summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/ChangeLog5
-rw-r--r--Build/source/texk/web2c/configure.ac2
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/luatexdir/Makefile.in50
-rw-r--r--Build/source/texk/web2c/luatexdir/NEWS2922
-rw-r--r--Build/source/texk/web2c/luatexdir/am/luatex.am426
-rw-r--r--Build/source/texk/web2c/luatexdir/avl.c893
-rw-r--r--Build/source/texk/web2c/luatexdir/commands.h550
-rw-r--r--Build/source/texk/web2c/luatexdir/depend.mk3
-rw-r--r--Build/source/texk/web2c/luatexdir/font/dofont.c275
-rw-r--r--Build/source/texk/web2c/luatexdir/font/luafont.c3445
-rw-r--r--Build/source/texk/web2c/luatexdir/font/luatexfont.h67
-rw-r--r--Build/source/texk/web2c/luatexdir/font/macnames.c33
-rw-r--r--Build/source/texk/web2c/luatexdir/font/mapfile.c302
-rw-r--r--Build/source/texk/web2c/luatexdir/font/pkin.c48
-rw-r--r--Build/source/texk/web2c/luatexdir/font/sfnt.c880
-rw-r--r--Build/source/texk/web2c/luatexdir/font/sfnt.h331
-rw-r--r--Build/source/texk/web2c/luatexdir/font/subfont.c226
-rw-r--r--Build/source/texk/web2c/luatexdir/font/texfont.c2373
-rw-r--r--Build/source/texk/web2c/luatexdir/font/texfont.h805
-rw-r--r--Build/source/texk/web2c/luatexdir/font/tfmofm.c1161
-rw-r--r--Build/source/texk/web2c/luatexdir/font/tounicode.c96
-rw-r--r--Build/source/texk/web2c/luatexdir/font/tt_glyf.c1123
-rw-r--r--Build/source/texk/web2c/luatexdir/font/tt_glyf.h97
-rw-r--r--Build/source/texk/web2c/luatexdir/font/tt_table.c787
-rw-r--r--Build/source/texk/web2c/luatexdir/font/tt_table.h310
-rw-r--r--Build/source/texk/web2c/luatexdir/font/vfovf.c2617
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writecff.c5359
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writecff.h461
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writeenc.c39
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writefont.c662
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writet3.c360
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writettf.c1116
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writettf.h212
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writetype0.c213
-rw-r--r--Build/source/texk/web2c/luatexdir/font/writetype2.c642
-rwxr-xr-xBuild/source/texk/web2c/luatexdir/get_svnversion.sh13
-rw-r--r--Build/source/texk/web2c/luatexdir/hyphen.h35
-rw-r--r--Build/source/texk/web2c/luatexdir/image/epdf.c42
-rw-r--r--Build/source/texk/web2c/luatexdir/image/epdf.h43
-rw-r--r--Build/source/texk/web2c/luatexdir/image/image.h81
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc333
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writeimg.c496
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writejbig2.c52
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writejbig2.h32
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writejpg.c36
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writepng.c129
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/hyphen.c48
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/texlang.c1498
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c863
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lfontlib.c378
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/limglib.c269
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lkpselib.c614
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/llanglib.c401
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/llualib.c486
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lmplib.c1273
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c4679
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/loslibext.c1168
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lpdflib.c42
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lstatslib.c383
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexiolib.c231
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltexlib.c2138
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/ltokenlib.c437
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luainit.c902
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luanode.c401
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luastuff.c616
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatex.c534
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatoken.c1072
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/texluac.c324
-rw-r--r--Build/source/texk/web2c/luatexdir/lua51/Makefile13
-rw-r--r--Build/source/texk/web2c/luatexdir/lua51/lcoco.c10
-rw-r--r--Build/source/texk/web2c/luatexdir/lua51/lcoco.h10
-rw-r--r--Build/source/texk/web2c/luatexdir/lua51/liolib.c29
-rw-r--r--Build/source/texk/web2c/luatexdir/lua51/lobject.c8
-rw-r--r--Build/source/texk/web2c/luatexdir/lua51/lstrlib.c30
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/Makefile50
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/Makefile.win25
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/README38
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/config44
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/config.win19
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html8
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html69
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html10
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html69
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c176
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def5
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h5
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua193
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/Makefile25
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Makefile112
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/Makefile15
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/descrip.mms27
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/VERSION1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/descrip.mms9
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/Makefile36
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/charview.c9513
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/contextchain.c3032
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/descrip.mms197
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/encoding.c3093
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontinfo.c10184
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontview.c11163
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fvfonts.c1911
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/kernclass.c3059
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lff.opt1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lookups.c6916
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/macbinary.c3212
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/namelist.c19852
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ofl.h7
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pfaeditui.h189
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/prefs.c2282
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinefill.c1864
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamp.c5
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamper.c20
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/start.c935
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stemdb.c2428
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottf.c5768
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfgpos.c3444
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfvar.c814
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ttfspecial.c1067
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/xlib.opt13
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontforge/src/ffdummies.c5552
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/ChangeLog (renamed from Build/source/texk/web2c/luatexdir/luafontforge/ChangeLog)0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/ff-config.in (renamed from Build/source/texk/web2c/luatexdir/luafontforge/ff-config.in)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/AUTHORS (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/AUTHORS)0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/INSTALL (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/INSTALL)0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/LICENSE (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/LICENSE)3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Makefile.in160
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ArabicForms.c260
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/Makefile.in36
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/alphabet.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/alphabet.c)0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/backtrns.c7434
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/char.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/char.c)23
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/cjk.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/cjk.c)38
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/combiners.h1014
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/dump.c994
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/gwwiconv.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/gwwiconv.c)20
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/memory.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/memory.c)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ucharmap.c675
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/unialt.c8885
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ustring.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/ustring.c)57
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/utype.c24588
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/VERSION1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure-options1
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure.in704
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/Makefile.in71
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/PfEd.h218
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/autohint.c)1505
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/baseviews.h541
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/clipnoui.c68
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/configure-pfaedit.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/configure-pfaedit.h)80
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/cvundoes.c134
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c221
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/edgelist.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/edgelist.h)9
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/edgelist2.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/edgelist2.h)7
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.c1152
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.h18
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/featurefile.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/featurefile.c)1815
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontforgevw.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/groups.h)27
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c286
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvcomposit.c160
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvfonts.c572
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libffstamp.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libstamp.pre103
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c4468
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c1201
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/macenc.c)1777
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mathconstants.c99
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c235
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.h32
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c19799
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c602
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/nouiutil.c203
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsepfa.c)170
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettf.c)1887
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettfatt.c)1209
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettfvar.c)19
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pfaedit.h)60
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/plugins.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/plugins.h)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psfont.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/psfont.h)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/psread.c)874
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pua.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pua.c)0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/python.c320
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/scripting.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/scripting.h)17
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sd.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/sd.h)37
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/scriptfuncs.h)31
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/sfd1.h)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c266
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c535
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c642
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinefont.h)1181
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineorder2.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineorder2.c)506
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineoverlap.c)169
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinerefigure.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinerefigure.c)32
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinesave.c)761
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesaveafm.c261
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinestroke.c)330
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineutil.c)2616
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineutil2.c)2078
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/start.c77
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/stemdb.c40
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/stemdb.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stemdb.h)123
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c2048
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c134
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfgpos.c366
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ttf.h)67
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttfspecial.c903
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/uiinterface.h511
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/unicoderange.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/unicoderange.h)11
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/views.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/views.h)855
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gdraw/Makefile.in0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/Makefile.in45
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/fsys.c487
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/gwwintl.c136
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/basics.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/basics.h)26
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/chardata.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/chardata.h)0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/charset.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/charset.h)4
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/config.h.in67
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/dynamic.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/dynamic.h)31
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/fileutil.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/fileutil.h)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gdraw.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gdraw.h)191
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gfile.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gfile.h)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/ggadget.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/ggadget.h)103
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gicons.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gicons.h)8
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gimage.h168
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gio.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gio.h)14
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gkeysym.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gkeysym.h)0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gprogress.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gprogress.h)4
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gresource.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gresource.h)2
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gwidget.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gwidget.h)11
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gwwiconv.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gwwiconv.h)3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/intl.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/intl.h)24
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/ustring.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/ustring.h)3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/utype.h (renamed from Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/utype.h)27
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/plugins/Makefile.in0
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c256
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c (renamed from Build/source/texk/web2c/luatexdir/luafontforge/src/luafflib.c)1026
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/Makefile19
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/clocks.c63
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/clocks.h20
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.c180
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.h31
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.c203
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.h64
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/lua50_profiler.c230
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/luaprofiler.h14
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/stack.c33
-rw-r--r--Build/source/texk/web2c/luatexdir/luaprofiler/stack.h44
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/LICENSE20
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/NEW14
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/README6
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/config60
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html132
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html289
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/http.html333
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/index.html208
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html163
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html333
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html430
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/luasocket.pngbin0 -> 11732 bytes
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html476
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css54
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html239
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html417
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html404
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html533
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html416
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/doc/url.html329
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/README89
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/b64.lua20
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/check-links.lua112
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/check-memory.lua17
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/dict.lua152
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/dispatch.lua302
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/eol.lua14
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/forward.lua65
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/get.lua142
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/lp.lua324
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/qp.lua24
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/etc/tftp.lua155
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/luasocket.sln37
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/makefile51
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/mime.vcproj141
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/README50
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua46
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/daytimeclnt.lua23
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/echoclnt.lua24
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/echosrvr.lua29
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/listener.lua26
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/lpr.lua51
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/talker.lua21
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/tinyirc.lua90
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/socket.vcproj182
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/Makefile63
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.c149
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.h48
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/buffer.c268
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/buffer.h47
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/except.c99
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/except.h35
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/ftp.lua281
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/ftp_lua.c470
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/http.lua350
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/http_lua.c623
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/inet.c285
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/inet.h42
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/io.c32
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/io.h67
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/ltn12.lua292
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/ltn12_lua.c422
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c73
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.c118
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.h32
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/mime.c711
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/mime.h31
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/mime.lua87
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/mime_lua.c135
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/options.c149
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/options.h39
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/select.c200
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/select.h17
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/smtp.lua251
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/smtp_lua.c412
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/socket.c5
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/socket.h76
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/socket.lua133
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/socket_lua.c217
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c339
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/tcp.h36
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/timeout.c207
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/timeout.h30
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/tp.lua123
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/tp_lua.c194
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/udp.c336
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/udp.h33
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/unix.c356
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/unix.h28
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/url.lua297
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/url_lua.c540
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/usocket.c377
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/usocket.h40
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.c401
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.h21
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/test/README12
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/test/testclnt.lua713
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/test/testsrvr.lua15
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/test/testsupport.lua37
-rw-r--r--Build/source/texk/web2c/luatexdir/luatangle.ch9
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex-api.h138
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.ch516
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.defines394
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.h139
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.mk25
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.web11219
-rw-r--r--Build/source/texk/web2c/luatexdir/luatexextra.in38
-rw-r--r--Build/source/texk/web2c/luatexdir/luatexlib.mk56
-rw-r--r--Build/source/texk/web2c/luatexdir/luazlib/lzlib.c25
-rw-r--r--Build/source/texk/web2c/luatexdir/macnames.c312
-rw-r--r--Build/source/texk/web2c/luatexdir/makecpool.c93
-rw-r--r--Build/source/texk/web2c/luatexdir/managed-sa.c458
-rw-r--r--Build/source/texk/web2c/luatexdir/managed-sa.h98
-rw-r--r--Build/source/texk/web2c/luatexdir/mathcodes.c586
-rw-r--r--Build/source/texk/web2c/luatexdir/mp/avl.c792
-rw-r--r--Build/source/texk/web2c/luatexdir/mp/avl.h118
-rw-r--r--Build/source/texk/web2c/luatexdir/mp/lmplib.c1238
-rw-r--r--Build/source/texk/web2c/luatexdir/mp/memio.w405
-rw-r--r--Build/source/texk/web2c/luatexdir/mp/mp.w (renamed from Build/source/texk/web2c/luatexdir/lua/mp.w)8526
-rw-r--r--Build/source/texk/web2c/luatexdir/mp/psout.w (renamed from Build/source/texk/web2c/luatexdir/lua/psout.w)1113
-rw-r--r--Build/source/texk/web2c/luatexdir/mp/tfmin.w242
-rw-r--r--Build/source/texk/web2c/luatexdir/nodes.h1156
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pagetree.c268
-rw-r--r--Build/source/texk/web2c/luatexdir/pdf/pdfpage.c565
-rw-r--r--Build/source/texk/web2c/luatexdir/pdftosrc.1219
-rw-r--r--Build/source/texk/web2c/luatexdir/pdftosrc.cc178
-rw-r--r--Build/source/texk/web2c/luatexdir/pdftosrc.rc35
-rw-r--r--Build/source/texk/web2c/luatexdir/primitive.h82
-rw-r--r--Build/source/texk/web2c/luatexdir/ptexlib.h359
-rw-r--r--Build/source/texk/web2c/luatexdir/ptexmac.h46
-rw-r--r--Build/source/texk/web2c/luatexdir/slnunicode/slnunico.c5
-rw-r--r--Build/source/texk/web2c/luatexdir/svnversion.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/filename.c339
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/linebreak.c62
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/math.c2255
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.c3864
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/postlinebreak.c50
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/primitive.c668
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texdeffont.c189
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.c1271
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texpdf.c26
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.c659
-rw-r--r--Build/source/texk/web2c/luatexdir/texmath.h316
-rw-r--r--Build/source/texk/web2c/luatexdir/textcodes.c452
-rw-r--r--Build/source/texk/web2c/luatexdir/tokens.h96
-rw-r--r--Build/source/texk/web2c/luatexdir/ttf2afm.c1053
-rw-r--r--Build/source/texk/web2c/luatexdir/ttf2afm.rc35
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/avl.c794
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/avl.h115
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/avlstuff.c (renamed from Build/source/texk/web2c/luatexdir/avlstuff.c)90
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/avlstuff.h (renamed from Build/source/texk/web2c/luatexdir/avlstuff.h)10
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/synctex.c1493
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/synctex.h113
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/utils.c (renamed from Build/source/texk/web2c/luatexdir/utils.c)1014
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/writezip.c (renamed from Build/source/texk/web2c/luatexdir/writezip.c)41
403 files changed, 163210 insertions, 148178 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 52f0df90d0d..23b1a80fa19 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-27 Taco Hoekwater <taco@luatex.org>
+
+ * configure.ac: With the new luatex, what used to be
+ luatexdir/luafontforge/ is now luatexdir/luafontloader/.
+
2009-03-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* texmfmp-help.h [eTeX,TeX]: Document -synctex switch.
diff --git a/Build/source/texk/web2c/configure.ac b/Build/source/texk/web2c/configure.ac
index 96459d1387d..07da4331be8 100644
--- a/Build/source/texk/web2c/configure.ac
+++ b/Build/source/texk/web2c/configure.ac
@@ -221,7 +221,7 @@ AM_CONDITIONAL([WIN32], [test "x$kpse_cv_have_win32" != xno])
AM_CONDITIONAL([MINGW32], [test "x$kpse_cv_have_win32" = xmingw32])
AS_IF([test "x$enable_luatex" = xyes],
-[AC_CONFIG_HEADERS([ff-config.h:luatexdir/luafontforge/ff-config.in])
+[AC_CONFIG_HEADERS([ff-config.h:luatexdir/luafontloader/ff-config.in])
AC_CHECK_HEADERS([langinfo_h])
AC_TYPE_LONG_DOUBLE
AC_TYPE_LONG_LONG_INT
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 3b38d7fd37d..efaac4a9191 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-27 Taco Hoekwater <taco@luatex.org>
+
+ * luatexdir: import of the current state of luatex, 0.37.0.
+ This affects many files in subdirectories.
+
2009-03-05 Peter Breitenlohner <peb@mppmu.mpg.de>
* image/pdftoepdf.cc: Uninclude <config.h>, included later
diff --git a/Build/source/texk/web2c/luatexdir/Makefile.in b/Build/source/texk/web2c/luatexdir/Makefile.in
index 43f433fd8b8..9d888766d18 100644
--- a/Build/source/texk/web2c/luatexdir/Makefile.in
+++ b/Build/source/texk/web2c/luatexdir/Makefile.in
@@ -1,4 +1,5 @@
# Makefile for luatex.
+# Public domain.
# $Id$
kpse_include ../make/common.mk
@@ -8,7 +9,14 @@ kpse_include ../make/library.mk
kpathsea_srcdir_parent = $(srcdir)/../..
kpathsea_dir_parent = ../..
-ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) @LIBXPDFCPPFLAGS@ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/.. -I$(LIBPNGSRCDIR) -I$(ZLIBSRCDIR)
+ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) \
+ -I. -I$(srcdir) \
+ -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) \
+ @LIBXPDFCPPFLAGS@ \
+ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. \
+ -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/.. \
+ -I$(LIBPNGSRCDIR) -I$(ZLIBSRCDIR) \
+ -DPDF_PARSER_ONLY -DDISABLE_OUTLINE -I../../../../src/libs/obsdcompat
CXX = @CXX@
CTANGLE = ../ctangle
@@ -32,18 +40,16 @@ LIBMD5DIR=../../../libs/md5
LIBMD5SRCDIR=$(srcdir)/$(LIBMD5DIR)
LIBOBSDCOMPATDIR=../../../libs/obsdcompat
-LIBOBSDCOMPATFSRCDIR=$(srcdir)/$(LIBOBSDCOMPATDIR)
+LIBOBSDCOMPATSRCDIR=$(srcdir)/$(LIBOBSDCOMPATDIR)
XCPPFLAGS=-I.. -I$(srcdir)/.. -I../.. -I$(srcdir)/../.. -I$(LIBMD5DIR) \
-I$(LIBMD5SRCDIR) @LIBPNGCPPFLAGS@ @ZLIBCPPFLAGS@ \
-I$(LIBXPDFDIR) -I$(LIBXPDFDIR)/.. -I$(LIBXPDFSRCDIR) -I$(LIBXPDFSRCDIR)/.. \
- -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) \
- -I$(LIBOBSDCOMPATFSRCDIR)/.. -DpdfTeX
+ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATSRCDIR) \
+ -I$(LIBOBSDCOMPATSRCDIR)/.. -DpdfTeX
OBJS = \
-avl.o \
-avlstuff.o \
font/mapfile.o \
font/pkin.o \
font/subfont.o \
@@ -90,47 +96,51 @@ lua/luatoken.o \
lua/luanode.o \
lua/llanglib.o \
lua/limglib.o \
-lua/mp.o \
-lua/psout.o \
-lua/lmplib.o \
lang/hnjalloc.o \
lang/hyphen.o \
lang/texlang.o \
+pdf/pdfpage.o \
+pdf/pagetree.o \
tex/linebreak.o \
tex/postlinebreak.o \
tex/texnodes.o \
tex/textoken.o \
tex/texpdf.o \
+tex/math.o \
+tex/mlist.o \
+tex/primitive.o \
+tex/texdeffont.o \
+tex/filename.o \
managed-sa.o \
mathcodes.o \
textcodes.o \
-utils.o \
-writezip.o
+utils/avl.o \
+utils/avlstuff.o \
+utils/utils.o \
+utils/writezip.o \
+utils/synctex.o
-all: libpdf.a $(makecpool)
+all: libpdf.a makecpool
-libpdf.a: lua/mp.c lua/psout.c $(OBJS)
+libpdf.a: $(OBJS)
rm -f $@
$(AR) $(ARFLAGS) $@ $(OBJS)
$(RANLIB) $@
-lua/mp.c: lua/mp.w
- $(CTANGLE) $(srcdir)/lua/mp.w - lua/mp.c
-
-lua/psout.c: lua/psout.w
- $(CTANGLE) $(srcdir)/lua/psout.w - lua/psout.c
+makecpool: makecpool.o
+ $(link_command) makecpool.o
kpse_include ../make/clean.mk
clean::
- rm -f libpdf.a ttf2afm pdftosrc
+ rm -f libpdf.a
depend:
rm -f $(OBJS) $(srcdir)/depend.mk
for a in $(OBJS); do \
env XXCFLAGS="-MM -MT \$$@" XCFLAGS="-MM -MT \$$@" $(MAKE) -k $$a; \
touch $$a; \
- grep -a -v "^$(CC)\|$(CXX)\|$(AR)\|make\|klibtool" $$a | \
+ grep -a -v "^$(CC)\|$(CXX)\|$(AR)\|make" $$a | \
sed 's: [^ ]*/\.\./libs/[^ ]*::g' >> $(srcdir)/depend.mk; \
done; \
rm -f $(OBJS)
diff --git a/Build/source/texk/web2c/luatexdir/NEWS b/Build/source/texk/web2c/luatexdir/NEWS
index 626b5c95a0b..9f151037197 100644
--- a/Build/source/texk/web2c/luatexdir/NEWS
+++ b/Build/source/texk/web2c/luatexdir/NEWS
@@ -1,537 +1,2385 @@
----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-beta-20060811 was released on 2006-08-11
----------------------------------------------------------------
-- renamed primitives:
- \primitive -> \pdfprimitive
- \ifprimitive -> \ifpdfprimitive
- \ifabsdim -> \ifpdfabsdim
- \ifabsnum -> \ifpdfabsnum
-- new version of \primitive/\ifprimitive (but see above)
-- new dimen: \pdfpxdimen
-- support for jbig2 files
-- new library: obsdcompat, which has improved string functions and allows the
- use of __attribute__
-- update libpng to 1.2.12
-- added JFIF detection patch to writejpg.c (was bug 548)
-- bugfix: truetype OS/2 v3 fonts (594)
-- bugfix: file with only \immediate\pdfobj stream results in garbage (505)
-- bugfix: invalid pdf created if font name contains space (509)
-
----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-beta-20060725 was released on 2006-07-25
----------------------------------------------------------------
-- added patches by Christian Schenk forwarded by Hartmut
-- added patch 421 (popen) from Taco
-- added lots of (void) to writettf* and ttf2afm to silence the compiler
-- removed some unused variables from tounicode.c
-- add new code by Thanh (patch 580)
-- added security patch for xpdf :-(
-- added JFIF detection patch to writejpg.c (bug 548)
-
----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-beta-20060213 was released on 2006-02-13
----------------------------------------------------------------
-- pdftex.web has been improved a bit
-- new patch:
- - 473 \ifabsnum and \ifabsdim
-- the manual has been updated a bit and is again included
-
----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-beta-20060125 was released on 2006-01-25
----------------------------------------------------------------
-- pdfTeX now includes pdfeTeX, i.e. there is no way to make a binary without
- eTeX support. Also the sources of TeX, eTeX and pdfTeX have been merged into
- one file pdftex.web
-- most pdfTeX change files are gone; only one file (pdftex.ch) remains.
-- improved patches:
- - 393 Ensure newline before endstream
-
----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-beta-20060117 was released on 2006-01-17
----------------------------------------------------------------
-- pdfTeX is now pdfeTeX, i.e. there is no way to make a binary without eTeX
- support. Also the sources of TeX, eTeX and pdfTeX have been merged into one
- file pdfetex.web
-- strip trailing zeros in fractions of reals written
-- removed patch 467 \ifindef
-- improved logging of objstreams
-
-----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-alpha-20060111 was released on 2006-01-11
-----------------------------------------------------------------
-- new patches:
- - 466 \primitive and \ifprimitive
- - 467 \ifinedef
-- improved patches:
- - 393 Ensure newline before endstream
-- pdfTeX now sets /ModDate and /Trapped by default (the values can be
- overridden with /pdfinfo)
-- more fixes to remove warnings from -Wall
-
-----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-alpha-20060106 was released on 2006-01-06
-----------------------------------------------------------------
-- many small fixes to remove warnings from -Wall
-- removed some unused variables
-- really fix bug 444
-- add some GCC extensions and use *nprintf instead of *printf where possible
-- fixed a unicode bug in ttf2afm
-
-----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-alpha-20051226 was released on 2005-12-26
-----------------------------------------------------------------
-- improved patches:
- - 453 Object Streams for PDF-1.5
- - take PK resolution from "pk_dpi" parameter in texmf.cnf, if it has not
- been set by the format file or by the user
- - 432 Rules in a PDF qQ group
-- some fixes for Thanhs patch
-- some improvements from -Wall
-- .indent.pro for indent
-
-----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-alpha-20051221 was released on 2005-12-21
-----------------------------------------------------------------
-- has a large patch from Thanh
-- pdflastlink has been fixed
-- remove generated pdf in case of fatal error
-
-----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-alpha-20051208 was released on 2005-12-08
-----------------------------------------------------------------
-- improved patches:
- - 386 grow obj_tab and dest_names arrays dynamically
- - 453 Object Streams for PDF-1.5
- - take PK resolution from "pk_dpi" parameter in texmf.cnf, if it has not
- been set by the format file or by the user
-- write out PDF statistics later to make them correct
-- makefile target pdfetex-all.pdf for a huge file
-
-----------------------------------------------------------------
-pdfTeX 3.141592-1.40.0-alpha-20051205 was released on 2005-12-05
-----------------------------------------------------------------
-- has these patches:
- - 386 grow obj_tab and dest_names arrays dynamically
- - 416 new primitive pdflastlink
- - 427 Character positioning patch
- - 432 Rules in a PDF qQ group
- - 434 Remove queued map item handling
- - 438 \pdfsavepos in DVI mode
- - 443 512 zeros in Type1 fonts not copied anymore
- - 447 Don't write /Encoding for non-reencoded fonts
- - 453 Object Streams for PDF-1.5
- - take PK resolution from "pk_dpi" parameter in texmf.cnf, if it has not
- been set by the format file or by the user
-
--------------------------------------------------
-pdfTeX 3.141592-1.30.6 was released on 2006-02-16
--------------------------------------------------
-- bugfix: updated xpdf to 3.01pl2
-
--------------------------------------------------
-pdfTeX 3.141592-1.30.5 was released on 2005-12-04
--------------------------------------------------
-- bugfix: \pdfximage prints the file name twice (bug 441)
-- bugfix: buffer overflow with \pdfmatch (bug 444)
-- bugfix: updated xpdf to 3.01pl1
-
--------------------------------------------------
-pdfTeX 3.141592-1.30.4 was released on 2005-10-17
--------------------------------------------------
-- bugfix: whitespaces in filenames didn't work on Unix anymore (bug 377)
-- bugfix: two \immediates cancel themselves (bug 437)
-- bugfix: wrong file name in error messages of image inclusion (bug 435)
-
--------------------------------------------------
-pdfTeX 3.141592-1.30.3 was released on 2005-09-04
--------------------------------------------------
-- bugfix: \write18
-
--------------------------------------------------
-pdfTeX 3.141592-1.30.2 was released on 2005-08-25
--------------------------------------------------
-- fixed some build problems and minor bugs introduced in 1.30.1
-
--------------------------------------------------
-pdfTeX 3.141592-1.30.1 was released on 2005-08-21
--------------------------------------------------
-- the eTeX extensions can now be enabled with the cmdline switch -etex
-- pdfTeX uses xpdf 3.01
-
--------------------------------------------------
-pdfTeX 3.141592-1.30.0 was released on 2005-08-01
--------------------------------------------------
-- pdfxtex (introduced with 1.20a) is gone; all extensions are now in pdf(e)tex.
-- Some primitives have been renamed; the old names will still work, but are
- deprecated and some give a warning that they are obsolete:
- \pdfoptionpdfminorversion -> \pdfminorversion
- \pdfoptionalwaysusepdfpagebox -> \pdfforcepagebox
- \pdfoptionpdfinclusionerrorlevel -> \pdfinclusionerrorlevel
-- pdftex knows two new units:
- - new Didot (1nd=0.375mm)
- - new Cicero (1nc=12nd)
-- New primitives:
- - Inclusion of pngs has been greatly improved: It now does
- - alpha channel and transparency (only if %!PDF >=1.4)
- - 16-bit colour (only if %!PDF >=1.5); this must be enabled by setting
- \pdfimagehicolor to 1.
- - gamma correction; this must be enabled by setting \pdfimageapplygamma to
- 1. The device gamma is taken from \pdfgamma. If no embedded value can be
- found in the png image, then the value of \pdfimagegamma is used instead.
- - fast direct embedding of png streams, if their structure allows this; the
- automatic fall-back is to decompress and re-compress as before.
- - pdfTeX now has an interface to the precise system time (if available) as an
- aid in benchmarking TeX macro code.
- - \pdfelapsedtime is a read-only integer that (initially) returns the
- amount of time passed since the start of this run. This amount is given
- in `scaled seconds': the value 65536 counts as one second. If more time
- has passed than 32767 seconds, (2^31)-1 will be returned.
- - \pdfresettimer updates the internal timer, such that subsequent calls to
- \pdfelapsedtime will restart from 0.
- - pdfTeX can now generate random numbers:
- - \pdfuniformdeviate <count> generates a uniformly distributed random
- integer value between 0 (inclusive) and <count> (exclusive).
- - \pdfnormaldeviate expands to a random integer value with a mean of 0 and
- a unit of 65536.
- - \pdfrandomseed allows access to the current seed value.
- - \pdfsetrandomseed <count> sets the random seed to a specific value.
- - \pdfnoligatures\f disables ligatures for the loaded font \f.
- - Escaping strings:
- - \pdfescapestring{<a>} escapes the string <a> so that it can be used as
- PDF string.
- - \pdfescapename{<a>} escapes the string <a> so that it can be used as PDF
- name.
- - \pdfescapehex{<a>} converts the string <a> to uppercase hexadecimal
- representation.
- - \pdfunescapehex{<b>} reverses the effect of \pdfescapehex
- - \pdfcreationdate expands to the date string that pdfTeX uses in the info
- dict as default.
- - \pdffilemoddate{<file>} expands to the modification date of <file> in the
- same format as \pdfcreationdate (PDF date format).
- - \pdffilesize{<file>} expands to the size of <file> as string.
- - \pdfmdfivesum{<abc>} or \pdfmdfivesum file {<file>} calculates the md5
- sum (of a string or a file) and converts it to uppercase hexadecimal format
- (same as \pdfescapehex).
- - \pdffiledump [offset <int>] [length <int>] <general text>
- Expands to a hex dump of the file given in <general text>, starting at
- given offset or 0 with given length.
- - \pdfshellescape is a read-only integer that is 1 if \write18 is enabled, 0
- otherwise.
- - \pdfxformname <object number>, which expands to the number in the
- corresponding form XObject name.
- - \leftmarginkern <box number> and \rightmarginkern <box number> tell the
- margin kern at the left and right side of the horizontal list stored in box
- <box number>.
- - \pdfpkmode is a token register that sets the MF mode for pixel font
- generation. The contents of this register is dumped into the format, so one
- can (optionally) preset it e.g. in part of pdftexconfig.tex.
- - \pdftracingfonts: An integer variable controlling the tracing of font
- expansion. It is zero by default; then we get a log (with fontexpansion)
- like this
- ...\tenrm t
- ...\tenrm (+20) e
- Without font expansion, this default should be compatible with TeX's
- original log output.
- If \pdftracingfonts is set to 1 (or greater), we get a more verbose log:
- ...\xivtt (cmtt10@14.0pt) t
- ...\xivtt (cmtt10+20@14.0pt) e
- See also bug 304.
-- New experimental primitives:
- - \pdfmatch [icase] [subcount <number>}] {<pattern>}{<string>}
- Implements pattern matching using the POSIX regex.
- It returns the same values as \pdfstrcmp, but with the following semantics:
- -1: error case (invalid pattern, ...)
- 0: no match
- 1: match found
- Options:
- * icase: case insensitive matching
- * subcount: it sets the table size for found subpatterns.
- A number "-1" resets the table size to the start default.
- - \pdflastmatch <number>
- The result of \pdfmatch is stored in an array. The entry "0" contains the
- match, the following entries submatches. The positions of the matches are
- also available. They are encoded:
- <position> "->" <match string>
- The position "-1" with an empty string indicates that this entry is not
- set.
- - \pdfstrcmp{<a>}{<b>} compares two strings and returns the strings "0" if
- <a> equals <b>, "-1" if <a> is less than <b>, "1" if <a> is greater than
- <b>
-- The primitive \pdfmovechars has been removed (bug 294)
-- Bugfixes:
- - empty strings are not supressed anymore (bug 335)
- - \unhboxing and character protusion didn't work well together (bug 292)
- - --jobname didn't work if there was no filename at all (bug 302)
- - Some problem with fonts on solaris (bug 315)
- - Dangling font objects with non-replacable fonts (bug 311).
- - \pdfxform didn't work with box>255 (bug 310)
- - cmap: unicode ???? is mapped to multiple glyphs (bug 306).
-- pdfTeX uses zlib 1.2.3
-
-------------------------------------------------
-pdfTeX 3.141592-1.21a was released on 2005-02-04
-------------------------------------------------
-- ttf2afm 1.0:
- - added support for refering to glyphs via unicode in encoding files (ie 'uniXXX')
- - added some more info to the AFM output
- - some minor bug fixes
- - a short documentation available
-- pdftex now understand forms 'uniXXXX' in encoding files (only makes sense
- with TrueType fonts)
-- added subset tag for TrueType fonts
-- PDF strings are now printed as following:
- (This is a string) -> (This is a string)
- This is a string -> (This is a string)
- <a1b245c1a2...> -> <a1b245c1a2...>
-- check for double newline char to get rid of empty lines in PDF output
-- Fixed a bug in the scanning of map lines introduced in the fix of bug #242 in
- 1.20b.
-- Fixed three problems in xpdf; xpdf is now 3.00pl3
-- \ifeof18 is a simple method to test if \write18 is enabled.
-- a few extensions in pdfxtex:
- - \pdflastximagecolordepth returns the last color depth
- - \pdfximage supports a keyword "colorspace" following an object number
- representing a ColorSpace object
- - \pdfstrcmp compares two strings
- - \pdfescapestring/\pdflastescapedstring provide a way to escape string
- - \pdffirstlineheight/\pdflastlinedepth/\pdfeachlineheight/\pdfeachlinedepth
- allow fixing line dimen
- - patches from Taco
- - px dimen unit
- - tagcode patch
- - quitvmode patch
-
-------------------------------------------------
-pdfTeX 3.141592-1.20b was released on 2004-12-22
-------------------------------------------------
-- Fixed some minor bugs, mostly with hz
-- The info line "output format initialized to PDF/DVI" isn't shown anymore, as
- this info wasn't reliable (bug 112).
-- Now the PDF-related statistics (PDF objects...) in the .log file is only
- shown in PDF output mode. It start with a line "PDF statistics:".
-- \pdfimageresolution is not limited to 2400 [dpi] anymore, can now be between
- 0 and 65535 [dpi].
-- pdfTeX uses xpdf 3.00pl2
-- pdfTeX uses libpng 1.2.8, which fixes some png-related bugs.
-
-------------------------------------------------
-pdfTeX 3.141592-1.20a was released on 2004-09-06
-------------------------------------------------
-- There is a new program pdfxtex, which contains experimental features which
- might end up in pdftex in the future.
-- Most distributions now use eTeX as the default engine, so when you call
- pdftex you will get pdfeTeX. Most distributions now also use pdfTeX as the
- default engine, so when you call latex you will get pdfeTeX running LaTeX.:-)
-- We are setting up pdfTeX as a project at sarovar
- (http://sarovar.org/projects/pdftex/). Please report bugs etc. through the
- site.
-- Support for the file pdftex.cfg is gone completely. All parameters that had
- previously been set by it can be set through primitives; their values are
- dumped to the format file.
-- The searchpath for encoding and mapfiles has been changed.
- See http://tug.org/pipermail/tex-live/2004-January/004734.html and
- http://tug.org/pipermail/tex-live/2004-January/004791.html
-- eTeX is now version 2.2, incorporating the last changes to TeX (3.141592).
-- New options for \pdfmapfile:
- General functionality: Map items (map files, new: also single map lines; see
- \pdfmapline) are put in list of pending map items. During the next shipout,
- pending map items are sequentially scanned for their map entries, and an
- internal map entry database is updated, using the modes below. Then the list
- of pending map items is cleared. Map entries of fonts already in use are left
- untouched. New: All \pdfmapfile and \pdfmapline commands can also be given
- after shipout of the first page.
- - \pdfmapfile {foo.map} clears the list of pending map items and starts a new
- list with the only pending file foo.map. When the map entry lines of
- foo.map are scanned, duplicate map entries are ignored and a warning is
- issued. This is the old behaviour.
- - \pdfmapfile {+foo.map} puts foo.map in the list of pending map items. When
- the map entry lines of foo.map are scanned, duplicate map entries are
- ignored and a warning is issued.
- - \pdfmapfile {=foo.map} puts foo.map in the list of pending map items. When
- foo.map is scanned, matching map entries in database are replaced by new
- entries from foo.map.
- - \pdfmapfile {-foo.map} puts foo.map in the list of pending map items. When
- foo.map is scanned, matching map entries are deleted from database.
- - \pdfmapfile {} clears the list of pending map items. It does not affect map
- entries already registered into the database. This is the old behaviour.
-- New command \pdfmapline {line}. It's like \pdfmapfile but here you can set
- single map lines like in the map files directly. The modifiers (+-=) have the
- same effect as with \pdfmapfile.
-- Simplified the handling of the 14 Type 1 "standard fonts" (Times,
- Helvetica...): They are now more or less handled like any other Type 1 font.
- See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000648.html
-- hz: So far the font expansion feature required that the user must be able to
- create expanded tfms (eg cmr10+10.tfm). Now font expansion can be used
- without creating these tfms.
- See http://www.ntg.nl/pipermail/ntg-pdftex/2004-May/000504.html
-- hz: Changed \pdffontexpand primitive --> the expand factor is now fixed to
- 1000 and the argument is ignored. This will lead to spurious texts of "1000"
- in your output if you compile old documents.
-- New command \pdftexbanner which returns a string with the full banner of the
- current binary (e.g. "This is pdfTeX, Version 3.141592-1.20a (Web2C 7.5.3)
- kpathsea version 3.5.3")
-- The PTEX.FullBanner key is now inserted in the document info dict instead of
- the catalog. Newer versions of Acrobat display it.
-- Now includes support for encTeX.
-- Extended \pdfannot to use reserveobjnum/useobjnum
- See http://www.ntg.nl/pipermail/ntg-pdftex/2004-March/000424.html
-- Bugfix: pdfTeX would read an .xpdfrc when including pdfs.
- See http://tug.org/pipermail/pdftex/2004-March/004835.html
-- Bugfix: The strings in /ID would sometimes be empty.
-- Bugfix: Even when mapfiles or encodings or PostScript font files were
- missing, pdfTeX still produced a (most often corrupt) pdf. Now it aborts with
- an error in these cases.
-- numerous small bugfixes.
-- pdfTeX now uses the GNU libavl from Ben Pfaff for managing of fontmap
- entries.
-- pdfTeX uses zlib 1.2.1
-- pdfTeX uses xpdf 3.00
-- pdfTeX uses libpng 1.2.7
-
-------------------------------------------------
-pdfTeX 3.141592-1.11b was released on 2003-10-06
-------------------------------------------------
-- Bugfix: The handling of /Rotate produced displaced images when /Rotate was 90
- or 270.
-
-------------------------------------------------
-pdfTeX 3.141592-1.11a was released on 2003-08-02
-------------------------------------------------
-- New command \pdftrailer analogue to \pdfcatalog whose argument ends up in the
- trailer dictionary.
-- The behaviour when an included pdf has a newer version than the one specified
- with \pdfoptionpdfminorversion can be controlled by the new internal integer
- \pdfoptionpdfinclusionerrorlevel: If it's 0, pdfTeX gives only a warning; if
- it's 1, it raises an error.
- This can also be set in pdftex.cfg with pdf_inclusion_errorlevel
-- The syntax for outlines has been extended to allow attributes:
- <outline spec> --> <attr spec> <action spec> [count <number>] <general text>
- See http://www.ntg.nl/pipermail/ntg-pdftex/2003-June/000165.html
-- The syntax of \pdfobj has been extended:
- \pdfobj <object type spec> (h, v, m)
- <object type spec> --> reserveobjnum
- | [useobjnum <number>] [<attr spec>] [stream [<attr spec>]] <object contents>
- <object contents> --> <file spec>
- | <general text>
- When the optional keyword `reserveobjnum' and `useobjnum' is not given, the
- behaviour is unchanged.
- See also http://tug.org/mailman/htdig/pdftex/2003-March/003814.html
-- Bugfix: /CreationDate didn't care for the timezone and could be fooled.
- See http://www.ntg.nl/pipermail/ntg-pdftex/2003-July/000223.html
-- Bugfix: The translation of 8-bit characters in included pdfs that had their
- eighth bit set sometimes got wrong because of a missing typecast.
- See http://www.ntg.nl/pipermail/ntg-pdftex/2003-July/000216.html
-- Bugfix: pdfTeX -ini would crash with a minimal file because it didn't read
- it's config and so didn't know anything about fonts.
- See http://tug.org/pipermail/pdftex/2003-July/004262.html
-- Bugfix: \pdfstartlink would produce spurious /NewWindow entries. Also the
- syntax of <action spec> and <goto-action spec> has been cleaned up.
- See http://www.ntg.nl/pipermail/ntg-pdftex/2003-June/000167.html
-- Bugfix: \pdffontattr was not used for T3 fonts.
- See http://tug.org/pipermail/pdftex/2003-June/004127.html
-- Bugfix: The cropbox of an included pdf would sometimes not be used.
- See http://tug.org/pipermail/pdftex/2003-May/004037.html
-- pdfTeX uses xpdf 2.02
-
-------------------------------------------------
-pdfTeX 3.141592-1.10b was released on 2003-02-26
-------------------------------------------------
-- The numbers in transformation matrices are allways written with maximum
- precision (see http://tug.org/pipermail/pdftex/2003-February/003596.html).
-- Incorporated the new version of TeX: 3.141592
-- Bugfix: Numbers in pdfs would sometimes be just a wee bit of (changed
- implementation of pdftoepdf.convertNumToPDF).
-- Bugfix: When setting the /Producer, /Creator or /CreationDate keys with
- /pdfinfo pdfTeX would also insert default values which caused duplicate keys
- in the info dict (see
- http://tug.org/pipermail/pdftex/2003-February/003524.html).
-- The reading of mapfiles is much faster (see
- http://tug.org/pipermail/pdftex/2002-July/002843.html).
-- Bugfix: AR5 had problems with the CTM when displaying in "fit visible" mode
- (see http://tug.org/pipermail/pdftex/2002-May/002688.html).
-- Bugfix: str_in_str had wrong indices (see
- http://tug.org/pipermail/pdftex/2002-March/002367.html).
-- Bugfix: decimal_digits defaulted to 0, which caused problems with included
- images when including pdfs (see
- http://tug.org/pipermail/pdftex/2003-February/003518.html).
- It now defaults to 4.
-- Bugfix: the type of included images was decided based only on the extensions;
- now pdfTeX looks for magic bytes at the start of files (see
- http://tug.org/pipermail/pdftex/2003-February/003519.html)
-
------------------------------------------------
-pdfTeX 3.14159-1.10a was released on 2003-01-16
------------------------------------------------
-- pdfTeX is now able to produce pdf1.4 (which is also the default) and has
- almost complete support for including pdf1.4 files:
- - Additional attributes like MetaData are copied from included pdfs.
- - Currently the Page Group attribute (see sections 7.3.6 and 7.5.5 of the pdf
- 1.4 reference) of included pdfs is NOT copied (as we don't know how to
- handle this when imposing pdfs).
- This means including pdfs with transparency features will work as long as
- the included pdf doesn't use Page Groups; if it does, the result might not
- be what is expected (One application known to use Page Groups is Adobe
- Illustrator v9++). The distributed pdfTeX binaries will give a warning
- about any occurance of a Page Group in an included pdf and ignore the Page
- Group (thus producing syntactically correct pdfs but probably not the
- intended output).
- Acrobat 5++ and newer versions of Jaws display files without Page Groups
- correctly, so this might not really be a problem.
- See pdftoepdf.cc for preprocessor flags which allow this behaviour to be
- changed (copying the Page Group (most likely producing incorrect pdf) or
- treating Page Groups as errors).
-- The new primitive \pdfoptionpdfminorversion sets the pdf version of the
- generated file and the latest allowed pdf version of included pdfs:
- \pdfoptionpdfminorversion=3
- tells pdfTeX to set the pdf version to 1.3 and allows only included pdfs with
- versions <= 1.3 .
- The default for \pdfoptionpdfminorversion is 4 for pdf 1.4
- This must appear before any data is written to the generated pdf file, so
- you should put it at the very start of your files.
- This can also be set in pdftex.cfg with pdf_minorversion
-- It is now possible to specify the pdf page box to use when including pdfs.
- The syntax has been extended:
- \pdfximage [<image attr spec>] <general text> (h, v, m)
- <image attr spec> --> [<rule spec>] [<attr spec>] [<page spec>] [<pdf box spec>]
- <pdf box spec> --> mediabox|cropbox|bleedbox|trimbox|artbox
- The default is cropbox (which defaults to mediabox), to be compatible with
- previous versions of pdfTeX.
- The page box specified at \pdfximage can be globally overridden with the
- config parameter always_use_pdfpagebox and the command
- \pdfoptionalwaysusepdfpagebox <integer>, where 0 is the default (use whatever
- is specified with \pdfximage), 1 is media, 2 is crop, 3 is bleed, 4 is trim
- and 5 is artbox. This can only be set once per object, i.e. the value used at
- \pdfximage is remembered.
- See the pdf reference for an explanation of the boxes.
-- The support for the inclusion of jpeg images has been extended to allow the
- inclusion of JPEG/Exif files which are produced by digital photo cameras
- (thanks to Hartmut Henkel).
-- The support for the inclusion of tif images has been removed as it was of
- limited use (it worked only for gray-scale and rgb images) and produced wrong
- results (all other images types where treated as rgb images).
- Tif images can be converted on *nix on-the-fly to pngs with the help of
- ImageMagick, epstopdf.sty or pdftex.def v0.4 or newer, and this rule:
- \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `basename #1 .tif`.png}
-- The extensions for pdf encryption have been removed, since they make the
- pdfTeX code overly complex. Those needing pdf encryption are encouraged to
- produce a standalone program for encrypting pdfs.
-- pdfTeX now writes a usage statistic about the pdfTeX specific memory to the
- log.
-- numerous bugfixes, most of them in the inclusion of pdfs.
-- pdfTeX uses xpdf 2.01
-- pdfTeX uses libpng 1.2.5
-
----------------------------------------------------------------------
-pdfTeX 3.14159-1.00a-pretest-20011127-ojmw was released on 2002-01-29
----------------------------------------------------------------------
-
-----------------------------------------------------------------
-pdfTeX 3.14159-1.00a-pretest-20010806 was released on 2001-08-06
-----------------------------------------------------------------
-
-----------------------------------------------------------------
-pdfTeX 3.14159-1.00a-pretest-20010804 was released on 2001-08-04
-----------------------------------------------------------------
-
-$Id$
-// vim: tw=79:ts=2:expandtab:autoindent
+==============================================================
+Luatex beta-0.36.0 was released 20090323
+==============================================================
+
+* The included fontforge code is stripped considerably, and
+ the lua table to access the code is renamed to 'fontloader'.
+ The old name ('fontforge') will remain present for a while,
+ but will eventually go away.
+
+* New lua functions: tex.primitives(), tex.extraprimitives,
+ tex.enableprimitives(). This is a prelude to a big change
+ in the next beta: iniluatex will from now on start up with
+ only the TeX82 primitives and \directlua, everything else
+ has to be bootstrapped via tex.enableprimitives().
+ See the manual for more details.
+
+* Support for multiple lua states has been removed, and at the
+ same time support for adding name ids to lua chunks has been
+ added. See the manual for more details.
+
+* More changes to the PDF backend to make it support non-latin
+ directions (form and image placement, vertical typesetting,
+ synctex).
+
+* The kpathsea library is updated. Highlights: cleaner build
+ process (thanks to Peter Breitenlohner), cleaner mingw32
+ (cross)compilation support, and a new reentrant API.
+
+* Some possible endless loops within extended delimiters in
+ math mode are now trapped.
+
+* Movements inside VF font characters were considerably off
+ due to a wrong conversion routine.
+
+* Error handling for \outer has been reinstated, but can be
+ suppressed via the new primitive \suppressoutererror.
+
+* The new primitives: \suppresslongerror and \suppressifcsnameerror
+ that can be used to suppress errors for \par in non-long macros
+ and for non-expandable objects inside \ifcsname ... \endcsname,
+ respectively.
+
+* New lua function: node.vpack() via a patch from Khaled Hosny
+ that also improves error handling in node.hpack().
+
+* Fix the typo that caused \charic (instead of \charit)
+ to be defined as a primitive.
+
+* Suppression of hyphenation via \hyphenchar\font=-1 now works
+ again.
+
+* The lua functions tex.print(), tex.sprint(), tex.write() now
+ accept an array of strings as well as vararg list of strings
+ to print.
+
+* A change to be build process: luatex.p is no longer split
+ int smaller pieces before running the C compiler.
+
+* Melissa O'Neill contributed a bugfix to the Type1 font
+ subsetting code.
+
+* A bunch of smaller bugfixes and cleanups (as usual).
+
+==============================================================
+Luatex beta-0.35.0 was released 20090224
+==============================================================
+
+* The math handling portions of LuaTeX are converted to C code,
+ and extended to support Unicode math. There are a great many
+ related changes, see the new Math chapter in the manual for
+ details.
+
+* A nasty bug in the paragraph breaking routine was fixed.
+ (All lines except the first one were believed to be wider then
+ they really were. This affected which nodes were considered
+ as active breakpoints)
+
+* Various changes to the PDF backend to make it support non-latin
+ directions.
+
+* Fixed the behaviour of the page offsets. Placement of the output
+ on the physical page should now work correctly in all directions,
+ both in DVI and PDF.
+ There now are \pageleftoffset and \pagetopoffset primitives,
+ as well as
+
+* fontforge.apply_featurefile() was broken since 0.31.0
+
+* The lua profiler library is added.
+
+* The included lua filesystem library is now 1.4.1.
+
+* Reading of pk files fixed.
+
+* An optional space afer a <direction specifier> for \textdir c.s.
+ is ignored from now on.
+
+* \bodydir and \pagedir can now be (re)set even after the first
+ page has been output.
+
+* The new callback mlist_to_hlist can be used to intercept the
+ normal conversion of math lists to horizontal lists.
+
+* The programs ttf2afm and pdftosrc are removed from the luatex
+ distribution (these belong to pdftex).
+
+* fontforge.open() now uses much less memory when opening large
+ (CJK) fonts.
+
+* The included libpng is now 1.2.35.
+
+* Quite a lot of smaller bugfixes and cleanups (as usual).
+
+
+==============================================================
+Luatex beta-0.31.3 was released 20081229
+==============================================================
+
+This release has a bunch of updates from the development trunk
+(#1657-1670,1677,1678,1680,1685,1687).
+
+ * Closing of files opened by \externalocp.
+
+ * Fix for a locale-related bug that make PDF generation fail
+ with a "Parsing CFF Dict failed" message when including
+ opentype fonts.
+
+ * The included metapost is now version 1.102.
+
+ * PDF rules in vertical modes in RL direction where output
+ in the wrong direction
+
+ * Fix for a crash on Apple fonts that contain a 'bsln' table.
+
+ * The handling of the second argument to fontforge.open() was
+ broken
+
+ * The included libpng is now 1.2.34
+
+ * Handling of ttc files on Windows was broken
+
+
+==============================================================
+Luatex beta-0.31.2 was released 20081209
+==============================================================
+
+Besides fixing building issues, this release has
+
+ * A small fix for a crash that could happen when using
+ external OCPs.
+
+ * A fix in the format of fontforge.to_table output.
+ (In 0.31.1 <font>.lookups was near-empty; the lookups
+ were accidentally output as part of the gpos table).
+
+==============================================================
+Luatex beta-0.31.1 was released 20081209
+==============================================================
+
+fixed a bunch of compilation errors on various platforms, but
+with no other visible changes.
+
+
+==============================================================
+Luatex beta-0.31.0 was released 20081205
+==============================================================
+
+This is just an intermediate release so that some testing can be
+done on the updated fontforge embedding.
+
+* There are new fields being generated by fontforge.to_table(),
+ and one or two old ones have been removed. These fields are /
+ will be documented in the manual, but very briefly:
+
+ - MATH table and associated information are now exported
+ (the main reason for the new fontforge code)
+ - Baseline data is now exported
+ (perhaps usable in lua code)
+ - Multiple Master / Glyph variation data is now exported
+ (but useless, for now)
+ - Mac Feature (AAT) information is now exported
+ (perhaps usable in lua code)
+ - If (lookup) names were saved via the PfED table, these
+ will the exported instead of the default, generated names.
+ (as requested by Yannis)
+
+* dfont is now treated as an archive format just like ttc
+ when it comes to fontforge.info(). NOTE: that does not mean you
+ can actually use them, because the backend doesn't know
+ yet how to embed dfont fonts in the PDF, that is on the
+ TODO list for the next big beta (0.40.0).
+
+* The executables are a lot larger than before. That is because
+ much more of fontforge is included than before. Likely this
+ will stay this way, because this makes upgrading the ff code
+ much easier, and it means that luatex/FF potentially
+ understands more font formats (after upgrading the backend,
+ of course)
+
+
+==============================================================
+Luatex beta-0.30.3 was released 20081128
+==============================================================
+
+This release fixes a really big bug, a few smaller ones,
+and has updates of png and mplib:
+
+* All hyphenation patterns that were anchored at the start or
+ end of a word were ignored in luatex versions 0.25.X and 0.30.X
+ (and possibly even earlier).
+
+* Repeated use of \language=-1 could result in "There is not room
+ for another language".
+
+* The lua true coroutines patch (Coco) is now disabled on OpenBSD
+ running on non-intel platforms.
+
+* The lua socket library is patched so that it will now compile on
+ OpenSolaris.
+
+* Luatex now has libpng 1.2.33 and mplib 1.100
+
+==============================================================
+Luatex beta-0.30.2 was released 20081020
+==============================================================
+
+* The Lua coco change from 0.30.1 is reverted as it gave
+ trouble on MacOSX. Lua coco on non-intel OpenBSD platforms
+ is now explicitly turned off.
+
+* The lua file reading speedup in 0.30.1 broke reading of
+ files larger than 100MB.
+
+* Reading of font-related files was broken when there was a find
+ callback, but no read callback.
+
+* The texmf.cnf array size setup values were ignored whenever
+ --lua was given on the commandline (instead of only when
+ texconfig.kpse_init is set to false).
+
+* glyphs with negative widths resulted in incorrect horizontal
+ placement (overlapping) of the string in the output PDF.
+
+* Using \latelua could sometimes result in an invalid output PDF,
+ and the argument token list was expanded too early
+
+* There was a read buffer overrun in the mapfile parser
+
+* There are two new variables in the status table:
+ status.callbacks and status.indirect_callbacks (execution counts).
+
+==============================================================
+Luatex beta-0.30.1 was released 20081009
+==============================================================
+
+* Invalid return values from the linebreak_filter callback
+ are now handled gracefully (was crashing)
+* a preinstalled ctangle is no longer needed except when
+ cross-compiling
+* In 0.30.0, the .notdef fix was incorrectly applied to
+ truetype / opentype fonts.
+* A bunch of all memory leaks is fixed
+* In lua, f:read('*a') now uses signicantly less memory
+* The number of \catcodetables is now limited to 64KB
+ (for speed reasons)
+* Luatex could crash if there were PDF images with and
+ without page /Group included on the same page
+* Lua coco now always uses setjmp (for OpenBSD compatibility)
+* The embedded mplib is updated to the latest svn version
+* # marks (characters with catcode 6) are no longer doubled
+ inside \directlua
+* Handling the nul character (U+0000) with catcode 13
+ (active) was broken
+* Luatex could crash on win32 with an access violation
+ because there was one predefined language too few
+ (the one matching \language=-1)
+
+==============================================================
+Luatex beta-0.30.0 was released 20080930
+==============================================================
+
+New features:
+
+* Readable \tex internal params that are counts, attrs, or dimens are
+ now returned as numbers instead of strings, and skips as node objects.
+ Read-write access to tex's skip registers added: tex.skip[0] etc.
+* new callback: 'linebreak_callback' to replace the internal paragraph
+ breaking code
+* the tex table now supports more readable 'convert' values:
+ tex.fontname, tex.pdffontname, tex.pdffontobjnum, tex.pdffontsize,
+ tex.uniformdeviate, tex.number, tex.romannumeral, tex.pdfpageref,
+ tex.pdfxformname (each takes a number as argument)
+* new readable parameter: tex.fontidentifier(number) returns the
+ \csname associated with that font id
+* luatex now outputs \FONT<nr> instead of \^^@ in Overfull/Underfull
+ messages if the font's id text is zero (like for expanded fonts) (#77)
+ * luatex --version is split into --version and --credits
+* There is now (again) an svn revision number in luatex --version (#91)
+* Add support for more read-only internal access from lua:
+ tex.lastpenalty, tex.lastkern, tex.lastskip, tex.lastnodetype,
+ tex.inputlineno, tex.badness, tex.pdftexversion, tex.pdflastobj,
+ tex.pdflastxform, tex.pdflastximage, tex.pdflastximagepages,
+ tex.pdflastannot, tex.pdflastxpos, tex.pdflastypos, tex.pdfrandomseed,
+ tex.pdflastlink, tex.luatexversion, tex.Alephversion,
+ tex.Omegaversion, tex.Alephminorversion, tex.Omegaminorversion,
+ tex.eTeXminorversion, tex.eTeXversion, tex.currentgrouplevel,
+ tex.currentgrouptype, tex.currentiflevel, tex.currentiftype,
+ tex.currentifbranch, tex.pdflastximagecolordepth (#81)
+* the old --src-specials are replaced by --synctex (#63)
+* the \expanded primitive is backported from pdftex 1.50 (#43)
+* luatex now comes with libpng 1.2.32
+* experimental: tex.definefont(string, number) associates a
+ csname string with a font id number
+
+Bugs fixed compared to 0.29.0:
+
+* dashes were exported wrongly by MPlib
+* multi-item \discretionaries were broken in various ways (#78, mailinglist)
+* read_font_info was sometimes called recursively from lua-loaded
+ virtual fonts
+* do_vf was sometimes called on lua-loaded fonts that where
+ already known to be virtual
+* trailing junk in tfm files is now ignored (needed for ecrm fonts)
+* pdf_ignored_dimen was initialized too late, breaking \prevdepth
+ handling and causing output lines to overlap eachother (#72)
+* pdf.immediateobj() had a printf-related bug
+* the fontname terminal logging is fixed for strange font file names
+* lua tex array assignments now listen to the globaldefs setting
+ (tex.count[0] etc) (#92,partial)
+* \parshape was broken (#70)
+* there is no longer a ".tex" extension forced on very input file (#74)
+* eof() for mapfiles was true one byte too soon (#76)
+* out of range \lefthyphenmin and \righthyphenmin settings now actually
+ disable hyphenation (#90)
+* tex.unset_attribute() looked too far ahead when a to-be-unset
+ attribute id not only did not exist in the node, but was also
+ higher than the highest set attribute on the node. (#65)
+* the parameters attr and page_name of read_image() were swapped
+ (this broke \pdfimage with attributes)
+* tex filenames with spaces in them on the command line are now
+ allowed again (#30)
+* sometimes pfb fonts were included multiple times without valid
+ reason (#29)
+* some parts of the pdftex 1.40.9 PNG transparancy hack were still
+ present and caused transparant png handling to fail
+* \localinterlinepenalty and \localbrokenpenalty were broken
+* special case catcode tables are now handled better (#23)
+* the handling of missing .notdef charstrings in old pfb fonts
+ is fixed (#27)
+
+==============================================================
+Luatex beta-0.29.0 was released 20080718
+==============================================================
+
+
+New features:
+
+* The embedded pdftex is now 1.40.9 (forthcoming) except for the
+ following:
+ - the png transparancy fix is skipped because it is in conflict
+ with a macro-based solution offered by context mkiv.
+ - LFS (PDF files > 2GiB) is not working yet.
+ - Synctex is still missing
+
+* libpng, xpdf, and zlib are updated to their pdftex 1.0.9 levels
+
+* MPlib is updated to 1.090
+
+* The syntax of buildpage_filter is changed to avoid confusion
+ (and crashes). See the manual for the new calling convention.
+
+Bugs fixed compared to 0.28.0:
+
+* The previous bugfix for \languages skipping numbers was wrong.
+
+* Various compile-time warnings are suppressed
+
+* \pdfsetmatrix was broken
+
+* \pdfsave and \pdfrestore were broken
+
+* Valid user_defined whatsits nevertheless were generating errors.
+
+
+==============================================================
+Luatex beta-0.28.0 was released 20080630
+==============================================================
+
+There is one new feature:
+
+There is now experimental support for non-trivial discretionaries
+following explicit hyphens. In analogy to \prehyphenchar and
+\posthyphenchar, there are two new parameters \preexhyphenchar en
+\postexhyphenchar. Both new parameters default to zero (nothing).
+When set to a nonzero value, the parameter is added to either the
+pre- or post- break text. Note that this is *in addition to* the
+hyphen already in the input. Testing and comments are very welcome.
+
+Here is a short example (no idea what is says):
+
+ \pdfoutput=1
+ \hsize=2in
+ \postexhyphenchar=`-
+ Seria bom se eu
+ pudesse t\^e-lo mantido como amigo, mas por
+ mais bem-intencionado que eu fosse, n\~ao
+ foi possivel
+ \bye
+
+
+
+Bugs fixed compared to 0.27.0:
+
+* Words that started off with a character with a zero \lccode
+ were never hyphenated at all.
+
+* There was a bug in the new active characters code that prevented
+ the latex format from being built (with Invalid character error).
+
+* There is a temporary fix for the sometimes appearing "Font has a
+ bad FontBB" message from Acrobat.
+
+* \leaders did not actually stretch enough (the last bit of glue
+ that has to line up the line endings was never output to the PDF).
+
+* Bad paragraph-related callbacks could result in luatex crashing.
+
+* The pre_linebreak and post_linebreak filters were never called
+ when \output was active (this was a leftover of a superceded
+ optimization).
+
+* 'skipping' language codes when setting up \patterns c.s. did not
+ work (it used the next empty slot instead of the actual value of
+ \language).
+
+* Using multiple 'attr' keywords on box items could cause random
+ crashes.
+
+* Calling lang.hyphenate() with one argument (without specifying a
+ tail node) could crash.
+
+* The luatex pdf banner and version reporting is cleaned up a bit.
+
+* Conflicting patterns inside \patterns now give an error:
+ ! Conflicting pattern ignored.
+ (duplicate identical patterns are ignored without error).
+
+==============================================================
+Luatex beta-0.27.0 was released 20080624
+==============================================================
+
+Bugs fixed compared to 0.25.3:
+
+* Unicode reencoding support for non-standard (i.e. older)
+ Type1 fonts is now somewhat less broken than it was (#25)
+
+* .vf fonts using specials crashed luatex
+
+* luatex would crash on --\par (#33)
+
+* An attempt is made to get a sane default value for StemV in
+ the created pdf (#32)
+
+* We can now guarantee that %PDF-1.* header is printed before
+ the first pdf.print() output
+
+* lang.hyphenate() was broken
+
+* insert_before(a,a,b) was broken (#37)
+
+* argv[0] is now cleaned up before being used as a default for
+ mem_name and prog_name (#28).
+
+* luatex would crash on loading extended fonts (fonts loaded
+ via lua callbacks) from a format file.
+
+* The fix for pdftex bug #799 is backported from pdftex 1.40.4.
+
+* slnunicode had a bug in the unicode.utf8.gmatch iterator.
+
+* Queries of nonexisting fontdimens could cause a crash.
+
+* luatex would crash on {\textdir TLT\pardir TLT x\break\par }
+
+* Fixed wrong placement of lines in mixed-direction paragraphs
+ that could happen in some situations.
+
+Other news:
+* Luatex now includes luasocket (#35)
+ See http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
+ for usage.
+ There is a new commandline option: --nosocket to disable this,
+ and that is also implied by --safer.
+
+ NOTE to the binary builders: there are some unfixed configure
+ problems when you need to add a specific library to get socket
+ support on your platform. You probably will have to edit the
+ generated Makefile by hand (search for 'socketlib').
+
+* There is ongoing development to the 'img' and 'mplib' libraries.
+ See the reference manual for details.
+
+* The 'character commands' in virtual fonts now support image
+ inclusion. See the reference manual for details.
+
+* Lua error messages now include the call stack.
+
+* \directlua and \latelua have been extended to accept a 'name'
+ keyword. The argument is a token list that is used as the lua
+ name of this chunk in lua error messages and call stack prints.
+ (#42)
+
+* The lua chunk names can be interfaced via a new virtual
+ table called lua.instancename, the values in that function as
+ defaults in the absence of 'name' keywords.
+
+* The 2-plane limit on active character range is removed (#12).
+
+* Subsetted TTF fonts in the PDF now retain the cmap table.
+
+* There is a new Lua variable os.selfdir. This contains the
+ full absolute pathname of the directory that the executable
+ resides in (with symlinks resolved)
+
+* There is a new function os.uname() this returns a lua
+ table containing various platform information items.
+
+* The node library now uses text strings for direction specifiers
+ instead of numbers. See the reference manual for details.
+
+* The 'E' (edit) as error response functionality is now a noop.
+
+* Adding luatex 0.25.3 to texlive resulted in a few minor backports,
+ in particular: Support for mktexfmt is added, and luatangle now
+ identifies itself as such (instead of calling itself otangle).
+
+* We fixed a whole series of portability problems (but
+ we probably introduced new problems as well).
+
+* Most (all?) files now have a corrected Copyright header,
+ and link in $Id$ and $URL$ into the object file.
+
+* Some unnecessary files were removed from the distribution.
+
+==============================================================
+Luatex beta-0.25.3 was released 20080418
+==============================================================
+
+Bugs fixed:
+* Pdftex bug no. 936 (sarovar) regarding vertical
+ positioning of embedded PDF files if depth parameter is given.
+* Luatex gave bogus lua return values for the tex.wd/hd/dp
+ values of void boxes
+* A few bugfixes in mplib (square pens caused hangs, elliptical
+ pens caused confused output)
+* Hyphenation of uppercase words (\uchyph) was broken
+* Output image placements corrected for all 8 transform cases
+ also when artbox etc. is used
+* There were missing maketexstring() calls in error messages
+* Math display contents were sometimes prematurely freed during
+ the placement of the equation number
+* Setting \language=-1 could cause crashes due to an array
+ index going out-of-bounds
+
+Other news:
+* build.sh.ppc is added to the source distribution. This is a
+ script that crosscompiles osx ppc binaries from osx intel
+* tex.box[<chardef name>] is now supported (but still experimental)
+* a bunch of compiler warnings are removed
+* The fontforge library now dump AAT feature tags as and
+ "<id,flags>" string
+* The new function font.nextid() predicts the next assigned font id
+* Some source code changes are backported from texlive
+
+==============================================================
+Luatex beta-0.25.2 was released 20080410
+==============================================================
+
+* Updated to MPlib 0.40
+* Bugfixes and cleanup in the lua img table code
+* Fix \pdflastximagepages bug from pdftex
+* Fix for very large tex.print strings
+* Update to Lpeg 0.8.1
+* &D Bugfix for Type1 fonts when out-of-range characters
+ are marked as 'used'
+
+==============================================================
+Luatex beta-0.25.1 was released 20080321
+==============================================================
+
+* Updated to MPlib 0.30 (that is now becoming usable)
+* The build requirement for a pre-installed ctangle is gone
+ (thanks to Martin)
+
+==============================================================
+Luatex beta-0.25.0 was released 20080311
+==============================================================
+
+New:
+
+* mplib library:
+ This version features an embedded MP interpreter whose output
+ can be directly accessed from lua code (mplib), without calls
+ to an external "mpost" command. Of course it has bugs and
+ limitations (makempx does not work, for example) but keep in
+ mind that it is only an initial attempt.
+ See the manual for more details.
+* img library:
+ ** img.immediatewrite() is added
+ ** images now accept a 'transform' key
+ ** widths etc. can now be given as width="100mm"
+
+Fixed:
+
+* \parshape handling was completely broken since 0.20.0+
+* when \pdfprotrudechars was in effect, an assertion failure
+ could happen when embedded \hboxes in the paragraph appeared
+ at the end of a line.
+* import of otf fonts with contextual lookups has been debugged,
+ thanks to a patch by GW himself.
+* compiling with gcc 4.2.3 is now supported
+* if you want to build from source, you need a pre-installed ctangle.
+
+
+==============================================================
+Luatex beta-0.22.1 was released 20080227
+==============================================================
+
+* The macnames.c source file for building ttf2afm is restored.
+* "make depend" in luatexdir now works again
+* luatex sometimes crashed because it attempted to expand an
+ already expanded font
+* luatex aborted when --progname was given but no format name.
+ It now sets the format name to the given progname in that case
+* sometimes paragraphs with near-empty lines could cause a crash
+* img.supportedtypes() had a bug causing it to crash
+* img.supportedtypes() has been renamed to img.types for consistency
+* img.boxes() added, returns strings representing bounding boxes
+* img.node() added, returns a whatsit node cf. \pdfrefximage
+* node.write() now accepts multiple arguments
+* the program_name_set switch was not set automatically from C,
+ causing errors unless lua code called kpse.set_program_name()
+ explicitly
+* kpse.set_program_name() can now be called more than once
+ in a single run.
+* os.spawn{...} and os.exec{...} could cause crashes because of
+ a memory allocation error
+
+==============================================================
+Luatex beta-0.22.0 was released 20080215
+==============================================================
+
+* We now have an official bug tracker: http://tracker.luatex.org
+* A new lua library (img) is added that allows a direct
+ interface to the image handling of luatex. You can use this
+ to include images from lua code instead of via the more
+ traditional \pdfximage cs. See the manual.
+* An optional equal sign after \{pre,post}hyphenchar is now
+ allowed.
+* os.exec() has been extended, and os.spawn() added. These
+ functions have support for quoted strings, and they
+ also accept a table with preseparated command arguments.
+* New string constants os.type and os.name are provided.
+* node.last_node() is added. This pops and returns the last
+ node from luatex's 'current list'
+* node.write() is added. This appends a node to the end of
+ luatex's 'current list' (experimental).
+* The strict check on unicode compliance in pattern files
+ is dropped. Patterns files still have to be in proper UTF-8
+ encoding, but the error for non-Unicode character values
+ (like 0 - 31 and 127 - 159) is dropped.
+* \pdfadjustinterwordglue, \prependkern, \appendkern
+ and associated \XXXXcode arrays are gone.
+* The rest of the pdftex font arrays are now merged into
+ the new luatex font data structure. This means that you
+ can now set up font expansion from lua code, and that a few
+ font-related limits are gone.
+* The 'top_skip' field in 'insert' nodes is renamed to 'spec',
+ for improved consistency.
+* kpse.show_path() added. This behaves just like
+ $ kpsewhich --show-path
+* The unicode.utf8 functions now also accept values in the range
+ 1.114.112 - 1.114.367 that is used by LUATEX for raw byte output.
+
+What's been fixed:
+
+* Better node memory (de)allocation error tracking and messages
+* Compilation on MacOSX 10.5 was broken
+* There was a bug in node.insert_after
+* Use of \{pre,post}hyphenchar was broken
+* lfs.permissions was leaking memory
+* Some warning and error messages are improved a bit
+* A set of bugs in character protrusion, this seems to be working
+ ok now.
+* Also, a set of bugs in font expansion. This now works in most
+ cases but is not quite bugfree yet (problematic files for testing
+ are welcomed).
+* The functions in the kpse library would crash luatex if
+ kpse.set_program_name() was not yet called. gives an error now.
+* Alignments with spanned columns could cause crashes
+* A patch is added for problems with filename parsing on the
+ "first input line" (by Jonathan Kew)
+* The hpack_filter and vpack_filter were only called for lists longer
+ than one node.
+* Luatex is now more forgiving about font subsets being smaller
+ than their expected size (issues a warning instead of aborts now)
+* A "double-free ignored" error for paragraphs with lines starting
+ with discarded items was fixed.
+
+==============================================================
+Luatex beta-0.20.2 was released 20071217
+==============================================================
+
+* some portability fixes to the build scripts
+* a fix for multi-\span in alignments causing unbreakable
+ loops
+* manual improvements from Jonathan Sauer
+* fix for undefined csnames in \directlua if
+ web2c's hash_extra is nonzero
+* fix for LR text inside of a RL document
+* fix for open_read_file callback not being called
+ unless find_read_file was also registered
+* removed the ocp status message when \ocps are not
+ actually used
+* "unicodeenc" in the fontforge to_table renamed to
+ "unicode" for improved consistency
+
+==============================================================
+Luatex beta-0.20.1 was released 20071207
+==============================================================
+
+* texlua was broken on Solaris because the some C header
+ files were loaded in the wrong order.
+* os.tmpdir() now accepts an argument, making it easier
+ to use. It now generates more unique filenames when
+ it is called repeatedly in one run.
+* The --luaconly commandline switch is now documented
+ in the --help text.
+* The new extended hyphenation exceptions were severely
+ broken.
+* \pdfprotrudechars could cause luatex to abort with an
+ assertion failure.
+* There was a bug in the \span code that could cause endless
+ loops.
+* The simple forms of \leaders were messed up on windows
+ because a variable was not properly initialized.
+* Non-grouped \textdir commands created invalid output.
+* e-TeX's pseudo files were not closed properly in ini mode.
+* The luatex.web now weaves properly again.
+* I made some small improvements to the manual.
+
+==============================================================
+Luatex beta-0.20.0 was released 20071205
+==============================================================
+
+News compared to the last beta (0.11.2) is as follows:
+
+* Completely overhauled hyphenation and ligkern application,
+ including the addition of a new "lang" table in lua to
+ interface to the language parameters, some extra functions
+ in the "node" table, and a few extra callbacks ("hyphenate",
+ "ligaturing", "kerning", "post_linebreak_filter").
+
+ There is a new chapter in the manual to document all the
+ changes to the hyphenation and line breaking algorithms,
+ it is simply too much to list here.
+
+* the interface of the pre_linebreak_filter,hpack_filter,
+ vpack_filter, and pre_output_filter has changed slightly.
+
+* boxes can now get explicit attributes different from the
+ currently active set, using a syntax like
+
+ \hbox attr2=12 attr3=-1 to 12pt {Hi!}
+
+* lpeg is now at version 0.7
+
+* a whole series of exotic bugs and compiler warnings are
+ fixed, mostly thanks to the watchful eye of Fabrice.
+
+* texio.print now accepts multiple strings as arguments.
+
+* the lua functions os.sleep(), os.times(), os.gettimeofday()
+ and os.tmpdir() have been added.
+
+* lua now comes with the coroutine (coco) patches from the
+ luajit project applied.
+
+* the banner line no longer claims to be TeX.
+
+* a bunch of bugs reported on the mailing list have been
+ fixed (I hope all of them).
+
+* (internal) we found lots of small ways to speed up lua
+ node processing.
+
+* (internal) the node (de)allocation functions have been
+ rewritten, so that absolutely all nodes now have a type,
+ even the ones with variable sizes.
+
+
+==============================================================
+Luatex snapshot-20071029 was released 20071029
+==============================================================
+
+* Completely overhauled hyphenation and ligkern application.
+
+ There is a new chapter in the manual to document all the
+ changes to the hyphenation and line breaking algorithms,
+ it is simply too much to list here.
+
+* the interface of the pre_linebreak_filter,hpack_filter,
+ vpack_filter, and pre_output_filter has changed slightly.
+
+* lpeg is now at version 0.7
+
+* a whole series of exotic bugs and compiler warnings are
+ fixed thanks to the watchful eye of Fabrice.
+
+* texio.print now accepts multiple strings as arguments.
+
+* The lua function os.sleep() is added
+
+==============================================================
+Luatex beta-0.11.2 was released 20070918
+==============================================================
+
+* Pdf inclusion and subsetting of CID-based opentype fonts
+ now works as it should.
+
+==============================================================
+Luatex beta-0.11.1 was released 20070918
+==============================================================
+
+A quick list of what is new and fixed since beta 0.10.2:
+
+New:
+* pfb+afm fonts can now be used in 'wide' (encodingbytes=2) mode
+* searching in PDFS using 'wide' fonts now works reasonably well
+ (based on the tounicode feature)
+* related to that, tounicode information can now be passed
+ on inside the font metrics table
+* font subsetting is now supported for CID-based OpenType fonts
+ (however, there is a known bug with KpozMinProVI-Regular.otf)
+* fontforge's warning and error messages are now intercepted
+ and passed on to the lua code as a second return value of
+ the fontforge.open() function
+* the new primitive \suppressfontnotfounderror can suppress
+ the TeX error for "Font not found"
+* The lua function font.current can now be used to set TeX's
+ current font
+
+Fixes:
+* set_attribute(-1) is now the same as unset_attribute()
+* OpenType lookups with glyph classes would crash luatex
+* luazlib would not compile on debian (fix from Norbert)
+* CID-based fonts would crash luatex
+* Bare CFF should be read in binary mode (fix from Akira)
+* VF processing did not process packets containing zero bytes properly
+* the truetype collection (.ttc) handling is fixed, so that all
+ of the fonts inside a collection can now be used reliably
+* application segfaults and stack overflows are intercepted
+ so that luatex can quit a bit more gracefully
+* an assertion failuer on systems with signed chars (linux-powerpc)
+ is fixed
+* a crash on AMD64 linux was fixed
+* the lua "pdf" table code was wrong
+* \ifcsname did not work properly for UTF-8 characters
+* Use of the math-related functions using make_fraction (like \atop)
+ caused a crash
+* \handling of \if\noexpand was wrong
+* applied a patch that cleans up XForm and page calculations
+* "autoconf" support from zziplib is stripped
+
+==============================================================
+Luatex beta-0.10.2 was released 20070814
+==============================================================
+
+Bugs fixed:
+
+* the primitive \span was completely broken
+* \pdfexpandfont (font expansion) misbehaved if it was used more
+ than once
+* virtual fonts: sometimes they used the wrong internal font id,
+ loading vf fonts via fonts.read_vf() was impossible, and sometimes
+ virtual fonts created segfaults
+* while dumping formats, the last font parameter for each font was not
+ dumped at all
+* zziplib was always compiled with pre-installed zlib headers, instead
+ of the ones in the build tree
+* lua 5.1.2 has trouble quoting ^Z characters etc, the tentative patch
+ for lua 5.2 from Luiz fixes that, hopefully
+* fontforge.font('font.pfb') now properly parses AFM boundingboxes
+* non-existing files in the argument for fontforge.open() or
+ fontforge.info() could cause segfaults, now it generates an error
+ instead
+* fontforge.open() did not return character widths for vertical fonts
+ as it should
+* on Windows, fontforge believed that ttc files (TrueType Collections)
+ were actually directories. ttc processing is still not 100% correct,
+ but it is getting better
+* the build system used explicit 'make' sometimes
+* the auto-growing string pool was not used everywhere
+* there were some typos in the documentation parts of the pascal web
+* use of \parshape could easily exhaust all available memory
+
+
+New features:
+
+* support for applying Adobe Feature files (.fea) and Adobe Font
+ Metrics (.afm) is added to the fontforge library
+* fontforge.info() will now return an array of tables for the contents
+ for ttc files
+* support for a 'texluac' personality was added, to replace the 'luac'
+ command from the official Lua distribution
+
+==============================================================
+Luatex beta-0.10.1 was released 20070719
+==============================================================
+
+This was a hotfix because beta-0.10.0 was completely broken.
+
+==============================================================
+Luatex beta-0.10.0 was released 20070718
+==============================================================
+
+The latest version of the manual is included in the package, and I
+am not going to repeat all of that. There were some minor changes
+compared to the previous snapshot, but mostly just bugfixes and
+documentation improvements.
+
+==============================================================
+Luatex snapshot-20070626 was released 20070626
+==============================================================
+
+* Integrated the lua library lzlib, this defines tables with
+ bindings for zlib (including eazy-to-use gzip support)
+* Updated to slnunicode version 1.1
+* Some small cleanups in the sparse array handling
+* Moved the raw byte support out of the valid unicode range
+* Fixed a bug in the OFM font reader
+* Removed the pdftex snap nodes (and associated primitives)
+
+
+==============================================================
+Luatex snapshot-20070622 was released 20070622
+==============================================================
+
+Not a lot of news, but it fixes a few important bugs in the lua
+node processing. Also a few utility functions are added:
+
+* tex.round()
+ rounds and bounds checks a lua number to make sure it is
+ a valid tex integer.
+* tex.scale()
+ multiplies a number (or the numeric values in a table)
+ with a fixed quantity, and calls tex.round() on the result.
+* node.has_field()
+ Test if a node has a specified field name
+* node.remove()
+ removes a node from a nodelist, while keeping the list intact
+* node.insert_before()
+ inserts a new node into a nodelist, just before a specified
+ location node
+* node.insert_before()
+ inserts a new node into a nodelist, just after a specified
+ location node
+* node.hpack()
+ packages a nodelist into a hlist node
+
+
+==============================================================
+Luatex snapshot-20070619 was released 20070619
+==============================================================
+
+* The lua node processing interface is completely reworked.
+ It is now completely based on userdata, and uses a new lua table
+ called 'node' to hold the methods. More detailed information
+ is in the manual (of course).
+
+* There is a fifth node processing callback:
+ pre_output_filter
+ this is executed just before the packaging of \box 255.
+
+* The hpack_filter and pre_linebreak_filter callbacks now
+ receive an extra argument indicating the number of top-level
+ glyphs in the node list.
+
+* Virtual fonts can now contain a 'node' key in the glyph
+ commands: the value should be a hlist node (i.e.: a horizontal
+ box), and that will then be output for each character access
+ in that font.
+
+* A new set of registers is added, called \attribute. These are
+ values that will be automatically attached to nodes created in
+ their scope. More information in the manual.
+
+* Direct read/write access to TeX's box registers is addded to
+ the lua 'tex' table.
+
+* TeX's main memory now grows dynamically, and the (de)allocation
+ routines have been rewritten completely.
+
+* The 'kpse' table is extended with extra interface functions, to
+ allow texlua to be used as a scripting engine.
+
+* The \pdftexversion command now returns 200, not 140.
+
+* The displayed banner and --version screens are cleaned up.
+
+* The format file is now RLE compressed. Not as small as before,
+ but unpacking is much faster.
+
+
+==============================================================
+Luatex snapshot-20070426 was released 20070426
+==============================================================
+
+This past month I have been busy with nodes and lists of nodes,
+so the big new feature in this release is that there are four
+callbacks that operate on node lists:
+
+ buildpage_filter
+ pre_linebreak_filter
+ hpack_filter
+ vpack_filter
+
+The preliminary documentation for these is in the manual, but the basic
+idea is that you can filter a node list just before LuaTeX starts doing
+something with it (like line breaking). This functionality is not stable
+yet: the node presentation of the various node types is pretty much OK
+now, but keep in mind the following:
+
+ * math noads and math typesetting are not handled at all (yet)
+ * not all hpacks and vpacks are intercepted (yet)
+ * the nested node list handling will probably change
+ * A conversion tool for nodes to/from dictionaries is planned,
+ but not done yet
+
+The other changes in this snapshot are various bugfixes (for builds
+on various platforms as well as font issues) and speedups (in the
+execution of callbacks and the creation of lua font representations).
+
+
+==============================================================
+Luatex snapshot-20070322 was released 20070322
+==============================================================
+
+* I have changed the token_filter callback quite rigorously,
+ mostly because of speed issues. The raw speed of trivial
+ lua token handling is now only about 20 times slower than
+ the native handling. Not bad at all, considering it has to move
+ between interpreted and compiled code for each and every
+ token. If you do not run the token filter inside \output,
+ the effective run speed difference should not be much more
+ than a factor 1.5.
+
+ Two big differences: you have to call token.get_next()
+ yourself, and the token table is now a three-item array
+ instead of a five-key hash. The minimal example changes to
+
+ \directlua0{
+ callback.register('token_filter', function ()
+ return token.get_next()
+ end)
+ }
+
+ more details are in the manual.
+
+* I've fixed a few bugs in the handling of Opentype TTF, and added
+ a new key in the font definition table:
+
+ f.encodingbytes = (1|2)
+
+ The default is 2 for opentype and truetype format, 1 otherwise.
+ Later on, it will become possible to have a type1 font in 2-byte
+ (CID) encoding or a truetype font in traditional encoding (1-byte),
+ but I have not covered all cases yet.
+
+
+
+==============================================================
+Luatex snapshot-20070309 was released 20070309
+==============================================================
+
+* The OCP debug information is removed again.
+
+* There is a new callback that I am quite excited about myself:
+ 'token_filter'.
+
+
+A bit of text from the reference manual:
+--------------------
+This callback allows you to change the modify any lexical token that
+enters the \type{main_control} function before \LUATEX\ executes the
+associated command.
+
+Note: not all tokens can be intercepted yet, only those that are `seen'
+by \LUATEX's main control function. Supplemental tokens like the bodies
+of macro definitions and the right-hand side of register assignments
+are not seen. For now, this is intentional.
+
+\startfunctioncall
+ function (table <token>)
+ return table <token>
+ end
+\stopfunctioncall
+
+Calling convention for this callback is bit more complicated then for
+most other callbacks. Initially, lua function will be called with the
+next token from \type{get_next()} as argument, represented as a small
+lua table. The function should either return a lua table representing
+a valid to-be-processed token, or something else like nil or an empty
+table.
+
+If your lua function does not return a table representing a valid
+token, it will be immediately called again with yet another token
+from \type{get_next()} as argument, until it eventually does return
+a useful token.
+
+But if the function does return a usable token, then that token will
+be processed by \LUATEX. Afterwards, the function will be called
+again, but now without an argument. This is repeated until it stops
+returning tokens. Then processing reverts back to the other branch.
+
+The point behind that roundabout calling convention is that it
+allows the lua function to buffer tokens for various uses. That in
+turn makes it possible to do some really advanced things like
+replacing OTPs.
+
+Now about that table. The table that the function will receive
+contains four fields:
+
+\starttabulate[|l|i|p|]
+\NC Key \NC type \NC Explanation \NC\FR
+\NC cmd \NC string \NC A representation of \LUATEX's internal
+ command code\NC\NR
+\NC chr \NC number \NC The command code modifier\NC\NR
+\NC cs \NC string \NC If the token came from a csname, this
+ is that csname\NC\NR
+\NC mod \NC character \NC A single character string representing
+the current processing mode. One of {\bf v}ertical, {\bf h}orizontal,
+display {\bf m}ath, {\bf n}o, internal {\bf V}ertical,
+ restricted {\bf H}orizontal, or inline {\bf M}ath mode.\NC\LR
+\stoptabulate
+
+If you modify the table before returning it, then it is wise to return
+either a (\type{cmd}, \type{chr}) pair, or a \type{cs} string. That is
+because if both options are present, the pair has precedence and the
+string is ignored. On the return table, {\bf mod} is ignored always.
+--------------
+
+I have no long example code yet and it is not as complete as one
+would want it to be because it is not intercepting everything that
+comes in, only the bits that are triggered by the main control
+loop.
+
+I decided to do a fast snapshot release for two reasons:
+
+* It is one of the easier extensions to get started with if you want
+ to learn a bit about lua programming
+
+* I would welcome feedback on the token interface, because it will
+ be needed in other places as well, soon. I am still not sure
+ whether converting the command to/from strings is worth it, for
+ example. And maybe it would be less confusing if you could return
+ a list of tokens instead of being called repeatedly?
+
+Here is the trivial example to get you started:
+
+ \directlua0{
+ callback.register('token_filter', function (t) return t end)
+ }
+
+
+==============================================================
+Luatex snapshot-20070307 was released 20070307
+==============================================================
+
+
+* Non-CID PostScript-based Opentype fonts are now combined over
+ the entire document, and properly subsetted. The code is
+ borrowed from xdvipdfmx with some minor adjustments
+
+ Adding support for CID-keyed OpenType fonts would not be hard
+ but at the moment I lack example input (and incentive).
+
+* A small extension to the virtual fonts structure: you can use
+
+ f.fonts[1] = { 'id' = 38}
+
+ to do a backreference to a previously defined font. This saves quite
+ a few computations
+
+* There was a bug in the handling of \leaders in the output whereby
+ it's width was taken to be twice what it should be while writing
+ to the PDF, fixed now.
+
+* The font inclusion code is cleaned up a bit by Hartmut.
+
+* Some compilation problems were fixed.
+
+* There is (quite a bit of) debugging information printed out when
+ OTPs are in use, because I am tracking down a bug reported by Idris.
+
+ The input of each and every OTP step is shown on the terminal in
+ a line line this:
+
+ [57902][1568][58423][1568][58408][1568][58921]
+
+ those are the decimal values of ocp i/o characters. If you don't
+ need them, don't worry about it.
+
+==============================================================
+Luatex snapshot-20070302 was released 20070302
+==============================================================
+
+* The 'snapshot version' banner is now calculated dynamically
+ at build time. This aids in figuring out what binary people
+ are actually running, but it can possibly break the build on
+ systems that do not have a `date` command.
+
+* The do_vf() function that checks for virtual font existance
+ is now run immediately after the font definition instead of
+ being postponed until characters are output.
+
+* The 'define_font' callback interface has changed a little.
+ It is now:
+ retval = function (name,size,fontid)
+
+ where fontid is the internal font number of the font that
+ is currently being defined, and retval can be either a table
+ (as before) or a different, previously defined fontid. This is
+ useful if a previous definition can be reused instead of
+ creating a whole new font structure.
+
+* The internal font data structure has been redone. Glyph index
+ inside a font is now handled by a sparse array, so that use
+ of e.g. 0xFB01 (fi-ligature) no longer creates a 64000+ entries
+ character array.
+
+* The internal cache-ing of font metric information is turned
+ off completely, because it was based on the assumption that
+ name + size were a unique identifier for a font. This can no
+ longer be guaranteed.
+
+* word boundary processing now works OK again, thanks to the
+ introduction of two virtual characters in the font table
+ definition. Besides the normal numeric entries in the
+ f.characters table, there can now also be two string keys:
+ "left_boundary" and "right_boundary". The ligatures and kerns
+ of the 'left_boundary' character are used for the pre-word
+ boundary processing, ligatures and kerns between characters
+ and 'right_boundary' are used for the post-word processing.
+
+* Lua font table references are no longer cached by the
+ executable ,in order to preserve memory. (the only downside
+ is that font.fonts[] access is now slower because of the need
+ to recreate the lua table).
+
+* There are other some small changes to the font table formats.
+ Please see the manual for details.
+
+* A 'real' font can now still have virtual characters if they
+ are loaded via lua. Just set the 'commands' section and/or
+ the 'fonts' array to your liking, and it should work out.
+
+ If you have created no 'fonts' array at all, then the default
+ font (indentifier '1') is the current font, so that you
+ can create virtual duplicates of already existing characters.
+
+ Note: this does not work the other way. There can not be
+ 'real' characters in a virtual font!
+
+* Truetype-based opentype fonts no longer require Acrobat 7
+ t(hey are now written out as if they are normal truetype).
+
+* A lua init script can now set 'texconfig.formatname' and/or
+ 'texconfig.jobname'. If ther is no file or format specified
+ on the commandline, then, if, one of those keys is present,
+ that key will be used instead of simply quitting with an
+ error.
+
+* Placement of boxes and rules in right-to-left mode is debugged,
+ and now seems to work ok.
+
+* Virtual font loading is debugged.
+
+* Some memory leaks are resolved
+
+* HZ font expansion should work ok again, but is not tested.
+
+* a few of the warning during opentype loading have been removed
+ because the problems are rather harmless and turned out to be
+ triggered by almost every font.
+
+
+==============================================================
+Luatex snapshot-20070218 was released 20070218
+==============================================================
+
+* The pdftex stuff is now updated to 1.40.3
+ (and on top of that, it still has those extra patches announced in
+ snapshot 20070202)
+
+* The virtual font parser is debugged and now appears rather stable.
+
+* There is one extra virtual command:
+
+ "commands" = {
+ {"slot", 1, 97}, -- place character 97 'a' in local font 1.
+ }
+
+ This is just a shortcut for {"font",1}, {"char", 97}
+
+* Some small memory leaks have been fixed. Luatex does not leak big
+ time, but I'd like to get back to valgrind reporting '0 out of 0',
+ instead of the current 800 bytes or so (that is a slow process).
+
+* You can read a truetype or opentype font from within lua code
+ using font.read_ttf() or font.read_otf(), respectively.
+
+ This feature uses a fair bit of the fontforge code, making the
+ binary rather a bit larger than before. Just so you know.
+
+ Apple (AAT, as well as encoding) support is still largely missing,
+ and bitmap-only and old Multiple-Master truetype fonts are not
+ supported at all (and never will be).
+
+ The output format is (shadily) documented in the reference manual.
+ At the moment, it very closely resembles the internal font stucture
+ that is used by fontforge.
+
+* LuaTeX can now write wide OpenType fonts to the PDF file.
+
+ There is no subsetting support yet, and a ToUnicode CMap is also
+ still missing, but nevertheless it is already somewhat useful. The
+ rule is very simple: if a font uses code points above 255, then it
+ is considered to be a `wide' font, and it will be written out as
+ a Type0 CID-keyed font to the PDF.
+
+ Caveat: Getting suitable metrics into LuaTeX can be a bit of problem
+ right now, because font.read_otf() does not produce anything that
+ can be fed back into define_font without extra processing. Hans has
+ some experimental Lua code for ConTeXt (of course :-)) and that is
+ how I know it works. You can expect a nicer interface soon,
+ hopefully next week, in the form of a simplistic table conversion
+ routine.
+
+* I have started work on supporting Aleph's bidi typesetting in PDF
+ mode as well, simple text seems to be largely ok. More complicated
+ documents will no doubt still show some bugs, but fixing those will
+ be easy (once they are discovered). Exactly what happens with specials
+ is not yet investigated.
+
+* Omega's (16-bit) wide virtual fonts now work OK in PDF mode. This
+ means that many Aleph files can now be run in PDF mode directly.
+ (the documents that use UTF-8 input encoding)
+
+
+==============================================================
+Luatex snapshot-20070202 was released 20070202
+==============================================================
+
+
+* The pdftex stuff is now updated to 1.40.2, and on top of that, it has
+
+ - an extra patch from Han The Thanh that adds a primitive to control
+ the merging of fonts from external pdf images (\pdfreplacefonts),
+ and a bugfix for virtual font handling.
+
+ - an extra patch by Hartmut Henkel that removes a number of malloc()s
+ and free()s from the calls to the compression library, thereby
+ making luatex run a bit faster.
+
+* luatex now happily accepts the following low-level syntax:
+
+ \font\myfont = <general text> <at specifier>
+
+ It feeds the <general text> to either kpathsea or a lua script for
+ further processing after stripping the braces.
+
+ In itself, this is not all that useful, but the reason for this
+ syntax extension is that it paves the road for a macro package
+ to do something like this:
+
+ \font\myfont = {font="Times New Roman", color="\darkred",
+ encoding="ec", features="liga", size=10bp}
+
+ without having to resort to system-specific quoting mechanisms.
+ Macro (and other) expansion takes inside the braced argument.
+
+ (I am considering adding this extension to \input as well).
+
+* It is now possible to define a font into the font.fonts[]
+ directly from lua, but becayse use is limited, I am only
+ mentioning it to be complete.
+
+ Syntax:
+ <number> id = font.define(<table> font)
+
+* There is a (not very reliable yet) virtual font parser accessible
+ from lua.
+
+ Syntax:
+ <table> vfdata = font.read_vf(<string> name, <number> size)
+
+ The interpreter tries to give a reasonable representation of a
+ virtual font file (the .vf file). Besides a few simple top-level
+ items:
+
+ designsize -- in scaled points
+ size -- also in sp
+ name -- the file name
+ checksum -- the vf checksum
+ header -- the header comment (if any)
+
+ it also has a top-level array 'fonts' wherein each item is a mini-
+ array describing one of te mapped fonts. An example makes this
+ easy to understand
+
+ "fonts" = { {"ptmr8a",655360}, {"psyr", 600000} }
+
+ says that the first referenced font (index 1) in this virtual font
+ is ptrmr8a.tfm loaded at 10pt, and the second is psyr.tfm loaded
+ at a little over 9pt. These index numbers are used by the character
+ command definitions that follow.
+
+ At top level, there is a 'characters' array, just as for a normal
+ font, except that each item has only two keys:
+
+ "width" -- the tfm width (as stored in the .vf)
+ "commands" -- an array of virtual font commands for a character.
+
+ each of the items in the 'commands' array is itself a tiny hash.
+
+ Each of those mini-hashes represents a single character packet
+ command. Here is a 'commands' entry that contains every possible
+ one at least once:
+
+ "commands" = {
+ {"push"}, -- remember where we are
+ {"right", 5000}, -- move right 0.08pt
+ {"font", 1}, -- select the fonts[1] entry
+ {"setchar", 97}, -- place character 97 'a'
+ {"pop"}, -- go all the way back
+ {"down", -200000}, -- move *up* about 3pt
+ {"special", "pdf: 1 0 0 rg"} -- switch to red color
+ {"rule", 500000, 20000} -- draw a bar
+ {'special',"pdf: 0 g"} -- back to black
+ }
+
+
+* But the big news is that you can now define your own virtual fonts
+ on the fly, by adding a few statements to the table returned to
+ the 'define_font' callback.
+
+ There are a few requirements:
+
+ - The table has to have a top-level key 'type', and it's value
+ must be 'virtual'.
+
+ The presence of this key with the specific value 'virtual'
+ will trigger handling of the rest of the special virtual font
+ fields in the table, but the mere existance of 'type' is
+ enough to prevent luatex from looking for a virtual font
+ on its own.
+
+ Therefore, this also works 'in reverse': if you are absolutely
+ certain that a font is not a virtual font, assigning the value
+ 'base' or 'real' to 'type' will inhibit tex from looking for a
+ virtual font file, thereby saving you a disk search.
+
+ - There must be a top-level 'fonts' array, as explained above.
+ Any fonts that are not yet known to luatex at that moment,
+ will be loaded automatically (Warning: do not ever use a font
+ in 'fonts' with the same name you will return in the table you
+ are defining right now!).
+
+ - Each and every character in the fonts needs to have a 'commands'
+ key, as explained above.
+
+ The main point behind these restrictions is that a font is
+ *either* a base font *or* a virtual font. It cannot be both
+ at the same time.
+
+
+==============================================================
+Luatex snapshot-20070126 was released 20070126
+==============================================================
+
+
+* Underscores in pascal identifiers are now retained.
+
+ This took quite a bit of work. The web2c conversion tools
+ needed only small adjustments, but most of the existing C
+ code depended on the removal of the underscores. I had to
+ go through changing many lines. 99% of all identifiers are
+ now written the same on the pascal side as on the C side.
+ This makes writing interface code quite a bit less confusing.
+
+ Not everything is completely clean yet, because I did
+ not want to change the web2c-specific C files. I often
+ took the other approach and removed the underscores
+ from the web2c options (like 'parsefirstlinep') in the
+ change file instead. Ugly, but predictable.
+
+ There is about a dozen or so of #defines left, that map
+ memoryword -> memory_word
+ strpool -> str_pool
+ etc.
+
+* The virtual font parsing and interpreting is now done in C.
+ (this is because it needs to be interfaced with the lua-based
+ font loader)
+
+* I am in the process of merging: the VF stuff; the TFM stuff;
+ the lua font loading; and the pdftex font backend into one
+ interface, so there were some smallish changes relating to
+ that as well. Nothing worth mentioning just yet except that
+ luatex now will read "ovf" files as well as "vf" files.
+
+* There are a few really small bugfixes for bug reports I received
+ on this list and by email.
+
+==============================================================
+Luatex snapshot-20070119 was released 20070119
+==============================================================
+
+The largest new bit is the existence of a font.fonts array, that you
+can use to query/adjust the internal defined tex fonts. See the manual
+for more details.
+
+Two small new lua extensions are added as well:
+
+ * os.setenv() -- to change the environment
+ * os.exec() -- a non-returning os.execute()
+
+And a bit of cleanup in the commandline processing.
+
+
+==============================================================
+Luatex snapshot-20070117 was released 20070117
+==============================================================
+
+* the pdftex core is updated to 1.40.1, and web2c to 7.5.6
+
+* the pdftex-specific documentation is removed
+
+* lua lpeg library updated to 0.4
+ ( http://www.inf.puc-rio.br/~roberto/lpeg.html )
+
+* the C part of the lua md5 library is added to the binary
+ ( http://www.inf.puc-rio.br/~roberto/md5/md5-5/md5.html )
+
+* --luaonly now puts the script itself at arg[0], and
+ preceding commandline items in the negative indices
+ (instead of starting the count at zero).
+ This new approach is compatible with the standalone lua
+ interpreter.
+
+
+==============================================================
+Luatex snapshot-20070107 was released 20070107
+==============================================================
+
+Hot on the heels of 20070105, a new snapshot. It turns out
+that using the callback to define a font broke all ligatures.
+This snapshot fixes that, and it has a few minor updates to
+the manual. Next shapshot will be after the inclusion of
+pdftex 1.40.1.
+
+==============================================================
+Luatex snapshot-20070105 was released 20070105
+==============================================================
+
+ * the calculations that converted lua strings into tex units
+ were horrendously wrong, this was discovered by Pawel.
+
+ * io.lines() was still using the old, line ending sensitive,
+ code from the lua core distribution
+
+ * The main font memory is allocated as needed^(1) instead of
+ statically pre-allocated.
+
+ * ligatures and kerns are separated completely from each other,
+ so use of \noligatures no longer inhibits kerning as well
+
+ * Metrics can be loaded using a callback: 'define_font'.
+ The value returned should be a lua table representing a tfm
+ file.
+
+ * there is a new lua table: font. It has one function:
+ font.read_tfm() that returns a table reprentation of the tfm
+ contents, for use with the above mentioned callback
+
+ * I dropped suppport for "Level 1" OFM files. I would like
+ to have a try at those extended font files, but I lack
+ examples (fonts nor documents). I am not even sure such
+ fonts have ever existed in the 'real world'.
+
+
+
+==============================================================
+Luatex snapshot-20061208 was released 20061208
+==============================================================
+
+* There is a new switch: --safer. This disables a number of lua
+ functions that are more or less dangerous (a detailed list is
+ in the manual)
+
+* Two longstanding bugs have been fixed: \latelua works once
+ again (patch by Hartmut) and a bug that caused mysterious crashes
+ turned out to be a problem inside the paragraph builder
+ (reconstitution of ligatures)
+
+* Six new string iterators have been added to the string library:
+ string.characters (one 1-letter string)
+ string.bytes (one byte)
+ string.characterpairs (two 1-letter strings)
+ string.bytepairs (two bytes)
+ string.utfcharacters (a one-character utf-8 string)
+ string.utfvalues (a unicode code point number)
+
+* The top 256 values of the unicode range (starting at hex
+ value "10FF00) are now reserved for byte output. Characters
+ in that range will be written by luatex after substracting
+ that offset. The net result is that \char"10FFA9 is written
+ as byte value hex A9 = decimal 169 = copyright sign in latin1
+
+ This trick allows byte-oriented output to \pdfliterals and
+ \specials, but should be considered very experimental.
+
+* There is a new callback called 'process_input_buffer' that can
+ be used to mutate the line buffer just before LuaTeX actually
+ starts looking at it.
+
+* The statistics table now has readable items
+ statistics.inputid
+ statistics.lasterrorstring
+ that represent TeX's current input id and the last error string
+
+* The show_error_hook callback no longer receives any arguments
+* There is a new switch: --safer. This disables a number of lua
+ functions that are more or less dangerous (a detailed list is
+ in the manual)
+
+* Two longstanding bugs have been fixed: \latelua works once
+ again (patch by Hartmut) and a bug that caused mysterious crashes
+ turned out to be a problem inside the paragraph builder
+ (reconstitution of ligatures)
+
+* Six new string iterators have been added to the string library:
+ string.characters (one 1-letter string)
+ string.bytes (one byte)
+ string.characterpairs (two 1-letter strings)
+ string.bytepairs (two bytes)
+ string.utfcharacters (a one-character utf-8 string)
+ string.utfvalues (a unicode code point number)
+
+* The top 256 values of the unicode range (starting at hex
+ value "10FF00) are now reserved for byte output. Characters
+ in that range will be written by luatex after substracting
+ that offset. The net result is that \char"10FFA9 is written
+ as byte value hex A9 = decimal 169 = copyright sign in latin1
+
+ This trick allows byte-oriented output to \pdfliterals and
+ \specials, but should be considered very experimental.
+
+* There is a new callback called 'process_input_buffer' that can
+ be used to mutate the line buffer just before LuaTeX actually
+ starts looking at it.
+
+* The statistics table now has readable items
+ statistics.inputid
+ statistics.lasterrorstring
+ that represent TeX's current input id and the last error string
+
+* The show_error_hook callback no longer receives any arguments
+
+* The statistics table now has readable items
+ statistics.luabytecodes
+ statistics.luastates
+ statistics.luabytecode_bytes
+ statistics.luastate_bytes
+ for memory statistics reporting
+
+
+* The statistics table now has readable items
+ statistics.luabytecodes
+ statistics.luastates
+ statistics.luabytecode_bytes
+ statistics.luastate_bytes
+ for memory statistics reporting
+
+
+==============================================================
+Luatex snapshot-20061204 was released 20061204
+==============================================================
+
+* The LuaTeX interpreter can now be run as a standalone lua script
+ processor, by using a commandline like this:
+
+ luatex --luaonly=luatools.lua
+
+* Luafilesystem (http://www.keplerproject.org/luafilesystem/ ) is
+ included.
+
+* There are a total of eight new file discovery callbacks:
+ find_vf_file
+ find_ocp_file
+ find_map_file
+ find_enc_file
+ find_sfd_file
+ find_pk_file
+ find_data_file
+ find_opentype_file
+ this enhances the orthogonality of the callback system, nothing
+ fundamental is changed.
+
+* There is a new callback called 'process_input_buffer' that can
+ be used to mutate the line buffer just before LuaTeX actually
+ starts looking at it.
+
+* The 'reader' and 'close' functions from 'open_read_file' now
+ receive the table they are defined in as a function argument,
+ that can be used as a per file localized data store.
+
+* Updated the Lua to the latest 5.1.1, with all known bug patches
+ from the website applied as well
+
+* Runtime autoloading of lua .so files is now off on all platforms.
+
+* The statistics table now has readable items
+ statistics.filename
+ statistics.linenumber
+ that represent TeX's current file name and line number
+
+* The support for user-defined type3 font .pgc files and the
+ associated 'read_miscfonts_file' callback has been removed.
+ (nobody used it anyway)
+
+* General cleanups to the source tree and build process.
+
+==============================================================
+Luatex snapshot-20061023 was released 20061023
+==============================================================
+
+* there was a missing callback: find_font_file
+* program_invocation_name was not set
+* buf_size could not be more that 300k
+
+
+==============================================================
+Luatex snapshot-20061013 was released 20061013
+==============================================================
+
+Last friday I uploaded a new snapshot and today I finally
+finished updating the manual to go with it. The changes all
+relate to startup, file i/o, and callbacks. The main achievement
+is: you can now run luatex without it *ever* initializing kpathsea.
+
+Because I am lazy, I have checked in the pdf of the manual
+as well, so that I can say: Please look at
+
+ https://foundry.supelec.fr/plugins/scmsvn/viewcvs.php/manual/
+ /luatexref-t.pdf?root=luatex&rev=148&view=log
+
+for all the details. :-)
+
+==============================================================
+Luatex snapshot-20061002 was released 20061002
+==============================================================
+
+
+* Some infrastructure changes:
+
+ libs/slnunicode-0.9.1/ renamed to libs/slnunicode/
+ libs/zziplib added
+ libs/luazip added
+
+ (zziplib is using a different version of autofoo. I know I have
+ messed up something in the build process, but the bit we need
+ compiles ok so I've postponed attempting to fix it)
+
+* The callback logic has changed quite a bit.
+
+ - all callbacks are now only possible in lua state 0.
+
+ - The callback 'input_line' has disappeared, and is replaced by
+ 'open_read_file'. One of the return values of that callback
+ is a table that defines a 'reader' function for line reading.
+
+ See the manual for further information on this.
+
+ - There are some new callbacks for the reading of various binary
+ files. The current ones are:
+
+ "read_ocp_file", "read_vf_file", "read_data_file", "read_font_file",
+ "read_map_file".
+
+ The rest of the file types will follow soon (fonts, enc files, and
+ images).
+
+ - There are also some new callbacks that 'find' a file's pathname:
+
+ "find_truetype_file", "find_type1_file", "find_image_file"
+
+ here too, more will follow later.
+
+ - the functions from io. that were copied to texio have been removed
+ again. The new callbacks do not pass file pointers around, so
+ they ere not longer needed
+
+ - the 'open_write_file' is temporarily unavailable
+
+* startup.lua is now always loaded into lua state 0
+
+* The luazip library from kepler is linked in, so there the table 'zip'
+ is accessible from all lua states.
+
+==============================================================
+Luatex snapshot-20060922 was released 20060922
+==============================================================
+
+* The texio table has gained a new function:
+
+ tex_file = texio.open(filename)
+
+ returns a file handle of a type that luatex can use
+ internally (the return of io.open is unusable in callbacks
+ because it will be garbage-collected at a random time)
+
+
+* In related news, there are two new callbacks you can define:
+
+ callback.register('open_read_file', f)
+ callback.register('open_write_file', f)
+
+ where your function should have the following conventions:
+
+ function f (number id_number, string asked_name)
+ return boolean success, string actual_name, tex_file filep
+ end
+
+ id_number: zero for the log or \input files or TeX's \read
+ number incremented by one (\read0 becomes 1).
+ asked_name: the user-supplied filename
+
+ success: return false for error, true otherwise.
+
+ The remaining two items are only looked at if you return true:
+
+ actual_name: the true filename used (with extension!)
+ filep: a file object opened though texio.open()
+
+
+* The tex.print function has an extra optional parameter:
+
+ tex.print(ctt_id n, strings ...)
+
+ This prints the strings using the catcode regime defined by
+ \catcodetable n (assuming n is valid, see below)
+
+* The new function tex.sprint has the same lua conventions as
+ tex.print, but behaces slightly different on the tex side:
+
+ ** tex does not switch to the 'new_line' state (this implies
+ that leading spaces are not ignored)
+ ** no \endlinechars are inserted
+ ** trailing spaces are not removed from the argument
+
+* Catcode tables are a completely new feature, that allows
+ you to switch the current catcode regime in one simple
+ statement:
+
+ \catcodetable <count>
+
+ Switches to the use of a different set of catcodes (table),
+ that is stored under the number <count>. Such a table has to
+ be previously created using one of the two command below, or
+ the number 0 (which is pre-inititialized)
+
+ This command obeys normal grouping rules.
+
+ \initcatcodetable <count>
+
+ creates a new, global, independent catcode table with catcodes
+ matching the code that are predefined by initex (tex -ini).
+
+ This allocation is global
+
+ \savecatcodetable <count>
+
+ copies the current set of catcodes to a new, global, table
+ with id number <count>. The definitions in this new table
+ are all treated as if they were made in the outermost level.
+
+ This allocation is global
+
+ At the end of each grouping level, items within all existing
+ catcodetables are restored, regardless of which one is the
+ currently active table.
+
+ Catcode table numbers cannot be larger than 0xFFFFFFF (228-1)
+
+* There is a new lua table: lua. It contains three read-only
+ items:
+
+ lua.id -- the id number of the instance
+ lua.version -- a luatex version identifier string
+ lua.startupfile -- the full filename (+path) of startup.lua
+
+ and it also contains a read/write array:
+
+ lua.bytecode[] -- lua executable bytecode
+
+ This array can be used to save and restore lua functions
+ across lua states. The accepted values are for assignments
+ are functions and nil. Likewise, the retrieved value is
+ either a function or nil.
+
+ The contents of the lua.bytecode array is stored inside the
+ format file, so it can also be used to preload lua code.
+
+
+* The format files are quire a bit smaller than before
+
+
+==============================================================
+Luatex snapshot-20060915 was released 20060915
+==============================================================
+
+* There is a new TEX primitive: \formatname. It is similar
+ to \jobname (read-only). In initex, the expansion is empty,
+ otherwise the expansion is the same as the \jobname from
+ the initex run.
+
+* the lua "tex" table has been expanded with a few of the 'convert'
+ codes (read-only). The supported ones at this moment are:
+
+ tex.eTeXVersion
+ tex.OmegaVersion
+ tex.AlephVersion
+ tex.pdftexrevision
+ tex.pdftexbanner
+ tex.pdfnormaldeviate
+ tex.jobname
+ tex.formatname
+ tex.eTeXrevision
+ tex.Omegarevision
+ tex.Alephrevision
+
+ This list looks haphazard, but it really is not. These are
+ all the cases of the 'convert' internal command that do not
+ require an argument.
+
+* The metatables of the subtables like tex.dimen[] etc. are now
+ adjustable from lua (not that I recommend doing that;-)).
+
+* On the lua side, there is a new global value: "luaid"
+ It holds the internal id number of this \directlua instance.
+
+* There is a new lua table, "callback", that has the single function
+ "callback.register", used to register callbacks. This replaces
+ the previous concoction (see my message about snapshot 20060901).
+ Syntax is :
+
+ callback.register(<callback name>,function (f) ... end)
+
+ where the <callback name> is for the moment, either "input_line"
+ or "show_error_hook".
+
+ This function internalizes the callback function in such a way
+ that you no longer have to worry about \luacallback (which has
+ been removed), nor does it matter if you redefine a function
+ accidentally.
+
+ The internal testing for callback presence is also quite a bit
+ faster, thanks to this change. Callback assignments are global
+ and the "input_line" always takes effect starting on the next
+ input line to be read from an actual file.
+
+
+* \detokenizedlua has been removed. It is functionally replaced by
+ the new function call tex.write("").
+
+ Each argument to each call of tex.write () counts as an input
+ line, but:
+ ** all catcodes on that line are either 'space' (for " ") or
+ 'character' for all others.
+ ** there is no \newlinechar appended.
+
+* The implementation of tex.print() has changed as well:
+
+ ** the very last tex.print() line from a \directlua
+ will no longer have a trailing \newlinechar
+ (this is very convenient when \directlua is used
+ within an \edef)
+ ** tex.print() is quite a lot faster than before, and the total amount
+ of returnable text from a \directlua is now only limited by
+ available system RAM. However, each separate tex.print ()
+ argument has to fit in TeX's input buffer.
+
+* The new primitive \luastartup can be set inside the format file
+ to specify the lua instance number in which a possible runtime
+ startup.lua script is executed (initex always uses 0)
+
+* There is a new primitive \scantextokens. Differences with
+ eTeX's \scantokens are:
+
+ ** the last line (usually only) from \scantextokens
+ does not have a \newlinechar
+
+ ** \scantextokens never raises an eof error.
+
+ This means things like
+
+ \edef\testone
+ {\scantextokens{\ifnum1=1 true}\else false\fi}
+
+ are legal input (but potentially dangerous!).
+
+* If you say
+ local d = tex.dimen["unknowndimen"]
+ 'd' will now become "nil" instead of raising an error
+
+ However,
+ tex.dimen["unknowndimen"] = d
+ is still (and probably will remain) illegal
+
+==============================================================
+Luatex snapshot-20060908 was released 20060908
+==============================================================
+
+* BIG CHANGE: \directlua now runs \scantokens internally.
+
+ There is no longer a need to call scantokens yourself, the
+ tex.print() output is now fed straight into a pseudo file.
+ This is quite a bit faster as well as easier to use, but
+ just in case you want it, the old behaviour is still present,
+ under the new name
+
+ \detokenizedlua
+
+
+* The texio library now has its own (partial) set of I/O commands,
+ so that the standard lua io library is back to the distributed
+ state (no more patched garbage collector)
+
+ Note: This is really a very small change (it should not have any
+ impact on wellbehaved input files), but I attempt to be complete
+ in these notes, since there is no official documentation yet.
+
+
+* There is a new standard library available: kpse
+
+ The most important function in that library is find_file:
+
+ string = kpse.find_file(string filename
+ [,string type]
+ [,boolean mustexist])
+
+ both "type" and "mustexist" are optional, so the function
+ has from one upto three arguments.
+
+ "type" is like the '-format' argument of kpsewhich. You can
+ run 'kpsewich -h' for a list. The default type is "tex".
+
+ "mustexist" is like '-must-exist', and the default is false.
+ If you specify "true" (or a nonzero integer), then the kpse
+ library will search the disk as well as the ls-R databases
+
+ The new library also has three other functions that map
+ straight to kpsewhich commandline options:
+
+ string = kpse.expand_path(string)
+ string = kpse.expand_var(string)
+ string = kpse.expand_braces(string)
+
+* There is a second callback possibility:
+
+ texio.show_error_hook(string message,
+ string|number indicator,
+ number lineno)
+
+ This command is run from inside the TeX error function, and the
+ idea is to allow you to do some extra reporting on top of what
+ TeX already does (none of the normal actions are removed).
+
+ "message" is the formal error message tex has given to the
+ user (the line after the "! ")
+ "indicator" is either a filename (when it is a string) or a
+ location indicator (a number) that can means lots of different
+ things like a token list id or a \read number.
+ "lineno" is the current line number
+
+ This is an investigative item only, comments are welcome but do
+ not take the syntax seriously.
+
+ The final goal IMO is the total replacement of TeX's error
+ handling routines, but that needs lots of adjustments
+ in the web source because TeX deals with errors in a somewhat
+ haphazard fashion (it needs unification first). The current
+ hook is only for 'testing the water'.
+
+* It is now possible to use named items in the
+
+ tex.count[]
+ tex.dimen[]
+ tex.toks[]
+
+ subtables, so you can have
+
+ tex.count.scratchcounter = 0
+ local enormous = tex.dimen["maxdimen"]
+
+ Luatex looks up the value for you on the fly. You have to use a
+ valid \countdef (or \dimendef, or \toksdef), anything else will
+ generate an error.
+
+ In a normal TeX file, you don't do \dimen\maxdimen, but the
+ lua syntax seems to be a bit cleaner to me. The intention is
+ to evntually also allow \chardefs and macros that expand
+ into a number (todo)
+
+
+* The tex table has also been extended with a large list of internal
+ parameters (partially read/write). It is possible to access
+ about every primitive that you can use after \the *and* is a
+ single token. So there is
+
+ integer = tex.tracingcommands (\the\tracingcommands)
+ integer = tex.prevgraf (\the\prevgraf)
+ string = tex.output (\the\output)
+
+ etc. for all of the internal parameters, but not the items
+ that need extra arguments (like \the\scriptfont )
+
+ The subset comprising simple integer and dimension registers
+ are writable as well as readable (stuff like \tracingcommands
+ and \parindent).
+
+ The fact that both lists are still quite limited is a result of
+ the very different types of things that can occur after \the and
+ also on the LHS of an assignment. The remaining primitives will
+ be filled in when there is a real need or implementation becomes
+ simple, whichever comes first.
+
+
+
+==============================================================
+Luatex snapshot-20060901 was released 20060901
+==============================================================
+
+All changes are related to lua this time, and most are quite unstable
+/ experimental. But first the things that are stabel/fixed bugs:
+
+* A VF loading bug that turned up in some of Hans' fonts
+ has been fixed
+
+* A small series of bounds checking fixes to \ocplist has been
+ added to prevent the system from crashing due to array indexes
+ running out of bounds.
+
+* The Lua file searching paths are now fixed. The search path for lua
+ script files now contains the following items (tried in order)
+ 1. the local directory:
+ ./?.lua
+ (for document-specific files)
+ 2. the items from the expansion of kpathsea's $TEXMFSCRIPTS variable,
+ but only the parts containing 'lua' as a subpath:
+ $TEXMFSCRIPTS<lua>/?.lua
+ $TEXMFSCRIPTS<lua>/?/init.lua
+ (for format-specific files)
+ 3. the $SELFAUTOPARENT sibling directory named 'lib'.
+ $SELFAUTOPARENT/lib/lua/5.1/?.lua
+ $SELFAUTOPARENT/lib/lua/5.1/?/init.lua
+ (for files that are not related to tex)
+
+ The search path for dynamic libraries has only
+ 1. the local directory:
+ ./?.so
+ (for document-specific files)
+ 2. and the $SELFAUTOPARENT sibling directory named 'lib'.
+ $SELFAUTOPARENT/lib/lua/5.1/?.so
+
+ (of course the extension is .dll on windows, but .dlls do not
+ work at the moment so it will not do you much good)
+
+* There are two functions available within a new table called
+ texio:
+ texio.write (luastring)
+ texio.write_nl (luastring)
+ both write the luastring to the same location(s) TeX writes
+ its stuff. So if \batchmode is on, it writes only to the
+ log, inside a \write, it prints to the current write file,
+ etc.
+
+ A read|write interface to TeX's "file selector" will
+ follow shortly.
+
+* At startup, luatex searches for a script named
+ startup.lua
+ in the path list I explained above. If such a file exists, it is
+ loaded.
+
+ This happens right before the first input file needs to be opened
+ (that is after format loading, but before any \everyjob tokens).
+
+ From within the script, you can check the value of
+
+ tex.formatname
+
+ that is the 'format identification' as used by TEX. When the variable
+ is equal to nil, luatex in in 'initex' mode, otherwise it will be
+ something like: " (format=plain 2006.9.1)"
+
+
+Now for the experimental portion: callbacks. Here is what I have done
+so far:
+
+* The main reason for wanting startup.lua is file (input) re-encoding.
+ For this purpose, it is now possible to set up a callback for
+ luatex to execute.
+
+ If you attach a Lua function to
+
+ texio.input_line
+
+ then from the next input line onwards, luatex will run that
+ function whenever it needs a new input line from a text file.
+
+ Your function will receive a file handle as argument, and
+ should return either a string or nil (with nil signalling that
+ the end of file has occurred).
+
+ The trivial case is simply this:
+
+ function reader (f)
+ return f:read()
+ end
+ texio.input_line = reader
+
+
+ Warning: The implementation is not totally finished yet. For the
+ moment the file handle ("f" in the example) is a normal lua file,
+ with a simple but important restriction: you cannot alter its value.
+ You cannot f:close() it, or assign it a different value. luatex
+ will eventually close the file itself.
+
+ The restriction is a side-effect of a synchronisation problem with
+ the lua garbage collector. Because of this, it also was necessary
+ to turn off the automatic file closing code for normal lua io
+ files (In other words: you have to close yourself all the files
+ you opened yourself, and you should not close any files you did
+ not open yourself).
+
+ In the near future, "f" will become a special 'texio' file object
+ and the needed functionality from the normal io library will be
+ reimplemented. Along with that change, there will also be a callback
+ to open (i.e. find) files, and a simple interface to the compiled-in
+ kpathsea to use within that callback.
+
+
+==============================================================
+Luatex snapshot-20060825 was released 20060825
+==============================================================
+
+The main change in this snapshot is that it uses far less memory.
+luatex -ini on my linux machine went from 326Mb (last week) to
+93Mb (now), and "texexec luatex" now ends at 184Mb instead of
+over 1/2Gb.
+
+This is achieved by two big changes:
+
+* The \mathcode, \delcode, \catcode, \sfcode, \lccode and \uccode
+ tables are now sparse arrays that are implemented in C. They
+ are no longer part of the TeX "equivalence table" and because
+ each had 1.1 million entries with a few memory words each, this
+ makes a major difference.
+
+ See mathcodes.c and textcodes.c if you are interested in the
+ gory details, but be warned: the code is still extremely
+ rough and ugly. In particular, the dump and undump routines
+ are far from optimal, resulting in somewhat larger format files
+ than before (approx 1.3Mb larger with unicode-letters loaded,
+ 10k without); and the assignments do not show up when using
+ the etex tracing routines \tracingassigns and \tracingrestores
+ (code simply not written yet)
+
+* Single-character commands are no longer "special" internally,
+ they are stored in the hash just like the multiletter csnames.
+
+
+==============================================================
+Luatex snapshot-20060818 was released 20060818
+==============================================================
+
+The snapshot is up to par with Aleph-RC4 (from texlive devel)
+and the latest pdftex beta (even newer than 20060811). However,
+there are some differences, to summarize:
+
+* There is no pool file (all strings are embedded)
+
+* -8bit and -translate-file are silently ignored
+
+* There is no mltex nor enctex (conflicts with aleph)
+
+* The tex functionality is always present and enabled
+ (but see below about TeXXeT), so the asterisk or
+ -etex switch for initex is not needed
+
+* "plus 1 filllllllll" does not generate any errors from TeX
+
+* TeXXeT (from eTeX) is not present, so the primives
+ \TeXXeTstate
+ \beginR
+ \beginL
+ \endR
+ \endL
+ are missing
+
+* The experimental pdftex regex match operations are removed,
+ because that feature does not make much sense when lua is
+ available so the primitives
+ \pdfmatch
+ \pdflastmatch
+ are missing
+
+* The input translations from Aleph are not implemented, the
+ 16 related primitives are all missing
+ \DefaultInputMode
+ \noDefaultInputMode
+ \noInputMode
+ \InputMode
+ \DefaultOutputMode
+ \noDefaultOutputMode
+ \noOutputMode
+ \OutputMode
+ \DefaultInputTranslation
+ \noDefaultInputTranslation
+ \noInputTranslation
+ \InputTranslation
+ \DefaultOutputTranslation
+ \noDefaultOutputTranslation
+ \noOutputTranslation
+ \OutputTranslation
+ All file IO assumes UTF-8, except that all the low-ascii
+ controls except TAB, CR en LF are written to the terminal
+ using ^^ notation (even these are binary in the log file).
+
+* Input characters can use the full range of Unicode,
+ but it probably only makes sense to use values above
+ the base plane for \mathcode and \catcode assignments,
+ since the fonts as well as the hyphenation patterns
+ are strictly 16-bit still.
+
+* The primitives
+ \pdfpagewidth and \pagewidth,
+ \pdfpageheight and \pageheight,
+ \fontcharwd and \charwd,
+ \fontcharht and \charht,
+ \fontchardp and \chardp,
+ \fontcharic and \charic,
+ are all aliases of eachother.
+
+* The new primitive
+ \clearmarks<number>
+ clears a marks class completely.
+
+* The experimental pdftex primitives
+ \pdfprimitive
+ \ifpdfprimitive
+ \ifpdfabsnum
+ \ifpdfabsdim
+ and provided without the extra 'pdf' prefix, so they are
+ simply called
+ \primitive
+ \ifprimitive
+ \ifabsnum
+ \ifabsdim
+ instead.
+
+* I probably forgot to mention some things :-) \ No newline at end of file
diff --git a/Build/source/texk/web2c/luatexdir/am/luatex.am b/Build/source/texk/web2c/luatexdir/am/luatex.am
index 7bbb26b3aee..9e3a5c69f1b 100644
--- a/Build/source/texk/web2c/luatexdir/am/luatex.am
+++ b/Build/source/texk/web2c/luatexdir/am/luatex.am
@@ -13,10 +13,10 @@ luatex_tangle = WEBINPUTS=$(srcdir)/luatexdir $(buildenv) $(LUATANGLE)
luatex_CPPFLAGS = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(XPDF_INCLUDES)
luatex_CPPFLAGS += $(OBSDCOMPAT_INCLUDES) -I$(srcdir)/libmd5
-luatex_CPPFLAGS += -Iluatexdir -I$(srcdir)/luatexdir -I$(srcdir)/luatexdir/lua51
+luatex_CPPFLAGS += -Iluatexdir -I$(srcdir)/luatexdir -I$(srcdir)/luatexdir/lua51 -I$(srcdir)/luatexdir/mp
luatex_CPPFLAGS += -Dextra_version_info=`date +-%Y%m%d%H`
-luatex_ldadd = libluatex.a libff.a libluamisc.a libzzip.a liblua51.a
+luatex_ldadd = libluatex.a libff.a libluamisc.a libzzip.a libluasocket.a liblua51.a
luatex_ldadd += $(LIBPNG_LIBS) $(ZLIB_LIBS) $(XPDF_LIBS)
luatex_ldadd += $(OBSDCOMPAT_LIBS) libmd5.a
@@ -155,7 +155,7 @@ EXTRA_LIBRARIES += libzzip.a
libzzip_a_DEPENDENCIES = liblua51.a
libzzip_a_CPPFLAGS = \
- $(KPSE_ZLIB_INCLUDES) \
+ $(ZLIB_INCLUDES) \
-I$(top_srcdir)/luatexdir/zziplib
libzzip_a_SOURCES = \
@@ -227,14 +227,131 @@ EXTRA_DIST += \
luatexdir/zziplib/zzipback.sed \
luatexdir/zziplib/zzipwrap
-## libluamisc (luafilesystem, luamd5, luapeg, luazip, luazlib,
+
+## luasocket
+##
+EXTRA_LIBRARIES += libluasocket.a
+
+libluasocket_a_DEPENDENCIES = $(ZLIB_DEPEND) libzzip.a
+
+libluasocket_a_CPPFLAGS = \
+ -I$(top_srcdir)/luatexdir/luasocket -I$(srcdir)/luatexdir/lua51
+
+libluasocket_a_SOURCES = \
+ luatexdir/luasocket/src/auxiliar.c \
+ luatexdir/luasocket/src/auxiliar.h \
+ luatexdir/luasocket/src/buffer.c \
+ luatexdir/luasocket/src/buffer.h \
+ luatexdir/luasocket/src/except.c \
+ luatexdir/luasocket/src/except.h \
+ luatexdir/luasocket/src/inet.c \
+ luatexdir/luasocket/src/inet.h \
+ luatexdir/luasocket/src/io.c \
+ luatexdir/luasocket/src/io.h \
+ luatexdir/luasocket/src/lua_preload.c \
+ luatexdir/luasocket/src/luasocket.c \
+ luatexdir/luasocket/src/luasocket.h \
+ luatexdir/luasocket/src/mime.c \
+ luatexdir/luasocket/src/mime.h \
+ luatexdir/luasocket/src/options.c \
+ luatexdir/luasocket/src/options.h \
+ luatexdir/luasocket/src/select.c \
+ luatexdir/luasocket/src/select.h \
+ luatexdir/luasocket/src/socket.c \
+ luatexdir/luasocket/src/socket.h \
+ luatexdir/luasocket/src/tcp.c \
+ luatexdir/luasocket/src/tcp.h \
+ luatexdir/luasocket/src/timeout.c \
+ luatexdir/luasocket/src/timeout.h \
+ luatexdir/luasocket/src/udp.c \
+ luatexdir/luasocket/src/udp.h \
+ luatexdir/luasocket/src/usocket.h
+
+
+EXTRA_DIST += \
+ luatexdir/luasocket/src/socket_lua.c \
+ luatexdir/luasocket/src/ftp_lua.c \
+ luatexdir/luasocket/src/http_lua.c \
+ luatexdir/luasocket/src/smtp_lua.c \
+ luatexdir/luasocket/src/tp_lua.c \
+ luatexdir/luasocket/src/url_lua.c \
+ luatexdir/luasocket/src/ltn12_lua.c \
+ luatexdir/luasocket/src/mime_lua.c
+
+## Not used
+##
+EXTRA_DIST += \
+ luatexdir/luasocket/src/Makefile \
+ luatexdir/luasocket/src/unix.c \
+ luatexdir/luasocket/src/unix.h \
+ luatexdir/luasocket/src/usocket.c \
+ luatexdir/luasocket/src/wsocket.c \
+ luatexdir/luasocket/src/wsocket.h \
+ luatexdir/luasocket/src/ftp.lua \
+ luatexdir/luasocket/src/http.lua \
+ luatexdir/luasocket/src/smtp.lua \
+ luatexdir/luasocket/src/tp.lua \
+ luatexdir/luasocket/src/url.lua \
+ luatexdir/luasocket/src/ltn12.lua \
+ luatexdir/luasocket/src/mime.lua \
+ luatexdir/luasocket/LICENSE \
+ luatexdir/luasocket/NEW \
+ luatexdir/luasocket/README \
+ luatexdir/luasocket/config \
+ luatexdir/luasocket/luasocket.sln \
+ luatexdir/luasocket/makefile \
+ luatexdir/luasocket/mime.vcproj \
+ luatexdir/luasocket/socket.vcproj \
+ luatexdir/luasocket/doc/dns.html \
+ luatexdir/luasocket/doc/ftp.html \
+ luatexdir/luasocket/doc/http.html \
+ luatexdir/luasocket/doc/index.html \
+ luatexdir/luasocket/doc/installation.html \
+ luatexdir/luasocket/doc/introduction.html \
+ luatexdir/luasocket/doc/ltn12.html \
+ luatexdir/luasocket/doc/luasocket.png \
+ luatexdir/luasocket/doc/mime.html \
+ luatexdir/luasocket/doc/reference.css \
+ luatexdir/luasocket/doc/reference.html \
+ luatexdir/luasocket/doc/smtp.html \
+ luatexdir/luasocket/doc/socket.html \
+ luatexdir/luasocket/doc/tcp.html \
+ luatexdir/luasocket/doc/udp.html \
+ luatexdir/luasocket/doc/url.html \
+ luatexdir/luasocket/etc/README \
+ luatexdir/luasocket/etc/b64.lua \
+ luatexdir/luasocket/etc/check-links.lua \
+ luatexdir/luasocket/etc/check-memory.lua \
+ luatexdir/luasocket/etc/dict.lua \
+ luatexdir/luasocket/etc/dispatch.lua \
+ luatexdir/luasocket/etc/eol.lua \
+ luatexdir/luasocket/etc/forward.lua \
+ luatexdir/luasocket/etc/get.lua \
+ luatexdir/luasocket/etc/lp.lua \
+ luatexdir/luasocket/etc/qp.lua \
+ luatexdir/luasocket/etc/tftp.lua \
+ luatexdir/luasocket/samples/README \
+ luatexdir/luasocket/samples/cddb.lua \
+ luatexdir/luasocket/samples/daytimeclnt.lua \
+ luatexdir/luasocket/samples/echoclnt.lua \
+ luatexdir/luasocket/samples/echosrvr.lua \
+ luatexdir/luasocket/samples/listener.lua \
+ luatexdir/luasocket/samples/lpr.lua \
+ luatexdir/luasocket/samples/talker.lua \
+ luatexdir/luasocket/samples/tinyirc.lua \
+ luatexdir/luasocket/test/README \
+ luatexdir/luasocket/test/testclnt.lua \
+ luatexdir/luasocket/test/testsrvr.lua \
+ luatexdir/luasocket/test/testsupport.lua
+
+## libluamisc (luafilesystem, luamd5, luapeg, luazip, luazlib, luaprofiler,
## and slnunicode)
EXTRA_LIBRARIES += libluamisc.a
-libluamisc_a_DEPENDENCIES = $(KPSE_ZLIB_DEPEND) libzzip.a
+libluamisc_a_DEPENDENCIES = libluasocket.a
libluamisc_a_CPPFLAGS = \
- $(KPSE_ZLIB_INCLUDES) \
+ $(ZLIB_INCLUDES) \
-I$(top_srcdir)/luatexdir/lua51 \
-I$(top_srcdir)/luatexdir/zziplib
@@ -245,6 +362,16 @@ libluamisc_a_SOURCES = \
luatexdir/luamd5/md5.h \
luatexdir/luamd5/md5lib.c \
luatexdir/luapeg/lpeg.c \
+ luatexdir/luaprofiler/clocks.h \
+ luatexdir/luaprofiler/core_profiler.h \
+ luatexdir/luaprofiler/function_meter.h \
+ luatexdir/luaprofiler/luaprofiler.h \
+ luatexdir/luaprofiler/stack.h \
+ luatexdir/luaprofiler/clocks.c \
+ luatexdir/luaprofiler/core_profiler.c \
+ luatexdir/luaprofiler/function_meter.c \
+ luatexdir/luaprofiler/lua50_profiler.c \
+ luatexdir/luaprofiler/stack.c \
luatexdir/luazip/src/luazip.c \
luatexdir/luazip/src/luazip.h \
luatexdir/luazlib/lgzip.c \
@@ -258,14 +385,19 @@ EXTRA_libluamisc_a_SOURCES = luatexdir/slnunicode/slnudata.c
##
EXTRA_DIST += \
luatexdir/luafilesystem/Makefile \
+ luatexdir/luafilesystem/Makefile.win \
+ luatexdir/luafilesystem/README \
luatexdir/luafilesystem/config \
+ luatexdir/luafilesystem/config.win \
luatexdir/luafilesystem/doc \
+ luatexdir/luafilesystem/src/lfs.def \
luatexdir/luafilesystem/tests \
luatexdir/luafilesystem/vc6 \
luatexdir/luamd5/makefile \
luatexdir/luamd5/md5.html \
luatexdir/luamd5/md5.lua \
luatexdir/luamd5/md5tests.lua \
+ luatexdir/luaprofiler/Makefile \
luatexdir/luazip/Makefile \
luatexdir/luazip/README \
luatexdir/luazip/config \
@@ -292,110 +424,133 @@ libff_a_CPPFLAGS = \
-D_NO_PYTHON=1 -DX_DISPLAY_MISSING=1 -DNODYNAMIC=1 \
-D_NO_FREETYPE=1 -D_NO_LIBUNINAMESLIST=1 -UHAVE_LIBINTL_H \
-I$(top_srcdir)/luatexdir/lua51 \
- -I$(top_srcdir)/luatexdir/luafontforge/fontforge/inc \
- -I$(top_srcdir)/luatexdir/luafontforge/fontforge/fontforge
+ -I$(top_srcdir)/luatexdir/luafontloader/fontforge/inc \
+ -I$(top_srcdir)/luatexdir/luafontloader/fontforge/fontforge
libff_a_SOURCES = \
- luatexdir/luafontforge/fontforge/Unicode/alphabet.c \
- luatexdir/luafontforge/fontforge/Unicode/char.c \
- luatexdir/luafontforge/fontforge/Unicode/cjk.c \
- luatexdir/luafontforge/fontforge/Unicode/gwwiconv.c \
- luatexdir/luafontforge/fontforge/Unicode/memory.c \
- luatexdir/luafontforge/fontforge/Unicode/ustring.c \
- luatexdir/luafontforge/fontforge/fontforge/autohint.c \
- luatexdir/luafontforge/fontforge/fontforge/charview.c \
- luatexdir/luafontforge/fontforge/fontforge/configure-pfaedit.h \
- luatexdir/luafontforge/fontforge/fontforge/contextchain.c \
- luatexdir/luafontforge/fontforge/fontforge/edgelist.h \
- luatexdir/luafontforge/fontforge/fontforge/edgelist2.h \
- luatexdir/luafontforge/fontforge/fontforge/encoding.c \
- luatexdir/luafontforge/fontforge/fontforge/featurefile.c \
- luatexdir/luafontforge/fontforge/fontforge/fontinfo.c \
- luatexdir/luafontforge/fontforge/fontforge/fontview.c \
- luatexdir/luafontforge/fontforge/fontforge/fvfonts.c \
- luatexdir/luafontforge/fontforge/fontforge/groups.h \
- luatexdir/luafontforge/fontforge/fontforge/kernclass.c \
- luatexdir/luafontforge/fontforge/fontforge/lookups.c \
- luatexdir/luafontforge/fontforge/fontforge/macbinary.c \
- luatexdir/luafontforge/fontforge/fontforge/macenc.c \
- luatexdir/luafontforge/fontforge/fontforge/namelist.c \
- luatexdir/luafontforge/fontforge/fontforge/ofl.h \
- luatexdir/luafontforge/fontforge/fontforge/parsepfa.c \
- luatexdir/luafontforge/fontforge/fontforge/parsettf.c \
- luatexdir/luafontforge/fontforge/fontforge/parsettfatt.c \
- luatexdir/luafontforge/fontforge/fontforge/parsettfvar.c \
- luatexdir/luafontforge/fontforge/fontforge/pfaedit.h \
- luatexdir/luafontforge/fontforge/fontforge/pfaeditui.h \
- luatexdir/luafontforge/fontforge/fontforge/plugins.h \
- luatexdir/luafontforge/fontforge/fontforge/prefs.c \
- luatexdir/luafontforge/fontforge/fontforge/psfont.h \
- luatexdir/luafontforge/fontforge/fontforge/psread.c \
- luatexdir/luafontforge/fontforge/fontforge/pua.c \
- luatexdir/luafontforge/fontforge/fontforge/sd.h \
- luatexdir/luafontforge/fontforge/fontforge/splinefill.c \
- luatexdir/luafontforge/fontforge/fontforge/splinefont.h \
- luatexdir/luafontforge/fontforge/fontforge/splineorder2.c \
- luatexdir/luafontforge/fontforge/fontforge/splineoverlap.c \
- luatexdir/luafontforge/fontforge/fontforge/splinerefigure.c \
- luatexdir/luafontforge/fontforge/fontforge/splinesave.c \
- luatexdir/luafontforge/fontforge/fontforge/splinestroke.c \
- luatexdir/luafontforge/fontforge/fontforge/splineutil.c \
- luatexdir/luafontforge/fontforge/fontforge/splineutil2.c \
- luatexdir/luafontforge/fontforge/fontforge/stamp.c \
- luatexdir/luafontforge/fontforge/fontforge/start.c \
- luatexdir/luafontforge/fontforge/fontforge/stemdb.c \
- luatexdir/luafontforge/fontforge/fontforge/stemdb.h \
- luatexdir/luafontforge/fontforge/fontforge/tottf.c \
- luatexdir/luafontforge/fontforge/fontforge/tottfgpos.c \
- luatexdir/luafontforge/fontforge/fontforge/ttf.h \
- luatexdir/luafontforge/fontforge/fontforge/tottfvar.c \
- luatexdir/luafontforge/fontforge/fontforge/ttfspecial.c \
- luatexdir/luafontforge/fontforge/fontforge/unicoderange.h \
- luatexdir/luafontforge/fontforge/fontforge/views.h \
- luatexdir/luafontforge/fontforge/inc/basics.h \
- luatexdir/luafontforge/fontforge/inc/chardata.h \
- luatexdir/luafontforge/fontforge/inc/charset.h \
- luatexdir/luafontforge/fontforge/inc/dynamic.h \
- luatexdir/luafontforge/fontforge/inc/fileutil.h \
- luatexdir/luafontforge/fontforge/inc/gdraw.h \
- luatexdir/luafontforge/fontforge/inc/gfile.h \
- luatexdir/luafontforge/fontforge/inc/ggadget.h \
- luatexdir/luafontforge/fontforge/inc/gicons.h \
- luatexdir/luafontforge/fontforge/inc/gio.h \
- luatexdir/luafontforge/fontforge/inc/gkeysym.h \
- luatexdir/luafontforge/fontforge/inc/gprogress.h \
- luatexdir/luafontforge/fontforge/inc/gresource.h \
- luatexdir/luafontforge/fontforge/inc/gwidget.h \
- luatexdir/luafontforge/fontforge/inc/gwwiconv.h \
- luatexdir/luafontforge/fontforge/inc/intl.h \
- luatexdir/luafontforge/fontforge/inc/ustring.h \
- luatexdir/luafontforge/fontforge/inc/utype.h \
- luatexdir/luafontforge/src/ffdummies.c \
- luatexdir/luafontforge/src/luafflib.c
+ luatexdir/luafontloader/fontforge/Unicode/ArabicForms.c \
+ luatexdir/luafontloader/fontforge/Unicode/alphabet.c \
+ luatexdir/luafontloader/fontforge/Unicode/backtrns.c \
+ luatexdir/luafontloader/fontforge/Unicode/char.c \
+ luatexdir/luafontloader/fontforge/Unicode/cjk.c \
+ luatexdir/luafontloader/fontforge/Unicode/combiners.h \
+ luatexdir/luafontloader/fontforge/Unicode/dump.c \
+ luatexdir/luafontloader/fontforge/Unicode/gwwiconv.c \
+ luatexdir/luafontloader/fontforge/Unicode/memory.c \
+ luatexdir/luafontloader/fontforge/Unicode/ucharmap.c \
+ luatexdir/luafontloader/fontforge/Unicode/unialt.c \
+ luatexdir/luafontloader/fontforge/Unicode/ustring.c \
+ luatexdir/luafontloader/fontforge/Unicode/utype.c \
+ luatexdir/luafontloader/fontforge/fontforge/PfEd.h \
+ luatexdir/luafontloader/fontforge/fontforge/autohint.c \
+ luatexdir/luafontloader/fontforge/fontforge/baseviews.h \
+ luatexdir/luafontloader/fontforge/fontforge/clipnoui.c \
+ luatexdir/luafontloader/fontforge/fontforge/configure-pfaedit.h \
+ luatexdir/luafontloader/fontforge/fontforge/cvundoes.c \
+ luatexdir/luafontloader/fontforge/fontforge/dumppfa.c \
+ luatexdir/luafontloader/fontforge/fontforge/edgelist.h \
+ luatexdir/luafontloader/fontforge/fontforge/edgelist2.h \
+ luatexdir/luafontloader/fontforge/fontforge/encoding.c \
+ luatexdir/luafontloader/fontforge/fontforge/encoding.h \
+ luatexdir/luafontloader/fontforge/fontforge/featurefile.c \
+ luatexdir/luafontloader/fontforge/fontforge/fontforgevw.h \
+ luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c \
+ luatexdir/luafontloader/fontforge/fontforge/fvcomposit.c \
+ luatexdir/luafontloader/fontforge/fontforge/fvfonts.c \
+ luatexdir/luafontloader/fontforge/fontforge/libffstamp.h \
+ luatexdir/luafontloader/fontforge/fontforge/libstamp.pre \
+ luatexdir/luafontloader/fontforge/fontforge/lookups.c \
+ luatexdir/luafontloader/fontforge/fontforge/lookups.h \
+ luatexdir/luafontloader/fontforge/fontforge/macbinary.c \
+ luatexdir/luafontloader/fontforge/fontforge/macenc.c \
+ luatexdir/luafontloader/fontforge/fontforge/mathconstants.c \
+ luatexdir/luafontloader/fontforge/fontforge/mm.c \
+ luatexdir/luafontloader/fontforge/fontforge/mm.h \
+ luatexdir/luafontloader/fontforge/fontforge/namelist.c \
+ luatexdir/luafontloader/fontforge/fontforge/noprefs.c \
+ luatexdir/luafontloader/fontforge/fontforge/nouiutil.c \
+ luatexdir/luafontloader/fontforge/fontforge/parsepfa.c \
+ luatexdir/luafontloader/fontforge/fontforge/parsettf.c \
+ luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c \
+ luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c \
+ luatexdir/luafontloader/fontforge/fontforge/pfaedit.h \
+ luatexdir/luafontloader/fontforge/fontforge/plugins.h \
+ luatexdir/luafontloader/fontforge/fontforge/psfont.h \
+ luatexdir/luafontloader/fontforge/fontforge/psread.c \
+ luatexdir/luafontloader/fontforge/fontforge/pua.c \
+ luatexdir/luafontloader/fontforge/fontforge/python.c \
+ luatexdir/luafontloader/fontforge/fontforge/scripting.h \
+ luatexdir/luafontloader/fontforge/fontforge/sd.h \
+ luatexdir/luafontloader/fontforge/fontforge/sfd1.c \
+ luatexdir/luafontloader/fontforge/fontforge/sfd1.h \
+ luatexdir/luafontloader/fontforge/fontforge/splinechar.c \
+ luatexdir/luafontloader/fontforge/fontforge/splinefill.c \
+ luatexdir/luafontloader/fontforge/fontforge/splinefont.c \
+ luatexdir/luafontloader/fontforge/fontforge/splinefont.h \
+ luatexdir/luafontloader/fontforge/fontforge/splineorder2.c \
+ luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c \
+ luatexdir/luafontloader/fontforge/fontforge/splinerefigure.c \
+ luatexdir/luafontloader/fontforge/fontforge/splinesave.c \
+ luatexdir/luafontloader/fontforge/fontforge/splinesaveafm.c \
+ luatexdir/luafontloader/fontforge/fontforge/splinestroke.c \
+ luatexdir/luafontloader/fontforge/fontforge/splineutil.c \
+ luatexdir/luafontloader/fontforge/fontforge/splineutil2.c \
+ luatexdir/luafontloader/fontforge/fontforge/start.c \
+ luatexdir/luafontloader/fontforge/fontforge/stemdb.c \
+ luatexdir/luafontloader/fontforge/fontforge/stemdb.h \
+ luatexdir/luafontloader/fontforge/fontforge/tottf.c \
+ luatexdir/luafontloader/fontforge/fontforge/tottfaat.c \
+ luatexdir/luafontloader/fontforge/fontforge/tottfgpos.c \
+ luatexdir/luafontloader/fontforge/fontforge/ttf.h \
+ luatexdir/luafontloader/fontforge/fontforge/ttfspecial.c \
+ luatexdir/luafontloader/fontforge/fontforge/uiinterface.h \
+ luatexdir/luafontloader/fontforge/fontforge/unicoderange.h \
+ luatexdir/luafontloader/fontforge/fontforge/views.h \
+ luatexdir/luafontloader/fontforge/gutils/fsys.c \
+ luatexdir/luafontloader/fontforge/gutils/gwwintl.c \
+ luatexdir/luafontloader/fontforge/inc/basics.h \
+ luatexdir/luafontloader/fontforge/inc/chardata.h \
+ luatexdir/luafontloader/fontforge/inc/charset.h \
+ luatexdir/luafontloader/fontforge/inc/dynamic.h \
+ luatexdir/luafontloader/fontforge/inc/fileutil.h \
+ luatexdir/luafontloader/fontforge/inc/gdraw.h \
+ luatexdir/luafontloader/fontforge/inc/gfile.h \
+ luatexdir/luafontloader/fontforge/inc/ggadget.h \
+ luatexdir/luafontloader/fontforge/inc/gicons.h \
+ luatexdir/luafontloader/fontforge/inc/gimage.h \
+ luatexdir/luafontloader/fontforge/inc/gio.h \
+ luatexdir/luafontloader/fontforge/inc/gkeysym.h \
+ luatexdir/luafontloader/fontforge/inc/gprogress.h \
+ luatexdir/luafontloader/fontforge/inc/gresource.h \
+ luatexdir/luafontloader/fontforge/inc/gwidget.h \
+ luatexdir/luafontloader/fontforge/inc/gwwiconv.h \
+ luatexdir/luafontloader/fontforge/inc/intl.h \
+ luatexdir/luafontloader/fontforge/inc/ustring.h \
+ luatexdir/luafontloader/fontforge/inc/utype.h \
+ luatexdir/luafontloader/src/ffdummies.c \
+ luatexdir/luafontloader/src/luafflib.c
EXTRA_DIST += \
- luatexdir/luafontforge/ChangeLog \
- luatexdir/luafontforge/fontforge/AUTHORS \
- luatexdir/luafontforge/fontforge/INSTALL \
- luatexdir/luafontforge/fontforge/LICENSE \
- luatexdir/luafontforge/fontforge/VERSION
+ luatexdir/luafontloader/ChangeLog \
+ luatexdir/luafontloader/fontforge/AUTHORS \
+ luatexdir/luafontloader/fontforge/INSTALL \
+ luatexdir/luafontloader/fontforge/LICENSE \
+ luatexdir/luafontloader/fontforge/VERSION \
+ luatexdir/luafontloader/fontforge/libs \
+ luatexdir/luafontloader/fontforge/po
## Not used
##
EXTRA_DIST += \
- luatexdir/luafontforge/Makefile \
- luatexdir/luafontforge/fontforge/Makefile \
- luatexdir/luafontforge/fontforge/Unicode/Makefile \
- luatexdir/luafontforge/fontforge/Unicode/descrip.mms \
- luatexdir/luafontforge/fontforge/descrip.mms \
- luatexdir/luafontforge/fontforge/fontforge/Makefile \
- luatexdir/luafontforge/fontforge/fontforge/descrip.mms \
- luatexdir/luafontforge/fontforge/fontforge/lff.opt \
- luatexdir/luafontforge/fontforge/fontforge/scriptfuncs.h \
- luatexdir/luafontforge/fontforge/fontforge/scripting.h \
- luatexdir/luafontforge/fontforge/fontforge/sfd1.h \
- luatexdir/luafontforge/fontforge/fontforge/stamper.c \
- luatexdir/luafontforge/fontforge/fontforge/xlib.opt
+ luatexdir/luafontloader/fontforge/Makefile.in \
+ luatexdir/luafontloader/fontforge/Unicode/Makefile.in \
+ luatexdir/luafontloader/fontforge/configure-options \
+ luatexdir/luafontloader/fontforge/configure.in \
+ luatexdir/luafontloader/fontforge/fontforge/Makefile.in \
+ luatexdir/luafontloader/fontforge/gdraw/Makefile.in \
+ luatexdir/luafontloader/fontforge/gutils/Makefile.in \
+ luatexdir/luafontloader/fontforge/inc/config.h.in \
+ luatexdir/luafontloader/fontforge/plugins/Makefile.in
## libluatex
##
@@ -409,11 +564,9 @@ libluatex_a_CPPFLAGS += -Iluatexdir -I$(srcdir)/luatexdir -I$(srcdir)/luatexdir/
libluatex_a_CPPFLAGS += -DpdfTeX
libluatex_a_SOURCES = \
- luatexdir/avl.c \
- luatexdir/avl.h \
- luatexdir/avlstuff.c \
- luatexdir/avlstuff.h \
+ luatexdir/commands.h \
luatexdir/font/dofont.c \
+ luatexdir/font/luatexfont.h \
luatexdir/font/luafont.c \
luatexdir/font/mapfile.c \
luatexdir/font/pkin.c \
@@ -440,6 +593,7 @@ libluatex_a_SOURCES = \
luatexdir/font/writettf.h \
luatexdir/font/writetype0.c \
luatexdir/font/writetype2.c \
+ luatexdir/get_svnversion.sh \
luatexdir/hyphen.h \
luatexdir/image/epdf.c \
luatexdir/image/epdf.h \
@@ -460,7 +614,6 @@ libluatex_a_SOURCES = \
luatexdir/lua/lkpselib.c \
luatexdir/lua/llanglib.c \
luatexdir/lua/llualib.c \
- luatexdir/lua/lmplib.c \
luatexdir/lua/lnodelib.c \
luatexdir/lua/loslibext.c \
luatexdir/lua/lpdflib.c \
@@ -476,21 +629,37 @@ libluatex_a_SOURCES = \
luatexdir/lua/texluac.c \
luatexdir/luatex-api.h \
luatexdir/luatex.h \
+ luatexdir/makecpool.c \
luatexdir/managed-sa.c \
luatexdir/managed-sa.h \
luatexdir/mathcodes.c \
+ luatexdir/mp/lmplib.c \
luatexdir/nodes.h \
+ luatexdir/pdf/pagetree.c \
+ luatexdir/pdf/pdfpage.c \
+ luatexdir/primitive.h \
luatexdir/ptexmac.h \
- luatexdir/svnversion.h \
+ luatexdir/tex/filename.c \
luatexdir/tex/linebreak.c \
+ luatexdir/tex/math.c \
+ luatexdir/tex/mlist.c \
luatexdir/tex/postlinebreak.c \
+ luatexdir/tex/primitive.c \
+ luatexdir/tex/texdeffont.c \
luatexdir/tex/texnodes.c \
luatexdir/tex/texpdf.c \
luatexdir/tex/textoken.c \
+ luatexdir/texmath.h \
luatexdir/textcodes.c \
luatexdir/tokens.h \
- luatexdir/utils.c \
- luatexdir/writezip.c
+ luatexdir/utils/avl.c \
+ luatexdir/utils/avl.h \
+ luatexdir/utils/avlstuff.c \
+ luatexdir/utils/avlstuff.h \
+ luatexdir/utils/synctex.h \
+ luatexdir/utils/synctex.c \
+ luatexdir/utils/utils.c \
+ luatexdir/utils/writezip.c
nodist_libluatex_a_SOURCES = $(lua_mp_c_h)
@@ -501,16 +670,21 @@ $(libluatex_a_SOURCES): $(lua_mp_c_h)
endif LUATEX
## These files are mutually dependent
-lua_mp_c_h = luatexdir/mp.c luatexdir/mplib.h luatexdir/mpmp.h
-lua_mp_c_h += luatexdir/mppsout.h luatexdir/psout.c
-lua_mp_web = luatexdir/lua/mp.w luatexdir/lua/psout.w
+lua_mp_c_h = luatexdir/mp.c luatexdir/mplib.h luatexdir/mpmp.h
+lua_mp_c_h += luatexdir/mppsout.h luatexdir/psout.c luatexdir/mplibps.h
+lua_mp_c_h += luatexdir/memio.c luatexdir/tfmin.c
+lua_mp_web = luatexdir/mp/avl.h luatexdir/mp/avl.c luatexdir/mp/mp.w luatexdir/mp/psout.w
+lua_mp_web += luatexdir/mp/memio.w luatexdir/mp/tfmin.w
+lua_mp_CPPFLAGS = -I$(srcdir)/luatexdir/mp
$(lua_mp_c_h): mp-ctangle
mp-ctangle: ctangle $(lua_mp_web) luatexd.h
$(mkdir_p) luatexdir
- CWEBINPUTS=$(srcdir)/luatexdir/lua $(ctangle) mp.w
- CWEBINPUTS=$(srcdir)/luatexdir/lua $(ctangle) psout.w
+ CWEBINPUTS=$(srcdir)/luatexdir/mp $(ctangle) mp.w
+ CWEBINPUTS=$(srcdir)/luatexdir/mp $(ctangle) psout.w
+ CWEBINPUTS=$(srcdir)/luatexdir/mp $(ctangle) tfmin.w
+ CWEBINPUTS=$(srcdir)/luatexdir/mp $(ctangle) memio.w
rm -f $(lua_mp_c_h)
- mv mp.c mplib.h mpmp.h mppsout.h psout.c luatexdir
+ mv mp.c mplib.h mpmp.h mppsout.h psout.c mplibps.h memio.c tfmin.c luatexdir
echo timestamp >$@
touch $(lua_mp_c_h)
@@ -528,20 +702,9 @@ EXTRA_DIST += \
luatexdir/change-files.txt \
luatexdir/font/subfont.txt
-## Not used (pdftosrc and ttf2afm)
-##
-EXTRA_DIST += \
- luatexdir/pdftosrc.1 \
- luatexdir/pdftosrc.cc \
- luatexdir/pdftosrc.rc \
- luatexdir/ttf2afm.c \
- luatexdir/ttf2afm.rc
-
-## included by luatexdir/ttf2afm.c
-EXTRA_DIST += luatexdir/macnames.c
## Tests
-##
+
dist_check_SCRIPTS += luatexdir/luatangle.test
if LUATEX
@@ -552,5 +715,8 @@ DISTCLEANFILES += cftest.p
## Eventually delete these files
##
-EXTRA_DIST += luatexdir/Makefile.in luatexdir/luatex.mk luatexdir/luatexlib.mk
-
+EXTRA_DIST += \
+ luatexdir/Makefile.in \
+ luatexdir/depend.mk \
+ luatexdir/luatex.mk \
+ luatexdir/luatexlib.mk
diff --git a/Build/source/texk/web2c/luatexdir/avl.c b/Build/source/texk/web2c/luatexdir/avl.c
deleted file mode 100644
index a25239e8d93..00000000000
--- a/Build/source/texk/web2c/luatexdir/avl.c
+++ /dev/null
@@ -1,893 +0,0 @@
-/* Produced by texiweb from libavl.w. */
-
-/* libavl - library for manipulation of binary trees.
- Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
-
- The author may be contacted at <blp@gnu.org> on the Internet, or
- write to Ben Pfaff, Stanford University, Computer Science Dept., 353
- Serra Mall, Stanford CA 94305, USA.
-*/
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "avl.h"
-
-/* Creates and returns a new table
- with comparison function |compare| using parameter |param|
- and memory allocator |allocator|.
- Returns |NULL| if memory allocation failed. */
-struct avl_table *
-avl_create (avl_comparison_func *compare, void *param,
- struct libavl_allocator *allocator)
-{
- struct avl_table *tree;
-
- assert (compare != NULL);
-
- if (allocator == NULL)
- allocator = &avl_allocator_default;
-
- tree = allocator->libavl_malloc (allocator, sizeof *tree);
- if (tree == NULL)
- return NULL;
-
- tree->avl_root = NULL;
- tree->avl_compare = compare;
- tree->avl_param = param;
- tree->avl_alloc = allocator;
- tree->avl_count = 0;
- tree->avl_generation = 0;
-
- return tree;
-}
-
-/* Search |tree| for an item matching |item|, and return it if found.
- Otherwise return |NULL|. */
-void *
-avl_find (const struct avl_table *tree, const void *item)
-{
- const struct avl_node *p;
-
- assert (tree != NULL && item != NULL);
- for (p = tree->avl_root; p != NULL; )
- {
- int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param);
-
- if (cmp < 0)
- p = p->avl_link[0];
- else if (cmp > 0)
- p = p->avl_link[1];
- else /* |cmp == 0| */
- return p->avl_data;
- }
-
- return NULL;
-}
-
-/* Inserts |item| into |tree| and returns a pointer to |item|'s address.
- If a duplicate item is found in the tree,
- returns a pointer to the duplicate without inserting |item|.
- Returns |NULL| in case of memory allocation failure. */
-void **
-avl_probe (struct avl_table *tree, void *item)
-{
- struct avl_node *y, *z; /* Top node to update balance factor, and parent. */
- struct avl_node *p, *q; /* Iterator, and parent. */
- struct avl_node *n; /* Newly inserted node. */
- struct avl_node *w; /* New root of rebalanced subtree. */
- int dir; /* Direction to descend. */
-
- unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */
- int k = 0; /* Number of cached results. */
-
- assert (tree != NULL && item != NULL);
-
- z = (struct avl_node *) &tree->avl_root;
- y = tree->avl_root;
- dir = 0;
- for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir])
- {
- int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param);
- if (cmp == 0)
- return &p->avl_data;
-
- if (p->avl_balance != 0)
- z = q, y = p, k = 0;
- da[k++] = dir = cmp > 0;
- }
-
- n = q->avl_link[dir] =
- tree->avl_alloc->libavl_malloc (tree->avl_alloc, sizeof *n);
- if (n == NULL)
- return NULL;
-
- tree->avl_count++;
- n->avl_data = item;
- n->avl_link[0] = n->avl_link[1] = NULL;
- n->avl_balance = 0;
- if (y == NULL)
- return &n->avl_data;
-
- for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++)
- if (da[k] == 0)
- p->avl_balance--;
- else
- p->avl_balance++;
-
- if (y->avl_balance == -2)
- {
- struct avl_node *x = y->avl_link[0];
- if (x->avl_balance == -1)
- {
- w = x;
- y->avl_link[0] = x->avl_link[1];
- x->avl_link[1] = y;
- x->avl_balance = y->avl_balance = 0;
- }
- else
- {
- assert (x->avl_balance == +1);
- w = x->avl_link[1];
- x->avl_link[1] = w->avl_link[0];
- w->avl_link[0] = x;
- y->avl_link[0] = w->avl_link[1];
- w->avl_link[1] = y;
- if (w->avl_balance == -1)
- x->avl_balance = 0, y->avl_balance = +1;
- else if (w->avl_balance == 0)
- x->avl_balance = y->avl_balance = 0;
- else /* |w->avl_balance == +1| */
- x->avl_balance = -1, y->avl_balance = 0;
- w->avl_balance = 0;
- }
- }
- else if (y->avl_balance == +2)
- {
- struct avl_node *x = y->avl_link[1];
- if (x->avl_balance == +1)
- {
- w = x;
- y->avl_link[1] = x->avl_link[0];
- x->avl_link[0] = y;
- x->avl_balance = y->avl_balance = 0;
- }
- else
- {
- assert (x->avl_balance == -1);
- w = x->avl_link[0];
- x->avl_link[0] = w->avl_link[1];
- w->avl_link[1] = x;
- y->avl_link[1] = w->avl_link[0];
- w->avl_link[0] = y;
- if (w->avl_balance == +1)
- x->avl_balance = 0, y->avl_balance = -1;
- else if (w->avl_balance == 0)
- x->avl_balance = y->avl_balance = 0;
- else /* |w->avl_balance == -1| */
- x->avl_balance = +1, y->avl_balance = 0;
- w->avl_balance = 0;
- }
- }
- else
- return &n->avl_data;
- z->avl_link[y != z->avl_link[0]] = w;
-
- tree->avl_generation++;
- return &n->avl_data;
-}
-
-/* Inserts |item| into |table|.
- Returns |NULL| if |item| was successfully inserted
- or if a memory allocation error occurred.
- Otherwise, returns the duplicate item. */
-void *
-avl_insert (struct avl_table *table, void *item)
-{
- void **p = avl_probe (table, item);
- return p == NULL || *p == item ? NULL : *p;
-}
-
-/* Inserts |item| into |table|, replacing any duplicate item.
- Returns |NULL| if |item| was inserted without replacing a duplicate,
- or if a memory allocation error occurred.
- Otherwise, returns the item that was replaced. */
-void *
-avl_replace (struct avl_table *table, void *item)
-{
- void **p = avl_probe (table, item);
- if (p == NULL || *p == item)
- return NULL;
- else
- {
- void *r = *p;
- *p = item;
- return r;
- }
-}
-
-/* Deletes from |tree| and returns an item matching |item|.
- Returns a null pointer if no matching item found. */
-void *
-avl_delete (struct avl_table *tree, const void *item)
-{
- /* Stack of nodes. */
- struct avl_node *pa[AVL_MAX_HEIGHT]; /* Nodes. */
- unsigned char da[AVL_MAX_HEIGHT]; /* |avl_link[]| indexes. */
- int k; /* Stack pointer. */
-
- struct avl_node *p; /* Traverses tree to find node to delete. */
- int cmp; /* Result of comparison between |item| and |p|. */
-
- assert (tree != NULL && item != NULL);
-
- k = 0;
- p = (struct avl_node *) &tree->avl_root;
- for (cmp = -1; cmp != 0;
- cmp = tree->avl_compare (item, p->avl_data, tree->avl_param))
- {
- int dir = cmp > 0;
-
- pa[k] = p;
- da[k++] = dir;
-
- p = p->avl_link[dir];
- if (p == NULL)
- return NULL;
- }
- item = p->avl_data;
-
- if (p->avl_link[1] == NULL)
- pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0];
- else
- {
- struct avl_node *r = p->avl_link[1];
- if (r->avl_link[0] == NULL)
- {
- r->avl_link[0] = p->avl_link[0];
- r->avl_balance = p->avl_balance;
- pa[k - 1]->avl_link[da[k - 1]] = r;
- da[k] = 1;
- pa[k++] = r;
- }
- else
- {
- struct avl_node *s;
- int j = k++;
-
- for (;;)
- {
- da[k] = 0;
- pa[k++] = r;
- s = r->avl_link[0];
- if (s->avl_link[0] == NULL)
- break;
-
- r = s;
- }
-
- s->avl_link[0] = p->avl_link[0];
- r->avl_link[0] = s->avl_link[1];
- s->avl_link[1] = p->avl_link[1];
- s->avl_balance = p->avl_balance;
-
- pa[j - 1]->avl_link[da[j - 1]] = s;
- da[j] = 1;
- pa[j] = s;
- }
- }
-
- tree->avl_alloc->libavl_free (tree->avl_alloc, p);
-
- assert (k > 0);
- while (--k > 0)
- {
- struct avl_node *y = pa[k];
-
- if (da[k] == 0)
- {
- y->avl_balance++;
- if (y->avl_balance == +1)
- break;
- else if (y->avl_balance == +2)
- {
- struct avl_node *x = y->avl_link[1];
- if (x->avl_balance == -1)
- {
- struct avl_node *w;
- assert (x->avl_balance == -1);
- w = x->avl_link[0];
- x->avl_link[0] = w->avl_link[1];
- w->avl_link[1] = x;
- y->avl_link[1] = w->avl_link[0];
- w->avl_link[0] = y;
- if (w->avl_balance == +1)
- x->avl_balance = 0, y->avl_balance = -1;
- else if (w->avl_balance == 0)
- x->avl_balance = y->avl_balance = 0;
- else /* |w->avl_balance == -1| */
- x->avl_balance = +1, y->avl_balance = 0;
- w->avl_balance = 0;
- pa[k - 1]->avl_link[da[k - 1]] = w;
- }
- else
- {
- y->avl_link[1] = x->avl_link[0];
- x->avl_link[0] = y;
- pa[k - 1]->avl_link[da[k - 1]] = x;
- if (x->avl_balance == 0)
- {
- x->avl_balance = -1;
- y->avl_balance = +1;
- break;
- }
- else
- x->avl_balance = y->avl_balance = 0;
- }
- }
- }
- else
- {
- y->avl_balance--;
- if (y->avl_balance == -1)
- break;
- else if (y->avl_balance == -2)
- {
- struct avl_node *x = y->avl_link[0];
- if (x->avl_balance == +1)
- {
- struct avl_node *w;
- assert (x->avl_balance == +1);
- w = x->avl_link[1];
- x->avl_link[1] = w->avl_link[0];
- w->avl_link[0] = x;
- y->avl_link[0] = w->avl_link[1];
- w->avl_link[1] = y;
- if (w->avl_balance == -1)
- x->avl_balance = 0, y->avl_balance = +1;
- else if (w->avl_balance == 0)
- x->avl_balance = y->avl_balance = 0;
- else /* |w->avl_balance == +1| */
- x->avl_balance = -1, y->avl_balance = 0;
- w->avl_balance = 0;
- pa[k - 1]->avl_link[da[k - 1]] = w;
- }
- else
- {
- y->avl_link[0] = x->avl_link[1];
- x->avl_link[1] = y;
- pa[k - 1]->avl_link[da[k - 1]] = x;
- if (x->avl_balance == 0)
- {
- x->avl_balance = +1;
- y->avl_balance = -1;
- break;
- }
- else
- x->avl_balance = y->avl_balance = 0;
- }
- }
- }
- }
-
- tree->avl_count--;
- tree->avl_generation++;
- return (void *) item;
-}
-
-/* Refreshes the stack of parent pointers in |trav|
- and updates its generation number. */
-static void
-trav_refresh (struct avl_traverser *trav)
-{
- assert (trav != NULL);
-
- trav->avl_generation = trav->avl_table->avl_generation;
-
- if (trav->avl_node != NULL)
- {
- avl_comparison_func *cmp = trav->avl_table->avl_compare;
- void *param = trav->avl_table->avl_param;
- struct avl_node *node = trav->avl_node;
- struct avl_node *i;
-
- trav->avl_height = 0;
- for (i = trav->avl_table->avl_root; i != node; )
- {
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- assert (i != NULL);
-
- trav->avl_stack[trav->avl_height++] = i;
- i = i->avl_link[cmp (node->avl_data, i->avl_data, param) > 0];
- }
- }
-}
-
-/* Initializes |trav| for use with |tree|
- and selects the null node. */
-void
-avl_t_init (struct avl_traverser *trav, struct avl_table *tree)
-{
- trav->avl_table = tree;
- trav->avl_node = NULL;
- trav->avl_height = 0;
- trav->avl_generation = tree->avl_generation;
-}
-
-/* Initializes |trav| for |tree|
- and selects and returns a pointer to its least-valued item.
- Returns |NULL| if |tree| contains no nodes. */
-void *
-avl_t_first (struct avl_traverser *trav, struct avl_table *tree)
-{
- struct avl_node *x;
-
- assert (tree != NULL && trav != NULL);
-
- trav->avl_table = tree;
- trav->avl_height = 0;
- trav->avl_generation = tree->avl_generation;
-
- x = tree->avl_root;
- if (x != NULL)
- while (x->avl_link[0] != NULL)
- {
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- trav->avl_stack[trav->avl_height++] = x;
- x = x->avl_link[0];
- }
- trav->avl_node = x;
-
- return x != NULL ? x->avl_data : NULL;
-}
-
-/* Initializes |trav| for |tree|
- and selects and returns a pointer to its greatest-valued item.
- Returns |NULL| if |tree| contains no nodes. */
-void *
-avl_t_last (struct avl_traverser *trav, struct avl_table *tree)
-{
- struct avl_node *x;
-
- assert (tree != NULL && trav != NULL);
-
- trav->avl_table = tree;
- trav->avl_height = 0;
- trav->avl_generation = tree->avl_generation;
-
- x = tree->avl_root;
- if (x != NULL)
- while (x->avl_link[1] != NULL)
- {
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- trav->avl_stack[trav->avl_height++] = x;
- x = x->avl_link[1];
- }
- trav->avl_node = x;
-
- return x != NULL ? x->avl_data : NULL;
-}
-
-/* Searches for |item| in |tree|.
- If found, initializes |trav| to the item found and returns the item
- as well.
- If there is no matching item, initializes |trav| to the null item
- and returns |NULL|. */
-void *
-avl_t_find (struct avl_traverser *trav, struct avl_table *tree, void *item)
-{
- struct avl_node *p, *q;
-
- assert (trav != NULL && tree != NULL && item != NULL);
- trav->avl_table = tree;
- trav->avl_height = 0;
- trav->avl_generation = tree->avl_generation;
- for (p = tree->avl_root; p != NULL; p = q)
- {
- int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param);
-
- if (cmp < 0)
- q = p->avl_link[0];
- else if (cmp > 0)
- q = p->avl_link[1];
- else /* |cmp == 0| */
- {
- trav->avl_node = p;
- return p->avl_data;
- }
-
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- trav->avl_stack[trav->avl_height++] = p;
- }
-
- trav->avl_height = 0;
- trav->avl_node = NULL;
- return NULL;
-}
-
-/* Attempts to insert |item| into |tree|.
- If |item| is inserted successfully, it is returned and |trav| is
- initialized to its location.
- If a duplicate is found, it is returned and |trav| is initialized to
- its location. No replacement of the item occurs.
- If a memory allocation failure occurs, |NULL| is returned and |trav|
- is initialized to the null item. */
-void *
-avl_t_insert (struct avl_traverser *trav, struct avl_table *tree, void *item)
-{
- void **p;
-
- assert (trav != NULL && tree != NULL && item != NULL);
-
- p = avl_probe (tree, item);
- if (p != NULL)
- {
- trav->avl_table = tree;
- trav->avl_node =
- ((struct avl_node *)
- ((char *) p - offsetof (struct avl_node, avl_data)));
- trav->avl_generation = tree->avl_generation - 1;
- return *p;
- }
- else
- {
- avl_t_init (trav, tree);
- return NULL;
- }
-}
-
-/* Initializes |trav| to have the same current node as |src|. */
-void *
-avl_t_copy (struct avl_traverser *trav, const struct avl_traverser *src)
-{
- assert (trav != NULL && src != NULL);
-
- if (trav != src)
- {
- trav->avl_table = src->avl_table;
- trav->avl_node = src->avl_node;
- trav->avl_generation = src->avl_generation;
- if (trav->avl_generation == trav->avl_table->avl_generation)
- {
- trav->avl_height = src->avl_height;
- memcpy (trav->avl_stack, (const void *) src->avl_stack,
- sizeof *trav->avl_stack * trav->avl_height);
- }
- }
-
- return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
-}
-
-/* Returns the next data item in inorder
- within the tree being traversed with |trav|,
- or if there are no more data items returns |NULL|. */
-void *
-avl_t_next (struct avl_traverser *trav)
-{
- struct avl_node *x;
-
- assert (trav != NULL);
-
- if (trav->avl_generation != trav->avl_table->avl_generation)
- trav_refresh (trav);
-
- x = trav->avl_node;
- if (x == NULL)
- {
- return avl_t_first (trav, trav->avl_table);
- }
- else if (x->avl_link[1] != NULL)
- {
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- trav->avl_stack[trav->avl_height++] = x;
- x = x->avl_link[1];
-
- while (x->avl_link[0] != NULL)
- {
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- trav->avl_stack[trav->avl_height++] = x;
- x = x->avl_link[0];
- }
- }
- else
- {
- struct avl_node *y;
-
- do
- {
- if (trav->avl_height == 0)
- {
- trav->avl_node = NULL;
- return NULL;
- }
-
- y = x;
- x = trav->avl_stack[--trav->avl_height];
- }
- while (y == x->avl_link[1]);
- }
- trav->avl_node = x;
-
- return x->avl_data;
-}
-
-/* Returns the previous data item in inorder
- within the tree being traversed with |trav|,
- or if there are no more data items returns |NULL|. */
-void *
-avl_t_prev (struct avl_traverser *trav)
-{
- struct avl_node *x;
-
- assert (trav != NULL);
-
- if (trav->avl_generation != trav->avl_table->avl_generation)
- trav_refresh (trav);
-
- x = trav->avl_node;
- if (x == NULL)
- {
- return avl_t_last (trav, trav->avl_table);
- }
- else if (x->avl_link[0] != NULL)
- {
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- trav->avl_stack[trav->avl_height++] = x;
- x = x->avl_link[0];
-
- while (x->avl_link[1] != NULL)
- {
- assert (trav->avl_height < AVL_MAX_HEIGHT);
- trav->avl_stack[trav->avl_height++] = x;
- x = x->avl_link[1];
- }
- }
- else
- {
- struct avl_node *y;
-
- do
- {
- if (trav->avl_height == 0)
- {
- trav->avl_node = NULL;
- return NULL;
- }
-
- y = x;
- x = trav->avl_stack[--trav->avl_height];
- }
- while (y == x->avl_link[0]);
- }
- trav->avl_node = x;
-
- return x->avl_data;
-}
-
-/* Returns |trav|'s current item. */
-void *
-avl_t_cur (struct avl_traverser *trav)
-{
- assert (trav != NULL);
-
- return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
-}
-
-/* Replaces the current item in |trav| by |new| and returns the item replaced.
- |trav| must not have the null item selected.
- The new item must not upset the ordering of the tree. */
-void *
-avl_t_replace (struct avl_traverser *trav, void *new)
-{
- void *old;
-
- assert (trav != NULL && trav->avl_node != NULL && new != NULL);
- old = trav->avl_node->avl_data;
- trav->avl_node->avl_data = new;
- return old;
-}
-
-/* Destroys |new| with |avl_destroy (new, destroy)|,
- first setting right links of nodes in |stack| within |new|
- to null pointers to avoid touching uninitialized data. */
-static void
-copy_error_recovery (struct avl_node **stack, int height,
- struct avl_table *new, avl_item_func *destroy)
-{
- assert (stack != NULL && height >= 0 && new != NULL);
-
- for (; height > 2; height -= 2)
- stack[height - 1]->avl_link[1] = NULL;
- avl_destroy (new, destroy);
-}
-
-/* Copies |org| to a newly created tree, which is returned.
- If |copy != NULL|, each data item in |org| is first passed to |copy|,
- and the return values are inserted into the tree,
- with |NULL| return values taken as indications of failure.
- On failure, destroys the partially created new tree,
- applying |destroy|, if non-null, to each item in the new tree so far,
- and returns |NULL|.
- If |allocator != NULL|, it is used for allocation in the new tree.
- Otherwise, the same allocator used for |org| is used. */
-struct avl_table *
-avl_copy (const struct avl_table *org, avl_copy_func *copy,
- avl_item_func *destroy, struct libavl_allocator *allocator)
-{
- struct avl_node *stack[2 * (AVL_MAX_HEIGHT + 1)];
- int height = 0;
-
- struct avl_table *new;
- const struct avl_node *x;
- struct avl_node *y;
-
- assert (org != NULL);
- new = avl_create (org->avl_compare, org->avl_param,
- allocator != NULL ? allocator : org->avl_alloc);
- if (new == NULL)
- return NULL;
- new->avl_count = org->avl_count;
- if (new->avl_count == 0)
- return new;
-
- x = (const struct avl_node *) &org->avl_root;
- y = (struct avl_node *) &new->avl_root;
- for (;;)
- {
- while (x->avl_link[0] != NULL)
- {
- assert (height < 2 * (AVL_MAX_HEIGHT + 1));
-
- y->avl_link[0] =
- new->avl_alloc->libavl_malloc (new->avl_alloc,
- sizeof *y->avl_link[0]);
- if (y->avl_link[0] == NULL)
- {
- if (y != (struct avl_node *) &new->avl_root)
- {
- y->avl_data = NULL;
- y->avl_link[1] = NULL;
- }
-
- copy_error_recovery (stack, height, new, destroy);
- return NULL;
- }
-
- stack[height++] = (struct avl_node *) x;
- stack[height++] = y;
- x = x->avl_link[0];
- y = y->avl_link[0];
- }
- y->avl_link[0] = NULL;
-
- for (;;)
- {
- y->avl_balance = x->avl_balance;
- if (copy == NULL)
- y->avl_data = x->avl_data;
- else
- {
- y->avl_data = copy (x->avl_data, org->avl_param);
- if (y->avl_data == NULL)
- {
- y->avl_link[1] = NULL;
- copy_error_recovery (stack, height, new, destroy);
- return NULL;
- }
- }
-
- if (x->avl_link[1] != NULL)
- {
- y->avl_link[1] =
- new->avl_alloc->libavl_malloc (new->avl_alloc,
- sizeof *y->avl_link[1]);
- if (y->avl_link[1] == NULL)
- {
- copy_error_recovery (stack, height, new, destroy);
- return NULL;
- }
-
- x = x->avl_link[1];
- y = y->avl_link[1];
- break;
- }
- else
- y->avl_link[1] = NULL;
-
- if (height <= 2)
- return new;
-
- y = stack[--height];
- x = stack[--height];
- }
- }
-}
-
-/* Frees storage allocated for |tree|.
- If |destroy != NULL|, applies it to each data item in inorder. */
-void
-avl_destroy (struct avl_table *tree, avl_item_func *destroy)
-{
- struct avl_node *p, *q;
-
- assert (tree != NULL);
-
- for (p = tree->avl_root; p != NULL; p = q)
- if (p->avl_link[0] == NULL)
- {
- q = p->avl_link[1];
- if (destroy != NULL && p->avl_data != NULL)
- destroy (p->avl_data, tree->avl_param);
- tree->avl_alloc->libavl_free (tree->avl_alloc, p);
- }
- else
- {
- q = p->avl_link[0];
- p->avl_link[0] = q->avl_link[1];
- q->avl_link[1] = p;
- }
-
- tree->avl_alloc->libavl_free (tree->avl_alloc, tree);
-}
-
-/* Allocates |size| bytes of space using |malloc()|.
- Returns a null pointer if allocation fails. */
-void *
-avl_malloc (struct libavl_allocator *allocator, size_t size)
-{
- assert (allocator != NULL && size > 0);
- return malloc (size);
-}
-
-/* Frees |block|. */
-void
-avl_free (struct libavl_allocator *allocator, void *block)
-{
- assert (allocator != NULL && block != NULL);
- free (block);
-}
-
-/* Default memory allocator that uses |malloc()| and |free()|. */
-struct libavl_allocator avl_allocator_default =
- {
- avl_malloc,
- avl_free
- };
-
-#undef NDEBUG
-#include <assert.h>
-
-/* Asserts that |avl_insert()| succeeds at inserting |item| into |table|. */
-void
-(avl_assert_insert) (struct avl_table *table, void *item)
-{
- void **p = avl_probe (table, item);
- assert (p != NULL && *p == item);
-}
-
-/* Asserts that |avl_delete()| really removes |item| from |table|,
- and returns the removed item. */
-void *
-(avl_assert_delete) (struct avl_table *table, void *item)
-{
- void *p = avl_delete (table, item);
- assert (p != NULL);
- return p;
-}
-
diff --git a/Build/source/texk/web2c/luatexdir/commands.h b/Build/source/texk/web2c/luatexdir/commands.h
new file mode 100644
index 00000000000..2ee3b8f28b4
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/commands.h
@@ -0,0 +1,550 @@
+/* commands.h
+
+ Copyright 2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: commands.h 2094 2009-03-23 14:13:54Z taco $ */
+
+
+typedef enum {
+ relax_cmd = 0, /* do nothing ( \.{\\relax} ) */
+#define escape_cmd relax_cmd /* escape delimiter (called \.\\ in {\sl The \TeX book\/}) */
+ left_brace_cmd, /* beginning of a group ( \.\{ ) */
+ right_brace_cmd, /* ending of a group ( \.\} ) */
+ math_shift_cmd, /* mathematics shift character ( \.\$ ) */
+ tab_mark_cmd, /* alignment delimiter ( \.\&, \.{\\span} ) */
+ car_ret_cmd, /* end of line ( |carriage_return|, \.{\\cr}, \.{\\crcr} ) */
+#define out_param_cmd car_ret_cmd /* output a macro parameter */
+ mac_param_cmd, /* macro parameter symbol ( \.\# ) */
+ sup_mark_cmd, /* superscript ( \.{\char'136} ) */
+ sub_mark_cmd, /* subscript ( \.{\char'137} ) */
+ endv_cmd, /* end of \<v_j> list in alignment template */
+#define ignore_cmd endv_cmd /* characters to ignore ( \.{\^\^@@} ) */
+ spacer_cmd, /* characters equivalent to blank space ( \.{\ } ) */
+ letter_cmd, /* characters regarded as letters ( \.{A..Z}, \.{a..z} ) */
+ other_char_cmd, /* none of the special character types */
+ par_end_cmd, /* end of paragraph ( \.{\\par} ) */
+#define active_char_cmd par_end_cmd /* characters that invoke macros ( \.{\char`\~} ) */
+#define match_cmd par_end_cmd /* match a macro parameter */
+ stop_cmd, /* end of job ( \.{\\end}, \.{\\dump} ) */
+#define comment_cmd stop_cmd /* characters that introduce comments ( \.\% ) */
+#define end_match_cmd stop_cmd /* end of parameters to macro */
+ delim_num_cmd, /* specify delimiter numerically ( \.{\\delimiter} ) */
+#define invalid_char_cmd delim_num_cmd /* characters that shouldn't appear ( \.{\^\^?} ) */
+#define max_char_code_cmd delim_num_cmd /* largest catcode for individual characters */
+ char_num_cmd, /* character specified numerically ( \.{\\char} ) */
+ math_char_num_cmd, /* explicit math code ( \.{\\mathchar} ) */
+ mark_cmd, /* mark definition ( \.{\\mark} ) */
+ xray_cmd, /* peek inside of \TeX\ ( \.{\\show}, \.{\\showbox}, etc.~) */
+ make_box_cmd, /* make a box ( \.{\\box}, \.{\\copy}, \.{\\hbox}, etc.~) */
+ hmove_cmd, /* horizontal motion ( \.{\\moveleft}, \.{\\moveright} ) */
+ vmove_cmd, /* vertical motion ( \.{\\raise}, \.{\\lower} ) */
+ un_hbox_cmd, /* unglue a box ( \.{\\unhbox}, \.{\\unhcopy} ) */
+ un_vbox_cmd, /* unglue a box ( \.{\\unvbox}, \.{\\unvcopy} or
+ \.{\\pagediscards}, \.{\\splitdiscards} ) */
+ remove_item_cmd, /* nullify last item ( \.{\\unpenalty}, \.{\\unkern}, \.{\\unskip} ) */
+ hskip_cmd, /* horizontal glue ( \.{\\hskip}, \.{\\hfil}, etc.~) */
+ vskip_cmd, /* vertical glue ( \.{\\vskip}, \.{\\vfil}, etc.~) */
+ mskip_cmd, /* math glue ( \.{\\mskip} ) */
+ kern_cmd, /* fixed space ( \.{\\kern}) */
+ mkern_cmd, /* math kern ( \.{\\mkern} ) */
+ leader_ship_cmd, /* use a box ( \.{\\shipout}, \.{\\leaders}, etc.~) */
+ halign_cmd, /* horizontal table alignment ( \.{\\halign} ) */
+ valign_cmd, /* vertical table alignment ( \.{\\valign} ) */
+ no_align_cmd, /* temporary escape from alignment ( \.{\\noalign} ) */
+ vrule_cmd, /* vertical rule ( \.{\\vrule} ) */
+ hrule_cmd, /* horizontal rule ( \.{\\hrule} ) */
+ insert_cmd, /* vlist inserted in box ( \.{\\insert} ) */
+ vadjust_cmd, /* vlist inserted in enclosing paragraph ( \.{\\vadjust} ) */
+ ignore_spaces_cmd, /* gobble |spacer| tokens ( \.{\\ignorespaces} ) */
+ after_assignment_cmd, /* save till assignment is done ( \.{\\afterassignment} ) */
+ after_group_cmd, /* save till group is done ( \.{\\aftergroup} ) */
+ break_penalty_cmd, /* additional badness ( \.{\\penalty} ) */
+ start_par_cmd, /* begin paragraph ( \.{\\indent}, \.{\\noindent} ) */
+ ital_corr_cmd, /* italic correction ( \.{\\/} ) */
+ accent_cmd, /* attach accent in text ( \.{\\accent} ) */
+ math_accent_cmd, /* attach accent in math ( \.{\\mathaccent} ) */
+ discretionary_cmd, /* discretionary texts ( \.{\\-}, \.{\\discretionary} ) */
+ eq_no_cmd, /* equation number ( \.{\\eqno}, \.{\\leqno} ) */
+ left_right_cmd, /* variable delimiter ( \.{\\left}, \.{\\right} or \.{\\middle} ) */
+ math_comp_cmd, /* component of formula ( \.{\\mathbin}, etc.~) */
+ limit_switch_cmd, /* diddle limit conventions ( \.{\\displaylimits}, etc.~) */
+ above_cmd, /* generalized fraction ( \.{\\above}, \.{\\atop}, etc.~) */
+ math_style_cmd, /* style specification ( \.{\\displaystyle}, etc.~) */
+ math_choice_cmd, /* choice specification ( \.{\\mathchoice} ) */
+ non_script_cmd, /* conditional math glue ( \.{\\nonscript} ) */
+ vcenter_cmd, /* vertically center a vbox ( \.{\\vcenter} ) */
+ case_shift_cmd, /* force specific case ( \.{\\lowercase}, \.{\\uppercase}~) */
+ message_cmd, /* send to user ( \.{\\message}, \.{\\errmessage} ) */
+ extension_cmd, /* extensions to \TeX\ ( \.{\\write}, \.{\\special}, etc.~) */
+ in_stream_cmd, /* files for reading ( \.{\\openin}, \.{\\closein} ) */
+ begin_group_cmd, /* begin local grouping ( \.{\\begingroup} ) */
+ end_group_cmd, /* end local grouping ( \.{\\endgroup} ) */
+ omit_cmd, /* omit alignment template ( \.{\\omit} ) */
+ ex_space_cmd, /* explicit space ( \.{\\\ } ) */
+ no_boundary_cmd, /* suppress boundary ligatures ( \.{\\noboundary} ) */
+ radical_cmd, /* square root and similar signs ( \.{\\radical} ) */
+ end_cs_name_cmd, /* end control sequence ( \.{\\endcsname} ) */
+ char_ghost_cmd, /* \.{\\ghostleft}, \.{\\ghostright} character for kerning */
+ assign_local_box_cmd, /* box for guillemets \.{\\localleftbox} or \.{\\localrightbox} */
+ char_given_cmd, /* character code defined by \.{\\chardef} */
+#define min_internal_cmd char_given_cmd /* the smallest code that can follow \.{\\the} */
+ math_given_cmd, /* math code defined by \.{\\mathchardef} */
+ omath_given_cmd, /* math code defined by \.{\\omathchardef} */
+ xmath_given_cmd, /* math code defined by \.{\\LuaTeXmathchardef} */
+ last_item_cmd, /* most recent item ( \.{\\lastpenalty}, \.{\\lastkern}, \.{\\lastskip} ) */
+#define max_non_prefixed_command_cmd last_item_cmd /* largest command code that can't be \.{\\global} */
+ toks_register_cmd, /* token list register ( \.{\\toks} ) */
+ assign_toks_cmd, /* special token list ( \.{\\output}, \.{\\everypar}, etc.~) */
+ assign_int_cmd, /* user-defined integer ( \.{\\tolerance}, \.{\\day}, etc.~) */
+ assign_attr_cmd, /* user-defined attributes */
+ assign_dimen_cmd, /* user-defined length ( \.{\\hsize}, etc.~) */
+ assign_glue_cmd, /* user-defined glue ( \.{\\baselineskip}, etc.~) */
+ assign_mu_glue_cmd, /* user-defined muglue ( \.{\\thinmuskip}, etc.~) */
+ assign_font_dimen_cmd, /* user-defined font dimension ( \.{\\fontdimen} ) */
+ assign_font_int_cmd, /* user-defined font integer ( \.{\\hyphenchar}, \.{\\skewchar} ) */
+ set_aux_cmd, /* specify state info ( \.{\\spacefactor}, \.{\\prevdepth} ) */
+ set_prev_graf_cmd, /* specify state info ( \.{\\prevgraf} ) */
+ set_page_dimen_cmd, /* specify state info ( \.{\\pagegoal}, etc.~) */
+ set_page_int_cmd, /* specify state info ( \.{\\deadcycles}, \.{\\insertpenalties} ) */
+ set_box_dimen_cmd, /* change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} ) */
+ set_tex_shape_cmd, /* specify fancy paragraph shape ( \.{\\parshape} ) */
+ set_etex_shape_cmd, /* specify etex extended list ( \.{\\interlinepenalties}, etc.~) */
+ def_char_code_cmd, /* define a character code ( \.{\\catcode}, etc.~) */
+ def_del_code_cmd, /* define a delimiter code ( \.{\\delcode}) */
+ extdef_math_code_cmd, /* define an extended character code ( \.{\\omathcode}, etc.~) */
+ extdef_del_code_cmd, /* define an extended delimiter code ( \.{\\odelcode}, etc.~) */
+ def_family_cmd, /* declare math fonts ( \.{\\textfont}, etc.~) */
+ set_math_param_cmd, /* set math parameters ( \.{\\mathquad}, etc.~) */
+ set_font_cmd, /* set current font ( font identifiers ) */
+ def_font_cmd, /* define a font file ( \.{\\font} ) */
+ register_cmd, /* internal register ( \.{\\count}, \.{\\dimen}, etc.~) */
+ assign_box_dir_cmd, /* (\.{\\boxdir}) */
+ assign_dir_cmd, /* (\.{\\pagedir}, \.{\\textdir}) */
+#define max_internal_cmd assign_dir_cmd /* the largest code that can follow \.{\\the} */
+ advance_cmd, /* advance a register or parameter ( \.{\\advance} ) */
+ multiply_cmd, /* multiply a register or parameter ( \.{\\multiply} ) */
+ divide_cmd, /* divide a register or parameter ( \.{\\divide} ) */
+ prefix_cmd, /* qualify a definition ( \.{\\global}, \.{\\long}, \.{\\outer} ) */
+ let_cmd, /* assign a command code ( \.{\\let}, \.{\\futurelet} ) */
+ shorthand_def_cmd, /* code definition ( \.{\\chardef}, \.{\\countdef}, etc.~) */
+ read_to_cs_cmd, /* read into a control sequence ( \.{\\read} ) */
+ def_cmd, /* macro definition ( \.{\\def}, \.{\\gdef}, \.{\\xdef}, \.{\\edef} ) */
+ set_box_cmd, /* set a box ( \.{\\setbox} ) */
+ hyph_data_cmd, /* hyphenation data ( \.{\\hyphenation}, \.{\\patterns} ) */
+ set_interaction_cmd, /* define level of interaction ( \.{\\batchmode}, etc.~) */
+ letterspace_font_cmd, /* letterspace a font ( \.{\\letterspacefont} ) */
+ pdf_copy_font_cmd, /* create a new font instance ( \.{\\pdfcopyfont} ) */
+ set_ocp_cmd, /* Place a translation process in the stream */
+ def_ocp_cmd, /* Define and load a translation process */
+ set_ocp_list_cmd, /* Place a list of OCPs in the stream */
+ def_ocp_list_cmd, /* Define a list of OCPs */
+ clear_ocp_lists_cmd, /* Remove all active OCP lists */
+ push_ocp_list_cmd, /* Add to the sequence of active OCP lists */
+ pop_ocp_list_cmd, /* Remove from the sequence of active OCP lists */
+ ocp_list_op_cmd, /* Operations for building a list of OCPs */
+ ocp_trace_level_cmd, /* Tracing of active OCPs, either 0 or 1 */
+#define max_command_cmd ocp_trace_level_cmd /* the largest command code seen at |big_switch| */
+ undefined_cs_cmd, /* initial state of most |eq_type| fields */
+ expand_after_cmd, /* special expansion ( \.{\\expandafter} ) */
+ no_expand_cmd, /* special nonexpansion ( \.{\\noexpand} ) */
+ input_cmd, /* input a source file ( \.{\\input}, \.{\\endinput} or
+ \.{\\scantokens} or \.{\\scantextokens} ) */
+ if_test_cmd, /* conditional text ( \.{\\if}, \.{\\ifcase}, etc.~) */
+ fi_or_else_cmd, /* delimiters for conditionals ( \.{\\else}, etc.~) */
+ cs_name_cmd, /* make a control sequence from tokens ( \.{\\csname} ) */
+ convert_cmd, /* convert to text ( \.{\\number}, \.{\\string}, etc.~) */
+ the_cmd, /* expand an internal quantity ( \.{\\the} or \.{\\unexpanded}, \.{\\detokenize} ) */
+ top_bot_mark_cmd, /* inserted mark ( \.{\\topmark}, etc.~) */
+ call_cmd, /* non-long, non-outer control sequence */
+ long_call_cmd, /* long, non-outer control sequence */
+ outer_call_cmd, /* non-long, outer control sequence */
+ long_outer_call_cmd, /* long, outer control sequence */
+ end_template_cmd, /* end of an alignment template */
+ dont_expand_cmd, /* the following token was marked by \.{\\noexpand} */
+ glue_ref_cmd, /* the equivalent points to a glue specification */
+ shape_ref_cmd, /* the equivalent points to a parshape specification */
+ box_ref_cmd, /* the equivalent points to a box node, or is |null| */
+ data_cmd, /* the equivalent is simply a halfword number */
+#define last_cmd data_cmd
+} tex_command_code;
+
+
+typedef enum {
+ int_val_level = 0, /* integer values */
+ attr_val_level, /* integer values */
+ dimen_val_level, /* dimension values */
+ glue_val_level, /* glue specifications */
+ mu_val_level, /* math glue specifications */
+ dir_val_level, /* directions */
+ ident_val_level, /* font identifier */
+ tok_val_level, /* token lists */
+} value_level_code;
+
+typedef enum {
+ above_code = 0,
+ over_code = 1,
+ atop_code = 2,
+ delimited_code = 3
+} fraction_codes;
+
+
+typedef enum {
+ convert_number_code = 0, /* command code for \.{\\number} */
+ convert_roman_numeral_code, /* command code for \.{\\romannumeral} */
+ convert_string_code, /* command code for \.{\\string} */
+ convert_meaning_code, /* command code for \.{\\meaning} */
+ convert_font_name_code, /* command code for \.{\\fontname} */
+ convert_etex_code, /* command code for \.{\\eTeXVersion} */
+ convert_omega_code, /* command code for \.{\\OmegaVersion} */
+ convert_aleph_code, /* command code for \.{\\AlephVersion} */
+ convert_format_name_code, /* command code for \.{\\AlephVersion} */
+ convert_pdftex_revision_code, /* command code for \.{\\pdftexrevision} */
+#define convert_pdftex_first_expand_code convert_pdftex_revision_code /* base for \pdfTeX's command codes */
+ convert_pdftex_banner_code, /* command code for \.{\\pdftexbanner} */
+ convert_pdf_font_name_code, /* command code for \.{\\pdffontname} */
+ convert_pdf_font_objnum_code, /* command code for \.{\\pdffontobjnum} */
+ convert_pdf_font_size_code, /* command code for \.{\\pdffontsize} */
+ convert_pdf_page_ref_code, /* command code for \.{\\pdfpageref} */
+ convert_pdf_xform_name_code, /* command code for \.{\\pdfxformname} */
+ convert_left_margin_kern_code, /* command code for \.{\\leftmarginkern} */
+ convert_right_margin_kern_code, /* command code for \.{\\rightmarginkern} */
+ convert_pdf_creation_date_code, /* command code for \.{\\pdfcreationdate} */
+ convert_uniform_deviate_code, /* command code for \.{\\uniformdeviate} */
+ convert_normal_deviate_code, /* command code for \.{\\normaldeviate} */
+ convert_pdf_insert_ht_code, /* command code for \.{\\pdfinsertht} */
+ convert_pdf_ximage_bbox_code, /* command code for \.{\\pdfximagebbox} */
+ convert_lua_code, /* command code for \.{\\directlua} */
+ convert_lua_escape_string_code, /* command code for \.{\\luaescapestring} */
+ convert_pdf_colorstack_init_code, /* command code for \.{\\pdfcolorstackinit} */
+ convert_luatex_revision_code, /* command code for \.{\\luatexrevision} */
+ convert_luatex_date_code, /* command code for \.{\\luatexdate} */
+ convert_expanded_code, /* command code for \.{\\expanded} */
+ convert_job_name_code, /* command code for \.{\\jobname} */
+#define convert_pdftex_convert_codes convert_job_name_code /* end of \pdfTeX's command codes */
+ convert_Aleph_revision_code, /* command code for \.{\\Alephrevision} */
+ convert_Omega_revision_code, /* command code for \.{\\Omegarevision} */
+ convert_eTeX_revision_code, /* command code for \.{\\eTeXrevision} */
+ convert_font_identifier_code, /* command code for \.{tex.fontidentifier} (virtual) */
+} convert_codes;
+
+typedef enum {
+ last_item_lastpenalty_code = 0, /* code for \.{\\lastpenalty} */
+ last_item_lastattr_code, /* not used */
+ last_item_lastkern_code, /* code for \.{\\lastkern} */
+ last_item_lastskip_code, /* code for \.{\\lastskip} */
+ last_item_last_node_type_code, /* code for \.{\\lastnodetype} */
+ last_item_input_line_no_code, /* code for \.{\\inputlineno} */
+ last_item_badness_code, /* code for \.{\\badness} */
+ last_item_pdftex_version_code, /* code for \.{\\pdftexversion} */
+#define last_item_pdftex_first_rint_code last_item_pdftex_version_code /* base for \pdfTeX's command codes */
+ last_item_pdf_last_obj_code, /* code for \.{\\pdflastobj} */
+ last_item_pdf_last_xform_code, /* code for \.{\\pdflastxform} */
+ last_item_pdf_last_ximage_code, /* code for \.{\\pdflastximage} */
+ last_item_pdf_last_ximage_pages_code, /* code for \.{\\pdflastximagepages} */
+ last_item_pdf_last_annot_code, /* code for \.{\\pdflastannot} */
+ last_item_pdf_last_x_pos_code, /* code for \.{\\pdflastxpos} */
+ last_item_pdf_last_y_pos_code, /* code for \.{\\pdflastypos} */
+ last_item_pdf_retval_code, /* global multi-purpose return value */
+ last_item_pdf_last_ximage_colordepth_code, /* code for \.{\\pdflastximagecolordepth} */
+ last_item_random_seed_code, /* code for \.{\\pdfrandomseed} */
+ last_item_pdf_last_link_code, /* code for \.{\\pdflastlink} */
+ last_item_luatex_version_code, /* code for \.{\\luatexversion} */
+#define last_item_pdftex_last_item_codes last_item_luatex_version_code /* end of \pdfTeX's command codes */
+ last_item_Aleph_version_code, /* code for \.{\\Alephversion} */
+#define last_item_Aleph_int last_item_Aleph_version_code
+ last_item_Omega_version_code, /* code for \.{\\Omegaversion} */
+ last_item_Aleph_minor_version_code, /* code for \.{\\Alephminorversion} */
+ last_item_Omega_minor_version_code, /* code for \.{\\Omegaminorversion} */
+ last_item_eTeX_minor_version_code, /* code for \.{\\eTeXminorversion} */
+ last_item_eTeX_version_code, /* code for \.{\\eTeXversion} */
+#define last_item_eTeX_int last_item_eTeX_version_code /* first of \eTeX\ codes for integers */
+ last_item_current_group_level_code, /* code for \.{\\currentgrouplevel} */
+ last_item_current_group_type_code, /* code for \.{\\currentgrouptype} */
+ last_item_current_if_level_code, /* code for \.{\\currentiflevel} */
+ last_item_current_if_type_code, /* code for \.{\\currentiftype} */
+ last_item_current_if_branch_code, /* code for \.{\\currentifbranch} */
+ last_item_glue_stretch_order_code, /* code for \.{\\gluestretchorder} */
+ last_item_glue_shrink_order_code, /* code for \.{\\glueshrinkorder} */
+ last_item_font_char_wd_code, /* code for \.{\\fontcharwd} */
+#define last_item_eTeX_dim last_item_font_char_wd_code /* first of \eTeX\ codes for dimensions */
+ last_item_font_char_ht_code, /* code for \.{\\fontcharht} */
+ last_item_font_char_dp_code, /* code for \.{\\fontchardp} */
+ last_item_font_char_ic_code, /* code for \.{\\fontcharic} */
+ last_item_par_shape_length_code, /* code for \.{\\parshapelength} */
+ last_item_par_shape_indent_code, /* code for \.{\\parshapeindent} */
+ last_item_par_shape_dimen_code, /* code for \.{\\parshapedimen} */
+ last_item_glue_stretch_code, /* code for \.{\\gluestretch} */
+ last_item_glue_shrink_code, /* code for \.{\\glueshrink} */
+ last_item_mu_to_glue_code, /* code for \.{\\mutoglue} */
+#define last_item_eTeX_glue last_item_mu_to_glue_code /* first of \eTeX\ codes for glue */
+ last_item_glue_to_mu_code, /* code for \.{\\gluetomu} */
+#define last_item_eTeX_mu last_item_glue_to_mu_code /* first of \eTeX\ codes for muglue */
+ last_item_numexpr_code, /* code for \.{\\numexpr} */
+#define last_item_eTeX_expr last_item_numexpr_code /* first of \eTeX\ codes for expressions */
+ last_item_attrexpr_code, /* not used */
+ last_item_dimexpr_code, /* code for \.{\\dimexpr} */
+ last_item_glueexpr_code, /* code for \.{\\glueexpr} */
+ last_item_muexpr_code, /* code for \.{\\muexpr} */
+} last_item_codes;
+
+typedef enum {
+ param_par_shape_code = 0, /* specifies paragraph shape */
+ param_output_routine_code, /* points to token list for \.{\\output} */
+ param_every_par_code, /* points to token list for \.{\\everypar} */
+ param_every_math_code, /* points to token list for \.{\\everymath} */
+ param_every_display_code, /* points to token list for \.{\\everydisplay} */
+ param_every_hbox_code, /* points to token list for \.{\\everyhbox} */
+ param_every_vbox_code, /* points to token list for \.{\\everyvbox} */
+ param_every_job_code, /* points to token list for \.{\\everyjob} */
+ param_every_cr_code, /* points to token list for \.{\\everycr} */
+ param_err_help_code, /* points to token list for \.{\\errhelp} */
+ param_pdf_pages_attr_code, /* points to token list for \.{\\pdfpagesattr} */
+ param_pdf_page_attr_code, /* points to token list for \.{\\pdfpageattr} */
+ param_pdf_page_resources_code, /* points to token list for \.{\\pdfpageresources} */
+ param_pdf_pk_mode_code, /* points to token list for \.{\\pdfpkmode} */
+ param_every_eof_code, /* points to token list for \.{\\everyeof} */
+ param_ocp_trace_level_code,
+ param_ocp_active_number_code,
+ param_ocp_active_min_ptr_code,
+ param_ocp_active_max_ptr_code,
+ param_ocp_active_code
+} param_local_pars;
+
+
+typedef enum {
+ param_pretolerance_code = 0, /* badness tolerance before hyphenation */
+ param_tolerance_code, /* badness tolerance after hyphenation */
+ param_line_penalty_code, /* added to the badness of every line */
+ param_hyphen_penalty_code, /* penalty for break after discretionary hyphen */
+ param_ex_hyphen_penalty_code, /* penalty for break after explicit hyphen */
+ param_club_penalty_code, /* penalty for creating a club line */
+ param_widow_penalty_code, /* penalty for creating a widow line */
+ param_display_widow_penalty_code, /* ditto, just before a display */
+ param_broken_penalty_code, /* penalty for breaking a page at a broken line */
+ param_bin_op_penalty_code, /* penalty for breaking after a binary operation */
+ param_rel_penalty_code, /* penalty for breaking after a relation */
+ param_pre_display_penalty_code, /* penalty for breaking just before a displayed formula */
+ param_post_display_penalty_code, /* penalty for breaking just after a displayed formula */
+ param_inter_line_penalty_code, /* additional penalty between lines */
+ param_double_hyphen_demerits_code, /* demerits for double hyphen break */
+ param_final_hyphen_demerits_code, /* demerits for final hyphen break */
+ param_adj_demerits_code, /* demerits for adjacent incompatible lines */
+ param_mag_code, /* magnification ratio */
+ param_delimiter_factor_code, /* ratio for variable-size delimiters */
+ param_looseness_code, /* change in number of lines for a paragraph */
+ param_time_code, /* current time of day */
+ param_day_code, /* current day of the month */
+ param_month_code, /* current month of the year */
+ param_year_code, /* current year of our Lord */
+ param_show_box_breadth_code, /* nodes per level in |show_box| */
+ param_show_box_depth_code, /* maximum level in |show_box| */
+ param_hbadness_code, /* hboxes exceeding this badness will be shown by |hpack| */
+ param_vbadness_code, /* vboxes exceeding this badness will be shown by |vpack| */
+ param_pausing_code, /* pause after each line is read from a file */
+ param_tracing_online_code, /* show diagnostic output on terminal */
+ param_tracing_macros_code, /* show macros as they are being expanded */
+ param_tracing_stats_code, /* show memory usage if \TeX\ knows it */
+ param_tracing_paragraphs_code, /* show line-break calculations */
+ param_tracing_pages_code, /* show page-break calculations */
+ param_tracing_output_code, /* show boxes when they are shipped out */
+ param_tracing_lost_chars_code, /* show characters that aren't in the font */
+ param_tracing_commands_code, /* show command codes at |big_switch| */
+ param_tracing_restores_code, /* show equivalents when they are restored */
+ param_uc_hyph_code, /* hyphenate words beginning with a capital letter */
+ param_output_penalty_code, /* penalty found at current page break */
+ param_max_dead_cycles_code, /* bound on consecutive dead cycles of output */
+ param_hang_after_code, /* hanging indentation changes after this many lines */
+ param_floating_penalty_code, /* penalty for insertions heldover after a split */
+ param_global_defs_code, /* override \.{\\global} specifications */
+ param_cur_fam_code, /* current family */
+ param_escape_char_code, /* escape character for token output */
+ param_default_hyphen_char_code, /* value of \.{\\hyphenchar} when a font is loaded */
+ param_default_skew_char_code, /* value of \.{\\skewchar} when a font is loaded */
+ param_end_line_char_code, /* character placed at the right end of the buffer */
+ param_new_line_char_code, /* character that prints as |print_ln| */
+ param_language_code, /* current hyphenation table */
+ param_left_hyphen_min_code, /* minimum left hyphenation fragment size */
+ param_right_hyphen_min_code, /* minimum right hyphenation fragment size */
+ param_holding_inserts_code, /* do not remove insertion nodes from \.{\\box255} */
+ param_error_context_lines_code, /* maximum intermediate line pairs shown */
+ param_local_inter_line_penalty_code, /* local \.{\\interlinepenalty} */
+ param_local_broken_penalty_code, /* local \.{\\brokenpenalty} */
+ param_no_local_whatsits_code, /* counts local whatsits */
+ param_no_local_dirs_code,
+ param_level_local_dir_code,
+ param_luastartup_id_code,
+ param_disable_lig_code,
+ param_disable_kern_code,
+ param_cat_code_table_code,
+ param_output_box_code,
+ param_cur_lang_code, /* current language id */
+ param_ex_hyphen_char_code,
+ param_page_direction_code, /* the five direction params do not exist in web */
+ param_body_direction_code,
+ param_par_direction_code,
+ param_text_direction_code,
+ param_math_direction_code,
+ param_pdf_output_code, /* switch on PDF output if positive */
+ param_pdf_compress_level_code, /* compress level of streams */
+ param_pdf_decimal_digits_code, /* digits after the decimal point of numbers */
+ param_pdf_move_chars_code, /* move chars 0..31 to higher area if possible */
+ param_pdf_image_resolution_code, /* default image resolution */
+ param_pdf_pk_resolution_code, /* default resolution of PK font */
+ param_pdf_unique_resname_code, /* generate unique names for resouces */
+ param_pdf_option_always_use_pdfpagebox_code, /* if the PDF inclusion should always use a specific PDF page box */
+ param_pdf_option_pdf_inclusion_errorlevel_code, /* if the PDF inclusion should treat pdfs newer than |pdf_minor_version| as an error */
+ param_pdf_minor_version_code, /* fractional part of the PDF version produced */
+ param_pdf_force_pagebox_code, /* if the PDF inclusion should always use a specific PDF page box */
+ param_pdf_pagebox_code, /* default pagebox to use for PDF inclusion */
+ param_pdf_inclusion_errorlevel_code, /* if the PDF inclusion should treat pdfs newer than |pdf_minor_version| as an error */
+ param_pdf_gamma_code,
+ param_pdf_image_gamma_code,
+ param_pdf_image_hicolor_code,
+ param_pdf_image_apply_gamma_code,
+ param_pdf_adjust_spacing_code, /* level of spacing adjusting */
+ param_pdf_protrude_chars_code, /* protrude chars at left/right edge of paragraphs */
+ param_pdf_tracing_fonts_code, /* level of font detail in log */
+ param_pdf_objcompresslevel_code, /* activate object streams */
+ param_unused_one_code, /* deleted param (pdftex integer 21) */
+ param_unused_two_code, /* deleted param (pdftex integer 22) */
+ param_unused_three_code, /* deleted param (pdftex integer 23) */
+ param_pdf_gen_tounicode_code, /* generate ToUnicode for fonts? */
+ param_pdf_draftmode_code, /* switch on draftmode if positive */
+ param_pdf_replace_font_code, /* generate ToUnicode for fonts? */
+ param_pdf_inclusion_copy_font_code, /* generate ToUnicode for fonts? */
+ param_tracing_assigns_code, /* show assignments */
+ param_tracing_groups_code, /* show save/restore groups */
+ param_tracing_ifs_code, /* show conditionals */
+ param_tracing_scan_tokens_code, /* show pseudo file open and close */
+ param_tracing_nesting_code, /* show incomplete groups and ifs within files */
+ param_pre_display_direction_code, /* text direction preceding a display */
+ param_last_line_fit_code, /* adjustment for last line of paragraph */
+ param_saving_vdiscards_code, /* save items discarded from vlists */
+ param_saving_hyph_codes_code, /* save hyphenation codes for languages */
+ param_suppress_fontnotfound_error_code, /* suppress errors for missing fonts */
+ param_suppress_long_error_code, /* suppress errors for \\par in non-long contexts */
+ param_suppress_ifcsname_error_code, /* suppress errors for \\ifcsname junk contexts */
+ param_suppress_outer_error_code, /* suppress errors for \\outer contexts */
+ param_synctex_code, /* is synctex file generation enabled ? */
+} int_param_codes;
+
+#define param_int_pars param_synctex_code+1 /* total number of integer parameters */
+
+typedef enum {
+ param_par_indent_code = 0, /* indentation of paragraphs */
+ param_math_surround_code, /* space around math in text */
+ param_line_skip_limit_code, /* threshold for |line_skip| instead of |baseline_skip| */
+ param_hsize_code, /* line width in horizontal mode */
+ param_vsize_code, /* page height in vertical mode */
+ param_max_depth_code, /* maximum depth of boxes on main pages */
+ param_split_max_depth_code, /* maximum depth of boxes on split pages */
+ param_box_max_depth_code, /* maximum depth of explicit vboxes */
+ param_hfuzz_code, /* tolerance for overfull hbox messages */
+ param_vfuzz_code, /* tolerance for overfull vbox messages */
+ param_delimiter_shortfall_code, /* maximum amount uncovered by variable delimiters */
+ param_null_delimiter_space_code, /* blank space in null delimiters */
+ param_script_space_code, /* extra space after subscript or superscript */
+ param_pre_display_size_code, /* length of text preceding a display */
+ param_display_width_code, /* length of line for displayed equation */
+ param_display_indent_code, /* indentation of line for displayed equation */
+ param_overfull_rule_code, /* width of rule that identifies overfull hboxes */
+ param_hang_indent_code, /* amount of hanging indentation */
+ param_h_offset_code, /* amount of horizontal offset when shipping pages out */
+ param_v_offset_code, /* amount of vertical offset when shipping pages out */
+ param_emergency_stretch_code, /* reduces badnesses on final pass of line-breaking */
+ param_page_left_offset_code,
+ param_page_top_offset_code,
+ param_page_right_offset_code,
+ param_page_bottom_offset_code,
+ param_pdf_h_origin_code, /* horigin of the PDF output */
+#define param_pdftex_first_dimen_code param_pdf_horigin_code /* first number defined in this section */
+ param_pdf_v_origin_code, /* vorigin of the PDF output */
+ param_page_width_code, /* page width of the PDF output */
+ param_page_height_code, /* page height of the PDF output */
+ param_pdf_link_margin_code, /* link margin in the PDF output */
+ param_pdf_dest_margin_code, /* dest margin in the PDF output */
+ param_pdf_thread_margin_code, /* thread margin in the PDF output */
+ param_pdf_first_line_height_code,
+ param_pdf_last_line_depth_code,
+ param_pdf_each_line_height_code,
+ param_pdf_each_line_depth_code,
+ param_pdf_ignored_dimen_code,
+ param_pdf_px_dimen_code
+} dimen_param_codes;
+
+#define param_pdftex_last_dimen_code param_pdftex_px_dimen_code /* last number defined in this section */
+#define param_dimen_pars param_pdftex_last_dimen_code+1 /* total number of dimension parameters */
+
+typedef enum {
+ param_line_skip_code = 0, /* interline glue if |baseline_skip| is infeasible */
+ param_baseline_skip_code, /* desired glue between baselines */
+ param_par_skip_code, /* extra glue just above a paragraph */
+ param_above_display_skip_code, /* extra glue just above displayed math */
+ param_below_display_skip_code, /* extra glue just below displayed math */
+ param_above_display_short_skip_code, /* glue above displayed math following short lines */
+ param_below_display_short_skip_code, /* glue below displayed math following short lines */
+ param_left_skip_code, /* glue at left of justified lines */
+ param_right_skip_code, /* glue at right of justified lines */
+ param_top_skip_code, /* glue at top of main pages */
+ param_split_top_skip_code, /* glue at top of split pages */
+ param_tab_skip_code, /* glue between aligned entries */
+ param_space_skip_code, /* glue between words (if not |zero_glue|) */
+ param_xspace_skip_code, /* glue after sentences (if not |zero_glue|) */
+ param_par_fill_skip_code, /* glue on last line of paragraph */
+ param_thin_mu_skip_code, /* thin space in math formula */
+ param_med_mu_skip_code, /* medium space in math formula */
+ param_thick_mu_skip_code, /* thick space in math formula */
+} param_skip_codes;
+
+#define glue_pars thick_mu_skip_code+1 /* total number of glue parameters */
+
+#define eq_type(a) zeqtb[a].hh.u.B0
+#define equiv(a) zeqtb[a].hh.v.RH
+
+#define int_par(A) zeqtb[static_int_base+(A)].cint
+#define dimen_par(A) zeqtb[static_dimen_base+(A)].cint
+#define loc_par(A) equiv(static_local_base+(A))
+#define glue_par(A) equiv(static_glue_base+(A))
+
+
+typedef enum {
+ bottom_level = 0, /* group code for the outside world */
+ simple_group, /* group code for local structure only */
+ hbox_group, /* code for `\.{\\hbox}\grp' */
+ adjusted_hbox_group, /* code for `\.{\\hbox}\grp' in vertical mode */
+ vbox_group, /* code for `\.{\\vbox}\grp' */
+ vtop_group, /* code for `\.{\\vtop}\grp' */
+ align_group, /* code for `\.{\\halign}\grp', `\.{\\valign}\grp' */
+ no_align_group, /* code for `\.{\\noalign}\grp' */
+ output_group, /* code for output routine */
+ math_group, /* code for, e.g., `\.{\char'136}\grp' */
+ disc_group, /* code for `\.{\\discretionary}\grp\grp\grp' */
+ insert_group, /* code for `\.{\\insert}\grp', `\.{\\vadjust}\grp' */
+ vcenter_group, /* code for `\.{\\vcenter}\grp' */
+ math_choice_group, /* code for `\.{\\mathchoice}\grp\grp\grp\grp' */
+ semi_simple_group, /* code for `\.{\\begingroup...\\endgroup}' */
+ math_shift_group, /* code for `\.{\$...\$}' */
+ math_left_group, /* code for `\.{\\left...\\right}' */
+ local_box_group, /* code for `\.{\\localleftbox...\\localrightbox}' */
+ max_group_code,
+ split_off_group, /* box code for the top part of a \.{\\vsplit} */
+ split_keep_group, /* box code for the bottom part of a \.{\\vsplit} */
+ preamble_group, /* box code for the preamble processing in an alignment */
+ align_set_group, /* box code for the final item pass in an alignment */
+ fin_row_group /* box code for a provisory line in an alignment */
+} tex_group_codes;
diff --git a/Build/source/texk/web2c/luatexdir/depend.mk b/Build/source/texk/web2c/luatexdir/depend.mk
deleted file mode 100644
index 4f456e24899..00000000000
--- a/Build/source/texk/web2c/luatexdir/depend.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-lua/mp.o: lua/mp.c mplib.h mpmp.h mppsout.h
-lua/psout.o: lua/psout.c avl.h mplib.h mpmp.h mppsout.h
-lua/lmplib.o: lua/lmplib.c mplib.h mpmp.h mppsout.h
diff --git a/Build/source/texk/web2c/luatexdir/font/dofont.c b/Build/source/texk/web2c/luatexdir/font/dofont.c
index fbe44c29ba9..14d785b8a9f 100644
--- a/Build/source/texk/web2c/luatexdir/font/dofont.c
+++ b/Build/source/texk/web2c/luatexdir/font/dofont.c
@@ -1,183 +1,186 @@
-/*
-Copyright (c) 1996-2006 Taco Hoekwater <taco@luatex.org>
+/* dofont.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of LuaTeX.
+ This file is part of LuaTeX.
-LuaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-LuaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with LuaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id: dofont.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include "luatex-api.h"
+static const char _svn_version[] =
+ "$Id: dofont.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/dofont.c $";
+
#define TIMERS 0
#if TIMERS
-#include <sys/time.h>
+# include <sys/time.h>
#endif
/* a bit more interfacing is needed for proper error reporting */
-static char *
-font_error_message (pointer u, char *nom, scaled s) {
- char *str = xmalloc(256);
- char *c = makecstring(zget_cs_text(u));
- char *extra = "metric data not found or bad";
- if (s>=0 ) {
- snprintf(str,255,"Font \\%s=%s at %gpt not loadable: %s", c, nom, (double)s/65536, extra);
- } else if (s!=-1000) {
- snprintf(str,255,"Font \\%s=%s scaled %d not loadable: %s", c, nom, (int)(-s), extra);
- } else {
- snprintf(str,255,"Font \\%s=%s not loadable: %s", c, nom, extra);
- }
- return str;
+static char *font_error_message(pointer u, char *nom, scaled s)
+{
+ char *str = xmalloc(256);
+ char *c = makecstring(zget_cs_text(u));
+ char *extra = "metric data not found or bad";
+ if (s >= 0) {
+ snprintf(str, 255, "Font \\%s=%s at %gpt not loadable: %s", c, nom,
+ (double) s / 65536, extra);
+ } else if (s != -1000) {
+ snprintf(str, 255, "Font \\%s=%s scaled %d not loadable: %s", c, nom,
+ (int) (-s), extra);
+ } else {
+ snprintf(str, 255, "Font \\%s=%s not loadable: %s", c, nom, extra);
+ }
+ return str;
}
static int
-do_define_font (integer f, char *cnom, char *caire, scaled s, integer natural_dir) {
+do_define_font(integer f, char *cnom, char *caire, scaled s,
+ integer natural_dir)
+{
- boolean res; /* was the callback successful? */
- integer callback_id;
- char *cnam;
+ boolean res; /* was the callback successful? */
+ integer callback_id;
+ char *cnam;
#if TIMERS
struct timeval tva;
struct timeval tvb;
double tvdiff;
#endif
- int r;
- res = 0;
-
- callback_id=callback_defined(define_font_callback);
- if (callback_id>0) {
- if (caire == NULL || strlen(caire)==0) {
- cnam = xstrdup(cnom);
- } else {
- cnam = xmalloc(strlen(cnom)+strlen(caire)+2);
- sprintf(cnam,"%s/%s",caire,cnom);
- }
+ int r;
+ res = 0;
+
+ callback_id = callback_defined(define_font_callback);
+ if (callback_id > 0) {
+ if (caire == NULL || strlen(caire) == 0) {
+ cnam = xstrdup(cnom);
+ } else {
+ cnam = xmalloc(strlen(cnom) + strlen(caire) + 2);
+ sprintf(cnam, "%s/%s", caire, cnom);
+ }
#if TIMERS
- gettimeofday(&tva,NULL);
+ gettimeofday(&tva, NULL);
#endif
- callback_id = run_and_save_callback(callback_id,"Sdd->",cnam,s,f);
+ callback_id = run_and_save_callback(callback_id, "Sdd->", cnam, s, f);
#if TIMERS
- gettimeofday(&tvb,NULL);
- tvdiff = tvb.tv_sec*1000000.0;
- tvdiff += (double)tvb.tv_usec;
- tvdiff -= (tva.tv_sec*1000000.0);
- tvdiff -= (double)tva.tv_usec;
- tvdiff /= 1000000;
- fprintf(stdout,"\ncallback('define_font',%s,%i): %f seconds\n", cnam,f,tvdiff);
+ gettimeofday(&tvb, NULL);
+ tvdiff = tvb.tv_sec * 1000000.0;
+ tvdiff += (double) tvb.tv_usec;
+ tvdiff -= (tva.tv_sec * 1000000.0);
+ tvdiff -= (double) tva.tv_usec;
+ tvdiff /= 1000000;
+ fprintf(stdout, "\ncallback('define_font',%s,%i): %f seconds\n", cnam,
+ f, tvdiff);
#endif
- free(cnam);
- if (callback_id>0) { /* success */
- luaL_checkstack(Luas[0],1,"out of stack space");
- lua_rawgeti(Luas[0],LUA_REGISTRYINDEX, callback_id);
- if (lua_istable(Luas[0],-1)) {
+ free(cnam);
+ if (callback_id > 0) { /* success */
+ luaL_checkstack(Luas, 1, "out of stack space");
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, callback_id);
+ if (lua_istable(Luas, -1)) {
#if TIMERS
- gettimeofday(&tva,NULL);
+ gettimeofday(&tva, NULL);
#endif
- res = font_from_lua(Luas[0],f);
- destroy_saved_callback (callback_id);
+ res = font_from_lua(Luas, f);
+ destroy_saved_callback(callback_id);
#if TIMERS
- gettimeofday(&tvb,NULL);
- tvdiff = tvb.tv_sec*1000000.0;
- tvdiff += (double)tvb.tv_usec;
- tvdiff -= (tva.tv_sec*1000000.0);
- tvdiff -= (double)tva.tv_usec;
- tvdiff /= 1000000;
- fprintf(stdout,"font_from_lua(%s,%i): %f seconds\n", font_name(f),f,tvdiff);
+ gettimeofday(&tvb, NULL);
+ tvdiff = tvb.tv_sec * 1000000.0;
+ tvdiff += (double) tvb.tv_usec;
+ tvdiff -= (tva.tv_sec * 1000000.0);
+ tvdiff -= (double) tva.tv_usec;
+ tvdiff /= 1000000;
+ fprintf(stdout, "font_from_lua(%s,%i): %f seconds\n",
+ font_name(f), f, tvdiff);
#endif
- lua_pop(Luas[0],1);
- } else if (lua_isnumber(Luas[0],-1)) {
- r = lua_tonumber(Luas[0],-1);
- destroy_saved_callback (callback_id);
- delete_font(f);
- lua_pop(Luas[0],1);
- return r;
- } else {
- lua_pop(Luas[0],1);
- delete_font(f);
- return 0;
- }
+ /* lua_pop(Luas, 1); *//* done by font_from_lua */
+ } else if (lua_isnumber(Luas, -1)) {
+ r = lua_tonumber(Luas, -1);
+ destroy_saved_callback(callback_id);
+ delete_font(f);
+ lua_pop(Luas, 1);
+ return r;
+ } else {
+ lua_pop(Luas, 1);
+ delete_font(f);
+ return 0;
+ }
+ }
+ } else {
+ res = read_tfm_info(f, cnom, caire, s);
+ if (res) {
+ set_hyphen_char(f, get_default_hyphen_char());
+ set_skew_char(f, get_default_skew_char());
+ }
}
- } else {
- res = read_tfm_info(f,cnom,caire,s);
if (res) {
- set_hyphen_char(f,get_default_hyphen_char());
- set_skew_char(f,get_default_skew_char());
+ if (font_type(f) != virtual_font_type) { /* implies lua */
+ do_vf(f);
+ set_font_natural_dir(f, natural_dir);
+ }
+ return f;
+ } else {
+ delete_font(f);
+ return 0;
}
- }
- if (res) {
- do_vf(f);
- set_font_natural_dir(f,natural_dir);
- return f;
- } else {
- delete_font(f);
- return 0;
- }
}
-int
-read_font_info(pointer u, strnumber nom, strnumber aire, scaled s,
- integer natural_dir) {
- integer f;
- char *cnom, *caire = NULL;
- char *msg;
- cnom = xstrdup(makecstring(nom));
- if (aire != 0)
- caire = xstrdup(makecstring(aire));
-
- f = new_font();
- if ((f = do_define_font(f, cnom,caire,s,natural_dir))) {
- if (caire != NULL) free(caire);
- free(cnom);
- return f;
- } else {
- char *help[] = {"I wasn't able to read the size data for this font,",
- "so I will ignore the font specification.",
- "[Wizards can fix TFM files using TFtoPL/PLtoTF.]",
- "You might try inserting a different font spec;",
- "e.g., type `I\font<same font id>=<substitute font name>'.",
- NULL } ;
- if(!get_suppress_fontnotfound_error()) {
- msg = font_error_message(u, cnom, s);
- tex_error(msg,help);
- free(msg);
- }
- if (caire != NULL) free(caire);
- free(cnom);
- return 0;
- }
+int read_font_info(pointer u, strnumber nom, scaled s, integer natural_dir)
+{
+ integer f;
+ char *cnom;
+ char *msg;
+ cnom = xstrdup(makecstring(nom));
+
+ f = new_font();
+ if ((f = do_define_font(f, cnom, NULL, s, natural_dir))) {
+ free(cnom);
+ return f;
+ } else {
+ char *help[] = { "I wasn't able to read the size data for this font,",
+ "so I will ignore the font specification.",
+ "[Wizards can fix TFM files using TFtoPL/PLtoTF.]",
+ "You might try inserting a different font spec;",
+ "e.g., type `I\font<same font id>=<substitute font name>'.",
+ NULL
+ };
+ if (!get_suppress_fontnotfound_error()) {
+ msg = font_error_message(u, cnom, s);
+ tex_error(msg, help);
+ free(msg);
+ }
+ free(cnom);
+ return 0;
+ }
}
/* TODO This function is a placeholder. There can easily appears holes in
the |font_tables| array, and we could attempt to reuse those
*/
-int
-find_font_id (char *nom, char *aire, scaled s) {
- integer f;
- f = new_font();
- if ((f = do_define_font(f, nom, aire,s,-1))) {
- return f;
- } else {
- return 0;
- }
+int find_font_id(char *nom, char *aire, scaled s)
+{
+ integer f;
+ f = new_font();
+ if ((f = do_define_font(f, nom, aire, s, -1))) {
+ return f;
+ } else {
+ return 0;
+ }
}
-
diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.c b/Build/source/texk/web2c/luatexdir/font/luafont.c
index 4a2eda1f41c..d9fd6273b06 100644
--- a/Build/source/texk/web2c/luatexdir/font/luafont.c
+++ b/Build/source/texk/web2c/luatexdir/font/luafont.c
@@ -1,316 +1,477 @@
+/* luafont.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+static const char _svn_version[] =
+ "$Id: luafont.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/luafont.c $";
+
#define noVERBOSE
#define SAVE_REF 1
-char *font_type_strings[] = {"unknown","virtual","real", NULL};
-char *font_format_strings[] = {"unknown","type1","type3","truetype", "opentype", NULL};
-char *font_embedding_strings[] = {"unknown","no","subset", "full", NULL};
-char *ligature_type_strings[] = {"=:", "=:|", "|=:", "|=:|", "", "=:|>", "|=:>", "|=:|>", "", "", "", "|=:|>>", NULL };
+char *font_type_strings[] = { "unknown", "virtual", "real", NULL };
+char *font_format_strings[] =
+ { "unknown", "type1", "type3", "truetype", "opentype", NULL };
+char *font_embedding_strings[] = { "unknown", "no", "subset", "full", NULL };
+char *ligature_type_strings[] =
+ { "=:", "=:|", "|=:", "|=:|", "", "=:|>", "|=:>", "|=:|>", "", "", "",
+ "|=:|>>", NULL
+};
+
+const char *MATH_param_names[] = {
+ "nil",
+ "ScriptPercentScaleDown",
+ "ScriptScriptPercentScaleDown",
+ "DelimitedSubFormulaMinHeight",
+ "DisplayOperatorMinHeight",
+ "MathLeading",
+ "AxisHeight",
+ "AccentBaseHeight",
+ "FlattenedAccentBaseHeight",
+ "SubscriptShiftDown",
+ "SubscriptTopMax",
+ "SubscriptBaselineDropMin",
+ "SuperscriptShiftUp",
+ "SuperscriptShiftUpCramped",
+ "SuperscriptBottomMin",
+ "SuperscriptBaselineDropMax",
+ "SubSuperscriptGapMin",
+ "SuperscriptBottomMaxWithSubscript",
+ "SpaceAfterScript",
+ "UpperLimitGapMin",
+ "UpperLimitBaselineRiseMin",
+ "LowerLimitGapMin",
+ "LowerLimitBaselineDropMin",
+ "StackTopShiftUp",
+ "StackTopDisplayStyleShiftUp",
+ "StackBottomShiftDown",
+ "StackBottomDisplayStyleShiftDown",
+ "StackGapMin",
+ "StackDisplayStyleGapMin",
+ "StretchStackTopShiftUp",
+ "StretchStackBottomShiftDown",
+ "StretchStackGapAboveMin",
+ "StretchStackGapBelowMin",
+ "FractionNumeratorShiftUp",
+ "FractionNumeratorDisplayStyleShiftUp",
+ "FractionDenominatorShiftDown",
+ "FractionDenominatorDisplayStyleShiftDown",
+ "FractionNumeratorGapMin",
+ "FractionNumeratorDisplayStyleGapMin",
+ "FractionRuleThickness",
+ "FractionDenominatorGapMin",
+ "FractionDenominatorDisplayStyleGapMin",
+ "SkewedFractionHorizontalGap",
+ "SkewedFractionVerticalGap",
+ "OverbarVerticalGap",
+ "OverbarRuleThickness",
+ "OverbarExtraAscender",
+ "UnderbarVerticalGap",
+ "UnderbarRuleThickness",
+ "UnderbarExtraDescender",
+ "RadicalVerticalGap",
+ "RadicalDisplayStyleVerticalGap",
+ "RadicalRuleThickness",
+ "RadicalExtraAscender",
+ "RadicalKernBeforeDegree",
+ "RadicalKernAfterDegree",
+ "RadicalDegreeBottomRaisePercent",
+ "MinConnectorOverlap",
+ NULL,
+};
+
+static void dump_intfield(lua_State * L, char *n, int c)
+{
+ lua_pushstring(L, n);
+ lua_pushnumber(L, c);
+ lua_rawset(L, -3);
+}
-void
-font_char_to_lua (lua_State *L, internalfontnumber f, charinfo *co) {
- int i;
- liginfo *l;
- kerninfo *ki;
-
- lua_createtable(L,0,10);
-
- lua_pushstring(L,"width");
- lua_pushnumber(L,get_charinfo_width(co));
- lua_rawset(L,-3);
-
- lua_pushstring(L,"height");
- lua_pushnumber(L,get_charinfo_height(co));
- lua_rawset(L,-3);
-
- lua_pushstring(L,"depth");
- lua_pushnumber(L,get_charinfo_depth(co));
- lua_rawset(L,-3);
-
- lua_pushstring(L,"italic");
- lua_pushnumber(L,get_charinfo_italic(co));
- lua_rawset(L,-3);
-
- if (get_charinfo_ef(co)!=0) {
- lua_pushstring(L,"expansion_factor");
- lua_pushnumber(L,get_charinfo_ef(co));
- lua_rawset(L,-3);
- }
-
- if (get_charinfo_lp(co)!=0) {
- lua_pushstring(L,"left_protruding");
- lua_pushnumber(L,get_charinfo_lp(co));
- lua_rawset(L,-3);
- }
-
- if (get_charinfo_lp(co)!=0) {
- lua_pushstring(L,"right_protruding");
- lua_pushnumber(L,get_charinfo_rp(co));
- lua_rawset(L,-3);
- }
-
-
- if (font_encodingbytes(f) == 2 ) {
- lua_pushstring(L,"index");
- lua_pushnumber(L,get_charinfo_index(co));
- lua_rawset(L,-3);
- }
-
- if (get_charinfo_name(co)!=NULL) {
- lua_pushstring(L,"name");
- lua_pushstring(L,get_charinfo_name(co));
- lua_rawset(L,-3);
- }
-
- if (get_charinfo_tounicode(co)!=NULL) {
- lua_pushstring(L,"tounicode");
- lua_pushstring(L,get_charinfo_tounicode(co));
- lua_rawset(L,-3);
- }
-
- if (get_charinfo_tag(co) == list_tag) {
- lua_pushstring(L,"next");
- lua_pushnumber(L,get_charinfo_remainder(co));
- lua_rawset(L,-3);
- }
-
- lua_pushstring(L,"used");
- lua_pushboolean(L,(get_charinfo_used(co) ? true : false));
- lua_rawset(L,-3);
-
- if (get_charinfo_tag(co) == ext_tag) {
- lua_pushstring(L,"extensible");
- lua_createtable(L,0,4);
- lua_pushnumber(L,get_charinfo_extensible(co,EXT_TOP));
- lua_setfield(L,-2,"top");
- lua_pushnumber(L,get_charinfo_extensible(co,EXT_BOT));
- lua_setfield(L,-2,"bot");
- lua_pushnumber(L,get_charinfo_extensible(co,EXT_MID));
- lua_setfield(L,-2,"mid");
- lua_pushnumber(L,get_charinfo_extensible(co,EXT_REP));
- lua_setfield(L,-2,"rep");
- lua_rawset(L,-3);
- }
- ki = get_charinfo_kerns(co);
- if (ki != NULL) {
- lua_pushstring(L,"kerns");
- lua_createtable(L,10,1);
- for (i=0;!kern_end(ki[i]);i++) {
- if (kern_char(ki[i]) == right_boundarychar) {
- lua_pushstring(L,"right_boundary");
- } else {
- lua_pushnumber(L,kern_char(ki[i]));
- }
- lua_pushnumber(L,kern_kern(ki[i]));
- lua_rawset(L,-3);
- }
- lua_rawset(L,-3);
- }
- l = get_charinfo_ligatures(co);
- if (l!=NULL) {
- lua_pushstring(L,"ligatures");
- lua_createtable(L,10,1);
- for (i=0;!lig_end(l[i]);i++) {
- if (lig_char(l[i]) == right_boundarychar) {
- lua_pushstring(L,"right_boundary");
- } else {
- lua_pushnumber(L,lig_char(l[i]));
- }
- lua_createtable(L,0,2);
- lua_pushstring(L,"type");
- lua_pushnumber(L,lig_type(l[i]));
- lua_rawset(L,-3);
- lua_pushstring(L,"char");
- lua_pushnumber(L,lig_replacement(l[i]));
- lua_rawset(L,-3);
- lua_rawset(L,-3);
- }
- lua_rawset(L,-3);
- }
+
+
+void font_char_to_lua(lua_State * L, internalfontnumber f, charinfo * co)
+{
+ int i;
+ liginfo *l;
+ kerninfo *ki;
+
+ lua_createtable(L, 0, 10);
+
+ lua_pushstring(L, "width");
+ lua_pushnumber(L, get_charinfo_width(co));
+ lua_rawset(L, -3);
+
+ lua_pushstring(L, "height");
+ lua_pushnumber(L, get_charinfo_height(co));
+ lua_rawset(L, -3);
+
+ lua_pushstring(L, "depth");
+ lua_pushnumber(L, get_charinfo_depth(co));
+ lua_rawset(L, -3);
+
+ lua_pushstring(L, "italic");
+ lua_pushnumber(L, get_charinfo_italic(co));
+ lua_rawset(L, -3);
+
+ lua_pushstring(L, "top_accent");
+ lua_pushnumber(L, get_charinfo_top_accent(co));
+ lua_rawset(L, -3);
+
+ lua_pushstring(L, "bot_accent");
+ lua_pushnumber(L, get_charinfo_bot_accent(co));
+ lua_rawset(L, -3);
+
+
+ if (get_charinfo_ef(co) != 0) {
+ lua_pushstring(L, "expansion_factor");
+ lua_pushnumber(L, get_charinfo_ef(co));
+ lua_rawset(L, -3);
+ }
+
+ if (get_charinfo_lp(co) != 0) {
+ lua_pushstring(L, "left_protruding");
+ lua_pushnumber(L, get_charinfo_lp(co));
+ lua_rawset(L, -3);
+ }
+
+ if (get_charinfo_lp(co) != 0) {
+ lua_pushstring(L, "right_protruding");
+ lua_pushnumber(L, get_charinfo_rp(co));
+ lua_rawset(L, -3);
+ }
+
+
+ if (font_encodingbytes(f) == 2) {
+ lua_pushstring(L, "index");
+ lua_pushnumber(L, get_charinfo_index(co));
+ lua_rawset(L, -3);
+ }
+
+ if (get_charinfo_name(co) != NULL) {
+ lua_pushstring(L, "name");
+ lua_pushstring(L, get_charinfo_name(co));
+ lua_rawset(L, -3);
+ }
+
+ if (get_charinfo_tounicode(co) != NULL) {
+ lua_pushstring(L, "tounicode");
+ lua_pushstring(L, get_charinfo_tounicode(co));
+ lua_rawset(L, -3);
+ }
+
+ if (get_charinfo_tag(co) == list_tag) {
+ lua_pushstring(L, "next");
+ lua_pushnumber(L, get_charinfo_remainder(co));
+ lua_rawset(L, -3);
+ }
+
+ lua_pushstring(L, "used");
+ lua_pushboolean(L, (get_charinfo_used(co) ? true : false));
+ lua_rawset(L, -3);
+
+ if (get_charinfo_tag(co) == ext_tag) {
+ extinfo *h;
+ h = get_charinfo_hor_variants(co);
+ if (h != NULL) {
+ int i = 1;
+ lua_newtable(L);
+ while (h != NULL) {
+ lua_createtable(L, 0, 5);
+ dump_intfield(L, "glyph", h->glyph);
+ dump_intfield(L, "extender", h->extender);
+ dump_intfield(L, "start", h->start_overlap);
+ dump_intfield(L, "end", h->end_overlap);
+ dump_intfield(L, "advance", h->advance);
+ lua_rawseti(L, -2, i);
+ i++;
+ h = h->next;
+ }
+ lua_setfield(L, -2, "horiz_variants");
+ }
+ h = get_charinfo_vert_variants(co);
+ if (h != NULL) {
+ int i = 1;
+ lua_newtable(L);
+ while (h != NULL) {
+ lua_createtable(L, 0, 5);
+ dump_intfield(L, "glyph", h->glyph);
+ dump_intfield(L, "extender", h->extender);
+ dump_intfield(L, "start", h->start_overlap);
+ dump_intfield(L, "end", h->end_overlap);
+ dump_intfield(L, "advance", h->advance);
+ lua_rawseti(L, -2, i);
+ i++;
+ h = h->next;
+ }
+ lua_setfield(L, -2, "vert_variants");
+ }
+ }
+ ki = get_charinfo_kerns(co);
+ if (ki != NULL) {
+ lua_pushstring(L, "kerns");
+ lua_createtable(L, 10, 1);
+ for (i = 0; !kern_end(ki[i]); i++) {
+ if (kern_char(ki[i]) == right_boundarychar) {
+ lua_pushstring(L, "right_boundary");
+ } else {
+ lua_pushnumber(L, kern_char(ki[i]));
+ }
+ lua_pushnumber(L, kern_kern(ki[i]));
+ lua_rawset(L, -3);
+ }
+ lua_rawset(L, -3);
+ }
+ l = get_charinfo_ligatures(co);
+ if (l != NULL) {
+ lua_pushstring(L, "ligatures");
+ lua_createtable(L, 10, 1);
+ for (i = 0; !lig_end(l[i]); i++) {
+ if (lig_char(l[i]) == right_boundarychar) {
+ lua_pushstring(L, "right_boundary");
+ } else {
+ lua_pushnumber(L, lig_char(l[i]));
+ }
+ lua_createtable(L, 0, 2);
+ lua_pushstring(L, "type");
+ lua_pushnumber(L, lig_type(l[i]));
+ lua_rawset(L, -3);
+ lua_pushstring(L, "char");
+ lua_pushnumber(L, lig_replacement(l[i]));
+ lua_rawset(L, -3);
+ lua_rawset(L, -3);
+ }
+ lua_rawset(L, -3);
+ }
}
-static void
-write_lua_parameters (lua_State *L, int f) {
- int k;
- lua_newtable(L);
- for (k=1;k<=font_params(f);k++) {
- lua_pushnumber(L,font_param(f,k));
- switch (k) {
- case slant_code: lua_setfield(L,-2,"slant"); break;
- case space_code: lua_setfield(L,-2,"space"); break;
- case space_stretch_code: lua_setfield(L,-2,"space_stretch"); break;
- case space_shrink_code: lua_setfield(L,-2,"space_shrink"); break;
- case x_height_code: lua_setfield(L,-2,"x_height"); break;
- case quad_code: lua_setfield(L,-2,"quad"); break;
- case extra_space_code: lua_setfield(L,-2,"extra_space"); break;
- default:
- lua_rawseti(L,-2,k);
- }
- }
- lua_setfield(L,-2,"parameters");
+static void write_lua_parameters(lua_State * L, int f)
+{
+ int k;
+ lua_newtable(L);
+ for (k = 1; k <= font_params(f); k++) {
+ lua_pushnumber(L, font_param(f, k));
+ switch (k) {
+ case slant_code:
+ lua_setfield(L, -2, "slant");
+ break;
+ case space_code:
+ lua_setfield(L, -2, "space");
+ break;
+ case space_stretch_code:
+ lua_setfield(L, -2, "space_stretch");
+ break;
+ case space_shrink_code:
+ lua_setfield(L, -2, "space_shrink");
+ break;
+ case x_height_code:
+ lua_setfield(L, -2, "x_height");
+ break;
+ case quad_code:
+ lua_setfield(L, -2, "quad");
+ break;
+ case extra_space_code:
+ lua_setfield(L, -2, "extra_space");
+ break;
+ default:
+ lua_rawseti(L, -2, k);
+ }
+ }
+ lua_setfield(L, -2, "parameters");
}
-int
-font_to_lua (lua_State *L, int f) {
- int k;
- charinfo *co;
- if (font_cache_id(f)) {
- /* fetch the table from the registry if it was
- saved there by font_from_lua() */
- lua_rawgeti(L,LUA_REGISTRYINDEX,font_cache_id(f));
- /* fontdimens can be changed from tex code */
- write_lua_parameters(L,f);
+static void write_lua_math_parameters(lua_State * L, int f)
+{
+ int k;
+ lua_newtable(L);
+ for (k = 1; k < font_math_params(f); k++) {
+ lua_pushnumber(L, font_math_param(f, k));
+ if (k <= MATH_param_max) {
+ lua_setfield(L, -2, MATH_param_names[k]);
+ } else {
+ lua_rawseti(L, -2, k);
+ }
+ }
+ lua_setfield(L, -2, "MathConstants");
+}
+
+
+
+int font_to_lua(lua_State * L, int f)
+{
+ int k;
+ charinfo *co;
+ if (font_cache_id(f)) {
+ /* fetch the table from the registry if it was
+ saved there by font_from_lua() */
+ lua_rawgeti(L, LUA_REGISTRYINDEX, font_cache_id(f));
+ /* fontdimens can be changed from tex code */
+ write_lua_parameters(L, f);
+ return 1;
+ }
+
+ lua_newtable(L);
+ lua_pushstring(L, font_name(f));
+ lua_setfield(L, -2, "name");
+ if (font_area(f) != NULL) {
+ lua_pushstring(L, font_area(f));
+ lua_setfield(L, -2, "area");
+ }
+ if (font_filename(f) != NULL) {
+ lua_pushstring(L, font_filename(f));
+ lua_setfield(L, -2, "filename");
+ }
+ if (font_fullname(f) != NULL) {
+ lua_pushstring(L, font_fullname(f));
+ lua_setfield(L, -2, "fullname");
+ }
+ if (font_encodingname(f) != NULL) {
+ lua_pushstring(L, font_encodingname(f));
+ lua_setfield(L, -2, "encodingname");
+ }
+
+ lua_pushboolean(L, (font_used(f) ? true : false));
+ lua_setfield(L, -2, "used");
+
+
+ lua_pushstring(L, font_type_strings[font_type(f)]);
+ lua_setfield(L, -2, "type");
+ lua_pushstring(L, font_format_strings[font_format(f)]);
+ lua_setfield(L, -2, "format");
+ lua_pushstring(L, font_embedding_strings[font_embedding(f)]);
+ lua_setfield(L, -2, "embedding");
+
+ lua_pushnumber(L, font_size(f));
+ lua_setfield(L, -2, "size");
+ lua_pushnumber(L, font_dsize(f));
+ lua_setfield(L, -2, "designsize");
+ lua_pushnumber(L, font_checksum(f));
+ lua_setfield(L, -2, "checksum");
+ lua_pushnumber(L, font_slant(f));
+ lua_setfield(L, -2, "slant");
+ lua_pushnumber(L, font_extend(f));
+ lua_setfield(L, -2, "extend");
+ lua_pushnumber(L, font_natural_dir(f));
+ lua_setfield(L, -2, "direction");
+ lua_pushnumber(L, font_encodingbytes(f));
+ lua_setfield(L, -2, "encodingbytes");
+ lua_pushnumber(L, font_tounicode(f));
+ lua_setfield(L, -2, "tounicode");
+
+ /* pdf parameters */
+ /* skip the first four for now, that are very much interal */
+ /*
+ if (pdf_font_size(f) != 0) {
+ lua_pushnumber(L,pdf_font_size(f));
+ lua_setfield(L,-2,"pdf_size");
+ }
+ if (pdf_font_num(f) != 0) {
+ lua_pushnumber(L,pdf_font_num(f));
+ lua_setfield(L,-2,"pdf_num");
+ }
+ if (pdf_font_blink(f) != 0) {
+ lua_pushnumber(L,pdf_font_blink(f));
+ lua_setfield(L,-2,"pdf_blink");
+ }
+ if (pdf_font_elink(f) != 0) {
+ lua_pushnumber(L,pdf_font_elink(f));
+ lua_setfield(L,-2,"pdf_elink");
+ }
+ */
+ /* the next one is read only */
+ if (pdf_font_expand_ratio(f) != 0) {
+ lua_pushnumber(L, pdf_font_expand_ratio(f));
+ lua_setfield(L, -2, "expand_ratio");
+ }
+ if (pdf_font_shrink(f) != 0) {
+ lua_pushnumber(L, pdf_font_shrink(f));
+ lua_setfield(L, -2, "shrink");
+ }
+ if (pdf_font_stretch(f) != 0) {
+ lua_pushnumber(L, pdf_font_stretch(f));
+ lua_setfield(L, -2, "stretch");
+ }
+ if (pdf_font_step(f) != 0) {
+ lua_pushnumber(L, pdf_font_step(f));
+ lua_setfield(L, -2, "step");
+ }
+ if (pdf_font_auto_expand(f) != 0) {
+ lua_pushboolean(L, pdf_font_auto_expand(f));
+ lua_setfield(L, -2, "auto_expand");
+ }
+ if (pdf_font_attr(f) != 0) {
+ lua_pushstring(L, makecstring(pdf_font_attr(f)));
+ lua_setfield(L, -2, "attributes");
+ }
+
+ /* params */
+ write_lua_parameters(L, f);
+ write_lua_math_parameters(L, f);
+
+ /* chars */
+ lua_createtable(L, font_tables[f]->charinfo_size, 0); /* all characters */
+
+ if (has_left_boundary(f)) {
+ co = get_charinfo(f, left_boundarychar);
+ font_char_to_lua(L, f, co);
+ lua_setfield(L, -2, "left_boundary");
+ }
+ if (has_right_boundary(f)) {
+ co = get_charinfo(f, right_boundarychar);
+ font_char_to_lua(L, f, co);
+ lua_setfield(L, -2, "right_boundary");
+ }
+
+ for (k = font_bc(f); k <= font_ec(f); k++) {
+ if (char_exists(f, k)) {
+ lua_pushnumber(L, k);
+ co = get_charinfo(f, k);
+ font_char_to_lua(L, f, co);
+ lua_rawset(L, -3);
+ }
+ }
+ lua_setfield(L, -2, "characters");
return 1;
- }
-
- lua_newtable(L);
- lua_pushstring(L,font_name(f));
- lua_setfield(L,-2,"name");
- if(font_area(f)!=NULL) {
- lua_pushstring(L,font_area(f));
- lua_setfield(L,-2,"area");
- }
- if(font_filename(f)!=NULL) {
- lua_pushstring(L,font_filename(f));
- lua_setfield(L,-2,"filename");
- }
- if(font_fullname(f)!=NULL) {
- lua_pushstring(L,font_fullname(f));
- lua_setfield(L,-2,"fullname");
- }
- if(font_encodingname(f)!=NULL) {
- lua_pushstring(L,font_encodingname(f));
- lua_setfield(L,-2,"encodingname");
- }
-
- lua_pushboolean(L,(font_used(f) ? true : false));
- lua_setfield(L,-2,"used");
-
-
- lua_pushstring(L,font_type_strings[font_type(f)]);
- lua_setfield(L,-2,"type");
- lua_pushstring(L,font_format_strings[font_format(f)]);
- lua_setfield(L,-2,"format");
- lua_pushstring(L,font_embedding_strings[font_embedding(f)]);
- lua_setfield(L,-2,"embedding");
-
- lua_pushnumber(L,font_size(f));
- lua_setfield(L,-2,"size");
- lua_pushnumber(L,font_dsize(f));
- lua_setfield(L,-2,"designsize");
- lua_pushnumber(L,font_checksum(f));
- lua_setfield(L,-2,"checksum");
- lua_pushnumber(L,font_slant(f));
- lua_setfield(L,-2,"slant");
- lua_pushnumber(L,font_extend(f));
- lua_setfield(L,-2,"extend");
- lua_pushnumber(L,font_natural_dir(f));
- lua_setfield(L,-2,"direction");
- lua_pushnumber(L,font_encodingbytes(f));
- lua_setfield(L,-2,"encodingbytes");
- lua_pushnumber(L,font_tounicode(f));
- lua_setfield(L,-2,"tounicode");
-
- /* pdf parameters */
- /* skip the first four for now, that are very much interal */
- /*
- if (pdf_font_size(f) != 0) {
- lua_pushnumber(L,pdf_font_size(f));
- lua_setfield(L,-2,"pdf_size");
- }
- if (pdf_font_num(f) != 0) {
- lua_pushnumber(L,pdf_font_num(f));
- lua_setfield(L,-2,"pdf_num");
- }
- if (pdf_font_blink(f) != 0) {
- lua_pushnumber(L,pdf_font_blink(f));
- lua_setfield(L,-2,"pdf_blink");
- }
- if (pdf_font_elink(f) != 0) {
- lua_pushnumber(L,pdf_font_elink(f));
- lua_setfield(L,-2,"pdf_elink");
- }
- */
- /* the next one is read only */
- if (pdf_font_expand_ratio(f) != 0) {
- lua_pushnumber(L,pdf_font_expand_ratio(f));
- lua_setfield(L,-2,"expand_ratio");
- }
- if (pdf_font_shrink(f) != 0) {
- lua_pushnumber(L,pdf_font_shrink(f));
- lua_setfield(L,-2,"shrink");
- }
- if (pdf_font_stretch(f) != 0) {
- lua_pushnumber(L,pdf_font_stretch(f));
- lua_setfield(L,-2,"stretch");
- }
- if (pdf_font_step(f) != 0) {
- lua_pushnumber(L,pdf_font_step(f));
- lua_setfield(L,-2,"step");
- }
- if (pdf_font_auto_expand(f) != 0) {
- lua_pushboolean(L,pdf_font_auto_expand(f));
- lua_setfield(L,-2,"auto_expand");
- }
- if (pdf_font_attr(f) != 0) {
- lua_pushstring(L,makecstring(pdf_font_attr(f)));
- lua_setfield(L,-2,"attributes");
- }
-
- /* params */
- write_lua_parameters(L,f);
-
- /* chars */
- lua_createtable(L,font_tables[f]->charinfo_size,0); /* all characters */
-
- if (has_left_boundary(f)) {
- co = get_charinfo(f,left_boundarychar);
- font_char_to_lua(L,f,co);
- lua_setfield(L,-2,"left_boundary");
- }
- if (has_right_boundary(f)) {
- co = get_charinfo(f,right_boundarychar);
- font_char_to_lua(L,f,co);
- lua_setfield(L,-2,"right_boundary");
- }
-
- for (k=font_bc(f);k<=font_ec(f);k++) {
- if (char_exists(f,k)) {
- lua_pushnumber(L,k);
- co = get_charinfo(f,k);
- font_char_to_lua(L,f,co);
- lua_rawset(L,-3);
- }
- }
- lua_setfield(L,-2,"characters");
- return 1;
}
-static int
-count_hash_items (lua_State *L, int name_index){
- int n = -1;
- lua_rawgeti(L,LUA_REGISTRYINDEX,name_index);
- lua_rawget(L,-2);
- if (!lua_isnil(L,-1)) {
- if (lua_istable(L,-1)) {
- n = 0;
- /* now find the number */
- lua_pushnil(L); /* first key */
- while (lua_next(L, -2) != 0) {
- n++;
- lua_pop(L,1);
- }
- }
- }
- lua_pop(L,1);
- return n;
+static int count_hash_items(lua_State * L, int name_index)
+{
+ int n = -1;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, name_index);
+ lua_rawget(L, -2);
+ if (!lua_isnil(L, -1)) {
+ if (lua_istable(L, -1)) {
+ n = 0;
+ /* now find the number */
+ lua_pushnil(L); /* first key */
+ while (lua_next(L, -2) != 0) {
+ n++;
+ lua_pop(L, 1);
+ }
+ }
+ }
+ lua_pop(L, 1);
+ return n;
}
#define streq(a,b) (strcmp(a,b)==0)
@@ -321,130 +482,130 @@ count_hash_items (lua_State *L, int name_index){
append_packet((l&0xFF000000)>>24); \
append_packet((l&0x00FF0000)>>16); \
append_packet((l&0x0000FF00)>>8); \
- append_packet((l&0x000000FF)); }
+ append_packet((l&0x000000FF)); }
/*
*/
#define lua_roundnumber(a,b) (int)floor((double)lua_tonumber(L,-1)+0.5)
-static int
-numeric_field (lua_State *L, char *name, int dflt) {
- int i = dflt;
- lua_pushstring(L,name);
- lua_rawget(L,-2);
- if (lua_isnumber(L,-1)) {
- i = lua_roundnumber(L,-1);
- }
- lua_pop(L,1);
- return i;
+static int numeric_field(lua_State * L, char *name, int dflt)
+{
+ int i = dflt;
+ lua_pushstring(L, name);
+ lua_rawget(L, -2);
+ if (lua_isnumber(L, -1)) {
+ i = lua_roundnumber(L, -1);
+ }
+ lua_pop(L, 1);
+ return i;
}
-static int
-n_numeric_field (lua_State *L, int name_index, int dflt) {
- register int i = dflt;
- lua_rawgeti(L,LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */
- lua_rawget(L,-2);
- if (lua_type(L,-1)==LUA_TNUMBER) {
- i = lua_roundnumber(L,-1);
- }
- lua_pop(L,1);
- return i;
+static int n_numeric_field(lua_State * L, int name_index, int dflt)
+{
+ register int i = dflt;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */
+ lua_rawget(L, -2);
+ if (lua_type(L, -1) == LUA_TNUMBER) {
+ i = lua_roundnumber(L, -1);
+ }
+ lua_pop(L, 1);
+ return i;
}
-static int
-enum_field (lua_State *L, char *name, int dflt, char **values) {
- int k;
- char *s;
- int i = dflt;
- lua_pushstring(L,name);
- lua_rawget(L,-2);
- if (lua_isnumber(L,-1)) {
- i = lua_tonumber(L,-1);
- } else if (lua_isstring(L,-1)) {
- s = (char *)lua_tostring(L,-1);
- k = 0;
- while (values[k] != NULL) {
- if (strcmp(values[k],s) == 0) {
- i = k;
- break;
- }
- k++;
- }
- }
- lua_pop(L,1);
- return i;
+static int enum_field(lua_State * L, char *name, int dflt, char **values)
+{
+ int k;
+ char *s;
+ int i = dflt;
+ lua_pushstring(L, name);
+ lua_rawget(L, -2);
+ if (lua_isnumber(L, -1)) {
+ i = lua_tonumber(L, -1);
+ } else if (lua_isstring(L, -1)) {
+ s = (char *) lua_tostring(L, -1);
+ k = 0;
+ while (values[k] != NULL) {
+ if (strcmp(values[k], s) == 0) {
+ i = k;
+ break;
+ }
+ k++;
+ }
+ }
+ lua_pop(L, 1);
+ return i;
}
-static int
-boolean_field (lua_State *L, char *name, int dflt) {
- int i = dflt;
- lua_pushstring(L,name);
- lua_rawget(L,-2);
- if (lua_isboolean(L,-1)) {
- i = lua_toboolean(L,-1);
- }
- lua_pop(L,1);
- return i;
+static int boolean_field(lua_State * L, char *name, int dflt)
+{
+ int i = dflt;
+ lua_pushstring(L, name);
+ lua_rawget(L, -2);
+ if (lua_isboolean(L, -1)) {
+ i = lua_toboolean(L, -1);
+ }
+ lua_pop(L, 1);
+ return i;
}
-static int
-n_boolean_field (lua_State *L, int name_index, int dflt) {
- int i = dflt;
- lua_rawgeti(L,LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */
- lua_rawget(L,-2);
- if (lua_isboolean(L,-1)) {
- i = lua_toboolean(L,-1);
- }
- lua_pop(L,1);
- return i;
+static int n_boolean_field(lua_State * L, int name_index, int dflt)
+{
+ int i = dflt;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */
+ lua_rawget(L, -2);
+ if (lua_isboolean(L, -1)) {
+ i = lua_toboolean(L, -1);
+ }
+ lua_pop(L, 1);
+ return i;
}
-static char *
-string_field (lua_State *L, char *name, char *dflt) {
- char *i;
- lua_pushstring(L,name);
- lua_rawget(L,-2);
- if (lua_isstring(L,-1)) {
- i = xstrdup(lua_tostring(L,-1));
- } else if (dflt==NULL) {
- i = NULL;
- } else {
- i = xstrdup(dflt);
- }
- lua_pop(L,1);
- return i;
+static char *string_field(lua_State * L, char *name, char *dflt)
+{
+ char *i;
+ lua_pushstring(L, name);
+ lua_rawget(L, -2);
+ if (lua_isstring(L, -1)) {
+ i = xstrdup(lua_tostring(L, -1));
+ } else if (dflt == NULL) {
+ i = NULL;
+ } else {
+ i = xstrdup(dflt);
+ }
+ lua_pop(L, 1);
+ return i;
}
-static char *
-n_string_field (lua_State *L, int name_index, char *dflt) {
- char *i;
- lua_rawgeti(L,LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */
- lua_rawget(L,-2);
- if (lua_isstring(L,-1)) {
- i = xstrdup(lua_tostring(L,-1));
- } else if (dflt==NULL) {
- i = NULL;
- } else {
- i = xstrdup(dflt);
- }
- lua_pop(L,1);
- return i;
+static char *n_string_field(lua_State * L, int name_index, char *dflt)
+{
+ char *i;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */
+ lua_rawget(L, -2);
+ if (lua_isstring(L, -1)) {
+ i = xstrdup(lua_tostring(L, -1));
+ } else if (dflt == NULL) {
+ i = NULL;
+ } else {
+ i = xstrdup(dflt);
+ }
+ lua_pop(L, 1);
+ return i;
}
-#define init_luaS_index(a) do { \
- lua_pushliteral(L,#a); \
- luaS_##a##_ptr = (char *)lua_tostring(L,-1); \
- luaS_##a##_index = luaL_ref (L,LUA_REGISTRYINDEX); \
+#define init_luaS_index(a) do { \
+ lua_pushliteral(L,#a); \
+ luaS_##a##_ptr = (char *)lua_tostring(L,-1); \
+ luaS_##a##_index = luaL_ref (L,LUA_REGISTRYINDEX); \
} while (0)
-#define make_luaS_index(a) \
- static int luaS_##a##_index = 0; \
+#define make_luaS_index(a) \
+ static int luaS_##a##_index = 0; \
static char * luaS_##a##_ptr = NULL
-#define luaS_index(a) luaS_##a##_index
+#define luaS_index(a) luaS_##a##_index
#define luaS_ptr_eq(a,b) (a==luaS_##b##_ptr)
@@ -452,13 +613,15 @@ make_luaS_index(width);
make_luaS_index(height);
make_luaS_index(depth);
make_luaS_index(italic);
+make_luaS_index(top_accent);
+make_luaS_index(bot_accent);
make_luaS_index(index);
make_luaS_index(left_protruding);
make_luaS_index(right_protruding);
make_luaS_index(expansion_factor);
-make_luaS_index(top);
-make_luaS_index(bot);
-make_luaS_index(rep);
+make_luaS_index(top);
+make_luaS_index(bot);
+make_luaS_index(rep);
make_luaS_index(mid);
make_luaS_index(next);
make_luaS_index(used);
@@ -475,6 +638,7 @@ make_luaS_index(right);
make_luaS_index(node);
make_luaS_index(down);
make_luaS_index(special);
+make_luaS_index(image);
make_luaS_index(slant);
make_luaS_index(space);
make_luaS_index(space_stretch);
@@ -487,455 +651,634 @@ make_luaS_index(right_boundary);
make_luaS_index(kerns);
make_luaS_index(ligatures);
make_luaS_index(fonts);
-
-void init_font_string_pointers (lua_State *L) {
- init_luaS_index(width);
- init_luaS_index(height);
- init_luaS_index(depth);
- init_luaS_index(italic);
- init_luaS_index(index);
- init_luaS_index(left_protruding);
- init_luaS_index(right_protruding);
- init_luaS_index(expansion_factor);
- init_luaS_index(top);
- init_luaS_index(bot);
- init_luaS_index(rep);
- init_luaS_index(mid);
- init_luaS_index(next);
- init_luaS_index(used);
- init_luaS_index(name);
- init_luaS_index(tounicode);
- init_luaS_index(font);
- init_luaS_index(char);
- init_luaS_index(slot);
- init_luaS_index(comment);
- init_luaS_index(push);
- init_luaS_index(pop);
- init_luaS_index(rule);
- init_luaS_index(right);
- init_luaS_index(node);
- init_luaS_index(down);
- init_luaS_index(special);
-
- init_luaS_index(slant);
- init_luaS_index(space);
- init_luaS_index(space_stretch);
- init_luaS_index(space_shrink);
- init_luaS_index(x_height);
- init_luaS_index(quad);
- init_luaS_index(extra_space);
-
- init_luaS_index(left_boundary);
- init_luaS_index(right_boundary);
- init_luaS_index(kerns);
- init_luaS_index(ligatures);
- init_luaS_index(fonts);
+make_luaS_index(extender);
+make_luaS_index(start);
+make_luaS_index(end);
+make_luaS_index(advance);
+make_luaS_index(glyph);
+
+void init_font_string_pointers(lua_State * L)
+{
+ init_luaS_index(width);
+ init_luaS_index(height);
+ init_luaS_index(depth);
+ init_luaS_index(italic);
+ init_luaS_index(top_accent);
+ init_luaS_index(bot_accent);
+ init_luaS_index(index);
+ init_luaS_index(left_protruding);
+ init_luaS_index(right_protruding);
+ init_luaS_index(expansion_factor);
+ init_luaS_index(top);
+ init_luaS_index(bot);
+ init_luaS_index(rep);
+ init_luaS_index(mid);
+ init_luaS_index(next);
+ init_luaS_index(used);
+ init_luaS_index(name);
+ init_luaS_index(tounicode);
+ init_luaS_index(font);
+ init_luaS_index(char);
+ init_luaS_index(slot);
+ init_luaS_index(comment);
+ init_luaS_index(push);
+ init_luaS_index(pop);
+ init_luaS_index(rule);
+ init_luaS_index(right);
+ init_luaS_index(node);
+ init_luaS_index(down);
+ init_luaS_index(special);
+ init_luaS_index(image);
+
+ init_luaS_index(slant);
+ init_luaS_index(space);
+ init_luaS_index(space_stretch);
+ init_luaS_index(space_shrink);
+ init_luaS_index(x_height);
+ init_luaS_index(quad);
+ init_luaS_index(extra_space);
+
+ init_luaS_index(left_boundary);
+ init_luaS_index(right_boundary);
+ init_luaS_index(kerns);
+ init_luaS_index(ligatures);
+ init_luaS_index(fonts);
+
+ init_luaS_index(extender);
+ init_luaS_index(start);
+ init_luaS_index(end);
+ init_luaS_index(advance);
+ init_luaS_index(glyph);
}
-static int
-count_char_packet_bytes (lua_State *L) {
- register int i;
- register int l = 0;
- int ff = 0;
- for (i=1;i<=lua_objlen(L,-1);i++) {
- lua_rawgeti(L,-1,i);
- if (lua_istable(L,-1)) {
- lua_rawgeti(L,-1,1);
- if (lua_isstring(L,-1)) {
- char *s = (char *)lua_tostring(L,-1);
- if (luaS_ptr_eq(s,font)) { l+= 5; ff =1; }
- else if (luaS_ptr_eq(s,char)) { if (ff==0) { l+=5; } l += 5; ff = 1; }
- else if (luaS_ptr_eq(s,slot)) { l += 10; ff = 1;}
- else if (luaS_ptr_eq(s,comment)) { ; }
- else if (luaS_ptr_eq(s,push) ||
- luaS_ptr_eq(s,pop)) { l++; }
- else if (luaS_ptr_eq(s,rule)) { l+=9; }
- else if (luaS_ptr_eq(s,right) ||
- luaS_ptr_eq(s,node) ||
- luaS_ptr_eq(s,down)) { l+=5; }
- else if (luaS_ptr_eq(s,special)) {
- size_t len;
- lua_rawgeti(L,-2,2);
- (void)lua_tolstring(L,-1,&len);
- lua_pop(L,1);
- if (len>0) { l = l + 5 + len; }
+static int count_char_packet_bytes(lua_State * L)
+{
+ register int i;
+ register int l = 0;
+ int ff = 0;
+ for (i = 1; i <= (int) lua_objlen(L, -1); i++) {
+ lua_rawgeti(L, -1, i);
+ if (lua_istable(L, -1)) {
+ lua_rawgeti(L, -1, 1);
+ if (lua_isstring(L, -1)) {
+ char *s = (char *) lua_tostring(L, -1);
+ if (luaS_ptr_eq(s, font)) {
+ l += 5;
+ ff = 1;
+ } else if (luaS_ptr_eq(s, char)) {
+ if (ff == 0) {
+ l += 5;
+ }
+ l += 5;
+ ff = 1;
+ } else if (luaS_ptr_eq(s, slot)) {
+ l += 10;
+ ff = 1;
+ } else if (luaS_ptr_eq(s, comment)) {;
+ } else if (luaS_ptr_eq(s, push) || luaS_ptr_eq(s, pop)) {
+ l++;
+ } else if (luaS_ptr_eq(s, rule)) {
+ l += 9;
+ } else if (luaS_ptr_eq(s, right) ||
+ luaS_ptr_eq(s, node) || luaS_ptr_eq(s, down)) {
+ l += 5;
+ } else if (luaS_ptr_eq(s, special)) {
+ size_t len;
+ lua_rawgeti(L, -2, 2);
+ (void) lua_tolstring(L, -1, &len);
+ lua_pop(L, 1);
+ if (len > 0) {
+ l = l + 5 + len;
+ }
+ } else if (luaS_ptr_eq(s, image)) {
+ l += 5;
+ } else {
+ fprintf(stdout, "unknown packet command %s!\n", s);
+ }
+ } else {
+ fprintf(stdout, "no packet command!\n");
+ }
+ lua_pop(L, 1); /* command name */
}
- else { fprintf(stdout,"unknown packet command %s!\n",s); }
- } else {
- fprintf(stdout,"no packet command!\n");
- }
- lua_pop(L,1); /* command name */
- }
- lua_pop(L,1); /* item */
- }
- return l;
+ lua_pop(L, 1); /* item */
+ }
+ return l;
}
-scaled
-sp_to_dvi (halfword sp, halfword atsize) {
- double result, mult;
- mult = (double)(atsize>>16);
- result = (sp << 4);
- return floor (result/mult );
+scaled sp_to_dvi(halfword sp, halfword atsize)
+{
+ double result, mult;
+ mult = (double) (atsize / 65536.0);
+ result = (double) (sp * 16.0);
+ return floor(result / mult);
}
static void
-read_char_packets (lua_State *L, integer *l_fonts, charinfo *co, int atsize) {
- int i, n, m;
- size_t l;
- int cmd;
- char *s;
- real_eight_bits *cpackets;
- int ff = 0;
- int np = 0;
- int max_f = 0;
- int pc = count_char_packet_bytes (L);
- if (pc<=0)
- return;
- assert(l_fonts != NULL);
- assert(l_fonts[1] != 0);
- while (l_fonts[(max_f+1)]!=0)
- max_f++;
-
- cpackets = xmalloc(pc+1);
- for (i=1;i<=lua_objlen(L,-1);i++) {
- lua_rawgeti(L,-1,i);
- if (lua_istable(L,-1)) {
- /* fetch the command code */
- lua_rawgeti(L,-1,1);
- if (lua_isstring(L,-1)) {
- s = (char *)lua_tostring(L,-1);
- cmd = 0;
- if (luaS_ptr_eq(s,font)) {
- cmd = packet_font_code;
- } else if (luaS_ptr_eq(s,char)) {
- cmd = packet_char_code;
- if (ff==0) {
- append_packet(packet_font_code);
- ff = l_fonts[1];
- do_store_four(ff);
- }
- } else if (luaS_ptr_eq(s,slot)) {
- cmd = packet_nop_code;
- lua_rawgeti(L,-2,2); n = lua_tointeger(L,-1);
- ff = (n>max_f ? l_fonts[1] : l_fonts[n]);
- lua_rawgeti(L,-3,3); n = lua_tointeger(L,-1);
- lua_pop(L,2);
- append_packet(packet_font_code);
- do_store_four(ff);
- append_packet(packet_char_code);
- do_store_four(n);
- }
- else if (luaS_ptr_eq(s,comment)) { cmd = packet_nop_code; }
- else if (luaS_ptr_eq(s,node)) { cmd = packet_node_code; }
- else if (luaS_ptr_eq(s,push)) { cmd = packet_push_code; }
- else if (luaS_ptr_eq(s,pop)) { cmd = packet_pop_code; }
- else if (luaS_ptr_eq(s,rule)) { cmd = packet_rule_code; }
- else if (luaS_ptr_eq(s,right)) { cmd = packet_right_code; }
- else if (luaS_ptr_eq(s,down)) { cmd = packet_down_code; }
- else if (luaS_ptr_eq(s,special)) { cmd = packet_special_code; }
-
- switch(cmd) {
- case packet_push_code:
- case packet_pop_code:
- append_packet(cmd);
- break;
- case packet_font_code:
- append_packet(cmd);
- lua_rawgeti(L,-2,2);
- n = lua_tointeger(L,-1);
- ff = (n>max_f ? l_fonts[1] : l_fonts[n]);
- do_store_four(ff);
- lua_pop(L,1);
- break;
- case packet_node_code:
- append_packet(cmd);
- lua_rawgeti(L,-2,2);
- n = copy_node_list(nodelist_from_lua(L));
- do_store_four(n);
- lua_pop(L,1);
- break;
- case packet_char_code:
- append_packet(cmd);
- lua_rawgeti(L,-2,2);
- n = lua_tointeger(L,-1);
- do_store_four(n);
- lua_pop(L,1);
- break;
- case packet_right_code:
- case packet_down_code:
- append_packet(cmd);
- lua_rawgeti(L,-2,2);
- n = lua_tointeger(L,-1);
- do_store_four(sp_to_dvi(n,atsize));
- lua_pop(L,1);
- break;
- case packet_rule_code:
- append_packet(cmd);
- lua_rawgeti(L,-2,2);
- n = lua_tointeger(L,-1);
- do_store_four(sp_to_dvi(n,atsize));
- lua_rawgeti(L,-3,3);
- n = lua_tointeger(L,-1);
- do_store_four(sp_to_dvi(n,atsize));
- lua_pop(L,2);
- break;
- case packet_special_code:
- append_packet(cmd);
- lua_rawgeti(L,-2,2);
- s = (char *)lua_tolstring(L,-1,&l);
- if (l>0) {
- do_store_four(l);
- m = (int)l;
- while(m>0) {
- n = *s++;
- m--;
- append_packet(n);
+read_char_packets(lua_State * L, integer * l_fonts, charinfo * co, int atsize)
+{
+ int i, n, m;
+ size_t l;
+ int cmd;
+ char *s;
+ real_eight_bits *cpackets;
+ int ff = 0;
+ int np = 0;
+ int max_f = 0;
+ int pc = count_char_packet_bytes(L);
+ if (pc <= 0)
+ return;
+ assert(l_fonts != NULL);
+ assert(l_fonts[1] != 0);
+ while (l_fonts[(max_f + 1)] != 0)
+ max_f++;
+
+ cpackets = xmalloc(pc + 1);
+ for (i = 1; i <= (int) lua_objlen(L, -1); i++) {
+ lua_rawgeti(L, -1, i);
+ if (lua_istable(L, -1)) {
+ /* fetch the command code */
+ lua_rawgeti(L, -1, 1);
+ if (lua_isstring(L, -1)) {
+ s = (char *) lua_tostring(L, -1);
+ cmd = 0;
+ if (luaS_ptr_eq(s, font)) {
+ cmd = packet_font_code;
+ } else if (luaS_ptr_eq(s, char)) {
+ cmd = packet_char_code;
+ if (ff == 0) {
+ append_packet(packet_font_code);
+ ff = l_fonts[1];
+ do_store_four(ff);
+ }
+ } else if (luaS_ptr_eq(s, slot)) {
+ cmd = packet_nop_code;
+ lua_rawgeti(L, -2, 2);
+ n = lua_tointeger(L, -1);
+ ff = (n > max_f ? l_fonts[1] : l_fonts[n]);
+ lua_rawgeti(L, -3, 3);
+ n = lua_tointeger(L, -1);
+ lua_pop(L, 2);
+ append_packet(packet_font_code);
+ do_store_four(ff);
+ append_packet(packet_char_code);
+ do_store_four(n);
+ } else if (luaS_ptr_eq(s, comment)) {
+ cmd = packet_nop_code;
+ } else if (luaS_ptr_eq(s, node)) {
+ cmd = packet_node_code;
+ } else if (luaS_ptr_eq(s, push)) {
+ cmd = packet_push_code;
+ } else if (luaS_ptr_eq(s, pop)) {
+ cmd = packet_pop_code;
+ } else if (luaS_ptr_eq(s, rule)) {
+ cmd = packet_rule_code;
+ } else if (luaS_ptr_eq(s, right)) {
+ cmd = packet_right_code;
+ } else if (luaS_ptr_eq(s, down)) {
+ cmd = packet_down_code;
+ } else if (luaS_ptr_eq(s, special)) {
+ cmd = packet_special_code;
+ } else if (luaS_ptr_eq(s, image)) {
+ cmd = packet_image_code;
+ }
+
+ switch (cmd) {
+ case packet_push_code:
+ case packet_pop_code:
+ append_packet(cmd);
+ break;
+ case packet_font_code:
+ append_packet(cmd);
+ lua_rawgeti(L, -2, 2);
+ n = lua_tointeger(L, -1);
+ ff = (n > max_f ? l_fonts[1] : l_fonts[n]);
+ do_store_four(ff);
+ lua_pop(L, 1);
+ break;
+ case packet_node_code:
+ append_packet(cmd);
+ lua_rawgeti(L, -2, 2);
+ n = copy_node_list(nodelist_from_lua(L));
+ do_store_four(n);
+ lua_pop(L, 1);
+ break;
+ case packet_char_code:
+ append_packet(cmd);
+ lua_rawgeti(L, -2, 2);
+ n = lua_tointeger(L, -1);
+ do_store_four(n);
+ lua_pop(L, 1);
+ break;
+ case packet_right_code:
+ case packet_down_code:
+ append_packet(cmd);
+ lua_rawgeti(L, -2, 2);
+ n = lua_tointeger(L, -1);
+ do_store_four(sp_to_dvi(n, atsize));
+ lua_pop(L, 1);
+ break;
+ case packet_rule_code:
+ append_packet(cmd);
+ lua_rawgeti(L, -2, 2);
+ n = lua_tointeger(L, -1);
+ do_store_four(sp_to_dvi(n, atsize));
+ lua_rawgeti(L, -3, 3);
+ n = lua_tointeger(L, -1);
+ do_store_four(sp_to_dvi(n, atsize));
+ lua_pop(L, 2);
+ break;
+ case packet_special_code:
+ append_packet(cmd);
+ lua_rawgeti(L, -2, 2);
+ s = (char *) lua_tolstring(L, -1, &l);
+ if (l > 0) {
+ do_store_four(l);
+ m = (int) l;
+ while (m > 0) {
+ n = *s++;
+ m--;
+ append_packet(n);
+ }
+ }
+ lua_pop(L, 1);
+ break;
+ case packet_image_code:
+ append_packet(cmd);
+ lua_rawgeti(L, -2, 2); /* img/imgtable? ... */
+ if (lua_istable(L, -1)) { /* imgtable ... */
+ lua_getglobal(L, "img"); /* imglib imgtable ... */
+ lua_pushstring(L, "new"); /* `new' imglib imgtable ... */
+ lua_gettable(L, -2); /* f imglib imgtable ... */
+ lua_insert(L, -3); /* imglib imgtable f ... */
+ lua_pop(L, 1); /* imgtable f ... */
+ lua_call(L, 1, 1);
+ } /* img ... */
+ luaL_checkudata(L, -1, TYPE_IMG); /* img ... --- just typecheck */
+ n = luaL_ref(L, LUA_GLOBALSINDEX); /* ... */
+ do_store_four(n);
+ break;
+ case packet_nop_code:
+ break;
+ default:
+ fprintf(stdout,
+ "Unknown char packet code %s (char %d in font %s)\n",
+ s, (int) c, font_name(f));
+ }
}
- }
- lua_pop(L,1);
- break;
- case packet_nop_code:
- break;
- default:
- fprintf(stdout,"Unknown char packet code %s (char %d in font %s)\n",s,(int)c,font_name(f));
+ lua_pop(L, 1); /* command code */
+ } else {
+ fprintf(stdout,
+ "Found a `commands' item that is not a table (char %d in font %s)\n",
+ (int) c, font_name(f));
}
- }
- lua_pop(L,1); /* command code */
- } else {
- fprintf(stdout,"Found a `commands' item that is not a table (char %d in font %s)\n",(int)c,font_name(f));
+ lua_pop(L, 1); /* command table */
}
- lua_pop(L,1); /* command table */
- }
- append_packet(packet_end_code);
- set_charinfo_packets(co,cpackets);
- return;
+ append_packet(packet_end_code);
+ set_charinfo_packets(co, cpackets);
+ return;
}
-static void
-read_lua_cidinfo (lua_State *L, int f) {
- int i;
- char *s;
- lua_getfield(L,-1,"cidinfo");
- if (lua_istable(L,-1)) {
- i = numeric_field(L,"version",0);
- set_font_cidversion(f,i);
- i = numeric_field(L,"supplement",0);
- set_font_cidsupplement(f,i);
- s = string_field(L,"registry","Adobe"); /* Adobe-Identity-0 */
- set_font_cidregistry(f,s);
- s = string_field(L,"ordering","Identity");
- set_font_cidordering(f,s);
- }
- lua_pop(L,1);
+static void read_lua_cidinfo(lua_State * L, int f)
+{
+ int i;
+ char *s;
+ lua_getfield(L, -1, "cidinfo");
+ if (lua_istable(L, -1)) {
+ i = numeric_field(L, "version", 0);
+ set_font_cidversion(f, i);
+ i = numeric_field(L, "supplement", 0);
+ set_font_cidsupplement(f, i);
+ s = string_field(L, "registry", "Adobe"); /* Adobe-Identity-0 */
+ set_font_cidregistry(f, s);
+ s = string_field(L, "ordering", "Identity");
+ set_font_cidordering(f, s);
+ }
+ lua_pop(L, 1);
}
-static void
-read_lua_parameters (lua_State *L, int f) {
- int i, n;
- char *s;
- lua_getfield(L,-1,"parameters");
- if (lua_istable(L,-1)) {
- /* the number of parameters is the max(IntegerKeys(L)),7) */
- n = 7;
- lua_pushnil(L); /* first key */
- while (lua_next(L, -2) != 0) {
- if (lua_isnumber(L,-2)) {
- i = lua_tonumber(L,-2);
- if (i > n) n = i;
- }
- lua_pop(L,1); /* pop value */
- }
- if (n>7) set_font_params(f,n);
- /* sometimes it is handy to have all integer keys */
- for (i=1;i<=7;i++) {
- lua_rawgeti(L,-1,i);
- if (lua_isnumber(L,-1)) {
- n = lua_roundnumber(L,-1);
- set_font_param(f,i, n);
- }
- lua_pop(L,1);
- }
- lua_pushnil(L); /* first key */
- while (lua_next(L, -2) != 0) {
- if (lua_isnumber(L,-2)) {
- i = lua_tointeger(L,-2);
- if (i>=8) {
- n = (lua_isnumber(L,-1) ? lua_roundnumber(L,-1) : 0);
- set_font_param(f,i, n);
+static void read_lua_parameters(lua_State * L, int f)
+{
+ int i, n;
+ char *s;
+ lua_getfield(L, -1, "parameters");
+ if (lua_istable(L, -1)) {
+ /* the number of parameters is the max(IntegerKeys(L)),7) */
+ n = 7;
+ lua_pushnil(L); /* first key */
+ while (lua_next(L, -2) != 0) {
+ if (lua_isnumber(L, -2)) {
+ i = lua_tonumber(L, -2);
+ if (i > n)
+ n = i;
+ }
+ lua_pop(L, 1); /* pop value */
}
- } else if (lua_isstring(L,-2)) {
- s = (char *)lua_tostring(L,-2);
- n = (lua_isnumber(L,-1) ? lua_roundnumber(L,-1) : 0);
- if (luaS_ptr_eq(s,slant)) { set_font_param(f,slant_code,n); }
- else if (luaS_ptr_eq(s,space)) { set_font_param(f,space_code,n); }
- else if (luaS_ptr_eq(s,space_stretch)) { set_font_param(f,space_stretch_code,n); }
- else if (luaS_ptr_eq(s,space_shrink)) { set_font_param(f,space_shrink_code,n); }
- else if (luaS_ptr_eq(s,x_height)) { set_font_param(f,x_height_code,n); }
- else if (luaS_ptr_eq(s,quad)) { set_font_param(f,quad_code,n); }
- else if (luaS_ptr_eq(s,extra_space)) { set_font_param(f,extra_space_code,n); }
- }
- lua_pop(L,1);
- }
- }
- lua_pop(L,1);
+ if (n > 7)
+ set_font_params(f, n);
+ /* sometimes it is handy to have all integer keys */
+ for (i = 1; i <= 7; i++) {
+ lua_rawgeti(L, -1, i);
+ if (lua_isnumber(L, -1)) {
+ n = lua_roundnumber(L, -1);
+ set_font_param(f, i, n);
+ }
+ lua_pop(L, 1);
+ }
+ lua_pushnil(L); /* first key */
+ while (lua_next(L, -2) != 0) {
+ if (lua_isnumber(L, -2)) {
+ i = lua_tointeger(L, -2);
+ if (i >= 8) {
+ n = (lua_isnumber(L, -1) ? lua_roundnumber(L, -1) : 0);
+ set_font_param(f, i, n);
+ }
+ } else if (lua_isstring(L, -2)) {
+ s = (char *) lua_tostring(L, -2);
+ n = (lua_isnumber(L, -1) ? lua_roundnumber(L, -1) : 0);
+ if (luaS_ptr_eq(s, slant)) {
+ set_font_param(f, slant_code, n);
+ } else if (luaS_ptr_eq(s, space)) {
+ set_font_param(f, space_code, n);
+ } else if (luaS_ptr_eq(s, space_stretch)) {
+ set_font_param(f, space_stretch_code, n);
+ } else if (luaS_ptr_eq(s, space_shrink)) {
+ set_font_param(f, space_shrink_code, n);
+ } else if (luaS_ptr_eq(s, x_height)) {
+ set_font_param(f, x_height_code, n);
+ } else if (luaS_ptr_eq(s, quad)) {
+ set_font_param(f, quad_code, n);
+ } else if (luaS_ptr_eq(s, extra_space)) {
+ set_font_param(f, extra_space_code, n);
+ }
+ }
+ lua_pop(L, 1);
+ }
+ }
+ lua_pop(L, 1);
}
-
-void
-font_char_from_lua (lua_State *L, internal_font_number f, integer i, integer *l_fonts) {
- int k,r,t;
- charinfo *co;
- kerninfo *ckerns;
- liginfo *cligs;
- scaled j;
- char *s;
- int nl = 0; /* number of ligature table items */
- int nk = 0; /* number of kern table items */
- int ctr = 0;
- int atsize = font_size(f);
- if (lua_istable(L,-1)) {
- co = get_charinfo(f,i);
- set_charinfo_tag (co,0);
- j = n_numeric_field(L,luaS_width_index,0); set_charinfo_width (co,j);
- j = n_numeric_field(L,luaS_height_index,0); set_charinfo_height (co,j);
- j = n_numeric_field(L,luaS_depth_index,0); set_charinfo_depth (co,j);
- j = n_numeric_field(L,luaS_italic_index,0); set_charinfo_italic (co,j);
- j = n_numeric_field(L,luaS_index_index,0); set_charinfo_index(co,j);
- j = n_numeric_field(L,luaS_expansion_factor_index,0); set_charinfo_ef(co,j);
- j = n_numeric_field(L,luaS_left_protruding_index,0); set_charinfo_lp(co,j);
- j = n_numeric_field(L,luaS_right_protruding_index,0); set_charinfo_rp(co,j);
- k = n_boolean_field(L,luaS_used_index,0); set_charinfo_used(co,k);
- s = n_string_field (L,luaS_name_index,NULL); set_charinfo_name(co,s);
- s = n_string_field (L,luaS_tounicode_index,NULL); set_charinfo_tounicode(co,s);
- k = n_numeric_field(L,luaS_next_index,-1);
- if (k>=0) {
- set_charinfo_tag (co,list_tag);
- set_charinfo_remainder (co,k);
- }
- lua_getfield(L,-1,"extensible");
- if (lua_istable(L,-1)){
- int top, bot,mid, rep;
- top = n_numeric_field(L,luaS_top_index,0);
- bot = n_numeric_field(L,luaS_bot_index,0);
- mid = n_numeric_field(L,luaS_mid_index,0);
- rep = n_numeric_field(L,luaS_rep_index,0);
- if (top != 0 || bot != 0 || mid != 0 || rep != 0) {
- set_charinfo_tag (co,ext_tag);
- set_charinfo_extensible (co,top,bot,mid,rep);
- } else {
- pdftex_warn("lua-loaded font %s char [%d] has an invalid extensible field!",font_name(f),(int)i);
- }
- }
- lua_pop(L,1);
-
- nk = count_hash_items(L,luaS_index(kerns));
- if (nk>0) {
- ckerns = xcalloc((nk+1),sizeof(kerninfo));
- lua_rawgeti(L,LUA_REGISTRYINDEX,luaS_index(kerns));
- lua_rawget(L,-2);
- if (lua_istable(L,-1)) { /* there are kerns */
- ctr = 0;
+
+static void read_lua_math_parameters(lua_State * L, int f)
+{
+ int i = 0, n = 0;
+ lua_getfield(L, -1, "MathConstants");
+ if (lua_istable(L, -1)) {
lua_pushnil(L);
while (lua_next(L, -2) != 0) {
- k = non_boundarychar;
- if (lua_isnumber(L,-2)) {
- k = lua_tonumber(L,-2); /* adjacent char */
- if (k<0)
- k = non_boundarychar;
- } else if (lua_isstring(L,-2)) {
- s = (char *)lua_tostring(L,-2);
- if (luaS_ptr_eq(s,right_boundary)) {
- k = right_boundarychar;
- if (!has_right_boundary(f))
- set_right_boundary(f,get_charinfo(f,right_boundarychar));
+ if (lua_isnumber(L, -2)) {
+ i = lua_tonumber(L, -2);
+ } else if (lua_isstring(L, -2)) {
+ i = luaL_checkoption(L, -2, NULL, MATH_param_names);
+ }
+ n = lua_tonumber(L, -1);
+ if (i != 0) {
+ set_font_math_param(f, i, n);
}
- }
- j = lua_roundnumber(L,-1); /* movement */
- if (k!=non_boundarychar) {
- set_kern_item(ckerns[ctr],k,j);
- ctr++;
- } else {
- pdftex_warn("lua-loaded font %s char [%d] has an invalid kern field!",font_name(f),(int)i);
- }
- lua_pop(L,1);
+ lua_pop(L, 1); /* pop value */
}
- /* guard against empty tables */
- if (ctr>0) {
- set_kern_item(ckerns[ctr],end_kern,0);
- set_charinfo_kerns(co,ckerns);
- } else {
- pdftex_warn("lua-loaded font %s char [%d] has an invalid kerns field!",font_name(f),(int)i);
+ }
+ lua_pop(L, 1);
+}
+
+
+void
+font_char_from_lua(lua_State * L, internal_font_number f, integer i,
+ integer * l_fonts)
+{
+ int k, r, t;
+ charinfo *co;
+ kerninfo *ckerns;
+ liginfo *cligs;
+ scaled j;
+ char *s;
+ int nl = 0; /* number of ligature table items */
+ int nk = 0; /* number of kern table items */
+ int ctr = 0;
+ int atsize = font_size(f);
+ if (lua_istable(L, -1)) {
+ co = get_charinfo(f, i);
+ set_charinfo_tag(co, 0);
+ j = n_numeric_field(L, luaS_width_index, 0);
+ set_charinfo_width(co, j);
+ j = n_numeric_field(L, luaS_height_index, 0);
+ set_charinfo_height(co, j);
+ j = n_numeric_field(L, luaS_depth_index, 0);
+ set_charinfo_depth(co, j);
+ j = n_numeric_field(L, luaS_italic_index, 0);
+ set_charinfo_italic(co, j);
+ j = n_numeric_field(L, luaS_top_accent_index, 0);
+ set_charinfo_top_accent(co, j);
+ j = n_numeric_field(L, luaS_bot_accent_index, 0);
+ set_charinfo_bot_accent(co, j);
+ j = n_numeric_field(L, luaS_index_index, 0);
+ set_charinfo_index(co, j);
+ j = n_numeric_field(L, luaS_expansion_factor_index, 0);
+ set_charinfo_ef(co, j);
+ j = n_numeric_field(L, luaS_left_protruding_index, 0);
+ set_charinfo_lp(co, j);
+ j = n_numeric_field(L, luaS_right_protruding_index, 0);
+ set_charinfo_rp(co, j);
+ k = n_boolean_field(L, luaS_used_index, 0);
+ set_charinfo_used(co, k);
+ s = n_string_field(L, luaS_name_index, NULL);
+ set_charinfo_name(co, s);
+ s = n_string_field(L, luaS_tounicode_index, NULL);
+ set_charinfo_tounicode(co, s);
+ k = n_numeric_field(L, luaS_next_index, -1);
+ if (k >= 0) {
+ set_charinfo_tag(co, list_tag);
+ set_charinfo_remainder(co, k);
}
- }
- lua_pop(L,1);
- }
-
- /* packet commands */
- lua_getfield(L,-1,"commands");
- if (lua_istable(L,-1)){
- lua_pushnil(L); /* first key */
- if (lua_next(L, -2) != 0) {
- lua_pop(L,2);
- read_char_packets(L,(integer *)l_fonts,co,atsize);
- }
- }
- lua_pop(L,1);
-
- /* ligatures */
- nl = count_hash_items(L,luaS_index(ligatures));
-
- if (nl>0) {
- cligs = xcalloc((nl+1),sizeof(liginfo));
- lua_rawgeti(L,LUA_REGISTRYINDEX,luaS_index(ligatures));
- lua_rawget(L,-2);
- if (lua_istable(L,-1)){/* do ligs */
- ctr = 0;
- lua_pushnil(L);
- while (lua_next(L, -2) != 0) {
- k = non_boundarychar;
- if (lua_isnumber(L,-2)) {
- k = lua_tonumber(L,-2); /* adjacent char */
- if (k<0) {
- k = non_boundarychar;
+ lua_getfield(L, -1, "extensible");
+ if (lua_istable(L, -1)) {
+ int top, bot, mid, rep;
+ top = n_numeric_field(L, luaS_top_index, 0);
+ bot = n_numeric_field(L, luaS_bot_index, 0);
+ mid = n_numeric_field(L, luaS_mid_index, 0);
+ rep = n_numeric_field(L, luaS_rep_index, 0);
+ if (top != 0 || bot != 0 || mid != 0 || rep != 0) {
+ set_charinfo_tag(co, ext_tag);
+ set_charinfo_extensible(co, top, bot, mid, rep);
+ } else {
+ pdftex_warn
+ ("lua-loaded font %s char [U+%X] has an invalid extensible field!",
+ font_name(f), (int) i);
}
- } else if (lua_isstring(L,-2)) {
- s = (char *)lua_tostring(L,-2);
- if (luaS_ptr_eq(s,right_boundary)) {
- k = right_boundarychar;
- if (!has_right_boundary(f))
- set_right_boundary(f,get_charinfo(f,right_boundarychar));
+ }
+ lua_pop(L, 1);
+
+ lua_getfield(L, -1, "horiz_variants");
+ if (lua_istable(L, -1)) {
+ int glyph, startconnect, endconnect, advance, extender;
+ extinfo *h;
+ set_charinfo_tag(co, ext_tag);
+ set_charinfo_hor_variants(co, NULL);
+ for (k = 1;; k++) {
+ lua_rawgeti(L, -1, k);
+ if (lua_istable(L, -1)) {
+ glyph = n_numeric_field(L, luaS_glyph_index, 0);
+ extender = n_numeric_field(L, luaS_extender_index, 0);
+ startconnect = n_numeric_field(L, luaS_start_index, 0);
+ endconnect = n_numeric_field(L, luaS_end_index, 0);
+ advance = n_numeric_field(L, luaS_advance_index, 0);
+ h = new_variant(glyph, startconnect, endconnect, advance,
+ extender);
+ add_charinfo_hor_variant(co, h);
+ lua_pop(L, 1);
+ } else {
+ lua_pop(L, 1);
+ break;
+ }
}
- }
- r = -1;
- if (lua_istable(L,-1)) {
- r = n_numeric_field(L,luaS_char_index,-1); /* ligature */
- }
- if (r != -1 && k != non_boundarychar) {
- t = enum_field(L,"type",0,ligature_type_strings);
- set_ligature_item(cligs[ctr],(t*2)+1,k,r);
- ctr++;
- } else {
- pdftex_warn("lua-loaded font %s char [%d] has an invalid ligature field!",font_name(f),(int)i);
- }
- lua_pop(L,1); /* iterator value */
- }
- /* guard against empty tables */
- if (ctr>0) {
- set_ligature_item(cligs[ctr],0,end_ligature,0);
- set_charinfo_ligatures(co,cligs);
- } else {
- pdftex_warn("lua-loaded font %s char [%d] has an invalid ligatures field!",font_name(f),(int)i);
}
- }
- lua_pop(L,1); /* ligatures table */
+ lua_pop(L, 1);
+
+
+ lua_getfield(L, -1, "vert_variants");
+ if (lua_istable(L, -1)) {
+ int glyph, startconnect, endconnect, advance, extender;
+ extinfo *h;
+ set_charinfo_tag(co, ext_tag);
+ set_charinfo_vert_variants(co, NULL);
+ for (k = 1;; k++) {
+ lua_rawgeti(L, -1, k);
+ if (lua_istable(L, -1)) {
+ glyph = n_numeric_field(L, luaS_glyph_index, 0);
+ extender = n_numeric_field(L, luaS_extender_index, 0);
+ startconnect = n_numeric_field(L, luaS_start_index, 0);
+ endconnect = n_numeric_field(L, luaS_end_index, 0);
+ advance = n_numeric_field(L, luaS_advance_index, 0);
+ h = new_variant(glyph, startconnect, endconnect, advance,
+ extender);
+ add_charinfo_vert_variant(co, h);
+ lua_pop(L, 1);
+ } else {
+ lua_pop(L, 1);
+ break;
+ }
+ }
+ }
+ lua_pop(L, 1);
+
+ nk = count_hash_items(L, luaS_index(kerns));
+ if (nk > 0) {
+ ckerns = xcalloc((nk + 1), sizeof(kerninfo));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(kerns));
+ lua_rawget(L, -2);
+ if (lua_istable(L, -1)) { /* there are kerns */
+ ctr = 0;
+ lua_pushnil(L);
+ while (lua_next(L, -2) != 0) {
+ k = non_boundarychar;
+ if (lua_isnumber(L, -2)) {
+ k = lua_tonumber(L, -2); /* adjacent char */
+ if (k < 0)
+ k = non_boundarychar;
+ } else if (lua_isstring(L, -2)) {
+ s = (char *) lua_tostring(L, -2);
+ if (luaS_ptr_eq(s, right_boundary)) {
+ k = right_boundarychar;
+ if (!has_right_boundary(f))
+ set_right_boundary(f,
+ get_charinfo(f,
+ right_boundarychar));
+ }
+ }
+ j = lua_roundnumber(L, -1); /* movement */
+ if (k != non_boundarychar) {
+ set_kern_item(ckerns[ctr], k, j);
+ ctr++;
+ } else {
+ pdftex_warn
+ ("lua-loaded font %s char [U+%X] has an invalid kern field!",
+ font_name(f), (int) i);
+ }
+ lua_pop(L, 1);
+ }
+ /* guard against empty tables */
+ if (ctr > 0) {
+ set_kern_item(ckerns[ctr], end_kern, 0);
+ set_charinfo_kerns(co, ckerns);
+ } else {
+ pdftex_warn
+ ("lua-loaded font %s char [U+%X] has an invalid kerns field!",
+ font_name(f), (int) i);
+ }
+ }
+ lua_pop(L, 1);
+ }
+
+ /* packet commands */
+ lua_getfield(L, -1, "commands");
+ if (lua_istable(L, -1)) {
+ lua_pushnil(L); /* first key */
+ if (lua_next(L, -2) != 0) {
+ lua_pop(L, 2);
+ read_char_packets(L, (integer *) l_fonts, co, atsize);
+ }
+ }
+ lua_pop(L, 1);
+
+ /* ligatures */
+ nl = count_hash_items(L, luaS_index(ligatures));
+
+ if (nl > 0) {
+ cligs = xcalloc((nl + 1), sizeof(liginfo));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(ligatures));
+ lua_rawget(L, -2);
+ if (lua_istable(L, -1)) { /* do ligs */
+ ctr = 0;
+ lua_pushnil(L);
+ while (lua_next(L, -2) != 0) {
+ k = non_boundarychar;
+ if (lua_isnumber(L, -2)) {
+ k = lua_tonumber(L, -2); /* adjacent char */
+ if (k < 0) {
+ k = non_boundarychar;
+ }
+ } else if (lua_isstring(L, -2)) {
+ s = (char *) lua_tostring(L, -2);
+ if (luaS_ptr_eq(s, right_boundary)) {
+ k = right_boundarychar;
+ if (!has_right_boundary(f))
+ set_right_boundary(f,
+ get_charinfo(f,
+ right_boundarychar));
+ }
+ }
+ r = -1;
+ if (lua_istable(L, -1)) {
+ r = n_numeric_field(L, luaS_char_index, -1); /* ligature */
+ }
+ if (r != -1 && k != non_boundarychar) {
+ t = enum_field(L, "type", 0, ligature_type_strings);
+ set_ligature_item(cligs[ctr], (t * 2) + 1, k, r);
+ ctr++;
+ } else {
+ pdftex_warn
+ ("lua-loaded font %s char [U+%X] has an invalid ligature field!",
+ font_name(f), (int) i);
+ }
+ lua_pop(L, 1); /* iterator value */
+ }
+ /* guard against empty tables */
+ if (ctr > 0) {
+ set_ligature_item(cligs[ctr], 0, end_ligature, 0);
+ set_charinfo_ligatures(co, cligs);
+ } else {
+ pdftex_warn
+ ("lua-loaded font %s char [U+%X] has an invalid ligatures field!",
+ font_name(f), (int) i);
+ }
+ }
+ lua_pop(L, 1); /* ligatures table */
+ }
}
- }
}
@@ -943,203 +1286,247 @@ font_char_from_lua (lua_State *L, internal_font_number f, integer i, integer *l_
/* The caller has to fix the state of the lua stack when there is an error! */
-int
-font_from_lua (lua_State *L, int f) {
- int i,n,r,t;
- int s_top; /* lua stack top */
- int bc; /* first char index */
- int ec; /* last char index */
- char *s;
- integer *l_fonts = NULL;
- /* the table is at stack index -1 */
-
- if (luaS_width_index==0)
- init_font_string_pointers(L);
-
- s = string_field(L,"area",""); set_font_area(f,s);
- s = string_field(L,"filename",NULL); set_font_filename(f,s);
- s = string_field(L,"encodingname",NULL); set_font_encodingname(f,s);
-
- s = string_field(L,"name",NULL); set_font_name(f,s);
- s = string_field(L,"fullname",font_name(f)); set_font_fullname(f,s);
-
- if (s==NULL) {
- pdftex_fail("lua-loaded font [%d] has no name!",f);
- return false;
- }
-
- i = numeric_field(L,"designsize",655360); set_font_dsize(f,i);
- i = numeric_field(L,"size",font_dsize(f)); set_font_size(f,i);
- i = numeric_field(L,"checksum",0); set_font_checksum(f,i);
- i = numeric_field(L,"direction",0); set_font_natural_dir(f,i);
- i = numeric_field(L,"encodingbytes",0); set_font_encodingbytes(f,i);
- i = numeric_field(L,"tounicode",0); set_font_tounicode(f,i);
-
- i = numeric_field(L,"extend",0);
- if (i<-2000) i = -2000; if (i>2000) i = 2000; if (i==1000) i = 0;
- set_font_extend(f,i);
- i = numeric_field(L,"slant",0);
- if (i<-1000) i = -1000; if (i>1000) i = 1000;
- set_font_slant(f,i);
-
- i = numeric_field(L,"hyphenchar",get_default_hyphen_char()); set_hyphen_char(f,i);
- i = numeric_field(L,"skewchar",get_default_skew_char()); set_skew_char(f,i);
- i = boolean_field(L,"used",0); set_font_used(f,i);
-
- s = string_field (L,"attributes",NULL);
- if (s!=NULL && strlen(s)>0) {
- i = maketexstring(s);
- set_pdf_font_attr(f,i);
- }
-
- i = enum_field(L,"type", unknown_font_type,font_type_strings); set_font_type(f,i);
- i = enum_field(L,"format", unknown_format, font_format_strings); set_font_format(f,i);
- i = enum_field(L,"embedding",unknown_embedding,font_embedding_strings); set_font_embedding(f,i);
- if (font_encodingbytes(f)==0 &&
- (font_format(f)==opentype_format || font_format(f)==truetype_format)) {
- set_font_encodingbytes(f,2);
- }
-
- /* now fetch the base fonts, if needed */
- n = count_hash_items(L,luaS_index(fonts));
- if (n>0) {
- l_fonts = xmalloc((n+2)*sizeof(integer));
- memset (l_fonts,0,(n+2)*sizeof(integer));
- lua_rawgeti(L,LUA_REGISTRYINDEX,luaS_index(fonts));
- lua_rawget(L,-2);
- for (i=1;i<=n;i++) {
- lua_rawgeti(L,-1,i);
- if (lua_istable(L,-1)) {
- lua_getfield(L,-1,"id");
- if (lua_isnumber(L,-1)) {
- l_fonts[i] = lua_tonumber(L,-1);
- lua_pop(L,2); /* pop id and entry */
- continue;
- }
- lua_pop(L,1); /* pop id */
- };
- s = NULL;
- if (lua_istable(L,-1)) {
- lua_getfield(L,-1,"name");
- if (lua_isstring(L,-1)) {
- s = (char *)lua_tostring(L,-1);
- }
- lua_pop(L,1); /* pop name */
- }
- if (s!= NULL) {
- lua_getfield(L,-1,"size");
- t = (lua_isnumber(L,-1) ? lua_roundnumber(L,-1) : -1000);
- lua_pop(L,1);
-
- /* TODO: the stack is messed up, otherwise this
- * explicit resizing would not be needed
- */
- s_top = lua_gettop(L);
- l_fonts[i] = find_font_id(s,"",t);
- lua_settop(L,s_top);
- } else {
- pdftex_fail("Invalid local font in font %s!\n", font_name(f));
- }
- lua_pop(L,1); /* pop list entry */
- }
- lua_pop(L,1); /* pop list entry */
- } else {
- if(font_type(f) == virtual_font_type) {
- pdftex_fail("Invalid local fonts in font %s!\n", font_name(f));
- } else {
- l_fonts = xmalloc(3*sizeof(integer));
- l_fonts[0] = 0;
- l_fonts[1] = f;
- l_fonts[2] = 0;
- }
- }
-
- /* parameters */
- read_lua_parameters(L,f);
- read_lua_cidinfo(L,f);
-
- /* characters */
- lua_getfield(L,-1,"characters");
- if (lua_istable(L,-1)) {
- /* find the array size values */
- ec = 0; bc = -1;
- lua_pushnil(L); /* first key */
- while (lua_next(L, -2) != 0) {
- if (lua_isnumber(L,-2)) {
- i = lua_tointeger(L,-2);
- if (i>=0) {
- if (lua_istable(L,-1)) {
- if (i>ec) ec = i;
- if (bc<0) bc = i;
- if (bc>=0 && i<bc) bc = i;
- }
+int font_from_lua(lua_State * L, int f)
+{
+ int i, n, r, t;
+ int s_top; /* lua stack top */
+ int bc; /* first char index */
+ int ec; /* last char index */
+ char *s;
+ integer *l_fonts = NULL;
+ /* the table is at stack index -1 */
+
+ if (luaS_width_index == 0)
+ init_font_string_pointers(L);
+
+ s = string_field(L, "area", "");
+ set_font_area(f, s);
+ s = string_field(L, "filename", NULL);
+ set_font_filename(f, s);
+ s = string_field(L, "encodingname", NULL);
+ set_font_encodingname(f, s);
+
+ s = string_field(L, "name", NULL);
+ set_font_name(f, s);
+ s = string_field(L, "fullname", font_name(f));
+ set_font_fullname(f, s);
+
+ if (s == NULL) {
+ pdftex_fail("lua-loaded font [%d] has no name!", f);
+ return false;
+ }
+
+ i = numeric_field(L, "designsize", 655360);
+ set_font_dsize(f, i);
+ i = numeric_field(L, "size", font_dsize(f));
+ set_font_size(f, i);
+ i = numeric_field(L, "checksum", 0);
+ set_font_checksum(f, i);
+ i = numeric_field(L, "direction", 0);
+ set_font_natural_dir(f, i);
+ i = numeric_field(L, "encodingbytes", 0);
+ set_font_encodingbytes(f, i);
+ i = numeric_field(L, "tounicode", 0);
+ set_font_tounicode(f, i);
+
+ i = numeric_field(L, "extend", 0);
+ if (i < -2000)
+ i = -2000;
+ if (i > 2000)
+ i = 2000;
+ if (i == 1000)
+ i = 0;
+ set_font_extend(f, i);
+ i = numeric_field(L, "slant", 0);
+ if (i < -1000)
+ i = -1000;
+ if (i > 1000)
+ i = 1000;
+ set_font_slant(f, i);
+
+ i = numeric_field(L, "hyphenchar", get_default_hyphen_char());
+ set_hyphen_char(f, i);
+ i = numeric_field(L, "skewchar", get_default_skew_char());
+ set_skew_char(f, i);
+ i = boolean_field(L, "used", 0);
+ set_font_used(f, i);
+
+ s = string_field(L, "attributes", NULL);
+ if (s != NULL && strlen(s) > 0) {
+ i = maketexstring(s);
+ set_pdf_font_attr(f, i);
+ }
+
+ i = enum_field(L, "type", unknown_font_type, font_type_strings);
+ set_font_type(f, i);
+ i = enum_field(L, "format", unknown_format, font_format_strings);
+ set_font_format(f, i);
+ i = enum_field(L, "embedding", unknown_embedding, font_embedding_strings);
+ set_font_embedding(f, i);
+ if (font_encodingbytes(f) == 0 &&
+ (font_format(f) == opentype_format
+ || font_format(f) == truetype_format)) {
+ set_font_encodingbytes(f, 2);
+ }
+
+ /* now fetch the base fonts, if needed */
+ n = count_hash_items(L, luaS_index(fonts));
+ if (n > 0) {
+ l_fonts = xmalloc((n + 2) * sizeof(integer));
+ memset(l_fonts, 0, (n + 2) * sizeof(integer));
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(fonts));
+ lua_rawget(L, -2);
+ for (i = 1; i <= n; i++) {
+ lua_rawgeti(L, -1, i);
+ if (lua_istable(L, -1)) {
+ lua_getfield(L, -1, "id");
+ if (lua_isnumber(L, -1)) {
+ l_fonts[i] = lua_tonumber(L, -1);
+ lua_pop(L, 2); /* pop id and entry */
+ continue;
+ }
+ lua_pop(L, 1); /* pop id */
+ };
+ s = NULL;
+ if (lua_istable(L, -1)) {
+ lua_getfield(L, -1, "name");
+ if (lua_isstring(L, -1)) {
+ s = (char *) lua_tostring(L, -1);
+ }
+ lua_pop(L, 1); /* pop name */
+ }
+ if (s != NULL) {
+ lua_getfield(L, -1, "size");
+ t = (lua_isnumber(L, -1) ? lua_roundnumber(L, -1) : -1000);
+ lua_pop(L, 1);
+
+ /* TODO: the stack is messed up, otherwise this
+ * explicit resizing would not be needed
+ */
+ s_top = lua_gettop(L);
+ if (strcmp(font_name(f), s) == 0)
+ l_fonts[i] = f;
+ else
+ l_fonts[i] = find_font_id(s, "", t);
+ lua_settop(L, s_top);
+ } else {
+ pdftex_fail("Invalid local font in font %s!\n", font_name(f));
+ }
+ lua_pop(L, 1); /* pop list entry */
}
- }
- lua_pop(L, 1);
- }
-
- if (bc != -1) {
- /* fprintf(stdout,"defined a font at %d with %d-%d\n",f,bc,ec); */
- set_font_bc(f,bc);
- set_font_ec(f,ec);
- lua_pushnil(L); /* first key */
- while (lua_next(L, -2) != 0) {
- if (lua_isnumber(L,-2)) {
- i = lua_tonumber(L,-2);
- if (i>=0) {
- font_char_from_lua(L,f, i, l_fonts);
- }
- } else if (lua_isstring(L,-2)) {
- s = (char *)lua_tostring(L,-2);
- if (luaS_ptr_eq(s,left_boundary)) {
- font_char_from_lua(L,f, left_boundarychar, l_fonts);
- } else if (luaS_ptr_eq(s,right_boundary)) {
- font_char_from_lua(L,f, right_boundarychar, l_fonts);
- }
+ lua_pop(L, 1); /* pop list entry */
+ } else {
+ if (font_type(f) == virtual_font_type) {
+ pdftex_fail("Invalid local fonts in font %s!\n", font_name(f));
+ } else {
+ l_fonts = xmalloc(3 * sizeof(integer));
+ l_fonts[0] = 0;
+ l_fonts[1] = f;
+ l_fonts[2] = 0;
}
- lua_pop(L, 1);
- }
- lua_pop(L, 1);
-
- /* handle font expansion last: the |copy_font| routine is called eventually,
- and that needs to know |bc| and |ec|. */
- if (font_type(f)!=virtual_font_type) {
- int fstep = numeric_field(L,"step",0);
- if (fstep<0) fstep = 0;
- if (fstep>100) fstep = 100;
- if (fstep!=0) {
- int fshrink = numeric_field(L,"shrink",0);
- int fstretch = numeric_field(L,"stretch",0);
- int fexpand = boolean_field(L,"auto_expand",0);
- if (fshrink<0) fshrink = 0;
- if (fshrink>500) fshrink = 500;
- fshrink -= (fshrink % fstep);
- if (fshrink<0) fshrink = 0;
- if (fstretch<0) fstretch = 0;
- if (fstretch>1000) fstretch = 1000;
- fstretch -= (fstretch % fstep);
- if (fstretch<0) fstretch = 0;
- set_expand_params(f, fexpand, fstretch, fshrink, fstep, 0);
- }
- }
-
- } else { /* jikes, no characters */
- pdftex_warn("lua-loaded font [%d] (%s) has no characters!",f, font_name(f));
}
+ /* parameters */
+ read_lua_parameters(L, f);
+ read_lua_math_parameters(L, f);
+ read_lua_cidinfo(L, f);
+
+ /* characters */
+ lua_getfield(L, -1, "characters");
+ if (lua_istable(L, -1)) {
+ /* find the array size values */
+ ec = 0;
+ bc = -1;
+ lua_pushnil(L); /* first key */
+ while (lua_next(L, -2) != 0) {
+ if (lua_isnumber(L, -2)) {
+ i = lua_tointeger(L, -2);
+ if (i >= 0) {
+ if (lua_istable(L, -1)) {
+ if (i > ec)
+ ec = i;
+ if (bc < 0)
+ bc = i;
+ if (bc >= 0 && i < bc)
+ bc = i;
+ }
+ }
+ }
+ lua_pop(L, 1);
+ }
+
+ if (bc != -1) {
+ /* fprintf(stdout,"defined a font at %d with %d-%d\n",f,bc,ec); */
+ set_font_bc(f, bc);
+ set_font_ec(f, ec);
+ lua_pushnil(L); /* first key */
+ while (lua_next(L, -2) != 0) {
+ if (lua_isnumber(L, -2)) {
+ i = lua_tonumber(L, -2);
+ if (i >= 0) {
+ font_char_from_lua(L, f, i, l_fonts);
+ }
+ } else if (lua_isstring(L, -2)) {
+ s = (char *) lua_tostring(L, -2);
+ if (luaS_ptr_eq(s, left_boundary)) {
+ font_char_from_lua(L, f, left_boundarychar, l_fonts);
+ } else if (luaS_ptr_eq(s, right_boundary)) {
+ font_char_from_lua(L, f, right_boundarychar, l_fonts);
+ }
+ }
+ lua_pop(L, 1);
+ }
+ lua_pop(L, 1);
+
+ /* handle font expansion last: the |copy_font| routine is called eventually,
+ and that needs to know |bc| and |ec|. */
+ if (font_type(f) != virtual_font_type) {
+ int fstep = numeric_field(L, "step", 0);
+ if (fstep < 0)
+ fstep = 0;
+ if (fstep > 100)
+ fstep = 100;
+ if (fstep != 0) {
+ int fshrink = numeric_field(L, "shrink", 0);
+ int fstretch = numeric_field(L, "stretch", 0);
+ int fexpand = boolean_field(L, "auto_expand", 0);
+ if (fshrink < 0)
+ fshrink = 0;
+ if (fshrink > 500)
+ fshrink = 500;
+ fshrink -= (fshrink % fstep);
+ if (fshrink < 0)
+ fshrink = 0;
+ if (fstretch < 0)
+ fstretch = 0;
+ if (fstretch > 1000)
+ fstretch = 1000;
+ fstretch -= (fstretch % fstep);
+ if (fstretch < 0)
+ fstretch = 0;
+ set_expand_params(f, fexpand, fstretch, fshrink, fstep, 0);
+ }
+ }
+
+ } else { /* jikes, no characters */
+ pdftex_warn("lua-loaded font [%d] (%s) has no characters!", f,
+ font_name(f));
+ }
+
#if SAVE_REF
- r = luaL_ref(Luas[0],LUA_REGISTRYINDEX); /* pops the table */
- set_font_cache_id(f,r);
+ r = luaL_ref(Luas, LUA_REGISTRYINDEX); /* pops the table */
+ set_font_cache_id(f, r);
#else
- lua_pop(Luas[0],1);
+ lua_pop(Luas, 1);
#endif
- } else { /* jikes, no characters */
- pdftex_warn("lua-loaded font [%d] (%s) has no character table!",f, font_name(f));
- }
+ } else { /* jikes, no characters */
+ pdftex_warn("lua-loaded font [%d] (%s) has no character table!", f,
+ font_name(f));
+ }
- if (l_fonts!=NULL)
- free(l_fonts);
- return true;
+ if (l_fonts != NULL)
+ free(l_fonts);
+ return true;
}
/* ====================================================================
@@ -1151,393 +1538,423 @@ font_from_lua (lua_State *L, int f) {
#define assert_disc(a) \
assert(pre_break(a)!=null); /* expect head_node */ \
- assert(type(pre_break(a))==nesting_node); \
+ assert(type(pre_break(a))==nesting_node); \
assert((vlink_pre_break(a)==null && tlink_pre_break(a)==null) || tail_of_list(vlink_pre_break(a))==tlink_pre_break(a)); \
assert(post_break(a)!=null); /* expect head_node */ \
- assert(type(post_break(a))==nesting_node); \
+ assert(type(post_break(a))==nesting_node); \
assert((vlink_post_break(a)==null && tlink_post_break(a)==null) || tail_of_list(vlink_post_break(a))==tlink_post_break(a)); \
- assert(no_break(a)!=null); /* expect head_node */ \
- assert(type(no_break(a))==nesting_node); \
- assert((vlink_no_break(a)==null && tlink_no_break(a)==null) || tail_of_list(vlink_no_break(a))==tlink_no_break(a));
-
-static void
-nesting_append (halfword nest, halfword newn) {
- halfword tail = tlink(nest);
- assert(alink(nest)==null);
- assert(vlink(newn)==null);
- assert(alink(newn)==null);
- if (tail==null) {
- assert(vlink(nest)==null);
- couple_nodes(nest,newn);
- } else {
- assert(vlink(tail)==null);
- assert(tail_of_list(vlink(nest))==tail);
- couple_nodes(tail,newn);
- }
- tlink(nest) = newn;
+ assert(no_break(a)!=null); /* expect head_node */ \
+ assert(type(no_break(a))==nesting_node); \
+ assert((vlink_no_break(a)==null && tlink_no_break(a)==null) || tail_of_list(vlink_no_break(a))==tlink_no_break(a));
+
+static void nesting_append(halfword nest, halfword newn)
+{
+ halfword tail = tlink(nest);
+ assert(alink(nest) == null);
+ assert(vlink(newn) == null);
+ assert(alink(newn) == null);
+ if (tail == null) {
+ assert(vlink(nest) == null);
+ couple_nodes(nest, newn);
+ } else {
+ assert(vlink(tail) == null);
+ assert(tail_of_list(vlink(nest)) == tail);
+ couple_nodes(tail, newn);
+ }
+ tlink(nest) = newn;
}
-static void
-nesting_prepend (halfword nest, halfword newn) {
- halfword head = vlink(nest);
- assert(alink(nest)==null);
- assert(vlink(newn)==null);
- assert(alink(newn)==null);
- couple_nodes(nest,newn);
- if (head==null) {
- assert(tlink(nest)==null);
- tlink(nest) = newn;
- } else {
- assert(alink(head)==nest);
- assert(tail_of_list(head)==tlink(nest));
- couple_nodes(newn,head);
- }
+static void nesting_prepend(halfword nest, halfword newn)
+{
+ halfword head = vlink(nest);
+ assert(alink(nest) == null);
+ assert(vlink(newn) == null);
+ assert(alink(newn) == null);
+ couple_nodes(nest, newn);
+ if (head == null) {
+ assert(tlink(nest) == null);
+ tlink(nest) = newn;
+ } else {
+ assert(alink(head) == nest);
+ assert(tail_of_list(head) == tlink(nest));
+ couple_nodes(newn, head);
+ }
}
-static int
-test_ligature( liginfo *lig, halfword left, halfword right ) {
- if (type(left)!=glyph_node)
- return 0;
- assert(type(right)==glyph_node);
- if (font(left)!=font(right)) return 0;
- if (is_ghost(left) || is_ghost(right)) return 0;
- *lig = get_ligature(font(left),character(left),character(right));
- if (is_valid_ligature(*lig)) {
- return 1;
- }
- return 0;
+static int test_ligature(liginfo * lig, halfword left, halfword right)
+{
+ if (type(left) != glyph_node)
+ return 0;
+ assert(type(right) == glyph_node);
+ if (font(left) != font(right))
+ return 0;
+ if (is_ghost(left) || is_ghost(right))
+ return 0;
+ *lig = get_ligature(font(left), character(left), character(right));
+ if (is_valid_ligature(*lig)) {
+ return 1;
+ }
+ return 0;
}
-static int
-try_ligature(halfword *frst, halfword fwd) {
- halfword cur = *frst;
- liginfo lig;
- if (test_ligature(&lig,cur,fwd)) {
- int move_after = (lig_type(lig) & 0x0C)>>2;
- int keep_right = ((lig_type(lig) & 0x01) != 0);
- int keep_left = ((lig_type(lig) & 0x02) != 0);
- halfword newgl = raw_glyph_node();
- font(newgl) = font(cur);
- character(newgl) = lig_replacement(lig);
- set_is_ligature(newgl);
-
- /* below might not be correct in contrived border case.
- * but we use it only for debugging, so ... */
- if (character(cur)<0) {
- set_is_leftboundary(newgl);
- }
- if (character(fwd)<0) {
- set_is_rightboundary(newgl);
- }
- if (character(cur)<0) {
- if (character(fwd)<0) {
- build_attribute_list(newgl);
- } else {
- add_node_attr_ref(node_attr(fwd));
- node_attr(newgl) = node_attr(fwd);
- }
- } else {
- add_node_attr_ref(node_attr(cur));
- node_attr(newgl) = node_attr(cur);
- }
-
- /* TODO/FIXME if this ligature is consists of another ligature
- * we should add it's lig_ptr to the new glyphs lig_ptr (and
- * cleanup the no longer needed node) LOW PRIORITY */
- /* left side */
- if (keep_left) {
- halfword new_first = copy_node(cur);
- lig_ptr(newgl) = new_first;
- couple_nodes(cur,newgl);
- if (move_after) {
- move_after--;
- cur = newgl;
- }
- } else {
- halfword prev = alink(cur);
- uncouple_node(cur);
- lig_ptr(newgl) = cur;
- assert(prev!=null);
- couple_nodes(prev,newgl);
- cur = newgl; /* as cur has disappeared */
- }
- /* right side */
- if (keep_right) {
- halfword new_second = copy_node(fwd);
- /* correct, because we _know_ lig_ptr points to _one_ node */
- couple_nodes(lig_ptr(newgl),new_second);
- couple_nodes(newgl,fwd);
- if (move_after) {
- move_after--;
- cur = fwd;
- }
- } else {
- halfword next = vlink(fwd);
- uncouple_node(fwd);
- /* correct, because we _know_ lig_ptr points to _one_ node */
- couple_nodes(lig_ptr(newgl),fwd);
- if (next!=null) {couple_nodes(newgl,next);}
- }
+static int try_ligature(halfword * frst, halfword fwd)
+{
+ halfword cur = *frst;
+ liginfo lig;
+ if (test_ligature(&lig, cur, fwd)) {
+ int move_after = (lig_type(lig) & 0x0C) >> 2;
+ int keep_right = ((lig_type(lig) & 0x01) != 0);
+ int keep_left = ((lig_type(lig) & 0x02) != 0);
+ halfword newgl = raw_glyph_node();
+ font(newgl) = font(cur);
+ character(newgl) = lig_replacement(lig);
+ set_is_ligature(newgl);
+
+ /* below might not be correct in contrived border case.
+ * but we use it only for debugging, so ... */
+ if (character(cur) < 0) {
+ set_is_leftboundary(newgl);
+ }
+ if (character(fwd) < 0) {
+ set_is_rightboundary(newgl);
+ }
+ if (character(cur) < 0) {
+ if (character(fwd) < 0) {
+ build_attribute_list(newgl);
+ } else {
+ add_node_attr_ref(node_attr(fwd));
+ node_attr(newgl) = node_attr(fwd);
+ }
+ } else {
+ add_node_attr_ref(node_attr(cur));
+ node_attr(newgl) = node_attr(cur);
+ }
- /* check and return */
- /* assert(move_after==0);*/
- *frst = cur;
- return 1;
- }
- return 0;
+ /* TODO/FIXME if this ligature is consists of another ligature
+ * we should add it's lig_ptr to the new glyphs lig_ptr (and
+ * cleanup the no longer needed node) LOW PRIORITY */
+ /* left side */
+ if (keep_left) {
+ halfword new_first = copy_node(cur);
+ lig_ptr(newgl) = new_first;
+ couple_nodes(cur, newgl);
+ if (move_after) {
+ move_after--;
+ cur = newgl;
+ }
+ } else {
+ halfword prev = alink(cur);
+ uncouple_node(cur);
+ lig_ptr(newgl) = cur;
+ assert(prev != null);
+ couple_nodes(prev, newgl);
+ cur = newgl; /* as cur has disappeared */
+ }
+ /* right side */
+ if (keep_right) {
+ halfword new_second = copy_node(fwd);
+ /* correct, because we _know_ lig_ptr points to _one_ node */
+ couple_nodes(lig_ptr(newgl), new_second);
+ couple_nodes(newgl, fwd);
+ if (move_after) {
+ move_after--;
+ cur = fwd;
+ }
+ } else {
+ halfword next = vlink(fwd);
+ uncouple_node(fwd);
+ /* correct, because we _know_ lig_ptr points to _one_ node */
+ couple_nodes(lig_ptr(newgl), fwd);
+ if (next != null) {
+ couple_nodes(newgl, next);
+ }
+ }
+
+ /* check and return */
+ /* assert(move_after==0); */
+ *frst = cur;
+ return 1;
+ }
+ return 0;
}
/* there shouldn't be any ligatures here - we only add them at the end of
* xxx_break in a DISC-1 - DISC-2 situation and we stop processing DISC-1
* (we continue with DISC-1's post_ and no_break */
-static halfword
-handle_lig_nest(halfword root, halfword cur) {
- if (cur==null) return root;
- while (vlink(cur)!=null) {
- halfword fwd = vlink(cur);
- if (type(cur)==glyph_node && type(fwd)==glyph_node &&
- font(cur)==font(fwd) && try_ligature(&cur,fwd)) continue;
- cur = vlink(cur);
- assert(vlink(alink(cur))==cur);
- }
- tlink(root) = cur;
- return root;
+static halfword handle_lig_nest(halfword root, halfword cur)
+{
+ if (cur == null)
+ return root;
+ while (vlink(cur) != null) {
+ halfword fwd = vlink(cur);
+ if (type(cur) == glyph_node && type(fwd) == glyph_node &&
+ font(cur) == font(fwd) && try_ligature(&cur, fwd))
+ continue;
+ cur = vlink(cur);
+ assert(vlink(alink(cur)) == cur);
+ }
+ tlink(root) = cur;
+ return root;
}
-static halfword
-handle_lig_word(halfword cur) {
- halfword right=null;
-
- if (type(cur)==whatsit_node && subtype(cur)==cancel_boundary_node) {
- halfword prev= alink(cur);
- halfword fwd = vlink(cur);
-/* uncouple_node(cur); */ /* not needed, it is freed */
- flush_node(cur);
- if (fwd==null) {
- vlink(prev) = fwd;
- return prev;
- }
- couple_nodes(prev,fwd);
- if (type(fwd)!=glyph_node) return prev;
- cur = fwd;
- } else if (has_left_boundary(font(cur))) {
- halfword prev= alink(cur);
- halfword p = new_glyph(font(cur),left_boundarychar);
- couple_nodes(prev,p);
- couple_nodes(p,cur);
- cur = p;
- }
- if (has_right_boundary(font(cur))) {
- right = new_glyph(font(cur),right_boundarychar);
- }
-
- while (1) {
- /* A glyph followed by ... */
- if (type(cur)==glyph_node) {
- halfword fwd = vlink(cur);
- if (fwd==null) { /* last character of paragraph */
- if (right==null) break;
- couple_nodes(cur,right);
- right = null;
- continue;
- }
- assert(alink(fwd)==cur);
- if (type(fwd)==glyph_node) { /* GLYPH - GLYPH */
- if (font(cur)!=font(fwd)) break;
- if (try_ligature(&cur,fwd)) continue;
- } else if (type(fwd)==disc_node) { /* GLYPH - DISC */
-
- /* if a{bx}{}{y} and a+b=>B convert to {Bx}{}{ay} */
- halfword pre = vlink_pre_break(fwd);
- halfword nob = vlink_no_break(fwd);
- halfword next, tail;
- liginfo lig;
- assert_disc(fwd);
- /* Check on: a{b?}{?}{?} and a+b=>B : {B?}{?}{a?}*/
- /* Check on: a{?}{?}{b?} and a+b=>B : {a?}{?}{B?} */
- if ( (pre!=null && type(pre)==glyph_node && test_ligature(&lig,cur,pre))
- || (nob!=null && type(nob)==glyph_node && test_ligature(&lig,cur,nob))) {
- /* move cur from before disc, to skipped part */
- halfword prev = alink(cur);
- assert(vlink(prev)==cur);
- uncouple_node(cur);
- couple_nodes(prev,fwd);
- nesting_prepend(no_break(fwd),cur);
- /* now ligature the pre_break */
- nesting_prepend(pre_break(fwd),copy_node(cur));
- /* As we have removed cur, we need to start again ... */
- cur = prev;
- }
- /* Check on: a{?}{?}{}b and a+b=>B : {a?}{?b}{B}*/
- next = vlink(fwd);
- if (nob==null && next != null && type(next)==glyph_node
- && test_ligature(&lig,cur,next)) {
- /* move cur from before disc to no_break part */
- halfword prev = alink(cur);
- assert(alink(next)==fwd);
- assert(vlink(prev)==cur);
- uncouple_node(cur);
- couple_nodes(prev,fwd);
- couple_nodes(no_break(fwd),cur); /* we _know_ it's empty */
- /* now copy cur the pre_break */
- nesting_prepend(pre_break(fwd),copy_node(cur));
- /* move next from after disc to no_break part */
- tail = vlink(next);
- uncouple_node(next);
- try_couple_nodes(fwd,tail);
- couple_nodes(cur,next); /* we _know_ this works */
- tlink(no_break(fwd)) = next; /* and make sure the list is correct */
- /* now copy next to the post_break */
- nesting_append(post_break(fwd),copy_node(next));
- /* As we have removed cur, we need to start again ... */
- cur = prev;
- }
- /* we are finished with the pre_break */
- handle_lig_nest(pre_break(fwd),vlink_pre_break(fwd));
- } else if (type(fwd)==whatsit_node && subtype(fwd)==cancel_boundary_node) {
- halfword next = vlink(fwd);
- try_couple_nodes(cur,next);
- flush_node(fwd);
- if (right!=null) {
- flush_node(right); /* Shame, didn't need it */
- /* right = null; */ /* no need, we're going to leave the loop anyway */
+static halfword handle_lig_word(halfword cur)
+{
+ halfword right = null;
+
+ if (type(cur) == whatsit_node && subtype(cur) == cancel_boundary_node) {
+ halfword prev = alink(cur);
+ halfword fwd = vlink(cur);
+ /* uncouple_node(cur); *//* not needed, it is freed */
+ flush_node(cur);
+ if (fwd == null) {
+ vlink(prev) = fwd;
+ return prev;
}
- break;
- } else { /* fwd is something unknown */
- if (right==null) break;
- couple_nodes(cur,right);
- couple_nodes(right,fwd);
- right = null;
- continue;
- }
- /* A discretionary followed by ... */
- } else if (type(cur)==disc_node) {
- assert_disc(cur);
- /* If {?}{x}{?} or {?}{?}{y} then ... */
- if (vlink_no_break(cur)!=null || vlink_post_break(cur)!=null) {
- halfword fwd;
- halfword lists[511]; /* max 8 levels */
-
- int i, max_depth=0;
- lists[max_depth++] = handle_lig_nest(post_break(cur),vlink_post_break(cur));
- lists[max_depth++] = handle_lig_nest(no_break(cur),vlink_no_break(cur));
- while (1) {
- if ((fwd = vlink(cur))==null) return cur;
- if ( type(fwd)==glyph_node) {
- halfword next;
- for (i=0; i<max_depth; i++) {
- liginfo lig;
- halfword tail = tlink(lists[i]);
- if ( tail!=null && test_ligature(&lig,tail,fwd))
- goto add_glyph_to_all;
+ couple_nodes(prev, fwd);
+ if (type(fwd) != glyph_node)
+ return prev;
+ cur = fwd;
+ } else if (has_left_boundary(font(cur))) {
+ halfword prev = alink(cur);
+ halfword p = new_glyph(font(cur), left_boundarychar);
+ couple_nodes(prev, p);
+ couple_nodes(p, cur);
+ cur = p;
+ }
+ if (has_right_boundary(font(cur))) {
+ right = new_glyph(font(cur), right_boundarychar);
+ }
+
+ while (1) {
+ /* A glyph followed by ... */
+ if (type(cur) == glyph_node) {
+ halfword fwd = vlink(cur);
+ if (fwd == null) { /* last character of paragraph */
+ if (right == null)
+ break;
+ /* --\par prohibits use of couple_nodes here */
+ try_couple_nodes(cur, right);
+ right = null;
+ continue;
}
- /* if we get here, nothing had a ligature, so we stop */
- break;
-add_glyph_to_all:
- for (i=0; i<max_depth; i++) {
- halfword copy = copy_node(fwd);
- halfword tail = tlink(lists[i]);
- nesting_append(lists[i],copy);
- if (tail==null) continue; /* first character - never a ligature */
- handle_lig_nest(lists[i],tail);
+ assert(alink(fwd) == cur);
+ if (type(fwd) == glyph_node) { /* GLYPH - GLYPH */
+ if (font(cur) != font(fwd))
+ break;
+ if (try_ligature(&cur, fwd))
+ continue;
+ } else if (type(fwd) == disc_node) { /* GLYPH - DISC */
+
+ /* if a{bx}{}{y} and a+b=>B convert to {Bx}{}{ay} */
+ halfword pre = vlink_pre_break(fwd);
+ halfword nob = vlink_no_break(fwd);
+ halfword next, tail;
+ liginfo lig;
+ assert_disc(fwd);
+ /* Check on: a{b?}{?}{?} and a+b=>B : {B?}{?}{a?} */
+ /* Check on: a{?}{?}{b?} and a+b=>B : {a?}{?}{B?} */
+ if ((pre != null && type(pre) == glyph_node
+ && test_ligature(&lig, cur, pre))
+ || (nob != null && type(nob) == glyph_node
+ && test_ligature(&lig, cur, nob))) {
+ /* move cur from before disc, to skipped part */
+ halfword prev = alink(cur);
+ assert(vlink(prev) == cur);
+ uncouple_node(cur);
+ couple_nodes(prev, fwd);
+ nesting_prepend(no_break(fwd), cur);
+ /* now ligature the pre_break */
+ nesting_prepend(pre_break(fwd), copy_node(cur));
+ /* As we have removed cur, we need to start again ... */
+ cur = prev;
+ }
+ /* Check on: a{?}{?}{}b and a+b=>B : {a?}{?b}{B} */
+ next = vlink(fwd);
+ if (nob == null && next != null && type(next) == glyph_node
+ && test_ligature(&lig, cur, next)) {
+ /* move cur from before disc to no_break part */
+ halfword prev = alink(cur);
+ assert(alink(next) == fwd);
+ assert(vlink(prev) == cur);
+ uncouple_node(cur);
+ couple_nodes(prev, fwd);
+ couple_nodes(no_break(fwd), cur); /* we _know_ it's empty */
+ /* now copy cur the pre_break */
+ nesting_prepend(pre_break(fwd), copy_node(cur));
+ /* move next from after disc to no_break part */
+ tail = vlink(next);
+ uncouple_node(next);
+ try_couple_nodes(fwd, tail);
+ couple_nodes(cur, next); /* we _know_ this works */
+ tlink(no_break(fwd)) = next; /* and make sure the list is correct */
+ /* now copy next to the post_break */
+ nesting_append(post_break(fwd), copy_node(next));
+ /* As we have removed cur, we need to start again ... */
+ cur = prev;
+ }
+ /* we are finished with the pre_break */
+ handle_lig_nest(pre_break(fwd), vlink_pre_break(fwd));
+ } else if (type(fwd) == whatsit_node
+ && subtype(fwd) == cancel_boundary_node) {
+ halfword next = vlink(fwd);
+ try_couple_nodes(cur, next);
+ flush_node(fwd);
+ if (right != null) {
+ flush_node(right); /* Shame, didn't need it */
+ /* right = null; *//* no need, we're going to leave the loop anyway */
+ }
+ break;
+ } else { /* fwd is something unknown */
+ if (right == null)
+ break;
+ couple_nodes(cur, right);
+ couple_nodes(right, fwd);
+ right = null;
+ continue;
}
- next = vlink(fwd);
- uncouple_node(fwd);
- try_couple_nodes(cur,next);
- flush_node(fwd);
- } else if ( type(fwd)==disc_node) {
- halfword next;
- /* MAGIC WARNING
- * A disc followed by a disc can have different kernings
- * depending on which path is choosen, and it is impossible to
- * store the possible kernings: fe {}{A}{W} {V}{}{A}
- * So we _always_ add discs so only a simple path remains. */
- int m=max_depth; /* as max_depth changes in this loop */
- for (i=0; i<m; i++) {
- halfword copy = copy_node(fwd);
- halfword tail = tlink(lists[i]);
- if (tail!=null) {
- halfword prev = alink(tail);
- assert(alink(tail)!=null);
- uncouple_node(tail);
- vlink(prev) = null;
- if (prev==lists[i]) {
- tlink(prev) = null;
- } else {
- tlink(lists[i]) = prev;
+ /* A discretionary followed by ... */
+ } else if (type(cur) == disc_node) {
+ assert_disc(cur);
+ /* If {?}{x}{?} or {?}{?}{y} then ... */
+ if (vlink_no_break(cur) != null || vlink_post_break(cur) != null) {
+ halfword fwd;
+ halfword lists[511]; /* max 8 levels */
+
+ int i, max_depth = 0;
+ lists[max_depth++] =
+ handle_lig_nest(post_break(cur), vlink_post_break(cur));
+ lists[max_depth++] =
+ handle_lig_nest(no_break(cur), vlink_no_break(cur));
+ while (1) {
+ if ((fwd = vlink(cur)) == null)
+ return cur;
+ if (type(fwd) == glyph_node) {
+ halfword next;
+ for (i = 0; i < max_depth; i++) {
+ liginfo lig;
+ halfword tail = tlink(lists[i]);
+ if (tail != null && test_ligature(&lig, tail, fwd))
+ goto add_glyph_to_all;
+ }
+ /* if we get here, nothing had a ligature, so we stop */
+ break;
+ add_glyph_to_all:
+ for (i = 0; i < max_depth; i++) {
+ halfword copy = copy_node(fwd);
+ halfword tail = tlink(lists[i]);
+ nesting_append(lists[i], copy);
+ if (tail == null)
+ continue; /* first character - never a ligature */
+ handle_lig_nest(lists[i], tail);
+ }
+ next = vlink(fwd);
+ uncouple_node(fwd);
+ try_couple_nodes(cur, next);
+ flush_node(fwd);
+ } else if (type(fwd) == disc_node) {
+ halfword next;
+ /* MAGIC WARNING
+ * A disc followed by a disc can have different kernings
+ * depending on which path is choosen, and it is impossible to
+ * store the possible kernings: fe {}{A}{W} {V}{}{A}
+ * So we _always_ add discs so only a simple path remains. */
+ int m = max_depth; /* as max_depth changes in this loop */
+ for (i = 0; i < m; i++) {
+ halfword copy = copy_node(fwd);
+ halfword tail = tlink(lists[i]);
+ if (tail != null) {
+ halfword prev = alink(tail);
+ assert(alink(tail) != null);
+ uncouple_node(tail);
+ vlink(prev) = null;
+ if (prev == lists[i]) {
+ tlink(prev) = null;
+ } else {
+ tlink(lists[i]) = prev;
+ }
+ nesting_prepend(pre_break(copy), tail);
+ nesting_prepend(no_break(copy),
+ copy_node(tail));
+ }
+ nesting_append(lists[i], copy);
+ handle_lig_nest(pre_break(copy),
+ vlink_pre_break(copy));
+ assert(max_depth < 256);
+ lists[max_depth++] =
+ handle_lig_nest(no_break(copy),
+ vlink_no_break(copy));
+ lists[i] =
+ handle_lig_nest(post_break(copy),
+ vlink_post_break(copy));
+ }
+ next = vlink(fwd);
+ uncouple_node(fwd);
+ try_couple_nodes(cur, next);
+ flush_node(fwd);
+ } else {
+ return cur;
+ }
}
- nesting_prepend(pre_break(copy),tail);
- nesting_prepend(no_break(copy),copy_node(tail));
- }
- nesting_append(lists[i],copy);
- handle_lig_nest(pre_break(copy),vlink_pre_break(copy));
- assert(max_depth<256);
- lists[max_depth++] = handle_lig_nest(no_break(copy),vlink_no_break(copy));
- lists[i] = handle_lig_nest(post_break(copy),vlink_post_break(copy));
}
- next = vlink(fwd);
- uncouple_node(fwd);
- try_couple_nodes(cur,next);
- flush_node(fwd);
- } else {
+ } else { /* NO GLYPH NOR DISC */
+ /* fprintf(stdout,"This is a %d node\n",type(cur)); */
+ /* assert(0); *//* TODO howcome there can be a glue here? */
return cur;
- }
}
- }
- } else { /* NO GLYPH NOR DISC */
- /* fprintf(stdout,"This is a %d node\n",type(cur));*/
- /* assert(0);*/ /* TODO howcome there can be a glue here? */
- return cur;
- }
- /* step-to-next-node */
- {
- halfword prev = cur;
- cur = vlink(cur);
- assert(cur!=null);
- assert(alink(cur)==prev);
- /* alink(cur) = prev;*/
- }
- }
-
- return cur;
+ /* step-to-next-node */
+ {
+ halfword prev = cur;
+ /* --\par allows vlink(cur) to be null */
+ cur = vlink(cur);
+ if (cur != null) {
+ assert(alink(cur) == prev);
+ }
+ }
+ }
+
+ return cur;
}
/* return = new tail, head should be a dummy */
-halfword
-handle_ligaturing(halfword head, halfword tail) {
- halfword save_tail ; /* trick to allow explicit node==null tests */
- halfword cur, prev;
+halfword handle_ligaturing(halfword head, halfword tail)
+{
+ halfword save_tail; /* trick to allow explicit node==null tests */
+ halfword cur, prev;
- if (vlink(head)==null)
- return tail;
- save_tail = vlink(tail);
- vlink(tail) = null;
-
- /* if (fix_node_lists) */
- fix_node_list(head);
-
- prev = head;
- cur = vlink(prev);
-
- while (cur!=null) {
- if ( type(cur)==glyph_node ||
- (type(cur)==whatsit_node && subtype(cur)==cancel_boundary_node)) {
- cur = handle_lig_word(cur);
- }
- prev = cur;
- cur = vlink(cur);
- assert(cur==null||alink(cur) == prev);
- }
- if (valid_node(save_tail)) {
- try_couple_nodes(prev,save_tail);
- }
- return prev;
+ if (vlink(head) == null)
+ return tail;
+ save_tail = vlink(tail);
+ vlink(tail) = null;
+
+ /* if (fix_node_lists) */
+ fix_node_list(head);
+
+ prev = head;
+ cur = vlink(prev);
+
+ while (cur != null) {
+ if (type(cur) == glyph_node ||
+ (type(cur) == whatsit_node
+ && subtype(cur) == cancel_boundary_node)) {
+ cur = handle_lig_word(cur);
+ }
+ prev = cur;
+ cur = vlink(cur);
+ assert(cur == null || alink(cur) == prev);
+ }
+ if (prev == null)
+ prev = tail;
+
+ if (valid_node(save_tail)) {
+ try_couple_nodes(prev, save_tail);
+ }
+ return prev;
}
@@ -1547,124 +1964,128 @@ handle_ligaturing(halfword head, halfword tail) {
*
* ==================================================================== */
-static void
-add_kern_before(halfword left, halfword right) {
- if ((!is_rightghost(right)) &&
- font(left)==font(right) &&
- has_kern(font(left),character(left))) {
- int k = get_kern(font(left),character(left),character(right));
- if (k!=0) {
- halfword kern = new_kern(k);
- halfword prev = alink(right);
- assert(vlink(prev)==right);
- couple_nodes(prev,kern);
- couple_nodes(kern,right);
- }
- }
+static void add_kern_before(halfword left, halfword right)
+{
+ if ((!is_rightghost(right)) &&
+ font(left) == font(right) && has_kern(font(left), character(left))) {
+ int k = raw_get_kern(font(left), character(left), character(right));
+ if (k != 0) {
+ halfword kern = new_kern(k);
+ halfword prev = alink(right);
+ assert(vlink(prev) == right);
+ couple_nodes(prev, kern);
+ couple_nodes(kern, right);
+ }
+ }
}
-static void
-add_kern_after(halfword left, halfword right, halfword aft) {
- if ((!is_rightghost(right)) &&
- font(left)==font(right) &&
- has_kern(font(left),character(left))) {
- int k = get_kern(font(left),character(left),character(right));
- if (k!=0) {
- halfword kern = new_kern(k);
- halfword next = vlink(aft);
- assert(next==null||alink(next)==aft);
- couple_nodes(aft,kern);
- try_couple_nodes(kern,next);
- }
- }
+static void add_kern_after(halfword left, halfword right, halfword aft)
+{
+ if ((!is_rightghost(right)) &&
+ font(left) == font(right) && has_kern(font(left), character(left))) {
+ int k = raw_get_kern(font(left), character(left), character(right));
+ if (k != 0) {
+ halfword kern = new_kern(k);
+ halfword next = vlink(aft);
+ assert(next == null || alink(next) == aft);
+ couple_nodes(aft, kern);
+ try_couple_nodes(kern, next);
+ }
+ }
}
static void
-do_handle_kerning (halfword root, halfword init_left, halfword init_right) {
- halfword cur = vlink(root);
- halfword left = null;
- assert(init_left==null || type(init_left)==glyph_node);
- assert(init_right==null || type(init_right)==glyph_node);
- if (cur==null) {
- if (init_left!=null && init_right!=null) {
- add_kern_after(init_left,init_right,root);
- tlink(root)=vlink(root);
+do_handle_kerning(halfword root, halfword init_left, halfword init_right)
+{
+ halfword cur = vlink(root);
+ halfword left = null;
+ assert(init_left == null || type(init_left) == glyph_node);
+ assert(init_right == null || type(init_right) == glyph_node);
+ if (cur == null) {
+ if (init_left != null && init_right != null) {
+ add_kern_after(init_left, init_right, root);
+ tlink(root) = vlink(root);
+ }
+ return;
}
- return;
- }
- if (type(cur)==glyph_node) {
- set_is_glyph(cur);
- if (init_left!=null)
- add_kern_before(init_left,cur);
- left = cur;
- }
- while ((cur=vlink(cur))!=null) {
- if (type(cur)==glyph_node) {
- set_is_glyph(cur);
- if (left != null) {
- add_kern_before(left,cur);
- if (character(left)<0 || is_ghost(left)) {
- halfword prev = alink(left);
- couple_nodes(prev,cur);
- flush_node(left);
+ if (type(cur) == glyph_node) {
+ set_is_glyph(cur);
+ if (init_left != null)
+ add_kern_before(init_left, cur);
+ left = cur;
+ }
+ while ((cur = vlink(cur)) != null) {
+ if (type(cur) == glyph_node) {
+ set_is_glyph(cur);
+ if (left != null) {
+ add_kern_before(left, cur);
+ if (character(left) < 0 || is_ghost(left)) {
+ halfword prev = alink(left);
+ couple_nodes(prev, cur);
+ flush_node(left);
+ }
+ }
+ left = cur;
+ } else {
+ if (type(cur) == disc_node) {
+ halfword right =
+ type(vlink(cur)) == glyph_node ? vlink(cur) : null;
+ do_handle_kerning(pre_break(cur), left, null);
+ do_handle_kerning(post_break(cur), null, right);
+ if (vlink_post_break(cur) != null)
+ tlink_post_break(cur) = tail_of_list(vlink_post_break(cur));
+ do_handle_kerning(no_break(cur), left, right);
+ if (vlink_no_break(cur) != null)
+ tlink_no_break(cur) = tail_of_list(vlink_no_break(cur)); /* needed? */
+ }
+ if (left != null) {
+ if (character(left) < 0 || is_ghost(left)) {
+ halfword prev = alink(left);
+ couple_nodes(prev, cur);
+ flush_node(left);
+ }
+ left = null;
+ }
}
- }
- left = cur;
- } else {
- if (type(cur)==disc_node) {
- halfword right= type(vlink(cur))==glyph_node ? vlink(cur) : null;
- do_handle_kerning(pre_break(cur),left,null);
- do_handle_kerning(post_break(cur),null,right);
- do_handle_kerning(no_break(cur),left,right);
- }
- if (left != null) {
- if (character(left)<0 || is_ghost(left)) {
- halfword prev = alink(left);
- couple_nodes(prev,cur);
- flush_node(left);
+ }
+ if (left != null) {
+ if (init_right != null)
+ add_kern_after(left, init_right, left);
+ if (character(left) < 0 || is_ghost(left)) {
+ halfword prev = alink(left);
+ halfword next = vlink(left);
+ if (next != null) {
+ couple_nodes(prev, next);
+ tlink(root) = next;
+ assert(vlink(next) == null);
+ assert(type(next) == kern_node);
+ } else if (prev != root) {
+ vlink(prev) = null;
+ tlink(root) = prev;
+ } else {
+ vlink(root) = null;
+ tlink(root) = null;
+ }
+ flush_node(left);
}
- left = null;
- }
- }
- }
- if (left!=null) {
- if (init_right!=null)
- add_kern_after(left,init_right,left);
- if (character(left)<0 || is_ghost(left)) {
- halfword prev = alink(left);
- halfword next = vlink(left);
- if (next!=null) {
- couple_nodes(prev,next);
- tlink(root) = next;
- assert(vlink(next)==null);
- assert(type(next)==kern_node);
- } else if (prev!=root) {
- vlink(prev) = null;
- tlink(root) = prev;
- } else {
- vlink(root) = null;
- tlink(root) = null;
- }
- flush_node(left);
- }
- }
+ }
}
-halfword
-handle_kerning (halfword head, halfword tail) {
- halfword save_link;
- save_link = vlink(tail);
- vlink(tail) = null;
- tlink(head) = tail;
- do_handle_kerning(head,null,null);
- tail = tlink(head);
- if (valid_node(save_link)) {
- try_couple_nodes(tail,save_link);
- }
- return tail;
+halfword handle_kerning(halfword head, halfword tail)
+{
+ halfword save_link;
+ save_link = vlink(tail);
+ vlink(tail) = null;
+ tlink(head) = tail;
+ do_handle_kerning(head, null, null);
+ tail = tlink(head);
+ if (valid_node(save_link)) {
+ try_couple_nodes(tail, save_link);
+ }
+ return tail;
}
/* ====================================================================
@@ -1674,63 +2095,63 @@ handle_kerning (halfword head, halfword tail) {
* ==================================================================== */
static halfword
-run_lua_ligkern_callback (halfword head, halfword tail, int callback_id){
- lua_State *L = Luas[0];
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1, callback_id);
- if (!lua_isfunction(L,-1)) {
- lua_pop(L,2);
- return tail;
- }
- nodelist_to_lua(L,head);
- nodelist_to_lua(L,tail);
- if (lua_pcall(L,2,1,0) != 0) {
- fprintf(stdout,"error: %s\n",lua_tostring(L,-1));
- lua_pop(L,2);
- lua_error(L);
+run_lua_ligkern_callback(halfword head, halfword tail, int callback_id)
+{
+ lua_State *L = Luas;
+ if (!get_callback(L, callback_id)) {
+ lua_pop(L, 2);
+ return tail;
+ }
+ nodelist_to_lua(L, head);
+ nodelist_to_lua(L, tail);
+ if (lua_pcall(L, 2, 1, 0) != 0) {
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ lua_error(L);
+ return tail;
+ }
+ tail = nodelist_from_lua(L);
+ if (fix_node_lists)
+ fix_node_list(head);
+ lua_pop(L, 2);
return tail;
- }
- tail = nodelist_from_lua(L);
- if (fix_node_lists)
- fix_node_list(head);
- lua_pop(L,2);
- return tail;
}
-halfword
-new_ligkern(halfword head, halfword tail) {
- int callback_id = 0;
+halfword new_ligkern(halfword head, halfword tail)
+{
+ int callback_id = 0;
- assert(head!=null);
- if (vlink(head)==null)
- return tail;
+ assert(head != null);
+ if (vlink(head) == null)
+ return tail;
- callback_id = callback_defined(ligaturing_callback);
- if (callback_id>0) {
- tail = run_lua_ligkern_callback(head,tail,callback_id);
- if (tail==null) tail = tail_of_list(head);
- } else {
- tail = handle_ligaturing(head,tail);
- }
-
- callback_id = callback_defined(kerning_callback);
- if (callback_id>0) {
- tail = run_lua_ligkern_callback(head,tail,callback_id);
- if (tail==null) tail = tail_of_list(head);
- } else {
- halfword nest = new_node(nesting_node,1);
- halfword cur = vlink(head);
- halfword aft = vlink(tail);
- couple_nodes(nest,cur);
- tlink(nest)=tail;
- vlink(tail)=null;
- do_handle_kerning(nest,null,null);
- couple_nodes(head,vlink(nest));
- tail = tlink(nest);
- try_couple_nodes(tail,aft);
- flush_node(nest);
- }
- return tail;
-}
+ callback_id = callback_defined(ligaturing_callback);
+ if (callback_id > 0) {
+ tail = run_lua_ligkern_callback(head, tail, callback_id);
+ if (tail == null)
+ tail = tail_of_list(head);
+ } else {
+ tail = handle_ligaturing(head, tail);
+ }
+ callback_id = callback_defined(kerning_callback);
+ if (callback_id > 0) {
+ tail = run_lua_ligkern_callback(head, tail, callback_id);
+ if (tail == null)
+ tail = tail_of_list(head);
+ } else {
+ halfword nest = new_node(nesting_node, 1);
+ halfword cur = vlink(head);
+ halfword aft = vlink(tail);
+ couple_nodes(nest, cur);
+ tlink(nest) = tail;
+ vlink(tail) = null;
+ do_handle_kerning(nest, null, null);
+ couple_nodes(head, vlink(nest));
+ tail = tlink(nest);
+ try_couple_nodes(tail, aft);
+ flush_node(nest);
+ }
+ return tail;
+}
diff --git a/Build/source/texk/web2c/luatexdir/font/luatexfont.h b/Build/source/texk/web2c/luatexdir/font/luatexfont.h
new file mode 100644
index 00000000000..ceee8bf69f3
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/font/luatexfont.h
@@ -0,0 +1,67 @@
+/* luatexfont.h General font functions
+
+ Copyright 2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: luatexfont.h 1783 2009-01-18 12:51:01Z oneiros $ */
+
+#ifndef LUATEXFONT_H
+# define LUATEXFONT_H 1
+
+# include "ptexlib.h"
+# include "sfnt.h"
+
+/* texfont.c */
+extern charinfo *copy_charinfo(charinfo * ci);
+
+/* tounicode.c */
+extern integer write_cid_tounicode(fo_entry * fo, internalfontnumber f);
+
+/* vfpacket.c */
+extern void replace_packet_fonts(internal_font_number f, integer * old_fontid,
+ integer * new_fontid, int count);
+extern integer *packet_local_fonts(internal_font_number f, integer * num);
+
+/* writeccf.c */
+extern void writetype1w(fd_entry * fd);
+
+/* writetype0.c */
+extern void writetype0(fd_entry * fd);
+
+/* writetype2.c */
+extern void writetype2(fd_entry * fd);
+extern unsigned long cidtogid_obj;
+extern pdf_obj *pdf_new_stream(void);
+extern void pdf_add_stream(pdf_obj * stream, unsigned char *buf, long len);
+extern void pdf_release_obj(pdf_obj * stream);
+
+/* writet3.c */
+extern FILE *t3_file;
+
+extern unsigned char *t3_buffer;
+extern integer t3_size;
+extern integer t3_curbyte;
+
+# define t3_read_file() readbinfile(t3_file,&t3_buffer,&t3_size)
+# define t3_close() xfclose(t3_file, cur_file_name)
+# define t3_getchar() t3_buffer[t3_curbyte++]
+# define t3_eof() (t3_curbyte>t3_size)
+
+# define t3_prefix(s) (!strncmp(t3_line_array, s, strlen(s)))
+# define t3_putchar(c) pdfout(c)
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/font/macnames.c b/Build/source/texk/web2c/luatexdir/font/macnames.c
index 941f087ef56..ae7720cc8dd 100644
--- a/Build/source/texk/web2c/luatexdir/font/macnames.c
+++ b/Build/source/texk/web2c/luatexdir/font/macnames.c
@@ -1,24 +1,25 @@
-/*
-Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
+/* macnames.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-$Id: macnames.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+static const char __svn_version[] =
+ "$Id: macnames.c 1223 2008-05-02 13:39:55Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/macnames.c $";
const char notdef[] = ".notdef";
diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.c b/Build/source/texk/web2c/luatexdir/font/mapfile.c
index 1c444e5c1d4..c97cdf59782 100644
--- a/Build/source/texk/web2c/luatexdir/font/mapfile.c
+++ b/Build/source/texk/web2c/luatexdir/font/mapfile.c
@@ -1,25 +1,22 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
+/* mapfile.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: mapfile.c 1013 2008-02-14 00:09:02Z oneiros $
-
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include <math.h>
#include "ptexlib.h"
@@ -28,6 +25,9 @@ $Id: mapfile.c 1013 2008-02-14 00:09:02Z oneiros $
#include <string.h>
#include "luatex-api.h"
+static const char _svn_version[] =
+ "$Id: mapfile.c 1870 2009-02-19 10:03:13Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/mapfile.c $";
+
#define FM_BUF_SIZE 1024
static FILE *fm_file;
@@ -37,12 +37,12 @@ static integer fm_size = 0;
static integer fm_curbyte = 0;
#define fm_open() \
- open_input (&fm_file, kpse_fontmap_format, FOPEN_RBIN_MODE)
+ (fm_file = fopen((char *) nameoffile + 1, FOPEN_RBIN_MODE))
#define fm_read_file() \
readbinfile(fm_file,&fm_buffer,&fm_size)
#define fm_close() xfclose(fm_file, cur_file_name)
#define fm_getchar() fm_buffer[fm_curbyte++]
-#define fm_eof() (fm_curbyte>=fm_size)
+#define fm_eof() (fm_curbyte>fm_size)
typedef enum { FM_DUPIGNORE, FM_REPLACE, FM_DELETE } updatemode;
typedef enum { MAPFILE, MAPLINE } maptype;
@@ -79,7 +79,7 @@ fm_entry *new_fm_entry(void)
fm->tfm_name = NULL;
fm->sfd_name = NULL;
fm->ps_name = NULL;
- fm->fd_flags = 4;
+ fm->fd_flags = FD_FLAGS_NOT_SET_IN_MAPLINE;
fm->ff_name = NULL;
fm->encname = NULL;
fm->type = 0;
@@ -102,23 +102,23 @@ void delete_fm_entry(fm_entry * fm)
xfree(fm);
}
-static ff_entry *new_ff_entry (void)
+static ff_entry *new_ff_entry(void)
{
ff_entry *ff;
- ff = xtalloc (1, ff_entry);
+ ff = xtalloc(1, ff_entry);
ff->ff_name = NULL;
ff->ff_path = NULL;
return ff;
}
-static void delete_ff_entry (ff_entry * ff)
+static void delete_ff_entry(ff_entry * ff)
{
- xfree (ff->ff_name);
- xfree (ff->ff_path);
- xfree (ff);
+ xfree(ff->ff_name);
+ xfree(ff->ff_path);
+ xfree(ff);
}
-static fm_entry *dummy_fm_entry ()
+static fm_entry *dummy_fm_entry()
{
static const fm_entry const_fm_entry;
return (fm_entry *) & const_fm_entry;
@@ -133,10 +133,10 @@ struct avl_table *encname_tree = NULL;
/* AVL sort fm_entry into tfm_tree by tfm_name */
-static int comp_fm_entry_tfm (const void *pa, const void *pb, void *p)
+static int comp_fm_entry_tfm(const void *pa, const void *pb, void *p)
{
- return strcmp (((const fm_entry *) pa)->tfm_name,
- ((const fm_entry *) pb)->tfm_name);
+ return strcmp(((const fm_entry *) pa)->tfm_name,
+ ((const fm_entry *) pb)->tfm_name);
}
/* AVL sort fm_entry into ps_tree by ps_name, slant, and extend */
@@ -155,13 +155,13 @@ static int comp_fm_entry_ps(const void *pa, const void *pb, void *p)
/* AVL sort ff_entry into ff_tree by ff_name */
-static int comp_ff_entry (const void *pa, const void *pb, void *p)
+static int comp_ff_entry(const void *pa, const void *pb, void *p)
{
- return strcmp (((const ff_entry *) pa)->ff_name,
- ((const ff_entry *) pb)->ff_name);
+ return strcmp(((const ff_entry *) pa)->ff_name,
+ ((const ff_entry *) pb)->ff_name);
}
-static void create_avl_trees ()
+static void create_avl_trees()
{
assert(tfm_tree == NULL);
tfm_tree = avl_create(comp_fm_entry_tfm, NULL, &avl_xallocator);
@@ -354,9 +354,9 @@ int check_fm_entry(fm_entry * fm, boolean warn)
}
/**********************************************************************/
-/* returns true if s is one of the 14 std. font names; speed-trimmed. */
+/* returns the font number if s is one of the 14 std. font names, -1 otherwise; speed-trimmed. */
-boolean check_std_t1font(char *s)
+int check_std_t1font(char *s)
{
static const char *std_t1font_names[] = {
"Courier", /* 0:7 */
@@ -378,10 +378,12 @@ boolean check_std_t1font(char *s)
{ -1, -1, -1, -1, -1, -1, 8, 0, -1, 4, 10, 9, -1, -1, 5, 2, 12, 6, -1,
3, -1, 7
};
- const size_t n = strlen(s);
+ size_t n;
int k = -1;
+ assert(s != NULL);
+ n = strlen(s);
if (n > 21)
- return false;
+ return -1;
if (n == 12) { /* three names have length 12 */
switch (*s) {
case 'C':
@@ -394,15 +396,16 @@ boolean check_std_t1font(char *s)
k = 13; /* ZapfDingbats */
break;
default:
- return false;
+ return -1;
}
} else
k = index[n];
if (k > -1 && !strcmp(std_t1font_names[k], s))
- return true;
- return false;
+ return k;
+ return -1;
};
+
/**********************************************************************/
static void fm_scan_line()
@@ -415,11 +418,17 @@ static void fm_scan_line()
switch (mitem->type) {
case MAPFILE:
p = fm_line;
- do {
- c = fm_getchar();
- append_char_to_buf(c, p, fm_line, FM_BUF_SIZE);
+ while (!fm_eof()) {
+ if (fm_curbyte == fm_size) {
+ fm_curbyte++;
+ c = 10;
+ } else {
+ c = fm_getchar();
+ }
+ append_char_to_buf(c, p, fm_line, FM_BUF_SIZE);
+ if (c == 10)
+ break;
}
- while (c != 10 && !fm_eof());
*(--p) = '\0';
r = fm_line;
break;
@@ -532,9 +541,9 @@ static void fm_scan_line()
}
}
done:
- if (fm->ps_name != NULL && check_std_t1font(fm->ps_name))
+ if (fm->ps_name != NULL && (check_std_t1font(fm->ps_name) >= 0))
set_std_t1font(fm);
- if (is_fontfile(fm)) {
+ if (is_fontfile(fm) && strlen(fm_fontfile(fm)) > 3) {
if (strcasecmp(strend(fm_fontfile(fm)) - 4, ".ttf") == 0)
set_truetype(fm);
else if (strcasecmp(strend(fm_fontfile(fm)) - 4, ".otf") == 0)
@@ -560,83 +569,95 @@ static void fm_scan_line()
/**********************************************************************/
-void fm_read_info ()
+void fm_read_info()
{
int callback_id;
int file_opened = 0;
- char *ftemp = NULL;
+ char *ftemp = NULL;
if (tfm_tree == NULL)
- create_avl_trees ();
+ create_avl_trees();
if (mitem->line == NULL) /* nothing to do */
return;
mitem->lineno = 1;
switch (mitem->type) {
case MAPFILE:
- set_cur_file_name (mitem->line);
- if (fm_buffer!=NULL) {
- xfree(fm_buffer);
- fm_buffer=NULL;
- }
- fm_curbyte=0;
- fm_size=0;
- callback_id=callback_defined(find_map_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->S",(char *)(nameoffile+1),&ftemp)) {
- if(ftemp!=NULL&&strlen(ftemp)) {
- free(nameoffile);
- namelength = strlen(ftemp);
- nameoffile = xmalloc(namelength+2);
- strcpy((char *)(nameoffile+1),ftemp);
- free(ftemp);
- }
- }
- }
- callback_id=callback_defined(read_map_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->bSd",(char *)(nameoffile+1),
- &file_opened, &fm_buffer,&fm_size)) {
- if(file_opened) {
- if (fm_size>0) {
- cur_file_name = (char *) nameoffile + 1;
- if (tracefilenames)
- tex_printf ("{%s", cur_file_name);
- while (!fm_eof ()) {
- fm_scan_line ();
- mitem->lineno++;
- }
- if (tracefilenames)
- tex_printf ("}");
- fm_file = NULL;
- }
- } else {
- pdftex_warn ("cannot open font map file");
- }
- } else {
- pdftex_warn ("cannot open font map file");
- }
- } else {
- if (!fm_open ()) {
- pdftex_warn ("cannot open font map file");
- } else {
- fm_read_file();
- cur_file_name = (char *) nameoffile + 1;
- tex_printf ("{%s", cur_file_name);
- while (!fm_eof ()) {
- fm_scan_line ();
- mitem->lineno++;
- }
- fm_close ();
- tex_printf ("}");
- fm_file = NULL;
- }
- }
- break;
+ set_cur_file_name(mitem->line);
+ if (fm_buffer != NULL) {
+ xfree(fm_buffer);
+ fm_buffer = NULL;
+ }
+ fm_curbyte = 0;
+ fm_size = 0;
+ callback_id = callback_defined(find_map_file_callback);
+ if (callback_id > 0) {
+ if (run_callback
+ (callback_id, "S->S", (char *) (nameoffile + 1), &ftemp)) {
+ if (ftemp != NULL && strlen(ftemp)) {
+ free(nameoffile);
+ namelength = strlen(ftemp);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), ftemp);
+ free(ftemp);
+ }
+ }
+ } else {
+ ftemp =
+ kpse_find_file((char *) (nameoffile + 1), kpse_fontmap_format,
+ 0);
+ if (ftemp != NULL) {
+ free(nameoffile);
+ namelength = strlen(ftemp);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), ftemp);
+ free(ftemp);
+ }
+ }
+ callback_id = callback_defined(read_map_file_callback);
+ if (callback_id > 0) {
+ if (run_callback(callback_id, "S->bSd", (char *) (nameoffile + 1),
+ &file_opened, &fm_buffer, &fm_size)) {
+ if (file_opened) {
+ if (fm_size > 0) {
+ cur_file_name = (char *) nameoffile + 1;
+ if (tracefilenames)
+ tex_printf("{%s", cur_file_name);
+ while (!fm_eof()) {
+ fm_scan_line();
+ mitem->lineno++;
+ }
+ if (tracefilenames)
+ tex_printf("}");
+ fm_file = NULL;
+ }
+ } else {
+ pdftex_warn("cannot open font map file");
+ }
+ } else {
+ pdftex_warn("cannot open font map file");
+ }
+ } else {
+ if (!fm_open()) {
+ pdftex_warn("cannot open font map file");
+ } else {
+ fm_read_file();
+ cur_file_name = (char *) nameoffile + 1;
+ tex_printf("{%s", cur_file_name);
+ while (!fm_eof()) {
+ fm_scan_line();
+ mitem->lineno++;
+ }
+ fm_close();
+ tex_printf("}");
+ fm_file = NULL;
+ }
+ }
+ break;
case MAPLINE:
- cur_file_name = NULL; /* makes pdftex_warn() shorter */
- fm_scan_line ();
- break;
+ cur_file_name = NULL; /* makes pdftex_warn() shorter */
+ fm_scan_line();
+ break;
default:
- assert (0);
+ assert(0);
}
mitem->line = NULL; /* done with this line */
cur_file_name = NULL;
@@ -667,10 +688,10 @@ static fm_entry_ptr fmlookup(internalfontnumber f)
boolean hasfmentry(internalfontnumber f)
{
- if (font_map(f) == NULL)
- set_font_map(f, (fm_entry_ptr) fmlookup(f));
- assert(font_map(f) != NULL);
- return font_map(f) != (fm_entry_ptr) dummy_fm_entry();
+ if (font_map(f) == NULL)
+ set_font_map(f, (fm_entry_ptr) fmlookup(f));
+ assert(font_map(f) != NULL);
+ return font_map(f) != (fm_entry_ptr) dummy_fm_entry();
}
/* check whether a map entry is valid for font replacement */
@@ -859,7 +880,7 @@ void pdf_init_map_file(string map_name)
mitem = xtalloc(1, mapitem);
mitem->mode = FM_DUPIGNORE;
mitem->type = MAPFILE;
- mitem->line = xstrdup(map_name);
+ mitem->line = map_name;
}
@@ -881,7 +902,7 @@ ff_entry *check_ff_exist(char *ff_name, boolean is_tt)
ff_entry tmp;
void **aa;
int callback_id;
- char *filepath=NULL;
+ char *filepath = NULL;
assert(ff_name != NULL);
tmp.ff_name = ff_name;
@@ -890,27 +911,26 @@ ff_entry *check_ff_exist(char *ff_name, boolean is_tt)
ff = new_ff_entry();
ff->ff_name = xstrdup(ff_name);
if (is_tt) {
- callback_id=callback_defined(find_truetype_file_callback);
- if (callback_id>0) {
- run_callback(callback_id,"S->S",ff_name,&filepath);
- if (filepath && strlen(filepath)==0)
- filepath=NULL;
- ff->ff_path = filepath;
- } else {
- ff->ff_path = kpse_find_file (ff_name, kpse_truetype_format, 0);
- }
- }
- else {
- callback_id=callback_defined(find_type1_file_callback);
- if (callback_id>0) {
- run_callback(callback_id,"S->S",ff_name,&filepath);
- if (filepath && strlen(filepath)==0)
- filepath=NULL;
- ff->ff_path = filepath;
- } else {
- ff->ff_path = kpse_find_file (ff_name, kpse_type1_format, 0);
- }
- }
+ callback_id = callback_defined(find_truetype_file_callback);
+ if (callback_id > 0) {
+ run_callback(callback_id, "S->S", ff_name, &filepath);
+ if (filepath && strlen(filepath) == 0)
+ filepath = NULL;
+ ff->ff_path = filepath;
+ } else {
+ ff->ff_path = kpse_find_file(ff_name, kpse_truetype_format, 0);
+ }
+ } else {
+ callback_id = callback_defined(find_type1_file_callback);
+ if (callback_id > 0) {
+ run_callback(callback_id, "S->S", ff_name, &filepath);
+ if (filepath && strlen(filepath) == 0)
+ filepath = NULL;
+ ff->ff_path = filepath;
+ } else {
+ ff->ff_path = kpse_find_file(ff_name, kpse_type1_format, 0);
+ }
+ }
aa = avl_probe(ff_tree, ff);
assert(aa != NULL);
}
diff --git a/Build/source/texk/web2c/luatexdir/font/pkin.c b/Build/source/texk/web2c/luatexdir/font/pkin.c
index 5067d6dbd66..99f64f29c11 100644
--- a/Build/source/texk/web2c/luatexdir/font/pkin.c
+++ b/Build/source/texk/web2c/luatexdir/font/pkin.c
@@ -1,24 +1,22 @@
-/*
-Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
+/* pkin.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: pkin.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
/*
* NAME
@@ -44,25 +42,21 @@ $Id: pkin.c 1013 2008-02-14 00:09:02Z oneiros $
*/
#include "ptexlib.h"
+#include "luatexfont.h"
+
+static const char _svn_version[] =
+ "$Id: pkin.c 1712 2009-01-02 10:54:55Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/pkin.c $";
/*
* Now we have some routines to get stuff from the pk file. pkbyte returns
* the next byte from the pk file.
*/
-
-/*
-static FILE *pkfile ;
-*/
-
-extern FILE *t3_file;
-#define pkfile t3_file
-
static shalfword pkbyte(void)
{
register shalfword i;
-
- if ((i = xgetc(pkfile)) == EOF)
+ i = t3_getchar();
+ if (t3_eof())
pdftex_fail("unexpected eof in pk file");
return (i);
}
diff --git a/Build/source/texk/web2c/luatexdir/font/sfnt.c b/Build/source/texk/web2c/luatexdir/font/sfnt.c
index 95453a531a0..b705ef7240b 100644
--- a/Build/source/texk/web2c/luatexdir/font/sfnt.c
+++ b/Build/source/texk/web2c/luatexdir/font/sfnt.c
@@ -1,114 +1,110 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/sfnt.c,v 1.12 2004/09/11 14:50:29 hirata Exp $
+/* sfnt.c
- This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+ Copyright 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
- the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
/* Based on dvipdfmx-0.13.2c */
#if HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H_ */
+# include "config.h"
+#endif /* HAVE_CONFIG_H_ */
#include <string.h>
#ifndef pdfTeX
-#include "system.h"
+# include "system.h"
-#include "error.h"
-#include "mem.h"
-#include "mfileio.h"
+# include "error.h"
+# include "mem.h"
+# include "mfileio.h"
#else
-extern void pdftex_fail (const char *fmt, ...); /* utils.c */
+# include "ptexlib.h"
#endif
#include "sfnt.h"
+static const char _svn_version[] =
+ "$Id: sfnt.c 1592 2008-11-28 13:23:51Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/sfnt.c $";
+
#ifdef XETEX
-UNSIGNED_BYTE
-ft_unsigned_byte(sfnt* f)
+UNSIGNED_BYTE ft_unsigned_byte(sfnt * f)
{
- unsigned char byte;
- unsigned long length = 1;
-
- if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, &byte, &length) != 0)
- TT_ERROR("sfnt: Freetype failure...");
- f->loc += 1;
-
- return byte;
+ unsigned char byte;
+ unsigned long length = 1;
+
+ if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, &byte, &length) != 0)
+ TT_ERROR("sfnt: Freetype failure...");
+ f->loc += 1;
+
+ return byte;
}
-SIGNED_BYTE
-ft_signed_byte(sfnt* f)
+SIGNED_BYTE ft_signed_byte(sfnt * f)
{
- int b = ft_unsigned_byte(f);
- if (b >= 0x80)
- b -= 0x100;
- return (SIGNED_BYTE)b;
+ int b = ft_unsigned_byte(f);
+ if (b >= 0x80)
+ b -= 0x100;
+ return (SIGNED_BYTE) b;
}
-UNSIGNED_PAIR
-ft_unsigned_pair(sfnt* f)
+UNSIGNED_PAIR ft_unsigned_pair(sfnt * f)
{
- unsigned char buf[2];
- unsigned long length = 2;
-
- if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, buf, &length) != 0)
- TT_ERROR("sfnt: Freetype failure...");
- f->loc += 2;
-
- return (UNSIGNED_PAIR)((unsigned)buf[0] << 8) + buf[1];
+ unsigned char buf[2];
+ unsigned long length = 2;
+
+ if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, buf, &length) != 0)
+ TT_ERROR("sfnt: Freetype failure...");
+ f->loc += 2;
+
+ return (UNSIGNED_PAIR) ((unsigned) buf[0] << 8) + buf[1];
}
-SIGNED_PAIR
-ft_signed_pair(sfnt* f)
+SIGNED_PAIR ft_signed_pair(sfnt * f)
{
- int p = ft_unsigned_pair(f);
- if (p >= 0x8000U)
- p -= 0x10000U;
-
- return (SIGNED_PAIR)p;
+ int p = ft_unsigned_pair(f);
+ if (p >= 0x8000U)
+ p -= 0x10000U;
+
+ return (SIGNED_PAIR) p;
}
-UNSIGNED_QUAD
-ft_unsigned_quad(sfnt* f)
+UNSIGNED_QUAD ft_unsigned_quad(sfnt * f)
{
- unsigned char buf[4];
- unsigned long length = 4;
+ unsigned char buf[4];
+ unsigned long length = 4;
- if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, buf, &length) != 0)
- TT_ERROR("sfnt: Freetype failure...");
- f->loc += 4;
+ if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, buf, &length) != 0)
+ TT_ERROR("sfnt: Freetype failure...");
+ f->loc += 4;
- return ((unsigned long)buf[0] << 24) + ((unsigned long)buf[1] << 16)
- + ((unsigned long)buf[2] << 8) + (unsigned long)buf[3];
+ return ((unsigned long) buf[0] << 24) + ((unsigned long) buf[1] << 16)
+ + ((unsigned long) buf[2] << 8) + (unsigned long) buf[3];
}
-unsigned long
-ft_read(unsigned char* buf, unsigned long len, sfnt* f)
+unsigned long ft_read(unsigned char *buf, unsigned long len, sfnt * f)
{
- unsigned long length = len;
- if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, buf, &length) != 0)
- TT_ERROR("sfnt: Freetype failure...");
- f->loc += len;
+ unsigned long length = len;
+ if (FT_Load_Sfnt_Table(f->ft_face, 0, f->loc, buf, &length) != 0)
+ TT_ERROR("sfnt: Freetype failure...");
+ f->loc += len;
- return length;
+ return length;
}
#endif
@@ -122,398 +118,381 @@ ft_read(unsigned char* buf, unsigned long len, sfnt* f)
* `ttcf': TrueType Collection
*/
#define SFNT_TRUETYPE 0x00010000UL
-#define SFNT_MAC_TRUE 0x74727565UL
+#define SFNT_MAC_TRUE 0x74727565UL
#define SFNT_OPENTYPE 0x00010000UL
#define SFNT_POSTSCRIPT 0x4f54544fUL
#define SFNT_TTC 0x74746366UL
#ifdef XETEX
-sfnt *
-sfnt_open (FT_Face face, int accept_types)
+sfnt *sfnt_open(FT_Face face, int accept_types)
{
- sfnt *sfont;
- ULONG type;
-
- if (!face || !FT_IS_SFNT(face))
- return NULL;
-
- sfont = NEW(1, sfnt);
- sfont->ft_face = face;
- sfont->loc = 0;
- sfont->type = 0;
-
- type = sfnt_get_ulong(sfont);
-
- if (type == SFNT_TRUETYPE || type == SFNT_MAC_TRUE) {
- sfont->type = SFNT_TYPE_TRUETYPE;
- } else if (type == SFNT_OPENTYPE) {
- sfont->type = SFNT_TYPE_OPENTYPE;
- } else if (type == SFNT_POSTSCRIPT) {
- sfont->type = SFNT_TYPE_POSTSCRIPT;
- } else if (type == SFNT_TTC) {
- sfont->type = SFNT_TYPE_TTC;
- }
-
- if ((sfont->type & accept_types) == 0) {
- RELEASE(sfont);
- return NULL;
- }
-
- sfont->loc = 0;
-
- sfont->directory = NULL;
-
- return sfont;
+ sfnt *sfont;
+ ULONG type;
+
+ if (!face || !FT_IS_SFNT(face))
+ return NULL;
+
+ sfont = NEW(1, sfnt);
+ sfont->ft_face = face;
+ sfont->loc = 0;
+ sfont->type = 0;
+
+ type = sfnt_get_ulong(sfont);
+
+ if (type == SFNT_TRUETYPE || type == SFNT_MAC_TRUE) {
+ sfont->type = SFNT_TYPE_TRUETYPE;
+ } else if (type == SFNT_OPENTYPE) {
+ sfont->type = SFNT_TYPE_OPENTYPE;
+ } else if (type == SFNT_POSTSCRIPT) {
+ sfont->type = SFNT_TYPE_POSTSCRIPT;
+ } else if (type == SFNT_TTC) {
+ sfont->type = SFNT_TYPE_TTC;
+ }
+
+ if ((sfont->type & accept_types) == 0) {
+ RELEASE(sfont);
+ return NULL;
+ }
+
+ sfont->loc = 0;
+
+ sfont->directory = NULL;
+
+ return sfont;
}
-#else /* not XETEX */
-#ifdef pdfTeX
-sfnt *
-sfnt_open (unsigned char *buffer, integer buflen)
+#else /* not XETEX */
+# ifdef pdfTeX
+sfnt *sfnt_open(unsigned char *buffer, integer buflen)
{
- sfnt *sfont;
- ULONG type;
-
- sfont = xmalloc(sizeof(sfnt));
- sfont->loc = 0;
- sfont->buffer = buffer;
- sfont->buflen = buflen;
-
- type = sfnt_get_ulong(sfont);
-
- if (type == SFNT_TRUETYPE || type == SFNT_MAC_TRUE) {
- sfont->type = SFNT_TYPE_TRUETYPE;
- } else if (type == SFNT_OPENTYPE) {
- sfont->type = SFNT_TYPE_OPENTYPE;
- } else if (type == SFNT_POSTSCRIPT) {
- sfont->type = SFNT_TYPE_POSTSCRIPT;
- } else if (type == SFNT_TTC) {
- sfont->type = SFNT_TYPE_TTC;
- }
-
- sfont->loc=0;
- sfont->directory = NULL;
- return sfont;
+ sfnt *sfont;
+ ULONG type;
+
+ sfont = xmalloc(sizeof(sfnt));
+ sfont->loc = 0;
+ sfont->buffer = buffer;
+ sfont->buflen = buflen;
+
+ type = sfnt_get_ulong(sfont);
+
+ if (type == SFNT_TRUETYPE || type == SFNT_MAC_TRUE) {
+ sfont->type = SFNT_TYPE_TRUETYPE;
+ } else if (type == SFNT_OPENTYPE) {
+ sfont->type = SFNT_TYPE_OPENTYPE;
+ } else if (type == SFNT_POSTSCRIPT) {
+ sfont->type = SFNT_TYPE_POSTSCRIPT;
+ } else if (type == SFNT_TTC) {
+ sfont->type = SFNT_TYPE_TTC;
+ }
+
+ sfont->loc = 0;
+ sfont->directory = NULL;
+ return sfont;
}
-#else
-sfnt *
-sfnt_open (FILE *fp)
+# else
+sfnt *sfnt_open(FILE * fp)
{
- sfnt *sfont;
- ULONG type;
+ sfnt *sfont;
+ ULONG type;
- ASSERT(fp);
+ ASSERT(fp);
- rewind(fp);
+ rewind(fp);
- sfont = NEW(1, sfnt);
+ sfont = NEW(1, sfnt);
- sfont->stream = fp;
+ sfont->stream = fp;
- type = sfnt_get_ulong(sfont);
+ type = sfnt_get_ulong(sfont);
- if (type == SFNT_TRUETYPE || type == SFNT_MAC_TRUE) {
- sfont->type = SFNT_TYPE_TRUETYPE;
- } else if (type == SFNT_OPENTYPE) {
- sfont->type = SFNT_TYPE_OPENTYPE;
- } else if (type == SFNT_POSTSCRIPT) {
- sfont->type = SFNT_TYPE_POSTSCRIPT;
- } else if (type == SFNT_TTC) {
- sfont->type = SFNT_TYPE_TTC;
- }
+ if (type == SFNT_TRUETYPE || type == SFNT_MAC_TRUE) {
+ sfont->type = SFNT_TYPE_TRUETYPE;
+ } else if (type == SFNT_OPENTYPE) {
+ sfont->type = SFNT_TYPE_OPENTYPE;
+ } else if (type == SFNT_POSTSCRIPT) {
+ sfont->type = SFNT_TYPE_POSTSCRIPT;
+ } else if (type == SFNT_TTC) {
+ sfont->type = SFNT_TYPE_TTC;
+ }
- rewind(sfont->stream);
+ rewind(sfont->stream);
- sfont->directory = NULL;
+ sfont->directory = NULL;
- return sfont;
+ return sfont;
}
-#endif
+# endif
#endif
-static void
-release_directory (struct sfnt_table_directory *td)
+static void release_directory(struct sfnt_table_directory *td)
{
- long i;
-
- if (td) {
- if (td->tables) {
- for (i = 0; i < td->num_tables; i++) {
- if (td->tables[i].data)
- RELEASE(td->tables[i].data);
- }
- RELEASE(td->tables);
+ long i;
+
+ if (td) {
+ if (td->tables) {
+ for (i = 0; i < td->num_tables; i++) {
+ if (td->tables[i].data)
+ RELEASE(td->tables[i].data);
+ }
+ RELEASE(td->tables);
+ }
+ if (td->flags)
+ RELEASE(td->flags);
+ RELEASE(td);
}
- if (td->flags)
- RELEASE(td->flags);
- RELEASE(td);
- }
- return;
+ return;
}
-void
-sfnt_close (sfnt *sfont)
+void sfnt_close(sfnt * sfont)
{
- if (sfont) {
- if (sfont->directory)
- release_directory(sfont->directory);
- RELEASE(sfont);
- }
+ if (sfont) {
+ if (sfont->directory)
+ release_directory(sfont->directory);
+ RELEASE(sfont);
+ }
- return;
+ return;
}
-int
-put_big_endian (void *s, LONG q, int n)
+int put_big_endian(void *s, LONG q, int n)
{
- int i;
- char *p;
+ int i;
+ char *p;
- p = (char *) s;
- for (i = n - 1; i >= 0; i--) {
- p[i] = (char) (q & 0xff);
- q >>= 8;
- }
+ p = (char *) s;
+ for (i = n - 1; i >= 0; i--) {
+ p[i] = (char) (q & 0xff);
+ q >>= 8;
+ }
- return n;
+ return n;
}
/* Convert four-byte number to big endianess
* in a machine independent way.
*/
-static void
-convert_tag (char *tag, unsigned long u_tag)
+static void convert_tag(char *tag, unsigned long u_tag)
{
- int i;
+ int i;
- for (i = 3; i >= 0; i--) {
- tag[i] = (char) (u_tag % 256);
- u_tag /= 256;
- }
+ for (i = 3; i >= 0; i--) {
+ tag[i] = (char) (u_tag % 256);
+ u_tag /= 256;
+ }
- return;
+ return;
}
/*
* Computes the max power of 2 <= n
*/
-static unsigned
-max2floor (unsigned n)
+static unsigned max2floor(unsigned n)
{
- int val = 1;
+ int val = 1;
- while (n > 1) {
- n /= 2;
- val *= 2;
- }
+ while (n > 1) {
+ n /= 2;
+ val *= 2;
+ }
- return val;
+ return val;
}
/*
* Computes the log2 of the max power of 2 <= n
*/
-static unsigned
-log2floor (unsigned n)
+static unsigned log2floor(unsigned n)
{
- unsigned val = 0;
+ unsigned val = 0;
- while (n > 1) {
- n /= 2;
- val++;
- }
+ while (n > 1) {
+ n /= 2;
+ val++;
+ }
- return val;
+ return val;
}
-static ULONG
-sfnt_calc_checksum(void *data, ULONG length)
+static ULONG sfnt_calc_checksum(void *data, ULONG length)
{
- ULONG chksum = 0;
- BYTE *p, *endptr;
- int count = 0;
-
- p = (BYTE *) data;
- endptr = p + length;
- while (p < endptr) {
- chksum += (p[0] << (8 * ( 3 - count)));
- count = ((count + 1) & 3);
- p++;
- }
-
- return chksum;
+ ULONG chksum = 0;
+ BYTE *p, *endptr;
+ int count = 0;
+
+ p = (BYTE *) data;
+ endptr = p + length;
+ while (p < endptr) {
+ chksum += (p[0] << (8 * (3 - count)));
+ count = ((count + 1) & 3);
+ p++;
+ }
+
+ return chksum;
}
-static int
-find_table_index (struct sfnt_table_directory *td, const char *tag)
+static int find_table_index(struct sfnt_table_directory *td, const char *tag)
{
- int idx;
+ int idx;
- if (!td)
- return -1;
+ if (!td)
+ return -1;
- for (idx = 0; idx < td->num_tables; idx++) {
- if (!memcmp(td->tables[idx].tag, tag, 4))
- return idx;
- }
+ for (idx = 0; idx < td->num_tables; idx++) {
+ if (!memcmp(td->tables[idx].tag, tag, 4))
+ return idx;
+ }
- return -1;
+ return -1;
}
-void
-sfnt_set_table (sfnt *sfont, const char *tag, void *data, ULONG length)
+void sfnt_set_table(sfnt * sfont, const char *tag, void *data, ULONG length)
{
- struct sfnt_table_directory *td;
- int idx;
+ struct sfnt_table_directory *td;
+ int idx;
- ASSERT(sfont);
+ ASSERT(sfont);
- td = sfont->directory;
- idx = find_table_index(td, tag);
+ td = sfont->directory;
+ idx = find_table_index(td, tag);
- if (idx < 0) {
- idx = td->num_tables;
- td->num_tables++;
- td->tables = RENEW(td->tables, td->num_tables, struct sfnt_table);
- memcpy(td->tables[idx].tag, tag, 4);
- }
+ if (idx < 0) {
+ idx = td->num_tables;
+ td->num_tables++;
+ td->tables = RENEW(td->tables, td->num_tables, struct sfnt_table);
+ memcpy(td->tables[idx].tag, tag, 4);
+ }
- td->tables[idx].check_sum = sfnt_calc_checksum(data, length);
- td->tables[idx].offset = 0L;
- td->tables[idx].length = length;
- td->tables[idx].data = data;
+ td->tables[idx].check_sum = sfnt_calc_checksum(data, length);
+ td->tables[idx].offset = 0L;
+ td->tables[idx].length = length;
+ td->tables[idx].data = data;
- return;
+ return;
}
-ULONG
-sfnt_find_table_len (sfnt *sfont, const char *tag)
+ULONG sfnt_find_table_len(sfnt * sfont, const char *tag)
{
- ULONG length;
- struct sfnt_table_directory *td;
- int idx;
-
- ASSERT(sfont && tag);
-
- td = sfont->directory;
- idx = find_table_index(td, tag);
- if (idx < 0)
- length = 0;
- else {
- length = td->tables[idx].length;
- }
+ ULONG length;
+ struct sfnt_table_directory *td;
+ int idx;
+
+ ASSERT(sfont && tag);
+
+ td = sfont->directory;
+ idx = find_table_index(td, tag);
+ if (idx < 0)
+ length = 0;
+ else {
+ length = td->tables[idx].length;
+ }
- return length;
+ return length;
}
-ULONG
-sfnt_find_table_pos (sfnt *sfont, const char *tag)
+ULONG sfnt_find_table_pos(sfnt * sfont, const char *tag)
{
- ULONG offset;
- struct sfnt_table_directory *td;
- int idx;
-
- ASSERT(sfont && tag);
-
- td = sfont->directory;
- idx = find_table_index(td, tag);
- if (idx < 0)
- offset = 0;
- else {
- offset = td->tables[idx].offset;
- }
+ ULONG offset;
+ struct sfnt_table_directory *td;
+ int idx;
+
+ ASSERT(sfont && tag);
+
+ td = sfont->directory;
+ idx = find_table_index(td, tag);
+ if (idx < 0)
+ offset = 0;
+ else {
+ offset = td->tables[idx].offset;
+ }
- return offset;
+ return offset;
}
-ULONG
-sfnt_locate_table (sfnt *sfont, const char *tag)
+ULONG sfnt_locate_table(sfnt * sfont, const char *tag)
{
- ULONG offset;
+ ULONG offset;
- ASSERT(sfont && tag);
+ ASSERT(sfont && tag);
- offset = sfnt_find_table_pos(sfont, tag);
- if (offset == 0)
- TT_ERROR("sfnt: table not found...");
+ offset = sfnt_find_table_pos(sfont, tag);
+ if (offset == 0)
+ TT_ERROR("sfnt: table not found...");
- sfnt_seek_set(sfont, offset);
+ sfnt_seek_set(sfont, offset);
- return offset;
+ return offset;
}
-int
-sfnt_read_table_directory (sfnt *sfont, ULONG offset)
+int sfnt_read_table_directory(sfnt * sfont, ULONG offset)
{
- struct sfnt_table_directory *td;
- unsigned long i, u_tag;
+ struct sfnt_table_directory *td;
+ unsigned long i, u_tag;
- ASSERT(sfont);
+ ASSERT(sfont);
- if (sfont->directory)
- release_directory(sfont->directory);
- sfont->directory = td = NEW (1, struct sfnt_table_directory);
+ if (sfont->directory)
+ release_directory(sfont->directory);
+ sfont->directory = td = NEW(1, struct sfnt_table_directory);
#ifdef XETEX
- ASSERT(sfont->ft_face);
+ ASSERT(sfont->ft_face);
#elif defined(pdfTeX)
- ASSERT(sfont->buffer);
+ ASSERT(sfont->buffer);
#else
- ASSERT(sfont->stream);
+ ASSERT(sfont->stream);
#endif
- sfnt_seek_set(sfont, offset);
+ sfnt_seek_set(sfont, offset);
- td->version = sfnt_get_ulong(sfont);
- td->num_tables = sfnt_get_ushort(sfont);
- td->search_range = sfnt_get_ushort(sfont);
- td->entry_selector = sfnt_get_ushort(sfont);
- td->range_shift = sfnt_get_ushort(sfont);
+ td->version = sfnt_get_ulong(sfont);
+ td->num_tables = sfnt_get_ushort(sfont);
+ td->search_range = sfnt_get_ushort(sfont);
+ td->entry_selector = sfnt_get_ushort(sfont);
+ td->range_shift = sfnt_get_ushort(sfont);
- td->flags = NEW(td->num_tables, char);
- td->tables = NEW(td->num_tables, struct sfnt_table);
+ td->flags = NEW(td->num_tables, char);
+ td->tables = NEW(td->num_tables, struct sfnt_table);
- for (i = 0; i < td->num_tables; i++) {
- u_tag = sfnt_get_ulong(sfont);
+ for (i = 0; i < td->num_tables; i++) {
+ u_tag = sfnt_get_ulong(sfont);
- convert_tag(td->tables[i].tag, u_tag);
- td->tables[i].check_sum = sfnt_get_ulong(sfont);
- td->tables[i].offset = sfnt_get_ulong(sfont);
- td->tables[i].length = sfnt_get_ulong(sfont);
- td->tables[i].data = NULL;
+ convert_tag(td->tables[i].tag, u_tag);
+ td->tables[i].check_sum = sfnt_get_ulong(sfont);
+ td->tables[i].offset = sfnt_get_ulong(sfont);
+ td->tables[i].length = sfnt_get_ulong(sfont);
+ td->tables[i].data = NULL;
- td->flags[i] = 0;
- }
+ td->flags[i] = 0;
+ }
- td->num_kept_tables = 0;
+ td->num_kept_tables = 0;
- return 0;
+ return 0;
}
-int
-sfnt_require_table (sfnt *sfont, const char *tag, int must_exist)
+int sfnt_require_table(sfnt * sfont, const char *tag, int must_exist)
{
- struct sfnt_table_directory *td;
- int idx;
-
- ASSERT(sfont && sfont->directory);
-
- td = sfont->directory;
- idx = find_table_index(td, tag);
- if (idx < 0) {
- if (must_exist)
- return -1;
- } else {
- td->flags[idx] |= SFNT_TABLE_REQUIRED;
- td->num_kept_tables++;
- }
-
- return 0;
+ struct sfnt_table_directory *td;
+ int idx;
+
+ ASSERT(sfont && sfont->directory);
+
+ td = sfont->directory;
+ idx = find_table_index(td, tag);
+ if (idx < 0) {
+ if (must_exist)
+ return -1;
+ } else {
+ td->flags[idx] |= SFNT_TABLE_REQUIRED;
+ td->num_kept_tables++;
+ }
+
+ return 0;
}
#ifndef pdfTeX
-#include "pdfobj.h"
+# include "pdfobj.h"
#endif
/*
@@ -528,120 +507,115 @@ sfnt_require_table (sfnt *sfont, const char *tag, int must_exist)
*/
#ifdef pdfTeX
-extern pdf_obj *pdf_new_stream(void);
-extern void pdf_add_stream(pdf_obj *, unsigned char *, long);
-extern void pdf_release_obj(pdf_obj *);
-#undef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define STREAM_COMPRESS
+# include "luatexfont.h"
+# undef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+# define STREAM_COMPRESS
#endif
-static unsigned char wbuf[1024], padbytes[4] = {0, 0, 0, 0};
+static unsigned char wbuf[1024], padbytes[4] = { 0, 0, 0, 0 };
-pdf_obj *
-sfnt_create_FontFile_stream (sfnt *sfont)
+pdf_obj *sfnt_create_FontFile_stream(sfnt * sfont)
{
- pdf_obj *stream;
+ pdf_obj *stream;
#ifndef pdfTeX
- pdf_obj *stream_dict;
+ pdf_obj *stream_dict;
#endif
- struct sfnt_table_directory *td;
- long offset, nb_read, length;
- int i, sr;
- char *p;
-
- ASSERT(sfont && sfont->directory);
-
- stream = pdf_new_stream(STREAM_COMPRESS);
-
- td = sfont->directory;
-
- /* Header */
- p = (char *) wbuf;
- p += sfnt_put_ulong (p, td->version);
- p += sfnt_put_ushort(p, td->num_kept_tables);
- sr = max2floor(td->num_kept_tables) * 16;
- p += sfnt_put_ushort(p, sr);
- p += sfnt_put_ushort(p, log2floor(td->num_kept_tables));
- p += sfnt_put_ushort(p, td->num_kept_tables * 16 - sr);
-
- pdf_add_stream(stream, wbuf, 12);
-
- /*
- * Compute start of actual tables (after headers).
- */
- offset = 12 + 16 * td->num_kept_tables;
- for (i = 0; i < td->num_tables; i++) {
- /* This table must exist in FontFile */
- if (td->flags[i] & SFNT_TABLE_REQUIRED) {
- if ((offset % 4) != 0) {
- offset += 4 - (offset % 4);
- }
-
- p = (char *) wbuf;
- memcpy(p, td->tables[i].tag, 4);
- p += 4;
- p += sfnt_put_ulong(p, td->tables[i].check_sum);
- p += sfnt_put_ulong(p, offset);
- p += sfnt_put_ulong(p, td->tables[i].length);
- pdf_add_stream(stream, wbuf, 16);
-
- offset += td->tables[i].length;
+ struct sfnt_table_directory *td;
+ long offset, nb_read, length;
+ int i, sr;
+ char *p;
+
+ ASSERT(sfont && sfont->directory);
+
+ stream = pdf_new_stream(STREAM_COMPRESS);
+
+ td = sfont->directory;
+
+ /* Header */
+ p = (char *) wbuf;
+ p += sfnt_put_ulong(p, td->version);
+ p += sfnt_put_ushort(p, td->num_kept_tables);
+ sr = max2floor(td->num_kept_tables) * 16;
+ p += sfnt_put_ushort(p, sr);
+ p += sfnt_put_ushort(p, log2floor(td->num_kept_tables));
+ p += sfnt_put_ushort(p, td->num_kept_tables * 16 - sr);
+
+ pdf_add_stream(stream, wbuf, 12);
+
+ /*
+ * Compute start of actual tables (after headers).
+ */
+ offset = 12 + 16 * td->num_kept_tables;
+ for (i = 0; i < td->num_tables; i++) {
+ /* This table must exist in FontFile */
+ if (td->flags[i] & SFNT_TABLE_REQUIRED) {
+ if ((offset % 4) != 0) {
+ offset += 4 - (offset % 4);
+ }
+
+ p = (char *) wbuf;
+ memcpy(p, td->tables[i].tag, 4);
+ p += 4;
+ p += sfnt_put_ulong(p, td->tables[i].check_sum);
+ p += sfnt_put_ulong(p, offset);
+ p += sfnt_put_ulong(p, td->tables[i].length);
+ pdf_add_stream(stream, wbuf, 16);
+
+ offset += td->tables[i].length;
+ }
}
- }
-
- offset = 12 + 16 * td->num_kept_tables;
- for (i = 0; i < td->num_tables; i++) {
- if (td->flags[i] & SFNT_TABLE_REQUIRED) {
- if ((offset % 4) != 0) {
- length = 4 - (offset % 4);
- pdf_add_stream(stream, padbytes, length);
- offset += length;
- }
- if (!td->tables[i].data) {
+
+ offset = 12 + 16 * td->num_kept_tables;
+ for (i = 0; i < td->num_tables; i++) {
+ if (td->flags[i] & SFNT_TABLE_REQUIRED) {
+ if ((offset % 4) != 0) {
+ length = 4 - (offset % 4);
+ pdf_add_stream(stream, padbytes, length);
+ offset += length;
+ }
+ if (!td->tables[i].data) {
#ifdef XETEX
- if (!sfont->ft_face)
+ if (!sfont->ft_face)
#elif defined(pdfTeX)
- if (!sfont->buffer)
+ if (!sfont->buffer)
#else
- if (!sfont->stream)
+ if (!sfont->stream)
#endif
- {
- pdf_release_obj(stream);
- TT_ERROR("Font file not opened or already closed...");
- return NULL;
- }
-
- length = td->tables[i].length;
- sfnt_seek_set(sfont, td->tables[i].offset);
- while (length > 0) {
- nb_read = sfnt_read(wbuf, MIN(length, 1024), sfont);
- if (nb_read < 0) {
- pdf_release_obj(stream);
- TT_ERROR("Reading file failed...");
- return NULL;
- } else if (nb_read > 0) {
- pdf_add_stream(stream, wbuf, nb_read);
- }
- length -= nb_read;
- }
- } else {
- pdf_add_stream(stream,
- (unsigned char *)td->tables[i].data,
- td->tables[i].length);
- RELEASE(td->tables[i].data);
- td->tables[i].data = NULL;
- }
- /* Set offset for next table */
- offset += td->tables[i].length;
+ {
+ pdf_release_obj(stream);
+ TT_ERROR("Font file not opened or already closed...");
+ return NULL;
+ }
+
+ length = td->tables[i].length;
+ sfnt_seek_set(sfont, td->tables[i].offset);
+ while (length > 0) {
+ nb_read = sfnt_read(wbuf, MIN(length, 1024), sfont);
+ if (nb_read < 0) {
+ pdf_release_obj(stream);
+ TT_ERROR("Reading file failed...");
+ return NULL;
+ } else if (nb_read > 0) {
+ pdf_add_stream(stream, wbuf, nb_read);
+ }
+ length -= nb_read;
+ }
+ } else {
+ pdf_add_stream(stream,
+ (unsigned char *) td->tables[i].data,
+ td->tables[i].length);
+ RELEASE(td->tables[i].data);
+ td->tables[i].data = NULL;
+ }
+ /* Set offset for next table */
+ offset += td->tables[i].length;
+ }
}
- }
#ifndef pdfTeX
- stream_dict = pdf_stream_dict(stream);
- pdf_add_dict(stream_dict,
- pdf_new_name("Length1"),
- pdf_new_number(offset));
+ stream_dict = pdf_stream_dict(stream);
+ pdf_add_dict(stream_dict, pdf_new_name("Length1"), pdf_new_number(offset));
#endif
- return stream;
+ return stream;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/sfnt.h b/Build/source/texk/web2c/luatexdir/font/sfnt.h
index 8db54dd9c39..87b373730be 100644
--- a/Build/source/texk/web2c/luatexdir/font/sfnt.h
+++ b/Build/source/texk/web2c/luatexdir/font/sfnt.h
@@ -1,197 +1,194 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/sfnt.h,v 1.9 2004/09/11 14:50:29 hirata Exp $
+/* sfnt.h
- This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+ Copyright 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
- the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: sfnt.h 1223 2008-05-02 13:39:55Z oneiros $ */
#ifndef _SFNT_H_
-#define _SFNT_H_
+# define _SFNT_H_
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H_ */
+# if HAVE_CONFIG_H
+# include "config.h"
+# endif /* HAVE_CONFIG_H_ */
-#ifndef pdfTeX
-#include "mfileio.h"
-#include "numbers.h"
-#include "pdfobj.h"
-#endif
+# ifndef pdfTeX
+# include "mfileio.h"
+# include "numbers.h"
+# include "pdfobj.h"
+# endif
-#ifdef XETEX
-#include "ft2build.h"
-#include FT_FREETYPE_H
-#include FT_TRUETYPE_TABLES_H
-#endif
+# ifdef XETEX
+# include "ft2build.h"
+# include FT_FREETYPE_H
+# include FT_TRUETYPE_TABLES_H
+# endif
/* Data Types as described in Apple's TTRefMan */
-typedef unsigned char BYTE;
-typedef signed char ICHAR;
+typedef unsigned char BYTE;
+typedef signed char ICHAR;
typedef unsigned short USHORT;
-typedef signed short SHORT;
-typedef unsigned long ULONG;
-typedef signed long LONG;
-typedef unsigned long Fixed; /* 16.16-bit signed fixed-point number */
-typedef short FWord;
+typedef signed short SHORT;
+typedef unsigned long ULONG;
+typedef signed long LONG;
+typedef unsigned long Fixed; /* 16.16-bit signed fixed-point number */
+typedef short FWord;
typedef unsigned short uFWord;
-typedef short F2Dot14; /* 16-bit signed fixed number with the low
- 14 bits representing fraction. */
-
-struct sfnt_table
-{
- /* table header */
- char tag[4];
- ULONG check_sum;
- ULONG offset;
- ULONG length;
- char *data; /* table data */
+typedef short F2Dot14; /* 16-bit signed fixed number with the low
+ 14 bits representing fraction. */
+
+struct sfnt_table {
+ /* table header */
+ char tag[4];
+ ULONG check_sum;
+ ULONG offset;
+ ULONG length;
+ char *data; /* table data */
};
-#define SFNT_TABLE_REQUIRED (1 << 0)
-
-struct sfnt_table_directory
-{
- ULONG version; /* Fixed for Win */
- USHORT num_tables;
- USHORT search_range;
- USHORT entry_selector;
- USHORT range_shift;
- USHORT num_kept_tables; /* number of kept tables */
- char *flags; /* keep or omit */
- struct sfnt_table *tables;
+# define SFNT_TABLE_REQUIRED (1 << 0)
+
+struct sfnt_table_directory {
+ ULONG version; /* Fixed for Win */
+ USHORT num_tables;
+ USHORT search_range;
+ USHORT entry_selector;
+ USHORT range_shift;
+ USHORT num_kept_tables; /* number of kept tables */
+ char *flags; /* keep or omit */
+ struct sfnt_table *tables;
};
/* sfnt resource */
-#define SFNT_TYPE_TRUETYPE (1 << 0)
-#define SFNT_TYPE_OPENTYPE (1 << 1)
-#define SFNT_TYPE_POSTSCRIPT (1 << 2)
-#define SFNT_TYPE_TTC (1 << 4)
-
-typedef struct
-{
- int type;
- struct sfnt_table_directory *directory;
-#ifdef XETEX
- FT_Face ft_face;
- long loc;
-#elif defined(pdfTeX)
- BYTE *buffer;
- long buflen;
- long loc;
-#else
- FILE *stream;
-#endif
+# define SFNT_TYPE_TRUETYPE (1 << 0)
+# define SFNT_TYPE_OPENTYPE (1 << 1)
+# define SFNT_TYPE_POSTSCRIPT (1 << 2)
+# define SFNT_TYPE_TTC (1 << 4)
+
+typedef struct {
+ int type;
+ struct sfnt_table_directory *directory;
+# ifdef XETEX
+ FT_Face ft_face;
+ long loc;
+# elif defined(pdfTeX)
+ BYTE *buffer;
+ long buflen;
+ long loc;
+# else
+ FILE *stream;
+# endif
} sfnt;
/* Convert sfnt "fixed" type to double */
-#define fixed(a) ((double)((a)%0x10000L)/(double)(0x10000L) + \
+# define fixed(a) ((double)((a)%0x10000L)/(double)(0x10000L) + \
(a)/0x10000L - (((a)/0x10000L > 0x7fffL) ? 0x10000L : 0))
-#ifdef XETEX
-UNSIGNED_BYTE ft_unsigned_byte(sfnt* f);
-SIGNED_BYTE ft_signed_byte(sfnt* f);
-UNSIGNED_PAIR ft_unsigned_pair(sfnt* f);
-SIGNED_PAIR ft_signed_pair(sfnt* f);
-UNSIGNED_QUAD ft_unsigned_quad(sfnt* f);
-unsigned long ft_read(unsigned char* buf, unsigned long len, sfnt* f);
-
-#define sfnt_get_byte(s) ((BYTE) ft_unsigned_byte(s))
-#define sfnt_get_char(s) ((ICHAR) ft_signed_byte (s))
-#define sfnt_get_ushort(s) ((USHORT) ft_unsigned_pair(s))
-#define sfnt_get_short(s) ((SHORT) ft_signed_pair (s))
-#define sfnt_get_ulong(s) ((ULONG) ft_unsigned_quad(s))
-#define sfnt_get_long(s) ((LONG) ft_signed_quad (s))
-
-#define sfnt_seek_set(s,o) (s)->loc = (o)
-#define sfnt_read(b,l,s) ft_read((b), (l), (s))
-#elif defined(pdfTeX)
-BYTE get_unsigned_byte(sfnt* f);
-ICHAR get_signed_byte(sfnt* f);
-USHORT get_unsigned_pair(sfnt* f);
-SHORT get_signed_pair(sfnt* f);
-ULONG get_unsigned_quad(sfnt* f);
-int do_sfnt_read (unsigned char *dest, int len, sfnt *f);
-
-#define sfnt_get_byte(s) ((BYTE) get_unsigned_byte(s))
-#define sfnt_get_char(s) ((ICHAR) get_signed_byte (s))
-#define sfnt_get_ushort(s) ((USHORT) get_unsigned_pair(s))
-#define sfnt_get_short(s) ((SHORT) get_signed_pair (s))
-#define sfnt_get_ulong(s) ((ULONG) get_unsigned_quad(s))
-#define sfnt_get_long(s) ((LONG) get_signed_quad (s))
-
-#define sfnt_seek_set(s,o) (s)->loc = (o)
-#define sfnt_read(b,l,s) do_sfnt_read((b), (l), (s))
-#else
+# ifdef XETEX
+UNSIGNED_BYTE ft_unsigned_byte(sfnt * f);
+SIGNED_BYTE ft_signed_byte(sfnt * f);
+UNSIGNED_PAIR ft_unsigned_pair(sfnt * f);
+SIGNED_PAIR ft_signed_pair(sfnt * f);
+UNSIGNED_QUAD ft_unsigned_quad(sfnt * f);
+unsigned long ft_read(unsigned char *buf, unsigned long len, sfnt * f);
+
+# define sfnt_get_byte(s) ((BYTE) ft_unsigned_byte(s))
+# define sfnt_get_char(s) ((ICHAR) ft_signed_byte (s))
+# define sfnt_get_ushort(s) ((USHORT) ft_unsigned_pair(s))
+# define sfnt_get_short(s) ((SHORT) ft_signed_pair (s))
+# define sfnt_get_ulong(s) ((ULONG) ft_unsigned_quad(s))
+# define sfnt_get_long(s) ((LONG) ft_signed_quad (s))
+
+# define sfnt_seek_set(s,o) (s)->loc = (o)
+# define sfnt_read(b,l,s) ft_read((b), (l), (s))
+# elif defined(pdfTeX)
+BYTE get_unsigned_byte(sfnt * f);
+ICHAR get_signed_byte(sfnt * f);
+USHORT get_unsigned_pair(sfnt * f);
+SHORT get_signed_pair(sfnt * f);
+ULONG get_unsigned_quad(sfnt * f);
+int do_sfnt_read(unsigned char *dest, int len, sfnt * f);
+
+# define sfnt_get_byte(s) ((BYTE) get_unsigned_byte(s))
+# define sfnt_get_char(s) ((ICHAR) get_signed_byte (s))
+# define sfnt_get_ushort(s) ((USHORT) get_unsigned_pair(s))
+# define sfnt_get_short(s) ((SHORT) get_signed_pair (s))
+# define sfnt_get_ulong(s) ((ULONG) get_unsigned_quad(s))
+# define sfnt_get_long(s) ((LONG) get_signed_quad (s))
+
+# define sfnt_seek_set(s,o) (s)->loc = (o)
+# define sfnt_read(b,l,s) do_sfnt_read((b), (l), (s))
+# else
/* get_***_*** from numbers.h */
-#define sfnt_get_byte(s) ((BYTE) get_unsigned_byte((s)->stream))
-#define sfnt_get_char(s) ((ICHAR) get_signed_byte ((s)->stream))
-#define sfnt_get_ushort(s) ((USHORT) get_unsigned_pair((s)->stream))
-#define sfnt_get_short(s) ((SHORT) get_signed_pair ((s)->stream))
-#define sfnt_get_ulong(s) ((ULONG) get_unsigned_quad((s)->stream))
-#define sfnt_get_long(s) ((LONG) get_signed_quad ((s)->stream))
-
-#define sfnt_seek_set(s,o) seek_absolute((s)->stream, (o))
-#define sfnt_read(b,l,s) fread((b), 1, (l), (s)->stream)
-#endif
-
-extern int put_big_endian (void *s, LONG q, int n);
-
-#define sfnt_put_ushort(s,v) put_big_endian((s), v, 2);
-#define sfnt_put_short(s,v) put_big_endian((s), v, 2);
-#define sfnt_put_ulong(s,v) put_big_endian((s), v, 4);
-#define sfnt_put_long(s,v) put_big_endian((s), v, 4);
-
-#ifdef XETEX
-extern sfnt *sfnt_open (FT_Face face, int accept_types);
-#elif defined(pdfTeX)
-extern sfnt *sfnt_open (unsigned char *buffer, integer buflen);
-#else
-extern sfnt *sfnt_open (FILE *fp);
-#endif
-extern void sfnt_close (sfnt *sfont);
+# define sfnt_get_byte(s) ((BYTE) get_unsigned_byte((s)->stream))
+# define sfnt_get_char(s) ((ICHAR) get_signed_byte ((s)->stream))
+# define sfnt_get_ushort(s) ((USHORT) get_unsigned_pair((s)->stream))
+# define sfnt_get_short(s) ((SHORT) get_signed_pair ((s)->stream))
+# define sfnt_get_ulong(s) ((ULONG) get_unsigned_quad((s)->stream))
+# define sfnt_get_long(s) ((LONG) get_signed_quad ((s)->stream))
+
+# define sfnt_seek_set(s,o) seek_absolute((s)->stream, (o))
+# define sfnt_read(b,l,s) fread((b), 1, (l), (s)->stream)
+# endif
+
+extern int put_big_endian(void *s, LONG q, int n);
+
+# define sfnt_put_ushort(s,v) put_big_endian((s), v, 2);
+# define sfnt_put_short(s,v) put_big_endian((s), v, 2);
+# define sfnt_put_ulong(s,v) put_big_endian((s), v, 4);
+# define sfnt_put_long(s,v) put_big_endian((s), v, 4);
+
+# ifdef XETEX
+extern sfnt *sfnt_open(FT_Face face, int accept_types);
+# elif defined(pdfTeX)
+extern sfnt *sfnt_open(unsigned char *buffer, integer buflen);
+# else
+extern sfnt *sfnt_open(FILE * fp);
+# endif
+extern void sfnt_close(sfnt * sfont);
/* table directory */
-extern int sfnt_read_table_directory (sfnt *sfont, ULONG offset);
-extern ULONG sfnt_find_table_len (sfnt *sfont, const char *tag);
-extern ULONG sfnt_find_table_pos (sfnt *sfont, const char *tag);
-extern ULONG sfnt_locate_table (sfnt *sfont, const char *tag);
-
-extern void sfnt_set_table (sfnt *sfont,
- const char *tag, void *data, ULONG length);
-extern int sfnt_require_table (sfnt *sfont, const char *tag, int must_exist);
-
-#ifdef pdfTeX
-typedef struct
-{
- ULONG length;
- BYTE *data;
+extern int sfnt_read_table_directory(sfnt * sfont, ULONG offset);
+extern ULONG sfnt_find_table_len(sfnt * sfont, const char *tag);
+extern ULONG sfnt_find_table_pos(sfnt * sfont, const char *tag);
+extern ULONG sfnt_locate_table(sfnt * sfont, const char *tag);
+
+extern void sfnt_set_table(sfnt * sfont,
+ const char *tag, void *data, ULONG length);
+extern int sfnt_require_table(sfnt * sfont, const char *tag, int must_exist);
+
+# ifdef pdfTeX
+typedef struct {
+ ULONG length;
+ BYTE *data;
} pdf_obj;
-#define ASSERT(a) assert(a)
-#define RELEASE(a) free(a)
-#define NEW(a,b) xmalloc((a)*sizeof(b))
-#define RENEW(a,b,c) xrealloc(a, ((b)*sizeof(c)))
-#define TT_ERROR pdftex_fail
-#define WARN printf
+# define ASSERT(a) assert(a)
+# define RELEASE(a) free(a)
+# define NEW(a,b) xmalloc((a)*sizeof(b))
+# define RENEW(a,b,c) xrealloc(a, ((b)*sizeof(c)))
+# define TT_ERROR pdftex_fail
+# define WARN printf
-#endif
+# endif
-extern pdf_obj *sfnt_create_FontFile_stream (sfnt *sfont);
+extern pdf_obj *sfnt_create_FontFile_stream(sfnt * sfont);
-#endif /* _SFNT_H_ */
+#endif /* _SFNT_H_ */
diff --git a/Build/source/texk/web2c/luatexdir/font/subfont.c b/Build/source/texk/web2c/luatexdir/font/subfont.c
index 836985c10fd..fecd5ed7857 100644
--- a/Build/source/texk/web2c/luatexdir/font/subfont.c
+++ b/Build/source/texk/web2c/luatexdir/font/subfont.c
@@ -1,26 +1,29 @@
-/*
-Copyright (c) 2005-2006 Han The Thanh, <thanh@pdftex.org>
+/* subfont.c
+
+ Copyright 2005-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include <string.h>
+static const char _svn_version[] =
+ "$Id: subfont.c 1783 2009-01-18 12:51:01Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/subfont.c $";
+
static struct avl_table *sfd_tree = NULL;
static unsigned char *sfd_buffer = NULL;
@@ -30,7 +33,7 @@ static integer sfd_curbyte = 0;
#define SFD_BUF_SIZE SMALL_BUF_SIZE
#define sfd_close() xfclose(sfd_file, cur_file_name)
-#define sfd_open() open_input(&sfd_file, kpse_sfd_format, FOPEN_RBIN_MODE)
+#define sfd_open() (sfd_file = fopen((char *) nameoffile + 1, FOPEN_RBIN_MODE))
#define sfd_read_file() readbinfile(sfd_file,&sfd_buffer,&sfd_size)
#define sfd_getchar() sfd_buffer[sfd_curbyte++]
@@ -40,11 +43,11 @@ static integer sfd_curbyte = 0;
static FILE *sfd_file;
static char sfd_line[SFD_BUF_SIZE];
-static subfont_entry *new_subfont_entry (void)
+static subfont_entry *new_subfont_entry(void)
{
int i;
subfont_entry *subfont;
- subfont = xtalloc (1, subfont_entry);
+ subfont = xtalloc(1, subfont_entry);
subfont->infix = NULL;
for (i = 0; i < 256; ++i)
subfont->charcodes[i] = -1; /* unassigned */
@@ -52,16 +55,16 @@ static subfont_entry *new_subfont_entry (void)
return subfont;
}
-static sfd_entry *new_sfd_entry (void)
+static sfd_entry *new_sfd_entry(void)
{
sfd_entry *sfd;
- sfd = xtalloc (1, sfd_entry);
+ sfd = xtalloc(1, sfd_entry);
sfd->name = NULL;
sfd->subfont = NULL;
return sfd;
}
-static void destroy_sfd_entry (void *pa, void *pb)
+static void destroy_sfd_entry(void *pa, void *pb)
{
subfont_entry *p, *q;
sfd_entry *sfd;
@@ -69,132 +72,139 @@ static void destroy_sfd_entry (void *pa, void *pb)
p = sfd->subfont;
while (p != NULL) {
q = p->next;
- xfree (p->infix);
- xfree (p);
+ xfree(p->infix);
+ xfree(p);
p = q;
}
- xfree (sfd->name);
+ xfree(sfd->name);
}
-static int comp_sfd_entry (const void *pa, const void *pb, void *p)
+static int comp_sfd_entry(const void *pa, const void *pb, void *p)
{
- return strcmp (((const sfd_entry *) pa)->name,
- ((const sfd_entry *) pb)->name);
+ return strcmp(((const sfd_entry *) pa)->name,
+ ((const sfd_entry *) pb)->name);
}
-void sfd_free (void)
+void sfd_free(void)
{
if (sfd_tree != NULL)
- avl_destroy (sfd_tree, destroy_sfd_entry);
+ avl_destroy(sfd_tree, destroy_sfd_entry);
}
-static void sfd_getline (boolean expect_eof)
+static void sfd_getline(boolean expect_eof)
{
char *p;
int c;
restart:
- if (sfd_eof ()) {
+ if (sfd_eof()) {
if (expect_eof)
return;
else
- pdftex_fail ("unexpected end of file");
+ pdftex_fail("unexpected end of file");
}
p = sfd_line;
do {
- c = sfd_getchar ();
- append_char_to_buf (c, p, sfd_line, SFD_BUF_SIZE);
+ c = sfd_getchar();
+ append_char_to_buf(c, p, sfd_line, SFD_BUF_SIZE);
} while (c != 10 && !sfd_eof());
- append_eol (p, sfd_line, SFD_BUF_SIZE);
+ append_eol(p, sfd_line, SFD_BUF_SIZE);
if (p - sfd_line < 2 || *sfd_line == '#')
goto restart;
}
-static sfd_entry *read_sfd (char *sfd_name)
+static sfd_entry *read_sfd(char *sfd_name)
{
void **aa;
sfd_entry *sfd, tmp_sfd;
subfont_entry *sf;
- char *ftemp = NULL;
+ char *ftemp = NULL;
char buf[SMALL_BUF_SIZE], *p;
long int i, j, k;
int n;
- int callback_id=0;
- int file_opened=0;
+ int callback_id = 0;
+ int file_opened = 0;
/* check whether this sfd has been read */
tmp_sfd.name = sfd_name;
if (sfd_tree == NULL) {
- sfd_tree = avl_create (comp_sfd_entry, NULL, &avl_xallocator);
- assert (sfd_tree != NULL);
+ sfd_tree = avl_create(comp_sfd_entry, NULL, &avl_xallocator);
+ assert(sfd_tree != NULL);
}
- sfd = (sfd_entry *) avl_find (sfd_tree, &tmp_sfd);
+ sfd = (sfd_entry *) avl_find(sfd_tree, &tmp_sfd);
if (sfd != NULL)
return sfd;
- set_cur_file_name (sfd_name);
- if (sfd_buffer!=NULL) {
- xfree(sfd_buffer);
- sfd_buffer=NULL;
+ set_cur_file_name(sfd_name);
+ if (sfd_buffer != NULL) {
+ xfree(sfd_buffer);
+ sfd_buffer = NULL;
}
- sfd_curbyte=0;
- sfd_size=0;
+ sfd_curbyte = 0;
+ sfd_size = 0;
- callback_id=callback_defined(find_sfd_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->S",cur_file_name,&ftemp)) {
- if(ftemp!=NULL&&strlen(ftemp)) {
- if (cur_file_name)
- free(cur_file_name);
- cur_file_name = xstrdup(ftemp);
- free(ftemp);
- }
- }
- }
- callback_id=callback_defined(read_sfd_file_callback);
- if (callback_id>0) {
- if(! (run_callback(callback_id,"S->bSd",cur_file_name,
- &file_opened, &sfd_buffer,&sfd_size) &&
- file_opened &&
- sfd_size>0 ) ) {
- pdftex_warn ("cannot open SFD file for reading");
- cur_file_name = NULL;
- return NULL;
- }
- sfd_read_file();
- sfd_close();
+ callback_id = callback_defined(find_sfd_file_callback);
+ if (callback_id > 0) {
+ if (run_callback(callback_id, "S->S", cur_file_name, &ftemp)) {
+ if (ftemp != NULL && strlen(ftemp)) {
+ if (cur_file_name)
+ free(cur_file_name);
+ cur_file_name = xstrdup(ftemp);
+ free(ftemp);
+ }
+ }
+ } else {
+ cur_file_name = kpse_find_file(cur_file_name, kpse_sfd_format, 0);
+ }
+ callback_id = callback_defined(read_sfd_file_callback);
+ if (callback_id > 0) {
+ if (!(run_callback(callback_id, "S->bSd", cur_file_name,
+ &file_opened, &sfd_buffer, &sfd_size) &&
+ file_opened && sfd_size > 0)) {
+ pdftex_warn("cannot open SFD file for reading");
+ cur_file_name = NULL;
+ return NULL;
+ }
+ } else {
+ if (!sfd_open()) {
+ pdftex_warn("cannot open SFD file for reading");
+ cur_file_name = NULL;
+ return NULL;
+ }
+ sfd_read_file();
+ sfd_close();
}
- tex_printf ("{");
- tex_printf (cur_file_name);
- sfd = new_sfd_entry ();
- sfd->name = xstrdup (sfd_name);
- while (!sfd_eof ()) {
- sfd_getline (true);
+ tex_printf("{");
+ tex_printf("%s", cur_file_name);
+ sfd = new_sfd_entry();
+ sfd->name = xstrdup(sfd_name);
+ while (!sfd_eof()) {
+ sfd_getline(true);
if (*sfd_line == 10) /* empty line indicating eof */
break;
- sf = new_subfont_entry ();
+ sf = new_subfont_entry();
sf->next = sfd->subfont;
sfd->subfont = sf;
- sscanf (sfd_line, "%s %n", buf, &n);
- sf->infix = xstrdup (buf);
+ sscanf(sfd_line, "%s %n", buf, &n);
+ sf->infix = xstrdup(buf);
p = sfd_line + n; /* skip to the next word */
k = 0;
read_ranges:
for (;;) {
if (*p == '\\') { /* continue on next line */
- sfd_getline (false);
+ sfd_getline(false);
p = sfd_line;
goto read_ranges;
} else if (*p == 0) /* end of subfont */
break;
- if (sscanf (p, " %li %n", &i, &n) == 0)
- pdftex_fail ("invalid token:\n%s", p);
+ if (sscanf(p, " %li %n", &i, &n) == 0)
+ pdftex_fail("invalid token:\n%s", p);
p += n;
if (*p == ':') { /* offset */
k = i;
p++;
} else if (*p == '_') { /* range */
- if (sscanf (p + 1, " %li %n", &j, &n) == 0)
- pdftex_fail ("invalid token:\n%s", p);
+ if (sscanf(p + 1, " %li %n", &j, &n) == 0)
+ pdftex_fail("invalid token:\n%s", p);
if (i > j || k + (j - i) > 255)
- pdftex_fail ("invalid range:\n%s", p);
+ pdftex_fail("invalid range:\n%s", p);
while (i <= j)
sf->charcodes[k++] = i++;
p += n + 1;
@@ -202,13 +212,13 @@ static sfd_entry *read_sfd (char *sfd_name)
sf->charcodes[k++] = i;
}
}
- tex_printf ("}");
- aa = avl_probe (sfd_tree, sfd);
- assert (aa != NULL);
+ tex_printf("}");
+ aa = avl_probe(sfd_tree, sfd);
+ assert(aa != NULL);
return sfd;
}
-boolean handle_subfont_fm (fm_entry * fm, int mode)
+boolean handle_subfont_fm(fm_entry * fm, int mode)
{
size_t l;
char *p, *q, *r;
@@ -216,28 +226,28 @@ boolean handle_subfont_fm (fm_entry * fm, int mode)
subfont_entry *sf;
fm_entry *fm2;
char buf[SMALL_BUF_SIZE];
- assert (fm->tfm_name != NULL);
+ assert(fm->tfm_name != NULL);
p = fm->tfm_name;
- q = strchr (p, '@'); /* search for the first '@' */
+ q = strchr(p, '@'); /* search for the first '@' */
if (q == NULL)
return false;
- r = strchr (q + 1, '@'); /* search for the second '@' */
+ r = strchr(q + 1, '@'); /* search for the second '@' */
if (r == NULL)
return false;
if (q <= p || r <= q + 1 /* prefix or sfd name is empty */
- || r - p != strlen (p) - 1) /* or the second '@' is not the last char yet */
+ || r - p != (int) strlen(p) - 1) /* or the second '@' is not the last char yet */
return false;
l = r - (q + 1); /* length of sfd name */
- strncpy (buf, q + 1, l);
+ strncpy(buf, q + 1, l);
buf[l] = 0;
- check_buf(strlen(buf) + 4, SMALL_BUF_SIZE);
- strcat (buf, ".sfd");
- sfd = read_sfd (buf);
+ check_buf(strlen(buf) + 4, SMALL_BUF_SIZE);
+ strcat(buf, ".sfd");
+ sfd = read_sfd(buf);
if (sfd == NULL)
return false;
/* at this point we know fm is a subfont */
- set_subfont (fm);
- xfree (fm->ps_name);
+ set_subfont(fm);
+ xfree(fm->ps_name);
fm->ps_name = NULL;
/* set default values for PidEid */
if (fm->pid == -1) {
@@ -246,19 +256,19 @@ boolean handle_subfont_fm (fm_entry * fm, int mode)
}
l = q - p; /* length of base tfm name (prefix) */
for (sf = sfd->subfont; sf != NULL; sf = sf->next) {
- strncpy (buf, p, l);
+ strncpy(buf, p, l);
buf[l] = 0;
- strcat (buf, sf->infix);
- fm2 = new_fm_entry ();
- fm2->tfm_name = xstrdup (buf);
- fm2->ff_name = xstrdup (fm->ff_name);
+ strcat(buf, sf->infix);
+ fm2 = new_fm_entry();
+ fm2->tfm_name = xstrdup(buf);
+ fm2->ff_name = xstrdup(fm->ff_name);
fm2->type = fm->type;
fm2->pid = fm->pid;
fm2->eid = fm->eid;
fm2->subfont = sf;
- if (avl_do_entry (fm2, mode) != 0) /* try to insert the entry */
- delete_fm_entry (fm2); /* delete it if failed */
+ if (avl_do_entry(fm2, mode) != 0) /* try to insert the entry */
+ delete_fm_entry(fm2); /* delete it if failed */
}
- delete_fm_entry (fm);
+ delete_fm_entry(fm);
return true;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.c b/Build/source/texk/web2c/luatexdir/font/texfont.c
index 150c2cba769..1daf6a5b56b 100644
--- a/Build/source/texk/web2c/luatexdir/font/texfont.c
+++ b/Build/source/texk/web2c/luatexdir/font/texfont.c
@@ -1,23 +1,21 @@
-/*
- Copyright (c) 1996-2006 Taco Hoekwater <taco@luatex.org>
-
- This file is part of LuaTeX.
-
- LuaTeX is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- LuaTeX is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LuaTeX; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- $Id: texfont.c 1013 2008-02-14 00:09:02Z oneiros $ */
+/* texfont.c Main font API implementation for the pascal parts
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
/* Main font API implementation for the pascal parts */
@@ -36,6 +34,9 @@
#include "ptexlib.h"
#include "luatex-api.h"
+static const char _svn_version[] =
+ "$Id: texfont.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/texfont.c $";
+
#define proper_char_index(c) (c<=font_ec(f) && c>=font_bc(f))
#define dxfree(a,b) { xfree(a); a = b ; }
#define do_realloc(a,b,d) a = xrealloc(a,(b)*sizeof(d))
@@ -45,1050 +46,1460 @@ texfont **font_tables = NULL;
static integer font_arr_max = 0;
static integer font_id_maxval = 0;
-static void grow_font_table (integer id) {
- int j;
- if (id>=font_arr_max) {
- font_bytes += (font_arr_max-id+8)*sizeof(texfont *);
- font_tables = xrealloc(font_tables,(id+8)*sizeof(texfont *));
- j = 8;
- while (j--) {
- font_tables[id+j] = NULL;
+extern extinfo *get_charinfo_vert_variants(charinfo * ci);
+extern extinfo *get_charinfo_hor_variants(charinfo * ci);
+extern void set_charinfo_hor_variants(charinfo * ci, extinfo * ext);
+extern void set_charinfo_vert_variants(charinfo * ci, extinfo * ext);
+
+extern extinfo *copy_variants(extinfo * o);
+
+
+static void grow_font_table(integer id)
+{
+ int j;
+ if (id >= font_arr_max) {
+ font_bytes += (font_arr_max - id + 8) * sizeof(texfont *);
+ font_tables = xrealloc(font_tables, (id + 8) * sizeof(texfont *));
+ j = 8;
+ while (j--) {
+ font_tables[id + j] = NULL;
+ }
+ font_arr_max = id + 8;
}
- font_arr_max = id+8;
- }
}
-integer
-new_font_id (void) {
- int i;
- for (i=0;i<font_arr_max;i++) {
- if (font_tables[i]==NULL) {
- break;
+integer new_font_id(void)
+{
+ int i;
+ for (i = 0; i < font_arr_max; i++) {
+ if (font_tables[i] == NULL) {
+ break;
+ }
}
- }
- if (i>=font_arr_max)
- grow_font_table (i);
- if (i>font_id_maxval)
+ if (i >= font_arr_max)
+ grow_font_table(i);
+ if (i > font_id_maxval)
+ font_id_maxval = i;
+ return i;
+}
+
+integer max_font_id(void)
+{
+ return font_id_maxval;
+}
+
+void set_max_font_id(integer i)
+{
font_id_maxval = i;
- return i;
-}
-
-integer
-max_font_id (void) {
- return font_id_maxval;
-}
-
-void
-set_max_font_id (integer i) {
- font_id_maxval = i;
-}
-
-integer
-new_font (void) {
- int k;
- int id;
- charinfo *ci;
- id = new_font_id();
- font_bytes += sizeof(texfont);
- /* most stuff is zero */
- font_tables[id] = xcalloc(1,sizeof(texfont));
- font_tables[id]->_font_name = NULL;
- font_tables[id]->_font_area = NULL;
- font_tables[id]->_font_filename = NULL;
- font_tables[id]->_font_fullname = NULL;
- font_tables[id]->_font_encodingname = NULL;
- font_tables[id]->_font_cidregistry = NULL;
- font_tables[id]->_font_cidordering = NULL;
- font_tables[id]->_left_boundary = NULL;
- font_tables[id]->_right_boundary = NULL;
- font_tables[id]->_param_base = NULL;
-
- set_font_bc(id, 1); /* ec = 0 */
- set_hyphen_char(id,'-');
- set_skew_char(id,-1);
-
- /* allocate eight values including 0 */
- set_font_params(id,7);
- for (k=0;k<=7;k++) {
- set_font_param(id,k,0);
- }
- /* character info zero is reserved for notdef */
- font_tables[id]->characters = new_sa_tree(1, 0); /* stack size 1, default item value 0 */
+}
- ci = xcalloc(1,sizeof(charinfo));
- set_charinfo_name(ci,xstrdup(".notdef"));
- font_tables[id]->charinfo = ci;
- font_tables[id]->charinfo_cache = NULL;
+integer new_font(void)
+{
+ int k;
+ int id;
+ charinfo *ci;
+ id = new_font_id();
+ font_bytes += sizeof(texfont);
+ /* most stuff is zero */
+ font_tables[id] = xcalloc(1, sizeof(texfont));
+ font_tables[id]->_font_name = NULL;
+ font_tables[id]->_font_area = NULL;
+ font_tables[id]->_font_filename = NULL;
+ font_tables[id]->_font_fullname = NULL;
+ font_tables[id]->_font_encodingname = NULL;
+ font_tables[id]->_font_cidregistry = NULL;
+ font_tables[id]->_font_cidordering = NULL;
+ font_tables[id]->_left_boundary = NULL;
+ font_tables[id]->_right_boundary = NULL;
+ font_tables[id]->_param_base = NULL;
+ font_tables[id]->_math_param_base = NULL;
+
+ set_font_bc(id, 1); /* ec = 0 */
+ set_hyphen_char(id, '-');
+ set_skew_char(id, -1);
+
+ /* allocate eight values including 0 */
+ set_font_params(id, 7);
+ for (k = 0; k <= 7; k++) {
+ set_font_param(id, k, 0);
+ }
+ /* character info zero is reserved for notdef */
+ font_tables[id]->characters = new_sa_tree(1, 0); /* stack size 1, default item value 0 */
+
+ ci = xcalloc(1, sizeof(charinfo));
+ set_charinfo_name(ci, xstrdup(".notdef"));
+ font_tables[id]->charinfo = ci;
+ font_tables[id]->charinfo_cache = NULL;
- return id;
+ return id;
}
#define Charinfo_count(a) font_tables[a]->charinfo_count
#define Charinfo_size(a) font_tables[a]->charinfo_size
#define Characters(a) font_tables[a]->characters
-charinfo *
-get_charinfo (internal_font_number f, integer c) {
- sa_tree_item glyph;
- charinfo *ci;
- if (proper_char_index(c)) {
- glyph = get_sa_item(Characters(f), c);
- if (!glyph) {
- /* this could be optimized using controlled growth */
- font_bytes += sizeof(charinfo);
- glyph = ++font_tables[f]->charinfo_count;
- do_realloc(font_tables[f]->charinfo, (glyph+1), charinfo);
- memset (&(font_tables[f]->charinfo[glyph]),0,sizeof(charinfo));
- font_tables[f]->charinfo[glyph].ef = 1000; /* init */
- font_tables[f]->charinfo_size = glyph;
- set_sa_item(font_tables[f]->characters, c, glyph, 1); /* 1= global */
- }
- return &(font_tables[f]->charinfo[glyph]);
- } else if (c == left_boundarychar) {
- if (left_boundary(f)==NULL) {
- ci = xcalloc(1,sizeof(charinfo));
- font_bytes += sizeof(charinfo);
- set_left_boundary(f,ci);
- }
- return left_boundary(f);
- } else if (c == right_boundarychar) {
- if (right_boundary(f)==NULL) {
- ci = xcalloc(1,sizeof(charinfo));
- font_bytes += sizeof(charinfo);
- set_right_boundary(f,ci);
- }
- return right_boundary(f);
- }
- return &(font_tables[f]->charinfo[0]);
+#define find_charinfo_id(f,c) get_sa_item(font_tables[f]->characters,c)
+
+charinfo *get_charinfo(internal_font_number f, integer c)
+{
+ sa_tree_item glyph;
+ charinfo *ci;
+ if (proper_char_index(c)) {
+ glyph = get_sa_item(Characters(f), c);
+ if (!glyph) {
+ /* this could be optimized using controlled growth */
+ font_bytes += sizeof(charinfo);
+ glyph = ++font_tables[f]->charinfo_count;
+ do_realloc(font_tables[f]->charinfo, (glyph + 1), charinfo);
+ memset(&(font_tables[f]->charinfo[glyph]), 0, sizeof(charinfo));
+ font_tables[f]->charinfo[glyph].ef = 1000; /* init */
+ font_tables[f]->charinfo_size = glyph;
+ set_sa_item(font_tables[f]->characters, c, glyph, 1); /* 1= global */
+ }
+ return &(font_tables[f]->charinfo[glyph]);
+ } else if (c == left_boundarychar) {
+ if (left_boundary(f) == NULL) {
+ ci = xcalloc(1, sizeof(charinfo));
+ font_bytes += sizeof(charinfo);
+ set_left_boundary(f, ci);
+ }
+ return left_boundary(f);
+ } else if (c == right_boundarychar) {
+ if (right_boundary(f) == NULL) {
+ ci = xcalloc(1, sizeof(charinfo));
+ font_bytes += sizeof(charinfo);
+ set_right_boundary(f, ci);
+ }
+ return right_boundary(f);
+ }
+ return &(font_tables[f]->charinfo[0]);
+}
+
+void set_charinfo(internal_font_number f, integer c, charinfo * ci)
+{
+ sa_tree_item glyph;
+ if (proper_char_index(c)) {
+ glyph = get_sa_item(Characters(f), c);
+ if (glyph) {
+ font_tables[f]->charinfo[glyph] = *ci;
+ } else {
+ pdftex_fail("font: %s", "character insertion failed");
+ }
+ } else if (c == left_boundarychar) {
+ set_left_boundary(f, ci);
+ } else if (c == right_boundarychar) {
+ set_right_boundary(f, ci);
+ }
+}
+
+
+
+charinfo *copy_charinfo(charinfo * ci)
+{
+ int x;
+ kerninfo *kern;
+ liginfo *lig;
+ real_eight_bits *packet;
+ charinfo *co = NULL;
+ if (ci == NULL)
+ return NULL;
+ co = xmalloc(sizeof(charinfo));
+ memcpy(co, ci, sizeof(charinfo));
+ set_charinfo_used(co, false);
+ co->name = NULL;
+ co->tounicode = NULL;
+ co->packets = NULL;
+ co->ligatures = NULL;
+ co->kerns = NULL;
+ co->vert_variants = NULL;
+ co->hor_variants = NULL;
+ if (ci->name != NULL) {
+ co->name = xstrdup(ci->name);
+ }
+ if (ci->tounicode != NULL) {
+ co->tounicode = xstrdup(ci->tounicode);
+ }
+ /* kerns */
+ if ((kern = get_charinfo_kerns(ci)) != NULL) {
+ x = 0;
+ while (!kern_end(kern[x])) {
+ x++;
+ }
+ x++;
+ co->kerns = xmalloc(x * sizeof(kerninfo));
+ memcpy(co->kerns, ci->kerns, (x * sizeof(kerninfo)));
+ }
+ /* ligs */
+ if ((lig = get_charinfo_ligatures(ci)) != NULL) {
+ x = 0;
+ while (!lig_end(lig[x])) {
+ x++;
+ }
+ x++;
+ co->ligatures = xmalloc(x * sizeof(liginfo));
+ memcpy(co->ligatures, ci->ligatures, (x * sizeof(liginfo)));
+ }
+ /* packets */
+ if ((packet = get_charinfo_packets(ci)) != NULL) {
+ x = vf_packet_bytes(ci);
+ co->packets = xmalloc(x);
+ memcpy(co->packets, ci->packets, x);
+ }
+
+ /* horizontal and vertical extenders */
+ if (get_charinfo_vert_variants(ci) != NULL) {
+ set_charinfo_vert_variants(co,
+ copy_variants(get_charinfo_vert_variants
+ (ci)));
+ }
+ if (get_charinfo_hor_variants(ci) != NULL) {
+ set_charinfo_hor_variants(co,
+ copy_variants(get_charinfo_hor_variants(ci)));
+ }
+ return co;
+}
+
+charinfo *char_info(internal_font_number f, integer c)
+{
+ if (f > font_id_maxval)
+ return 0;
+ if (proper_char_index(c)) {
+ register int glyph = find_charinfo_id(f, c);
+ return &(font_tables[f]->charinfo[glyph]);
+ } else if (c == left_boundarychar && left_boundary(f) != NULL) {
+ return left_boundary(f);
+ } else if (c == right_boundarychar && right_boundary(f) != NULL) {
+ return right_boundary(f);
+ }
+ return &(font_tables[f]->charinfo[0]);
+}
+
+charinfo_short char_info_short(internal_font_number f, integer c)
+{
+ charinfo_short s;
+ charinfo *i;
+ i = char_info(f, c);
+ s.ci_wd = i->width;
+ s.ci_dp = i->depth;
+ s.ci_ht = i->height;
+ return s;
+}
+
+integer char_exists(internal_font_number f, integer c)
+{
+ if (f > font_id_maxval)
+ return 0;
+ if (proper_char_index(c)) {
+ return find_charinfo_id(f, c);
+ } else if ((c == left_boundarychar) && has_left_boundary(f)) {
+ return 1;
+ } else if ((c == right_boundarychar) && has_right_boundary(f)) {
+ return 1;
+ }
+ return 0;
+}
+
+int lua_char_exists_callback(internal_font_number f, integer c)
+{
+ integer callback_id;
+ lua_State *L = Luas;
+ int ret = 0;
+ callback_id = callback_defined(char_exists_callback);
+ if (callback_id != 0) {
+ if (!get_callback(L, callback_id)) {
+ lua_pop(L, 2);
+ return 0;
+ }
+ lua_pushnumber(L, f);
+ lua_pushnumber(L, c);
+ if (lua_pcall(L, 2, 1, 0) != 0) { /* two args, 1 result */
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ error();
+ } else {
+ ret = lua_toboolean(L, -1);
+ }
+ }
+ return ret;
}
-void
-set_charinfo (internal_font_number f, integer c, charinfo *ci) {
- sa_tree_item glyph;
- if (proper_char_index(c)) {
- glyph = get_sa_item(Characters(f), c);
- if (glyph) {
- font_tables[f]->charinfo[glyph] = *ci;
+
+extinfo *new_variant(int glyph, int startconnect, int endconnect,
+ int advance, int repeater)
+{
+ extinfo *ext;
+ ext = xmalloc(sizeof(extinfo));
+ ext->next = NULL;
+ ext->glyph = glyph;
+ ext->start_overlap = startconnect;
+ ext->end_overlap = endconnect;
+ ext->advance = advance;
+ ext->extender = repeater;
+ return ext;
+}
+
+
+extinfo *copy_variant(extinfo * old)
+{
+ extinfo *ext;
+ ext = xmalloc(sizeof(extinfo));
+ ext->next = NULL;
+ ext->glyph = old->glyph;
+ ext->start_overlap = old->start_overlap;
+ ext->end_overlap = old->end_overlap;
+ ext->advance = old->advance;
+ ext->extender = old->extender;
+ return ext;
+}
+
+void dump_variant(extinfo * ext)
+{
+ dump_int(ext->glyph);
+ dump_int(ext->start_overlap);
+ dump_int(ext->end_overlap);
+ dump_int(ext->advance);
+ dump_int(ext->extender);
+ return;
+}
+
+
+extinfo *undump_variant(void)
+{
+ int x;
+ extinfo *ext;
+ undump_int(x);
+ if (x == 0)
+ return NULL;
+ ext = xmalloc(sizeof(extinfo));
+ ext->next = NULL;
+ ext->glyph = x;
+ undump_int(x);
+ ext->start_overlap = x;
+ undump_int(x);
+ ext->end_overlap = x;
+ undump_int(x);
+ ext->advance = x;
+ undump_int(x);
+ ext->extender = x;
+ return ext;
+}
+
+void add_charinfo_vert_variant(charinfo * ci, extinfo * ext)
+{
+ if (ci->vert_variants == NULL) {
+ ci->vert_variants = ext;
} else {
- pdftex_fail("font: %s","character insertion failed");
+ extinfo *lst = ci->vert_variants;
+ while (lst->next != NULL)
+ lst = lst->next;
+ lst->next = ext;
}
- } else if (c == left_boundarychar) {
- set_left_boundary(f,ci);
- } else if (c == right_boundarychar) {
- set_right_boundary(f,ci);
- }
+
}
+void add_charinfo_hor_variant(charinfo * ci, extinfo * ext)
+{
+ if (ci->hor_variants == NULL) {
+ ci->hor_variants = ext;
+ } else {
+ extinfo *lst = ci->hor_variants;
+ while (lst->next != NULL)
+ lst = lst->next;
+ lst->next = ext;
+ }
+}
-charinfo *
-copy_charinfo (charinfo *ci) {
- int x;
- kerninfo *kern;
- liginfo *lig;
- real_eight_bits *packet;
- charinfo *co = NULL;
- if (ci==NULL)
- return NULL;
- co = xmalloc(sizeof(charinfo));
- memcpy(co,ci,sizeof(charinfo));
- set_charinfo_used(co,false);
- co->name = NULL;
- co->tounicode = NULL;
- co->packets = NULL;
- co->ligatures = NULL;
- co->kerns = NULL;
- co->extensible = NULL;
- if (ci->name!=NULL) {
- co->name = xstrdup(ci->name);
- }
- if (ci->tounicode!=NULL) {
- co->tounicode = xstrdup(ci->tounicode);
- }
- /* kerns */
- if ((kern = get_charinfo_kerns(ci)) != NULL) {
- x = 0;
- while (!kern_end(kern[x])) { x++; } x++;
- co->kerns = xmalloc (x*sizeof(kerninfo));
- memcpy(co->kerns,ci->kerns,(x*sizeof(kerninfo)));
- }
- /* ligs */
- if ((lig = get_charinfo_ligatures(ci)) != NULL) {
- x = 0;
- while (!lig_end(lig[x])) { x++; } x++;
- co->ligatures = xmalloc (x*sizeof(liginfo));
- memcpy(co->ligatures,ci->ligatures,(x*sizeof(liginfo)));
- }
- /* packets */
- if ((packet = get_charinfo_packets(ci)) != NULL) {
- x = vf_packet_bytes(ci);
- co->packets = xmalloc (x);
- memcpy(co->packets,ci->packets,x);
- }
- if (get_charinfo_tag(ci)==ext_tag) {
- int top, bot, rep, mid;
- top = get_charinfo_extensible(ci,EXT_TOP);
- bot = get_charinfo_extensible(ci,EXT_BOT);
- mid = get_charinfo_extensible(ci,EXT_MID);
- rep = get_charinfo_extensible(ci,EXT_REP);
- set_charinfo_extensible(co,top,bot,mid,rep);
- }
- return co;
-}
-
-#if 0
-int
-find_charinfo_id (internal_font_number f, integer c) {
- register int g=0;
- if (font_tables[f]->charinfo_cache==NULL) {
- int i = (font_ec(f)+1)*sizeof(int);
- font_tables[f]->charinfo_cache = xmalloc(i);
- memset(font_tables[f]->charinfo_cache,0,i);
- } else {
- g = font_tables[f]->charinfo_cache[c];
- }
- if (g==0) {
- g = get_sa_item(font_tables[f]->characters, c);
- font_tables[f]->charinfo_cache[c] = g;
- }
- return g;
+extinfo *copy_variants(extinfo * o)
+{
+ extinfo *c, *t = NULL, *h = NULL;
+ while (o != NULL) {
+ c = copy_variant(o);
+ if (h == null)
+ h = c;
+ else
+ t->next = c;
+ t = c;
+ o = o->next;
+ }
+
+ return h;
}
-#else
-#define find_charinfo_id(f,c) get_sa_item(font_tables[f]->characters,c)
-#endif
-
-
-charinfo *
-char_info (internal_font_number f, integer c) {
- if (f>font_id_maxval)
- return 0;
- if (proper_char_index(c)) {
- register int glyph = find_charinfo_id(f,c);
- return &(font_tables[f]->charinfo[glyph]);
- } else if (c == left_boundarychar && left_boundary(f)!=NULL) {
- return left_boundary(f);
- } else if (c == right_boundarychar && right_boundary(f)!=NULL) {
- return right_boundary(f);
- }
- return &(font_tables[f]->charinfo[0]);
-}
-
-charinfo_short
-char_info_short (internal_font_number f, integer c) {
- charinfo_short s;
- charinfo *i;
- i = char_info(f,c);
- s.ci_wd = i->width;
- s.ci_dp = i->depth;
- s.ci_ht = i->height;
- return s;
-}
-
-integer
-char_exists (internal_font_number f, integer c) {
- if (f>font_id_maxval)
- return 0;
- if (proper_char_index(c)) {
- return find_charinfo_id(f,c);
- } else if ((c == left_boundarychar) && has_left_boundary(f)) {
- return 1;
- } else if ((c == right_boundarychar) && has_right_boundary(f)) {
- return 1;
- }
- return 0;
-}
-
-int
-lua_char_exists_callback (internal_font_number f, integer c) {
- integer callback_id ;
- lua_State *L = Luas[0];
- int ret=0;
- callback_id = callback_defined(char_exists_callback);
- if (callback_id!=0) {
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1, callback_id);
- if (!lua_isfunction(L,-1)) {
- lua_pop(L,2);
- return 0;
- }
- lua_pushnumber(L,f);
- lua_pushnumber(L,c);
- if (lua_pcall(L,2,1,0) != 0) { /* two args, 1 result */
- fprintf(stdout,"error: %s\n",lua_tostring(L,-1));
- lua_pop(L,2);
- error();
- } else {
- ret = lua_toboolean(L,-1);
- }
- }
- return ret;
-}
-
-
-void set_charinfo_width (charinfo *ci, scaled val) { ci->width = val; }
-void set_charinfo_height (charinfo *ci, scaled val) { ci->height = val; }
-void set_charinfo_depth (charinfo *ci, scaled val) { ci->depth = val; }
-void set_charinfo_italic (charinfo *ci, scaled val) { ci->italic = val; }
-void set_charinfo_tag (charinfo *ci, scaled val) { ci->tag = val; }
-void set_charinfo_remainder (charinfo *ci, scaled val) { ci->remainder = val; }
-void set_charinfo_used (charinfo *ci, scaled val) { ci->used = val; }
-void set_charinfo_index (charinfo *ci, scaled val) { ci->index = val; }
-void set_charinfo_name (charinfo *ci, char *val) { dxfree(ci->name,val); }
-void set_charinfo_tounicode (charinfo *ci, char *val) { dxfree(ci->tounicode,val); }
-void set_charinfo_ligatures (charinfo *ci, liginfo *val) { dxfree(ci->ligatures,val); }
-void set_charinfo_kerns (charinfo *ci, kerninfo *val) { dxfree(ci->kerns,val); }
-void set_charinfo_packets (charinfo *ci, real_eight_bits *val){ dxfree(ci->packets,val); }
-void set_charinfo_ef (charinfo *ci, scaled val) { ci->ef = val; }
-void set_charinfo_lp (charinfo *ci, scaled val) { ci->lp = val; }
-void set_charinfo_rp (charinfo *ci, scaled val) { ci->rp = val; }
-
-
-
-void set_charinfo_extensible (charinfo *ci, int top, int bot, int mid, int rep) {
- if (top == 0 && bot == 0 && mid == 0 && rep == 0) {
- if (ci->extensible != NULL) {
- free(ci->extensible);
- ci->extensible = NULL;
- }
- } else {
- if (ci->extensible == NULL) {
- ci->extensible = xmalloc(4*sizeof(integer));
- }
- ci->extensible[EXT_TOP] = top;
- ci->extensible[EXT_BOT] = bot;
- ci->extensible[EXT_MID] = mid;
- ci->extensible[EXT_REP] = rep;
- }
+
+
+void dump_charinfo_variants(extinfo * o)
+{
+ while (o != NULL) {
+ dump_variant(o);
+ o = o->next;
+ }
+ dump_int(0);
+ return;
}
-
-scaled get_charinfo_width (charinfo *ci) { return ci->width; }
-scaled get_charinfo_height (charinfo *ci) { return ci->height; }
-scaled get_charinfo_depth (charinfo *ci) { return ci->depth; }
-scaled get_charinfo_italic (charinfo *ci) { return ci->italic; }
-char get_charinfo_tag (charinfo *ci) { return ci->tag; }
-integer get_charinfo_remainder (charinfo *ci) { return ci->remainder; }
-char get_charinfo_used (charinfo *ci) { return ci->used; }
-integer get_charinfo_index (charinfo *ci) { return ci->index; }
-char *get_charinfo_name (charinfo *ci) { return ci->name; }
-char *get_charinfo_tounicode (charinfo *ci) { return ci->tounicode; }
-liginfo *get_charinfo_ligatures (charinfo *ci) { return ci->ligatures; }
-kerninfo *get_charinfo_kerns (charinfo *ci) { return ci->kerns; }
-real_eight_bits *get_charinfo_packets (charinfo *ci) { return ci->packets; }
-integer get_charinfo_ef (charinfo *ci) { return ci->ef; }
-integer get_charinfo_rp (charinfo *ci) { return ci->rp; }
-integer get_charinfo_lp (charinfo *ci) { return ci->lp; }
-integer get_charinfo_extensible (charinfo *ci, int whch) {
- int w = 0;
- if (ci->extensible != NULL)
- w = ci->extensible[whch];
- return w;
+extinfo *undump_charinfo_variants(void)
+{
+ extinfo *c, *t, *h = NULL;
+ c = undump_variant();
+ while (c != NULL) {
+ if (h == null)
+ h = c;
+ else
+ t->next = c;
+ t = c;
+ c = undump_variant();
+ }
+ return h;
}
-integer ext_top (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- integer w = get_charinfo_extensible(ci,EXT_TOP);
- /* fprintf(stdout,"top of char 0x%4x in font %s: %i\n",c,font_name(f),w);*/
- return w;
-}
-integer ext_bot (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- integer w = get_charinfo_extensible(ci,EXT_BOT);
- /*fprintf(stdout,"bot of char 0x%4x in font %s: %i\n",c,font_name(f),w);*/
- return w;
+void set_charinfo_width(charinfo * ci, scaled val)
+{
+ ci->width = val;
}
-integer ext_mid (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- integer w = get_charinfo_extensible(ci,EXT_MID);
- /*fprintf(stdout,"mid of char 0x%4x in font %s: %i\n",c,font_name(f),w);*/
- return w;
+
+void set_charinfo_height(charinfo * ci, scaled val)
+{
+ ci->height = val;
}
-integer ext_rep (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- integer w = get_charinfo_extensible(ci,EXT_REP);
- /*fprintf(stdout,"rep of char 0x%4x in font %s: %i\n",c,font_name(f),w);*/
- return w;
+
+void set_charinfo_depth(charinfo * ci, scaled val)
+{
+ ci->depth = val;
}
-scaled char_width (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- scaled w = get_charinfo_width(ci);
- /*fprintf(stdout,"width of char 0x%x in font %s: %i\n",c,font_name(f),w);*/
- return w;
-}
-
-scaled char_depth (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- scaled w = get_charinfo_depth(ci);
- /*fprintf(stdout,"depth of char 0x%x in font %s: %i\n",c,font_name(f),w);*/
- return w;
-}
-
-scaled char_height (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- scaled w = get_charinfo_height(ci);
- /*fprintf(stdout,"height of char 0x%x in font %s: %i\n",c,font_name(f),w);*/
- return w;
-}
-
-scaled char_italic (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_italic(ci);
-}
-
-integer char_remainder (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_remainder(ci);
-}
-
-char char_tag (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_tag(ci);
-}
-
-char char_used (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_used(ci);
-}
-
-char *char_name (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_name(ci);
-}
-
-integer char_index (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_index(ci);
-}
-
-liginfo * char_ligatures (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_ligatures(ci);
-}
-
-kerninfo * char_kerns (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_kerns(ci);
-}
-
-real_eight_bits * char_packets (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_packets(ci);
-}
-
-
-void
-set_font_params(internal_font_number f, int b) {
- int i;
- i = font_params(f);
- if (i!=b) {
- font_bytes += (b-font_params(f))*sizeof(scaled);
- do_realloc(param_base(f), (b+1), integer);
- font_params(f) = b;
- if (b>i) {
- while (i<b) {
- i++;
- set_font_param(f,i,0);
- }
- }
- }
-}
-
-
-integer
-copy_font (integer f) {
- int i;
- charinfo *ci , *co;
- integer k = new_font();
- memcpy(font_tables[k],font_tables[f],sizeof(texfont));
-
- set_font_cache_id(k,0);
- set_font_used(k,0);
- set_font_touched(k,0);
-
- font_tables[k]->_font_name = NULL;
- font_tables[k]->_font_filename = NULL;
- font_tables[k]->_font_fullname = NULL;
- font_tables[k]->_font_encodingname = NULL;
- font_tables[k]->_font_area = NULL;
- font_tables[k]->_font_cidregistry = NULL;
- font_tables[k]->_font_cidordering = NULL;
- font_tables[k]->_left_boundary = NULL;
- font_tables[k]->_right_boundary = NULL;
-
- set_font_name(k,xstrdup(font_name(f)));
- if (font_filename(f)!= NULL)
- set_font_filename(k,xstrdup(font_filename(f)));
- if (font_fullname(f)!= NULL)
- set_font_fullname(k,xstrdup(font_fullname(f)));
- if (font_encodingname(f)!= NULL)
- set_font_encodingname(k,xstrdup(font_encodingname(f)));
- if (font_area(f)!= NULL)
- set_font_area(k,xstrdup(font_area(f)));
- if (font_cidregistry(f)!= NULL)
- set_font_cidregistry(k,xstrdup(font_cidregistry(f)));
- if (font_cidordering(f)!= NULL)
- set_font_cidordering(k,xstrdup(font_cidordering(f)));
-
- i = sizeof(*param_base(f))*font_params(f);
- font_bytes += i;
- param_base(k) = xmalloc (i);
- memcpy(param_base(k),param_base(f), i);
-
- i = sizeof(charinfo)*(Charinfo_size(f)+1);
- font_bytes += i;
- font_tables[k]->charinfo = xmalloc(i);
- memset(font_tables[k]->charinfo,0,i);
- for(i=0;i<=Charinfo_size(k);i++) {
- ci = copy_charinfo(&font_tables[f]->charinfo[i]);
- font_tables[k]->charinfo[i] = *ci;
- }
-
- if (left_boundary(f)!= NULL ) {
- ci = copy_charinfo(left_boundary(f));
- set_charinfo(k,left_boundarychar,ci);
- }
+void set_charinfo_italic(charinfo * ci, scaled val)
+{
+ ci->italic = val;
+}
- if (right_boundary(f)!= NULL ) {
- ci = copy_charinfo(right_boundary(f));
- set_charinfo(k,right_boundarychar,ci);
- }
- return k;
-}
-
-void delete_font (integer f) {
- int i;
- charinfo *co;
- assert(f>0);
- if (font_tables[f]!=NULL) {
- set_font_name(f,NULL);
- set_font_filename(f,NULL);
- set_font_fullname(f,NULL);
- set_font_encodingname(f,NULL);
- set_font_area(f,NULL);
- set_font_cidregistry(f,NULL);
- set_font_cidordering(f,NULL);
- set_left_boundary(f,NULL);
- set_right_boundary(f,NULL);
-
- for(i=font_bc(f); i<=font_ec(f); i++) {
- if (char_exists(f,i)) {
- co = char_info(f,i);
- set_charinfo_name(co,NULL);
- set_charinfo_tounicode(co,NULL);
- set_charinfo_packets(co,NULL);
- set_charinfo_ligatures(co,NULL);
- set_charinfo_kerns(co,NULL);
- set_charinfo_extensible(co,0,0,0,0);
- }
- }
- /* free .notdef */
- set_charinfo_name(font_tables[f]->charinfo+0,NULL);
- free(font_tables[f]->charinfo);
- destroy_sa_tree(font_tables[f]->characters);
-
- free(param_base(f));
- free(font_tables[f]);
- font_tables[f] = NULL;
+void set_charinfo_top_accent(charinfo * ci, scaled val)
+{
+ ci->top_accent = val;
+}
+
+void set_charinfo_bot_accent(charinfo * ci, scaled val)
+{
+ ci->bot_accent = val;
+}
+
+void set_charinfo_tag(charinfo * ci, scaled val)
+{
+ ci->tag = val;
+}
+
+void set_charinfo_remainder(charinfo * ci, scaled val)
+{
+ ci->remainder = val;
+}
+
+void set_charinfo_used(charinfo * ci, scaled val)
+{
+ ci->used = val;
+}
- if (font_id_maxval==f) {
- font_id_maxval--;
+void set_charinfo_index(charinfo * ci, scaled val)
+{
+ ci->index = val;
+}
+void set_charinfo_name(charinfo * ci, char *val)
+{
+ dxfree(ci->name, val);
+}
+void set_charinfo_tounicode(charinfo * ci, char *val)
+{
+ dxfree(ci->tounicode, val);
+}
+
+void set_charinfo_ligatures(charinfo * ci, liginfo * val)
+{
+ dxfree(ci->ligatures, val);
+}
+
+void set_charinfo_kerns(charinfo * ci, kerninfo * val)
+{
+ dxfree(ci->kerns, val);
+}
+
+void set_charinfo_packets(charinfo * ci, real_eight_bits * val)
+{
+ dxfree(ci->packets, val);
+}
+
+void set_charinfo_ef(charinfo * ci, scaled val)
+{
+ ci->ef = val;
+}
+
+void set_charinfo_lp(charinfo * ci, scaled val)
+{
+ ci->lp = val;
+}
+
+void set_charinfo_rp(charinfo * ci, scaled val)
+{
+ ci->rp = val;
+}
+
+void set_charinfo_vert_variants(charinfo * ci, extinfo * ext)
+{
+ extinfo *c, *lst;
+ if (ci->vert_variants != NULL) {
+ lst = ci->vert_variants;
+ while (lst != NULL) {
+ c = lst->next;
+ free(lst);
+ lst = c;
+ }
}
- }
+ ci->vert_variants = ext;
+}
+
+void set_charinfo_hor_variants(charinfo * ci, extinfo * ext)
+{
+ extinfo *c, *lst;
+ if (ci->hor_variants != NULL) {
+ lst = ci->hor_variants;
+ while (lst != NULL) {
+ c = lst->next;
+ free(lst);
+ lst = c;
+ }
+ }
+ ci->hor_variants = ext;
+
+}
+
+/* In TeX, extensibles were fairly simple things.
+ This function squeezes a TFM extensible into the vertical extender structures.
+ |advance==0| is a special case for TFM fonts, because finding the proper
+ advance width during tfm reading can be tricky
+*/
+
+/* a small complication arises if |rep| is the only non-zero: it needs to be
+ doubled as a non-repeatable to avoid mayhem */
+
+void set_charinfo_extensible(charinfo * ci, int top, int bot, int mid, int rep)
+{
+ extinfo *ext;
+ set_charinfo_vert_variants(ci, NULL); /* clear old */
+ if (bot == 0 && top == 0 && mid == 0 && rep != 0) {
+ ext = new_variant(rep, 0, 0, 0, EXT_NORMAL);
+ add_charinfo_vert_variant(ci, ext);
+ ext = new_variant(rep, 0, 0, 0, EXT_REPEAT);
+ add_charinfo_vert_variant(ci, ext);
+ return;
+ }
+ if (bot != 0) {
+ ext = new_variant(bot, 0, 0, 0, EXT_NORMAL);
+ add_charinfo_vert_variant(ci, ext);
+ }
+ if (rep != 0) {
+ ext = new_variant(rep, 0, 0, 0, EXT_REPEAT);
+ add_charinfo_vert_variant(ci, ext);
+ }
+ if (mid != 0) {
+ ext = new_variant(mid, 0, 0, 0, EXT_NORMAL);
+ add_charinfo_vert_variant(ci, ext);
+ if (rep != 0) {
+ ext = new_variant(rep, 0, 0, 0, EXT_REPEAT);
+ add_charinfo_vert_variant(ci, ext);
+ }
+ }
+ if (top != 0) {
+ ext = new_variant(top, 0, 0, 0, EXT_NORMAL);
+ add_charinfo_vert_variant(ci, ext);
+ }
+}
+
+scaled get_charinfo_width(charinfo * ci)
+{
+ return ci->width;
+}
+
+scaled get_charinfo_height(charinfo * ci)
+{
+ return ci->height;
+}
+
+scaled get_charinfo_depth(charinfo * ci)
+{
+ return ci->depth;
+}
+
+scaled get_charinfo_italic(charinfo * ci)
+{
+ return ci->italic;
+}
+
+scaled get_charinfo_top_accent(charinfo * ci)
+{
+ return ci->top_accent;
+}
+
+scaled get_charinfo_bot_accent(charinfo * ci)
+{
+ return ci->bot_accent;
+}
+
+char get_charinfo_tag(charinfo * ci)
+{
+ return ci->tag;
+}
+
+integer get_charinfo_remainder(charinfo * ci)
+{
+ return ci->remainder;
}
-void
-create_null_font (void) {
- int i = new_font();
- assert(i==0);
- set_font_name(i,xstrdup("nullfont"));
- set_font_area(i,xstrdup(""));
- set_font_touched(i,1);
+char get_charinfo_used(charinfo * ci)
+{
+ return ci->used;
}
-boolean
-is_valid_font (integer id) {
- int ret=0;
- if (id>=0 && id<=font_id_maxval && font_tables[id]!=NULL)
- ret=1;
- return ret;
+integer get_charinfo_index(charinfo * ci)
+{
+ return ci->index;
+}
+
+char *get_charinfo_name(charinfo * ci)
+{
+ return ci->name;
+}
+
+char *get_charinfo_tounicode(charinfo * ci)
+{
+ return ci->tounicode;
+}
+
+liginfo *get_charinfo_ligatures(charinfo * ci)
+{
+ return ci->ligatures;
+}
+
+kerninfo *get_charinfo_kerns(charinfo * ci)
+{
+ return ci->kerns;
+}
+
+real_eight_bits *get_charinfo_packets(charinfo * ci)
+{
+ return ci->packets;
+}
+
+integer get_charinfo_ef(charinfo * ci)
+{
+ return ci->ef;
+}
+
+integer get_charinfo_rp(charinfo * ci)
+{
+ return ci->rp;
+}
+
+integer get_charinfo_lp(charinfo * ci)
+{
+ return ci->lp;
+}
+
+extinfo *get_charinfo_vert_variants(charinfo * ci)
+{
+ extinfo *w = NULL;
+ if (ci->vert_variants != NULL)
+ w = ci->vert_variants;
+ return w;
+}
+
+extinfo *get_charinfo_hor_variants(charinfo * ci)
+{
+ extinfo *w = NULL;
+ if (ci->hor_variants != NULL)
+ w = ci->hor_variants;
+ return w;
+}
+
+
+scaled char_width(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ scaled w = get_charinfo_width(ci);
+ /*fprintf(stdout,"width of char 0x%x in font %s: %i\n",c,font_name(f),w); */
+ return w;
+}
+
+scaled char_depth(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ scaled w = get_charinfo_depth(ci);
+ /*fprintf(stdout,"depth of char 0x%x in font %s: %i\n",c,font_name(f),w); */
+ return w;
+}
+
+scaled char_height(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ scaled w = get_charinfo_height(ci);
+ /*fprintf(stdout,"height of char 0x%x in font %s: %i\n",c,font_name(f),w); */
+ return w;
+}
+
+scaled char_italic(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_italic(ci);
+}
+
+scaled char_top_accent(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_top_accent(ci);
+}
+
+scaled char_bot_accent(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_bot_accent(ci);
+}
+
+
+integer char_remainder(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_remainder(ci);
+}
+
+char char_tag(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_tag(ci);
+}
+
+char char_used(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_used(ci);
+}
+
+char *char_name(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_name(ci);
+}
+
+integer char_index(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_index(ci);
+}
+
+liginfo *char_ligatures(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_ligatures(ci);
+}
+
+kerninfo *char_kerns(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_kerns(ci);
+}
+
+real_eight_bits *char_packets(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_packets(ci);
+}
+
+
+void set_font_params(internal_font_number f, int b)
+{
+ int i;
+ i = font_params(f);
+ if (i != b) {
+ font_bytes += (b - font_params(f) + 1) * sizeof(scaled);
+ do_realloc(param_base(f), (b + 2), integer);
+ font_params(f) = b;
+ if (b > i) {
+ while (i < b) {
+ i++;
+ set_font_param(f, i, 0);
+ }
+ }
+ }
+}
+
+void set_font_math_params(internal_font_number f, int b)
+{
+ int i;
+ i = font_math_params(f);
+ if (i != b) {
+ font_bytes += (b - font_math_params(f) + 1) * sizeof(scaled);
+ do_realloc(math_param_base(f), (b + 2), integer);
+ font_math_params(f) = b;
+ if (b > i) {
+ while (i < b) {
+ i++;
+ set_font_math_param(f, i, undefined_math_parameter);
+ }
+ }
+ }
+}
+
+
+
+integer copy_font(integer f)
+{
+ int i;
+ charinfo *ci;
+ integer k = new_font();
+ memcpy(font_tables[k], font_tables[f], sizeof(texfont));
+
+ set_font_cache_id(k, 0);
+ set_font_used(k, 0);
+ set_font_touched(k, 0);
+
+ font_tables[k]->_font_name = NULL;
+ font_tables[k]->_font_filename = NULL;
+ font_tables[k]->_font_fullname = NULL;
+ font_tables[k]->_font_encodingname = NULL;
+ font_tables[k]->_font_area = NULL;
+ font_tables[k]->_font_cidregistry = NULL;
+ font_tables[k]->_font_cidordering = NULL;
+ font_tables[k]->_left_boundary = NULL;
+ font_tables[k]->_right_boundary = NULL;
+
+ set_font_name(k, xstrdup(font_name(f)));
+ if (font_filename(f) != NULL)
+ set_font_filename(k, xstrdup(font_filename(f)));
+ if (font_fullname(f) != NULL)
+ set_font_fullname(k, xstrdup(font_fullname(f)));
+ if (font_encodingname(f) != NULL)
+ set_font_encodingname(k, xstrdup(font_encodingname(f)));
+ if (font_area(f) != NULL)
+ set_font_area(k, xstrdup(font_area(f)));
+ if (font_cidregistry(f) != NULL)
+ set_font_cidregistry(k, xstrdup(font_cidregistry(f)));
+ if (font_cidordering(f) != NULL)
+ set_font_cidordering(k, xstrdup(font_cidordering(f)));
+
+ i = sizeof(*param_base(f)) * font_params(f);
+ font_bytes += i;
+ param_base(k) = xmalloc(i);
+ memcpy(param_base(k), param_base(f), i);
+
+ if (font_math_params(f) > 0) {
+ i = sizeof(*math_param_base(f)) * font_math_params(f);
+ font_bytes += i;
+ math_param_base(k) = xmalloc(i);
+ memcpy(math_param_base(k), math_param_base(f), i);
+ }
+
+ i = sizeof(charinfo) * (Charinfo_size(f) + 1);
+ font_bytes += i;
+ font_tables[k]->charinfo = xmalloc(i);
+ memset(font_tables[k]->charinfo, 0, i);
+ for (i = 0; i <= Charinfo_size(k); i++) {
+ ci = copy_charinfo(&font_tables[f]->charinfo[i]);
+ font_tables[k]->charinfo[i] = *ci;
+ }
+
+ if (left_boundary(f) != NULL) {
+ ci = copy_charinfo(left_boundary(f));
+ set_charinfo(k, left_boundarychar, ci);
+ }
+
+ if (right_boundary(f) != NULL) {
+ ci = copy_charinfo(right_boundary(f));
+ set_charinfo(k, right_boundarychar, ci);
+ }
+ return k;
+}
+
+void delete_font(integer f)
+{
+ int i;
+ charinfo *co;
+ assert(f > 0);
+ if (font_tables[f] != NULL) {
+ set_font_name(f, NULL);
+ set_font_filename(f, NULL);
+ set_font_fullname(f, NULL);
+ set_font_encodingname(f, NULL);
+ set_font_area(f, NULL);
+ set_font_cidregistry(f, NULL);
+ set_font_cidordering(f, NULL);
+ set_left_boundary(f, NULL);
+ set_right_boundary(f, NULL);
+
+ for (i = font_bc(f); i <= font_ec(f); i++) {
+ if (char_exists(f, i)) {
+ co = char_info(f, i);
+ set_charinfo_name(co, NULL);
+ set_charinfo_tounicode(co, NULL);
+ set_charinfo_packets(co, NULL);
+ set_charinfo_ligatures(co, NULL);
+ set_charinfo_kerns(co, NULL);
+ set_charinfo_vert_variants(co, NULL);
+ set_charinfo_hor_variants(co, NULL);
+ }
+ }
+ /* free .notdef */
+ set_charinfo_name(font_tables[f]->charinfo + 0, NULL);
+ free(font_tables[f]->charinfo);
+ destroy_sa_tree(font_tables[f]->characters);
+
+ free(param_base(f));
+ if (math_param_base(f) != NULL)
+ free(math_param_base(f));
+ free(font_tables[f]);
+ font_tables[f] = NULL;
+
+ if (font_id_maxval == f) {
+ font_id_maxval--;
+ }
+ }
+}
+
+void create_null_font(void)
+{
+ int i = new_font();
+ assert(i == 0);
+ set_font_name(i, xstrdup("nullfont"));
+ set_font_area(i, xstrdup(""));
+ set_font_touched(i, 1);
+}
+
+boolean is_valid_font(integer id)
+{
+ int ret = 0;
+ if (id >= 0 && id <= font_id_maxval && font_tables[id] != NULL)
+ ret = 1;
+ return ret;
}
/* return 1 == identical */
-boolean
-cmp_font_name (integer id, strnumber t) {
- char *tid , *tt;
- if (!is_valid_font(id))
- return 0;
- tt = makecstring(t);
- tid = font_name(id);
- if (tt == NULL && tid == NULL)
+boolean cmp_font_name(integer id, strnumber t)
+{
+ char *tid, *tt;
+ if (!is_valid_font(id))
+ return 0;
+ tt = makecstring(t);
+ tid = font_name(id);
+ if (tt == NULL && tid == NULL)
+ return 1;
+ if (tt == NULL || tid == NULL || strcmp(tid, tt) != 0)
+ return 0;
return 1;
- if (tt == NULL || tid == NULL || strcmp(tid,tt)!=0)
- return 0;
- return 1;
-}
-
-boolean
-cmp_font_area (integer id, strnumber t) {
- char *tt = NULL;
- char *tid = font_area(id);
- if (t == 0) {
- if (tid == NULL || strlen(tid)==0)
- return 1;
- else
- return 0;
- }
- tt = makecstring(t);
- if ((tt == NULL || strlen(tt)==0) && (tid == NULL || strlen(tid)==0))
+}
+
+boolean cmp_font_area(integer id, strnumber t)
+{
+ char *tt = NULL;
+ char *tid = font_area(id);
+ if (t == 0) {
+ if (tid == NULL || strlen(tid) == 0)
+ return 1;
+ else
+ return 0;
+ }
+ tt = makecstring(t);
+ if ((tt == NULL || strlen(tt) == 0) && (tid == NULL || strlen(tid) == 0))
+ return 1;
+ if (tt == NULL || strcmp(tid, tt) != 0)
+ return 0;
return 1;
- if (tt == NULL || strcmp(tid,tt)!=0)
- return 0;
- return 1;
}
-static boolean
-same_font_name (integer id, integer t) {
- int ret = 0;
- if (font_name(t) == NULL ||
- font_name(id) == NULL ||
- strcmp(font_name(t),font_name(id))!=0) {
- ;
- } else {
- ret =1 ;
- }
- return ret;
-}
-
-boolean
-font_shareable (internal_font_number f, internal_font_number k) {
- int ret = 0;
- if (font_cidregistry(f) == NULL) {
- if ( hasfmentry ( k )
- && ( font_map ( k ) == font_map ( f ) )
- && ( same_font_name ( k , f )
- ||
- ( pdf_font_auto_expand (f)
- && ( pdf_font_blink (f) != 0 ) /* 0 = nullfont */
- && same_font_name ( k , pdf_font_blink (f) ) ) ) ) {
- ret = 1;
- }
- } else {
- if ((font_filename(k) != NULL && font_filename(f) != NULL &&
- strcmp(font_filename(k),font_filename(f)) == 0)
- ||
- ( pdf_font_auto_expand (f)
- && ( pdf_font_blink (f) != 0 ) /* 0 = nullfont */
- && same_font_name ( k , pdf_font_blink (f) ) ) ) {
- ret = 1;
+static boolean same_font_name(integer id, integer t)
+{
+ int ret = 0;
+ if (font_name(t) == NULL ||
+ font_name(id) == NULL || strcmp(font_name(t), font_name(id)) != 0) {
+ ;
+ } else {
+ ret = 1;
}
- }
- return ret;
-}
-
-integer
-test_no_ligatures (internal_font_number f) {
- integer c;
- for (c=font_bc(f);c<=font_ec(f);c++) {
- if (has_lig(f,c)) /* char_exists(f,c) */
- return 0;
- }
- return 1;
-}
-
-integer
-get_tag_code (internal_font_number f, integer c) {
- small_number i;
- if (char_exists(f,c)) {
- i = char_tag(f,c);
- if (i==lig_tag) return 1;
- else if (i==list_tag) return 2;
- else if (i==ext_tag) return 4;
- else return 0;
- }
- return -1;
-}
-
-integer
-get_lp_code (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_lp(ci);
-}
-
-integer
-get_rp_code (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_rp(ci);
-}
-
-integer
-get_ef_code (internal_font_number f, integer c) {
- charinfo *ci = char_info(f,c);
- return get_charinfo_ef(ci);
-}
-
-void
-set_tag_code (internal_font_number f, integer c, integer i) {
- integer fixedi;
- charinfo * co;
- if (char_exists(f,c)) {
- /* abs(fix_int(i-7,0)) */
- fixedi = - (i<-7 ? -7 : (i>0 ? 0 : i )) ;
- co = char_info(f,c);
- if (fixedi >= 4) {
- if (char_tag(f,c) == ext_tag)
- set_charinfo_tag(co,(char_tag(f,c)- ext_tag));
- fixedi = fixedi - 4;
- }
- if (fixedi >= 2) {
- if (char_tag(f,c) == list_tag)
- set_charinfo_tag(co,(char_tag(f,c)- list_tag));
- fixedi = fixedi - 2;
- };
- if (fixedi >= 1) {
- if (has_lig(f,c))
- set_charinfo_ligatures(co,NULL);
- if (has_kern(f,c))
- set_charinfo_kerns(co,NULL);
+ return ret;
+}
+
+boolean font_shareable(internal_font_number f, internal_font_number k)
+{
+ int ret = 0;
+ /* For some lua-loaded (for instance AFM) fonts, it is normal to have
+ a zero cidregistry, and such fonts do not have a fontmap entry yet
+ at this point, so the test shoulh use the other branch */
+ if (font_cidregistry(f) == NULL && font_cidregistry(k) == NULL &&
+ font_encodingbytes(f) != 2 && font_encodingbytes(k) != 2) {
+ if (hasfmentry(k)
+ && (font_map(k) == font_map(f))
+ && (same_font_name(k, f)
+ || (pdf_font_auto_expand(f)
+ && (pdf_font_blink(f) != 0) /* 0 = nullfont */
+ &&same_font_name(k, pdf_font_blink(f))))) {
+ ret = 1;
+ }
+ } else {
+ if ((font_filename(k) != NULL && font_filename(f) != NULL &&
+ strcmp(font_filename(k), font_filename(f)) == 0)
+ || (pdf_font_auto_expand(f)
+ && (pdf_font_blink(f) != 0) /* 0 = nullfont */
+ &&same_font_name(k, pdf_font_blink(f)))) {
+ ret = 1;
+ }
}
- }
+ return ret;
}
+integer test_no_ligatures(internal_font_number f)
+{
+ integer c;
+ for (c = font_bc(f); c <= font_ec(f); c++) {
+ if (has_lig(f, c)) /* char_exists(f,c) */
+ return 0;
+ }
+ return 1;
+}
-void
-set_lp_code(internal_font_number f, integer c, integer i) {
- charinfo * co;
- if (char_exists(f,c)) {
- co = char_info(f,c);
- set_charinfo_lp(co,i);
- }
+integer get_tag_code(internal_font_number f, integer c)
+{
+ small_number i;
+ if (char_exists(f, c)) {
+ i = char_tag(f, c);
+ if (i == lig_tag)
+ return 1;
+ else if (i == list_tag)
+ return 2;
+ else if (i == ext_tag)
+ return 4;
+ else
+ return 0;
+ }
+ return -1;
}
-void
-set_rp_code(internal_font_number f, integer c, integer i) {
- charinfo * co;
- if (char_exists(f,c)) {
- co = char_info(f,c);
- set_charinfo_rp(co,i);
- }
+integer get_lp_code(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_lp(ci);
}
-void
-set_ef_code(internal_font_number f, integer c, integer i) {
- charinfo * co;
- if (char_exists(f,c)) {
- co = char_info(f,c);
- set_charinfo_ef(co,i);
- }
+integer get_rp_code(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_rp(ci);
}
-void
-set_no_ligatures (internal_font_number f) {
- integer c;
- charinfo * co;
-
- if (font_tables[f]->ligatures_disabled)
- return;
-
- co = char_info(f,left_boundarychar);
- set_charinfo_ligatures(co,NULL);
- co = char_info(f,right_boundarychar); /* this is weird */
- set_charinfo_ligatures(co,NULL);
- for (c=0;c<font_tables[f]->charinfo_count;c++) {
- co = font_tables[f]->charinfo+c;
- set_charinfo_ligatures(co,NULL);
- }
- font_tables[f]->ligatures_disabled =1;
+integer get_ef_code(internal_font_number f, integer c)
+{
+ charinfo *ci = char_info(f, c);
+ return get_charinfo_ef(ci);
+}
+
+void set_tag_code(internal_font_number f, integer c, integer i)
+{
+ integer fixedi;
+ charinfo *co;
+ if (char_exists(f, c)) {
+ /* abs(fix_int(i-7,0)) */
+ fixedi = -(i < -7 ? -7 : (i > 0 ? 0 : i));
+ co = char_info(f, c);
+ if (fixedi >= 4) {
+ if (char_tag(f, c) == ext_tag)
+ set_charinfo_tag(co, (char_tag(f, c) - ext_tag));
+ fixedi = fixedi - 4;
+ }
+ if (fixedi >= 2) {
+ if (char_tag(f, c) == list_tag)
+ set_charinfo_tag(co, (char_tag(f, c) - list_tag));
+ fixedi = fixedi - 2;
+ };
+ if (fixedi >= 1) {
+ if (has_lig(f, c))
+ set_charinfo_ligatures(co, NULL);
+ if (has_kern(f, c))
+ set_charinfo_kerns(co, NULL);
+ }
+ }
}
-liginfo
-get_ligature (internal_font_number f, integer lc, integer rc) {
- liginfo t, u;
- charinfo * co;
- t.lig = 0;
- t.type = 0;
- t.adj = 0;
- if (lc == non_boundarychar || rc == non_boundarychar || (!has_lig(f,lc)) )
+
+void set_lp_code(internal_font_number f, integer c, integer i)
+{
+ charinfo *co;
+ if (char_exists(f, c)) {
+ co = char_info(f, c);
+ set_charinfo_lp(co, i);
+ }
+}
+
+void set_rp_code(internal_font_number f, integer c, integer i)
+{
+ charinfo *co;
+ if (char_exists(f, c)) {
+ co = char_info(f, c);
+ set_charinfo_rp(co, i);
+ }
+}
+
+void set_ef_code(internal_font_number f, integer c, integer i)
+{
+ charinfo *co;
+ if (char_exists(f, c)) {
+ co = char_info(f, c);
+ set_charinfo_ef(co, i);
+ }
+}
+
+void set_no_ligatures(internal_font_number f)
+{
+ integer c;
+ charinfo *co;
+
+ if (font_tables[f]->ligatures_disabled)
+ return;
+
+ co = char_info(f, left_boundarychar);
+ set_charinfo_ligatures(co, NULL);
+ co = char_info(f, right_boundarychar); /* this is weird */
+ set_charinfo_ligatures(co, NULL);
+ for (c = 0; c < font_tables[f]->charinfo_count; c++) {
+ co = font_tables[f]->charinfo + c;
+ set_charinfo_ligatures(co, NULL);
+ }
+ font_tables[f]->ligatures_disabled = 1;
+}
+
+liginfo get_ligature(internal_font_number f, integer lc, integer rc)
+{
+ liginfo t, u;
+ charinfo *co;
+ t.lig = 0;
+ t.type = 0;
+ t.adj = 0;
+ if (lc == non_boundarychar || rc == non_boundarychar || (!has_lig(f, lc)))
+ return t;
+ k = 0;
+ co = char_info(f, lc);
+ while (1) {
+ u = charinfo_ligature(co, k);
+ if (lig_end(u))
+ break;
+ if (lig_char(u) == rc) {
+ if (lig_disabled(u)) {
+ return t;
+ } else {
+ return u;
+ }
+ }
+ k++;
+ }
return t;
- k = 0;
- co = char_info(f,lc);
- while (1) {
- u = charinfo_ligature(co,k);
- if (lig_end(u))
- break;
- if (lig_char(u) == rc) {
- if (lig_disabled(u)) {
- return t;
- } else {
- return u;
- }
- }
- k++;
- }
- return t;
}
-scaled
-get_kern(internal_font_number f, integer lc, integer rc)
+scaled raw_get_kern(internal_font_number f, integer lc, integer rc)
{
- integer k;
- kerninfo u;
- charinfo * co;
- if (lc == non_boundarychar || rc == non_boundarychar || (!has_kern(f,lc)) )
+ integer k;
+ kerninfo u;
+ charinfo *co;
+ if (lc == non_boundarychar || rc == non_boundarychar)
+ return 0;
+ k = 0;
+ co = char_info(f, lc);
+ while (1) {
+ u = charinfo_kern(co, k);
+ if (kern_end(u))
+ break;
+ if (kern_char(u) == rc) {
+ if (kern_disabled(u))
+ return 0;
+ else
+ return kern_kern(u);
+ }
+ k++;
+ }
return 0;
- k = 0;
- co = char_info(f,lc);
- while (1) {
- u = charinfo_kern(co,k);
- if (kern_end(u))
- break;
- if (kern_char(u) == rc) {
- if (kern_disabled(u))
- return 0;
- else
- return kern_kern(u);
- }
- k++;
- }
- return 0;
+}
+
+
+scaled get_kern(internal_font_number f, integer lc, integer rc)
+{
+ if (lc == non_boundarychar || rc == non_boundarychar || (!has_kern(f, lc)))
+ return 0;
+ return raw_get_kern(f, lc, rc);
}
/* dumping and undumping fonts */
-#define dump_string(a) \
- if (a!=NULL) { \
- x = strlen(a)+1; \
- dump_int(x); dump_things(*a, x); \
- } else { \
- x = 0; dump_int(x); \
+#define dump_string(a) \
+ if (a!=NULL) { \
+ x = strlen(a)+1; \
+ dump_int(x); dump_things(*a, x); \
+ } else { \
+ x = 0; dump_int(x); \
}
-void
-dump_charinfo (int f , int c) {
- charinfo *co;
- int x;
- liginfo *lig;
- kerninfo *kern;
-
- dump_int(c);
- co = char_info(f,c);
- set_charinfo_used(co,0);
- dump_int(get_charinfo_width(co));
- dump_int(get_charinfo_height(co));
- dump_int(get_charinfo_depth(co));
- dump_int(get_charinfo_italic(co));
- dump_int(get_charinfo_tag(co));
- dump_int(get_charinfo_ef(co));
- dump_int(get_charinfo_rp(co));
- dump_int(get_charinfo_lp(co));
- dump_int(get_charinfo_remainder(co));
- dump_int(get_charinfo_used(co));
- dump_int(get_charinfo_index(co));
- dump_string(get_charinfo_name(co));
- dump_string(get_charinfo_tounicode(co));
-
- /* ligatures */
- x = 0;
- if ((lig = get_charinfo_ligatures(co)) != NULL) {
- while (!lig_end(lig[x])) { x++; }
- x++;
- dump_int(x); dump_things(*lig, x);
- } else {
+void dump_charinfo(int f, int c)
+{
+ charinfo *co;
+ int x;
+ liginfo *lig;
+ kerninfo *kern;
+ dump_int(c);
+ co = char_info(f, c);
+ set_charinfo_used(co, 0);
+ dump_int(get_charinfo_width(co));
+ dump_int(get_charinfo_height(co));
+ dump_int(get_charinfo_depth(co));
+ dump_int(get_charinfo_italic(co));
+ dump_int(get_charinfo_top_accent(co));
+ dump_int(get_charinfo_bot_accent(co));
+ dump_int(get_charinfo_tag(co));
+ dump_int(get_charinfo_ef(co));
+ dump_int(get_charinfo_rp(co));
+ dump_int(get_charinfo_lp(co));
+ dump_int(get_charinfo_remainder(co));
+ dump_int(get_charinfo_used(co));
+ dump_int(get_charinfo_index(co));
+ dump_string(get_charinfo_name(co));
+ dump_string(get_charinfo_tounicode(co));
+
+ /* ligatures */
+ x = 0;
+ if ((lig = get_charinfo_ligatures(co)) != NULL) {
+ while (!lig_end(lig[x])) {
+ x++;
+ }
+ x++;
+ dump_int(x);
+ dump_things(*lig, x);
+ } else {
+ dump_int(x);
+ }
+ /* kerns */
+ x = 0;
+ if ((kern = get_charinfo_kerns(co)) != NULL) {
+ while (!kern_end(kern[x])) {
+ x++;
+ }
+ x++;
+ dump_int(x);
+ dump_things(*kern, x);
+ } else {
+ dump_int(x);
+ }
+ /* packets */
+ x = vf_packet_bytes(co);
dump_int(x);
- }
- /* kerns */
- x = 0;
- if ((kern = get_charinfo_kerns(co)) != NULL) {
- while (!kern_end(kern[x])) { x++; }
- x++;
- dump_int(x); dump_things(*kern, x);
- } else {
- dump_int(x);
- }
- /* packets */
- x= vf_packet_bytes(co);
- dump_int(x);
- if (x>0) {
- dump_things(*get_charinfo_packets(co), x);
- }
+ if (x > 0) {
+ dump_things(*get_charinfo_packets(co), x);
+ }
- if (get_charinfo_tag(co)==ext_tag) {
- x = get_charinfo_extensible(co,EXT_TOP); dump_int(x);
- x = get_charinfo_extensible(co,EXT_BOT); dump_int(x);
- x = get_charinfo_extensible(co,EXT_MID); dump_int(x);
- x = get_charinfo_extensible(co,EXT_REP); dump_int(x);
- }
+ if (get_charinfo_tag(co) == ext_tag) {
+ dump_charinfo_variants(get_charinfo_vert_variants(co));
+ dump_charinfo_variants(get_charinfo_hor_variants(co));
+ }
}
-void
-dump_font (int f) {
- int i,x;
-
- set_font_used(f,0);
- font_tables[f]->charinfo_cache = NULL;
- dump_things(*(font_tables[f]), 1);
- dump_string(font_name(f));
- dump_string(font_area(f));
- dump_string(font_filename(f));
- dump_string(font_fullname(f));
- dump_string(font_encodingname(f));
- dump_string(font_cidregistry(f));
- dump_string(font_cidordering(f));
-
- dump_things(*param_base(f),(font_params(f)+1));
-
- if (has_left_boundary(f)) {
- dump_int(1); dump_charinfo(f,left_boundarychar);
- } else {
- dump_int(0);
- }
- if (has_right_boundary(f)) {
- dump_int(1); dump_charinfo(f,right_boundarychar);
- } else {
- dump_int(0);
- }
+void dump_font(int f)
+{
+ int i, x;
+
+ set_font_used(f, 0);
+ font_tables[f]->charinfo_cache = NULL;
+ dump_things(*(font_tables[f]), 1);
+ dump_string(font_name(f));
+ dump_string(font_area(f));
+ dump_string(font_filename(f));
+ dump_string(font_fullname(f));
+ dump_string(font_encodingname(f));
+ dump_string(font_cidregistry(f));
+ dump_string(font_cidordering(f));
+
+ dump_things(*param_base(f), (font_params(f) + 1));
+
+ if (font_math_params(f) > 0) {
+ dump_things(*math_param_base(f), (font_math_params(f)));
+ }
+ if (has_left_boundary(f)) {
+ dump_int(1);
+ dump_charinfo(f, left_boundarychar);
+ } else {
+ dump_int(0);
+ }
+ if (has_right_boundary(f)) {
+ dump_int(1);
+ dump_charinfo(f, right_boundarychar);
+ } else {
+ dump_int(0);
+ }
- for(i=font_bc(f); i<=font_ec(f); i++) {
- if (char_exists(f,i)) {
- dump_charinfo(f,i);
+ for (i = font_bc(f); i <= font_ec(f); i++) {
+ if (char_exists(f, i)) {
+ dump_charinfo(f, i);
+ }
}
- }
}
-int
-undump_charinfo (int f) {
- charinfo *co;
- int x,i;
- char *s = NULL;
- liginfo *lig = NULL;
- kerninfo *kern = NULL;
- real_eight_bits *packet = NULL;
- int top = 0, bot = 0, mid = 0, rep = 0;
-
- undump_int(i);
- co = get_charinfo(f,i);
- undump_int(x); set_charinfo_width(co,x);
- undump_int(x); set_charinfo_height(co,x);
- undump_int(x); set_charinfo_depth(co,x);
- undump_int(x); set_charinfo_italic(co,x);
- undump_int(x); set_charinfo_tag(co,x);
- undump_int(x); set_charinfo_ef(co,x);
- undump_int(x); set_charinfo_rp(co,x);
- undump_int(x); set_charinfo_lp(co,x);
- undump_int(x); set_charinfo_remainder(co,x);
- undump_int(x); set_charinfo_used(co,x);
- undump_int(x); set_charinfo_index(co,x);
-
- /* name */
- undump_int (x);
- if (x>0) {
- font_bytes += x;
- s = xmalloc(x);
- undump_things(*s,x);
- }
- set_charinfo_name(co,s);
-
- /* tounicode */
- undump_int (x);
- if (x>0) {
- font_bytes += x;
- s = xmalloc(x);
- undump_things(*s,x);
- }
- set_charinfo_tounicode(co,s);
-
- /* ligatures */
- undump_int (x);
- if (x>0) {
- font_bytes += x*sizeof(liginfo);
- lig = xmalloc(x*sizeof(liginfo));
- undump_things(*lig,x);
- }
- set_charinfo_ligatures(co,lig);
-
- /* kerns */
- undump_int (x);
- if (x>0) {
- font_bytes += x*sizeof(kerninfo);
- kern = xmalloc(x*sizeof(kerninfo));
- undump_things(*kern,x);
- }
- set_charinfo_kerns(co,kern);
-
- /* packets */
- undump_int (x);
- if (x>0) {
- font_bytes += x;
- packet = xmalloc(x);
- undump_things(*packet,x);
- }
- set_charinfo_packets(co,packet);
-
- if (get_charinfo_tag(co)==ext_tag) {
- undump_int(top);
- undump_int(bot);
- undump_int(mid);
- undump_int(rep);
- set_charinfo_extensible(co,top,bot,mid,rep);
- }
- return i;
+int undump_charinfo(int f)
+{
+ charinfo *co;
+ int x, i;
+ char *s = NULL;
+ liginfo *lig = NULL;
+ kerninfo *kern = NULL;
+ real_eight_bits *packet = NULL;
+
+ undump_int(i);
+ co = get_charinfo(f, i);
+ undump_int(x);
+ set_charinfo_width(co, x);
+ undump_int(x);
+ set_charinfo_height(co, x);
+ undump_int(x);
+ set_charinfo_depth(co, x);
+ undump_int(x);
+ set_charinfo_italic(co, x);
+ undump_int(x);
+ set_charinfo_top_accent(co, x);
+ undump_int(x);
+ set_charinfo_bot_accent(co, x);
+ undump_int(x);
+ set_charinfo_tag(co, x);
+ undump_int(x);
+ set_charinfo_ef(co, x);
+ undump_int(x);
+ set_charinfo_rp(co, x);
+ undump_int(x);
+ set_charinfo_lp(co, x);
+ undump_int(x);
+ set_charinfo_remainder(co, x);
+ undump_int(x);
+ set_charinfo_used(co, x);
+ undump_int(x);
+ set_charinfo_index(co, x);
+
+ /* name */
+ undump_int(x);
+ if (x > 0) {
+ font_bytes += x;
+ s = xmalloc(x);
+ undump_things(*s, x);
+ }
+ set_charinfo_name(co, s);
+ /* tounicode */
+ undump_int(x);
+ if (x > 0) {
+ font_bytes += x;
+ s = xmalloc(x);
+ undump_things(*s, x);
+ }
+ set_charinfo_tounicode(co, s);
+ /* ligatures */
+ undump_int(x);
+ if (x > 0) {
+ font_bytes += x * sizeof(liginfo);
+ lig = xmalloc(x * sizeof(liginfo));
+ undump_things(*lig, x);
+ }
+ set_charinfo_ligatures(co, lig);
+ /* kerns */
+ undump_int(x);
+ if (x > 0) {
+ font_bytes += x * sizeof(kerninfo);
+ kern = xmalloc(x * sizeof(kerninfo));
+ undump_things(*kern, x);
+ }
+ set_charinfo_kerns(co, kern);
+
+ /* packets */
+ undump_int(x);
+ if (x > 0) {
+ font_bytes += x;
+ packet = xmalloc(x);
+ undump_things(*packet, x);
+ }
+ set_charinfo_packets(co, packet);
+
+ if (get_charinfo_tag(co) == ext_tag) {
+ set_charinfo_vert_variants(co, undump_charinfo_variants());
+ set_charinfo_hor_variants(co, undump_charinfo_variants());
+ }
+ return i;
}
-#define undump_font_string(a) undump_int (x); \
- if (x>0) { \
- font_bytes += x; \
- s = xmalloc(x); undump_things(*s,x); \
+#define undump_font_string(a) undump_int (x); \
+ if (x>0) { \
+ font_bytes += x; \
+ s = xmalloc(x); undump_things(*s,x); \
a(f,s); }
-void
-undump_font(int f)
-{
- int x, i;
- texfont *tt;
- charinfo *ci;
- char *s;
- grow_font_table (f);
- font_tables[f] = NULL;
- font_bytes += sizeof(texfont);
- tt = xmalloc(sizeof(texfont));
- undump_things(*tt,1);
- font_tables[f] = tt;
-
- undump_font_string(set_font_name);
- undump_font_string(set_font_area);
- undump_font_string(set_font_filename);
- undump_font_string(set_font_fullname);
- undump_font_string(set_font_encodingname);
- undump_font_string(set_font_cidregistry);
- undump_font_string(set_font_cidordering);
-
- i = sizeof(*param_base(f))*(font_params(f)+1);
- font_bytes += i;
- param_base(f) = xmalloc (i);
- undump_things(*param_base(f), (font_params(f)+1));
-
- font_tables[f]->_left_boundary = NULL;
- undump_int(x);
- if (x) { i = undump_charinfo(f); } /* left boundary */
-
- font_tables[f]->_right_boundary = NULL;
- undump_int(x);
- if (x) { i = undump_charinfo(f); } /* right boundary */
-
-
- font_tables[f]->characters = new_sa_tree(1, 0); /* stack size 1, default item value 0 */
- ci = xcalloc(1,sizeof(charinfo));
- set_charinfo_name(ci,xstrdup(".notdef"));
- font_tables[f]->charinfo = ci;
-
- i = font_bc(f);
- while(i<font_ec(f)) {
- i = undump_charinfo(f);
- }
-}
+void undump_font(int f)
+{
+ int x, i;
+ texfont *tt;
+ charinfo *ci;
+ char *s;
+ grow_font_table(f);
+ font_tables[f] = NULL;
+ font_bytes += sizeof(texfont);
+ tt = xmalloc(sizeof(texfont));
+ undump_things(*tt, 1);
+ /* these |char *| need resetting */
+ tt->_font_name = NULL;
+ tt->_font_area = NULL;
+ tt->_font_filename = NULL;
+ tt->_font_fullname = NULL;
+ tt->_font_encodingname = NULL;
+ tt->_font_cidregistry = NULL;
+ tt->_font_cidordering = NULL;
+ font_tables[f] = tt;
+
+ undump_font_string(set_font_name);
+ undump_font_string(set_font_area);
+ undump_font_string(set_font_filename);
+ undump_font_string(set_font_fullname);
+ undump_font_string(set_font_encodingname);
+ undump_font_string(set_font_cidregistry);
+ undump_font_string(set_font_cidordering);
+
+ i = sizeof(*param_base(f)) * (font_params(f) + 1);
+ font_bytes += i;
+ param_base(f) = xmalloc(i);
+ undump_things(*param_base(f), (font_params(f) + 1));
+
+ if (font_math_params(f) > 0) {
+ i = sizeof(*math_param_base(f)) * (font_math_params(f) + 1);
+ font_bytes += i;
+ math_param_base(f) = xmalloc(i);
+ undump_things(*math_param_base(f), (font_math_params(f) + 1));
+ } else {
+ math_param_base(f) = NULL;
+ }
+ font_tables[f]->_left_boundary = NULL;
+ undump_int(x);
+ if (x) {
+ i = undump_charinfo(f);
+ }
+ /* left boundary */
+ font_tables[f]->_right_boundary = NULL;
+ undump_int(x);
+ if (x) {
+ i = undump_charinfo(f);
+ }
+
+ /* right boundary */
+ font_tables[f]->characters = new_sa_tree(1, 0); /* stack size 1, default item value 0 */
+ ci = xcalloc(1, sizeof(charinfo));
+ set_charinfo_name(ci, xstrdup(".notdef"));
+ font_tables[f]->charinfo = ci;
+
+ i = font_bc(f);
+ while (i < font_ec(f)) {
+ i = undump_charinfo(f);
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.h b/Build/source/texk/web2c/luatexdir/font/texfont.h
index 21b79f1e876..f91d00dc2b1 100644
--- a/Build/source/texk/web2c/luatexdir/font/texfont.h
+++ b/Build/source/texk/web2c/luatexdir/font/texfont.h
@@ -1,23 +1,23 @@
-/*
- Copyright (c) 1996-2006 Taco Hoekwater <taco@luatex.org>
-
- This file is part of LuaTeX.
-
- LuaTeX is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- LuaTeX is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LuaTeX; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- $Id: texfont.h 1117 2008-03-21 15:26:12Z hhenkel $ */
+/* texfont.h Main font API implementation for the pascal parts
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: texfont.h 2057 2009-03-19 15:45:47Z taco $ */
/* Here we have the interface to LuaTeX's font system, as seen from the
main pascal program. There is a companion list in luatex.defines to
@@ -28,41 +28,53 @@
*/
#ifndef TEXFONT_H
-#define TEXFONT_H 1
+# define TEXFONT_H 1
-#include "luatexdir/managed-sa.h"
+# include "luatexdir/managed-sa.h"
-#define pointer halfword
+# define pointer halfword
typedef struct liginfo {
- integer adj;
- integer lig;
- char type;
+ integer adj;
+ integer lig;
+ char type;
} liginfo;
typedef struct kerninfo {
- integer adj;
- scaled sc;
+ integer adj;
+ scaled sc;
} kerninfo;
+typedef struct extinfo {
+ struct extinfo *next;
+ int glyph;
+ int start_overlap;
+ int end_overlap;
+ int advance;
+ int extender;
+} extinfo;
+
typedef struct charinfo {
- char *name; /* postscript character name */
- liginfo *ligatures; /* ligature items */
- kerninfo *kerns; /* kern items */
- real_eight_bits *packets; /* virtual commands. */
- integer *extensible; /* extensible recipe (if any) */
- unsigned short index; /* CID index */
- integer remainder; /* spare value for odd items, could be union-ed with extensible */
- scaled width; /* width */
- scaled height; /* height */
- scaled depth; /* depth */
- scaled italic; /* italic correction */
- integer ef; /* font expansion factor */
- integer lp; /* left protruding factor */
- integer rp; /* right protruding factor */
- char tag ; /* list / ext taginfo */
- char used ; /* char is typeset ? */
- char *tounicode; /* unicode equivalent */
+ char *name; /* postscript character name */
+ liginfo *ligatures; /* ligature items */
+ kerninfo *kerns; /* kern items */
+ real_eight_bits *packets; /* virtual commands. */
+ unsigned short index; /* CID index */
+ integer remainder; /* spare value for odd items, could be union-ed with extensible */
+ scaled width; /* width */
+ scaled height; /* height */
+ scaled depth; /* depth */
+ scaled italic; /* italic correction */
+ scaled top_accent; /* top accent alignment */
+ scaled bot_accent; /* bot accent alignment */
+ integer ef; /* font expansion factor */
+ integer lp; /* left protruding factor */
+ integer rp; /* right protruding factor */
+ char tag; /* list / ext taginfo */
+ char used; /* char is typeset ? */
+ char *tounicode; /* unicode equivalent */
+ extinfo *hor_variants; /* horizontal variants */
+ extinfo *vert_variants; /* vertical variants */
} charinfo;
@@ -71,94 +83,111 @@ typedef struct charinfo {
at the same time. the structure |charinfo_short| is defined in
web */
-#ifndef luaTeX
+# ifndef luaTeX
typedef struct charinfo_short {
- scaled ci_wd; /* width */
- scaled ci_ht; /* height */
- scaled ci_dp; /* depth */
+ scaled ci_wd; /* width */
+ scaled ci_ht; /* height */
+ scaled ci_dp; /* depth */
} charinfo_short;
-#endif
+# endif
+# define EXT_NORMAL 0
+# define EXT_REPEAT 1
-extern charinfo_short char_info_short (internal_font_number f, integer c);
+extern extinfo *get_charinfo_vert_variants(charinfo * ci);
+extern extinfo *get_charinfo_hor_variants(charinfo * ci);
+extern void set_charinfo_hor_variants(charinfo * ci, extinfo * ext);
+extern void set_charinfo_vert_variants(charinfo * ci, extinfo * ext);
+extern void add_charinfo_vert_variant(charinfo * ci, extinfo * ext);
+extern void add_charinfo_hor_variant(charinfo * ci, extinfo * ext);
+
+extern extinfo *copy_variants(extinfo * o);
+
+extern extinfo *new_variant(int glyph, int startconnect, int endconnect,
+ int advance, int repeater);
+
+extern charinfo_short char_info_short(internal_font_number f, integer c);
typedef struct texfont {
- integer _font_size ;
- integer _font_dsize ;
- char * _font_name ;
- char * _font_area ;
- char * _font_filename ;
- char * _font_fullname ;
- char * _font_encodingname ;
- char * _font_cidregistry ;
- char * _font_cidordering ;
- integer _font_cidversion ;
- integer _font_cidsupplement ;
-
- integer _font_ec ;
- integer _font_checksum ; /* internal information */
- char _font_used ; /* internal information */
- char _font_touched ; /* internal information */
- integer _font_cache_id ; /* internal information */
- char _font_encodingbytes ; /* 1 or 2 bytes */
- integer _font_slant ; /* a slant in ppt */
- integer _font_extend ; /* an extension in ppt, or 0 */
- char _font_tounicode ; /* 1 if info is present */
- fm_entry_ptr _font_map;
- integer _font_type;
- integer _font_format;
- integer _font_embedding;
- integer _font_bc ;
- integer _hyphen_char ;
- integer _skew_char ;
- integer _font_natural_dir;
-
- charinfo *_left_boundary;
- charinfo *_right_boundary;
-
- integer _font_params;
- scaled *_param_base;
-
- sa_tree characters;
- integer charinfo_count;
- integer charinfo_size;
- charinfo *charinfo;
- int *charinfo_cache;
- integer ligatures_disabled;
-
- integer _pdf_font_num; /* maps to a PDF resource ID */
- scaled _pdf_font_size; /* maps to a PDF font size */
- internal_font_number _pdf_font_blink; /* link to base font for expanded fonts */
- internal_font_number _pdf_font_elink; /* link to expanded fonts for base font */
- integer _pdf_font_expand_ratio; /* expansion ratio of a particular font */
- internal_font_number _pdf_font_shrink; /* font at limit of shrinking */
- internal_font_number _pdf_font_stretch; /* font at limit of stretching */
- integer _pdf_font_step; /* amount of one step of expansion */
- boolean _pdf_font_auto_expand; /* this font is auto-expanded? */
- str_number _pdf_font_attr; /* pointer to additional attributes */
+ integer _font_size;
+ integer _font_dsize;
+ char *_font_name;
+ char *_font_area;
+ char *_font_filename;
+ char *_font_fullname;
+ char *_font_encodingname;
+ char *_font_cidregistry;
+ char *_font_cidordering;
+ integer _font_cidversion;
+ integer _font_cidsupplement;
+
+ integer _font_ec;
+ unsigned _font_checksum; /* internal information */
+ char _font_used; /* internal information */
+ char _font_touched; /* internal information */
+ integer _font_cache_id; /* internal information */
+ char _font_encodingbytes; /* 1 or 2 bytes */
+ integer _font_slant; /* a slant in ppt */
+ integer _font_extend; /* an extension in ppt, or 0 */
+ char _font_tounicode; /* 1 if info is present */
+ fm_entry_ptr _font_map;
+ integer _font_type;
+ integer _font_format;
+ integer _font_embedding;
+ integer _font_bc;
+ integer _hyphen_char;
+ integer _skew_char;
+ integer _font_natural_dir;
+
+ charinfo *_left_boundary;
+ charinfo *_right_boundary;
+
+ integer _font_params;
+ scaled *_param_base;
+
+ integer _font_math_params;
+ scaled *_math_param_base;
+
+ sa_tree characters;
+ integer charinfo_count;
+ integer charinfo_size;
+ charinfo *charinfo;
+ int *charinfo_cache;
+ integer ligatures_disabled;
+
+ integer _pdf_font_num; /* maps to a PDF resource ID */
+ scaled _pdf_font_size; /* maps to a PDF font size */
+ internal_font_number _pdf_font_blink; /* link to base font for expanded fonts */
+ internal_font_number _pdf_font_elink; /* link to expanded fonts for base font */
+ integer _pdf_font_expand_ratio; /* expansion ratio of a particular font */
+ internal_font_number _pdf_font_shrink; /* font at limit of shrinking */
+ internal_font_number _pdf_font_stretch; /* font at limit of stretching */
+ integer _pdf_font_step; /* amount of one step of expansion */
+ boolean _pdf_font_auto_expand; /* this font is auto-expanded? */
+ str_number _pdf_font_attr; /* pointer to additional attributes */
} texfont;
typedef enum {
- unknown_font_type=0, /* new font (has not been used yet) */
- virtual_font_type, /* virtual font */
- real_font_type, /* real font */
+ unknown_font_type = 0, /* new font (has not been used yet) */
+ virtual_font_type, /* virtual font */
+ real_font_type, /* real font */
} font_types;
typedef enum {
- unknown_format=0,
- type1_format,
- type3_format,
- truetype_format,
- opentype_format,
+ unknown_format = 0,
+ type1_format,
+ type3_format,
+ truetype_format,
+ opentype_format,
} font_formats;
typedef enum {
- unknown_embedding=0,
- no_embedding,
- subset_embedding,
- full_embedding,
+ unknown_embedding = 0,
+ no_embedding,
+ subset_embedding,
+ full_embedding,
} font_embedding_option;
extern char *font_type_strings[];
@@ -166,359 +195,391 @@ extern char *font_format_strings[];
extern char *font_embedding_strings[];
-#define font_checksum(a) font_tables[a]->_font_checksum
-#define set_font_checksum(a,b) font_checksum(a) = b
+# define font_checksum(a) font_tables[a]->_font_checksum
+# define set_font_checksum(a,b) font_checksum(a) = b
-#define font_check_0(a) ((font_tables[a]->_font_checksum&0xFF000000)>>24)
-#define font_check_1(a) ((font_tables[a]->_font_checksum&0x00FF0000)>>16)
-#define font_check_2(a) ((font_tables[a]->_font_checksum&0x0000FF00)>>8)
-#define font_check_3(a) (font_tables[a]->_font_checksum&0x000000FF)
+# define font_check_0(a) ((font_tables[a]->_font_checksum&0xFF000000)>>24)
+# define font_check_1(a) ((font_tables[a]->_font_checksum&0x00FF0000)>>16)
+# define font_check_2(a) ((font_tables[a]->_font_checksum&0x0000FF00)>>8)
+# define font_check_3(a) (font_tables[a]->_font_checksum&0x000000FF)
-#define font_size(a) font_tables[a]->_font_size
-#define set_font_size(a,b) font_size(a) = b
-#define font_dsize(a) font_tables[a]->_font_dsize
-#define set_font_dsize(a,b) font_dsize(a) = b
+# define font_size(a) font_tables[a]->_font_size
+# define set_font_size(a,b) font_size(a) = b
+# define font_dsize(a) font_tables[a]->_font_dsize
+# define set_font_dsize(a,b) font_dsize(a) = b
-#define font_name(a) font_tables[a]->_font_name
-#define get_font_name(a) (unsigned char *)font_name(a)
-#define set_font_name(f,b) font_name(f) = b
-#define tex_font_name(a) maketexstring(font_name(a))
+# define font_name(a) font_tables[a]->_font_name
+# define get_font_name(a) (unsigned char *)font_name(a)
+# define set_font_name(f,b) font_name(f) = b
+# define tex_font_name(a) maketexstring(font_name(a))
-boolean cmp_font_name (integer, strnumber);
+boolean cmp_font_name(integer, strnumber);
-#define font_area(a) font_tables[a]->_font_area
-#define get_font_area(a) (unsigned char *)font_area(a)
-#define set_font_area(f,b) font_area(f) = b
-#define tex_font_area(a) maketexstring(font_area(a))
+# define font_area(a) font_tables[a]->_font_area
+# define get_font_area(a) (unsigned char *)font_area(a)
+# define set_font_area(f,b) font_area(f) = b
+# define tex_font_area(a) maketexstring(font_area(a))
-boolean cmp_font_area (integer, strnumber);
+boolean cmp_font_area(integer, strnumber);
-#define font_reassign(a,b) { if (a!=NULL) free(a); a = b; }
+# define font_reassign(a,b) { if (a!=NULL) free(a); a = b; }
-#define font_filename(a) font_tables[a]->_font_filename
-#define set_font_filename(f,b) font_reassign(font_filename(f),b)
+# define font_filename(a) font_tables[a]->_font_filename
+# define set_font_filename(f,b) font_reassign(font_filename(f),b)
-#define font_fullname(a) font_tables[a]->_font_fullname
-#define set_font_fullname(f,b) font_reassign(font_fullname(f),b)
+# define font_fullname(a) font_tables[a]->_font_fullname
+# define set_font_fullname(f,b) font_reassign(font_fullname(f),b)
-#define font_encodingname(a) font_tables[a]->_font_encodingname
-#define set_font_encodingname(f,b) font_reassign(font_encodingname(f),b)
+# define font_encodingname(a) font_tables[a]->_font_encodingname
+# define set_font_encodingname(f,b) font_reassign(font_encodingname(f),b)
-boolean font_shareable(internal_font_number,internal_font_number);
+boolean font_shareable(internal_font_number, internal_font_number);
-#define cmp_font_filename(a,b) (!(font_filename(a)!=NULL || font_filename(b)!=NULL || \
+# define cmp_font_filename(a,b) (!(font_filename(a)!=NULL || font_filename(b)!=NULL || \
strcmp(font_filename(a),font_filename(b))))
-#define cmp_font_fullname(a,b) (!(font_fullname(a)!=NULL || font_fullname(b)!=NULL || \
+# define cmp_font_fullname(a,b) (!(font_fullname(a)!=NULL || font_fullname(b)!=NULL || \
strcmp(font_fullname(a),font_fullname(b))))
-#define cmp_font_encodingname(a,b) (!(font_encoding(a)!=NULL || font_encodingname(b)!=NULL || \
+# define cmp_font_encodingname(a,b) (!(font_encoding(a)!=NULL || font_encodingname(b)!=NULL || \
strcmp(font_encodingname(a),font_encodingname(b))))
-#define font_bc(a) font_tables[a]->_font_bc
-#define set_font_bc(f,b) font_bc(f) = b
+# define font_bc(a) font_tables[a]->_font_bc
+# define set_font_bc(f,b) font_bc(f) = b
-#define font_ec(a) font_tables[a]->_font_ec
-#define set_font_ec(f,b) font_ec(f) = b
+# define font_ec(a) font_tables[a]->_font_ec
+# define set_font_ec(f,b) font_ec(f) = b
-#define font_used(a) (font_tables[a]!=NULL && font_tables[a]->_font_used)
-#define set_font_used(a,b) font_tables[a]->_font_used = b
+# define font_used(a) (font_tables[a]!=NULL && font_tables[a]->_font_used)
+# define set_font_used(a,b) font_tables[a]->_font_used = b
-#define font_touched(a) font_tables[a]->_font_touched
-#define set_font_touched(a,b) font_touched(a) = b
-
-#define font_type(a) font_tables[a]->_font_type
-#define set_font_type(a,b) { /* fprintf(stdout,"set font type of %s to %i: %s\n",font_name(a),b,__FILE__); */ \
+# define font_touched(a) font_tables[a]->_font_touched
+# define set_font_touched(a,b) font_touched(a) = b
+
+# define font_type(a) font_tables[a]->_font_type
+# define set_font_type(a,b) { /* fprintf(stdout,"set font type of %s to %i: %s\n",font_name(a),b,__FILE__); */ \
font_type(a) = b; }
-#define font_format(a) font_tables[a]->_font_format
-#define font_format_name(a) font_format_strings[font_tables[a]->_font_format]
-#define set_font_format(a,b) font_format(a) = b
+# define font_format(a) font_tables[a]->_font_format
+# define font_format_name(a) font_format_strings[font_tables[a]->_font_format]
+# define set_font_format(a,b) font_format(a) = b
-#define font_embedding(a) font_tables[a]->_font_embedding
-#define set_font_embedding(a,b) font_embedding(a) = b
+# define font_embedding(a) font_tables[a]->_font_embedding
+# define set_font_embedding(a,b) font_embedding(a) = b
-#define font_cidversion(a) font_tables[a]->_font_cidversion
-#define set_font_cidversion(a,b) font_cidversion(a) = b
+# define font_cidversion(a) font_tables[a]->_font_cidversion
+# define set_font_cidversion(a,b) font_cidversion(a) = b
-#define font_cidsupplement(a) font_tables[a]->_font_cidsupplement
-#define set_font_cidsupplement(a,b) font_cidsupplement(a) = b
+# define font_cidsupplement(a) font_tables[a]->_font_cidsupplement
+# define set_font_cidsupplement(a,b) font_cidsupplement(a) = b
-#define font_cidordering(a) font_tables[a]->_font_cidordering
-#define set_font_cidordering(f,b) font_reassign(font_cidordering(f),b)
+# define font_cidordering(a) font_tables[a]->_font_cidordering
+# define set_font_cidordering(f,b) font_reassign(font_cidordering(f),b)
-#define font_cidregistry(a) font_tables[a]->_font_cidregistry
-#define set_font_cidregistry(f,b) font_reassign(font_cidregistry(f),b)
+# define font_cidregistry(a) font_tables[a]->_font_cidregistry
+# define set_font_cidregistry(f,b) font_reassign(font_cidregistry(f),b)
-#define font_map(a) font_tables[a]->_font_map
-#define set_font_map(a,b) font_map(a) = b
+# define font_map(a) font_tables[a]->_font_map
+# define set_font_map(a,b) font_map(a) = b
-#define font_cache_id(a) font_tables[a]->_font_cache_id
-#define set_font_cache_id(a,b) font_cache_id(a) = b
+# define font_cache_id(a) font_tables[a]->_font_cache_id
+# define set_font_cache_id(a,b) font_cache_id(a) = b
-#define font_encodingbytes(a) font_tables[a]->_font_encodingbytes
-#define set_font_encodingbytes(a,b) font_encodingbytes(a) = b
+# define font_encodingbytes(a) font_tables[a]->_font_encodingbytes
+# define set_font_encodingbytes(a,b) font_encodingbytes(a) = b
-#define font_slant(a) font_tables[a]->_font_slant
-#define set_font_slant(a,b) font_slant(a) = b
+# define font_slant(a) font_tables[a]->_font_slant
+# define set_font_slant(a,b) font_slant(a) = b
-#define font_extend(a) font_tables[a]->_font_extend
-#define set_font_extend(a,b) font_extend(a) = b
+# define font_extend(a) font_tables[a]->_font_extend
+# define set_font_extend(a,b) font_extend(a) = b
-#define font_tounicode(a) font_tables[a]->_font_tounicode
-#define set_font_tounicode(a,b) font_tounicode(a) = b
+# define font_tounicode(a) font_tables[a]->_font_tounicode
+# define set_font_tounicode(a,b) font_tounicode(a) = b
-#define hyphen_char(a) font_tables[a]->_hyphen_char
-#define set_hyphen_char(a,b) hyphen_char(a) = b
+# define hyphen_char(a) font_tables[a]->_hyphen_char
+# define set_hyphen_char(a,b) hyphen_char(a) = b
-#define skew_char(a) font_tables[a]->_skew_char
-#define set_skew_char(a,b) skew_char(a) = b
+# define skew_char(a) font_tables[a]->_skew_char
+# define set_skew_char(a,b) skew_char(a) = b
-#define font_natural_dir(a) font_tables[a]->_font_natural_dir
-#define set_font_natural_dir(a,b) font_natural_dir(a) = b
+# define font_natural_dir(a) font_tables[a]->_font_natural_dir
+# define set_font_natural_dir(a,b) font_natural_dir(a) = b
-#define pdf_font_size(a) font_tables[a]->_pdf_font_size
-#define set_pdf_font_size(a,b) pdf_font_size(a) = b
+# define pdf_font_size(a) font_tables[a]->_pdf_font_size
+# define set_pdf_font_size(a,b) pdf_font_size(a) = b
-#define pdf_font_num(a) font_tables[a]->_pdf_font_num
-#define set_pdf_font_num(a,b) pdf_font_num(a) = b
+# define pdf_font_num(a) font_tables[a]->_pdf_font_num
+# define set_pdf_font_num(a,b) pdf_font_num(a) = b
-#define pdf_font_blink(a) font_tables[a]->_pdf_font_blink
-#define set_pdf_font_blink(a,b) pdf_font_blink(a) = b
+# define pdf_font_blink(a) font_tables[a]->_pdf_font_blink
+# define set_pdf_font_blink(a,b) pdf_font_blink(a) = b
-#define pdf_font_elink(a) font_tables[a]->_pdf_font_elink
-#define set_pdf_font_elink(a,b) pdf_font_elink(a) = b
+# define pdf_font_elink(a) font_tables[a]->_pdf_font_elink
+# define set_pdf_font_elink(a,b) pdf_font_elink(a) = b
-#define pdf_font_expand_ratio(a) font_tables[a]->_pdf_font_expand_ratio
-#define set_pdf_font_expand_ratio(a,b) pdf_font_expand_ratio(a) = b
+# define pdf_font_expand_ratio(a) font_tables[a]->_pdf_font_expand_ratio
+# define set_pdf_font_expand_ratio(a,b) pdf_font_expand_ratio(a) = b
-#define pdf_font_shrink(a) font_tables[a]->_pdf_font_shrink
-#define set_pdf_font_shrink(a,b) pdf_font_shrink(a) = b
+# define pdf_font_shrink(a) font_tables[a]->_pdf_font_shrink
+# define set_pdf_font_shrink(a,b) pdf_font_shrink(a) = b
-#define pdf_font_stretch(a) font_tables[a]->_pdf_font_stretch
-#define set_pdf_font_stretch(a,b) pdf_font_stretch(a) = b
+# define pdf_font_stretch(a) font_tables[a]->_pdf_font_stretch
+# define set_pdf_font_stretch(a,b) pdf_font_stretch(a) = b
-#define pdf_font_step(a) font_tables[a]->_pdf_font_step
-#define set_pdf_font_step(a,b) pdf_font_step(a) = b
+# define pdf_font_step(a) font_tables[a]->_pdf_font_step
+# define set_pdf_font_step(a,b) pdf_font_step(a) = b
-#define pdf_font_auto_expand(a) font_tables[a]->_pdf_font_auto_expand
-#define set_pdf_font_auto_expand(a,b) pdf_font_auto_expand(a) = b
+# define pdf_font_auto_expand(a) font_tables[a]->_pdf_font_auto_expand
+# define set_pdf_font_auto_expand(a,b) pdf_font_auto_expand(a) = b
-#define pdf_font_attr(a) font_tables[a]->_pdf_font_attr
-#define set_pdf_font_attr(a,b) pdf_font_attr(a) = b
+# define pdf_font_attr(a) font_tables[a]->_pdf_font_attr
+# define set_pdf_font_attr(a,b) pdf_font_attr(a) = b
-#define left_boundarychar -1
-#define right_boundarychar -2
-#define non_boundarychar -3
+# define left_boundarychar -1
+# define right_boundarychar -2
+# define non_boundarychar -3
-#define left_boundary(a) font_tables[a]->_left_boundary
-#define has_left_boundary(a) (left_boundary(a)!=NULL)
-#define set_left_boundary(a,b) font_reassign(left_boundary(a),b)
+# define left_boundary(a) font_tables[a]->_left_boundary
+# define has_left_boundary(a) (left_boundary(a)!=NULL)
+# define set_left_boundary(a,b) font_reassign(left_boundary(a),b)
-#define right_boundary(a) font_tables[a]->_right_boundary
-#define has_right_boundary(a) (right_boundary(a)!=NULL)
-#define set_right_boundary(a,b) font_reassign(right_boundary(a),b)
+# define right_boundary(a) font_tables[a]->_right_boundary
+# define has_right_boundary(a) (right_boundary(a)!=NULL)
+# define set_right_boundary(a,b) font_reassign(right_boundary(a),b)
-#define font_bchar(a) (right_boundary(a)!=NULL ? right_boundarychar : non_boundarychar)
+# define font_bchar(a) (right_boundary(a)!=NULL ? right_boundarychar : non_boundarychar)
/* font parameters */
-#define font_params(a) font_tables[a]->_font_params
-#define param_base(a) font_tables[a]->_param_base
-#define font_param(a,b) font_tables[a]->_param_base[b]
+# define font_params(a) font_tables[a]->_font_params
+# define param_base(a) font_tables[a]->_param_base
+# define font_param(a,b) font_tables[a]->_param_base[b]
extern void set_font_params(internal_font_number f, int b);
-#define set_font_param(f,n,b) \
+# define set_font_param(f,n,b) \
{ if (font_params(f)<n) set_font_params(f,n); \
font_param(f,n) = b; }
+
+# define font_math_params(a) font_tables[a]->_font_math_params
+# define math_param_base(a) font_tables[a]->_math_param_base
+# define font_math_param(a,b) font_tables[a]->_math_param_base[b]
+
+extern void set_font_math_params(internal_font_number f, int b);
+
+# define set_font_math_param(f,n,b) \
+ { if (font_math_params(f)<n) set_font_math_params(f,n); \
+ font_math_param(f,n) = b; }
+
/* Font parameters are sometimes referred to as |slant(f)|, |space(f)|, etc.*/
typedef enum {
- slant_code = 1,
- space_code = 2,
- space_stretch_code = 3,
- space_shrink_code = 4,
- x_height_code = 5,
- quad_code = 6,
- extra_space_code = 7 } font_parameter_codes ;
-
-#define slant(f) font_param(f,slant_code)
-#define space(f) font_param(f,space_code)
-#define space_stretch(f) font_param(f,space_stretch_code)
-#define space_shrink(f) font_param(f,space_shrink_code)
-#define x_height(f) font_param(f,x_height_code)
-#define quad(f) font_param(f,quad_code)
-#define extra_space(f) font_param(f,extra_space_code)
+ slant_code = 1,
+ space_code = 2,
+ space_stretch_code = 3,
+ space_shrink_code = 4,
+ x_height_code = 5,
+ quad_code = 6,
+ extra_space_code = 7
+} font_parameter_codes;
+
+# define slant(f) font_param(f,slant_code)
+# define space(f) font_param(f,space_code)
+# define space_stretch(f) font_param(f,space_stretch_code)
+# define space_shrink(f) font_param(f,space_shrink_code)
+# define x_height(f) font_param(f,x_height_code)
+# define quad(f) font_param(f,quad_code)
+# define extra_space(f) font_param(f,extra_space_code)
/* now for characters */
-extern charinfo *get_charinfo (internal_font_number f, integer c) ;
-extern integer char_exists (internal_font_number f, integer c);
-extern charinfo *char_info (internal_font_number f, integer c);
-
-
-extern void set_charinfo_width (charinfo *ci, scaled val);
-extern void set_charinfo_height (charinfo *ci, scaled val);
-extern void set_charinfo_depth (charinfo *ci, scaled val);
-extern void set_charinfo_italic (charinfo *ci, scaled val);
-extern void set_charinfo_tag (charinfo *ci, scaled val);
-extern void set_charinfo_remainder (charinfo *ci, scaled val);
-extern void set_charinfo_used (charinfo *ci, scaled val);
-extern void set_charinfo_index (charinfo *ci, scaled val);
-extern void set_charinfo_name (charinfo *ci, char *val) ;
-extern void set_charinfo_tounicode (charinfo *ci, char *val) ;
-extern void set_charinfo_ligatures (charinfo *ci, liginfo *val);
-extern void set_charinfo_kerns (charinfo *ci, kerninfo *val);
-extern void set_charinfo_packets (charinfo *ci, real_eight_bits *val);
-extern void set_charinfo_extensible (charinfo *ci, int a, int b, int c, int d);
-
-#define set_char_used(f,a,b) set_charinfo_used(get_charinfo(f,a),b)
-
-extern scaled get_charinfo_width (charinfo *ci);
-extern scaled get_charinfo_height (charinfo *ci);
-extern scaled get_charinfo_depth (charinfo *ci);
-extern scaled get_charinfo_italic (charinfo *ci);
-extern char get_charinfo_tag (charinfo *ci);
-extern integer get_charinfo_remainder (charinfo *ci);
-extern char get_charinfo_used (charinfo *ci);
-extern integer get_charinfo_index (charinfo *ci);
-extern char * get_charinfo_name (charinfo *ci) ;
-extern char * get_charinfo_tounicode (charinfo *ci) ;
-extern liginfo * get_charinfo_ligatures (charinfo *ci);
-extern kerninfo *get_charinfo_kerns (charinfo *ci);
-extern real_eight_bits *get_charinfo_packets (charinfo *ci);
-extern integer get_charinfo_extensible (charinfo *ci, int which);
-
-extern integer ext_top (internal_font_number f, integer c);
-extern integer ext_bot (internal_font_number f, integer c);
-extern integer ext_rep (internal_font_number f, integer c);
-extern integer ext_mid (internal_font_number f, integer c);
-
-#define set_ligature_item(f,b,c,d) { f.type = b; f.adj = c; f.lig = d; }
-
-#define set_kern_item(f,b,c) { f.adj = b; f.sc = c; }
+extern charinfo *get_charinfo(internal_font_number f, integer c);
+extern integer char_exists(internal_font_number f, integer c);
+extern charinfo *char_info(internal_font_number f, integer c);
+
+
+extern void set_charinfo_width(charinfo * ci, scaled val);
+extern void set_charinfo_height(charinfo * ci, scaled val);
+extern void set_charinfo_depth(charinfo * ci, scaled val);
+extern void set_charinfo_italic(charinfo * ci, scaled val);
+extern void set_charinfo_top_accent(charinfo * ci, scaled val);
+extern void set_charinfo_bot_accent(charinfo * ci, scaled val);
+extern void set_charinfo_tag(charinfo * ci, scaled val);
+extern void set_charinfo_remainder(charinfo * ci, scaled val);
+extern void set_charinfo_used(charinfo * ci, scaled val);
+extern void set_charinfo_index(charinfo * ci, scaled val);
+extern void set_charinfo_name(charinfo * ci, char *val);
+extern void set_charinfo_tounicode(charinfo * ci, char *val);
+extern void set_charinfo_ligatures(charinfo * ci, liginfo * val);
+extern void set_charinfo_kerns(charinfo * ci, kerninfo * val);
+extern void set_charinfo_packets(charinfo * ci, real_eight_bits * val);
+extern void set_charinfo_extensible(charinfo * ci, int a, int b, int c, int d);
+extern void set_charinfo_ef(charinfo * ci, scaled val);
+extern void set_charinfo_lp(charinfo * ci, scaled val);
+extern void set_charinfo_rp(charinfo * ci, scaled val);
+
+# define set_char_used(f,a,b) do { \
+ if (char_exists(f,a)) \
+ set_charinfo_used(char_info(f,a),b); \
+ } while (0)
+
+extern scaled get_charinfo_width(charinfo * ci);
+extern scaled get_charinfo_height(charinfo * ci);
+extern scaled get_charinfo_depth(charinfo * ci);
+extern scaled get_charinfo_italic(charinfo * ci);
+extern scaled get_charinfo_top_accent(charinfo * ci);
+extern scaled get_charinfo_bot_accent(charinfo * ci);
+extern char get_charinfo_tag(charinfo * ci);
+extern integer get_charinfo_remainder(charinfo * ci);
+extern char get_charinfo_used(charinfo * ci);
+extern integer get_charinfo_index(charinfo * ci);
+extern char *get_charinfo_name(charinfo * ci);
+extern char *get_charinfo_tounicode(charinfo * ci);
+extern liginfo *get_charinfo_ligatures(charinfo * ci);
+extern kerninfo *get_charinfo_kerns(charinfo * ci);
+extern real_eight_bits *get_charinfo_packets(charinfo * ci);
+extern integer get_charinfo_ef(charinfo * ci);
+extern integer get_charinfo_rp(charinfo * ci);
+extern integer get_charinfo_lp(charinfo * ci);
+extern integer get_charinfo_extensible(charinfo * ci, int which);
+
+extern integer ext_top(internal_font_number f, integer c);
+extern integer ext_bot(internal_font_number f, integer c);
+extern integer ext_rep(internal_font_number f, integer c);
+extern integer ext_mid(internal_font_number f, integer c);
+
+# define set_ligature_item(f,b,c,d) { f.type = b; f.adj = c; f.lig = d; }
+
+# define set_kern_item(f,b,c) { f.adj = b; f.sc = c; }
/* character information */
-#define non_char 65536 /* a code that can't match a real character */
-#define non_address 0 /* a spurious |bchar_label| */
+# define non_char 65536 /* a code that can't match a real character */
+# define non_address 0 /* a spurious |bchar_label| */
/* character kerns and ligatures */
-#define end_kern 0x7FFFFF /* otherchar value meaning "stop" */
-#define ignored_kern 0x800000 /* otherchar value meaning "disabled" */
+# define end_kern 0x7FFFFF
+ /* otherchar value meaning "stop" */
+# define ignored_kern 0x800000
+ /* otherchar value meaning "disabled" */
-#define charinfo_kern(b,c) b->kerns[c]
+# define charinfo_kern(b,c) b->kerns[c]
-#define kern_char(b) (b).adj
-#define kern_kern(b) (b).sc
-#define kern_end(b) ((b).adj == end_kern)
-#define kern_disabled(b) ((b).adj > end_kern)
+# define kern_char(b) (b).adj
+# define kern_kern(b) (b).sc
+# define kern_end(b) ((b).adj == end_kern)
+# define kern_disabled(b) ((b).adj > end_kern)
/* character ligatures */
-#define end_ligature 0x7FFFFF /* otherchar value meaning "stop" */
-#define ignored_ligature 0x800000 /* otherchar value meaning "disabled" */
-
-#define charinfo_ligature(b,c) b->ligatures[c]
-
-#define is_valid_ligature(a) ((a).type!=0)
-#define lig_type(a) ((a).type>>1)
-#define lig_char(a) (a).adj
-#define lig_replacement(a) (a).lig
-#define lig_end(a) (lig_char(a) == end_ligature)
-#define lig_disabled(a) (lig_char(a) > end_ligature)
-
-#define no_tag 0 /* vanilla character */
-#define lig_tag 1 /* character has a ligature/kerning program */
-#define list_tag 2 /* character has a successor in a charlist */
-#define ext_tag 3 /* character is extensible */
-
-extern scaled char_height (internal_font_number f, integer c);
-extern scaled char_width (internal_font_number f, integer c);
-extern scaled char_depth (internal_font_number f, integer c);
-extern scaled char_italic (internal_font_number f, integer c);
-
-extern liginfo * char_ligatures (internal_font_number f, integer c);
-extern kerninfo * char_kerns (internal_font_number f, integer c);
-extern real_eight_bits * char_packets (internal_font_number f, integer c);
-
-#define has_lig(f,b) (char_exists(f,b) &&( char_ligatures(f,b) != NULL))
-#define has_kern(f,b) (char_exists(f,b) && (char_kerns(f,b) != NULL))
-#define has_packet(f,b) (char_exists(f,b) && (char_packets(f,b) != NULL))
-
-extern integer char_remainder (internal_font_number f, integer c);
-extern char char_tag (internal_font_number f, integer c);
-extern char char_used (internal_font_number f, integer c);
-extern char * char_name (internal_font_number f, integer c);
-extern integer char_index (internal_font_number f, integer c);
-
+# define end_ligature 0x7FFFFF /* otherchar value meaning "stop" */
+# define ignored_ligature 0x800000 /* otherchar value meaning "disabled" */
+
+# define charinfo_ligature(b,c) b->ligatures[c]
+
+# define is_valid_ligature(a) ((a).type!=0)
+# define lig_type(a) ((a).type>>1)
+# define lig_char(a) (a).adj
+# define lig_replacement(a) (a).lig
+# define lig_end(a) (lig_char(a) == end_ligature)
+# define lig_disabled(a) (lig_char(a) > end_ligature)
+
+# define no_tag 0 /* vanilla character */
+# define lig_tag 1 /* character has a ligature/kerning program */
+# define list_tag 2 /* character has a successor in a charlist */
+# define ext_tag 3 /* character is extensible */
+
+extern scaled char_height(internal_font_number f, integer c);
+extern scaled char_width(internal_font_number f, integer c);
+extern scaled char_depth(internal_font_number f, integer c);
+extern scaled char_italic(internal_font_number f, integer c);
+extern scaled char_top_accent(internal_font_number f, integer c);
+extern scaled char_bot_accent(internal_font_number f, integer c);
+
+extern liginfo *char_ligatures(internal_font_number f, integer c);
+extern kerninfo *char_kerns(internal_font_number f, integer c);
+extern real_eight_bits *char_packets(internal_font_number f, integer c);
+
+# define has_lig(f,b) (char_exists(f,b) &&( char_ligatures(f,b) != NULL))
+# define has_kern(f,b) (char_exists(f,b) && (char_kerns(f,b) != NULL))
+# define has_packet(f,b) (char_exists(f,b) && (char_packets(f,b) != NULL))
+
+extern integer char_remainder(internal_font_number f, integer c);
+extern char char_tag(internal_font_number f, integer c);
+extern char char_used(internal_font_number f, integer c);
+extern char *char_name(internal_font_number f, integer c);
+extern integer char_index(internal_font_number f, integer c);
+
+scaled raw_get_kern(internalfontnumber f, integer lc, integer rc);
scaled get_kern(internalfontnumber f, integer lc, integer rc);
liginfo get_ligature(internalfontnumber f, integer lc, integer rc);
-#define EXT_TOP 0
-#define EXT_BOT 1
-#define EXT_MID 2
-#define EXT_REP 3
+# define EXT_TOP 0
+# define EXT_BOT 1
+# define EXT_MID 2
+# define EXT_REP 3
extern texfont **font_tables;
-integer new_font (void) ;
-integer copy_font (integer id) ;
-integer scale_font (integer id, integer atsize) ;
-integer max_font_id (void);
-void set_max_font_id (integer id);
-integer new_font_id (void);
-void create_null_font (void);
+integer new_font(void);
+integer copy_font(integer id);
+integer scale_font(integer id, integer atsize);
+integer max_font_id(void);
+void set_max_font_id(integer id);
+integer new_font_id(void);
+void create_null_font(void);
void delete_font(integer id);
-boolean is_valid_font (integer id);
+boolean is_valid_font(integer id);
-void dump_font (int font_number);
-void undump_font (int font_number);
+void dump_font(int font_number);
+void undump_font(int font_number);
-integer test_no_ligatures (internal_font_number f) ;
-void set_no_ligatures (internal_font_number f) ;
+integer test_no_ligatures(internal_font_number f);
+void set_no_ligatures(internal_font_number f);
-extern integer get_tag_code (internal_font_number f, integer c);
-extern integer get_lp_code (internal_font_number f, integer c);
-extern integer get_rp_code (internal_font_number f, integer c);
-extern integer get_ef_code (internal_font_number f, integer c);
+extern integer get_tag_code(internal_font_number f, integer c);
+extern integer get_lp_code(internal_font_number f, integer c);
+extern integer get_rp_code(internal_font_number f, integer c);
+extern integer get_ef_code(internal_font_number f, integer c);
-extern void set_tag_code (internal_font_number f, integer c, integer i) ;
-extern void set_lp_code(internal_font_number f, integer c, integer i) ;
-extern void set_rp_code(internal_font_number f, integer c, integer i) ;
-extern void set_ef_code(internal_font_number f, integer c, integer i) ;
+extern void set_tag_code(internal_font_number f, integer c, integer i);
+extern void set_lp_code(internal_font_number f, integer c, integer i);
+extern void set_rp_code(internal_font_number f, integer c, integer i);
+extern void set_ef_code(internal_font_number f, integer c, integer i);
int read_tfm_info(internal_font_number f, char *nom, char *aire, scaled s);
/* from dofont.c */
-extern int read_font_info (pointer u, strnumber nom, strnumber aire, scaled s, integer ndir);
-extern int find_font_id (char *nom, char *aire, scaled s);
+extern int read_font_info(pointer u, strnumber nom, scaled s, integer ndir);
+extern int find_font_id(char *nom, char *aire, scaled s);
/* for and from vfpacket.c */
-#define scan_special 3 /* look into special text */ /* this is a hack */
-
-typedef enum { packet_char_code,
- packet_font_code,
- packet_pop_code,
- packet_push_code,
- packet_special_code,
- packet_right_code,
- packet_down_code,
- packet_rule_code,
- packet_node_code,
- packet_nop_code,
- packet_end_code } packet_command_codes;
-
-extern scaled sqxfw (scaled sq, integer fw);
-
-extern void do_vf_packet (internal_font_number vf_f, integer c);
-extern int vf_packet_bytes (charinfo *co);
+# define scan_special 3 /* look into special text */ /* this is a hack */
+
+typedef enum { packet_char_code,
+ packet_font_code,
+ packet_pop_code,
+ packet_push_code,
+ packet_special_code,
+ packet_image_code,
+ packet_right_code,
+ packet_down_code,
+ packet_rule_code,
+ packet_node_code,
+ packet_nop_code,
+ packet_end_code
+} packet_command_codes;
+
+extern scaled sqxfw(scaled sq, integer fw);
+
+extern void do_vf_packet(internal_font_number vf_f, integer c);
+extern int vf_packet_bytes(charinfo * co);
#endif
diff --git a/Build/source/texk/web2c/luatexdir/font/tfmofm.c b/Build/source/texk/web2c/luatexdir/font/tfmofm.c
index db82f94deba..36364ba6d44 100644
--- a/Build/source/texk/web2c/luatexdir/font/tfmofm.c
+++ b/Build/source/texk/web2c/luatexdir/font/tfmofm.c
@@ -1,34 +1,34 @@
-/*
-Copyright (c) 1996-2006 Taco Hoekwater <taco@luatex.org>
-
-This file is part of LuaTeX.
+/* tfmofm.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-LuaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-LuaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with LuaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: tfmofm.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
-
#include "luatex-api.h"
+#include "luatexfont.h"
+
+static const char _svn_version[] =
+ "$Id: tfmofm.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/tfmofm.c $";
/* Here are some macros that help process ligatures and kerns */
#define lig_kern_start(f,c) char_remainder(f,c)
-#define stop_flag 128 /* value indicating `\.{STOP}' in a lig/kern program */
-#define kern_flag 128 /* op code for a kern step */
+#define stop_flag 128 /* value indicating `\.{STOP}' in a lig/kern program */
+#define kern_flag 128 /* op code for a kern step */
#define skip_byte(z) lig_kerns[z].b0
#define next_char(z) lig_kerns[z].b1
@@ -205,7 +205,7 @@ character does not exist in the font, since a character is valid if and
only if it lies between |bc| and |ec| and has a nonzero |width_index|.
*/
- /*
+/*
@ \TeX\ checks the information of a \.{TFM} file for validity as the
file is being read in, so that no further checks will be needed when
typesetting is going on. The somewhat tedious subroutine that does this
@@ -361,53 +361,54 @@ additional parameter information, which is explained later.
*/
-#define tfm_abort { font_tables[f]->_font_name = NULL; \
- font_tables[f]->_font_area = NULL; \
- xfree(tfm_buffer); xfree(kerns); \
- xfree(widths); xfree(heights); xfree(depths); \
- xfree(italics); xfree(extens); xfree(lig_kerns); \
- xfree(xligs); xfree(xkerns); \
- return 0; }
+#define tfm_abort { font_tables[f]->_font_name = NULL; \
+ font_tables[f]->_font_area = NULL; \
+ xfree(tfm_buffer); xfree(kerns); \
+ xfree(widths); xfree(heights); xfree(depths); \
+ xfree(italics); xfree(extens); xfree(lig_kerns); \
+ xfree(xligs); xfree(xkerns); \
+ return 0; }
-#define tfm_success { xfree(tfm_buffer); xfree(kerns); \
- xfree(widths); xfree(heights); xfree(depths); \
- xfree(italics); xfree(extens); xfree(lig_kerns); \
- xfree(xligs); xfree(xkerns); return 1; }
+#define tfm_success { xfree(tfm_buffer); xfree(kerns); \
+ xfree(widths); xfree(heights); xfree(depths); \
+ xfree(italics); xfree(extens); xfree(lig_kerns); \
+ xfree(xligs); xfree(xkerns); return 1; }
int
-open_tfm_file(char *nom, char *aire, unsigned char **tfm_buf, integer *tfm_siz) {
- boolean res; /* was the callback successful? */
- boolean opened; /* was |tfm_file| successfully opened?*/
- integer callback_id;
- FILE *tfm_file;
- /* packfilename(nom,aire,getnullstr()); */
- if(nameoffile != NULL)
- xfree(nameoffile);
- nameoffile = malloc(strlen(nom)+2);
- strcpy(stringcast(nameoffile+1),nom);
- namelength = strlen(nom);
- callback_id=callback_defined(read_font_file_callback);
- if (callback_id>0) {
- res = run_callback(callback_id,"S->bSd",stringcast(nameoffile+1),
- &opened, tfm_buf, tfm_siz);
- if (res && opened && (*tfm_siz>0)) {
- return 1;
- }
+open_tfm_file(char *nom, char *aire, unsigned char **tfm_buf, integer * tfm_siz)
+{
+ boolean res; /* was the callback successful? */
+ boolean opened; /* was |tfm_file| successfully opened? */
+ integer callback_id;
+ FILE *tfm_file;
+ /* packfilename(nom,aire,getnullstr()); */
+ if (nameoffile != NULL)
+ xfree(nameoffile);
+ nameoffile = malloc(strlen(nom) + 2);
+ strcpy(stringcast(nameoffile + 1), nom);
+ namelength = strlen(nom);
+ callback_id = callback_defined(read_font_file_callback);
+ if (callback_id > 0) {
+ res = run_callback(callback_id, "S->bSd", stringcast(nameoffile + 1),
+ &opened, tfm_buf, tfm_siz);
+ if (res && opened && (*tfm_siz > 0)) {
+ return 1;
+ }
if (!opened)
- return -1;
- } else {
- if (ofm_open_in(tfm_file)) {
- res = read_tfm_file(tfm_file,tfm_buf,tfm_siz);
- b_close(tfm_file);
- if (res) {
- return 1;
- }
+ return -1;
} else {
- return -1;
+ if (ofm_open_in(tfm_file)) {
+ res = read_tfm_file(tfm_file, tfm_buf, tfm_siz);
+ b_close(tfm_file);
+ if (res) {
+ return 1;
+ }
+ } else {
+ return -1;
+ }
}
- }
- return 0;
+ return 0;
}
@@ -441,47 +442,47 @@ open_tfm_file(char *nom, char *aire, unsigned char **tfm_buf, integer *tfm_siz)
a=(a*256)+tfm_buffer[++tfm_byte]; }
#define store_four_bytes(z) \
- { a=tfm_buffer[++tfm_byte]; \
- a=(a*256)+tfm_buffer[++tfm_byte]; \
- a=(a*256)+tfm_buffer[++tfm_byte]; \
- a=(a*256)+tfm_buffer[++tfm_byte]; \
+ { a=tfm_buffer[++tfm_byte]; \
+ a=(a*256)+tfm_buffer[++tfm_byte]; \
+ a=(a*256)+tfm_buffer[++tfm_byte]; \
+ a=(a*256)+tfm_buffer[++tfm_byte]; \
z = a; }
#define store_char_info(z) \
{ if (font_level!=-1) { \
- fget; read_sixteen_unsigned(a); \
- ci._width_index=a; \
- fget; read_sixteen_unsigned(b); \
- ci._height_index=b>>8; \
- ci._depth_index=b%256; \
- fget; read_sixteen_unsigned(c); \
- ci._italic_index=c>>8; \
- ci._tag=c%4; \
- fget; read_sixteen_unsigned(d); \
- ci._remainder=d; \
+ fget; read_sixteen_unsigned(a); \
+ ci._width_index=a; \
+ fget; read_sixteen_unsigned(b); \
+ ci._height_index=b>>8; \
+ ci._depth_index=b%256; \
+ fget; read_sixteen_unsigned(c); \
+ ci._italic_index=c>>8; \
+ ci._tag=c%4; \
+ fget; read_sixteen_unsigned(d); \
+ ci._remainder=d; \
} else { \
- a=tfm_buffer[++tfm_byte]; \
- ci._width_index=a; \
- b=tfm_buffer[++tfm_byte]; \
- ci._height_index=b>>4; \
- ci._depth_index=b%16; \
- c=tfm_buffer[++tfm_byte]; \
- ci._italic_index=c>>2; \
- ci._tag=c%4; \
- d=tfm_buffer[++tfm_byte]; \
- ci._remainder=d; \
+ a=tfm_buffer[++tfm_byte]; \
+ ci._width_index=a; \
+ b=tfm_buffer[++tfm_byte]; \
+ ci._height_index=b>>4; \
+ ci._depth_index=b%16; \
+ c=tfm_buffer[++tfm_byte]; \
+ ci._italic_index=c>>2; \
+ ci._tag=c%4; \
+ d=tfm_buffer[++tfm_byte]; \
+ ci._remainder=d; \
} }
-#define read_four_quarters(q) \
+#define read_four_quarters(q) \
{ if (font_level!=-1) { \
- fget; read_sixteen_unsigned(a); q.b0=a; \
- fget; read_sixteen_unsigned(b); q.b1=b; \
- fget; read_sixteen_unsigned(c); q.b2=c; \
- fget; read_sixteen_unsigned(d); q.b3=d; \
+ fget; read_sixteen_unsigned(a); q.b0=a; \
+ fget; read_sixteen_unsigned(b); q.b1=b; \
+ fget; read_sixteen_unsigned(c); q.b2=c; \
+ fget; read_sixteen_unsigned(d); q.b3=d; \
} else { \
- a=tfm_buffer[++tfm_byte]; q.b0=a; \
- b=tfm_buffer[++tfm_byte]; q.b1=b; \
- c=tfm_buffer[++tfm_byte]; q.b2=c; \
+ a=tfm_buffer[++tfm_byte]; q.b0=a; \
+ b=tfm_buffer[++tfm_byte]; q.b1=b; \
+ c=tfm_buffer[++tfm_byte]; q.b2=c; \
d=tfm_buffer[++tfm_byte]; q.b3=d; \
} }
@@ -507,499 +508,565 @@ open_tfm_file(char *nom, char *aire, unsigned char **tfm_buf, integer *tfm_siz)
of \TeX\ between computers.
*/
-#define store_scaled(zz) \
+#define store_scaled(zz) \
{ fget; a=fbyte; fget; b=fbyte; \
fget; c=fbyte; fget; d=fbyte; \
sw=(((((d*z)>>8)+(c*z))>>8)+(b*z)) / beta; \
- if (a==0) { zz=sw; } else if (a==255) { zz=sw-alpha; } else tfm_abort; \
+ if (a==0) { zz=sw; } else if (a==255) { zz=sw-alpha; } else tfm_abort; \
}
#define check_existence(z) \
{ check_byte_range(z); \
- if (!char_exists(f,z)) tfm_abort; \
+ if (!char_exists(f,z)) tfm_abort; \
}
typedef struct tfmcharacterinfo {
- integer _kern_index;
- integer _lig_index;
- integer _width_index;
- integer _height_index;
- integer _depth_index;
- integer _italic_index;
- integer _remainder;
- unsigned char _tag ;
+ integer _kern_index;
+ integer _lig_index;
+ integer _width_index;
+ integer _height_index;
+ integer _depth_index;
+ integer _italic_index;
+ integer _remainder;
+ unsigned char _tag;
} tfmcharacterinfo;
-extern charinfo *copy_charinfo(charinfo *ci);
-
-int
-read_tfm_info(internalfontnumber f, char *cnom, char *caire, scaled s) {
- integer k; /* index into |font_info| */
- halfword lf,lh,bc,ec,nw,nh,nd,ni,nl,nk,ne,np,slh; /* sizes of subfiles */
- scaled *widths, *heights, *depths, *italics, *kerns;
- halfword font_dir;
- integer a,b,c,d; /* byte variables */
- integer i; /* counter */
- integer font_level,header_length;
- integer nco,ncw,npc,nlw,neew;
- tfmcharacterinfo ci;
- charinfo *co;
- four_quarters qw;
- four_quarters *lig_kerns, *extens;
- scaled sw; /* accumulators */
- integer bch_label; /* left boundary start location, or infinity */
- int bchar; /* :0..too_big_char; */ /* right boundary character, or |too_big_char| */
- integer first_two;
- scaled z; /* the design size or the ``at'' size */
- integer alpha;
- char beta; /* :1..16*/
- integer *xligs, *xkerns; /* aux. for ligkern processing */
- liginfo *cligs;
- kerninfo *ckerns;
- int fligs, fkerns;
- char *tmpnam;
- integer tfm_byte = 0; /* index into |tfm_buffer| */
- integer saved_tfm_byte = 0; /* saved index into |tfm_buffer| */
- unsigned char *tfm_buffer = NULL; /* byte buffer for tfm files */
- integer tfm_size = 0; /* total size of the tfm file */
-
- widths=NULL;
- heights=NULL;
- depths = NULL;
- italics = NULL;
- kerns = NULL;
- lig_kerns = NULL;
- extens = NULL;
- xkerns = NULL;
- ckerns = NULL;
- xligs = NULL;
- cligs = NULL;
-
- font_dir = 0;
-
- memset(&ci,0,sizeof(tfmcharacterinfo));
-
- if(open_tfm_file(cnom,caire,&tfm_buffer,&tfm_size)!=1)
- tfm_abort;
-
- /* cnom can be an absolute filename, xbasename() fixes that. */
-
- tmpnam=strdup(xbasename(cnom));
- if (strcmp(tmpnam+strlen(tmpnam)-4,".tfm")==0) {
- *(tmpnam+strlen(tmpnam)-4) =0;
- }
- set_font_name(f,tmpnam);
- set_font_area(f,xstrdup(caire)); /* perhaps it leaks, but it doesnt crash */
-
- /* @<Read the {\.{TFM}} size fields@>; */
- nco=0; ncw=0; npc=0;
- read_sixteen(first_two);
- if (first_two!=0) {
- font_level=-1;
- lf=first_two;
- fget; read_sixteen(lh);
- fget; read_sixteen(bc);
- fget; read_sixteen(ec);
- if ((bc>ec+1)||(ec>255)) tfm_abort;
- if (bc>255) { /* |bc=256| and |ec=255| */
- bc=1; ec=0;
+int read_tfm_info(internalfontnumber f, char *cnom, char *caire, scaled s)
+{
+ integer k; /* index into |font_info| */
+ halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np, slh; /* sizes of subfiles */
+ scaled *widths, *heights, *depths, *italics, *kerns;
+ halfword font_dir;
+ integer a, b, c, d; /* byte variables */
+ integer i; /* counter */
+ integer font_level, header_length;
+ integer nco, ncw, npc, nlw, neew;
+ tfmcharacterinfo ci;
+ charinfo *co;
+ four_quarters qw;
+ four_quarters *lig_kerns, *extens;
+ scaled sw; /* accumulators */
+ integer bch_label; /* left boundary start location, or infinity */
+ int bchar; /* :0..too_big_char; *//* right boundary character, or |too_big_char| */
+ integer first_two;
+ scaled z; /* the design size or the ``at'' size */
+ integer alpha;
+ char beta; /* :1..16 */
+ integer *xligs, *xkerns; /* aux. for ligkern processing */
+ liginfo *cligs;
+ kerninfo *ckerns;
+ int fligs, fkerns;
+ char *tmpnam;
+ integer tfm_byte = 0; /* index into |tfm_buffer| */
+ integer saved_tfm_byte = 0; /* saved index into |tfm_buffer| */
+ unsigned char *tfm_buffer = NULL; /* byte buffer for tfm files */
+ integer tfm_size = 0; /* total size of the tfm file */
+
+ widths = NULL;
+ heights = NULL;
+ depths = NULL;
+ italics = NULL;
+ kerns = NULL;
+ lig_kerns = NULL;
+ extens = NULL;
+ xkerns = NULL;
+ ckerns = NULL;
+ xligs = NULL;
+ cligs = NULL;
+
+ font_dir = 0;
+
+ memset(&ci, 0, sizeof(tfmcharacterinfo));
+
+ if (open_tfm_file(cnom, caire, &tfm_buffer, &tfm_size) != 1)
+ tfm_abort;
+
+ /* cnom can be an absolute filename, xbasename() fixes that. */
+
+ tmpnam = strdup(xbasename(cnom));
+ if (strcmp(tmpnam + strlen(tmpnam) - 4, ".tfm") == 0) {
+ *(tmpnam + strlen(tmpnam) - 4) = 0;
+ }
+ set_font_name(f, tmpnam);
+ set_font_area(f, NULL);
+
+ /* @<Read the {\.{TFM}} size fields@>; */
+ nco = 0;
+ ncw = 0;
+ npc = 0;
+ read_sixteen(first_two);
+ if (first_two != 0) {
+ font_level = -1;
+ lf = first_two;
+ fget;
+ read_sixteen(lh);
+ fget;
+ read_sixteen(bc);
+ fget;
+ read_sixteen(ec);
+ if ((bc > ec + 1) || (ec > 255))
+ tfm_abort;
+ if (bc > 255) { /* |bc=256| and |ec=255| */
+ bc = 1;
+ ec = 0;
+ };
+ fget;
+ read_sixteen(nw);
+ fget;
+ read_sixteen(nh);
+ fget;
+ read_sixteen(nd);
+ fget;
+ read_sixteen(ni);
+ fget;
+ read_sixteen(nl);
+ fget;
+ read_sixteen(nk);
+ fget;
+ read_sixteen(ne);
+ fget;
+ read_sixteen(np);
+ header_length = 6;
+ ncw = (ec - bc + 1);
+ nlw = nl;
+ neew = ne;
+ } else {
+ fget;
+ read_sixteen(font_level);
+ if (font_level != 0)
+ tfm_abort;
+ read_thirtytwo(lf);
+ read_thirtytwo(lh);
+ read_thirtytwo(bc);
+ read_thirtytwo(ec);
+ if ((bc > ec + 1) || (ec > 65535))
+ tfm_abort;
+ if (bc > 65535) { /* |bc=65536| and |ec=65535| */
+ bc = 1;
+ ec = 0;
+ };
+ read_thirtytwo(nw);
+ read_thirtytwo(nh);
+ read_thirtytwo(nd);
+ read_thirtytwo(ni);
+ read_thirtytwo(nl);
+ read_thirtytwo(nk);
+ read_thirtytwo(ne);
+ read_thirtytwo(np);
+ read_thirtytwo(font_dir); /* junk */
+ nlw = 2 * nl;
+ neew = 2 * ne;
+ header_length = 14;
+ ncw = 2 * (ec - bc + 1);
};
- fget; read_sixteen(nw);
- fget; read_sixteen(nh);
- fget; read_sixteen(nd);
- fget; read_sixteen(ni);
- fget; read_sixteen(nl);
- fget; read_sixteen(nk);
- fget; read_sixteen(ne);
- fget; read_sixteen(np);
- header_length=6;
- ncw=(ec-bc+1);
- nlw=nl;
- neew=ne;
- } else {
- fget; read_sixteen(font_level);
- if (font_level!=0) tfm_abort;
- read_thirtytwo(lf);
- read_thirtytwo(lh);
- read_thirtytwo(bc);
- read_thirtytwo(ec);
- if ((bc>ec+1)||(ec>65535)) tfm_abort;
- if (bc>65535) { /* |bc=65536| and |ec=65535| */
- bc=1; ec=0;
+ if (lf !=
+ (header_length + lh + ncw + nw + nh + nd + ni + nlw + nk + neew + np))
+ tfm_abort;
+ if ((nw == 0) || (nh == 0) || (nd == 0) || (ni == 0))
+ tfm_abort;
+
+ /*
+ We check to see that the \.{TFM} file doesn't end prematurely; but
+ no error message is given for files having more than |lf| words.
+ */
+ if (lf * 4 > tfm_size)
+ tfm_abort;
+
+ /* @<Use size fields to allocate font information@>; */
+
+ set_font_natural_dir(f, font_dir);
+ set_font_bc(f, bc);
+ set_font_ec(f, ec);
+
+ /* read the arrays first */
+ widths = xmalloc(nw * sizeof(scaled));
+ heights = xmalloc(nh * sizeof(scaled));
+ depths = xmalloc(nd * sizeof(scaled));
+ italics = xmalloc(ni * sizeof(scaled));
+ extens = xmalloc(ne * sizeof(four_quarters));
+ lig_kerns = xmalloc(nl * sizeof(four_quarters));
+ kerns = xmalloc(nk * sizeof(scaled));
+
+ /* @<Read the {\.{TFM}} header@>; */
+
+ /* Only the first two words of the header are needed by \TeX82. */
+ slh = lh;
+ if (lh < 2)
+ tfm_abort;
+ store_four_bytes(font_checksum(f));
+ fget;
+ read_sixteen(z); /* this rejects a negative design size */
+ fget;
+ z = z * 256 + fbyte;
+ fget;
+ z = (z * 16) + (fbyte >> 4);
+ if (z < unity)
+ tfm_abort;
+ while (lh > 2) {
+ fget;
+ fget;
+ fget;
+ fget;
+ lh--; /* ignore the rest of the header */
};
- read_thirtytwo(nw);
- read_thirtytwo(nh);
- read_thirtytwo(nd);
- read_thirtytwo(ni);
- read_thirtytwo(nl);
- read_thirtytwo(nk);
- read_thirtytwo(ne);
- read_thirtytwo(np);
- read_thirtytwo(font_dir); /* junk */
- nlw=2*nl;
- neew=2*ne;
- header_length=14;
- ncw=2*(ec-bc+1);
- };
- if (lf!=(header_length+lh+ncw+nw+nh+nd+ni+nlw+nk+neew+np)) tfm_abort;
-
- /* @<Use size fields to allocate font information@>; */
-
- set_font_natural_dir(f,font_dir);
- set_font_bc(f,bc);
- set_font_ec(f,ec);
-
- /* read the arrays first */
- widths = xmalloc(nw*sizeof(scaled));
- heights = xmalloc(nh*sizeof(scaled));
- depths = xmalloc(nd*sizeof(scaled));
- italics = xmalloc(ni*sizeof(scaled));
- extens = xmalloc(ne*sizeof(four_quarters));
- lig_kerns = xmalloc(nl*sizeof(four_quarters));
- kerns = xmalloc(nk*sizeof(scaled));
-
- /* @<Read the {\.{TFM}} header@>; */
-
- /* Only the first two words of the header are needed by \TeX82. */
- slh = lh;
- if (lh<2)
- tfm_abort;
- store_four_bytes(font_checksum(f));
- fget; read_sixteen(z); /* this rejects a negative design size */
- fget; z=z*256+fbyte; fget; z=(z*16)+(fbyte>>4);
- if (z<unity) tfm_abort;
- while (lh>2) {
- fget;fget;fget;fget;
- lh--; /* ignore the rest of the header */
- };
-
- /* read the arrays before the character info */
-
- set_font_dsize(f,z);
- if (s!=-1000) {
- z = (s>=0 ? s : xn_over_d(z,-s,1000));
- }
- set_font_size(f,z);
- if (np>7)
- set_font_params(f,np);
+ /* read the arrays before the character info */
- saved_tfm_byte = tfm_byte;
- tfm_byte = (header_length+slh+ncw)*4 - 1;
+ set_font_dsize(f, z);
+ if (s != -1000) {
+ z = (s >= 0 ? s : xn_over_d(z, -s, 1000));
+ }
+ set_font_size(f, z);
- /* @<Replace |z| by $|z|^\prime$ and compute $\alpha,\beta$@>; */
+ if (np > 7)
+ set_font_params(f, np);
- alpha=16;
- while (z>=040000000) {
- z=z>>1; alpha=alpha+alpha;
- };
- beta=256/alpha; alpha=alpha*z;
+ saved_tfm_byte = tfm_byte;
+ tfm_byte = (header_length + slh + ncw) * 4 - 1;
- /* @<Read box dimensions@>; */
+ /* @<Replace |z| by $|z|^\prime$ and compute $\alpha,\beta$@>; */
- for (k=0;k<nw;k++) {
- store_scaled(sw); widths[k] = sw;
- }
- if (widths[0]!=0) /* \\{width}[0] must be zero */
- tfm_abort;
- for (k=0;k<nh;k++) {
- store_scaled(sw); heights[k] = sw;
- }
- if (heights[0]!=0)
- tfm_abort; /* \\{height}[0] must be zero */
- for (k=0;k<nd;k++) {
- store_scaled(sw); depths[k] = sw;
- }
- if (depths[0]!=0)
- tfm_abort; /* \\{depth}[0] must be zero */
- for (k=0;k<ni;k++) {
- store_scaled(sw); italics[k] = sw;
- }
- if (italics[0]!=0)
- tfm_abort; /* \\{italic}[0] must be zero */
-
-
- /* @<Read ligature/kern program@>; */
-
- bch_label=nl; /* infinity*/
- bchar=65536;
- if (nl>0) {
- for (k=0;k<nl;k++) {
- read_four_quarters(qw);
- lig_kerns[k] = qw;
- if (a>128) {
- if (256*c+d>=nl) tfm_abort;
- if (a==255 && k==0) bchar=b;
- } else {
- /* if (b!=bchar) check_existence(b); */
- if (c<128) {
- /* check_existence(d); */ /* check ligature */
- } else if (256*(c-128)+d>=nk) {
- tfm_abort; /* check kern */
- }
- if ((a<128) && (k-0+a+1>=nl)) tfm_abort;
- };
+ alpha = 16;
+ while (z >= 040000000) {
+ z = z >> 1;
+ alpha = alpha + alpha;
};
- if (a==255) bch_label=256*c+d;
- };
+ beta = 256 / alpha;
+ alpha = alpha * z;
- /* the actual kerns */
- for (k=0;k<nk;k++) {
- store_scaled(sw); kerns[k] = sw;
- }
+ /* @<Read box dimensions@>; */
- /* @<Read extensible character recipes@>; */
- for (k=0;k<ne;k++) {
- read_four_quarters(qw); extens[k] = qw;
- }
+ for (k = 0; k < nw; k++) {
+ store_scaled(sw);
+ widths[k] = sw;
+ }
+ if (widths[0] != 0) /* \\{width}[0] must be zero */
+ tfm_abort;
+ for (k = 0; k < nh; k++) {
+ store_scaled(sw);
+ heights[k] = sw;
+ }
+ if (heights[0] != 0)
+ tfm_abort; /* \\{height}[0] must be zero */
+ for (k = 0; k < nd; k++) {
+ store_scaled(sw);
+ depths[k] = sw;
+ }
+ if (depths[0] != 0)
+ tfm_abort; /* \\{depth}[0] must be zero */
+ for (k = 0; k < ni; k++) {
+ store_scaled(sw);
+ italics[k] = sw;
+ }
+ if (italics[0] != 0)
+ tfm_abort; /* \\{italic}[0] must be zero */
+
+
+ /* @<Read ligature/kern program@>; */
+
+ bch_label = nl; /* infinity */
+ bchar = 65536;
+ if (nl > 0) {
+ for (k = 0; k < nl; k++) {
+ read_four_quarters(qw);
+ lig_kerns[k] = qw;
+ if (a > 128) {
+ if (256 * c + d >= nl)
+ tfm_abort;
+ if (a == 255 && k == 0)
+ bchar = b;
+ } else {
+ /* if (b!=bchar) check_existence(b); */
+ if (c < 128) {
+ /* check_existence(d); *//* check ligature */
+ } else if (256 * (c - 128) + d >= nk) {
+ tfm_abort; /* check kern */
+ }
+ if ((a < 128) && (k - 0 + a + 1 >= nl))
+ tfm_abort;
+ };
+ };
+ if (a == 255)
+ bch_label = 256 * c + d;
+ };
- /* @<Read font parameters@>; */
+ /* the actual kerns */
+ for (k = 0; k < nk; k++) {
+ store_scaled(sw);
+ kerns[k] = sw;
+ }
- if (np>7) {
- set_font_params(f,np);
- }
- for (k=1;k<=np;k++) {
- if (k==1) { /* the |slant| parameter is a pure number */
- fget; sw=fbyte;
- if (sw>127) sw=sw-256;
- fget; sw=sw*256+fbyte;
- fget; sw=sw*256+fbyte;
- fget; sw=(sw*16)+(fbyte>>4);
- set_font_param(f,k,sw);
- } else {
- store_scaled(font_param(f,k));
+ /* @<Read extensible character recipes@>; */
+ for (k = 0; k < ne; k++) {
+ read_four_quarters(qw);
+ extens[k] = qw;
}
- }
- /*
- We check to see that the \.{TFM} file doesn't end prematurely; but
- no error message is given for files having more than |lf| words.
- */
-
- if (tfm_byte<tfm_size-1) tfm_abort;
-
- tfm_byte = saved_tfm_byte ;
-
- /* fix up the left boundary character */
- fligs = 0;
- fkerns = 0;
- if (bch_label != nl ) {
- k = bch_label;
- /*
- if (skip_byte(k) > stop_flag)
- k = lig_kern_restart(k);
- */
- while (1) {
- if (skip_byte(k) <= stop_flag) {
- if(op_byte(k) >= kern_flag) { /* kern */
- fkerns++;
- } else { /* lig */
- fligs++;
- }
- }
- if (skip_byte(k) == 0) {
- k++;
- } else {
- if (skip_byte(k) >= stop_flag)
- break;
- k += skip_byte(k) + 1;
- }
+ /* @<Read font parameters@>; */
+
+ if (np > 7) {
+ set_font_params(f, np);
}
- }
- if (fkerns >0 || fligs > 0) {
- if (fligs>0) cligs = xcalloc((fligs+1),sizeof(liginfo));
- if (fkerns>0) ckerns = xcalloc((fkerns+1),sizeof(kerninfo));
+ for (k = 1; k <= np; k++) {
+ if (k == 1) { /* the |slant| parameter is a pure number */
+ fget;
+ sw = fbyte;
+ if (sw > 127)
+ sw = sw - 256;
+ fget;
+ sw = sw * 256 + fbyte;
+ fget;
+ sw = sw * 256 + fbyte;
+ fget;
+ sw = (sw * 16) + (fbyte >> 4);
+ set_font_param(f, k, sw);
+ } else {
+ store_scaled(font_param(f, k));
+ }
+ }
+
+ tfm_byte = saved_tfm_byte;
+
+ /* fix up the left boundary character */
fligs = 0;
fkerns = 0;
- k = bch_label;
- /*
- if (skip_byte(k) > stop_flag)
- k = lig_kern_restart(k);
- */
- while (1) {
- if (skip_byte(k) <= stop_flag) {
- if(op_byte(k) >= kern_flag) { /* kern */
- set_kern_item(ckerns[fkerns],next_char(k),kerns[256*(op_byte(k)-128)+rem_byte(k)]);
- fkerns++;
- } else { /* lig */
- set_ligature_item(cligs[fligs],(op_byte(k)*2+1),next_char(k),rem_byte(k));
- fligs++;
- }
- }
- if (skip_byte(k) == 0) {
- k++;
- } else {
- if (skip_byte(k) >= stop_flag)
- break;
- k += skip_byte(k) + 1;
- }
+ if (bch_label != nl) {
+ k = bch_label;
+ /*
+ if (skip_byte(k) > stop_flag)
+ k = lig_kern_restart(k);
+ */
+ while (1) {
+ if (skip_byte(k) <= stop_flag) {
+ if (op_byte(k) >= kern_flag) { /* kern */
+ fkerns++;
+ } else { /* lig */
+ fligs++;
+ }
+ }
+ if (skip_byte(k) == 0) {
+ k++;
+ } else {
+ if (skip_byte(k) >= stop_flag)
+ break;
+ k += skip_byte(k) + 1;
+ }
+ }
}
- if (fkerns>0 || fligs>0){
- co = get_charinfo(f,left_boundarychar);
- if (fkerns>0) {
- set_kern_item(ckerns[fkerns],end_kern,0);
- fkerns++;
- set_charinfo_kerns(co,ckerns);
- }
- if (fligs>0){
- set_ligature_item(cligs[fligs],0,end_ligature,0);
- fligs++;
- set_charinfo_ligatures(co,cligs);
- }
- set_charinfo_remainder(co,0);
+ if (fkerns > 0 || fligs > 0) {
+ if (fligs > 0)
+ cligs = xcalloc((fligs + 1), sizeof(liginfo));
+ if (fkerns > 0)
+ ckerns = xcalloc((fkerns + 1), sizeof(kerninfo));
+ fligs = 0;
+ fkerns = 0;
+ k = bch_label;
+ /*
+ if (skip_byte(k) > stop_flag)
+ k = lig_kern_restart(k);
+ */
+ while (1) {
+ if (skip_byte(k) <= stop_flag) {
+ if (op_byte(k) >= kern_flag) { /* kern */
+ set_kern_item(ckerns[fkerns], next_char(k),
+ kerns[256 * (op_byte(k) - 128) +
+ rem_byte(k)]);
+ fkerns++;
+ } else { /* lig */
+ set_ligature_item(cligs[fligs], (op_byte(k) * 2 + 1),
+ next_char(k), rem_byte(k));
+ fligs++;
+ }
+ }
+ if (skip_byte(k) == 0) {
+ k++;
+ } else {
+ if (skip_byte(k) >= stop_flag)
+ break;
+ k += skip_byte(k) + 1;
+ }
+ }
+ if (fkerns > 0 || fligs > 0) {
+ co = get_charinfo(f, left_boundarychar);
+ if (fkerns > 0) {
+ set_kern_item(ckerns[fkerns], end_kern, 0);
+ fkerns++;
+ set_charinfo_kerns(co, ckerns);
+ }
+ if (fligs > 0) {
+ set_ligature_item(cligs[fligs], 0, end_ligature, 0);
+ fligs++;
+ set_charinfo_ligatures(co, cligs);
+ }
+ set_charinfo_remainder(co, 0);
+ }
}
- }
- /* @<Read character data@>; */
- for (k=bc;k<=ec;k++) {
- store_char_info(k);
- if (ci._width_index==0)
- continue;
- if (ci._width_index>=nw||ci._height_index>=nh||
- ci._depth_index>=nd||ci._italic_index>=ni) tfm_abort;
- d = ci._remainder;
- switch (ci._tag) {
- case lig_tag: if (d>=nl) tfm_abort; break;
- case ext_tag: if (d>=ne) tfm_abort; break;
- case list_tag:
- /* We want to make sure that there is no cycle of characters linked together
- by |list_tag| entries, since such a cycle would get \TeX\ into an endless
- loop. If such a cycle exists, the routine here detects it when processing
- the largest character code in the cycle.
- */
- check_byte_range(d);
- while (d<k) { /* current_character == k */
- if (char_tag(f,d)!=list_tag)
- goto NOT_FOUND; /* not a cycle */
- d=char_remainder(f,d); /* next character on the list */
- };
- if (d==k) tfm_abort; /* yes, there's a cycle */
- NOT_FOUND:
- break;
- }
- /* put it in the actual font */
- co = get_charinfo(f,k);
- set_charinfo_index (co,k);
- set_charinfo_tag (co,ci._tag);
- if (ci._tag == ext_tag) {
- set_charinfo_extensible(co,
- extens[ci._remainder].b0, /* top */
- extens[ci._remainder].b2, /* bot */
- extens[ci._remainder].b1, /* mid */
- extens[ci._remainder].b3); /* rep */
- set_charinfo_remainder (co,0);
- } else {
- set_charinfo_remainder (co,ci._remainder);
- }
- set_charinfo_width (co,widths[ci._width_index]);
- set_charinfo_height (co,heights[ci._height_index]);
- set_charinfo_depth (co,depths[ci._depth_index]);
- set_charinfo_italic (co,italics[ci._italic_index]);
- };
-
- /* first pass: count ligs and kerns */
-
- xligs = xcalloc((ec+1),sizeof(integer));
- xkerns = xcalloc((ec+1),sizeof(integer));
-
- for (i=bc;i<=ec;i++) {
- if (char_tag(f,i) == lig_tag) {
- k = lig_kern_start(f,i);
- if (skip_byte(k) > stop_flag)
- k = lig_kern_restart(k);
- /* now k is the start index */
- while (1) {
- if (skip_byte(k) <= stop_flag) {
- if(op_byte(k) >= kern_flag) { /* kern */
- xkerns[i]++;
- if (next_char(k) == bchar)
- xkerns[i]++;
- } else { /* lig */
- xligs[i]++;
- if (next_char(k) == bchar)
- xligs[i]++;
- }
- }
- if (skip_byte(k) == 0) {
- k++;
- } else {
- if (skip_byte(k) >= stop_flag)
- break;
- k += skip_byte(k) + 1;
- }
- }
+ /* @<Read character data@>; */
+ for (k = bc; k <= ec; k++) {
+ store_char_info(k);
+ if (ci._width_index == 0)
+ continue;
+ if (ci._width_index >= nw || ci._height_index >= nh ||
+ ci._depth_index >= nd || ci._italic_index >= ni)
+ tfm_abort;
+ d = ci._remainder;
+ switch (ci._tag) {
+ case lig_tag:
+ if (d >= nl)
+ tfm_abort;
+ break;
+ case ext_tag:
+ if (d >= ne)
+ tfm_abort;
+ break;
+ case list_tag:
+ /* We want to make sure that there is no cycle of characters linked together
+ by |list_tag| entries, since such a cycle would get \TeX\ into an endless
+ loop. If such a cycle exists, the routine here detects it when processing
+ the largest character code in the cycle.
+ */
+ check_byte_range(d);
+ while (d < k) { /* current_character == k */
+ if (char_tag(f, d) != list_tag)
+ goto NOT_FOUND; /* not a cycle */
+ d = char_remainder(f, d); /* next character on the list */
+ };
+ if (d == k)
+ tfm_abort; /* yes, there's a cycle */
+ NOT_FOUND:
+ break;
+ }
+ /* put it in the actual font */
+ co = get_charinfo(f, k);
+ set_charinfo_index(co, k);
+ set_charinfo_tag(co, ci._tag);
+ if (ci._tag == ext_tag) {
+ set_charinfo_extensible(co, extens[ci._remainder].b0, /* top */
+ extens[ci._remainder].b2, /* bot */
+ extens[ci._remainder].b1, /* mid */
+ extens[ci._remainder].b3); /* rep */
+ set_charinfo_remainder(co, 0);
+ } else {
+ set_charinfo_remainder(co, ci._remainder);
+ }
+ set_charinfo_width(co, widths[ci._width_index]);
+ set_charinfo_height(co, heights[ci._height_index]);
+ set_charinfo_depth(co, depths[ci._depth_index]);
+ set_charinfo_italic(co, italics[ci._italic_index]);
+ };
+
+ /* first pass: count ligs and kerns */
+
+ xligs = xcalloc((ec + 1), sizeof(integer));
+ xkerns = xcalloc((ec + 1), sizeof(integer));
+
+ for (i = bc; i <= ec; i++) {
+ if (char_tag(f, i) == lig_tag) {
+ k = lig_kern_start(f, i);
+ if (skip_byte(k) > stop_flag)
+ k = lig_kern_restart(k);
+ /* now k is the start index */
+ while (1) {
+ if (skip_byte(k) <= stop_flag) {
+ if (op_byte(k) >= kern_flag) { /* kern */
+ xkerns[i]++;
+ if (next_char(k) == bchar)
+ xkerns[i]++;
+ } else { /* lig */
+ xligs[i]++;
+ if (next_char(k) == bchar)
+ xligs[i]++;
+ }
+ }
+ if (skip_byte(k) == 0) {
+ k++;
+ } else {
+ if (skip_byte(k) >= stop_flag)
+ break;
+ k += skip_byte(k) + 1;
+ }
+ }
+ }
}
- }
-
- cligs = NULL;
- ckerns = NULL;
- for (i=bc;i<=ec;i++) {
- fligs = 0;
- fkerns = 0;
- if (char_tag(f,i) == lig_tag) {
- k = lig_kern_start(f,i);
- if (skip_byte(k) > stop_flag)
- k = lig_kern_restart(k);
- /* now k is the start index */
- if (xligs[i]>0) cligs = xcalloc((xligs[i]+1),sizeof(liginfo));
- if (xkerns[i]>0) ckerns = xcalloc((xkerns[i]+1),sizeof(kerninfo));
- while (1) {
- if (skip_byte(k) <= stop_flag) {
- if(op_byte(k) >= kern_flag) { /* kern */
- if (next_char(k) == bchar) {
- set_kern_item(ckerns[fkerns],right_boundarychar,kerns[256*(op_byte(k)-128)+rem_byte(k)]);
- fkerns++;
- }
- set_kern_item(ckerns[fkerns],next_char(k),kerns[256*(op_byte(k)-128)+rem_byte(k)]);
- fkerns++;
- } else { /* lig */
- if (next_char(k) == bchar) {
- set_ligature_item(cligs[fligs],(op_byte(k)*2+1),right_boundarychar,rem_byte(k));
- fligs++;
- }
- set_ligature_item(cligs[fligs],(op_byte(k)*2+1),next_char(k),rem_byte(k));
- fligs++;
- }
- }
- if (skip_byte(k) == 0) {
- k++;
- } else {
- if (skip_byte(k) >= stop_flag)
- break;
- k += skip_byte(k) + 1;
- }
- }
- if (fkerns>0 || fligs>0){
- co = get_charinfo(f,i);
- if (fkerns>0) {
- set_kern_item(ckerns[fkerns],end_kern,0);
- fkerns++;
- set_charinfo_kerns(co,ckerns);
- }
- if (fligs>0){
- set_ligature_item(cligs[fligs],0,end_ligature,0);
- fligs++;
- set_charinfo_ligatures(co,cligs);
- }
- set_charinfo_remainder(co,0);
- }
+ cligs = NULL;
+ ckerns = NULL;
+
+ for (i = bc; i <= ec; i++) {
+ fligs = 0;
+ fkerns = 0;
+ if (char_tag(f, i) == lig_tag) {
+ k = lig_kern_start(f, i);
+ if (skip_byte(k) > stop_flag)
+ k = lig_kern_restart(k);
+ /* now k is the start index */
+ if (xligs[i] > 0)
+ cligs = xcalloc((xligs[i] + 1), sizeof(liginfo));
+ if (xkerns[i] > 0)
+ ckerns = xcalloc((xkerns[i] + 1), sizeof(kerninfo));
+ while (1) {
+ if (skip_byte(k) <= stop_flag) {
+ if (op_byte(k) >= kern_flag) { /* kern */
+ if (next_char(k) == bchar) {
+ set_kern_item(ckerns[fkerns], right_boundarychar,
+ kerns[256 * (op_byte(k) - 128) +
+ rem_byte(k)]);
+ fkerns++;
+ }
+ set_kern_item(ckerns[fkerns], next_char(k),
+ kerns[256 * (op_byte(k) - 128) +
+ rem_byte(k)]);
+ fkerns++;
+ } else { /* lig */
+ if (next_char(k) == bchar) {
+ set_ligature_item(cligs[fligs],
+ (op_byte(k) * 2 + 1),
+ right_boundarychar, rem_byte(k));
+ fligs++;
+ }
+ set_ligature_item(cligs[fligs], (op_byte(k) * 2 + 1),
+ next_char(k), rem_byte(k));
+ fligs++;
+ }
+ }
+ if (skip_byte(k) == 0) {
+ k++;
+ } else {
+ if (skip_byte(k) >= stop_flag)
+ break;
+ k += skip_byte(k) + 1;
+ }
+ }
+ if (fkerns > 0 || fligs > 0) {
+ co = get_charinfo(f, i);
+ if (fkerns > 0) {
+ set_kern_item(ckerns[fkerns], end_kern, 0);
+ fkerns++;
+ set_charinfo_kerns(co, ckerns);
+ }
+ if (fligs > 0) {
+ set_ligature_item(cligs[fligs], 0, end_ligature, 0);
+ fligs++;
+ set_charinfo_ligatures(co, cligs);
+ }
+ set_charinfo_remainder(co, 0);
+ }
+ }
}
- }
- /* @<Make final adjustments and |goto done|@> */
+ /* @<Make final adjustments and |goto done|@> */
- /* Now to wrap it up, we have checked all the necessary things about the \.{TFM}
- file, and all we need to do is put the finishing touches on the data for
- the new font.
- */
+ /* Now to wrap it up, we have checked all the necessary things about the \.{TFM}
+ file, and all we need to do is put the finishing touches on the data for
+ the new font.
+ */
- if (bchar!= 65536) {
- co = copy_charinfo(char_info(f,bchar));
- set_right_boundary(f,co);
- }
+ if (bchar != 65536) {
+ co = copy_charinfo(char_info(f, bchar));
+ set_right_boundary(f, co);
+ }
- tfm_success;
+ tfm_success;
}
-
diff --git a/Build/source/texk/web2c/luatexdir/font/tounicode.c b/Build/source/texk/web2c/luatexdir/font/tounicode.c
index ff86a8512e2..29ee8c9bd0b 100644
--- a/Build/source/texk/web2c/luatexdir/font/tounicode.c
+++ b/Build/source/texk/web2c/luatexdir/font/tounicode.c
@@ -1,25 +1,27 @@
-/*
-Copyright (c) 2006 Han The Thanh, <thanh@pdftex.org>
+/* tounicode.c
+ Copyright 2006 Han The Thanh, <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
+static const char _svn_version[] =
+ "$Id: tounicode.c 2029 2009-03-14 19:10:25Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/tounicode.c $";
+
#define isXdigit(c) (isdigit(c) || ('A' <= (c) && (c) <= 'F'))
#define UNI_UNDEF -1
#define UNI_STRING -2 /* string allocated by def_tounicode() */
@@ -289,17 +291,17 @@ static void set_glyph_unicode(char *s, glyph_unicode_entry * gp)
}
}
-static void set_cid_glyph_unicode(long index, glyph_unicode_entry * gp,
- internal_font_number f) {
- char *s;
- if (font_tounicode(f)) {
- if ((s = get_charinfo_tounicode(char_info(f,index)))!=NULL) {
+static void set_cid_glyph_unicode(long index, glyph_unicode_entry * gp,
+ internal_font_number f)
+{
+ char *s;
+ if (font_tounicode(f) &&
+ (s = get_charinfo_tounicode(char_info(f, index))) != NULL) {
gp->code = UNI_EXTRA_STRING;
gp->unicode_seq = xstrdup(s);
- }
- } else {
- gp->code = index; /* fallback */
- }
+ } else {
+ gp->code = index; /* fallback */
+ }
}
@@ -314,7 +316,7 @@ integer write_tounicode(char **glyph_names, char *name)
int bfchar_count, bfrange_count, subrange_count;
assert(strlen(name) + strlen(builtin_suffix) < SMALL_BUF_SIZE);
if (glyph_unicode_tree == NULL) {
- pdftex_warn("no GlyphToUnicode entry has been inserted yet!");
+ /*pdftex_warn("no GlyphToUnicode entry has been inserted yet!"); */
fixed_gen_tounicode = 0;
return 0;
}
@@ -451,19 +453,21 @@ integer write_tounicode(char **glyph_names, char *name)
return objnum;
}
-integer write_cid_tounicode(fo_entry * fo, internalfontnumber f) {
+integer write_cid_tounicode(fo_entry * fo, internalfontnumber f)
+{
int range_size[65537];
glyph_unicode_entry gtab[65537];
integer objnum;
int i, j, k;
int bfchar_count, bfrange_count, subrange_count;
- char *buf;
+ char *buf;
- assert(fo->fd->fontname);
- buf = xmalloc(strlen(fo->fd->fontname)+8);
- sprintf(buf,"%s-%s",(fo->fd->subset_tag!=NULL ? fo->fd->subset_tag : "UCS"),
- fo->fd->fontname);
+ assert(fo->fd->fontname);
+ buf = xmalloc(strlen(fo->fd->fontname) + 8);
+ sprintf(buf, "%s-%s",
+ (fo->fd->subset_tag != NULL ? fo->fd->subset_tag : "UCS"),
+ fo->fd->fontname);
objnum = pdf_new_objnum();
pdf_begin_dict(objnum, 0);
@@ -486,25 +490,25 @@ integer write_cid_tounicode(fo_entry * fo, internalfontnumber f) {
"/CMapName /TeX-Identity-%s def\n"
"/CMapType 2 def\n"
"1 begincodespacerange\n"
- "<0000> <FFFF>\n"
+ "<0000> <FFFF>\n"
"endcodespacerange\n", buf, buf, buf, buf, buf);
- xfree(buf);
+ xfree(buf);
/* set up gtab */
for (i = 0; i < 65537; ++i) {
gtab[i].code = UNI_UNDEF;
}
- for (k = 1; k <= max_font_id(); k++) {
- if (k == f || -f == pdf_font_num(k)) {
- for (i = font_bc(k); i <= font_ec(k); i++) {
- if (char_exists(k,i) && char_used(k,i)) {
- j = char_index(k,i);
- if (gtab[j].code == UNI_UNDEF) {
- set_cid_glyph_unicode(i, &gtab[j], f);
- }
- }
- }
- }
- }
+ for (k = 1; k <= max_font_id(); k++) {
+ if (k == f || -f == pdf_font_num(k)) {
+ for (i = font_bc(k); i <= font_ec(k); i++) {
+ if (char_exists(k, i) && char_used(k, i)) {
+ j = char_index(k, i);
+ if (gtab[j].code == UNI_UNDEF) {
+ set_cid_glyph_unicode(i, &gtab[j], f);
+ }
+ }
+ }
+ }
+ }
/* set range_size */
for (i = 0; i < 65536;) {
@@ -522,7 +526,7 @@ integer write_cid_tounicode(fo_entry * fo, internalfontnumber f) {
/* at this point i is the last entry of the subrange */
i++; /* move i to the next entry */
range_size[j] = i - j;
- }
+ }
}
/* calculate bfrange_count and bfchar_count */
diff --git a/Build/source/texk/web2c/luatexdir/font/tt_glyf.c b/Build/source/texk/web2c/luatexdir/font/tt_glyf.c
index bf21e58c49a..b024897f82d 100644
--- a/Build/source/texk/web2c/luatexdir/font/tt_glyf.c
+++ b/Build/source/texk/web2c/luatexdir/font/tt_glyf.c
@@ -1,24 +1,23 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/tt_glyf.c,v 1.2 2005/06/09 14:31:11 hirata Exp $
+/* tt_glyf.c
- This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+ Copyright 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
- the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
/*
* Subsetting glyf, updating loca, hmtx, ...
@@ -30,629 +29,623 @@
#include "sfnt.h"
#include "tt_table.h"
#include "tt_glyf.h"
+#include "writettf.h"
+
+static const char _svn_version[] =
+ "$Id: tt_glyf.c 1592 2008-11-28 13:23:51Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/tt_glyf.c $";
#define NUM_GLYPH_LIMIT 65534
#define TABLE_DATA_ALLOC_SIZE 40960
#define GLYPH_ARRAY_ALLOC_SIZE 256
-static USHORT
-find_empty_slot (struct tt_glyphs *g)
+static USHORT find_empty_slot(struct tt_glyphs *g)
{
- USHORT gid;
+ USHORT gid;
- ASSERT(g);
+ ASSERT(g);
- for (gid = 0; gid < NUM_GLYPH_LIMIT; gid++) {
- if (!(g->used_slot[gid/8] & (1 << (7 - (gid % 8)))))
- break;
- }
- if (gid == NUM_GLYPH_LIMIT)
- TT_ERROR("No empty glyph slot available.");
+ for (gid = 0; gid < NUM_GLYPH_LIMIT; gid++) {
+ if (!(g->used_slot[gid / 8] & (1 << (7 - (gid % 8)))))
+ break;
+ }
+ if (gid == NUM_GLYPH_LIMIT)
+ TT_ERROR("No empty glyph slot available.");
- return gid;
+ return gid;
}
-USHORT
-tt_find_glyph (struct tt_glyphs *g, USHORT gid)
+USHORT tt_find_glyph(struct tt_glyphs * g, USHORT gid)
{
- USHORT idx, new_gid = 0;
+ USHORT idx, new_gid = 0;
- ASSERT(g);
+ ASSERT(g);
- for (idx = 0; idx < g->num_glyphs; idx++) {
- if (gid == g->gd[idx].ogid) {
- new_gid = g->gd[idx].gid;
- break;
+ for (idx = 0; idx < g->num_glyphs; idx++) {
+ if (gid == g->gd[idx].ogid) {
+ new_gid = g->gd[idx].gid;
+ break;
+ }
}
- }
- return new_gid;
+ return new_gid;
}
-USHORT
-tt_get_index (struct tt_glyphs *g, USHORT gid)
+USHORT tt_get_index(struct tt_glyphs * g, USHORT gid)
{
- USHORT idx;
+ USHORT idx;
- ASSERT(g);
+ ASSERT(g);
- for (idx = 0; idx < g->num_glyphs; idx++) {
- if (gid == g->gd[idx].gid)
- break;
- }
- if (idx == g->num_glyphs)
- idx = 0;
+ for (idx = 0; idx < g->num_glyphs; idx++) {
+ if (gid == g->gd[idx].gid)
+ break;
+ }
+ if (idx == g->num_glyphs)
+ idx = 0;
- return idx;
+ return idx;
}
-USHORT
-tt_add_glyph (struct tt_glyphs *g, USHORT gid, USHORT new_gid)
+USHORT tt_add_glyph(struct tt_glyphs * g, USHORT gid, USHORT new_gid)
{
- ASSERT(g);
+ ASSERT(g);
- if (g->used_slot[new_gid/8] & (1 << (7 - (new_gid % 8)))) {
- WARN("Slot %u already used.", new_gid);
- } else {
- if (g->num_glyphs+1 >= NUM_GLYPH_LIMIT)
- TT_ERROR("Too many glyphs.");
+ if (g->used_slot[new_gid / 8] & (1 << (7 - (new_gid % 8)))) {
+ WARN("Slot %u already used.", new_gid);
+ } else {
+ if (g->num_glyphs + 1 >= NUM_GLYPH_LIMIT)
+ TT_ERROR("Too many glyphs.");
+
+ if (g->num_glyphs >= g->max_glyphs) {
+ g->max_glyphs += GLYPH_ARRAY_ALLOC_SIZE;
+ g->gd = RENEW(g->gd, g->max_glyphs, struct tt_glyph_desc);
+ }
+ g->gd[g->num_glyphs].gid = new_gid;
+ g->gd[g->num_glyphs].ogid = gid;
+ g->gd[g->num_glyphs].length = 0;
+ g->gd[g->num_glyphs].data = NULL;
+ g->used_slot[new_gid / 8] |= (1 << (7 - (new_gid % 8)));
+ g->num_glyphs += 1;
+ }
- if (g->num_glyphs >= g->max_glyphs) {
- g->max_glyphs += GLYPH_ARRAY_ALLOC_SIZE;
- g->gd = RENEW(g->gd, g->max_glyphs, struct tt_glyph_desc);
+ if (new_gid > g->last_gid) {
+ g->last_gid = new_gid;
}
- g->gd[g->num_glyphs].gid = new_gid;
- g->gd[g->num_glyphs].ogid = gid;
- g->gd[g->num_glyphs].length = 0;
- g->gd[g->num_glyphs].data = NULL;
- g->used_slot[new_gid/8] |= (1 << (7 - (new_gid % 8)));
- g->num_glyphs += 1;
- }
-
- if (new_gid > g->last_gid) {
- g->last_gid = new_gid;
- }
-
- return new_gid;
+
+ return new_gid;
}
/*
* Initialization
*/
-struct tt_glyphs *
-tt_build_init (void)
+struct tt_glyphs *tt_build_init(void)
{
- struct tt_glyphs *g;
-
- g = NEW(1, struct tt_glyphs);
-
- g->num_glyphs = 0;
- g->max_glyphs = 0;
- g->last_gid = 0;
- g->emsize = 1;
- g->default_advh = 0;
- g->default_tsb = 0;
- g->gd = NULL;
- g->used_slot = NEW(8192, unsigned char);
- memset(g->used_slot, 0, 8192);
- tt_add_glyph(g, 0, 0);
-
- return g;
+ struct tt_glyphs *g;
+
+ g = NEW(1, struct tt_glyphs);
+
+ g->num_glyphs = 0;
+ g->max_glyphs = 0;
+ g->last_gid = 0;
+ g->emsize = 1;
+ g->default_advh = 0;
+ g->default_tsb = 0;
+ g->gd = NULL;
+ g->used_slot = NEW(8192, unsigned char);
+ memset(g->used_slot, 0, 8192);
+ tt_add_glyph(g, 0, 0);
+
+ return g;
}
-void
-tt_build_finish (struct tt_glyphs *g)
+void tt_build_finish(struct tt_glyphs *g)
{
- if (g) {
- if (g->gd) {
- USHORT idx;
- for (idx = 0; idx < g->num_glyphs; idx++) {
- if (g->gd[idx].data)
- RELEASE(g->gd[idx].data);
- }
- RELEASE(g->gd);
+ if (g) {
+ if (g->gd) {
+ USHORT idx;
+ for (idx = 0; idx < g->num_glyphs; idx++) {
+ if (g->gd[idx].data)
+ RELEASE(g->gd[idx].data);
+ }
+ RELEASE(g->gd);
+ }
+ if (g->used_slot)
+ RELEASE(g->used_slot);
+ RELEASE(g);
}
- if (g->used_slot)
- RELEASE(g->used_slot);
- RELEASE(g);
- }
}
-static int
-glyf_cmp (const void *v1, const void *v2)
+static int glyf_cmp(const void *v1, const void *v2)
{
- int cmp = 0;
- struct tt_glyph_desc *sv1, *sv2;
-
- sv1 = (struct tt_glyph_desc *) v1;
- sv2 = (struct tt_glyph_desc *) v2;
-
- if (sv1->gid == sv2->gid)
- cmp = 0;
- else if (sv1->gid < sv2->gid)
- cmp = -1;
- else
- cmp = 1;
-
- return cmp;
+ int cmp = 0;
+ struct tt_glyph_desc *sv1, *sv2;
+
+ sv1 = (struct tt_glyph_desc *) v1;
+ sv2 = (struct tt_glyph_desc *) v2;
+
+ if (sv1->gid == sv2->gid)
+ cmp = 0;
+ else if (sv1->gid < sv2->gid)
+ cmp = -1;
+ else
+ cmp = 1;
+
+ return cmp;
}
-/*
- * TrueType outline data.
- */
-#define ARG_1_AND_2_ARE_WORDS (1 << 0)
-#define ARGS_ARE_XY_VALUES (1 << 1)
-#define ROUND_XY_TO_GRID (1 << 2)
-#define WE_HAVE_A_SCALE (1 << 3)
-#define RESERVED (1 << 4)
-#define MORE_COMPONENT (1 << 5)
-#define WE_HAVE_AN_X_AND_Y_SCALE (1 << 6)
-#define WE_HAVE_A_TWO_BY_TWO (1 << 7)
-#define WE_HAVE_INSTRUCTIONS (1 << 8)
-#define USE_MY_METRICS (1 << 9)
-
-int
-tt_build_tables (sfnt *sfont, struct tt_glyphs *g)
+int tt_build_tables(sfnt * sfont, struct tt_glyphs *g)
{
- char *hmtx_table_data = NULL, *loca_table_data = NULL;
- char *glyf_table_data = NULL;
- ULONG hmtx_table_size, loca_table_size, glyf_table_size;
- /* some information available from other TrueType table */
- struct tt_head_table *head = NULL;
- struct tt_hhea_table *hhea = NULL;
- struct tt_maxp_table *maxp = NULL;
- struct tt_longMetrics *hmtx, *vmtx = NULL;
- struct tt_os2__table *os2;
- /* temp */
- ULONG *location, offset;
- long i;
- USHORT *w_stat; /* Estimate most frequently appeared width */
-
- ASSERT(g);
-
- if (sfont->type != SFNT_TYPE_TRUETYPE &&
- sfont->type != SFNT_TYPE_TTC)
- TT_ERROR("Invalid font type");
-
- if (g->num_glyphs > NUM_GLYPH_LIMIT)
- TT_ERROR("Too many glyphs.");
-
- /*
- * Read head, hhea, maxp, loca:
- *
- * unitsPerEm --> head
- * numHMetrics --> hhea
- * indexToLocFormat --> head
- * numGlyphs --> maxp
- */
- head = tt_read_head_table(sfont);
- hhea = tt_read_hhea_table(sfont);
- maxp = tt_read_maxp_table(sfont);
-
- if (hhea->metricDataFormat != 0)
- TT_ERROR("Unknown metricDataFormat.");
-
- g->emsize = head->unitsPerEm;
-
- sfnt_locate_table(sfont, "hmtx");
- hmtx = tt_read_longMetrics(sfont, maxp->numGlyphs, hhea->numberOfHMetrics);
-
- os2 = tt_read_os2__table(sfont);
- if (os2) {
- g->default_advh = os2->sTypoAscender - os2->sTypoDescender;
- g->default_tsb = g->default_advh - os2->sTypoAscender;
- }
-
- if (sfnt_find_table_pos(sfont, "vmtx") > 0) {
- struct tt_vhea_table *vhea;
- vhea = tt_read_vhea_table(sfont);
- sfnt_locate_table(sfont, "vmtx");
- vmtx = tt_read_longMetrics(sfont, maxp->numGlyphs, vhea->numOfLongVerMetrics);
- RELEASE(vhea);
- } else {
- vmtx = NULL;
- }
-
- sfnt_locate_table(sfont, "loca");
- location = NEW(maxp->numGlyphs + 1, ULONG);
- if (head->indexToLocFormat == 0) {
- for (i = 0; i <= maxp->numGlyphs; i++)
- location[i] = 2*((ULONG) sfnt_get_ushort(sfont));
- } else if (head->indexToLocFormat == 1) {
- for (i = 0; i <= maxp->numGlyphs; i++)
- location[i] = sfnt_get_ulong(sfont);
- } else {
- TT_ERROR("Unknown IndexToLocFormat.");
- }
-
- w_stat = NEW(g->emsize+2, USHORT);
- memset(w_stat, 0, sizeof(USHORT)*(g->emsize+2));
- /*
- * Read glyf table.
- */
- offset = sfnt_locate_table(sfont, "glyf");
- /*
- * The num_glyphs may grow when composite glyph is found.
- * A component of glyph refered by a composite glyph is appended
- * to used_glyphs if it is not already registered in used_glyphs.
- * Glyph programs of composite glyphs are modified so that it
- * correctly refer to new gid of their components.
- */
- for (i = 0; i < NUM_GLYPH_LIMIT; i++) {
- USHORT gid; /* old gid */
- ULONG loc, len;
- BYTE *p, *endptr;
- SHORT number_of_contours;
-
- if (i >= g->num_glyphs) /* finished */
- break;
-
- gid = g->gd[i].ogid;
- if (gid >= maxp->numGlyphs)
- TT_ERROR("Invalid glyph index (gid %u)", gid);
-
- loc = location[gid];
- len = location[gid+1] - loc;
- g->gd[i].advw = hmtx[gid].advance;
- g->gd[i].lsb = hmtx[gid].sideBearing;
- if (vmtx) {
- g->gd[i].advh = vmtx[gid].advance;
- g->gd[i].tsb = vmtx[gid].sideBearing;
- } else {
- g->gd[i].advh = g->default_advh;
- g->gd[i].tsb = g->default_tsb;
- }
- g->gd[i].length = len;
- g->gd[i].data = NULL;
- if (g->gd[i].advw <= g->emsize) {
- w_stat[g->gd[i].advw] += 1;
- } else {
- w_stat[g->emsize+1] += 1; /* larger than em */
- }
+ char *hmtx_table_data = NULL, *loca_table_data = NULL;
+ char *glyf_table_data = NULL;
+ ULONG hmtx_table_size, loca_table_size, glyf_table_size;
+ /* some information available from other TrueType table */
+ struct tt_head_table *head = NULL;
+ struct tt_hhea_table *hhea = NULL;
+ struct tt_maxp_table *maxp = NULL;
+ struct tt_longMetrics *hmtx, *vmtx = NULL;
+ struct tt_os2__table *os2;
+ /* temp */
+ ULONG *location, offset;
+ long i;
+ USHORT *w_stat; /* Estimate most frequently appeared width */
+
+ ASSERT(g);
+
+ if (sfont->type != SFNT_TYPE_TRUETYPE && sfont->type != SFNT_TYPE_TTC)
+ TT_ERROR("Invalid font type");
+
+ if (g->num_glyphs > NUM_GLYPH_LIMIT)
+ TT_ERROR("Too many glyphs.");
- if (len == 0) { /* Does not contains any data. */
- continue;
- } else if (len < 10) {
- TT_ERROR("Invalid TrueType glyph data (gid %u).", gid);
- }
+ /*
+ * Read head, hhea, maxp, loca:
+ *
+ * unitsPerEm --> head
+ * numHMetrics --> hhea
+ * indexToLocFormat --> head
+ * numGlyphs --> maxp
+ */
+ head = tt_read_head_table(sfont);
+ hhea = tt_read_hhea_table(sfont);
+ maxp = tt_read_maxp_table(sfont);
- g->gd[i].data = p = NEW(len, BYTE);
- endptr = p + len;
+ if (hhea->metricDataFormat != 0)
+ TT_ERROR("Unknown metricDataFormat.");
- sfnt_seek_set(sfont, offset+loc);
- number_of_contours = sfnt_get_short(sfont);
- p += sfnt_put_short(p, number_of_contours);
+ g->emsize = head->unitsPerEm;
- /* BoundingBox: FWord x 4 */
- g->gd[i].llx = sfnt_get_short(sfont);
- g->gd[i].lly = sfnt_get_short(sfont);
- g->gd[i].urx = sfnt_get_short(sfont);
- g->gd[i].ury = sfnt_get_short(sfont);
- /* _FIXME_ */
-#if 1
- if (!vmtx) /* vertOriginY == sTypeAscender */
- g->gd[i].tsb = g->default_advh - g->default_tsb - g->gd[i].ury;
-#endif
- p += sfnt_put_short(p, g->gd[i].llx);
- p += sfnt_put_short(p, g->gd[i].lly);
- p += sfnt_put_short(p, g->gd[i].urx);
- p += sfnt_put_short(p, g->gd[i].ury);
+ sfnt_locate_table(sfont, "hmtx");
+ hmtx = tt_read_longMetrics(sfont, maxp->numGlyphs, hhea->numberOfHMetrics);
- /* Read evrything else. */
- sfnt_read(p, len - 10, sfont);
- /*
- * Fix GIDs of composite glyphs.
- */
- if (number_of_contours < 0) {
- USHORT flags, cgid, new_gid; /* flag, gid of a component */
- do {
- if (p >= endptr)
- TT_ERROR("Invalid TrueType glyph data (gid %u): %u bytes", gid, (unsigned int)len);
- /*
- * Flags and gid of component glyph are both USHORT.
- */
- flags = ((*p) << 8)| *(p+1);
- p += 2;
- cgid = ((*p) << 8)| *(p+1);
- if (cgid >= maxp->numGlyphs) {
- TT_ERROR("Invalid gid (%u > %u) in composite glyph %u.", cgid, maxp->numGlyphs, gid);
- }
- new_gid = tt_find_glyph(g, cgid);
- if (new_gid == 0) {
- new_gid = tt_add_glyph(g, cgid, find_empty_slot(g));
- }
- p += sfnt_put_ushort(p, new_gid);
- /*
- * Just skip remaining part.
- */
- p += (flags & ARG_1_AND_2_ARE_WORDS) ? 4 : 2;
- if (flags & WE_HAVE_A_SCALE) /* F2Dot14 */
- p += 2;
- else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) /* F2Dot14 x 2 */
- p += 4;
- else if (flags & WE_HAVE_A_TWO_BY_TWO) /* F2Dot14 x 4 */
- p += 8;
- } while (flags & MORE_COMPONENT);
- /*
- * TrueType instructions comes here:
- * length_of_instruction (ushort)
- * instruction (byte * length_of_instruction)
- */
- }
- }
- RELEASE(location);
- RELEASE(hmtx);
- if (vmtx)
- RELEASE(vmtx);
-
- {
- int max_count = -1;
-
- g->dw = g->gd[0].advw;
- for (i = 0; i < g->emsize + 1; i++) {
- if (w_stat[i] > max_count) {
- max_count = w_stat[i];
- g->dw = i;
- }
+ os2 = tt_read_os2__table(sfont);
+ if (os2) {
+ g->default_advh = os2->sTypoAscender - os2->sTypoDescender;
+ g->default_tsb = g->default_advh - os2->sTypoAscender;
+
+ /* dvipdfmx does this elsewhere! */
+ fd_cur->font_dim[STEMV_CODE].val =
+ (os2->usWeightClass / 65) * (os2->usWeightClass / 65) + 50;
}
- }
- RELEASE(w_stat);
-
- qsort(g->gd, g->num_glyphs, sizeof(struct tt_glyph_desc), glyf_cmp);
- {
- USHORT prev, last_advw;
- char *p, *q;
- int padlen, num_hm_known;
-
- glyf_table_size = 0UL;
- num_hm_known = 0;
- last_advw = g->gd[g->num_glyphs - 1].advw;
- for (i = g->num_glyphs - 1; i >= 0; i--) {
- padlen = (g->gd[i].length % 4) ? (4 - (g->gd[i].length % 4)) : 0;
- glyf_table_size += g->gd[i].length + padlen;
- if (!num_hm_known && last_advw != g->gd[i].advw) {
- hhea->numberOfHMetrics = g->gd[i].gid + 2;
- num_hm_known = 1;
- }
+
+ if (sfnt_find_table_pos(sfont, "vmtx") > 0) {
+ struct tt_vhea_table *vhea;
+ vhea = tt_read_vhea_table(sfont);
+ sfnt_locate_table(sfont, "vmtx");
+ vmtx =
+ tt_read_longMetrics(sfont, maxp->numGlyphs,
+ vhea->numOfLongVerMetrics);
+ RELEASE(vhea);
+ } else {
+ vmtx = NULL;
}
- /* All advance widths are same. */
- if (!num_hm_known) {
- hhea->numberOfHMetrics = 1;
+
+ sfnt_locate_table(sfont, "loca");
+ location = NEW(maxp->numGlyphs + 1, ULONG);
+ if (head->indexToLocFormat == 0) {
+ for (i = 0; i <= maxp->numGlyphs; i++)
+ location[i] = 2 * ((ULONG) sfnt_get_ushort(sfont));
+ } else if (head->indexToLocFormat == 1) {
+ for (i = 0; i <= maxp->numGlyphs; i++)
+ location[i] = sfnt_get_ulong(sfont);
+ } else {
+ TT_ERROR("Unknown IndexToLocFormat.");
}
- hmtx_table_size = hhea->numberOfHMetrics * 2 + (g->last_gid + 1) * 2;
+ w_stat = NEW(g->emsize + 2, USHORT);
+ memset(w_stat, 0, sizeof(USHORT) * (g->emsize + 2));
/*
- * Choosing short format does not always give good result
- * when compressed. Sometimes increases size.
+ * Read glyf table.
*/
- if (glyf_table_size < 0x20000UL) {
- head->indexToLocFormat = 0;
- loca_table_size = (g->last_gid + 2)*2;
- } else {
- head->indexToLocFormat = 1;
- loca_table_size = (g->last_gid + 2)*4;
+ offset = sfnt_locate_table(sfont, "glyf");
+ /*
+ * The num_glyphs may grow when composite glyph is found.
+ * A component of glyph refered by a composite glyph is appended
+ * to used_glyphs if it is not already registered in used_glyphs.
+ * Glyph programs of composite glyphs are modified so that it
+ * correctly refer to new gid of their components.
+ */
+ for (i = 0; i < NUM_GLYPH_LIMIT; i++) {
+ USHORT gid; /* old gid */
+ ULONG loc, len;
+ BYTE *p, *endptr;
+ SHORT number_of_contours;
+
+ if (i >= g->num_glyphs) /* finished */
+ break;
+
+ gid = g->gd[i].ogid;
+ if (gid >= maxp->numGlyphs)
+ TT_ERROR("Invalid glyph index (gid %u)", gid);
+
+ loc = location[gid];
+ len = location[gid + 1] - loc;
+ g->gd[i].advw = hmtx[gid].advance;
+ g->gd[i].lsb = hmtx[gid].sideBearing;
+ if (vmtx) {
+ g->gd[i].advh = vmtx[gid].advance;
+ g->gd[i].tsb = vmtx[gid].sideBearing;
+ } else {
+ g->gd[i].advh = g->default_advh;
+ g->gd[i].tsb = g->default_tsb;
+ }
+ g->gd[i].length = len;
+ g->gd[i].data = NULL;
+ if (g->gd[i].advw <= g->emsize) {
+ w_stat[g->gd[i].advw] += 1;
+ } else {
+ w_stat[g->emsize + 1] += 1; /* larger than em */
+ }
+
+ if (len == 0) { /* Does not contains any data. */
+ continue;
+ } else if (len < 10) {
+ TT_ERROR("Invalid TrueType glyph data (gid %u).", gid);
+ }
+
+ g->gd[i].data = p = NEW(len, BYTE);
+ endptr = p + len;
+
+ sfnt_seek_set(sfont, offset + loc);
+ number_of_contours = sfnt_get_short(sfont);
+ p += sfnt_put_short(p, number_of_contours);
+
+ /* BoundingBox: FWord x 4 */
+ g->gd[i].llx = sfnt_get_short(sfont);
+ g->gd[i].lly = sfnt_get_short(sfont);
+ g->gd[i].urx = sfnt_get_short(sfont);
+ g->gd[i].ury = sfnt_get_short(sfont);
+ /* _FIXME_ */
+#if 1
+ if (!vmtx) /* vertOriginY == sTypeAscender */
+ g->gd[i].tsb = g->default_advh - g->default_tsb - g->gd[i].ury;
+#endif
+ p += sfnt_put_short(p, g->gd[i].llx);
+ p += sfnt_put_short(p, g->gd[i].lly);
+ p += sfnt_put_short(p, g->gd[i].urx);
+ p += sfnt_put_short(p, g->gd[i].ury);
+
+ /* Read evrything else. */
+ sfnt_read(p, len - 10, sfont);
+ /*
+ * Fix GIDs of composite glyphs.
+ */
+ if (number_of_contours < 0) {
+ USHORT flags, cgid, new_gid; /* flag, gid of a component */
+ do {
+ if (p >= endptr)
+ TT_ERROR("Invalid TrueType glyph data (gid %u): %u bytes",
+ gid, (unsigned int) len);
+ /*
+ * Flags and gid of component glyph are both USHORT.
+ */
+ flags = ((*p) << 8) | *(p + 1);
+ p += 2;
+ cgid = ((*p) << 8) | *(p + 1);
+ if (cgid >= maxp->numGlyphs) {
+ TT_ERROR("Invalid gid (%u > %u) in composite glyph %u.",
+ cgid, maxp->numGlyphs, gid);
+ }
+ new_gid = tt_find_glyph(g, cgid);
+ if (new_gid == 0) {
+ new_gid = tt_add_glyph(g, cgid, find_empty_slot(g));
+ }
+ p += sfnt_put_ushort(p, new_gid);
+ /*
+ * Just skip remaining part.
+ */
+ p += (flags & ARG_1_AND_2_ARE_WORDS) ? 4 : 2;
+ if (flags & WE_HAVE_A_SCALE) /* F2Dot14 */
+ p += 2;
+ else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) /* F2Dot14 x 2 */
+ p += 4;
+ else if (flags & WE_HAVE_A_TWO_BY_TWO) /* F2Dot14 x 4 */
+ p += 8;
+ } while (flags & MORE_COMPONENTS);
+ /*
+ * TrueType instructions comes here:
+ * length_of_instruction (ushort)
+ * instruction (byte * length_of_instruction)
+ */
+ }
}
-
- hmtx_table_data = p = NEW(hmtx_table_size, char);
- loca_table_data = q = NEW(loca_table_size, char);
- glyf_table_data = NEW(glyf_table_size, char);
-
- offset = 0UL; prev = 0;
- for (i = 0; i < g->num_glyphs; i++) {
- long gap, j;
- gap = (long) g->gd[i].gid - prev - 1;
- for (j = 1; j <= gap; j++) {
- if (prev + j == hhea->numberOfHMetrics - 1) {
- p += sfnt_put_ushort(p, last_advw);
- } else if (prev + j < hhea->numberOfHMetrics) {
- p += sfnt_put_ushort(p, 0);
- }
- p += sfnt_put_short (p, 0);
- if (head->indexToLocFormat == 0) {
- q += sfnt_put_ushort(q, (USHORT) (offset/2));
- } else {
- q += sfnt_put_ulong(q, offset);
- }
- }
- padlen = (g->gd[i].length % 4) ? (4 - (g->gd[i].length % 4)) : 0;
- if (g->gd[i].gid < hhea->numberOfHMetrics) {
- p += sfnt_put_ushort(p, g->gd[i].advw);
- }
- p += sfnt_put_short (p, g->gd[i].lsb);
- if (head->indexToLocFormat == 0) {
- q += sfnt_put_ushort(q, (USHORT) (offset/2));
- } else {
- q += sfnt_put_ulong(q, offset);
- }
- memset(glyf_table_data + offset, 0, g->gd[i].length + padlen);
- memcpy(glyf_table_data + offset, g->gd[i].data, g->gd[i].length);
- offset += g->gd[i].length + padlen;
- prev = g->gd[i].gid;
- /* free data here since it consume much memory */
- RELEASE(g->gd[i].data);
- g->gd[i].length = 0; g->gd[i].data = NULL;
+ RELEASE(location);
+ RELEASE(hmtx);
+ if (vmtx)
+ RELEASE(vmtx);
+
+ {
+ int max_count = -1;
+
+ g->dw = g->gd[0].advw;
+ for (i = 0; i < g->emsize + 1; i++) {
+ if (w_stat[i] > max_count) {
+ max_count = w_stat[i];
+ g->dw = i;
+ }
+ }
}
- if (head->indexToLocFormat == 0) {
- q += sfnt_put_ushort(q, (USHORT) (offset/2));
- } else {
- q += sfnt_put_ulong(q, offset);
+ RELEASE(w_stat);
+
+ qsort(g->gd, g->num_glyphs, sizeof(struct tt_glyph_desc), glyf_cmp);
+ {
+ USHORT prev, last_advw;
+ char *p, *q;
+ int padlen, num_hm_known;
+
+ glyf_table_size = 0UL;
+ num_hm_known = 0;
+ last_advw = g->gd[g->num_glyphs - 1].advw;
+ for (i = g->num_glyphs - 1; i >= 0; i--) {
+ padlen = (g->gd[i].length % 4) ? (4 - (g->gd[i].length % 4)) : 0;
+ glyf_table_size += g->gd[i].length + padlen;
+ if (!num_hm_known && last_advw != g->gd[i].advw) {
+ hhea->numberOfHMetrics = g->gd[i].gid + 2;
+ num_hm_known = 1;
+ }
+ }
+ /* All advance widths are same. */
+ if (!num_hm_known) {
+ hhea->numberOfHMetrics = 1;
+ }
+ hmtx_table_size = hhea->numberOfHMetrics * 2 + (g->last_gid + 1) * 2;
+
+ /*
+ * Choosing short format does not always give good result
+ * when compressed. Sometimes increases size.
+ */
+ if (glyf_table_size < 0x20000UL) {
+ head->indexToLocFormat = 0;
+ loca_table_size = (g->last_gid + 2) * 2;
+ } else {
+ head->indexToLocFormat = 1;
+ loca_table_size = (g->last_gid + 2) * 4;
+ }
+
+ hmtx_table_data = p = NEW(hmtx_table_size, char);
+ loca_table_data = q = NEW(loca_table_size, char);
+ glyf_table_data = NEW(glyf_table_size, char);
+
+ offset = 0UL;
+ prev = 0;
+ for (i = 0; i < g->num_glyphs; i++) {
+ long gap, j;
+ gap = (long) g->gd[i].gid - prev - 1;
+ for (j = 1; j <= gap; j++) {
+ if (prev + j == hhea->numberOfHMetrics - 1) {
+ p += sfnt_put_ushort(p, last_advw);
+ } else if (prev + j < hhea->numberOfHMetrics) {
+ p += sfnt_put_ushort(p, 0);
+ }
+ p += sfnt_put_short(p, 0);
+ if (head->indexToLocFormat == 0) {
+ q += sfnt_put_ushort(q, (USHORT) (offset / 2));
+ } else {
+ q += sfnt_put_ulong(q, offset);
+ }
+ }
+ padlen = (g->gd[i].length % 4) ? (4 - (g->gd[i].length % 4)) : 0;
+ if (g->gd[i].gid < hhea->numberOfHMetrics) {
+ p += sfnt_put_ushort(p, g->gd[i].advw);
+ }
+ p += sfnt_put_short(p, g->gd[i].lsb);
+ if (head->indexToLocFormat == 0) {
+ q += sfnt_put_ushort(q, (USHORT) (offset / 2));
+ } else {
+ q += sfnt_put_ulong(q, offset);
+ }
+ memset(glyf_table_data + offset, 0, g->gd[i].length + padlen);
+ memcpy(glyf_table_data + offset, g->gd[i].data, g->gd[i].length);
+ offset += g->gd[i].length + padlen;
+ prev = g->gd[i].gid;
+ /* free data here since it consume much memory */
+ RELEASE(g->gd[i].data);
+ g->gd[i].length = 0;
+ g->gd[i].data = NULL;
+ }
+ if (head->indexToLocFormat == 0) {
+ q += sfnt_put_ushort(q, (USHORT) (offset / 2));
+ } else {
+ q += sfnt_put_ulong(q, offset);
+ }
+
+ sfnt_set_table(sfont, "hmtx", (char *) hmtx_table_data,
+ hmtx_table_size);
+ sfnt_set_table(sfont, "loca", (char *) loca_table_data,
+ loca_table_size);
+ sfnt_set_table(sfont, "glyf", (char *) glyf_table_data,
+ glyf_table_size);
}
- sfnt_set_table(sfont, "hmtx", (char *) hmtx_table_data, hmtx_table_size);
- sfnt_set_table(sfont, "loca", (char *) loca_table_data, loca_table_size);
- sfnt_set_table(sfont, "glyf", (char *) glyf_table_data, glyf_table_size);
- }
-
- head->checkSumAdjustment = 0;
- maxp->numGlyphs = g->last_gid + 1;
-
- /* TODO */
- sfnt_set_table(sfont, "maxp", tt_pack_maxp_table(maxp), TT_MAXP_TABLE_SIZE);
- sfnt_set_table(sfont, "hhea", tt_pack_hhea_table(hhea), TT_HHEA_TABLE_SIZE);
- sfnt_set_table(sfont, "head", tt_pack_head_table(head), TT_HEAD_TABLE_SIZE);
- RELEASE(maxp);
- RELEASE(hhea);
- RELEASE(head);
- if (os2)
- RELEASE(os2);
+ head->checkSumAdjustment = 0;
+ maxp->numGlyphs = g->last_gid + 1;
+
+ /* TODO */
+ sfnt_set_table(sfont, "maxp", tt_pack_maxp_table(maxp), TT_MAXP_TABLE_SIZE);
+ sfnt_set_table(sfont, "hhea", tt_pack_hhea_table(hhea), TT_HHEA_TABLE_SIZE);
+ sfnt_set_table(sfont, "head", tt_pack_head_table(head), TT_HEAD_TABLE_SIZE);
+ RELEASE(maxp);
+ RELEASE(hhea);
+ RELEASE(head);
+ if (os2)
+ RELEASE(os2);
- return 0;
+ return 0;
}
-int
-tt_get_metrics (sfnt *sfont, struct tt_glyphs *g)
+int tt_get_metrics(sfnt * sfont, struct tt_glyphs *g)
{
- struct tt_head_table *head = NULL;
- struct tt_hhea_table *hhea = NULL;
- struct tt_maxp_table *maxp = NULL;
- struct tt_longMetrics *hmtx, *vmtx = NULL;
- struct tt_os2__table *os2;
- /* temp */
- ULONG *location, offset;
- long i;
- USHORT *w_stat;
-
- ASSERT(g);
-
- if (sfont == NULL ||
+ struct tt_head_table *head = NULL;
+ struct tt_hhea_table *hhea = NULL;
+ struct tt_maxp_table *maxp = NULL;
+ struct tt_longMetrics *hmtx, *vmtx = NULL;
+ struct tt_os2__table *os2;
+ /* temp */
+ ULONG *location, offset;
+ long i;
+ USHORT *w_stat;
+
+ ASSERT(g);
+
+ if (sfont == NULL ||
#ifdef XETEX
- sfont->ft_face == NULL
+ sfont->ft_face == NULL
#elif defined(pdfTeX)
- sfont->buffer == NULL
+ sfont->buffer == NULL
#else
- sfont->stream == NULL
+ sfont->stream == NULL
#endif
- )
- TT_ERROR("File not opened.");
-
- if (sfont->type != SFNT_TYPE_TRUETYPE &&
- sfont->type != SFNT_TYPE_TTC)
- TT_ERROR("Invalid font type");
-
- /*
- * Read head, hhea, maxp, loca:
- *
- * unitsPerEm --> head
- * numHMetrics --> hhea
- * indexToLocFormat --> head
- * numGlyphs --> maxp
- */
- head = tt_read_head_table(sfont);
- hhea = tt_read_hhea_table(sfont);
- maxp = tt_read_maxp_table(sfont);
-
- if (hhea->metricDataFormat != 0)
- TT_ERROR("Unknown metricDataFormat.");
-
- g->emsize = head->unitsPerEm;
-
- sfnt_locate_table(sfont, "hmtx");
- hmtx = tt_read_longMetrics(sfont, maxp->numGlyphs, hhea->numberOfHMetrics);
-
- os2 = tt_read_os2__table(sfont);
- g->default_advh = os2->sTypoAscender - os2->sTypoDescender;
- g->default_tsb = g->default_advh - os2->sTypoAscender;
-
- if (sfnt_find_table_pos(sfont, "vmtx") > 0) {
- struct tt_vhea_table *vhea;
- vhea = tt_read_vhea_table(sfont);
- sfnt_locate_table(sfont, "vmtx");
- vmtx = tt_read_longMetrics(sfont, maxp->numGlyphs, vhea->numOfLongVerMetrics);
- RELEASE(vhea);
- } else {
- vmtx = NULL;
- }
-
- sfnt_locate_table(sfont, "loca");
- location = NEW(maxp->numGlyphs + 1, ULONG);
- if (head->indexToLocFormat == 0) {
- for (i = 0; i <= maxp->numGlyphs; i++)
- location[i] = 2*((ULONG) sfnt_get_ushort(sfont));
- } else if (head->indexToLocFormat == 1) {
- for (i = 0; i <= maxp->numGlyphs; i++)
- location[i] = sfnt_get_ulong(sfont);
- } else {
- TT_ERROR("Unknown IndexToLocFormat.");
- }
-
- w_stat = NEW(g->emsize+2, USHORT);
- memset(w_stat, 0, sizeof(USHORT)*(g->emsize+2));
- /*
- * Read glyf table.
- */
- offset = sfnt_locate_table(sfont, "glyf");
- for (i = 0; i < g->num_glyphs; i++) {
- USHORT gid; /* old gid */
- ULONG loc, len;
- SHORT number_of_contours;
-
- gid = g->gd[i].ogid;
- if (gid >= maxp->numGlyphs)
- TT_ERROR("Invalid glyph index (gid %u)", gid);
-
- loc = location[gid];
- len = location[gid+1] - loc;
- g->gd[i].advw = hmtx[gid].advance;
- g->gd[i].lsb = hmtx[gid].sideBearing;
- if (vmtx) {
- g->gd[i].advh = vmtx[gid].advance;
- g->gd[i].tsb = vmtx[gid].sideBearing;
+ )
+ TT_ERROR("File not opened.");
+
+ if (sfont->type != SFNT_TYPE_TRUETYPE && sfont->type != SFNT_TYPE_TTC)
+ TT_ERROR("Invalid font type");
+
+ /*
+ * Read head, hhea, maxp, loca:
+ *
+ * unitsPerEm --> head
+ * numHMetrics --> hhea
+ * indexToLocFormat --> head
+ * numGlyphs --> maxp
+ */
+ head = tt_read_head_table(sfont);
+ hhea = tt_read_hhea_table(sfont);
+ maxp = tt_read_maxp_table(sfont);
+
+ if (hhea->metricDataFormat != 0)
+ TT_ERROR("Unknown metricDataFormat.");
+
+ g->emsize = head->unitsPerEm;
+
+ sfnt_locate_table(sfont, "hmtx");
+ hmtx = tt_read_longMetrics(sfont, maxp->numGlyphs, hhea->numberOfHMetrics);
+
+ os2 = tt_read_os2__table(sfont);
+ g->default_advh = os2->sTypoAscender - os2->sTypoDescender;
+ g->default_tsb = g->default_advh - os2->sTypoAscender;
+
+ if (sfnt_find_table_pos(sfont, "vmtx") > 0) {
+ struct tt_vhea_table *vhea;
+ vhea = tt_read_vhea_table(sfont);
+ sfnt_locate_table(sfont, "vmtx");
+ vmtx =
+ tt_read_longMetrics(sfont, maxp->numGlyphs,
+ vhea->numOfLongVerMetrics);
+ RELEASE(vhea);
} else {
- g->gd[i].advh = g->default_advh;
- g->gd[i].tsb = g->default_tsb;
+ vmtx = NULL;
}
- g->gd[i].length = len;
- g->gd[i].data = NULL;
- if (g->gd[i].advw <= g->emsize) {
- w_stat[g->gd[i].advw] += 1;
+ sfnt_locate_table(sfont, "loca");
+ location = NEW(maxp->numGlyphs + 1, ULONG);
+ if (head->indexToLocFormat == 0) {
+ for (i = 0; i <= maxp->numGlyphs; i++)
+ location[i] = 2 * ((ULONG) sfnt_get_ushort(sfont));
+ } else if (head->indexToLocFormat == 1) {
+ for (i = 0; i <= maxp->numGlyphs; i++)
+ location[i] = sfnt_get_ulong(sfont);
} else {
- w_stat[g->emsize+1] += 1; /* larger than em */
+ TT_ERROR("Unknown IndexToLocFormat.");
}
- if (len == 0) { /* Does not contains any data. */
- continue;
- } else if (len < 10) {
- TT_ERROR("Invalid TrueType glyph data (gid %u).", gid);
+ w_stat = NEW(g->emsize + 2, USHORT);
+ memset(w_stat, 0, sizeof(USHORT) * (g->emsize + 2));
+ /*
+ * Read glyf table.
+ */
+ offset = sfnt_locate_table(sfont, "glyf");
+ for (i = 0; i < g->num_glyphs; i++) {
+ USHORT gid; /* old gid */
+ ULONG loc, len;
+ SHORT number_of_contours;
+
+ gid = g->gd[i].ogid;
+ if (gid >= maxp->numGlyphs)
+ TT_ERROR("Invalid glyph index (gid %u)", gid);
+
+ loc = location[gid];
+ len = location[gid + 1] - loc;
+ g->gd[i].advw = hmtx[gid].advance;
+ g->gd[i].lsb = hmtx[gid].sideBearing;
+ if (vmtx) {
+ g->gd[i].advh = vmtx[gid].advance;
+ g->gd[i].tsb = vmtx[gid].sideBearing;
+ } else {
+ g->gd[i].advh = g->default_advh;
+ g->gd[i].tsb = g->default_tsb;
+ }
+ g->gd[i].length = len;
+ g->gd[i].data = NULL;
+
+ if (g->gd[i].advw <= g->emsize) {
+ w_stat[g->gd[i].advw] += 1;
+ } else {
+ w_stat[g->emsize + 1] += 1; /* larger than em */
+ }
+
+ if (len == 0) { /* Does not contains any data. */
+ continue;
+ } else if (len < 10) {
+ TT_ERROR("Invalid TrueType glyph data (gid %u).", gid);
+ }
+
+ sfnt_seek_set(sfont, offset + loc);
+ number_of_contours = sfnt_get_short(sfont);
+
+ /* BoundingBox: FWord x 4 */
+ g->gd[i].llx = sfnt_get_short(sfont);
+ g->gd[i].lly = sfnt_get_short(sfont);
+ g->gd[i].urx = sfnt_get_short(sfont);
+ g->gd[i].ury = sfnt_get_short(sfont);
+ /* _FIXME_ */
+#if 1
+ if (!vmtx) /* vertOriginY == sTypeAscender */
+ g->gd[i].tsb = g->default_advh - g->default_tsb - g->gd[i].ury;
+#endif
}
+ RELEASE(location);
+ RELEASE(hmtx);
+ RELEASE(maxp);
+ RELEASE(hhea);
+ RELEASE(head);
+ RELEASE(os2);
- sfnt_seek_set(sfont, offset+loc);
- number_of_contours = sfnt_get_short(sfont);
+ if (vmtx)
+ RELEASE(vmtx);
- /* BoundingBox: FWord x 4 */
- g->gd[i].llx = sfnt_get_short(sfont);
- g->gd[i].lly = sfnt_get_short(sfont);
- g->gd[i].urx = sfnt_get_short(sfont);
- g->gd[i].ury = sfnt_get_short(sfont);
- /* _FIXME_ */
-#if 1
- if (!vmtx) /* vertOriginY == sTypeAscender */
- g->gd[i].tsb = g->default_advh - g->default_tsb - g->gd[i].ury;
-#endif
- }
- RELEASE(location);
- RELEASE(hmtx);
- RELEASE(maxp);
- RELEASE(hhea);
- RELEASE(head);
- RELEASE(os2);
-
- if (vmtx)
- RELEASE(vmtx);
-
- {
- int max_count = -1;
-
- g->dw = g->gd[0].advw;
- for (i = 0; i < g->emsize + 1; i++) {
- if (w_stat[i] > max_count) {
- max_count = w_stat[i];
- g->dw = i;
- }
+ {
+ int max_count = -1;
+
+ g->dw = g->gd[0].advw;
+ for (i = 0; i < g->emsize + 1; i++) {
+ if (w_stat[i] > max_count) {
+ max_count = w_stat[i];
+ g->dw = i;
+ }
+ }
}
- }
- RELEASE(w_stat);
+ RELEASE(w_stat);
- return 0;
+ return 0;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/tt_glyf.h b/Build/source/texk/web2c/luatexdir/font/tt_glyf.h
index cf33af6733f..0ca8465c33d 100644
--- a/Build/source/texk/web2c/luatexdir/font/tt_glyf.h
+++ b/Build/source/texk/web2c/luatexdir/font/tt_glyf.h
@@ -1,60 +1,59 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/tt_glyf.h,v 1.1 2004/09/11 14:50:29 hirata Exp $
+/* tt_glyf.h
- This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+ Copyright 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
- the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: tt_glyf.h 1223 2008-05-02 13:39:55Z oneiros $ */
#ifndef _TT_GLYF_H_
-#define _TT_GLYF_H_
-
-struct tt_glyph_desc
-{
- USHORT gid;
- USHORT ogid; /* GID in original font */
- USHORT advw, advh;
- SHORT lsb, tsb;
- SHORT llx, lly, urx, ury;
- ULONG length;
- BYTE *data;
+# define _TT_GLYF_H_
+
+struct tt_glyph_desc {
+ USHORT gid;
+ USHORT ogid; /* GID in original font */
+ USHORT advw, advh;
+ SHORT lsb, tsb;
+ SHORT llx, lly, urx, ury;
+ ULONG length;
+ BYTE *data;
};
-struct tt_glyphs
-{
- USHORT num_glyphs;
- USHORT max_glyphs;
- USHORT last_gid;
- USHORT emsize;
- USHORT dw; /* optimal value for DW */
- USHORT default_advh; /* default value */
- SHORT default_tsb; /* default value */
- struct tt_glyph_desc *gd;
- unsigned char *used_slot;
+struct tt_glyphs {
+ USHORT num_glyphs;
+ USHORT max_glyphs;
+ USHORT last_gid;
+ USHORT emsize;
+ USHORT dw; /* optimal value for DW */
+ USHORT default_advh; /* default value */
+ SHORT default_tsb; /* default value */
+ struct tt_glyph_desc *gd;
+ unsigned char *used_slot;
};
-extern struct tt_glyphs *tt_build_init (void);
-extern void tt_build_finish (struct tt_glyphs *g);
+extern struct tt_glyphs *tt_build_init(void);
+extern void tt_build_finish(struct tt_glyphs *g);
-extern USHORT tt_add_glyph (struct tt_glyphs *g, USHORT gid, USHORT new_gid);
-extern USHORT tt_get_index (struct tt_glyphs *g, USHORT gid);
-extern USHORT tt_find_glyph (struct tt_glyphs *g, USHORT gid);
+extern USHORT tt_add_glyph(struct tt_glyphs *g, USHORT gid, USHORT new_gid);
+extern USHORT tt_get_index(struct tt_glyphs *g, USHORT gid);
+extern USHORT tt_find_glyph(struct tt_glyphs *g, USHORT gid);
-extern int tt_build_tables (sfnt *sfont, struct tt_glyphs *g);
-extern int tt_get_metrics (sfnt *sfont, struct tt_glyphs *g);
+extern int tt_build_tables(sfnt * sfont, struct tt_glyphs *g);
+extern int tt_get_metrics(sfnt * sfont, struct tt_glyphs *g);
-#endif /* _TT_GLYF_H_ */
+#endif /* _TT_GLYF_H_ */
diff --git a/Build/source/texk/web2c/luatexdir/font/tt_table.c b/Build/source/texk/web2c/luatexdir/font/tt_table.c
index 4f82552d9df..3df19723c2b 100644
--- a/Build/source/texk/web2c/luatexdir/font/tt_table.c
+++ b/Build/source/texk/web2c/luatexdir/font/tt_table.c
@@ -1,39 +1,41 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/tt_table.c,v 1.7 2004/09/11 14:50:29 hirata Exp $
+/* tt_table.c
- This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+ Copyright 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
- the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#ifndef pdfTeX
-#include "system.h"
-#include "error.h"
-#include "mem.h"
-#include "mfileio.h"
+# include "system.h"
+# include "error.h"
+# include "mem.h"
+# include "mfileio.h"
#else
-extern void pdftex_fail (const char *fmt, ...); /* utils.c */
+# include "ptexlib.h"
#endif
#include "sfnt.h"
#include "tt_table.h"
+static const char _svn_version[] =
+ "$Id: tt_table.c 1588 2008-11-28 13:18:54Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/tt_table.c $";
+
/*
tables contains information refered by other tables
maxp->numGlyphs, etc --> loca, etc
@@ -42,269 +44,264 @@ extern void pdftex_fail (const char *fmt, ...); /* utils.c */
head->glyphDataFormat --> glyf
*/
-char *tt_pack_head_table (struct tt_head_table *table)
+char *tt_pack_head_table(struct tt_head_table *table)
{
- int i;
- char *p, *data;
-
- if (table == NULL)
- TT_ERROR("passed NULL pointer\n");
-
- p = data = NEW(TT_HEAD_TABLE_SIZE, char);
- p += sfnt_put_ulong(p, table->version);
- p += sfnt_put_ulong(p, table->fontRevision);
- p += sfnt_put_ulong(p, table->checkSumAdjustment);
- p += sfnt_put_ulong(p, table->magicNumber);
- p += sfnt_put_ushort(p, table->flags);
- p += sfnt_put_ushort(p, table->unitsPerEm);
- for (i=0; i<8; i++) {
- *(p++) = (table->created)[i];
- }
- for (i=0; i<8; i++) {
- *(p++) = (table->modified)[i];
- }
- p += sfnt_put_short(p, table->xMin);
- p += sfnt_put_short(p, table->yMin);
- p += sfnt_put_short(p, table->xMax);
- p += sfnt_put_short(p, table->yMax);
- p += sfnt_put_ushort(p, table->macStyle);
- p += sfnt_put_ushort(p, table->lowestRecPPEM);
- p += sfnt_put_short(p, table->fontDirectionHint);
- p += sfnt_put_short(p, table->indexToLocFormat);
- p += sfnt_put_short(p, table->glyphDataFormat);
-
- return data;
+ int i;
+ char *p, *data;
+
+ if (table == NULL)
+ TT_ERROR("passed NULL pointer\n");
+
+ p = data = NEW(TT_HEAD_TABLE_SIZE, char);
+ p += sfnt_put_ulong(p, table->version);
+ p += sfnt_put_ulong(p, table->fontRevision);
+ p += sfnt_put_ulong(p, table->checkSumAdjustment);
+ p += sfnt_put_ulong(p, table->magicNumber);
+ p += sfnt_put_ushort(p, table->flags);
+ p += sfnt_put_ushort(p, table->unitsPerEm);
+ for (i = 0; i < 8; i++) {
+ *(p++) = (table->created)[i];
+ }
+ for (i = 0; i < 8; i++) {
+ *(p++) = (table->modified)[i];
+ }
+ p += sfnt_put_short(p, table->xMin);
+ p += sfnt_put_short(p, table->yMin);
+ p += sfnt_put_short(p, table->xMax);
+ p += sfnt_put_short(p, table->yMax);
+ p += sfnt_put_ushort(p, table->macStyle);
+ p += sfnt_put_ushort(p, table->lowestRecPPEM);
+ p += sfnt_put_short(p, table->fontDirectionHint);
+ p += sfnt_put_short(p, table->indexToLocFormat);
+ p += sfnt_put_short(p, table->glyphDataFormat);
+
+ return data;
}
-struct tt_head_table *tt_read_head_table (sfnt *sfont)
+struct tt_head_table *tt_read_head_table(sfnt * sfont)
{
- int i;
- struct tt_head_table *table = NULL;
-
- table = NEW(1, struct tt_head_table);
-
- sfnt_locate_table(sfont, "head");
-
- table->version = sfnt_get_ulong(sfont);
- table->fontRevision = sfnt_get_ulong(sfont);
- table->checkSumAdjustment = sfnt_get_ulong(sfont);
- table->magicNumber = sfnt_get_ulong(sfont);
- table->flags = sfnt_get_ushort(sfont);
- table->unitsPerEm = sfnt_get_ushort(sfont);
- for (i=0; i<8; i++) {
- (table->created)[i] = sfnt_get_byte (sfont);
- }
- for (i=0; i<8; i++) {
- (table->modified)[i] = sfnt_get_byte (sfont);
- }
- table->xMin = sfnt_get_short(sfont);
- table->yMin = sfnt_get_short(sfont);
- table->xMax = sfnt_get_short(sfont);
- table->yMax = sfnt_get_short(sfont);
- table->macStyle = sfnt_get_short(sfont);
- table->lowestRecPPEM = sfnt_get_short(sfont);
- table->fontDirectionHint = sfnt_get_short(sfont);
- table->indexToLocFormat = sfnt_get_short(sfont);
- table->glyphDataFormat = sfnt_get_short(sfont);
-
- return table;
+ int i;
+ struct tt_head_table *table = NULL;
+
+ table = NEW(1, struct tt_head_table);
+
+ sfnt_locate_table(sfont, "head");
+
+ table->version = sfnt_get_ulong(sfont);
+ table->fontRevision = sfnt_get_ulong(sfont);
+ table->checkSumAdjustment = sfnt_get_ulong(sfont);
+ table->magicNumber = sfnt_get_ulong(sfont);
+ table->flags = sfnt_get_ushort(sfont);
+ table->unitsPerEm = sfnt_get_ushort(sfont);
+ for (i = 0; i < 8; i++) {
+ (table->created)[i] = sfnt_get_byte(sfont);
+ }
+ for (i = 0; i < 8; i++) {
+ (table->modified)[i] = sfnt_get_byte(sfont);
+ }
+ table->xMin = sfnt_get_short(sfont);
+ table->yMin = sfnt_get_short(sfont);
+ table->xMax = sfnt_get_short(sfont);
+ table->yMax = sfnt_get_short(sfont);
+ table->macStyle = sfnt_get_short(sfont);
+ table->lowestRecPPEM = sfnt_get_short(sfont);
+ table->fontDirectionHint = sfnt_get_short(sfont);
+ table->indexToLocFormat = sfnt_get_short(sfont);
+ table->glyphDataFormat = sfnt_get_short(sfont);
+
+ return table;
}
-char *tt_pack_maxp_table (struct tt_maxp_table *table)
+char *tt_pack_maxp_table(struct tt_maxp_table *table)
{
- char *p, *data;
-
- p = data = NEW(TT_MAXP_TABLE_SIZE, char);
- p += sfnt_put_ulong(p, table->version);
- p += sfnt_put_ushort(p, table->numGlyphs);
- p += sfnt_put_ushort(p, table->maxPoints);
- p += sfnt_put_ushort(p, table->maxContours);
- p += sfnt_put_ushort(p, table->maxComponentPoints);
- p += sfnt_put_ushort(p, table->maxComponentContours);
- p += sfnt_put_ushort(p, table->maxZones);
- p += sfnt_put_ushort(p, table->maxTwilightPoints);
- p += sfnt_put_ushort(p, table->maxStorage);
- p += sfnt_put_ushort(p, table->maxFunctionDefs);
- p += sfnt_put_ushort(p, table->maxInstructionDefs);
- p += sfnt_put_ushort(p, table->maxStackElements);
- p += sfnt_put_ushort(p, table->maxSizeOfInstructions);
- p += sfnt_put_ushort(p, table->maxComponentElements);
- p += sfnt_put_ushort(p, table->maxComponentDepth);
-
- return data;
+ char *p, *data;
+
+ p = data = NEW(TT_MAXP_TABLE_SIZE, char);
+ p += sfnt_put_ulong(p, table->version);
+ p += sfnt_put_ushort(p, table->numGlyphs);
+ p += sfnt_put_ushort(p, table->maxPoints);
+ p += sfnt_put_ushort(p, table->maxContours);
+ p += sfnt_put_ushort(p, table->maxComponentPoints);
+ p += sfnt_put_ushort(p, table->maxComponentContours);
+ p += sfnt_put_ushort(p, table->maxZones);
+ p += sfnt_put_ushort(p, table->maxTwilightPoints);
+ p += sfnt_put_ushort(p, table->maxStorage);
+ p += sfnt_put_ushort(p, table->maxFunctionDefs);
+ p += sfnt_put_ushort(p, table->maxInstructionDefs);
+ p += sfnt_put_ushort(p, table->maxStackElements);
+ p += sfnt_put_ushort(p, table->maxSizeOfInstructions);
+ p += sfnt_put_ushort(p, table->maxComponentElements);
+ p += sfnt_put_ushort(p, table->maxComponentDepth);
+
+ return data;
}
-struct tt_maxp_table *tt_read_maxp_table (sfnt *sfont)
+struct tt_maxp_table *tt_read_maxp_table(sfnt * sfont)
{
- struct tt_maxp_table *table = NULL;
-
- table = NEW(1, struct tt_maxp_table);
-
- sfnt_locate_table(sfont, "maxp");
- table->version = sfnt_get_ulong(sfont);
- table->numGlyphs = sfnt_get_ushort(sfont);
- table->maxPoints = sfnt_get_ushort(sfont);
- table->maxContours = sfnt_get_ushort(sfont);
- table->maxComponentPoints = sfnt_get_ushort(sfont);
- table->maxComponentContours = sfnt_get_ushort(sfont);
- table->maxZones = sfnt_get_ushort(sfont);
- table->maxTwilightPoints = sfnt_get_ushort(sfont);
- table->maxStorage = sfnt_get_ushort(sfont);
- table->maxFunctionDefs = sfnt_get_ushort(sfont);
- table->maxInstructionDefs = sfnt_get_ushort(sfont);
- table->maxStackElements = sfnt_get_ushort(sfont);
- table->maxSizeOfInstructions = sfnt_get_ushort(sfont);
- table->maxComponentElements = sfnt_get_ushort(sfont);
- table->maxComponentDepth = sfnt_get_ushort(sfont);
-
- return table;
+ struct tt_maxp_table *table = NULL;
+
+ table = NEW(1, struct tt_maxp_table);
+
+ sfnt_locate_table(sfont, "maxp");
+ table->version = sfnt_get_ulong(sfont);
+ table->numGlyphs = sfnt_get_ushort(sfont);
+ table->maxPoints = sfnt_get_ushort(sfont);
+ table->maxContours = sfnt_get_ushort(sfont);
+ table->maxComponentPoints = sfnt_get_ushort(sfont);
+ table->maxComponentContours = sfnt_get_ushort(sfont);
+ table->maxZones = sfnt_get_ushort(sfont);
+ table->maxTwilightPoints = sfnt_get_ushort(sfont);
+ table->maxStorage = sfnt_get_ushort(sfont);
+ table->maxFunctionDefs = sfnt_get_ushort(sfont);
+ table->maxInstructionDefs = sfnt_get_ushort(sfont);
+ table->maxStackElements = sfnt_get_ushort(sfont);
+ table->maxSizeOfInstructions = sfnt_get_ushort(sfont);
+ table->maxComponentElements = sfnt_get_ushort(sfont);
+ table->maxComponentDepth = sfnt_get_ushort(sfont);
+
+ return table;
}
-char *tt_pack_hhea_table (struct tt_hhea_table *table)
+char *tt_pack_hhea_table(struct tt_hhea_table *table)
{
- int i;
- char *p, *data;
-
- p = data = NEW(TT_HHEA_TABLE_SIZE, char);
- p += sfnt_put_ulong(p, table->version);
- p += sfnt_put_short(p, table->Ascender);
- p += sfnt_put_short(p, table->Descender);
- p += sfnt_put_short(p, table->LineGap);
- p += sfnt_put_ushort(p, table->advanceWidthMax);
- p += sfnt_put_short(p, table->minLeftSideBearing);
- p += sfnt_put_short(p, table->minRightSideBearing);
- p += sfnt_put_short(p, table->xMaxExtent);
- p += sfnt_put_short(p, table->caretSlopeRise);
- p += sfnt_put_short(p, table->caretSlopeRun);
- for (i = 0; i < 5; i++) {
- p += sfnt_put_short(p, table->reserved[i]);
- }
- p += sfnt_put_short(p, table->metricDataFormat);
- p += sfnt_put_ushort(p, table->numberOfHMetrics);
-
- return data;
+ int i;
+ char *p, *data;
+
+ p = data = NEW(TT_HHEA_TABLE_SIZE, char);
+ p += sfnt_put_ulong(p, table->version);
+ p += sfnt_put_short(p, table->Ascender);
+ p += sfnt_put_short(p, table->Descender);
+ p += sfnt_put_short(p, table->LineGap);
+ p += sfnt_put_ushort(p, table->advanceWidthMax);
+ p += sfnt_put_short(p, table->minLeftSideBearing);
+ p += sfnt_put_short(p, table->minRightSideBearing);
+ p += sfnt_put_short(p, table->xMaxExtent);
+ p += sfnt_put_short(p, table->caretSlopeRise);
+ p += sfnt_put_short(p, table->caretSlopeRun);
+ for (i = 0; i < 5; i++) {
+ p += sfnt_put_short(p, table->reserved[i]);
+ }
+ p += sfnt_put_short(p, table->metricDataFormat);
+ p += sfnt_put_ushort(p, table->numberOfHMetrics);
+
+ return data;
}
-struct tt_hhea_table *
-tt_read_hhea_table (sfnt *sfont)
+struct tt_hhea_table *tt_read_hhea_table(sfnt * sfont)
{
- int i;
- struct tt_hhea_table *table = NULL;
-
- table = NEW(1, struct tt_hhea_table);
-
- sfnt_locate_table(sfont, "hhea");
- table->version = sfnt_get_ulong(sfont);
- table->Ascender = sfnt_get_short (sfont);
- table->Descender = sfnt_get_short(sfont);
- table->LineGap = sfnt_get_short(sfont);
- table->advanceWidthMax = sfnt_get_ushort(sfont);
- table->minLeftSideBearing = sfnt_get_short(sfont);
- table->minRightSideBearing = sfnt_get_short(sfont);
- table->xMaxExtent = sfnt_get_short(sfont);
- table->caretSlopeRise = sfnt_get_short(sfont);
- table->caretSlopeRun = sfnt_get_short(sfont);
- for(i = 0; i < 5; i++) {
- table->reserved[i] = sfnt_get_short(sfont);
- }
- table->metricDataFormat = sfnt_get_short(sfont);
- if (table->metricDataFormat != 0)
- TT_ERROR("unknown metricDaraFormat");
- table->numberOfHMetrics = sfnt_get_ushort(sfont);
-
- return table;
+ int i;
+ struct tt_hhea_table *table = NULL;
+
+ table = NEW(1, struct tt_hhea_table);
+
+ sfnt_locate_table(sfont, "hhea");
+ table->version = sfnt_get_ulong(sfont);
+ table->Ascender = sfnt_get_short(sfont);
+ table->Descender = sfnt_get_short(sfont);
+ table->LineGap = sfnt_get_short(sfont);
+ table->advanceWidthMax = sfnt_get_ushort(sfont);
+ table->minLeftSideBearing = sfnt_get_short(sfont);
+ table->minRightSideBearing = sfnt_get_short(sfont);
+ table->xMaxExtent = sfnt_get_short(sfont);
+ table->caretSlopeRise = sfnt_get_short(sfont);
+ table->caretSlopeRun = sfnt_get_short(sfont);
+ for (i = 0; i < 5; i++) {
+ table->reserved[i] = sfnt_get_short(sfont);
+ }
+ table->metricDataFormat = sfnt_get_short(sfont);
+ if (table->metricDataFormat != 0)
+ TT_ERROR("unknown metricDaraFormat");
+ table->numberOfHMetrics = sfnt_get_ushort(sfont);
+
+ return table;
}
/* vhea */
-char *
-tt_pack_vhea_table (struct tt_vhea_table *table)
+char *tt_pack_vhea_table(struct tt_vhea_table *table)
{
- int i;
- char *p, *data;
-
- p = data = NEW(TT_VHEA_TABLE_SIZE, char);
- p += sfnt_put_ulong(p, table->version);
- p += sfnt_put_short(p, table->vertTypoAscender);
- p += sfnt_put_short(p, table->vertTypoDescender);
- p += sfnt_put_short(p, table->vertTypoLineGap);
- p += sfnt_put_short(p, table->advanceHeightMax); /* ushort ? */
- p += sfnt_put_short(p, table->minTopSideBearing);
- p += sfnt_put_short(p, table->minBottomSideBearing);
- p += sfnt_put_short(p, table->yMaxExtent);
- p += sfnt_put_short(p, table->caretSlopeRise);
- p += sfnt_put_short(p, table->caretSlopeRun);
- p += sfnt_put_short(p, table->caretOffset);
- for(i = 0; i < 5; i++) {
- p += sfnt_put_short(p, table->reserved[i]);
- }
- p += sfnt_put_ushort(p, table->numOfLongVerMetrics);
-
- return data;
-}
+ int i;
+ char *p, *data;
+
+ p = data = NEW(TT_VHEA_TABLE_SIZE, char);
+ p += sfnt_put_ulong(p, table->version);
+ p += sfnt_put_short(p, table->vertTypoAscender);
+ p += sfnt_put_short(p, table->vertTypoDescender);
+ p += sfnt_put_short(p, table->vertTypoLineGap);
+ p += sfnt_put_short(p, table->advanceHeightMax); /* ushort ? */
+ p += sfnt_put_short(p, table->minTopSideBearing);
+ p += sfnt_put_short(p, table->minBottomSideBearing);
+ p += sfnt_put_short(p, table->yMaxExtent);
+ p += sfnt_put_short(p, table->caretSlopeRise);
+ p += sfnt_put_short(p, table->caretSlopeRun);
+ p += sfnt_put_short(p, table->caretOffset);
+ for (i = 0; i < 5; i++) {
+ p += sfnt_put_short(p, table->reserved[i]);
+ }
+ p += sfnt_put_ushort(p, table->numOfLongVerMetrics);
-struct tt_vhea_table *tt_read_vhea_table (sfnt *sfont)
-{
- int i;
- struct tt_vhea_table *table = NULL;
-
- table = NEW(1, struct tt_vhea_table);
-
- sfnt_locate_table(sfont, "vhea");
- table->version = sfnt_get_ulong(sfont);
- table->vertTypoAscender = sfnt_get_short (sfont);
- table->vertTypoDescender = sfnt_get_short(sfont);
- table->vertTypoLineGap = sfnt_get_short(sfont);
- table->advanceHeightMax = sfnt_get_short(sfont); /* ushort ? */
- table->minTopSideBearing = sfnt_get_short(sfont);
- table->minBottomSideBearing = sfnt_get_short(sfont);
- table->yMaxExtent = sfnt_get_short(sfont);
- table->caretSlopeRise = sfnt_get_short(sfont);
- table->caretSlopeRun = sfnt_get_short(sfont);
- table->caretOffset = sfnt_get_short(sfont);
- for(i=0;i<5;i++) {
- (table->reserved)[i] = sfnt_get_short(sfont);
- }
- table->numOfLongVerMetrics = sfnt_get_ushort(sfont);
-
- return table;
+ return data;
}
-
-struct tt_VORG_table *
-tt_read_VORG_table (sfnt *sfont)
+struct tt_vhea_table *tt_read_vhea_table(sfnt * sfont)
{
- struct tt_VORG_table *vorg;
- ULONG offset;
- USHORT i;
-
- offset = sfnt_find_table_pos(sfont, "VORG");
+ int i;
+ struct tt_vhea_table *table = NULL;
+
+ table = NEW(1, struct tt_vhea_table);
+
+ sfnt_locate_table(sfont, "vhea");
+ table->version = sfnt_get_ulong(sfont);
+ table->vertTypoAscender = sfnt_get_short(sfont);
+ table->vertTypoDescender = sfnt_get_short(sfont);
+ table->vertTypoLineGap = sfnt_get_short(sfont);
+ table->advanceHeightMax = sfnt_get_short(sfont); /* ushort ? */
+ table->minTopSideBearing = sfnt_get_short(sfont);
+ table->minBottomSideBearing = sfnt_get_short(sfont);
+ table->yMaxExtent = sfnt_get_short(sfont);
+ table->caretSlopeRise = sfnt_get_short(sfont);
+ table->caretSlopeRun = sfnt_get_short(sfont);
+ table->caretOffset = sfnt_get_short(sfont);
+ for (i = 0; i < 5; i++) {
+ (table->reserved)[i] = sfnt_get_short(sfont);
+ }
+ table->numOfLongVerMetrics = sfnt_get_ushort(sfont);
- if (offset > 0) {
- vorg = NEW(1, struct tt_VORG_table);
+ return table;
+}
- sfnt_locate_table(sfont, "VORG");
- if (sfnt_get_ushort(sfont) != 1 ||
- sfnt_get_ushort(sfont) != 0)
- TT_ERROR("Unsupported VORG version.");
- vorg->defaultVertOriginY = sfnt_get_short(sfont);
- vorg->numVertOriginYMetrics = sfnt_get_ushort(sfont);
- vorg->vertOriginYMetrics = NEW(vorg->numVertOriginYMetrics,
- struct tt_vertOriginYMetrics);
- /*
- * The vertOriginYMetrics array must be sorted in increasing
- * glyphIndex order.
- */
- for (i = 0;
- i < vorg->numVertOriginYMetrics; i++) {
- vorg->vertOriginYMetrics[i].glyphIndex = sfnt_get_ushort(sfont);
- vorg->vertOriginYMetrics[i].vertOriginY = sfnt_get_short(sfont);
+struct tt_VORG_table *tt_read_VORG_table(sfnt * sfont)
+{
+ struct tt_VORG_table *vorg;
+ ULONG offset;
+ USHORT i;
+
+ offset = sfnt_find_table_pos(sfont, "VORG");
+
+ if (offset > 0) {
+ vorg = NEW(1, struct tt_VORG_table);
+
+ sfnt_locate_table(sfont, "VORG");
+ if (sfnt_get_ushort(sfont) != 1 || sfnt_get_ushort(sfont) != 0)
+ TT_ERROR("Unsupported VORG version.");
+
+ vorg->defaultVertOriginY = sfnt_get_short(sfont);
+ vorg->numVertOriginYMetrics = sfnt_get_ushort(sfont);
+ vorg->vertOriginYMetrics = NEW(vorg->numVertOriginYMetrics,
+ struct tt_vertOriginYMetrics);
+ /*
+ * The vertOriginYMetrics array must be sorted in increasing
+ * glyphIndex order.
+ */
+ for (i = 0; i < vorg->numVertOriginYMetrics; i++) {
+ vorg->vertOriginYMetrics[i].glyphIndex = sfnt_get_ushort(sfont);
+ vorg->vertOriginYMetrics[i].vertOriginY = sfnt_get_short(sfont);
+ }
+ } else {
+ vorg = NULL;
}
- } else {
- vorg = NULL;
- }
- return vorg;
+ return vorg;
}
/*
@@ -313,171 +310,167 @@ tt_read_VORG_table (sfnt *sfont)
* Reading/writing hmtx and vmtx depend on other tables, maxp and hhea/vhea.
*/
-struct tt_longMetrics *
-tt_read_longMetrics (sfnt *sfont, USHORT numGlyphs, USHORT numLongMetrics)
+struct tt_longMetrics *tt_read_longMetrics(sfnt * sfont, USHORT numGlyphs,
+ USHORT numLongMetrics)
{
- struct tt_longMetrics *m;
- USHORT gid, last_adv = 0;
-
- m = NEW(numGlyphs, struct tt_longMetrics);
- for (gid = 0; gid < numGlyphs; gid++) {
- if (gid < numLongMetrics)
- last_adv = sfnt_get_ushort(sfont);
- m[gid].sideBearing = sfnt_get_short(sfont);
- m[gid].advance = last_adv;
- }
-
- return m;
+ struct tt_longMetrics *m;
+ USHORT gid, last_adv = 0;
+
+ m = NEW(numGlyphs, struct tt_longMetrics);
+ for (gid = 0; gid < numGlyphs; gid++) {
+ if (gid < numLongMetrics)
+ last_adv = sfnt_get_ushort(sfont);
+ m[gid].sideBearing = sfnt_get_short(sfont);
+ m[gid].advance = last_adv;
+ }
+
+ return m;
}
/* OS/2 table */
/* this table may not exist */
-struct tt_os2__table *
-tt_read_os2__table (sfnt *sfont)
+struct tt_os2__table *tt_read_os2__table(sfnt * sfont)
{
- struct tt_os2__table *table = NULL;
- int i;
+ struct tt_os2__table *table = NULL;
+ int i;
+
+ if (sfnt_find_table_pos(sfont, "OS/2") == 0)
+ return NULL;
+
+ sfnt_locate_table(sfont, "OS/2");
+
+ table = NEW(1, struct tt_os2__table);
+
+ table->version = sfnt_get_ushort(sfont);
+ table->xAvgCharWidth = sfnt_get_short(sfont);
+ table->usWeightClass = sfnt_get_ushort(sfont);
+ table->usWidthClass = sfnt_get_ushort(sfont);
+ table->fsType = sfnt_get_short(sfont);
+ table->ySubscriptXSize = sfnt_get_short(sfont);
+ table->ySubscriptYSize = sfnt_get_short(sfont);
+ table->ySubscriptXOffset = sfnt_get_short(sfont);
+ table->ySubscriptYOffset = sfnt_get_short(sfont);
+ table->ySuperscriptXSize = sfnt_get_short(sfont);
+ table->ySuperscriptYSize = sfnt_get_short(sfont);
+ table->ySuperscriptXOffset = sfnt_get_short(sfont);
+ table->ySuperscriptYOffset = sfnt_get_short(sfont);
+ table->yStrikeoutSize = sfnt_get_short(sfont);
+ table->yStrikeoutPosition = sfnt_get_short(sfont);
+ table->sFamilyClass = sfnt_get_short(sfont);
+ for (i = 0; i < 10; i++) {
+ table->panose[i] = sfnt_get_byte(sfont);
+ }
+ table->ulUnicodeRange1 = sfnt_get_ulong(sfont);
+ table->ulUnicodeRange2 = sfnt_get_ulong(sfont);
+ table->ulUnicodeRange3 = sfnt_get_ulong(sfont);
+ table->ulUnicodeRange4 = sfnt_get_ulong(sfont);
+ for (i = 0; i < 4; i++) {
+ table->achVendID[i] = sfnt_get_char(sfont);
+ }
+ table->fsSelection = sfnt_get_ushort(sfont);
+ table->usFirstCharIndex = sfnt_get_ushort(sfont);
+ table->usLastCharIndex = sfnt_get_ushort(sfont);
+ table->sTypoAscender = sfnt_get_short(sfont);
+ table->sTypoDescender = sfnt_get_short(sfont);
+ table->sTypoLineGap = sfnt_get_short(sfont);
+ table->usWinAscent = sfnt_get_ushort(sfont);
+ table->usWinDescent = sfnt_get_ushort(sfont);
+ table->ulCodePageRange1 = sfnt_get_ulong(sfont);
+ table->ulCodePageRange2 = sfnt_get_ulong(sfont);
+ if (table->version == 0x0002) {
+ table->sxHeight = sfnt_get_short(sfont);
+ table->sCapHeight = sfnt_get_short(sfont);
+ table->usDefaultChar = sfnt_get_ushort(sfont);
+ table->usBreakChar = sfnt_get_ushort(sfont);
+ table->usMaxContext = sfnt_get_ushort(sfont);
+ }
- if (sfnt_find_table_pos(sfont, "OS/2") == 0)
- return NULL;
-
- sfnt_locate_table(sfont, "OS/2");
-
- table = NEW(1, struct tt_os2__table);
-
- table->version = sfnt_get_ushort(sfont);
- table->xAvgCharWidth = sfnt_get_short(sfont);
- table->usWeightClass = sfnt_get_ushort(sfont);
- table->usWidthClass = sfnt_get_ushort(sfont);
- table->fsType = sfnt_get_short(sfont);
- table->ySubscriptXSize = sfnt_get_short(sfont);
- table->ySubscriptYSize = sfnt_get_short(sfont);
- table->ySubscriptXOffset = sfnt_get_short(sfont);
- table->ySubscriptYOffset = sfnt_get_short(sfont);
- table->ySuperscriptXSize = sfnt_get_short(sfont);
- table->ySuperscriptYSize = sfnt_get_short(sfont);
- table->ySuperscriptXOffset = sfnt_get_short(sfont);
- table->ySuperscriptYOffset = sfnt_get_short(sfont);
- table->yStrikeoutSize = sfnt_get_short(sfont);
- table->yStrikeoutPosition = sfnt_get_short(sfont);
- table->sFamilyClass = sfnt_get_short(sfont);
- for (i = 0; i < 10; i++) {
- table->panose[i] = sfnt_get_byte(sfont);
- }
- table->ulUnicodeRange1 = sfnt_get_ulong(sfont);
- table->ulUnicodeRange2 = sfnt_get_ulong(sfont);
- table->ulUnicodeRange3 = sfnt_get_ulong(sfont);
- table->ulUnicodeRange4 = sfnt_get_ulong(sfont);
- for (i = 0; i < 4; i++) {
- table->achVendID[i] = sfnt_get_char(sfont);
- }
- table->fsSelection = sfnt_get_ushort(sfont);
- table->usFirstCharIndex = sfnt_get_ushort(sfont);
- table->usLastCharIndex = sfnt_get_ushort(sfont);
- table->sTypoAscender = sfnt_get_short(sfont);
- table->sTypoDescender = sfnt_get_short(sfont);
- table->sTypoLineGap = sfnt_get_short(sfont);
- table->usWinAscent = sfnt_get_ushort(sfont);
- table->usWinDescent = sfnt_get_ushort(sfont);
- table->ulCodePageRange1 = sfnt_get_ulong(sfont);
- table->ulCodePageRange2 = sfnt_get_ulong(sfont);
- if (table->version == 0x0002) {
- table->sxHeight = sfnt_get_short(sfont);
- table->sCapHeight = sfnt_get_short(sfont);
- table->usDefaultChar = sfnt_get_ushort(sfont);
- table->usBreakChar = sfnt_get_ushort(sfont);
- table->usMaxContext = sfnt_get_ushort(sfont);
- }
-
- return table;
+ return table;
}
USHORT
-tt_get_name (sfnt *sfont, char *dest, USHORT destlen,
- USHORT plat_id, USHORT enco_id,
- USHORT lang_id, USHORT name_id)
+tt_get_name(sfnt * sfont, char *dest, USHORT destlen,
+ USHORT plat_id, USHORT enco_id, USHORT lang_id, USHORT name_id)
{
- USHORT length = 0;
- USHORT num_names, string_offset;
- ULONG name_offset;
- int i;
-
- name_offset = sfnt_locate_table (sfont, "name");
-
- if (sfnt_get_ushort(sfont))
- TT_ERROR ("Expecting zero");
-
- num_names = sfnt_get_ushort(sfont);
- string_offset = sfnt_get_ushort(sfont);
- for (i=0;i<num_names;i++) {
- USHORT p_id, e_id, n_id, l_id;
- USHORT offset;
-
- p_id = sfnt_get_ushort(sfont);
- e_id = sfnt_get_ushort(sfont);
- l_id = sfnt_get_ushort(sfont);
- n_id = sfnt_get_ushort(sfont);
- length = sfnt_get_ushort(sfont);
- offset = sfnt_get_ushort(sfont);
- /* language ID value 0xffffu for `accept any language ID' */
- if ((p_id == plat_id) && (e_id == enco_id) &&
- (lang_id == 0xffffu || l_id == lang_id) && (n_id == name_id)) {
- if (length > destlen - 1) {
- fprintf(stderr, "\n** Notice: Name string too long. Truncating **\n");
- length = destlen - 1;
- }
- sfnt_seek_set (sfont, name_offset+string_offset+offset);
- sfnt_read((unsigned char*)dest, length, sfont);
- dest[length] = '\0';
- break;
+ USHORT length = 0;
+ USHORT num_names, string_offset;
+ ULONG name_offset;
+ int i;
+
+ name_offset = sfnt_locate_table(sfont, "name");
+
+ if (sfnt_get_ushort(sfont))
+ TT_ERROR("Expecting zero");
+
+ num_names = sfnt_get_ushort(sfont);
+ string_offset = sfnt_get_ushort(sfont);
+ for (i = 0; i < num_names; i++) {
+ USHORT p_id, e_id, n_id, l_id;
+ USHORT offset;
+
+ p_id = sfnt_get_ushort(sfont);
+ e_id = sfnt_get_ushort(sfont);
+ l_id = sfnt_get_ushort(sfont);
+ n_id = sfnt_get_ushort(sfont);
+ length = sfnt_get_ushort(sfont);
+ offset = sfnt_get_ushort(sfont);
+ /* language ID value 0xffffu for `accept any language ID' */
+ if ((p_id == plat_id) && (e_id == enco_id) &&
+ (lang_id == 0xffffu || l_id == lang_id) && (n_id == name_id)) {
+ if (length > destlen - 1) {
+ fprintf(stderr,
+ "\n** Notice: Name string too long. Truncating **\n");
+ length = destlen - 1;
+ }
+ sfnt_seek_set(sfont, name_offset + string_offset + offset);
+ sfnt_read((unsigned char *) dest, length, sfont);
+ dest[length] = '\0';
+ break;
+ }
+ }
+ if (i == num_names) {
+ length = 0;
}
- }
- if (i == num_names) {
- length = 0;
- }
- return length;
+ return length;
}
-USHORT
-tt_get_ps_fontname (sfnt *sfont, char *dest, USHORT destlen)
+USHORT tt_get_ps_fontname(sfnt * sfont, char *dest, USHORT destlen)
{
- USHORT namelen = 0;
+ USHORT namelen = 0;
#ifdef XETEX
- const char* name = FT_Get_Postscript_Name(sfont->ft_face);
+ const char *name = FT_Get_Postscript_Name(sfont->ft_face);
namelen = strlen(name);
if (namelen > destlen - 1) {
- strncpy(dest, name, destlen - 1);
- dest[destlen] = 0;
- }
- else
- strcpy(dest, name);
+ strncpy(dest, name, destlen - 1);
+ dest[destlen] = 0;
+ } else
+ strcpy(dest, name);
#else
- /* First try Mac-Roman PS name and then Win-Unicode PS name */
- if ((namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0, 6)) != 0 ||
- (namelen = tt_get_name(sfont, dest, destlen, 3, 1, 0x409u, 6)) != 0 ||
- (namelen = tt_get_name(sfont, dest, destlen, 3, 5, 0x412u, 6)) != 0)
- return namelen;
+ /* First try Mac-Roman PS name and then Win-Unicode PS name */
+ if ((namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0, 6)) != 0 ||
+ (namelen = tt_get_name(sfont, dest, destlen, 3, 1, 0x409u, 6)) != 0 ||
+ (namelen = tt_get_name(sfont, dest, destlen, 3, 5, 0x412u, 6)) != 0)
+ return namelen;
- fprintf(stderr, "\n** Warning: No valid PostScript name available **\n");
- /*
- Wrokaround for some bad TTfonts:
- Language ID value 0xffffu for `accept any language ID'
- */
- if ((namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0xffffu, 6)) == 0) {
+ fprintf(stderr, "\n** Warning: No valid PostScript name available **\n");
/*
- Finally falling back to Mac Roman name field.
- Warning: Some bad Japanese TTfonts using SJIS encoded string in the
- Mac Roman name field.
- */
- namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0, 1);
- }
-
+ Wrokaround for some bad TTfonts:
+ Language ID value 0xffffu for `accept any language ID'
+ */
+ if ((namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0xffffu, 6)) == 0) {
+ /*
+ Finally falling back to Mac Roman name field.
+ Warning: Some bad Japanese TTfonts using SJIS encoded string in the
+ Mac Roman name field.
+ */
+ namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0, 1);
+ }
#endif
- return namelen;
+ return namelen;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/tt_table.h b/Build/source/texk/web2c/luatexdir/font/tt_table.h
index ffb2c5b8f45..5dcd17d5b66 100644
--- a/Build/source/texk/web2c/luatexdir/font/tt_table.h
+++ b/Build/source/texk/web2c/luatexdir/font/tt_table.h
@@ -1,193 +1,189 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/tt_table.h,v 1.6 2004/09/11 14:50:29 hirata Exp $
+/* tt_table.h
- This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+ Copyright 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
- the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: tt_table.h 1223 2008-05-02 13:39:55Z oneiros $ */
#ifndef _TT_TABLE_H_
-#define _TT_TABLE_H_
-
-#include "sfnt.h"
-
-#define TT_HEAD_TABLE_SIZE 54UL
-#define TT_MAXP_TABLE_SIZE 32UL
-#define TT_HHEA_TABLE_SIZE 36UL
-#define TT_VHEA_TABLE_SIZE 36UL
-
-struct tt_head_table
-{
- Fixed version;
- Fixed fontRevision;
- ULONG checkSumAdjustment;
- ULONG magicNumber;
- USHORT flags;
- USHORT unitsPerEm;
- BYTE created[8];
- BYTE modified[8];
- FWord xMin, yMin, xMax, yMax;
- USHORT macStyle;
- USHORT lowestRecPPEM;
- SHORT fontDirectionHint;
- SHORT indexToLocFormat;
- SHORT glyphDataFormat;
+# define _TT_TABLE_H_
+
+# include "sfnt.h"
+
+# define TT_HEAD_TABLE_SIZE 54UL
+# define TT_MAXP_TABLE_SIZE 32UL
+# define TT_HHEA_TABLE_SIZE 36UL
+# define TT_VHEA_TABLE_SIZE 36UL
+
+struct tt_head_table {
+ Fixed version;
+ Fixed fontRevision;
+ ULONG checkSumAdjustment;
+ ULONG magicNumber;
+ USHORT flags;
+ USHORT unitsPerEm;
+ BYTE created[8];
+ BYTE modified[8];
+ FWord xMin, yMin, xMax, yMax;
+ USHORT macStyle;
+ USHORT lowestRecPPEM;
+ SHORT fontDirectionHint;
+ SHORT indexToLocFormat;
+ SHORT glyphDataFormat;
};
-struct tt_hhea_table
-{
- Fixed version;
- FWord Ascender;
- FWord Descender;
- FWord LineGap;
- uFWord advanceWidthMax;
- FWord minLeftSideBearing;
- FWord minRightSideBearing;
- FWord xMaxExtent;
- SHORT caretSlopeRise;
- SHORT caretSlopeRun;
- SHORT reserved[5]; /* set to 0 */
- SHORT metricDataFormat;
- USHORT numberOfHMetrics;
+struct tt_hhea_table {
+ Fixed version;
+ FWord Ascender;
+ FWord Descender;
+ FWord LineGap;
+ uFWord advanceWidthMax;
+ FWord minLeftSideBearing;
+ FWord minRightSideBearing;
+ FWord xMaxExtent;
+ SHORT caretSlopeRise;
+ SHORT caretSlopeRun;
+ SHORT reserved[5]; /* set to 0 */
+ SHORT metricDataFormat;
+ USHORT numberOfHMetrics;
};
-struct tt_vhea_table
-{
- Fixed version;
- SHORT vertTypoAscender; /* v.1.1 name */
- SHORT vertTypoDescender; /* v.1.1 name */
- SHORT vertTypoLineGap; /* v.1.1 name */
- SHORT advanceHeightMax;
- SHORT minTopSideBearing;
- SHORT minBottomSideBearing;
- SHORT yMaxExtent;
- SHORT caretSlopeRise;
- SHORT caretSlopeRun;
- SHORT caretOffset;
- SHORT reserved[5]; /* set to 0 */
- USHORT numOfLongVerMetrics;
+struct tt_vhea_table {
+ Fixed version;
+ SHORT vertTypoAscender; /* v.1.1 name */
+ SHORT vertTypoDescender; /* v.1.1 name */
+ SHORT vertTypoLineGap; /* v.1.1 name */
+ SHORT advanceHeightMax;
+ SHORT minTopSideBearing;
+ SHORT minBottomSideBearing;
+ SHORT yMaxExtent;
+ SHORT caretSlopeRise;
+ SHORT caretSlopeRun;
+ SHORT caretOffset;
+ SHORT reserved[5]; /* set to 0 */
+ USHORT numOfLongVerMetrics;
};
-struct tt_maxp_table
-{
- Fixed version;
- USHORT numGlyphs;
- USHORT maxPoints;
- USHORT maxContours;
- USHORT maxComponentPoints;
- USHORT maxComponentContours;
- USHORT maxZones;
- USHORT maxTwilightPoints;
- USHORT maxStorage;
- USHORT maxFunctionDefs;
- USHORT maxInstructionDefs;
- USHORT maxStackElements;
- USHORT maxSizeOfInstructions;
- USHORT maxComponentElements;
- USHORT maxComponentDepth;
+struct tt_maxp_table {
+ Fixed version;
+ USHORT numGlyphs;
+ USHORT maxPoints;
+ USHORT maxContours;
+ USHORT maxComponentPoints;
+ USHORT maxComponentContours;
+ USHORT maxZones;
+ USHORT maxTwilightPoints;
+ USHORT maxStorage;
+ USHORT maxFunctionDefs;
+ USHORT maxInstructionDefs;
+ USHORT maxStackElements;
+ USHORT maxSizeOfInstructions;
+ USHORT maxComponentElements;
+ USHORT maxComponentDepth;
};
-struct tt_os2__table
-{
- USHORT version; /* 0x0001 or 0x0002 */
- SHORT xAvgCharWidth;
- USHORT usWeightClass;
- USHORT usWidthClass;
- SHORT fsType; /* if (faType & 0x08) editable_embedding */
- SHORT ySubscriptXSize;
- SHORT ySubscriptYSize;
- SHORT ySubscriptXOffset;
- SHORT ySubscriptYOffset;
- SHORT ySuperscriptXSize;
- SHORT ySuperscriptYSize;
- SHORT ySuperscriptXOffset;
- SHORT ySuperscriptYOffset;
- SHORT yStrikeoutSize;
- SHORT yStrikeoutPosition;
- SHORT sFamilyClass;
- BYTE panose[10];
- ULONG ulUnicodeRange1;
- ULONG ulUnicodeRange2;
- ULONG ulUnicodeRange3;
- ULONG ulUnicodeRange4;
- ICHAR achVendID[4];
- USHORT fsSelection;
- USHORT usFirstCharIndex;
- USHORT usLastCharIndex;
- SHORT sTypoAscender; /* TTF spec. from MS is wrong */
- SHORT sTypoDescender; /* TTF spec. from MS is wrong */
- SHORT sTypoLineGap; /* TTF spec. from MS is wrong */
- USHORT usWinAscent;
- USHORT usWinDescent;
- ULONG ulCodePageRange1;
- ULONG ulCodePageRange2;
- /* version 0x0002 */
- SHORT sxHeight;
- SHORT sCapHeight;
- USHORT usDefaultChar;
- USHORT usBreakChar;
- USHORT usMaxContext;
+struct tt_os2__table {
+ USHORT version; /* 0x0001 or 0x0002 */
+ SHORT xAvgCharWidth;
+ USHORT usWeightClass;
+ USHORT usWidthClass;
+ SHORT fsType; /* if (faType & 0x08) editable_embedding */
+ SHORT ySubscriptXSize;
+ SHORT ySubscriptYSize;
+ SHORT ySubscriptXOffset;
+ SHORT ySubscriptYOffset;
+ SHORT ySuperscriptXSize;
+ SHORT ySuperscriptYSize;
+ SHORT ySuperscriptXOffset;
+ SHORT ySuperscriptYOffset;
+ SHORT yStrikeoutSize;
+ SHORT yStrikeoutPosition;
+ SHORT sFamilyClass;
+ BYTE panose[10];
+ ULONG ulUnicodeRange1;
+ ULONG ulUnicodeRange2;
+ ULONG ulUnicodeRange3;
+ ULONG ulUnicodeRange4;
+ ICHAR achVendID[4];
+ USHORT fsSelection;
+ USHORT usFirstCharIndex;
+ USHORT usLastCharIndex;
+ SHORT sTypoAscender; /* TTF spec. from MS is wrong */
+ SHORT sTypoDescender; /* TTF spec. from MS is wrong */
+ SHORT sTypoLineGap; /* TTF spec. from MS is wrong */
+ USHORT usWinAscent;
+ USHORT usWinDescent;
+ ULONG ulCodePageRange1;
+ ULONG ulCodePageRange2;
+ /* version 0x0002 */
+ SHORT sxHeight;
+ SHORT sCapHeight;
+ USHORT usDefaultChar;
+ USHORT usBreakChar;
+ USHORT usMaxContext;
};
struct tt_vertOriginYMetrics {
- USHORT glyphIndex;
- SHORT vertOriginY;
+ USHORT glyphIndex;
+ SHORT vertOriginY;
};
struct tt_VORG_table {
- SHORT defaultVertOriginY;
- USHORT numVertOriginYMetrics;
- struct tt_vertOriginYMetrics *vertOriginYMetrics;
+ SHORT defaultVertOriginY;
+ USHORT numVertOriginYMetrics;
+ struct tt_vertOriginYMetrics *vertOriginYMetrics;
};
/* hmtx and vmtx */
-struct tt_longMetrics
-{
- USHORT advance;
- SHORT sideBearing;
+struct tt_longMetrics {
+ USHORT advance;
+ SHORT sideBearing;
};
/* head, hhea, maxp */
-extern char *tt_pack_head_table (struct tt_head_table *table);
-extern struct tt_head_table *tt_read_head_table (sfnt *sfont);
-extern char *tt_pack_hhea_table (struct tt_hhea_table *table);
-extern struct tt_hhea_table *tt_read_hhea_table (sfnt *sfont);
-extern char *tt_pack_maxp_table (struct tt_maxp_table *table);
-extern struct tt_maxp_table *tt_read_maxp_table (sfnt *sfont);
+extern char *tt_pack_head_table(struct tt_head_table *table);
+extern struct tt_head_table *tt_read_head_table(sfnt * sfont);
+extern char *tt_pack_hhea_table(struct tt_hhea_table *table);
+extern struct tt_hhea_table *tt_read_hhea_table(sfnt * sfont);
+extern char *tt_pack_maxp_table(struct tt_maxp_table *table);
+extern struct tt_maxp_table *tt_read_maxp_table(sfnt * sfont);
/* vhea */
-extern char *tt_pack_vhea_table (struct tt_vhea_table *table);
-extern struct tt_vhea_table *tt_read_vhea_table (sfnt *sfont);
+extern char *tt_pack_vhea_table(struct tt_vhea_table *table);
+extern struct tt_vhea_table *tt_read_vhea_table(sfnt * sfont);
/* VORG */
-extern struct tt_VORG_table *tt_read_VORG_table (sfnt *sfont);
+extern struct tt_VORG_table *tt_read_VORG_table(sfnt * sfont);
/* hmtx and vmtx */
-extern struct tt_longMetrics *tt_read_longMetrics (sfnt *sfont,
- USHORT numGlyphs, USHORT numLongMetrics);
+extern struct tt_longMetrics *tt_read_longMetrics(sfnt * sfont,
+ USHORT numGlyphs,
+ USHORT numLongMetrics);
/* OS/2 table */
-extern struct tt_os2__table *tt_read_os2__table (sfnt *sfont);
+extern struct tt_os2__table *tt_read_os2__table(sfnt * sfont);
/* name table */
-extern USHORT tt_get_name (sfnt *sfont, char *dest, USHORT destlen,
- USHORT plat_id, USHORT enco_id,
- USHORT lang_id, USHORT name_id);
-extern USHORT tt_get_ps_fontname (sfnt *sfont, char *dest, USHORT destlen);
+extern USHORT tt_get_name(sfnt * sfont, char *dest, USHORT destlen,
+ USHORT plat_id, USHORT enco_id,
+ USHORT lang_id, USHORT name_id);
+extern USHORT tt_get_ps_fontname(sfnt * sfont, char *dest, USHORT destlen);
-#endif /* _TT_TABLE_H_ */
+#endif /* _TT_TABLE_H_ */
diff --git a/Build/source/texk/web2c/luatexdir/font/vfovf.c b/Build/source/texk/web2c/luatexdir/font/vfovf.c
index 61a0b76aaa4..fefcd16b756 100644
--- a/Build/source/texk/web2c/luatexdir/font/vfovf.c
+++ b/Build/source/texk/web2c/luatexdir/font/vfovf.c
@@ -1,113 +1,114 @@
-/*
-Copyright (c) 1996-2006 Taco Hoekwater <taco@luatex.org>
-
-This file is part of LuaTeX.
+/* vfovf.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-LuaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-LuaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with LuaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: vfovf.c 1169 2008-04-15 14:57:56Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
-
#include "luatex-api.h"
+#include "luatexfont.h"
+
+static const char _svn_version[] =
+ "$Id: vfovf.c 2057 2009-03-19 15:45:47Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/vfovf.c $";
/* this is a hack! */
#define font_max 5000
-#define set_char_0 0 /* typeset character 0 and move right */
-#define set1 128 /* typeset a character and move right */
-#define set2 129 /* typeset a character and move right */
-#define set3 130 /* typeset a character and move right */
-#define set4 131 /* typeset a character and move right */
-#define set_rule 132 /* typeset a rule and move right */
-#define put1 133 /* typeset a character without moving */
-#define put2 134 /* typeset a character without moving */
-#define put3 135 /* typeset a character without moving */
-#define put4 136 /* typeset a character without moving */
-#define put_rule 137 /* typeset a rule */
-#define nop 138 /* no operation */
-#define bop 139 /* beginning of page */
-#define eop 140 /* ending of page */
-#define push 141 /* save the current positions */
-#define pop 142 /* restore previous positions */
-#define right1 143 /* move right */
-#define right2 144 /* move right */
-#define right3 145 /* move right */
-#define right4 146 /* move right, 4 bytes */
-#define w0 147 /* move right by |w| */
-#define w1 148 /* move right and set |w| */
-#define w2 149 /* move right and set |w| */
-#define w3 150 /* move right and set |w| */
-#define w4 151 /* move right and set |w| */
-#define x0 152 /* move right by |x| */
-#define x1 153 /* move right and set |x| */
-#define x2 154 /* move right and set |x| */
-#define x3 155 /* move right and set |x| */
-#define x4 156 /* move right and set |x| */
-#define down1 157 /* move down */
-#define down2 158 /* move down */
-#define down3 159 /* move down */
-#define down4 160 /* move down, 4 bytes */
-#define y0 161 /* move down by |y| */
-#define y1 162 /* move down and set |y| */
-#define y2 163 /* move down and set |y| */
-#define y3 164 /* move down and set |y| */
-#define y4 165 /* move down and set |y| */
-#define z0 166 /* move down by |z| */
-#define z1 167 /* move down and set |z| */
-#define z2 168 /* move down and set |z| */
-#define z3 169 /* move down and set |z| */
-#define z4 170 /* move down and set |z| */
-#define fnt_num_0 171 /* set current font to 0 */
-#define fnt1 235 /* set current font */
-#define fnt2 236 /* set current font */
-#define fnt3 237 /* set current font */
-#define fnt4 238 /* set current font */
-#define xxx1 239 /* extension to DVI primitives */
-#define xxx2 240 /* extension to DVI primitives */
-#define xxx3 241 /* extension to DVI primitives */
-#define xxx4 242 /* potentially long extension to DVI primitives */
-#define fnt_def1 243 /* define the meaning of a font number */
-#define pre 247 /* preamble */
-#define post 248 /* postamble beginning */
-#define post_post 249 /* postamble ending */
-#define yyy1 250 /* PDF literal text */
-#define yyy2 251 /* PDF literal text */
-#define yyy3 252 /* PDF literal text */
-#define yyy4 253 /* PDF literal text */
+#define set_char_0 0 /* typeset character 0 and move right */
+#define set1 128 /* typeset a character and move right */
+#define set2 129 /* typeset a character and move right */
+#define set3 130 /* typeset a character and move right */
+#define set4 131 /* typeset a character and move right */
+#define set_rule 132 /* typeset a rule and move right */
+#define put1 133 /* typeset a character without moving */
+#define put2 134 /* typeset a character without moving */
+#define put3 135 /* typeset a character without moving */
+#define put4 136 /* typeset a character without moving */
+#define put_rule 137 /* typeset a rule */
+#define nop 138 /* no operation */
+#define bop 139 /* beginning of page */
+#define eop 140 /* ending of page */
+#define push 141 /* save the current positions */
+#define pop 142 /* restore previous positions */
+#define right1 143 /* move right */
+#define right2 144 /* move right */
+#define right3 145 /* move right */
+#define right4 146 /* move right, 4 bytes */
+#define w0 147 /* move right by |w| */
+#define w1 148 /* move right and set |w| */
+#define w2 149 /* move right and set |w| */
+#define w3 150 /* move right and set |w| */
+#define w4 151 /* move right and set |w| */
+#define x0 152 /* move right by |x| */
+#define x1 153 /* move right and set |x| */
+#define x2 154 /* move right and set |x| */
+#define x3 155 /* move right and set |x| */
+#define x4 156 /* move right and set |x| */
+#define down1 157 /* move down */
+#define down2 158 /* move down */
+#define down3 159 /* move down */
+#define down4 160 /* move down, 4 bytes */
+#define y0 161 /* move down by |y| */
+#define y1 162 /* move down and set |y| */
+#define y2 163 /* move down and set |y| */
+#define y3 164 /* move down and set |y| */
+#define y4 165 /* move down and set |y| */
+#define z0 166 /* move down by |z| */
+#define z1 167 /* move down and set |z| */
+#define z2 168 /* move down and set |z| */
+#define z3 169 /* move down and set |z| */
+#define z4 170 /* move down and set |z| */
+#define fnt_num_0 171 /* set current font to 0 */
+#define fnt1 235 /* set current font */
+#define fnt2 236 /* set current font */
+#define fnt3 237 /* set current font */
+#define fnt4 238 /* set current font */
+#define xxx1 239 /* extension to DVI primitives */
+#define xxx2 240 /* extension to DVI primitives */
+#define xxx3 241 /* extension to DVI primitives */
+#define xxx4 242 /* potentially long extension to DVI primitives */
+#define fnt_def1 243 /* define the meaning of a font number */
+#define pre 247 /* preamble */
+#define post 248 /* postamble beginning */
+#define post_post 249 /* postamble ending */
+#define yyy1 250 /* PDF literal text */
+#define yyy2 251 /* PDF literal text */
+#define yyy3 252 /* PDF literal text */
+#define yyy4 253 /* PDF literal text */
#define null_font 0
-#define long_char 242 /* \.{VF} command for general character packet */
-#define vf_id 202 /* identifies \.{VF} files */
+#define long_char 242 /* \.{VF} command for general character packet */
+#define vf_id 202 /* identifies \.{VF} files */
/* go out \.{VF} processing with an error message */
-#define bad_vf(a) { xfree(vf_buffer); print_nlp(); \
- print_string("Error in processing VF font ("); \
- print_string(font_name(f)); \
- print_string(".vf): "); \
- print_string(a); \
- print_string(", virtual font will be ignored"); \
- print_ln(); return; }
-
-#define lua_bad_vf(a) { xfree(vf_buffer); \
- lua_settop(L,s_top); \
- lua_pushnil(L); \
- lua_pushstring(L,a); \
- return 2; }
+#define bad_vf(a) { xfree(vf_buffer); print_nlp(); \
+ print_string("Error in processing VF font ("); \
+ print_string(font_name(f)); \
+ print_string(".vf): "); \
+ print_string(a); \
+ print_string(", virtual font will be ignored"); \
+ print_ln(); return; }
+
+#define lua_bad_vf(a) { xfree(vf_buffer); \
+ lua_settop(L,s_top); \
+ lua_pushnil(L); \
+ lua_pushstring(L,a); \
+ return 2; }
#define tmp_b0 tmp_w.qqqq.b0
#define tmp_b1 tmp_w.qqqq.b1
@@ -115,9 +116,9 @@ $Id: vfovf.c 1169 2008-04-15 14:57:56Z oneiros $
#define tmp_b3 tmp_w.qqqq.b3
#define tmp_int tmp_w.cint
-#define vf_stack_size 100 /* \.{DVI} files shouldn't |push| beyond this depth */
+#define vf_stack_size 100 /* \.{DVI} files shouldn't |push| beyond this depth */
-typedef unsigned char vf_stack_index ; /* an index into the stack */
+typedef unsigned char vf_stack_index; /* an index into the stack */
typedef struct vf_stack_record {
scaled stack_w, stack_x, stack_y, stack_z;
@@ -127,179 +128,201 @@ boolean auto_expand_vf(internal_font_number f); /* forward */
/* get a byte from\.{VF} file */
-#define vf_byte(a) { real_eight_bits vf_tmp_b; \
- if (vf_cur>=vf_size) { \
- pdftex_fail("unexpected eof on virtual font"); \
- } \
+#define vf_byte(a) { real_eight_bits vf_tmp_b; \
+ if (vf_cur>=vf_size) { \
+ pdftex_fail("unexpected eof on virtual font"); \
+ } \
vf_tmp_b = vf_buffer[vf_cur++] ; a = vf_tmp_b; }
-#define vf_replace_z() { \
- vf_alpha=16; \
- while (vf_z>=040000000) { \
- vf_z= vf_z / 2; \
- vf_alpha += vf_alpha; \
- } \
- vf_beta=256 / vf_alpha; \
+#define vf_replace_z() { \
+ vf_alpha=16; \
+ while (vf_z>=040000000) { \
+ vf_z= vf_z / 2; \
+ vf_alpha += vf_alpha; \
+ } \
+ vf_beta=256 / vf_alpha; \
vf_alpha=vf_alpha*vf_z; }
/* read |k| bytes as an integer from \.{VF} file */
-#define vf_read(k,l) { integer itmp = 0, dtmp = k, jtmp = 0; \
- while (dtmp > 0) { \
- vf_byte(jtmp); \
- if ((dtmp==k) && jtmp>127) \
- jtmp = jtmp - 256; \
- itmp = itmp*256 + jtmp; \
- decr(dtmp); \
- } \
+#define vf_read(k,l) { integer itmp = 0, dtmp = k, jtmp = 0; \
+ while (dtmp > 0) { \
+ vf_byte(jtmp); \
+ if ((dtmp==(integer)k) && jtmp>127) \
+ jtmp = jtmp - 256; \
+ itmp = itmp*256 + jtmp; \
+ decr(dtmp); \
+ } \
l = itmp; }
-#define vf_read_u(k,l) { unsigned int dtmp=k, itmp = 0, jtmp = 0; \
- while (dtmp-- > 0) { \
- vf_byte(jtmp); \
- itmp = itmp*256 + jtmp; \
- } \
+#define vf_read_u(k,l) { unsigned int dtmp=k, itmp = 0, jtmp = 0; \
+ while (dtmp-- > 0) { \
+ vf_byte(jtmp); \
+ itmp = itmp*256 + jtmp; \
+ } \
l = itmp; }
-void
-pdf_check_vf_cur_val (void) {
- internal_font_number f;
- f = cur_val;
- if (font_type(f) == virtual_font_type)
- pdf_error(maketexstring("font"), maketexstring("command cannot be used with virtual font"));
+void pdf_check_vf_cur_val(void)
+{
+ internal_font_number f;
+ f = cur_val;
+ if (font_type(f) == virtual_font_type)
+ pdf_error(maketexstring("font"),
+ maketexstring("command cannot be used with virtual font"));
}
static void
-vf_local_font_warning(internal_font_number f, internal_font_number k, char *s, integer a, integer b) {
- print_nlp();
- print_string(s);
- print_string(" in local font ");
- print_string(font_name(k));
- print_string(" (");
- print_int(b);
- print_string(" != ");
- print_int(a);
- print_string(") in virtual font ");
- print_string(font_name(f));
- print_string(".vf ignored.");
+vf_local_font_warning(internal_font_number f, internal_font_number k, char *s,
+ integer a, integer b)
+{
+ print_nlp();
+ print_string(s);
+ print_string(" in local font ");
+ print_string(font_name(k));
+ print_string(" (");
+ print_int(b);
+ print_string(" != ");
+ print_int(a);
+ print_string(") in virtual font ");
+ print_string(font_name(f));
+ print_string(".vf ignored.");
}
/* process a local font in \.{VF} file */
-internal_font_number
-vf_def_font(internal_font_number f,unsigned char *vf_buffer, integer *vf_cr) {
+internal_font_number
+vf_def_font(internal_font_number f, unsigned char *vf_buffer, integer * vf_cr)
+{
internal_font_number k;
str_number s;
- scaled ds,fs;
+ scaled ds, fs;
four_quarters cs;
- memory_word tmp_w; /* accumulator */
+ memory_word tmp_w; /* accumulator */
integer junk;
unsigned long checksum;
- cs.b0 = vf_buffer[(*vf_cr)];
- cs.b1 = vf_buffer[(*vf_cr)+1];
- cs.b2 = vf_buffer[(*vf_cr)+2];
- cs.b3 = vf_buffer[(*vf_cr)+3]; (*vf_cr)+=4;
- checksum = cs.b0*256*256*256 + cs.b1*256*256 + cs.b2*256 + cs.b3;
- k = vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- if (k>127) k-=256;
- k = k*256+ vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- k = k*256+ vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- k = k*256+ vf_buffer[(*vf_cr)] ; (*vf_cr)++;
+ cs.b0 = vf_buffer[(*vf_cr)];
+ cs.b1 = vf_buffer[(*vf_cr) + 1];
+ cs.b2 = vf_buffer[(*vf_cr) + 2];
+ cs.b3 = vf_buffer[(*vf_cr) + 3];
+ (*vf_cr) += 4;
+ checksum =
+ cs.b0 * 256 * 256 * 256 + cs.b1 * 256 * 256 + cs.b2 * 256 + cs.b3;
+ k = vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ if (k > 127)
+ k -= 256;
+ k = k * 256 + vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ k = k * 256 + vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ k = k * 256 + vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
fs = sqxfw(k, font_size(f));
- k = vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- if (k>127) k-=256;
- k = k*256+ vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- k = k*256+ vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- k = k*256+ vf_buffer[(*vf_cr)] ; (*vf_cr)++;
+ k = vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ if (k > 127)
+ k -= 256;
+ k = k * 256 + vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ k = k * 256 + vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ k = k * 256 + vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
ds = k / 16;
- tmp_b0 = vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- tmp_b1 = vf_buffer[(*vf_cr)] ; (*vf_cr)++;
+ tmp_b0 = vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ tmp_b1 = vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
while (tmp_b0 > 0) {
- tmp_b0--;
- (*vf_cr)++; /* skip the font path */
+ tmp_b0--;
+ (*vf_cr)++; /* skip the font path */
}
string_room(tmp_b1);
while (tmp_b1 > 0) {
- tmp_b1--;
- junk = vf_buffer[(*vf_cr)] ; (*vf_cr)++;
- append_pool_char(junk);
+ tmp_b1--;
+ junk = vf_buffer[(*vf_cr)];
+ (*vf_cr)++;
+ append_pool_char(junk);
}
s = make_string();
k = tfm_lookup(s, fs);
- if (k == null_font)
- k = read_font_info(get_nullcs(), s, get_nullstr(), fs, -1);
+ if (k == null_font)
+ k = read_font_info(get_nullcs(), s, fs, -1);
if (k != null_font) {
- if (checksum!=0 && font_checksum(k)!=0 && checksum!= font_checksum(k))
- vf_local_font_warning(f, k, "checksum mismatch",checksum,font_checksum(k));
- if (ds != font_dsize(k))
- vf_local_font_warning(f, k, "design size mismatch",ds,font_dsize(k));
+ if (checksum != 0 && font_checksum(k) != 0
+ && checksum != font_checksum(k))
+ vf_local_font_warning(f, k, "checksum mismatch", checksum,
+ font_checksum(k));
+ if (ds != font_dsize(k))
+ vf_local_font_warning(f, k, "design size mismatch", ds,
+ font_dsize(k));
}
if (pdf_font_expand_ratio(f) != 0)
- set_expand_params(k, pdf_font_auto_expand(f),
- pdf_font_expand_ratio(pdf_font_stretch(f)),
- -pdf_font_expand_ratio(pdf_font_shrink(f)),
- pdf_font_step(f), pdf_font_expand_ratio(f));
+ set_expand_params(k, pdf_font_auto_expand(f),
+ pdf_font_expand_ratio(pdf_font_stretch(f)),
+ -pdf_font_expand_ratio(pdf_font_shrink(f)),
+ pdf_font_step(f), pdf_font_expand_ratio(f));
return k;
}
-int
-open_vf_file (char *fn, unsigned char **vbuffer, integer *vsize) {
- boolean res; /* was the callback successful? */
- integer callback_id;
- boolean file_read; /* was |vf_file| successfully read? */
- FILE *vf_file;
- char *fnam = NULL;
+int open_vf_file(char *fn, unsigned char **vbuffer, integer * vsize)
+{
+ boolean res; /* was the callback successful? */
+ integer callback_id;
+ boolean file_read; /* was |vf_file| successfully read? */
+ FILE *vf_file;
+ char *fnam = NULL;
- namelength = strlen(fn);
- nameoffile = xmalloc(namelength+2);
- strcpy((char *)(nameoffile+1),fn);
+ namelength = strlen(fn);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), fn);
- callback_id=callback_defined(find_vf_file_callback);
- if (callback_id>0) {
- res = run_callback(callback_id,"S->S",fn, &fnam);
- if (res && (fnam!=NULL) && (strlen(fnam)>0)) {
- /* @<Fixup |nameoffile| after callback@>; */
- free(nameoffile);
- namelength = strlen(fnam);
- nameoffile = xmalloc(namelength+2);
- strcpy((char *)(nameoffile+1),fnam);
- } else {
- return 0;
- }
- }
- callback_id=callback_defined(read_vf_file_callback);
- if (callback_id>0) {
- file_read = false;
- res = run_callback(callback_id,"S->bSd",stringcast(nameoffile+1),
- &file_read, vbuffer,vsize);
- if (res && file_read && (*vsize>0)) {
- return 1;
+ callback_id = callback_defined(find_vf_file_callback);
+ if (callback_id > 0) {
+ res = run_callback(callback_id, "S->S", fn, &fnam);
+ if (res && (fnam != NULL) && (strlen(fnam) > 0)) {
+ /* @<Fixup |nameoffile| after callback@>; */
+ free(nameoffile);
+ namelength = strlen(fnam);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), fnam);
+ } else {
+ return 0;
+ }
}
- if (!file_read)
- return 0; /* -1 */
- } else {
- if (ovf_b_open_in(vf_file) || vf_b_open_in(vf_file)) {
- res = read_vf_file(vf_file,vbuffer,vsize);
- b_close(vf_file);
- if (res) {
- return 1;
- }
+ callback_id = callback_defined(read_vf_file_callback);
+ if (callback_id > 0) {
+ file_read = false;
+ res = run_callback(callback_id, "S->bSd", stringcast(nameoffile + 1),
+ &file_read, vbuffer, vsize);
+ if (res && file_read && (*vsize > 0)) {
+ return 1;
+ }
+ if (!file_read)
+ return 0; /* -1 */
} else {
- return 0; /* -1 */
+ if (ovf_b_open_in(vf_file) || vf_b_open_in(vf_file)) {
+ res = read_vf_file(vf_file, vbuffer, vsize);
+ b_close(vf_file);
+ if (res) {
+ return 1;
+ }
+ } else {
+ return 0; /* -1 */
+ }
}
- }
- return 0;
+ return 0;
}
@@ -311,1039 +334,1281 @@ open_vf_file (char *fn, unsigned char **vbuffer, integer *vsize) {
process font definitions in virtual font we call |vf_def_font|.
*/
-#define append_packet(k) vpackets[vf_np++] = k
+#define append_packet(k) vpackets[vf_np++] = k
/* life is easier if all internal font commands are fnt4 and
all character commands are set4 or put4 */
-#define append_fnt_set(k) { \
- assert(k>0) ; \
- append_packet(packet_font_code); \
- append_four(k); }
+#define append_fnt_set(k) { \
+ assert(k>0) ; \
+ append_packet(packet_font_code); \
+ append_four(k); }
-#define append_four(k) { \
- append_packet((k&0xFF000000)>>24); \
- append_packet((k&0x00FF0000)>>16); \
- append_packet((k&0x0000FF00)>>8); \
- append_packet((k&0x000000FF)); }
+#define append_four(k) { \
+ append_packet((k&0xFF000000)>>24); \
+ append_packet((k&0x00FF0000)>>16); \
+ append_packet((k&0x0000FF00)>>8); \
+ append_packet((k&0x000000FF)); }
/* some of these things happen twice, adding a define is simplest */
-#define test_checksum() { vf_byte(tmp_b0); vf_byte(tmp_b1); \
- vf_byte(tmp_b2); vf_byte(tmp_b3); \
+#define test_checksum() { vf_byte(tmp_b0); vf_byte(tmp_b1); \
+ vf_byte(tmp_b2); vf_byte(tmp_b3); \
if (((tmp_b0 != 0) || (tmp_b1 != 0) || (tmp_b2 != 0) || (tmp_b3 != 0)) && \
- ((font_check_0(f) != 0) || (font_check_1(f) != 0) || \
- (font_check_2(f) != 0) || (font_check_3(f) != 0)) && \
- ((tmp_b0 != font_check_0(f)) || (tmp_b1 != font_check_1(f)) || \
- (tmp_b2 != font_check_2(f)) || (tmp_b3 != font_check_3(f)))) { \
- print_nlp(); \
- print_string("checksum mismatch in font "); \
- print_string(font_name(f)); \
+ ((font_check_0(f) != 0) || (font_check_1(f) != 0) || \
+ (font_check_2(f) != 0) || (font_check_3(f) != 0)) && \
+ ((tmp_b0 != font_check_0(f)) || (tmp_b1 != font_check_1(f)) || \
+ (tmp_b2 != font_check_2(f)) || (tmp_b3 != font_check_3(f)))) { \
+ print_nlp(); \
+ print_string("checksum mismatch in font "); \
+ print_string(font_name(f)); \
print_string(".vf ignored "); } }
-#define test_dsize() { int read_tmp; vf_read(4,read_tmp); \
- if ((read_tmp / 16) != font_dsize(f)) { \
- print_nlp(); \
- print_string("design size mismatch in font "); \
- print_string(font_name(f)); \
- print_string(".vf ignored"); \
+#define test_dsize() { int read_tmp; vf_read(4,read_tmp); \
+ if ((read_tmp / 16) != font_dsize(f)) { \
+ print_nlp(); \
+ print_string("design size mismatch in font "); \
+ print_string(font_name(f)); \
+ print_string(".vf ignored"); \
} }
-int count_packet_bytes (real_eight_bits *vf_buf, int cur_bute, int count) {
- int k = 0;
- int ff = 0;
- int acc = 0;
- unsigned int cmd = 0;
- unsigned int d = 0;
- while (k<count) {
- cmd = vf_buf[cur_bute+k]; k++;
- if ((cmd >= set_char_0) && (cmd < set1)) {
- if (ff==0) { ff = 1; acc+=5; }
- acc+=5;
- } else if ((fnt_num_0 <= cmd) && (cmd <= fnt_num_0 + 63)) {
- ff = 1;
- acc+=5;
- } else {
- switch (cmd) {
- case fnt1: acc+=5; k+=1; ff=1 ; break;
- case fnt2: acc+=5; k+=2; ff=1 ; break;
- case fnt3: acc+=5; k+=3; ff=1 ; break;
- case fnt4: acc+=5; k+=4; ff=1 ; break;
- case set_rule: acc+=9; k+=8; break;
- case put_rule: acc+=11; k+=8; break;
- case set1: acc+=5; k+=1; if (ff==0) { ff = 1; acc+=5; } break;
- case set2: acc+=5; k+=2; if (ff==0) { ff = 1; acc+=5; } break;
- case set3: acc+=5; k+=3; if (ff==0) { ff = 1; acc+=5; } break;
- case set4: acc+=5; k+=4; if (ff==0) { ff = 1; acc+=5; } break;
- case put1: acc+=7; k+=1; if (ff==0) { ff = 1; acc+=5; } break;
- case put2: acc+=7; k+=2; if (ff==0) { ff = 1; acc+=5; } break;
- case put3: acc+=7; k+=3; if (ff==0) { ff = 1; acc+=5; } break;
- case put4: acc+=7; k+=4; if (ff==0) { ff = 1; acc+=5; } break;
- case right1: acc+=5; k+=1; break;
- case right2: acc+=5; k+=2; break;
- case right3: acc+=5; k+=3; break;
- case right4: acc+=5; k+=4; break;
- case w1: acc+=5; k+=1; break;
- case w2: acc+=5; k+=2; break;
- case w3: acc+=5; k+=3; break;
- case w4: acc+=5; k+=4; break;
- case x1: acc+=5; k+=1; break;
- case x2: acc+=5; k+=2; break;
- case x3: acc+=5; k+=3; break;
- case x4: acc+=5; k+=4; break;
- case down1: acc+=5; k+=1; break;
- case down2: acc+=5; k+=2; break;
- case down3: acc+=5; k+=3; break;
- case down4: acc+=5; k+=4; break;
- case y1: acc+=5; k+=1; break;
- case y2: acc+=5; k+=2; break;
- case y3: acc+=5; k+=3; break;
- case y4: acc+=5; k+=4; break;
- case z1: acc+=5; k+=1; break;
- case z2: acc+=5; k+=2; break;
- case z3: acc+=5; k+=3; break;
- case z4: acc+=5; k+=4; break;
- case xxx1:
- d = vf_buf[cur_bute+k]; k++;
- k += d; acc += 5 + d;
- break;
- case xxx2:
- d = vf_buf[cur_bute+k]; k++;
- d = d*256 + vf_buf[cur_bute+k]; k++;
- k += d; acc += 5 + d;
- break;
- case xxx3:
- d = vf_buf[cur_bute+k]; k++;
- d = d*256 + vf_buf[cur_bute+k]; k++;
- d = d*256 + vf_buf[cur_bute+k]; k++;
- k += d; acc += 5 + d;
- break;
- case xxx4:
- d = vf_buf[cur_bute+k]; k++;
- d = d*256 + vf_buf[cur_bute+k]; k++;
- d = d*256 + vf_buf[cur_bute+k]; k++;
- d = d*256 + vf_buf[cur_bute+k]; k++;
- k += d; acc += 5 + d;
- break;
- case w0: acc+=5; break;
- case x0: acc+=5; break;
- case y0: acc+=5; break;
- case z0: acc+=5; break;
- case nop: break;
- case push: acc+=1; break;
- case pop: acc+=1; break;
- }
- }
- }
- return (acc+1);
+int count_packet_bytes(real_eight_bits * vf_buf, int cur_bute, int count)
+{
+ int k = 0;
+ int ff = 0;
+ int acc = 0;
+ unsigned int cmd = 0;
+ unsigned int d = 0;
+ while (k < count) {
+ cmd = vf_buf[cur_bute + k];
+ k++;
+ if (cmd < set1) {
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ acc += 5;
+ } else if ((fnt_num_0 <= cmd) && (cmd <= fnt_num_0 + 63)) {
+ ff = 1;
+ acc += 5;
+ } else {
+ switch (cmd) {
+ case fnt1:
+ acc += 5;
+ k += 1;
+ ff = 1;
+ break;
+ case fnt2:
+ acc += 5;
+ k += 2;
+ ff = 1;
+ break;
+ case fnt3:
+ acc += 5;
+ k += 3;
+ ff = 1;
+ break;
+ case fnt4:
+ acc += 5;
+ k += 4;
+ ff = 1;
+ break;
+ case set_rule:
+ acc += 9;
+ k += 8;
+ break;
+ case put_rule:
+ acc += 11;
+ k += 8;
+ break;
+ case set1:
+ acc += 5;
+ k += 1;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case set2:
+ acc += 5;
+ k += 2;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case set3:
+ acc += 5;
+ k += 3;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case set4:
+ acc += 5;
+ k += 4;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case put1:
+ acc += 7;
+ k += 1;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case put2:
+ acc += 7;
+ k += 2;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case put3:
+ acc += 7;
+ k += 3;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case put4:
+ acc += 7;
+ k += 4;
+ if (ff == 0) {
+ ff = 1;
+ acc += 5;
+ }
+ break;
+ case right1:
+ acc += 5;
+ k += 1;
+ break;
+ case right2:
+ acc += 5;
+ k += 2;
+ break;
+ case right3:
+ acc += 5;
+ k += 3;
+ break;
+ case right4:
+ acc += 5;
+ k += 4;
+ break;
+ case w1:
+ acc += 5;
+ k += 1;
+ break;
+ case w2:
+ acc += 5;
+ k += 2;
+ break;
+ case w3:
+ acc += 5;
+ k += 3;
+ break;
+ case w4:
+ acc += 5;
+ k += 4;
+ break;
+ case x1:
+ acc += 5;
+ k += 1;
+ break;
+ case x2:
+ acc += 5;
+ k += 2;
+ break;
+ case x3:
+ acc += 5;
+ k += 3;
+ break;
+ case x4:
+ acc += 5;
+ k += 4;
+ break;
+ case down1:
+ acc += 5;
+ k += 1;
+ break;
+ case down2:
+ acc += 5;
+ k += 2;
+ break;
+ case down3:
+ acc += 5;
+ k += 3;
+ break;
+ case down4:
+ acc += 5;
+ k += 4;
+ break;
+ case y1:
+ acc += 5;
+ k += 1;
+ break;
+ case y2:
+ acc += 5;
+ k += 2;
+ break;
+ case y3:
+ acc += 5;
+ k += 3;
+ break;
+ case y4:
+ acc += 5;
+ k += 4;
+ break;
+ case z1:
+ acc += 5;
+ k += 1;
+ break;
+ case z2:
+ acc += 5;
+ k += 2;
+ break;
+ case z3:
+ acc += 5;
+ k += 3;
+ break;
+ case z4:
+ acc += 5;
+ k += 4;
+ break;
+ case xxx1:
+ d = vf_buf[cur_bute + k];
+ k++;
+ k += d;
+ acc += 5 + d;
+ break;
+ case xxx2:
+ d = vf_buf[cur_bute + k];
+ k++;
+ d = d * 256 + vf_buf[cur_bute + k];
+ k++;
+ k += d;
+ acc += 5 + d;
+ break;
+ case xxx3:
+ d = vf_buf[cur_bute + k];
+ k++;
+ d = d * 256 + vf_buf[cur_bute + k];
+ k++;
+ d = d * 256 + vf_buf[cur_bute + k];
+ k++;
+ k += d;
+ acc += 5 + d;
+ break;
+ case xxx4:
+ d = vf_buf[cur_bute + k];
+ k++;
+ d = d * 256 + vf_buf[cur_bute + k];
+ k++;
+ d = d * 256 + vf_buf[cur_bute + k];
+ k++;
+ d = d * 256 + vf_buf[cur_bute + k];
+ k++;
+ k += d;
+ acc += 5 + d;
+ break;
+ case w0:
+ acc += 5;
+ break;
+ case x0:
+ acc += 5;
+ break;
+ case y0:
+ acc += 5;
+ break;
+ case z0:
+ acc += 5;
+ break;
+ case nop:
+ break;
+ case push:
+ acc += 1;
+ break;
+ case pop:
+ acc += 1;
+ break;
+ }
+ }
+ }
+ return (acc + 1);
}
-void
-do_vf(internal_font_number f) {
- integer k, n, i;
- unsigned cmd;
- scaled x,y,w,z,h,v;
- integer cc, cmd_length, packet_length;
- charinfo *co;
- scaled tfm_width;
- integer save_cur_byte;
- vf_stack_index stack_level;
- integer vf_z; /* multiplier */
- integer vf_alpha; /* correction for negative values */
- char vf_beta; /* divisor */
- integer vf_np;
- real_eight_bits *vpackets;
- memory_word tmp_w; /* accumulator */
- vf_stack_record vf_stack[256];
- integer junk;
- unsigned char *vf_buffer;
- integer vf_size;
- integer vf_cur;
- integer *vf_local_fnts = NULL; /* external font ids */
- integer *vf_real_fnts = NULL; /* internal font ids */
- unsigned vf_nf = 0; /* local font counter */
-
- if (font_type(f)!= unknown_font_type)
- return;
- set_font_type(f,real_font_type);
- if (auto_expand_vf(f))
- return; /* auto-expanded virtual font */
- stack_level = 0;
- /* @<Open |vf_file|, return if not found@>; */
- vf_cur=0; vf_buffer=NULL; vf_size=0;
- if (!open_vf_file(font_name(f), &vf_buffer, &vf_size))
- return;
- /* @<Process the preamble@>;@/ */
- set_font_type(f,virtual_font_type);
- vf_byte(k);
- if (k != pre)
- bad_vf("PRE command expected");
- vf_byte(k);
- if (k != vf_id)
- bad_vf("wrong id byte");
- vf_byte(cmd_length);
- for (k = 1;k<= cmd_length;k++)
- vf_byte(junk);
- test_checksum();
- test_dsize();
- /* update_terminal;*/
- vf_z = font_size(f);
- vf_replace_z();
- /* @<Process the font definitions@>;@/ */
- /* scan forward to find the number of internal fonts */
- vf_nf = 0;
- save_cur_byte = vf_cur;
- vf_byte(cmd);
- while ((cmd >= fnt_def1) && (cmd <= (fnt_def1 + 3))) {
- vf_read((cmd - fnt_def1 + 1),junk);
- vf_read(4,junk);
- vf_read(4,junk);
- vf_read(4,junk);
+void do_vf(internal_font_number f)
+{
+ integer k, i;
+ unsigned cmd, n;
+ scaled x, y, w, z, h, v;
+ integer cc, cmd_length, packet_length;
+ charinfo *co;
+ scaled tfm_width;
+ integer save_cur_byte;
+ vf_stack_index stack_level;
+ integer vf_z; /* multiplier */
+ integer vf_alpha; /* correction for negative values */
+ char vf_beta; /* divisor */
+ integer vf_np;
+ real_eight_bits *vpackets;
+ memory_word tmp_w; /* accumulator */
+ vf_stack_record vf_stack[256];
+ integer junk;
+ unsigned char *vf_buffer;
+ integer vf_size;
+ integer vf_cur;
+ integer *vf_local_fnts = NULL; /* external font ids */
+ integer *vf_real_fnts = NULL; /* internal font ids */
+ unsigned vf_nf = 0; /* local font counter */
+
+ if (font_type(f) != unknown_font_type)
+ return;
+ set_font_type(f, real_font_type);
+ if (auto_expand_vf(f))
+ return; /* auto-expanded virtual font */
+ stack_level = 0;
+ /* @<Open |vf_file|, return if not found@>; */
+ vf_cur = 0;
+ vf_buffer = NULL;
+ vf_size = 0;
+ if (!open_vf_file(font_name(f), &vf_buffer, &vf_size))
+ return;
+ /* @<Process the preamble@>;@/ */
+ set_font_type(f, virtual_font_type);
vf_byte(k);
- vf_byte(junk);
- k += junk;
- while (k-- > 0) { vf_byte(junk); }
- incr(vf_nf);
- vf_byte(cmd);
- }
- vf_cur = save_cur_byte;
- vf_byte(cmd);
- /* malloc and fill the local font arrays */
- if (vf_nf>0) {
- i = vf_nf*sizeof(integer);
- vf_local_fnts= xmalloc(i);
- memset(vf_local_fnts,0,i);
- vf_real_fnts= xmalloc(i);
- memset(vf_real_fnts,0,i);
+ if (k != pre)
+ bad_vf("PRE command expected");
+ vf_byte(k);
+ if (k != vf_id)
+ bad_vf("wrong id byte");
+ vf_byte(cmd_length);
+ for (k = 1; k <= cmd_length; k++)
+ vf_byte(junk);
+ test_checksum();
+ test_dsize();
+ /* update_terminal; */
+ vf_z = font_size(f);
+ vf_replace_z();
+ /* @<Process the font definitions@>;@/ */
+ /* scan forward to find the number of internal fonts */
vf_nf = 0;
+ save_cur_byte = vf_cur;
+ vf_byte(cmd);
while ((cmd >= fnt_def1) && (cmd <= (fnt_def1 + 3))) {
- vf_read_u((cmd - fnt_def1 + 1),vf_local_fnts[vf_nf]);
- vf_real_fnts[vf_nf] = vf_def_font(f, vf_buffer, &vf_cur);
- incr(vf_nf);
- vf_byte(cmd);
+ vf_read((cmd - fnt_def1 + 1), junk);
+ vf_read(4, junk);
+ vf_read(4, junk);
+ vf_read(4, junk);
+ vf_byte(k);
+ vf_byte(junk);
+ k += junk;
+ while (k-- > 0) {
+ vf_byte(junk);
+ }
+ incr(vf_nf);
+ vf_byte(cmd);
+ }
+ vf_cur = save_cur_byte;
+ vf_byte(cmd);
+ /* malloc and fill the local font arrays */
+ if (vf_nf > 0) {
+ i = vf_nf * sizeof(integer);
+ vf_local_fnts = xmalloc(i);
+ memset(vf_local_fnts, 0, i);
+ vf_real_fnts = xmalloc(i);
+ memset(vf_real_fnts, 0, i);
+ vf_nf = 0;
+ while ((cmd >= fnt_def1) && (cmd <= (fnt_def1 + 3))) {
+ vf_read_u((cmd - fnt_def1 + 1), vf_local_fnts[vf_nf]);
+ vf_real_fnts[vf_nf] = vf_def_font(f, vf_buffer, &vf_cur);
+ incr(vf_nf);
+ vf_byte(cmd);
+ }
}
- }
- while (cmd <= long_char) {
- /* @<Build a character packet@>;@/ */
- vf_np = 0;
- if (cmd == long_char) {
- vf_read_u(4,packet_length);
- vf_read_u(4,cc);
- if (!char_exists(f,cc)) {
- bad_vf("invalid character code");
- }
- vf_read(4,k);
- tfm_width = sqxfw(k, font_size(f));
- } else {
- packet_length = cmd;
- vf_byte(cc);
- if (!char_exists(f,cc)) {
- bad_vf("invalid character code");
- }
- vf_read(3,k);
- tfm_width = sqxfw(k, font_size(f));
+ while (cmd <= long_char) {
+ /* @<Build a character packet@>;@/ */
+ vf_np = 0;
+ if (cmd == long_char) {
+ vf_read_u(4, packet_length);
+ vf_read_u(4, cc);
+ if (!char_exists(f, cc)) {
+ bad_vf("invalid character code");
+ }
+ vf_read(4, k);
+ tfm_width = sqxfw(k, font_size(f));
+ } else {
+ packet_length = cmd;
+ vf_byte(cc);
+ if (!char_exists(f, cc)) {
+ bad_vf("invalid character code");
+ }
+ vf_read(3, k);
+ tfm_width = sqxfw(k, font_size(f));
+ }
+ if (packet_length < 0)
+ bad_vf("negative packet length");
+ if (tfm_width != char_width(f, cc)) {
+ /* precisely 'one off' errors are rampant */
+ if (abs(tfm_width - char_width(f, cc)) > 1) {
+ print_nlp();
+ print_string("character width mismatch in font ");
+ print_string(font_name(f));
+ print_string(".vf ignored");
+ }
+ }
+ k = count_packet_bytes(vf_buffer, vf_cur, packet_length);
+ vpackets = xmalloc(k + 1); /* need one extra extra for packet_end */
+ co = get_charinfo(f, cc);
+ k = 0;
+ w = 0;
+ x = 0;
+ y = 0;
+ z = 0;
+ while (packet_length > 0) {
+ vf_byte(cmd);
+ decr(packet_length);
+
+ if (cmd < set1) {
+ if (k == 0) {
+ k = vf_real_fnts[0];
+ append_fnt_set(k);
+ }
+ append_packet(packet_char_code);
+ append_four(cmd);
+ cmd_length = 0;
+ cmd = nop;
+
+ } else if (((fnt_num_0 <= cmd) && (cmd <= fnt_num_0 + 63)) ||
+ ((fnt1 <= cmd) && (cmd <= fnt1 + 3))) {
+ if (cmd >= fnt1) {
+ vf_read_u((cmd - fnt1 + 1), k);
+ packet_length -= (cmd - fnt1 + 1);
+ } else {
+ k = cmd - fnt_num_0;
+ }
+
+ /* change from local to external font id */
+ n = 0;
+ while ((n < vf_nf) && (vf_local_fnts[n] != k))
+ n++;
+ if (n == vf_nf)
+ bad_vf("undefined local font");
+
+ k = vf_real_fnts[n];
+ append_fnt_set(k);
+ cmd_length = 0;
+ cmd = nop;
+ } else {
+ switch (cmd) {
+ case set_rule:
+ vf_read(4, h);
+ vf_read(4, v);
+ append_packet(packet_rule_code);
+ append_four(h);
+ append_four(v);
+ packet_length -= 8;
+ break;
+ case put_rule:
+ vf_read(4, h);
+ vf_read(4, v);
+ append_packet(packet_push_code);
+ append_packet(packet_rule_code);
+ append_four(h);
+ append_four(v);
+ append_packet(packet_pop_code);
+ packet_length -= 8;
+ break;
+ case set1:
+ case set2:
+ case set3:
+ case set4:
+ if (k == 0) {
+ k = vf_real_fnts[0];
+ append_fnt_set(k);
+ }
+ vf_read_u((cmd - set1 + 1), i);
+ append_packet(packet_char_code);
+ append_four(i);
+ packet_length -= (cmd - set1 + 1);
+ break;
+ case put1:
+ case put2:
+ case put3:
+ case put4:
+ if (k == 0) {
+ k = vf_real_fnts[0];
+ append_fnt_set(k);
+ }
+ vf_read_u((cmd - put1 + 1), i);
+ append_packet(packet_push_code);
+ append_packet(packet_char_code);
+ append_four(i);
+ append_packet(packet_pop_code);
+ packet_length -= (cmd - put1 + 1);
+ break;
+ case right1:
+ case right2:
+ case right3:
+ case right4:
+ vf_read((cmd - right1 + 1), i);
+ append_packet(packet_right_code);
+ append_four(i);
+ packet_length -= (cmd - right1 + 1);
+ break;
+ case w1:
+ case w2:
+ case w3:
+ case w4:
+ vf_read((cmd - w1 + 1), w);
+ append_packet(packet_right_code);
+ append_four(w);
+ packet_length -= (cmd - w1 + 1);
+ break;
+ case x1:
+ case x2:
+ case x3:
+ case x4:
+ vf_read((cmd - x1 + 1), x);
+ append_packet(packet_right_code);
+ append_four(x);
+ packet_length -= (cmd - x1 + 1);
+ break;
+ case down1:
+ case down2:
+ case down3:
+ case down4:
+ vf_read((cmd - down1 + 1), i);
+ append_packet(packet_down_code);
+ append_four(i);
+ packet_length -= (cmd - down1 + 1);
+ break;
+ case y1:
+ case y2:
+ case y3:
+ case y4:
+ vf_read((cmd - y1 + 1), y);
+ append_packet(packet_down_code);
+ append_four(y);
+ packet_length -= (cmd - y1 + 1);
+ break;
+ case z1:
+ case z2:
+ case z3:
+ case z4:
+ vf_read((cmd - z1 + 1), z);
+ append_packet(packet_down_code);
+ append_four(z);
+ packet_length -= (cmd - z1 + 1);
+ break;
+ case xxx1:
+ case xxx2:
+ case xxx3:
+ case xxx4:
+ vf_read_u((cmd - xxx1 + 1), cmd_length);
+ packet_length -= (cmd - xxx1 + 1);
+ if (cmd_length <= 0)
+ bad_vf("special of negative length");
+ packet_length -= cmd_length;
+
+ append_packet(packet_special_code);
+ append_four(cmd_length);
+ while (cmd_length > 0) {
+ cmd_length--;
+ vf_byte(i);
+ append_packet(i);
+ }
+ break;
+ case w0:
+ append_packet(packet_right_code);
+ append_four(w);
+ break;
+ case x0:
+ append_packet(packet_right_code);
+ append_four(x);
+ break;
+ case y0:
+ append_packet(packet_down_code);
+ append_four(y);
+ break;
+ case z0:
+ append_packet(packet_down_code);
+ append_four(z);
+ break;
+ case nop:
+ break;
+ case push:
+ if (stack_level == vf_stack_size) {
+ overflow_string("virtual font stack size",
+ vf_stack_size);
+ } else {
+ vf_stack[stack_level].stack_w = w;
+ vf_stack[stack_level].stack_x = x;
+ vf_stack[stack_level].stack_y = y;
+ vf_stack[stack_level].stack_z = z;
+ incr(stack_level);
+ append_packet(packet_push_code);
+ }
+ break;
+ case pop:
+ if (stack_level == 0) {
+ bad_vf("more POPs than PUSHs in character");
+ } else {
+ decr(stack_level);
+ w = vf_stack[stack_level].stack_w;
+ x = vf_stack[stack_level].stack_x;
+ y = vf_stack[stack_level].stack_y;
+ z = vf_stack[stack_level].stack_z;
+ append_packet(packet_pop_code);
+ }
+ break;
+ default:
+ bad_vf("improver DVI command");
+ }
+ }
+ }
+ /* signal end of packet */
+ append_packet(packet_end_code);
+
+ if (stack_level != 0)
+ bad_vf("more PUSHs than POPs in character packet");
+ if (packet_length != 0)
+ bad_vf("invalid packet length or DVI command in packet");
+ /* @<Store the packet being built@>; */
+ set_charinfo_packets(co, vpackets);
+ vf_byte(cmd);
}
- if (packet_length < 0)
- bad_vf("negative packet length");
- if (tfm_width != char_width(f,cc)) {
- /* precisely 'one off' errors are rampant */
- if (abs(tfm_width - char_width(f,cc))>1) {
- print_nlp();
- print_string("character width mismatch in font ");
- print_string(font_name(f));
- print_string(".vf ignored");
- }
- }
- k = count_packet_bytes(vf_buffer,vf_cur,packet_length);
- vpackets = xmalloc(k+1);
- co = get_charinfo(f,cc);
- k = 0;
- w = 0; x = 0; y = 0; z = 0;
- while (packet_length > 0) {
- vf_byte(cmd);
- decr(packet_length);
-
- if ((cmd >= set_char_0) && (cmd < set1)) {
- if (k == 0) {
- k = vf_real_fnts[0];
- append_fnt_set(k);
- }
- append_packet(packet_char_code);
- append_four(cmd);
- cmd_length = 0;
- cmd = nop;
-
- } else if (((fnt_num_0 <= cmd) && (cmd <= fnt_num_0 + 63)) ||
- ((fnt1 <= cmd) && (cmd <= fnt1 + 3))) {
- if (cmd >= fnt1) {
- vf_read_u((cmd - fnt1 + 1),k);
- packet_length -= (cmd - fnt1 + 1);
- } else {
- k = cmd - fnt_num_0;
- }
-
- /* change from local to external font id */
- n = 0;
- while ((n < vf_nf) && (vf_local_fnts[n] != k))
- n++;
- if (n==vf_nf)
- bad_vf("undefined local font");
-
- k = vf_real_fnts[n];
- append_fnt_set(k);
- cmd_length = 0;
- cmd = nop;
- } else {
- switch (cmd) {
- case set_rule:
- vf_read(4,h); vf_read(4,v);
- append_packet(packet_rule_code);
- append_four(h);
- append_four(v);
- packet_length -= 8;
- break;
- case put_rule:
- vf_read(4,h); vf_read(4,v);
- append_packet(packet_push_code);
- append_packet(packet_rule_code);
- append_four(h);
- append_four(v);
- append_packet(packet_pop_code);
- packet_length -= 8;
- break;
- case set1:
- case set2:
- case set3:
- case set4:
- if (k == 0) {
- k = vf_real_fnts[0];
- append_fnt_set(k);
- }
- vf_read_u((cmd - set1 + 1),i);
- append_packet(packet_char_code);
- append_four(i);
- packet_length -= (cmd - set1 + 1);
- break;
- case put1:
- case put2:
- case put3:
- case put4:
- if (k == 0) {
- k = vf_real_fnts[0];
- append_fnt_set(k);
- }
- vf_read_u((cmd - put1 + 1),i);
- append_packet(packet_push_code);
- append_packet(packet_char_code);
- append_four(i);
- append_packet(packet_pop_code);
- packet_length -= (cmd - put1 + 1);
- break;
- case right1:
- case right2:
- case right3:
- case right4:
- vf_read((cmd - right1 + 1),i);
- append_packet(packet_right_code);
- append_four(i);
- packet_length -= (cmd - right1 + 1);
- break;
- case w1:
- case w2:
- case w3:
- case w4:
- vf_read((cmd - w1 + 1),w);
- append_packet(packet_right_code);
- append_four(w);
- packet_length -= (cmd - w1 + 1);
- break;
- case x1:
- case x2:
- case x3:
- case x4:
- vf_read((cmd - x1 + 1),x);
- append_packet(packet_right_code);
- append_four(x);
- packet_length -= (cmd - x1 + 1);
- break;
- case down1:
- case down2:
- case down3:
- case down4:
- vf_read((cmd - down1 + 1),i);
- append_packet(packet_down_code);
- append_four(i);
- packet_length -= (cmd - down1 + 1);
- break;
- case y1:
- case y2:
- case y3:
- case y4:
- vf_read((cmd - y1 + 1),y);
- append_packet(packet_down_code);
- append_four(y);
- packet_length -= (cmd - y1 + 1);
- break;
- case z1:
- case z2:
- case z3:
- case z4:
- vf_read((cmd - z1 + 1),z);
- append_packet(packet_down_code);
- append_four(z);
- packet_length -= (cmd - z1 + 1);
- break;
- case xxx1:
- case xxx2:
- case xxx3:
- case xxx4:
- vf_read_u((cmd - xxx1 + 1),cmd_length);
- packet_length -= (cmd - xxx1 + 1);
- if (cmd_length <= 0)
- bad_vf("special of negative length");
- packet_length -= cmd_length;
-
- append_packet(packet_special_code);
- append_four(cmd_length);
- while (cmd_length > 0) {
- cmd_length--;
- vf_byte(i);
- append_packet(i);
- }
- append_packet(0);
- break;
- case w0:
- append_packet(packet_right_code);
- append_four(w);
- break;
- case x0:
- append_packet(packet_right_code);
- append_four(x);
- break;
- case y0:
- append_packet(packet_down_code);
- append_four(y);
- break;
- case z0:
- append_packet(packet_down_code);
- append_four(z);
- break;
- case nop:
- break;
- case push:
- if (stack_level == vf_stack_size) {
- overflow_string("virtual font stack size", vf_stack_size);
- } else {
- vf_stack[stack_level].stack_w = w;
- vf_stack[stack_level].stack_x = x;
- vf_stack[stack_level].stack_y = y;
- vf_stack[stack_level].stack_z = z;
- incr(stack_level);
- append_packet(packet_push_code);
- }
- break;
- case pop:
- if (stack_level == 0) {
- bad_vf("more POPs than PUSHs in character");
- } else {
- decr(stack_level);
- w = vf_stack[stack_level].stack_w;
- x = vf_stack[stack_level].stack_x;
- y = vf_stack[stack_level].stack_y;
- z = vf_stack[stack_level].stack_z;
- append_packet(packet_pop_code);
- }
- break;
- default:
- bad_vf("improver DVI command");
- }
- }
- }
- /* signal end of packet */
- append_packet(packet_end_code);
-
- if (stack_level != 0)
- bad_vf("more PUSHs than POPs in character packet");
- if (packet_length != 0)
- bad_vf("invalid packet length or DVI command in packet");
- /* @<Store the packet being built@>; */
- set_charinfo_packets(co,vpackets);
- vf_byte(cmd);
- }
- if (cmd != post)
- bad_vf("POST command expected");
+ if (cmd != post)
+ bad_vf("POST command expected");
- xfree(vf_buffer);
+ xfree(vf_buffer);
}
-#define make_command0(N,K) { \
- lua_newtable(L); \
- lua_pushstring(L, N); \
- lua_rawseti(L,-2, 1); \
- lua_rawseti(L,-2, K); \
+#define make_command0(N,K) { \
+ lua_newtable(L); \
+ lua_pushstring(L, N); \
+ lua_rawseti(L,-2, 1); \
+ lua_rawseti(L,-2, K); \
K++; }
-#define make_command1(N,V,K) { \
- lua_newtable(L); \
- lua_pushstring(L, N); \
- lua_rawseti(L,-2, 1); \
- lua_pushnumber(L, V); \
- lua_rawseti(L,-2, 2); \
- lua_rawseti(L,-2, K); \
+#define make_command1(N,V,K) { \
+ lua_newtable(L); \
+ lua_pushstring(L, N); \
+ lua_rawseti(L,-2, 1); \
+ lua_pushnumber(L, V); \
+ lua_rawseti(L,-2, 2); \
+ lua_rawseti(L,-2, K); \
K++; }
-#define make_command2(N,V,W,K) { \
- lua_newtable(L); \
- lua_pushstring(L, N); \
- lua_rawseti(L,-2, 1); \
- lua_pushnumber(L, V); \
- lua_rawseti(L,-2, 2); \
- lua_pushnumber(L, W); \
- lua_rawseti(L,-2, 3); \
- lua_rawseti(L,-2, K); \
+#define make_command2(N,V,W,K) { \
+ lua_newtable(L); \
+ lua_pushstring(L, N); \
+ lua_rawseti(L,-2, 1); \
+ lua_pushnumber(L, V); \
+ lua_rawseti(L,-2, 2); \
+ lua_pushnumber(L, W); \
+ lua_rawseti(L,-2, 3); \
+ lua_rawseti(L,-2, K); \
K++; }
-#define make_commands(N,S,V,K) { \
- lua_newtable(L); \
- lua_pushstring(L, N); \
- lua_rawseti(L,-2, 1); \
- lua_pushlstring(L, S, V); \
- lua_rawseti(L,-2, 2); \
- lua_rawseti(L,-2, K); \
+#define make_commands(N,S,V,K) { \
+ lua_newtable(L); \
+ lua_pushstring(L, N); \
+ lua_rawseti(L,-2, 1); \
+ lua_pushlstring(L, S, V); \
+ lua_rawseti(L,-2, 2); \
+ lua_rawseti(L,-2, K); \
K++; }
-int
-make_vf_table(lua_State *L, char *cnom, scaled atsize) {
- integer cmd, k, i;
- integer cc, cmd_length, packet_length;
- scaled tfm_width;
- vf_stack_index stack_level;
- integer vf_z; /* multiplier */
- integer vf_alpha; /* correction for negative values */
- char vf_beta; /* divisor */
- char *s;
- scaled h,v;
- scaled w, x, y, z;
- integer s_top; /* lua stack */
- integer vf_nf ; /* local font counter */
- scaled ds,fs;
- four_quarters cs;
- memory_word tmp_w; /* accumulator */
- vf_stack_record vf_stack[256];
- unsigned char *vf_buffer;
- integer vf_size;
- integer vf_cur;
-
-
- stack_level = 0;
- /* @<Open |vf_file|, return if not found@>; */
- vf_cur=0; vf_buffer=NULL; vf_size=0;
- if (!open_vf_file(cnom, &vf_buffer, &vf_size)) {
- lua_pushnil(L);
- return 1;
- }
+int make_vf_table(lua_State * L, char *cnom, scaled atsize)
+{
+ integer cmd, k, i;
+ integer cc, cmd_length, packet_length;
+ scaled tfm_width;
+ vf_stack_index stack_level;
+ integer vf_z; /* multiplier */
+ integer vf_alpha; /* correction for negative values */
+ char vf_beta; /* divisor */
+ char *s;
+ scaled h, v;
+ scaled w, x, y, z;
+ integer s_top; /* lua stack */
+ integer vf_nf; /* local font counter */
+ scaled ds, fs;
+ four_quarters cs;
+ memory_word tmp_w; /* accumulator */
+ vf_stack_record vf_stack[256];
+ unsigned char *vf_buffer;
+ integer vf_size;
+ integer vf_cur;
+
+
+ stack_level = 0;
+ /* @<Open |vf_file|, return if not found@>; */
+ vf_cur = 0;
+ vf_buffer = NULL;
+ vf_size = 0;
+ if (!open_vf_file(cnom, &vf_buffer, &vf_size)) {
+ lua_pushnil(L);
+ return 1;
+ }
+
+ /* start by creating a table */
+ s_top = lua_gettop(L);
+ lua_newtable(L);
+
+ /* @<Process the preamble@>;@/ */
+ vf_byte(k);
+ if (k != pre)
+ lua_bad_vf("PRE command expected");
+ vf_byte(k);
+ if (k != vf_id)
+ lua_bad_vf("wrong id byte");
+ vf_byte(cmd_length);
+
+ s = xmalloc(cmd_length);
+ for (k = 1; k <= cmd_length; k++)
+ vf_byte(s[(k - 1)]);
- /* start by creating a table */
- s_top = lua_gettop(L);
- lua_newtable(L);
-
- /* @<Process the preamble@>;@/ */
- vf_byte(k);
- if (k != pre)
- lua_bad_vf("PRE command expected");
- vf_byte(k);
- if (k != vf_id)
- lua_bad_vf("wrong id byte");
- vf_byte(cmd_length);
-
- s = xmalloc(cmd_length);
- for (k = 1;k<= cmd_length;k++)
- vf_byte(s[(k-1)]);
-
- lua_pushlstring(L,s,cmd_length);
- free(s);
- lua_setfield(L,-2,"header");
-
- vf_byte(cs.b0); vf_byte(cs.b1); vf_byte(cs.b2); vf_byte(cs.b3);
- lua_pushnumber(L, (unsigned long)(cs.b0<<24)+(cs.b1<<16)+(cs.b2<<8)+cs.b3 );
- lua_setfield(L,-2,"checksum");
-
- vf_read(4,k);
- ds = k /16;
- lua_pushinteger(L,ds);
- lua_setfield(L,-2,"designsize");
-
-
- lua_pushstring(L,cnom);
- lua_setfield(L,-2,"name");
-
- lua_pushinteger(L,atsize);
- lua_setfield(L,-2,"size");
-
-
- /* update_terminal;*/
- vf_z = atsize;
- vf_replace_z();
- /* @<Process the font definitions@>;@/ */
- vf_byte(cmd);
- lua_newtable(L);
-
- i = 1;
- while ((cmd >= fnt_def1) && (cmd <= fnt_def1 + 3)) {
-
- lua_newtable(L);
- vf_read_u((cmd - fnt_def1 + 1),vf_nf);
- vf_nf++;
- /* checksum */
- vf_byte(cs.b0); vf_byte(cs.b1); vf_byte(cs.b2); vf_byte(cs.b3);
-
- vf_read(4,k);
- fs = sqxfw(k, atsize);
- lua_pushstring(L,"size");
- lua_pushnumber(L,fs);
- lua_rawset(L,-3);
-
- vf_read(4,k);
- ds = k / 16; /* dsize, not used */
-
- vf_byte(tmp_b0);
- vf_byte(tmp_b1);
- while (tmp_b0 > 0) { tmp_b0--; vf_byte(k); } /* skip the font path */
-
- s = xmalloc(tmp_b1+1); k = 0;
- while (tmp_b1-- > 0)
- vf_byte(s[k++]);
- s[k]=0;
- lua_pushstring(L,"name");
- lua_pushstring(L,xstrdup(s));
+ lua_pushlstring(L, s, cmd_length);
free(s);
- lua_rawset(L,-3);
-
- lua_rawseti(L,-2,vf_nf);
- i++;
- vf_byte(cmd);
- }
+ lua_setfield(L, -2, "header");
+
+ vf_byte(cs.b0);
+ vf_byte(cs.b1);
+ vf_byte(cs.b2);
+ vf_byte(cs.b3);
+ lua_pushnumber(L,
+ (unsigned long) (cs.b0 << 24) + (cs.b1 << 16) +
+ (cs.b2 << 8) + cs.b3);
+ lua_setfield(L, -2, "checksum");
+
+ vf_read(4, k);
+ ds = k / 16;
+ lua_pushinteger(L, ds);
+ lua_setfield(L, -2, "designsize");
- if (i>1) {
- lua_setfield(L,-2,"fonts");
- } else {
- lua_pop(L,1);
- }
- lua_newtable(L); /* 'characters' */
- while (cmd <= long_char) {
- /* @<Build a character packet@>;@/ */
- if (cmd == long_char) {
- vf_read_u(4,packet_length);
- vf_read_u(4,cc);
- vf_read(4,tfm_width);
- } else {
- packet_length = cmd;
- vf_byte(cc);
- vf_read(3,tfm_width);
- }
- if (packet_length < 0)
- lua_bad_vf("negative packet length");
-
- lua_newtable(L); /* for this character */
-
- lua_pushnumber(L,tfm_width);
- lua_setfield(L,-2,"width");
-
- lua_newtable(L); /* for 'commands' */
-
- k = 1; vf_nf = 0;
- w = 0; x = 0; y = 0; z = 0;
- while (packet_length > 0) {
- vf_byte(cmd);
- decr(packet_length);
-
- if ((cmd >= set_char_0) && (cmd < set1)) {
- if (vf_nf == 0) {
- vf_nf = 1;
- make_command1("font",vf_nf,k);
- }
- make_command1("char",cmd,k);
-
- } else if (((fnt_num_0 <= cmd) && (cmd <= fnt_num_0 + 63)) ||
- ((fnt1 <= cmd) && (cmd <= fnt1 + 3))) {
- if (cmd >= fnt1) {
- vf_read_u((cmd - fnt1 + 1),vf_nf); vf_nf++;
- packet_length -= (cmd - fnt1 + 1);
- } else {
- vf_nf = cmd - fnt_num_0 + 1;
- }
- make_command1("font",vf_nf,k);
- } else {
- switch (cmd) {
- case set_rule:
- vf_read(4,h); vf_read(4,v);
- make_command2("rule",sqxfw(h,atsize),sqxfw(v,atsize),k);
- packet_length -= 8;
- break;
- case put_rule:
- vf_read(4,h); vf_read(4,v);
- make_command0("push",k);
- make_command2("rule",sqxfw(h,atsize),sqxfw(v,atsize),k);
- make_command0("pop",k);
- packet_length -= 8;
- break;
- case set1:
- case set2:
- case set3:
- case set4:
- if (vf_nf == 0) {
- vf_nf = 1;
- make_command1("font",vf_nf,k);
- }
- vf_read_u((cmd - set1 + 1),i);
- make_command1("char",i,k);
- packet_length -= (cmd - set1 + 1);
- break;
- case put1:
- case put2:
- case put3:
- case put4:
- if (vf_nf == 0) {
- vf_nf = 1;
- make_command1("font",vf_nf,k);
- }
- vf_read_u((cmd - put1 + 1),i);
- make_command0("push",k);
- make_command1("char",i,k);
- make_command0("pop",k);
- packet_length -= (cmd - put1 + 1);
- break;
- case right1:
- case right2:
- case right3:
- case right4:
- vf_read((cmd - right1 + 1),i);
- make_command1("right",sqxfw(i,atsize),k);
- packet_length -= (cmd - right1 + 1);
- break;
- case w1:
- case w2:
- case w3:
- case w4:
- vf_read((cmd - w1 + 1),w);
- make_command1("right",sqxfw(w,atsize),k);
- packet_length -= (cmd - w1 + 1);
- break;
- case x1:
- case x2:
- case x3:
- case x4:
- vf_read((cmd - x1 + 1),x);
- make_command1("right",sqxfw(x,atsize),k);
- packet_length -= (cmd - x1 + 1);
- break;
- case down1:
- case down2:
- case down3:
- case down4:
- vf_read((cmd - down1 + 1),i);
- make_command1("down",sqxfw(i,atsize),k);
- packet_length -= (cmd - down1 + 1);
- break;
- case y1:
- case y2:
- case y3:
- case y4:
- vf_read((cmd - y1 + 1),y);
- make_command1("down",sqxfw(y,atsize),k);
- packet_length -= (cmd - y1 + 1);
- break;
- case z1:
- case z2:
- case z3:
- case z4:
- vf_read((cmd - z1 + 1),z);
- make_command1("down",sqxfw(z,atsize),k);
- packet_length -= (cmd - z1 + 1);
- break;
- case xxx1:
- case xxx2:
- case xxx3:
- case xxx4:
- vf_read_u((cmd - xxx1 + 1),cmd_length);
- packet_length -= (cmd - xxx1 + 1);
- if (cmd_length <= 0)
- lua_bad_vf("special of negative length");
- packet_length -= cmd_length;
-
- s = xmalloc(cmd_length+1); i = 0;
- while (cmd_length > 0) {
- cmd_length--;
- vf_byte(s[i]);
- i++;
- }
- s[i]=0;
- make_commands("special",strdup(s),i,k);
- free(s);
- break;
- case w0:
- make_command1("right",sqxfw(w,atsize),k);
- break;
- case x0:
- make_command1("right",sqxfw(x,atsize),k);
- break;
- case y0:
- make_command1("down",sqxfw(y,atsize),k);
- break;
- case z0:
- make_command1("down",sqxfw(z,atsize),k);
- break;
- case nop:
- break;
- case push:
- if (stack_level == vf_stack_size) {
- overflow_string("virtual font stack size", vf_stack_size);
- } else {
- vf_stack[stack_level].stack_w = w;
- vf_stack[stack_level].stack_x = x;
- vf_stack[stack_level].stack_y = y;
- vf_stack[stack_level].stack_z = z;
- incr(stack_level);
- make_command0("push",k);
- }
- break;
- case pop:
- if (stack_level == 0) {
- lua_bad_vf("more POPs than PUSHs in character");
- } else {
- decr(stack_level);
- w = vf_stack[stack_level].stack_w;
- x = vf_stack[stack_level].stack_x;
- y = vf_stack[stack_level].stack_y;
- z = vf_stack[stack_level].stack_z;
- make_command0("pop",k);
- }
- break;
- default:
- lua_bad_vf("improver DVI command");
- }
- }
- }
- /* signal end of packet */
- lua_setfield(L,-2,"commands");
+ lua_pushstring(L, cnom);
+ lua_setfield(L, -2, "name");
- if (stack_level != 0)
- lua_bad_vf("more PUSHs than POPs in character packet");
- if (packet_length != 0)
- lua_bad_vf("invalid packet length or DVI command in packet");
+ lua_pushinteger(L, atsize);
+ lua_setfield(L, -2, "size");
- lua_rawseti(L,-2,cc);
+ /* update_terminal; */
+ vf_z = atsize;
+ vf_replace_z();
+ /* @<Process the font definitions@>;@/ */
vf_byte(cmd);
- }
- lua_setfield(L,-2,"characters");
+ lua_newtable(L);
+
+ i = 1;
+ while ((cmd >= fnt_def1) && (cmd <= fnt_def1 + 3)) {
+
+ lua_newtable(L);
+ vf_read_u((cmd - fnt_def1 + 1), vf_nf);
+ vf_nf++;
+ /* checksum */
+ vf_byte(cs.b0);
+ vf_byte(cs.b1);
+ vf_byte(cs.b2);
+ vf_byte(cs.b3);
+
+ vf_read(4, k);
+ fs = sqxfw(k, atsize);
+ lua_pushstring(L, "size");
+ lua_pushnumber(L, fs);
+ lua_rawset(L, -3);
+
+ vf_read(4, k);
+ ds = k / 16; /* dsize, not used */
+
+ vf_byte(tmp_b0);
+ vf_byte(tmp_b1);
+ while (tmp_b0 > 0) {
+ tmp_b0--;
+ vf_byte(k);
+ } /* skip the font path */
+
+ s = xmalloc(tmp_b1 + 1);
+ k = 0;
+ while (tmp_b1-- > 0)
+ vf_byte(s[k++]);
+ s[k] = 0;
+ lua_pushstring(L, "name");
+ lua_pushstring(L, xstrdup(s));
+ free(s);
+ lua_rawset(L, -3);
+
+ lua_rawseti(L, -2, vf_nf);
+ i++;
+ vf_byte(cmd);
+ }
- if (cmd != post)
- lua_bad_vf("POST command expected");
- xfree(vf_buffer);
- return 1;
-}
+ if (i > 1) {
+ lua_setfield(L, -2, "fonts");
+ } else {
+ lua_pop(L, 1);
+ }
+ lua_newtable(L); /* 'characters' */
+ while (cmd <= long_char) {
+ /* @<Build a character packet@>;@/ */
+ if (cmd == long_char) {
+ vf_read_u(4, packet_length);
+ vf_read_u(4, cc);
+ vf_read(4, tfm_width);
+ } else {
+ packet_length = cmd;
+ vf_byte(cc);
+ vf_read(3, tfm_width);
+ }
+ if (packet_length < 0)
+ lua_bad_vf("negative packet length");
+
+ lua_newtable(L); /* for this character */
+
+ lua_pushnumber(L, tfm_width);
+ lua_setfield(L, -2, "width");
+
+ lua_newtable(L); /* for 'commands' */
+
+ k = 1;
+ vf_nf = 0;
+ w = 0;
+ x = 0;
+ y = 0;
+ z = 0;
+ while (packet_length > 0) {
+ vf_byte(cmd);
+ decr(packet_length);
+
+ if ((cmd >= set_char_0) && (cmd < set1)) {
+ if (vf_nf == 0) {
+ vf_nf = 1;
+ make_command1("font", vf_nf, k);
+ }
+ make_command1("char", cmd, k);
+
+ } else if (((fnt_num_0 <= cmd) && (cmd <= fnt_num_0 + 63)) ||
+ ((fnt1 <= cmd) && (cmd <= fnt1 + 3))) {
+ if (cmd >= fnt1) {
+ vf_read_u((cmd - fnt1 + 1), vf_nf);
+ vf_nf++;
+ packet_length -= (cmd - fnt1 + 1);
+ } else {
+ vf_nf = cmd - fnt_num_0 + 1;
+ }
+ make_command1("font", vf_nf, k);
+ } else {
+ switch (cmd) {
+ case set_rule:
+ vf_read(4, h);
+ vf_read(4, v);
+ make_command2("rule", sqxfw(h, atsize), sqxfw(v, atsize),
+ k);
+ packet_length -= 8;
+ break;
+ case put_rule:
+ vf_read(4, h);
+ vf_read(4, v);
+ make_command0("push", k);
+ make_command2("rule", sqxfw(h, atsize), sqxfw(v, atsize),
+ k);
+ make_command0("pop", k);
+ packet_length -= 8;
+ break;
+ case set1:
+ case set2:
+ case set3:
+ case set4:
+ if (vf_nf == 0) {
+ vf_nf = 1;
+ make_command1("font", vf_nf, k);
+ }
+ vf_read_u((cmd - set1 + 1), i);
+ make_command1("char", i, k);
+ packet_length -= (cmd - set1 + 1);
+ break;
+ case put1:
+ case put2:
+ case put3:
+ case put4:
+ if (vf_nf == 0) {
+ vf_nf = 1;
+ make_command1("font", vf_nf, k);
+ }
+ vf_read_u((cmd - put1 + 1), i);
+ make_command0("push", k);
+ make_command1("char", i, k);
+ make_command0("pop", k);
+ packet_length -= (cmd - put1 + 1);
+ break;
+ case right1:
+ case right2:
+ case right3:
+ case right4:
+ vf_read((cmd - right1 + 1), i);
+ make_command1("right", sqxfw(i, atsize), k);
+ packet_length -= (cmd - right1 + 1);
+ break;
+ case w1:
+ case w2:
+ case w3:
+ case w4:
+ vf_read((cmd - w1 + 1), w);
+ make_command1("right", sqxfw(w, atsize), k);
+ packet_length -= (cmd - w1 + 1);
+ break;
+ case x1:
+ case x2:
+ case x3:
+ case x4:
+ vf_read((cmd - x1 + 1), x);
+ make_command1("right", sqxfw(x, atsize), k);
+ packet_length -= (cmd - x1 + 1);
+ break;
+ case down1:
+ case down2:
+ case down3:
+ case down4:
+ vf_read((cmd - down1 + 1), i);
+ make_command1("down", sqxfw(i, atsize), k);
+ packet_length -= (cmd - down1 + 1);
+ break;
+ case y1:
+ case y2:
+ case y3:
+ case y4:
+ vf_read((cmd - y1 + 1), y);
+ make_command1("down", sqxfw(y, atsize), k);
+ packet_length -= (cmd - y1 + 1);
+ break;
+ case z1:
+ case z2:
+ case z3:
+ case z4:
+ vf_read((cmd - z1 + 1), z);
+ make_command1("down", sqxfw(z, atsize), k);
+ packet_length -= (cmd - z1 + 1);
+ break;
+ case xxx1:
+ case xxx2:
+ case xxx3:
+ case xxx4:
+ vf_read_u((cmd - xxx1 + 1), cmd_length);
+ packet_length -= (cmd - xxx1 + 1);
+ if (cmd_length <= 0)
+ lua_bad_vf("special of negative length");
+ packet_length -= cmd_length;
+
+ s = xmalloc(cmd_length + 1);
+ i = 0;
+ while (cmd_length > 0) {
+ cmd_length--;
+ vf_byte(s[i]);
+ i++;
+ }
+ s[i] = 0;
+ make_commands("special", strdup(s), i, k);
+ free(s);
+ break;
+ case w0:
+ make_command1("right", sqxfw(w, atsize), k);
+ break;
+ case x0:
+ make_command1("right", sqxfw(x, atsize), k);
+ break;
+ case y0:
+ make_command1("down", sqxfw(y, atsize), k);
+ break;
+ case z0:
+ make_command1("down", sqxfw(z, atsize), k);
+ break;
+ case nop:
+ break;
+ case push:
+ if (stack_level == vf_stack_size) {
+ overflow_string("virtual font stack size",
+ vf_stack_size);
+ } else {
+ vf_stack[stack_level].stack_w = w;
+ vf_stack[stack_level].stack_x = x;
+ vf_stack[stack_level].stack_y = y;
+ vf_stack[stack_level].stack_z = z;
+ incr(stack_level);
+ make_command0("push", k);
+ }
+ break;
+ case pop:
+ if (stack_level == 0) {
+ lua_bad_vf("more POPs than PUSHs in character");
+ } else {
+ decr(stack_level);
+ w = vf_stack[stack_level].stack_w;
+ x = vf_stack[stack_level].stack_x;
+ y = vf_stack[stack_level].stack_y;
+ z = vf_stack[stack_level].stack_z;
+ make_command0("pop", k);
+ }
+ break;
+ default:
+ lua_bad_vf("improver DVI command");
+ }
+ }
+ }
+ /* signal end of packet */
+ lua_setfield(L, -2, "commands");
+
+ if (stack_level != 0)
+ lua_bad_vf("more PUSHs than POPs in character packet");
+ if (packet_length != 0)
+ lua_bad_vf("invalid packet length or DVI command in packet");
+
+ lua_rawseti(L, -2, cc);
+
+ vf_byte(cmd);
+ }
+ lua_setfield(L, -2, "characters");
-extern void replace_packet_fonts(internal_font_number f, integer *old_fontid, integer *new_fontid, int count) ;
-extern integer *packet_local_fonts(internal_font_number f, integer *num);
-extern internal_font_number auto_expand_font (internal_font_number f, integer e) ;
+ if (cmd != post)
+ lua_bad_vf("POST command expected");
+ xfree(vf_buffer);
+ return 1;
+}
/* This function is called from |do_vf|, and fixes up the virtual data
inside an auto-expanded virtual font */
-boolean
-auto_expand_vf(internal_font_number f) {
-
- internal_font_number bf;
- integer e, k;
- integer *vf_old_fonts, *vf_new_fonts;
- integer num = 0;
-
- if ((! pdf_font_auto_expand(f)) || (pdf_font_blink(f) == null_font))
- return false ; /* not an auto-expanded font */
- bf = pdf_font_blink(f);
-
- if (font_type(bf) != virtual_font_type)
- return false; /* not a virtual font */
-
- e = pdf_font_expand_ratio(f);
-
- vf_old_fonts = packet_local_fonts(bf,&num);
- if (num>0) {
- vf_new_fonts = xmalloc(num*sizeof(integer));
- for (k=0;k<num;k++) {
- vf_new_fonts[k] = auto_expand_font(vf_old_fonts[k], e);
- copy_expand_params(vf_new_fonts[k], vf_old_fonts[k], e);
+boolean auto_expand_vf(internal_font_number f)
+{
+
+ internal_font_number bf;
+ integer e, k;
+ integer *vf_old_fonts, *vf_new_fonts;
+ integer num = 0;
+
+ if ((!pdf_font_auto_expand(f)) || (pdf_font_blink(f) == null_font))
+ return false; /* not an auto-expanded font */
+ bf = pdf_font_blink(f);
+
+ if (font_type(bf) != virtual_font_type)
+ return false; /* not a virtual font */
+
+ e = pdf_font_expand_ratio(f);
+
+ vf_old_fonts = packet_local_fonts(bf, &num);
+ if (num > 0) {
+ vf_new_fonts = xmalloc(num * sizeof(integer));
+ for (k = 0; k < num; k++) {
+ vf_new_fonts[k] = auto_expand_font(vf_old_fonts[k], e);
+ copy_expand_params(vf_new_fonts[k], vf_old_fonts[k], e);
+ }
+ replace_packet_fonts(f, vf_old_fonts, vf_new_fonts, num);
+ xfree(vf_new_fonts);
+ xfree(vf_old_fonts);
}
- replace_packet_fonts(f,vf_old_fonts,vf_new_fonts,num);
- xfree(vf_new_fonts);
- xfree(vf_old_fonts);
- }
- set_font_type(f,virtual_font_type);
- return true;
+ set_font_type(f, virtual_font_type);
+ return true;
}
/* this function is not always safe, because it needs makecstring() */
-str_number
-expand_font_name (internal_font_number f, integer e) {
- int old_setting;
- old_setting=selector;
- selector=new_string;
- print_string(font_name(f));
- if (e > 0) {
- print_char('+');
- }
- print_int(e);
- selector=old_setting;
- return make_string();
+str_number expand_font_name(internal_font_number f, integer e)
+{
+ int old_setting;
+ old_setting = selector;
+ selector = new_string;
+ print_string(font_name(f));
+ if (e > 0) {
+ print_char('+');
+ }
+ print_int(e);
+ selector = old_setting;
+ return make_string();
}
-internal_font_number
-auto_expand_font (internal_font_number f, integer e) {
- internal_font_number k;
- kerninfo *krn;
- charinfo *co, *ci;
- char *fn;
- integer i;
- scaled w;
- k = copy_font(f);
- i = strlen(font_name(f))+12;
- fn = xmalloc(i);
- snprintf(fn,i,"%s%s%d",font_name(f),(e>0 ? "+" : ""), (int)e);
- set_font_name(k,fn);
- for (i = font_bc(k);i<=font_ec(k);i++) {
- if (char_exists(k,i)) {
- co = get_charinfo(k,i);
- w = round_xn_over_d(char_width(f,i), 1000 + e, 1000);
- set_charinfo_width (co, w);
- w = round_xn_over_d(char_italic(f,i), 1000 + e, 1000);
- set_charinfo_italic(co, w);
- krn = get_charinfo_kerns(co);
- if (krn != NULL) {
- while (!kern_end((*krn))) {
- kern_kern(*krn) = round_xn_over_d(kern_kern(*krn), 1000 + e, 1000);
- krn++;
- }
- }
+internal_font_number auto_expand_font(internal_font_number f, integer e)
+{
+ internal_font_number k;
+ kerninfo *krn;
+ charinfo *co;
+ char *fn;
+ integer i;
+ scaled w;
+ k = copy_font(f);
+ i = strlen(font_name(f)) + 12;
+ fn = xmalloc(i);
+ snprintf(fn, i, "%s%s%d", font_name(f), (e > 0 ? "+" : ""), (int) e);
+ set_font_name(k, fn);
+ for (i = font_bc(k); i <= font_ec(k); i++) {
+ if (char_exists(k, i)) {
+ co = get_charinfo(k, i);
+ w = round_xn_over_d(char_width(f, i), 1000 + e, 1000);
+ set_charinfo_width(co, w);
+ w = round_xn_over_d(char_italic(f, i), 1000 + e, 1000);
+ set_charinfo_italic(co, w);
+ krn = get_charinfo_kerns(co);
+ if (krn != NULL) {
+ while (!kern_end((*krn))) {
+ kern_kern(*krn) =
+ round_xn_over_d(kern_kern(*krn), 1000 + e, 1000);
+ krn++;
+ }
+ }
+ }
}
- }
- return k;
+ return k;
}
-void
-vf_expand_local_fonts(internal_font_number f) {
- internal_font_number lf;
- integer k, num;
- integer *vf_old_fonts;
- pdfassert(font_type(f) == virtual_font_type);
- num = 0;
- vf_old_fonts = packet_local_fonts(f,&num);
- if (num>0) {
- for (k = 0;k<num;k++) {
- lf = vf_old_fonts[k];
- set_expand_params(lf, pdf_font_auto_expand(f),
- pdf_font_expand_ratio(pdf_font_stretch(f)),
- -pdf_font_expand_ratio(pdf_font_shrink(f)),
- pdf_font_step(f), pdf_font_expand_ratio(f));
- if (font_type(lf) == virtual_font_type)
- vf_expand_local_fonts(lf);
+void vf_expand_local_fonts(internal_font_number f)
+{
+ internal_font_number lf;
+ integer k, num;
+ integer *vf_old_fonts;
+ pdfassert(font_type(f) == virtual_font_type);
+ num = 0;
+ vf_old_fonts = packet_local_fonts(f, &num);
+ if (num > 0) {
+ for (k = 0; k < num; k++) {
+ lf = vf_old_fonts[k];
+ set_expand_params(lf, pdf_font_auto_expand(f),
+ pdf_font_expand_ratio(pdf_font_stretch(f)),
+ -pdf_font_expand_ratio(pdf_font_shrink(f)),
+ pdf_font_step(f), pdf_font_expand_ratio(f));
+ if (font_type(lf) == virtual_font_type)
+ vf_expand_local_fonts(lf);
+ }
+ xfree(vf_old_fonts);
}
- xfree(vf_old_fonts);
- }
}
-internal_font_number
-letter_space_font (halfword u, internal_font_number f, integer e) {
- internal_font_number k;
- scaled w, r;
+internal_font_number
+letter_space_font(halfword u, internal_font_number f, integer e)
+{
+ internal_font_number k;
+ scaled w, r;
- char *new_font_name;
- integer vf_z;
- integer vf_alpha;
- integer vf_beta;
- memory_word tmp_w; /* accumulator */
+ char *new_font_name;
+ integer vf_z;
+ integer vf_alpha;
+ integer vf_beta;
+ memory_word tmp_w; /* accumulator */
- /* read a new font and expand the character widths */
- k = read_font_info(u, tex_font_name(f), get_nullstr(), font_size(f), font_natural_dir(f));
- set_no_ligatures(k); /* disable ligatures for letter-spaced fonts */
+ /* read a new font and expand the character widths */
+ k = read_font_info(u, tex_font_name(f), font_size(f), font_natural_dir(f));
+ set_no_ligatures(k); /* disable ligatures for letter-spaced fonts */
/*
for (i = 0;i <= font_widths(k);i++) {
set_font_width(k,i,font_width(f,i)+round_xn_over_d(quad(k), e, 1000));
}
*/
- /* append eg '+100ls' to font name */
- new_font_name = xmalloc(strlen(font_name(k)) + 8); /* |abs(e) <= 1000| */
- if (e > 0) {
- sprintf(new_font_name,"%s+%ils",font_name(k),(int)e);
- } else {
- /* minus from %i */
- sprintf(new_font_name,"%s%ils",font_name(k),(int)e);
- }
- set_font_name(k, new_font_name);
-
- /* create the corresponding virtual font */
- set_font_type(k,virtual_font_type);
-
- vf_z = font_size(f);
- vf_replace_z();
- w = round_xn_over_d(quad(f), e, 2000);
- if (w > 0) {
- tmp_b0 = 0;
- } else {
- tmp_b0 = 255;
- w = vf_alpha + w;
- }
- r = w*vf_beta;
- tmp_b1 = r / vf_z;
- r = r % vf_z;
- if (r == 0) {
- tmp_b2 = 0;
- } else {
- r = r * 256;
- tmp_b2 = r / vf_z;
+ /* append eg '+100ls' to font name */
+ new_font_name = xmalloc(strlen(font_name(k)) + 8); /* |abs(e) <= 1000| */
+ if (e > 0) {
+ sprintf(new_font_name, "%s+%ils", font_name(k), (int) e);
+ } else {
+ /* minus from %i */
+ sprintf(new_font_name, "%s%ils", font_name(k), (int) e);
+ }
+ set_font_name(k, new_font_name);
+
+ /* create the corresponding virtual font */
+ set_font_type(k, virtual_font_type);
+
+ vf_z = font_size(f);
+ vf_replace_z();
+ w = round_xn_over_d(quad(f), e, 2000);
+ if (w > 0) {
+ tmp_b0 = 0;
+ } else {
+ tmp_b0 = 255;
+ w = vf_alpha + w;
+ }
+ r = w * vf_beta;
+ tmp_b1 = r / vf_z;
r = r % vf_z;
- }
- if (r == 0) {
- tmp_b3 = 0;
- } else {
- r = r * 256;
- tmp_b3 = r / vf_z;
- }
- /*
- vf_packet_base[k] = new_vf_packet(k);
-
- for (c=font_bc(k);c<=font_ec(k);c++) {
- string_room(17);
- append_fnt_set(f);
- append_packet(right1 + 3);
- append_packet(tmp_b0);
- append_packet(tmp_b1);
- append_packet(tmp_b2);
- append_packet(tmp_b3);
-
- append_packet(set1);
- append_packet(c);
-
- append_packet(right1 + 3);
- append_packet(tmp_b0);
- append_packet(tmp_b1);
- append_packet(tmp_b2);
- append_packet(tmp_b3);
- s = make_string();
- store_packet(k, c, s);
- flush_str(s);
- }
-*/
- return k;
+ if (r == 0) {
+ tmp_b2 = 0;
+ } else {
+ r = r * 256;
+ tmp_b2 = r / vf_z;
+ r = r % vf_z;
+ }
+ if (r == 0) {
+ tmp_b3 = 0;
+ } else {
+ r = r * 256;
+ tmp_b3 = r / vf_z;
+ }
+ /*
+ vf_packet_base[k] = new_vf_packet(k);
+
+ for (c=font_bc(k);c<=font_ec(k);c++) {
+ string_room(17);
+ append_fnt_set(f);
+ append_packet(right1 + 3);
+ append_packet(tmp_b0);
+ append_packet(tmp_b1);
+ append_packet(tmp_b2);
+ append_packet(tmp_b3);
+
+ append_packet(set1);
+ append_packet(c);
+
+ append_packet(right1 + 3);
+ append_packet(tmp_b0);
+ append_packet(tmp_b1);
+ append_packet(tmp_b2);
+ append_packet(tmp_b3);
+ s = make_string();
+ store_packet(k, c, s);
+ flush_str(s);
+ }
+ */
+ return k;
}
+/* the fontname has [+-]\d+ls at the end */
+
+boolean is_letterspaced_font(internal_font_number f)
+{
+ char *i, *j;
+ if (font_type(f) != virtual_font_type)
+ return false;
+ j = font_name(f);
+ i = j + strlen(j);
+ if ((*(i - 1) != 'l') || (*i != 's'))
+ return false;
+ i = i - 2;
+ while (i >= j) {
+ if ((*i < '0') || (*i > '9'))
+ break;
+ i--;
+ }
+ if (i < j)
+ return false;
+ if ((*i != '+') && (*i != '-'))
+ return false;
+ return true;
+}
+/* TODO */
+
+internal_font_number copy_font_info(internal_font_number f)
+{
+ return copy_font(f);
+}
diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.c b/Build/source/texk/web2c/luatexdir/font/writecff.c
index 69c35c6950e..274c4ad1567 100644
--- a/Build/source/texk/web2c/luatexdir/font/writecff.c
+++ b/Build/source/texk/web2c/luatexdir/font/writecff.c
@@ -1,29 +1,29 @@
-/*
-Copyright (c) 2007 Taco Hoekwater, taco@luatex.org
-
-This file is part of luaTeX.
+/* writecff.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-luaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-luaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with luaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: writecff.c 1021 2008-02-14 10:24:34Z taco $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include "writecff.h"
+static const char _svn_version[] =
+ "$Id: writecff.c 1592 2008-11-28 13:23:51Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writecff.c $";
+
#define get_offset(s,n) get_unsigned(s, (n))
#define get_card8(a) a->stream[a->offset++]
#define get_card16(a) get_unsigned(a,2)
@@ -37,12 +37,12 @@ $Id: writecff.c 1021 2008-02-14 10:24:34Z taco $
static char work_buffer[WORK_BUFFER_SIZE];
-static unsigned long get_unsigned (cff_font *cff, int n)
+static unsigned long get_unsigned(cff_font * cff, int n)
{
- unsigned long v = 0;
- while (n-- > 0)
- v = v*256 + get_card8(cff);
- return v;
+ unsigned long v = 0;
+ while (n-- > 0)
+ v = v * 256 + get_card8(cff);
+ return v;
}
#define CFF_ERROR pdftex_fail
@@ -50,421 +50,454 @@ static unsigned long get_unsigned (cff_font *cff, int n)
const char *const cff_stdstr[CFF_STDSTR_MAX] = {
- ".notdef", "space", "exclam", "quotedbl", "numbersign",
- "dollar", "percent", "ampersand", "quoteright", "parenleft",
- "parenright", "asterisk", "plus", "comma", "hyphen",
- "period", "slash", "zero", "one", "two",
- "three", "four", "five", "six", "seven",
- "eight", "nine", "colon", "semicolon", "less",
- "equal", "greater", "question", "at", "A",
- "B", "C", "D", "E", "F",
- "G", "H", "I", "J", "K",
- "L", "M", "N", "O", "P",
- "Q", "R", "S", "T", "U",
- "V", "W", "X", "Y", "Z",
- "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
- "quoteleft", "a", "b", "c", "d",
- "e", "f", "g", "h", "i",
- "j", "k", "l", "m", "n",
- "o", "p", "q", "r", "s",
- "t", "u", "v", "w", "x",
- "y", "z", "braceleft", "bar", "braceright",
- "asciitilde", "exclamdown", "cent", "sterling", "fraction",
- "yen", "florin", "section", "currency", "quotesingle",
- "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi",
- "fl", "endash", "dagger", "daggerdbl", "periodcentered",
- "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright",
- "guillemotright", "ellipsis", "perthousand", "questiondown", "grave",
- "acute", "circumflex", "tilde", "macron", "breve",
- "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut",
- "ogonek", "caron", "emdash", "AE", "ordfeminine",
- "Lslash", "Oslash", "OE", "ordmasculine", "ae",
- "dotlessi", "lslash", "oslash", "oe", "germandbls",
- "onesuperior", "logicalnot", "mu", "trademark", "Eth",
- "onehalf", "plusminus", "Thorn", "onequarter", "divide",
- "brokenbar", "degree", "thorn", "threequarters", "twosuperior",
- "registered", "minus", "eth", "multiply", "threesuperior",
- "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave",
- "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex",
- "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis",
- "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis",
- "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex",
- "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron",
- "aacute", "acircumflex", "adieresis", "agrave", "aring",
- "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis",
- "egrave", "iacute", "icircumflex", "idieresis", "igrave",
- "ntilde", "oacute", "ocircumflex", "odieresis", "ograve",
- "otilde", "scaron", "uacute", "ucircumflex", "udieresis",
- "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall",
- "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall",
- "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle",
- "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle",
- "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior",
- "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior",
- "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior",
- "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior",
- "tsuperior", "ff", "ffi", "ffl", "parenleftinferior",
- "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall",
- "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall",
- "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall",
- "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall",
- "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall",
- "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall",
- "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall",
- "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall",
- "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash",
- "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall",
- "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird",
- "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior",
- "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior",
- "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior",
- "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior",
- "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall",
- "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall",
- "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall",
- "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall",
- "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall",
- "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall",
- "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall",
- "001.000", "001.001", "001.002", "001.003",
- "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"
+ ".notdef", "space", "exclam", "quotedbl", "numbersign",
+ "dollar", "percent", "ampersand", "quoteright", "parenleft",
+ "parenright", "asterisk", "plus", "comma", "hyphen",
+ "period", "slash", "zero", "one", "two",
+ "three", "four", "five", "six", "seven",
+ "eight", "nine", "colon", "semicolon", "less",
+ "equal", "greater", "question", "at", "A",
+ "B", "C", "D", "E", "F",
+ "G", "H", "I", "J", "K",
+ "L", "M", "N", "O", "P",
+ "Q", "R", "S", "T", "U",
+ "V", "W", "X", "Y", "Z",
+ "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
+ "quoteleft", "a", "b", "c", "d",
+ "e", "f", "g", "h", "i",
+ "j", "k", "l", "m", "n",
+ "o", "p", "q", "r", "s",
+ "t", "u", "v", "w", "x",
+ "y", "z", "braceleft", "bar", "braceright",
+ "asciitilde", "exclamdown", "cent", "sterling", "fraction",
+ "yen", "florin", "section", "currency", "quotesingle",
+ "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi",
+ "fl", "endash", "dagger", "daggerdbl", "periodcentered",
+ "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright",
+ "guillemotright", "ellipsis", "perthousand", "questiondown", "grave",
+ "acute", "circumflex", "tilde", "macron", "breve",
+ "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut",
+ "ogonek", "caron", "emdash", "AE", "ordfeminine",
+ "Lslash", "Oslash", "OE", "ordmasculine", "ae",
+ "dotlessi", "lslash", "oslash", "oe", "germandbls",
+ "onesuperior", "logicalnot", "mu", "trademark", "Eth",
+ "onehalf", "plusminus", "Thorn", "onequarter", "divide",
+ "brokenbar", "degree", "thorn", "threequarters", "twosuperior",
+ "registered", "minus", "eth", "multiply", "threesuperior",
+ "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave",
+ "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex",
+ "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis",
+ "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis",
+ "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex",
+ "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron",
+ "aacute", "acircumflex", "adieresis", "agrave", "aring",
+ "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis",
+ "egrave", "iacute", "icircumflex", "idieresis", "igrave",
+ "ntilde", "oacute", "ocircumflex", "odieresis", "ograve",
+ "otilde", "scaron", "uacute", "ucircumflex", "udieresis",
+ "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall",
+ "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall",
+ "Acutesmall",
+ "parenleftsuperior", "parenrightsuperior", "twodotenleader",
+ "onedotenleader", "zerooldstyle",
+ "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle",
+ "fiveoldstyle",
+ "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle",
+ "commasuperior",
+ "threequartersemdash", "periodsuperior", "questionsmall", "asuperior",
+ "bsuperior",
+ "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior",
+ "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior",
+ "tsuperior", "ff", "ffi", "ffl", "parenleftinferior",
+ "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall",
+ "Asmall",
+ "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall",
+ "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall",
+ "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall",
+ "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall",
+ "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall",
+ "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall",
+ "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall",
+ "Dieresissmall",
+ "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash",
+ "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall",
+ "questiondownsmall",
+ "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird",
+ "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior",
+ "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior",
+ "oneinferior",
+ "twoinferior", "threeinferior", "fourinferior", "fiveinferior",
+ "sixinferior",
+ "seveninferior", "eightinferior", "nineinferior", "centinferior",
+ "dollarinferior",
+ "periodinferior", "commainferior", "Agravesmall", "Aacutesmall",
+ "Acircumflexsmall",
+ "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall",
+ "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall",
+ "Igravesmall",
+ "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall",
+ "Ntildesmall",
+ "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall",
+ "Odieresissmall",
+ "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall",
+ "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall",
+ "001.000", "001.001", "001.002", "001.003",
+ "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"
};
/* Only read header part but not body */
-cff_index *
-cff_get_index_header (cff_font *cff)
+cff_index *cff_get_index_header(cff_font * cff)
{
- cff_index *idx;
- card16 i, count;
+ cff_index *idx;
+ card16 i, count;
- idx = xcalloc(1, sizeof(cff_index));
+ idx = xcalloc(1, sizeof(cff_index));
- idx->count = count = get_card16(cff);
- if (count > 0) {
- idx->offsize = get_card8(cff);
- if (idx->offsize < 1 || idx->offsize > 4)
- CFF_ERROR("invalid offsize data");
+ idx->count = count = get_card16(cff);
+ if (count > 0) {
+ idx->offsize = get_card8(cff);
+ if (idx->offsize < 1 || idx->offsize > 4)
+ CFF_ERROR("invalid offsize data");
- idx->offset = xcalloc(count+1, sizeof(l_offset));
- for (i=0;i<count+1;i++) {
- (idx->offset)[i] = get_offset(cff, idx->offsize);
- }
+ idx->offset = xcalloc(count + 1, sizeof(l_offset));
+ for (i = 0; i < count + 1; i++) {
+ (idx->offset)[i] = get_offset(cff, idx->offsize);
+ }
- if (idx->offset[0] != 1)
- CFF_ERROR("cff_get_index(): invalid index data");
+ if (idx->offset[0] != 1)
+ CFF_ERROR("cff_get_index(): invalid index data");
- idx->data = NULL;
- } else {
- idx->offsize = 0;
- idx->offset = NULL;
- idx->data = NULL;
- }
+ idx->data = NULL;
+ } else {
+ idx->offsize = 0;
+ idx->offset = NULL;
+ idx->data = NULL;
+ }
- return idx;
+ return idx;
}
-cff_index *
-cff_get_index (cff_font *cff)
+cff_index *cff_get_index(cff_font * cff)
{
- cff_index *idx;
- card16 i, count;
- long length;
+ cff_index *idx;
+ card16 i, count;
+ long length;
- idx = xcalloc(1,sizeof(cff_index));
+ idx = xcalloc(1, sizeof(cff_index));
- idx->count = count = get_card16(cff);
- if (count > 0) {
- idx->offsize = get_card8(cff);
- if (idx->offsize < 1 || idx->offsize > 4)
- CFF_ERROR("invalid offsize data");
+ idx->count = count = get_card16(cff);
+ if (count > 0) {
+ idx->offsize = get_card8(cff);
+ if (idx->offsize < 1 || idx->offsize > 4)
+ CFF_ERROR("invalid offsize data");
- idx->offset = xcalloc((count + 1),sizeof(l_offset));
- for (i = 0 ; i < count + 1; i++) {
- idx->offset[i] = get_offset(cff, idx->offsize);
- }
+ idx->offset = xcalloc((count + 1), sizeof(l_offset));
+ for (i = 0; i < count + 1; i++) {
+ idx->offset[i] = get_offset(cff, idx->offsize);
+ }
- if (idx->offset[0] != 1)
- CFF_ERROR("Invalid CFF Index offset data");
+ if (idx->offset[0] != 1)
+ CFF_ERROR("Invalid CFF Index offset data");
- length = idx->offset[count] - idx->offset[0];
+ length = idx->offset[count] - idx->offset[0];
- idx->data = xcalloc(length,sizeof(card8));
- memcpy(idx->data,&cff->stream[cff->offset],length);
- cff->offset += length;
+ idx->data = xcalloc(length, sizeof(card8));
+ memcpy(idx->data, &cff->stream[cff->offset], length);
+ cff->offset += length;
- } else {
- idx->offsize = 0;
- idx->offset = NULL;
- idx->data = NULL;
- }
- return idx;
+ } else {
+ idx->offsize = 0;
+ idx->offset = NULL;
+ idx->data = NULL;
+ }
+ return idx;
}
-long
-cff_pack_index (cff_index *idx, card8 *dest, long destlen)
+long cff_pack_index(cff_index * idx, card8 * dest, long destlen)
{
- long len = 0;
- unsigned long datalen;
- card16 i;
+ long len = 0;
+ unsigned long datalen;
+ card16 i;
- if (idx->count < 1) {
- if (destlen < 2)
- CFF_ERROR("Not enough space available...");
- memset(dest, 0, 2);
- return 2;
- }
+ if (idx->count < 1) {
+ if (destlen < 2)
+ CFF_ERROR("Not enough space available...");
+ memset(dest, 0, 2);
+ return 2;
+ }
- len = cff_index_size(idx);
- datalen = idx->offset[idx->count] - 1;
+ len = cff_index_size(idx);
+ datalen = idx->offset[idx->count] - 1;
- if (destlen < len)
- CFF_ERROR("Not enough space available...");
+ if (destlen < len)
+ CFF_ERROR("Not enough space available...");
- *(dest++) = (idx->count >> 8) & 0xff;
- *(dest++) = idx->count & 0xff;
+ *(dest++) = (idx->count >> 8) & 0xff;
+ *(dest++) = idx->count & 0xff;
- if (datalen < 0xffUL) {
- idx->offsize = 1;
- *(dest++) = 1;
- for (i = 0; i <= idx->count; i++) {
- *(dest++) = (card8) (idx->offset[i] & 0xff);
- }
- } else if (datalen < 0xffffUL) {
- idx->offsize = 2;
- *(dest++) = 2;
- for (i = 0; i <= idx->count; i++) {
- *(dest++) = (card8) ((idx->offset[i] >> 8) & 0xff);
- *(dest++) = (card8) ( idx->offset[i] & 0xff);
- }
- } else if (datalen < 0xffffffUL) {
- idx->offsize = 3;
- *(dest++) = 3;
- for (i = 0; i <= idx->count; i++) {
- *(dest++) = (card8)((idx->offset[i] >> 16) & 0xff);
- *(dest++) = (card8)((idx->offset[i] >> 8) & 0xff);
- *(dest++) = (card8)(idx->offset[i] & 0xff);
- }
- } else {
- idx->offsize = 4;
- *(dest++) = 4;
- for (i = 0; i <= idx->count; i++) {
- *(dest++) = (card8)((idx->offset[i] >> 24) & 0xff);
- *(dest++) = (card8)((idx->offset[i] >> 16) & 0xff);
- *(dest++) = (card8)((idx->offset[i] >> 8) & 0xff);
- *(dest++) = (card8)(idx->offset[i] & 0xff);
+ if (datalen < 0xffUL) {
+ idx->offsize = 1;
+ *(dest++) = 1;
+ for (i = 0; i <= idx->count; i++) {
+ *(dest++) = (card8) (idx->offset[i] & 0xff);
+ }
+ } else if (datalen < 0xffffUL) {
+ idx->offsize = 2;
+ *(dest++) = 2;
+ for (i = 0; i <= idx->count; i++) {
+ *(dest++) = (card8) ((idx->offset[i] >> 8) & 0xff);
+ *(dest++) = (card8) (idx->offset[i] & 0xff);
+ }
+ } else if (datalen < 0xffffffUL) {
+ idx->offsize = 3;
+ *(dest++) = 3;
+ for (i = 0; i <= idx->count; i++) {
+ *(dest++) = (card8) ((idx->offset[i] >> 16) & 0xff);
+ *(dest++) = (card8) ((idx->offset[i] >> 8) & 0xff);
+ *(dest++) = (card8) (idx->offset[i] & 0xff);
+ }
+ } else {
+ idx->offsize = 4;
+ *(dest++) = 4;
+ for (i = 0; i <= idx->count; i++) {
+ *(dest++) = (card8) ((idx->offset[i] >> 24) & 0xff);
+ *(dest++) = (card8) ((idx->offset[i] >> 16) & 0xff);
+ *(dest++) = (card8) ((idx->offset[i] >> 8) & 0xff);
+ *(dest++) = (card8) (idx->offset[i] & 0xff);
+ }
}
- }
- memmove(dest, idx->data, idx->offset[idx->count] - 1);
+ memmove(dest, idx->data, idx->offset[idx->count] - 1);
- return len;
+ return len;
}
-long
-cff_index_size (cff_index *idx)
+long cff_index_size(cff_index * idx)
{
- if (idx->count > 0) {
- l_offset datalen;
-
- datalen = idx->offset[idx->count] - 1;
- if (datalen < 0xffUL) {
- idx->offsize = 1;
- } else if (datalen < 0xffffUL) {
- idx->offsize = 2;
- } else if (datalen < 0xffffffUL) {
- idx->offsize = 3;
+ if (idx->count > 0) {
+ l_offset datalen;
+
+ datalen = idx->offset[idx->count] - 1;
+ if (datalen < 0xffUL) {
+ idx->offsize = 1;
+ } else if (datalen < 0xffffUL) {
+ idx->offsize = 2;
+ } else if (datalen < 0xffffffUL) {
+ idx->offsize = 3;
+ } else {
+ idx->offsize = 4;
+ }
+ return (3 + (idx->offsize) * (idx->count + 1) + datalen);
} else {
- idx->offsize = 4;
+ return 2;
}
- return (3 + (idx->offsize)*(idx->count + 1) + datalen);
- } else {
- return 2;
- }
}
-cff_index *cff_new_index (card16 count)
+cff_index *cff_new_index(card16 count)
{
- cff_index *idx;
+ cff_index *idx;
- idx = xcalloc(1, sizeof(cff_index));
- idx->count = count;
- idx->offsize = 0;
+ idx = xcalloc(1, sizeof(cff_index));
+ idx->count = count;
+ idx->offsize = 0;
- if (count > 0) {
- idx->offset = xcalloc(count + 1, sizeof(l_offset));
- (idx->offset)[0] = 1;
- } else {
- idx->offset = NULL;
- }
- idx->data = NULL;
+ if (count > 0) {
+ idx->offset = xcalloc(count + 1, sizeof(l_offset));
+ (idx->offset)[0] = 1;
+ } else {
+ idx->offset = NULL;
+ }
+ idx->data = NULL;
- return idx;
+ return idx;
}
-void cff_release_index (cff_index *idx)
+void cff_release_index(cff_index * idx)
{
- if (idx) {
- xfree(idx->data);
- xfree(idx->offset);
- xfree(idx);
- }
+ if (idx) {
+ xfree(idx->data);
+ xfree(idx->offset);
+ xfree(idx);
+ }
}
-void cff_release_dict (cff_dict *dict)
+void cff_release_dict(cff_dict * dict)
{
- if (dict) {
- if (dict->entries) {
- int i;
- for (i=0;i<dict->count;i++) {
- xfree((dict->entries)[i].values);
- }
- xfree(dict->entries);
- }
- xfree(dict);
- }
+ if (dict) {
+ if (dict->entries) {
+ int i;
+ for (i = 0; i < dict->count; i++) {
+ xfree((dict->entries)[i].values);
+ }
+ xfree(dict->entries);
+ }
+ xfree(dict);
+ }
}
-void cff_release_encoding (cff_encoding *encoding)
+void cff_release_encoding(cff_encoding * encoding)
{
- if (encoding) {
- switch (encoding->format & (~0x80)) {
- case 0: xfree(encoding->data.codes); break;
- case 1: xfree(encoding->data.range1); break;
- default: CFF_ERROR("Unknown Encoding format.");
+ if (encoding) {
+ switch (encoding->format & (~0x80)) {
+ case 0:
+ xfree(encoding->data.codes);
+ break;
+ case 1:
+ xfree(encoding->data.range1);
+ break;
+ default:
+ CFF_ERROR("Unknown Encoding format.");
+ }
+ if (encoding->format & 0x80)
+ xfree(encoding->supp);
+ xfree(encoding);
}
- if (encoding->format & 0x80)
- xfree(encoding->supp);
- xfree(encoding);
- }
}
-void
-cff_release_charsets (cff_charsets *charset)
+void cff_release_charsets(cff_charsets * charset)
{
- if (charset) {
- switch (charset->format) {
- case 0: xfree(charset->data.glyphs); break;
- case 1: xfree(charset->data.range1); break;
- case 2: xfree(charset->data.range2); break;
- default: break;
+ if (charset) {
+ switch (charset->format) {
+ case 0:
+ xfree(charset->data.glyphs);
+ break;
+ case 1:
+ xfree(charset->data.range1);
+ break;
+ case 2:
+ xfree(charset->data.range2);
+ break;
+ default:
+ break;
+ }
+ xfree(charset);
}
- xfree(charset);
- }
}
-void cff_release_fdselect (cff_fdselect *fdselect)
+void cff_release_fdselect(cff_fdselect * fdselect)
{
- if (fdselect) {
- if (fdselect->format == 0) { xfree(fdselect->data.fds); }
- else if (fdselect->format == 3) { xfree(fdselect->data.ranges); }
- xfree(fdselect);
- }
+ if (fdselect) {
+ if (fdselect->format == 0) {
+ xfree(fdselect->data.fds);
+ } else if (fdselect->format == 3) {
+ xfree(fdselect->data.ranges);
+ }
+ xfree(fdselect);
+ }
}
-void
-cff_close (cff_font *cff)
+void cff_close(cff_font * cff)
{
- card16 i;
-
- if (cff) {
- if (cff->fontname) xfree(cff->fontname);
- if (cff->name) cff_release_index(cff->name);
- if (cff->topdict) cff_release_dict(cff->topdict);
- if (cff->string) cff_release_index(cff->string);
- if (cff->gsubr) cff_release_index(cff->gsubr);
- if (cff->encoding) cff_release_encoding(cff->encoding);
- if (cff->charsets) cff_release_charsets(cff->charsets);
- if (cff->fdselect) cff_release_fdselect(cff->fdselect);
- if (cff->cstrings) cff_release_index(cff->cstrings);
- if (cff->fdarray) {
- for (i=0;i<cff->num_fds;i++) {
- if (cff->fdarray[i]) cff_release_dict(cff->fdarray[i]);
- }
- xfree(cff->fdarray);
- }
- if (cff->private) {
- for (i=0;i<cff->num_fds;i++) {
- if (cff->private[i]) cff_release_dict(cff->private[i]);
- }
- xfree(cff->private);
- }
- if (cff->subrs) {
- for (i=0;i<cff->num_fds;i++) {
- if (cff->subrs[i]) cff_release_index(cff->subrs[i]);
- }
- xfree(cff->subrs);
- }
- if (cff->_string)
- cff_release_index(cff->_string);
- xfree(cff);
- }
+ card16 i;
+
+ if (cff) {
+ if (cff->fontname)
+ xfree(cff->fontname);
+ if (cff->name)
+ cff_release_index(cff->name);
+ if (cff->topdict)
+ cff_release_dict(cff->topdict);
+ if (cff->string)
+ cff_release_index(cff->string);
+ if (cff->gsubr)
+ cff_release_index(cff->gsubr);
+ if (cff->encoding)
+ cff_release_encoding(cff->encoding);
+ if (cff->charsets)
+ cff_release_charsets(cff->charsets);
+ if (cff->fdselect)
+ cff_release_fdselect(cff->fdselect);
+ if (cff->cstrings)
+ cff_release_index(cff->cstrings);
+ if (cff->fdarray) {
+ for (i = 0; i < cff->num_fds; i++) {
+ if (cff->fdarray[i])
+ cff_release_dict(cff->fdarray[i]);
+ }
+ xfree(cff->fdarray);
+ }
+ if (cff->private) {
+ for (i = 0; i < cff->num_fds; i++) {
+ if (cff->private[i])
+ cff_release_dict(cff->private[i]);
+ }
+ xfree(cff->private);
+ }
+ if (cff->subrs) {
+ for (i = 0; i < cff->num_fds; i++) {
+ if (cff->subrs[i])
+ cff_release_index(cff->subrs[i]);
+ }
+ xfree(cff->subrs);
+ }
+ if (cff->_string)
+ cff_release_index(cff->_string);
+ xfree(cff);
+ }
- return;
+ return;
}
-char *
-cff_get_name (cff_font *cff)
+char *cff_get_name(cff_font * cff)
{
- char *fontname;
- l_offset len;
- cff_index *idx;
+ char *fontname;
+ l_offset len;
+ cff_index *idx;
- idx = cff->name;
- len = idx->offset[cff->index + 1] - idx->offset[cff->index];
- fontname = xmalloc((len + 1)*sizeof(char));
- memcpy(fontname, idx->data + idx->offset[cff->index] - 1, len);
- fontname[len] = '\0';
+ idx = cff->name;
+ len = idx->offset[cff->index + 1] - idx->offset[cff->index];
+ fontname = xmalloc((len + 1) * sizeof(char));
+ memcpy(fontname, idx->data + idx->offset[cff->index] - 1, len);
+ fontname[len] = '\0';
- return fontname;
+ return fontname;
}
-long
-cff_set_name (cff_font *cff, char *name)
+long cff_set_name(cff_font * cff, char *name)
{
- cff_index *idx;
+ cff_index *idx;
- if (strlen(name) > 127)
- CFF_ERROR("FontName string length too large...");
+ if (strlen(name) > 127)
+ CFF_ERROR("FontName string length too large...");
- if (cff->name)
- cff_release_index(cff->name);
+ if (cff->name)
+ cff_release_index(cff->name);
- cff->name = idx = xcalloc(1, sizeof(cff_index));
- idx->count = 1;
- idx->offsize = 1;
- idx->offset = xmalloc(2*sizeof(l_offset));
- (idx->offset)[0] = 1;
- (idx->offset)[1] = strlen(name) + 1;
- idx->data = xcalloc(strlen(name), sizeof(card8));
- memmove(idx->data, name, strlen(name)); /* no trailing '\0' */
+ cff->name = idx = xcalloc(1, sizeof(cff_index));
+ idx->count = 1;
+ idx->offsize = 1;
+ idx->offset = xmalloc(2 * sizeof(l_offset));
+ (idx->offset)[0] = 1;
+ (idx->offset)[1] = strlen(name) + 1;
+ idx->data = xcalloc(strlen(name), sizeof(card8));
+ memmove(idx->data, name, strlen(name)); /* no trailing '\0' */
- return 5 + strlen(name);
+ return 5 + strlen(name);
}
-long
-cff_put_header (cff_font *cff, card8 *dest, long destlen)
+long cff_put_header(cff_font * cff, card8 * dest, long destlen)
{
- if (destlen < 4)
- CFF_ERROR("Not enough space available...");
-
- *(dest++) = cff->header_major;
- *(dest++) = cff->header_minor;
- *(dest++) = 4; /* Additional data in between header and
- * Name INDEX ignored.
- */
- /* We will set all offset (0) to four-byte integer. */
- *(dest++) = 4;
- cff->header_offsize = 4;
-
- return 4;
+ if (destlen < 4)
+ CFF_ERROR("Not enough space available...");
+
+ *(dest++) = cff->header_major;
+ *(dest++) = cff->header_minor;
+ *(dest++) = 4; /* Additional data in between header and
+ * Name INDEX ignored.
+ */
+ /* We will set all offset (0) to four-byte integer. */
+ *(dest++) = 4;
+ cff->header_offsize = 4;
+
+ return 4;
}
#define CFF_PARSE_OK 0
@@ -475,15 +508,15 @@ cff_put_header (cff_font *cff, card8 *dest, long destlen)
#define DICT_ENTRY_MAX 16
-cff_dict *cff_new_dict (void)
+cff_dict *cff_new_dict(void)
{
- cff_dict *dict;
+ cff_dict *dict;
- dict = xcalloc(1, sizeof(cff_dict));
- dict->max = DICT_ENTRY_MAX;
- dict->count = 0;
- dict->entries = xcalloc(dict->max, sizeof(cff_dict_entry));
- return dict;
+ dict = xcalloc(1, sizeof(cff_dict));
+ dict->max = DICT_ENTRY_MAX;
+ dict->count = 0;
+ dict->entries = xcalloc(dict->max, sizeof(cff_dict_entry));
+ return dict;
}
/*
@@ -500,7 +533,7 @@ cff_dict *cff_new_dict (void)
*/
#define CFF_DICT_STACK_LIMIT 64
-static int stack_top = 0;
+static int stack_top = 0;
static double arg_stack[CFF_DICT_STACK_LIMIT];
/*
@@ -513,231 +546,239 @@ static double arg_stack[CFF_DICT_STACK_LIMIT];
#define CFF_LAST_DICT_OP (CFF_LAST_DICT_OP1 + CFF_LAST_DICT_OP2)
static struct {
- const char *opname;
- int argtype;
+ const char *opname;
+ int argtype;
} dict_operator[CFF_LAST_DICT_OP] = {
- {"version", CFF_TYPE_SID},
- {"Notice", CFF_TYPE_SID},
- {"FullName", CFF_TYPE_SID},
- {"FamilyName", CFF_TYPE_SID},
- {"Weight", CFF_TYPE_SID},
- {"FontBBox", CFF_TYPE_ARRAY},
- {"BlueValues", CFF_TYPE_DELTA},
- {"OtherBlues", CFF_TYPE_DELTA},
- {"FamilyBlues", CFF_TYPE_DELTA},
- {"FamilyOtherBlues", CFF_TYPE_DELTA},
- {"StdHW", CFF_TYPE_NUMBER},
- {"StdVW", CFF_TYPE_NUMBER},
- {NULL, -1}, /* first byte of two-byte operator */
- /* Top */
- {"UniqueID", CFF_TYPE_NUMBER},
- {"XUID", CFF_TYPE_ARRAY},
- {"charset", CFF_TYPE_OFFSET},
- {"Encoding", CFF_TYPE_OFFSET},
- {"CharStrings", CFF_TYPE_OFFSET},
- {"Private", CFF_TYPE_SZOFF}, /* two numbers (size and offset) */
- /* Private */
- {"Subrs", CFF_TYPE_OFFSET},
- {"defaultWidthX", CFF_TYPE_NUMBER},
- {"nominalWidthX", CFF_TYPE_NUMBER},
- /* Operator 2 */
- {"Copyright", CFF_TYPE_SID},
- {"IsFixedPitch", CFF_TYPE_BOOLEAN},
- {"ItalicAngle", CFF_TYPE_NUMBER},
- {"UnderlinePosition", CFF_TYPE_NUMBER},
- {"UnderlineThickness", CFF_TYPE_NUMBER},
- {"PaintType", CFF_TYPE_NUMBER},
- {"CharstringType", CFF_TYPE_NUMBER},
- {"FontMatrix", CFF_TYPE_ARRAY},
- {"StrokeWidth", CFF_TYPE_NUMBER},
- {"BlueScale", CFF_TYPE_NUMBER},
- {"BlueShift", CFF_TYPE_NUMBER},
- {"BlueFuzz", CFF_TYPE_NUMBER},
- {"StemSnapH", CFF_TYPE_DELTA},
- {"StemSnapV", CFF_TYPE_DELTA},
- {"ForceBold", CFF_TYPE_BOOLEAN},
- {NULL, -1},
- {NULL, -1},
- {"LanguageGroup", CFF_TYPE_NUMBER},
- {"ExpansionFactor", CFF_TYPE_NUMBER},
- {"InitialRandomSeed", CFF_TYPE_NUMBER},
- {"SyntheticBase", CFF_TYPE_NUMBER},
- {"PostScript", CFF_TYPE_SID},
- {"BaseFontName", CFF_TYPE_SID},
- {"BaseFontBlend", CFF_TYPE_DELTA}, /* MMaster ? */
- {NULL, -1},
- {NULL, -1},
- {NULL, -1},
- {NULL, -1},
- {NULL, -1},
- {NULL, -1},
- /* CID-Keyed font */
- {"ROS", CFF_TYPE_ROS}, /* SID SID number */
- {"CIDFontVersion", CFF_TYPE_NUMBER},
- {"CIDFontRevision", CFF_TYPE_NUMBER},
- {"CIDFontType", CFF_TYPE_NUMBER},
- {"CIDCount", CFF_TYPE_NUMBER},
- {"UIDBase", CFF_TYPE_NUMBER},
- {"FDArray", CFF_TYPE_OFFSET},
- {"FDSelect", CFF_TYPE_OFFSET},
- {"FontName", CFF_TYPE_SID},
-};
+ {
+ "version", CFF_TYPE_SID}, {
+ "Notice", CFF_TYPE_SID}, {
+ "FullName", CFF_TYPE_SID}, {
+ "FamilyName", CFF_TYPE_SID}, {
+ "Weight", CFF_TYPE_SID}, {
+ "FontBBox", CFF_TYPE_ARRAY}, {
+ "BlueValues", CFF_TYPE_DELTA}, {
+ "OtherBlues", CFF_TYPE_DELTA}, {
+ "FamilyBlues", CFF_TYPE_DELTA}, {
+ "FamilyOtherBlues", CFF_TYPE_DELTA}, {
+ "StdHW", CFF_TYPE_NUMBER}, {
+ "StdVW", CFF_TYPE_NUMBER}, {
+ NULL, -1}, /* first byte of two-byte operator */
+ /* Top */
+ {
+ "UniqueID", CFF_TYPE_NUMBER}, {
+ "XUID", CFF_TYPE_ARRAY}, {
+ "charset", CFF_TYPE_OFFSET}, {
+ "Encoding", CFF_TYPE_OFFSET}, {
+ "CharStrings", CFF_TYPE_OFFSET}, {
+ "Private", CFF_TYPE_SZOFF}, /* two numbers (size and offset) */
+ /* Private */
+ {
+ "Subrs", CFF_TYPE_OFFSET}, {
+ "defaultWidthX", CFF_TYPE_NUMBER}, {
+ "nominalWidthX", CFF_TYPE_NUMBER},
+ /* Operator 2 */
+ {
+ "Copyright", CFF_TYPE_SID}, {
+ "IsFixedPitch", CFF_TYPE_BOOLEAN}, {
+ "ItalicAngle", CFF_TYPE_NUMBER}, {
+ "UnderlinePosition", CFF_TYPE_NUMBER}, {
+ "UnderlineThickness", CFF_TYPE_NUMBER}, {
+ "PaintType", CFF_TYPE_NUMBER}, {
+ "CharstringType", CFF_TYPE_NUMBER}, {
+ "FontMatrix", CFF_TYPE_ARRAY}, {
+ "StrokeWidth", CFF_TYPE_NUMBER}, {
+ "BlueScale", CFF_TYPE_NUMBER}, {
+ "BlueShift", CFF_TYPE_NUMBER}, {
+ "BlueFuzz", CFF_TYPE_NUMBER}, {
+ "StemSnapH", CFF_TYPE_DELTA}, {
+ "StemSnapV", CFF_TYPE_DELTA}, {
+ "ForceBold", CFF_TYPE_BOOLEAN}, {
+ NULL, -1}, {
+ NULL, -1}, {
+ "LanguageGroup", CFF_TYPE_NUMBER}, {
+ "ExpansionFactor", CFF_TYPE_NUMBER}, {
+ "InitialRandomSeed", CFF_TYPE_NUMBER}, {
+ "SyntheticBase", CFF_TYPE_NUMBER}, {
+ "PostScript", CFF_TYPE_SID}, {
+ "BaseFontName", CFF_TYPE_SID}, {
+ "BaseFontBlend", CFF_TYPE_DELTA}, /* MMaster ? */
+ {
+ NULL, -1}, {
+ NULL, -1}, {
+ NULL, -1}, {
+ NULL, -1}, {
+ NULL, -1}, {
+ NULL, -1},
+ /* CID-Keyed font */
+ {
+ "ROS", CFF_TYPE_ROS}, /* SID SID number */
+ {
+ "CIDFontVersion", CFF_TYPE_NUMBER}, {
+ "CIDFontRevision", CFF_TYPE_NUMBER}, {
+ "CIDFontType", CFF_TYPE_NUMBER}, {
+ "CIDCount", CFF_TYPE_NUMBER}, {
+ "UIDBase", CFF_TYPE_NUMBER}, {
+ "FDArray", CFF_TYPE_OFFSET}, {
+ "FDSelect", CFF_TYPE_OFFSET}, {
+"FontName", CFF_TYPE_SID},};
/* Parse DICT data */
-static double get_integer (card8 **data, card8 *endptr, int *status)
+static double get_integer(card8 ** data, card8 * endptr, int *status)
{
- long result = 0;
- card8 b0, b1, b2;
-
- b0 = *(*data)++;
- if (b0 == 28 && *data < endptr - 2) { /* shortint */
- b1 = *(*data)++;
- b2 = *(*data)++;
- result = b1*256+b2;
- if (result > 0x7fffL)
- result -= 0x10000L;
- } else if (b0 == 29 && *data < endptr - 4) { /* longint */
- int i;
- result = *(*data)++;
- if (result > 0x7f)
- result -= 0x100;
- for (i=0;i<3;i++) {
- result = result*256+(**data);
- *data += 1;
- }
- } else if (b0 >= 32 && b0 <= 246) { /* int (1) */
- result = b0 - 139;
- } else if (b0 >= 247 && b0 <= 250) { /* int (2) */
- b1 = *(*data)++;
- result = (b0-247)*256+b1+108;
- } else if (b0 >= 251 && b0 <= 254) {
- b1 = *(*data)++;
- result = -(b0-251)*256-b1-108;
- } else {
- *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
- }
+ long result = 0;
+ card8 b0, b1, b2;
+
+ b0 = *(*data)++;
+ if (b0 == 28 && *data < endptr - 2) { /* shortint */
+ b1 = *(*data)++;
+ b2 = *(*data)++;
+ result = b1 * 256 + b2;
+ if (result > 0x7fffL)
+ result -= 0x10000L;
+ } else if (b0 == 29 && *data < endptr - 4) { /* longint */
+ int i;
+ result = *(*data)++;
+ if (result > 0x7f)
+ result -= 0x100;
+ for (i = 0; i < 3; i++) {
+ result = result * 256 + (**data);
+ *data += 1;
+ }
+ } else if (b0 >= 32 && b0 <= 246) { /* int (1) */
+ result = b0 - 139;
+ } else if (b0 >= 247 && b0 <= 250) { /* int (2) */
+ b1 = *(*data)++;
+ result = (b0 - 247) * 256 + b1 + 108;
+ } else if (b0 >= 251 && b0 <= 254) {
+ b1 = *(*data)++;
+ result = -(b0 - 251) * 256 - b1 - 108;
+ } else {
+ *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
+ }
- return (double) result;
+ return (double) result;
}
/* Simply uses strtod */
-static double get_real(card8 **data, card8 *endptr, int *status)
+static double get_real(card8 ** data, card8 * endptr, int *status)
{
- double result = 0.0;
- int nibble = 0, pos = 0;
- int len = 0, fail = 0;
-
- if (**data != 30 || *data >= endptr -1) {
- *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
- return 0.0;
- }
-
- *data += 1; /* skip first byte (30) */
-
- pos = 0;
- while ((! fail) && len < WORK_BUFFER_SIZE - 2 && *data < endptr) {
- /* get nibble */
- if (pos % 2) {
- nibble = **data & 0x0f;
- *data += 1;
+ double result = 0.0;
+ int nibble = 0, pos = 0;
+ int len = 0, fail = 0;
+
+ if (**data != 30 || *data >= endptr - 1) {
+ *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
+ return 0.0;
+ }
+
+ *data += 1; /* skip first byte (30) */
+
+ pos = 0;
+ while ((!fail) && len < WORK_BUFFER_SIZE - 2 && *data < endptr) {
+ /* get nibble */
+ if (pos % 2) {
+ nibble = **data & 0x0f;
+ *data += 1;
+ } else {
+ nibble = (**data >> 4) & 0x0f;
+ }
+ if (nibble >= 0x00 && nibble <= 0x09) {
+ work_buffer[len++] = nibble + '0';
+ } else if (nibble == 0x0a) { /* . */
+ work_buffer[len++] = '.';
+ } else if (nibble == 0x0b || nibble == 0x0c) { /* E, E- */
+ work_buffer[len++] = 'e';
+ if (nibble == 0x0c)
+ work_buffer[len++] = '-';
+ } else if (nibble == 0x0e) { /* `-' */
+ work_buffer[len++] = '-';
+ } else if (nibble == 0x0d) { /* skip */
+ /* do nothing */
+ } else if (nibble == 0x0f) { /* end */
+ work_buffer[len++] = '\0';
+ if (((pos % 2) == 0) && (**data != 0xff)) {
+ fail = 1;
+ }
+ break;
+ } else { /* invalid */
+ fail = 1;
+ }
+ pos++;
+ }
+
+ /* returned values */
+ if (fail || nibble != 0x0f) {
+ *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
} else {
- nibble = (**data >> 4) & 0x0f;
- }
- if (nibble >= 0x00 && nibble <= 0x09) {
- work_buffer[len++] = nibble + '0';
- } else if (nibble == 0x0a) { /* . */
- work_buffer[len++] = '.';
- } else if (nibble == 0x0b || nibble == 0x0c) { /* E, E- */
- work_buffer[len++] = 'e';
- if (nibble == 0x0c)
- work_buffer[len++] = '-';
- } else if (nibble == 0x0e) { /* `-' */
- work_buffer[len++] = '-';
- } else if (nibble == 0x0d) { /* skip */
- /* do nothing */
- } else if (nibble == 0x0f) { /* end */
- work_buffer[len++] = '\0';
- if (((pos % 2) == 0) && (**data != 0xff)) {
- fail = 1;
- }
- break;
- } else { /* invalid */
- fail = 1;
- }
- pos++;
- }
-
- /* returned values */
- if (fail || nibble != 0x0f) {
- *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
- } else {
- char *s;
- result = strtod(work_buffer, &s);
- if (*s != 0 || errno == ERANGE) {
- *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
+ char *s;
+ result = strtod(work_buffer, &s);
+ if (*s != 0 || errno == ERANGE) {
+ *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
+ }
}
- }
- return result;
+ return result;
}
/* operators */
-static void add_dict (cff_dict *dict,
- card8 **data, card8 *endptr, int *status)
+static void add_dict(cff_dict * dict,
+ card8 ** data, card8 * endptr, int *status)
{
- int id, argtype;
+ int id, argtype;
+
+ id = **data;
+ if (id == 0x0c) {
+ *data += 1;
+ if (*data >= endptr ||
+ (id = **data + CFF_LAST_DICT_OP1) >= CFF_LAST_DICT_OP) {
+ *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
+ return;
+ }
+ } else if (id >= CFF_LAST_DICT_OP1) {
+ *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
+ return;
+ }
+
+ argtype = dict_operator[id].argtype;
+ if (dict_operator[id].opname == NULL || argtype < 0) {
+ *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
+ return;
+ } else if (stack_top < 1) {
+ *status = CFF_CFF_ERROR_STACK_UNDERFLOW;
+ return;
+ }
+
+ if (dict->count >= dict->max) {
+ dict->max += DICT_ENTRY_MAX;
+ /* not zeroed! */
+ dict->entries =
+ xrealloc(dict->entries, dict->max * sizeof(cff_dict_entry));
+ }
+
+ (dict->entries)[dict->count].id = id;
+ (dict->entries)[dict->count].key = (char *) dict_operator[id].opname;
+ if (argtype == CFF_TYPE_NUMBER ||
+ argtype == CFF_TYPE_BOOLEAN ||
+ argtype == CFF_TYPE_SID || argtype == CFF_TYPE_OFFSET) {
+ stack_top--;
+ (dict->entries)[dict->count].count = 1;
+ (dict->entries)[dict->count].values = xcalloc(1, sizeof(double));
+ (dict->entries)[dict->count].values[0] = arg_stack[stack_top];
+ } else {
+ (dict->entries)[dict->count].count = stack_top;
+ (dict->entries)[dict->count].values =
+ xcalloc(stack_top, sizeof(double));
+ while (stack_top > 0) {
+ stack_top--;
+ (dict->entries)[dict->count].values[stack_top] =
+ arg_stack[stack_top];
+ }
+ }
- id = **data;
- if (id == 0x0c) {
+ dict->count += 1;
*data += 1;
- if (*data >= endptr ||
- (id = **data + CFF_LAST_DICT_OP1) >= CFF_LAST_DICT_OP) {
- *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
- return;
- }
- } else if (id >= CFF_LAST_DICT_OP1) {
- *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
- return;
- }
- argtype = dict_operator[id].argtype;
- if (dict_operator[id].opname == NULL || argtype < 0) {
- *status = CFF_CFF_ERROR_PARSE_CFF_ERROR;
return;
- } else if (stack_top < 1) {
- *status = CFF_CFF_ERROR_STACK_UNDERFLOW;
- return;
- }
-
- if (dict->count >= dict->max) {
- dict->max += DICT_ENTRY_MAX;
- /* not zeroed! */
- dict->entries = xrealloc(dict->entries, dict->max*sizeof(cff_dict_entry));
- }
-
- (dict->entries)[dict->count].id = id;
- (dict->entries)[dict->count].key = (char *) dict_operator[id].opname;
- if (argtype == CFF_TYPE_NUMBER ||
- argtype == CFF_TYPE_BOOLEAN ||
- argtype == CFF_TYPE_SID ||
- argtype == CFF_TYPE_OFFSET) {
- stack_top--;
- (dict->entries)[dict->count].count = 1;
- (dict->entries)[dict->count].values = xcalloc(1, sizeof(double));
- (dict->entries)[dict->count].values[0] = arg_stack[stack_top];
- } else {
- (dict->entries)[dict->count].count = stack_top;
- (dict->entries)[dict->count].values = xcalloc(stack_top, sizeof(double));
- while (stack_top > 0) {
- stack_top--;
- (dict->entries)[dict->count].values[stack_top] = arg_stack[stack_top];
- }
- }
-
- dict->count += 1;
- *data += 1;
-
- return;
}
/*
@@ -745,370 +786,370 @@ static void add_dict (cff_dict *dict,
* Private: two numbers, size and offset
* ROS : three numbers, SID, SID, and a number
*/
-cff_dict *cff_dict_unpack (card8 *data, card8 *endptr)
+cff_dict *cff_dict_unpack(card8 * data, card8 * endptr)
{
- cff_dict *dict;
- int status = CFF_PARSE_OK;
-
- stack_top = 0;
-
- dict = cff_new_dict();
- while (data < endptr && status == CFF_PARSE_OK) {
- if (*data < 22) { /* operator */
- add_dict(dict, &data, endptr, &status);
- } else if (*data == 30) { /* real - First byte of a sequence (variable) */
- if (stack_top < CFF_DICT_STACK_LIMIT) {
- arg_stack[stack_top] = get_real(&data, endptr, &status);
- stack_top++;
- } else {
- status = CFF_CFF_ERROR_STACK_OVERFLOW;
- }
- } else if (*data == 255 || (*data >= 22 && *data <= 27)) { /* reserved */
- data++;
- } else { /* everything else are integer */
- if (stack_top < CFF_DICT_STACK_LIMIT) {
- arg_stack[stack_top] = get_integer(&data, endptr, &status);
- stack_top++;
- } else {
- status = CFF_CFF_ERROR_STACK_OVERFLOW;
- }
- }
- }
+ cff_dict *dict;
+ int status = CFF_PARSE_OK;
- if (status != CFF_PARSE_OK) {
- pdftex_fail("Parsing CFF DICT failed. (error=%d)", status);
- } else if (stack_top != 0) {
- WARN("Garbage in CFF DICT data.");
stack_top = 0;
- }
- return dict;
+ dict = cff_new_dict();
+ while (data < endptr && status == CFF_PARSE_OK) {
+ if (*data < 22) { /* operator */
+ add_dict(dict, &data, endptr, &status);
+ } else if (*data == 30) { /* real - First byte of a sequence (variable) */
+ if (stack_top < CFF_DICT_STACK_LIMIT) {
+ arg_stack[stack_top] = get_real(&data, endptr, &status);
+ stack_top++;
+ } else {
+ status = CFF_CFF_ERROR_STACK_OVERFLOW;
+ }
+ } else if (*data == 255 || (*data >= 22 && *data <= 27)) { /* reserved */
+ data++;
+ } else { /* everything else are integer */
+ if (stack_top < CFF_DICT_STACK_LIMIT) {
+ arg_stack[stack_top] = get_integer(&data, endptr, &status);
+ stack_top++;
+ } else {
+ status = CFF_CFF_ERROR_STACK_OVERFLOW;
+ }
+ }
+ }
+
+ if (status != CFF_PARSE_OK) {
+ pdftex_fail("Parsing CFF DICT failed. (error=%d)", status);
+ } else if (stack_top != 0) {
+ WARN("Garbage in CFF DICT data.");
+ stack_top = 0;
+ }
+
+ return dict;
}
-int cff_dict_known (cff_dict *dict, const char *key)
+int cff_dict_known(cff_dict * dict, const char *key)
{
- int i;
+ int i;
- for (i = 0; i < dict->count; i++) {
- if (key && strcmp(key, (dict->entries)[i].key) == 0
- && (dict->entries)[i].count > 0)
- return 1;
- }
+ for (i = 0; i < dict->count; i++) {
+ if (key && strcmp(key, (dict->entries)[i].key) == 0
+ && (dict->entries)[i].count > 0)
+ return 1;
+ }
- return 0;
+ return 0;
}
-double cff_dict_get (cff_dict *dict, const char *key, int idx)
+double cff_dict_get(cff_dict * dict, const char *key, int idx)
{
- double value = 0.0;
- int i;
+ double value = 0.0;
+ int i;
- assert(key && dict);
+ assert(key && dict);
- for (i = 0; i < dict->count; i++) {
- if (strcmp(key, (dict->entries)[i].key) == 0) {
- if ((dict->entries)[i].count > idx)
- value = (dict->entries)[i].values[idx];
- else
- pdftex_fail("Invalid index number.");
- break;
+ for (i = 0; i < dict->count; i++) {
+ if (strcmp(key, (dict->entries)[i].key) == 0) {
+ if ((dict->entries)[i].count > idx)
+ value = (dict->entries)[i].values[idx];
+ else
+ pdftex_fail("Invalid index number.");
+ break;
+ }
}
- }
- if (i == dict->count)
- pdftex_fail("DICT entry \"%s\" not found.", key);
+ if (i == dict->count)
+ pdftex_fail("DICT entry \"%s\" not found.", key);
- return value;
+ return value;
}
-card8 cff_fdselect_lookup (cff_font *cff, card16 gid)
+card8 cff_fdselect_lookup(cff_font * cff, card16 gid)
{
- card8 fd = 0xff;
- cff_fdselect *fdsel;
-
- if (cff->fdselect == NULL)
- CFF_ERROR("in cff_fdselect_lookup(): FDSelect not available");
-
- fdsel = cff->fdselect;
-
- if (gid >= cff->num_glyphs)
- CFF_ERROR("in cff_fdselect_lookup(): Invalid glyph index");
-
- switch (fdsel->format) {
- case 0:
- fd = fdsel->data.fds[gid];
- break;
- case 3:
- {
- if (gid == 0) {
- fd = (fdsel->data).ranges[0].fd;
- } else {
- card16 i;
- for (i=1;i<(fdsel->num_entries);i++) {
- if (gid < (fdsel->data).ranges[i].first)
- break;
- }
- fd = (fdsel->data).ranges[i-1].fd;
- }
- }
- break;
- default:
- CFF_ERROR("in cff_fdselect_lookup(): Invalid FDSelect format");
- break;
- }
-
- if (fd >= cff->num_fds)
- CFF_ERROR("in cff_fdselect_lookup(): Invalid Font DICT index");
-
- return fd;
+ card8 fd = 0xff;
+ cff_fdselect *fdsel;
+
+ if (cff->fdselect == NULL)
+ CFF_ERROR("in cff_fdselect_lookup(): FDSelect not available");
+
+ fdsel = cff->fdselect;
+
+ if (gid >= cff->num_glyphs)
+ CFF_ERROR("in cff_fdselect_lookup(): Invalid glyph index");
+
+ switch (fdsel->format) {
+ case 0:
+ fd = fdsel->data.fds[gid];
+ break;
+ case 3:
+ {
+ if (gid == 0) {
+ fd = (fdsel->data).ranges[0].fd;
+ } else {
+ card16 i;
+ for (i = 1; i < (fdsel->num_entries); i++) {
+ if (gid < (fdsel->data).ranges[i].first)
+ break;
+ }
+ fd = (fdsel->data).ranges[i - 1].fd;
+ }
+ }
+ break;
+ default:
+ CFF_ERROR("in cff_fdselect_lookup(): Invalid FDSelect format");
+ break;
+ }
+
+ if (fd >= cff->num_fds)
+ CFF_ERROR("in cff_fdselect_lookup(): Invalid Font DICT index");
+
+ return fd;
}
-long cff_read_subrs (cff_font *cff)
+long cff_read_subrs(cff_font * cff)
{
- long len = 0;
- long offset;
- int i;
-
-
- if ((cff->flag & FONTTYPE_CIDFONT) && cff->fdselect == NULL) {
- cff_read_fdselect(cff);
- }
-
- if ((cff->flag & FONTTYPE_CIDFONT) && cff->fdarray == NULL) {
- cff_read_fdarray(cff);
- }
+ long len = 0;
+ long offset;
+ int i;
- if (cff->private == NULL)
- cff_read_private(cff);
- if (cff->gsubr == NULL) {
- cff->offset = cff->gsubr_offset;
- cff->gsubr = cff_get_index(cff);
- }
-
- cff->subrs = xcalloc(cff->num_fds, sizeof(cff_index *));
- if (cff->flag & FONTTYPE_CIDFONT) {
- for (i=0;i<cff->num_fds;i++) {
- if (cff->private[i] == NULL ||
- !cff_dict_known(cff->private[i], "Subrs")) {
- (cff->subrs)[i] = NULL;
- } else {
- offset = (long) cff_dict_get(cff->fdarray[i], "Private", 1);
- offset += (long) cff_dict_get(cff->private[i], "Subrs", 0);
- cff->offset = offset;
- (cff->subrs)[i] = cff_get_index(cff);
- len += cff_index_size((cff->subrs)[i]);
- }
- }
- } else {
- if (cff->private[0] == NULL ||
- !cff_dict_known(cff->private[0], "Subrs")) {
- (cff->subrs)[0] = NULL;
- } else {
- offset = (long) cff_dict_get(cff->topdict, "Private", 1);
- offset += (long) cff_dict_get(cff->private[0], "Subrs", 0);
- cff->offset = offset;
- (cff->subrs)[0] = cff_get_index(cff);
- len += cff_index_size((cff->subrs)[0]);
+ if ((cff->flag & FONTTYPE_CIDFONT) && cff->fdselect == NULL) {
+ cff_read_fdselect(cff);
}
- }
-
- return len;
-}
-
-
-long cff_read_fdarray (cff_font *cff)
-{
- long len = 0;
- cff_index *idx;
- long offset, size;
- card16 i;
- if (cff->topdict == NULL)
- CFF_ERROR("in cff_read_fdarray(): Top DICT not found");
+ if ((cff->flag & FONTTYPE_CIDFONT) && cff->fdarray == NULL) {
+ cff_read_fdarray(cff);
+ }
- if (!(cff->flag & FONTTYPE_CIDFONT))
- return 0;
+ if (cff->private == NULL)
+ cff_read_private(cff);
- /* must exist */
- offset = (long) cff_dict_get(cff->topdict, "FDArray", 0);
- cff->offset = offset;
- idx = cff_get_index(cff);
- cff->num_fds = (card8)idx->count;
- cff->fdarray = xcalloc(idx->count, sizeof(cff_dict *));
- for (i=0;i<idx->count;i++) {
- card8 *data = idx->data + (idx->offset)[i] - 1;
- size = (idx->offset)[i+1] - (idx->offset)[i];
- if (size > 0) {
- (cff->fdarray)[i] = cff_dict_unpack(data, data+size);
- } else {
- (cff->fdarray)[i] = NULL;
+ if (cff->gsubr == NULL) {
+ cff->offset = cff->gsubr_offset;
+ cff->gsubr = cff_get_index(cff);
}
- }
- len = cff_index_size(idx);
- cff_release_index(idx);
- return len;
+ cff->subrs = xcalloc(cff->num_fds, sizeof(cff_index *));
+ if (cff->flag & FONTTYPE_CIDFONT) {
+ for (i = 0; i < cff->num_fds; i++) {
+ if (cff->private[i] == NULL ||
+ !cff_dict_known(cff->private[i], "Subrs")) {
+ (cff->subrs)[i] = NULL;
+ } else {
+ offset = (long) cff_dict_get(cff->fdarray[i], "Private", 1);
+ offset += (long) cff_dict_get(cff->private[i], "Subrs", 0);
+ cff->offset = offset;
+ (cff->subrs)[i] = cff_get_index(cff);
+ len += cff_index_size((cff->subrs)[i]);
+ }
+ }
+ } else {
+ if (cff->private[0] == NULL ||
+ !cff_dict_known(cff->private[0], "Subrs")) {
+ (cff->subrs)[0] = NULL;
+ } else {
+ offset = (long) cff_dict_get(cff->topdict, "Private", 1);
+ offset += (long) cff_dict_get(cff->private[0], "Subrs", 0);
+ cff->offset = offset;
+ (cff->subrs)[0] = cff_get_index(cff);
+ len += cff_index_size((cff->subrs)[0]);
+ }
+ }
+
+ return len;
}
-long cff_read_private (cff_font *cff)
+long cff_read_fdarray(cff_font * cff)
{
- long len = 0;
- card8 *data;
- long offset, size;
+ long len = 0;
+ cff_index *idx;
+ long offset, size;
+ card16 i;
+
+ if (cff->topdict == NULL)
+ CFF_ERROR("in cff_read_fdarray(): Top DICT not found");
+
+ if (!(cff->flag & FONTTYPE_CIDFONT))
+ return 0;
+
+ /* must exist */
+ offset = (long) cff_dict_get(cff->topdict, "FDArray", 0);
+ cff->offset = offset;
+ idx = cff_get_index(cff);
+ cff->num_fds = (card8) idx->count;
+ cff->fdarray = xcalloc(idx->count, sizeof(cff_dict *));
+ for (i = 0; i < idx->count; i++) {
+ card8 *data = idx->data + (idx->offset)[i] - 1;
+ size = (idx->offset)[i + 1] - (idx->offset)[i];
+ if (size > 0) {
+ (cff->fdarray)[i] = cff_dict_unpack(data, data + size);
+ } else {
+ (cff->fdarray)[i] = NULL;
+ }
+ }
+ len = cff_index_size(idx);
+ cff_release_index(idx);
+
+ return len;
+}
- if (cff->flag & FONTTYPE_CIDFONT) {
- int i;
- if (cff->fdarray == NULL)
- cff_read_fdarray(cff);
-
- cff->private = xcalloc(cff->num_fds, sizeof(cff_dict *));
- for (i=0;i<cff->num_fds;i++) {
- if (cff->fdarray[i] != NULL &&
- cff_dict_known(cff->fdarray[i], "Private") &&
- (size = (long) cff_dict_get(cff->fdarray[i], "Private", 0))
- > 0) {
- offset = (long) cff_dict_get(cff->fdarray[i], "Private", 1);
- cff->offset = offset;
- data = xcalloc(size, sizeof(card8));
- memcpy(data,&cff->stream[cff->offset],size);
- cff->offset = size;
- (cff->private)[i] = cff_dict_unpack(data, data+size);
- xfree(data);
- len += size;
- } else {
- (cff->private)[i] = NULL;
- }
- }
- } else {
- cff->num_fds = 1;
- cff->private = xcalloc(1, sizeof(cff_dict *));
- if (cff_dict_known(cff->topdict, "Private") &&
- (size = (long) cff_dict_get(cff->topdict, "Private", 0)) > 0) {
- offset = (long) cff_dict_get(cff->topdict, "Private", 1);
- cff->offset = offset;
- data = xcalloc(size, sizeof(card8));
- memcpy(data,&cff->stream[cff->offset],size);
- cff->offset = size;
- cff->private[0] = cff_dict_unpack(data, data+size);
- xfree(data);
- len += size;
+long cff_read_private(cff_font * cff)
+{
+ long len = 0;
+ card8 *data;
+ long offset, size;
+
+ if (cff->flag & FONTTYPE_CIDFONT) {
+ int i;
+
+ if (cff->fdarray == NULL)
+ cff_read_fdarray(cff);
+
+ cff->private = xcalloc(cff->num_fds, sizeof(cff_dict *));
+ for (i = 0; i < cff->num_fds; i++) {
+ if (cff->fdarray[i] != NULL &&
+ cff_dict_known(cff->fdarray[i], "Private") &&
+ (size = (long) cff_dict_get(cff->fdarray[i], "Private", 0))
+ > 0) {
+ offset = (long) cff_dict_get(cff->fdarray[i], "Private", 1);
+ cff->offset = offset;
+ data = xcalloc(size, sizeof(card8));
+ memcpy(data, &cff->stream[cff->offset], size);
+ cff->offset = size;
+ (cff->private)[i] = cff_dict_unpack(data, data + size);
+ xfree(data);
+ len += size;
+ } else {
+ (cff->private)[i] = NULL;
+ }
+ }
} else {
- (cff->private)[0] = NULL;
- len = 0;
- }
- }
-
- return len;
+ cff->num_fds = 1;
+ cff->private = xcalloc(1, sizeof(cff_dict *));
+ if (cff_dict_known(cff->topdict, "Private") &&
+ (size = (long) cff_dict_get(cff->topdict, "Private", 0)) > 0) {
+ offset = (long) cff_dict_get(cff->topdict, "Private", 1);
+ cff->offset = offset;
+ data = xcalloc(size, sizeof(card8));
+ memcpy(data, &cff->stream[cff->offset], size);
+ cff->offset = size;
+ cff->private[0] = cff_dict_unpack(data, data + size);
+ xfree(data);
+ len += size;
+ } else {
+ (cff->private)[0] = NULL;
+ len = 0;
+ }
+ }
+
+ return len;
}
-cff_font *read_cff (unsigned char *buf,long buflength, int n)
+cff_font *read_cff(unsigned char *buf, long buflength, int n)
{
- cff_font *cff;
- cff_index *idx;
- long offset ;
+ cff_font *cff;
+ cff_index *idx;
+ long offset;
- cff = xcalloc(1,sizeof(cff_font));
+ cff = xcalloc(1, sizeof(cff_font));
- cff->stream = buf;
- cff->stream_size = buflength;
- cff->index = n;
+ cff->stream = buf;
+ cff->stream_size = buflength;
+ cff->index = n;
- cff->header_major = get_card8(cff);
- cff->header_minor = get_card8(cff);
- cff->header_hdr_size = get_card8(cff);
- cff->header_offsize = get_card8(cff);
- if (cff->header_offsize < 1 || cff->header_offsize > 4) {
- WARN("invalid offsize data");
- cff_close(cff);
- return NULL;
- }
- if (cff->header_major > 1) {
- pdftex_warn("CFF major version %u not supported.",cff->header_major);
- cff_close(cff);
- return NULL;
- }
- cff->offset = cff->header_hdr_size;
-
- /* Name INDEX */
- idx = cff_get_index(cff);
- if (n > idx->count - 1) {
- pdftex_warn("Invalid CFF fontset index number.");
- cff_close(cff);
- return NULL;
- }
+ cff->header_major = get_card8(cff);
+ cff->header_minor = get_card8(cff);
+ cff->header_hdr_size = get_card8(cff);
+ cff->header_offsize = get_card8(cff);
+ if (cff->header_offsize < 1 || cff->header_offsize > 4) {
+ WARN("invalid offsize data");
+ cff_close(cff);
+ return NULL;
+ }
+ if (cff->header_major > 1) {
+ pdftex_warn("CFF major version %u not supported.", cff->header_major);
+ cff_close(cff);
+ return NULL;
+ }
+ cff->offset = cff->header_hdr_size;
- cff->name = idx;
+ /* Name INDEX */
+ idx = cff_get_index(cff);
+ if (n > idx->count - 1) {
+ pdftex_warn("Invalid CFF fontset index number.");
+ cff_close(cff);
+ return NULL;
+ }
- cff->fontname = cff_get_name(cff);
+ cff->name = idx;
- /* Top DICT INDEX */
- idx = cff_get_index(cff);
- if (n > idx->count - 1) {
- WARN("CFF Top DICT not exist...");
- cff_close(cff);
- return NULL;
- }
- cff->topdict = cff_dict_unpack(idx->data + idx->offset[n] - 1,
- idx->data + idx->offset[n + 1] - 1);
- if (!cff->topdict) {
- WARN("Parsing CFF Top DICT data failed...");
- cff_close(cff);
- return NULL;
- }
- cff_release_index(idx);
+ cff->fontname = cff_get_name(cff);
- if (cff_dict_known(cff->topdict, "CharstringType") &&
- cff_dict_get(cff->topdict, "CharstringType", 0) != 2) {
- WARN("Only Type 2 Charstrings supported...");
- cff_close(cff);
- return NULL;
- }
+ /* Top DICT INDEX */
+ idx = cff_get_index(cff);
+ if (n > idx->count - 1) {
+ WARN("CFF Top DICT not exist...");
+ cff_close(cff);
+ return NULL;
+ }
+ cff->topdict = cff_dict_unpack(idx->data + idx->offset[n] - 1,
+ idx->data + idx->offset[n + 1] - 1);
+ if (!cff->topdict) {
+ WARN("Parsing CFF Top DICT data failed...");
+ cff_close(cff);
+ return NULL;
+ }
+ cff_release_index(idx);
- if (cff_dict_known(cff->topdict, "SyntheticBase")) {
- WARN("CFF Synthetic font not supported.");
- cff_close(cff);
- return NULL;
- }
+ if (cff_dict_known(cff->topdict, "CharstringType") &&
+ cff_dict_get(cff->topdict, "CharstringType", 0) != 2) {
+ WARN("Only Type 2 Charstrings supported...");
+ cff_close(cff);
+ return NULL;
+ }
- /* String INDEX */
- cff->string = cff_get_index(cff);
+ if (cff_dict_known(cff->topdict, "SyntheticBase")) {
+ WARN("CFF Synthetic font not supported.");
+ cff_close(cff);
+ return NULL;
+ }
- /* offset to GSubr */
- cff->gsubr_offset = cff->offset;
+ /* String INDEX */
+ cff->string = cff_get_index(cff);
- /* Number of glyphs */
- offset = (long) cff_dict_get(cff->topdict, "CharStrings", 0);
- cff->offset = offset;
- cff->num_glyphs = get_card16(cff);
+ /* offset to GSubr */
+ cff->gsubr_offset = cff->offset;
- /* Check for font type */
- if (cff_dict_known(cff->topdict, "ROS")) {
- cff->flag |= FONTTYPE_CIDFONT;
- } else {
- cff->flag |= FONTTYPE_FONT;
- }
+ /* Number of glyphs */
+ offset = (long) cff_dict_get(cff->topdict, "CharStrings", 0);
+ cff->offset = offset;
+ cff->num_glyphs = get_card16(cff);
- /* Check for encoding */
- if (cff_dict_known(cff->topdict, "Encoding")) {
- offset = (long) cff_dict_get(cff->topdict, "Encoding", 0);
- if (offset == 0) { /* predefined */
- cff->flag |= ENCODING_STANDARD;
- } else if (offset == 1) {
- cff->flag |= ENCODING_EXPERT;
+ /* Check for font type */
+ if (cff_dict_known(cff->topdict, "ROS")) {
+ cff->flag |= FONTTYPE_CIDFONT;
+ } else {
+ cff->flag |= FONTTYPE_FONT;
}
- } else {
- cff->flag |= ENCODING_STANDARD;
- }
- cff->offset = cff->gsubr_offset; /* seek back to GSubr */
+ /* Check for encoding */
+ if (cff_dict_known(cff->topdict, "Encoding")) {
+ offset = (long) cff_dict_get(cff->topdict, "Encoding", 0);
+ if (offset == 0) { /* predefined */
+ cff->flag |= ENCODING_STANDARD;
+ } else if (offset == 1) {
+ cff->flag |= ENCODING_EXPERT;
+ }
+ } else {
+ cff->flag |= ENCODING_STANDARD;
+ }
+
+ cff->offset = cff->gsubr_offset; /* seek back to GSubr */
- return cff;
+ return cff;
}
/* write a cff for opentype */
@@ -1116,610 +1157,610 @@ cff_font *read_cff (unsigned char *buf,long buflength, int n)
/* Pack DICT data */
-static long pack_integer (card8 *dest, long destlen, long value)
+static long pack_integer(card8 * dest, long destlen, long value)
{
- long len = 0;
-
- if (value >= -107 && value <= 107) {
- if (destlen < 1)
- CFF_ERROR("Buffer overflow.");
- dest[0] = (value + 139) & 0xff;
- len = 1;
- } else if (value >= 108 && value <= 1131) {
- if (destlen < 2)
- CFF_ERROR("Buffer overflow.");
- value = 0xf700u + value - 108;
- dest[0] = (value >> 8) & 0xff;
- dest[1] = value & 0xff;
- len = 2;
- } else if (value >= -1131 && value <= -108) {
- if (destlen < 2)
- CFF_ERROR("Buffer overflow.");
- value = 0xfb00u - value - 108;
- dest[0] = (value >> 8) & 0xff;
- dest[1] = value & 0xff;
- len = 2;
- } else if (value >= -32768 && value <= 32767) { /* shortint */
- if (destlen < 3)
- CFF_ERROR("Buffer overflow.");
- dest[0] = 28;
- dest[1] = (value >> 8) & 0xff;
- dest[2] = value & 0xff;
- len = 3;
- } else { /* longint */
- if (destlen < 5)
- CFF_ERROR("Buffer overflow.");
- dest[0] = 29;
- dest[1] = (value >> 24) & 0xff;
- dest[2] = (value >> 16) & 0xff;
- dest[3] = (value >> 8) & 0xff;
- dest[4] = value & 0xff;
- len = 5;
- }
- return len;
+ long len = 0;
+
+ if (value >= -107 && value <= 107) {
+ if (destlen < 1)
+ CFF_ERROR("Buffer overflow.");
+ dest[0] = (value + 139) & 0xff;
+ len = 1;
+ } else if (value >= 108 && value <= 1131) {
+ if (destlen < 2)
+ CFF_ERROR("Buffer overflow.");
+ value = 0xf700u + value - 108;
+ dest[0] = (value >> 8) & 0xff;
+ dest[1] = value & 0xff;
+ len = 2;
+ } else if (value >= -1131 && value <= -108) {
+ if (destlen < 2)
+ CFF_ERROR("Buffer overflow.");
+ value = 0xfb00u - value - 108;
+ dest[0] = (value >> 8) & 0xff;
+ dest[1] = value & 0xff;
+ len = 2;
+ } else if (value >= -32768 && value <= 32767) { /* shortint */
+ if (destlen < 3)
+ CFF_ERROR("Buffer overflow.");
+ dest[0] = 28;
+ dest[1] = (value >> 8) & 0xff;
+ dest[2] = value & 0xff;
+ len = 3;
+ } else { /* longint */
+ if (destlen < 5)
+ CFF_ERROR("Buffer overflow.");
+ dest[0] = 29;
+ dest[1] = (value >> 24) & 0xff;
+ dest[2] = (value >> 16) & 0xff;
+ dest[3] = (value >> 8) & 0xff;
+ dest[4] = value & 0xff;
+ len = 5;
+ }
+ return len;
}
-static long pack_real (card8 *dest, long destlen, double value)
+static long pack_real(card8 * dest, long destlen, double value)
{
- long e;
- int i = 0, pos = 2;
+ long e;
+ int i = 0, pos = 2;
#define CFF_REAL_MAX_LEN 17
- if (destlen < 2)
- CFF_ERROR("Buffer overflow.");
-
- dest[0] = 30;
-
- if (value == 0.0) {
- dest[1] = 0x0f;
- return 2;
- }
-
- if (value < 0.0) {
- dest[1] = 0xe0;
- value *= -1.0;
- pos++;
- }
-
- e = 0;
- if (value >= 10.0) {
- while (value >= 10.0) {
- value /= 10.0;
- e++;
- }
- } else if (value < 1.0) {
- while (value < 1.0) {
- value *= 10.0;
- e--;
- }
- }
-
- sprintf(work_buffer, "%1.14g", value);
- for (i=0;i<CFF_REAL_MAX_LEN;i++) {
- unsigned char ch = 0;
- if (work_buffer[i] == '\0') {
- break;
- } else if (work_buffer[i] == '.') {
- ch = 0x0a;
- } else if (work_buffer[i] >= '0' && work_buffer[i] <= '9') {
- ch = work_buffer[i] - '0';
- } else {
- CFF_ERROR("Invalid character.");
- }
-
- if (destlen < pos/2 + 1)
- CFF_ERROR("Buffer overflow.");
-
- if (pos % 2) {
- dest[pos/2] += ch;
- } else {
- dest[pos/2] = (ch << 4);
+ if (destlen < 2)
+ CFF_ERROR("Buffer overflow.");
+
+ dest[0] = 30;
+
+ if (value == 0.0) {
+ dest[1] = 0x0f;
+ return 2;
+ }
+
+ if (value < 0.0) {
+ dest[1] = 0xe0;
+ value *= -1.0;
+ pos++;
+ }
+
+ e = 0;
+ if (value >= 10.0) {
+ while (value >= 10.0) {
+ value /= 10.0;
+ e++;
+ }
+ } else if (value < 1.0) {
+ while (value < 1.0) {
+ value *= 10.0;
+ e--;
+ }
+ }
+
+ sprintf(work_buffer, "%1.14g", value);
+ for (i = 0; i < CFF_REAL_MAX_LEN; i++) {
+ unsigned char ch = 0;
+ if (work_buffer[i] == '\0') {
+ break;
+ } else if (work_buffer[i] == '.') {
+ ch = 0x0a;
+ } else if (work_buffer[i] >= '0' && work_buffer[i] <= '9') {
+ ch = work_buffer[i] - '0';
+ } else {
+ CFF_ERROR("Invalid character.");
+ }
+
+ if (destlen < pos / 2 + 1)
+ CFF_ERROR("Buffer overflow.");
+
+ if (pos % 2) {
+ dest[pos / 2] += ch;
+ } else {
+ dest[pos / 2] = (ch << 4);
+ }
+ pos++;
+ }
+
+ if (e > 0) {
+ if (pos % 2) {
+ dest[pos / 2] += 0x0b;
+ } else {
+ if (destlen < pos / 2 + 1)
+ CFF_ERROR("Buffer overflow.");
+ dest[pos / 2] = 0xb0;
+ }
+ pos++;
+ } else if (e < 0) {
+ if (pos % 2) {
+ dest[pos / 2] += 0x0c;
+ } else {
+ if (destlen < pos / 2 + 1)
+ CFF_ERROR("Buffer overflow.");
+ dest[pos / 2] = 0xc0;
+ }
+ e *= -1;
+ pos++;
+ }
+
+ if (e != 0) {
+ sprintf(work_buffer, "%ld", e);
+ for (i = 0; i < CFF_REAL_MAX_LEN; i++) {
+ unsigned char ch = 0;
+ if (work_buffer[i] == '\0') {
+ break;
+ } else if (work_buffer[i] == '.') {
+ ch = 0x0a;
+ } else if (work_buffer[i] >= '0' && work_buffer[i] <= '9') {
+ ch = work_buffer[i] - '0';
+ } else {
+ CFF_ERROR("Invalid character.");
+ }
+
+ if (destlen < pos / 2 + 1)
+ CFF_ERROR("Buffer overflow.");
+
+ if (pos % 2) {
+ dest[pos / 2] += ch;
+ } else {
+ dest[pos / 2] = (ch << 4);
+ }
+ pos++;
+ }
}
- pos++;
- }
- if (e > 0) {
- if (pos % 2) {
- dest[pos/2] += 0x0b;
- } else {
- if (destlen < pos/2 + 1)
- CFF_ERROR("Buffer overflow.");
- dest[pos/2] = 0xb0;
- }
- pos++;
- } else if (e < 0) {
if (pos % 2) {
- dest[pos/2] += 0x0c;
+ dest[pos / 2] += 0x0f;
+ pos++;
} else {
- if (destlen < pos/2 + 1)
- CFF_ERROR("Buffer overflow.");
- dest[pos/2] = 0xc0;
- }
- e *= -1;
- pos++;
- }
-
- if (e != 0) {
- sprintf(work_buffer, "%ld", e);
- for (i=0;i<CFF_REAL_MAX_LEN;i++) {
- unsigned char ch = 0;
- if (work_buffer[i] == '\0') {
- break;
- } else if (work_buffer[i] == '.') {
- ch = 0x0a;
- } else if (work_buffer[i] >= '0' && work_buffer[i] <= '9') {
- ch = work_buffer[i] - '0';
- } else {
- CFF_ERROR("Invalid character.");
- }
-
- if (destlen < pos/2 + 1)
- CFF_ERROR("Buffer overflow.");
-
- if (pos % 2) {
- dest[pos/2] += ch;
- } else {
- dest[pos/2] = (ch << 4);
- }
- pos++;
+ if (destlen < pos / 2 + 1)
+ CFF_ERROR("Buffer overflow.");
+ dest[pos / 2] = 0xff;
+ pos += 2;
}
- }
-
- if (pos % 2) {
- dest[pos/2] += 0x0f;
- pos++;
- } else {
- if (destlen < pos/2 + 1)
- CFF_ERROR("Buffer overflow.");
- dest[pos/2] = 0xff;
- pos += 2;
- }
- return pos/2;
+ return pos / 2;
}
-static long cff_dict_put_number (double value,
- card8 *dest, long destlen,
- int type)
+static long cff_dict_put_number(double value,
+ card8 * dest, long destlen, int type)
{
- long len = 0;
- double nearint;
-
- nearint = floor(value+0.5);
- /* set offset to longint */
- if (type == CFF_TYPE_OFFSET) {
- long lvalue;
-
- lvalue = (long) value;
- if (destlen < 5)
- CFF_ERROR("Buffer overflow.");
- dest[0] = 29;
- dest[1] = (lvalue >> 24) & 0xff;
- dest[2] = (lvalue >> 16) & 0xff;
- dest[3] = (lvalue >> 8) & 0xff;
- dest[4] = lvalue & 0xff;
- len = 5;
- } else if (value > CFF_INT_MAX || value < CFF_INT_MIN ||
- (fabs(value - nearint) > 1.0e-5)) { /* real */
- len = pack_real(dest, destlen, value);
- } else { /* integer */
- len = pack_integer(dest, destlen, (long) nearint);
- }
-
- return len;
+ long len = 0;
+ double nearint;
+
+ nearint = floor(value + 0.5);
+ /* set offset to longint */
+ if (type == CFF_TYPE_OFFSET) {
+ long lvalue;
+
+ lvalue = (long) value;
+ if (destlen < 5)
+ CFF_ERROR("Buffer overflow.");
+ dest[0] = 29;
+ dest[1] = (lvalue >> 24) & 0xff;
+ dest[2] = (lvalue >> 16) & 0xff;
+ dest[3] = (lvalue >> 8) & 0xff;
+ dest[4] = lvalue & 0xff;
+ len = 5;
+ } else if (value > CFF_INT_MAX || value < CFF_INT_MIN || (fabs(value - nearint) > 1.0e-5)) { /* real */
+ len = pack_real(dest, destlen, value);
+ } else { /* integer */
+ len = pack_integer(dest, destlen, (long) nearint);
+ }
+
+ return len;
}
-static long
-put_dict_entry (cff_dict_entry *de,
- card8 *dest, long destlen)
+static long put_dict_entry(cff_dict_entry * de, card8 * dest, long destlen)
{
- long len = 0;
- int i, type, id;
-
- if (de->count > 0) {
- id = de->id;
- if (dict_operator[id].argtype == CFF_TYPE_OFFSET ||
- dict_operator[id].argtype == CFF_TYPE_SZOFF) {
- type = CFF_TYPE_OFFSET;
- } else {
- type = CFF_TYPE_NUMBER;
- }
- for (i = 0; i < de->count; i++) {
- len += cff_dict_put_number(de->values[i],
- dest+len,
- destlen-len, type);
- }
- if (id >= 0 && id < CFF_LAST_DICT_OP1) {
- if (len + 1 > destlen)
- CFF_ERROR("Buffer overflow.");
- dest[len++] = id;
- } else if (id >= 0 && id < CFF_LAST_DICT_OP) {
- if (len + 2 > destlen)
- CFF_ERROR("in cff_dict_pack(): Buffer overflow");
- dest[len++] = 12;
- dest[len++] = id - CFF_LAST_DICT_OP1;
- } else {
- CFF_ERROR("Invalid CFF DICT operator ID.");
- }
- }
-
- return len;
+ long len = 0;
+ int i, type, id;
+
+ if (de->count > 0) {
+ id = de->id;
+ if (dict_operator[id].argtype == CFF_TYPE_OFFSET ||
+ dict_operator[id].argtype == CFF_TYPE_SZOFF) {
+ type = CFF_TYPE_OFFSET;
+ } else {
+ type = CFF_TYPE_NUMBER;
+ }
+ for (i = 0; i < de->count; i++) {
+ len += cff_dict_put_number(de->values[i],
+ dest + len, destlen - len, type);
+ }
+ if (id >= 0 && id < CFF_LAST_DICT_OP1) {
+ if (len + 1 > destlen)
+ CFF_ERROR("Buffer overflow.");
+ dest[len++] = id;
+ } else if (id >= 0 && id < CFF_LAST_DICT_OP) {
+ if (len + 2 > destlen)
+ CFF_ERROR("in cff_dict_pack(): Buffer overflow");
+ dest[len++] = 12;
+ dest[len++] = id - CFF_LAST_DICT_OP1;
+ } else {
+ CFF_ERROR("Invalid CFF DICT operator ID.");
+ }
+ }
+
+ return len;
}
-long cff_dict_pack (cff_dict *dict, card8 *dest, long destlen)
+long cff_dict_pack(cff_dict * dict, card8 * dest, long destlen)
{
- long len = 0;
- int i;
+ long len = 0;
+ int i;
- for (i = 0; i < dict->count; i++) {
- if (!strcmp(dict->entries[i].key, "ROS")) {
- len += put_dict_entry(&dict->entries[i], dest, destlen);
- break;
+ for (i = 0; i < dict->count; i++) {
+ if (!strcmp(dict->entries[i].key, "ROS")) {
+ len += put_dict_entry(&dict->entries[i], dest, destlen);
+ break;
+ }
}
- }
- for (i = 0; i < dict->count; i++) {
- if (strcmp(dict->entries[i].key, "ROS")) {
- len += put_dict_entry(&dict->entries[i], dest+len, destlen-len);
+ for (i = 0; i < dict->count; i++) {
+ if (strcmp(dict->entries[i].key, "ROS")) {
+ len += put_dict_entry(&dict->entries[i], dest + len, destlen - len);
+ }
}
- }
- return len;
+ return len;
}
-void cff_dict_add (cff_dict *dict, const char *key, int count)
+void cff_dict_add(cff_dict * dict, const char *key, int count)
{
- int id, i;
+ int id, i;
- for (id=0;id<CFF_LAST_DICT_OP;id++) {
- if (key && dict_operator[id].opname &&
- strcmp(dict_operator[id].opname, key) == 0)
- break;
- }
+ for (id = 0; id < CFF_LAST_DICT_OP; id++) {
+ if (key && dict_operator[id].opname &&
+ strcmp(dict_operator[id].opname, key) == 0)
+ break;
+ }
- if (id == CFF_LAST_DICT_OP)
- CFF_ERROR("Unknown CFF DICT operator.");
+ if (id == CFF_LAST_DICT_OP)
+ CFF_ERROR("Unknown CFF DICT operator.");
- for (i=0;i<dict->count;i++) {
- if ((dict->entries)[i].id == id) {
- if ((dict->entries)[i].count != count)
- CFF_ERROR("Inconsistent DICT argument number.");
- return;
+ for (i = 0; i < dict->count; i++) {
+ if ((dict->entries)[i].id == id) {
+ if ((dict->entries)[i].count != count)
+ CFF_ERROR("Inconsistent DICT argument number.");
+ return;
+ }
}
- }
- if (dict->count + 1 >= dict->max) {
- dict->max += 8;
- dict->entries = xrealloc(dict->entries, (dict->max)*sizeof(cff_dict_entry));
- }
+ if (dict->count + 1 >= dict->max) {
+ dict->max += 8;
+ dict->entries =
+ xrealloc(dict->entries, (dict->max) * sizeof(cff_dict_entry));
+ }
- (dict->entries)[dict->count].id = id;
- (dict->entries)[dict->count].key = (char *) dict_operator[id].opname;
- (dict->entries)[dict->count].count = count;
- if (count > 0) {
- (dict->entries)[dict->count].values = xcalloc(count, sizeof(double));
- memset((dict->entries)[dict->count].values,
- 0, sizeof(double)*count);
- } else {
- (dict->entries)[dict->count].values = NULL;
- }
- dict->count += 1;
+ (dict->entries)[dict->count].id = id;
+ (dict->entries)[dict->count].key = (char *) dict_operator[id].opname;
+ (dict->entries)[dict->count].count = count;
+ if (count > 0) {
+ (dict->entries)[dict->count].values = xcalloc(count, sizeof(double));
+ memset((dict->entries)[dict->count].values, 0, sizeof(double) * count);
+ } else {
+ (dict->entries)[dict->count].values = NULL;
+ }
+ dict->count += 1;
- return;
+ return;
}
-void cff_dict_remove (cff_dict *dict, const char *key)
+void cff_dict_remove(cff_dict * dict, const char *key)
{
- int i;
- for (i = 0; i < dict->count; i++) {
- if (key && strcmp(key, (dict->entries)[i].key) == 0) {
- (dict->entries)[i].count = 0;
- if ((dict->entries)[i].values)
- xfree((dict->entries)[i].values);
- (dict->entries)[i].values = NULL;
+ int i;
+ for (i = 0; i < dict->count; i++) {
+ if (key && strcmp(key, (dict->entries)[i].key) == 0) {
+ (dict->entries)[i].count = 0;
+ if ((dict->entries)[i].values)
+ xfree((dict->entries)[i].values);
+ (dict->entries)[i].values = NULL;
+ }
}
- }
}
-void cff_dict_set (cff_dict *dict, const char *key, int idx, double value)
+void cff_dict_set(cff_dict * dict, const char *key, int idx, double value)
{
- int i;
+ int i;
- assert(dict && key);
+ assert(dict && key);
- for (i = 0 ; i < dict->count; i++) {
- if (strcmp(key, (dict->entries)[i].key) == 0) {
- if ((dict->entries)[i].count > idx)
- (dict->entries)[i].values[idx] = value;
- else
- CFF_ERROR("Invalid index number.");
- break;
+ for (i = 0; i < dict->count; i++) {
+ if (strcmp(key, (dict->entries)[i].key) == 0) {
+ if ((dict->entries)[i].count > idx)
+ (dict->entries)[i].values[idx] = value;
+ else
+ CFF_ERROR("Invalid index number.");
+ break;
+ }
}
- }
- if (i == dict->count)
- pdftex_fail("DICT entry \"%s\" not found.", key);
+ if (i == dict->count)
+ pdftex_fail("DICT entry \"%s\" not found.", key);
}
/* Strings */
-char *cff_get_string (cff_font *cff, s_SID id)
+char *cff_get_string(cff_font * cff, s_SID id)
{
- char *result = NULL;
- long len;
-
- if (id < CFF_STDSTR_MAX) {
- len = strlen(cff_stdstr[id]);
- result = xcalloc(len+1, sizeof(char));
- memcpy(result, cff_stdstr[id], len);
- result[len] = '\0';
- } else if (cff && cff->string) {
- cff_index *strings = cff->string;
- id -= CFF_STDSTR_MAX;
- if (id < strings->count) {
- len = (strings->offset)[id+1] - (strings->offset)[id];
- result = xcalloc(len + 1, sizeof(char));
- memmove(result, strings->data + (strings->offset)[id] - 1, len);
- result[len] = '\0';
- }
- }
-
- return result;
+ char *result = NULL;
+ long len;
+
+ if (id < CFF_STDSTR_MAX) {
+ len = strlen(cff_stdstr[id]);
+ result = xcalloc(len + 1, sizeof(char));
+ memcpy(result, cff_stdstr[id], len);
+ result[len] = '\0';
+ } else if (cff && cff->string) {
+ cff_index *strings = cff->string;
+ id -= CFF_STDSTR_MAX;
+ if (id < strings->count) {
+ len = (strings->offset)[id + 1] - (strings->offset)[id];
+ result = xcalloc(len + 1, sizeof(char));
+ memmove(result, strings->data + (strings->offset)[id] - 1, len);
+ result[len] = '\0';
+ }
+ }
+
+ return result;
}
-long cff_get_sid (cff_font *cff, char *str)
+long cff_get_sid(cff_font * cff, char *str)
{
- card16 i;
+ card16 i;
- if (!cff || !str)
- return -1;
+ if (!cff || !str)
+ return -1;
- /* I search String INDEX first. */
- if (cff && cff->string) {
- cff_index *idx = cff->string;
- for (i = 0; i < idx->count; i++) {
- if (strlen(str) == (idx->offset)[i+1] - (idx->offset)[i] &&
- !memcmp(str, (idx->data)+(idx->offset)[i]-1, strlen(str)))
- return (i + CFF_STDSTR_MAX);
+ /* I search String INDEX first. */
+ if (cff && cff->string) {
+ cff_index *idx = cff->string;
+ for (i = 0; i < idx->count; i++) {
+ if (strlen(str) == (idx->offset)[i + 1] - (idx->offset)[i] &&
+ !memcmp(str, (idx->data) + (idx->offset)[i] - 1, strlen(str)))
+ return (i + CFF_STDSTR_MAX);
+ }
}
- }
- for (i = 0; i < CFF_STDSTR_MAX; i++) {
- if (!strcmp(str, cff_stdstr[i]))
- return i;
- }
+ for (i = 0; i < CFF_STDSTR_MAX; i++) {
+ if (!strcmp(str, cff_stdstr[i]))
+ return i;
+ }
- return -1;
+ return -1;
}
-void cff_update_string (cff_font *cff)
+void cff_update_string(cff_font * cff)
{
- if (cff == NULL)
- CFF_ERROR("CFF font not opened.");
-
- if (cff->string)
- cff_release_index(cff->string);
- cff->string = cff->_string;
- cff->_string = NULL;
+ if (cff == NULL)
+ CFF_ERROR("CFF font not opened.");
+
+ if (cff->string)
+ cff_release_index(cff->string);
+ cff->string = cff->_string;
+ cff->_string = NULL;
}
-s_SID cff_add_string (cff_font *cff, char *str)
+s_SID cff_add_string(cff_font * cff, char *str)
{
- card16 idx;
- cff_index *strings;
- l_offset offset, size;
-
- if (cff == NULL)
- CFF_ERROR("CFF font not opened.");
-
- if (cff->_string == NULL)
- cff->_string = cff_new_index(0);
- strings = cff->_string;
-
- for (idx = 0; idx < strings->count; idx++) {
- size = strings->offset[idx+1] - strings->offset[idx];
- offset = strings->offset[idx];
- if (size == strlen(str) &&
- !memcmp(strings->data+offset-1, str, strlen(str)))
- return (idx + CFF_STDSTR_MAX);
- }
-
- for (idx = 0; idx < CFF_STDSTR_MAX; idx++) {
- if (cff_stdstr[idx] &&
- !strcmp(cff_stdstr[idx], str))
- return idx;
- }
- offset = (strings->count > 0) ? strings->offset[strings->count] : 1;
- strings->offset = xrealloc(strings->offset, (strings->count+2)*sizeof(l_offset));
- if (strings->count == 0)
- strings->offset[0] = 1;
- idx = strings->count;
- strings->count += 1;
- strings->offset[strings->count] = offset + strlen(str);
- strings->data = xrealloc(strings->data, (offset+strlen(str)-1)*sizeof(card8));
- memcpy(strings->data+offset-1, str, strlen(str));
-
- return (idx + CFF_STDSTR_MAX);
+ card16 idx;
+ cff_index *strings;
+ l_offset offset, size;
+
+ if (cff == NULL)
+ CFF_ERROR("CFF font not opened.");
+
+ if (cff->_string == NULL)
+ cff->_string = cff_new_index(0);
+ strings = cff->_string;
+
+ for (idx = 0; idx < strings->count; idx++) {
+ size = strings->offset[idx + 1] - strings->offset[idx];
+ offset = strings->offset[idx];
+ if (size == strlen(str) &&
+ !memcmp(strings->data + offset - 1, str, strlen(str)))
+ return (idx + CFF_STDSTR_MAX);
+ }
+
+ for (idx = 0; idx < CFF_STDSTR_MAX; idx++) {
+ if (cff_stdstr[idx] && !strcmp(cff_stdstr[idx], str))
+ return idx;
+ }
+ offset = (strings->count > 0) ? strings->offset[strings->count] : 1;
+ strings->offset =
+ xrealloc(strings->offset, (strings->count + 2) * sizeof(l_offset));
+ if (strings->count == 0)
+ strings->offset[0] = 1;
+ idx = strings->count;
+ strings->count += 1;
+ strings->offset[strings->count] = offset + strlen(str);
+ strings->data =
+ xrealloc(strings->data, (offset + strlen(str) - 1) * sizeof(card8));
+ memcpy(strings->data + offset - 1, str, strlen(str));
+
+ return (idx + CFF_STDSTR_MAX);
}
-void cff_dict_update (cff_dict *dict, cff_font *cff)
+void cff_dict_update(cff_dict * dict, cff_font * cff)
{
- int i;
-
- for (i = 0;i < dict->count; i++) {
- if ((dict->entries)[i].count > 0) {
- char *str;
- int id;
-
- id = (dict->entries)[i].id;
-
- if (dict_operator[id].argtype == CFF_TYPE_SID) {
- str = cff_get_string(cff, (dict->entries)[i].values[0]);
- (dict->entries)[i].values[0] = cff_add_string(cff, str);
- xfree(str);
- } else if (dict_operator[id].argtype == CFF_TYPE_ROS) {
- str = cff_get_string(cff, (dict->entries)[i].values[0]);
- (dict->entries)[i].values[0] = cff_add_string(cff, str);
- xfree(str);
- str = cff_get_string(cff, (dict->entries)[i].values[1]);
- (dict->entries)[i].values[1] = cff_add_string(cff, str);
- xfree(str);
- }
-
+ int i;
+
+ for (i = 0; i < dict->count; i++) {
+ if ((dict->entries)[i].count > 0) {
+ char *str;
+ int id;
+
+ id = (dict->entries)[i].id;
+
+ if (dict_operator[id].argtype == CFF_TYPE_SID) {
+ str = cff_get_string(cff, (dict->entries)[i].values[0]);
+ (dict->entries)[i].values[0] = cff_add_string(cff, str);
+ xfree(str);
+ } else if (dict_operator[id].argtype == CFF_TYPE_ROS) {
+ str = cff_get_string(cff, (dict->entries)[i].values[0]);
+ (dict->entries)[i].values[0] = cff_add_string(cff, str);
+ xfree(str);
+ str = cff_get_string(cff, (dict->entries)[i].values[1]);
+ (dict->entries)[i].values[1] = cff_add_string(cff, str);
+ xfree(str);
+ }
+
+ }
}
- }
}
/* charsets */
-long cff_read_charsets (cff_font *cff)
+long cff_read_charsets(cff_font * cff)
{
- cff_charsets *charset;
- long offset, length;
- card16 count, i;
+ cff_charsets *charset;
+ long offset, length;
+ card16 count, i;
- if (cff->topdict == NULL)
- CFF_ERROR("Top DICT not available");
+ if (cff->topdict == NULL)
+ CFF_ERROR("Top DICT not available");
- if (!cff_dict_known(cff->topdict, "charset")) {
- cff->flag |= CHARSETS_ISOADOBE;
- cff->charsets = NULL;
- return 0;
- }
+ if (!cff_dict_known(cff->topdict, "charset")) {
+ cff->flag |= CHARSETS_ISOADOBE;
+ cff->charsets = NULL;
+ return 0;
+ }
- offset = (long) cff_dict_get(cff->topdict, "charset", 0);
+ offset = (long) cff_dict_get(cff->topdict, "charset", 0);
- if (offset == 0) { /* predefined */
- cff->flag |= CHARSETS_ISOADOBE;
- cff->charsets = NULL;
- return 0;
- } else if (offset == 1) {
- cff->flag |= CHARSETS_EXPERT;
- cff->charsets = NULL;
- return 0;
- } else if (offset == 2) {
- cff->flag |= CHARSETS_EXPSUB;
- cff->charsets = NULL;
- return 0;
- }
+ if (offset == 0) { /* predefined */
+ cff->flag |= CHARSETS_ISOADOBE;
+ cff->charsets = NULL;
+ return 0;
+ } else if (offset == 1) {
+ cff->flag |= CHARSETS_EXPERT;
+ cff->charsets = NULL;
+ return 0;
+ } else if (offset == 2) {
+ cff->flag |= CHARSETS_EXPSUB;
+ cff->charsets = NULL;
+ return 0;
+ }
- cff->offset = offset;
- cff->charsets = charset = xcalloc(1, sizeof(cff_charsets));
- charset->format = get_card8(cff);
- charset->num_entries = 0;
-
- count = cff->num_glyphs - 1;
- length = 1;
-
- /* Not sure. Not well documented. */
- switch (charset->format) {
- case 0:
- charset->num_entries = cff->num_glyphs - 1; /* no .notdef */
- charset->data.glyphs = xcalloc(charset->num_entries, sizeof(s_SID));
- length += (charset->num_entries) * 2;
- for (i=0;i<(charset->num_entries);i++) {
- charset->data.glyphs[i] = get_card16(cff);
- }
- count = 0;
- break;
- case 1:
- {
- cff_range1 *ranges = NULL;
- while (count > 0 && charset->num_entries < cff->num_glyphs) {
- ranges = xrealloc(ranges, (charset->num_entries + 1)*sizeof(cff_range1));
- ranges[charset->num_entries].first = get_card16(cff);
- ranges[charset->num_entries].n_left = get_card8(cff);
- count -= ranges[charset->num_entries].n_left + 1; /* no-overrap */
- charset->num_entries += 1;
- charset->data.range1 = ranges;
- }
- length += (charset->num_entries) * 3;
- }
- break;
- case 2:
- {
- cff_range2 *ranges = NULL;
- while (count > 0 && charset->num_entries < cff->num_glyphs) {
- ranges = xrealloc(ranges, (charset->num_entries + 1)*sizeof(cff_range2));
- ranges[charset->num_entries].first = get_card16(cff);
- ranges[charset->num_entries].n_left = get_card16(cff);
- count -= ranges[charset->num_entries].n_left + 1; /* non-overrapping */
- charset->num_entries += 1;
- }
- charset->data.range2 = ranges;
- length += (charset->num_entries) * 4;
- }
- break;
- default:
- xfree(charset);
- CFF_ERROR("Unknown Charset format");
- break;
- }
+ cff->offset = offset;
+ cff->charsets = charset = xcalloc(1, sizeof(cff_charsets));
+ charset->format = get_card8(cff);
+ charset->num_entries = 0;
- if (count > 0)
- CFF_ERROR("Charset data possibly broken");
+ count = cff->num_glyphs - 1;
+ length = 1;
- return length;
+ /* Not sure. Not well documented. */
+ switch (charset->format) {
+ case 0:
+ charset->num_entries = cff->num_glyphs - 1; /* no .notdef */
+ charset->data.glyphs = xcalloc(charset->num_entries, sizeof(s_SID));
+ length += (charset->num_entries) * 2;
+ for (i = 0; i < (charset->num_entries); i++) {
+ charset->data.glyphs[i] = get_card16(cff);
+ }
+ count = 0;
+ break;
+ case 1:
+ {
+ cff_range1 *ranges = NULL;
+ while (count > 0 && charset->num_entries < cff->num_glyphs) {
+ ranges =
+ xrealloc(ranges,
+ (charset->num_entries + 1) * sizeof(cff_range1));
+ ranges[charset->num_entries].first = get_card16(cff);
+ ranges[charset->num_entries].n_left = get_card8(cff);
+ count -= ranges[charset->num_entries].n_left + 1; /* no-overrap */
+ charset->num_entries += 1;
+ charset->data.range1 = ranges;
+ }
+ length += (charset->num_entries) * 3;
+ }
+ break;
+ case 2:
+ {
+ cff_range2 *ranges = NULL;
+ while (count > 0 && charset->num_entries < cff->num_glyphs) {
+ ranges =
+ xrealloc(ranges,
+ (charset->num_entries + 1) * sizeof(cff_range2));
+ ranges[charset->num_entries].first = get_card16(cff);
+ ranges[charset->num_entries].n_left = get_card16(cff);
+ count -= ranges[charset->num_entries].n_left + 1; /* non-overrapping */
+ charset->num_entries += 1;
+ }
+ charset->data.range2 = ranges;
+ length += (charset->num_entries) * 4;
+ }
+ break;
+ default:
+ xfree(charset);
+ CFF_ERROR("Unknown Charset format");
+ break;
+ }
+
+ if (count > 0)
+ CFF_ERROR("Charset data possibly broken");
+
+ return length;
}
-long cff_pack_charsets (cff_font *cff, card8 *dest, long destlen)
+long cff_pack_charsets(cff_font * cff, card8 * dest, long destlen)
{
- long len = 0;
- card16 i;
- cff_charsets *charset;
-
- if (cff->flag & HAVE_STANDARD_CHARSETS || cff->charsets == NULL)
- return 0;
+ long len = 0;
+ card16 i;
+ cff_charsets *charset;
- if (destlen < 1)
- CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
+ if (cff->flag & HAVE_STANDARD_CHARSETS || cff->charsets == NULL)
+ return 0;
- charset = cff->charsets;
+ if (destlen < 1)
+ CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
- dest[len++] = charset->format;
- switch (charset->format) {
- case 0:
- if (destlen < len + (charset->num_entries)*2)
- CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
- for (i=0;i<(charset->num_entries);i++) {
- s_SID sid = (charset->data).glyphs[i]; /* or CID */
- dest[len++] = (sid >> 8) & 0xff;
- dest[len++] = sid & 0xff;
- }
- break;
- case 1:
- {
- if (destlen < len + (charset->num_entries)*3)
- CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
- for (i=0;i<(charset->num_entries);i++) {
- dest[len++] = ((charset->data).range1[i].first >> 8) & 0xff;
- dest[len++] = (charset->data).range1[i].first & 0xff;
- dest[len++] = (charset->data).range1[i].n_left;
- }
- }
- break;
- case 2:
- {
- if (destlen < len + (charset->num_entries)*4)
- CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
- for (i=0;i<(charset->num_entries);i++) {
- dest[len++] = ((charset->data).range2[i].first >> 8) & 0xff;
- dest[len++] = (charset->data).range2[i].first & 0xff;
- dest[len++] = ((charset->data).range2[i].n_left >> 8) & 0xff;
- dest[len++] = (charset->data).range2[i].n_left & 0xff;
- }
- }
- break;
- default:
- CFF_ERROR("Unknown Charset format");
- break;
- }
+ charset = cff->charsets;
- return len;
+ dest[len++] = charset->format;
+ switch (charset->format) {
+ case 0:
+ if (destlen < len + (charset->num_entries) * 2)
+ CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
+ for (i = 0; i < (charset->num_entries); i++) {
+ s_SID sid = (charset->data).glyphs[i]; /* or CID */
+ dest[len++] = (sid >> 8) & 0xff;
+ dest[len++] = sid & 0xff;
+ }
+ break;
+ case 1:
+ {
+ if (destlen < len + (charset->num_entries) * 3)
+ CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
+ for (i = 0; i < (charset->num_entries); i++) {
+ dest[len++] = ((charset->data).range1[i].first >> 8) & 0xff;
+ dest[len++] = (charset->data).range1[i].first & 0xff;
+ dest[len++] = (charset->data).range1[i].n_left;
+ }
+ }
+ break;
+ case 2:
+ {
+ if (destlen < len + (charset->num_entries) * 4)
+ CFF_ERROR("in cff_pack_charsets(): Buffer overflow");
+ for (i = 0; i < (charset->num_entries); i++) {
+ dest[len++] = ((charset->data).range2[i].first >> 8) & 0xff;
+ dest[len++] = (charset->data).range2[i].first & 0xff;
+ dest[len++] = ((charset->data).range2[i].n_left >> 8) & 0xff;
+ dest[len++] = (charset->data).range2[i].n_left & 0xff;
+ }
+ }
+ break;
+ default:
+ CFF_ERROR("Unknown Charset format");
+ break;
+ }
+
+ return len;
}
@@ -1771,14 +1812,14 @@ static int status = CS_PARSE_CFF_ERROR;
/* hintmask and cntrmask need number of stem zones */
static int num_stems = 0;
-static int phase = 0;
+static int phase = 0;
/* subroutine nesting */
-static int cs2_nest = 0;
+static int cs2_nest = 0;
/* advance width */
-static int have_width = 0;
-static double width = 0.0;
+static int have_width = 0;
+static double width = 0.0;
/*
* Standard Encoding Accented Characters:
@@ -1787,11 +1828,11 @@ static double width = 0.0;
*/
#if 0
/* adx ady bchar achar endchar */
-static double seac[4] = {0.0, 0.0, 0.0, 0.0};
+static double seac[4] = { 0.0, 0.0, 0.0, 0.0 };
#endif
/* Operand stack and Transient array */
-static int cs2_stack_top = 0;
+static int cs2_stack_top = 0;
static double cs2_arg_stack[CS_ARG_STACK_MAX];
static double trn_array[CS_TRANS_ARRAY_MAX];
@@ -1864,7 +1905,7 @@ static double trn_array[CS_TRANS_ARRAY_MAX];
/* RESERVED 19 */
#define cs_put 20
#define cs_get 21
-#define cs_ifelse 22
+#define cs_ifelse 22
#define cs_random 23
#define cs_mul 24
/* RESERVED 25 */
@@ -1884,60 +1925,59 @@ static double trn_array[CS_TRANS_ARRAY_MAX];
/*
* clear_stack() put all operands sotred in operand stack to dest.
*/
-static void
-clear_stack (card8 **dest, card8 *limit)
+static void clear_stack(card8 ** dest, card8 * limit)
{
- int i;
-
- for (i = 0; i < cs2_stack_top; i++) {
- double value;
- long ivalue;
- value = cs2_arg_stack[i];
- /* Nearest integer value */
- ivalue = (long) floor(value+0.5);
- if (value >= 0x8000L || value <= (-0x8000L - 1)) {
- /*
- * This number cannot be represented as a single operand.
- * We must use `a b mul ...' or `a c div' to represent large values.
- */
- CFF_ERROR("Argument value too large. (This is bug)");
- } else if (fabs(value - ivalue) > 3.0e-5) {
- /* 16.16-bit signed fixed value */
- DST_NEED(limit, *dest + 5);
- *(*dest)++ = 255;
- ivalue = (long) floor(value); /* mantissa */
- *(*dest)++ = (ivalue >> 8) & 0xff;
- *(*dest)++ = ivalue & 0xff;
- ivalue = (long)((value - ivalue) * 0x10000l); /* fraction */
- *(*dest)++ = (ivalue >> 8) & 0xff;
- *(*dest)++ = ivalue & 0xff;
- /* Everything else are integers. */
- } else if (ivalue >= -107 && ivalue <= 107) {
- DST_NEED(limit, *dest + 1);
- *(*dest)++ = ivalue + 139;
- } else if (ivalue >= 108 && ivalue <= 1131) {
- DST_NEED(limit, *dest + 2);
- ivalue = 0xf700u + ivalue - 108;
- *(*dest)++ = (ivalue >> 8) & 0xff;
- *(*dest)++ = ivalue & 0xff;
- } else if (ivalue >= -1131 && ivalue <= -108) {
- DST_NEED(limit, *dest + 2);
- ivalue = 0xfb00u - ivalue - 108;
- *(*dest)++ = (ivalue >> 8) & 0xff;
- *(*dest)++ = ivalue & 0xff;
- } else if (ivalue >= -32768 && ivalue <= 32767) { /* shortint */
- DST_NEED(limit, *dest + 3);
- *(*dest)++ = 28;
- *(*dest)++ = (ivalue >> 8) & 0xff;
- *(*dest)++ = (ivalue) & 0xff;
- } else { /* Shouldn't come here */
- CFF_ERROR("Unexpected error.");
- }
- }
+ int i;
- cs2_stack_top = 0; /* clear stack */
+ for (i = 0; i < cs2_stack_top; i++) {
+ double value;
+ long ivalue;
+ value = cs2_arg_stack[i];
+ /* Nearest integer value */
+ ivalue = (long) floor(value + 0.5);
+ if (value >= 0x8000L || value <= (-0x8000L - 1)) {
+ /*
+ * This number cannot be represented as a single operand.
+ * We must use `a b mul ...' or `a c div' to represent large values.
+ */
+ CFF_ERROR("Argument value too large. (This is bug)");
+ } else if (fabs(value - ivalue) > 3.0e-5) {
+ /* 16.16-bit signed fixed value */
+ DST_NEED(limit, *dest + 5);
+ *(*dest)++ = 255;
+ ivalue = (long) floor(value); /* mantissa */
+ *(*dest)++ = (ivalue >> 8) & 0xff;
+ *(*dest)++ = ivalue & 0xff;
+ ivalue = (long) ((value - ivalue) * 0x10000l); /* fraction */
+ *(*dest)++ = (ivalue >> 8) & 0xff;
+ *(*dest)++ = ivalue & 0xff;
+ /* Everything else are integers. */
+ } else if (ivalue >= -107 && ivalue <= 107) {
+ DST_NEED(limit, *dest + 1);
+ *(*dest)++ = ivalue + 139;
+ } else if (ivalue >= 108 && ivalue <= 1131) {
+ DST_NEED(limit, *dest + 2);
+ ivalue = 0xf700u + ivalue - 108;
+ *(*dest)++ = (ivalue >> 8) & 0xff;
+ *(*dest)++ = ivalue & 0xff;
+ } else if (ivalue >= -1131 && ivalue <= -108) {
+ DST_NEED(limit, *dest + 2);
+ ivalue = 0xfb00u - ivalue - 108;
+ *(*dest)++ = (ivalue >> 8) & 0xff;
+ *(*dest)++ = ivalue & 0xff;
+ } else if (ivalue >= -32768 && ivalue <= 32767) { /* shortint */
+ DST_NEED(limit, *dest + 3);
+ *(*dest)++ = 28;
+ *(*dest)++ = (ivalue >> 8) & 0xff;
+ *(*dest)++ = (ivalue) & 0xff;
+ } else { /* Shouldn't come here */
+ CFF_ERROR("Unexpected error.");
+ }
+ }
+
+ cs2_stack_top = 0; /* clear stack */
- return;
+ return;
}
/*
@@ -1951,122 +1991,122 @@ clear_stack (card8 **dest, card8 *limit)
*/
static void
-do_operator1 (card8 **dest, card8 *limit, card8 **data, card8 *endptr)
+do_operator1(card8 ** dest, card8 * limit, card8 ** data, card8 * endptr)
{
- card8 op = **data;
-
- *data += 1;
-
- switch (op) {
- case cs_hstemhm:
- case cs_vstemhm:
- /* charstring may have hintmask if above operator have seen */
- case cs_hstem:
- case cs_vstem:
- if (phase == 0 && (cs2_stack_top % 2)) {
- have_width = 1;
- width = cs2_arg_stack[0];
- }
- num_stems += cs2_stack_top/2;
- clear_stack(dest, limit);
- DST_NEED(limit, *dest + 1);
- *(*dest)++ = op;
- phase = 1;
- break;
- case cs_hintmask:
- case cs_cntrmask:
- if (phase < 2) {
- if (phase == 0 && (cs2_stack_top % 2)) {
- have_width = 1;
- width = cs2_arg_stack[0];
- }
- num_stems += cs2_stack_top/2;
- }
- clear_stack(dest, limit);
- DST_NEED(limit, *dest + 1);
- *(*dest)++ = op;
- if (num_stems > 0) {
- int masklen = (num_stems + 7) / 8;
- DST_NEED(limit, *dest + masklen);
- SRC_NEED(endptr, *data + masklen);
- memmove(*dest, *data, masklen);
- *data += masklen;
- *dest += masklen;
- }
- phase = 2;
- break;
- case cs_rmoveto:
- if (phase == 0 && (cs2_stack_top % 2)) {
- have_width = 1;
- width = cs2_arg_stack[0];
- }
- clear_stack(dest, limit);
- DST_NEED(limit, *dest + 1);
- *(*dest)++ = op;
- phase = 2;
- break;
- case cs_hmoveto:
- case cs_vmoveto:
- if (phase == 0 && (cs2_stack_top % 2) == 0) {
- have_width = 1;
- width = cs2_arg_stack[0];
- }
- clear_stack(dest, limit);
- DST_NEED(limit, *dest + 1);
- *(*dest)++ = op;
- phase = 2;
- break;
- case cs_endchar:
- if (cs2_stack_top == 1) {
- have_width = 1;
- width = cs2_arg_stack[0];
- clear_stack(dest, limit);
- } else if (cs2_stack_top == 4 || cs2_stack_top == 5) {
- WARN("\"seac\" character deprecated in Type 2 charstring.");
- status = CS_PARSE_CFF_ERROR;
- return;
- } else if (cs2_stack_top > 0) {
- WARN("Operand stack not empty.");
- }
- DST_NEED(limit, *dest + 1);
- *(*dest)++ = op;
- status = CS_CHAR_END;
- break;
- /* above oprators are candidate for first stack-clearing operator */
- case cs_rlineto:
- case cs_hlineto:
- case cs_vlineto:
- case cs_rrcurveto:
- case cs_rcurveline:
- case cs_rlinecurve:
- case cs_vvcurveto:
- case cs_hhcurveto:
- case cs_vhcurveto:
- case cs_hvcurveto:
- if (phase < 2) {
- WARN("Broken Type 2 charstring.");
- status = CS_PARSE_CFF_ERROR;
- return;
- }
- clear_stack(dest, limit);
- DST_NEED(limit, *dest + 1);
- *(*dest)++ = op;
- break;
- /* all operotors above are stack-clearing operator */
- /* no output */
- case cs_return:
- case cs_callgsubr:
- case cs_callsubr:
- CFF_ERROR("Unexpected call(g)subr/return");
- break;
- default:
- /* no-op ? */
- WARN("%s: Unknown charstring operator: 0x%02x", CS_TYPE2_DEBUG_STR, op);
- status = CS_PARSE_CFF_ERROR;
- break;
- }
+ card8 op = **data;
+
+ *data += 1;
+
+ switch (op) {
+ case cs_hstemhm:
+ case cs_vstemhm:
+ /* charstring may have hintmask if above operator have seen */
+ case cs_hstem:
+ case cs_vstem:
+ if (phase == 0 && (cs2_stack_top % 2)) {
+ have_width = 1;
+ width = cs2_arg_stack[0];
+ }
+ num_stems += cs2_stack_top / 2;
+ clear_stack(dest, limit);
+ DST_NEED(limit, *dest + 1);
+ *(*dest)++ = op;
+ phase = 1;
+ break;
+ case cs_hintmask:
+ case cs_cntrmask:
+ if (phase < 2) {
+ if (phase == 0 && (cs2_stack_top % 2)) {
+ have_width = 1;
+ width = cs2_arg_stack[0];
+ }
+ num_stems += cs2_stack_top / 2;
+ }
+ clear_stack(dest, limit);
+ DST_NEED(limit, *dest + 1);
+ *(*dest)++ = op;
+ if (num_stems > 0) {
+ int masklen = (num_stems + 7) / 8;
+ DST_NEED(limit, *dest + masklen);
+ SRC_NEED(endptr, *data + masklen);
+ memmove(*dest, *data, masklen);
+ *data += masklen;
+ *dest += masklen;
+ }
+ phase = 2;
+ break;
+ case cs_rmoveto:
+ if (phase == 0 && (cs2_stack_top % 2)) {
+ have_width = 1;
+ width = cs2_arg_stack[0];
+ }
+ clear_stack(dest, limit);
+ DST_NEED(limit, *dest + 1);
+ *(*dest)++ = op;
+ phase = 2;
+ break;
+ case cs_hmoveto:
+ case cs_vmoveto:
+ if (phase == 0 && (cs2_stack_top % 2) == 0) {
+ have_width = 1;
+ width = cs2_arg_stack[0];
+ }
+ clear_stack(dest, limit);
+ DST_NEED(limit, *dest + 1);
+ *(*dest)++ = op;
+ phase = 2;
+ break;
+ case cs_endchar:
+ if (cs2_stack_top == 1) {
+ have_width = 1;
+ width = cs2_arg_stack[0];
+ clear_stack(dest, limit);
+ } else if (cs2_stack_top == 4 || cs2_stack_top == 5) {
+ WARN("\"seac\" character deprecated in Type 2 charstring.");
+ status = CS_PARSE_CFF_ERROR;
+ return;
+ } else if (cs2_stack_top > 0) {
+ WARN("Operand stack not empty.");
+ }
+ DST_NEED(limit, *dest + 1);
+ *(*dest)++ = op;
+ status = CS_CHAR_END;
+ break;
+ /* above oprators are candidate for first stack-clearing operator */
+ case cs_rlineto:
+ case cs_hlineto:
+ case cs_vlineto:
+ case cs_rrcurveto:
+ case cs_rcurveline:
+ case cs_rlinecurve:
+ case cs_vvcurveto:
+ case cs_hhcurveto:
+ case cs_vhcurveto:
+ case cs_hvcurveto:
+ if (phase < 2) {
+ WARN("Broken Type 2 charstring.");
+ status = CS_PARSE_CFF_ERROR;
+ return;
+ }
+ clear_stack(dest, limit);
+ DST_NEED(limit, *dest + 1);
+ *(*dest)++ = op;
+ break;
+ /* all operotors above are stack-clearing operator */
+ /* no output */
+ case cs_return:
+ case cs_callgsubr:
+ case cs_callsubr:
+ CFF_ERROR("Unexpected call(g)subr/return");
+ break;
+ default:
+ /* no-op ? */
+ WARN("%s: Unknown charstring operator: 0x%02x", CS_TYPE2_DEBUG_STR, op);
+ status = CS_PARSE_CFF_ERROR;
+ break;
+ }
- return;
+ return;
}
/*
@@ -2077,272 +2117,276 @@ do_operator1 (card8 **dest, card8 *limit, card8 **data, card8 *endptr)
* random: How random ?
*/
static void
-do_operator2 (card8 **dest, card8 *limit, card8 **data, card8 *endptr)
+do_operator2(card8 ** dest, card8 * limit, card8 ** data, card8 * endptr)
{
- card8 op;
+ card8 op;
- *data += 1;
+ *data += 1;
- SRC_NEED(endptr, *data + 1);
+ SRC_NEED(endptr, *data + 1);
- op = **data;
- *data += 1;
+ op = **data;
+ *data += 1;
- switch(op) {
- case cs_dotsection: /* deprecated */
- WARN("Operator \"dotsection\" deprecated in Type 2 charstring.");
- status = CS_PARSE_CFF_ERROR;
- return;
- break;
- case cs_hflex:
- case cs_flex:
- case cs_hflex1:
- case cs_flex1:
- if (phase < 2) {
- WARN("%s: Broken Type 2 charstring.", CS_TYPE2_DEBUG_STR);
- status = CS_PARSE_CFF_ERROR;
- return;
- }
- clear_stack(dest, limit);
- DST_NEED(limit, *dest + 2);
- *(*dest)++ = cs_escape;
- *(*dest)++ = op;
- break;
- /* all operator above are stack-clearing */
- /* no output */
- case cs_and:
- NEED(cs2_stack_top, 2);
- cs2_stack_top--;
- if (cs2_arg_stack[cs2_stack_top] && cs2_arg_stack[cs2_stack_top-1]) {
- cs2_arg_stack[cs2_stack_top-1] = 1.0;
- } else {
- cs2_arg_stack[cs2_stack_top-1] = 0.0;
- }
- break;
- case cs_or:
- NEED(cs2_stack_top, 2);
- cs2_stack_top--;
- if (cs2_arg_stack[cs2_stack_top] || cs2_arg_stack[cs2_stack_top-1]) {
- cs2_arg_stack[cs2_stack_top-1] = 1.0;
- } else {
- cs2_arg_stack[cs2_stack_top-1] = 0.0;
- }
- break;
- case cs_not:
- NEED(cs2_stack_top, 1);
- if (cs2_arg_stack[cs2_stack_top-1]) {
- cs2_arg_stack[cs2_stack_top-1] = 0.0;
- } else {
- cs2_arg_stack[cs2_stack_top-1] = 1.0;
- }
- break;
- case cs_abs:
- NEED(cs2_stack_top, 1);
- cs2_arg_stack[cs2_stack_top-1] = fabs(cs2_arg_stack[cs2_stack_top-1]);
- break;
- case cs_add:
- NEED(cs2_stack_top, 2);
- cs2_arg_stack[cs2_stack_top-2] += cs2_arg_stack[cs2_stack_top-1];
- cs2_stack_top--;
- break;
- case cs_sub:
- NEED(cs2_stack_top, 2);
- cs2_arg_stack[cs2_stack_top-2] -= cs2_arg_stack[cs2_stack_top-1];
- cs2_stack_top--;
- break;
- case cs_div: /* doesn't check overflow */
- NEED(cs2_stack_top, 2);
- cs2_arg_stack[cs2_stack_top-2] /= cs2_arg_stack[cs2_stack_top-1];
- cs2_stack_top--;
- break;
- case cs_neg:
- NEED(cs2_stack_top, 1);
- cs2_arg_stack[cs2_stack_top-1] *= -1.0;
- break;
- case cs_eq:
- NEED(cs2_stack_top, 2);
- cs2_stack_top--;
- if (cs2_arg_stack[cs2_stack_top] == cs2_arg_stack[cs2_stack_top-1]) {
- cs2_arg_stack[cs2_stack_top-1] = 1.0;
- } else {
- cs2_arg_stack[cs2_stack_top-1] = 0.0;
- }
- break;
- case cs_drop:
- NEED(cs2_stack_top, 1);
- cs2_stack_top--;
- break;
- case cs_put:
- NEED(cs2_stack_top, 2);
- {
- int idx = (int)cs2_arg_stack[--cs2_stack_top];
- NEED(CS_TRANS_ARRAY_MAX, idx);
- trn_array[idx] = cs2_arg_stack[--cs2_stack_top];
- }
- break;
- case cs_get:
- NEED(cs2_stack_top, 1);
- {
- int idx = (int)cs2_arg_stack[cs2_stack_top-1];
- NEED(CS_TRANS_ARRAY_MAX, idx);
- cs2_arg_stack[cs2_stack_top-1] = trn_array[idx];
- }
- break;
- case cs_ifelse:
- NEED(cs2_stack_top, 4);
- cs2_stack_top -= 3;
- if (cs2_arg_stack[cs2_stack_top+1] > cs2_arg_stack[cs2_stack_top+2]) {
- cs2_arg_stack[cs2_stack_top-1] = cs2_arg_stack[cs2_stack_top];
- }
- break;
- case cs_mul:
- NEED(cs2_stack_top, 2);
- cs2_arg_stack[cs2_stack_top-2] = cs2_arg_stack[cs2_stack_top-2] * cs2_arg_stack[cs2_stack_top-1];
- cs2_stack_top--;
- break;
- case cs_sqrt:
- NEED(cs2_stack_top, 1);
- cs2_arg_stack[cs2_stack_top-1] = sqrt(cs2_arg_stack[cs2_stack_top-1]);
- break;
- case cs_dup:
- NEED(cs2_stack_top, 1);
- NEED(CS_ARG_STACK_MAX, cs2_stack_top+1);
- cs2_arg_stack[cs2_stack_top] = cs2_arg_stack[cs2_stack_top-1];
- cs2_stack_top++;
- break;
- case cs_exch:
- NEED(cs2_stack_top, 2);
- {
- double save = cs2_arg_stack[cs2_stack_top-2];
- cs2_arg_stack[cs2_stack_top-2] = cs2_arg_stack[cs2_stack_top-1];
- cs2_arg_stack[cs2_stack_top-1] = save;
+ switch (op) {
+ case cs_dotsection: /* deprecated */
+ WARN("Operator \"dotsection\" deprecated in Type 2 charstring.");
+ status = CS_PARSE_CFF_ERROR;
+ return;
+ break;
+ case cs_hflex:
+ case cs_flex:
+ case cs_hflex1:
+ case cs_flex1:
+ if (phase < 2) {
+ WARN("%s: Broken Type 2 charstring.", CS_TYPE2_DEBUG_STR);
+ status = CS_PARSE_CFF_ERROR;
+ return;
+ }
+ clear_stack(dest, limit);
+ DST_NEED(limit, *dest + 2);
+ *(*dest)++ = cs_escape;
+ *(*dest)++ = op;
+ break;
+ /* all operator above are stack-clearing */
+ /* no output */
+ case cs_and:
+ NEED(cs2_stack_top, 2);
+ cs2_stack_top--;
+ if (cs2_arg_stack[cs2_stack_top] && cs2_arg_stack[cs2_stack_top - 1]) {
+ cs2_arg_stack[cs2_stack_top - 1] = 1.0;
+ } else {
+ cs2_arg_stack[cs2_stack_top - 1] = 0.0;
+ }
+ break;
+ case cs_or:
+ NEED(cs2_stack_top, 2);
+ cs2_stack_top--;
+ if (cs2_arg_stack[cs2_stack_top] || cs2_arg_stack[cs2_stack_top - 1]) {
+ cs2_arg_stack[cs2_stack_top - 1] = 1.0;
+ } else {
+ cs2_arg_stack[cs2_stack_top - 1] = 0.0;
+ }
+ break;
+ case cs_not:
+ NEED(cs2_stack_top, 1);
+ if (cs2_arg_stack[cs2_stack_top - 1]) {
+ cs2_arg_stack[cs2_stack_top - 1] = 0.0;
+ } else {
+ cs2_arg_stack[cs2_stack_top - 1] = 1.0;
+ }
+ break;
+ case cs_abs:
+ NEED(cs2_stack_top, 1);
+ cs2_arg_stack[cs2_stack_top - 1] =
+ fabs(cs2_arg_stack[cs2_stack_top - 1]);
+ break;
+ case cs_add:
+ NEED(cs2_stack_top, 2);
+ cs2_arg_stack[cs2_stack_top - 2] += cs2_arg_stack[cs2_stack_top - 1];
+ cs2_stack_top--;
+ break;
+ case cs_sub:
+ NEED(cs2_stack_top, 2);
+ cs2_arg_stack[cs2_stack_top - 2] -= cs2_arg_stack[cs2_stack_top - 1];
+ cs2_stack_top--;
+ break;
+ case cs_div: /* doesn't check overflow */
+ NEED(cs2_stack_top, 2);
+ cs2_arg_stack[cs2_stack_top - 2] /= cs2_arg_stack[cs2_stack_top - 1];
+ cs2_stack_top--;
+ break;
+ case cs_neg:
+ NEED(cs2_stack_top, 1);
+ cs2_arg_stack[cs2_stack_top - 1] *= -1.0;
+ break;
+ case cs_eq:
+ NEED(cs2_stack_top, 2);
+ cs2_stack_top--;
+ if (cs2_arg_stack[cs2_stack_top] == cs2_arg_stack[cs2_stack_top - 1]) {
+ cs2_arg_stack[cs2_stack_top - 1] = 1.0;
+ } else {
+ cs2_arg_stack[cs2_stack_top - 1] = 0.0;
+ }
+ break;
+ case cs_drop:
+ NEED(cs2_stack_top, 1);
+ cs2_stack_top--;
+ break;
+ case cs_put:
+ NEED(cs2_stack_top, 2);
+ {
+ int idx = (int) cs2_arg_stack[--cs2_stack_top];
+ NEED(CS_TRANS_ARRAY_MAX, idx);
+ trn_array[idx] = cs2_arg_stack[--cs2_stack_top];
+ }
+ break;
+ case cs_get:
+ NEED(cs2_stack_top, 1);
+ {
+ int idx = (int) cs2_arg_stack[cs2_stack_top - 1];
+ NEED(CS_TRANS_ARRAY_MAX, idx);
+ cs2_arg_stack[cs2_stack_top - 1] = trn_array[idx];
+ }
+ break;
+ case cs_ifelse:
+ NEED(cs2_stack_top, 4);
+ cs2_stack_top -= 3;
+ if (cs2_arg_stack[cs2_stack_top + 1] > cs2_arg_stack[cs2_stack_top + 2]) {
+ cs2_arg_stack[cs2_stack_top - 1] = cs2_arg_stack[cs2_stack_top];
+ }
+ break;
+ case cs_mul:
+ NEED(cs2_stack_top, 2);
+ cs2_arg_stack[cs2_stack_top - 2] =
+ cs2_arg_stack[cs2_stack_top - 2] * cs2_arg_stack[cs2_stack_top - 1];
+ cs2_stack_top--;
+ break;
+ case cs_sqrt:
+ NEED(cs2_stack_top, 1);
+ cs2_arg_stack[cs2_stack_top - 1] =
+ sqrt(cs2_arg_stack[cs2_stack_top - 1]);
+ break;
+ case cs_dup:
+ NEED(cs2_stack_top, 1);
+ NEED(CS_ARG_STACK_MAX, cs2_stack_top + 1);
+ cs2_arg_stack[cs2_stack_top] = cs2_arg_stack[cs2_stack_top - 1];
+ cs2_stack_top++;
+ break;
+ case cs_exch:
+ NEED(cs2_stack_top, 2);
+ {
+ double save = cs2_arg_stack[cs2_stack_top - 2];
+ cs2_arg_stack[cs2_stack_top - 2] = cs2_arg_stack[cs2_stack_top - 1];
+ cs2_arg_stack[cs2_stack_top - 1] = save;
+ }
+ break;
+ case cs_index:
+ NEED(cs2_stack_top, 2); /* need two arguments at least */
+ {
+ int idx = (int) cs2_arg_stack[cs2_stack_top - 1];
+ if (idx < 0) {
+ cs2_arg_stack[cs2_stack_top - 1] =
+ cs2_arg_stack[cs2_stack_top - 2];
+ } else {
+ NEED(cs2_stack_top, idx + 2);
+ cs2_arg_stack[cs2_stack_top - 1] =
+ cs2_arg_stack[cs2_stack_top - idx - 2];
+ }
+ }
+ break;
+ case cs_roll:
+ NEED(cs2_stack_top, 2);
+ {
+ int N, J;
+ J = (int) cs2_arg_stack[--cs2_stack_top];
+ N = (int) cs2_arg_stack[--cs2_stack_top];
+ NEED(cs2_stack_top, N);
+ if (J > 0) {
+ J = J % N;
+ while (J-- > 0) {
+ double save = cs2_arg_stack[cs2_stack_top - 1];
+ int i = cs2_stack_top - 1;
+ while (i > cs2_stack_top - N) {
+ cs2_arg_stack[i] = cs2_arg_stack[i - 1];
+ i--;
+ }
+ cs2_arg_stack[i] = save;
+ }
+ } else {
+ J = (-J) % N;
+ while (J-- > 0) {
+ double save = cs2_arg_stack[cs2_stack_top - N];
+ int i = cs2_stack_top - N;
+ while (i < cs2_stack_top - 1) {
+ cs2_arg_stack[i] = cs2_arg_stack[i + 1];
+ i++;
+ }
+ cs2_arg_stack[i] = save;
+ }
+ }
+ }
+ break;
+ case cs_random:
+ WARN("%s: Charstring operator \"random\" found.", CS_TYPE2_DEBUG_STR);
+ NEED(CS_ARG_STACK_MAX, cs2_stack_top + 1);
+ cs2_arg_stack[cs2_stack_top++] = 1.0;
+ break;
+ default:
+ /* no-op ? */
+ WARN("%s: Unknown charstring operator: 0x0c%02x", CS_TYPE2_DEBUG_STR,
+ op);
+ status = CS_PARSE_CFF_ERROR;
+ break;
}
- break;
- case cs_index:
- NEED(cs2_stack_top, 2); /* need two arguments at least */
- {
- int idx = (int)cs2_arg_stack[cs2_stack_top-1];
- if (idx < 0) {
- cs2_arg_stack[cs2_stack_top-1] = cs2_arg_stack[cs2_stack_top-2];
- } else {
- NEED(cs2_stack_top, idx+2);
- cs2_arg_stack[cs2_stack_top-1] = cs2_arg_stack[cs2_stack_top-idx-2];
- }
- }
- break;
- case cs_roll:
- NEED(cs2_stack_top, 2);
- {
- int N, J;
- J = (int)cs2_arg_stack[--cs2_stack_top];
- N = (int)cs2_arg_stack[--cs2_stack_top];
- NEED(cs2_stack_top, N);
- if (J > 0) {
- J = J % N;
- while (J-- > 0) {
- double save = cs2_arg_stack[cs2_stack_top-1];
- int i = cs2_stack_top - 1;
- while (i > cs2_stack_top-N) {
- cs2_arg_stack[i] = cs2_arg_stack[i-1];
- i--;
- }
- cs2_arg_stack[i] = save;
- }
- } else {
- J = (-J) % N;
- while (J-- > 0) {
- double save = cs2_arg_stack[cs2_stack_top-N];
- int i = cs2_stack_top - N;
- while (i < cs2_stack_top-1) {
- cs2_arg_stack[i] = cs2_arg_stack[i+1];
- i++;
- }
- cs2_arg_stack[i] = save;
- }
- }
- }
- break;
- case cs_random:
- WARN("%s: Charstring operator \"random\" found.", CS_TYPE2_DEBUG_STR);
- NEED(CS_ARG_STACK_MAX, cs2_stack_top+1);
- cs2_arg_stack[cs2_stack_top++] = 1.0;
- break;
- default:
- /* no-op ? */
- WARN("%s: Unknown charstring operator: 0x0c%02x", CS_TYPE2_DEBUG_STR, op);
- status = CS_PARSE_CFF_ERROR;
- break;
- }
- return;
+ return;
}
/*
* integer:
* exactly the same as the DICT encoding (except 29)
*/
-static void
-cs2_get_integer (card8 **data, card8 *endptr)
+static void cs2_get_integer(card8 ** data, card8 * endptr)
{
- long result = 0;
- card8 b0 = **data, b1, b2;
-
- *data += 1;
-
- if (b0 == 28) { /* shortint */
- SRC_NEED(endptr, *data + 2);
- b1 = **data;
- b2 = *(*data+1);
- result = b1*256+b2;
- if (result > 0x7fff)
- result -= 0x10000L;
- *data += 2;
- } else if (b0 >= 32 && b0 <= 246) { /* int (1) */
- result = b0 - 139;
- } else if (b0 >= 247 && b0 <= 250) { /* int (2) */
- SRC_NEED(endptr, *data + 1);
- b1 = **data;
- result = (b0-247)*256+b1+108;
- *data += 1;
- } else if (b0 >= 251 && b0 <= 254) {
- SRC_NEED(endptr, *data + 1);
- b1 = **data;
- result = -(b0-251)*256-b1-108;
+ long result = 0;
+ card8 b0 = **data, b1, b2;
+
*data += 1;
- } else {
- status = CS_PARSE_CFF_ERROR;
- return;
- }
- NEED(CS_ARG_STACK_MAX, cs2_stack_top+1);
- cs2_arg_stack[cs2_stack_top++] = (double) result;
+ if (b0 == 28) { /* shortint */
+ SRC_NEED(endptr, *data + 2);
+ b1 = **data;
+ b2 = *(*data + 1);
+ result = b1 * 256 + b2;
+ if (result > 0x7fff)
+ result -= 0x10000L;
+ *data += 2;
+ } else if (b0 >= 32 && b0 <= 246) { /* int (1) */
+ result = b0 - 139;
+ } else if (b0 >= 247 && b0 <= 250) { /* int (2) */
+ SRC_NEED(endptr, *data + 1);
+ b1 = **data;
+ result = (b0 - 247) * 256 + b1 + 108;
+ *data += 1;
+ } else if (b0 >= 251 && b0 <= 254) {
+ SRC_NEED(endptr, *data + 1);
+ b1 = **data;
+ result = -(b0 - 251) * 256 - b1 - 108;
+ *data += 1;
+ } else {
+ status = CS_PARSE_CFF_ERROR;
+ return;
+ }
+
+ NEED(CS_ARG_STACK_MAX, cs2_stack_top + 1);
+ cs2_arg_stack[cs2_stack_top++] = (double) result;
- return;
+ return;
}
/*
* Signed 16.16-bits fixed number for Type 2 charstring encoding
*/
-static void
-get_fixed (card8 **data, card8 *endptr)
+static void get_fixed(card8 ** data, card8 * endptr)
{
- long ivalue;
- double rvalue;
+ long ivalue;
+ double rvalue;
- *data += 1;
+ *data += 1;
- SRC_NEED(endptr, *data + 4);
+ SRC_NEED(endptr, *data + 4);
- ivalue = *(*data) * 0x100 + *(*data+1);
- rvalue = (ivalue > 0x7fffL) ? (ivalue - 0x10000L) : ivalue;
- ivalue = *(*data+2) * 0x100 + *(*data+3);
- rvalue += ((double) ivalue) / 0x10000L;
+ ivalue = *(*data) * 0x100 + *(*data + 1);
+ rvalue = (ivalue > 0x7fffL) ? (ivalue - 0x10000L) : ivalue;
+ ivalue = *(*data + 2) * 0x100 + *(*data + 3);
+ rvalue += ((double) ivalue) / 0x10000L;
- NEED(CS_ARG_STACK_MAX, cs2_stack_top+1);
- cs2_arg_stack[cs2_stack_top++] = rvalue;
- *data += 4;
+ NEED(CS_ARG_STACK_MAX, cs2_stack_top + 1);
+ cs2_arg_stack[cs2_stack_top++] = rvalue;
+ *data += 4;
- return;
+ return;
}
/*
@@ -2354,32 +2398,33 @@ get_fixed (card8 **data, card8 *endptr)
* subr_idx: CFF INDEX data that contains subroutines.
* id: biased subroutine number.
*/
-static void
-get_subr (card8 **subr, long *len, cff_index *subr_idx, long id)
+static void get_subr(card8 ** subr, long *len, cff_index * subr_idx, long id)
{
- card16 count;
+ card16 count;
- if (subr_idx == NULL)
- CFF_ERROR("%s: Subroutine called but no subroutine found.", CS_TYPE2_DEBUG_STR);
+ if (subr_idx == NULL)
+ CFF_ERROR("%s: Subroutine called but no subroutine found.",
+ CS_TYPE2_DEBUG_STR);
- count = subr_idx->count;
+ count = subr_idx->count;
- /* Adding bias number */
- if (count < 1240) {
- id += 107;
- } else if (count < 33900) {
- id += 1131;
- } else {
- id += 32768;
- }
+ /* Adding bias number */
+ if (count < 1240) {
+ id += 107;
+ } else if (count < 33900) {
+ id += 1131;
+ } else {
+ id += 32768;
+ }
- if (id > count)
- CFF_ERROR("%s: Invalid Subr index: %ld (max=%u)", CS_TYPE2_DEBUG_STR, id, count);
+ if (id > count)
+ CFF_ERROR("%s: Invalid Subr index: %ld (max=%u)", CS_TYPE2_DEBUG_STR,
+ id, count);
- *len = (subr_idx->offset)[id + 1] - (subr_idx->offset)[id];
- *subr = subr_idx->data + (subr_idx->offset)[id] - 1;
+ *len = (subr_idx->offset)[id + 1] - (subr_idx->offset)[id];
+ *subr = subr_idx->data + (subr_idx->offset)[id] - 1;
- return;
+ return;
}
/*
@@ -2390,112 +2435,115 @@ get_subr (card8 **subr, long *len, cff_index *subr_idx, long id)
*/
static void
-do_charstring (card8 **dest, card8 *limit,
- card8 **data, card8 *endptr,
- cff_index *gsubr_idx, cff_index *subr_idx)
+do_charstring(card8 ** dest, card8 * limit,
+ card8 ** data, card8 * endptr,
+ cff_index * gsubr_idx, cff_index * subr_idx)
{
- card8 b0 = 0, *subr;
- long len;
-
- if (cs2_nest > CS_SUBR_NEST_MAX)
- CFF_ERROR("%s: Subroutine nested too deeply.", CS_TYPE2_DEBUG_STR);
-
- cs2_nest++;
-
- while (*data < endptr && status == CS_PARSE_OK) {
- b0 = **data;
- if (b0 == 255) { /* 16-bit.16-bit fixed signed number */
- get_fixed(data, endptr);
- } else if (b0 == cs_return) {
- status = CS_SUBR_RETURN;
- } else if (b0 == cs_callgsubr) {
- if (cs2_stack_top < 1) {
- status = CS_STACK_CFF_ERROR;
- } else {
- cs2_stack_top--;
- get_subr(&subr, &len, gsubr_idx, (long) cs2_arg_stack[cs2_stack_top]);
- if (*dest + len > limit)
- CFF_ERROR("%s: Possible buffer overflow.", CS_TYPE2_DEBUG_STR);
- do_charstring(dest, limit, &subr, subr + len,
- gsubr_idx, subr_idx);
- *data += 1;
- }
- } else if (b0 == cs_callsubr) {
- if (cs2_stack_top < 1) {
- status = CS_STACK_CFF_ERROR;
- } else {
- cs2_stack_top--;
- get_subr(&subr, &len, subr_idx, (long) cs2_arg_stack[cs2_stack_top]);
- if (limit < *dest + len)
- CFF_ERROR("%s: Possible buffer overflow.", CS_TYPE2_DEBUG_STR);
- do_charstring(dest, limit, &subr, subr + len,
- gsubr_idx, subr_idx);
- *data += 1;
- }
- } else if (b0 == cs_escape) {
- do_operator2(dest, limit, data, endptr);
- } else if (b0 < 32 && b0 != 28) { /* 19, 20 need mask */
- do_operator1(dest, limit, data, endptr);
- } else if ((b0 <= 22 && b0 >= 27) || b0 == 31) { /* reserved */
- status = CS_PARSE_CFF_ERROR; /* not an error ? */
- } else { /* integer */
- cs2_get_integer(data, endptr);
- }
- }
-
- if (status == CS_SUBR_RETURN) {
- status = CS_PARSE_OK;
- } else if (status == CS_CHAR_END && *data < endptr) {
- WARN("%s: Garbage after endchar.", CS_TYPE2_DEBUG_STR);
- } else if (status < CS_PARSE_OK) { /* error */
- CFF_ERROR("%s: Parsing charstring failed: (status=%d, stack=%d)",
- CS_TYPE2_DEBUG_STR, status, cs2_stack_top);
- }
-
- cs2_nest--;
+ card8 b0 = 0, *subr;
+ long len;
+
+ if (cs2_nest > CS_SUBR_NEST_MAX)
+ CFF_ERROR("%s: Subroutine nested too deeply.", CS_TYPE2_DEBUG_STR);
+
+ cs2_nest++;
+
+ while (*data < endptr && status == CS_PARSE_OK) {
+ b0 = **data;
+ if (b0 == 255) { /* 16-bit.16-bit fixed signed number */
+ get_fixed(data, endptr);
+ } else if (b0 == cs_return) {
+ status = CS_SUBR_RETURN;
+ } else if (b0 == cs_callgsubr) {
+ if (cs2_stack_top < 1) {
+ status = CS_STACK_CFF_ERROR;
+ } else {
+ cs2_stack_top--;
+ get_subr(&subr, &len, gsubr_idx,
+ (long) cs2_arg_stack[cs2_stack_top]);
+ if (*dest + len > limit)
+ CFF_ERROR("%s: Possible buffer overflow.",
+ CS_TYPE2_DEBUG_STR);
+ do_charstring(dest, limit, &subr, subr + len, gsubr_idx,
+ subr_idx);
+ *data += 1;
+ }
+ } else if (b0 == cs_callsubr) {
+ if (cs2_stack_top < 1) {
+ status = CS_STACK_CFF_ERROR;
+ } else {
+ cs2_stack_top--;
+ get_subr(&subr, &len, subr_idx,
+ (long) cs2_arg_stack[cs2_stack_top]);
+ if (limit < *dest + len)
+ CFF_ERROR("%s: Possible buffer overflow.",
+ CS_TYPE2_DEBUG_STR);
+ do_charstring(dest, limit, &subr, subr + len, gsubr_idx,
+ subr_idx);
+ *data += 1;
+ }
+ } else if (b0 == cs_escape) {
+ do_operator2(dest, limit, data, endptr);
+ } else if (b0 < 32 && b0 != 28) { /* 19, 20 need mask */
+ do_operator1(dest, limit, data, endptr);
+ } else if ((b0 <= 22 && b0 >= 27) || b0 == 31) { /* reserved */
+ status = CS_PARSE_CFF_ERROR; /* not an error ? */
+ } else { /* integer */
+ cs2_get_integer(data, endptr);
+ }
+ }
+
+ if (status == CS_SUBR_RETURN) {
+ status = CS_PARSE_OK;
+ } else if (status == CS_CHAR_END && *data < endptr) {
+ WARN("%s: Garbage after endchar.", CS_TYPE2_DEBUG_STR);
+ } else if (status < CS_PARSE_OK) { /* error */
+ CFF_ERROR("%s: Parsing charstring failed: (status=%d, stack=%d)",
+ CS_TYPE2_DEBUG_STR, status, cs2_stack_top);
+ }
+
+ cs2_nest--;
- return;
+ return;
}
-static void
-cs_parse_init (void)
+static void cs_parse_init(void)
{
- status = CS_PARSE_OK;
- cs2_nest = 0;
- phase = 0;
- num_stems = 0;
- cs2_stack_top = 0;
+ status = CS_PARSE_OK;
+ cs2_nest = 0;
+ phase = 0;
+ num_stems = 0;
+ cs2_stack_top = 0;
}
/*
* Not just copying...
*/
long
-cs_copy_charstring (card8 *dst, long dstlen,
- card8 *src, long srclen,
- cff_index *gsubr, cff_index *subr,
- double default_width, double nominal_width, cs_ginfo *ginfo)
+cs_copy_charstring(card8 * dst, long dstlen,
+ card8 * src, long srclen,
+ cff_index * gsubr, cff_index * subr,
+ double default_width, double nominal_width, cs_ginfo * ginfo)
{
- card8 *save = dst;
+ card8 *save = dst;
- cs_parse_init();
+ cs_parse_init();
- width = 0.0;
- have_width = 0;
+ width = 0.0;
+ have_width = 0;
- /* expand call(g)subrs */
- do_charstring(&dst, dst + dstlen, &src, src + srclen, gsubr, subr);
+ /* expand call(g)subrs */
+ do_charstring(&dst, dst + dstlen, &src, src + srclen, gsubr, subr);
- if (ginfo) {
- ginfo->flags = 0; /* not used */
- if (have_width) {
- ginfo->wx = nominal_width + width;
- } else {
- ginfo->wx = default_width;
+ if (ginfo) {
+ ginfo->flags = 0; /* not used */
+ if (have_width) {
+ ginfo->wx = nominal_width + width;
+ } else {
+ ginfo->wx = default_width;
+ }
}
- }
- return (long)(dst - save);
+ return (long) (dst - save);
}
/* encodings */
@@ -2505,243 +2553,244 @@ cs_copy_charstring (card8 *dst, long dstlen,
*
* Encoding and Charset arrays always begin with GID = 1.
*/
-long cff_read_encoding (cff_font *cff)
+long cff_read_encoding(cff_font * cff)
{
- cff_encoding *encoding;
- long offset, length;
- card8 i;
+ cff_encoding *encoding;
+ long offset, length;
+ card8 i;
- if (cff->topdict == NULL) {
- CFF_ERROR("Top DICT data not found");
- }
+ if (cff->topdict == NULL) {
+ CFF_ERROR("Top DICT data not found");
+ }
- if (!cff_dict_known(cff->topdict, "Encoding")) {
- cff->flag |= ENCODING_STANDARD;
- cff->encoding = NULL;
- return 0;
- }
+ if (!cff_dict_known(cff->topdict, "Encoding")) {
+ cff->flag |= ENCODING_STANDARD;
+ cff->encoding = NULL;
+ return 0;
+ }
- offset = (long) cff_dict_get(cff->topdict, "Encoding", 0);
- if (offset == 0) { /* predefined */
- cff->flag |= ENCODING_STANDARD;
- cff->encoding = NULL;
- return 0;
- } else if (offset == 1) {
- cff->flag |= ENCODING_EXPERT;
- cff->encoding = NULL;
- return 0;
- }
+ offset = (long) cff_dict_get(cff->topdict, "Encoding", 0);
+ if (offset == 0) { /* predefined */
+ cff->flag |= ENCODING_STANDARD;
+ cff->encoding = NULL;
+ return 0;
+ } else if (offset == 1) {
+ cff->flag |= ENCODING_EXPERT;
+ cff->encoding = NULL;
+ return 0;
+ }
- cff->offset= offset;
- cff->encoding = encoding = xcalloc(1, sizeof(cff_encoding));
- encoding->format = get_card8(cff);
- length = 1;
-
- switch (encoding->format & (~0x80)) {
- case 0:
- encoding->num_entries = get_card8(cff);
- (encoding->data).codes = xcalloc(encoding->num_entries, sizeof(card8));
- for (i=0;i<(encoding->num_entries);i++) {
- (encoding->data).codes[i] = get_card8(cff);
- }
- length += encoding->num_entries + 1;
- break;
- case 1:
- {
- cff_range1 *ranges;
- encoding->num_entries = get_card8(cff);
- encoding->data.range1 = ranges
- = xcalloc(encoding->num_entries, sizeof(cff_range1));
- for (i=0;i<(encoding->num_entries);i++) {
- ranges[i].first = get_card8(cff);
- ranges[i].n_left = get_card8(cff);
- }
- length += (encoding->num_entries) * 2 + 1;
- }
- break;
- default:
- xfree(encoding);
- CFF_ERROR("Unknown Encoding format");
- break;
- }
+ cff->offset = offset;
+ cff->encoding = encoding = xcalloc(1, sizeof(cff_encoding));
+ encoding->format = get_card8(cff);
+ length = 1;
- /* Supplementary data */
- if ((encoding->format) & 0x80) {
- cff_map *map;
- encoding->num_supps = get_card8(cff);
- encoding->supp = map = xcalloc(encoding->num_supps, sizeof(cff_map));
- for (i=0;i<(encoding->num_supps);i++) {
- map[i].code = get_card8(cff);
- map[i].glyph = get_card16(cff); /* SID */
- }
- length += (encoding->num_supps) * 3 + 1;
- } else {
- encoding->num_supps = 0;
- encoding->supp = NULL;
- }
+ switch (encoding->format & (~0x80)) {
+ case 0:
+ encoding->num_entries = get_card8(cff);
+ (encoding->data).codes = xcalloc(encoding->num_entries, sizeof(card8));
+ for (i = 0; i < (encoding->num_entries); i++) {
+ (encoding->data).codes[i] = get_card8(cff);
+ }
+ length += encoding->num_entries + 1;
+ break;
+ case 1:
+ {
+ cff_range1 *ranges;
+ encoding->num_entries = get_card8(cff);
+ encoding->data.range1 = ranges
+ = xcalloc(encoding->num_entries, sizeof(cff_range1));
+ for (i = 0; i < (encoding->num_entries); i++) {
+ ranges[i].first = get_card8(cff);
+ ranges[i].n_left = get_card8(cff);
+ }
+ length += (encoding->num_entries) * 2 + 1;
+ }
+ break;
+ default:
+ xfree(encoding);
+ CFF_ERROR("Unknown Encoding format");
+ break;
+ }
+
+ /* Supplementary data */
+ if ((encoding->format) & 0x80) {
+ cff_map *map;
+ encoding->num_supps = get_card8(cff);
+ encoding->supp = map = xcalloc(encoding->num_supps, sizeof(cff_map));
+ for (i = 0; i < (encoding->num_supps); i++) {
+ map[i].code = get_card8(cff);
+ map[i].glyph = get_card16(cff); /* SID */
+ }
+ length += (encoding->num_supps) * 3 + 1;
+ } else {
+ encoding->num_supps = 0;
+ encoding->supp = NULL;
+ }
- return length;
+ return length;
}
-long cff_pack_encoding (cff_font *cff, card8 *dest, long destlen)
+long cff_pack_encoding(cff_font * cff, card8 * dest, long destlen)
{
- long len = 0;
- cff_encoding *encoding;
- card16 i;
+ long len = 0;
+ cff_encoding *encoding;
+ card16 i;
- if (cff->flag & HAVE_STANDARD_ENCODING || cff->encoding == NULL)
- return 0;
+ if (cff->flag & HAVE_STANDARD_ENCODING || cff->encoding == NULL)
+ return 0;
- if (destlen < 2)
- CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
-
- encoding = cff->encoding;
-
- dest[len++] = encoding->format;
- dest[len++] = encoding->num_entries;
- switch (encoding->format & (~0x80)) {
- case 0:
- if (destlen < len + encoding->num_entries)
- CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
- for (i=0;i<(encoding->num_entries);i++) {
- dest[len++] = (encoding->data).codes[i];
- }
- break;
- case 1:
- {
- if (destlen < len + (encoding->num_entries)*2)
- CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
- for (i=0;i<(encoding->num_entries);i++) {
- dest[len++] = (encoding->data).range1[i].first & 0xff;
- dest[len++] = (encoding->data).range1[i].n_left;
- }
- }
- break;
- default:
- CFF_ERROR("Unknown Encoding format");
- break;
- }
+ if (destlen < 2)
+ CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
- if ((encoding->format) & 0x80) {
- if (destlen < len + (encoding->num_supps)*3 + 1)
- CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
- dest[len++] = encoding->num_supps;
- for (i=0;i<(encoding->num_supps);i++) {
- dest[len++] = (encoding->supp)[i].code;
- dest[len++] = ((encoding->supp)[i].glyph >> 8) & 0xff;
- dest[len++] = (encoding->supp)[i].glyph & 0xff;
- }
- }
+ encoding = cff->encoding;
- return len;
+ dest[len++] = encoding->format;
+ dest[len++] = encoding->num_entries;
+ switch (encoding->format & (~0x80)) {
+ case 0:
+ if (destlen < len + encoding->num_entries)
+ CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
+ for (i = 0; i < (encoding->num_entries); i++) {
+ dest[len++] = (encoding->data).codes[i];
+ }
+ break;
+ case 1:
+ {
+ if (destlen < len + (encoding->num_entries) * 2)
+ CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
+ for (i = 0; i < (encoding->num_entries); i++) {
+ dest[len++] = (encoding->data).range1[i].first & 0xff;
+ dest[len++] = (encoding->data).range1[i].n_left;
+ }
+ }
+ break;
+ default:
+ CFF_ERROR("Unknown Encoding format");
+ break;
+ }
+
+ if ((encoding->format) & 0x80) {
+ if (destlen < len + (encoding->num_supps) * 3 + 1)
+ CFF_ERROR("in cff_pack_encoding(): Buffer overflow");
+ dest[len++] = encoding->num_supps;
+ for (i = 0; i < (encoding->num_supps); i++) {
+ dest[len++] = (encoding->supp)[i].code;
+ dest[len++] = ((encoding->supp)[i].glyph >> 8) & 0xff;
+ dest[len++] = (encoding->supp)[i].glyph & 0xff;
+ }
+ }
+
+ return len;
}
/* CID-Keyed font specific */
-long cff_read_fdselect (cff_font *cff)
+long cff_read_fdselect(cff_font * cff)
{
- cff_fdselect *fdsel;
- long offset, length;
- card16 i;
-
- if (cff->topdict == NULL)
- CFF_ERROR("Top DICT not available");
-
- if (!(cff->flag & FONTTYPE_CIDFONT))
- return 0;
-
- offset = (long) cff_dict_get(cff->topdict, "FDSelect", 0);
- cff->offset = offset;
- cff->fdselect = fdsel = xcalloc(1, sizeof(cff_fdselect));
- fdsel->format = get_card8(cff);
-
- length = 1;
-
- switch (fdsel->format) {
- case 0:
- fdsel->num_entries = cff->num_glyphs;
- (fdsel->data).fds = xcalloc(fdsel->num_entries, sizeof(card8));
- for (i=0;i<(fdsel->num_entries);i++) {
- (fdsel->data).fds[i] = get_card8(cff);
- }
- length += fdsel->num_entries;
- break;
- case 3:
- {
- cff_range3 *ranges;
- fdsel->num_entries = get_card16(cff);
- fdsel->data.ranges = ranges = xcalloc(fdsel->num_entries, sizeof(cff_range3));
- for (i=0;i<(fdsel->num_entries);i++) {
- ranges[i].first = get_card16(cff);
- ranges[i].fd = get_card8(cff);
- }
- if (ranges[0].first != 0)
- CFF_ERROR("Range not starting with 0.");
- if (cff->num_glyphs != get_card16(cff))
- CFF_ERROR("Sentinel value mismatched with number of glyphs.");
- length += (fdsel->num_entries) * 3 + 4;
- }
- break;
- default:
- xfree(fdsel);
- CFF_ERROR("Unknown FDSelect format.");
- break;
- }
-
- return length;
+ cff_fdselect *fdsel;
+ long offset, length;
+ card16 i;
+
+ if (cff->topdict == NULL)
+ CFF_ERROR("Top DICT not available");
+
+ if (!(cff->flag & FONTTYPE_CIDFONT))
+ return 0;
+
+ offset = (long) cff_dict_get(cff->topdict, "FDSelect", 0);
+ cff->offset = offset;
+ cff->fdselect = fdsel = xcalloc(1, sizeof(cff_fdselect));
+ fdsel->format = get_card8(cff);
+
+ length = 1;
+
+ switch (fdsel->format) {
+ case 0:
+ fdsel->num_entries = cff->num_glyphs;
+ (fdsel->data).fds = xcalloc(fdsel->num_entries, sizeof(card8));
+ for (i = 0; i < (fdsel->num_entries); i++) {
+ (fdsel->data).fds[i] = get_card8(cff);
+ }
+ length += fdsel->num_entries;
+ break;
+ case 3:
+ {
+ cff_range3 *ranges;
+ fdsel->num_entries = get_card16(cff);
+ fdsel->data.ranges = ranges =
+ xcalloc(fdsel->num_entries, sizeof(cff_range3));
+ for (i = 0; i < (fdsel->num_entries); i++) {
+ ranges[i].first = get_card16(cff);
+ ranges[i].fd = get_card8(cff);
+ }
+ if (ranges[0].first != 0)
+ CFF_ERROR("Range not starting with 0.");
+ if (cff->num_glyphs != get_card16(cff))
+ CFF_ERROR("Sentinel value mismatched with number of glyphs.");
+ length += (fdsel->num_entries) * 3 + 4;
+ }
+ break;
+ default:
+ xfree(fdsel);
+ CFF_ERROR("Unknown FDSelect format.");
+ break;
+ }
+
+ return length;
}
-long cff_pack_fdselect (cff_font *cff, card8 *dest, long destlen)
+long cff_pack_fdselect(cff_font * cff, card8 * dest, long destlen)
{
- cff_fdselect *fdsel;
- long len = 0;
- card16 i;
-
- if (cff->fdselect == NULL)
- return 0;
+ cff_fdselect *fdsel;
+ long len = 0;
+ card16 i;
- if (destlen < 1)
- CFF_ERROR("in cff_pack_fdselect(): Buffur overflow");
-
- fdsel = cff->fdselect;
-
- dest[len++] = fdsel->format;
- switch (fdsel->format) {
- case 0:
- if (fdsel->num_entries != cff->num_glyphs)
- CFF_ERROR("in cff_pack_fdselect(): Invalid data");
- if (destlen < len + fdsel->num_entries)
- CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
- for (i=0;i<fdsel->num_entries;i++) {
- dest[len++] = (fdsel->data).fds[i];
- }
- break;
- case 3:
- {
- if (destlen < len + 2)
- CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
- len += 2;
- for (i=0;i<(fdsel->num_entries);i++) {
- if (destlen < len + 3)
- CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
- dest[len++] = ((fdsel->data).ranges[i].first >> 8) & 0xff;
- dest[len++] = (fdsel->data).ranges[i].first & 0xff;
- dest[len++] = (fdsel->data).ranges[i].fd;
- }
- if (destlen < len + 2)
- CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
- dest[len++] = (cff->num_glyphs >> 8) & 0xff;
- dest[len++] = cff->num_glyphs & 0xff;
- dest[1] = ((len/3 - 1) >> 8) & 0xff;
- dest[2] = (len/3 - 1) & 0xff;
- }
- break;
- default:
- CFF_ERROR("Unknown FDSelect format.");
- break;
- }
+ if (cff->fdselect == NULL)
+ return 0;
- return len;
+ if (destlen < 1)
+ CFF_ERROR("in cff_pack_fdselect(): Buffur overflow");
+
+ fdsel = cff->fdselect;
+
+ dest[len++] = fdsel->format;
+ switch (fdsel->format) {
+ case 0:
+ if (fdsel->num_entries != cff->num_glyphs)
+ CFF_ERROR("in cff_pack_fdselect(): Invalid data");
+ if (destlen < len + fdsel->num_entries)
+ CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
+ for (i = 0; i < fdsel->num_entries; i++) {
+ dest[len++] = (fdsel->data).fds[i];
+ }
+ break;
+ case 3:
+ {
+ if (destlen < len + 2)
+ CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
+ len += 2;
+ for (i = 0; i < (fdsel->num_entries); i++) {
+ if (destlen < len + 3)
+ CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
+ dest[len++] = ((fdsel->data).ranges[i].first >> 8) & 0xff;
+ dest[len++] = (fdsel->data).ranges[i].first & 0xff;
+ dest[len++] = (fdsel->data).ranges[i].fd;
+ }
+ if (destlen < len + 2)
+ CFF_ERROR("in cff_pack_fdselect(): Buffer overflow");
+ dest[len++] = (cff->num_glyphs >> 8) & 0xff;
+ dest[len++] = cff->num_glyphs & 0xff;
+ dest[1] = ((len / 3 - 1) >> 8) & 0xff;
+ dest[2] = (len / 3 - 1) & 0xff;
+ }
+ break;
+ default:
+ CFF_ERROR("Unknown FDSelect format.");
+ break;
+ }
+
+ return len;
}
@@ -2749,335 +2798,334 @@ long cff_pack_fdselect (cff_font *cff, card8 *dest, long destlen)
/*
* Create an instance of embeddable font.
*/
-static void
-write_fontfile (cff_font *cffont, char *fullname)
+static void write_fontfile(cff_font * cffont, char *fullname)
{
- cff_index *topdict, *fdarray, *private;
- unsigned char *dest;
- long destlen = 0, i, size;
- long offset, topdict_offset, fdarray_offset;
-
- /* DICT sizes (offset set to long int) */
- topdict = cff_new_index(1);
- fdarray = cff_new_index(cffont->num_fds);
- private = cff_new_index(cffont->num_fds);
-
- cff_dict_remove(cffont->topdict, "UniqueID");
- cff_dict_remove(cffont->topdict, "XUID");
- cff_dict_remove(cffont->topdict, "Private"); /* some bad font may have */
- cff_dict_remove(cffont->topdict, "Encoding"); /* some bad font may have */
-
- topdict->offset[1] = cff_dict_pack(cffont->topdict,
- (card8 *) work_buffer,
- WORK_BUFFER_SIZE) + 1;
- for (i = 0;i < cffont->num_fds; i++) {
- size = 0;
- if (cffont->private && cffont->private[i]) {
- size = cff_dict_pack(cffont->private[i],
- (card8 *) work_buffer, WORK_BUFFER_SIZE);
- if (size < 1) { /* Private had contained only Subr */
- cff_dict_remove(cffont->fdarray[i], "Private");
- }
- }
- (private->offset)[i+1] = (private->offset)[i] + size;
- (fdarray->offset)[i+1] = (fdarray->offset)[i] +
- cff_dict_pack(cffont->fdarray[i],
- (card8 *) work_buffer, WORK_BUFFER_SIZE);
- }
-
- destlen = 4; /* header size */
- destlen += cff_set_name(cffont, fullname);
- destlen += cff_index_size(topdict);
- destlen += cff_index_size(cffont->string);
- destlen += cff_index_size(cffont->gsubr);
- destlen += (cffont->charsets->num_entries) * 2 + 1; /* charset format 0 */
- destlen += (cffont->fdselect->num_entries) * 3 + 5; /* fdselect format 3 */
- destlen += cff_index_size(cffont->cstrings);
- destlen += cff_index_size(fdarray);
- destlen += private->offset[private->count] - 1; /* Private is not INDEX */
-
- dest = xcalloc(destlen, sizeof(card8));
-
- offset = 0;
- /* Header */
- offset += cff_put_header(cffont, dest + offset, destlen - offset);
- /* Name */
- offset += cff_pack_index(cffont->name, dest + offset, destlen - offset);
- /* Top DICT */
- topdict_offset = offset;
- offset += cff_index_size(topdict);
- /* Strings */
- offset += cff_pack_index(cffont->string, dest + offset, destlen - offset);
- /* Global Subrs */
- offset += cff_pack_index(cffont->gsubr, dest + offset, destlen - offset);
-
- /* charset */
- cff_dict_set(cffont->topdict, "charset", 0, offset);
- offset += cff_pack_charsets(cffont, dest + offset, destlen - offset);
-
- /* FDSelect */
- cff_dict_set(cffont->topdict, "FDSelect", 0, offset);
- offset += cff_pack_fdselect(cffont, dest + offset, destlen - offset);
-
- /* CharStrings */
- cff_dict_set(cffont->topdict, "CharStrings", 0, offset);
- offset += cff_pack_index(cffont->cstrings,
- dest + offset, cff_index_size(cffont->cstrings));
- cff_release_index(cffont->cstrings);
- cffont->cstrings = NULL; /* Charstrings cosumes huge memory */
-
- /* FDArray and Private */
- cff_dict_set(cffont->topdict, "FDArray", 0, offset);
- fdarray_offset = offset;
- offset += cff_index_size(fdarray);
-
- fdarray->data = xcalloc(fdarray->offset[fdarray->count] - 1, sizeof(card8));
- for (i = 0; i < cffont->num_fds; i++) {
- size = private->offset[i+1] - private->offset[i];
- if (cffont->private[i] && size > 0) {
- cff_dict_pack(cffont->private[i], dest + offset, size);
- cff_dict_set(cffont->fdarray[i], "Private", 0, size);
- cff_dict_set(cffont->fdarray[i], "Private", 1, offset);
- }
- cff_dict_pack(cffont->fdarray[i],
- fdarray->data + (fdarray->offset)[i] - 1,
- fdarray->offset[fdarray->count] - 1);
- offset += size;
- }
-
- cff_pack_index(fdarray, dest + fdarray_offset, cff_index_size(fdarray));
- cff_release_index(fdarray);
- cff_release_index(private);
-
- /* Finally Top DICT */
- topdict->data = xcalloc(topdict->offset[topdict->count] - 1, sizeof(card8));
- cff_dict_pack(cffont->topdict,
- topdict->data, topdict->offset[topdict->count] - 1);
- cff_pack_index(topdict, dest + topdict_offset, cff_index_size(topdict));
- cff_release_index(topdict);
-
- for (i = 0; i < offset; i++)
- fb_putchar (dest[i]);
-
- /*fprintf(stdout," (%i/%i)",offset,cffont->stream_size);*/
- xfree(dest);
- return ;
+ cff_index *topdict, *fdarray, *private;
+ unsigned char *dest;
+ long destlen = 0, i, size;
+ long offset, topdict_offset, fdarray_offset;
+
+ /* DICT sizes (offset set to long int) */
+ topdict = cff_new_index(1);
+ fdarray = cff_new_index(cffont->num_fds);
+ private = cff_new_index(cffont->num_fds);
+
+ cff_dict_remove(cffont->topdict, "UniqueID");
+ cff_dict_remove(cffont->topdict, "XUID");
+ cff_dict_remove(cffont->topdict, "Private"); /* some bad font may have */
+ cff_dict_remove(cffont->topdict, "Encoding"); /* some bad font may have */
+
+ topdict->offset[1] = cff_dict_pack(cffont->topdict,
+ (card8 *) work_buffer,
+ WORK_BUFFER_SIZE) + 1;
+ for (i = 0; i < cffont->num_fds; i++) {
+ size = 0;
+ if (cffont->private && cffont->private[i]) {
+ size = cff_dict_pack(cffont->private[i],
+ (card8 *) work_buffer, WORK_BUFFER_SIZE);
+ if (size < 1) { /* Private had contained only Subr */
+ cff_dict_remove(cffont->fdarray[i], "Private");
+ }
+ }
+ (private->offset)[i + 1] = (private->offset)[i] + size;
+ (fdarray->offset)[i + 1] = (fdarray->offset)[i] +
+ cff_dict_pack(cffont->fdarray[i],
+ (card8 *) work_buffer, WORK_BUFFER_SIZE);
+ }
+
+ destlen = 4; /* header size */
+ destlen += cff_set_name(cffont, fullname);
+ destlen += cff_index_size(topdict);
+ destlen += cff_index_size(cffont->string);
+ destlen += cff_index_size(cffont->gsubr);
+ destlen += (cffont->charsets->num_entries) * 2 + 1; /* charset format 0 */
+ destlen += (cffont->fdselect->num_entries) * 3 + 5; /* fdselect format 3 */
+ destlen += cff_index_size(cffont->cstrings);
+ destlen += cff_index_size(fdarray);
+ destlen += private->offset[private->count] - 1; /* Private is not INDEX */
+
+ dest = xcalloc(destlen, sizeof(card8));
+
+ offset = 0;
+ /* Header */
+ offset += cff_put_header(cffont, dest + offset, destlen - offset);
+ /* Name */
+ offset += cff_pack_index(cffont->name, dest + offset, destlen - offset);
+ /* Top DICT */
+ topdict_offset = offset;
+ offset += cff_index_size(topdict);
+ /* Strings */
+ offset += cff_pack_index(cffont->string, dest + offset, destlen - offset);
+ /* Global Subrs */
+ offset += cff_pack_index(cffont->gsubr, dest + offset, destlen - offset);
+
+ /* charset */
+ cff_dict_set(cffont->topdict, "charset", 0, offset);
+ offset += cff_pack_charsets(cffont, dest + offset, destlen - offset);
+
+ /* FDSelect */
+ cff_dict_set(cffont->topdict, "FDSelect", 0, offset);
+ offset += cff_pack_fdselect(cffont, dest + offset, destlen - offset);
+
+ /* CharStrings */
+ cff_dict_set(cffont->topdict, "CharStrings", 0, offset);
+ offset += cff_pack_index(cffont->cstrings,
+ dest + offset, cff_index_size(cffont->cstrings));
+ cff_release_index(cffont->cstrings);
+ cffont->cstrings = NULL; /* Charstrings cosumes huge memory */
+
+ /* FDArray and Private */
+ cff_dict_set(cffont->topdict, "FDArray", 0, offset);
+ fdarray_offset = offset;
+ offset += cff_index_size(fdarray);
+
+ fdarray->data = xcalloc(fdarray->offset[fdarray->count] - 1, sizeof(card8));
+ for (i = 0; i < cffont->num_fds; i++) {
+ size = private->offset[i + 1] - private->offset[i];
+ if (cffont->private[i] && size > 0) {
+ cff_dict_pack(cffont->private[i], dest + offset, size);
+ cff_dict_set(cffont->fdarray[i], "Private", 0, size);
+ cff_dict_set(cffont->fdarray[i], "Private", 1, offset);
+ }
+ cff_dict_pack(cffont->fdarray[i],
+ fdarray->data + (fdarray->offset)[i] - 1,
+ fdarray->offset[fdarray->count] - 1);
+ offset += size;
+ }
+
+ cff_pack_index(fdarray, dest + fdarray_offset, cff_index_size(fdarray));
+ cff_release_index(fdarray);
+ cff_release_index(private);
+
+ /* Finally Top DICT */
+ topdict->data = xcalloc(topdict->offset[topdict->count] - 1, sizeof(card8));
+ cff_dict_pack(cffont->topdict,
+ topdict->data, topdict->offset[topdict->count] - 1);
+ cff_pack_index(topdict, dest + topdict_offset, cff_index_size(topdict));
+ cff_release_index(topdict);
+
+ for (i = 0; i < offset; i++)
+ fb_putchar(dest[i]);
+
+ /*fprintf(stdout," (%i/%i)",offset,cffont->stream_size); */
+ xfree(dest);
+ return;
}
-/* if the CFF data was converted from an old type1 font, then the .notdef
- glyph may not be at id 0, so in that case |uglytype1fix| is nonzero */
-
-void write_cff(cff_font *cffont, fd_entry *fd, int uglytype1fix) {
- cff_index *charstrings, *cs_idx;
+/* this block is used a few times */
+
+#define DO_COPY_CHARSTRING() \
+ if ((avl_find(fd->gl_tree,glyph) != NULL)) { \
+ size = cs_idx->offset[code+1] - cs_idx->offset[code]; \
+ if (size > CS_STR_LEN_MAX) { \
+ pdftex_fail("Charstring too long: gid=%u, %ld bytes", code, size); \
+ } \
+ if (charstring_len + CS_STR_LEN_MAX >= max_len) { \
+ max_len = charstring_len + 2 * CS_STR_LEN_MAX; \
+ charstrings->data = xrealloc(charstrings->data, max_len*sizeof(card8)); \
+ } \
+ (charstrings->offset)[gid] = charstring_len + 1; \
+ cffont->offset= offset + (cs_idx->offset)[code] - 1; \
+ memcpy(data,&cffont->stream[cffont->offset],size); \
+ charstring_len += cs_copy_charstring(charstrings->data + charstring_len, \
+ max_len - charstring_len, \
+ data, size, \
+ cffont->gsubr, (cffont->subrs)[0], \
+ default_width, nominal_width, NULL); \
+ gid++; \
+ }
+
+void write_cff(cff_font * cffont, fd_entry * fd)
+{
+ cff_index *charstrings, *cs_idx;
- long charstring_len, max_len;
- long size, offset = 0;
+ long charstring_len, max_len;
+ long size, offset = 0;
- card8 *data;
- card16 num_glyphs, cs_count, code, gid, last_cid;
+ card8 *data;
+ card16 num_glyphs, cs_count, code, gid, last_cid;
- double nominal_width, default_width;
+ double nominal_width, default_width;
- char *fullname;
+ char *fullname;
- glw_entry *glyph, *found;
- struct avl_traverser t;
+ glw_entry *glyph, *found;
+ struct avl_traverser t;
+ fullname = xcalloc(8 + strlen(fd->fontname), 1);
+ sprintf(fullname, "%s+%s", fd->subset_tag, fd->fontname);
+ /* finish parsing the CFF */
+ cff_read_private(cffont);
+ cff_read_subrs(cffont);
-
- fullname = xcalloc(8+strlen(fd->fontname),1);
- sprintf(fullname,"%s+%s",fd->subset_tag,fd->fontname);
+ /*
+ * Widths
+ */
+ if (cffont->private[0] &&
+ cff_dict_known(cffont->private[0], "defaultWidthX")) {
+ default_width =
+ (double) cff_dict_get(cffont->private[0], "defaultWidthX", 0);
+ } else {
+ default_width = CFF_DEFAULTWIDTHX_DEFAULT;
+ }
+ if (cffont->private[0] &&
+ cff_dict_known(cffont->private[0], "nominalWidthX")) {
+ nominal_width =
+ (double) cff_dict_get(cffont->private[0], "nominalWidthX", 0);
+ } else {
+ nominal_width = CFF_NOMINALWIDTHX_DEFAULT;
+ }
- /* finish parsing the CFF */
- cff_read_private(cffont);
- cff_read_subrs (cffont);
+ num_glyphs = 0;
+ last_cid = 0;
+ glyph = xtalloc(1, glw_entry);
- /*
- * Widths
- */
- if (cffont->private[0] &&
- cff_dict_known(cffont->private[0], "defaultWidthX")) {
- default_width = (double) cff_dict_get(cffont->private[0], "defaultWidthX", 0);
- } else {
- default_width = CFF_DEFAULTWIDTHX_DEFAULT;
- }
- if (cffont->private[0] &&
- cff_dict_known(cffont->private[0], "nominalWidthX")) {
- nominal_width = (double) cff_dict_get(cffont->private[0], "nominalWidthX", 0);
- } else {
- nominal_width = CFF_NOMINALWIDTHX_DEFAULT;
- }
+ /* insert notdef */
+ glyph->id = 0;
+ if (avl_find(fd->gl_tree, glyph) == NULL) {
+ avl_insert(fd->gl_tree, glyph);
+ glyph = xtalloc(1, glw_entry);
+ }
- num_glyphs = 0;
- last_cid = 0;
- glyph = xtalloc(1,glw_entry);
+ avl_t_init(&t, fd->gl_tree);
+ for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
+ found != NULL; found = (glw_entry *) avl_t_next(&t)) {
+ if (found->id > last_cid)
+ last_cid = found->id;
+ num_glyphs++;
+ }
- /* insert notdef */
- glyph->id = uglytype1fix;
- if (avl_find(fd->gl_tree, glyph)==NULL) {
- /*fprintf(stderr,"seeding .notdef at %i\n",uglytype1fix);*/
- avl_insert(fd->gl_tree, glyph);
- glyph = xtalloc(1,glw_entry);
- }
+ {
+ cff_fdselect *fdselect;
+ fdselect = xcalloc(1, sizeof(cff_fdselect));
+ fdselect->format = 3;
+ fdselect->num_entries = 1;
+ fdselect->data.ranges = xcalloc(1, sizeof(cff_range3));
+ fdselect->data.ranges[0].first = 0;
+ fdselect->data.ranges[0].fd = 0;
+ cffont->fdselect = fdselect;
+ }
- avl_t_init(&t, fd->gl_tree);
- for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
- found != NULL;
- found = (glw_entry *) avl_t_next(&t)) {
- if (found->id > last_cid)
- last_cid = found->id;
- num_glyphs++;
- }
+ {
+ cff_charsets *charset;
+
+ charset = xcalloc(1, sizeof(cff_charsets));
+ charset->format = 0;
+ charset->num_entries = num_glyphs - 1;
+ charset->data.glyphs = xcalloc(num_glyphs, sizeof(s_SID));
+
+ gid = 0;
+
+ avl_t_init(&t, fd->gl_tree);
+ for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
+ found != NULL; found = (glw_entry *) avl_t_next(&t)) {
+ if (found->id != 0) {
+ charset->data.glyphs[gid] = found->id;
+ gid++;
+ }
+ }
+ cffont->charsets = charset;
+ }
+
+ cff_dict_add(cffont->topdict, "CIDCount", 1);
+ cff_dict_set(cffont->topdict, "CIDCount", 0, last_cid + 1);
+
+ cffont->fdarray = xcalloc(1, sizeof(cff_dict *));
+ cffont->fdarray[0] = cff_new_dict();
+ cff_dict_add(cffont->fdarray[0], "FontName", 1);
+ cff_dict_set(cffont->fdarray[0], "FontName", 0, (double) cff_add_string(cffont, fullname)); /* FIXME: Skip XXXXXX+ */
+ cff_dict_add(cffont->fdarray[0], "Private", 2);
+ cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
+ cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
+ /* FDArray - index offset, not known yet */
+ cff_dict_add(cffont->topdict, "FDArray", 1);
+ cff_dict_set(cffont->topdict, "FDArray", 0, 0.0);
+ /* FDSelect - offset, not known yet */
+ cff_dict_add(cffont->topdict, "FDSelect", 1);
+ cff_dict_set(cffont->topdict, "FDSelect", 0, 0.0);
+
+ cff_dict_remove(cffont->topdict, "UniqueID");
+ cff_dict_remove(cffont->topdict, "XUID");
+ cff_dict_remove(cffont->topdict, "Private");
+ cff_dict_remove(cffont->topdict, "Encoding");
+
+ cffont->offset = cff_dict_get(cffont->topdict, "CharStrings", 0);
+ cs_idx = cff_get_index_header(cffont);
+
+ offset = cffont->offset;
+ cs_count = cs_idx->count;
+ if (cs_count < 2) {
+ CFF_ERROR("No valid charstring data found.");
+ }
+
+ /* build the new charstrings entry */
+ charstrings = cff_new_index(cs_count + 1);
+ max_len = 2 * CS_STR_LEN_MAX;
+ charstrings->data = xcalloc(max_len, sizeof(card8));
+ charstring_len = 0;
- {
- cff_fdselect *fdselect;
+ gid = 0;
+ data = xcalloc(CS_STR_LEN_MAX, sizeof(card8));
- fdselect = xcalloc(1, sizeof(cff_fdselect));
- fdselect->format = 3;
- fdselect->num_entries = 1;
- fdselect->data.ranges = xcalloc(1, sizeof(cff_range3));
- fdselect->data.ranges[0].first = 0;
- fdselect->data.ranges[0].fd = 0;
- cffont->fdselect = fdselect;
- }
+ {
+ int i;
+ for (i = 0; i < cs_count; i++) {
+ code = i;
+ glyph->id = code;
+ DO_COPY_CHARSTRING();
+ }
+ }
- {
- cff_charsets *charset;
+ /* this happens if the internal metrics do not agree with the actual disk font */
+ if (gid < num_glyphs) {
+ WARN("embedded subset is smaller than expected: %d instead of %d glyphs.", gid, num_glyphs);
+ num_glyphs = gid;
+ }
- charset = xcalloc(1, sizeof(cff_charsets));
- charset->format = 0;
- charset->num_entries = num_glyphs-1;
- charset->data.glyphs = xcalloc(num_glyphs, sizeof(s_SID));
+ xfree(data);
+ cff_release_index(cs_idx);
- gid = 0;
+ (charstrings->offset)[num_glyphs] = charstring_len + 1;
+ charstrings->count = num_glyphs;
+ cffont->num_glyphs = num_glyphs;
+ cffont->cstrings = charstrings;
- avl_t_init(&t, fd->gl_tree);
- for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
- found != NULL;
- found = (glw_entry *) avl_t_next(&t)) {
- if(found->id!=0) {
- charset->data.glyphs[gid] = found->id;
- gid++;
- }
- }
- cffont->charsets = charset;
- }
+ /*
+ * We don't use subroutines at all.
+ */
+ if (cffont->gsubr)
+ cff_release_index(cffont->gsubr);
+ cffont->gsubr = cff_new_index(0);
- cff_dict_add(cffont->topdict, "CIDCount", 1);
- cff_dict_set(cffont->topdict, "CIDCount", 0, last_cid + 1);
-
- cffont->fdarray = xcalloc(1, sizeof(cff_dict *));
- cffont->fdarray[0] = cff_new_dict();
- cff_dict_add(cffont->fdarray[0], "FontName", 1);
- cff_dict_set(cffont->fdarray[0], "FontName", 0,
- (double) cff_add_string(cffont, fullname)); /* FIXME: Skip XXXXXX+ */
- cff_dict_add(cffont->fdarray[0], "Private", 2);
- cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
- cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
- /* FDArray - index offset, not known yet */
- cff_dict_add(cffont->topdict, "FDArray", 1);
- cff_dict_set(cffont->topdict, "FDArray", 0, 0.0);
- /* FDSelect - offset, not known yet */
- cff_dict_add(cffont->topdict, "FDSelect", 1);
- cff_dict_set(cffont->topdict, "FDSelect", 0, 0.0);
-
- cff_dict_remove(cffont->topdict, "UniqueID");
- cff_dict_remove(cffont->topdict, "XUID");
- cff_dict_remove(cffont->topdict, "Private");
- cff_dict_remove(cffont->topdict, "Encoding");
-
- cffont->offset = cff_dict_get(cffont->topdict, "CharStrings", 0);
- cs_idx = cff_get_index_header(cffont);
-
- offset = cffont->offset;
- cs_count = cs_idx->count;
- if (cs_count < 2) {
- CFF_ERROR("No valid charstring data found.");
- }
+ if (cffont->subrs && cffont->subrs[0])
+ cff_release_index(cffont->subrs[0]);
+ cffont->subrs[0] = NULL;
- /* build the new charstrings entry */
- charstrings = cff_new_index(cs_count+1);
- max_len = 2 * CS_STR_LEN_MAX;
- charstrings->data = xcalloc(max_len, sizeof(card8));
- charstring_len = 0;
-
- gid = 0;
- data = xcalloc(CS_STR_LEN_MAX, sizeof(card8));
-
- for (code=0; code < cs_count; code++) {
- glyph->id = code;
- if ((avl_find(fd->gl_tree,glyph) != NULL)) {
- size = cs_idx->offset[code+1] - cs_idx->offset[code];
-
- if (size > CS_STR_LEN_MAX) {
- pdftex_fail("Charstring too long: gid=%u, %ld bytes", code, size);
- }
- if (charstring_len + CS_STR_LEN_MAX >= max_len) {
- max_len = charstring_len + 2 * CS_STR_LEN_MAX;
- charstrings->data = xrealloc(charstrings->data, max_len*sizeof(card8));
- }
- (charstrings->offset)[gid] = charstring_len + 1;
- cffont->offset= offset + (cs_idx->offset)[code] - 1;
- memcpy(data,&cffont->stream[cffont->offset],size);
- charstring_len += cs_copy_charstring(charstrings->data + charstring_len,
- max_len - charstring_len,
- data, size,
- cffont->gsubr, (cffont->subrs)[0],
- default_width, nominal_width, NULL);
- gid++;
+ if (cffont->private && (cffont->private)[0]) {
+ cff_dict_remove((cffont->private)[0], "Subrs"); /* no Subrs */
}
- }
-
- /* this happens if the internal metrics do not agree with the actual disk font */
- if (gid < num_glyphs) {
- WARN("embedded subset is smaller than expected: %d instead of %d glyphs.", gid, num_glyphs);
- num_glyphs = gid;
- }
-
- xfree(data);
- cff_release_index(cs_idx);
-
- (charstrings->offset)[num_glyphs] = charstring_len + 1;
- charstrings->count = num_glyphs;
- cffont->num_glyphs = num_glyphs;
- cffont->cstrings = charstrings;
-
- /*
- * We don't use subroutines at all.
- */
- if (cffont->gsubr)
- cff_release_index(cffont->gsubr);
- cffont->gsubr = cff_new_index(0);
-
- if (cffont->subrs && cffont->subrs[0])
- cff_release_index(cffont->subrs[0]);
- cffont->subrs[0] = NULL;
-
- if (cffont->private && (cffont->private)[0]) {
- cff_dict_remove((cffont->private)[0], "Subrs"); /* no Subrs */
- }
- cff_add_string(cffont, (char *)"Adobe");
- cff_add_string(cffont, (char *)"Identity");
+ cff_add_string(cffont, (char *) "Adobe");
+ cff_add_string(cffont, (char *) "Identity");
- cff_dict_update(cffont->topdict, cffont);
- cff_dict_update(cffont->private[0], cffont);
- cff_update_string(cffont);
+ cff_dict_update(cffont->topdict, cffont);
+ cff_dict_update(cffont->private[0], cffont);
+ cff_update_string(cffont);
- /* CFF code need to be rewrote... */
- cff_dict_add(cffont->topdict, "ROS", 3);
- cff_dict_set(cffont->topdict, "ROS", 0,
- (double) cff_get_sid(cffont, (char *)"Adobe"));
- cff_dict_set(cffont->topdict, "ROS", 1,
- (double) cff_get_sid(cffont, (char *)"Identity"));
- cff_dict_set(cffont->topdict, "ROS", 2, 0.0);
+ /* CFF code need to be rewrote... */
+ cff_dict_add(cffont->topdict, "ROS", 3);
+ cff_dict_set(cffont->topdict, "ROS", 0,
+ (double) cff_get_sid(cffont, (char *) "Adobe"));
+ cff_dict_set(cffont->topdict, "ROS", 1,
+ (double) cff_get_sid(cffont, (char *) "Identity"));
+ cff_dict_set(cffont->topdict, "ROS", 2, 0.0);
- write_fontfile(cffont,fullname);
- xfree(fullname);
- cff_close (cffont);
+ write_fontfile(cffont, fullname);
+ xfree(fullname);
+ cff_close(cffont);
}
@@ -3086,236 +3134,245 @@ void write_cff(cff_font *cffont, fd_entry *fd, int uglytype1fix) {
/* Input : SID or CID (16-bit unsigned int)
* Output: glyph index
*/
-card16
-cff_charsets_lookup (cff_font *cff, card16 cid)
+card16 cff_charsets_lookup(cff_font * cff, card16 cid)
{
- card16 gid = 0;
- cff_charsets *charset;
- card16 i;
-
- if (cff->flag & (CHARSETS_ISOADOBE|CHARSETS_EXPERT|CHARSETS_EXPSUB)) {
- ERROR("Predefined CFF charsets not supported yet");
- } else if (cff->charsets == NULL) {
- ERROR("Charsets data not available");
- }
+ card16 gid = 0;
+ cff_charsets *charset;
+ card16 i;
- if (cid == 0) {
- return 0; /* GID 0 (.notdef) */
- }
+ if (cff->flag & (CHARSETS_ISOADOBE | CHARSETS_EXPERT | CHARSETS_EXPSUB)) {
+ ERROR("Predefined CFF charsets not supported yet");
+ } else if (cff->charsets == NULL) {
+ ERROR("Charsets data not available");
+ }
- charset = cff->charsets;
-
- gid = 0;
- switch (charset->format) {
- case 0:
- for (i = 0; i <charset->num_entries; i++) {
- if (cid == charset->data.glyphs[i]) {
- gid = i + 1;
- return gid;
- }
- }
- break;
- case 1:
- for (i = 0; i < charset->num_entries; i++) {
- if (cid >= charset->data.range1[i].first &&
- cid <= charset->data.range1[i].first + charset->data.range1[i].n_left) {
- gid += cid - charset->data.range1[i].first + 1;
- return gid;
- }
- gid += charset->data.range1[i].n_left + 1;
- }
- break;
- case 2:
- for (i = 0; i < charset->num_entries; i++) {
- if (cid >= charset->data.range2[i].first &&
- cid <= charset->data.range2[i].first + charset->data.range2[i].n_left) {
- gid += cid - charset->data.range2[i].first + 1;
- return gid;
- }
- gid += charset->data.range2[i].n_left + 1;
- }
- break;
- default:
- ERROR("Unknown Charset format");
- }
+ if (cid == 0) {
+ return 0; /* GID 0 (.notdef) */
+ }
+
+ charset = cff->charsets;
- return 0; /* not found */
+ gid = 0;
+ switch (charset->format) {
+ case 0:
+ for (i = 0; i < charset->num_entries; i++) {
+ if (cid == charset->data.glyphs[i]) {
+ gid = i + 1;
+ return gid;
+ }
+ }
+ break;
+ case 1:
+ for (i = 0; i < charset->num_entries; i++) {
+ if (cid >= charset->data.range1[i].first &&
+ cid <=
+ charset->data.range1[i].first +
+ charset->data.range1[i].n_left) {
+ gid += cid - charset->data.range1[i].first + 1;
+ return gid;
+ }
+ gid += charset->data.range1[i].n_left + 1;
+ }
+ break;
+ case 2:
+ for (i = 0; i < charset->num_entries; i++) {
+ if (cid >= charset->data.range2[i].first &&
+ cid <=
+ charset->data.range2[i].first +
+ charset->data.range2[i].n_left) {
+ gid += cid - charset->data.range2[i].first + 1;
+ return gid;
+ }
+ gid += charset->data.range2[i].n_left + 1;
+ }
+ break;
+ default:
+ ERROR("Unknown Charset format");
+ }
+
+ return 0; /* not found */
}
#define is_cidfont(a) ((a)->flag & FONTTYPE_CIDFONT)
#define CID_MAX 65535
-void write_cid_cff(cff_font *cffont, fd_entry *fd, int uglytype1fix) {
- cff_index *charstrings, *cs_idx;
+void write_cid_cff(cff_font * cffont, fd_entry * fd)
+{
+ cff_index *charstrings, *cs_idx;
- long charstring_len, max_len;
- long size, offset = 0;
+ long charstring_len, max_len;
+ long size, offset = 0;
- card8 *data;
- card16 num_glyphs, cs_count, gid, last_cid;
+ card8 *data;
+ card16 num_glyphs, cs_count, gid, last_cid;
- int fdsel, prev_fd, cid_count, cid;
- char *fullname;
+ int fdsel, prev_fd, cid_count, cid;
+ char *fullname;
- glw_entry *glyph;
+ glw_entry *glyph;
- unsigned char *CIDToGIDMap = NULL;
+ unsigned char *CIDToGIDMap = NULL;
- cff_fdselect *fdselect = NULL;
- cff_charsets *charset = NULL;
+ cff_fdselect *fdselect = NULL;
+ cff_charsets *charset = NULL;
- if (!is_cidfont(cffont)) {
- perror("Not a CIDfont.");
- return;
- }
+ if (!is_cidfont(cffont)) {
+ perror("Not a CIDfont.");
+ return;
+ }
- fullname = xcalloc(8+strlen(fd->fontname),1);
- sprintf(fullname,"%s+%s",fd->subset_tag,fd->fontname);
+ fullname = xcalloc(8 + strlen(fd->fontname), 1);
+ sprintf(fullname, "%s+%s", fd->subset_tag, fd->fontname);
- /* finish parsing the CFF */
+ /* finish parsing the CFF */
- if (cff_dict_known(cffont->topdict, "CIDCount")) {
- cid_count = (card16) cff_dict_get(cffont->topdict, "CIDCount", 0);
- } else {
- cid_count = CFF_CIDCOUNT_DEFAULT;
- }
- cff_read_charsets(cffont);
- CIDToGIDMap = xmalloc((2*cid_count) * sizeof(unsigned char));
- memset(CIDToGIDMap, 0, 2*cid_count);
+ if (cff_dict_known(cffont->topdict, "CIDCount")) {
+ cid_count = (card16) cff_dict_get(cffont->topdict, "CIDCount", 0);
+ } else {
+ cid_count = CFF_CIDCOUNT_DEFAULT;
+ }
+ cff_read_charsets(cffont);
+ CIDToGIDMap = xmalloc((2 * cid_count) * sizeof(unsigned char));
+ memset(CIDToGIDMap, 0, 2 * cid_count);
- glyph = xtalloc(1,glw_entry);
- /* insert notdef */
- glyph->id = uglytype1fix;
- if (avl_find(fd->gl_tree, glyph)==NULL) {
- avl_insert(fd->gl_tree, glyph);
- glyph = xtalloc(1,glw_entry);
- }
+ glyph = xtalloc(1, glw_entry);
+ /* insert notdef */
+ glyph->id = 0;
+ if (avl_find(fd->gl_tree, glyph) == NULL) {
+ avl_insert(fd->gl_tree, glyph);
+ glyph = xtalloc(1, glw_entry);
+ }
- cid = 0; last_cid = 0; num_glyphs = 0;
- for (cid = 0; cid <= CID_MAX; cid++) {
- glyph->id = cid;
- if (avl_find(fd->gl_tree,glyph) != NULL) {
- gid = cff_charsets_lookup(cffont, cid);
- CIDToGIDMap[2*cid] = (gid >> 8) & 0xff;
- CIDToGIDMap[2*cid+1] = gid & 0xff;
- last_cid = cid;
- num_glyphs++;
+ cid = 0;
+ last_cid = 0;
+ num_glyphs = 0;
+ for (cid = 0; cid <= CID_MAX; cid++) {
+ glyph->id = cid;
+ if (avl_find(fd->gl_tree, glyph) != NULL) {
+ gid = cff_charsets_lookup(cffont, cid);
+ CIDToGIDMap[2 * cid] = (gid >> 8) & 0xff;
+ CIDToGIDMap[2 * cid + 1] = gid & 0xff;
+ last_cid = cid;
+ num_glyphs++;
+ }
}
- }
- cff_read_fdselect(cffont);
- cff_read_fdarray(cffont);
- cff_read_private(cffont);
-
- cff_read_subrs (cffont);
+ cff_read_fdselect(cffont);
+ cff_read_fdarray(cffont);
+ cff_read_private(cffont);
+ cff_read_subrs(cffont);
- cffont->offset = cff_dict_get(cffont->topdict, "CharStrings", 0);
- cs_idx = cff_get_index_header(cffont);
- offset = cffont->offset;
- cs_count = cs_idx->count;
- if (cs_count < 2) {
- CFF_ERROR("No valid charstring data found.");
- }
+ cffont->offset = cff_dict_get(cffont->topdict, "CharStrings", 0);
+ cs_idx = cff_get_index_header(cffont);
- charset = xcalloc(1, sizeof(cff_charsets));
- charset->format = 0;
- charset->num_entries = 0;
- charset->data.glyphs = xcalloc(num_glyphs, sizeof(s_SID));
-
- fdselect = xcalloc(1, sizeof(cff_fdselect));
- fdselect->format = 3;
- fdselect->num_entries = 0;
- fdselect->data.ranges = xcalloc(num_glyphs, sizeof(cff_range3));
-
- charstrings = cff_new_index(cs_count+1);
- max_len = 2 * CS_STR_LEN_MAX;
- charstrings->data = xcalloc(max_len, sizeof(card8));
- charstring_len = 0;
-
- prev_fd = -1; gid = 0;
- data = xcalloc(CS_STR_LEN_MAX, sizeof(card8));
- for (cid=0; cid <= last_cid; cid++) {
- unsigned short gid_org;
-
- glyph->id = cid;
- if (avl_find(fd->gl_tree,glyph) == NULL)
- continue;
-
- gid_org = (CIDToGIDMap[2*cid] << 8)|(CIDToGIDMap[2*cid+1]);
- size = cs_idx->offset[gid_org+1] - cs_idx->offset[gid_org];
- if (size > CS_STR_LEN_MAX) {
- pdftex_fail("Charstring too long: gid=%u, %ld bytes", cid, size);
- }
- if (charstring_len + CS_STR_LEN_MAX >= max_len) {
- max_len = charstring_len + 2 * CS_STR_LEN_MAX;
- charstrings->data = xrealloc(charstrings->data, max_len*sizeof(card8));
- }
- (charstrings->offset)[gid] = charstring_len + 1;
- cffont->offset= offset + (cs_idx->offset)[gid_org] - 1;
- memcpy(data,&cffont->stream[cffont->offset],size);
- fdsel = cff_fdselect_lookup(cffont, gid_org);
- charstring_len += cs_copy_charstring(charstrings->data + charstring_len,
- max_len - charstring_len,
- data, size,
- cffont->gsubr, (cffont->subrs)[fdsel],
- 0, 0, NULL);
-
- if (cid>0 && gid_org > 0) {
- charset->data.glyphs[charset->num_entries] = cid;
- charset->num_entries += 1;
- }
- if (fdsel != prev_fd) {
- fdselect->data.ranges[fdselect->num_entries].first = gid;
- fdselect->data.ranges[fdselect->num_entries].fd = fdsel;
- fdselect->num_entries += 1;
- prev_fd = fdsel;
- }
- gid++;
- }
-
- if (gid != num_glyphs)
- CFF_ERROR("Unexpected error: %i != %i", gid, num_glyphs);
- xfree(data);
- cff_release_index(cs_idx);
-
- xfree(CIDToGIDMap);
-
- (charstrings->offset)[num_glyphs] = charstring_len + 1;
- charstrings->count = num_glyphs;
- cffont->num_glyphs = num_glyphs;
- cffont->cstrings = charstrings;
-
- cff_release_charsets(cffont->charsets);
- cffont->charsets = charset;
- cff_release_fdselect(cffont->fdselect);
- cffont->fdselect = fdselect;
-
- /*
- * We don't use subroutines at all.
- */
- if (cffont->gsubr)
- cff_release_index(cffont->gsubr);
- cffont->gsubr = cff_new_index(0);
-
- for (fdsel = 0; fdsel < cffont->num_fds; fdsel++) {
- if (cffont->subrs && cffont->subrs[fdsel]) {
- cff_release_index(cffont->subrs[fdsel]);
- cffont->subrs[fdsel] = NULL;
- }
- if (cffont->private && (cffont->private)[fdsel]) {
- cff_dict_remove((cffont->private)[fdsel], "Subrs"); /* no Subrs */
+ offset = cffont->offset;
+ cs_count = cs_idx->count;
+ if (cs_count < 2) {
+ CFF_ERROR("No valid charstring data found.");
}
- }
- write_fontfile(cffont,fullname);
- xfree(fullname);
- cff_close (cffont);
+ charset = xcalloc(1, sizeof(cff_charsets));
+ charset->format = 0;
+ charset->num_entries = 0;
+ charset->data.glyphs = xcalloc(num_glyphs, sizeof(s_SID));
+
+ fdselect = xcalloc(1, sizeof(cff_fdselect));
+ fdselect->format = 3;
+ fdselect->num_entries = 0;
+ fdselect->data.ranges = xcalloc(num_glyphs, sizeof(cff_range3));
+
+ charstrings = cff_new_index(cs_count + 1);
+ max_len = 2 * CS_STR_LEN_MAX;
+ charstrings->data = xcalloc(max_len, sizeof(card8));
+ charstring_len = 0;
+
+ prev_fd = -1;
+ gid = 0;
+ data = xcalloc(CS_STR_LEN_MAX, sizeof(card8));
+ for (cid = 0; cid <= last_cid; cid++) {
+ unsigned short gid_org;
+
+ glyph->id = cid;
+ if (avl_find(fd->gl_tree, glyph) == NULL)
+ continue;
+
+ gid_org = (CIDToGIDMap[2 * cid] << 8) | (CIDToGIDMap[2 * cid + 1]);
+ size = cs_idx->offset[gid_org + 1] - cs_idx->offset[gid_org];
+ if (size > CS_STR_LEN_MAX) {
+ pdftex_fail("Charstring too long: gid=%u, %ld bytes", cid, size);
+ }
+ if (charstring_len + CS_STR_LEN_MAX >= max_len) {
+ max_len = charstring_len + 2 * CS_STR_LEN_MAX;
+ charstrings->data =
+ xrealloc(charstrings->data, max_len * sizeof(card8));
+ }
+ (charstrings->offset)[gid] = charstring_len + 1;
+ cffont->offset = offset + (cs_idx->offset)[gid_org] - 1;
+ memcpy(data, &cffont->stream[cffont->offset], size);
+ fdsel = cff_fdselect_lookup(cffont, gid_org);
+ charstring_len += cs_copy_charstring(charstrings->data + charstring_len,
+ max_len - charstring_len,
+ data, size,
+ cffont->gsubr,
+ (cffont->subrs)[fdsel], 0, 0,
+ NULL);
+
+ if (cid > 0 && gid_org > 0) {
+ charset->data.glyphs[charset->num_entries] = cid;
+ charset->num_entries += 1;
+ }
+ if (fdsel != prev_fd) {
+ fdselect->data.ranges[fdselect->num_entries].first = gid;
+ fdselect->data.ranges[fdselect->num_entries].fd = fdsel;
+ fdselect->num_entries += 1;
+ prev_fd = fdsel;
+ }
+ gid++;
+ }
+
+ if (gid != num_glyphs)
+ CFF_ERROR("Unexpected error: %i != %i", gid, num_glyphs);
+ xfree(data);
+ cff_release_index(cs_idx);
+
+ xfree(CIDToGIDMap);
+
+ (charstrings->offset)[num_glyphs] = charstring_len + 1;
+ charstrings->count = num_glyphs;
+ cffont->num_glyphs = num_glyphs;
+ cffont->cstrings = charstrings;
+
+ cff_release_charsets(cffont->charsets);
+ cffont->charsets = charset;
+ cff_release_fdselect(cffont->fdselect);
+ cffont->fdselect = fdselect;
+
+ /*
+ * We don't use subroutines at all.
+ */
+ if (cffont->gsubr)
+ cff_release_index(cffont->gsubr);
+ cffont->gsubr = cff_new_index(0);
+
+ for (fdsel = 0; fdsel < cffont->num_fds; fdsel++) {
+ if (cffont->subrs && cffont->subrs[fdsel]) {
+ cff_release_index(cffont->subrs[fdsel]);
+ cffont->subrs[fdsel] = NULL;
+ }
+ if (cffont->private && (cffont->private)[fdsel]) {
+ cff_dict_remove((cffont->private)[fdsel], "Subrs"); /* no Subrs */
+ }
+ }
+
+ write_fontfile(cffont, fullname);
+ xfree(fullname);
+ cff_close(cffont);
}
@@ -3324,58 +3381,56 @@ void write_cid_cff(cff_font *cffont, fd_entry *fd, int uglytype1fix) {
* I have defined a utility function in luafflib.c that does exactly that.
* If it works out ok, I will clean up this code.
*/
+extern int ff_createcff(char *, unsigned char **, integer *); /* libs/luafontforge/src/luafflib.c */
-extern int ff_createcff (char *, unsigned char **, integer *);
-
-void writetype1w (fd_entry *fd) {
- cff_font *cff;
- int i;
- FILE *fp;
- ff_entry *ff;
- unsigned char *tfm_buffer = NULL;
- integer tfm_size = 0;
- int notdefpos = 0;
-
- ff = check_ff_exist(fd->fm->ff_name, 0);
-
- fp = fopen (ff->ff_path, "rb");
- cur_file_name = ff->ff_path;
-
- if (!fp) {
- fprintf(stderr,"Type1: Could not open Type1 font: %s", cur_file_name);
- uexit(1);
- }
- fclose(fp);
+void writetype1w(fd_entry * fd)
+{
+ cff_font *cff;
+ int i;
+ FILE *fp;
+ ff_entry *ff;
+ unsigned char *tfm_buffer = NULL;
+ integer tfm_size = 0;
- if (tracefilenames) {
- if (is_subsetted(fd->fm))
- tex_printf ("<%s", cur_file_name);
- else
- tex_printf ("<<%s", cur_file_name);
- }
+ ff = check_ff_exist(fd->fm->ff_name, 0);
- notdefpos = ff_createcff(ff->ff_path,&tfm_buffer,&tfm_size);
+ fp = fopen(ff->ff_path, "rb");
+ cur_file_name = ff->ff_path;
- if (tfm_size>0) {
- cff = read_cff(tfm_buffer,tfm_size,0);
- if (cff != NULL) {
- write_cff(cff,fd,notdefpos);
- } else {
- for (i = 0; i < tfm_size ; i++)
- fb_putchar (tfm_buffer[i]);
+ if (!fp) {
+ fprintf(stderr, "Type1: Could not open Type1 font: %s", cur_file_name);
+ uexit(1);
+ }
+ fclose(fp);
+
+ if (tracefilenames) {
+ if (is_subsetted(fd->fm))
+ tex_printf("<%s", cur_file_name);
+ else
+ tex_printf("<<%s", cur_file_name);
}
- fd->ff_found = 1;
- } else {
- fprintf(stderr,"Type1: Could not understand Type1 font: %s", cur_file_name);
- uexit(1);
- }
- if (tracefilenames) {
- if (is_subsetted (fd->fm))
- tex_printf (">");
- else
- tex_printf (">>");
- }
- cur_file_name = NULL;
-}
+ (void) ff_createcff(ff->ff_path, &tfm_buffer, &tfm_size);
+ if (tfm_size > 0) {
+ cff = read_cff(tfm_buffer, tfm_size, 0);
+ if (cff != NULL) {
+ write_cff(cff, fd);
+ } else {
+ for (i = 0; i < tfm_size; i++)
+ fb_putchar(tfm_buffer[i]);
+ }
+ fd->ff_found = 1;
+ } else {
+ fprintf(stderr, "Type1: Could not understand Type1 font: %s",
+ cur_file_name);
+ uexit(1);
+ }
+ if (tracefilenames) {
+ if (is_subsetted(fd->fm))
+ tex_printf(">");
+ else
+ tex_printf(">>");
+ }
+ cur_file_name = NULL;
+}
diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.h b/Build/source/texk/web2c/luatexdir/font/writecff.h
index 8cb93024f7a..2d92a8723ae 100644
--- a/Build/source/texk/web2c/luatexdir/font/writecff.h
+++ b/Build/source/texk/web2c/luatexdir/font/writecff.h
@@ -1,349 +1,344 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/cff_limits.h,v 1.3 2002/10/30 02:27:05 chofchof Exp $
+/* writecff.h
- This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+ Copyright 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
- the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: writecff.h 1518 2008-09-30 08:18:10Z taco $ */
#ifndef _CFF_LIMITS_H_
-#define _CFF_LIMITS_H_
+# define _CFF_LIMITS_H_
-#include <limits.h>
+# include <limits.h>
-#define CFF_INT_MAX 0x7fffffff
-#define CFF_INT_MIN (-0x7fffffff - 1)
+# define CFF_INT_MAX 0x7fffffff
+# define CFF_INT_MIN (-0x7fffffff - 1)
-#if (LONG_MAX < CFF_INT_MAX || LONG_MIN > CFF_INT_MIN)
-#error "CFF support won't work on this system."
-#endif
+# if (LONG_MAX < CFF_INT_MAX || LONG_MIN > CFF_INT_MIN)
+# error "CFF support won't work on this system."
+# endif
-#define CFF_SID_MAX 64999
-#define CFF_STDSTR_MAX 391
+# define CFF_SID_MAX 64999
+# define CFF_STDSTR_MAX 391
/* Type 2 Charstring */
-#define CS_NUM_SUBR_MAX 65536
-#define CS_STR_LEN_MAX 65536
-#define CS_STEM_ZONE_MAX 96
-#define CS_ARG_STACK_MAX 48
-#define CS_TRANS_ARRAY_MAX 32
-#define CS_SUBR_NEST_MAX 10
+# define CS_NUM_SUBR_MAX 65536
+# define CS_STR_LEN_MAX 65536
+# define CS_STEM_ZONE_MAX 96
+# define CS_ARG_STACK_MAX 48
+# define CS_TRANS_ARRAY_MAX 32
+# define CS_SUBR_NEST_MAX 10
-#endif /* _CFF_LIMITS_H_ */
+#endif /* _CFF_LIMITS_H_ */
#ifndef _CFF_TYPES_H_
-#define _CFF_TYPES_H_
+# define _CFF_TYPES_H_
/* CFF Data Types */
-#define CFF_TYPE_UNKNOWN 0
-#define CFF_TYPE_INTEGER (1 << 0)
-#define CFF_TYPE_REAL (1 << 1)
-#define CFF_TYPE_NUMBER (CFF_TYPE_INTEGER|CFF_TYPE_REAL)
-#define CFF_TYPE_BOOLEAN (1 << 2)
-#define CFF_TYPE_SID (1 << 3)
-#define CFF_TYPE_ARRAY (1 << 4)
-#define CFF_TYPE_DELTA (1 << 5)
+# define CFF_TYPE_UNKNOWN 0
+# define CFF_TYPE_INTEGER (1 << 0)
+# define CFF_TYPE_REAL (1 << 1)
+# define CFF_TYPE_NUMBER (CFF_TYPE_INTEGER|CFF_TYPE_REAL)
+# define CFF_TYPE_BOOLEAN (1 << 2)
+# define CFF_TYPE_SID (1 << 3)
+# define CFF_TYPE_ARRAY (1 << 4)
+# define CFF_TYPE_DELTA (1 << 5)
/* SID SID number */
-#define CFF_TYPE_ROS (1 << 6)
+# define CFF_TYPE_ROS (1 << 6)
/* offset(0) */
-#define CFF_TYPE_OFFSET (1 << 7)
+# define CFF_TYPE_OFFSET (1 << 7)
/* size offset(0) */
-#define CFF_TYPE_SZOFF (1 << 8)
+# define CFF_TYPE_SZOFF (1 << 8)
-typedef unsigned char card8; /* 1-byte unsigned number */
-typedef unsigned short card16; /* 2-byte unsigned number */
-typedef unsigned char c_offsize; /* 1-byte unsigned number specifies the size
- of an Offset field or fields, range 1-4 */
-typedef unsigned long l_offset; /* 1, 2, 3, or 4-byte offset */
-typedef unsigned short s_SID; /* 2-byte string identifier */
+typedef unsigned char card8; /* 1-byte unsigned number */
+typedef unsigned short card16; /* 2-byte unsigned number */
+typedef unsigned char c_offsize; /* 1-byte unsigned number specifies the size
+ of an Offset field or fields, range 1-4 */
+typedef unsigned long l_offset; /* 1, 2, 3, or 4-byte offset */
+typedef unsigned short s_SID; /* 2-byte string identifier */
-typedef unsigned long l_size;
+typedef unsigned long l_size;
typedef struct {
- card16 count; /* number of objects stored in INDEX */
- c_offsize offsize; /* Offset array element size, 1-4 */
- l_offset *offset; /* Offset array, count + 1 offsets */
- card8 *data; /* Object data */
+ card16 count; /* number of objects stored in INDEX */
+ c_offsize offsize; /* Offset array element size, 1-4 */
+ l_offset *offset; /* Offset array, count + 1 offsets */
+ card8 *data; /* Object data */
} cff_index;
/* Dictionary */
typedef struct {
- int id; /* encoded data value (as card8 or card16) */
- char *key; /* opname */
- int count; /* number of values */
- double *values; /* values */
+ int id; /* encoded data value (as card8 or card16) */
+ char *key; /* opname */
+ int count; /* number of values */
+ double *values; /* values */
} cff_dict_entry;
typedef struct {
- int max;
- int count;
- cff_dict_entry *entries;
+ int max;
+ int count;
+ cff_dict_entry *entries;
} cff_dict;
/* Encoding, Charset and FDSelect */
-typedef struct
-{
- s_SID first; /* SID or CID, or card8 for Encoding */
- card8 n_left; /* no. of remaining gids/codes in this range */
+typedef struct {
+ s_SID first; /* SID or CID, or card8 for Encoding */
+ card8 n_left; /* no. of remaining gids/codes in this range */
} cff_range1;
-typedef struct
-{
- s_SID first; /* SID or CID (card16) */
- card16 n_left; /* card16-version of range1 */
+typedef struct {
+ s_SID first; /* SID or CID (card16) */
+ card16 n_left; /* card16-version of range1 */
} cff_range2;
-typedef struct
-{
- card8 code;
- s_SID glyph;
+typedef struct {
+ card8 code;
+ s_SID glyph;
} cff_map;
-typedef struct
-{
- card8 format; /* if (format & 0x80) then have supplement */
- card8 num_entries; /* number of entries */
- union {
- card8 *codes; /* format 0 */
- cff_range1 *range1; /* format 1 */
- } data;
- card8 num_supps; /* number of supplementary data */
- cff_map *supp; /* supplement */
+typedef struct {
+ card8 format; /* if (format & 0x80) then have supplement */
+ card8 num_entries; /* number of entries */
+ union {
+ card8 *codes; /* format 0 */
+ cff_range1 *range1; /* format 1 */
+ } data;
+ card8 num_supps; /* number of supplementary data */
+ cff_map *supp; /* supplement */
} cff_encoding;
-typedef struct
-{
- card8 format;
- card16 num_entries;
- union {
- s_SID *glyphs; /* format 0 */
- cff_range1 *range1; /* format 1 */
- cff_range2 *range2; /* format 2 */
- } data;
+typedef struct {
+ card8 format;
+ card16 num_entries;
+ union {
+ s_SID *glyphs; /* format 0 */
+ cff_range1 *range1; /* format 1 */
+ cff_range2 *range2; /* format 2 */
+ } data;
} cff_charsets;
/* CID-Keyed font specific */
-typedef struct
-{
- card16 first;
- card8 fd;
+typedef struct {
+ card16 first;
+ card8 fd;
} cff_range3;
-typedef struct
-{
- card8 format;
- card16 num_entries; /* number of glyphs/ranges */
- union {
- card8 *fds; /* format 0 */
- cff_range3 *ranges; /* format 3 */
- } data;
- /* card16 sentinel; */ /* format 3 only, must be equals to num_glyphs */
+typedef struct {
+ card8 format;
+ card16 num_entries; /* number of glyphs/ranges */
+ union {
+ card8 *fds; /* format 0 */
+ cff_range3 *ranges; /* format 3 */
+ } data;
+ /* card16 sentinel; *//* format 3 only, must be equals to num_glyphs */
} cff_fdselect;
-#endif /* _CFF_TYPES_H_ */
+#endif /* _CFF_TYPES_H_ */
#ifndef _CFF_STDSTR_H_
-#define _CFF_STDSTR_H_
+# define _CFF_STDSTR_H_
-#define CFF_STDSTR_MAX 391
+# define CFF_STDSTR_MAX 391
extern const char *const cff_stdstr[];
-#endif /* _CFF_STDSTR_H_ */
+#endif /* _CFF_STDSTR_H_ */
#ifndef _CFF_H_
-#define _CFF_H_
+# define _CFF_H_
/*#include "mfileio.h"*/
/* Flag */
-#define FONTTYPE_CIDFONT (1 << 0)
-#define FONTTYPE_FONT (1 << 1)
-#define FONTTYPE_MMASTER (1 << 2)
+# define FONTTYPE_CIDFONT (1 << 0)
+# define FONTTYPE_FONT (1 << 1)
+# define FONTTYPE_MMASTER (1 << 2)
-#define ENCODING_STANDARD (1 << 3)
-#define ENCODING_EXPERT (1 << 4)
+# define ENCODING_STANDARD (1 << 3)
+# define ENCODING_EXPERT (1 << 4)
-#define CHARSETS_ISOADOBE (1 << 5)
-#define CHARSETS_EXPERT (1 << 6)
-#define CHARSETS_EXPSUB (1 << 7)
+# define CHARSETS_ISOADOBE (1 << 5)
+# define CHARSETS_EXPERT (1 << 6)
+# define CHARSETS_EXPSUB (1 << 7)
-#define HAVE_STANDARD_ENCODING (ENCODING_STANDARD|ENCODING_EXPERT)
-#define HAVE_STANDARD_CHARSETS \
+# define HAVE_STANDARD_ENCODING (ENCODING_STANDARD|ENCODING_EXPERT)
+# define HAVE_STANDARD_CHARSETS \
(CHARSETS_ISOADOBE|CHARSETS_EXPERT|CHARSETS_EXPSUB)
-#define CFF_STRING_NOTDEF 65535
-
-typedef struct
-{
- char *fontname; /* FontName */
-
- /* - CFF structure - */
-
- card8 header_major; /* major version */
- card8 header_minor; /* minor version */
- card8 header_hdr_size; /* Header size (bytes) */
- c_offsize header_offsize; /* Absolute offset (0) size */
-
- cff_index *name; /* Name INDEX */
- cff_dict *topdict; /* Top DICT (single) */
- cff_index *string; /* String INDEX */
- cff_index *gsubr; /* Global Subr INDEX */
- cff_encoding *encoding; /* Encodings */
- cff_charsets *charsets; /* Charsets */
- cff_fdselect *fdselect; /* FDSelect, CIDFont only */
- cff_index *cstrings; /* CharStrings */
- cff_dict **fdarray; /* CIDFont only */
- cff_dict **private; /* per-Font DICT */
- cff_index **subrs; /* Local Subr INDEX, per-Private DICT */
-
- /* -- extra data -- */
- l_offset gsubr_offset;
- card16 num_glyphs; /* number of glyphs (CharString INDEX count) */
- card8 num_fds; /* number of Font DICT */
-
- /* Updated String INDEX.
- * Please fix this. We should separate input and output.
- */
- cff_index *_string;
-
- unsigned char *stream;
- l_offset offset;
- l_offset stream_size;
-
- int index; /* CFF fontset index */
- int flag; /* Flag: see above */
+# define CFF_STRING_NOTDEF 65535
+
+typedef struct {
+ char *fontname; /* FontName */
+
+ /* - CFF structure - */
+
+ card8 header_major; /* major version */
+ card8 header_minor; /* minor version */
+ card8 header_hdr_size; /* Header size (bytes) */
+ c_offsize header_offsize; /* Absolute offset (0) size */
+
+ cff_index *name; /* Name INDEX */
+ cff_dict *topdict; /* Top DICT (single) */
+ cff_index *string; /* String INDEX */
+ cff_index *gsubr; /* Global Subr INDEX */
+ cff_encoding *encoding; /* Encodings */
+ cff_charsets *charsets; /* Charsets */
+ cff_fdselect *fdselect; /* FDSelect, CIDFont only */
+ cff_index *cstrings; /* CharStrings */
+ cff_dict **fdarray; /* CIDFont only */
+ cff_dict **private; /* per-Font DICT */
+ cff_index **subrs; /* Local Subr INDEX, per-Private DICT */
+
+ /* -- extra data -- */
+ l_offset gsubr_offset;
+ card16 num_glyphs; /* number of glyphs (CharString INDEX count) */
+ card8 num_fds; /* number of Font DICT */
+
+ /* Updated String INDEX.
+ * Please fix this. We should separate input and output.
+ */
+ cff_index *_string;
+
+ unsigned char *stream;
+ l_offset offset;
+ l_offset stream_size;
+
+ int index; /* CFF fontset index */
+ int flag; /* Flag: see above */
} cff_font;
extern cff_font *cff_open(unsigned char *stream, long stream_size, int n);
-extern void cff_close (cff_font *cff);
+extern void cff_close(cff_font * cff);
-#define cff_seek_set(c, p) seek_absolute (((c)->stream), ((c)->offset) + (p));
+# define cff_seek_set(c, p) seek_absolute (((c)->stream), ((c)->offset) + (p));
/* CFF Header */
-extern long cff_put_header (cff_font *cff, card8 *dest, long destlen);
+extern long cff_put_header(cff_font * cff, card8 * dest, long destlen);
/* CFF INDEX */
-extern cff_index *cff_get_index (cff_font *cff);
-extern cff_index *cff_get_index_header (cff_font *cff);
-extern void cff_release_index (cff_index *idx);
-extern cff_index *cff_new_index (card16 count);
-extern long cff_index_size (cff_index *idx);
-extern long cff_pack_index (cff_index *idx, card8 *dest, long destlen);
+extern cff_index *cff_get_index(cff_font * cff);
+extern cff_index *cff_get_index_header(cff_font * cff);
+extern void cff_release_index(cff_index * idx);
+extern cff_index *cff_new_index(card16 count);
+extern long cff_index_size(cff_index * idx);
+extern long cff_pack_index(cff_index * idx, card8 * dest, long destlen);
/* Name INDEX */
-extern char *cff_get_name (cff_font *cff);
-extern long cff_set_name (cff_font *cff, char *name);
+extern char *cff_get_name(cff_font * cff);
+extern long cff_set_name(cff_font * cff, char *name);
/* Global and Local Subrs INDEX */
-extern long cff_read_subrs (cff_font *cff);
+extern long cff_read_subrs(cff_font * cff);
/* Encoding */
-extern long cff_read_encoding (cff_font *cff);
-extern long cff_pack_encoding (cff_font *cff, card8 *dest, long destlen);
-extern card16 cff_encoding_lookup (cff_font *cff, card8 code);
-extern void cff_release_encoding (cff_encoding *encoding);
+extern long cff_read_encoding(cff_font * cff);
+extern long cff_pack_encoding(cff_font * cff, card8 * dest, long destlen);
+extern card16 cff_encoding_lookup(cff_font * cff, card8 code);
+extern void cff_release_encoding(cff_encoding * encoding);
/* Charsets */
-extern long cff_read_charsets (cff_font *cff);
-extern long cff_pack_charsets (cff_font *cff, card8 *dest, long destlen);
+extern long cff_read_charsets(cff_font * cff);
+extern long cff_pack_charsets(cff_font * cff, card8 * dest, long destlen);
/* Returns GID of PS name "glyph" */
-extern card16 cff_glyph_lookup (cff_font *cff, const char *glyph);
+extern card16 cff_glyph_lookup(cff_font * cff, const char *glyph);
/* Returns GID of glyph with SID/CID "cid" */
-extern card16 cff_charsets_lookup (cff_font *cff, card16 cid);
-extern void cff_release_charsets (cff_charsets *charset);
+extern card16 cff_charsets_lookup(cff_font * cff, card16 cid);
+extern void cff_release_charsets(cff_charsets * charset);
/* Returns SID or CID */
-extern card16 cff_charsets_lookup_inverse (cff_font *cff, card16 gid);
+extern card16 cff_charsets_lookup_inverse(cff_font * cff, card16 gid);
/* FDSelect */
-extern long cff_read_fdselect (cff_font *cff);
-extern long cff_pack_fdselect (cff_font *cff, card8 *dest, long destlen);
-extern card8 cff_fdselect_lookup (cff_font *cff, card16 gid);
-extern void cff_release_fdselect (cff_fdselect *fdselect);
+extern long cff_read_fdselect(cff_font * cff);
+extern long cff_pack_fdselect(cff_font * cff, card8 * dest, long destlen);
+extern card8 cff_fdselect_lookup(cff_font * cff, card16 gid);
+extern void cff_release_fdselect(cff_fdselect * fdselect);
/* Font DICT(s) */
-extern long cff_read_fdarray (cff_font *cff);
+extern long cff_read_fdarray(cff_font * cff);
/* Private DICT(s) */
-extern long cff_read_private (cff_font *cff);
+extern long cff_read_private(cff_font * cff);
/* String */
-extern int cff_match_string (cff_font *cff, const char *str, s_SID sid);
-extern char *cff_get_string (cff_font *cff, s_SID id);
-extern long cff_get_sid (cff_font *cff, char *str);
-extern s_SID cff_add_string (cff_font *cff, char *str);
-extern void cff_update_string (cff_font *cff);
+extern int cff_match_string(cff_font * cff, const char *str, s_SID sid);
+extern char *cff_get_string(cff_font * cff, s_SID id);
+extern long cff_get_sid(cff_font * cff, char *str);
+extern s_SID cff_add_string(cff_font * cff, char *str);
+extern void cff_update_string(cff_font * cff);
-#define cff_is_stdstr(s) (cff_get_sid(NULL, (s)) >= 0)
+# define cff_is_stdstr(s) (cff_get_sid(NULL, (s)) >= 0)
-#endif /* _CFF_H_ */
+#endif /* _CFF_H_ */
#ifndef _CFF_DICT_H_
-#define _CFF_DICT_H_
+# define _CFF_DICT_H_
-#define CFF_CIDCOUNT_DEFAULT 8720
-#define CFF_NOMINALWIDTHX_DEFAULT 0.0
-#define CFF_DEFAULTWIDTHX_DEFAULT 0.0
+# define CFF_CIDCOUNT_DEFAULT 8720
+# define CFF_NOMINALWIDTHX_DEFAULT 0.0
+# define CFF_DEFAULTWIDTHX_DEFAULT 0.0
-extern cff_dict *cff_new_dict (void);
-extern void cff_release_dict (cff_dict *dict);
+extern cff_dict *cff_new_dict(void);
+extern void cff_release_dict(cff_dict * dict);
-extern void cff_dict_set (cff_dict *dict, const char *key, int idx, double value);
-extern double cff_dict_get (cff_dict *dict, const char *key, int idx);
-extern void cff_dict_add (cff_dict *dict, const char *key, int count);
-extern void cff_dict_remove (cff_dict *dict, const char *key);
-extern int cff_dict_known (cff_dict *dict, const char *key);
+extern void cff_dict_set(cff_dict * dict, const char *key, int idx,
+ double value);
+extern double cff_dict_get(cff_dict * dict, const char *key, int idx);
+extern void cff_dict_add(cff_dict * dict, const char *key, int count);
+extern void cff_dict_remove(cff_dict * dict, const char *key);
+extern int cff_dict_known(cff_dict * dict, const char *key);
/* decode/encode DICT */
-extern cff_dict *cff_dict_unpack (card8 *data, card8 *endptr);
-extern long cff_dict_pack (cff_dict *dict, card8 *dest, long destlen);
+extern cff_dict *cff_dict_unpack(card8 * data, card8 * endptr);
+extern long cff_dict_pack(cff_dict * dict, card8 * dest, long destlen);
-extern void cff_dict_update (cff_dict *dict, cff_font *cff);
+extern void cff_dict_update(cff_dict * dict, cff_font * cff);
-#endif /* _CFF_DICT_H_ */
+#endif /* _CFF_DICT_H_ */
#ifndef _CS_TYPE2_H_
-#define _CS_TYPE2_H_
+# define _CS_TYPE2_H_
typedef struct {
- int flags; /* unused in Type 2 charstring */
- double wx, wy;
- struct {
- double llx, lly, urx, ury;
- } bbox;
- struct {
- double asb, adx, ady;
- card8 bchar, achar;
- } seac; /* unused in Type 2 charstring */
+ int flags; /* unused in Type 2 charstring */
+ double wx, wy;
+ struct {
+ double llx, lly, urx, ury;
+ } bbox;
+ struct {
+ double asb, adx, ady;
+ card8 bchar, achar;
+ } seac; /* unused in Type 2 charstring */
} cs_ginfo;
-extern long cs_copy_charstring (card8 *dest, long destlen,
- card8 *src, long srclen,
- cff_index *gsubr, cff_index *subr,
- double default_width, double nominal_width, cs_ginfo *ginfo);
-#endif /* _CS_TYPE2_H_ */
+extern long cs_copy_charstring(card8 * dest, long destlen,
+ card8 * src, long srclen,
+ cff_index * gsubr, cff_index * subr,
+ double default_width, double nominal_width,
+ cs_ginfo * ginfo);
+#endif /* _CS_TYPE2_H_ */
#define cff_is_cidfont(a) (a->flag & FONTTYPE_CIDFONT)
#define cff_understandable(a) (a->header_major==1)
-extern cff_font *read_cff(unsigned char *buf,long buflength, int subf);
+extern cff_font *read_cff(unsigned char *buf, long buflength, int subf);
-extern void write_cff(cff_font *cff, fd_entry *fd, int hack);
-extern void write_cid_cff(cff_font *cffont, fd_entry *fd, int uglytype1fix) ;
+extern void write_cff(cff_font * cff, fd_entry * fd);
+extern void write_cid_cff(cff_font * cffont, fd_entry * fd);
diff --git a/Build/source/texk/web2c/luatexdir/font/writeenc.c b/Build/source/texk/web2c/luatexdir/font/writeenc.c
index feaf1407d1e..648992ba6cd 100644
--- a/Build/source/texk/web2c/luatexdir/font/writeenc.c
+++ b/Build/source/texk/web2c/luatexdir/font/writeenc.c
@@ -1,27 +1,28 @@
-/*
-Copyright (c) 1996-2005 Han The Thanh, <thanh@pdftex.org>
+/* writeenc.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id: writeenc.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
+static const char _svn_version[] =
+ "$Id: writeenc.c 1407 2008-07-15 10:49:28Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writeenc.c $";
+
/**********************************************************************/
/* All encoding entries go into AVL tree for fast search by name. */
@@ -93,7 +94,7 @@ void epdf_write_enc(char **glyph_names, integer fe_objnum)
assert(fe_objnum != 0);
pdf_begin_dict(fe_objnum, 1);
pdf_puts("/Type /Encoding\n");
- pdf_printf("/Differences [");
+ pdf_puts("/Differences [");
for (i = 0, i_old = -2; i < 256; i++)
if (glyph_names[i] != notdef) {
if (i == i_old + 1) /* no gap */
@@ -119,7 +120,7 @@ void write_enc(char **glyph_names, struct avl_table *tx_tree, integer fe_objnum)
assert(fe_objnum != 0);
pdf_begin_dict(fe_objnum, 1);
pdf_puts("/Type /Encoding\n");
- pdf_printf("/Differences [");
+ pdf_puts("/Differences [");
avl_t_init(&t, tx_tree);
for (i_old = -2, p = (int *) avl_t_first(&t, tx_tree); p != NULL;
p = (int *) avl_t_next(&t)) {
diff --git a/Build/source/texk/web2c/luatexdir/font/writefont.c b/Build/source/texk/web2c/luatexdir/font/writefont.c
index 679929e32e4..5c6b2d905a0 100644
--- a/Build/source/texk/web2c/luatexdir/font/writefont.c
+++ b/Build/source/texk/web2c/luatexdir/font/writefont.c
@@ -1,42 +1,32 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
+/* writefont.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: writefont.c 1139 2008-04-09 14:44:20Z taco $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
+#include "luatexfont.h"
-extern void writetype0 (fd_entry * fd) ;
-extern void writetype2 (fd_entry * fd) ;
-extern unsigned long cidtogid_obj;
-
-#ifdef DO_TYPE1C
-extern void writet1c(fd_entry * fd); /* in writecff.c */
-#endif
-
-extern void writet1w (fd_entry * fd); /* in writecff.c */
-extern void writetype1w (fd_entry * fd);
-extern integer write_cid_tounicode(fo_entry * fo, internalfontnumber f); /* in tounicode.c */
-
+static const char _svn_version[] =
+ "$Id: writefont.c 2097 2009-03-23 22:45:03Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writefont.c $";
void write_cid_fontdictionary(fo_entry * fo, internalfontnumber f);
-void create_cid_fontdictionary(fm_entry * fm, integer font_objnum, internalfontnumber f);
+void create_cid_fontdictionary(fm_entry * fm, integer font_objnum,
+ internalfontnumber f);
/**********************************************************************/
@@ -97,7 +87,7 @@ fd_entry *new_fd_entry(void)
fd->fn_objnum = 0;
fd->all_glyphs = false;
fd->write_ttf_glyph_names = false;
- for (i = 0; i < INT_KEYS_NUM; i++) {
+ for (i = 0; i < FONT_KEYS_NUM; i++) {
fd->font_dim[i].val = 0;
fd->font_dim[i].set = false;
}
@@ -121,21 +111,21 @@ static void preset_fontmetrics(fd_entry * fd, internalfontnumber f)
int i;
fd->font_dim[ITALIC_ANGLE_CODE].val =
divide_scaled(-atan(get_slant(f) / 65536.0) * (180 / M_PI),
- pdf_font_size(f), 3);
+ pdf_font_size(f), 3);
fd->font_dim[ASCENT_CODE].val =
- divide_scaled(char_height(f, 'h'), pdf_font_size(f), 3);
+ divide_scaled(char_height(f, 'h'), pdf_font_size(f), 3);
fd->font_dim[CAPHEIGHT_CODE].val =
- divide_scaled(char_height(f, 'H'), pdf_font_size(f), 3);
+ divide_scaled(char_height(f, 'H'), pdf_font_size(f), 3);
i = -divide_scaled(char_depth(f, 'y'), pdf_font_size(f), 3);
fd->font_dim[DESCENT_CODE].val = i < 0 ? i : 0;
fd->font_dim[STEMV_CODE].val =
- divide_scaled(char_width(f, '.') / 3, pdf_font_size(f), 3);
+ divide_scaled(char_width(f, '.') / 3, pdf_font_size(f), 3);
fd->font_dim[XHEIGHT_CODE].val =
- divide_scaled(get_x_height(f), pdf_font_size(f), 3);
+ divide_scaled(get_x_height(f), pdf_font_size(f), 3);
fd->font_dim[FONTBBOX1_CODE].val = 0;
fd->font_dim[FONTBBOX2_CODE].val = fd->font_dim[DESCENT_CODE].val;
fd->font_dim[FONTBBOX3_CODE].val =
- divide_scaled(get_quad(f), pdf_font_size(f), 3);
+ divide_scaled(get_quad(f), pdf_font_size(f), 3);
fd->font_dim[FONTBBOX4_CODE].val =
fd->font_dim[CAPHEIGHT_CODE].val > fd->font_dim[ASCENT_CODE].val ?
fd->font_dim[CAPHEIGHT_CODE].val : fd->font_dim[ASCENT_CODE].val;
@@ -143,16 +133,48 @@ static void preset_fontmetrics(fd_entry * fd, internalfontnumber f)
fd->font_dim[i].set = true;
}
+static void fix_fontmetrics(fd_entry * fd)
+{
+ int i;
+ intparm *p = (intparm *) fd->font_dim;
+ assert(p[FONTBBOX1_CODE].set && p[FONTBBOX2_CODE].set
+ && p[FONTBBOX3_CODE].set && p[FONTBBOX4_CODE].set);
+ /* make sure there is a rectangle */
+ if (p[FONTBBOX3_CODE].val < p[FONTBBOX1_CODE].val) {
+ i = p[FONTBBOX3_CODE].val;
+ p[FONTBBOX3_CODE].val = p[FONTBBOX1_CODE].val;
+ p[FONTBBOX1_CODE].val = i;
+ } else if (p[FONTBBOX3_CODE].val == p[FONTBBOX1_CODE].val)
+ p[FONTBBOX3_CODE].val = p[FONTBBOX1_CODE].val + 1;
+ if (p[FONTBBOX4_CODE].val < p[FONTBBOX2_CODE].val) {
+ i = p[FONTBBOX4_CODE].val;
+ p[FONTBBOX4_CODE].val = p[FONTBBOX2_CODE].val;
+ p[FONTBBOX2_CODE].val = i;
+ } else if (p[FONTBBOX4_CODE].val == p[FONTBBOX2_CODE].val)
+ p[FONTBBOX4_CODE].val = p[FONTBBOX2_CODE].val + 1;
+ if (!p[ASCENT_CODE].set) {
+ p[ASCENT_CODE].val = p[FONTBBOX4_CODE].val;
+ p[ASCENT_CODE].set = true;
+ }
+ if (!p[DESCENT_CODE].set) {
+ p[DESCENT_CODE].val = p[FONTBBOX2_CODE].val;
+ p[DESCENT_CODE].set = true;
+ }
+ if (!p[CAPHEIGHT_CODE].set) {
+ p[CAPHEIGHT_CODE].val = p[FONTBBOX4_CODE].val;
+ p[CAPHEIGHT_CODE].set = true;
+ }
+}
+
static void write_fontmetrics(fd_entry * fd)
{
int i;
- if (fd->font_dim[FONTBBOX1_CODE].set && fd->font_dim[FONTBBOX2_CODE].set
- && fd->font_dim[FONTBBOX3_CODE].set && fd->font_dim[FONTBBOX4_CODE].set)
- pdf_printf("/%s [%i %i %i %i]\n", font_key[FONTBBOX1_CODE].pdfname,
- (int) fd->font_dim[FONTBBOX1_CODE].val,
- (int) fd->font_dim[FONTBBOX2_CODE].val,
- (int) fd->font_dim[FONTBBOX3_CODE].val,
- (int) fd->font_dim[FONTBBOX4_CODE].val);
+ fix_fontmetrics(fd);
+ pdf_printf("/%s [%i %i %i %i]\n", font_key[FONTBBOX1_CODE].pdfname,
+ (int) fd->font_dim[FONTBBOX1_CODE].val,
+ (int) fd->font_dim[FONTBBOX2_CODE].val,
+ (int) fd->font_dim[FONTBBOX3_CODE].val,
+ (int) fd->font_dim[FONTBBOX4_CODE].val);
for (i = 0; i < GEN_KEY_NUM; i++)
if (fd->font_dim[i].set)
pdf_printf("/%s %i\n", font_key[i].pdfname, fd->font_dim[i].val);
@@ -299,7 +321,7 @@ void get_char_range(fo_entry * fo, internalfontnumber f)
{
int i;
assert(fo != NULL);
- for (i = font_bc(f); i <= font_ec(f); i++) /* search for first_char and last_char */
+ for (i = font_bc(f); i <= font_ec(f); i++) /* search for first_char and last_char */
if (pdf_char_marked(f, i))
break;
fo->first_char = i;
@@ -308,15 +330,31 @@ void get_char_range(fo_entry * fo, internalfontnumber f)
break;
fo->last_char = i;
if ((fo->first_char > fo->last_char)
- || !pdf_char_marked(f, fo->first_char)) { /* no character used from this font */
+ || !pdf_char_marked(f, fo->first_char)) { /* no character used from this font */
fo->last_char = 0;
fo->first_char = fo->last_char + 1;
}
}
+static int font_has_subset(internalfontnumber f)
+{
+ int i, s;
+ for (i = font_bc(f); i <= font_ec(f); i++) /* search for first_char and last_char */
+ if (pdf_char_marked(f, i))
+ break;
+ s = i;
+ for (i = font_ec(f); i >= font_bc(f); i--)
+ if (pdf_char_marked(f, i))
+ break;
+ if (s > i)
+ return 0;
+ else
+ return 1;
+}
+
static void write_charwidth_array(fo_entry * fo, internalfontnumber f)
{
- int i, j, *ip, *fip, width;
+ int i, j, *ip, *fip;
struct avl_traverser t;
assert(fo->tx_tree != NULL);
assert(fo->cw_objnum == 0);
@@ -335,10 +373,7 @@ static void write_charwidth_array(fo_entry * fo, internalfontnumber f)
j++;
}
j = i;
- width = divide_scaled(char_width(f, i), pdf_font_size(f), 4);
- pdf_printf("%i", (int) width / 10); /* see adv_char_width() in pdftex.web */
- if ((width = width % 10) != 0)
- pdf_printf(".%i", width);
+ pdf_print_charwidth(f, i);
}
pdf_puts("]\n");
pdf_end_obj();
@@ -374,72 +409,89 @@ void register_fo_entry(fo_entry * fo)
assert(fo != NULL);
assert(fo->fm != NULL);
assert(fo->fm->tfm_name != NULL);
- assert (lookup_fo_entry(fo->fm->tfm_name) == NULL) ;
- aa = avl_probe(fo_tree, fo);
- assert(aa != NULL);
+ assert(lookup_fo_entry(fo->fm->tfm_name) == NULL);
+ aa = avl_probe(fo_tree, fo);
+ assert(aa != NULL);
}
/**********************************************************************/
static void write_fontfile(fd_entry * fd)
{
- assert(is_included(fd->fm));
- if (is_cidkeyed(fd->fm)) {
- if (is_opentype(fd->fm))
- writetype0(fd);
- else if (is_truetype(fd->fm))
- writetype2(fd);
- else if (is_type1(fd->fm))
- writetype1w(fd);
- else
- assert(0);
- } else {
- if (is_type1(fd->fm))
-#ifdef DO_TYPE1C
- writet1c(fd);
-#else
- writet1(fd);
-#endif
- else if (is_truetype(fd->fm))
- writettf(fd);
- else if (is_opentype(fd->fm))
- writeotf(fd);
- else
- assert(0);
- }
- if (!fd->ff_found)
- return;
- assert(fd->ff_objnum == 0);
- fd->ff_objnum = pdf_new_objnum();
- pdf_begin_dict(fd->ff_objnum, 0); /* font file stream */
- if (is_cidkeyed(fd->fm)) {
- /* No subtype is used for TrueType-based OpenType fonts */
- if (is_opentype(fd->fm) || is_type1(fd->fm))
- pdf_puts("/Subtype /CIDFontType0C\n");
- /* else
- pdf_puts("/Subtype /OpenType\n");*/
- } else {
- if (is_type1(fd->fm))
- pdf_printf("/Length1 %i\n/Length2 %i\n/Length3 %i\n",
- (int) t1_length1, (int) t1_length2, (int) t1_length3);
- else if (is_truetype(fd->fm))
- pdf_printf("/Length1 %i\n", (int) ttf_length);
- else if (is_opentype(fd->fm))
- pdf_puts("/Subtype /Type1C\n");
- else
- assert(0);
+ assert(is_included(fd->fm));
+ if (is_cidkeyed(fd->fm)) {
+ if (is_opentype(fd->fm))
+ writetype0(fd);
+ else if (is_truetype(fd->fm))
+ writetype2(fd);
+ else if (is_type1(fd->fm))
+ writetype1w(fd);
+ else
+ assert(0);
+ } else {
+ if (is_type1(fd->fm))
+ writet1(fd);
+ else if (is_truetype(fd->fm))
+ writettf(fd);
+ else if (is_opentype(fd->fm))
+ writeotf(fd);
+ else
+ assert(0);
}
- pdf_begin_stream();
- fb_flush();
- pdf_end_stream();
+ if (!fd->ff_found)
+ return;
+ assert(fd->ff_objnum == 0);
+ fd->ff_objnum = pdf_new_objnum();
+ pdf_begin_dict(fd->ff_objnum, 0); /* font file stream */
+ if (is_cidkeyed(fd->fm)) {
+ /* No subtype is used for TrueType-based OpenType fonts */
+ if (is_opentype(fd->fm) || is_type1(fd->fm))
+ pdf_puts("/Subtype /CIDFontType0C\n");
+ /* else
+ pdf_puts("/Subtype /OpenType\n"); */
+ } else {
+ if (is_type1(fd->fm))
+ pdf_printf("/Length1 %i\n/Length2 %i\n/Length3 %i\n",
+ (int) t1_length1, (int) t1_length2, (int) t1_length3);
+ else if (is_truetype(fd->fm))
+ pdf_printf("/Length1 %i\n", (int) ttf_length);
+ else if (is_opentype(fd->fm))
+ pdf_puts("/Subtype /Type1C\n");
+ else
+ assert(0);
+ }
+ pdf_begin_stream();
+ fb_flush();
+ pdf_end_stream();
}
/**********************************************************************/
static void write_fontdescriptor(fd_entry * fd)
{
+ static const int std_flags[] = {
+ /* indices for << start with 0, but bits start with 1, so the numbers
+ * for << are 1 lower than the bits in table 5.20 */
+ /* *INDENT-OFF* */
+ 1 + 2 + (1 << 5), /* Courier */
+ 1 + 2 + (1 << 5) + (1 << 18),/* Courier-Bold */
+ 1 + 2 + (1 << 5) + (1 << 6), /* Courier-Oblique */
+ 1 + 2 + (1 << 5) + (1 << 6) + (1 << 18),/* Courier-BoldOblique */
+ (1 << 5), /* Helvetica */
+ (1 << 5) + (1 << 18),/* Helvetica-Bold */
+ (1 << 5) + (1 << 6), /* Helvetica-Oblique */
+ (1 << 5) + (1 << 6) + (1 << 18),/* Helvetica-BoldOblique */
+ 4, /* Symbol */
+ 2 + (1 << 5), /* Times-Roman */
+ 2 + (1 << 5) + (1 << 18),/* Times-Bold */
+ 2 + (1 << 5) + (1 << 6), /* Times-Italic */
+ 2 + (1 << 5) + (1 << 6) + (1 << 18),/* Times-BoldItalic */
+ 4 /* ZapfDingbats */
+ /* *INDENT-ON* */
+ };
char *glyph;
struct avl_traverser t;
+ int fd_flags;
assert(fd != NULL && fd->fm != NULL);
if (is_fontfile(fd->fm))
@@ -451,13 +503,24 @@ static void write_fontdescriptor(fd_entry * fd)
pdf_begin_dict(fd->fd_objnum, 1);
pdf_puts("/Type /FontDescriptor\n");
write_fontname(fd, "FontName");
- if (!fd->ff_found && fd->fm->fd_flags == 4)
- pdf_puts("/Flags 34\n"); /* assumes a roman sans serif font */
- else
- pdf_printf("/Flags %i\n", (int) fd->fm->fd_flags);
+ if (fd->fm->fd_flags != FD_FLAGS_NOT_SET_IN_MAPLINE)
+ fd_flags = (int) fd->fm->fd_flags;
+ else if (fd->ff_found)
+ fd_flags = FD_FLAGS_DEFAULT_EMBED;
+ else {
+ fd_flags = is_std_t1font(fd->fm)
+ ? std_flags[check_std_t1font(fd->fm->ps_name)]
+ : FD_FLAGS_DEFAULT_NON_EMBED;
+ pdftex_warn
+ ("No flags specified for non-embedded font `%s' (%s) (I'm using %i): "
+ "fix your map entry.",
+ fd->fm->ps_name != NULL ? fd->fm->ps_name : "No name given",
+ fd->fm->tfm_name, fd_flags);
+ }
+ pdf_printf("/Flags %i\n", fd_flags);
write_fontmetrics(fd);
if (is_cidkeyed(fd->fm)) {
- if (is_type1(fd->fm))
+ if (is_type1(fd->fm))
pdf_printf("/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
else if (is_truetype(fd->fm))
pdf_printf("/FontFile2 %i 0 R\n", (int) fd->ff_objnum);
@@ -466,36 +529,36 @@ static void write_fontdescriptor(fd_entry * fd)
else
assert(0);
} else {
- if (fd->ff_found) {
- if (is_subsetted(fd->fm) && is_type1(fd->fm)) {
- /* /CharSet is optional; names may appear in any order */
- assert(fd->gl_tree != NULL);
- avl_t_init(&t, fd->gl_tree);
- pdf_puts("/CharSet (");
- for (glyph = (char *) avl_t_first(&t, fd->gl_tree); glyph != NULL;
- glyph = (char *) avl_t_next(&t))
- pdf_printf("/%s", glyph);
- pdf_puts(")\n");
+ if (fd->ff_found) {
+ if (is_subsetted(fd->fm) && is_type1(fd->fm)) {
+ /* /CharSet is optional; names may appear in any order */
+ assert(fd->gl_tree != NULL);
+ avl_t_init(&t, fd->gl_tree);
+ pdf_puts("/CharSet (");
+ for (glyph = (char *) avl_t_first(&t, fd->gl_tree);
+ glyph != NULL; glyph = (char *) avl_t_next(&t))
+ pdf_printf("/%s", glyph);
+ pdf_puts(")\n");
+ }
+ if (is_type1(fd->fm))
+ pdf_printf("/FontFile %i 0 R\n", (int) fd->ff_objnum);
+ else if (is_truetype(fd->fm))
+ pdf_printf("/FontFile2 %i 0 R\n", (int) fd->ff_objnum);
+ else if (is_opentype(fd->fm))
+ pdf_printf("/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
+ else
+ assert(0);
}
- if (is_type1(fd->fm))
- pdf_printf("/FontFile %i 0 R\n", (int) fd->ff_objnum);
- else if (is_truetype(fd->fm))
- pdf_printf("/FontFile2 %i 0 R\n", (int) fd->ff_objnum);
- else if (is_opentype(fd->fm))
- pdf_printf("/FontFile3 %i 0 R\n", (int) fd->ff_objnum);
- else
- assert(0);
- }
}
/* TODO: Optional keys for CID fonts.
-
+
The most interesting ones are
- /Style << /Panose <12-byte string>>>
+ /Style << /Panose <12-byte string>>>
and
- /CIDSET <stream>
+ /CIDSET <stream>
the latter can be used in subsets, to give the included CIDs
as a bitmap on the whole list.
- */
+ */
pdf_end_dict();
}
@@ -535,11 +598,7 @@ void write_fontdictionary(fo_entry * fo)
pdf_puts("/Type /Font\n");
pdf_puts("/Subtype /");
if (is_type1(fo->fm))
-#ifdef DO_TYPE1C
- pdf_printf("%s\n", "Type1C");
-#else
pdf_printf("%s\n", "Type1");
-#endif
else if (is_truetype(fo->fm))
pdf_printf("%s\n", "TrueType");
else if (is_opentype(fo->fm))
@@ -551,14 +610,14 @@ void write_fontdictionary(fo_entry * fo)
pdf_printf("/FontDescriptor %i 0 R\n", (int) fo->fd->fd_objnum);
assert(fo->cw_objnum != 0);
pdf_printf("/FirstChar %i\n/LastChar %i\n/Widths %i 0 R\n",
- (int) fo->first_char, (int) fo->last_char,
- (int) fo->cw_objnum);
- if ((is_type1(fo->fm) || is_opentype(fo->fm)) && fo->fe != NULL && fo->fe->fe_objnum != 0)
+ (int) fo->first_char, (int) fo->last_char, (int) fo->cw_objnum);
+ if ((is_type1(fo->fm) || is_opentype(fo->fm)) && fo->fe != NULL
+ && fo->fe->fe_objnum != 0)
pdf_printf("/Encoding %i 0 R\n", (int) fo->fe->fe_objnum);
if (fo->tounicode_objnum != 0)
pdf_printf("/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
if (pdf_font_attr(fo->tex_font) != get_nullstr()) {
- pdf_print(pdf_font_attr(fo->tex_font));
+ pdf_print(pdf_font_attr(fo->tex_font));
pdf_puts("\n");
}
pdf_end_dict();
@@ -596,7 +655,8 @@ void create_fontdictionary(fm_entry * fm, integer font_objnum,
{
fo_entry *fo = new_fo_entry();
get_char_range(fo, f); /* set fo->first_char and fo->last_char from f */
- if (fo->last_char>255) fo->last_char=255; /* added 9-4-2008, mantis #25 */
+ if (fo->last_char > 255)
+ fo->last_char = 255; /* added 9-4-2008, mantis #25 */
assert(fo->last_char >= fo->first_char);
fo->fm = fm;
fo->fo_objnum = font_objnum;
@@ -605,7 +665,7 @@ void create_fontdictionary(fm_entry * fm, integer font_objnum,
fo->fe = get_fe_entry(fo->fm->encname); /* returns NULL if .enc file couldn't be opened */
if (fo->fe != NULL && (is_type1(fo->fm) || is_opentype(fo->fm))) {
if (fo->fe->fe_objnum == 0)
- fo->fe->fe_objnum = pdf_new_objnum(); /* then it will be written out */
+ fo->fe->fe_objnum = pdf_new_objnum(); /* then it will be written out */
/* mark encoding pairs used by TeX to optimize encoding vector */
fo->fe->tx_tree = mark_chars(fo, fo->fe->tx_tree, f);
}
@@ -613,37 +673,37 @@ void create_fontdictionary(fm_entry * fm, integer font_objnum,
fo->tx_tree = mark_chars(fo, fo->tx_tree, f); /* for write_charwidth_array() */
write_charwidth_array(fo, f);
if (!is_builtin(fo->fm)) {
- if (is_type1(fo->fm)) {
- if ((fo->fd = lookup_fontdescriptor(fo)) == NULL) {
- create_fontdescriptor(fo, f);
- register_fd_entry(fo->fd);
- }
- } else
- create_fontdescriptor(fo, f);
- if (fo->fe != NULL) {
- mark_reenc_glyphs(fo, f);
- if (!is_type1(fo->fm)) {
- /* mark reencoded characters as chars on TeX level */
- assert(fo->fd->tx_tree == NULL);
- fo->fd->tx_tree = mark_chars(fo, fo->fd->tx_tree, f);
- if (is_truetype(fo->fm))
- fo->fd->write_ttf_glyph_names = true;
- }
- } else
- /* mark non-reencoded characters as chars on TeX level */
- fo->fd->tx_tree = mark_chars(fo, fo->fd->tx_tree, f);
- if (!is_type1(fo->fm))
- write_fontdescriptor(fo->fd);
+ if (is_type1(fo->fm)) {
+ if ((fo->fd = lookup_fontdescriptor(fo)) == NULL) {
+ create_fontdescriptor(fo, f);
+ register_fd_entry(fo->fd);
+ }
+ } else
+ create_fontdescriptor(fo, f);
+ if (fo->fe != NULL) {
+ mark_reenc_glyphs(fo, f);
+ if (!is_type1(fo->fm)) {
+ /* mark reencoded characters as chars on TeX level */
+ assert(fo->fd->tx_tree == NULL);
+ fo->fd->tx_tree = mark_chars(fo, fo->fd->tx_tree, f);
+ if (is_truetype(fo->fm))
+ fo->fd->write_ttf_glyph_names = true;
+ }
+ } else
+ /* mark non-reencoded characters as chars on TeX level */
+ fo->fd->tx_tree = mark_chars(fo, fo->fd->tx_tree, f);
+ if (!is_type1(fo->fm))
+ write_fontdescriptor(fo->fd);
} else {
- /* builtin fonts still need the /Widths array and /FontDescriptor
- * (to avoid error 'font FOO contains bad /BBox')
- */
- create_fontdescriptor(fo, f);
- write_fontdescriptor(fo->fd);
- if (!is_std_t1font(fo->fm))
- pdftex_warn("font `%s' is not a standard font; "
- "I suppose it is available to your PDF viewer then",
- fo->fm->ps_name);
+ /* builtin fonts still need the /Widths array and /FontDescriptor
+ * (to avoid error 'font FOO contains bad /BBox')
+ */
+ create_fontdescriptor(fo, f);
+ write_fontdescriptor(fo->fd);
+ if (!is_std_t1font(fo->fm))
+ pdftex_warn("font `%s' is not a standard font; "
+ "I suppose it is available to your PDF viewer then",
+ fo->fm->ps_name);
}
if (is_type1(fo->fm))
register_fo_entry(fo);
@@ -658,47 +718,57 @@ void do_pdf_font(integer font_objnum, internalfontnumber f)
{
fm_entry *fm;
/* This is not 100% true: CID is actually needed whenever (and
- * only) there are more than 256 separate glyphs used. But for
- * now, just assume the user knows what he is doing;
- */
- if (font_encodingbytes(f)==2) {
- /* Create a virtual font map entry, as this is needed by the
- * rest of the font inclusion mechanism.
- */
- fm = new_fm_entry();
- fm->tfm_name = font_name(f); /* or whatever, not a real tfm */
- fm->ff_name = font_filename(f); /* the actual file */
- fm->encname = font_encodingname(f); /* for the CIDSystemInfo */
- fm->ps_name = font_fullname(f); /* the true name */
- fm->slant = font_slant(f); /* slant factor */
- fm->extend = font_extend(f); /* extension factor */
- fm->fd_flags = 4; /* can perhaps be done better */
- fm->in_use = true;
-
- switch (font_format(f)) {
- case opentype_format: set_opentype(fm); break;
- case truetype_format: set_truetype(fm); break;
- case type1_format: set_type1(fm); break;
- default:
- pdftex_fail("writefont.c: The file format (%s) for font `%s' is incompatible with wide characters\n",
- font_format_name(f),font_name(f));
- }
- /* This makes "unknown" default to subsetted inclusion */
- if (font_embedding(f)!=no_embedding) {
- set_included(fm);
- if (font_embedding(f)!=full_embedding) {
- set_subsetted(fm);
- }
- }
- set_cidkeyed(fm);
- create_cid_fontdictionary(fm, font_objnum, f);
-
+ * only) there are more than 256 separate glyphs used. But for
+ * now, just assume the user knows what he is doing;
+ */
+ if (!font_has_subset(f))
+ return;
+
+ if (font_encodingbytes(f) == 2) {
+ /* Create a virtual font map entry, as this is needed by the
+ * rest of the font inclusion mechanism.
+ */
+ fm = new_fm_entry();
+ fm->tfm_name = font_name(f); /* or whatever, not a real tfm */
+ fm->ff_name = font_filename(f); /* the actual file */
+ fm->encname = font_encodingname(f); /* for the CIDSystemInfo */
+ fm->ps_name = font_fullname(f); /* the true name */
+ fm->slant = font_slant(f); /* slant factor */
+ fm->extend = font_extend(f); /* extension factor */
+ fm->fd_flags = 4; /* can perhaps be done better */
+ fm->in_use = true;
+
+ switch (font_format(f)) {
+ case opentype_format:
+ set_opentype(fm);
+ break;
+ case truetype_format:
+ set_truetype(fm);
+ break;
+ case type1_format:
+ set_type1(fm);
+ break;
+ default:
+ pdftex_fail
+ ("writefont.c: The file format (%s) for font `%s' is incompatible with wide characters\n",
+ font_format_name(f), font_name(f));
+ }
+ /* This makes "unknown" default to subsetted inclusion */
+ if (font_embedding(f) != no_embedding) {
+ set_included(fm);
+ if (font_embedding(f) != full_embedding) {
+ set_subsetted(fm);
+ }
+ }
+ set_cidkeyed(fm);
+ create_cid_fontdictionary(fm, font_objnum, f);
+
} else {
- fm = hasfmentry(f) ? (fm_entry *) font_map(f) : NULL;
- if (fm == NULL || (fm->ps_name == NULL && fm->ff_name == NULL))
- writet3(font_objnum, f);
- else
- create_fontdictionary(fm, font_objnum, f);
+ fm = hasfmentry(f) ? (fm_entry *) font_map(f) : NULL;
+ if (fm == NULL || (fm->ps_name == NULL && fm->ff_name == NULL))
+ writet3(font_objnum, f);
+ else
+ create_fontdictionary(fm, font_objnum, f);
}
}
@@ -717,11 +787,11 @@ void do_pdf_font(integer font_objnum, internalfontnumber f)
int comp_glw_entry(const void *pa, const void *pb, void *p)
{
- unsigned short i, j;
- i = (*(glw_entry *)pa).id;
- j = (*(glw_entry *)pb).id;
- cmp_return(i,j);
- return 0;
+ unsigned short i, j;
+ i = (*(glw_entry *) pa).id;
+ j = (*(glw_entry *) pb).id;
+ cmp_return(i, j);
+ return 0;
}
void create_cid_fontdescriptor(fo_entry * fo, internalfontnumber f)
@@ -744,26 +814,29 @@ void create_cid_fontdescriptor(fo_entry * fo, internalfontnumber f)
indexes, and those are limited to 16-bit values.
*/
-static void mark_cid_subset_glyphs(fo_entry *fo, internal_font_number f)
-{
- int i, k;
- glw_entry *j;
- void *aa;
- for (k = 1; k <= max_font_id(); k++) {
- if ( k == f || -f == pdf_font_num(k)) {
- for (i = font_bc(k); i <= font_ec(k); i++) {
- if (char_exists(k,i) && char_used(k,i)) {
- j = xtalloc(1,glw_entry);
- j->id = char_index(k,i);
- j->wd = divide_scaled_n(char_width(k, i), pdf_font_size(k), 10000.0);
- if ((glw_entry *)avl_find(fo->fd->gl_tree,j) == NULL) {
- aa = avl_probe(fo->fd->gl_tree, j);
- assert(aa != NULL);
- }
- }
- }
+static void mark_cid_subset_glyphs(fo_entry * fo, internal_font_number f)
+{
+ int i, k, l;
+ glw_entry *j;
+ void *aa;
+ for (k = 1; k <= max_font_id(); k++) {
+ if (k == f || -f == pdf_font_num(k)) {
+ l = pdf_font_size(k);
+ for (i = font_bc(k); i <= font_ec(k); i++) {
+ if (char_exists(k, i) && char_used(k, i)) {
+ j = xtalloc(1, glw_entry);
+ j->id = char_index(k, i);
+ j->wd = divide_scaled_n(char_width(k, i), l, 10000.0);
+ if ((glw_entry *) avl_find(fo->fd->gl_tree, j) == NULL) {
+ aa = avl_probe(fo->fd->gl_tree, j);
+ assert(aa != NULL);
+ } else {
+ xfree(j);
+ }
+ }
+ }
+ }
}
- }
}
/*
@@ -782,38 +855,47 @@ static void mark_cid_subset_glyphs(fo_entry *fo, internal_font_number f)
static void write_cid_charwidth_array(fo_entry * fo)
{
- int i, j;
- glw_entry *glyph;
- struct avl_traverser t;
-
- assert(fo->cw_objnum == 0);
- fo->cw_objnum = pdf_new_objnum();
- pdf_begin_obj(fo->cw_objnum, 1);
- avl_t_init(&t, fo->fd->gl_tree);
- glyph = (glw_entry *) avl_t_first(&t, fo->fd->gl_tree);
- assert(glyph != NULL);
- i = glyph->id;
- pdf_printf("[ %i [", i);
- for (; glyph != NULL; glyph = (glw_entry *) avl_t_next(&t)) {
- j = glyph->wd;
- if (glyph->id>(i+1)) {
- pdf_printf("] %i [", glyph->id);
- j = glyph->wd;
- }
- if (glyph->id==(i+1))
- pdf_puts(" ");
- pdf_printf("%i", (j/10));
- if ((j % 10) != 0)
- pdf_printf(".%i", (j % 10));
+ int i, j;
+ glw_entry *glyph;
+ struct avl_traverser t;
+
+ assert(fo->cw_objnum == 0);
+ fo->cw_objnum = pdf_new_objnum();
+ pdf_begin_obj(fo->cw_objnum, 1);
+ avl_t_init(&t, fo->fd->gl_tree);
+ glyph = (glw_entry *) avl_t_first(&t, fo->fd->gl_tree);
+ assert(glyph != NULL);
i = glyph->id;
- }
- pdf_puts("]]\n");
- pdf_end_obj();
+ pdf_printf("[ %i [", i);
+ for (; glyph != NULL; glyph = (glw_entry *) avl_t_next(&t)) {
+ j = glyph->wd;
+ if (glyph->id > (unsigned) (i + 1)) {
+ pdf_printf("] %i [", glyph->id);
+ j = glyph->wd;
+ }
+ if (glyph->id == (unsigned) (i + 1))
+ pdf_puts(" ");
+
+ if (j < 0) {
+ pdf_puts("-");
+ j = -j;
+ }
+
+ /* pdf_print_charwidth(f, i); */
+
+ pdf_printf("%i", (j / 10));
+ if ((j % 10) != 0)
+ pdf_printf(".%i", (j % 10));
+
+ i = glyph->id;
+ }
+ pdf_puts("]]\n");
+ pdf_end_obj();
}
void create_cid_fontdictionary(fm_entry * fm, integer font_objnum,
- internalfontnumber f)
+ internalfontnumber f)
{
fo_entry *fo = new_fo_entry();
get_char_range(fo, f); /* set fo->first_char and fo->last_char from f */
@@ -821,66 +903,68 @@ void create_cid_fontdictionary(fm_entry * fm, integer font_objnum,
fo->fm = fm;
fo->fo_objnum = font_objnum;
fo->tex_font = f;
- create_cid_fontdescriptor (fo, f);
- mark_cid_subset_glyphs (fo,f);
+ create_cid_fontdescriptor(fo, f);
+ mark_cid_subset_glyphs(fo, f);
if (is_subsetted(fo->fm)) {
- /*
- this is a bit sneaky. |make_subset_tag()| actually expects the glyph tree
- to contain strings instead of |glw_entry| items. However, all calculations
- are done using explicit typecasts, so it works out ok.
- */
- make_subset_tag(fo->fd);
+ /*
+ this is a bit sneaky. |make_subset_tag()| actually expects the glyph tree
+ to contain strings instead of |glw_entry| items. However, all calculations
+ are done using explicit typecasts, so it works out ok.
+ */
+ make_subset_tag(fo->fd);
}
write_cid_charwidth_array(fo);
write_fontdescriptor(fo->fd);
-
- write_cid_fontdictionary(fo,f);
+
+ write_cid_fontdictionary(fo, f);
+ xfree(fo);
}
void write_cid_fontdictionary(fo_entry * fo, internalfontnumber f)
{
int i;
- fo->tounicode_objnum = write_cid_tounicode(fo,f);
+ fo->tounicode_objnum = write_cid_tounicode(fo, f);
pdf_begin_dict(fo->fo_objnum, 1);
pdf_puts("/Type /Font\n");
pdf_puts("/Subtype /Type0\n");
pdf_puts("/Encoding /Identity-H\n");
write_fontname(fo->fd, "BaseFont");
- i = pdf_new_objnum();
+ i = pdf_new_objnum();
pdf_printf("/DescendantFonts [%i 0 R]\n", i);
/* todo: the ToUnicode CMap */
- if (fo->tounicode_objnum != 0)
- pdf_printf("/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
-
+ if (fo->tounicode_objnum != 0)
+ pdf_printf("/ToUnicode %i 0 R\n", (int) fo->tounicode_objnum);
+
pdf_end_dict();
pdf_begin_dict(i, 1);
pdf_puts("/Type /Font\n");
if (is_opentype(fo->fm) || is_type1(fo->fm)) {
- pdf_puts("/Subtype /CIDFontType0\n");
+ pdf_puts("/Subtype /CIDFontType0\n");
} else {
- pdf_puts("/Subtype /CIDFontType2\n");
- pdf_printf("/CIDToGIDMap /Identity\n");
+ pdf_puts("/Subtype /CIDFontType2\n");
+ pdf_printf("/CIDToGIDMap /Identity\n");
}
write_fontname(fo->fd, "BaseFont");
pdf_printf("/FontDescriptor %i 0 R\n", (int) fo->fd->fd_objnum);
- pdf_printf("/W %i 0 R\n",(int) fo->cw_objnum);
+ pdf_printf("/W %i 0 R\n", (int) fo->cw_objnum);
pdf_printf("/CIDSystemInfo <<\n");
- pdf_printf("/Registry (%s)\n", (font_cidregistry(f)? font_cidregistry(f): "Adobe"));
- pdf_printf("/Ordering (%s)\n",(font_cidordering(f)? font_cidordering(f) : "Identity")) ;
- pdf_printf("/Supplement %u\n",(unsigned int)font_cidsupplement(f));
+ pdf_printf("/Registry (%s)\n",
+ (font_cidregistry(f) ? font_cidregistry(f) : "Adobe"));
+ pdf_printf("/Ordering (%s)\n",
+ (font_cidordering(f) ? font_cidordering(f) : "Identity"));
+ pdf_printf("/Supplement %u\n", (unsigned int) font_cidsupplement(f));
pdf_printf(">>\n");
/* I doubt there is anything useful that could be written here */
/*
- if (pdf_font_attr(fo->tex_font) != get_nullstr()) {
- pdf_print(pdf_font_attr(fo->tex_font));
- pdf_puts("\n");
- }
- */
+ if (pdf_font_attr(fo->tex_font) != get_nullstr()) {
+ pdf_print(pdf_font_attr(fo->tex_font));
+ pdf_puts("\n");
+ }
+ */
pdf_end_dict();
}
-
diff --git a/Build/source/texk/web2c/luatexdir/font/writet3.c b/Build/source/texk/web2c/luatexdir/font/writet3.c
index 42827d1b124..4e349860d22 100644
--- a/Build/source/texk/web2c/luatexdir/font/writet3.c
+++ b/Build/source/texk/web2c/luatexdir/font/writet3.c
@@ -1,34 +1,36 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* writet3.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id: writet3.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include <kpathsea/tex-glyph.h>
#include <kpathsea/magstep.h>
#include <string.h>
+#include "luatexfont.h"
+
+static const char _svn_version[] =
+ "$Id: writet3.c 1712 2009-01-02 10:54:55Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writet3.c $";
#define T3_BUF_SIZE 1024
typedef char t3_line_entry;
-define_array (t3_line);
+define_array(t3_line);
FILE *t3_file;
static boolean t3_image_used;
@@ -40,30 +42,18 @@ static float t3_font_scale;
static integer t3_b0, t3_b1, t3_b2, t3_b3;
static boolean is_pk_font;
-static unsigned char *t3_buffer = NULL;
-static integer t3_size = 0;
-static integer t3_curbyte = 0;
-
-
-#define t3_open() \
- open_input(&t3_file, kpse_miscfonts_format, FOPEN_RBIN_MODE)
-#define t3_read_file() readbinfile(t3_file,&t3_buffer,&t3_size)
-#define t3_close() xfclose(t3_file, cur_file_name)
-#define t3_getchar() t3_buffer[t3_curbyte++]
-#define t3_eof() (t3_curbyte>t3_size)
-
-#define t3_prefix(s) (!strncmp(t3_line_array, s, strlen(s)))
-#define t3_putchar(c) pdfout(c)
-
-
+/* not static because used by pkin.c */
+unsigned char *t3_buffer = NULL;
+integer t3_size = 0;
+integer t3_curbyte = 0;
#define t3_check_eof() \
if (t3_eof()) \
pdftex_fail("unexpected end of file");
-static void update_bbox (integer llx, integer lly, integer urx, integer ury,
- boolean is_first_glyph)
+static void update_bbox(integer llx, integer lly, integer urx, integer ury,
+ boolean is_first_glyph)
{
if (is_first_glyph) {
t3_b0 = llx;
@@ -82,111 +72,111 @@ static void update_bbox (integer llx, integer lly, integer urx, integer ury,
}
}
-static integer get_pk_font_scale (internalfontnumber f)
+static integer get_pk_font_scale(internalfontnumber f)
{
return
- divide_scaled (pk_scale_factor,
- divide_scaled (pdf_font_size(f), one_hundred_bp,
+ divide_scaled(pk_scale_factor,
+ divide_scaled(pdf_font_size(f), one_hundred_bp,
fixed_decimal_digits + 2), 0);
}
-static integer pk_char_width (internalfontnumber f, scaled w)
+static integer pk_char_width(internalfontnumber f, scaled w)
{
return
- divide_scaled (divide_scaled (w, pdf_font_size(f), 7),
- get_pk_font_scale (f), 0);
+ divide_scaled(divide_scaled(w, pdf_font_size(f), 7),
+ get_pk_font_scale(f), 0);
}
-scaled get_pk_char_width (internalfontnumber f, scaled w)
+scaled get_pk_char_width(internalfontnumber f, scaled w)
{
- return (get_pk_font_scale (f) / 100000.0) *
- (pk_char_width (f, w) / 100.0) * pdf_font_size(f);
+ return (get_pk_font_scale(f) / 100000.0) *
+ (pk_char_width(f, w) / 100.0) * pdf_font_size(f);
}
-static boolean writepk (internalfontnumber f)
+static boolean writepk(internalfontnumber f)
{
kpse_glyph_file_type font_ret;
integer llx, lly, urx, ury;
integer cw, rw, i, j;
halfword *row;
char *name;
- char *ftemp = NULL;
+ char *ftemp = NULL;
chardesc cd;
boolean is_null_glyph, check_preamble;
integer dpi;
- int callback_id=0;
- int file_opened=0;
- int mallocsize=0;
- if (t3_buffer!=NULL) {
- xfree(t3_buffer);
- t3_buffer=NULL;
+ int callback_id = 0;
+ int file_opened = 0;
+ int mallocsize = 0;
+ if (t3_buffer != NULL) {
+ xfree(t3_buffer);
+ t3_buffer = NULL;
}
- t3_curbyte=0;
- t3_size=0;
+ t3_curbyte = 0;
+ t3_size = 0;
- callback_id=callback_defined(find_pk_file_callback);
+ callback_id = callback_defined(find_pk_file_callback);
- if (callback_id>0) {
- dpi = round (fixed_pk_resolution *
- (((float) pdf_font_size(f)) / font_dsize(f)));
- /* <base>.dpi/<fontname>.<tdpi>pk */
- cur_file_name = font_name(f);
- mallocsize = strlen(cur_file_name)+24+9;
- name = xmalloc(mallocsize);
- snprintf(name,mallocsize,"%ddpi/%s.%dpk",(int)fixed_pk_resolution,cur_file_name,(int)dpi);
- if(run_callback(callback_id,"S->S",name,&ftemp)) {
- if(ftemp!=NULL&&strlen(ftemp)) {
- free(name);
- name = xstrdup(ftemp);
- free(ftemp);
- }
- }
- } else {
- dpi =
- kpse_magstep_fix (round
- (fixed_pk_resolution *
- (((float) pdf_font_size(f)) / font_dsize(f))),
- fixed_pk_resolution, NULL);
- cur_file_name = font_name(f);
- name = kpse_find_pk (cur_file_name, (unsigned) dpi, &font_ret);
- if (name == NULL ||
- !FILESTRCASEEQ (cur_file_name, font_ret.name) ||
- !kpse_bitmap_tolerance ((float) font_ret.dpi, (float) dpi)) {
- pdftex_warn ("Font %s at %i not found", cur_file_name, (int) dpi);
- cur_file_name = NULL;
- return false;
- }
- }
- callback_id=callback_defined(read_pk_file_callback);
- if (callback_id>0) {
- if(! ( run_callback(callback_id,"S->bSd",name, &file_opened, &t3_buffer,&t3_size) &&
- file_opened &&
- t3_size>0 ) ) {
- pdftex_warn ("Font %s at %i not found", cur_file_name, (int)dpi);
- cur_file_name = NULL;
- return false;
- }
+ if (callback_id > 0) {
+ dpi = round(fixed_pk_resolution *
+ (((float) pdf_font_size(f)) / font_dsize(f)));
+ /* <base>.dpi/<fontname>.<tdpi>pk */
+ cur_file_name = font_name(f);
+ mallocsize = strlen(cur_file_name) + 24 + 9;
+ name = xmalloc(mallocsize);
+ snprintf(name, mallocsize, "%ddpi/%s.%dpk", (int) fixed_pk_resolution,
+ cur_file_name, (int) dpi);
+ if (run_callback(callback_id, "S->S", name, &ftemp)) {
+ if (ftemp != NULL && strlen(ftemp)) {
+ free(name);
+ name = xstrdup(ftemp);
+ free(ftemp);
+ }
+ }
+ } else {
+ dpi =
+ kpse_magstep_fix(round
+ (fixed_pk_resolution *
+ (((float) pdf_font_size(f)) / font_dsize(f))),
+ fixed_pk_resolution, NULL);
+ cur_file_name = font_name(f);
+ name = kpse_find_pk(cur_file_name, (unsigned) dpi, &font_ret);
+ if (name == NULL ||
+ !FILESTRCASEEQ(cur_file_name, font_ret.name) ||
+ !kpse_bitmap_tolerance((float) font_ret.dpi, (float) dpi)) {
+ pdftex_fail("Font %s at %i not found", cur_file_name, (int) dpi);
+ }
+ }
+ callback_id = callback_defined(read_pk_file_callback);
+ if (callback_id > 0) {
+ if (!
+ (run_callback
+ (callback_id, "S->bSd", name, &file_opened, &t3_buffer, &t3_size)
+ && file_opened && t3_size > 0)) {
+ pdftex_warn("Font %s at %i not found", cur_file_name, (int) dpi);
+ cur_file_name = NULL;
+ return false;
+ }
} else {
- t3_file = xfopen (name, FOPEN_RBIN_MODE);
- t3_read_file();
- t3_close();
+ t3_file = xfopen(name, FOPEN_RBIN_MODE);
+ recorder_record_input(name);
+ t3_read_file();
+ t3_close();
}
t3_image_used = true;
is_pk_font = true;
- if (tracefilenames)
- tex_printf (" <%s", (char *) name);
+ if (tracefilenames)
+ tex_printf(" <%s", (char *) name);
cd.rastersize = 256;
- cd.raster = xtalloc (cd.rastersize, halfword);
+ cd.raster = xtalloc(cd.rastersize, halfword);
check_preamble = true;
- while (readchar (check_preamble, &cd) != 0) {
+ while (readchar(check_preamble, &cd) != 0) {
check_preamble = false;
- if (!pdf_char_marked (f, cd.charcode))
+ if (!pdf_char_marked(f, cd.charcode))
continue;
t3_char_widths[cd.charcode] =
- pk_char_width (f, get_charwidth (f, cd.charcode));
+ pk_char_width(f, get_charwidth(f, cd.charcode));
if (cd.cwidth < 1 || cd.cheight < 1) {
- cd.xescape = cd.cwidth =
- round (t3_char_widths[cd.charcode] / 100.0);
+ cd.xescape = cd.cwidth = round(t3_char_widths[cd.charcode] / 100.0);
cd.cheight = 1;
cd.xoff = 0;
cd.yoff = 0;
@@ -197,44 +187,44 @@ static boolean writepk (internalfontnumber f)
lly = cd.yoff - cd.cheight + 1;
urx = cd.cwidth + llx + 1;
ury = cd.cheight + lly;
- update_bbox (llx, lly, urx, ury, t3_glyph_num == 0);
+ update_bbox(llx, lly, urx, ury, t3_glyph_num == 0);
t3_glyph_num++;
- pdf_new_dict (0, 0, 0);
+ pdf_new_dict(0, 0, 0);
t3_char_procs[cd.charcode] = obj_ptr;
- pdf_begin_stream ();
- pdf_print_real (t3_char_widths[cd.charcode], 2);
- pdf_printf (" 0 %i %i %i %i d1\n",
- (int) llx, (int) lly, (int) urx, (int) ury);
+ pdf_begin_stream();
+ pdf_print_real(t3_char_widths[cd.charcode], 2);
+ pdf_printf(" 0 %i %i %i %i d1\n",
+ (int) llx, (int) lly, (int) urx, (int) ury);
if (is_null_glyph)
goto end_stream;
- pdf_printf ("q\n%i 0 0 %i %i %i cm\nBI\n", (int) cd.cwidth,
- (int) cd.cheight, (int) llx, (int) lly);
- pdf_printf ("/W %i\n/H %i\n", (int) cd.cwidth, (int) cd.cheight);
- pdf_puts ("/IM true\n/BPC 1\n/D [1 0]\nID ");
+ pdf_printf("q\n%i 0 0 %i %i %i cm\nBI\n", (int) cd.cwidth,
+ (int) cd.cheight, (int) llx, (int) lly);
+ pdf_printf("/W %i\n/H %i\n", (int) cd.cwidth, (int) cd.cheight);
+ pdf_puts("/IM true\n/BPC 1\n/D [1 0]\nID ");
cw = (cd.cwidth + 7) / 8;
rw = (cd.cwidth + 15) / 16;
row = cd.raster;
for (i = 0; i < cd.cheight; i++) {
for (j = 0; j < rw - 1; j++) {
- pdfout (*row / 256);
- pdfout (*row % 256);
+ pdfout(*row / 256);
+ pdfout(*row % 256);
row++;
}
- pdfout (*row / 256);
+ pdfout(*row / 256);
if (2 * rw == cw)
- pdfout (*row % 256);
+ pdfout(*row % 256);
row++;
}
- pdf_puts ("\nEI\nQ\n");
+ pdf_puts("\nEI\nQ\n");
end_stream:
- pdf_end_stream ();
+ pdf_end_stream();
}
- xfree (cd.raster);
+ xfree(cd.raster);
cur_file_name = NULL;
return true;
}
-void writet3 (int objnum, internalfontnumber f)
+void writet3(int objnum, internalfontnumber f)
{
int i;
@@ -250,99 +240,99 @@ void writet3 (int objnum, internalfontnumber f)
t3_char_procs[i] = 0;
t3_char_widths[i] = 0;
}
- pack_file_name (tex_font_name(f), get_nullstr (), maketexlstring (".pgc",4));
- cur_file_name = makecstring (make_name_string ());
+ pack_file_name(tex_font_name(f), get_nullstr(), maketexlstring(".pgc", 4));
+ cur_file_name = makecstring(make_name_string());
is_pk_font = false;
- if (t3_buffer!=NULL) {
- xfree(t3_buffer);
- t3_buffer=NULL;
+ if (t3_buffer != NULL) {
+ xfree(t3_buffer);
+ t3_buffer = NULL;
+ }
+ t3_curbyte = 0;
+ t3_size = 0;
+ if (!writepk(f)) {
+ cur_file_name = NULL;
+ return;
}
- t3_curbyte=0;
- t3_size=0;
- if (!writepk (f)) {
- cur_file_name = NULL;
- return;
- }
for (i = font_bc(f); i <= font_ec(f); i++)
- if (pdf_char_marked (f, i))
+ if (pdf_char_marked(f, i))
break;
first_char = i;
for (i = font_ec(f); i > first_char; i--)
- if (pdf_char_marked (f, i))
+ if (pdf_char_marked(f, i))
break;
last_char = i;
- pdf_begin_dict (objnum, 1); /* Type 3 font dictionary */
- pdf_puts ("/Type /Font\n/Subtype /Type3\n");
- pdf_printf ("/Name /F%i\n", (int) f);
- if (pdf_font_attr(f) != get_nullstr ()) {
- pdf_print (pdf_font_attr(f));
- pdf_puts ("\n");
+ pdf_begin_dict(objnum, 1); /* Type 3 font dictionary */
+ pdf_puts("/Type /Font\n/Subtype /Type3\n");
+ pdf_printf("/Name /F%i\n", (int) f);
+ if (pdf_font_attr(f) != get_nullstr()) {
+ pdf_print(pdf_font_attr(f));
+ pdf_puts("\n");
}
if (is_pk_font) {
- pk_font_scale = get_pk_font_scale (f);
- pdf_puts ("/FontMatrix [");
- pdf_print_real (pk_font_scale, 5);
- pdf_puts (" 0 0 ");
- pdf_print_real (pk_font_scale, 5);
- pdf_puts (" 0 0]\n");
+ pk_font_scale = get_pk_font_scale(f);
+ pdf_puts("/FontMatrix [");
+ pdf_print_real(pk_font_scale, 5);
+ pdf_puts(" 0 0 ");
+ pdf_print_real(pk_font_scale, 5);
+ pdf_puts(" 0 0]\n");
} else
- pdf_printf ("/FontMatrix [%g 0 0 %g 0 0]\n",
- (double) t3_font_scale, (double) t3_font_scale);
- pdf_printf ("/%s [ %i %i %i %i ]\n",
- font_key[FONTBBOX1_CODE].pdfname,
- (int) t3_b0, (int) t3_b1, (int) t3_b2, (int) t3_b3);
- pdf_printf ("/Resources << /ProcSet [ /PDF %s] >>\n",
- t3_image_used ? "/ImageB " : "");
- pdf_printf ("/FirstChar %i\n/LastChar %i\n", first_char, last_char);
- wptr = pdf_new_objnum ();
- eptr = pdf_new_objnum ();
- cptr = pdf_new_objnum ();
- pdf_printf ("/Widths %i 0 R\n/Encoding %i 0 R\n/CharProcs %i 0 R\n",
- (int)wptr, (int)eptr, (int)cptr);
- pdf_end_dict ();
- pdf_begin_obj (wptr, 1); /* chars width array */
- pdf_puts ("[");
+ pdf_printf("/FontMatrix [%g 0 0 %g 0 0]\n",
+ (double) t3_font_scale, (double) t3_font_scale);
+ pdf_printf("/%s [ %i %i %i %i ]\n",
+ font_key[FONTBBOX1_CODE].pdfname,
+ (int) t3_b0, (int) t3_b1, (int) t3_b2, (int) t3_b3);
+ pdf_printf("/Resources << /ProcSet [ /PDF %s] >>\n",
+ t3_image_used ? "/ImageB " : "");
+ pdf_printf("/FirstChar %i\n/LastChar %i\n", first_char, last_char);
+ wptr = pdf_new_objnum();
+ eptr = pdf_new_objnum();
+ cptr = pdf_new_objnum();
+ pdf_printf("/Widths %i 0 R\n/Encoding %i 0 R\n/CharProcs %i 0 R\n",
+ (int) wptr, (int) eptr, (int) cptr);
+ pdf_end_dict();
+ pdf_begin_obj(wptr, 1); /* chars width array */
+ pdf_puts("[");
if (is_pk_font)
for (i = first_char; i <= last_char; i++) {
- pdf_print_real (t3_char_widths[i], 2);
- pdf_puts (" ");
+ pdf_print_real(t3_char_widths[i], 2);
+ pdf_puts(" ");
} else
for (i = first_char; i <= last_char; i++)
- pdf_printf ("%i ", (int) t3_char_widths[i]);
- pdf_puts ("]\n");
- pdf_end_obj ();
- pdf_begin_dict (eptr, 1); /* encoding dictionary */
- pdf_printf ("/Type /Encoding\n/Differences [%i", first_char);
+ pdf_printf("%i ", (int) t3_char_widths[i]);
+ pdf_puts("]\n");
+ pdf_end_obj();
+ pdf_begin_dict(eptr, 1); /* encoding dictionary */
+ pdf_printf("/Type /Encoding\n/Differences [%i", first_char);
if (t3_char_procs[first_char] == 0) {
- pdf_printf ("/%s", notdef);
+ pdf_printf("/%s", notdef);
is_notdef = true;
} else {
- pdf_printf ("/a%i", first_char);
+ pdf_printf("/a%i", first_char);
is_notdef = false;
}
for (i = first_char + 1; i <= last_char; i++) {
if (t3_char_procs[i] == 0) {
if (!is_notdef) {
- pdf_printf (" %i/%s", i, notdef);
+ pdf_printf(" %i/%s", i, notdef);
is_notdef = true;
}
} else {
if (is_notdef) {
- pdf_printf (" %i", i);
+ pdf_printf(" %i", i);
is_notdef = false;
}
- pdf_printf ("/a%i", i);
+ pdf_printf("/a%i", i);
}
}
- pdf_puts ("]\n");
- pdf_end_dict ();
- pdf_begin_dict (cptr, 1); /* CharProcs dictionary */
+ pdf_puts("]\n");
+ pdf_end_dict();
+ pdf_begin_dict(cptr, 1); /* CharProcs dictionary */
for (i = first_char; i <= last_char; i++)
if (t3_char_procs[i] != 0)
- pdf_printf ("/a%i %i 0 R\n", (int) i, (int) t3_char_procs[i]);
- pdf_end_dict ();
- if (tracefilenames)
- tex_printf (">");
+ pdf_printf("/a%i %i 0 R\n", (int) i, (int) t3_char_procs[i]);
+ pdf_end_dict();
+ if (tracefilenames)
+ tex_printf(">");
cur_file_name = NULL;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/writettf.c b/Build/source/texk/web2c/luatexdir/font/writettf.c
index 2a92706a0de..fafd7c6eab4 100644
--- a/Build/source/texk/web2c/luatexdir/font/writettf.c
+++ b/Build/source/texk/web2c/luatexdir/font/writettf.c
@@ -1,29 +1,30 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
+/* writettf.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: writettf.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include "writettf.h"
#include <string.h>
+static const char _svn_version[] =
+ "$Id: writettf.c 1592 2008-11-28 13:23:51Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writettf.c $";
+
#define DEFAULT_NTABS 14
#define NEW_CMAP_SIZE 2
@@ -31,7 +32,7 @@ $Id: writettf.c 1013 2008-02-14 00:09:02Z oneiros $
#define ttf_offset fb_offset
#define ttf_seek_outbuf fb_seek
- /* #define INFILE ttf_file*/
+ /* #define INFILE ttf_file */
unsigned char *ttf_buffer = NULL;
integer ttf_size = 0;
@@ -40,7 +41,7 @@ integer ttf_curbyte = 0;
typedef struct {
char *name; /* name of glyph */
long code; /* charcode in case of subfonts */
- short newindex; /* new index of glyph in output file */
+ long newindex; /* new index of glyph in output file */
} ttfenc_entry;
@@ -59,7 +60,7 @@ typedef struct {
char *ttf_name;
TTF_USHORT pid;
TTF_USHORT eid;
- short *table;
+ long *table;
} ttf_cmap_entry;
static TTF_USHORT ntabs;
@@ -89,7 +90,7 @@ static TTF_ULONG checkSumAdjustment_offset;
FILE *ttf_file;
static ttfenc_entry ttfenc_tab[256];
-fd_entry *fd_cur; /* pointer to the current font descriptor */
+fd_entry *fd_cur; /* pointer to the current font descriptor */
static struct avl_table *ttf_cmap_tree = NULL;
@@ -97,8 +98,8 @@ integer ttf_length;
#include "macnames.c"
-extern char *fb_array;
-extern char charsetstr[];
+extern char *fb_array; /* from luatexdir/utils.c */
+extern char charsetstr[]; /* from mpdir/psout.w */
static const char *newtabnames[] = {
"OS/2",
@@ -117,44 +118,44 @@ static const char *newtabnames[] = {
"prep"
};
-ttf_cmap_entry *new_ttf_cmap_entry (void)
+ttf_cmap_entry *new_ttf_cmap_entry(void)
{
ttf_cmap_entry *e;
- e = xtalloc (1, ttf_cmap_entry);
+ e = xtalloc(1, ttf_cmap_entry);
e->ttf_name = NULL;
e->table = NULL;
return e;
}
-static void destroy_ttf_cmap_entry (void *pa, void *pb)
+static void destroy_ttf_cmap_entry(void *pa, void *pb)
{
ttf_cmap_entry *p;
p = (ttf_cmap_entry *) pa;
- xfree (p->ttf_name);
- xfree (p->table);
- xfree (p);
+ xfree(p->ttf_name);
+ xfree(p->table);
+ xfree(p);
}
-void ttf_free (void)
+void ttf_free(void)
{
if (ttf_cmap_tree != NULL)
- avl_destroy (ttf_cmap_tree, destroy_ttf_cmap_entry);
+ avl_destroy(ttf_cmap_tree, destroy_ttf_cmap_entry);
}
-static int comp_ttf_cmap_entry (const void *pa, const void *pb, void *p)
+static int comp_ttf_cmap_entry(const void *pa, const void *pb, void *p)
{
const ttf_cmap_entry *p1 = (const ttf_cmap_entry *) pa,
*p2 = (const ttf_cmap_entry *) pb;
int i;
- assert (p1->ttf_name != NULL && p2->ttf_name != NULL);
- if ((i = strcmp (p1->ttf_name, p2->ttf_name)) != 0)
+ assert(p1->ttf_name != NULL && p2->ttf_name != NULL);
+ if ((i = strcmp(p1->ttf_name, p2->ttf_name)) != 0)
return i;
- cmp_return (p1->pid, p2->pid);
- cmp_return (p1->eid, p2->eid);
+ cmp_return(p1->pid, p2->pid);
+ cmp_return(p1->eid, p2->eid);
return 0;
}
-static unsigned char ttf_addchksm (unsigned char b)
+static unsigned char ttf_addchksm(unsigned char b)
{
tmp_ulong = (tmp_ulong << 8) + b;
tab_length++;
@@ -165,14 +166,14 @@ static unsigned char ttf_addchksm (unsigned char b)
return b;
}
-static TTF_ULONG ttf_getchksm (void)
+static TTF_ULONG ttf_getchksm(void)
{
while (tab_length % 4 != 0)
- ttf_putchar (ttf_addchksm (0)); /* ttf_addchksm updates tab_length */
+ ttf_putchar(ttf_addchksm(0)); /* ttf_addchksm updates tab_length */
return checksum;
}
-long ttf_putnum (int s, long n)
+long ttf_putnum(int s, long n)
{
long i = n;
char buf[TTF_LONG_SIZE + 1], *p = buf;
@@ -182,25 +183,25 @@ long ttf_putnum (int s, long n)
}
p--;
while (p >= buf)
- ttf_putchar (ttf_addchksm (*p--));
+ ttf_putchar(ttf_addchksm(*p--));
return n;
}
-long ttf_getnum (int s)
+long ttf_getnum(int s)
{
long i = 0;
int c;
while (s > 0) {
- if (ttf_eof())
- pdftex_fail ("unexpected EOF");
- c = ttf_getchar ();
- i = (i << 8) + c;
- s--;
+ if (ttf_eof())
+ pdftex_fail("unexpected EOF");
+ c = ttf_getchar();
+ i = (i << 8) + c;
+ s--;
}
return i;
}
-static long ttf_funit (long n)
+static long ttf_funit(long n)
{
if (n < 0)
return -((-n / upem) * 1000 + ((-n % upem) * 1000) / upem);
@@ -208,38 +209,38 @@ static long ttf_funit (long n)
return (n / upem) * 1000 + ((n % upem) * 1000) / upem;
}
-static void ttf_ncopy (int n)
+static void ttf_ncopy(int n)
{
while (n-- > 0)
- copy_byte ();
+ copy_byte();
}
-dirtab_entry *ttf_name_lookup (const char *s, boolean required)
+dirtab_entry *ttf_name_lookup(const char *s, boolean required)
{
dirtab_entry *tab;
for (tab = dir_tab; tab - dir_tab < ntabs; tab++)
- if (strncmp (tab->tag, s, 4) == 0)
+ if (strncmp(tab->tag, s, 4) == 0)
break;
if (tab - dir_tab == ntabs) {
if (required)
- pdftex_fail ("can't find table `%s'", s);
+ pdftex_fail("can't find table `%s'", s);
else
tab = NULL;
}
return tab;
}
-dirtab_entry *ttf_seek_tab (const char *name, TTF_LONG offset)
+dirtab_entry *ttf_seek_tab(const char *name, TTF_LONG offset)
{
- dirtab_entry *tab = ttf_name_lookup (name, true);
- /*xfseek (INFILE, tab->offset + offset, SEEK_SET, cur_file_name);*/
- ttf_curbyte = tab->offset + offset;
+ dirtab_entry *tab = ttf_name_lookup(name, true);
+ /*xfseek (INFILE, tab->offset + offset, SEEK_SET, cur_file_name); */
+ ttf_curbyte = tab->offset + offset;
return tab;
}
-static void ttf_seek_off (TTF_LONG offset)
+static void ttf_seek_off(TTF_LONG offset)
{
- ttf_curbyte = offset;
+ ttf_curbyte = offset;
//xfseek (INFILE, offset, SEEK_SET, cur_file_name);
}
@@ -294,7 +295,9 @@ static void ttf_copy_encoding(void)
e = ttfenc_tab + *q;
e->code = charcodes[*q];
if (e->code == -1)
- pdftex_warn("character %i is not mapped to any charcode", *q);
+ pdftex_warn
+ ("character %i in subfont %s is not mapped to any charcode",
+ *q, fd_cur->fm->tfm_name);
else {
assert(e->code < 0x10000);
sprintf(buf, "/c%4.4X", (int) e->code);
@@ -333,27 +336,27 @@ static char *strip_spaces_and_delims(char *s, int l)
return buf;
}
-static void ttf_read_name (void)
+static void ttf_read_name(void)
{
int i, j;
- dirtab_entry *tab = ttf_seek_tab ("name", TTF_USHORT_SIZE);
- char *p;
- name_record_num = get_ushort ();
- name_tab = xtalloc (name_record_num, name_record);
+ dirtab_entry *tab = ttf_seek_tab("name", TTF_USHORT_SIZE);
+ char *p, buf[SMALL_BUF_SIZE];
+ name_record_num = get_ushort();
+ name_tab = xtalloc(name_record_num, name_record);
name_buf_size = tab->length -
(3 * TTF_USHORT_SIZE + name_record_num * 6 * TTF_USHORT_SIZE);
- name_buf = xtalloc (name_buf_size, char);
- ttf_skip (TTF_USHORT_SIZE);
+ name_buf = xtalloc(name_buf_size, char);
+ ttf_skip(TTF_USHORT_SIZE);
for (i = 0; i < name_record_num; i++) {
- name_tab[i].platform_id = get_ushort ();
- name_tab[i].encoding_id = get_ushort ();
- name_tab[i].language_id = get_ushort ();
- name_tab[i].name_id = get_ushort ();
- name_tab[i].length = get_ushort ();
- name_tab[i].offset = get_ushort ();
+ name_tab[i].platform_id = get_ushort();
+ name_tab[i].encoding_id = get_ushort();
+ name_tab[i].language_id = get_ushort();
+ name_tab[i].name_id = get_ushort();
+ name_tab[i].length = get_ushort();
+ name_tab[i].offset = get_ushort();
}
for (p = name_buf; p - name_buf < name_buf_size; p++)
- *p = get_char ();
+ *p = get_char();
/* look for PS font name */
for (i = 0; i < name_record_num; i++) {
if (name_tab[i].platform_id == 1 &&
@@ -369,12 +372,15 @@ static void ttf_read_name (void)
if (!fd_cur->font_dim[FONTNAME_CODE].set) {
for (i = 0; i < name_record_num; i++) {
if (name_tab[i].platform_id == 3 &&
- (name_tab[i].encoding_id == 0 ||
- name_tab[i].encoding_id == 1) && name_tab[i].name_id == 6) {
- for (j = 0, p = fd_cur->fontname; j < name_tab[i].length;
- j += 2)
+ (name_tab[i].encoding_id == 0 || name_tab[i].encoding_id == 1)
+ && name_tab[i].name_id == 6) {
+ xfree(fd_cur->fontname);
+ assert(name_tab[i].length < sizeof(buf));
+ for (j = 0, p = buf; j < name_tab[i].length; j += 2)
*p++ = name_buf[name_tab[i].offset + j + 1];
*p = 0;
+ fd_cur->fontname =
+ xstrdup(strip_spaces_and_delims(buf, strlen(buf)));
fd_cur->font_dim[FONTNAME_CODE].set = true;
break;
}
@@ -382,28 +388,28 @@ static void ttf_read_name (void)
}
}
-static void ttf_read_mapx (void)
+static void ttf_read_mapx(void)
{
glyph_entry *glyph;
- ttf_seek_tab ("maxp", TTF_FIXED_SIZE);
- glyph_tab = xtalloc (1 + (glyphs_count = get_ushort ()), glyph_entry);
+ ttf_seek_tab("maxp", TTF_FIXED_SIZE);
+ glyph_tab = xtalloc(1 + (glyphs_count = get_ushort()), glyph_entry);
for (glyph = glyph_tab; glyph - glyph_tab < glyphs_count; glyph++) {
glyph->newindex = -1;
glyph->newoffset = 0;
glyph->name_index = 0;
glyph->name = (char *) notdef;
}
- glyph_index = xtalloc (glyphs_count, long);
+ glyph_index = xtalloc(glyphs_count, long);
glyph_index[0] = 0; /* index of ".notdef" glyph */
glyph_index[1] = 1; /* index of ".null" glyph */
}
-void ttf_read_head (void)
+void ttf_read_head(void)
{
- ttf_seek_tab ("head",
- 2 * TTF_FIXED_SIZE + 2 * TTF_ULONG_SIZE + TTF_USHORT_SIZE);
- upem = get_ushort ();
- ttf_skip (16);
+ ttf_seek_tab("head",
+ 2 * TTF_FIXED_SIZE + 2 * TTF_ULONG_SIZE + TTF_USHORT_SIZE);
+ upem = get_ushort();
+ ttf_skip(16);
fd_cur->font_dim[FONTBBOX1_CODE].val = ttf_funit(get_fword());
fd_cur->font_dim[FONTBBOX2_CODE].val = ttf_funit(get_fword());
fd_cur->font_dim[FONTBBOX3_CODE].val = ttf_funit(get_fword());
@@ -412,27 +418,27 @@ void ttf_read_head (void)
fd_cur->font_dim[FONTBBOX2_CODE].set = true;
fd_cur->font_dim[FONTBBOX3_CODE].set = true;
fd_cur->font_dim[FONTBBOX4_CODE].set = true;
- ttf_skip (2 * TTF_USHORT_SIZE + TTF_SHORT_SIZE);
- loca_format = get_short ();
+ ttf_skip(2 * TTF_USHORT_SIZE + TTF_SHORT_SIZE);
+ loca_format = get_short();
}
-void ttf_read_hhea (void)
+void ttf_read_hhea(void)
{
- ttf_seek_tab ("hhea", TTF_FIXED_SIZE);
+ ttf_seek_tab("hhea", TTF_FIXED_SIZE);
fd_cur->font_dim[ASCENT_CODE].val = ttf_funit(get_fword());
fd_cur->font_dim[DESCENT_CODE].val = ttf_funit(get_fword());
fd_cur->font_dim[ASCENT_CODE].set = true;
fd_cur->font_dim[DESCENT_CODE].set = true;
- ttf_skip (TTF_FWORD_SIZE + TTF_UFWORD_SIZE + 3 * TTF_FWORD_SIZE +
- 8 * TTF_SHORT_SIZE);
- nhmtxs = get_ushort ();
+ ttf_skip(TTF_FWORD_SIZE + TTF_UFWORD_SIZE + 3 * TTF_FWORD_SIZE +
+ 8 * TTF_SHORT_SIZE);
+ nhmtxs = get_ushort();
}
-void ttf_read_pclt (void)
+void ttf_read_pclt(void)
{
- if (ttf_name_lookup ("PCLT", false) == NULL)
+ if (ttf_name_lookup("PCLT", false) == NULL)
return;
- ttf_seek_tab ("PCLT", TTF_FIXED_SIZE + TTF_ULONG_SIZE + TTF_USHORT_SIZE);
+ ttf_seek_tab("PCLT", TTF_FIXED_SIZE + TTF_ULONG_SIZE + TTF_USHORT_SIZE);
fd_cur->font_dim[XHEIGHT_CODE].val = ttf_funit(get_ushort());
ttf_skip(2 * TTF_USHORT_SIZE);
fd_cur->font_dim[CAPHEIGHT_CODE].val = ttf_funit(get_ushort());
@@ -440,25 +446,25 @@ void ttf_read_pclt (void)
fd_cur->font_dim[CAPHEIGHT_CODE].set = true;
}
-static void ttf_read_hmtx (void)
+static void ttf_read_hmtx(void)
{
glyph_entry *glyph;
TTF_UFWORD last_advWidth;
- ttf_seek_tab ("hmtx", 0);
+ ttf_seek_tab("hmtx", 0);
for (glyph = glyph_tab; glyph - glyph_tab < nhmtxs; glyph++) {
- glyph->advWidth = get_ufword ();
- glyph->lsb = get_ufword ();
+ glyph->advWidth = get_ufword();
+ glyph->lsb = get_ufword();
}
if (nhmtxs < glyphs_count) {
last_advWidth = glyph[-1].advWidth;
for (; glyph - glyph_tab < glyphs_count; glyph++) {
glyph->advWidth = last_advWidth;
- glyph->lsb = get_ufword ();
+ glyph->lsb = get_ufword();
}
}
}
-void ttf_read_post (void)
+void ttf_read_post(void)
{
int k, nnames;
long length;
@@ -467,9 +473,9 @@ void ttf_read_post (void)
TTF_FIXED italic_angle;
char *p;
glyph_entry *glyph;
- const dirtab_entry *tab = ttf_seek_tab ("post", 0);
- post_format = get_fixed ();
- italic_angle = get_fixed ();
+ const dirtab_entry *tab = ttf_seek_tab("post", 0);
+ post_format = get_fixed();
+ italic_angle = get_fixed();
int_part = italic_angle >> 16;
if (int_part > 0x7FFF) { /* a negative number */
int_part = 0x10000 - int_part;
@@ -481,7 +487,7 @@ void ttf_read_post (void)
fd_cur->font_dim[ITALIC_ANGLE_CODE].set = true;
if (glyph_tab == NULL)
return; /* being called from writeotf() */
- ttf_skip (2 * TTF_FWORD_SIZE + 5 * TTF_ULONG_SIZE);
+ ttf_skip(2 * TTF_FWORD_SIZE + 5 * TTF_ULONG_SIZE);
switch (post_format) {
case 0x10000:
for (glyph = glyph_tab; glyph - glyph_tab < NMACGLYPHS; glyph++) {
@@ -490,15 +496,15 @@ void ttf_read_post (void)
}
break;
case 0x20000:
- nnames = get_ushort (); /* some fonts have this value different from nglyphs */
+ nnames = get_ushort(); /* some fonts have this value different from nglyphs */
for (glyph = glyph_tab; glyph - glyph_tab < nnames; glyph++)
- glyph->name_index = get_ushort ();
- /*length = tab->length - (xftell (INFILE, cur_file_name) - tab->offset);*/
+ glyph->name_index = get_ushort();
+ /*length = tab->length - (xftell (INFILE, cur_file_name) - tab->offset); */
length = tab->length - (ttf_curbyte - tab->offset);
- glyph_name_buf = xtalloc (length, char);
+ glyph_name_buf = xtalloc(length, char);
for (p = glyph_name_buf; p - glyph_name_buf < length;) {
- for (k = get_byte (); k > 0; k--)
- *p++ = get_char ();
+ for (k = get_byte(); k > 0; k--)
+ *p++ = get_char();
*p++ = 0;
}
for (glyph = glyph_tab; glyph - glyph_tab < nnames; glyph++) {
@@ -508,7 +514,7 @@ void ttf_read_post (void)
p = glyph_name_buf;
k = glyph->name_index - NMACGLYPHS;
for (; k > 0; k--)
- p = strend (p) + 1;
+ p = strend(p) + 1;
glyph->name = p;
}
}
@@ -519,41 +525,41 @@ void ttf_read_post (void)
}
break;
default:
- pdftex_fail ("unsupported format (%.8X) of `post' table",
- (unsigned int) post_format);
+ pdftex_fail("unsupported format (%.8X) of `post' table",
+ (unsigned int) post_format);
}
}
-static void ttf_read_loca (void)
+static void ttf_read_loca(void)
{
glyph_entry *glyph;
- ttf_seek_tab ("loca", 0);
+ ttf_seek_tab("loca", 0);
if (loca_format != 0)
for (glyph = glyph_tab; glyph - glyph_tab < glyphs_count + 1; glyph++)
- glyph->offset = get_ulong ();
+ glyph->offset = get_ulong();
else
for (glyph = glyph_tab; glyph - glyph_tab < glyphs_count + 1; glyph++)
- glyph->offset = get_ushort () << 1;
+ glyph->offset = get_ushort() << 1;
}
-void ttf_read_tabdir (void)
+void ttf_read_tabdir(void)
{
int i;
dirtab_entry *tab;
- ttf_skip (TTF_FIXED_SIZE); /* ignore the sfnt number */
- dir_tab = xtalloc (ntabs = get_ushort (), dirtab_entry);
- ttf_skip (3 * TTF_USHORT_SIZE);
+ ttf_skip(TTF_FIXED_SIZE); /* ignore the sfnt number */
+ dir_tab = xtalloc(ntabs = get_ushort(), dirtab_entry);
+ ttf_skip(3 * TTF_USHORT_SIZE);
for (tab = dir_tab; tab - dir_tab < ntabs; tab++) {
for (i = 0; i < 4; i++)
- tab->tag[i] = get_char ();
- tab->checksum = get_ulong ();
- tab->offset = get_ulong ();
- tab->length = get_ulong ();
+ tab->tag[i] = get_char();
+ tab->checksum = get_ulong();
+ tab->offset = get_ulong();
+ tab->length = get_ulong();
}
}
-static ttf_cmap_entry *ttf_read_cmap (char *ttf_name, int pid, int eid,
- boolean warn)
+static ttf_cmap_entry *ttf_read_cmap(char *ttf_name, int pid, int eid,
+ boolean warn)
{
seg_entry *seg_tab, *s;
TTF_USHORT *glyphId, format, segCount;
@@ -568,71 +574,71 @@ static ttf_cmap_entry *ttf_read_cmap (char *ttf_name, int pid, int eid,
tmp_e.pid = pid;
tmp_e.eid = eid;
if (ttf_cmap_tree == NULL) {
- ttf_cmap_tree = avl_create (comp_ttf_cmap_entry, NULL, &avl_xallocator);
- assert (ttf_cmap_tree != NULL);
+ ttf_cmap_tree = avl_create(comp_ttf_cmap_entry, NULL, &avl_xallocator);
+ assert(ttf_cmap_tree != NULL);
}
- p = (ttf_cmap_entry *) avl_find (ttf_cmap_tree, &tmp_e);
+ p = (ttf_cmap_entry *) avl_find(ttf_cmap_tree, &tmp_e);
if (p != NULL)
return p;
/* not found, have to read it */
- ttf_seek_tab ("cmap", TTF_USHORT_SIZE); /* skip the table vesrion number (=0) */
- ncmapsubtabs = get_ushort ();
- /* cmap_offset = xftell (INFILE, cur_file_name) - 2 * TTF_USHORT_SIZE;*/
- cmap_offset = ttf_curbyte - 2 * TTF_USHORT_SIZE;
- cmap_tab = xtalloc (ncmapsubtabs, cmap_entry);
+ ttf_seek_tab("cmap", TTF_USHORT_SIZE); /* skip the table vesrion number (=0) */
+ ncmapsubtabs = get_ushort();
+ /* cmap_offset = xftell (INFILE, cur_file_name) - 2 * TTF_USHORT_SIZE; */
+ cmap_offset = ttf_curbyte - 2 * TTF_USHORT_SIZE;
+ cmap_tab = xtalloc(ncmapsubtabs, cmap_entry);
for (i = 0; i < ncmapsubtabs; ++i) {
- tmp_pid = get_ushort ();
- tmp_eid = get_ushort ();
- tmp_offset = get_ulong ();
+ tmp_pid = get_ushort();
+ tmp_eid = get_ushort();
+ tmp_offset = get_ulong();
if (tmp_pid == pid && tmp_eid == eid) {
- ttf_seek_off (cmap_offset + tmp_offset);
- format = get_ushort ();
+ ttf_seek_off(cmap_offset + tmp_offset);
+ format = get_ushort();
if (format == 4)
goto read_cmap_format_4;
else {
if (warn)
- pdftex_warn ("cmap format %i unsupported", format);
+ pdftex_warn("cmap format %i unsupported", format);
return NULL;
}
}
}
if (warn)
- pdftex_warn ("cannot find cmap subtable for (pid,eid) = (%i, %i)",
- pid, eid);
+ pdftex_warn("cannot find cmap subtable for (pid,eid) = (%i, %i)",
+ pid, eid);
return NULL;
read_cmap_format_4:
/* initialize the new entry */
- p = new_ttf_cmap_entry ();
- p->ttf_name = xstrdup (ttf_name);
+ p = new_ttf_cmap_entry();
+ p->ttf_name = xstrdup(ttf_name);
p->pid = pid;
p->eid = eid;
- p->table = xtalloc (0x10000, short);
+ p->table = xtalloc(0x10000, long);
for (i = 0; i < 0x10000; ++i)
p->table[i] = -1; /* unassigned yet */
/* read the subtable */
- length = get_ushort (); /* length of subtable */
- (void) get_ushort (); /* skip the version number */
- segCount = get_ushort () / 2;
- (void) get_ushort (); /* skip searchRange */
- (void) get_ushort (); /* skip entrySelector */
- (void) get_ushort (); /* skip rangeShift */
- seg_tab = xtalloc (segCount, seg_entry);
+ length = get_ushort(); /* length of subtable */
+ (void) get_ushort(); /* skip the version number */
+ segCount = get_ushort() / 2;
+ (void) get_ushort(); /* skip searchRange */
+ (void) get_ushort(); /* skip entrySelector */
+ (void) get_ushort(); /* skip rangeShift */
+ seg_tab = xtalloc(segCount, seg_entry);
for (s = seg_tab; s - seg_tab < segCount; s++)
- s->endCode = get_ushort ();
- (void) get_ushort (); /* skip reversedPad */
+ s->endCode = get_ushort();
+ (void) get_ushort(); /* skip reversedPad */
for (s = seg_tab; s - seg_tab < segCount; s++)
- s->startCode = get_ushort ();
+ s->startCode = get_ushort();
for (s = seg_tab; s - seg_tab < segCount; s++)
- s->idDelta = get_ushort ();
+ s->idDelta = get_ushort();
for (s = seg_tab; s - seg_tab < segCount; s++)
- s->idRangeOffset = get_ushort ();
+ s->idRangeOffset = get_ushort();
length -= 8 * TTF_USHORT_SIZE + 4 * segCount * TTF_USHORT_SIZE;
n = length / TTF_USHORT_SIZE; /* number of glyphID's */
- glyphId = xtalloc (n, TTF_USHORT);
+ glyphId = xtalloc(n, TTF_USHORT);
for (i = 0; i < n; i++)
- glyphId[i] = get_ushort ();
+ glyphId[i] = get_ushort();
for (s = seg_tab; s - seg_tab < segCount; s++) {
for (i = s->startCode; i <= s->endCode; i++) {
if (i == 0xFFFF)
@@ -643,144 +649,144 @@ static ttf_cmap_entry *ttf_read_cmap (char *ttf_name, int pid, int eid,
else {
k = (i - s->startCode) + s->idRangeOffset / 2 +
(s - seg_tab) - segCount;
- assert (k >= 0 && k < n);
+ assert(k >= 0 && k < n);
index = glyphId[k];
if (index != 0)
index = (index + s->idDelta) & 0xFFFF;
}
if (index >= glyphs_count)
- pdftex_fail ("cmap: glyph index %li out of range [0..%i)",
- index, glyphs_count);
+ pdftex_fail("cmap: glyph index %li out of range [0..%i)",
+ index, glyphs_count);
if (p->table[i] != -1)
pdftex_warn
("cmap: multiple glyphs are mapped to unicode %.4lX, "
- "only %i will be used (glyph %li being ignored)", i,
+ "only %li will be used (glyph %li being ignored)", i,
p->table[i], index);
else
p->table[i] = index;
}
}
}
- xfree (seg_tab);
- xfree (glyphId);
- aa = avl_probe (ttf_cmap_tree, p);
- assert (aa != NULL);
+ xfree(seg_tab);
+ xfree(glyphId);
+ aa = avl_probe(ttf_cmap_tree, p);
+ assert(aa != NULL);
return p;
}
-static void ttf_read_font (void)
+static void ttf_read_font(void)
{
- ttf_read_tabdir ();
- if (ttf_name_lookup ("PCLT", false) == NULL)
+ ttf_read_tabdir();
+ if (ttf_name_lookup("PCLT", false) == NULL)
new_ntabs--;
- if (ttf_name_lookup ("fpgm", false) == NULL)
+ if (ttf_name_lookup("fpgm", false) == NULL)
new_ntabs--;
- if (ttf_name_lookup ("cvt ", false) == NULL)
+ if (ttf_name_lookup("cvt ", false) == NULL)
new_ntabs--;
- if (ttf_name_lookup ("prep", false) == NULL)
+ if (ttf_name_lookup("prep", false) == NULL)
new_ntabs--;
- ttf_read_mapx ();
- ttf_read_head ();
- ttf_read_hhea ();
- ttf_read_pclt ();
- ttf_read_hmtx ();
- ttf_read_post ();
- ttf_read_loca ();
- ttf_read_name ();
+ ttf_read_mapx();
+ ttf_read_head();
+ ttf_read_hhea();
+ ttf_read_pclt();
+ ttf_read_hmtx();
+ ttf_read_post();
+ ttf_read_loca();
+ ttf_read_name();
}
-static void ttf_reset_chksm (dirtab_entry * tab)
+static void ttf_reset_chksm(dirtab_entry * tab)
{
checksum = 0;
tab_length = 0;
tmp_ulong = 0;
- tab->offset = ttf_offset ();
+ tab->offset = ttf_offset();
if (tab->offset % 4 != 0)
- pdftex_warn ("offset of `%4.4s' is not a multiple of 4", tab->tag);
+ pdftex_warn("offset of `%4.4s' is not a multiple of 4", tab->tag);
}
-static void ttf_set_chksm (dirtab_entry * tab)
+static void ttf_set_chksm(dirtab_entry * tab)
{
- tab->length = ttf_offset () - tab->offset;
- tab->checksum = ttf_getchksm ();
+ tab->length = ttf_offset() - tab->offset;
+ tab->checksum = ttf_getchksm();
}
-static void ttf_copytab (const char *name)
+static void ttf_copytab(const char *name)
{
long i;
- dirtab_entry *tab = ttf_seek_tab (name, 0);
- ttf_reset_chksm (tab);
+ dirtab_entry *tab = ttf_seek_tab(name, 0);
+ ttf_reset_chksm(tab);
for (i = tab->length; i > 0; i--)
- copy_char ();
- ttf_set_chksm (tab);
+ copy_char();
+ ttf_set_chksm(tab);
}
#define BYTE_ENCODING_LENGTH \
((256)*TTF_BYTE_SIZE + 3*TTF_USHORT_SIZE)
-static void ttf_byte_encoding (void)
+static void ttf_byte_encoding(void)
{
ttfenc_entry *e;
- (void) put_ushort (0); /* format number (0: byte encoding table) */
- (void) put_ushort (BYTE_ENCODING_LENGTH); /* length of table */
- (void) put_ushort (0); /* version number */
+ (void) put_ushort(0); /* format number (0: byte encoding table) */
+ (void) put_ushort(BYTE_ENCODING_LENGTH); /* length of table */
+ (void) put_ushort(0); /* version number */
for (e = ttfenc_tab; e - ttfenc_tab < 256; e++)
if (e->newindex < 256) {
- put_byte (e->newindex);
+ put_byte(e->newindex);
} else {
if (e->name != notdef)
pdftex_warn
("glyph `%s' has been mapped to `%s' in `ttf_byte_encoding' cmap table",
e->name, notdef);
- put_byte (0); /* notdef */
+ put_byte(0); /* notdef */
}
}
#define TRIMMED_TABLE_MAP_LENGTH (TTF_USHORT_SIZE*(5 + (256)))
-static void ttf_trimmed_table_map (void)
+static void ttf_trimmed_table_map(void)
{
ttfenc_entry *e;
- (void) put_ushort (6); /* format number (6): trimmed table mapping */
- (void) put_ushort (TRIMMED_TABLE_MAP_LENGTH);
- (void) put_ushort (0); /* version number (0) */
- (void) put_ushort (0); /* first character code */
- (void) put_ushort (256); /* number of character code in table */
+ (void) put_ushort(6); /* format number (6): trimmed table mapping */
+ (void) put_ushort(TRIMMED_TABLE_MAP_LENGTH);
+ (void) put_ushort(0); /* version number (0) */
+ (void) put_ushort(0); /* first character code */
+ (void) put_ushort(256); /* number of character code in table */
for (e = ttfenc_tab; e - ttfenc_tab < 256; e++)
- (void) put_ushort (e->newindex);
+ (void) put_ushort(e->newindex);
}
#define SEG_MAP_DELTA_LENGTH ((16 + (256))*TTF_USHORT_SIZE)
-static void ttf_seg_map_delta (void)
+static void ttf_seg_map_delta(void)
{
ttfenc_entry *e;
- (void) put_ushort (4); /* format number (4: segment mapping to delta values) */
- (void) put_ushort (SEG_MAP_DELTA_LENGTH);
- (void) put_ushort (0); /* version number */
- (void) put_ushort (4); /* 2*segCount */
- (void) put_ushort (4); /* searchRange */
- (void) put_ushort (1); /* entrySelector */
- (void) put_ushort (0); /* rangeShift */
- (void) put_ushort (0xF0FF); /* endCount[0] */
- (void) put_ushort (0xFFFF); /* endCount[1] */
- (void) put_ushort (0); /* reversedPad */
- (void) put_ushort (0xF000); /* startCount[0] */
- (void) put_ushort (0xFFFF); /* startCount[1] */
- (void) put_ushort (0); /* idDelta[0] */
- (void) put_ushort (1); /* idDelta[1] */
- (void) put_ushort (2 * TTF_USHORT_SIZE); /* idRangeOffset[0] */
- (void) put_ushort (0); /* idRangeOffset[1] */
+ (void) put_ushort(4); /* format number (4: segment mapping to delta values) */
+ (void) put_ushort(SEG_MAP_DELTA_LENGTH);
+ (void) put_ushort(0); /* version number */
+ (void) put_ushort(4); /* 2*segCount */
+ (void) put_ushort(4); /* searchRange */
+ (void) put_ushort(1); /* entrySelector */
+ (void) put_ushort(0); /* rangeShift */
+ (void) put_ushort(0xF0FF); /* endCount[0] */
+ (void) put_ushort(0xFFFF); /* endCount[1] */
+ (void) put_ushort(0); /* reversedPad */
+ (void) put_ushort(0xF000); /* startCount[0] */
+ (void) put_ushort(0xFFFF); /* startCount[1] */
+ (void) put_ushort(0); /* idDelta[0] */
+ (void) put_ushort(1); /* idDelta[1] */
+ (void) put_ushort(2 * TTF_USHORT_SIZE); /* idRangeOffset[0] */
+ (void) put_ushort(0); /* idRangeOffset[1] */
for (e = ttfenc_tab; e - ttfenc_tab < 256; e++)
- (void) put_ushort (e->newindex);
+ (void) put_ushort(e->newindex);
}
#define CMAP_ENTRY_LENGTH (2*TTF_USHORT_SIZE + TTF_ULONG_SIZE)
-static void ttf_select_cmap (void)
+static void ttf_select_cmap(void)
{
- assert (sizeof (new_cmap_tab) <= NEW_CMAP_SIZE * sizeof (cmap_entry));
+ assert(sizeof(new_cmap_tab) <= NEW_CMAP_SIZE * sizeof(cmap_entry));
new_cmap_tab[0].platform_id = 1; /* Macintosh */
new_cmap_tab[0].encoding_id = 0; /* Symbol; ignore code page */
new_cmap_tab[0].format = new_glyphs_count < 256 ? 0 /* byte encoding */
@@ -790,15 +796,15 @@ static void ttf_select_cmap (void)
new_cmap_tab[1].format = 4; /* segment mapping to delta */
}
-static void ttf_write_cmap (void)
+static void ttf_write_cmap(void)
{
cmap_entry *ce;
long offset;
- dirtab_entry *tab = ttf_name_lookup ("cmap", true);
- ttf_select_cmap ();
- ttf_reset_chksm (tab);
- (void) put_ushort (0); /* table version number (0) */
- (void) put_ushort (NEW_CMAP_SIZE); /* number of encoding tables */
+ dirtab_entry *tab = ttf_name_lookup("cmap", true);
+ ttf_select_cmap();
+ ttf_reset_chksm(tab);
+ (void) put_ushort(0); /* table version number (0) */
+ (void) put_ushort(NEW_CMAP_SIZE); /* number of encoding tables */
offset = 2 * TTF_USHORT_SIZE + NEW_CMAP_SIZE * CMAP_ENTRY_LENGTH;
for (ce = new_cmap_tab; ce - new_cmap_tab < NEW_CMAP_SIZE; ce++) {
ce->offset = offset;
@@ -813,33 +819,34 @@ static void ttf_write_cmap (void)
offset += TRIMMED_TABLE_MAP_LENGTH;
break;
default:
- pdftex_fail ("invalid format (it should not have happened)");
+ pdftex_fail("invalid format (it should not have happened)");
}
- (void) put_ushort (ce->platform_id);
- (void) put_ushort (ce->encoding_id);
- put_ulong (ce->offset);
+ (void) put_ushort(ce->platform_id);
+ (void) put_ushort(ce->encoding_id);
+ put_ulong(ce->offset);
}
for (ce = new_cmap_tab; ce - new_cmap_tab < NEW_CMAP_SIZE; ce++) {
switch (ce->format) {
case 0:
- ttf_byte_encoding ();
+ ttf_byte_encoding();
break;
case 4:
- ttf_seg_map_delta ();
+ ttf_seg_map_delta();
break;
case 6:
- ttf_trimmed_table_map ();
+ ttf_trimmed_table_map();
break;
}
}
- ttf_set_chksm (tab);
+ ttf_set_chksm(tab);
}
-static int prepend_subset_tags (int index, char *p)
+static int prepend_subset_tags(int index, char *p)
{
- const boolean is_unicode = (name_tab[index].platform_id == 3);
+ boolean is_unicode;
int i;
- assert (index > 0 && index < name_record_num && fd_cur->subset_tag != NULL);
+ assert(index >= 0 && index < name_record_num && fd_cur->subset_tag != NULL);
+ is_unicode = (name_tab[index].platform_id == 3);
if (is_unicode) {
for (i = 0; i < 6; ++i) {
*p++ = 0;
@@ -849,7 +856,7 @@ static int prepend_subset_tags (int index, char *p)
*p++ = '+';
return 14;
} else {
- strncpy (p, fd_cur->subset_tag, 6);
+ strncpy(p, fd_cur->subset_tag, 6);
p += 6;
*p++ = '+';
return 7;
@@ -857,19 +864,19 @@ static int prepend_subset_tags (int index, char *p)
}
-static void ttf_write_name (void)
+static void ttf_write_name(void)
{
int i, l;
char *p;
int new_name_buf_size;
char *new_name_buf;
name_record *n;
- dirtab_entry *tab = ttf_name_lookup ("name", true);
- if (is_subsetted (fd_cur->fm)) {
+ dirtab_entry *tab = ttf_name_lookup("name", true);
+ if (is_subsetted(fd_cur->fm)) {
l = 0;
for (i = 0; i < name_record_num; i++)
l += name_tab[i].length + 14; /* maximum lengh of new stogare area */
- new_name_buf = xtalloc (l, char);
+ new_name_buf = xtalloc(l, char);
/* additional space for subset tags */
p = new_name_buf;
for (i = 0; i < name_record_num; i++) {
@@ -880,11 +887,11 @@ static void ttf_write_name (void)
((n->platform_id == 1 && n->encoding_id == 0) ||
(n->platform_id == 3 && n->encoding_id == 0) ||
(n->platform_id == 3 && n->encoding_id == 1))) {
- l = prepend_subset_tags (i, p);
+ l = prepend_subset_tags(i, p);
p += l;
} else
l = 0;
- memcpy (p, name_buf + n->offset, n->length);
+ memcpy(p, name_buf + n->offset, n->length);
p += n->length;
n->new_length = n->length + l;
}
@@ -893,51 +900,51 @@ static void ttf_write_name (void)
new_name_buf = name_buf;
new_name_buf_size = name_buf_size;
}
- ttf_reset_chksm (tab);
- (void) put_ushort (0); /* Format selector */
- (void) put_ushort (name_record_num);
- (void) put_ushort (3 * TTF_USHORT_SIZE +
- name_record_num * 6 * TTF_USHORT_SIZE);
+ ttf_reset_chksm(tab);
+ (void) put_ushort(0); /* Format selector */
+ (void) put_ushort(name_record_num);
+ (void) put_ushort(3 * TTF_USHORT_SIZE +
+ name_record_num * 6 * TTF_USHORT_SIZE);
for (i = 0; i < name_record_num; i++) {
- (void) put_ushort (name_tab[i].platform_id);
- (void) put_ushort (name_tab[i].encoding_id);
- (void) put_ushort (name_tab[i].language_id);
- (void) put_ushort (name_tab[i].name_id);
- (void) put_ushort (name_tab[i].new_length);
- (void) put_ushort (name_tab[i].new_offset);
+ (void) put_ushort(name_tab[i].platform_id);
+ (void) put_ushort(name_tab[i].encoding_id);
+ (void) put_ushort(name_tab[i].language_id);
+ (void) put_ushort(name_tab[i].name_id);
+ (void) put_ushort(name_tab[i].new_length);
+ (void) put_ushort(name_tab[i].new_offset);
}
for (p = new_name_buf; p - new_name_buf < new_name_buf_size; p++)
- put_char (*p);
- ttf_set_chksm (tab);
+ put_char(*p);
+ ttf_set_chksm(tab);
if (new_name_buf != name_buf)
- xfree (new_name_buf);
+ xfree(new_name_buf);
}
-static void ttf_write_dirtab (void)
+static void ttf_write_dirtab(void)
{
dirtab_entry *tab;
TTF_ULONG i, k;
char *p;
- const integer save_offset = ttf_offset ();
- ttf_seek_outbuf (TABDIR_OFF);
- if (is_subsetted (fd_cur->fm)) {
+ const integer save_offset = ttf_offset();
+ ttf_seek_outbuf(TABDIR_OFF);
+ if (is_subsetted(fd_cur->fm)) {
for (i = 0; i < DEFAULT_NTABS; i++) {
- tab = ttf_name_lookup (newtabnames[i], false);
+ tab = ttf_name_lookup(newtabnames[i], false);
if (tab == NULL)
continue;
for (k = 0; k < 4; k++)
- put_char (tab->tag[k]);
- put_ulong (tab->checksum);
- put_ulong (tab->offset);
- put_ulong (tab->length);
+ put_char(tab->tag[k]);
+ put_ulong(tab->checksum);
+ put_ulong(tab->offset);
+ put_ulong(tab->length);
}
} else {
for (tab = dir_tab; tab - dir_tab < ntabs; tab++) {
for (k = 0; k < 4; k++)
- put_char (tab->tag[k]);
- put_ulong (tab->checksum);
- put_ulong (tab->offset);
- put_ulong (tab->length);
+ put_char(tab->tag[k]);
+ put_ulong(tab->checksum);
+ put_ulong(tab->offset);
+ put_ulong(tab->length);
}
}
/* adjust checkSumAdjustment */
@@ -952,34 +959,34 @@ static void ttf_write_dirtab (void)
}
}
if (i % 4 != 0) {
- pdftex_warn ("font length is not a multiple of 4 (%li)", i);
+ pdftex_warn("font length is not a multiple of 4 (%li)", i);
checksum <<= 8 * (4 - i % 4);
}
k = 0xB1B0AFBA - checksum;
- ttf_seek_outbuf (checkSumAdjustment_offset);
- put_ulong (k);
- ttf_seek_outbuf (save_offset);
+ ttf_seek_outbuf(checkSumAdjustment_offset);
+ put_ulong(k);
+ ttf_seek_outbuf(save_offset);
}
-static void ttf_write_glyf (void)
+static void ttf_write_glyf(void)
{
long *id, k;
TTF_USHORT idx;
TTF_USHORT flags;
- dirtab_entry *tab = ttf_name_lookup ("glyf", true);
+ dirtab_entry *tab = ttf_name_lookup("glyf", true);
const long glyf_offset = tab->offset;
- const long new_glyf_offset = ttf_offset ();
- ttf_reset_chksm (tab);
+ const long new_glyf_offset = ttf_offset();
+ ttf_reset_chksm(tab);
for (id = glyph_index; id - glyph_index < new_glyphs_count; id++) {
- glyph_tab[*id].newoffset = ttf_offset () - new_glyf_offset;
+ glyph_tab[*id].newoffset = ttf_offset() - new_glyf_offset;
if (glyph_tab[*id].offset != glyph_tab[*id + 1].offset) {
- ttf_seek_off (glyf_offset + glyph_tab[*id].offset);
- k = copy_short ();
- ttf_ncopy (4 * TTF_FWORD_SIZE);
+ ttf_seek_off(glyf_offset + glyph_tab[*id].offset);
+ k = copy_short();
+ ttf_ncopy(4 * TTF_FWORD_SIZE);
if (k < 0) {
do {
- flags = copy_ushort ();
- idx = get_ushort ();
+ flags = copy_ushort();
+ idx = get_ushort();
if (glyph_tab[idx].newindex < 0) {
glyph_tab[idx].newindex = new_glyphs_count;
glyph_index[new_glyphs_count++] = idx;
@@ -988,27 +995,27 @@ static void ttf_write_glyf (void)
which appears in the condition of the `for' loop
*/
}
- (void) put_ushort (glyph_tab[idx].newindex);
+ (void) put_ushort(glyph_tab[idx].newindex);
if (flags & ARG_1_AND_2_ARE_WORDS)
- ttf_ncopy (2 * TTF_SHORT_SIZE);
+ ttf_ncopy(2 * TTF_SHORT_SIZE);
else
- ttf_ncopy (TTF_USHORT_SIZE);
+ ttf_ncopy(TTF_USHORT_SIZE);
if (flags & WE_HAVE_A_SCALE)
- ttf_ncopy (TTF_F2DOT14_SIZE);
+ ttf_ncopy(TTF_F2DOT14_SIZE);
else if (flags & WE_HAVE_AN_X_AND_Y_SCALE)
- ttf_ncopy (2 * TTF_F2DOT14_SIZE);
+ ttf_ncopy(2 * TTF_F2DOT14_SIZE);
else if (flags & WE_HAVE_A_TWO_BY_TWO)
- ttf_ncopy (4 * TTF_F2DOT14_SIZE);
+ ttf_ncopy(4 * TTF_F2DOT14_SIZE);
} while (flags & MORE_COMPONENTS);
if (flags & WE_HAVE_INSTRUCTIONS)
- ttf_ncopy (copy_ushort ());
+ ttf_ncopy(copy_ushort());
} else
- ttf_ncopy (glyph_tab[*id + 1].offset - glyph_tab[*id].offset -
- TTF_USHORT_SIZE - 4 * TTF_FWORD_SIZE);
+ ttf_ncopy(glyph_tab[*id + 1].offset - glyph_tab[*id].offset -
+ TTF_USHORT_SIZE - 4 * TTF_FWORD_SIZE);
}
}
- last_glyf_offset = ttf_offset () - new_glyf_offset;
- ttf_set_chksm (tab);
+ last_glyf_offset = ttf_offset() - new_glyf_offset;
+ ttf_set_chksm(tab);
}
static void ttf_reindex_glyphs(void)
@@ -1016,7 +1023,7 @@ static void ttf_reindex_glyphs(void)
ttfenc_entry *e;
glyph_entry *glyph;
int index;
- short *t;
+ long *t;
ttf_cmap_entry *cmap = NULL;
boolean cmap_not_found = false;
@@ -1089,7 +1096,7 @@ static void ttf_reindex_glyphs(void)
if (t[index] != -1) {
if (t[index] >= glyphs_count) {
pdftex_warn
- ("`%s' is mapped to index %i which is out of valid range [0..%i)",
+ ("`%s' is mapped to index %li which is out of valid range [0..%i)",
e->name, t[index], glyphs_count);
continue;
}
@@ -1112,7 +1119,7 @@ static void ttf_reindex_glyphs(void)
append_new_glyph:
assert(glyph > glyph_tab && glyph - glyph_tab < glyphs_count);
if (glyph->newindex < 0) {
- glyph_index[new_glyphs_count] = (short) (glyph - glyph_tab);
+ glyph_index[new_glyphs_count] = (short) (glyph - glyph_tab);
glyph->newindex = new_glyphs_count;
new_glyphs_count++;
}
@@ -1120,53 +1127,53 @@ static void ttf_reindex_glyphs(void)
}
}
-static void ttf_write_head ()
+static void ttf_write_head()
{
dirtab_entry *tab;
- tab = ttf_seek_tab ("head", 0);
- ttf_reset_chksm (tab);
- ttf_ncopy (2 * TTF_FIXED_SIZE);
- checkSumAdjustment_offset = ttf_offset ();
- put_ulong (0);
- ttf_skip (TTF_ULONG_SIZE); /* skip checkSumAdjustment */
- ttf_ncopy (TTF_ULONG_SIZE + 2 * TTF_USHORT_SIZE + 16 +
- 4 * TTF_FWORD_SIZE + 2 * TTF_USHORT_SIZE + TTF_SHORT_SIZE);
+ tab = ttf_seek_tab("head", 0);
+ ttf_reset_chksm(tab);
+ ttf_ncopy(2 * TTF_FIXED_SIZE);
+ checkSumAdjustment_offset = ttf_offset();
+ put_ulong(0);
+ ttf_skip(TTF_ULONG_SIZE); /* skip checkSumAdjustment */
+ ttf_ncopy(TTF_ULONG_SIZE + 2 * TTF_USHORT_SIZE + 16 +
+ 4 * TTF_FWORD_SIZE + 2 * TTF_USHORT_SIZE + TTF_SHORT_SIZE);
if (is_subsetted(fd_cur->fm)) {
- (void) put_short (loca_format);
- (void) put_short (0);
+ (void) put_short(loca_format);
+ (void) put_short(0);
} else
- ttf_ncopy (2 * TTF_SHORT_SIZE);
- ttf_set_chksm (tab);
+ ttf_ncopy(2 * TTF_SHORT_SIZE);
+ ttf_set_chksm(tab);
}
-static void ttf_write_hhea (void)
+static void ttf_write_hhea(void)
{
dirtab_entry *tab;
- tab = ttf_seek_tab ("hhea", 0);
- ttf_reset_chksm (tab);
- ttf_ncopy (TTF_FIXED_SIZE + 3 * TTF_FWORD_SIZE + TTF_UFWORD_SIZE +
- 3 * TTF_FWORD_SIZE + 8 * TTF_SHORT_SIZE);
- (void) put_ushort (new_glyphs_count);
- ttf_set_chksm (tab);
+ tab = ttf_seek_tab("hhea", 0);
+ ttf_reset_chksm(tab);
+ ttf_ncopy(TTF_FIXED_SIZE + 3 * TTF_FWORD_SIZE + TTF_UFWORD_SIZE +
+ 3 * TTF_FWORD_SIZE + 8 * TTF_SHORT_SIZE);
+ (void) put_ushort(new_glyphs_count);
+ ttf_set_chksm(tab);
}
-static void ttf_write_htmx (void)
+static void ttf_write_htmx(void)
{
long *id;
- dirtab_entry *tab = ttf_seek_tab ("hmtx", 0);
- ttf_reset_chksm (tab);
+ dirtab_entry *tab = ttf_seek_tab("hmtx", 0);
+ ttf_reset_chksm(tab);
for (id = glyph_index; id - glyph_index < new_glyphs_count; id++) {
- put_ufword (glyph_tab[*id].advWidth);
- put_ufword (glyph_tab[*id].lsb);
+ put_ufword(glyph_tab[*id].advWidth);
+ put_ufword(glyph_tab[*id].lsb);
}
- ttf_set_chksm (tab);
+ ttf_set_chksm(tab);
}
-static void ttf_write_loca (void)
+static void ttf_write_loca(void)
{
long *id;
- dirtab_entry *tab = ttf_seek_tab ("loca", 0);
- ttf_reset_chksm (tab);
+ dirtab_entry *tab = ttf_seek_tab("loca", 0);
+ ttf_reset_chksm(tab);
loca_format = 0;
if (last_glyf_offset >= 0x00020000 || (last_glyf_offset & 1))
loca_format = 1;
@@ -1178,152 +1185,152 @@ static void ttf_write_loca (void)
}
if (loca_format != 0) {
for (id = glyph_index; id - glyph_index < new_glyphs_count; id++)
- put_ulong (glyph_tab[*id].newoffset);
- put_ulong (last_glyf_offset);
+ put_ulong(glyph_tab[*id].newoffset);
+ put_ulong(last_glyf_offset);
} else {
for (id = glyph_index; id - glyph_index < new_glyphs_count; id++)
- (void) put_ushort (glyph_tab[*id].newoffset / 2);
- (void) put_ushort (last_glyf_offset / 2);
+ (void) put_ushort(glyph_tab[*id].newoffset / 2);
+ (void) put_ushort(last_glyf_offset / 2);
}
- ttf_set_chksm (tab);
+ ttf_set_chksm(tab);
}
-static void ttf_write_mapx (void)
+static void ttf_write_mapx(void)
{
- dirtab_entry *tab = ttf_seek_tab ("maxp", TTF_FIXED_SIZE + TTF_USHORT_SIZE);
- ttf_reset_chksm (tab);
- put_fixed (0x00010000);
- (void) put_ushort (new_glyphs_count);
- ttf_ncopy (13 * TTF_USHORT_SIZE);
- ttf_set_chksm (tab);
+ dirtab_entry *tab = ttf_seek_tab("maxp", TTF_FIXED_SIZE + TTF_USHORT_SIZE);
+ ttf_reset_chksm(tab);
+ put_fixed(0x00010000);
+ (void) put_ushort(new_glyphs_count);
+ ttf_ncopy(13 * TTF_USHORT_SIZE);
+ ttf_set_chksm(tab);
}
-static void ttf_write_OS2 (void)
+static void ttf_write_OS2(void)
{
- dirtab_entry *tab = ttf_seek_tab ("OS/2", 0);
+ dirtab_entry *tab = ttf_seek_tab("OS/2", 0);
TTF_USHORT version;
- ttf_reset_chksm (tab);
- version = get_ushort ();
+ ttf_reset_chksm(tab);
+ version = get_ushort();
if (version > 3)
- pdftex_fail ("unknown version of OS/2 table (%.4X)", version);
- (void) put_ushort (0x0001); /* fix version to 1 */
- ttf_ncopy (2 * TTF_USHORT_SIZE + 13 * TTF_SHORT_SIZE + 10 * TTF_BYTE_SIZE);
- ttf_skip (4 * TTF_ULONG_SIZE); /* ulUnicodeRange 1--4 */
- put_ulong (0x00000003); /* Basic Latin + Latin-1 Supplement (0x0000--0x00FF) */
- put_ulong (0x10000000); /* Private Use (0xE000--0xF8FF) */
- put_ulong (0x00000000);
- put_ulong (0x00000000);
- ttf_ncopy (4 * TTF_CHAR_SIZE + TTF_USHORT_SIZE); /* achVendID + fsSelection */
- ttf_skip (2 * TTF_USHORT_SIZE);
- (void) put_ushort (0x0000); /* usFirstCharIndex */
- (void) put_ushort (0xF0FF); /* usLastCharIndex */
- ttf_ncopy (5 * TTF_USHORT_SIZE);
+ pdftex_fail("unknown version of OS/2 table (%.4X)", version);
+ (void) put_ushort(0x0001); /* fix version to 1 */
+ ttf_ncopy(2 * TTF_USHORT_SIZE + 13 * TTF_SHORT_SIZE + 10 * TTF_BYTE_SIZE);
+ ttf_skip(4 * TTF_ULONG_SIZE); /* ulUnicodeRange 1--4 */
+ put_ulong(0x00000003); /* Basic Latin + Latin-1 Supplement (0x0000--0x00FF) */
+ put_ulong(0x10000000); /* Private Use (0xE000--0xF8FF) */
+ put_ulong(0x00000000);
+ put_ulong(0x00000000);
+ ttf_ncopy(4 * TTF_CHAR_SIZE + TTF_USHORT_SIZE); /* achVendID + fsSelection */
+ ttf_skip(2 * TTF_USHORT_SIZE);
+ (void) put_ushort(0x0000); /* usFirstCharIndex */
+ (void) put_ushort(0xF0FF); /* usLastCharIndex */
+ ttf_ncopy(5 * TTF_USHORT_SIZE);
/* for version 0 the OS/2 table ends here, the rest is for version 1 */
- put_ulong (0x80000000); /* Symbol Character Set---don't use any code page */
- put_ulong (0x00000000);
- ttf_set_chksm (tab);
+ put_ulong(0x80000000); /* Symbol Character Set---don't use any code page */
+ put_ulong(0x00000000);
+ ttf_set_chksm(tab);
}
-static boolean unsafe_name (char *s)
+static boolean unsafe_name(char *s)
{
const char **p;
for (p = ambiguous_names; *p != NULL; p++)
- if (strcmp (s, *p) == 0)
+ if (strcmp(s, *p) == 0)
return true;
return false;
}
-static void ttf_write_post (void)
+static void ttf_write_post(void)
{
- dirtab_entry *tab = ttf_seek_tab ("post", TTF_FIXED_SIZE);
+ dirtab_entry *tab = ttf_seek_tab("post", TTF_FIXED_SIZE);
glyph_entry *glyph;
char *s;
long *id;
int l;
- ttf_reset_chksm (tab);
+ ttf_reset_chksm(tab);
if (!fd_cur->write_ttf_glyph_names || post_format == 0x00030000) {
- put_fixed (0x00030000);
- ttf_ncopy (TTF_FIXED_SIZE + 2 * TTF_FWORD_SIZE + 5 * TTF_ULONG_SIZE);
+ put_fixed(0x00030000);
+ ttf_ncopy(TTF_FIXED_SIZE + 2 * TTF_FWORD_SIZE + 5 * TTF_ULONG_SIZE);
} else {
- put_fixed (0x00020000);
- ttf_ncopy (TTF_FIXED_SIZE + 2 * TTF_FWORD_SIZE + 5 * TTF_ULONG_SIZE);
- (void) put_ushort (new_glyphs_count);
+ put_fixed(0x00020000);
+ ttf_ncopy(TTF_FIXED_SIZE + 2 * TTF_FWORD_SIZE + 5 * TTF_ULONG_SIZE);
+ (void) put_ushort(new_glyphs_count);
k = 0;
for (id = glyph_index; id - glyph_index < new_glyphs_count; id++) {
glyph = glyph_tab + *id;
- if (glyph->name_index >= NMACGLYPHS || unsafe_name (glyph->name))
+ if (glyph->name_index >= NMACGLYPHS || unsafe_name(glyph->name))
glyph->name_index = NMACGLYPHS + k++;
- (void) put_ushort (glyph->name_index);
+ (void) put_ushort(glyph->name_index);
}
for (id = glyph_index; id - glyph_index < new_glyphs_count; id++) {
glyph = glyph_tab + *id;
if (glyph->name_index >= NMACGLYPHS) {
s = glyph->name;
- l = strlen (s);
- put_byte (l);
+ l = strlen(s);
+ put_byte(l);
while (l-- > 0)
- put_char (*s++);
+ put_char(*s++);
}
}
}
- ttf_set_chksm (tab);
+ ttf_set_chksm(tab);
}
-static void ttf_init_font (int n)
+static void ttf_init_font(int n)
{
int i, k;
for (i = 1, k = 0; i <= n; i <<= 1, k++);
- put_fixed (0x00010000); /* font version */
- (void) put_ushort (n); /* number of tables */
- (void) put_ushort (i << 3); /* search range */
- (void) put_ushort (k - 1); /* entry selector */
- (void) put_ushort ((n << 4) - (i << 3)); /* range shift */
- ttf_seek_outbuf (TABDIR_OFF + n * 4 * TTF_ULONG_SIZE);
+ put_fixed(0x00010000); /* font version */
+ (void) put_ushort(n); /* number of tables */
+ (void) put_ushort(i << 3); /* search range */
+ (void) put_ushort(k - 1); /* entry selector */
+ (void) put_ushort((n << 4) - (i << 3)); /* range shift */
+ ttf_seek_outbuf(TABDIR_OFF + n * 4 * TTF_ULONG_SIZE);
}
-static void ttf_subset_font (void)
+static void ttf_subset_font(void)
{
- ttf_init_font (new_ntabs);
- if (ttf_name_lookup ("PCLT", false) != NULL)
- ttf_copytab ("PCLT");
- if (ttf_name_lookup ("fpgm", false) != NULL)
- ttf_copytab ("fpgm");
- if (ttf_name_lookup ("cvt ", false) != NULL)
- ttf_copytab ("cvt ");
- if (ttf_name_lookup ("prep", false) != NULL)
- ttf_copytab ("prep");
- ttf_reindex_glyphs ();
- ttf_write_glyf ();
- ttf_write_loca ();
- ttf_write_OS2 ();
- ttf_write_head ();
- ttf_write_hhea ();
- ttf_write_htmx ();
- ttf_write_mapx ();
- ttf_write_name ();
- ttf_write_post ();
- ttf_write_cmap ();
- ttf_write_dirtab ();
+ ttf_init_font(new_ntabs);
+ if (ttf_name_lookup("PCLT", false) != NULL)
+ ttf_copytab("PCLT");
+ if (ttf_name_lookup("fpgm", false) != NULL)
+ ttf_copytab("fpgm");
+ if (ttf_name_lookup("cvt ", false) != NULL)
+ ttf_copytab("cvt ");
+ if (ttf_name_lookup("prep", false) != NULL)
+ ttf_copytab("prep");
+ ttf_reindex_glyphs();
+ ttf_write_glyf();
+ ttf_write_loca();
+ ttf_write_OS2();
+ ttf_write_head();
+ ttf_write_hhea();
+ ttf_write_htmx();
+ ttf_write_mapx();
+ ttf_write_name();
+ ttf_write_post();
+ ttf_write_cmap();
+ ttf_write_dirtab();
}
-static void ttf_copy_font (void)
+static void ttf_copy_font(void)
{
dirtab_entry *tab;
- ttf_init_font (ntabs);
+ ttf_init_font(ntabs);
for (tab = dir_tab; tab - dir_tab < ntabs; tab++) {
- if (strncmp (tab->tag, "head", 4) == 0)
- ttf_write_head ();
+ if (strncmp(tab->tag, "head", 4) == 0)
+ ttf_write_head();
else
- ttf_copytab (tab->tag);
+ ttf_copytab(tab->tag);
}
- ttf_write_dirtab ();
+ ttf_write_dirtab();
}
void writettf(fd_entry * fd)
{
- int callback_id;
- int file_opened = 0;
- char *ftemp = NULL;
+ int callback_id;
+ int file_opened = 0;
+ char *ftemp = NULL;
fd_cur = fd; /* fd_cur is global inside writettf.c */
assert(fd_cur->fm != NULL);
assert(is_truetype(fd_cur->fm));
@@ -1333,47 +1340,46 @@ void writettf(fd_entry * fd)
if (is_subsetted(fd_cur->fm) && (fd_cur->fe == NULL)
&& !is_subfont(fd_cur->fm)) {
- pdftex_warn ("Subset TrueType must be a reencoded or a subfont");
- cur_file_name = NULL;
- return;
+ pdftex_fail("Subset TrueType must be a reencoded or a subfont");
+ }
+ ttf_curbyte = 0;
+ ttf_size = 0;
+ callback_id = callback_defined(find_truetype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback
+ (callback_id, "S->S", (char *) (nameoffile + 1), &ftemp)) {
+ if (ftemp != NULL && strlen(ftemp)) {
+ free(nameoffile);
+ namelength = strlen(ftemp);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), ftemp);
+ free(ftemp);
+ }
+ }
+ }
+
+ callback_id = callback_defined(read_truetype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback(callback_id, "S->bSd", (char *) (nameoffile + 1),
+ &file_opened, &ttf_buffer, &ttf_size) &&
+ file_opened && ttf_size > 0) {
+ } else {
+ pdftex_fail("cannot open TrueType font file for reading");
+ }
+ } else {
+ if (!ttf_open()) {
+ pdftex_fail("cannot open TrueType font file for reading");
+ }
+ ttf_read_file();
+ ttf_close();
}
- ttf_curbyte=0;
- ttf_size=0;
- callback_id=callback_defined(find_truetype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->S",(char *)(nameoffile+1),&ftemp)) {
- if(ftemp!=NULL&&strlen(ftemp)) {
- free(nameoffile);
- namelength = strlen(ftemp);
- nameoffile = xmalloc(namelength+2);
- strcpy((char *)(nameoffile+1),ftemp);
- free(ftemp);
- }
- }
- }
-
- callback_id=callback_defined(read_truetype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->bSd",(char *)(nameoffile+1),
- &file_opened, &ttf_buffer,&ttf_size) &&
- file_opened && ttf_size>0) {
- } else {
- pdftex_fail ("cannot open TrueType font file for reading");
- }
- } else {
- if (!ttf_open ()) {
- pdftex_fail ("cannot open TrueType font file for reading");
- }
- ttf_read_file();
- ttf_close();
- }
cur_file_name = (char *) nameoffile + 1;
- if (tracefilenames) {
- if (is_subsetted(fd_cur->fm))
- tex_printf ("<%s", cur_file_name);
- else
- tex_printf ("<<%s", cur_file_name);
- }
+ if (tracefilenames) {
+ if (is_subsetted(fd_cur->fm))
+ tex_printf("<%s", cur_file_name);
+ else
+ tex_printf("<<%s", cur_file_name);
+ }
fd_cur->ff_found = true;
new_glyphs_count = 2;
new_ntabs = DEFAULT_NTABS;
@@ -1383,107 +1389,111 @@ void writettf(fd_entry * fd)
glyph_name_buf = NULL;
name_tab = NULL;
name_buf = NULL;
- ttf_read_font ();
-
- pdf_save_offset = pdfoffset ();
- pdf_flush ();
-
- if (is_subsetted(fd_cur->fm)) {
- ttf_copy_encoding ();
- ttf_subset_font ();
- } else
- ttf_copy_font ();
- ttf_length = ttf_offset ();
-
- xfree (dir_tab);
- xfree (glyph_tab);
- xfree (glyph_index);
- xfree (glyph_name_buf);
- xfree (name_tab);
- xfree (name_buf);
- if (tracefilenames) {
- if (is_subsetted (fd_cur->fm))
- tex_printf (">");
- else
- tex_printf (">>");
- }
+ ttf_read_font();
+
+ pdf_save_offset = pdfoffset();
+ pdf_flush();
+
+ if (is_subsetted(fd_cur->fm)) {
+ ttf_copy_encoding();
+ ttf_subset_font();
+ } else
+ ttf_copy_font();
+ ttf_length = ttf_offset();
+
+ xfree(dir_tab);
+ xfree(glyph_tab);
+ xfree(glyph_index);
+ xfree(glyph_name_buf);
+ xfree(name_tab);
+ xfree(name_buf);
+ if (tracefilenames) {
+ if (is_subsetted(fd_cur->fm))
+ tex_printf(">");
+ else
+ tex_printf(">>");
+ }
+ xfree(ttf_buffer);
cur_file_name = NULL;
}
void do_writeotf(fd_entry * fd)
{
- long i;
- dirtab_entry *tab;
- dir_tab = NULL;
- glyph_tab = NULL;
- if (tracefilenames)
- tex_printf ("<<%s", cur_file_name);
- ttf_read_tabdir ();
- /* read font parameters */
- if (ttf_name_lookup ("head", false) != NULL)
- ttf_read_head ();
- if (ttf_name_lookup ("hhea", false) != NULL)
- ttf_read_hhea ();
- if (ttf_name_lookup ("PCLT", false) != NULL)
- ttf_read_pclt ();
- if (ttf_name_lookup ("post", false) != NULL)
- ttf_read_post ();
- /* copy font file */
- tab = ttf_seek_tab ("CFF ", 0);
- for (i = tab->length; i > 0; i--)
- copy_char ();
- xfree (dir_tab);
- /* ttf_close ();*/
- if (tracefilenames)
- tex_printf (">>");
+ long i;
+ dirtab_entry *tab;
+ dir_tab = NULL;
+ glyph_tab = NULL;
+ if (tracefilenames)
+ tex_printf("<<%s", cur_file_name);
+ ttf_read_tabdir();
+ /* read font parameters */
+ if (ttf_name_lookup("head", false) != NULL)
+ ttf_read_head();
+ if (ttf_name_lookup("hhea", false) != NULL)
+ ttf_read_hhea();
+ if (ttf_name_lookup("PCLT", false) != NULL)
+ ttf_read_pclt();
+ if (ttf_name_lookup("post", false) != NULL)
+ ttf_read_post();
+ /* copy font file */
+ tab = ttf_seek_tab("CFF ", 0);
+ for (i = tab->length; i > 0; i--)
+ copy_char();
+ xfree(dir_tab);
+ /* ttf_close (); */
+ if (tracefilenames)
+ tex_printf(">>");
}
-void writeotf (fd_entry * fd) {
- int callback_id;
- int file_opened = 0;
- char *ftemp = NULL;
-
-
- fd_cur = fd; /* fd_cur is global inside writettf.c */
- assert(fd_cur->fm != NULL);
- assert(is_opentype(fd_cur->fm));
- assert(is_included(fd_cur->fm));
-
- set_cur_file_name(fd_cur->fm->ff_name);
- ttf_curbyte=0;
- ttf_size=0;
- callback_id=callback_defined(find_opentype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->S",(char *)(nameoffile+1),&ftemp)) {
- if(ftemp!=NULL&&strlen(ftemp)) {
- free(nameoffile);
- namelength = strlen(ftemp);
- nameoffile = xmalloc(namelength+2);
- strcpy((char *)(nameoffile+1),ftemp);
- free(ftemp);
- }
+void writeotf(fd_entry * fd)
+{
+ int callback_id;
+ int file_opened = 0;
+ char *ftemp = NULL;
+
+
+ fd_cur = fd; /* fd_cur is global inside writettf.c */
+ assert(fd_cur->fm != NULL);
+ assert(is_opentype(fd_cur->fm));
+ assert(is_included(fd_cur->fm));
+
+ set_cur_file_name(fd_cur->fm->ff_name);
+ ttf_curbyte = 0;
+ ttf_size = 0;
+ callback_id = callback_defined(find_opentype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback
+ (callback_id, "S->S", (char *) (nameoffile + 1), &ftemp)) {
+ if (ftemp != NULL && strlen(ftemp)) {
+ free(nameoffile);
+ namelength = strlen(ftemp);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), ftemp);
+ free(ftemp);
+ }
+ }
}
- }
- callback_id=callback_defined(read_opentype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->bSd",(char *)(nameoffile+1),
- &file_opened, &ttf_buffer,&ttf_size) &&
- file_opened && ttf_size>0) {
+ callback_id = callback_defined(read_opentype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback(callback_id, "S->bSd", (char *) (nameoffile + 1),
+ &file_opened, &ttf_buffer, &ttf_size) &&
+ file_opened && ttf_size > 0) {
+ } else {
+ pdftex_fail("cannot open OpenType font file for reading");
+ }
} else {
- pdftex_fail ("cannot open OpenType font file for reading");
- }
- } else {
- if (!otf_open ()) {
- pdftex_fail ("cannot open OpenType font file for reading");
+ if (!otf_open()) {
+ pdftex_fail("cannot open OpenType font file for reading");
+ }
+ ttf_read_file();
+ ttf_close();
}
- ttf_read_file();
- ttf_close();
- }
-
- cur_file_name = (char *) nameoffile + 1;
- fd_cur->ff_found = true;
- do_writeotf(fd);
- cur_file_name = NULL;
+
+ cur_file_name = (char *) nameoffile + 1;
+ fd_cur->ff_found = true;
+ do_writeotf(fd);
+ xfree(ttf_buffer);
+ cur_file_name = NULL;
}
/*
diff --git a/Build/source/texk/web2c/luatexdir/font/writettf.h b/Build/source/texk/web2c/luatexdir/font/writettf.h
index ecfaa2c37e3..42a57a72c8f 100644
--- a/Build/source/texk/web2c/luatexdir/font/writettf.h
+++ b/Build/source/texk/web2c/luatexdir/font/writettf.h
@@ -1,25 +1,27 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* writettf.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-$Id: writettf.h 1013 2008-02-14 00:09:02Z oneiros $
-*/
+/* $Id: writettf.h 1592 2008-11-28 13:23:51Z oneiros $ */
+#ifndef WRITETTF_H
+# define WRITETTF_H 1
typedef signed char TTF_CHAR;
typedef unsigned char TTF_BYTE;
typedef signed short TTF_SHORT;
@@ -32,79 +34,82 @@ typedef signed short TTF_FWORD;
typedef unsigned short TTF_UFWORD;
typedef unsigned short TTF_F2DOT14;
-#define TTF_CHAR_SIZE 1
-#define TTF_BYTE_SIZE 1
-#define TTF_SHORT_SIZE 2
-#define TTF_USHORT_SIZE 2
-#define TTF_LONG_SIZE 4
-#define TTF_ULONG_SIZE 4
-#define TTF_FIXED_SIZE 4
-#define TTF_FWORD_SIZE 2
-#define TTF_UFWORD_SIZE 2
-#define TTF_F2DOT14_SIZE 2
-
-#define ARG_1_AND_2_ARE_WORDS (1<<0)
-#define ARGS_ARE_XY_VALUES (1<<1)
-#define ROUND_XY_TO_GRID (1<<2)
-#define WE_HAVE_A_SCALE (1<<3)
-#define RESERVED (1<<4)
-#define MORE_COMPONENTS (1<<5)
-#define WE_HAVE_AN_X_AND_Y_SCALE (1<<6)
-#define WE_HAVE_A_TWO_BY_TWO (1<<7)
-#define WE_HAVE_INSTRUCTIONS (1<<8)
-#define USE_MY_METRICS (1<<9)
-
-#define get_type(t) ((t)ttf_getnum(t##_SIZE))
-#define ttf_skip(n) ttf_getnum(n)
-
-#define get_byte() get_type(TTF_BYTE)
-#define get_char() get_type(TTF_CHAR)
-#define get_ushort() get_type(TTF_USHORT)
-#define get_short() get_type(TTF_SHORT)
-#define get_ulong() get_type(TTF_ULONG)
-#define get_long() get_type(TTF_LONG)
-#define get_fixed() get_type(TTF_FIXED)
-#define get_funit() get_type(TTF_FUNIT)
-#define get_fword() get_type(TTF_FWORD)
-#define get_ufword() get_type(TTF_UFWORD)
-#define get_f2dot14() get_type(TTF_F2DOT14)
-
-#define put_num(t,n) ((t)ttf_putnum(t##_SIZE, n))
-
-#define put_char(n) (void)put_num(TTF_CHAR, n)
-#define put_byte(n) (void)put_num(TTF_BYTE, n)
-#define put_short(n) put_num(TTF_SHORT, n)
-#define put_ushort(n) put_num(TTF_USHORT, n)
-#define put_long(n) put_num(TTF_LONG, n)
-#define put_ulong(n) (void)put_num(TTF_ULONG, n)
-#define put_fixed(n) (void)put_num(TTF_FIXED, n)
-#define put_funit(n) put_num(TTF_FUNIT, n)
-#define put_fword(n) put_num(TTF_FWORD, n)
-#define put_ufword(n) (void)put_num(TTF_UFWORD, n)
-#define put_f2dot14(n) put_num(TTF_F2DOT14, n)
-
-#define copy_byte() put_byte(get_byte())
-#define copy_char() put_char(get_char())
-#define copy_ushort() put_ushort(get_ushort())
-#define copy_short() put_short(get_short())
-#define copy_ulong() put_ulong(get_ulong())
-#define copy_long() put_long(get_long())
-#define copy_fixed() put_fixed(get_fixed())
-#define copy_funit() put_funit(get_funit())
-#define copy_fword() put_fword(get_fword())
-#define copy_ufword() put_ufword(get_ufword())
-#define copy_f2dot14() put_f2dot14(get_f2dot14())
-
-#define is_unicode_mapping(e) \
+# define TTF_CHAR_SIZE 1
+# define TTF_BYTE_SIZE 1
+# define TTF_SHORT_SIZE 2
+# define TTF_USHORT_SIZE 2
+# define TTF_LONG_SIZE 4
+# define TTF_ULONG_SIZE 4
+# define TTF_FIXED_SIZE 4
+# define TTF_FWORD_SIZE 2
+# define TTF_UFWORD_SIZE 2
+# define TTF_F2DOT14_SIZE 2
+
+/*
+ * TrueType outline data.
+ */
+# define ARG_1_AND_2_ARE_WORDS (1<<0)
+# define ARGS_ARE_XY_VALUES (1<<1)
+# define ROUND_XY_TO_GRID (1<<2)
+# define WE_HAVE_A_SCALE (1<<3)
+# define RESERVED (1<<4)
+# define MORE_COMPONENTS (1<<5)
+# define WE_HAVE_AN_X_AND_Y_SCALE (1<<6)
+# define WE_HAVE_A_TWO_BY_TWO (1<<7)
+# define WE_HAVE_INSTRUCTIONS (1<<8)
+# define USE_MY_METRICS (1<<9)
+
+# define get_type(t) ((t)ttf_getnum(t##_SIZE))
+# define ttf_skip(n) ttf_getnum(n)
+
+# define get_byte() get_type(TTF_BYTE)
+# define get_char() get_type(TTF_CHAR)
+# define get_ushort() get_type(TTF_USHORT)
+# define get_short() get_type(TTF_SHORT)
+# define get_ulong() get_type(TTF_ULONG)
+# define get_long() get_type(TTF_LONG)
+# define get_fixed() get_type(TTF_FIXED)
+# define get_funit() get_type(TTF_FUNIT)
+# define get_fword() get_type(TTF_FWORD)
+# define get_ufword() get_type(TTF_UFWORD)
+# define get_f2dot14() get_type(TTF_F2DOT14)
+
+# define put_num(t,n) ((t)ttf_putnum(t##_SIZE, n))
+
+# define put_char(n) (void)put_num(TTF_CHAR, n)
+# define put_byte(n) (void)put_num(TTF_BYTE, n)
+# define put_short(n) put_num(TTF_SHORT, n)
+# define put_ushort(n) put_num(TTF_USHORT, n)
+# define put_long(n) put_num(TTF_LONG, n)
+# define put_ulong(n) (void)put_num(TTF_ULONG, n)
+# define put_fixed(n) (void)put_num(TTF_FIXED, n)
+# define put_funit(n) put_num(TTF_FUNIT, n)
+# define put_fword(n) put_num(TTF_FWORD, n)
+# define put_ufword(n) (void)put_num(TTF_UFWORD, n)
+# define put_f2dot14(n) put_num(TTF_F2DOT14, n)
+
+# define copy_byte() put_byte(get_byte())
+# define copy_char() put_char(get_char())
+# define copy_ushort() put_ushort(get_ushort())
+# define copy_short() put_short(get_short())
+# define copy_ulong() put_ulong(get_ulong())
+# define copy_long() put_long(get_long())
+# define copy_fixed() put_fixed(get_fixed())
+# define copy_funit() put_funit(get_funit())
+# define copy_fword() put_fword(get_fword())
+# define copy_ufword() put_ufword(get_ufword())
+# define copy_f2dot14() put_f2dot14(get_f2dot14())
+
+# define is_unicode_mapping(e) \
(e->platform_id == 0 || (e->platform_id == 3 || e->encoding_id == 1))
-#define NMACGLYPHS 258
-#define TABDIR_OFF 12
-#define ENC_BUF_SIZE 1024
+# define NMACGLYPHS 258
+# define TABDIR_OFF 12
+# define ENC_BUF_SIZE 1024
-#define GLYPH_PREFIX_INDEX "index"
-#define GLYPH_PREFIX_UNICODE "uni"
+# define GLYPH_PREFIX_INDEX "index"
+# define GLYPH_PREFIX_UNICODE "uni"
typedef struct {
char tag[4];
@@ -145,28 +150,27 @@ extern integer ttf_size;
extern integer ttf_curbyte;
extern glyph_entry *glyph_tab;
extern dirtab_entry *dir_tab;
-extern dirtab_entry *ttf_name_lookup (const char *s, boolean required);
-extern dirtab_entry *ttf_seek_tab (const char *name, TTF_LONG offset);
+extern dirtab_entry *ttf_name_lookup(const char *s, boolean required);
+extern dirtab_entry *ttf_seek_tab(const char *name, TTF_LONG offset);
-extern void ttf_read_tabdir (void);
-extern void ttf_read_head (void);
-extern void ttf_read_hhea (void);
-extern void ttf_read_pclt (void);
-extern void ttf_read_post (void);
+extern void ttf_read_tabdir(void);
+extern void ttf_read_head(void);
+extern void ttf_read_hhea(void);
+extern void ttf_read_pclt(void);
+extern void ttf_read_post(void);
extern FILE *ttf_file;
-#define ttf_open() \
- open_input(&ttf_file, kpse_truetype_format, FOPEN_RBIN_MODE)
-#define otf_open() \
- open_input(&ttf_file, kpse_opentype_format, FOPEN_RBIN_MODE)
-#define ttf_read_file() \
+# define ttf_open() \
+ (ttf_file = fopen((char *) nameoffile + 1, FOPEN_RBIN_MODE))
+# define otf_open() \
+ (ttf_file = fopen((char *) nameoffile + 1, FOPEN_RBIN_MODE))
+# define ttf_read_file() \
readbinfile(ttf_file,&ttf_buffer,&ttf_size)
-#define ttf_close() xfclose(ttf_file,cur_file_name)
-#define ttf_getchar() ttf_buffer[ttf_curbyte++]
-#define ttf_eof() (ttf_curbyte>ttf_size)
-
-extern long ttf_putnum (int s, long n);
-extern long ttf_getnum (int s);
-
+# define ttf_close() xfclose(ttf_file,cur_file_name)
+# define ttf_getchar() ttf_buffer[ttf_curbyte++]
+# define ttf_eof() (ttf_curbyte>ttf_size)
+extern long ttf_putnum(int s, long n);
+extern long ttf_getnum(int s);
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/font/writetype0.c b/Build/source/texk/web2c/luatexdir/font/writetype0.c
index 0f9eecaac7c..846314bedab 100644
--- a/Build/source/texk/web2c/luatexdir/font/writetype0.c
+++ b/Build/source/texk/web2c/luatexdir/font/writetype0.c
@@ -1,124 +1,125 @@
-/*
-Copyright (c) 2007 Taco Hoekwater, taco@luatex.org
+/* writetype0.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of luaTeX.
+ This file is part of LuaTeX.
-luaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-luaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with luaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id: writetype0.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
-
#include "writettf.h"
-
#include "writecff.h"
-void writetype0 (fd_entry * fd) {
- int callback_id;
- int file_opened = 0;
- char *ftemp = NULL;
- long i;
- dirtab_entry *tab;
- cff_font *cff;
-
- dir_tab = NULL;
- glyph_tab = NULL;
-
- fd_cur = fd; /* fd_cur is global inside writettf.c */
- assert(fd_cur->fm != NULL);
- assert(is_opentype(fd_cur->fm));
- assert(is_included(fd_cur->fm));
-
- set_cur_file_name(fd_cur->fm->ff_name);
- ttf_curbyte=0;
- ttf_size=0;
- callback_id=callback_defined(find_opentype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->S",(char *)(nameoffile+1),&ftemp)) {
- if(ftemp!=NULL&&strlen(ftemp)) {
- free(nameoffile);
- namelength = strlen(ftemp);
- nameoffile = xmalloc(namelength+2);
- strcpy((char *)(nameoffile+1),ftemp);
- free(ftemp);
- }
+static const char _svn_version[] =
+ "$Id: writetype0.c 1783 2009-01-18 12:51:01Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writetype0.c $";
+
+void writetype0(fd_entry * fd)
+{
+ int callback_id;
+ int file_opened = 0;
+ char *ftemp = NULL;
+ long i;
+ dirtab_entry *tab;
+ cff_font *cff;
+
+ dir_tab = NULL;
+ glyph_tab = NULL;
+
+ fd_cur = fd; /* fd_cur is global inside writettf.c */
+ assert(fd_cur->fm != NULL);
+ assert(is_opentype(fd_cur->fm));
+ assert(is_included(fd_cur->fm));
+
+ set_cur_file_name(fd_cur->fm->ff_name);
+ ttf_curbyte = 0;
+ ttf_size = 0;
+ callback_id = callback_defined(find_opentype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback
+ (callback_id, "S->S", (char *) (nameoffile + 1), &ftemp)) {
+ if (ftemp != NULL && strlen(ftemp)) {
+ free(nameoffile);
+ namelength = strlen(ftemp);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), ftemp);
+ free(ftemp);
+ }
+ }
}
- }
- callback_id=callback_defined(read_opentype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->bSd",(char *)(nameoffile+1),
- &file_opened, &ttf_buffer,&ttf_size) &&
- file_opened && ttf_size>0) {
+ callback_id = callback_defined(read_opentype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback(callback_id, "S->bSd", (char *) (nameoffile + 1),
+ &file_opened, &ttf_buffer, &ttf_size) &&
+ file_opened && ttf_size > 0) {
+ } else {
+ pdftex_fail("cannot open OpenType font file for reading");
+ }
} else {
- pdftex_fail ("cannot open OpenType font file for reading");
- }
- } else {
- if (!otf_open ()) {
- pdftex_fail ("cannot open OpenType font file for reading");
+ if (!otf_open()) {
+ pdftex_fail("cannot open OpenType font file for reading");
+ }
+ ttf_read_file();
+ ttf_close();
}
- ttf_read_file();
- ttf_close();
- }
-
- cur_file_name = (char *) nameoffile + 1;
- fd_cur->ff_found = true;
- if (tracefilenames) {
- if (is_subsetted(fd_cur->fm))
- tex_printf ("<%s", cur_file_name);
- else
- tex_printf ("<<%s", cur_file_name);
- }
- ttf_read_tabdir ();
- /* read font parameters */
- if (ttf_name_lookup ("head", false) != NULL)
- ttf_read_head ();
- if (ttf_name_lookup ("hhea", false) != NULL)
- ttf_read_hhea ();
- if (ttf_name_lookup ("PCLT", false) != NULL)
- ttf_read_pclt ();
- if (ttf_name_lookup ("post", false) != NULL)
- ttf_read_post ();
+ cur_file_name = (char *) nameoffile + 1;
+ fd_cur->ff_found = true;
- /* copy font file */
- tab = ttf_seek_tab ("CFF ", 0);
+ if (tracefilenames) {
+ if (is_subsetted(fd_cur->fm))
+ tex_printf("<%s", cur_file_name);
+ else
+ tex_printf("<<%s", cur_file_name);
+ }
+ ttf_read_tabdir();
+ /* read font parameters */
+ if (ttf_name_lookup("head", false) != NULL)
+ ttf_read_head();
+ if (ttf_name_lookup("hhea", false) != NULL)
+ ttf_read_hhea();
+ if (ttf_name_lookup("PCLT", false) != NULL)
+ ttf_read_pclt();
+ if (ttf_name_lookup("post", false) != NULL)
+ ttf_read_post();
- /* TODO the next 0 is a subfont index */
- cff = read_cff(ttf_buffer+ttf_curbyte,tab->length,0);
- if (cff != NULL) {
- if (cff_is_cidfont(cff)) {
- write_cid_cff(cff,fd_cur,0);
- /*
- for (i = tab->length; i > 0; i--)
- fb_putchar (ttf_getnum(1));
- */
+ /* copy font file */
+ tab = ttf_seek_tab("CFF ", 0);
+
+ /* TODO the next 0 is a subfont index */
+ cff = read_cff(ttf_buffer + ttf_curbyte, tab->length, 0);
+ if (cff != NULL) {
+ if (cff_is_cidfont(cff)) {
+ write_cid_cff(cff, fd_cur);
+ /*
+ for (i = tab->length; i > 0; i--)
+ fb_putchar (ttf_getnum(1));
+ */
+ } else {
+ write_cff(cff, fd_cur);
+ }
} else {
- write_cff(cff,fd_cur,0);
+ /* not understood, just do a copy */
+ for (i = tab->length; i > 0; i--)
+ fb_putchar(ttf_getnum(1));
+ }
+ xfree(dir_tab);
+ xfree(ttf_buffer);
+ if (tracefilenames) {
+ if (is_subsetted(fd_cur->fm))
+ tex_printf(">");
+ else
+ tex_printf(">>");
}
- } else {
- /* not understood, just do a copy */
- for (i = tab->length; i > 0; i--)
- fb_putchar (ttf_getnum(1));
- }
- xfree (dir_tab);
- if (tracefilenames) {
- if (is_subsetted (fd_cur->fm))
- tex_printf (">");
- else
- tex_printf (">>");
- }
- cur_file_name = NULL;
+ cur_file_name = NULL;
}
diff --git a/Build/source/texk/web2c/luatexdir/font/writetype2.c b/Build/source/texk/web2c/luatexdir/font/writetype2.c
index 649c350b707..ba98772b931 100644
--- a/Build/source/texk/web2c/luatexdir/font/writetype2.c
+++ b/Build/source/texk/web2c/luatexdir/font/writetype2.c
@@ -1,25 +1,21 @@
+/* writetype0.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-/*
-Copyright (c) 2007 Taco Hoekwater, taco@luatex.org
-
-This file is part of luaTeX.
-
-luaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-luaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with luaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: writetype2.c 1013 2008-02-14 00:09:02Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include "writettf.h"
@@ -28,170 +24,185 @@ $Id: writetype2.c 1013 2008-02-14 00:09:02Z oneiros $
#include "sfnt.h"
#include "tt_glyf.h"
+static const char _svn_version[] =
+ "$Id: writetype2.c 1783 2009-01-18 12:51:01Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/font/writetype2.c $";
+
/* forward*/
-void make_tt_subset (fd_entry * fd,unsigned char *buffer, integer buflen) ;
+void make_tt_subset(fd_entry * fd, unsigned char *buffer, integer buflen);
unsigned long cidtogid_obj = 0;
/* low-level helpers */
-#define test_loc(l) \
- if ((f->loc+l)>f->buflen) { \
- fprintf (stderr,"File ended prematurely\n"); \
- uexit(1); \
+#define test_loc(l) \
+ if ((f->loc+l)>f->buflen) { \
+ fprintf (stderr,"File ended prematurely\n"); \
+ uexit(1); \
}
-BYTE get_unsigned_byte(sfnt* f) {
- test_loc(1);
- return (BYTE)f->buffer[(f->loc++)];
+BYTE get_unsigned_byte(sfnt * f)
+{
+ test_loc(1);
+ return (BYTE) f->buffer[(f->loc++)];
};
-ICHAR get_signed_byte(sfnt* f) {
- test_loc(1);
- return (ICHAR)f->buffer[(f->loc++)];
+ICHAR get_signed_byte(sfnt * f)
+{
+ test_loc(1);
+ return (ICHAR) f->buffer[(f->loc++)];
};
-USHORT get_unsigned_pair(sfnt* f){
- USHORT l;
- test_loc(2);
- l = f->buffer[(f->loc++)];
- l = l*0x100 + f->buffer[(f->loc++)];
- return l;
+USHORT get_unsigned_pair(sfnt * f)
+{
+ USHORT l;
+ test_loc(2);
+ l = f->buffer[(f->loc++)];
+ l = l * 0x100 + f->buffer[(f->loc++)];
+ return l;
};
-SHORT get_signed_pair(sfnt* f){
- long l;
- test_loc(2);
- l = f->buffer[(f->loc++)];
- if (l>0x80) l -= 0x100;
- l = l*0x100 + f->buffer[(f->loc++)];
- return l;
+SHORT get_signed_pair(sfnt * f)
+{
+ long l;
+ test_loc(2);
+ l = f->buffer[(f->loc++)];
+ if (l > 0x80)
+ l -= 0x100;
+ l = l * 0x100 + f->buffer[(f->loc++)];
+ return l;
};
-ULONG get_unsigned_quad(sfnt* f){
- ULONG l;
- test_loc(4);
- l = f->buffer[(f->loc++)];
- l = l*0x100 + f->buffer[(f->loc++)];
- l = l*0x100 + f->buffer[(f->loc++)];
- l = l*0x100 + f->buffer[(f->loc++)];
- return l;
+ULONG get_unsigned_quad(sfnt * f)
+{
+ ULONG l;
+ test_loc(4);
+ l = f->buffer[(f->loc++)];
+ l = l * 0x100 + f->buffer[(f->loc++)];
+ l = l * 0x100 + f->buffer[(f->loc++)];
+ l = l * 0x100 + f->buffer[(f->loc++)];
+ return l;
};
-int do_sfnt_read (unsigned char *dest, int len, sfnt *f) {
- int i;
- test_loc(len);
- for (i=0;i<len;i++) {
- *(dest+i)=f->buffer[f->loc+i];
- }
- f->loc += len;
- return len;
+int do_sfnt_read(unsigned char *dest, int len, sfnt * f)
+{
+ int i;
+ test_loc(len);
+ for (i = 0; i < len; i++) {
+ *(dest + i) = f->buffer[f->loc + i];
+ }
+ f->loc += len;
+ return len;
};
-pdf_obj *pdf_new_stream(void) {
- pdf_obj *stream = xmalloc(sizeof(pdf_obj)) ;
- stream->length =0;
- stream->data=NULL;
- return stream;
+pdf_obj *pdf_new_stream(void)
+{
+ pdf_obj *stream = xmalloc(sizeof(pdf_obj));
+ stream->length = 0;
+ stream->data = NULL;
+ return stream;
};
-void pdf_add_stream(pdf_obj *stream, unsigned char *buf, long len) {
- int i;
- assert (stream!=NULL);
- if (stream->data==NULL) {
- stream->data = xmalloc(len);
- } else {
- stream->data = xrealloc(stream->data,len+stream->length);
- }
- for (i=0;i<len;i++) {
- *(stream->data+stream->length+i)=*(buf+i);
- }
- stream->length+=len;
+void pdf_add_stream(pdf_obj * stream, unsigned char *buf, long len)
+{
+ int i;
+ assert(stream != NULL);
+ if (stream->data == NULL) {
+ stream->data = xmalloc(len);
+ } else {
+ stream->data = xrealloc(stream->data, len + stream->length);
+ }
+ for (i = 0; i < len; i++) {
+ *(stream->data + stream->length + i) = *(buf + i);
+ }
+ stream->length += len;
};
-void pdf_release_obj(pdf_obj *stream) {
- if (stream!=NULL) {
- if (stream->data!=NULL) {
- xfree(stream->data);
+void pdf_release_obj(pdf_obj * stream)
+{
+ if (stream != NULL) {
+ if (stream->data != NULL) {
+ xfree(stream->data);
+ }
+ xfree(stream);
}
- xfree(stream);
- }
};
-void
-writetype2 (fd_entry * fd) {
- int callback_id;
- int file_opened = 0;
- char *ftemp = NULL;
-
- glyph_tab = NULL;
-
- fd_cur = fd; /* fd_cur is global inside writettf.c */
- assert(fd_cur->fm != NULL);
- assert(is_truetype(fd_cur->fm));
-
- if (!is_subsetted(fd_cur->fm)) {
- writettf(fd);
- return;
- }
-
- assert(is_included(fd_cur->fm));
-
- set_cur_file_name(fd_cur->fm->ff_name);
- ttf_curbyte=0;
- ttf_size=0;
- callback_id=callback_defined(find_opentype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->S",(char *)(nameoffile+1),&ftemp)) {
- if(ftemp!=NULL&&strlen(ftemp)) {
- free(nameoffile);
- namelength = strlen(ftemp);
- nameoffile = xmalloc(namelength+2);
- strcpy((char *)(nameoffile+1),ftemp);
- free(ftemp);
- }
+void writetype2(fd_entry * fd)
+{
+ int callback_id;
+ int file_opened = 0;
+ char *ftemp = NULL;
+
+ glyph_tab = NULL;
+
+ fd_cur = fd; /* fd_cur is global inside writettf.c */
+ assert(fd_cur->fm != NULL);
+ assert(is_truetype(fd_cur->fm));
+
+ if (!is_subsetted(fd_cur->fm)) {
+ writettf(fd);
+ return;
}
- }
- callback_id=callback_defined(read_opentype_file_callback);
- if (callback_id>0) {
- if(run_callback(callback_id,"S->bSd",(char *)(nameoffile+1),
- &file_opened, &ttf_buffer,&ttf_size) &&
- file_opened && ttf_size>0) {
+
+ assert(is_included(fd_cur->fm));
+
+ set_cur_file_name(fd_cur->fm->ff_name);
+ ttf_curbyte = 0;
+ ttf_size = 0;
+ callback_id = callback_defined(find_opentype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback
+ (callback_id, "S->S", (char *) (nameoffile + 1), &ftemp)) {
+ if (ftemp != NULL && strlen(ftemp)) {
+ free(nameoffile);
+ namelength = strlen(ftemp);
+ nameoffile = xmalloc(namelength + 2);
+ strcpy((char *) (nameoffile + 1), ftemp);
+ free(ftemp);
+ }
+ }
+ }
+ callback_id = callback_defined(read_opentype_file_callback);
+ if (callback_id > 0) {
+ if (run_callback(callback_id, "S->bSd", (char *) (nameoffile + 1),
+ &file_opened, &ttf_buffer, &ttf_size) &&
+ file_opened && ttf_size > 0) {
+ } else {
+ pdftex_fail("cannot open OpenType font file for reading");
+ }
} else {
- pdftex_fail ("cannot open OpenType font file for reading");
+ if (!otf_open()) {
+ pdftex_fail("cannot open OpenType font file for reading");
+ }
+ ttf_read_file();
+ ttf_close();
}
- } else {
- if (!otf_open ()) {
- pdftex_fail ("cannot open OpenType font file for reading");
+
+ cur_file_name = (char *) nameoffile + 1;
+ fd_cur->ff_found = true;
+
+ if (tracefilenames) {
+ if (is_subsetted(fd_cur->fm))
+ tex_printf("<%s", cur_file_name);
+ else
+ tex_printf("<<%s", cur_file_name);
}
- ttf_read_file();
- ttf_close();
- }
-
- cur_file_name = (char *) nameoffile + 1;
- fd_cur->ff_found = true;
-
- if (tracefilenames) {
- if (is_subsetted(fd_cur->fm))
- tex_printf ("<%s", cur_file_name);
- else
- tex_printf ("<<%s", cur_file_name);
- }
- /* here is the real work */
+ /* here is the real work */
- make_tt_subset(fd,ttf_buffer,ttf_size);
+ make_tt_subset(fd, ttf_buffer, ttf_size);
- /*xfree (dir_tab);*/
- if (tracefilenames) {
- if (is_subsetted (fd_cur->fm))
- tex_printf (">");
- else
- tex_printf (">>");
- }
- cur_file_name = NULL;
+ /*xfree (dir_tab); */
+ xfree(ttf_buffer);
+ if (tracefilenames) {
+ if (is_subsetted(fd_cur->fm))
+ tex_printf(">");
+ else
+ tex_printf(">>");
+ }
+ cur_file_name = NULL;
}
/*
@@ -216,207 +227,216 @@ writetype2 (fd_entry * fd) {
* The 'name' table added. See comments in ttf.c.
*/
-static struct
-{
- const char *name;
- int must_exist;
+static struct {
+ const char *name;
+ int must_exist;
} required_table[] = {
- {"OS/2", 0}, {"head", 1}, {"hhea", 1}, {"loca", 1}, {"maxp", 1},
- {"name", 1}, {"glyf", 1}, {"hmtx", 1}, {"fpgm", 0}, {"cvt ", 0},
- {"prep", 0}, {NULL, 0}
+ {
+ "OS/2", 0}, {
+ "cmap", 0}, {
+ "head", 1}, {
+ "hhea", 1}, {
+ "loca", 1}, {
+ "maxp", 1}, {
+ "name", 1}, {
+ "glyf", 1}, {
+ "hmtx", 1}, {
+ "fpgm", 0}, {
+ "cvt ", 0}, {
+ "prep", 0}, {
+ NULL, 0}
};
-unsigned long ttc_read_offset (sfnt *sfont, int ttc_idx)
+unsigned long ttc_read_offset(sfnt * sfont, int ttc_idx)
{
- long version;
- unsigned long offset = 0;
- unsigned long num_dirs = 0;
+ long version;
+ unsigned long offset = 0;
+ unsigned long num_dirs = 0;
- sfnt_seek_set (sfont, 4); /* skip version tag */
+ sfnt_seek_set(sfont, 4); /* skip version tag */
- version = sfnt_get_ulong(sfont);
- num_dirs = sfnt_get_ulong(sfont);
- if (ttc_idx < 0 || ttc_idx > num_dirs - 1) {
- fprintf(stderr,"Invalid TTC index number\n");
- uexit(1);
- }
+ version = sfnt_get_ulong(sfont);
+ num_dirs = sfnt_get_ulong(sfont);
+ if (ttc_idx < 0 || ttc_idx > (int) (num_dirs - 1)) {
+ fprintf(stderr, "Invalid TTC index number\n");
+ uexit(1);
+ }
- sfnt_seek_set (sfont, 12 + ttc_idx * 4);
- offset = sfnt_get_ulong (sfont);
+ sfnt_seek_set(sfont, 12 + ttc_idx * 4);
+ offset = sfnt_get_ulong(sfont);
- return offset;
+ return offset;
}
-extern int ff_get_ttc_index(char *ffname, char*psname);
-
-void make_tt_subset (fd_entry * fd,unsigned char *buffer, integer buflen) {
-
- long i, cid;
- unsigned int last_cid;
- glw_entry *glyph, *found;
- struct avl_traverser t;
- unsigned char *cidtogidmap ;
- unsigned short num_glyphs, gid;
- struct tt_glyphs *glyphs;
- char *used_chars;
- sfnt *sfont;
- pdf_obj *fontfile;
- int verbose = 0, error = 0;
-
- cidtogidmap = NULL;
-
- sfont = sfnt_open(buffer, buflen);
-
- if (sfont->type == SFNT_TYPE_TTC) {
- i = ff_get_ttc_index(fd->fm->ff_name,fd->fm->ps_name);
- error = sfnt_read_table_directory(sfont, ttc_read_offset(sfont, i));
- } else {
- error = sfnt_read_table_directory(sfont, 0);
- }
+extern int ff_get_ttc_index(char *ffname, char *psname); /* libs/luafontforge/src/luafflib.c */
- if (error < 0) {
- fprintf(stderr,"Could not parse the ttf directory.\n");
- uexit(1);
- }
+void make_tt_subset(fd_entry * fd, unsigned char *buffer, integer buflen)
+{
+
+ long i, cid;
+ unsigned int last_cid;
+ glw_entry *found;
+ struct avl_traverser t;
+ unsigned char *cidtogidmap;
+ unsigned short num_glyphs, gid;
+ struct tt_glyphs *glyphs;
+ char *used_chars;
+ sfnt *sfont;
+ pdf_obj *fontfile;
+ int verbose = 0, error = 0;
+
+ cidtogidmap = NULL;
+
+ sfont = sfnt_open(buffer, buflen);
+
+ if (sfont->type == SFNT_TYPE_TTC) {
+ i = ff_get_ttc_index(fd->fm->ff_name, fd->fm->ps_name);
+ error = sfnt_read_table_directory(sfont, ttc_read_offset(sfont, i));
+ } else {
+ error = sfnt_read_table_directory(sfont, 0);
+ }
- glyphs = tt_build_init();
+ if (error < 0) {
+ fprintf(stderr, "Could not parse the ttf directory.\n");
+ uexit(1);
+ }
- last_cid = 0;
- num_glyphs = 1; /* .notdef */
+ glyphs = tt_build_init();
- glyph = xtalloc(1,glw_entry);
+ last_cid = 0;
+
+ avl_t_init(&t, fd->gl_tree);
+ for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
+ found != NULL; found = (glw_entry *) avl_t_next(&t)) {
+ if (found->id > last_cid)
+ last_cid = found->id;
+ }
- avl_t_init(&t, fd->gl_tree);
- for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
- found != NULL;
- found = (glw_entry *) avl_t_next(&t)) {
- if (found->id > last_cid)
- last_cid = found->id;
- }
-
#ifndef NO_GHOSTSCRIPT_BUG
- cidtogidmap = NULL;
+ cidtogidmap = NULL;
#else
- cidtogidmap = xmalloc(((last_cid + 1) * 2) * sizeof(unsigned char));
- memset(cidtogidmap, 0, (last_cid + 1) * 2);
+ cidtogidmap = xmalloc(((last_cid + 1) * 2) * sizeof(unsigned char));
+ memset(cidtogidmap, 0, (last_cid + 1) * 2);
#endif
- /* fill used_chars */
- used_chars = xmalloc((last_cid + 1) * sizeof(char));
- memset(used_chars, 0, (last_cid + 1));
- avl_t_init(&t, fd->gl_tree);
- for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
- found != NULL;
- found = (glw_entry *) avl_t_next(&t)) {
- used_chars[found->id] = 1;
- }
+ /* fill used_chars */
+ used_chars = xmalloc((last_cid + 1) * sizeof(char));
+ memset(used_chars, 0, (last_cid + 1));
+ avl_t_init(&t, fd->gl_tree);
+ for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
+ found != NULL; found = (glw_entry *) avl_t_next(&t)) {
+ used_chars[found->id] = 1;
+ }
- /*
- * Map CIDs to GIDs.
- */
+ /*
+ * Map CIDs to GIDs.
+ */
- num_glyphs = 1; /* .notdef */
- for (cid = 1; cid <= last_cid; cid++) {
- if (used_chars[cid]==0)
- continue;
- gid = cid;
+ num_glyphs = 1; /* .notdef */
+ for (cid = 1; cid <= (long) last_cid; cid++) {
+ if (used_chars[cid] == 0)
+ continue;
+ gid = cid;
#ifndef NO_GHOSTSCRIPT_BUG
- gid = tt_add_glyph(glyphs, gid, cid);
+ gid = tt_add_glyph(glyphs, gid, cid);
#else
- gid = tt_add_glyph(glyphs, gid, num_glyphs);
- cidtogidmap[2*cid ] = gid >> 8;
- cidtogidmap[2*cid+1] = gid & 0xff;
-#endif /* !NO_GHOSTSCRIPT_BUG */
-
- num_glyphs++;
- }
+ gid = tt_add_glyph(glyphs, gid, num_glyphs);
+ cidtogidmap[2 * cid] = gid >> 8;
+ cidtogidmap[2 * cid + 1] = gid & 0xff;
+#endif /* !NO_GHOSTSCRIPT_BUG */
- if (num_glyphs==1) {
- fprintf(stderr,"No glyphs in subset?.\n");
- uexit(1);
- }
+ num_glyphs++;
+ }
- if (tt_build_tables(sfont, glyphs) < 0) {
- fprintf(stderr,"Could not parse the ttf buffer.\n");
- uexit(1);
- }
-
- if (verbose > 1) {
- fprintf(stdout,"[%u glyphs (Max CID: %u)]", glyphs->num_glyphs, last_cid);
- }
+ if (num_glyphs == 1) {
+ fprintf(stderr, "No glyphs in subset?.\n");
+ uexit(1);
+ }
- tt_build_finish(glyphs);
+ if (tt_build_tables(sfont, glyphs) < 0) {
+ fprintf(stderr, "Could not parse the ttf buffer.\n");
+ uexit(1);
+ }
- /* Create font file */
+ if (verbose > 1) {
+ fprintf(stdout, "[%u glyphs (Max CID: %u)]", glyphs->num_glyphs,
+ last_cid);
+ }
- for (i = 0; required_table[i].name; i++) {
- if (sfnt_require_table(sfont,
- required_table[i].name,
- required_table[i].must_exist) < 0) {
- fprintf(stderr,"Some required TrueType table does not exist.");
- uexit(1);
+ tt_build_finish(glyphs);
+
+ /* Create font file */
+
+ for (i = 0; required_table[i].name; i++) {
+ if (sfnt_require_table(sfont,
+ required_table[i].name,
+ required_table[i].must_exist) < 0) {
+ fprintf(stderr, "Some required TrueType table does not exist.");
+ uexit(1);
+ }
}
- }
- fontfile = sfnt_create_FontFile_stream(sfont);
+ fontfile = sfnt_create_FontFile_stream(sfont);
- if (verbose > 1) {
- fprintf(stdout,"[%ld bytes]", fontfile->length);
- }
+ if (verbose > 1) {
+ fprintf(stdout, "[%ld bytes]", fontfile->length);
+ }
- /* squeeze in the cidgidmap */
- if (cidtogidmap!=NULL) {
- cidtogid_obj = pdf_new_objnum();
- pdf_begin_dict(cidtogid_obj, 0);
- pdf_printf("/Length %i\n",((last_cid + 1) * 2));
- pdf_end_dict();
- pdf_printf("stream\n");
- pdfroom ((last_cid + 1) * 2);
- for (i = 0; i<((last_cid + 1) * 2); i++ ) {
- pdf_buf[pdf_ptr++] = cidtogidmap[i];
+ /* squeeze in the cidgidmap */
+ if (cidtogidmap != NULL) {
+ cidtogid_obj = pdf_new_objnum();
+ pdf_begin_dict(cidtogid_obj, 0);
+ pdf_printf("/Length %i\n", ((last_cid + 1) * 2));
+ pdf_end_dict();
+ pdf_printf("stream\n");
+ pdfroom((last_cid + 1) * 2);
+ for (i = 0; i < ((int) (last_cid + 1) * 2); i++) {
+ pdf_buf[pdf_ptr++] = cidtogidmap[i];
+ }
+ pdf_printf("\nendstream\n");
}
- pdf_printf("\nendstream\n");
- }
- /* the tff subset */
- for (i = 0; i<fontfile->length; i++ )
- fb_putchar (fontfile->data[i]);
-
-
- /* other stuff that needs fixing: */
-
- /*
- * DW, W, DW2, and W2
- */
- /*
- if (opt_flags & CIDFONT_FORCE_FIXEDPITCH) {
- pdf_add_dict(font->fontdict,
- pdf_new_name("DW"), pdf_new_number(1000.0));
- } else {
- add_TTCIDHMetrics(font->fontdict, glyphs, used_chars, cidtogidmap, last_cid);
- if (v_used_chars)
- add_TTCIDVMetrics(font->fontdict, glyphs, used_chars, cidtogidmap, last_cid);
- }
- */
-
- /*
- * CIDSet
- */
- /*
- {
- pdf_obj *cidset;
-
- cidset = pdf_new_stream(STREAM_COMPRESS);
- pdf_add_stream(cidset, used_chars, last_cid/8 + 1);
- pdf_add_dict(font->descriptor,
- pdf_new_name("CIDSet"),
- pdf_ref_obj(cidset));
- pdf_release_obj(cidset);
- }
- */
+ /* the tff subset */
+ for (i = 0; i < (int) (fontfile->length); i++)
+ fb_putchar(fontfile->data[i]);
- return;
+ pdf_release_obj(fontfile);
+
+ /* other stuff that needs fixing: */
+
+ /*
+ * DW, W, DW2, and W2
+ */
+ /*
+ if (opt_flags & CIDFONT_FORCE_FIXEDPITCH) {
+ pdf_add_dict(font->fontdict,
+ pdf_new_name("DW"), pdf_new_number(1000.0));
+ } else {
+ add_TTCIDHMetrics(font->fontdict, glyphs, used_chars, cidtogidmap, last_cid);
+ if (v_used_chars)
+ add_TTCIDVMetrics(font->fontdict, glyphs, used_chars, cidtogidmap, last_cid);
+ }
+ */
+
+ /*
+ * CIDSet
+ */
+ /*
+ {
+ pdf_obj *cidset;
+
+ cidset = pdf_new_stream(STREAM_COMPRESS);
+ pdf_add_stream(cidset, used_chars, last_cid/8 + 1);
+ pdf_add_dict(font->descriptor,
+ pdf_new_name("CIDSet"),
+ pdf_ref_obj(cidset));
+ pdf_release_obj(cidset);
+ }
+ */
+ xfree(used_chars);
+ sfnt_close(sfont);
+ return;
}
diff --git a/Build/source/texk/web2c/luatexdir/get_svnversion.sh b/Build/source/texk/web2c/luatexdir/get_svnversion.sh
new file mode 100755
index 00000000000..1c544342799
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/get_svnversion.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+srcdir=$1
+if [ -e "`which svnversion`" ] && [ -e "`which sed`" ]; then
+ REV=`svnversion $srcdir | sed 's/^\([0-9]\+\).*/\1/'`
+ case $REV in *[^0-9]*)
+ echo unknown
+ exit 0
+ ;;
+ esac
+ echo $REV
+else
+ echo unknown
+fi \ No newline at end of file
diff --git a/Build/source/texk/web2c/luatexdir/hyphen.h b/Build/source/texk/web2c/luatexdir/hyphen.h
index f665c7605b9..fa54e8db245 100644
--- a/Build/source/texk/web2c/luatexdir/hyphen.h
+++ b/Build/source/texk/web2c/luatexdir/hyphen.h
@@ -34,27 +34,28 @@
*
*/
#ifndef __HYPHEN_H__
-#define __HYPHEN_H__
+# define __HYPHEN_H__
-#ifdef __cplusplus
+# ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+# endif /* __cplusplus */
-typedef struct _HyphenDict HyphenDict;
+ typedef struct _HyphenDict HyphenDict;
-#include "ptexlib.h"
-#include "nodes.h"
+# include "ptexlib.h"
+# include "nodes.h"
-HyphenDict* hnj_hyphen_new();
-void hnj_hyphen_load(HyphenDict*dict, const unsigned char *fn);
-void hnj_hyphen_free (HyphenDict *dict);
-void hnj_hyphen_clear (HyphenDict *dict);
-void hnj_hyphen_hyphenate (HyphenDict *dict, halfword first, halfword last, int size, halfword left, halfword right, lang_variables*lan);
-unsigned char* hnj_serialize(HyphenDict*);
-void hnj_free_serialize(unsigned char*);
+ HyphenDict *hnj_hyphen_new();
+ void hnj_hyphen_load(HyphenDict * dict, const unsigned char *fn);
+ void hnj_hyphen_free(HyphenDict * dict);
+ void hnj_hyphen_clear(HyphenDict * dict);
+ void hnj_hyphen_hyphenate(HyphenDict * dict, halfword first, halfword last,
+ int size, halfword left, halfword right,
+ lang_variables * lan);
+ unsigned char *hnj_serialize(HyphenDict *);
+ void hnj_free_serialize(unsigned char *);
-#ifdef __cplusplus
+# ifdef __cplusplus
}
-#endif /* __cplusplus */
-
-#endif /* __HYPHEN_H__ */
+# endif /* __cplusplus */
+#endif /* __HYPHEN_H__ */
diff --git a/Build/source/texk/web2c/luatexdir/image/epdf.c b/Build/source/texk/web2c/luatexdir/image/epdf.c
index 071181f17bd..05ba93fdcf2 100644
--- a/Build/source/texk/web2c/luatexdir/image/epdf.c
+++ b/Build/source/texk/web2c/luatexdir/image/epdf.c
@@ -1,32 +1,32 @@
-/*
-Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
+/* epdf.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id: epdf.c 1012 2008-02-14 00:00:57Z oneiros $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
-
#include <kpathsea/c-vararg.h>
#include <kpathsea/c-proto.h>
#include <string.h>
+static const char _svn_version[] =
+ "$Id: epdf.c 1407 2008-07-15 10:49:28Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/image/epdf.c $";
+
extern void epdf_check_mem(void);
extern void register_fd_entry(fd_entry *);
@@ -37,7 +37,7 @@ int is_subsetable(fm_entry * fm)
return is_subsetted(fm);
}
-fd_entry *epdf_create_fontdescriptor(fm_entry * fm)
+fd_entry *epdf_create_fontdescriptor(fm_entry * fm, int stemV)
{
fd_entry *fd;
if ((fd = lookup_fd_entry(fm->ff_name, fm->slant, fm->extend)) == NULL) {
@@ -48,7 +48,9 @@ fd_entry *epdf_create_fontdescriptor(fm_entry * fm)
fd->fd_objnum = pdf_new_objnum();
assert(fm->ps_name != NULL);
fd->fontname = xstrdup(fm->ps_name); /* just fallback */
- /* preset_fontmetrics (fo->fd, f); */
+ // stemV must be copied
+ fd->font_dim[STEMV_CODE].val = stemV;
+ fd->font_dim[STEMV_CODE].set = true;
fd->gl_tree = avl_create(comp_string_entry, NULL, &avl_xallocator);
assert(fd->gl_tree != NULL);
}
diff --git a/Build/source/texk/web2c/luatexdir/image/epdf.h b/Build/source/texk/web2c/luatexdir/image/epdf.h
index 93a9e1c45eb..d079c4c98c4 100644
--- a/Build/source/texk/web2c/luatexdir/image/epdf.h
+++ b/Build/source/texk/web2c/luatexdir/image/epdf.h
@@ -1,24 +1,24 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* epdf.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-$Id: epdf.h 1125 2008-03-25 19:36:52Z hhenkel $
-*/
+/* $Id: epdf.h 2073 2009-03-21 10:06:50Z hhenkel $ */
extern "C" {
@@ -45,12 +45,13 @@ extern "C" {
#include <web2c/luatexdir/ptexmac.h>
#include "openbsd-compat.h"
#include "image.h"
-#include "../avlstuff.h"
+#include "../utils/avlstuff.h"
/* #-define pdfbufsize pdfbufmax */
extern integer epdf_page_box;
extern void *epdf_xref;
+ extern integer epdf_lastGroupObjectNum;
extern integer pdf_box_spec_media;
extern integer pdf_box_spec_crop;
@@ -58,14 +59,15 @@ extern "C" {
extern integer pdf_box_spec_trim;
extern integer pdf_box_spec_art;
- extern integer pdf_stream_length;
- extern integer pdf_ptr;
+ extern longinteger pdf_stream_length;
+ extern longinteger pdf_ptr;
extern integer pool_ptr;
typedef unsigned char eight_bits;
extern eight_bits *pdf_buf;
extern integer pdf_buf_size;
extern integer pdf_os_mode;
extern eight_bits pdf_last_byte;
+ extern integer fixed_inclusion_copy_font;
extern char notdef[];
@@ -94,6 +96,7 @@ extern "C" {
__attribute__ ((format(printf, 1, 2)))
extern void tex_printf(const char *, ...);
extern void write_epdf(image_dict *);
+ extern void write_additional_epdf_objects(void);
extern void zpdf_begin_dict(integer, bool);
extern void zpdf_begin_obj(integer, bool);
extern void zpdf_create_obj(integer, integer);
@@ -102,7 +105,7 @@ extern "C" {
/* epdf.c */
extern void epdf_mark_glyphs(struct fd_entry *, char *);
- extern struct fd_entry *epdf_create_fontdescriptor(struct fm_entry *);
+ extern struct fd_entry *epdf_create_fontdescriptor(struct fm_entry *, int);
extern int get_fd_objnum(struct fd_entry *);
extern int get_fn_objnum(struct fd_entry *);
diff --git a/Build/source/texk/web2c/luatexdir/image/image.h b/Build/source/texk/web2c/luatexdir/image/image.h
index 33f09274433..7d9bb8b0e00 100644
--- a/Build/source/texk/web2c/luatexdir/image/image.h
+++ b/Build/source/texk/web2c/luatexdir/image/image.h
@@ -1,23 +1,24 @@
-/*
-Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
+/* image.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: image.h 1125 2008-03-25 19:36:52Z hhenkel $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: image.h 1407 2008-07-15 10:49:28Z taco $ */
#ifndef IMAGE_H
# define IMAGE_H
@@ -34,6 +35,7 @@ $Id: image.h 1125 2008-03-25 19:36:52Z hhenkel $
extern integer zround(double); /* from zround.c */
# define bp2int(p) zround(p * (one_hundred_bp / 100.0))
+# define int2bp(i) (i * 100.0 / one_hundred_bp)
# define TYPE_IMG "image"
# define TYPE_IMG_DICT "image-dict"
@@ -43,6 +45,10 @@ extern integer zround(double); /* from zround.c */
/**********************************************************************/
typedef struct {
+ char *stream;
+} pdf_stream_struct;
+
+typedef struct {
png_structp png_ptr;
png_infop info_ptr;
} png_img_struct;
@@ -52,21 +58,21 @@ typedef struct {
JPG_UINT32 length; /* length of file/data */
} jpg_img_struct;
-#if 0
+# if 0
typedef struct { /* currently unused */
} jb2_img_struct;
-#endif
+# endif
typedef enum { DICT_NEW, /* fresh dictionary */
DICT_FILESCANNED, /* image file scanned */
DICT_REFERED, /* pdf_refximage_node in node list --> read-only dict */
DICT_OUTIMG, /* /Im* appears in pagestream */
- DICT_SCHEDULED, /* image dict scheduled for writing */
+ DICT_SCHEDULED, /* image dict scheduled for writing (PONR) */
DICT_WRITTEN /* image dict written to file */
} dict_state;
-typedef enum { IMAGE_TYPE_NONE, IMAGE_TYPE_PDF, IMAGE_TYPE_PNG, IMAGE_TYPE_JPG,
- IMAGE_TYPE_JBIG2, IMAGE_TYPE_SENTINEL
+typedef enum { IMG_TYPE_NONE, IMG_TYPE_PDF, IMG_TYPE_PNG, IMG_TYPE_JPG,
+ IMG_TYPE_JBIG2, IMG_TYPE_PDFSTREAM, IMG_TYPE_SENTINEL
} imgtype_e;
typedef enum { IMG_KEEPOPEN, IMG_CLOSEINBETWEEN } img_readtype_e;
@@ -87,7 +93,9 @@ typedef struct {
integer y_orig;
integer x_res; /* pixel resolution as in JPG/PNG/JBIG2 file */
integer y_res;
+ integer rotation; /* rotation (multiples of 90 deg.) for PDF files */
integer colorspace; /* number of /ColorSpace object */
+ integer group_ref; /* if it's <=0, the page has no group */
integer total_pages;
integer page_num; /* requested page (by number) */
char *pagename; /* requested page (by name) */
@@ -99,8 +107,11 @@ typedef struct {
int color_space; /* used color space. See JPG_ constants */
int color_depth; /* color depth */
pdfboxspec_e page_box_spec; /* PDF page box spec.: media/crop/bleed/trim/art */
+ integer bbox[4];
dict_state state;
+ integer flags;
union {
+ pdf_stream_struct *pdfstream;
png_img_struct *png;
jpg_img_struct *jpg;
/* jb2_img_struct *jb2; */
@@ -115,7 +126,9 @@ typedef struct {
# define img_yorig(N) ((N)->y_orig)
# define img_xres(N) ((N)->x_res)
# define img_yres(N) ((N)->y_res)
+# define img_rotation(N) ((N)->rotation)
# define img_colorspace(N) ((N)->colorspace)
+# define img_group_ref(N) ((N)->group_ref)
# define img_totalpages(N) ((N)->total_pages)
# define img_pagenum(N) ((N)->page_num)
# define img_pagename(N) ((N)->pagename)
@@ -127,8 +140,12 @@ typedef struct {
# define img_color(N) ((N)->color_space)
# define img_colordepth(N) ((N)->color_depth)
# define img_pagebox(N) ((N)->page_box_spec)
+# define img_bbox(N) ((N)->bbox)
# define img_state(N) ((N)->state)
+# define img_pdfstream_ptr(N) ((N)->img_struct.pdfstream)
+# define img_pdfstream_stream(N) ((N)->img_struct.pdfstream->stream)
+
# define img_png_ptr(N) ((N)->img_struct.png)
# define img_png_png_ptr(N) ((N)->img_struct.png->png_ptr)
# define img_png_info_ptr(N) ((N)->img_struct.png->info_ptr)
@@ -138,6 +155,12 @@ typedef struct {
# define img_jb2_ptr(N) ((N)->img_struct.jb2)
+# define F_FLAG_BBOX (1 << 0)
+
+# define img_set_bbox(N) (img_flags(N) |= F_FLAG_BBOX)
+# define img_unset_bbox(N) (img_flags(N) &= ~F_FLAG_BBOX)
+# define img_is_bbox(N) ((img_flags(N) & F_FLAG_BBOX) != 0)
+
/**********************************************************************/
typedef struct {
@@ -147,6 +170,7 @@ typedef struct {
integer transform;
integer flags;
image_dict *dict;
+ int array_idx; /* index within img_array */
int dict_ref; /* luaL_ref() reference */
} image;
@@ -156,18 +180,17 @@ typedef struct {
# define img_transform(N) ((N)->transform)
# define img_flags(N) ((N)->flags)
# define img_dict(N) ((N)->dict)
+# define img_arrayidx(N) ((N)->array_idx)
# define img_dictref(N) ((N)->dict_ref)
-# define F_FLAG_SCALED 0x01
-# define F_FLAG_REFERED 0x02
+# define img_is_refered(N) (img_arrayidx(N) != -1)
+
+# define F_FLAG_SCALED (1 << 0)
# define img_flags(N) ((N)->flags)
# define img_set_scaled(N) (img_flags(N) |= F_FLAG_SCALED)
-# define img_set_refered(N) (img_flags(N) |= F_FLAG_REFERED)
# define img_unset_scaled(N) (img_flags(N) &= ~F_FLAG_SCALED)
-# define img_unset_refered(N) (img_flags(N) &= ~F_FLAG_REFERED)
# define img_is_scaled(N) ((img_flags(N) & F_FLAG_SCALED) != 0)
-# define img_is_refered(N) ((img_flags(N) & F_FLAG_REFERED) != 0)
# define set_wd_running(N) (img_width(N) = null_flag)
# define set_ht_running(N) (img_height(N) = null_flag)
@@ -180,6 +203,9 @@ typedef struct {
/* writeimg.c */
+void new_img_pdfstream_struct(image_dict *);
+void check_pdfstream_dict(image_dict *);
+void write_pdfstream(image_dict *);
image *new_image();
image_dict *new_image_dict();
void init_image(image *);
@@ -206,6 +232,9 @@ void write_jpg(image_dict *);
void write_jbig2(image_dict *);
void write_epdf(image_dict *);
+extern void write_additional_epdf_objects(void);
+extern void write_additional_png_objects(void);
+
/* pdftoepdf.cc */
void unrefPdfDocument(char *);
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
index 81b74369bb9..663e37d073b 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
@@ -1,24 +1,22 @@
-/*
-Copyright 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* pdftoepdf.cc
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id: pdftoepdf.cc 1129 2008-03-27 19:43:44Z hhenkel $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <math.h>
@@ -46,24 +44,14 @@ $Id: pdftoepdf.cc 1129 2008-03-27 19:43:44Z hhenkel $
#include "epdf.h"
+static const char _svn_version[] =
+ "$Id: pdftoepdf.cc 1539 2008-10-06 09:52:07Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/image/pdftoepdf.cc $";
+
#define one_hundred_bp 6578176 /* 7227 * 65536 / 72 */
// This file is mostly C and not very much C++; it's just used to interface
// the functions of xpdf, which happens to be written in C++.
-// Used flags below:
-// PDFTEX_COPY_PAGEGROUP
-// If pdfTeX should copy a page group (a new feature in PDF 1.4 for
-// transparency) of an included file. The current support for this is
-// most likely broken. pdfTeX will at least give a warning if this flag
-// is not set. Surprisingly Acrobat and Jaws display files without a
-// page group correctly, so it might be safe to not set the flag.
-// See also PDFTEX_COPY_PAGEGROUP_NOFAIL.
-// PDFTEX_COPY_PAGEGROUP_NOFAIL
-// If set to false, pdfTeX will treat a page group in an included file
-// as an error and abort gracefully. This is only evaluated if
-// PDFTEX_COPY_PAGEGROUP is set.
-
// The prefix "PTEX" for the PDF keys is special to pdfTeX;
// this has been registered with Adobe by Hans Hagen.
@@ -75,6 +63,7 @@ $Id: pdftoepdf.cc 1129 2008-03-27 19:43:44Z hhenkel $
// and &obj to get a pointer to the object.
// It is no longer necessary to call Object::free explicitely.
+/* *INDENT-OFF* */
class PdfObject {
public:
PdfObject() { // nothing
@@ -94,6 +83,7 @@ class PdfObject {
public:
Object iObject;
};
+/* *INDENT-ON* */
// When copying the Resources of the selected page, all objects are copied
// recusively top-down. Indirect objects however are not fetched during
@@ -123,6 +113,8 @@ static XRef *xref = NULL;
static InObj *inObjList = NULL;
static UsedEncoding *encodingList;
static GBool isInit = gFalse;
+static bool groupIsIndirect;
+static PdfObject lastGroup;
//**********************************************************************
// Maintain AVL tree of open embedded PDF files
@@ -290,13 +282,28 @@ static void copyName(char *s)
pdf_puts("/");
for (; *s != 0; s++) {
if (isdigit(*s) || isupper(*s) || islower(*s) || *s == '_' ||
- *s == '.' || *s == '-')
+ *s == '.' || *s == '-' || *s == '+')
pdfout(*s);
else
pdf_printf("#%.2X", *s & 0xFF);
}
}
+static int getNewObjectNumber(Ref ref)
+{
+ InObj *p;
+ if (inObjList == 0) {
+ pdftex_fail("No objects copied yet");
+ } else {
+ for (p = inObjList; p != 0; p = p->next) {
+ if (p->ref.num == ref.num && p->ref.gen == ref.gen) {
+ return p->num;
+ }
+ }
+ pdftex_fail("Object not yet copied: %i %i", ref.num, ref.gen);
+ }
+}
+
static void copyObject(Object *);
static void copyDictEntry(Object * obj, int i)
@@ -347,9 +354,10 @@ static void copyStream(Stream * str)
{
int c;
str->reset();
- while ((c = str->getChar()) != EOF)
+ while ((c = str->getChar()) != EOF) {
pdfout(c);
- pdf_last_byte = pdf_buf[pdf_ptr - 1];
+ pdf_last_byte = c;
+ }
}
static void copyProcSet(Object * obj)
@@ -376,7 +384,7 @@ static void copyProcSet(Object * obj)
static void copyFont(char *tag, Object * fontRef)
{
PdfObject fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
- fontfile, ffsubtype;
+ fontfile, ffsubtype, stemV;
GfxFont *gfont;
fd_entry *fd;
fm_entry *fontmap;
@@ -392,7 +400,7 @@ static void copyFont(char *tag, Object * fontRef)
}
// Only handle included Type1 (and Type1C) fonts; anything else will be copied.
// Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true.
- if (fixed_replace_font && fontRef->fetch(xref, &fontdict)->isDict()
+ if (!fixed_inclusion_copy_font && fontRef->fetch(xref, &fontdict)->isDict()
&& fontdict->dictLookup("Subtype", &subtype)->isName()
&& !strcmp(subtype->getName(), "Type1")
&& fontdict->dictLookup("BaseFont", &basefont)->isName()
@@ -405,7 +413,9 @@ static void copyFont(char *tag, Object * fontRef)
&ffsubtype)->isName()
&& !strcmp(ffsubtype->getName(), "Type1C")))
&& (fontmap = lookup_fontmap(basefont->getName())) != NULL) {
- fd = epdf_create_fontdescriptor(fontmap);
+ // copy the value of /StemV
+ fontdesc->dictLookup("StemV", &stemV);
+ fd = epdf_create_fontdescriptor(fontmap, stemV->getInt());
if (fontdesc->dictLookup("CharSet", &charset) &&
charset->isString() && is_subsetable(fontmap))
epdf_mark_glyphs(fd, charset->getString()->getCString());
@@ -579,16 +589,16 @@ static void copyObject(Object * obj)
copyDict(&obj1);
pdf_puts(">>\n");
pdf_puts("stream\n");
- copyStream(obj->getStream()->getBaseStream());
+ copyStream(obj->getStream()->getUndecodedStream());
if (pdf_last_byte != '\n')
pdf_puts("\n");
pdf_puts("endstream"); // can't simply write pdf_end_stream()
} else if (obj->isRef()) {
ref = obj->getRef();
if (ref.num == 0) {
- pdftex_warn
- ("PDF inclusion: reference to invalid object was replaced by <null>");
- pdf_puts("null");
+ pdftex_fail
+ ("PDF inclusion: reference to invalid object"
+ " (is the included pdf broken?)");
} else
pdf_printf("%d 0 R", addOther(ref));
} else {
@@ -633,8 +643,9 @@ static void writeEncodings()
for (r = encodingList; r != NULL; r = r->next) {
for (i = 0; i < 256; i++) {
if (r->font->isCIDFont()) {
- pdftex_warn
- ("PDF inclusion: CID font included, encoding maybe wrong");
+ pdftex_fail
+ ("PDF inclusion: CID fonts are not supported"
+ " (try to disable font replacement to fix this)");
}
if ((s = ((Gfx8BitFont *) r->font)->getCharName(i)) != NULL)
glyphNames[i] = s;
@@ -684,10 +695,9 @@ read_pdf_info(image_dict * idict, integer minor_pdf_version_wanted,
Page *page;
int rotate;
PDFRectangle *pagebox;
- float pdf_version_found, pdf_version_wanted, pdf_width, pdf_height,
- pdf_xorig, pdf_yorig;
+ float pdf_version_found, pdf_version_wanted, xsize, ysize, xorig, yorig;
assert(idict != NULL);
- assert(img_type(idict) == IMAGE_TYPE_PDF);
+ assert(img_type(idict) == IMG_TYPE_PDF);
// initialize
if (isInit == gFalse) {
globalParams = new GlobalParams();
@@ -733,49 +743,75 @@ read_pdf_info(image_dict * idict, integer minor_pdf_version_wanted,
pdftex_fail("PDF inclusion: required page <%i> does not exist",
(int) img_pagenum(idict));
}
+ pdf_doc->xref = pdf_doc->doc->getXRef();
// get the required page
page = pdf_doc->doc->getCatalog()->getPage(img_pagenum(idict));
// get the pagebox (media, crop...) to use.
pagebox = get_pagebox(page, img_pagebox(idict));
if (pagebox->x2 > pagebox->x1) {
- pdf_xorig = pagebox->x1;
- pdf_width = pagebox->x2 - pagebox->x1;
+ xorig = pagebox->x1;
+ xsize = pagebox->x2 - pagebox->x1;
} else {
- pdf_xorig = pagebox->x2;
- pdf_width = pagebox->x1 - pagebox->x2;
+ xorig = pagebox->x2;
+ xsize = pagebox->x1 - pagebox->x2;
}
if (pagebox->y2 > pagebox->y1) {
- pdf_yorig = pagebox->y1;
- pdf_height = pagebox->y2 - pagebox->y1;
+ yorig = pagebox->y1;
+ ysize = pagebox->y2 - pagebox->y1;
} else {
- pdf_yorig = pagebox->y2;
- pdf_height = pagebox->y1 - pagebox->y2;
+ yorig = pagebox->y2;
+ ysize = pagebox->y1 - pagebox->y2;
}
-
+ // The following 4 parameters are raw. Do _not_ modify by /Rotate!
+ img_xsize(idict) = bp2int(xsize);
+ img_ysize(idict) = bp2int(ysize);
+ img_xorig(idict) = bp2int(xorig);
+ img_yorig(idict) = bp2int(yorig);
+
+ // Handle /Rotate parameter. Only multiples of 90 deg. are allowed
+ // (PDF Ref. v1.3, p. 78).
rotate = page->getRotate();
- // handle page rotation and adjust dimens as needed
- if (rotate != 0) {
- // handle only the simple case: multiple of 90s.
- // these are the only values allowed according to the
- // reference (v1.3, p. 78).
- // 180 needs no special treatment here
- register float f;
- switch (rotate % 360) {
- case 90:
- case 270:
- f = pdf_height;
- pdf_height = pdf_width;
- pdf_width = f;
- break;
- default:;
+ switch (((rotate % 360) + 360) % 360) { // handles also neg. angles
+ case 0:
+ img_rotation(idict) = 0;
+ break;
+ case 90:
+ img_rotation(idict) = 3; // PDF counts clockwise!
+ break;
+ case 180:
+ img_rotation(idict) = 2;
+ break;
+ case 270:
+ img_rotation(idict) = 1;
+ break;
+ default:
+ pdftex_warn
+ ("PDF inclusion: "
+ "/Rotate parameter in PDF file not multiple of 90 degrees.");
+ }
+ if (page->getGroup() != NULL) {
+ initDictFromDict(lastGroup, page->getGroup());
+ if (lastGroup->dictGetLength() > 0) {
+ groupIsIndirect = lastGroup->isRef();
+ if (groupIsIndirect) {
+ // FIXME: Here we already copy the object. It would be
+ // better to do this only after write_epdf, otherwise we
+ // may copy ununsed /Group objects
+ copyObject(&lastGroup);
+ epdf_lastGroupObjectNum =
+ getNewObjectNumber(lastGroup->getRef());
+ } else {
+ // make the group an indirect object; copying is done later
+ // by write_additional_epdf_objects after write_epdf
+ epdf_lastGroupObjectNum = pdf_new_objnum();
+ }
+ pdf_puts("\n");
}
+ } else {
+ epdf_lastGroupObjectNum = 0;
}
- pdf_doc->xref = pdf_doc->doc->getXRef();
- img_xsize(idict) = bp2int(pdf_width);
- img_ysize(idict) = bp2int(pdf_height);
- img_xorig(idict) = bp2int(pdf_xorig);
- img_yorig(idict) = bp2int(pdf_yorig);
+
}
// Writes the current epf_doc.
@@ -786,22 +822,19 @@ static void write_epdf1(image_dict * idict)
{
Page *page;
PdfObject contents, obj1, obj2;
- PdfObject group, metadata, pieceinfo, separationInfo;
+ PdfObject metadata, pieceinfo, separationInfo;
Object info;
char *key;
char s[256];
int i, l;
- int rotate;
- double scale[6] = { 0, 0, 0, 0, 0, 0 };
- bool writematrix = false;
PdfDocument *pdf_doc = (PdfDocument *) findPdfDocument(img_filepath(idict));
assert(pdf_doc != NULL);
xref = pdf_doc->xref;
inObjList = pdf_doc->inObjList;
encodingList = NULL;
page = pdf_doc->doc->getCatalog()->getPage(img_pagenum(idict));
- rotate = page->getRotate();
PDFRectangle *pagebox;
+ float bbox[4];
// write the Page header
pdf_puts("/Type /XObject\n/Subtype /Form\n");
if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0)
@@ -819,73 +852,35 @@ static void write_epdf1(image_dict * idict)
pdf_printf("/%s.InfoDict ", pdfkeyprefix);
pdf_printf("%d 0 R\n", addOther(info.getRef()));
}
- // get the pagebox (media, crop...) to use.
- pagebox = get_pagebox(page, img_pagebox(idict));
-
- // handle page rotation
- if (rotate != 0) {
- // this handles only the simple case: multiple of 90s but these
- // are the only values allowed according to the reference
- // (v1.3, p. 78).
- // the image is rotated around its center.
- // the /Rotate key is clockwise while the matrix is
- // counterclockwise :-%
- tex_printf(", page is rotated %d degrees", rotate);
- switch (rotate % 360) {
- case 90:
- scale[1] = -1;
- scale[2] = 1;
- scale[4] = pagebox->x1 - pagebox->y1;
- scale[5] = pagebox->y1 + pagebox->x2;
- writematrix = true;
- break;
- case 180:
- scale[0] = scale[3] = -1;
- scale[4] = pagebox->x1 + pagebox->x2;
- scale[5] = pagebox->y1 + pagebox->y2;
- writematrix = true;
- break; // width and height are exchanged
- case 270:
- scale[1] = 1;
- scale[2] = -1;
- scale[4] = pagebox->x1 + pagebox->y2;
- scale[5] = pagebox->y1 - pagebox->x1;
- writematrix = true;
- break;
- default:;
- }
- if (writematrix) { // The matrix is only written if the image is rotated.
- sprintf(s, "/Matrix [%.8f %.8f %.8f %.8f %.8f %.8f]\n",
- scale[0], scale[1], scale[2], scale[3], scale[4], scale[5]);
- pdf_printf(stripzeros(s));
- }
+ if (img_is_bbox(idict)) {
+ bbox[0] = int2bp(img_bbox(idict)[0]);
+ bbox[1] = int2bp(img_bbox(idict)[1]);
+ bbox[2] = int2bp(img_bbox(idict)[2]);
+ bbox[3] = int2bp(img_bbox(idict)[3]);
+ } else {
+ // get the pagebox (media, crop...) to use.
+ pagebox = get_pagebox(page, img_pagebox(idict));
+ bbox[0] = pagebox->x1;
+ bbox[1] = pagebox->y1;
+ bbox[2] = pagebox->x2;
+ bbox[3] = pagebox->y2;
}
-
- sprintf(s, "/BBox [%.8f %.8f %.8f %.8f]\n",
- pagebox->x1, pagebox->y1, pagebox->x2, pagebox->y2);
- pdf_printf(stripzeros(s));
+ sprintf(s, "/BBox [%.8f %.8f %.8f %.8f]\n", bbox[0], bbox[1], bbox[2],
+ bbox[3]);
+ pdf_puts(stripzeros(s));
+ // The /Matrix calculation is replaced by transforms in out_img().
// write the page Group if it's there
- if (page->getGroup() != NULL) {
-#if PDFTEX_COPY_PAGEGROUP
-# if PDFTEX_COPY_PAGEGROUP_NOFAIL
- // FIXME: This will most likely produce incorrect PDFs :-(
- initDictFromDict(group, page->getGroup());
- if (group->dictGetLength() > 0) {
+ if (epdf_lastGroupObjectNum > 0) {
+ if (page->getGroup() != NULL) {
+ initDictFromDict(lastGroup, page->getGroup());
+ if (lastGroup->dictGetLength() > 0) {
pdf_puts("/Group ");
- copyObject(&group);
+ groupIsIndirect = lastGroup->isRef();
+ pdf_printf("%d 0 R", epdf_lastGroupObjectNum);
pdf_puts("\n");
}
-# else
- // FIXME: currently we don't know how to handle Page Groups so we abort gracefully :-(
- pdftex_fail
- ("PDF inclusion: Page Group detected which luatex can't handle. Sorry.");
-# endif
-#else
- // FIXME: currently we don't know how to handle Page Groups so we at least give a warning :-(
- pdftex_warn
- ("PDF inclusion: Page Group detected which luatex can't handle. Ignoring it.");
-#endif
+ }
}
// write the page Metadata if it's there
if (page->getMetadata() != NULL) {
@@ -903,6 +898,11 @@ static void write_epdf1(image_dict * idict)
pdf_puts("\n");
}
}
+ // copy LastModified (needed when PieceInfo is there)
+ if (page->getLastModified() != NULL) {
+ pdf_printf("/LastModified (%s)\n",
+ page->getLastModified()->getCString());
+ }
// write the page SeparationInfo if it's there
if (page->getSeparationInfo() != NULL) {
initDictFromDict(separationInfo, page->getSeparationInfo());
@@ -915,13 +915,10 @@ static void write_epdf1(image_dict * idict)
// write the Resources dictionary
if (page->getResourceDict() == NULL) {
// Resources can be missing (files without them have been spotted
- // in the wild). This violates the PDF Ref., which claims they are
- // required, but all RIPs accept them.
- // We "replace" them with empty /Resources, although in form xobjects
- // /Resources are not required.
+ // in the wild); in which case the /Resouces of the /Page will be used.
+ // "This practice is not recommended".
pdftex_warn
- ("PDF inclusion: no /Resources detected. Replacing with empty /Resources.");
- pdf_puts("/Resources <<>>\n");
+ ("PDF inclusion: /Resources missing. 'This practice is not recommended' (PDF Ref)");
} else {
initDictFromDict(obj1, page->getResourceDict());
page->getResourceDict()->incRef();
@@ -944,9 +941,36 @@ static void write_epdf1(image_dict * idict)
// write the page contents
page->getContents(&contents);
if (contents->isStream()) {
- initDictFromDict(obj1, contents->streamGetDict());
- contents->streamGetDict()->incRef();
- copyDict(&obj1);
+ // Variant A: get stream and recompress under control
+ // of \pdfcompresslevel
+ //
+ // pdfbeginstream();
+ // copyStream(contents->getStream());
+ // pdfendstream();
+
+ // Variant B: copy stream without recompressing
+ //
+ contents->streamGetDict()->lookup("F", &obj1);
+ if (!obj1->isNull()) {
+ pdftex_fail("PDF inclusion: Unsupported external stream");
+ }
+ contents->streamGetDict()->lookup("Length", &obj1);
+ assert(!obj1->isNull());
+ pdf_puts("/Length ");
+ copyObject(&obj1);
+ pdf_puts("\n");
+ contents->streamGetDict()->lookup("Filter", &obj1);
+ if (!obj1->isNull()) {
+ pdf_puts("/Filter ");
+ copyObject(&obj1);
+ pdf_puts("\n");
+ contents->streamGetDict()->lookup("DecodeParms", &obj1);
+ if (!obj1->isNull()) {
+ pdf_puts("/DecodeParms ");
+ copyObject(&obj1);
+ pdf_puts("\n");
+ }
+ }
pdf_puts(">>\nstream\n");
copyStream(contents->getStream()->getBaseStream());
pdf_end_stream();
@@ -1013,3 +1037,14 @@ void epdf_check_mem()
delete globalParams;
isInit = gFalse;
}
+
+// Called after the xobject generated by write_epdf has been finished; used to
+// write out objects that have been made indirect
+void write_additional_epdf_objects(void)
+{
+ if ((epdf_lastGroupObjectNum > 0) && !groupIsIndirect) {
+ zpdf_begin_obj(epdf_lastGroupObjectNum, 2);
+ copyObject(&lastGroup);
+ pdf_end_obj();
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.c b/Build/source/texk/web2c/luatexdir/image/writeimg.c
index 79c3445945d..b105f507b42 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.c
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.c
@@ -1,24 +1,22 @@
-/*
-Copyright (c) 1996-2002, 2005 Han The Thanh, <thanh@pdftex.org>
+/* writeimg.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
-pdfTeX is free software;
-you can redistribute it and / or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: writeimg.c 1152 2008-04-13 22:29:59Z hhenkel $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
#include "ptexlib.h"
@@ -30,8 +28,13 @@ $Id: writeimg.c 1152 2008-04-13 22:29:59Z hhenkel $
#include <../lua51/lua.h>
#include <../lua51/lauxlib.h>
+static const char _svn_version[] =
+ "$Id: writeimg.c 2019 2009-03-14 00:15:58Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/image/writeimg.c $";
+
extern void pdf_print_real(integer m, integer d);
+extern pdfstructure *pstruct;
+
#define obj_aux(A) obj_tab[(A)].int4
/**********************************************************************/
@@ -104,9 +107,9 @@ extern void pdf_print_real(integer m, integer d);
standard extension.
Functions "check_type_by_header" and "check_type_by_extension":
- img_type(img) is set to IMAGE_TYPE_NONE by new_image_dict().
+ img_type(img) is set to IMG_TYPE_NONE by new_image_dict().
Both functions try to detect a type and set img_type(img).
- Thus a value other than IMAGE_TYPE_NONE indicates that a
+ Thus a value other than IMG_TYPE_NONE indicates that a
type has been found.
*/
@@ -116,6 +119,8 @@ extern void pdf_print_real(integer m, integer d);
#define HEADER_PDF "%PDF-1."
#define MAX_HEADER (sizeof(HEADER_PNG)-1)
+integer epdf_lastGroupObjectNum;
+
static void check_type_by_header(image_dict * idict)
{
int i;
@@ -123,7 +128,7 @@ static void check_type_by_header(image_dict * idict)
char header[MAX_HEADER];
assert(idict != NULL);
- if (img_type(idict) != IMAGE_TYPE_NONE) /* nothing to do */
+ if (img_type(idict) != IMG_TYPE_NONE) /* nothing to do */
return;
/* read the header */
file = xfopen(img_filepath(idict), FOPEN_RBIN_MODE);
@@ -135,13 +140,13 @@ static void check_type_by_header(image_dict * idict)
xfclose(file, img_filepath(idict));
/* tests */
if (strncmp(header, HEADER_JPG, sizeof(HEADER_JPG) - 1) == 0)
- img_type(idict) = IMAGE_TYPE_JPG;
+ img_type(idict) = IMG_TYPE_JPG;
else if (strncmp(header, HEADER_PNG, sizeof(HEADER_PNG) - 1) == 0)
- img_type(idict) = IMAGE_TYPE_PNG;
+ img_type(idict) = IMG_TYPE_PNG;
else if (strncmp(header, HEADER_JBIG2, sizeof(HEADER_JBIG2) - 1) == 0)
- img_type(idict) = IMAGE_TYPE_JBIG2;
+ img_type(idict) = IMG_TYPE_JBIG2;
else if (strncmp(header, HEADER_PDF, sizeof(HEADER_PDF) - 1) == 0)
- img_type(idict) = IMAGE_TYPE_PDF;
+ img_type(idict) = IMG_TYPE_PDF;
}
static void check_type_by_extension(image_dict * idict)
@@ -149,21 +154,31 @@ static void check_type_by_extension(image_dict * idict)
char *image_suffix;
assert(idict != NULL);
- if (img_type(idict) != IMAGE_TYPE_NONE) /* nothing to do */
+ if (img_type(idict) != IMG_TYPE_NONE) /* nothing to do */
return;
/* tests */
if ((image_suffix = strrchr(img_filename(idict), '.')) == 0)
- img_type(idict) = IMAGE_TYPE_NONE;
+ img_type(idict) = IMG_TYPE_NONE;
else if (strcasecmp(image_suffix, ".png") == 0)
- img_type(idict) = IMAGE_TYPE_PNG;
+ img_type(idict) = IMG_TYPE_PNG;
else if (strcasecmp(image_suffix, ".jpg") == 0 ||
strcasecmp(image_suffix, ".jpeg") == 0)
- img_type(idict) = IMAGE_TYPE_JPG;
+ img_type(idict) = IMG_TYPE_JPG;
else if (strcasecmp(image_suffix, ".jbig2") == 0 ||
strcasecmp(image_suffix, ".jb2") == 0)
- img_type(idict) = IMAGE_TYPE_JBIG2;
+ img_type(idict) = IMG_TYPE_JBIG2;
else if (strcasecmp(image_suffix, ".pdf") == 0)
- img_type(idict) = IMAGE_TYPE_PDF;
+ img_type(idict) = IMG_TYPE_PDF;
+}
+
+/**********************************************************************/
+
+void new_img_pdfstream_struct(image_dict * p)
+{
+ assert(p != NULL);
+ assert(img_pdfstream_ptr(p) == NULL);
+ img_pdfstream_ptr(p) = xtalloc(1, pdf_stream_struct);
+ img_pdfstream_stream(p) = NULL;
}
/**********************************************************************/
@@ -176,9 +191,9 @@ void init_image(image * p)
set_dp_running(p);
img_transform(p) = 0;
img_flags(p) = 0;
- img_unset_refered(p); /* wd/ht/dp may be modified */
img_unset_scaled(p);
img_dict(p) = NULL;
+ img_arrayidx(p) = -1; /* -1 = unused, used count from 0 */
img_dictref(p) = LUA_NOREF;
}
@@ -200,7 +215,9 @@ void init_image_dict(image_dict * p)
img_yorig(p) = 0;
img_xres(p) = 0;
img_yres(p) = 0;
+ img_rotation(p) = 0;
img_colorspace(p) = 0;
+ img_group_ref(p) = 0;
img_totalpages(p) = 0;
img_pagenum(p) = 1;
img_pagename(p) = NULL;
@@ -208,10 +225,15 @@ void init_image_dict(image_dict * p)
img_filepath(p) = NULL;
img_attr(p) = NULL;
img_file(p) = NULL;
- img_type(p) = IMAGE_TYPE_NONE;
+ img_type(p) = IMG_TYPE_NONE;
img_color(p) = 0;
img_colordepth(p) = 0;
img_pagebox(p) = PDF_BOX_SPEC_MEDIA;
+ img_bbox(p)[0] = 0;
+ img_bbox(p)[1] = 0;
+ img_bbox(p)[2] = 0;
+ img_bbox(p)[3] = 0;
+ img_unset_bbox(p);
img_state(p) = DICT_NEW;
img_png_ptr(p) = NULL; /* union */
}
@@ -240,21 +262,31 @@ void free_dict_strings(image_dict * p)
}
void free_image_dict(image_dict * p)
-{ /* called from limglib.c */
+{
+ if (ini_version)
+ return; /* The image may be \dump{}ed to a format */
+ /* called from limglib.c */
assert(img_state(p) < DICT_REFERED);
switch (img_type(p)) {
- case IMAGE_TYPE_PDF:
+ case IMG_TYPE_PDF:
unrefPdfDocument(img_filepath(p));
break;
- case IMAGE_TYPE_PNG: /* assuming IMG_CLOSEINBETWEEN */
+ case IMG_TYPE_PNG: /* assuming IMG_CLOSEINBETWEEN */
assert(img_png_ptr(p) == NULL);
break;
- case IMAGE_TYPE_JPG: /* assuming IMG_CLOSEINBETWEEN */
+ case IMG_TYPE_JPG: /* assuming IMG_CLOSEINBETWEEN */
assert(img_jpg_ptr(p) == NULL);
break;
- case IMAGE_TYPE_JBIG2: /* todo: writejbig2.c cleanup */
+ case IMG_TYPE_JBIG2: /* todo: writejbig2.c cleanup */
break;
- case IMAGE_TYPE_NONE:
+ case IMG_TYPE_PDFSTREAM:
+ if (img_pdfstream_ptr(p) != NULL) {
+ if (img_pdfstream_stream(p) != NULL)
+ xfree(img_pdfstream_stream(p));
+ xfree(img_pdfstream_ptr(p));
+ }
+ break;
+ case IMG_TYPE_NONE:
break;
default:
assert(0);
@@ -293,21 +325,23 @@ void read_img(image_dict * idict, integer pdf_minor_version,
}
if (img_filepath(idict) == NULL)
pdftex_fail("cannot find image file");
+ recorder_record_input(img_filename(idict));
/* type checks */
check_type_by_header(idict);
check_type_by_extension(idict);
/* read image */
switch (img_type(idict)) {
- case IMAGE_TYPE_PDF:
+ case IMG_TYPE_PDF:
read_pdf_info(idict, pdf_minor_version, pdf_inclusion_errorlevel);
+ img_group_ref(idict) = epdf_lastGroupObjectNum;
break;
- case IMAGE_TYPE_PNG:
+ case IMG_TYPE_PNG:
read_png_info(idict, IMG_CLOSEINBETWEEN);
break;
- case IMAGE_TYPE_JPG:
+ case IMG_TYPE_JPG:
read_jpg_info(idict, IMG_CLOSEINBETWEEN);
break;
- case IMAGE_TYPE_JBIG2:
+ case IMG_TYPE_JBIG2:
if (pdf_minor_version < 4) {
pdftex_fail
("JBIG2 images only possible with at least PDF 1.4; you are generating PDF 1.%i",
@@ -316,42 +350,56 @@ void read_img(image_dict * idict, integer pdf_minor_version,
read_jbig2_info(idict);
break;
default:
- pdftex_fail("internal error: unknown image type");
+ pdftex_fail("internal error: unknown image type (2)");
}
cur_file_name = NULL;
if (img_state(idict) < DICT_FILESCANNED)
img_state(idict) = DICT_FILESCANNED;
}
+// Within scale_img() only image width and height matter;
+// the offsets and positioning are not interesting here.
+// But one needs rotation info to swap width and height.
+// img_rotation() comes from the optional /Rotate key in the PDF file.
+
void scale_img(image * img)
{
- integer x, y, xr, yr; /* size and resolution of image */
- scaled w, h; /* indeed size corresponds to image resolution */
+ integer x, y, xr, yr, tmp; /* size and resolution of image */
+ scaled w = 0, h = 0; /* indeed size corresponds to image resolution */
integer default_res;
image_dict *idict;
assert(img != NULL);
idict = img_dict(img);
assert(idict != NULL);
- x = img_xsize(idict); /* dimensions, resolutions from image file */
- y = img_ysize(idict);
+ if ((img_type(idict) == IMG_TYPE_PDF
+ || img_type(idict) == IMG_TYPE_PDFSTREAM) && img_is_bbox(idict)) {
+ x = img_xsize(idict) = img_bbox(idict)[2] - img_bbox(idict)[0]; /* dimensions from image.bbox */
+ y = img_ysize(idict) = img_bbox(idict)[3] - img_bbox(idict)[1];
+ img_xorig(idict) = img_bbox(idict)[0];
+ img_yorig(idict) = img_bbox(idict)[1];
+ } else {
+ x = img_xsize(idict); /* dimensions, resolutions from image file */
+ y = img_ysize(idict);
+ }
xr = img_xres(idict);
yr = img_yres(idict);
- if ((img_transform(img) & 1) == 1) {
- int tmp = x;
+ if (x <= 0 || y <= 0 || xr < 0 || yr < 0)
+ pdftex_fail("ext1: invalid image dimensions");
+ if (xr > 65535 || yr > 65535) {
+ xr = 0;
+ yr = 0;
+ pdftex_warn("ext1: too large image resolution ignored");
+ }
+ if (((img_transform(img) - img_rotation(idict)) & 1) == 1) {
+ tmp = x;
x = y;
y = tmp;
tmp = xr;
xr = yr;
yr = tmp;
}
- if (xr > 65535 || yr > 65535) {
- xr = 0;
- yr = 0;
- pdftex_warn("ext1: too large image resolution ignored");
- }
- if (x <= 0 || y <= 0 || xr < 0 || yr < 0)
- pdftex_fail("ext1: invalid image dimensions");
- if (img_type(idict) == IMAGE_TYPE_PDF) {
+ if (img_type(idict) == IMG_TYPE_PDF
+ || img_type(idict) == IMG_TYPE_PDFSTREAM) {
w = x;
h = y;
} else {
@@ -410,41 +458,50 @@ void scale_img(image * img)
img_set_scaled(img);
}
-void out_img(image * img, scaled hpos, scaled vpos)
+void out_img(image * img, pdfstructure * p, scaledpos * pos)
{
float a[6]; /* transformation matrix */
float xoff, yoff, tmp;
int r; /* number of digits after the decimal point */
- image_dict *idict;
+ int k;
scaled wd, ht, dp;
+ scaledpos tmppos;
+ pdffloat cm[6];
+ image_dict *idict;
+ integer groupref; /* added from web for 1.40.8 */
assert(img != 0);
idict = img_dict(img);
assert(idict != 0);
wd = img_width(img);
ht = img_height(img);
dp = img_depth(img);
- if ((img_transform(img) & 1) == 1) { /* 90 deg. or 270 deg. rotated */
- if (ht == -dp)
- pdftex_fail("image transform: division by zero (height == -depth)");
- if (wd == 0)
- pdftex_fail("image transform: division by zero (width == 0)");
- }
+ a[0] = a[3] = 1.0e6;
a[1] = a[2] = 0;
- if (img_type(idict) == IMAGE_TYPE_PDF) {
- a[0] = 1.0e6 / img_xsize(idict);
- a[3] = 1.0e6 / img_ysize(idict);
+ if (img_type(idict) == IMG_TYPE_PDF
+ || img_type(idict) == IMG_TYPE_PDFSTREAM) {
+ a[0] /= img_xsize(idict);
+ a[3] /= img_ysize(idict);
+ xoff = (float) img_xorig(idict) / img_xsize(idict);
+ yoff = (float) img_yorig(idict) / img_ysize(idict);
r = 6;
} else {
- a[3] = a[0] = 1.0e6 / one_hundred_bp;
+ /* added from web for 1.40.8 */
+ if (img_type(idict) == IMG_TYPE_PNG) {
+ groupref = img_group_ref(idict);
+ if ((groupref > 0) && (pdf_page_group_val < 1))
+ pdf_page_group_val = groupref;
+ }
+ /* /added from web */
+ a[0] /= one_hundred_bp;
+ a[3] = a[0];
+ xoff = yoff = 0;
r = 4;
}
- xoff = (float) img_xorig(idict) / img_xsize(idict);
- yoff = (float) img_yorig(idict) / img_ysize(idict);
- if ((img_transform(img) & 7) > 3) { /* mirrored */
+ if ((img_transform(img) & 7) > 3) { // mirror cases
a[0] *= -1;
xoff *= -1;
}
- switch (img_transform(img) & 3) {
+ switch ((img_transform(img) + img_rotation(idict)) & 3) {
case 0: /* no transform */
break;
case 1: /* rot. 90 deg. (counterclockwise) */
@@ -477,41 +534,42 @@ void out_img(image * img, scaled hpos, scaled vpos)
a[1] *= ht + dp;
a[2] *= wd;
a[3] *= ht + dp;
- a[4] = hpos - xoff;
- a[5] = vpos - yoff;
- switch (img_transform(img) & 7) {
+ a[4] = pos->h - xoff;
+ a[5] = pos->v - yoff;
+ k = img_transform(img) + img_rotation(idict);
+ if ((img_transform(img) & 7) > 3)
+ k++;
+ switch (k & 3) {
case 0: /* no transform */
- case 7: /* mirrored, then rot. 270 deg. */
break;
case 1: /* rot. 90 deg. (counterclockwise) */
- case 4: /* mirrored, unrotated */
a[4] += wd;
break;
case 2: /* rot. 180 deg. */
- case 5: /* mirrored, then rot. 90 deg. */
a[4] += wd;
a[5] += ht + dp;
break;
case 3: /* rot. 270 deg. */
- case 6: /* mirrored, then rot. 180 deg. */
a[5] += ht + dp;
break;
default:;
}
- pdf_end_text();
+ /* the following is a kludge, TODO: use pdfpage.c functions */
+ setpdffloat(cm[0], round(a[0]), r);
+ setpdffloat(cm[1], round(a[1]), r);
+ setpdffloat(cm[2], round(a[2]), r);
+ setpdffloat(cm[3], round(a[3]), r);
+ tmppos.h = round(a[4]);
+ tmppos.v = round(a[5]);
+ (void) calc_pdfpos(p, &tmppos);
+ cm[4] = p->cm[4];
+ cm[5] = p->cm[5];
+ pdf_goto_pagemode();
+ if (pdf_page_group_val < 1)
+ pdf_page_group_val = img_group_ref(idict); /* added from web for 1.40.8 */
pdf_printf("q\n");
- pdf_print_real((integer) a[0], r);
- pdfout(' ');
- pdf_print_real((integer) a[1], r);
- pdfout(' ');
- pdf_print_real((integer) a[2], r);
- pdfout(' ');
- pdf_print_real((integer) a[3], r);
- pdfout(' ');
- pdf_print_bp((integer) a[4]);
- pdfout(' ');
- pdf_print_bp((integer) a[5]);
- pdf_printf(" cm\n/Im");
+ pdf_print_cm(cm);
+ pdf_printf("/Im");
pdf_print_int(img_index(idict));
pdf_print_resname_prefix();
pdf_printf(" Do\nQ\n");
@@ -526,23 +584,34 @@ void write_img(image_dict * idict)
if (tracefilenames)
tex_printf(" <%s", img_filepath(idict));
switch (img_type(idict)) {
- case IMAGE_TYPE_PNG:
+ case IMG_TYPE_PNG:
write_png(idict);
break;
- case IMAGE_TYPE_JPG:
+ case IMG_TYPE_JPG:
write_jpg(idict);
break;
- case IMAGE_TYPE_JBIG2:
+ case IMG_TYPE_JBIG2:
write_jbig2(idict);
break;
- case IMAGE_TYPE_PDF:
+ case IMG_TYPE_PDF:
write_epdf(idict);
+ epdf_lastGroupObjectNum = img_group_ref(idict);
+ break;
+ case IMG_TYPE_PDFSTREAM:
+ write_pdfstream(idict);
break;
default:
- pdftex_fail("internal error: unknown image type");
+ pdftex_fail("internal error: unknown image type (1)");
}
if (tracefilenames)
tex_printf(">");
+ if (img_type(idict) == IMG_TYPE_PDF) {
+ write_additional_epdf_objects();
+ } else {
+ if (img_type(idict) == IMG_TYPE_PNG) {
+ write_additional_png_objects();
+ }
+ }
}
if (img_state(idict) < DICT_WRITTEN)
img_state(idict) = DICT_WRITTEN;
@@ -550,9 +619,41 @@ void write_img(image_dict * idict)
/**********************************************************************/
+void check_pdfstream_dict(image_dict * idict)
+{
+ if (!img_is_bbox(idict))
+ pdftex_fail("image.stream: no bbox given");
+ if (img_state(idict) < DICT_FILESCANNED)
+ img_state(idict) = DICT_FILESCANNED;
+}
+
+void write_pdfstream(image_dict * idict)
+{
+ char s[256];
+ assert(img_pdfstream_ptr(idict) != NULL);
+ assert(img_is_bbox(idict));
+ pdf_puts("/Type /XObject\n/Subtype /Form\n");
+ if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0)
+ pdf_printf("%s\n", img_attr(idict));
+ pdf_puts("/FormType 1\n");
+ sprintf(s, "/BBox [%.8f %.8f %.8f %.8f]\n", int2bp(img_bbox(idict)[0]),
+ int2bp(img_bbox(idict)[1]), int2bp(img_bbox(idict)[2]),
+ int2bp(img_bbox(idict)[3]));
+ pdf_printf(stripzeros(s));
+ pdf_begin_stream();
+ if (img_pdfstream_stream(idict) != NULL)
+ pdf_puts(img_pdfstream_stream(idict));
+ pdf_end_stream();
+}
+
+/**********************************************************************/
+
typedef image *img_entry;
/* define img_ptr, img_array, & img_limit */
-define_array(img); /* array of pointers to image structures */
+/* avoid use of size_t */
+img_entry *img_ptr, *img_array = NULL;
+integer img_limit;
+
integer img_to_array(image * img)
{
@@ -562,20 +663,168 @@ integer img_to_array(image * img)
return img_ptr++ - img_array; /* now img is read-only */
}
+
+
+/**********************************************************************/
+
+/* To allow the use of \pdfrefximage inside saved boxes in -ini mode,
+ * the information in the array has to be (un)dumped with the format.
+ * The next two routines take care of that.
+ *
+ * Most of the work involved in setting up the images is simply
+ * executed again. This solves the many possible errors resulting from
+ * the split in two separate runs.
+
+ * There was only one problem remaining: The pdfversion and
+ * pdfinclusionerrorlevel can have changed inbetween the call to
+ * readimage() and dump time. That is why they are passed as arguments
+ * to undumpimagemeta once more.
+ */
+
+/* some of the dumped values are really type int, not integer,
+ * but since the macro falls back to generic_dump anyway, that
+ * does not matter.
+ */
+
+#define dumpinteger generic_dump
+#define undumpinteger generic_undump
+
+/* (un)dumping a string means dumping the allocation size, followed
+ * by the bytes. The trailing \0 is dumped as well, because that
+ * makes the code simpler.
+ */
+
+#define dumpcharptr(a) \
+ do { \
+ integer x; \
+ if (a!=NULL) { \
+ x = strlen(a)+1; \
+ dumpinteger(x); dump_things(*a, x); \
+ } else { \
+ x = 0; dumpinteger(x); \
+ } \
+ } while (0)
+
+#define undumpcharptr(s) \
+ do { \
+ integer x; \
+ char *a; \
+ undumpinteger (x); \
+ if (x>0) { \
+ a = malloc(x); \
+ undump_things(*a,x); \
+ s = a ; \
+ } else { s = NULL; } \
+ } while (0)
+
+
+
+void dumpimagemeta(void)
+{
+ int cur_image, i;
+ image *img;
+ image_dict *idict;
+
+ dumpinteger(img_limit);
+ cur_image = (img_ptr - img_array);
+ dumpinteger(cur_image);
+
+ for (i = 0; i < cur_image; i++) {
+ img = img_array[i];
+ assert(img != NULL);
+ idict = img_dict(img);
+ dumpcharptr(img_filename(idict));
+ dumpinteger(img_type(idict));
+ dumpinteger(img_color(idict));
+ dumpinteger(img_width(img));
+ dumpinteger(img_height(img));
+ dumpinteger(img_xres(idict));
+ dumpinteger(img_yres(idict));
+ dumpinteger(img_totalpages(idict));
+ dumpinteger(img_colorspace(idict));
+ dumpinteger(img_group_ref(idict));
+
+ /* the image_struct is not dumped at all, except for a few
+ variables that are needed to restore the contents */
+
+ if (img_type(idict) == IMG_TYPE_PDF) {
+ dumpinteger(img_pagebox(idict));
+ dumpinteger(img_pagenum(idict));
+ } else if (img_type(idict) == IMG_TYPE_JBIG2) {
+ dumpinteger(img_pagenum(idict));
+ }
+
+ }
+}
+
+void undumpimagemeta(integer pdfversion, integer pdfinclusionerrorlevel)
+{
+ int cur_image, i;
+ image *img;
+ image_dict *idict;
+
+ undumpinteger(img_limit);
+
+ img_array = xtalloc(img_limit, img_entry);
+ undumpinteger(cur_image);
+ img_ptr = img_array + cur_image;
+
+ for (i = 0; i < cur_image; i++) {
+ img = new_image();
+ assert(img_arrayidx(img) == -1);
+ img_arrayidx(img) = img_to_array(img);
+ idict = img_dict(img) = new_image_dict();
+ assert(idict != NULL);
+ undumpcharptr(img_filename(idict));
+ undumpinteger(img_type(idict));
+ undumpinteger(img_color(idict));
+ undumpinteger(img_width(img));
+ undumpinteger(img_height(img));
+ undumpinteger(img_xres(idict));
+ undumpinteger(img_yres(idict));
+ undumpinteger(img_totalpages(idict));
+ undumpinteger(img_colorspace(idict));
+ undumpinteger(img_group_ref(idict));
+
+ switch (img_type(idict)) {
+ case IMG_TYPE_PDF:
+ undumpinteger(img_pagebox(idict));
+ undumpinteger(img_pagenum(idict));
+ break;
+ case IMG_TYPE_PNG:
+ break;
+ case IMG_TYPE_JPG:
+ break;
+ case IMG_TYPE_JBIG2:
+ if (pdfversion < 4) {
+ pdftex_fail
+ ("JBIG2 images only possible with at least PDF 1.4; you are generating PDF 1.%i",
+ (int) pdfversion);
+ }
+ undumpinteger(img_pagenum(idict));
+ break;
+ default:
+ pdftex_fail("unknown type of image");
+ }
+ read_img(idict, pdfversion, pdfinclusionerrorlevel);
+ }
+}
+
+
+
+
/**********************************************************************/
/* stuff to be accessible from TeX */
integer read_image(integer objnum, integer index, strnumber filename,
- integer page_num,
- strnumber attr,
- strnumber page_name,
+ integer page_num, strnumber page_name, strnumber attr,
integer colorspace, integer page_box,
integer pdf_minor_version, integer pdf_inclusion_errorlevel)
{
- integer ref;
- image *a = new_image();
image_dict *idict;
- ref = img_to_array(a);
+ image *a = new_image();
+ assert(img_arrayidx(a) == -1);
+ img_arrayidx(a) = img_to_array(a);
idict = img_dict(a) = new_image_dict();
assert(idict != NULL);
img_objnum(idict) = objnum;
@@ -594,8 +843,7 @@ integer read_image(integer objnum, integer index, strnumber filename,
img_pagebox(idict) = page_box;
read_img(idict, pdf_minor_version, pdf_inclusion_errorlevel);
img_unset_scaled(a);
- img_set_refered(a);
- return ref;
+ return img_arrayidx(a);
}
void set_image_dimensions(integer ref, integer wd, integer ht, integer dp)
@@ -613,8 +861,11 @@ void scale_image(integer ref)
void out_image(integer ref, scaled hpos, scaled vpos)
{
+ scaledpos pos;
+ pos.h = hpos;
+ pos.v = vpos;
image *a = img_array[ref];
- out_img(a, hpos, vpos);
+ out_img(a, pstruct, &pos);
}
void write_image(integer ref)
@@ -632,6 +883,24 @@ integer image_colordepth(integer ref)
return img_colordepth(img_dict(img_array[ref]));
}
+integer image_group_ref(integer ref)
+{
+ return img_group_ref(img_dict(img_array[ref]));
+}
+
+
+/* The following five functions are for \pdfximagebbox */
+
+integer epdf_xsize(integer ref)
+{
+ return img_xsize(img_dict(img_array[ref]));
+}
+
+integer epdf_ysize(integer ref)
+{
+ return img_ysize(img_dict(img_array[ref]));
+}
+
integer epdf_orig_x(integer ref)
{
return img_xorig(img_dict(img_array[ref]));
@@ -642,6 +911,17 @@ integer epdf_orig_y(integer ref)
return img_yorig(img_dict(img_array[ref]));
}
+boolean is_pdf_image(integer ref)
+{
+ return img_type(img_dict(img_array[ref])) == IMG_TYPE_PDF;
+}
+
+boolean is_png_image(integer ref)
+{
+ return img_type(img_dict(img_array[ref])) == IMG_TYPE_PNG;
+}
+
+
integer image_objnum(integer ref)
{
return img_objnum(img_dict(img_array[ref]));
diff --git a/Build/source/texk/web2c/luatexdir/image/writejbig2.c b/Build/source/texk/web2c/luatexdir/image/writejbig2.c
index 2d7d4560548..c2f01d1bfca 100644
--- a/Build/source/texk/web2c/luatexdir/image/writejbig2.c
+++ b/Build/source/texk/web2c/luatexdir/image/writejbig2.c
@@ -1,21 +1,24 @@
-/***********************************************************************
-Copyright (c) 2002-2006 Han The Thanh, <thanh@pdftex.org>
+/* writejbig2.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
-This file is part of pdfTeX.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
-any later version.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-pdfTeX is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-You should have received a copy of the GNU General Public License along
-with pdfTeX; if not, write to the Free Software Foundation, Inc., 59
-Temple Place, Suite 330, Boston, MA 02111-1307 USA
+/***********************************************************************
This is experimental JBIG2 image support to pdfTeX. JBIG2 image decoding
is part of Adobe PDF-1.4, and requires Acroread 5.0 or later.
@@ -75,10 +78,13 @@ object exists, reference it. Else create fresh one.
09 Dec. 2002: JBIG2 seg. page numbers > 0 are now set to 1, see PDF Ref.
-$Id: writejbig2.c 1127 2008-03-25 21:32:54Z hhenkel $
***********************************************************************/
#include "writejbig2.h"
+
+static const char _svn_version[] =
+ "$Id: writejbig2.c 1407 2008-07-15 10:49:28Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/image/writejbig2.c $";
+
#undef DEBUG
/**********************************************************************/
@@ -292,7 +298,7 @@ void readfilehdr(FILEINFO * fip)
fip->sequentialaccess = (fip->filehdrflags & 0x01) ? true : false;
if (fip->sequentialaccess) { /* Annex D.1 vs. Annex D.2 */
xfseek(fip->file, 0, SEEK_END, fip->filepath);
- fip->filesize = xftell(fip->file, fip->filepath);
+ fip->filesize = (long) xftello(fip->file, fip->filepath);
xfseek(fip->file, 9, SEEK_SET, fip->filepath);
}
/* Annex D.4.3 Number of pages */
@@ -363,7 +369,7 @@ boolean readseghdr(FILEINFO * fip, SEGINFO * sip)
sip->segpage = ygetc(fip->file);
/* 7.2.7 Segment data length */
sip->segdatalen = read4bytes(fip->file);
- sip->hdrend = xftell(fip->file, fip->filepath);
+ sip->hdrend = (long) xftello(fip->file, fip->filepath);
/* ---- at end of segment header ---- */
return true;
}
@@ -583,7 +589,7 @@ void rd_jbig2_info(FILEINFO * fip)
sip->dataend = sip->datastart + sip->segdatalen;
if (!fip->sequentialaccess
&& (sip->pageinfoflag || sip->endofstripeflag))
- xfseek(fip->file, sip->datastart, SEEK_SET, fip->filepath);
+ xfseeko(fip->file, sip->datastart, SEEK_SET, fip->filepath);
seekdist = sip->segdatalen;
/* 7.4.8 Page information segment syntax */
if (sip->pageinfoflag) {
@@ -603,11 +609,11 @@ void rd_jbig2_info(FILEINFO * fip)
}
if (!fip->sequentialaccess
&& (sip->pageinfoflag || sip->endofstripeflag))
- xfseek(fip->file, sip->hdrend, SEEK_SET, fip->filepath);
+ xfseeko(fip->file, sip->hdrend, SEEK_SET, fip->filepath);
if (!fip->sequentialaccess)
streampos += sip->segdatalen;
if (fip->sequentialaccess)
- xfseek(fip->file, seekdist, SEEK_CUR, fip->filepath);
+ xfseeko(fip->file, seekdist, SEEK_CUR, fip->filepath);
if (sip->endofpageflag && currentpage && (pip->stripinginfo >> 15))
pip->height = pip->stripedheight;
}
@@ -655,10 +661,10 @@ void wr_jbig2(FILEINFO * fip, unsigned long page)
for (slip = pip->segments.first; slip != NULL; slip = slip->next) { /* loop over page segments */
sip = slip->d;
if (sip->isrefered || page > 0) {
- xfseek(fip->file, sip->hdrstart, SEEK_SET, fip->filepath);
+ xfseeko(fip->file, sip->hdrstart, SEEK_SET, fip->filepath);
/* mark refered-to page 0 segments, change segpages > 1 to 1 */
writeseghdr(fip, sip);
- xfseek(fip->file, sip->datastart, SEEK_SET, fip->filepath);
+ xfseeko(fip->file, sip->datastart, SEEK_SET, fip->filepath);
for (i = sip->datastart; i < sip->dataend; i++)
pdfout(ygetc(fip->file));
}
@@ -675,7 +681,7 @@ void read_jbig2_info(image_dict * idict)
PAGEINFO *pip;
void **aa;
assert(idict != NULL);
- img_type(idict) = IMAGE_TYPE_JBIG2;
+ img_type(idict) = IMG_TYPE_JBIG2;
if (img_pagenum(idict) < 1)
pdftex_fail
("read_jbig2_info(): page %d not in JBIG2 image file; page must be > 0",
diff --git a/Build/source/texk/web2c/luatexdir/image/writejbig2.h b/Build/source/texk/web2c/luatexdir/image/writejbig2.h
index c1bec32d859..5bc91920889 100644
--- a/Build/source/texk/web2c/luatexdir/image/writejbig2.h
+++ b/Build/source/texk/web2c/luatexdir/image/writejbig2.h
@@ -1,26 +1,28 @@
-/***********************************************************************
-Copyright (c) 2002-2006 Han The Thanh, <thanh@pdftex.org>
+/* writejbig2.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
-any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License along
-with pdfTeX; if not, write to the Free Software Foundation, Inc., 59
-Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+/***********************************************************************
This is experimental JBIG2 image support to pdfTeX. JBIG2 image decoding
is part of Adobe PDF-1.4, and requires Acroread 5.0 or later.
-$Id: writejbig2.h 1012 2008-02-14 00:00:57Z oneiros $
+$Id: writejbig2.h 1224 2008-05-02 15:26:27Z oneiros $
***********************************************************************/
#include <stdlib.h>
diff --git a/Build/source/texk/web2c/luatexdir/image/writejpg.c b/Build/source/texk/web2c/luatexdir/image/writejpg.c
index 422c29470fb..8e439c76ca5 100644
--- a/Build/source/texk/web2c/luatexdir/image/writejpg.c
+++ b/Build/source/texk/web2c/luatexdir/image/writejpg.c
@@ -1,28 +1,30 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* writejpg.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: writejpg.c 1100 2008-03-09 13:40:48Z hhenkel $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
#include "ptexlib.h"
#include "image.h"
+static const char _svn_version[] =
+ "$Id: writejpg.c 1224 2008-05-02 15:26:27Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/image/writejpg.c $";
+
#define JPG_GRAY 1 /* Gray color space, use /DeviceGray */
#define JPG_RGB 3 /* RGB color space, use /DeviceRGB */
#define JPG_CMYK 4 /* CMYK color space, use /DeviceCMYK */
@@ -117,7 +119,7 @@ void read_jpg_info(image_dict * idict, img_readtype_e readtype)
int i, units = 0;
unsigned char jpg_id[] = "JFIF";
assert(idict != NULL);
- assert(img_type(idict) == IMAGE_TYPE_JPG);
+ assert(img_type(idict) == IMG_TYPE_JPG);
img_totalpages(idict) = 1;
img_pagenum(idict) = 1;
img_xres(idict) = img_yres(idict) = 0;
diff --git a/Build/source/texk/web2c/luatexdir/image/writepng.c b/Build/source/texk/web2c/luatexdir/image/writepng.c
index d431b3b7ed1..1981d002218 100644
--- a/Build/source/texk/web2c/luatexdir/image/writepng.c
+++ b/Build/source/texk/web2c/luatexdir/image/writepng.c
@@ -1,29 +1,32 @@
-/*
-Copyright (c) 1996-2004 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
+/* writepng.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id: writepng.c 1101 2008-03-09 16:12:15Z hhenkel $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
#include "ptexlib.h"
#include "image.h"
+static const char _svn_version[] =
+ "$Id: writepng.c 2029 2009-03-14 19:10:25Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/image/writepng.c $";
+
+static int transparent_page_group = -1;
+
void close_and_cleanup_png(image_dict * idict)
{
assert(idict != NULL);
@@ -44,7 +47,7 @@ void read_png_info(image_dict * idict, img_readtype_e readtype)
png_structp png_p;
png_infop info_p;
assert(idict != NULL);
- assert(img_type(idict) == IMAGE_TYPE_PNG);
+ assert(img_type(idict) == IMG_TYPE_PNG);
img_totalpages(idict) = 1;
img_pagenum(idict) = 1;
img_xres(idict) = img_yres(idict) = 0;
@@ -120,7 +123,7 @@ void read_png_info(image_dict * idict, img_readtype_e readtype)
#define write_gray_pixel_8(r) \
if (j % 2 == 0) pdf_buf[pdf_ptr++] = *r++; \
- else smask[smask_ptr++] = *r++
+ else smask[smask_ptr++] = *r++
#define write_rgb_pixel_16(r) \
@@ -139,27 +142,27 @@ void read_png_info(image_dict * idict, img_readtype_e readtype)
r = row; \
k = info_p->rowbytes; \
while(k > 0) { \
- l = (k > pdf_buf_size)? pdf_buf_size : k; \
- pdfroom(l); \
- for (j = 0; j < l; j++) { \
- outmac; \
- } \
- k -= l; \
- } \
+ l = (k > pdf_buf_size)? pdf_buf_size : k; \
+ pdfroom(l); \
+ for (j = 0; j < l; j++) { \
+ outmac; \
+ } \
+ k -= l; \
+ } \
}
#define write_interlaced(outmac) \
for (i = 0; (unsigned) i < (int)info_p->height; i++) { \
row = rows[i]; \
- k = info_p->rowbytes; \
- while(k > 0) { \
- l = (k > pdf_buf_size)? pdf_buf_size : k;\
- pdfroom(l); \
- for (j = 0; j < l; j++) { \
- outmac; \
- } \
- k -= l; \
- } \
+ k = info_p->rowbytes; \
+ while(k > 0) { \
+ l = (k > pdf_buf_size)? pdf_buf_size : k;\
+ pdfroom(l); \
+ for (j = 0; j < l; j++) { \
+ outmac; \
+ } \
+ k -= l; \
+ } \
xfree(rows[i]); \
}
@@ -389,7 +392,7 @@ void write_png_rgb_alpha(image_dict * idict)
bitdepth = (int) info_p->bit_depth;
pdf_begin_dict(smask_objnum, 0);
pdf_puts("/Type /XObject\n/Subtype /Image\n");
- if (img_attr(idict) != NULL)
+ if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0)
pdf_printf("%s\n", img_attr(idict));
pdf_printf("/Width %i\n/Height %i\n/BitsPerComponent %i\n",
(int) info_p->width,
@@ -460,14 +463,15 @@ void copy_png(image_dict * idict)
pdftex_fail("writepng: fseek in PNG file failed");
}
} while (endflag == false);
- pdf_printf("/Length %d\n", streamlength);
- pdf_printf("/Filter /FlateDecode\n");
- pdf_printf("/DecodeParms << ");
- pdf_printf("/Colors %d ", info_p->color_type == 2 ? 3 : 1);
- pdf_printf("/Columns %d ", (int) info_p->width);
- pdf_printf("/BitsPerComponent %i ", (int) info_p->bit_depth);
- pdf_printf("/Predictor %d ", 10); /* actual predictor defined on line basis */
- pdf_printf(">>\n>>\nstream\n");
+ pdf_printf("/Length %d\n"
+ "/Filter/FlateDecode\n"
+ "/DecodeParms<<"
+ "/Colors %d"
+ "/Columns %d"
+ "/BitsPerComponent %i"
+ "/Predictor 10>>\n>>\nstream\n", streamlength,
+ info_p->color_type == 2 ? 3 : 1,
+ (int) info_p->width, info_p->bit_depth);
/* 2nd pass to copy data */
endflag = false;
if (fseek(fp, 8, SEEK_SET) != 0)
@@ -516,6 +520,8 @@ void reopen_png(image_dict * idict)
pdftex_fail("writepng: image dimensions have changed");
}
+static boolean last_png_needs_page_group;
+
void write_png(image_dict * idict)
{
double gamma, checked_gamma;
@@ -524,6 +530,7 @@ void write_png(image_dict * idict)
png_structp png_p;
png_infop info_p;
assert(idict != NULL);
+ last_png_needs_page_group = false;
if (img_file(idict) == NULL)
reopen_png(idict);
assert(img_png_ptr(idict) != NULL);
@@ -616,18 +623,20 @@ void write_png(image_dict * idict)
write_png_gray(idict);
break;
case PNG_COLOR_TYPE_GRAY_ALPHA:
- if (fixed_pdf_minor_version >= 4)
+ if (fixed_pdf_minor_version >= 4) {
write_png_gray_alpha(idict);
- else
+ last_png_needs_page_group = true;
+ } else
write_png_gray(idict);
break;
case PNG_COLOR_TYPE_RGB:
write_png_rgb(idict);
break;
case PNG_COLOR_TYPE_RGB_ALPHA:
- if (fixed_pdf_minor_version >= 4)
+ if (fixed_pdf_minor_version >= 4) {
write_png_rgb_alpha(idict);
- else
+ last_png_needs_page_group = true;
+ } else
write_png_rgb(idict);
break;
default:
@@ -638,3 +647,27 @@ void write_png(image_dict * idict)
pdf_flush();
close_and_cleanup_png(idict);
}
+
+
+
+static boolean transparent_page_group_was_written = false;
+
+/* Called after the xobject generated by write_png has been finished; used to
+ * write out additional objects */
+void write_additional_png_objects(void)
+{
+ return; /* this interferes with current macro-based usage and cannot be configured */
+ if (last_png_needs_page_group) {
+ if (!transparent_page_group_was_written && transparent_page_group > 1) {
+ /* create new group object */
+ transparent_page_group_was_written = true;
+ pdf_begin_obj(transparent_page_group, 2);
+ if (get_pdf_compress_level() == 0) {
+ pdf_puts("%PTEX Group needed for transparent pngs\n");
+ }
+ pdf_puts
+ ("<</Type/Group /S/Transparency /CS/DeviceRGB /I true /K true>>\n");
+ pdf_end_obj();
+ }
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/lang/hyphen.c b/Build/source/texk/web2c/luatexdir/lang/hyphen.c
index 049210d3d71..56d745809ae 100644
--- a/Build/source/texk/web2c/luatexdir/lang/hyphen.c
+++ b/Build/source/texk/web2c/luatexdir/lang/hyphen.c
@@ -53,6 +53,9 @@
#include "hnjalloc.h"
#include "hyphen.h"
+static const char _svn_version[] =
+ "$Id: hyphen.c 1696 2008-12-28 21:02:34Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lang/texlang.c $";
+
/* SHOULD BE MOVED TO SEPARATE LIBRARY */
static unsigned char * hnj_strdup(
const unsigned char *s
@@ -283,7 +286,15 @@ static void hyppat_insert(
i = hnj_string_hash (key) % HASH_SIZE;
for (e = hashtab->entries[i]; e; e=e->next) {
if (strcmp((char*)e->key,(char*)key)==0) {
- if (e->u.hyppat) hnj_free(e->u.hyppat);
+ if (e->u.hyppat) {
+ if (hyppat && strcmp((char*)e->u.hyppat,(char*)hyppat)!=0) {
+ int s = maketexstring("Conflicting pattern ignored");
+ do_print_err(s);
+ error();
+ flush_str(s);
+ }
+ hnj_free(e->u.hyppat);
+ }
e->u.hyppat = hyppat;
hnj_free(key);
return;
@@ -418,7 +429,7 @@ static const unsigned char* next_pattern(
size_t* length,
const unsigned char **buf
) {
- const unsigned char *rover = *buf, *here;
+ const unsigned char *here, *rover = *buf;
while (*rover && isspace(*rover)) rover++;
here = rover;
while (*rover) {
@@ -598,10 +609,10 @@ void hnj_hyphen_load(
const unsigned char* format;
const unsigned char* begin = f;
+ unsigned char *pat;
+ char *org;
while((format = next_pattern(&l,&f))!=NULL) {
int i,j,e;
- unsigned char *pat;
- char *org;
/*
printf("%s\n",format);
char* repl = strnchr(format, '/',l);
@@ -630,10 +641,11 @@ void hnj_hyphen_load(
if (is_utf8_follow(format[i])) e++;
}
/* l-e => number of _characters_ not _bytes_*/
+ /* l-j => number of pattern bytes */
/* l-e-j => number of pattern characters*/
pat = (unsigned char*) malloc(1+l-j);
org = ( char*) malloc(2+l-e-j);
- /* remove hyphenation encoders (digits) from pat*/
+ /* remove hyphenation encoders (digits) from pat*/
org[0] = '0';
for (i=0,j=0,e=0; (unsigned)i<l; i++) {
unsigned char c = format[i];
@@ -659,15 +671,15 @@ void hnj_hyphen_load(
for (l=1; l<=wordsize; l++) {
if (is_utf8_follow(word[l])) continue; /* Do not clip an utf8 sequence*/
for (j=1; j<=l; j++) {
- int i = l-j;
char *subpat_pat;
+ int i = l-j;
if (is_utf8_follow(word[i])) continue; /* Do not start halfway an utf8 sequence*/
if ((subpat_pat = hyppat_lookup(dict->patterns,word+i,j))!=NULL) {
char* newpat_pat;
if ((newpat_pat = hyppat_lookup(dict->merged,word,l))==NULL) {
+ char *neworg;
unsigned char *newword=(unsigned char*)malloc(l+1);
int e=0;
- char *neworg;
strncpy((char*)newword, (char*)word,l); newword[l]=0;
for (i=0; i<l; i++) if (is_utf8_follow(newword[i])) e++;
neworg = malloc(l+2-e);
@@ -700,7 +712,8 @@ void hnj_hyphen_load(
last_state = state_num;
ch = word[j];
if (ch>=0x80) {
- int i=1, m;
+ int m;
+ int i=1;
while (is_utf8_follow(word[j-i])) i++;
ch = word[j-i] & mask[i];
m = j-i;
@@ -757,14 +770,14 @@ void hnj_hyphen_hyphenate(
halfword right,
lang_variables *lan
) {
+ int char_num;
+ halfword here;
+ int state = 0;
/* +2 for dots at each end, +1 for points /outside/ characters*/
int ext_word_len = length+2;
int hyphen_len = ext_word_len+1;
/*char *hyphens = hnj_malloc((hyphen_len*2)+1); */ /* LATER */
char *hyphens = hnj_malloc(hyphen_len+1);
- int char_num;
- int state = 0;
- halfword here;
/* Add a '.' to beginning and end to facilitate matching*/
set_vlink(begin_point,first);
@@ -780,18 +793,21 @@ void hnj_hyphen_hyphenate(
hyphens[hyphen_len] = 0;
/* now, run the finite state machine */
- for (char_num=0, here=begin_point; here!=end_point; here=get_vlink(here)) {
-
- int ch = get_lc_code(get_character(here));
+ for (char_num=0, here=begin_point; here!=get_vlink(end_point); here=get_vlink(here)) {
+ int ch;
+ if (here == begin_point || here == end_point)
+ ch='.';
+ else
+ ch = get_lc_code(get_character(here));
while (state!=-1) {
/* printf("%*s%s%c",char_num-strlen(get_state_str(state)),"",get_state_str(state),(char)ch);*/
HyphenState *hstate = &dict->states[state];
int k;
for (k = 0; k < hstate->num_trans; k++) {
if (hstate->trans[k].uni_ch == ch) {
- char *match;
- state = hstate->trans[k].new_state;
+ char *match;
+ state = hstate->trans[k].new_state;
/* printf(" state %d\n",state);*/
match = dict->states[state].match;
if (match) {
diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.c b/Build/source/texk/web2c/luatexdir/lang/texlang.c
index 1f847f5c643..c37350f146f 100644
--- a/Build/source/texk/web2c/luatexdir/lang/texlang.c
+++ b/Build/source/texk/web2c/luatexdir/lang/texlang.c
@@ -1,24 +1,21 @@
-/*
-Copyright (c) 2007 Taco Hoekwater <taco@latex.org>
+/* texlang.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of luatex.
+ This file is part of LuaTeX.
-luatex is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-luatex is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with luatex; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-This is texlang.c
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
@@ -26,464 +23,648 @@ This is texlang.c
#include <string.h>
#include "nodes.h"
+#include "font/texfont.h"
#include "hyphen.h"
+static const char _svn_version[] =
+ "$Id: texlang.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lang/texlang.c $";
+
/* functions from the fontforge unicode library */
-extern unsigned int *utf82u_strcpy(unsigned int *ubuf,const char *utf8buf);
+#if 0
+extern unsigned int *utf82u_strcpy(unsigned int *ubuf, const char *utf8buf);
extern unsigned int u_strlen(unsigned int *ubuf);
-extern char *utf8_idpb(char *w,unsigned int i);
+extern char *utf8_idpb(char *w, unsigned int i);
+#else
+
+typedef unsigned int unichar_t;
+typedef unsigned char uint8;
+typedef unsigned int uint32;
+
+static unichar_t *utf82u_strcpy(unichar_t * ubuf, const char *utf8buf)
+{
+ int len = strlen(utf8buf) + 1;
+ unichar_t *upt = ubuf, *uend = ubuf + len - 1;
+ const uint8 *pt = (const uint8 *) utf8buf, *end = pt + strlen(utf8buf);
+ int w, w2;
+
+ while (pt < end && *pt != '\0' && upt < uend) {
+ if (*pt <= 127)
+ *upt = *pt++;
+ else if (*pt <= 0xdf) {
+ *upt = ((*pt & 0x1f) << 6) | (pt[1] & 0x3f);
+ pt += 2;
+ } else if (*pt <= 0xef) {
+ *upt = ((*pt & 0xf) << 12) | ((pt[1] & 0x3f) << 6) | (pt[2] & 0x3f);
+ pt += 3;
+ } else {
+ w = (((*pt & 0x7) << 2) | ((pt[1] & 0x30) >> 4)) - 1;
+ w = (w << 6) | ((pt[1] & 0xf) << 2) | ((pt[2] & 0x30) >> 4);
+ w2 = ((pt[2] & 0xf) << 6) | (pt[3] & 0x3f);
+ *upt = w * 0x400 + w2 + 0x10000;
+ pt += 4;
+ }
+ ++upt;
+ }
+ *upt = '\0';
+ return (ubuf);
+}
+
+static char *utf8_idpb(char *utf8_text, uint32 ch)
+{
+ /* Increment and deposit character */
+ if (ch >= 17 * 65536)
+ return (utf8_text);
+
+ if (ch <= 127)
+ *utf8_text++ = ch;
+ else if (ch <= 0x7ff) {
+ *utf8_text++ = 0xc0 | (ch >> 6);
+ *utf8_text++ = 0x80 | (ch & 0x3f);
+ } else if (ch <= 0xffff) {
+ *utf8_text++ = 0xe0 | (ch >> 12);
+ *utf8_text++ = 0x80 | ((ch >> 6) & 0x3f);
+ *utf8_text++ = 0x80 | (ch & 0x3f);
+ } else {
+ uint32 val = ch - 0x10000;
+ int u = ((val & 0xf0000) >> 16) + 1, z = (val & 0x0f000) >> 12, y =
+ (val & 0x00fc0) >> 6, x = val & 0x0003f;
+ *utf8_text++ = 0xf0 | (u >> 2);
+ *utf8_text++ = 0x80 | ((u & 3) << 4) | z;
+ *utf8_text++ = 0x80 | y;
+ *utf8_text++ = 0x80 | x;
+ }
+ return (utf8_text);
+}
+
+static int u_strlen(register unichar_t * str)
+{
+ register int len = 0;
+ while (*str++ != '\0')
+ ++len;
+ return (len);
+}
+
+#endif
#define noVERBOSE
-#define MAX_TEX_LANGUAGES 32767
+#define MAX_TEX_LANGUAGES 32768
-static struct tex_language *tex_languages[MAX_TEX_LANGUAGES] = {NULL};
+static struct tex_language *tex_languages[MAX_TEX_LANGUAGES] = { NULL };
static int next_lang_id = 0;
-struct tex_language *
-new_language (void) {
- struct tex_language* lang;
- if (next_lang_id<MAX_TEX_LANGUAGES) {
- lang = xmalloc(sizeof(struct tex_language));
- tex_languages[next_lang_id] = lang;
- lang->id = next_lang_id++;
- lang->exceptions = 0;
- lang->patterns = NULL;
- lang->pre_hyphen_char = '-';
- lang->post_hyphen_char = 0;
- return lang;
- } else {
- return NULL;
- }
+struct tex_language *new_language(int n)
+{
+ struct tex_language *lang;
+ unsigned l;
+ if (n >= 0) {
+ l = (unsigned) n;
+ if (l != (MAX_TEX_LANGUAGES - 1))
+ if (next_lang_id <= n)
+ next_lang_id = n + 1;
+ } else {
+ while (tex_languages[next_lang_id] != NULL)
+ next_lang_id++;
+ l = next_lang_id++;
+ }
+ if (l < (MAX_TEX_LANGUAGES - 1) && tex_languages[l] == NULL) {
+ lang = xmalloc(sizeof(struct tex_language));
+ tex_languages[l] = lang;
+ lang->id = l;
+ lang->exceptions = 0;
+ lang->patterns = NULL;
+ lang->pre_hyphen_char = '-';
+ lang->post_hyphen_char = 0;
+ lang->pre_exhyphen_char = 0;
+ lang->post_exhyphen_char = 0;
+ return lang;
+ } else {
+ return NULL;
+ }
}
-struct tex_language *
-get_language (int n) {
- if (n>=0 && n<MAX_TEX_LANGUAGES ) {
- if (tex_languages[n]!=NULL) {
- return tex_languages[n];
+struct tex_language *get_language(int n)
+{
+ if (n >= 0 && n < MAX_TEX_LANGUAGES) {
+ if (tex_languages[n] != NULL) {
+ return tex_languages[n];
+ } else {
+ return new_language(n);
+ }
} else {
- return new_language();
+ return NULL;
}
- } else {
- return NULL;
- }
}
-void
-set_pre_hyphen_char (integer n, integer v) {
- struct tex_language *l = get_language((int)n);
- if (l!=NULL)
- l->pre_hyphen_char = (int)v;
+void set_pre_hyphen_char(integer n, integer v)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l != NULL)
+ l->pre_hyphen_char = (int) v;
}
-void
-set_post_hyphen_char (integer n, integer v) {
- struct tex_language *l = get_language((int)n);
- if (l!=NULL)
- l->post_hyphen_char = (int)v;
+void set_post_hyphen_char(integer n, integer v)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l != NULL)
+ l->post_hyphen_char = (int) v;
}
-integer
-get_pre_hyphen_char (integer n) {
- struct tex_language *l = get_language((int)n);
- if (l==NULL) return -1;
- return (integer)l->pre_hyphen_char;
+
+void set_pre_exhyphen_char(integer n, integer v)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l != NULL)
+ l->pre_exhyphen_char = (int) v;
}
-integer
-get_post_hyphen_char (integer n) {
- struct tex_language *l = get_language((int)n);
- if (l==NULL) return -1;
- return (integer)l->post_hyphen_char;
+void set_post_exhyphen_char(integer n, integer v)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l != NULL)
+ l->post_exhyphen_char = (int) v;
}
-void
-load_patterns (struct tex_language *lang, unsigned char *buffer) {
- if (lang==NULL)
- return;
- if (lang->patterns==NULL) {
- lang->patterns = hnj_hyphen_new();
- }
- hnj_hyphen_load (lang->patterns,buffer);
+
+
+integer get_pre_hyphen_char(integer n)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l == NULL)
+ return -1;
+ return (integer) l->pre_hyphen_char;
}
-void
-clear_patterns (struct tex_language *lang) {
- if (lang==NULL)
- return;
- if (lang->patterns!=NULL) {
- hnj_hyphen_clear(lang->patterns);
- }
+integer get_post_hyphen_char(integer n)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l == NULL)
+ return -1;
+ return (integer) l->post_hyphen_char;
}
-void
-load_tex_patterns(int curlang, halfword head) {
- char *s = tokenlist_to_cstring (head,1, NULL);
- load_patterns(get_language(curlang),(unsigned char *)s);
+
+integer get_pre_exhyphen_char(integer n)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l == NULL)
+ return -1;
+ return (integer) l->pre_exhyphen_char;
+}
+
+integer get_post_exhyphen_char(integer n)
+{
+ struct tex_language *l = get_language((int) n);
+ if (l == NULL)
+ return -1;
+ return (integer) l->post_exhyphen_char;
+}
+
+void load_patterns(struct tex_language *lang, unsigned char *buffer)
+{
+ if (lang == NULL)
+ return;
+ if (lang->patterns == NULL) {
+ lang->patterns = hnj_hyphen_new();
+ }
+ hnj_hyphen_load(lang->patterns, buffer);
+}
+
+void clear_patterns(struct tex_language *lang)
+{
+ if (lang == NULL)
+ return;
+ if (lang->patterns != NULL) {
+ hnj_hyphen_clear(lang->patterns);
+ }
+}
+
+void load_tex_patterns(int curlang, halfword head)
+{
+ char *s = tokenlist_to_cstring(head, 1, NULL);
+ load_patterns(get_language(curlang), (unsigned char *) s);
}
#define STORE_CHAR(x) { word[w] = x ; if (w<MAX_WORD_LEN) w++; }
-
+
/* todo change this! */
-char *
-clean_hyphenation (char *buffer, char **cleaned) {
- int items;
- unsigned char word [MAX_WORD_LEN+1];
- int w = 0;
- char *s = buffer;
- while (*s && !isspace(*s)) {
- if (*s == '-') { /* skip */
- } else if (*s == '=') {
- STORE_CHAR('-');
- } else if (*s == '{') {
- s++;
- items=0;
- while (*s && *s!='}') { s++; }
- if (*s=='}') { items++; s++; }
- while (*s && *s!='}') { s++; }
- if (*s=='}') { items++; s++; }
- if (*s=='{') { s++; }
- while (*s && *s!='}') {STORE_CHAR(*s); s++; }
- if (*s=='}') { items++; } else { s--; }
- if (items!=3) { /* syntax error */
- *cleaned = NULL;
- while (*s && !isspace(*s)) { s++; }
- return s;
- }
- } else {
- STORE_CHAR(*s);
+char *clean_hyphenation(char *buffer, char **cleaned)
+{
+ int items;
+ unsigned char word[MAX_WORD_LEN + 1];
+ int w = 0;
+ char *s = buffer;
+ while (*s && !isspace(*s)) {
+ if (*s == '-') { /* skip */
+ } else if (*s == '=') {
+ STORE_CHAR('-');
+ } else if (*s == '{') {
+ s++;
+ items = 0;
+ while (*s && *s != '}') {
+ s++;
+ }
+ if (*s == '}') {
+ items++;
+ s++;
+ }
+ while (*s && *s != '}') {
+ s++;
+ }
+ if (*s == '}') {
+ items++;
+ s++;
+ }
+ if (*s == '{') {
+ s++;
+ }
+ while (*s && *s != '}') {
+ STORE_CHAR(*s);
+ s++;
+ }
+ if (*s == '}') {
+ items++;
+ } else {
+ s--;
+ }
+ if (items != 3) { /* syntax error */
+ *cleaned = NULL;
+ while (*s && !isspace(*s)) {
+ s++;
+ }
+ return s;
+ }
+ } else {
+ STORE_CHAR(*s);
+ }
+ s++;
}
- s++;
- }
- word[w] = 0;
- *cleaned = xstrdup((char *)word);
- return s;
-}
-
-void
-load_hyphenation (struct tex_language *lang, unsigned char *buffer) {
- char *s, *value, *cleaned;
- lua_State *L = Luas[0];
- if (lang==NULL)
- return;
- if (lang->exceptions==0) {
- lua_newtable(L);
- lang->exceptions = luaL_ref(L,LUA_REGISTRYINDEX);
- }
- lua_rawgeti(L, LUA_REGISTRYINDEX, lang->exceptions);
- s = (char *)buffer;
- while (*s) {
- while (isspace(*s)) s++;
- if (*s) {
- value = s;
- s = clean_hyphenation(s, &cleaned);
- if (cleaned!=NULL) {
- if ((s-value)>0) {
- lua_pushstring(L,cleaned);
- lua_pushlstring(L,value,(s-value));
- lua_rawset(L,-3);
- }
- free(cleaned);
- } else {
+ word[w] = 0;
+ *cleaned = xstrdup((char *) word);
+ return s;
+}
+
+void load_hyphenation(struct tex_language *lang, unsigned char *buffer)
+{
+ char *s, *value, *cleaned;
+ lua_State *L = Luas;
+ if (lang == NULL)
+ return;
+ if (lang->exceptions == 0) {
+ lua_newtable(L);
+ lang->exceptions = luaL_ref(L, LUA_REGISTRYINDEX);
+ }
+ lua_rawgeti(L, LUA_REGISTRYINDEX, lang->exceptions);
+ s = (char *) buffer;
+ while (*s) {
+ while (isspace(*s))
+ s++;
+ if (*s) {
+ value = s;
+ s = clean_hyphenation(s, &cleaned);
+ if (cleaned != NULL) {
+ if ((s - value) > 0) {
+ lua_pushstring(L, cleaned);
+ lua_pushlstring(L, value, (s - value));
+ lua_rawset(L, -3);
+ }
+ free(cleaned);
+ } else {
#ifdef VERBOSE
- fprintf(stderr,"skipping invalid hyphenation exception: %s\n",value);
+ fprintf(stderr, "skipping invalid hyphenation exception: %s\n",
+ value);
#endif
- }
+ }
+ }
}
- }
}
-void
-clear_hyphenation (struct tex_language *lang) {
- if (lang==NULL)
- return;
- if (lang->exceptions!=0) {
- luaL_unref(Luas[0],LUA_REGISTRYINDEX,lang->exceptions);
- lang->exceptions = 0;
- }
+void clear_hyphenation(struct tex_language *lang)
+{
+ if (lang == NULL)
+ return;
+ if (lang->exceptions != 0) {
+ luaL_unref(Luas, LUA_REGISTRYINDEX, lang->exceptions);
+ lang->exceptions = 0;
+ }
}
-void
-load_tex_hyphenation(int curlang, halfword head) {
- char *s = tokenlist_to_cstring (head,1, NULL);
- load_hyphenation(get_language(curlang),(unsigned char *)s);
+void load_tex_hyphenation(int curlang, halfword head)
+{
+ char *s = tokenlist_to_cstring(head, 1, NULL);
+ load_hyphenation(get_language(curlang), (unsigned char *) s);
}
/* TODO: clean this up. The delete_attribute_ref() statements are not very
nice, but needed. Also, in the post-break, it would be nicer to get the
attribute list from vlink(n). No rush, as it is currently not used much. */
-halfword insert_discretionary ( halfword t, halfword pre, halfword post, halfword replace) {
- halfword g, n;
- n = new_node(disc_node,syllable_disc);
- try_couple_nodes(n,vlink(t));
- couple_nodes(t,n);
- for (g=pre;g!=null;g=vlink(g)) {
- font(g)=font(replace);
- if (node_attr(t)!=null) {
- delete_attribute_ref(node_attr(g));
- node_attr(g) = node_attr(t);
- attr_list_ref(node_attr(t)) += 1;
+halfword insert_discretionary(halfword t, halfword pre, halfword post,
+ halfword replace)
+{
+ halfword g, n;
+ int f;
+ n = new_node(disc_node, syllable_disc);
+ try_couple_nodes(n, vlink(t));
+ couple_nodes(t, n);
+ if (replace != null)
+ f = font(replace);
+ else
+ f = get_cur_font(); /* for compound words following explicit hyphens */
+ for (g = pre; g != null; g = vlink(g)) {
+ font(g) = f;
+ if (node_attr(t) != null) {
+ delete_attribute_ref(node_attr(g));
+ node_attr(g) = node_attr(t);
+ attr_list_ref(node_attr(t)) += 1;
+ }
}
- }
- for (g=post;g!=null;g =vlink(g)) {
- font(g)=font(replace);
- if (node_attr(t)!=null) {
- delete_attribute_ref(node_attr(g));
- node_attr(g) = node_attr(t);
- attr_list_ref(node_attr(t)) += 1;
+ for (g = post; g != null; g = vlink(g)) {
+ font(g) = f;
+ if (node_attr(t) != null) {
+ delete_attribute_ref(node_attr(g));
+ node_attr(g) = node_attr(t);
+ attr_list_ref(node_attr(t)) += 1;
+ }
}
- }
- for (g=replace;g!=null;g =vlink(g)) {
- if (node_attr(t)!=null) {
- delete_attribute_ref(node_attr(g));
- node_attr(g) = node_attr(t);
- attr_list_ref(node_attr(t)) += 1;
+ for (g = replace; g != null; g = vlink(g)) {
+ if (node_attr(t) != null) {
+ delete_attribute_ref(node_attr(g));
+ node_attr(g) = node_attr(t);
+ attr_list_ref(node_attr(t)) += 1;
+ }
}
- }
- if (node_attr(t)!=null) {
- delete_attribute_ref(node_attr(vlink(t)));
- node_attr(vlink(t)) = node_attr(t);
- attr_list_ref(node_attr(t)) += 1;
- }
- t = vlink(t);
- set_disc_field(pre_break(t),pre);
- set_disc_field(post_break(t),post);
- set_disc_field(no_break(t),replace);
- return t;
-}
-
-halfword
-insert_syllable_discretionary ( halfword t, lang_variables *lan) {
- halfword g, n;
- n = new_node(disc_node,syllable_disc);
- couple_nodes(n,vlink(t));
- couple_nodes(t,n);
- delete_attribute_ref(node_attr(n));
- if (node_attr(t)!=null) {
- node_attr(n) = node_attr(t);
- attr_list_ref(node_attr(t))++ ;
- } else {
- node_attr(n) = null;
- }
- if (lan->pre_hyphen_char >0) {
- g = raw_glyph_node();
- set_to_character(g);
- character(g)=lan->pre_hyphen_char;
- font(g)=font(t);
- lang_data(g)=lang_data(t);
- if (node_attr(t)!=null) {
- node_attr(g) = node_attr(t);
- attr_list_ref(node_attr(t)) ++;
- }
- set_disc_field(pre_break(n),g);
- }
+ if (node_attr(t) != null) {
+ delete_attribute_ref(node_attr(vlink(t)));
+ node_attr(vlink(t)) = node_attr(t);
+ attr_list_ref(node_attr(t)) += 1;
+ }
+ t = vlink(t);
+ set_disc_field(pre_break(t), pre);
+ set_disc_field(post_break(t), post);
+ set_disc_field(no_break(t), replace);
+ return t;
+}
- if (lan->post_hyphen_char >0) {
- t = vlink(n);
- g = raw_glyph_node();
- set_to_character(g);
- character(g)=lan->post_hyphen_char;
- font(g)=font(t);
- lang_data(g)=lang_data(t);
- if (node_attr(t)!=null) {
- node_attr(g) = node_attr(t);
- attr_list_ref(node_attr(t)) += 1;
- }
- set_disc_field(post_break(n),g);
- }
- return n;
+halfword insert_syllable_discretionary(halfword t, lang_variables * lan)
+{
+ halfword g, n;
+ n = new_node(disc_node, syllable_disc);
+ couple_nodes(n, vlink(t));
+ couple_nodes(t, n);
+ delete_attribute_ref(node_attr(n));
+ if (node_attr(t) != null) {
+ node_attr(n) = node_attr(t);
+ attr_list_ref(node_attr(t))++;
+ } else {
+ node_attr(n) = null;
+ }
+ if (lan->pre_hyphen_char > 0) {
+ g = raw_glyph_node();
+ set_to_character(g);
+ character(g) = lan->pre_hyphen_char;
+ font(g) = font(t);
+ lang_data(g) = lang_data(t);
+ if (node_attr(t) != null) {
+ node_attr(g) = node_attr(t);
+ attr_list_ref(node_attr(t))++;
+ }
+ set_disc_field(pre_break(n), g);
+ }
+
+ if (lan->post_hyphen_char > 0) {
+ t = vlink(n);
+ g = raw_glyph_node();
+ set_to_character(g);
+ character(g) = lan->post_hyphen_char;
+ font(g) = font(t);
+ lang_data(g) = lang_data(t);
+ if (node_attr(t) != null) {
+ node_attr(g) = node_attr(t);
+ attr_list_ref(node_attr(t)) += 1;
+ }
+ set_disc_field(post_break(n), g);
+ }
+ return n;
}
-halfword insert_word_discretionary ( halfword t, lang_variables *lan) {
- halfword pre = null, pos = null;
- if (lan->pre_hyphen_char >0) pre = insert_character ( null, lan->pre_hyphen_char);
- if (lan->post_hyphen_char>0) pos = insert_character ( null, lan->post_hyphen_char);
- return insert_discretionary ( t, pre, pos, null);
+halfword insert_word_discretionary(halfword t, lang_variables * lan)
+{
+ halfword pre = null, pos = null;
+ if (lan->pre_exhyphen_char > 0)
+ pre = insert_character(null, lan->pre_exhyphen_char);
+ if (lan->post_exhyphen_char > 0)
+ pos = insert_character(null, lan->post_exhyphen_char);
+ return insert_discretionary(t, pre, pos, null);
}
-halfword insert_complex_discretionary ( halfword t, lang_variables *lan,
- halfword pre, halfword pos, halfword replace) {
- return insert_discretionary ( t, pre, pos, replace);
+halfword compound_word_break(halfword t, int clang)
+{
+ int disc;
+ lang_variables langdata;
+ langdata.pre_exhyphen_char = get_pre_exhyphen_char(clang);
+ langdata.post_exhyphen_char = get_post_exhyphen_char(clang);
+ disc = insert_word_discretionary(t, &langdata);
+ return disc;
}
-halfword insert_character ( halfword t, int c) {
- halfword p;
- p=new_node(glyph_node,0);
- set_to_character(p);
- character(p)=c;
- if (t!=null) {
- couple_nodes(t,p);
- }
- return p;
+halfword insert_complex_discretionary(halfword t, lang_variables * lan,
+ halfword pre, halfword pos,
+ halfword replace)
+{
+ (void) lan;
+ return insert_discretionary(t, pre, pos, replace);
}
-void
-set_disc_field (halfword f, halfword t) {
- if (t!=null) {
- couple_nodes(f,t);
- tlink(f) = tail_of_list(t);
- }
+halfword insert_character(halfword t, int c)
+{
+ halfword p;
+ p = new_node(glyph_node, 0);
+ set_to_character(p);
+ character(p) = c;
+ if (t != null) {
+ couple_nodes(t, p);
+ }
+ return p;
+}
+
+
+void set_disc_field(halfword f, halfword t)
+{
+ if (t != null) {
+ couple_nodes(f, t);
+ tlink(f) = tail_of_list(t);
+ } else {
+ vlink(f) = null;
+ tlink(f) = null;
+ }
}
-char *hyphenation_exception(int exceptions, char *w) {
- char *ret = NULL;
- lua_State *L = Luas[0];
- lua_checkstack(L,2);
- lua_rawgeti(L,LUA_REGISTRYINDEX,exceptions);
- if (lua_istable(L,-1)) { /* ?? */
- lua_pushstring(L,w); /* word table */
- lua_rawget(L,-2);
- if (lua_isstring(L,-1)) {
- ret = xstrdup((char *)lua_tostring(L,-1));
+char *hyphenation_exception(int exceptions, char *w)
+{
+ char *ret = NULL;
+ lua_State *L = Luas;
+ lua_checkstack(L, 2);
+ lua_rawgeti(L, LUA_REGISTRYINDEX, exceptions);
+ if (lua_istable(L, -1)) { /* ?? */
+ lua_pushstring(L, w); /* word table */
+ lua_rawget(L, -2);
+ if (lua_isstring(L, -1)) {
+ ret = xstrdup((char *) lua_tostring(L, -1));
+ }
+ lua_pop(L, 2);
+ } else {
+ lua_pop(L, 1);
}
- lua_pop(L,2);
- } else {
- lua_pop(L,1);
- }
- return ret;
-}
-
-
-char *exception_strings(struct tex_language *lang) {
- char *value;
- size_t size = 0, current =0;
- size_t l =0;
- char *ret = NULL;
- lua_State *L = Luas[0];
- if (lang->exceptions==0)
- return NULL;
- lua_checkstack(L,2);
- lua_rawgeti(L,LUA_REGISTRYINDEX,lang->exceptions);
- if (lua_istable(L,-1)) {
- /* iterate and join */
- lua_pushnil(L); /* first key */
- while (lua_next(L,-2) != 0) {
- value = (char *)lua_tolstring(L, -1, &l);
- if (current + 2 + l > size ) {
- ret = xrealloc(ret, (1.2*size)+current+l+1024);
- size = (1.2*size)+current+l+1024;
- }
- *(ret+current) = ' ';
- strcpy(ret+current+1,value);
- current += l+1;
- lua_pop(L, 1);
+ return ret;
+}
+
+
+char *exception_strings(struct tex_language *lang)
+{
+ char *value;
+ size_t size = 0, current = 0;
+ size_t l = 0;
+ char *ret = NULL;
+ lua_State *L = Luas;
+ if (lang->exceptions == 0)
+ return NULL;
+ lua_checkstack(L, 2);
+ lua_rawgeti(L, LUA_REGISTRYINDEX, lang->exceptions);
+ if (lua_istable(L, -1)) {
+ /* iterate and join */
+ lua_pushnil(L); /* first key */
+ while (lua_next(L, -2) != 0) {
+ value = (char *) lua_tolstring(L, -1, &l);
+ if (current + 2 + l > size) {
+ ret = xrealloc(ret, (1.2 * size) + current + l + 1024);
+ size = (1.2 * size) + current + l + 1024;
+ }
+ *(ret + current) = ' ';
+ strcpy(ret + current + 1, value);
+ current += l + 1;
+ lua_pop(L, 1);
+ }
}
- }
- return ret;
+ return ret;
}
/* the sequence from |wordstart| to |r| can contain only normal characters */
/* it could be faster to modify a halfword pointer and return an integer */
-halfword find_exception_part(unsigned int *j, int *uword, int len) {
- halfword g = null, gg = null;
- register int i = *j;
- i++; /* this puts uword[i] on the '{' */
- while (i<len && uword[i+1] != '}') {
- if (g==null) {
- gg = new_char(0,uword[i+1]);
- g = gg;
- } else {
- halfword s = new_char(0,uword[i+1]);
- couple_nodes(g,s);
- g = vlink(g);
+halfword find_exception_part(unsigned int *j, int *uword, int len)
+{
+ halfword g = null, gg = null;
+ register int i = *j;
+ i++; /* this puts uword[i] on the '{' */
+ while (i < len && uword[i + 1] != '}') {
+ if (g == null) {
+ gg = new_char(0, uword[i + 1]);
+ g = gg;
+ } else {
+ halfword s = new_char(0, uword[i + 1]);
+ couple_nodes(g, s);
+ g = vlink(g);
+ }
+ i++;
}
- i++;
- }
- *j = ++i;
- return gg;
+ *j = ++i;
+ return gg;
}
-int count_exception_part(unsigned int *j, int *uword, int len) {
- int ret=0;
- register int i = *j;
- i++; /* this puts uword[i] on the '{' */
- while (i<len && uword[i+1] != '}') {
- ret++;
- i++;
- }
- *j = ++i;
- return ret;
-}
-
-
-static char *PAT_ERROR[] = {
- "Exception discretionaries should contain three pairs of braced items.",
- "No intervening spaces are allowed.",
- NULL };
-
-void do_exception (halfword wordstart, halfword r, char *replacement) {
- unsigned i;
- halfword t;
- unsigned len;
- int clang;
- lang_variables langdata;
- int uword[MAX_WORD_LEN+1] = {0};
- (void)utf82u_strcpy((unsigned int *)uword,replacement);
- len = u_strlen((unsigned int *)uword);
- i = 0;
- t=wordstart;
- clang = char_lang(wordstart);
- langdata.pre_hyphen_char = get_pre_hyphen_char(clang);
- langdata.post_hyphen_char = get_post_hyphen_char(clang);
-
- for (i=0;i<len;i++) {
- if (uword[i+1] == '-') { /* a hyphen follows */
- while (vlink(t)!=r && (type(t)!=glyph_node || !is_simple_character(t)))
- t = vlink(t);
- if (vlink(t)==r)
- break;
- insert_syllable_discretionary(t, &langdata);
- t = vlink(t); /* skip the new disc */
- } else if (uword[i+1] == '=') {
- /* do nothing ? */
- t = vlink(t);
- } else if (uword[i+1] == '{') {
- halfword gg, hh, replace = null;
- int repl;
- gg = find_exception_part(&i,uword,len);
- if (i==len || uword[i+1] != '{') {
- tex_error ("broken pattern 1", PAT_ERROR);
- }
- hh = find_exception_part(&i,uword,len);
- if (i==len || uword[i+1] != '{') {
- tex_error ("broken pattern 2", PAT_ERROR);
- }
- repl = count_exception_part(&i,uword,len);
- if (i==len) {
- tex_error ("broken pattern 3", PAT_ERROR);
- }
- /*i++; */ /* jump over the last right brace */
- if (vlink(t)==r)
- break;
- if (repl>0) {
- halfword q = t;
- replace = vlink(q);
- while(repl>0 && q!=null) {
- q=vlink(q);
- if (type(q)==glyph_node) {
- repl--;
- }
- }
- try_couple_nodes(t,vlink(q));
- vlink(q)=null;
- }
- t = insert_discretionary(t,gg,hh,replace);
- } else {
- t = vlink(t);
+int count_exception_part(unsigned int *j, int *uword, int len)
+{
+ int ret = 0;
+ register int i = *j;
+ i++; /* this puts uword[i] on the '{' */
+ while (i < len && uword[i + 1] != '}') {
+ ret++;
+ i++;
+ }
+ *j = ++i;
+ return ret;
+}
+
+
+static char *PAT_ERROR[] = {
+ "Exception discretionaries should contain three pairs of braced items.",
+ "No intervening spaces are allowed.",
+ NULL
+};
+
+void do_exception(halfword wordstart, halfword r, char *replacement)
+{
+ unsigned i;
+ halfword t;
+ unsigned len;
+ int clang;
+ lang_variables langdata;
+ int uword[MAX_WORD_LEN + 1] = { 0 };
+ (void) utf82u_strcpy((unsigned int *) uword, replacement);
+ len = u_strlen((unsigned int *) uword);
+ i = 0;
+ t = wordstart;
+ clang = char_lang(wordstart);
+ langdata.pre_hyphen_char = get_pre_hyphen_char(clang);
+ langdata.post_hyphen_char = get_post_hyphen_char(clang);
+
+ for (i = 0; i < len; i++) {
+ if (uword[i + 1] == '-') { /* a hyphen follows */
+ while (vlink(t) != r
+ && (type(t) != glyph_node || !is_simple_character(t)))
+ t = vlink(t);
+ if (vlink(t) == r)
+ break;
+ insert_syllable_discretionary(t, &langdata);
+ t = vlink(t); /* skip the new disc */
+ } else if (uword[i + 1] == '=') {
+ /* do nothing ? */
+ t = vlink(t);
+ } else if (uword[i + 1] == '{') {
+ halfword gg, hh, replace = null;
+ int repl;
+ gg = find_exception_part(&i, uword, len);
+ if (i == len || uword[i + 1] != '{') {
+ tex_error("broken pattern 1", PAT_ERROR);
+ }
+ hh = find_exception_part(&i, uword, len);
+ if (i == len || uword[i + 1] != '{') {
+ tex_error("broken pattern 2", PAT_ERROR);
+ }
+ repl = count_exception_part(&i, uword, len);
+ if (i == len) {
+ tex_error("broken pattern 3", PAT_ERROR);
+ }
+ /*i++; *//* jump over the last right brace */
+ if (vlink(t) == r)
+ break;
+ if (repl > 0) {
+ halfword q = t;
+ replace = vlink(q);
+ while (repl > 0 && q != null) {
+ q = vlink(q);
+ if (type(q) == glyph_node) {
+ repl--;
+ }
+ }
+ try_couple_nodes(t, vlink(q));
+ vlink(q) = null;
+ }
+ t = insert_discretionary(t, gg, hh, replace);
+ t = vlink(t); /* skip the new disc */
+ } else {
+ t = vlink(t);
+ }
}
- }
}
/* This is a documentation section from the pascal web file. It is not
@@ -554,276 +735,299 @@ using an algorithm due to Frank~M. Liang.
/*
* This is incompatible with TEX because the first word of a paragraph
* can be hyphenated, but most european users seem to agree that
- * prohibiting hyphenation there was not a the best idea ever.
+ * prohibiting hyphenation there was not the best idea ever.
*/
-halfword find_next_wordstart(halfword r) {
- register int l;
- register int start_ok = 1;
- int mathlevel = 1;
- while (r!=null) {
- switch (type(r)) {
- case glue_node:
- start_ok = 1;
- break;
- case math_node:
- while (mathlevel>0 ){
- r = vlink(r);
- if (r==null)
- return r;
- if (type(r)==math_node) {
- if (subtype(r)==before) {
- mathlevel++;
- } else {
- mathlevel--;
- }
- }
- }
- break;
- case glyph_node:
- if (start_ok &&
- is_simple_character(r) &&
- (l = get_lc_code(character(r)))>0 &&
- (char_uchyph(r) || l == character(r)))
- return r;
- /* fall through */
- default:
- start_ok = 0;
- break;
- }
- r = vlink(r);
- }
- return r;
-}
-
-int valid_wordend( halfword s) {
- register halfword r = s;
- register int clang = char_lang(s);
- if (r==null)
- return 1;
- while ((r!=null) &&
- ((type(r)==glyph_node && is_simple_character(r) && clang == char_lang(r)) ||
- (type(r)==kern_node && subtype(r)==normal))) {
- r = vlink(r);
- }
- if (r==null ||
- (type(r)==glyph_node && is_simple_character(r) && clang != char_lang(r)) ||
- type(r)==glue_node ||
- type(r)==whatsit_node ||
- type(r)==ins_node ||
- type(r)==adjust_node ||
- type(r)==penalty_node ||
- (type(r)==kern_node && subtype(r)==explicit))
- return 1;
- return 0;
-}
-
-void
-hnj_hyphenation (halfword head, halfword tail) {
- int lchar, i;
- struct tex_language* lang;
- lang_variables langdata;
- char utf8word[(4*MAX_WORD_LEN)+1] = {0};
- int wordlen = 0;
- char *hy = utf8word;
- char *replacement = NULL;
- halfword s, r = head, wordstart = null, save_tail = null, left = null, right = null;
-
- /* this first movement assures two things:
- * a) that we won't waste lots of time on something that has been
- * handled already (in that case, none of the glyphs match |simple_character|).
- * b) that the first word can be hyphenated. if the movement was
- * not explicit, then the indentation at the start of a paragraph
- * list would make find_next_wordstart() look too far ahead.
- */
-
- while (r!=null && (type(r)!=glyph_node || !is_simple_character(r)))
- r =vlink(r);
- /* this will make |r| a glyph node with subtype_character */
- r = find_next_wordstart(r);
- if (r==null)
- return;
-
- assert (tail!=null);
- save_tail = vlink(tail);
- s = new_penalty(0);
- couple_nodes(tail, s);
-
- while (r!=null) { /* could be while(1), but let's be paranoid */
- int clang, lhmin, rhmin;
- wordstart = r;
- assert (is_simple_character(wordstart));
- clang = char_lang(wordstart);
- lhmin = char_lhmin(wordstart);
- rhmin = char_rhmin(wordstart);
- langdata.pre_hyphen_char = get_pre_hyphen_char(clang);
- langdata.post_hyphen_char = get_post_hyphen_char(clang);
- while (r!=null &&
- type(r)==glyph_node &&
- is_simple_character(r) &&
- clang == char_lang(r) &&
- (lchar = get_lc_code(character(r)))>0) {
- wordlen++;
- hy = utf8_idpb(hy,character(r));
- /* this should not be needed any more */
- /*if (vlink(r)!=null) alink(vlink(r))=r;*/
- r = vlink(r);
- }
- if (valid_wordend(r) && wordlen>=lhmin+rhmin && (lang=tex_languages[clang])!=NULL) {
- *hy=0;
- if (lang->exceptions!=0 &&
- (replacement = hyphenation_exception(lang->exceptions,utf8word))!=NULL) {
+halfword find_next_wordstart(halfword r)
+{
+ register int l;
+ register int start_ok = 1;
+ int mathlevel = 1;
+ while (r != null) {
+ switch (type(r)) {
+ case glue_node:
+ start_ok = 1;
+ break;
+ case math_node:
+ while (mathlevel > 0) {
+ r = vlink(r);
+ if (r == null)
+ return r;
+ if (type(r) == math_node) {
+ if (subtype(r) == before) {
+ mathlevel++;
+ } else {
+ mathlevel--;
+ }
+ }
+ }
+ break;
+ case glyph_node:
+ if (start_ok &&
+ is_simple_character(r) &&
+ (l = get_lc_code(character(r))) > 0 &&
+ (char_uchyph(r) || l == character(r)))
+ return r;
+ break;
+ default:
+ start_ok = 0;
+ break;
+ }
+ r = vlink(r);
+ }
+ return r;
+}
+
+int valid_wordend(halfword s)
+{
+ register halfword r = s;
+ register int clang = char_lang(s);
+ if (r == null)
+ return 1;
+ while ((r != null) && ((type(r) == glyph_node && is_simple_character(r)
+ && clang == char_lang(r)) || (type(r) == kern_node
+ && subtype(r) ==
+ normal))) {
+ r = vlink(r);
+ }
+ if (r == null || (type(r) == glyph_node && is_simple_character(r)
+ && clang != char_lang(r)) || type(r) == glue_node
+ || type(r) == whatsit_node || type(r) == ins_node
+ || type(r) == adjust_node || type(r) == penalty_node
+ || (type(r) == kern_node && subtype(r) == explicit))
+ return 1;
+ return 0;
+}
+
+void hnj_hyphenation(halfword head, halfword tail)
+{
+ int lchar, i;
+ struct tex_language *lang;
+ lang_variables langdata;
+ char utf8word[(4 * MAX_WORD_LEN) + 1] = { 0 };
+ int wordlen = 0;
+ char *hy = utf8word;
+ char *replacement = NULL;
+ halfword s, r = head, wordstart = null, save_tail = null, left =
+ null, right = null;
+
+ /* this first movement assures two things:
+ * a) that we won't waste lots of time on something that has been
+ * handled already (in that case, none of the glyphs match |simple_character|).
+ * b) that the first word can be hyphenated. if the movement was
+ * not explicit, then the indentation at the start of a paragraph
+ * list would make find_next_wordstart() look too far ahead.
+ */
+
+ while (r != null && (type(r) != glyph_node || !is_simple_character(r))) {
+ r = vlink(r);
+ }
+ /* this will make |r| a glyph node with subtype_character */
+ r = find_next_wordstart(r);
+ if (r == null)
+ return;
+
+ assert(tail != null);
+ save_tail = vlink(tail);
+ s = new_penalty(0);
+ couple_nodes(tail, s);
+
+ while (r != null) { /* could be while(1), but let's be paranoid */
+ int clang, lhmin, rhmin;
+ halfword hyf_font;
+ halfword end_word = r;
+ wordstart = r;
+ assert(is_simple_character(wordstart));
+ hyf_font = font(wordstart);
+ if (hyphen_char(hyf_font)<0) /* for backward compat */
+ hyf_font = 0;
+ clang = char_lang(wordstart);
+ lhmin = char_lhmin(wordstart);
+ rhmin = char_rhmin(wordstart);
+ langdata.pre_hyphen_char = get_pre_hyphen_char(clang);
+ langdata.post_hyphen_char = get_post_hyphen_char(clang);
+ while (r != null &&
+ type(r) == glyph_node &&
+ is_simple_character(r) &&
+ clang == char_lang(r) &&
+ (lchar = get_lc_code(character(r))) > 0) {
+ wordlen++;
+ hy = utf8_idpb(hy, character(r));
+ /* this should not be needed any more */
+ /*if (vlink(r)!=null) alink(vlink(r))=r; */
+ end_word = r;
+ r = vlink(r);
+ }
+ if (valid_wordend(r) && wordlen >= lhmin + rhmin
+ && (hyf_font != 0) && (lang = tex_languages[clang]) != NULL) {
+ *hy = 0;
+ if (lang->exceptions != 0 &&
+ (replacement =
+ hyphenation_exception(lang->exceptions, utf8word)) != NULL) {
#ifdef VERBOSE
- fprintf(stderr,"replacing %s (c=%d) by %s\n",utf8word,clang,replacement);
-#endif
- do_exception(wordstart,r,replacement);
- free(replacement);
- } else if (lang->patterns!=NULL) {
-
- left = wordstart;
- for (i=lhmin;i>1;i--) {
- left = vlink(left);
- while (!is_simple_character(left))
- left = vlink(left);
- }
- right = r;
- for (i=rhmin;i>0;i--) {
- right = alink(right);
- while (!is_simple_character(right))
- right = alink(right);
- }
-
+ fprintf(stderr, "replacing %s (c=%d) by %s\n", utf8word, clang,
+ replacement);
+#endif
+ do_exception(wordstart, r, replacement);
+ free(replacement);
+ } else if (lang->patterns != NULL) {
+
+ left = wordstart;
+ for (i = lhmin; i > 1; i--) {
+ left = vlink(left);
+ while (!is_simple_character(left))
+ left = vlink(left);
+ }
+ right = r;
+ for (i = rhmin; i > 0; i--) {
+ right = alink(right);
+ while (!is_simple_character(right))
+ right = alink(right);
+ }
+
#ifdef VERBOSE
- fprintf(stderr,"hyphenate %s (c=%d,l=%d,r=%d) from %c to %c\n",utf8word,
- clang,lhmin,rhmin,
- character(left), character(right));
-#endif
- (void)hnj_hyphen_hyphenate(lang->patterns,wordstart,r,wordlen,left,right, &langdata);
- }
- }
- wordlen = 0;
- hy = utf8word;
- if (r==null)
- break;
- r = find_next_wordstart(r);
- }
- flush_node(vlink(tail));
- vlink(tail) = save_tail;
-}
-
-
-void
-new_hyphenation (halfword head, halfword tail) {
- register int callback_id = 0;
- if (head==null || vlink(head)==null)
- return;
- fix_node_list (head); /* TODO: use couple_nodes() in append_tail()!*/
- callback_id = callback_defined(hyphenate_callback);
- if (callback_id>0) {
- lua_State *L = Luas[0];
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1, callback_id);
- if (!lua_isfunction(L,-1)) {
- lua_pop(L,2);
- return;
- }
- nodelist_to_lua(L,head);
- nodelist_to_lua(L,tail);
- if (lua_pcall(L,2,0,0) != 0) {
- fprintf(stdout,"error: %s\n",lua_tostring(L,-1));
- lua_pop(L,2);
- lua_error(L);
- return;
- }
- lua_pop(L,1);
- } else {
- hnj_hyphenation(head,tail);
- }
+ fprintf(stderr, "hyphenate %s (c=%d,l=%d,r=%d) from %c to %c\n",
+ utf8word, clang, lhmin, rhmin, character(left),
+ character(right));
+#endif
+ (void) hnj_hyphen_hyphenate(lang->patterns, wordstart, end_word,
+ wordlen, left, right, &langdata);
+ }
+ }
+ wordlen = 0;
+ hy = utf8word;
+ if (r == null)
+ break;
+ r = find_next_wordstart(r);
+ }
+ flush_node(vlink(tail));
+ vlink(tail) = save_tail;
+}
+
+
+void new_hyphenation(halfword head, halfword tail)
+{
+ register int callback_id = 0;
+ if (head == null || vlink(head) == null)
+ return;
+ fix_node_list(head); /* TODO: use couple_nodes() in append_tail()! */
+ callback_id = callback_defined(hyphenate_callback);
+ if (callback_id > 0) {
+ lua_State *L = Luas;
+ if (!get_callback(L, callback_id)) {
+ lua_pop(L, 2);
+ return;
+ }
+ nodelist_to_lua(L, head);
+ nodelist_to_lua(L, tail);
+ if (lua_pcall(L, 2, 0, 0) != 0) {
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ lua_error(L);
+ return;
+ }
+ lua_pop(L, 1);
+ } else {
+ hnj_hyphenation(head, tail);
+ }
}
/* dumping and undumping fonts */
-#define dump_string(a) \
- if (a!=NULL) { \
- x = strlen(a)+1; \
- dump_int(x); dump_things(*a, x); \
- } else { \
- x = 0; dump_int(x); \
+#define dump_string(a) \
+ if (a!=NULL) { \
+ x = strlen(a)+1; \
+ dump_int(x); dump_things(*a, x); \
+ } else { \
+ x = 0; dump_int(x); \
}
-void dump_one_language (int i) {
- char *s = NULL;
- unsigned x = 0;
- struct tex_language *lang;
- lang = tex_languages[i];
- dump_int(lang->id);
- dump_int(lang->pre_hyphen_char);
- dump_int(lang->post_hyphen_char);
- if (lang->patterns!=NULL) {
- s = (char *)hnj_serialize(lang->patterns);
- }
- dump_string(s);
- if (s!=NULL) {
- free(s);
- s = NULL;
- }
- if (lang->exceptions!=0)
- s = exception_strings(lang);
- dump_string(s);
- if (s!=NULL) {
- free(s);
- }
- free (lang);
+void dump_one_language(int i)
+{
+ char *s = NULL;
+ unsigned x = 0;
+ struct tex_language *lang;
+ lang = tex_languages[i];
+ dump_int(lang->id);
+ dump_int(lang->pre_hyphen_char);
+ dump_int(lang->post_hyphen_char);
+ dump_int(lang->pre_exhyphen_char);
+ dump_int(lang->post_exhyphen_char);
+ if (lang->patterns != NULL) {
+ s = (char *) hnj_serialize(lang->patterns);
+ }
+ dump_string(s);
+ if (s != NULL) {
+ free(s);
+ s = NULL;
+ }
+ if (lang->exceptions != 0)
+ s = exception_strings(lang);
+ dump_string(s);
+ if (s != NULL) {
+ free(s);
+ }
+ free(lang);
}
-void dump_language_data (void) {
- int i;
- dump_int(next_lang_id);
- for (i=0;i<next_lang_id;i++) {
- if (tex_languages[i]) {
- dump_int(1);
- dump_one_language(i);
- } else {
- dump_int(0);
+void dump_language_data(void)
+{
+ int i;
+ dump_int(next_lang_id);
+ for (i = 0; i < next_lang_id; i++) {
+ if (tex_languages[i]) {
+ dump_int(1);
+ dump_one_language(i);
+ } else {
+ dump_int(0);
+ }
}
- }
}
-void undump_one_language (int i) {
- char *s = NULL;
- unsigned x = 0;
- struct tex_language *lang = get_language(i);
- undump_int(x); lang->id = x;
- undump_int(x); lang->pre_hyphen_char = x;
- undump_int(x); lang->post_hyphen_char = x;
- /* patterns */
- undump_int (x);
- if (x>0) {
- s = xmalloc(x);
- undump_things(*s,x);
- load_patterns(lang,(unsigned char *)s);
- free(s);
- }
- /* exceptions */
- undump_int (x);
- if (x>0) {
- s = xmalloc(x);
- undump_things(*s,x);
- load_hyphenation(lang,(unsigned char *)s);
- free(s);
- }
-}
-
-void undump_language_data (void) {
- unsigned i, x, numlangs;
- undump_int(numlangs);
- for (i=0;i<numlangs;i++) {
+void undump_one_language(int i)
+{
+ char *s = NULL;
+ unsigned x = 0;
+ struct tex_language *lang = get_language(i);
+ undump_int(x);
+ lang->id = x;
+ undump_int(x);
+ lang->pre_hyphen_char = x;
undump_int(x);
- if (x==1) {
- undump_one_language(i);
+ lang->post_hyphen_char = x;
+ undump_int(x);
+ lang->pre_exhyphen_char = x;
+ undump_int(x);
+ lang->post_exhyphen_char = x;
+ /* patterns */
+ undump_int(x);
+ if (x > 0) {
+ s = xmalloc(x);
+ undump_things(*s, x);
+ load_patterns(lang, (unsigned char *) s);
+ free(s);
+ }
+ /* exceptions */
+ undump_int(x);
+ if (x > 0) {
+ s = xmalloc(x);
+ undump_things(*s, x);
+ load_hyphenation(lang, (unsigned char *) s);
+ free(s);
}
- }
}
+void undump_language_data(void)
+{
+ unsigned i, x, numlangs;
+ undump_int(numlangs);
+ next_lang_id = numlangs;
+ for (i = 0; i < numlangs; i++) {
+ undump_int(x);
+ if (x == 1) {
+ undump_one_language(i);
+ }
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
index 09e94fda2e9..c85a1912e49 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
@@ -1,149 +1,175 @@
-/* $Id: lcallbacklib.c 1013 2008-02-14 00:09:02Z oneiros $ */
+/* lcallbacklib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
-extern int do_run_callback (int special, char *values, va_list vl);
+static const char _svn_version[] =
+ "$Id: lcallbacklib.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/lcallbacklib.c $";
-int callback_set[total_callbacks] = {0};
+extern int do_run_callback(int special, char *values, va_list vl);
+extern int lua_traceback(lua_State * L);
+
+int callback_count = 0;
+int saved_callback_count = 0;
+
+int callback_set[total_callbacks] = { 0 };
static const char *const callbacknames[] = {
- "", /* empty on purpose */
- "find_write_file",
- "find_output_file",
- "find_image_file",
- "find_format_file",
- "find_read_file", "open_read_file",
- "find_ocp_file", "read_ocp_file",
- "find_vf_file", "read_vf_file",
- "find_data_file", "read_data_file",
- "find_font_file", "read_font_file",
- "find_map_file", "read_map_file",
- "find_enc_file", "read_enc_file",
- "find_type1_file", "read_type1_file",
- "find_truetype_file", "read_truetype_file",
- "find_opentype_file", "read_opentype_file",
- "find_sfd_file", "read_sfd_file",
- "find_pk_file", "read_pk_file",
- "show_error_hook",
- "process_input_buffer",
- "start_page_number", "stop_page_number",
- "start_run", "stop_run",
- "define_font",
- "token_filter",
- "pre_output_filter",
- "buildpage_filter",
- "hpack_filter", "vpack_filter",
- "char_exists",
- "hyphenate",
- "ligaturing",
- "kerning",
- "pre_linebreak_filter",
- "linebreak_filter",
- "post_linebreak_filter",
- NULL };
+ "", /* empty on purpose */
+ "find_write_file",
+ "find_output_file",
+ "find_image_file",
+ "find_format_file",
+ "find_read_file", "open_read_file",
+ "find_ocp_file", "read_ocp_file",
+ "find_vf_file", "read_vf_file",
+ "find_data_file", "read_data_file",
+ "find_font_file", "read_font_file",
+ "find_map_file", "read_map_file",
+ "find_enc_file", "read_enc_file",
+ "find_type1_file", "read_type1_file",
+ "find_truetype_file", "read_truetype_file",
+ "find_opentype_file", "read_opentype_file",
+ "find_sfd_file", "read_sfd_file",
+ "find_pk_file", "read_pk_file",
+ "show_error_hook",
+ "process_input_buffer",
+ "start_page_number", "stop_page_number",
+ "start_run", "stop_run",
+ "define_font",
+ "token_filter",
+ "pre_output_filter",
+ "buildpage_filter",
+ "hpack_filter", "vpack_filter",
+ "char_exists",
+ "hyphenate",
+ "ligaturing",
+ "kerning",
+ "pre_linebreak_filter",
+ "linebreak_filter",
+ "post_linebreak_filter",
+ "mlist_to_hlist",
+ NULL
+};
int callback_callbacks_id = 0;
-void
-get_lua_boolean (char *table, char *name, boolean *target) {
- int stacktop;
- stacktop = lua_gettop(Luas[0]);
- luaL_checkstack(Luas[0],2,"out of stack space");
- lua_getglobal(Luas[0],table);
- if (lua_istable(Luas[0],-1)) {
- lua_getfield(Luas[0],-1,name);
- if (lua_isboolean(Luas[0],-1)) {
- *target = (lua_toboolean(Luas[0],-1));
- } else if (lua_isnumber(Luas[0],-1)) {
- *target = (lua_tonumber(Luas[0],-1)==0 ? 0 : 1);
+void get_lua_boolean(char *table, char *name, boolean * target)
+{
+ int stacktop;
+ stacktop = lua_gettop(Luas);
+ luaL_checkstack(Luas, 2, "out of stack space");
+ lua_getglobal(Luas, table);
+ if (lua_istable(Luas, -1)) {
+ lua_getfield(Luas, -1, name);
+ if (lua_isboolean(Luas, -1)) {
+ *target = (lua_toboolean(Luas, -1));
+ } else if (lua_isnumber(Luas, -1)) {
+ *target = (lua_tonumber(Luas, -1) == 0 ? 0 : 1);
+ }
}
- }
- lua_settop(Luas[0],stacktop);
- return;
+ lua_settop(Luas, stacktop);
+ return;
}
-void
-get_saved_lua_boolean (int r, char *name, boolean *target) {
- int stacktop;
- stacktop = lua_gettop(Luas[0]);
- luaL_checkstack(Luas[0],2,"out of stack space");
- lua_rawgeti(Luas[0],LUA_REGISTRYINDEX,r);
- if (lua_istable(Luas[0],-1)) {
- lua_getfield(Luas[0],-1,name);
- if (lua_isboolean(Luas[0],-1)) {
- *target = lua_toboolean(Luas[0],-1);
- } else if (lua_isnumber(Luas[0],-1)) {
- *target = (lua_tonumber(Luas[0],-1)==0 ? 0 : 1);
- }
- }
- lua_settop(Luas[0],stacktop);
- return;
+void get_saved_lua_boolean(int r, char *name, boolean * target)
+{
+ int stacktop;
+ stacktop = lua_gettop(Luas);
+ luaL_checkstack(Luas, 2, "out of stack space");
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, r);
+ if (lua_istable(Luas, -1)) {
+ lua_getfield(Luas, -1, name);
+ if (lua_isboolean(Luas, -1)) {
+ *target = lua_toboolean(Luas, -1);
+ } else if (lua_isnumber(Luas, -1)) {
+ *target = (lua_tonumber(Luas, -1) == 0 ? 0 : 1);
+ }
+ }
+ lua_settop(Luas, stacktop);
+ return;
}
-void
-get_lua_number (char *table, char *name, integer *target) {
- int stacktop;
- stacktop = lua_gettop(Luas[0]);
- luaL_checkstack(Luas[0],2,"out of stack space");
- lua_getglobal(Luas[0],table);
- if (lua_istable(Luas[0],-1)) {
- lua_getfield(Luas[0],-1,name);
- if (lua_isnumber(Luas[0],-1)) {
- *target = lua_tonumber(Luas[0],-1);
+void get_lua_number(char *table, char *name, integer * target)
+{
+ int stacktop;
+ stacktop = lua_gettop(Luas);
+ luaL_checkstack(Luas, 2, "out of stack space");
+ lua_getglobal(Luas, table);
+ if (lua_istable(Luas, -1)) {
+ lua_getfield(Luas, -1, name);
+ if (lua_isnumber(Luas, -1)) {
+ *target = lua_tonumber(Luas, -1);
+ }
}
- }
- lua_settop(Luas[0],stacktop);
- return;
+ lua_settop(Luas, stacktop);
+ return;
}
-void
-get_saved_lua_number (int r, char *name, integer *target) {
- int stacktop;
- stacktop = lua_gettop(Luas[0]);
- luaL_checkstack(Luas[0],2,"out of stack space");
- lua_rawgeti(Luas[0],LUA_REGISTRYINDEX,r);
- if (lua_istable(Luas[0],-1)) {
- lua_getfield(Luas[0],-1,name);
- if (lua_isnumber(Luas[0],-1)) {
- *target = lua_tonumber(Luas[0],-1);
- }
- }
- lua_settop(Luas[0],stacktop);
- return;
+void get_saved_lua_number(int r, char *name, integer * target)
+{
+ int stacktop;
+ stacktop = lua_gettop(Luas);
+ luaL_checkstack(Luas, 2, "out of stack space");
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, r);
+ if (lua_istable(Luas, -1)) {
+ lua_getfield(Luas, -1, name);
+ if (lua_isnumber(Luas, -1)) {
+ *target = lua_tonumber(Luas, -1);
+ }
+ }
+ lua_settop(Luas, stacktop);
+ return;
}
-void
-get_lua_string (char *table, char *name, char **target) {
- int stacktop;
- stacktop = lua_gettop(Luas[0]);
- luaL_checkstack(Luas[0],2,"out of stack space");
- lua_getglobal(Luas[0],table);
- if (lua_istable(Luas[0],-1)) {
- lua_getfield(Luas[0],-1,name);
- if (lua_isstring(Luas[0],-1)) {
- *target = (char *)lua_tostring(Luas[0],-1);
+void get_lua_string(char *table, char *name, char **target)
+{
+ int stacktop;
+ stacktop = lua_gettop(Luas);
+ luaL_checkstack(Luas, 2, "out of stack space");
+ lua_getglobal(Luas, table);
+ if (lua_istable(Luas, -1)) {
+ lua_getfield(Luas, -1, name);
+ if (lua_isstring(Luas, -1)) {
+ *target = (char *) lua_tostring(Luas, -1);
+ }
}
- }
- lua_settop(Luas[0],stacktop);
- return;
+ lua_settop(Luas, stacktop);
+ return;
}
-void
-get_saved_lua_string (int r, char *name, char **target) {
- int stacktop;
- stacktop = lua_gettop(Luas[0]);
- luaL_checkstack(Luas[0],2,"out of stack space");
- lua_rawgeti(Luas[0],LUA_REGISTRYINDEX,r);
- if (lua_istable(Luas[0],-1)) {
- lua_getfield(Luas[0],-1,name);
- if (lua_isstring(Luas[0],-1)) {
- *target = (char *)lua_tostring(Luas[0],-1);
- }
- }
- lua_settop(Luas[0],stacktop);
- return;
+void get_saved_lua_string(int r, char *name, char **target)
+{
+ int stacktop;
+ stacktop = lua_gettop(Luas);
+ luaL_checkstack(Luas, 2, "out of stack space");
+ lua_rawgeti(Luas, LUA_REGISTRYINDEX, r);
+ if (lua_istable(Luas, -1)) {
+ lua_getfield(Luas, -1, name);
+ if (lua_isstring(Luas, -1)) {
+ *target = (char *) lua_tostring(Luas, -1);
+ }
+ }
+ lua_settop(Luas, stacktop);
+ return;
}
@@ -154,311 +180,340 @@ get_saved_lua_string (int r, char *name, char **target) {
#define CALLBACK_STRING 'S'
#define CALLBACK_CHARNUM 'c'
-int
-run_saved_callback (int r, char *name, char *values, ...) {
- va_list args;
- int ret = 0;
- lua_State *L = Luas[0];
- int stacktop = lua_gettop(L);
- va_start(args,values);
- luaL_checkstack(L,2,"out of stack space");
- lua_rawgeti(L,LUA_REGISTRYINDEX,r);
- lua_pushstring(L,name);
- lua_rawget(L,-2);
- if (lua_isfunction(L,-1)) {
- ret = do_run_callback(2,values,args);
- }
- va_end(args);
- lua_settop(L,stacktop);
- return ret;
+
+int run_saved_callback(int r, char *name, char *values, ...)
+{
+ va_list args;
+ int ret = 0;
+ lua_State *L = Luas;
+ int stacktop = lua_gettop(L);
+ va_start(args, values);
+ luaL_checkstack(L, 2, "out of stack space");
+ lua_rawgeti(L, LUA_REGISTRYINDEX, r);
+ lua_pushstring(L, name);
+ lua_rawget(L, -2);
+ if (lua_isfunction(L, -1)) {
+ saved_callback_count++;
+ callback_count++;
+ ret = do_run_callback(2, values, args);
+ }
+ va_end(args);
+ lua_settop(L, stacktop);
+ return ret;
}
-int
-run_and_save_callback (int i, char *values, ...) {
- va_list args;
- int ret = 0;
- lua_State *L = Luas[0];
- int stacktop = lua_gettop(L);
- va_start(args,values);
- luaL_checkstack(L,2,"out of stack space");
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1,i);
- if (lua_isfunction(L,-1)) {
- ret = do_run_callback(1,values,args);
- }
- va_end(args);
- if (ret>0) {
- ret = luaL_ref(L,LUA_REGISTRYINDEX);
- }
- lua_settop(L,stacktop);
- return ret;
+boolean get_callback(lua_State * L, int i)
+{
+ luaL_checkstack(L, 2, "out of stack space");
+ lua_rawgeti(L, LUA_REGISTRYINDEX, callback_callbacks_id);
+ lua_rawgeti(L, -1, i);
+ if (lua_isfunction(L, -1)) {
+ callback_count++;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+int run_and_save_callback(int i, char *values, ...)
+{
+ va_list args;
+ int ret = 0;
+ lua_State *L = Luas;
+ int stacktop = lua_gettop(L);
+ va_start(args, values);
+ if (get_callback(L, i)) {
+ ret = do_run_callback(1, values, args);
+ }
+ va_end(args);
+ if (ret > 0) {
+ ret = luaL_ref(L, LUA_REGISTRYINDEX);
+ }
+ lua_settop(L, stacktop);
+ return ret;
}
-int
-run_callback (int i, char *values, ...) {
- va_list args;
- int ret = 0;
- lua_State *L = Luas[0];
- int stacktop = lua_gettop(L);
- va_start(args,values);
- luaL_checkstack(L,2,"out of stack space");
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1, i);
- if (lua_isfunction(L,-1)) {
- ret = do_run_callback(0,values,args);
- }
- va_end(args);
- lua_settop(L,stacktop);
- return ret;
+int run_callback(int i, char *values, ...)
+{
+ va_list args;
+ int ret = 0;
+ lua_State *L = Luas;
+ int stacktop = lua_gettop(L);
+ va_start(args, values);
+ if (get_callback(L, i)) {
+ ret = do_run_callback(0, values, args);
+ }
+ va_end(args);
+ lua_settop(L, stacktop);
+ return ret;
}
-int
-do_run_callback (int special, char *values, va_list vl) {
- int ret, len;
- int narg,nres;
- char *s;
- char cs;
- int *bufloc;
- char *ss = NULL;
- int retval = 0;
- lua_State *L = Luas[0];
- if (special==2) { /* copy the enclosing table */
- luaL_checkstack(L,1,"out of stack space");
- lua_pushvalue(L,-2);
- }
- for (narg = 0; *values; narg++) {
- luaL_checkstack(L,1,"out of stack space");
- switch (*values++) {
- case CALLBACK_CHARNUM: /* an ascii char! */
- cs = (char)va_arg(vl, int);
- lua_pushlstring(L,&cs, 1);
- break;
- case CALLBACK_STRING: /* C string */
- s = va_arg(vl, char *);
- lua_pushstring(L, s);
- break;
- case CALLBACK_INTEGER: /* int */
- lua_pushnumber(L, va_arg(vl, int));
- break;
- case CALLBACK_STRNUMBER: /* TeX string */
- s = makeclstring(va_arg(vl, int),&len);
- lua_pushlstring(L, s,len);
- break;
- case CALLBACK_BOOLEAN: /* boolean */
- lua_pushboolean(L, va_arg(vl, int));
- break;
- case CALLBACK_LINE: /* a buffer section, with implied start */
- lua_pushlstring(L, (char *)(buffer+first), va_arg(vl, int));
- break;
- case '-':
- narg--;
- break;
- case '>':
- goto ENDARGS;
- default :
- ;
+int do_run_callback(int special, char *values, va_list vl)
+{
+ int ret;
+ size_t len;
+ int narg, nres;
+ const char *s;
+ char cs;
+ int *bufloc;
+ char *ss = NULL;
+ int retval = 0;
+ lua_State *L = Luas;
+ if (special == 2) { /* copy the enclosing table */
+ luaL_checkstack(L, 1, "out of stack space");
+ lua_pushvalue(L, -2);
}
- }
- ENDARGS:
- nres = strlen(values);
- if (special==1) {
- nres++;
- }
- if (special==2) {
- narg++;
- }
- if(lua_pcall(L,narg,nres,0) != 0) {
- /* Can't be more precise here, could be called before
- * TeX initialization is complete
- */
- fprintf(stderr,"This went wrong: %s\n",lua_tostring(L,-1));
- error();
- return 0;
- };
- if (nres==0) {
- return 1;
- }
- nres = -nres;
- while (*values) {
- int b;
- switch (*values++) {
- case CALLBACK_BOOLEAN:
- if (!lua_isboolean(L,nres)) {
- fprintf(stderr,"Expected a boolean, not: %s\n", lua_typename(L,lua_type(L,nres)));
- goto EXIT;
- }
- b = lua_toboolean(L,nres);
- *va_arg(vl, boolean *) = (boolean)b;
- break;
- case CALLBACK_INTEGER:
- if (!lua_isnumber(L,nres)) {
- fprintf(stderr,"Expected a number, not: %s\n", lua_typename(L,lua_type(L,nres)));
- goto EXIT;
- }
- b = lua_tonumber(L,nres);
- *va_arg(vl, int *) = b;
- break;
- case CALLBACK_LINE: /* TeX line */
- if (!lua_isstring(L,nres)) {
- if (!lua_isnil(L,nres))
- fprintf(stderr,"Expected a string for (l), not: %s\n",
- lua_typename(L,lua_type(L,nres)));
- goto EXIT;
- }
- s = (char *)lua_tolstring(L,nres, (size_t *)&len);
- if (s!=NULL) { /* |len| can be zero */
- bufloc = va_arg(vl, int *);
- ret = *bufloc;
- check_buffer_overflow (ret+len);
- while (len--) {
- buffer[(*bufloc)++] = *s++;
- }
- while ((*bufloc)-1>ret && buffer[(*bufloc)-1] == ' ')
- (*bufloc)--;
- } else {
- bufloc = 0;
- }
- break;
- case CALLBACK_STRNUMBER: /* TeX string */
- if (!lua_isstring(L,nres)) {
- if (!lua_isnil(L,nres)) {
- fprintf(stderr,"Expected a string for (s), not: %s\n",
- lua_typename(L,lua_type(L,nres)));
- goto EXIT;
- }
- }
- s = (char *)lua_tolstring(L,nres,(size_t *)&len);
- if (s==NULL) /* |len| can be zero */
- *va_arg(vl, int *) = 0;
- else {
- *va_arg(vl, int *) = maketexlstring(s,len);
- }
- break;
- case CALLBACK_STRING: /* C string aka buffer */
- if (!lua_isstring(L,nres)) {
- if (!lua_isnil(L,nres)) {
- fprintf(stderr,"Expected a string for (S), not: %s\n",
- lua_typename(L,lua_type(L,nres)));
- goto EXIT;
- }
- }
- s = (char *)lua_tolstring(L,nres,(size_t *)&len);
-
- if (s==NULL) /* |len| can be zero */
- *va_arg(vl, int *) = 0;
- else {
- ss = xmalloc(len+1);
- (void)memcpy(ss,s,(len+1));
- *va_arg(vl, char **) = ss;
- }
- break;
- default:
- fprintf(stdout,"invalid return value type");
- goto EXIT;
+ ss = index(values, '>');
+ assert(ss);
+ luaL_checkstack(L, (ss - values + 1), "out of stack space");
+ ss = NULL;
+ for (narg = 0; *values; narg++) {
+ switch (*values++) {
+ case CALLBACK_CHARNUM: /* an ascii char! */
+ cs = (char) va_arg(vl, int);
+ lua_pushlstring(L, &cs, 1);
+ break;
+ case CALLBACK_STRING: /* C string */
+ s = va_arg(vl, char *);
+ lua_pushstring(L, s);
+ break;
+ case CALLBACK_INTEGER: /* int */
+ lua_pushnumber(L, va_arg(vl, int));
+ break;
+ case CALLBACK_STRNUMBER: /* TeX string */
+ s = makeclstring(va_arg(vl, int), &len);
+ lua_pushlstring(L, s, len);
+ break;
+ case CALLBACK_BOOLEAN: /* boolean */
+ lua_pushboolean(L, va_arg(vl, int));
+ break;
+ case CALLBACK_LINE: /* a buffer section, with implied start */
+ lua_pushlstring(L, (char *) (buffer + first), va_arg(vl, int));
+ break;
+ case '-':
+ narg--;
+ break;
+ case '>':
+ goto ENDARGS;
+ default:
+ ;
+ }
+ }
+ ENDARGS:
+ nres = strlen(values);
+ if (special == 1) {
+ nres++;
+ }
+ if (special == 2) {
+ narg++;
+ }
+ {
+ int i;
+ lua_active++;
+ i = lua_pcall(L, narg, nres, 0);
+ lua_active--;
+ /* lua_remove(L, base); *//* remove traceback function */
+ if (i != 0) {
+ /* Can't be more precise here, could be called before
+ * TeX initialization is complete
+ */
+ if (!log_opened) {
+ fprintf(stderr, "This went wrong: %s\n", lua_tostring(L, -1));
+ error();
+ } else {
+ lua_gc(L, LUA_GCCOLLECT, 0);
+ luatex_error(L, (i == LUA_ERRRUN ? 0 : 1));
+ }
+ return 0;
+ }
+ }
+ if (nres == 0) {
+ return 1;
+ }
+ nres = -nres;
+ while (*values) {
+ int b;
+ switch (*values++) {
+ case CALLBACK_BOOLEAN:
+ if (!lua_isboolean(L, nres)) {
+ fprintf(stderr, "Expected a boolean, not: %s\n",
+ lua_typename(L, lua_type(L, nres)));
+ goto EXIT;
+ }
+ b = lua_toboolean(L, nres);
+ *va_arg(vl, boolean *) = (boolean) b;
+ break;
+ case CALLBACK_INTEGER:
+ if (!lua_isnumber(L, nres)) {
+ fprintf(stderr, "Expected a number, not: %s\n",
+ lua_typename(L, lua_type(L, nres)));
+ goto EXIT;
+ }
+ b = lua_tonumber(L, nres);
+ *va_arg(vl, int *) = b;
+ break;
+ case CALLBACK_LINE: /* TeX line */
+ if (!lua_isstring(L, nres)) {
+ if (!lua_isnil(L, nres))
+ fprintf(stderr, "Expected a string for (l), not: %s\n",
+ lua_typename(L, lua_type(L, nres)));
+ goto EXIT;
+ }
+ s = lua_tolstring(L, nres, &len);
+ if (s != NULL) { /* |len| can be zero */
+ bufloc = va_arg(vl, int *);
+ if (len != 0) {
+ ret = *bufloc;
+ check_buffer_overflow(ret + len);
+ strncpy((char *) (buffer + ret), s, len);
+ *bufloc += len;
+ /* while (len--) { buffer[(*bufloc)++] = *s++; } */
+ while ((*bufloc) - 1 > ret && buffer[(*bufloc) - 1] == ' ')
+ (*bufloc)--;
+ }
+ } else {
+ bufloc = 0;
+ }
+ break;
+ case CALLBACK_STRNUMBER: /* TeX string */
+ if (!lua_isstring(L, nres)) {
+ if (!lua_isnil(L, nres)) {
+ fprintf(stderr, "Expected a string for (s), not: %s\n",
+ lua_typename(L, lua_type(L, nres)));
+ goto EXIT;
+ }
+ }
+ s = lua_tolstring(L, nres, &len);
+ if (s == NULL) /* |len| can be zero */
+ *va_arg(vl, int *) = 0;
+ else {
+ *va_arg(vl, int *) = maketexlstring(s, len);
+ }
+ break;
+ case CALLBACK_STRING: /* C string aka buffer */
+ if (!lua_isstring(L, nres)) {
+ if (!lua_isnil(L, nres)) {
+ fprintf(stderr, "Expected a string for (S), not: %s\n",
+ lua_typename(L, lua_type(L, nres)));
+ goto EXIT;
+ }
+ }
+ s = lua_tolstring(L, nres, &len);
+
+ if (s == NULL) /* |len| can be zero */
+ *va_arg(vl, int *) = 0;
+ else {
+ ss = xmalloc(len + 1);
+ (void) memcpy(ss, s, (len + 1));
+ *va_arg(vl, char **) = ss;
+ }
+ break;
+ default:
+ fprintf(stdout, "invalid return value type");
+ goto EXIT;
+ }
+ nres++;
}
- nres++;
- }
- retval = 1;
- EXIT:
- return retval;
+ retval = 1;
+ EXIT:
+ return retval;
}
-void
-destroy_saved_callback (int i) {
- luaL_unref(Luas[0],LUA_REGISTRYINDEX,i);
+void destroy_saved_callback(int i)
+{
+ luaL_unref(Luas, LUA_REGISTRYINDEX, i);
}
-static int callback_register (lua_State *L) {
- int cb;
- char *s;
- if (!lua_isstring(L,1) ||
- ((!lua_isfunction(L,2)) && !lua_isnil(L,2))) {
- lua_pushnil(L);
- lua_pushstring(L,"Invalid arguments to callback.register.");
- return 2;
- }
- s = (char *)lua_tostring(L,1);
- for(cb=0;cb<total_callbacks;cb++) {
- if (strcmp(callbacknames[cb],s)==0)
- break;
- }
- if (cb==total_callbacks) {
- lua_pushnil(L);
- lua_pushstring(L,"No such callback exists.");
- return 2;
- }
- if (lua_isfunction(L,2)) {
- callback_set[cb]=cb;
- } else {
- callback_set[cb]=0;
- }
- luaL_checkstack(L,2,"out of stack space");
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id); /* push the table */
- lua_pushvalue(L,2); /* the function or nil */
- lua_rawseti(L,-2,cb);
- lua_rawseti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_pushnumber(L,cb);
- return 1;
+static int callback_register(lua_State * L)
+{
+ int cb;
+ char *s;
+ if (!lua_isstring(L, 1) || ((!lua_isfunction(L, 2)) && !lua_isnil(L, 2))) {
+ lua_pushnil(L);
+ lua_pushstring(L, "Invalid arguments to callback.register.");
+ return 2;
+ }
+ s = (char *) lua_tostring(L, 1);
+ for (cb = 0; cb < total_callbacks; cb++) {
+ if (strcmp(callbacknames[cb], s) == 0)
+ break;
+ }
+ if (cb == total_callbacks) {
+ lua_pushnil(L);
+ lua_pushstring(L, "No such callback exists.");
+ return 2;
+ }
+ if (lua_isfunction(L, 2)) {
+ callback_set[cb] = cb;
+ } else {
+ callback_set[cb] = 0;
+ }
+ luaL_checkstack(L, 2, "out of stack space");
+ lua_rawgeti(L, LUA_REGISTRYINDEX, callback_callbacks_id); /* push the table */
+ lua_pushvalue(L, 2); /* the function or nil */
+ lua_rawseti(L, -2, cb);
+ lua_rawseti(L, LUA_REGISTRYINDEX, callback_callbacks_id);
+ lua_pushnumber(L, cb);
+ return 1;
}
-static int callback_find (lua_State *L) {
- int cb;
- char * s;
- if (!lua_isstring(L,1)) {
- lua_pushnil(L);
- lua_pushstring(L,"Invalid arguments to callback.find.");
- return 2;
- }
- s = (char *)lua_tostring(L,1);
- for(cb=0;cb<total_callbacks;cb++) {
- if (strcmp(callbacknames[cb],s)==0)
- break;
- }
- if (cb==total_callbacks) {
- lua_pushnil(L);
- lua_pushstring(L,"No such callback exists.");
- return 2;
- }
- luaL_checkstack(L,2,"out of stack space");
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id); /* push the table */
- lua_rawgeti(L,-1,cb);
- return 1;
+static int callback_find(lua_State * L)
+{
+ int cb;
+ char *s;
+ if (!lua_isstring(L, 1)) {
+ lua_pushnil(L);
+ lua_pushstring(L, "Invalid arguments to callback.find.");
+ return 2;
+ }
+ s = (char *) lua_tostring(L, 1);
+ for (cb = 0; cb < total_callbacks; cb++) {
+ if (strcmp(callbacknames[cb], s) == 0)
+ break;
+ }
+ if (cb == total_callbacks) {
+ lua_pushnil(L);
+ lua_pushstring(L, "No such callback exists.");
+ return 2;
+ }
+ luaL_checkstack(L, 2, "out of stack space");
+ lua_rawgeti(L, LUA_REGISTRYINDEX, callback_callbacks_id); /* push the table */
+ lua_rawgeti(L, -1, cb);
+ return 1;
}
-static int callback_listf (lua_State *L) {
- int i;
- luaL_checkstack(L,3,"out of stack space");
- lua_newtable(L);
- for (i=1; callbacknames[i]; i++) {
- lua_pushstring(L,callbacknames[i]);
- if (callback_defined(i)) {
- lua_pushboolean(L,1);
- } else {
- lua_pushboolean(L,0);
+static int callback_listf(lua_State * L)
+{
+ int i;
+ luaL_checkstack(L, 3, "out of stack space");
+ lua_newtable(L);
+ for (i = 1; callbacknames[i]; i++) {
+ lua_pushstring(L, callbacknames[i]);
+ if (callback_defined(i)) {
+ lua_pushboolean(L, 1);
+ } else {
+ lua_pushboolean(L, 0);
+ }
+ lua_rawset(L, -3);
}
- lua_rawset(L,-3);
- }
- return 1;
+ return 1;
}
-static const struct luaL_reg callbacklib [] = {
- {"find", callback_find},
- {"register",callback_register},
- {"list", callback_listf},
- {NULL, NULL} /* sentinel */
+static const struct luaL_reg callbacklib[] = {
+ {"find", callback_find},
+ {"register", callback_register},
+ {"list", callback_listf},
+ {NULL, NULL} /* sentinel */
};
-int luaopen_callback (lua_State *L)
+int luaopen_callback(lua_State * L)
{
- luaL_register(L, "callback", callbacklib);
- luaL_checkstack(L,1,"out of stack space");
- lua_newtable(L);
- callback_callbacks_id = luaL_ref(L,LUA_REGISTRYINDEX);
- return 1;
+ luaL_register(L, "callback", callbacklib);
+ luaL_checkstack(L, 1, "out of stack space");
+ lua_newtable(L);
+ callback_callbacks_id = luaL_ref(L, LUA_REGISTRYINDEX);
+ return 1;
}
-
-
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
index 4bb5252daa7..6dd698ffe0a 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c
@@ -1,224 +1,246 @@
-/* $Id: lfontlib.c 1171 2008-04-16 13:56:53Z taco $ */
+/* lfontlib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+static const char _svn_version[] =
+ "$Id: lfontlib.c 1226 2008-05-02 16:11:02Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/lfontlib.c $";
+
/* this function is in vfovf.c for the moment */
-extern int make_vf_table(lua_State *L, char *name, scaled s);
-
-static int
-font_read_tfm (lua_State *L) {
- internalfontnumber f;
- scaled s;
- int k;
- char *cnom;
- if(lua_isstring(L, 1)) {
- cnom = (char *)lua_tostring(L, 1);
- if(lua_isnumber(L, 2)) {
- s = (integer)lua_tonumber(L,2);
- if (strlen(cnom)) {
- f = new_font();
- if (read_tfm_info(f, cnom, "", s)) {
- k = font_to_lua(L,f);
- delete_font(f);
- return k;
- } else {
- delete_font(f);
- lua_pushstring(L, "font loading failed");
- lua_error(L);
- }
- } else {
- lua_pushstring(L, "expected tfm name as first argument");
- lua_error(L);
- }
+extern int make_vf_table(lua_State * L, char *name, scaled s);
+
+static int font_read_tfm(lua_State * L)
+{
+ internalfontnumber f;
+ scaled s;
+ int k;
+ char *cnom;
+ if (lua_isstring(L, 1)) {
+ cnom = (char *) lua_tostring(L, 1);
+ if (lua_isnumber(L, 2)) {
+ s = (integer) lua_tonumber(L, 2);
+ if (strlen(cnom)) {
+ f = new_font();
+ if (read_tfm_info(f, cnom, "", s)) {
+ k = font_to_lua(L, f);
+ delete_font(f);
+ return k;
+ } else {
+ delete_font(f);
+ lua_pushstring(L, "font loading failed");
+ lua_error(L);
+ }
+ } else {
+ lua_pushstring(L, "expected tfm name as first argument");
+ lua_error(L);
+ }
+ } else {
+ lua_pushstring(L, "expected an integer size as second argument");
+ lua_error(L);
+ }
} else {
- lua_pushstring(L, "expected an integer size as second argument");
- lua_error(L);
+ lua_pushstring(L, "expected tfm name as first argument");
+ lua_error(L);
}
- } else {
- lua_pushstring(L, "expected tfm name as first argument");
- lua_error(L);
- }
- return 2; /* not reached */
+ return 2; /* not reached */
}
-static int
-font_read_vf (lua_State *L) {
- scaled s;
- char *cnom;
- if(lua_isstring(L, 1)) {
- cnom = (char *)lua_tostring(L, 1);
- if (strlen(cnom)) {
- if(lua_isnumber(L, 2)) {
- s = lua_tonumber(L,2);
- return make_vf_table(L,cnom,s);
- } else {
- lua_pushstring(L, "expected an integer size as second argument");
- lua_error(L);
- return 2;
- }
- }
- }
- lua_pushstring(L, "expected vf name as first argument");
- lua_error(L);
- return 2; /* not reached */
+static int font_read_vf(lua_State * L)
+{
+ scaled s;
+ char *cnom;
+ if (lua_isstring(L, 1)) {
+ cnom = (char *) lua_tostring(L, 1);
+ if (strlen(cnom)) {
+ if (lua_isnumber(L, 2)) {
+ s = lua_tonumber(L, 2);
+ return make_vf_table(L, cnom, s);
+ } else {
+ lua_pushstring(L,
+ "expected an integer size as second argument");
+ lua_error(L);
+ return 2;
+ }
+ }
+ }
+ lua_pushstring(L, "expected vf name as first argument");
+ lua_error(L);
+ return 2; /* not reached */
}
-static int
-tex_current_font (lua_State *L) {
- int i;
- i = (int)luaL_optinteger(L,1,0);
- if (i>0) {
- if (is_valid_font(i)) {
- zset_cur_font(i);
- return 0;
- } else {
- lua_pushstring(L, "expected a valid font id");
- lua_error(L);
- return 2; /* not reached */
- }
- } else {
- lua_pushnumber(L,get_cur_font());
- return 1;
- }
+static int tex_current_font(lua_State * L)
+{
+ int i;
+ i = (int) luaL_optinteger(L, 1, 0);
+ if (i > 0) {
+ if (is_valid_font(i)) {
+ zset_cur_font(i);
+ return 0;
+ } else {
+ lua_pushstring(L, "expected a valid font id");
+ lua_error(L);
+ return 2; /* not reached */
+ }
+ } else {
+ lua_pushnumber(L, get_cur_font());
+ return 1;
+ }
}
-static int
-tex_max_font (lua_State *L) {
- lua_pushnumber(L,max_font_id());
- return 1;
+static int tex_max_font(lua_State * L)
+{
+ lua_pushnumber(L, max_font_id());
+ return 1;
}
-static int
-tex_each_font_next (lua_State *L) {
- int i,m; /* id */
- m = lua_tonumber(L,1);
- i = lua_tonumber(L,2);
- i++;
- while(i<=m && !is_valid_font(i))
- i++;
- if (i>m) {
- lua_pushnil(L);
- return 1;
- } else {
- lua_pushnumber(L, i);
- font_to_lua (L, i);
- return 2;
- }
+static int tex_each_font_next(lua_State * L)
+{
+ int i, m; /* id */
+ m = lua_tonumber(L, 1);
+ i = lua_tonumber(L, 2);
+ i++;
+ while (i <= m && !is_valid_font(i))
+ i++;
+ if (i > m) {
+ lua_pushnil(L);
+ return 1;
+ } else {
+ lua_pushnumber(L, i);
+ font_to_lua(L, i);
+ return 2;
+ }
}
-static int
-tex_each_font (lua_State *L) {
- lua_pushcclosure(L, tex_each_font_next, 0);
- lua_pushnumber(L, max_font_id());
- lua_pushnumber(L, 0);
- return 3;
+static int tex_each_font(lua_State * L)
+{
+ lua_pushcclosure(L, tex_each_font_next, 0);
+ lua_pushnumber(L, max_font_id());
+ lua_pushnumber(L, 0);
+ return 3;
}
-static int
-frozenfont (lua_State *L) {
- int i;
- i = (int)luaL_checkinteger(L,1);
- if (i) {
- if (is_valid_font(i)) {
- if (font_touched(i) || font_used(i)) {
- lua_pushboolean(L,1);
- } else {
- lua_pushboolean(L,0);
- }
+static int frozenfont(lua_State * L)
+{
+ int i;
+ i = (int) luaL_checkinteger(L, 1);
+ if (i) {
+ if (is_valid_font(i)) {
+ if (font_touched(i) || font_used(i)) {
+ lua_pushboolean(L, 1);
+ } else {
+ lua_pushboolean(L, 0);
+ }
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
} else {
- lua_pushnil(L);
+ lua_pushstring(L, "expected an integer argument");
+ lua_error(L);
}
- return 1;
- } else {
- lua_pushstring(L, "expected an integer argument");
- lua_error(L);
- }
- return 0; /* not reached */
+ return 0; /* not reached */
}
-static int
-setfont (lua_State *L) {
- int i;
- i = (int)luaL_checkinteger(L,-2);
- if (i) {
- luaL_checktype(L,-1,LUA_TTABLE);
- if (is_valid_font(i)) {
- if (! (font_touched(i) || font_used(i))) {
- font_from_lua (L,i) ;
- } else {
- lua_pushstring(L, "that font has been accessed already, changing it is forbidden");
- lua_error(L);
- }
- } else {
- lua_pushstring(L, "that integer id is not a valid font");
- lua_error(L);
+static int setfont(lua_State * L)
+{
+ int i;
+ i = (int) luaL_checkinteger(L, -2);
+ if (i) {
+ luaL_checktype(L, -1, LUA_TTABLE);
+ if (is_valid_font(i)) {
+ if (!(font_touched(i) || font_used(i))) {
+ font_from_lua(L, i);
+ } else {
+ lua_pushstring(L,
+ "that font has been accessed already, changing it is forbidden");
+ lua_error(L);
+ }
+ } else {
+ lua_pushstring(L, "that integer id is not a valid font");
+ lua_error(L);
+ }
}
- }
- return 0;
+ return 0;
}
-static int
-deffont (lua_State *L) {
- int i;
- luaL_checktype(L,-1,LUA_TTABLE);
+static int deffont(lua_State * L)
+{
+ int i;
+ luaL_checktype(L, -1, LUA_TTABLE);
- i = new_font();
- if(font_from_lua (L,i)) {
- lua_pushnumber(L,i);
- return 1;
- } else {
- lua_pop(L,1); /* pop the broken table */
- delete_font(i);
- lua_pushstring(L, "font creation failed");
- lua_error(L);
- }
- return 0; /* not reached */
+ i = new_font();
+ if (font_from_lua(L, i)) {
+ lua_pushnumber(L, i);
+ return 1;
+ } else {
+ lua_pop(L, 1); /* pop the broken table */
+ delete_font(i);
+ lua_pushstring(L, "font creation failed");
+ lua_error(L);
+ }
+ return 0; /* not reached */
}
/* this returns the expected (!) next fontid. */
-static int
-nextfontid (lua_State *L) {
- int i = new_font();
- lua_pushnumber(L,i);
- delete_font(i);
- return 1;
+static int nextfontid(lua_State * L)
+{
+ int i = new_font();
+ lua_pushnumber(L, i);
+ delete_font(i);
+ return 1;
}
-static int
-getfont (lua_State *L) {
- int i;
- i = (int)luaL_checkinteger(L,-1);
- if (i && is_valid_font(i) && font_to_lua (L, i))
+static int getfont(lua_State * L)
+{
+ int i;
+ i = (int) luaL_checkinteger(L, -1);
+ if (i && is_valid_font(i) && font_to_lua(L, i))
+ return 1;
+ lua_pushnil(L);
return 1;
- lua_pushnil(L);
- return 1;
}
-static const struct luaL_reg fontlib [] = {
- {"read_tfm", font_read_tfm},
- {"read_vf", font_read_vf},
- {"current", tex_current_font},
- {"max", tex_max_font},
- {"each", tex_each_font},
- {"getfont", getfont},
- {"setfont", setfont},
- {"define", deffont},
- {"nextid", nextfontid},
- {"frozen", frozenfont},
- {NULL, NULL} /* sentinel */
+static const struct luaL_reg fontlib[] = {
+ {"read_tfm", font_read_tfm},
+ {"read_vf", font_read_vf},
+ {"current", tex_current_font},
+ {"max", tex_max_font},
+ {"each", tex_each_font},
+ {"getfont", getfont},
+ {"setfont", setfont},
+ {"define", deffont},
+ {"nextid", nextfontid},
+ {"frozen", frozenfont},
+ {NULL, NULL} /* sentinel */
};
-int luaopen_font (lua_State *L)
+int luaopen_font(lua_State * L)
{
- luaL_register(L, "font", fontlib);
- make_table(L,"fonts","getfont","setfont");
- return 1;
+ luaL_register(L, "font", fontlib);
+ make_table(L, "fonts", "getfont", "setfont");
+ return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/limglib.c b/Build/source/texk/web2c/luatexdir/lua/limglib.c
index 8f3f70ec718..44b3a04712d 100644
--- a/Build/source/texk/web2c/luatexdir/lua/limglib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/limglib.c
@@ -1,4 +1,21 @@
-/* $Id: limglib.c 1098 2008-03-09 10:28:19Z hhenkel $ */
+/* limglib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <string.h>
@@ -9,16 +26,18 @@
#include "../image/image.h"
#include "../luatex-api.h"
+static const char _svn_version[] =
+ "$Id: limglib.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/limglib.c $";
+
/**********************************************************************/
#ifdef DEBUG
-static void stackDump(lua_State * L, char *s)
+void stackDump(lua_State * L, char *s)
{
- int i;
- int top = lua_gettop(L);
+ int i, t, top = lua_gettop(L);
printf("\n=== stackDump <%s>: ", s);
- for (i = 1; i <= top; i++) { /* repeat for each level */
- int t = lua_type(L, i);
+ for (i = top; i >= 1; i--) { /* repeat for each level */
+ t = lua_type(L, i);
printf("%d: ", i);
switch (t) {
case LUA_TSTRING: /* strings */
@@ -42,10 +61,10 @@ static void stackDump(lua_State * L, char *s)
/**********************************************************************/
-typedef enum { P__ZERO, P_ATTR, P_COLORDEPTH, P_COLORSPACE, P_DEPTH, P_FILENAME,
- P_FILEPATH, P_HEIGHT, P_IMAGETYPE, P_INDEX, P_OBJNUM, P_PAGE, P_PAGEBOX,
- P_TOTALPAGES, P_TRANSFORM, P_WIDTH, P_XRES, P_XSIZE, P_YRES, P_YSIZE,
- P__SENTINEL
+typedef enum { P__ZERO, P_ATTR, P_BBOX, P_COLORDEPTH, P_COLORSPACE, P_DEPTH,
+ P_FILENAME, P_FILEPATH, P_HEIGHT, P_IMAGETYPE, P_INDEX, P_OBJNUM,
+ P_PAGE, P_PAGEBOX, P_TOTALPAGES, P_ROTATION, P_STREAM, P_TRANSFORM,
+ P_WIDTH, P_XRES, P_XSIZE, P_YRES, P_YSIZE, P__SENTINEL
} parm_idx;
typedef struct {
@@ -53,9 +72,10 @@ typedef struct {
parm_idx idx; /* index within img_parms array */
} parm_struct;
-parm_struct img_parms[] = {
+const parm_struct img_parms[] = {
{NULL, P__ZERO}, /* dummy; lua indices run from 1 */
{"attr", P_ATTR},
+ {"bbox", P_BBOX},
{"colordepth", P_COLORDEPTH},
{"colorspace", P_COLORSPACE},
{"depth", P_DEPTH},
@@ -68,6 +88,8 @@ parm_struct img_parms[] = {
{"page", P_PAGE},
{"pagebox", P_PAGEBOX},
{"pages", P_TOTALPAGES},
+ {"rotation", P_ROTATION},
+ {"stream", P_STREAM},
{"transform", P_TRANSFORM},
{"width", P_WIDTH},
{"xres", P_XRES},
@@ -77,8 +99,9 @@ parm_struct img_parms[] = {
{NULL, P__SENTINEL}
};
-#define imgtype_max 4
-const char *imgtype_s[] = { "none", "pdf", "png", "jpg", "jbig2", NULL };
+#define imgtype_max 5
+const char *imgtype_s[] =
+ { "none", "pdf", "png", "jpg", "jbig2", "stream", NULL };
#define pagebox_max 5
const char *pdfboxspec_s[] =
@@ -94,7 +117,7 @@ static void image_to_lua(lua_State * L, image * a)
lua_pushvalue(L, -1); /* k k u ... */
lua_gettable(L, LUA_ENVIRONINDEX); /* i? k u ... */
if (!lua_isnumber(L, -1)) /* !i k u ... */
- luaL_error(L, "image_to_lua not a valid image key: %s",
+ luaL_error(L, "image_to_lua(): %s is not a valid image key",
lua_tostring(L, -2));
i = lua_tointeger(L, -1); /* i k u ... */
lua_pop(L, 2); /* u ... */
@@ -148,11 +171,17 @@ static void image_to_lua(lua_State * L, image * a)
case P_TOTALPAGES:
lua_pushinteger(L, img_totalpages(d));
break;
- case P_XSIZE:
- lua_pushinteger(L, img_xsize(d));
+ case P_XSIZE: /* Modify by /Rotate only for output */
+ if ((img_rotation(d) & 1) == 0)
+ lua_pushinteger(L, img_xsize(d));
+ else
+ lua_pushinteger(L, img_ysize(d));
break;
- case P_YSIZE:
- lua_pushinteger(L, img_ysize(d));
+ case P_YSIZE: /* Modify by /Rotate only for output */
+ if ((img_rotation(d) & 1) == 0)
+ lua_pushinteger(L, img_ysize(d));
+ else
+ lua_pushinteger(L, img_xsize(d));
break;
case P_XRES:
lua_pushinteger(L, img_xres(d));
@@ -160,6 +189,9 @@ static void image_to_lua(lua_State * L, image * a)
case P_YRES:
lua_pushinteger(L, img_yres(d));
break;
+ case P_ROTATION:
+ lua_pushinteger(L, img_rotation(d));
+ break;
case P_COLORSPACE:
if (img_colorspace(d) == 0)
lua_pushnil(L);
@@ -175,7 +207,7 @@ static void image_to_lua(lua_State * L, image * a)
case P_IMAGETYPE:
j = img_type(d);
if (j >= 0 && j <= imgtype_max) {
- if (j == IMAGE_TYPE_NONE)
+ if (j == IMG_TYPE_NONE)
lua_pushnil(L);
else
lua_pushstring(L, imgtype_s[j]);
@@ -192,6 +224,27 @@ static void image_to_lua(lua_State * L, image * a)
} else
assert(0);
break;
+ case P_BBOX:
+ if (!img_is_bbox(d)) {
+ img_bbox(d)[0] = img_xorig(d);
+ img_bbox(d)[1] = img_yorig(d);
+ img_bbox(d)[2] = img_xorig(d) + img_xsize(d);
+ img_bbox(d)[3] = img_yorig(d) + img_ysize(d);
+ }
+ lua_newtable(L);
+ lua_pushinteger(L, 1);
+ lua_pushinteger(L, img_bbox(d)[0]);
+ lua_settable(L, -3);
+ lua_pushinteger(L, 2);
+ lua_pushinteger(L, img_bbox(d)[1]);
+ lua_settable(L, -3);
+ lua_pushinteger(L, 3);
+ lua_pushinteger(L, img_bbox(d)[2]);
+ lua_settable(L, -3);
+ lua_pushinteger(L, 4);
+ lua_pushinteger(L, img_bbox(d)[3]);
+ lua_settable(L, -3);
+ break;
case P_OBJNUM:
if (img_objnum(d) == 0)
lua_pushnil(L);
@@ -204,6 +257,14 @@ static void image_to_lua(lua_State * L, image * a)
else
lua_pushinteger(L, img_index(d));
break;
+ case P_STREAM:
+ if (img_type(d) != IMG_TYPE_PDFSTREAM || img_pdfstream_ptr(d) == NULL
+ || img_pdfstream_stream(d) == NULL
+ || strlen(img_pdfstream_stream(d)) == 0)
+ lua_pushnil(L);
+ else
+ lua_pushstring(L, img_pdfstream_stream(d));
+ break;
default:
assert(0);
} /* v u ... */
@@ -217,7 +278,7 @@ static void lua_to_image(lua_State * L, image * a)
lua_pushvalue(L, -2); /* k v k t ... */
lua_gettable(L, LUA_ENVIRONINDEX); /* i? v k t ... */
if (!lua_isnumber(L, -1)) /* !i v k t ... */
- luaL_error(L, "lua_to_image not a valid image key: %s",
+ luaL_error(L, "lua_to_image(): %s is not a valid image key",
lua_tostring(L, -3));
i = lua_tointeger(L, -1); /* i v k t ... */
lua_pop(L, 1); /* v k t ... */
@@ -277,6 +338,8 @@ static void lua_to_image(lua_State * L, image * a)
case P_FILENAME:
if (img_state(d) >= DICT_FILESCANNED)
luaL_error(L, "image.filename is now read-only");
+ if (img_type(d) == IMG_TYPE_PDFSTREAM)
+ luaL_error(L, "image.filename can't be used with image.stream");
if (lua_isstring(L, -1)) {
if (img_filename(d) != NULL)
xfree(img_filename(d));
@@ -331,12 +394,49 @@ static void lua_to_image(lua_State * L, image * a)
else
luaL_error(L, "image.pagebox needs string or nil value");
break;
+ case P_BBOX:
+ if (img_state(d) >= DICT_FILESCANNED)
+ luaL_error(L, "image.bbox is now read-only");
+ if (!lua_istable(L, -1))
+ luaL_error(L, "image.bbox needs table value");
+ if (lua_objlen(L, -1) != 4)
+ luaL_error(L, "image.bbox table must have exactly 4 elements");
+ for (i = 1; i <= 4; i++) { /* v k t ... */
+ lua_pushinteger(L, i); /* idx v k t ... */
+ lua_gettable(L, -2); /* int v k t ... */
+ if (lua_type(L, -1) == LUA_TNUMBER)
+ img_bbox(d)[i - 1] = lua_tointeger(L, -1);
+ else if (lua_type(L, -1) == LUA_TSTRING)
+ img_bbox(d)[i - 1] =
+ dimen_to_number(L, (char *) lua_tostring(L, -1));
+ else
+ luaL_error(L,
+ "image.bbox table needs integer value or dimension string elements");
+ lua_pop(L, 1); /* v k t ... */
+ }
+ img_set_bbox(d);
+ img_unset_scaled(a);
+ break;
+ case P_STREAM:
+ if (img_filename(d) != NULL)
+ luaL_error(L, "image.stream can't be used with image.filename");
+ if (img_state(d) >= DICT_FILESCANNED)
+ luaL_error(L, "image.stream is now read-only");
+ if (img_pdfstream_ptr(d) == NULL)
+ new_img_pdfstream_struct(d);
+ if (img_pdfstream_stream(d) != NULL)
+ xfree(img_pdfstream_stream(d));
+ img_pdfstream_stream(d) = xstrdup(lua_tostring(L, -1));
+ img_type(d) = IMG_TYPE_PDFSTREAM;
+ img_unset_scaled(a);
+ break;
case P_FILEPATH:
case P_TOTALPAGES:
case P_XSIZE:
case P_YSIZE:
case P_XRES:
case P_YRES:
+ case P_ROTATION:
case P_IMAGETYPE:
case P_OBJNUM:
case P_INDEX:
@@ -389,24 +489,24 @@ void copy_image(lua_State * L, lua_Number scale)
/**********************************************************************/
-static int l_new_image(lua_State * L)
+int l_new_image(lua_State * L)
{
image *a, **aa;
image_dict **add;
if (lua_gettop(L) > 1)
luaL_error(L, "img.new() needs maximum 1 argument");
- if (lua_gettop(L) == 1 && !lua_istable(L, 1))
+ if (lua_gettop(L) == 1 && !lua_istable(L, -1))
luaL_error(L, "img.new() needs table as optional argument"); /* (t) */
aa = (image **) lua_newuserdata(L, sizeof(image *)); /* i (t) */
luaL_getmetatable(L, TYPE_IMG); /* m i (t) */
lua_setmetatable(L, -2); /* i (t) */
a = *aa = new_image();
- add = (image_dict **) lua_newuserdata(L, sizeof(image_dict *)); /* ad i (t) */
+ add = (image_dict **) lua_newuserdata(L, sizeof(image_dict *)); /* ad i (t) */
luaL_getmetatable(L, TYPE_IMG_DICT); /* m ad i (t) */
lua_setmetatable(L, -2); /* ad i (t) */
img_dict(a) = *add = new_image_dict();
img_dictref(a) = luaL_ref(L, LUA_GLOBALSINDEX); /* i (t) */
- if (lua_gettop(L) != 1) { /* i t, else just i */
+ if (lua_gettop(L) == 2) { /* i t, else just i */
lua_insert(L, -2); /* t i */
lua_pushnil(L); /* n t i (1st key for iterator) */
while (lua_next(L, -2) != 0) { /* v k t i */
@@ -423,40 +523,62 @@ static int l_copy_image(lua_State * L)
if (lua_gettop(L) != 1)
luaL_error(L, "img.copy() needs exactly 1 argument");
if (lua_istable(L, 1))
- l_new_image(L); /* image --- if everything worked well */
+ (void) l_new_image(L); /* image --- if everything worked well */
else
- copy_image(L, 1.0); /* image */
+ (void) copy_image(L, 1.0); /* image */
return 1; /* image */
}
+static void read_scale_img(lua_State * L, image * a)
+{
+ image_dict *ad;
+ assert(a != NULL);
+ ad = img_dict(a);
+ assert(ad != NULL);
+ if (img_state(ad) == DICT_NEW) {
+ if (img_type(ad) == IMG_TYPE_PDFSTREAM)
+ check_pdfstream_dict(ad);
+ else {
+ /* check_pdfminorversion() should not be here, as it belongs
+ * to the output functions, and it is too early here to start
+ * already the PDF file only for image file scanning; but
+ * it's needed as several fixed_* parameters are used early,
+ * e. g. by read_png_info(). */
+ check_pdfminorversion();
+ read_img(ad, get_pdf_minor_version(),
+ get_pdf_inclusion_errorlevel());
+ img_unset_scaled(a);
+ }
+ }
+ fix_image_size(L, a);
+}
+
static int l_scan_image(lua_State * L)
{
image *a, **aa;
- image_dict *ad;
if (lua_gettop(L) != 1)
luaL_error(L, "img.scan() needs exactly 1 argument");
if (lua_istable(L, 1))
- l_new_image(L); /* image --- if everything worked well */
+ (void) l_new_image(L); /* image --- if everything worked well */
aa = (image **) luaL_checkudata(L, 1, TYPE_IMG); /* image */
a = *aa;
- ad = img_dict(a);
- if (img_state(ad) == DICT_NEW) {
- read_img(ad, get_pdf_minor_version(), get_pdf_inclusion_errorlevel());
- img_unset_scaled(a);
- }
- fix_image_size(L, a);
+ check_pdfoutput(maketexstring("img.scan()"), true);
+ flush_str(last_tex_string);
+ read_scale_img(L, a);
return 1; /* image */
}
-/* these should go into some header file... */
-#define obj_type_ximage 8
+/* DANGER! these should go into some header file... */
+#define obj_type_ximage 7
#define obj_aux(a) obj_tab[a].int4 /* auxiliary pointer */
#define obj_data_ptr obj_aux /* pointer to |pdf_mem| */
static halfword img_to_node(image * a, integer ref)
{
- image_dict *ad = img_dict(a);
+ image_dict *ad;
halfword n;
+ assert(a != NULL);
+ ad = img_dict(a);
assert(ad != NULL);
assert(img_objnum(ad) != 0);
n = new_node(whatsit_node, pdf_refximage_node);
@@ -467,44 +589,47 @@ static halfword img_to_node(image * a, integer ref)
return n;
}
-typedef enum { WR_WRITE, WR_IMMEDIATEWRITE, WR_NODE } wrtype_e;
+typedef enum { WR_WRITE, WR_IMMEDIATEWRITE, WR_NODE, WR_VF_IMG } wrtype_e;
const char *wrtype_s[] =
- { "img.write()", "img.immediatewrite()", "img.node()" };
+ { "img.write()", "img.immediatewrite()", "img.node()", "write vf image" };
extern void lua_nodelib_push_fast(lua_State * L, halfword n);
+static void setup_image(lua_State * L, image * a, wrtype_e writetype)
+{
+ image_dict *ad;
+ assert(a != NULL);
+ ad = img_dict(a);
+ check_pdfoutput(maketexstring(wrtype_s[writetype]), true);
+ flush_str(last_tex_string);
+ read_scale_img(L, a);
+ if (img_arrayidx(a) == -1)
+ img_arrayidx(a) = img_to_array(a); /* now a is read-only */
+ if (img_objnum(ad) == 0) { /* latest needed just before out_img() */
+ pdf_ximage_count++;
+ pdf_create_obj(obj_type_ximage, pdf_ximage_count);
+ img_objnum(ad) = obj_ptr;
+ img_index(ad) = pdf_ximage_count;
+ obj_data_ptr(obj_ptr) = img_arrayidx(a);
+ }
+}
+
static void write_image_or_node(lua_State * L, wrtype_e writetype)
{
image *a, **aa;
image_dict *ad;
halfword n;
- integer ref;
if (lua_gettop(L) != 1)
luaL_error(L, "%s needs exactly 1 argument", wrtype_s[writetype]);
if (lua_istable(L, 1))
- l_new_image(L); /* image --- if everything worked well */
+ (void) l_new_image(L); /* image --- if everything worked well */
aa = (image **) luaL_checkudata(L, 1, TYPE_IMG); /* image */
a = *aa;
ad = img_dict(a);
- assert(ad != NULL);
- if (img_state(ad) == DICT_NEW) {
- read_img(ad, get_pdf_minor_version(), get_pdf_inclusion_errorlevel());
- img_unset_scaled(a);
- }
- fix_image_size(L, a);
- check_pdfoutput(maketexstring(wrtype_s[writetype]), true);
- flush_str(last_tex_string);
- ref = img_to_array(a);
- if (img_objnum(ad) == 0) { /* not strictly needed here, could be delayed until out_image() */
- pdf_ximage_count++;
- pdf_create_obj(obj_type_ximage, pdf_ximage_count);
- img_objnum(ad) = obj_ptr;
- img_index(ad) = pdf_ximage_count;
- obj_data_ptr(obj_ptr) = ref;
- }
+ setup_image(L, a, writetype);
switch (writetype) {
case WR_WRITE:
- n = img_to_node(a, ref);
+ n = img_to_node(a, img_arrayidx(a));
new_tail_append(n);
break; /* image */
case WR_IMMEDIATEWRITE:
@@ -514,7 +639,7 @@ static void write_image_or_node(lua_State * L, wrtype_e writetype)
break; /* image */
case WR_NODE: /* image */
lua_pop(L, 1); /* - */
- n = img_to_node(a, ref);
+ n = img_to_node(a, img_arrayidx(a));
lua_nodelib_push_fast(L, n);
break; /* node */
default:
@@ -522,7 +647,6 @@ static void write_image_or_node(lua_State * L, wrtype_e writetype)
}
if (img_state(ad) < DICT_REFERED)
img_state(ad) = DICT_REFERED;
- img_set_refered(a); /* now image may not be freed by gc */
}
static int l_write_image(lua_State * L)
@@ -545,7 +669,7 @@ static int l_image_node(lua_State * L)
static int l_image_keys(lua_State * L)
{
- parm_struct *p = img_parms + 1;
+ const parm_struct *p = img_parms + 1;
if (lua_gettop(L) != 0)
luaL_error(L, "img.keys() goes without argument");
lua_newtable(L); /* t */
@@ -601,6 +725,21 @@ static const struct luaL_Reg imglib[] = {
};
/**********************************************************************/
+
+void vf_out_image(unsigned i)
+{
+ image *a, **aa;
+ lua_State *L = Luas; /* ... */
+ lua_rawgeti(L, LUA_GLOBALSINDEX, i); /* image ... */
+ aa = (image **) luaL_checkudata(L, -1, TYPE_IMG);
+ a = *aa;
+ setup_image(L, a, WR_VF_IMG); /* image ... */
+ assert(img_is_refered(a));
+ output_image(img_arrayidx(a));
+ lua_pop(L, 1); /* ... */
+}
+
+/**********************************************************************/
/* Metamethods for image */
static int m_img_get(lua_State * L)
@@ -635,8 +774,10 @@ static int m_img_mul(lua_State * L)
static int m_img_print(lua_State * L)
{
- image **aa = (image **) luaL_checkudata(L, 1, TYPE_IMG);
- image_dict *d = img_dict(*aa);
+ image **aa;
+ image_dict *d;
+ aa = (image **) luaL_checkudata(L, 1, TYPE_IMG);
+ d = img_dict(*aa);
if (img_pagename(d) != NULL && strlen(img_pagename(d)) != 0)
lua_pushfstring(L, "<img{filename=\"%s\", page=\"%s\"}>",
img_filename(d), img_pagename(d));
@@ -692,7 +833,7 @@ static const struct luaL_Reg img_dict_m[] = {
/**********************************************************************/
-void preset_environment(lua_State * L, parm_struct * p)
+void preset_environment(lua_State * L, const parm_struct * p)
{
int i;
lua_newtable(L); /* t */
diff --git a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c
index 5ec4dfed869..23bd37e2f5f 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lkpselib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lkpselib.c
@@ -1,4 +1,21 @@
-/* $Id: lkpselib.c 1061 2008-02-20 09:51:04Z taco $ */
+/* lkpselib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
@@ -7,202 +24,298 @@
#include <kpathsea/tex-glyph.h>
#include <kpathsea/readable.h>
+static const char _svn_version[] =
+ "$Id: lkpselib.c 2093 2009-03-23 11:44:13Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/lkpselib.c $";
+
static const int filetypes[] = {
- kpse_gf_format,
- kpse_pk_format,
- kpse_any_glyph_format,
- kpse_tfm_format,
- kpse_afm_format,
- kpse_base_format,
- kpse_bib_format,
- kpse_bst_format,
- kpse_cnf_format,
- kpse_db_format,
- kpse_fmt_format,
- kpse_fontmap_format,
- kpse_mem_format,
- kpse_mf_format,
- kpse_mfpool_format,
- kpse_mft_format,
- kpse_mp_format,
- kpse_mppool_format,
- kpse_mpsupport_format,
- kpse_ocp_format,
- kpse_ofm_format,
- kpse_opl_format,
- kpse_otp_format,
- kpse_ovf_format,
- kpse_ovp_format,
- kpse_pict_format,
- kpse_tex_format,
- kpse_texdoc_format,
- kpse_texpool_format,
- kpse_texsource_format,
- kpse_tex_ps_header_format,
- kpse_troff_font_format,
- kpse_type1_format,
- kpse_vf_format,
- kpse_dvips_config_format,
- kpse_ist_format,
- kpse_truetype_format,
- kpse_type42_format,
- kpse_web2c_format,
- kpse_program_text_format,
- kpse_program_binary_format,
- kpse_miscfonts_format,
- kpse_web_format,
- kpse_cweb_format,
- kpse_enc_format,
- kpse_cmap_format,
- kpse_sfd_format,
- kpse_opentype_format,
- kpse_pdftex_config_format,
- kpse_lig_format,
- kpse_texmfscripts_format };
+ kpse_gf_format,
+ kpse_pk_format,
+ kpse_any_glyph_format,
+ kpse_tfm_format,
+ kpse_afm_format,
+ kpse_base_format,
+ kpse_bib_format,
+ kpse_bst_format,
+ kpse_cnf_format,
+ kpse_db_format,
+ kpse_fmt_format,
+ kpse_fontmap_format,
+ kpse_mem_format,
+ kpse_mf_format,
+ kpse_mfpool_format,
+ kpse_mft_format,
+ kpse_mp_format,
+ kpse_mppool_format,
+ kpse_mpsupport_format,
+ kpse_ocp_format,
+ kpse_ofm_format,
+ kpse_opl_format,
+ kpse_otp_format,
+ kpse_ovf_format,
+ kpse_ovp_format,
+ kpse_pict_format,
+ kpse_tex_format,
+ kpse_texdoc_format,
+ kpse_texpool_format,
+ kpse_texsource_format,
+ kpse_tex_ps_header_format,
+ kpse_troff_font_format,
+ kpse_type1_format,
+ kpse_vf_format,
+ kpse_dvips_config_format,
+ kpse_ist_format,
+ kpse_truetype_format,
+ kpse_type42_format,
+ kpse_web2c_format,
+ kpse_program_text_format,
+ kpse_program_binary_format,
+ kpse_miscfonts_format,
+ kpse_web_format,
+ kpse_cweb_format,
+ kpse_enc_format,
+ kpse_cmap_format,
+ kpse_sfd_format,
+ kpse_opentype_format,
+ kpse_pdftex_config_format,
+ kpse_lig_format,
+ kpse_texmfscripts_format,
+ kpse_lua_format
+};
static const char *const filetypenames[] = {
- "gf",
- "pk",
- "bitmap font",
- "tfm",
- "afm",
- "base",
- "bib",
- "bst",
- "cnf",
- "ls-R",
- "fmt",
- "map",
- "mem",
- "mf",
- "mfpool",
- "mft",
- "mp",
- "mppool",
- "MetaPost support",
- "ocp",
- "ofm",
- "opl",
- "otp",
- "ovf",
- "ovp",
- "graphic/figure",
- "tex",
- "TeX system documentation",
- "texpool",
- "TeX system sources",
- "PostScript header",
- "Troff fonts",
- "type1 fonts",
- "vf",
- "dvips config",
- "ist",
- "truetype fonts",
- "type42 fonts",
- "web2c files",
- "other text files",
- "other binary files",
- "misc fonts",
- "web",
- "cweb",
- "enc files",
- "cmap files",
- "subfont definition files",
- "opentype fonts",
- "pdftex config",
- "lig files",
- "texmfscripts",
- NULL };
+ "gf",
+ "pk",
+ "bitmap font",
+ "tfm",
+ "afm",
+ "base",
+ "bib",
+ "bst",
+ "cnf",
+ "ls-R",
+ "fmt",
+ "map",
+ "mem",
+ "mf",
+ "mfpool",
+ "mft",
+ "mp",
+ "mppool",
+ "MetaPost support",
+ "ocp",
+ "ofm",
+ "opl",
+ "otp",
+ "ovf",
+ "ovp",
+ "graphic/figure",
+ "tex",
+ "TeX system documentation",
+ "texpool",
+ "TeX system sources",
+ "PostScript header",
+ "Troff fonts",
+ "type1 fonts",
+ "vf",
+ "dvips config",
+ "ist",
+ "truetype fonts",
+ "type42 fonts",
+ "web2c files",
+ "other text files",
+ "other binary files",
+ "misc fonts",
+ "web",
+ "cweb",
+ "enc files",
+ "cmap files",
+ "subfont definition files",
+ "opentype fonts",
+ "pdftex config",
+ "lig files",
+ "texmfscripts",
+ "lua",
+ NULL
+};
+
+
+#define KPATHSEA_METATABLE "luatex_kpathsea"
/* set to 1 by the |program_name| function */
-int program_name_set = 0;
+int program_name_set = 0;
-#define TEST_PROGRAM_NAME_SET do { \
- if (! program_name_set) { \
+#define TEST_PROGRAM_NAME_SET do { \
+ if (! program_name_set) { \
lua_pushstring(L, "Please call kpse.set_program_name() before using the library"); \
- return lua_error(L); \
- } \
+ return lua_error(L); \
+ } \
} while (0)
-static int find_file (lua_State *L) {
- int i;
- char *st;
- int ftype = kpse_tex_format;
- int mexist = 0;
- TEST_PROGRAM_NAME_SET;
- if (!lua_isstring(L,1)) {
- lua_pushstring(L, "not a file name");
- lua_error(L);
- }
- st = (char *)lua_tostring(L,1);
- i = lua_gettop(L);
- while (i>1) {
- if (lua_isboolean (L,i)) {
- mexist = lua_toboolean (L,i);
- } else if (lua_isnumber (L,i)) {
- mexist = lua_tonumber (L,i) ;
- } else if (lua_isstring(L,i)) {
- int op = luaL_checkoption(L, i, NULL, filetypenames);
- ftype = filetypes[op];
+static int find_file(lua_State * L)
+{
+ int i;
+ char *st;
+ int ftype = kpse_tex_format;
+ int mexist = 0;
+ TEST_PROGRAM_NAME_SET;
+ if (!lua_isstring(L, 1)) {
+ lua_pushstring(L, "not a file name");
+ lua_error(L);
+ }
+ st = (char *) lua_tostring(L, 1);
+ i = lua_gettop(L);
+ while (i > 1) {
+ if (lua_isboolean(L, i)) {
+ mexist = lua_toboolean(L, i);
+ } else if (lua_isnumber(L, i)) {
+ mexist = lua_tonumber(L, i);
+ } else if (lua_isstring(L, i)) {
+ int op = luaL_checkoption(L, i, NULL, filetypenames);
+ ftype = filetypes[op];
+ }
+ i--;
+ }
+ if (ftype == kpse_pk_format ||
+ ftype == kpse_gf_format || ftype == kpse_any_glyph_format) {
+ /* ret.format, ret.name, ret.dpi */
+ kpse_glyph_file_type ret;
+ lua_pushstring(L, kpse_find_glyph(st, mexist, ftype, &ret));
+ } else {
+ if (mexist > 0)
+ mexist = 1;
+ if (mexist < 0)
+ mexist = 0;
+ lua_pushstring(L, kpse_find_file(st, ftype, mexist));
+ }
+ return 1;
+}
+
+
+static int lua_kpathsea_find_file(lua_State * L)
+{
+ int i;
+ int ftype = kpse_tex_format;
+ int mexist = 0;
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ char *st = (char *) luaL_checkstring(L, 2);
+ i = lua_gettop(L);
+ while (i > 2) {
+ if (lua_isboolean(L, i)) {
+ mexist = lua_toboolean(L, i);
+ } else if (lua_isnumber(L, i)) {
+ mexist = lua_tonumber(L, i);
+ } else if (lua_isstring(L, i)) {
+ int op = luaL_checkoption(L, i, NULL, filetypenames);
+ ftype = filetypes[op];
+ }
+ i--;
}
- i--;
- }
- if (ftype==kpse_pk_format ||
- ftype==kpse_gf_format ||
- ftype==kpse_any_glyph_format) {
- /* ret.format, ret.name, ret.dpi */
- kpse_glyph_file_type ret;
- lua_pushstring(L, kpse_find_glyph (st,mexist, ftype, &ret));
- } else {
- if (mexist>0)
- mexist = 1;
- if (mexist<0)
- mexist = 0;
- lua_pushstring(L, kpse_find_file (st,ftype,mexist));
- }
- return 1;
+ if (ftype == kpse_pk_format ||
+ ftype == kpse_gf_format || ftype == kpse_any_glyph_format) {
+ /* ret.format, ret.name, ret.dpi */
+ kpse_glyph_file_type ret;
+ lua_pushstring(L, kpathsea_find_glyph(*kp, st, mexist, ftype, &ret));
+ } else {
+ if (mexist > 0)
+ mexist = 1;
+ if (mexist < 0)
+ mexist = 0;
+ lua_pushstring(L, kpathsea_find_file(*kp, st, ftype, mexist));
+ }
+ return 1;
+
+}
+
+static int show_path(lua_State * L)
+{
+ int op = luaL_checkoption(L, -1, "tex", filetypenames);
+ int user_format = filetypes[op];
+ TEST_PROGRAM_NAME_SET;
+ if (!kpse_format_info[user_format].type) /* needed if arg was numeric */
+ kpse_init_format(user_format);
+ lua_pushstring(L, kpse_format_info[user_format].path);
+ return 1;
+}
+
+static int lua_kpathsea_show_path(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ int op = luaL_checkoption(L, -1, "tex", filetypenames);
+ int user_format = filetypes[op];
+ if (!(*kp)->format_info[user_format].type) /* needed if arg was numeric */
+ kpathsea_init_format(*kp, user_format);
+ lua_pushstring(L, (*kp)->format_info[user_format].path);
+ return 1;
+}
+
+static int expand_path(lua_State * L)
+{
+ const char *st = luaL_checkstring(L, 1);
+ TEST_PROGRAM_NAME_SET;
+ lua_pushstring(L, kpse_path_expand(st));
+ return 1;
+}
+
+static int lua_kpathsea_expand_path(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ const char *st = luaL_checkstring(L, 2);
+ lua_pushstring(L, kpathsea_path_expand(*kp, st));
+ return 1;
+}
+
+static int expand_braces(lua_State * L)
+{
+ const char *st = luaL_checkstring(L, 1);
+ TEST_PROGRAM_NAME_SET;
+ lua_pushstring(L, kpse_brace_expand(st));
+ return 1;
}
-static int show_path (lua_State *L) {
- int op = luaL_checkoption(L, -1, "tex", filetypenames);
- int user_format = filetypes[op];
- TEST_PROGRAM_NAME_SET;
- if (!kpse_format_info[user_format].type) /* needed if arg was numeric */
- kpse_init_format (user_format);
- lua_pushstring (L, kpse_format_info[user_format].path);
- return 1;
+static int lua_kpathsea_expand_braces(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ const char *st = luaL_checkstring(L, 2);
+ lua_pushstring(L, kpathsea_brace_expand(*kp, st));
+ return 1;
}
-static int expand_path (lua_State *L) {
- const char *st = luaL_checkstring(L,1);
- TEST_PROGRAM_NAME_SET;
- lua_pushstring(L, kpse_path_expand(st));
- return 1;
+static int expand_var(lua_State * L)
+{
+ const char *st = luaL_checkstring(L, 1);
+ TEST_PROGRAM_NAME_SET;
+ lua_pushstring(L, kpse_var_expand(st));
+ return 1;
}
-static int expand_braces (lua_State *L) {
- const char *st = luaL_checkstring(L,1);
- TEST_PROGRAM_NAME_SET;
- lua_pushstring(L, kpse_brace_expand(st));
- return 1;
+static int lua_kpathsea_expand_var(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ const char *st = luaL_checkstring(L, 2);
+ lua_pushstring(L, kpathsea_var_expand(*kp, st));
+ return 1;
}
-static int expand_var (lua_State *L) {
- const char *st = luaL_checkstring(L,1);
- TEST_PROGRAM_NAME_SET;
- lua_pushstring(L, kpse_var_expand(st));
- return 1;
+
+static int var_value(lua_State * L)
+{
+ const char *st = luaL_checkstring(L, 1);
+ TEST_PROGRAM_NAME_SET;
+ lua_pushstring(L, kpse_var_value(st));
+ return 1;
}
-static int var_value (lua_State *L) {
- const char *st = luaL_checkstring(L,1);
- TEST_PROGRAM_NAME_SET;
- lua_pushstring(L, kpse_var_value(st));
- return 1;
+static int lua_kpathsea_var_value(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ const char *st = luaL_checkstring(L, 2);
+ lua_pushstring(L, kpathsea_var_value(*kp, st));
+ return 1;
}
+
/* Engine support is a bit of a problem, because we do not want
* to interfere with the normal format discovery of |luatex|.
* Current approach: run |os.setenv()| if you have to.
@@ -210,63 +323,122 @@ static int var_value (lua_State *L) {
extern int luainit;
-static int set_program_name (lua_State *L) {
- const char *exe_name = luaL_checkstring(L,1);
- const char *prog_name = luaL_optstring(L,2,exe_name);
- if (! program_name_set) {
- kpse_set_program_name(exe_name, prog_name);
- program_name_set = 1;
- } else {
- kpse_reset_program_name(prog_name);
- }
- /* fix up the texconfig entry */
- lua_checkstack(L,3);
- lua_getglobal(L,"texconfig");
- if (lua_istable(L,-1)) {
- lua_pushstring(L,"kpse_init");
- lua_pushboolean(L,0);
- lua_rawset(L,-3);
- }
- lua_pop(L,1);
- return 0;
+static int set_program_name(lua_State * L)
+{
+ const char *exe_name = luaL_checkstring(L, 1);
+ const char *prog_name = luaL_optstring(L, 2, exe_name);
+ if (!program_name_set) {
+ kpse_set_program_name(exe_name, prog_name);
+ program_name_set = 1;
+ } else {
+ kpse_reset_program_name(prog_name);
+ }
+ /* fix up the texconfig entry */
+ lua_checkstack(L, 3);
+ lua_getglobal(L, "texconfig");
+ if (lua_istable(L, -1)) {
+ lua_pushstring(L, "kpse_init");
+ lua_pushboolean(L, 0);
+ lua_rawset(L, -3);
+ }
+ lua_pop(L, 1);
+ return 0;
+}
+
+static int init_prog(lua_State * L)
+{
+ const char *prefix = luaL_checkstring(L, 1);
+ unsigned dpi = luaL_checkinteger(L, 2);
+ const char *mode = luaL_checkstring(L, 3);
+ const char *fallback = luaL_optstring(L, 4, NULL);
+ TEST_PROGRAM_NAME_SET;
+ kpse_init_prog(prefix, dpi, mode, fallback);
+ return 0;
}
-static int init_prog (lua_State *L) {
- const char *prefix = luaL_checkstring(L,1);
- unsigned dpi = luaL_checkinteger(L,2);
- const char *mode = luaL_checkstring(L,3);
- const char *fallback = luaL_optstring(L,4,NULL);
- TEST_PROGRAM_NAME_SET;
- kpse_init_prog(prefix,dpi,mode,fallback);
- return 0;
+static int lua_kpathsea_init_prog(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ const char *prefix = luaL_checkstring(L, 2);
+ unsigned dpi = luaL_checkinteger(L, 3);
+ const char *mode = luaL_checkstring(L, 4);
+ const char *fallback = luaL_optstring(L, 5, NULL);
+ kpathsea_init_prog(*kp,prefix, dpi, mode, fallback);
+ return 0;
}
-static int readable_file (lua_State *L) {
- const char *name = luaL_checkstring(L,1);
- TEST_PROGRAM_NAME_SET;
- lua_pushstring(L,(char *)kpse_readable_file (name));
- return 1;
+static int readable_file(lua_State * L)
+{
+ const char *name = luaL_checkstring(L, 1);
+ TEST_PROGRAM_NAME_SET;
+ lua_pushstring(L, (char *) kpse_readable_file(name));
+ return 1;
}
+static int lua_kpathsea_readable_file(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ const char *name = luaL_checkstring(L, 2);
+ lua_pushstring(L, (char *) kpathsea_readable_file(*kp,name));
+ return 1;
+}
-static const struct luaL_reg kpselib [] = {
- {"set_program_name", set_program_name},
- {"init_prog", init_prog},
- {"readable_file", readable_file},
- {"find_file", find_file},
- {"expand_path", expand_path},
- {"expand_var", expand_var},
- {"expand_braces",expand_braces},
- {"var_value",var_value},
- {"show_path",show_path},
- {NULL, NULL} /* sentinel */
-};
+static int lua_kpathsea_finish(lua_State * L)
+{
+ kpathsea *kp = (kpathsea *)luaL_checkudata(L, 1, KPATHSEA_METATABLE);
+ kpathsea_finish(*kp);
+ return 0;
+}
-int
-luaopen_kpse (lua_State *L)
+static int lua_kpathsea_new(lua_State * L)
{
- luaL_register(L,"kpse",kpselib);
- return 1;
+ kpathsea kpse = NULL;
+ kpathsea *kp = NULL;
+ char *argv = (char *)luaL_checkstring(L,1);
+ char *liar = (char *)luaL_optstring(L,2,argv);
+ kpse = kpathsea_new();
+ kpathsea_set_program_name(kpse, argv, liar);
+ kp = (kpathsea *)lua_newuserdata(L, sizeof(kpathsea *));
+ *kp = kpse;
+ luaL_getmetatable(L, KPATHSEA_METATABLE);
+ lua_setmetatable(L, -2);
+ return 1;
}
+static const struct luaL_reg kpselib_m[] = {
+ {"__gc", lua_kpathsea_finish },
+ {"init_prog", lua_kpathsea_init_prog },
+ {"readable_file", lua_kpathsea_readable_file },
+ {"find_file", lua_kpathsea_find_file },
+ {"expand_path", lua_kpathsea_expand_path },
+ {"expand_var", lua_kpathsea_expand_var },
+ {"expand_braces", lua_kpathsea_expand_braces },
+ {"var_value", lua_kpathsea_var_value },
+ {"show_path", lua_kpathsea_show_path },
+ {NULL, NULL} /* sentinel */
+};
+
+static const struct luaL_reg kpselib_l[] = {
+ {"new", lua_kpathsea_new },
+ {"set_program_name", set_program_name },
+ {"init_prog", init_prog },
+ {"readable_file", readable_file },
+ {"find_file", find_file },
+ {"expand_path", expand_path },
+ {"expand_var", expand_var },
+ {"expand_braces", expand_braces },
+ {"var_value", var_value },
+ {"show_path", show_path },
+ {NULL, NULL} /* sentinel */
+};
+
+int luaopen_kpse(lua_State * L)
+{
+ luaL_newmetatable(L, KPATHSEA_METATABLE);
+ lua_pushvalue(L, -1);
+ lua_setfield(L, -2,"__index");
+ luaL_register(L, NULL, kpselib_m);
+ luaL_register(L, "kpse", kpselib_l);
+ return 1;
+}
diff --git a/Build/source/texk/web2c/luatexdir/lua/llanglib.c b/Build/source/texk/web2c/luatexdir/lua/llanglib.c
index a5227afa1a0..6aa634525b5 100644
--- a/Build/source/texk/web2c/luatexdir/lua/llanglib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/llanglib.c
@@ -1,222 +1,275 @@
-/*
-Copyright (c) 2007 Taco Hoekwater <taco@latex.org>
+/* llanglib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of luatex.
+ This file is part of LuaTeX.
-luatex is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-luatex is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with luatex; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-This is llanglib.c
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+static const char _svn_version[] =
+ "$Id: llanglib.c 1594 2008-11-28 13:32:48Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/llanglib.c $";
+
#define LANG_METATABLE "luatex.lang"
#define check_islang(L,b) (struct tex_language **)luaL_checkudata(L,b,LANG_METATABLE)
-extern halfword *check_isnode (lua_State *L, int ud) ;
+extern halfword *check_isnode(lua_State * L, int ud);
-static int
-lang_new (lua_State *L) {
- struct tex_language **lang;
- if (lua_gettop(L)==0) {
- lang = lua_newuserdata(L, sizeof(struct tex_language *));
- *lang = new_language();
- if (!*lang) {
- lua_pushstring(L,"lang.new(): no room for a new language");
- return lua_error(L);
+static int lang_new(lua_State * L)
+{
+ struct tex_language **lang;
+ if (lua_gettop(L) == 0) {
+ lang = lua_newuserdata(L, sizeof(struct tex_language *));
+ *lang = new_language(-1);
+ if (!*lang) {
+ lua_pushstring(L, "lang.new(): no room for a new language");
+ return lua_error(L);
+ }
+ } else {
+ lang = lua_newuserdata(L, sizeof(struct tex_language *));
+ *lang = get_language(lua_tonumber(L, 1));
+ if (!*lang) {
+ lua_pushfstring(L, "lang.new(%d): undefined language",
+ lua_tonumber(L, 1));
+ return lua_error(L);
+ }
}
- } else {
- lang = lua_newuserdata(L, sizeof(struct tex_language *));
- *lang = get_language(lua_tonumber(L,1));
- }
- luaL_getmetatable(L,LANG_METATABLE);
- lua_setmetatable(L,-2);
- return 1;
+ luaL_getmetatable(L, LANG_METATABLE);
+ lua_setmetatable(L, -2);
+ return 1;
}
-static int
-lang_id (lua_State *L) {
- struct tex_language **lang_ptr;
- lang_ptr = check_islang(L,1);
- lua_pushnumber(L,(*lang_ptr)->id);
- return 1;
+static int lang_id(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ lua_pushnumber(L, (*lang_ptr)->id);
+ return 1;
}
-static int
-lang_patterns (lua_State *L) {
- struct tex_language **lang_ptr;
- lang_ptr = check_islang(L,1);
- if (lua_gettop(L)!=1) {
- if (!lua_isstring(L,2)) {
- lua_pushstring(L,"lang.patterns(): argument should be a string");
- return lua_error(L);
- }
- load_patterns(*lang_ptr, (unsigned char *)lua_tostring(L,2));
- return 0;
- } else {
- if ((*lang_ptr)->patterns!=NULL) {
- lua_pushstring(L,(char *)hnj_serialize((*lang_ptr)->patterns));
- } else {
- lua_pushnil(L);
- }
- return 1;
- }
+static int lang_patterns(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ if (lua_gettop(L) != 1) {
+ if (!lua_isstring(L, 2)) {
+ lua_pushstring(L, "lang.patterns(): argument should be a string");
+ return lua_error(L);
+ }
+ load_patterns(*lang_ptr, (unsigned char *) lua_tostring(L, 2));
+ return 0;
+ } else {
+ if ((*lang_ptr)->patterns != NULL) {
+ lua_pushstring(L, (char *) hnj_serialize((*lang_ptr)->patterns));
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+ }
}
-static int
-lang_clear_patterns (lua_State *L) {
- struct tex_language **lang_ptr;
- lang_ptr = check_islang(L,1);
- clear_patterns(*lang_ptr);
- return 0;
+static int lang_clear_patterns(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ clear_patterns(*lang_ptr);
+ return 0;
}
-static int
-lang_hyphenation (lua_State *L) {
- struct tex_language **lang_ptr;
- lang_ptr = check_islang(L,1);
- if (lua_gettop(L)!=1) {
- if(!lua_isstring(L,2)) {
- lua_pushstring(L,"lang.hyphenation(): argument should be a string");
- return lua_error(L);
- }
- load_hyphenation(*lang_ptr,(unsigned char *)lua_tostring(L,2));
- return 0;
- } else {
- if ((*lang_ptr)->exceptions!=0) {
- lua_pushstring(L,exception_strings(*lang_ptr));
- } else {
- lua_pushnil(L);
- }
- return 1;
- }
+static int lang_hyphenation(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ if (lua_gettop(L) != 1) {
+ if (!lua_isstring(L, 2)) {
+ lua_pushstring(L,
+ "lang.hyphenation(): argument should be a string");
+ return lua_error(L);
+ }
+ load_hyphenation(*lang_ptr, (unsigned char *) lua_tostring(L, 2));
+ return 0;
+ } else {
+ if ((*lang_ptr)->exceptions != 0) {
+ lua_pushstring(L, exception_strings(*lang_ptr));
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+ }
}
-static int
-lang_pre_hyphen_char (lua_State *L) {
- struct tex_language **lang_ptr;
- lang_ptr = check_islang(L,1);
- if (lua_gettop(L)!=1) {
- if(!lua_isnumber(L,2)) {
- lua_pushstring(L,"lang.prehyphenchar(): argument should be a character number");
- return lua_error(L);
- }
- (*lang_ptr)->pre_hyphen_char = lua_tonumber(L,2);
- return 0;
- } else {
- lua_pushnumber(L,(*lang_ptr)->pre_hyphen_char);
- return 1;
- }
+static int lang_pre_hyphen_char(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ if (lua_gettop(L) != 1) {
+ if (!lua_isnumber(L, 2)) {
+ lua_pushstring(L,
+ "lang.prehyphenchar(): argument should be a character number");
+ return lua_error(L);
+ }
+ (*lang_ptr)->pre_hyphen_char = lua_tonumber(L, 2);
+ return 0;
+ } else {
+ lua_pushnumber(L, (*lang_ptr)->pre_hyphen_char);
+ return 1;
+ }
}
-static int
-lang_post_hyphen_char (lua_State *L) {
- struct tex_language **lang_ptr;
- lang_ptr = check_islang(L,1);
- if (lua_gettop(L)!=1) {
- if(!lua_isnumber(L,2)) {
- lua_pushstring(L,"lang.posthyphenchar(): argument should be a character number");
- return lua_error(L);
- }
- (*lang_ptr)->post_hyphen_char = lua_tonumber(L,2);
- return 0;
- } else {
- lua_pushnumber(L,(*lang_ptr)->post_hyphen_char);
- return 1;
- }
+static int lang_post_hyphen_char(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ if (lua_gettop(L) != 1) {
+ if (!lua_isnumber(L, 2)) {
+ lua_pushstring(L,
+ "lang.posthyphenchar(): argument should be a character number");
+ return lua_error(L);
+ }
+ (*lang_ptr)->post_hyphen_char = lua_tonumber(L, 2);
+ return 0;
+ } else {
+ lua_pushnumber(L, (*lang_ptr)->post_hyphen_char);
+ return 1;
+ }
}
-static int
-lang_clear_hyphenation (lua_State *L) {
- struct tex_language **lang_ptr;
- lang_ptr = check_islang(L,1);
- clear_hyphenation(*lang_ptr);
- return 0;
+
+static int lang_pre_exhyphen_char(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ if (lua_gettop(L) != 1) {
+ if (!lua_isnumber(L, 2)) {
+ lua_pushstring(L,
+ "lang.preexhyphenchar(): argument should be a character number");
+ return lua_error(L);
+ }
+ (*lang_ptr)->pre_exhyphen_char = lua_tonumber(L, 2);
+ return 0;
+ } else {
+ lua_pushnumber(L, (*lang_ptr)->pre_exhyphen_char);
+ return 1;
+ }
}
+static int lang_post_exhyphen_char(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ if (lua_gettop(L) != 1) {
+ if (!lua_isnumber(L, 2)) {
+ lua_pushstring(L,
+ "lang.postexhyphenchar(): argument should be a character number");
+ return lua_error(L);
+ }
+ (*lang_ptr)->post_exhyphen_char = lua_tonumber(L, 2);
+ return 0;
+ } else {
+ lua_pushnumber(L, (*lang_ptr)->post_exhyphen_char);
+ return 1;
+ }
+}
+
+
+static int lang_clear_hyphenation(lua_State * L)
+{
+ struct tex_language **lang_ptr;
+ lang_ptr = check_islang(L, 1);
+ clear_hyphenation(*lang_ptr);
+ return 0;
+}
-static int
-do_lang_clean (lua_State *L) {
- char *cleaned;
- if (!lua_isstring(L,1)) {
- lua_pushstring(L,"lang.clean(): argument should be a string");
- return lua_error(L);
- }
- (void)clean_hyphenation((char *)lua_tostring(L,1),&cleaned);
- lua_pushstring(L,cleaned);
- return 1;
+
+static int do_lang_clean(lua_State * L)
+{
+ char *cleaned;
+ if (!lua_isstring(L, 1)) {
+ lua_pushstring(L, "lang.clean(): argument should be a string");
+ return lua_error(L);
+ }
+ (void) clean_hyphenation((char *) lua_tostring(L, 1), &cleaned);
+ lua_pushstring(L, cleaned);
+ return 1;
}
-static int
-do_lang_hyphenate (lua_State *L) {
- halfword *h,*t;
- h = check_isnode(L,1);
- if (lua_isuserdata(L,2)) {
- t = check_isnode(L,2);
- lua_pop(L,1);
- } else {
- t = h;
- while (vlink(*t)!=null)
- *t = vlink(*t);
- }
- hnj_hyphenation(*h,*t);
- lua_pushboolean(L,1);
- return 1;
+static int do_lang_hyphenate(lua_State * L)
+{
+ halfword *h, *t;
+ h = check_isnode(L, 1);
+ if (lua_isuserdata(L, 2)) {
+ t = check_isnode(L, 2);
+ lua_pop(L, 1);
+ } else {
+ t = h;
+ while (vlink(*t) != null)
+ *t = vlink(*t);
+ }
+ hnj_hyphenation(*h, *t);
+ lua_pushboolean(L, 1);
+ return 1;
}
-static const struct luaL_reg langlib_d [] = {
- {"clear_patterns", lang_clear_patterns},
- {"clear_hyphenation", lang_clear_hyphenation},
- {"patterns", lang_patterns},
- {"hyphenation", lang_hyphenation},
- {"prehyphenchar", lang_pre_hyphen_char},
- {"posthyphenchar", lang_post_hyphen_char},
- {"id", lang_id},
- {NULL, NULL} /* sentinel */
+static const struct luaL_reg langlib_d[] = {
+ /* *INDENT-OFF* */
+ {"clear_patterns", lang_clear_patterns},
+ {"clear_hyphenation", lang_clear_hyphenation},
+ {"patterns", lang_patterns},
+ {"hyphenation", lang_hyphenation},
+ {"prehyphenchar", lang_pre_hyphen_char},
+ {"posthyphenchar", lang_post_hyphen_char},
+ {"preexhyphenchar", lang_pre_exhyphen_char},
+ {"postexhyphenchar", lang_post_exhyphen_char},
+ {"id", lang_id},
+ /* *INDENT-ON* */
+ {NULL, NULL} /* sentinel */
};
static const struct luaL_reg langlib[] = {
- {"clear_patterns", lang_clear_patterns},
- {"clear_hyphenation", lang_clear_hyphenation},
- {"patterns", lang_patterns},
- {"hyphenation", lang_hyphenation},
- {"prehyphenchar", lang_pre_hyphen_char},
- {"posthyphenchar", lang_post_hyphen_char},
- {"id", lang_id},
- {"clean", do_lang_clean},
- {"hyphenate", do_lang_hyphenate},
- {"new", lang_new},
- {NULL, NULL} /* sentinel */
+ /* *INDENT-OFF* */
+ {"clear_patterns", lang_clear_patterns},
+ {"clear_hyphenation", lang_clear_hyphenation},
+ {"patterns", lang_patterns},
+ {"hyphenation", lang_hyphenation},
+ {"prehyphenchar", lang_pre_hyphen_char},
+ {"posthyphenchar", lang_post_hyphen_char},
+ {"preexhyphenchar", lang_pre_exhyphen_char},
+ {"postexhyphenchar", lang_post_exhyphen_char},
+ {"id", lang_id},
+ {"clean", do_lang_clean},
+ {"hyphenate", do_lang_hyphenate},
+ {"new", lang_new},
+ /* *INDENT-ON* */
+ {NULL, NULL} /* sentinel */
};
-int
-luaopen_lang (lua_State *L) {
- luaL_newmetatable(L,LANG_METATABLE);
- lua_pushvalue(L, -1); /* push metatable */
- lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
- luaL_register(L, NULL, langlib_d); /* dict methods */
- luaL_register(L, "lang", langlib);
- return 1;
+int luaopen_lang(lua_State * L)
+{
+ luaL_newmetatable(L, LANG_METATABLE);
+ lua_pushvalue(L, -1); /* push metatable */
+ lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
+ luaL_register(L, NULL, langlib_d); /* dict methods */
+ luaL_register(L, "lang", langlib);
+ return 1;
}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/llualib.c b/Build/source/texk/web2c/luatexdir/lua/llualib.c
index 90b1687f3b1..7efff052754 100644
--- a/Build/source/texk/web2c/luatexdir/lua/llualib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/llualib.c
@@ -1,17 +1,36 @@
+/* llualib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-/* $Id: llualib.c 1169 2008-04-15 14:57:56Z oneiros $ */
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
+static const char _svn_version[] =
+ "$Id: llualib.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/llualib.c $";
+
#define LOAD_BUF_SIZE 256
#define UINT_MAX32 0xFFFFFFFF
typedef struct {
- unsigned char* buf;
- int size;
- int done;
- int alloc;
+ unsigned char *buf;
+ int size;
+ int done;
+ int alloc;
} bytecode;
static bytecode *lua_bytecode_registers = NULL;
@@ -19,211 +38,298 @@ static bytecode *lua_bytecode_registers = NULL;
int luabytecode_max = -1;
unsigned int luabytecode_bytes = 0;
-void dump_luac_registers (void) {
- int k,n;
- bytecode b;
- dump_int(luabytecode_max);
- if (lua_bytecode_registers != NULL) {
- n = 0;
- for (k=0;k<=luabytecode_max;k++) {
- if (lua_bytecode_registers[k].size != 0)
- n++;
- }
- dump_int(n);
- for (k=0;k<=luabytecode_max;k++) {
- b = lua_bytecode_registers[k];
- if (b.size != 0) {
- dump_int(k);
- dump_int(b.size);
- do_zdump ((char *)b.buf,1,(b.size), DUMP_FILE);
- }
- }
- }
+char *luanames[65536] = {NULL};
+
+extern char *luanames[];
+
+char *
+get_lua_name (int i)
+{
+ if (i<0 || i>65535)
+ return NULL;
+ return luanames[i];
+}
+
+void dump_luac_registers(void)
+{
+ integer x;
+ int k, n;
+ bytecode b;
+ dump_int(luabytecode_max);
+ if (lua_bytecode_registers != NULL) {
+ n = 0;
+ for (k = 0; k <= luabytecode_max; k++) {
+ if (lua_bytecode_registers[k].size != 0)
+ n++;
+ }
+ dump_int(n);
+ for (k = 0; k <= luabytecode_max; k++) {
+ b = lua_bytecode_registers[k];
+ if (b.size != 0) {
+ dump_int(k);
+ dump_int(b.size);
+ do_zdump((char *) b.buf, 1, (b.size), DUMP_FILE);
+ }
+ }
+ }
+ for (k = 0; k < 65536; k++) {
+ char *a = luanames[k];
+ if (a!=NULL) {
+ x = strlen(a)+1;
+ dump_int(x);
+ dump_things(*a, x);
+ } else {
+ x = 0;
+ dump_int(x);
+ }
+ }
}
-void undump_luac_registers (void) {
- int k,n;
- unsigned int i;
- bytecode b;
- undump_int(luabytecode_max);
- if (luabytecode_max>=0) {
- i = (luabytecode_max+1);
- if ((int)(UINT_MAX32/sizeof(bytecode)+1)<=i) {
- lua_fatal_error(maketexstring("Corrupt format file"));
- }
- lua_bytecode_registers = xmalloc(i*sizeof(bytecode));
- luabytecode_bytes = i*sizeof(bytecode);
- for (i=0;i<=(unsigned)luabytecode_max;i++) {
- lua_bytecode_registers[i].done = 0;
- lua_bytecode_registers[i].size = 0;
- lua_bytecode_registers[i].buf = NULL;
- }
- undump_int(n);
- for (i=0;i<(unsigned)n;i++) {
- undump_int(k);
- undump_int(b.size);
- b.buf=xmalloc(b.size);
- luabytecode_bytes += b.size;
- memset(b.buf, 0, b.size);
- do_zundump ((char *)b.buf,1, b.size, DUMP_FILE);
- lua_bytecode_registers[k].size = b.size;
- lua_bytecode_registers[k].alloc = b.size;
- lua_bytecode_registers[k].buf = b.buf;
- }
- }
+void undump_luac_registers(void)
+{
+ integer x;
+ int k, n;
+ unsigned int i;
+ bytecode b;
+ undump_int(luabytecode_max);
+ if (luabytecode_max >= 0) {
+ i = (luabytecode_max + 1);
+ if ((int) (UINT_MAX32 / sizeof(bytecode) + 1) <= i) {
+ lua_fatal_error(maketexstring("Corrupt format file"));
+ }
+ lua_bytecode_registers = xmalloc(i * sizeof(bytecode));
+ luabytecode_bytes = i * sizeof(bytecode);
+ for (i = 0; i <= (unsigned) luabytecode_max; i++) {
+ lua_bytecode_registers[i].done = 0;
+ lua_bytecode_registers[i].size = 0;
+ lua_bytecode_registers[i].buf = NULL;
+ }
+ undump_int(n);
+ for (i = 0; i < (unsigned) n; i++) {
+ undump_int(k);
+ undump_int(b.size);
+ b.buf = xmalloc(b.size);
+ luabytecode_bytes += b.size;
+ memset(b.buf, 0, b.size);
+ do_zundump((char *) b.buf, 1, b.size, DUMP_FILE);
+ lua_bytecode_registers[k].size = b.size;
+ lua_bytecode_registers[k].alloc = b.size;
+ lua_bytecode_registers[k].buf = b.buf;
+ }
+ }
+ for (k = 0; k < 65536; k++) {
+ undump_int(x);
+ if (x > 0) {
+ char *s = xmalloc(x);
+ undump_things(*s, x);
+ luanames[k] = s;
+ }
+ }
}
-static void
-bytecode_register_shadow_set (lua_State* L, int k){
- /* the stack holds the value to be set */
- lua_pushstring(L,"bytecode_shadow"); /* lua.bytecode_shadow */
- lua_rawget(L,LUA_REGISTRYINDEX);
- if (lua_istable(L, -1)) {
- lua_pushvalue(L,-2);
- lua_rawseti(L,-2,k);
- }
- lua_pop(L,1); /* pop table or nil */
- lua_pop(L,1); /* pop value */
+static void bytecode_register_shadow_set(lua_State * L, int k)
+{
+ /* the stack holds the value to be set */
+ lua_pushstring(L, "bytecode_shadow"); /* lua.bytecode_shadow */
+ lua_rawget(L, LUA_REGISTRYINDEX);
+ if (lua_istable(L, -1)) {
+ lua_pushvalue(L, -2);
+ lua_rawseti(L, -2, k);
+ }
+ lua_pop(L, 1); /* pop table or nil */
+ lua_pop(L, 1); /* pop value */
}
-static int
-bytecode_register_shadow_get (lua_State* L, int k){
- /* the stack holds the value to be set */
- int ret = 0;
- lua_pushstring(L,"bytecode_shadow");
- lua_rawget(L,LUA_REGISTRYINDEX);
- if (lua_istable(L, -1)) {
- lua_rawgeti(L,-1,k);
- if (!lua_isnil(L,-1))
- ret = 1;
- lua_insert(L,-3); /* store the value or nil, deeper down */
- lua_pop(L,1); /* pop the value or nil at top */
- }
- lua_pop(L,1); /* pop table or nil */
- return ret;
+static int bytecode_register_shadow_get(lua_State * L, int k)
+{
+ /* the stack holds the value to be set */
+ int ret = 0;
+ lua_pushstring(L, "bytecode_shadow");
+ lua_rawget(L, LUA_REGISTRYINDEX);
+ if (lua_istable(L, -1)) {
+ lua_rawgeti(L, -1, k);
+ if (!lua_isnil(L, -1))
+ ret = 1;
+ lua_insert(L, -3); /* store the value or nil, deeper down */
+ lua_pop(L, 1); /* pop the value or nil at top */
+ }
+ lua_pop(L, 1); /* pop table or nil */
+ return ret;
}
-int writer(lua_State* L, const void* b, size_t size, void* B) {
- bytecode* buf = (bytecode*)B;
- if ((int)(buf->size + size) > buf->alloc) {
- buf->buf = xrealloc(buf->buf,buf->alloc+size+LOAD_BUF_SIZE);
- buf->alloc = buf->alloc+size+LOAD_BUF_SIZE;
- }
- memcpy(buf->buf+buf->size, b, size);
- buf->size += size;
- luabytecode_bytes += size;
- return 0;
+int writer(lua_State * L, const void *b, size_t size, void *B)
+{
+ bytecode *buf = (bytecode *) B;
+ (void)L; /* for -Wunused */
+ if ((int) (buf->size + size) > buf->alloc) {
+ buf->buf = xrealloc(buf->buf, buf->alloc + size + LOAD_BUF_SIZE);
+ buf->alloc = buf->alloc + size + LOAD_BUF_SIZE;
+ }
+ memcpy(buf->buf + buf->size, b, size);
+ buf->size += size;
+ luabytecode_bytes += size;
+ return 0;
}
-const char* reader(lua_State* L, void* ud, size_t* size) {
- bytecode* buf = (bytecode*)ud;
- if (buf->done == buf->size) {
- *size = 0;
- buf->done = 0;
- return NULL;
- }
- *size = buf->size;
- buf->done = buf->size;
- return (const char*)buf->buf;
+const char *reader(lua_State * L, void *ud, size_t * size)
+{
+ bytecode *buf = (bytecode *) ud;
+ (void)L; /* for -Wunused */
+ if (buf->done == buf->size) {
+ *size = 0;
+ buf->done = 0;
+ return NULL;
+ }
+ *size = buf->size;
+ buf->done = buf->size;
+ return (const char *) buf->buf;
}
-int get_bytecode (lua_State *L) {
- int k;
- k = (int)luaL_checkinteger(L,-1);
- if (k<0) {
- lua_pushnil(L);
- } else if (!bytecode_register_shadow_get(L,k)) {
- if (k<=luabytecode_max && lua_bytecode_registers[k].buf != NULL) {
- if(lua_load(L,reader,(void *)(lua_bytecode_registers+k),"bytecode")) {
- lua_error(L);
- lua_pushnil(L);
- } else {
- lua_pushvalue(L,-1);
- bytecode_register_shadow_set(L,k);
- }
- } else {
- lua_pushnil(L);
+int get_bytecode(lua_State * L)
+{
+ int k;
+ k = (int) luaL_checkinteger(L, -1);
+ if (k < 0) {
+ lua_pushnil(L);
+ } else if (!bytecode_register_shadow_get(L, k)) {
+ if (k <= luabytecode_max && lua_bytecode_registers[k].buf != NULL) {
+ if (lua_load
+ (L, reader, (void *) (lua_bytecode_registers + k),
+ "bytecode")) {
+ lua_error(L);
+ lua_pushnil(L);
+ } else {
+ lua_pushvalue(L, -1);
+ bytecode_register_shadow_set(L, k);
+ }
+ } else {
+ lua_pushnil(L);
+ }
}
- }
- return 1;
+ return 1;
}
-int set_bytecode (lua_State *L) {
- int k, ltype;
- unsigned int i;
- k = (int)luaL_checkinteger(L,-2);
- i = k+1;
- if ((int)(UINT_MAX32/sizeof(bytecode)+1)<i) {
- lua_pushstring(L, "value too large");
- lua_error(L);
- }
- if (k<0) {
- lua_pushstring(L, "negative values not allowed");
- lua_error(L);
- }
- ltype = lua_type(L,-1);
- if (ltype != LUA_TFUNCTION && ltype != LUA_TNIL){
- lua_pushstring(L, "unsupported type");
- lua_error(L);
- }
- if (k>luabytecode_max) {
- i = sizeof(bytecode)*(k+1);
- lua_bytecode_registers = xrealloc(lua_bytecode_registers,i);
- if (luabytecode_max==-1) {
- luabytecode_bytes += sizeof(bytecode)*(k+1);
- } else {
- luabytecode_bytes += sizeof(bytecode)*(k+1-luabytecode_max);
- }
- for (i=(luabytecode_max+1);i<=(unsigned)k;i++) {
- lua_bytecode_registers[i].buf=NULL;
- lua_bytecode_registers[i].size=0;
- lua_bytecode_registers[i].done=0;
- }
- luabytecode_max = k;
- }
- if (lua_bytecode_registers[k].buf != NULL) {
- xfree(lua_bytecode_registers[k].buf);
- luabytecode_bytes -= lua_bytecode_registers[k].size;
- lua_bytecode_registers[k].buf = NULL;
- lua_bytecode_registers[k].size=0;
- lua_bytecode_registers[k].done=0;
- lua_pushnil(L);
- bytecode_register_shadow_set(L,k);
- }
- if (ltype == LUA_TFUNCTION) {
- lua_bytecode_registers[k].buf=xmalloc(LOAD_BUF_SIZE);
- lua_bytecode_registers[k].alloc = LOAD_BUF_SIZE;
- memset(lua_bytecode_registers[k].buf, 0, LOAD_BUF_SIZE);
- lua_dump(L,writer,(void *)(lua_bytecode_registers+k));
- }
- lua_pop(L,1);
- return 0;
+int set_bytecode(lua_State * L)
+{
+ int k, ltype;
+ unsigned int i;
+ k = (int) luaL_checkinteger(L, -2);
+ i = k + 1;
+ if ((int) (UINT_MAX32 / sizeof(bytecode) + 1) < i) {
+ lua_pushstring(L, "value too large");
+ lua_error(L);
+ }
+ if (k < 0) {
+ lua_pushstring(L, "negative values not allowed");
+ lua_error(L);
+ }
+ ltype = lua_type(L, -1);
+ if (ltype != LUA_TFUNCTION && ltype != LUA_TNIL) {
+ lua_pushstring(L, "unsupported type");
+ lua_error(L);
+ }
+ if (k > luabytecode_max) {
+ i = sizeof(bytecode) * (k + 1);
+ lua_bytecode_registers = xrealloc(lua_bytecode_registers, i);
+ if (luabytecode_max == -1) {
+ luabytecode_bytes += sizeof(bytecode) * (k + 1);
+ } else {
+ luabytecode_bytes += sizeof(bytecode) * (k + 1 - luabytecode_max);
+ }
+ for (i = (luabytecode_max + 1); i <= (unsigned) k; i++) {
+ lua_bytecode_registers[i].buf = NULL;
+ lua_bytecode_registers[i].size = 0;
+ lua_bytecode_registers[i].done = 0;
+ }
+ luabytecode_max = k;
+ }
+ if (lua_bytecode_registers[k].buf != NULL) {
+ xfree(lua_bytecode_registers[k].buf);
+ luabytecode_bytes -= lua_bytecode_registers[k].size;
+ lua_bytecode_registers[k].buf = NULL;
+ lua_bytecode_registers[k].size = 0;
+ lua_bytecode_registers[k].done = 0;
+ lua_pushnil(L);
+ bytecode_register_shadow_set(L, k);
+ }
+ if (ltype == LUA_TFUNCTION) {
+ lua_bytecode_registers[k].buf = xmalloc(LOAD_BUF_SIZE);
+ lua_bytecode_registers[k].alloc = LOAD_BUF_SIZE;
+ memset(lua_bytecode_registers[k].buf, 0, LOAD_BUF_SIZE);
+ lua_dump(L, writer, (void *) (lua_bytecode_registers + k));
+ }
+ lua_pop(L, 1);
+ return 0;
}
-static const struct luaL_reg lualib [] = {
- {"getbytecode", get_bytecode},
- {"setbytecode", set_bytecode},
- {NULL, NULL} /* sentinel */
-};
-int luaopen_lua (lua_State *L, int n, char *fname)
+int set_luaname(lua_State * L)
{
- luaL_register(L, "lua", lualib);
- make_table(L,"bytecode","getbytecode","setbytecode");
- lua_newtable(L);
- lua_setfield(L, LUA_REGISTRYINDEX, "bytecode_shadow");
- lua_pushinteger(L, n);
- lua_setfield(L, -2, "id");
- lua_pushstring(L, "0.1");
- lua_setfield(L, -2, "version");
- if (fname == NULL) {
- lua_pushnil(L);
- } else {
- lua_pushstring(L, fname);
- }
- lua_setfield(L, -2, "startupfile");
- return 1;
+ int k;
+ char *s;
+ if (lua_gettop(L)==3) {
+ k = (int) luaL_checkinteger(L, 2);
+ if (k>65535 || k<0) {
+ /* error */
+ } else {
+ if (luanames[k] != NULL) {
+ free(luanames[k]);
+ luanames[k] = NULL;
+ }
+ if (lua_isstring(L, 3)) {
+ s = (char *) lua_tostring(L,3);
+ if (s!=NULL)
+ luanames[k] = xstrdup(s);
+ }
+ }
+ }
+ return 0;
}
+int get_luaname(lua_State * L)
+{
+ int k;
+ k = (int) luaL_checkinteger(L, 2);
+ if (k>65535 || k<0) {
+ /* error */
+ lua_pushnil(L);
+ } else {
+ if (luanames[k]!=NULL)
+ lua_pushstring(L, luanames[k]);
+ else
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+
+
+static const struct luaL_reg lualib[] = {
+ /* *INDENT-OFF* */
+ {"getluaname", get_luaname},
+ {"setluaname", set_luaname},
+ {"getbytecode", get_bytecode},
+ {"setbytecode", set_bytecode},
+ /* *INDENT-ON* */
+ {NULL, NULL} /* sentinel */
+};
+
+int luaopen_lua(lua_State * L, char *fname)
+{
+ luaL_register(L, "lua", lualib);
+ make_table(L, "bytecode", "getbytecode", "setbytecode");
+ make_table(L, "name", "getluaname", "setluaname");
+ lua_newtable(L);
+ lua_setfield(L, LUA_REGISTRYINDEX, "bytecode_shadow");
+ lua_pushstring(L, LUA_VERSION);
+ lua_setfield(L, -2, "version");
+ if (fname == NULL) {
+ lua_pushnil(L);
+ } else {
+ lua_pushstring(L, fname);
+ }
+ lua_setfield(L, -2, "startupfile");
+ return 1;
+}
diff --git a/Build/source/texk/web2c/luatexdir/lua/lmplib.c b/Build/source/texk/web2c/luatexdir/lua/lmplib.c
deleted file mode 100644
index b435618e97b..00000000000
--- a/Build/source/texk/web2c/luatexdir/lua/lmplib.c
+++ /dev/null
@@ -1,1273 +0,0 @@
-/* $Id$ */
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifndef pdfTeX
-#include <lua.h>
-#include <lauxlib.h>
-#include <lualib.h>
-#else
-#include <../lua51/lua.h>
-#include <../lua51/lauxlib.h>
-#include <../lua51/lualib.h>
-#endif
-
-#include "mplib.h"
-#include "mpmp.h"
-#include "mppsout.h" /* for mp_edge_object */
-
-#define MPLIB_METATABLE "MPlib"
-#define MPLIB_FIG_METATABLE "MPlib.fig"
-#define MPLIB_GR_METATABLE "MPlib.gr"
-
-#define mplib_init_S(a) do { \
- lua_pushliteral(L,#a); \
- mplib_##a##_ptr = (char *)lua_tostring(L,-1); \
- mplib_##a##_index = luaL_ref (L,LUA_REGISTRYINDEX); \
- } while (0)
-
-#define mplib_push_S(a) do { \
- lua_rawgeti(L,LUA_REGISTRYINDEX,mplib_##a##_index); \
- } while (0)
-
-#define mplib_is_S(a,i) (mplib_##a##_ptr==(char *)lua_tostring(L,i))
-
-#define mplib_make_S(a) \
- static int mplib_##a##_index = 0; \
- static char *mplib_##a##_ptr = NULL
-
-static int mplib_type_Ses[mp_special_code+1] = {0}; /* [0] is not used */
-
-mplib_make_S(fill);
-mplib_make_S(outline);
-mplib_make_S(text);
-mplib_make_S(special);
-mplib_make_S(start_bounds);
-mplib_make_S(stop_bounds);
-mplib_make_S(start_clip);
-mplib_make_S(stop_clip);
-
-mplib_make_S(left_type);
-mplib_make_S(right_type);
-mplib_make_S(x_coord);
-mplib_make_S(y_coord);
-mplib_make_S(left_x);
-mplib_make_S(left_y);
-mplib_make_S(right_x);
-mplib_make_S(right_y);
-
-mplib_make_S(color);
-mplib_make_S(dash);
-mplib_make_S(depth);
-mplib_make_S(dsize);
-mplib_make_S(font);
-mplib_make_S(height);
-mplib_make_S(htap);
-mplib_make_S(linecap);
-mplib_make_S(linejoin);
-mplib_make_S(miterlimit);
-mplib_make_S(path);
-mplib_make_S(pen);
-mplib_make_S(postscript);
-mplib_make_S(prescript);
-mplib_make_S(transform);
-mplib_make_S(type);
-mplib_make_S(width);
-
-void mplib_init_Ses(lua_State *L) {
- mplib_init_S(fill);
- mplib_init_S(outline);
- mplib_init_S(text);
- mplib_init_S(start_bounds);
- mplib_init_S(stop_bounds);
- mplib_init_S(start_clip);
- mplib_init_S(stop_clip);
- mplib_init_S(special);
-
- mplib_type_Ses[mp_fill_code] = mplib_fill_index;
- mplib_type_Ses[mp_stroked_code] = mplib_outline_index;
- mplib_type_Ses[mp_text_code] = mplib_text_index;
- mplib_type_Ses[mp_start_bounds_code] = mplib_start_bounds_index;
- mplib_type_Ses[mp_stop_bounds_code] = mplib_stop_bounds_index;
- mplib_type_Ses[mp_start_clip_code] = mplib_start_clip_index;
- mplib_type_Ses[mp_stop_clip_code] = mplib_stop_clip_index;
- mplib_type_Ses[mp_special_code] = mplib_special_index;
-
- mplib_init_S(left_type);
- mplib_init_S(right_type);
- mplib_init_S(x_coord);
- mplib_init_S(y_coord);
- mplib_init_S(left_x);
- mplib_init_S(left_y);
- mplib_init_S(right_x);
- mplib_init_S(right_y);
-
- mplib_init_S(color);
- mplib_init_S(dash);
- mplib_init_S(depth);
- mplib_init_S(dsize);
- mplib_init_S(font);
- mplib_init_S(height);
- mplib_init_S(htap);
- mplib_init_S(linecap);
- mplib_init_S(linejoin);
- mplib_init_S(miterlimit);
- mplib_init_S(path);
- mplib_init_S(pen);
- mplib_init_S(postscript);
- mplib_init_S(prescript);
- mplib_init_S(transform);
- mplib_init_S(type);
- mplib_init_S(width);
-}
-
-
-
-
-#define xfree(A) if ((A)!=NULL) { free((A)); A = NULL; }
-
-#define is_mp(L,b) (MP *)luaL_checkudata(L,b,MPLIB_METATABLE)
-#define is_fig(L,b) (struct mp_edge_object **)luaL_checkudata(L,b,MPLIB_FIG_METATABLE)
-#define is_gr_object(L,b) (struct mp_graphic_object **)luaL_checkudata(L,b,MPLIB_GR_METATABLE)
-
-/* Enumeration string arrays */
-
-static const char *interaction_options[] =
- { "unknown","batch","nonstop","scroll","errorstop", NULL};
-
-static const char *mplib_filetype_names[] =
- {"term", "error", "mp", "log", "ps", "mem", "tfm", "map", "pfb", "enc", NULL};
-
-/* only "endpoint" and "explicit" actually happen in paths,
- as well as "open" in elliptical pens */
-
-static const char *knot_type_enum[] =
- { "endpoint", "explicit", "given", "curl", "open", "end_cycle" };
-
-/* object fields */
-
-static const char *fill_fields[] =
- { "type", "path", "htap", "pen", "color", "linejoin", "miterlimit",
- "prescript", "postscript", NULL };
-
-static const char *stroked_fields[] =
- { "type", "path", "pen", "color", "linejoin", "miterlimit", "linecap", "dash",
- "prescript", "postscript", NULL };
-
-static const char *text_fields[] =
- { "type", "text", "dsize", "font", "color", "width", "height", "depth", "transform",
- "prescript", "postscript", NULL };
-
-static const char *special_fields[] =
- { "type", "prescript", NULL };
-
-static const char *start_bounds_fields[] =
- { "type", "path", NULL };
-
-static const char *start_clip_fields[] =
- { "type", "path", NULL };
-
-static const char *stop_bounds_fields[] =
- { "type", NULL };
-
-static const char *stop_clip_fields[] =
- { "type", NULL };
-
-static const char *no_fields[] =
- { NULL };
-
-typedef enum {
- P_ERROR_LINE, P_HALF_LINE, P_MAX_LINE, P_MAIN_MEMORY,
- P_HASH_SIZE, P_HASH_PRIME, P_PARAM_SIZE, P_IN_OPEN, P_RANDOM_SEED,
- P_INTERACTION, P_INI_VERSION, P_TROFF_MODE, P_PRINT_NAMES, P_MEM_NAME,
- P_JOB_NAME, P_FIND_FILE, P__SENTINEL
-} mplib_parm_idx;
-
-typedef struct {
- const char *name; /* parameter name */
- mplib_parm_idx idx; /* parameter index */
-} mplib_parm_struct;
-
-static mplib_parm_struct mplib_parms[] = {
- {"error_line", P_ERROR_LINE },
- {"half_error_line", P_HALF_LINE },
- {"max_print_line", P_MAX_LINE },
- {"main_memory", P_MAIN_MEMORY },
- {"hash_size", P_HASH_SIZE },
- {"hash_prime", P_HASH_PRIME },
- {"param_size", P_PARAM_SIZE },
- {"max_in_open", P_IN_OPEN },
- {"random_seed", P_RANDOM_SEED },
- {"interaction", P_INTERACTION },
- {"ini_version", P_INI_VERSION },
- {"troff_mode", P_TROFF_MODE },
- {"print_found_names", P_PRINT_NAMES },
- {"mem_name", P_MEM_NAME },
- {"job_name", P_JOB_NAME },
- {"find_file", P_FIND_FILE },
- {NULL, P__SENTINEL }
-};
-
-typedef struct _FILE_ITEM {
- FILE *f;
-} _FILE_ITEM ;
-
-typedef struct _FILE_ITEM File;
-
-#define make_stream_buf(A) char *A; size_t A##_size; size_t A##_used
-
-#define free_stream_buf(A) xfree(mplib_data->A); mplib_data->A##_size = 0; mplib_data->A##_used = 0
-
-typedef struct _MPLIB_INSTANCE_DATA {
- void *term_file_ptr;
- void *err_file_ptr;
- void *log_file_ptr;
- void *ps_file_ptr;
- make_stream_buf(term_out);
- make_stream_buf(error_out);
- make_stream_buf(log_out);
- make_stream_buf(ps_out);
- char *input_data;
- char *input_data_ptr;
- size_t input_data_len;
- struct mp_edge_object *edges ;
- lua_State *LL;
-} _MPLIB_INSTANCE_DATA;
-
-typedef struct _MPLIB_INSTANCE_DATA mplib_instance;
-
-static mplib_instance *mplib_get_data (MP mp) {
- return (mplib_instance *)mp->userdata;
-}
-
-static mplib_instance *mplib_make_data (void) {
- mplib_instance *mplib_data = malloc(sizeof(mplib_instance));
- memset(mplib_data,0,sizeof(mplib_instance));
- return mplib_data ;
-}
-
-
-/* Start by defining all the callback routines for the library
- * except |run_make_mpx| and |run_editor|.
- */
-
-
-char *mplib_find_file (MP mp, const char *fname, const char *fmode, int ftype) {
- mplib_instance *mplib_data = mplib_get_data(mp);
- lua_State *L = mplib_data->LL;
- lua_checkstack(L,4);
- lua_getfield(L,LUA_REGISTRYINDEX,"mplib_file_finder");
- if (lua_isfunction(L,-1)) {
- char *s = NULL, *x = NULL;
- lua_pushstring(L, fname);
- lua_pushstring(L, fmode);
- if (ftype >= mp_filetype_text) {
- lua_pushnumber(L, ftype-mp_filetype_text);
- } else {
- lua_pushstring(L, mplib_filetype_names[ftype]);
- }
- if(lua_pcall(L,3,1,0) != 0) {
- fprintf(stdout,"Error in mp.find_file: %s\n", (char *)lua_tostring(L,-1));
- return NULL;
- }
- x = (char *)lua_tostring(L,-1);
- if (x!=NULL)
- s = strdup(x);
- lua_pop(L,1); /* pop the string */
- return s;
- } else {
- lua_pop(L,1);
- }
- if (fmode[0] != 'r' || (! access (fname,R_OK)) || ftype) {
- return strdup(fname);
- }
- return NULL;
-}
-
-static int
-mplib_find_file_function (lua_State *L) {
- if (! (lua_isfunction(L,-1)|| lua_isnil(L,-1) )) {
- return 1; /* error */
- }
- lua_pushstring(L, "mplib_file_finder");
- lua_pushvalue(L,-2);
- lua_rawset(L,LUA_REGISTRYINDEX);
- return 0;
-}
-
-void *mplib_open_file(MP mp, const char *fname, const char *fmode, int ftype) {
- File *ff = malloc(sizeof (File));
- if (ff) {
- mplib_instance *mplib_data = mplib_get_data(mp);
- ff->f = NULL;
- if (ftype==mp_filetype_terminal) {
- if (fmode[0] == 'r') {
- ff->f = stdin;
- } else {
- xfree(mplib_data->term_file_ptr);
- ff->f = malloc(1);
- mplib_data->term_file_ptr = ff->f;
- }
- } else if (ftype==mp_filetype_error) {
- xfree(mplib_data->err_file_ptr);
- ff->f = malloc(1);
- mplib_data->err_file_ptr = ff->f;
- } else if (ftype == mp_filetype_log) {
- xfree(mplib_data->log_file_ptr);
- ff->f = malloc(1);
- mplib_data->log_file_ptr = ff->f;
- } else if (ftype == mp_filetype_postscript) {
- xfree(mplib_data->ps_file_ptr);
- ff->f = malloc(1);
- mplib_data->ps_file_ptr = ff->f;
- } else {
- char realmode[3];
- char *f = mplib_find_file(mp, fname,fmode,ftype);
- if (f==NULL)
- return NULL;
- realmode[0] = *fmode;
- realmode[1] = 'b';
- realmode[2] = 0;
- ff->f = fopen(f, realmode);
- if ((fmode[0] == 'r') && (ff->f == NULL)) {
- free(ff);
- return NULL;
- }
- }
- return ff;
- }
- return NULL;
-}
-
-static int
-mplib_get_char (void *f, mplib_instance *mplib_data) {
- int c;
- if (f==stdin && mplib_data->input_data != NULL) {
- if (mplib_data->input_data_len==0) {
- if (mplib_data->input_data_ptr!=NULL)
- mplib_data->input_data_ptr = NULL;
- else
- mplib_data->input_data = NULL;
- c = EOF;
- } else {
- mplib_data->input_data_len--;
- c = *(mplib_data->input_data_ptr)++;
- }
- } else {
- c = fgetc(f);
- }
- return c;
-}
-
-static void
-mplib_unget_char (void *f, mplib_instance *mplib_data, int c) {
- if (f==stdin && mplib_data->input_data_ptr != NULL) {
- mplib_data->input_data_len++;
- mplib_data->input_data_ptr--;
- } else {
- ungetc(c,f);
- }
-}
-
-
-char *mplib_read_ascii_file (MP mp, void *ff, size_t *size) {
- char *s = NULL;
- if (ff!=NULL) {
- int c;
- size_t len = 0, lim = 128;
- mplib_instance *mplib_data = mplib_get_data(mp);
- FILE *f = ((File *)ff)->f;
- if (f==NULL)
- return NULL;
- *size = 0;
- c = mplib_get_char(f,mplib_data);
- if (c==EOF)
- return NULL;
- s = malloc(lim);
- if (s==NULL) return NULL;
- while (c!=EOF && c!='\n' && c!='\r') {
- if (len==lim) {
- s =realloc(s, (lim+(lim>>2)));
- if (s==NULL) return NULL;
- lim+=(lim>>2);
- }
- s[len++] = c;
- c = mplib_get_char(f,mplib_data);
- }
- if (c=='\r') {
- c = mplib_get_char(f,mplib_data);
- if (c!=EOF && c!='\n')
- mplib_unget_char(f,mplib_data,c);
- }
- s[len] = 0;
- *size = len;
- }
- return s;
-}
-
-#define APPEND_STRING(a,b) do { \
- if ((mplib_data->a##_used+strlen(b))>=mplib_data->a##_size) { \
- mplib_data->a##_size += 256+(mplib_data->a##_size)/5+strlen(b); \
- mplib_data->a = realloc(mplib_data->a,mplib_data->a##_size); \
- } \
- (void)strcpy(mplib_data->a+mplib_data->a##_used,b); \
- mplib_data->a##_used += strlen(b); \
- } while (0)
-
-void mplib_write_ascii_file (MP mp, void *ff, const char *s) {
- if (ff!=NULL) {
- void *f = ((File *)ff)->f;
- mplib_instance *mplib_data = mplib_get_data(mp);
- if (f!=NULL) {
- if (f==mplib_data->term_file_ptr) {
- APPEND_STRING(term_out,s);
- } else if (f==mplib_data->err_file_ptr) {
- APPEND_STRING(error_out,s);
- } else if (f==mplib_data->log_file_ptr) {
- APPEND_STRING(log_out,s);
- } else if (f==mplib_data->ps_file_ptr) {
- APPEND_STRING(ps_out,s);
- } else {
- fprintf((FILE *)f,"%s",s);
- }
- }
- }
-}
-
-void mplib_read_binary_file (MP mp, void *ff, void **data, size_t *size) {
- (void)mp;
- if (ff!=NULL) {
- size_t len = 0;
- FILE *f = ((File *)ff)->f;
- if (f!=NULL)
- len = fread(*data,1,*size,f);
- *size = len;
- }
-}
-
-void mplib_write_binary_file (MP mp, void *ff, void *s, size_t size) {
- (void)mp;
- if (ff!=NULL) {
- FILE *f = ((File *)ff)->f;
- if (f!=NULL)
- fwrite(s,size,1,f);
- }
-}
-
-
-void mplib_close_file (MP mp, void *ff) {
- if (ff!=NULL) {
- mplib_instance *mplib_data = mplib_get_data(mp);
- void *f = ((File *)ff)->f;
- if (f != NULL && f != mplib_data->term_file_ptr && f != mplib_data->err_file_ptr
- && f != mplib_data->log_file_ptr && f != mplib_data->ps_file_ptr) {
- fclose(f);
- }
- free(ff);
- }
-}
-
-int mplib_eof_file (MP mp, void *ff) {
- if (ff!=NULL) {
- mplib_instance *mplib_data = mplib_get_data(mp);
- FILE *f = ((File *)ff)->f;
- if (f==NULL)
- return 1;
- if (f==stdin && mplib_data->input_data != NULL) {
- return (mplib_data->input_data_len==0);
- }
- return feof(f);
- }
- return 1;
-}
-
-void mplib_flush_file (MP mp, void *ff) {
- (void)mp;
- (void)ff;
- return ;
-}
-
-#define APPEND_TO_EDGES(a) do { \
- if (mplib_data->edges==NULL) { \
- mplib_data->edges = hh; \
- } else { \
- struct mp_edge_object *p = mplib_data->edges; \
- while (p->_next!=NULL) { p = p->_next; } \
- p->_next = hh; \
- } \
-} while (0)
-
-void mplib_shipout_backend (MP mp, int h) {
- struct mp_edge_object *hh = mp_gr_export(mp, h);
- if (hh) {
- mplib_instance *mplib_data = mplib_get_data(mp);
- APPEND_TO_EDGES(hh);
- }
-}
-
-
-static void
-mplib_setup_file_ops(struct MP_options * options) {
- options->find_file = mplib_find_file;
- options->open_file = mplib_open_file;
- options->close_file = mplib_close_file;
- options->eof_file = mplib_eof_file;
- options->flush_file = mplib_flush_file;
- options->write_ascii_file = mplib_write_ascii_file;
- options->read_ascii_file = mplib_read_ascii_file;
- options->write_binary_file = mplib_write_binary_file;
- options->read_binary_file = mplib_read_binary_file;
- options->shipout_backend = mplib_shipout_backend;
-}
-
-static int
-mplib_new (lua_State *L) {
- MP *mp_ptr;
- mp_ptr = lua_newuserdata(L, sizeof(MP *));
- if (mp_ptr) {
- int i;
- mplib_instance *mplib_data;
- struct MP_options * options; /* instance options */
- options = mp_options();
- mplib_setup_file_ops(options);
- mplib_data = mplib_make_data();
- mplib_data->LL = L;
- options->userdata = (void *)mplib_data;
- options->noninteractive = 1; /* required ! */
- options->print_found_names = 0;
- if (lua_type(L,1)==LUA_TTABLE) {
- for (i=0;mplib_parms[i].name!=NULL;i++) {
- lua_getfield(L,1,mplib_parms[i].name);
- if (lua_isnil(L,-1)) {
- lua_pop(L,1);
- continue; /* skip unset */
- }
- switch(mplib_parms[i].idx) {
- case P_ERROR_LINE:
- options->error_line = lua_tointeger(L,-1);
- break;
- case P_HALF_LINE:
- options->half_error_line = lua_tointeger(L,-1);
- break;
- case P_MAX_LINE:
- options->max_print_line = lua_tointeger(L,-1);
- break;
- case P_MAIN_MEMORY:
- options->main_memory = lua_tointeger(L,-1);
- break;
- case P_HASH_SIZE:
- options->hash_size = lua_tointeger(L,-1);
- break;
- case P_HASH_PRIME:
- options->hash_prime = lua_tointeger(L,-1);
- break;
- case P_PARAM_SIZE:
- options->param_size = lua_tointeger(L,-1);
- break;
- case P_IN_OPEN:
- options->max_in_open = lua_tointeger(L,-1);
- break;
- case P_RANDOM_SEED:
- options->random_seed = lua_tointeger(L,-1);
- break;
- case P_INTERACTION:
- options->interaction = luaL_checkoption(L,-1,"errorstopmode", interaction_options);
- break;
- case P_INI_VERSION:
- options->ini_version = lua_toboolean(L,-1);
- break;
- case P_TROFF_MODE:
- options->troff_mode = lua_toboolean(L,-1);
- break;
- case P_PRINT_NAMES:
- options->print_found_names = lua_toboolean(L,-1);
- break;
- /*
- case P_COMMAND_LINE:
- options->command_line = strdup((char *)lua_tostring(L,-1));
- break;
- */
- case P_MEM_NAME:
- options->mem_name = strdup((char *)lua_tostring(L,-1));
- break;
- case P_JOB_NAME:
- options->job_name = strdup((char *)lua_tostring(L,-1));
- break;
- case P_FIND_FILE:
- if(mplib_find_file_function(L)) { /* error here */
- fprintf(stdout,"Invalid arguments to mp.new({find_file=...})\n");
- }
- break;
- default:
- break;
- }
- lua_pop(L,1);
- }
- }
- *mp_ptr = mp_new(options);
- xfree(options->command_line);
- xfree(options->mem_name);
- xfree(options->job_name);
- free(options);
- if (*mp_ptr) {
- luaL_getmetatable(L,MPLIB_METATABLE);
- lua_setmetatable(L,-2);
- return 1;
- }
- }
- lua_pushnil(L);
- return 1;
-}
-
-static int
-mplib_collect (lua_State *L) {
- MP *mp_ptr = is_mp(L,1);
- xfree(*mp_ptr);
- return 0;
-}
-
-static int
-mplib_tostring (lua_State *L) {
- MP *mp_ptr = is_mp(L,1);
- if (*mp_ptr!=NULL) {
- lua_pushfstring(L,"<MP %p>",*mp_ptr);
- return 1;
- }
- return 0;
-}
-
-static int
-mplib_wrapresults(lua_State *L, mplib_instance *mplib_data, int h) {
- lua_checkstack(L,5);
- lua_newtable(L);
- if (mplib_data->term_out != NULL) {
- lua_pushstring(L,mplib_data->term_out);
- lua_setfield(L,-2,"term");
- free_stream_buf(term_out);
- }
- if (mplib_data->error_out != NULL) {
- lua_pushstring(L,mplib_data->error_out);
- lua_setfield(L,-2,"error");
- free_stream_buf(error_out);
- }
- if (mplib_data->log_out != NULL ) {
- lua_pushstring(L,mplib_data->log_out);
- lua_setfield(L,-2,"log");
- free_stream_buf(log_out);
- }
- if (mplib_data->edges != NULL ) {
- struct mp_edge_object **v;
- struct mp_edge_object *p = mplib_data->edges;
- int i = 1;
- lua_newtable(L);
- while (p!=NULL) {
- v = lua_newuserdata (L, sizeof(struct mp_edge_object *));
- *v = p;
- luaL_getmetatable(L,MPLIB_FIG_METATABLE);
- lua_setmetatable(L,-2);
- lua_rawseti(L,-2,i); i++;
- p = p->_next;
- }
- lua_setfield(L,-2,"fig");
- mplib_data->edges = NULL;
- }
- lua_pushnumber(L,h);
- lua_setfield(L,-2,"status");
- return 1;
-}
-
-static int
-mplib_execute (lua_State *L) {
- MP *mp_ptr = is_mp(L,1);
- if (*mp_ptr!=NULL && lua_isstring(L,2)) {
- int h;
- mplib_instance *mplib_data = mplib_get_data(*mp_ptr);
- mplib_data->input_data = (char *)lua_tolstring(L,2, &(mplib_data->input_data_len));
- mplib_data->input_data_ptr = mplib_data->input_data;
- if ((*mp_ptr)->run_state==0) {
- h = mp_initialize(*mp_ptr);
- }
- h = mp_execute(*mp_ptr);
- if (mplib_data->input_data_len!=0) {
- mplib_data->input_data = NULL;
- mplib_data->input_data_ptr = NULL;
- mplib_data->input_data_len=0;
- }
- return mplib_wrapresults(L, mplib_data, h);
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-static int
-mplib_finish (lua_State *L) {
- MP *mp_ptr = is_mp(L,1);
- if (*mp_ptr!=NULL) {
- mplib_instance *mplib_data = mplib_get_data(*mp_ptr);
- int h = mp_finish(*mp_ptr);
- return mplib_wrapresults(L, mplib_data, h);
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-static int
-mplib_statistics (lua_State *L) {
- MP *mp_ptr = is_mp(L,1);
- if (*mp_ptr!=NULL) {
- lua_newtable(L);
- lua_pushnumber(L, mp_memory_usage (*mp_ptr));
- lua_setfield(L,-2,"main_memory");
- lua_pushnumber(L, mp_hash_usage (*mp_ptr));
- lua_setfield(L,-2,"hash_size");
- lua_pushnumber(L, mp_param_usage (*mp_ptr));
- lua_setfield(L,-2,"param_size");
- lua_pushnumber(L, mp_open_usage (*mp_ptr));
- lua_setfield(L,-2,"max_in_open");
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-
-/* figure methods */
-
-static int
-mplib_fig_collect (lua_State *L) {
- struct mp_edge_object **hh = is_fig(L,1);
- if (*hh!=NULL) {
- mp_gr_toss_objects (*hh);
- *hh=NULL;
- }
- return 0;
-}
-
-static int
-mplib_fig_body (lua_State *L) {
- int i = 1;
- struct mp_graphic_object **v;
- struct mp_graphic_object *p;
- struct mp_edge_object **hh = is_fig(L,1);
- lua_newtable(L);
- p = (*hh)->body;
- while (p!=NULL) {
- v = lua_newuserdata (L, sizeof(struct mp_graphic_object *));
- *v = p;
- luaL_getmetatable(L,MPLIB_GR_METATABLE);
- lua_setmetatable(L,-2);
- lua_rawseti(L,-2,i); i++;
- p = p->_link_field;
- }
- (*hh)->body = NULL; /* prevent double free */
- return 1;
-}
-
-static int
-mplib_fig_copy_body (lua_State *L) {
- int i = 1;
- struct mp_graphic_object **v;
- struct mp_graphic_object *p;
- struct mp_edge_object **hh = is_fig(L,1);
- lua_newtable(L);
- p = (*hh)->body;
- while (p!=NULL) {
- v = lua_newuserdata (L, sizeof(struct mp_graphic_object *));
- *v = mp_gr_copy_object((*hh)->_parent,p);
- luaL_getmetatable(L,MPLIB_GR_METATABLE);
- lua_setmetatable(L,-2);
- lua_rawseti(L,-2,i); i++;
- p = p->_link_field;
- }
- return 1;
-}
-
-
-static int
-mplib_fig_tostring (lua_State *L) {
- struct mp_edge_object **hh = is_fig(L,1);
- lua_pushfstring(L,"<figure %p>",*hh);
- return 1;
-}
-
-
-
-static int
-mp_wrapped_shipout (struct mp_edge_object *hh, int prologues, int procset) {
- MP mp = hh->_parent;
- if (setjmp(mp->jump_buf)) {
- return 0;
- }
- mp_gr_ship_out(hh,prologues,procset);
- return 1;
-}
-
-static int
-mplib_fig_postscript (lua_State *L) {
- struct mp_edge_object **hh = is_fig(L,1);
- int prologues = luaL_optnumber(L,2,-1);
- int procset = luaL_optnumber(L,3,-1);
- mplib_instance *mplib_data = mplib_get_data((*hh)->_parent);
- if (mplib_data->ps_out == NULL) {
- if (mp_wrapped_shipout(*hh,prologues, procset)) {
- if (mplib_data->ps_out!=NULL ) {
- lua_pushstring(L, mplib_data->ps_out);
- free_stream_buf(ps_out);
- } else {
- lua_pushnil(L);
- }
- return 1;
- } else {
- lua_pushnil(L);
- lua_pushstring(L,mplib_data->log_out);
- xfree(mplib_data->ps_out);
- return 2;
- }
- }
- lua_pushnil(L);
- return 1;
-}
-
-static int
-mplib_fig_filename (lua_State *L) {
- struct mp_edge_object **hh = is_fig(L,1);
- if (*hh!= NULL) {
- char *s = (*hh)->_filename;
- lua_pushstring(L,s);
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-
-static int
-mplib_fig_bb (lua_State *L) {
- struct mp_edge_object **hh = is_fig(L,1);
- lua_newtable(L);
- lua_pushnumber(L, (double)(*hh)->_minx/65536.0);
- lua_rawseti(L,-2,1);
- lua_pushnumber(L, (double)(*hh)->_miny/65536.0);
- lua_rawseti(L,-2,2);
- lua_pushnumber(L, (double)(*hh)->_maxx/65536.0);
- lua_rawseti(L,-2,3);
- lua_pushnumber(L, (double)(*hh)->_maxy/65536.0);
- lua_rawseti(L,-2,4);
- return 1;
-}
-
-/* object methods */
-
-static int
-mplib_gr_collect (lua_State *L) {
- struct mp_graphic_object **hh = is_gr_object(L,1);
- if (*hh!=NULL) {
- mp_gr_toss_object(*hh);
- *hh=NULL;
- }
- return 0;
-}
-
-static int
-mplib_gr_tostring (lua_State *L) {
- struct mp_graphic_object **hh = is_gr_object(L,1);
- lua_pushfstring(L,"<object %p>",*hh);
- return 1;
-}
-
-
-static int
-mplib_gr_fields (lua_State *L) {
- const char **fields;
- int i ;
- struct mp_graphic_object **hh = is_gr_object(L,1);
- if (*hh) {
- switch ((*hh)->_type_field) {
- case mp_fill_code: fields = fill_fields; break;
- case mp_stroked_code: fields = stroked_fields; break;
- case mp_text_code: fields = text_fields; break;
- case mp_special_code: fields = special_fields; break;
- case mp_start_clip_code: fields = start_clip_fields; break;
- case mp_start_bounds_code: fields = start_bounds_fields; break;
- case mp_stop_clip_code: fields = stop_clip_fields; break;
- case mp_stop_bounds_code: fields = stop_bounds_fields; break;
- default: fields = no_fields;
- }
- lua_newtable(L);
- for (i=0;fields[i]!=NULL;i++) {
- lua_pushstring(L,fields[i]);
- lua_rawseti(L,-2,(i+1));
- }
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-
-#define mplib_push_number(L,x) lua_pushnumber(L,(lua_Number)(x)/65536.0)
-
-#define MPLIB_PATH 0
-#define MPLIB_PEN 1
-
-static void
-mplib_push_path (lua_State *L, struct mp_knot *h, int is_pen) {
- struct mp_knot *p; /* for scanning the path */
- int i=1;
- p=h;
- if (p!=NULL) {
- lua_newtable(L);
- do {
- lua_createtable(L,0,6);
- if (!is_pen) {
- if (p->left_type_field != mp_explicit) {
- mplib_push_S(left_type);
- lua_pushstring(L,knot_type_enum[p->left_type_field]);
- lua_rawset(L,-3);
- }
- if (p->right_type_field != mp_explicit) {
- mplib_push_S(right_type);
- lua_pushstring(L,knot_type_enum[p->right_type_field]);
- lua_rawset(L,-3);
- }
- }
- mplib_push_S(x_coord);
- mplib_push_number(L,p->x_coord_field);
- lua_rawset(L,-3);
- mplib_push_S(y_coord);
- mplib_push_number(L,p->y_coord_field);
- lua_rawset(L,-3);
- mplib_push_S(left_x);
- mplib_push_number(L,p->left_x_field);
- lua_rawset(L,-3);
- mplib_push_S(left_y);
- mplib_push_number(L,p->left_y_field);
- lua_rawset(L,-3);
- mplib_push_S(right_x);
- mplib_push_number(L,p->right_x_field);
- lua_rawset(L,-3);
- mplib_push_S(right_y);
- mplib_push_number(L,p->right_y_field);
- lua_rawset(L,-3);
- lua_rawseti(L,-2,i); i++;
- if ( p->right_type_field==mp_endpoint ) {
- return;
- }
- p=p->next_field;
- } while (p!=h) ;
- } else {
- lua_pushnil(L);
- }
-}
-
-/* this assumes that the top of the stack is a table
- or nil already in the case
- */
-static void
-mplib_push_pentype (lua_State *L, struct mp_knot *h) {
- struct mp_knot *p; /* for scanning the path */
- p=h;
- if (p==NULL) {
- /* do nothing */
- } else if (p==p->next_field) {
- mplib_push_S(type);
- lua_pushstring(L,"elliptical");
- lua_rawset(L,-3);
- } else {
- }
-}
-
-#define set_color_objects(pq) \
- object_color_model = pq->color_model_field; \
- object_color_a = pq->color_field._a_val; \
- object_color_b = pq->color_field._b_val; \
- object_color_c = pq->color_field._c_val; \
- object_color_d = pq->color_field._d_val;
-
-
-static void
-mplib_push_color (lua_State *L, struct mp_graphic_object *p ) {
- int object_color_model;
- int object_color_a, object_color_b, object_color_c, object_color_d ;
- if (p!=NULL) {
- if (p->_type_field == mp_fill_code) {
- mp_fill_object *h = (mp_fill_object *)p;
- set_color_objects(h);
- } else if (p->_type_field == mp_stroked_code) {
- mp_stroked_object *h = (mp_stroked_object *)p;
- set_color_objects(h);
- } else {
- mp_text_object *h = (mp_text_object *)p;
- set_color_objects(h);
- }
- lua_newtable(L);
- if (object_color_model >= mp_grey_model) {
- mplib_push_number(L,object_color_a);
- lua_rawseti(L,-2,1);
- if (object_color_model >= mp_rgb_model) {
- mplib_push_number(L,object_color_b);
- lua_rawseti(L,-2,2);
- mplib_push_number(L,object_color_c);
- lua_rawseti(L,-2,3);
- if (object_color_model == mp_cmyk_model) {
- mplib_push_number(L,object_color_d);
- lua_rawseti(L,-2,4);
- }
- }
- }
- } else {
- lua_pushnil(L);
- }
-}
-
-/* the dash scale is not exported, the field has no external value */
-static void
-mplib_push_dash (lua_State *L, struct mp_stroked_object *h ) {
- mp_dash_object *d;
- double ds;
- if (h!=NULL && h->dash_p_field != NULL) {
- d = h->dash_p_field;
- lua_newtable(L);
- mplib_push_number(L,d->offset_field);
- lua_setfield(L,-2,"offset");
- if (d->array_field!=NULL ) {
- int i = 0;
- lua_newtable(L);
- while (*(d->array_field+i) != -1) {
- ds = *(d->array_field+1) / 65536.0;
- lua_pushnumber(L, ds);
- i++;
- lua_rawseti(L,-2,i);
- }
- lua_setfield(L,-2,"dashes");
- }
- } else {
- lua_pushnil(L);
- }
-}
-
-static void
-mplib_push_transform (lua_State *L, struct mp_text_object *h ) {
- int i = 1;
- if (h!=NULL) {
- lua_createtable(L,6,0);
- mplib_push_number(L,h->tx_field);
- lua_rawseti(L,-2,i); i++;
- mplib_push_number(L,h->ty_field);
- lua_rawseti(L,-2,i); i++;
- mplib_push_number(L,h->txx_field);
- lua_rawseti(L,-2,i); i++;
- mplib_push_number(L,h->tyx_field);
- lua_rawseti(L,-2,i); i++;
- mplib_push_number(L,h->txy_field);
- lua_rawseti(L,-2,i); i++;
- mplib_push_number(L,h->tyy_field);
- lua_rawseti(L,-2,i); i++;
- } else {
- lua_pushnil(L);
- }
-}
-
-#define FIELD(A) (mplib_is_S(A,2))
-
-static void
-mplib_fill_field (lua_State *L, struct mp_fill_object *h) {
- if (FIELD(path)) {
- mplib_push_path(L, h->path_p_field, MPLIB_PATH);
- } else if (FIELD(htap)) {
- mplib_push_path(L, h->htap_p_field, MPLIB_PATH);
- } else if (FIELD(pen)) {
- mplib_push_path(L, h->pen_p_field, MPLIB_PEN);
- mplib_push_pentype(L, h->pen_p_field);
- } else if (FIELD(color)) {
- mplib_push_color(L,(mp_graphic_object *)h);
- } else if (FIELD(linejoin)) {
- lua_pushnumber(L,h->ljoin_field);
- } else if (FIELD(miterlimit)) {
- mplib_push_number(L,h->miterlim_field);
- } else if (FIELD(prescript)) {
- lua_pushstring(L,h->pre_script_field);
- } else if (FIELD(postscript)) {
- lua_pushstring(L,h->post_script_field);
- } else {
- lua_pushnil(L);
- }
-}
-
-static void
-mplib_stroked_field (lua_State *L, struct mp_stroked_object *h) {
- if (FIELD(path)) {
- mplib_push_path(L, h->path_p_field, MPLIB_PATH);
- } else if (FIELD(pen)) {
- mplib_push_path(L, h->pen_p_field, MPLIB_PEN);
- mplib_push_pentype(L, h->pen_p_field);
- } else if (FIELD(color)) {
- mplib_push_color(L, (mp_graphic_object *)h);
- } else if (FIELD(dash)) {
- mplib_push_dash(L,h);
- } else if (FIELD(linecap)) {
- lua_pushnumber(L,h->lcap_field);
- } else if (FIELD(linejoin)) {
- lua_pushnumber(L,h->ljoin_field);
- } else if (FIELD(miterlimit)) {
- mplib_push_number(L,h->miterlim_field);
- } else if (FIELD(prescript)) {
- lua_pushstring(L,h->pre_script_field);
- } else if (FIELD(postscript)) {
- lua_pushstring(L,h->post_script_field);
- } else {
- lua_pushnil(L);
- }
-}
-
-static void
-mplib_text_field (lua_State *L, struct mp_text_object *h) {
- if (FIELD(text)) {
- lua_pushstring(L,h->text_p_field);
- } else if (FIELD(dsize)) {
- mplib_push_number(L,(h->font_dsize_field/16));
- } else if (FIELD(font)) {
- lua_pushstring(L,h->font_name_field);
- } else if (FIELD(color)) {
- mplib_push_color(L,(mp_graphic_object *)h);
- } else if (FIELD(width)) {
- mplib_push_number(L,h->width_field);
- } else if (FIELD(height)) {
- mplib_push_number(L,h->height_field);
- } else if (FIELD(depth)) {
- mplib_push_number(L,h->depth_field);
- } else if (FIELD(transform)) {
- mplib_push_transform(L,h);
- } else if (FIELD(prescript)) {
- lua_pushstring(L,h->pre_script_field);
- } else if (FIELD(postscript)) {
- lua_pushstring(L,h->post_script_field);
- } else {
- lua_pushnil(L);
- }
-}
-
-static void
-mplib_special_field (lua_State *L, struct mp_special_object *h) {
- if (FIELD(prescript)) {
- lua_pushstring(L,h->pre_script_field);
- } else {
- lua_pushnil(L);
- }
-}
-
-static void
-mplib_start_bounds_field (lua_State *L, struct mp_bounds_object *h) {
- if (FIELD(path)) {
- mplib_push_path(L,h->path_p_field, MPLIB_PATH);
- } else {
- lua_pushnil(L);
- }
-}
-
-static void
-mplib_start_clip_field (lua_State *L, struct mp_clip_object *h) {
- if (FIELD(path)) {
- mplib_push_path(L,h->path_p_field, MPLIB_PATH);
- } else {
- lua_pushnil(L);
- }
-}
-
-static int
-mplib_gr_index (lua_State *L) {
- struct mp_graphic_object **hh = is_gr_object(L,1);
- if (*hh) {
- struct mp_graphic_object *h = *hh;
-
- if (mplib_is_S(type,2)) {
- lua_rawgeti(L,LUA_REGISTRYINDEX,mplib_type_Ses[h->_type_field]);
- } else {
- switch (h->_type_field) {
- case mp_fill_code: mplib_fill_field(L,(mp_fill_object *)h); break;
- case mp_stroked_code: mplib_stroked_field(L,(mp_stroked_object *)h); break;
- case mp_text_code: mplib_text_field(L,(mp_text_object *)h); break;
- case mp_special_code: mplib_special_field(L,(mp_special_object *)h); break;
- case mp_start_clip_code: mplib_start_clip_field(L,(mp_clip_object *)h); break;
- case mp_start_bounds_code: mplib_start_bounds_field(L,(mp_bounds_object *)h); break;
- /* case mp_stop_clip_code: */
- /* case mp_stop_bounds_code: */
- default: lua_pushnil(L);
- }
- }
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-
-static const struct luaL_reg mplib_meta[] = {
- {"__gc", mplib_collect},
- {"__tostring", mplib_tostring},
- {NULL, NULL} /* sentinel */
-};
-
-static const struct luaL_reg mplib_fig_meta[] = {
- {"__gc", mplib_fig_collect },
- {"__tostring", mplib_fig_tostring },
- {"objects", mplib_fig_body },
- {"copy_objects", mplib_fig_copy_body },
- {"filename", mplib_fig_filename },
- {"postscript", mplib_fig_postscript },
- {"boundingbox", mplib_fig_bb },
- {NULL, NULL} /* sentinel */
-};
-
-static const struct luaL_reg mplib_gr_meta[] = {
- {"__gc", mplib_gr_collect },
- {"__tostring", mplib_gr_tostring },
- {"__index", mplib_gr_index },
- {NULL, NULL} /* sentinel */
-};
-
-
-static const struct luaL_reg mplib_d [] = {
- {"execute", mplib_execute },
- {"finish", mplib_finish },
- {"statistics", mplib_statistics },
- {NULL, NULL} /* sentinel */
-};
-
-
-static const struct luaL_reg mplib_m[] = {
- {"new", mplib_new },
- {"fields", mplib_gr_fields },
- {NULL, NULL} /* sentinel */
-};
-
-
-int
-luaopen_mp (lua_State *L) {
- mplib_init_Ses(L);
-
- luaL_newmetatable(L,MPLIB_GR_METATABLE);
- lua_pushvalue(L, -1); /* push metatable */
- lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
- luaL_register(L, NULL, mplib_gr_meta); /* object meta methods */
- lua_pop(L,1);
-
- luaL_newmetatable(L,MPLIB_FIG_METATABLE);
- lua_pushvalue(L, -1); /* push metatable */
- lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
- luaL_register(L, NULL, mplib_fig_meta); /* figure meta methods */
- lua_pop(L,1);
-
- luaL_newmetatable(L,MPLIB_METATABLE);
- lua_pushvalue(L, -1); /* push metatable */
- lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
- luaL_register(L, NULL, mplib_meta); /* meta methods */
- luaL_register(L, NULL, mplib_d); /* dict methods */
- luaL_register(L, "mplib", mplib_m); /* module functions */
- return 1;
-}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index de269d5d9c8..0bbbc021987 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -1,10 +1,32 @@
-/* $Id: lnodelib.c 1056 2008-02-19 15:42:17Z taco $ */
+/* lnodelib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+#include "commands.h"
+
+static const char _svn_version[] =
+ "$Id: lnodelib.c 2027 2009-03-14 18:47:32Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/lnodelib.c $";
+
#define init_luaS_index(a) do { \
lua_pushliteral(L,#a); \
luaS_##a##_ptr = (char *)lua_tostring(L,-1); \
@@ -15,7 +37,7 @@
static int luaS_##a##_index = 0; \
static char * luaS_##a##_ptr = NULL
-#define luaS_index(a) luaS_##a##_index
+#define luaS_index(a) luaS_##a##_index
#define luaS_ptr_eq(a,b) (a==luaS_##b##_ptr)
@@ -23,75 +45,81 @@
make_luaS_index(luatex_node);
-halfword *check_isnode (lua_State *L, int ud) {
- register halfword *p = lua_touserdata(L, ud);
- if (p != NULL) {
- if (lua_getmetatable(L, ud)) {
- lua_rawgeti(L,LUA_REGISTRYINDEX,luaS_index(luatex_node));
- lua_gettable(L, LUA_REGISTRYINDEX);
- if (lua_rawequal(L, -1, -2)) {
- lua_pop(L, 2);
- return p;
- }
+halfword *check_isnode(lua_State * L, int ud)
+{
+ register halfword *p = lua_touserdata(L, ud);
+ if (p != NULL) {
+ if (lua_getmetatable(L, ud)) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(luatex_node));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ if (lua_rawequal(L, -1, -2)) {
+ lua_pop(L, 2);
+ return p;
+ }
+ }
}
- }
- luaL_typerror(L, ud, NODE_METATABLE);
- return NULL;
+ luaL_typerror(L, ud, NODE_METATABLE);
+ return NULL;
}
/* This routine finds the numerical value of a string (or number) at
lua stack index |n|. If it is not a valid node type, returns -1 */
-static
-int do_get_node_type_id (lua_State *L, int n, node_info *data) {
- register int j;
- if (lua_type(L,n)==LUA_TSTRING) {
- char *s = (char *)lua_tostring(L,n);
- for (j=0;data[j].id!=-1;j++) {
- if (strcmp(s,data[j].name)==0)
- return j;
- }
- } else if (lua_type(L,n)==LUA_TNUMBER) {
- register int i = lua_tointeger(L,n);
- if (data[i].id==i)
- return i;
- for (j=0;data[j].id!=-1;j++) {
- if (data[j].id==i)
- return j;
+static
+int do_get_node_type_id(lua_State * L, int n, node_info * data)
+{
+ register int j;
+ if (lua_type(L, n) == LUA_TSTRING) {
+ char *s = (char *) lua_tostring(L, n);
+ for (j = 0; data[j].id != -1; j++) {
+ if (strcmp(s, data[j].name) == 0)
+ return j;
+ }
+ } else if (lua_type(L, n) == LUA_TNUMBER) {
+ register int i = lua_tointeger(L, n);
+ for (j = 0; data[j].id != -1; j++) {
+ if (data[j].id == i)
+ return j;
+ }
}
- }
- return -1;
+ return -1;
}
#define get_node_type_id(L,n) do_get_node_type_id(L,n,node_data)
#define get_node_subtype_id(L,n) do_get_node_type_id(L,n,whatsit_node_data)
-static
-int get_valid_node_type_id (lua_State *L, int n) {
- int i = get_node_type_id(L,n);
- if (i==-1) {
- if (lua_type(L,n)==LUA_TSTRING) {
- lua_pushfstring(L, "Invalid node type id: %s",(char *)lua_tostring(L,n));
- } else {
- lua_pushfstring(L, "Invalid node type id: %d",(int)lua_tonumber(L,n));
+static
+int get_valid_node_type_id(lua_State * L, int n)
+{
+ int i = get_node_type_id(L, n);
+ if (i == -1) {
+ if (lua_type(L, n) == LUA_TSTRING) {
+ lua_pushfstring(L, "Invalid node type id: %s",
+ (char *) lua_tostring(L, n));
+ } else {
+ lua_pushfstring(L, "Invalid node type id: %d",
+ (int) lua_tonumber(L, n));
+ }
+ return lua_error(L);
}
- return lua_error(L);
- }
- return i;
+ return i;
}
-static
-int get_valid_node_subtype_id (lua_State *L, int n) {
- int i = get_node_subtype_id(L,n);
- if (i==-1) {
- if (lua_type(L,n)==LUA_TSTRING) {
- lua_pushfstring(L, "Invalid whatsit node id: %s",(char *)lua_tostring(L,n));
- } else {
- lua_pushfstring(L, "Invalid whatsit node id: %d",(int)lua_tonumber(L,n));
+static
+int get_valid_node_subtype_id(lua_State * L, int n)
+{
+ int i = get_node_subtype_id(L, n);
+ if (i == -1) {
+ if (lua_type(L, n) == LUA_TSTRING) {
+ lua_pushfstring(L, "Invalid whatsit node id: %s",
+ (char *) lua_tostring(L, n));
+ } else {
+ lua_pushfstring(L, "Invalid whatsit node id: %d",
+ (int) lua_tonumber(L, n));
+ }
+ return lua_error(L);
}
- return lua_error(L);
- }
- return i;
+ return i;
}
@@ -103,362 +131,454 @@ int get_valid_node_subtype_id (lua_State *L, int n) {
range. This test could be improved.
*/
-void
-lua_nodelib_push(lua_State *L) {
- halfword n;
- halfword *a;
- n = -1;
- if (lua_isnumber(L,-1)) {
- n = lua_tointeger(L,-1);
- }
- lua_pop(L,1);
- if ((n==null) || (n<0) || (n>var_mem_max)) {
- lua_pushnil(L);
- } else {
- a = lua_newuserdata(L, sizeof(halfword));
- *a = n;
- lua_rawgeti(L,LUA_REGISTRYINDEX,luaS_index(luatex_node));
- lua_gettable(L, LUA_REGISTRYINDEX);
- lua_setmetatable(L,-2);
- }
- return;
+void lua_nodelib_push(lua_State * L)
+{
+ halfword n;
+ halfword *a;
+ n = -1;
+ if (lua_isnumber(L, -1)) {
+ n = lua_tointeger(L, -1);
+ }
+ lua_pop(L, 1);
+ if ((n == null) || (n < 0) || (n > var_mem_max)) {
+ lua_pushnil(L);
+ } else {
+ a = lua_newuserdata(L, sizeof(halfword));
+ *a = n;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(luatex_node));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ lua_setmetatable(L, -2);
+ }
+ return;
}
-void
-lua_nodelib_push_fast(lua_State *L, halfword n) {
- halfword *a;
- a = lua_newuserdata(L, sizeof(halfword));
- *a = n;
- lua_rawgeti(L,LUA_REGISTRYINDEX,luaS_index(luatex_node));
- lua_gettable(L, LUA_REGISTRYINDEX);
- lua_setmetatable(L,-2);
- return;
+void lua_nodelib_push_fast(lua_State * L, halfword n)
+{
+ halfword *a;
+ a = lua_newuserdata(L, sizeof(halfword));
+ *a = n;
+ lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(luatex_node));
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ lua_setmetatable(L, -2);
+ return;
}
/* converts type strings to type ids */
-static int
-lua_nodelib_id (lua_State *L) {
- integer i = get_node_type_id(L,1);
- if (i>=0) {
- lua_pushnumber(L,i);
- } else {
- lua_pushnil(L);
- }
- return 1;
+static int lua_nodelib_id(lua_State * L)
+{
+ integer i = get_node_type_id(L, 1);
+ if (i >= 0) {
+ lua_pushnumber(L, i);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
}
-static int
-lua_nodelib_subtype (lua_State *L) {
- integer i = get_node_subtype_id(L,1);
- if (i>=0) {
- lua_pushnumber(L,i);
- } else {
- lua_pushnil(L);
- }
- return 1;
+static int lua_nodelib_subtype(lua_State * L)
+{
+ integer i = get_node_subtype_id(L, 1);
+ if (i >= 0) {
+ lua_pushnumber(L, i);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
}
/* converts id numbers to type names */
-static int
-lua_nodelib_type (lua_State *L) {
- integer i = get_node_type_id(L,1);
- if (i>=0) {
- lua_pushstring(L,node_data[i].name);
- } else {
- lua_pushnil(L);
- }
- return 1;
+static int lua_nodelib_type(lua_State * L)
+{
+ integer i = get_node_type_id(L, 1);
+ if (i >= 0) {
+ lua_pushstring(L, node_data[i].name);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
}
/* allocate a new node */
-static int
-lua_nodelib_new(lua_State *L) {
- int i,j;
- halfword n = null;
- i = get_valid_node_type_id(L,1);
-
- if (i==whatsit_node) {
- j = -1;
- if (lua_gettop(L)>1) { j = get_valid_node_subtype_id(L,2); }
- if (j<0) {
- lua_pushstring(L, "Creating a whatsit requires the subtype number as a second argument");
- lua_error(L);
- }
- } else {
- j = 0;
- if (lua_gettop(L)>1) { j = lua_tointeger(L,2); }
- }
- n = new_node(i,j);
- lua_nodelib_push_fast(L,n);
- return 1;
+static int lua_nodelib_new(lua_State * L)
+{
+ int i, j;
+ halfword n = null;
+ i = get_valid_node_type_id(L, 1);
+
+ if (i == whatsit_node) {
+ j = -1;
+ if (lua_gettop(L) > 1) {
+ j = get_valid_node_subtype_id(L, 2);
+ }
+ if (j < 0) {
+ lua_pushstring(L,
+ "Creating a whatsit requires the subtype number as a second argument");
+ lua_error(L);
+ }
+ } else {
+ j = 0;
+ if (lua_gettop(L) > 1) {
+ j = lua_tointeger(L, 2);
+ }
+ }
+ n = new_node(i, j);
+ lua_nodelib_push_fast(L, n);
+ return 1;
}
/* Free a node.
This function returns the 'next' node, because that may be helpful */
-static int
-lua_nodelib_free(lua_State *L) {
- halfword *n;
- halfword p;
- if (lua_gettop(L)<1) {
- lua_pushnil(L);
+static int lua_nodelib_free(lua_State * L)
+{
+ halfword *n;
+ halfword p;
+ if (lua_gettop(L) < 1) {
+ lua_pushnil(L);
+ return 1;
+ } else if (lua_isnil(L, 1)) {
+ return 1; /* the nil itself */
+ }
+ n = check_isnode(L, 1);
+ p = vlink(*n);
+ flush_node(*n);
+ lua_pushnumber(L, p);
+ lua_nodelib_push(L);
return 1;
- } else if(lua_isnil(L,1)) {
- return 1; /* the nil itself */
- }
- n = check_isnode(L,1);
- p = vlink(*n);
- flush_node(*n);
- lua_pushnumber(L,p);
- lua_nodelib_push(L);
- return 1;
}
/* Free a node list */
-static int
-lua_nodelib_flush_list(lua_State *L) {
- halfword *n_ptr;
- if ((lua_gettop(L)<1) || lua_isnil(L,1))
+static int lua_nodelib_flush_list(lua_State * L)
+{
+ halfword *n_ptr;
+ if ((lua_gettop(L) < 1) || lua_isnil(L, 1))
+ return 0;
+ n_ptr = check_isnode(L, 1);
+ flush_node_list(*n_ptr);
return 0;
- n_ptr = check_isnode(L,1);
- flush_node_list(*n_ptr);
- return 0;
}
/* find prev, and fix backlinks */
-#define set_t_to_prev(head,current) \
- t = head; \
- while (vlink(t)!=current && t != null) { \
- if (vlink(t)!=null) \
- alink(vlink(t)) = t; \
- t = vlink(t); \
+#define set_t_to_prev(head,current) \
+ t = head; \
+ while (vlink(t)!=current && t != null) { \
+ if (vlink(t)!=null) \
+ alink(vlink(t)) = t; \
+ t = vlink(t); \
}
/* remove a node from a list */
-static int
-lua_nodelib_remove (lua_State *L) {
- halfword head, current, t;
- if (lua_gettop(L)<2) {
- lua_pushstring(L,"Not enough arguments for node.remove()");
- lua_error(L);
- }
- head = *(check_isnode(L,1));
- if (lua_isnil(L,2)) {
- return 2; /* the arguments, as they are */
- }
- current = *(check_isnode(L,2));
-
- if (head == current) {
- if (alink(head)!=null && vlink(current)!=null) {
- alink(vlink(current)) = alink(head);
- }
- head = vlink(current);
- current = head;
- } else { /* head != current */
- t = alink(current);
- if (t==null || vlink(t)!=current) {
- set_t_to_prev(head,current);
- if (t==null) { /* error! */
- lua_pushstring(L,"Attempt to node.remove() a non-existing node");
- lua_error(L);
- }
- }
- /* t is now the previous node */
- vlink(t) = vlink(current);
- if (vlink(current)!=null) {
- alink(vlink(current)) = t;
- }
- current = vlink(current);
- }
- lua_pushnumber(L,head);
- lua_nodelib_push(L);
- lua_pushnumber(L,current);
- lua_nodelib_push(L);
- return 2;
+static int lua_nodelib_remove(lua_State * L)
+{
+ halfword head, current, t;
+ if (lua_gettop(L) < 2) {
+ lua_pushstring(L, "Not enough arguments for node.remove()");
+ lua_error(L);
+ }
+ head = *(check_isnode(L, 1));
+ if (lua_isnil(L, 2)) {
+ return 2; /* the arguments, as they are */
+ }
+ current = *(check_isnode(L, 2));
+
+ if (head == current) {
+ if (alink(head) != null && vlink(current) != null) {
+ alink(vlink(current)) = alink(head);
+ }
+ head = vlink(current);
+ current = head;
+ } else { /* head != current */
+ t = alink(current);
+ if (t == null || vlink(t) != current) {
+ set_t_to_prev(head, current);
+ if (t == null) { /* error! */
+ lua_pushstring(L,
+ "Attempt to node.remove() a non-existing node");
+ lua_error(L);
+ }
+ }
+ /* t is now the previous node */
+ vlink(t) = vlink(current);
+ if (vlink(current) != null) {
+ alink(vlink(current)) = t;
+ }
+ current = vlink(current);
+ }
+ lua_pushnumber(L, head);
+ lua_nodelib_push(L);
+ lua_pushnumber(L, current);
+ lua_nodelib_push(L);
+ return 2;
}
/* Insert a node in a list */
-static int
-lua_nodelib_insert_before (lua_State *L) {
- halfword head, current, n, t;
- if (lua_gettop(L)<3) {
- lua_pushstring(L,"Not enough arguments for node.insert_before()");
- lua_error(L);
- }
- if (lua_isnil(L,3)) {
- lua_pop(L,1);
- return 2;
- } else {
- n = *(check_isnode(L,3));
- }
- if (lua_isnil(L,1)) { /* no head */
- vlink(n) = null;
- alink(n) = null;
- lua_nodelib_push_fast(L,n);
- lua_pushvalue(L,-1);
- return 2;
- } else {
- head = *(check_isnode(L,1));
- }
- if (lua_isnil(L,2)) {
- current = tail_of_list(head);
- } else {
- current = *(check_isnode(L,2));
- }
- t = alink(current);
- if (t==null || vlink(t)!=current) {
- set_t_to_prev(head,current);
- if (t==null) { /* error! */
- lua_pushstring(L,"Attempt to node.insert_before() a non-existing node");
- lua_error(L);
+static int lua_nodelib_insert_before(lua_State * L)
+{
+ halfword head, current, n, t;
+ if (lua_gettop(L) < 3) {
+ lua_pushstring(L, "Not enough arguments for node.insert_before()");
+ lua_error(L);
}
- }
- couple_nodes(t,n);
- couple_nodes(n,current);
- if (head==current) {
- lua_nodelib_push_fast(L,n);
- } else {
- lua_nodelib_push_fast(L,head);
- }
- lua_nodelib_push_fast(L,n);
- return 2;
+ if (lua_isnil(L, 3)) {
+ lua_pop(L, 1);
+ return 2;
+ } else {
+ n = *(check_isnode(L, 3));
+ }
+ if (lua_isnil(L, 1)) { /* no head */
+ vlink(n) = null;
+ alink(n) = null;
+ lua_nodelib_push_fast(L, n);
+ lua_pushvalue(L, -1);
+ return 2;
+ } else {
+ head = *(check_isnode(L, 1));
+ }
+ if (lua_isnil(L, 2)) {
+ current = tail_of_list(head);
+ } else {
+ current = *(check_isnode(L, 2));
+ }
+ if (head != current) {
+ t = alink(current);
+ if (t == null || vlink(t) != current) {
+ set_t_to_prev(head, current);
+ if (t == null) { /* error! */
+ lua_pushstring(L,
+ "Attempt to node.insert_before() a non-existing node");
+ lua_error(L);
+ }
+ }
+ couple_nodes(t, n);
+ }
+ couple_nodes(n, current);
+ if (head == current) {
+ lua_nodelib_push_fast(L, n);
+ } else {
+ lua_nodelib_push_fast(L, head);
+ }
+ lua_nodelib_push_fast(L, n);
+ return 2;
}
-static int
-lua_nodelib_insert_after (lua_State *L) {
- halfword head, current, n;
- if (lua_gettop(L)<3) {
- lua_pushstring(L,"Not enough arguments for node.insert_after()");
- lua_error(L);
- }
- if (lua_isnil(L,3)) {
- lua_pop(L,1);
- return 2;
- } else {
- n = *(check_isnode(L,3));
- }
- if (lua_isnil(L,1)) { /* no head */
- vlink(n) = null;
- alink(n) = null;
- lua_nodelib_push_fast(L,n);
- lua_pushvalue(L,-1);
- return 2;
- } else {
- head = *(check_isnode(L,1));
- }
- if (lua_isnil(L,2)) {
- current = head;
- while (vlink(current)!=null)
- current = vlink(current);
- } else {
- current = *(check_isnode(L,2));
- }
- try_couple_nodes(n,vlink(current));
- couple_nodes(current, n);
+static int lua_nodelib_insert_after(lua_State * L)
+{
+ halfword head, current, n;
+ if (lua_gettop(L) < 3) {
+ lua_pushstring(L, "Not enough arguments for node.insert_after()");
+ lua_error(L);
+ }
+ if (lua_isnil(L, 3)) {
+ lua_pop(L, 1);
+ return 2;
+ } else {
+ n = *(check_isnode(L, 3));
+ }
+ if (lua_isnil(L, 1)) { /* no head */
+ vlink(n) = null;
+ alink(n) = null;
+ lua_nodelib_push_fast(L, n);
+ lua_pushvalue(L, -1);
+ return 2;
+ } else {
+ head = *(check_isnode(L, 1));
+ }
+ if (lua_isnil(L, 2)) {
+ current = head;
+ while (vlink(current) != null)
+ current = vlink(current);
+ } else {
+ current = *(check_isnode(L, 2));
+ }
+ try_couple_nodes(n, vlink(current));
+ couple_nodes(current, n);
- lua_pop(L,2);
- lua_nodelib_push_fast(L,n);
- return 2;
+ lua_pop(L, 2);
+ lua_nodelib_push_fast(L, n);
+ return 2;
}
/* Copy a node list */
-static int
-lua_nodelib_copy_list (lua_State *L) {
- halfword *n;
- halfword m;
- if (lua_isnil(L,1))
- return 1; /* the nil itself */
- n = check_isnode(L,1);
- m = copy_node_list(*n);
- lua_nodelib_push_fast(L,m);
- return 1;
+static int lua_nodelib_copy_list(lua_State * L)
+{
+ halfword *n;
+ halfword m;
+ if (lua_isnil(L, 1))
+ return 1; /* the nil itself */
+ n = check_isnode(L, 1);
+ m = copy_node_list(*n);
+ lua_nodelib_push_fast(L, m);
+ return 1;
}
/* (Deep) copy a node */
-static int
-lua_nodelib_copy(lua_State *L) {
- halfword *n;
- halfword m;
- if (lua_isnil(L,1))
- return 1; /* the nil itself */
- n = check_isnode(L,1);
- m = copy_node(*n);
- lua_nodelib_push_fast(L,m);
- return 1;
+static int lua_nodelib_copy(lua_State * L)
+{
+ halfword *n;
+ halfword m;
+ if (lua_isnil(L, 1))
+ return 1; /* the nil itself */
+ n = check_isnode(L, 1);
+ m = copy_node(*n);
+ lua_nodelib_push_fast(L, m);
+ return 1;
}
/* output (write) a node to tex's processor */
-static int
-lua_nodelib_append(lua_State *L) {
- halfword *n;
- halfword m;
- int i, j;
- j = lua_gettop(L);
- for (i=1;i<=j;i++) {
- n = check_isnode(L,i);
- m = copy_node_list(*n);
- new_tail_append(m);
- while (vlink(m)!= null) {
- m = vlink(m);
- new_tail_append(m);
- }
- }
- return 0;
+static int lua_nodelib_append(lua_State * L)
+{
+ halfword *n;
+ halfword m;
+ int i, j;
+ j = lua_gettop(L);
+ for (i = 1; i <= j; i++) {
+ n = check_isnode(L, i);
+ m = copy_node_list(*n);
+ new_tail_append(m);
+ while (vlink(m) != null) {
+ m = vlink(m);
+ new_tail_append(m);
+ }
+ }
+ return 0;
}
-static int
-lua_nodelib_last_node(lua_State *L) {
- halfword m;
- m = pop_tail();
- lua_pushnumber(L,m);
- lua_nodelib_push(L);
- return 1;
+static int lua_nodelib_last_node(lua_State * L)
+{
+ halfword m;
+ m = pop_tail();
+ lua_pushnumber(L, m);
+ lua_nodelib_push(L);
+ return 1;
}
/* build a hbox */
-static int
-lua_nodelib_hpack(lua_State *L) {
- halfword n, p;
- char *s;
- integer w = 0;
- int m = 1;
- n = *(check_isnode(L,1));
- if (lua_gettop(L)>1) {
- w = lua_tointeger(L,2);
- if (lua_gettop(L)>2 && lua_type(L,3)==LUA_TSTRING) {
- s = (char *)lua_tostring(L,3);
- if (strcmp(s,"additional")==0) {
- m = 1;
- } else {
- m = lua_tonumber(L,3);
- }
+static int lua_nodelib_hpack(lua_State * L)
+{
+ halfword n, p;
+ char *s;
+ integer w = 0;
+ int m = 1;
+ n = *(check_isnode(L, 1));
+ if (lua_gettop(L) > 1) {
+ w = lua_tointeger(L, 2);
+ if (lua_gettop(L) > 2) {
+ if (lua_type(L, 3) == LUA_TSTRING) {
+ s = (char *) lua_tostring(L, 3);
+ if (strcmp(s, "additional") == 0)
+ m = 1;
+ else if (strcmp(s, "exactly") == 0)
+ m = 0;
+ else {
+ lua_pushstring(L,
+ "3rd argument should be either additional or exactly");
+ lua_error(L);
+ }
+ }
+
+ else if (lua_type(L, 3) == LUA_TNUMBER) {
+ m = lua_tonumber(L, 3);
+ } else {
+ lua_pushstring(L, "incorrect 3rd argument");
+ }
+ }
}
- }
- p = hpack(n,w,m);
- lua_nodelib_push_fast(L,p);
- return 1;
+ p = hpack(n, w, m);
+ lua_nodelib_push_fast(L, p);
+ return 1;
+}
+
+
+/* build a vbox */
+static int lua_nodelib_vpack(lua_State * L)
+{
+ halfword n, p;
+ char *s;
+ integer w = 0;
+ int m = 1;
+ n = *(check_isnode(L, 1));
+ if (lua_gettop(L) > 1) {
+ w = lua_tointeger(L, 2);
+ if (lua_gettop(L) > 2) {
+ if (lua_type(L, 3) == LUA_TSTRING) {
+ s = (char *) lua_tostring(L, 3);
+ if (strcmp(s, "additional") == 0)
+ m = 1;
+ else if (strcmp(s, "exactly") == 0)
+ m = 0;
+ else {
+ lua_pushstring(L,
+ "3rd argument should be either additional or exactly");
+ lua_error(L);
+ }
+ }
+
+ else if (lua_type(L, 3) == LUA_TNUMBER) {
+ m = lua_tonumber(L, 3);
+ } else {
+ lua_pushstring(L, "incorrect 3rd argument");
+ }
+ }
+ }
+ p = vpackage(n, w, m, max_dimen);
+ lua_nodelib_push_fast(L, p);
+ return 1;
+}
+
+
+/* create a hlist from a formula */
+
+static int lua_nodelib_mlist_to_hlist(lua_State * L)
+{
+ halfword n;
+ int w;
+ boolean m;
+ n = *(check_isnode(L, 1));
+ w = luaL_checkoption(L, 2, "text", math_style_names);
+ luaL_checkany(L, 3);
+ m = lua_toboolean(L, 3);
+ cur_mlist = n;
+ cur_style = w;
+ mlist_penalties = m;
+ mlist_to_hlist();
+ lua_nodelib_push_fast(L, vlink(temp_head));
+ return 1;
}
+static int lua_nodelib_mfont(lua_State * L)
+{
+ int f, s;
+ f = luaL_checkinteger(L, 1);
+ if (lua_gettop(L) == 2)
+ s = lua_tointeger(L, 2); /* this should be a multiple of 256 ! */
+ else
+ s = 0;
+ lua_pushnumber(L, fam_fnt(f, s));
+ return 1;
+}
+
+
+
/* This function is similar to |get_node_type_id|, for field
identifiers. It has to do some more work, because not all
identifiers are valid for all types of nodes.
@@ -486,338 +606,363 @@ make_luaS_index(xoffset);
make_luaS_index(yoffset);
-void initialize_luaS_indexes(lua_State *L) {
- init_luaS_index(id);
- init_luaS_index(next);
- init_luaS_index(char);
- init_luaS_index(font);
- init_luaS_index(attr);
- init_luaS_index(prev);
- init_luaS_index(lang);
- init_luaS_index(subtype);
- init_luaS_index(left);
- init_luaS_index(right);
- init_luaS_index(uchyph);
- init_luaS_index(components);
- init_luaS_index(xoffset);
- init_luaS_index(yoffset);
+void initialize_luaS_indexes(lua_State * L)
+{
+ init_luaS_index(id);
+ init_luaS_index(next);
+ init_luaS_index(char);
+ init_luaS_index(font);
+ init_luaS_index(attr);
+ init_luaS_index(prev);
+ init_luaS_index(lang);
+ init_luaS_index(subtype);
+ init_luaS_index(left);
+ init_luaS_index(right);
+ init_luaS_index(uchyph);
+ init_luaS_index(components);
+ init_luaS_index(xoffset);
+ init_luaS_index(yoffset);
}
-static int
-get_node_field_id (lua_State *L, int n, int node ) {
- register int t = type(node);
- register char *s = (char *)lua_tostring(L,n);
- if (luaS_ptr_eq(s,next)) { return 0; }
- else if (luaS_ptr_eq(s,id)) { return 1; }
- else if (luaS_ptr_eq(s,attr) &&
- nodetype_has_attributes(t)) { return 3 ; }
- else if (t==glyph_node) {
- if (luaS_ptr_eq(s,subtype)) { return 2; }
- else if (luaS_ptr_eq(s,font)) { return 5; }
- else if (luaS_ptr_eq(s,char)) { return 4; }
- else if (luaS_ptr_eq(s,prev)) { return -1; }
- else if (luaS_ptr_eq(s,lang)) { return 6; }
- else if (luaS_ptr_eq(s,left)) { return 7; }
- else if (luaS_ptr_eq(s,right)) { return 8; }
- else if (luaS_ptr_eq(s,uchyph)) { return 9; }
- else if (luaS_ptr_eq(s,components)) { return 10; }
- else if (luaS_ptr_eq(s,xoffset)) { return 11; }
- else if (luaS_ptr_eq(s,yoffset)) { return 12; }
- }
- else if (luaS_ptr_eq(s,prev)) { return -1; }
- else if (luaS_ptr_eq(s,subtype)) { return 2; }
- else {
- int j;
- char **fields = node_data[t].fields;
- if (t==whatsit_node)
- fields = whatsit_node_data[subtype(node)].fields;
- for (j=0;fields[j]!=NULL;j++) {
- if (strcmp(s,fields[j])==0) {
- return j+3;
- }
- }
- }
- return -2;
+static int get_node_field_id(lua_State * L, int n, int node)
+{
+ register int t = type(node);
+ register char *s = (char *) lua_tostring(L, n);
+ if (luaS_ptr_eq(s, next)) {
+ return 0;
+ } else if (luaS_ptr_eq(s, id)) {
+ return 1;
+ } else if (luaS_ptr_eq(s, attr) && nodetype_has_attributes(t)) {
+ return 3;
+ } else if (t == glyph_node) {
+ if (luaS_ptr_eq(s, subtype)) {
+ return 2;
+ } else if (luaS_ptr_eq(s, font)) {
+ return 5;
+ } else if (luaS_ptr_eq(s, char)) {
+ return 4;
+ } else if (luaS_ptr_eq(s, prev)) {
+ return -1;
+ } else if (luaS_ptr_eq(s, lang)) {
+ return 6;
+ } else if (luaS_ptr_eq(s, left)) {
+ return 7;
+ } else if (luaS_ptr_eq(s, right)) {
+ return 8;
+ } else if (luaS_ptr_eq(s, uchyph)) {
+ return 9;
+ } else if (luaS_ptr_eq(s, components)) {
+ return 10;
+ } else if (luaS_ptr_eq(s, xoffset)) {
+ return 11;
+ } else if (luaS_ptr_eq(s, yoffset)) {
+ return 12;
+ }
+ } else if (luaS_ptr_eq(s, prev)) {
+ return -1;
+ } else if (luaS_ptr_eq(s, subtype)) {
+ return 2;
+ } else {
+ int j;
+ char **fields = node_data[t].fields;
+ if (t == whatsit_node)
+ fields = whatsit_node_data[subtype(node)].fields;
+ for (j = 0; fields[j] != NULL; j++) {
+ if (strcmp(s, fields[j]) == 0) {
+ return j + 3;
+ }
+ }
+ }
+ return -2;
}
-static int
-get_valid_node_field_id (lua_State *L, int n, int node ) {
- int i = get_node_field_id(L,n,node);
- if (i==-2) {
- char *s = (char *)lua_tostring(L,n);
- lua_pushfstring(L, "Invalid field id %s for node type %s (%d)" , s, node_data[type(node)].name,subtype(node));
- lua_error(L);
- }
- return i;
+static int get_valid_node_field_id(lua_State * L, int n, int node)
+{
+ int i = get_node_field_id(L, n, node);
+ if (i == -2) {
+ char *s = (char *) lua_tostring(L, n);
+ lua_pushfstring(L, "Invalid field id %s for node type %s (%d)", s,
+ node_data[type(node)].name, subtype(node));
+ lua_error(L);
+ }
+ return i;
}
-static int
-lua_nodelib_has_field (lua_State *L) {
- int i= -2;
- if (!lua_isnil(L,1)) {
- i = get_node_field_id(L,2,*(check_isnode(L,1)));
- }
- lua_pushboolean(L,(i!=-2));
- return 1;
+static int lua_nodelib_has_field(lua_State * L)
+{
+ int i = -2;
+ if (!lua_isnil(L, 1)) {
+ i = get_node_field_id(L, 2, *(check_isnode(L, 1)));
+ }
+ lua_pushboolean(L, (i != -2));
+ return 1;
}
/* fetch the list of valid node types */
-static int
-do_lua_nodelib_types (lua_State *L, node_info *data) {
- int i;
- lua_newtable(L);
- for (i=0;data[i].id!=-1;i++) {
- lua_pushstring(L,data[i].name);
- lua_rawseti(L,-2,data[i].id);
- }
- return 1;
+static int do_lua_nodelib_types(lua_State * L, node_info * data)
+{
+ int i;
+ lua_newtable(L);
+ for (i = 0; data[i].id != -1; i++) {
+ lua_pushstring(L, data[i].name);
+ lua_rawseti(L, -2, data[i].id);
+ }
+ return 1;
}
-static int
-lua_nodelib_types (lua_State *L) {
- return do_lua_nodelib_types (L, node_data);
+static int lua_nodelib_types(lua_State * L)
+{
+ return do_lua_nodelib_types(L, node_data);
}
-static int
-lua_nodelib_whatsits (lua_State *L) {
- return do_lua_nodelib_types (L, whatsit_node_data);
+static int lua_nodelib_whatsits(lua_State * L)
+{
+ return do_lua_nodelib_types(L, whatsit_node_data);
}
/* fetch the list of valid fields */
-static int
-lua_nodelib_fields (lua_State *L) {
- int i = -1;
- char ** fields;
- int t = get_valid_node_type_id(L,1);
- if (t==whatsit_node ) {
- t = get_valid_node_subtype_id(L,2);
- fields = whatsit_node_data[t].fields;
- } else {
- fields = node_data[t].fields;
- }
- lua_checkstack(L,2);
- lua_newtable(L);
- lua_pushstring(L,"next");
- lua_rawseti(L,-2,0);
- lua_pushstring(L,"id");
- lua_rawseti(L,-2,1);
- lua_pushstring(L,"subtype");
- lua_rawseti(L,-2,2);
- if (fields!=NULL) {
- lua_pushstring(L,"prev");
- lua_rawseti(L,-2,-1);
- for (i=0;fields[i]!=NULL;i++) {
- lua_pushstring(L,fields[i]);
- lua_rawseti(L,-2,(i+3));
+static int lua_nodelib_fields(lua_State * L)
+{
+ int i = -1;
+ char **fields;
+ int t = get_valid_node_type_id(L, 1);
+ if (t == whatsit_node) {
+ t = get_valid_node_subtype_id(L, 2);
+ fields = whatsit_node_data[t].fields;
+ } else {
+ fields = node_data[t].fields;
}
- }
- return 1;
+ lua_checkstack(L, 2);
+ lua_newtable(L);
+ lua_pushstring(L, "next");
+ lua_rawseti(L, -2, 0);
+ lua_pushstring(L, "id");
+ lua_rawseti(L, -2, 1);
+ lua_pushstring(L, "subtype");
+ lua_rawseti(L, -2, 2);
+ if (fields != NULL) {
+ lua_pushstring(L, "prev");
+ lua_rawseti(L, -2, -1);
+ for (i = 0; fields[i] != NULL; i++) {
+ lua_pushstring(L, fields[i]);
+ lua_rawseti(L, -2, (i + 3));
+ }
+ }
+ return 1;
}
/* find the end of a list */
-static int
-lua_nodelib_tail (lua_State *L) {
- halfword *n;
- halfword t;
- if (lua_isnil(L,1))
- return 1; /* the nil itself */
- n = check_isnode(L,1);
- t=*n;
- if (t==null)
- return 1; /* the old userdata */
- alink(t) = null;
- while (vlink(t)!=null) {
- alink(vlink(t)) = t;
- t = vlink(t);
- }
- lua_nodelib_push_fast(L,t);
- return 1;
+static int lua_nodelib_tail(lua_State * L)
+{
+ halfword *n;
+ halfword t;
+ if (lua_isnil(L, 1))
+ return 1; /* the nil itself */
+ n = check_isnode(L, 1);
+ t = *n;
+ if (t == null)
+ return 1; /* the old userdata */
+ alink(t) = null;
+ while (vlink(t) != null) {
+ alink(vlink(t)) = t;
+ t = vlink(t);
+ }
+ lua_nodelib_push_fast(L, t);
+ return 1;
}
/* a few utility functions for attribute stuff */
-static int
-lua_nodelib_has_attribute (lua_State *L) {
- halfword *n;
- int i, val ;
- if (lua_isnil(L,1))
- return 1; /* the nil itself */
- n = check_isnode(L,1);
- i = lua_tointeger(L,2);
- val = luaL_optinteger(L,3,-1);
- if((val = has_attribute(*n,i,val))>=0) {
- lua_pushnumber(L,val);
- } else {
+static int lua_nodelib_has_attribute(lua_State * L)
+{
+ halfword *n;
+ int i, val;
+ n = check_isnode(L, 1);
+ if (n != NULL) {
+ i = lua_tointeger(L, 2);
+ val = luaL_optinteger(L, 3, -1);
+ if ((val = has_attribute(*n, i, val)) >= 0) {
+ lua_pushnumber(L, val);
+ return 1;
+ }
+ }
lua_pushnil(L);
- }
- return 1;
+ return 1;
}
-static int
-lua_nodelib_set_attribute (lua_State *L) {
- halfword *n;
- int i, val;
- if (lua_gettop(L)==3) {
- i = lua_tointeger(L,2);
- val = lua_tointeger(L,3);
- n = check_isnode(L,1);
- if (val<0) {
- (void)unset_attribute(*n,i,val);
+static int lua_nodelib_set_attribute(lua_State * L)
+{
+ halfword *n;
+ int i, val;
+ if (lua_gettop(L) == 3) {
+ i = lua_tointeger(L, 2);
+ val = lua_tointeger(L, 3);
+ n = check_isnode(L, 1);
+ if (val < 0) {
+ (void) unset_attribute(*n, i, val);
+ } else {
+ set_attribute(*n, i, val);
+ }
} else {
- set_attribute(*n,i,val);
+ lua_pushstring(L, "incorrect number of arguments");
+ lua_error(L);
}
- } else {
- lua_pushstring(L,"incorrect number of arguments");
- lua_error(L);
- }
- return 0;
+ return 0;
}
-static int
-lua_nodelib_unset_attribute (lua_State *L) {
- halfword *n;
- int i, val, ret;
- if (lua_gettop(L)<=3) {
- i = luaL_checknumber(L,2);
- val = luaL_optnumber(L,3,-1);
- n = check_isnode(L,1);
- ret = unset_attribute(*n,i,val);
- if(ret>=0) {
- lua_pushnumber(L,ret);
+static int lua_nodelib_unset_attribute(lua_State * L)
+{
+ halfword *n;
+ int i, val, ret;
+ if (lua_gettop(L) <= 3) {
+ i = luaL_checknumber(L, 2);
+ val = luaL_optnumber(L, 3, -1);
+ n = check_isnode(L, 1);
+ ret = unset_attribute(*n, i, val);
+ if (ret >= 0) {
+ lua_pushnumber(L, ret);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
} else {
- lua_pushnil(L);
+ lua_pushstring(L, "incorrect number of arguments");
+ return lua_error(L);
}
- return 1;
- } else {
- lua_pushstring(L,"incorrect number of arguments");
- return lua_error(L);
- }
}
/* iteration */
-static int nodelib_aux_nil (lua_State *L) {
- lua_pushnil(L);
- return 1;
+static int nodelib_aux_nil(lua_State * L)
+{
+ lua_pushnil(L);
+ return 1;
}
-static int
-nodelib_aux_next_filtered (lua_State *L) {
- register halfword t; /* traverser */
- register int i = lua_tointeger(L,lua_upvalueindex(1));
- if (lua_isnil(L,2)) { /* first call */
- t = *check_isnode(L,1);
- } else {
- t = *check_isnode(L,2);
- t = vlink(t);
- }
- while (t!=null && type(t)!=i) { t = vlink(t); }
- if (t==null) {
- lua_pushnil(L);
- } else {
- lua_nodelib_push_fast(L,t);
- }
- return 1;
+static int nodelib_aux_next_filtered(lua_State * L)
+{
+ register halfword t; /* traverser */
+ register int i = lua_tointeger(L, lua_upvalueindex(1));
+ if (lua_isnil(L, 2)) { /* first call */
+ t = *check_isnode(L, 1);
+ } else {
+ t = *check_isnode(L, 2);
+ t = vlink(t);
+ }
+ while (t != null && type(t) != i) {
+ t = vlink(t);
+ }
+ if (t == null) {
+ lua_pushnil(L);
+ } else {
+ lua_nodelib_push_fast(L, t);
+ }
+ return 1;
}
-static int
-lua_nodelib_traverse_filtered (lua_State *L) {
- halfword n;
- if (lua_isnil(L,2)) {
- lua_pushcclosure(L, nodelib_aux_nil, 0);
- return 1;
- }
- n = *(check_isnode(L,2));
- lua_pop(L,1); /* the node, integer remains */
- lua_pushcclosure(L, nodelib_aux_next_filtered, 1);
- lua_nodelib_push_fast(L,n);
- lua_pushnil(L);
- return 3;
-}
-
-static int
-nodelib_aux_next (lua_State *L) {
- register halfword t; /* traverser */
- if (lua_isnil(L,2)) { /* first call */
- t = *check_isnode(L,1);
- } else {
- t = *check_isnode(L,2);
- t = vlink(t);
- }
- if (t==null) {
+static int lua_nodelib_traverse_filtered(lua_State * L)
+{
+ halfword n;
+ if (lua_isnil(L, 2)) {
+ lua_pushcclosure(L, nodelib_aux_nil, 0);
+ return 1;
+ }
+ n = *(check_isnode(L, 2));
+ lua_pop(L, 1); /* the node, integer remains */
+ lua_pushcclosure(L, nodelib_aux_next_filtered, 1);
+ lua_nodelib_push_fast(L, n);
lua_pushnil(L);
- } else {
- lua_nodelib_push_fast(L,t);
- }
- return 1;
+ return 3;
}
-static int
-lua_nodelib_traverse (lua_State *L) {
- halfword n;
- if (lua_isnil(L,1)) {
- lua_pushcclosure(L, nodelib_aux_nil, 0);
+static int nodelib_aux_next(lua_State * L)
+{
+ register halfword t; /* traverser */
+ if (lua_isnil(L, 2)) { /* first call */
+ t = *check_isnode(L, 1);
+ } else {
+ t = *check_isnode(L, 2);
+ t = vlink(t);
+ }
+ if (t == null) {
+ lua_pushnil(L);
+ } else {
+ lua_nodelib_push_fast(L, t);
+ }
return 1;
- }
- n = *(check_isnode(L,1));
- lua_pushcclosure(L, nodelib_aux_next, 0);
- lua_nodelib_push_fast(L,n);
- lua_pushnil(L);
- return 3;
-;
+}
+
+static int lua_nodelib_traverse(lua_State * L)
+{
+ halfword n;
+ if (lua_isnil(L, 1)) {
+ lua_pushcclosure(L, nodelib_aux_nil, 0);
+ return 1;
+ }
+ n = *(check_isnode(L, 1));
+ lua_pushcclosure(L, nodelib_aux_next, 0);
+ lua_nodelib_push_fast(L, n);
+ lua_pushnil(L);
+ return 3;
+ ;
}
static int
-do_lua_nodelib_count (lua_State *L, halfword match, int i, halfword first) {
- int count = 0;
- int t = first;
- while (t!=match) {
- if (i<0 || type(t)==i) { count++; }
- t = vlink(t);
- }
- lua_pushnumber(L,count);
- return 1;
+do_lua_nodelib_count(lua_State * L, halfword match, int i, halfword first)
+{
+ int count = 0;
+ int t = first;
+ while (t != match) {
+ if (i < 0 || type(t) == i) {
+ count++;
+ }
+ t = vlink(t);
+ }
+ lua_pushnumber(L, count);
+ return 1;
}
-static int lua_nodelib_length (lua_State *L) {
- halfword n;
- halfword m = null;
- if (lua_isnil(L,1)) {
- lua_pushnumber(L,0);
- return 1;
- }
- n = *(check_isnode(L,1));
- if (lua_gettop(L)==2) {
- m = *(check_isnode(L,2));
- }
- return do_lua_nodelib_count(L,m,-1,n);
+static int lua_nodelib_length(lua_State * L)
+{
+ halfword n;
+ halfword m = null;
+ if (lua_isnil(L, 1)) {
+ lua_pushnumber(L, 0);
+ return 1;
+ }
+ n = *(check_isnode(L, 1));
+ if (lua_gettop(L) == 2) {
+ m = *(check_isnode(L, 2));
+ }
+ return do_lua_nodelib_count(L, m, -1, n);
}
-static int lua_nodelib_count (lua_State *L) {
- halfword n;
- halfword m = null;
- int i = -1;
- i = lua_tointeger(L,1);
- if (lua_isnil(L,2)) {
- lua_pushnumber(L,0);
- return 1;
- }
- n = *(check_isnode(L,2));
- if (lua_gettop(L)==3)
- m = *(check_isnode(L,3));
- return do_lua_nodelib_count(L,m,i,n);
+static int lua_nodelib_count(lua_State * L)
+{
+ halfword n;
+ halfword m = null;
+ int i = -1;
+ i = lua_tointeger(L, 1);
+ if (lua_isnil(L, 2)) {
+ lua_pushnumber(L, 0);
+ return 1;
+ }
+ n = *(check_isnode(L, 2));
+ if (lua_gettop(L) == 3)
+ m = *(check_isnode(L, 3));
+ return do_lua_nodelib_count(L, m, i, n);
}
/* fetching a field from a node */
@@ -828,1140 +973,2332 @@ static int lua_nodelib_count (lua_State *L) {
#define nodelib_pushaction(L,n) { lua_pushnumber(L,n); lua_nodelib_push(L); }
#define nodelib_pushstring(L,n) { lua_pushstring(L,makecstring(n)); }
-static void
-lua_nodelib_getfield_whatsit (lua_State *L, int n, int field) {
- if (field==2) {
- lua_pushnumber(L,subtype(n));
- } else {
- switch (subtype(n)) {
- case open_node:
- switch (field) {
- case 4: lua_pushnumber(L,write_stream(n)); break;
- case 5: nodelib_pushstring(L,open_name(n)); break;
- case 6: nodelib_pushstring(L,open_area(n)); break;
- case 7: nodelib_pushstring(L,open_ext(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case write_node:
- switch (field) {
- case 4: lua_pushnumber(L,write_stream(n)); break;
- case 5: tokenlist_to_lua(L,write_tokens(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case close_node:
- switch (field) {
- case 4: lua_pushnumber(L,write_stream(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case special_node:
- switch (field) {
- case 4: tokenlist_to_luastring(L,write_tokens(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case local_par_node:
- switch (field) {
- case 4: lua_pushnumber(L,local_pen_inter(n)); break;
- case 5: lua_pushnumber(L,local_pen_broken(n)); break;
- case 6: lua_pushnumber(L,local_par_dir(n)); break;
- case 7: nodelib_pushlist(L,local_box_left(n)); break;
- case 8: lua_pushnumber(L,local_box_left_width(n)); break;
- case 9: nodelib_pushlist(L,local_box_right(n)); break;
- case 10: lua_pushnumber(L,local_box_right_width(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case dir_node:
- switch (field) {
- case 4: lua_pushnumber(L,dir_dir(n)); break;
- case 5: lua_pushnumber(L,dir_level(n)); break;
- case 6: lua_pushnumber(L,dir_dvi_ptr(n)); break;
- case 7: lua_pushnumber(L,dir_dvi_h(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_literal_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_literal_mode(n)); break;
- case 5: tokenlist_to_luastring(L,pdf_literal_data(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_refobj_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_obj_objnum(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_refxform_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_width(n)); break;
- case 5: lua_pushnumber(L,pdf_height(n)); break;
- case 6: lua_pushnumber(L,pdf_depth(n)); break;
- case 7: lua_pushnumber(L,pdf_xform_objnum(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_refximage_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_width(n)); break;
- case 5: lua_pushnumber(L,pdf_height(n)); break;
- case 6: lua_pushnumber(L,pdf_depth(n)); break;
- case 7: lua_pushnumber(L,pdf_ximage_objnum(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_annot_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_width(n)); break;
- case 5: lua_pushnumber(L,pdf_height(n)); break;
- case 6: lua_pushnumber(L,pdf_depth(n)); break;
- case 7: lua_pushnumber(L,pdf_annot_objnum(n)); break;
- case 8: tokenlist_to_luastring(L,pdf_annot_data(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_start_link_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_width(n)); break;
- case 5: lua_pushnumber(L,pdf_height(n)); break;
- case 6: lua_pushnumber(L,pdf_depth(n)); break;
- case 7: lua_pushnumber(L,pdf_link_objnum(n)); break;
- case 8: tokenlist_to_luastring(L,pdf_link_attr(n)); break;
- case 9: nodelib_pushaction(L,pdf_link_action(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_dest_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_width(n)); break;
- case 5: lua_pushnumber(L,pdf_height(n)); break;
- case 6: lua_pushnumber(L,pdf_depth(n)); break;
- case 7: lua_pushnumber(L,pdf_dest_named_id(n)); break;
- case 8: if (pdf_dest_named_id(n) == 1)
- tokenlist_to_luastring(L,pdf_dest_id(n));
- else
- lua_pushnumber(L,pdf_dest_id(n)); break;
- case 9: lua_pushnumber(L,pdf_dest_type(n)); break;
- case 10: lua_pushnumber(L,pdf_dest_xyz_zoom(n)); break;
- case 11: lua_pushnumber(L,pdf_dest_objnum(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_thread_node:
- case pdf_start_thread_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_width(n)); break;
- case 5: lua_pushnumber(L,pdf_height(n)); break;
- case 6: lua_pushnumber(L,pdf_depth(n)); break;
- case 7: lua_pushnumber(L,pdf_thread_named_id(n)); break;
- case 8: if (pdf_thread_named_id(n) == 1)
- tokenlist_to_luastring(L,pdf_thread_id(n));
- else
- lua_pushnumber(L,pdf_thread_id(n)); break;
- case 9: tokenlist_to_luastring(L,pdf_thread_attr(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case late_lua_node:
- switch (field) {
- case 4: lua_pushnumber(L,late_lua_reg(n)); break;
- case 5: tokenlist_to_luastring(L,late_lua_data(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case close_lua_node:
- switch (field) {
- case 4: lua_pushnumber(L,late_lua_reg(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_colorstack_node:
- switch (field) {
- case 4: lua_pushnumber(L,pdf_colorstack_stack(n)); break;
- case 5: lua_pushnumber(L,pdf_colorstack_cmd(n)); break;
- case 6: tokenlist_to_luastring(L,pdf_colorstack_data(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case pdf_setmatrix_node:
- switch (field) {
- case 4: tokenlist_to_luastring(L,pdf_setmatrix_data(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case user_defined_node:
- switch (field) {
- case 4: lua_pushnumber(L,user_node_id(n)); break;
- case 5: lua_pushnumber(L,user_node_type(n)); break;
- case 6:
- switch (user_node_type(n)) {
- case 'a': nodelib_pushlist(L,user_node_value(n)); break;
- case 'd': lua_pushnumber(L,user_node_value(n)); break;
- case 'n': nodelib_pushlist(L,user_node_value(n)); break;
- case 's': nodelib_pushstring(L,user_node_value(n)); break;
- case 't': tokenlist_to_lua(L,user_node_value(n)); break;
- default: lua_pushnumber(L,user_node_value(n)); break;
- } break;
- default: lua_pushnil(L);
- }
- break;
- default:
- lua_pushnil(L);
- break;
- }
- }
+static void nodelib_pushdir(lua_State * L, int n, boolean dirnode)
+{
+ int f = 0;
+ char dirstring[5] = { 0 };
+ if (dirnode) {
+ dirstring[f++] = (n < 0 ? '-' : '+');
+ }
+ if (n < 0)
+ n += 64;
+ dirstring[f++] = dir_names[(int) dir_primary[n]];
+ dirstring[f++] = dir_names[(int) dir_secondary[n]];
+ dirstring[f++] = dir_names[(int) dir_tertiary[n]];
+ lua_pushstring(L, dirstring);
+}
+
+static void lua_nodelib_getfield_whatsit(lua_State * L, int n, int field)
+{
+ if (field == 2) {
+ lua_pushnumber(L, subtype(n));
+ } else {
+ switch (subtype(n)) {
+ case open_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, write_stream(n));
+ break;
+ case 5:
+ nodelib_pushstring(L, open_name(n));
+ break;
+ case 6:
+ nodelib_pushstring(L, open_area(n));
+ break;
+ case 7:
+ nodelib_pushstring(L, open_ext(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case write_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, write_stream(n));
+ break;
+ case 5:
+ tokenlist_to_lua(L, write_tokens(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case close_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, write_stream(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case special_node:
+ switch (field) {
+ case 4:
+ tokenlist_to_luastring(L, write_tokens(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case local_par_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, local_pen_inter(n));
+ break;
+ case 5:
+ lua_pushnumber(L, local_pen_broken(n));
+ break;
+ case 6:
+ nodelib_pushdir(L, local_par_dir(n), false);
+ break;
+ case 7:
+ nodelib_pushlist(L, local_box_left(n));
+ break;
+ case 8:
+ lua_pushnumber(L, local_box_left_width(n));
+ break;
+ case 9:
+ nodelib_pushlist(L, local_box_right(n));
+ break;
+ case 10:
+ lua_pushnumber(L, local_box_right_width(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case dir_node:
+ switch (field) {
+ case 4:
+ nodelib_pushdir(L, dir_dir(n), true);
+ break;
+ case 5:
+ lua_pushnumber(L, dir_level(n));
+ break;
+ case 6:
+ lua_pushnumber(L, dir_dvi_ptr(n));
+ break;
+ case 7:
+ lua_pushnumber(L, dir_dvi_h(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_literal_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_literal_mode(n));
+ break;
+ case 5:
+ tokenlist_to_luastring(L, pdf_literal_data(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_refobj_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_obj_objnum(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_refxform_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, pdf_height(n));
+ break;
+ case 6:
+ lua_pushnumber(L, pdf_depth(n));
+ break;
+ case 7:
+ lua_pushnumber(L, pdf_xform_objnum(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_refximage_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, pdf_height(n));
+ break;
+ case 6:
+ lua_pushnumber(L, pdf_depth(n));
+ break;
+ case 7:
+ lua_pushnumber(L, pdf_ximage_objnum(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_annot_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, pdf_height(n));
+ break;
+ case 6:
+ lua_pushnumber(L, pdf_depth(n));
+ break;
+ case 7:
+ lua_pushnumber(L, pdf_annot_objnum(n));
+ break;
+ case 8:
+ tokenlist_to_luastring(L, pdf_annot_data(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_start_link_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, pdf_height(n));
+ break;
+ case 6:
+ lua_pushnumber(L, pdf_depth(n));
+ break;
+ case 7:
+ lua_pushnumber(L, pdf_link_objnum(n));
+ break;
+ case 8:
+ tokenlist_to_luastring(L, pdf_link_attr(n));
+ break;
+ case 9:
+ nodelib_pushaction(L, pdf_link_action(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_dest_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, pdf_height(n));
+ break;
+ case 6:
+ lua_pushnumber(L, pdf_depth(n));
+ break;
+ case 7:
+ lua_pushnumber(L, pdf_dest_named_id(n));
+ break;
+ case 8:
+ if (pdf_dest_named_id(n) == 1)
+ tokenlist_to_luastring(L, pdf_dest_id(n));
+ else
+ lua_pushnumber(L, pdf_dest_id(n));
+ break;
+ case 9:
+ lua_pushnumber(L, pdf_dest_type(n));
+ break;
+ case 10:
+ lua_pushnumber(L, pdf_dest_xyz_zoom(n));
+ break;
+ case 11:
+ lua_pushnumber(L, pdf_dest_objnum(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_thread_node:
+ case pdf_start_thread_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, pdf_height(n));
+ break;
+ case 6:
+ lua_pushnumber(L, pdf_depth(n));
+ break;
+ case 7:
+ lua_pushnumber(L, pdf_thread_named_id(n));
+ break;
+ case 8:
+ if (pdf_thread_named_id(n) == 1)
+ tokenlist_to_luastring(L, pdf_thread_id(n));
+ else
+ lua_pushnumber(L, pdf_thread_id(n));
+ break;
+ case 9:
+ tokenlist_to_luastring(L, pdf_thread_attr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case late_lua_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, late_lua_reg(n));
+ break;
+ case 5:
+ tokenlist_to_luastring(L, late_lua_data(n));
+ break;
+ case 6:
+ tokenlist_to_luastring(L, late_lua_name(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case close_lua_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, late_lua_reg(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_colorstack_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, pdf_colorstack_stack(n));
+ break;
+ case 5:
+ lua_pushnumber(L, pdf_colorstack_cmd(n));
+ break;
+ case 6:
+ tokenlist_to_luastring(L, pdf_colorstack_data(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case pdf_setmatrix_node:
+ switch (field) {
+ case 4:
+ tokenlist_to_luastring(L, pdf_setmatrix_data(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case user_defined_node:
+ switch (field) {
+ case 4:
+ lua_pushnumber(L, user_node_id(n));
+ break;
+ case 5:
+ lua_pushnumber(L, user_node_type(n));
+ break;
+ case 6:
+ switch (user_node_type(n)) {
+ case 'a':
+ nodelib_pushlist(L, user_node_value(n));
+ break;
+ case 'd':
+ lua_pushnumber(L, user_node_value(n));
+ break;
+ case 'n':
+ nodelib_pushlist(L, user_node_value(n));
+ break;
+ case 's':
+ nodelib_pushstring(L, user_node_value(n));
+ break;
+ case 't':
+ tokenlist_to_lua(L, user_node_value(n));
+ break;
+ default:
+ lua_pushnumber(L, user_node_value(n));
+ break;
+ }
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ default:
+ lua_pushnil(L);
+ break;
+ }
+ }
}
-static int
-lua_nodelib_getfield (lua_State *L) {
- halfword *n_ptr, n;
- int field;
- if (lua_isnil(L,1))
- return 1; /* a nil */
- n_ptr = check_isnode(L,1);
- n = *n_ptr;
- field = get_valid_node_field_id(L,2, n);
-
- if (field<-1)
- return 0;
- if (field==0) {
- lua_pushnumber(L,vlink(n));
- lua_nodelib_push(L);
- } else if (field==1) {
- lua_pushnumber(L,type(n));
- } else if (field==-1) {
- lua_pushnumber(L,alink(n));
- lua_nodelib_push(L);
- } else if (field==3 && nodetype_has_attributes(type(n))) {
- nodelib_pushattr(L,node_attr(n));
- } else {
+static int lua_nodelib_getfield(lua_State * L)
+{
+ register halfword n;
+ register int field;
+ n = *((halfword *) lua_touserdata(L, 1));
+ field = get_valid_node_field_id(L, 2, n);
+ if (field == 0) {
+ lua_pushnumber(L, vlink(n));
+ lua_nodelib_push(L);
+ return 1;
+ }
+ if (field == 1) {
+ lua_pushnumber(L, type(n));
+ return 1;
+ }
+ if (field == -1) {
+ lua_pushnumber(L, alink(n));
+ lua_nodelib_push(L);
+ return 1;
+ }
+ if (field == 3 && nodetype_has_attributes(type(n))) {
+ nodelib_pushattr(L, node_attr(n));
+ return 1;
+ }
+ if (field < -1)
+ return 0;
switch (type(n)) {
case hlist_node:
case vlist_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: lua_pushnumber(L,width(n)); break;
- case 5: lua_pushnumber(L,depth(n)); break;
- case 6: lua_pushnumber(L,height(n)); break;
- case 7: lua_pushnumber(L,box_dir(n)); break;
- case 8: lua_pushnumber(L,shift_amount(n)); break;
- case 9: lua_pushnumber(L,glue_order(n)); break;
- case 10: lua_pushnumber(L,glue_sign(n)); break;
- case 11: lua_pushnumber(L,(double)glue_set(n)); break;
- case 12: nodelib_pushlist(L,list_ptr(n)); break;
- default: lua_pushnil(L);
- }
- break;
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, depth(n));
+ break;
+ case 6:
+ lua_pushnumber(L, height(n));
+ break;
+ case 7:
+ nodelib_pushdir(L, box_dir(n), false);
+ break;
+ case 8:
+ lua_pushnumber(L, shift_amount(n));
+ break;
+ case 9:
+ lua_pushnumber(L, glue_order(n));
+ break;
+ case 10:
+ lua_pushnumber(L, glue_sign(n));
+ break;
+ case 11:
+ lua_pushnumber(L, (double) glue_set(n));
+ break;
+ case 12:
+ nodelib_pushlist(L, list_ptr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
case unset_node:
- switch (field) {
- case 2: lua_pushnumber(L,0); break;
- case 4: lua_pushnumber(L,width(n)); break;
- case 5: lua_pushnumber(L,depth(n)); break;
- case 6: lua_pushnumber(L,height(n)); break;
- case 7: lua_pushnumber(L,box_dir(n)); break;
- case 8: lua_pushnumber(L,glue_shrink(n)); break;
- case 9: lua_pushnumber(L,glue_order(n)); break;
- case 10: lua_pushnumber(L,glue_sign(n)); break;
- case 11: lua_pushnumber(L,glue_stretch(n)); break;
- case 12: lua_pushnumber(L,span_count(n)); break;
- case 13: nodelib_pushlist(L,list_ptr(n)); break;
- default: lua_pushnil(L);
- }
- break;
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, 0);
+ break;
+ case 4:
+ lua_pushnumber(L, width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, depth(n));
+ break;
+ case 6:
+ lua_pushnumber(L, height(n));
+ break;
+ case 7:
+ nodelib_pushdir(L, box_dir(n), false);
+ break;
+ case 8:
+ lua_pushnumber(L, glue_shrink(n));
+ break;
+ case 9:
+ lua_pushnumber(L, glue_order(n));
+ break;
+ case 10:
+ lua_pushnumber(L, glue_sign(n));
+ break;
+ case 11:
+ lua_pushnumber(L, glue_stretch(n));
+ break;
+ case 12:
+ lua_pushnumber(L, span_count(n));
+ break;
+ case 13:
+ nodelib_pushlist(L, list_ptr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
case rule_node:
- switch (field) {
- case 2: lua_pushnumber(L,0); break;
- case 4: lua_pushnumber(L,width(n)); break;
- case 5: lua_pushnumber(L,depth(n)); break;
- case 6: lua_pushnumber(L,height(n)); break;
- case 7: lua_pushnumber(L,rule_dir(n)); break;
- default: lua_pushnil(L);
- }
- break;
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, 0);
+ break;
+ case 4:
+ lua_pushnumber(L, width(n));
+ break;
+ case 5:
+ lua_pushnumber(L, depth(n));
+ break;
+ case 6:
+ lua_pushnumber(L, height(n));
+ break;
+ case 7:
+ nodelib_pushdir(L, rule_dir(n), false);
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
case ins_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: lua_pushnumber(L,float_cost(n)); break;
- case 5: lua_pushnumber(L,depth(n)); break;
- case 6: lua_pushnumber(L,height(n)); break;
- case 7: nodelib_pushspec(L,split_top_ptr(n)); break;
- case 8: nodelib_pushlist(L,ins_ptr(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case mark_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: lua_pushnumber(L,mark_class(n)); break;
- case 5: tokenlist_to_lua(L,mark_ptr(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case adjust_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: nodelib_pushlist(L,adjust_ptr(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case disc_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: nodelib_pushlist(L,vlink(pre_break(n))); break;
- case 5: nodelib_pushlist(L,vlink(post_break(n))); break;
- case 6: nodelib_pushlist(L,vlink(no_break(n))); break;
- default: lua_pushnil(L);
- }
- break;
- case math_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: lua_pushnumber(L,surround(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case glue_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: nodelib_pushspec(L,glue_ptr(n)); break;
- case 5: nodelib_pushlist(L,leader_ptr(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case glue_spec_node:
- switch (field) {
- case 2: lua_pushnumber(L,0); break;
- case 3: lua_pushnumber(L,width(n)); break;
- case 4: lua_pushnumber(L,stretch(n)); break;
- case 5: lua_pushnumber(L,shrink(n)); break;
- case 6: lua_pushnumber(L,stretch_order(n)); break;
- case 7: lua_pushnumber(L,shrink_order(n)); break;
- case 8: lua_pushnumber(L,glue_ref_count(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case kern_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: lua_pushnumber(L,width(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case penalty_node:
- switch (field) {
- case 2: lua_pushnumber(L,0); break;
- case 4: lua_pushnumber(L,penalty(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case glyph_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 4: lua_pushnumber(L,character(n)); break;
- case 5: lua_pushnumber(L,font(n)); break;
- case 6: lua_pushnumber(L,char_lang(n)); break;
- case 7: lua_pushnumber(L,char_lhmin(n)); break;
- case 8: lua_pushnumber(L,char_rhmin(n)); break;
- case 9: lua_pushnumber(L,char_uchyph(n)); break;
- case 10: nodelib_pushlist(L,lig_ptr(n)); break;
- case 11: lua_pushnumber(L,x_displace(n)); break;
- case 12: lua_pushnumber(L,y_displace(n)); break;
- default: lua_pushnil(L);
- }
- break;
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, float_cost(n));
+ break;
+ case 5:
+ lua_pushnumber(L, depth(n));
+ break;
+ case 6:
+ lua_pushnumber(L, height(n));
+ break;
+ case 7:
+ nodelib_pushspec(L, split_top_ptr(n));
+ break;
+ case 8:
+ nodelib_pushlist(L, ins_ptr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case mark_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, mark_class(n));
+ break;
+ case 5:
+ tokenlist_to_lua(L, mark_ptr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case adjust_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, adjust_ptr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case disc_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, vlink(pre_break(n)));
+ break;
+ case 5:
+ nodelib_pushlist(L, vlink(post_break(n)));
+ break;
+ case 6:
+ nodelib_pushlist(L, vlink(no_break(n)));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case math_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, surround(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case glue_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushspec(L, glue_ptr(n));
+ break;
+ case 5:
+ nodelib_pushlist(L, leader_ptr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case glue_spec_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, 0);
+ break;
+ case 3:
+ lua_pushnumber(L, width(n));
+ break;
+ case 4:
+ lua_pushnumber(L, stretch(n));
+ break;
+ case 5:
+ lua_pushnumber(L, shrink(n));
+ break;
+ case 6:
+ lua_pushnumber(L, stretch_order(n));
+ break;
+ case 7:
+ lua_pushnumber(L, shrink_order(n));
+ break;
+ case 8:
+ lua_pushnumber(L, glue_ref_count(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case kern_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, width(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case penalty_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, 0);
+ break;
+ case 4:
+ lua_pushnumber(L, penalty(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case glyph_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, character(n));
+ break;
+ case 5:
+ lua_pushnumber(L, font(n));
+ break;
+ case 6:
+ lua_pushnumber(L, char_lang(n));
+ break;
+ case 7:
+ lua_pushnumber(L, char_lhmin(n));
+ break;
+ case 8:
+ lua_pushnumber(L, char_rhmin(n));
+ break;
+ case 9:
+ lua_pushnumber(L, char_uchyph(n));
+ break;
+ case 10:
+ nodelib_pushlist(L, lig_ptr(n));
+ break;
+ case 11:
+ lua_pushnumber(L, x_displace(n));
+ break;
+ case 12:
+ lua_pushnumber(L, y_displace(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case style_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, 0);
+ break;
+ case 4:
+ lua_pushstring(L, math_style_names[subtype(n)]);
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case choice_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, display_mlist(n));
+ break;
+ case 5:
+ nodelib_pushlist(L, text_mlist(n));
+ break;
+ case 6:
+ nodelib_pushlist(L, script_mlist(n));
+ break;
+ case 7:
+ nodelib_pushlist(L, script_script_mlist(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case ord_noad:
+ case op_noad:
+ case bin_noad:
+ case rel_noad:
+ case open_noad:
+ case close_noad:
+ case punct_noad:
+ case inner_noad:
+ case under_noad:
+ case over_noad:
+ case vcenter_noad:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, nucleus(n));
+ break;
+ case 5:
+ nodelib_pushlist(L, subscr(n));
+ break;
+ case 6:
+ nodelib_pushlist(L, supscr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case radical_noad:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, nucleus(n));
+ break;
+ case 5:
+ nodelib_pushlist(L, subscr(n));
+ break;
+ case 6:
+ nodelib_pushlist(L, supscr(n));
+ break;
+ case 7:
+ nodelib_pushlist(L, left_delimiter(n));
+ break;
+ case 8:
+ nodelib_pushlist(L, degree(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case fraction_noad:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, thickness(n));
+ break;
+ case 5:
+ nodelib_pushlist(L, numerator(n));
+ break;
+ case 6:
+ nodelib_pushlist(L, denominator(n));
+ break;
+ case 7:
+ nodelib_pushlist(L, left_delimiter(n));
+ break;
+ case 8:
+ nodelib_pushlist(L, right_delimiter(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case accent_noad:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, nucleus(n));
+ break;
+ case 5:
+ nodelib_pushlist(L, subscr(n));
+ break;
+ case 6:
+ nodelib_pushlist(L, supscr(n));
+ break;
+ case 7:
+ nodelib_pushlist(L, accent_chr(n));
+ break;
+ case 8:
+ nodelib_pushlist(L, bot_accent_chr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case fence_noad:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, delimiter(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case math_char_node:
+ case math_text_char_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, math_fam(n));
+ break;
+ case 5:
+ lua_pushnumber(L, math_character(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case sub_box_node:
+ case sub_mlist_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, math_list(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case delim_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 4:
+ lua_pushnumber(L, small_fam(n));
+ break;
+ case 5:
+ lua_pushnumber(L, small_char(n));
+ break;
+ case 6:
+ lua_pushnumber(L, large_fam(n));
+ break;
+ case 7:
+ lua_pushnumber(L, large_char(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
case inserting_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 3: nodelib_pushlist(L,last_ins_ptr(n)); break;
- case 4: nodelib_pushlist(L,best_ins_ptr(n)); break;
- default: lua_pushnil(L);
- }
- break;
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 3:
+ nodelib_pushlist(L, last_ins_ptr(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, best_ins_ptr(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
case split_up_node:
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 3: nodelib_pushlist(L,last_ins_ptr(n)); break;
- case 4: nodelib_pushlist(L,best_ins_ptr(n)); break;
- case 5: nodelib_pushlist(L,broken_ptr(n)); break;
- case 6: nodelib_pushlist(L,broken_ins(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case margin_kern_node :
- switch (field) {
- case 2: lua_pushnumber(L,subtype(n)); break;
- case 3: lua_pushnumber(L,width(n)); break;
- case 4: nodelib_pushlist(L,margin_char(n)); break;
- default: lua_pushnil(L);
- }
- break;
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 3:
+ nodelib_pushlist(L, last_ins_ptr(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, best_ins_ptr(n));
+ break;
+ case 5:
+ nodelib_pushlist(L, broken_ptr(n));
+ break;
+ case 6:
+ nodelib_pushlist(L, broken_ins(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case margin_kern_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, subtype(n));
+ break;
+ case 3:
+ lua_pushnumber(L, width(n));
+ break;
+ case 4:
+ nodelib_pushlist(L, margin_char(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
case action_node:
- switch (field) {
- case 2: lua_pushnil(L); /* dummy subtype */ break;
- case 3: lua_pushnumber(L,pdf_action_type(n)); break;
- case 4: lua_pushnumber(L,pdf_action_named_id(n)); break;
- case 5: if (pdf_action_named_id(n)==1) {
- tokenlist_to_luastring(L,pdf_action_id(n));
- } else {
- lua_pushnumber(L,pdf_action_id(n));
- } break;
- case 6: tokenlist_to_luastring(L,pdf_action_file(n)); break;
- case 7: lua_pushnumber(L,pdf_action_new_window(n)); break;
- case 8: tokenlist_to_luastring(L,pdf_action_tokens(n));break;
- case 9: lua_pushnumber(L,pdf_action_refcount(n)); break;
- default: lua_pushnil(L);
- }
- break;
- case attribute_list_node :
- switch (field) {
- case 2: lua_pushnumber(L,0); break;
- default: lua_pushnil(L);
- }
- break;
- case attribute_node :
- switch (field) {
- case 2: lua_pushnumber(L,0); break;
- case 3: lua_pushnumber(L,attribute_id(n)); break;
- case 4: lua_pushnumber(L,attribute_value(n)); break;
- default: lua_pushnil(L);
- }
- break;
+ switch (field) {
+ case 2:
+ lua_pushnil(L); /* dummy subtype */
+ break;
+ case 3:
+ lua_pushnumber(L, pdf_action_type(n));
+ break;
+ case 4:
+ lua_pushnumber(L, pdf_action_named_id(n));
+ break;
+ case 5:
+ if (pdf_action_named_id(n) == 1) {
+ tokenlist_to_luastring(L, pdf_action_id(n));
+ } else {
+ lua_pushnumber(L, pdf_action_id(n));
+ }
+ break;
+ case 6:
+ tokenlist_to_luastring(L, pdf_action_file(n));
+ break;
+ case 7:
+ lua_pushnumber(L, pdf_action_new_window(n));
+ break;
+ case 8:
+ tokenlist_to_luastring(L, pdf_action_tokens(n));
+ break;
+ case 9:
+ lua_pushnumber(L, pdf_action_refcount(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case attribute_list_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, 0);
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
+ case attribute_node:
+ switch (field) {
+ case 2:
+ lua_pushnumber(L, 0);
+ break;
+ case 3:
+ lua_pushnumber(L, attribute_id(n));
+ break;
+ case 4:
+ lua_pushnumber(L, attribute_value(n));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ break;
case whatsit_node:
- lua_nodelib_getfield_whatsit(L,n,field);
- break;
- default:
- lua_pushnil(L);
- break;
+ lua_nodelib_getfield_whatsit(L, n, field);
+ break;
+ default:
+ lua_pushnil(L);
+ break;
}
- }
- return 1;
+ return 1;
}
-static int nodelib_getlist(lua_State *L, int n) {
- halfword *m;
- if (lua_isuserdata(L,n)) {
- m = check_isnode(L,n);
- return *m;
- } else {
- return null ;
- }
+
+
+static int nodelib_getlist(lua_State * L, int n)
+{
+ halfword *m;
+ if (lua_isuserdata(L, n)) {
+ m = check_isnode(L, n);
+ return *m;
+ } else {
+ return null;
+ }
}
+static int nodelib_getdir(lua_State * L, int n)
+{
+ char *s = NULL;
+ int d = 32; /* invalid number */
+ int a = -1, b = -1, c = -1;
+ if (lua_type(L, n) == LUA_TSTRING) {
+ s = (char *) lua_tostring(L, n);
+ if (strlen(s) == 3) {
+ d = 0;
+ }
+ if (strlen(s) == 4) {
+ if (*s == '-')
+ d = -64;
+ else if (*s == '+')
+ d = 0;
+ s++;
+ }
+ if (strlen(s) == 3) {
+ switch (*s) {
+ /* *INDENT-OFF* */
+ case 'T': a=0; break;
+ case 'L': a=1; break;
+ case 'B': a=2; break;
+ case 'R': a=3; break;
+ /* *INDENT-ON* */
+ }
+ switch (*(s + 1)) {
+ /* *INDENT-OFF* */
+ case 'T': b=0; break;
+ case 'L': b=1; break;
+ case 'B': b=2; break;
+ case 'R': b=3; break;
+ /* *INDENT-ON* */
+ }
+ switch (*(s + 2)) {
+ /* *INDENT-OFF* */
+ case 'T': c=0; break;
+ case 'L': c=1; break;
+ case 'B': c=2; break;
+ case 'R': c=3; break;
+ /* *INDENT-ON* */
+ }
+ }
+ if (a != -1 && b != -1 && c != -1 && !dir_parallel(a, b)) {
+ d += (a * 8 + dir_rearrange[b] * 4 + c);
+ }
+ } else if (lua_isnumber(L, n)) {
+ d = lua_tonumber(L, n);
+ }
+ if ((d > 31) || (d < -64) || (d < 0 && (d + 64) > 31)) {
+ d = 0;
+ lua_pushfstring(L, "Bad direction specifier %s",
+ (char *) lua_tostring(L, n));
+ lua_error(L);
+ }
+ return d;
+}
+
+
#define nodelib_getspec nodelib_getlist
#define nodelib_getaction nodelib_getlist
-static str_number
-nodelib_getstring(lua_State *L, int a) {
- size_t k;
- char *s=(char *)lua_tolstring(L,a, &k);
- return maketexlstring(s,k);
+static str_number nodelib_getstring(lua_State * L, int a)
+{
+ size_t k;
+ char *s = (char *) lua_tolstring(L, a, &k);
+ return maketexlstring(s, k);
}
#define nodelib_gettoks(L,a) tokenlist_from_lua(L)
-static void nodelib_setattr (lua_State *L, int stackindex, halfword n) {
- halfword p;
- p = nodelib_getlist(L,stackindex);
- if (node_attr(n) != p) {
- if (node_attr(n)!=null)
- delete_attribute_ref(node_attr(n));
- node_attr(n) = p;
- attr_list_ref(p)++;
- }
+static void nodelib_setattr(lua_State * L, int stackindex, halfword n)
+{
+ halfword p;
+ p = nodelib_getlist(L, stackindex);
+ if (node_attr(n) != p) {
+ if (node_attr(n) != null)
+ delete_attribute_ref(node_attr(n));
+ node_attr(n) = p;
+ attr_list_ref(p)++;
+ }
}
-static int nodelib_cantset (lua_State *L, int field, int n) {
- lua_pushfstring(L,"You cannot set field %d in a node of type %s",
- field, node_data[type(n)].name);
- lua_error(L);
- return 0;
+static int nodelib_cantset(lua_State * L, int field, int n)
+{
+ lua_pushfstring(L, "You cannot set field %d in a node of type %s",
+ field, node_data[type(n)].name);
+ lua_error(L);
+ return 0;
}
-static int
-lua_nodelib_setfield_whatsit(lua_State *L, int n, int field) {
- switch (subtype(n)) {
- case open_node:
- switch (field) {
- case 4: write_stream(n) = lua_tointeger(L,3); break;
- case 5: open_name(n) = nodelib_getstring(L,3); break;
- case 6: open_area(n) = nodelib_getstring(L,3); break;
- case 7: open_ext(n) = nodelib_getstring(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case write_node:
- switch (field) {
- case 4: write_stream(n) = lua_tointeger(L,3); break;
- case 5: write_tokens(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case close_node:
- switch (field) {
- case 4: write_stream(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case special_node:
- switch (field) {
- case 4: write_tokens(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case local_par_node:
- switch (field) {
- case 4: local_pen_inter(n) = lua_tointeger(L,3); break;
- case 5: local_pen_broken(n) = lua_tointeger(L,3); break;
- case 6: local_par_dir(n) = lua_tointeger(L,3); break;
- case 7: local_box_left(n) = nodelib_getlist(L,3); break;
- case 8: local_box_left_width(n) = lua_tointeger(L,3); break;
- case 9: local_box_right(n) = nodelib_getlist(L,3); break;
- case 10: local_box_right_width(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case dir_node:
- switch (field) {
- case 4: dir_dir(n) = lua_tointeger(L,3); break;
- case 5: dir_level(n) = lua_tointeger(L,3); break;
- case 6: dir_dvi_ptr(n) = lua_tointeger(L,3); break;
- case 7: dir_dvi_h(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_literal_node:
- switch (field) {
- case 4: pdf_literal_mode(n) = lua_tointeger(L,3); break;
- case 5: pdf_literal_data(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_refobj_node:
- switch (field) {
- case 4: pdf_obj_objnum(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_refxform_node:
- switch (field) {
- case 4: pdf_width(n) = lua_tointeger(L,3); break;
- case 5: pdf_height(n) = lua_tointeger(L,3); break;
- case 6: pdf_depth(n) = lua_tointeger(L,3); break;
- case 7: pdf_xform_objnum(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_refximage_node:
- switch (field) {
- case 4: pdf_width(n) = lua_tointeger(L,3); break;
- case 5: pdf_height(n) = lua_tointeger(L,3); break;
- case 6: pdf_depth(n) = lua_tointeger(L,3); break;
- case 7: pdf_ximage_objnum(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_annot_node:
- switch (field) {
- case 4: pdf_width(n) = lua_tointeger(L,3); break;
- case 5: pdf_height(n) = lua_tointeger(L,3); break;
- case 6: pdf_depth(n) = lua_tointeger(L,3); break;
- case 7: pdf_annot_objnum(n) = lua_tointeger(L,3); break;
- case 8: pdf_annot_data(n) = nodelib_getstring(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_start_link_node:
- switch (field) {
- case 4: pdf_width(n) = lua_tointeger(L,3); break;
- case 5: pdf_height(n) = lua_tointeger(L,3); break;
- case 6: pdf_depth(n) = lua_tointeger(L,3); break;
- case 7: pdf_link_objnum(n) = lua_tointeger(L,3); break;
- case 8: pdf_link_attr(n) = nodelib_getstring(L,3); break;
- case 9: pdf_link_action(n) = nodelib_getaction(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_end_link_node:
- switch (field) {
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_dest_node:
- switch (field) {
- case 4: pdf_width(n) = lua_tointeger(L,3); break;
- case 5: pdf_height(n) = lua_tointeger(L,3); break;
- case 6: pdf_depth(n) = lua_tointeger(L,3); break;
- case 7: pdf_dest_named_id(n) = lua_tointeger(L,3); break;
- case 8: if (pdf_dest_named_id(n)==1)
- pdf_dest_id(n) = nodelib_gettoks(L,3);
- else
- pdf_dest_id(n) = lua_tointeger(L,3); break;
- case 9: pdf_dest_type(n) = lua_tointeger(L,3); break;
- case 10: pdf_dest_xyz_zoom(n) = lua_tointeger(L,3); break;
- case 11: pdf_dest_objnum(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_thread_node:
- case pdf_start_thread_node:
- switch (field) {
- case 4: pdf_width(n) = lua_tointeger(L,3); break;
- case 5: pdf_height(n) = lua_tointeger(L,3); break;
- case 6: pdf_depth(n) = lua_tointeger(L,3); break;
- case 7: pdf_thread_named_id(n) = lua_tointeger(L,3); break;
- case 8: if (pdf_thread_named_id(n)==1)
- pdf_thread_id(n) = nodelib_gettoks(L,3);
- else
- pdf_thread_id(n) = lua_tointeger(L,3); break;
- case 9: pdf_thread_attr(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_end_thread_node:
- case pdf_save_pos_node:
- return nodelib_cantset(L,field,n);
- break;
- case late_lua_node:
- switch (field) {
- case 4: late_lua_reg(n) = lua_tointeger(L,3); break;
- case 5: late_lua_data(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case close_lua_node:
- switch (field) {
- case 4: late_lua_reg(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_colorstack_node:
- switch (field) {
- case 4: pdf_colorstack_stack(n) = lua_tointeger(L,3); break;
- case 5: pdf_colorstack_cmd(n) = lua_tointeger(L,3); break;
- case 6: pdf_colorstack_data(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_setmatrix_node:
- switch (field) {
- case 4: pdf_setmatrix_data(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case pdf_save_node:
- case pdf_restore_node:
- case cancel_boundary_node:
- return nodelib_cantset(L,field,n);
- break;
- case user_defined_node:
- switch (field) {
- case 4: user_node_id(n) = lua_tointeger(L,3); break;
- case 5: user_node_type(n) = lua_tointeger(L,3); break;
- case 6:
- switch(user_node_type(n)) {
- case 'a': user_node_value(n) = nodelib_getlist(L,3); break;
- case 'd': user_node_value(n) = lua_tointeger(L,3); break;
- case 'n': user_node_value(n) = nodelib_getlist(L,3); break;
- case 's': user_node_value(n) = nodelib_getstring(L,3); break;
- case 't': user_node_value(n) = nodelib_gettoks(L,3); break;
- default: user_node_value(n) = lua_tointeger(L,3); break;
- } break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- default:
- /* do nothing */
- break;
- }
- return 0;
+static int lua_nodelib_setfield_whatsit(lua_State * L, int n, int field)
+{
+ switch (subtype(n)) {
+ case open_node:
+ switch (field) {
+ case 4:
+ write_stream(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ open_name(n) = nodelib_getstring(L, 3);
+ break;
+ case 6:
+ open_area(n) = nodelib_getstring(L, 3);
+ break;
+ case 7:
+ open_ext(n) = nodelib_getstring(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case write_node:
+ switch (field) {
+ case 4:
+ write_stream(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ write_tokens(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case close_node:
+ switch (field) {
+ case 4:
+ write_stream(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case special_node:
+ switch (field) {
+ case 4:
+ write_tokens(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case local_par_node:
+ switch (field) {
+ case 4:
+ local_pen_inter(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ local_pen_broken(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ local_par_dir(n) = nodelib_getdir(L, 3);
+ break;
+ case 7:
+ local_box_left(n) = nodelib_getlist(L, 3);
+ break;
+ case 8:
+ local_box_left_width(n) = lua_tointeger(L, 3);
+ break;
+ case 9:
+ local_box_right(n) = nodelib_getlist(L, 3);
+ break;
+ case 10:
+ local_box_right_width(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case dir_node:
+ switch (field) {
+ case 4:
+ dir_dir(n) = nodelib_getdir(L, 3);
+ break;
+ case 5:
+ dir_level(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ dir_dvi_ptr(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ dir_dvi_h(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_literal_node:
+ switch (field) {
+ case 4:
+ pdf_literal_mode(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_literal_data(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_refobj_node:
+ switch (field) {
+ case 4:
+ pdf_obj_objnum(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_refxform_node:
+ switch (field) {
+ case 4:
+ pdf_width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_height(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ pdf_depth(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ pdf_xform_objnum(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_refximage_node:
+ switch (field) {
+ case 4:
+ pdf_width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_height(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ pdf_depth(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ pdf_ximage_objnum(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_annot_node:
+ switch (field) {
+ case 4:
+ pdf_width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_height(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ pdf_depth(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ pdf_annot_objnum(n) = lua_tointeger(L, 3);
+ break;
+ case 8:
+ pdf_annot_data(n) = nodelib_getstring(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_start_link_node:
+ switch (field) {
+ case 4:
+ pdf_width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_height(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ pdf_depth(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ pdf_link_objnum(n) = lua_tointeger(L, 3);
+ break;
+ case 8:
+ pdf_link_attr(n) = nodelib_getstring(L, 3);
+ break;
+ case 9:
+ pdf_link_action(n) = nodelib_getaction(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_end_link_node:
+ switch (field) {
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_dest_node:
+ switch (field) {
+ case 4:
+ pdf_width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_height(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ pdf_depth(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ pdf_dest_named_id(n) = lua_tointeger(L, 3);
+ break;
+ case 8:
+ if (pdf_dest_named_id(n) == 1)
+ pdf_dest_id(n) = nodelib_gettoks(L, 3);
+ else
+ pdf_dest_id(n) = lua_tointeger(L, 3);
+ break;
+ case 9:
+ pdf_dest_type(n) = lua_tointeger(L, 3);
+ break;
+ case 10:
+ pdf_dest_xyz_zoom(n) = lua_tointeger(L, 3);
+ break;
+ case 11:
+ pdf_dest_objnum(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_thread_node:
+ case pdf_start_thread_node:
+ switch (field) {
+ case 4:
+ pdf_width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_height(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ pdf_depth(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ pdf_thread_named_id(n) = lua_tointeger(L, 3);
+ break;
+ case 8:
+ if (pdf_thread_named_id(n) == 1)
+ pdf_thread_id(n) = nodelib_gettoks(L, 3);
+ else
+ pdf_thread_id(n) = lua_tointeger(L, 3);
+ break;
+ case 9:
+ pdf_thread_attr(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_end_thread_node:
+ case pdf_save_pos_node:
+ return nodelib_cantset(L, field, n);
+ break;
+ case late_lua_node:
+ switch (field) {
+ case 4:
+ late_lua_reg(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ late_lua_data(n) = nodelib_gettoks(L, 3);
+ break;
+ case 6:
+ late_lua_name(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case close_lua_node:
+ switch (field) {
+ case 4:
+ late_lua_reg(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_colorstack_node:
+ switch (field) {
+ case 4:
+ pdf_colorstack_stack(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ pdf_colorstack_cmd(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ pdf_colorstack_data(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_setmatrix_node:
+ switch (field) {
+ case 4:
+ pdf_setmatrix_data(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case pdf_save_node:
+ case pdf_restore_node:
+ case cancel_boundary_node:
+ return nodelib_cantset(L, field, n);
+ break;
+ case user_defined_node:
+ switch (field) {
+ case 4:
+ user_node_id(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ user_node_type(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ switch (user_node_type(n)) {
+ case 'a':
+ user_node_value(n) = nodelib_getlist(L, 3);
+ break;
+ case 'd':
+ user_node_value(n) = lua_tointeger(L, 3);
+ break;
+ case 'n':
+ user_node_value(n) = nodelib_getlist(L, 3);
+ break;
+ case 's':
+ user_node_value(n) = nodelib_getstring(L, 3);
+ break;
+ case 't':
+ user_node_value(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ user_node_value(n) = lua_tointeger(L, 3);
+ break;
+ }
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
+ return 0;
}
-static int
-lua_nodelib_setfield (lua_State *L) {
- register halfword n;
- register int field;
- n = *check_isnode(L,1);
- field = get_valid_node_field_id(L,2,n);
- if (field<-1)
- return 0;
- if (field==0) {
- vlink(n) = nodelib_getlist(L,3);
- } else if (field==-1) {
- alink(n) = nodelib_getlist(L,3);
- } else if (field==3 && nodetype_has_attributes(type(n))) {
- nodelib_setattr(L,3,n);
- } else if (type(n)==glyph_node) {
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: character(n) = lua_tointeger(L,3); break;
- case 5: font(n) = lua_tointeger(L,3); break;
- case 6: set_char_lang(n,lua_tointeger(L,3)); break;
- case 7: set_char_lhmin(n,lua_tointeger(L,3)); break;
- case 8: set_char_rhmin(n,lua_tointeger(L,3)); break;
- case 9: set_char_uchyph(n,lua_tointeger(L,3)); break;
- case 10: lig_ptr(n) = nodelib_getlist(L,3); break;
- case 11: x_displace(n) = lua_tointeger(L,3); break;
- case 12: y_displace(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- } else {
- switch (type(n)) {
- case hlist_node:
- case vlist_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: width(n) = lua_tointeger(L,3); break;
- case 5: depth(n) = lua_tointeger(L,3); break;
- case 6: height(n) = lua_tointeger(L,3); break;
- case 7: box_dir(n) = lua_tointeger(L,3); break;
- case 8: shift_amount(n) = lua_tointeger(L,3); break;
- case 9: glue_order(n) = lua_tointeger(L,3); break;
- case 10: glue_sign(n) = lua_tointeger(L,3); break;
- case 11: glue_set(n) = (double)lua_tonumber(L,3); break;
- case 12: list_ptr(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case unset_node:
- switch (field) {
- case 2: /* dummy subtype */ break;
- case 4: width(n) = lua_tointeger(L,3); break;
- case 5: depth(n) = lua_tointeger(L,3); break;
- case 6: height(n) = lua_tointeger(L,3); break;
- case 7: box_dir(n) = lua_tointeger(L,3); break;
- case 8: glue_shrink(n) = lua_tointeger(L,3); break;
- case 9: glue_order(n) = lua_tointeger(L,3); break;
- case 10: glue_sign(n) = lua_tointeger(L,3); break;
- case 11: glue_stretch(n) = lua_tointeger(L,3); break;
- case 12: span_count(n) = lua_tointeger(L,3); break;
- case 13: list_ptr(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case rule_node:
- switch (field) {
- case 2: /* dummy subtype */ break;
- case 4: width(n) = lua_tointeger(L,3); break;
- case 5: depth(n) = lua_tointeger(L,3); break;
- case 6: height(n) = lua_tointeger(L,3); break;
- case 7: rule_dir(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case ins_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: float_cost(n) = lua_tointeger(L,3); break;
- case 5: depth(n) = lua_tointeger(L,3); break;
- case 6: height(n) = lua_tointeger(L,3); break;
- case 7: split_top_ptr(n) = nodelib_getspec(L,3); break;
- case 8: ins_ptr(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case mark_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: mark_class(n) = lua_tointeger(L,3); break;
- case 5: mark_ptr(n) = nodelib_gettoks(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case adjust_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: adjust_ptr(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case disc_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: set_disc_field(pre_break(n),nodelib_getlist(L,3)); break;
- case 5: set_disc_field(post_break(n),nodelib_getlist(L,3)); break;
- case 6: set_disc_field(no_break(n),nodelib_getlist(L,3)); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case math_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: surround(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case glue_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: glue_ptr(n) = nodelib_getspec(L,3); break;
- case 5: leader_ptr(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case glue_spec_node:
- switch (field) {
- case 2: /* dummy subtype */ break;
- case 3: width(n) = lua_tointeger(L,3); break;
- case 4: stretch(n) = lua_tointeger(L,3); break;
- case 5: shrink(n) = lua_tointeger(L,3); break;
- case 6: stretch_order(n) = lua_tointeger(L,3); break;
- case 7: shrink_order(n) = lua_tointeger(L,3); break;
- case 8: glue_ref_count(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case kern_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 4: width(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case penalty_node:
- switch (field) {
- case 2: /* dummy subtype */ break;
- case 4: penalty(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case action_node:
- switch (field) {
- case 2: /* dummy subtype */ break;
- case 3: pdf_action_type(n) = lua_tointeger(L,3); break;
- case 4: pdf_action_named_id(n) = lua_tointeger(L,3); break;
- case 5: if (pdf_action_named_id(n)==1) {
- pdf_action_id(n) = nodelib_gettoks(L,3);
- } else {
- pdf_action_id(n) = lua_tointeger(L,3);
- } break;
- case 6: pdf_action_file(n) = nodelib_gettoks(L,3); break;
- case 7: pdf_action_new_window(n) = lua_tointeger(L,3); break;
- case 8: pdf_action_tokens(n) = nodelib_gettoks(L,3); break;
- case 9: pdf_action_refcount(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case margin_kern_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 3: width(n) = lua_tointeger(L,3); break;
- case 4: margin_char(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case inserting_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 3: last_ins_ptr(n) = nodelib_getlist(L,3); break;
- case 4: best_ins_ptr(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case split_up_node:
- switch (field) {
- case 2: subtype(n) = lua_tointeger(L,3); break;
- case 3: last_ins_ptr(n) = nodelib_getlist(L,3); break;
- case 4: best_ins_ptr(n) = nodelib_getlist(L,3); break;
- case 5: broken_ptr(n) = nodelib_getlist(L,3); break;
- case 6: broken_ins(n) = nodelib_getlist(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case attribute_list_node:
- switch (field) {
- case 2: /* dummy subtype */ break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case attribute_node:
- switch (field) {
- case 2: /* dummy subtype */ break;
- case 3: attribute_id(n) = lua_tointeger(L,3); break;
- case 4: attribute_value(n) = lua_tointeger(L,3); break;
- default: return nodelib_cantset(L,field,n);
- }
- break;
- case whatsit_node:
- lua_nodelib_setfield_whatsit(L,n,field);
- break;
- default:
- /* do nothing */
- break;
+static int lua_nodelib_setfield(lua_State * L)
+{
+ register halfword n;
+ register int field;
+ n = *((halfword *) lua_touserdata(L, 1));
+ field = get_valid_node_field_id(L, 2, n);
+ if (field < -1)
+ return 0;
+ if (field == 0) {
+ vlink(n) = nodelib_getlist(L, 3);
+ } else if (field == -1) {
+ alink(n) = nodelib_getlist(L, 3);
+ } else if (field == 3 && nodetype_has_attributes(type(n))) {
+ nodelib_setattr(L, 3, n);
+ } else if (type(n) == glyph_node) {
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ character(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ font(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ set_char_lang(n, lua_tointeger(L, 3));
+ break;
+ case 7:
+ set_char_lhmin(n, lua_tointeger(L, 3));
+ break;
+ case 8:
+ set_char_rhmin(n, lua_tointeger(L, 3));
+ break;
+ case 9:
+ set_char_uchyph(n, lua_tointeger(L, 3));
+ break;
+ case 10:
+ lig_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ case 11:
+ x_displace(n) = lua_tointeger(L, 3);
+ break;
+ case 12:
+ y_displace(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ } else {
+ switch (type(n)) {
+ case hlist_node:
+ case vlist_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ depth(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ height(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ box_dir(n) = nodelib_getdir(L, 3);
+ break;
+ case 8:
+ shift_amount(n) = lua_tointeger(L, 3);
+ break;
+ case 9:
+ glue_order(n) = lua_tointeger(L, 3);
+ break;
+ case 10:
+ glue_sign(n) = lua_tointeger(L, 3);
+ break;
+ case 11:
+ glue_set(n) = (double) lua_tonumber(L, 3);
+ break;
+ case 12:
+ list_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case unset_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ case 4:
+ width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ depth(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ height(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ box_dir(n) = lua_tointeger(L, 3);
+ break;
+ case 8:
+ glue_shrink(n) = lua_tointeger(L, 3);
+ break;
+ case 9:
+ glue_order(n) = lua_tointeger(L, 3);
+ break;
+ case 10:
+ glue_sign(n) = lua_tointeger(L, 3);
+ break;
+ case 11:
+ glue_stretch(n) = lua_tointeger(L, 3);
+ break;
+ case 12:
+ span_count(n) = lua_tointeger(L, 3);
+ break;
+ case 13:
+ list_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case rule_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ case 4:
+ width(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ depth(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ height(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ rule_dir(n) = nodelib_getdir(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case ins_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ float_cost(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ depth(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ height(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ split_top_ptr(n) = nodelib_getspec(L, 3);
+ break;
+ case 8:
+ ins_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case mark_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ mark_class(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ mark_ptr(n) = nodelib_gettoks(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case adjust_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ adjust_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case disc_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ set_disc_field(pre_break(n), nodelib_getlist(L, 3));
+ break;
+ case 5:
+ set_disc_field(post_break(n), nodelib_getlist(L, 3));
+ break;
+ case 6:
+ set_disc_field(no_break(n), nodelib_getlist(L, 3));
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case math_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ surround(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case glue_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ glue_ptr(n) = nodelib_getspec(L, 3);
+ break;
+ case 5:
+ leader_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case glue_spec_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ case 3:
+ width(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ stretch(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ shrink(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ stretch_order(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ shrink_order(n) = lua_tointeger(L, 3);
+ break;
+ case 8:
+ glue_ref_count(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case kern_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ width(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case penalty_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ case 4:
+ penalty(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case action_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ case 3:
+ pdf_action_type(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ pdf_action_named_id(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ if (pdf_action_named_id(n) == 1) {
+ pdf_action_id(n) = nodelib_gettoks(L, 3);
+ } else {
+ pdf_action_id(n) = lua_tointeger(L, 3);
+ }
+ break;
+ case 6:
+ pdf_action_file(n) = nodelib_gettoks(L, 3);
+ break;
+ case 7:
+ pdf_action_new_window(n) = lua_tointeger(L, 3);
+ break;
+ case 8:
+ pdf_action_tokens(n) = nodelib_gettoks(L, 3);
+ break;
+ case 9:
+ pdf_action_refcount(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case style_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ case 4:
+ subtype(n) = luaL_checkoption(L, 3, "text", math_style_names);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case choice_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ display_mlist(n) = nodelib_getlist(L, 3);
+ break;
+ case 5:
+ text_mlist(n) = nodelib_getlist(L, 3);
+ break;
+ case 6:
+ script_mlist(n) = nodelib_getlist(L, 3);
+ break;
+ case 7:
+ script_script_mlist(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case ord_noad:
+ case op_noad:
+ case bin_noad:
+ case rel_noad:
+ case open_noad:
+ case close_noad:
+ case punct_noad:
+ case inner_noad:
+ case under_noad:
+ case over_noad:
+ case vcenter_noad:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ nucleus(n) = nodelib_getlist(L, 3);
+ break;
+ case 5:
+ subscr(n) = nodelib_getlist(L, 3);
+ break;
+ case 6:
+ supscr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case radical_noad:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ nucleus(n) = nodelib_getlist(L, 3);
+ break;
+ case 5:
+ subscr(n) = nodelib_getlist(L, 3);
+ break;
+ case 6:
+ supscr(n) = nodelib_getlist(L, 3);
+ break;
+ case 7:
+ left_delimiter(n) = nodelib_getlist(L, 3);
+ break;
+ case 8:
+ degree(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case fraction_noad:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ thickness(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ numerator(n) = nodelib_getlist(L, 3);
+ break;
+ case 6:
+ denominator(n) = nodelib_getlist(L, 3);
+ break;
+ case 7:
+ left_delimiter(n) = nodelib_getlist(L, 3);
+ break;
+ case 8:
+ right_delimiter(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case accent_noad:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ nucleus(n) = nodelib_getlist(L, 3);
+ break;
+ case 5:
+ subscr(n) = nodelib_getlist(L, 3);
+ break;
+ case 6:
+ supscr(n) = nodelib_getlist(L, 3);
+ break;
+ case 7:
+ accent_chr(n) = nodelib_getlist(L, 3);
+ break;
+ case 8:
+ bot_accent_chr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case fence_noad:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ delimiter(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case math_char_node:
+ case math_text_char_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ math_fam(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ math_character(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case sub_box_node:
+ case sub_mlist_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ math_list(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case delim_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ small_fam(n) = lua_tointeger(L, 3);
+ break;
+ case 5:
+ small_char(n) = lua_tointeger(L, 3);
+ break;
+ case 6:
+ large_fam(n) = lua_tointeger(L, 3);
+ break;
+ case 7:
+ large_char(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case margin_kern_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 3:
+ width(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ margin_char(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case inserting_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 3:
+ last_ins_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ case 4:
+ best_ins_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case split_up_node:
+ switch (field) {
+ case 2:
+ subtype(n) = lua_tointeger(L, 3);
+ break;
+ case 3:
+ last_ins_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ case 4:
+ best_ins_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ case 5:
+ broken_ptr(n) = nodelib_getlist(L, 3);
+ break;
+ case 6:
+ broken_ins(n) = nodelib_getlist(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case attribute_list_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case attribute_node:
+ switch (field) {
+ case 2: /* dummy subtype */
+ break;
+ case 3:
+ attribute_id(n) = lua_tointeger(L, 3);
+ break;
+ case 4:
+ attribute_value(n) = lua_tointeger(L, 3);
+ break;
+ default:
+ return nodelib_cantset(L, field, n);
+ }
+ break;
+ case whatsit_node:
+ lua_nodelib_setfield_whatsit(L, n, field);
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
}
- }
- return 0;
+ return 0;
}
-static int
-lua_nodelib_print (lua_State *L) {
- char *msg;
- char a[7] = {' ',' ',' ', 'n', 'i', 'l', 0};
- char v[7] = {' ',' ',' ', 'n', 'i', 'l', 0};
- halfword *n;
- n = check_isnode(L,1);
- msg = xmalloc(256);
- if (alink(*n)!=null)
- snprintf(a,7,"%6d",(int)alink(*n));
- if (vlink(*n)!=null)
- snprintf(v,7,"%6d",(int)vlink(*n));
- snprintf(msg,255,"<node %s < %6d > %s : %s %d>", a, (int)*n, v, node_data[type(*n)].name, subtype(*n));
- lua_pushstring(L,msg);
- free(msg);
- return 1;
+static int lua_nodelib_print(lua_State * L)
+{
+ char *msg;
+ char a[7] = { ' ', ' ', ' ', 'n', 'i', 'l', 0 };
+ char v[7] = { ' ', ' ', ' ', 'n', 'i', 'l', 0 };
+ halfword *n;
+ n = check_isnode(L, 1);
+ msg = xmalloc(256);
+ if (alink(*n) != null)
+ snprintf(a, 7, "%6d", (int) alink(*n));
+ if (vlink(*n) != null)
+ snprintf(v, 7, "%6d", (int) vlink(*n));
+ snprintf(msg, 255, "<node %s < %6d > %s : %s %d>", a, (int) *n, v,
+ node_data[type(*n)].name, subtype(*n));
+ lua_pushstring(L, msg);
+ free(msg);
+ return 1;
}
-static int
-lua_nodelib_equal (lua_State *L) {
- halfword n, m;
- n = *(check_isnode(L,1));
- m = *(check_isnode(L,2));
- lua_pushboolean(L,(n==m));
- return 1;
-}
-
-static int
-font_tex_ligaturing (lua_State *L) {
- /* on the stack are two nodes and a direction */
- halfword tmp_head;
- halfword *h;
- halfword t =null;
- if (lua_gettop(L)<1) {
- lua_pushnil(L);
- lua_pushboolean(L,0);
- return 2;
- }
- h = check_isnode(L,1);
- if (lua_gettop(L)>1) {
- t = *(check_isnode(L,2));
- }
- tmp_head = new_node(nesting_node,1);
- couple_nodes(tmp_head,*h);
- tlink(tmp_head)=t;
- t = handle_ligaturing(tmp_head,t);
- lua_pushnumber(L,vlink(tmp_head));
- flush_node(tmp_head);
- lua_nodelib_push(L);
- lua_pushnumber(L,t);
- lua_nodelib_push(L);
- lua_pushboolean(L,1);
- return 3;
-}
-
-static int
-font_tex_kerning (lua_State *L) {
- /* on the stack are two nodes and a direction */
-
- halfword tmp_head;
- halfword *h;
- halfword t =null;
- if (lua_gettop(L)<1) {
- lua_pushnil(L);
- lua_pushboolean(L,0);
- return 2;
- }
- h = check_isnode(L,1);
- if (lua_gettop(L)>1) {
- t = *(check_isnode(L,2));
- }
- tmp_head = new_node(nesting_node,1);
- couple_nodes(tmp_head,*h);
- tlink(tmp_head)=t;
- t = handle_kerning(tmp_head,t);
- lua_pushnumber(L,vlink(tmp_head));
- flush_node(tmp_head);
- lua_nodelib_push(L);
- lua_pushnumber(L,t);
- lua_nodelib_push(L);
- lua_pushboolean(L,1);
- return 3;
+static int lua_nodelib_equal(lua_State * L)
+{
+ register halfword n, m;
+ n = *((halfword *) lua_touserdata(L, 1));
+ m = *((halfword *) lua_touserdata(L, 2));
+ lua_pushboolean(L, (n == m));
+ return 1;
}
-static int
-lua_nodelib_protect_glyphs (lua_State *L) {
- int t = 0;
- halfword head = *(check_isnode(L,1));
- while (head!=null) {
- if (type(head)==glyph_node) {
- register int s = subtype(head);
- if (s<256) {
- t = 1;
- subtype(head) = ((s&0xFE) << 8);
- }
- }
- head = vlink(head);
- }
- lua_pushboolean(L,t);
- lua_pushvalue(L,1);
- return 2;
+static int font_tex_ligaturing(lua_State * L)
+{
+ /* on the stack are two nodes and a direction */
+ halfword tmp_head;
+ halfword *h;
+ halfword t = null;
+ if (lua_gettop(L) < 1) {
+ lua_pushnil(L);
+ lua_pushboolean(L, 0);
+ return 2;
+ }
+ h = check_isnode(L, 1);
+ if (lua_gettop(L) > 1) {
+ t = *(check_isnode(L, 2));
+ }
+ tmp_head = new_node(nesting_node, 1);
+ couple_nodes(tmp_head, *h);
+ tlink(tmp_head) = t;
+ t = handle_ligaturing(tmp_head, t);
+ lua_pushnumber(L, vlink(tmp_head));
+ flush_node(tmp_head);
+ lua_nodelib_push(L);
+ lua_pushnumber(L, t);
+ lua_nodelib_push(L);
+ lua_pushboolean(L, 1);
+ return 3;
}
-static int
-lua_nodelib_unprotect_glyphs (lua_State *L) {
- int t = 0;
- halfword head = *(check_isnode(L,1));
- while (head!=null) {
- if (type(head)==glyph_node) {
- register int s = subtype(head);
- if (s>=256) {
- t = 1;
- subtype(head) = (s >> 8);
- }
- }
- head = vlink(head);
- }
- lua_pushboolean(L,t);
- lua_pushvalue(L,1);
- return 2;
+static int font_tex_kerning(lua_State * L)
+{
+ /* on the stack are two nodes and a direction */
+
+ halfword tmp_head;
+ halfword *h;
+ halfword t = null;
+ if (lua_gettop(L) < 1) {
+ lua_pushnil(L);
+ lua_pushboolean(L, 0);
+ return 2;
+ }
+ h = check_isnode(L, 1);
+ if (lua_gettop(L) > 1) {
+ t = *(check_isnode(L, 2));
+ }
+ tmp_head = new_node(nesting_node, 1);
+ couple_nodes(tmp_head, *h);
+ tlink(tmp_head) = t;
+ t = handle_kerning(tmp_head, t);
+ lua_pushnumber(L, vlink(tmp_head));
+ flush_node(tmp_head);
+ lua_nodelib_push(L);
+ lua_pushnumber(L, t);
+ lua_nodelib_push(L);
+ lua_pushboolean(L, 1);
+ return 3;
}
+static int lua_nodelib_protect_glyphs(lua_State * L)
+{
+ int t = 0;
+ halfword head = *(check_isnode(L, 1));
+ while (head != null) {
+ if (type(head) == glyph_node) {
+ register int s = subtype(head);
+ if (s <= 256) {
+ t = 1;
+ subtype(head) = (s == 1 ? 256 : 256 + s);
+ }
+ }
+ head = vlink(head);
+ }
+ lua_pushboolean(L, t);
+ lua_pushvalue(L, 1);
+ return 2;
+}
-static int
-lua_nodelib_first_character (lua_State *L) {
- /* on the stack are two nodes and a direction */
- halfword h, savetail = null, t = null;
- if (lua_gettop(L)<1) {
- lua_pushnil(L);
- lua_pushboolean(L,0);
+static int lua_nodelib_unprotect_glyphs(lua_State * L)
+{
+ int t = 0;
+ halfword head = *(check_isnode(L, 1));
+ while (head != null) {
+ if (type(head) == glyph_node) {
+ register int s = subtype(head);
+ if (s > 256) {
+ t = 1;
+ subtype(head) = s - 256;
+ }
+ }
+ head = vlink(head);
+ }
+ lua_pushboolean(L, t);
+ lua_pushvalue(L, 1);
+ return 2;
+}
+
+
+static int lua_nodelib_first_character(lua_State * L)
+{
+ /* on the stack are two nodes and a direction */
+ halfword h, savetail = null, t = null;
+ if (lua_gettop(L) < 1) {
+ lua_pushnil(L);
+ lua_pushboolean(L, 0);
+ return 2;
+ }
+ h = *(check_isnode(L, 1));
+ if (lua_gettop(L) > 1) {
+ t = *(check_isnode(L, 2));
+ savetail = vlink(t);
+ vlink(t) = null;
+ }
+ while (h != null && !is_simple_character(h)) {
+ h = vlink(h);
+ }
+ if (savetail != null) {
+ vlink(t) = savetail;
+ }
+ lua_pushnumber(L, h);
+ lua_nodelib_push(L);
+ lua_pushboolean(L, (h == null ? 0 : 1));
return 2;
- }
- h = *(check_isnode(L,1));
- if (lua_gettop(L)>1) {
- t = *(check_isnode(L,2));
- savetail = vlink(t);
- vlink(t) = null;
- }
- while (h!=null && !is_simple_character(h)) {
- h = vlink(h);
- }
- if (savetail!=null) { vlink(t) = savetail; }
- lua_pushnumber(L,h);
- lua_nodelib_push(L);
- lua_pushboolean(L,(h==null? 0 : 1));
- return 2;
}
/* this is too simplistic, but it helps Hans to get going */
-halfword
-do_ligature_n (halfword prev, halfword stop, halfword lig) {
- vlink(lig) = vlink(stop);
- vlink(stop) = null;
- lig_ptr(lig) = vlink(prev);
- vlink(prev) = lig;
- return lig;
+halfword do_ligature_n(halfword prev, halfword stop, halfword lig)
+{
+ vlink(lig) = vlink(stop);
+ vlink(stop) = null;
+ lig_ptr(lig) = vlink(prev);
+ vlink(prev) = lig;
+ return lig;
}
/* node.do_ligature_n(node prev, node last, node lig) */
-static int
-lua_nodelib_do_ligature_n (lua_State *L) {
- halfword n, m, o, p, tmp_head;
- n = *(check_isnode(L,1));
- m = *(check_isnode(L,2));
- o = *(check_isnode(L,3));
- if (alink(n)==null || vlink(alink(n))!=n) {
- tmp_head = new_node(temp_node,0);
- couple_nodes(tmp_head,n);
- p = do_ligature_n(tmp_head,m,o);
- flush_node(tmp_head);
- } else {
- p = do_ligature_n(alink(n),m,o);
- }
- lua_pushnumber(L,p);
- lua_nodelib_push(L);
- return 1;
+static int lua_nodelib_do_ligature_n(lua_State * L)
+{
+ halfword n, m, o, p, tmp_head;
+ n = *(check_isnode(L, 1));
+ m = *(check_isnode(L, 2));
+ o = *(check_isnode(L, 3));
+ if (alink(n) == null || vlink(alink(n)) != n) {
+ tmp_head = new_node(temp_node, 0);
+ couple_nodes(tmp_head, n);
+ p = do_ligature_n(tmp_head, m, o);
+ flush_node(tmp_head);
+ } else {
+ p = do_ligature_n(alink(n), m, o);
+ }
+ lua_pushnumber(L, p);
+ lua_nodelib_push(L);
+ return 1;
}
-extern halfword list_node_mem_usage (void) ;
+extern halfword list_node_mem_usage(void);
-static int
-lua_nodelib_usedlist (lua_State *L) {
- lua_pushnumber(L,list_node_mem_usage());
- lua_nodelib_push(L);
- return 1;
-}
-
-
-static const struct luaL_reg nodelib_f [] = {
- {"id", lua_nodelib_id},
- {"subtype", lua_nodelib_subtype},
- {"type", lua_nodelib_type},
- {"new", lua_nodelib_new},
- {"length", lua_nodelib_length},
- {"count", lua_nodelib_count},
- {"traverse", lua_nodelib_traverse},
- {"traverse_id", lua_nodelib_traverse_filtered},
- {"slide", lua_nodelib_tail},
- {"types", lua_nodelib_types},
- {"whatsits", lua_nodelib_whatsits},
- {"fields", lua_nodelib_fields},
- {"has_field", lua_nodelib_has_field},
- {"free", lua_nodelib_free},
- {"flush_list", lua_nodelib_flush_list},
- {"remove", lua_nodelib_remove},
- {"insert_before", lua_nodelib_insert_before},
- {"insert_after", lua_nodelib_insert_after},
- {"write", lua_nodelib_append},
- {"last_node", lua_nodelib_last_node},
- {"copy", lua_nodelib_copy},
- {"copy_list", lua_nodelib_copy_list},
- {"hpack", lua_nodelib_hpack},
- {"has_attribute", lua_nodelib_has_attribute},
- {"set_attribute", lua_nodelib_set_attribute},
- {"unset_attribute", lua_nodelib_unset_attribute},
- {"do_ligature_n", lua_nodelib_do_ligature_n},
- {"ligaturing", font_tex_ligaturing},
- {"kerning", font_tex_kerning},
- {"first_character", lua_nodelib_first_character},
- {"usedlist", lua_nodelib_usedlist},
- {"protect_glyphs", lua_nodelib_protect_glyphs},
- {"unprotect_glyphs", lua_nodelib_unprotect_glyphs},
- {NULL, NULL} /* sentinel */
+static int lua_nodelib_usedlist(lua_State * L)
+{
+ lua_pushnumber(L, list_node_mem_usage());
+ lua_nodelib_push(L);
+ return 1;
+}
+
+
+static const struct luaL_reg nodelib_f[] = {
+ {"id", lua_nodelib_id},
+ {"subtype", lua_nodelib_subtype},
+ {"type", lua_nodelib_type},
+ {"new", lua_nodelib_new},
+ {"length", lua_nodelib_length},
+ {"count", lua_nodelib_count},
+ {"traverse", lua_nodelib_traverse},
+ {"traverse_id", lua_nodelib_traverse_filtered},
+ {"slide", lua_nodelib_tail},
+ {"types", lua_nodelib_types},
+ {"whatsits", lua_nodelib_whatsits},
+ {"fields", lua_nodelib_fields},
+ {"has_field", lua_nodelib_has_field},
+ {"free", lua_nodelib_free},
+ {"flush_list", lua_nodelib_flush_list},
+ {"remove", lua_nodelib_remove},
+ {"insert_before", lua_nodelib_insert_before},
+ {"insert_after", lua_nodelib_insert_after},
+ {"write", lua_nodelib_append},
+ {"last_node", lua_nodelib_last_node},
+ {"copy", lua_nodelib_copy},
+ {"copy_list", lua_nodelib_copy_list},
+ {"hpack", lua_nodelib_hpack},
+ {"vpack", lua_nodelib_vpack},
+ {"mlist_to_hlist", lua_nodelib_mlist_to_hlist},
+ {"family_font", lua_nodelib_mfont},
+ {"has_attribute", lua_nodelib_has_attribute},
+ {"set_attribute", lua_nodelib_set_attribute},
+ {"unset_attribute", lua_nodelib_unset_attribute},
+ {"do_ligature_n", lua_nodelib_do_ligature_n},
+ {"ligaturing", font_tex_ligaturing},
+ {"kerning", font_tex_kerning},
+ {"first_character", lua_nodelib_first_character},
+ {"usedlist", lua_nodelib_usedlist},
+ {"protect_glyphs", lua_nodelib_protect_glyphs},
+ {"unprotect_glyphs", lua_nodelib_unprotect_glyphs},
+ {NULL, NULL} /* sentinel */
};
-static const struct luaL_reg nodelib_m [] = {
- {"__index", lua_nodelib_getfield},
- {"__newindex", lua_nodelib_setfield},
- {"__tostring", lua_nodelib_print},
- {"__eq", lua_nodelib_equal},
- {NULL, NULL} /* sentinel */
+static const struct luaL_reg nodelib_m[] = {
+ {"__index", lua_nodelib_getfield},
+ {"__newindex", lua_nodelib_setfield},
+ {"__tostring", lua_nodelib_print},
+ {"__eq", lua_nodelib_equal},
+ {NULL, NULL} /* sentinel */
};
-int
-luaopen_node (lua_State *L)
+int luaopen_node(lua_State * L)
{
- luaL_newmetatable(L,NODE_METATABLE);
- luaL_register(L, NULL, nodelib_m);
- luaL_register(L, "node", nodelib_f);
- init_luaS_index(luatex_node);
- initialize_luaS_indexes(L);
- return 1;
+ luaL_newmetatable(L, NODE_METATABLE);
+ luaL_register(L, NULL, nodelib_m);
+ luaL_register(L, "node", nodelib_f);
+ init_luaS_index(luatex_node);
+ initialize_luaS_indexes(L);
+ return 1;
}
-void
-nodelist_to_lua (lua_State *L, int n) {
- lua_pushnumber(L,n);
- lua_nodelib_push(L);
+void nodelist_to_lua(lua_State * L, int n)
+{
+ lua_pushnumber(L, n);
+ lua_nodelib_push(L);
}
-int
-nodelist_from_lua (lua_State *L) {
- halfword *n;
- if (lua_isnil(L,-1))
- return null;
- n = check_isnode(L,-1);
- return *n;
+int nodelist_from_lua(lua_State * L)
+{
+ halfword *n;
+ if (lua_isnil(L, -1))
+ return null;
+ n = check_isnode(L, -1);
+ return *n;
}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/loslibext.c b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
index e79e3a52a98..5f5da8dd6f5 100644
--- a/Build/source/texk/web2c/luatexdir/lua/loslibext.c
+++ b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
@@ -1,4 +1,21 @@
-/* $Id: loslibext.c 1066 2008-02-23 10:52:51Z taco $ */
+/* loslibext.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
@@ -7,6 +24,15 @@
#include <sys/types.h>
#include <time.h>
+static const char _svn_version[] =
+ "$Id: loslibext.c 1594 2008-11-28 13:32:48Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/loslibext.c $";
+
+#if defined(_WIN32) || defined(WIN32) || defined(__NT__)
+#define MKDIR(a,b) mkdir(a)
+#else
+#define MKDIR(a,b) mkdir(a,b)
+#endif
+
/* An attempt to figure out the basic platform, does not
care about niceties like version numbers yet,
and ignores platforms where luatex is unlikely to
@@ -14,47 +40,48 @@
(amiga|mac|os2|vms) */
#if defined(_WIN32) || defined(WIN32) || defined(__NT__)
-#define OS_PLATTYPE "windows"
-#define OS_PLATNAME "windows"
-#elif defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
-#define OS_PLATTYPE "msdos"
-#define OS_PLATNAME "msdos"
-#else /* assume everything else is unix-y */
-#define OS_PLATTYPE "unix"
+# define OS_PLATTYPE "windows"
+# define OS_PLATNAME "windows"
+#elif defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
+# define OS_PLATTYPE "msdos"
+# define OS_PLATNAME "msdos"
+#else /* assume everything else is unix-y */
+# include <sys/utsname.h>
+# define OS_PLATTYPE "unix"
/* this is just a first guess */
-#if defined(__BSD__)
- #define OS_PLATNAME "bsd"
-#elif defined(__SYSV__)
- #define OS_PLATNAME "sysv"
-#else
- #define OS_PLATNAME "generic"
-#endif
+# if defined(__BSD__)
+# define OS_PLATNAME "bsd"
+# elif defined(__SYSV__)
+# define OS_PLATNAME "sysv"
+# else
+# define OS_PLATNAME "generic"
+# endif
/* attempt to be more precise */
-#if defined(__LINUX__) || defined (__linux)
- #undef OS_PLATNAME
- #define OS_PLATNAME "linux"
-#elif defined(__FREEBSD__) || defined(__FreeBSD)
- #undef OS_PLATNAME
- #define OS_PLATNAME "freebsd"
-#elif defined(__OPENBSD__) || defined(__OpenBSD)
- #undef OS_PLATNAME
- #define OS_PLATNAME "openbsd"
-#elif defined(__SOLARIS__)
- #undef OS_PLATNAME
- #define OS_PLATNAME "solaris"
-#elif defined(__SUNOS__) || defined(__SUN__) || defined(sun)
- #undef OS_PLATNAME
- #define OS_PLATNAME "sunos"
-#elif defined(HPUX) || defined(__hpux)
- #undef OS_PLATNAME
- #define OS_PLATNAME "hpux"
-#elif defined(__sgi)
- #undef OS_PLATNAME
- #define OS_PLATNAME "irix"
-#elif defined(__MACH__) && defined(__APPLE__)
- #undef OS_PLATNAME
- #define OS_PLATNAME "macosx"
-#endif
+# if defined(__LINUX__) || defined (__linux)
+# undef OS_PLATNAME
+# define OS_PLATNAME "linux"
+# elif defined(__FREEBSD__) || defined(__FreeBSD__) || defined(__FreeBSD)
+# undef OS_PLATNAME
+# define OS_PLATNAME "freebsd"
+# elif defined(__OPENBSD__) || defined(__OpenBSD)
+# undef OS_PLATNAME
+# define OS_PLATNAME "openbsd"
+# elif defined(__SOLARIS__)
+# undef OS_PLATNAME
+# define OS_PLATNAME "solaris"
+# elif defined(__SUNOS__) || defined(__SUN__) || defined(sun)
+# undef OS_PLATNAME
+# define OS_PLATNAME "sunos"
+# elif defined(HPUX) || defined(__hpux)
+# undef OS_PLATNAME
+# define OS_PLATNAME "hpux"
+# elif defined(__sgi)
+# undef OS_PLATNAME
+# define OS_PLATNAME "irix"
+# elif defined(__MACH__) && defined(__APPLE__)
+# undef OS_PLATNAME
+# define OS_PLATNAME "macosx"
+# endif
#endif
@@ -67,77 +94,76 @@
*/
#if (! defined(WIN32)) && (! defined(__SUNOS__))
-#include <sys/time.h> /* gettimeofday() */
-#include <sys/times.h> /* times() */
-#include <sys/wait.h>
-#endif
+# include <sys/time.h> /* gettimeofday() */
+# include <sys/times.h> /* times() */
+# include <sys/wait.h>
+#endif
/* set this to one for spawn instead of exec on windows */
#define DONT_REALLY_EXIT 1
#ifdef WIN32
-#include <process.h>
-#define spawn_command(a,b,c) _spawnvpe(_P_WAIT,(const char *)a,(const char* const*)b,(const char* const*)c)
-#if DONT_REALLY_EXIT
-#define exec_command(a,b,c) exit(spawn_command((a),(b),(c)))
+# include <process.h>
+# define spawn_command(a,b,c) _spawnvpe(_P_WAIT,(const char *)a,(const char* const*)b,(const char* const*)c)
+# if DONT_REALLY_EXIT
+# define exec_command(a,b,c) exit(spawn_command((a),(b),(c)))
+# else
+# define exec_command(a,b,c) _execvpe((const char *)a,(const char* const*)b,(const char* const*)c)
+# endif
#else
-#define exec_command(a,b,c) _execvpe((const char *)a,(const char* const*)b,(const char* const*)c)
-#endif
-#else
-#include <unistd.h>
-#define DEFAULT_PATH "/bin:/usr/bin:."
+# include <unistd.h>
+# define DEFAULT_PATH "/bin:/usr/bin:."
-static int
-exec_command(const char *file, char *const *argv, char *const *envp)
+static int exec_command(const char *file, char *const *argv, char *const *envp)
{
- char path[PATH_MAX];
- const char *searchpath, *esp;
- size_t prefixlen, filelen, totallen;
-
- if (strchr(file, '/')) /* Specific path */
- return execve(file, argv, envp);
-
- filelen = strlen(file);
-
- searchpath = getenv("PATH");
- if (!searchpath)
- searchpath = DEFAULT_PATH;
-
- errno = ENOENT; /* Default errno, if execve() doesn't change it */
-
- do {
- esp = strchr(searchpath, ':');
- if (esp)
- prefixlen = esp - searchpath;
- else
- prefixlen = strlen(searchpath);
-
- if (prefixlen == 0 || searchpath[prefixlen - 1] == '/') {
- totallen = prefixlen + filelen;
- if (totallen >= PATH_MAX)
- continue;
- memcpy(path, searchpath, prefixlen);
- memcpy(path + prefixlen, file, filelen);
- } else {
- totallen = prefixlen + filelen + 1;
- if (totallen >= PATH_MAX)
- continue;
- memcpy(path, searchpath, prefixlen);
- path[prefixlen] = '/';
- memcpy(path + prefixlen + 1, file, filelen);
- }
- path[totallen] = '\0';
-
- execve(path, argv, envp);
- if (errno == E2BIG || errno == ENOEXEC ||
- errno == ENOMEM || errno == ETXTBSY)
- break; /* Report this as an error, no more search */
-
- searchpath = esp + 1;
- } while (esp);
-
- return -1;
+ char path[PATH_MAX];
+ const char *searchpath, *esp;
+ size_t prefixlen, filelen, totallen;
+
+ if (strchr(file, '/')) /* Specific path */
+ return execve(file, argv, envp);
+
+ filelen = strlen(file);
+
+ searchpath = getenv("PATH");
+ if (!searchpath)
+ searchpath = DEFAULT_PATH;
+
+ errno = ENOENT; /* Default errno, if execve() doesn't change it */
+
+ do {
+ esp = strchr(searchpath, ':');
+ if (esp)
+ prefixlen = esp - searchpath;
+ else
+ prefixlen = strlen(searchpath);
+
+ if (prefixlen == 0 || searchpath[prefixlen - 1] == '/') {
+ totallen = prefixlen + filelen;
+ if (totallen >= PATH_MAX)
+ continue;
+ memcpy(path, searchpath, prefixlen);
+ memcpy(path + prefixlen, file, filelen);
+ } else {
+ totallen = prefixlen + filelen + 1;
+ if (totallen >= PATH_MAX)
+ continue;
+ memcpy(path, searchpath, prefixlen);
+ path[prefixlen] = '/';
+ memcpy(path + prefixlen + 1, file, filelen);
+ }
+ path[totallen] = '\0';
+
+ execve(path, argv, envp);
+ if (errno == E2BIG || errno == ENOEXEC ||
+ errno == ENOMEM || errno == ETXTBSY)
+ break; /* Report this as an error, no more search */
+
+ searchpath = esp + 1;
+ } while (esp);
+
+ return -1;
}
/*
@@ -159,61 +185,66 @@ exec_command(const char *file, char *const *argv, char *const *envp)
range in the 8-bit section.
*/
-#define INVALID_RET_E2BIG 143
-#define INVALID_RET_ENOENT 144
-#define INVALID_RET_ENOEXEC 145
-#define INVALID_RET_ENOMEM 146
-#define INVALID_RET_ETXTBSY 147
-#define INVALID_RET_UNKNOWN 148
-#define INVALID_RET_INTR 149
+# define INVALID_RET_E2BIG 143
+# define INVALID_RET_ENOENT 144
+# define INVALID_RET_ENOEXEC 145
+# define INVALID_RET_ENOMEM 146
+# define INVALID_RET_ETXTBSY 147
+# define INVALID_RET_UNKNOWN 148
+# define INVALID_RET_INTR 149
-static int
-spawn_command(const char *file, char *const *argv, char *const *envp)
+static int spawn_command(const char *file, char *const *argv, char *const *envp)
{
- pid_t pid, wait_pid;
- int status;
- pid = fork();
- if (pid<0) {
- return -1; /* fork failed */
- }
- if (pid>0) { /* parent */
- status = 0;
- wait_pid = waitpid (pid, &status,0);
- if (wait_pid == pid) {
- if (WIFEXITED(status))
- return WEXITSTATUS(status);
- else
- return INVALID_RET_INTR;
- } else {
- return -1; /* some waitpid error */
+ pid_t pid, wait_pid;
+ int status;
+ pid = fork();
+ if (pid < 0) {
+ return -1; /* fork failed */
}
- } else {
- int f;
- /* somewhat random upper limit. ignore errors on purpose */
- for (f = 0; f<256; f++)
- (void)fsync(f);
-
- if (exec_command(file, argv, envp)) {
- /* let's hope no-one uses these values */
- switch (errno) {
- case E2BIG: exit(INVALID_RET_E2BIG);
- case ETXTBSY: exit(INVALID_RET_ETXTBSY);
- case ENOENT: exit(INVALID_RET_ENOENT);
- case ENOEXEC: exit(INVALID_RET_ENOEXEC);
- case ENOMEM: exit(INVALID_RET_ENOMEM);
- default: exit(INVALID_RET_UNKNOWN);
- }
- return -1;
+ if (pid > 0) { /* parent */
+ status = 0;
+ wait_pid = waitpid(pid, &status, 0);
+ if (wait_pid == pid) {
+ if (WIFEXITED(status))
+ return WEXITSTATUS(status);
+ else
+ return INVALID_RET_INTR;
+ } else {
+ return -1; /* some waitpid error */
+ }
+ } else {
+ int f;
+ /* somewhat random upper limit. ignore errors on purpose */
+ for (f = 0; f < 256; f++)
+ (void) fsync(f);
+
+ if (exec_command(file, argv, envp)) {
+ /* let's hope no-one uses these values */
+ switch (errno) {
+ case E2BIG:
+ exit(INVALID_RET_E2BIG);
+ case ETXTBSY:
+ exit(INVALID_RET_ETXTBSY);
+ case ENOENT:
+ exit(INVALID_RET_ENOENT);
+ case ENOEXEC:
+ exit(INVALID_RET_ENOEXEC);
+ case ENOMEM:
+ exit(INVALID_RET_ENOMEM);
+ default:
+ exit(INVALID_RET_UNKNOWN);
+ }
+ return -1;
+ }
}
- }
+ return 0;
}
#endif
extern char **environ;
-static char **
-do_split_command(char *maincmd)
+static char **do_split_command(char *maincmd)
{
char *piece, *start_piece;
char *cmd;
@@ -223,299 +254,489 @@ do_split_command(char *maincmd)
int in_string = 0;
int quoted = 0;
if (strlen(maincmd) == 0)
- return NULL;
+ return NULL;
/* allocate the array of options first. it will probably be
be a little bit too big, but better too much than to little */
- j=2;
- for (i = 0; i < strlen(maincmd); i++) { if (maincmd[i]==' ') j++; }
+ j = 2;
+ for (i = 0; i < strlen(maincmd); i++) {
+ if (maincmd[i] == ' ')
+ j++;
+ }
cmdline = malloc(sizeof(char *) * j);
- for (i = 0; i < j; i++) { cmdline[i] = NULL; }
+ for (i = 0; i < j; i++) {
+ cmdline[i] = NULL;
+ }
cmd = maincmd;
i = 0;
- while (cmd[i] == ' ') i++; /* skip leading spaces */
- start_piece = malloc(strlen(cmd)+1); /* a buffer */
+ while (cmd[i] == ' ')
+ i++; /* skip leading spaces */
+ start_piece = malloc(strlen(cmd) + 1); /* a buffer */
piece = start_piece;
for (; i <= strlen(maincmd); i++) {
- if (cmd[i]=='\\' &&
- (cmd[i+1] == '\\' || cmd[i+1] == '\'' || cmd[i+1] == '"')) {
- quoted =1;
- continue;
- }
- if (in_string && cmd[i] == in_string && !quoted) {
- in_string = 0;
- continue;
- }
- if ((cmd[i] == '"' || cmd[i] == '\'')&& !quoted) {
- in_string = cmd[i];
- continue;
- }
- if ((in_string==0 && cmd[i] == ' ') || cmd[i]==0) {
- *piece = 0;
- cmdline[ret++] = xstrdup(start_piece);
- piece = start_piece;
- while (i < strlen(maincmd) && cmd[(i + 1)] == ' ')
- i++;
- continue;
- }
- *piece++ = cmd[i];
- quoted=0;
+ if (cmd[i] == '\\' &&
+ (cmd[i + 1] == '\\' || cmd[i + 1] == '\'' || cmd[i + 1] == '"')) {
+ quoted = 1;
+ continue;
+ }
+ if (in_string && cmd[i] == in_string && !quoted) {
+ in_string = 0;
+ continue;
+ }
+ if ((cmd[i] == '"' || cmd[i] == '\'') && !quoted) {
+ in_string = cmd[i];
+ continue;
+ }
+ if ((in_string == 0 && cmd[i] == ' ') || cmd[i] == 0) {
+ *piece = 0;
+ cmdline[ret++] = xstrdup(start_piece);
+ piece = start_piece;
+ while (i < strlen(maincmd) && cmd[(i + 1)] == ' ')
+ i++;
+ continue;
+ }
+ *piece++ = cmd[i];
+ quoted = 0;
}
xfree(start_piece);
return cmdline;
}
-static char **
-do_flatten_command(lua_State *L, char **runcmd) {
- unsigned int i, j ;
- char *s;
- char **cmdline = NULL;
- *runcmd = NULL;
-
- for (j = 1;;j++) {
- lua_rawgeti(L,-1,j);
- if (lua_isnil(L,-1)) {
- lua_pop(L,1);
- break;
- }
- lua_pop(L,1);
- }
- if (j == 1)
- return NULL;
- cmdline = malloc(sizeof(char *) * (j+1));
- for (i = 1; i <= j; i++) {
- cmdline[i] = NULL;
- lua_rawgeti(L,-1,i);
- if (lua_isnil(L,-1) || (s=(char *)lua_tostring(L,-1))==NULL) {
- lua_pop(L,1);
- if (i==1) {
- xfree(cmdline) ;
- return NULL;
- } else {
- break;
- }
- } else {
- lua_pop(L,1);
- cmdline[(i-1)] = xstrdup(s);
- }
- }
- cmdline[i] = NULL;
-
- lua_rawgeti(L,-1,0);
- if (lua_isnil(L,-1) || (s=(char *)lua_tostring(L,-1))==NULL) {
- *runcmd = cmdline[0];
- } else {
- *runcmd = xstrdup(s);
- }
- lua_pop(L,1);
-
- return cmdline;
+static char **do_flatten_command(lua_State * L, char **runcmd)
+{
+ unsigned int i, j;
+ char *s;
+ char **cmdline = NULL;
+ *runcmd = NULL;
+
+ for (j = 1;; j++) {
+ lua_rawgeti(L, -1, j);
+ if (lua_isnil(L, -1)) {
+ lua_pop(L, 1);
+ break;
+ }
+ lua_pop(L, 1);
+ }
+ if (j == 1)
+ return NULL;
+ cmdline = malloc(sizeof(char *) * (j + 1));
+ for (i = 1; i <= j; i++) {
+ cmdline[i] = NULL;
+ lua_rawgeti(L, -1, i);
+ if (lua_isnil(L, -1) || (s = (char *) lua_tostring(L, -1)) == NULL) {
+ lua_pop(L, 1);
+ if (i == 1) {
+ xfree(cmdline);
+ return NULL;
+ } else {
+ break;
+ }
+ } else {
+ lua_pop(L, 1);
+ cmdline[(i - 1)] = xstrdup(s);
+ }
+ }
+ cmdline[i] = NULL;
+
+ lua_rawgeti(L, -1, 0);
+ if (lua_isnil(L, -1) || (s = (char *) lua_tostring(L, -1)) == NULL) {
+ *runcmd = cmdline[0];
+ } else {
+ *runcmd = xstrdup(s);
+ }
+ lua_pop(L, 1);
+
+ return cmdline;
}
-static int os_exec (lua_State *L) {
- char * maincmd, * runcmd;
- char ** cmdline = NULL;
+static int os_exec(lua_State * L)
+{
+ char *maincmd, *runcmd;
+ char **cmdline = NULL;
- if (lua_gettop(L)!=1) {
- lua_pushnil(L);
- lua_pushliteral(L,"invalid arguments passed");
- return 2;
- }
- if (lua_type(L,1)==LUA_TSTRING) {
- maincmd = (char *)lua_tostring(L, 1);
- cmdline = do_split_command(maincmd);
- runcmd = cmdline[0];
- } else if (lua_type(L,1)==LUA_TTABLE) {
- cmdline = do_flatten_command(L, & runcmd);
- }
- if (cmdline!=NULL) {
+ if (lua_gettop(L) != 1) {
+ lua_pushnil(L);
+ lua_pushliteral(L, "invalid arguments passed");
+ return 2;
+ }
+ if (lua_type(L, 1) == LUA_TSTRING) {
+ maincmd = (char *) lua_tostring(L, 1);
+ cmdline = do_split_command(maincmd);
+ runcmd = cmdline[0];
+ } else if (lua_type(L, 1) == LUA_TTABLE) {
+ cmdline = do_flatten_command(L, &runcmd);
+ }
+ if (cmdline != NULL) {
#if defined(WIN32) && DONT_REALLY_EXIT
- exec_command(runcmd, cmdline, environ);
+ exec_command(runcmd, cmdline, environ);
#else
- if (exec_command(runcmd, cmdline, environ)==-1) {
- lua_pushnil(L);
- lua_pushfstring(L,"%s: %s",runcmd, strerror(errno));
- lua_pushnumber(L, errno);
- return 3;
- }
+ if (exec_command(runcmd, cmdline, environ) == -1) {
+ lua_pushnil(L);
+ lua_pushfstring(L, "%s: %s", runcmd, strerror(errno));
+ lua_pushnumber(L, errno);
+ return 3;
+ }
#endif
- }
- lua_pushnil(L);
- lua_pushliteral(L,"invalid command line passed");
- return 2;
+ }
+ lua_pushnil(L);
+ lua_pushliteral(L, "invalid command line passed");
+ return 2;
}
-#define do_error_return(A,B) do { \
- lua_pushnil(L); \
- lua_pushfstring(L,"%s: %s",runcmd,(A)); \
- lua_pushnumber(L, B); \
- return 3; \
+#define do_error_return(A,B) do { \
+ lua_pushnil(L); \
+ lua_pushfstring(L,"%s: %s",runcmd,(A)); \
+ lua_pushnumber(L, B); \
+ return 3; \
} while (0)
-static int os_spawn (lua_State *L) {
- char * maincmd, * runcmd;
- char ** cmdline = NULL;
- int i;
+static int os_spawn(lua_State * L)
+{
+ char *maincmd, *runcmd;
+ char **cmdline = NULL;
+ int i;
- if (lua_gettop(L)!=1) {
- lua_pushnil(L);
- lua_pushliteral(L,"invalid arguments passed");
- return 2;
- }
- if (lua_type(L,1)==LUA_TSTRING) {
- maincmd = (char *)lua_tostring(L, 1);
- cmdline = do_split_command(maincmd);
- runcmd = cmdline[0];
- } else if (lua_type(L,1)==LUA_TTABLE) {
- cmdline = do_flatten_command(L, &runcmd);
- }
- if (cmdline!=NULL) {
- i = spawn_command(runcmd, cmdline, environ);
- if (i==0) {
- lua_pushnumber(L, i);
- return 1;
- } else if (i==-1) {
- /* this branch covers WIN32 as well as fork() and waitpid() errors */
- do_error_return(strerror(errno),errno);
+ if (lua_gettop(L) != 1) {
+ lua_pushnil(L);
+ lua_pushliteral(L, "invalid arguments passed");
+ return 2;
+ }
+ if (lua_type(L, 1) == LUA_TSTRING) {
+ maincmd = (char *) lua_tostring(L, 1);
+ cmdline = do_split_command(maincmd);
+ runcmd = cmdline[0];
+ } else if (lua_type(L, 1) == LUA_TTABLE) {
+ cmdline = do_flatten_command(L, &runcmd);
+ }
+ if (cmdline != NULL) {
+ i = spawn_command(runcmd, cmdline, environ);
+ if (i == 0) {
+ lua_pushnumber(L, i);
+ return 1;
+ } else if (i == -1) {
+ /* this branch covers WIN32 as well as fork() and waitpid() errors */
+ do_error_return(strerror(errno), errno);
#ifndef WIN32
- } else if (i==INVALID_RET_E2BIG) { do_error_return(strerror(E2BIG),i);
- } else if (i==INVALID_RET_ENOENT) { do_error_return(strerror(ENOENT),i);
- } else if (i==INVALID_RET_ENOEXEC) { do_error_return(strerror(ENOEXEC),i);
- } else if (i==INVALID_RET_ENOMEM) { do_error_return(strerror(ENOMEM),i);
- } else if (i==INVALID_RET_ETXTBSY) { do_error_return(strerror(ETXTBSY),i);
- } else if (i==INVALID_RET_UNKNOWN) { do_error_return("execution failed",i);
- } else if (i==INVALID_RET_INTR) { do_error_return("execution interrupted",i);
+ } else if (i == INVALID_RET_E2BIG) {
+ do_error_return(strerror(E2BIG), i);
+ } else if (i == INVALID_RET_ENOENT) {
+ do_error_return(strerror(ENOENT), i);
+ } else if (i == INVALID_RET_ENOEXEC) {
+ do_error_return(strerror(ENOEXEC), i);
+ } else if (i == INVALID_RET_ENOMEM) {
+ do_error_return(strerror(ENOMEM), i);
+ } else if (i == INVALID_RET_ETXTBSY) {
+ do_error_return(strerror(ETXTBSY), i);
+ } else if (i == INVALID_RET_UNKNOWN) {
+ do_error_return("execution failed", i);
+ } else if (i == INVALID_RET_INTR) {
+ do_error_return("execution interrupted", i);
#endif
- } else {
- lua_pushnumber(L, i);
- return 1;
+ } else {
+ lua_pushnumber(L, i);
+ return 1;
+ }
}
- }
- lua_pushnil(L);
- lua_pushliteral(L,"invalid command line passed");
- return 2;
+ lua_pushnil(L);
+ lua_pushliteral(L, "invalid command line passed");
+ return 2;
}
/* Hans wants to set env values */
-static int os_setenv (lua_State *L) {
- char *value, *key, *val;
- key = (char *)luaL_optstring(L, 1, NULL);
- val = (char *)luaL_optstring(L, 2, NULL);
- if (key) {
- if (val) {
- value = xmalloc(strlen(key)+strlen(val)+2);
- sprintf(value,"%s=%s",key,val);
- if (putenv(value)) {
- return luaL_error(L, "unable to change environment");
- }
- } else {
+static int os_setenv(lua_State * L)
+{
+ char *value, *key, *val;
+ key = (char *) luaL_optstring(L, 1, NULL);
+ val = (char *) luaL_optstring(L, 2, NULL);
+ if (key) {
+ if (val) {
+ value = xmalloc(strlen(key) + strlen(val) + 2);
+ sprintf(value, "%s=%s", key, val);
+ if (putenv(value)) {
+ return luaL_error(L, "unable to change environment");
+ }
+ } else {
#if defined(WIN32) || defined(__sun__) || defined(__sun) || defined(_AIX)
- value = xmalloc(strlen(key)+2);
- sprintf(value,"%s=",key);
- if (putenv(value)) {
- return luaL_error(L, "unable to change environment");
- }
+ value = xmalloc(strlen(key) + 2);
+ sprintf(value, "%s=", key);
+ if (putenv(value)) {
+ return luaL_error(L, "unable to change environment");
+ }
#else
- (void)unsetenv(key);
-#endif
- }
- }
- lua_pushboolean (L, 1);
- return 1;
+ (void) unsetenv(key);
+#endif
+ }
+ }
+ lua_pushboolean(L, 1);
+ return 1;
}
-void find_env (lua_State *L){
- char *envitem, *envitem_orig;
- char *envkey;
- char **envpointer;
- envpointer = environ;
- lua_getglobal(L,"os");
- if (envpointer!=NULL && lua_istable(L,-1)) {
- luaL_checkstack(L,2,"out of stack space");
- lua_pushstring(L,"env");
- lua_newtable(L);
- while (*envpointer) {
- /* TODO: perhaps a memory leak here */
- luaL_checkstack(L,2,"out of stack space");
- envitem = xstrdup(*envpointer);
- envitem_orig = envitem;
- envkey=envitem;
- while (*envitem != '=') {
- envitem++;
- }
- *envitem=0;
- envitem++;
- lua_pushstring(L,envkey);
- lua_pushstring(L,envitem);
- lua_rawset(L,-3);
- envpointer++;
- free(envitem_orig);
+void find_env(lua_State * L)
+{
+ char *envitem, *envitem_orig;
+ char *envkey;
+ char **envpointer;
+ envpointer = environ;
+ lua_getglobal(L, "os");
+ if (envpointer != NULL && lua_istable(L, -1)) {
+ luaL_checkstack(L, 2, "out of stack space");
+ lua_pushstring(L, "env");
+ lua_newtable(L);
+ while (*envpointer) {
+ /* TODO: perhaps a memory leak here */
+ luaL_checkstack(L, 2, "out of stack space");
+ envitem = xstrdup(*envpointer);
+ envitem_orig = envitem;
+ envkey = envitem;
+ while (*envitem != '=') {
+ envitem++;
+ }
+ *envitem = 0;
+ envitem++;
+ lua_pushstring(L, envkey);
+ lua_pushstring(L, envitem);
+ lua_rawset(L, -3);
+ envpointer++;
+ free(envitem_orig);
+ }
+ lua_rawset(L, -3);
}
- lua_rawset(L,-3);
- }
- lua_pop(L,1);
+ lua_pop(L, 1);
}
-static int ex_sleep(lua_State *L)
+static int ex_sleep(lua_State * L)
{
- lua_Number interval = luaL_checknumber(L, 1);
- lua_Number units = luaL_optnumber(L, 2, 1);
+ lua_Number interval = luaL_checknumber(L, 1);
+ lua_Number units = luaL_optnumber(L, 2, 1);
#ifdef WIN32
- Sleep(1e3 * interval / units);
-#else /* assumes posix or bsd */
- usleep(1e6 * interval / units);
+ Sleep(1e3 * interval / units);
+#else /* assumes posix or bsd */
+ usleep(1e6 * interval / units);
#endif
- return 0;
+ return 0;
}
-#if (! defined (WIN32)) && (! defined (__SUNOS__))
-static int os_times (lua_State *L) {
- struct tms r;
- (void)times(&r);
- lua_newtable(L);
- lua_pushnumber(L, ((lua_Number)(r.tms_utime))/(lua_Number)sysconf(_SC_CLK_TCK));
- lua_setfield(L,-2,"utime");
- lua_pushnumber(L, ((lua_Number)(r.tms_stime))/(lua_Number)sysconf(_SC_CLK_TCK));
- lua_setfield(L,-2,"stime");
- lua_pushnumber(L, ((lua_Number)(r.tms_cutime))/(lua_Number)sysconf(_SC_CLK_TCK));
- lua_setfield(L,-2,"cutime");
- lua_pushnumber(L, ((lua_Number)(r.tms_cstime))/(lua_Number)sysconf(_SC_CLK_TCK));
- lua_setfield(L,-2,"cstime");
- return 1;
+
+
+#ifdef WIN32
+# define _UTSNAME_LENGTH 65
+
+/* Structure describing the system and machine. */
+struct utsname {
+ char sysname[_UTSNAME_LENGTH];
+ char nodename[_UTSNAME_LENGTH];
+ char release[_UTSNAME_LENGTH];
+ char version[_UTSNAME_LENGTH];
+ char machine[_UTSNAME_LENGTH];
+};
+
+/*
+ * Get name and information about current kernel.
+ */
+static int uname(struct utsname *uts)
+{
+ enum { WinNT, Win95, Win98, WinUnknown };
+ OSVERSIONINFO osver;
+ SYSTEM_INFO sysinfo;
+ DWORD sLength;
+ DWORD os = WinUnknown;
+
+ memset(uts, 0, sizeof(*uts));
+
+ osver.dwOSVersionInfoSize = sizeof(osver);
+ GetVersionEx(&osver);
+ GetSystemInfo(&sysinfo);
+
+ switch (osver.dwPlatformId) {
+ case VER_PLATFORM_WIN32_NT: /* NT, Windows 2000 or Windows XP */
+ if (osver.dwMajorVersion == 4)
+ strcpy(uts->sysname, "Windows NT4x"); /* NT4x */
+ else if (osver.dwMajorVersion <= 3)
+ strcpy(uts->sysname, "Windows NT3x"); /* NT3x */
+ else if (osver.dwMajorVersion == 5) {
+ if (osver.dwMinorVersion == 0)
+ strcpy(uts->sysname, "Windows 2000"); /* 2k */
+ else if (osver.dwMinorVersion == 1)
+ strcpy(uts->sysname, "Windows XP"); /* XP */
+ else if (osver.dwMinorVersion == 2)
+ strcpy(uts->sysname, "Windows Server 2003"); /* Server 2003 */
+ } else if (osver.dwMajorVersion == 6) {
+ /*
+ if( osver.wProductType == VER_NT_WORKSTATION )
+ */
+ strcpy(uts->sysname, "Windows Vista"); /* Vista */
+ /*
+ else
+ strcpy (uts->sysname, "Windows Server 2008");
+ */
+ }
+ os = WinNT;
+ break;
+
+ case VER_PLATFORM_WIN32_WINDOWS: /* Win95, Win98 or WinME */
+ if ((osver.dwMajorVersion > 4) ||
+ ((osver.dwMajorVersion == 4) && (osver.dwMinorVersion > 0))) {
+ if (osver.dwMinorVersion >= 90)
+ strcpy(uts->sysname, "Windows ME"); /* ME */
+ else
+ strcpy(uts->sysname, "Windows 98"); /* 98 */
+ os = Win98;
+ } else {
+ strcpy(uts->sysname, "Windows 95"); /* 95 */
+ os = Win95;
+ }
+ break;
+
+ case VER_PLATFORM_WIN32s: /* Windows 3.x */
+ strcpy(uts->sysname, "Windows");
+ break;
+
+ default: /* anything else */
+ strcpy(uts->sysname, "Windows");
+ break;
+ }
+
+ sprintf(uts->version, "%ld.%02ld",
+ osver.dwMajorVersion, osver.dwMinorVersion);
+
+ if (osver.szCSDVersion[0] != '\0' &&
+ (strlen(osver.szCSDVersion) + strlen(uts->version) + 1) <
+ sizeof(uts->version)) {
+ strcat(uts->version, " ");
+ strcat(uts->version, osver.szCSDVersion);
+ }
+
+ sprintf(uts->release, "build %ld", osver.dwBuildNumber & 0xFFFF);
+
+ switch (sysinfo.wProcessorArchitecture) {
+ case PROCESSOR_ARCHITECTURE_PPC:
+ strcpy(uts->machine, "ppc");
+ break;
+ case PROCESSOR_ARCHITECTURE_ALPHA:
+ strcpy(uts->machine, "alpha");
+ break;
+ case PROCESSOR_ARCHITECTURE_MIPS:
+ strcpy(uts->machine, "mips");
+ break;
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ /*
+ * dwProcessorType is only valid in Win95 and Win98 and WinME
+ * wProcessorLevel is only valid in WinNT
+ */
+ switch (os) {
+ case Win95:
+ case Win98:
+ switch (sysinfo.dwProcessorType) {
+ case PROCESSOR_INTEL_386:
+ case PROCESSOR_INTEL_486:
+ case PROCESSOR_INTEL_PENTIUM:
+ sprintf(uts->machine, "i%ld", sysinfo.dwProcessorType);
+ break;
+ default:
+ strcpy(uts->machine, "i386");
+ break;
+ }
+ break;
+ case WinNT:
+ sprintf(uts->machine, "i%d86", sysinfo.wProcessorLevel);
+ break;
+ default:
+ strcpy(uts->machine, "unknown");
+ break;
+ }
+ break;
+ default:
+ strcpy(uts->machine, "unknown");
+ break;
+ }
+
+ sLength = sizeof(uts->nodename) - 1;
+ GetComputerName(uts->nodename, &sLength);
+ return 0;
}
#endif
-#if ! defined (__SUNOS__)
-#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
- #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
-#else
- #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
+static int ex_uname(lua_State * L)
+{
+ struct utsname uts;
+ if (uname(&uts) >= 0) {
+ lua_newtable(L);
+ lua_pushstring(L, uts.sysname);
+ lua_setfield(L, -2, "sysname");
+ lua_pushstring(L, uts.machine);
+ lua_setfield(L, -2, "machine");
+ lua_pushstring(L, uts.release);
+ lua_setfield(L, -2, "release");
+ lua_pushstring(L, uts.version);
+ lua_setfield(L, -2, "version");
+ lua_pushstring(L, uts.nodename);
+ lua_setfield(L, -2, "nodename");
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+
+#if (! defined (WIN32)) && (! defined (__SUNOS__))
+static int os_times(lua_State * L)
+{
+ struct tms r;
+ (void) times(&r);
+ lua_newtable(L);
+ lua_pushnumber(L,
+ ((lua_Number) (r.tms_utime)) /
+ (lua_Number) sysconf(_SC_CLK_TCK));
+ lua_setfield(L, -2, "utime");
+ lua_pushnumber(L,
+ ((lua_Number) (r.tms_stime)) /
+ (lua_Number) sysconf(_SC_CLK_TCK));
+ lua_setfield(L, -2, "stime");
+ lua_pushnumber(L,
+ ((lua_Number) (r.tms_cutime)) /
+ (lua_Number) sysconf(_SC_CLK_TCK));
+ lua_setfield(L, -2, "cutime");
+ lua_pushnumber(L,
+ ((lua_Number) (r.tms_cstime)) /
+ (lua_Number) sysconf(_SC_CLK_TCK));
+ lua_setfield(L, -2, "cstime");
+ return 1;
+}
#endif
-static int os_gettimeofday (lua_State *L) {
- double v;
-#ifndef WIN32
- struct timeval tv;
- gettimeofday(&tv, NULL);
- v = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
-#else
- FILETIME ft;
- unsigned __int64 tmpres = 0;
+#if ! defined (__SUNOS__)
- GetSystemTimeAsFileTime(&ft);
+# if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
+# define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
+# else
+# define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
+# endif
- tmpres |= ft.dwHighDateTime;
- tmpres <<= 32;
- tmpres |= ft.dwLowDateTime;
- tmpres /= 10;
- tmpres -= DELTA_EPOCH_IN_MICROSECS; /*converting file time to unix epoch*/
- v = (double)tmpres / 1000000.0;
-#endif
- lua_pushnumber(L, v);
- return 1;
+static int os_gettimeofday(lua_State * L)
+{
+ double v;
+# ifndef WIN32
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ v = (double) tv.tv_sec + (double) tv.tv_usec / 1000000.0;
+# else
+ FILETIME ft;
+ unsigned __int64 tmpres = 0;
+
+ GetSystemTimeAsFileTime(&ft);
+
+ tmpres |= ft.dwHighDateTime;
+ tmpres <<= 32;
+ tmpres |= ft.dwLowDateTime;
+ tmpres /= 10;
+ tmpres -= DELTA_EPOCH_IN_MICROSECS; /*converting file time to unix epoch */
+ v = (double) tmpres / 1000000.0;
+# endif
+ lua_pushnumber(L, v);
+ return 1;
}
#endif
@@ -525,103 +746,110 @@ static int dirs_made = 0;
#define MAXTRIES 36*36*36
-char *
-do_mkdtemp (char *tmpl)
+char *do_mkdtemp(char *tmpl)
{
- int count ;
- int value ;
- char *xes = &tmpl[strlen (tmpl) - 6];
- /* this is not really all that random, but it will do */
- if (dirs_made==0) {
- srand(time(NULL));
- }
- value = rand();
- for (count = 0; count < MAXTRIES; value += 8413, ++count) {
- int v = value;
- xes[0] = repl[v % 36]; v /= 36;
- xes[1] = repl[v % 36]; v /= 36;
- xes[2] = repl[v % 36]; v /= 36;
- xes[3] = repl[v % 36]; v /= 36;
- xes[4] = repl[v % 36]; v /= 36;
- xes[5] = repl[v % 36];
- if (mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR) >= 0) {
- dirs_made++;
- return tmpl;
- } else if (errno != EEXIST) {
- return NULL;
- }
+ int count;
+ int value;
+ char *xes = &tmpl[strlen(tmpl) - 6];
+ /* this is not really all that random, but it will do */
+ if (dirs_made == 0) {
+ srand(time(NULL));
+ }
+ value = rand();
+ for (count = 0; count < MAXTRIES; value += 8413, ++count) {
+ int v = value;
+ xes[0] = repl[v % 36];
+ v /= 36;
+ xes[1] = repl[v % 36];
+ v /= 36;
+ xes[2] = repl[v % 36];
+ v /= 36;
+ xes[3] = repl[v % 36];
+ v /= 36;
+ xes[4] = repl[v % 36];
+ v /= 36;
+ xes[5] = repl[v % 36];
+ if (MKDIR(tmpl, S_IRUSR | S_IWUSR | S_IXUSR) >= 0) {
+ dirs_made++;
+ return tmpl;
+ } else if (errno != EEXIST) {
+ return NULL;
+ }
}
- return NULL;
+ return NULL;
}
-static int os_tmpdir (lua_State *L) {
- char *s, *tempdir;
- char *tmp = (char *)luaL_optstring(L, 1, "luatex.XXXXXX");
- if (tmp==NULL ||
- strlen(tmp)<6 ||
- (strcmp(tmp+strlen(tmp)-6,"XXXXXX") != 0)) {
- lua_pushnil(L);
- lua_pushstring(L, "Invalid argument to os.tmpdir()");
- return 2;
- } else {
- tempdir = xstrdup(tmp);
- }
+static int os_tmpdir(lua_State * L)
+{
+ char *s, *tempdir;
+ char *tmp = (char *) luaL_optstring(L, 1, "luatex.XXXXXX");
+ if (tmp == NULL ||
+ strlen(tmp) < 6 || (strcmp(tmp + strlen(tmp) - 6, "XXXXXX") != 0)) {
+ lua_pushnil(L);
+ lua_pushstring(L, "Invalid argument to os.tmpdir()");
+ return 2;
+ } else {
+ tempdir = xstrdup(tmp);
+ }
#ifdef HAVE_MKDTEMP
- s = mkdtemp(tempdir);
+ s = mkdtemp(tempdir);
#else
- s = do_mkdtemp(tempdir);
+ s = do_mkdtemp(tempdir);
#endif
- if (s==NULL) {
- int en = errno; /* calls to Lua API may change this value */
- lua_pushnil(L);
- lua_pushfstring(L, "%s", strerror(en));
- return 2;
- } else {
- lua_pushstring(L,s);
- return 1;
- }
+ if (s == NULL) {
+ int en = errno; /* calls to Lua API may change this value */
+ lua_pushnil(L);
+ lua_pushfstring(L, "%s", strerror(en));
+ return 2;
+ } else {
+ lua_pushstring(L, s);
+ return 1;
+ }
}
-void
-open_oslibext (lua_State *L, int safer_option) {
-
- find_env(L);
+void open_oslibext(lua_State * L, int safer_option)
+{
- lua_getglobal(L,"os");
- lua_pushcfunction(L, ex_sleep);
- lua_setfield(L,-2,"sleep");
- lua_getglobal(L,"os");
- lua_pushliteral(L, OS_PLATTYPE);
- lua_setfield(L,-2,"type");
- lua_getglobal(L,"os");
- lua_pushliteral(L, OS_PLATNAME);
- lua_setfield(L,-2,"name");
+ find_env(L);
+
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, ex_sleep);
+ lua_setfield(L, -2, "sleep");
+ lua_getglobal(L, "os");
+ lua_pushliteral(L, OS_PLATTYPE);
+ lua_setfield(L, -2, "type");
+ lua_getglobal(L, "os");
+ lua_pushliteral(L, OS_PLATNAME);
+ lua_setfield(L, -2, "name");
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, ex_uname);
+ lua_setfield(L, -2, "uname");
#if (! defined (WIN32)) && (! defined (__SUNOS__))
- lua_getglobal(L,"os");
- lua_pushcfunction(L, os_times);
- lua_setfield(L,-2,"times");
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, os_times);
+ lua_setfield(L, -2, "times");
#endif
#if ! defined (__SUNOS__)
- lua_getglobal(L,"os");
- lua_pushcfunction(L, os_gettimeofday);
- lua_setfield(L,-2,"gettimeofday");
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, os_gettimeofday);
+ lua_setfield(L, -2, "gettimeofday");
#endif
- if (!safer_option) {
- lua_getglobal(L,"os");
- lua_pushcfunction(L, os_setenv);
- lua_setfield(L,-2,"setenv");
- lua_getglobal(L,"os");
- lua_pushcfunction(L, os_exec);
- lua_setfield(L,-2,"exec");
- lua_getglobal(L,"os");
- lua_pushcfunction(L, os_spawn);
- lua_setfield(L,-2,"spawn");
- lua_getglobal(L,"os");
- lua_pushcfunction(L, os_tmpdir);
- lua_setfield(L,-2,"tmpdir");
-
- }
+ if (!safer_option) {
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, os_setenv);
+ lua_setfield(L, -2, "setenv");
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, os_exec);
+ lua_setfield(L, -2, "exec");
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, os_spawn);
+ lua_setfield(L, -2, "spawn");
+ lua_getglobal(L, "os");
+ lua_pushcfunction(L, os_tmpdir);
+ lua_setfield(L, -2, "tmpdir");
+
+ }
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
index 393409b0729..6c1558e47a6 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
@@ -1,8 +1,27 @@
-/* $Id: lpdflib.c 1154 2008-04-13 22:36:03Z oneiros $ */
+/* lpdflib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
+static const char _svn_version[] =
+ "$Id: lpdflib.c 2072 2009-03-21 08:50:20Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/lpdflib.c $";
static int findcurv(lua_State * L)
{
@@ -20,7 +39,6 @@ static int findcurh(lua_State * L)
return 1;
}
-
typedef enum { set_origin, direct_page, direct_always } pdf_lit_mode;
int luapdfprint(lua_State * L)
@@ -57,13 +75,15 @@ int luapdfprint(lua_State * L)
lua_error(L);
}
}
+ check_pdfminorversion();
switch (literal_mode) {
case (set_origin):
- pdf_end_text();
- pdf_set_origin(cur_h, cur_v);
+ pdf_goto_pagemode();
+ pos = synch_p_with_c(cur);
+ pdf_set_pos(pos.h, pos.v);
break;
case (direct_page):
- pdf_end_text();
+ pdf_goto_pagemode();
break;
case (direct_always):
pdf_end_string_nl();
@@ -80,15 +100,25 @@ int luapdfprint(lua_State * L)
return 0;
}
+/* DANGER! this should go into some header file */
#define obj_type_others 0
static int l_immediateobj(lua_State * L)
{
+ unsigned i;
+ size_t len;
+ const char *st;
if (!lua_isstring(L, -1))
luaL_error(L, "pdf.immediateobj needs string value");
pdf_create_obj(obj_type_others, 0);
pdf_begin_obj(obj_ptr, 1);
- pdf_printf("%s\n", lua_tostring(L, -1));
+ st = lua_tolstring(L, -1, &len);
+ for (i = 0; i < len; i++) {
+ if (i % 16 == 0)
+ pdfroom(16);
+ pdf_buf[pdf_ptr++] = st[i];
+ }
+ pdf_puts("\n");
pdf_end_obj();
lua_pop(L, 1);
lua_pushinteger(L, obj_ptr);
diff --git a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
index 025e851e775..586ded0db4f 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lstatslib.c
@@ -1,211 +1,248 @@
-/* $Id: lstatslib.c 1013 2008-02-14 00:09:02Z oneiros $ */
+/* lstatslib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
+
+static const char _svn_version[] =
+ "$Id: lstatslib.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/lstatslib.c $";
+
typedef struct statistic {
- const char *name;
- char type;
- void *value;
-} statistic ;
+ const char *name;
+ char type;
+ void *value;
+} statistic;
extern char *ptexbanner;
-/* extern string getcurrentfilenamestring; */
+extern void lua_nodelib_push_fast(lua_State * L, halfword n);
-typedef char * (*charfunc)(void);
-typedef integer (*intfunc)(void);
+typedef char *(*charfunc) (void);
+typedef integer(*intfunc) (void);
-char *getbanner (void) {
- return ptexbanner;
+char *getbanner(void)
+{
+ return ptexbanner;
}
/* hack, I really should implement the makecstring */
-char *getfilename (void) {
- integer t;
- t = get_current_name();
- if (t>(1<<21))
- return makecstring(t);
- else
- return xstrdup ("");
+char *getfilename(void)
+{
+ integer t;
+ t = get_current_name();
+ if (t > (1 << 21))
+ return makecstring(t);
+ else
+ return xstrdup("");
}
-char *getlasterror (void) {
- return makecstring(last_error);
+char *getlasterror(void)
+{
+ return makecstring(last_error);
}
extern int luabytecode_max;
extern int luabytecode_bytes;
-extern int luastate_max;
+static int luastate_max = 1; /* fixed value */
extern int luastate_bytes;
+extern int callback_count;
+extern int saved_callback_count;
static struct statistic stats[] = {
- { "pdf_gone", 'g', &pdf_gone },
- { "pdf_ptr", 'g', &pdf_ptr },
- { "dvi_gone", 'g', &dvi_offset },
- { "dvi_ptr", 'g', &dvi_ptr },
- { "total_pages", 'g', &total_pages },
- { "output_file_name", 's', &output_file_name },
- { "log_name", 's', &texmf_log_name }, /* weird */
- { "banner", 'S', &getbanner },
- { "pdftex_banner", 's', &pdftex_banner },
- /*
- * mem stat
- */
- { "var_used", 'g', &var_used },
- { "dyn_used", 'g', &dyn_used },
- /*
- * traditional tex stats
- */
- { "str_ptr", 'g', &str_ptr },
- { "init_str_ptr", 'g', &init_str_ptr },
- { "max_strings", 'g', &max_strings },
- { "pool_ptr", 'g', &pool_ptr },
- { "init_pool_ptr", 'g', &init_pool_ptr },
- { "pool_size", 'g', &pool_size },
- { "var_mem_max", 'g', &var_mem_max },
- { "node_mem_usage", 'S', &sprint_node_mem_usage },
- { "fix_mem_max", 'g', &fix_mem_max },
- { "fix_mem_min", 'g', &fix_mem_min },
- { "fix_mem_end", 'g', &fix_mem_end },
- { "cs_count", 'g', &cs_count },
- { "hash_size", 'G', &get_hash_size },
- { "hash_extra", 'g', &hash_extra },
- { "font_ptr", 'G', &max_font_id },
- { "max_in_stack", 'g', &max_in_stack },
- { "max_nest_stack", 'g', &max_nest_stack },
- { "max_param_stack", 'g', &max_param_stack },
- { "max_buf_stack", 'g', &max_buf_stack },
- { "max_save_stack", 'g', &max_save_stack },
- { "stack_size", 'g', &stack_size },
- { "nest_size", 'g', &nest_size },
- { "param_size", 'g', &param_size },
- { "buf_size", 'g', &buf_size },
- { "save_size", 'g', &save_size },
- /* pdf stats */
- { "obj_ptr", 'g', &obj_ptr },
- { "obj_tab_size", 'g', &obj_tab_size },
- { "pdf_os_cntr", 'g', &pdf_os_cntr },
- { "pdf_os_objidx", 'g', &pdf_os_objidx },
- { "pdf_dest_names_ptr", 'g', &pdf_dest_names_ptr },
- { "dest_names_size", 'g', &dest_names_size },
- { "pdf_mem_ptr", 'g', &pdf_mem_ptr },
- { "pdf_mem_size", 'g', &pdf_mem_size },
-
- { "largest_used_mark", 'g', &biggest_used_mark },
-
- { "filename", 'S', &getfilename },
- { "inputid", 'G', &get_current_name },
- { "linenumber", 'g', &line },
- { "lasterrorstring", 'S', &getlasterror },
-
- { "luabytecodes", 'g', &luabytecode_max },
- { "luabytecode_bytes", 'g', &luabytecode_bytes },
- { "luastates", 'g', &luastate_max },
- { "luastate_bytes", 'g', &luastate_bytes },
-
- { "output_active", 'b', &output_active },
-
- { NULL, 0 , 0 } };
-
-
-static int stats_name_to_id (char *name) {
- int i;
- for (i=0; stats[i].name!=NULL; i++) {
- if (strcmp(stats[i].name, name) == 0)
- return i;
- }
- return 0;
+ {"pdf_gone", 'g', &pdf_gone},
+ {"pdf_ptr", 'g', &pdf_ptr},
+ {"dvi_gone", 'g', &dvi_offset},
+ {"dvi_ptr", 'g', &dvi_ptr},
+ {"total_pages", 'g', &total_pages},
+ {"output_file_name", 's', &output_file_name},
+ {"log_name", 's', &texmf_log_name}, /* weird */
+ {"banner", 'S', &getbanner},
+ {"pdftex_banner", 's', &pdftex_banner},
+ /*
+ * mem stat
+ */
+ {"var_used", 'g', &var_used},
+ {"dyn_used", 'g', &dyn_used},
+ /*
+ * traditional tex stats
+ */
+ {"str_ptr", 'g', &str_ptr},
+ {"init_str_ptr", 'g', &init_str_ptr},
+ {"max_strings", 'g', &max_strings},
+ {"pool_ptr", 'g', &pool_ptr},
+ {"init_pool_ptr", 'g', &init_pool_ptr},
+ {"pool_size", 'g', &pool_size},
+ {"var_mem_max", 'g', &var_mem_max},
+ {"node_mem_usage", 'S', &sprint_node_mem_usage},
+ {"fix_mem_max", 'g', &fix_mem_max},
+ {"fix_mem_min", 'g', &fix_mem_min},
+ {"fix_mem_end", 'g', &fix_mem_end},
+ {"cs_count", 'g', &cs_count},
+ {"hash_size", 'G', &get_hash_size},
+ {"hash_extra", 'g', &hash_extra},
+ {"font_ptr", 'G', &max_font_id},
+ {"max_in_stack", 'g', &max_in_stack},
+ {"max_nest_stack", 'g', &max_nest_stack},
+ {"max_param_stack", 'g', &max_param_stack},
+ {"max_buf_stack", 'g', &max_buf_stack},
+ {"max_save_stack", 'g', &max_save_stack},
+ {"stack_size", 'g', &stack_size},
+ {"nest_size", 'g', &nest_size},
+ {"param_size", 'g', &param_size},
+ {"buf_size", 'g', &buf_size},
+ {"save_size", 'g', &save_size},
+ /* pdf stats */
+ {"obj_ptr", 'g', &obj_ptr},
+ {"obj_tab_size", 'g', &obj_tab_size},
+ {"pdf_os_cntr", 'g', &pdf_os_cntr},
+ {"pdf_os_objidx", 'g', &pdf_os_objidx},
+ {"pdf_dest_names_ptr", 'g', &pdf_dest_names_ptr},
+ {"dest_names_size", 'g', &dest_names_size},
+ {"pdf_mem_ptr", 'g', &pdf_mem_ptr},
+ {"pdf_mem_size", 'g', &pdf_mem_size},
+
+ {"largest_used_mark", 'g', &biggest_used_mark},
+
+ {"filename", 'S', &getfilename},
+ {"inputid", 'G', &get_current_name},
+ {"linenumber", 'g', &line},
+ {"lasterrorstring", 'S', &getlasterror},
+
+ {"luabytecodes", 'g', &luabytecode_max},
+ {"luabytecode_bytes", 'g', &luabytecode_bytes},
+ {"luastates", 'g', &luastate_max},
+ {"luastate_bytes", 'g', &luastate_bytes},
+ {"callbacks", 'g', &callback_count},
+ {"indirect_callbacks", 'g', &saved_callback_count},
+
+ {"output_active", 'b', &output_active},
+ {"best_page_break", 'n', &best_page_break},
+ {NULL, 0, 0}
+};
+
+
+static int stats_name_to_id(char *name)
+{
+ int i;
+ for (i = 0; stats[i].name != NULL; i++) {
+ if (strcmp(stats[i].name, name) == 0)
+ return i;
+ }
+ return 0;
}
-static int do_getstat (lua_State *L,int i) {
- int t;
- char *st;
- charfunc f;
- intfunc g;
- int str;
- t = stats[i].type;
- switch(t) {
- case 'S':
- f = stats[i].value;
- st = f();
- lua_pushstring(L,st);
- break;
- case 's':
- str = *(integer *)(stats[i].value);
- if (str) {
- lua_pushstring(L,makecstring(str));
- } else {
- lua_pushnil(L);
- }
- break;
- case 'G':
- g = stats[i].value;
- lua_pushnumber(L,g());
- break;
- case 'g':
- lua_pushnumber(L,*(integer *)(stats[i].value));
- break;
- case 'B':
- g = stats[i].value;
- lua_pushboolean(L,g());
- break;
- case 'b':
- lua_pushboolean(L,*(integer *)(stats[i].value));
- break;
- default:
- lua_pushnil(L);
- }
- return 1;
+static int do_getstat(lua_State * L, int i)
+{
+ int t;
+ char *st;
+ charfunc f;
+ intfunc g;
+ int str;
+ t = stats[i].type;
+ switch (t) {
+ case 'S':
+ f = stats[i].value;
+ st = f();
+ lua_pushstring(L, st);
+ break;
+ case 's':
+ str = *(integer *) (stats[i].value);
+ if (str) {
+ lua_pushstring(L, makecstring(str));
+ } else {
+ lua_pushnil(L);
+ }
+ break;
+ case 'G':
+ g = stats[i].value;
+ lua_pushnumber(L, g());
+ break;
+ case 'g':
+ lua_pushnumber(L, *(integer *) (stats[i].value));
+ break;
+ case 'B':
+ g = stats[i].value;
+ lua_pushboolean(L, g());
+ break;
+ case 'n':
+ lua_nodelib_push_fast(L, *(halfword *) (stats[i].value));
+ break;
+ case 'b':
+ lua_pushboolean(L, *(integer *) (stats[i].value));
+ break;
+ default:
+ lua_pushnil(L);
+ }
+ return 1;
}
-static int getstats (lua_State *L) {
- char *st;
- int i;
- if (lua_isstring(L,-1)) {
- st = (char *)lua_tostring(L,-1);
- i = stats_name_to_id(st);
- if (i>0) {
- return do_getstat(L,i);
- }
- }
- return 0;
+static int getstats(lua_State * L)
+{
+ char *st;
+ int i;
+ if (lua_isstring(L, -1)) {
+ st = (char *) lua_tostring(L, -1);
+ i = stats_name_to_id(st);
+ if (i > 0) {
+ return do_getstat(L, i);
+ }
+ }
+ return 0;
}
-static int setstats (lua_State *L) {
- return 0;
+static int setstats(lua_State * L)
+{
+ return 0;
}
-static int statslist (lua_State *L) {
- int i;
- luaL_checkstack(L,1,"out of stack space");
- lua_newtable(L);
- for (i=0; stats[i].name!=NULL; i++) {
- luaL_checkstack(L,2,"out of stack space");
- lua_pushstring(L,stats[i].name);
- do_getstat(L,i);
- lua_rawset(L,-3);
- }
- return 1;
+static int statslist(lua_State * L)
+{
+ int i;
+ luaL_checkstack(L, 1, "out of stack space");
+ lua_newtable(L);
+ for (i = 0; stats[i].name != NULL; i++) {
+ luaL_checkstack(L, 2, "out of stack space");
+ lua_pushstring(L, stats[i].name);
+ do_getstat(L, i);
+ lua_rawset(L, -3);
+ }
+ return 1;
}
-static const struct luaL_reg statslib [] = {
- {"list",statslist},
- {NULL, NULL} /* sentinel */
+static const struct luaL_reg statslib[] = {
+ {"list", statslist},
+ {NULL, NULL} /* sentinel */
};
-int luaopen_stats (lua_State *L)
+int luaopen_stats(lua_State * L)
{
- luaL_register(L, "status", statslib);
- luaL_newmetatable(L,"stats_meta");
- lua_pushstring(L, "__index");
- lua_pushcfunction(L, getstats);
- lua_settable(L, -3);
- lua_pushstring(L, "__newindex");
- lua_pushcfunction(L, setstats);
- lua_settable(L, -3);
- lua_setmetatable(L,-2); /* meta to itself */
- return 1;
+ luaL_register(L, "status", statslib);
+ luaL_newmetatable(L, "stats_meta");
+ lua_pushstring(L, "__index");
+ lua_pushcfunction(L, getstats);
+ lua_settable(L, -3);
+ lua_pushstring(L, "__newindex");
+ lua_pushcfunction(L, setstats);
+ lua_settable(L, -3);
+ lua_setmetatable(L, -2); /* meta to itself */
+ return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c b/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c
index a61409b2943..c07d3cac696 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexiolib.c
@@ -1,117 +1,160 @@
-/* $Id: ltexiolib.c 1013 2008-02-14 00:09:02Z oneiros $ */
+/* ltexiolib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
+static const char _svn_version[] =
+ "$Id: ltexiolib.c 2027 2009-03-14 18:47:32Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/ltexiolib.c $";
+
typedef void (*texio_printer) (strnumber s);
static char *loggable_info = NULL;
-static int
-do_texio_print (lua_State *L, texio_printer printfunction) {
- strnumber texs,u;
- char *s;
- char save_selector;
- int n,i;
- size_t k;
- u = 0;
- n = lua_gettop(L);
- if (n==0 || !lua_isstring(L, -1)) {
- lua_pushstring(L, "no string to print");
- lua_error(L);
- }
- save_selector = selector;
- i = 1;
- if (n>1) {
- s=(char *)lua_tostring(L, 1);
- if (strcmp(s,"log") == 0) { i++; selector = log_only; }
- else if (strcmp(s,"term") == 0) { i++; selector = term_only; }
- else if (strcmp(s,"term and log") == 0) { i++; selector = term_and_log; }
- }
- if (selector!=log_only && selector!=term_only && selector != term_and_log) {
- normalize_selector(); /* sets selector */
- }
- /* just in case there is a string in progress */
- if (str_start[str_ptr-0x200000]<pool_ptr)
- u=make_string();
- for (;i<=n;i++) {
- s = (char *)lua_tolstring(L, i, &k);
- texs = maketexlstring(s,k);
- printfunction(texs);
- flush_str(texs);
- }
- selector = save_selector;
- if (u!=0) str_ptr--;
- return 0;
+static boolean get_selector_value(lua_State * L, int i, char *l)
+{
+ boolean r = false;
+ if (lua_isstring(L, i)) {
+ char *s = (char *) lua_tostring(L, i);
+ if (strcmp(s, "log") == 0) {
+ *l = log_only;
+ r = true;
+ } else if (strcmp(s, "term") == 0) {
+ *l = term_only;
+ r = true;
+ } else if (strcmp(s, "term and log") == 0) {
+ *l = term_and_log;
+ r = true;
+ }
+ } else {
+ lua_pushstring(L, "first argument is not a string");
+ lua_error(L);
+ }
+ return r;
+}
+
+static int do_texio_print(lua_State * L, texio_printer printfunction)
+{
+ strnumber texs;
+ char *s;
+ size_t k;
+ int i = 1;
+ strnumber u = 0;
+ char save_selector = selector;
+ int n = lua_gettop(L);
+ if (n == 0 || !lua_isstring(L, -1)) {
+ lua_pushstring(L, "no string to print");
+ lua_error(L);
+ }
+ if (n > 1) {
+ if (get_selector_value(L, i, &selector))
+ i++;
+ }
+ if (selector != log_only && selector != term_only
+ && selector != term_and_log) {
+ normalize_selector(); /* sets selector */
+ }
+ /* just in case there is a string in progress */
+ if (str_start[str_ptr - 0x200000] < pool_ptr)
+ u = make_string();
+ for (; i <= n; i++) {
+ if (lua_isstring(L, i)) {
+ s = (char *) lua_tolstring(L, i, &k);
+ texs = maketexlstring(s, k);
+ printfunction(texs);
+ flush_str(texs);
+ } else {
+ lua_pushstring(L, "argument is not a string");
+ lua_error(L);
+ }
+ }
+ selector = save_selector;
+ if (u != 0)
+ str_ptr--;
+ return 0;
}
-static void
-do_texio_ini_print (lua_State *L, char *extra) {
- char *s;
- int i,n,l;
- n = lua_gettop(L);
- i = 1;
- l = 3;
- if (n>1) {
- s=(char *)lua_tostring(L, 1);
- if (strcmp(s,"log") == 0) { i++; l = 1; }
- else if (strcmp(s,"term") == 0) { i++; l = 2; }
- else if (strcmp(s,"term and log") == 0) { i++; l = 3; }
- }
- for (;i<=n;i++) {
- if(lua_isstring(L, i)) {
- s = (char *)lua_tostring(L, i);
- if (l==2||l==3)
- fprintf(stdout,"%s%s", extra, s);
- if (l==1||l==3) {
- if (loggable_info==NULL) {
- loggable_info = strdup(s);
- } else {
- char *v = concat3 (loggable_info,extra,s);
- free(loggable_info);
- loggable_info = v;
- }
- }
- }
- }
+static void do_texio_ini_print(lua_State * L, char *extra)
+{
+ char *s;
+ int i = 1;
+ char l = term_and_log;
+ int n = lua_gettop(L);
+ if (n > 1) {
+ if (get_selector_value(L, i, &l))
+ i++;
+ }
+ for (; i <= n; i++) {
+ if (lua_isstring(L, i)) {
+ s = (char *) lua_tostring(L, i);
+ if (l == term_and_log || l == term_only)
+ fprintf(stdout, "%s%s", extra, s);
+ if (l == log_only || l == term_and_log) {
+ if (loggable_info == NULL) {
+ loggable_info = strdup(s);
+ } else {
+ char *v = concat3(loggable_info, extra, s);
+ free(loggable_info);
+ loggable_info = v;
+ }
+ }
+ }
+ }
}
-static int
-texio_print (lua_State *L) {
- if (ready_already!=314159 || pool_ptr==0 || job_name==0) {
- do_texio_ini_print(L,"");
- return 0;
- }
- return do_texio_print(L,zprint);
+static int texio_print(lua_State * L)
+{
+ if (ready_already != 314159 || pool_ptr == 0 || job_name == 0) {
+ do_texio_ini_print(L, "");
+ return 0;
+ }
+ return do_texio_print(L, zprint);
}
-static int
-texio_printnl (lua_State *L) {
- if (ready_already!=314159 || pool_ptr==0 || job_name==0) {
- do_texio_ini_print(L,"\n");
- return 0;
- }
- return do_texio_print(L,zprint_nl);
+static int texio_printnl(lua_State * L)
+{
+ if (ready_already != 314159 || pool_ptr == 0 || job_name == 0) {
+ do_texio_ini_print(L, "\n");
+ return 0;
+ }
+ return do_texio_print(L, zprint_nl);
}
/* at the point this function is called, the selector is log_only */
-void flush_loggable_info (void) {
- if (loggable_info!=NULL) {
- fprintf(log_file,"%s\n",loggable_info);
- free(loggable_info);
- loggable_info=NULL;
- }
+void flush_loggable_info(void)
+{
+ if (loggable_info != NULL) {
+ fprintf(log_file, "%s\n", loggable_info);
+ free(loggable_info);
+ loggable_info = NULL;
+ }
}
-static const struct luaL_reg texiolib [] = {
- {"write", texio_print},
- {"write_nl", texio_printnl},
- {NULL, NULL} /* sentinel */
+static const struct luaL_reg texiolib[] = {
+ {"write", texio_print},
+ {"write_nl", texio_printnl},
+ {NULL, NULL} /* sentinel */
};
-int
-luaopen_texio (lua_State *L) {
- luaL_register(L,"texio",texiolib);
- return 1;
+int luaopen_texio(lua_State * L)
+{
+ luaL_register(L, "texio", texiolib);
+ return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
index 937c802727a..a847d89f12e 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c
@@ -1,191 +1,226 @@
-/* $Id: ltexlib.c 1168 2008-04-15 13:43:34Z taco $ */
+/* ltexlib.c
+
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+#include "commands.h"
+#include "tokens.h"
+
+static const char _svn_version[] =
+ "$Id: ltexlib.c 2079 2009-03-22 10:15:03Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/ltexlib.c $";
+
+extern halfword *check_isnode(lua_State * L, int ud);
+extern void lua_nodelib_push_fast(lua_State * L, halfword n);
typedef struct {
- char *text;
- unsigned int tsize;
- void *next;
- unsigned char partial;
- int cattable;
+ char *text;
+ unsigned int tsize;
+ void *next;
+ boolean partial;
+ integer cattable;
} rope;
typedef struct {
- rope *head;
- rope *tail;
- char complete; /* currently still writing ? */
+ rope *head;
+ rope *tail;
+ char complete; /* currently still writing ? */
} spindle;
#define PARTIAL_LINE 1
#define FULL_LINE 0
-#define NO_CAT_TABLE -2
-#define DEFAULT_CAT_TABLE -1
-
#define write_spindle spindles[spindle_index]
#define read_spindle spindles[(spindle_index-1)]
-static int spindle_size = 0;
-static spindle *spindles = NULL;
-static int spindle_index = 0;
-
-
-static int
-do_luacprint (lua_State * L, int partial, int deftable) {
- int i, n;
- size_t tsize;
- char *st, *sttemp;
- rope *rn;
- int cattable = deftable;
- int startstrings = 1;
- n = lua_gettop(L);
- if (cattable != NO_CAT_TABLE) {
- if (lua_type(L,1)==LUA_TNUMBER && n>1) {
- cattable = lua_tonumber(L, 1);
- startstrings = 2;
- }
- }
- for (i = startstrings; i <= n; i++) {
- if (!lua_isstring(L, i)) {
- lua_pushstring(L, "no string to print");
- lua_error(L);
- }
- sttemp = (char *)lua_tolstring(L, i,&tsize);
- st = xmalloc((tsize+1));
- memcpy(st,sttemp,(tsize+1));
+static int spindle_size = 0;
+static spindle *spindles = NULL;
+static int spindle_index = 0;
+
+static void
+luac_store (lua_State *L, int i, int partial, integer cattable)
+{
+ char *st, *sttemp;
+ size_t tsize;
+ rope *rn = NULL;
+ sttemp = (char *) lua_tolstring(L, i, &tsize);
+ st = xmalloc((tsize + 1));
+ memcpy(st, sttemp, (tsize + 1));
if (st) {
- /* fprintf(stderr,"W[%d]:=%s\n",spindle_index,st);*/
- luacstrings++;
- rn = (rope *)xmalloc(sizeof(rope)); /* valgrind says we leak here */
- rn->text = st;
- rn->tsize = tsize;
- rn->partial = partial;
- rn->cattable = cattable;
- rn->next = NULL;
- if (write_spindle.head == NULL) {
- assert(write_spindle.tail == NULL);
- write_spindle.head = rn;
- } else {
- write_spindle.tail->next = rn;
- }
- write_spindle.tail = rn;
- write_spindle.complete = 0;
+ luacstrings++;
+ rn = (rope *) xmalloc(sizeof(rope));
+ rn->text = st;
+ rn->tsize = tsize;
+ rn->partial = partial;
+ rn->cattable = cattable;
+ rn->next = NULL;
+ if (write_spindle.head == NULL) {
+ assert(write_spindle.tail == NULL);
+ write_spindle.head = rn;
+ } else {
+ write_spindle.tail->next = rn;
+ }
+ write_spindle.tail = rn;
+ write_spindle.complete = 0;
}
- }
- return 0;
}
-int luacwrite(lua_State * L) {
- return do_luacprint(L,FULL_LINE,NO_CAT_TABLE);
-}
-int luacprint(lua_State * L) {
- return do_luacprint(L,FULL_LINE,DEFAULT_CAT_TABLE);
+static int
+do_luacprint(lua_State * L, int partial, int deftable)
+{
+ int i, n;
+ integer cattable = (integer) deftable;
+ int startstrings = 1;
+ n = lua_gettop(L);
+ if (cattable != NO_CAT_TABLE) {
+ if (lua_type(L, 1) == LUA_TNUMBER && n > 1) {
+ cattable = lua_tonumber(L, 1);
+ startstrings = 2;
+ }
+ }
+ if (lua_type(L, startstrings) == LUA_TTABLE) {
+ for (i = 1; ; i++) {
+ lua_rawgeti(L,startstrings, i);
+ if (lua_isstring(L, -1)) {
+ luac_store(L, -1, partial, cattable);
+ lua_pop(L,1);
+ } else {
+ break;
+ }
+ }
+ } else {
+ for (i = startstrings; i <= n; i++) {
+ if (!lua_isstring(L, i)) {
+ lua_pushstring(L, "no string to print");
+ lua_error(L);
+ }
+ luac_store(L,i, partial, cattable);
+ }
+ }
+ return 0;
}
-int luacsprint(lua_State * L) {
- return do_luacprint(L,PARTIAL_LINE,DEFAULT_CAT_TABLE);
+int luacwrite(lua_State * L)
+{
+ return do_luacprint(L, FULL_LINE, NO_CAT_TABLE);
}
-int
-luacstring_detokenized (void) {
- return (read_spindle.tail->cattable == NO_CAT_TABLE);
+int luacprint(lua_State * L)
+{
+ return do_luacprint(L, FULL_LINE, DEFAULT_CAT_TABLE);
}
-int
-luacstring_defaultcattable (void) {
- return (read_spindle.tail->cattable == DEFAULT_CAT_TABLE);
+int luacsprint(lua_State * L)
+{
+ return do_luacprint(L, PARTIAL_LINE, DEFAULT_CAT_TABLE);
}
-integer
-luacstring_cattable (void) {
- return (integer)read_spindle.tail->cattable;
+integer luacstring_cattable(void)
+{
+ return (integer) read_spindle.tail->cattable;
}
-int
-luacstring_simple (void) {
- return (read_spindle.tail->partial == PARTIAL_LINE);
+int luacstring_partial(void)
+{
+ return read_spindle.tail->partial;
}
-int
-luacstring_penultimate (void) {
- return (read_spindle.tail->next == NULL);
+int luacstring_final_line(void)
+{
+ return (read_spindle.tail->next == NULL);
}
-int
-luacstring_input (void) {
- char *st;
- int ret;
- rope *t = read_spindle.head;
- if (!read_spindle.complete) {
- read_spindle.complete =1;
- read_spindle.tail = NULL;
- }
- if (t == NULL) {
- if(read_spindle.tail != NULL)
- free(read_spindle.tail);
- read_spindle.tail = NULL;
- return 0;
- }
- if (t->text != NULL) {
- st = t->text;
- /* put that thing in the buffer */
- last = first;
- ret = last;
- check_buffer_overflow (last + t->tsize);
- /* make sure it fits in the pool as well (for show_token_list c.s) */
- check_pool_overflow(pool_ptr + t->tsize);
- while (t->tsize-->0)
- buffer[last++] = *st++;
- if (!t->partial) {
- while (last-1>ret && buffer[last-1] == ' ')
- last--;
- }
- free (t->text);
- t->text = NULL;
- }
- if (read_spindle.tail != NULL) { /* not a one-liner */
- free(read_spindle.tail);
- }
- read_spindle.tail = t;
- read_spindle.head = t->next;
- return 1;
+int luacstring_input(void)
+{
+ char *st;
+ int ret;
+ rope *t = read_spindle.head;
+ if (!read_spindle.complete) {
+ read_spindle.complete = 1;
+ read_spindle.tail = NULL;
+ }
+ if (t == NULL) {
+ if (read_spindle.tail != NULL)
+ free(read_spindle.tail);
+ read_spindle.tail = NULL;
+ return 0;
+ }
+ if (t->text != NULL) {
+ st = t->text;
+ /* put that thing in the buffer */
+ last = first;
+ ret = last;
+ check_buffer_overflow(last + t->tsize);
+ /* make sure it fits in the pool as well (for show_token_list c.s) */
+ check_pool_overflow(pool_ptr + t->tsize);
+ while (t->tsize-- > 0)
+ buffer[last++] = *st++;
+ if (!t->partial) {
+ while (last - 1 > ret && buffer[last - 1] == ' ')
+ last--;
+ }
+ free(t->text);
+ t->text = NULL;
+ }
+ if (read_spindle.tail != NULL) { /* not a one-liner */
+ free(read_spindle.tail);
+ }
+ read_spindle.tail = t;
+ read_spindle.head = t->next;
+ return 1;
}
/* open for reading, and make a new one for writing */
-void
-luacstring_start (int n) {
- spindle_index++;
- if(spindle_size == spindle_index) { /* add a new one */
- spindles = xrealloc(spindles,sizeof(spindle)*(spindle_size+1));
- spindles[spindle_index].head = NULL;
- spindles[spindle_index].tail = NULL;
- spindles[spindle_index].complete = 0;
- spindle_size++;
- }
+void luacstring_start(int n)
+{
+ (void) n; /* for -W */
+ spindle_index++;
+ if (spindle_size == spindle_index) { /* add a new one */
+ spindles = xrealloc(spindles, sizeof(spindle) * (spindle_size + 1));
+ spindles[spindle_index].head = NULL;
+ spindles[spindle_index].tail = NULL;
+ spindles[spindle_index].complete = 0;
+ spindle_size++;
+ }
}
/* close for reading */
-void
-luacstring_close (int n) {
- rope *next, *t;
- next = read_spindle.head;
- while (next != NULL) {
- if (next->text != NULL)
- free(next->text);
- t = next;
- next = next->next;
- free(t);
- }
- read_spindle.head = NULL;
- if(read_spindle.tail != NULL)
- free(read_spindle.tail);
- read_spindle.tail = NULL;
- read_spindle.complete = 0;
- spindle_index--;
+void luacstring_close(int n)
+{
+ rope *next, *t;
+ (void) n; /* for -W */
+ next = read_spindle.head;
+ while (next != NULL) {
+ if (next->text != NULL)
+ free(next->text);
+ t = next;
+ next = next->next;
+ free(t);
+ }
+ read_spindle.head = NULL;
+ if (read_spindle.tail != NULL)
+ free(read_spindle.tail);
+ read_spindle.tail = NULL;
+ read_spindle.complete = 0;
+ spindle_index--;
}
/* local (static) versions */
@@ -196,653 +231,1210 @@ luacstring_close (int n) {
#define check_index_range(j) \
if (j > 65535) { \
- lua_pushstring(L, "incorrect index value"); \
- lua_error(L); }
-
-
-int dimen_to_number (lua_State *L,char *s){
- double v;
- char *d;
- int j;
- v = strtod(s,&d);
- if (strcmp (d,"in") == 0) { j = (int)(((v*7227)/100) *65536); }
- else if (strcmp (d,"pc") == 0) { j = (int)((v*12) *65536); }
- else if (strcmp (d,"cm") == 0) { j = (int)(((v*7227)/254) *65536); }
- else if (strcmp (d,"mm") == 0) { j = (int)(((v*7227)/2540) *65536); }
- else if (strcmp (d,"bp") == 0) { j = (int)(((v*7227)/7200) *65536); }
- else if (strcmp (d,"dd") == 0) { j = (int)(((v*1238)/1157) *65536); }
- else if (strcmp (d,"cc") == 0) { j = (int)(((v*14856)/1157) *65536); }
- else if (strcmp (d,"nd") == 0) { j = (int)(((v*21681)/20320)*65536); }
- else if (strcmp (d,"nc") == 0) { j = (int)(((v*65043)/5080) *65536); }
- else if (strcmp (d,"pt") == 0) { j = (int)(v *65536); }
- else if (strcmp (d,"sp") == 0) { j = (int)(v); }
- else {
- lua_pushstring(L, "unknown dimension specifier");
- lua_error(L);
- j = 0;
- }
- return j;
-}
-
-int setdimen (lua_State *L) {
- int i,j;
- size_t k;
- int cur_cs;
- int texstr;
- char *s;
- i = lua_gettop(L);
- j = 0;
- /* find the value*/
- if (!lua_isnumber(L,i))
- if (lua_isstring(L,i)) {
- j = dimen_to_number(L,(char *)lua_tostring(L,i));
+ lua_pushstring(L, "incorrect index value"); \
+ lua_error(L); }
+
+
+int dimen_to_number(lua_State * L, char *s)
+{
+ double v;
+ char *d;
+ int j;
+ v = strtod(s, &d);
+ if (strcmp(d, "in") == 0) {
+ j = (int) (((v * 7227) / 100) * 65536);
+ } else if (strcmp(d, "pc") == 0) {
+ j = (int) ((v * 12) * 65536);
+ } else if (strcmp(d, "cm") == 0) {
+ j = (int) (((v * 7227) / 254) * 65536);
+ } else if (strcmp(d, "mm") == 0) {
+ j = (int) (((v * 7227) / 2540) * 65536);
+ } else if (strcmp(d, "bp") == 0) {
+ j = (int) (((v * 7227) / 7200) * 65536);
+ } else if (strcmp(d, "dd") == 0) {
+ j = (int) (((v * 1238) / 1157) * 65536);
+ } else if (strcmp(d, "cc") == 0) {
+ j = (int) (((v * 14856) / 1157) * 65536);
+ } else if (strcmp(d, "nd") == 0) {
+ j = (int) (((v * 21681) / 20320) * 65536);
+ } else if (strcmp(d, "nc") == 0) {
+ j = (int) (((v * 65043) / 5080) * 65536);
+ } else if (strcmp(d, "pt") == 0) {
+ j = (int) (v * 65536);
+ } else if (strcmp(d, "sp") == 0) {
+ j = (int) (v);
} else {
- lua_pushstring(L, "unsupported value type");
- lua_error(L);
- }
- else
- j = (int)lua_tonumber(L,i);
- /* find the index*/
- if (lua_type(L,i-1)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i-1, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- k = zget_equiv(cur_cs)-get_scaled_base();
- } else {
- k = (int)luaL_checkinteger(L,i-1);
- }
- check_index_range(k);
- if(set_tex_dimen_register(k,j)) {
- lua_pushstring(L, "incorrect value");
- lua_error(L);
- }
- return 0;
-}
-
-int getdimen (lua_State *L) {
- int i,j;
- size_t k;
- int cur_cs;
- int texstr;
- char *s;
- i = lua_gettop(L);
- if (lua_type(L,i)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- if (is_undefined_cs(cur_cs)) {
- lua_pushnil(L);
- return 1;
- }
- k = zget_equiv(cur_cs)-get_scaled_base();
- } else {
- k = (int)luaL_checkinteger(L,i);
- }
- check_index_range(k);
- j = get_tex_dimen_register(k);
- lua_pushnumber(L, j);
- return 1;
-}
-
-int setcount (lua_State *L) {
- int i,j;
- size_t k;
- int cur_cs;
- int texstr;
- char *s;
- i = lua_gettop(L);
- j = (int)luaL_checkinteger(L,i);
- if (lua_type(L,i-1)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i-1,&k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- k = zget_equiv(cur_cs)-get_count_base();
- } else {
- k = (int)luaL_checkinteger(L,i-1);
- }
- check_index_range(k);
- if (set_tex_count_register(k,j)) {
- lua_pushstring(L, "incorrect value");
- lua_error(L);
- }
- return 0;
-}
-
-int getcount (lua_State *L) {
- int i, j;
- size_t k;
- int cur_cs;
- int texstr;
- char *s;
- i = lua_gettop(L);
- if (lua_type(L,i)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- if (is_undefined_cs(cur_cs)) {
- lua_pushnil(L);
- return 1;
- }
- k = zget_equiv(cur_cs)-get_count_base();
- } else {
- k = (int)luaL_checkinteger(L,i);
- }
- check_index_range(k);
- j = get_tex_count_register(k);
- lua_pushnumber(L, j);
- return 1;
-}
-
-
-int setattribute (lua_State *L) {
- int i,j;
- size_t k;
- int cur_cs;
- int texstr;
- char *s;
- i = lua_gettop(L);
- j = (int)luaL_checkinteger(L,i);
- if (lua_type(L,i-1)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i-1, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- k = zget_equiv(cur_cs)-get_attribute_base();
- } else {
- k = (int)luaL_checkinteger(L,i-1);
- }
- check_index_range(k);
- if (set_tex_attribute_register(k,j)) {
- lua_pushstring(L, "incorrect value");
- lua_error(L);
- }
- return 0;
-}
-
-int getattribute (lua_State *L) {
- int i, j;
- size_t k;
- int cur_cs;
- int texstr;
- char *s;
- i = lua_gettop(L);
- if (lua_type(L,i)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- if (is_undefined_cs(cur_cs)) {
- lua_pushnil(L);
- return 1;
- }
- k = zget_equiv(cur_cs)-get_attribute_base();
- } else {
- k = (int)luaL_checkinteger(L,i);
- }
- check_index_range(k);
- j = get_tex_attribute_register(k);
- lua_pushnumber(L, j);
- return 1;
-}
-
-int settoks (lua_State *L) {
- int i,j;
- size_t k,len;
- int cur_cs;
- int texstr;
- char *s, *st;
- i = lua_gettop(L);
- if (!lua_isstring(L,i)) {
- lua_pushstring(L, "unsupported value type");
- lua_error(L);
- }
- st = (char *)lua_tolstring(L,i,&len);
-
- if (lua_type(L,i-1)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i-1, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- k = zget_equiv(cur_cs)-get_toks_base();
- } else {
- k = (int)luaL_checkinteger(L,i-1);
- }
- check_index_range(k);
- j = maketexlstring(st,len);
-
- if(zset_tex_toks_register(k,j)) {
- flush_str(j);
- lua_pushstring(L, "incorrect value");
- lua_error(L);
- }
- return 0;
-}
-
-int gettoks (lua_State *L) {
- int i;
- size_t k;
- strnumber t;
- int cur_cs;
- int texstr;
- char *s;
- i = lua_gettop(L);
- if (lua_type(L,i)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- if (is_undefined_cs(cur_cs)) {
- lua_pushnil(L);
- return 1;
- }
- k = zget_equiv(cur_cs)-get_toks_base();
- } else {
- k = (int)luaL_checkinteger(L,i);
- }
-
- check_index_range(k);
- t = get_tex_toks_register(k);
- lua_pushstring(L, makecstring(t));
- flush_str(t);
- return 1;
-}
-
-/* UGLY hack */
-
-#define char_given 70
-#define math_given 71
-#define omath_given 72
-
-static int get_box_id (lua_State *L, int i) {
- const char *s;
- integer cur_cs, cur_cmd;
- str_number texstr;
- size_t k = 0;
- int j = -1;
- if (lua_type(L,i)==LUA_TSTRING) {
- s = (char *)lua_tolstring(L,i, &k);
- texstr = maketexlstring(s,k);
- cur_cs = string_lookup(texstr);
- cur_cmd = zget_eq_type(cur_cs);
- flush_str(texstr);
- if (cur_cmd==char_given ||
- cur_cmd==math_given ||
- cur_cmd==omath_given) {
- j = zget_equiv(cur_cs);
- }
- } else {
- j = (int)lua_tonumber(L,(i));
- }
- return j;
-}
-
-int getbox (lua_State *L) {
- int k, t;
- k = get_box_id(L,-1);
- check_index_range(k);
- t = get_tex_box_register(k);
- nodelist_to_lua(L,t);
- return 1;
-}
-
-int setbox (lua_State *L) {
- int i,j,k;
- k = get_box_id(L,-2);
- check_index_range(k);
- i = get_tex_box_register(k);
- if (lua_isboolean(L,-1)) {
- j = lua_toboolean(L,-1);
- if (j==0)
- j = null;
- else
- return 0;
- } else {
- j = nodelist_from_lua(L);
- }
- if(set_tex_box_register(k,j)) {
- lua_pushstring(L, "incorrect value");
- lua_error(L);
- }
- return 0;
-}
-
-static int getboxdim (lua_State *L, int whichdim) {
- int i, j;
- i = lua_gettop(L);
- j = get_box_id(L,i);
- lua_settop(L,(i-2)); /* table at -1 */
- if (j<0 || j > 65535) {
- lua_pushstring(L, "incorrect index");
- lua_error(L);
- }
- switch (whichdim) {
- case width_offset:
- lua_pushnumber(L, get_tex_box_width(j));
- break;
- case height_offset:
- lua_pushnumber(L, get_tex_box_height(j));
- break;
- case depth_offset:
- lua_pushnumber(L, get_tex_box_depth(j));
- }
- return 1;
-}
-
-int getboxwd (lua_State *L) {
- return getboxdim (L, width_offset);
-}
-
-int getboxht (lua_State *L) {
- return getboxdim (L, height_offset);
-}
-
-int getboxdp (lua_State *L) {
- return getboxdim (L, depth_offset);
-}
-
-static int setboxdim (lua_State *L, int whichdim) {
- int i,j,k,err;
- i = lua_gettop(L);
- if (!lua_isnumber(L,i)) {
- j = dimen_to_number(L,(char *)lua_tostring(L,i));
- } else {
- j = (int)lua_tonumber(L,i);
- }
- k = get_box_id(L,(i-1));
- lua_settop(L,(i-3)); /* table at -2 */
- if (k<0 || k > 65535) {
- lua_pushstring(L, "incorrect index");
- lua_error(L);
- }
- err = 0;
- switch (whichdim) {
- case width_offset:
- err = set_tex_box_width(k,j);
- break;
- case height_offset:
- err = set_tex_box_height(k,j);
- break;
- case depth_offset:
- err = set_tex_box_depth(k,j);
- }
- if (err) {
- lua_pushstring(L, "not a box");
- lua_error(L);
- }
- return 0;
-}
-
-int setboxwd (lua_State *L) {
- return setboxdim(L,width_offset);
-}
-
-int setboxht (lua_State *L) {
- return setboxdim(L,height_offset);
-}
-
-int setboxdp (lua_State *L) {
- return setboxdim(L,depth_offset);
-}
-
-int settex (lua_State *L) {
- char *st;
- int i,j,texstr;
- size_t k;
- int cur_cs, cur_cmd;
- j = 0;
- i = lua_gettop(L);
- if (lua_isstring(L,(i-1))) {
- st = (char *)lua_tolstring(L,(i-1), &k);
- texstr = maketexlstring(st,k);
- if (zis_primitive(texstr)) {
- cur_cs = string_lookup(texstr);
- flush_str(texstr);
- cur_cmd = zget_eq_type(cur_cs);
- if (is_int_assign(cur_cmd)) {
- if (lua_isnumber(L,i)) {
- assign_internal_int(zget_equiv(cur_cs),lua_tonumber(L,i));
- } else {
- lua_pushstring(L, "unsupported value type");
- lua_error(L);
- }
- } else if (is_dim_assign(cur_cmd)) {
- if (!lua_isnumber(L,i))
- if (lua_isstring(L,i)) {
- j = dimen_to_number(L,(char *)lua_tostring(L,i));
- } else {
- lua_pushstring(L, "unsupported value type");
- lua_error(L);
- }
- else
- j = (int)lua_tonumber(L,i);
- assign_internal_dim(zget_equiv(cur_cs),j);
- } else {
- lua_pushstring(L, "unsupported tex internal assignment");
- lua_error(L);
- }
+ lua_pushstring(L, "unknown dimension specifier");
+ lua_error(L);
+ j = 0;
+ }
+ return j;
+}
+
+int setdimen(lua_State * L)
+{
+ int i, j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ j = 0;
+ /* find the value */
+ if (!lua_isnumber(L, i))
+ if (lua_isstring(L, i)) {
+ j = dimen_to_number(L, (char *) lua_tostring(L, i));
+ } else {
+ lua_pushstring(L, "unsupported value type");
+ lua_error(L);
+ } else
+ j = (int) lua_tonumber(L, i);
+ /* find the index */
+ if (lua_type(L, i - 1) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i - 1, &k);
+ cur_cs = string_lookup(s, k);
+ k = zget_equiv(cur_cs) - get_scaled_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i - 1);
+ }
+ check_index_range(k);
+ if (set_tex_dimen_register(k, j)) {
+ lua_pushstring(L, "incorrect value");
+ lua_error(L);
+ }
+ return 0;
+}
+
+int getdimen(lua_State * L)
+{
+ int i, j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ if (lua_type(L, i) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i, &k);
+ cur_cs = string_lookup(s, k);
+ if (is_undefined_cs(cur_cs)) {
+ lua_pushnil(L);
+ return 1;
+ }
+ k = zget_equiv(cur_cs) - get_scaled_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i);
+ }
+ check_index_range(k);
+ j = get_tex_dimen_register(k);
+ lua_pushnumber(L, j);
+ return 1;
+}
+
+
+int setskip(lua_State * L)
+{
+ int i;
+ halfword *j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ j = check_isnode(L, i); /* the value */
+
+ if (lua_type(L, i - 1) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i - 1, &k);
+ cur_cs = string_lookup(s, k);
+ k = zget_equiv(cur_cs) - get_scaled_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i - 1);
+ }
+ check_index_range(k); /* the index */
+ if (set_tex_skip_register(k, *j)) {
+ lua_pushstring(L, "incorrect value");
+ lua_error(L);
+ }
+ return 0;
+}
+
+int getskip(lua_State * L)
+{
+ int i;
+ halfword j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ if (lua_type(L, i) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i, &k);
+ cur_cs = string_lookup(s, k);
+ if (is_undefined_cs(cur_cs)) {
+ lua_pushnil(L);
+ return 1;
+ }
+ k = zget_equiv(cur_cs) - get_scaled_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i);
+ }
+ check_index_range(k);
+ j = get_tex_skip_register(k);
+ lua_nodelib_push_fast(L, j);
+ return 1;
+}
+
+
+
+int setcount(lua_State * L)
+{
+ int i, j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ j = (int) luaL_checkinteger(L, i);
+ if (lua_type(L, i - 1) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i - 1, &k);
+ cur_cs = string_lookup(s, k);
+ k = zget_equiv(cur_cs) - get_count_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i - 1);
+ }
+ check_index_range(k);
+ if (set_tex_count_register(k, j)) {
+ lua_pushstring(L, "incorrect value");
+ lua_error(L);
+ }
+ return 0;
+}
+
+int getcount(lua_State * L)
+{
+ int i, j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ if (lua_type(L, i) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i, &k);
+ cur_cs = string_lookup(s, k);
+ if (is_undefined_cs(cur_cs)) {
+ lua_pushnil(L);
+ return 1;
+ }
+ k = zget_equiv(cur_cs) - get_count_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i);
+ }
+ check_index_range(k);
+ j = get_tex_count_register(k);
+ lua_pushnumber(L, j);
+ return 1;
+}
+
+
+int setattribute(lua_State * L)
+{
+ int i, j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ j = (int) luaL_checkinteger(L, i);
+ if (lua_type(L, i - 1) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i - 1, &k);
+ cur_cs = string_lookup(s, k);
+ k = zget_equiv(cur_cs) - get_attribute_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i - 1);
+ }
+ check_index_range(k);
+ if (set_tex_attribute_register(k, j)) {
+ lua_pushstring(L, "incorrect value");
+ lua_error(L);
+ }
+ return 0;
+}
+
+int getattribute(lua_State * L)
+{
+ int i, j;
+ size_t k;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ if (lua_type(L, i) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i, &k);
+ cur_cs = string_lookup(s, k);
+ if (is_undefined_cs(cur_cs)) {
+ lua_pushnil(L);
+ return 1;
+ }
+ k = zget_equiv(cur_cs) - get_attribute_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i);
+ }
+ check_index_range(k);
+ j = get_tex_attribute_register(k);
+ lua_pushnumber(L, j);
+ return 1;
+}
+
+int settoks(lua_State * L)
+{
+ int i, j;
+ size_t k, len;
+ int cur_cs;
+ char *s, *st;
+ i = lua_gettop(L);
+ if (!lua_isstring(L, i)) {
+ lua_pushstring(L, "unsupported value type");
+ lua_error(L);
+ }
+ st = (char *) lua_tolstring(L, i, &len);
+
+ if (lua_type(L, i - 1) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i - 1, &k);
+ cur_cs = string_lookup(s, k);
+ k = zget_equiv(cur_cs) - get_toks_base();
+ } else {
+ k = (int) luaL_checkinteger(L, i - 1);
+ }
+ check_index_range(k);
+ j = maketexlstring(st, len);
+
+ if (zset_tex_toks_register(k, j)) {
+ flush_str(j);
+ lua_pushstring(L, "incorrect value");
+ lua_error(L);
+ }
+ return 0;
+}
+
+int gettoks(lua_State * L)
+{
+ int i;
+ size_t k;
+ strnumber t;
+ int cur_cs;
+ char *s;
+ i = lua_gettop(L);
+ if (lua_type(L, i) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i, &k);
+ cur_cs = string_lookup(s, k);
+ if (is_undefined_cs(cur_cs)) {
+ lua_pushnil(L);
+ return 1;
+ }
+ k = zget_equiv(cur_cs) - get_toks_base();
} else {
- lua_rawset(L,(i-2));
- }
- } else {
- lua_rawset(L,(i-2));
- }
- return 0;
-}
-
-char *
-get_something_internal (int cur_cmd, int cur_code) {
- int texstr;
- char *str;
- int save_cur_val,save_cur_val_level;
- save_cur_val = cur_val;
- save_cur_val_level = cur_val_level;
- zscan_something_simple(cur_cmd,cur_code);
- texstr = the_scanned_result();
- cur_val = save_cur_val;
- cur_val_level = save_cur_val_level;
- str = makecstring(texstr);
- flush_str(texstr);
- return str;
-}
-
-char *
-get_convert (int cur_code) {
- int texstr;
- char *str = NULL;
- texstr = the_convert_string(cur_code);
- if (texstr) {
+ k = (int) luaL_checkinteger(L, i);
+ }
+
+ check_index_range(k);
+ t = get_tex_toks_register(k);
+ lua_pushstring(L, makecstring(t));
+ flush_str(t);
+ return 1;
+}
+
+static int get_box_id(lua_State * L, int i)
+{
+ char *s;
+ integer cur_cs, cur_cmd;
+ size_t k = 0;
+ int j = -1;
+ if (lua_type(L, i) == LUA_TSTRING) {
+ s = (char *) lua_tolstring(L, i, &k);
+ cur_cs = string_lookup(s, k);
+ cur_cmd = zget_eq_type(cur_cs);
+ if (cur_cmd == char_given_cmd ||
+ cur_cmd == math_given_cmd || cur_cmd == omath_given_cmd) {
+ j = zget_equiv(cur_cs);
+ }
+ } else {
+ j = (int) lua_tonumber(L, (i));
+ }
+ return j;
+}
+
+int getbox(lua_State * L)
+{
+ int k, t;
+ k = get_box_id(L, -1);
+ check_index_range(k);
+ t = get_tex_box_register(k);
+ nodelist_to_lua(L, t);
+ return 1;
+}
+
+int setbox(lua_State * L)
+{
+ int i, j, k;
+ k = get_box_id(L, -2);
+ check_index_range(k);
+ i = get_tex_box_register(k);
+ if (lua_isboolean(L, -1)) {
+ j = lua_toboolean(L, -1);
+ if (j == 0)
+ j = null;
+ else
+ return 0;
+ } else {
+ j = nodelist_from_lua(L);
+ }
+ if (set_tex_box_register(k, j)) {
+ lua_pushstring(L, "incorrect value");
+ lua_error(L);
+ }
+ return 0;
+}
+
+static int getboxdim(lua_State * L, int whichdim)
+{
+ int i, j;
+ i = lua_gettop(L);
+ j = get_box_id(L, i);
+ lua_settop(L, (i - 2)); /* table at -1 */
+ if (j < 0 || j > 65535) {
+ lua_pushstring(L, "incorrect index");
+ lua_error(L);
+ }
+ switch (whichdim) {
+ case width_offset:
+ lua_pushnumber(L, get_tex_box_width(j));
+ break;
+ case height_offset:
+ lua_pushnumber(L, get_tex_box_height(j));
+ break;
+ case depth_offset:
+ lua_pushnumber(L, get_tex_box_depth(j));
+ }
+ return 1;
+}
+
+int getboxwd(lua_State * L)
+{
+ return getboxdim(L, width_offset);
+}
+
+int getboxht(lua_State * L)
+{
+ return getboxdim(L, height_offset);
+}
+
+int getboxdp(lua_State * L)
+{
+ return getboxdim(L, depth_offset);
+}
+
+static int setboxdim(lua_State * L, int whichdim)
+{
+ int i, j, k, err;
+ i = lua_gettop(L);
+ if (!lua_isnumber(L, i)) {
+ j = dimen_to_number(L, (char *) lua_tostring(L, i));
+ } else {
+ j = (int) lua_tonumber(L, i);
+ }
+ k = get_box_id(L, (i - 1));
+ lua_settop(L, (i - 3)); /* table at -2 */
+ if (k < 0 || k > 65535) {
+ lua_pushstring(L, "incorrect index");
+ lua_error(L);
+ }
+ err = 0;
+ switch (whichdim) {
+ case width_offset:
+ err = set_tex_box_width(k, j);
+ break;
+ case height_offset:
+ err = set_tex_box_height(k, j);
+ break;
+ case depth_offset:
+ err = set_tex_box_depth(k, j);
+ }
+ if (err) {
+ lua_pushstring(L, "not a box");
+ lua_error(L);
+ }
+ return 0;
+}
+
+int setboxwd(lua_State * L)
+{
+ return setboxdim(L, width_offset);
+}
+
+int setboxht(lua_State * L)
+{
+ return setboxdim(L, height_offset);
+}
+
+int setboxdp(lua_State * L)
+{
+ return setboxdim(L, depth_offset);
+}
+
+int settex(lua_State * L)
+{
+ char *st;
+ int i, j, texstr;
+ size_t k;
+ int cur_cs, cur_cmd;
+ j = 0;
+ i = lua_gettop(L);
+ if (lua_isstring(L, (i - 1))) {
+ st = (char *) lua_tolstring(L, (i - 1), &k);
+ texstr = maketexlstring(st, k);
+ if (is_primitive(texstr)) {
+ cur_cs = string_lookup(st, k);
+ flush_str(texstr);
+ cur_cmd = zget_eq_type(cur_cs);
+ if (is_int_assign(cur_cmd)) {
+ if (lua_isnumber(L, i)) {
+ assign_internal_value(0, zget_equiv(cur_cs),
+ lua_tonumber(L, i));
+ } else {
+ lua_pushstring(L, "unsupported value type");
+ lua_error(L);
+ }
+ } else if (is_dim_assign(cur_cmd)) {
+ if (!lua_isnumber(L, i))
+ if (lua_isstring(L, i)) {
+ j = dimen_to_number(L, (char *) lua_tostring(L, i));
+ } else {
+ lua_pushstring(L, "unsupported value type");
+ lua_error(L);
+ } else
+ j = (int) lua_tonumber(L, i);
+ assign_internal_value(0, zget_equiv(cur_cs), j);
+ } else {
+ lua_pushstring(L, "unsupported tex internal assignment");
+ lua_error(L);
+ }
+ } else {
+ lua_rawset(L, (i - 2));
+ }
+ } else {
+ lua_rawset(L, (i - 2));
+ }
+ return 0;
+}
+
+char *get_something_internal(int cur_cmd, int cur_code)
+{
+ int texstr;
+ char *str;
+ int save_cur_val, save_cur_val_level;
+ save_cur_val = cur_val;
+ save_cur_val_level = cur_val_level;
+ zscan_something_simple(cur_cmd, cur_code);
+ texstr = the_scanned_result();
+ cur_val = save_cur_val;
+ cur_val_level = save_cur_val_level;
str = makecstring(texstr);
flush_str(texstr);
- }
- return str;
-}
-
-
-int
-gettex (lua_State *L) {
- char *st;
- int i,texstr;
- size_t k;
- char *str;
- int cur_cs, cur_cmd, cur_code;
- i = lua_gettop(L);
- if (lua_isstring(L,i)) {
- st = (char *)lua_tolstring(L,i, &k);
- texstr = maketexlstring(st,k);
- cur_cs = zprim_lookup(texstr);
- flush_str(texstr);
- if (cur_cs) {
- cur_cmd = zget_prim_eq_type(cur_cs);
- cur_code = zget_prim_equiv(cur_cs);
- if (is_convert(cur_cmd))
- str = get_convert(cur_code);
- else
- str = get_something_internal(cur_cmd,cur_code);
- if (str)
- lua_pushstring(L,str);
- else
- lua_pushnil(L);
- return 1;
+ return str;
+}
+
+int do_convert(lua_State * L, int cur_code)
+{
+ int texstr;
+ integer i = -1;
+ char *str = NULL;
+ switch (cur_code) {
+ case convert_pdf_creation_date_code: /* ? */
+ case convert_pdf_insert_ht_code: /* arg <register int> */
+ case convert_pdf_ximage_bbox_code: /* arg 2 ints */
+ case convert_lua_code: /* arg complex */
+ case convert_lua_escape_string_code: /* arg token list */
+ case convert_pdf_colorstack_init_code: /* arg complex */
+ case convert_left_margin_kern_code: /* arg box */
+ case convert_right_margin_kern_code: /* arg box */
+ break;
+ case convert_string_code: /* arg token */
+ case convert_meaning_code: /* arg token */
+ break;
+
+ /* the next fall through, and come from 'official' indices! */
+ case convert_font_name_code: /* arg fontid */
+ case convert_font_identifier_code: /* arg fontid */
+ case convert_pdf_font_name_code: /* arg fontid */
+ case convert_pdf_font_objnum_code: /* arg fontid */
+ case convert_pdf_font_size_code: /* arg fontid */
+ case convert_uniform_deviate_code: /* arg int */
+ case convert_number_code: /* arg int */
+ case convert_roman_numeral_code: /* arg int */
+ case convert_pdf_page_ref_code: /* arg int */
+ case convert_pdf_xform_name_code: /* arg int */
+ if (lua_gettop(L) < 1) {
+ /* error */
+ }
+ i = lua_tonumber(L, 1); /* these fall through! */
+ default:
+ texstr = the_convert_string(cur_code, i);
+ if (texstr) {
+ str = makecstring(texstr);
+ flush_str(texstr);
+ }
+ }
+ if (str)
+ lua_pushstring(L, str);
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
+
+int do_scan_internal(lua_State * L, int cur_cmd, int cur_code)
+{
+ int texstr;
+ char *str = NULL;
+ int save_cur_val, save_cur_val_level;
+ save_cur_val = cur_val;
+ save_cur_val_level = cur_val_level;
+ zscan_something_simple(cur_cmd, cur_code);
+
+ if (cur_val_level == int_val_level ||
+ cur_val_level == dimen_val_level || cur_val_level == attr_val_level) {
+ lua_pushnumber(L, cur_val);
+ } else if (cur_val_level == glue_val_level) {
+ lua_nodelib_push_fast(L, cur_val);
+ } else { /* dir_val_level, mu_val_level, tok_val_level */
+ texstr = the_scanned_result();
+ str = makecstring(texstr);
+ if (str)
+ lua_pushstring(L, str);
+ else
+ lua_pushnil(L);
+ flush_str(texstr);
+ }
+ cur_val = save_cur_val;
+ cur_val_level = save_cur_val_level;
+ return 1;
+}
+
+int do_lastitem(lua_State * L, int cur_code)
+{
+ int retval = 1;
+ switch (cur_code) {
+ /* the next two do not actually exist */
+ case last_item_lastattr_code:
+ case last_item_attrexpr_code:
+ lua_pushnil(L);
+ break;
+ /* the expressions do something complicated with arguments, yuck */
+ case last_item_numexpr_code:
+ case last_item_dimexpr_code:
+ case last_item_glueexpr_code:
+ case last_item_muexpr_code:
+ lua_pushnil(L);
+ break;
+ /* these read a glue or muglue, todo */
+ case last_item_mu_to_glue_code:
+ case last_item_glue_to_mu_code:
+ case last_item_glue_stretch_order_code:
+ case last_item_glue_shrink_order_code:
+ case last_item_glue_stretch_code:
+ case last_item_glue_shrink_code:
+ lua_pushnil(L);
+ break;
+ /* these read a fontid and a char, todo */
+ case last_item_font_char_wd_code:
+ case last_item_font_char_ht_code:
+ case last_item_font_char_dp_code:
+ case last_item_font_char_ic_code:
+ lua_pushnil(L);
+ break;
+ /* these read an integer, todo */
+ case last_item_par_shape_length_code:
+ case last_item_par_shape_indent_code:
+ case last_item_par_shape_dimen_code:
+ lua_pushnil(L);
+ break;
+ case last_item_lastpenalty_code:
+ case last_item_lastkern_code:
+ case last_item_lastskip_code:
+ case last_item_last_node_type_code:
+ case last_item_input_line_no_code:
+ case last_item_badness_code:
+ case last_item_pdftex_version_code:
+ case last_item_pdf_last_obj_code:
+ case last_item_pdf_last_xform_code:
+ case last_item_pdf_last_ximage_code:
+ case last_item_pdf_last_ximage_pages_code:
+ case last_item_pdf_last_annot_code:
+ case last_item_pdf_last_x_pos_code:
+ case last_item_pdf_last_y_pos_code:
+ case last_item_pdf_retval_code:
+ case last_item_pdf_last_ximage_colordepth_code:
+ case last_item_random_seed_code:
+ case last_item_pdf_last_link_code:
+ case last_item_luatex_version_code:
+ case last_item_Aleph_version_code:
+ case last_item_Omega_version_code:
+ case last_item_Aleph_minor_version_code:
+ case last_item_Omega_minor_version_code:
+ case last_item_eTeX_minor_version_code:
+ case last_item_eTeX_version_code:
+ case last_item_current_group_level_code:
+ case last_item_current_group_type_code:
+ case last_item_current_if_level_code:
+ case last_item_current_if_type_code:
+ case last_item_current_if_branch_code:
+ retval = do_scan_internal(L, last_item_cmd, cur_code);
+ break;
+ default:
+ lua_pushnil(L);
+ break;
+ }
+ return retval;
+}
+
+
+static int getfontname(lua_State * L)
+{
+ return do_convert(L, convert_font_name_code);
+}
+
+static int getfontidentifier(lua_State * L)
+{
+ return do_convert(L, convert_font_identifier_code);
+}
+
+static int getpdffontname(lua_State * L)
+{
+ return do_convert(L, convert_pdf_font_name_code);
+}
+
+static int getpdffontobjnum(lua_State * L)
+{
+ return do_convert(L, convert_pdf_font_objnum_code);
+}
+
+static int getpdffontsize(lua_State * L)
+{
+ return do_convert(L, convert_pdf_font_size_code);
+}
+
+static int getuniformdeviate(lua_State * L)
+{
+ return do_convert(L, convert_uniform_deviate_code);
+}
+
+static int getnumber(lua_State * L)
+{
+ return do_convert(L, convert_number_code);
+}
+
+static int getromannumeral(lua_State * L)
+{
+ return do_convert(L, convert_roman_numeral_code);
+}
+
+static int getpdfpageref(lua_State * L)
+{
+ return do_convert(L, convert_pdf_page_ref_code);
+}
+
+static int getpdfxformname(lua_State * L)
+{
+ return do_convert(L, convert_pdf_xform_name_code);
+}
+
+
+int get_parshape(lua_State * L)
+{
+ int n;
+ halfword par_shape_ptr = get_par_shape_ptr();
+ if (par_shape_ptr != 0) {
+ int m = 1;
+ n = vinfo(par_shape_ptr + 1);
+ lua_createtable(L, n, 0);
+ while (m <= n) {
+ lua_createtable(L, 2, 0);
+ lua_pushnumber(L, vlink((par_shape_ptr) + (2 * (m - 1)) + 2));
+ lua_rawseti(L, -2, 1);
+ lua_pushnumber(L, vlink((par_shape_ptr) + (2 * (m - 1)) + 3));
+ lua_rawseti(L, -2, 2);
+ lua_rawseti(L, -2, m);
+ m++;
+ }
} else {
- lua_rawget(L,(i-1));
- return 1;
- }
- } else {
- lua_rawget(L,(i-1));
+ lua_pushnil(L);
+ }
return 1;
- }
- return 0; /* not reached */
-}
-
-
-int
-getlist (lua_State *L) {
- char *str;
- if (lua_isstring(L,2)) {
- str = (char *)lua_tostring(L,2);
- if (strcmp(str,"page_ins_head")==0) {
- lua_pushnumber(L,page_ins_head); lua_nodelib_push(L);
- } else if (strcmp(str,"contrib_head")==0) {
- lua_pushnumber(L,contrib_head); lua_nodelib_push(L);
- } else if (strcmp(str,"page_head")==0) {
- lua_pushnumber(L,page_head); lua_nodelib_push(L);
- } else if (strcmp(str,"temp_head")==0) {
- lua_pushnumber(L,temp_head); lua_nodelib_push(L);
- } else if (strcmp(str,"hold_head")==0) {
- lua_pushnumber(L,hold_head); lua_nodelib_push(L);
- } else if (strcmp(str,"adjust_head")==0) {
- lua_pushnumber(L,adjust_head); lua_nodelib_push(L);
- } else if (strcmp(str,"pre_adjust_head")==0) {
- lua_pushnumber(L,pre_adjust_head); lua_nodelib_push(L);
- } else if (strcmp(str,"align_head")==0) {
- lua_pushnumber(L,align_head); lua_nodelib_push(L);
+}
+
+
+int gettex(lua_State * L)
+{
+ int cur_cs = -1;
+ int retval = 1; /* default is to return nil */
+
+ if (lua_isstring(L, 2)) { /* 1 == 'tex' */
+ int texstr;
+ size_t k;
+ char *st = (char *) lua_tolstring(L, 2, &k);
+ texstr = maketexlstring(st, k);
+ cur_cs = prim_lookup(texstr); /* not found == relax == 0 */
+ flush_str(texstr);
+ }
+ if (cur_cs > 0) {
+ int cur_cmd, cur_code;
+ cur_cmd = get_prim_eq_type(cur_cs);
+ cur_code = get_prim_equiv(cur_cs);
+ switch (cur_cmd) {
+ case last_item_cmd:
+ retval = do_lastitem(L, cur_code);
+ break;
+ case convert_cmd:
+ retval = do_convert(L, cur_code);
+ break;
+ case assign_toks_cmd:
+ case assign_int_cmd:
+ case assign_attr_cmd:
+ case assign_dir_cmd:
+ case assign_dimen_cmd:
+ case assign_glue_cmd:
+ case assign_mu_glue_cmd:
+ case set_aux_cmd:
+ case set_prev_graf_cmd:
+ case set_page_int_cmd:
+ case set_page_dimen_cmd:
+ case char_given_cmd:
+ case math_given_cmd:
+ case omath_given_cmd:
+ retval = do_scan_internal(L, cur_cmd, cur_code);
+ break;
+ case set_tex_shape_cmd:
+ retval = get_parshape(L);
+ break;
+ default:
+ lua_pushnil(L);
+ break;
+ }
} else {
- lua_pushnil(L);
+ lua_rawget(L, 1); /* fetch other index from table */
}
- } else {
- lua_pushnil(L);
- }
- return 1;
+ return retval;
}
-int
-setlist (lua_State *L) {
- assert(L);
- return 0;
+
+int getlist(lua_State * L)
+{
+ char *str;
+ if (lua_isstring(L, 2)) {
+ str = (char *) lua_tostring(L, 2);
+ if (strcmp(str, "page_ins_head") == 0) {
+ if (vlink(page_ins_head) == page_ins_head)
+ lua_pushnumber(L, null);
+ else
+ lua_pushnumber(L, vlink(page_ins_head));
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "contrib_head") == 0) {
+ lua_pushnumber(L, vlink(contrib_head));
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "page_head") == 0) {
+ lua_pushnumber(L, vlink(page_head));
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "temp_head") == 0) {
+ lua_pushnumber(L, vlink(temp_head));
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "hold_head") == 0) {
+ lua_pushnumber(L, vlink(hold_head));
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "adjust_head") == 0) {
+ lua_pushnumber(L, vlink(adjust_head));
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "best_page_break") == 0) {
+ lua_pushnumber(L, best_page_break);
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "least_page_cost") == 0) {
+ lua_pushnumber(L, least_page_cost);
+ } else if (strcmp(str, "best_size") == 0) {
+ lua_pushnumber(L, best_size);
+ } else if (strcmp(str, "pre_adjust_head") == 0) {
+ lua_pushnumber(L, vlink(pre_adjust_head));
+ lua_nodelib_push(L);
+ } else if (strcmp(str, "align_head") == 0) {
+ lua_pushnumber(L, vlink(align_head));
+ lua_nodelib_push(L);
+ } else {
+ lua_pushnil(L);
+ }
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+int setlist(lua_State * L)
+{
+ halfword *n_ptr;
+ char *str;
+ halfword n = 0;
+ if (lua_isstring(L, 2)) {
+ str = (char *) lua_tostring(L, 2);
+ if (strcmp(str, "best_size") == 0) {
+ best_size = lua_tointeger(L, 3);
+ } else if (strcmp(str, "least_page_cost") == 0) {
+ least_page_cost = lua_tointeger(L, 3);
+ } else {
+ if (!lua_isnil(L, 3)) {
+ n_ptr = check_isnode(L, 3);
+ n = *n_ptr;
+ }
+ if (strcmp(str, "page_ins_head") == 0) {
+ if (n == 0) {
+ vlink(page_ins_head) = page_ins_head;
+ } else {
+ halfword m;
+ vlink(page_ins_head) = n;
+ m = tail_of_list(n);
+ vlink(m) = page_ins_head;
+ }
+ } else if (strcmp(str, "contrib_head") == 0) {
+ vlink(contrib_head) = n;
+ if (n == 0) {
+ if (nest_ptr == 0)
+ cur_list.tail_field = contrib_head; /* vertical mode */
+ else
+ nest[0].tail_field = contrib_head; /* other modes */
+ }
+ } else if (strcmp(str, "best_page_break") == 0) {
+ best_page_break = n;
+ } else if (strcmp(str, "page_head") == 0) {
+ vlink(page_head) = n;
+ page_tail = (n == 0 ? page_head : tail_of_list(n));
+ } else if (strcmp(str, "temp_head") == 0) {
+ vlink(temp_head) = n;
+ } else if (strcmp(str, "hold_head") == 0) {
+ vlink(hold_head) = n;
+ } else if (strcmp(str, "adjust_head") == 0) {
+ vlink(adjust_head) = n;
+ adjust_tail = (n == 0 ? adjust_head : tail_of_list(n));
+ } else if (strcmp(str, "pre_adjust_head") == 0) {
+ vlink(pre_adjust_head) = n;
+ pre_adjust_tail = (n == 0 ? pre_adjust_head : tail_of_list(n));
+ } else if (strcmp(str, "align_head") == 0) {
+ vlink(align_head) = n;
+ }
+ }
+ }
+ return 0;
}
#define infinity 2147483647
-static int
-do_integer_error(double m) {
- char *help[] = {"I can only go up to 2147483647='17777777777=""7FFFFFFF,",
- "so I'm using that number instead of yours.",
- NULL } ;
- tex_error("Number too big",help);
- return (m>0.0 ? infinity : -infinity);
+static int do_integer_error(double m)
+{
+ char *help[] = { "I can only go up to 2147483647='17777777777=" "7FFFFFFF,",
+ "so I'm using that number instead of yours.",
+ NULL
+ };
+ tex_error("Number too big", help);
+ return (m > 0.0 ? infinity : -infinity);
}
-static int
-tex_roundnumber (lua_State *L) {
- double m = lua_tonumber(L, 1)+0.5;
- if (abs(m)>(double)infinity)
- lua_pushnumber(L,do_integer_error(m));
- else
- lua_pushnumber(L,floor(m));
- return 1;
+static int tex_roundnumber(lua_State * L)
+{
+ double m = lua_tonumber(L, 1) + 0.5;
+ if (abs(m) > (double) infinity)
+ lua_pushnumber(L, do_integer_error(m));
+ else
+ lua_pushnumber(L, floor(m));
+ return 1;
}
-static int
-tex_scaletable (lua_State *L) {
- double delta = luaL_checknumber(L, 2);
- if (lua_istable(L,1)) {
- lua_newtable(L); /* the new table is at index 3 */
- lua_pushnil(L);
- while (lua_next(L,1)!= 0 ) { /* numeric value */
- lua_pushvalue(L,-2);
- lua_insert(L,-2);
- if (lua_isnumber(L,-1)) {
- double m = lua_tonumber(L,-1)*delta + 0.5;
- lua_pop(L,1);
- if (abs(m)>(double)infinity)
- lua_pushnumber(L,do_integer_error(m));
- else
- lua_pushnumber(L,floor(m));
- }
- lua_rawset(L,3);
- }
- } else if (lua_isnumber(L,1)) {
- double m = lua_tonumber(L,1)*delta + 0.5;
- if (abs(m)>(double)infinity)
- lua_pushnumber(L,do_integer_error(m));
- else
- lua_pushnumber(L,floor(m));
- } else {
- lua_pushnil(L);
- }
- return 1;
-}
-
-static const struct luaL_reg texlib [] = {
- {"write", luacwrite},
- {"print", luacprint},
- {"sprint", luacsprint},
- {"setdimen", setdimen},
- {"getdimen", getdimen},
- {"setattribute", setattribute},
- {"getattribute", getattribute},
- {"setcount", setcount},
- {"getcount", getcount},
- {"settoks", settoks},
- {"gettoks", gettoks},
- {"setbox", setbox},
- {"getbox", getbox},
- {"setlist", setlist},
- {"getlist", getlist},
- {"setboxwd", setboxwd},
- {"getboxwd", getboxwd},
- {"setboxht", setboxht},
- {"getboxht", getboxht},
- {"setboxdp", setboxdp},
- {"getboxdp", getboxdp},
- {"round", tex_roundnumber},
- {"scale", tex_scaletable},
- {NULL, NULL} /* sentinel */
-};
+static int tex_scaletable(lua_State * L)
+{
+ double delta = luaL_checknumber(L, 2);
+ if (lua_istable(L, 1)) {
+ lua_newtable(L); /* the new table is at index 3 */
+ lua_pushnil(L);
+ while (lua_next(L, 1) != 0) { /* numeric value */
+ lua_pushvalue(L, -2);
+ lua_insert(L, -2);
+ if (lua_isnumber(L, -1)) {
+ double m = lua_tonumber(L, -1) * delta + 0.5;
+ lua_pop(L, 1);
+ if (abs(m) > (double) infinity)
+ lua_pushnumber(L, do_integer_error(m));
+ else
+ lua_pushnumber(L, floor(m));
+ }
+ lua_rawset(L, 3);
+ }
+ } else if (lua_isnumber(L, 1)) {
+ double m = lua_tonumber(L, 1) * delta + 0.5;
+ if (abs(m) > (double) infinity)
+ lua_pushnumber(L, do_integer_error(m));
+ else
+ lua_pushnumber(L, floor(m));
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+#define hash_text(A) hash[(A)].rh
+
+static int tex_definefont(lua_State * L)
+{
+ char *csname;
+ int f, u;
+ str_number t;
+ size_t l;
+ int i = 1;
+ int a = 0;
+ if (!no_new_control_sequence) {
+ char *help[] =
+ { "You can't create a new font inside a \\csname\\endcsname pair",
+ NULL
+ };
+ tex_error("Definition active", help);
+ }
+ if ((lua_gettop(L) == 3) && lua_isboolean(L, 1)) {
+ a = lua_toboolean(L, 1);
+ i = 2;
+ }
+ csname = (char *) luaL_checklstring(L, i, &l);
+ f = luaL_checkinteger(L, (i + 1));
+ t = maketexlstring(csname, l);
+ no_new_control_sequence = 0;
+ u = string_lookup(csname, l);
+ no_new_control_sequence = 1;
+ if (a)
+ geq_define(u, set_font_cmd, f);
+ else
+ eq_define(u, set_font_cmd, f);
+ zeqtb[get_font_id_base() + f] = zeqtb[u];
+ hash_text(get_font_id_base() + f) = t;
+ return 0;
+}
+
+static int tex_hashpairs(lua_State * L)
+{
+ int cmd, chr;
+ str_number s = 0;
+ int cs = 1;
+ int eqtb_size = get_eqtb_size();
+ lua_newtable(L);
+ while (cs < eqtb_size) {
+ s = hash_text(cs);
+ if (s > 0) {
+ lua_pushstring(L, makecstring(s));
+ cmd = zget_eq_type(cs);
+ chr = zget_equiv(cs);
+ make_token_table(L, cmd, chr, cs);
+ lua_rawset(L, -3);
+ }
+ cs++;
+ }
+ return 1;
+}
+
+static int tex_primitives(lua_State * L)
+{
+ int cmd, chr;
+ str_number s = 0;
+ int cs = 0;
+ lua_newtable(L);
+ while (cs < prim_size) {
+ s = get_prim_text(cs);
+ if (s > 0) {
+ lua_pushstring(L, makecstring(s));
+ cmd = get_prim_eq_type(cs);
+ chr = get_prim_equiv(cs);
+ make_token_table(L, cmd, chr, 0);
+ lua_rawset(L, -3);
+ }
+ cs++;
+ }
+ return 1;
+}
-int luaopen_tex (lua_State *L)
-{
- luaL_register(L, "tex", texlib);
- make_table(L,"attribute","getattribute","setattribute");
- make_table(L,"dimen","getdimen","setdimen");
- make_table(L,"count","getcount","setcount");
- make_table(L,"toks","gettoks","settoks");
- make_table(L,"box","getbox","setbox");
- make_table(L,"lists","getlist","setlist");
- make_table(L,"wd","getboxwd","setboxwd");
- make_table(L,"ht","getboxht","setboxht");
- make_table(L,"dp","getboxdp","setboxdp");
- /* make the meta entries */
- /* fetch it back */
- luaL_newmetatable(L,"tex_meta");
- lua_pushstring(L, "__index");
- lua_pushcfunction(L, gettex);
- lua_settable(L, -3);
- lua_pushstring(L, "__newindex");
- lua_pushcfunction(L, settex);
- lua_settable(L, -3);
- lua_setmetatable(L,-2); /* meta to itself */
- /* initialize the I/O stack: */
- spindles = xmalloc(sizeof(spindle));
- spindle_index = 0;
- spindles[0].head = NULL;
- spindles[0].tail = NULL;
- spindle_size = 1;
- return 1;
+static int tex_extraprimitives(lua_State * L)
+{
+ int n, i;
+ int mask = 0;
+ str_number s = 0;
+ int cs = 0;
+ n = lua_gettop(L);
+ if (n == 0) {
+ mask = etex_command + aleph_command + omega_command +
+ pdftex_command + luatex_command;
+ } else {
+ for (i = 1; i <= n; i++) {
+ if (lua_isstring(L, i)) {
+ char *s = (char *) lua_tostring(L, i);
+ if (strcmp(s, "etex") == 0) {
+ mask |= etex_command;
+ } else if (strcmp(s, "tex") == 0) {
+ mask |= tex_command;
+ } else if (strcmp(s, "core") == 0) {
+ mask |= core_command;
+ } else if (strcmp(s, "pdftex") == 0) {
+ mask |= pdftex_command;
+ } else if (strcmp(s, "aleph") == 0) {
+ mask |= aleph_command;
+ } else if (strcmp(s, "omega") == 0) {
+ mask |= omega_command;
+ } else if (strcmp(s, "luatex") == 0) {
+ mask |= luatex_command;
+ }
+ }
+ }
+ }
+ lua_newtable(L);
+ i = 1;
+ while (cs < prim_size) {
+ s = get_prim_text(cs);
+ if (s > 0) {
+ if (get_prim_origin(cs) & mask) {
+ lua_pushstring(L, makecstring(s));
+ lua_rawseti(L, -2, i++);
+ }
+ }
+ cs++;
+ }
+ return 1;
+}
+
+static int tex_enableprimitives(lua_State * L)
+{
+ int n = lua_gettop(L);
+ if (n != 2) {
+ lua_pushstring(L, "wrong number of arguments");
+ lua_error(L);
+ } else {
+ size_t l;
+ int i;
+ char *pre = (char *) luaL_checklstring(L, 1, &l);
+ if (lua_istable(L,2)) {
+ int nncs = no_new_control_sequence;
+ no_new_control_sequence = true;
+ i = 1;
+ while (1) {
+ lua_rawgeti(L,2,i);
+ if (lua_isstring(L,3)) {
+ char *prim = (char *) lua_tostring(L,3);
+ str_number s = maketexstring(prim);
+ halfword prim_val = prim_lookup(s);
+ if (prim_val != undefined_primitive) {
+ char *newprim;
+ size_t newl;
+ halfword cur_cmd = get_prim_eq_type(prim_val);
+ halfword cur_chr = get_prim_equiv(prim_val);
+ if (strncmp(pre,prim,l)!=0) { /* not a prefix */
+ newl = strlen(prim)+l;
+ newprim = (char *) xmalloc (newl+1);
+ strcpy(newprim,pre);
+ strcat(newprim+l,prim);
+ } else {
+ newl = strlen(prim);
+ newprim = (char *) xmalloc (newl+1);
+ strcpy(newprim,prim);
+ }
+ if (string_lookup(newprim, newl) == static_undefined_control_sequence ) {
+ primitive_def(newprim, newl, cur_cmd, cur_chr);
+ }
+ free (newprim);
+ }
+ flush_str(s);
+ } else {
+ lua_pop(L,1);
+ break;
+ }
+ lua_pop(L,1);
+ i++;
+ }
+ lua_pop(L,1); /* the table */
+ no_new_control_sequence = nncs;
+ } else {
+ lua_pushstring(L, "Expected an array of names as second argument");
+ lua_error(L);
+ }
+ }
+ return 0;
}
+
+
+static const struct luaL_reg texlib[] = {
+ {"write", luacwrite},
+ {"print", luacprint},
+ {"sprint", luacsprint},
+ {"setdimen", setdimen},
+ {"getdimen", getdimen},
+ {"setskip", setskip},
+ {"getskip", getskip},
+ {"setattribute", setattribute},
+ {"getattribute", getattribute},
+ {"setcount", setcount},
+ {"getcount", getcount},
+ {"settoks", settoks},
+ {"gettoks", gettoks},
+ {"setbox", setbox},
+ {"getbox", getbox},
+ {"setlist", setlist},
+ {"getlist", getlist},
+ {"setboxwd", setboxwd},
+ {"getboxwd", getboxwd},
+ {"setboxht", setboxht},
+ {"getboxht", getboxht},
+ {"setboxdp", setboxdp},
+ {"getboxdp", getboxdp},
+ {"round", tex_roundnumber},
+ {"scale", tex_scaletable},
+ {"fontname", getfontname},
+ {"fontidentifier", getfontidentifier},
+ {"pdffontname", getpdffontname},
+ {"pdffontobjnum", getpdffontobjnum},
+ {"pdffontsize", getpdffontsize},
+ {"uniformdeviate", getuniformdeviate},
+ {"number", getnumber},
+ {"romannumeral", getromannumeral},
+ {"pdfpageref", getpdfpageref},
+ {"pdfxformname", getpdfxformname},
+ {"definefont", tex_definefont},
+ {"hashtokens", tex_hashpairs},
+ {"primitives", tex_primitives},
+ {"extraprimitives", tex_extraprimitives},
+ {"enableprimitives", tex_enableprimitives},
+ {NULL, NULL} /* sentinel */
+};
+
+int luaopen_tex(lua_State * L)
+{
+ luaL_register(L, "tex", texlib);
+ make_table(L, "attribute", "getattribute", "setattribute");
+ make_table(L, "skip", "getskip", "setskip");
+ make_table(L, "dimen", "getdimen", "setdimen");
+ make_table(L, "count", "getcount", "setcount");
+ make_table(L, "toks", "gettoks", "settoks");
+ make_table(L, "box", "getbox", "setbox");
+ make_table(L, "lists", "getlist", "setlist");
+ make_table(L, "wd", "getboxwd", "setboxwd");
+ make_table(L, "ht", "getboxht", "setboxht");
+ make_table(L, "dp", "getboxdp", "setboxdp");
+ /* make the meta entries */
+ /* fetch it back */
+ luaL_newmetatable(L, "tex_meta");
+ lua_pushstring(L, "__index");
+ lua_pushcfunction(L, gettex);
+ lua_settable(L, -3);
+ lua_pushstring(L, "__newindex");
+ lua_pushcfunction(L, settex);
+ lua_settable(L, -3);
+ lua_setmetatable(L, -2); /* meta to itself */
+ /* initialize the I/O stack: */
+ spindles = xmalloc(sizeof(spindle));
+ spindle_index = 0;
+ spindles[0].head = NULL;
+ spindles[0].tail = NULL;
+ spindle_size = 1;
+ /* a somewhat odd place for this assert, maybe */
+ assert(command_names[data_cmd].command_offset == data_cmd);
+ assert(param_int_pars == (get_count_base() - get_int_base()));
+ return 1;
+}
diff --git a/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c b/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c
index 582779623cf..b81c61f4023 100644
--- a/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/ltokenlib.c
@@ -1,263 +1,284 @@
-/* $Id: ltokenlib.c 1013 2008-02-14 00:09:02Z oneiros $ */
+/* ltokenlib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
+#include "tokens.h"
+static const char _svn_version[] =
+ "$Id: ltokenlib.c 2015 2009-03-13 19:06:34Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/ltokenlib.c $";
-extern int get_command_id (char *);
+extern int get_command_id(char *);
static int max_command = 0;
-static int hash_base = 0;
-static int active_base = 0;
static int null_cs = 0;
#define protected_token 0x1C00001
#define is_valid_token(L,i) (lua_istable(L,i) && lua_objlen(L,i)==3)
-#define get_token_cmd(L,i) lua_rawgeti(L,i,1)
-#define get_token_chr(L,i) lua_rawgeti(L,i,2)
-#define get_token_cs(L,i) lua_rawgeti(L,i,3)
-
-static int
-test_expandable (lua_State *L) {
- integer cmd = -1;
- if (is_valid_token(L,-1)) {
- get_token_cmd(L,-1);
- if (lua_isnumber(L,-1)) {
- cmd = lua_tointeger(L,-1);
- } else if (lua_isstring(L,-1)) {
- cmd = get_command_id((char *)lua_tostring(L,-1));
- }
- if (cmd>max_command) {
- lua_pushboolean(L,1);
+#define get_token_cmd(L,i) lua_rawgeti(L,i,1)
+#define get_token_chr(L,i) lua_rawgeti(L,i,2)
+#define get_token_cs(L,i) lua_rawgeti(L,i,3)
+#define is_active_string(s) (strlen((char *)s)>3 && *s==0xEF && *(s+1)==0xBF && *(s+2)==0xBF)
+
+
+static int test_expandable(lua_State * L)
+{
+ integer cmd = -1;
+ if (is_valid_token(L, -1)) {
+ get_token_cmd(L, -1);
+ if (lua_isnumber(L, -1)) {
+ cmd = lua_tointeger(L, -1);
+ } else if (lua_isstring(L, -1)) {
+ cmd = get_command_id((char *) lua_tostring(L, -1));
+ }
+ if (cmd > max_command) {
+ lua_pushboolean(L, 1);
+ } else {
+ lua_pushboolean(L, 0);
+ }
} else {
- lua_pushboolean(L,0);
+ lua_pushnil(L);
}
- } else {
- lua_pushnil(L);
- }
- return 1;
+ return 1;
}
-static int
-test_protected (lua_State *L) {
- integer chr = -1;
- if (is_valid_token(L,-1)) {
- get_token_chr(L,-1);
- if (lua_isnumber(L,-1)) {
- chr = lua_tointeger(L,-1);
- } else if (lua_isstring(L,-1)) {
- chr = get_command_id((char *)lua_tostring(L,-1));
- }
- if (fixmem[fixmem[chr].hhrh].hhlh==protected_token) {
- lua_pushboolean(L,1);
+static int test_protected(lua_State * L)
+{
+ integer chr = -1;
+ if (is_valid_token(L, -1)) {
+ get_token_chr(L, -1);
+ if (lua_isnumber(L, -1)) {
+ chr = lua_tointeger(L, -1);
+ } else if (lua_isstring(L, -1)) {
+ chr = get_command_id((char *) lua_tostring(L, -1));
+ }
+ if (fixmem[fixmem[chr].hhrh].hhlh == protected_token) {
+ lua_pushboolean(L, 1);
+ } else {
+ lua_pushboolean(L, 0);
+ }
} else {
- lua_pushboolean(L,0);
+ lua_pushnil(L);
}
- } else {
- lua_pushnil(L);
- }
- return 1;
+ return 1;
}
-static int
-test_activechar (lua_State *L) {
- integer cmd = -1;
- if (is_valid_token(L,-1)) {
- get_token_chr(L,-1);
- if (lua_isnumber(L,-1)) {
- cmd = lua_tointeger(L,-1);
- }
- if (cmd>0 && cmd==protected_token) {
- lua_pushboolean(L,1);
- } else {
- lua_pushboolean(L,0);
+static int test_activechar(lua_State * L)
+{
+ if (is_valid_token(L, -1)) {
+ str_number n;
+ integer cs = 0;
+ get_token_cs(L, -1);
+ if (lua_isnumber(L, -1)) {
+ cs = lua_tointeger(L, -1);
+ }
+ lua_pop(L, 1);
+ if (cs != 0 && (n = zget_cs_text(cs)) && n > 0) {
+ unsigned char *s = (unsigned char *) makecstring(n);
+ if (is_active_string(s)) {
+ free(s);
+ lua_pushboolean(L, 1);
+ return 1;
+ }
+ free(s);
+ }
}
- } else {
- lua_pushnil(L);
- }
- return 1;
+ lua_pushboolean(L, 0);
+ return 1;
}
-static int
-run_get_command_name (lua_State *L) {
- int cs;
- if (is_valid_token(L,-1)) {
- get_token_cmd(L,-1);
- if (lua_isnumber(L,-1)) {
- cs = lua_tointeger(L,-1);
- lua_pushstring(L,command_names[cs].cmd_name);
+static int run_get_command_name(lua_State * L)
+{
+ int cs;
+ if (is_valid_token(L, -1)) {
+ get_token_cmd(L, -1);
+ if (lua_isnumber(L, -1)) {
+ cs = lua_tointeger(L, -1);
+ lua_pushstring(L, command_names[cs].cmd_name);
+ } else {
+ lua_pushstring(L, "");
+ }
} else {
- lua_pushstring(L,"");
+ lua_pushnil(L);
}
- } else {
- lua_pushnil(L);
- }
- return 1;
+ return 1;
}
-static int
-run_get_csname_name (lua_State *L) {
- int cs,cmd,n;
- char *s;
-
- if (is_valid_token(L,-1)) {
- get_token_cmd(L,-1);
- if (lua_isnumber(L,-1)) {
- cmd = lua_tointeger(L,-1);
- }
- lua_pop(L,1);
- cs = 0;
- get_token_cs(L,-1);
- if (lua_isnumber(L,-1)) {
- cs = lua_tointeger(L,-1);
- }
- lua_pop(L,1);
-
- if (cs != 0 && (n = zget_cs_text(cs)) && n>=0) {
- s = makecstring(n);
- lua_pushstring(L,s);
- } else {
- lua_pushstring(L,"");
- }
- } else {
- lua_pushnil(L);
- }
- return 1;
+
+static int run_get_csname_name(lua_State * L)
+{
+ int cs, cmd, n;
+
+ if (is_valid_token(L, -1)) {
+ get_token_cmd(L, -1);
+ if (lua_isnumber(L, -1)) {
+ cmd = lua_tointeger(L, -1);
+ }
+ lua_pop(L, 1);
+ cs = 0;
+ get_token_cs(L, -1);
+ if (lua_isnumber(L, -1)) {
+ cs = lua_tointeger(L, -1);
+ }
+ lua_pop(L, 1);
+
+ if (cs != 0 && (n = zget_cs_text(cs)) && n >= 0) {
+ unsigned char *s = (unsigned char *) makecstring(n);
+ if (is_active_string(s))
+ lua_pushstring(L, (char *) (s + 3));
+ else
+ lua_pushstring(L, (char *) s);
+ } else {
+ lua_pushstring(L, "");
+ }
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
}
-static int
-run_get_command_id (lua_State *L) {
- int cs = -1;
- if (lua_isstring(L,-1)) {
- cs = get_command_id((char *)lua_tostring(L,-1));
- }
- lua_pushnumber(L,cs);
- return 1;
+static int run_get_command_id(lua_State * L)
+{
+ int cs = -1;
+ if (lua_isstring(L, -1)) {
+ cs = get_command_id((char *) lua_tostring(L, -1));
+ }
+ lua_pushnumber(L, cs);
+ return 1;
}
-static int
-run_get_csname_id (lua_State *L) {
- int texstr;
- char *s;
- size_t k,cs = 0;
- if (lua_isstring(L,-1)) {
- s = (char *)lua_tolstring(L,-1, &k);
- texstr = maketexlstring(s,k);
- cs = string_lookup(texstr);
- flush_str(texstr);
- }
- lua_pushnumber(L,cs);
- return 1;
+static int run_get_csname_id(lua_State * L)
+{
+ char *s;
+ size_t k, cs = 0;
+ if (lua_isstring(L, -1)) {
+ s = (char *) lua_tolstring(L, -1, &k);
+ cs = string_lookup(s, k);
+ }
+ lua_pushnumber(L, cs);
+ return 1;
}
-void
-make_token_table (lua_State *L, int cmd, int chr, int cs) {
- lua_createtable(L,3,0);
- lua_pushnumber(L,cmd);
- lua_rawseti(L,-2,1);
- lua_pushnumber(L,chr);
- lua_rawseti(L,-2,2);
- lua_pushnumber(L,cs);
- lua_rawseti(L,-2,3);
+void make_token_table(lua_State * L, int cmd, int chr, int cs)
+{
+ lua_createtable(L, 3, 0);
+ lua_pushnumber(L, cmd);
+ lua_rawseti(L, -2, 1);
+ lua_pushnumber(L, chr);
+ lua_rawseti(L, -2, 2);
+ lua_pushnumber(L, cs);
+ lua_rawseti(L, -2, 3);
}
-static int
-run_get_next (lua_State *L) {
- int save_nncs;
- save_nncs = no_new_control_sequence;
- no_new_control_sequence = 0;
- get_next();
- no_new_control_sequence = save_nncs;
- make_token_table(L,cur_cmd,cur_chr,cur_cs);
- return 1;
+static int run_get_next(lua_State * L)
+{
+ int save_nncs;
+ save_nncs = no_new_control_sequence;
+ no_new_control_sequence = 0;
+ get_next();
+ no_new_control_sequence = save_nncs;
+ make_token_table(L, cur_cmd, cur_chr, cur_cs);
+ return 1;
}
-static int
-run_expand (lua_State *L) {
- expand();
- return 0;
+static int run_expand(lua_State * L)
+{
+ expand();
+ return 0;
}
-static int
-run_lookup (lua_State *L) {
- char *s;
- size_t l;
- str_number t;
- integer cs,cmd,chr;
- int save_nncs;
- if (lua_isstring(L,-1)) {
- s = (char *)lua_tolstring(L,-1,&l);
- if (l>0) {
- save_nncs = no_new_control_sequence;
- no_new_control_sequence = true;
- cs = id_lookup((last+1),l); /* cleans up the lookup buffer */
- t = maketexlstring(s,l);
- cs = string_lookup(t);
- flush_str(t);
- cmd = zget_eq_type(cs);
- chr = zget_equiv(cs);
- make_token_table(L,cmd,chr,cs);
- no_new_control_sequence = save_nncs;
- return 1;
+static int run_lookup(lua_State * L)
+{
+ char *s;
+ size_t l;
+ integer cs, cmd, chr;
+ int save_nncs;
+ if (lua_isstring(L, -1)) {
+ s = (char *) lua_tolstring(L, -1, &l);
+ if (l > 0) {
+ save_nncs = no_new_control_sequence;
+ no_new_control_sequence = true;
+ cs = id_lookup((last + 1), l); /* cleans up the lookup buffer */
+ cs = string_lookup(s, l);
+ cmd = zget_eq_type(cs);
+ chr = zget_equiv(cs);
+ make_token_table(L, cmd, chr, cs);
+ no_new_control_sequence = save_nncs;
+ return 1;
+ }
}
- }
- lua_newtable(L);
- return 1;
+ lua_newtable(L);
+ return 1;
}
-static int
-run_build (lua_State *L) {
- integer cmd,chr,cs;
- if (lua_isnumber(L,1)) {
- cs =0;
- chr = lua_tointeger(L,1);
- cmd = luaL_optinteger(L,2,zget_char_cat_code(chr));
- if (cmd==0 || cmd == 9 || cmd == 14 || cmd == 15) {
- fprintf(stdout, "\n\nluatex error: not a good token.\nCatcode %i can not be returned, so I replaced it by 12 (other)",(int)cmd);
- error();
- cmd=12;
- }
- if (cmd == 13) {
- cs=chr+active_base;
- cmd=zget_eq_type(cs);
- chr=zget_equiv(cs);
+static int run_build(lua_State * L)
+{
+ integer cmd, chr, cs;
+ if (lua_isnumber(L, 1)) {
+ cs = 0;
+ chr = lua_tointeger(L, 1);
+ cmd = luaL_optinteger(L, 2, get_char_cat_code(chr));
+ if (cmd == 0 || cmd == 9 || cmd == 14 || cmd == 15) {
+ fprintf(stdout,
+ "\n\nluatex error: not a good token.\nCatcode %i can not be returned, so I replaced it by 12 (other)",
+ (int) cmd);
+ error();
+ cmd = 12;
+ }
+ if (cmd == 13) {
+ cs = active_to_cs(chr, false);
+ cmd = zget_eq_type(cs);
+ chr = zget_equiv(cs);
+ }
+ make_token_table(L, cmd, chr, cs);
+ return 1;
+ } else {
+ return run_lookup(L);
}
- make_token_table(L,cmd,chr,cs);
- return 1;
- } else {
- return run_lookup(L);
- }
}
-static const struct luaL_reg tokenlib [] = {
- {"get_next", run_get_next},
- {"expand", run_expand},
- {"lookup", run_lookup},
- {"create", run_build},
- {"is_expandable",test_expandable},
- {"is_activechar",test_activechar},
- {"is_protected", test_protected},
- {"csname_id", run_get_csname_id},
- {"csname_name", run_get_csname_name},
- {"command_name", run_get_command_name},
- {"command_id", run_get_command_id},
- {NULL, NULL} /* sentinel */
+static const struct luaL_reg tokenlib[] = {
+ {"get_next", run_get_next},
+ {"expand", run_expand},
+ {"lookup", run_lookup},
+ {"create", run_build},
+ {"is_expandable", test_expandable},
+ {"is_activechar", test_activechar},
+ {"is_protected", test_protected},
+ {"csname_id", run_get_csname_id},
+ {"csname_name", run_get_csname_name},
+ {"command_name", run_get_command_name},
+ {"command_id", run_get_command_id},
+ {NULL, NULL} /* sentinel */
};
-int luaopen_token (lua_State *L)
+int luaopen_token(lua_State * L)
{
- luaL_register(L, "token", tokenlib);
- max_command = get_max_command();
- hash_base = get_hash_base();
- active_base = get_active_base();
- null_cs = get_nullcs();
- return 1;
+ luaL_register(L, "token", tokenlib);
+ max_command = get_max_command();
+ null_cs = get_nullcs();
+ return 1;
}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.c b/Build/source/texk/web2c/luatexdir/lua/luainit.c
index 3aa5dfc35b5..f89607530ac 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.c
@@ -1,3 +1,22 @@
+/* luainit.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
#include <sys/stat.h>
#include "luatex-api.h"
@@ -5,21 +24,37 @@
#include <luatexdir/luatexextra.h>
-#ifndef program_invocation_name
-/* char *program_invocation_name = NULL; */
-#endif
-
-extern void parse_src_specials_option (char *n) ;
+static const char _svn_version[] =
+ "$Id: luainit.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/luainit.c $";
+
+/* TH: TODO
+ *
+ * This file is getting a bit messy, but it is not simple to fix unilaterally.
+ *
+ * Better to wait until Karl has some time (after texlive 2008) so we can
+ * synchronize with kpathsea. One problem, for instance, is that I would
+ * like to resolve the full executable path. kpse_set_program_name() does
+ * that, indirectly (by setting SELFAUTOLOC in the environment), but it
+ * does much more, making it hard to use for our purpose.
+ *
+ * In fact, it sets three C variables:
+ * program_invocation_name program_invocation_short_name kpse->program_name
+ * and four environment variables:
+ * SELFAUTOLOC SELFAUTODIR SELFAUTOPARENT progname
+ *
+ */
+
+extern string normalize_quotes(const_string name, const_string mesg);
const_string LUATEX_IHELP[] = {
"Usage: luatex --lua=FILE [OPTION]... [TEXNAME[.tex]] [COMMANDS]",
" or: luatex --lua=FILE [OPTION]... \\FIRST-LINE",
" or: luatex --lua=FILE [OPTION]... &FMT ARGS",
- " Run luaTeX on TEXNAME, usually creating TEXNAME.pdf.",
+ " Run LuaTeX on TEXNAME, usually creating TEXNAME.pdf.",
" Any remaining COMMANDS are processed as luatex input, after TEXNAME is read.",
"",
" Alternatively, if the first non-option argument begins with a backslash,",
- " interpret all non-option arguments as a line of luatex input.",
+ " luatex interprets all non-option arguments as an input line.",
"",
" Alternatively, if the first non-option argument begins with a &, the",
" next word is taken as the FMT to read, overriding all else. Any",
@@ -28,7 +63,8 @@ const_string LUATEX_IHELP[] = {
" If no arguments or options are specified, prompt for input.",
"",
" --lua=FILE the lua initialization file",
- " --safer disable some easily exploitable lua commands",
+ " --nosocket disable the luasocket (network) library",
+ " --safer disable easily exploitable lua commands",
" --fmt=FORMAT load the format file FORMAT",
" --ini be initex, for dumping formats",
" --help display this help and exit",
@@ -41,23 +77,50 @@ const_string LUATEX_IHELP[] = {
NULL
};
+char *ex_selfdir(char *argv0)
+{
+#if defined(WIN32)
+ char short_path[PATH_MAX], path[PATH_MAX], *fp;
+
+ /* SearchPath() always gives back an absolute directory */
+ if (SearchPath(NULL, argv0, ".exe", PATH_MAX, short_path, &fp) == 0)
+ FATAL1("Can't determine where the executable %s is.\n", argv0);
+ if (!win32_get_long_filename(short_path, path, sizeof(path))) {
+ FATAL1("This path points to an invalid file : %s\n", short_path);
+ }
+ /* slashify the dirname */
+ for (fp = path; fp && *fp; fp++)
+ if (IS_DIR_SEP(*fp))
+ *fp = DIR_SEP;
+ /* sdir will be the directory of the executable, ie: c:/TeX/bin */
+ return xdirname(path);
+#else
+ return kpse_selfdir(argv0);
+#endif
+}
+
static void
prepare_cmdline(lua_State * L, char **argv, int argc, int zero_offset)
{
int i;
+ char *s;
luaL_checkstack(L, argc + 3, "too many arguments to script");
lua_createtable(L, 0, 0);
for (i = 0; i < argc; i++) {
- lua_pushstring(L, argv[i]);
- lua_rawseti(L, -2, (i-zero_offset));
+ lua_pushstring(L, argv[i]);
+ lua_rawseti(L, -2, (i - zero_offset));
}
lua_setglobal(L, "arg");
+ lua_getglobal(L, "os");
+ s = ex_selfdir(argv[0]);
+ lua_pushstring(L, s);
+ xfree(s);
+ lua_setfield(L, -2, "selfdir");
return;
}
extern string dump_name;
extern const_string c_job_name;
-extern boolean srcspecialsoption;
extern char *last_source_name;
extern int last_lineno;
@@ -66,7 +129,7 @@ string input_name = NULL;
static string user_progname = NULL;
extern char *ptexbanner;
-extern int program_name_set; /* in lkpselib.c */
+extern int program_name_set; /* in lkpselib.c */
/* for topenin() */
extern char **argv;
@@ -77,6 +140,7 @@ int lua_only = 0;
int lua_offset = 0;
int safer_option = 0;
+int nosocket_option = 0;
/* Reading the options. */
@@ -87,444 +151,448 @@ int safer_option = 0;
/* SunOS cc can't initialize automatic structs, so make this static. */
static struct option long_options[]
- = { { "fmt", 1, 0, 0},
- { "lua", 1, 0, 0},
- { "luaonly", 0, 0, 0},
- { "safer", 0, &safer_option, 1},
- { "help", 0, 0, 0 },
- { "ini", 0, &ini_version, 1 },
- { "interaction", 1, 0, 0 },
- { "halt-on-error", 0, &haltonerrorp, 1 },
- { "kpathsea-debug", 1, 0, 0 },
- { "progname", 1, 0, 0 },
- { "version", 0, 0, 0 },
- { "recorder", 0, &recorder_enabled, 1 },
- { "etex", 0, 0, 0 },
- { "output-comment", 1, 0, 0 },
- { "output-directory", 1, 0, 0 },
- { "draftmode", 0, 0, 0 },
- { "output-format", 1, 0, 0 },
- { "shell-escape", 0, &shellenabledp, 1 },
- { "no-shell-escape", 0, &shellenabledp, -1 },
- { "enable-write18", 0, &shellenabledp, 1 },
- { "disable-write18", 0, &shellenabledp, -1 },
- { "shell-restricted", 0, 0, 0 },
- { "debug-format", 0, &debug_format_file, 1 },
- { "src-specials", 2, 0, 0 },
- { "file-line-error-style", 0, &filelineerrorstylep, 1 },
- { "no-file-line-error-style", 0, &filelineerrorstylep, -1 },
+= { {"fmt", 1, 0, 0},
+{"lua", 1, 0, 0},
+{"luaonly", 0, 0, 0},
+{"safer", 0, &safer_option, 1},
+{"nosocket", 0, &nosocket_option, 1},
+{"help", 0, 0, 0},
+{"ini", 0, &ini_version, 1},
+{"interaction", 1, 0, 0},
+{"halt-on-error", 0, &haltonerrorp, 1},
+{"kpathsea-debug", 1, 0, 0},
+{"progname", 1, 0, 0},
+{"version", 0, 0, 0},
+{"credits", 0, 0, 0},
+{"recorder", 0, &recorder_enabled, 1},
+{"etex", 0, 0, 0},
+{"output-comment", 1, 0, 0},
+{"output-directory", 1, 0, 0},
+{"draftmode", 0, 0, 0},
+{"output-format", 1, 0, 0},
+{"shell-escape", 0, &shellenabledp, 1},
+{"no-shell-escape", 0, &shellenabledp, -1},
+{"debug-format", 0, &debug_format_file, 1},
+{"file-line-error-style", 0, &filelineerrorstylep, 1},
+{"no-file-line-error-style", 0, &filelineerrorstylep, -1},
/* Shorter option names for the above. */
- { "file-line-error", 0, &filelineerrorstylep, 1 },
- { "no-file-line-error", 0, &filelineerrorstylep, -1 },
- { "jobname", 1, 0, 0 },
- { "parse-first-line", 0, &parsefirstlinep, 1 },
- { "no-parse-first-line", 0, &parsefirstlinep, -1 },
- { "translate-file", 1, 0, 0 },
- { "default-translate-file", 1, 0, 0 },
- { "8bit", 0, 0, 0 },
- { "mktex", 1, 0, 0 },
- { "no-mktex", 1, 0, 0 },
+{"file-line-error", 0, &filelineerrorstylep, 1},
+{"no-file-line-error", 0, &filelineerrorstylep, -1},
+{"jobname", 1, 0, 0},
+{"parse-first-line", 0, &parsefirstlinep, 1},
+{"no-parse-first-line", 0, &parsefirstlinep, -1},
+{"translate-file", 1, 0, 0},
+{"default-translate-file", 1, 0, 0},
+{"8bit", 0, 0, 0},
+{"mktex", 1, 0, 0},
+{"no-mktex", 1, 0, 0},
+/* Synchronization: just like "interaction" above */
+{"synctex", 1, 0, 0},
{0, 0, 0, 0}
};
-static void
-parse_options(int argc, char **argv)
+static void parse_options(int argc, char **argv)
{
- int g; /* `getopt' return code. */
- int option_index;
- char *firstfile = NULL;
- opterr = 0; /* dont whine */
- for (;;) {
- g = getopt_long_only(argc, argv, "+", long_options, &option_index);
-
- if (g == -1) /* End of arguments, exit the loop. */
- break;
- if (g == '?') /* Unknown option. */
- continue;
-
- assert(g == 0); /* We have no short option names. */
-
- if (ARGUMENT_IS("luaonly")) {
- lua_only = 1;
- lua_offset = optind;
- luainit = 1 ;
- } else if (ARGUMENT_IS("lua")) {
- startup_filename = optarg;
- lua_offset = (optind-1);
- luainit = 1 ;
-
- } else if (ARGUMENT_IS ("kpathsea-debug")) {
- kpathsea_debug |= atoi (optarg);
-
- } else if (ARGUMENT_IS("progname")) {
- user_progname = optarg;
-
- } else if (ARGUMENT_IS ("jobname")) {
- c_job_name = optarg;
-
- } else if (ARGUMENT_IS("fmt")) {
- dump_name = optarg;
-
- } else if (ARGUMENT_IS ("output-directory")) {
- output_directory = optarg;
-
- } else if (ARGUMENT_IS ("output-comment")) {
- unsigned len = strlen (optarg);
- if (len < 256) {
- output_comment = optarg;
- } else {
- WARNING2 ("Comment truncated to 255 characters from %d. (%s)",
- len, optarg);
- output_comment = (string)xmalloc (256);
- strncpy (output_comment, optarg, 255);
- output_comment[255] = 0;
- }
-
- } else if (ARGUMENT_IS ("src-specials")) {
- last_source_name = xstrdup("");
- /* Option `--src" without any value means `auto' mode. */
- if (optarg == NULL) {
- insertsrcspecialeverypar = true;
- insertsrcspecialauto = true;
- srcspecialsoption = true;
- srcspecialsp = true;
- } else {
- parse_src_specials_option(optarg);
- }
-
- } else if (ARGUMENT_IS ("output-format")) {
- pdf_output_option = 1;
- if (strcmp(optarg, "dvi") == 0) {
- pdf_output_value = 0;
- } else if (strcmp(optarg, "pdf") == 0) {
- pdf_output_value = 2;
- } else {
- WARNING1 ("Ignoring unknown value `%s' for --output-format", optarg);
- pdf_output_option = 0;
- }
-
- } else if (ARGUMENT_IS ("draftmode")) {
- pdf_draftmode_option = 1;
- pdf_draftmode_value = 1;
-
- } else if (ARGUMENT_IS ("mktex")) {
- kpse_maketex_option (optarg, true);
-
- } else if (ARGUMENT_IS ("no-mktex")) {
- kpse_maketex_option (optarg, false);
-
- } else if (ARGUMENT_IS ("interaction")) {
- /* These numbers match @d's in *.ch */
- if (STREQ (optarg, "batchmode")) {
- interactionoption = 0;
- } else if (STREQ (optarg, "nonstopmode")) {
- interactionoption = 1;
- } else if (STREQ (optarg, "scrollmode")) {
- interactionoption = 2;
- } else if (STREQ (optarg, "errorstopmode")) {
- interactionoption = 3;
- } else {
- WARNING1 ("Ignoring unknown argument `%s' to --interaction", optarg);
- }
-
- } else if (ARGUMENT_IS("help")) {
- usagehelp(LUATEX_IHELP, BUG_ADDRESS);
-
- } else if (ARGUMENT_IS("version")) {
- char *versions;
- initversionstring(&versions);
- print_version_banner();
-
- puts(
-"\n\nLuaTeX merges and builds upon (parts of) the code from these projects:\n\n"
-"tex by Donald Knuth\n"
-"etex by Peter Breitenlohner, Phil Taylor and friends\n"
-"omega by John Plaice and Yannis Haralambous\n"
-"aleph by Giuseppe Bilotta\n"
-"pdftex by Han The Thanh and friends\n"
-"kpathsea by Karl Berry, Olaf Weber and others\n"
-"lua by Roberto Ierusalimschy, Waldemar Celes,\n"
-" Luiz Henrique de Figueiredo\n"
-"metapost by John Hobby, Taco Hoekwater and friends.\n"
-"xpdf by Derek Noonberg (partial)\n"
-"fontforge by George Williams (partial)\n\n"
-"Some extensions to lua and additional lua libraries are used, as well as\n"
-"libraries for graphic inclusion. More details can be found in the source.\n"
-"Code development was sponsored by a grant from Colorado State University\n"
-"via the 'oriental tex' project, the TeX User Groups, and donations.\n\n"
-"The LuaTeX team is Hans Hagen, Hartmut Henkel, Taco Hoekwater.\n\n"
-"There is NO warranty. Redistribution of this software is covered by\n"
-"the terms of the GNU General Public License, version 2. For more\n"
-"information about these matters, see the file named COPYING and\n"
-"the LuaTeX source.\n\n"
-"Copyright 2008 Taco Hoekwater, the LuaTeX Team.\n");
-
- puts(versions);
- uexit(0);
- }
- }
- /* attempt to find dump_name */
- if (argv[optind] && argv[optind][0] == '&') {
- dump_name = strdup(argv[optind] + 1);
- } else if (argv[optind] && argv[optind][0] != '\\') {
- if (argv[optind][0] == '*') {
- input_name = strdup(argv[optind] + 1);
- } else {
- firstfile = strdup(argv[optind]);
- if (lua_only) {
- startup_filename = firstfile;
- } else {
- if ((strstr(firstfile,".lua") == firstfile+strlen(firstfile)-4) ||
- (strstr(firstfile,".luc") == firstfile+strlen(firstfile)-4) ||
- (strstr(firstfile,".LUA") == firstfile+strlen(firstfile)-4) ||
- (strstr(firstfile,".LUC") == firstfile+strlen(firstfile)-4) ||
- (strstr(argv[0],"luatexlua") != NULL) ||
- (strstr(argv[0],"texlua") != NULL)) {
- startup_filename = firstfile;
- lua_only = 1;
- lua_offset = optind;
- luainit = 1 ;
- } else {
- input_name = firstfile;
- }
- }
- }
- } else {
- if ((strstr(argv[0],"luatexlua") != NULL)||
- (strstr(argv[0],"texlua") != NULL)) {
- lua_only = 1;
- luainit = 1 ;
- }
- }
+ int g; /* `getopt' return code. */
+ int option_index;
+ char *firstfile = NULL;
+ opterr = 0; /* dont whine */
+ for (;;) {
+ g = getopt_long_only(argc, argv, "+", long_options, &option_index);
+
+ if (g == -1) /* End of arguments, exit the loop. */
+ break;
+ if (g == '?') /* Unknown option. */
+ continue;
+
+ assert(g == 0); /* We have no short option names. */
+
+ if (ARGUMENT_IS("luaonly")) {
+ lua_only = 1;
+ lua_offset = optind;
+ luainit = 1;
+ } else if (ARGUMENT_IS("lua")) {
+ startup_filename = optarg;
+ lua_offset = (optind - 1);
+ luainit = 1;
+
+ } else if (ARGUMENT_IS("kpathsea-debug")) {
+ kpathsea_debug |= atoi(optarg);
+
+ } else if (ARGUMENT_IS("progname")) {
+ user_progname = optarg;
+
+ } else if (ARGUMENT_IS("jobname")) {
+ c_job_name = optarg;
+
+ } else if (ARGUMENT_IS("fmt")) {
+ dump_name = optarg;
+
+ } else if (ARGUMENT_IS("output-directory")) {
+ output_directory = optarg;
+
+ } else if (ARGUMENT_IS("output-comment")) {
+ unsigned len = strlen(optarg);
+ if (len < 256) {
+ output_comment = optarg;
+ } else {
+ WARNING2("Comment truncated to 255 characters from %d. (%s)",
+ len, optarg);
+ output_comment = (string) xmalloc(256);
+ strncpy(output_comment, optarg, 255);
+ output_comment[255] = 0;
+ }
+
+ } else if (ARGUMENT_IS("output-format")) {
+ pdf_output_option = 1;
+ if (strcmp(optarg, "dvi") == 0) {
+ pdf_output_value = 0;
+ } else if (strcmp(optarg, "pdf") == 0) {
+ pdf_output_value = 2;
+ } else {
+ WARNING1("Ignoring unknown value `%s' for --output-format",
+ optarg);
+ pdf_output_option = 0;
+ }
+
+ } else if (ARGUMENT_IS("draftmode")) {
+ pdf_draftmode_option = 1;
+ pdf_draftmode_value = 1;
+
+ } else if (ARGUMENT_IS("mktex")) {
+ kpse_maketex_option(optarg, true);
+
+ } else if (ARGUMENT_IS("no-mktex")) {
+ kpse_maketex_option(optarg, false);
+
+ } else if (ARGUMENT_IS("interaction")) {
+ /* These numbers match @d's in *.ch */
+ if (STREQ(optarg, "batchmode")) {
+ interactionoption = 0;
+ } else if (STREQ(optarg, "nonstopmode")) {
+ interactionoption = 1;
+ } else if (STREQ(optarg, "scrollmode")) {
+ interactionoption = 2;
+ } else if (STREQ(optarg, "errorstopmode")) {
+ interactionoption = 3;
+ } else {
+ WARNING1("Ignoring unknown argument `%s' to --interaction",
+ optarg);
+ }
+
+ } else if (ARGUMENT_IS("synctex")) {
+ /* Synchronize TeXnology: catching the command line option as a long */
+ synctexoption = (int) strtol(optarg, NULL, 0);
+
+ } else if (ARGUMENT_IS("help")) {
+ usagehelp(LUATEX_IHELP, BUG_ADDRESS);
+
+ } else if (ARGUMENT_IS("version")) {
+ print_version_banner();
+ /* *INDENT-OFF* */
+ puts("\n\nExecute 'luatex --credits' for credits and version details.\n\n"
+ "There is NO warranty. Redistribution of this software is covered by\n"
+ "the terms of the GNU General Public License, version 2. For more\n"
+ "information about these matters, see the file named COPYING and\n"
+ "the LuaTeX source.\n\n"
+ "Copyright 2009 Taco Hoekwater, the LuaTeX Team.\n");
+ /* *INDENT-ON* */
+ uexit(0);
+ } else if (ARGUMENT_IS("credits")) {
+ char *versions;
+ initversionstring(&versions);
+ print_version_banner();
+ /* *INDENT-OFF* */
+ puts("\n\nThe LuaTeX team is Hans Hagen, Hartmut Henkel, Taco Hoekwater.\n"
+ "LuaTeX merges and builds upon (parts of) the code from these projects:\n\n"
+ "tex by Donald Knuth\n"
+ "etex by Peter Breitenlohner, Phil Taylor and friends\n"
+ "omega by John Plaice and Yannis Haralambous\n"
+ "aleph by Giuseppe Bilotta\n"
+ "pdftex by Han The Thanh and friends\n"
+ "kpathsea by Karl Berry, Olaf Weber and others\n"
+ "lua by Roberto Ierusalimschy, Waldemar Celes,\n"
+ " Luiz Henrique de Figueiredo\n"
+ "metapost by John Hobby, Taco Hoekwater and friends.\n"
+ "xpdf by Derek Noonberg (partial)\n"
+ "fontforge by George Williams (partial)\n\n"
+ "Some extensions to lua and additional lua libraries are used, as well as\n"
+ "libraries for graphic inclusion. More details can be found in the source.\n"
+ "Code development was sponsored by a grant from Colorado State University\n"
+ "via the 'oriental tex' project, the TeX User Groups, and donations.\n");
+ /* *INDENT-ON* */
+ puts(versions);
+ uexit(0);
+ }
+ }
+ /* attempt to find dump_name */
+ if (argv[optind] && argv[optind][0] == '&') {
+ dump_name = strdup(argv[optind] + 1);
+ } else if (argv[optind] && argv[optind][0] != '\\') {
+ if (argv[optind][0] == '*') {
+ input_name = strdup(argv[optind] + 1);
+ } else {
+ firstfile = strdup(argv[optind]);
+ if (lua_only) {
+ startup_filename = firstfile;
+ } else {
+ if ((strstr(firstfile, ".lua") ==
+ firstfile + strlen(firstfile) - 4)
+ || (strstr(firstfile, ".luc") ==
+ firstfile + strlen(firstfile) - 4)
+ || (strstr(firstfile, ".LUA") ==
+ firstfile + strlen(firstfile) - 4)
+ || (strstr(firstfile, ".LUC") ==
+ firstfile + strlen(firstfile) - 4)
+ || (strstr(argv[0], "luatexlua") != NULL)
+ || (strstr(argv[0], "texlua") != NULL)) {
+ startup_filename = firstfile;
+ lua_only = 1;
+ lua_offset = optind;
+ luainit = 1;
+ } else {
+ input_name = firstfile;
+ }
+ }
+ }
+ } else {
+ if ((strstr(argv[0], "luatexlua") != NULL) ||
+ (strstr(argv[0], "texlua") != NULL)) {
+ lua_only = 1;
+ luainit = 1;
+ }
+ }
+ if (safer_option) /* --safer implies --nosocket */
+ nosocket_option = 1;
+
+ /* Finalize the input filename. */
+ if (input_name != NULL) {
+ argv[optind] = normalize_quotes(input_name, "argument");
+ }
}
/* test for readability */
#define is_readable(a) (stat(a,&finfo)==0) && S_ISREG(finfo.st_mode) && \
(f=fopen(a,"r")) != NULL && !fclose(f)
-char *
-find_filename(char *name, char *envkey)
+char *find_filename(char *name, char *envkey)
{
struct stat finfo;
char *dirname = NULL;
char *filename = NULL;
FILE *f;
if (is_readable(name)) {
- return name;
+ return name;
} else {
- dirname = getenv(envkey);
- if ((dirname != NULL) && strlen(dirname)) {
- dirname = strdup(getenv(envkey));
- if (*(dirname + strlen(dirname) - 1) == '/') {
- *(dirname + strlen(dirname) - 1) = 0;
- }
- filename = xmalloc(strlen(dirname) + strlen(name) + 2);
- filename = concat3(dirname, "/", name);
- if (is_readable(filename)) {
- xfree(dirname);
- return filename;
- }
- xfree(filename);
- }
+ dirname = getenv(envkey);
+ if ((dirname != NULL) && strlen(dirname)) {
+ dirname = strdup(getenv(envkey));
+ if (*(dirname + strlen(dirname) - 1) == '/') {
+ *(dirname + strlen(dirname) - 1) = 0;
+ }
+ filename = xmalloc(strlen(dirname) + strlen(name) + 2);
+ filename = concat3(dirname, "/", name);
+ if (is_readable(filename)) {
+ xfree(dirname);
+ return filename;
+ }
+ xfree(filename);
+ }
}
return NULL;
}
-void
-init_kpse (void) {
-
- if (!user_progname) {
- user_progname = dump_name;
- } else if (!dump_name) {
- dump_name = user_progname;
- }
- if (!user_progname) {
- if (ini_version) {
- user_progname = input_name;
- } else {
- if(!startup_filename) {
- if (!dump_name) {
- dump_name = strdup(argv[0]);
- user_progname = dump_name;
- }
- }
- }
- }
- if (!user_progname) {
- fprintf(stdout,
- "kpathsea mode needs a --progname or --fmt switch\n");
- exit(1);
- }
-
- kpse_set_program_enabled (kpse_fmt_format, MAKE_TEX_FMT_BY_DEFAULT,
- kpse_src_compile);
-
- kpse_set_program_name(argv[0], user_progname);
- program_name_set=1;
-
- /* Needs program_name set. */
- init_shell_escape ();
-}
-
-void
-fix_dumpname (void) {
- int dist;
- if (dump_name) {
- /* adjust array for Pascal and provide extension, if needed */
- dist = strlen(dump_name) - strlen(DUMP_EXT);
- if (strstr(dump_name, DUMP_EXT) == dump_name + dist)
- DUMP_VAR = concat(" ", dump_name);
- else
- DUMP_VAR = concat3(" ", dump_name, DUMP_EXT);
- DUMP_LENGTH_VAR = strlen(DUMP_VAR + 1);
- } else {
- /* For dump_name to be NULL is a bug. */
- if (!ini_version)
- abort();
- }
+char *cleaned_invocation_name(char *arg)
+{
+ char *ret, *dot;
+ const char *start = xbasename(arg);
+ ret = xstrdup(start);
+ dot = index(ret, '.');
+ if (dot != NULL) {
+ *dot = 0; /* chop */
+ }
+ return ret;
}
-void
-lua_initialize(int ac, char **av)
+void init_kpse(void)
{
- char *given_file = NULL;
- int kpse_init;
- int tex_table_id;
- int pdf_table_id;
- int token_table_id;
- int node_table_id;
- /* Save to pass along to topenin. */
- argc = ac;
- argv = av;
-
- ptexbanner = BANNER;
- program_invocation_name = argv[0];
-
- /* be 'luac' */
- if (argc>1 &&
- (STREQ(argv[0],"texluac") ||
- STREQ(argv[1],"--luaconly") ||
- STREQ(argv[1],"--luac"))) {
- exit(luac_main(ac,av));
- }
-
- /* Must be initialized before options are parsed. */
- interactionoption = 4;
- dump_name = NULL;
- /* parse commandline */
- parse_options(ac, av);
-
- /* make sure that the locale is 'sane' (for lua) */
- putenv("LC_CTYPE=C");
- putenv("LC_COLLATE=C");
- putenv("LC_NUMERIC=C");
-
- /* this is sometimes needed */
- putenv("engine=luatex");
-
- luainterpreter(0);
-
- prepare_cmdline(Luas[0], argv, argc, lua_offset); /* collect arguments */
-
- if (startup_filename != NULL) {
- given_file = xstrdup(startup_filename);
- startup_filename = find_filename(startup_filename, "LUATEXDIR");
- }
- /* now run the file */
- if (startup_filename != NULL) {
- /* hide the 'tex' and 'pdf' table */
- tex_table_id = hide_lua_table(Luas[0], "tex");
- token_table_id = hide_lua_table(Luas[0], "token");
- node_table_id = hide_lua_table(Luas[0], "node");
- pdf_table_id = hide_lua_table(Luas[0], "pdf");
-
- if (luaL_loadfile(Luas[0], startup_filename)) {
- fprintf(stdout, "%s\n",lua_tostring(Luas[0], -1));
- exit(1);
+ if (!user_progname) {
+ user_progname = dump_name;
+ } else if (!dump_name) {
+ dump_name = user_progname;
}
- if (lua_pcall(Luas[0], 0, 0, 0)) {
- fprintf(stdout, "%s\n",lua_tostring(Luas[0], -1));
- exit(1);
+ if (!user_progname) {
+ if (ini_version) {
+ user_progname = input_name;
+ } else {
+ if (!startup_filename) {
+ if (!dump_name) {
+ dump_name = cleaned_invocation_name(argv[0]);
+ user_progname = dump_name;
+ }
+ }
+ }
}
- /* no filename? quit now! */
- if (!input_name) {
- get_lua_string("texconfig", "jobname", &input_name);
+ if (!user_progname) {
+ fprintf(stdout, "kpathsea mode needs a --progname or --fmt switch\n");
+ exit(1);
}
- if (!dump_name) {
- get_lua_string("texconfig", "formatname", &dump_name);
+
+ kpse_set_program_enabled(kpse_fmt_format, MAKE_TEX_FMT_BY_DEFAULT,
+ kpse_src_compile);
+
+ kpse_set_program_name(argv[0], user_progname);
+ program_name_set = 1;
+}
+
+void fix_dumpname(void)
+{
+ int dist;
+ if (dump_name) {
+ /* adjust array for Pascal and provide extension, if needed */
+ dist = strlen(dump_name) - strlen(DUMP_EXT);
+ if (strstr(dump_name, DUMP_EXT) == dump_name + dist)
+ DUMP_VAR = concat(" ", dump_name);
+ else
+ DUMP_VAR = concat3(" ", dump_name, DUMP_EXT);
+ DUMP_LENGTH_VAR = strlen(DUMP_VAR + 1);
+ } else {
+ /* For dump_name to be NULL is a bug. */
+ if (!ini_version)
+ abort();
}
- if ((lua_only) || ((!input_name) && (!dump_name))) {
- exit(0);
+}
+
+void lua_initialize(int ac, char **av)
+{
+
+ char *given_file = NULL;
+ int kpse_init;
+ int tex_table_id;
+ int pdf_table_id;
+ int token_table_id;
+ int node_table_id;
+ /* Save to pass along to topenin. */
+ argc = ac;
+ argv = av;
+
+ ptexbanner = BANNER;
+
+ program_invocation_name = cleaned_invocation_name(argv[0]);
+
+ /* be 'luac' */
+ if (argc > 1 &&
+ (STREQ(program_invocation_name, "texluac") ||
+ STREQ(argv[1], "--luaconly") || STREQ(argv[1], "--luac"))) {
+ exit(luac_main(ac, av));
}
- /* unhide the 'tex' and 'pdf' table */
- unhide_lua_table(Luas[0], "tex", tex_table_id);
- unhide_lua_table(Luas[0], "pdf", pdf_table_id);
- unhide_lua_table(Luas[0], "token", token_table_id);
- unhide_lua_table(Luas[0], "node", node_table_id);
-
- /* kpse_init */
- kpse_init = -1;
- get_lua_boolean("texconfig", "kpse_init", &kpse_init);
-
- if (kpse_init != 0) {
- init_kpse();
+
+ /* Must be initialized before options are parsed. */
+ interactionoption = 4;
+ dump_name = NULL;
+
+#warning SyncTeX: -synctex command line option available
+ /* 0 means "disable Synchronize TeXnology".
+ * synctexoption is a *.web variable.
+ * We initialize it to a weird value to catch the -synctex command line flag
+ * At runtime, if synctexoption is not INT_MAX, then it contains the command line option provided,
+ * otherwise no such option was given by the user. */
+#define SYNCTEX_NO_OPTION INT_MAX
+ synctexoption = SYNCTEX_NO_OPTION;
+
+ /* parse commandline */
+ parse_options(ac, av);
+
+ /* make sure that the locale is 'sane' (for lua) */
+ putenv("LC_CTYPE=C");
+ putenv("LC_COLLATE=C");
+ putenv("LC_NUMERIC=C");
+
+ /* this is sometimes needed */
+ putenv("engine=luatex");
+
+ luainterpreter();
+
+ prepare_cmdline(Luas, argv, argc, lua_offset); /* collect arguments */
+
+ if (startup_filename != NULL) {
+ given_file = xstrdup(startup_filename);
+ startup_filename = find_filename(startup_filename, "LUATEXDIR");
}
- /* prohibit_file_trace (boolean) */
- tracefilenames = 1;
- get_lua_boolean("texconfig", "trace_file_names", &tracefilenames);
-
- /* src_special_xx */
- insertsrcspecialauto = insertsrcspecialeverypar =
- insertsrcspecialeveryparend = insertsrcspecialeverycr =
- insertsrcspecialeverymath = insertsrcspecialeveryhbox =
- insertsrcspecialeveryvbox = insertsrcspecialeverydisplay =
- false;
- get_lua_boolean("texconfig", "src_special_auto",
- &insertsrcspecialauto);
- get_lua_boolean("texconfig", "src_special_everypar",
- &insertsrcspecialeverypar);
- get_lua_boolean("texconfig", "src_special_everyparend",
- &insertsrcspecialeveryparend);
- get_lua_boolean("texconfig", "src_special_everycr",
- &insertsrcspecialeverycr);
- get_lua_boolean("texconfig", "src_special_everymath",
- &insertsrcspecialeverymath);
- get_lua_boolean("texconfig", "src_special_everyhbox",
- &insertsrcspecialeveryhbox);
- get_lua_boolean("texconfig", "src_special_everyvbox",
- &insertsrcspecialeveryvbox);
- get_lua_boolean("texconfig", "src_special_everydisplay",
- &insertsrcspecialeverydisplay);
-
- srcspecialsp = insertsrcspecialauto | insertsrcspecialeverypar |
- insertsrcspecialeveryparend | insertsrcspecialeverycr |
- insertsrcspecialeverymath | insertsrcspecialeveryhbox |
- insertsrcspecialeveryvbox | insertsrcspecialeverydisplay;
-
- /* file_line_error */
- filelineerrorstylep = false;
- get_lua_boolean("texconfig", "file_line_error",
- &filelineerrorstylep);
-
- /* halt_on_error */
- haltonerrorp = false;
- get_lua_boolean("texconfig", "halt_on_error", &haltonerrorp);
-
- fix_dumpname();
- } else {
- if (luainit) {
- if (given_file) {
- fprintf(stdout, "%s file %s not found\n", (lua_only ? "Script" : "Configuration"), given_file);
- } else {
- fprintf(stdout, "No %s file given\n", (lua_only ? "script" : "configuration"));
- }
- exit(1);
+ /* now run the file */
+ if (startup_filename != NULL) {
+ /* hide the 'tex' and 'pdf' table */
+ tex_table_id = hide_lua_table(Luas, "tex");
+ token_table_id = hide_lua_table(Luas, "token");
+ node_table_id = hide_lua_table(Luas, "node");
+ pdf_table_id = hide_lua_table(Luas, "pdf");
+
+ if (luaL_loadfile(Luas, startup_filename)) {
+ fprintf(stdout, "%s\n", lua_tostring(Luas, -1));
+ exit(1);
+ }
+ if (lua_pcall(Luas, 0, 0, 0)) {
+ fprintf(stdout, "%s\n", lua_tostring(Luas, -1));
+ exit(1);
+ }
+ /* no filename? quit now! */
+ if (!input_name) {
+ get_lua_string("texconfig", "jobname", &input_name);
+ }
+ if (!dump_name) {
+ get_lua_string("texconfig", "formatname", &dump_name);
+ }
+ if ((lua_only) || ((!input_name) && (!dump_name))) {
+ if (given_file)
+ free(given_file);
+ /* this is not strictly needed but it pleases valgrind */
+ lua_close(Luas);
+ exit(0);
+ }
+ /* unhide the 'tex' and 'pdf' table */
+ unhide_lua_table(Luas, "tex", tex_table_id);
+ unhide_lua_table(Luas, "pdf", pdf_table_id);
+ unhide_lua_table(Luas, "token", token_table_id);
+ unhide_lua_table(Luas, "node", node_table_id);
+
+ /* kpse_init */
+ kpse_init = -1;
+ get_lua_boolean("texconfig", "kpse_init", &kpse_init);
+
+ if (kpse_init != 0) {
+ luainit = 0; /* re-enable loading of texmf.cnf values, see luatex.ch */
+ init_kpse();
+ }
+ /* prohibit_file_trace (boolean) */
+ tracefilenames = 1;
+ get_lua_boolean("texconfig", "trace_file_names", &tracefilenames);
+
+ /* file_line_error */
+ filelineerrorstylep = false;
+ get_lua_boolean("texconfig", "file_line_error", &filelineerrorstylep);
+
+ /* halt_on_error */
+ haltonerrorp = false;
+ get_lua_boolean("texconfig", "halt_on_error", &haltonerrorp);
+
+ fix_dumpname();
} else {
- /* init */
- init_kpse();
- fix_dumpname();
+ if (luainit) {
+ if (given_file) {
+ fprintf(stdout, "%s file %s not found\n",
+ (lua_only ? "Script" : "Configuration"), given_file);
+ free(given_file);
+ } else {
+ fprintf(stdout, "No %s file given\n",
+ (lua_only ? "script" : "configuration"));
+ }
+ exit(1);
+ } else {
+ /* init */
+ init_kpse();
+ fix_dumpname();
+ }
}
- }
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luanode.c b/Build/source/texk/web2c/luatexdir/lua/luanode.c
index 17c8e7be8e2..0be6547446f 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luanode.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luanode.c
@@ -1,181 +1,247 @@
-/* $Id: luanode.c 1013 2008-02-14 00:09:02Z oneiros $ */
+/* luanode.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
-#undef link /* defined by cpascal.h */
+static const char _svn_version[] =
+ "$Id: luanode.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/luanode.c $";
+
+#undef link /* defined by cpascal.h */
#define info(a) fixmem[(a)].hhlh
#define link(a) fixmem[(a)].hhrh
-
static char *group_code_names[] = {
- "",
- "simple",
- "hbox",
- "adjusted_hbox",
- "vbox",
- "vtop",
- "align",
- "no_align",
- "output",
- "math",
- "disc",
- "insert",
- "vcenter",
- "math_choice",
- "semi_simple",
- "math_shift",
- "math_left",
- "local_box" ,
- "split_off",
- "split_keep",
- "preamble",
- "align_set",
- "fin_row"};
-
-char *pack_type_name[] = { "exactly", "additional"};
+ "",
+ "simple",
+ "hbox",
+ "adjusted_hbox",
+ "vbox",
+ "vtop",
+ "align",
+ "no_align",
+ "output",
+ "math",
+ "disc",
+ "insert",
+ "vcenter",
+ "math_choice",
+ "semi_simple",
+ "math_shift",
+ "math_left",
+ "local_box",
+ "split_off",
+ "split_keep",
+ "preamble",
+ "align_set",
+ "fin_row"
+};
+char *pack_type_name[] = { "exactly", "additional" };
-void
-lua_node_filter_s (int filterid, char *extrainfo, halfword head_node, halfword *tail_node) {
- halfword ret;
- int a;
- lua_State *L = Luas[0];
- int callback_id = callback_defined(filterid);
- if (head_node==null || vlink(head_node)==null || callback_id==0)
- return;
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1, callback_id);
- if (!lua_isfunction(L,-1)) {
- lua_pop(L,2);
- return;
- }
- nodelist_to_lua(L,vlink(head_node)); /* arg 1 */
- lua_pushstring(L,extrainfo); /* arg 2 */
- if (lua_pcall(L,2,1,0) != 0) { /* no arg, 1 result */
- fprintf(stdout,"error: %s\n",lua_tostring(L,-1));
- lua_pop(L,2);
- error();
+
+void lua_node_filter_s(int filterid, char *extrainfo)
+{
+ lua_State *L = Luas;
+ int s_top = lua_gettop(L);
+ if (!get_callback(L, callback_defined(filterid))) {
+ lua_settop(L, s_top);
+ return;
+ }
+ lua_pushstring(L, extrainfo); /* arg 1 */
+ if (lua_pcall(L, 1, 0, 0) != 0) {
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_settop(L, s_top);
+ error();
+ return;
+ }
+ lua_settop(L, s_top);
return;
- }
- if (lua_isboolean(L,-1)) {
- if (lua_toboolean(L,-1)!=1) {
- flush_node_list(vlink(head_node));
- vlink(head_node) = null;
- }
- } else {
- a = nodelist_from_lua(L);
- vlink(head_node)= a;
- }
- lua_pop(L,2); /* result and callback container table */
- if (fix_node_lists)
- fix_node_list(head_node);
- ret = vlink(head_node);
- if (ret!=null) {
- while (vlink(ret)!=null)
- ret=vlink(ret);
- *tail_node=ret;
- } else {
- *tail_node=head_node;
- }
- return ;
}
void
-lua_node_filter (int filterid, int extrainfo, halfword head_node, halfword *tail_node) {
- lua_node_filter_s(filterid, group_code_names[extrainfo], head_node, tail_node);
- return ;
+lua_node_filter(int filterid, int xextrainfo, halfword head_node,
+ halfword * tail_node)
+{
+ halfword ret;
+ int a;
+ lua_State *L = Luas;
+ char *extrainfo = group_code_names[xextrainfo];
+ int callback_id = callback_defined(filterid);
+ if (head_node == null || vlink(head_node) == null || callback_id == 0)
+ return;
+ if (!get_callback(L, callback_id)) {
+ lua_pop(L, 2);
+ return;
+ }
+ nodelist_to_lua(L, vlink(head_node)); /* arg 1 */
+ lua_pushstring(L, extrainfo); /* arg 2 */
+ if (lua_pcall(L, 2, 1, 0) != 0) { /* no arg, 1 result */
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ error();
+ return;
+ }
+ if (lua_isboolean(L, -1)) {
+ if (lua_toboolean(L, -1) != 1) {
+ flush_node_list(vlink(head_node));
+ vlink(head_node) = null;
+ }
+ } else {
+ a = nodelist_from_lua(L);
+ vlink(head_node) = a;
+ }
+ lua_pop(L, 2); /* result and callback container table */
+ if (fix_node_lists)
+ fix_node_list(head_node);
+ ret = vlink(head_node);
+ if (ret != null) {
+ while (vlink(ret) != null)
+ ret = vlink(ret);
+ *tail_node = ret;
+ } else {
+ *tail_node = head_node;
+ }
+ return;
+}
+
+
+int
+lua_linebreak_callback(int is_broken, halfword head_node, halfword * new_head)
+{
+ int a;
+ register halfword *p;
+ int ret = 0; /* failure */
+ lua_State *L = Luas;
+ int callback_id = callback_defined(linebreak_filter_callback);
+ if (head_node == null || vlink(head_node) == null || callback_id == 0)
+ return ret;
+ if (!get_callback(L, callback_id)) {
+ lua_pop(L, 2);
+ return ret;
+ }
+ nodelist_to_lua(L, vlink(head_node)); /* arg 1 */
+ lua_pushboolean(L, is_broken); /* arg 2 */
+ if (lua_pcall(L, 2, 1, 0) != 0) { /* no arg, 1 result */
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ error();
+ return ret;
+ }
+
+ p = lua_touserdata(L, -1);
+ if (p != NULL) {
+ a = nodelist_from_lua(L);
+ vlink(*new_head) = a;
+ ret = 1;
+ }
+ lua_pop(L, 2); /* result and callback container table */
+ return ret;
}
halfword
-lua_hpack_filter (halfword head_node, scaled size, int pack_type, int extrainfo) {
- halfword ret;
- lua_State *L = Luas[0];
- int callback_id = callback_defined(hpack_filter_callback);
- if (head_node==null || callback_id == 0)
- return head_node;
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1, callback_id);
- if (!lua_isfunction(L,-1)) {
- lua_pop(L,2);
- return head_node;
- }
-
- nodelist_to_lua(L,head_node);
- lua_pushstring(L,group_code_names[extrainfo]);
- lua_pushnumber(L,size);
- lua_pushstring(L,pack_type_name[pack_type]);
- if (lua_pcall(L,4,1,0) != 0) { /* no arg, 1 result */
- fprintf(stdout,"error: %s\n",lua_tostring(L,-1));
- lua_pop(L,2);
- error();
- return head_node;
- }
- ret = head_node;
- if (lua_isboolean(L,-1)) {
- if (lua_toboolean(L,-1)!=1) {
- flush_node_list(head_node);
- ret = null;
- }
- } else {
- ret = nodelist_from_lua(L);
- }
- lua_pop(L,2); /* result and callback container table */
- /* lua_gc(L,LUA_GCSTEP, LUA_GC_STEP_SIZE);*/
- if (fix_node_lists)
- fix_node_list(ret);
- return ret;
+lua_hpack_filter(halfword head_node, scaled size, int pack_type, int extrainfo)
+{
+ halfword ret;
+ lua_State *L = Luas;
+ int callback_id = callback_defined(hpack_filter_callback);
+ if (head_node == null || callback_id == 0)
+ return head_node;
+ if (!get_callback(L, callback_id)) {
+ lua_pop(L, 2);
+ return head_node;
+ }
+ nodelist_to_lua(L, head_node);
+ lua_pushstring(L, group_code_names[extrainfo]);
+ lua_pushnumber(L, size);
+ lua_pushstring(L, pack_type_name[pack_type]);
+ if (lua_pcall(L, 4, 1, 0) != 0) { /* no arg, 1 result */
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ error();
+ return head_node;
+ }
+ ret = head_node;
+ if (lua_isboolean(L, -1)) {
+ if (lua_toboolean(L, -1) != 1) {
+ flush_node_list(head_node);
+ ret = null;
+ }
+ } else {
+ ret = nodelist_from_lua(L);
+ }
+ lua_pop(L, 2); /* result and callback container table */
+ /* lua_gc(L,LUA_GCSTEP, LUA_GC_STEP_SIZE); */
+ if (fix_node_lists)
+ fix_node_list(ret);
+ return ret;
}
halfword
-lua_vpack_filter (halfword head_node, scaled size, int pack_type, scaled maxd, int extrainfo) {
- halfword ret;
- integer callback_id ;
- lua_State *L = Luas[0];
- if (head_node==null)
- return head_node;
- if (strcmp("output",group_code_names[extrainfo])==0) {
- callback_id = callback_defined(pre_output_filter_callback);
- } else {
- callback_id = callback_defined(vpack_filter_callback);
- }
- if (callback_id==0) {
- return head_node;
- }
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- lua_rawgeti(L,-1, callback_id);
- if (!lua_isfunction(L,-1)) {
- lua_pop(L,2);
- return head_node;
- }
- nodelist_to_lua(L,head_node);
- lua_pushstring(L,group_code_names[extrainfo]);
- lua_pushnumber(L,size);
- lua_pushstring(L,pack_type_name[pack_type]);
- lua_pushnumber(L,maxd);
- if (lua_pcall(L,5,1,0) != 0) { /* no arg, 1 result */
- fprintf(stdout,"error: %s\n",lua_tostring(L,-1));
- lua_pop(L,2);
- error();
- return head_node;
- }
- ret = head_node;
- if (lua_isboolean(L,-1)) {
- if (lua_toboolean(L,-1)!=1) {
- flush_node_list(head_node);
- ret = null;
- }
- } else {
- ret = nodelist_from_lua(L);
- }
- lua_pop(L,2); /* result and callback container table */
- /* lua_gc(L,LUA_GCSTEP, LUA_GC_STEP_SIZE);*/
- if (fix_node_lists)
- fix_node_list(ret);
- return ret;
+lua_vpack_filter(halfword head_node, scaled size, int pack_type, scaled maxd,
+ int extrainfo)
+{
+ halfword ret;
+ integer callback_id;
+ lua_State *L = Luas;
+ if (head_node == null)
+ return head_node;
+ if (strcmp("output", group_code_names[extrainfo]) == 0) {
+ callback_id = callback_defined(pre_output_filter_callback);
+ } else {
+ callback_id = callback_defined(vpack_filter_callback);
+ }
+ if (callback_id == 0) {
+ return head_node;
+ }
+ if (!get_callback(L, callback_id)) {
+ lua_pop(L, 2);
+ return head_node;
+ }
+ nodelist_to_lua(L, head_node);
+ lua_pushstring(L, group_code_names[extrainfo]);
+ lua_pushnumber(L, size);
+ lua_pushstring(L, pack_type_name[pack_type]);
+ lua_pushnumber(L, maxd);
+ if (lua_pcall(L, 5, 1, 0) != 0) { /* no arg, 1 result */
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_pop(L, 2);
+ error();
+ return head_node;
+ }
+ ret = head_node;
+ if (lua_isboolean(L, -1)) {
+ if (lua_toboolean(L, -1) != 1) {
+ flush_node_list(head_node);
+ ret = null;
+ }
+ } else {
+ ret = nodelist_from_lua(L);
+ }
+ lua_pop(L, 2); /* result and callback container table */
+ /* lua_gc(L,LUA_GCSTEP, LUA_GC_STEP_SIZE); */
+ if (fix_node_lists)
+ fix_node_list(ret);
+ return ret;
}
@@ -184,17 +250,16 @@ lua_vpack_filter (halfword head_node, scaled size, int pack_type, scaled maxd, i
* eTeX manual for the expected return values.
*/
-int
-visible_last_node_type (int n) {
- int i = type(n);
- if ((i!=math_node) && (i<=unset_node))
- return i+1;
- if (i==glyph_node)
- return -1;
- if (i==whatsit_node && subtype(n)==local_par_node)
- return -1;
- if (i==255)
- return -1 ; /* this is not right, probably dir nodes! */
- return last_known_node +1 ;
+int visible_last_node_type(int n)
+{
+ int i = type(n);
+ if ((i != math_node) && (i <= unset_node))
+ return i + 1;
+ if (i == glyph_node)
+ return -1;
+ if (i == whatsit_node && subtype(n) == local_par_node)
+ return -1;
+ if (i == 255)
+ return -1; /* this is not right, probably dir nodes! */
+ return last_known_node + 1;
}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/luastuff.c b/Build/source/texk/web2c/luatexdir/lua/luastuff.c
index f48bfdb0171..49298ea2fc5 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luastuff.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luastuff.c
@@ -1,41 +1,64 @@
-/* $Id: luastuff.c 1079 2008-03-05 15:34:41Z taco $ */
+/* luastuff.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
-lua_State *Luas[65536];
+static const char _svn_version[] =
+ "$Id: luastuff.c 2064 2009-03-20 13:13:14Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/luastuff.c $";
+
+lua_State *Luas = NULL;
extern char *startup_filename;
extern int safer_option;
+extern int nosocket_option;
-int luastate_max = 0;
int luastate_bytes = 0;
-void
-make_table (lua_State *L, char *tab, char *getfunc, char *setfunc) {
- /* make the table */ /* [{<tex>}] */
- lua_pushstring(L,tab); /* [{<tex>},"dimen"] */
- lua_newtable(L); /* [{<tex>},"dimen",{}] */
- lua_settable(L, -3); /* [{<tex>}] */
- /* fetch it back */
- lua_pushstring(L,tab); /* [{<tex>},"dimen"] */
- lua_gettable(L, -2); /* [{<tex>},{<dimen>}] */
- /* make the meta entries */
- luaL_newmetatable(L,tab); /* [{<tex>},{<dimen>},{<dimen_m>}] */
- lua_pushstring(L, "__index"); /* [{<tex>},{<dimen>},{<dimen_m>},"__index"] */
- lua_pushstring(L, getfunc); /* [{<tex>},{<dimen>},{<dimen_m>},"__index","getdimen"] */
- lua_gettable(L, -5); /* [{<tex>},{<dimen>},{<dimen_m>},"__index",<tex.getdimen>] */
- lua_settable(L, -3); /* [{<tex>},{<dimen>},{<dimen_m>}] */
- lua_pushstring(L, "__newindex");/* [{<tex>},{<dimen>},{<dimen_m>},"__newindex"] */
- lua_pushstring(L, setfunc); /* [{<tex>},{<dimen>},{<dimen_m>},"__newindex","setdimen"] */
- lua_gettable(L, -5); /* [{<tex>},{<dimen>},{<dimen_m>},"__newindex",<tex.setdimen>] */
- lua_settable(L, -3); /* [{<tex>},{<dimen>},{<dimen_m>}] */
- lua_setmetatable(L,-2); /* [{<tex>},{<dimen>}] : assign the metatable */
- lua_pop(L,1); /* [{<tex>}] : clean the stack */
+int lua_active = 0;
+
+void make_table(lua_State * L, char *tab, char *getfunc, char *setfunc)
+{
+ /* make the table *//* [{<tex>}] */
+ lua_pushstring(L, tab); /* [{<tex>},"dimen"] */
+ lua_newtable(L); /* [{<tex>},"dimen",{}] */
+ lua_settable(L, -3); /* [{<tex>}] */
+ /* fetch it back */
+ lua_pushstring(L, tab); /* [{<tex>},"dimen"] */
+ lua_gettable(L, -2); /* [{<tex>},{<dimen>}] */
+ /* make the meta entries */
+ luaL_newmetatable(L, tab); /* [{<tex>},{<dimen>},{<dimen_m>}] */
+ lua_pushstring(L, "__index"); /* [{<tex>},{<dimen>},{<dimen_m>},"__index"] */
+ lua_pushstring(L, getfunc); /* [{<tex>},{<dimen>},{<dimen_m>},"__index","getdimen"] */
+ lua_gettable(L, -5); /* [{<tex>},{<dimen>},{<dimen_m>},"__index",<tex.getdimen>] */
+ lua_settable(L, -3); /* [{<tex>},{<dimen>},{<dimen_m>}] */
+ lua_pushstring(L, "__newindex"); /* [{<tex>},{<dimen>},{<dimen_m>},"__newindex"] */
+ lua_pushstring(L, setfunc); /* [{<tex>},{<dimen>},{<dimen_m>},"__newindex","setdimen"] */
+ lua_gettable(L, -5); /* [{<tex>},{<dimen>},{<dimen_m>},"__newindex",<tex.setdimen>] */
+ lua_settable(L, -3); /* [{<tex>},{<dimen>},{<dimen_m>}] */
+ lua_setmetatable(L, -2); /* [{<tex>},{<dimen>}] : assign the metatable */
+ lua_pop(L, 1); /* [{<tex>}] : clean the stack */
}
-static
-const char *getS(lua_State * L, void *ud, size_t * size) {
+static
+const char *getS(lua_State * L, void *ud, size_t * size)
+{
LoadS *ls = (LoadS *) ud;
(void) L;
if (ls->size == 0)
@@ -45,266 +68,345 @@ const char *getS(lua_State * L, void *ud, size_t * size) {
return ls->s;
}
-void *my_luaalloc (void *ud, void *ptr, size_t osize, size_t nsize) {
- void *ret = NULL;
- if (nsize == 0)
- free(ptr);
- else
- ret = realloc(ptr, nsize);
- luastate_bytes += (nsize-osize);
- return ret;
+void *my_luaalloc(void *ud, void *ptr, size_t osize, size_t nsize)
+{
+ void *ret = NULL;
+ (void)ud; /* for -Wunused */
+ if (nsize == 0)
+ free(ptr);
+ else
+ ret = realloc(ptr, nsize);
+ luastate_bytes += (nsize - osize);
+ return ret;
}
-static int my_luapanic (lua_State *L) {
- (void)L; /* to avoid warnings */
- fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
- lua_tostring(L, -1));
- return 0;
+static int my_luapanic(lua_State * L)
+{
+ (void) L; /* to avoid warnings */
+ fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
+ lua_tostring(L, -1));
+ return 0;
}
-void
-luainterpreter (int n) {
- lua_State *L;
- L = lua_newstate(my_luaalloc, NULL);
- if (L==NULL) {
- fprintf(stderr,"Can't create a new Lua state (%d).",n);
- return;
- }
- lua_atpanic(L, &my_luapanic);
-
- luastate_max++;
- luaL_openlibs(L);
-
- open_oslibext(L,safer_option);
-
- lua_getglobal(L,"package");
- lua_pushstring(L,"");
- lua_setfield(L,-2,"cpath");
- lua_pop(L,1); /* pop the table */
-
- /*luaopen_unicode(L);*/
- lua_pushcfunction(L, luaopen_unicode);
- lua_pushstring(L, "unicode");
- lua_call(L, 1, 0);
-
- /*luaopen_zip(L);*/
- lua_pushcfunction(L, luaopen_zip);
- lua_pushstring(L, "zip");
- lua_call(L, 1, 0);
-
- /*luaopen_lpeg(L);*/
- lua_pushcfunction(L, luaopen_lpeg);
- lua_pushstring(L, "lpeg");
- lua_call(L, 1, 0);
-
- /*luaopen_md5(L);*/
- lua_pushcfunction(L, luaopen_md5);
- lua_pushstring(L, "md5");
- lua_call(L, 1, 0);
-
- /*luaopen_lfs(L);*/
- lua_pushcfunction(L, luaopen_lfs);
- lua_pushstring(L, "lfs");
- lua_call(L, 1, 0);
-
- /* zlib. slightly odd calling convention */
- luaopen_zlib(L);
- lua_setglobal(L,"zlib");
- luaopen_gzip(L);
- /* fontforge */
- luaopen_ff(L);
-
- luaopen_pdf(L);
- luaopen_tex(L);
- luaopen_token(L);
- luaopen_node(L);
- luaopen_texio(L);
- luaopen_kpse(L);
- if (n==0) {
+void luainterpreter(void)
+{
+ lua_State *L;
+ L = lua_newstate(my_luaalloc, NULL);
+ if (L == NULL) {
+ fprintf(stderr, "Can't create the Lua state.\n");
+ return;
+ }
+ lua_atpanic(L, &my_luapanic);
+
+ luaL_openlibs(L);
+
+ open_oslibext(L, safer_option);
+
+ lua_getglobal(L, "package");
+ lua_pushstring(L, "");
+ lua_setfield(L, -2, "cpath");
+ lua_pop(L, 1); /* pop the table */
+
+ /*luaopen_unicode(L); */
+ lua_pushcfunction(L, luaopen_unicode);
+ lua_pushstring(L, "unicode");
+ lua_call(L, 1, 0);
+
+ /*luaopen_zip(L); */
+ lua_pushcfunction(L, luaopen_zip);
+ lua_pushstring(L, "zip");
+ lua_call(L, 1, 0);
+
+ /* luasockets */
+ /* socket and mime are a bit tricky to open because
+ * they use a load-time dependency that has to be
+ * worked around for luatex, where the C module is
+ * loaded way before the lua module.
+ */
+ if (!nosocket_option) {
+ lua_getglobal(L, "package");
+ lua_getfield(L, -1, "loaded");
+ if (!lua_istable(L, -1)) {
+ lua_newtable(L);
+ lua_setfield(L, -2, "loaded");
+ lua_getfield(L, -1, "loaded");
+ }
+ luaopen_socket_core(L);
+ lua_setfield(L, -2, "socket.core");
+ lua_pushnil(L);
+ lua_setfield(L, -2, "socket"); /* package.loaded.socket = nil */
+
+ luaopen_mime_core(L);
+ lua_setfield(L, -2, "mime.core");
+ lua_pushnil(L);
+ lua_setfield(L, -2, "mime"); /* package.loaded.mime = nil */
+ lua_pop(L, 2); /* pop the tables */
+
+ luatex_socketlua_open(L); /* preload the pure lua modules */
+ }
+
+ /*luaopen_lpeg(L); */
+ lua_pushcfunction(L, luaopen_lpeg);
+ lua_pushstring(L, "lpeg");
+ lua_call(L, 1, 0);
+
+ /*luaopen_md5(L); */
+ lua_pushcfunction(L, luaopen_md5);
+ lua_pushstring(L, "md5");
+ lua_call(L, 1, 0);
+
+ /*luaopen_lfs(L); */
+ lua_pushcfunction(L, luaopen_lfs);
+ lua_pushstring(L, "lfs");
+ lua_call(L, 1, 0);
+
+ /* zlib. slightly odd calling convention */
+ luaopen_zlib(L);
+ lua_setglobal(L, "zlib");
+ luaopen_gzip(L);
+ /* fontforge */
+ luaopen_ff(L);
+ /* profiler, from kepler */
+ luaopen_profiler(L);
+
+ luaopen_pdf(L);
+ luaopen_tex(L);
+ luaopen_token(L);
+ luaopen_node(L);
+ luaopen_texio(L);
+ luaopen_kpse(L);
+
luaopen_callback(L);
lua_createtable(L, 0, 0);
lua_setglobal(L, "texconfig");
- }
- luaopen_lua(L,n,startup_filename);
- luaopen_stats(L);
- luaopen_font(L);
- luaopen_lang(L);
-
- /* luaopen_img(L); */
- lua_pushcfunction(L, luaopen_img);
- lua_pushstring(L, "img");
- lua_call(L, 1, 0);
-
- luaopen_mp(L);
-
- if (safer_option) {
- /* disable some stuff if --safer */
- (void)hide_lua_value(L, "os","execute");
- (void)hide_lua_value(L, "os","rename");
- (void)hide_lua_value(L, "os","remove");
- (void)hide_lua_value(L, "io","popen");
- /* make io.open only read files */
- luaL_checkstack(L,2,"out of stack space");
- lua_getglobal(L,"io");
- lua_getfield(L,-1,"open_ro");
- lua_setfield(L,-2,"open");
- (void)hide_lua_value(L, "io","tmpfile");
- (void)hide_lua_value(L, "io","output");
- (void)hide_lua_value(L, "lfs","chdir");
- (void)hide_lua_value(L, "lfs","lock");
- (void)hide_lua_value(L, "lfs","touch");
- (void)hide_lua_value(L, "lfs","rmdir");
- (void)hide_lua_value(L, "lfs","mkdir");
- }
- Luas[n] = L;
+
+ luaopen_lua(L, startup_filename);
+ luaopen_stats(L);
+ luaopen_font(L);
+ luaopen_lang(L);
+
+ /* luaopen_img(L); */
+ lua_pushcfunction(L, luaopen_img);
+ lua_pushstring(L, "img");
+ lua_call(L, 1, 0);
+
+ luaopen_mplib(L);
+
+ if (safer_option) {
+ /* disable some stuff if --safer */
+ (void) hide_lua_value(L, "os", "execute");
+ (void) hide_lua_value(L, "os", "rename");
+ (void) hide_lua_value(L, "os", "remove");
+ (void) hide_lua_value(L, "io", "popen");
+ /* make io.open only read files */
+ luaL_checkstack(L, 2, "out of stack space");
+ lua_getglobal(L, "io");
+ lua_getfield(L, -1, "open_ro");
+ lua_setfield(L, -2, "open");
+ (void) hide_lua_value(L, "io", "tmpfile");
+ (void) hide_lua_value(L, "io", "output");
+ (void) hide_lua_value(L, "lfs", "chdir");
+ (void) hide_lua_value(L, "lfs", "lock");
+ (void) hide_lua_value(L, "lfs", "touch");
+ (void) hide_lua_value(L, "lfs", "rmdir");
+ (void) hide_lua_value(L, "lfs", "mkdir");
+ }
+ Luas = L;
+}
+
+int hide_lua_table(lua_State * L, char *name)
+{
+ int r = 0;
+ lua_getglobal(L, name);
+ if (lua_istable(L, -1)) {
+ r = luaL_ref(L, LUA_REGISTRYINDEX);
+ lua_pushnil(L);
+ lua_setglobal(L, name);
+ }
+ return r;
}
-int hide_lua_table(lua_State *L, char *name) {
- int r=0;
- lua_getglobal(L,name);
- if(lua_istable(L,-1)) {
- r = luaL_ref(L,LUA_REGISTRYINDEX);
- lua_pushnil(L);
- lua_setglobal(L,name);
- }
- return r;
+void unhide_lua_table(lua_State * L, char *name, int r)
+{
+ lua_rawgeti(L, LUA_REGISTRYINDEX, r);
+ lua_setglobal(L, name);
+ luaL_unref(L, LUA_REGISTRYINDEX, r);
}
-void unhide_lua_table(lua_State *L, char *name, int r) {
- lua_rawgeti(L,LUA_REGISTRYINDEX,r);
- lua_setglobal(L,name);
- luaL_unref(L,LUA_REGISTRYINDEX,r);
+int hide_lua_value(lua_State * L, char *name, char *item)
+{
+ int r = 0;
+ lua_getglobal(L, name);
+ if (lua_istable(L, -1)) {
+ lua_getfield(L, -1, item);
+ r = luaL_ref(L, LUA_REGISTRYINDEX);
+ lua_pushnil(L);
+ lua_setfield(L, -2, item);
+ }
+ return r;
}
-int hide_lua_value(lua_State *L, char *name, char *item) {
- int r=0;
- lua_getglobal(L,name);
- if(lua_istable(L,-1)) {
- lua_getfield(L,-1,item);
- r = luaL_ref(L,LUA_REGISTRYINDEX);
- lua_pushnil(L);
- lua_setfield(L,-2,item);
- }
- return r;
+void unhide_lua_value(lua_State * L, char *name, char *item, int r)
+{
+ lua_getglobal(L, name);
+ if (lua_istable(L, -1)) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, r);
+ lua_setfield(L, -2, item);
+ luaL_unref(L, LUA_REGISTRYINDEX, r);
+ }
}
-void unhide_lua_value(lua_State *L, char *name, char *item, int r) {
- lua_getglobal(L,name);
- if(lua_istable(L,-1)) {
- lua_rawgeti(L,LUA_REGISTRYINDEX,r);
- lua_setfield(L,-2,item);
- luaL_unref(L,LUA_REGISTRYINDEX,r);
- }
+
+int lua_traceback(lua_State * L)
+{
+ lua_getfield(L, LUA_GLOBALSINDEX, "debug");
+ if (!lua_istable(L, -1)) {
+ lua_pop(L, 1);
+ return 1;
+ }
+ lua_getfield(L, -1, "traceback");
+ if (!lua_isfunction(L, -1)) {
+ lua_pop(L, 2);
+ return 1;
+ }
+ lua_pushvalue(L, 1); /* pass error message */
+ lua_pushinteger(L, 2); /* skip this function and traceback */
+ lua_call(L, 2, 1); /* call debug.traceback */
+ return 1;
}
+void luacall(int p, int nameptr)
+{
+ LoadS ls;
+ int i, l;
+ char *lua_id;
+ char *s = NULL;
-void
-luacall(int n, int s) {
- LoadS ls;
- int i ;
- char lua_id[12];
- if (Luas[n] == NULL) {
- luainterpreter(n);
- }
- luatex_load_init(s,&ls);
- if (ls.size>0) {
- snprintf((char *)lua_id,12,"luas[%d]",n);
- i = lua_load(Luas[n], getS, &ls, lua_id);
- if (i != 0) {
- Luas[n] = luatex_error(Luas[n],(i == LUA_ERRSYNTAX ? 0 : 1));
- } else {
- i = lua_pcall(Luas[n], 0, 0, 0);
- if (i != 0) {
- Luas[n] = luatex_error(Luas[n],(i == LUA_ERRRUN ? 0 : 1));
- }
- }
- }
+ if (Luas == NULL) {
+ luainterpreter();
+ }
+ l = 0;
+ lua_active++;
+ s = tokenlist_to_cstring(p, 1, &l);
+ ls.s = s;
+ ls.size = l;
+
+ if (ls.size > 0) {
+ if (nameptr > 0) {
+ lua_id = tokenlist_to_cstring(nameptr, 1, &l);
+ } else if (nameptr<0) {
+ char *tmp = get_lua_name((nameptr+65536));
+ if (tmp!=NULL)
+ lua_id = xstrdup(tmp);
+ else
+ lua_id = xstrdup("\\latelua ");
+ } else {
+ lua_id = xmalloc(20);
+ snprintf((char *) lua_id, 20, "\\latelua ") ;
+ }
+
+ i = lua_load(Luas, getS, &ls, lua_id);
+ if (i != 0) {
+ Luas = luatex_error(Luas, (i == LUA_ERRSYNTAX ? 0 : 1));
+ } else {
+ int base = lua_gettop(Luas); /* function index */
+ lua_checkstack(Luas, 1);
+ lua_pushcfunction(Luas, lua_traceback); /* push traceback function */
+ lua_insert(Luas, base); /* put it under chunk */
+ i = lua_pcall(Luas, 0, 0, base);
+ lua_remove(Luas, base); /* remove traceback function */
+ if (i != 0) {
+ lua_gc(Luas, LUA_GCCOLLECT, 0);
+ Luas = luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1));
+ }
+ }
+ xfree(lua_id);
+ }
+ lua_active--;
}
-void
-luatokencall(int n, int p) {
- LoadS ls;
- int i, l;
- char *s=NULL;
- char lua_id[12];
- if (Luas[n] == NULL) {
- luainterpreter(n);
- }
- l = 0;
- s = tokenlist_to_cstring(p,1,&l);
- ls.s = s;
- ls.size = l;
- if (ls.size>0) {
- snprintf((char *)lua_id,12,"luas[%d]",n);
- i = lua_load(Luas[n], getS, &ls, lua_id);
- xfree(s);
- if (i != 0) {
- Luas[n] = luatex_error(Luas[n],(i == LUA_ERRSYNTAX ? 0 : 1));
- } else {
- i = lua_pcall(Luas[n], 0, 0, 0);
- if (i != 0) {
- Luas[n] = luatex_error(Luas[n],(i == LUA_ERRRUN ? 0 : 1));
- }
- }
- }
+void luatokencall(int p, int nameptr)
+{
+ LoadS ls;
+ int i, l;
+ char *s = NULL;
+ char *lua_id;
+ assert (Luas);
+ l = 0;
+ lua_active++;
+ s = tokenlist_to_cstring(p, 1, &l);
+ ls.s = s;
+ ls.size = l;
+ if (ls.size > 0) {
+ if (nameptr > 0) {
+ lua_id = tokenlist_to_cstring(nameptr, 1, &l);
+ } else if (nameptr<0) {
+ char *tmp = get_lua_name((nameptr+65536));
+ if (tmp!=NULL)
+ lua_id = xstrdup(tmp);
+ else
+ lua_id = xstrdup("\\directlua ");
+ } else {
+ lua_id = xstrdup("\\directlua ");
+ }
+ i = lua_load(Luas, getS, &ls, lua_id);
+ xfree(s);
+ if (i != 0) {
+ Luas = luatex_error(Luas, (i == LUA_ERRSYNTAX ? 0 : 1));
+ } else {
+ int base = lua_gettop(Luas); /* function index */
+ lua_checkstack(Luas, 1);
+ lua_pushcfunction(Luas, lua_traceback); /* push traceback function */
+ lua_insert(Luas, base); /* put it under chunk */
+ i = lua_pcall(Luas, 0, 0, base);
+ lua_remove(Luas, base); /* remove traceback function */
+ if (i != 0) {
+ lua_gc(Luas, LUA_GCCOLLECT, 0);
+ Luas = luatex_error(Luas, (i == LUA_ERRRUN ? 0 : 1));
+ }
+ }
+ xfree(lua_id);
+ }
+ lua_active--;
}
-void
-closelua(int n) {
- if (n!=0 && Luas[n] != NULL) {
- lua_close(Luas[n]);
- luastate_max--;
- Luas[n] = NULL;
- }
+void luatex_load_init(int s, LoadS * ls)
+{
+ ls->s = (const char *) &(str_pool[str_start[s]]);
+ ls->size = str_start[s + 1] - str_start[s];
}
-void
-luatex_load_init (int s, LoadS *ls) {
- ls->s = (const char *)&(str_pool[str_start[s]]);
- ls->size = str_start[s + 1] - str_start[s];
-}
+lua_State *luatex_error(lua_State * L, int is_fatal)
+{
-lua_State *
-luatex_error (lua_State * L, int is_fatal) {
-
- size_t len;
- char *err;
- strnumber s;
- const char *luaerr = lua_tolstring(L, -1,&len);
- err = (char *)xmalloc(len+1);
- len = snprintf(err,(len+1),"%s",luaerr);
- if (is_fatal>0) {
- /* Normally a memory error from lua.
- The pool may overflow during the maketexlstring(), but we
- are crashing anyway so we may as well abort on the pool size */
- s = maketexlstring(err, len);
- lua_fatal_error(s);
- /* never reached */
- xfree (err);
- lua_close(L);
- luastate_max--;
- return (lua_State *)NULL;
- } else {
- /* Here, the pool could be full already, but we can possibly escape from that
- * condition, since the lua chunk that caused the error is the current string.
- */
- s = str_ptr-0x200000;
- /* fprintf(stderr,"poolinfo: %d: %d,%d out of %d\n",s,pool_ptr,str_start[(s-1)],pool_size);*/
- pool_ptr = str_start[(s-1)];
- str_start[s] = pool_ptr;
- if (pool_ptr+len>=pool_size) {
- lua_norm_error(' ');
+ strnumber s;
+ const char *luaerr;
+ size_t len = 0;
+ char *err = NULL;
+ if (lua_isstring(L, -1)) {
+ luaerr = lua_tolstring(L, -1, &len);
+ err = (char *) xmalloc(len + 1);
+ len = snprintf(err, (len + 1), "%s", luaerr);
+ }
+ if (is_fatal > 0) {
+ /* Normally a memory error from lua.
+ The pool may overflow during the maketexlstring(), but we
+ are crashing anyway so we may as well abort on the pool size */
+ s = maketexlstring(err, len);
+ lua_fatal_error(s);
+ /* never reached */
+ xfree(err);
+ lua_close(L);
+ return (lua_State *) NULL;
} else {
- s = maketexlstring(err,len);
- lua_norm_error(s);
- flush_str(s);
+ s = maketexlstring(err, len);
+ lua_norm_error(s);
+ flush_str(s);
+ xfree(err);
+ return L;
}
- xfree (err);
- return L;
- }
}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex.c b/Build/source/texk/web2c/luatexdir/lua/luatex.c
index 5172ca24292..24b928fba45 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luatex.c
@@ -1,32 +1,53 @@
-/* $Id: luatex.c 1013 2008-02-14 00:09:02Z oneiros $ */
+/* luatex.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include <zlib.h>
+static const char _svn_version[] =
+ "$Id: luatex.c 2028 2009-03-14 18:50:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/luatex.c $";
+
/* do this aleph stuff here, for now */
-void
-b_test_in(void)
+extern int program_name_set; /* in lkpselib.c */
+
+void b_test_in(void)
{
- string fname = kpse_find_file ((char *)(nameoffile + 1),
- kpse_program_binary_format, true);
-
- if (fname) {
- libcfree(nameoffile);
- nameoffile = xmalloc(2+strlen(fname));
- namelength = strlen(fname);
- strcpy((char *)nameoffile+1, fname);
- }
- else {
- libcfree(nameoffile);
- nameoffile = xmalloc(2);
- namelength = 0;
- nameoffile[0] = 0;
- nameoffile[1] = 0;
+ if (program_name_set) {
+ string fname = kpse_find_file((char *) (nameoffile + 1),
+ kpse_program_binary_format, true);
+ if (fname) {
+ libcfree(nameoffile);
+ nameoffile = xmalloc(2 + strlen(fname));
+ namelength = strlen(fname);
+ strcpy((char *) nameoffile + 1, fname);
+ } else {
+ libcfree(nameoffile);
+ nameoffile = xmalloc(2);
+ namelength = 0;
+ nameoffile[0] = 0;
+ nameoffile[1] = 0;
+ }
}
}
-
+
int **ocp_tables;
static int ocp_entries = 0;
@@ -35,41 +56,39 @@ void
allocate_ocp_table P2C(int, ocp_number, int, ocp_size)
{
int i;
- if (ocp_entries==0) {
- ocp_tables = (int **) xmalloc(256*sizeof(int**));
- ocp_entries=256;
- } else if ((ocp_number==256)&&(ocp_entries==256)) {
- ocp_tables = xrealloc(ocp_tables, 65536);
- ocp_entries=65536;
+ if (ocp_entries == 0) {
+ ocp_tables = (int **) xmalloc(256 * sizeof(int **));
+ ocp_entries = 256;
+ } else if ((ocp_number == 256) && (ocp_entries == 256)) {
+ ocp_tables = xrealloc(ocp_tables, 65536);
+ ocp_entries = 65536;
}
- ocp_tables[ocp_number] =
- (int *) xmalloc((1+ocp_size)*sizeof(int));
+ ocp_tables[ocp_number] = (int *) xmalloc((1 + ocp_size) * sizeof(int));
ocp_tables[ocp_number][0] = ocp_size;
- for (i=1; i<=ocp_size; i++) {
- ocp_tables[ocp_number][i] = 0;
+ for (i = 1; i <= ocp_size; i++) {
+ ocp_tables[ocp_number][i] = 0;
}
}
void
dump_ocp_table P1C(int, ocp_number)
{
- dump_things(ocp_tables[ocp_number][0], ocp_tables[ocp_number][0]+1);
+ dump_things(ocp_tables[ocp_number][0], ocp_tables[ocp_number][0] + 1);
}
void
undump_ocp_table P1C(int, ocp_number)
{
int sizeword;
- if (ocp_entries==0) {
- ocp_tables = (int **) xmalloc(256*sizeof(int**));
- ocp_entries=256;
- } else if ((ocp_number==256)&&(ocp_entries==256)) {
- ocp_tables = xrealloc(ocp_tables, 65536);
- ocp_entries=65536;
+ if (ocp_entries == 0) {
+ ocp_tables = (int **) xmalloc(256 * sizeof(int **));
+ ocp_entries = 256;
+ } else if ((ocp_number == 256) && (ocp_entries == 256)) {
+ ocp_tables = xrealloc(ocp_tables, 65536);
+ ocp_entries = 65536;
}
- undump_things(sizeword,1);
- ocp_tables[ocp_number] =
- (int *) xmalloc((1+sizeword)*sizeof(int));
+ undump_things(sizeword, 1);
+ ocp_tables[ocp_number] = (int *) xmalloc((1 + sizeword) * sizeof(int));
ocp_tables[ocp_number][0] = sizeword;
undump_things(ocp_tables[ocp_number][1], sizeword);
}
@@ -78,141 +97,146 @@ undump_ocp_table P1C(int, ocp_number)
void
run_external_ocp P1C(string, external_ocp_name)
{
- char *in_file_name;
- char *out_file_name;
- FILE *in_file;
- FILE *out_file;
- char command_line[400];
- int i;
- unsigned c;
- int c_in;
+ char *in_file_name;
+ char *out_file_name;
+ FILE *in_file;
+ FILE *out_file;
+ int in_file_fd;
+ int out_file_fd;
+ char command_line[400];
+ int i;
+ unsigned c;
+ int c_in;
#ifdef WIN32
- char *tempenv;
-
-#define null_string(s) ((s == NULL) || (*s == '\0'))
-
- tempenv = getenv("TMPDIR");
- if (null_string(tempenv))
- tempenv = getenv("TEMP");
- if (null_string(tempenv))
- tempenv = getenv("TMP");
- if (null_string(tempenv))
- tempenv = "c:/tmp"; /* "/tmp" is not good if we are on a CD-ROM */
- in_file_name = concat(tempenv, "/__aleph__in__XXXXXX");
- mktemp(in_file_name);
+ char *tempenv;
+
+# define null_string(s) ((s == NULL) || (*s == '\0'))
+
+ tempenv = getenv("TMPDIR");
+ if (null_string(tempenv))
+ tempenv = getenv("TEMP");
+ if (null_string(tempenv))
+ tempenv = getenv("TMP");
+ if (null_string(tempenv))
+ tempenv = "c:/tmp"; /* "/tmp" is not good if we are on a CD-ROM */
+ in_file_name = concat(tempenv, "/__aleph__in__XXXXXX");
+ mktemp(in_file_name);
+ in_file = fopen(in_file_name, FOPEN_WBIN_MODE);
#else
- in_file_name = strdup("/tmp/__aleph__in__XXXXXX");
- mkstemp(in_file_name);
-#endif /* WIN32 */
-
- in_file = fopen(in_file_name, FOPEN_WBIN_MODE);
-
- for (i=1; i<=otp_input_end; i++) {
- c = otp_input_buf[i];
- if (c>0xffff) {
- fprintf(stderr, "Aleph does not currently support 31-bit chars\n");
- exit(1);
- }
- if (c>0x4000000) {
- fputc(0xfc | ((c>>30) & 0x1), in_file);
- fputc(0x80 | ((c>>24) & 0x3f), in_file);
- fputc(0x80 | ((c>>18) & 0x3f), in_file);
- fputc(0x80 | ((c>>12) & 0x3f), in_file);
- fputc(0x80 | ((c>>6) & 0x3f), in_file);
- fputc(0x80 | (c & 0x3f), in_file);
- } else if (c>0x200000) {
- fputc(0xf8 | ((c>>24) & 0x3), in_file);
- fputc(0x80 | ((c>>18) & 0x3f), in_file);
- fputc(0x80 | ((c>>12) & 0x3f), in_file);
- fputc(0x80 | ((c>>6) & 0x3f), in_file);
- fputc(0x80 | (c & 0x3f), in_file);
- } else if (c>0x10000) {
- fputc(0xf0 | ((c>>18) & 0x7), in_file);
- fputc(0x80 | ((c>>12) & 0x3f), in_file);
- fputc(0x80 | ((c>>6) & 0x3f), in_file);
- fputc(0x80 | (c & 0x3f), in_file);
- } else if (c>0x800) {
- fputc(0xe0 | ((c>>12) & 0xf), in_file);
- fputc(0x80 | ((c>>6) & 0x3f), in_file);
- fputc(0x80 | (c & 0x3f), in_file);
- } else if (c>0x80) {
- fputc(0xc0 | ((c>>6) & 0x1f), in_file);
- fputc(0x80 | (c & 0x3f), in_file);
- } else {
- fputc(c & 0x7f, in_file);
- }
- }
- fclose(in_file);
-
+ in_file_name = strdup("/tmp/__aleph__in__XXXXXX");
+ in_file_fd = mkstemp(in_file_name);
+ in_file = fdopen(in_file_fd, FOPEN_WBIN_MODE);
+#endif /* WIN32 */
+
+
+ for (i = 1; i <= otp_input_end; i++) {
+ c = otp_input_buf[i];
+ if (c > 0xffff) {
+ fprintf(stderr, "Aleph does not currently support 31-bit chars\n");
+ exit(1);
+ }
+ if (c > 0x4000000) {
+ fputc(0xfc | ((c >> 30) & 0x1), in_file);
+ fputc(0x80 | ((c >> 24) & 0x3f), in_file);
+ fputc(0x80 | ((c >> 18) & 0x3f), in_file);
+ fputc(0x80 | ((c >> 12) & 0x3f), in_file);
+ fputc(0x80 | ((c >> 6) & 0x3f), in_file);
+ fputc(0x80 | (c & 0x3f), in_file);
+ } else if (c > 0x200000) {
+ fputc(0xf8 | ((c >> 24) & 0x3), in_file);
+ fputc(0x80 | ((c >> 18) & 0x3f), in_file);
+ fputc(0x80 | ((c >> 12) & 0x3f), in_file);
+ fputc(0x80 | ((c >> 6) & 0x3f), in_file);
+ fputc(0x80 | (c & 0x3f), in_file);
+ } else if (c > 0x10000) {
+ fputc(0xf0 | ((c >> 18) & 0x7), in_file);
+ fputc(0x80 | ((c >> 12) & 0x3f), in_file);
+ fputc(0x80 | ((c >> 6) & 0x3f), in_file);
+ fputc(0x80 | (c & 0x3f), in_file);
+ } else if (c > 0x800) {
+ fputc(0xe0 | ((c >> 12) & 0xf), in_file);
+ fputc(0x80 | ((c >> 6) & 0x3f), in_file);
+ fputc(0x80 | (c & 0x3f), in_file);
+ } else if (c > 0x80) {
+ fputc(0xc0 | ((c >> 6) & 0x1f), in_file);
+ fputc(0x80 | (c & 0x3f), in_file);
+ } else {
+ fputc(c & 0x7f, in_file);
+ }
+ }
+ fclose(in_file);
+
#define advance_cin if ((c_in = fgetc(out_file)) == -1) { \
fprintf(stderr, "File contains bad char\n"); \
goto end_of_while; \
}
-
+
#ifdef WIN32
- out_file_name = concat(tempenv, "/__aleph__out__XXXXXX");
- mktemp(out_file_name);
+ out_file_name = concat(tempenv, "/__aleph__out__XXXXXX");
+ mktemp(out_file_name);
+ out_file = fopen(out_file_name, FOPEN_RBIN_MODE);
#else
- out_file_name = strdup("/tmp/__aleph__out__XXXXXX");
- mkstemp(out_file_name);
+ out_file_name = strdup("/tmp/__aleph__out__XXXXXX");
+ out_file_fd = mkstemp(out_file_name);
+ out_file = fdopen(out_file_fd, FOPEN_RBIN_MODE);
#endif
- sprintf(command_line, "%s <%s >%s\n",
- external_ocp_name+1, in_file_name, out_file_name);
- system(command_line);
- out_file = fopen(out_file_name, FOPEN_RBIN_MODE);
- otp_output_end = 0;
- otp_output_buf[otp_output_end] = 0;
- while ((c_in = fgetc(out_file)) != -1) {
- if (c_in>=0xfc) {
- c = (c_in & 0x1) << 30;
- {advance_cin}
- c |= (c_in & 0x3f) << 24;
- {advance_cin}
- c |= (c_in & 0x3f) << 18;
- {advance_cin}
- c |= (c_in & 0x3f) << 12;
- {advance_cin}
- c |= (c_in & 0x3f) << 6;
- {advance_cin}
- c |= c_in & 0x3f;
- } else if (c_in>=0xf8) {
- c = (c_in & 0x3) << 24;
- {advance_cin}
- c |= (c_in & 0x3f) << 18;
- {advance_cin}
- c |= (c_in & 0x3f) << 12;
- {advance_cin}
- c |= (c_in & 0x3f) << 6;
- {advance_cin}
- c |= c_in & 0x3f;
- } else if (c_in>=0xf0) {
- c = (c_in & 0x7) << 18;
- {advance_cin}
- c |= (c_in & 0x3f) << 12;
- {advance_cin}
- c |= (c_in & 0x3f) << 6;
- {advance_cin}
- c |= c_in & 0x3f;
- } else if (c_in>=0xe0) {
- c = (c_in & 0xf) << 12;
- {advance_cin}
- c |= (c_in & 0x3f) << 6;
- {advance_cin}
- c |= c_in & 0x3f;
- } else if (c_in>=0x80) {
- c = (c_in & 0x1f) << 6;
- {advance_cin}
- c |= c_in & 0x3f;
- } else {
- c = c_in & 0x7f;
- }
- otp_output_buf[++otp_output_end] = c;
- }
-
-end_of_while:
- remove(in_file_name);
- remove(out_file_name);
+ sprintf(command_line, "%s <%s >%s\n",
+ external_ocp_name + 1, in_file_name, out_file_name);
+ system(command_line);
+ otp_output_end = 0;
+ otp_output_buf[otp_output_end] = 0;
+ while ((c_in = fgetc(out_file)) != -1) {
+ if (c_in >= 0xfc) {
+ c = (c_in & 0x1) << 30;
+ advance_cin;
+ c |= (c_in & 0x3f) << 24;
+ advance_cin;
+ c |= (c_in & 0x3f) << 18;
+ advance_cin;
+ c |= (c_in & 0x3f) << 12;
+ advance_cin;
+ c |= (c_in & 0x3f) << 6;
+ advance_cin;
+ c |= c_in & 0x3f;
+ } else if (c_in >= 0xf8) {
+ c = (c_in & 0x3) << 24;
+ advance_cin;
+ c |= (c_in & 0x3f) << 18;
+ advance_cin;
+ c |= (c_in & 0x3f) << 12;
+ advance_cin;
+ c |= (c_in & 0x3f) << 6;
+ advance_cin;
+ c |= c_in & 0x3f;
+ } else if (c_in >= 0xf0) {
+ c = (c_in & 0x7) << 18;
+ advance_cin;
+ c |= (c_in & 0x3f) << 12;
+ advance_cin;
+ c |= (c_in & 0x3f) << 6;
+ advance_cin;
+ c |= c_in & 0x3f;
+ } else if (c_in >= 0xe0) {
+ c = (c_in & 0xf) << 12;
+ advance_cin;
+ c |= (c_in & 0x3f) << 6;
+ advance_cin;
+ c |= c_in & 0x3f;
+ } else if (c_in >= 0x80) {
+ c = (c_in & 0x1f) << 6;
+ advance_cin;
+ c |= c_in & 0x3f;
+ } else {
+ c = c_in & 0x7f;
+ }
+ otp_output_buf[++otp_output_end] = c;
+ }
+ fclose(out_file);
+
+ end_of_while:
+ remove(in_file_name);
+ remove(out_file_name);
}
/* Read and write dump files through zlib */
@@ -224,120 +248,116 @@ end_of_while:
static gzFile gz_fmtfile = NULL;
-void
-do_zdump (char *p, int item_size, int nitems, FILE *out_file)
+void do_zdump(char *p, int item_size, int nitems, FILE * out_file)
{
- int err;
- if (nitems==0)
- return;
- if (gzwrite (gz_fmtfile,(void *)p, item_size*nitems) != item_size*nitems)
- {
- fprintf (stderr, "! Could not write %d %d-byte item(s): %s.\n",
- nitems, item_size, gzerror(gz_fmtfile,&err));
- uexit (1);
+ int err;
+ if (nitems == 0)
+ return;
+ if (gzwrite(gz_fmtfile, (void *) p, item_size * nitems) !=
+ item_size * nitems) {
+ fprintf(stderr, "! Could not write %d %d-byte item(s): %s.\n", nitems,
+ item_size, gzerror(gz_fmtfile, &err));
+ uexit(1);
}
}
-void
-do_zundump (char *p, int item_size, int nitems, FILE *in_file)
+void do_zundump(char *p, int item_size, int nitems, FILE * in_file)
{
- int err;
- if (nitems==0)
- return;
- if (gzread (gz_fmtfile,(void *)p, item_size*nitems) <= 0)
- {
- fprintf (stderr, "Could not undump %d %d-byte item(s): %s.\n",
- nitems, item_size, gzerror(gz_fmtfile,&err));
- uexit (1);
- }
+ int err;
+ if (nitems == 0)
+ return;
+ if (gzread(gz_fmtfile, (void *) p, item_size * nitems) <= 0) {
+ fprintf(stderr, "Could not undump %d %d-byte item(s): %s.\n",
+ nitems, item_size, gzerror(gz_fmtfile, &err));
+ uexit(1);
+ }
}
#define COMPRESSION "R3"
-boolean
-zopen_w_input (FILE **f, int format, const_string fopen_mode) {
- int callbackid;
- int res;
- char *fnam;
- callbackid = callback_defined(find_format_file_callback);
- if (callbackid>0) {
- res = run_callback(callbackid,"S->S",(nameoffile+1),&fnam);
- if (res && fnam && strlen(fnam)>0) {
- xfree (nameoffile);
- nameoffile = xmalloc (strlen(fnam)+2);
- memcpy((nameoffile+1),fnam,strlen(fnam));
- *(nameoffile+strlen(fnam)+1)=0;
- *f = xfopen(fnam,fopen_mode);
- if (*f == NULL) {
- return 0;
- }
- } else {
- return 0;
- }
- } else {
- res = open_input(f,format,fopen_mode);
- }
- if (res) {
- gz_fmtfile = gzdopen(fileno(*f),"rb" COMPRESSION);
- }
- return res;
+boolean zopen_w_input(FILE ** f, int format, const_string fopen_mode)
+{
+ int callbackid;
+ int res;
+ char *fnam;
+ callbackid = callback_defined(find_format_file_callback);
+ if (callbackid > 0) {
+ res = run_callback(callbackid, "S->S", (nameoffile + 1), &fnam);
+ if (res && fnam && strlen(fnam) > 0) {
+ xfree(nameoffile);
+ nameoffile = xmalloc(strlen(fnam) + 2);
+ memcpy((nameoffile + 1), fnam, strlen(fnam));
+ *(nameoffile + strlen(fnam) + 1) = 0;
+ *f = xfopen(fnam, fopen_mode);
+ if (*f == NULL) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+ } else {
+ res = open_input(f, format, fopen_mode);
+ }
+ if (res) {
+ gz_fmtfile = gzdopen(fileno(*f), "rb" COMPRESSION);
+ }
+ return res;
}
-boolean
-zopen_w_output (FILE **f, const_string fopen_mode) {
- int res = 1;
- if (luainit) {
- *f = fopen((nameoffile+1),fopen_mode);
- if (*f == NULL) {
- return 0;
+boolean zopen_w_output(FILE ** f, const_string fopen_mode)
+{
+ int res = 1;
+ if (luainit) {
+ *f = fopen((const_string) (nameoffile + 1), fopen_mode);
+ if (*f == NULL) {
+ return 0;
+ }
+ } else {
+ res = open_output(f, fopen_mode);
+ }
+ if (res) {
+ gz_fmtfile = gzdopen(fileno(*f), "wb" COMPRESSION);
}
- } else {
- res = open_output(f,fopen_mode);
- }
- if (res) {
- gz_fmtfile = gzdopen(fileno(*f),"wb" COMPRESSION);
- }
- return res;
+ return res;
}
-void
-zwclose (FILE *f) {
- gzclose(gz_fmtfile);
+void zwclose(FILE * f)
+{
+ gzclose(gz_fmtfile);
}
/* create the dvi or pdf file */
-int
-open_outfile(FILE **f, char *name, char *mode) {
- FILE *res;
- res = fopen(name,mode);
- if (res != NULL) {
- *f = res;
- return 1;
- }
- return 0;
+int open_outfile(FILE ** f, char *name, char *mode)
+{
+ FILE *res;
+ res = fopen(name, mode);
+ if (res != NULL) {
+ *f = res;
+ return 1;
+ }
+ return 0;
}
/* the caller sets tfm_buffer=NULL and tfm_size=0 */
-int
-readbinfile (FILE *f, unsigned char **tfm_buffer, integer *tfm_size) {
- void *buf;
- int size;
- if (fseek(f, 0, SEEK_END)==0) {
- size = ftell(f);
- if (size>0) {
- buf = xmalloc(size);
- if(fseek(f, 0, SEEK_SET)==0) {
- if(fread((void *)buf,size,1,f)==1) {
- *tfm_buffer=(unsigned char *)buf;
- *tfm_size=(integer)size;
- return 1;
- }
- }
- }
- } /* seek failed, or zero-sized file */
- return 0;
+int readbinfile(FILE * f, unsigned char **tfm_buffer, integer * tfm_size)
+{
+ void *buf;
+ int size;
+ if (fseek(f, 0, SEEK_END) == 0) {
+ size = ftell(f);
+ if (size > 0) {
+ buf = xmalloc(size);
+ if (fseek(f, 0, SEEK_SET) == 0) {
+ if (fread((void *) buf, size, 1, f) == 1) {
+ *tfm_buffer = (unsigned char *) buf;
+ *tfm_size = (integer) size;
+ return 1;
+ }
+ }
+ }
+ } /* seek failed, or zero-sized file */
+ return 0;
}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatoken.c b/Build/source/texk/web2c/luatexdir/lua/luatoken.c
index 5f823104d56..4182d94e6fe 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatoken.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luatoken.c
@@ -1,548 +1,600 @@
-/* $Id: luatoken.c 1168 2008-04-15 13:43:34Z taco $ */
+/* luatoken.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "tokens.h"
+#include "commands.h"
-command_item command_names[] =
- { { "relax", 0, NULL },
- { "left_brace", 0 , NULL },
- { "right_brace", 0 , NULL },
- { "math_shift", 0 , NULL },
- { "tab_mark", 0 , NULL },
- { "car_ret", 0 , NULL },
- { "mac_param", 0 , NULL },
- { "sup_mark", 0 , NULL },
- { "sub_mark", 0 , NULL },
- { "endv", 0 , NULL },
- { "spacer", 0 , NULL },
- { "letter", 0 , NULL },
- { "other_char", 0 , NULL },
- { "par_end", 0 , NULL },
- { "stop", 0 , NULL },
- { "delim_num", 0 , NULL },
- { "char_num", 0 , NULL },
- { "math_char_num", 0 , NULL },
- { "mark", 0 , NULL },
- { "xray", 0 , NULL },
- { "make_box", 0 , NULL },
- { "hmove", 0 , NULL },
- { "vmove", 0 , NULL },
- { "un_hbox", 0 , NULL },
- { "un_vbox", 0 , NULL },
- { "remove_item", 0 , NULL },
- { "hskip", 0 , NULL },
- { "vskip", 0 , NULL },
- { "mskip", 0 , NULL },
- { "kern", 0 , NULL },
- { "mkern", 0 , NULL },
- { "leader_ship", 0 , NULL },
- { "halign", 0 , NULL },
- { "valign", 0 , NULL },
- { "no_align", 0 , NULL },
- { "vrule", 0 , NULL },
- { "hrule", 0 , NULL },
- { "insert", 0 , NULL },
- { "vadjust", 0 , NULL },
- { "ignore_spaces", 0 , NULL },
- { "after_assignment", 0 , NULL },
- { "after_group", 0 , NULL },
- { "break_penalty", 0 , NULL },
- { "start_par", 0 , NULL },
- { "ital_corr", 0 , NULL },
- { "accent", 0 , NULL },
- { "math_accent", 0 , NULL },
- { "discretionary", 0 , NULL },
- { "eq_no", 0 , NULL },
- { "left_right", 0 , NULL },
- { "math_comp", 0 , NULL },
- { "limit_switch", 0 , NULL },
- { "above", 0 , NULL },
- { "math_style", 0 , NULL },
- { "math_choice", 0 , NULL },
- { "non_script", 0 , NULL },
- { "vcenter", 0 , NULL },
- { "case_shift", 0 , NULL },
- { "message", 0 , NULL },
- { "extension", 0 , NULL },
- { "in_stream", 0 , NULL },
- { "begin_group", 0 , NULL },
- { "end_group", 0 , NULL },
- { "omit", 0 , NULL },
- { "ex_space", 0 , NULL },
- { "no_boundary", 0 , NULL },
- { "radical", 0 , NULL },
- { "end_cs_name", 0 , NULL },
- { "char_ghost", 0 , NULL },
- { "assign_local_box", 0 , NULL },
- { "char_given", 0 , NULL },
- { "math_given", 0 , NULL },
- { "omath_given", 0 , NULL },
- { "last_item", 0 , NULL },
- { "toks_register", 0 , NULL },
- { "assign_toks", 0, NULL },
- { "assign_int", 0, NULL },
- { "assign_dimen", 0 , NULL },
- { "assign_glue", 0 ,NULL },
- { "assign_mu_glue", 0 , NULL },
- { "assign_font_dimen", 0 , NULL },
- { "assign_font_int", 0 , NULL },
- { "set_aux", 0 , NULL },
- { "set_prev_graf", 0 , NULL },
- { "set_page_dimen", 0 , NULL },
- { "set_page_int", 0 , NULL },
- { "set_box_dimen", 0 , NULL },
- { "set_shape", 0, NULL },
- { "def_code", 0 , NULL },
- { "extdef_code", 0 , NULL },
- { "def_family", 0 , NULL },
- { "set_font", 0 , NULL },
- { "def_font", 0 , NULL },
- { "register", 0 , NULL },
- { "assign_box_dir", 0 , NULL },
- { "assign_dir", 0 , NULL },
- { "advance", 0 , NULL },
- { "multiply", 0 , NULL },
- { "divide", 0 , NULL },
- { "prefix", 0 , NULL },
- { "let", 0 , NULL }, /* 100 */
- { "shorthand_def", 0 , NULL },
- { "read_to_cs", 0 , NULL },
- { "def", 0 , NULL },
- { "set_box", 0 , NULL },
- { "hyph_data", 0 , NULL },
- { "set_interaction", 0 , NULL },
- { "letterspace_font", 0 , NULL },
- { "set_ocp", 0 , NULL },
- { "def_ocp", 0 , NULL },
- { "set_ocp_list", 0 , NULL }, /* 110 */
- { "def_ocp_list", 0 , NULL },
- { "clear_ocp_lists", 0 , NULL },
- { "push_ocp_list", 0 , NULL },
- { "pop_ocp_list", 0 , NULL },
- { "ocp_list_op", 0 , NULL },
- { "ocp_trace_level", 0 , NULL},
- { "undefined_cs", 0 , NULL },
- { "expand_after", 0 , NULL },
- { "no_expand", 0 , NULL },
- { "input", 0 , NULL }, /* 120 */
- { "if_test", 0 , NULL },
- { "fi_or_else", 0 , NULL },
- { "cs_name", 0 , NULL },
- { "convert", 0 , NULL },
- { "the", 0 , NULL },
- { "top_bot_mark", 0 , NULL },
- { "call", 0 , NULL },
- { "long_call", 0 , NULL },
- { "outer_call", 0 , NULL },
- { "long_outer_call", 0 , NULL }, /* 130 */
- { "end_template", 0 , NULL },
- { "dont_expand", 0, NULL },
- { "glue_ref", 0 , NULL },
- { "shape_ref", 0 , NULL },
- { "box_ref", 0 , NULL },
- { "data", 0 , NULL },
- { NULL, 0, NULL } };
-
-
-int get_command_id (char *s) {
- int i;
- int cmd = -1;
- for (i=0;command_names[i].cmd_name != NULL;i++) {
- if (strcmp(s,command_names[i].cmd_name) == 0)
- break;
- }
- if (command_names[i].cmd_name!=NULL) {
- cmd = i;
- }
- return cmd;
+static const char _svn_version[] =
+ "$Id: luatoken.c 2079 2009-03-22 10:15:03Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/luatoken.c $";
+
+command_item command_names[] = {
+ {"relax", relax_cmd, NULL},
+ {"left_brace", left_brace_cmd, NULL},
+ {"right_brace", right_brace_cmd, NULL},
+ {"math_shift", math_shift_cmd, NULL},
+ {"tab_mark", tab_mark_cmd, NULL},
+ {"car_ret", car_ret_cmd, NULL},
+ {"mac_param", mac_param_cmd, NULL},
+ {"sup_mark", sup_mark_cmd, NULL},
+ {"sub_mark", sub_mark_cmd, NULL},
+ {"endv", endv_cmd, NULL},
+ {"spacer", spacer_cmd, NULL},
+ {"letter", letter_cmd, NULL},
+ {"other_char", other_char_cmd, NULL},
+ {"par_end", par_end_cmd, NULL},
+ {"stop", stop_cmd, NULL},
+ {"delim_num", delim_num_cmd, NULL},
+ {"char_num", char_num_cmd, NULL},
+ {"math_char_num", math_char_num_cmd, NULL},
+ {"mark", mark_cmd, NULL},
+ {"xray", xray_cmd, NULL},
+ {"make_box", make_box_cmd, NULL},
+ {"hmove", hmove_cmd, NULL},
+ {"vmove", vmove_cmd, NULL},
+ {"un_hbox", un_hbox_cmd, NULL},
+ {"un_vbox", un_vbox_cmd, NULL},
+ {"remove_item", remove_item_cmd, NULL},
+ {"hskip", hskip_cmd, NULL},
+ {"vskip", vskip_cmd, NULL},
+ {"mskip", mskip_cmd, NULL},
+ {"kern", kern_cmd, NULL},
+ {"mkern", mkern_cmd, NULL},
+ {"leader_ship", leader_ship_cmd, NULL},
+ {"halign", halign_cmd, NULL},
+ {"valign", valign_cmd, NULL},
+ {"no_align", no_align_cmd, NULL},
+ {"vrule", vrule_cmd, NULL},
+ {"hrule", hrule_cmd, NULL},
+ {"insert", insert_cmd, NULL},
+ {"vadjust", vadjust_cmd, NULL},
+ {"ignore_spaces", ignore_spaces_cmd, NULL},
+ {"after_assignment", after_assignment_cmd, NULL},
+ {"after_group", after_group_cmd, NULL},
+ {"break_penalty", break_penalty_cmd, NULL},
+ {"start_par", start_par_cmd, NULL},
+ {"ital_corr", ital_corr_cmd, NULL},
+ {"accent", accent_cmd, NULL},
+ {"math_accent", math_accent_cmd, NULL},
+ {"discretionary", discretionary_cmd, NULL},
+ {"eq_no", eq_no_cmd, NULL},
+ {"left_right", left_right_cmd, NULL},
+ {"math_comp", math_comp_cmd, NULL},
+ {"limit_switch", limit_switch_cmd, NULL},
+ {"above", above_cmd, NULL},
+ {"math_style", math_style_cmd, NULL},
+ {"math_choice", math_choice_cmd, NULL},
+ {"non_script", non_script_cmd, NULL},
+ {"vcenter", vcenter_cmd, NULL},
+ {"case_shift", case_shift_cmd, NULL},
+ {"message", message_cmd, NULL},
+ {"extension", extension_cmd, NULL},
+ {"in_stream", in_stream_cmd, NULL},
+ {"begin_group", begin_group_cmd, NULL},
+ {"end_group", end_group_cmd, NULL},
+ {"omit", omit_cmd, NULL},
+ {"ex_space", ex_space_cmd, NULL},
+ {"no_boundary", no_boundary_cmd, NULL},
+ {"radical", radical_cmd, NULL},
+ {"end_cs_name", end_cs_name_cmd, NULL},
+ {"char_ghost", char_ghost_cmd, NULL},
+ {"assign_local_box", assign_local_box_cmd, NULL},
+ {"char_given", char_given_cmd, NULL},
+ {"math_given", math_given_cmd, NULL},
+ {"omath_given", omath_given_cmd, NULL},
+ {"xmath_given", xmath_given_cmd, NULL},
+ {"last_item", last_item_cmd, NULL},
+ {"toks_register", toks_register_cmd, NULL},
+ {"assign_toks", assign_toks_cmd, NULL},
+ {"assign_int", assign_int_cmd, NULL},
+ {"assign_attr", assign_attr_cmd, NULL},
+ {"assign_dimen", assign_dimen_cmd, NULL},
+ {"assign_glue", assign_glue_cmd, NULL},
+ {"assign_mu_glue", assign_mu_glue_cmd, NULL},
+ {"assign_font_dimen", assign_font_dimen_cmd, NULL},
+ {"assign_font_int", assign_font_int_cmd, NULL},
+ {"set_aux", set_aux_cmd, NULL},
+ {"set_prev_graf", set_prev_graf_cmd, NULL},
+ {"set_page_dimen", set_page_dimen_cmd, NULL},
+ {"set_page_int", set_page_int_cmd, NULL},
+ {"set_box_dimen", set_box_dimen_cmd, NULL},
+ {"set_tex_shape", set_tex_shape_cmd, NULL},
+ {"set_etex_shape", set_etex_shape_cmd, NULL},
+ {"def_char_code", def_char_code_cmd, NULL},
+ {"def_del_code", def_del_code_cmd, NULL},
+ {"extdef_math_code", extdef_math_code_cmd, NULL},
+ {"extdef_del_code", extdef_del_code_cmd, NULL},
+ {"def_family", def_family_cmd, NULL},
+ {"set_math_param", set_math_param_cmd, NULL},
+ {"set_font", set_font_cmd, NULL},
+ {"def_font", def_font_cmd, NULL},
+ {"register", register_cmd, NULL},
+ {"assign_box_dir", assign_box_dir_cmd, NULL},
+ {"assign_dir", assign_dir_cmd, NULL},
+ {"advance", advance_cmd, NULL},
+ {"multiply", multiply_cmd, NULL},
+ {"divide", divide_cmd, NULL},
+ {"prefix", prefix_cmd, NULL},
+ {"let", let_cmd, NULL},
+ {"shorthand_def", shorthand_def_cmd, NULL},
+ {"read_to_cs", read_to_cs_cmd, NULL},
+ {"def", def_cmd, NULL},
+ {"set_box", set_box_cmd, NULL},
+ {"hyph_data", hyph_data_cmd, NULL},
+ {"set_interaction", set_interaction_cmd, NULL},
+ {"letterspace_font", letterspace_font_cmd, NULL},
+ {"pdf_copy_font", pdf_copy_font_cmd, NULL},
+ {"set_ocp", set_ocp_cmd, NULL},
+ {"def_ocp", def_ocp_cmd, NULL},
+ {"set_ocp_list", set_ocp_list_cmd, NULL},
+ {"def_ocp_list", def_ocp_list_cmd, NULL},
+ {"clear_ocp_lists", clear_ocp_lists_cmd, NULL},
+ {"push_ocp_list", push_ocp_list_cmd, NULL},
+ {"pop_ocp_list", pop_ocp_list_cmd, NULL},
+ {"ocp_list_op", ocp_list_op_cmd, NULL},
+ {"ocp_trace_level", ocp_trace_level_cmd, NULL},
+ {"undefined_cs", undefined_cs_cmd, NULL},
+ {"expand_after", expand_after_cmd, NULL},
+ {"no_expand", no_expand_cmd, NULL},
+ {"input", input_cmd, NULL},
+ {"if_test", if_test_cmd, NULL},
+ {"fi_or_else", fi_or_else_cmd, NULL},
+ {"cs_name", cs_name_cmd, NULL},
+ {"convert", convert_cmd, NULL},
+ {"the", the_cmd, NULL},
+ {"top_bot_mark", top_bot_mark_cmd, NULL},
+ {"call", call_cmd, NULL},
+ {"long_call", long_call_cmd, NULL},
+ {"outer_call", outer_call_cmd, NULL},
+ {"long_outer_call", long_outer_call_cmd, NULL},
+ {"end_template", end_template_cmd, NULL},
+ {"dont_expand", dont_expand_cmd, NULL},
+ {"glue_ref", glue_ref_cmd, NULL},
+ {"shape_ref", shape_ref_cmd, NULL},
+ {"box_ref", box_ref_cmd, NULL},
+ {"data", data_cmd, NULL},
+ {NULL, 0, NULL}
+};
+
+
+int get_command_id(char *s)
+{
+ int i;
+ int cmd = -1;
+ for (i = 0; command_names[i].cmd_name != NULL; i++) {
+ if (strcmp(s, command_names[i].cmd_name) == 0)
+ break;
+ }
+ if (command_names[i].cmd_name != NULL) {
+ cmd = i;
+ }
+ return cmd;
}
-static int
-get_cur_cmd (lua_State *L) {
- int r = 0, len;
- cur_cs = 0;
- len = lua_objlen(L,-1);
- if (len==3 || len==2) {
- r = 1;
- lua_rawgeti(L,-1,1);
- cur_cmd = lua_tointeger(L,-1);
- lua_rawgeti(L,-2,2);
- cur_chr = lua_tointeger(L,-1);
- if (len==3) {
- lua_rawgeti(L,-3,3);
- cur_cs = lua_tointeger(L,-1);
- }
- lua_pop(L,len);
- if (cur_cs==0)
- cur_tok=(cur_cmd*string_offset)+cur_chr;
- else
- cur_tok=cs_token_flag+cur_cs;
- }
- return r;
+static int get_cur_cmd(lua_State * L)
+{
+ int r = 0;
+ int len = lua_objlen(L, -1);
+ cur_cs = 0;
+ if (len == 3 || len == 2) {
+ r = 1;
+ lua_rawgeti(L, -1, 1);
+ cur_cmd = lua_tointeger(L, -1);
+ lua_rawgeti(L, -2, 2);
+ cur_chr = lua_tointeger(L, -1);
+ if (len == 3) {
+ lua_rawgeti(L, -3, 3);
+ cur_cs = lua_tointeger(L, -1);
+ }
+ lua_pop(L, len);
+ if (cur_cs == 0)
+ cur_tok = (cur_cmd * string_offset) + cur_chr;
+ else
+ cur_tok = cs_token_flag + cur_cs;
+ }
+ return r;
}
-static int
-token_from_lua (lua_State *L) {
- int cmd,chr;
- int cs = 0;
- int len = lua_objlen(L,-1);
- if (len==3 || len==2) {
- lua_rawgeti(L,-1,1);
- cmd = lua_tointeger(L,-1);
- lua_rawgeti(L,-2,2);
- chr = lua_tointeger(L,-1);
- if (len==3) {
- lua_rawgeti(L,-3,3);
- cs = lua_tointeger(L,-1);
- }
- lua_pop(L,len);
- if (cs==0) {
- return (cmd*string_offset)+chr;
- } else {
- return cs_token_flag+cs;
+static int token_from_lua(lua_State * L)
+{
+ int cmd, chr;
+ int cs = 0;
+ int len = lua_objlen(L, -1);
+ if (len == 3 || len == 2) {
+ lua_rawgeti(L, -1, 1);
+ cmd = lua_tointeger(L, -1);
+ lua_rawgeti(L, -2, 2);
+ chr = lua_tointeger(L, -1);
+ if (len == 3) {
+ lua_rawgeti(L, -3, 3);
+ cs = lua_tointeger(L, -1);
+ }
+ lua_pop(L, len);
+ if (cs == 0) {
+ return (cmd * string_offset) + chr;
+ } else {
+ return cs_token_flag + cs;
+ }
}
- }
- return -1;
+ return -1;
}
-static int
-get_cur_cs (lua_State *L) {
- char *s;
- unsigned j;
- size_t l;
- integer cs;
- int save_nncs;
- int ret;
- ret = 0;
- cur_cs = 0;
- lua_getfield(L,-1,"name");
- if (lua_isstring(L,-1)) {
- s = (char *)lua_tolstring(L,-1,&l);
- if (l>0) {
- if ((int)(last+l)>buf_size)
- check_buffer_overflow(last+l);
- for (j=0;j<l;j++) {
- buffer[last+1+j]=*s++;
- }
- save_nncs = no_new_control_sequence;
- no_new_control_sequence = false;
- cs = id_lookup((last+1),l);
- cur_tok = cs_token_flag+cs;
- cur_cmd = zget_eq_type(cs);
- cur_chr = zget_equiv(cs);
- no_new_control_sequence = save_nncs;
- ret = 1;
+static int get_cur_cs(lua_State * L)
+{
+ char *s;
+ unsigned j;
+ size_t l;
+ integer cs;
+ int save_nncs;
+ int ret;
+ ret = 0;
+ cur_cs = 0;
+ lua_getfield(L, -1, "name");
+ if (lua_isstring(L, -1)) {
+ s = (char *) lua_tolstring(L, -1, &l);
+ if (l > 0) {
+ if ((int) (last + l) > buf_size)
+ check_buffer_overflow(last + l);
+ for (j = 0; j < l; j++) {
+ buffer[last + 1 + j] = *s++;
+ }
+ save_nncs = no_new_control_sequence;
+ no_new_control_sequence = false;
+ cs = id_lookup((last + 1), l);
+ cur_tok = cs_token_flag + cs;
+ cur_cmd = zget_eq_type(cs);
+ cur_chr = zget_equiv(cs);
+ no_new_control_sequence = save_nncs;
+ ret = 1;
+ }
}
- }
- lua_pop(L,1);
- return ret;
+ lua_pop(L, 1);
+ return ret;
}
-#define append_i_byte(a) { \
- if ((i+2)>alloci) { \
- ret = xrealloc(ret,alloci+64); \
- alloci = alloci + 64; } \
- ret[i++] = a; }
-
-#define Print_char(a) append_i_byte(a)
-
-#define Print_uchar(s) { \
- if (s<=0x7F) { \
- Print_char(s); \
- } else if (s<=0x7FF) { \
- Print_char(0xC0 + (s / 0x40)); \
- Print_char(0x80 + (s % 0x40)); \
- } else if (s<=0xFFFF) { \
- Print_char(0xE0 + (s / 0x1000)); \
- Print_char(0x80 + ((s % 0x1000) / 0x40)); \
- Print_char(0x80 + ((s % 0x1000) % 0x40)); \
- } else if (s>=0x10FF00) { \
- Print_char(s-0x10FF00); \
- } else { \
- Print_char(0xF0 + (s / 0x40000)); \
- Print_char(0x80 + ((s % 0x40000) / 0x1000)); \
- Print_char(0x80 + (((s % 0x40000) % 0x1000) / 0x40)); \
- Print_char(0x80 + (((s % 0x40000) % 0x1000) % 0x40)); \
- } }
-
-
-#define Print_esc(b) { if (e>0 && e<string_offset) { Print_uchar (e); Print_uchar (e); } \
- { char *v = b; while (*v) { Print_char(*v); v++; } } }
-
-#define single_letter(a) (length(a)==1)|| \
- ((length(a)==4)&&(str_pool[str_start_macro(a)]>=0xF0))|| \
- ((length(a)==3)&&(str_pool[str_start_macro(a)]>=0xE0))|| \
+#define make_room(a) \
+ if ((i+a+1)>alloci) { \
+ ret = xrealloc(ret,alloci+64); \
+ alloci = alloci + 64; \
+ }
+
+
+#define append_i_byte(a) ret[i++] = a
+
+#define Print_char(a) make_room(1); append_i_byte(a)
+
+#define Print_uchar(s) { \
+ make_room(4); \
+ if (s<=0x7F) { \
+ append_i_byte(s); \
+ } else if (s<=0x7FF) { \
+ append_i_byte(0xC0 + (s / 0x40)); \
+ append_i_byte(0x80 + (s % 0x40)); \
+ } else if (s<=0xFFFF) { \
+ append_i_byte(0xE0 + (s / 0x1000)); \
+ append_i_byte(0x80 + ((s % 0x1000) / 0x40)); \
+ append_i_byte(0x80 + ((s % 0x1000) % 0x40)); \
+ } else if (s>=0x110000) { \
+ append_i_byte(s-0x11000); \
+ } else { \
+ append_i_byte(0xF0 + (s / 0x40000)); \
+ append_i_byte(0x80 + ((s % 0x40000) / 0x1000)); \
+ append_i_byte(0x80 + (((s % 0x40000) % 0x1000) / 0x40)); \
+ append_i_byte(0x80 + (((s % 0x40000) % 0x1000) % 0x40)); \
+ } }
+
+
+#define Print_esc(b) { \
+ char *v = b; \
+ if (e>0 && e<string_offset) { \
+ Print_uchar (e); Print_uchar (e); \
+ } \
+ while (*v) { Print_char(*v); v++; } \
+ }
+
+#define single_letter(a) (length(a)==1)|| \
+ ((length(a)==4)&&(str_pool[str_start_macro(a)]>=0xF0))|| \
+ ((length(a)==3)&&(str_pool[str_start_macro(a)]>=0xE0))|| \
((length(a)==2)&&(str_pool[str_start_macro(a)]>=0xC0))
-#define is_cat_letter(a) \
+#define is_active_cs(a) (length(a)>3 && \
+ (str_pool[str_start_macro(a)] == 0xEF) && \
+ (str_pool[str_start_macro(a)+1] == 0xBF) && \
+ (str_pool[str_start_macro(a)+2] == 0xBF))
+
+#define is_cat_letter(a) \
(get_char_cat_code(pool_to_unichar(str_start_macro(a))) == 11)
-static int active_base = 0;
-static int hash_base = 0;
-static int eqtb_size = 0;
static int null_cs = 0;
-static int undefined_control_sequence;
-
-char *
-tokenlist_to_cstring ( int p , int inhibit_par, int *siz) {
- integer m, c ;
- integer q;
- char *s;
- int e;
- char *ret=NULL;
- int match_chr = '#';
- int n = '0';
- int alloci = 0;
- int i = 0;
- if (p==null || link(p)==null) {
- if (siz!=NULL)
- *siz = 0;
- return NULL;
- }
- p = link(p); /* skip refcount */
- if (active_base==0) {
- active_base = get_active_base();
- hash_base = get_hash_base();
- null_cs = get_nullcs();
- eqtb_size = get_eqtb_size();
- undefined_control_sequence = get_undefined_control_sequence();
- }
- e = get_escape_char();
- while ( p != null ) {
- if (p < fix_mem_min || p > fix_mem_end ) {
- Print_esc ("CLOBBERED.") ;
- break;
- }
- if (info(p)>=cs_token_flag) {
- if ( ! (inhibit_par && info(p)==par_token) ) {
- q = info(p) - cs_token_flag;
- if (q<hash_base) {
- if (q==null_cs) {
- /* Print_esc("csname"); Print_esc("endcsname"); */
- } else {
- if (q<active_base) {
- Print_esc("IMPOSSIBLE.");
- } else {
- Print_uchar(q-active_base);
- }
- }
- } else if ((q>=undefined_control_sequence)&&((q<=eqtb_size)||(q>eqtb_size+hash_extra))) {
- Print_esc("IMPOSSIBLE.");
- } else if ((zget_cs_text(q)<0)||(zget_cs_text(q)>=str_ptr)) {
- Print_esc("NONEXISTENT.");
- } else {
- Print_uchar (e);
- s = makecstring(zget_cs_text(q));
- while (*s) { Print_char(*s); s++; }
- if ((! single_letter(zget_cs_text(q))) || is_cat_letter(zget_cs_text(q))) {
- Print_char(' ');
- }
- }
- }
- } else {
- m=info(p) / string_offset;
- c=info(p) % string_offset;
- if ( info(p) < 0 ) {
- Print_esc ( "BAD.") ;
- } else {
- switch ( m ) {
- case 6 : /* falls through */
- Print_uchar ( c ) ;
- case 1 :
- case 2 :
- case 3 :
- case 4 :
- case 7 :
- case 8 :
- case 10 :
- case 11 :
- case 12 :
- Print_uchar ( c ) ;
- break ;
- case 5 :
- Print_uchar ( match_chr ) ;
- if ( c <= 9 ) {
- Print_char ( c + '0') ;
- } else {
- Print_char ( '!' ) ;
- return NULL;
- }
- break ;
- case 13 :
- match_chr = c ;
- Print_uchar ( c ) ;
- incr ( n ) ;
- Print_char ( n ) ;
- if ( n > '9' )
- return NULL;
- break ;
- case 14 :
- if ( c == 0 ) {
- Print_char ('-');
- Print_char ('>') ;
- }
- break ;
- default:
- Print_esc ( "BAD.") ;
- break ;
- }
- }
- }
- p = link(p);
- }
- ret[i]=0;
- if (siz!=NULL)
- *siz = i;
- return ret;
+static int eqtb_size = 0;
+
+/* 2,720,652 */
+char *tokenlist_to_cstring(int pp, int inhibit_par, int *siz)
+{
+ register integer p, c, m;
+ integer q;
+ integer infop;
+ char *s;
+ int e;
+ char *ret;
+ int match_chr = '#';
+ int n = '0';
+ int alloci = 1024;
+ int i = 0;
+ p = pp;
+ if (p == null || link(p) == null) {
+ if (siz != NULL)
+ *siz = 0;
+ return NULL;
+ }
+ ret = xmalloc(alloci);
+ p = link(p); /* skip refcount */
+ if (null_cs == 0) {
+ null_cs = get_nullcs();
+ eqtb_size = get_eqtb_size();
+ }
+ e = get_escape_char();
+ while (p != null) {
+ if (p < fix_mem_min || p > fix_mem_end) {
+ Print_esc("CLOBBERED.");
+ break;
+ }
+ infop = info(p);
+ if (infop >= cs_token_flag) {
+ if (!(inhibit_par && infop == par_token)) {
+ q = infop - cs_token_flag;
+ if (q < hash_base) {
+ if (q == null_cs) {
+ /* Print_esc("csname"); Print_esc("endcsname"); */
+ }
+ } else if ((q >= static_undefined_control_sequence)
+ && ((q <= eqtb_size)
+ || (q > eqtb_size + hash_extra))) {
+ Print_esc("IMPOSSIBLE.");
+ } else if ((zget_cs_text(q) < 0)
+ || (zget_cs_text(q) >= str_ptr)) {
+ Print_esc("NONEXISTENT.");
+ } else {
+ str_number txt = zget_cs_text(q);
+ s = makecstring(txt);
+ if (is_active_cs(txt)) {
+ s = s + 3;
+ while (*s) {
+ Print_char(*s);
+ s++;
+ }
+ } else {
+ Print_uchar(e);
+ while (*s) {
+ Print_char(*s);
+ s++;
+ }
+ if ((!single_letter(zget_cs_text(q)))
+ || is_cat_letter(zget_cs_text(q))) {
+ Print_char(' ');
+ }
+ }
+ }
+ }
+ } else {
+ if (infop < 0) {
+ Print_esc("BAD.");
+ } else {
+ m = infop >> string_offset_bits;
+ c = infop & (string_offset - 1);
+ switch (m) {
+ case 10:
+ case 11:
+ case 12:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 7:
+ case 8:
+ Print_uchar(c);
+ break;
+ case 6:
+ /* Print_uchar(c); */
+ Print_uchar(c);
+ break;
+ case 5:
+ Print_uchar(match_chr);
+ if (c <= 9) {
+ Print_char(c + '0');
+ } else {
+ Print_char('!');
+ xfree(ret);
+ return NULL;
+ }
+ break;
+ case 13:
+ match_chr = c;
+ Print_uchar(c);
+ n++;
+ Print_char(n);
+ if (n > '9') {
+ xfree(ret);
+ return NULL;
+ }
+ break;
+ case 14:
+ if (c == 0) {
+ Print_char('-');
+ Print_char('>');
+ }
+ break;
+ default:
+ Print_esc("BAD.");
+ break;
+ }
+ }
+ }
+ p = link(p);
+ }
+ ret[i] = 0;
+ if (siz != NULL)
+ *siz = i;
+ return ret;
}
-void
-tokenlist_to_lua(lua_State *L, int p) {
- int cmd,chr,cs;
- int v;
- int i = 1;
- v = p;
- while (v!=null && v < fix_mem_end) { i++; v = link(v); }
- i = 1;
- lua_createtable(L,i,0);
- while (p!=null&& p < fix_mem_end) {
- if (info(p)>=cs_token_flag) {
- cs=info(p)-cs_token_flag;
- cmd = zget_eq_type(cs);
- chr = zget_equiv(cs);
- make_token_table(L,cmd,chr,cs);
- } else {
- cmd=info(p) / string_offset;
- chr=info(p) % string_offset;
- make_token_table(L,cmd,chr,0);
+void tokenlist_to_lua(lua_State * L, int p)
+{
+ int cmd, chr, cs;
+ int v;
+ int i = 1;
+ v = p;
+ while (v != null && v < fix_mem_end) {
+ i++;
+ v = link(v);
+ }
+ i = 1;
+ lua_createtable(L, i, 0);
+ while (p != null && p < fix_mem_end) {
+ if (info(p) >= cs_token_flag) {
+ cs = info(p) - cs_token_flag;
+ cmd = zget_eq_type(cs);
+ chr = zget_equiv(cs);
+ make_token_table(L, cmd, chr, cs);
+ } else {
+ cmd = info(p) / string_offset;
+ chr = info(p) % string_offset;
+ make_token_table(L, cmd, chr, 0);
+ }
+ lua_rawseti(L, -2, i++);
+ p = link(p);
}
- lua_rawseti(L,-2,i++);
- p = link(p);
- }
}
-void
-tokenlist_to_luastring(lua_State *L, int p) {
- int l;
- char *s;
- s = tokenlist_to_cstring(p,1,&l);
- lua_pushlstring(L,s,l);
+void tokenlist_to_luastring(lua_State * L, int p)
+{
+ int l;
+ char *s;
+ s = tokenlist_to_cstring(p, 1, &l);
+ lua_pushlstring(L, s, l);
}
-int
-tokenlist_from_lua(lua_State *L) {
- char *s;
- int tok;
- size_t i,j;
- halfword p,q,r;
- r = get_avail();
- info(r)=0; /* ref count */
- link(r)=null;
- p = r;
- if (lua_istable(L,-1)) {
- j = lua_objlen(L,-1);
- if (j>0) {
- for (i=1;i<=j;i++) {
- lua_rawgeti(L,-1,i);
- tok = token_from_lua(L);
- if (tok>=0) {
- store_new_token(tok);
- }
- lua_pop(L,1);
- };
- }
- return r;
- } else if (lua_isstring(L,-1)) {
- s = (char *)lua_tolstring(L,-1,&j);
- for (i=0;i<j;i++) {
- if (s[i] == 32) {
- tok = (10*string_offset)+s[i];
- } else {
- tok = (12*string_offset)+s[i];
- }
- store_new_token(tok);
+int tokenlist_from_lua(lua_State * L)
+{
+ char *s;
+ int tok;
+ size_t i, j;
+ halfword p, q, r;
+ r = get_avail();
+ info(r) = 0; /* ref count */
+ link(r) = null;
+ p = r;
+ if (lua_istable(L, -1)) {
+ j = lua_objlen(L, -1);
+ if (j > 0) {
+ for (i = 1; i <= j; i++) {
+ lua_rawgeti(L, -1, i);
+ tok = token_from_lua(L);
+ if (tok >= 0) {
+ store_new_token(tok);
+ }
+ lua_pop(L, 1);
+ };
+ }
+ return r;
+ } else if (lua_isstring(L, -1)) {
+ s = (char *) lua_tolstring(L, -1, &j);
+ for (i = 0; i < j; i++) {
+ if (s[i] == 32) {
+ tok = (10 * string_offset) + s[i];
+ } else {
+ tok = (12 * string_offset) + s[i];
+ }
+ store_new_token(tok);
+ }
+ return r;
+ } else {
+ free_avail(r);
+ return null;
}
- return r;
- } else {
- free_avail(r);
- return null;
- }
}
-void
-do_get_token_lua (integer callback_id) {
- lua_State *L = Luas[0];
-
- lua_rawgeti(L,LUA_REGISTRYINDEX,callback_callbacks_id);
- while (1) {
- lua_rawgeti(L,-1, callback_id);
- if (!lua_isfunction(L,-1)) {
- lua_pop(L,2); /* the not-a-function callback and the container */
- get_next();
- return;
- }
- if (lua_pcall(L,0,1,0) != 0) { /* no arg, 1 result */
- fprintf(stdout,"error: %s\n",lua_tostring(L,-1));
- lua_pop(L,2);
- error();
- return;
- }
- if (lua_istable(L,-1)) {
- lua_rawgeti(L,-1,1);
- if (lua_istable(L,-1)) {
- integer p,q,r;
- int i,j;
- lua_pop(L,1);
- /* build a token list */
- r = get_avail();
- p = r;
- j = lua_objlen(L,-1);
- if (j>0) {
- for (i=1;i<=j;i++) {
- lua_rawgeti(L,-1,i);
- if (get_cur_cmd(L) || get_cur_cs(L)) {
- store_new_token(cur_tok);
- }
- lua_pop(L,1);
- }
- }
- if (p!=r) {
- p = link(r);
- free_avail(r);
- begin_token_list(p, inserted);
- cur_input.nofilter_field=true;
- get_next();
- lua_pop(L,1);
- break;
- } else {
- fprintf(stdout,"error: illegal or empty token list returned\n");
- lua_pop(L,2);
- error();
- return;
- }
- } else {
- lua_pop(L,1);
- if (get_cur_cmd(L) || get_cur_cs(L)) {
- lua_pop(L,1);
- break;
- } else {
- lua_pop(L,2);
- continue;
- }
- }
- } else {
- lua_pop(L,1);
- continue;
+void do_get_token_lua(integer callback_id)
+{
+ lua_State *L = Luas;
+ while (1) {
+ if (!get_callback(L, callback_id)) {
+ get_next();
+ lua_pop(L, 2); /* the not-a-function callback and the container */
+ break;
+ }
+ if (lua_pcall(L, 0, 1, 0) != 0) { /* no arg, 1 result */
+ tex_error((char *) lua_tostring(L, -1), NULL);
+ lua_pop(L, 2); /* container and result */
+ break;
+ }
+ if (lua_istable(L, -1)) {
+ lua_rawgeti(L, -1, 1);
+ if (lua_istable(L, -1)) { /* container, result, result[1] */
+ integer p, q, r;
+ int i, j;
+ lua_pop(L, 1); /* container, result */
+ /* build a token list */
+ r = get_avail();
+ p = r;
+ j = lua_objlen(L, -1);
+ if (j > 0) {
+ for (i = 1; i <= j; i++) {
+ lua_rawgeti(L, -1, i);
+ if (get_cur_cmd(L) || get_cur_cs(L)) {
+ store_new_token(cur_tok);
+ }
+ lua_pop(L, 1);
+ }
+ }
+ if (p != r) {
+ p = link(r);
+ free_avail(r);
+ begin_token_list(p, inserted);
+ cur_input.nofilter_field = true;
+ get_next();
+ } else {
+ tex_error("error: illegal or empty token list returned",
+ NULL);
+ }
+ lua_pop(L, 2);
+ break;
+ } else { /* container, result, whatever */
+ lua_pop(L, 1); /* container, result */
+ if (get_cur_cmd(L) || get_cur_cs(L)) {
+ lua_pop(L, 2);
+ break;
+ } else {
+ lua_pop(L, 2);
+ continue;
+ }
+ }
+ } else {
+ lua_pop(L, 2); /* container, result */
+ }
}
- }
- lua_pop(L,1); /* callback container */
- return;
+ return;
}
-
diff --git a/Build/source/texk/web2c/luatexdir/lua/texluac.c b/Build/source/texk/web2c/luatexdir/lua/texluac.c
index 4bc13458d13..d4295aba6ae 100644
--- a/Build/source/texk/web2c/luatexdir/lua/texluac.c
+++ b/Build/source/texk/web2c/luatexdir/lua/texluac.c
@@ -1,7 +1,29 @@
-/*
-** $Id: texluac.c 1013 2008-02-14 00:09:02Z oneiros $
-** Lua compiler (saves bytecodes to files; also list bytecodes)
-** See Copyright Notice in lua.h
+/* texlua.c
+
+* Copyright (C) 1994-2007 Lua.org, PUC-Rio. All rights reserved.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* "Software"), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sublicense, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject to
+* the following conditions:
+*
+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
*/
#include <errno.h>
@@ -23,177 +45,185 @@
#include <../lua51/lstring.h>
#include <../lua51/lundump.h>
-#define PROGNAME "texluac" /* default program name */
-#define OUTPUT PROGNAME ".out" /* default output file */
+static const char _svn_version[] =
+ "$Id: texluac.c 1226 2008-05-02 16:11:02Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/texluac.c $";
-static int dumping=1; /* dump bytecodes? */
-static int stripping=0; /* strip debug information? */
-static char Output[]={ OUTPUT }; /* default output file name */
-static const char* output=Output; /* actual output file name */
-static const char* progname=PROGNAME; /* actual program name */
+#define PROGNAME "texluac" /* default program name */
+#define OUTPUT PROGNAME ".out" /* default output file */
-static void fatal(const char* message)
+static int dumping = 1; /* dump bytecodes? */
+static int stripping = 0; /* strip debug information? */
+static char Output[] = { OUTPUT }; /* default output file name */
+static const char *output = Output; /* actual output file name */
+static const char *progname = PROGNAME; /* actual program name */
+
+static void fatal(const char *message)
{
- fprintf(stderr,"%s: %s\n",progname,message);
- exit(EXIT_FAILURE);
+ fprintf(stderr, "%s: %s\n", progname, message);
+ exit(EXIT_FAILURE);
}
-static void cannot(const char* what)
+static void cannot(const char *what)
{
- fprintf(stderr,"%s: cannot %s %s: %s\n",progname,what,output,strerror(errno));
- exit(EXIT_FAILURE);
+ fprintf(stderr, "%s: cannot %s %s: %s\n", progname, what, output,
+ strerror(errno));
+ exit(EXIT_FAILURE);
}
-static void usage(const char* message)
+static void usage(const char *message)
{
- if (*message=='-')
- fprintf(stderr,"%s: unrecognized option " LUA_QS "\n",progname,message);
- else
- fprintf(stderr,"%s: %s\n",progname,message);
- fprintf(stderr,
- "usage: %s [options] [filenames].\n"
- "Available options are:\n"
- " - process stdin\n"
- " -o name output to file " LUA_QL("name") " (default is \"%s\")\n"
- " -p parse only\n"
- " -s strip debug information\n"
- " -v show version information\n"
- " -- stop handling options\n",
- progname,Output);
- exit(EXIT_FAILURE);
+ if (*message == '-')
+ fprintf(stderr, "%s: unrecognized option " LUA_QS "\n", progname,
+ message);
+ else
+ fprintf(stderr, "%s: %s\n", progname, message);
+ fprintf(stderr,
+ "usage: %s [options] [filenames].\n"
+ "Available options are:\n"
+ " - process stdin\n"
+ " -o name output to file " LUA_QL("name") " (default is \"%s\")\n"
+ " -p parse only\n"
+ " -s strip debug information\n"
+ " -v show version information\n"
+ " -- stop handling options\n", progname, Output);
+ exit(EXIT_FAILURE);
}
-#define IS(s) (strcmp(argv[i],s)==0)
+#define IS(s) (strcmp(argv[i],s)==0)
-static int doargs(int argc, char* argv[])
+static int doargs(int argc, char *argv[])
{
- int i;
- int version=0;
- if (argv[0]!=NULL && *argv[0]!=0) progname=argv[0];
- for (i=1; i<argc; i++)
- {
- if (*argv[i]!='-') /* end of options; keep it */
- break;
- else if (IS("--")) /* end of options; skip it */
- {
- ++i;
- if (version) ++version;
- break;
- }
- else if (IS("-")) /* end of options; use stdin */
- break;
- else if (IS("-o")) /* output file */
- {
- output=argv[++i];
- if (output==NULL || *output==0) usage(LUA_QL("-o") " needs argument");
- if (IS("-")) output=NULL;
- }
- else if (IS("-p")) /* parse only */
- dumping=0;
- else if (IS("-s")) /* strip debug information */
- stripping=1;
- else if (IS("-v")) /* show version */
- ++version;
- else if (IS("--luaconly")) /* ignore */
- ;
- else if (IS("--luac")) /* ignore */
- ;
- else /* unknown option */
- usage(argv[i]);
- }
- if (i==argc && (!dumping))
- {
- dumping=0;
- argv[--i]=Output;
- }
- if (version)
- {
- printf("%s %s\n",LUA_RELEASE,LUA_COPYRIGHT);
- if (version==argc-1) exit(EXIT_SUCCESS);
- }
- return i;
+ int i;
+ int version = 0;
+ if (argv[0] != NULL && *argv[0] != 0)
+ progname = argv[0];
+ for (i = 1; i < argc; i++) {
+ if (*argv[i] != '-') /* end of options; keep it */
+ break;
+ else if (IS("--")) { /* end of options; skip it */
+ ++i;
+ if (version)
+ ++version;
+ break;
+ } else if (IS("-")) /* end of options; use stdin */
+ break;
+ else if (IS("-o")) { /* output file */
+ output = argv[++i];
+ if (output == NULL || *output == 0)
+ usage(LUA_QL("-o") " needs argument");
+ if (IS("-"))
+ output = NULL;
+ } else if (IS("-p")) /* parse only */
+ dumping = 0;
+ else if (IS("-s")) /* strip debug information */
+ stripping = 1;
+ else if (IS("-v")) /* show version */
+ ++version;
+ else if (IS("--luaconly")) /* ignore */
+ ;
+ else if (IS("--luac")) /* ignore */
+ ;
+ else /* unknown option */
+ usage(argv[i]);
+ }
+ if (i == argc && (!dumping)) {
+ dumping = 0;
+ argv[--i] = Output;
+ }
+ if (version) {
+ printf("%s %s\n", LUA_RELEASE, LUA_COPYRIGHT);
+ if (version == argc - 1)
+ exit(EXIT_SUCCESS);
+ }
+ return i;
}
#define toproto(L,i) (clvalue(L->top+(i))->l.p)
-static const Proto* combine(lua_State* L, int n)
+static const Proto *combine(lua_State * L, int n)
{
- if (n==1)
- return toproto(L,-1);
- else
- {
- int i,pc;
- Proto* f=luaF_newproto(L);
- setptvalue2s(L,L->top,f); incr_top(L);
- f->source=luaS_newliteral(L,"=(" PROGNAME ")");
- f->maxstacksize=1;
- pc=2*n+1;
- f->code=luaM_newvector(L,pc,Instruction);
- f->sizecode=pc;
- f->p=luaM_newvector(L,n,Proto*);
- f->sizep=n;
- pc=0;
- for (i=0; i<n; i++)
- {
- f->p[i]=toproto(L,i-n-1);
- f->code[pc++]=CREATE_ABx(OP_CLOSURE,0,i);
- f->code[pc++]=CREATE_ABC(OP_CALL,0,1,1);
- }
- f->code[pc++]=CREATE_ABC(OP_RETURN,0,1,0);
- return f;
- }
+ if (n == 1)
+ return toproto(L, -1);
+ else {
+ int i, pc;
+ Proto *f = luaF_newproto(L);
+ setptvalue2s(L, L->top, f);
+ incr_top(L);
+ f->source = luaS_newliteral(L, "=(" PROGNAME ")");
+ f->maxstacksize = 1;
+ pc = 2 * n + 1;
+ f->code = luaM_newvector(L, pc, Instruction);
+ f->sizecode = pc;
+ f->p = luaM_newvector(L, n, Proto *);
+ f->sizep = n;
+ pc = 0;
+ for (i = 0; i < n; i++) {
+ f->p[i] = toproto(L, i - n - 1);
+ f->code[pc++] = CREATE_ABx(OP_CLOSURE, 0, i);
+ f->code[pc++] = CREATE_ABC(OP_CALL, 0, 1, 1);
+ }
+ f->code[pc++] = CREATE_ABC(OP_RETURN, 0, 1, 0);
+ return f;
+ }
}
-static int writer(lua_State* L, const void* p, size_t size, void* u)
+static int writer(lua_State * L, const void *p, size_t size, void *u)
{
- UNUSED(L);
- return (fwrite(p,size,1,(FILE*)u)!=1) && (size!=0);
+ UNUSED(L);
+ return (fwrite(p, size, 1, (FILE *) u) != 1) && (size != 0);
}
struct Smain {
- int argc;
- char** argv;
+ int argc;
+ char **argv;
};
-static int pmain(lua_State* L)
+static int pmain(lua_State * L)
{
- struct Smain* s = (struct Smain*)lua_touserdata(L, 1);
- int argc=s->argc;
- char** argv=s->argv;
- const Proto* f;
- int i;
- if (!lua_checkstack(L,argc)) fatal("too many input files");
- for (i=0; i<argc; i++)
- {
- const char* filename=IS("-") ? NULL : argv[i];
- if (luaL_loadfile(L,filename)!=0) fatal(lua_tostring(L,-1));
- }
- f=combine(L,argc);
- if (dumping)
- {
- FILE* D= (output==NULL) ? stdout : fopen(output,"wb");
- if (D==NULL) cannot("open");
- lua_lock(L);
- luaU_dump(L,f,writer,D,stripping);
- lua_unlock(L);
- if (ferror(D)) cannot("write");
- if (fclose(D)) cannot("close");
- }
- return 0;
+ struct Smain *s = (struct Smain *) lua_touserdata(L, 1);
+ int argc = s->argc;
+ char **argv = s->argv;
+ const Proto *f;
+ int i;
+ if (!lua_checkstack(L, argc))
+ fatal("too many input files");
+ for (i = 0; i < argc; i++) {
+ const char *filename = IS("-") ? NULL : argv[i];
+ if (luaL_loadfile(L, filename) != 0)
+ fatal(lua_tostring(L, -1));
+ }
+ f = combine(L, argc);
+ if (dumping) {
+ FILE *D = (output == NULL) ? stdout : fopen(output, "wb");
+ if (D == NULL)
+ cannot("open");
+ lua_lock(L);
+ luaU_dump(L, f, writer, D, stripping);
+ lua_unlock(L);
+ if (ferror(D))
+ cannot("write");
+ if (fclose(D))
+ cannot("close");
+ }
+ return 0;
}
-int luac_main(int argc, char* argv[])
+int luac_main(int argc, char *argv[])
{
- lua_State* L;
- struct Smain s;
- int i=doargs(argc,argv);
- argc-=i; argv+=i;
- if (argc<=0) usage("no input files given");
- L=lua_open();
- if (L==NULL) fatal("not enough memory for state");
- s.argc=argc;
- s.argv=argv;
- if (lua_cpcall(L,pmain,&s)!=0) fatal(lua_tostring(L,-1));
- lua_close(L);
- return EXIT_SUCCESS;
+ lua_State *L;
+ struct Smain s;
+ int i = doargs(argc, argv);
+ argc -= i;
+ argv += i;
+ if (argc <= 0)
+ usage("no input files given");
+ L = lua_open();
+ if (L == NULL)
+ fatal("not enough memory for state");
+ s.argc = argc;
+ s.argv = argv;
+ if (lua_cpcall(L, pmain, &s) != 0)
+ fatal(lua_tostring(L, -1));
+ lua_close(L);
+ return EXIT_SUCCESS;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua51/Makefile b/Build/source/texk/web2c/luatexdir/lua51/Makefile
index ad1c47b73e1..55bdc11178f 100644
--- a/Build/source/texk/web2c/luatexdir/lua51/Makefile
+++ b/Build/source/texk/web2c/luatexdir/lua51/Makefile
@@ -7,8 +7,7 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc
-CFLAGS= -g -O2 -Wall $(XCFLAGS) $(MYCFLAGS) $(COCOFLAGS)
+LOCALCFLAGS= $(MYCFLAGS) $(COCOCFLAGS)
AR= ar rcu
RANLIB= ranlib
RM= rm -f
@@ -77,12 +76,14 @@ clean:
$(RM) $(ALL_T) $(ALL_O)
depend:
- @$(CC) $(CFLAGS) -MM l*.c print.c
+ @$(CC) $(LOCALCFLAGS) $(CFLAGS) $(XCFLAGS) -MM l*.c print.c
echo:
@echo "PLAT = $(PLAT)"
@echo "CC = $(CC)"
+ @echo "LOCALCFLAGS = $(LOCALCFLAGS)"
@echo "CFLAGS = $(CFLAGS)"
+ @echo "XCFLAGS = $(XCFLAGS)"
@echo "AR = $(AR)"
@echo "RANLIB = $(RANLIB)"
@echo "RM = $(RM)"
@@ -96,7 +97,7 @@ none:
@echo "Please choose a platform: $(PLATS)"
aix:
- $(MAKE) a CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
+ $(MAKE) a CC="xlc" LOCALCFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
ansi:
$(MAKE) a MYCFLAGS=-DLUA_ANSI
@@ -131,6 +132,10 @@ posix:
solaris:
$(MAKE) a MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
+.c.o:
+ $(CC) $(LOCALCFLAGS) $(CFLAGS) $(XCFLAGS) -c $<
+
+
# list targets that do not create files (but not all makes understand .PHONY)
.PHONY: all $(PLATS) default o a clean depend echo none
diff --git a/Build/source/texk/web2c/luatexdir/lua51/lcoco.c b/Build/source/texk/web2c/luatexdir/lua51/lcoco.c
index 87b8c6ce503..f7a4b86c5bc 100644
--- a/Build/source/texk/web2c/luatexdir/lua51/lcoco.c
+++ b/Build/source/texk/web2c/luatexdir/lua51/lcoco.c
@@ -24,6 +24,16 @@
*/
/* Coco -- True C coroutines for Lua. http://luajit.org/coco.html */
+
+#if defined(__OpenBSD__)
+#if defined(__i386) || defined(__i386__)
+#else
+#undef COCO_DISABLE
+#define COCO_DISABLE
+# warning COCO: not supported on this platform (non-intel OpenBSD)
+#endif
+#endif
+
#ifndef COCO_DISABLE
#define lcoco_c
diff --git a/Build/source/texk/web2c/luatexdir/lua51/lcoco.h b/Build/source/texk/web2c/luatexdir/lua51/lcoco.h
index 96858d75ca5..6e87a8d3c19 100644
--- a/Build/source/texk/web2c/luatexdir/lua51/lcoco.h
+++ b/Build/source/texk/web2c/luatexdir/lua51/lcoco.h
@@ -3,6 +3,16 @@
** Copyright (C) 2004-2007 Mike Pall. See copyright notice in lcoco.c
*/
+#if defined(__OpenBSD__)
+#if defined(__i386) || defined(__i386__)
+#else
+#undef COCO_DISABLE
+#define COCO_DISABLE
+#define lcoco_h
+#endif
+#endif
+
+
#ifndef lcoco_h
#define lcoco_h
diff --git a/Build/source/texk/web2c/luatexdir/lua51/liolib.c b/Build/source/texk/web2c/luatexdir/lua51/liolib.c
index f86e436ff2a..b98fd9a0448 100644
--- a/Build/source/texk/web2c/luatexdir/lua51/liolib.c
+++ b/Build/source/texk/web2c/luatexdir/lua51/liolib.c
@@ -155,9 +155,9 @@ static int io_open (lua_State *L) {
}
static int io_open_ro (lua_State *L) {
+ FILE **pf;
const char *filename = luaL_checkstring(L, 1);
const char *mode = luaL_optstring(L, 2, "r");
- FILE **pf;
if ((strcmp(mode,"r")!= 0)&&(strcmp(mode,"rb")!=0))
return pushresult(L, 0, filename);
pf = newfile(L);
@@ -354,6 +354,31 @@ static int read_chars (lua_State *L, FILE *f, size_t n) {
return (n == 0 || lua_strlen(L, -1) > 0);
}
+static int read_all (lua_State *L, FILE *f) {
+ /* attempt to speed up reading whole files */
+ size_t rlen; /* how much to read */
+ size_t nr; /* number of chars actually read */
+ size_t old; /* old file location */
+ char *p;
+ old = ftell(f);
+ if(old > 0 &&
+ (fseek(f,0,SEEK_END)>=0) &&
+ ((rlen = ftell(f)) >0 ) &&
+ rlen < 1000*1000*100 ) { /* 100 MB */
+ fseek(f,old,SEEK_SET);
+ p = malloc(rlen);
+ if (p != NULL) {
+ nr = fread(p, sizeof(char), rlen, f);
+ lua_pushlstring(L,p,nr);
+ free(p);
+ return 1;
+ }
+ }
+ if (old>0)
+ fseek(f,old,SEEK_SET);
+ return read_chars(L,f, ~((size_t)0));
+}
+
static int g_read (lua_State *L, FILE *f, int first) {
int nargs = lua_gettop(L) - 1;
@@ -383,7 +408,7 @@ static int g_read (lua_State *L, FILE *f, int first) {
success = new_read_line(L, f);
break;
case 'a': /* file */
- read_chars(L, f, ~((size_t)0)); /* read MAX_SIZE_T chars */
+ read_all(L, f);
success = 1; /* always success */
break;
default:
diff --git a/Build/source/texk/web2c/luatexdir/lua51/lobject.c b/Build/source/texk/web2c/luatexdir/lua51/lobject.c
index acde82ccdf1..9fb81f637b2 100644
--- a/Build/source/texk/web2c/luatexdir/lua51/lobject.c
+++ b/Build/source/texk/web2c/luatexdir/lua51/lobject.c
@@ -197,18 +197,18 @@ void luaO_chunkid (char *out, const char *source, size_t bufflen) {
}
strcat(out, source);
}
- else { /* out = [string "string"] */
+ else { /* out = <string> */
size_t len = strcspn(source, "\n\r"); /* stop at first newline */
- bufflen -= sizeof(" [string \"...\"] ");
+ bufflen -= sizeof(" <...> ");
if (len > bufflen) len = bufflen;
- strcpy(out, "[string \"");
+ strcpy(out, "<");
if (source[len] != '\0') { /* must truncate? */
strncat(out, source, len);
strcat(out, "...");
}
else
strcat(out, source);
- strcat(out, "\"]");
+ strcat(out, ">");
}
}
}
diff --git a/Build/source/texk/web2c/luatexdir/lua51/lstrlib.c b/Build/source/texk/web2c/luatexdir/lua51/lstrlib.c
index 38c6b45c8da..51a2e09e034 100644
--- a/Build/source/texk/web2c/luatexdir/lua51/lstrlib.c
+++ b/Build/source/texk/web2c/luatexdir/lua51/lstrlib.c
@@ -584,8 +584,8 @@ static int characters_aux (lua_State *L) {
size_t ls;
char b[2];
const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
- int ind = lua_tointeger(L, lua_upvalueindex(2));
- if (ind<ls) {
+ int ind = lua_tointeger(L, lua_upvalueindex(2));
+ if (ind<(int)ls) {
lua_pushinteger(L, (ind+1)); /* iterator */
lua_replace(L, lua_upvalueindex(2));
b[0] = *(s+ind); b[1] = 0;
@@ -621,12 +621,12 @@ static int utfcharacters_aux (lua_State *L) {
int j;
const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
int ind = lua_tointeger(L, lua_upvalueindex(2));
- if (ind>=ls) return 0; /* end of string */
+ if (ind>=(int)ls) return 0; /* end of string */
c = (unsigned) s[ind];
for (j=0;j<4;j++) {
if ((c&mask[j])==mequ[j]) {
int k;
- if (ind+1+j>ls) return utf_failed(L,ls); /* will not fit */
+ if (ind+1+j>(int)ls) return utf_failed(L,ls); /* will not fit */
for (k=1; k<=j; k++) {
c = (unsigned) s[ind+k];
if ((c&0xC0)!=0x80) return utf_failed(L,ind+k); /* bad follow */
@@ -661,12 +661,12 @@ static int utfvalues_aux (lua_State *L) {
const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
int ind = lua_tointeger(L, lua_upvalueindex(2));
- if (ind<ls) {
+ if (ind<(int)ls) {
i = *(s+ind);
if (i<0x80) {
v = i;
} else if (i>=0xF0) {
- if ((ind+3)<ls && ((unsigned)*(s+ind+1))>=0x80
+ if ((ind+3)<(int)ls && ((unsigned)*(s+ind+1))>=0x80
&& ((unsigned)*(s+ind+2))>=0x80 && ((unsigned)*(s+ind+3))>=0x80) {
numbytes = 4;
j = ((unsigned)*(s+ind+1))-128;
@@ -675,7 +675,7 @@ static int utfvalues_aux (lua_State *L) {
v = (((((i-0xF0)*64) + j)*64) + k)*64 + l;
}
} else if (i>=0xE0) {
- if ((ind+2)<ls && ((unsigned)*(s+ind+1))>=0x80 && ((unsigned)*(s+ind+2))>=0x80) {
+ if ((ind+2)<(int)ls && ((unsigned)*(s+ind+1))>=0x80 && ((unsigned)*(s+ind+2))>=0x80) {
numbytes = 3;
j = ((unsigned)*(s+ind+1))-128;
k = ((unsigned)*(s+ind+2))-128;
@@ -683,7 +683,7 @@ static int utfvalues_aux (lua_State *L) {
}
} else if (i>=0xC0) {
- if ((ind+1)<ls && ((unsigned)*(s+ind+1))>=0x80) {
+ if ((ind+1)<(int)ls && ((unsigned)*(s+ind+1))>=0x80) {
numbytes = 2;
j = ((unsigned)*(s+ind+1))-128;
v = ((i-0xC0)*64) + j;
@@ -713,8 +713,8 @@ static int characterpairs_aux (lua_State *L) {
char b[2];
const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
int ind = lua_tointeger(L, lua_upvalueindex(2));
- if (ind<ls) {
- if (ind+1<ls) {
+ if (ind<(int)ls) {
+ if (ind+1<(int)ls) {
lua_pushinteger(L, (ind+2)); /* iterator */
} else {
lua_pushinteger(L, (ind+1)); /* iterator */
@@ -722,7 +722,7 @@ static int characterpairs_aux (lua_State *L) {
lua_replace(L, lua_upvalueindex(2));
b[0] = *(s+ind); b[1] = 0;
lua_pushlstring(L, b, 1);
- if (ind+1<ls) {
+ if (ind+1<(int)ls) {
b[0] = *(s+ind+1);
lua_pushlstring(L, b, 1);
} else {
@@ -747,7 +747,7 @@ static int bytes_aux (lua_State *L) {
unsigned char i;
const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
int ind = lua_tointeger(L, lua_upvalueindex(2));
- if (ind<ls) {
+ if (ind<(int)ls) {
lua_pushinteger(L, (ind+1)); /* iterator */
lua_replace(L, lua_upvalueindex(2));
i = (unsigned char)*(s+ind);
@@ -770,8 +770,8 @@ static int bytepairs_aux (lua_State *L) {
unsigned char i;
const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);
int ind = lua_tointeger(L, lua_upvalueindex(2));
- if (ind<ls) {
- if (ind+1<ls) {
+ if (ind<(int)ls) {
+ if (ind+1<(int)ls) {
lua_pushinteger(L, (ind+2)); /* iterator */
} else {
lua_pushinteger(L, (ind+1)); /* iterator */
@@ -779,7 +779,7 @@ static int bytepairs_aux (lua_State *L) {
lua_replace(L, lua_upvalueindex(2));
i = (unsigned char)*(s+ind);
lua_pushinteger(L, i); /* byte one */
- if (ind+1<ls) {
+ if (ind+1<(int)ls) {
i = (unsigned char)*(s+ind+1);
lua_pushinteger(L, i); /* byte two */
} else {
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/Makefile b/Build/source/texk/web2c/luatexdir/luafilesystem/Makefile
index 35e7b3e9d54..10d9ca44c2c 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/Makefile
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/Makefile
@@ -1,28 +1,22 @@
-# $Id: Makefile,v 1.26 2005/06/27 17:06:01 tomas Exp $
-
-T= lfs
-V= 1.2
-CONFIG= ./config
-
-include $(CONFIG)
-
-COMPAT_O= $(COMPAT_DIR)/compat-5.1.o
-SRCS= src/$T.c
-OBJS= src/$T.o $(COMPAT_O)
-
-
-lib: src/$(LIBNAME)
-
-src/$(LIBNAME): $(OBJS)
- export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS)
-
-$(COMPAT_O): $(COMPAT_DIR)/compat-5.1.c
- $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
-
-install: src/$(LIBNAME)
- mkdir -p $(LUA_LIBDIR)
- cp src/$(LIBNAME) $(LUA_LIBDIR)
- cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
-
-clean:
- rm -f src/$(LIBNAME) $(OBJS) $(COMPAT_O)
+# $Id: Makefile,v 1.34 2008/05/07 19:06:37 carregal Exp $
+
+T= lfs
+
+CONFIG= ./config
+
+include $(CONFIG)
+
+SRCS= src/$T.c
+OBJS= src/$T.o
+
+lib: src/lfs.so
+
+src/lfs.so: $(OBJS)
+ export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/lfs.so $(OBJS)
+
+install:
+ mkdir -p $(LUA_LIBDIR)
+ cp src/lfs.so $(LUA_LIBDIR)
+
+clean:
+ rm -f src/lfs.so $(OBJS)
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/Makefile.win b/Build/source/texk/web2c/luatexdir/luafilesystem/Makefile.win
new file mode 100644
index 00000000000..65cab812408
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/Makefile.win
@@ -0,0 +1,25 @@
+# $Id: Makefile.win,v 1.11 2008/05/07 19:06:37 carregal Exp $
+
+T= lfs
+
+include config.win
+
+SRCS= src\$T.c
+OBJS= src\$T.obj
+
+lib: src\lfs.dll
+
+.c.obj:
+ $(CC) /c /Fo$@ $(CFLAGS) $<
+
+src\lfs.dll: $(OBJS)
+ link /dll /def:src\$T.def /out:src\lfs.dll $(OBJS) "$(LUA_LIB)"
+ IF EXIST src\lfs.dll.manifest mt -manifest src\lfs.dll.manifest -outputresource:src\lfs.dll;2
+
+install: src\lfs.dll
+ IF NOT EXIST "$(LUA_LIBDIR)" mkdir "$(LUA_LIBDIR)"
+ copy src\lfs.dll "$(LUA_LIBDIR)"
+
+clean:
+ del src\lfs.dll $(OBJS) src\$T.lib src\$T.exp
+ IF EXIST src\lfs.dll.manifest del src\lfs.dll.manifest \ No newline at end of file
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/README b/Build/source/texk/web2c/luatexdir/luafilesystem/README
new file mode 100644
index 00000000000..858ecb67bb0
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/README
@@ -0,0 +1,38 @@
+LuaFileSystem - File System Library for Lua
+Copyright 2003 Kepler Project
+http://www.keplerproject.org/luafilesystem
+
+Description
+-----------
+LuaFileSystem is a Lua library developed to complement the set of functions
+related to file systems offered by the standard Lua distribution.
+
+LuaFileSystem offers a portable way to access the underlying directory structure and file attributes.
+LuaFileSystem is free software and uses the same license as Lua 5.1
+
+Version 1.4.1 [07/May/2008] changes:
+ * documentation review
+ * fixed Windows compilation issues
+ * fixed bug in the Windows tests (patch by Shmuel Zeigerman)
+ * fixed bug [#2185] lfs.attributes(filename, 'size') overflow on files > 2 Gb
+
+LuaRocks Installation
+---------------------
+luarocks install luafilesystem
+
+Unix Installation
+-----------------
+To install on Linux/OSX/BSD, please edit the config file and then call
+
+make
+make install
+
+The last step may require root privileges.
+
+Windows Installation
+--------------------
+To install on Windows, please copy lfs.dll to your package.cpath directory
+
+Documentation
+-------------
+Please check the documentation at /doc/us/ for more information.
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/config b/Build/source/texk/web2c/luatexdir/luafilesystem/config
index d27284333ea..cfd4c6a6d3e 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/config
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/config
@@ -1,20 +1,24 @@
-# Installation directories
-# System's libraries directory (where binary libraries are installed)
-LUA_LIBDIR= /usr/local/lib/lua/5.0
-# Lua includes directory
-LUA_INC= /usr/local/include
-
-# OS dependent
-LIB_OPTION= -shared #for Linux
-#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X
-
-LIBNAME= $T.so.$V
-COMPAT_DIR= ../compat/src
-
-# Compilation directives
-WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings
-INCS= -I$(LUA_INC) -I$(COMPAT_DIR)
-CFLAGS= $(WARN) $(INCS)
-CC= gcc
-
-# $Id: config,v 1.14 2005/06/24 01:49:16 tomas Exp $
+# Installation directories
+
+# Default installation prefix
+PREFIX=/usr/local
+
+# System's libraries directory (where binary libraries are installed)
+LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
+
+# Lua includes directory
+LUA_INC= $(PREFIX)/include
+
+# OS dependent
+LIB_OPTION= -shared #for Linux
+#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X
+
+LIBNAME= $T.so.$V
+
+# Compilation directives
+WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
+INCS= -I$(LUA_INC)
+CFLAGS= $(WARN) $(INCS)
+CC= gcc
+
+# $Id: config,v 1.21 2007/10/27 22:42:32 carregal Exp $
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/config.win b/Build/source/texk/web2c/luatexdir/luafilesystem/config.win
new file mode 100644
index 00000000000..50e81f64206
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/config.win
@@ -0,0 +1,19 @@
+# Installation directories
+# System's libraries directory (where binary libraries are installed)
+LUA_LIBDIR= "c:\lua5.1"
+
+# Lua includes directory
+LUA_INC= "c:\lua5.1\include"
+
+# Lua library
+LUA_LIB= "c:\lua5.1\lua5.1.lib"
+
+LIBNAME= $T.dll
+
+# Compilation directives
+WARN= /O2
+INCS= /I$(LUA_INC)
+CFLAGS= /MD $(WARN) $(INCS)
+CC= cl
+
+# $Id: config.win,v 1.7 2008/03/25 17:39:29 mascarenhas Exp $
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html
index 89f70707287..746df62b4e5 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/examples.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>LuaFileSystem</title>
<link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/>
@@ -39,6 +39,7 @@
<li><a href="manual.html">Manual</a>
<ul>
<li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
<li><a href="manual.html#installation">Installation</a></li>
<li><a href="manual.html#reference">Reference</a></li>
</ul>
@@ -92,9 +93,8 @@ attrdir (".")
</div> <!-- id="main" -->
<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer">
- <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
- <p><small>$Id: examples.html,v 1.5 2006/03/14 14:07:55 carregal Exp $</small></p>
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: examples.html,v 1.8 2007/12/14 15:28:04 carregal Exp $</small></p>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html
index 15c954a1fc8..63b57915e9d 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/index.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>LuaFileSystem</title>
<link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/>
@@ -39,6 +39,7 @@
<li><a href="manual.html">Manual</a>
<ul>
<li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
<li><a href="manual.html#installation">Installation</a></li>
<li><a href="manual.html#reference">Reference</a></li>
</ul>
@@ -66,46 +67,77 @@ systems offered by the standard Lua distribution.</p>
the underlying directory structure and file attributes.</p>
<p>LuaFileSystem is free software and uses the same
-<a href="license.html">license</a> as Lua 5.0.</p>
+<a href="license.html">license</a> as Lua 5.1.</p>
<h2><a name="status"></a>Status</h2>
-<p>Current version is 1.2. It was developed for Lua 5.0.</p>
-
-<p>Version 1.2 follows the
-<a href="http://www.keplerproject.org/compat">package model</a>
-for Lua 5.1 (see section <a href="manual.html#installation">Installation</a>
-for more details).</p>
-
+<p>Current version is 1.4.1. It was developed for Lua 5.1.</p>
<h2><a name="download"></a>Download</h2>
<p>LuaFileSystem source can be downloaded from its
<a href="http://luaforge.net/projects/luafilesystem/files">Lua Forge</a>
page. If you are using
-<a href="http://luabinaries.luaforge.net">LuaBinaries</a> Release 2
-a Windows binary version of LuaFileSystem can also be found at the
-LuaForge page.</p>
-
+<a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.3 a Windows binary
+version of LuaFileSystem (compiled with Visual Studio 2005 Express) can be found at the same LuaForge page.</p>
<h2><a name="history"></a>History</h2>
<dl class="history">
- <dt><strong>Version 1.2</strong> [15/Mar/2006]</dt>
+ <dt><strong>Version 1.4.1</strong> [07/May/2008]</dt>
+ <dd>
+ <ul>
+ <li>documentation review</li>
+ <li>fixed Windows compilation issues</li>
+ <li>fixed bug in the Windows tests (patch by Shmuel Zeigerman)</li>
+ <li>fixed bug [<a href="http://luaforge.net/tracker/?func=detail&amp;group_id=66&amp;aid=2185&amp;atid=356">#2185</a>]
+ <code>lfs.attributes(filename, 'size')</code> overflow on files > 2 Gb
+ </li>
+ </ul>
+ </dd>
+
+ <dt><strong>Version 1.4.0</strong> [13/Feb/2008]</dt>
+ <dd>
+ <ul>
+ <li>added function
+ <a href="manual.html#setmode"><code>lfs.setmode</code></a>
+ (works only in Windows systems).</li>
+ <li><a href="manual.html#attributes"><code>lfs.attributes</code></a>
+ raises an error if attribute does not exist</li>
+ </ul>
+ </dd>
+
+ <dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.3/">Version 1.3.0</a></strong> [26/Oct/2007]</dt>
+ <dd>
+ <ul>
+ <li>added function
+ <a href="manual.html#symlinkattributes"><code>lfs.symlinkattributes</code></a>
+ (works only in non Windows systems).</li>
+ </ul>
+ </dd>
+
+ <dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.2/">Version 1.2.1</a></strong> [08/May/2007]</dt>
+ <dd>
+ <ul>
+ <li>compatible only with Lua 5.1 (Lua 5.0 support was dropped)</li>
+ </ul>
+ </dd>
+
+ <dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.2/">Version 1.2</a></strong> [15/Mar/2006]</dt>
<dd>
<ul>
<li>added optional argument to
<a href="manual.html#attributes"><code>lfs.attributes</code></a></li>
<li>added function
<a href="manual.html#rmdir"><code>lfs.rmdir</code></a></li>
- <li>bug correction on <code>lfs.dir</code></li>
+ <li>bug correction on <a href="manual.html#dir"><code>lfs.dir</code></a></li>
</ul>
</dd>
<dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.1/">Version 1.1</a></strong> [30/May/2005]</dt>
<dd>
<ul>
- <li>added function <code>lfs.touch</code>.</li>
+ <li>added function <a href="manual.html#touch"><code>lfs.touch</code></a>.</li>
</ul>
</dd>
@@ -137,9 +169,8 @@ Comments are welcome!</p>
</div> <!-- id="main" -->
<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer">
- <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
- <p><small>$Id: index.html,v 1.30 2006/03/15 16:44:04 carregal Exp $</small></p>
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: index.html,v 1.42 2008/05/07 19:06:37 carregal Exp $</small></p>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html
index 6bb4aaa0028..4ecad4bd7bb 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/license.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>LuaFileSystem</title>
<link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/>
@@ -39,6 +39,7 @@
<li><a href="manual.html">Manual</a>
<ul>
<li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
<li><a href="manual.html#installation">Installation</a></li>
<li><a href="manual.html#reference">Reference</a></li>
</ul>
@@ -84,7 +85,7 @@ Ierusalimschy, Andr&eacute; Carregal and Tom&aacute;s Guisasola.
The implementation is not derived from licensed software.</p>
<hr/>
-<p>Copyright &copy; 2004-2006 The Kepler Project.</p>
+<p>Copyright &copy; 2003 Kepler Project.</p>
<p>Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -111,9 +112,8 @@ SOFTWARE.</p>
</div> <!-- id="main" -->
<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer">
- <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
- <p><small>$Id: license.html,v 1.9 2006/03/14 14:07:55 carregal Exp $</small></p>
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: license.html,v 1.13 2008/02/11 22:42:21 carregal Exp $</small></p>
</div><!-- id="about" -->
</div><!-- id="container" -->
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html
index 281c06ea407..efae2363359 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/doc/us/manual.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>LuaFileSystem</title>
<link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/>
@@ -37,6 +37,7 @@
<li><strong>Manual</strong>
<ul>
<li><a href="manual.html#introduction">Introduction</a></li>
+ <li><a href="manual.html#building">Building</a></li>
<li><a href="manual.html#installation">Installation</a></li>
<li><a href="manual.html#reference">Reference</a></li>
</ul>
@@ -63,20 +64,32 @@ systems offered by the standard Lua distribution.</p>
<p>LuaFileSystem offers a portable way to access
the underlying directory structure and file attributes.</p>
+<h2><a name="building"></a>Building</h2>
+
+<p>
+LuaFileSystem should be built with Lua 5.1 so the language library
+and header files for the target version must be installed properly.
+</p>
+
+<p>
+LuaFileSystem offers a Makefile and a separate configuration file,
+<code>config</code>,
+which should be edited to suit your installation before running
+<code>make</code>.
+The file has some definitions like paths to the external libraries,
+compiler options and the like.
+</p>
+
<h2><a name="installation"></a>Installation</h2>
-<p>LuaFileSystem follows the
-<a href="http://www.keplerproject.org/compat/">package model</a>
-for Lua 5.1, therefore it should be "installed". Refer to
-<a href="http://www.keplerproject.org/compat/manual.html#configuration">
-Compat-5.1 configuration</a> section about how to install the compiled
-binary properly.
-The compiled binary should be copied to a directory in your
-<code>LUA_CPATH</code>.</p>
+<p>The easiest way to install LuaFileSystem is to use LuaRocks:</p>
+
+<pre class="example">
+luarocks install luafilesystem
+</pre>
-<p>Windows users can use the binary version of LuaFileSystem
-(<code>lfs.dll</code>) available at
-<a href="http://luaforge.net/projects/luafilesystem/files">LuaForge</a>.</p>
+<p>If you prefer to install LuaFileSystem manually, the compiled binary should be copied to a directory in your
+<a href="http://www.lua.org/manual/5.1/manual.html#pdf-package.cpath">C path</a>.</p>
<h2><a name="reference"></a>Reference</h2>
@@ -96,7 +109,7 @@ LuaFileSystem offers the following functions:
The attributes are described as follows;
attribute <code>mode</code> is a string, all the others are numbers,
and the time related attributes use the same time reference of
- <a href="http://www.lua.org/manual/5.0/manual.html#5.7"><code>os.time</code></a>:
+ <a href="http://www.lua.org/manual/5.1/manual.html#pdf-os.time"><code>os.time</code></a>:
<dl>
<dt><strong><code>dev</code></strong></dt>
<dd>on Unix systems, this represents the device that the inode resides on. On Windows systems,
@@ -142,6 +155,12 @@ LuaFileSystem offers the following functions:
<dt><strong><code>blksize</code></strong></dt>
<dd>optimal file system I/O blocksize; (Unix only)</dd>
</dl>
+ This function uses <code>stat</code> internally thus if the given
+ <code>filepath</code> is a symbolic link, it is followed (if it points to
+ another link the chain is followed recursively) and the information
+ is about the file it refers to.
+ To obtain information about the link itself, see function
+ <a href="#symlinkattributes">lfs.symlinkattributes</a>.
</dd>
<dt><a name="chdir"></a><strong><code>lfs.chdir (path)</code></strong></dt>
@@ -157,8 +176,8 @@ LuaFileSystem offers the following functions:
<dt><a name="dir"></a><strong><code>lfs.dir (path)</code></strong></dt>
<dd>
Lua iterator over the entries of a given directory.
- Each time the iterator is called it returns a string with an entry of the
- directory; <code>nil</code> is returned when there is no more entries.
+ Each time the iterator is called it returns a directory entry's name as a string, or
+ <code>nil</code> if there are no more entries.
Raises an error if <code>path</code> is not a directory.
</dd>
@@ -185,14 +204,27 @@ LuaFileSystem offers the following functions:
<dd>Removes an existing directory. The argument is the name of the directory.<br />
Returns <code>true</code> if the operation was successful;
in case of error, it returns <code>nil</code> plus an error string.</dd>
+
+ <dt><a name="setmode"></a><strong><code>lfs.setmode (file, mode)</code></strong></dt>
+ <dd>Sets the writing mode for a file. The mode string can be either <code>binary</code> or <code>text</code>.
+ Returns the previous mode string for the file. This function is only available in Windows, so you may want to make sure that
+ <code>lfs.setmode</code> exists before using it.
+ </dd>
+ <dt><a name="symlinkattributes"></a><strong><code>lfs.symlinkattributes (filepath [, aname])</code></strong></dt>
+ <dd>Identical to <a href="#attributes">lfs.attributes</a> except that
+ it obtains information about the link itself (not the file it refers to).
+ This function is not available in Windows so you may want to make sure that
+ <code>lfs.symlinkattributes</code> exists before using it.
+ </dd>
+
<dt><a name="touch"></a><strong><code>lfs.touch (filepath [, atime [, mtime]])</code></strong></dt>
<dd>Set access and modification times of a file. This function is
a bind to <code>utime</code> function. The first argument is the
filename, the second argument (<code>atime</code>) is the access time,
and the third argument (<code>mtime</code>) is the modification time.
Both times are provided in seconds (which should be generated with
- Lua standard function <code>os.date</code>).
+ Lua standard function <code>os.time</code>).
If the modification time is omitted, the access time provided is used;
if both times are omitted, the current time is used.<br />
Returns <code>true</code> if the operation was successful;
@@ -215,9 +247,8 @@ LuaFileSystem offers the following functions:
</div> <!-- id="main" -->
<div id="about">
- <p><a href="http://validator.w3.org/check?uri=referer">
- <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
- <p><small>$Id: manual.html,v 1.30.2.1 2006/03/15 20:30:53 carregal Exp $</small></p>
+ <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
+ <p><small>$Id: manual.html,v 1.42 2008/03/24 18:17:59 carregal Exp $</small></p>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c
index eea8bfaca83..ea9aea6f69c 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c
@@ -1,6 +1,6 @@
/*
** LuaFileSystem
-** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/luafilesystem)
+** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
**
** File system manipulation library.
** This library offers these functions:
@@ -11,15 +11,20 @@
** lfs.lock (fh, mode)
** lfs.mkdir (path)
** lfs.rmdir (path)
+** lfs.setmode (filepath, mode)
+** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts
** lfs.touch (filepath [, atime [, mtime]])
** lfs.unlock (fh)
**
-** $Id: lfs.c,v 1.32 2006/03/14 13:39:38 tomas Exp $
+** $Id: lfs.c,v 1.53 2008/05/07 19:06:37 carregal Exp $
*/
+#define _LARGEFILE64_SOURCE
+
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <time.h>
#include <sys/stat.h>
@@ -28,6 +33,7 @@
#include <io.h>
#include <sys/locking.h>
#include <sys/utime.h>
+#include <fcntl.h>
#else
#include <unistd.h>
#include <dirent.h>
@@ -39,8 +45,6 @@
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
-/* #include "compat-5.1.h"*/
-
#include "lfs.h"
/* Define 'strerror' for systems that do not implement it */
@@ -69,6 +73,26 @@ typedef struct dir_data {
} dir_data;
+#ifdef _WIN32
+#define lfs_setmode(L,file,m) ((void)L, _setmode(_fileno(file), m))
+#define STAT_STRUCT struct _stati64
+#define STAT_FUNC _stati64
+#else
+#define _O_TEXT 0
+#define _O_BINARY 0
+#define lfs_setmode(L,file,m) ((void)((void)file,m), \
+ luaL_error(L, LUA_QL("setmode") " not supported on this platform"), -1)
+#ifdef HAVE_STAT64
+#define STAT_STRUCT struct stat64
+#define STAT_FUNC stat64
+#define LSTAT_FUNC lstat64
+#else
+#define STAT_STRUCT struct stat
+#define STAT_FUNC stat
+#define LSTAT_FUNC lstat
+#endif
+#endif
+
/*
** This function changes the working (current) directory
*/
@@ -91,16 +115,17 @@ static int change_dir (lua_State *L) {
** and a string describing the error
*/
static int get_dir (lua_State *L) {
- char path[255+2];
- if (getcwd(path, 255) == NULL) {
- lua_pushnil(L);
- lua_pushstring(L, getcwd_error);
- return 2;
- }
- else {
- lua_pushstring(L, path);
- return 1;
- }
+ char *path;
+ if ((path = getcwd(NULL, 0)) == NULL) {
+ lua_pushnil(L);
+ lua_pushstring(L, getcwd_error);
+ return 2;
+ }
+ else {
+ lua_pushstring(L, path);
+ free(path);
+ return 1;
+ }
}
/*
@@ -165,6 +190,43 @@ static int _file_lock (lua_State *L, FILE *fh, const char *mode, const long star
return (code != -1);
}
+#ifdef _WIN32
+static int lfs_g_setmode (lua_State *L, FILE *f, int arg) {
+ static const int mode[] = {_O_TEXT, _O_BINARY};
+ static const char *const modenames[] = {"text", "binary", NULL};
+ int op = luaL_checkoption(L, arg, NULL, modenames);
+ int res = lfs_setmode(L, f, mode[op]);
+ if (res != -1) {
+ int i;
+ lua_pushboolean(L, 1);
+ for (i = 0; modenames[i] != NULL; i++) {
+ if (mode[i] == res) {
+ lua_pushstring(L, modenames[i]);
+ goto exit;
+ }
+ }
+ lua_pushnil(L);
+ exit:
+ return 2;
+ } else {
+ int en = errno;
+ lua_pushnil(L);
+ lua_pushfstring(L, "%s", strerror(en));
+ lua_pushinteger(L, en);
+ return 3;
+ }
+}
+#else
+static int lfs_g_setmode (lua_State *L, FILE *f, int arg) {
+ lua_pushboolean(L, 0);
+ lua_pushliteral(L, "setmode not supported on this platform");
+ return 2;
+}
+#endif
+
+static int lfs_f_setmode(lua_State *L) {
+ return lfs_g_setmode(L, check_file(L, 1, "setmode"), 2);
+}
/*
** Locks a file.
@@ -406,14 +468,13 @@ static const char *mode2string (mode_t mode) {
return "other";
}
-
-/*
+ /*
** Convert the inode protection mode to a permission list.
*/
#ifdef _WIN32
static const char *perm2string (unsigned short mode) {
- char perms[10] = "---------\0";
+ static char perms[10] = "---------\0";
if (mode & _S_IREAD)
{ perms[0] = 'r'; perms[3] = 'r'; perms[6] = 'r'; }
if (mode & _S_IWRITE)
@@ -424,7 +485,7 @@ static const char *perm2string (unsigned short mode) {
}
#else
static const char *perm2string (mode_t mode) {
- char perms[10] = "---------\0";
+ static char perms[10] = "---------\0";
if (mode & S_IRUSR) perms[0] = 'r';
if (mode & S_IWUSR) perms[1] = 'w';
if (mode & S_IXUSR) perms[2] = 'x';
@@ -438,7 +499,6 @@ static const char *perm2string (mode_t mode) {
}
#endif
-
/*
** Set access time and modification values for file
*/
@@ -464,66 +524,71 @@ static int file_utime (lua_State *L) {
/* inode protection mode */
-static void push_st_mode (lua_State *L, struct stat *info) {
+static void push_st_mode (lua_State *L, STAT_STRUCT *info) {
lua_pushstring (L, mode2string (info->st_mode));
}
/* device inode resides on */
-static void push_st_dev (lua_State *L, struct stat *info) {
+static void push_st_dev (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_dev);
}
/* inode's number */
-static void push_st_ino (lua_State *L, struct stat *info) {
+static void push_st_ino (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_ino);
}
/* number of hard links to the file */
-static void push_st_nlink (lua_State *L, struct stat *info) {
+static void push_st_nlink (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_nlink);
}
/* user-id of owner */
-static void push_st_uid (lua_State *L, struct stat *info) {
+static void push_st_uid (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_uid);
}
/* group-id of owner */
-static void push_st_gid (lua_State *L, struct stat *info) {
+static void push_st_gid (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_gid);
}
/* device type, for special file inode */
-static void push_st_rdev (lua_State *L, struct stat *info) {
+static void push_st_rdev (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_rdev);
}
/* time of last access */
-static void push_st_atime (lua_State *L, struct stat *info) {
+static void push_st_atime (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, info->st_atime);
}
/* time of last data modification */
-static void push_st_mtime (lua_State *L, struct stat *info) {
+static void push_st_mtime (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, info->st_mtime);
}
/* time of last file status change */
-static void push_st_ctime (lua_State *L, struct stat *info) {
+static void push_st_ctime (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, info->st_ctime);
}
/* file size, in bytes */
-static void push_st_size (lua_State *L, struct stat *info) {
+static void push_st_size (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_size);
}
/* permssions string */
static void push_st_perm (lua_State *L, struct stat *info) {
lua_pushstring (L, perm2string (info->st_mode));
}
-
#ifndef _WIN32
/* blocks allocated for file */
-static void push_st_blocks (lua_State *L, struct stat *info) {
+static void push_st_blocks (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_blocks);
}
/* optimal file system I/O blocksize */
-static void push_st_blksize (lua_State *L, struct stat *info) {
+static void push_st_blksize (lua_State *L, STAT_STRUCT *info) {
lua_pushnumber (L, (lua_Number)info->st_blksize);
}
#endif
+static void push_invalid (lua_State *L, STAT_STRUCT *info) {
+ luaL_error(L, "invalid attribute name");
+#ifndef _WIN32
+ info->st_blksize = 0; /* never reached */
+#endif
+}
-typedef void (*_push_function) (lua_State *L, struct stat *info);
+typedef void (*_push_function) (lua_State *L, STAT_STRUCT *info);
struct _stat_members {
const char *name;
@@ -547,18 +612,18 @@ struct _stat_members members[] = {
{ "blocks", push_st_blocks },
{ "blksize", push_st_blksize },
#endif
- { NULL, NULL }
+ { NULL, push_invalid }
};
/*
-** Get file information
+** Get file or symbolic link information
*/
-static int file_info (lua_State *L) {
+static int _file_info_ (lua_State *L, int (*st)(const char*, STAT_STRUCT*)) {
int i;
- struct stat info;
+ STAT_STRUCT info;
const char *file = luaL_checkstring (L, 1);
- if (stat(file, &info)) {
+ if (st(file, &info)) {
lua_pushnil (L);
lua_pushfstring (L, "cannot obtain information from file `%s'", file);
return 2;
@@ -568,6 +633,7 @@ static int file_info (lua_State *L) {
const char *member = lua_tostring (L, 2);
if (strcmp (member, "mode") == 0) v = 0;
#ifndef _WIN32
+ else if (strcmp (member, "blocks") == 0) v = 11;
else if (strcmp (member, "blksize") == 0) v = 12;
#endif
else /* look for member */
@@ -591,6 +657,30 @@ static int file_info (lua_State *L) {
/*
+** Get file information using stat.
+*/
+static int file_info (lua_State *L) {
+ return _file_info_ (L, STAT_FUNC);
+}
+
+
+/*
+** Get symbolic link information using lstat.
+*/
+#ifndef _WIN32
+static int link_info (lua_State *L) {
+ return _file_info_ (L, LSTAT_FUNC);
+}
+#else
+static int link_info (lua_State *L) {
+ lua_pushboolean(L, 0);
+ lua_pushliteral(L, "symlinkattributes not supported on this platform");
+ return 2;
+}
+#endif
+
+
+/*
** Get file information
*/
static int file_is_directory (lua_State *L) {
@@ -634,13 +724,13 @@ static int file_is_file (lua_State *L) {
*/
static void set_info (lua_State *L) {
lua_pushliteral (L, "_COPYRIGHT");
- lua_pushliteral (L, "Copyright (C) 2003-2006 Kepler Project");
+ lua_pushliteral (L, "Copyright (C) 2003 Kepler Project");
lua_settable (L, -3);
lua_pushliteral (L, "_DESCRIPTION");
lua_pushliteral (L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution");
lua_settable (L, -3);
lua_pushliteral (L, "_VERSION");
- lua_pushliteral (L, "LuaFileSystem 1.2");
+ lua_pushliteral (L, "LuaFileSystem 1.4.1");
lua_settable (L, -3);
}
@@ -655,6 +745,8 @@ static const struct luaL_reg fslib[] = {
{"lock", file_lock},
{"mkdir", make_dir},
{"rmdir", remove_dir},
+ {"symlinkattributes", link_info},
+ {"setmode", lfs_f_setmode},
{"touch", file_utime},
{"unlock", file_unlock},
{NULL, NULL},
@@ -662,7 +754,7 @@ static const struct luaL_reg fslib[] = {
int luaopen_lfs (lua_State *L) {
dir_create_meta (L);
- luaL_openlib (L, "lfs", fslib, 0);
+ luaL_register (L, "lfs", fslib);
set_info (L);
return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def
new file mode 100644
index 00000000000..978ee6e60f9
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.def
@@ -0,0 +1,5 @@
+LIBRARY lfs.dll
+DESCRIPTION "LuaFileSystem"
+VERSION 1.4.1
+EXPORTS
+luaopen_lfs
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h
index 62ae79fa96c..4b52780bb3f 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.h
@@ -1,8 +1,8 @@
/*
** LuaFileSystem
-** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/luafilesystem)
+** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
**
-** $Id: lfs.h,v 1.3 2006/03/10 23:37:32 carregal Exp $
+** $Id: lfs.h,v 1.5 2008/02/19 20:08:23 mascarenhas Exp $
*/
/* Define 'chdir' for systems that do not implement it */
@@ -13,4 +13,5 @@
#define chdir_error strerror(errno)
#endif
+
int luaopen_lfs (lua_State *L);
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua b/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua
index 66ec52a2f8b..1fd6157a7b9 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/tests/test.lua
@@ -1,80 +1,113 @@
-#!/usr/local/bin/lua50
-
-local tmp = "/tmp"
-local sep = "/"
-local upper = ".."
-
-require"lfs"
-
-function attrdir (path)
- for file in lfs.dir(path) do
- if file ~= "." and file ~= ".." then
- local f = path..sep..file
- print ("\t=> "..f.." <=")
- local attr = lfs.attributes (f)
- assert (type(attr) == "table")
- if attr.mode == "directory" then
- attrdir (f)
- else
- for name, value in pairs(attr) do
- print (name, value)
- end
- end
- end
- end
-end
-
--- Checking changing directories
-local current = assert (lfs.currentdir())
-local reldir = string.gsub (current, "^.*%"..sep.."([^"..sep.."])$", "%1")
-assert (lfs.chdir (upper), "could not change to upper directory")
-assert (lfs.chdir (reldir), "could not change back to current directory")
-assert (lfs.currentdir() == current, "error trying to change directories")
-assert (lfs.chdir ("this couldn't be an actual directory") == nil, "could change to a non-existent directory")
-
--- Changing creating and removing directories
-local tmpdir = tmp..sep.."lfs_tmp_dir"
-local tmpfile = tmpdir..sep.."tmp_file"
-assert (lfs.mkdir (tmpdir), "could not make a new directory")
-local attrib, errmsg = lfs.attributes (tmpdir)
-if not attrib then
- error ("could not get attributes of file `"..tmpdir.."':\n"..errmsg)
-end
-local f = io.open(tmpfile, "w")
-f:close()
-
--- Change access time
-assert (lfs.touch (tmpfile, 86401))
-local new_att = assert (lfs.attributes (tmpfile))
-assert (new_att.access == 86401, "could not set access time")
-assert (new_att.modification == 86401, "could not set modification time")
-
--- Change access and modification time
-assert (lfs.touch (tmpfile, 86403, 86402))
-local new_att = assert (lfs.attributes (tmpfile))
-assert (new_att.access == 86403, "could not set access time")
-assert (new_att.modification == 86402, "could not set modification time")
-
--- Restore access time to current value
-assert (lfs.touch (tmpfile))
-new_att = assert (lfs.attributes (tmpfile))
-assert (new_att.access == attrib.access)
-assert (new_att.modification == attrib.modification)
-
--- Remove new file and directory
-assert (os.remove (tmpfile), "could not remove new file")
-assert (lfs.rmdir (tmpdir), "could not remove new directory")
-assert (lfs.mkdir (tmpdir..sep.."lfs_tmp_dir") == nil, "could create a directory inside a non-existent one")
-
--- Trying to get attributes of a non-existent file
-assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file")
-assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory")
-
--- Stressing directory iterator
-count = 0
-for i = 1, 4000 do
- for file in lfs.dir (tmp) do
- count = count + 1
- end
-end
-print"Ok!"
+#!/usr/local/bin/lua5.1
+
+local tmp = "/tmp"
+local sep = "/"
+local upper = ".."
+
+require"lfs"
+print (lfs._VERSION)
+
+function attrdir (path)
+ for file in lfs.dir(path) do
+ if file ~= "." and file ~= ".." then
+ local f = path..sep..file
+ print ("\t=> "..f.." <=")
+ local attr = lfs.attributes (f)
+ assert (type(attr) == "table")
+ if attr.mode == "directory" then
+ attrdir (f)
+ else
+ for name, value in pairs(attr) do
+ print (name, value)
+ end
+ end
+ end
+ end
+end
+
+-- Checking changing directories
+local current = assert (lfs.currentdir())
+local reldir = string.gsub (current, "^.*%"..sep.."([^"..sep.."])$", "%1")
+assert (lfs.chdir (upper), "could not change to upper directory")
+assert (lfs.chdir (reldir), "could not change back to current directory")
+assert (lfs.currentdir() == current, "error trying to change directories")
+assert (lfs.chdir ("this couldn't be an actual directory") == nil, "could change to a non-existent directory")
+
+-- Changing creating and removing directories
+local tmpdir = current..sep.."lfs_tmp_dir"
+local tmpfile = tmpdir..sep.."tmp_file"
+-- Test for existence of a previous lfs_tmp_dir
+-- that may have resulted from an interrupted test execution and remove it
+if lfs.chdir (tmpdir) then
+ assert (lfs.chdir (upper), "could not change to upper directory")
+ assert (os.remove (tmpfile), "could not remove file from previous test")
+ assert (lfs.rmdir (tmpdir), "could not remove directory from previous test")
+end
+
+-- tries to create a directory
+assert (lfs.mkdir (tmpdir), "could not make a new directory")
+local attrib, errmsg = lfs.attributes (tmpdir)
+if not attrib then
+ error ("could not get attributes of file `"..tmpdir.."':\n"..errmsg)
+end
+local f = io.open(tmpfile, "w")
+f:close()
+
+-- Change access time
+local testdate = os.time({ year = 2007, day = 10, month = 2, hour=0})
+assert (lfs.touch (tmpfile, testdate))
+local new_att = assert (lfs.attributes (tmpfile))
+assert (new_att.access == testdate, "could not set access time")
+assert (new_att.modification == testdate, "could not set modification time")
+
+-- Change access and modification time
+local testdate1 = os.time({ year = 2007, day = 10, month = 2, hour=0})
+local testdate2 = os.time({ year = 2007, day = 11, month = 2, hour=0})
+
+assert (lfs.touch (tmpfile, testdate2, testdate1))
+local new_att = assert (lfs.attributes (tmpfile))
+assert (new_att.access == testdate2, "could not set access time")
+assert (new_att.modification == testdate1, "could not set modification time")
+
+local res, err = lfs.symlinkattributes(tmpfile)
+if err ~= "symlinkattributes not supported on this platform" then
+ -- Checking symbolic link information (does not work in Windows)
+ assert (os.execute ("ln -s "..tmpfile.." _a_link_for_test_"))
+ assert (lfs.attributes"_a_link_for_test_".mode == "file")
+ assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
+ assert (os.remove"_a_link_for_test_")
+end
+
+if lfs.setmode then
+ -- Checking text/binary modes (works only in Windows)
+ local f = io.open(tmpfile, "w")
+ local result, mode = lfs.setmode(f, "binary")
+ assert((result and mode == "text") or (not result and mode == "setmode not supported on this platform"))
+ result, mode = lfs.setmode(f, "text")
+ assert((result and mode == "binary") or (not result and mode == "setmode not supported on this platform"))
+ f:close()
+end
+
+-- Restore access time to current value
+assert (lfs.touch (tmpfile, attrib.access, attrib.modification))
+new_att = assert (lfs.attributes (tmpfile))
+assert (new_att.access == attrib.access)
+assert (new_att.modification == attrib.modification)
+
+-- Remove new file and directory
+assert (os.remove (tmpfile), "could not remove new file")
+assert (lfs.rmdir (tmpdir), "could not remove new directory")
+assert (lfs.mkdir (tmpdir..sep.."lfs_tmp_dir") == nil, "could create a directory inside a non-existent one")
+
+-- Trying to get attributes of a non-existent file
+assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file")
+assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory")
+
+-- Stressing directory iterator
+count = 0
+for i = 1, 4000 do
+ for file in lfs.dir (tmp) do
+ count = count + 1
+ end
+end
+print"Ok!"
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/Makefile b/Build/source/texk/web2c/luatexdir/luafontforge/Makefile
deleted file mode 100644
index a160ab19650..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# $Id$
-
-srcdir=../../../libs/luafontforge
-
-FF_LIB=ffdummies.o luafflib.o
-
-_CFLAGS=-DFONTFORGE_CONFIG_NO_WINDOWING_UI=1 -DLUA_FF_LIB=1 $(XCFLAGS)
-#CFLAGS = -g -O2
-
-.PHONY: newfile
-
-fontforge: $(FF_LIB) newfile
- rm -f libff.a
- cd fontforge && $(MAKE)
- cd Unicode && $(MAKE)
- sh -c "ar cru libff.a fontforge/*.o Unicode/*.o $(FF_LIB)"
- ranlib libff.a
-
-%.o: $(srcdir)/src/%.c
- $(CC) $(_CFLAGS) $(CFLAGS) -I$(srcdir)/../lua51 -I$(srcdir)/fontforge/inc -I$(srcdir)/fontforge/fontforge -c $< -o $@
-
-clean:
- rm -f libff.a $(FF_LIB)
- cd fontforge; $(MAKE) clean
- cd Unicode; $(MAKE) clean
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Makefile b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Makefile
deleted file mode 100644
index b79b39e8842..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Makefile
+++ /dev/null
@@ -1,112 +0,0 @@
-prefix = /usr/local
-exec_prefix = ${prefix}
-
-bindir = ${exec_prefix}/bin
-libdir = ${exec_prefix}/lib
-mandir = ${prefix}/man
-includedir = ${prefix}/include
-sharedir = $(prefix)/share/fontforge
-docdir = $(prefix)/share/doc/fontforge
-localedir = $(prefix)/share/locale
-
-srcdir = .
-top_builddir = .
-
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-INSTALL = /usr/bin/install -c
-INSTALL_DATA = ${INSTALL} -m 644
-
-all: fontforge
-
-libs: libgunicode libgdraw
-
-fontforge: libgunicode libgdraw pos
- ( cd fontforge ; $(MAKE) )
-
-libgunicode:
- ( cd Unicode ; $(MAKE) )
-
-libgdraw:
- ( cd gdraw ; $(MAKE) )
-
-pos:
- -ln -s $(srcdir)/po/*.po po
- ( cd po ; $(MAKE) )
-
-clean:
- ( cd fontforge ; $(MAKE) clean )
- ( cd Unicode ; $(MAKE) clean )
- ( cd gdraw ; $(MAKE) clean )
- ( cd plugins ; $(MAKE) clean )
- -( cd po ; rm *.mo )
- -rm -rf .libs
-
-distclean cleaner:
- ( cd fontforge ; $(MAKE) distclean )
- ( cd Unicode ; $(MAKE) distclean )
- ( cd gdraw ; $(MAKE) distclean )
- ( cd plugins ; $(MAKE) distclean )
- -( cd po ; rm *.mo Makefile* )
- -rm -rf .libs
- -rm Makefile config.cache config.log config.status libtool fontforge.pc systemspecific
-
-install_libs: libs
-# You may need to be root to do the install
- mkdir -p $(libdir)
- #-rm $(libdir)/libgdraw.so* $(libdir)/libgunicode.so.*
- $(LIBTOOL) --mode=install $(INSTALL) -c libgunicode.la $(libdir)/libgunicode.la
- $(LIBTOOL) --mode=install $(INSTALL) -c libgdraw.la $(libdir)/libgdraw.la
- $(LIBTOOL) --mode=finish $(libdir)
- mkdir -p $(libdir)/pkgconfig
- $(INSTALL_DATA) fontforge.pc $(libdir)/pkgconfig
-
-install_docs:
- mkdir -p $(docdir)
- mkdir -p $(docdir)/flags $(docdir)/ja
-#explicit use of sh to make sure we don't invoke csh with different "if" syntax
- -sh -c "if test -d $(srcdir)/htdocs/ja >/dev/null ; then mkdir -p $(docdir)/ja ; fi"
- -$(INSTALL_DATA) $(srcdir)/htdocs/*.{html,png,gif,pdf} $(docdir)
- -$(INSTALL_DATA) $(srcdir)/htdocs/flags/* $(docdir)/flags
- -$(INSTALL_DATA) $(srcdir)/htdocs/ja/* $(docdir)/ja
-
-install_po:
- ( cd po ; $(MAKE) install )
-
-install: $(sharedir) all install_libs install_po
-# You may need to be root to do the install
- mkdir -p $(bindir)
- mkdir -p $(mandir)/man1
- mkdir -p $(sharedir)
- $(LIBTOOL) --mode=install $(INSTALL) -c fontforge/fontforge $(bindir)
- $(LIBTOOL) --mode=install $(INSTALL) -c fontforge/sfddiff $(bindir)
- $(LIBTOOL) --mode=install $(INSTALL) -c fontforge/fontimage $(bindir)
-# -rm -f $(bindir)/pfaedit
-# (cd $(bindir) ; ln -s fontforge pfaedit)
-# $(INSTALL_DATA) fontforge/pfaedit-*.ui $(sharedir)
-#The next line will fail for most installs. If you have downloaded the cidmaps
-# this will install them. If you haven't it won't. You only need the cidmaps
-# if you are editing CID keyed files (and even then you can live without them
- -$(INSTALL_DATA) $(srcdir)/cidmap/*.cidmap $(sharedir) >/dev/null 2>&1
- $(INSTALL_DATA) $(srcdir)/fontforge/fontforge.1 $(mandir)/man1
- $(INSTALL_DATA) $(srcdir)/fontforge/sfddiff.1 $(mandir)/man1
- $(INSTALL_DATA) $(srcdir)/fontforge/fontimage.1 $(mandir)/man1
-#explicit use of sh to make sure we don't invoke csh with different "if" syntax
- sh -c "if test -d $(srcdir)/htdocs >/dev/null ; then $(MAKE) install_docs ; fi"
- sh < systemspecific
-
-uninstall:
- -rm $(bindir)/fontforge
- -rm $(bindir)/sfddiff
- -rm $(bindir)/fontimage
- -rm $(sharedir)/pfaedit-*.ui
- -rm $(localedir)/*/LC_MESSAGES/FontForge.mo
- -rm $(mandir)/man1/fontimage.1
- -rm $(mandir)/man1/fontforge.1
- -rm $(mandir)/man1/sfddiff.1
- -rm $(libdir)/libgdraw.*
- -rm $(libdir)/libgunicode.*
- -rm $(sharedir)/*.cidmap
- -rm -rf $(docdir)/*
-
-$(sharedir):
- mkdir -p $(sharedir)
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/Makefile b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/Makefile
deleted file mode 100644
index 7538627cb5d..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $Id$
-top_srcdir = ../../../../libs/luafontforge/fontforge
-srcdir = $(top_srcdir)/Unicode
-
-#CC = gcc
-
-OBJECTS = alphabet.o char.o memory.o cjk.o ustring.o gwwiconv.o
-
-_CFLAGS = -I$(top_srcdir)/inc -DLUA_FF_LIB=1 $(XCFLAGS)
-#CFLAGS = -g -O2
-
-all: $(OBJECTS)
-
-%.o: $(srcdir)/%.c
- $(CC) $(_CFLAGS) $(CFLAGS) -c $< -o $@
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/descrip.mms b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/descrip.mms
deleted file mode 100644
index 10fccc109c2..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/descrip.mms
+++ /dev/null
@@ -1,27 +0,0 @@
-libgunicode_OBJECTS = ArabicForms.obj,alphabet.obj,backtrns.obj,char.obj,\
- cjk.obj,memory.obj,ucharmap.obj,unialt.obj,ustring.obj,\
- utype.obj,usprintf.obj,gwwiconv.obj
-
-CFLAGS=/incl=([-.inc])/name=(as_is,short)/nowarn/define=(\
- "_STATIC_LIBFREETYPE=1","_STATIC_LIBPNG=1","HAVE_LIBINTL_H=1",\
- "_STATIC_LIBUNINAMESLIST=1","_STATIC_LIBXML=1","_NO_XINPUT=1",\
- "_STATIC_LIBUNGIF=1","_STATIC_LIBJPEG=1","_STATIC_LIBTIFF=1")
-
-all : [-.libs]libgunicode.olb
- write sys$output "unicode finished"
-
-[-.libs]libgunicode.olb : $(libgunicode_OBJECTS)
- library/create [-.libs]libgunicode.olb $(libgunicode_OBJECTS)
-
-ArabicForms.obj : ArabicForms.c
-alphabet.obj : alphabet.c
-backtrns.obj : backtrns.c
-char.obj : char.c
-cjk.obj : cjk.c
-memory.obj : memory.c
-ucharmap.obj : ucharmap.c
-unialt.obj : unialt.c
-ustring.obj : ustring.c
-utype.obj : utype.c
-usprintf.obj : usprintf.c
-gwwiconv.obj : gwwiconv.c
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/VERSION b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/VERSION
deleted file mode 100644
index 86747f5830b..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-20070607
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/descrip.mms b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/descrip.mms
deleted file mode 100644
index 3629c307bf6..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/descrip.mms
+++ /dev/null
@@ -1,9 +0,0 @@
-all :
- set def [.unicode]
- mms
- set def [-.gdraw]
- mms
- set def [-.fontforge]
- mms
- set def [-.plugins]
- mms
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/Makefile b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/Makefile
deleted file mode 100644
index 3113228c30a..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-
-top_srcdir = ../../../../libs/luafontforge/fontforge
-srcdir = $(top_srcdir)/fontforge
-
-#CC = gcc
-AR = ar cru
-RANLIB = ranlib
-
-OBJECTS =autohint.o charview.o fontinfo.o \
- fontview.o fvfonts.o parsepfa.o parsettf.o prefs.o psread.o namelist.o \
- splinefill.o splineoverlap.o splinestroke.o splineutil.o splineutil2.o stamp.o \
- start.o encoding.o macbinary.o splineorder2.o kernclass.o ttfspecial.o \
- parsettfatt.o contextchain.o macenc.o splinerefigure.o parsettfvar.o pua.o \
- stemdb.o lookups.o featurefile.o \
- tottf.o tottfgpos.o tottfvar.o splinesave.o
-
-_CFLAGS = -I$(top_srcdir)/inc -I$(srcdir) -I. $(XCFLAGS) \
- -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \
- -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 \
- -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -D_NO_PYTHON=1 -DHAVE_LANGINFO_H=1 \
- -DX_DISPLAY_MISSING=1 -DHAVE_LONG_DOUBLE=1 -D_HAS_LONGLONG=1 \
- -DNODYNAMIC=1 -D_NO_FREETYPE=1 -D_NO_LIBUNINAMESLIST=1 \
- -DFONTFORGE_CONFIG_NO_WINDOWING_UI=1 -DLUA_FF_LIB=1 -UHAVE_LIBINTL_H
-
-#CFLAGS = -g -O2
-
-all: $(OBJECTS)
-
-# The slight error introduced occasionally by optimization turns out to have
-# disasterous effects. This file may not be compiled with the optimizer.
-# On the other hand we do need CPPFLAGS to get the right includes...
-splinerefigure.o: $(srcdir)/splinerefigure.c $(srcdir)/splinefont.h
- $(CC) -g -c -o splinerefigure.o $(_CFLAGS) $(srcdir)/splinerefigure.c
-
-%.o: $(srcdir)/%.c $(srcdir)/splinefont.h $(srcdir)/views.h $(srcdir)/stemdb.h $(srcdir)/ttf.h $(srcdir)/unicoderange.h $(srcdir)/psfont.h $(srcdir)/groups.h $(srcdir)/edgelist.h $(srcdir)/edgelist2.h
- $(CC) $(_CFLAGS) $(CFLAGS) -c $< -o $@
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/charview.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/charview.c
deleted file mode 100644
index 82434d8dbf9..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/charview.c
+++ /dev/null
@@ -1,9513 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/* #define TEST_O2 */
-
-#include "pfaeditui.h"
-#include <math.h>
-#include <locale.h>
-#ifndef FONTFORGE_CONFIG_GTK
-# include <ustring.h>
-# include <utype.h>
-# include <gresource.h>
-# ifdef FONTFORGE_CONFIG_GDRAW
-extern int _GScrollBar_Width;
-# include <gkeysym.h>
-# endif
-#endif
-#ifdef HAVE_IEEEFP_H
-# include <ieeefp.h> /* Solaris defines isnan in ieeefp rather than math.h */
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-extern struct lconv localeinfo;
-extern char *coord_sep;
-struct cvshows CVShows = {
- 1, /* show foreground */
- 1, /* show background */
- 1, /* show grid plane */
- 1, /* show horizontal hints */
- 1, /* show vertical hints */
- 1, /* show diagonal hints */
- 1, /* show points */
- 0, /* show filled */
- 1, /* show rulers */
- 1, /* show points which are to be rounded to the ttf grid and aren't on hints */
- 1, /* show x minimum distances */
- 1, /* show y minimum distances */
- 1, /* show horizontal metrics */
- 0, /* show vertical metrics */
- 0, /* mark extrema */
- 0, /* show points of inflection */
- 1, /* show blue values */
- 1, /* show family blues too */
- 1, /* show anchor points */
- 1, /* show control point info when moving them */
- 1, /* show tabs containing names of former glyphs */
- 1 /* show side bearings */
-};
-static Color pointcol = 0xff0000;
-static Color firstpointcol = 0x707000;
-static Color selectedpointcol = 0xc8c800;
-static int selectedpointwidth = 2;
-static Color extremepointcol = 0xc00080;
-static Color pointofinflectioncol = 0x008080;
-Color nextcpcol = 0x007090;
-Color prevcpcol = 0xcc00cc;
-static Color selectedcpcol = 0xffffff;
-static Color coordcol = 0x808080;
-Color widthcol = 0x000000;
-static Color widthselcol = 0x00ff00;
-static Color widthgridfitcol = 0x009800;
-static Color lcaretcol = 0x909040;
-static Color rastercol = 0xa0a0a0;
-static Color rasternewcol = 0x909090;
-static Color rasteroldcol = 0xc0c0c0;
-static Color rastergridcol = 0xb0b0ff;
-static Color rasterdarkcol = 0x606060;
-static Color italiccoordcol = 0x909090;
-static Color metricslabelcol = 0x00000;
-static Color hintlabelcol = 0x00ffff;
-static Color bluevalstipplecol = 0x8080ff;
-static Color fambluestipplecol = 0xff7070;
-static Color mdhintcol = 0xe04040;
-static Color dhintcol = 0xd0a0a0;
-static Color hhintcol = 0xa0d0a0;
-static Color vhintcol = 0xc0c0ff;
-static Color hflexhintcol = 0x00ff00;
-static Color vflexhintcol = 0x00ff00;
-static Color conflicthintcol = 0x00ffff;
-static Color hhintactivecol = 0x00a000;
-static Color vhintactivecol = 0x0000ff;
-static Color anchorcol = 0x0040ff;
-static Color anchoredoutlinecol = 0x0040ff;
-static Color templateoutlinecol = 0x009800;
-static Color oldoutlinecol = 0x008000;
-static Color transformorigincol = 0x000000;
-static Color guideoutlinecol = 0x808080;
-static Color gridfitoutlinecol = 0x009800;
-static Color backoutlinecol = 0x009800;
-static Color foreoutlinecol = 0x000000;
-static Color backimagecol = 0x707070;
-static Color fillcol = 0x707070;
-static Color tracecol = 0x008000;
-
-static int cvcolsinited = false;
-
-static void CVColInit( void ) {
- GResStruct cvcolors[] = {
- { "PointColor", rt_color, &pointcol },
- { "FirstPointColor", rt_color, &firstpointcol },
- { "SelectedPointColor", rt_color, &selectedpointcol },
- { "SelectedPointWidth", rt_int, &selectedpointwidth },
- { "ExtremePointColor", rt_color, &extremepointcol },
- { "PointOfInflectionColor", rt_color, &pointofinflectioncol },
- { "NextCPColor", rt_color, &nextcpcol },
- { "PrevCPColor", rt_color, &prevcpcol },
- { "SelectedCPColor", rt_color, &selectedcpcol },
- { "CoordinateLineColor", rt_color, &coordcol },
- { "WidthColor", rt_color, &widthcol },
- { "WidthSelColor", rt_color, &widthselcol },
- { "GridFitWidthColor", rt_color, &widthgridfitcol },
- { "LigatureCaretColor", rt_color, &lcaretcol },
- { "RasterColor", rt_color, &rastercol },
- { "RasterNewColor", rt_color, &rasternewcol },
- { "RasterOldColor", rt_color, &rasteroldcol },
- { "RasterGridColor", rt_color, &rastergridcol },
- { "RasterDarkColor", rt_color, &rasterdarkcol },
- { "ItalicCoordColor", rt_color, &italiccoordcol },
- { "MetricsLabelColor", rt_color, &metricslabelcol },
- { "HintLabelColor", rt_color, &hintlabelcol },
- { "BlueValuesStippledColor", rt_color, &bluevalstipplecol },
- { "FamilyBlueStippledColor", rt_color, &fambluestipplecol },
- { "MDHintColor", rt_color, &mdhintcol },
- { "DHintColor", rt_color, &dhintcol },
- { "HHintColor", rt_color, &hhintcol },
- { "VHintColor", rt_color, &vhintcol },
- { "HFlexHintColor", rt_color, &hflexhintcol },
- { "VFlexHintColor", rt_color, &vflexhintcol },
- { "ConflictHintColor", rt_color, &conflicthintcol },
- { "HHintActiveColor", rt_color, &hhintactivecol },
- { "VHintActiveColor", rt_color, &vhintactivecol },
- { "AnchorColor", rt_color, &anchorcol },
- { "AnchoredOutlineColor", rt_color, &anchoredoutlinecol },
- { "TemplateOutlineColor", rt_color, &templateoutlinecol },
- { "OldOutlineColor", rt_color, &oldoutlinecol },
- { "TransformOriginColor", rt_color, &transformorigincol },
- { "GuideOutlineColor", rt_color, &guideoutlinecol },
- { "GridFitOutlineColor", rt_color, &gridfitoutlinecol },
- { "BackgroundOutlineColor", rt_color, &backoutlinecol },
- { "ForegroundOutlineColor", rt_color, &foreoutlinecol },
- { "BackgroundImageColor", rt_color, &backimagecol },
- { "FillColor", rt_color, &fillcol },
- { "TraceColor", rt_color, &tracecol },
- { NULL }
- };
- GResourceFind( cvcolors, "CharView.");
-}
-
-
-GDevEventMask input_em[] = {
- /* Event masks for wacom devices */
- /* negative utility in opening Mouse1 */
- /* No point in distinguishing cursor from core mouse */
- { (1<<et_mousemove)|(1<<et_mousedown)|(1<<et_mouseup)|(1<<et_char), "stylus" },
- { (1<<et_mousemove)|(1<<et_mousedown)|(1<<et_mouseup), "eraser" },
- { 0, NULL }
-};
-const int input_em_cnt = sizeof(input_em)/sizeof(input_em[0])-1;
-
-/* Positions on the info line */
-#define RPT_BASE 5 /* Place to draw the pointer icon */
-#define RPT_DATA 13 /* x,y text after above */
-#define SPT_BASE 73 /* Place to draw selected pt icon */
-#define SPT_DATA 87 /* Any text for it */
-#define SOF_BASE 147 /* Place to draw selection to pointer icon */
-#define SOF_DATA 169 /* Any text for it */
-#define SDS_BASE 229 /* Place to draw distance icon */
-#define SDS_DATA 251 /* Any text for it */
-#define SAN_BASE 281 /* Place to draw angle icon */
-#define SAN_DATA 303 /* Any text for it */
-#define MAG_BASE 333 /* Place to draw magnification icon */
-#define MAG_DATA 344 /* Any text for it */
-#define LAYER_DATA 404 /* Text to show the current layer */
-#define CODERANGE_DATA 474 /* Text to show the current code range (if the debugger be active) */
-
-void CVDrawRubberRect(GWindow pixmap, CharView *cv) {
- GRect r;
- if ( !cv->p.rubberbanding )
-return;
- r.x = cv->xoff + rint(cv->p.cx*cv->scale);
- r.y = -cv->yoff + cv->height - rint(cv->p.cy*cv->scale);
- r.width = rint( (cv->p.ex-cv->p.cx)*cv->scale );
- r.height = -rint( (cv->p.ey-cv->p.cy)*cv->scale );
- if ( r.width<0 ) {
- r.x += r.width;
- r.width = -r.width;
- }
- if ( r.height<0 ) {
- r.y += r.height;
- r.height = -r.height;
- }
- GDrawSetDashedLine(pixmap,2,2,0);
- GDrawSetLineWidth(pixmap,0);
- GDrawSetXORMode(pixmap);
- GDrawSetXORBase(pixmap,GDrawGetDefaultBackground(NULL));
- GDrawDrawRect(pixmap,&r,0x000000);
- GDrawSetCopyMode(pixmap);
- GDrawSetDashedLine(pixmap,0,0,0);
-}
-
-static void CVDrawRubberLine(GWindow pixmap, CharView *cv) {
- int x,y, xend,yend;
- if ( !cv->p.rubberlining )
-return;
- x = cv->xoff + rint(cv->p.cx*cv->scale);
- y = -cv->yoff + cv->height - rint(cv->p.cy*cv->scale);
- xend = cv->xoff + rint(cv->info.x*cv->scale);
- yend = -cv->yoff + cv->height - rint(cv->info.y*cv->scale);
- GDrawSetXORMode(pixmap);
- GDrawSetLineWidth(pixmap,0);
- GDrawSetXORBase(pixmap,GDrawGetDefaultBackground(NULL));
- GDrawDrawLine(pixmap,x,y,xend,yend,0x000000);
- GDrawSetCopyMode(pixmap);
-}
-
-static void CVDrawBB(CharView *cv, GWindow pixmap, DBounds *bb) {
- GRect r;
- int off = cv->xoff+cv->height-cv->yoff;
-
- r.x = cv->xoff + rint(bb->minx*cv->scale);
- r.y = -cv->yoff + cv->height - rint(bb->maxy*cv->scale);
- r.width = rint((bb->maxx-bb->minx)*cv->scale);
- r.height = rint((bb->maxy-bb->miny)*cv->scale);
- GDrawSetDashedLine(pixmap,1,1,off);
- GDrawDrawRect(pixmap,&r,GDrawGetDefaultForeground(NULL));
- GDrawSetDashedLine(pixmap,0,0,0);
-}
-
-/* Sigh. I have to do my own clipping because at large magnifications */
-/* things can easily exceed 16 bits */
-static int CVSplineOutside(CharView *cv, Spline *spline) {
- int x[4], y[4];
-
- x[0] = cv->xoff + rint(spline->from->me.x*cv->scale);
- y[0] = -cv->yoff + cv->height - rint(spline->from->me.y*cv->scale);
-
- x[1] = cv->xoff + rint(spline->to->me.x*cv->scale);
- y[1] = -cv->yoff + cv->height - rint(spline->to->me.y*cv->scale);
-
- if ( spline->from->nonextcp && spline->to->noprevcp ) {
- if ( (x[0]<0 && x[1]<0) || (x[0]>=cv->width && x[1]>=cv->width) ||
- (y[0]<0 && y[1]<0) || (y[0]>=cv->height && y[1]>=cv->height) )
-return( true );
- } else {
- x[2] = cv->xoff + rint(spline->from->nextcp.x*cv->scale);
- y[2] = -cv->yoff + cv->height - rint(spline->from->nextcp.y*cv->scale);
- x[3] = cv->xoff + rint(spline->to->prevcp.x*cv->scale);
- y[3] = -cv->yoff + cv->height - rint(spline->to->prevcp.y*cv->scale);
- if ( (x[0]<0 && x[1]<0 && x[2]<0 && x[3]<0) ||
- (x[0]>=cv->width && x[1]>=cv->width && x[2]>=cv->width && x[3]>=cv->width ) ||
- (y[0]<0 && y[1]<0 && y[2]<0 && y[3]<0 ) ||
- (y[0]>=cv->height && y[1]>=cv->height && y[2]>=cv->height && y[3]>=cv->height) )
-return( true );
- }
-
-return( false );
-}
-
-static int CVLinesIntersectScreen(CharView *cv, LinearApprox *lap) {
- LineList *l;
- int any = false;
- int x,y;
- int bothout;
-
- for ( l=lap->lines; l!=NULL; l=l->next ) {
- l->asend.x = l->asstart.x = cv->xoff + l->here.x;
- l->asend.y = l->asstart.y = -cv->yoff + cv->height-l->here.y;
- l->flags = 0;
- if ( l->asend.x<0 || l->asend.x>=cv->width || l->asend.y<0 || l->asend.y>=cv->height ) {
- l->flags = cvli_clipped;
- any = true;
- }
- }
- if ( !any ) {
- for ( l=lap->lines; l!=NULL; l=l->next )
- l->flags = cvli_onscreen;
- lap->any = true;
-return( true );
- }
-
- any = false;
- for ( l=lap->lines; l->next!=NULL; l=l->next ) {
- if ( !(l->flags&cvli_clipped) && !(l->next->flags&cvli_clipped) )
- l->flags = cvli_onscreen;
- else {
- bothout = (l->flags&cvli_clipped) && (l->next->flags&cvli_clipped);
- if (( l->asstart.x<0 && l->next->asend.x>0 ) ||
- ( l->asstart.x>0 && l->next->asend.x<0 )) {
- y = -(l->next->asend.y-l->asstart.y)*(double)l->asstart.x/(l->next->asend.x-l->asstart.x) +
- l->asstart.y;
- if ( l->asstart.x<0 ) {
- l->asstart.x = 0;
- l->asstart.y = y;
- } else {
- l->next->asend.x = 0;
- l->next->asend.y = y;
- }
- } else if ( l->asstart.x<0 && l->next->asend.x<0 )
- continue;
- if (( l->asstart.x<cv->width && l->next->asend.x>cv->width ) ||
- ( l->asstart.x>cv->width && l->next->asend.x<cv->width )) {
- y = (l->next->asend.y-l->asstart.y)*(double)(cv->width-l->asstart.x)/(l->next->asend.x-l->asstart.x) +
- l->asstart.y;
- if ( l->asstart.x>cv->width ) {
- l->asstart.x = cv->width;
- l->asstart.y = y;
- } else {
- l->next->asend.x = cv->width;
- l->next->asend.y = y;
- }
- } else if ( l->asstart.x>cv->width && l->next->asend.x>cv->width )
- continue;
- if (( l->asstart.y<0 && l->next->asend.y>0 ) ||
- ( l->asstart.y>0 && l->next->asend.y<0 )) {
- x = -(l->next->asend.x-l->asstart.x)*(double)l->asstart.y/(l->next->asend.y-l->asstart.y) +
- l->asstart.x;
- if (( x<0 || x>=cv->width ) && bothout )
- continue; /* Not on screen */;
- if ( l->asstart.y<0 ) {
- l->asstart.y = 0;
- l->asstart.x = x;
- } else {
- l->next->asend.y = 0;
- l->next->asend.x = x;
- }
- } else if ( l->asstart.y<0 && l->next->asend.y< 0 )
- continue;
- if (( l->asstart.y<cv->height && l->next->asend.y>cv->height ) ||
- ( l->asstart.y>cv->height && l->next->asend.y<cv->height )) {
- x = (l->next->asend.x-l->asstart.x)*(double)(cv->height-l->asstart.y)/(l->next->asend.y-l->asstart.y) +
- l->asstart.x;
- if (( x<0 || x>=cv->width ) && bothout )
- continue; /* Not on screen */;
- if ( l->asstart.y>cv->height ) {
- l->asstart.y = cv->height;
- l->asstart.x = x;
- } else {
- l->next->asend.y = cv->height;
- l->next->asend.x = x;
- }
- } else if ( l->asstart.y>cv->height && l->next->asend.y>cv->height )
- continue;
- l->flags |= cvli_onscreen;
- any = true;
- }
- }
- lap->any = any;
-return( any );
-}
-
-typedef struct gpl { struct gpl *next; GPoint *gp; int cnt; } GPointList;
-
-static void GPLFree(GPointList *gpl) {
- GPointList *next;
-
- while ( gpl!=NULL ) {
- next = gpl->next;
- free( gpl->gp );
- free( gpl );
- gpl = next;
- }
-}
-
-/* Before we did clipping this was a single polygon. Now it is a set of */
-/* sets of line segments. If no clipping is done, then we end up with */
-/* one set which is the original polygon, otherwise we get the segments */
-/* which are inside the screen. Each set of segments is contiguous */
-static GPointList *MakePoly(CharView *cv, SplinePointList *spl) {
- int i, len;
- LinearApprox *lap;
- LineList *line, *prev;
- Spline *spline, *first;
- GPointList *head=NULL, *last=NULL, *cur;
- int closed;
-
- for ( i=0; i<2; ++i ) {
- len = 0; first = NULL;
- closed = true;
- cur = NULL;
- for ( spline = spl->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
- if ( !CVSplineOutside(cv,spline) && !isnan(spline->splines[0].a) && !isnan(spline->splines[1].a)) {
- lap = SplineApproximate(spline,cv->scale);
- if ( i==0 )
- CVLinesIntersectScreen(cv,lap);
- if ( lap->any ) {
- for ( prev = lap->lines, line=prev->next; line!=NULL; prev=line, line=line->next ) {
- if ( !(prev->flags&cvli_onscreen) ) {
- closed = true;
- continue;
- }
- if ( closed || (prev->flags&cvli_clipped) ) {
- if ( i==0 ) {
- cur = gcalloc(1,sizeof(GPointList));
- if ( head==NULL )
- head = cur;
- else {
- last->cnt = len;
- last->next = cur;
- }
- last = cur;
- } else {
- if ( cur==NULL )
- cur = head;
- else
- cur = cur->next;
- cur->gp = galloc(cur->cnt*sizeof(GPoint));
- cur->gp[0].x = prev->asstart.x;
- cur->gp[0].y = prev->asstart.y;
- }
- len=1;
- closed = false;
- }
- if ( i!=0 ) {
- if ( len>=cur->cnt )
- fprintf( stderr, "Clipping is screwed up, about to die %d (should be less than %d)\n", len, cur->cnt );
- cur->gp[len].x = line->asend.x;
- cur->gp[len].y = line->asend.y;
- }
- ++len;
- if ( line->flags&cvli_clipped )
- closed = true;
- }
- } else
- closed = true;
- } else
- closed = true;
- if ( first==NULL ) first = spline;
- }
- if ( i==0 && cur!=NULL )
- cur->cnt = len;
- }
-return( head );
-}
-
-static void DrawPoint(CharView *cv, GWindow pixmap, SplinePoint *sp,
- SplineSet *spl, int onlynumber) {
- GRect r;
- int x, y, cx, cy;
- Color col = sp==spl->first ? firstpointcol : pointcol, subcol;
- int pnum;
- char buf[12]; unichar_t ubuf[12];
- int isfake;
-
- if ( cv->markextrema && !sp->nonextcp && !sp->noprevcp &&
- ((sp->nextcp.x==sp->me.x && sp->prevcp.x==sp->me.x) ||
- (sp->nextcp.y==sp->me.y && sp->prevcp.y==sp->me.y)) )
- col = extremepointcol;
- if ( sp->selected )
- col = selectedpointcol;
-
- x = cv->xoff + rint(sp->me.x*cv->scale);
- y = -cv->yoff + cv->height - rint(sp->me.y*cv->scale);
- if ( x<-4000 || y<-4000 || x>cv->width+4000 || y>=cv->height+4000 )
-return;
-
- /* draw the control points if it's selected */
- if ( sp->selected || cv->showpointnumbers || cv->show_ft_results || cv->dv ) {
- int iscurrent = sp==(cv->p.sp!=NULL?cv->p.sp:cv->lastselpt);
- if ( !sp->nonextcp ) {
- cx = cv->xoff + rint(sp->nextcp.x*cv->scale);
- cy = -cv->yoff + cv->height - rint(sp->nextcp.y*cv->scale);
- if ( cx<-100 ) { /* Clip */
- cy = cx==x ? x : (cy-y) * (double)(-100-x)/(cx-x) + y;
- cx = -100;
- } else if ( cx>cv->width+100 ) {
- cy = cx==x ? x : (cy-y) * (double)(cv->width+100-x)/(cx-x) + y;
- cx = cv->width+100;
- }
- if ( cy<-100 ) {
- cx = cy==y ? y : (cx-x) * (double)(-100-y)/(cy-y) + x;
- cy = -100;
- } else if ( cy>cv->height+100 ) {
- cx = cy==y ? y : (cx-x) * (double)(cv->height+100-y)/(cy-y) + x;
- cy = cv->height+100;
- }
- subcol = nextcpcol;
- if ( iscurrent && cv->p.nextcp && !onlynumber ) {
- r.x = cx-3; r.y = cy-3; r.width = r.height = 7;
- GDrawFillRect(pixmap,&r, nextcpcol);
- subcol = selectedcpcol;
- }
- if ( !onlynumber ) {
- GDrawDrawLine(pixmap,x,y,cx,cy, nextcpcol);
- GDrawDrawLine(pixmap,cx-3,cy-3,cx+3,cy+3,subcol);
- GDrawDrawLine(pixmap,cx+3,cy-3,cx-3,cy+3,subcol);
- }
- if ( cv->showpointnumbers || cv->show_ft_results || cv->dv ) {
- pnum = sp->nextcpindex;
- if ( pnum!=0xffff && pnum!=0xfffe ) {
- sprintf( buf,"%d", pnum );
- uc_strcpy(ubuf,buf);
- GDrawDrawText(pixmap,cx,cy-6,ubuf,-1,NULL,nextcpcol);
- }
- }
- }
- if ( !sp->noprevcp ) {
- cx = cv->xoff + rint(sp->prevcp.x*cv->scale);
- cy = -cv->yoff + cv->height - rint(sp->prevcp.y*cv->scale);
- if ( cx<-100 ) { /* Clip */
- cy = cx==x ? x : (cy-y) * (double)(-100-x)/(cx-x) + y;
- cx = -100;
- } else if ( cx>cv->width+100 ) {
- cy = cx==x ? x : (cy-y) * (double)(cv->width+100-x)/(cx-x) + y;
- cx = cv->width+100;
- }
- if ( cy<-100 ) {
- cx = cy==y ? y : (cx-x) * (double)(-100-y)/(cy-y) + x;
- cy = -100;
- } else if ( cy>cv->height+100 ) {
- cx = cy==y ? y : (cx-x) * (double)(cv->height+100-y)/(cy-y) + x;
- cy = cv->height+100;
- }
- subcol = prevcpcol;
- if ( iscurrent && cv->p.prevcp && !onlynumber ) {
- r.x = cx-3; r.y = cy-3; r.width = r.height = 7;
- GDrawFillRect(pixmap,&r, prevcpcol);
- subcol = selectedcpcol;
- }
- if ( !onlynumber ) {
- GDrawDrawLine(pixmap,x,y,cx,cy, prevcpcol);
- GDrawDrawLine(pixmap,cx-3,cy-3,cx+3,cy+3,subcol);
- GDrawDrawLine(pixmap,cx+3,cy-3,cx-3,cy+3,subcol);
- }
- }
- }
-
- if ( x<-4 || y<-4 || x>cv->width+4 || y>=cv->height+4 )
-return;
- r.x = x-2;
- r.y = y-2;
- r.width = r.height = 5;
- if ( sp->selected )
- GDrawSetLineWidth(pixmap,selectedpointwidth);
- isfake = false;
- if ( cv->fv->sf->order2 && cv->drawmode==dm_fore &&
- cv->sc->layers[ly_fore].refs==NULL ) {
- int mightbe_fake = SPInterpolate(sp);
- if ( !mightbe_fake && sp->ttfindex==0xffff )
- sp->ttfindex = 0xfffe; /* if we have no instructions we won't call instrcheck and won't notice when a point stops being fake */
- else if ( mightbe_fake )
- sp->ttfindex = 0xffff;
- isfake = sp->ttfindex==0xffff;
- }
- if ( onlynumber )
- /* Draw Nothing */;
- else if ( sp->pointtype==pt_curve ) {
- --r.x; --r.y; r.width +=2; r.height += 2;
- if ( sp->selected || isfake )
- GDrawDrawElipse(pixmap,&r,col);
- else
- GDrawFillElipse(pixmap,&r,col);
- } else if ( sp->pointtype==pt_corner ) {
- if ( sp->selected || isfake )
- GDrawDrawRect(pixmap,&r,col);
- else
- GDrawFillRect(pixmap,&r,col);
- } else {
- GPoint gp[5];
- int dir;
- BasePoint *cp=NULL;
- if ( !sp->nonextcp )
- cp = &sp->nextcp;
- else if ( !sp->noprevcp )
- cp = &sp->prevcp;
- dir = 0;
- if ( cp!=NULL ) {
- float dx = cp->x-sp->me.x, dy = cp->y-sp->me.y;
- if ( dx<0 ) dx= -dx;
- if ( dy<0 ) dy= -dy;
- if ( dx>2*dy ) {
- if ( cp->x>sp->me.x ) dir = 0 /* right */;
- else dir = 1 /* left */;
- } else if ( dy>2*dx ) {
- if ( cp->y>sp->me.y ) dir = 2 /* up */;
- else dir = 3 /* down */;
- } else {
- if ( cp->y>sp->me.y && cp->x>sp->me.x ) dir=4;
- else if ( cp->x>sp->me.x ) dir=5;
- else if ( cp->y>sp->me.y ) dir=7;
- else dir = 6;
- }
- }
- if ( dir==1 /* left */ || dir==0 /* right */) {
- gp[0].y = y; gp[0].x = (dir==0)?x+4:x-4;
- gp[1].y = y-4; gp[1].x = x;
- gp[2].y = y+4; gp[2].x = x;
- } else if ( dir==2 /* up */ || dir==3 /* down */ ) {
- gp[0].x = x; gp[0].y = dir==2?y-4:y+4; /* remember screen coordinates are backwards in y from character coords */
- gp[1].x = x-4; gp[1].y = y;
- gp[2].x = x+4; gp[2].y = y;
- } else {
- /* at a 45 angle, a value of 4 looks too small. I probably want 4*1.414 */
- int xdiff= cp->x>sp->me.x?5:-5, ydiff = cp->y>sp->me.y?-5:5;
- gp[0].x = x+xdiff/2; gp[0].y = y+ydiff/2;
- gp[1].x = gp[0].x-xdiff; gp[1].y = gp[0].y;
- gp[2].x = gp[0].x; gp[2].y = gp[0].y-ydiff;
- }
- gp[3] = gp[0];
- if ( sp->selected || isfake )
- GDrawDrawPoly(pixmap,gp,4,col);
- else
- GDrawFillPoly(pixmap,gp,4,col);
- }
- GDrawSetLineWidth(pixmap,0);
- if ( (cv->showpointnumbers || cv->show_ft_results|| cv->dv ) && sp->ttfindex!=0xffff ) {
- if ( sp->ttfindex==0xfffe )
- strcpy(buf,"?");
- else
- sprintf( buf,"%d", sp->ttfindex );
- GDrawDrawText8(pixmap,x,y-6,buf,-1,NULL,col);
- }
- if ( !onlynumber ) {
- if ((( sp->roundx || sp->roundy ) &&
- (((cv->showrounds&1) && cv->scale>=.3) || (cv->showrounds&2))) ||
- (sp->watched && cv->dv!=NULL) ||
- sp->hintmask!=NULL ) {
- r.x = x-5; r.y = y-5;
- r.width = r.height = 11;
- GDrawDrawElipse(pixmap,&r,col);
- }
- if (( sp->flexx && cv->showhhints ) || (sp->flexy && cv->showvhints)) {
- r.x = x-5; r.y = y-5;
- r.width = r.height = 11;
- GDrawDrawElipse(pixmap,&r,sp->flexx ? hflexhintcol : vflexhintcol );
- }
- }
-}
-
-static void DrawLine(CharView *cv, GWindow pixmap,
- real x1, real y1, real x2, real y2, Color fg) {
- int ix1 = cv->xoff + rint(x1*cv->scale);
- int iy1 = -cv->yoff + cv->height - rint(y1*cv->scale);
- int ix2 = cv->xoff + rint(x2*cv->scale);
- int iy2 = -cv->yoff + cv->height - rint(y2*cv->scale);
- if ( iy1==iy2 ) {
- if ( iy1<0 || iy1>cv->height )
-return;
- if ( ix1<0 ) ix1 = 0;
- if ( ix2>cv->width ) ix2 = cv->width;
- } else if ( ix1==ix2 ) {
- if ( ix1<0 || ix1>cv->width )
-return;
- if ( iy1<0 ) iy1 = 0;
- if ( iy2<0 ) iy2 = 0;
- if ( iy1>cv->height ) iy1 = cv->height;
- if ( iy2>cv->height ) iy2 = cv->height;
- }
- GDrawDrawLine(pixmap, ix1,iy1, ix2,iy2, fg );
-}
-
-static void DrawDirection(CharView *cv,GWindow pixmap, SplinePoint *sp) {
- BasePoint dir, *other;
- double len;
- int x,y,xe,ye;
- SplinePoint *test;
-
- if ( sp->next==NULL )
-return;
-
- x = cv->xoff + rint(sp->me.x*cv->scale);
- y = -cv->yoff + cv->height - rint(sp->me.y*cv->scale);
- if ( x<0 || y<0 || x>cv->width || y>cv->width )
-return;
-
- /* Werner complained when the first point and the second point were at */
- /* the same location... */ /* Damn. They weren't at the same location */
- /* the were off by a rounding error. I'm not going to fix for that */
- for ( test=sp; ; ) {
- if ( test->me.x!=sp->me.x || test->me.y!=sp->me.y ) {
- other = &test->me;
- break;
- } else if ( !test->nonextcp ) {
- other = &test->nextcp;
- break;
- }
- if ( test->next==NULL )
-return;
- test = test->next->to;
- if ( test==sp )
-return;
- }
-
- dir.x = other->x-sp->me.x;
- dir.y = sp->me.y-other->y; /* screen coordinates are the mirror of user coords */
- len = sqrt(dir.x*dir.x + dir.y*dir.y);
- dir.x /= len; dir.y /= len;
-
- x += rint(5*dir.y);
- y -= rint(5*dir.x);
- xe = x + rint(7*dir.x);
- ye = y + rint(7*dir.y);
- GDrawDrawLine(pixmap,x,y,xe,ye,firstpointcol);
- GDrawDrawLine(pixmap,xe,ye,xe+rint(2*(dir.y-dir.x)),ye+rint(2*(-dir.y-dir.x)), firstpointcol);
- GDrawDrawLine(pixmap,xe,ye,xe+rint(2*(-dir.y-dir.x)),ye+rint(2*(dir.x-dir.y)), firstpointcol);
-}
-
-static void CVMarkInterestingLocations(CharView *cv, GWindow pixmap,
- SplinePointList *spl) {
- Spline *s, *first;
- extended interesting[6];
- int i, ecnt, cnt;
- GRect r;
-
- for ( s=spl->first->next, first=NULL; s!=NULL && s!=first; s=s->to->next ) {
- if ( first==NULL ) first = s;
- cnt = ecnt = 0;
- if ( cv->markextrema )
- ecnt = cnt = Spline2DFindExtrema(s,interesting);
-
- if ( cv->markpoi ) {
- cnt += Spline2DFindPointsOfInflection(s,interesting+cnt);
- }
- r.width = r.height = 9;
- for ( i=0; i<cnt; ++i ) if ( interesting[i]>0 && interesting[i]<1.0 ) {
- Color col = i<ecnt ? extremepointcol : pointofinflectioncol;
- double x = ((s->splines[0].a*interesting[i]+s->splines[0].b)*interesting[i]+s->splines[0].c)*interesting[i]+s->splines[0].d;
- double y = ((s->splines[1].a*interesting[i]+s->splines[1].b)*interesting[i]+s->splines[1].c)*interesting[i]+s->splines[1].d;
- double sx = cv->xoff + rint(x*cv->scale);
- double sy = -cv->yoff + cv->height - rint(y*cv->scale);
- if ( sx<-5 || sy<-5 || sx>10000 || sy>10000 )
- continue;
- GDrawDrawLine(pixmap,sx-4,sy,sx+4,sy, col);
- GDrawDrawLine(pixmap,sx,sy-4,sx,sy+4, col);
- r.x = sx-4; r.y = sy-4;
- GDrawDrawElipse(pixmap,&r,col);
- }
- }
-}
-
-void CVDrawSplineSet(CharView *cv, GWindow pixmap, SplinePointList *set,
- Color fg, int dopoints, DRect *clip ) {
- Spline *spline, *first;
- SplinePointList *spl;
-
- if ( cv->inactive )
- dopoints = false;
-
- GDrawSetFont(pixmap,cv->small); /* For point numbers */
- for ( spl = set; spl!=NULL; spl = spl->next ) {
- GPointList *gpl = MakePoly(cv,spl), *cur;
- if ( dopoints>0 || (dopoints==-1 && cv->showpointnumbers) ) {
- first = NULL;
- if ( dopoints>0 )
- DrawDirection(cv,pixmap,spl->first);
- for ( spline = spl->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
- DrawPoint(cv,pixmap,spline->from,spl,dopoints<0);
- if ( first==NULL ) first = spline;
- }
- if ( spline==NULL )
- DrawPoint(cv,pixmap,spl->last,spl,dopoints<0);
- }
- for ( cur=gpl; cur!=NULL; cur=cur->next )
- GDrawDrawPoly(pixmap,cur->gp,cur->cnt,fg);
- GPLFree(gpl);
- if (( cv->markextrema || cv->markpoi ) && dopoints )
- CVMarkInterestingLocations(cv,pixmap,spl);
- }
-}
-
-static void CVDrawLayerSplineSet(CharView *cv, GWindow pixmap, Layer *layer,
- Color fg, int dopoints, DRect *clip ) {
-#ifdef FONTFORGE_CONFIG_TYPE3
- int active = cv->layerheads[cv->drawmode]==layer;
-
- if ( layer->dostroke ) {
- if ( layer->stroke_pen.brush.col!=COLOR_INHERITED &&
- layer->stroke_pen.brush.col!=GDrawGetDefaultBackground(NULL))
- fg = layer->stroke_pen.brush.col;
-#if 0
- if ( layer->stroke_pen.width!=WIDTH_INHERITED )
- GDrawSetLineWidth(pixmap,rint(layer->stroke_pen.width*layer->stroke_pen.trans[0]*cv->scale));
-#endif
- }
- if ( layer->dofill ) {
- if ( layer->fill_brush.col!=COLOR_INHERITED &&
- layer->fill_brush.col!=GDrawGetDefaultBackground(NULL))
- fg = layer->fill_brush.col;
- }
- if ( !active && layer!=&cv->sc->layers[ly_back] )
- GDrawSetDashedLine(pixmap,5,5,cv->xoff+cv->height-cv->yoff);
- CVDrawSplineSet(cv,pixmap,layer->splines,fg,dopoints && active,clip);
- if ( !active && layer!=&cv->sc->layers[ly_back] )
- GDrawSetDashedLine(pixmap,0,0,0);
-#if 0
- if ( layer->dostroke && layer->stroke_pen.width!=WIDTH_INHERITED )
- GDrawSetLineWidth(pixmap,0);
-#endif
-#else
- CVDrawSplineSet(cv,pixmap,layer->splines,fg,dopoints,clip);
-#endif
-}
-
-static void CVDrawTemplates(CharView *cv,GWindow pixmap,SplineChar *template,DRect *clip) {
- RefChar *r;
-
- CVDrawSplineSet(cv,pixmap,template->layers[ly_fore].splines,templateoutlinecol,false,clip);
- for ( r=template->layers[ly_fore].refs; r!=NULL; r=r->next )
- CVDrawSplineSet(cv,pixmap,r->layers[0].splines,templateoutlinecol,false,clip);
-}
-
-static void CVShowDHint(CharView *cv, GWindow pixmap, DStemInfo *dstem) {
- IPoint ip[40], ip2[40];
- GPoint clipped[13];
- int i,j, tot,last;
-
- ip[0].x = cv->xoff + rint(dstem->leftedgetop.x*cv->scale);
- ip[0].y = -cv->yoff + cv->height - rint(dstem->leftedgetop.y*cv->scale);
- ip[1].x = cv->xoff + rint(dstem->rightedgetop.x*cv->scale);
- ip[1].y = -cv->yoff + cv->height - rint(dstem->rightedgetop.y*cv->scale);
- ip[2].x = cv->xoff + rint(dstem->rightedgebottom.x*cv->scale);
- ip[2].y = -cv->yoff + cv->height - rint(dstem->rightedgebottom.y*cv->scale);
- ip[3].x = cv->xoff + rint(dstem->leftedgebottom.x*cv->scale);
- ip[3].y = -cv->yoff + cv->height - rint(dstem->leftedgebottom.y*cv->scale);
-
- if (( ip[0].x<0 && ip[1].x<0 && ip[2].x<0 && ip[3].x<0 ) ||
- ( ip[0].x>=cv->width && ip[1].x>=cv->width && ip[2].x>=cv->width && ip[3].x>=cv->width ) ||
- ( ip[0].y<0 && ip[1].y<0 && ip[2].y<0 && ip[3].y<0 ) ||
- ( ip[0].y>=cv->height && ip[1].y>=cv->height && ip[2].y>=cv->height && ip[3].y>=cv->height ))
-return; /* Offscreen */
-
- /* clip to left edge */
- tot = 4;
- for ( i=j=0; i<tot; ++i ) {
- last = i==0?tot-1:i-1;
- if ( ip[i].x>=0 && ip[last].x>=0) {
- ip2[j++] = ip[i];
- } else if ( ip[i].x<0 && ip[last].x<0 ) {
- if ( j==0 || ip2[j-1].x!=0 || ip2[j-1].y!=ip[i].y ) {
- ip2[j].x = 0;
- ip2[j++].y = ip[i].y;
- }
- } else {
- ip2[j].x = 0;
- ip2[j++].y = ip[last].y - ip[last].x * ((real) (ip[i].y-ip[last].y))/(ip[i].x-ip[last].x);
- if ( ip[i].x>0 )
- ip2[j++] = ip[i];
- else {
- ip2[j].x = 0;
- ip2[j++].y = ip[i].y;
- }
- }
- }
- /* clip to right edge */
- tot = j;
- for ( i=j=0; i<tot; ++i ) {
- last = i==0?tot-1:i-1;
- if ( ip2[i].x<cv->width && ip2[last].x<cv->width ) {
- ip[j++] = ip2[i];
- } else if ( ip2[i].x>=cv->width && ip2[last].x>=cv->width ) {
- if ( j==0 || ip[j-1].x!=cv->width-1 || ip[j-1].y!=ip2[i].y ) {
- ip[j].x = cv->width-1;
- ip[j++].y = ip2[i].y;
- }
- } else {
- ip[j].x = cv->width-1;
- ip[j++].y = ip2[last].y + (cv->width-1- ip2[last].x) * ((real) (ip2[i].y-ip2[last].y))/(ip2[i].x-ip2[last].x);
- if ( ip2[i].x<cv->width )
- ip[j++] = ip2[i];
- else {
- ip[j].x = cv->width-1;
- ip[j++].y = ip2[i].y;
- }
- }
- }
- /* clip to bottom edge */
- tot = j;
- for ( i=j=0; i<tot; ++i ) {
- last = i==0?tot-1:i-1;
- if ( ip[i].y>=0 && ip[last].y>=0) {
- ip2[j++] = ip[i];
- } else if ( ip[i].y<0 && ip[last].y<0 ) {
- ip2[j].y = 0;
- ip2[j++].x = ip[i].x;
- } else {
- ip2[j].y = 0;
- ip2[j++].x = ip[last].x - ip[last].y * ((real) (ip[i].x-ip[last].x))/(ip[i].y-ip[last].y);
- if ( ip[i].y>0 )
- ip2[j++] = ip[i];
- else {
- ip2[j].y = 0;
- ip2[j++].x = ip[i].x;
- }
- }
- }
- /* clip to top edge */
- tot = j;
- for ( i=j=0; i<tot; ++i ) {
- last = i==0?tot-1:i-1;
- if ( ip2[i].y<cv->height && ip2[last].y<cv->height ) {
- ip[j++] = ip2[i];
- } else if ( ip2[i].y>=cv->height && ip2[last].y>=cv->height ) {
- ip[j].y = cv->height-1;
- ip[j++].x = ip2[i].x;
- } else {
- ip[j].y = cv->height-1;
- ip[j++].x = ip2[last].x + (cv->height-1- ip2[last].y) * ((real) (ip2[i].x-ip2[last].x))/(ip2[i].y-ip2[last].y);
- if ( ip2[i].y<cv->width )
- ip[j++] = ip2[i];
- else {
- ip[j].y = cv->height-1;
- ip[j++].x = ip2[i].x;
- }
- }
- }
-
- tot=j;
- clipped[0].x = ip[0].x; clipped[0].y = ip[0].y;
- for ( i=j=1; i<tot; ++i ) {
- if ( ip[i].x!=ip[i-1].x || ip[i].y!=ip[i-1].y ) {
- clipped[j].x = ip[i].x; clipped[j++].y = ip[i].y;
- }
- }
- clipped[j++] = clipped[0];
- GDrawFillPoly(pixmap,clipped,j,dhintcol);
-}
-
-static void CVShowMinimumDistance(CharView *cv, GWindow pixmap,MinimumDistance *md) {
- int x1,y1, x2,y2;
- int xa, ya;
- int off = cv->xoff+cv->height-cv->yoff;
-
- if (( md->x && !cv->showmdx ) || (!md->x && !cv->showmdy))
-return;
- if ( md->sp1==NULL && md->sp2==NULL )
-return;
- if ( md->sp1!=NULL ) {
- x1 = cv->xoff + rint( md->sp1->me.x*cv->scale );
- y1 = -cv->yoff + cv->height - rint(md->sp1->me.y*cv->scale);
- } else {
- x1 = cv->xoff + rint( cv->sc->width*cv->scale );
- y1 = 0x80000000;
- }
- if ( md->sp2!=NULL ) {
- x2 = cv->xoff + rint( md->sp2->me.x*cv->scale );
- y2 = -cv->yoff + cv->height - rint(md->sp2->me.y*cv->scale);
- } else {
- x2 = cv->xoff + rint( cv->sc->width*cv->scale );
- y2 = y1-8;
- }
- if ( y1==0x80000000 )
- y1 = y2-8;
- if ( md->x ) {
- ya = (y1+y2)/2;
- GDrawDrawArrow(pixmap, x1,ya, x2,ya, 2, mdhintcol);
- GDrawSetDashedLine(pixmap,5,5,off);
- GDrawDrawLine(pixmap, x1,ya, x1,y1, mdhintcol);
- GDrawDrawLine(pixmap, x2,ya, x2,y2, mdhintcol);
- } else {
- xa = (x1+x2)/2;
- GDrawDrawArrow(pixmap, xa,y1, xa,y2, 2, mdhintcol);
- GDrawSetDashedLine(pixmap,5,5,off);
- GDrawDrawLine(pixmap, xa,y1, x1,y1, mdhintcol);
- GDrawDrawLine(pixmap, xa,y2, x2,y2, mdhintcol);
- }
- GDrawSetDashedLine(pixmap,0,0,0);
-}
-
-static void dtos(char *buf,real val) {
- char *pt;
-
- sprintf( buf,"%.1f", (double) val);
- pt = buf+strlen(buf);
- if ( pt[-1]=='0' && pt[-2]=='.' ) pt[-2] = '\0';
-}
-
-static void CVDrawBlues(CharView *cv,GWindow pixmap,char *bluevals,char *others,
- Color col) {
- double blues[24];
- char *pt, *end;
- int i=0, bcnt=0;
- GRect r;
- char buf[20];
- int len,len2;
-
- if ( bluevals!=NULL ) {
- for ( pt = bluevals; isspace( *pt ) || *pt=='['; ++pt);
- while ( i<14 && *pt!='\0' && *pt!=']' ) {
- blues[i] = strtod(pt,&end);
- if ( pt==end )
- break;
- ++i;
- pt = end;
- while ( isspace( *pt )) ++pt;
- }
- if ( i&1 ) --i;
- }
- if ( others!=NULL ) {
- for ( pt = others; isspace( *pt ) || *pt=='['; ++pt);
- while ( i<24 && *pt!='\0' && *pt!=']' ) {
- blues[i] = strtod(pt,&end);
- if ( pt==end )
- break;
- ++i;
- pt = end;
- while ( isspace( *pt )) ++pt;
- }
- if ( i&1 ) --i;
- }
- bcnt = i;
- if ( i==0 )
-return;
-
- r.x = 0; r.width = cv->width;
- for ( i=0; i<bcnt; i += 2 ) {
- int first, other;
- first = -cv->yoff + cv->height - rint(blues[i]*cv->scale);
- other = -cv->yoff + cv->height - rint(blues[i+1]*cv->scale);
- r.y = first;
- if ( ( r.y<0 && other<0 ) || (r.y>cv->height && other>cv->height))
- continue;
- if ( r.y<0 ) r.y = 0;
- else if ( r.y>cv->height ) r.y = cv->height;
- if ( other<0 ) other = 0;
- else if ( other>cv->height ) other = cv->height;
- if ( other<r.y ) {
- r.height = r.y-other;
- r.y = other;
- } else
- r.height = other-r.y;
- if ( r.height==0 ) r.height = 1; /* show something */
- GDrawSetStippled(pixmap,2, 0,0);
- GDrawFillRect(pixmap,&r,col);
- GDrawSetStippled(pixmap,0, 0,0);
-
- if ( first>-20 && first<cv->height+20 ) {
- dtos( buf, blues[i]);
- len = GDrawGetText8Width(pixmap,buf,-1,NULL);
- GDrawDrawText8(pixmap,cv->width-len-5,first-3,buf,-1,NULL,hintlabelcol);
- } else
- len = 0;
- if ( other>-20 && other<cv->height+20 ) {
- dtos( buf, blues[i+1]-blues[i]);
- len2 = GDrawGetText8Width(pixmap,buf,-1,NULL);
- GDrawDrawText8(pixmap,cv->width-len-5-len2-5,other+cv->sas-3,buf,-1,NULL,hintlabelcol);
- }
- }
-}
-
-static void CVShowHints(CharView *cv, GWindow pixmap) {
- StemInfo *hint;
- GRect r;
- HintInstance *hi;
- int end;
- Color col;
- DStemInfo *dstem;
- MinimumDistance *md;
- char *blues, *others;
- struct psdict *private = cv->sc->parent->private;
- char buf[20];
- int len, len2;
- SplinePoint *sp;
- SplineSet *spl;
-
- GDrawSetFont(pixmap,cv->small);
- blues = PSDictHasEntry(private,"BlueValues"); others = PSDictHasEntry(private,"OtherBlues");
- if ( cv->showblues && (blues!=NULL || others!=NULL))
- CVDrawBlues(cv,pixmap,blues,others,bluevalstipplecol);
- blues = PSDictHasEntry(private,"FamilyBlues"); others = PSDictHasEntry(private,"FamilyOtherBlues");
- if ( cv->showfamilyblues && (blues!=NULL || others!=NULL))
- CVDrawBlues(cv,pixmap,blues,others,fambluestipplecol);
-
- if ( cv->showdhints ) for ( dstem = cv->sc->dstem; dstem!=NULL; dstem = dstem->next ) {
- CVShowDHint(cv,pixmap,dstem);
- }
-
- if ( cv->showhhints && cv->sc->hstem!=NULL ) {
- GDrawSetDashedLine(pixmap,5,5,cv->xoff);
- for ( hint = cv->sc->hstem; hint!=NULL; hint = hint->next ) {
- if ( hint->width<0 ) {
- r.y = -cv->yoff + cv->height - rint(hint->start*cv->scale);
- r.height = rint(-hint->width*cv->scale)+1;
- } else {
- r.y = -cv->yoff + cv->height - rint((hint->start+hint->width)*cv->scale);
- r.height = rint(hint->width*cv->scale)+1;
- }
- col = hint->active ? hhintactivecol : hhintcol;
- /* XRectangles are shorts! */
- if ( r.y<32767 && r.y+r.height>-32768 ) {
- if ( r.y<-32768 ) {
- r.height -= (-32768-r.y);
- r.y = -32768;
- }
- if ( r.y+r.height>32767 )
- r.height = 32767-r.y;
- for ( hi=hint->where; hi!=NULL; hi=hi->next ) {
- r.x = cv->xoff + rint(hi->begin*cv->scale);
- end = cv->xoff + rint(hi->end*cv->scale);
- if ( end>=0 && r.x<=cv->width ) {
- r.width = end-r.x+1;
- GDrawFillRect(pixmap,&r,col);
- }
- }
- }
- col = (!hint->active && hint->hasconflicts) ? conflicthintcol : col;
- if ( r.y>=0 && r.y<=cv->height )
- GDrawDrawLine(pixmap,0,r.y,cv->width,r.y,col);
- if ( r.y+r.height>=0 && r.y+r.height<=cv->width )
- GDrawDrawLine(pixmap,0,r.y+r.height-1,cv->width,r.y+r.height-1,col);
-
- r.y = -cv->yoff + cv->height - rint(hint->start*cv->scale);
- r.y += ( hint->width>0 ) ? -3 : cv->sas+3;
- if ( r.y>-20 && r.y<cv->height+20 ) {
- dtos( buf, hint->start);
- len = GDrawGetText8Width(pixmap,buf,-1,NULL);
- GDrawDrawText8(pixmap,cv->width-len-5,r.y,buf,-1,NULL,hintlabelcol);
- } else
- len = 0;
- r.y = -cv->yoff + cv->height - rint((hint->start+hint->width)*cv->scale);
- r.y += ( hint->width>0 ) ? cv->sas+3 : -3;
- if ( r.y>-20 && r.y<cv->height+20 ) {
- if ( hint->ghost ) {
- buf[0] = 'G';
- buf[1] = ' ';
- dtos(buf+2, hint->width);
- } else
- dtos( buf, hint->width);
- len2 = GDrawGetText8Width(pixmap,buf,-1,NULL);
- GDrawDrawText8(pixmap,cv->width-len-5-len2-5,r.y,buf,-1,NULL,hintlabelcol);
- }
- }
- }
- if ( cv->showvhints && cv->sc->vstem!=NULL ) {
- GDrawSetDashedLine(pixmap,5,5,cv->height-cv->yoff);
- for ( hint = cv->sc->vstem; hint!=NULL; hint = hint->next ) {
- if ( hint->width<0 ) {
- r.x = cv->xoff + rint( (hint->start+hint->width)*cv->scale );
- r.width = rint(-hint->width*cv->scale)+1;
- } else {
- r.x = cv->xoff + rint(hint->start*cv->scale);
- r.width = rint(hint->width*cv->scale)+1;
- }
- col = hint->active ? vhintactivecol : vhintcol;
- if ( r.x<32767 && r.x+r.width>-32768 ) {
- if ( r.x<-32768 ) {
- r.width -= (-32768-r.x);
- r.x = -32768;
- }
- if ( r.x+r.width>32767 )
- r.width = 32767-r.x;
- for ( hi=hint->where; hi!=NULL; hi=hi->next ) {
- r.y = -cv->yoff + cv->height - rint(hi->end*cv->scale);
- end = -cv->yoff + cv->height - rint(hi->begin*cv->scale);
- if ( end>=0 && r.y<=cv->height ) {
- r.height = end-r.y+1;
- GDrawFillRect(pixmap,&r,col);
- }
- }
- }
- col = (!hint->active && hint->hasconflicts) ? conflicthintcol : col;
- if ( r.x>=0 && r.x<=cv->width )
- GDrawDrawLine(pixmap,r.x,0,r.x,cv->height,col);
- if ( r.x+r.width>=0 && r.x+r.width<=cv->width )
- GDrawDrawLine(pixmap,r.x+r.width-1,0,r.x+r.width-1,cv->height,col);
-
- r.x = cv->xoff + rint(hint->start*cv->scale);
- if ( r.x>-60 && r.x<cv->width+20 ) {
- dtos( buf, hint->start);
- len = GDrawGetText8Width(pixmap,buf,-1,NULL);
- r.x += ( hint->width>0 ) ? 3 : -len-3;
- GDrawDrawText8(pixmap,r.x,cv->sas+3,buf,-1,NULL,hintlabelcol);
- }
- r.x = cv->xoff + rint((hint->start+hint->width)*cv->scale);
- if ( r.x>-60 && r.x<cv->width+20 ) {
- if ( hint->ghost ) {
- buf[0] = 'G';
- buf[1] = ' ';
- dtos(buf+2, hint->width);
- } else
- dtos( buf, hint->width);
- len = GDrawGetText8Width(pixmap,buf,-1,NULL);
- r.x += ( hint->width>0 ) ? -len-3 : 3;
- GDrawDrawText8(pixmap,r.x,cv->sas+cv->sfh+3,buf,-1,NULL,hintlabelcol);
- }
- }
- }
- GDrawSetDashedLine(pixmap,0,0,0);
-
- for ( md=cv->sc->md; md!=NULL; md=md->next )
- CVShowMinimumDistance(cv, pixmap,md);
-
- if ( cv->showvhints || cv->showhhints ) {
- for ( spl=cv->sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
- if ( spl->first->prev!=NULL ) for ( sp=spl->first ; ; ) {
- if ( cv->showhhints && sp->flexx ) {
- double x,y,end;
- x = cv->xoff + rint(sp->me.x*cv->scale);
- y = -cv->yoff + cv->height - rint(sp->me.y*cv->scale);
- end = cv->xoff + rint(sp->next->to->me.x*cv->scale);
- if ( x>-4096 && x<32767 && y>-4096 && y<32767 ) {
- GDrawDrawLine(pixmap,x,y,end,y,hflexhintcol);
- }
- }
- if ( cv->showvhints && sp->flexy ) {
- double x,y,end;
- x = cv->xoff + rint(sp->me.x*cv->scale);
- y = -cv->yoff + cv->height - rint(sp->me.y*cv->scale);
- end = -cv->yoff + cv->height - rint(sp->next->to->me.y*cv->scale);
- if ( x>-4096 && x<32767 && y>-4096 && y<32767 ) {
- GDrawDrawLine(pixmap,x,y,x,end,vflexhintcol);
- }
- }
- if ( sp->next==NULL ) /* This can happen if we get an internal error inside of RemoveOverlap when the pointlist is not in good shape */
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
- }
-}
-
-static void CVDrawRefName(CharView *cv,GWindow pixmap,RefChar *ref,int fg) {
- unichar_t namebuf[100];
- int x,y, len;
-
- x = cv->xoff + rint(ref->top.x*cv->scale);
- y = -cv->yoff + cv->height - rint(ref->top.y*cv->scale);
- y -= 5;
- if ( x<-400 || y<-40 || x>cv->width+400 || y>cv->height )
-return;
-
- uc_strncpy(namebuf,ref->sc->name,sizeof(namebuf)/sizeof(namebuf[0]));
- GDrawSetFont(pixmap,cv->small);
- len = GDrawGetTextWidth(pixmap,namebuf,-1,NULL);
- GDrawDrawText(pixmap,x-len/2,y,namebuf,-1,NULL,fg);
-}
-
-void DrawAnchorPoint(GWindow pixmap,int x, int y,int selected) {
- GPoint gp[9];
- Color col = anchorcol;
-
- gp[0].x = x-1; gp[0].y = y-1;
- gp[1].x = x; gp[1].y = y-6;
- gp[2].x = x+1; gp[2].y = y-1;
- gp[3].x = x+6; gp[3].y = y;
- gp[4].x = x+1; gp[4].y = y+1;
- gp[5].x = x; gp[5].y = y+6;
- gp[6].x = x-1; gp[6].y = y+1;
- gp[7].x = x-6; gp[7].y = y;
- gp[8] = gp[0];
- if ( selected )
- GDrawDrawPoly(pixmap,gp,9,col);
- else
- GDrawFillPoly(pixmap,gp,9,col);
-}
-
-static void CVDrawAnchorPoints(CharView *cv,GWindow pixmap) {
- int x,y, len, sel;
- Color col = anchorcol;
- AnchorPoint *ap;
- char *name, ubuf[40];
- GRect r;
-
- if ( cv->drawmode!=dm_fore || cv->sc->anchor==NULL || !cv->showanchor )
-return;
- GDrawSetFont(pixmap,cv->normal);
-
- for ( sel=0; sel<2; ++sel ) {
- for ( ap = cv->sc->anchor; ap!=NULL; ap=ap->next ) if ( ap->selected==sel ) {
- x = cv->xoff + rint(ap->me.x*cv->scale);
- y = -cv->yoff + cv->height - rint(ap->me.y*cv->scale);
- if ( x<-400 || y<-40 || x>cv->width+400 || y>cv->height )
- continue;
-
- DrawAnchorPoint(pixmap,x,y,ap->selected);
- if ( ap->anchor->type==act_mkmk ) {
- strncpy(ubuf,ap->anchor->name,20);
- strcat(ubuf," ");
- strcat(ubuf,ap->type==at_basemark ? _("Base") : _("Mark") );
- name = ubuf;
- } else if ( ap->type==at_basechar || ap->type==at_mark || ap->type==at_basemark ) {
- name = ap->anchor->name;
- } else if ( ap->type==at_centry || ap->type==at_cexit ) {
- strncpy(ubuf,ap->anchor->name,20);
- strcat(ubuf,ap->type==at_centry ? _("Entry") : _("Exit") );
- name = ubuf;
- } else if ( ap->type==at_baselig ) {
- strncpy(ubuf,ap->anchor->name,20);
- sprintf(ubuf+strlen(ubuf),"#%d", ap->lig_index);
- name = ubuf;
- } else
- name = NULL; /* Should never happen */
- len = GDrawGetText8Width(pixmap,name,-1,NULL);
- r.x = x-len/2; r.width = len;
- r.y = y+7; r.height = cv->nfh;
- GDrawFillRect(pixmap,&r,GDrawGetDefaultBackground(NULL));
- GDrawDrawText8(pixmap,x-len/2,y+7+cv->nas,name,-1,NULL,col);
- }
- }
-}
-
-static void DrawImageList(CharView *cv,GWindow pixmap,ImageList *backimages) {
- GRect size, temp;
- int x,y;
-
- GDrawGetSize(pixmap,&size);
-
- while ( backimages!=NULL ) {
- struct _GImage *base = backimages->image->list_len==0?
- backimages->image->u.image:backimages->image->u.images[0];
-
- temp = size;
- x = (int) (cv->xoff + rint(backimages->xoff * cv->scale));
- y = (int) (-cv->yoff + cv->height - rint(backimages->yoff*cv->scale));
- temp.x -= x; temp.y -= y;
-
- GDrawDrawImageMagnified(pixmap, backimages->image, &temp,
- x,y,
- (int) rint((base->width*backimages->xscale*cv->scale)),
- (int) rint((base->height*backimages->yscale*cv->scale)));
- backimages = backimages->next;
- }
-}
-
-static void DrawSelImageList(CharView *cv,GWindow pixmap,ImageList *images) {
- while ( images!=NULL ) {
- if ( images->selected )
- CVDrawBB(cv,pixmap,&images->bb);
- images = images->next;
- }
-}
-
-static void DrawOldState(CharView *cv, GWindow pixmap, Undoes *undo, DRect *clip) {
- RefChar *refs;
-
- if ( undo==NULL )
-return;
-
- CVDrawSplineSet(cv,pixmap,undo->u.state.splines,oldoutlinecol,false,clip);
- for ( refs=undo->u.state.refs; refs!=NULL; refs=refs->next )
- if ( refs->layers[0].splines!=NULL )
- CVDrawSplineSet(cv,pixmap,refs->layers[0].splines,oldoutlinecol,false,clip);
- /* Don't do images... */
-}
-
-static void DrawTransOrigin(CharView *cv, GWindow pixmap) {
- int x = rint(cv->p.cx*cv->scale) + cv->xoff, y = cv->height-cv->yoff-rint(cv->p.cy*cv->scale);
-
- GDrawDrawLine(pixmap,x-4,y,x+4,y,transformorigincol);
- GDrawDrawLine(pixmap,x,y-4,x,y+4,transformorigincol);
-}
-
-static void DrawVLine(CharView *cv,GWindow pixmap,real pos,Color fg, int flags, GImage *lock) {
- char buf[20];
- int x = cv->xoff + rint(pos*cv->scale);
- DrawLine(cv,pixmap,pos,-32768,pos,32767,fg);
- if ( flags&1 ) {
- if ( x>-400 && x<cv->width+400 ) {
- dtos( buf, pos);
- GDrawSetFont(pixmap,cv->small);
- GDrawDrawText8(pixmap,x+5,cv->sas+3,buf,-1,NULL,metricslabelcol);
- if ( lock!=NULL )
- GDrawDrawImage(pixmap,lock,NULL,x+5,3+cv->sfh);
- }
- }
- if ( ItalicConstrained && cv->sc->parent->italicangle!=0 ) {
- double s = sin(-cv->sc->parent->italicangle*3.1415926535897932/180.);
- int xoff = rint(8096*s);
- DrawLine(cv,pixmap,pos-xoff,-8096,pos+xoff,8096,italiccoordcol);
- }
-}
-
-static void DrawMMGhosts(CharView *cv,GWindow pixmap,DRect *clip) {
- /* In an MM font, draw any selected alternate versions of the current char */
- MMSet *mm = cv->sc->parent->mm;
- int j;
- SplineFont *sub;
- SplineChar *sc;
- RefChar *rf;
-
- if ( mm==NULL )
-return;
- for ( j = 0; j<mm->instance_count+1; ++j ) {
- if ( j==0 )
- sub = mm->normal;
- else
- sub = mm->instances[j-1];
- sc = NULL;
- if ( cv->sc->parent!=sub && (cv->mmvisible & (1<<j)) &&
- cv->sc->orig_pos<sub->glyphcnt )
- sc = sub->glyphs[cv->sc->orig_pos];
- if ( sc!=NULL ) {
- for ( rf=sc->layers[ly_fore].refs; rf!=NULL; rf = rf->next )
- CVDrawSplineSet(cv,pixmap,rf->layers[0].splines,backoutlinecol,false,clip);
- CVDrawSplineSet(cv,pixmap,sc->layers[ly_fore].splines,backoutlinecol,false,clip);
- }
- }
-}
-
-static void CVDrawGridRaster(CharView *cv, GWindow pixmap, DRect *clip ) {
- if ( cv->showgrids ) {
- /* Draw ppem grid, and the raster for truetype debugging, grid fit */
- GRect pixel;
- real grid_spacing = (cv->sc->parent->ascent+cv->sc->parent->descent) / (real) cv->ft_ppem;
- int max,jmax,ii,i,jj,j;
- int minx, maxx, miny, maxy, r,or;
- Color clut[256];
-
- pixel.width = pixel.height = grid_spacing*cv->scale+1;
- if ( cv->raster!=NULL ) {
- if ( cv->raster->num_greys>2 ) {
- int rb, gb, bb, rd, gd, bd;
- clut[0] = GDrawGetDefaultBackground(NULL);
- rb = COLOR_RED(clut[0]); gb = COLOR_GREEN(clut[0]); bb = COLOR_BLUE(clut[0]);
- rd = COLOR_RED(rasterdarkcol)-rb;
- gd = COLOR_GREEN(rasterdarkcol)-gb;
- bd = COLOR_BLUE(rasterdarkcol)-bb;
- for ( i=1; i<256; ++i ) {
- clut[i] = ( (rb +rd*(i)/0xff)<<16 ) |
- ( (gb+gd*(i)/0xff)<<8 ) |
- ( (bb+bd*(i)/0xff) );
- }
- }
- minx = cv->raster->lb; maxx = minx+cv->raster->cols;
- maxy = cv->raster->as; miny = maxy-cv->raster->rows;
- if ( cv->oldraster!=NULL ) {
- if ( cv->oldraster->lb<minx ) minx = cv->oldraster->lb;
- if ( cv->oldraster->lb+cv->oldraster->cols>maxx ) maxx = cv->oldraster->lb+cv->oldraster->cols;
- if ( cv->oldraster->as>maxy ) maxy = cv->oldraster->as;
- if ( cv->oldraster->as-cv->oldraster->rows<miny ) miny = cv->oldraster->as-cv->oldraster->rows;
- }
- for ( ii=maxy; ii>miny; --ii ) {
- for ( jj=minx; jj<maxx; ++jj ) {
- i = cv->raster->as-ii; j = jj-cv->raster->lb;
- if ( i<0 || i>=cv->raster->rows || j<0 || j>=cv->raster->cols )
- r = 0;
- else if ( cv->raster->num_greys<=2 )
- r = cv->raster->bitmap[i*cv->raster->bytes_per_row+(j>>3)] & (1<<(7-(j&7)));
- else
- r = cv->raster->bitmap[i*cv->raster->bytes_per_row+j];
- if ( cv->oldraster==NULL || cv->oldraster->num_greys!=cv->raster->num_greys)
- or = r;
- else {
- i = cv->oldraster->as-ii; j = jj-cv->oldraster->lb;
- if ( i<0 || i>=cv->oldraster->rows || j<0 || j>=cv->oldraster->cols )
- or = 0;
- else if ( cv->raster->num_greys<=2 )
- or = cv->oldraster->bitmap[i*cv->oldraster->bytes_per_row+(j>>3)] & (1<<(7-(j&7)));
- else
- or = cv->oldraster->bitmap[i*cv->oldraster->bytes_per_row+j];
- }
- if ( r || or ) {
- pixel.x = jj*grid_spacing*cv->scale + cv->xoff;
- pixel.y = cv->height-cv->yoff - rint(ii*grid_spacing*cv->scale);
- if ( cv->raster->num_greys<=2 )
- GDrawFillRect(pixmap,&pixel,(r && or) ? rastercol : r ? rasternewcol : rasteroldcol );
- else
- GDrawFillRect(pixmap,&pixel,(r-or>-16 && r-or<16) ? clut[r] : (clut[r]&0x00ff00) );
- }
- }
- }
- }
-
- for ( i = floor( clip->x/grid_spacing ), max = ceil((clip->x+clip->width)/grid_spacing);
- i<=max; ++i )
- DrawLine(cv,pixmap,i*grid_spacing,-32768,i*grid_spacing,32767,i==0?coordcol:rastergridcol);
- for ( i = floor( clip->y/grid_spacing ), max = ceil((clip->y+clip->height)/grid_spacing);
- i<=max; ++i )
- DrawLine(cv,pixmap,-32768,i*grid_spacing,32767,i*grid_spacing,i==0?coordcol:rastergridcol);
- if ( grid_spacing*cv->scale>=7 ) {
- for ( i = floor( clip->x/grid_spacing ), max = ceil((clip->x+clip->width)/grid_spacing);
- i<=max; ++i )
- for ( j = floor( clip->y/grid_spacing ), jmax = ceil((clip->y+clip->height)/grid_spacing);
- j<=jmax; ++j ) {
- int x = (i+.5)*grid_spacing*cv->scale + cv->xoff;
- int y = cv->height-cv->yoff - rint((j+.5)*grid_spacing*cv->scale);
- GDrawDrawLine(pixmap,x-2,y,x+2,y,rastergridcol);
- GDrawDrawLine(pixmap,x,y-2,x,y+2,rastergridcol);
- }
- }
- }
- if ( cv->showback ) {
- CVDrawSplineSet(cv,pixmap,cv->gridfit,gridfitoutlinecol,
- cv->showpoints,clip);
- }
-}
-
-static int APinSC(AnchorPoint *ap,SplineChar *sc) {
- /* Anchor points can be deleted ... */
- AnchorPoint *test;
-
- for ( test=sc->anchor; test!=NULL && test!=ap; test = test->next );
-return( test==ap );
-}
-
-static void DrawAPMatch(CharView *cv,GWindow pixmap,DRect *clip) {
- SplineChar *sc = cv->sc, *apsc = cv->apsc;
- SplineFont *sf = sc->parent;
- real trans[6];
- SplineSet *head, *tail, *temp;
- RefChar *ref;
-
- /* The other glyph might have been removed from the font */
- /* Either anchor might have been deleted. Be prepared for that to happen */
- if ( (apsc->orig_pos>=sf->glyphcnt || apsc->orig_pos<0) ||
- sf->glyphs[apsc->orig_pos]!=apsc ||
- !APinSC(cv->apmine,sc) || !APinSC(cv->apmatch,apsc)) {
- cv->apmine = cv->apmatch = NULL;
- cv->apsc =NULL;
-return;
- }
-
- /* Ok this isn't very accurate, but we are going to use the current glyph's*/
- /* coordinate system (because we're showing the current glyph), we should */
- /* always use the base character's coordinates, but that would screw up */
- /* editing of the current glyph if it happened to be the mark */
- trans[0] = trans[3] = 1;
- trans[1] = trans[2] = 0;
- trans[4] = cv->apmine->me.x - cv->apmatch->me.x;
- trans[5] = cv->apmine->me.y - cv->apmatch->me.y;
-
- head = tail = SplinePointListCopy(apsc->layers[ly_fore].splines);
- for ( ref = apsc->layers[ly_fore].refs; ref!=NULL; ref = ref->next ) {
- temp = SplinePointListCopy(ref->layers[0].splines);
- if ( head!=NULL ) {
- for ( ; tail->next!=NULL; tail = tail->next );
- tail->next = temp;
- } else
- head = tail = temp;
- }
- head = SplinePointListTransform(head,trans,true);
- CVDrawSplineSet(cv,pixmap,head,anchoredoutlinecol,
- false,clip);
- SplinePointListsFree(head);
- if ( cv->apmine->type==at_mark || cv->apmine->type==at_centry ) {
- DrawVLine(cv,pixmap,trans[4],anchoredoutlinecol,false,NULL);
- DrawLine(cv,pixmap,-8096,trans[5],8096,trans[5],anchoredoutlinecol);
- }
-}
-
-static void DrawPLine(CharView *cv,GWindow pixmap,int x1, int y1, int x2, int y2,Color col) {
-
- if ( x1==x2 || y1==y2 ) {
- if ( x1<0 ) x1=0;
- else if ( x1>cv->width ) x1 = cv->width;
- if ( x2<0 ) x2=0;
- else if ( x2>cv->width ) x2 = cv->width;
- if ( y1<0 ) y1=0;
- else if ( y1>cv->height ) y1 = cv->height;
- if ( y2<0 ) y2=0;
- else if ( y2>cv->height ) y2 = cv->height;
- } else if ( y1<-1000 || y2<-1000 || x1<-1000 || x2<-1000 ||
- y1>cv->height+1000 || y2>cv->height+1000 ||
- x1>cv->width+1000 || x2>cv->width+1000 )
-return;
- GDrawDrawLine(pixmap,x1,y1,x2,y2,col);
-}
-
-static void FindQuickBounds(SplineSet *ss,BasePoint **bounds) {
- SplinePoint *sp;
-
- for ( ; ss!=NULL; ss=ss->next ) {
- sp = ss->first;
- if ( sp->next==NULL || sp->next->to==sp ) /* Ignore contours with one point. Often tt points for moving references or anchors */
- continue;
- forever {
- if ( bounds[0]==NULL )
- bounds[0] = bounds[1] = bounds[2] = bounds[3] = &sp->me;
- else {
- if ( sp->me.x<bounds[0]->x ) bounds[0] = &sp->me;
- if ( sp->me.x>bounds[1]->x ) bounds[1] = &sp->me;
- if ( sp->me.y<bounds[2]->y ) bounds[2] = &sp->me;
- if ( sp->me.y>bounds[3]->y ) bounds[3] = &sp->me;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
-}
-
-static void CVSideBearings(GWindow pixmap, CharView *cv) {
- SplineChar *sc = cv->sc;
- RefChar *ref;
- BasePoint *bounds[4];
- int layer,l;
- int x,y, x2, y2;
- char buf[20];
-
- memset(bounds,0,sizeof(bounds));
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- FindQuickBounds(sc->layers[layer].splines,bounds);
- for ( ref=sc->layers[layer].refs; ref!=NULL; ref=ref->next )
- for ( l=0; l<ref->layer_cnt; ++l )
- FindQuickBounds(ref->layers[l].splines,bounds);
- }
-
- if ( bounds[0]==NULL )
-return; /* no points. no side bearings */
-
- GDrawSetFont(pixmap,cv->small);
- if ( cv->showhmetrics ) {
- if ( bounds[0]->x!=0 ) {
- x = rint(bounds[0]->x*cv->scale) + cv->xoff;
- y = cv->height-cv->yoff-rint(bounds[0]->y*cv->scale);
- DrawPLine(cv,pixmap,cv->xoff,y,x,y,metricslabelcol);
- /* arrow heads */
- DrawPLine(cv,pixmap,cv->xoff,y,cv->xoff+4,y+4,metricslabelcol);
- DrawPLine(cv,pixmap,cv->xoff,y,cv->xoff+4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y,x-4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y,x-4,y+4,metricslabelcol);
- dtos( buf, bounds[0]->x);
- x = cv->xoff + (x-cv->xoff-GDrawGetText8Width(pixmap,buf,-1,NULL))/2;
- GDrawDrawText8(pixmap,x,y-4,buf,-1,NULL,metricslabelcol);
- }
-
- if ( sc->width != bounds[1]->x ) {
- x = rint(bounds[1]->x*cv->scale) + cv->xoff;
- y = cv->height-cv->yoff-rint(bounds[1]->y*cv->scale);
- x2 = rint(sc->width*cv->scale) + cv->xoff;
- DrawPLine(cv,pixmap,x,y,x2,y,metricslabelcol);
- /* arrow heads */
- DrawPLine(cv,pixmap,x,y,x+4,y+4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y,x+4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x2,y,x2-4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x2,y,x2-4,y+4,metricslabelcol);
- dtos( buf, sc->width-bounds[1]->x);
- x = x + (x2-x-GDrawGetText8Width(pixmap,buf,-1,NULL))/2;
- GDrawDrawText8(pixmap,x,y-4,buf,-1,NULL,metricslabelcol);
- }
- }
-
- if ( cv->showvmetrics ) {
- x = rint(bounds[2]->x*cv->scale) + cv->xoff;
- y = cv->height-cv->yoff-rint(bounds[2]->y*cv->scale);
- y2 = cv->height-cv->yoff-rint(-sc->parent->descent*cv->scale);
- DrawPLine(cv,pixmap,x,y,x,y2,metricslabelcol);
- /* arrow heads */
- DrawPLine(cv,pixmap,x,y,x-4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y,x+4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y2,x+4,y2+4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y2,x-4,y2+4,metricslabelcol);
- dtos( buf, bounds[2]->y-sc->parent->descent);
- y = y + (y-y2-cv->sfh)/2;
- GDrawDrawText8(pixmap,x+4,y,buf,-1,NULL,metricslabelcol);
-
- x = rint(bounds[3]->x*cv->scale) + cv->xoff;
- y = cv->height-cv->yoff-rint(bounds[3]->y*cv->scale);
- y2 = cv->height-cv->yoff-rint(sc->parent->ascent*cv->scale);
- DrawPLine(cv,pixmap,x,y,x,y2,metricslabelcol);
- /* arrow heads */
- DrawPLine(cv,pixmap,x,y,x-4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y,x+4,y-4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y2,x+4,y2+4,metricslabelcol);
- DrawPLine(cv,pixmap,x,y2,x-4,y2+4,metricslabelcol);
- dtos( buf, sc->vwidth-bounds[3]->y);
- x = x + (x2-x-GDrawGetText8Width(pixmap,buf,-1,NULL))/2;
- GDrawDrawText8(pixmap,x,y-4,buf,-1,NULL,metricslabelcol);
- }
-}
-
-static void CVExpose(CharView *cv, GWindow pixmap, GEvent *event ) {
- SplineFont *sf = cv->sc->parent;
- RefChar *rf;
- GRect old;
- DRect clip;
- char buf[20];
- PST *pst; int i, layer, rlayer;
-
- GDrawPushClip(pixmap,&event->u.expose.rect,&old);
-
- clip.width = event->u.expose.rect.width/cv->scale;
- clip.height = event->u.expose.rect.height/cv->scale;
- clip.x = (event->u.expose.rect.x-cv->xoff)/cv->scale;
- clip.y = (cv->height-event->u.expose.rect.y-event->u.expose.rect.height-cv->yoff)/cv->scale;
-
- GDrawSetFont(pixmap,cv->small);
- GDrawSetLineWidth(pixmap,0);
-
- if ( !cv->show_ft_results && cv->dv==NULL ) {
- /* if we've got bg images (and we're showing them) then the hints live in */
- /* the bg image pixmap (else they get overwritten by the pixmap) */
- if ( (cv->showhhints || cv->showvhints || cv->showdhints) && ( cv->sc->layers[ly_back].images==NULL || !cv->showback) )
- CVShowHints(cv,pixmap);
-
- for ( layer = ly_back; layer<cv->sc->layer_cnt; ++layer ) if ( cv->sc->layers[layer].images!=NULL ) {
- if ( (( cv->showback || cv->drawmode==dm_back ) && layer==ly_back ) ||
- (( cv->showfore || cv->drawmode==dm_fore ) && layer>ly_back )) {
- /* This really should be after the grids, but then it would completely*/
- /* hide them. */
- GRect r;
- if ( cv->backimgs==NULL )
- cv->backimgs = GDrawCreatePixmap(GDrawGetDisplayOfWindow(cv->v),cv->width,cv->height);
- if ( cv->back_img_out_of_date ) {
- GDrawFillRect(cv->backimgs,NULL,GDrawGetDefaultBackground(GDrawGetDisplayOfWindow(cv->v)));
- if ( cv->showhhints || cv->showvhints || cv->showdhints)
- CVShowHints(cv,cv->backimgs);
- DrawImageList(cv,cv->backimgs,cv->sc->layers[layer].images);
- cv->back_img_out_of_date = false;
- }
- r.x = r.y = 0; r.width = cv->width; r.height = cv->height;
- GDrawDrawPixmap(pixmap,cv->backimgs,&r,0,0);
- }
- }
- if ( cv->showgrids || cv->drawmode==dm_grid ) {
- CVDrawSplineSet(cv,pixmap,cv->fv->sf->grid.splines,guideoutlinecol,
- cv->showpoints && cv->drawmode==dm_grid,&clip);
- }
- if ( cv->showhmetrics ) {
- DrawVLine(cv,pixmap,0,coordcol,false,NULL);
- DrawLine(cv,pixmap,-8096,0,8096,0,coordcol);
- DrawLine(cv,pixmap,-8096,sf->ascent,8096,sf->ascent,coordcol);
- DrawLine(cv,pixmap,-8096,-sf->descent,8096,-sf->descent,coordcol);
- }
- if ( cv->showvmetrics ) {
- DrawLine(cv,pixmap,(sf->ascent+sf->descent)/2,-8096,(sf->ascent+sf->descent)/2,8096,coordcol);
- DrawLine(cv,pixmap,-8096,sf->vertical_origin,8096,sf->vertical_origin,coordcol);
- }
-
- DrawSelImageList(cv,pixmap,cv->layerheads[cv->drawmode]->images);
-
- if (( cv->showfore || cv->drawmode==dm_fore ) && cv->showfilled ) {
- /* Wrong order, I know. But it is useful to have the background */
- /* visible on top of the fill... */
- cv->gi.u.image->clut->clut[1] = fillcol;
- GDrawDrawImage(pixmap, &cv->gi, NULL, cv->xoff + cv->filled->xmin,
- -cv->yoff + cv->height-cv->filled->ymax);
- cv->gi.u.image->clut->clut[1] = backimagecol;
- }
- } else {
- /* Draw FreeType Results */
- CVDrawGridRaster(cv,pixmap,&clip);
- }
-
- if ( cv->layerheads[cv->drawmode]->undoes!=NULL && cv->layerheads[cv->drawmode]->undoes->undotype==ut_tstate )
- DrawOldState(cv,pixmap,cv->layerheads[cv->drawmode]->undoes, &clip);
-
- if ( !cv->show_ft_results && cv->dv==NULL ) {
- if ( cv->showback || cv->drawmode==dm_back ) {
- /* Used to draw the image list here, but that's too slow. Optimization*/
- /* is to draw to pixmap, dump pixmap a bit earlier */
- /* Then when we moved the fill image around, we had to deal with the */
- /* images before the fill... */
- CVDrawLayerSplineSet(cv,pixmap,&cv->sc->layers[ly_back],backoutlinecol,
- cv->showpoints && cv->drawmode==dm_back,&clip);
- if ( cv->template1!=NULL )
- CVDrawTemplates(cv,pixmap,cv->template1,&clip);
- if ( cv->template2!=NULL )
- CVDrawTemplates(cv,pixmap,cv->template2,&clip);
- }
- if ( cv->mmvisible!=0 )
- DrawMMGhosts(cv,pixmap,&clip);
- }
-
- if ( cv->showfore || (cv->drawmode==dm_fore && !cv->show_ft_results && cv->dv==NULL)) {
- CVDrawAnchorPoints(cv,pixmap);
- for ( layer=ly_fore ; layer<cv->sc->layer_cnt; ++layer ) {
- for ( rf=cv->sc->layers[layer].refs; rf!=NULL; rf = rf->next ) {
- CVDrawRefName(cv,pixmap,rf,0);
- for ( rlayer=0; rlayer<rf->layer_cnt; ++rlayer )
- CVDrawSplineSet(cv,pixmap,rf->layers[rlayer].splines,foreoutlinecol,-1,&clip);
- if ( rf->selected && cv->layerheads[cv->drawmode]==&cv->sc->layers[layer])
- CVDrawBB(cv,pixmap,&rf->bb);
- }
-
- CVDrawLayerSplineSet(cv,pixmap,&cv->sc->layers[layer],foreoutlinecol,
- cv->showpoints && cv->drawmode==dm_fore,&clip);
- }
- }
-
- if ( cv->freehand.current_trace!=NULL )
- CVDrawSplineSet(cv,pixmap,cv->freehand.current_trace,tracecol,
- false,&clip);
-
- if ( cv->showhmetrics && cv->searcher==NULL ) {
- RefChar *lock = HasUseMyMetrics(cv->sc);
- if ( lock!=NULL ) cv->sc->width = lock->sc->width;
- DrawVLine(cv,pixmap,cv->sc->width,(!cv->inactive && cv->widthsel)?widthselcol:widthcol,true,
- lock!=NULL ? &GIcon_lock : NULL);
- for ( pst=cv->sc->possub; pst!=NULL && pst->type!=pst_lcaret; pst=pst->next );
- if ( pst!=NULL ) {
- for ( i=0; i<pst->u.lcaret.cnt; ++i )
- DrawVLine(cv,pixmap,pst->u.lcaret.carets[i],lcaretcol,true,NULL);
- }
- if ( cv->show_ft_results || cv->dv!=NULL )
- DrawVLine(cv,pixmap,cv->ft_gridfitwidth,widthgridfitcol,true,NULL);
- }
- if ( cv->showvmetrics ) {
- int len, y = -cv->yoff + cv->height - rint((sf->vertical_origin-cv->sc->vwidth)*cv->scale);
- DrawLine(cv,pixmap,-32768,sf->vertical_origin-cv->sc->vwidth,
- 32767,sf->vertical_origin-cv->sc->vwidth,
- (!cv->inactive && cv->vwidthsel)?widthselcol:widthcol);
- if ( y>-40 && y<cv->height+40 ) {
- dtos( buf, cv->sc->vwidth);
- GDrawSetFont(pixmap,cv->small);
- len = GDrawGetText8Width(pixmap,buf,-1,NULL);
- GDrawDrawText8(pixmap,cv->width-len-5,y,buf,-1,NULL,metricslabelcol);
- }
- }
- if ( cv->showsidebearings && cv->showfore &&
- (cv->showvmetrics || cv->showhmetrics))
- CVSideBearings(pixmap,cv);
-
- if ( cv->p.rubberbanding )
- CVDrawRubberRect(pixmap,cv);
- if ( cv->p.rubberlining )
- CVDrawRubberLine(pixmap,cv);
- if ((( cv->active_tool >= cvt_scale && cv->active_tool <= cvt_perspective ) ||
- cv->active_shape!=NULL ) &&
- cv->p.pressed )
- DrawTransOrigin(cv,pixmap);
- if ( cv->apmine!=NULL )
- DrawAPMatch(cv,pixmap,&clip);
-
- GDrawPopClip(pixmap,&old);
-}
-#endif
-
-void SCUpdateAll(SplineChar *sc) {
-#if defined(FONTFORGE_CONFIG_GTK)
- CharView *cv;
- struct splinecharlist *dlist;
-
- for ( cv=sc->views; cv!=NULL; cv=cv->next )
- gtk_widget_queue_draw(cv->v);
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next )
- SCUpdateAll(dlist->sc);
-#elif defined(FONTFORGE_CONFIG_GDRAW)
- CharView *cv;
- struct splinecharlist *dlist;
- MetricsView *mv;
- FontView *fv;
-
- for ( cv=sc->views; cv!=NULL; cv=cv->next )
- GDrawRequestExpose(cv->v,NULL,false);
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next )
- SCUpdateAll(dlist->sc);
- if ( sc->parent!=NULL ) {
- for ( fv = sc->parent->fv; fv!=NULL; fv=fv->nextsame )
- FVRegenChar(fv,sc);
- for ( mv = sc->parent->metrics; mv!=NULL; mv=mv->next )
- MVRegenChar(mv,sc);
- }
-#endif
-}
-
-void SCOutOfDateBackground(SplineChar *sc) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- CharView *cv;
-
- for ( cv=sc->views; cv!=NULL; cv=cv->next )
- cv->back_img_out_of_date = true;
-#endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void CVRegenFill(CharView *cv) {
- if ( cv->showfilled ) {
- BDFCharFree(cv->filled);
- cv->filled = SplineCharRasterize(cv->sc,cv->scale*(cv->fv->sf->ascent+cv->fv->sf->descent)+.1);
- cv->gi.u.image->data = cv->filled->bitmap;
- cv->gi.u.image->bytes_per_line = cv->filled->bytes_per_line;
- cv->gi.u.image->width = cv->filled->xmax-cv->filled->xmin+1;
- cv->gi.u.image->height = cv->filled->ymax-cv->filled->ymin+1;
- GDrawRequestExpose(cv->v,NULL,false);
- }
-}
-
-static void FVRedrawAllCharViews(FontView *fv) {
- int i;
- CharView *cv;
-
- for ( i=0; i<fv->sf->glyphcnt; ++i ) if ( fv->sf->glyphs[i]!=NULL )
- for ( cv = fv->sf->glyphs[i]->views; cv!=NULL; cv=cv->next )
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void SCRegenFills(SplineChar *sc) {
- struct splinecharlist *dlist;
- CharView *cv;
-
- for ( cv = sc->views; cv!=NULL; cv=cv->next )
- CVRegenFill(cv);
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next )
- SCRegenFills(dlist->sc);
-}
-
-static void SCRegenDependents(SplineChar *sc) {
- struct splinecharlist *dlist;
- FontView *fv;
-
- for ( fv = sc->parent->fv; fv!=NULL; fv=fv->nextsame ) {
- if ( fv->sv!=NULL ) {
- SCReinstanciateRef(&fv->sv->sc_srch,sc);
- SCReinstanciateRef(&fv->sv->sc_rpl,sc);
- }
- }
-
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next ) {
- SCReinstanciateRef(dlist->sc,sc);
- SCRegenDependents(dlist->sc);
- }
-}
-
-static void CVUpdateInfo(CharView *cv, GEvent *event) {
-
- cv->info_within = true;
- cv->e.x = event->u.mouse.x; cv->e.y = event->u.mouse.y;
- cv->info.x = (event->u.mouse.x-cv->xoff)/cv->scale;
- cv->info.y = (cv->height-event->u.mouse.y-cv->yoff)/cv->scale;
- CVInfoDraw(cv,cv->gw);
-}
-
-static void CVNewScale(CharView *cv) {
- GEvent e;
-
- CVRegenFill(cv);
- cv->back_img_out_of_date = true;
-
- GScrollBarSetBounds(cv->vsb,-20000*cv->scale,8000*cv->scale,cv->height);
- GScrollBarSetBounds(cv->hsb,-8000*cv->scale,32000*cv->scale,cv->width);
- GScrollBarSetPos(cv->vsb,cv->yoff-cv->height);
- GScrollBarSetPos(cv->hsb,-cv->xoff);
-
- GDrawRequestExpose(cv->v,NULL,false);
- if ( cv->showrulers )
- GDrawRequestExpose(cv->gw,NULL,false);
- GDrawGetPointerPosition(cv->v,&e);
- CVUpdateInfo(cv,&e);
-}
-
-static void _CVFit(CharView *cv,DBounds *b) {
- real left, right, top, bottom, hsc, wsc;
- extern int palettes_docked;
- int offset = palettes_docked ? 90 : 0;
- int em = cv->sc->parent->ascent + cv->sc->parent->descent;
- int hsmall = true;
-
- if ( offset>cv->width ) offset = 0;
-
- bottom = b->miny;
- top = b->maxy;
- left = b->minx;
- right = b->maxx;
-
- if ( top<bottom ) IError("Bottom bigger than top!");
- if ( right<left ) IError("Left bigger than right!");
- top -= bottom;
- right -= left;
- if ( top==0 ) top = em;
- if ( right==0 ) right = em;
- wsc = (cv->width-offset) / right;
- hsc = cv->height / top;
- if ( wsc<hsc ) { hsc = wsc; hsmall = false ; }
-
- cv->scale = hsc;
- if ( cv->scale > 1.0 ) {
- cv->scale = floor(2*cv->scale)/2;
- } else {
- cv->scale = 2/ceil(2/cv->scale);
- }
-
- cv->xoff = -left *cv->scale + offset;
- if ( hsmall )
- cv->yoff = -bottom*cv->scale;
- else
- cv->yoff = -(bottom+top/2)*cv->scale + cv->height/2;
-
- CVNewScale(cv);
-}
-
-static void CVFit(CharView *cv) {
- DBounds b;
- double center;
-
- SplineCharFindBounds(cv->sc,&b);
- if ( b.miny==0 && b.maxy==0 ) {
- b.maxy =cv->sc->parent->ascent;
- b.miny = -cv->sc->parent->descent;
- }
- if ( b.miny>=0 ) b.miny = -cv->sc->parent->descent;
- if ( b.minx>0 ) b.minx = 0;
- if ( b.maxx<0 ) b.maxx = 0;
- if ( b.maxy<0 ) b.maxy = 0;
- if ( b.maxx<cv->sc->width ) b.maxx = cv->sc->width;
- /* Now give some extra space around the interesting stuff */
- center = (b.maxx+b.minx)/2;
- b.minx = center - (center - b.minx)*1.2;
- b.maxx = center + (b.maxx - center)*1.2;
- center = (b.maxy+b.miny)/2;
- b.miny = center - (center - b.miny)*1.2;
- b.maxy = center + (b.maxy - center)*1.2;
-
- _CVFit(cv,&b);
-}
-
-static void CVUnlinkView(CharView *cv ) {
- CharView *test;
-
- if ( cv->sc->views == cv ) {
- cv->sc->views = cv->next;
- } else {
- for ( test=cv->sc->views; test->next!=cv && test->next!=NULL; test=test->next );
- if ( test->next==cv )
- test->next = cv->next;
- }
-}
-
-static GWindow CharIcon(CharView *cv, FontView *fv) {
- SplineChar *sc = cv->sc;
- BDFFont *bdf, *bdf2;
- BDFChar *bdfc;
- GWindow icon = cv->icon;
- GRect r;
-
- r.x = r.y = 0; r.width = r.height = fv->cbw-1;
- if ( icon == NULL )
- cv->icon = icon = GDrawCreateBitmap(NULL,r.width,r.width,NULL);
- GDrawFillRect(icon,&r,0x0); /* for some reason icons seem to be color reversed by my defn */
-
- bdf = NULL; bdfc = NULL;
- if ( sc->layers[ly_fore].refs!=NULL || sc->layers[ly_fore].splines!=NULL ) {
- bdf = fv->show;
- if ( sc->orig_pos>=bdf->glyphcnt || bdf->glyphs[sc->orig_pos]==NULL )
- bdf = fv->filled;
- if ( sc->orig_pos>=bdf->glyphcnt || bdf->glyphs[sc->orig_pos]==NULL ) {
- bdf2 = NULL; bdfc = NULL;
- for ( bdf=fv->sf->bitmaps; bdf!=NULL && bdf->pixelsize<24 ; bdf=bdf->next )
- bdf2 = bdf;
- if ( bdf2!=NULL && bdf!=NULL ) {
- if ( 24-bdf2->pixelsize < bdf->pixelsize-24 )
- bdf = bdf2;
- } else if ( bdf==NULL )
- bdf = bdf2;
- }
- if ( bdf!=NULL && sc->orig_pos<bdf->glyphcnt )
- bdfc = bdf->glyphs[sc->orig_pos];
- }
-
- if ( bdfc!=NULL ) {
- GClut clut;
- struct _GImage base;
- GImage gi;
- /* if not empty, use the font's own shape, otherwise use a standard */
- /* font */
- memset(&gi,'\0',sizeof(gi));
- memset(&base,'\0',sizeof(base));
- memset(&clut,'\0',sizeof(clut));
- gi.u.image = &base;
- base.trans = -1;
- base.clut = &clut;
- if ( bdfc->byte_data ) { int i;
- base.image_type = it_index;
- clut.clut_len = bdf->clut->clut_len;
- for ( i=0; i<clut.clut_len; ++i ) {
- int v = 255-i*255/(clut.clut_len-1);
- clut.clut[i] = COLOR_CREATE(v,v,v);
- }
- clut.trans_index = -1;
- } else {
- base.image_type = it_mono;
- clut.clut_len = 2;
- clut.clut[1] = 0xffffff;
- }
- base.data = bdfc->bitmap;
- base.bytes_per_line = bdfc->bytes_per_line;
- base.width = bdfc->xmax-bdfc->xmin+1;
- base.height = bdfc->ymax-bdfc->ymin+1;
- GDrawDrawImage(icon,&gi,NULL,(r.width-base.width)/2,(r.height-base.height)/2);
- } else if ( sc->unicodeenc!=-1 ) {
- FontRequest rq;
- GFont *font;
- static unichar_t times[] = { 't', 'i', 'm', 'e', 's',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };
- unichar_t text[2];
- int as, ds, ld, width;
-
- memset(&rq,0,sizeof(rq));
- rq.family_name = times;
- rq.point_size = 24;
- rq.weight = 400;
- font = GDrawInstanciateFont(NULL,&rq);
- GDrawSetFont(icon,font);
- text[0] = sc->unicodeenc; text[1] = 0;
- GDrawFontMetrics(font,&as,&ds,&ld);
- width = GDrawGetTextWidth(icon,text,1,NULL);
- GDrawDrawText(icon,(r.width-width)/2,(r.height-as-ds)/2+as,text,1,NULL,0xffffff);
- }
-return( icon );
-}
-
-static int CVCurEnc(CharView *cv) {
- if ( cv->map_of_enc == cv->fv->map && cv->enc!=-1 )
-return( cv->enc );
-
-return( cv->fv->map->backmap[cv->sc->orig_pos] );
-}
-
-static char *CVMakeTitles(CharView *cv,char *buf) {
- char *title;
- SplineChar *sc = cv->sc;
-
-/* GT: This is the title for a window showing an outline character */
-/* GT: It will look something like: */
-/* GT: exclam at 33 from Arial */
-/* GT: $1 is the name of the glyph */
-/* GT: $2 is the glyph's encoding */
-/* GT: $3 is the font name */
- sprintf(buf,_("%1$.80s at %2$d from %3$.90s"),
- sc->name, CVCurEnc(cv), sc->parent->fontname);
- if ( sc->changed )
- strcat(buf," *");
- title = copy(buf);
- if ( sc->unicodeenc!=-1 && sc->unicodeenc<0x110000 && _UnicodeNameAnnot!=NULL &&
- _UnicodeNameAnnot[sc->unicodeenc>>16][(sc->unicodeenc>>8)&0xff][sc->unicodeenc&0xff].name!=NULL ) {
- strcat(buf, " ");
- latin1_2_utf8_strcpy(buf+strlen(buf), _UnicodeNameAnnot[sc->unicodeenc>>16][(sc->unicodeenc>>8)&0xff][sc->unicodeenc&0xff].name);
- }
- if ( cv->show_ft_results || cv->dv )
- sprintf(buf+strlen(buf), " (%gpt, %ddpi)", (double) cv->ft_pointsize, cv->ft_dpi );
-return( title );
-}
-
-void SCRefreshTitles(SplineChar *sc) {
- /* Called if the user changes the unicode encoding or the character name */
- CharView *cv;
- char buf[300], *title;
-
- if ( sc->views==NULL )
-return;
- for ( cv = sc->views; cv!=NULL; cv=cv->next ) {
- title = CVMakeTitles(cv,buf);
- /* Could be different if one window is debugging and one is not */
- GDrawSetWindowTitles8(cv->gw,buf,title);
- free(title);
- }
-}
-
-static void CVChangeTabsVisibility(CharView *cv,int makevisible) {
- GRect gsize, pos, sbsize;
-
- if ( cv->tabs==NULL || GGadgetIsVisible(cv->tabs)==makevisible )
-return;
- GGadgetGetSize(cv->tabs,&gsize);
- GGadgetGetSize(cv->vsb,&sbsize);
- if ( makevisible ) {
- cv->mbh += gsize.height;
- cv->height -= gsize.height;
- GGadgetMove(cv->vsb,sbsize.x,sbsize.y+gsize.height);
- GGadgetResize(cv->vsb,sbsize.width,sbsize.height-gsize.height);
- } else {
- cv->mbh -= gsize.height;
- cv->height += gsize.height;
- GGadgetMove(cv->vsb,sbsize.x,sbsize.y-gsize.height);
- GGadgetResize(cv->vsb,sbsize.width,sbsize.height+gsize.height);
- }
- GGadgetSetVisible(cv->tabs,makevisible);
- cv->back_img_out_of_date = true;
- pos.x = 0; pos.y = cv->mbh+cv->infoh;
- pos.width = cv->width; pos.height = cv->height;
- if ( cv->showrulers ) {
- pos.x += cv->rulerh;
- pos.y += cv->rulerh;
- }
- GDrawMoveResize(cv->v,pos.x,pos.y,pos.width,pos.height);
- GDrawSync(NULL);
- GDrawRequestExpose(cv->v,NULL,false);
- GDrawRequestExpose(cv->gw,NULL,false);
-}
-
-void CVChangeSC(CharView *cv, SplineChar *sc ) {
- char *title;
- char buf[300];
- extern int updateflex;
- int i;
-
- CVDebugFree(cv->dv);
-
- if ( cv->expandedge != ee_none ) {
- GDrawSetCursor(cv->v,ct_mypointer);
- cv->expandedge = ee_none;
- }
-
- SplinePointListsFree(cv->gridfit); cv->gridfit = NULL;
- FreeType_FreeRaster(cv->oldraster); cv->oldraster = NULL;
- FreeType_FreeRaster(cv->raster); cv->raster = NULL;
-
- SCLigCaretCheck(sc,false);
-
- CVUnlinkView(cv);
- cv->p.nextcp = cv->p.prevcp = cv->widthsel = cv->vwidthsel = false;
- if ( sc->views==NULL && updateflex )
- SplineCharIsFlexible(sc);
- cv->sc = sc;
- cv->next = sc->views;
- sc->views = cv;
- cv->layerheads[dm_fore] = &sc->layers[ly_fore];
- cv->layerheads[dm_back] = &sc->layers[ly_back];
- cv->layerheads[dm_grid] = &sc->parent->grid;
- cv->p.sp = cv->lastselpt = NULL;
- cv->apmine = cv->apmatch = NULL; cv->apsc = NULL;
- cv->template1 = cv->template2 = NULL;
-#if HANYANG
- if ( cv->sc->parent->rules!=NULL && cv->sc->compositionunit )
- Disp_DefaultTemplate(cv);
-#endif
- if ( cv->showpointnumbers || cv->show_ft_results )
- SCNumberPoints(sc);
- if ( cv->show_ft_results )
- CVGridFitChar(cv);
-
- CVNewScale(cv);
-
- CharIcon(cv,cv->fv);
- title = CVMakeTitles(cv,buf);
- GDrawSetWindowTitles8(cv->gw,buf,title);
- cv->lastselpt = NULL; cv->p.sp = NULL;
- CVInfoDraw(cv,cv->gw);
- free(title);
- _CVPaletteActivate(cv,true);
-
- if ( cv->tabs!=NULL ) {
- for ( i=0; i<cv->former_cnt; ++i )
- if ( strcmp(cv->former_names[i],sc->name)==0 )
- break;
- if ( i!=cv->former_cnt && cv->showtabs )
- GTabSetSetSel(cv->tabs,i);
- else {
- if ( cv->former_cnt==FORMER_MAX )
- free(cv->former_names[FORMER_MAX-1]);
- for ( i=cv->former_cnt<FORMER_MAX?cv->former_cnt-1:FORMER_MAX-2; i>=0; --i )
- cv->former_names[i+1] = cv->former_names[i];
- cv->former_names[0] = copy(sc->name);
- if ( cv->former_cnt<FORMER_MAX )
- ++cv->former_cnt;
- for ( i=0; i<cv->former_cnt; ++i )
- GTabSetChangeTabName(cv->tabs,cv->former_names[i],i);
- GTabSetRemetric(cv->tabs);
- GTabSetSetSel(cv->tabs,0); /* This does a redraw */
- if ( !GGadgetIsVisible(cv->tabs) && cv->showtabs )
- CVChangeTabsVisibility(cv,true);
- }
- }
-}
-
-static void CVChangeChar(CharView *cv, int i ) {
- SplineChar *sc;
- SplineFont *sf = cv->sc->parent;
- EncMap *map = cv->fv->map;
- int gid = i<0 || i>= map->enccount ? -2 : map->map[i];
-
- if ( gid == -2 )
-return;
- if ( gid==-1 || (sc = sf->glyphs[gid])==NULL )
- sc = SFMakeChar(sf,map,i);
-
- if ( sc==NULL || (cv->sc == sc && cv->enc==i ))
-return;
- cv->map_of_enc = map;
- cv->enc = i;
- CVChangeSC(cv,sc);
-}
-
-static int CVChangeToFormer( GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- CharView *cv = GDrawGetUserData(GGadgetGetWindow(g));
- int new_aspect = GTabSetGetSel(g);
- SplineFont *sf = cv->sc->parent;
- int gid;
-
- for ( gid=sf->glyphcnt-1; gid>=0; --gid )
- if ( sf->glyphs[gid]!=NULL &&
- strcmp(sf->glyphs[gid]->name,cv->former_names[new_aspect])==0 )
- break;
- if ( gid<0 ) {
- /* They changed the name? See if we can get a unicode value from it */
- int unienc = UniFromName(cv->former_names[new_aspect],sf->uni_interp,cv->fv->map->enc);
- if ( unienc>=0 ) {
- gid = SFFindGID(sf,unienc,cv->former_names[new_aspect]);
- if ( gid>=0 ) {
- free(cv->former_names[new_aspect]);
- cv->former_names[new_aspect] = copy(sf->glyphs[gid]->name);
- }
- }
- }
- if ( gid<0 )
-return( true );
- CVChangeSC(cv,sf->glyphs[gid]);
- }
-return( true );
-}
-
-static void CVClear(GWindow,GMenuItem *mi, GEvent *);
-static void CVMouseMove(CharView *cv, GEvent *event );
-static void CVMouseUp(CharView *cv, GEvent *event );
-static void CVHScroll(CharView *cv,struct sbevent *sb);
-static void CVVScroll(CharView *cv,struct sbevent *sb);
-static void CVElide(GWindow gw,struct gmenuitem *mi,GEvent *e);
-static void CVMerge(GWindow gw,struct gmenuitem *mi,GEvent *e);
-static void SVElide(GWindow gw,struct gmenuitem *mi,GEvent *e);
-static void SVMerge(GWindow gw,struct gmenuitem *mi,GEvent *e);
-static void CVMenuSimplify(GWindow gw,struct gmenuitem *mi,GEvent *e);
-static void CVMenuSimplifyMore(GWindow gw,struct gmenuitem *mi,GEvent *e);
-static void SVMenuSimplify(GWindow gw,struct gmenuitem *mi,GEvent *e);
-#if 0
-static void SVMenuSimplifyMore(GWindow gw,struct gmenuitem *mi,GEvent *e);
-#endif
-
-
-static void CVFakeMove(CharView *cv, GEvent *event) {
- GEvent e;
-
- memset(&e,0,sizeof(e));
- e.type = et_mousemove;
- e.w = cv->v;
- if ( event->w!=cv->v ) {
- GPoint p;
- p.x = event->u.chr.x; p.y = event->u.chr.y;
- GDrawTranslateCoordinates(event->w,cv->v,&p);
- event->u.chr.x = p.x; event->u.chr.y = p.y;
- }
- e.u.mouse.state = TrueCharState(event);
- e.u.mouse.x = event->u.chr.x;
- e.u.mouse.y = event->u.chr.y;
- e.u.mouse.device = NULL;
- CVMouseMove(cv,&e);
-}
-
-static void CVDoFindInFontView(CharView *cv) {
- FVChangeChar(cv->fv,CVCurEnc(cv));
- GDrawSetVisible(cv->fv->gw,true);
- GDrawRaise(cv->fv->gw);
-}
-
-static void CVCharUp(CharView *cv, GEvent *event ) {
-#if _ModKeysAutoRepeat
- /* Under cygwin these keys auto repeat, they don't under normal X */
- if ( event->u.chr.keysym == GK_Shift_L || event->u.chr.keysym == GK_Shift_R ||
- event->u.chr.keysym == GK_Control_L || event->u.chr.keysym == GK_Control_R ||
- event->u.chr.keysym == GK_Meta_L || event->u.chr.keysym == GK_Meta_R ||
- event->u.chr.keysym == GK_Alt_L || event->u.chr.keysym == GK_Alt_R ||
- event->u.chr.keysym == GK_Super_L || event->u.chr.keysym == GK_Super_R ||
- event->u.chr.keysym == GK_Hyper_L || event->u.chr.keysym == GK_Hyper_R ) {
- if ( cv->autorpt!=NULL ) {
- GDrawCancelTimer(cv->autorpt);
- CVToolsSetCursor(cv,cv->oldstate,NULL);
- }
- cv->keysym = event->u.chr.keysym;
- cv->oldkeyx = event->u.chr.x;
- cv->oldkeyy = event->u.chr.y;
- cv->oldkeyw = event->w;
- cv->oldstate = TrueCharState(event);
- cv->autorpt = GDrawRequestTimer(cv->v,100,0,NULL);
- } else {
- if ( cv->autorpt!=NULL ) {
- GDrawCancelTimer(cv->autorpt); cv->autorpt=NULL;
- CVToolsSetCursor(cv,cv->oldstate,NULL);
- }
- CVToolsSetCursor(cv,TrueCharState(event),NULL);
- }
-#else
- CVToolsSetCursor(cv,TrueCharState(event),NULL);
- if ( event->u.chr.keysym == GK_Shift_L || event->u.chr.keysym == GK_Shift_R ||
- event->u.chr.keysym == GK_Alt_L || event->u.chr.keysym == GK_Alt_R ||
- event->u.chr.keysym == GK_Meta_L || event->u.chr.keysym == GK_Meta_R )
- CVFakeMove(cv, event);
-#endif
-}
-
-static void CVInfoDrawText(CharView *cv, GWindow pixmap ) {
- GRect r;
- Color bg = GDrawGetDefaultBackground(GDrawGetDisplayOfWindow(pixmap));
- Color fg = GDrawGetDefaultForeground(GDrawGetDisplayOfWindow(pixmap));
- char buffer[50];
- unichar_t ubuffer[50];
- int ybase = cv->mbh+(cv->infoh-cv->sfh)/2+cv->sas;
- real xdiff, ydiff;
- SplinePoint *sp, dummy;
-
- GDrawSetFont(pixmap,cv->small);
- r.x = RPT_DATA; r.width = 60;
- r.y = cv->mbh; r.height = cv->infoh-1;
- GDrawFillRect(pixmap,&r,bg);
- r.x = SPT_DATA; r.width = 60;
- GDrawFillRect(pixmap,&r,bg);
- r.x = SOF_DATA; r.width = 60;
- GDrawFillRect(pixmap,&r,bg);
- r.x = SDS_DATA; r.width = 30;
- GDrawFillRect(pixmap,&r,bg);
- r.x = SAN_DATA; r.width = 30;
- GDrawFillRect(pixmap,&r,bg);
- r.x = MAG_DATA; r.width = 60;
- GDrawFillRect(pixmap,&r,bg);
- r.x = LAYER_DATA; r.width = 60;
- GDrawFillRect(pixmap,&r,bg);
- r.x = CODERANGE_DATA; r.width = 60;
- GDrawFillRect(pixmap,&r,bg);
-
- if ( cv->info_within ) {
- if ( cv->info.x>=1000 || cv->info.x<=-1000 || cv->info.y>=1000 || cv->info.y<=-1000 )
- sprintf(buffer,"%d%s%d", (int) cv->info.x, coord_sep, (int) cv->info.y );
- else
- sprintf(buffer,"%.4g%s%.4g", (double) cv->info.x, coord_sep, (double) cv->info.y );
- buffer[11] = '\0';
- uc_strcpy(ubuffer,buffer);
- GDrawDrawText(pixmap,RPT_DATA,ybase,ubuffer,-1,NULL,fg);
- }
- if ( cv->scale>=.25 )
- sprintf( buffer, "%d%%", (int) (100*cv->scale));
- else
- sprintf( buffer, "%.3g%%", (double) (100*cv->scale));
- uc_strcpy(ubuffer,buffer);
- GDrawDrawText(pixmap,MAG_DATA,ybase,ubuffer,-1,NULL,fg);
- GDrawDrawText8(pixmap,LAYER_DATA,ybase,
-/* GT: Foreground, make it short */
- cv->drawmode==dm_fore ? _("Fore") :
-/* GT: Background, make it short */
- cv->drawmode==dm_back ? _("Back") :
-/* GT: Guide layer, make it short */
- _("Guide"),
- -1,NULL,fg);
- if ( cv->coderange!=cr_none )
- GDrawDrawText8(pixmap,CODERANGE_DATA,ybase,
- cv->coderange==cr_fpgm ? _("'fpgm'") :
- cv->coderange==cr_prep ? _("'prep'") : _("Glyph"),
- -1,NULL,fg);
- sp = cv->p.sp!=NULL ? cv->p.sp : cv->lastselpt;
- if ( sp==NULL ) if ( cv->active_tool==cvt_rect || cv->active_tool==cvt_elipse ||
- cv->active_tool==cvt_poly || cv->active_tool==cvt_star ) {
- dummy.me.x = cv->p.cx; dummy.me.y = cv->p.cy;
- sp = &dummy;
- }
- if ( sp ) {
- real selx, sely;
- if ( cv->pressed && sp==cv->p.sp ) {
- selx = cv->p.constrain.x;
- sely = cv->p.constrain.y;
- } else {
- selx = sp->me.x;
- sely = sp->me.y;
- }
- xdiff=cv->info.x-selx;
- ydiff = cv->info.y-sely;
-
- if ( selx>=1000 || selx<=-1000 || sely>=1000 || sely<=-1000 )
- sprintf(buffer,"%d%s%d", (int) selx, coord_sep, (int) sely );
- else
- sprintf(buffer,"%.4g%s%.4g", (double) selx, coord_sep, (double) sely );
- buffer[11] = '\0';
- uc_strcpy(ubuffer,buffer);
- GDrawDrawText(pixmap,SPT_DATA,ybase,ubuffer,-1,NULL,fg);
- } else if ( cv->widthsel && cv->info_within ) {
- xdiff = cv->info.x-cv->p.cx;
- ydiff = 0;
- } else if ( cv->p.rubberbanding && cv->info_within ) {
- xdiff=cv->info.x-cv->p.cx;
- ydiff = cv->info.y-cv->p.cy;
- } else
-return;
- if ( !cv->info_within )
-return;
-
- if ( xdiff>=1000 || xdiff<=-1000 || ydiff>=1000 || ydiff<=-1000 )
- sprintf(buffer,"%d%s%d", (int) xdiff, coord_sep, (int) ydiff );
- else
- sprintf(buffer,"%.4g%s%.4g", (double) xdiff, coord_sep, (double) ydiff );
- buffer[11] = '\0';
- uc_strcpy(ubuffer,buffer);
- GDrawDrawText(pixmap,SOF_DATA,ybase,ubuffer,-1,NULL,fg);
-
- sprintf( buffer, "%.1f", sqrt(xdiff*xdiff+ydiff*ydiff));
- uc_strcpy(ubuffer,buffer);
- GDrawDrawText(pixmap,SDS_DATA,ybase,ubuffer,-1,NULL,fg);
-
- sprintf( buffer, "%d\260", (int) rint(180*atan2(ydiff,xdiff)/3.1415926535897932));
- uc_strcpy(ubuffer,buffer);
- GDrawDrawText(pixmap,SAN_DATA,ybase,ubuffer,-1,NULL,fg);
-}
-
-static void CVInfoDrawRulers(CharView *cv, GWindow pixmap ) {
- int rstart = cv->mbh+cv->infoh;
- GDrawSetXORMode(pixmap);
- GDrawSetXORBase(pixmap,GDrawGetDefaultBackground(NULL));
- GDrawSetLineWidth(pixmap,0);
- if ( cv->olde.x!=-1 ) {
- GDrawDrawLine(pixmap,cv->olde.x+cv->rulerh,rstart,cv->olde.x+cv->rulerh,rstart+cv->rulerh,0xff0000);
- GDrawDrawLine(pixmap,0,cv->olde.y+rstart+cv->rulerh,cv->rulerh,cv->olde.y+rstart+cv->rulerh,0xff0000);
- }
- GDrawDrawLine(pixmap,cv->e.x+cv->rulerh,rstart,cv->e.x+cv->rulerh,rstart+cv->rulerh,0xff0000);
- GDrawDrawLine(pixmap,0,cv->e.y+rstart+cv->rulerh,cv->rulerh,cv->e.y+rstart+cv->rulerh,0xff0000);
- cv->olde = cv->e;
- GDrawSetCopyMode(pixmap);
-}
-
-void CVInfoDraw(CharView *cv, GWindow pixmap ) {
- CVInfoDrawText(cv,pixmap);
- if ( cv->showrulers )
- CVInfoDrawRulers(cv,pixmap);
-}
-
-static void CVCrossing(CharView *cv, GEvent *event ) {
- CVToolsSetCursor(cv,event->u.mouse.state,event->u.mouse.device);
- cv->info_within = event->u.crossing.entered;
- cv->info.x = (event->u.crossing.x-cv->xoff)/cv->scale;
- cv->info.y = (cv->height-event->u.crossing.y-cv->yoff)/cv->scale;
- CVInfoDraw(cv,cv->gw);
- CPEndInfo(cv);
-}
-
-static int CheckPoint(FindSel *fs, SplinePoint *sp, SplineSet *spl) {
-
- if ( fs->xl<=sp->me.x && fs->xh>=sp->me.x &&
- fs->yl<=sp->me.y && fs->yh >= sp->me.y ) {
- fs->p->sp = sp;
- fs->p->spline = NULL;
- fs->p->anysel = true;
- fs->p->spl = spl;
- if ( !fs->seek_controls )
-return( true );
- }
- if ( (sp->selected && fs->select_controls) || fs->all_controls ) {
- if ( fs->xl<=sp->nextcp.x && fs->xh>=sp->nextcp.x &&
- fs->yl<=sp->nextcp.y && fs->yh >= sp->nextcp.y ) {
- fs->p->sp = sp;
- fs->p->spline = NULL;
- fs->p->spl = spl;
- fs->p->nextcp = true;
- fs->p->anysel = true;
- fs->p->cp = sp->nextcp;
- if ( sp->nonextcp && sp->pointtype==pt_curve ) {
- fs->p->cp.x = sp->me.x + (sp->me.x-sp->prevcp.x);
- fs->p->cp.y = sp->me.y + (sp->me.y-sp->prevcp.y);
- }
- sp->selected = true;
-return( true );
- } else if ( fs->xl<=sp->prevcp.x && fs->xh>=sp->prevcp.x &&
- fs->yl<=sp->prevcp.y && fs->yh >= sp->prevcp.y ) {
- fs->p->sp = sp;
- fs->p->spline = NULL;
- fs->p->spl = spl;
- fs->p->prevcp = true;
- fs->p->anysel = true;
- fs->p->cp = sp->prevcp;
- if ( sp->noprevcp && sp->pointtype==pt_curve ) {
- fs->p->cp.x = sp->me.x + (sp->me.x-sp->nextcp.x);
- fs->p->cp.y = sp->me.y + (sp->me.y-sp->nextcp.y);
- }
- sp->selected = true;
-return( true );
- }
- }
-return( false );
-}
-
-static int CheckSpline(FindSel *fs, Spline *spline, SplineSet *spl) {
-
- /* Anything else is better than a spline */
- if ( fs->p->anysel )
-return( false );
-
- if ( NearSpline(fs,spline)) {
- fs->p->spline = spline;
- fs->p->spl = spl;
- fs->p->anysel = true;
-return( false /*true*/ ); /* Check if there's a point where we are first */
- /* if there is use it, if not (because anysel is true) we'll fall back */
- /* here */
- }
-return( false );
-}
-
-static int InImage( FindSel *fs, ImageList *img) {
- int x,y;
-
- x = floor((fs->p->cx-img->xoff)/img->xscale);
- y = floor((img->yoff-fs->p->cy)/img->yscale);
- if ( x<0 || y<0 || x>=GImageGetWidth(img->image) || y>=GImageGetHeight(img->image))
-return ( false );
- if ( GImageGetPixelColor(img->image,x,y)&0x80000000 ) /* Transparent */
-return( false );
-
-return( true );
-}
-
-static int InSplineSet( FindSel *fs, SplinePointList *set) {
- SplinePointList *spl;
- Spline *spline, *first;
-
- for ( spl = set; spl!=NULL; spl = spl->next ) {
- if ( CheckPoint(fs,spl->first,spl) && ( !fs->seek_controls || fs->p->nextcp || fs->p->prevcp )) {
-return( true );
- }
- first = NULL;
- for ( spline = spl->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
- if ( (CheckPoint(fs,spline->to,spl) && ( !fs->seek_controls || fs->p->nextcp || fs->p->prevcp )) ||
- ( CheckSpline(fs,spline,spl) && !fs->seek_controls )) {
-return( true );
- }
- if ( first==NULL ) first = spline;
- }
- }
-return( fs->p->anysel );
-}
-
-static int NearSplineSetPoints( FindSel *fs, SplinePointList *set) {
- SplinePointList *spl;
- Spline *spline, *first;
-
- for ( spl = set; spl!=NULL; spl = spl->next ) {
- if ( CheckPoint(fs,spl->first,spl)) {
-return( true );
- }
- first = NULL;
- for ( spline = spl->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
- if ( CheckPoint(fs,spline->to,spl) ) {
-return( true );
- }
- if ( first==NULL ) first = spline;
- }
- }
-return( fs->p->anysel );
-}
-
-static void SetFS( FindSel *fs, PressedOn *p, CharView *cv, GEvent *event) {
- extern float snapdistance;
-
- memset(p,'\0',sizeof(PressedOn));
- p->pressed = true;
-
- memset(fs,'\0',sizeof(*fs));
- fs->p = p;
- fs->e = event;
- p->x = event->u.mouse.x;
- p->y = event->u.mouse.y;
- p->cx = (event->u.mouse.x-cv->xoff)/cv->scale;
- p->cy = (cv->height-event->u.mouse.y-cv->yoff)/cv->scale;
-
- fs->fudge = snapdistance/cv->scale; /* 3.5 pixel fudge */
- fs->xl = p->cx - fs->fudge;
- fs->xh = p->cx + fs->fudge;
- fs->yl = p->cy - fs->fudge;
- fs->yh = p->cy + fs->fudge;
-}
-
-int CVMouseAtSpline(CharView *cv,GEvent *event) {
- FindSel fs;
- int pressed = cv->p.pressed;
-
- SetFS(&fs,&cv->p,cv,event);
- cv->p.pressed = pressed;
-return( InSplineSet(&fs,cv->layerheads[cv->drawmode]->splines));
-}
-
-static GEvent *CVConstrainedMouseDown(CharView *cv,GEvent *event, GEvent *fake) {
- SplinePoint *base;
- int basex, basey, dx, dy;
- int sign;
-
- base = CVAnySelPoint(cv);
- if ( base==NULL )
-return( event );
-
- basex = cv->xoff + rint(base->me.x*cv->scale);
- basey = -cv->yoff + cv->height - rint(base->me.y*cv->scale);
-
- dx= event->u.mouse.x-basex, dy = event->u.mouse.y-basey;
- sign = dx*dy<0?-1:1;
-
- fake->u.mouse = event->u.mouse;
- if ( dx<0 ) dx = -dx; if ( dy<0 ) dy = -dy;
- if ( dy >= 2*dx ) {
- cv->p.x = fake->u.mouse.x = basex;
- cv->p.cx = base->me.x;
- if ( !(event->u.mouse.state&ksm_alt) &&
- ItalicConstrained && cv->sc->parent->italicangle!=0 ) {
- double off = tan(cv->sc->parent->italicangle*3.1415926535897932/180)*
- (cv->p.cy-base->me.y);
- double aoff = off<0 ? -off : off;
- if ( dx>=aoff*cv->scale/2 && (event->u.mouse.x-basex<0)!=(off<0) ) {
- cv->p.cx -= off;
- cv->p.x = fake->u.mouse.x = cv->xoff + rint(cv->p.cx*cv->scale);
- }
- }
- } else if ( dx >= 2*dy ) {
- fake->u.mouse.y = basey;
- cv->p.cy = base->me.y;
- } else if ( dx > dy ) {
- fake->u.mouse.x = basex + sign * (event->u.mouse.y-cv->p.y);
- cv->p.cx = base->me.x - sign * (cv->p.cy-base->me.y);
- } else {
- fake->u.mouse.y = basey + sign * (event->u.mouse.x-cv->p.x);
- cv->p.cy = base->me.y - sign * (cv->p.cx-base->me.x);
- }
-
-return( fake );
-}
-
-static void CVSetConstrainPoint(CharView *cv, GEvent *event) {
- SplineSet *sel;
-
- if ( (sel = CVAnySelPointList(cv))!=NULL ) {
- if ( sel->first->selected ) cv->p.constrain = sel->first->me;
- else cv->p.constrain = sel->last->me;
- } else if ( cv->p.sp!=NULL ) {
- cv->p.constrain = cv->p.sp->me;
- } else {
- cv->p.constrain.x = cv->info.x;
- cv->p.constrain.y = cv->info.y;
- }
-}
-
-static void CVDoSnaps(CharView *cv, FindSel *fs) {
- PressedOn *p = fs->p;
-
-#if 1
- if ( cv->drawmode!=dm_grid && cv->layerheads[dm_grid]->splines!=NULL ) {
- PressedOn temp;
- int oldseek = fs->seek_controls;
- temp = *p;
- fs->p = &temp;
- fs->seek_controls = false;
- if ( InSplineSet( fs, cv->layerheads[dm_grid]->splines)) {
- if ( temp.spline!=NULL ) {
- p->cx = ((temp.spline->splines[0].a*temp.t+
- temp.spline->splines[0].b)*temp.t+
- temp.spline->splines[0].c)*temp.t+
- temp.spline->splines[0].d;
- p->cy = ((temp.spline->splines[1].a*temp.t+
- temp.spline->splines[1].b)*temp.t+
- temp.spline->splines[1].c)*temp.t+
- temp.spline->splines[1].d;
- } else if ( temp.sp!=NULL ) {
- p->cx = temp.sp->me.x;
- p->cy = temp.sp->me.y;
- }
- }
- fs->p = p;
- fs->seek_controls = oldseek;
- }
-#endif
- if ( p->cx>-fs->fudge && p->cx<fs->fudge )
- p->cx = 0;
- else if ( p->cx>cv->sc->width-fs->fudge && p->cx<cv->sc->width+fs->fudge &&
- !cv->widthsel)
- p->cx = cv->sc->width;
- else if ( cv->widthsel && p!=&cv->p &&
- p->cx>cv->oldwidth-fs->fudge && p->cx<cv->oldwidth+fs->fudge )
- p->cx = cv->oldwidth;
-#if 0
- else if ( cv->sc->parent->hsnaps!=NULL && cv->drawmode!=dm_grid ) {
- int i, *hsnaps = cv->sc->parent->hsnaps;
- for ( i=0; hsnaps[i]!=0x80000000; ++i ) {
- if ( p->cx>hsnaps[i]-fs->fudge && p->cx<hsnaps[i]+fs->fudge ) {
- p->cx = hsnaps[i];
- break;
- }
- }
- }
-#endif
- if ( p->cy>-fs->fudge && p->cy<fs->fudge )
- p->cy = 0;
-#if 0
- else if ( cv->sc->parent->vsnaps!=NULL && cv->drawmode!=dm_grid ) {
- int i, *vsnaps = cv->sc->parent->vsnaps;
- for ( i=0; vsnaps[i]!=0x80000000; ++i ) {
- if ( p->cy>vsnaps[i]-fs->fudge && p->cy<vsnaps[i]+fs->fudge ) {
- p->cy = vsnaps[i];
- break;
- }
- }
- }
-#endif
-}
-
-static int _CVTestSelectFromEvent(CharView *cv,FindSel *fs) {
- PressedOn temp;
- ImageList *img;
-
- if ( !InSplineSet(fs,cv->layerheads[cv->drawmode]->splines)) {
- if ( cv->drawmode==dm_fore) {
- RefChar *rf;
- temp = cv->p;
- fs->p = &temp;
- fs->seek_controls = false;
- for ( rf=cv->sc->layers[ly_fore].refs; rf!=NULL; rf = rf->next ) {
- if ( InSplineSet(fs,rf->layers[0].splines)) {
- cv->p.ref = rf;
- cv->p.anysel = true;
- break;
- }
- }
- if ( cv->showanchor && !cv->p.anysel ) {
- AnchorPoint *ap, *found=NULL;
- /* I do this pecular search because: */
- /* 1) I expect there to be lots of times we get multiple */
- /* anchors at the same location */
- /* 2) The anchor points are drawn so that the bottommost */
- /* is displayed */
- for ( ap=cv->sc->anchor; ap!=NULL; ap=ap->next )
- if ( fs->xl<=ap->me.x && fs->xh>=ap->me.x &&
- fs->yl<=ap->me.y && fs->yh >= ap->me.y )
- found = ap;
- if ( found!=NULL ) {
- cv->p.ap = found;
- cv->p.anysel = true;
- }
- }
- }
- for ( img = cv->layerheads[cv->drawmode]->images; img!=NULL; img=img->next ) {
- if ( InImage(fs,img)) {
- cv->p.img = img;
- cv->p.anysel = true;
- break;
- }
- }
- }
-return( cv->p.anysel );
-}
-
-int CVTestSelectFromEvent(CharView *cv,GEvent *event) {
- FindSel fs;
-
- SetFS(&fs,&cv->p,cv,event);
-return( _CVTestSelectFromEvent(cv,&fs));
-}
-
-static void CVMouseDown(CharView *cv, GEvent *event ) {
- FindSel fs;
- GEvent fake;
-
- if ( event->u.mouse.button==2 && event->u.mouse.device!=NULL &&
- strcmp(event->u.mouse.device,"stylus")==0 )
-return; /* I treat this more like a modifier key change than a button press */
-
- if ( cv->expandedge != ee_none )
- GDrawSetCursor(cv->v,ct_mypointer);
- if ( event->u.mouse.button==3 ) {
- CVToolsPopup(cv,event);
-return;
- }
- CVToolsSetCursor(cv,event->u.mouse.state|(1<<(7+event->u.mouse.button)), event->u.mouse.device );
- cv->active_tool = cv->showing_tool;
- cv->needsrasterize = false;
- cv->recentchange = false;
-
- SetFS(&fs,&cv->p,cv,event);
- if ( event->u.mouse.state&ksm_shift )
- event = CVConstrainedMouseDown(cv,event,&fake);
-
- if ( cv->active_tool == cvt_pointer ) {
- fs.select_controls = true;
- if ( event->u.mouse.state&ksm_alt ) fs.seek_controls = true;
- if ( cv->showpointnumbers && cv->fv->sf->order2 ) fs.all_controls = true;
- cv->lastselpt = NULL;
- _CVTestSelectFromEvent(cv,&fs);
- fs.p = &cv->p;
- } else if ( cv->active_tool == cvt_curve || cv->active_tool == cvt_corner ||
- cv->active_tool == cvt_tangent || cv->active_tool == cvt_pen ) {
- InSplineSet(&fs,cv->layerheads[cv->drawmode]->splines);
- if ( fs.p->sp==NULL && fs.p->spline==NULL )
- CVDoSnaps(cv,&fs);
- } else {
- NearSplineSetPoints(&fs,cv->layerheads[cv->drawmode]->splines);
- if ( fs.p->sp==NULL && fs.p->spline==NULL )
- CVDoSnaps(cv,&fs);
- }
-
- cv->e.x = event->u.mouse.x; cv->e.y = event->u.mouse.y;
- if ( cv->p.sp!=NULL ) {
- BasePoint *p;
- if ( cv->p.nextcp )
- p = &cv->p.sp->nextcp;
- else if ( cv->p.prevcp )
- p = &cv->p.sp->prevcp;
- else
- p = &cv->p.sp->me;
- cv->info.x = p->x;
- cv->info.y = p->y;
- cv->p.cx = p->x; cv->p.cy = p->y;
- } else {
- cv->info.x = cv->p.cx;
- cv->info.y = cv->p.cy;
- }
- cv->info_within = true;
- CVInfoDraw(cv,cv->gw);
- CVSetConstrainPoint(cv,event);
-
- switch ( cv->active_tool ) {
- case cvt_pointer:
- CVMouseDownPointer(cv, &fs, event);
- cv->lastselpt = fs.p->sp;
- break;
- case cvt_magnify: case cvt_minify:
- break;
- case cvt_hand:
- CVMouseDownHand(cv);
- break;
- case cvt_freehand:
- CVMouseDownFreeHand(cv,event);
- break;
- case cvt_curve: case cvt_corner: case cvt_tangent: case cvt_pen:
- CVMouseDownPoint(cv,event);
- break;
- case cvt_ruler:
- CVMouseDownRuler(cv,event);
- break;
- case cvt_rotate: case cvt_flip: case cvt_scale: case cvt_skew:
- case cvt_3d_rotate: case cvt_perspective:
- CVMouseDownTransform(cv);
- break;
- case cvt_knife:
- CVMouseDownKnife(cv);
- break;
- case cvt_rect: case cvt_elipse: case cvt_poly: case cvt_star:
- CVMouseDownShape(cv,event);
- break;
- }
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-static int _SCRefNumberPoints2(SplineSet **_rss,SplineChar *sc,int pnum) {
- SplineSet *ss, *rss = *_rss;
- SplinePoint *sp, *rsp;
- RefChar *r;
- int starts_with_cp, startcnt;
-
- for ( ss=sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next, rss=rss->next ) {
- if ( rss==NULL ) /* Can't happen */
- break;
- starts_with_cp = !ss->first->noprevcp &&
- ((ss->first->ttfindex == pnum+1 && ss->first->prev!=NULL &&
- ss->first->prev->from->nextcpindex==pnum ) ||
- ((ss->first->ttfindex==0xffff || SPInterpolate( ss->first ))));
- startcnt = pnum;
- if ( starts_with_cp ) ++pnum;
- for ( sp = ss->first, rsp=rss->first; ; ) {
- if ( sp->ttfindex==0xffff || SPInterpolate( sp ))
- rsp->ttfindex = 0xffff;
- else
- rsp->ttfindex = pnum++;
- if ( sp->next==NULL )
- break;
- if ( sp->next->to == ss->first ) {
- if ( sp->nonextcp )
- rsp->nextcpindex = 0xffff;
- else if ( starts_with_cp )
- rsp->nextcpindex = startcnt;
- else
- rsp->nextcpindex = pnum++;
- break;
- }
- if ( sp->nonextcp )
- rsp->nextcpindex = 0xffff;
- else
- rsp->nextcpindex = pnum++;
- sp = sp->next->to;
- rsp = rsp->next->to;
- }
- }
-
- *_rss = rss;
- for ( r = sc->layers[ly_fore].refs; r!=NULL; r=r->next )
- pnum = _SCRefNumberPoints2(_rss,r->sc,pnum);
-return( pnum );
-}
-
-static int SCRefNumberPoints2(RefChar *ref,int pnum) {
- SplineSet *rss;
-
- rss = ref->layers[0].splines;
-return( _SCRefNumberPoints2(&rss,ref->sc,pnum));
-}
-
-int SSTtfNumberPoints(SplineSet *ss) {
- int pnum=0;
- SplinePoint *sp;
- int starts_with_cp;
-
- for ( ; ss!=NULL; ss=ss->next ) {
- starts_with_cp = !ss->first->noprevcp &&
- ((ss->first->ttfindex == pnum+1 && ss->first->prev!=NULL &&
- ss->first->prev->from->nextcpindex==pnum ) ||
- SPInterpolate( ss->first ));
- if ( starts_with_cp && ss->first->prev!=NULL )
- ss->first->prev->from->nextcpindex = pnum++;
- for ( sp=ss->first; ; ) {
- if ( SPInterpolate(sp) )
- sp->ttfindex = 0xffff;
- else
- sp->ttfindex = pnum++;
- if ( sp->nonextcp )
- sp->nextcpindex = 0xffff;
- else if ( !starts_with_cp || (sp->next!=NULL && sp->next->to!=ss->first) )
- sp->nextcpindex = pnum++;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
-return( pnum );
-}
-
-int SCNumberPoints(SplineChar *sc) {
- int pnum=0;
- SplineSet *ss;
- SplinePoint *sp;
- RefChar *ref;
-
- if ( sc->parent->order2 ) { /* TrueType and its complexities. I ignore svg here */
- if ( sc->layers[ly_fore].refs!=NULL ) {
- /* if there are references there can't be splines. So if we've got*/
- /* splines mark all point numbers on them as meaningless */
- for ( ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; ; ) {
- sp->ttfindex = 0xfffe;
- if ( !sp->nonextcp )
- sp->nextcpindex = 0xfffe;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
- for ( ref = sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next )
- pnum = SCRefNumberPoints2(ref,pnum);
- } else {
- pnum = SSTtfNumberPoints(sc->layers[ly_fore].splines);
- }
- } else { /* cubic (PostScript/SVG) splines */
- int layer;
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- for ( ss = sc->layers[layer].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; ; ) {
- sp->ttfindex = pnum++;
- sp->nextcpindex = 0xffff;
- if ( sc->numberpointsbackards ) {
- if ( sp->prev==NULL )
- break;
- if ( !sp->noprevcp || !sp->prev->from->nonextcp )
- pnum += 2;
- sp = sp->prev->from;
- } else {
- if ( sp->next==NULL )
- break;
- if ( !sp->nonextcp || !sp->next->to->noprevcp )
- pnum += 2;
- sp = sp->next->to;
- }
- if ( sp==ss->first )
- break;
- }
- }
- }
- }
-return( pnum );
-}
-
-int SCPointsNumberedProperly(SplineChar *sc) {
- int pnum=0, skipit;
- SplineSet *ss;
- SplinePoint *sp;
- int starts_with_cp;
- int start_pnum;
-
- if ( sc->layers[ly_fore].splines!=NULL &&
- sc->layers[ly_fore].refs!=NULL )
-return( false ); /* TrueType can't represent this, so always remove instructions. They can't be meaningful */
-
- for ( ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- starts_with_cp = (ss->first->ttfindex == pnum+1 || ss->first->ttfindex==0xffff) &&
- !ss->first->noprevcp;
- start_pnum = pnum;
- if ( starts_with_cp ) ++pnum;
- for ( sp=ss->first; ; ) {
- skipit = SPInterpolate(sp);
- if ( sp->nonextcp || sp->noprevcp ) skipit = false;
- if ( sp->ttfindex==0xffff && skipit )
- /* Doesn't count */;
- else if ( sp->ttfindex!=pnum )
-return( false );
- else
- ++pnum;
- if ( sp->nonextcp && sp->nextcpindex==0xffff )
- /* Doesn't count */;
- else if ( sp->nextcpindex==pnum )
- ++pnum;
- else if ( sp->nextcpindex==start_pnum && starts_with_cp &&
- (sp->next!=NULL && sp->next->to==ss->first) )
- /* Ok */;
- else
-return( false );
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- if ( starts_with_cp ) --pnum;
- }
-return( true );
-}
-
-static void instrcheck(SplineChar *sc) {
- uint8 *instrs = sc->ttf_instrs==NULL && sc->parent->mm!=NULL && sc->parent->mm->apple ?
- sc->parent->mm->normal->glyphs[sc->orig_pos]->ttf_instrs : sc->ttf_instrs;
- struct splinecharlist *dep;
- int any_ptnumbers_shown = false;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- CharView *cv;
-#endif
- extern int clear_tt_instructions_when_needed;
- SplineSet *ss;
- SplinePoint *sp;
- AnchorPoint *ap;
- int had_ap, had_dep, had_instrs;
-
- if ( !sc->parent->order2 )
-return;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- for ( cv=sc->views; cv!=NULL; cv=cv->next )
- if ( cv->showpointnumbers ) {
- any_ptnumbers_shown = true;
- break;
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
- if ( sc->instructions_out_of_date && !any_ptnumbers_shown && sc->anchor==NULL )
-return;
- if ( instrs==NULL && sc->dependents==NULL && !any_ptnumbers_shown && sc->anchor==NULL )
-return;
- /* If the points are no longer in order then the instructions are not valid */
- /* (because they'll refer to the wrong points) and should be removed */
- /* Except that annoys users who don't expect it */
- had_ap = had_dep = had_instrs = 0;
- if ( !SCPointsNumberedProperly(sc)) {
- if ( instrs!=NULL ) {
- if ( clear_tt_instructions_when_needed ) {
- free(sc->ttf_instrs); sc->ttf_instrs = NULL;
- sc->ttf_instrs_len = 0;
-# ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCMarkInstrDlgAsChanged(sc);
-# endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- had_instrs = 1;
- } else {
- sc->instructions_out_of_date = true;
- had_instrs = 2;
- }
- }
- for ( dep=sc->dependents; dep!=NULL; dep=dep->next ) {
- RefChar *ref;
- if ( dep->sc->ttf_instrs_len!=0 ) {
- if ( clear_tt_instructions_when_needed ) {
- free(dep->sc->ttf_instrs); dep->sc->ttf_instrs = NULL;
- dep->sc->ttf_instrs_len = 0;
-# ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCMarkInstrDlgAsChanged(dep->sc);
-# endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- had_instrs = 1;
- } else {
- dep->sc->instructions_out_of_date = true;
- had_instrs = 2;
- }
- }
- for ( ref=dep->sc->layers[ly_fore].refs; ref!=NULL && ref->sc!=sc; ref=ref->next );
- for ( ; ref!=NULL ; ref=ref->next ) {
-#if 0
- ref->point_match = false;
-#endif
- if ( ref->point_match )
- ref->point_match_out_of_date = true;
- had_dep = true;
- }
- }
- SCNumberPoints(sc);
- for ( ap=sc->anchor ; ap!=NULL; ap=ap->next ) {
- if ( ap->has_ttf_pt ) {
- had_ap = true;
- ap->has_ttf_pt = false;
- for ( ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; ; ) {
- if ( sp->me.x==ap->me.x && sp->me.y==ap->me.y && sp->ttfindex!=0xffff ) {
- ap->has_ttf_pt = true;
- ap->ttf_pt_index = sp->ttfindex;
- goto found;
- } else if ( sp->nextcp.x==ap->me.x && sp->nextcp.y==ap->me.y && sp->nextcpindex!=0xffff ) {
- ap->has_ttf_pt = true;
- ap->ttf_pt_index = sp->nextcpindex;
- goto found;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
- found: ;
- }
- }
- }
- if ( no_windowing_ui )
- /* If we're in a script it's annoying (and pointless) to get this message */;
- else if ( sc->complained_about_ptnums )
- /* It's annoying to get the same message over and over again as you edit a glyph */;
- else if ( had_ap || had_dep || had_instrs ) {
- ff_post_notice(_("You changed the point numbering"),
- _("You have just changed the point numbering of glyph %s.%s%s%s"),
- sc->name,
- had_instrs==0 ? "" :
- had_instrs==1 ? _(" Instructions in this glyph (or one that refers to it) have been lost.") :
- _(" Instructions in this glyph (or one that refers to it) are now out of date."),
- had_dep ? _(" At least one reference to this glyph used point matching. That match is now out of date.")
- : "",
- had_ap ? _(" At least one anchor point used point matching. It may be out of date now.")
- : "" );
- sc->complained_about_ptnums = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( had_instrs==2 )
- GDrawRequestExpose(sc->parent->fv->v,NULL,false);
-#endif
- }
-}
-
-static void _SCHintsChanged(SplineChar *sc) {
- struct splinecharlist *dlist;
-
- if ( !sc->changedsincelasthinted ) {
- sc->changedsincelasthinted = true;
- FVMarkHintsOutOfDate(sc);
- }
-
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next )
- _SCHintsChanged(dlist->sc);
-}
-
-void SCHintsChanged(SplineChar *sc) {
- struct splinecharlist *dlist;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int was = sc->changedsincelasthinted;
-#endif
-
- if ( sc->parent->onlybitmaps || sc->parent->multilayer || sc->parent->strokedfont || sc->parent->order2 )
-return;
- sc->changedsincelasthinted = false; /* We just applied a hinting change */
- if ( !sc->changed ) {
- sc->changed = true;
- FVToggleCharChanged(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCRefreshTitles(sc);
-#endif
- if ( !sc->parent->changed ) {
- sc->parent->changed = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVSetTitle(sc->parent->fv);
-#endif
- }
- }
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next )
- _SCHintsChanged(dlist->sc);
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( was ) {
- FontView *fvs;
- for ( fvs = sc->parent->fv; fvs!=NULL; fvs=fvs->nextsame )
- GDrawRequestExpose(fvs->v,NULL,false);
- }
-#endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-void CVSetCharChanged(CharView *cv,int changed) {
- FontView *fv = cv->fv;
- SplineFont *sf = fv->sf;
- SplineChar *sc = cv->sc;
- int oldchanged = sf->changed;
- /* A changed argument of 2 means the outline didn't change, but something */
- /* else (width, anchorpoint) did */
-
- if ( changed )
- SFSetModTime(sf);
- if ( cv->drawmode==dm_grid ) {
- if ( changed ) {
- sf->changed = true;
- if ( fv->cidmaster!=NULL )
- fv->cidmaster->changed = true;
- }
- } else {
- if ( cv->drawmode==dm_fore && changed!=2 )
- sf->onlybitmaps = false;
- if ( (sc->changed==0) != (changed==0) ) {
- sc->changed = (changed!=0);
- FVToggleCharChanged(sc);
- SCRefreshTitles(sc);
- if ( changed ) {
- sf->changed = true;
- if ( fv->cidmaster!=NULL )
- fv->cidmaster->changed = true;
- }
- }
- if ( changed==1 ) {
- instrcheck(sc);
- SCDeGridFit(sc);
- if ( sc->parent->onlybitmaps )
- /* Do nothing */;
- else if ( sc->parent->multilayer || sc->parent->strokedfont || sc->parent->order2 )
- sc->changed_since_search = true;
- else if ( cv->drawmode==dm_fore )
- sc->changed_since_search = sc->changedsincelasthinted = true;
- sc->changed_since_autosave = true;
- sf->changed_since_autosave = true;
- sf->changed_since_xuidchanged = true;
- if ( fv->cidmaster!=NULL ) {
- fv->cidmaster->changed_since_autosave = true;
- fv->cidmaster->changed_since_xuidchanged = true;
- }
- _SCHintsChanged(cv->sc);
- }
- if ( cv->drawmode==dm_fore ) {
- cv->needsrasterize = true;
- }
- }
- cv->recentchange = true;
- if ( !oldchanged )
- FVSetTitle(fv);
-}
-
-void SCClearSelPt(SplineChar *sc) {
- CharView *cv;
-
- for ( cv=sc->views; cv!=NULL; cv=cv->next ) {
- cv->lastselpt = cv->p.sp = NULL;
- }
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-static void TTFPointMatches(SplineChar *sc,int top) {
- AnchorPoint *ap;
- BasePoint here, there;
- struct splinecharlist *deps;
- RefChar *ref;
-
- if ( !sc->parent->order2 )
-return;
- for ( ap=sc->anchor ; ap!=NULL; ap=ap->next ) {
- if ( ap->has_ttf_pt )
- if ( ttfFindPointInSC(sc,ap->ttf_pt_index,&ap->me,NULL)!=-1 )
- ap->has_ttf_pt = false;
- }
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( ref->point_match ) {
- if ( ttfFindPointInSC(sc,ref->match_pt_base,&there,ref)==-1 &&
- ttfFindPointInSC(ref->sc,ref->match_pt_ref,&here,NULL)==-1 ) {
- if ( ref->transform[4]!=there.x-here.x ||
- ref->transform[5]!=there.y-here.y ) {
- ref->transform[4] = there.x-here.x;
- ref->transform[5] = there.y-here.y;
- SCReinstanciateRefChar(sc,ref);
- if ( !top )
- _SCCharChangedUpdate(sc,true);
- }
- } else
- ref->point_match = false; /* one of the points no longer exists */
- }
- }
- for ( deps = sc->dependents; deps!=NULL; deps = deps->next )
- TTFPointMatches(deps->sc,false);
-}
-
-void _SCCharChangedUpdate(SplineChar *sc,int changed) {
- SplineFont *sf = sc->parent;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- extern int updateflex;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
- TTFPointMatches(sc,true);
- if ( changed != -1 ) {
- sc->changed_since_autosave = true;
- SFSetModTime(sf);
- if ( (sc->changed==0) != (changed==0) ) {
- sc->changed = (changed!=0);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVToggleCharChanged(sc);
- SCRefreshTitles(sc);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !sf->changed && sf->fv!=NULL )
- FVSetTitle(sf->fv);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- if ( changed ) {
- instrcheck(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCDeGridFit(sc);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
- if ( !sc->parent->onlybitmaps && !sc->parent->multilayer &&
- changed==1 && !sc->parent->strokedfont && !sc->parent->order2 )
- sc->changedsincelasthinted = true;
- sc->changed_since_search = true;
- sf->changed = true;
- sf->changed_since_autosave = true;
- sf->changed_since_xuidchanged = true;
- _SCHintsChanged(sc);
- }
- if ( sf->cidmaster!=NULL )
- sf->cidmaster->changed = sf->cidmaster->changed_since_autosave =
- sf->cidmaster->changed_since_xuidchanged = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCRegenDependents(sc); /* All chars linked to this one need to get the new splines */
- if ( updateflex && sc->views!=NULL )
- SplineCharIsFlexible(sc);
- SCUpdateAll(sc);
-# ifdef FONTFORGE_CONFIG_TYPE3
- SCLayersChange(sc);
-# endif
- SCRegenFills(sc);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-}
-
-void SCCharChangedUpdate(SplineChar *sc) {
- _SCCharChangedUpdate(sc,true);
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-void _CVCharChangedUpdate(CharView *cv,int changed) {
- extern int updateflex;
- FontView *fv;
-
- CVSetCharChanged(cv,changed);
-#ifdef FONTFORGE_CONFIG_TYPE3
- CVLayerChange(cv);
-#endif
- if ( cv->needsrasterize ) {
- TTFPointMatches(cv->sc,true); /* Must precede regen dependents, as this can change references */
- SCRegenDependents(cv->sc); /* All chars linked to this one need to get the new splines */
- if ( updateflex )
- SplineCharIsFlexible(cv->sc);
- SCUpdateAll(cv->sc);
- SCRegenFills(cv->sc);
- for ( fv = cv->sc->parent->fv; fv!=NULL; fv=fv->nextsame )
- FVRegenChar(fv,cv->sc);
- cv->needsrasterize = false;
- } else if ( cv->drawmode==dm_back ) {
- /* If we changed the background then only views of this character */
- /* need to know about it. No dependents needed, but why write */
- /* another routine for a rare case... */
- SCUpdateAll(cv->sc);
- } else if ( cv->drawmode==dm_grid ) {
- /* If we changed the grid then any character needs to know it */
- FVRedrawAllCharViews(cv->fv);
- }
- cv->recentchange = false;
- cv->p.sp = NULL; /* Might have been deleted */
-}
-
-void CVCharChangedUpdate(CharView *cv) {
- _CVCharChangedUpdate(cv,true);
-}
-
-static void CVMouseMove(CharView *cv, GEvent *event ) {
- real cx, cy;
- PressedOn p;
- FindSel fs;
- GEvent fake;
- int stop_motion = false;
-
-#if 0 /* Debug wacom !!!! */
- printf( "dev=%s (%d,%d) 0x%x\n", event->u.mouse.device!=NULL?event->u.mouse.device:"<None>",
- event->u.mouse.x, event->u.mouse.y, event->u.mouse.state);
-#endif
-
- if ( event->u.mouse.device!=NULL )
- CVToolsSetCursor(cv,event->u.mouse.state,event->u.mouse.device);
-
- if ( !cv->p.pressed ) {
- CVUpdateInfo(cv, event);
- if ( cv->showing_tool == cvt_pointer ) {
- CVCheckResizeCursors(cv);
- if ( cv->dv!=NULL )
- CVDebugPointPopup(cv);
- } else if ( cv->showing_tool == cvt_ruler )
- CVMouseMoveRuler(cv,event);
-return;
- }
-
- SetFS(&fs,&p,cv,event);
- if ( cv->active_tool == cvt_freehand )
- /* freehand does it's own kind of constraining */;
- else if ( (event->u.mouse.state&ksm_shift) && !cv->p.rubberbanding ) {
- /* Constrained */
-
- fake.u.mouse = event->u.mouse;
- if ( ((event->u.mouse.state&ksm_alt) ||
- (!cv->cntrldown && (event->u.mouse.state&ksm_control))) &&
- (cv->p.nextcp || cv->p.prevcp)) {
- real dot = (cv->p.cp.x-cv->p.constrain.x)*(p.cx-cv->p.constrain.x) +
- (cv->p.cp.y-cv->p.constrain.y)*(p.cy-cv->p.constrain.y);
- real len = (cv->p.cp.x-cv->p.constrain.x)*(cv->p.cp.x-cv->p.constrain.x)+
- (cv->p.cp.y-cv->p.constrain.y)*(cv->p.cp.y-cv->p.constrain.y);
- if ( len!=0 ) {
- dot /= len;
- /* constrain control point to same angle with respect to base point*/
- if ( dot<0 ) dot = 0;
- p.cx = cv->p.constrain.x + dot*(cv->p.cp.x-cv->p.constrain.x);
- p.cy = cv->p.constrain.y + dot*(cv->p.cp.y-cv->p.constrain.y);
- p.x = fake.u.mouse.x = cv->xoff + rint(p.cx*cv->scale);
- p.y = fake.u.mouse.y = -cv->yoff + cv->height - rint(p.cy*cv->scale);
- }
- } else {
- /* Constrain mouse to hor/vert/45 from base point */
- int basex = cv->active_tool!=cvt_hand ? cv->xoff + rint(cv->p.constrain.x*cv->scale) : cv->p.x;
- int basey = cv->active_tool!=cvt_hand ?-cv->yoff + cv->height - rint(cv->p.constrain.y*cv->scale) : cv->p.y;
- int dx= event->u.mouse.x-basex, dy = event->u.mouse.y-basey;
- int sign = dx*dy<0?-1:1;
- double aspect = 1.0;
-
- if ( dx<0 ) dx = -dx; if ( dy<0 ) dy = -dy;
- if ( cv->p.img!=NULL && cv->p.img->bb.minx!=cv->p.img->bb.maxx )
- aspect = (cv->p.img->bb.maxy - cv->p.img->bb.miny) / (cv->p.img->bb.maxx - cv->p.img->bb.minx);
- else if ( cv->p.ref!=NULL && cv->p.ref->bb.minx!=cv->p.ref->bb.maxx )
- aspect = (cv->p.ref->bb.maxy - cv->p.ref->bb.miny) / (cv->p.ref->bb.maxx - cv->p.ref->bb.minx);
- if ( dy >= 2*dx ) {
- p.x = fake.u.mouse.x = basex;
- p.cx = cv->p.constrain.x;
- if ( ItalicConstrained && cv->sc->parent->italicangle!=0 ) {
- double off = tan(cv->sc->parent->italicangle*3.1415926535897932/180)*
- (p.cy-cv->p.constrain.y);
- double aoff = off<0 ? -off : off;
- if ( dx>=aoff*cv->scale/2 && (event->u.mouse.x-basex<0)!=(off<0) ) {
- p.cx -= off;
- p.x = fake.u.mouse.x = cv->xoff + rint(p.cx*cv->scale);
- }
- }
- } else if ( dx >= 2*dy ) {
- p.y = fake.u.mouse.y = basey;
- p.cy = cv->p.constrain.y;
- } else if ( dx > dy ) {
- p.x = fake.u.mouse.x = basex + sign * (event->u.mouse.y-basey)/aspect;
- p.cx = cv->p.constrain.x - sign * (p.cy-cv->p.constrain.y)/aspect;
- } else {
- p.y = fake.u.mouse.y = basey + sign * (event->u.mouse.x-basex)*aspect;
- p.cy = cv->p.constrain.y - sign * (p.cx-cv->p.constrain.x)*aspect;
- }
- }
- event = &fake;
- }
-
- /* If we've changed the character (recentchange is true) we want to */
- /* snap to the original location, otherwise we'll keep snapping to the */
- /* current point as it moves across the screen (jerkily) */
- if ( cv->active_tool == cvt_hand || cv->active_tool == cvt_freehand )
- /* Don't snap to points */;
- else if ( cv->active_tool == cvt_pointer &&
- ( cv->p.nextcp || cv->p.prevcp))
- /* Don't snap to points when moving control points */;
- else if ( !cv->joinvalid || !CheckPoint(&fs,&cv->joinpos,NULL)) {
- SplinePointList *spl;
- spl = cv->layerheads[cv->drawmode]->splines;
- if ( cv->recentchange && cv->active_tool==cvt_pointer &&
- cv->layerheads[cv->drawmode]->undoes!=NULL &&
- (cv->layerheads[cv->drawmode]->undoes->undotype==ut_state ||
- cv->layerheads[cv->drawmode]->undoes->undotype==ut_tstate ))
- spl = cv->layerheads[cv->drawmode]->undoes->u.state.splines;
- if ( cv->active_tool != cvt_knife )
- NearSplineSetPoints(&fs,spl);
- else
- InSplineSet(&fs,spl);
- }
- if ( p.sp!=NULL && p.sp!=cv->active_sp ) { /* Snap to points */
- p.cx = p.sp->me.x;
- p.cy = p.sp->me.y;
- } else {
- CVDoSnaps(cv,&fs);
- }
- cx = (p.cx -cv->p.cx) / cv->scale;
- cy = (p.cy - cv->p.cy) / cv->scale;
- if ( cx<0 ) cx = -cx;
- if ( cy<0 ) cy = -cy;
-
- /* If they haven't moved far from the start point, then snap to it */
- if ( cx+cy < 4 ) {
- p.x = cv->p.x; p.y = cv->p.y;
- }
-
- cv->info.x = p.cx; cv->info.y = p.cy;
- cv->info_sp = p.sp;
- cv->e.x = event->u.mouse.x; cv->e.y = event->u.mouse.y;
- CVInfoDraw(cv,cv->gw);
-
- switch ( cv->active_tool ) {
- case cvt_pointer:
- stop_motion = CVMouseMovePointer(cv,event);
- break;
- case cvt_magnify: case cvt_minify:
- if ( !cv->p.rubberbanding ) {
- cv->p.ex = cv->p.cx;
- cv->p.ey = cv->p.cy;
- }
- if ( cv->p.rubberbanding )
- CVDrawRubberRect(cv->v,cv);
- cv->p.ex = cv->info.x;
- cv->p.ey = cv->info.y;
- cv->p.rubberbanding = true;
- CVDrawRubberRect(cv->v,cv);
- break;
- case cvt_hand:
- CVMouseMoveHand(cv,event);
- break;
- case cvt_freehand:
- CVMouseMoveFreeHand(cv,event);
- break;
- case cvt_curve: case cvt_corner: case cvt_tangent:
- CVMouseMovePoint(cv,&p);
- break;
- case cvt_pen:
- CVMouseMovePen(cv,&p,event);
- break;
- case cvt_ruler:
- CVMouseMoveRuler(cv,event);
- break;
- case cvt_rotate: case cvt_flip: case cvt_scale: case cvt_skew:
- case cvt_3d_rotate: case cvt_perspective:
- CVMouseMoveTransform(cv);
- break;
- case cvt_knife:
- CVMouseMoveKnife(cv,&p);
- break;
- case cvt_rect: case cvt_elipse: case cvt_poly: case cvt_star:
- CVMouseMoveShape(cv);
- break;
- }
- if ( stop_motion ) {
- event->type = et_mouseup;
- CVMouseUp(cv,event);
- }
-}
-
-static void CVMagnify(CharView *cv, real midx, real midy, int bigger) {
- static float scales[] = { 1, 2, 3, 4, 6, 8, 11, 16, 23, 32, 45, 64, 90, 128, 181, 256, 512, 1024, 0 };
- int i, j;
-
- if ( bigger!=0 ) {
- if ( cv->scale>=1 ) {
- for ( i=0; scales[i]!=0 && cv->scale>scales[i]; ++i );
- if ( scales[i]==0 ) i=j= i-1;
- else if ( RealNear(scales[i],cv->scale) ) j=i;
- else if ( i!=0 && RealNear(scales[i-1],cv->scale) ) j= --i; /* Round errors! */
- else j = i-1;
- } else { real sinv = 1/cv->scale; int t;
- for ( i=0; scales[i]!=0 && sinv>scales[i]; ++i );
- if ( scales[i]==0 ) i=j= i-1;
- else if ( RealNear(scales[i],sinv) ) j=i;
- else if ( i!=0 && RealNear(scales[i-1],sinv) ) j= --i; /* Round errors! */
- else j = i-1;
- t = j;
- j = -i; i = -t;
- }
- if ( bigger==1 ) {
- if ( i==j ) ++i;
- if ( i>0 && scales[i]==0 ) --i;
- if ( i>=0 )
- cv->scale = scales[i];
- else
- cv->scale = 1/scales[-i];
- } else {
- if ( i==j ) --j;
- if ( j<0 && scales[-j]==0 ) ++j;
- if ( j>=0 )
- cv->scale = scales[j];
- else
- cv->scale = 1/scales[-j];
- }
- }
- cv->xoff = -(rint(midx*cv->scale) - cv->width/2);
- cv->yoff = -(rint(midy*cv->scale) - cv->height/2);
- CVNewScale(cv);
-}
-
-static void CVMouseUp(CharView *cv, GEvent *event ) {
-
- CVMouseMove(cv,event);
- if ( cv->pressed!=NULL ) {
- GDrawCancelTimer(cv->pressed);
- cv->pressed = NULL;
- }
- cv->p.pressed = false;
-
- if ( cv->p.rubberbanding ) {
- CVDrawRubberRect(cv->v,cv);
- cv->p.rubberbanding = false;
- } else if ( cv->p.rubberlining ) {
- CVDrawRubberLine(cv->v,cv);
- cv->p.rubberlining = false;
- }
- switch ( cv->active_tool ) {
- case cvt_pointer:
- CVMouseUpPointer(cv);
- break;
- case cvt_ruler:
- CVMouseUpRuler(cv,event);
- break;
- case cvt_hand:
- CVMouseUpHand(cv);
- break;
- case cvt_freehand:
- CVMouseUpFreeHand(cv,event);
- break;
- case cvt_curve: case cvt_corner: case cvt_tangent: case cvt_pen:
- CVMouseUpPoint(cv,event);
- break;
- case cvt_magnify: case cvt_minify:
- if ( cv->p.x>=event->u.mouse.x-6 && cv->p.x<=event->u.mouse.x+6 &&
- cv->p.y>=event->u.mouse.y-6 && cv->p.y<=event->u.mouse.y+6 ) {
- real cx, cy;
- cx = (event->u.mouse.x-cv->xoff)/cv->scale ;
- cy = (cv->height-event->u.mouse.y-cv->yoff)/cv->scale ;
- CVMagnify(cv,cx,cy,cv->active_tool==cvt_minify?-1:1);
- } else {
- DBounds b;
- double oldscale = cv->scale;
- if ( cv->p.cx>cv->info.x ) {
- b.minx = cv->info.x;
- b.maxx = cv->p.cx;
- } else {
- b.minx = cv->p.cx;
- b.maxx = cv->info.x;
- }
- if ( cv->p.cy>cv->info.y ) {
- b.miny = cv->info.y;
- b.maxy = cv->p.cy;
- } else {
- b.miny = cv->p.cy;
- b.maxy = cv->info.y;
- }
- _CVFit(cv,&b);
- if ( oldscale==cv->scale ) {
- cv->scale += .5;
- CVNewScale(cv);
- }
- }
- break;
- case cvt_rotate: case cvt_flip: case cvt_scale: case cvt_skew:
- case cvt_3d_rotate: case cvt_perspective:
- CVMouseUpTransform(cv);
- break;
- case cvt_knife:
- CVMouseUpKnife(cv,event);
- break;
- case cvt_rect: case cvt_elipse: case cvt_poly: case cvt_star:
- CVMouseUpShape(cv);
- break;
- }
- cv->active_tool = cvt_none;
- CVToolsSetCursor(cv,event->u.mouse.state&~(1<<(7+event->u.mouse.button)),event->u.mouse.device); /* X still has the buttons set in the state, even though we just released them. I don't want em */
- /* CharChangedUpdate is a rather blunt tool. When moving anchor points with */
- /* the mouse we need finer control than it provides */
- /* If recentchange is set then change should also be set, don't think we */
- /* need the full form of this call */
- if ( cv->needsrasterize || cv->recentchange )
- _CVCharChangedUpdate(cv,2);
-}
-
-static void CVTimer(CharView *cv,GEvent *event) {
-
- if ( event->u.timer.timer==cv->pressed ) {
- GEvent e;
- GDrawGetPointerPosition(cv->v,&e);
- if ( e.u.mouse.x<0 || e.u.mouse.y<0 ||
- e.u.mouse.x>=cv->width || e.u.mouse.y >= cv->height ) {
- real dx = 0, dy = 0;
- if ( e.u.mouse.x<0 )
- dx = cv->width/8;
- else if ( e.u.mouse.x>=cv->width )
- dx = -cv->width/8;
- if ( e.u.mouse.y<0 )
- dy = -cv->height/8;
- else if ( e.u.mouse.y>=cv->height )
- dy = cv->height/8;
- cv->xoff += dx; cv->yoff += dy;
- cv->back_img_out_of_date = true;
- if ( dy!=0 )
- GScrollBarSetPos(cv->vsb,cv->yoff-cv->height);
- if ( dx!=0 )
- GScrollBarSetPos(cv->hsb,-cv->xoff);
- GDrawRequestExpose(cv->v,NULL,false);
- }
-#if _ModKeysAutoRepeat
- /* Under cygwin the modifier keys auto repeat, they don't under normal X */
- } else if ( cv->autorpt==event->u.timer.timer ) {
- cv->autorpt = NULL;
- CVToolsSetCursor(cv,cv->oldstate,NULL);
- if ( cv->keysym == GK_Shift_L || cv->keysym == GK_Shift_R ||
- cv->keysym == GK_Alt_L || cv->keysym == GK_Alt_R ||
- cv->keysym == GK_Meta_L || cv->keysym == GK_Meta_R ) {
- GEvent e;
- e.w = cv->oldkeyw;
- e.u.chr.keysym = cv->keysym;
- e.u.chr.x = cv->oldkeyx;
- e.u.chr.y = cv->oldkeyy;
- CVFakeMove(cv,&e);
- }
-#endif
- }
-}
-
-static void CVDrop(CharView *cv,GEvent *event) {
- /* We should get a list of character names. Add each as a RefChar */
- int32 len;
- int ch, first = true;
- char *start, *pt, *cnames;
- SplineChar *rsc;
- RefChar *new;
-
- if ( cv->drawmode!=dm_fore ) {
- gwwv_post_error(_("Not Foreground"),_("References may be dragged only to the foreground layer"));
-return;
- }
- if ( !GDrawSelectionHasType(cv->gw,sn_drag_and_drop,"STRING"))
-return;
- cnames = GDrawRequestSelection(cv->gw,sn_drag_and_drop,"STRING",&len);
- if ( cnames==NULL )
-return;
-
- start = cnames;
- while ( *start ) {
- while ( *start==' ' ) ++start;
- if ( *start=='\0' )
- break;
- for ( pt=start; *pt && *pt!=' '; ++pt );
- ch = *pt; *pt = '\0';
- if ( (rsc=SFGetChar(cv->sc->parent,-1,start))!=NULL && rsc!=cv->sc ) {
- if ( first ) {
- CVPreserveState(cv);
- first =false;
- }
- new = RefCharCreate();
- new->transform[0] = new->transform[3] = 1.0;
- new->layers[0].splines = NULL;
- new->sc = rsc;
- new->next = cv->sc->layers[ly_fore].refs;
- cv->sc->layers[ly_fore].refs = new;
- SCReinstanciateRefChar(cv->sc,new);
- SCMakeDependent(cv->sc,rsc);
- }
- *pt = ch;
- start = pt;
- }
-
- free(cnames);
- CVCharChangedUpdate(cv);
-}
-
-#ifdef TEST_O2
-static int o2_cp_fixup( SplineSet *spl) {
- SplinePoint *sp, *n;
- int ret = false, spi, ni;
-
- while ( spl!=NULL ) {
- for ( sp=spl->first ; ; ) {
- if ( sp->next==NULL )
- break;
- n = sp->next->to;
- if ( !sp->next->order2 )
- /* No constraints on cubics */;
- else if ( sp->nonextcp && n->noprevcp )
- /* A line is ok */;
- else if ( RealNear(sp->nextcp.x,n->prevcp.x) &&
- RealNear(sp->nextcp.y,n->prevcp.y))
- /* That's ok as well */;
- else {
- ret = true;
- fprintf( stderr, "Control point between (%g,%g) and (%g,%g) is wrong.\n",
- sp->me.x, sp->me.y, n->me.x, n->me.y );
- spi = SPInterpolate(sp);
- ni = SPInterpolate(n);
- sp->nextcp.x = (sp->nextcp.x+n->prevcp.x)/2;
- sp->nextcp.y = (sp->nextcp.y+n->prevcp.y)/2;
- n->prevcp = sp->nextcp;
- if ( spi ) {
- sp->me.x = (sp->prevcp.x + sp->nextcp.x)/2;
- sp->me.y = (sp->prevcp.y + sp->nextcp.y)/2;
- }
- if ( ni ) {
- n->me.x = (n->prevcp.x + n->nextcp.x)/2;
- n->me.y = (n->prevcp.y + n->nextcp.y)/2;
- }
- }
- sp = n;
- if ( sp==spl->first )
- break;
- }
- spl = spl->next;
- }
-return( ret );
-}
-#endif
-
-static int v_e_h(GWindow gw, GEvent *event) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- GGadgetPopupExternalEvent(event);
- if (( event->type==et_mouseup || event->type==et_mousedown ) &&
- (event->u.mouse.button==4 || event->u.mouse.button==5) ) {
- if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) /* bind shift to magnify/minify */
-return( GGadgetDispatchEvent(cv->vsb,event));
- }
-
- switch ( event->type ) {
- case et_expose:
- GDrawSetLineWidth(gw,0);
- CVExpose(cv,gw,event);
-#ifdef TEST_O2
- if ( o2_cp_fixup(cv->layerheads[cv->drawmode]->splines) )
- IError("Mismatch control points" );
-#endif
- break;
- case et_crossing:
- CVCrossing(cv,event);
- break;
- case et_mousedown:
- CVPaletteActivate(cv);
- if ( cv->gic!=NULL )
- GDrawSetGIC(gw,cv->gic,0,20);
- if ( cv->inactive )
- SVMakeActive(cv->searcher,cv);
- CVMouseDown(cv,event);
- break;
- case et_mousemove:
- if ( cv->p.pressed )
- GDrawSkipMouseMoveEvents(cv->v,event);
- CVMouseMove(cv,event);
- break;
- case et_mouseup:
- CVMouseUp(cv,event);
- break;
- case et_char:
- if ( cv->searcher!=NULL )
- SVChar(cv->searcher,event);
- else
- CVChar(cv,event);
- break;
- case et_charup:
- CVCharUp(cv,event);
- break;
- case et_timer:
- CVTimer(cv,event);
- break;
- case et_drop:
- CVDrop(cv,event);
- break;
- case et_focus:
- if ( event->u.focus.gained_focus ) {
- if ( cv->gic!=NULL )
- GDrawSetGIC(gw,cv->gic,0,20);
-#if 0
- CVPaletteActivate(cv);
-#endif
- }
- break;
- }
-return( true );
-}
-
-static void CVDrawNum(CharView *cv,GWindow pixmap,int x, int y, char *format,real val, int align) {
- char buffer[40];
- unichar_t ubuf[40];
- int len;
-
- if ( val==0 ) val=0; /* avoid -0 */
- sprintf(buffer,format,val);
- uc_strcpy(ubuf,buffer);
- if ( align!=0 ) {
- len = GDrawGetTextWidth(pixmap,ubuf,-1,NULL);
- if ( align==1 )
- x-=len/2;
- else
- x-=len;
- }
- GDrawDrawText(pixmap,x,y,ubuf,-1,NULL,GDrawGetDefaultForeground(NULL));
-}
-
-static void CVDrawVNum(CharView *cv,GWindow pixmap,int x, int y, char *format,real val, int align) {
- char buffer[40];
- unichar_t ubuf[40], *upt;
- int len;
-
- if ( val==0 ) val=0; /* avoid -0 */
- sprintf(buffer,format,val);
- uc_strcpy(ubuf,buffer);
- if ( align!=0 ) {
- len = strlen(buffer)*cv->sfh;
- if ( align==1 )
- y-=len/2;
- else
- y-=len;
- }
- for ( upt=ubuf; *upt; ++upt ) {
- GDrawDrawText(pixmap,x,y,upt,1,NULL,GDrawGetDefaultForeground(NULL));
- y += cv->sfh;
- }
-}
-
-
-static void CVExposeRulers(CharView *cv, GWindow pixmap ) {
- real xmin, xmax, ymin, ymax;
- real onehundred, pos;
- real units, littleunits;
- int ybase = cv->mbh+cv->infoh;
- int x,y;
- GRect rect;
- Color def_fg = GDrawGetDefaultForeground(NULL);
-
- xmin = -cv->xoff/cv->scale;
- xmax = (cv->width-cv->xoff)/cv->scale;
- ymin = -cv->yoff/cv->scale;
- ymax = (cv->height-cv->yoff)/cv->scale;
- onehundred = 100/cv->scale;
-
- if ( onehundred<5 ) {
- units = 1; littleunits=0;
- } else if ( onehundred<10 ) {
- units = 5; littleunits=1;
- } else if ( onehundred<50 ) {
- units = 10; littleunits=2;
- } else if ( onehundred<100 ) {
- units = 25; littleunits=5;
- } else if ( onehundred<500 ) {
- units = 100; littleunits=20;
- } else if ( onehundred<1000 ) {
- units = 250; littleunits=50;
- } else if ( onehundred<5000 ) {
- units = 1000; littleunits=200;
- } else if ( onehundred<10000 ) {
- units = 2500; littleunits=500;
- } else if ( onehundred<10000 ) {
- units = 10000; littleunits=2000;
- } else {
- for ( units=1 ; units<onehundred; units *= 10 );
- units/=10; littleunits = units/2;
- }
-
- rect.x = 0; rect.width = cv->width+cv->rulerh; rect.y = ybase; rect.height = cv->rulerh;
- GDrawFillRect(pixmap,&rect,GDrawGetDefaultBackground(NULL));
- rect.y = ybase; rect.height = cv->height+cv->rulerh; rect.x = 0; rect.width = cv->rulerh;
- GDrawFillRect(pixmap,&rect,GDrawGetDefaultBackground(NULL));
- GDrawSetLineWidth(pixmap,0);
- GDrawDrawLine(pixmap,cv->rulerh,cv->mbh+cv->infoh+cv->rulerh-1,8096,cv->mbh+cv->infoh+cv->rulerh-1,def_fg);
- GDrawDrawLine(pixmap,cv->rulerh-1,cv->mbh+cv->infoh+cv->rulerh,cv->rulerh-1,8096,def_fg);
-
- GDrawSetFont(pixmap,cv->small);
- if ( xmax-xmin<1 && cv->width>100 ) {
- CVDrawNum(cv,pixmap,cv->rulerh,ybase+cv->sas,"%.3f",xmin,0);
- CVDrawNum(cv,pixmap,cv->rulerh+cv->width,ybase+cv->sas,"%.3f",xmax,2);
- }
- if ( ymax-ymin<1 && cv->height>100 ) {
- CVDrawVNum(cv,pixmap,1,ybase+cv->rulerh+cv->height+cv->sas,"%.3f",ymin,0);
- CVDrawVNum(cv,pixmap,1,ybase+cv->rulerh+cv->sas,"%.3f",ymax,2);
- }
- if ( fabs(xmin/units) < 1e5 && fabs(ymin/units)<1e5 && fabs(xmax/units)<1e5 && fabs(ymax/units)<1e5 ) {
- if ( littleunits!=0 ) {
- for ( pos=littleunits*ceil(xmin/littleunits); pos<xmax; pos += littleunits ) {
- x = cv->xoff + rint(pos*cv->scale);
- GDrawDrawLine(pixmap,x+cv->rulerh,ybase+cv->rulerh-4,x+cv->rulerh,ybase+cv->rulerh, def_fg);
- }
- for ( pos=littleunits*ceil(ymin/littleunits); pos<ymax; pos += littleunits ) {
- y = -cv->yoff + cv->height - rint(pos*cv->scale);
- GDrawDrawLine(pixmap,cv->rulerh-4,ybase+cv->rulerh+y,cv->rulerh,ybase+cv->rulerh+y, def_fg);
- }
- }
- for ( pos=units*ceil(xmin/units); pos<xmax; pos += units ) {
- x = cv->xoff + rint(pos*cv->scale);
- GDrawDrawLine(pixmap,x+cv->rulerh,ybase+cv->rulerh-6,x+cv->rulerh,ybase+cv->rulerh, def_fg);
- CVDrawNum(cv,pixmap,x+cv->rulerh,ybase+cv->sas,"%g",pos,1);
- }
- for ( pos=units*ceil(ymin/units); pos<ymax; pos += units ) {
- y = -cv->yoff + cv->height - rint(pos*cv->scale);
- GDrawDrawLine(pixmap,cv->rulerh-6,ybase+cv->rulerh+y,cv->rulerh,ybase+cv->rulerh+y, def_fg);
- CVDrawVNum(cv,pixmap,1,y+ybase+cv->rulerh+cv->sas,"%g",pos,1);
- }
- }
-}
-
-static void InfoExpose(CharView *cv, GWindow pixmap, GEvent *expose) {
- GRect old1, old2;
- Color def_fg = GDrawGetDefaultForeground(NULL);
-
- if ( expose->u.expose.rect.y + expose->u.expose.rect.height < cv->mbh ||
- (!cv->showrulers && expose->u.expose.rect.y >= cv->mbh+cv->infoh ))
-return;
-
- GDrawPushClip(pixmap,&expose->u.expose.rect,&old1);
- GDrawSetLineWidth(pixmap,0);
- if ( expose->u.expose.rect.y< cv->mbh+cv->infoh ) {
-#if 0
- r.x = 0; r.width = 8096;
- r.y = cv->mbh; r.height = cv->infoh;
-#endif
- GDrawPushClip(pixmap,&expose->u.expose.rect,&old2);
-
- GDrawDrawLine(pixmap,0,cv->mbh+cv->infoh-1,8096,cv->mbh+cv->infoh-1,def_fg);
- GDrawDrawImage(pixmap,&GIcon_rightpointer,NULL,RPT_BASE,cv->mbh+2);
- GDrawDrawImage(pixmap,&GIcon_selectedpoint,NULL,SPT_BASE,cv->mbh+2);
- GDrawDrawImage(pixmap,&GIcon_sel2ptr,NULL,SOF_BASE,cv->mbh+2);
- GDrawDrawImage(pixmap,&GIcon_distance,NULL,SDS_BASE,cv->mbh+2);
- GDrawDrawImage(pixmap,&GIcon_angle,NULL,SAN_BASE,cv->mbh+2);
- GDrawDrawImage(pixmap,&GIcon_mag,NULL,MAG_BASE,cv->mbh+2);
- CVInfoDrawText(cv,pixmap);
- GDrawPopClip(pixmap,&old2);
- }
- if ( cv->showrulers ) {
- CVExposeRulers(cv,pixmap);
- cv->olde.x = -1;
- CVInfoDrawRulers(cv,pixmap);
- }
- GDrawPopClip(pixmap,&old1);
-}
-
-void CVResize(CharView *cv ) {
- int sbsize = GDrawPointsToPixels(cv->gw,_GScrollBar_Width);
- GRect size;
- GDrawGetSize(cv->gw,&size);
- {
- int newwidth = size.width-sbsize,
- newheight = size.height-sbsize - cv->mbh-cv->infoh;
- int sbwidth = newwidth, sbheight = newheight;
-
- if ( cv->dv!=NULL ) {
- newwidth -= cv->dv->dwidth;
- sbwidth -= cv->dv->dwidth;
- }
- if ( newwidth<30 || newheight<50 ) {
- if ( newwidth<30 )
- newwidth = 30+sbsize+(cv->dv!=NULL ? cv->dv->dwidth : 0);
- if ( newheight<50 )
- newheight = 50+sbsize+cv->mbh+cv->infoh;
- GDrawResize(cv->gw,newwidth,newheight);
-return;
- }
-
- if ( cv->dv!=NULL ) {
- int dvheight = size.height-(cv->mbh+cv->infoh);
- GDrawMove(cv->dv->dv,size.width-cv->dv->dwidth,cv->mbh+cv->infoh);
- GDrawResize(cv->dv->dv,cv->dv->dwidth,dvheight);
- GDrawResize(cv->dv->ii.v,cv->dv->dwidth-sbsize,dvheight-cv->dv->toph);
- GGadgetResize(cv->dv->ii.vsb,sbsize,dvheight-cv->dv->toph);
- cv->dv->ii.vheight = dvheight-cv->dv->toph;
- GDrawRequestExpose(cv->dv->dv,NULL,false);
- GDrawRequestExpose(cv->dv->ii.v,NULL,false);
- GScrollBarSetBounds(cv->dv->ii.vsb,0,cv->dv->ii.lheight+1,
- cv->dv->ii.vheight/cv->dv->ii.fh);
- }
- if ( cv->showrulers ) {
- newheight -= cv->rulerh;
- newwidth -= cv->rulerh;
- }
-
- if ( newwidth == cv->width && newheight == cv->height )
-return;
- if ( cv->backimgs!=NULL )
- GDrawDestroyWindow(cv->backimgs);
- cv->backimgs = NULL;
-
- /* MenuBar takes care of itself */
- GDrawResize(cv->v,newwidth,newheight);
- GGadgetMove(cv->vsb,sbwidth, cv->mbh+cv->infoh);
- GGadgetResize(cv->vsb,sbsize,sbheight);
- GGadgetMove(cv->hsb,0,size.height-sbsize);
- GGadgetResize(cv->hsb,sbwidth,sbsize);
- cv->width = newwidth; cv->height = newheight;
- CVFit(cv);
- CVPalettesRaise(cv);
- }
-}
-
-static void CVHScroll(CharView *cv,struct sbevent *sb) {
- int newpos = cv->xoff;
-
- switch( sb->type ) {
- case et_sb_top:
- newpos = 0;
- break;
- case et_sb_uppage:
- newpos += 9*cv->width/10;
- break;
- case et_sb_up:
- newpos += cv->width/15;
- break;
- case et_sb_down:
- newpos -= cv->width/15;
- break;
- case et_sb_downpage:
- newpos -= 9*cv->width/10;
- break;
- case et_sb_bottom:
- newpos = 0;
- break;
- case et_sb_thumb:
- case et_sb_thumbrelease:
- newpos = -sb->pos;
- break;
- case et_sb_halfup:
- newpos += cv->width/30;
- break;
- case et_sb_halfdown:
- newpos -= cv->width/30;
- break;
- }
- if ( newpos<-(32000*cv->scale-cv->width) )
- newpos = -(32000*cv->scale-cv->width);
- if ( newpos>8000*cv->scale ) newpos = 8000*cv->scale;
- if ( newpos!=cv->xoff ) {
- int diff = newpos-cv->xoff;
- cv->xoff = newpos;
- cv->back_img_out_of_date = true;
- GScrollBarSetPos(cv->hsb,-newpos);
- GDrawScroll(cv->v,NULL,diff,0);
- if (( cv->showhhints && cv->sc->hstem!=NULL ) || cv->showblues || cv->showvmetrics ) {
- GRect r;
- r.y = 0; r.height = cv->height;
- r.width = 6*cv->sfh+10;
- if ( diff>0 )
- r.x = cv->width-r.width;
- else
- r.x = cv->width+diff-r.width;
- GDrawRequestExpose(cv->v,&r,false);
- }
- if ( cv->showrulers ) {
- GRect r;
- r.y = cv->infoh+cv->mbh; r.height = cv->rulerh; r.x = 0; r.width = cv->rulerh+cv->width;
- GDrawRequestExpose(cv->gw,&r,false);
- }
- }
-}
-
-static void CVVScroll(CharView *cv,struct sbevent *sb) {
- int newpos = cv->yoff;
-
- switch( sb->type ) {
- case et_sb_top:
- newpos = 0;
- break;
- case et_sb_uppage:
- newpos -= 9*cv->height/10;
- break;
- case et_sb_up:
- newpos -= cv->height/15;
- break;
- case et_sb_down:
- newpos += cv->height/15;
- break;
- case et_sb_downpage:
- newpos += 9*cv->height/10;
- break;
- case et_sb_bottom:
- newpos = 0;
- break;
- case et_sb_thumb:
- case et_sb_thumbrelease:
- newpos = sb->pos+cv->height;
- break;
- case et_sb_halfup:
- newpos -= cv->height/30;
- break;
- case et_sb_halfdown:
- newpos += cv->height/30;
- break;
- }
- if ( newpos<-(20000*cv->scale-cv->height) )
- newpos = -(20000*cv->scale-cv->height);
- if ( newpos>8000*cv->scale ) newpos = 8000*cv->scale;
- if ( newpos!=cv->yoff ) {
- int diff = newpos-cv->yoff;
- cv->yoff = newpos;
- cv->back_img_out_of_date = true;
- GScrollBarSetPos(cv->vsb,newpos-cv->height);
- GDrawScroll(cv->v,NULL,0,diff);
- if (( cv->showvhints && cv->sc->vstem!=NULL) || cv->showhmetrics ) {
- GRect r;
- r.x = 0; r.width = cv->width;
- r.height = 2*cv->sfh+6;
- if ( diff>0 )
- r.y = 0;
- else
- r.y = -diff;
- GDrawRequestExpose(cv->v,&r,false);
- }
- if ( cv->showrulers ) {
- GRect r;
- r.x = 0; r.width = cv->rulerh; r.y = cv->infoh+cv->mbh; r.height = cv->rulerh+cv->height;
- GDrawRequestExpose(cv->gw,&r,false);
- }
- }
-}
-
-void LogoExpose(GWindow pixmap,GEvent *event, GRect *r,enum drawmode dm) {
- int sbsize = GDrawPointsToPixels(pixmap,_GScrollBar_Width);
- GRect old;
-
- r->width = r->height = sbsize;
- if ( event->u.expose.rect.x+event->u.expose.rect.width >= r->x &&
- event->u.expose.rect.y+event->u.expose.rect.height >= r->y ) {
- /* Put something into the little box where the two scroll bars meet */
- int xoff, yoff;
- GImage *which = (dm==dm_fore) ? &GIcon_FontForgeLogo :
- (dm==dm_back) ? &GIcon_FontForgeBack :
- &GIcon_FontForgeGuide;
- struct _GImage *base = which->u.image;
- xoff = (sbsize-base->width);
- yoff = (sbsize-base->height);
- GDrawPushClip(pixmap,r,&old);
- GDrawDrawImage(pixmap,which,NULL,
- r->x+(xoff-xoff/2),r->y+(yoff-yoff/2));
- GDrawPopClip(pixmap,&old);
- /*GDrawDrawLine(pixmap,r->x+sbsize-1,r->y,r->x+sbsize-1,r->y+sbsize,0x000000);*/
- }
-}
-
-static void CVLogoExpose(CharView *cv,GWindow pixmap,GEvent *event) {
- int rh = cv->showrulers ? cv->rulerh : 0;
- GRect r;
-
- r.x = cv->width+rh;
- r.y = cv->height+cv->mbh+cv->infoh+rh;
- LogoExpose(pixmap,event,&r,cv->drawmode);
-}
-
-static int cv_e_h(GWindow gw, GEvent *event) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if (( event->type==et_mouseup || event->type==et_mousedown ) &&
- (event->u.mouse.button==4 || event->u.mouse.button==5) ) {
-return( GGadgetDispatchEvent(cv->vsb,event));
- }
-
- switch ( event->type ) {
- case et_selclear:
- ClipboardClear();
- break;
- case et_expose:
- GDrawSetLineWidth(gw,0);
- InfoExpose(cv,gw,event);
- CVLogoExpose(cv,gw,event);
- break;
- case et_char:
- if ( cv->searcher!=NULL )
- SVChar(cv->searcher,event);
- else
- CVChar(cv,event);
- break;
- case et_charup:
- CVCharUp(cv,event);
- break;
- case et_resize:
- if ( event->u.resize.sized )
- CVResize(cv);
- break;
- case et_controlevent:
- switch ( event->u.control.subtype ) {
- case et_scrollbarchange:
- if ( event->u.control.g == cv->hsb )
- CVHScroll(cv,&event->u.control.u.sb);
- else
- CVVScroll(cv,&event->u.control.u.sb);
- break;
- }
- break;
- case et_map:
- if ( event->u.map.is_visible )
- CVPaletteActivate(cv);
- else
- CVPalettesHideIfMine(cv);
- break;
- case et_destroy:
- CVUnlinkView(cv);
- CVPalettesHideIfMine(cv);
- if ( cv->backimgs!=NULL ) {
- GDrawDestroyWindow(cv->backimgs);
- cv->backimgs = NULL;
- }
- if ( cv->icon!=NULL ) {
- GDrawDestroyWindow(cv->icon);
- cv->icon = NULL;
- }
- CharViewFree(cv);
- break;
- case et_close:
- GDrawDestroyWindow(gw);
- break;
- case et_mouseup: case et_mousedown:
- GGadgetEndPopup();
- CVPaletteActivate(cv);
- if ( cv->inactive )
- SVMakeActive(cv->searcher,cv);
- break;
- case et_mousemove:
- if ( event->u.mouse.y>cv->mbh ) {
- int enc = CVCurEnc(cv);
- SCPreparePopup(cv->gw,cv->sc,cv->fv->map->remap,enc,
- UniFromEnc(enc,cv->fv->map->enc));
- }
- break;
- case et_drop:
- CVDrop(cv,event);
- break;
- case et_focus:
- if ( event->u.focus.gained_focus ) {
- if ( cv->gic!=NULL )
- GDrawSetGIC(gw,cv->gic,0,20);
-#if 0
- CVPaletteActivate(cv);
-#endif
- }
- break;
- }
-return( true );
-}
-
-#define MID_Fit 2001
-#define MID_ZoomIn 2002
-#define MID_ZoomOut 2003
-#define MID_HidePoints 2004
-#define MID_Fill 2006
-#define MID_Next 2007
-#define MID_Prev 2008
-#define MID_HideRulers 2009
-#define MID_NextDef 2012
-#define MID_PrevDef 2013
-#define MID_DisplayCompositions 2014
-#define MID_MarkExtrema 2015
-#define MID_Goto 2016
-#define MID_FindInFontView 2017
-#define MID_KernPairs 2018
-#define MID_AnchorPairs 2019
-#define MID_ShowGridFit 2020
-#define MID_PtsNone 2021
-#define MID_PtsTrue 2022
-#define MID_PtsPost 2023
-#define MID_PtsSVG 2024
-#define MID_Ligatures 2025
-#define MID_Former 2026
-#define MID_MarkPointsOfInflection 2027
-#define MID_ShowCPInfo 2028
-#define MID_ShowTabs 2029
-#define MID_AnchorGlyph 2030
-#define MID_AnchorControl 2031
-#define MID_ShowSideBearings 2032
-#define MID_Cut 2101
-#define MID_Copy 2102
-#define MID_Paste 2103
-#define MID_Clear 2104
-#define MID_Merge 2105
-#define MID_SelAll 2106
-#define MID_CopyRef 2107
-#define MID_UnlinkRef 2108
-#define MID_Undo 2109
-#define MID_Redo 2110
-#define MID_CopyWidth 2111
-#define MID_RemoveUndoes 2112
-#define MID_CopyFgToBg 2115
-#define MID_NextPt 2116
-#define MID_PrevPt 2117
-#define MID_FirstPt 2118
-#define MID_NextCP 2119
-#define MID_PrevCP 2120
-#define MID_SelNone 2121
-#define MID_SelectWidth 2122
-#define MID_SelectVWidth 2123
-#define MID_CopyLBearing 2124
-#define MID_CopyRBearing 2125
-#define MID_CopyVWidth 2126
-#define MID_Join 2127
-#define MID_CopyGridFit 2128
-#define MID_Elide 2129
-#define MID_SelectAllPoints 2130
-#define MID_SelectAnchors 2131
-#define MID_FirstPtNextCont 2132
-#define MID_Contours 2133
-#define MID_SelectHM 2134
-#define MID_SelInvert 2136
-#define MID_CopyBgToFg 2137
-#define MID_SelPointAt 2138
-#define MID_CopyLookupData 2139
-#define MID_Clockwise 2201
-#define MID_Counter 2202
-#define MID_GetInfo 2203
-#define MID_Correct 2204
-#define MID_AvailBitmaps 2210
-#define MID_RegenBitmaps 2211
-#define MID_Stroke 2205
-#define MID_RmOverlap 2206
-#define MID_Simplify 2207
-#define MID_BuildAccent 2208
-#define MID_Autotrace 2212
-#define MID_Round 2213
-#define MID_MetaFont 2217
-#define MID_Average 2219
-#define MID_SpacePts 2220
-#define MID_SpaceRegion 2221
-#define MID_MakeParallel 2222
-#define MID_ShowDependentRefs 2223
-#define MID_AddExtrema 2224
-#define MID_CleanupGlyph 2225
-#define MID_TilePath 2226
-#define MID_BuildComposite 2227
-#define MID_Exclude 2228
-#define MID_Intersection 2229
-#define MID_FindInter 2230
-#define MID_Effects 2231
-#define MID_SimplifyMore 2232
-#define MID_First 2233
-#define MID_Earlier 2234
-#define MID_Later 2235
-#define MID_Last 2236
-#define MID_CharInfo 2240
-#define MID_ShowDependentSubs 2241
-#define MID_CanonicalStart 2242
-#define MID_CanonicalContours 2243
-#define MID_RemoveBitmaps 2244
-#define MID_Corner 2301
-#define MID_Tangent 2302
-#define MID_Curve 2303
-#define MID_MakeFirst 2304
-#define MID_MakeLine 2305
-#define MID_CenterCP 2306
-#define MID_ImplicitPt 2307
-#define MID_NoImplicitPt 2308
-#define MID_InsertPtOnSplineAt 2309
-#define MID_AddAnchor 2310
-#define MID_AutoHint 2400
-#define MID_ClearHStem 2401
-#define MID_ClearVStem 2402
-#define MID_AddHHint 2404
-#define MID_AddVHint 2405
-#define MID_AddDHint 2406
-#define MID_ReviewHints 2407
-#define MID_CreateHHint 2408
-#define MID_CreateVHint 2409
-#define MID_MinimumDistance 2410
-#define MID_AutoInstr 2411
-#define MID_ClearInstr 2412
-#define MID_EditInstructions 2413
-#define MID_Debug 2414
-#define MID_HintSubsPt 2415
-#define MID_AutoCounter 2416
-#define MID_DontAutoHint 2417
-#define MID_Tools 2501
-#define MID_Layers 2502
-#define MID_DockPalettes 2503
-#define MID_Center 2600
-#define MID_SetWidth 2601
-#define MID_SetLBearing 2602
-#define MID_SetRBearing 2603
-#define MID_Thirds 2604
-#define MID_RemoveKerns 2605
-#define MID_SetVWidth 2606
-#define MID_RemoveVKerns 2607
-#define MID_KPCloseup 2608
-#define MID_AnchorsAway 2609
-#define MID_OpenBitmap 2700
-#define MID_Revert 2702
-#define MID_Recent 2703
-#define MID_Display 2706
-#define MID_RevertGlyph 2707
-
-#define MID_MMReblend 2800
-#define MID_MMAll 2821
-#define MID_MMNone 2822
-
-#define MID_Warnings 3000
-
-static void CVMenuClose(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- GDrawDestroyWindow(gw);
-}
-
-static void CVMenuOpenBitmap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- if ( cv->fv->sf->bitmaps==NULL )
-return;
- BitmapViewCreatePick(CVCurEnc(cv),cv->fv);
-}
-
-static void CVMenuOpenMetrics(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- MetricsViewCreate(cv->fv,cv->sc,NULL);
-}
-
-static void CVMenuSave(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _FVMenuSave(cv->fv);
-}
-
-static void CVMenuSaveAs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _FVMenuSaveAs(cv->fv);
-}
-
-static void CVMenuGenerate(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _FVMenuGenerate(cv->fv,false);
-}
-
-static void CVMenuGenerateFamily(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _FVMenuGenerate(cv->fv,true);
-}
-
-static void CVMenuExport(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVExport(cv);
-}
-
-static void CVMenuImport(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVImport(cv);
-}
-
-static void CVMenuRevert(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- FVDelay(cv->fv,FVRevert); /* The revert command can potentially */
- /* destroy our window (if the char weren't in the */
- /* old font). If that happens before the menu finishes */
- /* we get a crash. So delay till after the menu completes */
-}
-
-void RevertedGlyphReferenceFixup(SplineChar *sc, SplineFont *sf) {
- RefChar *refs, *prev, *next;
-
- for ( prev=NULL, refs = sc->layers[ly_fore].refs ; refs!=NULL; refs = next ) {
- next = refs->next;
- if ( refs->orig_pos<sf->glyphcnt && sf->glyphs[refs->orig_pos]!=NULL ) {
- prev = refs;
- refs->sc = sf->glyphs[refs->orig_pos];
- refs->unicode_enc = refs->sc->unicodeenc;
- SCReinstanciateRefChar(sc,refs);
- SCMakeDependent(sc,refs->sc);
- } else {
- if ( prev==NULL )
- sc->layers[ly_fore].refs = next;
- else
- prev->next = next;
- RefCharFree(refs);
- }
- }
-}
-
-static void CVMenuRevertGlyph(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplineChar *sc, temp;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Undoes **undoes;
- int layer, lc;
-#endif
- CharView *cvs;
-
- if ( cv->sc->parent->filename==NULL || cv->sc->namechanged || cv->sc->parent->mm!=NULL )
-return;
- if ( cv->sc->parent->sfd_version<2 )
- gwwv_post_error(_("Old sfd file"),_("This font comes from an old format sfd file. Not all aspects of it can be reverted successfully."));
-
- sc = SFDReadOneChar(cv->sc->parent,cv->sc->name);
- if ( sc==NULL ) {
- gwwv_post_error(_("Can't Find Glyph"),_("The glyph, %.80s, can't be found in the sfd file"),cv->sc->name);
- cv->sc->namechanged = true;
- } else {
- SCPreserveState(cv->sc,true);
- SCPreserveBackground(cv->sc);
- temp = *cv->sc;
- cv->sc->dependents = NULL;
-#ifdef FONTFORGE_CONFIG_TYPE3
- lc = cv->sc->layer_cnt;
- undoes = galloc(lc*sizeof(Undoes *));
- for ( layer=0; layer<lc; ++layer ) {
- undoes[layer] = cv->sc->layers[layer].undoes;
- cv->sc->layers[layer].undoes = NULL;
- }
-#else
- cv->sc->layers[ly_fore].undoes = cv->sc->layers[ly_back].undoes = NULL;
-#endif
- SplineCharFreeContents(cv->sc);
- *cv->sc = *sc;
- chunkfree(sc,sizeof(SplineChar));
- cv->sc->parent = temp.parent;
- cv->sc->dependents = temp.dependents;
-#ifdef FONTFORGE_CONFIG_TYPE3
- for ( layer = 0; layer<lc && layer<cv->sc->layer_cnt; ++layer )
- cv->sc->layers[layer].undoes = undoes[layer];
- for ( ; layer<lc; ++layer )
- UndoesFree(undoes[layer]);
- free(undoes);
-#else
- cv->sc->layers[ly_fore].undoes = temp.layers[ly_fore].undoes;
- cv->sc->layers[ly_back].undoes = temp.layers[ly_back].undoes;
-#endif
- cv->sc->views = temp.views;
- /* cv->sc->changed = temp.changed; */
- for ( cvs=cv->sc->views; cvs!=NULL; cvs=cvs->next ) {
- cvs->layerheads[dm_back] = &cv->sc->layers[ly_back];
- cvs->layerheads[dm_fore] = &cv->sc->layers[ly_fore];
- }
- RevertedGlyphReferenceFixup(cv->sc, temp.parent);
- _CVCharChangedUpdate(cv,false);
- }
-}
-
-static void CVMenuPrint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- PrintDlg(NULL,cv->sc,NULL);
-}
-
-static void CVMenuDisplay(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- DisplayDlg(cv->sc->parent);
-}
-
-static void fllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Revert:
- mi->ti.disabled = cv->fv->sf->origname==NULL || cv->fv->sf->new;
- break;
- case MID_RevertGlyph:
- mi->ti.disabled = cv->fv->sf->filename==NULL ||
- cv->fv->sf->sfd_version<2 ||
- cv->sc->namechanged ||
- cv->fv->sf->mm!=NULL;
- break;
- case MID_Recent:
- mi->ti.disabled = !RecentFilesAny();
- break;
- case MID_Display:
- mi->ti.disabled = (cv->fv->sf->onlybitmaps && cv->fv->sf->bitmaps==NULL) ||
- cv->fv->sf->multilayer;
- break;
- }
- }
-}
-
-static void CVMenuFontInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- DelayEvent(FontMenuFontInfo,cv->fv);
-}
-
-static void CVMenuFindProblems(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- FindProblems(NULL,cv,NULL);
-}
-
-static void CVMenuMetaFont(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-#ifdef GWW_TEST
- extern int ChangeWeight(SplineChar *sc,double factor,double add);
- ChangeWeight(cv->sc,2.0,25);
-#else
- MetaFont(NULL,cv,NULL);
-#endif
-}
-
-static void CVMenuInline(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- OutlineDlg(NULL,cv,NULL,true);
-}
-
-static void CVMenuOutline(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- OutlineDlg(NULL,cv,NULL,false);
-}
-
-static void CVMenuShadow(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- ShadowDlg(NULL,cv,NULL,false);
-}
-
-static void CVMenuWireframe(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- ShadowDlg(NULL,cv,NULL,true);
-}
-
-static void _CVMenuScale(CharView *cv,struct gmenuitem *mi) {
-
- if ( mi->mid == MID_Fit ) {
- CVFit(cv);
- } else {
- BasePoint c;
- c.x = (cv->width/2-cv->xoff)/cv->scale;
- c.y = (cv->height/2-cv->yoff)/cv->scale;
- if ( CVAnySel(cv,NULL,NULL,NULL,NULL))
- CVFindCenter(cv,&c,false);
- CVMagnify(cv,c.x,c.y,mi->mid==MID_ZoomOut?-1:1);
- }
-}
-
-static void CVMenuScale(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuScale(cv,mi);
-}
-
-static void CVMenuShowHide(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVShows.showpoints = cv->showpoints = !cv->showpoints;
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void CVMenuNumberPoints(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- switch ( mi->mid ) {
- case MID_PtsNone:
- cv->showpointnumbers = false;
- break;
- case MID_PtsTrue:
- cv->showpointnumbers = true;
- break;
- case MID_PtsPost:
- cv->showpointnumbers = true;
- cv->sc->numberpointsbackards = true;
- break;
- case MID_PtsSVG:
- cv->showpointnumbers = true;
- cv->sc->numberpointsbackards = false;
- break;
- }
- SCNumberPoints(cv->sc);
- SCUpdateAll(cv->sc);
-}
-
-static void CVMenuMarkExtrema(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVShows.markextrema = cv->markextrema = !cv->markextrema;
- SavePrefs();
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void CVMenuMarkPointsOfInflection(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVShows.markpoi = cv->markpoi = !cv->markpoi;
- SavePrefs();
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void CVMenuShowCPInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVShows.showcpinfo = cv->showcpinfo = !cv->showcpinfo;
- SavePrefs();
- /* Nothing to update, only show this stuff in the user is moving a cp */
- /* which s/he is currently not, s/he is manipulating the menu */
-}
-
-static void CVMenuShowTabs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVShows.showtabs = cv->showtabs = !cv->showtabs;
- CVChangeTabsVisibility(cv,cv->showtabs);
- SavePrefs();
-}
-
-static void CVMenuShowSideBearings(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVShows.showsidebearings = cv->showsidebearings = !cv->showsidebearings;
- SavePrefs();
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void _CVMenuShowHideRulers(CharView *cv) {
- GRect pos;
-
- CVShows.showrulers = cv->showrulers = !cv->showrulers;
- pos.y = cv->mbh+cv->infoh;
- pos.x = 0;
- if ( cv->showrulers ) {
- cv->height -= cv->rulerh;
- cv->width -= cv->rulerh;
- pos.y += cv->rulerh;
- pos.x += cv->rulerh;
- } else {
- cv->height += cv->rulerh;
- cv->width += cv->rulerh;
- }
- cv->back_img_out_of_date = true;
- pos.width = cv->width; pos.height = cv->height;
- GDrawMoveResize(cv->v,pos.x,pos.y,pos.width,pos.height);
- GDrawSync(NULL);
- GDrawRequestExpose(cv->v,NULL,false);
- SavePrefs();
-}
-
-static void CVMenuShowHideRulers(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuShowHideRulers(cv);
-}
-
-static void CVMenuFill(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVShows.showfilled = cv->showfilled = !cv->showfilled;
- CVRegenFill(cv);
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void CVMenuShowGridFit(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( !hasFreeType() || cv->drawmode!=dm_fore || cv->dv!=NULL )
-return;
- CVFtPpemDlg(cv,false);
-}
-
-static void CVMenuEditInstrs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- SCEditInstructions(cv->sc);
-}
-
-static void CVMenuDebug(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( !hasFreeTypeDebugger())
-return;
- CVFtPpemDlg(cv,true);
-}
-
-static void CVMenuClearInstrs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( cv->sc->ttf_instrs_len!=0 ) {
- free(cv->sc->ttf_instrs);
- cv->sc->ttf_instrs = NULL;
- cv->sc->ttf_instrs_len = 0;
- cv->sc->instructions_out_of_date = false;
- SCCharChangedUpdate(cv->sc);
- SCMarkInstrDlgAsChanged(cv->sc);
- cv->sc->complained_about_ptnums = false; /* Should be after CharChanged */
- }
-}
-
-static void CVMenuKernPairs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SFShowKernPairs(cv->sc->parent,cv->sc,NULL);
-}
-
-static void CVMenuLigatures(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SFShowLigatures(cv->fv->sf,cv->sc);
-}
-
-static void CVMenuAnchorPairs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SFShowKernPairs(cv->sc->parent,cv->sc,(AnchorClass *) (-1));
-}
-
-static void CVMenuAPDetach(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv->apmine = cv->apmatch = NULL;
- cv->apsc = NULL;
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void CVMenuAPAttachSC(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- enum anchor_type type;
- AnchorPoint *ap;
- AnchorClass *ac;
-
- ap = mi->ti.userdata;
- if ( ap==NULL )
- for ( ap = cv->sc->anchor; ap!=NULL && !ap->selected; ap=ap->next );
- if ( ap==NULL )
- ap = cv->sc->anchor;
- if ( ap==NULL )
-return;
- type = ap->type;
- cv->apmine = ap;
- ac = ap->anchor;
- cv->apsc = mi->ti.userdata;
- for ( ap = cv->apsc->anchor; ap!=NULL ; ap=ap->next ) {
- if ( ap->anchor==ac &&
- ((type==at_centry && ap->type==at_cexit) ||
- (type==at_cexit && ap->type==at_centry) ||
- (type==at_mark && ap->type!=at_mark) ||
- ((type==at_basechar || type==at_baselig || type==at_basemark) && ap->type==at_mark)) )
- break;
- }
- cv->apmatch = ap;
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static SplineChar **GlyphsMatchingAP(SplineFont *sf, AnchorPoint *ap) {
- SplineChar *sc;
- AnchorClass *ac = ap->anchor;
- enum anchor_type type = ap->type;
- int i, k, gcnt;
- SplineChar **glyphs;
-
- glyphs = NULL;
- for ( k=0; k<2; ++k ) {
- gcnt = 0;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc=sf->glyphs[i])!=NULL ) {
- for ( ap = sc->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor == ac &&
- ((type==at_centry && ap->type==at_cexit) ||
- (type==at_cexit && ap->type==at_centry) ||
- (type==at_mark && ap->type!=at_mark) ||
- ((type==at_basechar || type==at_baselig || type==at_basemark) && ap->type==at_mark)) )
- break;
- }
- if ( ap!=NULL ) {
- if ( k )
- glyphs[gcnt] = sc;
- ++gcnt;
- }
- }
- if ( !k ) {
- if ( gcnt==0 )
-return( NULL );
- glyphs = galloc((gcnt+1)*sizeof(SplineChar *));
- } else
- glyphs[gcnt] = NULL;
- }
-return( glyphs );
-}
-
-static void _CVMenuChangeChar(CharView *cv,int mid ) {
- SplineFont *sf = cv->sc->parent;
- int pos = -1;
- int gid;
- EncMap *map = cv->fv->map;
- Encoding *enc = map->enc;
-
- if ( cv->searcher!=NULL )
-return;
- if ( mid == MID_Next ) {
- pos = CVCurEnc(cv)+1;
- } else if ( mid == MID_Prev ) {
- pos = CVCurEnc(cv)-1;
- } else if ( mid == MID_NextDef ) {
- for ( pos = CVCurEnc(cv)+1; pos<map->enccount &&
- ((gid=map->map[pos])==-1 || !SCWorthOutputting(sf->glyphs[gid])); ++pos );
- if ( pos>=map->enccount ) {
- if ( enc->is_tradchinese ) {
- if ( strstrmatch(enc->enc_name,"hkscs")!=NULL ) {
- if ( CVCurEnc(cv)<0x8140 )
- pos = 0x8140;
- } else {
- if ( CVCurEnc(cv)<0xa140 )
- pos = 0xa140;
- }
- } else if ( CVCurEnc(cv)<0x8431 && strstrmatch(enc->enc_name,"johab")!=NULL )
- pos = 0x8431;
- else if ( CVCurEnc(cv)<0xa1a1 && strstrmatch(enc->iconv_name?enc->iconv_name:enc->enc_name,"EUC")!=NULL )
- pos = 0xa1a1;
- else if ( CVCurEnc(cv)<0x8140 && strstrmatch(enc->enc_name,"sjis")!=NULL )
- pos = 0x8140;
- else if ( CVCurEnc(cv)<0xe040 && strstrmatch(enc->enc_name,"sjis")!=NULL )
- pos = 0xe040;
- if ( pos>=map->enccount )
-return;
- }
- } else if ( mid == MID_PrevDef ) {
- for ( pos = CVCurEnc(cv)-1; pos>=0 &&
- ((gid=map->map[pos])==-1 || !SCWorthOutputting(sf->glyphs[gid])); --pos );
- if ( pos<0 )
-return;
- } else if ( mid == MID_Former ) {
- if ( cv->former_cnt<=1 )
-return;
- for ( gid=sf->glyphcnt-1; gid>=0; --gid )
- if ( sf->glyphs[gid]!=NULL &&
- strcmp(sf->glyphs[gid]->name,cv->former_names[1])==0 )
- break;
- if ( gid<0 )
-return;
- pos = map->backmap[gid];
- }
- /* Werner doesn't think it should wrap */
- if ( pos<0 ) /* pos = map->enccount-1; */
-return;
- else if ( pos>= map->enccount ) /* pos = 0; */
-return;
- if ( pos>=0 && pos<map->enccount )
- CVChangeChar(cv,pos);
-}
-
-
-static void CVMenuChangeChar(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- _CVMenuChangeChar(cv,mi->mid);
-}
-
-void CVChar(CharView *cv, GEvent *event ) {
- extern float arrowAmount;
-
-#if _ModKeysAutoRepeat
- /* Under cygwin these keys auto repeat, they don't under normal X */
- if ( cv->autorpt!=NULL ) {
- GDrawCancelTimer(cv->autorpt); cv->autorpt = NULL;
- if ( cv->keysym == event->u.chr.keysym ) /* It's an autorepeat, ignore it */
-return;
- CVToolsSetCursor(cv,cv->oldstate,NULL);
- }
-#endif
-
-#if MyMemory
- if ( event->u.chr.keysym == GK_F2 ) {
- fprintf( stderr, "Malloc debug on\n" );
- __malloc_debug(5);
- } else if ( event->u.chr.keysym == GK_F3 ) {
- fprintf( stderr, "Malloc debug off\n" );
- __malloc_debug(0);
- }
-#endif
-#if 0
- if ( event->u.chr.keysym == GK_F4 ) {
- RepeatFromFile(cv);
- }
-#endif
-
- CVPaletteActivate(cv);
- CVToolsSetCursor(cv,TrueCharState(event),NULL);
- /* The isalpha check is to prevent infinite loops since DVChar can */
- /* call CVChar too */
- if ( cv->dv!=NULL && isalpha(event->u.chr.chars[0]) && DVChar(cv->dv,event))
- /* All Done */;
- else if ( event->u.chr.keysym=='s' &&
- (event->u.chr.state&ksm_control) &&
- (event->u.chr.state&ksm_meta) )
- MenuSaveAll(NULL,NULL,NULL);
- else if ( event->u.chr.keysym=='q' &&
- (event->u.chr.state&ksm_control) &&
- (event->u.chr.state&ksm_meta) )
- MenuExit(NULL,NULL,NULL);
- else if ( event->u.chr.keysym == GK_Shift_L || event->u.chr.keysym == GK_Shift_R ||
- event->u.chr.keysym == GK_Alt_L || event->u.chr.keysym == GK_Alt_R ||
- event->u.chr.keysym == GK_Meta_L || event->u.chr.keysym == GK_Meta_R ) {
- CVFakeMove(cv, event);
- } else if ( (event->u.chr.state&ksm_meta) &&
- !(event->u.chr.state&(ksm_control|ksm_shift)) &&
- event->u.chr.chars[0]!='\0' ) {
- CVPaletteMnemonicCheck(event);
- } else if ( !(event->u.chr.state&(ksm_control|ksm_meta)) &&
- event->u.chr.keysym == GK_BackSpace ) {
- /* Menu does delete */
- CVClear(cv->gw,NULL,NULL);
- } else if ( event->u.chr.keysym == GK_Help ) {
- MenuHelp(NULL,NULL,NULL); /* Menu does F1 */
- } else if ( event->u.chr.keysym=='<' && (event->u.chr.state&ksm_control) ) {
- /* European keyboards do not need shift to get < */
- CVDoFindInFontView(cv);
- } else if ( (event->u.chr.keysym=='[' || event->u.chr.keysym==']') &&
- (event->u.chr.state&ksm_control) ) {
- /* European keyboards need a funky modifier to get [] */
- _CVMenuChangeChar(cv,event->u.chr.keysym=='[' ? MID_Prev : MID_Next );
- } else if ( (event->u.chr.keysym=='{' || event->u.chr.keysym=='}') &&
- (event->u.chr.state&ksm_control) ) {
- /* European keyboards need a funky modifier to get {} */
- _CVMenuChangeChar(cv,event->u.chr.keysym=='{' ? MID_PrevDef : MID_NextDef );
- } else if ( event->u.chr.keysym=='\\' && (event->u.chr.state&ksm_control) ) {
- /* European keyboards need a funky modifier to get \ */
- CVDoTransform(cv,cvt_none);
- } else if ( event->u.chr.keysym == GK_Left ||
- event->u.chr.keysym == GK_Up ||
- event->u.chr.keysym == GK_Right ||
- event->u.chr.keysym == GK_Down ||
- event->u.chr.keysym == GK_KP_Left ||
- event->u.chr.keysym == GK_KP_Up ||
- event->u.chr.keysym == GK_KP_Right ||
- event->u.chr.keysym == GK_KP_Down ) {
- real dx=0, dy=0; int anya;
- switch ( event->u.chr.keysym ) {
- case GK_Left: case GK_KP_Left:
- dx = -1;
- break;
- case GK_Right: case GK_KP_Right:
- dx = 1;
- break;
- case GK_Up: case GK_KP_Up:
- dy = 1;
- break;
- case GK_Down: case GK_KP_Down:
- dy = -1;
- break;
- }
- if ( event->u.chr.state & (ksm_control|ksm_capslock) ) {
- struct sbevent sb;
- sb.type = dy>0 || dx<0 ? et_sb_halfup : et_sb_halfdown;
- if ( dx==0 )
- CVVScroll(cv,&sb);
- else
- CVHScroll(cv,&sb);
- } else {
- if ( event->u.chr.state & ksm_meta ) {
- dx *= 10; dy *= 10;
- }
- if ( event->u.chr.state & (ksm_shift) )
- dx -= dy*tan((cv->sc->parent->italicangle)*(3.1415926535897932/180) );
- if (( cv->p.sp!=NULL || cv->lastselpt!=NULL ) &&
- (cv->p.nextcp || cv->p.prevcp) ) {
- SplinePoint *sp = cv->p.sp ? cv->p.sp : cv->lastselpt;
- SplinePoint *old = cv->p.sp;
- BasePoint *which = cv->p.nextcp ? &sp->nextcp : &sp->prevcp;
- BasePoint to;
- to.x = which->x + dx*arrowAmount;
- to.y = which->y + dy*arrowAmount;
- cv->p.sp = sp;
- CVPreserveState(cv);
- CVAdjustControl(cv,which,&to);
- cv->p.sp = old;
- SCUpdateAll(cv->sc);
- } else if ( CVAnySel(cv,NULL,NULL,NULL,&anya) || cv->widthsel || cv->vwidthsel ) {
- CVPreserveState(cv);
- CVMoveSelection(cv,dx*arrowAmount,dy*arrowAmount, event->u.chr.state);
- if ( cv->widthsel )
- SCSynchronizeWidth(cv->sc,cv->sc->width,cv->sc->width-dx,NULL);
- _CVCharChangedUpdate(cv,2);
- CVInfoDraw(cv,cv->gw);
- }
- }
- } else if ( event->u.chr.keysym == GK_Page_Up ||
- event->u.chr.keysym == GK_KP_Page_Up ||
- event->u.chr.keysym == GK_Prior ||
- event->u.chr.keysym == GK_Page_Down ||
- event->u.chr.keysym == GK_KP_Page_Down ||
- event->u.chr.keysym == GK_Next ) {
- /* Um... how do we scroll horizontally??? */
- struct sbevent sb;
- sb.type = et_sb_uppage;
- if ( event->u.chr.keysym == GK_Page_Down ||
- event->u.chr.keysym == GK_KP_Page_Down ||
- event->u.chr.keysym == GK_Next )
- sb.type = et_sb_downpage;
- CVVScroll(cv,&sb);
- } else if ( event->u.chr.keysym == GK_Home ) {
- CVFit(cv);
- } else if ( !(event->u.chr.state&(ksm_control|ksm_meta)) &&
- event->type == et_char &&
- cv->searcher==NULL &&
- cv->dv==NULL &&
- event->u.chr.chars[0]>=' ' && event->u.chr.chars[1]=='\0' ) {
- SplineFont *sf = cv->sc->parent;
- int i;
- EncMap *map = cv->fv->map;
- extern int cv_auto_goto;
- if ( cv_auto_goto ) {
- i = SFFindSlot(sf,map,event->u.chr.chars[0],NULL);
- if ( i!=-1 )
- CVChangeChar(cv,i);
- }
- }
-}
-
-void CVShowPoint(CharView *cv, BasePoint *me) {
- int x, y;
- int fudge = 30;
-
- if ( cv->width<60 )
- fudge = cv->width/3;
- if ( cv->height<60 && fudge>cv->height/3 )
- fudge = cv->height/3;
-
- /* Make sure the point is visible and has some context around it */
- x = cv->xoff + rint(me->x*cv->scale);
- y = -cv->yoff + cv->height - rint(me->y*cv->scale);
- if ( x<fudge || y<fudge || x>cv->width-fudge || y>cv->height-fudge )
- CVMagnify(cv,me->x,me->y,0);
-}
-
-static void CVSelectContours(CharView *cv,struct gmenuitem *mi) {
- SplineSet *spl;
- SplinePoint *sp;
- int sel;
-
- for ( spl=cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl=spl->next ) {
- sel = false;
- for ( sp=spl->first ; ; ) {
- if ( sp->selected ) {
- sel = true;
- break;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- if ( sel ) {
- for ( sp=spl->first ; ; ) {
- sp->selected = true;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
- }
- SCUpdateAll(cv->sc);
-}
-
-static void CVMenuSelectContours(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVSelectContours(cv,mi);
-}
-
-static void CVMenuSelectPointAt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVSelectPointAt(cv);
-}
-
-static void CVNextPrevPt(CharView *cv,struct gmenuitem *mi) {
- SplinePoint *selpt=NULL, *other;
- RefChar *r; ImageList *il;
- SplineSet *spl, *ss;
- int x, y;
-
- if ( mi->mid != MID_FirstPt ) {
- if ( cv->layerheads[cv->drawmode]->splines==NULL )
-return;
- other = (cv->layerheads[cv->drawmode]->splines)->first;
- CVClearSel(cv);
- } else {
- if ( !CVOneThingSel(cv,&selpt,&spl,&r,&il,NULL) || spl==NULL )
-return;
- other = selpt;
- if ( spl==NULL )
-return;
- else if ( mi->mid == MID_NextPt ) {
- if ( other->next!=NULL && other->next->to!=spl->first )
- other = other->next->to;
- else {
- if ( spl->next == NULL )
- spl = cv->layerheads[cv->drawmode]->splines;
- else
- spl = spl->next;
- other = spl->first;
- }
- } else if ( mi->mid == MID_PrevPt ) {
- if ( other!=spl->first ) {
- other = other->prev->from;
- } else {
- if ( spl==cv->layerheads[cv->drawmode]->splines ) {
- for ( ss = cv->layerheads[cv->drawmode]->splines; ss->next!=NULL; ss=ss->next );
- } else {
- for ( ss = cv->layerheads[cv->drawmode]->splines; ss->next!=spl; ss=ss->next );
- }
- spl = ss;
- other = ss->last;
- if ( spl->last==spl->first && spl->last->prev!=NULL )
- other = other->prev->from;
- }
- } else if ( mi->mid == MID_FirstPtNextCont ) {
- if ( spl->next!=NULL )
- other = spl->next->first;
- else
- other = NULL;
- }
- }
- if ( selpt!=NULL )
- selpt->selected = false;
- if ( other!=NULL )
- other->selected = true;
- cv->p.sp = NULL;
- cv->lastselpt = other;
-
- /* Make sure the point is visible and has some context around it */
- if ( other!=NULL ) {
- x = cv->xoff + rint(other->me.x*cv->scale);
- y = -cv->yoff + cv->height - rint(other->me.y*cv->scale);
- if ( x<40 || y<40 || x>cv->width-40 || y>cv->height-40 )
- CVMagnify(cv,other->me.x,other->me.y,0);
- }
-
- CVInfoDraw(cv,cv->gw);
- SCUpdateAll(cv->sc);
-}
-
-static void CVMenuNextPrevPt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVNextPrevPt(cv,mi);
-}
-
-static void CVNextPrevCPt(CharView *cv,struct gmenuitem *mi) {
- SplinePoint *selpt=NULL;
- RefChar *r; ImageList *il;
- SplineSet *spl;
-
- if ( !CVOneThingSel(cv,&selpt,&spl,&r,&il,NULL))
-return;
- if ( selpt==NULL )
-return;
- cv->p.nextcp = mi->mid==MID_NextCP;
- cv->p.prevcp = mi->mid==MID_PrevCP;
- SCUpdateAll(cv->sc);
-}
-
-static void CVMenuNextPrevCPt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVNextPrevCPt(cv,mi);
-}
-
-static void CVMenuGotoChar(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int pos = GotoChar(cv->fv->sf,cv->fv->map);
-
- if ( pos!=-1 )
- CVChangeChar(cv,pos);
-}
-
-static void CVMenuFindInFontView(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVDoFindInFontView(cv);
-}
-
-static void CVMenuPalettesDock(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- PalettesChangeDocking();
-}
-
-static void CVMenuPaletteShow(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVPaletteSetVisible(cv, mi->mid==MID_Tools, !CVPaletteIsVisible(cv, mi->mid==MID_Tools));
-}
-
-static void cv_pllistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
- extern int palettes_docked;
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Tools:
- mi->ti.checked = CVPaletteIsVisible(cv,1);
- break;
- case MID_Layers:
- mi->ti.checked = CVPaletteIsVisible(cv,0);
- break;
- case MID_DockPalettes:
- mi->ti.checked = palettes_docked;
- break;
- }
- }
-}
-
-static void pllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_pllistcheck(cv,mi,e);
-}
-
-static void CVUndo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVDoUndo(cv);
-}
-
-static void CVRedo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVDoRedo(cv);
-}
-
-static void _CVCopy(CharView *cv) {
- int desel = false, anya;
-
- if ( !CVAnySel(cv,NULL,NULL,NULL,&anya))
- if ( !(desel = CVSetSel(cv,-1)))
-return;
- CopySelected(cv);
- if ( desel )
- CVClearSel(cv);
-}
-
-static void CVCopy(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVCopy(cv);
-}
-
-static void CVCopyLookupData(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SCCopyLookupData(cv->sc);
-}
-
-static void CVCopyRef(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CopyReference(cv->sc);
-}
-
-static void CVMenuCopyGridFit(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVCopyGridFit(cv);
-}
-
-static void CVCopyWidth(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- if ( mi->mid==MID_CopyVWidth && !cv->sc->parent->hasvmetrics )
-return;
- CopyWidth(cv,mi->mid==MID_CopyWidth?ut_width:
- mi->mid==MID_CopyVWidth?ut_vwidth:
- mi->mid==MID_CopyLBearing?ut_lbearing:
- ut_rbearing);
-}
-
-static void CVDoClear(CharView *cv) {
- ImageList *prev, *imgs, *next;
-
- CVPreserveState(cv);
- if ( cv->drawmode==dm_fore )
- SCRemoveSelectedMinimumDistances(cv->sc,2);
- cv->layerheads[cv->drawmode]->splines = SplinePointListRemoveSelected(cv->sc,
- cv->layerheads[cv->drawmode]->splines);
- if ( cv->drawmode==dm_fore ) {
- RefChar *refs, *next;
- AnchorPoint *ap, *aprev=NULL, *anext;
- for ( refs=cv->sc->layers[ly_fore].refs; refs!=NULL; refs = next ) {
- next = refs->next;
- if ( refs->selected )
- SCRemoveDependent(cv->sc,refs);
- }
- if ( cv->showanchor ) for ( ap=cv->sc->anchor; ap!=NULL; ap=anext ) {
- anext = ap->next;
- if ( ap->selected ) {
- if ( aprev!=NULL )
- aprev->next = anext;
- else
- cv->sc->anchor = anext;
- ap->next = NULL;
- AnchorPointsFree(ap);
- } else
- aprev = ap;
- }
- }
- for ( prev = NULL, imgs=cv->layerheads[cv->drawmode]->images; imgs!=NULL; imgs = next ) {
- next = imgs->next;
- if ( !imgs->selected )
- prev = imgs;
- else {
- if ( prev==NULL )
- cv->layerheads[cv->drawmode]->images = next;
- else
- prev->next = next;
- chunkfree(imgs,sizeof(ImageList));
- /* garbage collection of images????!!!! */
- }
- }
- if ( cv->lastselpt!=NULL || cv->p.sp!=NULL ) {
- cv->lastselpt = NULL; cv->p.sp = NULL;
- CVInfoDraw(cv,cv->gw);
- }
-}
-
-static void CVClear(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int anyanchor;
-
- if ( !CVAnySel(cv,NULL,NULL,NULL,&anyanchor))
-return;
- CVDoClear(cv);
- CVCharChangedUpdate(cv);
-}
-
-static void CVClearBackground(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- SCClearBackground(cv->sc);
-}
-
-static void _CVPaste(CharView *cv) {
- enum undotype ut = CopyUndoType();
- int was_empty = cv->drawmode==dm_fore && cv->sc->hstem==NULL && cv->sc->vstem==NULL && cv->sc->layers[ly_fore].splines==NULL && cv->sc->layers[ly_fore].refs==NULL;
- if ( ut!=ut_lbearing ) /* The lbearing code does this itself */
- CVPreserveStateHints(cv);
- if ( ut!=ut_width && ut!=ut_vwidth && ut!=ut_lbearing && ut!=ut_rbearing && ut!=ut_possub )
- CVClearSel(cv);
- PasteToCV(cv);
- CVCharChangedUpdate(cv);
- if ( was_empty && (cv->sc->hstem != NULL || cv->sc->vstem!=NULL ))
- cv->sc->changedsincelasthinted = false;
-}
-
-static void CVPaste(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVPaste(cv);
-}
-
-static void _CVMerge(CharView *cv,int elide) {
- int anyp = 0;
-
- if ( !CVAnySel(cv,&anyp,NULL,NULL,NULL) || !anyp)
-return;
- CVPreserveState(cv);
- SplineCharMerge(cv->sc,&cv->layerheads[cv->drawmode]->splines,!elide);
- SCClearSelPt(cv->sc);
- CVCharChangedUpdate(cv);
-}
-
-static void CVMerge(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMerge(cv,false);
-}
-
-static void CVElide(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMerge(cv,true);
-}
-
-static void _CVJoin(CharView *cv) {
- int anyp = 0, changed;
- extern float joinsnap;
-
- CVAnySel(cv,&anyp,NULL,NULL,NULL);
- CVPreserveState(cv);
- cv->layerheads[cv->drawmode]->splines = SplineSetJoin(cv->layerheads[cv->drawmode]->splines,!anyp,joinsnap/cv->scale,&changed);
- if ( changed )
- CVCharChangedUpdate(cv);
-}
-
-static void CVJoin(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVJoin(cv);
-}
-
-static void _CVCut(CharView *cv) {
- int anya;
-
- if ( !CVAnySel(cv,NULL,NULL,NULL,&anya))
-return;
- _CVCopy(cv);
- CVDoClear(cv);
- CVCharChangedUpdate(cv);
-}
-
-static void CVCut(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVCut(cv);
-}
-
-static void CVCopyFgBg(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( cv->sc->layers[ly_fore].splines==NULL )
-return;
- SCCopyFgToBg(cv->sc,true);
-}
-
-#ifdef FONTFORGE_CONFIG_COPY_BG_TO_FG
-static void CVCopyBgFg(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( cv->sc->layers[ly_back].splines==NULL )
-return;
- SCCopyBgToFg(cv->sc,true);
-}
-#endif
-
-static void CVSelectAll(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int mask = -1;
-
- if ( mi->mid==MID_SelectAllPoints )
- mask = 1;
- else if ( mi->mid==MID_SelectAnchors )
- mask = 2;
- if ( CVSetSel(cv,mask))
- SCUpdateAll(cv->sc);
-}
-
-static void CVSelectNone(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- if ( CVClearSel(cv))
- SCUpdateAll(cv->sc);
-}
-
-static void CVSelectInvert(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVInvertSel(cv);
- SCUpdateAll(cv->sc);
-}
-
-static void CVSelectWidth(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- if ( HasUseMyMetrics(cv->sc)!=NULL )
-return;
- cv->widthsel = !cv->widthsel;
- cv->oldwidth = cv->sc->width;
- SCUpdateAll(cv->sc);
-}
-
-static void CVSelectVWidth(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- if ( !cv->showvmetrics || !cv->sc->parent->hasvmetrics )
-return;
- if ( HasUseMyMetrics(cv->sc)!=NULL )
-return;
- cv->vwidthsel = !cv->widthsel;
- cv->oldvwidth = cv->sc->vwidth;
- SCUpdateAll(cv->sc);
-}
-
-static void CVSelectHM(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplinePoint *sp; SplineSet *spl; RefChar *r; ImageList *im;
- int exactlyone = CVOneThingSel(cv,&sp,&spl,&r,&im,NULL);
-
- if ( !exactlyone || sp==NULL || sp->hintmask == NULL || spl==NULL )
-return;
- while ( sp!=NULL ) {
- if ( sp->prev==NULL )
- break;
- sp = sp->prev->from;
- if ( sp == spl->first )
- break;
- if ( sp->hintmask!=NULL )
- goto done;
- sp->selected = true;
- }
- for ( spl = spl->next; spl!=NULL; spl = spl->next ) {
- for ( sp=spl->first; sp!=NULL; ) {
- if ( sp->hintmask!=NULL )
- goto done;
- sp->selected = true;
- if ( sp->prev==NULL )
- break;
- sp = sp->prev->from;
- if ( sp == spl->first )
- break;
- }
- }
- done:
- SCUpdateAll(cv->sc);
-}
-
-static void _CVUnlinkRef(CharView *cv) {
- int anyrefs=0;
- RefChar *rf, *next;
-
- if ( cv->drawmode==dm_fore && cv->layerheads[dm_fore]->refs!=NULL ) {
- CVPreserveState(cv);
- for ( rf=cv->layerheads[dm_fore]->refs; rf!=NULL && !anyrefs; rf=rf->next )
- if ( rf->selected ) anyrefs = true;
- for ( rf=cv->layerheads[dm_fore]->refs; rf!=NULL ; rf=next ) {
- next = rf->next;
- if ( rf->selected || !anyrefs) {
- SCRefToSplines(cv->sc,rf);
- }
- }
- CVSetCharChanged(cv,true);
- SCUpdateAll(cv->sc);
- /* Don't need to update dependancies, their splines won't have changed*/
- }
-}
-
-static void CVUnlinkRef(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVUnlinkRef(cv);
-}
-
-static void CVRemoveUndoes(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- UndoesFree(cv->layerheads[cv->drawmode]->undoes);
- UndoesFree(cv->layerheads[cv->drawmode]->redoes);
- cv->layerheads[cv->drawmode]->undoes = cv->layerheads[cv->drawmode]->redoes = NULL;
-}
-
-/* We can only paste if there's something in the copy buffer */
-/* we can only copy if there's something selected to copy */
-/* figure out what things are possible from the edit menu before the user */
-/* pulls it down */
-static void cv_edlistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e,int is_cv) {
- int anypoints, anyrefs, anyimages, anyanchor;
-
- CVAnySel(cv,&anypoints,&anyrefs,&anyimages,&anyanchor);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Join:
- mi->ti.disabled = !anypoints;
- break;
- case MID_Merge:
- mi->ti.disabled = !anypoints;
- break;
- case MID_Elide:
- mi->ti.disabled = !anypoints;
- break;
- case MID_Clear: case MID_Cut: /*case MID_Copy:*/
- /* If nothing is selected, copy copies everything */
- mi->ti.disabled = !anypoints && !anyrefs && !anyimages && !anyanchor;
- break;
- case MID_CopyLBearing: case MID_CopyRBearing:
- mi->ti.disabled = cv->drawmode!=dm_fore ||
- (cv->sc->layers[ly_fore].splines==NULL && cv->sc->layers[ly_fore].refs==NULL);
- break;
-#ifdef FONTFORGE_CONFIG_COPY_BG_TO_FG
- case MID_CopyBgToFg:
- mi->ti.disabled = cv->sc->layers[ly_back].splines==NULL;
- break;
-#endif
- case MID_CopyFgToBg:
- mi->ti.disabled = cv->sc->layers[ly_fore].splines==NULL;
- break;
- case MID_CopyGridFit:
- mi->ti.disabled = cv->gridfit==NULL;
- break;
- case MID_Paste:
- mi->ti.disabled = !CopyContainsSomething() &&
-#ifndef _NO_LIBPNG
- !GDrawSelectionHasType(cv->gw,sn_clipboard,"image/png") &&
-#endif
-#ifndef _NO_LIBXML
- !GDrawSelectionHasType(cv->gw,sn_clipboard,"image/svg") &&
-#endif
- !GDrawSelectionHasType(cv->gw,sn_clipboard,"image/bmp") &&
- !GDrawSelectionHasType(cv->gw,sn_clipboard,"image/eps") &&
- !GDrawSelectionHasType(cv->gw,sn_clipboard,"image/ps");
- break;
- case MID_Undo:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->undoes==NULL;
- break;
- case MID_Redo:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->redoes==NULL;
- break;
- case MID_RemoveUndoes:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->undoes==NULL && cv->layerheads[cv->drawmode]->redoes==NULL;
- break;
- case MID_CopyRef:
- mi->ti.disabled = cv->drawmode!=dm_fore || cv->searcher!=NULL;
- break;
- case MID_CopyLookupData:
- mi->ti.disabled = (cv->sc->possub==NULL && cv->sc->kerns==NULL && cv->sc->vkerns==NULL) ||
- cv->searcher!=NULL;
- break;
- case MID_UnlinkRef:
- mi->ti.disabled = cv->drawmode!=dm_fore || cv->sc->layers[ly_fore].refs==NULL;
- break;
- }
- }
-}
-
-static void edlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_edlistcheck(cv,mi,e,true);
-}
-
-int BpColinear(BasePoint *first, BasePoint *mid, BasePoint *last) {
- BasePoint dist_f, unit_f, dist_l, unit_l;
- double len, off_l, off_f;
-
- dist_f.x = first->x - mid->x; dist_f.y = first->y - mid->y;
- len = sqrt( dist_f.x*dist_f.x + dist_f.y*dist_f.y );
- if ( len==0 )
-return( false );
- unit_f.x = dist_f.x/len; unit_f.y = dist_f.y/len;
-
- dist_l.x = last->x - mid->x; dist_l.y = last->y - mid->y;
- len = sqrt( dist_l.x*dist_l.x + dist_l.y*dist_l.y );
- if ( len==0 )
-return( false );
- unit_l.x = dist_l.x/len; unit_l.y = dist_l.y/len;
-
- off_f = dist_l.x*unit_f.y - dist_l.y*unit_f.x;
- off_l = dist_f.x*unit_l.y - dist_f.y*unit_l.x;
- if ( ( off_f<-1.5 || off_f>1.5 ) && ( off_l<-1.5 || off_l>1.5 ))
-return( false );
-
-return( true );
-}
-
-void SPChangePointType(SplinePoint *sp, int pointtype) {
- BasePoint unitnext, unitprev;
- double nextlen, prevlen;
- int makedflt;
- /*int oldpointtype = sp->pointtype;*/
-
- if ( sp->pointtype==pointtype ) {
- if ( pointtype==pt_curve ) {
- if ( !sp->nextcpdef && sp->next!=NULL && !sp->next->order2 )
- SplineCharDefaultNextCP(sp);
- if ( !sp->prevcpdef && sp->prev!=NULL && !sp->prev->order2 )
- SplineCharDefaultPrevCP(sp);
- }
-return;
- }
- sp->pointtype = pointtype;
-
- if ( pointtype==pt_corner ) {
- /* Leave control points as they are */;
- sp->nextcpdef = sp->nonextcp;
- sp->prevcpdef = sp->noprevcp;
- } else if ( pointtype==pt_tangent ) {
- if ( sp->next!=NULL && !sp->nonextcp && sp->next->knownlinear ) {
- sp->nonextcp = true;
- sp->nextcp = sp->me;
- } else if ( sp->prev!=NULL && !sp->nonextcp &&
- BpColinear(&sp->prev->from->me,&sp->me,&sp->nextcp) ) {
- /* The current control point is reasonable */
- } else {
- SplineCharTangentNextCP(sp);
- if ( sp->next ) SplineRefigure(sp->next);
- }
- if ( sp->prev!=NULL && !sp->noprevcp && sp->prev->knownlinear ) {
- sp->noprevcp = true;
- sp->prevcp = sp->me;
- } else if ( sp->next!=NULL && !sp->noprevcp &&
- BpColinear(&sp->next->to->me,&sp->me,&sp->prevcp) ) {
- /* The current control point is reasonable */
- } else {
- SplineCharTangentPrevCP(sp);
- if ( sp->prev ) SplineRefigure(sp->prev);
- }
- } else if ( BpColinear(&sp->prevcp,&sp->me,&sp->nextcp) ||
- ( sp->nonextcp ^ sp->noprevcp )) {
- /* Retain the old control points */
- } else {
- unitnext.x = sp->nextcp.x-sp->me.x; unitnext.y = sp->nextcp.y-sp->me.y;
- nextlen = sqrt(unitnext.x*unitnext.x + unitnext.y*unitnext.y);
- unitprev.x = sp->me.x-sp->prevcp.x; unitprev.y = sp->me.y-sp->prevcp.y;
- prevlen = sqrt(unitprev.x*unitprev.x + unitprev.y*unitprev.y);
- makedflt=true;
- if ( nextlen!=0 && prevlen!=0 ) {
- unitnext.x /= nextlen; unitnext.y /= nextlen;
- unitprev.x /= prevlen; unitprev.y /= prevlen;
- if ( unitnext.x*unitprev.x + unitnext.y*unitprev.y>=.95 ) {
- /* If the control points are essentially in the same direction*/
- /* (so valid for a curve) then leave them as is */
- makedflt = false;
- }
- }
- if ( makedflt ) {
- sp->nextcpdef = sp->prevcpdef = true;
- if (( sp->prev!=NULL && sp->prev->order2 ) ||
- (sp->next!=NULL && sp->next->order2)) {
- if ( sp->prev!=NULL )
- SplineRefigureFixup(sp->prev);
- if ( sp->next!=NULL )
- SplineRefigureFixup(sp->next);
- } else {
- SplineCharDefaultPrevCP(sp);
- SplineCharDefaultNextCP(sp);
- }
- }
- }
-}
-
-static void _CVMenuPointType(CharView *cv,struct gmenuitem *mi) {
- int pointtype = mi->mid==MID_Corner?pt_corner:mi->mid==MID_Tangent?pt_tangent:pt_curve;
- SplinePointList *spl;
- Spline *spline, *first;
-
- CVPreserveState(cv); /* We should only get here if there's a selection */
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL ; spl = spl->next ) {
- first = NULL;
- if ( spl->first->selected ) {
- if ( spl->first->pointtype!=pointtype )
- SPChangePointType(spl->first,pointtype);
- }
- for ( spline=spl->first->next; spline!=NULL && spline!=first ; spline = spline->to->next ) {
- if ( spline->to->selected ) {
- if ( spline->to->pointtype!=pointtype )
- SPChangePointType(spline->to,pointtype);
- }
- if ( first == NULL ) first = spline;
- }
- }
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuPointType(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuPointType(cv,mi);
-}
-
-static void _CVMenuImplicit(CharView *cv,struct gmenuitem *mi) {
- SplinePointList *spl;
- Spline *spline, *first;
- int dontinterpolate = mi->mid==MID_NoImplicitPt;
-
- if ( !cv->sc->parent->order2 )
-return;
- CVPreserveState(cv); /* We should only get here if there's a selection */
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL ; spl = spl->next ) {
- first = NULL;
- if ( spl->first->selected ) {
- spl->first->dontinterpolate = dontinterpolate;
- }
- for ( spline=spl->first->next; spline!=NULL && spline!=first ; spline = spline->to->next ) {
- if ( spline->to->selected ) {
- spline->to->dontinterpolate = dontinterpolate;
- }
- if ( first == NULL ) first = spline;
- }
- }
- SCNumberPoints(cv->sc);
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuImplicit(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuImplicit(cv,mi);
-}
-
-static void cv_ptlistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
- int type = -2, cnt=0, ccp_cnt=0, spline_selected=0;
- SplinePointList *spl, *sel=NULL;
- Spline *spline, *first;
- SplinePoint *selpt=NULL;
- int notimplicit = -1;
-
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- first = NULL;
- if ( spl->first->selected ) {
- sel = spl;
- selpt = spl->first; ++cnt;
- if ( type==-2 ) type = spl->first->pointtype;
- else if ( type!=spl->first->pointtype ) type = -1;
- if ( !spl->first->nonextcp && !spl->first->noprevcp && spl->first->prev!=NULL )
- ++ccp_cnt;
- if ( notimplicit==-1 ) notimplicit = spl->first->dontinterpolate;
- else if ( notimplicit!=spl->first->dontinterpolate ) notimplicit = -2;
- }
- for ( spline=spl->first->next; spline!=NULL && spline!=first; spline = spline->to->next ) {
- if ( spline->to->selected ) {
- if ( type==-2 ) type = spline->to->pointtype;
- else if ( type!=spline->to->pointtype ) type = -1;
- selpt = spline->to;
- sel = spl; ++cnt;
- if ( !spline->to->nonextcp && !spline->to->noprevcp && spline->to->next!=NULL )
- ++ccp_cnt;
- if ( notimplicit==-1 ) notimplicit = spline->to->dontinterpolate;
- else if ( notimplicit!=spline->to->dontinterpolate ) notimplicit = -2;
- if ( spline->from->selected )
- ++spline_selected;
- }
- if ( first == NULL ) first = spline;
- }
- }
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Corner:
- mi->ti.disabled = type==-2;
- mi->ti.checked = type==pt_corner;
- break;
- case MID_Tangent:
- mi->ti.disabled = type==-2;
- mi->ti.checked = type==pt_tangent;
- break;
- case MID_Curve:
- mi->ti.disabled = type==-2;
- mi->ti.checked = type==pt_curve;
- break;
- case MID_MakeFirst:
- mi->ti.disabled = cnt!=1 || sel->first->prev==NULL || sel->first==selpt;
- break;
- case MID_MakeLine:
- mi->ti.disabled = cnt==0;
- break;
- case MID_InsertPtOnSplineAt:
- mi->ti.disabled = spline_selected!=1;
- break;
- case MID_CenterCP:
- mi->ti.disabled = ccp_cnt==0;
- break;
- case MID_ImplicitPt:
- mi->ti.disabled = !cv->sc->parent->order2;
- mi->ti.checked = notimplicit==0;
- break;
- case MID_NoImplicitPt:
- mi->ti.disabled = !cv->sc->parent->order2;
- mi->ti.checked = notimplicit==1;
- break;
-#if 0
- case MID_AddAnchor:
- mi->ti.disabled = AnchorClassUnused(cv->sc,&waslig)==NULL;
- break;
-#endif
- }
- }
-}
-
-static void ptlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_ptlistcheck(cv,mi,e);
-}
-
-static void _CVMenuDir(CharView *cv,struct gmenuitem *mi) {
- int splinepoints, dir;
- SplinePointList *spl;
- Spline *spline, *first;
- int needsrefresh = false;
-
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- first = NULL;
- splinepoints = 0;
- if ( spl->first->selected ) splinepoints = true;
- for ( spline=spl->first->next; spline!=NULL && spline!=first && !splinepoints; spline = spline->to->next ) {
- if ( spline->to->selected ) splinepoints = true;
- if ( first == NULL ) first = spline;
- }
- if ( splinepoints && spl->first==spl->last && spl->first->next!=NULL ) {
- dir = SplinePointListIsClockwise(spl);
- if ( (mi->mid==MID_Clockwise && !dir) || (mi->mid==MID_Counter && dir)) {
- if ( !needsrefresh )
- CVPreserveState(cv);
- SplineSetReverse(spl);
- needsrefresh = true;
- }
- }
- }
- if ( needsrefresh )
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuDir(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuDir(cv,mi);
-}
-
-static int getorigin(void *d,BasePoint *base,int index) {
- CharView *cv = (CharView *) d;
-
- base->x = base->y = 0;
- switch ( index ) {
- case 0: /* Character origin */
- /* all done */
- break;
- case 1: /* Center of selection */
- CVFindCenter(cv,base,!CVAnySel(cv,NULL,NULL,NULL,NULL));
- break;
- case 2: /* last press */
- base->x = cv->p.cx;
- base->y = cv->p.cy;
- /* I don't have any way of telling if a press has happened. if one */
- /* hasn't they'll just get a 0,0 origin. oh well */
- break;
- default:
-return( false );
- }
-return( true );
-}
-
-void BackgroundImageTransform(SplineChar *sc, ImageList *img,real transform[6]) {
- if ( transform[1]==0 && transform[2]==0 && transform[0]>0 && transform[3]>0 ) {
- img->xoff = transform[0]*img->xoff + transform[4];
- img->yoff = transform[3]*img->yoff + transform[5];
- if (( img->xscale *= transform[0])<0 ) img->xscale = -img->xscale;
- if (( img->yscale *= transform[3])<0 ) img->yscale = -img->yscale;
- img->bb.minx = img->xoff; img->bb.maxy = img->yoff;
- img->bb.maxx = img->xoff + GImageGetWidth(img->image)*img->xscale;
- img->bb.miny = img->yoff - GImageGetHeight(img->image)*img->yscale;
- } else
- /* Don't support rotating, flipping or skewing images */;
- SCOutOfDateBackground(sc);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-void CVTransFunc(CharView *cv,real transform[6], enum fvtrans_flags flags) {
- int anysel = cv->p.transany;
- RefChar *refs;
- ImageList *img;
- real t[6];
- AnchorPoint *ap;
- KernPair *kp;
- PST *pst;
- int j;
-
- SplinePointListTransform(cv->layerheads[cv->drawmode]->splines,transform,!anysel);
- if ( flags&fvt_round_to_int )
- SplineSetsRound2Int(cv->layerheads[cv->drawmode]->splines,1.0);
- if ( cv->layerheads[cv->drawmode]->images!=NULL ) {
- ImageListTransform(cv->layerheads[cv->drawmode]->images,transform);
- SCOutOfDateBackground(cv->sc);
- }
- if ( cv->drawmode==dm_fore ) {
- for ( refs = cv->layerheads[cv->drawmode]->refs; refs!=NULL; refs=refs->next )
- if ( refs->selected || !anysel ) {
- for ( j=0; j<refs->layer_cnt; ++j )
- SplinePointListTransform(refs->layers[j].splines,transform,true);
- t[0] = refs->transform[0]*transform[0] +
- refs->transform[1]*transform[2];
- t[1] = refs->transform[0]*transform[1] +
- refs->transform[1]*transform[3];
- t[2] = refs->transform[2]*transform[0] +
- refs->transform[3]*transform[2];
- t[3] = refs->transform[2]*transform[1] +
- refs->transform[3]*transform[3];
- t[4] = refs->transform[4]*transform[0] +
- refs->transform[5]*transform[2] +
- transform[4];
- t[5] = refs->transform[4]*transform[1] +
- refs->transform[5]*transform[3] +
- transform[5];
- if ( flags&fvt_round_to_int ) {
- t[4] = rint( t[4] );
- t[5] = rint( t[5] );
- }
- memcpy(refs->transform,t,sizeof(t));
- RefCharFindBounds(refs);
- }
- if ( cv->showanchor ) {
- for ( ap=cv->sc->anchor; ap!=NULL; ap=ap->next ) if ( ap->selected || !anysel )
- ApTransform(ap,transform);
- }
- if ( flags & fvt_scalepstpos ) {
- for ( kp=cv->sc->kerns; kp!=NULL; kp=kp->next )
- kp->off = rint(kp->off*transform[0]);
- for ( kp=cv->sc->vkerns; kp!=NULL; kp=kp->next )
- kp->off = rint(kp->off*transform[3]);
- for ( pst = cv->sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_position )
- VrTrans(&pst->u.pos,transform);
- else if ( pst->type==pst_pair ) {
- VrTrans(&pst->u.pair.vr[0],transform);
- VrTrans(&pst->u.pair.vr[1],transform);
- }
- }
- }
- if ( transform[1]==0 && transform[2]==0 ) {
- TransHints(cv->sc->hstem,transform[3],transform[5],transform[0],transform[4],flags&fvt_round_to_int);
- TransHints(cv->sc->vstem,transform[0],transform[4],transform[3],transform[5],flags&fvt_round_to_int);
- }
- if ( transform[0]==1 && transform[3]==1 && transform[1]==0 &&
- transform[2]==0 && transform[5]==0 &&
- transform[4]!=0 && CVAllSelected(cv) &&
- cv->sc->unicodeenc!=-1 && isalpha(cv->sc->unicodeenc)) {
- SCUndoSetLBearingChange(cv->sc,(int) rint(transform[4]));
- SCSynchronizeLBearing(cv->sc,transform[4]);
- }
- if ( !(flags&fvt_dontmovewidth) && (cv->widthsel || !anysel))
- if ( transform[0]>0 && transform[3]>0 && transform[1]==0 &&
- transform[2]==0 && transform[4]!=0 )
- SCSynchronizeWidth(cv->sc,cv->sc->width*transform[0]+transform[4],cv->sc->width,NULL);
- if ( !(flags&fvt_dontmovewidth) && (cv->vwidthsel || !anysel))
- if ( transform[0]==1 && transform[3]==1 && transform[1]==0 &&
- transform[2]==0 && transform[5]!=0 )
- cv->sc->vwidth+=transform[5];
- if ( (flags&fvt_dobackground) && !anysel ) {
- SCPreserveBackground(cv->sc);
- for ( img = cv->sc->layers[ly_back].images; img!=NULL; img=img->next )
- BackgroundImageTransform(cv->sc, img, transform);
- SplinePointListTransform(cv->layerheads[cv->drawmode]->splines,
- transform,true);
- }
- }
-}
-
-static void transfunc(void *d,real transform[6],int otype,BVTFunc *bvts,
- enum fvtrans_flags flags) {
- CharView *cv = (CharView *) d;
- int anya;
-
- cv->p.transany = CVAnySel(cv,NULL,NULL,NULL,&anya);
- CVPreserveStateHints(cv);
- if ( cv->drawmode==dm_fore && (flags&fvt_dobackground) )
- SCPreserveBackground(cv->sc);
- CVTransFunc(cv,transform,flags);
- CVCharChangedUpdate(cv);
-}
-
-void CVDoTransform(CharView *cv, enum cvtools cvt ) {
- int anysel = CVAnySel(cv,NULL,NULL,NULL,NULL);
- TransformDlgCreate(cv,transfunc,getorigin,!anysel && cv->drawmode==dm_fore,
- cvt);
-}
-
-static void CVMenuTransform(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVDoTransform(cv,cvt_none);
-}
-
-static void CVMenuPOV(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- struct pov_data pov_data;
- if ( PointOfViewDlg(&pov_data,cv->sc->parent,true)==-1 )
-return;
- CVPointOfView(cv,&pov_data);
-}
-
-static void CVMenuNLTransform(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- NonLinearDlg(NULL,cv);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-static void SplinePointRound(SplinePoint *sp,real factor) {
-
- sp->nextcp.x = rint(sp->nextcp.x*factor)/factor;
- sp->nextcp.y = rint(sp->nextcp.y*factor)/factor;
- if ( sp->next!=NULL && sp->next->order2 )
- sp->next->to->prevcp = sp->nextcp;
- sp->prevcp.x = rint(sp->prevcp.x*factor)/factor;
- sp->prevcp.y = rint(sp->prevcp.y*factor)/factor;
- if ( sp->prev!=NULL && sp->prev->order2 )
- sp->prev->from->nextcp = sp->prevcp;
- if ( sp->prev!=NULL && sp->next!=NULL && sp->next->order2 &&
- sp->ttfindex == 0xffff ) {
- sp->me.x = (sp->nextcp.x + sp->prevcp.x)/2;
- sp->me.y = (sp->nextcp.y + sp->prevcp.y)/2;
- } else {
- sp->me.x = rint(sp->me.x*factor)/factor;
- sp->me.y = rint(sp->me.y*factor)/factor;
- }
-}
-
-void SplineSetsRound2Int(SplineSet *spl,real factor) {
- SplinePoint *sp;
-
- for ( ; spl!=NULL; spl=spl->next ) {
- for ( sp=spl->first; ; ) {
- SplinePointRound(sp,factor);
- if ( sp->prev!=NULL )
- SplineRefigure(sp->prev);
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- if ( spl->first->prev!=NULL )
- SplineRefigure(spl->first->prev);
- }
-}
-
-static void SplineSetsChangeCoord(SplineSet *spl,real old, real new,int isy) {
- SplinePoint *sp;
-
- for ( ; spl!=NULL; spl=spl->next ) {
- for ( sp=spl->first; ; ) {
- if ( isy ) {
- if ( RealNear(sp->me.y,old) ) {
- if ( RealNear(sp->nextcp.y,old))
- sp->nextcp.y = new;
- else
- sp->nextcp.y += new-sp->me.y;
- if ( RealNear(sp->prevcp.y,old))
- sp->prevcp.y = new;
- else
- sp->prevcp.y += new-sp->me.y;
- sp->me.y = new;
- /* we expect to be called before SplineSetRound2Int and will */
- /* allow it to do any SplineRefigures */
- }
- } else {
- if ( RealNear(sp->me.x,old) ) {
- if ( RealNear(sp->nextcp.x,old))
- sp->nextcp.x = new;
- else
- sp->nextcp.x += new-sp->me.x;
- if ( RealNear(sp->prevcp.x,old))
- sp->prevcp.x = new;
- else
- sp->prevcp.x += new-sp->me.x;
- sp->me.x = new;
- }
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- if ( spl->first->prev!=NULL )
- SplineRefigure(spl->first->prev);
- }
-}
-
-void SCRound2Int(SplineChar *sc,real factor) {
- RefChar *r;
- StemInfo *stems;
- real old, new;
- int layer;
-
- for ( stems = sc->hstem; stems!=NULL; stems=stems->next ) {
- old = stems->start+stems->width;
- stems->start = rint(stems->start*factor)/factor;
- stems->width = rint(stems->width*factor)/factor;
- new = stems->start+stems->width;
- if ( old!=new )
- SplineSetsChangeCoord(sc->layers[ly_fore].splines,old,new,true);
- }
- for ( stems = sc->vstem; stems!=NULL; stems=stems->next ) {
- old = stems->start+stems->width;
- stems->start = rint(stems->start*factor)/factor;
- stems->width = rint(stems->width*factor)/factor;
- new = stems->start+stems->width;
- if ( old!=new )
- SplineSetsChangeCoord(sc->layers[ly_fore].splines,old,new,false);
- }
-
- for ( layer = ly_fore; layer<sc->layer_cnt; ++layer ) {
- SplineSetsRound2Int(sc->layers[layer].splines,factor);
- for ( r=sc->layers[layer].refs; r!=NULL; r=r->next ) {
- r->transform[4] = rint(r->transform[4]*factor)/factor;
- r->transform[5] = rint(r->transform[5]*factor)/factor;
- RefCharFindBounds(r);
- }
- }
- SCCharChangedUpdate(sc);
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void CVMenuConstrain(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVConstrainSelection(cv,mi->mid==MID_Average?0:
- mi->mid==MID_SpacePts?1:
- 2);
-}
-
-static void CVMenuMakeParallel(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVMakeParallel(cv);
-}
-
-static void _CVMenuRound2Int(CharView *cv, double factor) {
- int anysel = CVAnySel(cv,NULL,NULL,NULL,NULL);
- SplinePointList *spl;
- SplinePoint *sp;
- RefChar *r;
-
- CVPreserveState(cv);
- for ( spl= cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl=spl->next ) {
- for ( sp=spl->first; ; ) {
- if ( sp->selected || !anysel )
- SplinePointRound(sp,factor);
- if ( sp->prev!=NULL )
- SplineRefigure(sp->prev);
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- if ( spl->first->prev!=NULL )
- SplineRefigure(spl->first->prev);
- }
- if ( cv->drawmode==dm_fore ) {
- for ( r=cv->sc->layers[ly_fore].refs; r!=NULL; r=r->next ) {
- if ( r->selected || !anysel ) {
- r->transform[4] = rint(r->transform[4]*factor)/factor;
- r->transform[5] = rint(r->transform[5]*factor)/factor;
- }
- }
- }
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuRound2Int(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuRound2Int(cv,1.0);
-}
-
-static void CVMenuRound2Hundredths(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuRound2Int(cv,100.0);
-}
-
-static void CVMenuCluster(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int layer = cv->drawmode == dm_grid ? -1 :
- cv->drawmode == dm_back ? 0
- : cv->layerheads[dm_fore] - cv->sc->layers;
- SCRoundToCluster(cv->sc,layer,true,.1,.5);
-}
-
-static void CVMenuStroke(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVStroke(cv);
-}
-
-#ifdef FONTFORGE_CONFIG_TILEPATH
-static void CVMenuTilePath(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVTile(cv);
-}
-#endif
-
-static void _CVMenuOverlap(CharView *cv,enum overlap_type ot) {
- /* We know it's more likely that we'll find a problem in the overlap code */
- /* than anywhere else, so let's save the current state against a crash */
- int layer = cv->drawmode == dm_grid ? -1 :
- cv->drawmode == dm_back ? 0
- : cv->layerheads[dm_fore] - cv->sc->layers;
-
- DoAutoSaves();
- if ( !SCRoundToCluster(cv->sc,layer,false,.03,.12))
- CVPreserveState(cv); /* SCRound2Cluster does this when it makes a change, not otherwise */
- if ( cv->drawmode==dm_fore ) {
- MinimumDistancesFree(cv->sc->md);
- cv->sc->md = NULL;
- }
- cv->layerheads[cv->drawmode]->splines = SplineSetRemoveOverlap(cv->sc,cv->layerheads[cv->drawmode]->splines,ot);
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuOverlap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int anysel;
-
- (void) CVAnySel(cv,&anysel,NULL,NULL,NULL);
- _CVMenuOverlap(cv,mi->mid==MID_RmOverlap ? (anysel ? over_rmselected: over_remove) :
- mi->mid==MID_Intersection ? (anysel ? over_intersel : over_intersect ) :
- mi->mid==MID_Exclude ? over_exclude :
- (anysel ? over_fisel : over_findinter));
-}
-
-static void CVMenuOrder(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplinePointList *spl;
- RefChar *r;
- ImageList *im;
- int exactlyone = CVOneContourSel(cv,&spl,&r,&im);
-
- if ( !exactlyone )
-return;
-
- CVPreserveState(cv);
- if ( spl!=NULL ) {
- SplinePointList *p, *pp, *t;
- p = pp = NULL;
- for ( t=cv->layerheads[cv->drawmode]->splines; t!=NULL && t!=spl; t=t->next ) {
- pp = p; p = t;
- }
- switch ( mi->mid ) {
- case MID_First:
- if ( p!=NULL ) {
- p->next = spl->next;
- spl->next = cv->layerheads[cv->drawmode]->splines;
- cv->layerheads[cv->drawmode]->splines = spl;
- }
- break;
- case MID_Earlier:
- if ( p!=NULL ) {
- p->next = spl->next;
- spl->next = p;
- if ( pp==NULL ) {
- cv->layerheads[cv->drawmode]->splines = spl;
- } else {
- pp->next = spl;
- }
- }
- break;
- case MID_Last:
- if ( spl->next!=NULL ) {
- for ( t=cv->layerheads[cv->drawmode]->splines; t->next!=NULL; t=t->next );
- t->next = spl;
- if ( p==NULL )
- cv->layerheads[cv->drawmode]->splines = spl->next;
- else
- p->next = spl->next;
- spl->next = NULL;
- }
- break;
- case MID_Later:
- if ( spl->next!=NULL ) {
- t = spl->next;
- spl->next = t->next;
- t->next = spl;
- if ( p==NULL )
- cv->layerheads[cv->drawmode]->splines = t;
- else
- p->next = t;
- }
- break;
- }
- } else if ( r!=NULL ) {
- RefChar *p, *pp, *t;
- p = pp = NULL;
- for ( t=cv->sc->layers[ly_fore].refs; t!=NULL && t!=r; t=t->next ) {
- pp = p; p = t;
- }
- switch ( mi->mid ) {
- case MID_First:
- if ( p!=NULL ) {
- p->next = r->next;
- r->next = cv->sc->layers[ly_fore].refs;
- cv->sc->layers[ly_fore].refs = r;
- }
- break;
- case MID_Earlier:
- if ( p!=NULL ) {
- p->next = r->next;
- r->next = p;
- if ( pp==NULL ) {
- cv->sc->layers[ly_fore].refs = r;
- } else {
- pp->next = r;
- }
- }
- break;
- case MID_Last:
- if ( r->next!=NULL ) {
- for ( t=cv->sc->layers[ly_fore].refs; t->next!=NULL; t=t->next );
- t->next = r;
- if ( p==NULL )
- cv->sc->layers[ly_fore].refs = r->next;
- else
- p->next = r->next;
- r->next = NULL;
- }
- break;
- case MID_Later:
- if ( r->next!=NULL ) {
- t = r->next;
- r->next = t->next;
- t->next = r;
- if ( p==NULL )
- cv->sc->layers[ly_fore].refs = t;
- else
- p->next = t;
- }
- break;
- }
- } else if ( im!=NULL ) {
- ImageList *p, *pp, *t;
- p = pp = NULL;
- for ( t=cv->layerheads[cv->drawmode]->images; t!=NULL && t!=im; t=t->next ) {
- pp = p; p = t;
- }
- switch ( mi->mid ) {
- case MID_First:
- if ( p!=NULL ) {
- p->next = im->next;
- im->next = cv->layerheads[cv->drawmode]->images;
- cv->layerheads[cv->drawmode]->images = im;
- }
- break;
- case MID_Earlier:
- if ( p!=NULL ) {
- p->next = im->next;
- im->next = p;
- if ( pp==NULL ) {
- cv->layerheads[cv->drawmode]->images = im;
- } else {
- pp->next = im;
- }
- }
- break;
- case MID_Last:
- if ( im->next!=NULL ) {
- for ( t=cv->layerheads[cv->drawmode]->images; t->next!=NULL; t=t->next );
- t->next = im;
- if ( p==NULL )
- cv->layerheads[cv->drawmode]->images = im->next;
- else
- p->next = im->next;
- im->next = NULL;
- }
- break;
- case MID_Later:
- if ( im->next!=NULL ) {
- t = im->next;
- im->next = t->next;
- t->next = im;
- if ( p==NULL )
- cv->layerheads[cv->drawmode]->images = t;
- else
- p->next = t;
- }
- break;
- }
- }
- CVCharChangedUpdate(cv);
-}
-
-static void _CVMenuAddExtrema(CharView *cv) {
- int anysel;
- SplineFont *sf = cv->sc->parent;
-
- (void) CVAnySel(cv,&anysel,NULL,NULL,NULL);
- CVPreserveState(cv);
- SplineCharAddExtrema(cv->sc,cv->layerheads[cv->drawmode]->splines,
- anysel?ae_between_selected:ae_only_good,sf->ascent+sf->descent);
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuAddExtrema(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuAddExtrema(cv);
-}
-
-static void CVSimplify(CharView *cv,int type) {
- static struct simplifyinfo smpls[] = {
- { sf_normal },
- { sf_normal,.75,.05,0,-1 },
- { sf_normal,.75,.05,0,-1 }};
- struct simplifyinfo *smpl = &smpls[type+1];
-
- if ( smpl->linelenmax==-1 || (type==0 && !smpl->set_as_default)) {
- smpl->err = (cv->sc->parent->ascent+cv->sc->parent->descent)/1000.;
- smpl->linelenmax = (cv->sc->parent->ascent+cv->sc->parent->descent)/100.;
- }
-
- if ( type==1 ) {
- if ( !SimplifyDlg(cv->sc->parent,smpl))
-return;
- if ( smpl->set_as_default )
- smpls[1] = *smpl;
- }
-
- CVPreserveState(cv);
- smpl->check_selected_contours = true;
- cv->layerheads[cv->drawmode]->splines = SplineCharSimplify(cv->sc,cv->layerheads[cv->drawmode]->splines,
- smpl);
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuSimplify(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVSimplify(cv,0);
-}
-
-static void CVMenuSimplifyMore(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVSimplify(cv,1);
-}
-
-static void CVMenuCleanupGlyph(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVSimplify(cv,-1);
-}
-
-static int SPLSelected(SplineSet *ss) {
- SplinePoint *sp;
-
- for ( sp=ss->first ;; ) {
- if ( sp->selected )
-return( true );
- if ( sp->next==NULL )
-return( false );
- sp = sp->next->to;
- if ( sp==ss->first )
-return( false );
- }
-}
-
-static void CVCanonicalStart(CharView *cv) {
- SplineSet *ss;
- int changed = 0;
-
- for ( ss = cv->layerheads[cv->drawmode]->splines; ss!=NULL; ss=ss->next )
- if ( ss->first==ss->last && SPLSelected(ss))
- SPLStartToLeftmost(cv->sc,ss,&changed);
-}
-
-static void CVMenuCanonicalStart(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVCanonicalStart(cv);
-}
-
-static void CVCanonicalContour(CharView *cv) {
- if ( cv->drawmode==dm_fore )
- CanonicalContours(cv->sc);
-}
-
-static void CVMenuCanonicalContours(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVCanonicalContour(cv);
-}
-
-static void _CVMenuMakeFirst(CharView *cv) {
- SplinePoint *selpt = NULL;
- int anypoints = 0, splinepoints;
- SplinePointList *spl, *sel;
- Spline *spline, *first;
-
- sel = NULL;
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- first = NULL;
- splinepoints = 0;
- if ( spl->first->selected ) { splinepoints = 1; sel = spl; selpt=spl->first; }
- for ( spline=spl->first->next; spline!=NULL && spline!=first && !splinepoints; spline = spline->to->next ) {
- if ( spline->to->selected ) { ++splinepoints; sel = spl; selpt=spline->to; }
- if ( first == NULL ) first = spline;
- }
- anypoints += splinepoints;
- }
-
- if ( anypoints!=1 || sel->first->prev==NULL || sel->first==selpt )
-return;
-
- CVPreserveState(cv);
- sel->first = sel->last = selpt;
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuMakeFirst(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuMakeFirst(cv);
-}
-
-static void _CVMenuMakeLine(CharView *cv) {
- SplinePointList *spl;
- SplinePoint *sp;
- int changed = false;
-
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- for ( sp=spl->first; ; ) {
- if ( sp->selected ) {
- int any = false;
- if ( !changed ) {
- CVPreserveState(cv);
- changed = true;
- }
- if ( sp->prev!=NULL && sp->prev->from->selected ) {
- any = true;
- sp->prevcp = sp->me;
- sp->noprevcp = true;
- sp->prev->from->nextcp = sp->prev->from->me;
- sp->prev->from->nonextcp = true;
- SplineRefigure(sp->prev);
- }
- if ( sp->next!=NULL && sp->next->to->selected ) {
- any = true;
- sp->nextcp = sp->me;
- sp->nonextcp = true;
- sp->next->to->prevcp = sp->next->to->me;
- sp->next->to->noprevcp = true;
- SplineRefigure(sp->next);
- }
- if ( !any ) {
- sp->nextcp = sp->me;
- sp->prevcp = sp->me;
- sp->nonextcp = sp->noprevcp = true;
- if ( sp->prev!=NULL ) SplineRefigure(sp->prev);
- if ( sp->next!=NULL ) SplineRefigure(sp->next);
- }
- changed = true;
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
-
- if ( changed )
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuMakeLine(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuMakeLine(cv);
-}
-
-struct insertonsplineat {
- int done;
- GWindow gw;
- Spline *s;
- CharView *cv;
-};
-
-#define CID_X 1001
-#define CID_Y 1002
-#define CID_XR 1003
-#define CID_YR 1004
-
-static int IOSA_OK(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- int err = false;
- struct insertonsplineat *iosa = GDrawGetUserData(GGadgetGetWindow(g));
- double val;
- extended ts[3];
- int which;
- SplinePoint *sp;
-
- if ( GGadgetIsChecked(GWidgetGetControl(iosa->gw,CID_XR)) ) {
- val = GetReal8(iosa->gw,CID_X,"X",&err);
- which = 0;
- } else {
- val = GetReal8(iosa->gw,CID_Y,"Y",&err);
- which = 1;
- }
- if ( err )
-return(true);
- if ( SplineSolveFull(&iosa->s->splines[which],val,ts)==0 ) {
- gwwv_post_error(_("Out of Range"),_("The spline does not reach %g"), (double) val );
-return( true );
- }
- iosa->done = true;
- CVPreserveState(iosa->cv);
- forever {
- sp = SplineBisect(iosa->s,ts[0]);
- SplinePointCatagorize(sp);
- if ( which==0 ) {
- double off = val-sp->me.x;
- sp->me.x = val; sp->nextcp.x += off; sp->prevcp.x += off;
- } else {
- double off = val-sp->me.y;
- sp->me.y = val; sp->nextcp.y += off; sp->prevcp.y += off;
- }
- SplineRefigure(sp->prev); SplineRefigure(sp->next);
- if ( ts[1]==-1 ) {
- CVCharChangedUpdate(iosa->cv);
-return( true );
- }
- iosa->s = sp->next;
- if ( SplineSolveFull(&iosa->s->splines[which],val,ts)==0 ) {
- /* Odd. We found one earlier */
- CVCharChangedUpdate(iosa->cv);
-return( true );
- }
- }
- }
-return( true );
-}
-
-static int IOSA_Cancel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct insertonsplineat *iosa = GDrawGetUserData(GGadgetGetWindow(g));
- iosa->done = true;
- }
-return( true );
-}
-
-static int IOSA_FocusChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textfocuschanged ) {
- struct insertonsplineat *iosa = GDrawGetUserData(GGadgetGetWindow(g));
- int cid = (intpt) GGadgetGetUserData(g);
- GGadgetSetChecked(GWidgetGetControl(iosa->gw,cid),true);
- }
-return( true );
-}
-
-static int IOSA_RadioChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct insertonsplineat *iosa = GDrawGetUserData(GGadgetGetWindow(g));
- int cid = (intpt) GGadgetGetUserData(g);
- GWidgetIndicateFocusGadget(GWidgetGetControl(iosa->gw,cid));
- GTextFieldSelect(GWidgetGetControl(iosa->gw,cid),0,-1);
- }
-return( true );
-}
-
-static int iosa_e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- struct insertonsplineat *iosa = GDrawGetUserData(gw);
- iosa->done = true;
- } else if ( event->type == et_char ) {
-return( false );
- } else if ( event->type == et_map ) {
- /* Above palettes */
- GDrawRaise(gw);
- }
-return( true );
-}
-
-static void _CVMenuInsertPt(CharView *cv) {
- SplineSet *spl;
- Spline *s, *found=NULL, *first;
- struct insertonsplineat iosa;
- GRect pos;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[11], boxes[2], topbox[2], *hvs[13], *varray[8], *buttons[6];
- GTextInfo label[11];
-
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- first = NULL;
- for ( s=spl->first->next; s!=NULL && s!=first ; s = s->to->next ) {
- if ( first==NULL ) first=s;
- if ( s->from->selected && s->to->selected ) {
- if ( found!=NULL )
-return; /* Can only work with one spline */
- found = s;
- }
- }
- }
- if ( found==NULL )
-return; /* Need a spline */
-
- memset(&iosa,0,sizeof(iosa));
- iosa.s = found;
- iosa.cv = cv;
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Insert a point on the given spline at either...");
- wattrs.is_dlg = true;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,210));
- pos.height = GDrawPointsToPixels(NULL,120);
- iosa.gw = GDrawCreateTopWindow(NULL,&pos,iosa_e_h,&iosa,&wattrs);
-
- memset(&label,0,sizeof(label));
- memset(&gcd,0,sizeof(gcd));
-
- label[0].text = (unichar_t *) _("_X:");
- label[0].text_is_1byte = true;
- label[0].text_in_resource = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 5; gcd[0].gd.pos.y = 5;
- gcd[0].gd.flags = gg_enabled|gg_visible|gg_cb_on;
- gcd[0].gd.cid = CID_XR;
- gcd[0].gd.handle_controlevent = IOSA_RadioChange;
- gcd[0].data = (void *) CID_X;
- gcd[0].creator = GRadioCreate;
-
- label[1].text = (unichar_t *) _("_Y:");
- label[1].text_is_1byte = true;
- label[1].text_in_resource = true;
- gcd[1].gd.label = &label[1];
- gcd[1].gd.pos.x = 5; gcd[1].gd.pos.y = 32;
- gcd[1].gd.flags = gg_enabled|gg_visible|gg_rad_continueold ;
- gcd[1].gd.cid = CID_YR;
- gcd[1].gd.handle_controlevent = IOSA_RadioChange;
- gcd[1].data = (void *) CID_Y;
- gcd[1].creator = GRadioCreate;
-
- gcd[2].gd.pos.x = 131; gcd[2].gd.pos.y = 5; gcd[2].gd.pos.width = 60;
- gcd[2].gd.flags = gg_enabled|gg_visible;
- gcd[2].gd.cid = CID_X;
- gcd[2].gd.handle_controlevent = IOSA_FocusChange;
- gcd[2].data = (void *) CID_XR;
- gcd[2].creator = GTextFieldCreate;
-
- gcd[3].gd.pos.x = 131; gcd[3].gd.pos.y = 32; gcd[3].gd.pos.width = 60;
- gcd[3].gd.flags = gg_enabled|gg_visible;
- gcd[3].gd.cid = CID_Y;
- gcd[3].gd.handle_controlevent = IOSA_FocusChange;
- gcd[3].data = (void *) CID_YR;
- gcd[3].creator = GTextFieldCreate;
-
- gcd[4].gd.pos.x = 20-3; gcd[4].gd.pos.y = 120-32-3;
- gcd[4].gd.pos.width = -1; gcd[4].gd.pos.height = 0;
- gcd[4].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[4].text = (unichar_t *) _("_OK");
- label[4].text_is_1byte = true;
- label[4].text_in_resource = true;
- gcd[4].gd.mnemonic = 'O';
- gcd[4].gd.label = &label[4];
- gcd[4].gd.handle_controlevent = IOSA_OK;
- gcd[4].creator = GButtonCreate;
-
- gcd[5].gd.pos.x = -20; gcd[5].gd.pos.y = 120-32;
- gcd[5].gd.pos.width = -1; gcd[5].gd.pos.height = 0;
- gcd[5].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[5].text = (unichar_t *) _("_Cancel");
- label[5].text_is_1byte = true;
- label[5].text_in_resource = true;
- gcd[5].gd.label = &label[5];
- gcd[5].gd.mnemonic = 'C';
- gcd[5].gd.handle_controlevent = IOSA_Cancel;
- gcd[5].creator = GButtonCreate;
-
- hvs[0] = &gcd[0]; hvs[1] = &gcd[2]; hvs[2] = NULL;
- hvs[3] = &gcd[1]; hvs[4] = &gcd[3]; hvs[5] = NULL;
- hvs[6] = NULL;
-
- buttons[0] = buttons[2] = buttons[4] = GCD_Glue; buttons[5] = NULL;
- buttons[1] = &gcd[4]; buttons[3] = &gcd[5];
-
- varray[0] = &boxes[1]; varray[1] = NULL;
- varray[2] = GCD_Glue; varray[3] = NULL;
- varray[4] = &boxes[0]; varray[5] = NULL;
- varray[6] = NULL;
-
- memset(boxes,0,sizeof(boxes));
- boxes[0].gd.flags = gg_enabled|gg_visible;
- boxes[0].gd.u.boxelements = buttons;
- boxes[0].creator = GHBoxCreate;
-
- boxes[1].gd.flags = gg_enabled|gg_visible;
- boxes[1].gd.u.boxelements = hvs;
- boxes[1].creator = GHVBoxCreate;
-
- memset(topbox,0,sizeof(topbox));
- topbox[0].gd.pos.x = topbox[0].gd.pos.y = 2;
- topbox[0].gd.pos.width = pos.width-4; topbox[0].gd.pos.height = pos.height-4;
- topbox[0].gd.flags = gg_enabled|gg_visible;
- topbox[0].gd.u.boxelements = varray;
- topbox[0].creator = GHVGroupCreate;
-
-
- GGadgetsCreate(iosa.gw,topbox);
- GHVBoxSetExpandableRow(topbox[0].ret,1);
- GHVBoxSetExpandableCol(boxes[0].ret,gb_expandgluesame);
- GHVBoxSetExpandableCol(boxes[1].ret,1);
- GWidgetIndicateFocusGadget(GWidgetGetControl(iosa.gw,CID_X));
- GTextFieldSelect(GWidgetGetControl(iosa.gw,CID_X),0,-1);
- GHVBoxFitWindow(topbox[0].ret);
-
- GDrawSetVisible(iosa.gw,true);
- while ( !iosa.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(iosa.gw);
-}
-
-static void CVMenuInsertPt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVMenuInsertPt(cv);
-}
-
-static void _CVCenterCP(CharView *cv) {
- SplinePointList *spl;
- SplinePoint *sp;
- int changed = false;
- enum movething { mt_pt, mt_ncp, mt_pcp } movething = mt_pt;
-
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- for ( sp=spl->first; ; ) {
- if ( sp->selected && sp->prev!=NULL && sp->next!=NULL &&
- !sp->noprevcp && !sp->nonextcp ) {
- if ( sp->me.x != (sp->nextcp.x+sp->prevcp.x)/2 ||
- sp->me.y != (sp->nextcp.y+sp->prevcp.y)/2 ) {
- if ( !changed ) {
- CVPreserveState(cv);
- changed = true;
- }
- switch ( movething ) {
- case mt_pt:
- sp->me.x = (sp->nextcp.x+sp->prevcp.x)/2;
- sp->me.y = (sp->nextcp.y+sp->prevcp.y)/2;
- SplineRefigure(sp->prev);
- SplineRefigure(sp->next);
- break;
- case mt_ncp:
- sp->nextcp.x = sp->me.x - (sp->prevcp.x-sp->me.x);
- sp->nextcp.y = sp->me.y - (sp->prevcp.y-sp->me.y);
- if ( sp->next->order2 ) {
- sp->next->to->prevcp = sp->nextcp;
- sp->next->to->noprevcp = false;
- }
- SplineRefigure(sp->prev);
- SplineRefigureFixup(sp->next);
- break;
- case mt_pcp:
- sp->prevcp.x = sp->me.x - (sp->nextcp.x-sp->me.x);
- sp->prevcp.y = sp->me.y - (sp->nextcp.y-sp->me.y);
- if ( sp->prev->order2 ) {
- sp->prev->from->nextcp = sp->prevcp;
- sp->prev->from->nonextcp = false;
- }
- SplineRefigureFixup(sp->prev);
- SplineRefigure(sp->next);
- break;
- }
- }
- }
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
-
- if ( changed )
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuCenterCP(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- _CVCenterCP(cv);
-}
-
-void CVAddAnchor(CharView *cv) {
- int waslig;
-
- if ( AnchorClassUnused(cv->sc,&waslig)==NULL ) {
- ff_post_notice(_("Make a new anchor class"),_("I cannot find an unused anchor class\nto assign a new point to. If you\nwish a new anchor point you must\ndefine a new anchor class with\nElement->Font Info"));
- FontInfo(cv->sc->parent,11,true); /* Lookups */
- if ( AnchorClassUnused(cv->sc,&waslig)==NULL )
-return;
- }
- ApGetInfo(cv,NULL);
-}
-
-static void CVMenuAddAnchor(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVAddAnchor(cv);
-}
-
-static void CVMenuAutotrace(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SCAutoTrace(cv->sc,cv->v,e!=NULL && (e->u.mouse.state&ksm_shift));
-}
-
-static void CVMenuBuildAccent(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- extern int onlycopydisplayed;
-
- if ( SFIsRotatable(cv->fv->sf,cv->sc))
- /* It's ok */;
- else if ( !SFIsSomethingBuildable(cv->fv->sf,cv->sc,true) )
-return;
- SCBuildComposit(cv->fv->sf,cv->sc,!onlycopydisplayed,cv->fv);
-}
-
-static void CVMenuBuildComposite(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- extern int onlycopydisplayed;
-
- if ( SFIsRotatable(cv->fv->sf,cv->sc))
- /* It's ok */;
- else if ( !SFIsCompositBuildable(cv->fv->sf,cv->sc->unicodeenc,cv->sc) )
-return;
- SCBuildComposit(cv->fv->sf,cv->sc,!onlycopydisplayed,cv->fv);
-}
-
-static void CVMenuCorrectDir(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int changed=false, refchanged=false;
- RefChar *ref;
- int asked=-1;
-
- if ( cv->drawmode==dm_fore ) for ( ref=cv->sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( ref->transform[0]*ref->transform[3]<0 ||
- (ref->transform[0]==0 && ref->transform[1]*ref->transform[2]>0)) {
- if ( asked==-1 ) {
- char *buts[4];
- buts[0] = _("_Unlink");
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[1] = _("_No");
- buts[2] = _("_Cancel");
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[1] = GTK_STOCK_NO;
- buts[2] = GTK_STOCK_CANCEL;
-#endif
- buts[3] = NULL;
- asked = gwwv_ask(_("Flipped Reference"),(const char **) buts,0,2,_("%.50s contains a flipped reference. This cannot be corrected as is. Would you like me to unlink it and then correct it?"), cv->sc->name );
- if ( asked==2 )
-return;
- else if ( asked==1 )
- break;
- }
- if ( asked==0 ) {
- if ( !refchanged ) {
- refchanged = true;
- CVPreserveState(cv);
- }
- SCRefToSplines(cv->sc,ref);
- }
- }
- }
-
- if ( !refchanged )
- CVPreserveState(cv);
-
- cv->layerheads[cv->drawmode]->splines = SplineSetsCorrect(cv->layerheads[cv->drawmode]->splines,&changed);
- if ( changed || refchanged )
- CVCharChangedUpdate(cv);
-}
-
-static void CVMenuGetInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- CVGetInfo(cv);
-}
-
-static void CVMenuCharInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SCCharInfo(cv->sc,cv->fv->map,CVCurEnc(cv));
-}
-
-static void CVMenuShowDependentRefs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SCRefBy(cv->sc);
-}
-
-static void CVMenuShowDependentSubs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SCSubBy(cv->sc);
-}
-
-static void CVMenuBitmaps(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- BitmapDlg(cv->fv,cv->sc,mi->mid==MID_RemoveBitmaps?-1: (mi->mid==MID_AvailBitmaps) );
-}
-
-static void cv_allistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
- int selpoints = 0;
- SplinePointList *spl;
- SplinePoint *sp=NULL;
-
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- sp=spl->first;
- while ( 1 ) {
- if ( sp->selected )
- ++selpoints;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Average:
- mi->ti.disabled = selpoints<2;
- break;
- case MID_SpacePts:
- mi->ti.disabled = ((selpoints<3) && (selpoints!=1));
- break;
- case MID_SpaceRegion:
- mi->ti.disabled = selpoints<3;
- break;
- case MID_MakeParallel:
- mi->ti.disabled = selpoints!=4;
- break;
- }
- }
-}
-
-static void allistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_allistcheck(cv,mi,e);
-}
-
-static void cv_balistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_BuildAccent:
- mi->ti.disabled = !SFIsSomethingBuildable(cv->fv->sf,cv->sc,true);
- break;
- case MID_BuildComposite:
- mi->ti.disabled = !SFIsSomethingBuildable(cv->fv->sf,cv->sc,false);
- break;
- }
- }
-}
-
-static void balistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_balistcheck(cv,mi,e);
-}
-
-static void delistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_ShowDependentRefs:
- mi->ti.disabled = cv->sc->dependents==NULL;
- break;
- case MID_ShowDependentSubs:
- mi->ti.disabled = !SCUsedBySubs(cv->sc);
- break;
- }
- }
-}
-
-static void cv_ellistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e,int is_cv) {
- int anypoints = 0, splinepoints, dir = -2;
- SplinePointList *spl;
- Spline *spline, *first;
- AnchorPoint *ap;
- int order2 = cv->sc->parent->order2;
-
-#ifdef FONTFORGE_CONFIG_TILEPATH
- int badsel = false;
- RefChar *ref;
- ImageList *il;
-
- for ( ref=cv->layerheads[cv->drawmode]->refs; ref!=NULL; ref=ref->next )
- if ( ref->selected )
- badsel = true;
-
- for ( il=cv->layerheads[cv->drawmode]->images; il!=NULL; il=il->next )
- if ( il->selected )
- badsel = true;
-#endif
-
- for ( spl = cv->layerheads[cv->drawmode]->splines; spl!=NULL; spl = spl->next ) {
- first = NULL;
- splinepoints = 0;
- if ( spl->first->selected ) { splinepoints = 1; }
- for ( spline=spl->first->next; spline!=NULL && spline!=first && !splinepoints; spline = spline->to->next ) {
- if ( spline->to->selected ) { ++splinepoints; }
- if ( first == NULL ) first = spline;
- }
- if ( splinepoints ) {
- anypoints += splinepoints;
- if ( dir==-1 )
- /* Do nothing */;
- else if ( spl->first!=spl->last || spl->first->next==NULL ) {
- if ( dir==-2 || dir==2 )
- dir = 2; /* Not a closed path, no direction */
- else
- dir = -1;
- } else if ( dir==-2 )
- dir = SplinePointListIsClockwise(spl);
- else {
- int subdir = SplinePointListIsClockwise(spl);
- if ( subdir!=dir )
- dir = -1;
- }
- }
- }
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_GetInfo:
- {
- SplinePoint *sp; SplineSet *spl; RefChar *ref; ImageList *img;
- mi->ti.disabled = !CVOneThingSel(cv,&sp,&spl,&ref,&img,&ap);
- }
- break;
- case MID_Clockwise:
- mi->ti.disabled = !anypoints || dir==2;
- mi->ti.checked = dir==1;
- break;
- case MID_Counter:
- mi->ti.disabled = !anypoints || dir==2;
- mi->ti.checked = dir==0;
- break;
- case MID_Correct:
- mi->ti.disabled = !anypoints || dir==2;
- break;
- case MID_MetaFont:
- mi->ti.disabled = cv->drawmode!=dm_fore || cv->sc->layers[ly_fore].refs!=NULL || order2;
- break;
- case MID_Stroke:
- case MID_RmOverlap:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->splines==NULL;
- break;
- case MID_Effects:
- mi->ti.disabled = ( cv->layerheads[cv->drawmode]->splines==NULL || order2 );
- break;
-#ifdef FONTFORGE_CONFIG_TILEPATH
- case MID_TilePath:
- mi->ti.disabled = badsel || ClipBoardToSplineSet()==NULL || order2;
- break;
-#endif
- case MID_RegenBitmaps: case MID_RemoveBitmaps:
- mi->ti.disabled = cv->fv->sf->bitmaps==NULL;
- break;
- case MID_AddExtrema:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->splines==NULL;
- /* Like Simplify, always available, but may not do anything if */
- /* all extrema have points. I'm not going to check for that, too hard */
- break;
- case MID_Simplify:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->splines==NULL;
- /* Simplify is always available (it may not do anything though) */
- /* well, ok. Disable it if there is absolutely nothing to work on */
- break;
- case MID_BuildAccent:
- mi->ti.disabled = !SFIsSomethingBuildable(cv->fv->sf,cv->sc,false);
- break;
- case MID_Autotrace:
- mi->ti.disabled = FindAutoTraceName()==NULL || cv->sc->layers[ly_back].images==NULL;
- break;
- }
- }
-}
-
-static void ellistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_ellistcheck(cv,mi,e,true);
-}
-
-static void CVMenuAutoHint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- /*int removeOverlap = e==NULL || !(e->u.mouse.state&ksm_shift);*/
- int was = cv->sc->changedsincelasthinted;
-
- /* Hint undoes are done in _SplineCharAutoHint */
- cv->sc->manualhints = false;
- SplineCharAutoHint(cv->sc,NULL);
- SCUpdateAll(cv->sc);
- if ( was ) {
- FontView *fvs;
- for ( fvs=cv->fv; fvs!=NULL; fvs=fvs->nextsame )
- GDrawRequestExpose(fvs->v,NULL,false); /* Clear any changedsincelasthinted marks */
- }
-}
-
-static void CVMenuAutoHintSubs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- SCFigureHintMasks(cv->sc);
- SCUpdateAll(cv->sc);
-}
-
-static void CVMenuAutoCounter(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- SCFigureCounterMasks(cv->sc);
-}
-
-static void CVMenuDontAutoHint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- cv->sc->manualhints = !cv->sc->manualhints;
-}
-
-static void CVMenuAutoInstr(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- SCAutoInstr(cv->sc,NULL);
-}
-
-static void CVMenuClearHints(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- SCPreserveHints(cv->sc);
- SCHintsChanged(cv->sc);
- if ( mi->mid==MID_ClearHStem ) {
- StemInfosFree(cv->sc->hstem);
- cv->sc->hstem = NULL;
- cv->sc->hconflicts = false;
- } else if ( mi->mid==MID_ClearVStem ) {
- StemInfosFree(cv->sc->vstem);
- cv->sc->vstem = NULL;
- cv->sc->vconflicts = false;
- }
- cv->sc->manualhints = true;
- SCClearHintMasks(cv->sc,true);
- SCOutOfDateBackground(cv->sc);
- SCUpdateAll(cv->sc);
-}
-
-static void CVMenuAddHint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplinePoint *sp1, *sp2, *sp3, *sp4;
- StemInfo *h=NULL;
- DStemInfo *d;
-
- if ( !CVTwoForePointsSelected(cv,&sp1,&sp2))
-return;
-
- SCPreserveHints(cv->sc);
- SCHintsChanged(cv->sc);
- if ( mi->mid==MID_AddHHint ) {
- if ( sp1->me.y==sp2->me.y )
-return;
- h = chunkalloc(sizeof(StemInfo));
- if ( sp2->me.y>sp1->me.y ) {
- h->start = sp1->me.y;
- h->width = sp2->me.y-sp1->me.y;
- } else {
- h->start = sp2->me.y;
- h->width = sp1->me.y-sp2->me.y;
- }
- SCGuessHHintInstancesAndAdd(cv->sc,h,sp1->me.x,sp2->me.x);
- cv->sc->hconflicts = StemListAnyConflicts(cv->sc->hstem);
- } else if ( mi->mid==MID_AddVHint ) {
- if ( sp1->me.x==sp2->me.x )
-return;
- h = chunkalloc(sizeof(StemInfo));
- if ( sp2->me.x>sp1->me.x ) {
- h->start = sp1->me.x;
- h->width = sp2->me.x-sp1->me.x;
- } else {
- h->start = sp2->me.x;
- h->width = sp1->me.x-sp2->me.x;
- }
- SCGuessVHintInstancesAndAdd(cv->sc,h,sp1->me.y,sp2->me.y);
- cv->sc->vconflicts = StemListAnyConflicts(cv->sc->vstem);
- } else {
- if ( !CVIsDiagonalable(sp1,sp2,&sp3,&sp4))
-return;
- /* Make sure sp1<->sp3 is further left than sp2<->sp4 */
- if ( sp1->me.x > sp2->me.x + (sp1->me.y-sp2->me.y) * (sp4->me.x-sp2->me.x)/(sp4->me.y-sp2->me.y) ) {
- SplinePoint *temp;
- temp = sp1; sp1 = sp2; sp2 = temp;
- temp = sp3; sp3=sp4; sp4=temp;
- }
- /* Make sure sp1,sp2 are at the top */
- if ( sp1->me.y<sp3->me.y ) {
- SplinePoint *temp;
- temp = sp1; sp1=sp3; sp3=temp;
- temp = sp2; sp2=sp4; sp4=temp;
- }
- d = chunkalloc(sizeof(DStemInfo));
- d->next = cv->sc->dstem;
- cv->sc->dstem = d;
- d->leftedgetop = sp1->me;
- d->rightedgetop = sp2->me;
- d->leftedgebottom = sp3->me;
- d->rightedgebottom = sp4->me;
- }
- cv->sc->manualhints = true;
- if ( h!=NULL && cv->sc->parent->mm==NULL )
- SCModifyHintMasksAdd(cv->sc,h);
- else
- SCClearHintMasks(cv->sc,true);
- SCOutOfDateBackground(cv->sc);
- SCUpdateAll(cv->sc);
-}
-
-static void CVMenuCreateHint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- CVCreateHint(cv,mi->mid==MID_CreateHHint,true);
-}
-
-static void CVMenuReviewHints(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( cv->sc->hstem==NULL && cv->sc->vstem==NULL )
-return;
- CVReviewHints(cv);
-}
-
-static void htlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplinePoint *sp1, *sp2, *sp3, *sp4;
- int multilayer = cv->sc->parent->multilayer;
-
- sp1 = sp2 = NULL;
- CVTwoForePointsSelected(cv,&sp1,&sp2);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_AutoHint:
- mi->ti.disabled = multilayer;
- break;
- case MID_HintSubsPt: case MID_AutoCounter:
- mi->ti.disabled = cv->sc->parent->order2 || multilayer;
- break;
- case MID_DontAutoHint:
- mi->ti.disabled = cv->sc->parent->order2 || multilayer;
- mi->ti.checked = cv->sc->manualhints;
- break;
- case MID_AutoInstr:
- case MID_EditInstructions:
- mi->ti.disabled = !cv->fv->sf->order2 || multilayer;
- break;
- case MID_Debug:
- mi->ti.disabled = !cv->fv->sf->order2 || multilayer || !hasFreeTypeDebugger();
- break;
- case MID_ClearInstr:
- mi->ti.disabled = cv->sc->ttf_instrs_len==0;
- break;
- case MID_AddHHint:
- mi->ti.disabled = sp2==NULL || sp2->me.y==sp1->me.y || multilayer;
- break;
- case MID_AddVHint:
- mi->ti.disabled = sp2==NULL || sp2->me.x==sp1->me.x || multilayer;
- break;
- case MID_AddDHint:
- mi->ti.disabled = !CVIsDiagonalable(sp1,sp2,&sp3,&sp4) || multilayer;
- break;
- case MID_ReviewHints:
- mi->ti.disabled = (cv->sc->hstem==NULL && cv->sc->vstem==NULL ) || multilayer;
- break;
- }
- }
-}
-
-static void mtlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- RefChar *r = HasUseMyMetrics(cv->sc);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_RemoveKerns:
- mi->ti.disabled = cv->sc->kerns==NULL;
- break;
- case MID_RemoveVKerns:
- mi->ti.disabled = cv->sc->vkerns==NULL;
- break;
- case MID_SetVWidth:
- mi->ti.disabled = !cv->sc->parent->hasvmetrics || r!=NULL;
- break;
- case MID_AnchorsAway:
- mi->ti.disabled = cv->sc->anchor==NULL;
- break;
- case MID_SetWidth: case MID_SetLBearing: case MID_SetRBearing:
- mi->ti.disabled = r!=NULL;
- break;
- }
- }
-}
-
-static void cv_sllistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
- SplinePoint *sp; SplineSet *spl; RefChar *r; ImageList *im;
- int exactlyone = CVOneThingSel(cv,&sp,&spl,&r,&im,NULL);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_NextPt: case MID_PrevPt:
- case MID_NextCP: case MID_PrevCP:
- case MID_FirstPtNextCont:
- mi->ti.disabled = !exactlyone || sp==NULL;
- break;
- case MID_FirstPt: case MID_SelPointAt:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->splines==NULL;
- break;
- case MID_Contours:
- mi->ti.disabled = CVAnySelPoints(cv)==NULL;
- break;
- case MID_SelectWidth:
- mi->ti.disabled = !cv->showhmetrics;
- if ( HasUseMyMetrics(cv->sc)!=NULL )
- mi->ti.disabled = true;
- if ( !mi->ti.disabled ) {
- free(mi->ti.text);
- mi->ti.text = utf82u_copy(cv->widthsel?_("Deselect Width"):_("Width"));
- }
- break;
- case MID_SelectVWidth:
- mi->ti.disabled = !cv->showvmetrics || !cv->sc->parent->hasvmetrics;
- if ( HasUseMyMetrics(cv->sc)!=NULL )
- mi->ti.disabled = true;
- if ( !mi->ti.disabled ) {
- free(mi->ti.text);
- mi->ti.text = utf82u_copy(cv->vwidthsel?_("Deselect VWidth"):_("VWidth"));
- }
- break;
- case MID_SelectHM:
- mi->ti.disabled = !exactlyone || sp==NULL || sp->hintmask==NULL;
- break;
- }
- }
-}
-
-static void sllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_sllistcheck(cv,mi,e);
-}
-
-static void cv_cblistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
- int i;
- KernPair *kp;
- SplineChar *sc = cv->sc;
- SplineFont *sf = sc->parent;
- PST *pst;
- char *name;
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_AnchorPairs:
- mi->ti.disabled = sc->anchor==NULL;
- break;
- case MID_AnchorControl:
- mi->ti.disabled = sc->anchor==NULL;
- break;
- case MID_AnchorGlyph:
- if ( cv->apmine!=NULL )
- mi->ti.disabled = false;
- else
- mi->ti.disabled = sc->anchor==NULL;
- break;
- case MID_KernPairs:
- mi->ti.disabled = sc->kerns==NULL;
- if ( sc->kerns==NULL ) {
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- for ( kp = sf->glyphs[i]->kerns; kp!=NULL; kp=kp->next ) {
- if ( kp->sc == sc ) {
- mi->ti.disabled = false;
- goto out;
- }
- }
- }
- out:;
- }
- break;
- case MID_Ligatures:
- name = sc->name;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- for ( pst=sf->glyphs[i]->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type==pst_ligature &&
- PSTContains(pst->u.lig.components,name)) {
- mi->ti.disabled = false;
- goto break_out_2;
- }
- }
- }
- mi->ti.disabled = true;
- break_out_2:;
- break;
- }
- }
-}
-
-static void cv_nplistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
- SplineChar *sc = cv->sc;
- int order2 = sc->parent->order2;
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_PtsNone:
- mi->ti.checked = !cv->showpointnumbers;
- break;
- case MID_PtsTrue:
- mi->ti.disabled = !order2;
- mi->ti.checked = cv->showpointnumbers && order2;
- break;
- case MID_PtsPost:
- mi->ti.disabled = order2;
- mi->ti.checked = cv->showpointnumbers && !order2 && sc->numberpointsbackards;
- break;
- case MID_PtsSVG:
- mi->ti.disabled = order2;
- mi->ti.checked = cv->showpointnumbers && !order2 && !sc->numberpointsbackards;
- break;
- }
- }
-}
-
-static void cv_vwlistcheck(CharView *cv,struct gmenuitem *mi,GEvent *e) {
- int pos, gid;
- SplineFont *sf = cv->sc->parent;
- EncMap *map = cv->fv->map;
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_NextDef:
- for ( pos = CVCurEnc(cv)+1; pos<map->enccount && ((gid=map->map[pos])==-1 || !SCWorthOutputting(sf->glyphs[gid])); ++pos );
- mi->ti.disabled = pos==map->enccount || cv->searcher!=NULL;
- break;
- case MID_PrevDef:
- for ( pos = CVCurEnc(cv)-1; pos>=0 && ((gid=map->map[pos])==-1 || !SCWorthOutputting(sf->glyphs[gid])); --pos );
- mi->ti.disabled = pos<0 || cv->searcher!=NULL;
- break;
- case MID_Next:
- mi->ti.disabled = cv->searcher!=NULL || CVCurEnc(cv)==map->enccount-1;
- break;
- case MID_Prev:
- mi->ti.disabled = cv->searcher!=NULL || CVCurEnc(cv)==0;
- break;
- case MID_Former:
- if ( cv->former_cnt<=1 )
- pos = -1;
- else for ( pos = sf->glyphcnt-1; pos>=0 ; --pos )
- if ( sf->glyphs[pos]!=NULL && strcmp(sf->glyphs[pos]->name,cv->former_names[1])==0 )
- break;
- mi->ti.disabled = pos==-1 || cv->searcher!=NULL;
- break;
- case MID_Goto: case MID_FindInFontView:
- mi->ti.disabled = cv->searcher!=NULL;
- break;
- case MID_MarkExtrema:
- mi->ti.checked = cv->markextrema;
- break;
- case MID_MarkPointsOfInflection:
- mi->ti.checked = cv->markpoi;
- break;
- case MID_ShowCPInfo:
- mi->ti.checked = cv->showcpinfo;
- break;
- case MID_ShowSideBearings:
- mi->ti.checked = cv->showsidebearings;
- break;
- case MID_ShowTabs:
- mi->ti.checked = cv->showtabs;
- mi->ti.disabled = cv->former_cnt<=1;
- break;
- case MID_HidePoints:
- free(mi->ti.text);
- mi->ti.text = utf82u_copy(cv->showpoints?_("Hide Points"):_("Show Points"));
- break;
- case MID_HideRulers:
- free(mi->ti.text);
- mi->ti.text = utf82u_copy(cv->showrulers?_("Hide Rulers"):_("Show Rulers"));
- break;
- case MID_ShowGridFit:
- mi->ti.disabled = !hasFreeType() || cv->drawmode!=dm_fore || cv->dv!=NULL;
- mi->ti.checked = cv->show_ft_results;
- break;
- case MID_Fill:
- mi->ti.checked = cv->showfilled;
- break;
-#if HANYANG
- case MID_DisplayCompositions:
- mi->ti.disabled = !cv->sc->compositionunit || cv->sc->parent->rules==NULL;
- break;
-#endif
- }
- }
-}
-
-static void cblistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_cblistcheck(cv,mi,e);
-}
-
-static void nplistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_nplistcheck(cv,mi,e);
-}
-
-static void vwlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- cv_vwlistcheck(cv,mi,e);
-}
-
-static void CVMenuCenter(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- DBounds bb;
- real transform[6];
- int drawmode = cv->drawmode;
-
- cv->drawmode = dm_fore;
-
- transform[0] = transform[3] = 1.0;
- transform[1] = transform[2] = transform[5] = 0.0;
- SplineCharFindBounds(cv->sc,&bb);
- if ( mi->mid==MID_Center )
- transform[4] = (cv->sc->width-(bb.maxx-bb.minx))/2 - bb.minx;
- else
- transform[4] = (cv->sc->width-(bb.maxx-bb.minx))/3 - bb.minx;
- if ( transform[4]!=0 ) {
- cv->p.transany = false;
- CVPreserveState(cv);
- CVTransFunc(cv,transform,fvt_dontmovewidth);
- CVCharChangedUpdate(cv);
- }
- cv->drawmode = drawmode;
-}
-
-static void CVMenuSetWidth(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( mi->mid == MID_SetVWidth && !cv->sc->parent->hasvmetrics )
-return;
- CVSetWidth(cv,mi->mid==MID_SetWidth?wt_width:
- mi->mid==MID_SetLBearing?wt_lbearing:
- mi->mid==MID_SetRBearing?wt_rbearing:
- wt_vwidth);
-}
-
-static void CVMenuRemoveKern(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( cv->sc->kerns!=NULL ) {
- KernPairsFree(cv->sc->kerns);
- cv->sc->kerns = NULL;
- cv->sc->parent->changed = true;
- if ( cv->fv->cidmaster!=NULL )
- cv->fv->cidmaster->changed = true;
- }
-}
-
-static void CVMenuRemoveVKern(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- if ( cv->sc->vkerns!=NULL ) {
- KernPairsFree(cv->sc->vkerns);
- cv->sc->vkerns = NULL;
- cv->sc->parent->changed = true;
- if ( cv->fv->cidmaster!=NULL )
- cv->fv->cidmaster->changed = true;
- }
-}
-
-static void CVMenuKPCloseup(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- KernPairD(cv->sc->parent,cv->sc,NULL,false);
-}
-
-static void CVMenuAnchorsAway(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- AnchorPoint *ap;
-
- ap = mi->ti.userdata;
- if ( ap==NULL )
- for ( ap = cv->sc->anchor; ap!=NULL && !ap->selected; ap = ap->next );
- if ( ap==NULL ) ap= cv->sc->anchor;
- if ( ap==NULL )
-return;
-
- GDrawSetCursor(cv->v,ct_watch);
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- AnchorControl(cv->sc,ap);
- GDrawSetCursor(cv->v,ct_pointer);
-}
-
-static GMenuItem2 wnmenu[] = {
- { { (unichar_t *) N_("New O_utline Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 1, 0, 0, 0, 0, 0, 1, 1, 0, 'u' }, H_("New Outline Window|Ctl+H"), NULL, NULL, /* No function, never avail */NULL },
- { { (unichar_t *) N_("New _Bitmap Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("New Bitmap Window|Ctl+J"), NULL, NULL, CVMenuOpenBitmap, MID_OpenBitmap },
- { { (unichar_t *) N_("New _Metrics Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("New Metrics Window|Ctl+K"), NULL, NULL, CVMenuOpenMetrics },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Warnings"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Warnings|No Shortcut"), NULL, NULL, _MenuWarnings, MID_Warnings },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { NULL }
-};
-
-static void CVWindowMenuBuild(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- struct gmenuitem *wmi;
-
- WindowMenuBuild(gw,mi,e);
- for ( wmi = mi->sub; wmi->ti.text!=NULL || wmi->ti.line ; ++wmi ) {
- switch ( wmi->mid ) {
- case MID_OpenBitmap:
- wmi->ti.disabled = cv->sc->parent->bitmaps==NULL;
- break;
- case MID_Warnings:
- wmi->ti.disabled = ErrorWindowExists();
- break;
- }
- }
-}
-
-static void SVWindowMenuBuild(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- struct gmenuitem *wmi;
-
- WindowMenuBuild(gw,mi,e);
- for ( wmi = mi->sub; wmi->ti.text!=NULL || wmi->ti.line ; ++wmi ) {
- switch ( wmi->mid ) {
- case MID_OpenBitmap:
- wmi->ti.disabled = true;
- break;
- }
- }
-}
-
-static GMenuItem2 dummyitem[] = { { (unichar_t *) N_("Font|_New"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, NULL };
-static GMenuItem2 fllist[] = {
- { { (unichar_t *) N_("Font|_New"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("New|Ctl+N"), NULL, NULL, MenuNew },
- { { (unichar_t *) N_("_Open"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'O' }, H_("Open|Ctl+O"), NULL, NULL, MenuOpen },
- { { (unichar_t *) N_("Recen_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, NULL, dummyitem, MenuRecentBuild, NULL, MID_Recent },
- { { (unichar_t *) N_("_Close"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Close|Ctl+Shft+Q"), NULL, NULL, CVMenuClose },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Save"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Save|Ctl+S"), NULL, NULL, CVMenuSave },
- { { (unichar_t *) N_("S_ave as..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'a' }, H_("Save as...|Ctl+Shft+S"), NULL, NULL, CVMenuSaveAs },
- { { (unichar_t *) N_("_Generate Fonts..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'G' }, H_("Generate Fonts...|Ctl+Shft+G"), NULL, NULL, CVMenuGenerate },
- { { (unichar_t *) N_("Generate Mac _Family..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Generate Mac Family...|Alt+Ctl+G"), NULL, NULL, CVMenuGenerateFamily },
- { { (unichar_t *) N_("Expor_t..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, H_("Export...|No Shortcut"), NULL, NULL, CVMenuExport },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Import..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Import...|Ctl+Shft+I"), NULL, NULL, CVMenuImport },
- { { (unichar_t *) N_("_Revert File"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Revert File|Ctl+Shft+R"), NULL, NULL, CVMenuRevert, MID_Revert },
- { { (unichar_t *) N_("Revert Gl_yph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Revert Glyph|Alt+Ctl+R"), NULL, NULL, CVMenuRevertGlyph, MID_RevertGlyph },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Print..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Print...|Ctl+P"), NULL, NULL, CVMenuPrint },
- { { (unichar_t *) N_("_Display..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, H_("Display...|Alt+Ctl+P"), NULL, NULL, CVMenuDisplay, MID_Display },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Pr_eferences..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'e' }, H_("Preferences...|No Shortcut"), NULL, NULL, MenuPrefs },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Quit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'Q' }, H_("Quit|Ctl+Q"), NULL, NULL, MenuExit },
- { NULL }
-};
-
-static GMenuItem2 sllist[] = {
- { { (unichar_t *) N_("Select _All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Select All|Ctl+A"), NULL, NULL, CVSelectAll, MID_SelAll },
- { { (unichar_t *) N_("_Invert Selection"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Invert Selection|Ctl+Escape"), NULL, NULL, CVSelectInvert, MID_SelInvert },
- { { (unichar_t *) N_("_Deselect All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Deselect All|Escape"), NULL, NULL, CVSelectNone, MID_SelNone },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_First Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("First Point|Ctl+."), NULL, NULL, CVMenuNextPrevPt, MID_FirstPt },
- { { (unichar_t *) N_("First P_oint, Next Contour"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("First Point, Next Contour|Alt+Ctl+."), NULL, NULL, CVMenuNextPrevPt, MID_FirstPtNextCont },
- { { (unichar_t *) N_("_Next Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("Next Point|Ctl+Shft+}"), NULL, NULL, CVMenuNextPrevPt, MID_NextPt },
- { { (unichar_t *) N_("_Prev Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Prev Point|Ctl+Shft+{"), NULL, NULL, CVMenuNextPrevPt, MID_PrevPt },
- { { (unichar_t *) N_("Ne_xt Control Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'x' }, H_("Next Control Point|Ctl+;"), NULL, NULL, CVMenuNextPrevCPt, MID_NextCP },
- { { (unichar_t *) N_("P_rev Control Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Prev Control Point|Ctl+Shft+:"), NULL, NULL, CVMenuNextPrevCPt, MID_PrevCP },
- { { (unichar_t *) N_("Points on Selected _Contours"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Points on Selected Contours|Alt+Ctl+,"), NULL, NULL, CVMenuSelectContours, MID_Contours },
- { { (unichar_t *) N_("Point A_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Point At|Ctl+,"), NULL, NULL, CVMenuSelectPointAt, MID_SelPointAt },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Select All _Points & Refs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Select All Points & Refs|Alt+Ctl+A"), NULL, NULL, CVSelectAll, MID_SelectAllPoints },
- { { (unichar_t *) N_("Sele_ct Anchors"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'c' }, H_("Select Anchors|No Shortcut"), NULL, NULL, CVSelectAll, MID_SelectAnchors },
- { { (unichar_t *) N_("_Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Width|No Shortcut"), NULL, NULL, CVSelectWidth, MID_SelectWidth },
- { { (unichar_t *) N_("_VWidth"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("VWidth|No Shortcut"), NULL, NULL, CVSelectVWidth, MID_SelectVWidth },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Select Points Affected by HM"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("Select Points Affected by HM|No Shortcut"), NULL, NULL, CVSelectHM, MID_SelectHM },
- { NULL }
-};
-
-static GMenuItem2 edlist[] = {
- { { (unichar_t *) N_("_Undo"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'U' }, H_("Undo|Ctl+Z"), NULL, NULL, CVUndo, MID_Undo },
- { { (unichar_t *) N_("_Redo"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Redo|Ctl+Y"), NULL, NULL, CVRedo, MID_Redo },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Cu_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, H_("Cut|Ctl+X"), NULL, NULL, CVCut, MID_Cut },
- { { (unichar_t *) N_("_Copy"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Copy|Ctl+C"), NULL, NULL, CVCopy, MID_Copy },
- { { (unichar_t *) N_("C_opy Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Copy Reference|Ctl+G"), NULL, NULL, CVCopyRef, MID_CopyRef },
- { { (unichar_t *) N_("Copy _Lookup Data"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Copy Lookup Data|Alt+Ctl+C"), NULL, NULL, CVCopyLookupData, MID_CopyLookupData },
- { { (unichar_t *) N_("Copy _Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, H_("Copy Width|Ctl+W"), NULL, NULL, CVCopyWidth, MID_CopyWidth },
- { { (unichar_t *) N_("Co_py LBearing"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'p' }, H_("Copy LBearing|No Shortcut"), NULL, NULL, CVCopyWidth, MID_CopyLBearing },
- { { (unichar_t *) N_("Copy RBearin_g"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'g' }, H_("Copy RBearing|No Shortcut"), NULL, NULL, CVCopyWidth, MID_CopyRBearing },
- { { (unichar_t *) N_("_Paste"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Paste|Ctl+V"), NULL, NULL, CVPaste, MID_Paste },
- { { (unichar_t *) N_("C_lear"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, H_("Clear|Delete"), NULL, NULL, CVClear, MID_Clear },
- { { (unichar_t *) N_("Clear _Background"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Clear Background|No Shortcut"), NULL, NULL, CVClearBackground },
- { { (unichar_t *) N_("_Merge"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Merge|Ctl+M"), NULL, NULL, CVMerge, MID_Merge },
- { { (unichar_t *) N_("_Elide"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Elide|Alt+Ctl+M"), NULL, NULL, CVElide, MID_Elide },
- { { (unichar_t *) N_("_Join"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'J' }, H_("Join|Ctl+Shft+J"), NULL, NULL, CVJoin, MID_Join },
- { { (unichar_t *) N_("Copy _Fg To Bg"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Copy Fg To Bg|Ctl+Shft+C"), NULL, NULL, CVCopyFgBg, MID_CopyFgToBg },
-#ifdef FONTFORGE_CONFIG_COPY_BG_TO_FG
- { { (unichar_t *) N_("Cop_y Bg To Fg"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Copy Bg To Fg|No Shortcut"), NULL, NULL, CVCopyBgFg, MID_CopyBgToFg },
-#endif
- { { (unichar_t *) N_("Copy Gri_d Fit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Copy Grid Fit|No Shortcut"), NULL, NULL, CVMenuCopyGridFit, MID_CopyGridFit },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Select"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, NULL, sllist, sllistcheck },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("U_nlink Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'U' }, H_("Unlink Reference|Ctl+U"), NULL, NULL, CVUnlinkRef, MID_UnlinkRef },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Remo_ve Undoes"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'e' }, H_("Remove Undoes|No Shortcut"), NULL, NULL, CVRemoveUndoes, MID_RemoveUndoes },
- { NULL }
-};
-
-static GMenuItem2 ptlist[] = {
- { { (unichar_t *) N_("_Curve"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'C' }, H_("Curve|Ctl+2"), NULL, NULL, CVMenuPointType, MID_Curve },
- { { (unichar_t *) N_("C_orner"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'o' }, H_("Corner|Ctl+3"), NULL, NULL, CVMenuPointType, MID_Corner },
- { { (unichar_t *) N_("_Tangent"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'T' }, H_("Tangent|Ctl+4"), NULL, NULL, CVMenuPointType, MID_Tangent },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
-/* GT: Make this (selected) point the first point in the glyph */
- { { (unichar_t *) N_("_Make First"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Make First|Ctl+1"), NULL, NULL, CVMenuMakeFirst, MID_MakeFirst },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Can Be _Interpolated"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'T' }, H_("Can Be Interpolated|No Shortcut"), NULL, NULL, CVMenuImplicit, MID_ImplicitPt },
- { { (unichar_t *) N_("Can't Be _Interpolated"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'T' }, H_("Can't Be Interpolated|No Shortcut"), NULL, NULL, CVMenuImplicit, MID_NoImplicitPt },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Add Anchor"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Add Anchor|Ctl+0"), NULL, NULL, CVMenuAddAnchor, MID_AddAnchor },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Make _Line"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Make Line|No Shortcut"), NULL, NULL, CVMenuMakeLine, MID_MakeLine },
- { { (unichar_t *) N_("Insert Point On _Spline At..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Insert Point On Spline At...|No Shortcut"), NULL, NULL, CVMenuInsertPt, MID_InsertPtOnSplineAt },
- { { (unichar_t *) N_("Center _Between Control Points"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Center Between Control Points|No Shortcut"), NULL, NULL, CVMenuCenterCP, MID_CenterCP },
- { NULL }
-};
-
-static GMenuItem2 allist[] = {
-/* GT: Align these points to their average position */
- { { (unichar_t *) N_("_Average Points"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Average Points|Ctl+Shft+@"), NULL, NULL, CVMenuConstrain, MID_Average },
- { { (unichar_t *) N_("_Space Points"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Space Points|Ctl+Shft+#"), NULL, NULL, CVMenuConstrain, MID_SpacePts },
- { { (unichar_t *) N_("Space _Regions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Space Regions...|No Shortcut"), NULL, NULL, CVMenuConstrain, MID_SpaceRegion },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Make _Parallel..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Make Parallel...|No Shortcut"), NULL, NULL, CVMenuMakeParallel, MID_MakeParallel },
- { NULL }
-};
-
-static GMenuItem2 smlist[] = {
- { { (unichar_t *) N_("_Simplify"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Simplify|Ctl+Shft+M"), NULL, NULL, CVMenuSimplify, MID_Simplify },
- { { (unichar_t *) N_("Simplify More..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Simplify More...|Alt+Ctl+Shft+M"), NULL, NULL, CVMenuSimplifyMore, MID_SimplifyMore },
- { { (unichar_t *) N_("Clea_nup Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Cleanup Glyph|No Shortcut"), NULL, NULL, CVMenuCleanupGlyph, MID_CleanupGlyph },
- { { (unichar_t *) N_("Canonical Start _Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Canonical Start Point|No Shortcut"), NULL, NULL, CVMenuCanonicalStart, MID_CanonicalStart },
- { { (unichar_t *) N_("Canonical _Contours"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Canonical Contours|No Shortcut"), NULL, NULL, CVMenuCanonicalContours, MID_CanonicalContours },
- { NULL }
-};
-
-static void smlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Simplify:
- case MID_CleanupGlyph:
- case MID_SimplifyMore:
- case MID_CanonicalStart:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->splines==NULL;
- break;
- case MID_CanonicalContours:
- mi->ti.disabled = cv->layerheads[cv->drawmode]->splines==NULL ||
- cv->layerheads[cv->drawmode]->splines->next==NULL ||
- cv->drawmode!=dm_fore;
- break;
- }
- }
-}
-
-static GMenuItem2 orlist[] = {
- { { (unichar_t *) N_("_First"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("First|No Shortcut"), NULL, NULL, CVMenuOrder, MID_First },
- { { (unichar_t *) N_("_Earlier"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Earlier|No Shortcut"), NULL, NULL, CVMenuOrder, MID_Earlier },
- { { (unichar_t *) N_("L_ater"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Later|No Shortcut"), NULL, NULL, CVMenuOrder, MID_Later },
- { { (unichar_t *) N_("_Last"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Last|No Shortcut"), NULL, NULL, CVMenuOrder, MID_Last },
- { NULL }
-};
-
-static void orlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplinePointList *spl;
- RefChar *r;
- ImageList *im;
- int exactlyone = CVOneContourSel(cv,&spl,&r,&im);
- int isfirst, islast;
-
- isfirst = islast = false;
- if ( spl!=NULL ) {
- isfirst = cv->layerheads[cv->drawmode]->splines==spl;
- islast = spl->next==NULL;
- } else if ( r!=NULL ) {
- isfirst = cv->layerheads[cv->drawmode]->refs==r;
- islast = r->next==NULL;
- } else if ( im!=NULL ) {
- isfirst = cv->layerheads[cv->drawmode]->images==im;
- islast = im->next!=NULL;
- }
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_First:
- case MID_Earlier:
- mi->ti.disabled = !exactlyone || isfirst;
- break;
- case MID_Last:
- case MID_Later:
- mi->ti.disabled = !exactlyone || islast;
- break;
- }
- }
-}
-
-static GMenuItem2 rmlist[] = {
- { { (unichar_t *) N_("_Remove Overlap"), &GIcon_rmoverlap, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Remove Overlap|Ctl+Shft+O"), NULL, NULL, CVMenuOverlap, MID_RmOverlap },
- { { (unichar_t *) N_("_Intersect"), &GIcon_intersection, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Intersect|No Shortcut"), NULL, NULL, CVMenuOverlap, MID_Intersection },
- { { (unichar_t *) N_("_Exclude"), &GIcon_exclude, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'E' }, H_("Exclude|No Shortcut"), NULL, NULL, CVMenuOverlap, MID_Exclude },
- { { (unichar_t *) N_("_Find Intersections"), &GIcon_findinter, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Find Intersections|No Shortcut"), NULL, NULL, CVMenuOverlap, MID_FindInter },
- { NULL }
-};
-
-static GMenuItem2 eflist[] = {
- { { (unichar_t *) N_("_Inline"), &GIcon_inline, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'O' }, H_("Inline|No Shortcut"), NULL, NULL, CVMenuInline },
- { { (unichar_t *) N_("_Outline"), &GIcon_outline, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Outline|No Shortcut"), NULL, NULL, CVMenuOutline },
- { { (unichar_t *) N_("_Shadow"), &GIcon_shadow, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Shadow|No Shortcut"), NULL, NULL, CVMenuShadow },
- { { (unichar_t *) N_("_Wireframe"), &GIcon_wireframe, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'W' }, H_("Wireframe|No Shortcut"), NULL, NULL, CVMenuWireframe },
- { NULL }
-};
-
-static GMenuItem2 balist[] = {
- { { (unichar_t *) N_("_Build Accented Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'u' }, H_("Build Accented Glyph|Ctl+Shft+A"), NULL, NULL, CVMenuBuildAccent, MID_BuildAccent },
- { { (unichar_t *) N_("Build _Composite Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Build Composite Glyph|No Shortcut"), NULL, NULL, CVMenuBuildComposite, MID_BuildComposite },
- { NULL }
-};
-
-static GMenuItem2 delist[] = {
- { { (unichar_t *) N_("_References..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'u' }, H_("References...|Alt+Ctl+I"), NULL, NULL, CVMenuShowDependentRefs, MID_ShowDependentRefs },
- { { (unichar_t *) N_("_Substitutions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Substitutions...|No Shortcut"), NULL, NULL, CVMenuShowDependentSubs, MID_ShowDependentSubs },
- { NULL }
-};
-
-static GMenuItem2 trlist[] = {
- { { (unichar_t *) N_("_Transform..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Transform...|No Shortcut"), NULL, NULL, CVMenuTransform },
- { { (unichar_t *) N_("_Point of View Projection..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Point of View Projection...|Ctl+Shft+<"), NULL, NULL, CVMenuPOV },
- { { (unichar_t *) N_("_Non Linear Transform..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Non Linear Transform...|Ctl+Shft+|"), NULL, NULL, CVMenuNLTransform },
- { NULL }
-};
-
-static GMenuItem2 rndlist[] = {
- { { (unichar_t *) N_("To _Int"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("To Int|Ctl+Shft+_"), NULL, NULL, CVMenuRound2Int, MID_Round },
- { { (unichar_t *) N_("To _Hundredths"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("To Hundredths|No Shortcut"), NULL, NULL, CVMenuRound2Hundredths, 0 },
- { { (unichar_t *) N_("_Cluster"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Cluster|No Shortcut"), NULL, NULL, CVMenuCluster },
- { NULL }
-};
-
-static GMenuItem2 ellist[] = {
- { { (unichar_t *) N_("_Font Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Font Info...|Ctl+Shft+F"), NULL, NULL, CVMenuFontInfo },
- { { (unichar_t *) N_("Glyph _Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Glyph Info...|Alt+Ctl+Shft+I"), NULL, NULL, CVMenuCharInfo, MID_CharInfo },
- { { (unichar_t *) N_("Get _Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Get Info...|Ctl+I"), NULL, NULL, CVMenuGetInfo, MID_GetInfo },
- { { (unichar_t *) N_("S_how Dependent"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, NULL, delist, delistcheck },
- { { (unichar_t *) N_("Find Pr_oblems..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Find Problems...|Ctl+E"), NULL, NULL, CVMenuFindProblems },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Bitm_ap strikes Available..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Bitmap strikes Available...|Ctl+Shft+B"), NULL, NULL, CVMenuBitmaps, MID_AvailBitmaps },
- { { (unichar_t *) N_("Regenerate _Bitmap Glyphs..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Regenerate Bitmap Glyphs...|Ctl+B"), NULL, NULL, CVMenuBitmaps, MID_RegenBitmaps },
- { { (unichar_t *) N_("Remove Bitmap Glyphs..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Remove Bitmap Glyphs...|No Shortcut"), NULL, NULL, CVMenuBitmaps, MID_RemoveBitmaps },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Transformations"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Transformations|No Shortcut"), trlist },
- { { (unichar_t *) N_("_Expand Stroke..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, H_("Expand Stroke...|Ctl+Shft+E"), NULL, NULL, CVMenuStroke, MID_Stroke },
-#ifdef FONTFORGE_CONFIG_TILEPATH
- { { (unichar_t *) N_("Tile _Path..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Tile Path...|No Shortcut"), NULL, NULL, CVMenuTilePath, MID_TilePath },
-#endif
- { { (unichar_t *) N_("O_verlap"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'v' }, NULL, rmlist, NULL, NULL, MID_RmOverlap },
- { { (unichar_t *) N_("_Simplify"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, NULL, smlist, smlistcheck, NULL, MID_Simplify },
- { { (unichar_t *) N_("Add E_xtrema"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'x' }, H_("Add Extrema|Ctl+Shft+X"), NULL, NULL, CVMenuAddExtrema, MID_AddExtrema },
- { { (unichar_t *) N_("Effects"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, NULL, eflist, NULL, NULL, MID_Effects },
- { { (unichar_t *) N_("_Meta Font..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Meta Font...|Ctl+Shft+!"), NULL, NULL, CVMenuMetaFont, MID_MetaFont },
- { { (unichar_t *) N_("Autot_race"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Autotrace|Ctl+Shft+T"), NULL, NULL, CVMenuAutotrace, MID_Autotrace },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("A_lign"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, NULL, allist, allistcheck },
- { { (unichar_t *) N_("Roun_d"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, NULL, rndlist, NULL, NULL, MID_Round },
- { { (unichar_t *) N_("Order"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, NULL, orlist, orlistcheck },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Cl_ockwise"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'o' }, H_("Clockwise|No Shortcut"), NULL, NULL, CVMenuDir, MID_Clockwise },
- { { (unichar_t *) N_("Cou_nter Clockwise"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'n' }, H_("Counter Clockwise|No Shortcut"), NULL, NULL, CVMenuDir, MID_Counter },
- { { (unichar_t *) N_("_Correct Direction"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, H_("Correct Direction|Ctl+Shft+D"), NULL, NULL, CVMenuCorrectDir, MID_Correct },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("B_uild"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'u' }, NULL, balist, balistcheck, NULL, MID_BuildAccent },
- { NULL }
-};
-
-static GMenuItem2 htlist[] = {
- { { (unichar_t *) N_("Auto_Hint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("AutoHint|Ctl+Shft+H"), NULL, NULL, CVMenuAutoHint, MID_AutoHint },
- { { (unichar_t *) N_("Hint _Substitution Pts"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("Hint Substitution Pts|No Shortcut"), NULL, NULL, CVMenuAutoHintSubs, MID_HintSubsPt },
- { { (unichar_t *) N_("Auto _Counter Hint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("Auto Counter Hint|No Shortcut"), NULL, NULL, CVMenuAutoCounter, MID_AutoCounter },
- { { (unichar_t *) N_("_Don't AutoHint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'H' }, H_("Don't AutoHint|No Shortcut"), NULL, NULL, CVMenuDontAutoHint, MID_DontAutoHint },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Auto_Instr"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("AutoInstr|Ctl+T"), NULL, NULL, CVMenuAutoInstr, MID_AutoInstr },
- { { (unichar_t *) N_("_Edit Instructions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, H_("Edit Instructions...|No Shortcut"), NULL, NULL, CVMenuEditInstrs, MID_EditInstructions },
- { { (unichar_t *) N_("_Debug..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, H_("Debug...|No Shortcut"), NULL, NULL, CVMenuDebug, MID_Debug },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Clear HStem"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Clear HStem|No Shortcut"), NULL, NULL, CVMenuClearHints, MID_ClearHStem },
- { { (unichar_t *) N_("Clear _VStem"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("Clear VStem|No Shortcut"), NULL, NULL, CVMenuClearHints, MID_ClearVStem },
- { { (unichar_t *) N_("Clear Instructions"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Clear Instructions|No Shortcut"), NULL, NULL, CVMenuClearInstrs, MID_ClearInstr },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Add HHint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Add HHint|No Shortcut"), NULL, NULL, CVMenuAddHint, MID_AddHHint },
- { { (unichar_t *) N_("Add VHi_nt"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 's' }, H_("Add VHint|No Shortcut"), NULL, NULL, CVMenuAddHint, MID_AddVHint },
- { { (unichar_t *) N_("Add DHint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, H_("Add DHint|No Shortcut"), NULL, NULL, CVMenuAddHint, MID_AddDHint },
- { { (unichar_t *) N_("Crea_te HHint..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Create HHint...|No Shortcut"), NULL, NULL, CVMenuCreateHint, MID_CreateHHint },
- { { (unichar_t *) N_("Cr_eate VHint..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'e' }, H_("Create VHint...|No Shortcut"), NULL, NULL, CVMenuCreateHint, MID_CreateVHint },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Review Hints..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Review Hints...|Alt+Ctl+H"), NULL, NULL, CVMenuReviewHints, MID_ReviewHints },
- { NULL }
-};
-
-static GMenuItem2 ap2list[] = {
- { NULL }
-};
-
-static void ap2listbuild(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- char buf[300];
- GMenuItem *sub;
- int k, cnt;
- AnchorPoint *ap;
- extern void GMenuItemArrayFree(GMenuItem *mi);
-
- if ( mi->sub!=NULL ) {
- GMenuItemArrayFree(mi->sub);
- mi->sub = NULL;
- }
-
- for ( k=0; k<2; ++k ) {
- cnt = 0;
- for ( ap=cv->sc->anchor; ap!=NULL; ap=ap->next ) {
- if ( k ) {
- if ( ap->type==at_baselig )
-/* GT: In the next few lines the "%s" is the name of an anchor class, and the */
-/* GT: rest of the string identifies the type of the anchor */
- snprintf(buf,sizeof(buf), _("%s at ligature pos %d"), ap->anchor->name, ap->lig_index );
- else
- snprintf(buf,sizeof(buf),
- ap->type==at_cexit ? _("%s exit"):
- ap->type==at_centry ? _("%s entry"):
- ap->type==at_mark ? _("%s mark"):
- _("%s base"),ap->anchor->name );
- sub[cnt].ti.text = utf82u_copy(buf);
- sub[cnt].ti.userdata = ap;
- sub[cnt].ti.bg = sub[cnt].ti.fg = COLOR_DEFAULT;
- sub[cnt].invoke = CVMenuAnchorsAway;
- }
- ++cnt;
- }
- if ( !k )
- sub = gcalloc(cnt+1,sizeof(GMenuItem));
- }
- mi->sub = sub;
-}
-
-static GMenuItem2 mtlist[] = {
- { { (unichar_t *) N_("_Center in Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Center in Width|No Shortcut"), NULL, NULL, CVMenuCenter, MID_Center },
- { { (unichar_t *) N_("_Thirds in Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Thirds in Width|No Shortcut"), NULL, NULL, CVMenuCenter, MID_Thirds },
- { { (unichar_t *) N_("Set _Width..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, H_("Set Width...|Ctl+Shft+L"), NULL, NULL, CVMenuSetWidth, MID_SetWidth },
- { { (unichar_t *) N_("Set _LBearing..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'L' }, H_("Set LBearing...|Ctl+L"), NULL, NULL, CVMenuSetWidth, MID_SetLBearing },
- { { (unichar_t *) N_("Set _RBearing..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Set RBearing...|Ctl+R"), NULL, NULL, CVMenuSetWidth, MID_SetRBearing },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Remove Kern _Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Remove Kern Pairs|No Shortcut"), NULL, NULL, CVMenuRemoveKern, MID_RemoveKerns },
- { { (unichar_t *) N_("Remove VKern Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Remove VKern Pairs|No Shortcut"), NULL, NULL, CVMenuRemoveVKern, MID_RemoveVKerns },
- { { (unichar_t *) N_("Kern Pair Closeup..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Kern Pair Closeup...|No Shortcut"), NULL, NULL, CVMenuKPCloseup, MID_KPCloseup },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Set _Vertical Advance..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("Set Vertical Advance...|No Shortcut"), NULL, NULL, CVMenuSetWidth, MID_SetVWidth },
- { NULL }
-};
-
-static GMenuItem2 pllist[] = {
- { { (unichar_t *) N_("_Tools"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'T' }, H_("Tools|No Shortcut"), NULL, NULL, CVMenuPaletteShow, MID_Tools },
- { { (unichar_t *) N_("_Layers"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'L' }, H_("Layers|No Shortcut"), NULL, NULL, CVMenuPaletteShow, MID_Layers },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Docked Palettes"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'D' }, H_("Docked Palettes|No Shortcut"), NULL, NULL, CVMenuPalettesDock, MID_DockPalettes },
- { NULL }
-};
-
-static GMenuItem2 aplist[] = {
- { { (unichar_t *) N_("_Detach"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("Detach|No Shortcut"), NULL, NULL, CVMenuAPDetach },
- { NULL }
-};
-
-static void aplistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplineChar *sc = cv->sc, **glyphs;
- SplineFont *sf = sc->parent;
- AnchorPoint *ap, *found;
- extern void GMenuItemArrayFree(GMenuItem *mi);
- extern void GMenuItem2ArrayFree(GMenuItem2 *mi);
- extern GMenuItem *GMenuItem2ArrayCopy(GMenuItem2 *mi, uint16 *cnt);
- GMenuItem2 *mit;
- int cnt;
-
- found = NULL;
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->selected ) {
- if ( found==NULL )
- found = ap;
- else {
- /* Can't deal with two selected anchors */
- found = NULL;
- break;
- }
- }
- }
-
- GMenuItemArrayFree(mi->sub);
- if ( found==NULL )
- glyphs = NULL;
- else
- glyphs = GlyphsMatchingAP(sf,found);
- if ( glyphs==NULL ) {
- mi->sub = GMenuItem2ArrayCopy(aplist,NULL);
- mi->sub->ti.disabled = (cv->apmine==NULL);
-return;
- }
-
- for ( cnt = 0; glyphs[cnt]!=NULL; ++cnt );
- mit = gcalloc(cnt+2,sizeof(GMenuItem2));
- mit[0] = aplist[0];
- mit[0].ti.text = (unichar_t *) copy( (char *) mit[0].ti.text );
- mit[0].ti.disabled = (cv->apmine==NULL);
- for ( cnt = 0; glyphs[cnt]!=NULL; ++cnt ) {
- mit[cnt+1].ti.text = (unichar_t *) copy(glyphs[cnt]->name);
- mit[cnt+1].ti.text_is_1byte = true;
- mit[cnt+1].ti.fg = mit[cnt+1].ti.bg = COLOR_DEFAULT;
- mit[cnt+1].ti.userdata = glyphs[cnt];
- mit[cnt+1].invoke = CVMenuAPAttachSC;
- if ( glyphs[cnt]==cv->apsc )
- mit[cnt+1].ti.checked = mit[cnt+1].ti.checkable = true;
- }
- free(glyphs);
- mi->sub = GMenuItem2ArrayCopy(mit,NULL);
- GMenuItem2ArrayFree(mit);
-}
-
-static GMenuItem2 cblist[] = {
- { { (unichar_t *) N_("_Kern Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("Kern Pairs|No Shortcut"), NULL, NULL, CVMenuKernPairs, MID_KernPairs },
- { { (unichar_t *) N_("_Anchored Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Anchored Pairs|No Shortcut"), NULL, NULL, CVMenuAnchorPairs, MID_AnchorPairs },
- { { (unichar_t *) N_("_Anchor Control..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, NULL, ap2list, ap2listbuild, NULL, MID_AnchorControl },
- { { (unichar_t *) N_("Anchor _Glyph at Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, NULL, aplist, aplistcheck, NULL, MID_AnchorGlyph },
- { { (unichar_t *) N_("_Ligatures"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'L' }, H_("Ligatures|No Shortcut"), NULL, NULL, CVMenuLigatures, MID_Ligatures },
- NULL
-};
-
-static GMenuItem2 nplist[] = {
- { { (unichar_t *) N_("PointNumbers|_None"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'K' }, H_("None|No Shortcut"), NULL, NULL, CVMenuNumberPoints, MID_PtsNone },
- { { (unichar_t *) N_("TrueType"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'A' }, H_("TrueType|No Shortcut"), NULL, NULL, CVMenuNumberPoints, MID_PtsTrue },
- { { (unichar_t *) NU_("PostScript®"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'L' }, H_("PostScript|No Shortcut"), NULL, NULL, CVMenuNumberPoints, MID_PtsPost },
- { { (unichar_t *) N_("SVG"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'L' }, H_("SVG|No Shortcut"), NULL, NULL, CVMenuNumberPoints, MID_PtsSVG },
- NULL
-};
-
-static GMenuItem2 vwlist[] = {
- { { (unichar_t *) N_("_Fit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Fit|Ctl+F"), NULL, NULL, CVMenuScale, MID_Fit },
- { { (unichar_t *) N_("Z_oom out"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Zoom out|Alt+Ctl+-"), NULL, NULL, CVMenuScale, MID_ZoomOut },
- { { (unichar_t *) N_("Zoom _in"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'i' }, H_("Zoom in|Alt+Ctl+Shft++"), NULL, NULL, CVMenuScale, MID_ZoomIn },
-#if HANYANG
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Display Compositions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'i' }, H_("Display Compositions...|No Shortcut"), NULL, NULL, CVDisplayCompositions, MID_DisplayCompositions },
-#endif
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Next Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("Next Glyph|Ctl+]"), NULL, NULL, CVMenuChangeChar, MID_Next },
- { { (unichar_t *) N_("_Prev Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Prev Glyph|Ctl+["), NULL, NULL, CVMenuChangeChar, MID_Prev },
- { { (unichar_t *) N_("Next _Defined Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, H_("Next Defined Glyph|Alt+Ctl+]"), NULL, NULL, CVMenuChangeChar, MID_NextDef },
- { { (unichar_t *) N_("Prev Defined Gl_yph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'a' }, H_("Prev Defined Glyph|Alt+Ctl+["), NULL, NULL, CVMenuChangeChar, MID_PrevDef },
- { { (unichar_t *) N_("Form_er Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'a' }, H_("Former Glyph|Ctl+Shft+<"), NULL, NULL, CVMenuChangeChar, MID_Former },
- { { (unichar_t *) N_("_Goto"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'G' }, H_("Goto|Ctl+Shft+>"), NULL, NULL, CVMenuGotoChar, MID_Goto },
- { { (unichar_t *) N_("Find In Font _View"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("Find In Font View|Ctl+Shft+<"), NULL, NULL, CVMenuFindInFontView, MID_FindInFontView },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Hide Poin_ts"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Hide Points|Ctl+D"), NULL, NULL, CVMenuShowHide, MID_HidePoints },
- { { (unichar_t *) N_("_Number Points"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, NULL, nplist, nplistcheck },
- { { (unichar_t *) N_("_Mark Extrema"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'M' }, H_("Mark Extrema|No Shortcut"), NULL, NULL, CVMenuMarkExtrema, MID_MarkExtrema },
- { { (unichar_t *) N_("M_ark Points of Inflection"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'M' }, H_("Mark Points of Inflection|No Shortcut"), NULL, NULL, CVMenuMarkPointsOfInflection, MID_MarkPointsOfInflection },
- { { (unichar_t *) N_("Show _Control Point Info"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'M' }, H_("Show Control Point Info|No Shortcut"), NULL, NULL, CVMenuShowCPInfo, MID_ShowCPInfo },
- { { (unichar_t *) N_("Show Side B_earings"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'M' }, H_("Show Side Bearings|No Shortcut"), NULL, NULL, CVMenuShowSideBearings, MID_ShowSideBearings },
- { { (unichar_t *) N_("Fi_ll"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'l' }, H_("Fill|No Shortcut"), NULL, NULL, CVMenuFill, MID_Fill },
- { { (unichar_t *) N_("Sho_w Grid Fit..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'l' }, H_("Show Grid Fit...|No Shortcut"), NULL, NULL, CVMenuShowGridFit, MID_ShowGridFit },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, }},
- { { (unichar_t *) N_("Com_binations"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'b' }, NULL, cblist, cblistcheck },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, }},
- { { (unichar_t *) N_("Palette_s"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, NULL, pllist, pllistcheck },
- { { (unichar_t *) N_("S_how Glyph Tabs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'R' }, H_("Show Glyph Tabs|No Shortcut"), NULL, NULL, CVMenuShowTabs, MID_ShowTabs },
- { { (unichar_t *) N_("Hide _Rulers"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Hide Rulers|No Shortcut"), NULL, NULL, CVMenuShowHideRulers, MID_HideRulers },
- { NULL }
-};
-
-static void CVMenuShowMMMask(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- uint32 changemask = (uint32) (intpt) mi->ti.userdata;
- /* Change which mms get displayed in the "background" */
-
- if ( mi->mid==MID_MMAll ) {
- if ( (cv->mmvisible&changemask)==changemask ) cv->mmvisible = 0;
- else cv->mmvisible = changemask;
- } else if ( mi->mid == MID_MMNone ) {
- if ( cv->mmvisible==0 ) cv->mmvisible = (1<<(cv->sc->parent->mm->instance_count+1))-1;
- else cv->mmvisible = 0;
- } else
- cv->mmvisible ^= changemask;
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static GMenuItem2 mvlist[] = {
- { { (unichar_t *) N_("SubFonts|_All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0xffffffff, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '\0' }, H_("All|No Shortcut"), NULL, NULL, CVMenuShowMMMask, MID_MMAll },
- { { (unichar_t *) N_("SubFonts|_None"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '\0' }, H_("None|No Shortcut"), NULL, NULL, CVMenuShowMMMask, MID_MMNone },
- { NULL }
-};
-
-static void mvlistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int i, base, j;
- extern void GMenuItemArrayFree(GMenuItem *mi);
- extern GMenuItem *GMenuItem2ArrayCopy(GMenuItem2 *mi, uint16 *cnt);
- MMSet *mm = cv->sc->parent->mm;
- uint32 submask;
- SplineFont *sub;
- GMenuItem2 *mml;
-
- base = 3;
- if ( mm==NULL )
- mml = mvlist;
- else {
- mml = gcalloc(base+mm->instance_count+2,sizeof(GMenuItem2));
- memcpy(mml,mvlist,sizeof(mvlist));
- mml[base-1].ti.fg = mml[base-1].ti.bg = COLOR_DEFAULT;
- mml[base-1].ti.line = true;
- submask = 0;
- for ( j = 0, i=base; j<mm->instance_count+1; ++i, ++j ) {
- if ( j==0 )
- sub = mm->normal;
- else
- sub = mm->instances[j-1];
- mml[i].ti.text = uc_copy(sub->fontname);
- mml[i].ti.checkable = true;
- mml[i].ti.checked = (cv->mmvisible & (1<<j))?1:0;
- mml[i].ti.userdata = (void *) (intpt) (1<<j);
- mml[i].invoke = CVMenuShowMMMask;
- mml[i].ti.fg = mml[i].ti.bg = COLOR_DEFAULT;
- if ( sub==cv->sc->parent )
- submask = (1<<j);
- }
- /* All */
- mml[0].ti.userdata = (void *) (intpt) ((1<<j)-1);
- mml[0].ti.checked = (cv->mmvisible == (uint32) (intpt) mml[0].ti.userdata);
- /* None */
- mml[1].ti.checked = (cv->mmvisible == 0 || cv->mmvisible == submask);
- }
- GMenuItemArrayFree(mi->sub);
- mi->sub = GMenuItem2ArrayCopy(mml,NULL);
- if ( mml!=mvlist ) {
- for ( i=base; mml[i].ti.text!=NULL; ++i )
- free( mml[i].ti.text);
- free(mml);
- }
-}
-
-static void CVMenuReblend(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- char *err;
- MMSet *mm = cv->sc->parent->mm;
-
- if ( mm==NULL || mm->apple || cv->sc->parent!=mm->normal )
-return;
- err = MMBlendChar(mm,cv->sc->orig_pos);
- if ( mm->normal->glyphs[cv->sc->orig_pos]!=NULL )
- _SCCharChangedUpdate(mm->normal->glyphs[cv->sc->orig_pos],-1);
- if ( err!=0 )
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_post_error(_("Bad Multiple Master Font"),err);
-#endif
-}
-
-static GMenuItem2 mmlist[] = {
-/* GT: Here (and following) MM means "MultiMaster" */
- { { (unichar_t *) N_("MM _Reblend"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("MM Reblend|No Shortcut"), NULL, NULL, CVMenuReblend, MID_MMReblend },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, }},
- { { (unichar_t *) N_("_View"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, NULL, mvlist, mvlistcheck },
- { NULL }
-};
-
-static void CVMenuShowSubChar(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- SplineFont *new = mi->ti.userdata;
- /* Change to the same char in a different instance font of the mm */
-
- CVChangeSC(cv,SFMakeChar(new,cv->fv->map,CVCurEnc(cv)));
- cv->layerheads[dm_grid] = &new->grid;
-}
-
-static void mmlistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
- int i, base, j;
- extern void GMenuItemArrayFree(GMenuItem *mi);
- extern GMenuItem *GMenuItem2ArrayCopy(GMenuItem2 *mi, uint16 *cnt);
- MMSet *mm = cv->sc->parent->mm;
- SplineFont *sub;
- GMenuItem2 *mml;
-
- base = sizeof(mmlist)/sizeof(mmlist[0]);
- if ( mm==NULL )
- mml = mmlist;
- else {
- mml = gcalloc(base+mm->instance_count+2,sizeof(GMenuItem2));
- memcpy(mml,mmlist,sizeof(mmlist));
- mml[base-1].ti.fg = mml[base-1].ti.bg = COLOR_DEFAULT;
- mml[base-1].ti.line = true;
- for ( j = 0, i=base; j<mm->instance_count+1; ++i, ++j ) {
- if ( j==0 )
- sub = mm->normal;
- else
- sub = mm->instances[j-1];
- mml[i].ti.text = uc_copy(sub->fontname);
- mml[i].ti.checkable = true;
- mml[i].ti.checked = sub==cv->sc->parent;
- mml[i].ti.userdata = sub;
- mml[i].invoke = CVMenuShowSubChar;
- mml[i].ti.fg = mml[i].ti.bg = COLOR_DEFAULT;
- }
- }
- mml[0].ti.disabled = (mm==NULL || cv->sc->parent!=mm->normal || mm->apple);
- GMenuItemArrayFree(mi->sub);
- mi->sub = GMenuItem2ArrayCopy(mml,NULL);
- if ( mml!=mmlist ) {
- for ( i=base; mml[i].ti.text!=NULL; ++i )
- free( mml[i].ti.text);
- free(mml);
- }
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void CVMenuContextualHelp(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void CharViewMenu_ContextualHelp(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- help("charview.html");
-}
-
-static GMenuItem2 mblist[] = {
- { { (unichar_t *) N_("_File"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, NULL, fllist, fllistcheck },
- { { (unichar_t *) N_("_Edit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, NULL, edlist, edlistcheck },
- { { (unichar_t *) N_("_Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, NULL, ptlist, ptlistcheck },
- { { (unichar_t *) N_("E_lement"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, NULL, ellist, ellistcheck },
- { { (unichar_t *) N_("H_ints"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, NULL, htlist, htlistcheck },
- { { (unichar_t *) N_("_View"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, NULL, vwlist, vwlistcheck },
- { { (unichar_t *) N_("_Metrics"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, NULL, mtlist, mtlistcheck },
-/* GT: Here (and following) MM means "MultiMaster" */
- { { (unichar_t *) N_("MM"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, NULL, mmlist, mmlistcheck },
- { { (unichar_t *) N_("_Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, NULL, wnmenu, CVWindowMenuBuild },
- { { (unichar_t *) N_("_Help"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, NULL, helplist, NULL },
- { NULL }
-};
-
-static GMenuItem2 mblist_nomm[] = {
- { { (unichar_t *) N_("_File"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, NULL, fllist, fllistcheck },
- { { (unichar_t *) N_("_Edit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, NULL, edlist, edlistcheck },
- { { (unichar_t *) N_("_Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, NULL, ptlist, ptlistcheck },
- { { (unichar_t *) N_("E_lement"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, NULL, ellist, ellistcheck },
- { { (unichar_t *) N_("H_ints"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, NULL, htlist, htlistcheck },
- { { (unichar_t *) N_("_View"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, NULL, vwlist, vwlistcheck },
- { { (unichar_t *) N_("_Metrics"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, NULL, mtlist, mtlistcheck },
- { { (unichar_t *) N_("_Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, NULL, wnmenu, CVWindowMenuBuild },
- { { (unichar_t *) N_("_Help"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, NULL, helplist, NULL },
- { NULL }
-};
-
-static void _CharViewCreate(CharView *cv, SplineChar *sc, FontView *fv,int enc) {
- GRect pos;
- GWindowAttrs wattrs;
- GGadgetData gd;
- int sbsize;
- FontRequest rq;
- int as, ds, ld;
- extern int updateflex;
- static unichar_t fixed[] = { 'f','i','x','e','d',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };
- static unichar_t *infofamily=NULL;
- extern int cv_auto_goto;
-
- if ( !cvcolsinited )
- CVColInit();
-
- if ( sc->views==NULL && updateflex )
- SplineCharIsFlexible(sc);
-
- cv->sc = sc;
- cv->scale = .5;
- cv->xoff = cv->yoff = 20;
- cv->next = sc->views;
- sc->views = cv;
- cv->fv = fv;
- cv->map_of_enc = fv->map;
- cv->enc = enc;
-
- cv->drawmode = dm_fore;
-
- cv->showback = CVShows.showback;
- cv->showfore = CVShows.showfore;
- cv->showgrids = CVShows.showgrids;
- cv->showhhints = CVShows.showhhints;
- cv->showvhints = CVShows.showvhints;
- cv->showdhints = CVShows.showdhints;
- cv->showpoints = CVShows.showpoints;
- cv->showrulers = CVShows.showrulers;
- cv->showfilled = CVShows.showfilled;
- cv->showrounds = CVShows.showrounds;
- cv->showmdx = CVShows.showmdx;
- cv->showmdy = CVShows.showmdy;
- cv->showhmetrics = CVShows.showhmetrics;
- cv->showvmetrics = CVShows.showvmetrics;
- cv->markextrema = CVShows.markextrema;
- cv->showsidebearings = CVShows.showsidebearings;
- cv->markpoi = CVShows.markpoi;
- cv->showblues = CVShows.showblues;
- cv->showfamilyblues = CVShows.showfamilyblues;
- cv->showanchor = CVShows.showanchor;
- cv->showcpinfo = CVShows.showcpinfo;
- cv->showtabs = CVShows.showtabs;
-
- cv->infoh = 13;
- cv->rulerh = 13;
-
- GDrawGetSize(cv->gw,&pos);
- memset(&gd,0,sizeof(gd));
- gd.pos.y = cv->mbh+cv->infoh;
- gd.pos.width = sbsize = GDrawPointsToPixels(cv->gw,_GScrollBar_Width);
- gd.pos.height = pos.height-cv->mbh-cv->infoh - sbsize;
- gd.pos.x = pos.width-sbsize;
- gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels|gg_sb_vert;
- cv->vsb = GScrollBarCreate(cv->gw,&gd,cv);
-
- gd.pos.y = pos.height-sbsize; gd.pos.height = sbsize;
- gd.pos.width = pos.width - sbsize;
- gd.pos.x = 0;
- gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels;
- cv->hsb = GScrollBarCreate(cv->gw,&gd,cv);
-
- GDrawGetSize(cv->gw,&pos);
- pos.y = cv->mbh+cv->infoh; pos.height -= cv->mbh + sbsize + cv->infoh;
- pos.x = 0; pos.width -= sbsize;
- if ( cv->showrulers ) {
- pos.y += cv->rulerh; pos.height -= cv->rulerh;
- pos.x += cv->rulerh; pos.width -= cv->rulerh;
- }
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor;
- wattrs.event_masks = -1;
- wattrs.cursor = ct_mypointer;
- cv->v = GWidgetCreateSubWindow(cv->gw,&pos,v_e_h,cv,&wattrs);
-
- if ( GDrawRequestDeviceEvents(cv->v,input_em_cnt,input_em)>0 ) {
- /* Success! They've got a wacom tablet */
- }
-
- if ( infofamily==NULL ) {
- infofamily = uc_copy(GResourceFindString("CharView.InfoFamily"));
- if ( infofamily==NULL )
- infofamily = fixed;
- }
-
- memset(&rq,0,sizeof(rq));
- rq.family_name = infofamily;
- rq.point_size = -7;
- rq.weight = 400;
- cv->small = GDrawInstanciateFont(GDrawGetDisplayOfWindow(cv->gw),&rq);
- GDrawFontMetrics(cv->small,&as,&ds,&ld);
- cv->sfh = as+ds; cv->sas = as;
- rq.point_size = 10;
- cv->normal = GDrawInstanciateFont(GDrawGetDisplayOfWindow(cv->gw),&rq);
- GDrawFontMetrics(cv->normal,&as,&ds,&ld);
- cv->nfh = as+ds; cv->nas = as;
-
- cv->height = pos.height; cv->width = pos.width;
- cv->gi.u.image = gcalloc(1,sizeof(struct _GImage));
- cv->gi.u.image->image_type = it_mono;
- cv->gi.u.image->clut = gcalloc(1,sizeof(GClut));
- cv->gi.u.image->clut->trans_index = cv->gi.u.image->trans = 0;
- cv->gi.u.image->clut->clut_len = 2;
- cv->gi.u.image->clut->clut[0] = 0xffffff;
- cv->gi.u.image->clut->clut[1] = backimagecol;
- cv->b1_tool = cvt_pointer; cv->cb1_tool = cvt_pointer;
- cv->b2_tool = cvt_magnify; cv->cb2_tool = cvt_ruler;
- cv->s1_tool = cvt_freehand; cv->s2_tool = cvt_pen;
- cv->er_tool = cvt_knife;
- cv->showing_tool = cvt_pointer;
- cv->pressed_tool = cv->pressed_display = cv->active_tool = cvt_none;
- cv->layerheads[dm_fore] = &sc->layers[ly_fore];
- cv->layerheads[dm_back] = &sc->layers[ly_back];
- cv->layerheads[dm_grid] = &fv->sf->grid;
-
-#if HANYANG
- if ( sc->parent->rules!=NULL && sc->compositionunit )
- Disp_DefaultTemplate(cv);
-#endif
-
- cv->olde.x = -1;
-
- cv->ft_dpi = 72; cv->ft_pointsize = 12.0; cv->ft_ppem = 12;
-
- /*GWidgetHidePalettes();*/
- /*cv->tools = CVMakeTools(cv);*/
- /*cv->layers = CVMakeLayers(cv);*/
-
- CVFit(cv);
- GDrawSetVisible(cv->v,true);
- if ( cv_auto_goto ) /* Chinese input method steals hot key key-strokes */
- cv->gic = GDrawCreateInputContext(cv->v,gic_root|gic_orlesser);
- GDrawSetVisible(cv->gw,true);
-}
-
-void DefaultY(GRect *pos) {
- static int nexty=0;
- GRect size;
-
- GDrawGetSize(GDrawGetRoot(NULL),&size);
- if ( nexty!=0 ) {
- FontView *fv;
- int any=0, i;
- BDFFont *bdf;
- /* are there any open cv/bv windows? */
- for ( fv = fv_list; fv!=NULL && !any; fv = fv->next ) {
- for ( i=0; i<fv->sf->glyphcnt; ++i ) if ( fv->sf->glyphs[i]!=NULL ) {
- if ( fv->sf->glyphs[i]->views!=NULL ) {
- any = true;
- break;
- }
- }
- for ( bdf = fv->sf->bitmaps; bdf!=NULL && !any; bdf=bdf->next ) {
- for ( i=0; i<bdf->glyphcnt; ++i ) if ( bdf->glyphs[i]!=NULL ) {
- if ( bdf->glyphs[i]->views!=NULL ) {
- any = true;
- break;
- }
- }
- }
- }
- if ( !any ) nexty = 0;
- }
- pos->y = nexty;
- nexty += 200;
- if ( nexty+pos->height > size.height )
- nexty = 0;
-}
-
-static void CharViewInit(void);
-
-CharView *CharViewCreate(SplineChar *sc, FontView *fv,int enc) {
- CharView *cv = gcalloc(1,sizeof(CharView));
- GWindowAttrs wattrs;
- GRect pos, zoom;
- GWindow gw;
- GGadgetData gd;
- GTabInfo aspects[2];
- GRect gsize;
- char buf[300];
-
- CharViewInit();
-
- cv->sc = sc;
- cv->fv = fv;
- cv->enc = enc;
- cv->map_of_enc = fv->map; /* I know this is done again in _CharViewCreate, but it needs to be done before creating the title */
-
- SCLigCaretCheck(sc,false);
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_utf8_ititle;
- wattrs.event_masks = -1;
- wattrs.cursor = ct_mypointer;
- wattrs.utf8_icon_title = CVMakeTitles(cv,buf);
- wattrs.utf8_window_title = buf;
- wattrs.icon = CharIcon(cv, fv);
- if ( wattrs.icon )
- wattrs.mask |= wam_icon;
- pos.x = GGadgetScale(104)+6; pos.width=pos.height = 540;
- DefaultY(&pos);
-
- cv->gw = gw = GDrawCreateTopWindow(NULL,&pos,cv_e_h,cv,&wattrs);
- free( (unichar_t *) wattrs.icon_title );
-
- GDrawGetSize(GDrawGetRoot(screen_display),&zoom);
- zoom.x = CVPalettesWidth(); zoom.width -= zoom.x-10;
- zoom.height -= 30; /* Room for title bar & such */
- GDrawSetZoom(gw,&zoom,-1);
-
- memset(&gd,0,sizeof(gd));
- gd.flags = gg_visible | gg_enabled;
- helplist[0].invoke = CVMenuContextualHelp;
- gd.u.menu2 = sc->parent->mm==NULL ? mblist_nomm : mblist;
- cv->mb = GMenu2BarCreate( gw, &gd, NULL);
- GGadgetGetSize(cv->mb,&gsize);
- cv->mbh = gsize.height;
-
- memset(aspects,0,sizeof(aspects));
- aspects[0].text = (unichar_t *) sc->name;
- aspects[0].text_is_1byte = true;
- /* NOT visible until we add a second glyph to the stack */
- gd.flags = gg_enabled|gg_tabset_nowindow|gg_tabset_scroll|gg_pos_in_pixels;
- gd.u.menu = NULL;
- gd.u.tabs = aspects;
- gd.pos.x = 0;
- gd.pos.y = cv->mbh;
- gd.handle_controlevent = CVChangeToFormer;
- cv->tabs = GTabSetCreate( gw, &gd, NULL );
- cv->former_cnt = 1;
- cv->former_names[0] = copy(sc->name);
- GGadgetTakesKeyboard(cv->tabs,false);
-
- _CharViewCreate(cv,sc,fv,enc);
-return( cv );
-}
-
-void CharViewFree(CharView *cv) {
- int i;
-
- BDFCharFree(cv->filled);
- if ( cv->ruler_w ) {
- GDrawDestroyWindow(cv->ruler_w);
- cv->ruler_w = NULL;
- }
- free(cv->gi.u.image->clut);
- free(cv->gi.u.image);
-#if HANYANG
- if ( cv->jamodisplay!=NULL )
- Disp_DoFinish(cv->jamodisplay,true);
-#endif
-
- CVDebugFree(cv->dv);
-
- SplinePointListsFree(cv->gridfit);
- FreeType_FreeRaster(cv->oldraster);
- FreeType_FreeRaster(cv->raster);
-
- CVDebugFree(cv->dv);
-
- for ( i=0; i<cv->former_cnt; ++i )
- free(cv->former_names[i]);
-
- free(cv);
-}
-
-int CVValid(SplineFont *sf, SplineChar *sc, CharView *cv) {
- /* A charview may have been closed. A splinechar may have been removed */
- /* from a font */
- CharView *test;
-
- if ( cv->sc!=sc || sc->parent!=sf )
-return( false );
- if ( sc->orig_pos<0 || sc->orig_pos>sf->glyphcnt )
-return( false );
- if ( sf->glyphs[sc->orig_pos]!=sc )
-return( false );
- for ( test=sc->views; test!=NULL; test=test->next )
- if ( test==cv )
-return( true );
-
-return( false );
-}
-
-static void sv_fllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Recent:
- mi->ti.disabled = !RecentFilesAny();
- break;
- }
- }
-}
-
-static void sv_pllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- cv_pllistcheck(cv,mi,e);
-}
-
-static void sv_edlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- cv_edlistcheck(cv,mi,e,false);
-}
-
-static void sv_ptlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- cv_ptlistcheck(cv,mi,e);
-}
-
-static void sv_allistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- cv_allistcheck(cv,mi,e);
-}
-
-static void sv_ellistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- cv_ellistcheck(cv,mi,e,false);
-}
-
-static void sv_sllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- cv_sllistcheck(cv,mi,e);
-}
-
-static void sv_vwlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- cv_vwlistcheck(cv,mi,e);
-}
-
-static void SVMenuSave(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- _FVMenuSave(sv->fv);
-}
-
-static void SVMenuSaveAs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- _FVMenuSaveAs(sv->fv);
-}
-
-static void SVMenuGenerate(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- _FVMenuGenerate(sv->fv,false);
-}
-
-static void SVSelectAll(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- if ( CVSetSel(cv,-1))
- SCUpdateAll(cv->sc);
-}
-
-static void SVSelectNone(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- if ( CVClearSel(cv))
- SCUpdateAll(cv->sc);
-}
-
-static void SVMenuNextPrevPt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVNextPrevPt(cv,mi);
-}
-
-static void SVMenuNextPrevCPt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVNextPrevCPt(cv,mi);
-}
-
-static void SVUndo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVDoUndo(cv);
-}
-
-static void SVRedo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVDoRedo(cv);
-}
-
-static void SVCut(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVCut(cv);
-}
-
-static void SVCopy(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVCopy(cv);
-}
-
-static void SVPaste(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVPaste(cv);
-}
-
-static void SVClear(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
-
- if ( !CVAnySel(cv,NULL,NULL,NULL,NULL))
-return;
- CVDoClear(cv);
- CVCharChangedUpdate(cv);
-}
-
-static void SVMerge(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMerge(cv,false);
-}
-
-static void SVElide(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMerge(cv,true);
-}
-
-static void SVJoin(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVJoin(cv);
-}
-
-static void SVUnlinkRef(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVUnlinkRef(cv);
-}
-
-static void SVRemoveUndoes(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
-
- UndoesFree(sv->cv_srch.layerheads[sv->cv_srch.drawmode]->undoes);
- UndoesFree(sv->cv_srch.layerheads[sv->cv_srch.drawmode]->redoes);
- sv->cv_srch.layerheads[sv->cv_srch.drawmode]->undoes = sv->cv_srch.layerheads[sv->cv_srch.drawmode]->redoes = NULL;
-
- UndoesFree(sv->cv_rpl.layerheads[sv->cv_rpl.drawmode]->undoes);
- UndoesFree(sv->cv_rpl.layerheads[sv->cv_rpl.drawmode]->redoes);
- sv->cv_rpl.layerheads[sv->cv_rpl.drawmode]->undoes = sv->cv_rpl.layerheads[sv->cv_rpl.drawmode]->redoes = NULL;
-}
-
-static void SVMenuPointType(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMenuPointType(cv,mi);
-}
-
-static void SVMenuMakeFirst(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMenuMakeFirst(cv);
-}
-
-static void SVMenuConstrain(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVConstrainSelection(cv,mi->mid==MID_Average?0:
- mi->mid==MID_SpacePts?1:
- 2);
-}
-
-static void SVMenuMakeParallel(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVMakeParallel(cv);
-}
-
-static void SVMenuFontInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- DelayEvent(FontMenuFontInfo,sv->fv);
-}
-
-static void SVMenuGetInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- SplinePoint *sp; SplineSet *spl; RefChar *r; ImageList *im;
-
- if( !CVOneThingSel(cv,&sp,&spl,&r,&im,NULL))
-return;
- CVGetInfo(cv);
-}
-
-static void SVMenuTransform(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- int anysel = CVAnySel(cv,NULL,NULL,NULL,NULL);
- TransformDlgCreate(cv,transfunc,getorigin,!anysel && cv->drawmode==dm_fore,
- cvt_none);
-}
-
-static void SVMenuStroke(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVStroke(cv);
-}
-
-static void SVMenuOverlap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- int anysel;
-
- (void) CVAnySel(cv,&anysel,NULL,NULL,NULL);
- _CVMenuOverlap(cv,anysel ? over_rmselected: over_remove);
-}
-
-static void SVMenuSimplify(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- static struct simplifyinfo smpl = { sf_normal,.75,.05,0 };
- smpl.err = (cv->sc->parent->ascent+cv->sc->parent->descent)/1000.;
- smpl.linelenmax = (cv->sc->parent->ascent+cv->sc->parent->descent)/100.;
- CVPreserveState(cv);
- cv->layerheads[cv->drawmode]->splines = SplineCharSimplify(cv->sc,cv->layerheads[cv->drawmode]->splines,&smpl);
- CVCharChangedUpdate(cv);
-}
-
-static void SVMenuCleanupGlyph(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- static struct simplifyinfo smpl = { sf_cleanup };
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- CVPreserveState(cv);
- cv->layerheads[cv->drawmode]->splines = SplineCharSimplify(cv->sc,cv->layerheads[cv->drawmode]->splines,&smpl);
- CVCharChangedUpdate(cv);
-}
-
-static void SVMenuAddExtrema(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMenuAddExtrema(cv);
-}
-
-static void SVMenuRound2Int(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMenuRound2Int(cv,1.0);
-}
-
-static void SVMenuDir(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMenuDir(cv,mi);
-}
-
-static void SVMenuCorrectDir(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- int changed=false;
- CVPreserveState(cv);
- cv->layerheads[cv->drawmode]->splines = SplineSetsCorrect(cv->layerheads[cv->drawmode]->splines,&changed);
- if ( changed )
- CVCharChangedUpdate(cv);
-}
-
-static void SVMenuPaletteShow(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
-
- CVPaletteSetVisible(cv, mi->mid==MID_Tools, !CVPaletteIsVisible(cv, mi->mid==MID_Tools));
-}
-
-static void SVMenuScale(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
- _CVMenuScale(cv,mi);
-}
-
-static void SVMenuShowHide(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
-
- cv->showpoints = !cv->showpoints;
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void SVMenuMarkExtrema(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
-
- cv->markextrema = !cv->markextrema;
- GDrawRequestExpose(cv->v,NULL,false);
-}
-
-static void SVMenuShowHideRulers(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- SearchView *sv = (SearchView *) GDrawGetUserData(gw);
- CharView *cv = sv->cv_srch.inactive ? &sv->cv_rpl : &sv->cv_srch;
-
- if ( cv->showrulers == sv->cv_srch.showrulers )
- _CVMenuShowHideRulers(&sv->cv_srch);
- if ( cv->showrulers == sv->cv_rpl.showrulers )
- _CVMenuShowHideRulers(&sv->cv_rpl);
-}
-
-static GMenuItem2 sv_fllist[] = {
- { { (unichar_t *) N_("Font|_New"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("New|Ctl+N"), NULL, NULL, MenuNew },
- { { (unichar_t *) N_("_Open"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'O' }, H_("Open|Ctl+O"), NULL, NULL, MenuOpen },
- { { (unichar_t *) N_("Recen_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, NULL, dummyitem, MenuRecentBuild, NULL, MID_Recent },
- { { (unichar_t *) N_("_Close"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Close|Ctl+Shft+Q"), NULL, NULL, SVMenuClose },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Save"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Save|Ctl+S"), NULL, NULL, SVMenuSave },
- { { (unichar_t *) N_("S_ave as..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'a' }, H_("Save as...|Ctl+Shft+S"), NULL, NULL, SVMenuSaveAs },
- { { (unichar_t *) N_("_Generate Fonts..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'G' }, H_("Generate Fonts...|Ctl+Shft+G"), NULL, NULL, SVMenuGenerate },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Quit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'Q' }, H_("Quit|Ctl+Q"), NULL, NULL, MenuExit },
- { NULL }
-};
-
-static GMenuItem2 sv_sllist[] = {
- { { (unichar_t *) N_("Select _All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Select All|Ctl+A"), NULL, NULL, SVSelectAll, MID_SelAll },
- { { (unichar_t *) N_("_Deselect All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Deselect All|Escape"), NULL, NULL, SVSelectNone, MID_SelNone },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_First Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("First Point|Ctl+."), NULL, NULL, SVMenuNextPrevPt, MID_FirstPt },
- { { (unichar_t *) N_("First P_oint, Next Contour"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("First Point, Next Contour|Alt+Ctl+."), NULL, NULL, SVMenuNextPrevPt, MID_FirstPtNextCont },
- { { (unichar_t *) N_("_Next Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("Next Point|Ctl+Shft+}"), NULL, NULL, SVMenuNextPrevPt, MID_NextPt },
- { { (unichar_t *) N_("_Prev Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Prev Point|Ctl+Shft+{"), NULL, NULL, SVMenuNextPrevPt, MID_PrevPt },
- { { (unichar_t *) N_("Ne_xt Control Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'x' }, H_("Next Control Point|Ctl+;"), NULL, NULL, SVMenuNextPrevCPt, MID_NextCP },
- { { (unichar_t *) N_("P_rev Control Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Prev Control Point|Ctl+Shft+:"), NULL, NULL, SVMenuNextPrevCPt, MID_PrevCP },
- { NULL }
-};
-
-static GMenuItem2 sv_edlist[] = {
- { { (unichar_t *) N_("_Undo"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'U' }, H_("Undo|Ctl+Z"), NULL, NULL, SVUndo, MID_Undo },
- { { (unichar_t *) N_("_Redo"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Redo|Ctl+Y"), NULL, NULL, SVRedo, MID_Redo },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Cu_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, H_("Cut|Ctl+X"), NULL, NULL, SVCut, MID_Cut },
- { { (unichar_t *) N_("_Copy"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Copy|Ctl+C"), NULL, NULL, SVCopy, MID_Copy },
- { { (unichar_t *) N_("_Paste"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Paste|Ctl+V"), NULL, NULL, SVPaste, MID_Paste },
- { { (unichar_t *) N_("C_lear"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, H_("Clear|Delete"), NULL, NULL, SVClear, MID_Clear },
- { { (unichar_t *) N_("_Merge"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Merge|Ctl+M"), NULL, NULL, SVMerge, MID_Merge },
- { { (unichar_t *) N_("_Elide"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, H_("Elide|Alt+Ctl+M"), NULL, NULL, SVElide, MID_Elide },
- { { (unichar_t *) N_("_Join"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'J' }, H_("Join|Ctl+Shft+J"), NULL, NULL, SVJoin, MID_Join },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Select"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, NULL, sv_sllist, sv_sllistcheck },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("U_nlink Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'U' }, H_("Unlink Reference|Ctl+U"), NULL, NULL, SVUnlinkRef, MID_UnlinkRef },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Remo_ve Undoes"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'e' }, H_("Remove Undoes|No Shortcut"), NULL, NULL, SVRemoveUndoes, MID_RemoveUndoes },
- { NULL }
-};
-
-static GMenuItem2 sv_ptlist[] = {
- { { (unichar_t *) N_("_Curve"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'C' }, H_("Curve|Ctl+2"), NULL, NULL, SVMenuPointType, MID_Curve },
- { { (unichar_t *) N_("C_orner"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'o' }, H_("Corner|Ctl+3"), NULL, NULL, SVMenuPointType, MID_Corner },
- { { (unichar_t *) N_("_Tangent"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'T' }, H_("Tangent|Ctl+4"), NULL, NULL, SVMenuPointType, MID_Tangent },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Make First"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Make First|Ctl+1"), NULL, NULL, SVMenuMakeFirst, MID_MakeFirst },
- { NULL }
-};
-
-static GMenuItem2 sv_allist[] = {
-/* GT: Align these points to their average position */
- { { (unichar_t *) N_("_Average Points"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Average Points|Ctl+Shft+@"), NULL, NULL, SVMenuConstrain, MID_Average },
- { { (unichar_t *) N_("_Space Points"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Space Points|Ctl+Shft+#"), NULL, NULL, SVMenuConstrain, MID_SpacePts },
- { { (unichar_t *) N_("Space _Regions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Space Regions...|No Shortcut"), NULL, NULL, SVMenuConstrain, MID_SpaceRegion },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Make _Parallel..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Make Parallel...|No Shortcut"), NULL, NULL, SVMenuMakeParallel, MID_MakeParallel },
- { NULL }
-};
-
-static GMenuItem2 sv_ellist[] = {
- { { (unichar_t *) N_("_Font Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Font Info...|Ctl+Shft+F"), NULL, NULL, SVMenuFontInfo },
- { { (unichar_t *) N_("Get _Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Get Info...|Ctl+I"), NULL, NULL, SVMenuGetInfo, MID_GetInfo },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Transform..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Transform...|No Shortcut"), NULL, NULL, SVMenuTransform },
- { { (unichar_t *) N_("_Expand Stroke..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, H_("Expand Stroke...|Ctl+Shft+E"), NULL, NULL, SVMenuStroke, MID_Stroke },
- { { (unichar_t *) N_("_Remove Overlap"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'v' }, H_("Remove Overlap|Ctl+Shft+O"), NULL, NULL, SVMenuOverlap, MID_RmOverlap },
- { { (unichar_t *) N_("_Simplify"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Simplify|Ctl+Shft+M"), NULL, NULL, SVMenuSimplify, MID_Simplify },
- { { (unichar_t *) N_("Clea_nup Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Cleanup Glyph|No Shortcut"), NULL, NULL, SVMenuCleanupGlyph, MID_CleanupGlyph },
- { { (unichar_t *) N_("Add E_xtrema"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'x' }, H_("Add Extrema|Ctl+Shft+X"), NULL, NULL, SVMenuAddExtrema, MID_AddExtrema },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("A_lign"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, NULL, sv_allist, sv_allistcheck },
- { { (unichar_t *) N_("To _Int"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("To Int|Ctl+Shft+_"), NULL, NULL, SVMenuRound2Int, MID_Round },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Cl_ockwise"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'o' }, H_("Clockwise|No Shortcut"), NULL, NULL, SVMenuDir, MID_Clockwise },
- { { (unichar_t *) N_("Cou_nter Clockwise"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'n' }, H_("Counter Clockwise|No Shortcut"), NULL, NULL, SVMenuDir, MID_Counter },
- { { (unichar_t *) N_("_Correct Direction"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, H_("Correct Direction|Ctl+Shft+D"), NULL, NULL, SVMenuCorrectDir, MID_Correct },
- { NULL }
-};
-
-static GMenuItem2 sv_pllist[] = {
- { { (unichar_t *) N_("_Tools"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'T' }, H_("Tools|No Shortcut"), NULL, NULL, SVMenuPaletteShow, MID_Tools },
- { { (unichar_t *) N_("_Layers"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'L' }, H_("Layers|No Shortcut"), NULL, NULL, SVMenuPaletteShow, MID_Layers },
- { { (unichar_t *) N_("_Docked Palettes"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'D' }, H_("Docked Palettes|No Shortcut"), NULL, NULL, CVMenuPalettesDock, MID_DockPalettes },
- { NULL }
-};
-
-static GMenuItem2 sv_vwlist[] = {
- { { (unichar_t *) N_("_Fit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Fit|Ctl+F"), NULL, NULL, SVMenuScale, MID_Fit },
- { { (unichar_t *) N_("Z_oom out"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Zoom out|Alt+Ctl+-"), NULL, NULL, SVMenuScale, MID_ZoomOut },
- { { (unichar_t *) N_("Zoom _in"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'i' }, H_("Zoom in|Alt+Ctl+Shft++"), NULL, NULL, SVMenuScale, MID_ZoomIn },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Hide Poin_ts"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Hide Points|Ctl+D"), NULL, NULL, SVMenuShowHide, MID_HidePoints },
- { { (unichar_t *) N_("_Mark Extrema"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'M' }, H_("Mark Extrema|No Shortcut"), NULL, NULL, SVMenuMarkExtrema, MID_MarkExtrema },
- /*{ { (unichar_t *) N_("Fi_ll"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'l' }, '\0', 0, NULL, NULL, SVMenuFill, MID_Fill },*/
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, }},
- { { (unichar_t *) N_("_Palettes"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, NULL, sv_pllist, sv_pllistcheck },
- { { (unichar_t *) N_("Hide _Rulers"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Hide Rulers|No Shortcut"), NULL, NULL, SVMenuShowHideRulers, MID_HideRulers },
- { NULL }
-};
-
-static GMenuItem2 sv_mblist[] = {
- { { (unichar_t *) N_("_File"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, NULL, sv_fllist, sv_fllistcheck },
- { { (unichar_t *) N_("_Edit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, NULL, sv_edlist, sv_edlistcheck },
- { { (unichar_t *) N_("_Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, NULL, sv_ptlist, sv_ptlistcheck },
- { { (unichar_t *) N_("E_lement"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, NULL, sv_ellist, sv_ellistcheck },
- { { (unichar_t *) N_("_View"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, NULL, sv_vwlist, sv_vwlistcheck },
- { { (unichar_t *) N_("_Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, NULL, wnmenu, SVWindowMenuBuild },
- { { (unichar_t *) N_("_Help"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, NULL, helplist, NULL },
- { NULL }
-};
-
-static void CharViewInit(void) {
- int i;
- static int done = false;
-
- if ( done )
-return;
- done = true;
-
- mb2DoGetText(sv_mblist);
- mb2DoGetText(mblist);
- for ( i=0; mblist_nomm[i].ti.text!=NULL; ++i )
- mblist_nomm[i].ti.text = (unichar_t *) _((char *) mblist_nomm[i].ti.text);
-}
-
-static int sv_cv_e_h(GWindow gw, GEvent *event) {
- CharView *cv = (CharView *) GDrawGetUserData(gw);
-
- switch ( event->type ) {
- case et_expose:
- InfoExpose(cv,gw,event);
- CVLogoExpose(cv,gw,event);
- break;
- case et_char:
- SVChar(cv->searcher,event);
- break;
- case et_charup:
- CVCharUp(cv,event);
- break;
- case et_controlevent:
- switch ( event->u.control.subtype ) {
- case et_scrollbarchange:
- if ( event->u.control.g == cv->hsb )
- CVHScroll(cv,&event->u.control.u.sb);
- else
- CVVScroll(cv,&event->u.control.u.sb);
- break;
- }
- break;
- case et_map:
- if ( event->u.map.is_visible )
- CVPaletteActivate(cv);
- else
- CVPalettesHideIfMine(cv);
- break;
- case et_resize:
- if ( event->u.resize.sized )
- CVResize(cv);
- break;
- case et_destroy:
- if ( cv->backimgs!=NULL ) {
- GDrawDestroyWindow(cv->backimgs);
- cv->backimgs = NULL;
- }
- break;
- case et_mouseup: case et_mousedown:
- GGadgetEndPopup();
- CVPaletteActivate(cv);
- break;
- case et_mousemove:
- if ( event->u.mouse.y>cv->mbh ) {
- int enc = CVCurEnc(cv);
- SCPreparePopup(cv->gw,cv->sc,cv->fv->map->remap,enc,
- UniFromEnc(enc,cv->fv->map->enc));
- }
- break;
- }
-return( true );
-}
-
-void SVCharViewInits(SearchView *sv) {
- GGadgetData gd;
- GWindowAttrs wattrs;
- GRect pos, gsize;
-
- CharViewInit();
-
- sv->cv_srch.searcher = sv;
- sv->cv_rpl.inactive = true;
- sv->cv_rpl.searcher = sv;
-
- memset(&gd,0,sizeof(gd));
- gd.flags = gg_visible | gg_enabled;
- helplist[0].invoke = CVMenuContextualHelp;
- gd.u.menu2 = sv_mblist;
- sv->mb = GMenu2BarCreate( sv->gw, &gd, NULL);
- GGadgetGetSize(sv->mb,&gsize);
- sv->mbh = gsize.height;
-
- sv->dummy_fv.map = &sv->dummy_map;
- sv->dummy_map.map = sv->map;
- sv->dummy_map.backmap = sv->backmap;
- sv->dummy_map.enccount = sv->dummy_map.encmax = sv->dummy_map.backmax = 2;
- sv->dummy_map.enc = &custom;
-
- pos.y = sv->mbh+sv->fh+10; pos.height = 220;
- pos.width = pos.height; pos.x = 10+pos.width+20; /* Do replace first so palettes appear propperly */
- sv->rpl_x = pos.x; sv->cv_y = pos.y;
- sv->cv_height = pos.height; sv->cv_width = pos.width;
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor;
- wattrs.event_masks = -1;
- wattrs.cursor = ct_mypointer;
- sv->cv_rpl.gw = GWidgetCreateSubWindow(sv->gw,&pos,sv_cv_e_h,&sv->cv_rpl,&wattrs);
- _CharViewCreate(&sv->cv_rpl, &sv->sc_rpl, &sv->dummy_fv, 1);
-
- pos.x = 10;
- sv->cv_srch.gw = GWidgetCreateSubWindow(sv->gw,&pos,sv_cv_e_h,&sv->cv_srch,&wattrs);
- _CharViewCreate(&sv->cv_srch, &sv->sc_srch, &sv->dummy_fv, 0);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/contextchain.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/contextchain.c
deleted file mode 100644
index 3425b883a09..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/contextchain.c
+++ /dev/null
@@ -1,3032 +0,0 @@
-/* Copyright (C) 2003-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include <chardata.h>
-#include <utype.h>
-#include <ustring.h>
-#include <gkeysym.h>
-
-static void FPSTRuleContentsFree(struct fpst_rule *r, enum fpossub_format format) {
- int j;
-
- switch ( format ) {
- case pst_glyphs:
- free(r->u.glyph.names);
- free(r->u.glyph.back);
- free(r->u.glyph.fore);
- break;
- case pst_class:
- free(r->u.class.nclasses);
- free(r->u.class.bclasses);
- free(r->u.class.fclasses);
- break;
- case pst_reversecoverage:
- free(r->u.rcoverage.replacements);
- case pst_coverage:
- for ( j=0 ; j<r->u.coverage.ncnt ; ++j )
- free(r->u.coverage.ncovers[j]);
- free(r->u.coverage.ncovers);
- for ( j=0 ; j<r->u.coverage.bcnt ; ++j )
- free(r->u.coverage.bcovers[j]);
- free(r->u.coverage.bcovers);
- for ( j=0 ; j<r->u.coverage.fcnt ; ++j )
- free(r->u.coverage.fcovers[j]);
- free(r->u.coverage.fcovers);
- break;
- case pst_formatmax:
- break;
- }
- free(r->lookups);
-}
-
-#ifndef LUA_FF_LIB
-static void FPSTRulesFree(struct fpst_rule *r, enum fpossub_format format, int rcnt) {
- int i;
- for ( i=0; i<rcnt; ++i )
- FPSTRuleContentsFree(&r[i],format);
- free(r);
-}
-#endif
-
-static struct fpst_rule *RulesCopy(struct fpst_rule *from, int cnt,
- enum fpossub_format format ) {
- int i, j;
- struct fpst_rule *to, *f, *t;
- if ( cnt==0 )
-return( NULL );
-
- t = NULL;
- to = gcalloc(cnt,sizeof(struct fpst_rule));
- for ( i=0; i<cnt; ++i ) {
- f = from+i; t = to+i;
- switch ( format ) {
- case pst_glyphs:
- t->u.glyph.names = copy(f->u.glyph.names);
- t->u.glyph.back = copy(f->u.glyph.back);
- t->u.glyph.fore = copy(f->u.glyph.fore);
- break;
- case pst_class:
- t->u.class.ncnt = f->u.class.ncnt;
- t->u.class.bcnt = f->u.class.bcnt;
- t->u.class.fcnt = f->u.class.fcnt;
- t->u.class.nclasses = galloc( f->u.class.ncnt*sizeof(uint16));
- memcpy(t->u.class.nclasses,f->u.class.nclasses,
- f->u.class.ncnt*sizeof(uint16));
- if ( t->u.class.bcnt!=0 ) {
- t->u.class.bclasses = galloc( f->u.class.bcnt*sizeof(uint16));
- memcpy(t->u.class.bclasses,f->u.class.bclasses,
- f->u.class.bcnt*sizeof(uint16));
- }
- if ( t->u.class.fcnt!=0 ) {
- t->u.class.fclasses = galloc( f->u.class.fcnt*sizeof(uint16));
- memcpy(t->u.class.fclasses,f->u.class.fclasses,
- f->u.class.fcnt*sizeof(uint16));
- }
- break;
- case pst_reversecoverage:
- t->u.rcoverage.replacements = copy(f->u.rcoverage.replacements);
- case pst_coverage:
- t->u.coverage.ncnt = f->u.coverage.ncnt;
- t->u.coverage.bcnt = f->u.coverage.bcnt;
- t->u.coverage.fcnt = f->u.coverage.fcnt;
- t->u.coverage.ncovers = galloc( f->u.coverage.ncnt*sizeof(char *));
- for ( j=0; j<t->u.coverage.ncnt; ++j )
- t->u.coverage.ncovers[j] = copy(f->u.coverage.ncovers[j]);
- if ( t->u.coverage.bcnt!=0 ) {
- t->u.coverage.bcovers = galloc( f->u.coverage.bcnt*sizeof(char *));
- for ( j=0; j<t->u.coverage.bcnt; ++j )
- t->u.coverage.bcovers[j] = copy(f->u.coverage.bcovers[j]);
- }
- if ( t->u.coverage.fcnt!=0 ) {
- t->u.coverage.fcovers = galloc( f->u.coverage.fcnt*sizeof(char *));
- for ( j=0; j<t->u.coverage.fcnt; ++j )
- t->u.coverage.fcovers[j] = copy(f->u.coverage.fcovers[j]);
- }
- break;
- case pst_formatmax:
- break;
- }
- if ( f->lookup_cnt!=0 ) {
- t->lookup_cnt = f->lookup_cnt;
- t->lookups = galloc(t->lookup_cnt*sizeof(struct seqlookup));
- memcpy(t->lookups,f->lookups,t->lookup_cnt*sizeof(struct seqlookup));
- }
- }
-return( t );
-}
-
-FPST *FPSTCopy(FPST *fpst) {
- FPST *nfpst;
- int i;
-
- nfpst = chunkalloc(sizeof(FPST));
- *nfpst = *fpst;
- nfpst->next = NULL;
- if ( nfpst->nccnt!=0 ) {
- nfpst->nclass = galloc(nfpst->nccnt*sizeof(char *));
- for ( i=0; i<nfpst->nccnt; ++i )
- nfpst->nclass[i] = copy(fpst->nclass[i]);
- }
- if ( nfpst->bccnt!=0 ) {
- nfpst->bclass = galloc(nfpst->bccnt*sizeof(char *));
- for ( i=0; i<nfpst->bccnt; ++i )
- nfpst->bclass[i] = copy(fpst->bclass[i]);
- }
- if ( nfpst->fccnt!=0 ) {
- nfpst->fclass = galloc(nfpst->fccnt*sizeof(char *));
- for ( i=0; i<nfpst->fccnt; ++i )
- nfpst->fclass[i] = copy(fpst->fclass[i]);
- }
- nfpst->rules = RulesCopy(fpst->rules,fpst->rule_cnt,fpst->format);
-return( nfpst );
-}
-
-void FPSTFree(FPST *fpst) {
- FPST *next;
- int i;
-
- while ( fpst!=NULL ) {
- next = fpst->next;
- for ( i=0; i<fpst->nccnt; ++i )
- free(fpst->nclass[i]);
- for ( i=0; i<fpst->bccnt; ++i )
- free(fpst->bclass[i]);
- for ( i=0; i<fpst->fccnt; ++i )
- free(fpst->fclass[i]);
- free(fpst->nclass); free(fpst->bclass); free(fpst->fclass);
- for ( i=0; i<fpst->rule_cnt; ++i ) {
- FPSTRuleContentsFree( &fpst->rules[i],fpst->format );
- }
- free(fpst->rules);
- chunkfree(fpst,sizeof(FPST));
- fpst = next;
- }
-}
-
-int ClassesMatch(int cnt1,char **classes1,int cnt2,char **classes2) {
- int i;
-
- if ( cnt1!=cnt2 )
-return( false );
- for ( i=1; i<cnt2; ++i )
- if ( strcmp(classes1[i],classes2[i])!=0 )
-return( false );
-
-return( true );
-}
-
-static char **classcopy(char **names,int nextclass) {
- char **ret;
- int i;
-
- if ( nextclass <= 1 )
-return( NULL );
-
- ret = galloc(nextclass*sizeof(char *));
- ret[0] = NULL;
- for ( i=1; i<nextclass; ++i )
- ret[i] = copy(names[i]);
-return( ret );
-}
-
-FPST *FPSTGlyphToClass(FPST *fpst) {
- FPST *new;
- int nextclass=0, i,j,k, max, cnt, ch;
- char *pt, *end;
- char **names;
-
- if ( fpst->format!=pst_glyphs )
-return( NULL );
-
- new = chunkalloc(sizeof(FPST));
- new->type = fpst->type;
- new->format = pst_class;
- new->subtable = fpst->subtable;
- new->rule_cnt = fpst->rule_cnt;
- new->rules = gcalloc(fpst->rule_cnt,sizeof(struct fpst_rule));
-
- max = 100; nextclass=1;
- names = galloc(max*sizeof(char *));
- names[0] = NULL;
- for ( i=0; i<fpst->rule_cnt; ++i ) {
- for ( j=0; j<3; ++j ) {
- cnt = 0;
- if ( (&fpst->rules[i].u.glyph.names)[j]!=NULL && *(&fpst->rules[i].u.glyph.names)[j]!='\0' ) {
- cnt = 1;
- for ( pt=(&fpst->rules[i].u.glyph.names)[j]; *pt; ++pt ) {
- if ( *pt==' ' ) {
- ++cnt;
- while ( *pt==' ' ) ++pt;
- --pt;
- }
- }
- }
- (&new->rules[i].u.class.ncnt)[j] = cnt;
- if ( cnt!=0 ) {
- (&new->rules[i].u.class.nclasses)[j] = galloc(cnt*sizeof(uint16));
- cnt = 0;
- for ( pt=(&fpst->rules[i].u.glyph.names)[j]; *pt; pt=end ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- for ( end=pt ; *end!=' ' && *end!='\0'; ++end );
- ch = *end; *end='\0';
- for ( k=1; k<nextclass; ++k )
- if ( strcmp(pt,names[k])==0 )
- break;
- if ( k==nextclass ) {
- if ( nextclass>=max )
- names = grealloc(names,(max+=100)*sizeof(char *));
- names[nextclass++] = copy(pt);
- }
- *end = ch;
- (&new->rules[i].u.class.nclasses)[j][cnt++] = k;
- }
- }
- }
- new->rules[i].lookup_cnt = fpst->rules[i].lookup_cnt;
- new->rules[i].lookups = galloc(fpst->rules[i].lookup_cnt*sizeof(struct seqlookup));
- memcpy(new->rules[i].lookups,fpst->rules[i].lookups,
- fpst->rules[i].lookup_cnt*sizeof(struct seqlookup));
- }
- new->nccnt = nextclass;
- new->nclass = names;
- if ( fpst->type==pst_chainpos || fpst->type==pst_chainsub ) {
- /* our class set has one "class" for each glyph used anywhere */
- /* all three class sets are the same */
- new->bccnt = new->fccnt = nextclass;
- new->bclass = classcopy(names,nextclass);
- new->fclass = classcopy(names,nextclass);
- }
-return( new );
-}
-
-/* ************************************************************************** */
-/* ************************ Context/Chaining Dialog ************************* */
-/* ************************************************************************** */
-struct contextchaindlg {
- struct gfi_data *gfi;
- SplineFont *sf;
- FPST *fpst;
- unichar_t *newname;
- int isnew;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- GWindow gw;
- GWindow formats, coverage, glist, glyphs, cselect, class, classbuild, classnumber;
- enum activewindow { aw_formats, aw_coverage, aw_glist, aw_glyphs, aw_cselect,
- aw_class, aw_classbuild, aw_classnumber } aw;
-#endif
- uint16 wasedit;
- uint16 wasoffset;
- uint8 foredefault;
- int subheightdiff, canceldrop;
-};
-
-#define CID_OK 100
-#define CID_Cancel 101
-#define CID_Next 102
-#define CID_Prev 103
-#define CID_Group 104
-
-#define CID_ByGlyph 200
-#define CID_ByClass 201
-#define CID_ByCoverage 202
-
-/* There are more CIDs used in this file than those listed here */
-/* The CIDs given here are for glyph lists (aw_glyphs & aw_glist) */
-/* similar controls refering to coverage tables have 100 added to them */
-/* The CIDs here are also for the "match" aspect of the tabsets */
-/* those in backtrack get 20 added, those in lookahead get 40 */
-#define CID_New 300
-#define CID_Edit 301
-#define CID_Delete 302
-#define CID_Up 303
-#define CID_Down 304
-#define CID_GList 305
-
-#define CID_MatchType 1003
-#define CID_Set 1004
-#define CID_Select 1005
-#define CID_GlyphList 1006
-#define CID_Set2 1007
-#define CID_Select2 1008
-#define CID_RplList 1009
-#define CID_LookupList 1010
-#define CID_LNew 1011
-#define CID_LEdit 1012
-#define CID_LDelete 1013
-#define CID_LUp 1014
-#define CID_LDown 1015
-
-#define CID_StdClasses 1016
-
-#define CID_ClassNumbers 2000
-#define CID_ClassList 2001
-#define CID_ClassType 2002
-#define CID_SameAsClasses 2003
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-GTextInfo stdclasses[] = {
- { (unichar_t *) N_("None"), NULL, 0, 0, "None", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("0-9"), NULL, 0, 0, "0-9", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Letters in Script(s)"), NULL, 0, 0, "Letters", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lower Case"), NULL, 0, 0, "LC", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Upper Case"), NULL, 0, 0, "UC", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Glyphs in Script(s)"), NULL, 0, 0, "Glyphs", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Added"), NULL, 0, 0, "None", NULL, 1, 0, 0, 0, 0, 0, 1},
- { NULL }
-};
-
-#endif
-
-char *cu_copybetween(const unichar_t *start, const unichar_t *end) {
- char *ret = galloc(end-start+1);
- cu_strncpy(ret,start,end-start);
- ret[end-start] = '\0';
-return( ret );
-}
-
-#ifndef LUA_FF_LIB
-static char *ccd_cu_copy(const unichar_t *start) {
- char *ret, *pt;
-
- while ( isspace(*start)) ++start;
- if ( *start=='\0' )
-return( NULL );
- ret = pt = galloc(u_strlen(start)+1);
- while ( *start ) {
- while ( !isspace(*start) && *start!='\0' )
- *pt++ = *start++;
- while ( isspace(*start)) ++start;
- if ( *start!='\0' ) *pt++ = ' ';
- }
- *pt = '\0';
-return( ret );
-}
-
-static char *reversenames(char *str) {
- char *ret;
- char *rpt, *pt, *start, *spt;
-
- if ( str==NULL )
-return( NULL );
-
- rpt = ret = galloc(strlen(str)+1);
- *ret = '\0';
- for ( pt=str+strlen(str); pt>str; pt=start ) {
- for ( start = pt-1; start>=str && *start!=' '; --start );
- for ( spt=start+1; spt<pt; )
- *rpt++ = *spt++;
- *rpt++ = ' ';
- }
- if ( rpt>ret )
- rpt[-1] = '\0';
-return( ret );
-}
-
-static unichar_t *classnumbers(int cnt,uint16 *classes) {
- char buf[20];
- int i, len;
- unichar_t *pt, *ret;
-
- len = 0;
- for ( i=0; i<cnt; ++i ) {
- sprintf( buf, "%d ", classes[i]);
- len += strlen(buf);
- }
- ret = pt = galloc((len+3)*sizeof(unichar_t));
- *pt = '\0'; /* In case it is empty */
-
- for ( i=0; i<cnt; ++i ) {
- sprintf( buf, "%d ", classes[i]);
- uc_strcpy(pt,buf);
- pt += strlen(buf);
- }
-return( ret );
-}
-
-static unichar_t *rclassnumbers(int cnt,uint16 *classes) {
- char buf[20];
- int i, len;
- unichar_t *pt, *ret;
-
- len = 0;
- for ( i=0; i<cnt; ++i ) {
- sprintf( buf, "%d ", classes[i]);
- len += strlen(buf);
- }
- ret = pt = galloc((len+3)*sizeof(unichar_t));
- *pt = '\0';
- for ( i=cnt-1; i>=0; --i ) {
- sprintf( buf, "%d ", classes[i]);
- uc_strcpy(pt,buf);
- pt += strlen(buf);
- }
-return( ret );
-}
-
-static int CCD_GlyphNameCnt(const unichar_t *pt) {
- int cnt = 0;
-
- while ( *pt ) {
- while ( isspace( *pt )) ++pt;
- if ( *pt=='\0' )
-return( cnt );
- ++cnt;
- while ( !isspace(*pt) && *pt!='\0' ) ++pt;
- }
-return( cnt );
-}
-
-static int seqlookuplen(struct fpst_rule *r) {
- int i, len=0;
- char buf[20];
-
- for ( i=0; i<r->lookup_cnt; ++i ) {
- sprintf( buf," %d \"\",", r->lookups[i].seq );
- len += strlen(buf) + utf8_strlen( r->lookups[i].lookup->lookup_name );
- }
-return( len );
-}
-
-static unichar_t *addseqlookups(unichar_t *pt, struct fpst_rule *r) {
- int i;
- char buf[20];
-
- *pt++ = 0x21d2;
- for ( i=0; i<r->lookup_cnt; ++i ) {
- unichar_t *temp;
- sprintf( buf," %d \"", r->lookups[i].seq );
- uc_strcpy(pt, buf);
- pt += u_strlen(pt);
- temp = utf82u_copy(r->lookups[i].lookup->lookup_name );
- u_strcpy(pt,temp);
- pt += u_strlen(pt);
- *pt++ = '"';
- *pt++ = ',';
- }
- if ( pt[-1]==',' ) pt[-1] = '\0';
- *pt = '\0';
-return( pt );
-}
-
-static void parseseqlookups(SplineFont *sf, const unichar_t *solooks, struct fpst_rule *r) {
- int cnt;
- const unichar_t *pt;
-
- for ( pt = solooks, cnt=0; *pt!='\0'; ) {
- ++cnt;
- while ( *pt!='"' && *pt!='\0' ) ++pt;
- if ( *pt=='"' ) {
- ++pt;
- while ( *pt!='"' && *pt!='\0' ) ++pt;
- if ( *pt=='"' ) ++pt;
- }
- if ( *pt==',' ) ++pt;
- }
- r->lookup_cnt = cnt;
- r->lookups = gcalloc(cnt,sizeof(struct seqlookup));
- cnt = 0;
- pt = solooks;
- forever {
- unichar_t *end;
- r->lookups[cnt].seq = u_strtol(pt,&end,10);
- pt = end+1;
- if ( *pt=='"' ) {
- const unichar_t *eoname; char *temp;
- ++pt;
- for ( eoname = pt; *eoname!='\0' && *eoname!='"'; ++eoname );
- temp = u2utf8_copyn(pt,eoname-pt);
- r->lookups[cnt].lookup = SFFindLookup(sf,temp);
- if ( r->lookups[cnt].lookup==NULL )
- IError("No lookup in parseseqlookups");
- free(temp);
- pt = eoname;
- if ( *pt=='"' ) ++pt;
- }
- ++cnt;
- if ( *pt!=',' )
- break;
- ++pt;
- }
-}
-
-static unichar_t *glistitem(struct fpst_rule *r) {
- unichar_t *ret, *pt;
- int len;
-
- len = (r->u.glyph.back==NULL ? 0 : strlen(r->u.glyph.back)) +
- strlen(r->u.glyph.names) +
- (r->u.glyph.fore==0 ? 0 : strlen(r->u.glyph.fore)) +
- seqlookuplen(r);
-
- ret = pt = galloc((len+8) * sizeof(unichar_t));
- if ( r->u.glyph.back!=NULL && *r->u.glyph.back!='\0' ) {
- char *temp = reversenames(r->u.glyph.back);
- uc_strcpy(pt,temp);
- pt += strlen(temp);
- free(temp);
- *pt++ = ' ';
- }
- *pt++ = '[';
- *pt++ = ' ';
- uc_strcpy(pt,r->u.glyph.names);
- pt += strlen(r->u.glyph.names);
- *pt++ = ' ';
- *pt++ = ']';
- *pt++ = ' ';
- if ( r->u.glyph.fore!=NULL && *r->u.glyph.fore!='\0' ) {
- uc_strcpy(pt,r->u.glyph.fore);
- pt += strlen(r->u.glyph.fore);
- *pt++ = ' ';
- }
- pt = addseqlookups(pt, r);
-return( ret );
-}
-
-static void glistitem2rule(SplineFont *sf, const unichar_t *ret,struct fpst_rule *r) {
- const unichar_t *pt;
- char *temp;
-
- for ( pt=ret; *pt!='\0' && *pt!='['; ++pt );
- if ( *pt=='\0' )
-return;
- if ( pt>ret ) {
- temp = cu_copybetween(ret,pt-1);
- r->u.glyph.back = reversenames(temp);
- free(temp);
- }
- ret = pt+2;
- for ( pt=ret; *pt!='\0' && *pt!=']'; ++pt );
- if ( *pt=='\0' )
-return;
- r->u.glyph.names = cu_copybetween(ret,pt-1);
- ret = pt+2;
- for ( pt=ret; *pt!='\0' && *pt!=0x21d2; ++pt );
- if ( *pt=='\0' )
-return;
- if ( pt!=ret )
- r->u.glyph.fore = cu_copybetween(ret,pt-1);
- parseseqlookups(sf,pt+2,r);
-}
-
-
-static GTextInfo **glistlist(FPST *fpst) {
- GTextInfo **ti;
- int i;
-
- if ( fpst->format!=pst_glyphs || fpst->rule_cnt==0 )
-return(NULL);
- ti = galloc((fpst->rule_cnt+1)*sizeof(GTextInfo *));
- ti[fpst->rule_cnt] = gcalloc(1,sizeof(GTextInfo));
- for ( i=0; i<fpst->rule_cnt; ++i ) {
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- ti[i]->text = glistitem(&fpst->rules[i]);
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- }
-return( ti );
-}
-
-
-static unichar_t *clslistitem(struct fpst_rule *r) {
- unichar_t *ret, *pt;
- int len, i, k;
- char buf[20];
-
- len = 0;
- for ( i=0; i<3; ++i ) {
- for ( k=0; k<(&r->u.class.ncnt)[i]; ++k ) {
- sprintf( buf, "%d ", (&r->u.class.nclasses)[i][k]);
- len += strlen(buf);
- }
- }
-
- ret = pt = galloc((len+8+seqlookuplen(r)) * sizeof(unichar_t));
- for ( k=r->u.class.bcnt-1; k>=0; --k ) {
- sprintf( buf, "%d ", r->u.class.bclasses[k]);
- uc_strcpy(pt,buf);
- pt += strlen(buf);
- }
- *pt++ = '[';
- for ( k=0; k<r->u.class.ncnt; ++k ) {
- sprintf( buf, "%d ", r->u.class.nclasses[k]);
- uc_strcpy(pt,buf);
- pt += strlen(buf);
- }
- if ( pt[-1]==' ' ) --pt;
- *pt++ = ']';
- for ( k=0; k<r->u.class.fcnt; ++k ) {
- sprintf( buf, " %d", r->u.class.fclasses[k]);
- uc_strcpy(pt,buf);
- pt += strlen(buf);
- }
-
- *pt++ = ' ';
- pt = addseqlookups(pt, r);
-return( ret );
-}
-
-static void clslistitem2rule(SplineFont *sf,const unichar_t *ret,struct fpst_rule *r) {
- const unichar_t *pt; unichar_t *end;
- int len, i;
-
- memset(r,0,sizeof(*r));
-
- len = 0; i=1;
- for ( pt=ret; *pt; ++pt ) {
- while ( *pt!='[' && *pt!=']' && *pt!=0x21d2 && *pt!='\0' ) {
- if ( isdigit( *pt )) {
- ++len;
- while ( isdigit(*pt)) ++pt;
- } else if ( *pt!=' ' && *pt!='[' && *pt!=']' && *pt!=0x21d2 && *pt!='\0' )
- ++pt;
- while ( *pt==' ' ) ++pt;
- }
- (&r->u.class.ncnt)[i] = len;
- (&r->u.class.nclasses)[i] = galloc(len*sizeof(uint16));
- len = 0;
- if ( *pt=='\0' || *pt==0x21d2 )
- break;
- if ( *pt=='[' ) i=0;
- else i=2;
- }
- len = 0; i=1;
- for ( pt=ret; *pt; ++pt ) {
- while ( *pt!='[' && *pt!=']' && *pt!=0x21d2 && *pt!='\0' ) {
- if ( isdigit( *pt )) {
- if ( len>=(&r->u.class.ncnt)[i] )
- IError( "clslistitem2rule bad memory");
- (&r->u.class.nclasses)[i][len++] = u_strtol(pt,&end,10);
- pt = end;
- } else if ( *pt!=' ' && *pt!='[' && *pt!=']' && *pt!=0x21d2 && *pt!='\0' )
- ++pt;
- while ( *pt==' ' ) ++pt;
- }
- len = 0;
- if ( *pt=='[' ) i=0;
- else i=2;
- if ( *pt=='\0' || *pt==0x21d2 )
- break;
- }
- /* reverse the backtrack */
- for ( i=0; i<r->u.class.bcnt/2; ++i ) {
- int temp = r->u.class.bclasses[i];
- r->u.class.bclasses[i] = r->u.class.bclasses[r->u.class.bcnt-1-i];
- r->u.class.bclasses[r->u.class.bcnt-1-i] = temp;
- }
-
- if ( *pt=='\0' || pt[1]=='\0' )
-return;
- parseseqlookups(sf,pt+2,r);
-}
-
-static GTextInfo **clslistlist(FPST *fpst) {
- GTextInfo **ti;
- int i;
-
- if ( fpst->format!=pst_class || fpst->rule_cnt==0 )
-return(NULL);
- ti = galloc((fpst->rule_cnt+1)*sizeof(GTextInfo *));
- ti[fpst->rule_cnt] = gcalloc(1,sizeof(GTextInfo));
- for ( i=0; i<fpst->rule_cnt; ++i ) {
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- ti[i]->text = clslistitem(&fpst->rules[i]);
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- }
-return( ti );
-}
-
-static GTextInfo **clistlist(FPST *fpst,int which) {
- GTextInfo **ti;
- int cnt, i;
-
- if ( (fpst->format!=pst_coverage && fpst->format!=pst_reversecoverage) ||
- fpst->rule_cnt!=1 )
-return(NULL);
- cnt = (&fpst->rules[0].u.coverage.ncnt)[which];
- if ( cnt == 0 )
-return( NULL );
- ti = galloc((cnt+1)*sizeof(GTextInfo *));
- ti[cnt] = gcalloc(1,sizeof(GTextInfo));
- if ( which != 1 ) {
- for ( i=0; i<cnt; ++i ) {
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- ti[i]->text = uc_copy((&fpst->rules[0].u.coverage.ncovers)[which][i]);
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- }
- } else {
- for ( i=0; i<cnt; ++i ) {
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- ti[i]->text = uc_copy(fpst->rules[0].u.coverage.bcovers[cnt-i-1]);
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- }
- }
-return( ti );
-}
-
-static GTextInfo **slistlist(struct fpst_rule *r) {
- GTextInfo **ti;
- char buf[20];
- int i;
-
- if ( r->lookup_cnt==0 )
-return(NULL);
- ti = galloc((r->lookup_cnt+1)*sizeof(GTextInfo *));
- ti[r->lookup_cnt] = gcalloc(1,sizeof(GTextInfo));
- for ( i=0; i<r->lookup_cnt; ++i ) {
- unichar_t *space;
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- sprintf( buf,"%d ", r->lookups[i].seq );
- ti[i]->text = space = galloc((strlen(buf)+utf8_strlen(r->lookups[i].lookup->lookup_name)+2)*sizeof(unichar_t));
- uc_strcpy(space,buf);
- utf82u_strcat(space,r->lookups[i].lookup->lookup_name);
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- }
-return( ti );
-}
-
-
-static void CCD_ParseLookupList(SplineFont *sf, struct fpst_rule *r,GGadget *list) {
- int32 len, i;
- GTextInfo **ti = GGadgetGetList(list,&len);
- unichar_t *end;
- char *name;
-
- r->lookup_cnt = len;
- r->lookups = galloc(len*sizeof(struct seqlookup));
- for ( i=0; i<len; ++i ) {
- r->lookups[i].seq = u_strtol(ti[i]->text,&end,10);
- while ( *end==' ') ++end;
- if ( *end=='"' ) ++end;
- name = u2utf8_copy(end);
- if ( name[strlen(name)-1] == '"' )
- name[strlen(name)-1] = '\0';
- r->lookups[i].lookup = SFFindLookup(sf,name);
- if ( r->lookups[i].lookup==NULL )
- IError("Failed to find lookup in CCD_ParseLookupList");
- free(name);
- }
-}
-
-
-static void CCD_EnableNextPrev(struct contextchaindlg *ccd) {
- /* Cancel is always enabled */
- switch ( ccd->aw ) {
- case aw_formats:
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Prev),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Next),true);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_OK),false);
- break;
- case aw_glyphs:
- case aw_classbuild:
- case aw_classnumber:
- case aw_cselect:
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Prev),true);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Next),true);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_OK),false);
- break;
- case aw_coverage:
- case aw_glist:
- case aw_class:
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Prev),ccd->fpst->format!=pst_reversecoverage);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Next),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_OK),true);
- break;
- default:
- IError("Can't get here");
- break;
- }
-}
-
-static int CCD_ValidNameList(const char *ret,int empty_bad) {
- int first;
- extern int allow_utf8_glyphnames;
-
- while ( isspace(*ret)) ++ret;
- if ( *ret=='\0' )
-return( !empty_bad );
-
- first = true;
- while ( *ret ) {
- if ( (*(unsigned char *) ret>=0x7f && !allow_utf8_glyphnames) || *ret<' ' )
-return( false );
- if ( first && isdigit(*ret) )
-return( false );
- first = isspace(*ret);
- if ( *ret=='(' || *ret=='[' || *ret=='{' || *ret=='<' ||
- *ret==')' || *ret==']' || *ret=='}' || *ret=='>' ||
- *ret=='%' || *ret=='/' )
-return( false );
- ++ret;
- }
-return( true );
-}
-
-static char *CCD_NonExistantName(SplineFont *sf,const char *ret) {
- const char *pt, *end; char *name;
-
- for ( pt = ret; *pt; pt = end ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- end = strchr(pt,' ');
- if ( end==NULL ) end = pt+strlen(pt);
- name = copyn(pt,end-pt);
- if ( SFGetChar(sf,-1,name)==NULL )
-return( name );
- free(name);
- }
-return( NULL );
-}
-
-int CCD_NameListCheck(SplineFont *sf,const char *ret,int empty_bad,char *title) {
- char *missingname;
- int ans;
-
- if ( !CCD_ValidNameList(ret,empty_bad) ) {
- gwwv_post_error(title,
- strcmp(title,_("Bad Class"))==0? _("A class must contain at least one glyph name, glyph names must be valid postscript names, and no glyphs may appear in any other class") :
- strcmp(title,_("Bad Coverage"))==0? _("A coverage table must contain at least one glyph name, and glyph names must be valid postscript names") :
- _("A glyph list must contain at least one glyph name, and glyph names must be valid postscript names") );
-return(false);
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( (missingname=CCD_NonExistantName(sf,ret))!=NULL ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes"); buts[1] = _("_No"); buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_NO, NULL };
-#endif
- ans = gwwv_ask(title,(const char **) buts,0,1,
- strcmp(title,_("Bad Class"))==0? _("The class member \"%.20s\" is not in this font.\nIs that what you want?") :
- strcmp(title,_("Bad Coverage"))==0? _("The coverage table member \"%.20s\" is not in this font.\nIs that what you want?") :
- _("There is no glyph named \"%.20hs\" in this font.\nIs that what you want?"), missingname );
- free(missingname);
-return(!ans);
- }
-#endif
-return( true );
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-int CCD_InvalidClassList(char *ret,GGadget *list,int wasedit) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- char *pt, *end; unichar_t *tpt, *tend;
- int i;
-
- for ( pt = ret; *pt; pt = end ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- end = strchr(pt,' ');
- if ( end==NULL ) end = pt+strlen(pt);
- for ( i=0; i<len; ++i ) {
- if ( wasedit && ti[i]->selected )
- continue;
- for ( tpt=ti[i]->text; *tpt; tpt = tend ) {
- while ( *tpt==' ' ) ++tpt;
- tend = u_strchr(tpt,' ');
- if ( tend==NULL ) tend = tpt+u_strlen(tpt);
- /* We've already checked for ASCII, so ucs2 & utf8 should */
- /* have the same length for an ASCII string */
- if ( tend-tpt==end-pt && uc_strncmp(tpt,pt,end-pt)==0 ) {
- char *dupname = copyn(pt,end-pt);
- gwwv_post_error(_("Bad Class"),_("No glyphs from another class may appear here, but %.30s does"), dupname);
- free(dupname);
-return( true );
- }
- }
- }
- }
-return( false );
-}
-
-static int CCD_ReasonableClassNum(const unichar_t *match,GGadget *mlist,
- const unichar_t *back, GGadget *blist,
- const unichar_t *fore, GGadget *flist,
- struct fpst_rule *r ) {
- int32 mlen, blen, flen;
- GTextInfo **ti;
- const unichar_t *pt; unichar_t *end;
- int any;
- int val;
-
- ti = GGadgetGetList(mlist,&mlen);
- ti = GGadgetGetList(blist,&blen);
- ti = GGadgetGetList(flist,&flen);
-
- any = 0;
- for ( pt=match;; pt = end) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- if ( isdigit( *pt )) ++any;
- val = u_strtol(pt,&end,10);
- if ( *end!=' ' && *end!='\0' ) {
- gwwv_post_error(_("Bad Match Class Number"),_("The list of class numbers should only contain digits and spaces"));
-return( false );
- }
- if ( val>=mlen || val<0) {
- gwwv_post_error(_("Bad Match Class Number"),_("There are only %d classes in this class set, yet you are trying to use %d."),mlen,val);
-return( false );
- }
- }
- r->u.class.ncnt = any;
- if ( any==0 ) {
- gwwv_post_error(_("Bad Match Class Number"),_("There are no class numbers listed to be matched. There must be at least one."));
-return( false );
- }
-
- any = 0;
- for ( pt=back;; pt = end) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- if ( isdigit( *pt )) ++any;
- val = u_strtol(pt,&end,10);
- if ( *end!=' ' && *end!='\0' ) {
- gwwv_post_error(_("Bad Backtrack Class Number"),_("The list of class numbers should only contain digits and spaces"));
-return( false );
- }
- if ( val>=blen || val<0) {
- gwwv_post_error(_("Bad Backtrack Class Number"),_("There are only %d classes in this class set, yet you are trying to use %d."),blen,val);
-return( false );
- }
- }
- r->u.class.bcnt = any;
-
- any = 0;
- for ( pt=fore;; pt = end) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- if ( isdigit( *pt )) ++any;
- val = u_strtol(pt,&end,10);
- if ( *end!=' ' && *end!='\0' ) {
- gwwv_post_error(_("Bad Lookahead Class Number"),_("The list of class numbers should only contain digits and spaces"));
-return( false );
- }
- if ( val>=flen || val<0) {
- gwwv_post_error(_("Bad Lookahead Class Number"),_("There are only %d classes in this class set, yet you are trying to use %d."),flen,val);
-return( false );
- }
- }
- r->u.class.fcnt = any;
-
- r->u.class.nclasses = galloc(r->u.class.ncnt*sizeof(uint16));
- r->u.class.bclasses = galloc(r->u.class.bcnt*sizeof(uint16));
- r->u.class.fclasses = galloc(r->u.class.fcnt*sizeof(uint16));
-
- any = 0;
- for ( pt=match;; pt = end) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- if ( any>=r->u.class.ncnt ) IError("ReasonableClassNumber unreasonable");
- r->u.class.nclasses[any++] = u_strtol(pt,&end,10);
- }
-
- any = 0;
- for ( pt=back;; pt = end) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- if (r->u.class.bcnt-1-any<0 || r->u.class.bcnt-1-any>=r->u.class.bcnt ) IError("ReasonableClassNumber unreasonable");
- r->u.class.bclasses[r->u.class.bcnt-1-any++] = u_strtol(pt,&end,10);
- }
-
- any = 0;
- for ( pt=fore;; pt = end) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- if ( any>=r->u.class.fcnt ) IError("ReasonableClassNumber unreasonable");
- r->u.class.fclasses[any++] = u_strtol(pt,&end,10);
- }
-return( true );
-}
-
-static void CCD_FinishEditNew(struct contextchaindlg *ccd) {
- char *temp;
- struct fpst_rule dummy;
- GGadget *list = GWidgetGetControl(ccd->gw,CID_GList+ccd->wasoffset);
- int i,tot;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes"); buts[1] = _("_No"); buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_NO, NULL };
-#endif
-
- if ( ccd->wasoffset>=300 ) { /* It's a class */
- char *ret = GGadgetGetTitle8(GWidgetGetControl(ccd->gw,CID_GlyphList+300));
- if ( !CCD_NameListCheck(ccd->sf,ret,true,_("Bad Class")) ||
- CCD_InvalidClassList(ret,list,ccd->wasedit) ) {
- free(ret);
-return;
- }
- if ( ccd->wasedit ) {
- GListChangeLine8(list,GGadgetGetFirstListSelectedItem(list),ret);
- } else {
- GListAppendLine8(list,ret,false);
- }
- ccd->aw = aw_class;
- GDrawSetVisible(ccd->classbuild,false);
- GDrawSetVisible(ccd->class,true);
- free(ret);
- } else if ( ccd->wasoffset>=200 ) { /* It's class numbers */
- unichar_t *ret;
- memset(&dummy,0,sizeof(dummy));
- CCD_ParseLookupList(ccd->sf,&dummy,GWidgetGetControl(ccd->gw,CID_LookupList+500));
- if ( dummy.lookup_cnt==0 ) {
- int ans = gwwv_ask(_("No Sequence/Lookups"),
- (const char **) buts,0,1,
- _("There are no entries in the Sequence/Lookup List, was this intentional?"));
- if ( ans==1 )
-return;
- }
- if ( !CCD_ReasonableClassNum(
- _GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_ClassNumbers)),
- GWidgetGetControl(ccd->gw,CID_ClassList),
- _GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_ClassNumbers+20)),
- GWidgetGetControl(ccd->gw,CID_ClassList+20),
- _GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_ClassNumbers+40)),
- GWidgetGetControl(ccd->gw,CID_ClassList+40), &dummy )) {
- FPSTRuleContentsFree(&dummy,pst_class);
-return;
- }
- for ( i=0; i<dummy.lookup_cnt; ++i ) {
- if ( dummy.lookups[i].seq >= dummy.u.class.ncnt ) {
- gwwv_post_error(_("Bad Sequence/Lookup List"),_("Sequence number out of bounds, must be less than %d (number of classes in list above)"), dummy.u.class.ncnt );
-return;
- }
- }
- ret = clslistitem(&dummy);
- FPSTRuleContentsFree(&dummy,pst_class);
- if ( ccd->wasedit ) {
- GListChangeLine(list,GGadgetGetFirstListSelectedItem(list),ret);
- } else {
- GListAppendLine(list,ret,false);
- }
- ccd->aw = aw_class;
- GDrawSetVisible(ccd->classnumber,false);
- GDrawSetVisible(ccd->class,true);
- } else if ( ccd->wasoffset>=100 ) { /* It's from coverage */
- char *ret = GGadgetGetTitle8(GWidgetGetControl(ccd->gw,CID_GlyphList+100));
- if ( !CCD_NameListCheck(ccd->sf,ret,true,_("Bad Coverage")) ) {
- free(ret);
-return;
- }
- if ( ccd->wasedit ) {
- GListChangeLine8(list,GGadgetGetFirstListSelectedItem(list),ret);
- } else {
- GListAppendLine8(list,ret,false);
- }
- ccd->aw = aw_coverage;
- GDrawSetVisible(ccd->cselect,false);
- GDrawSetVisible(ccd->coverage,true);
- free(ret);
- } else { /* It's from glyph list */
- unichar_t *ret; char *val;
-
- memset(&dummy,0,sizeof(dummy));
- val = GGadgetGetTitle8(GWidgetGetControl(ccd->gw,CID_GlyphList));
- if ( !CCD_NameListCheck(ccd->sf,val,true,_("Bad Match Glyph List")) ) {
- free(val);
-return;
- }
- free(val);
- val = GGadgetGetTitle8(GWidgetGetControl(ccd->gw,CID_GlyphList+20));
- if ( !CCD_NameListCheck(ccd->sf,val,false,_("Bad Backtrack Glyph List")) ) {
- free(val);
-return;
- }
- free(val);
- val = GGadgetGetTitle8(GWidgetGetControl(ccd->gw,CID_GlyphList+40));
- if ( !CCD_NameListCheck(ccd->sf,val,false,_("Bad Lookahead Glyph List")) ) {
- free(val);
-return;
- }
- free(val);
- CCD_ParseLookupList(ccd->sf,&dummy,GWidgetGetControl(ccd->gw,CID_LookupList));
- if ( dummy.lookup_cnt==0 ) {
- int ans = gwwv_ask(_("No Sequence/Lookups"),
- (const char **) buts,0,1,
- _("There are no entries in the Sequence/Lookup List, was this intentional?"));
- if ( ans==1 )
-return;
- }
- dummy.u.glyph.names = ccd_cu_copy(_GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList)));
- tot = CCD_GlyphNameCnt(_GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList)));
- for ( i=0; i<dummy.lookup_cnt; ++i ) {
- if ( dummy.lookups[i].seq >= tot ) {
- gwwv_post_error(_("Bad Sequence/Lookup List"),_("Sequence number out of bounds, must be less than %d (number of glyphs, classes or coverage tables)"), tot );
-return;
- }
- }
- temp = ccd_cu_copy(_GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList+20)));
- dummy.u.glyph.back = reversenames(temp);
- free(temp);
- dummy.u.glyph.fore = ccd_cu_copy(_GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList+40)));
- ret = glistitem(&dummy);
- FPSTRuleContentsFree(&dummy,pst_glyphs);
- if ( ccd->wasedit ) {
- GListChangeLine(list,GGadgetGetFirstListSelectedItem(list),ret);
- } else {
- GListAppendLine(list,ret,false);
- }
- ccd->aw = aw_glist;
- GDrawSetVisible(ccd->glyphs,false);
- GDrawSetVisible(ccd->glist,true);
- }
-}
-
-static void _CCD_DoEditNew(struct contextchaindlg *ccd,int off,int isedit) {
- static unichar_t nulstr[] = { 0 };
- int i;
-
- if ( off>=200 && off<300) { /* It's a list of class numbers from the class window */
- int32 i, len;
- GTextInfo **ti;
- if ( isedit ) {
- GGadget *list = GWidgetGetControl(ccd->gw,CID_GList+off);
- struct fpst_rule dummy;
- unichar_t *temp;
- int32 len;
- GTextInfo **old = GGadgetGetList(list,&len);
- i = GGadgetGetFirstListSelectedItem(list);
- if ( i==-1 )
-return;
- memset(&dummy,0,sizeof(dummy));
- clslistitem2rule(ccd->sf,old[i]->text,&dummy);
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_ClassNumbers),
- (temp=classnumbers(dummy.u.class.ncnt,dummy.u.class.nclasses)));
- free(temp);
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_ClassNumbers+20),
- (temp=rclassnumbers(dummy.u.class.bcnt,dummy.u.class.bclasses)));
- free(temp);
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_ClassNumbers+40),
- (temp=classnumbers(dummy.u.class.fcnt,dummy.u.class.fclasses)));
- free(temp);
- ti = slistlist(&dummy);
- GGadgetSetList(GWidgetGetControl(ccd->gw,CID_LookupList+500),ti,false);
- FPSTRuleContentsFree(&dummy,pst_class);
- } else {
- for ( i=0; i<3; ++i )
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_ClassNumbers+i*20),nulstr);
- GGadgetClearList(GWidgetGetControl(ccd->gw,CID_LookupList+500));
- }
- GWidgetIndicateFocusGadget(GWidgetGetControl(ccd->gw,CID_ClassNumbers));
- for ( i=0; i<3; ++i ) {
- if ( i!=0 && GGadgetIsChecked(GWidgetGetControl(ccd->gw,CID_SameAsClasses+i*20)) )
- ti = GGadgetGetList(GWidgetGetControl(ccd->gw,CID_GList+300),&len);
- else
- ti = GGadgetGetList(GWidgetGetControl(ccd->gw,CID_GList+300+i*20),&len);
- GGadgetSetList(GWidgetGetControl(ccd->gw,CID_ClassList+i*20),ti,true);
- }
- ccd->aw = aw_classnumber;
- GDrawSetVisible(ccd->class,false);
- GDrawSetVisible(ccd->classnumber,true);
- } else if ( off>=100 ) { /* It's from coverage or class */
- int to_off = off>=300 ? 300 : 100;
- if ( isedit ) {
- GGadget *list = GWidgetGetControl(ccd->gw,CID_GList+off);
- int32 len;
- GTextInfo **old = GGadgetGetList(list,&len);
- i = GGadgetGetFirstListSelectedItem(list);
- if ( i==-1 )
-return;
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList+to_off),old[i]->text);
- } else {
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList+to_off),nulstr);
- }
- GWidgetIndicateFocusGadget(GWidgetGetControl(ccd->gw,CID_GlyphList+to_off));
- if ( off>=300 ) { /* It's a class from the class window */
- ccd->aw = aw_classbuild;
- GDrawSetVisible(ccd->class,false);
- GDrawSetVisible(ccd->classbuild,true);
- } else {
- ccd->aw = aw_cselect;
- GDrawSetVisible(ccd->coverage,false);
- GDrawSetVisible(ccd->cselect,true);
- }
- } else { /* It's from glyph list */
- unichar_t *temp; char *temp2;
- if ( isedit ) {
- struct fpst_rule dummy;
- GGadget *list = GWidgetGetControl(ccd->gw,CID_GList+off);
- int32 len; int i;
- GTextInfo **old = GGadgetGetList(list,&len), **ti;
- i = GGadgetGetFirstListSelectedItem(list);
- if ( i==-1 )
-return;
- memset(&dummy,0,sizeof(dummy));
- glistitem2rule(ccd->sf,old[i]->text,&dummy);
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList),(temp=uc_copy(dummy.u.glyph.names)));
- free(temp);
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList+20),(temp=uc_copy((temp2 = reversenames(dummy.u.glyph.back))==NULL ? "" : temp2)));
- free(temp); free(temp2);
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList+40),(temp=uc_copy(dummy.u.glyph.fore?dummy.u.glyph.fore:"")));
- free(temp);
- ti = slistlist(&dummy);
- GGadgetSetList(GWidgetGetControl(ccd->gw,CID_LookupList),ti,false);
- FPSTRuleContentsFree(&dummy,pst_glyphs);
- } else {
- for ( i=0; i<3; ++i )
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,CID_GlyphList+i*20),nulstr);
- GGadgetClearList(GWidgetGetControl(ccd->gw,CID_LookupList));
- }
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LEdit),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LDelete),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LUp),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LDown),false);
- ccd->aw = aw_glyphs;
- GDrawSetVisible(ccd->glist,false);
- GDrawSetVisible(ccd->glyphs,true);
- }
- CCD_EnableNextPrev(ccd);
- ccd->wasedit = isedit;
- ccd->wasoffset = off;
-}
-
-static void _CCD_ToSelection(struct contextchaindlg *ccd,int cid,int order_matters ) {
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(ccd->gw,cid));
- SplineFont *sf = ccd->sf;
- FontView *fv = sf->fv;
- const unichar_t *end;
- int i,pos, found=-1;
- char *nm;
-
- GDrawRaise(fv->gw);
- GDrawSetVisible(fv->gw,true);
- memset(fv->selected,0,fv->map->enccount);
- i=1;
- while ( *ret ) {
- end = u_strchr(ret,' ');
- if ( end==NULL ) end = ret+u_strlen(ret);
- nm = cu_copybetween(ret,end);
- for ( ret = end; isspace(*ret); ++ret);
- if (( pos = SFFindSlot(sf,fv->map,-1,nm))!=-1 ) {
- if ( found==-1 ) found = pos;
- fv->selected[pos] = i;
- if ( order_matters && i<255 ) ++i;
- }
- free(nm);
- }
-
- if ( found!=-1 )
- FVScrollToChar(fv,found);
- GDrawRequestExpose(fv->v,NULL,false);
-}
-
-static int CCD_ToSelection(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Select;
- int isglyph = ccd->aw==aw_glyphs;
-
- _CCD_ToSelection(ccd,CID_GlyphList+off,isglyph);
- }
-return( true );
-}
-
-static int CCD_ToSelection2(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Select2;
-
- _CCD_ToSelection(ccd,CID_RplList+off,true);
- }
-return( true );
-}
-#endif
-
-#ifndef LUA_FF_LIB
-
-static int BaseEnc(SplineChar *sc) {
- int uni = sc->unicodeenc;
-
- if ( uni==-1 || (uni>=0xe000 && uni<=0xf8ff)) { /* Private use or undefined */
- char *pt = strchr(sc->name,'.');
- if ( pt!=NULL ) {
- *pt = '\0';
- uni = UniFromName(sc->name,ui_none,NULL);
- *pt = '.';
- }
- }
-return( uni );
-}
-
-static int GlyphInClass(char *name,char *glyphs) {
- char *start, *pt;
- int len = strlen(name);
-
- for ( start = glyphs; *start ; ) {
- pt = strchr(start,' ');
- if ( pt==NULL ) {
-return( strcmp(name,start)==0 );
- }
- if ( pt-start==len && strncmp(name,start,len)==0 )
-return( true );
- start = pt;
- while ( *start==' ' ) ++start;
- }
-return( false );
-}
-
-static char *addglyph(char *results,char *name) {
- int len = strlen( results );
- results = grealloc(results,len+strlen(name)+2);
- if ( len!=0 ) {
- results[len] = ' ';
- strcpy( results+len+1,name );
- } else
- strcpy(results,name);
-return( results );
-}
-
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int CCD_StdClass(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_StdClasses;
- GTextInfo *ti = GGadgetGetListItemSelected(g);
- char *glyphs, *results;
- int any, gid, check_script, baseenc;
- FeatureScriptLangList *fl = ccd->fpst->subtable->lookup->features;
- SplineChar *sc;
-
- if ( ti==NULL )
-return( true );
- if ( strcmp((char *) ti->userdata,"None")==0 )
-return( true );
-
- check_script= strcmp((char *) ti->userdata,"0-9")!=0;
- if ( check_script && fl==NULL ) {
- GGadgetSelectOneListItem(g,0);
-return( true );
- }
- glyphs = GGadgetGetTitle8(GWidgetGetControl(ccd->gw,CID_GlyphList+off));
- results = copy(glyphs);
- any = 0;
-
- for ( gid=0; gid<ccd->sf->glyphcnt; ++gid ) if ( (sc=ccd->sf->glyphs[gid])!=NULL ) {
- if ( check_script && !ScriptInFeatureScriptList(SCScriptFromUnicode(sc),fl))
- continue;
- baseenc = BaseEnc(sc);
- if ( strcmp(ti->userdata,"Glyphs")==0 ) {
- /* ok, we've checked the script, nothing else to do, it matches*/
- } else if ( baseenc>=0x10000 || baseenc==-1 ) {
- /* I don't have any tables outside bmp */
- continue;
- } else if ( strcmp(ti->userdata,"0-9")==0 ) {
- if ( baseenc<'0' || baseenc>'9' )
- continue;
- } else if ( strcmp(ti->userdata,"Letters")==0 ) {
- if ( !isalpha(baseenc))
- continue;
- } else if ( strcmp(ti->userdata,"LC")==0 ) {
- if ( !islower(baseenc))
- continue;
- } else if ( strcmp(ti->userdata,"UC")==0 ) {
- if ( !isupper(baseenc))
- continue;
- }
- /* If we get here the glyph should be in the class */
- if ( GlyphInClass(sc->name,glyphs))
- continue; /* It's already there nothing for us to do */
- results = addglyph(results,sc->name);
- any = true;
- }
- if ( any ) {
- GGadgetSelectOneListItem(g,sizeof(stdclasses)/sizeof(stdclasses[0])-2);
- GGadgetSetTitle8(GWidgetGetControl(ccd->gw,CID_GlyphList+off),results);
- } else
- GGadgetSelectOneListItem(g,0);
- free(glyphs); free(results);
- }
-return( true );
-}
-#endif
-
-#ifndef LUA_FF_LIB
-static void _CCD_FromSelection(struct contextchaindlg *ccd,int cid,int order_matters ) {
- SplineFont *sf = ccd->sf;
- FontView *fv = sf->fv;
- unichar_t *vals, *pt;
- int i, j, len, max;
- SplineChar *sc;
-
- for ( i=len=max=0; i<fv->map->enccount; ++i ) if ( fv->selected[i]) {
- sc = SFMakeChar(sf,fv->map,i);
- len += strlen(sc->name)+1;
- if ( fv->selected[i]>max ) max = fv->selected[i];
- }
- pt = vals = galloc((len+1)*sizeof(unichar_t));
- *pt = '\0';
- if ( order_matters ) {
- /* in a glyph string the order of selection is important */
- /* also in replacement list */
- for ( j=1; j<=max; ++j ) {
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i]==j ) {
- int gid = fv->map->map[i];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL ) {
- uc_strcpy(pt,sf->glyphs[gid]->name);
- pt += u_strlen(pt);
- *pt++ = ' ';
- }
- }
- }
- } else {
- /* in a coverage table (or class) the order of selection is irrelevant */
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] ) {
- int gid = fv->map->map[i];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL ) {
- uc_strcpy(pt,sf->glyphs[gid]->name);
- pt += u_strlen(pt);
- *pt++ = ' ';
- }
- }
- }
- if ( pt>vals ) pt[-1]='\0';
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- GGadgetSetTitle(GWidgetGetControl(ccd->gw,cid),vals);
-#endif
- free(vals);
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int CCD_FromSelection(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Set;
- int isglyph = ccd->aw==aw_glyphs;
-
- _CCD_FromSelection(ccd,CID_GlyphList+off,isglyph);
- }
-return( true );
-}
-
-static int CCD_FromSelection2(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Set2;
-
- _CCD_FromSelection(ccd,CID_RplList+off,true);
- }
-return( true );
-}
-
-static int CCD_Delete(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Delete;
- GListDelSelected(GWidgetGetControl(ccd->gw,CID_GList+off));
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Delete+off),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Edit+off),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Up+off),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Down+off),false);
- }
-return( true );
-}
-
-static int CCD_Up(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Up;
- GGadget *list = GWidgetGetControl(ccd->gw,CID_GList+off);
- int32 len; int i;
-
- (void) GGadgetGetList(list,&len);
- GListMoveSelected(list,-1);
- i = GGadgetGetFirstListSelectedItem(list);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Up+off),i!=0);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Down+off),i!=len-1);
- }
-return( true );
-}
-
-static int CCD_Down(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Down;
- GGadget *list = GWidgetGetControl(ccd->gw,CID_GList+off);
- int32 len; int i;
-
- (void) GGadgetGetList(list,&len);
- GListMoveSelected(list,1);
- i = GGadgetGetFirstListSelectedItem(list);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Up+off),i!=0);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Down+off),i!=len-1);
- }
-return( true );
-}
-
-static int CCD_Edit(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_Edit;
- _CCD_DoEditNew(ccd,off,true);
- }
-return( true );
-}
-
-static int CCD_New(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_New;
- _CCD_DoEditNew(ccd,off,false);
- }
-return( true );
-}
-
-static int CCD_GlyphSelected(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_GList;
- int32 len; int i;
-
- (void) GGadgetGetList(g,&len);
- i = GGadgetGetFirstListSelectedItem(g);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Up+off),i>0 &&
- (i>1 || off<300));
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Down+off),i!=len-1 &&
- i!=-1 && (i!=0 || off<300));
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Delete+off),i!=-1 &&
- (i!=0 || off<300));
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Edit+off),i!=-1 &&
- (i!=0 || off<300));
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_GList;
- int i = GGadgetGetFirstListSelectedItem(g);
- if ( i!=0 || off<300 )
- _CCD_DoEditNew(ccd,off,true);
- }
-return( true );
-}
-
-static int CCD_SameAsClasses(GGadget *g, GEvent *e) {
- int ison = GGadgetIsChecked(g);
- int off = GGadgetGetCid(g)-CID_SameAsClasses;
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
-
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_GList+300+off),!ison);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_New+300+off),!ison);
- if ( ison ) {
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Edit+300+off),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Delete+300+off),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Up+300+off),false);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_Down+300+off),false);
- } else {
- GEvent ev;
- memset(&ev,0,sizeof(ev));
- ev.type =et_controlevent;
- ev.u.control.subtype = et_listselected;
- ev.u.control.g = GWidgetGetControl(ccd->gw,CID_GList+300+off);
- CCD_GlyphSelected(ev.u.control.g,&ev);
- }
-return( true );
-}
-
-static int CCD_ClassSelected(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassList;
- int i;
- GGadget *tf = GWidgetGetControl(ccd->gw,CID_ClassNumbers+off);
- char buf[20];
- unichar_t ubuf[20];
-
- i = GGadgetGetFirstListSelectedItem(g);
- if ( i==-1 )
-return( true );
- sprintf( buf, " %d ", i );
- uc_strcpy(ubuf,buf);
- GTextFieldReplace(tf,ubuf);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- }
-return( true );
-}
-
-static int CCD_LDelete(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_LDelete;
- GListDelSelected(GWidgetGetControl(ccd->gw,CID_LookupList+off));
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LDelete+off),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LEdit+off),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LUp+off),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LDown+off),false);
- }
-return( true );
-}
-
-static int CCD_LUp(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_LUp;
- GGadget *list = GWidgetGetControl(ccd->gw,CID_LookupList+off);
- int32 len; int i;
-
- (void) GGadgetGetList(list,&len);
- GListMoveSelected(list,-1);
- i = GGadgetGetFirstListSelectedItem(list);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LUp+off),i!=0);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LDown+off),i!=len-1);
- }
-return( true );
-}
-
-static int CCD_LDown(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_LDown;
- GGadget *list = GWidgetGetControl(ccd->gw,CID_LookupList+off);
- int32 len; int i;
-
- (void) GGadgetGetList(list,&len);
- GListMoveSelected(list,1);
- i = GGadgetGetFirstListSelectedItem(list);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LUp+off),i!=0);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_LDown+off),i!=len-1);
- }
-return( true );
-}
-
-struct seqlook_data {
- int done;
- int ok;
-};
-
-static int seqlook_e_h(GWindow gw, GEvent *e) {
- if ( e->type==et_close ) {
- struct seqlook_data *d = GDrawGetUserData(gw);
- d->done = true;
- } else if ( e->type == et_char ) {
-return( false );
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct seqlook_data *d = GDrawGetUserData(gw);
- d->done = true;
- d->ok = GGadgetGetCid(e->u.control.g);
- }
-return( true );
-}
-
-static void _CCD_DoLEditNew(struct contextchaindlg *ccd,int off,int isedit) {
- int seq, i;
- char cbuf[20];
- unichar_t nullstr[1], *end, *lstr = nullstr;
- GGadget *list = GWidgetGetControl(ccd->gw,CID_LookupList+off);
- struct seqlook_data d;
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[8];
- GTextInfo label[8], **ti;
- const unichar_t *pt;
- unichar_t *line;
- int selpos= -1;
- int isgpos;
-
- nullstr[0] = 0; seq = 0;
- if ( isedit ) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- selpos = GGadgetGetFirstListSelectedItem(list);
- seq = u_strtol(ti[selpos]->text,&end,10);
- if ( *end==' ' ) ++end;
- lstr = end;
- }
-
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Sequence/Lookup");
- pos.x = pos.y = 0;
- pos.width = GDrawPointsToPixels(NULL,180);
- pos.height = GDrawPointsToPixels(NULL,130);
- gw = GDrawCreateTopWindow(NULL,&pos,seqlook_e_h,&d,&wattrs);
-
- memset(&label,0,sizeof(label));
- memset(&gcd,0,sizeof(gcd));
-
- label[0].text = (unichar_t *) _("Sequence Number:");
- label[0].text_is_1byte = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 5; gcd[0].gd.pos.y = 6;
- gcd[0].gd.flags = gg_visible | gg_enabled;
- gcd[0].creator = GLabelCreate;
-
- sprintf(cbuf,"%d",seq);
- label[1].text = (unichar_t *) cbuf;
- label[1].text_is_1byte = true;
- gcd[1].gd.label = &label[1];
- gcd[1].gd.pos.x = 10; gcd[1].gd.pos.y = 18;
- gcd[1].gd.flags = gg_visible | gg_enabled;
- gcd[1].gd.cid = 1000;
- gcd[1].creator = GTextFieldCreate;
-
- label[2].text = (unichar_t *) _("Lookup:");
- label[2].text_is_1byte = true;
- label[2].text_in_resource = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.pos.x = 5; gcd[2].gd.pos.y = gcd[1].gd.pos.y+25;
- gcd[2].gd.flags = gg_visible | gg_enabled;
- gcd[2].creator = GLabelCreate;
-
- gcd[3].gd.pos.x = 10; gcd[3].gd.pos.y = gcd[2].gd.pos.y+13;
- gcd[3].gd.pos.width = 140;
- gcd[3].gd.flags = gg_visible | gg_enabled;
- gcd[3].creator = GListButtonCreate;
-
- gcd[4].gd.pos.x = 20-3; gcd[4].gd.pos.y = 130-35-3;
- gcd[4].gd.pos.width = -1; gcd[4].gd.pos.height = 0;
- gcd[4].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[4].text = (unichar_t *) _("_OK");
- label[4].text_is_1byte = true;
- label[4].text_in_resource = true;
- gcd[4].gd.label = &label[4];
- gcd[4].gd.cid = true;
- gcd[4].creator = GButtonCreate;
-
- gcd[5].gd.pos.x = -20; gcd[5].gd.pos.y = 130-35;
- gcd[5].gd.pos.width = -1; gcd[5].gd.pos.height = 0;
- gcd[5].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[5].text = (unichar_t *) _("_Cancel");
- label[5].text_is_1byte = true;
- label[5].text_in_resource = true;
- gcd[5].gd.label = &label[5];
- gcd[5].creator = GButtonCreate;
-
- gcd[6].gd.pos.x = 2; gcd[6].gd.pos.y = 2;
- gcd[6].gd.pos.width = pos.width-4; gcd[6].gd.pos.height = pos.height-2;
- gcd[6].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- gcd[6].creator = GGroupCreate;
-
- GGadgetsCreate(gw,gcd);
- isgpos = ( ccd->fpst->type==pst_contextpos || ccd->fpst->type==pst_chainpos );
- GGadgetSetList(gcd[3].ret, ti = SFLookupListFromType(ccd->sf,ot_undef),false);
- for ( i=0; ti[i]->text!=NULL; ++i )
- if ( u_strcmp(lstr,ti[i]->text)==0 ) {
- GGadgetSelectOneListItem(gcd[3].ret,i);
- break;
- }
- GDrawSetVisible(gw,true);
-
- retry:
- memset(&d,'\0',sizeof(d));
- while ( !d.done )
- GDrawProcessOneEvent(NULL);
-
- if ( d.ok ) {
- int err = false;
- seq = GetInt8(gw,1000,_("Sequence Position:"),&err);
- if ( err )
- goto retry;
- pt = _GGadgetGetTitle(gcd[3].ret);
- if ( *pt=='\0' ) {
- gwwv_post_error("Please select a lookup", "Please select a lookup");
- goto retry;
- }
- sprintf(cbuf,"%d ",seq);
- line = galloc((strlen(cbuf)+u_strlen(pt)+4)*sizeof(unichar_t));
- uc_strcpy(line,cbuf);
- u_strcat(line,pt);
- if ( isedit )
- GListChangeLine(list,selpos,line);
- else
- GListAppendLine(list,line,false);
- free(line);
- }
- GDrawDestroyWindow(gw);
-}
-
-static int CCD_LEdit(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_LEdit;
- _CCD_DoLEditNew(ccd,off,true);
- }
-return( true );
-}
-
-static int CCD_LNew(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_LNew;
- _CCD_DoLEditNew(ccd,off,false);
- }
-return( true );
-}
-
-static int CCD_LookupSelected(GGadget *g, GEvent *e) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_LookupList;
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- int32 len; int i;
-
- (void) GGadgetGetList(g,&len);
- i = GGadgetGetFirstListSelectedItem(g);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LUp+off),i>0);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LDown+off),i!=len-1 && i!=-1);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LDelete+off),i!=-1);
- GGadgetSetEnabled(GWidgetGetControl(ccd->gw,CID_LEdit+off),i!=-1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- _CCD_DoLEditNew(ccd,off,true);
- }
-return( true );
-}
-
-void CCD_Close(struct contextchaindlg *ccd) {
- if ( ccd->isnew )
- GFI_FinishContextNew(ccd->gfi,ccd->fpst,false);
- GFI_CCDEnd(ccd->gfi);
- GDrawDestroyWindow(ccd->gw);
-}
-
-static char **CCD_ParseCoverageList(struct contextchaindlg *ccd,int cid,int *cnt) {
- int i;
- int32 _cnt;
- GTextInfo **ti = GGadgetGetList(GWidgetGetControl(ccd->gw,cid),&_cnt);
- char **ret;
-
- *cnt = _cnt;
- if ( _cnt==0 )
-return( NULL );
- ret = galloc(*cnt*sizeof(char *));
- for ( i=0; i<_cnt; ++i )
- ret[i] = ccd_cu_copy(ti[i]->text);
-return( ret );
-}
-
-static void CoverageReverse(char **bcovers,int bcnt) {
- int i;
- char *temp;
-
- for ( i=0; i<bcnt/2; ++i ) {
- temp = bcovers[i];
- bcovers[i] = bcovers[bcnt-i-1];
- bcovers[bcnt-i-1] = temp;
- }
-}
-
-static void _CCD_Ok(struct contextchaindlg *ccd) {
- FPST *fpst = ccd->fpst;
- int32 len, i, k;
- GTextInfo **old, **classes;
- struct fpst_rule dummy;
- int has[3];
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes"); buts[1] = _("_No"); buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_NO, NULL };
-#endif
-
- switch ( ccd->aw ) {
- case aw_glist: {
- old = GGadgetGetList(GWidgetGetControl(ccd->gw,CID_GList),&len);
- if ( len==0 ) {
- gwwv_post_error(_("Missing rules"),_(" There must be at least one contextual rule"));
-return;
- }
- FPSTRulesFree(fpst->rules,fpst->format,fpst->rule_cnt);
- fpst->format = pst_glyphs;
- fpst->rule_cnt = len;
- fpst->rules = gcalloc(len,sizeof(struct fpst_rule));
- for ( i=0; i<len; ++i )
- glistitem2rule(ccd->sf,old[i]->text,&fpst->rules[i]);
- } break;
- case aw_class: {
- old = GGadgetGetList(GWidgetGetControl(ccd->gw,CID_GList+200),&len);
- if ( len==0 ) {
- gwwv_post_error(_("Missing rules"),_(" There must be at least one contextual rule"));
-return;
- }
- FPSTRulesFree(fpst->rules,fpst->format,fpst->rule_cnt);
- fpst->format = pst_class;
- fpst->rule_cnt = len;
- fpst->rules = gcalloc(len,sizeof(struct fpst_rule));
- fpst->nccnt = fpst->bccnt = fpst->fccnt = 0;
- fpst->nclass = fpst->bclass = fpst->fclass = NULL;
- has[1] = has[2] = false; has[0] = true;
- for ( i=0; i<len; ++i ) {
- clslistitem2rule(ccd->sf,old[i]->text,&fpst->rules[i]);
- if ( fpst->rules[i].u.class.bcnt!=0 ) has[1] = true;
- if ( fpst->rules[i].u.class.fcnt!=0 ) has[2] = true;
- }
- for ( i=0; i<3; ++i ) {
- if ( i==0 || !GGadgetIsChecked(GWidgetGetControl(ccd->gw,CID_SameAsClasses+i*20)) )
- classes = GGadgetGetList(GWidgetGetControl(ccd->gw,CID_GList+300+i*20),&len);
- else if ( has[i] )
- classes = GGadgetGetList(GWidgetGetControl(ccd->gw,CID_GList+300),&len);
- else
- continue;
- (&fpst->nccnt)[i] = len;
- (&fpst->nclass)[i] = galloc(len*sizeof(char*));
- (&fpst->nclass)[i][0] = NULL;
- for ( k=1; k<len; ++k )
- (&fpst->nclass)[i][k] = cu_copy(classes[k]->text);
- }
- } break;
- case aw_coverage:
- old = GGadgetGetList(GWidgetGetControl(ccd->gw,CID_GList+100),&len);
- if ( len==0 ) {
- gwwv_post_error(_("Bad Coverage Table"),_("There must be at least one match coverage table"));
-return;
- }
- if ( fpst->format==pst_reversecoverage ) {
- if ( len!=1 ) {
- gwwv_post_error(_("Bad Coverage Table"),_("In a Reverse Chaining Substitution there must be exactly one coverage table to match"));
-return;
- }
- if ( CCD_GlyphNameCnt(old[0]->text)!=CCD_GlyphNameCnt(
- _GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_RplList+100))) ) {
- gwwv_post_error(_("Replacement mismatch"),_("In a Reverse Chaining Substitution there must be exactly as many replacements as there are glyph names in the match coverage table"));
-return;
- }
- dummy.u.rcoverage.replacements = ccd_cu_copy(
- _GGadgetGetTitle(GWidgetGetControl(ccd->gw,CID_RplList+100)));
- } else {
- CCD_ParseLookupList(ccd->sf,&dummy,GWidgetGetControl(ccd->gw,CID_LookupList+100));
- if ( dummy.lookup_cnt==0 ) {
- int ans = gwwv_ask(_("No Sequence/Lookups"),
- (const char **) buts,0,1,
- _("There are no entries in the Sequence/Lookup List, was this intentional?"));
- if ( ans==1 )
-return;
- }
- }
- FPSTRulesFree(fpst->rules,fpst->format,fpst->rule_cnt);
- fpst->format = fpst->type==pst_reversesub ? pst_reversecoverage : pst_coverage;
- fpst->rule_cnt = 1;
- fpst->rules = gcalloc(1,sizeof(struct fpst_rule));
- fpst->rules[0].u.coverage.ncovers = CCD_ParseCoverageList(ccd,CID_GList+100,&fpst->rules[0].u.coverage.ncnt);
- fpst->rules[0].u.coverage.bcovers = CCD_ParseCoverageList(ccd,CID_GList+100+20,&fpst->rules[0].u.coverage.bcnt);
- CoverageReverse(fpst->rules[0].u.coverage.bcovers,fpst->rules[0].u.coverage.bcnt);
- fpst->rules[0].u.coverage.fcovers = CCD_ParseCoverageList(ccd,CID_GList+100+40,&fpst->rules[0].u.coverage.fcnt);
- if ( fpst->format==pst_reversecoverage )
- fpst->rules[0].u.rcoverage.replacements = dummy.u.rcoverage.replacements;
- else {
- fpst->rules[0].lookup_cnt = dummy.lookup_cnt;
- fpst->rules[0].lookups = dummy.lookups;
- for ( i=0; i<dummy.lookup_cnt; ++i ) {
- if ( dummy.lookups[i].seq >= fpst->rules[0].u.coverage.ncnt ) {
- gwwv_post_error(_("Bad Sequence/Lookup List"),
- _("Sequence number out of bounds, must be less than %d (number of classes in list above)"),
- fpst->rules[0].u.coverage.ncnt );
-return;
- }
- }
- }
- break;
- default:
- IError("The OK button should not be enabled here");
-return;
- }
- if ( ccd->isnew )
- GFI_FinishContextNew(ccd->gfi,ccd->fpst,true);
- GFI_CCDEnd(ccd->gfi);
- GDrawDestroyWindow(ccd->gw);
-}
-
-static int CCD_OK(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- _CCD_Ok(ccd);
- }
-return( true );
-}
-
-static int CCD_Cancel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- CCD_Close(ccd);
- }
-return( true );
-}
-
-static int CCD_Next(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- switch ( ccd->aw ) {
- case aw_formats:
- GDrawSetVisible(ccd->formats,false);
- if ( GGadgetIsChecked(GWidgetGetControl(ccd->gw,CID_ByGlyph)) ) {
- ccd->aw = aw_glist;
- GDrawSetVisible(ccd->glist,true);
- } else if ( GGadgetIsChecked(GWidgetGetControl(ccd->gw,CID_ByClass)) ) {
- ccd->aw = aw_class;
- GDrawSetVisible(ccd->class,true);
- } else {
- ccd->aw = aw_coverage;
- GDrawSetVisible(ccd->coverage,true);
- }
- break;
- case aw_glyphs:
- case aw_classnumber:
- case aw_classbuild:
- case aw_cselect:
- CCD_FinishEditNew(ccd);
- break;
- default:
- IError("The next button should not be enabled here");
- break;
- }
- CCD_EnableNextPrev(ccd);
- }
-return( true );
-}
-
-static int CCD_Prev(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct contextchaindlg *ccd = GDrawGetUserData(GGadgetGetWindow(g));
- switch ( ccd->aw ) {
- case aw_formats:
- CCD_Cancel(g,e);
- break;
- case aw_glyphs:
- ccd->aw = aw_glist;
- GDrawSetVisible(ccd->glyphs,false);
- GDrawSetVisible(ccd->glist,true);
- break;
- case aw_cselect:
- ccd->aw = aw_coverage;
- GDrawSetVisible(ccd->cselect,false);
- GDrawSetVisible(ccd->coverage,true);
- break;
- case aw_classnumber:
- case aw_classbuild:
- ccd->aw = aw_class;
- GDrawSetVisible(ccd->classbuild,false);
- GDrawSetVisible(ccd->classnumber,false);
- GDrawSetVisible(ccd->class,true);
- break;
- case aw_coverage:
- case aw_class:
- case aw_glist:
- ccd->aw = aw_formats;
- GDrawSetVisible(ccd->coverage,false);
- GDrawSetVisible(ccd->class,false);
- GDrawSetVisible(ccd->glist,false);
- GDrawSetVisible(ccd->formats,true);
- break;
- default:
- IError("Can't get here");
- break;
- }
- CCD_EnableNextPrev(ccd);
- }
-return( true );
-}
-
-static void CCD_SimulateDefaultButton( struct contextchaindlg *ccd ) {
- GEvent ev;
- int i,j;
-
- /* figure out what the default action should be */
- memset(&ev,0,sizeof(ev));
- ev.type = et_controlevent;
- ev.u.control.subtype = et_buttonactivate;
- if ( ccd->aw==aw_formats || ccd->aw == aw_glyphs || ccd->aw == aw_cselect ) {
- ev.u.control.g = GWidgetGetControl(ccd->gw,CID_Next);
- CCD_Next(ev.u.control.g,&ev);
-/* For the glyph list and the coverage list, the [Next] button is disabled */
-/* I think [OK] is probably inappropriate, so let's do either [New] or [Edit] */
-/* (which are what [Next] would logically do) depending on which of the two */
-/* is more appropriate */
-/* ev.u.control.g = GWidgetGetControl(ccd->gw,CID_OK); */
-/* CCD_OK(ev.u.control.g,&ev); */
- } else if ( ccd->aw==aw_glist ) {
- i = GGadgetGetFirstListSelectedItem( GWidgetGetControl(ccd->gw,CID_GList));
- if ( i==-1 ) {
- ev.u.control.g = GWidgetGetControl(ccd->gw,CID_New);
- CCD_New(ev.u.control.g,&ev);
- } else {
- ev.u.control.g = GWidgetGetControl(ccd->gw,CID_Edit);
- CCD_Edit(ev.u.control.g,&ev);
- }
- } else {
- i = GTabSetGetSel( GWidgetGetControl(ccd->gw,CID_MatchType+100));
- j = GGadgetGetFirstListSelectedItem( GWidgetGetControl(ccd->gw,CID_GList+100+i*20));
- if ( j==-1 ) {
- ev.u.control.g = GWidgetGetControl(ccd->gw,CID_New+100+i*20);
- CCD_New(ev.u.control.g,&ev);
- } else {
- ev.u.control.g = GWidgetGetControl(ccd->gw,CID_Edit+100+i*20);
- CCD_Edit(ev.u.control.g,&ev);
- }
- }
-}
-
-static void CCD_Drop(struct contextchaindlg *ccd,GEvent *event) {
- char *cnames;
- unichar_t *unames, *pt;
- const unichar_t *ret;
- GGadget *g;
- int32 len;
-
- if ( ccd->aw != aw_glyphs && ccd->aw != aw_cselect &&
- (ccd->aw != aw_coverage || ccd->fpst->format!=pst_reversecoverage)) {
- GDrawBeep(NULL);
-return;
- }
-
- if ( ccd->aw==aw_cselect )
- g = GWidgetGetControl(ccd->gw,CID_GlyphList+100);
- else if ( ccd->aw==aw_glyphs ) {
- int which = GTabSetGetSel(GWidgetGetControl(ccd->glyphs,CID_MatchType));
- g = GWidgetGetControl(ccd->gw,CID_GlyphList+20*which);
- } else {
- int which = GTabSetGetSel(GWidgetGetControl(ccd->coverage,CID_MatchType+100));
- if ( which!=0 ) {
- GDrawBeep(NULL);
-return;
- }
- g = GWidgetGetControl(ccd->gw,CID_RplList+100);
- }
-
- if ( !GDrawSelectionHasType(ccd->gw,sn_drag_and_drop,"STRING"))
-return;
- cnames = GDrawRequestSelection(ccd->gw,sn_drag_and_drop,"STRING",&len);
- if ( cnames==NULL )
-return;
-
- ret = _GGadgetGetTitle(g);
- unames = galloc((strlen(cnames)+u_strlen(ret)+8)*sizeof(unichar_t));
- u_strcpy(unames,ret);
- pt = unames+u_strlen(unames);
- if ( pt>unames && pt[-1]!=' ' )
- uc_strcpy(pt," ");
- uc_strcat(pt,cnames);
- free(cnames);
-
- GGadgetSetTitle(g,unames);
-}
-
-static int subccd_e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("contextchain.html");
-return( true );
- } else if ( event->u.chr.keysym=='q' && (event->u.chr.state&ksm_control)) {
- if ( event->u.chr.state&ksm_shift )
- CCD_Close(GDrawGetUserData(gw));
- else
- MenuExit(NULL,NULL,NULL);
-return( true );
- } else if ( event->u.chr.chars[0]=='\r' ) {
- CCD_SimulateDefaultButton( (struct contextchaindlg *) GDrawGetUserData(gw));
-return( true );
- }
-return( false );
- } else if ( event->type == et_drop ) {
- CCD_Drop(GDrawGetUserData(gw),event);
- }
-return( true );
-}
-
-static int ccd_e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- struct contextchaindlg *ccd = GDrawGetUserData(gw);
- CCD_Close(ccd);
- } else if ( event->type==et_destroy ) {
- struct contextchaindlg *ccd = GDrawGetUserData(gw);
- chunkfree(ccd,sizeof(struct contextchaindlg));
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("contextchain.html");
-return( true );
- } else if ( event->u.chr.keysym=='q' && (event->u.chr.state&ksm_control)) {
- if ( event->u.chr.state&ksm_shift )
- CCD_Close(GDrawGetUserData(gw));
- else
- MenuExit(NULL,NULL,NULL);
-return( true );
- } else if ( event->u.chr.chars[0]=='\r' ) {
- CCD_SimulateDefaultButton( (struct contextchaindlg *) GDrawGetUserData(gw));
-return( true );
- }
-return( false );
- } else if ( event->type==et_resize ) {
- int blen = GDrawPointsToPixels(NULL,GIntGetResource(_NUM_Buttonsize)), i;
- GRect wsize, csize;
- struct contextchaindlg *ccd = GDrawGetUserData(gw);
- GGadget *g;
-
- GDrawGetSize(ccd->gw,&wsize);
- GGadgetResize(GWidgetGetControl(ccd->gw,CID_Group),wsize.width-4,wsize.height-4);
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_OK),&csize);
- GGadgetMove(GWidgetGetControl(ccd->gw,CID_OK),csize.x,wsize.height-ccd->canceldrop);
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_Next),&csize);
- GGadgetMove(GWidgetGetControl(ccd->gw,CID_Next),csize.x,wsize.height-ccd->canceldrop);
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_Prev),&csize);
- GGadgetMove(GWidgetGetControl(ccd->gw,CID_Prev),csize.x,wsize.height-ccd->canceldrop);
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_Cancel),&csize);
- GGadgetMove(GWidgetGetControl(ccd->gw,CID_Cancel),wsize.width-blen-20,wsize.height-ccd->canceldrop);
-
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_MatchType),&csize);
- GGadgetResize(GWidgetGetControl(ccd->gw,CID_MatchType),wsize.width-GDrawPointsToPixels(NULL,10),csize.height);
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_MatchType+100),&csize);
- GGadgetResize(GWidgetGetControl(ccd->gw,CID_MatchType+100),wsize.width-GDrawPointsToPixels(NULL,10),csize.height);
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_LookupList),&csize);
- GGadgetResize(GWidgetGetControl(ccd->gw,CID_LookupList),wsize.width-GDrawPointsToPixels(NULL,20),csize.height);
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_GList),&csize);
- GGadgetResize(GWidgetGetControl(ccd->gw,CID_GList),wsize.width-GDrawPointsToPixels(NULL,20),csize.height);
- if ( (g = GWidgetGetControl(ccd->gw,CID_LookupList+100))!=NULL ) {
- GGadgetGetSize(g,&csize);
- GGadgetResize(g,wsize.width-GDrawPointsToPixels(NULL,20),csize.height);
- } else {
- GGadgetGetSize(GWidgetGetControl(ccd->gw,CID_RplList+100),&csize);
- GGadgetResize(GWidgetGetControl(ccd->gw,CID_RplList+100),wsize.width-GDrawPointsToPixels(NULL,25),csize.height);
- }
- for ( i=0; i<3; ++i ) {
- if ( (g=GWidgetGetControl(ccd->gw,CID_GlyphList+i*20))!=NULL ) {
- GGadgetGetSize(g,&csize);
- GGadgetResize(g,wsize.width-GDrawPointsToPixels(NULL,25),csize.height);
- }
- if ( (g=GWidgetGetControl(ccd->gw,CID_GList+100+i*20))!=NULL ) {
- GGadgetGetSize(g,&csize);
- GGadgetResize(g,wsize.width-GDrawPointsToPixels(NULL,20),csize.height);
- }
- }
- if ( (g=GWidgetGetControl(ccd->gw,CID_GlyphList+100))!=NULL ) {
- GGadgetGetSize(g,&csize);
- GGadgetResize(g,wsize.width-GDrawPointsToPixels(NULL,25),csize.height);
- }
-
- GDrawResize(ccd->formats,wsize.width-8,wsize.height-ccd->subheightdiff);
- GDrawResize(ccd->coverage,wsize.width-8,wsize.height-ccd->subheightdiff);
- GDrawResize(ccd->glist,wsize.width-8,wsize.height-ccd->subheightdiff);
- GDrawResize(ccd->glyphs,wsize.width-8,wsize.height-ccd->subheightdiff);
- GDrawResize(ccd->cselect,wsize.width-8,wsize.height-ccd->subheightdiff);
- GDrawResize(ccd->class,wsize.width-8,wsize.height-ccd->subheightdiff);
-
- GDrawRequestExpose(ccd->gw,NULL,false);
- GDrawRequestExpose(ccd->aw==aw_formats ? ccd->formats :
- ccd->aw==aw_coverage ? ccd->coverage :
- ccd->aw==aw_glist ? ccd->glist :
- ccd->aw==aw_glyphs ? ccd->glyphs :
- ccd->cselect, NULL,false);
- } else if ( event->type == et_drop ) {
- CCD_Drop(GDrawGetUserData(gw),event);
- }
-return( true );
-}
-
-#define CCD_WIDTH 340
-#define CCD_HEIGHT 340
-
-static int CCD_AddGList(GGadgetCreateData *gcd, GTextInfo *label,int off,
- int y, int width,int height) {
- int k = 0, space;
- int blen = GIntGetResource(_NUM_Buttonsize);
-
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = y;
- gcd[k].gd.pos.width = width;
- gcd[k].gd.pos.height = height;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.handle_controlevent = CCD_GlyphSelected;
- gcd[k].gd.cid = CID_GList+off;
- gcd[k++].creator = GListCreate;
-
- space = width==CCD_WIDTH-30 ? 7 : 10;
- label[k].text = (unichar_t *) S_("Class|_New");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+gcd[k-1].gd.pos.height+10;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.handle_controlevent = CCD_New;
- gcd[k].gd.cid = CID_New+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Edit");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_Edit;
- gcd[k].gd.cid = CID_Edit+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Delete");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_Delete;
- gcd[k].gd.cid = CID_Delete+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Up");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space+5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_Up;
- gcd[k].gd.cid = CID_Up+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Down");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_Down;
- gcd[k].gd.cid = CID_Down+off;
- gcd[k++].creator = GButtonCreate;
-
-return( k );
-}
-
-static int CCD_AddGlyphList(GGadgetCreateData *gcd, GTextInfo *label,int off,
- int y, int height) {
- int k;
- static int inited = 0;
-
- if ( !inited ) {
- for ( k=0; stdclasses[k].text!=NULL; ++k )
- stdclasses[k].text = (unichar_t *) _((char *) stdclasses[k].text);
- inited = true;
- }
-
- k=0;
- label[k].text = (unichar_t *) _("Set From Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = y;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set this glyph list to be the characters selected in the fontview");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = CCD_FromSelection;
- gcd[k].gd.cid = CID_Set+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("Select In Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 110; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set the fontview's selection to be the characters named here");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = CCD_ToSelection;
- gcd[k].gd.cid = CID_Select+off;
- gcd[k++].creator = GButtonCreate;
-
- if ( off>100 ) { /* Don't add for glyph lists */
- label[k].text = (unichar_t *) _("Add Standard Class:");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = y+24+6;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k++].creator = GLabelCreate;
-
- gcd[k].gd.pos.x = 110; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-6;
- gcd[k].gd.popup_msg = (unichar_t *) _("Add one of these standard classes of glyphs to the current class");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.u.list = stdclasses;
- gcd[k].gd.handle_controlevent = CCD_StdClass;
- gcd[k].gd.cid = CID_StdClasses+off;
- gcd[k++].creator = GListButtonCreate;
-
- y+=24;
- }
-
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = y+24;
- gcd[k].gd.pos.width = CCD_WIDTH-25; gcd[k].gd.pos.height = 8*13+4;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
- gcd[k].gd.cid = CID_GlyphList+off;
- gcd[k++].creator = GTextAreaCreate;
-return( k );
-}
-
-static void CCD_AddSeqLookup(GGadgetCreateData *gcd, GTextInfo *label,int off,
- int y, int width, int height) {
- int k, space;
- int blen = GIntGetResource(_NUM_Buttonsize);
-
- k = 0;
- space = width==CCD_WIDTH-30 ? 7 : 10;
- label[k].text = (unichar_t *) _("An ordered list of sequence positions and lookup tags");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = y;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k++].creator = GLabelCreate;
-
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+13;
- gcd[k].gd.pos.width = width;
- gcd[k].gd.pos.height = height;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.handle_controlevent = CCD_LookupSelected;
- gcd[k].gd.cid = CID_LookupList+off;
- gcd[k++].creator = GListCreate;
-
- label[k].text = (unichar_t *) S_("Lookup|_New");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+gcd[k-1].gd.pos.height+10;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.handle_controlevent = CCD_LNew;
- gcd[k].gd.cid = CID_LNew+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Edit");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_LEdit;
- gcd[k].gd.cid = CID_LEdit+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Delete");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_LDelete;
- gcd[k].gd.cid = CID_LDelete+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Up");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space+5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_LUp;
- gcd[k].gd.cid = CID_LUp+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Down");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = CCD_LDown;
- gcd[k].gd.cid = CID_LDown+off;
- gcd[k++].creator = GButtonCreate;
-}
-
-static void CCD_AddReplacements(GGadgetCreateData *gcd, GTextInfo *label,
- struct fpst_rule *r,int off, int y) {
- int k;
-
- k=0;
- label[k].text = (unichar_t *) _("Replacements");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = y;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k++].creator = GLabelCreate;
-
- label[k].text = (unichar_t *) _("Set From Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+13;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set this glyph list to be the characters selected in the fontview");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = CCD_FromSelection2;
- gcd[k].gd.cid = CID_Set2+off;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("Select In Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 110; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set the fontview's selection to be the characters named here");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = CCD_ToSelection2;
- gcd[k].gd.cid = CID_Select2+off;
- gcd[k++].creator = GButtonCreate;
-
- if ( r!=NULL && r->u.rcoverage.replacements!=NULL ) {
- label[k].text = (unichar_t *) r->u.rcoverage.replacements;
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- }
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+25;
- gcd[k].gd.pos.width = CCD_WIDTH-25; gcd[k].gd.pos.height = 4*13+4;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
- gcd[k].gd.cid = CID_RplList+off;
- gcd[k++].creator = GTextAreaCreate;
-}
-#endif
-
-struct contextchaindlg *ContextChainEdit(SplineFont *sf,FPST *fpst,
- struct gfi_data *gfi, unichar_t *newname) {
- struct contextchaindlg *ccd;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int i,j,k, space;
- static char *titles[2][5] = {
- { N_("Edit Contextual Position"), N_("Edit Contextual Substitution"),
- N_("Edit Chaining Position"), N_("Edit Chaining Substitution"),
- N_("Edit Reverse Chaining Substitution"),
- },
- { N_("New Contextual Position"), N_("New Contextual Substitution"),
- N_("New Chaining Position"), N_("New Chaining Substitution"),
- N_("New Reverse Chaining Substitution")
- }};
- GRect pos, subpos;
- GWindow gw;
- GWindowAttrs wattrs;
- GTabInfo faspects[5];
- GGadgetCreateData glgcd[8], fgcd[3], ggcd[3][14], cgcd[3][18], csgcd[6],
- clgcd[10];
- GTextInfo gllabel[8], flabel[3], glabel[3][14], clabel[3][18], cslabel[6],
- cllabel[10];
- GGadgetCreateData bgcd[6], rgcd[15];
- GTextInfo blabel[4], rlabel[15];
- int blen = GIntGetResource(_NUM_Buttonsize)*100/GGadgetScale(100);
- struct fpst_rule *r=NULL;
- char *text[] = {
-/* GT: The following strings should be concatenated together, the result */
-/* GT: translated, and then broken into lines by hand. I'm sure it would */
-/* GT: be better to specify this all as one string, but my widgets won't support */
-/* GT: that */
- N_("OpenType Contextual or Chaining subtables may be in one"),
- N_(" of three formats. The context may be specified either"),
- N_(" as a string of specific glyphs, a string of glyph classes,"), N_(" or a string of coverage tables."),
- N_("In the first format you must specify a string of glyph-names."), N_(" In the second format you must specify a string of class numbers."),
- N_(" In the third format you must specify a string each element"), N_(" of which may contain several glyph-names."),
- N_("For chaining subtables you may also specify backtrack and"),
- N_(" lookahead lists."), 0 };
- FPST *tempfpst;
-#endif
-
- ccd = chunkalloc(sizeof(struct contextchaindlg));
- ccd->gfi = gfi;
- ccd->sf = sf;
- ccd->fpst = fpst;
- ccd->newname = newname;
- ccd->isnew = newname!=NULL;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.is_dlg = true;
- wattrs.restrict_input_to_me = false;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _(titles[ccd->isnew][fpst->type-pst_contextpos]);
- pos.x = pos.y = 0;
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(CCD_WIDTH));
- pos.height = GDrawPointsToPixels(NULL,CCD_HEIGHT);
- ccd->gw = gw = GDrawCreateTopWindow(NULL,&pos,ccd_e_h,ccd,&wattrs);
-
- subpos = pos;
- subpos.y = subpos.x = 4;
- subpos.width -= 8;
- ccd->subheightdiff = GDrawPointsToPixels(NULL,44)-8;
- subpos.height -= ccd->subheightdiff;
-
-
- memset(&blabel,0,sizeof(blabel));
- memset(&bgcd,0,sizeof(bgcd));
-
- ccd->canceldrop = GDrawPointsToPixels(NULL,30);
- bgcd[0].gd.pos.x = 20; bgcd[0].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-33;
- bgcd[0].gd.pos.width = -1; bgcd[0].gd.pos.height = 0;
- bgcd[0].gd.flags = gg_visible | gg_enabled;
- blabel[0].text = (unichar_t *) _("_OK");
- blabel[0].text_is_1byte = true;
- blabel[0].text_in_resource = true;
- bgcd[0].gd.label = &blabel[0];
- bgcd[0].gd.cid = CID_OK;
- bgcd[0].gd.handle_controlevent = CCD_OK;
- bgcd[0].creator = GButtonCreate;
-
- space = (CCD_WIDTH-4*blen-40)/3;
- bgcd[1].gd.pos.x = bgcd[0].gd.pos.x+blen+space; bgcd[1].gd.pos.y = bgcd[0].gd.pos.y;
- bgcd[1].gd.pos.width = -1; bgcd[1].gd.pos.height = 0;
- bgcd[1].gd.flags = gg_visible;
- blabel[1].text = (unichar_t *) _("< _Prev");
- blabel[1].text_is_1byte = true;
- blabel[1].text_in_resource = true;
- bgcd[1].gd.label = &blabel[1];
- bgcd[1].gd.handle_controlevent = CCD_Prev;
- bgcd[1].gd.cid = CID_Prev;
- bgcd[1].creator = GButtonCreate;
-
- bgcd[2].gd.pos.x = bgcd[1].gd.pos.x+blen+space; bgcd[2].gd.pos.y = bgcd[1].gd.pos.y;
- bgcd[2].gd.pos.width = -1; bgcd[2].gd.pos.height = 0;
- bgcd[2].gd.flags = gg_visible;
- blabel[2].text = (unichar_t *) _("_Next >");
- blabel[2].text_is_1byte = true;
- blabel[2].text_in_resource = true;
- bgcd[2].gd.label = &blabel[2];
- bgcd[2].gd.handle_controlevent = CCD_Next;
- bgcd[2].gd.cid = CID_Next;
- bgcd[2].creator = GButtonCreate;
-
- bgcd[3].gd.pos.x = -20; bgcd[3].gd.pos.y = bgcd[1].gd.pos.y;
- bgcd[3].gd.pos.width = -1; bgcd[3].gd.pos.height = 0;
- bgcd[3].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- blabel[3].text = (unichar_t *) _("_Cancel");
- blabel[3].text_is_1byte = true;
- blabel[3].text_in_resource = true;
- bgcd[3].gd.label = &blabel[3];
- bgcd[3].gd.handle_controlevent = CCD_Cancel;
- bgcd[3].gd.cid = CID_Cancel;
- bgcd[3].creator = GButtonCreate;
-
- bgcd[4].gd.pos.x = 2; bgcd[4].gd.pos.y = 2;
- bgcd[4].gd.pos.width = pos.width-4; bgcd[4].gd.pos.height = pos.height-4;
- bgcd[4].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- bgcd[4].gd.cid = CID_Group;
- bgcd[4].creator = GGroupCreate;
-
- if ( fpst->type == pst_reversesub ) {
- bgcd[1].gd.flags = bgcd[2].gd.flags = gg_visible;
- ccd->aw = aw_coverage;
- } else if ( ccd->isnew || fpst->rule_cnt==0) {
- fpst->format = pst_class;
- bgcd[0].gd.flags = gg_visible;
- bgcd[2].gd.flags = gg_visible | gg_enabled;
- ccd->aw = aw_formats;
- } else if ( fpst->format==pst_coverage ) {
- bgcd[1].gd.flags = gg_visible | gg_enabled; bgcd[2].gd.flags = gg_visible;
- ccd->aw = aw_coverage; /* flags are different from those of reversesub above */
- } else if ( fpst->format==pst_class ) {
- bgcd[1].gd.flags = gg_visible | gg_enabled; bgcd[2].gd.flags = gg_visible;
- ccd->aw = aw_class;
- } else {
- bgcd[1].gd.flags = gg_visible | gg_enabled; bgcd[2].gd.flags = gg_visible;
- ccd->aw = aw_glist;
- }
-
- GGadgetsCreate(gw,bgcd);
-
- wattrs.mask = wam_events;
- ccd->formats = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&rlabel,0,sizeof(rlabel));
- memset(&rgcd,0,sizeof(rgcd));
-
- for ( i=0; text[i]!=0; ++i ) {
- rgcd[i].gd.pos.x = 5; rgcd[i].gd.pos.y = 5+i*13;
- rgcd[i].gd.flags = gg_visible | gg_enabled;
- rlabel[i].text = (unichar_t *) _(text[i]);
- rlabel[i].text_is_1byte = true;
- rgcd[i].gd.label = &rlabel[i];
- rgcd[i].creator = GLabelCreate;
- }
-
- rgcd[i].gd.pos.x = 50; rgcd[i].gd.pos.y = rgcd[i-1].gd.pos.y+20;
- rgcd[i].gd.flags = gg_visible | gg_enabled | (fpst->format==pst_glyphs ? gg_cb_on : 0 );
- rlabel[i].text = (unichar_t *) _("By Glyphs");
- rlabel[i].text_is_1byte = true;
- rgcd[i].gd.label = &rlabel[i];
- rgcd[i].gd.cid = CID_ByGlyph;
- rgcd[i++].creator = GRadioCreate;
-
- rgcd[i].gd.pos.x = rgcd[i-1].gd.pos.x; rgcd[i].gd.pos.y = rgcd[i-1].gd.pos.y+16;
- rgcd[i].gd.flags = gg_visible | gg_enabled | (fpst->format==pst_class ? gg_cb_on : 0 );
- rlabel[i].text = (unichar_t *) _("By Classes");
- rlabel[i].text_is_1byte = true;
- rgcd[i].gd.label = &rlabel[i];
- rgcd[i].gd.cid = CID_ByClass;
- rgcd[i++].creator = GRadioCreate;
-
- rgcd[i].gd.pos.x = rgcd[i-1].gd.pos.x; rgcd[i].gd.pos.y = rgcd[i-1].gd.pos.y+16;
- rgcd[i].gd.flags = gg_visible | gg_enabled | (fpst->format!=pst_glyphs && fpst->format!=pst_class ? gg_cb_on : 0 );
- rlabel[i].text = (unichar_t *) _("By Coverage");
- rlabel[i].text_is_1byte = true;
- rgcd[i].gd.label = &rlabel[i];
- rgcd[i].gd.cid = CID_ByCoverage;
- rgcd[i].creator = GRadioCreate;
- GGadgetsCreate(ccd->formats,rgcd);
-
-
- ccd->glyphs = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&ggcd,0,sizeof(ggcd));
- memset(&fgcd,0,sizeof(fgcd));
- memset(&glabel,0,sizeof(glabel));
- memset(&flabel,0,sizeof(flabel));
- memset(&faspects,0,sizeof(faspects));
- for ( i=0; i<3; ++i ) {
- k = CCD_AddGlyphList(&ggcd[i][0],&glabel[i][0],(0*100+i*20), 5, 8*13+4 );
-
- if ( i==0 )
- CCD_AddSeqLookup(&ggcd[i][k],&glabel[i][k],(i*20),ggcd[0][k-1].gd.pos.y+ggcd[0][k-1].gd.pos.height+10,
- CCD_WIDTH-20,4*13+10);
- }
-
- j = 0;
-
- faspects[j].text = (unichar_t *) _("Match");
- faspects[j].text_is_1byte = true;
- faspects[j].selected = true;
- faspects[j].gcd = ggcd[j]; ++j;
-
- faspects[j].text = (unichar_t *) _("Backtrack");
- faspects[j].text_is_1byte = true;
- faspects[j].disabled = fpst->type==pst_contextpos || fpst->type==pst_contextsub;
- faspects[j].gcd = ggcd[j]; ++j;
-
- faspects[j].text = (unichar_t *) _("Lookahead");
- faspects[j].text_is_1byte = true;
- faspects[j].disabled = fpst->type==pst_contextpos || fpst->type==pst_contextsub;
- faspects[j].gcd = ggcd[j]; ++j;
-
- flabel[0].text = (unichar_t *) _("A list of glyphs:");
- flabel[0].text_is_1byte = true;
- fgcd[0].gd.label = &flabel[0];
- fgcd[0].gd.pos.x = 5; fgcd[0].gd.pos.y = 5;
- fgcd[0].gd.flags = gg_visible | gg_enabled;
- fgcd[0].creator = GLabelCreate;
-
- fgcd[1].gd.pos.x = 3; fgcd[1].gd.pos.y = 18;
- fgcd[1].gd.pos.width = CCD_WIDTH-10;
- fgcd[1].gd.pos.height = CCD_HEIGHT-60;
- fgcd[1].gd.u.tabs = faspects;
- fgcd[1].gd.flags = gg_visible | gg_enabled;
- fgcd[1].gd.cid = CID_MatchType;
- fgcd[1].creator = GTabSetCreate;
- GGadgetsCreate(ccd->glyphs,fgcd);
-
-
- ccd->coverage = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&clabel,0,sizeof(clabel));
- memset(&cgcd,0,sizeof(cgcd));
-
- for ( i=0; i<3; ++i ) {
- k = CCD_AddGList(&cgcd[i][0],&clabel[i][0],100+i*20,5,
- CCD_WIDTH-20,i==0 ? CCD_HEIGHT-250 : CCD_HEIGHT-150);
-
- if ( i==0 ) {
- if ( ccd->fpst->format!=pst_reversecoverage )
- CCD_AddSeqLookup(&cgcd[i][k],&clabel[i][k],100,cgcd[0][k-1].gd.pos.y+40,
- CCD_WIDTH-20,4*13+10);
- else {
- r = NULL;
- if ( fpst->rule_cnt==1 ) r = &fpst->rules[0];
- CCD_AddReplacements(&cgcd[i][k],&clabel[i][k],r,100,cgcd[0][k-1].gd.pos.y+40);
- }
- }
- faspects[i].gcd = cgcd[i];
- }
- flabel[0].text = (unichar_t *) _("A coverage table:");
- fgcd[1].gd.cid = CID_MatchType+100;
- GGadgetsCreate(ccd->coverage,fgcd);
- if (( fpst->format==pst_coverage || fpst->format==pst_reversecoverage ) &&
- fpst->rule_cnt==1 ) {
- for ( i=0; i<3; ++i ) {
- if ( (&fpst->rules[0].u.coverage.ncnt)[i]!=0 )
- GGadgetSetList(cgcd[i][0].ret,clistlist(fpst,i),false);
- }
- if ( fpst->format==pst_coverage ) {
- GTextInfo **ti = slistlist(&fpst->rules[0]);
- GGadgetSetList(GWidgetGetControl(ccd->gw,CID_LookupList+100),ti,false);
- }
- }
-
- ccd->glist = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&gllabel,0,sizeof(gllabel));
- memset(&glgcd,0,sizeof(glgcd));
-
- k = 0;
- gllabel[k].text = (unichar_t *) _("A list of glyph lists:");
- gllabel[k].text_is_1byte = true;
- glgcd[k].gd.label = &gllabel[k];
- glgcd[k].gd.pos.x = 5; glgcd[k].gd.pos.y = 5;
- glgcd[k].gd.flags = gg_visible | gg_enabled;
- glgcd[k++].creator = GLabelCreate;
-
- k += CCD_AddGList(&glgcd[k],&gllabel[k],0,19,
- CCD_WIDTH-20,CCD_HEIGHT-100);
-
- GGadgetsCreate(ccd->glist,glgcd);
- if ( fpst->format==pst_glyphs && fpst->rule_cnt>0 )
- GGadgetSetList(glgcd[1].ret,glistlist(fpst),false);
-
-
- ccd->cselect = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&cslabel,0,sizeof(cslabel));
- memset(&csgcd,0,sizeof(csgcd));
-
- CCD_AddGlyphList(csgcd,cslabel,100,5,8*13+4);
- GGadgetsCreate(ccd->cselect,csgcd);
-
- ccd->class = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&cllabel,0,sizeof(cllabel));
- memset(&clgcd,0,sizeof(clgcd));
- memset(&clabel,0,sizeof(clabel));
- memset(&cgcd,0,sizeof(cgcd));
-
- k=0;
- cllabel[k].text = (unichar_t *) _("List of lists of class numbers");
- cllabel[k].text_is_1byte = true;
- clgcd[k].gd.label = &cllabel[k];
- clgcd[k].gd.pos.x = 5; clgcd[k].gd.pos.y = 5;
- clgcd[k].gd.flags = gg_visible | gg_enabled;
- clgcd[k++].creator = GLabelCreate;
-
- k += CCD_AddGList(&clgcd[k],&cllabel[k],200,19,
- CCD_WIDTH-20,CCD_HEIGHT-270);
-
- clgcd[k].gd.pos.x = 2; clgcd[k].gd.pos.y = clgcd[k-1].gd.pos.y+30;
- clgcd[k].gd.pos.width = CCD_WIDTH-23;
- clgcd[k].gd.flags = gg_visible | gg_enabled;
- clgcd[k++].creator = GLineCreate;
-
- for ( i=0; i<3; ++i ) {
- int l=0;
- clabel[i][l].text = (unichar_t *) _("Classes (Lists of lists of glyph names)");
- clabel[i][l].text_is_1byte = true;
- cgcd[i][l].gd.label = &clabel[i][l];
- cgcd[i][l].gd.pos.x = 5; cgcd[i][l].gd.pos.y = 5;
- cgcd[i][l].gd.flags = gg_visible | gg_enabled;
- cgcd[i][l++].creator = GLabelCreate;
-
- if ( i!=0 ) {
- clabel[i][l].text = (unichar_t *) _("Same as Match Classes");
- clabel[i][l].text_is_1byte = true;
- cgcd[i][l].gd.label = &clabel[i][l];
- cgcd[i][l].gd.pos.x = 190; cgcd[i][l].gd.pos.y = 7;
- cgcd[i][l].gd.handle_controlevent = CCD_SameAsClasses;
- cgcd[i][l].gd.flags = gg_visible | gg_enabled;
- cgcd[i][l].gd.cid = CID_SameAsClasses + i*20;
- cgcd[i][l++].creator = GCheckBoxCreate;
- }
-
- CCD_AddGList(&cgcd[i][l],&clabel[i][l],300+i*20,cgcd[i][0].gd.pos.y+15,
- CCD_WIDTH-20,CCD_HEIGHT-270);
- faspects[i].gcd = cgcd[i];
- }
- j=0;
- faspects[j++].text = (unichar_t *) _("Match Classes");
- faspects[j++].text = (unichar_t *) _("Back Classes");
- faspects[j++].text = (unichar_t *) _("Ahead Classes");
-
- clgcd[k].gd.pos.x = 3; clgcd[k].gd.pos.y = clgcd[k-1].gd.pos.y+5;
- clgcd[k].gd.pos.width = CCD_WIDTH-10;
- clgcd[k].gd.pos.height = CCD_HEIGHT-185;
- clgcd[k].gd.u.tabs = faspects;
- clgcd[k].gd.flags = gg_visible | gg_enabled;
- clgcd[k].gd.cid = CID_MatchType+300;
- clgcd[k].creator = GTabSetCreate;
- GGadgetsCreate(ccd->class,clgcd);
-
- tempfpst = fpst;
- if ( fpst->format==pst_glyphs && fpst->rule_cnt>0 )
- tempfpst = FPSTGlyphToClass(fpst);
- if ( tempfpst->format==pst_class && tempfpst->rule_cnt>0 ) {
- GGadgetSetList(GWidgetGetControl(ccd->class,CID_GList+200),clslistlist(tempfpst),false);
- for ( i=0; i<3; ++i ) {
- GGadget *list = GWidgetGetControl(ccd->class,CID_GList+300+i*20);
- GListAppendLine8(list,_("{Everything Else}"),false);
- for ( k=1; k<(&tempfpst->nccnt)[i]; ++k ) {
- GListAppendLine8(list,(&tempfpst->nclass)[i][k],false);
- }
- if ( i!=0 && ClassesMatch((&tempfpst->nccnt)[i],(&tempfpst->nclass)[i],tempfpst->nccnt,tempfpst->nclass)) {
- GGadgetSetChecked(GWidgetGetControl(ccd->class,CID_SameAsClasses+i*20),true);
- CCD_SameAsClasses(GWidgetGetControl(ccd->class,CID_SameAsClasses+i*20),NULL);
- }
- }
- if ( tempfpst!=fpst )
- FPSTFree(tempfpst);
- } else {
- for ( i=0; i<3; ++i )
- GListAppendLine8(GWidgetGetControl(ccd->class,CID_GList+300+i*20),
- _("{Everything Else}"),false);
- for ( i=1; i<3; ++i ) {
- GGadgetSetChecked(GWidgetGetControl(ccd->class,CID_SameAsClasses+i*20),true);
- CCD_SameAsClasses(GWidgetGetControl(ccd->class,CID_SameAsClasses+i*20),NULL);
- }
- }
-
- ccd->classbuild = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&cslabel,0,sizeof(cslabel));
- memset(&csgcd,0,sizeof(csgcd));
-
- CCD_AddGlyphList(csgcd,cslabel,300,5,8*13+4);
- GGadgetsCreate(ccd->classbuild,csgcd);
-
- ccd->classnumber = GWidgetCreateSubWindow(ccd->gw,&subpos,subccd_e_h,ccd,&wattrs);
- memset(&clabel,0,sizeof(clabel));
- memset(&cgcd,0,sizeof(cgcd));
- memset(&cllabel,0,sizeof(cllabel));
- memset(&clgcd,0,sizeof(clgcd));
-
- for ( i=0; i<3; ++i ) {
- k=0;
-
- clabel[i][k].text = (unichar_t *) _("List of class numbers");
- clabel[i][k].text_is_1byte = true;
- cgcd[i][k].gd.label = &clabel[i][k];
- cgcd[i][k].gd.pos.x = 5; cgcd[i][k].gd.pos.y = 5;
- cgcd[i][k].gd.flags = gg_visible | gg_enabled;
- cgcd[i][k++].creator = GLabelCreate;
-
- cgcd[i][k].gd.pos.x = 5; cgcd[i][k].gd.pos.y = cgcd[i][k-1].gd.pos.y+14;
- cgcd[i][k].gd.pos.width = CCD_WIDTH-25; cgcd[i][k].gd.pos.height = 4*13+4;
- cgcd[i][k].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
- cgcd[i][k].gd.cid = CID_ClassNumbers+i*20;
- cgcd[i][k++].creator = GTextAreaCreate;
-
- clabel[i][k].text = (unichar_t *) _("Classes");
- clabel[i][k].text_is_1byte = true;
- cgcd[i][k].gd.label = &clabel[i][k];
- cgcd[i][k].gd.pos.x = 5; cgcd[i][k].gd.pos.y = cgcd[i][k-1].gd.pos.y+cgcd[i][k-1].gd.pos.height+5;
- cgcd[i][k].gd.flags = gg_visible | gg_enabled;
- cgcd[i][k++].creator = GLabelCreate;
-
- cgcd[i][k].gd.pos.x = 5; cgcd[i][k].gd.pos.y = cgcd[i][k-1].gd.pos.y+14;
- cgcd[i][k].gd.pos.width = CCD_WIDTH-25; cgcd[i][k].gd.pos.height = 4*13+10;
- cgcd[i][k].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
- cgcd[i][k].gd.handle_controlevent = CCD_ClassSelected;
- cgcd[i][k].gd.cid = CID_ClassList+i*20;
- cgcd[i][k++].creator = GListCreate;
-
- if ( i==0 )
- CCD_AddSeqLookup(&cgcd[i][k],&clabel[i][k],500,cgcd[0][k-1].gd.pos.y+cgcd[0][k-1].gd.pos.height+5,
- CCD_WIDTH-20,4*13+10);
- faspects[i].gcd = cgcd[i];
- }
-
- j=0;
- faspects[j++].text = (unichar_t *) _("Match");
- faspects[j++].text = (unichar_t *) _("Backtrack");
- faspects[j++].text = (unichar_t *) _("Lookahead");
-
- k=0;
- clgcd[k].gd.pos.x = 3; clgcd[k].gd.pos.y = 5;
- clgcd[k].gd.pos.width = CCD_WIDTH-10;
- clgcd[k].gd.pos.height = CCD_HEIGHT-45;
- clgcd[k].gd.u.tabs = faspects;
- clgcd[k].gd.flags = gg_visible | gg_enabled;
- clgcd[k].gd.cid = CID_ClassType;
- clgcd[k].creator = GTabSetCreate;
- GGadgetsCreate(ccd->classnumber,clgcd);
-
-
- if ( ccd->aw == aw_formats )
- GDrawSetVisible(ccd->formats,true);
- else if ( ccd->aw == aw_glist )
- GDrawSetVisible(ccd->glist,true);
- else if ( ccd->aw == aw_class )
- GDrawSetVisible(ccd->class,true);
- else
- GDrawSetVisible(ccd->coverage,true);
-
- GDrawSetVisible(gw,true);
-#endif
-return( ccd );
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/descrip.mms b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/descrip.mms
deleted file mode 100644
index 78a390c14f9..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/descrip.mms
+++ /dev/null
@@ -1,197 +0,0 @@
-CFLAGS=/nowarn/incl=([-.inc])/name=(as_is,short)/define=(\
- "_STATIC_LIBFREETYPE=1","_STATIC_LIBPNG=1","HAVE_LIBINTL_H=1",\
- "_STATIC_LIBUNINAMESLIST=1","_STATIC_LIBXML=1","_NO_XINPUT=1",\
- "_STATIC_LIBUNGIF=1","_STATIC_LIBJPEG=1","_STATIC_LIBTIFF=1",\
- "_NO_PYTHON=1",\
- "FONTFORGE_CONFIG_DEVICETABLES=1","PLUGINDIR=""/FONTFORGE$PLUGINS""")
-
-fontforge_OBJECTS = alignment.obj,autohint.obj,autosave.obj,autowidth.obj,\
- bitmapdlg.obj,metafont.obj,parsettfbmf.obj,\
- bitmapview.obj,bvedit.obj,charview.obj,cursors.obj
-
-fontforge_OBJECTS1=cvaddpoints.obj,cvexport.obj,cvgetinfo.obj,cvhints.obj,cvimages.obj,cvknife.obj,\
-cvpalettes.obj,cvpointer.obj,cvruler.obj,cvshapes.obj,cvstroke.obj,cvtranstools.obj
-
-fontforge_OBJECTS2=cvundoes.obj,dumpbdf.obj,dumppfa.obj,fontinfo.obj,fontview.obj,fvcomposit.obj,\
- fvfonts.obj,fvimportbdf.obj,fvmetrics.obj,images.obj,metricsview.obj,\
- parsepfa.obj,parsettf.obj,prefs.obj,psread.obj,namelist.obj,savefontdlg.obj
-
-fontforge_OBJECTS3=sfd.obj,splashimage.obj,splinefill.obj,splineoverlap.obj,splinesave.obj,\
- splinesaveafm.obj,splinestroke.obj,splineutil.obj,splineutil2.obj,stamp.obj,\
- start.obj,tottf.obj,transform.obj,uiutil.obj,utils.obj,windowmenu.obj
-
-fontforge_OBJECTS4=zapfnomen.obj,othersubrs.obj,autotrace.obj,openfontdlg.obj,encoding.obj,print.obj,\
- problems.obj,crctab.obj,macbinary.obj,scripting.obj
-
-fontforge_OBJECTS5=displayfonts.obj,combinations.obj,sftextfield.obj,ikarus.obj,\
- cvfreehand.obj,cvhand.obj,simplifydlg.obj,winfonts.obj,freetype.obj,\
- gotodlg.obj,search.obj,tottfgpos.obj,charinfo.obj,tottfaat.obj
-
-fontforge_OBJECTS6=splineorder2.obj,genttfinstrs.obj,ttfinstrs.obj,cvgridfit.obj,\
- cvdebug.obj,showatt.obj,kernclass.obj,nonlineartrans.obj,effects.obj,\
- histograms.obj,ttfspecial.obj,svg.obj,parsettfatt.obj,contextchain.obj
-
-fontforge_OBJECTS7=macenc.obj,statemachine.obj,splinerefigure.obj,mm.obj,\
- parsettfvar.obj,tottfvar.obj,pua.obj,stemdb.obj,anchorsaway.obj,\
- palmfonts.obj,cvdgloss.obj,groups.obj,parsepdf.obj,plugins.obj
-
-fontforge_OBJECTS8=bdfinfo.obj,glyphcomp.obj,unicoderange.obj,ufo.obj,\
- ofl.obj,lookups.obj,sfd1.obj,python.obj,featurefile.obj
-
-fontforge.exe : main.obj lff.opt xlib.opt [-.libs]libfontforge.exe
- link/exec=fontforge.exe main,lff/opt,[-.libs]LIBGDRAW/lib,\
- LIBGUNICODE/lib,[]xlib.opt/opt
-
-[-.libs]libfontforge.exe : $(fontforge_OBJECTS) $(fontforge_OBJECTS1)\
- $(fontforge_OBJECTS2) $(fontforge_OBJECTS3) $(fontforge_OBJECTS4)\
- $(fontforge_OBJECTS5) $(fontforge_OBJECTS6) $(fontforge_OBJECTS7)\
- $(fontforge_OBJECTS8) [-.libs]LIBGDRAW.olb [-.libs]LIBGUNICODE.olb
- @ WRITE_ SYS$OUTPUT " generating lff1.opt"
- @ OPEN_/WRITE FILE lff1.opt
- @ WRITE_ FILE "!"
- @ WRITE_ FILE "! lff1.opt generated by DESCRIP.$(MMS_EXT)"
- @ WRITE_ FILE "!"
- @ WRITE_ FILE "IDENTIFICATION=""lff"""
- @ WRITE_ FILE "GSMATCH=LEQUAL,1,0
- @ WRITE_ FILE "$(fontforge_OBJECTS)"
- @ WRITE_ FILE "$(fontforge_OBJECTS1)"
- @ WRITE_ FILE "$(fontforge_OBJECTS2)"
- @ WRITE_ FILE "$(fontforge_OBJECTS3)"
- @ WRITE_ FILE "$(fontforge_OBJECTS4)"
- @ WRITE_ FILE "$(fontforge_OBJECTS5)"
- @ WRITE_ FILE "$(fontforge_OBJECTS6)"
- @ WRITE_ FILE "$(fontforge_OBJECTS7)"
- @ WRITE_ FILE "$(fontforge_OBJECTS8)"
- @ CLOSE_ FILE
- @ $(MMS)$(MMSQUALIFIERS)/ignore=warning lff_vms
- @ WRITE_ SYS$OUTPUT " linking libfontforge.exe ..."
- @ LINK_/NODEB/SHARE=[-.libs]libfontforge.exe/MAP=lff.map/FULL lff1.opt/opt,\
- lff_vms.opt/opt,[-.libs]LIBGDRAW/lib,LIBGUNICODE/lib,\
- [-.fontforge]xlib.opt/opt
-
-lff_vms :
- @ WRITE_ SYS$OUTPUT " generating lff.map ..."
- @ LINK_/NODEB/NOSHARE/NOEXE/MAP=lff.map/FULL lff1.opt/OPT
- @ WRITE_ SYS$OUTPUT " analyzing lff.map ..."
- @ @[-.plugins]ANALYZE_MAP.COM lff.map lff_vms.opt
-
-alignment.obj : alignment.c
-autohint.obj : autohint.c
-autosave.obj : autosave.c
-autowidth.obj : autowidth.c
-bitmapdlg.obj : bitmapdlg.c
-metafont.obj : metafont.c
-parsettfbmf.obj : parsettfbmf.c
-bitmapview.obj : bitmapview.c
-bvedit.obj : bvedit.c
-charview.obj : charview.c
-cursors.obj : cursors.c
-cvaddpoints.obj : cvaddpoints.c
-cvexport.obj : cvexport.c
-cvgetinfo.obj : cvgetinfo.c
-cvhints.obj : cvhints.c
-cvimages.obj : cvimages.c
-cvknife.obj : cvknife.c
-cvpalettes.obj : cvpalettes.c
-cvpointer.obj : cvpointer.c
-cvruler.obj : cvruler.c
-cvshapes.obj : cvshapes.c
-cvstroke.obj : cvstroke.c
-cvtranstools. : cvtranstools.c
-cvundoes.obj : cvundoes.c
-dumpbdf.obj : dumpbdf.c
-dumppfa.obj : dumppfa.c
-fontinfo.obj : fontinfo.c
-fontview.obj : fontview.c
-fvcomposit.obj : fvcomposit.c
-fvfonts.obj : fvfonts.c
-fvimportbdf.obj : fvimportbdf.c
-fvmetrics.obj : fvmetrics.c
-images.obj : images.c
-metricsview.obj : metricsview.c
-parsepfa.obj : parsepfa.c
-parsettf.obj : parsettf.c
-prefs.obj : prefs.c
-psread.obj : psread.c
-namelist.obj : namelist.c
-savefontdlg.ob : savefontdlg.c
-sfd.obj : sfd.c
-splashimage.obj : splashimage.c
-splinefill.obj : splinefill.c
-splineoverlap.obj : splineoverlap.c
-splinesave.obj : splinesave.c
-splinesaveafm.obj : splinesaveafm.c
-splinestroke.obj : splinestroke.c
-splineutil.obj : splineutil.c
-splineutil2.obj : splineutil2.c
-stamp.obj : stamp.c
-start.obj : start.c
-tottf.obj : tottf.c
- $(CC) $(CFLAGS)/noop tottf
-transform.obj : transform.c
-uiutil.obj : uiutil.c
-utils.obj : utils.c
-windowmenu.obj : windowmenu.c
-zapfnomen.obj : zapfnomen.c
-othersubrs.obj : othersubrs.c
-autotrace.obj : autotrace.c
-openfontdlg.obj : openfontdlg.c
-encoding.obj : encoding.c
-print.ob : print.c
-problems.obj : problems.c
-crctab.obj : crctab.c
-macbinary.obj : macbinary.c
-scripting.obj : scripting.c
-displayfonts.obj : displayfonts.c
-combinations.obj : combinations.c
-sftextfield.obj : sftextfield.c
-ikarus.obj : ikarus.c
-cvfreehand.obj : cvfreehand.c
-cvhand.obj : cvhand.c
-simplifydlg.obj : simplifydlg.c
-winfonts.obj : winfonts.c
-freetype.obj : freetype.c
-gotodlg.obj : gotodlg.c
-search.obj : search.c
-tottfgpos.obj : tottfgpos.c
-charinfo.obj : charinfo.c
-tottfaat.obj : tottfaat.c
- $(CC) $(CFLAGS)/noop tottfaat
-splineorder2.obj : splineorder2.c
-genttfinstrs.obj : genttfinstrs.c
-ttfinstrs.obj : ttfinstrs.c
-cvgridfit.obj : cvgridfit.c
-cvdebug.obj : cvdebug.c
-showatt.obj : showatt.c
-kernclass.obj : kernclass.c
-nonlineartrans.obj : nonlineartrans.c
-effects.obj : effects.c
-histograms.obj : histograms.c
-ttfspecial.obj : ttfspecial.c
-svg.obj : svg.c
-parsettfatt.obj : parsettfatt.c
-contextchain.obj : contextchain.c
-macenc.obj : macenc.c
-statemachine.obj : statemachine.c
-splinerefigure.obj : splinerefigure.c
-mm.obj : mm.c
-parsettfvar.obj : parsettfvar.c
-tottfvar.obj : tottfvar.c
-pua.obj : pua.c
-stemdb.obj : stemdb.c
-anchorsaway.obj : anchorsaway.c
-palmfonts.obj : palmfonts.c
-cvdgloss.obj : cvdgloss.c
-groups.obj : groups.c
-parsepdf.obj : parsepdf.c
-plugins.obj : plugins.c
-main.obj : main.c
-bdfinfo.obj : bdfinfo.c
-glyphcomp.obj : glyphcomp.c
-unicoderange.obj : unicoderange.c
-ufo.obj : ufo.c
-ofl.obj : ofl.c
-lookups.obj : lookups.c
-sfd1.obj : sfd1.c
-python.obj : python.c
-featurefile.obj : featurefile.c
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/encoding.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/encoding.c
deleted file mode 100644
index 439382bbd1d..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/encoding.c
+++ /dev/null
@@ -1,3093 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "pfaeditui.h"
-#include <ustring.h>
-#include <utype.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <gfile.h>
-#include <gio.h>
-#include <gresource.h>
-#include "plugins.h"
-
-#ifdef LUA_FF_LIB
-/* no need for iconv here, since PS is 8-bit legacy */
-#define Isspace(a) ((a)==' '|| ((a) >= '\t' && (a) <= '\r'))
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#define Isalpha(a) (((a)>='a' && (a)<='z') || ((a)>='A' && (a)<='Z'))
-#define Isupper(a) ((a)>='A' && (a)<='Z')
-#define Isalnum(a) (Isalpha(a)||Isdigit(a))
-#define Ishexdigit(a) (((a)>='0' && (a)<='9')||((a)>='a' && (a)<='f')||((a)>='A' && (a)<='F'))
-extern void gwwv_post_error(char *a, ...);
-#else
-#define Isspace isspace
-#define Isdigit isdigit
-#define Isalpha isalpha
-#define Isupper isupper
-#define Isalnum isalnum
-#define Ishexdigit ishexdigit
-#endif
-
-
-
-static int32 tex_base_encoding[] = {
- 0x0000, 0x02d9, 0xfb01, 0xfb02, 0x2044, 0x02dd, 0x0141, 0x0142,
- 0x02db, 0x02da, 0x000a, 0x02d8, 0x2212, 0x000d, 0x017d, 0x017e,
- 0x02c7, 0x0131, 0xf6be, 0xfb00, 0xfb03, 0xfb04, 0x2260, 0x221e,
- 0x2264, 0x2265, 0x2202, 0x2211, 0x220f, 0x03c0, 0x0060, 0x0027,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2019,
- 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
- 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- 0x2018, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
- 0x20ac, 0x222b, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
- 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x2126, 0x221a, 0x2248,
- 0x0090, 0x0091, 0x0092, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
- 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x2206, 0x25ca, 0x0178,
- 0x0000, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
- 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x002d, 0x00ae, 0x00af,
- 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
- 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
- 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
- 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
- 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
- 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
- 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
- 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
-};
-
-static int32 unicode_from_MacSymbol[] = {
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
- 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
- 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
- 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220d,
- 0x0028, 0x0029, 0x2217, 0x002b, 0x002c, 0x2212, 0x002e, 0x002f,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- 0x2245, 0x0391, 0x0392, 0x03a7, 0x0394, 0x0395, 0x03a6, 0x0393,
- 0x0397, 0x0399, 0x03d1, 0x039a, 0x039b, 0x039c, 0x039d, 0x039f,
- 0x03a0, 0x0398, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03c2, 0x03a9,
- 0x039e, 0x03a8, 0x0396, 0x005b, 0x2234, 0x005d, 0x22a5, 0x005f,
- 0xf8e5, 0x03b1, 0x03b2, 0x03c7, 0x03b4, 0x03b5, 0x03c6, 0x03b3,
- 0x03b7, 0x03b9, 0x03d5, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf,
- 0x03c0, 0x03b8, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03d6, 0x03c9,
- 0x03be, 0x03c8, 0x03b6, 0x007b, 0x007c, 0x007d, 0x223c, 0x007f,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
- 0x0000, 0x03d2, 0x2032, 0x2264, 0x2044, 0x221e, 0x0192, 0x2663,
- 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193,
- 0x00b0, 0x00b1, 0x2033, 0x2265, 0x00d7, 0x221d, 0x2202, 0x2022,
- 0x00f7, 0x2260, 0x2261, 0x2248, 0x2026, 0xf8e6, 0xf8e7, 0x21b5,
- 0x2135, 0x2111, 0x211c, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229,
- 0x222a, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209,
- 0x2220, 0x2207, 0x00ae, 0x00a9, 0x2122, 0x220f, 0x221a, 0x22c5,
- 0x00ac, 0x2227, 0x2228, 0x21d4, 0x21d0, 0x21d1, 0x21d2, 0x21d3,
- 0x22c4, 0x2329, 0xf8e8, 0xf8e9, 0xf8ea, 0x2211, 0xf8eb, 0xf8ec,
- 0xf8ed, 0xf8ee, 0xf8ef, 0xf8f0, 0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4,
- 0xf8ff, 0x232a, 0x222b, 0x2320, 0xf8f5, 0x2321, 0xf8f6, 0xf8f7,
- 0xf8f8, 0xf8f9, 0xf8fa, 0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0x02c7
-};
-
-/* I don't think iconv provides encodings for zapfdingbats nor jis201 */
-/* Perhaps I should list them here for compatability, but I think I'll just */
-/* leave them out. I doubt they get used. */
-static Encoding texbase = { "TeX-Base-Encoding", 256, tex_base_encoding, NULL, NULL, 1, 1, 1, 1 };
- Encoding custom = { "Custom", 0, NULL, NULL, &texbase, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0 };
-static Encoding original = { "Original", 0, NULL, NULL, &custom, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0 };
-static Encoding unicodebmp = { "UnicodeBmp", 65536, NULL, NULL, &original, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0 };
-static Encoding unicodefull = { "UnicodeFull", 17*65536, NULL, NULL, &unicodebmp, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0 };
-static Encoding adobestd = { "AdobeStandard", 256, unicode_from_adobestd, AdobeStandardEncoding, &unicodefull,
- 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };
-static Encoding symbol = { "Symbol", 256, unicode_from_MacSymbol, NULL, &adobestd,1, 1, 1, 1, 0, 0, 0, 0, 0, 0 };
-
-Encoding *enclist = &symbol;
-
-const char *FindUnicharName(void) {
- /* Iconv and libiconv use different names for UCS2. Just great. Perhaps */
- /* different versions of each use still different names? */
- /* Even worse, both accept UCS-2, but under iconv it means native byte */
- /* ordering and under libiconv it means big-endian */
- iconv_t test;
- static char *goodname = NULL;
-#ifdef UNICHAR_16
- static char *names[] = { "UCS-2", "UCS-2-INTERNAL", "UCS2", "ISO-10646/UCS2", "UNICODE", NULL };
- static char *namesle[] = { "UCS-2LE", "UNICODELITTLE", NULL };
- static char *namesbe[] = { "UCS-2BE", "UNICODEBIG", NULL };
-#else
- static char *names[] = { "UCS-4", "UCS-4-INTERNAL", "UCS4", "ISO-10646-UCS-4", "UTF-32", NULL };
- static char *namesle[] = { "UCS-4LE", "UTF-32LE", NULL };
- static char *namesbe[] = { "UCS-4BE", "UTF-32BE", NULL };
-#endif
- char **testnames;
- int i;
- union {
- short s;
- char c[2];
- } u;
-
- if ( goodname!=NULL )
-return( goodname );
-
- u.c[0] = 0x1; u.c[1] = 0x2;
- if ( u.s==0x201 ) { /* Little endian */
- testnames = namesle;
- } else {
- testnames = namesbe;
- }
- for ( i=0; testnames[i]!=NULL; ++i ) {
- test = iconv_open(testnames[i],"ISO-8859-1");
- if ( test!=(iconv_t) -1 && test!=NULL ) {
- iconv_close(test);
- goodname = testnames[i];
- break;
- }
- }
-
- if ( goodname==NULL ) {
- for ( i=0; names[i]!=NULL; ++i ) {
- test = iconv_open(names[i],"ISO-8859-1");
- if ( test!=(iconv_t) -1 && test!=NULL ) {
- iconv_close(test);
- goodname = names[i];
- break;
- }
- }
- }
-
- if ( goodname==NULL ) {
-#ifdef UNICHAR_16
- IError( "I can't figure out your version of iconv(). I need a name for the UCS-2 encoding and I can't find one. Reconfigure --without-iconv. Bye.");
-#else
- IError( "I can't figure out your version of iconv(). I need a name for the UCS-4 encoding and I can't find one. Reconfigure --without-iconv. Bye.");
-#endif
- exit( 1 );
- }
-
- test = iconv_open(names[i],"Mac");
- if ( test==(iconv_t) -1 || test==NULL ) {
- IError( "Your version of iconv does not support the \"Mac Roman\" encoding.\nIf this causes problems, reconfigure --without-iconv." );
- } else
- iconv_close(test);
-
- /* I really should check for ISO-2022-JP, KR, CN, and all the other encodings */
- /* I might find in a ttf 'name' table. But those tables take too long to build */
-return( goodname );
-}
-
-static int TryEscape( Encoding *enc,char *escape_sequence ) {
- char from[20], ucs[20];
- size_t fromlen, tolen;
- ICONV_CONST char *fpt;
- char *upt;
- int i, j, low;
- int esc_len = strlen(escape_sequence);
-
- strcpy(from,escape_sequence);
-
- enc->has_2byte = false;
- low = -1;
- for ( i=0; i<256; ++i ) if ( i!=escape_sequence[0] ) {
- for ( j=0; j<256; ++j ) {
- from[esc_len] = i; from[esc_len+1] = j; from[esc_len+2] = 0;
- fromlen = esc_len+2;
- fpt = from;
- upt = ucs;
- tolen = sizeof(ucs);
- if ( iconv( enc->tounicode , &fpt, &fromlen, &upt, &tolen )!= (size_t) (-1) &&
- upt-ucs==sizeof(unichar_t) /* Exactly one character */ ) {
- if ( low==-1 ) {
- enc->low_page = low = i;
- enc->has_2byte = true;
- }
- enc->high_page = i;
- break;
- }
- }
- }
- if ( enc->low_page==enc->high_page )
- enc->has_2byte = false;
- if ( enc->has_2byte ) {
- strcpy(enc->iso_2022_escape, escape_sequence);
- enc->iso_2022_escape_len = esc_len;
- }
-return( enc->has_2byte );
-}
-
-Encoding *_FindOrMakeEncoding(const char *name,int make_it) {
- Encoding *enc;
- char buffer[20];
- const char *iconv_name;
- Encoding temp;
- uint8 good[256];
- int i, j, any, all;
- char from[8], ucs[20];
- size_t fromlen, tolen;
- ICONV_CONST char *fpt;
- char *upt;
- /* iconv is not case sensitive */
-
- if ( strncasecmp(name,"iso8859_",8)==0 || strncasecmp(name,"koi8_",5)==0 ) {
- /* Fixup for old naming conventions */
- strncpy(buffer,name,sizeof(buffer));
- *strchr(buffer,'_') = '-';
- name = buffer;
- } else if ( strcasecmp(name,"iso-8859")==0 ) {
- /* Fixup for old naming conventions */
- strncpy(buffer,name,3);
- strncpy(buffer+3,name+4,sizeof(buffer)-3);
- name = buffer;
- } else if ( strcasecmp(name,"isolatin1")==0 ) {
- name = "iso8859-1";
- } else if ( strcasecmp(name,"isocyrillic")==0 ) {
- name = "iso8859-5";
- } else if ( strcasecmp(name,"isoarabic")==0 ) {
- name = "iso8859-6";
- } else if ( strcasecmp(name,"isogreek")==0 ) {
- name = "iso8859-7";
- } else if ( strcasecmp(name,"isohebrew")==0 ) {
- name = "iso8859-8";
- } else if ( strcasecmp(name,"isothai")==0 ) {
- name = "tis-620"; /* TIS doesn't define non-breaking space in 0xA0 */
- } else if ( strcasecmp(name,"latin0")==0 || strcasecmp(name,"latin9")==0 ) {
- name = "iso8859-15"; /* "latin-9" is supported (libiconv bug?) */
- } else if ( strcasecmp(name,"koi8r")==0 ) {
- name = "koi8-r";
- } else if ( strncasecmp(name,"jis201",6)==0 || strncasecmp(name,"jisx0201",8)==0 ) {
- name = "jis_x0201";
- } else if ( strcasecmp(name,"AdobeStandardEncoding")==0 || strcasecmp(name,"Adobe")==0 )
- name = "AdobeStandard";
- for ( enc=enclist; enc!=NULL; enc=enc->next )
- if ( strmatch(name,enc->enc_name)==0 ||
- (enc->iconv_name!=NULL && strmatch(name,enc->iconv_name)==0))
-return( enc );
- if ( strmatch(name,"unicode")==0 || strmatch(name,"iso10646")==0 || strmatch(name,"iso10646-1")==0 )
-return( &unicodebmp );
- if ( strmatch(name,"unicode4")==0 || strmatch(name,"ucs4")==0 )
-return( &unicodefull );
-
- iconv_name = name;
- /* Mac seems to work ok */
- if ( strcasecmp(name,"win")==0 || strcasecmp(name,"ansi")==0 )
- iconv_name = "MS-ANSI"; /* "WINDOWS-1252";*/
- else if ( strncasecmp(name,"jis208",6)==0 || strncasecmp(name,"jisx0208",8)==0 )
- iconv_name = "ISO-2022-JP";
- else if ( strncasecmp(name,"jis212",6)==0 || strncasecmp(name,"jisx0212",8)==0 )
- iconv_name = "ISO-2022-JP-2";
- else if ( strncasecmp(name,"ksc5601",7)==0 )
- iconv_name = "ISO-2022-KR";
- else if ( strcasecmp(name,"gb2312pk")==0 || strcasecmp(name,"gb2312packed")==0 )
- iconv_name = "EUC-CN";
- else if ( strncasecmp(name,"gb2312",6)==0 )
- iconv_name = "ISO-2022-CN";
- else if ( strcasecmp(name,"wansung")==0 )
- iconv_name = "EUC-KR";
- else if ( strcasecmp(name,"EUC-CN")==0 ) {
- iconv_name = name;
- name = "gb2312pk";
- } else if ( strcasecmp(name,"EUC-KR")==0 ) {
- iconv_name = name;
- name = "wansung";
- }
-
-/* Escape sequences: */
-/* ISO-2022-CN: \e $ ) A ^N */
-/* ISO-2022-KR: \e $ ) C ^N */
-/* ISO-2022-JP: \e $ B */
-/* ISO-2022-JP-2: \e $ ( D */
-/* ISO-2022-JP-3: \e $ ( O */ /* Capital "O", not zero */
-/* ISO-2022-CN-EXT: \e $ ) E ^N */ /* Not sure about this, also uses CN escape */
-
- memset(&temp,0,sizeof(temp));
- temp.builtin = true;
- temp.tounicode = iconv_open(FindUnicharName(),iconv_name);
- if ( temp.tounicode==(iconv_t) -1 || temp.tounicode==NULL )
-return( NULL ); /* Iconv doesn't recognize this name */
- temp.fromunicode = iconv_open(iconv_name,FindUnicharName());
- if ( temp.fromunicode==(iconv_t) -1 || temp.fromunicode==NULL ) {
- /* This should never happen, but if it does... */
- iconv_close(temp.tounicode);
-return( NULL );
- }
-
- memset(good,0,sizeof(good));
- any = false; all = true;
- for ( i=1; i<256; ++i ) {
- from[0] = i; from[1] = 0;
- fromlen = 1;
- fpt = from;
- upt = ucs;
- tolen = sizeof(ucs);
- if ( iconv( temp.tounicode , &fpt, &fromlen, &upt, &tolen )!= (size_t) (-1)) {
- good[i] = true;
- any = true;
- } else
- all = false;
- }
- if ( any )
- temp.has_1byte = true;
- if ( all )
- temp.only_1byte = true;
-
- if ( !all ) {
- if ( strstr(iconv_name,"2022")==NULL ) {
- for ( i=temp.has_1byte; i<256; ++i ) if ( !good[i] ) {
- for ( j=0; j<256; ++j ) {
- from[0] = i; from[1] = j; from[2] = 0;
- fromlen = 2;
- fpt = from;
- upt = ucs;
- tolen = sizeof(ucs);
- if ( iconv( temp.tounicode , &fpt, &fromlen, &upt, &tolen )!= (size_t) (-1) &&
- upt-ucs==sizeof(unichar_t) /* Exactly one character */ ) {
- if ( temp.low_page==-1 )
- temp.low_page = i;
- temp.high_page = i;
- temp.has_2byte = true;
- break;
- }
- }
- }
- if ( temp.low_page==temp.high_page ) {
- temp.has_2byte = false;
- temp.low_page = temp.high_page = -1;
- }
- }
- if ( !temp.has_2byte && !good[033]/* escape */ ) {
- if ( strstr(iconv_name,"2022")!=NULL &&
- strstr(iconv_name,"JP3")!=NULL &&
- TryEscape( &temp,"\33$(O" ))
- ;
- else if ( strstr(iconv_name,"2022")!=NULL &&
- strstr(iconv_name,"JP2")!=NULL &&
- TryEscape( &temp,"\33$(D" ))
- ;
- else if ( strstr(iconv_name,"2022")!=NULL &&
- strstr(iconv_name,"JP")!=NULL &&
- TryEscape( &temp,"\33$B" ))
- ;
- else if ( strstr(iconv_name,"2022")!=NULL &&
- strstr(iconv_name,"KR")!=NULL &&
- TryEscape( &temp,"\33$)C\16" ))
- ;
- else if ( strstr(iconv_name,"2022")!=NULL &&
- strstr(iconv_name,"CN")!=NULL &&
- TryEscape( &temp,"\33$)A\16" ))
- ;
- }
- }
- if ( !temp.has_1byte && !temp.has_2byte )
-return( NULL );
- if ( !make_it )
-return( NULL );
-
- enc = chunkalloc(sizeof(Encoding));
- *enc = temp;
- enc->enc_name = copy(name);
- if ( iconv_name!=name )
- enc->iconv_name = copy(iconv_name);
- enc->next = enclist;
- enc->builtin = true;
- enclist = enc;
- if ( enc->has_2byte )
- enc->char_cnt = (enc->high_page<<8) + 256;
- else {
- enc->char_cnt = 256;
- enc->only_1byte = true;
- }
- if ( strstrmatch(iconv_name,"JP")!=NULL ||
- strstrmatch(iconv_name,"sjis")!=NULL ||
- strstrmatch(iconv_name,"cp932")!=NULL )
- enc->is_japanese = true;
- else if ( strstrmatch(iconv_name,"KR")!=NULL )
- enc->is_korean = true;
- else if ( strstrmatch(iconv_name,"CN")!=NULL )
- enc->is_simplechinese = true;
- else if ( strstrmatch(iconv_name,"BIG")!=NULL && strstrmatch(iconv_name,"5")!=NULL )
- enc->is_tradchinese = true;
-
- if ( strstrmatch(name,"ISO8859")!=NULL &&
- strtol(name+strlen(name)-2,NULL,10)>=16 )
- /* Not in our menu, don't hide */;
- else if ( iconv_name!=name || strmatch(name,"mac")==0 || strstrmatch(name,"ISO8859")!=NULL ||
- strmatch(name,"koi8-r")==0 || strmatch(name,"sjis")==0 ||
- strmatch(name,"big5")==0 || strmatch(name,"big5hkscs")==0 )
- enc->hidden = true;
-
-return( enc );
-}
-
-Encoding *FindOrMakeEncoding(const char *name) {
-return( _FindOrMakeEncoding(name,true));
-}
-
-/* Plugin API */
-int AddEncoding(char *name,EncFunc enc_to_uni,EncFunc uni_to_enc,int max) {
- Encoding *enc;
- int i;
-
- for ( enc=enclist; enc!=NULL; enc=enc->next ) {
- if ( strmatch(name,enc->enc_name)==0 ||
- (enc->iconv_name!=NULL && strmatch(name,enc->iconv_name)==0)) {
- if ( enc->tounicode_func==NULL )
-return( 0 ); /* Failure */
- else {
- enc->tounicode_func = enc_to_uni;
- enc->fromunicode_func = uni_to_enc;
- enc->char_cnt = max;
-return( 2 );
- }
- }
- }
-
- if ( strmatch(name,"unicode")==0 || strmatch(name,"iso10646")==0 || strmatch(name,"iso10646-1")==0 )
-return( 0 ); /* Failure */
- if ( strmatch(name,"unicode4")==0 || strmatch(name,"ucs4")==0 )
-return( 0 ); /* Failure */
-
- enc = chunkalloc(sizeof(Encoding));
- enc->enc_name = copy(name);
- enc->next = enclist;
- enclist = enc;
- enc->tounicode_func = enc_to_uni;
- enc->fromunicode_func = uni_to_enc;
- enc->char_cnt = max;
- for ( i=0; i<256 && i<max; ++i )
- if ( enc_to_uni(i)!=-1 )
- break;
-
- if ( i<256 && i<max )
- enc->has_1byte = true;
- if ( max<256 )
- enc->only_1byte = true;
- else
- enc->has_2byte = true;
-return( 1 );
-}
-
-static char *getPfaEditEncodings(void) {
- static char *encfile=NULL;
- char buffer[1025];
-
- if ( encfile!=NULL )
-return( encfile );
- if ( getPfaEditDir(buffer)==NULL )
-return( NULL );
- sprintf(buffer,"%s/Encodings.ps", getPfaEditDir(buffer));
- encfile = copy(buffer);
-return( encfile );
-}
-
-static void EncodingFree(Encoding *item) {
- int i;
-
- free(item->enc_name);
- if ( item->psnames!=NULL ) for ( i=0; i<item->char_cnt; ++i )
- free(item->psnames[i]);
- free(item->psnames);
- free(item->unicode);
- free(item);
-}
-
-/* Parse a TXT file from the unicode consortium */
- /* Unicode Consortium Format A */
- /* List of lines with several fields, */
- /* first is the encoding value (in hex), second the Unicode value (in hex) */
- /* # is a comment character (to eol) */
-static Encoding *ParseConsortiumEncodingFile(FILE *file) {
- char buffer[200];
- int32 encs[1024];
- int enc, unienc, max, i;
- Encoding *item;
-
- for ( i=0; i<1024; ++i )
- encs[i] = 0;
- for ( i=0; i<32; ++i )
- encs[i] = i;
- for ( i=127; i<0xa0; ++i )
- encs[i] = i;
- max = -1;
-
- while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
- if ( Ishexdigit(buffer[0]) ) {
- if ( sscanf(buffer, "%x %x", (unsigned *) &enc, (unsigned *) &unienc)==2 &&
- enc<1024 && enc>=0 ) {
- encs[enc] = unienc;
- if ( enc>max ) max = enc;
- }
- }
- }
-
- if ( max==-1 )
-return( NULL );
-
- ++max;
- if ( max<256 ) max = 256;
- item = gcalloc(1,sizeof(Encoding));
- item->only_1byte = item->has_1byte = true;
- item->char_cnt = max;
- item->unicode = galloc(max*sizeof(int32));
- memcpy(item->unicode,encs,max*sizeof(int32));
-return( item );
-}
-
-static void DeleteEncoding(Encoding *me);
-
-static void RemoveMultiples(Encoding *item) {
- Encoding *test;
-
- for ( test=enclist; test!=NULL; test = test->next ) {
- if ( strcmp(test->enc_name,item->enc_name)==0 )
- break;
- }
- if ( test!=NULL )
- DeleteEncoding(test);
-}
-
-void ParseEncodingFile(char *filename) {
- FILE *file;
- char *orig = filename;
- Encoding *head, *item, *prev, *next;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- char buf[300];
- char *name;
-#endif
- int i,ch;
- file = NULL;
- if ( filename==NULL ) filename = getPfaEditEncodings();
- if ( filename!=NULL ) file = fopen(filename,"r");
- if ( file==NULL ) {
- if ( orig!=NULL )
- gwwv_post_error(_("Couldn't open file"), _("Couldn't open file %.200s"), orig);
-return;
- }
- ch = getc(file);
- if ( ch==EOF ) {
- fclose(file);
-return;
- }
- ungetc(ch,file);
- if ( ch=='#' || ch=='0' )
- head = ParseConsortiumEncodingFile(file);
- else
- head = PSSlurpEncodings(file);
- fclose(file);
- if ( head==NULL ) {
- gwwv_post_error(_("Bad encoding file format"),_("Bad encoding file format") );
-return;
- }
-
- for ( i=0, prev=NULL, item=head; item!=NULL; prev = item, item=next, ++i ) {
- next = item->next;
- if ( item->enc_name==NULL ) {
- if ( no_windowing_ui ) {
- gwwv_post_error(_("Bad encoding file format"),_("This file contains an unnamed encoding, which cannot be named in a script"));
-return;
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( item==head && item->next==NULL )
- strcpy(buf,_("Please name this encoding"));
- else {
-# if defined( _NO_SNPRINTF ) || defined( __VMS )
- if ( i<=3 )
- sprintf(buf,
- _("Please name the %s encoding in this file"),
- i==1 ? _("First") :
- i==2 ? _("Second") :
- _("Third") );
- else
- sprintf(buf, _("Please name the %dth encoding in this file"),
- i );
-# else
- if ( i<=3 )
- snprintf(buf,sizeof(buf),
- _("Please name the %s encoding in this file"),
- i==1 ? _("_First") : i==2 ? _("Second") : _("Third") );
- else
- snprintf(buf,sizeof(buf),
- _("Please name the %dth encoding in this file"),
- i );
-# endif
- }
- name = gwwv_ask_string(buf,NULL,buf);
- if ( name!=NULL ) {
- item->enc_name = copy(name);
- free(name);
- } else {
- if ( prev==NULL )
- head = item->next;
- else
- prev->next = item->next;
- EncodingFree(item);
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
- }
- for ( item=head; item!=NULL; item=item->next )
- RemoveMultiples(item);
-
- if ( enclist == NULL )
- enclist = head;
- else {
- for ( item=enclist; item->next!=NULL; item=item->next );
- item->next = head;
- }
-}
-
-void LoadPfaEditEncodings(void) {
- ParseEncodingFile(NULL);
-}
-
-void DumpPfaEditEncodings(void) {
- FILE *file;
- Encoding *item;
- int i;
- char buffer[80];
-
- for ( item=enclist; item!=NULL && item->builtin; item=item->next );
- if ( item==NULL ) {
- unlink(getPfaEditEncodings());
-return;
- }
-
- file = fopen( getPfaEditEncodings(), "w");
- if ( file==NULL ) {
- LogError( _("couldn't write encodings file\n") );
-return;
- }
-
- for ( item=enclist; item!=NULL; item = item->next ) if ( !item->builtin && item->tounicode_func==NULL ) {
- fprintf( file, "/%s [\n", item->enc_name );
- if ( item->psnames==NULL )
- fprintf( file, "%% Use codepoints.\n" );
- for ( i=0; i<item->char_cnt; ++i ) {
- if ( item->psnames!=NULL && item->psnames[i]!=NULL )
- fprintf( file, " /%s", item->psnames[i]);
- else if ( item->unicode[i]<' ' || (item->unicode[i]>=0x7f && item->unicode[i]<0xa0))
- fprintf( file, " /.notdef" );
- else
- fprintf( file, " /%s", StdGlyphName(buffer,item->unicode[i],ui_none,(NameList *) -1));
- if ( (i&0xf)==0 )
- fprintf( file, "\t\t%% 0x%02x\n", i );
- else
- putc('\n',file);
- }
- fprintf( file, "] def\n\n" );
- }
- fclose(file);
-}
-
-static void DeleteEncoding(Encoding *me) {
- FontView *fv;
- Encoding *prev;
-
- if ( me->builtin )
-return;
-
- for ( fv = fv_list; fv!=NULL; fv = fv->next ) {
- if ( fv->map->enc==me )
- fv->map->enc = &custom;
- }
- if ( me==enclist )
- enclist = me->next;
- else {
- for ( prev = enclist; prev!=NULL && prev->next!=me; prev=prev->next );
- if ( prev!=NULL ) prev->next = me->next;
- }
- EncodingFree(me);
- if ( default_encoding == me )
- default_encoding = FindOrMakeEncoding("ISO8859-1");
- if ( default_encoding == NULL )
- default_encoding = &custom;
- DumpPfaEditEncodings();
-}
-
-#ifndef LUA_FF_LIB
-static GTextInfo *EncodingList(void) {
- GTextInfo *ti;
- int i;
- Encoding *item;
-
- i = 0;
- for ( item=enclist; item!=NULL ; item=item->next )
- if ( !item->builtin )
- ++i;
- ti = gcalloc(i+1,sizeof(GTextInfo));
- i = 0;
- for ( item=enclist; item!=NULL ; item=item->next )
- if ( !item->builtin )
- ti[i++].text = uc_copy(item->enc_name);
- if ( i!=0 )
- ti[0].selected = true;
-return( ti );
-}
-#endif
-
-#define CID_Encodings 1001
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-static int DE_Delete(GGadget *g, GEvent *e) {
- GWindow gw;
- int *done;
- GGadget *list;
- int sel,i;
- Encoding *item;
-
- if ( e->type==et_controlevent &&
- (e->u.control.subtype == et_buttonactivate ||
- e->u.control.subtype == et_listdoubleclick )) {
- gw = GGadgetGetWindow(g);
- done = GDrawGetUserData(gw);
- list = GWidgetGetControl(gw,CID_Encodings);
- sel = GGadgetGetFirstListSelectedItem(list);
- i=0;
- for ( item=enclist; item!=NULL; item=item->next ) {
- if ( item->builtin )
- /* Do Nothing */;
- else if ( i==sel )
- break;
- else
- ++i;
- }
- if ( item!=NULL )
- DeleteEncoding(item);
- *done = true;
- }
-return( true );
-}
-
-static int DE_Cancel(GGadget *g, GEvent *e) {
- GWindow gw;
- int *done;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- done = GDrawGetUserData(gw);
- *done = true;
- }
-return( true );
-}
-
-static int de_e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- int *done = GDrawGetUserData(gw);
- *done = true;
- } else if ( event->type == et_char ) {
-return( false );
- }
-return( true );
-}
-
-void RemoveEncoding(void) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[5];
- GTextInfo label[5];
- Encoding *item;
- int done = 0;
-
- for ( item=enclist; item!=NULL && item->builtin; item=item->next );
- if ( item==NULL )
-return;
-
- memset(&gcd,0,sizeof(gcd));
- memset(&label,0,sizeof(label));
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Remove Encoding");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,150));
- pos.height = GDrawPointsToPixels(NULL,110);
- gw = GDrawCreateTopWindow(NULL,&pos,de_e_h,&done,&wattrs);
-
- gcd[0].gd.pos.x = 10; gcd[0].gd.pos.y = 6;
- gcd[0].gd.pos.width = 130; gcd[0].gd.pos.height = 5*12+10;
- gcd[0].gd.flags = gg_visible | gg_enabled;
- gcd[0].gd.cid = CID_Encodings;
- gcd[0].gd.u.list = EncodingList();
- gcd[0].gd.handle_controlevent = DE_Delete;
- gcd[0].creator = GListCreate;
-
- gcd[2].gd.pos.x = -10; gcd[2].gd.pos.y = gcd[0].gd.pos.y+gcd[0].gd.pos.height+5;
- gcd[2].gd.pos.width = -1; gcd[2].gd.pos.height = 0;
- gcd[2].gd.flags = gg_visible | gg_enabled | gg_but_cancel ;
- label[2].text = (unichar_t *) _("_Cancel");
- label[2].text_is_1byte = true;
- label[2].text_in_resource = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.mnemonic = 'C';
- gcd[2].gd.handle_controlevent = DE_Cancel;
- gcd[2].creator = GButtonCreate;
-
- gcd[1].gd.pos.x = 10-3; gcd[1].gd.pos.y = gcd[2].gd.pos.y-3;
- gcd[1].gd.pos.width = -1; gcd[1].gd.pos.height = 0;
- gcd[1].gd.flags = gg_visible | gg_enabled | gg_but_default ;
- label[1].text = (unichar_t *) _("_Delete");
- label[1].text_is_1byte = true;
- label[1].text_in_resource = true;
- gcd[1].gd.mnemonic = 'D';
- gcd[1].gd.label = &label[1];
- gcd[1].gd.handle_controlevent = DE_Delete;
- gcd[1].creator = GButtonCreate;
-
- gcd[3].gd.pos.x = 2; gcd[3].gd.pos.y = 2;
- gcd[3].gd.pos.width = pos.width-4; gcd[3].gd.pos.height = pos.height-2;
- gcd[3].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- gcd[3].creator = GGroupCreate;
-
- GGadgetsCreate(gw,gcd);
- GTextInfoListFree(gcd[0].gd.u.list);
-
- GWidgetHidePalettes();
- GDrawSetVisible(gw,true);
- while ( !done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-}
-#endif
-
-Encoding *MakeEncoding(SplineFont *sf,EncMap *map) {
- char *name;
- int i, gid;
- Encoding *item, *temp;
- SplineChar *sc;
-
- if ( map->enc!=&custom )
-return(NULL);
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- name = gwwv_ask_string(_("Please name this encoding"),NULL,_("Please name this encoding"));
-#else
- name = NULL;
-#endif
- if ( name==NULL )
-return(NULL);
- item = gcalloc(1,sizeof(Encoding));
- item->enc_name = name;
- item->only_1byte = item->has_1byte = true;
- item->char_cnt = map->enccount;
- item->unicode = gcalloc(map->enccount,sizeof(int32));
- for ( i=0; i<map->enccount; ++i ) if ( (gid = map->map[i])!=-1 && (sc=sf->glyphs[gid])!=NULL ) {
- if ( sc->unicodeenc!=-1 )
- item->unicode[i] = sc->unicodeenc;
- else if ( strcmp(sc->name,".notdef")!=0 ) {
- if ( item->psnames==NULL )
- item->psnames = gcalloc(map->enccount,sizeof(unichar_t *));
- item->psnames[i] = copy(sc->name);
- }
- }
- RemoveMultiples(item);
-
- if ( enclist == NULL )
- enclist = item;
- else {
- for ( temp=enclist; temp->next!=NULL; temp=temp->next );
- temp->next = item;
- }
- DumpPfaEditEncodings();
-return( item );
-}
-
-#ifndef LUA_FF_LIB
-void LoadEncodingFile(void) {
- char *filename;
- char *fn = NULL;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- static char filter[] = "*.{ps,PS,txt,TXT,enc,ENC}";
- fn = gwwv_open_filename(_("Load Encoding"), NULL, filter, NULL);
-#endif
- if ( fn==NULL )
-return;
- filename = utf82def_copy(fn);
- ParseEncodingFile(filename);
- free(fn); free(filename);
- DumpPfaEditEncodings();
-}
-#endif
-
-void SFFindNearTop(SplineFont *sf) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontView *fv;
- EncMap *map;
- int i,k,gid;
-
- if ( sf->cidmaster!=NULL )
- sf = sf->cidmaster;
- if ( sf->subfontcnt==0 ) {
- for ( fv=sf->fv; fv!=NULL; fv=fv->nextsame ) {
- map = fv->map;
- fv->sc_near_top = NULL;
- for ( i=fv->rowoff*fv->colcnt; i<map->enccount && i<(fv->rowoff+fv->rowcnt)*fv->colcnt; ++i )
- if ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- fv->sc_near_top = sf->glyphs[gid];
- break;
- }
- }
- } else {
- for ( fv=sf->fv; fv!=NULL; fv=fv->nextsame ) {
- map = fv->map;
- fv->sc_near_top = NULL;
- for ( i=fv->rowoff*fv->colcnt; i<map->enccount && i<(fv->rowoff+fv->rowcnt)*fv->colcnt; ++i ) {
- for ( k=0; k<sf->subfontcnt; ++k )
- if ( (gid=map->map[i])!=-1 &&
- gid<sf->subfonts[k]->glyphcnt &&
- sf->subfonts[k]->glyphs[gid]!=NULL )
- fv->sc_near_top = sf->subfonts[k]->glyphs[gid];
- }
- }
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-}
-
-void SFRestoreNearTop(SplineFont *sf) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontView *fv;
-
- for ( fv=sf->fv; fv!=NULL; fv=fv->nextsame ) if ( fv->sc_near_top!=NULL ) {
- /* Note: For CID keyed fonts, we don't care if sc is in the currenly */
- /* displayed font, all we care about is the CID */
- int enc = fv->map->backmap[fv->sc_near_top->orig_pos];
- if ( enc!=-1 ) {
- fv->rowoff = enc/fv->colcnt;
- GScrollBarSetPos(fv->vsb,fv->rowoff);
- /* Don't ask for an expose event yet. We'll get one soon enough */
- }
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-}
-
-/* ************************************************************************** */
-/* ****************************** CID Encodings ***************************** */
-/* ************************************************************************** */
-struct cidmap {
- char *registry, *ordering;
- int supplement, maxsupple;
- int cidmax; /* Max cid found in the charset */
- int namemax; /* Max cid with useful info */
- uint32 *unicode;
- char **name;
- struct cidmap *next;
-};
-
-static struct cidmap *cidmaps = NULL;
-
-int CIDFromName(char *name,SplineFont *cidmaster) {
- /* We've had various conventions for encoding a cid inside a name */
- /* I'm primarily interested in this when the name is something like */
- /* Japan1.504.vert */
- /* which tells me that the current glyph is the rotated version of */
- /* cid 504 */
- /* Other convention "cid-504.vert" */
- int len = strlen( cidmaster->ordering );
- int cid;
- char *end;
-
- if ( strncmp(name,cidmaster->ordering,len)==0 ) {
- if ( name[len]=='.' ) ++len;
- } else if ( strncmp(name,"cid-",4)==0 ) {
- len = 4;
- }
- cid = strtol(name+len,&end,10);
- if ( end==name+len )
-return( -1 );
- if ( *end!='.' && *end!='\0' )
-return( -1 );
-
-return ( cid );
-}
-
-int CID2Uni(struct cidmap *map,int cid) {
- unsigned int uni;
-
- if ( map==NULL )
-return( -1 );
- else if ( cid==0 )
-return( 0 );
- else if ( cid<map->namemax && map->unicode[cid]!=0 )
-return( map->unicode[cid] );
- else if ( cid<map->namemax && map->name[cid]!=NULL ) {
- if ( sscanf(map->name[cid],"uni%x", &uni )==1 )
-return( uni );
- }
-
-return( -1 );
-}
-
-int CID2NameUni(struct cidmap *map,int cid, char *buffer, int len) {
- int enc = -1;
- const char *temp;
-
-#if defined( _NO_SNPRINTF ) || defined( __VMS )
- if ( map==NULL )
- sprintf(buffer,"cid-%d", cid);
- else if ( cid<map->namemax && map->name[cid]!=NULL )
- strncpy(buffer,map->name[cid],len);
- else if ( cid==0 || (cid<map->namemax && map->unicode[cid]!=0 )) {
- if ( map->unicode==NULL || map->namemax==0 )
- enc = 0;
- else
- enc = map->unicode[cid];
- temp = StdGlyphName(buffer,enc,ui_none,(NameList *) -1);
- if ( temp!=buffer )
- strcpy(buffer,temp);
- } else
- sprintf(buffer,"%s.%d", map->ordering, cid);
-#else
- if ( map==NULL )
- snprintf(buffer,len,"cid-%d", cid);
- else if ( cid<map->namemax && map->name[cid]!=NULL )
- strncpy(buffer,map->name[cid],len);
- else if ( cid==0 )
- strcpy(buffer,".notdef");
- else if ( cid<map->namemax && map->unicode[cid]!=0 ) {
- if ( map->unicode==NULL || map->namemax==0 )
- enc = 0;
- else
- enc = map->unicode[cid];
- temp = StdGlyphName(buffer,enc,ui_none,(NameList *) -1);
- if ( temp!=buffer )
- strcpy(buffer,temp);
- } else
- snprintf(buffer,len,"%s.%d", map->ordering, cid);
-#endif
-return( enc );
-}
-
-int NameUni2CID(struct cidmap *map,int uni, const char *name) {
- int i;
-
- if ( map==NULL )
-return( -1 );
- if ( uni!=-1 ) {
- for ( i=0; i<map->namemax; ++i )
- if ( map->unicode[i]==uni )
-return( i );
- } else {
- for ( i=0; i<map->namemax; ++i )
- if ( map->name[i]!=NULL && strcmp(map->name[i],name)==0 )
-return( i );
- }
-return( -1 );
-}
-
-int MaxCID(struct cidmap *map) {
-return( map->cidmax );
-}
-
-static char *SearchDirForCidMap(char *dir,char *registry,char *ordering,
- int supplement,char **maybefile) {
- char maybe[FILENAME_MAX+1];
- struct dirent *ent;
- DIR *d;
- int len, rlen = strlen(registry), olen=strlen(ordering);
- char *pt, *end, *ret;
- int test, best = -1;
-
- if ( dir==NULL )
-return( NULL );
-
- if ( *maybefile!=NULL ) {
- char *pt = strrchr(*maybefile,'.');
- while ( pt>*maybefile && Isdigit(pt[-1]))
- --pt;
- best = strtol(pt,NULL,10);
- }
-
- d = opendir(dir);
- if ( d==NULL )
-return( NULL );
- while ( (ent = readdir(d))!=NULL ) {
- if ( (len = strlen(ent->d_name))<8 )
- continue;
- if ( strcmp(ent->d_name+len-7,".cidmap")!=0 )
- continue;
- if ( strncmp(ent->d_name,registry,rlen)!=0 || ent->d_name[rlen]!='-' )
- continue;
- pt = ent->d_name+rlen+1;
- if ( strncmp(pt,ordering,olen)!=0 || pt[olen]!='-' )
- continue;
- pt += olen+1;
- if ( !Isdigit(*pt))
- continue;
- test = strtol(pt,&end,10);
- if ( *end!='.' )
- continue;
- if ( test>=supplement ) {
- ret = galloc(strlen(dir)+1+len+1);
- strcpy(ret,dir);
- strcat(ret,"/");
- strcat(ret,ent->d_name);
- closedir(d);
-return( ret );
- } else if ( test>best ) {
- best = test;
- strcpy(maybe,ent->d_name);
- }
- }
- closedir(d);
- if ( best>-1 ) {
- ret = galloc(strlen(dir)+1+strlen(maybe)+1);
- strcpy(ret,dir);
- strcat(ret,"/");
- strcat(ret,maybe);
- *maybefile = ret;
- }
-return( NULL );
-}
-
-#ifndef LUA_FF_LIB
-static char *SearchNoLibsDirForCidMap(char *dir,char *registry,char *ordering,
- int supplement,char **maybefile) {
- char *ret;
-
- if ( dir==NULL || strstr(dir,"/.libs")==NULL )
-return( NULL );
-
- dir = copy(dir);
- *strstr(dir,"/.libs") = '\0';
-
- ret = SearchDirForCidMap(dir,registry,ordering,supplement,maybefile);
- free(dir);
-return( ret );
-}
-#endif
-
-static struct cidmap *MakeDummyMap(char *registry,char *ordering,int supplement) {
- struct cidmap *ret = galloc(sizeof(struct cidmap));
-
- ret->registry = copy(registry);
- ret->ordering = copy(ordering);
- ret->supplement = ret->maxsupple = supplement;
- ret->cidmax = ret->namemax = 0;
- ret->unicode = NULL; ret->name = NULL;
- ret->next = cidmaps;
- cidmaps = ret;
-return( ret );
-}
-
-struct cidmap *LoadMapFromFile(char *file,char *registry,char *ordering,
- int supplement) {
- struct cidmap *ret = galloc(sizeof(struct cidmap));
- char *pt = strrchr(file,'.');
- FILE *f;
- int cid1, cid2, uni, cnt, i;
- char name[100];
-
- while ( pt>file && Isdigit(pt[-1]))
- --pt;
- ret->supplement = ret->maxsupple = strtol(pt,NULL,10);
- if ( supplement>ret->maxsupple )
- ret->maxsupple = supplement;
- ret->registry = copy(registry);
- ret->ordering = copy(ordering);
- ret->next = cidmaps;
- cidmaps = ret;
-
- f = fopen( file,"r" );
- if ( f==NULL ) {
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Missing cidmap file"),_("Couldn't open cidmap file: %s"), file );
-#else
- gwwv_post_error(_("Couldn't open file"), _("Couldn't open file %.200s"), file);
-#endif
- ret->cidmax = ret->namemax = 0;
- ret->unicode = NULL; ret->name = NULL;
- } else if ( fscanf( f, "%d %d", &ret->cidmax, &ret->namemax )!=2 ) {
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Bad cidmap file"),_("%s is not a cidmap file, please download\nhttp://fontforge.sourceforge.net/cidmaps.tgz"), file );
- fprintf( stderr, _("%s is not a cidmap file, please download\nhttp://fontforge.sourceforge.net/cidmaps.tgz"), file );
-#else
- gwwv_post_error(_("Bad Cidmap File"), _("%s is not a cidmap file, please download\nhttp://fontforge.sourceforge.net/cidmaps.tgz"), file);
- fprintf( stderr, "%s is not a cidmap file, please download\nhttp://fontforge.sourceforge.net/cidmaps.tgz", file );
-#endif
- ret->cidmax = ret->namemax = 0;
- ret->unicode = NULL; ret->name = NULL;
- } else {
- ret->unicode = gcalloc(ret->namemax+1,sizeof(uint32));
- ret->name = gcalloc(ret->namemax+1,sizeof(char *));
- while ( 1 ) {
- cnt=fscanf( f, "%d..%d %x", &cid1, &cid2, (unsigned *) &uni );
- if ( cnt<=0 )
- break;
- if ( cid1>ret->namemax )
- continue;
- if ( cnt==3 ) {
- if ( cid2>ret->namemax ) cid2 = ret->namemax;
- for ( i=cid1; i<=cid2; ++i )
- ret->unicode[i] = uni++;
- } else if ( cnt==1 ) {
- if ( fscanf(f,"%x", (unsigned *) &uni )==1 )
- ret->unicode[cid1] = uni;
- else if ( fscanf(f," /%s", name )==1 )
- ret->name[cid1] = copy(name);
- }
- }
- fclose(f);
- }
- free(file);
-return( ret );
-}
-
-struct cidmap *FindCidMap(char *registry,char *ordering,int supplement,SplineFont *sf) {
- struct cidmap *map, *maybe=NULL;
- char *file, *maybefile=NULL;
- int maybe_sup = -1;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- char *buts[3], *buts2[3], *buts3[3];
- char buf[100];
-#endif
- int ret;
-
- if ( sf!=NULL && sf->loading_cid_map )
-return( NULL );
-
- for ( map = cidmaps; map!=NULL; map = map->next ) {
- if ( strcmp(map->registry,registry)==0 && strcmp(map->ordering,ordering)==0 ) {
- if ( supplement<=map->supplement )
-return( map );
- else if ( maybe==NULL || maybe->supplement<map->supplement )
- maybe = map;
- }
- }
- if ( maybe!=NULL && supplement<=maybe->maxsupple )
-return( maybe ); /* User has said it's ok to use maybe at this supplement level */
-
- file = SearchDirForCidMap(".",registry,ordering,supplement,&maybefile);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( file==NULL )
- file = SearchDirForCidMap(GResourceProgramDir,registry,ordering,supplement,&maybefile);
- if ( file==NULL )
- file = SearchNoLibsDirForCidMap(GResourceProgramDir,registry,ordering,supplement,&maybefile);
-#endif
-#ifdef SHAREDIR
- if ( file==NULL )
- file = SearchDirForCidMap(SHAREDIR,registry,ordering,supplement,&maybefile);
-#endif
- if ( file==NULL )
- file = SearchDirForCidMap(getPfaEditShareDir(),registry,ordering,supplement,&maybefile);
- if ( file==NULL )
- file = SearchDirForCidMap("/usr/share/fontforge",registry,ordering,supplement,&maybefile);
-
- if ( file==NULL && (maybe!=NULL || maybefile!=NULL)) {
- if ( maybefile!=NULL ) {
- char *pt = strrchr(maybefile,'.');
- while ( pt>maybefile && Isdigit(pt[-1]))
- --pt;
- maybe_sup = strtol(pt,NULL,10);
- if ( maybe!=NULL && maybe->supplement >= maybe_sup ) {
- free(maybefile); maybefile = NULL;
- maybe_sup = maybe->supplement;
- } else
- maybe = NULL;
- }
- if ( maybe!=NULL )
- maybe_sup = maybe->supplement;
- if ( sf!=NULL ) sf->loading_cid_map = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- buts[0] = _("_Use It"); buts[1] = _("_Search"); buts[2] = NULL;
- ret = gwwv_ask(_("Use CID Map"),(const char **) buts,0,1,_("This font is based on the charset %1$.20s-%2$.20s-%3$d, but the best I've been able to find is %1$.20s-%2$.20s-%4$d.\nShall I use that or let you search?"),
- registry,ordering,supplement,maybe_sup);
-#else
- ret = 0; /* In a script, default to using an old version of the file */
- /* We'll get most cids that way */
-#endif
- if ( sf!=NULL ) sf->loading_cid_map = false;
- if ( ret==0 ) {
- if ( maybe!=NULL ) {
- maybe->maxsupple = supplement;
-return( maybe );
- } else {
- file = maybefile;
- maybefile = NULL;
- }
- }
- }
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( file==NULL ) {
- char *uret;
-#if defined( _NO_SNPRINTF ) || defined( __VMS )
- sprintf(buf,"%s-%s-*.cidmap", registry, ordering );
-#else
- snprintf(buf,sizeof(buf),"%s-%s-*.cidmap", registry, ordering );
-#endif
- if ( maybe==NULL && maybefile==NULL ) {
- buts3[0] = _("_Browse"); buts3[1] = _("_Give Up"); buts3[2] = NULL;
- ret = gwwv_ask(_("No cidmap file..."),(const char **)buts3,0,1,_("FontForge was unable to find a cidmap file for this font. It is not essential to have one, but some things will work better if you do. If you have not done so you might want to download the cidmaps from:\n http://FontForge.sourceforge.net/cidmaps.tgz\nand then gunzip and untar them and move them to:\n %.80s\n\nWould you like to search your local disk for an appropriate file?"),
-#ifdef SHAREDIR
- SHAREDIR
-#else
- getPfaEditShareDir()==NULL?"/usr/share/fontforge":getPfaEditShareDir()
-#endif
- );
- if ( ret==1 || no_windowing_ui )
- buf[0] = '\0';
- }
- uret = NULL;
- if ( buf[0]!='\0' && !no_windowing_ui ) {
- if ( sf!=NULL ) sf->loading_cid_map = true;
- uret = gwwv_open_filename(_("Find a cidmap file..."),NULL,buf,NULL);
- if ( sf!=NULL ) sf->loading_cid_map = false;
- }
- if ( uret==NULL ) {
- buts2[0] = "_Use It"; buts2[1] = "_Search"; buts2[2] = NULL;
- if ( maybe==NULL && maybefile==NULL )
- /* No luck */;
- else if ( no_windowing_ui && maybe!=NULL ) {
- maybe->maxsupple = supplement;
-return( maybe );
- } else if ( no_windowing_ui ) {
- file = maybefile;
- maybefile = NULL;
- } else if ( gwwv_ask(_("Use CID Map"),(const char **)buts2,0,1,_("Are you sure you don't want to use the cidmap I found?"))==0 ) {
- if ( maybe!=NULL ) {
- maybe->maxsupple = supplement;
-return( maybe );
- } else {
- file = maybefile;
- maybefile = NULL;
- }
- }
- } else {
- file = utf82def_copy(uret);
- free(uret);
- }
- }
-#else /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- if ( maybe==NULL && maybefile==NULL )
- /* No luck */;
- else if ( maybe!=NULL ) {
- maybe->maxsupple = supplement;
-return( maybe );
- } else {
- file = maybefile;
- maybefile = NULL;
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
- free(maybefile);
- if ( file!=NULL )
-return( LoadMapFromFile(file,registry,ordering,supplement));
-
-return( MakeDummyMap(registry,ordering,supplement));
-}
-
-static void SFApplyOrdering(SplineFont *sf, int glyphcnt) {
- SplineChar **glyphs, *sc;
- int i;
- RefChar *refs, *rnext, *rprev;
- SplineSet *new, *spl;
-
- /* Remove references to characters which aren't in the new map (if any) */
- /* Don't need to fix up dependencies, because we throw the char away */
- for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc = sf->glyphs[i])!=NULL ) {
- for ( rprev = NULL, refs=sc->layers[ly_fore].refs; refs!=NULL; refs=rnext ) {
- rnext = refs->next;
- if ( refs->sc->orig_pos==-1 ) {
- new = refs->layers[0].splines;
- if ( new!=NULL ) {
- for ( spl = new; spl->next!=NULL; spl = spl->next );
- spl->next = sc->layers[ly_fore].splines;
- sc->layers[ly_fore].splines = new;
- }
- refs->layers[0].splines=NULL;
- RefCharFree(refs);
- if ( rprev==NULL )
- sc->layers[ly_fore].refs = rnext;
- else
- rprev->next = rnext;
- } else
- rprev = refs;
- }
- }
-
- glyphs = gcalloc(glyphcnt+1,sizeof(SplineChar *));
- for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc = sf->glyphs[i])!=NULL ) {
- if ( sc->orig_pos==-1 )
- SplineCharFree(sc);
- else
- glyphs[sc->orig_pos] = sc;
- }
-
- free(sf->glyphs);
- sf->glyphcnt = sf->glyphmax = glyphcnt;
- sf->glyphs = glyphs;
-}
-
-/* Convert a normal font to a cid font, rearranging glyphs into cid order */
-void SFEncodeToMap(SplineFont *sf,struct cidmap *map) {
- SplineChar *sc;
- int i,max=0, anyextras=0;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) {
- sc->orig_pos = NameUni2CID(map,sc->unicodeenc,sc->name);
- if ( sc->orig_pos>max ) max = sc->orig_pos;
- else if ( sc->orig_pos==-1 ) ++anyextras;
- } else if ( sc!=NULL )
- sc->orig_pos = -1;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( anyextras ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buttons[3];
- buttons[0] = _("_Delete");
- buttons[1] = _("_Add");
- buttons[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buttons[] = { GTK_STOCK_DELETE, GTK_STOCK_ADD, NULL };
-#endif
- if ( gwwv_ask(_("Extraneous glyphs"),(const char **) buttons,0,1,_("The current encoding contains glyphs which I cannot map to CIDs.\nShould I delete them or add them to the end (where they may conflict with future ros definitions)?"))==1 ) {
- if ( map!=NULL && max<map->cidmax ) max = map->cidmax;
- anyextras = 0;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) {
- if ( sc->orig_pos == -1 ) sc->orig_pos = max + anyextras++;
- }
- max += anyextras;
- }
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- SFApplyOrdering(sf, max+1);
-}
-
-#ifndef LUA_FF_LIB
-struct block {
- int cur, tot;
- char **maps;
- char **dirs;
-};
-
-static void AddToBlock(struct block *block,char *mapname, char *dir) {
- int i, val, j;
- int len = strlen(mapname);
-
- if ( mapname[len-7]=='.' ) len -= 7;
- for ( i=0; i<block->cur; ++i ) {
- if ( (val=strncmp(block->maps[i],mapname,len))==0 )
-return; /* Duplicate */
- else if ( val>0 )
- break;
- }
- if ( block->tot==0 ) {
- block->tot = 10;
- block->maps = galloc(10*sizeof(char *));
- block->dirs = galloc(10*sizeof(char *));
- } else if ( block->cur>=block->tot ) {
- block->tot += 10;
- block->maps = grealloc(block->maps,block->tot*sizeof(char *));
- block->dirs = grealloc(block->dirs,block->tot*sizeof(char *));
- }
- for ( j=block->cur; j>=i; --j ) {
- block->maps[j+1] = block->maps[j];
- block->dirs[j+1] = block->dirs[j];
- }
- block->maps[i] = copyn(mapname,len);
- block->dirs[i] = dir;
- ++block->cur;
-}
-
-static void FindMapsInDir(struct block *block,char *dir) {
- struct dirent *ent;
- DIR *d;
- int len;
- char *pt, *pt2;
-
- if ( dir==NULL )
-return;
- /* format of cidmap filename "?*-?*-[0-9]*.cidmap" */
- d = opendir(dir);
- if ( d==NULL )
-return;
- while ( (ent = readdir(d))!=NULL ) {
- if ( (len = strlen(ent->d_name))<8 )
- continue;
- if ( strcmp(ent->d_name+len-7,".cidmap")!=0 )
- continue;
- pt = strchr(ent->d_name, '-');
- if ( pt==NULL || pt==ent->d_name )
- continue;
- pt2 = strchr(pt+1, '-' );
- if ( pt2==NULL || pt2==pt+1 || !isdigit(pt2[1]))
- continue;
- AddToBlock(block,ent->d_name,dir);
- }
-}
-
-static void FindMapsInNoLibsDir(struct block *block,char *dir) {
-
- if ( dir==NULL || strstr(dir,"/.libs")==NULL )
-return;
-
- dir = copy(dir);
- *strstr(dir,"/.libs") = '\0';
-
- FindMapsInDir(block,dir);
- free(dir);
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-struct cidmap *AskUserForCIDMap(SplineFont *sf) {
- struct block block;
- struct cidmap *map = NULL;
- char buffer[200];
- char **choices;
- int i,ret;
- char *filename=NULL;
- char *reg, *ord, *pt;
- int supplement;
-
- memset(&block,'\0',sizeof(block));
- for ( map = cidmaps; map!=NULL; map = map->next ) {
- sprintf(buffer,"%s-%s-%d", map->registry, map->ordering, map->supplement);
- AddToBlock(&block,buffer,NULL);
- }
- FindMapsInDir(&block,".");
- FindMapsInDir(&block,GResourceProgramDir);
- FindMapsInNoLibsDir(&block,GResourceProgramDir);
-#ifdef SHAREDIR
- FindMapsInDir(&block,SHAREDIR);
-#endif
- FindMapsInDir(&block,getPfaEditShareDir());
- FindMapsInDir(&block,"/usr/share/fontforge");
-
- choices = gcalloc(block.cur+2,sizeof(unichar_t *));
- choices[0] = copy(_("Browse..."));
- for ( i=0; i<block.cur; ++i )
- choices[i+1] = copy(block.maps[i]);
- ret = gwwv_choose(_("Find a cidmap file..."),(const char **) choices,i+1,0,_("Please select a CID ordering"));
- for ( i=0; i<=block.cur; ++i )
- free( choices[i] );
- free(choices);
- if ( ret==0 ) {
- filename = gwwv_open_filename(_("Find a cidmap file..."),NULL,
- "?*-?*-[0-9]*.cidmap",NULL);
- if ( filename==NULL )
- ret = -1;
- }
- if ( ret!=-1 ) {
- if ( filename!=NULL )
- /* Do nothing for now */;
- else if ( block.dirs[ret-1]!=NULL ) {
- filename = galloc(strlen(block.dirs[ret-1])+strlen(block.maps[ret-1])+3+8);
- strcpy(filename,block.dirs[ret-1]);
- strcat(filename,"/");
- strcat(filename,block.maps[ret-1]);
- strcat(filename,".cidmap");
- }
- if ( ret!=0 )
- reg = block.maps[ret-1];
- else {
- reg = strrchr(filename,'/');
- if ( reg==NULL ) reg = filename;
- else ++reg;
- reg = copy(reg);
- }
- pt = strchr(reg,'-');
- if ( pt==NULL )
- ret = -1;
- else {
- *pt = '\0';
- ord = pt+1;
- pt = strchr(ord,'-');
- if ( pt==NULL )
- ret = -1;
- else {
- *pt = '\0';
- supplement = strtol(pt+1,NULL,10);
- }
- }
- if ( ret == -1 )
- /* No map */;
- else if ( filename==NULL )
- map = FindCidMap(reg,ord,supplement,sf);
- else
- map = LoadMapFromFile(filename,reg,ord,supplement);
- if ( ret!=0 && reg!=block.maps[ret-1] )
- free(reg);
- /*free(filename);*/ /* Freed by loadmap */
- }
- for ( i=0; i<block.cur; ++i )
- free( block.maps[i]);
- free(block.maps);
- free(block.dirs);
- if ( map!=NULL ) {
- sf->cidregistry = copy(map->registry);
- sf->ordering = copy(map->ordering);
- sf->supplement = map->supplement;
- }
-return( map );
-}
-
-static enum fchooserret CMapFilter(GGadget *g,GDirEntry *ent,
- const unichar_t *dir) {
- enum fchooserret ret = GFileChooserDefFilter(g,ent,dir);
- char buf2[256];
- FILE *file;
- static char *cmapflag = "%!PS-Adobe-3.0 Resource-CMap";
-
- if ( ret==fc_show && !ent->isdir ) {
- int len = 3*(u_strlen(dir)+u_strlen(ent->name)+5);
- char *filename = galloc(len);
- u2def_strncpy(filename,dir,len);
- strcat(filename,"/");
- u2def_strncpy(buf2,ent->name,sizeof(buf2));
- strcat(filename,buf2);
- file = fopen(filename,"r");
- if ( file==NULL )
- ret = fc_hide;
- else {
- if ( fgets(buf2,sizeof(buf2),file)==NULL ||
- strncmp(buf2,cmapflag,strlen(cmapflag))!=0 )
- ret = fc_hide;
- fclose(file);
- }
- free(filename);
- }
-return( ret );
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-enum cmaptype { cmt_out=-1, cmt_coderange, cmt_notdefs, cmt_cid, cmt_max };
-struct cmap {
- struct {
- int n;
- struct coderange { uint32 first, last, cid; } *ranges;
- } groups[cmt_max];
- char *registry;
- char *ordering;
- int supplement;
- struct remap *remap;
- int total;
-};
-
-static void cmapfree(struct cmap *cmap) {
- free(cmap->registry);
- free(cmap->ordering);
- free(cmap->groups[cmt_coderange].ranges);
- free(cmap->groups[cmt_notdefs].ranges);
- free(cmap->groups[cmt_cid].ranges);
- free(cmap->remap);
- free(cmap);
-}
-
-static struct coderange *ExtendArray(struct coderange *ranges,int *n, int val) {
- if ( *n == 0 )
- ranges = gcalloc(val,sizeof(struct coderange));
- else {
- ranges = grealloc(ranges,(*n+val)*sizeof(struct coderange));
- memset(ranges+*n,0,val*sizeof(struct coderange));
- }
- *n += val;
-return( ranges );
-}
-
-static char *readpsstr(char *str) {
- char *eos;
-
- while ( Isspace(*str)) ++str;
- if ( *str=='(' ) ++str;
- /* Postscript strings can be more complicated than this (hex, nested parens, Enc85...) */
- /* but none of those should show up here */
- for ( eos = str; *eos!=')' && *eos!='\0'; ++eos );
-return( copyn(str,eos-str));
-}
-
-static struct cmap *ParseCMap(char *filename) {
- char buf2[200];
- FILE *file;
- struct cmap *cmap;
- char *end, *pt;
- int val, pos;
- enum cmaptype in;
- static const char *bcsr = "begincodespacerange", *bndr = "beginnotdefrange", *bcr = "begincidrange";
- static const char *reg = "/Registry", *ord = "/Ordering", *sup="/Supplement";
-
- pos = 0;
- file = fopen(filename,"r");
- if ( file==NULL )
-return( NULL );
-
- cmap = gcalloc(1,sizeof(struct cmap));
- in = cmt_out;
- while ( fgets(buf2,sizeof(buf2),file)!=NULL ) {
- for ( pt=buf2; Isspace(*pt); ++pt);
- if ( in==cmt_out ) {
- if ( *pt=='/' ) {
- if ( strncmp(pt,reg,strlen(reg))==0 )
- cmap->registry = readpsstr(pt+strlen(reg));
- else if ( strncmp(pt,ord,strlen(ord))==0 )
- cmap->ordering = readpsstr(pt+strlen(ord));
- else if ( strncmp(pt,ord,strlen(ord))==0 ) {
- for ( pt += strlen(sup); Isspace(*pt); ++pt );
- cmap->supplement = strtol(pt,NULL,10);
- }
- continue;
- } else if ( !Isdigit(*pt) )
- continue;
- val = strtol(pt,&end,10);
- while ( Isspace(*end)) ++end;
- if ( strncmp(end,bcsr,strlen(bcsr))==0 )
- in = cmt_coderange;
- else if ( strncmp(end,bndr,strlen(bndr))==0 )
- in = cmt_notdefs;
- else if ( strncmp(end,bcr,strlen(bcr))==0 )
- in = cmt_cid;
- if ( in!=cmt_out ) {
- pos = cmap->groups[in].n;
- cmap->groups[in].ranges = ExtendArray(cmap->groups[in].ranges,&cmap->groups[in].n,val);
- }
- } else if ( strncmp(pt,"end",3)== 0 )
- in = cmt_out;
- else {
- if ( *pt!='<' )
- continue;
- cmap->groups[in].ranges[pos].first = strtoul(pt+1,&end,16);
- if ( *end=='>' ) ++end;
- while ( Isspace(*end)) ++end;
- if ( *end=='<' ) ++end;
- cmap->groups[in].ranges[pos].last = strtoul(end,&end,16);
- if ( in!=cmt_coderange ) {
- if ( *end=='>' ) ++end;
- while ( Isspace(*end)) ++end;
- cmap->groups[in].ranges[pos].cid = strtol(end,&end,10);
- }
- ++pos;
- }
- }
- fclose(file);
-return( cmap );
-}
-
-static void CompressCMap(struct cmap *cmap) {
- int32 i,j,k, pos, base;
- uint32 min, oldmax;
- /* we can't really deal with three and four byte encodings */
- /* so if we get one arrange for the sf itself to do a remap */
-
- cmap->total = 0x10000;
- for ( i=0; i<cmap->groups[cmt_coderange].n; ++i )
- if ( cmap->groups[cmt_coderange].ranges[i].last>0xfffff )
- break;
- if ( i==cmap->groups[cmt_coderange].n ) /* No need to remap */
-return;
-
- cmap->remap = gcalloc(cmap->groups[cmt_coderange].n+1,sizeof(struct remap));
- base = 0;
- for ( i=0; i<cmap->groups[cmt_coderange].n; ++i )
- if ( cmap->groups[cmt_coderange].ranges[i].last<0xffff ) {
- base = 0x10000;
- break;
- }
-
- pos=0;
- oldmax = base==0?0:0xffff;
- for ( i=0; i<cmap->groups[cmt_coderange].n; ++i ) {
- min = 0xffffffff; k=-1;
- for ( j=0; j<cmap->groups[cmt_coderange].n; ++j )
- if ( cmap->groups[cmt_coderange].ranges[j].first>oldmax &&
- cmap->groups[cmt_coderange].ranges[j].first<min ) {
- min = cmap->groups[cmt_coderange].ranges[j].first;
- k = j;
- }
- if ( k==-1 )
- break;
- cmap->remap[pos].firstenc = cmap->groups[cmt_coderange].ranges[k].first&~0xff;
- cmap->remap[pos].lastenc = cmap->groups[cmt_coderange].ranges[k].last|0xff;
- cmap->remap[pos].infont = base;
- base += cmap->remap[pos].lastenc-cmap->remap[pos].firstenc+1;
- oldmax = cmap->remap[pos].lastenc;
- ++pos;
- }
- cmap->remap[pos].infont = -1; /* Marks end */
- cmap->total = base;
- /* so cmap->remap will map sf indeces into the encoding in the cmap */
-
- /* And now we want to change the groups[cmt_cid].ranges so that they will */
- /* map into sf indeces rather than into the encoding of the cmap */
- for ( i=0; i<cmap->groups[cmt_cid].n; ++i ) {
- for ( k=0; cmap->remap[k].infont!=-1; ++k )
- if ( cmap->groups[cmt_cid].ranges[i].first>=cmap->remap[k].firstenc &&
- cmap->groups[cmt_cid].ranges[i].first<=cmap->remap[k].lastenc )
- break;
- if ( cmap->remap[k].infont==-1 )
- continue;
- cmap->groups[cmt_cid].ranges[i].first += cmap->remap[k].infont-cmap->remap[k].firstenc;
- cmap->groups[cmt_cid].ranges[i].last += cmap->remap[k].infont-cmap->remap[k].firstenc;
- }
-}
-
-SplineFont *CIDFlatten(SplineFont *cidmaster,SplineChar **glyphs,int charcnt) {
- FontView *fvs;
- SplineFont *new;
- char buffer[20];
- BDFFont *bdf;
- int j;
-
- if ( cidmaster==NULL )
-return(NULL);
- new = SplineFontEmpty();
- new->fontname = copy(cidmaster->fontname);
- new->fullname = copy(cidmaster->fullname);
- new->familyname = copy(cidmaster->familyname);
- new->weight = copy(cidmaster->weight);
- new->copyright = copy(cidmaster->copyright);
- sprintf(buffer,"%g", cidmaster->cidversion);
- new->version = copy(buffer);
- new->italicangle = cidmaster->italicangle;
- new->upos = cidmaster->upos;
- new->uwidth = cidmaster->uwidth;
- new->ascent = cidmaster->ascent;
- new->descent = cidmaster->descent;
- new->changed = new->changed_since_autosave = true;
- new->display_antialias = cidmaster->display_antialias;
- new->hasvmetrics = cidmaster->hasvmetrics;
- new->fv = cidmaster->fv;
- /* Don't copy the grid splines, there won't be anything meaningfull at top level */
- /* and won't know which font to copy from below */
- new->bitmaps = cidmaster->bitmaps; /* should already be flattened */
- cidmaster->bitmaps = NULL; /* don't free 'em */
- for ( bdf=new->bitmaps; bdf!=NULL; bdf=bdf->next )
- bdf->sf = new;
- new->gpos_lookups = cidmaster->gpos_lookups;
- cidmaster->gpos_lookups = NULL;
- new->gsub_lookups = cidmaster->gsub_lookups;
- cidmaster->gsub_lookups = NULL;
- new->kerns = cidmaster->kerns; new->vkerns = cidmaster->vkerns;
- cidmaster->kerns = cidmaster->vkerns = NULL;
- new->names = cidmaster->names; cidmaster->names = NULL;
- new->pfminfo = cidmaster->pfminfo;
- new->texdata = cidmaster->texdata;
- new->possub = cidmaster->possub; cidmaster->possub = NULL;
- new->sm = cidmaster->sm; cidmaster->sm = NULL;
- new->features = cidmaster->features; cidmaster->features = NULL;
- new->macstyle = cidmaster->macstyle;
- new->origname = copy( cidmaster->origname );
- new->display_size = cidmaster->display_size;
- /* Don't copy private */
- new->xuid = copy(cidmaster->xuid);
- new->glyphs = glyphs;
- new->glyphcnt = new->glyphmax = charcnt;
- for ( j=0; j<charcnt; ++j ) if ( glyphs[j]!=NULL ) {
- glyphs[j]->parent = new;
- glyphs[j]->orig_pos = j;
- }
- for ( fvs=new->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- fvs->cidmaster = NULL;
- if ( fvs->sf->glyphcnt!=new->glyphcnt ) {
- free(fvs->selected);
- fvs->selected = gcalloc(new->glyphcnt,sizeof(char));
- if ( fvs->map->encmax < new->glyphcnt )
- fvs->map->map = grealloc(fvs->map->map,(fvs->map->encmax = new->glyphcnt)*sizeof(int));
- fvs->map->enccount = new->glyphcnt;
- if ( fvs->map->backmax < new->glyphcnt )
- fvs->map->backmap = grealloc(fvs->map->backmap,(fvs->map->backmax = new->glyphcnt)*sizeof(int));
- for ( j=0; j<new->glyphcnt; ++j )
- fvs->map->map[j] = fvs->map->backmap[j] = j;
- }
- fvs->sf = new;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVSetTitle(fvs);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontViewReformatAll(new);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- SplineFontFree(cidmaster);
-return( new );
-}
-
-void SFFlatten(SplineFont *cidmaster) {
- SplineChar **glyphs;
- int i,j,max;
-
- if ( cidmaster==NULL )
-return;
- if ( cidmaster->cidmaster!=NULL )
- cidmaster = cidmaster->cidmaster;
- /* This doesn't change the ordering, so no need for special tricks to */
- /* preserve scrolling location. */
- for ( i=max=0; i<cidmaster->subfontcnt; ++i ) {
- if ( max<cidmaster->subfonts[i]->glyphcnt )
- max = cidmaster->subfonts[i]->glyphcnt;
- }
- glyphs = gcalloc(max,sizeof(SplineChar *));
- for ( j=0; j<max; ++j ) {
- for ( i=0; i<cidmaster->subfontcnt; ++i ) {
- if ( j<cidmaster->subfonts[i]->glyphcnt && cidmaster->subfonts[i]->glyphs[j]!=NULL ) {
- glyphs[j] = cidmaster->subfonts[i]->glyphs[j];
- cidmaster->subfonts[i]->glyphs[j] = NULL;
- break;
- }
- }
- }
- CIDFlatten(cidmaster,glyphs,max);
-}
-
-int SFFlattenByCMap(SplineFont *sf,char *cmapname) {
- struct cmap *cmap;
- int i,j,k,l,m, extras, max, curmax, warned;
- int found[4];
- SplineChar **glyphs = NULL, *sc;
- FontView *fvs;
-
- if ( sf->cidmaster!=NULL )
- sf = sf->cidmaster;
- if ( sf->subfontcnt==0 ) {
- gwwv_post_error(_("Not a CID-keyed font"),_("Not a CID-keyed font"));
-return( false );
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( cmapname==NULL ) {
- cmapname = gwwv_open_filename(_("Find an adobe CMap file..."),NULL,NULL,CMapFilter);
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- if ( cmapname==NULL )
-return( false );
- cmap = ParseCMap(cmapname);
- if ( cmap==NULL )
-return( false );
- CompressCMap(cmap);
- max = 0;
- for ( i=0; i<cmap->groups[cmt_cid].n; ++i ) {
- if ( max<cmap->groups[cmt_cid].ranges[i].last )
- max = cmap->groups[cmt_cid].ranges[i].last;
- if ( cmap->groups[cmt_cid].ranges[i].last>0x100000 ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error(_("Encoding Too Large"),_("Encoding Too Large"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Encoding Too Large"),_("Encoding Too Large"));
-#endif
- cmapfree(cmap);
-return( false );
- }
- }
-
- SFFindNearTop(sf);
- curmax = 0;
- for ( k=0; k<sf->subfontcnt; ++k ) {
- if ( curmax < sf->subfonts[k]->glyphcnt )
- curmax = sf->subfonts[k]->glyphcnt;
- }
-
- glyphs = gcalloc(curmax,sizeof(SplineChar *));
- for ( i=0; i<curmax; ++i ) {
- for ( k=0; k<sf->subfontcnt; ++k )
- if ( i<sf->subfonts[k]->glyphcnt && sf->subfonts[k]->glyphs[i]!=NULL ) {
- glyphs[i] = sf->subfonts[k]->glyphs[i];
- sf->subfonts[k]->glyphs[i] = NULL;
- break;
- }
- }
- sf = CIDFlatten(sf,glyphs,curmax);
-
- warned = true;
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- EncMap *map = fvs->map;
- for ( j=0; j<2; ++j ) {
- extras = 0;
- for ( i=0; i<curmax; ++i ) {
- sc = glyphs[i];
- if ( sc!=NULL ) {
- m = 0;
- for ( l=0; l<cmap->groups[cmt_cid].n; ++l ) {
- if ( i>=cmap->groups[cmt_cid].ranges[l].cid &&
- i<=cmap->groups[cmt_cid].ranges[l].cid +
- cmap->groups[cmt_cid].ranges[l].last -
- cmap->groups[cmt_cid].ranges[l].first ) {
- if ( m<sizeof(found)/sizeof(found[0]) )
- found[m++] = l;
- else if ( !warned ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- ff_post_notice(_("MultipleEncodingIgnored"),
- _("The glyph at CID %d is mapped to more than %d encodings. Only the first %d are handled."), i,
- sizeof(found)/sizeof(found[0]),
- sizeof(found)/sizeof(found[0]));
-#elif defined(FONTFORGE_CONFIG_GTK)
- ff_post_notice(_("MultipleEncodingIgnored"),
- _("The glyph at CID %d is mapped to more than %d encodings. Only the first %d are handled."), i,
- sizeof(found)/sizeof(found[0]),
- sizeof(found)/sizeof(found[0]));
-#endif
- warned = true;
- }
- }
- }
- if ( m==0 ) {
- if ( j ) {
- map->map[max+extras] = sc->orig_pos;
- map->backmap[sc->orig_pos] = max+extras;
- }
- ++extras;
- } else {
- if ( j ) {
- int p = cmap->groups[cmt_cid].ranges[found[0]].first +
- i-cmap->groups[cmt_cid].ranges[found[0]].cid;
- map->map[p] = sc->orig_pos;
- map->backmap[sc->orig_pos] = p;
- for ( l=1; l<m; ++l ) {
- int pos = cmap->groups[cmt_cid].ranges[found[l]].first +
- i-cmap->groups[cmt_cid].ranges[found[l]].cid;
- map->map[pos] = sc->orig_pos;
- }
- }
- }
- }
- }
- if ( !j ) {
- map->map = grealloc(map->map,(map->encmax = map->enccount = max+extras)*sizeof(int));
- memset(map->map,-1,map->enccount*sizeof(int));
- memset(map->backmap,-1,sf->glyphcnt*sizeof(int));
- map->remap = cmap->remap; cmap->remap = NULL;
- }
- warned = true;
- }
- }
- cmapfree(cmap);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontViewReformatAll(sf);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- SFRestoreNearTop(sf);
-return( true );
-}
-
-static int Enc2CMap(struct cmap *cmap,int enc) {
- int i;
-
- for ( i=0; i<cmap->groups[cmt_cid].n; ++i )
- if ( enc>=cmap->groups[cmt_cid].ranges[i].first &&
- enc<=cmap->groups[cmt_cid].ranges[i].last )
-return( enc-cmap->groups[cmt_cid].ranges[i].first+
- cmap->groups[cmt_cid].ranges[i].cid );
-
-return( -1 );
-}
-
-static void SFEncodeToCMap(SplineFont *cidmaster,SplineFont *sf,EncMap *oldmap, struct cmap *cmap) {
- SplineChar *sc;
- int i,max=0, anyextras=0;
-
- cidmaster->cidregistry = cmap->registry; cmap->registry = NULL;
- cidmaster->ordering = cmap->ordering; cmap->ordering = NULL;
- cidmaster->supplement = cmap->supplement;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc = sf->glyphs[i])!=NULL ) {
- if ( strcmp(sc->name,".notdef")==0 )
- sc->orig_pos = 0;
- else if ( oldmap->backmap[i]==-1 )
- sc->orig_pos = -1;
- else {
- sc->orig_pos = Enc2CMap(cmap,oldmap->backmap[i]);
- if ( sc->orig_pos==0 ) sc->orig_pos = -1;
- }
- if ( sc->orig_pos>max ) max = sc->orig_pos;
- else if ( sc->orig_pos==-1 ) ++anyextras;
- }
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( anyextras ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buttons[3];
- buttons[0] = _("_Delete");
- buttons[1] = _("_Add");
- buttons[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buttons[] = { GTK_STOCK_DELETE, GTK_STOCK_ADD, NULL };
-#endif
- if ( gwwv_ask(_("Extraneous glyphs"),(const char **) buttons,0,1,_("The current encoding contains glyphs which I cannot map to CIDs.\nShould I delete them or add them to the end (where they may conflict with future ros definitions)?"))==1 ) {
- if ( cmap!=NULL && max<cmap->total ) max = cmap->total;
- anyextras = 0;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc = sf->glyphs[i])!=NULL ) {
- if ( sc->orig_pos == -1 ) sc->orig_pos = max + anyextras++;
- }
- max += anyextras;
- }
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- SFApplyOrdering(sf, max);
-}
-
-SplineFont *MakeCIDMaster(SplineFont *sf,EncMap *oldmap,int bycmap,char *cmapfilename, struct cidmap *cidmap) {
- SplineFont *cidmaster;
- struct cidmap *map;
- struct cmap *cmap;
- FontView *fvs;
- int freeme;
-
- cidmaster = SplineFontEmpty();
- SFFindNearTop(sf);
- if ( bycmap ) {
- freeme = false;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( cmapfilename==NULL ) {
- cmapfilename = gwwv_open_filename(_("Find an adobe CMap file..."),NULL,NULL,CMapFilter);
- freeme = true;
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- if ( cmapfilename==NULL ) {
- SplineFontFree(cidmaster);
-return(NULL);
- }
- cmap = ParseCMap(cmapfilename);
- if ( freeme )
- free(cmapfilename);
- if ( cmap==NULL ) {
- SplineFontFree(cidmaster);
-return(NULL);
- }
- CompressCMap(cmap);
- SFEncodeToCMap(cidmaster,sf,oldmap,cmap);
- cmapfree(cmap);
- } else {
- map = cidmap;
- if (map == NULL) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- map = AskUserForCIDMap(cidmaster); /* Sets the ROS fields */
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- } else {
- cidmaster->cidregistry = copy(map->registry);
- cidmaster->ordering = copy(map->ordering);
- cidmaster->supplement = map->supplement;
- }
- if ( map==NULL ) {
- SplineFontFree(cidmaster);
-return(NULL);
- }
- SFEncodeToMap(sf,map);
- }
- if ( sf->uni_interp!=ui_none && sf->uni_interp!=ui_unset )
- cidmaster->uni_interp = sf->uni_interp;
- else if ( strstrmatch(cidmaster->ordering,"japan")!=NULL )
- cidmaster->uni_interp = ui_japanese;
- else if ( strstrmatch(cidmaster->ordering,"CNS")!=NULL )
- cidmaster->uni_interp = ui_trad_chinese;
- else if ( strstrmatch(cidmaster->ordering,"GB")!=NULL )
- cidmaster->uni_interp = ui_simp_chinese;
- else if ( strstrmatch(cidmaster->ordering,"Korea")!=NULL )
- cidmaster->uni_interp = ui_korean;
- sf->uni_interp = cidmaster->uni_interp;
- cidmaster->fontname = copy(sf->fontname);
- cidmaster->fullname = copy(sf->fullname);
- cidmaster->familyname = copy(sf->familyname);
- cidmaster->weight = copy(sf->weight);
- cidmaster->copyright = copy(sf->copyright);
- cidmaster->cidversion = 1.0;
- cidmaster->display_antialias = sf->display_antialias;
- cidmaster->display_size = sf->display_size;
- cidmaster->ascent = sf->ascent /*880*/;
- cidmaster->descent = sf->descent /*120*/;
- cidmaster->changed = cidmaster->changed_since_autosave = true;
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- fvs->cidmaster = cidmaster;
- cidmaster->fv = sf->fv;
- sf->cidmaster = cidmaster;
- cidmaster->subfontcnt = 1;
- cidmaster->subfonts = gcalloc(2,sizeof(SplineFont *));
- cidmaster->subfonts[0] = sf;
- cidmaster->gpos_lookups = sf->gpos_lookups; sf->gpos_lookups = NULL;
- cidmaster->gsub_lookups = sf->gsub_lookups; sf->gsub_lookups = NULL;
- cidmaster->possub = sf->possub; sf->possub = NULL;
- cidmaster->kerns = sf->kerns; sf->kerns = NULL;
- cidmaster->vkerns = sf->vkerns; sf->vkerns = NULL;
- if ( sf->private==NULL )
- sf->private = gcalloc(1,sizeof(struct psdict));
- if ( !PSDictHasEntry(sf->private,"lenIV"))
- PSDictChangeEntry(sf->private,"lenIV","1"); /* It's 4 by default, in CIDs the convention seems to be 1 */
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- free(fvs->selected);
- fvs->selected = gcalloc(fvs->sf->glyphcnt,sizeof(char));
- EncMapFree(fvs->map);
- fvs->map = EncMap1to1(fvs->sf->glyphcnt);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVSetTitle(fvs);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
- SFRestoreNearTop(sf);
- CIDMasterAsDes(sf);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontViewReformatAll(sf);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-return( cidmaster );
-}
-
-int CountOfEncoding(Encoding *encoding_name) {
-return( encoding_name->char_cnt );
-}
-
-char *SFEncodingName(SplineFont *sf,EncMap *map) {
- char buffer[130];
-
- if ( sf->cidmaster!=NULL )
- sf = sf->cidmaster;
- if ( sf->subfontcnt!=0 ) {
- sprintf( buffer, "%.50s-%.50s-%d", sf->cidregistry, sf->ordering, sf->supplement );
-return( copy( buffer ));
- }
-return( copy( map->enc->enc_name ));
-}
-
-/* ************************** Reencoding routines ************************** */
-
-static void BDFOrigFixup(BDFFont *bdf,int orig_cnt,SplineFont *sf) {
- BDFChar **glyphs = gcalloc(orig_cnt,sizeof(BDFChar *));
- int i;
-
- for ( i=0; i<bdf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- glyphs[sf->glyphs[i]->orig_pos] = bdf->glyphs[i];
- if ( bdf->glyphs[i]!=NULL ) /* Not all glyphs exist in a piecemeal font */
- bdf->glyphs[i]->orig_pos = sf->glyphs[i]->orig_pos;
- }
- free(bdf->glyphs);
- bdf->glyphs = glyphs;
- bdf->glyphcnt = bdf->glyphmax = orig_cnt;
- bdf->ticked = true;
-}
-
-static int _SFForceEncoding(SplineFont *sf,EncMap *old, Encoding *new_enc) {
- int enc_cnt,i;
- BDFFont *bdf;
- FontView *fvs;
-
- /* Normally we base our encoding process on unicode code points. */
- /* but encodings like AdobeStandard are more interested in names than */
- /* code points. It is perfectly possible to have a font properly */
- /* encoded by code point which is not properly encoded by name */
- /* (might have f_i where it should have fi). So even if it's got */
- /* the right encoding, we still may want to force the names */
- if ( new_enc->is_custom )
-return(false); /* Custom, it's whatever's there */
-
- if ( new_enc->is_original ) {
- SplineChar **glyphs;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->orig_pos = -1;
- for ( i=enc_cnt=0; i<old->enccount; ++i )
- if ( old->map[i]!=-1 && sf->glyphs[old->map[i]]!=NULL &&
- sf->glyphs[old->map[i]]->orig_pos == -1 )
- sf->glyphs[old->map[i]]->orig_pos = enc_cnt++;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- if ( sf->glyphs[i]->orig_pos==-1 )
- sf->glyphs[i]->orig_pos = enc_cnt++;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- struct splinecharlist *scl;
- int layer;
- RefChar *ref;
-
- for ( scl=sf->glyphs[i]->dependents; scl!=NULL; scl=scl->next ) {
- for ( layer=ly_fore; layer<scl->sc->layer_cnt; ++layer )
- for ( ref = scl->sc->layers[layer].refs; ref!=NULL; ref=ref->next )
- ref->orig_pos = ref->sc->orig_pos;
- }
- }
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- fvs->map->ticked = false;
- if ( fvs->filled!=NULL ) fvs->filled->ticked = false;
- }
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame ) if ( !fvs->map->ticked ) {
- EncMap *map = fvs->map;
- for ( i=0; i<map->enccount; ++i ) if ( map->map[i]!=-1 )
- map->map[i] = sf->glyphs[map->map[i]]->orig_pos;
- if ( enc_cnt>map->backmax ) {
- free(map->backmap);
- map->backmax = enc_cnt;
- map->backmap = galloc(enc_cnt*sizeof(int));
- }
- memset(map->backmap,-1,enc_cnt*sizeof(int));
- for ( i=0; i<map->enccount; ++i ) if ( map->map[i]!=-1 )
- if ( map->backmap[map->map[i]]==-1 )
- map->backmap[map->map[i]] = i;
- map->ticked = true;
- }
- if ( !old->ticked )
- IError( "Unticked encmap" );
- for ( bdf=sf->bitmaps; bdf!=NULL; bdf=bdf->next )
- BDFOrigFixup(bdf,enc_cnt,sf);
- for ( fvs=sf->fv; fvs!=NULL ; fvs=fvs->nextsame ) {
- if ( fvs->filled!=NULL && !fvs->filled->ticked )
- BDFOrigFixup(sf->fv->filled,enc_cnt,sf);
- }
- glyphs = gcalloc(enc_cnt,sizeof(SplineChar *));
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- glyphs[sf->glyphs[i]->orig_pos] = sf->glyphs[i];
- free(sf->glyphs);
- sf->glyphs = glyphs;
- sf->glyphcnt = sf->glyphmax = enc_cnt;
-return( true );
- }
-
- enc_cnt = new_enc->char_cnt;
-
- if ( old->enccount<enc_cnt ) {
- if ( old->encmax<enc_cnt ) {
- old->map = grealloc(old->map,enc_cnt*sizeof(int));
- old->encmax = enc_cnt;
- }
- memset(old->map+old->enccount,-1,(enc_cnt-old->enccount)*sizeof(int));
- old->enccount = enc_cnt;
- }
- old->enc = new_enc;
- for ( i=0; i<old->enccount && i<enc_cnt; ++i ) if ( old->map[i]!=-1 && sf->glyphs[old->map[i]]!=NULL ) {
- SplineChar dummy;
- int j = old->map[i];
- SCBuildDummy(&dummy,sf,old,i);
- sf->glyphs[j]->unicodeenc = dummy.unicodeenc;
- free(sf->glyphs[j]->name);
- sf->glyphs[j]->name = copy(dummy.name);
- }
- /* We just changed the unicode values for most glyphs */
- /* but any references to them will have the old values, and that's bad, so fix 'em up */
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- struct splinecharlist *scl;
- int layer;
- RefChar *ref;
-
- for ( scl=sf->glyphs[i]->dependents; scl!=NULL; scl=scl->next ) {
- for ( layer=ly_fore; layer<scl->sc->layer_cnt; ++layer )
- for ( ref = scl->sc->layers[layer].refs; ref!=NULL; ref=ref->next )
- ref->unicode_enc = ref->sc->unicodeenc;
- }
- }
-return( true );
-}
-
-int SFForceEncoding(SplineFont *sf,EncMap *old, Encoding *new_enc) {
- if ( sf->mm!=NULL ) {
- MMSet *mm = sf->mm;
- int i;
- for ( i=0; i<mm->instance_count; ++i )
- _SFForceEncoding(mm->instances[i],old,new_enc);
- _SFForceEncoding(mm->normal,old,new_enc);
- } else
-return( _SFForceEncoding(sf,old,new_enc));
-
-return( true );
-}
-
-EncMap *EncMapFromEncoding(SplineFont *sf,Encoding *enc) {
- int i,j, extras, found, base, unmax;
- int *encoded, *unencoded;
- EncMap *map;
- struct altuni *altuni;
- SplineChar *sc;
-
- if ( enc==NULL )
-return( NULL );
-
- base = enc->char_cnt;
- if ( enc->is_original )
- base = 0;
- else if ( enc->char_cnt<=256 )
- base = 256;
- else if ( enc->char_cnt<=0x10000 )
- base = 0x10000;
- encoded = galloc(base*sizeof(int));
- memset(encoded,-1,base*sizeof(int));
- unencoded = galloc(sf->glyphcnt*sizeof(int));
- unmax = sf->glyphcnt;
-
- for ( i=extras=0; i<sf->glyphcnt; ++i ) if ( (sc=sf->glyphs[i])!=NULL ) {
- found = false;
- if ( enc->psnames!=NULL ) {
- for ( j=enc->char_cnt-1; j>=0; --j ) {
- if ( enc->psnames[j]!=NULL &&
- strcmp(enc->psnames[j],sc->name)==0 ) {
- found = true;
- encoded[j] = i;
- }
- }
- }
- if ( !found ) {
- if ( sc->unicodeenc!=-1 &&
- sc->unicodeenc<unicode4_size &&
- (j = EncFromUni(sc->unicodeenc,enc))!= -1 )
- encoded[j] = i;
- else {
- /* I don't think extras can surpass unmax now, but it doesn't */
- /* hurt to leave the code (it's from when we encoded duplicates see below) */
- if ( extras>=unmax ) unencoded = grealloc(unencoded,(unmax+=300)*sizeof(int));
- unencoded[extras++] = i;
- }
- for ( altuni=sc->altuni; altuni!=NULL; altuni=altuni->next ) {
- if ( altuni->unienc!=-1 &&
- altuni->unienc<unicode4_size &&
- (j = EncFromUni(altuni->unienc,enc))!= -1 )
- encoded[j] = i;
- /* I used to have code here to add these unencoded duplicates */
- /* but I don't really see any reason to do so. The main unicode */
- /* will occur, and any encoded duplicates so the glyph won't */
- /* vanish */
- }
- }
- }
-
- /* Some glyphs have both a pua encoding and an encoding in a non-bmp */
- /* plane. Big5HK does and the AMS glyphs do */
- if ( enc->is_unicodefull && (sf->uni_interp == ui_trad_chinese ||
- sf->uni_interp == ui_ams )) {
- extern const int cns14pua[], amspua[];
- const int *pua = sf->uni_interp == ui_ams? amspua : cns14pua;
- for ( i=0xe000; i<0xf8ff; ++i ) {
- if ( pua[i-0xe000]!=0 )
- encoded[pua[i-0xe000]] = encoded[i];
- }
- }
-
- if ( enc->psnames != NULL ) {
- /* Names are more important than unicode code points for some encodings */
- /* AdobeStandard for instance which won't work if you have a glyph */
- /* named "f_i" (must be "fi") even though the code point is correct */
- /* The code above would match f_i where AS requires fi, so force the */
- /* names to be correct. */
- for ( j=0; j<enc->char_cnt; ++j ) {
- if ( encoded[j]!=-1 && enc->psnames[j]!=NULL &&
- strcmp(sf->glyphs[encoded[j]]->name,enc->psnames[j])!=0 ) {
- free(sf->glyphs[encoded[j]]->name);
- sf->glyphs[encoded[j]]->name = copy(enc->psnames[j]);
- }
- }
- }
-
- map = chunkalloc(sizeof(EncMap));
- map->enccount = map->encmax = base + extras;
- map->map = galloc(map->enccount*sizeof(int));
- memcpy(map->map,encoded,base*sizeof(int));
- memcpy(map->map+base,unencoded,extras*sizeof(int));
- map->backmax = sf->glyphcnt;
- map->backmap = galloc(sf->glyphcnt*sizeof(int));
- memset(map->backmap,-1,sf->glyphcnt*sizeof(int)); /* Just in case there are some unencoded glyphs (duplicates perhaps) */
- for ( i = map->enccount-1; i>=0; --i ) if ( map->map[i]!=-1 )
- map->backmap[map->map[i]] = i;
- map->enc = enc;
-
- free(encoded);
- free(unencoded);
-
-return( map );
-}
-
-EncMap *CompactEncMap(EncMap *map, SplineFont *sf) {
- int i, inuse, gid;
- int32 *newmap;
-
- for ( i=inuse=0; i<map->enccount ; ++i )
- if ( (gid = map->map[i])!=-1 && SCWorthOutputting(sf->glyphs[gid]))
- ++inuse;
- newmap = galloc(inuse*sizeof(int32));
- for ( i=inuse=0; i<map->enccount ; ++i )
- if ( (gid = map->map[i])!=-1 && SCWorthOutputting(sf->glyphs[gid]))
- newmap[inuse++] = gid;
- free(map->map);
- map->map = newmap;
- map->enccount = inuse;
- map->encmax = inuse;
- map->enc = &custom;
- memset(map->backmap,-1,sf->glyphcnt*sizeof(int));
- for ( i=inuse-1; i>=0; --i )
- if ( (gid=map->map[i])!=-1 )
- map->backmap[gid] = i;
-return( map );
-}
-
-void SFRemoveGlyph(SplineFont *sf,SplineChar *sc, int *flags) {
- struct splinecharlist *dep, *dnext;
- BDFFont *bdf;
- BDFChar *bfc;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- CharView *cv, *next;
- BitmapView *bv, *bvnext;
- FontView *fvs;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- RefChar *refs, *rnext;
- KernPair *kp, *kprev;
- int i;
-
- if ( sc==NULL )
-return;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- /* Close any open windows */
- if ( sc->views ) {
- for ( cv = sc->views; cv!=NULL; cv=next ) {
- next = cv->next;
- GDrawDestroyWindow(cv->gw);
- }
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
- for ( bdf=sf->bitmaps; bdf!=NULL; bdf = bdf->next ) {
- if ( sc->orig_pos<bdf->glyphcnt && (bfc = bdf->glyphs[sc->orig_pos])!= NULL ) {
- bdf->glyphs[sc->orig_pos] = NULL;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( bfc->views!=NULL ) {
- for ( bv= bfc->views; bv!=NULL; bv=bvnext ) {
- bvnext = bv->next;
- GDrawDestroyWindow(bv->gw);
- }
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- BDFCharFree(bfc);
- }
- }
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- /* Turn any searcher references to this glyph into inline copies of it */
- for ( fvs=sc->parent->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- if ( fvs->sv!=NULL ) {
- RefChar *rf, *rnext;
- for ( rf = fvs->sv->sc_srch.layers[ly_fore].refs; rf!=NULL; rf=rnext ) {
- rnext = rf->next;
- if ( rf->sc==sc )
- SCRefToSplines(&fvs->sv->sc_srch,rf);
- }
- for ( rf = fvs->sv->sc_rpl.layers[ly_fore].refs; rf!=NULL; rf=rnext ) {
- rnext = rf->next;
- if ( rf->sc==sc )
- SCRefToSplines(&fvs->sv->sc_rpl,rf);
- }
- }
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
- /* Turn any references to this glyph into inline copies of it */
- for ( dep=sc->dependents; dep!=NULL; dep=dnext ) {
- SplineChar *dsc = dep->sc;
- RefChar *rf, *rnext;
- dnext = dep->next;
- /* May be more than one reference to us, colon has two refs to period */
- /* but only one dlist entry */
- for ( rf = dsc->layers[ly_fore].refs; rf!=NULL; rf=rnext ) {
- rnext = rf->next;
- if ( rf->sc==sc )
- SCRefToSplines(dsc,rf);
- }
- }
-
- for ( refs=sc->layers[ly_fore].refs; refs!=NULL; refs = rnext ) {
- rnext = refs->next;
- SCRemoveDependent(sc,refs);
- }
-
- /* Remove any kerning pairs that look at this character */
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- for ( kprev=NULL, kp=sf->glyphs[i]->kerns; kp!=NULL; kprev = kp, kp=kp->next ) {
- if ( kp->sc==sc ) {
- if ( kprev==NULL )
- sf->glyphs[i]->kerns = kp->next;
- else
- kprev->next = kp->next;
- kp->next = NULL;
- KernPairsFree(kp);
- break;
- }
- }
- }
-
- sf->glyphs[sc->orig_pos] = NULL;
- SplineCharFree(sc);
-}
-
-void FVAddEncodingSlot(FontView *fv,int gid) {
- EncMap *map = fv->map;
- int enc;
-
- if ( map->enccount>=map->encmax )
- map->map = grealloc(map->map,(map->encmax+=10)*sizeof(int));
- enc = map->enccount++;
- map->map[enc] = gid;
- map->backmap[gid] = enc;
-
- fv->selected = grealloc(fv->selected,map->enccount);
- fv->selected[enc] = 0;
- if ( fv->colcnt!=0 ) { /* Ie. scripting vs. UI */
- fv->rowltot = (enc+1+fv->colcnt-1)/fv->colcnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- GScrollBarSetBounds(fv->vsb,0,fv->rowltot,fv->rowcnt);
-#endif
- }
-}
-
-void SFAddEncodingSlot(SplineFont *sf,int gid) {
- FontView *fv;
- for ( fv=sf->fv; fv!=NULL; fv = fv->nextsame )
- FVAddEncodingSlot(fv,gid);
-}
-
-static int MapAddEnc(SplineFont *sf,SplineChar *sc,EncMap *basemap, EncMap *map,int baseenc, int gid, FontView *fv) {
- int any = false, enc;
-
- if ( gid>=map->backmax ) {
- map->backmap = grealloc(map->backmap,(map->backmax+=10)*sizeof(int));
- memset(map->backmap+map->backmax-10,-1,10*sizeof(int));
- }
- if ( map->enc->psnames!=NULL ) {
- /* Check for multiple encodings */
- for ( enc = map->enc->char_cnt-1; enc>=0; --enc ) {
- if ( map->enc->psnames[enc]!=NULL && strcmp(sc->name,map->enc->psnames[enc])==0 ) {
- if ( !any ) {
- map->backmap[gid] = enc;
- any = true;
- }
- map->map[enc] = gid;
- }
- }
- } else {
- enc = SFFindSlot(sf,map,sc->unicodeenc,sc->name);
- if ( enc!=-1 ) {
- map->map[enc] = gid;
- map->backmap[gid] = enc;
- any = true;
- }
- }
- if ( basemap!=NULL && map->enc==basemap->enc && baseenc!=-1 ) {
- if ( baseenc>=map->enccount )
- FVAddEncodingSlot(fv,gid);
- else {
- map->map[baseenc] = gid;
- if ( map->backmap[gid]==-1 )
- map->backmap[gid] = baseenc;
- }
- any = true;
- }
-return( any );
-}
-
-void SFAddGlyphAndEncode(SplineFont *sf,SplineChar *sc,EncMap *basemap, int baseenc) {
- int gid, mapfound = false;
- FontView *fv;
- BDFFont *bdf;
-
- if ( sf->cidmaster==NULL ) {
- if ( sf->glyphcnt+1>=sf->glyphmax )
- sf->glyphs = grealloc(sf->glyphs,(sf->glyphmax+=10)*sizeof(SplineChar *));
- gid = sf->glyphcnt++;
- for ( bdf = sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- if ( sf->glyphcnt+1>=bdf->glyphmax )
- bdf->glyphs = grealloc(bdf->glyphs,(bdf->glyphmax=sf->glyphmax)*sizeof(BDFChar *));
- if ( sf->glyphcnt>bdf->glyphcnt ) {
- memset(bdf->glyphs+bdf->glyphcnt,0,(sf->glyphcnt-bdf->glyphcnt)*sizeof(BDFChar *));
- bdf->glyphcnt = sf->glyphcnt;
- }
- }
- for ( fv=sf->fv; fv!=NULL; fv = fv->nextsame ) {
- EncMap *map = fv->map;
- if ( gid>=map->backmax )
- map->backmap = grealloc(map->backmap,(map->backmax=gid+10)*sizeof(int));
- map->backmap[gid] = -1;
- }
- } else {
- gid = baseenc;
- if ( baseenc+1>=sf->glyphmax )
- sf->glyphs = grealloc(sf->glyphs,(sf->glyphmax = baseenc+10)*sizeof(SplineChar *));
- if ( baseenc>=sf->glyphcnt ) {
- memset(sf->glyphs+sf->glyphcnt,0,(baseenc+1-sf->glyphcnt)*sizeof(SplineChar *));
- sf->glyphcnt = baseenc+1;
- for ( bdf = sf->cidmaster->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- if ( baseenc+1>=bdf->glyphmax )
- bdf->glyphs = grealloc(bdf->glyphs,(bdf->glyphmax=baseenc+10)*sizeof(BDFChar *));
- if ( baseenc+1>bdf->glyphcnt ) {
- memset(bdf->glyphs+bdf->glyphcnt,0,(baseenc+1-bdf->glyphcnt)*sizeof(BDFChar *));
- bdf->glyphcnt = baseenc+1;
- }
- }
- for ( fv=sf->fv; fv!=NULL; fv = fv->nextsame ) if ( fv->sf==sf ) {
- EncMap *map = fv->map;
- if ( gid>=map->backmax )
- map->backmap = grealloc(map->backmap,(map->backmax=gid+10)*sizeof(int));
- map->backmap[gid] = -1;
- }
- }
- }
- sf->glyphs[gid] = NULL;
- for ( fv=sf->fv; fv!=NULL; fv = fv->nextsame ) {
- EncMap *map = fv->map;
- BDFFont *bdf = fv->filled;
-
- if ( bdf!=NULL ) {
- if ( gid>=bdf->glyphmax )
- bdf->glyphs = grealloc(bdf->glyphs,sf->glyphmax*sizeof(BDFChar *));
- if ( gid>=bdf->glyphcnt ) {
- memset(bdf->glyphs+bdf->glyphcnt,0,(gid+1-bdf->glyphcnt)*sizeof(BDFChar *));
- bdf->glyphcnt = gid+1;
- }
- }
- if ( !MapAddEnc(sf,sc,basemap,map,baseenc,gid,fv) )
- FVAddEncodingSlot(fv,gid);
- if ( map==basemap ) mapfound = true;
- }
- if ( !mapfound && basemap!=NULL )
- MapAddEnc(sf,sc,basemap,basemap,baseenc,gid,fv);
- sf->glyphs[gid] = sc;
- sc->orig_pos = gid;
- sc->parent = sf;
- SFHashGlyph(sf,sc);
-}
-
-static SplineChar *SplineCharMatch(SplineFont *parent,SplineChar *sc) {
- SplineChar *scnew = SplineCharCreate();
-
- scnew->parent = parent;
- scnew->orig_pos = sc->orig_pos;
- scnew->name = copy(sc->name);
- scnew->unicodeenc = sc->unicodeenc;
- scnew->width = sc->width;
- scnew->vwidth = sc->vwidth;
- scnew->widthset = true;
-return( scnew );
-}
-
-void SFMatchGlyphs(SplineFont *sf,SplineFont *target,int addempties) {
- /* reorder sf so that its glyphs array is the same as that in target */
- int i, j, cnt, cnt2;
- SplineChar **glyphs;
- BDFFont *bdf;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->ticked = false;
- if (( cnt = target->glyphcnt )<sf->glyphcnt ) cnt = sf->glyphcnt;
- glyphs = gcalloc(cnt,sizeof(SplineChar *));
- for ( i=0; i<target->glyphcnt; ++i ) if ( target->glyphs[i]!=NULL ) {
- SplineChar *sc = SFGetChar(sf,target->glyphs[i]->unicodeenc,target->glyphs[i]->name );
- if ( sc==NULL && addempties )
- sc = SplineCharMatch(sf,target->glyphs[i]);
- if ( sc!=NULL ) {
- glyphs[i] = sc;
- sc->ticked = true;
- }
- }
- for ( i=cnt2=0; i<sf->glyphcnt; ++i )
- if ( sf->glyphs[i]!=NULL && !sf->glyphs[i]->ticked )
- ++cnt2;
- if ( target->glyphcnt+cnt2>cnt ) {
- glyphs = grealloc(glyphs,(target->glyphcnt+cnt2)*sizeof(SplineChar *));
- memset(glyphs+cnt,0,(target->glyphcnt+cnt2-cnt)*sizeof(SplineChar *));
- cnt = target->glyphcnt+cnt2;
- }
- j = target->glyphcnt;
- for ( i=0; i<sf->glyphcnt; ++i )
- if ( sf->glyphs[i]!=NULL && !sf->glyphs[i]->ticked )
- glyphs[j++] = sf->glyphs[i];
- free(sf->glyphs);
- sf->glyphs = glyphs;
- sf->glyphcnt = sf->glyphmax = cnt;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->orig_pos = i;
- for ( bdf = sf->bitmaps; bdf!=NULL; bdf = bdf->next ) {
- BDFChar **glyphs;
- glyphs = gcalloc(sf->glyphcnt,sizeof(BDFChar *));
- for ( i=0; i<bdf->glyphcnt; ++i ) if ( bdf->glyphs[i]!=NULL )
- glyphs[bdf->glyphs[i]->sc->orig_pos] = bdf->glyphs[i];
- free(bdf->glyphs);
- bdf->glyphs = glyphs;
- bdf->glyphcnt = bdf->glyphmax = sf->glyphcnt;
- }
-}
-
-void MMMatchGlyphs(MMSet *mm) {
- /* reorder all instances so that they have the same orig_pos */
- int i, j, index, lasthole;
- SplineFont *sf, *base = NULL;
- SplineChar *sc, *scnew, *sc2;
-
- for ( i = 0; i<mm->instance_count; ++i ) if ( mm->instances[i]!=NULL ) {
- base = mm->instances[i];
- break;
- }
- if ( base==NULL )
-return;
-
- /* First build up an ordering that uses all glyphs found in any of the */
- /* sub-fonts, "base" will be the start of it. We will add glyphs to */
- /* "base" as needed */
- lasthole = -1;
- for ( i = 0; i<mm->instance_count; ++i ) if ( (sf=mm->instances[i])!=NULL && sf!=NULL ) {
- for ( j=0; j<sf->glyphcnt; ++j ) if ( (sc=sf->glyphs[j])!=NULL ) {
- if ( j<base->glyphcnt && base->glyphs[j]!=NULL &&
- base->glyphs[j]->unicodeenc==sc->unicodeenc &&
- strcmp(base->glyphs[j]->name,sc->name)==0 )
- continue; /* It's good, and in the same place */
- else if ( (sc2=SFGetChar(base,sc->unicodeenc,sc->name))!=NULL &&
- sc2->unicodeenc==sc->unicodeenc &&
- strcmp(sc2->name,sc->name)==0 )
- continue; /* Well, it's in there somewhere */
- else {
- /* We need to add it */
- if ( j<base->glyphcnt && base->glyphs[j]==NULL )
- index = j;
- else {
- for ( ++lasthole ; lasthole<base->glyphcnt && base->glyphs[lasthole]!=NULL; ++lasthole );
- index = lasthole;
- if ( lasthole>=base->glyphmax )
- base->glyphs = grealloc(base->glyphs,(base->glyphmax+=20)*sizeof(SplineChar *));
- if ( lasthole>=base->glyphcnt )
- base->glyphcnt = lasthole+1;
- }
- base->glyphs[index] = scnew = SplineCharMatch(base,sc);
- scnew->orig_pos = index;
- }
- }
- }
-
- /* Now force all other instances to match */
- for ( i = 0; i<mm->instance_count; ++i ) if ( (sf=mm->instances[i])!=NULL && sf!=NULL )
- SFMatchGlyphs(sf,base,true);
- if ( mm->normal!=NULL )
- SFMatchGlyphs(mm->normal,base,true);
-}
-
-GTextInfo encodingtypes[] = {
- { (unichar_t *) N_("Custom"), NULL, 0, 0, (void *) "Custom", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Encoding|Glyph Order"), NULL, 0, 0, (void *) "Original", NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL, NULL, 0, 0, NULL, NULL, 1, 0, 0, 0, 0, 1, 0 },
- { (unichar_t *) N_("ISO 8859-1 (Latin1)"), NULL, 0, 0, (void *) "iso8859-1", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-15 (Latin0)"), NULL, 0, 0, (void *) "iso8859-15", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-2 (Latin2)"), NULL, 0, 0, (void *) "iso8859-2", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-3 (Latin3)"), NULL, 0, 0, (void *) "iso8859-3", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-4 (Latin4)"), NULL, 0, 0, (void *) "iso8859-4", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-9 (Latin5)"), NULL, 0, 0, (void *) "iso8859-9", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-10 (Latin6)"), NULL, 0, 0, (void *) "iso8859-10", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-13 (Latin7)"), NULL, 0, 0, (void *) "iso8859-13", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-14 (Latin8)"), NULL, 0, 0, (void *) "iso8859-14", NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL, NULL, 0, 0, NULL, NULL, 1, 0, 0, 0, 0, 1, 0 },
- { (unichar_t *) N_("ISO 8859-5 (Cyrillic)"), NULL, 0, 0, (void *) "iso8859-5", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("KOI8-R (Cyrillic)"), NULL, 0, 0, (void *) "koi8-r", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-6 (Arabic)"), NULL, 0, 0, (void *) "iso8859-6", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-7 (Greek)"), NULL, 0, 0, (void *) "iso8859-7", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-8 (Hebrew)"), NULL, 0, 0, (void *) "iso8859-8", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 8859-11 (Thai)"), NULL, 0, 0, (void *) "iso8859-11", NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL, NULL, 0, 0, NULL, NULL, 1, 0, 0, 0, 0, 1, 0 },
- { (unichar_t *) N_("Macintosh Latin"), NULL, 0, 0, (void *) "mac", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Windows Latin (\"ANSI\")"), NULL, 0, 0, (void *) "win", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Adobe Standard"), NULL, 0, 0, (void *) "AdobeStandard", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Symbol"), NULL, 0, 0, (void *) "Symbol", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) NU_("ΤεΧ Base (8r)"), NULL, 0, 0, (void *) "TeX-Base-Encoding", NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL, NULL, 0, 0, NULL, NULL, 1, 0, 0, 0, 0, 1, 0 },
- { (unichar_t *) N_("ISO 10646-1 (Unicode, BMP)"), NULL, 0, 0, (void *) "UnicodeBmp", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("ISO 10646-1 (Unicode, Full)"), NULL, 0, 0, (void *) "UnicodeFull", NULL, 0, 0, 0, 0, 0, 0, 1},
- /*{ (unichar_t *) N_("ISO 10646-? (by plane) ..."), NULL, 0, 0, (void *) em_unicodeplanes, NULL, 0, 0, 0, 0, 0, 0, 1}*/
- { NULL, NULL, 0, 0, NULL, NULL, 1, 0, 0, 0, 0, 1, 0 },
- { (unichar_t *) N_("SJIS (Kanji)"), NULL, 0, 0, (void *) "sjis", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("JIS 208 (Kanji)"), NULL, 0, 0, (void *) "jis208", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("JIS 212 (Kanji)"), NULL, 0, 0, (void *) "jis212", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Wansung (Korean)"), NULL, 0, 0, (void *) "wansung", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("KSC 5601-1987 (Korean)"), NULL, 0, 0, (void *) "ksc5601", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Johab (Korean)"), NULL, 0, 0, (void *) "johab", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("GB 2312 (Simp. Chinese)"), NULL, 0, 0, (void *) "gb2312", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("EUC GB 2312 (Chinese)"), NULL, 0, 0, (void *) "gb2312pk", NULL, 0, 0, 0, 0, 0, 0, 1},
-#ifdef FONTFORGE_CONFIG_GB12345
- { (unichar_t *) N_("EUC-GB12345"), NULL, 0, 0, (void *) "GB12345-EUC", NULL, 0, 0, 0, 0, 0, 0, 1, 0},
-#endif
- { (unichar_t *) N_("Big5 (Trad. Chinese)"), NULL, 0, 0, (void *) "big5", NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Big5 HKSCS (Trad. Chinese)"), NULL, 0, 0, (void *) "big5hkscs", NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-
-static void EncodingInit(void) {
- int i;
- static int done = false;
-
- if ( done )
-return;
- done = true;
- for ( i=0; i<sizeof(encodingtypes)/sizeof(encodingtypes[0])-1; ++i ) {
- if ( !encodingtypes[i].line )
- encodingtypes[i].text = (unichar_t *) S_((char *) encodingtypes[i].text);
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-GMenuItem *GetEncodingMenu(void (*func)(GWindow,GMenuItem *,GEvent *),
- Encoding *current) {
- GMenuItem *mi;
- int i, cnt;
- Encoding *item;
-
- EncodingInit();
-
- cnt = 0;
- for ( item=enclist; item!=NULL ; item=item->next )
- if ( !item->hidden )
- ++cnt;
- i = cnt+1;
- i += sizeof(encodingtypes)/sizeof(encodingtypes[0]);
- mi = gcalloc(i+1,sizeof(GMenuItem));
- for ( i=0; i<sizeof(encodingtypes)/sizeof(encodingtypes[0])-1; ++i ) {
- mi[i].ti = encodingtypes[i];
- if ( !mi[i].ti.line ) {
- mi[i].ti.text = utf82u_copy((char *) (mi[i].ti.text));
- mi[i].ti.checkable = true;
- if ( strmatch(mi[i].ti.userdata,current->enc_name)==0 ||
- (current->iconv_name!=NULL && strmatch(mi[i].ti.userdata,current->iconv_name)==0))
- mi[i].ti.checked = true;
- }
- mi[i].ti.text_is_1byte = false;
- mi[i].ti.fg = mi[i].ti.bg = COLOR_DEFAULT;
- mi[i].invoke = func;
- }
- if ( cnt!=0 ) {
- mi[i].ti.fg = mi[i].ti.bg = COLOR_DEFAULT;
- mi[i++].ti.line = true;
- for ( item=enclist; item!=NULL ; item=item->next )
- if ( !item->hidden ) {
- mi[i].ti.text = utf82u_copy(item->enc_name);
- mi[i].ti.userdata = (void *) item->enc_name;
- mi[i].ti.fg = mi[i].ti.bg = COLOR_DEFAULT;
- mi[i].ti.checkable = true;
- if ( item==current )
- mi[i].ti.checked = true;
- mi[i++].invoke = func;
- }
- }
-return( mi );
-}
-#endif
-
-GTextInfo *GetEncodingTypes(void) {
- GTextInfo *ti;
- int i, cnt;
- Encoding *item;
-
- EncodingInit();
-
- cnt = 0;
- for ( item=enclist; item!=NULL ; item=item->next )
- if ( !item->hidden )
- ++cnt;
- i = cnt + sizeof(encodingtypes)/sizeof(encodingtypes[0]);
- ti = gcalloc(i+1,sizeof(GTextInfo));
- memcpy(ti,encodingtypes,sizeof(encodingtypes)-sizeof(encodingtypes[0]));
- for ( i=0; i<sizeof(encodingtypes)/sizeof(encodingtypes[0])-1; ++i ) {
- ti[i].text = (unichar_t *) copy((char *) ti[i].text);
- }
- if ( cnt!=0 ) {
- ti[i++].line = true;
- for ( item=enclist; item!=NULL ; item=item->next )
- if ( !item->hidden ) {
- ti[i].text = uc_copy(item->enc_name);
- ti[i++].userdata = (void *) item->enc_name;
- }
- }
-return( ti );
-}
-
-GTextInfo *EncodingTypesFindEnc(GTextInfo *encodingtypes, Encoding *enc) {
- int i;
- char *name;
- Encoding *new_enc;
-
- for ( i=0; encodingtypes[i].text!=NULL || encodingtypes[i].line; ++i ) {
- if ( encodingtypes[i].text==NULL )
- continue;
- name = encodingtypes[i].userdata;
- new_enc = FindOrMakeEncoding(name);
- if ( new_enc==NULL )
- continue;
- if ( enc==new_enc )
-return( &encodingtypes[i] );
- }
-return( NULL );
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-Encoding *ParseEncodingNameFromList(GGadget *listfield) {
- const unichar_t *name = _GGadgetGetTitle(listfield);
- int32 len;
- GTextInfo **ti = GGadgetGetList(listfield,&len);
- int i;
- Encoding *enc = NULL;
-
- for ( i=0; i<len; ++i ) if ( ti[i]->text!=NULL ) {
- if ( u_strcmp(name,ti[i]->text)==0 ) {
- enc = FindOrMakeEncoding(ti[i]->userdata);
- break;
- }
- }
-
- if ( enc == NULL ) {
- char *temp = u2utf8_copy(name);
- enc = FindOrMakeEncoding(temp);
- free(temp);
- }
- if ( enc==NULL )
- gwwv_post_error(_("Bad Encoding"),_("Bad Encoding"));
-return( enc );
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-void SFExpandGlyphCount(SplineFont *sf, int newcnt) {
- int old = sf->glyphcnt;
- FontView *fv;
-
- if ( old>=newcnt )
-return;
- if ( sf->glyphmax<newcnt ) {
- sf->glyphs = grealloc(sf->glyphs,newcnt*sizeof(SplineChar *));
- sf->glyphmax = newcnt;
- }
- memset(sf->glyphs+sf->glyphcnt,0,(newcnt-sf->glyphcnt)*sizeof(SplineChar *));
- sf->glyphcnt = newcnt;
-
- for ( fv=sf->fv; fv!=NULL; fv=fv->nextsame ) {
- if ( fv->sf==sf ) { /* Beware of cid keyed fonts which might look at a different subfont */
- if ( fv->normal!=NULL )
- continue; /* If compacted then we haven't added any glyphs so haven't changed anything */
- /* Don't display any of these guys, so not mapped. */
- /* No change to selection, or to map->map, but change to backmap */
- if ( newcnt>fv->map->backmax )
- fv->map->backmap = grealloc(fv->map->backmap,(fv->map->backmax = newcnt+5)*sizeof(int32));
- memset(fv->map->backmap+old,-1,(newcnt-old)*sizeof(int32));
- }
- }
-}
-
-
-
-
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontinfo.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontinfo.c
deleted file mode 100644
index da8f2441c1f..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontinfo.c
+++ /dev/null
@@ -1,10184 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include "ofl.h"
-#include <ustring.h>
-#include <chardata.h>
-#include <utype.h>
-#include "unicoderange.h"
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-extern int _GScrollBar_Width;
-#endif
-#include <gkeysym.h>
-#include <math.h>
-#include <unistd.h>
-#include <time.h>
-
-#ifdef LUA_FF_LIB
-#define Isspace(a) (a==' ')
-#else
-#define Isspace isspace
-#endif
-
-#ifndef LUA_FF_LIB
-static int last_aspect=0;
-#endif
-
-GTextInfo emsizes[] = {
- { (unichar_t *) "1000", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "1024", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "2048", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "4096", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }
-};
-
-GTextInfo interpretations[] = {
-/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "None", ignore "Interpretation|" */
-/* GT: In french this could be "Aucun" or "Aucune" depending on the gender */
-/* GT: of "Interpretation" */
- { (unichar_t *) N_("Interpretation|None"), NULL, 0, 0, (void *) ui_none, NULL, 0, 0, 0, 0, 0, 0, 1},
-/* { (unichar_t *) N_("Adobe Public Use Defs."), NULL, 0, 0, (void *) ui_adobe, NULL, 0, 0, 0, 0, 0, 0, 1}, */
-/* { (unichar_t *) N_("Greek"), NULL, 0, 0, (void *) ui_greek, NULL, 0, 0, 0, 0, 0, 0, 1}, */
- { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) ui_japanese, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Traditional Chinese"), NULL, 0, 0, (void *) ui_trad_chinese, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Simplified Chinese"), NULL, 0, 0, (void *) ui_simp_chinese, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) ui_korean, NULL, 0, 0, 0, 0, 0, 0, 1},
-/* { (unichar_t *) N_("AMS Public Use"), NULL, 0, 0, (void *) ui_ams, NULL, 0, 0, 0, 0, 0, 0, 1}, */
- { NULL }};
-GTextInfo macstyles[] = {
- { (unichar_t *) N_("MacStyles|Bold"), NULL, 0, 0, (void *) sf_bold, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MacStyles|Italic"), NULL, 0, 0, (void *) sf_italic, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MacStyles|Condense"), NULL, 0, 0, (void *) sf_condense, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MacStyles|Expand"), NULL, 0, 0, (void *) sf_extend, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MacStyles|Underline"), NULL, 0, 0, (void *) sf_underline, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MacStyles|Outline"), NULL, 0, 0, (void *) sf_outline, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MacStyles|Shadow"), NULL, 0, 0, (void *) sf_shadow, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo widthclass[] = {
- { (unichar_t *) N_("Ultra-Condensed (50%)"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Extra-Condensed (62.5%)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Condensed (75%)"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Semi-Condensed (87.5%)"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Medium (100%)"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Semi-Expanded (112.5%)"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Expanded (125%)"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Extra-Expanded (150%)"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Ultra-Expanded (200%)"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo weightclass[] = {
- { (unichar_t *) N_("100 Thin"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("200 Extra-Light"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("300 Light"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("400 Book"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("500 Medium"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("600 Demi-Bold"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("700 Bold"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("800 Heavy"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("900 Black"), NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo fstype[] = {
- { (unichar_t *) N_("Never Embed/No Editing"), NULL, 0, 0, (void *) 0x02, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Printable Document"), NULL, 0, 0, (void *) 0x04, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Editable Document"), NULL, 0, 0, (void *) 0x08, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Installable Font"), NULL, 0, 0, (void *) 0x00, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo pfmfamily[] = {
- { (unichar_t *) N_("Serif"), NULL, 0, 0, (void *) 0x11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x21, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Monospace"), NULL, 0, 0, (void *) 0x31, NULL, 0, 0, 0, 0, 0, 0, 1},
-/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
-/* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
-/* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
- { (unichar_t *) N_("cursive|Script"), NULL, 0, 0, (void *) 0x41, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Decorative"), NULL, 0, 0, (void *) 0x51, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo ibmfamily[] = {
- { (unichar_t *) N_("No Classification"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Old Style Serifs"), NULL, 0, 0, (void *) 0x100, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Rounded Legibility"), NULL, 0, 0, (void *) 0x101, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Geralde"), NULL, 0, 0, (void *) 0x102, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Venetian"), NULL, 0, 0, (void *) 0x103, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Modified Venetian"), NULL, 0, 0, (void *) 0x104, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Dutch Modern"), NULL, 0, 0, (void *) 0x105, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Dutch Trad"), NULL, 0, 0, (void *) 0x106, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Contemporary"), NULL, 0, 0, (void *) 0x107, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Calligraphic"), NULL, 0, 0, (void *) 0x108, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("OSS Miscellaneous"), NULL, 0, 0, (void *) 0x10f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Transitional Serifs"), NULL, 0, 0, (void *) 0x200, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("TS Direct Line"), NULL, 0, 0, (void *) 0x201, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("TS Script"), NULL, 0, 0, (void *) 0x202, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("TS Miscellaneous"), NULL, 0, 0, (void *) 0x20f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Modern Serifs"), NULL, 0, 0, (void *) 0x300, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MS Italian"), NULL, 0, 0, (void *) 0x301, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MS Script"), NULL, 0, 0, (void *) 0x302, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("MS Miscellaneous"), NULL, 0, 0, (void *) 0x30f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Clarendon Serifs"), NULL, 0, 0, (void *) 0x400, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Clarendon"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Modern"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Traditional"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Newspaper"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Stub Serif"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Monotone"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Typewriter"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CS Miscellaneous"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slab Serifs"), NULL, 0, 0, (void *) 0x500, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slab Serifs|SS Monotone"), NULL, 0, 0, (void *) 0x501, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slab Serifs|SS Humanist"), NULL, 0, 0, (void *) 0x502, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slab Serifs|SS Geometric"), NULL, 0, 0, (void *) 0x503, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slab Serifs|SS Swiss"), NULL, 0, 0, (void *) 0x504, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slab Serifs|SS Typewriter"), NULL, 0, 0, (void *) 0x505, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slab Serifs|SS Miscellaneous"), NULL, 0, 0, (void *) 0x50f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Freeform Serifs"), NULL, 0, 0, (void *) 0x700, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("FS Modern"), NULL, 0, 0, (void *) 0x701, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("FS Miscellaneous"), NULL, 0, 0, (void *) 0x70f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif"), NULL, 0, 0, (void *) 0x800, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS IBM NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS Humanist"), NULL, 0, 0, (void *) 0x802, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS Low-x Round Geometric"), NULL, 0, 0, (void *) 0x803, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS High-x Round Geometric"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS NeoGrotesque Gothic"), NULL, 0, 0, (void *) 0x805, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS Modified Grotesque Gothic"), NULL, 0, 0, (void *) 0x806, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS Typewriter Gothic"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS Matrix"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sans-Serif|SS Miscellaneous"), NULL, 0, 0, (void *) 0x80f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Ornamentals"), NULL, 0, 0, (void *) 0x900, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("O Engraver"), NULL, 0, 0, (void *) 0x901, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("O Black Letter"), NULL, 0, 0, (void *) 0x902, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("O Decorative"), NULL, 0, 0, (void *) 0x903, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("O Three Dimensional"), NULL, 0, 0, (void *) 0x904, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("O Miscellaneous"), NULL, 0, 0, (void *) 0x90f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Scripts"), NULL, 0, 0, (void *) 0xa00, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Uncial"), NULL, 0, 0, (void *) 0xa01, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Brush Joined"), NULL, 0, 0, (void *) 0xa02, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Formal Joined"), NULL, 0, 0, (void *) 0xa03, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Monotone Joined"), NULL, 0, 0, (void *) 0xa04, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Calligraphic"), NULL, 0, 0, (void *) 0xa05, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Brush Unjoined"), NULL, 0, 0, (void *) 0xa06, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Formal Unjoined"), NULL, 0, 0, (void *) 0xa07, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Monotone Unjoined"), NULL, 0, 0, (void *) 0xa08, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("S Miscellaneous"), NULL, 0, 0, (void *) 0xa0f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Symbolic"), NULL, 0, 0, (void *) 0xc00, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sy Mixed Serif"), NULL, 0, 0, (void *) 0xc03, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sy Old Style Serif"), NULL, 0, 0, (void *) 0xc06, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sy Neo-grotesque Sans Serif"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sy Miscellaneous"), NULL, 0, 0, (void *) 0xc0f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo os2versions[] = {
- { (unichar_t *) N_("OS2Version|Automatic"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("2"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("3"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("4"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-#ifndef LUA_FF_LIB
-static GTextInfo gaspversions[] = {
- { (unichar_t *) N_("0"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("1"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-#endif
-static GTextInfo panfamily[] = {
- { (unichar_t *) N_("PanoseFamily|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseFamily|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Text & Display"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
-/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "Script", ignore "cursive|" */
-/* GT: English uses "script" to me a general writing style (latin, greek, kanji) */
-/* GT: and the cursive handwriting style. Here we mean cursive handwriting. */
- { (unichar_t *) N_("cursive|Script"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Decorative"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Pictorial"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "6", NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "7", NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panserifs[] = {
- { (unichar_t *) N_("PanoseSerifs|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseSerifs|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Cove"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Obtuse Cove"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Square Cove"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Obtuse Square Cove"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseSerivfs|Square"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseSerifs|Thin"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Bone"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Exaggerated"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Triangle"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal Sans"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Obtuse Sans"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Perp Sans"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Flared"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseSerivfs|Rounded"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panweight[] = {
- { (unichar_t *) N_("PanoseWeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseWeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Very Light"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Light"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseWeight|Thin"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Book"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Demi"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Bold"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Heavy"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Black"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Nord"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panprop[] = {
- { (unichar_t *) N_("PanoseProportion|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseProportion|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Old Style"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Modern"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Even Width"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Expanded"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Condensed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Very Expanded"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Very Condensed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Monospaced"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo pancontrast[] = {
- { (unichar_t *) N_("PanoseContrast|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|None"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|Very Low"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|Low"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|Medium Low"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|Medium"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|Medium High"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|High"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseContrast|Very High"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panstrokevar[] = {
- { (unichar_t *) N_("PanoseStrokeVariation|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseStrokeVariation|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Gradual/Diagonal"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Gradual/Transitional"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Gradual/Vertical"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Gradual/Horizontal"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Rapid/Vertical"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Rapid/Horizontal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Instant/Vertical"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panarmstyle[] = {
- { (unichar_t *) N_("PanoseArmStyle|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseArmStyle|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Straight Arms/Horizontal"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Straight Arms/Wedge"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Straight Arms/Vertical"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Straight Arms/Single Serif"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Straight Arms/Double Serif"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Non-Straight Arms/Horizontal"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Non-Straight Arms/Wedge"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Non-Straight Arms/Vertical"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Non-Straight Arms/Single Serif"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Non-Straight Arms/Double Serif"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panletterform[] = {
- { (unichar_t *) N_("PanoseLetterform|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseLetterform|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal/Contact"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal/Weighted"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal/Boxed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal/Flattened"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal/Rounded"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal/Off-Center"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Normal/Square"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Oblique/Contact"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Oblique/Weighted"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Oblique/Boxed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Oblique/Rounded"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Oblique/Off-Center"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Oblique/Square"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panmidline[] = {
- { (unichar_t *) N_("PanoseMidline|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Standard/Trimmed"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Standard/Pointed"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Standard/Serifed"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|High/Trimmed"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|High/Pointed"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|High/Serifed"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Constant/Trimmed"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Constant/Pointed"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Constant/Serifed"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Low/Trimmed"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Low/Pointed"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseMidline|Low/Serifed"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo panxheight[] = {
- { (unichar_t *) N_("PanoseXHeight|Any"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseXHeight|No Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseXHeight|Constant/Small"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseXHeight|Constant/Standard"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseXHeight|Constant/Large"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseXHeight|Ducking/Small"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseXHeight|Ducking/Standard"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("PanoseXHeight|Ducking/Large"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "8", NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "9", NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "10", NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "11", NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "12", NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "13", NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "14", NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "15", NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-
-#ifndef LUA_FF_LIB
-static struct ms_2_locales { char *loc_name; int local_id; } ms_2_locals[] = {
- { "af", 0x436 },
- { "sq_AL", 0x41c },
- { "am", 0x45e },
- { "ar_SA", 0x401 },
- { "ar_IQ", 0x801 },
- { "ar_EG", 0xc01 },
- { "ar_LY", 0x1001 },
- { "ar_DZ", 0x1401 },
- { "ar_MA", 0x1801 },
- { "ar_TN", 0x1C01 },
- { "ar_OM", 0x2001 },
- { "ar_YE", 0x2401 },
- { "ar_SY", 0x2801 },
- { "ar_JO", 0x2c01 },
- { "ar_LB", 0x3001 },
- { "ar_KW", 0x3401 },
- { "ar_AE", 0x3801 },
- { "ar_BH", 0x3c01 },
- { "ar_QA", 0x4001 },
- { "hy", 0x42b },
- { "as", 0x44d },
- { "az", 0x42c },
- { "az", 0x82c },
- { "eu", 0x42d },
- { "be_BY", 0x423 },
- { "bn_IN", 0x445 },
- { "bn_BD", 0x845 },
- { "bg_BG", 0x402 },
- { "my", 0x455 },
- { "ca", 0x403 },
- { "km", 0x453 },
- { "zh_TW", 0x404 }, /* Trad */
- { "zh_CN", 0x804 }, /* Simp */
- { "zh_HK", 0xc04 }, /* Trad */
- { "zh_SG", 0x1004 }, /* Simp */
- { "zh_MO", 0x1404 }, /* Trad */
- { "hr", 0x41a },
- { "hr_BA", 0x101a },
- { "cs_CZ", 0x405 },
- { "da_DK", 0x406 },
- { "div", 0x465 },
- { "nl_NL", 0x413 },
- { "nl_BE", 0x813 },
- { "en_UK", 0x809 },
- { "en_US", 0x409 },
- { "en_CA", 0x1009 },
- { "en_AU", 0xc09 },
- { "en_NZ", 0x1409 },
- { "en_IE", 0x1809 },
- { "en_ZA", 0x1c09 },
- { "en_JM", 0x2009 },
- { "en", 0x2409 },
- { "en_BZ", 0x2809 },
- { "en_TT", 0x2c09 },
- { "en_ZW", 0x3009 },
- { "en_PH", 0x3409 },
- { "en_ID", 0x3809 },
- { "en_HK", 0x3c09 },
- { "en_IN", 0x4009 },
- { "en_MY", 0x4409 },
- { "et_EE", 0x425 },
- { "fo", 0x438 },
-/* No language code for filipino */
- { "fa", 0x429 },
- { "fi_FI", 0x40b },
- { "fr_FR", 0x40c },
- { "fr_BE", 0x80c },
- { "fr_CA", 0xc0c },
- { "fr_CH", 0x100c },
- { "fr_LU", 0x140c },
- { "fr_MC", 0x180c },
- { "fr", 0x1c0c }, /* West Indes */
- { "fr_RE", 0x200c },
- { "fr_CD", 0x240c },
- { "fr_SN", 0x280c },
- { "fr_CM", 0x2c0c },
- { "fr_CI", 0x300c },
- { "fr_ML", 0x340c },
- { "fr_MA", 0x380c },
- { "fr_HT", 0x3c0c },
- { "fr_DZ", 0xe40c }, /* North African is most likely to be Algeria, possibly Tunisia */
- { "fy", 0x462 },
- { "gl", 0x456 },
- { "ka", 0x437 },
- { "de_DE", 0x407 },
- { "de_CH", 0x807 },
- { "de_AT", 0xc07 },
- { "de_LU", 0x1007 },
- { "de_LI", 0x1407 },
- { "el_GR", 0x408 },
- { "ga", 0x83c },
- { "gd", 0x43c },
- { "gn", 0x474 },
- { "gu", 0x447 },
- { "ha", 0x468 },
- { "he_IL", 0x40d },
- { "iw", 0x40d }, /* Obsolete name for Hebrew */
- { "hi", 0x439 },
- { "hu_HU", 0x40e },
- { "is_IS", 0x40f },
- { "id", 0x421 },
- { "in", 0x421 }, /* Obsolete name for Indonesean */
- { "iu", 0x45d },
- { "it_IT", 0x410 },
- { "it_CH", 0x810 },
- { "ja_JP", 0x411 },
- { "kn", 0x44b },
- { "ks_IN", 0x860 },
- { "kk", 0x43f },
- { "ky", 0x440 },
- { "km", 0x453 },
- { "kok", 0x457 },
- { "ko", 0x412 },
- { "ko", 0x812 }, /*Johab */
- { "lo", 0x454 },
- { "la", 0x476 },
- { "lv_LV", 0x426 },
- { "lt_LT", 0x427 },
- { "lt", 0x827 }, /* Classic */
- { "mk", 0x42f },
- { "ms", 0x43e },
- { "ms", 0x83e },
- { "ml", 0x44c },
- { "mt", 0x43a },
- { "mr", 0x44e },
- { "mn", 0x450 },
- { "ne_NP", 0x461 },
- { "ne_IN", 0x861 },
- { "no_NO", 0x414 }, /* Bokmal */
- { "no_NO", 0x814 }, /* Nynorsk */
- { "or", 0x448 },
- { "om", 0x472 },
- { "ps", 0x463 },
- { "pl_PL", 0x415 },
- { "pt_PT", 0x416 },
- { "pt_BR", 0x816 },
- { "pa_IN", 0x446 },
- { "pa_PK", 0x846 },
- { "qu_BO", 0x46b },
- { "qu_EC", 0x86b },
- { "qu_PE", 0xc6b },
- { "rm", 0x417 },
- { "ro_RO", 0x418 },
- { "ro_MD", 0x818 },
- { "ru_RU", 0x419 },
- { "ru_MD", 0x819 },
- { "smi", 0x43b },
- { "sa", 0x43b },
-/* No language code for Sepedi */
- { "sr", 0xc1a }, /* Cyrillic */
- { "sr", 0x81a }, /* Latin */
- { "sd_IN", 0x459 },
- { "sd_PK", 0x859 },
- { "si", 0x45b },
- { "sk_SK", 0x41b },
- { "sl_SI", 0x424 },
- { "wen", 0x42e },
- { "es_ES", 0x40a }, /* traditional spanish */
- { "es_MX", 0x80a },
- { "es_ES", 0xc0a }, /* Modern spanish */
- { "es_GT", 0x100a },
- { "es_CR", 0x140a },
- { "es_PA", 0x180a },
- { "es_DO", 0x1c0a },
- { "es_VE", 0x200a },
- { "es_CO", 0x240a },
- { "es_PE", 0x280a },
- { "es_AR", 0x2c0a },
- { "es_EC", 0x300a },
- { "es_CL", 0x340a },
- { "es_UY", 0x380a },
- { "es_PY", 0x3c0a },
- { "es_BO", 0x400a },
- { "es_SV", 0x440a },
- { "es_HN", 0x480a },
- { "es_NI", 0x4c0a },
- { "es_PR", 0x500a },
- { "es_US", 0x540a },
- { "sutu", 0x430 },
- { "sw_KE", 0x441 },
- { "sv_SE", 0x41d },
- { "sv_FI", 0x81d },
- { "tl", 0x464 },
- { "tg", 0x464 },
- { "ta", 0x449 },
- { "tt", 0x444 },
- { "te", 0x44a },
- { "th", 0x41e },
- { "bo_CN", 0x451 },
- { "bo_BT", 0x451 },
- { "ti_ET", 0x473 },
- { "ti_ER", 0x873 },
- { "ts", 0x431 },
- { "tn", 0x432 },
- { "tr_TR", 0x41f },
- { "tk", 0x442 },
- { "uk_UA", 0x422 },
- { "ug", 0x480 },
- { "ur_PK", 0x420 },
- { "ur_IN", 0x820 },
- { "uz", 0x443 }, /* Latin */
- { "uz", 0x843 }, /* Cyrillic */
- { "ven", 0x433 },
- { "vi", 0x42a },
- { "cy", 0x452 },
- { "xh", 0x434 },
- { "yi", 0x43d },
- { "ji", 0x43d }, /* Obsolete Yiddish */
- { "yo", 0x46a },
- { "zu", 0x435 },
- { NULL }};
-#endif
-
-static GTextInfo mslanguages[] = {
- { (unichar_t *) N_("Afrikaans"), NULL, 0, 0, (void *) 0x436, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Albanian"), NULL, 0, 0, (void *) 0x41c, NULL, 0, 0, 0, 0, 0, 0, 1},
-/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "Malayalam", ignore "Lang|" */
- { (unichar_t *) N_("Lang|Amharic"), NULL, 0, 0, (void *) 0x45e, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Saudi Arabia)"), NULL, 0, 0, (void *) 0x401, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Iraq)"), NULL, 0, 0, (void *) 0x801, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Egypt)"), NULL, 0, 0, (void *) 0xc01, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Libya)"), NULL, 0, 0, (void *) 0x1001, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Algeria)"), NULL, 0, 0, (void *) 0x1401, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Morocco)"), NULL, 0, 0, (void *) 0x1801, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Tunisia)"), NULL, 0, 0, (void *) 0x1C01, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Oman)"), NULL, 0, 0, (void *) 0x2001, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Yemen)"), NULL, 0, 0, (void *) 0x2401, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Syria)"), NULL, 0, 0, (void *) 0x2801, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Jordan)"), NULL, 0, 0, (void *) 0x2c01, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Lebanon)"), NULL, 0, 0, (void *) 0x3001, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Kuwait)"), NULL, 0, 0, (void *) 0x3401, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (U.A.E.)"), NULL, 0, 0, (void *) 0x3801, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Bahrain)"), NULL, 0, 0, (void *) 0x3c01, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Arabic (Qatar)"), NULL, 0, 0, (void *) 0x4001, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Armenian"), NULL, 0, 0, (void *) 0x42b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Assamese"), NULL, 0, 0, (void *) 0x44d, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Azeri (Latin)"), NULL, 0, 0, (void *) 0x42c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Azeri (Cyrillic)"), NULL, 0, 0, (void *) 0x82c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Basque"), NULL, 0, 0, (void *) 0x42d, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Byelorussian"), NULL, 0, 0, (void *) 0x423, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Bengali"), NULL, 0, 0, (void *) 0x445, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Bengali Bangladesh"), NULL, 0, 0, (void *) 0x845, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Bulgarian"), NULL, 0, 0, (void *) 0x402, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Burmese"), NULL, 0, 0, (void *) 0x455, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Catalan"), NULL, 0, 0, (void *) 0x403, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Cambodian"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Cherokee"), NULL, 0, 0, (void *) 0x45c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Chinese (Taiwan)"), NULL, 0, 0, (void *) 0x404, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Chinese (PRC)"), NULL, 0, 0, (void *) 0x804, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Chinese (Hong Kong)"), NULL, 0, 0, (void *) 0xc04, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Chinese (Singapore)"), NULL, 0, 0, (void *) 0x1004, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Chinese (Macau)"), NULL, 0, 0, (void *) 0x1404, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Croatian"), NULL, 0, 0, (void *) 0x41a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Croatian Bosnia/Herzegovina"), NULL, 0, 0, (void *) 0x101a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Czech"), NULL, 0, 0, (void *) 0x405, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Danish"), NULL, 0, 0, (void *) 0x406, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Divehi"), NULL, 0, 0, (void *) 0x465, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Dutch"), NULL, 0, 0, (void *) 0x413, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Flemish (Belgian Dutch)"), NULL, 0, 0, (void *) 0x813, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Edo"), NULL, 0, 0, (void *) 0x466, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (British)"), NULL, 0, 0, (void *) 0x809, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (US)"), NULL, 0, 0, (void *) 0x409, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Canada)"), NULL, 0, 0, (void *) 0x1009, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Australian)"), NULL, 0, 0, (void *) 0xc09, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (New Zealand)"), NULL, 0, 0, (void *) 0x1409, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Irish)"), NULL, 0, 0, (void *) 0x1809, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (South Africa)"), NULL, 0, 0, (void *) 0x1c09, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Jamaica)"), NULL, 0, 0, (void *) 0x2009, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Caribbean)"), NULL, 0, 0, (void *) 0x2409, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Belize)"), NULL, 0, 0, (void *) 0x2809, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Trinidad)"), NULL, 0, 0, (void *) 0x2c09, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Zimbabwe)"), NULL, 0, 0, (void *) 0x3009, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Philippines)"), NULL, 0, 0, (void *) 0x3409, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Indonesia)"), NULL, 0, 0, (void *) 0x3809, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Hong Kong)"), NULL, 0, 0, (void *) 0x3c09, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (India)"), NULL, 0, 0, (void *) 0x4009, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("English (Malaysia)"), NULL, 0, 0, (void *) 0x4409, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Estonian"), NULL, 0, 0, (void *) 0x425, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Faeroese"), NULL, 0, 0, (void *) 0x438, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Farsi"), NULL, 0, 0, (void *) 0x429, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Filipino"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Finnish"), NULL, 0, 0, (void *) 0x40b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French French"), NULL, 0, 0, (void *) 0x40c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Belgium"), NULL, 0, 0, (void *) 0x80c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Canadian"), NULL, 0, 0, (void *) 0xc0c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Swiss"), NULL, 0, 0, (void *) 0x100c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Luxembourg"), NULL, 0, 0, (void *) 0x140c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Monaco"), NULL, 0, 0, (void *) 0x180c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French West Indies"), NULL, 0, 0, (void *) 0x1c0c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) NU_("French R\303\251union"), NULL, 0, 0, (void *) 0x200c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French D.R. Congo"), NULL, 0, 0, (void *) 0x240c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Senegal"), NULL, 0, 0, (void *) 0x280c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Camaroon"), NULL, 0, 0, (void *) 0x2c0c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) NU_("French C\303\264te d'Ivoire"), NULL, 0, 0, (void *) 0x300c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Mali"), NULL, 0, 0, (void *) 0x340c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Morocco"), NULL, 0, 0, (void *) 0x380c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French Haiti"), NULL, 0, 0, (void *) 0x3c0c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French North Africa"), NULL, 0, 0, (void *) 0xe40c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Frisian"), NULL, 0, 0, (void *) 0x462, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Fulfulde"), NULL, 0, 0, (void *) 0x467, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Gaelic (Scottish)"), NULL, 0, 0, (void *) 0x43c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Gaelic (Irish)"), NULL, 0, 0, (void *) 0x83c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Galician"), NULL, 0, 0, (void *) 0x467, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Georgian"), NULL, 0, 0, (void *) 0x437, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("German German"), NULL, 0, 0, (void *) 0x407, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("German Swiss"), NULL, 0, 0, (void *) 0x807, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("German Austrian"), NULL, 0, 0, (void *) 0xc07, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("German Luxembourg"), NULL, 0, 0, (void *) 0x1007, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("German Liechtenstein"), NULL, 0, 0, (void *) 0x1407, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Greek"), NULL, 0, 0, (void *) 0x408, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Guarani"), NULL, 0, 0, (void *) 0x474, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Gujarati"), NULL, 0, 0, (void *) 0x447, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Hausa"), NULL, 0, 0, (void *) 0x468, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Hawaiian"), NULL, 0, 0, (void *) 0x475, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Hebrew"), NULL, 0, 0, (void *) 0x40d, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Hindi"), NULL, 0, 0, (void *) 0x439, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Hungarian"), NULL, 0, 0, (void *) 0x40e, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Ibibio"), NULL, 0, 0, (void *) 0x469, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Icelandic"), NULL, 0, 0, (void *) 0x40f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Igbo"), NULL, 0, 0, (void *) 0x470, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Indonesian"), NULL, 0, 0, (void *) 0x421, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Inuktitut"), NULL, 0, 0, (void *) 0x45d, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Italian"), NULL, 0, 0, (void *) 0x410, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Italian Swiss"), NULL, 0, 0, (void *) 0x810, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) 0x411, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Kannada"), NULL, 0, 0, (void *) 0x44b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kanuri"), NULL, 0, 0, (void *) 0x471, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kashmiri (India)"), NULL, 0, 0, (void *) 0x860, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kazakh"), NULL, 0, 0, (void *) 0x43f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Khmer"), NULL, 0, 0, (void *) 0x453, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kirghiz"), NULL, 0, 0, (void *) 0x440, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Konkani"), NULL, 0, 0, (void *) 0x457, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) 0x412, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Korean (Johab)"), NULL, 0, 0, (void *) 0x812, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lao"), NULL, 0, 0, (void *) 0x454, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Latvian"), NULL, 0, 0, (void *) 0x426, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Latin"), NULL, 0, 0, (void *) 0x476, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lithuanian"), NULL, 0, 0, (void *) 0x427, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lithuanian (Classic)"), NULL, 0, 0, (void *) 0x827, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Macedonian"), NULL, 0, 0, (void *) 0x42f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Malay"), NULL, 0, 0, (void *) 0x43e, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Malay (Brunei)"), NULL, 0, 0, (void *) 0x83e, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Malayalam"), NULL, 0, 0, (void *) 0x44c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Maltese"), NULL, 0, 0, (void *) 0x43a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Manipuri"), NULL, 0, 0, (void *) 0x458, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Maori"), NULL, 0, 0, (void *) 0x481, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Marathi"), NULL, 0, 0, (void *) 0x44e, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mongolian (Cyrillic)"), NULL, 0, 0, (void *) 0x450, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mongolian (Mongolian)"), NULL, 0, 0, (void *) 0x850, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Nepali"), NULL, 0, 0, (void *) 0x461, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Nepali (India)"), NULL, 0, 0, (void *) 0x861, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Norwegian (Bokmal)"), NULL, 0, 0, (void *) 0x414, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Norwegian (Nynorsk)"), NULL, 0, 0, (void *) 0x814, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Oriya"), NULL, 0, 0, (void *) 0x448, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Oromo"), NULL, 0, 0, (void *) 0x472, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Papiamentu"), NULL, 0, 0, (void *) 0x479, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Pashto"), NULL, 0, 0, (void *) 0x463, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Polish"), NULL, 0, 0, (void *) 0x415, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Portugese (Portugal)"), NULL, 0, 0, (void *) 0x416, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Portuguese (Brasil)"), NULL, 0, 0, (void *) 0x816, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Punjabi (India)"), NULL, 0, 0, (void *) 0x446, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Punjabi (Pakistan)"), NULL, 0, 0, (void *) 0x846, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Quecha (Bolivia)"), NULL, 0, 0, (void *) 0x46b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Quecha (Ecuador)"), NULL, 0, 0, (void *) 0x86b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Quecha (Peru)"), NULL, 0, 0, (void *) 0xc6b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Rhaeto-Romanic"), NULL, 0, 0, (void *) 0x417, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Romanian"), NULL, 0, 0, (void *) 0x418, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Romanian (Moldova)"), NULL, 0, 0, (void *) 0x818, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Russian"), NULL, 0, 0, (void *) 0x419, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Russian (Moldova)"), NULL, 0, 0, (void *) 0x819, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sami (Lappish)"), NULL, 0, 0, (void *) 0x43b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sanskrit"), NULL, 0, 0, (void *) 0x43b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sepedi"), NULL, 0, 0, (void *) 0x46c, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Serbian (Cyrillic)"), NULL, 0, 0, (void *) 0xc1a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Serbian (Latin)"), NULL, 0, 0, (void *) 0x81a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sindhi India"), NULL, 0, 0, (void *) 0x459, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sindhi Pakistan"), NULL, 0, 0, (void *) 0x859, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Sinhalese"), NULL, 0, 0, (void *) 0x45b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slovak"), NULL, 0, 0, (void *) 0x41b, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slovenian"), NULL, 0, 0, (void *) 0x424, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sorbian"), NULL, 0, 0, (void *) 0x42e, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Traditional)"), NULL, 0, 0, (void *) 0x40a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish Mexico"), NULL, 0, 0, (void *) 0x80a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Modern)"), NULL, 0, 0, (void *) 0xc0a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Guatemala)"), NULL, 0, 0, (void *) 0x100a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Costa Rica)"), NULL, 0, 0, (void *) 0x140a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Panama)"), NULL, 0, 0, (void *) 0x180a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Dominican Republic)"), NULL, 0, 0, (void *) 0x1c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Venezuela)"), NULL, 0, 0, (void *) 0x200a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Colombia)"), NULL, 0, 0, (void *) 0x240a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Peru)"), NULL, 0, 0, (void *) 0x280a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Argentina)"), NULL, 0, 0, (void *) 0x2c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Ecuador)"), NULL, 0, 0, (void *) 0x300a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Chile)"), NULL, 0, 0, (void *) 0x340a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Uruguay)"), NULL, 0, 0, (void *) 0x380a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Paraguay)"), NULL, 0, 0, (void *) 0x3c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Bolivia)"), NULL, 0, 0, (void *) 0x400a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (El Salvador)"), NULL, 0, 0, (void *) 0x440a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Honduras)"), NULL, 0, 0, (void *) 0x480a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Nicaragua)"), NULL, 0, 0, (void *) 0x4c0a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Puerto Rico)"), NULL, 0, 0, (void *) 0x500a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (United States)"), NULL, 0, 0, (void *) 0x540a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish (Latin America)"), NULL, 0, 0, (void *) 0xe40a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sutu"), NULL, 0, 0, (void *) 0x430, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Swahili (Kenyan)"), NULL, 0, 0, (void *) 0x441, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Swedish (Sweden)"), NULL, 0, 0, (void *) 0x41d, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Swedish (Finland)"), NULL, 0, 0, (void *) 0x81d, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Syriac"), NULL, 0, 0, (void *) 0x45a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Tagalog"), NULL, 0, 0, (void *) 0x464, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tajik"), NULL, 0, 0, (void *) 0x428, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tamazight (Arabic)"), NULL, 0, 0, (void *) 0x45f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tamazight (Latin)"), NULL, 0, 0, (void *) 0x85f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Tamil"), NULL, 0, 0, (void *) 0x449, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tatar (Tatarstan)"), NULL, 0, 0, (void *) 0x444, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Telugu"), NULL, 0, 0, (void *) 0x44a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Thai"), NULL, 0, 0, (void *) 0x41e, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tibetan (PRC)"), NULL, 0, 0, (void *) 0x451, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tibetan Bhutan"), NULL, 0, 0, (void *) 0x851, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tigrinya Ethiopia"), NULL, 0, 0, (void *) 0x473, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tigrinyan Eritrea"), NULL, 0, 0, (void *) 0x873, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tsonga"), NULL, 0, 0, (void *) 0x431, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tswana"), NULL, 0, 0, (void *) 0x432, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Turkish"), NULL, 0, 0, (void *) 0x41f, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Turkmen"), NULL, 0, 0, (void *) 0x442, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Uighur"), NULL, 0, 0, (void *) 0x480, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Ukrainian"), NULL, 0, 0, (void *) 0x422, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Urdu (Pakistan)"), NULL, 0, 0, (void *) 0x420, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Urdu (India)"), NULL, 0, 0, (void *) 0x820, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Uzbek (Latin)"), NULL, 0, 0, (void *) 0x443, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Uzbek (Cyrillic)"), NULL, 0, 0, (void *) 0x843, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Venda"), NULL, 0, 0, (void *) 0x433, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Vietnamese"), NULL, 0, 0, (void *) 0x42a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Welsh"), NULL, 0, 0, (void *) 0x452, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Xhosa"), NULL, 0, 0, (void *) 0x434, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Yi"), NULL, 0, 0, (void *) 0x478, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Yiddish"), NULL, 0, 0, (void *) 0x43d, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Yoruba"), NULL, 0, 0, (void *) 0x46a, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Zulu"), NULL, 0, 0, (void *) 0x435, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo ttfnameids[] = {
-/* Put styles (docs call it subfamily) first because it is most likely to change */
- { (unichar_t *) N_("Styles (SubFamily)"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 1, 0, 1},
- { (unichar_t *) N_("Copyright"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Family"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Fullname"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("UniqueID"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Version"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
-/* Don't give user access to PostscriptName, we set that elsewhere */
- { (unichar_t *) N_("Trademark"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Manufacturer"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Designer"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Descriptor"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Vendor URL"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Designer URL"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("License"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("License URL"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
-/* slot 15 is reserved */
- { (unichar_t *) N_("Preferred Family"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Preferred Styles"), NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Compatible Full"), NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sample Text"), NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("CID findfont Name"), NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static char *TN_DefaultName(GGadget *g, int r, int c);
-static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c);
-static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c);
-static struct col_init ci[3] = {
- { me_enum, NULL, mslanguages, TN_LangEnable, N_("Language") },
- { me_enum, NULL, ttfnameids, TN_StrIDEnable, N_("String ID") },
- { me_func, TN_DefaultName, NULL, NULL, N_("String") }
- };
-#endif
-static GTextInfo gridfit[] = {
- { (unichar_t *) N_("No Grid Fit"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
- { (unichar_t *) N_("Grid Fit"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo antialias[] = {
- { (unichar_t *) N_("No Anti-Alias"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
- { (unichar_t *) N_("Anti-Alias"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static GTextInfo symsmooth[] = {
- { (unichar_t *) N_("No Symmetric-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
- { (unichar_t *) N_("Symmetric-Smoothing"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo gfsymsmooth[] = {
- { (unichar_t *) N_("No Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 1, 0, 1},
- { (unichar_t *) N_("Grid Fit w/ Sym-Smooth"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static struct col_init gaspci[5] = {
- { me_int , NULL, NULL, NULL, N_("Gasp|Pixels Per EM") },
- { me_enum, NULL, gridfit, NULL, N_("Gasp|Grid Fit") },
- { me_enum, NULL, antialias, NULL, N_("Gasp|Anti-Alias") },
- { me_enum, NULL, symsmooth, NULL, N_("Gasp|Symmetric Smoothing") },
- { me_enum, NULL, gfsymsmooth, NULL, N_("Gasp|Grid Fit w/ Sym Smooth") }
- };
-#endif
-
-struct langstyle { int lang; const char *str; };
-static const char regulareng[] = "Regular";
-static const char demiboldeng[] = "DemiBold";
-static const char demiboldeng3[] = "Demi";
-static const char demiboldeng5[] = "SemiBold";
-static const char boldeng[] = "Bold";
-static const char thineng[] = "Thin";
-static const char lighteng[] = "Light";
-static const char extralighteng[] = "ExtraLight";
-static const char extralighteng2[] = "VeryLight";
-static const char mediumeng[] = "Medium";
-static const char bookeng[] = "Book";
-static const char heavyeng[] = "Heavy";
-static const char blackeng[] = "Black";
-static const char italiceng[] = "Italic";
-static const char obliqueeng[] = "Oblique";
-static const char condensedeng[] = "Condensed";
-static const char expandedeng[] = "Expanded";
-static const char outlineeng[] = "Outline";
-
-static const char regularfren[] = "Normal";
-static const char boldfren[] = "Gras";
-static const char demiboldfren[] = "DemiGras";
-static const char demiboldfren2[] = "Demi";
-static const char mediumfren[] = "Normal";
-static const char lightfren[] = "Maigre";
-static const char blackfren[] = "ExtraGras";
-static const char italicfren[] = "Italique";
-static const char obliquefren[] = "Oblique";
-static const char condensedfren[] = "Etroite";
-static const char expandedfren[] = "Elargi";
-static const char outlinefren[] = "Contour";
-
-static const char regulargerm[] = "Standard";
-static const char demiboldgerm[] = "Halbfett";
-static const char demiboldgerm2[] = "Schmallfett";
-static const char boldgerm[] = "Fett";
-static const char boldgerm2[] = "Dick";
-static const char blackgerm[] = "Schwarz";
-static const char lightgerm[] = "Mager";
-static const char mediumgerm[] = "Mittel";
-static const char bookgerm[] = "Buchschrift";
-static const char italicgerm[] = "Kursiv";
-static const char obliquegerm[] = "Schr\303\244g";
-static const char condensedgerm[] = "Schmal";
-static const char expandedgerm[] = "Breit";
-static const char outlinegerm[] = "Konturert";
-
-static const char regularspan[] = "Normal";
-static const char boldspan[] = "Negrita";
-static const char lightspan[] = "Fina";
-static const char blackspan[] = "Supernegra";
-static const char italicspan[] = "Cursiva";
-static const char condensedspan[] = "Condensada";
-static const char expandedspan[] = "Amplida";
-
-static const char regulardutch[] = "Normaal";
-static const char mediumdutch[] = "Normaal";
-static const char bookdutch[] = "Normaal";
-static const char bolddutch[] = "Vet";
-static const char demibolddutch[] = "Halfvet";
-static const char lightdutch[] = "Licht mager";
-static const char blackdutch[] = "Extra vet";
-static const char italicdutch[] = "Cursief";
-static const char italicdutch2[] = "italiek";
-static const char obliquedutch[] = "oblique";
-static const char obliquedutch2[] = "schuin";
-static const char condenseddutch[] = "Smal";
-static const char expandeddutch[] = "Breed";
-static const char outlinedutch[] = "Contour";
-
-static const char regularswed[] = "Mager";
-static const char boldswed[] = "Fet";
-static const char lightswed[] = "Extrafin";
-static const char blackswed[] = "Extrafet";
-static const char italicswed[] = "Kursiv";
-static const char condensedswed[] = "Smal";
-static const char expandedswed[] = "Bred";
-
-static const char regulardanish[] = "Normal";
-static const char bolddanish[] = "Fed";
-static const char demibolddanish[] = "Halvfed";
-static const char lightdanish[] = "Fin";
-static const char mediumdanish[] = "Medium";
-static const char blackdanish[] = "Extrafed";
-static const char italicdanish[] = "Kursiv";
-static const char condenseddanish[] = "Smal";
-static const char expandeddanish[] = "Bred";
-static const char outlinedanish[] = "Kontour";
-
-static const char regularnor[] = "Vanlig";
-static const char boldnor[] = "Halvfet";
-static const char lightnor[] = "Mager";
-static const char blacknor[] = "Fet";
-static const char italicnor[] = "Kursiv";
-static const char condensednor[] = "Smal";
-static const char expandednor[] = "Sperret";
-
-static const char regularital[] = "Normale";
-static const char demiboldital[] = "Nerretto";
-static const char boldital[] = "Nero";
-static const char thinital[] = "Fine";
-static const char lightital[] = "Chiaro";
-static const char mediumital[] = "Medio";
-static const char bookital[] = "Libro";
-static const char heavyital[] = "Nerissimo";
-static const char blackital[] = "ExtraNero";
-static const char italicital[] = "Cursivo";
-static const char obliqueital[] = "Obliquo";
-static const char condensedital[] = "Condensato";
-static const char expandedital[] = "Allargato";
-
-static const char regularru[] = "\320\236\320\261\321\213\321\207\320\275\321\213\320\271";
-static const char demiboldru[] = "\320\237\320\276\320\273\321\203\320\266\320\270\321\200\320\275\321\213\320\271";
-static const char boldru[] = "\320\236\320\261\321\213\321\207\320\275\321\213\320\271";
-static const char heavyru[] = "\320\241\320\262\320\265\321\200\321\205\320\266\320\270\321\200\320\275\321\213\320\271";
-static const char blackru[] = "\320\247\321\221\321\200\320\275\321\213\320\271";
-static const char thinru[] = "\320\242\320\276\320\275\320\272\320\270\320\271";
-static const char lightru[] = "\320\241\320\262\320\265\321\202\320\273\321\213\320\271";
-static const char italicru[] = "\320\232\321\203\321\200\321\201\320\270\320\262";
-static const char obliqueru[] = "\320\235\320\260\320\272\320\273\320\276\320\275";
-static const char condensedru[] = "\320\243\320\267\320\272\320\270\320\271";
-static const char expandedru[] = "\320\250\320\270\321\200\320\276\320\272\320\270\320\271";
-
-static const char regularhu[] = "Norm\303\241l";
-static const char demiboldhu[] = "Negyedk\303\266v\303\251r";
-static const char demiboldhu2[] = "F\303\251lk\303\266v\303\251r";
-static const char boldhu[] = "F\303\251lk\303\266v\303\251r";
-static const char boldhu2[] = "H\303\241romnegyedk\303\266v\303\251r";
-static const char thinhu[] = "Sov\303\241ny";
-static const char lighthu[] = "Vil\303\241gos";
-static const char mediumhu[] = "K\303\266zepes";
-static const char bookhu[] = "Halv\303\241ny";
-static const char bookhu2[] = "K\303\266nyv";
-static const char heavyhu[] = "K\303\266v\303\251r";
-static const char heavyhu2[] = "Extrak\303\266v\303\251r";
-static const char blackhu[] = "Fekete";
-static const char blackhu2[] = "S\303\266t\303\251t";
-static const char italichu[] = "D\305\221lt";
-static const char obliquehu[] = "D\303\266nt\303\266tt";
-static const char obliquehu2[] = "Ferde";
-static const char condensedhu[] = "Keskeny";
-static const char expandedhu[] = "Sz\303\251les";
-static const char outlinehu[] = "Kont\303\272ros";
-
-static const char regularpl[] = "podstawowa";
-static const char demiboldpl[] = "p\303\263\305\202gruba";
-static const char boldpl[] = "pogrubiona";
-static const char thinpl[] = "cienka";
-static const char lightpl[] = "bardzo cienka";
-static const char heavypl[] = "bardzo gruba";
-static const char italicpl[] = "pochy\305\202a";
-static const char obliquepl[] = "pochy\305\202a";
-static const char condensedpl[] = "w\304\205ska";
-static const char expandedpl[] = "szeroka";
-static const char outlinepl[] = "konturowa";
-static const char mediumpl[] = "zwyk\305\202a";
-static const char bookpl[] = "zwyk\305\202a";
-
-
-#ifndef LUA_FF_LIB
-
-static struct langstyle regs[] = { {0x409, regulareng}, { 0x40c, regularfren }, { 0x410, regularital }, { 0x407, regulargerm }, { 0x40a, regularspan }, { 0x419, regularru }, { 0x40e, regularhu },
- { 0x413, regulardutch}, { 0x41d, regularswed }, { 0x414, regularnor },
- { 0x406, regulardanish}, {0x415, regularpl }, { 0x804, "\346\255\243\345\270\270"},
- { 0x408, "\316\272\316\261\316\275\316\277\316\275\316\271\316\272\316\256"}, { 0x42a, "Chu\341\272\251n"}, { 0 }};
-static struct langstyle meds[] = { {0x409, mediumeng}, { 0x410, mediumital },
- { 0x40c, mediumfren }, { 0x407, mediumgerm }, { 0x40e, mediumhu },
- { 0x406, mediumdanish}, {0x415, mediumpl }, { 0x804, "\344\270\255\347\255\211"},
- { 0x408, "\302\265\316\265\317\203\316\261\316\257\316\261"}, { 0x42a, "V\341\273\253a"}, { 0x413, mediumdutch}, { 0 }};
-static struct langstyle books[] = { {0x409, bookeng}, { 0x410, bookital },
- { 0x407, bookgerm }, { 0x40e, bookhu }, { 0x40e, bookhu2 },
- { 0x415, bookpl}, { 0x804, "\344\271\246\344\275\223"}, { 0x408, "\303\237\316\271\303\237\316\273\316\257\316\277\317\205"},
- { 0x42a, "S\303\241ch"}, { 0x413, bookdutch}, { 0 }};
-static struct langstyle bolds[] = { {0x409, boldeng}, { 0x410, boldital }, { 0x40c, boldfren }, { 0x407, boldgerm }, { 0x407, boldgerm2 }, { 0x40a, boldspan}, { 0x419, boldru }, { 0x40e, boldhu }, { 0x40e, boldhu2 },
- { 0x413, bolddutch}, { 0x41d, boldswed }, { 0x414, boldnor },
- { 0x406, bolddanish}, { 0x415, boldpl}, { 0x804, "\347\262\227\344\275\223"},
- { 0x408, "\316\255\316\275\317\204\316\277\316\275\316\267"}, { 0x42a, "\304\220\341\272\255m"}, { 0 }};
-static struct langstyle italics[] = { {0x409, italiceng}, { 0x410, italicital }, { 0x40c, italicfren }, { 0x407, italicgerm }, { 0x40a, italicspan}, { 0x419, italicru }, { 0x40e, italichu },
- { 0x413, italicdutch}, { 0x413, italicdutch2}, { 0x41d, italicswed }, { 0x414, italicnor },
- { 0x406, italicdanish}, { 0x415, italicpl}, { 0x804, "\346\226\234\344\275\223"},
- { 0x408, "\316\233\316\265\316\271\317\210\316\257\316\261\317\202"}, { 0x42a, "Nghi\303\252ng" }, { 0 }};
-static struct langstyle obliques[] = { {0x409, obliqueeng}, { 0x410, obliqueital },
- { 0x40c, obliquefren }, { 0x407, obliquegerm }, { 0x419, obliqueru },
- { 0x40e, obliquehu }, { 0x40e, obliquehu2 }, {0x415, obliquepl},
- { 0x804, "\346\226\234\344\275\223"}, { 0x408, "\317\200\316\273\316\254\316\263\316\271\316\261"},
- { 0x42a, "Xi\303\252n" }, { 0x413, obliquedutch}, { 0x413, obliquedutch2}, { 0 }};
-static struct langstyle demibolds[] = { {0x409, demiboldeng}, {0x409, demiboldeng3}, {0x409, demiboldeng5},
- { 0x410, demiboldital }, { 0x40c, demiboldfren }, { 0x40c, demiboldfren2 }, { 0x407, demiboldgerm }, { 0x407, demiboldgerm2 },
- { 0x419, demiboldru }, { 0x40e, demiboldhu }, { 0x40e, demiboldhu2 },
- { 0x406, demibolddanish}, { 0x415, demiboldpl },
- { 0x804, "\347\225\245\347\262\227"}, { 0x408, "\316\267\302\265\316\271\316\255\316\275\317\204\316\277\316\275\316\267"},
- { 0x42a, "N\341\273\255a \304\221\341\272\255m"}, { 0x413, demibolddutch}, { 0 }};
-static struct langstyle heavys[] = { {0x409, heavyeng}, { 0x410, heavyital },
- { 0x419, heavyru }, { 0x40e, heavyhu }, { 0x40e, heavyhu2 },
- { 0x415, heavypl }, { 0x804, "\347\262\227"}, { 0 }};
-static struct langstyle blacks[] = { {0x409, blackeng}, { 0x410, blackital }, { 0x40c, blackfren }, { 0x407, blackgerm }, { 0x419, blackru }, { 0x40e, blackhu }, { 0x40e, blackhu2 }, { 0x40a, blackspan },
- { 0x413, blackdutch}, { 0x41d, blackswed }, { 0x414, blacknor }, { 0x406, blackdanish},
- { 0x415, heavypl }, { 0x804, "\351\273\221"}, { 0x408, "\302\265\316\261\317\215\317\201\316\261"},
- { 0x42a, "\304\220en"}, {0} };
-static struct langstyle thins[] = { {0x409, thineng}, { 0x410, thinital },
- { 0x419, thinru }, { 0x40e, thinhu }, { 0x415, thinpl},
- { 0x804, "\347\273\206"}, { 0 }};
-static struct langstyle extralights[] = { {0x409, extralighteng}, {0x409, extralighteng2},
- { 0x804, "\346\236\201\347\273\206"}, {0}};
-static struct langstyle lights[] = { {0x409, lighteng}, {0x410, lightital}, {0x40c, lightfren}, {0x407, lightgerm}, { 0x419, lightru }, { 0x40e, lighthu }, { 0x40a, lightspan },
- { 0x413, lightdutch}, { 0x41d, lightswed }, { 0x414, lightnor },
- { 0x406, lightdanish}, { 0x415, lightpl}, { 0x804, "\347\273\206"},
- { 0x408, "\316\273\316\265\317\200\317\204\316\256"}, { 0x42a, "Nh\341\272\271" }, { 0 }};
-static struct langstyle condenseds[] = { {0x409, condensedeng}, {0x410, condensedital}, {0x40c, condensedfren}, {0x407, condensedgerm}, { 0x419, condensedru }, { 0x40e, condensedhu }, { 0x40a, condensedspan },
- { 0x413, condenseddutch}, { 0x41d, condensedswed },
- { 0x414, condensednor }, { 0x406, condenseddanish},
- { 0x415, condensedpl }, { 0x804, "\345\216\213\347\274\251"},
- { 0x408, "\317\200\317\205\316\272\316\275\316\256"}, { 0x42a, "H\341\272\271p" }, { 0 }};
-static struct langstyle expandeds[] = { {0x409, expandedeng}, {0x410, expandedital}, {0x40c, expandedfren}, {0x407, expandedgerm}, { 0x419, expandedru }, { 0x40e, expandedhu }, { 0x40a, expandedspan },
- { 0x413, expandeddutch}, { 0x41d, expandedswed }, { 0x414, expandednor },
- { 0x406, expandeddanish}, { 0x415, expandedpl }, { 0x804, "\345\212\240\345\256\275"},
- { 0x408, "\316\261\317\201\316\261\316\271\316\256"}, { 0x42a, "R\341\273\231ng" }, { 0 }};
-static struct langstyle outlines[] = { {0x409, outlineeng}, {0x40c, outlinefren},
- {0x407, outlinegerm}, {0x40e, outlinehu}, { 0x406, outlinedanish},
- {0x415, outlinepl}, { 0x804, "\350\275\256\345\273\223"}, { 0x408, "\317\200\316\265\317\201\316\271\316\263\317\201\316\254\316\274\316\274\316\261\317\204\316\277\317\202"},
- {0x42a, "N\303\251t ngo\303\240i" }, { 0x413, outlinedutch}, { 0 }};
-static struct langstyle *stylelist[] = {regs, meds, books, demibolds, bolds, heavys, blacks,
- extralights, lights, thins, italics, obliques, condenseds, expandeds, outlines, NULL };
-#endif
-
-#define CID_Features 101 /* Mac stuff */
-#define CID_FeatureDel 103
-#define CID_FeatureEdit 105
-
-#define CID_Family 1002
-#define CID_Weight 1003
-#define CID_ItalicAngle 1004
-#define CID_UPos 1005
-#define CID_UWidth 1006
-#define CID_Ascent 1007
-#define CID_Descent 1008
-#define CID_Notice 1010
-#define CID_Version 1011
-#define CID_UniqueID 1012
-#define CID_HasVerticalMetrics 1013
-#define CID_VOriginLab 1014
-#define CID_VOrigin 1015
-#define CID_Fontname 1016
-#define CID_Em 1017
-#define CID_Scale 1018
-#define CID_IsOrder2 1019
-#define CID_IsMultiLayer 1020
-#define CID_Interpretation 1021
-#define CID_IsStrokedFont 1022
-#define CID_StrokeWidth 1023
-#define CID_Namelist 1024
-#define CID_XUID 1113
-#define CID_Human 1114
-#define CID_SameAsFontname 1115
-#define CID_HasDefBase 1116
-#define CID_DefBaseName 1117
-
-#define CID_PrivateEntries 2001
-#define CID_PrivateValues 2002
-#define CID_Add 2003
-#define CID_Guess 2004
-#define CID_Remove 2005
-#define CID_Hist 2006
-
-#define CID_TTFTabs 3000
-#define CID_WeightClass 3001
-#define CID_WidthClass 3002
-#define CID_PFMFamily 3003
-#define CID_FSType 3004
-#define CID_NoSubsetting 3005
-#define CID_OnlyBitmaps 3006
-#define CID_LineGap 3007
-#define CID_VLineGap 3008
-#define CID_VLineGapLab 3009
-#define CID_WinAscent 3010
-#define CID_WinAscentLab 3011
-#define CID_WinAscentIsOff 3012
-#define CID_WinDescent 3013
-#define CID_WinDescentLab 3014
-#define CID_WinDescentIsOff 3015
-#define CID_TypoAscent 3016
-#define CID_TypoAscentLab 3017
-#define CID_TypoAscentIsOff 3018
-#define CID_TypoDescent 3019
-#define CID_TypoDescentLab 3020
-#define CID_TypoDescentIsOff 3021
-#define CID_TypoLineGap 3022
-#define CID_HHeadAscent 3023
-#define CID_HHeadAscentLab 3024
-#define CID_HHeadAscentIsOff 3025
-#define CID_HHeadDescent 3026
-#define CID_HHeadDescentLab 3027
-#define CID_HHeadDescentIsOff 3028
-#define CID_Vendor 3029
-#define CID_IBMFamily 3030
-#define CID_OS2Version 3031
-#define CID_UseTypoMetrics 3032
-#define CID_WeightWidthSlopeOnly 3033
-
-#define CID_SubSuperDefault 3100
-#define CID_SubXSize 3101
-#define CID_SubYSize 3102
-#define CID_SubXOffset 3103
-#define CID_SubYOffset 3104
-#define CID_SuperXSize 3105
-#define CID_SuperYSize 3106
-#define CID_SuperXOffset 3107
-#define CID_SuperYOffset 3108
-#define CID_StrikeoutSize 3109
-#define CID_StrikeoutPos 3110
-
-#define CID_PanFamily 4001
-#define CID_PanSerifs 4002
-#define CID_PanWeight 4003
-#define CID_PanProp 4004
-#define CID_PanContrast 4005
-#define CID_PanStrokeVar 4006
-#define CID_PanArmStyle 4007
-#define CID_PanLetterform 4008
-#define CID_PanMidLine 4009
-#define CID_PanXHeight 4010
-#define CID_PanDefault 4011
-#define CID_PanFamilyLab 4021
-#define CID_PanSerifsLab 4022
-#define CID_PanWeightLab 4023
-#define CID_PanPropLab 4024
-#define CID_PanContrastLab 4025
-#define CID_PanStrokeVarLab 4026
-#define CID_PanArmStyleLab 4027
-#define CID_PanLetterformLab 4028
-#define CID_PanMidLineLab 4029
-#define CID_PanXHeightLab 4030
-
-#define CID_TNLangSort 5001
-#define CID_TNStringSort 5002
-#define CID_TNVScroll 5003
-#define CID_TNHScroll 5004
-#define CID_TNames 5005
-
-#define CID_Language 5006 /* Used by AskForLangNames */
-
-#define CID_Gasp 5100
-#define CID_GaspVersion 5101
-#define CID_HeadClearType 5102
-
-#define CID_Comment 6001
-
-#define CID_MarkClasses 7101
-#define CID_MarkNew 7102
-#define CID_MarkEdit 7103
-
-#define CID_TeXText 8001
-#define CID_TeXMathSym 8002
-#define CID_TeXMathExt 8003
-#define CID_MoreParams 8005
-#define CID_TeXExtraSpLabel 8006
-#define CID_TeX 8007 /* through 8014 */
-
-#define CID_DesignSize 8301
-#define CID_DesignBottom 8302
-#define CID_DesignTop 8303
-#define CID_StyleID 8304
-#define CID_StyleName 8305
-#define CID_StyleNameNew 8306
-#define CID_StyleNameDel 8307
-#define CID_StyleNameRename 8308
-
-#define CID_Tabs 10001
-#define CID_OK 10002
-#define CID_Cancel 10003
-#define CID_MainGroup 10004
-
-#define CID_Lookups 11000
-#define CID_LookupTop 11001
-#define CID_LookupUp 11002
-#define CID_LookupDown 11003
-#define CID_LookupBottom 11004
-#define CID_AddLookup 11005
-#define CID_AddSubtable 11006
-#define CID_EditMetadata 11007
-#define CID_EditSubtable 11008
-#define CID_DeleteLookup 11009
-#define CID_MergeLookup 11010
-#define CID_RevertLookups 11011
-#define CID_LookupSort 11012
-#define CID_ImportLookups 11013
-#define CID_LookupWin 11020 /* (GSUB, add 1 for GPOS) */
-#define CID_LookupVSB 11022 /* (GSUB, add 1 for GPOS) */
-#define CID_LookupHSB 11024 /* (GSUB, add 1 for GPOS) */
-#define CID_SaveLookup 11026
-#define CID_SaveFeat 11027
-#define CID_AddAllAlternates 11028
-#define CID_AddDFLT 11029
-
-#define CID_MacAutomatic 16000
-#define CID_MacStyles 16001
-#define CID_MacFOND 16002
-
-#define CID_Unicode 16100
-#define CID_UnicodeEmpties 16101
-
-const char *TTFNameIds(int id) {
- int i;
-
- FontInfoInit();
- for ( i=0; ttfnameids[i].text!=NULL; ++i )
- if ( ttfnameids[i].userdata == (void *) (intpt) id )
-return( (char *) ttfnameids[i].text );
-
- if ( id==6 )
-return( "Postscript" );
-
-return( _("Unknown") );
-}
-
-const char *MSLangString(int language) {
- int i;
-
- FontInfoInit();
- for ( i=0; mslanguages[i].text!=NULL; ++i )
- if ( mslanguages[i].userdata == (void *) (intpt) language )
-return( (char *) mslanguages[i].text );
-
- language &= 0xff;
- for ( i=0; mslanguages[i].text!=NULL; ++i )
- if ( ((intpt) mslanguages[i].userdata & 0xff) == language )
-return( (char *) mslanguages[i].text );
-
-return( _("Unknown") );
-}
-
-
-struct psdict *PSDictCopy(struct psdict *dict) {
- struct psdict *ret;
- int i;
-
- if ( dict==NULL )
-return( NULL );
-
- ret = gcalloc(1,sizeof(struct psdict));
- ret->cnt = dict->cnt; ret->next = dict->next;
- ret->keys = gcalloc(ret->cnt,sizeof(char *));
- ret->values = gcalloc(ret->cnt,sizeof(char *));
- for ( i=0; i<dict->next; ++i ) {
- ret->keys[i] = copy(dict->keys[i]);
- ret->values[i] = copy(dict->values[i]);
- }
-
-return( ret );
-}
-
-int PSDictFindEntry(struct psdict *dict, char *key) {
- int i;
-
- if ( dict==NULL )
-return( -1 );
-
- for ( i=0; i<dict->next; ++i )
- if ( strcmp(dict->keys[i],key)==0 )
-return( i );
-
-return( -1 );
-}
-
-char *PSDictHasEntry(struct psdict *dict, char *key) {
- int i;
-
- if ( dict==NULL )
-return( NULL );
-
- for ( i=0; i<dict->next; ++i )
- if ( strcmp(dict->keys[i],key)==0 )
-return( dict->values[i] );
-
-return( NULL );
-}
-
-int PSDictRemoveEntry(struct psdict *dict, char *key) {
- int i;
-
- if ( dict==NULL )
-return( false );
-
- for ( i=0; i<dict->next; ++i )
- if ( strcmp(dict->keys[i],key)==0 )
- break;
- if ( i==dict->next )
-return( false );
- free( dict->keys[i]);
- free( dict->values[i] );
- --dict->next;
- while ( i<dict->next ) {
- dict->keys[i] = dict->keys[i+1];
- dict->values[i] = dict->values[i+1];
- ++i;
- }
-
-return( true );
-}
-
-int PSDictChangeEntry(struct psdict *dict, char *key, char *newval) {
- int i;
-
- if ( dict==NULL )
-return( -1 );
-
- for ( i=0; i<dict->next; ++i )
- if ( strcmp(dict->keys[i],key)==0 )
- break;
- if ( i==dict->next ) {
- if ( dict->next>=dict->cnt ) {
- dict->cnt += 10;
- dict->keys = grealloc(dict->keys,dict->cnt*sizeof(char *));
- dict->values = grealloc(dict->values,dict->cnt*sizeof(char *));
- }
- dict->keys[dict->next] = copy(key);
- dict->values[dict->next] = NULL;
- ++dict->next;
- }
- free(dict->values[i]);
- dict->values[i] = copy(newval);
-return( i );
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-/* These are Postscript names, and as such should not be translated */
-enum { pt_number, pt_boolean, pt_array, pt_code };
-static struct { const char *name; short type, arr_size, present; } KnownPrivates[] = {
- { "BlueValues", pt_array, 14 },
- { "OtherBlues", pt_array, 10 },
- { "BlueFuzz", pt_number },
- { "FamilyBlues", pt_array, 14 },
- { "FamilyOtherBlues", pt_array, 10 },
- { "BlueScale", pt_number },
- { "BlueShift", pt_number },
- { "StdHW", pt_array, 1 },
- { "StdVW", pt_array, 1 },
- { "StemSnapH", pt_array, 12 },
- { "StemSnapV", pt_array, 12 },
- { "ForceBold", pt_boolean },
- { "LanguageGroup", pt_number },
- { "RndStemUp", pt_number },
- { "lenIV", pt_number },
- { "ExpansionFactor", pt_number },
- { "Erode", pt_code },
-/* I am deliberately not including Subrs and OtherSubrs */
-/* The first could not be entered (because it's a set of binary strings) */
-/* And the second has special meaning to us and must be handled with care */
- { NULL }
-};
-
-struct ask_data {
- int ret;
- int done;
-};
-
-static int Ask_Cancel(GGadget *g, GEvent *e) {
- GWindow gw;
- struct ask_data *d;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- d = GDrawGetUserData(gw);
- d->done = true;
- }
-return( true );
-}
-
-static int Ask_OK(GGadget *g, GEvent *e) {
- GWindow gw;
- struct ask_data *d;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- d = GDrawGetUserData(gw);
- d->done = d->ret = true;
- }
-return( true );
-}
-
-static int ask_e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- struct ask_data *d = GDrawGetUserData(gw);
- d->done = true;
- } else if ( event->type == et_char ) {
-return( false );
- }
-return( true );
-}
-
-static char *AskKey(SplineFont *sf) {
- int i,j, cnt=0;
- GTextInfo *ti;
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[8], boxes[3], *varray[9], *harray[7];
- GTextInfo label[8];
- struct ask_data d;
- char *ret;
- int ptwidth;
-
- if ( sf->private==NULL )
- for ( i=0; KnownPrivates[i].name!=NULL; ++i ) {
- KnownPrivates[i].present = 0;
- ++cnt;
- }
- else {
- for ( i=0; KnownPrivates[i].name!=NULL; ++i ) {
- for ( j=0; j<sf->private->next; ++j )
- if ( strcmp(KnownPrivates[i].name,sf->private->keys[j])==0 )
- break;
- if ( !(KnownPrivates[i].present = (j<sf->private->next)) )
- ++cnt;
- }
- }
- if ( cnt==0 )
- ti = NULL;
- else {
- ti = gcalloc(cnt+1,sizeof(GTextInfo));
- for ( i=cnt=0; KnownPrivates[i].name!=NULL; ++i )
- if ( !KnownPrivates[i].present )
- ti[cnt++].text = uc_copy(KnownPrivates[i].name);
- }
-
- memset(&d,'\0',sizeof(d));
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Private Key");
- pos.x = pos.y = 0;
- ptwidth = 2*GIntGetResource(_NUM_Buttonsize)+GGadgetScale(60);
- pos.width =GDrawPointsToPixels(NULL,ptwidth);
- pos.height = GDrawPointsToPixels(NULL,90);
- gw = GDrawCreateTopWindow(NULL,&pos,ask_e_h,&d,&wattrs);
-
- memset(&label,0,sizeof(label));
- memset(&gcd,0,sizeof(gcd));
-
- label[0].text = (unichar_t *) _("Key (in Private dictionary)");
- label[0].text_is_1byte = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 10; gcd[0].gd.pos.y = 6;
- gcd[0].gd.flags = gg_visible | gg_enabled;
- gcd[0].creator = GLabelCreate;
- varray[0] = &gcd[0]; varray[1] = NULL;
-
- gcd[1].gd.pos.x = 10; gcd[1].gd.pos.y = 18; gcd[1].gd.pos.width = ptwidth-20;
- gcd[1].gd.flags = gg_visible | gg_enabled;
- gcd[1].creator = GTextFieldCreate;
- if ( ti!=NULL ) {
- gcd[1].gd.u.list = ti;
- gcd[1].creator = GListFieldCreate;
- }
- varray[2] = &gcd[1]; varray[3] = NULL;
- varray[4] = GCD_Glue; varray[5] = NULL;
-
- gcd[2].gd.pos.x = 20-3; gcd[2].gd.pos.y = 90-35-3;
- gcd[2].gd.pos.width = -1; gcd[2].gd.pos.height = 0;
- gcd[2].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[2].text = (unichar_t *) _("_OK");
- label[2].text_is_1byte = true;
- label[2].text_in_resource = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.handle_controlevent = Ask_OK;
- gcd[2].creator = GButtonCreate;
- harray[0] = GCD_Glue; harray[1] = &gcd[2]; harray[2] = GCD_Glue;
-
- gcd[3].gd.pos.x = -20; gcd[3].gd.pos.y = 90-35;
- gcd[3].gd.pos.width = -1; gcd[3].gd.pos.height = 0;
- gcd[3].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[3].text = (unichar_t *) _("_Cancel");
- label[3].text_is_1byte = true;
- label[3].text_in_resource = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.handle_controlevent = Ask_Cancel;
- gcd[3].creator = GButtonCreate;
- harray[3] = GCD_Glue; harray[4] = &gcd[3]; harray[5] = GCD_Glue;
- harray[6] = NULL;
- varray[6] = &boxes[2]; varray[7] = NULL;
- varray[8] = NULL;
-
- gcd[4].gd.pos.x = 2; gcd[4].gd.pos.y = 2;
- gcd[4].gd.pos.width = pos.width-4; gcd[4].gd.pos.height = pos.height-2;
- gcd[4].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- gcd[4].creator = GGroupCreate;
-
- memset(boxes,0,sizeof(boxes));
- boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
- boxes[0].gd.flags = gg_enabled|gg_visible;
- boxes[0].gd.u.boxelements = varray;
- boxes[0].creator = GHVGroupCreate;
-
- boxes[2].gd.flags = gg_enabled|gg_visible;
- boxes[2].gd.u.boxelements = harray;
- boxes[2].creator = GHBoxCreate;
-
- GGadgetsCreate(gw,boxes);
- GHVBoxSetExpandableRow(boxes[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(boxes[2].ret,gb_expandgluesame);
- GHVBoxFitWindow(boxes[0].ret);
- GWidgetHidePalettes();
- GDrawSetVisible(gw,true);
- while ( !d.done )
- GDrawProcessOneEvent(NULL);
- ret = NULL;
- if ( d.ret )
- ret = cu_copy(_GGadgetGetTitle(gcd[1].ret));
- GTextInfoListFree(ti);
- GDrawDestroyWindow(gw);
-return( ret );
-}
-
-static GTextInfo *PI_ListSet(SplineFont *sf) {
- GTextInfo *ti = gcalloc((sf->private==NULL?0:sf->private->next)+1,sizeof( GTextInfo ));
- int i=0;
-
- if ( sf->private!=NULL ) {
- for ( i=0; i<sf->private->next; ++i ) {
- ti[i].text = uc_copy(sf->private->keys[i]);
- }
- }
- if ( i!=0 )
- ti[0].selected = true;
-return( ti );
-}
-
-static GTextInfo **PI_ListArray(struct psdict *private) {
- GTextInfo **ti = gcalloc((private==NULL?0:private->next)+1,sizeof( GTextInfo *));
- int i=0;
-
- if ( private!=NULL ) {
- for ( i=0; i<private->next; ++i ) {
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- ti[i]->text = uc_copy(private->keys[i]);
- }
- }
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- if ( i!=0 )
- ti[0]->selected = true;
-return( ti );
-}
-
-static void PIPrivateCheck(struct gfi_data *d) {
- if ( d->private==NULL ) {
- if ( d->sf->private==NULL ) {
- d->private = gcalloc(1,sizeof(struct psdict));
- d->private->cnt = 10;
- d->private->keys = gcalloc(10,sizeof(char *));
- d->private->values = gcalloc(10,sizeof(char *));
- } else
- d->private = PSDictCopy(d->sf->private);
- }
-}
-
-static int PIFinishFormer(struct gfi_data *d) {
- unichar_t *end;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
-#endif
-
- if ( d->old_sel < 0 )
-return( true );
- if ( d->private==NULL && d->sf->private!=NULL ) {
- const unichar_t *val = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_PrivateValues));
- if ( uc_strcmp(val,d->sf->private->values[d->old_sel])==0 )
-return( true ); /* Didn't change */
- PIPrivateCheck(d);
- }
- if ( d->private!=NULL && d->old_sel>=0 && d->old_sel!=d->private->next ) {
- const unichar_t *val = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_PrivateValues));
- const unichar_t *pt = val;
- int i;
-
- /* does the type appear reasonable? */
- while ( isspace(*pt)) ++pt;
- for ( i=0; KnownPrivates[i].name!=NULL; ++i )
- if ( strcmp(KnownPrivates[i].name,d->private->keys[d->old_sel])==0 )
- break;
- if ( KnownPrivates[i].name!=NULL ) {
- if ( KnownPrivates[i].type==pt_array ) {
- if ( *pt!='[' && gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected array.\nProceed anyway?"))==1 )
-return( false );
- } else if ( KnownPrivates[i].type==pt_boolean ) {
- if ( uc_strcmp(pt,"true")!=0 && uc_strcmp(pt,"false")!=0 &&
- gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected boolean.\nProceed anyway?"))==1 )
-return( false );
- } else if ( KnownPrivates[i].type==pt_code ) {
- if ( *pt!='{' && gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected code.\nProceed anyway?"))==1 )
-return( false );
- } else if ( KnownPrivates[i].type==pt_number ) {
- u_strtod(pt,&end);
- while ( isspace(*end)) ++end;
- if ( *end!='\0' && gwwv_ask(_("Bad type"),(const char **) buts,0,1,_("Expected number.\nProceed anyway?"))==1 )
-return( false );
- }
- }
-
- /* Ok then set it */
- free(d->private->values[d->old_sel]);
- d->private->values[d->old_sel] = cu_copy(val);
- d->old_sel = -1;
- }
-return( true );
-}
-
-static void ProcessListSel(struct gfi_data *d) {
- GGadget *list = GWidgetGetControl(d->gw,CID_PrivateEntries);
- int sel = GGadgetGetFirstListSelectedItem(list);
- unichar_t *temp;
- static const unichar_t nullstr[] = { 0 };
- SplineFont *sf = d->sf;
- struct psdict *private;
-
- if ( d->old_sel==sel )
-return;
-
- if ( !PIFinishFormer(d)) {
- /*GGadgetSelectListItem(list,sel,false);*/
- GGadgetSelectListItem(list,d->old_sel,true);
-return;
- }
- private = d->private ? d->private : sf->private;
- if ( sel==-1 ) {
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Remove),false);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess),false);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist),false);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PrivateValues),false);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),nullstr);
- } else {
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Remove),true);
- if ( strcmp(private->keys[sel],"BlueValues")==0 ||
- strcmp(private->keys[sel],"OtherBlues")==0 ||
- strcmp(private->keys[sel],"StdHW")==0 ||
- strcmp(private->keys[sel],"StemSnapH")==0 ||
- strcmp(private->keys[sel],"StdVW")==0 ||
- strcmp(private->keys[sel],"StemSnapV")==0 ) {
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess),true);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist),true);
- } else {
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Guess),false);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_Hist),false);
- }
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PrivateValues),true);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),
- temp = uc_copy( private->values[sel]));
- free( temp );
- GTextFieldShow(GWidgetGetControl(d->gw,CID_PrivateValues),0);
- }
- d->old_sel = sel;
-}
-
-static int PI_Add(GGadget *g, GEvent *e) {
- GWindow gw;
- struct gfi_data *d;
- GGadget *list;
- int i;
- char *newkey;
- GTextInfo **ti;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- d = GDrawGetUserData(gw);
- if ( !PIFinishFormer(d))
-return(true);
- newkey = AskKey(d->sf);
- if ( newkey==NULL )
-return( true );
- PIPrivateCheck(d);
- if (( i = PSDictFindEntry(d->private,newkey))==-1 )
- i = PSDictChangeEntry(d->private,newkey,"");
- list = GWidgetGetControl(d->gw,CID_PrivateEntries);
- ti = PI_ListArray(d->private);
- if ( i>0 ) {
- ti[0]->selected = false;
- ti[i]->selected = true;
- }
- GGadgetSetList(list,ti,false);
- d->old_sel = -1;
- ProcessListSel(d);
- free(newkey);
- }
-return( true );
-}
-
-static void arraystring(char *buffer,real *array,int cnt) {
- int i, ei;
-
- for ( ei=cnt; ei>1 && array[ei-1]==0; --ei );
- *buffer++ = '[';
- for ( i=0; i<ei; ++i ) {
- sprintf(buffer, "%d ", (int) array[i]);
- buffer += strlen(buffer);
- }
- if ( buffer[-1] ==' ' ) --buffer;
- *buffer++ = ']'; *buffer='\0';
-}
-
-static void SnapSet(struct psdict *private,real stemsnap[12], real snapcnt[12],
- char *name1, char *name2 ) {
- int i, mi;
- char buffer[211];
-
- mi = -1;
- for ( i=0; stemsnap[i]!=0 && i<12; ++i )
- if ( mi==-1 ) mi = i;
- else if ( snapcnt[i]>snapcnt[mi] ) mi = i;
- if ( mi==-1 )
-return;
- sprintf( buffer, "[%d]", (int) stemsnap[mi]);
- PSDictChangeEntry(private,name1,buffer);
- arraystring(buffer,stemsnap,12);
- PSDictChangeEntry(private,name2,buffer);
-}
-
-static int PI_Guess(GGadget *g, GEvent *e) {
- GWindow gw;
- struct gfi_data *d;
- GGadget *list;
- int sel;
- SplineFont *sf;
- real bluevalues[14], otherblues[10];
- real snapcnt[12];
- real stemsnap[12];
- char buffer[211];
- unichar_t *temp;
- struct psdict *private;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
-#endif
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- d = GDrawGetUserData(gw);
- sf = d->sf;
- private = d->private ? d->private : sf->private;
- list = GWidgetGetControl(d->gw,CID_PrivateEntries);
- sel = GGadgetGetFirstListSelectedItem(list);
- if ( strcmp(private->keys[sel],"BlueValues")==0 ||
- strcmp(private->keys[sel],"OtherBlues")==0 ) {
- if ( gwwv_ask(_("Guess"),(const char **) buts,0,1,_("This will change both BlueValues and OtherBlues.\nDo you want to continue?"))==1 )
-return( true );
- PIPrivateCheck(d);
- private = d->private;
- FindBlues(sf,bluevalues,otherblues);
- arraystring(buffer,bluevalues,14);
- PSDictChangeEntry(private,"BlueValues",buffer);
- if ( otherblues[0]!=0 || otherblues[1]!=0 ) {
- arraystring(buffer,otherblues,10);
- PSDictChangeEntry(private,"OtherBlues",buffer);
- }
- } else if ( strcmp(private->keys[sel],"StdHW")==0 ||
- strcmp(private->keys[sel],"StemSnapH")==0 ) {
- if ( gwwv_ask(_("Guess"),(const char **) buts,0,1,_("This will change both StdHW and StemSnapH.\nDo you want to continue?"))==1 )
-return( true );
- FindHStems(sf,stemsnap,snapcnt);
- PIPrivateCheck(d);
- SnapSet(d->private,stemsnap,snapcnt,"StdHW","StemSnapH");
- } else if ( strcmp(private->keys[sel],"StdVW")==0 ||
- strcmp(private->keys[sel],"StemSnapV")==0 ) {
- if ( gwwv_ask(_("Guess"),(const char **) buts,0,1,_("This will change both StdVW and StemSnapV.\nDo you want to continue?"))==1 )
-return( true );
- FindVStems(sf,stemsnap,snapcnt);
- PIPrivateCheck(d);
- SnapSet(d->private,stemsnap,snapcnt,"StdVW","StemSnapV");
- }
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),
- temp = uc_copy( d->private->values[sel]));
- free( temp );
- }
-return( true );
-}
-
-static int PI_Hist(GGadget *g, GEvent *e) {
- GWindow gw;
- struct gfi_data *d;
- GGadget *list;
- int sel;
- SplineFont *sf;
- struct psdict *private;
- enum hist_type h;
- unichar_t *temp;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- d = GDrawGetUserData(gw);
- sf = d->sf;
- PIPrivateCheck(d);
- private = d->private ? d->private : sf->private;
- list = GWidgetGetControl(d->gw,CID_PrivateEntries);
- sel = GGadgetGetFirstListSelectedItem(list);
- if ( strcmp(private->keys[sel],"BlueValues")==0 ||
- strcmp(private->keys[sel],"OtherBlues")==0 )
- h = hist_blues;
- else if ( strcmp(private->keys[sel],"StdHW")==0 ||
- strcmp(private->keys[sel],"StemSnapH")==0 )
- h = hist_hstem;
- else if ( strcmp(private->keys[sel],"StdVW")==0 ||
- strcmp(private->keys[sel],"StemSnapV")==0 )
- h = hist_vstem;
- else
-return( true ); /* can't happen */
- SFHistogram(sf,private,NULL,NULL,h);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_PrivateValues),
- temp = uc_copy( d->private->values[sel]));
- free( temp );
- }
-return( true );
-}
-
-static int PI_Delete(GGadget *g, GEvent *e) {
- GWindow gw;
- struct gfi_data *d;
- GGadget *list;
- int sel;
- SplineFont *sf;
- GTextInfo **ti;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- d = GDrawGetUserData(gw);
- PIPrivateCheck(d);
- sf = d->sf;
- list = GWidgetGetControl(d->gw,CID_PrivateEntries);
- sel = GGadgetGetFirstListSelectedItem(list);
- PSDictRemoveEntry(d->private, d->private->keys[sel]);
- sf->changed = true;
- ti = PI_ListArray(d->private);
- --sel;
- if ( d->private!=NULL && sel>=d->private->next )
- sel = d->private->next-1;
- if ( sel>0 ) {
- ti[0]->selected = false;
- ti[sel]->selected = true;
- }
- GGadgetSetList(list,ti,false);
- d->old_sel = -2;
- ProcessListSel(d);
- }
-return( true );
-}
-
-static int PI_ListSel(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- ProcessListSel(GDrawGetUserData(GGadgetGetWindow(g)));
- }
-return( true );
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-/* Use URW 4 letter abbreviations */
-static char *knownweights[] = { "Demi", "Bold", "Regu", "Medi", "Book", "Thin",
- "Ligh", "Heav", "Blac", "Ultr", "Nord", "Norm", "Gras", "Stan", "Halb",
- "Fett", "Mage", "Mitt", "Buch", NULL };
-static char *realweights[] = { "Demi", "Bold", "Regular", "Medium", "Book", "Thin",
- "Light", "Heavy", "Black", "Ultra", "Nord", "Normal", "Gras", "Standard", "Halbfett",
- "Fett", "Mager", "Mittel", "Buchschrift", NULL};
-#ifndef LUA_FF_LIB
-static char *moreweights[] = { "ExtraLight", "VeryLight", NULL };
-static char **noticeweights[] = { moreweights, realweights, knownweights, NULL };
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int GFI_NameChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- GWindow gw = GGadgetGetWindow(g);
- struct gfi_data *gfi = GDrawGetUserData(gw);
- const unichar_t *uname = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
- unichar_t ubuf[50];
- int i,j;
- for ( j=0; noticeweights[j]!=NULL; ++j ) {
- for ( i=0; noticeweights[j][i]!=NULL; ++i ) {
- if ( uc_strstrmatch(uname,noticeweights[j][i])!=NULL ) {
- uc_strcpy(ubuf, noticeweights[j]==knownweights ?
- realweights[i] : noticeweights[j][i]);
- GGadgetSetTitle(GWidgetGetControl(gw,CID_Weight),ubuf);
- break;
- }
- }
- if ( noticeweights[j][i]!=NULL )
- break;
- }
- if ( gfi->human_untitled )
- GGadgetSetTitle(GWidgetGetControl(gw,CID_Human),uname);
- if ( gfi->family_untitled ) {
- const unichar_t *ept = uname+u_strlen(uname); unichar_t *temp;
- for ( i=0; knownweights[i]!=NULL; ++i ) {
- if (( temp = uc_strstrmatch(uname,knownweights[i]))!=NULL && temp<ept && temp!=uname )
- ept = temp;
- }
- if (( temp = uc_strstrmatch(uname,"ital"))!=NULL && temp<ept && temp!=uname )
- ept = temp;
- if (( temp = uc_strstrmatch(uname,"obli"))!=NULL && temp<ept && temp!=uname )
- ept = temp;
- if (( temp = uc_strstrmatch(uname,"kurs"))!=NULL && temp<ept && temp!=uname )
- ept = temp;
- if (( temp = uc_strstrmatch(uname,"slanted"))!=NULL && temp<ept && temp!=uname )
- ept = temp;
- if (( temp = u_strchr(uname,'-'))!=NULL && temp!=uname )
- ept = temp;
- temp = u_copyn(uname,ept-uname);
- GGadgetSetTitle(GWidgetGetControl(gw,CID_Family),temp);
- }
- }
-return( true );
-}
-
-static int GFI_FamilyChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- gfi->family_untitled = false;
- }
-return( true );
-}
-
-static int GFI_DefBaseChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- GGadgetSetChecked(GWidgetGetControl(gfi->gw,*_GGadgetGetTitle(g)!='\0'?CID_HasDefBase:CID_SameAsFontname),
- true);
- }
-return( true );
-}
-
-static int GFI_HumanChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- gfi->human_untitled = false;
- }
-return( true );
-}
-
-static int GFI_VMetricsCheck(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- GWindow gw = GGadgetGetWindow(g);
- const unichar_t *vo = _GGadgetGetTitle(GWidgetGetControl(gw,CID_VOrigin));
- int checked = GGadgetIsChecked(g);
- if ( checked && *vo=='\0' ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- char space[10]; unichar_t uspace[10];
- sprintf( space, "%d", d->sf->ascent );
- uc_strcpy(uspace,space);
- GGadgetSetTitle(GWidgetGetControl(gw,CID_VOrigin),uspace);
- }
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_VOrigin),checked);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_VOriginLab),checked);
- GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGap),checked);
- GGadgetSetEnabled(GWidgetGetControl(GDrawGetParentWindow(gw),CID_VLineGapLab),checked);
- }
-return( true );
-}
-
-static int GFI_EmChanged(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- char buf[20]; unichar_t ubuf[20];
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- const unichar_t *ret = _GGadgetGetTitle(g); unichar_t *end;
- int val = u_strtol(ret,&end,10), ascent, descent;
- if ( *end )
-return( true );
- switch ( GGadgetGetCid(g)) {
- case CID_Em:
- ascent = rint( ((double) val)*d->sf->ascent/(d->sf->ascent+d->sf->descent) );
- descent = val - ascent;
- break;
- case CID_Ascent:
- ascent = val;
- ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
- descent = u_strtol(ret,&end,10);
- if ( *end )
-return( true );
- break;
- case CID_Descent:
- descent = val;
- ret = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
- ascent = u_strtol(ret,&end,10);
- if ( *end )
-return( true );
- break;
- }
- sprintf( buf, "%d", ascent ); if ( ascent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Ascent),ubuf);
- sprintf( buf, "%d", descent ); if ( descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Descent),ubuf);
- sprintf( buf, "%d", ascent+descent ); if ( ascent+descent==0 ) buf[0]='\0'; uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Em),ubuf);
- }
-return( true );
-}
-
-static int GFI_GuessItalic(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- double val = SFGuessItalicAngle(d->sf);
- char buf[30]; unichar_t ubuf[30];
- sprintf( buf, "%.1f", val);
- uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_ItalicAngle),ubuf);
- }
-return( true );
-}
-
-static void MCD_Close(struct markclassdlg *mcd);
-
-static void GFI_Close(struct gfi_data *d) {
- FontView *fvs;
- SplineFont *sf = d->sf;
-
- if ( d->ccd )
- CCD_Close(d->ccd);
- if ( d->smd )
- SMD_Close(d->smd);
- if ( d->mcd )
- MCD_Close(d->mcd );
-
- PSDictFree(d->private);
-
- GDrawDestroyWindow(d->gw);
- if ( d->sf->fontinfo == d )
- d->sf->fontinfo = NULL;
- for ( fvs = d->sf->fv; fvs!=NULL; fvs = fvs->nextsame ) {
- GDrawRequestExpose(sf->fv->v,NULL,false);
- }
- d->done = true;
- /* d will be freed by destroy event */;
-}
-
-static void GFI_CancelClose(struct gfi_data *d) {
- int isgpos,i,j;
-
- MacFeatListFree(GGadgetGetUserData((GWidgetGetControl(
- d->gw,CID_Features))));
- MarkClassFree(d->mark_class_cnt,d->mark_classes,d->mark_class_names);
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- struct lkdata *lk = &d->tables[isgpos];
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].new )
- SFRemoveLookup(d->sf,lk->all[i].lookup);
- else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].new )
- SFRemoveLookupSubTable(d->sf,lk->all[i].subtables[j].subtable);
- }
- free(lk->all[i].subtables);
- }
- free(lk->all);
- }
- GFI_Close(d);
-}
-
-static GTextInfo *MarkClassesList(SplineFont *sf) {
- int cnt;
- GTextInfo *ti;
-
- if ( sf->mark_class_cnt==0 )
-return( NULL );
-
- ti = gcalloc(sf->mark_class_cnt+1,sizeof(GTextInfo));
- for ( cnt=1; cnt<sf->mark_class_cnt; ++cnt ) {
- ti[cnt-1].text = uc_copy(sf->mark_class_names[cnt]);
- ti[cnt-1].fg = ti[cnt-1].bg = COLOR_DEFAULT;
- }
-return( ti );
-}
-
-#define CID_MCD_Name 1001
-#define CID_MCD_Set 1002
-#define CID_MCD_Select 1003
-#define CID_MCD_GlyphList 1004
-
-#define MCD_Width 250
-#define MCD_Height 210
-
-typedef struct markclassdlg {
- GWindow gw;
- struct gfi_data *d;
- GGadget *list;
- int which;
-} MarkClassDlg;
-
-static void MCD_Close(MarkClassDlg *mcd) {
- mcd->d->mcd = NULL;
- GDrawDestroyWindow(mcd->gw);
- free(mcd);
-}
-
-static void MCD_DoCancel(MarkClassDlg *mcd) {
- MCD_Close(mcd);
-}
-
-static int MCD_Cancel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
- MCD_DoCancel(mcd);
- }
-return( true );
-}
-
-static int MCD_InvalidClassList(const char *ret,char **classes, char **names,
- int nclass, int which) {
- const char *pt, *end;
- char *tpt, *tend;
- int i;
-
- for ( pt = ret; *pt; pt = end ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- end = strchr(pt,' ');
- if ( end==NULL ) end = pt+strlen(pt);
- for ( i=1; (i < nclass) && (classes[i]!=NULL); ++i ) {
- if ( which==i )
- continue;
- for ( tpt=classes[i]; *tpt; tpt = tend ) {
- while ( *tpt==' ' ) ++tpt;
- tend = strchr(tpt,' ');
- if ( tend==NULL ) tend = tpt+strlen(tpt);
- if ( tend-tpt==end-pt && strncmp(pt,tpt,end-pt)==0 ) {
- char *dupname = copyn(pt,end-pt);
- gwwv_post_error(_("Bad Class"),_("No glyphs from another class may appear here, but %.30s appears here and in class %.30s"), dupname, names[i]);
- free(dupname);
-return( true );
- }
- }
- }
- }
-return( false );
-}
-
-static int MCD_OK(GGadget *g, GEvent *e) {
- char *newname;
- char *glyphs;
- struct gfi_data *d;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
- newname = GGadgetGetTitle8(GWidgetGetControl(mcd->gw,CID_MCD_Name));
- glyphs = GGadgetGetTitle8(GWidgetGetControl(mcd->gw,CID_MCD_GlyphList));
- d = mcd->d;
-
- if ( !CCD_NameListCheck(d->sf,glyphs,true,_("Bad Class")) ||
- MCD_InvalidClassList(glyphs,d->mark_classes,d->mark_class_names,
- d->mark_class_cnt,mcd->which )) {
- free(newname); free(glyphs);
-return( true );
- }
-
- if ( mcd->which==-1 ) { /* New */
-
- if ( d->mark_class_cnt==0 ) {
- d->mark_class_cnt = 2; /* Class 0 is magic */
- d->mark_classes = gcalloc(2,sizeof(char *));
- d->mark_class_names = gcalloc(2,sizeof(unichar_t *));
- } else {
- ++d->mark_class_cnt;
- d->mark_classes = grealloc(d->mark_classes,d->mark_class_cnt*sizeof(char*));
- d->mark_class_names = grealloc(d->mark_class_names,d->mark_class_cnt*sizeof(unichar_t*));
- }
- d->mark_classes[d->mark_class_cnt-1] = copy(glyphs);
- d->mark_class_names[d->mark_class_cnt-1] = copy(newname);
- GListAppendLine8(mcd->list,newname,false);
- } else {
- free(d->mark_classes[mcd->which]); d->mark_classes[mcd->which] = copy(glyphs);
- free(d->mark_class_names[mcd->which]); d->mark_class_names[mcd->which] = copy(newname);
- GListChangeLine8(mcd->list,mcd->which,newname);
- }
- MCD_Close(mcd);
- free(newname); free(glyphs);
- }
-return( true );
-}
-
-static int MCD_ToSelection(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(mcd->gw,CID_MCD_GlyphList));
- SplineFont *sf = mcd->d->sf;
- FontView *fv = sf->fv;
- const unichar_t *end;
- int pos, found=-1;
- char *nm;
-
- GDrawSetVisible(fv->gw,true);
- GDrawRaise(fv->gw);
- memset(fv->selected,0,fv->map->enccount);
- while ( *ret ) {
- end = u_strchr(ret,' ');
- if ( end==NULL ) end = ret+u_strlen(ret);
- nm = cu_copybetween(ret,end);
- for ( ret = end; isspace(*ret); ++ret);
- if (( pos = SFFindSlot(sf,fv->map,-1,nm))!=-1 ) {
- if ( found==-1 ) found = pos;
- if ( pos!=-1 )
- fv->selected[pos] = true;
- }
- free(nm);
- }
-
- if ( found!=-1 )
- FVScrollToChar(fv,found);
- GDrawRequestExpose(fv->v,NULL,false);
- }
-return( true );
-}
-
-static int MCD_FromSelection(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- MarkClassDlg *mcd = GDrawGetUserData(GGadgetGetWindow(g));
- SplineFont *sf = mcd->d->sf;
- FontView *fv = sf->fv;
- unichar_t *vals, *pt;
- int i, len, max, gid;
- SplineChar *sc, dummy;
-
- for ( i=len=max=0; i<fv->map->enccount; ++i ) if ( fv->selected[i]) {
- gid = fv->map->map[i];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL )
- sc = sf->glyphs[gid];
- else
- sc = SCBuildDummy(&dummy,sf,fv->map,i);
- len += strlen(sc->name)+1;
- if ( fv->selected[i]>max ) max = fv->selected[i];
- }
- pt = vals = galloc((len+1)*sizeof(unichar_t));
- *pt = '\0';
- /* in a class the order of selection is irrelevant */
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i]) {
- gid = fv->map->map[i];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL )
- sc = sf->glyphs[gid];
- else
- sc = SCBuildDummy(&dummy,sf,fv->map,i);
- uc_strcpy(pt,sc->name);
- pt += u_strlen(pt);
- *pt++ = ' ';
- }
- if ( pt>vals ) pt[-1]='\0';
-
- GGadgetSetTitle(GWidgetGetControl(mcd->gw,CID_MCD_GlyphList),vals);
- free(vals);
- }
-return( true );
-}
-
-void DropChars2Text(GWindow gw, GGadget *glyphs,GEvent *event) {
- char *cnames;
- const unichar_t *old;
- unichar_t *new;
- int32 len;
-
- if ( !GDrawSelectionHasType(gw,sn_drag_and_drop,"STRING"))
-return;
- cnames = GDrawRequestSelection(gw,sn_drag_and_drop,"STRING",&len);
- if ( cnames==NULL )
-return;
-
- old = _GGadgetGetTitle(glyphs);
- if ( old==NULL || *old=='\0' ) {
- new = uc_copy(cnames);
- } else {
- new = galloc(strlen(cnames)+u_strlen(old)+5);
- u_strcpy(new,old);
- if ( new[u_strlen(new)-1]!=' ' )
- uc_strcat(new," ");
- uc_strcat(new,cnames);
- }
- GGadgetSetTitle(glyphs,new);
- free( cnames );
- free( new );
-}
-
-static void MCD_Drop(MarkClassDlg *mcd,GEvent *event) {
- DropChars2Text(mcd->gw,GWidgetGetControl(mcd->gw,CID_MCD_GlyphList),event);
-}
-
-static int mcd_e_h(GWindow gw, GEvent *event) {
- MarkClassDlg *mcd = GDrawGetUserData(gw);
-
- switch ( event->type ) {
- case et_close:
- MCD_DoCancel(mcd);
- break;
- case et_char:
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("fontinfo.html#MarkClass");
-return( true );
- }
-return( false );
- break;
- case et_drop:
- MCD_Drop(mcd,event);
- break;
- }
-return( true );
-}
-
-static void CreateMarkClassDlg(struct gfi_data *d, GGadget *list, int which) {
- MarkClassDlg *mcd;
- GWindow gw;
- GRect pos;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[10];
- GTextInfo label[10];
- int k;
- unichar_t *freeme = NULL;
-
- if ( d->mcd!=NULL ) {
- GDrawSetVisible(d->mcd->gw,true);
- GDrawRaise(d->mcd->gw);
-return;
- }
-
- memset(&wattrs,0,sizeof(wattrs));
- memset(&gcd,0,sizeof(gcd));
- memset(&label,0,sizeof(label));
-
- mcd = gcalloc(1,sizeof(MarkClassDlg));
- mcd->d = d; mcd->list = list; mcd->which = which;
-
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = false;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Mark Classes");
- wattrs.is_dlg = false;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,MCD_Width));
- pos.height = GDrawPointsToPixels(NULL,MCD_Height);
- mcd->gw = gw = GDrawCreateTopWindow(NULL,&pos,mcd_e_h,mcd,&wattrs);
-
- k = 0;
-
- label[k].text = (unichar_t *) _("Class Name:");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = 10;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k++].creator = GLabelCreate;
-
- if ( which!=-1 ) {
- gcd[k].gd.label = &label[k];
- label[k].text = (unichar_t *) d->mark_class_names[which];
- label[k].text_is_1byte = true;
- }
- gcd[k].gd.pos.x = 70; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.cid = CID_MCD_Name;
- gcd[k++].creator = GTextFieldCreate;
-
- label[k].text = (unichar_t *) _("Set From Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+28;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set this glyph list to be the glyphs selected in the fontview");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = MCD_FromSelection;
- gcd[k].gd.cid = CID_MCD_Set;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("Select In Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 110; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set the fontview's selection to be the glyphs named here");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = MCD_ToSelection;
- gcd[k].gd.cid = CID_MCD_Select;
- gcd[k++].creator = GButtonCreate;
-
- if ( which!=-1 ) {
- gcd[k].gd.label = &label[k];
- label[k].text = freeme = uc_copy(d->mark_classes[which]);
- }
- gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
- gcd[k].gd.pos.width = MCD_Width-20; gcd[k].gd.pos.height = 8*13+4;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap; /* Just ASCII text for glyph names, no need for xim */
- gcd[k].gd.cid = CID_MCD_GlyphList;
- gcd[k++].creator = GTextAreaCreate;
-
- label[k].text = (unichar_t *) _("_OK");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 30; gcd[k].gd.pos.y = MCD_Height-30-3;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible|gg_enabled | gg_but_default;
- gcd[k].gd.handle_controlevent = MCD_OK;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Cancel");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = -30+3; gcd[k].gd.pos.y = MCD_Height-30;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible|gg_enabled | gg_but_cancel;
- gcd[k].gd.handle_controlevent = MCD_Cancel;
- gcd[k++].creator = GButtonCreate;
-
- gcd[k].gd.pos.x = 2; gcd[k].gd.pos.y = 2;
- gcd[k].gd.pos.width = pos.width-4;
- gcd[k].gd.pos.height = pos.height-4;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_pos_in_pixels;
- gcd[k++].creator = GGroupCreate;
-
- GGadgetsCreate(mcd->gw,gcd);
- GDrawSetVisible(mcd->gw,true);
-
- free(freeme);
-}
-
-static int GFI_MarkNew(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- CreateMarkClassDlg(d, GWidgetGetControl(GGadgetGetWindow(g),CID_MarkClasses), -1);
- }
-return( true );
-}
-
-static int GFI_MarkEdit(GGadget *g, GEvent *e) {
- int i;
- GGadget *list;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- list = GWidgetGetControl(GGadgetGetWindow(g),CID_MarkClasses);
- if ( (i = GGadgetGetFirstListSelectedItem(list))==-1 && i+1 < d->mark_class_cnt )
-return( true );
- CreateMarkClassDlg(d, list, i+1);
- }
-return( true );
-}
-
-static int GFI_MarkSelChanged(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- int sel = GGadgetGetFirstListSelectedItem(g);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MarkEdit),sel!=-1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- e->u.control.subtype = et_buttonactivate;
- GFI_MarkEdit(g,e);
- }
-return( true );
-}
-
-static char *OtfNameToText(int lang, const char *name) {
- const char *langname;
- char *text;
- int i;
-
- for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
- if ( mslanguages[i].userdata == (void *) (intpt) lang )
- break;
- if ( i==-1 )
- for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
- if ( ((intpt) mslanguages[i].userdata&0xff) == (lang&0xff) )
- break;
- if ( i==-1 )
- langname = "";
- else
- langname = (char*) (mslanguages[i].text);
-
- text = galloc((strlen(langname)+strlen(name)+4));
- strcpy(text,name);
- strcat(text," | ");
- strcat(text,langname);
-return( text );
-}
-
-static GTextInfo **StyleNames(struct otfname *otfn) {
- int cnt;
- struct otfname *on;
- GTextInfo **tis;
- char *cname;
-
- for ( cnt=0, on=otfn; on!=NULL; on=on->next )
- ++cnt;
- tis = galloc((cnt+1)*sizeof(GTextInfo *));
- for ( cnt=0, on=otfn; on!=NULL; on=on->next, ++cnt ) {
- tis[cnt] = gcalloc(1,sizeof(GTextInfo));
- tis[cnt]->fg = tis[cnt]->bg = COLOR_DEFAULT;
- tis[cnt]->userdata = (void *) (intpt) otfn->lang;
- cname = OtfNameToText(on->lang,on->name);
- tis[cnt]->text = utf82u_copy(cname);
- free(cname);
- }
- tis[cnt] = gcalloc(1,sizeof(GTextInfo));
-return( tis );
-}
-
-static struct otfname *OtfNameFromStyleNames(GGadget *list) {
- int32 len; int i;
- GTextInfo **old = GGadgetGetList(list,&len);
- struct otfname *head=NULL, *last, *cur;
- unichar_t *pt, *temp;
-
- for ( i=0; i<len; ++i ) {
- cur = chunkalloc(sizeof(struct otfname));
- cur->lang = (intpt) old[i]->userdata;
- pt = uc_strstr(old[i]->text," | ");
- temp = u_copyn(old[i]->text,pt-old[i]->text);
- cur->name = u2utf8_copy(temp);
- free(temp);
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- }
-return( head );
-}
-
-static int sn_e_h(GWindow gw, GEvent *event) {
-
- if ( event->type==et_close ) {
- int *d = GDrawGetUserData(gw);
- *d = true;
- } else if ( event->type == et_char ) {
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- int *d = GDrawGetUserData(gw);
- *d = GGadgetGetCid(event->u.control.g)+1;
- }
-return( true );
-}
-
-static void AskForLangName(GGadget *list,int sel) {
- int32 len; int i;
- GTextInfo **old = GGadgetGetList(list,&len);
- unichar_t *name, *pt;
- char *cname;
- int lang_index;
- GGadgetCreateData gcd[7];
- GTextInfo label[5];
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- int done = 0;
- int k;
- GTextInfo **ti;
- char *temp;
-
- for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
- mslanguages[i].fg = mslanguages[i].bg = COLOR_DEFAULT;
- if ( sel==-1 ) {
- for ( i=0; i<len; ++i )
- if ( old[i]->userdata == (void *) 0x409 )
- break;
- if ( i==len ) {
- for ( i=sizeof(mslanguages)/sizeof(mslanguages[0])-1; i>=0 ; --i )
- if ( mslanguages[i].userdata == (void *) 0x409 )
- break;
- lang_index = i;
- } else {
- for ( lang_index=sizeof(mslanguages)/sizeof(mslanguages[0])-1; lang_index>=0 ; --lang_index ) {
- for ( i=0; i<len; ++i )
- if ( mslanguages[lang_index].userdata == old[i]->userdata )
- break;
- if ( i==len )
- break;
- }
- }
- if ( lang_index < 0 )
- lang_index = 0;
- name = uc_copy("");
- } else {
- for ( lang_index=sizeof(mslanguages)/sizeof(mslanguages[0])-1; lang_index>=0 ; --lang_index )
- if ( mslanguages[lang_index].userdata == old[sel]->userdata )
- break;
- if ( lang_index < 0 )
- lang_index = 0;
- pt = uc_strstr(old[sel]->text," | ");
- name = u_copyn(old[sel]->text,pt-old[sel]->text);
- }
-
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
-
- gcd[0].gd.pos.x = 7; gcd[0].gd.pos.y = 7;
- gcd[0].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic;
- gcd[0].gd.cid = CID_Language;
- gcd[0].gd.u.list = mslanguages;
- gcd[0].creator = GListButtonCreate;
- for ( i=0; mslanguages[i].text!=NULL; ++i )
- mslanguages[i].selected = false;
- mslanguages[lang_index].selected = true;
-
- k = 1;
- label[k].text = (unichar_t *) _("_Name:");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k++].creator = GLabelCreate;
-
- label[k].text = name;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 50; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
- gcd[k].gd.pos.width = 122;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.cid = CID_StyleName;
- gcd[k++].creator = GTextFieldCreate;
-
- gcd[k].gd.pos.x = 25-3; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
- gcd[k].gd.pos.width = -1; gcd[k].gd.pos.height = 0;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[k].text = (unichar_t *) _("_OK");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.cid = true;
- gcd[k++].creator = GButtonCreate;
-
- gcd[k].gd.pos.x = -25; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+3;
- gcd[k].gd.pos.width = -1; gcd[k].gd.pos.height = 0;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[k].text = (unichar_t *) _("_Cancel");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.cid = false;
- gcd[k++].creator = GButtonCreate;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.is_dlg = true;
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Style Name:");
- pos.x = pos.y = 0;
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(180));
- pos.height = GDrawPointsToPixels(NULL,2*26+45);
- gw = GDrawCreateTopWindow(NULL,&pos,sn_e_h,&done,&wattrs);
-
- GGadgetsCreate(gw,gcd);
- free(name);
- ti = GGadgetGetList(gcd[0].ret,&len);
- for ( i=0; i<len; ++i )
- if ( ti[i]->userdata == mslanguages[lang_index].userdata ) {
- GGadgetSelectOneListItem(gcd[0].ret,i);
- break;
- }
- GDrawSetVisible(gw,true);
-
- while ( !done )
- GDrawProcessOneEvent(NULL);
-
- if ( done==2 ) {
- lang_index = GGadgetGetFirstListSelectedItem(gcd[0].ret);
- cname = OtfNameToText((intpt) ti[lang_index]->userdata,
- (temp = GGadgetGetTitle8(GWidgetGetControl(gw,CID_StyleName))));
- free(temp);
- if ( sel==-1 )
- GListAppendLine8(list,cname,false)->userdata =
- ti[lang_index]->userdata;
- else
- GListChangeLine8(list,sel,cname)->userdata =
- ti[lang_index]->userdata;
- free(name);
- }
-
- GDrawDestroyWindow(gw);
-}
-
-static int GFI_StyleNameNew(GGadget *g, GEvent *e) {
- GGadget *list;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- list = GWidgetGetControl(GGadgetGetWindow(g),CID_StyleName);
- AskForLangName(list,-1);
- }
-return( true );
-}
-
-static int GFI_StyleNameDel(GGadget *g, GEvent *e) {
- GGadget *list;
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- list = GWidgetGetControl(GGadgetGetWindow(g),CID_StyleName);
- GListDelSelected(list);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_StyleNameDel),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_StyleNameRename),false);
- }
-return( true );
-}
-
-static int GFI_StyleNameRename(GGadget *g, GEvent *e) {
- GGadget *list;
- int sel;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- list = GWidgetGetControl(GGadgetGetWindow(g),CID_StyleName);
- if ( (sel=GGadgetGetFirstListSelectedItem(list))==-1 )
-return( true );
- AskForLangName(list,sel);
- }
-return( true );
-}
-
-static int GFI_StyleNameSelChanged(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- int sel = GGadgetGetFirstListSelectedItem(g);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_StyleNameDel),sel!=-1);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_StyleNameRename),sel!=-1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- e->u.control.subtype = et_buttonactivate;
- GFI_StyleNameRename(g,e);
- }
-return( true );
-}
-
-void GListMoveSelected(GGadget *list,int offset) {
- int32 len; int i,j;
- GTextInfo **old, **new;
-
- old = GGadgetGetList(list,&len);
- new = gcalloc(len+1,sizeof(GTextInfo *));
- j = (offset<0 ) ? 0 : len-1;
- for ( i=0; i<len; ++i ) if ( old[i]->selected ) {
- if ( offset==0x80000000 || offset==0x7fffffff )
- /* Do Nothing */;
- else if ( offset<0 ) {
- if ( (j= i+offset)<0 ) j=0;
- while ( new[j] ) ++j;
- } else {
- if ( (j= i+offset)>=len ) j=len-1;
- while ( new[j] ) --j;
- }
- new[j] = galloc(sizeof(GTextInfo));
- *new[j] = *old[i];
- new[j]->text = u_copy(new[j]->text);
- if ( offset<0 ) ++j; else --j;
- }
- for ( i=j=0; i<len; ++i ) if ( !old[i]->selected ) {
- while ( new[j] ) ++j;
- new[j] = galloc(sizeof(GTextInfo));
- *new[j] = *old[i];
- new[j]->text = u_copy(new[j]->text);
- ++j;
- }
- new[len] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,new,false);
-}
-
-void GListDelSelected(GGadget *list) {
- int32 len; int i,j;
- GTextInfo **old, **new;
-
- old = GGadgetGetList(list,&len);
- new = gcalloc(len+1,sizeof(GTextInfo *));
- for ( i=j=0; i<len; ++i ) if ( !old[i]->selected ) {
- new[j] = galloc(sizeof(GTextInfo));
- *new[j] = *old[i];
- new[j]->text = u_copy(new[j]->text);
- ++j;
- }
- new[j] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,new,false);
-}
-
-GTextInfo *GListChangeLine(GGadget *list,int pos, const unichar_t *line) {
- GTextInfo **old, **new;
- int32 i,len;
-
- old = GGadgetGetList(list,&len);
- new = gcalloc(len+1,sizeof(GTextInfo *));
- for ( i=0; i<len; ++i ) {
- new[i] = galloc(sizeof(GTextInfo));
- *new[i] = *old[i];
- if ( i!=pos )
- new[i]->text = u_copy(new[i]->text);
- else
- new[i]->text = u_copy(line);
- }
- new[i] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,new,false);
- GGadgetScrollListToPos(list,pos);
-return( new[pos]);
-}
-
-GTextInfo *GListAppendLine(GGadget *list,const unichar_t *line,int select) {
- GTextInfo **old, **new;
- int32 i,len;
-
- old = GGadgetGetList(list,&len);
- new = gcalloc(len+2,sizeof(GTextInfo *));
- for ( i=0; i<len; ++i ) {
- new[i] = galloc(sizeof(GTextInfo));
- *new[i] = *old[i];
- new[i]->text = u_copy(new[i]->text);
- if ( select ) new[i]->selected = false;
- }
- new[i] = gcalloc(1,sizeof(GTextInfo));
- new[i]->fg = new[i]->bg = COLOR_DEFAULT;
- new[i]->userdata = NULL;
- new[i]->text = u_copy(line);
- new[i]->selected = select;
- new[i+1] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,new,false);
- GGadgetScrollListToPos(list,i);
-return( new[i]);
-}
-
-GTextInfo *GListChangeLine8(GGadget *list,int pos, const char *line) {
- GTextInfo **old, **new;
- int32 i,len;
-
- old = GGadgetGetList(list,&len);
- new = gcalloc(len+1,sizeof(GTextInfo *));
- for ( i=0; i<len; ++i ) {
- new[i] = galloc(sizeof(GTextInfo));
- *new[i] = *old[i];
- if ( i!=pos )
- new[i]->text = u_copy(new[i]->text);
- else
- new[i]->text = utf82u_copy(line);
- }
- new[i] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,new,false);
- GGadgetScrollListToPos(list,pos);
-return( new[pos]);
-}
-
-GTextInfo *GListAppendLine8(GGadget *list,const char *line,int select) {
- GTextInfo **old, **new;
- int32 i,len;
-
- old = GGadgetGetList(list,&len);
- new = gcalloc(len+2,sizeof(GTextInfo *));
- for ( i=0; i<len; ++i ) {
- new[i] = galloc(sizeof(GTextInfo));
- *new[i] = *old[i];
- new[i]->text = u_copy(new[i]->text);
- if ( select ) new[i]->selected = false;
- }
- new[i] = gcalloc(1,sizeof(GTextInfo));
- new[i]->fg = new[i]->bg = COLOR_DEFAULT;
- new[i]->userdata = NULL;
- new[i]->text = utf82u_copy(line);
- new[i]->selected = select;
- new[i+1] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,new,false);
- GGadgetScrollListToPos(list,i);
-return( new[i]);
-}
-
-static int GFI_Cancel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- GFI_CancelClose(d);
- }
-return( true );
-}
-
-static int AskLoseUndoes() {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
-#endif
-return( gwwv_ask(_("Losing Undoes"),(const char **) buts,0,1,_("Changing the order of the splines in the font will lose all undoes.\nContinue anyway?")) );
-}
-
-static void BadFamily() {
- gwwv_post_error(_("Bad Family Name"),_("Bad Family Name, must begin with an alphabetic character."));
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-static char *modifierlist[] = { "Ital", "Obli", "Kursive", "Cursive", "Slanted",
- "Expa", "Cond", NULL };
-static char *modifierlistfull[] = { "Italic", "Oblique", "Kursive", "Cursive", "Slanted",
- "Expanded", "Condensed", NULL };
-static char **mods[] = { knownweights, modifierlist, NULL };
-static char **fullmods[] = { realweights, modifierlistfull, NULL };
-
-char *_GetModifiers(char *fontname, char *familyname,char *weight) {
- char *pt, *fpt;
- int i, j;
-
- /* URW fontnames don't match the familyname */
- /* "NimbusSanL-Regu" vs "Nimbus Sans L" (note "San" vs "Sans") */
- /* so look for a '-' if there is one and use that as the break point... */
-
- if ( (fpt=strchr(fontname,'-'))!=NULL ) {
- ++fpt;
- if ( *fpt=='\0' )
- fpt = NULL;
- } else if ( familyname!=NULL ) {
- for ( pt = fontname, fpt=familyname; *fpt!='\0' && *pt!='\0'; ) {
- if ( *fpt == *pt ) {
- ++fpt; ++pt;
- } else if ( *fpt==' ' )
- ++fpt;
- else if ( *pt==' ' )
- ++pt;
- else if ( *fpt=='a' || *fpt=='e' || *fpt=='i' || *fpt=='o' || *fpt=='u' )
- ++fpt; /* allow vowels to be omitted from family when in fontname */
- else
- break;
- }
- if ( *fpt=='\0' && *pt!='\0' )
- fpt = pt;
- else
- fpt = NULL;
- }
-
- if ( fpt == NULL ) {
- for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
- pt = strstr(fontname,mods[i][j]);
- if ( pt!=NULL && (fpt==NULL || pt<fpt))
- fpt = pt;
- }
- }
- if ( fpt!=NULL ) {
- for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
- if ( strcmp(fpt,mods[i][j])==0 )
-return( fullmods[i][j]);
- }
- if ( strcmp(fpt,"BoldItal")==0 )
-return( "BoldItalic" );
- else if ( strcmp(fpt,"BoldObli")==0 )
-return( "BoldOblique" );
-
-return( fpt );
- }
-
-return( weight==NULL || *weight=='\0' ? "Regular": weight );
-}
-
-char *SFGetModifiers(SplineFont *sf) {
-return( _GetModifiers(sf->fontname,sf->familyname,sf->weight));
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static const unichar_t *_uGetModifiers(const unichar_t *fontname, const unichar_t *familyname,
- const unichar_t *weight) {
- const unichar_t *pt, *fpt;
- static unichar_t regular[] = { 'R','e','g','u','l','a','r', 0 };
- static unichar_t space[20];
- int i,j;
-
- /* URW fontnames don't match the familyname */
- /* "NimbusSanL-Regu" vs "Nimbus Sans L" (note "San" vs "Sans") */
- /* so look for a '-' if there is one and use that as the break point... */
-
- if ( (fpt=u_strchr(fontname,'-'))!=NULL ) {
- ++fpt;
- if ( *fpt=='\0' )
- fpt = NULL;
- } else if ( familyname!=NULL ) {
- for ( pt = fontname, fpt=familyname; *fpt!='\0' && *pt!='\0'; ) {
- if ( *fpt == *pt ) {
- ++fpt; ++pt;
- } else if ( *fpt==' ' )
- ++fpt;
- else if ( *pt==' ' )
- ++pt;
- else if ( *fpt=='a' || *fpt=='e' || *fpt=='i' || *fpt=='o' || *fpt=='u' )
- ++fpt; /* allow vowels to be omitted from family when in fontname */
- else
- break;
- }
- if ( *fpt=='\0' && *pt!='\0' )
- fpt = pt;
- else
- fpt = NULL;
- }
-
- if ( fpt==NULL ) {
- for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
- pt = uc_strstr(fontname,mods[i][j]);
- if ( pt!=NULL && (fpt==NULL || pt<fpt))
- fpt = pt;
- }
- }
-
- if ( fpt!=NULL ) {
- for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
- if ( uc_strcmp(fpt,mods[i][j])==0 ) {
- uc_strcpy(space,fullmods[i][j]);
-return( space );
- }
- }
- if ( uc_strcmp(fpt,"BoldItal")==0 ) {
- uc_strcpy(space,"BoldItalic");
-return( space );
- } else if ( uc_strcmp(fpt,"BoldObli")==0 ) {
- uc_strcpy(space,"BoldOblique");
-return( space );
- }
-return( fpt );
- }
-
-return( weight==NULL || *weight=='\0' ? regular: weight );
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-void SFSetFontName(SplineFont *sf, char *family, char *mods,char *full) {
- char *n;
- char *pt, *tpt;
-
- n = galloc(strlen(family)+strlen(mods)+2);
- strcpy(n,family); strcat(n," "); strcat(n,mods);
- if ( full==NULL || *full == '\0' )
- full = copy(n);
- for ( pt=tpt=n; *pt; ) {
- if ( !Isspace(*pt))
- *tpt++ = *pt++;
- else
- ++pt;
- }
- *tpt = '\0';
-#if 0
- for ( pt=tpt=family; *pt; ) {
- if ( !Isspace(*pt))
- *tpt++ = *pt++;
- else
- ++pt;
- }
- *tpt = '\0';
-#endif
-
- free(sf->fullname); sf->fullname = copy(full);
-
- /* In the URW world fontnames aren't just a simple concatenation of */
- /* family name and modifiers, so neither the family name nor the modifiers */
- /* changed, then don't change the font name */
- if ( strcmp(family,sf->familyname)==0 && strcmp(n,sf->fontname)==0 )
- /* Don't change the fontname */;
- /* or anything else */
- else {
- free(sf->fontname); sf->fontname = n;
- free(sf->familyname); sf->familyname = copy(family);
- free(sf->weight); sf->weight = NULL;
- if ( strstrmatch(mods,"extralight")!=NULL || strstrmatch(mods,"extra-light")!=NULL )
- sf->weight = copy("ExtraLight");
- else if ( strstrmatch(mods,"demilight")!=NULL || strstrmatch(mods,"demi-light")!=NULL )
- sf->weight = copy("DemiLight");
- else if ( strstrmatch(mods,"demibold")!=NULL || strstrmatch(mods,"demi-bold")!=NULL )
- sf->weight = copy("DemiBold");
- else if ( strstrmatch(mods,"semibold")!=NULL || strstrmatch(mods,"semi-bold")!=NULL )
- sf->weight = copy("SemiBold");
- else if ( strstrmatch(mods,"demiblack")!=NULL || strstrmatch(mods,"demi-black")!=NULL )
- sf->weight = copy("DemiBlack");
- else if ( strstrmatch(mods,"extrabold")!=NULL || strstrmatch(mods,"extra-bold")!=NULL )
- sf->weight = copy("ExtraBold");
- else if ( strstrmatch(mods,"extrablack")!=NULL || strstrmatch(mods,"extra-black")!=NULL )
- sf->weight = copy("ExtraBlack");
- else if ( strstrmatch(mods,"book")!=NULL )
- sf->weight = copy("Book");
- else if ( strstrmatch(mods,"regular")!=NULL )
- sf->weight = copy("Regular");
- else if ( strstrmatch(mods,"roman")!=NULL )
- sf->weight = copy("Roman");
- else if ( strstrmatch(mods,"normal")!=NULL )
- sf->weight = copy("Normal");
- else if ( strstrmatch(mods,"demi")!=NULL )
- sf->weight = copy("Demi");
- else if ( strstrmatch(mods,"medium")!=NULL )
- sf->weight = copy("Medium");
- else if ( strstrmatch(mods,"bold")!=NULL )
- sf->weight = copy("Bold");
- else if ( strstrmatch(mods,"heavy")!=NULL )
- sf->weight = copy("Heavy");
- else if ( strstrmatch(mods,"black")!=NULL )
- sf->weight = copy("Black");
- else if ( strstrmatch(mods,"Nord")!=NULL )
- sf->weight = copy("Nord");
-/* Sigh. URW uses 4 letter abreviations... */
- else if ( strstrmatch(mods,"Regu")!=NULL )
- sf->weight = copy("Regular");
- else if ( strstrmatch(mods,"Medi")!=NULL )
- sf->weight = copy("Medium");
- else if ( strstrmatch(mods,"blac")!=NULL )
- sf->weight = copy("Black");
- else
- sf->weight = copy("Medium");
- }
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( sf->fv!=NULL && sf->fv->gw!=NULL ) {
- unichar_t *temp;
- int i;
- GDrawSetWindowTitles(sf->fv->gw,temp = uc_copy(sf->fontname),NULL);
- free(temp);
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->views!=NULL ) {
- char buffer[300]; unichar_t ubuf[300]; CharView *cv;
- sprintf( buffer, "%.90s from %.90s", sf->glyphs[i]->name, sf->fontname );
- uc_strcpy(ubuf,buffer);
- for ( cv = sf->glyphs[i]->views; cv!=NULL; cv=cv->next )
- GDrawSetWindowTitles(cv->gw,ubuf,NULL);
- }
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-}
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-static int SetFontName(GWindow gw, SplineFont *sf) {
- const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
- const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Fontname));
- const unichar_t *uweight = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Weight));
- const unichar_t *uhum = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Human));
- int diff = uc_strcmp(ufont,sf->fontname)!=0;
-
- free(sf->familyname);
- free(sf->fontname);
- free(sf->weight);
- free(sf->fullname);
- sf->familyname = cu_copy(ufamily);
- sf->fontname = cu_copy(ufont);
- sf->weight = cu_copy(uweight);
- sf->fullname = cu_copy(uhum);
-return( diff );
-}
-
-static int CheckNames(struct gfi_data *d) {
- const unichar_t *ufamily = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family));
- const unichar_t *ufont = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname));
- unichar_t *end; const unichar_t *pt;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
-#endif
-
- if ( u_strlen(ufont)>63 ) {
- gwwv_post_error(_("Bad Font Name"),_("A Postscript name should be ASCII\nand must not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"));
-return( false );
- }
-
- if ( *ufamily=='\0' ) {
- gwwv_post_error(_("A Font Family name is required"),_("A Font Family name is required"));
-return( false );
- }
- /* A postscript name cannot be a number. There are two ways it can be a */
- /* number, it can be a real (which we can check for with strtod) or */
- /* it can be a "radix number" which is <intval>'#'<intval>. I'll only */
- /* do a cursory test for that */
- u_strtod(ufamily,&end);
- if ( *end=='\0' || (isdigit(ufamily[0]) && u_strchr(ufamily,'#')!=NULL) ) {
- gwwv_post_error(_("Bad Font Family Name"),_("A Postscript name may not be a number"));
-return( false );
- }
- if ( u_strlen(ufamily)>31 ) {
- if ( gwwv_ask(_("Bad Font Family Name"),(const char **) buts,0,1,_("Some versions of Windows will refuse to install postscript fonts if the familyname is longer than 31 characters. Do you want to continue anyway?"))==1 )
-return( false );
- } else {
- if ( u_strlen(ufont)>31 ) {
- if ( gwwv_ask(_("Bad Font Name"),(const char **) buts,0,1,_("Some versions of Windows will refuse to install postscript fonts if the fontname is longer than 31 characters. Do you want to continue anyway?"))==1 )
-return( false );
- } else if ( u_strlen(ufont)>29 ) {
- if ( gwwv_ask(_("Bad Font Name"),(const char **) buts,0,1,_("Adobe's fontname spec (5088.FontNames.pdf) says that fontnames must not be longer than 29 characters. Do you want to continue anyway?"))==1 )
-return( false );
- }
- }
- while ( *ufamily ) {
- if ( *ufamily<' ' || *ufamily>=0x7f ) {
- gwwv_post_error(_("Bad Font Family Name"),_("A Postscript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
-return( false );
- }
- ++ufamily;
- }
-
- u_strtod(ufont,&end);
- if ( (*end=='\0' || (isdigit(ufont[0]) && u_strchr(ufont,'#')!=NULL)) &&
- *ufont!='\0' ) {
- gwwv_post_error(_("Bad Font Name"),_("A Postscript name may not be a number"));
-return( false );
- }
- for ( pt=ufont; *pt; ++pt ) {
- if ( *pt<=' ' || *pt>=0x7f ||
- *pt=='(' || *pt=='[' || *pt=='{' || *pt=='<' ||
- *pt==')' || *pt==']' || *pt=='}' || *pt=='>' ||
- *pt=='%' || *pt=='/' ) {
- gwwv_post_error(_("Bad Font Name"),_("A Postscript name should be ASCII\nand must not contain (){}[]<>%%/ or space"));
-return( false );
- }
- }
-return( true );
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-void TTF_PSDupsDefault(SplineFont *sf) {
- struct ttflangname *english;
- char versionbuf[40];
-
- /* Ok, if we've just loaded a ttf file then we've got a bunch of langnames*/
- /* we copied some of them (copyright, family, fullname, etc) into equiv */
- /* postscript entries in the sf. If we then use FontInfo and change the */
- /* obvious postscript entries we are left with the old ttf entries. If */
- /* we generate a ttf file and then load it the old values pop up. */
- /* Solution: Anything we can generate by default should be set to NULL */
- for ( english=sf->names; english!=NULL && english->lang!=0x409; english=english->next );
- if ( english==NULL )
-return;
- if ( english->names[ttf_family]!=NULL &&
- strcmp(english->names[ttf_family],sf->familyname)==0 ) {
- free(english->names[ttf_family]);
- english->names[ttf_family]=NULL;
- }
- if ( english->names[ttf_copyright]!=NULL &&
- strcmp(english->names[ttf_copyright],sf->copyright)==0 ) {
- free(english->names[ttf_copyright]);
- english->names[ttf_copyright]=NULL;
- }
- if ( english->names[ttf_fullname]!=NULL &&
- strcmp(english->names[ttf_fullname],sf->fullname)==0 ) {
- free(english->names[ttf_fullname]);
- english->names[ttf_fullname]=NULL;
- }
- if ( sf->subfontcnt!=0 || sf->version!=NULL ) {
- if ( sf->subfontcnt!=0 )
- sprintf( versionbuf, "Version %f", sf->cidversion );
- else
- sprintf(versionbuf,"Version %.20s ", sf->version);
- if ( english->names[ttf_version]!=NULL &&
- strcmp(english->names[ttf_version],versionbuf)==0 ) {
- free(english->names[ttf_version]);
- english->names[ttf_version]=NULL;
- }
- }
- if ( english->names[ttf_subfamily]!=NULL &&
- strcmp(english->names[ttf_subfamily],SFGetModifiers(sf))==0 ) {
- free(english->names[ttf_subfamily]);
- english->names[ttf_subfamily]=NULL;
- }
-
- /* User should not be allowed any access to this one, not ever */
- free(english->names[ttf_postscriptname]);
- english->names[ttf_postscriptname]=NULL;
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int ttfspecials[] = { ttf_copyright, ttf_family, ttf_fullname,
- ttf_subfamily, ttf_version, -1 };
-
-static char *tn_recalculatedef(struct gfi_data *d,int cur_id) {
- char versionbuf[40], *v;
-
- switch ( cur_id ) {
- case ttf_copyright:
-return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Notice)));
- case ttf_family:
-return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Family)));
- case ttf_fullname:
-return( GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Human)));
- case ttf_subfamily:
-return( u2utf8_copy(_uGetModifiers(
- _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)),
- _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Family)),
- _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Weight)))));
- case ttf_version:
- sprintf(versionbuf,_("Version %.20s"),
- v=GGadgetGetTitle8(GWidgetGetControl(d->gw,CID_Version)));
- free(v);
-return( copy(versionbuf));
- default:
-return( NULL );
- }
-}
-
-static char *TN_DefaultName(GGadget *g, int r, int c) {
- struct gfi_data *d = GGadgetGetUserData(g);
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
-
- if ( strings==NULL || !strings[3*r+2].user_bits )
-return( NULL );
-
-return( tn_recalculatedef(d,strings[3*r+1].u.md_ival ));
-}
-
-static const char *langname(int lang,char *buffer) {
- int i;
- for ( i=0; mslanguages[i].text!=NULL; ++i )
- if ( mslanguages[i].userdata == (void *) (intpt) lang )
-return( (char *) mslanguages[i].text );
-
- sprintf( buffer, "%04X", lang );
-return( buffer );
-}
-
-static int strid_sorter(const void *pt1, const void *pt2) {
- const struct matrix_data *n1 = pt1, *n2 = pt2;
- char buf1[20], buf2[20];
- const char *l1, *l2;
-
- if ( n1[1].u.md_ival!=n2[1].u.md_ival )
-return( n1[1].u.md_ival - n2[1].u.md_ival );
-
- l1 = langname(n1[0].u.md_ival,buf1);
- l2 = langname(n2[0].u.md_ival,buf2);
-return( strcoll(l1,l2));
-}
-
-static int lang_sorter(const void *pt1, const void *pt2) {
- const struct matrix_data *n1 = pt1, *n2 = pt2;
- char buf1[20], buf2[20];
- const char *l1, *l2;
-
- if ( n1[0].u.md_ival==n2[0].u.md_ival )
-return( n1[1].u.md_ival - n2[1].u.md_ival );
-
- l1 = langname(n1[0].u.md_ival,buf1);
- l2 = langname(n2[0].u.md_ival,buf2);
-return( strcoll(l1,l2));
-}
-
-static int ms_thislocale = 0;
-static int specialvals(const struct matrix_data *n) {
- if ( n[0].u.md_ival == ms_thislocale )
-return( -10000000 );
- else if ( (n[0].u.md_ival&0x3ff) == (ms_thislocale&0x3ff) )
-return( -10000000 + (n[0].u.md_ival&~0x3ff) );
- if ( n[0].u.md_ival == 0x409 ) /* English */
-return( -1000000 );
- else if ( (n[0].u.md_ival&0x3ff) == 9 )
-return( -1000000 + (n[0].u.md_ival&~0x3ff) );
-
-return( 1 );
-}
-
-static int speciallang_sorter(const void *pt1, const void *pt2) {
- const struct matrix_data *n1 = pt1, *n2 = pt2;
- char buf1[20], buf2[20];
- const char *l1, *l2;
- int pos1=1, pos2=1;
-
- /* sort so that entries for the current language are first, then English */
- /* then alphabetical order */
- if ( n1[0].u.md_ival==n2[0].u.md_ival )
-return( n1[1].u.md_ival - n2[1].u.md_ival );
-
- pos1 = specialvals(n1); pos2 = specialvals(n2);
- if ( pos1<0 || pos2<0 )
-return( pos1-pos2 );
- l1 = langname(n1[0].u.md_ival,buf1);
- l2 = langname(n2[0].u.md_ival,buf2);
-return( strcoll(l1,l2));
-}
-
-static void TTFNames_Resort(struct gfi_data *d) {
- int(*compar)(const void *, const void *);
- GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
- int rows;
- struct matrix_data *strings = GMatrixEditGet(edit, &rows);
-
- if ( strings==NULL )
-return;
-
- if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNLangSort)) )
- compar = lang_sorter;
- else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TNStringSort)) )
- compar = strid_sorter;
- else
- compar = speciallang_sorter;
- ms_thislocale = d->langlocalecode;
- qsort(strings,rows,3*sizeof(struct matrix_data),compar);
-}
-
-static void DefaultLanguage(struct gfi_data *d) {
- const char *lang=NULL;
- int i, langlen;
- static char *envs[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
- char langcountry[8], language[4];
- int langcode, langlocalecode;
-
- for ( i=0; envs[i]!=NULL; ++i ) {
- lang = getenv(envs[i]);
- if ( lang!=NULL ) {
- langlen = strlen(lang);
- if (( langlen>5 && lang[5]=='.' && lang[2]=='_' ) ||
- (langlen==5 && lang[2]=='_' ) ||
- (langlen==2) ||
- (langlen==3)) /* Some obscure languages have a 3 letter code */
- /* I understand this language */
- break;
- }
- }
- if ( lang==NULL )
- lang = "en_US";
- strncpy(langcountry,lang,5); langcountry[5] = '\0';
- strncpy(language,lang,3); language[3] = '\0';
- if ( language[2]=='_' ) language[2] = '\0';
- langlen = strlen(language);
-
- langcode = langlocalecode = -1;
- for ( i=0; ms_2_locals[i].loc_name!=NULL; ++i ) {
- if ( strmatch(langcountry,ms_2_locals[i].loc_name)==0 ) {
- langlocalecode = ms_2_locals[i].local_id;
- langcode = langlocalecode&0x3ff;
- break;
- } else if ( strncmp(language,ms_2_locals[i].loc_name,langlen)==0 )
- langcode = ms_2_locals[i].local_id&0x3ff;
- }
- if ( langcode==-1 ) /* Default to English */
- langcode = 0x9;
- d->langlocalecode = langlocalecode==-1 ? (langcode|0x400) : langlocalecode;
-}
-
-static int GFI_Char(struct gfi_data *d,GEvent *event) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("fontinfo.html");
-return( true );
- } else if ( event->u.chr.keysym=='s' &&
- (event->u.chr.state&ksm_control) &&
- (event->u.chr.state&ksm_meta) ) {
- MenuSaveAll(NULL,NULL,NULL);
-return( true );
- } else if ( event->u.chr.keysym=='q' && (event->u.chr.state&ksm_control)) {
- if ( event->u.chr.state&ksm_shift ) {
- GFI_CancelClose(d);
- } else
- MenuExit(NULL,NULL,NULL);
-return( true );
- }
-return( false );
-}
-
-static int CheckActiveStyleTranslation(struct gfi_data *d,
- struct matrix_data *strings,int r, int rows) {
- int i,j, eng_pos, other_pos;
- char *english, *new=NULL, *temp, *pt;
- int other_lang = strings[3*r].u.md_ival;
- int changed = false;
-
- for ( i=rows-1; i>=0 ; --i )
- if ( strings[3*i+1].u.md_ival==ttf_subfamily &&
- strings[3*i].u.md_ival == 0x409 )
- break;
- if ( i<0 || (english = strings[3*i+2].u.md_str)==NULL )
- new = tn_recalculatedef(d,ttf_subfamily);
- else
- new = copy(english);
- for ( i=0; stylelist[i]!=NULL; ++i ) {
- eng_pos = other_pos = -1;
- for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
- if ( stylelist[i][j].lang == other_lang ) {
- other_pos = j;
- break;
- }
- }
- if ( other_pos==-1 )
- continue;
- for ( j=0; stylelist[i][j].str!=NULL; ++j ) {
- if ( stylelist[i][j].lang == 0x409 &&
- (pt = strstrmatch(new,stylelist[i][j].str))!=NULL ) {
- if ( pt==new && strlen(stylelist[i][j].str)==strlen(new) ) {
- free(new);
- free(strings[3*r+2].u.md_str);
- if ( other_lang==0x415 ) {
- /* polish needs a word before the translation */
- strings[3*r+2].u.md_str = galloc(strlen("odmiana ")+strlen(stylelist[i][other_pos].str)+1);
- strcpy(strings[3*r+2].u.md_str,"odmiana ");
- strcat(strings[3*r+2].u.md_str,stylelist[i][other_pos].str);
- } else
- strings[3*r+2].u.md_str = copy(stylelist[i][other_pos].str);
-return( true );
- }
- temp = galloc((strlen(new)
- + strlen(stylelist[i][other_pos].str)
- - strlen(stylelist[i][j].str)
- +1));
- strncpy(temp,new,pt-new);
- strcpy(temp+(pt-new),stylelist[i][other_pos].str);
- strcat(temp+(pt-new),pt+strlen(stylelist[i][j].str));
- free(new);
- new = temp;
- changed = true;
- continue;
- }
- }
- }
- if ( changed ) {
- free(strings[3*r+2].u.md_str);
- if ( other_lang==0x415 ) {
- /* polish needs a word before the translation */
- strings[3*r+2].u.md_str = galloc(strlen("odmiana ")+strlen(new)+1);
- strcpy(strings[3*r+2].u.md_str,"odmiana ");
- strcat(strings[3*r+2].u.md_str,new);
- free(new);
- } else
- strings[3*r+2].u.md_str = new;
- } else
- free(new);
-return( changed );
-}
-
-#define MID_ToggleBase 1
-#define MID_MultiEdit 2
-#define MID_Delete 3
-
-static void TN_StrPopupDispatch(GWindow gw, GMenuItem *mi, GEvent *e) {
- struct gfi_data *d = GDrawGetUserData(GDrawGetParentWindow(gw));
- GGadget *g = GWidgetGetControl(d->gw,CID_TNames);
-
- switch ( mi->mid ) {
- case MID_ToggleBase: {
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- strings[3*d->tn_active+2].frozen = !strings[3*d->tn_active+2].frozen;
- if ( strings[3*d->tn_active+2].frozen ) {
- free( strings[3*d->tn_active+2].u.md_str );
- strings[3*d->tn_active+2].u.md_str = NULL;
- } else {
- strings[3*d->tn_active+2].u.md_str = tn_recalculatedef(d,strings[3*d->tn_active+1].u.md_ival);
- }
- GGadgetRedraw(g);
- } break;
- case MID_MultiEdit:
- GMatrixEditStringDlg(g,d->tn_active,2);
- break;
- case MID_Delete:
- GMatrixEditDeleteRow(g,d->tn_active);
- break;
- }
-}
-
-static int menusort(const void *m1, const void *m2) {
- const GMenuItem *mi1 = m1, *mi2 = m2;
-
- /* Should do a strcoll here, but I never wrote one */
- if ( mi1->ti.text_is_1byte && mi2->ti.text_is_1byte )
-return( strcoll( (char *) (mi1->ti.text), (char *) (mi2->ti.text)) );
- else
-return( u_strcmp(mi1->ti.text,mi2->ti.text));
-}
-
-static void TN_StrIDEnable(GGadget *g,GMenuItem *mi, int r, int c) {
- int rows, i, j;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
-
- for ( i=0; mi[i].ti.text!=NULL; ++i ) {
- int strid = (intpt) mi[i].ti.userdata;
- for ( j=0; j<rows; ++j ) if ( j!=r )
- if ( strings[3*j].u.md_ival == strings[3*r].u.md_ival &&
- strings[3*j+1].u.md_ival == strid ) {
- mi[i].ti.disabled = true;
- break;
- }
- }
- qsort(mi,i,sizeof(mi[0]),menusort);
-}
-
-static void TN_LangEnable(GGadget *g,GMenuItem *mi, int r, int c) {
- int i;
-
- for ( i=0; mi[i].ti.text!=NULL; ++i )
- qsort(mi,i,sizeof(mi[0]),menusort);
-}
-
-static void TN_NewName(GGadget *g,int row) {
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
-
- strings[3*row+1].u.md_ival = ttf_subfamily;
-}
-
-static void TN_FinishEdit(GGadget *g,int row,int col,int wasnew) {
- int i,rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- uint8 found[ttf_namemax];
- struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
- int ret = false;
-
- if ( col==2 ) {
- if ( strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0' ) {
- GMatrixEditDeleteRow(g,row);
- ret = true;
- }
- } else {
- if ( col==0 ) {
- memset(found,0,sizeof(found));
- found[ttf_idontknow] = true; /* reserved name id */
- for ( i=0; i<rows; ++i ) if ( i!=row ) {
- if ( strings[3*i].u.md_ival == strings[3*row].u.md_ival ) /* Same language */
- found[strings[3*i+1].u.md_ival] = true;
- }
- if ( found[ strings[3*row+1].u.md_ival ] ) {
- /* This language already has an entry for this strid */
- /* pick another */
- if ( !found[ttf_subfamily] ) {
- strings[3*row+1].u.md_ival = ttf_subfamily;
- ret = true;
- } else {
- for ( i=0; i<ttf_namemax; ++i )
- if ( !found[i] ) {
- strings[3*row+1].u.md_ival = i;
- ret = true;
- break;
- }
- }
- }
- }
- if ( (strings[3*row+2].u.md_str==NULL || *strings[3*row+2].u.md_str=='\0') ) {
- for ( i=0; i<rows; ++i ) if ( i!=row ) {
- if ( strings[3*row+1].u.md_ival == strings[3*i+1].u.md_ival &&
- (strings[3*row].u.md_ival&0xff) == (strings[3*i].u.md_ival&0xff)) {
- /* Same string, same language, different locale */
- /* first guess is the same as the other string. */
- if ( strings[3*i+2].u.md_str==NULL )
- strings[3*row+2].u.md_str = tn_recalculatedef(d,strings[3*row+1].u.md_ival );
- else
- strings[3*row+2].u.md_str = copy(strings[3*i+2].u.md_str);
- ret = true;
- break;
- }
- }
- /* If we didn't find anything above, and if we've got a style */
- /* (subfamily) see if we can guess a translation from the english */
- if ( i==rows && strings[3*row+1].u.md_ival == ttf_subfamily )
- ret |= CheckActiveStyleTranslation(d,strings,row,rows);
- }
- }
- if ( ret )
- GGadgetRedraw(g);
-}
-
-static int TN_CanDelete(GGadget *g,int row) {
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- if ( strings==NULL )
-return( false );
-
-return( !strings[3*row+2].user_bits );
-}
-
-static void TN_PopupMenu(GGadget *g,GEvent *event,int r,int c) {
- struct gfi_data *d = (struct gfi_data *) GGadgetGetUserData(g);
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- GMenuItem mi[5];
- int i;
-
- if ( strings==NULL )
-return;
-
- d->tn_active = r;
-
- memset(mi,'\0',sizeof(mi));
- for ( i=0; i<3; ++i ) {
- mi[i].ti.fg = COLOR_DEFAULT;
- mi[i].ti.bg = COLOR_DEFAULT;
- mi[i].mid = i+1;
- mi[i].invoke = TN_StrPopupDispatch;
- mi[i].ti.text_is_1byte = true;
- }
- mi[MID_Delete-1].ti.disabled = strings[3*r+2].user_bits;
- mi[MID_ToggleBase-1].ti.disabled = !strings[3*r+2].user_bits;
- if ( strings[3*r+2].frozen ) {
- mi[MID_MultiEdit-1].ti.disabled = true;
- mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Detach from PostScript Names");
- } else {
- char *temp;
- mi[MID_ToggleBase-1].ti.text = (unichar_t *) _("Same as PostScript Names");
- temp = tn_recalculatedef(d,strings[3*r+1].u.md_ival);
- mi[MID_ToggleBase-1].ti.disabled = (temp==NULL);
- free(temp);
- }
- if ( c!=2 )
- mi[MID_MultiEdit-1].ti.disabled = true;
- mi[MID_MultiEdit-1].ti.text = (unichar_t *) _("Multi-line edit");
- mi[MID_Delete-1].ti.text = (unichar_t *) _("Delete");
- GMenuCreatePopupMenu(event->w,event, mi);
-}
-
-static int TN_PassChar(GGadget *g,GEvent *e) {
-return( GFI_Char(GGadgetGetUserData(g),e));
-}
-
-static char *TN_BigEditTitle(GGadget *g,int r, int c) {
- char buf[100], buf2[20];
- const char *lang;
- int k;
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
-
- lang = langname(strings[3*r].u.md_ival,buf2);
- for ( k=0; ttfnameids[k].text!=NULL && ttfnameids[k].userdata!=(void *) (intpt) strings[3*r+1].u.md_ival;
- ++k );
- snprintf(buf,sizeof(buf),_("%1$.30s string for %2$.30s"),
- lang, (char *) ttfnameids[k].text );
-return( copy( buf ));
-}
-
-static void TNMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
- SplineFont *sf = d->sf;
- int i,j,k,cnt;
- uint8 sawEnglishUS[ttf_namemax];
- struct ttflangname *tln;
- struct matrix_data *md;
-
- DefaultLanguage(d);
-
- memset(mi,0,sizeof(*mi));
- mi->col_cnt = 3;
- mi->col_init = ci;
-
- md = NULL;
- for ( k=0; k<2; ++k ) {
- memset(sawEnglishUS,0,sizeof(sawEnglishUS));
- cnt = 0;
- for ( tln = sf->names; tln!=NULL; tln = tln->next ) {
- for ( i=0; i<ttf_namemax; ++i ) if ( i!=ttf_postscriptname && tln->names[i]!=NULL ) {
- if ( md!=NULL ) {
- md[3*cnt ].u.md_ival = tln->lang;
- md[3*cnt+1].u.md_ival = i;
- md[3*cnt+2].u.md_str = copy(tln->names[i]);
- }
- ++cnt;
- if ( tln->lang==0x409 )
- sawEnglishUS[i] = true;
- }
- }
- for ( i=0; ttfspecials[i]!=-1; ++i ) if ( !sawEnglishUS[ttfspecials[i]] ) {
- if ( md!=NULL ) {
- md[3*cnt ].u.md_ival = 0x409;
- md[3*cnt+1].u.md_ival = ttfspecials[i];
- md[3*cnt+2].u.md_str = NULL;
-/* if frozen is set then can't remove or edit. (old basedon bit) */
- md[3*cnt].frozen = md[3*cnt+1].frozen = md[3*cnt+2].frozen = true;
-/* if user_bits is set then can't remove. (old cantremove bit) */
- md[3*cnt].user_bits = md[3*cnt+1].user_bits = md[3*cnt+2].user_bits = true;
- }
- ++cnt;
- }
- if ( md==NULL )
- md = gcalloc(3*(cnt+10),sizeof(struct matrix_data));
- }
- for ( i=0; i<cnt; ++i ) if ( md[3*cnt].u.md_ival==0x409 ) {
- for ( j=0; ttfspecials[j]!=-1 && ttfspecials[j]!=md[3*cnt+1].u.md_ival; ++j );
- md[3*i].user_bits = md[3*i+1].user_bits = md[3*i+2].user_bits =
- ( ttfspecials[j]!=-1 );
- }
- mi->matrix_data = md;
- mi->initial_row_cnt = cnt;
-
- mi->initrow = TN_NewName;
- mi->finishedit = TN_FinishEdit;
- mi->candelete = TN_CanDelete;
- mi->popupmenu = TN_PopupMenu;
- mi->handle_key = TN_PassChar;
- mi->bigedittitle = TN_BigEditTitle;
-}
-
-static int GFI_HelpOFL(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- help("http://scripts.sil.org/OFL");
- }
-return( true );
-}
-
-static int GFI_AddOFL(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- GGadget *tng = GWidgetGetControl(GGadgetGetWindow(g),CID_TNames);
- int rows;
- struct matrix_data *tns, *newtns;
- int i,j,k,l,m, extras, len;
- char *all, *pt, **data;
- char buffer[1024], *bpt;
- const char *author = GetAuthor();
- char *reservedname, *fallback;
- time_t now;
- struct tm *tm;
-
- time(&now);
- tm = localtime(&now);
-
- tns = GMatrixEditGet(tng, &rows); newtns = NULL;
- for ( k=0; k<2; ++k ) {
- extras = 0;
- for ( i=0; ofl_str_lang_data[i].data!=NULL; ++i ) {
- for ( j=rows-1; j>=0; --j ) {
- if ( tns[j*3+1].u.md_ival==ofl_str_lang_data[i].strid &&
- tns[j*3+0].u.md_ival==ofl_str_lang_data[i].lang ) {
- if ( k ) {
- free(newtns[j*3+2].u.md_str);
- newtns[j*3+2].u.md_str = NULL;
- }
- break;
- }
- }
- if ( j<0 )
- j = rows + extras++;
- if ( k ) {
- newtns[j*3+1].u.md_ival = ofl_str_lang_data[i].strid;
- newtns[j*3+0].u.md_ival = ofl_str_lang_data[i].lang;
- data = ofl_str_lang_data[i].data;
- reservedname = fallback = NULL;
- for ( m=0; m<rows; ++m ) {
- if ( newtns[j*3+1].u.md_ival==ttf_family ) {
- if ( newtns[j*3+0].u.md_ival==0x409 )
- fallback = newtns[3*j+2].u.md_str;
- else if ( newtns[j*3+0].u.md_ival==ofl_str_lang_data[i].lang )
- reservedname = newtns[3*j+2].u.md_str;
- }
- }
- if ( reservedname==NULL )
- reservedname = fallback;
- if ( reservedname==NULL )
- reservedname = d->sf->familyname;
- for ( m=0; m<2; ++m ) {
- len = 0;
- for ( l=0; data[l]!=NULL; ++l ) {
- if ( l==0 || l==1 ) {
- sprintf( buffer, data[l], tm->tm_year+1900, author, reservedname );
- bpt = buffer;
- } else
- bpt = data[l];
- if ( m ) {
- strcpy( pt, bpt );
- pt += strlen( bpt );
- *pt++ = '\n';
- } else
- len += strlen( bpt ) + 1; /* for a new line */
- }
- if ( !m )
- newtns[j*3+2].u.md_str = all = pt = galloc(len+2);
- }
- if ( pt>all ) pt[-1] = '\0';
- else *pt = '\0';
- }
- }
- if ( !k ) {
- newtns = gcalloc((rows+extras)*3,sizeof(struct matrix_data));
- memcpy(newtns,tns,rows*3*sizeof(struct matrix_data));
- for ( i=0; i<rows; ++i )
- newtns[3*i+2].u.md_str = copy(newtns[3*i+2].u.md_str);
- }
- }
- GMatrixEditSet(tng, newtns, rows+extras, false);
- gwwv_post_notice(_("Please read the OFL"),_(
- "You should read the OFL and its FAQ \n"
- "at http://scripts.sil.org/OFL."
- "\n"
- "If you are not very familiar with English,\n"
- "please check if there is a translation of the \n"
- "FAQ or an unofficial translation of the license \n"
- "in your mother tongue or preferred language. \n"
- "\n"
- "Fontforge does not know about your email or URL,\n"
- "you will need to add them manually. \n"
- "Please fill in the copyright notice in the license\n"
- "header along with any Reserved Font Name(s).\n"
- "If you are branching from an existing font make sure\n"
- "you have the right to do so and remember to add your\n"
- "additional copyright notice along with any Reserved Font Name(s).\n" ));
- }
-return( true );
-}
-
-static int Gasp_Default(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- GGadget *gg = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
- int rows;
- struct matrix_data *gasp;
-
- if ( !SFHasInstructions(d->sf)) {
- rows = 1;
- gasp = gcalloc(5,sizeof(struct matrix_data));
- gasp[0].u.md_ival = 65535;
- gasp[1].u.md_ival = 0; /* no grid fit (we have no instructions, we can't grid fit) */
- gasp[2].u.md_ival = 1; /* do anti-alias */
- gasp[2].u.md_ival = 0; /* do symmetric smoothing */
- gasp[2].u.md_ival = 0; /* do no grid fit w/ sym smooth */
- } else {
- rows = 3;
- gasp = gcalloc(5,sizeof(struct matrix_data));
- gasp[0].u.md_ival = 8; gasp[1].u.md_ival = 0; gasp[2].u.md_ival = 1;
- gasp[3].u.md_ival = 0; gasp[4].u.md_ival = 0;
- gasp[5].u.md_ival = 16; gasp[6].u.md_ival = 1; gasp[7].u.md_ival = 0;
- gasp[8].u.md_ival = 0; gasp[9].u.md_ival = 0;
- gasp[10].u.md_ival = 65535; gasp[11].u.md_ival = 1; gasp[12].u.md_ival = 1;
- gasp[13].u.md_ival = 0; gasp[14].u.md_ival = 0;
- }
- GMatrixEditSet(gg,gasp,rows,false);
- }
-return( true );
-}
-
-static int Gasp_CanDelete(GGadget *g,int row) {
- int rows;
- struct matrix_data *gasp = GMatrixEditGet(g, &rows);
- if ( gasp==NULL )
-return( false );
-
- /* Only allow them to delete the sentinal entry if that would give us an */
- /* empty gasp table */
-return( gasp[5*row].u.md_ival!=0xffff || rows==1 );
-}
-
-static int gasp_comp(const void *_md1, const void *_md2) {
- const struct matrix_data *md1 = _md1, *md2 = _md2;
-return( md1->u.md_ival - md2->u.md_ival );
-}
-
-static void Gasp_FinishEdit(GGadget *g,int row,int col,int wasnew) {
- int rows;
- struct matrix_data *gasp = GMatrixEditGet(g, &rows);
-
- if ( col==0 ) {
- qsort(gasp,rows,3*sizeof(struct matrix_data),gasp_comp);
- GGadgetRedraw(g);
- }
-}
-
-static void GaspMatrixInit(struct matrixinit *mi,struct gfi_data *d) {
- SplineFont *sf = d->sf;
- int i;
- struct matrix_data *md;
-
- memset(mi,0,sizeof(*mi));
- mi->col_cnt = 5;
- mi->col_init = gaspci;
-
- if ( sf->gasp_cnt==0 ) {
- md = gcalloc(5,sizeof(struct matrix_data));
- mi->initial_row_cnt = 0;
- } else {
- md = gcalloc(5*sf->gasp_cnt,sizeof(struct matrix_data));
- for ( i=0; i<sf->gasp_cnt; ++i ) {
- md[5*i ].u.md_ival = sf->gasp[i].ppem;
- md[5*i+1].u.md_ival = (sf->gasp[i].flags&1)?1:0;
- md[5*i+2].u.md_ival = (sf->gasp[i].flags&2)?1:0;
- md[5*i+3].u.md_ival = (sf->gasp[i].flags&4)?1:0;
- md[5*i+4].u.md_ival = (sf->gasp[i].flags&8)?1:0;
- }
- mi->initial_row_cnt = sf->gasp_cnt;
- }
- mi->matrix_data = md;
-
- mi->finishedit = Gasp_FinishEdit;
- mi->candelete = Gasp_CanDelete;
- mi->handle_key = TN_PassChar;
-}
-
-static int GFI_GaspVersion(GGadget *g, GEvent *e) {
- if ( e->u.control.subtype == et_listselected ) {
- int version = GGadgetGetFirstListSelectedItem(g);
- GGadget *gasp = GWidgetGetControl(GGadgetGetWindow(g),CID_Gasp);
- if ( version == 0 ) {
- GMatrixEditEnableColumn(gasp,3,false);
- GMatrixEditEnableColumn(gasp,4,false);
- } else {
- GMatrixEditEnableColumn(gasp,3,true);
- GMatrixEditEnableColumn(gasp,4,true);
- }
- GGadgetRedraw(gasp);
- }
-return( true );
-}
-
-static int GFI_SortBy(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *d = (struct gfi_data *) GDrawGetUserData(GGadgetGetWindow(g));
- TTFNames_Resort(d);
- GGadgetRedraw(GWidgetGetControl(d->gw,CID_TNames));
- }
-return( true );
-}
-
-static void BDFsSetAsDs(SplineFont *sf) {
- BDFFont *bdf;
- real scale;
-
- for ( bdf=sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- scale = bdf->pixelsize / (real) (sf->ascent+sf->descent);
- bdf->ascent = rint(sf->ascent*scale);
- bdf->descent = bdf->pixelsize-bdf->ascent;
- }
-}
-
-static char *texparams[] = { N_("Slant:"), N_("Space:"), N_("Stretch:"),
- N_("Shrink:"), N_("XHeight:"), N_("Quad:"),
-/* GT: Extra Space, see below for a full comment */
- N_("Extra Sp:"), NULL };
-static char *texpopups[] = { N_("In an italic font the horizontal change per unit vertical change"),
- N_("The amount of space between words when using this font"),
- N_("The amount of strechable space between words when using this font"),
- N_("The amount the space between words may shrink when using this font"),
- N_("The height of the lower case letters with flat tops"),
- N_("The width of one em"),
- N_("Either:\nThe amount of extra space to be added after a sentence\nOr the space to be used within math formulae"),
- NULL};
-
-static int ParseTeX(struct gfi_data *d) {
- int i, err=false;
- double em = (d->sf->ascent+d->sf->descent), val;
-
- for ( i=0; texparams[i]!=0 ; ++i ) {
- val = GetReal8(d->gw,CID_TeX+i,texparams[i],&err);
- d->texdata.params[i] = rint( val/em * (1<<20) );
- }
- if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
- d->texdata.type = tex_text;
- else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
- d->texdata.type = tex_math;
- else
- d->texdata.type = tex_mathext;
-return( !err );
-}
-
-static int ttfmultuniqueids(SplineFont *sf,struct gfi_data *d) {
- struct ttflangname *tln;
- int found = false;
- int i;
-
- if ( d->names_set ) {
- GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
- int rows;
- struct matrix_data *strings = GMatrixEditGet(edit, &rows);
- for ( i=0; i<rows; ++i )
- if ( strings[3*i+1].u.md_ival==ttf_uniqueid ) {
- if ( found )
-return( true );
- found = true;
- }
- } else {
- for ( tln = sf->names; tln!=NULL; tln=tln->next )
- if ( tln->names[ttf_uniqueid]!=NULL ) {
- if ( found )
-return( true );
- found = true;
- }
- }
-return( false );
-}
-
-static int ttfuniqueidmatch(SplineFont *sf,struct gfi_data *d) {
- struct ttflangname *tln;
- int i;
-
- if ( sf->names==NULL )
-return( false );
-
- if ( !d->names_set ) {
- for ( tln = sf->names; tln!=NULL; tln=tln->next )
- if ( tln->names[ttf_uniqueid]!=NULL )
-return( true );
- } else {
- GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
- int rows;
- struct matrix_data *strings = GMatrixEditGet(edit, &rows);
-
- for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
- if ( tln->names[ttf_uniqueid]==NULL )
- continue; /* Not set, so if it has been given a new value */
- /* that's a change, and if it hasn't that's ok */
- for ( i=0; i<rows; ++i )
- if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
- break;
- if ( i==rows )
- continue; /* removed. That's a change */
- if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )==0 )
-return( true ); /* name unchanged */
- }
- }
-return( false );
-}
-
-static void ttfuniqueidfixup(SplineFont *sf,struct gfi_data *d) {
- struct ttflangname *tln;
- char *changed = NULL;
- int i;
-
- if ( sf->names==NULL )
-return;
-
- if ( !d->names_set ) {
- for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
- free( tln->names[ttf_uniqueid]);
- tln->names[ttf_uniqueid] = NULL;
- }
- } else {
- GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
- int rows;
- struct matrix_data *strings = GMatrixEditGet(edit, &rows);
-
- /* see if any instances of the name have changed */
- for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
- if ( tln->names[ttf_uniqueid]==NULL )
- continue;
- for ( i=0; i<rows; ++i )
- if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
- break;
- if ( i==rows )
- continue;
- if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str )!=0 )
- changed = copy(strings[3*i+2].u.md_str );
- break;
- }
- /* All unique ids should be the same, if any changed set the unchanged */
- /* ones to the one that did (or the first of many if several changed) */
- for ( tln = sf->names; tln!=NULL; tln=tln->next ) {
- if ( tln->names[ttf_uniqueid]==NULL )
- continue;
- for ( i=0; i<rows; ++i )
- if ( strings[3*i+1].u.md_ival==ttf_uniqueid && strings[3*i].u.md_ival==tln->lang )
- break;
- if ( i==rows )
- continue;
- if ( strcmp(tln->names[ttf_uniqueid],strings[3*i+2].u.md_str)==0 ) {
- free(strings[3*i+2].u.md_str);
- strings[3*i+2].u.md_str = changed!=NULL
- ? copy( changed )
- : NULL;
- }
- }
- }
-}
-
-static void StoreTTFNames(struct gfi_data *d) {
- struct ttflangname *tln;
- SplineFont *sf = d->sf;
- int i;
- GGadget *edit = GWidgetGetControl(d->gw,CID_TNames);
- int rows;
- struct matrix_data *strings = GMatrixEditGet(edit, &rows);
-
- TTFLangNamesFree(sf->names); sf->names = NULL;
-
- for ( i=0; i<rows; ++i ) {
- for ( tln=sf->names; tln!=NULL && tln->lang!=strings[3*i].u.md_ival; tln=tln->next );
- if ( tln==NULL ) {
- tln = chunkalloc(sizeof(struct ttflangname));
- tln->lang = strings[3*i].u.md_ival;
- tln->next = sf->names;
- sf->names = tln;
- }
- tln->names[strings[3*i+1].u.md_ival] = copy(strings[3*i+2].u.md_str );
- }
- TTF_PSDupsDefault(sf);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-/* If we change the ascent/descent of a sub font then consider changing the */
-/* as/ds of the master font. I used to think this irrelevant, but as the */
-/* typoAscent/Descent is based on the master's ascent/descent it actually */
-/* is meaningful. Set the master to the subfont with the most glyphs */
-void CIDMasterAsDes(SplineFont *sf) {
- SplineFont *cidmaster = sf->cidmaster;
- SplineFont *best;
- int i, cid, cnt, bcnt;
-
- if ( cidmaster==NULL )
-return;
- best = NULL; bcnt = 0;
- for ( i=0; i<cidmaster->subfontcnt; ++i ) {
- sf = cidmaster->subfonts[i];
- for ( cid=cnt=0; cid<sf->glyphcnt; ++cid )
- if ( sf->glyphs[cid]!=NULL )
- ++cnt;
- if ( cnt>bcnt ) {
- best = sf;
- bcnt = cnt;
- }
- }
- if ( best==NULL && cidmaster->subfontcnt>0 )
- best = cidmaster->subfonts[0];
- if ( best!=NULL ) {
- double ratio = 1000.0/(best->ascent+best->descent);
- int ascent = rint(best->ascent*ratio);
- if ( cidmaster->ascent!=ascent || cidmaster->descent!=1000-ascent ) {
- cidmaster->ascent = ascent;
- cidmaster->descent = 1000-ascent;
- }
- }
-}
-
-void SFSetModTime(SplineFont *sf) {
- time_t now;
- time(&now);
- sf->modificationtime = now;
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void GFI_ApplyLookupChanges(struct gfi_data *gfi) {
- int i,j, isgpos;
- OTLookup *last;
- SplineFont *sf = gfi->sf;
- struct lookup_subtable *sublast;
-
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- struct lkdata *lk = &gfi->tables[isgpos];
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- SFRemoveLookup(gfi->sf,lk->all[i].lookup);
- else for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable);
- }
- }
- last = NULL;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( !lk->all[i].deleted ) {
- if ( last!=NULL )
- last->next = lk->all[i].lookup;
- else if ( isgpos )
- sf->gpos_lookups = lk->all[i].lookup;
- else
- sf->gsub_lookups = lk->all[i].lookup;
- last = lk->all[i].lookup;
- sublast = NULL;
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( !lk->all[i].subtables[j].deleted ) {
- if ( sublast!=NULL )
- sublast->next = lk->all[i].subtables[j].subtable;
- else
- last->subtables = lk->all[i].subtables[j].subtable;
- sublast = lk->all[i].subtables[j].subtable;
- }
- }
- if ( sublast!=NULL )
- sublast->next = NULL;
- else
- last->subtables = NULL;
- }
- free(lk->all[i].subtables);
- }
- if ( last!=NULL )
- last->next = NULL;
- else if ( isgpos )
- sf->gpos_lookups = NULL;
- else
- sf->gsub_lookups = NULL;
- free(lk->all);
- }
-}
-
-static int GFI_OK(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- struct gfi_data *d = GDrawGetUserData(gw);
- SplineFont *sf = d->sf, *_sf;
- int interp;
- int reformat_fv=0, retitle_fv=false;
- int upos, uwid, as, des, err = false, weight=0;
- int uniqueid, linegap=0, vlinegap=0, winascent=0, windescent=0;
- int tlinegap=0, tascent=0, tdescent=0, hascent=0, hdescent=0;
- int winaoff=true, windoff=true;
- int taoff=true, tdoff=true, haoff = true, hdoff = true;
- real ia, cidversion;
- const unichar_t *txt, *fond; unichar_t *end;
- int i,j, mcs;
- int vmetrics, vorigin, namechange, order2;
- int xuidchanged = false;
- GTextInfo *pfmfam, *ibmfam, *fstype, *nlitem;
- int32 len;
- GTextInfo **ti;
- int subs[4], super[4], strike[2];
- int design_size, size_top, size_bottom, styleid;
- int strokedfont = false;
- real strokewidth;
-#ifdef FONTFORGE_CONFIG_TYPE3
- int multilayer = false;
-#endif
- char os2_vendor[4];
- NameList *nl;
- extern int allow_utf8_glyphnames;
- int os2version;
- int rows, gasprows;
- struct matrix_data *strings = GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
- struct matrix_data *gasp = GMatrixEditGet(GWidgetGetControl(d->gw,CID_Gasp), &gasprows);
-
- if ( strings==NULL || gasp==NULL )
-return( true );
- if ( gasprows>0 && gasp[5*gasprows-5].u.md_ival!=65535 ) {
- gwwv_post_error(_("Bad Grid Fiting table"),_("The 'gasp' (Grid Fit) table must end with a pixel entry of 65535"));
-return( true );
- }
- if ( !CheckNames(d))
-return( true );
- if ( !PIFinishFormer(d))
-return( true );
- if ( d->ccd )
- CCD_Close(d->ccd);
- if ( d->smd )
- SMD_Close(d->smd);
-
- if ( ttfmultuniqueids(sf,d)) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2]=NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
-#endif
- if ( gwwv_ask(_("Too many Unique Font IDs"),(const char **) buts,0,1,_("You should only specify the TrueType Unique Font Identification string in one language. This font has more. Do you want to continue anyway?"))==1 )
-return( true );
- }
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Family));
- if ( !isalpha(*txt)) {
- BadFamily();
-return( true );
- }
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_ItalicAngle));
- ia = u_strtod(txt,&end);
- if ( *end!='\0' ) {
- Protest8(_("_Italic Angle:"));
-return(true);
- }
- order2 = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsOrder2));
- strokedfont = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsStrokedFont));
- strokewidth = GetReal8(gw,CID_StrokeWidth,_("Stroke _Width:"),&err);
-#ifdef FONTFORGE_CONFIG_TYPE3
- multilayer = GGadgetIsChecked(GWidgetGetControl(gw,CID_IsMultiLayer));
-#endif
- vmetrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_HasVerticalMetrics));
- upos = GetReal8(gw,CID_UPos, _("Underline _Position:"),&err);
- uwid = GetReal8(gw,CID_UWidth,S_("Underline|_Height:"),&err);
- GetInt8(gw,CID_Em,_("_Em Size:"),&err); /* just check for errors. redundant info */
- as = GetInt8(gw,CID_Ascent,_("_Ascent:"),&err);
- des = GetInt8(gw,CID_Descent,_("_Descent:"),&err);
- uniqueid = GetInt8(gw,CID_UniqueID,_("UniqueID"),&err);
- design_size = rint(10*GetReal8(gw,CID_DesignSize,_("De_sign Size:"),&err));
- size_bottom = rint(10*GetReal8(gw,CID_DesignBottom,_("_Bottom"),&err));
- size_top = rint(10*GetReal8(gw,CID_DesignTop,_("_Top"),&err));
- styleid = GetInt8(gw,CID_StyleID,_("Style _ID:"),&err);
- if ( err )
-return(true);
- if ( sf->subfontcnt!=0 ) {
- cidversion = GetReal8(gw,CID_Version,_("_Version"),&err);
- if ( err )
-return(true);
- }
- if ( vmetrics )
- vorigin = GetInt8(gw,CID_VOrigin,_("Vertical _Origin:"),&err);
- os2version = sf->os2_version;
- if ( d->ttf_set ) {
- char *os2v = GGadgetGetTitle8(GWidgetGetControl(gw,CID_OS2Version));
- if ( strcasecmp(os2v,_( (char *) os2versions[0].text ))== 0 )
- os2version = 0;
- else
- os2version = GetInt8(gw,CID_OS2Version,_("Weight, Width, Slope Only"),&err);
- free(os2v);
- /* Only use the normal routine if we get no value, because */
- /* "400 Book" is a reasonable setting, but would cause GetInt */
- /* to complain */
- weight = u_strtol(_GGadgetGetTitle(GWidgetGetControl(gw,CID_WeightClass)),NULL,10);
- if ( weight == 0 )
- weight = GetInt8(gw,CID_WeightClass,_("_Weight Class"),&err);
- linegap = GetInt8(gw,CID_LineGap,_("HHead _Line Gap:"),&err);
- tlinegap = GetInt8(gw,CID_TypoLineGap,_("Typo Line _Gap:"),&err);
- if ( vmetrics )
- vlinegap = GetInt8(gw,CID_VLineGap,_("VHead _Column Spacing:"),&err);
- winaoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinAscentIsOff));
- windoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_WinDescentIsOff));
- winascent = GetInt8(gw,CID_WinAscent,winaoff ? _("Win _Ascent Offset:") : _("Win Ascent:"),&err);
- windescent = GetInt8(gw,CID_WinDescent,windoff ? _("Win _Descent Offset:") : _("Win Descent:"),&err);
- taoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoAscentIsOff));
- tdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_TypoDescentIsOff));
- tascent = GetInt8(gw,CID_TypoAscent,taoff ? _("_Typo Ascent Offset:") : _("Typo Ascent:"),&err);
- tdescent = GetInt8(gw,CID_TypoDescent,tdoff ? _("T_ypo Descent Offset:") : _("Typo Descent:"),&err);
- haoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadAscentIsOff));
- hdoff = GGadgetIsChecked(GWidgetGetControl(gw,CID_HHeadDescentIsOff));
- hascent = GetInt8(gw,CID_HHeadAscent,haoff ? _("_HHead Ascent Offset:") : _("HHead Ascent:"),&err);
- hdescent = GetInt8(gw,CID_HHeadDescent,hdoff ? _("HHead De_scent Offset:") : _("HHead Descent:"),&err);
- if ( err )
-return(true);
-
- if ( !GGadgetIsChecked(GWidgetGetControl(gw,CID_SubSuperDefault)) ) {
- for ( i=0; i<4; ++i )
- subs[i] = GetInt8(gw,CID_SubXSize+i,_("Subscript"),&err);
- for ( i=0; i<4; ++i )
- super[i] = GetInt8(gw,CID_SuperXSize+i,_("Superscript"),&err);
- for ( i=0; i<2; ++i )
- strike[i] = GetInt8(gw,CID_StrikeoutSize+i,_("Strikeout"),&err);
- }
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Vendor));
- if ( u_strlen(txt)>4 || txt[0]>0x7e || (txt[0]!='\0' && (txt[1]>0x7e ||
- (txt[1]!='\0' && (txt[2]>0x7e || (txt[2]!='\0' && txt[3]>0x7e))))) ) {
- if ( u_strlen(txt)>4 )
- gwwv_post_error(_("Bad IBM Family"),_("Tag must be 4 characters long"));
- else
- gwwv_post_error(_("Bad IBM Family"),_("A tag must be 4 ASCII characters"));
-return( true );
- }
- os2_vendor[0] = txt[0]==0 ? ' ' : txt[0];
- os2_vendor[1] = txt[0]==0 || txt[1]=='\0' ? ' ' : txt[1];
- os2_vendor[2] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' ? ' ' : txt[2];
- os2_vendor[3] = txt[0]==0 || txt[1]=='\0' || txt[2]=='\0' || txt[3]=='\0' ? ' ' : txt[3];
- }
- if ( err )
-return(true);
- if ( d->tex_set ) {
- if ( !ParseTeX(d))
-return( true );
- }
- if ( as+des>16384 || des<0 || as<0 ) {
- gwwv_post_error(_("Bad Ascent/Descent"),_("Ascent and Descent must be positive and their sum less than 16384"));
-return( true );
- }
- mcs = -1;
- if ( !GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic)) ) {
- mcs = 0;
- ti = GGadgetGetList(GWidgetGetControl(d->gw,CID_MacStyles),&len);
- for ( i=0; i<len; ++i )
- if ( ti[i]->selected )
- mcs |= (int) (intpt) ti[i]->userdata;
- if ( (mcs&sf_condense) && (mcs&sf_extend)) {
- gwwv_post_error(_("Bad Style"),_("A style may not have both condense and extend set (it makes no sense)"));
-return( true );
- }
- }
- if ( order2!=sf->order2 && sf->changed && AskLoseUndoes())
-return( true );
- if ( order2!=sf->order2 && !SFCloseAllInstrs(sf))
-return( true );
-
- nlitem = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_Namelist));
- if ( nlitem==NULL )
- nl = DefaultNameListForNewFonts();
- else {
- char *name = u2utf8_copy(nlitem->text);
- nl = NameListByName(name);
- free(name);
- }
- if ( nl->uses_unicode && !allow_utf8_glyphnames ) {
- gwwv_post_error(_("Namelist contains non-ASCII names"),_("Glyph names should be limited to characters in the ASCII character set,\nbut there are names in this namelist which use characters outside\nthat range."));
-return(true);
- }
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( strokedfont!=sf->strokedfont || multilayer!=sf->multilayer ) {
- if ( sf->strokedfont && multilayer )
- SFSetLayerWidthsStroked(sf,sf->strokewidth);
- else if ( sf->multilayer )
- SFSplinesFromLayers(sf,strokedfont);
- SFReinstanciateRefs(sf);
- if ( multilayer!=sf->multilayer ) {
- sf->multilayer = multilayer;
- SFLayerChange(sf);
- }
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->changedsincelasthinted = !strokedfont && !multilayer;
- }
-#else
- if ( strokedfont!=sf->strokedfont )
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->changedsincelasthinted = !strokedfont;
-#endif
- sf->strokedfont = strokedfont;
- sf->strokewidth = strokewidth;
- GDrawSetCursor(gw,ct_watch);
- namechange = SetFontName(gw,sf);
- if ( namechange ) retitle_fv = true;
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_XUID));
- xuidchanged = (sf->xuid==NULL && *txt!='\0') ||
- (sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0);
- if ( namechange &&
- ((uniqueid!=0 && uniqueid==sf->uniqueid) ||
- (sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0) ||
- ttfuniqueidmatch(sf,d)) ) {
- char *buts[4];
- int ans;
- buts[0] = _("Change");
- buts[1] = _("Retain");
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[2] = _("_Cancel");
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[2] = GTK_STOCK_CANCEL;
-#endif
- buts[3] = NULL;
- ans = gwwv_ask(_("Change UniqueID?"),(const char **) buts,0,2,_("You have changed this font's name without changing the UniqueID (or XUID).\nThis is probably not a good idea, would you like me to\ngenerate a random new value?"));
- if ( ans==2 ) {
- GDrawSetCursor(gw,ct_pointer);
-return(true);
- }
- if ( ans==0 ) {
- if ( uniqueid!=0 && uniqueid==sf->uniqueid )
- uniqueid = 4000000 + (rand()&0x3ffff);
- if ( sf->xuid!=NULL && uc_strcmp(txt,sf->xuid)==0 ) {
- SFRandomChangeXUID(sf);
- xuidchanged = true;
- }
- }
- if ( ttfuniqueidmatch(sf,d))
- ttfuniqueidfixup(sf,d);
- } else {
- free(sf->xuid);
- sf->xuid = *txt=='\0'?NULL:cu_copy(txt);
- }
-
- free(sf->gasp);
- sf->gasp_cnt = gasprows;
- if ( gasprows==0 )
- sf->gasp = NULL;
- else {
- sf->gasp = galloc(gasprows*sizeof(struct gasp));
- sf->gasp_version = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_GaspVersion));
- for ( i=0; i<gasprows; ++i ) {
- sf->gasp[i].ppem = gasp[5*i].u.md_ival;
- if ( sf->gasp_version==0 )
- sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
- (gasp[5*i+2].u.md_ival<<1);
- else
- sf->gasp[i].flags = gasp[5*i+1].u.md_ival |
- (gasp[5*i+2].u.md_ival<<1) |
- (gasp[5*i+2].u.md_ival<<2) |
- (gasp[5*i+2].u.md_ival<<3);
- }
- }
- sf->head_optimized_for_cleartype = GGadgetIsChecked(GWidgetGetControl(gw,CID_HeadClearType));
-
- OtfNameListFree(sf->fontstyle_name);
- sf->fontstyle_name = OtfNameFromStyleNames(GWidgetGetControl(gw,CID_StyleName));
- sf->design_size = design_size;
- sf->design_range_bottom = size_bottom;
- sf->design_range_top = size_top;
- sf->fontstyle_id = styleid;
-
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Notice));
- free(sf->copyright); sf->copyright = cu_copy(txt);
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Comment));
- free(sf->comments); sf->comments = cu_copy(*txt?txt:NULL);
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_DefBaseName));
- if ( *txt=='\0' || GGadgetIsChecked(GWidgetGetControl(gw,CID_SameAsFontname)) )
- txt = NULL;
- free(sf->defbasefilename); sf->defbasefilename = u2utf8_copy(txt);
- if ( sf->subfontcnt!=0 ) {
- sf->cidversion = cidversion;
- } else {
- txt = _GGadgetGetTitle(GWidgetGetControl(gw,CID_Version));
- free(sf->version); sf->version = cu_copy(txt);
- }
- fond = _GGadgetGetTitle(GWidgetGetControl(gw,CID_MacFOND));
- free(sf->fondname); sf->fondname = NULL;
- if ( *fond )
- sf->fondname = cu_copy(fond);
- sf->macstyle = mcs;
- sf->italicangle = ia;
- sf->upos = upos;
- sf->uwidth = uwid;
- sf->uniqueid = uniqueid;
- sf->texdata = d->texdata;
-
- interp = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_Interpretation));
- if ( interp==-1 ) sf->uni_interp = ui_none;
- else sf->uni_interp = (intpt) interpretations[interp].userdata;
-
- sf->for_new_glyphs = nl;
-
- if ( sf->hasvmetrics!=vmetrics )
- CVPaletteDeactivate(); /* Force a refresh later */
- _sf = sf->cidmaster?sf->cidmaster:sf;
- _sf->hasvmetrics = vmetrics;
- for ( j=0; j<_sf->subfontcnt; ++j )
- _sf->subfonts[j]->hasvmetrics = vmetrics;
- if ( vmetrics ) {
- _sf->vertical_origin = vorigin;
- for ( j=0; j<_sf->subfontcnt; ++j )
- _sf->subfonts[j]->vertical_origin = vorigin;
- }
-
- if ( d->private!=NULL ) {
- PSDictFree(sf->private);
- sf->private = d->private;
- d->private = NULL;
- }
- if ( d->names_set )
- StoreTTFNames(d);
- if ( d->ttf_set ) {
- sf->os2_version = os2version;
- sf->use_typo_metrics = GGadgetIsChecked(GWidgetGetControl(gw,CID_UseTypoMetrics));
- sf->weight_width_slope_only = GGadgetIsChecked(GWidgetGetControl(gw,CID_WeightWidthSlopeOnly));
- sf->pfminfo.weight = weight;
- sf->pfminfo.width = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_WidthClass))+1;
- pfmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PFMFamily));
- if ( pfmfam!=NULL )
- sf->pfminfo.pfmfamily = (intpt) (pfmfam->userdata);
- else
- sf->pfminfo.pfmfamily = 0x11;
- ibmfam = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_IBMFamily));
- if ( pfmfam!=NULL )
- sf->pfminfo.os2_family_class = (intpt) (ibmfam->userdata);
- else
- sf->pfminfo.os2_family_class = 0x00;
- memcpy(sf->pfminfo.os2_vendor,os2_vendor,sizeof(os2_vendor));
- fstype = GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_FSType));
- if ( fstype!=NULL )
- sf->pfminfo.fstype = (intpt) (fstype->userdata);
- else
- sf->pfminfo.fstype = 0xc;
- if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_NoSubsetting)))
- sf->pfminfo.fstype |=0x100;
- if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_OnlyBitmaps)))
- sf->pfminfo.fstype |=0x200;
- for ( i=0; i<10; ++i )
- sf->pfminfo.panose[i] = (intpt) (GGadgetGetListItemSelected(GWidgetGetControl(gw,CID_PanFamily+i))->userdata);
- sf->pfminfo.panose_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_PanDefault));
- sf->pfminfo.os2_typolinegap = tlinegap;
- sf->pfminfo.linegap = linegap;
- if ( vmetrics )
- sf->pfminfo.vlinegap = vlinegap;
- sf->pfminfo.os2_winascent = winascent;
- sf->pfminfo.os2_windescent = windescent;
- sf->pfminfo.winascent_add = winaoff;
- sf->pfminfo.windescent_add = windoff;
- sf->pfminfo.os2_typoascent = tascent;
- sf->pfminfo.os2_typodescent = tdescent;
- sf->pfminfo.typoascent_add = taoff;
- sf->pfminfo.typodescent_add = tdoff;
- sf->pfminfo.hhead_ascent = hascent;
- sf->pfminfo.hhead_descent = hdescent;
- sf->pfminfo.hheadascent_add = haoff;
- sf->pfminfo.hheaddescent_add = hdoff;
- sf->pfminfo.pfmset = true;
-
- sf->pfminfo.subsuper_set = !GGadgetIsChecked(GWidgetGetControl(gw,CID_PanDefault));
- if ( sf->pfminfo.subsuper_set ) {
- sf->pfminfo.os2_subxsize = subs[0];
- sf->pfminfo.os2_subysize = subs[1];
- sf->pfminfo.os2_subxoff = subs[2];
- sf->pfminfo.os2_subyoff = subs[3];
- sf->pfminfo.os2_supxsize = super[0];
- sf->pfminfo.os2_supysize = super[1];
- sf->pfminfo.os2_supxoff = super[2];
- sf->pfminfo.os2_supyoff = super[3];
- sf->pfminfo.os2_strikeysize = strike[0];
- sf->pfminfo.os2_strikeypos = strike[1];
- }
- }
- /* must come after all scaleable fields (linegap, etc.) */
- if ( as!=sf->ascent || des!=sf->descent ) {
- if ( as+des != sf->ascent+sf->descent && GGadgetIsChecked(GWidgetGetControl(gw,CID_Scale)) )
- SFScaleToEm(sf,as,des);
- else {
- sf->ascent = as;
- sf->descent = des;
- }
- BDFsSetAsDs(sf);
- reformat_fv = true;
- CIDMasterAsDes(sf);
- }
- if ( order2!=sf->order2 ) {
- if ( order2 )
- SFConvertToOrder2(sf);
- else
- SFConvertToOrder3(sf);
- }
- GFI_ApplyLookupChanges(d);
- if ( retitle_fv ) { FontView *fvs;
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- FVSetTitle(fvs);
- }
- if ( reformat_fv )
- FontViewReformatAll(sf);
- sf->changed = true;
- SFSetModTime(sf);
- sf->changed_since_autosave = true;
- sf->changed_since_xuidchanged = !xuidchanged;
- /* Just in case they changed the blue values and we are showing blues */
- /* in outline views... */
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- CharView *cv;
- for ( cv = sf->glyphs[i]->views; cv!=NULL; cv=cv->next ) {
- cv->back_img_out_of_date = true;
- GDrawRequestExpose(cv->v,NULL,false);
- }
- }
- MacFeatListFree(sf->features);
- sf->features = GGadgetGetUserData(GWidgetGetControl(d->gw,CID_Features));
- last_aspect = d->old_aspect;
-
- MarkClassFree(sf->mark_class_cnt,sf->mark_classes,sf->mark_class_names);
- sf->mark_class_cnt = d->mark_class_cnt;
- sf->mark_classes = d->mark_classes;
- sf->mark_class_names = d->mark_class_names;
-
- GFI_Close(d);
-
- SFReplaceFontnameBDFProps(sf);
- }
-return( true );
-}
-
-static void GFI_AsDsLab(struct gfi_data *d, int cid) {
- int isoffset = GGadgetIsChecked(GWidgetGetControl(d->gw,cid));
- DBounds b;
- int ocid, labcid;
- double val;
- char buf[40];
- char *offt, *baret;
- int ismax=0;
- unichar_t *end;
-
- switch ( cid ) {
- case CID_WinAscentIsOff:
- offt = _("Win Ascent Offset:"); baret = _("Win Ascent:");
- ocid = CID_WinAscent; labcid = CID_WinAscentLab;
- ismax = true;
- break;
- case CID_WinDescentIsOff:
- offt = _("Win Descent Offset:"); baret = _("Win Descent:");
- ocid = CID_WinDescent; labcid = CID_WinDescentLab;
- break;
- case CID_TypoAscentIsOff:
- offt = _("Typo Ascent Offset:"); baret = _("Typo Ascent:");
- ocid = CID_TypoAscent; labcid = CID_TypoAscentLab;
- ismax = true;
- break;
- case CID_TypoDescentIsOff:
- offt = _("Typo Descent Offset:"); baret = _("Typo Descent:");
- ocid = CID_TypoDescent; labcid = CID_TypoDescentLab;
- break;
- case CID_HHeadAscentIsOff:
- offt = _("HHead Ascent Offset:"); baret = _("HHead Ascent:");
- ocid = CID_HHeadAscent; labcid = CID_HHeadAscentLab;
- ismax = true;
- break;
- case CID_HHeadDescentIsOff:
- offt = _("HHead Descent Offset:"); baret = _("HHead Descent:");
- ocid = CID_HHeadDescent; labcid = CID_HHeadDescentLab;
- break;
- default:
-return;
- }
-
- GGadgetSetTitle8(GWidgetGetControl(d->gw,labcid),
- isoffset?offt:baret);
- if ( cid == CID_TypoAscentIsOff ) {
- const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
- double av=u_strtod(as,&end);
- b.maxy = *end=='\0' ? av : d->sf->ascent;
- } else if ( cid == CID_TypoDescentIsOff ) {
- const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
- double dv=u_strtod(ds,&end);
- b.miny = *end=='\0' ? -dv : -d->sf->descent;
- } else {
- CIDFindBounds(d->sf,&b);
- if ( cid == CID_WinDescentIsOff ) b.miny = -b.miny;
- }
-
- val = u_strtod(_GGadgetGetTitle(GWidgetGetControl(d->gw,ocid)),NULL);
- if ( isoffset )
- sprintf( buf,"%g",rint( val-(ismax ? b.maxy : b.miny)) );
- else
- sprintf( buf,"%g",rint( val+(ismax ? b.maxy : b.miny)) );
- GGadgetSetTitle8(GWidgetGetControl(d->gw,ocid),buf);
-}
-
-static int GFI_AsDesIsOff(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- GFI_AsDsLab(d,GGadgetGetCid(g));
- }
-return( true );
-}
-
-static void _GFI_PanoseDefault(struct gfi_data *d) {
- int i;
- int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_PanDefault));
-
- for ( i=0; i<10; ++i ) {
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamily+i),!isdefault);
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_PanFamilyLab+i),!isdefault);
- }
- if ( isdefault ) {
- char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
- struct pfminfo info;
- memset(&info,0,sizeof(info));
- SFDefaultOS2Info(&info,d->sf,n);
- free(n);
- for ( i=0; i<10; ++i )
- GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),info.panose[i]);
- }
-}
-
-static int GFI_PanoseDefault(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- _GFI_PanoseDefault(d);
- }
-return( true );
-}
-
-static void GFI_SubSuperSet(struct gfi_data *d, struct pfminfo *info) {
- char buffer[40];
- unichar_t ubuf[40];
-
- sprintf( buffer, "%d", info->os2_subxsize );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXSize),ubuf);
-
- sprintf( buffer, "%d", info->os2_subysize );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYSize),ubuf);
-
- sprintf( buffer, "%d", info->os2_subxoff );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubXOffset),ubuf);
-
- sprintf( buffer, "%d", info->os2_subyoff );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SubYOffset),ubuf);
-
-
- sprintf( buffer, "%d", info->os2_supxsize );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXSize),ubuf);
-
- sprintf( buffer, "%d", info->os2_supysize );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYSize),ubuf);
-
- sprintf( buffer, "%d", info->os2_supxoff );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperXOffset),ubuf);
-
- sprintf( buffer, "%d", info->os2_supyoff );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_SuperYOffset),ubuf);
-
-
- sprintf( buffer, "%d", info->os2_strikeysize );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutSize),ubuf);
-
- sprintf( buffer, "%d", info->os2_strikeypos );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_StrikeoutPos),ubuf);
-}
-
-static void _GFI_SubSuperDefault(struct gfi_data *d) {
- int i;
- int isdefault = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault));
-
- for ( i=0; i<10; ++i )
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_SubXSize+i),!isdefault);
- if ( isdefault ) {
- const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
- const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
- const unichar_t *ia = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
- unichar_t *aend, *dend, *iend;
- double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend),iav=u_strtod(ia,&iend);
- struct pfminfo info;
- if ( *aend!='\0' ) av = d->sf->ascent;
- if ( *dend!='\0' ) dv = d->sf->descent;
- if ( *iend!='\0' ) iav = d->sf->italicangle;
- memset(&info,0,sizeof(info));
- SFDefaultOS2SubSuper(&info,(int) (dv+av), iav);
- GFI_SubSuperSet(d,&info);
- }
-}
-
-static int GFI_SubSuperDefault(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- _GFI_SubSuperDefault(d);
- }
-return( true );
-}
-
-static void TTFSetup(struct gfi_data *d) {
- struct pfminfo info;
- char buffer[10]; unichar_t ubuf[10];
- int i, lg, vlg, tlg;
- const unichar_t *as = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Ascent));
- const unichar_t *ds = _GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Descent));
- unichar_t *aend, *dend;
- double av=u_strtod(as,&aend),dv=u_strtod(ds,&dend);
-
- info = d->sf->pfminfo;
- if ( !info.pfmset ) {
- /* Base this stuff on the CURRENT name */
- /* if the user just created a font, and named it *Bold, then the sf */
- /* won't yet have Bold in its name, and basing the weight on it would*/
- /* give the wrong answer. That's why we don't do this init until we */
- /* get to one of the ttf aspects, it gives the user time to set the */
- /* name properly */
- /* And on CURRENT values of ascent and descent */
- char *n = cu_copy(_GGadgetGetTitle(GWidgetGetControl(d->gw,CID_Fontname)));
- if ( *aend=='\0' && *dend=='\0' ) {
- if ( info.linegap==0 )
- info.linegap = rint(.09*(av+dv));
- if ( info.vlinegap==0 )
- info.vlinegap = info.linegap;
- if ( info.os2_typolinegap==0 )
- info.os2_typolinegap = info.linegap;
- }
- lg = info.linegap; vlg = info.vlinegap; tlg = info.os2_typolinegap;
- SFDefaultOS2Info(&info,d->sf,n);
- if ( lg != 0 )
- info.linegap = lg;
- if ( vlg!= 0 )
- info.vlinegap = vlg;
- if ( tlg!=0 )
- info.os2_typolinegap = tlg;
- free(n);
- }
-
- if ( info.weight>0 && info.weight<=900 && info.weight%100==0 )
- GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),
- (char *) weightclass[info.weight/100-1].text);
- else {
- sprintf( buffer, "%d", info.weight );
- GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_WeightClass),buffer);
- }
- GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_WidthClass),info.width-1);
- for ( i=0; pfmfamily[i].text!=NULL; ++i )
- if ( (intpt) (pfmfamily[i].userdata)==info.pfmfamily ) {
- GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PFMFamily),i);
- break;
- }
-
- if ( d->sf->os2_version>=0 && d->sf->os2_version<=4 )
- GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_OS2Version),d->sf->os2_version);
- else {
- sprintf( buffer,"%d", d->sf->os2_version );
- GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_OS2Version),buffer);
- }
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_UseTypoMetrics),d->sf->use_typo_metrics);
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WeightWidthSlopeOnly),d->sf->weight_width_slope_only);
-
- for ( i=0; ibmfamily[i].text!=NULL; ++i )
- if ( (intpt) (ibmfamily[i].userdata)==info.os2_family_class ) {
- GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_IBMFamily),i);
- break;
- }
- if ( info.os2_vendor[0]!='\0' ) {
- ubuf[0] = info.os2_vendor[0];
- ubuf[1] = info.os2_vendor[1];
- ubuf[2] = info.os2_vendor[2];
- ubuf[3] = info.os2_vendor[3];
- ubuf[4] = 0;
- } else if ( TTFFoundry!=NULL )
- uc_strncpy(ubuf,TTFFoundry,4);
- else
- uc_strcpy(ubuf,"PfEd");
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_Vendor),ubuf);
-
-
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_PanDefault),!info.panose_set);
- _GFI_PanoseDefault(d);
- if ( info.panose_set )
- for ( i=0; i<10; ++i )
- GGadgetSelectOneListItem(GWidgetGetControl(d->gw,CID_PanFamily+i),info.panose[i]);
-
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_SubSuperDefault),!info.subsuper_set);
- if ( info.subsuper_set )
- GFI_SubSuperSet(d,&info);
- _GFI_SubSuperDefault(d);
-
- d->ttf_set = true;
- /* FSType is already set */
- sprintf( buffer, "%d", info.linegap );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_LineGap),ubuf);
- sprintf( buffer, "%d", info.vlinegap );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_VLineGap),ubuf);
- sprintf( buffer, "%d", info.os2_typolinegap );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoLineGap),ubuf);
-
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinAscentIsOff),info.winascent_add);
- GFI_AsDsLab(d,CID_WinAscentIsOff);
- sprintf( buffer, "%d", info.os2_winascent );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinAscent),ubuf);
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_WinDescentIsOff),info.windescent_add);
- GFI_AsDsLab(d,CID_WinDescentIsOff);
- sprintf( buffer, "%d", info.os2_windescent );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_WinDescent),ubuf);
-
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoAscentIsOff),info.typoascent_add);
- GFI_AsDsLab(d,CID_TypoAscentIsOff);
- sprintf( buffer, "%d", info.os2_typoascent );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoAscent),ubuf);
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TypoDescentIsOff),info.typodescent_add);
- GFI_AsDsLab(d,CID_TypoDescentIsOff);
- sprintf( buffer, "%d", info.os2_typodescent );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_TypoDescent),ubuf);
-
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadAscentIsOff),info.hheadascent_add);
- GFI_AsDsLab(d,CID_HHeadAscentIsOff);
- sprintf( buffer, "%d", info.hhead_ascent );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadAscent),ubuf);
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_HHeadDescentIsOff),info.hheaddescent_add);
- GFI_AsDsLab(d,CID_HHeadDescentIsOff);
- sprintf( buffer, "%d", info.hhead_descent );
- uc_strcpy(ubuf,buffer);
- GGadgetSetTitle(GWidgetGetControl(d->gw,CID_HHeadDescent),ubuf);
-}
-
-static char *mathparams[] = {
-/* GT: TeX parameters for math fonts. "Num" means numerator, "Denom" */
-/* GT: means denominator, "Sup" means superscript, "Sub" means subscript */
- N_("Num1:"),
- N_("Num2:"), N_("Num3:"), N_("Denom1:"),
- N_("Denom2:"), N_("Sup1:"), N_("Sup2:"), N_("Sup3:"), N_("Sub1:"), N_("Sub2:"),
- N_("SupDrop:"), N_("SubDrop:"), N_("Delim1:"), N_("Delim2:"), N_("Axis Ht:"),
- 0 };
-static char *mathpopups[] = { N_("Amount to raise baseline for numerators in display styles"),
- N_("Amount to raise baseline for numerators in non-display styles"),
- N_("Amount to raise baseline for numerators in non-display atop styles"),
- N_("Amount to lower baseline for denominators in display styles"),
- N_("Amount to lower baseline for denominators in non-display styles"),
- N_("Amount to raise baseline for superscripts in display styles"),
- N_("Amount to raise baseline for superscripts in non-display styles"),
- N_("Amount to raise baseline for superscripts in modified styles"),
- N_("Amount to lower baseline for subscripts in display styles"),
- N_("Amount to lower baseline for subscripts in non-display styles"),
- N_("Amount above top of large box to place baseline of superscripts"),
- N_("Amount below bottom of large box to place baseline of subscripts"),
- N_("Size of comb delimiters in display styles"),
- N_("Size of comb delimiters in non-display styles"),
- N_("Height of fraction bar above base line"),
- 0 };
-/* GT: Default Rule Thickness. A rule being a typographic term for a straight */
-/* GT: black line on a printed page. */
-static char *extparams[] = { N_("Def Rule Thick:"),
-/* GT: I don't really understand these "Big Op Space" things. They have */
-/* GT: something to do with TeX and are roughly defined a few strings down */
- N_("Big Op Space1:"),
- N_("Big Op Space2:"),
- N_("Big Op Space3:"),
- N_("Big Op Space4:"),
- N_("Big Op Space5:"), 0 };
-static char *extpopups[] = { N_("Default thickness of over and overline bars"),
- N_("The minimum glue space above a large displayed operator"),
- N_("The minimum glue space below a large displayed operator"),
- N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is above the operator"),
- N_("The minimum distance between a limit's baseline and a large displayed\noperator when the limit is below the operator"),
- N_("The extra glue place above and below displayed limits"),
- 0 };
-
-static int mp_e_h(GWindow gw, GEvent *event) {
- int i;
-
- if ( event->type==et_close ) {
- struct gfi_data *d = GDrawGetUserData(gw);
- d->mpdone = true;
- } else if ( event->type == et_char ) {
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(gw);
- if ( GGadgetGetCid(event->u.control.g)) {
- int err=false;
- double em = (d->sf->ascent+d->sf->descent), val;
- char **params;
- if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) )
- params = mathparams;
- else
- params = extparams;
- for ( i=0; params[i]!=0 && !err; ++i ) {
- val = GetReal8(gw,CID_TeX+i,params[i],&err);
- if ( !err )
- d->texdata.params[i+7] = rint( val/em * (1<<20) );
- }
- if ( !err )
- d->mpdone = true;
- } else
- d->mpdone = true;
- }
-return( true );
-}
-
-static int GFI_MoreParams(GGadget *g, GEvent *e) {
- int tot;
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData txgcd[35];
- GTextInfo txlabel[35];
- int i,y,k;
- char **params, **popups;
- char values[20][20];
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXText)) )
-return( true );
- else if ( GGadgetIsChecked(GWidgetGetControl(d->gw,CID_TeXMathSym)) ) {
- tot = 22-7;
- params = mathparams;
- popups = mathpopups;
- } else {
- tot = 13-7;
- params = extparams;
- popups = extpopups;
- }
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.is_dlg = true;
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
-/* GT: More Parameters */
- wattrs.utf8_window_title = _("More Params");
- pos.x = pos.y = 0;
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(180));
- pos.height = GDrawPointsToPixels(NULL,tot*26+60);
- gw = GDrawCreateTopWindow(NULL,&pos,mp_e_h,d,&wattrs);
-
- memset(&txlabel,0,sizeof(txlabel));
- memset(&txgcd,0,sizeof(txgcd));
-
- k=0; y = 10;
- for ( i=0; params[i]!=0; ++i ) {
- txlabel[k].text = (unichar_t *) params[i];
- txlabel[k].text_is_1byte = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = y+4;
- txgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- txgcd[k].gd.popup_msg = (unichar_t *) popups[i];
- txgcd[k++].creator = GLabelCreate;
-
- sprintf( values[i], "%g", d->texdata.params[i+7]*(double) (d->sf->ascent+d->sf->descent)/(double) (1<<20));
- txlabel[k].text = (unichar_t *) values[i];
- txlabel[k].text_is_1byte = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.pos.x = 85; txgcd[k].gd.pos.y = y;
- txgcd[k].gd.pos.width = 75;
- txgcd[k].gd.flags = gg_visible | gg_enabled;
- txgcd[k].gd.cid = CID_TeX + i;
- txgcd[k++].creator = GTextFieldCreate;
- y += 26;
- }
-
- txgcd[k].gd.pos.x = 30-3; txgcd[k].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
- txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
- txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
- txlabel[k].text = (unichar_t *) _("_OK");
- txlabel[k].text_is_1byte = true;
- txlabel[k].text_in_resource = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.cid = true;
- txgcd[k++].creator = GButtonCreate;
-
- txgcd[k].gd.pos.x = -30; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+3;
- txgcd[k].gd.pos.width = -1; txgcd[k].gd.pos.height = 0;
- txgcd[k].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- txlabel[k].text = (unichar_t *) _("_Cancel");
- txlabel[k].text_is_1byte = true;
- txlabel[k].text_in_resource = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.cid = false;
- txgcd[k++].creator = GButtonCreate;
-
- txgcd[k].gd.pos.x = 2; txgcd[k].gd.pos.y = 2;
- txgcd[k].gd.pos.width = pos.width-4; txgcd[k].gd.pos.height = pos.height-4;
- txgcd[k].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- txgcd[k].creator = GGroupCreate;
-
- GGadgetsCreate(gw,txgcd);
- d->mpdone = false;
- GDrawSetVisible(gw,true);
-
- while ( !d->mpdone )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
- }
-return( true );
-}
-
-static int GFI_TeXChanged(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- if ( GGadgetGetCid(g)==CID_TeXText ) {
- GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
-/* GT: Extra Space */
- _("Extra Sp:"));
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
- } else {
- GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
- _("Math Sp:"));
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),true);
- }
- }
-return( true );
-}
-
-static void DefaultTeX(struct gfi_data *d) {
- char buffer[20];
- int i;
- SplineFont *sf = d->sf;
-
- d->tex_set = true;
-
- if ( sf->texdata.type==tex_unset ) {
- TeXDefaultParams(sf);
- d->texdata = sf->texdata;
- }
-
- for ( i=0; i<7; ++i ) {
- sprintf( buffer,"%g", d->texdata.params[i]*(sf->ascent+sf->descent)/(double) (1<<20));
- GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeX+i),buffer);
- }
- if ( sf->texdata.type==tex_math )
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathSym), true);
- else if ( sf->texdata.type == tex_mathext )
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXMathExt), true);
- else {
- GGadgetSetChecked(GWidgetGetControl(d->gw,CID_TeXText), true);
- GGadgetSetTitle8(GWidgetGetControl(d->gw,CID_TeXExtraSpLabel),
-/* GT: Extra Space */
- _("Extra Sp:"));
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MoreParams),false);
- }
-}
-
-static int GFI_MacAutomatic(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- int autom = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_MacAutomatic));
- GGadgetSetEnabled(GWidgetGetControl(d->gw,CID_MacStyles),!autom);
- }
-return( true );
-}
-
-static void FigureUnicode(struct gfi_data *d) {
- int includeempties = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_UnicodeEmpties));
- GGadget *list = GWidgetGetControl(d->gw,CID_Unicode);
- struct rangeinfo *ri;
- int cnt, i;
- GTextInfo **ti;
- char buffer[200];
-
- GGadgetClearList(list);
- ri = SFUnicodeRanges(d->sf,(includeempties?ur_includeempty:0)|ur_sortbyunicode);
- if ( ri==NULL ) cnt=0;
- else
- for ( cnt=0; ri[cnt].range!=NULL; ++cnt );
-
- ti = galloc((cnt+1) * sizeof( GTextInfo * ));
- for ( i=0; i<cnt; ++i ) {
- if ( ri[i].range->first==-1 )
- snprintf( buffer, sizeof(buffer),
- "%s %d/0", _(ri[i].range->name), ri[i].cnt);
- else
- snprintf( buffer, sizeof(buffer),
- "%s U+%04X-U+%04X %d/%d",
- _(ri[i].range->name),
- (int) ri[i].range->first, (int) ri[i].range->last,
- ri[i].cnt, ri[i].range->actual );
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- ti[i]->text = utf82u_copy(buffer);
- ti[i]->userdata = ri[i].range;
- }
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,ti,false);
- free(ri);
-}
-
-static int GFI_UnicodeRangeChange(GGadget *g, GEvent *e) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- GTextInfo *ti = GGadgetGetListItemSelected(g);
- struct unicoderange *r;
- int gid, first=-1;
- SplineFont *sf = d->sf;
- FontView *fv = sf->fv;
- EncMap *map = fv->map;
- int i, enc;
-
- if ( ti==NULL )
-return( true );
- if ( e->type!=et_controlevent ||
- (e->u.control.subtype != et_listselected &&e->u.control.subtype != et_listdoubleclick))
-return( true );
-
- r = ti->userdata;
-
- for ( i=0; i<map->enccount; ++i )
- fv->selected[i] = 0;
-
- if ( e->u.control.subtype == et_listselected ) {
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
- enc = map->backmap[gid];
- if ( sf->glyphs[gid]->unicodeenc>=r->first && sf->glyphs[gid]->unicodeenc<=r->last &&
- enc!=-1 ) {
- if ( first==-1 || enc<first ) first = enc;
- fv->selected[enc] = true;
- }
- }
- } else if ( e->u.control.subtype == et_listdoubleclick && !r->unassigned ) {
- char *found = gcalloc(r->last-r->first+1,1);
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
- int u = sf->glyphs[gid]->unicodeenc;
- if ( u>=r->first && u<=r->last ) {
- found[u-r->first] = true;
- }
- }
- for ( i=0; i<=r->last-r->first; ++i ) {
- if ( isunicodepointassigned(i+r->first) && !found[i] ) {
- enc = EncFromUni(i+r->first,map->enc);
- if ( enc!=-1 ) {
- if ( first==-1 || enc<first ) first = enc;
- fv->selected[enc] = true;
- }
- }
- }
- free(found);
- }
- if ( first==-1 ) {
- GDrawBeep(NULL);
- } else {
- FVScrollToChar(fv,first);
- }
- GDrawRequestExpose(fv->v,NULL,false);
-return( true );
-}
-
-static int GFI_UnicodeEmptiesChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- FigureUnicode(d);
- }
-return( true );
-}
-
-static int GFI_AspectChange(GGadget *g, GEvent *e) {
- if ( e==NULL || (e->type==et_controlevent && e->u.control.subtype == et_radiochanged )) {
- struct gfi_data *d = GDrawGetUserData(GGadgetGetWindow(g));
- int new_aspect = GTabSetGetSel(g);
- int rows;
-
- if ( d->old_aspect == d->tn_aspect )
- GMatrixEditGet(GWidgetGetControl(d->gw,CID_TNames), &rows);
- if ( !d->ttf_set && new_aspect == d->ttfv_aspect )
- TTFSetup(d);
- else if ( !d->names_set && new_aspect == d->tn_aspect ) {
- TTFNames_Resort(d);
- d->names_set = true;
- } else if ( !d->tex_set && new_aspect == d->tx_aspect )
- DefaultTeX(d);
- else if ( new_aspect == d->unicode_aspect )
- FigureUnicode(d);
- d->old_aspect = new_aspect;
- }
-return( true );
-}
-
-static int e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- struct gfi_data *d = GDrawGetUserData(gw);
- GFI_CancelClose(d);
- } else if ( event->type==et_destroy ) {
- struct gfi_data *d = GDrawGetUserData(gw);
- free(d);
- } else if ( event->type==et_char ) {
-return( GFI_Char(GDrawGetUserData(gw),event));
- }
-return( true );
-}
-
-static void GFI_InitMarkClasses(struct gfi_data *d) {
- SplineFont *sf = d->sf;
- int i;
-
- d->mark_class_cnt = sf->mark_class_cnt;
- if ( d->mark_class_cnt!=0 ) {
- d->mark_classes = galloc(d->mark_class_cnt*sizeof(char *));
- d->mark_class_names = galloc(d->mark_class_cnt*sizeof(unichar_t *));
- d->mark_classes[0] = NULL; d->mark_class_names[0] = NULL;
- for ( i=1; i<d->mark_class_cnt; ++i ) {
- d->mark_classes[i] = copy(sf->mark_classes[i]);
- d->mark_class_names[i] = copy(sf->mark_class_names[i]);
- }
- }
-}
-
-static void LookupSetup(struct lkdata *lk,OTLookup *lookups) {
- int cnt, subcnt;
- OTLookup *otl;
- struct lookup_subtable *sub;
-
- for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next );
- lk->cnt = cnt; lk->max = cnt+10;
- lk->all = gcalloc(lk->max,sizeof(struct lkinfo));
- for ( cnt=0, otl=lookups; otl!=NULL; ++cnt, otl=otl->next ) {
- lk->all[cnt].lookup = otl;
- for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next );
- lk->all[cnt].subtable_cnt = subcnt; lk->all[cnt].subtable_max = subcnt+10;
- lk->all[cnt].subtables = gcalloc(lk->all[cnt].subtable_max,sizeof(struct lksubinfo));
- for ( subcnt=0, sub=otl->subtables; sub!=NULL; ++subcnt, sub=sub->next )
- lk->all[cnt].subtables[subcnt].subtable = sub;
- }
-}
-
-static void LookupInfoFree(struct lkdata *lk) {
- int cnt;
-
- for ( cnt=0; cnt<lk->cnt; ++cnt )
- free(lk->all[cnt].subtables);
- free(lk->all);
-}
-
-#define LK_MARGIN 2
-
-struct selection_bits {
- int lookup_cnt, sub_cnt; /* Number of selected lookups, and selected sub tables */
- int a_lookup, a_sub; /* The index of one of those lookups, or subtables */
- int a_sub_lookup; /* the index of the lookup containing a_sub */
- int any_first, any_last; /* Whether any of the selected items is first or last in its catagory */
- int sub_table_mergeable; /* Can we merge the selected subtables? */
- int lookup_mergeable; /* Can we merge the selected lookups? */
-};
-
-static void LookupParseSelection(struct lkdata *lk, struct selection_bits *sel) {
- int lookup_cnt, sub_cnt, any_first, any_last, all_one_lookup;
- int a_lookup, a_sub, a_sub_lookup;
- int sub_mergeable, lookup_mergeable;
- int i,j;
-
- lookup_cnt = sub_cnt = any_first = any_last = 0;
- all_one_lookup = a_lookup = a_sub = a_sub_lookup = -1;
- sub_mergeable = lookup_mergeable = true;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected ) {
- ++lookup_cnt;
- if ( a_lookup==-1 )
- a_lookup = i;
- else if ( lk->all[i].lookup->lookup_type!=lk->all[a_lookup].lookup->lookup_type ||
- lk->all[i].lookup->lookup_flags!=lk->all[a_lookup].lookup->lookup_flags )
- lookup_mergeable = false;
- if ( i==0 ) any_first=true;
- if ( i==lk->cnt-1 ) any_last=true;
- }
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected ) {
- ++sub_cnt;
- if ( a_sub==-1 ) {
- a_sub = j; a_sub_lookup = i;
- }
- if ( j==0 ) any_first = true;
- if ( j==lk->all[i].subtable_cnt-1 ) any_last = true;
- if ( lk->all[i].subtables[j].subtable->kc!=NULL ||
- lk->all[i].subtables[j].subtable->fpst!=NULL ||
- lk->all[i].subtables[j].subtable->sm!=NULL )
- sub_mergeable = false;
- if ( all_one_lookup==-1 )
- all_one_lookup = i;
- else if ( all_one_lookup!=i )
- all_one_lookup = -2;
- }
- }
- }
- }
-
- sel->lookup_cnt = lookup_cnt;
- sel->sub_cnt = sub_cnt;
- sel->a_lookup = a_lookup;
- sel->a_sub = a_sub;
- sel->a_sub_lookup = a_sub_lookup;
- sel->any_first = any_first;
- sel->any_last = any_last;
- sel->sub_table_mergeable = sub_mergeable && all_one_lookup && sub_cnt>=2 && lookup_cnt==0;
- sel->lookup_mergeable = lookup_mergeable && lookup_cnt>=2 && sub_cnt==0;
-}
-
-void GFI_LookupEnableButtons(struct gfi_data *gfi, int isgpos) {
- struct lkdata *lk = &gfi->tables[isgpos];
- struct selection_bits sel;
- FontView *ofv;
-
- LookupParseSelection(lk,&sel);
-
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupTop),!sel.any_first &&
- sel.lookup_cnt+sel.sub_cnt==1);
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupUp),!sel.any_first &&
- sel.lookup_cnt+sel.sub_cnt!=0);
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupDown),!sel.any_last &&
- sel.lookup_cnt+sel.sub_cnt!=0);
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupBottom),!sel.any_last &&
- sel.lookup_cnt+sel.sub_cnt==1);
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddLookup),
- (sel.lookup_cnt+sel.sub_cnt<=1));
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_AddSubtable),
- (sel.lookup_cnt==1 && sel.sub_cnt<=1) || (sel.lookup_cnt==0 && sel.sub_cnt==1));
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditMetadata),
- (sel.lookup_cnt==1 && sel.sub_cnt==0) ||
- (sel.lookup_cnt==0 && sel.sub_cnt==1));
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_EditSubtable),sel.lookup_cnt==0 &&
- sel.sub_cnt==1);
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_DeleteLookup),sel.lookup_cnt!=0 ||
- sel.sub_cnt!=0);
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_MergeLookup),
- (sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
- (sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable));
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_RevertLookups),true);
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_LookupSort),lk->cnt>1 );
-
- for ( ofv=fv_list; ofv!=NULL; ofv = ofv->next ) {
- SplineFont *osf = ofv->sf;
- if ( osf->cidmaster ) osf = osf->cidmaster;
- if ( osf==gfi->sf || gfi->sf->cidmaster==osf )
- continue;
- if ( (isgpos && osf->gpos_lookups!=NULL) || (!isgpos && osf->gsub_lookups!=NULL) )
- break;
- }
- GGadgetSetEnabled(GWidgetGetControl(gfi->gw,CID_ImportLookups),ofv!=NULL);
-}
-
-void GFI_LookupScrollbars(struct gfi_data *gfi, int isgpos, int refresh) {
- int lcnt, i,j;
- int width=0, wmax;
- GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
- struct lkdata *lk = &gfi->tables[isgpos];
- GGadget *vsb = GWidgetGetControl(gfi->gw,CID_LookupVSB+isgpos);
- GGadget *hsb = GWidgetGetControl(gfi->gw,CID_LookupHSB+isgpos);
- int off_top, off_left;
-
- GDrawSetFont(gw,gfi->font);
- lcnt = 0;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- ++lcnt;
- wmax = GDrawGetText8Width(gw,lk->all[i].lookup->lookup_name,-1,NULL);
- if ( wmax > width ) width = wmax;
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- ++lcnt;
- wmax = gfi->fh+GDrawGetText8Width(gw,lk->all[i].subtables[j].subtable->subtable_name,-1,NULL);
- if ( wmax > width ) width = wmax;
- }
- }
- }
- width += gfi->fh;
- GScrollBarSetBounds(vsb,0,lcnt,(gfi->lkheight-2*LK_MARGIN)/gfi->fh);
- GScrollBarSetBounds(hsb,0,width,gfi->lkwidth-2*LK_MARGIN);
- off_top = lk->off_top;
- if ( off_top+((gfi->lkheight-2*LK_MARGIN)/gfi->fh) > lcnt )
- off_top = lcnt - (gfi->lkheight-2*LK_MARGIN)/gfi->fh;
- if ( off_top<0 )
- off_top = 0;
- off_left = lk->off_left;
- if ( off_left+gfi->lkwidth-2*LK_MARGIN > width )
- off_left = width-(gfi->lkwidth-2*LK_MARGIN);
- if ( off_left<0 )
- off_left = 0;
- if ( off_top!=lk->off_top || off_left!=lk->off_left ) {
- lk->off_top = off_top; lk->off_left = off_left;
- GScrollBarSetPos(vsb,off_top);
- GScrollBarSetPos(hsb,off_left);
- refresh = true;
- }
- if ( refresh )
- GDrawRequestExpose(gw,NULL,true);
-}
-
-static int LookupsHScroll(GGadget *g,GEvent *event) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GGadgetGetCid(g)-CID_LookupHSB;
- struct lkdata *lk = &gfi->tables[isgpos];
- int newpos = lk->off_left;
- int32 sb_min, sb_max, sb_pagesize;
-
- if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
-return( true );
-
- GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
- switch( event->u.control.u.sb.type ) {
- case et_sb_top:
- newpos = 0;
- break;
- case et_sb_uppage:
- newpos -= 9*sb_pagesize/10;
- break;
- case et_sb_up:
- newpos -= sb_pagesize/15;
- break;
- case et_sb_down:
- newpos += sb_pagesize/15;
- break;
- case et_sb_downpage:
- newpos += 9*sb_pagesize/10;
- break;
- case et_sb_bottom:
- newpos = sb_max-sb_pagesize;
- break;
- case et_sb_thumb:
- case et_sb_thumbrelease:
- newpos = event->u.control.u.sb.pos;
- break;
- case et_sb_halfup:
- newpos -= sb_pagesize/30;
- break;
- case et_sb_halfdown:
- newpos += sb_pagesize/30;
- break;
- }
- if ( newpos>sb_max-sb_pagesize )
- newpos = sb_max-sb_pagesize;
- if ( newpos<0 ) newpos = 0;
- if ( newpos!=lk->off_left ) {
- lk->off_left = newpos;
- GScrollBarSetPos(event->u.control.g,newpos);
- GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,true);
- }
-return( true );
-}
-
-static int LookupsVScroll(GGadget *g,GEvent *event) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GGadgetGetCid(g)-CID_LookupVSB;
- struct lkdata *lk = &gfi->tables[isgpos];
- int newpos = lk->off_top;
- int32 sb_min, sb_max, sb_pagesize;
-
- if ( event->type!=et_controlevent || event->u.control.subtype != et_scrollbarchange )
-return( true );
-
- GScrollBarGetBounds(event->u.control.g,&sb_min,&sb_max,&sb_pagesize);
- switch( event->u.control.u.sb.type ) {
- case et_sb_top:
- newpos = 0;
- break;
- case et_sb_uppage:
- newpos -= 9*sb_pagesize/10;
- break;
- case et_sb_up:
- --newpos;
- break;
- case et_sb_down:
- ++newpos;
- break;
- case et_sb_downpage:
- newpos += 9*sb_pagesize/10;
- break;
- case et_sb_bottom:
- newpos = (sb_max-sb_pagesize);
- break;
- case et_sb_thumb:
- case et_sb_thumbrelease:
- newpos = event->u.control.u.sb.pos;
- break;
- }
- if ( newpos>(sb_max-sb_pagesize) )
- newpos = (sb_max-sb_pagesize);
- if ( newpos<0 ) newpos = 0;
- if ( newpos!=lk->off_top ) {
- /*int diff = newpos-lk->off_top;*/
- lk->off_top = newpos;
- GScrollBarSetPos(event->u.control.g,newpos);
- /*GDrawScroll(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,0,diff*gfi->fh);*/
- GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos)),NULL,true);
- }
-return( true );
-}
-
-static int GFI_LookupOrder(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- int i,j,k;
- struct lkinfo temp;
- struct lksubinfo temp2;
- int cid = GGadgetGetCid(g);
- GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
-
- if ( cid==CID_LookupTop ) {
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected ) {
- temp = lk->all[i];
- for ( k=i-1; k>=0; --k )
- lk->all[k+1] = lk->all[k];
- lk->all[0] = temp;
- goto done;
- }
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected ) {
- temp2 = lk->all[i].subtables[j];
- for ( k=j-1; k>=0; --k )
- lk->all[i].subtables[k+1] = lk->all[i].subtables[k];
- lk->all[i].subtables[0] = temp2;
- goto done;
- }
- }
- }
- }
- } else if ( cid==CID_LookupBottom ) {
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected ) {
- temp = lk->all[i];
- for ( k=i; k<lk->cnt-1; --k )
- lk->all[k] = lk->all[k+1];
- lk->all[lk->cnt-1] = temp;
- goto done;
- }
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected ) {
- temp2 = lk->all[i].subtables[j];
- for ( k=j; k<lk->all[i].subtable_cnt-1; --k )
- lk->all[i].subtables[k] = lk->all[i].subtables[k+1];
- lk->all[i].subtables[lk->all[i].subtable_cnt-1] = temp2;
- goto done;
- }
- }
- }
- }
- } else if ( cid==CID_LookupUp ) {
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected && i!=0 ) {
- temp = lk->all[i];
- lk->all[i] = lk->all[i-1];
- lk->all[i-1] = temp;
- }
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected && j!=0 ) {
- temp2 = lk->all[i].subtables[j];
- lk->all[i].subtables[j] = lk->all[i].subtables[j-1];
- lk->all[i].subtables[j-1] = temp2;
- }
- }
- }
- }
- } else if ( cid==CID_LookupDown ) {
- for ( i=lk->cnt-1; i>=0; --i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected && i!=lk->cnt-1 ) {
- temp = lk->all[i];
- lk->all[i] = lk->all[i+1];
- lk->all[i+1] = temp;
- }
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected && j!=lk->all[i].subtable_cnt-1 ) {
- temp2 = lk->all[i].subtables[j];
- lk->all[i].subtables[j] = lk->all[i].subtables[j+1];
- lk->all[i].subtables[j+1] = temp2;
- }
- }
- }
- }
- }
- done:
- GFI_LookupEnableButtons(gfi,isgpos);
- GDrawRequestExpose(gw,NULL,true);
- }
-return( true );
-}
-
-static int GFI_LookupSort(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- struct lkinfo temp;
- int i,j;
-
- for ( i=0; i<lk->cnt; ++i ) {
- int order = FeatureOrderId(isgpos,lk->all[i].lookup->features);
- for ( j=i+1; j<lk->cnt; ++j ) {
- int jorder = FeatureOrderId(isgpos,lk->all[j].lookup->features);
- if ( order>jorder) {
- temp = lk->all[i];
- lk->all[i] = lk->all[j];
- lk->all[j] = temp;
- order = jorder;
- }
- }
- }
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-return( true );
-}
-
-/* ??? *//* How about a series of buttons to show only by lookup_type, feat-tag, script-tag */
-
-void GFI_CCDEnd(struct gfi_data *d) {
-
- d->ccd = NULL;
-}
-
-void GFI_FinishContextNew(struct gfi_data *d,FPST *fpst, int success) {
- OTLookup *otl;
- struct lookup_subtable *sub, *prev;
- FPST *ftest, *fprev;
-
- if ( !success ) {
- /* We can't allow incomplete FPSTs to float around */
- /* If they didn't fill it in, delete it */
- otl = fpst->subtable->lookup;
- prev = NULL;
- for ( sub=otl->subtables; sub!=NULL && sub!=fpst->subtable; prev = sub, sub=sub->next );
- if ( sub!=NULL ) {
- if ( prev==NULL )
- otl->subtables = sub->next;
- else
- prev->next = sub->next;
- free(sub->subtable_name);
- chunkfree(sub,sizeof(struct lookup_subtable));
- }
- fprev = NULL;
- for ( ftest=d->sf->possub; ftest!=NULL && ftest!=fpst; fprev = ftest, ftest=ftest->next );
- if ( ftest!=NULL ) {
- if ( fprev==NULL )
- d->sf->possub = fpst->next;
- else
- fprev->next = fpst->next;
- }
-
- chunkfree(fpst,sizeof(FPST));
- }
-}
-
-void GFI_SMDEnd(struct gfi_data *d) {
-
- d->smd = NULL;
-}
-
-void GFI_FinishSMNew(struct gfi_data *d,ASM *sm, int success, int isnew) {
- OTLookup *otl;
- struct lookup_subtable *sub, *prev;
- ASM *smtest, *smprev;
-
- if ( !success && isnew ) {
- /* We can't allow incomplete state machines floating around */
- /* If they didn't fill it in, delete it */
- otl = sm->subtable->lookup;
- prev = NULL;
- for ( sub=otl->subtables; sub!=NULL && sub!=sm->subtable; prev = sub, sub=sub->next );
- if ( sub!=NULL ) {
- if ( prev==NULL )
- otl->subtables = sub->next;
- else
- prev->next = sub->next;
- free(sub->subtable_name);
- chunkfree(sub,sizeof(struct lookup_subtable));
- }
- smprev = NULL;
- for ( smtest=d->sf->sm; smtest!=NULL && smtest!=sm; smprev = smtest, smtest=smtest->next );
- if ( smtest!=NULL ) {
- if ( smprev==NULL )
- d->sf->sm = sm->next;
- else
- smprev->next = sm->next;
- }
- chunkfree(sm,sizeof(ASM));
- }
-}
-
-static void LookupSubtableContents(struct gfi_data *gfi,int isgpos) {
- struct lkdata *lk = &gfi->tables[isgpos];
- int i,j;
-
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected ) {
- _LookupSubtableContents(gfi->sf,lk->all[i].subtables[j].subtable,NULL);
-return;
- }
- }
- }
- }
-}
-
-static int GFI_LookupEditSubtableContents(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- LookupSubtableContents(gfi,isgpos);
- }
-return( true );
-}
-
-static int GFI_LookupAddLookup(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- int i,j,k,lcnt;
- OTLookup *otl = chunkalloc(sizeof(OTLookup));
-
- if ( !EditLookup(otl,isgpos,gfi->sf)) {
- chunkfree(otl,sizeof(OTLookup));
-return( true );
- }
- for ( i=lk->cnt-1; i>=0; --i ) {
- if ( !lk->all[i].deleted && lk->all[i].selected ) {
- lk->all[i].selected = false;
- break;
- }
- if ( !lk->all[i].deleted && lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j )
- if ( !lk->all[i].subtables[j].deleted &&
- lk->all[i].subtables[j].selected ) {
- lk->all[i].subtables[j].selected = false;
- break;
- }
- if ( j<lk->all[i].subtable_cnt )
- break;
- }
- }
- if ( lk->cnt>=lk->max )
- lk->all = grealloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
- for ( k=lk->cnt; k>i+1; --k )
- lk->all[k] = lk->all[k-1];
- memset(&lk->all[k],0,sizeof(struct lkinfo));
- lk->all[k].lookup = otl;
- lk->all[k].new = true;
- lk->all[k].selected = true;
- ++lk->cnt;
- if ( isgpos ) {
- otl->next = gfi->sf->gpos_lookups;
- gfi->sf->gpos_lookups = otl;
- } else {
- otl->next = gfi->sf->gsub_lookups;
- gfi->sf->gsub_lookups = otl;
- }
-
- /* Make sure the window is scrolled to display the new lookup */
- lcnt=0;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( i==k )
- break;
- ++lcnt;
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- ++lcnt;
- }
- }
- if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
- lk->off_top = lcnt;
-
- GFI_LookupScrollbars(gfi,isgpos, true);
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-return( true );
-}
-
-static int GFI_LookupAddSubtable(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- int i,j,k,lcnt;
- struct lookup_subtable *sub;
-
- lcnt = 0;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- j = -1;
- ++lcnt;
- if ( lk->all[i].selected )
- break;
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- ++lcnt;
- if ( lk->all[i].subtables[j].selected )
- goto break_2_loops;
- }
- }
- break_2_loops:
- if ( i==lk->cnt )
-return( true );
-
- sub = chunkalloc(sizeof(struct lookup_subtable));
- sub->lookup = lk->all[i].lookup;
- if ( !EditSubtable(sub,isgpos,gfi->sf,NULL)) {
- chunkfree(sub,sizeof(struct lookup_subtable));
-return( true );
- }
- if ( lk->all[i].subtable_cnt>=lk->all[i].subtable_max )
- lk->all[i].subtables = grealloc(lk->all[i].subtables,(lk->all[i].subtable_max+=10)*sizeof(struct lksubinfo));
- for ( k=lk->all[i].subtable_cnt; k>j+1; --k )
- lk->all[i].subtables[k] = lk->all[i].subtables[k-1];
- memset(&lk->all[i].subtables[k],0,sizeof(struct lksubinfo));
- lk->all[i].subtables[k].subtable = sub;
- lk->all[i].subtables[k].new = true;
- sub->next = lk->all[i].lookup->subtables;
- lk->all[i].lookup->subtables = sub;
- ++lk->all[i].subtable_cnt;
-
- /* Make sure the window is scrolled to display the new subtable */
- if ( lcnt<lk->off_top || lcnt>=lk->off_top+(gfi->lkheight-2*LK_MARGIN)/gfi->fh )
- lk->off_top = lcnt;
-
- GFI_LookupScrollbars(gfi,isgpos, true);
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-return( true );
-}
-
-static int GFI_LookupEditMetadata(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- int i,j;
-
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected ) {
- EditLookup(lk->all[i].lookup,isgpos,gfi->sf);
-return( true );
- } else if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected ) {
- EditSubtable(lk->all[i].subtables[j].subtable,isgpos,gfi->sf,NULL);
-return( true );
- }
- }
- }
- }
- }
-return( true );
-}
-
-static int GFI_LookupMergeLookup(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- char *buts[3];
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- struct selection_bits sel;
- int i,j;
- struct lkinfo *lkfirst;
- struct lksubinfo *sbfirst;
- struct lookup_subtable *sub;
-
- LookupParseSelection(lk,&sel);
- if ( !sel.sub_table_mergeable && !sel.lookup_mergeable )
-return( true );
-
- buts[0] = _("Do it");
- buts[1] = _("_Cancel");
- buts[2] = NULL;
- if ( gwwv_ask(_("Cannot be Undone"),(const char **) buts,0,1,_("The Merge operation cannot be reverted.\nDo it anyway?"))==1 )
-return( true );
- if ( sel.lookup_mergeable ) {
- lkfirst = NULL;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].selected && !lk->all[i].deleted ) {
- if ( lkfirst==NULL )
- lkfirst = &lk->all[i];
- else {
- FLMerge(lkfirst->lookup,lk->all[i].lookup);
- if ( lkfirst->subtable_cnt+lk->all[i].subtable_cnt >= lkfirst->subtable_max )
- lkfirst->subtables = grealloc(lkfirst->subtables,(lkfirst->subtable_max+=lk->all[i].subtable_cnt)*sizeof(struct lksubinfo));
- memcpy(lkfirst->subtables+lkfirst->subtable_cnt,
- lk->all[i].subtables,lk->all[i].subtable_cnt*sizeof(struct lksubinfo));
- lkfirst->subtable_cnt += lk->all[i].subtable_cnt;
- for ( j=0; j<lk->all[i].subtable_cnt; ++j )
- lk->all[i].subtables[j].subtable->lookup = lkfirst->lookup;
- if ( lk->all[i].lookup->subtables!=NULL ) {
- for ( sub = lk->all[i].lookup->subtables; sub->next!=NULL; sub = sub->next );
- sub->next = lkfirst->lookup->subtables;
- lkfirst->lookup->subtables = lk->all[i].lookup->subtables;
- lk->all[i].lookup->subtables = NULL;
- }
- lk->all[i].subtable_cnt = 0;
- lk->all[i].deleted = true;
- lk->all[i].open = false;
- lk->all[i].selected = false;
- }
- }
- }
- } else if ( sel.sub_table_mergeable ) {
- sbfirst = NULL;
- for ( i=0; i<lk->cnt; ++i ) if ( !lk->all[i].deleted && lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) if ( !lk->all[i].subtables[j].deleted ) {
- if ( lk->all[i].subtables[j].selected ) {
- if ( sbfirst == NULL )
- sbfirst = &lk->all[i].subtables[j];
- else {
- SFSubTablesMerge(gfi->sf,sbfirst->subtable,lk->all[i].subtables[j].subtable);
- lk->all[i].subtables[j].deleted = true;
- lk->all[i].subtables[j].selected = false;
- }
- }
- }
- if ( sbfirst!=NULL ) /* Can only merge subtables within a lookup, so if we found anything, in a lookup that's everything */
- break;
- }
- }
- GFI_LookupScrollbars(gfi,isgpos, true);
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-return( true );
-}
-
-static int GFI_LookupDeleteLookup(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- int i,j;
-
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected )
- lk->all[i].deleted = true;
- else if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lk->all[i].subtables[j].selected )
- lk->all[i].subtables[j].deleted = true;
- }
- }
- }
-
- GFI_LookupScrollbars(gfi,isgpos, true);
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-
-return( true );
-}
-
-static int GFI_LookupRevertLookup(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- int i,j;
-
- /* First remove any new lookups, subtables */
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].new )
- SFRemoveLookup(gfi->sf,lk->all[i].lookup);
- else {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j )
- if ( lk->all[i].subtables[j].new )
- SFRemoveLookupSubTable(gfi->sf,lk->all[i].subtables[j].subtable);
- }
- }
-
- /* Now since we didn't actually delete anything we don't need to do */
- /* anything to resurrect them */
-
- /* Finally we need to restore the original order. */
- /* But that just means regenerating the lk structure. So free it and */
- /* regenerate it */
-
- LookupInfoFree(lk);
- LookupSetup(lk,isgpos?gfi->sf->gpos_lookups:gfi->sf->gsub_lookups);
-
- GFI_LookupScrollbars(gfi,isgpos, true);
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-return( true );
-}
-
-static int import_e_h(GWindow gw, GEvent *event) {
- int *done = GDrawGetUserData(gw);
-
- if ( event->type==et_close ) {
- *done = true;
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("fontinfo.html#Lookups");
-return( true );
- }
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- switch ( GGadgetGetCid(event->u.control.g)) {
- case CID_OK:
- *done = 2;
- break;
- case CID_Cancel:
- *done = true;
- break;
- }
- }
-return( true );
-}
-
-static int GFI_LookupImportLookup(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- FontView *ofv;
- SplineFont *osf;
- OTLookup *otl;
- int i, j, cnt;
- GTextInfo *ti;
- GGadgetCreateData gcd[7], *varray[8], *harray[7];
- GTextInfo label[7];
- GWindowAttrs wattrs;
- GRect pos;
- GWindow gw;
- int done = 0;
-
- /* Figure out what lookups can be imported from which (open) fonts */
- ti = NULL;
- for ( j=0; j<2; ++j ) {
- for ( ofv=fv_list; ofv!=NULL; ofv=ofv->next ) {
- osf = ofv->sf;
- if ( osf->cidmaster ) osf = osf->cidmaster;
- osf->ticked = false;
- }
- cnt = 0;
- for ( ofv=fv_list; ofv!=NULL; ofv=ofv->next ) {
- osf = ofv->sf;
- if ( osf->cidmaster ) osf = osf->cidmaster;
- if ( osf->ticked || osf==gfi->sf || osf==gfi->sf->cidmaster ||
- ( isgpos && osf->gpos_lookups==NULL) ||
- (!isgpos && osf->gsub_lookups==NULL) )
- continue;
- osf->ticked = true;
- if ( cnt!=0 ) {
- if ( ti )
- ti[cnt].line = true;
- ++cnt;
- }
- if ( ti ) {
- ti[cnt].text = (unichar_t *) copy( osf->fontname );
- ti[cnt].text_is_1byte = true;
- ti[cnt].disabled = true;
- ti[cnt].userdata = osf;
- }
- ++cnt;
- for ( otl = isgpos ? osf->gpos_lookups : osf->gsub_lookups; otl!=NULL; otl=otl->next ) {
- if ( ti ) {
- ti[cnt].text = (unichar_t *) strconcat( " ", otl->lookup_name );
- ti[cnt].text_is_1byte = true;
- ti[cnt].userdata = otl;
- }
- ++cnt;
- }
- }
- if ( ti==NULL )
- ti = gcalloc((cnt+1),sizeof(GTextInfo));
- }
-
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
-
- i = 0;
- label[i].text = (unichar_t *) _("Select lookups from other fonts");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 12; gcd[i].gd.pos.y = 6+6;
- gcd[i].gd.flags = gg_visible | gg_enabled;
- gcd[i].creator = GLabelCreate;
- varray[0] = &gcd[i++]; varray[1] = NULL;
-
- gcd[i].gd.pos.height = 12*12+6;
- gcd[i].gd.flags = gg_enabled|gg_visible|gg_list_multiplesel|gg_utf8_popup;
- gcd[i].gd.u.list = ti;
- gcd[i].creator = GListCreate;
- varray[2] = &gcd[i++]; varray[3] = NULL;
-
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_Import");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_OK;
- harray[0] = GCD_Glue; harray[1] = &gcd[i]; harray[2] = GCD_Glue;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_Cancel;
- harray[3] = GCD_Glue; harray[4] = &gcd[i]; harray[5] = GCD_Glue; harray[6] = NULL;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.flags = gg_enabled|gg_visible;
- gcd[i].gd.u.boxelements = harray;
- gcd[i].creator = GHBoxCreate;
- varray[4] = &gcd[i++]; varray[5] = NULL; varray[6] = NULL;
-
- gcd[i].gd.pos.x = gcd[i].gd.pos.y = 2;
- gcd[i].gd.flags = gg_enabled|gg_visible;
- gcd[i].gd.u.boxelements = varray;
- gcd[i].creator = GHVGroupCreate;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Import Lookup...");
- wattrs.is_dlg = true;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,150));
- pos.height = GDrawPointsToPixels(NULL,193);
- gw = GDrawCreateTopWindow(NULL,&pos,import_e_h,&done,&wattrs);
-
- GGadgetsCreate(gw,&gcd[i]);
- GHVBoxSetExpandableRow(gcd[i].ret,1);
- GHVBoxSetExpandableCol(gcd[i-1].ret,gb_expandgluesame);
- GHVBoxFitWindow(gcd[i].ret);
- GTextInfoListFree(ti);
- GDrawSetVisible(gw,true);
-
- while ( !done )
- GDrawProcessOneEvent(NULL);
- if ( done==2 ) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(gcd[1].ret,&len);
- osf = NULL;
- for ( i=0; i<len; ++i ) {
- if ( ti[i]->disabled )
- osf = ti[i]->userdata;
- else if ( ti[i]->selected && ti[i]->text!=NULL )
- OTLookupCopyInto(gfi->sf,osf,(OTLookup *) ti[i]->userdata);
- }
- }
- GDrawDestroyWindow(gw);
-
- GFI_LookupScrollbars(gfi,isgpos, true);
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-return( true );
-}
-
-static int GFI_LookupAspectChange(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- struct gfi_data *gfi = GDrawGetUserData(GGadgetGetWindow(g));
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- GFI_LookupEnableButtons(gfi,isgpos);
- }
-return( true );
-}
-
-static void LookupExpose(GWindow pixmap, struct gfi_data *gfi, int isgpos) {
- int lcnt, i,j;
- struct lkdata *lk = &gfi->tables[isgpos];
- GRect r, old;
-
- r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
- r.y = LK_MARGIN; r.height = gfi->lkheight-2*LK_MARGIN;
- GDrawPushClip(pixmap,&r,&old);
- GDrawSetFont(pixmap,gfi->font);
-
- lcnt = 0;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lcnt>=lk->off_top ) {
- if ( lk->all[i].selected ) {
- r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
- r.y = (lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
- GDrawFillRect(pixmap,&r,0xffff00);
- }
- r.x = LK_MARGIN-lk->off_left; r.width = (gfi->as&~1);
- r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = r.width;
- GDrawDrawRect(pixmap,&r,0x000000);
- GDrawDrawLine(pixmap,r.x+2,r.y+(r.height/2), r.x+r.width-2,r.y+(r.height/2), 0x000000);
- if ( !lk->all[i].open )
- GDrawDrawLine(pixmap,r.x+(r.width/2),r.y+2, r.x+(r.width/2),r.y+r.height-2, 0x000000);
- GDrawDrawText8(pixmap,r.x+gfi->fh, r.y+gfi->as,
- lk->all[i].lookup->lookup_name,-1,NULL,0x000000);
- }
- ++lcnt;
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( lcnt>=lk->off_top ) {
- if ( lk->all[i].subtables[j].selected ) {
- r.x = LK_MARGIN; r.width = gfi->lkwidth-2*LK_MARGIN;
- r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh; r.height = gfi->fh;
- GDrawFillRect(pixmap,&r,0xffff00);
- }
- r.x = LK_MARGIN+2*gfi->fh-lk->off_left;
- r.y = LK_MARGIN+(lcnt-lk->off_top)*gfi->fh;
- GDrawDrawText8(pixmap,r.x, r.y+gfi->as,
- lk->all[i].subtables[j].subtable->subtable_name,-1,NULL,0x000000);
- }
- ++lcnt;
- }
- }
- }
- GDrawPopClip(pixmap,&old);
-}
-
-static void LookupDeselect(struct lkdata *lk) {
- int i,j;
-
- for ( i=0; i<lk->cnt; ++i ) {
- lk->all[i].selected = false;
- for ( j=0; j<lk->all[i].subtable_cnt; ++j )
- lk->all[i].subtables[j].selected = false;
- }
-}
-
-static void LookupPopup(GWindow gw,OTLookup *otl,struct lookup_subtable *sub) {
- extern char *lookup_type_names[2][10];
- static char popup_msg[300];
- int pos;
- char *lookuptype;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
- int l;
-
- if ( (otl->lookup_type&0xff)>= 0xf0 ) {
- if ( otl->lookup_type==kern_statemachine )
- lookuptype = _("Kerning State Machine");
- else if ( otl->lookup_type==morx_indic )
- lookuptype = _("Indic State Machine");
- else if ( otl->lookup_type==morx_context )
- lookuptype = _("Contextual State Machine");
- else
- lookuptype = _("Contextual State Machine");
- } else if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
- lookuptype = _(lookup_type_names[otl->lookup_type>>8][otl->lookup_type&0xff]);
- else
- lookuptype = S_("LookupType|Unknown");
- snprintf(popup_msg,sizeof(popup_msg), "%s\n", lookuptype);
- pos = strlen(popup_msg);
-
- if ( sub!=NULL && otl->lookup_type==gpos_pair && sub->kc!=NULL ) {
- snprintf(popup_msg+pos,sizeof(popup_msg)-pos,_("(kerning class)\n") );
- pos += strlen( popup_msg+pos );
- }
-
- if ( otl->features==NULL )
- snprintf(popup_msg+pos,sizeof(popup_msg)-pos,_("Not attached to a feature"));
- else {
- for ( fl=otl->features; fl!=NULL && pos<sizeof(popup_msg)-2; fl=fl->next ) {
- snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c: ",
- fl->featuretag>>24, fl->featuretag>>16,
- fl->featuretag>>8, fl->featuretag&0xff );
- pos += strlen( popup_msg+pos );
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c{",
- sl->script>>24, sl->script>>16,
- sl->script>>8, sl->script&0xff );
- pos += strlen( popup_msg+pos );
- for ( l=0; l<sl->lang_cnt; ++l ) {
- uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
- snprintf(popup_msg+pos,sizeof(popup_msg)-pos,"%c%c%c%c,",
- lang>>24, lang>>16,
- lang>>8, lang&0xff );
- pos += strlen( popup_msg+pos );
- }
- if ( popup_msg[pos-1]==',' )
- popup_msg[pos-1] = '}';
- else if ( pos<sizeof(popup_msg)-2 )
- popup_msg[pos++] = '}';
- if ( pos<sizeof(popup_msg)-2 )
- popup_msg[pos++] = ' ';
- }
- if ( pos<sizeof(popup_msg)-2 )
- popup_msg[pos++] = '\n';
- }
- }
- if ( pos>=sizeof(popup_msg) )
- pos = sizeof(popup_msg)-1;
- popup_msg[pos]='\0';
- GGadgetPreparePopup8(gw,popup_msg);
-}
-
-static void AddDFLT(OTLookup *otl) {
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
- int l;
-
- for ( fl = otl->features; fl!=NULL; fl=fl->next ) {
- int hasDFLT = false, hasdflt=false;
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- if ( sl->script == DEFAULT_SCRIPT )
- hasDFLT = true;
- for ( l=0; l<sl->lang_cnt; ++l ) {
- uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
- if ( lang==DEFAULT_LANG ) {
- hasdflt = true;
- break;
- }
- }
- if ( hasdflt && hasDFLT )
- break;
- }
- if ( hasDFLT /* Already there */ ||
- !hasdflt /* Shouldn't add it */ )
- continue;
- sl = chunkalloc(sizeof(struct scriptlanglist));
- sl->script = DEFAULT_SCRIPT;
- sl->lang_cnt = 1;
- sl->langs[0] = DEFAULT_LANG;
- sl->next = fl->scripts;
- fl->scripts = sl;
- }
-}
-
-static void AALTRemoveOld(SplineFont *sf,struct lkdata *lk) {
- int i;
- FeatureScriptLangList *fl, *prev;
-
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- prev = NULL;
- for ( fl = lk->all[i].lookup->features; fl!=NULL; prev=fl, fl=fl->next ) {
- if ( fl->featuretag==CHR('a','a','l','t') ) {
- if ( fl==lk->all[i].lookup->features && fl->next==NULL )
- lk->all[i].deleted = true;
- else {
- if ( prev==NULL )
- lk->all[i].lookup->features = fl->next;
- else
- prev->next = fl->next;
- fl->next = NULL;
- FeatureScriptLangListFree(fl);
- }
- break;
- }
- }
- }
-}
-
-
-struct sllk { uint32 script; int cnt, max; OTLookup **lookups; int lcnt, lmax; uint32 *langs; };
-
-static void AddOTLToSllk(struct sllk *sllk, OTLookup *otl, struct scriptlanglist *sl) {
- int i,j,k,l;
-
- if ( otl->lookup_type==gsub_single || otl->lookup_type==gsub_alternate ) {
- for ( i=0; i<sllk->cnt; ++i )
- if ( sllk->lookups[i]==otl )
- break;
- if ( i==sllk->cnt ) {
- if ( sllk->cnt>=sllk->max )
- sllk->lookups = grealloc(sllk->lookups,(sllk->max+=5)*sizeof(OTLookup *));
- sllk->lookups[sllk->cnt++] = otl;
- for ( l=0; l<sl->lang_cnt; ++l ) {
- uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
- for ( j=0; j<sllk->lcnt; ++j )
- if ( sllk->langs[j]==lang )
- break;
- if ( j==sllk->lcnt ) {
- if ( sllk->lcnt>=sllk->lmax )
- sllk->langs = grealloc(sllk->langs,(sllk->lmax+=sl->lang_cnt+MAX_LANG)*sizeof(uint32));
- sllk->langs[sllk->lcnt++] = lang;
- }
- }
- }
- } else if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ) {
- struct lookup_subtable *sub;
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- FPST *fpst = sub->fpst;
- for ( j=0; j<fpst->rule_cnt; ++j ) {
- struct fpst_rule *r = &fpst->rules[j];
- for ( k=0; k<r->lookup_cnt; ++k )
- AddOTLToSllk(sllk,r->lookups[k].lookup,sl);
- }
- }
- }
- /* reverse contextual chaining is weird and I shall ignore it. Adobe does too*/
-}
-
-static char *ComponentsFromPSTs(PST **psts,int pcnt) {
- char **names=NULL;
- int ncnt=0, nmax=0;
- int i,j,len;
- char *ret;
-
- /* First find all the names */
- for ( i=0; i<pcnt; ++i ) {
- char *nlist = psts[i]->u.alt.components;
- char *start, *pt, ch;
-
- for ( start = nlist; ; ) {
- while ( *start==' ' )
- ++start;
- if ( *start=='\0' )
- break;
- for ( pt=start; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- for ( j=0; j<ncnt; ++j )
- if ( strcmp( start,names[j])==0 )
- break;
- if ( j==ncnt ) {
- if ( ncnt>=nmax )
- names = grealloc(names,(nmax+=10)*sizeof(char *));
- names[ncnt++] = copy(start);
- }
- *pt = ch;
- start = pt;
- }
- }
-
- len = 0;
- for ( i=0; i<ncnt; ++i )
- len += strlen(names[i])+1;
- if ( len==0 ) len=1;
- ret = galloc(len);
- len = 0;
- for ( i=0; i<ncnt; ++i ) {
- strcpy(ret+len,names[i]);
- len += strlen(names[i]);
- ret[len++] = ' ';
- }
- if ( len==0 )
- *ret = '\0';
- else
- ret[len-1] = '\0';
-
- for ( i=0; i<ncnt; ++i )
- free(names[i]);
- free(names);
-return( ret );
-}
-
-static int SllkMatch(struct sllk *sllk,int s1,int s2) {
- int i;
-
- if ( sllk[s1].cnt != sllk[s2].cnt )
-return( false );
-
- for ( i=0; i<sllk[s1].cnt; ++i ) {
- if ( sllk[s1].lookups[i] != sllk[s2].lookups[i] )
-return( false );
- }
-
-return( true );
-}
-
-static void AALTCreateNew(SplineFont *sf, struct lkdata *lk) {
- /* different script/lang combinations may need different 'aalt' lookups */
- /* well, let's just say different script combinations */
- /* for each script/lang combo find all single/alternate subs for each */
- /* glyph. Merge those choices and create new lookup with that info */
- struct sllk *sllk = NULL;
- int sllk_cnt=0, sllk_max = 0;
- int i,s;
- OTLookup *otl;
- struct lookup_subtable *sub;
- PST **psts, *pst;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
- int l,k,j,gid,pcnt;
- SplineFont *_sf;
- SplineChar *sc;
-
- /* Find all scripts, and all the single/alternate lookups for each */
- /* and all the languages used for these in each script */
- for ( i=0; i<lk->cnt; ++i ) {
- otl = lk->all[i].lookup;
- for ( fl=otl->features; fl!=NULL; fl=fl->next )
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- for ( s=0; s<sllk_cnt; ++s )
- if ( sl->script == sllk[s].script )
- break;
- if ( s==sllk_cnt ) {
- if ( sllk_cnt>=sllk_max )
- sllk = grealloc(sllk,(sllk_max+=10)*sizeof(struct sllk));
- memset(&sllk[sllk_cnt],0,sizeof(struct sllk));
- sllk[sllk_cnt++].script = sl->script;
- }
- AddOTLToSllk(&sllk[s], otl,sl);
- }
- }
- /* Each of these gets its own gsub_alternate lookup which gets inserted */
- /* at the head of the lookup list. Each lookup has one subtable */
- for ( i=0; i<sllk_cnt; ++i ) {
- if ( sllk[i].cnt==0 ) /* Script used, but provides no alternates */
- continue;
- /* Make the new lookup (and all its supporting data structures) */
- otl = chunkalloc(sizeof(OTLookup));
- otl->lookup_type = gsub_alternate;
- otl->lookup_flags = sllk[i].lookups[0]->lookup_flags & pst_r2l;
- otl->features = fl = chunkalloc(sizeof(FeatureScriptLangList));
- fl->featuretag = CHR('a','a','l','t');
- /* Any other scripts with the same lookup set? */
- for ( j=i; j<sllk_cnt; ++j ) {
- if ( i==j || SllkMatch(sllk,i,j)) {
- sl = chunkalloc(sizeof(struct scriptlanglist));
- sl->next = fl->scripts;
- fl->scripts = sl;
- sl->script = sllk[j].script;
- sl->lang_cnt = sllk[j].lcnt;
- if ( sl->lang_cnt>MAX_LANG )
- sl->morelangs = galloc((sl->lang_cnt-MAX_LANG)*sizeof(uint32));
- for ( l=0; l<sl->lang_cnt; ++l )
- if ( l<MAX_LANG )
- sl->langs[l] = sllk[j].langs[l];
- else
- sl->morelangs[l-MAX_LANG] = sllk[j].langs[l];
- if ( i!=j ) sllk[j].cnt = 0; /* Mark as processed */
- }
- }
- otl->subtables = sub = chunkalloc(sizeof(struct lookup_subtable));
- sub->lookup = otl;
- sub->per_glyph_pst_or_kern = true;
-
- /* Add it to the various lists it needs to be in */
- if ( lk->cnt>=lk->max )
- lk->all = grealloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
- for ( k=lk->cnt; k>0; --k )
- lk->all[k] = lk->all[k-1];
- memset(&lk->all[0],0,sizeof(struct lkinfo));
- lk->all[0].lookup = otl;
- lk->all[0].new = true;
- ++lk->cnt;
- otl->next = sf->gsub_lookups;
- sf->gsub_lookups = otl;
-
- /* Now add the new subtable */
- lk->all[0].subtables = gcalloc(1,sizeof(struct lksubinfo));
- lk->all[0].subtable_cnt = lk->all[0].subtable_max = 1;
- lk->all[0].subtables[0].subtable = sub;
- lk->all[0].subtables[0].new = true;
-
- /* Now look at every glyph in the font, and see if it has any of the */
- /* lookups we are interested in, and if it does, build a new pst */
- /* containing all posibilities listed on any of them */
- if ( sf->cidmaster ) sf = sf->cidmaster;
- psts = galloc(sllk[i].cnt*sizeof(PST *));
- k=0;
- do {
- _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
- for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc = _sf->glyphs[gid])!=NULL ) {
- pcnt = 0;
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==NULL )
- continue;
- for ( j=0; j<sllk[i].cnt; ++j )
- if ( pst->subtable->lookup == sllk[i].lookups[j] )
- break;
- if ( j<sllk[i].cnt )
- psts[pcnt++] = pst;
- }
- if ( pcnt==0 )
- continue;
- pst = chunkalloc(sizeof(PST));
- pst->subtable = sub;
- pst->type = pst_alternate;
- pst->next = sc->possub;
- sc->possub = pst;
- pst->u.alt.components = ComponentsFromPSTs(psts,pcnt);
- }
- ++k;
- } while ( k<sf->subfontcnt );
- free(psts);
- NameOTLookup(otl,sf);
- }
-
- for ( i=0; i<sllk_cnt; ++i ) {
- free( sllk[i].langs );
- free( sllk[i].lookups );
- }
- free(sllk);
-}
-
-static void lookupmenu_dispatch(GWindow v, GMenuItem *mi, GEvent *e) {
- GEvent dummy;
- struct gfi_data *gfi = GDrawGetUserData(v);
- int i;
- char *buts[4];
-
- if ( mi->mid==CID_SaveFeat || mi->mid==CID_SaveLookup ) {
- char *filename, *defname;
- FILE *out;
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
- OTLookup *otl = NULL;
-
- if ( mi->mid==CID_SaveLookup ) {
- for ( i=0; i<lk->cnt && (!lk->all[i].selected || lk->all[i].deleted); ++i );
- if ( i==lk->cnt )
-return;
- otl = lk->all[i].lookup;
- }
- defname = strconcat(gfi->sf->fontname,".fea");
- filename = gwwv_save_filename(_("Feature file?"),defname,"*.fea");
- free(defname);
- if ( filename==NULL )
-return;
- /* Convert to def encoding !!! */
- out = fopen(filename,"w");
- if ( out==NULL ) {
- gwwv_post_error(_("Cannot open file"),_("Cannot open %s"), filename );
- free(filename);
-return;
- }
- if ( otl!=NULL )
- FeatDumpOneLookup( out,gfi->sf,otl );
- else
- FeatDumpFontLookups( out,gfi->sf );
- if ( ferror(out)) {
- gwwv_post_error(_("Output error"),_("An error occurred writing %s"), filename );
- free(filename);
- fclose(out);
-return;
- }
- free(filename);
- fclose(out);
- } else if ( mi->mid==CID_AddAllAlternates ) {
- /* First we want to remove any old aalt-only lookups */
- /* (and remove the 'aalt' tag from any lookups with multiple features) */
- /* Then add the new ones */
- struct lkdata *lk = &gfi->tables[0]; /* GSUB */
- int has_aalt_only=false, has_aalt_mixed = false;
- int i, ret;
- FeatureScriptLangList *fl;
-
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- for ( fl = lk->all[i].lookup->features; fl!=NULL; fl=fl->next ) {
- if ( fl->featuretag==CHR('a','a','l','t') ) {
- if ( fl==lk->all[i].lookup->features && fl->next==NULL )
- has_aalt_only = true;
- else
- has_aalt_mixed = true;
- break;
- }
- }
- }
- if ( has_aalt_only || has_aalt_mixed ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[0] = _("_OK"); buts[1] = _("_Cancel"); buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[0] = GTK_STOCK_OK; buts[1] = GTK_STOCK_CANCEL; buts[2] = NULL;
-#endif
- ret = gwwv_ask(has_aalt_only?_("Lookups will be removed"):_("Feature tags will be removed"),
- (const char **) buts,0,1,
- !has_aalt_mixed ?
- _("Warning: There are already some 'aalt' lookups in\n"
- "the font. If you proceed with this command those\n"
- "lookups will be removed and new lookups will be\n"
- "generated. The old information will be LOST.\n"
- " Is that what you want?") :
- !has_aalt_only ?
- _("Warning: There are already some 'aalt' lookups in\n"
- "the font but there are other feature tags associated\n"
- "with these lookups. If you proceed with this command\n"
- "the 'aalt' tag will be removed from those lookups,\n"
- "and new lookups will be generate which will NOT be\n"
- "associated with the other feature tag(s).\n"
- " Is that what you want?") :
- _("Warning: There are already some 'aalt' lookups in\n"
- "the font, some have no other feature tags associated\n"
- "with them and these will be removed, others have other\n"
- "tags associated and these will remain while the 'aalt'\n"
- "tag will be removed from the lookup -- a new lookup\n"
- "will be generated which is not associated with any\n"
- "other feature tags.\n"
- " Is that what you want?") );
- if ( ret==1 )
-return;
- AALTRemoveOld(gfi->sf,lk);
- }
- AALTCreateNew(gfi->sf,lk);
- GDrawRequestExpose(GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+0)),NULL,true);
- } else if ( mi->mid==CID_AddDFLT ) {
- struct selection_bits sel;
- int toall, ret, i;
- char *buts[4];
- int isgpos = GTabSetGetSel(GWidgetGetControl(gfi->gw,CID_Lookups));
- struct lkdata *lk = &gfi->tables[isgpos];
-
- LookupParseSelection(lk,&sel);
-#if defined(FONTFORGE_CONFIG_GDRAW)
- if ( sel.lookup_cnt==0 ) {
- buts[0] = _("_Apply to All"); buts[1] = _("_Cancel"); buts[2]=NULL;
- } else {
- buts[0] = _("_Apply to All"); buts[1] = _("_Apply to Selection"); buts[2] = _("_Cancel"); buts[3]=NULL;
- }
-#elif defined(FONTFORGE_CONFIG_GTK)
- if ( sel.lookup_cnt==0 ) {
- buts[0] = _("_Apply to All"); buts[1] = GTK_STOCK_CANCEL; buts[2]=NULL;
- } else {
- buts[0] = _("_Apply to All"); buts[1] = _("_Apply to Selection"); buts[2] = GTK_STOCK_CANCEL; buts[3]=NULL;
- }
-#endif
- ret = gwwv_ask(_("Apply to:"),(const char **) buts,0,sel.lookup_cnt==0?1:2,_("Apply change to which lookups?"));
- toall = false;
- if ( ret==0 )
- toall = true;
- else if ( (ret==1 && sel.lookup_cnt==0) || (ret==2 && sel.lookup_cnt!=0))
-return;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( lk->all[i].selected || toall ) {
- AddDFLT(lk->all[i].lookup);
- }
- }
- } else {
- memset(&dummy,0,sizeof(dummy));
- dummy.type = et_controlevent;
- dummy.u.control.subtype = et_buttonpress;
- dummy.u.control.g = GWidgetGetControl(gfi->gw,mi->mid);
- dummy.w = GGadgetGetWindow(dummy.u.control.g);
- dummy.u.control.u.button.button = e->u.mouse.button;
- GGadgetDispatchEvent(dummy.u.control.g,&dummy);
- }
-}
-
-static GMenuItem lookuppopupmenu[] = {
- { { (unichar_t *) N_("_Top"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupTop },
- { { (unichar_t *) N_("_Up"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupUp },
- { { (unichar_t *) N_("_Down"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupDown },
- { { (unichar_t *) N_("_Bottom"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupBottom },
- { { (unichar_t *) N_("_Sort"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_LookupSort },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Add _Lookup"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddLookup },
- { { (unichar_t *) N_("Add Sub_table"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddSubtable },
- { { (unichar_t *) N_("Edit _Metadata"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_EditMetadata },
- { { (unichar_t *) N_("_Edit Data"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_EditSubtable },
- { { (unichar_t *) N_("De_lete"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_DeleteLookup },
- { { (unichar_t *) N_("_Merge"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_MergeLookup },
- { { (unichar_t *) N_("Sa_ve Lookup"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_SaveLookup },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Add 'aalt' features"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddAllAlternates },
- { { (unichar_t *) N_("Add 'D_FLT' script"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_AddDFLT },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Revert All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_RevertLookups },
- { { (unichar_t *) N_("_Import"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_RevertLookups },
- { { (unichar_t *) N_("S_ave Feature File"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, lookupmenu_dispatch, CID_SaveFeat },
- { NULL }};
-
-static void LookupMenu(struct gfi_data *gfi,struct lkdata *lk,GEvent *event) {
- struct selection_bits sel;
- int i,j;
-
- LookupParseSelection(lk,&sel);
- for ( i=0; lookuppopupmenu[i].ti.text!=NULL || lookuppopupmenu[i].ti.line; ++i ) {
- switch ( lookuppopupmenu[i].mid ) {
- case 0:
- /* Lines */;
- break;
- case CID_LookupTop:
- lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt!=1;
- break;
- case CID_LookupUp:
- lookuppopupmenu[i].ti.disabled = sel.any_first || sel.lookup_cnt+sel.sub_cnt==0;
- break;
- case CID_LookupDown:
- lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt==0;
- break;
- case CID_LookupBottom:
- lookuppopupmenu[i].ti.disabled = sel.any_last || sel.lookup_cnt+sel.sub_cnt!=1;
- break;
- case CID_LookupSort:
- lookuppopupmenu[i].ti.disabled = lk->cnt<=1;
- break;
- case CID_AddLookup:
- lookuppopupmenu[i].ti.disabled = sel.lookup_cnt+sel.sub_cnt>1;
- break;
- case CID_AddSubtable:
- lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt>1) && (sel.lookup_cnt!=0 || sel.sub_cnt!=1);
- break;
- case CID_EditMetadata:
- lookuppopupmenu[i].ti.disabled = (sel.lookup_cnt!=1 || sel.sub_cnt!=0) &&
- (sel.lookup_cnt!=0 || sel.sub_cnt!=1);
- break;
- case CID_EditSubtable:
- lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=0 || sel.sub_cnt!=1;
- break;
- case CID_DeleteLookup:
- lookuppopupmenu[i].ti.disabled = sel.lookup_cnt==0 && sel.sub_cnt==0;
- break;
- case CID_MergeLookup:
- lookuppopupmenu[i].ti.disabled = !(
- (sel.lookup_cnt>=2 && sel.sub_cnt==0 && sel.lookup_mergeable) ||
- (sel.lookup_cnt==0 && sel.sub_cnt>=2 && sel.sub_table_mergeable) );
- break;
- case CID_RevertLookups:
- lookuppopupmenu[i].ti.disabled = false;
- break;
- case CID_SaveLookup:
- lookuppopupmenu[i].ti.disabled = sel.lookup_cnt!=1 || sel.sub_cnt!=0;
- for ( j=0; j<lk->cnt; ++j ) if ( lk->all[j].selected ) {
- int type = lk->all[j].lookup->lookup_type;
- if ( type==kern_statemachine || type==morx_indic ||
- type==morx_context || type==morx_insert )
- lookuppopupmenu[i].ti.disabled = true;
- break;
- }
- break;
- case CID_AddDFLT:
- lookuppopupmenu[i].ti.disabled = lk->cnt==0;
- break;
- case CID_AddAllAlternates:
- lookuppopupmenu[i].ti.disabled = lk->cnt==0 || lk==&gfi->tables[1]/*Only applies to GSUB*/;
- break;
- case CID_SaveFeat:
- lookuppopupmenu[i].ti.disabled = lk->cnt<=1;
- break;
- }
- }
- GMenuCreatePopupMenu(event->w,event, lookuppopupmenu);
-}
-
-
-static void LookupMouse(struct gfi_data *gfi, int isgpos, GEvent *event) {
- struct lkdata *lk = &gfi->tables[isgpos];
- int l = (event->u.mouse.y-LK_MARGIN)/gfi->fh + lk->off_top;
- int inbox = event->u.mouse.x>=LK_MARGIN &&
- event->u.mouse.x>=LK_MARGIN-lk->off_left &&
- event->u.mouse.x<=LK_MARGIN-lk->off_left+gfi->as+1;
- GWindow gw = GDrawableGetWindow(GWidgetGetControl(gfi->gw,CID_LookupWin+isgpos));
- int i,j,lcnt;
-
- if ( l<0 || event->u.mouse.y>=(gfi->lkheight-2*LK_MARGIN) )
-return;
-
- lcnt = 0;
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- if ( l==lcnt ) {
- if ( event->type==et_mouseup )
-return;
- else if ( event->type==et_mousemove ) {
- LookupPopup(gw,lk->all[i].lookup,NULL);
-return;
- } else {
- if ( inbox || event->u.mouse.clicks>1 ) {
- lk->all[i].open = !lk->all[i].open;
- GFI_LookupScrollbars(gfi, isgpos, true);
-return;
- }
- if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
- LookupDeselect(lk);
- lk->all[i].selected = true;
- } else
- lk->all[i].selected = !lk->all[i].selected;
- GFI_LookupEnableButtons(gfi,isgpos);
- GDrawRequestExpose(gw,NULL,true);
- if ( event->u.mouse.button==3 )
- LookupMenu(gfi,lk,event);
-return;
- }
- }
- ++lcnt;
- if ( lk->all[i].open ) {
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted )
- continue;
- if ( l==lcnt ) {
- if ( event->type==et_mouseup )
-return;
- else if ( event->type==et_mousemove ) {
- LookupPopup(gw,lk->all[i].lookup,lk->all[i].subtables[j].subtable);
-return;
- } else {
- if ( inbox )
-return; /* Can't open this guy */
- if ( event->u.mouse.clicks>1 )
- LookupSubtableContents(gfi,isgpos);
- else {
- if ( !(event->u.mouse.state&(ksm_shift|ksm_control)) ) {
- LookupDeselect(lk);
- lk->all[i].subtables[j].selected = true;
- } else
- lk->all[i].subtables[j].selected = !lk->all[i].subtables[j].selected;
- GFI_LookupEnableButtons(gfi,isgpos);
- GDrawRequestExpose(gw,NULL,true);
- if ( event->u.mouse.button==3 )
- LookupMenu(gfi,lk,event);
- }
-return;
- }
- }
- ++lcnt;
- }
- }
- }
-}
-
-static int lookups_e_h(GWindow gw, GEvent *event, int isgpos) {
- struct gfi_data *gfi = GDrawGetUserData(gw);
-
- if (( event->type==et_mouseup || event->type==et_mousedown ) &&
- (event->u.mouse.button==4 || event->u.mouse.button==5) ) {
-return( GGadgetDispatchEvent(GWidgetGetControl(gw,CID_LookupVSB+isgpos),event));
- }
-
- switch ( event->type ) {
- case et_char:
-return( GFI_Char(gfi,event) );
- case et_expose:
- LookupExpose(gw,gfi,isgpos);
- break;
- case et_mousedown: case et_mousemove: case et_mouseup:
- LookupMouse(gfi,isgpos,event);
- break;
- case et_resize: {
- GRect r;
- GDrawGetSize(gw,&r);
- gfi->lkheight = r.height; gfi->lkwidth = r.width;
- GFI_LookupScrollbars(gfi,false,false);
- GFI_LookupScrollbars(gfi,true,false);
- }
- break;
- }
-return( true );
-}
-
-static int gposlookups_e_h(GWindow gw, GEvent *event) {
-return( lookups_e_h(gw,event,true));
-}
-
-static int gsublookups_e_h(GWindow gw, GEvent *event) {
-return( lookups_e_h(gw,event,false));
-}
-
-void FontInfo(SplineFont *sf,int defaspect,int sync) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GTabInfo aspects[22], vaspects[5], lkaspects[3];
- GGadgetCreateData mgcd[10], ngcd[17], psgcd[30], tngcd[8],
- pgcd[8], vgcd[19], pangcd[22], comgcd[3], txgcd[23],
- mfgcd[8], mcgcd[8], szgcd[19], mkgcd[5], metgcd[29], vagcd[3], ssgcd[23],
- xugcd[7], dgcd[6], ugcd[4], gaspgcd[5], gaspgcd_def[2], lksubgcd[2][4],
- lkgcd[2], lkbuttonsgcd[15];
- GGadgetCreateData mb[2], mb2, nb[2], nb2, nb3, xub[2], psb[2], psb2[3], ppbox[3],
- vbox[4], metbox[2], ssbox[2], panbox[2], combox[2], mkbox[3],
- txbox[5], ubox[2], dbox[2],
- mcbox[3], mfbox[3], szbox[6], tnboxes[4], gaspboxes[3],
- lkbox[7];
- GGadgetCreateData *marray[7], *marray2[9], *narray[26], *narray2[7], *narray3[3],
- *xuarray[13], *psarray[10], *psarray2[21], *psarray3[3], *psarray4[10],
- *ppbuttons[5], *pparray[4], *vradio[5], *varray[38], *metarray[46],
- *ssarray[58], *panarray[38], *comarray[2],
- *mkarray[3], *mkarray2[4], *txarray[5], *txarray2[30],
- *txarray3[6], *txarray4[6], *uarray[3], *darray[10],
- *mcarray[13], *mcarray2[7],
- *mfarray[14], *szarray[7], *szarray2[5], *szarray3[7],
- *szarray4[4], *szarray5[6], *tnvarray[4], *tnharray[6], *tnharray2[5], *gaspharray[6],
- *gaspvarray[3], *lkarray[2][7], *lkbuttonsarray[17], *lkharray[3];
- GTextInfo mlabel[10], nlabel[16], pslabel[30], tnlabel[7],
- plabel[8], vlabel[19], panlabel[22], comlabel[3], txlabel[23],
- mflabel[8], mclabel[8], szlabel[17], mklabel[5], metlabel[28],
- sslabel[23], xulabel[6], dlabel[5], ulabel[1], gasplabel[5],
- lkbuttonslabel[14];
- GTextInfo *namelistnames;
- struct gfi_data *d;
- char iabuf[20], upbuf[20], uwbuf[20], asbuf[20], dsbuf[20],
- vbuf[20], uibuf[12], vorig[20], embuf[20];
- char dszbuf[20], dsbbuf[20], dstbuf[21], sibuf[20], swbuf[20];
- int i,j,k, psrow;
- int mcs;
- char title[130];
- /* static unichar_t monospace[] = { 'c','o','u','r','i','e','r',',','m', 'o', 'n', 'o', 's', 'p', 'a', 'c', 'e',',','c','a','s','l','o','n',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };*/
- static unichar_t sans[] = { 'h','e','l','v','e','t','i','c','a',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };
- FontRequest rq;
- int as, ds, ld;
- char **nlnames;
- char createtime[200], modtime[200];
- unichar_t *tmpcreatetime, *tmpmodtime;
- time_t t;
- const struct tm *tm;
- struct matrixinit mi, gaspmi;
-
- FontInfoInit();
-
- if ( sf->fontinfo!=NULL ) {
- GDrawSetVisible(((struct gfi_data *) (sf->fontinfo))->gw,true);
- GDrawRaise( ((struct gfi_data *) (sf->fontinfo))->gw );
-return;
- }
- if ( defaspect==-1 )
- defaspect = last_aspect;
-
- d = gcalloc(1,sizeof(struct gfi_data));
- sf->fontinfo = d;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.is_dlg = true;
- if ( sync ) {
- wattrs.mask |= wam_restrict;
- wattrs.restrict_input_to_me = 1;
- }
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- snprintf(title,sizeof(title),_("Font Information for %.90s"),
- sf->fontname);
- wattrs.utf8_window_title = title;
- pos.x = pos.y = 0;
-#ifndef FONTFORGE_CONFIG_INFO_HORIZONTAL
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268+85));
-#else
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268));
-#endif
- pos.height = GDrawPointsToPixels(NULL,375);
- gw = GDrawCreateTopWindow(NULL,&pos,e_h,d,&wattrs);
-
- d->sf = sf;
- d->gw = gw;
- d->old_sel = -2;
- d->texdata = sf->texdata;
-
- memset(&nlabel,0,sizeof(nlabel));
- memset(&ngcd,0,sizeof(ngcd));
-
- nlabel[0].text = (unichar_t *) _("Fo_ntname:");
- nlabel[0].text_is_1byte = true;
- nlabel[0].text_in_resource = true;
- ngcd[0].gd.label = &nlabel[0];
- ngcd[0].gd.pos.x = 12; ngcd[0].gd.pos.y = 6+6;
- ngcd[0].gd.flags = gg_visible | gg_enabled;
- ngcd[0].creator = GLabelCreate;
-
- ngcd[1].gd.pos.x = 115; ngcd[1].gd.pos.y = ngcd[0].gd.pos.y-6; ngcd[1].gd.pos.width = 137;
- ngcd[1].gd.flags = gg_visible | gg_enabled;
- nlabel[1].text = (unichar_t *) sf->fontname;
- nlabel[1].text_is_1byte = true;
- ngcd[1].gd.label = &nlabel[1];
- ngcd[1].gd.cid = CID_Fontname;
- ngcd[1].gd.handle_controlevent = GFI_NameChange;
- ngcd[1].creator = GTextFieldCreate;
-
- nlabel[2].text = (unichar_t *) _("_Family Name:");
- nlabel[2].text_is_1byte = true;
- nlabel[2].text_in_resource = true;
- ngcd[2].gd.label = &nlabel[2];
- ngcd[2].gd.pos.x = 12; ngcd[2].gd.pos.y = ngcd[0].gd.pos.y+26;
- ngcd[2].gd.flags = gg_visible | gg_enabled;
- ngcd[2].creator = GLabelCreate;
-
- ngcd[3].gd.pos.x = ngcd[1].gd.pos.x; ngcd[3].gd.pos.y = ngcd[2].gd.pos.y-6; ngcd[3].gd.pos.width = 137;
- ngcd[3].gd.flags = gg_visible | gg_enabled;
- nlabel[3].text = (unichar_t *) (sf->familyname?sf->familyname:sf->fontname);
- nlabel[3].text_is_1byte = true;
- ngcd[3].gd.label = &nlabel[3];
- ngcd[3].gd.cid = CID_Family;
- ngcd[3].gd.handle_controlevent = GFI_FamilyChange;
- ngcd[3].creator = GTextFieldCreate;
- if ( sf->familyname==NULL || strstr(sf->familyname,"Untitled")==sf->familyname )
- d->family_untitled = true;
-
- ngcd[4].gd.pos.x = 12; ngcd[4].gd.pos.y = ngcd[3].gd.pos.y+26+6;
- nlabel[4].text = (unichar_t *) _("Name For Human_s:");
- nlabel[4].text_is_1byte = true;
- nlabel[4].text_in_resource = true;
- ngcd[4].gd.label = &nlabel[4];
- ngcd[4].gd.flags = gg_visible | gg_enabled;
- ngcd[4].creator = GLabelCreate;
-
- ngcd[5].gd.pos.x = 115; ngcd[5].gd.pos.y = ngcd[4].gd.pos.y-6; ngcd[5].gd.pos.width = 137;
- ngcd[5].gd.flags = gg_visible | gg_enabled;
- nlabel[5].text = (unichar_t *) (sf->fullname?sf->fullname:sf->fontname);
- nlabel[5].text_is_1byte = true;
- ngcd[5].gd.label = &nlabel[5];
- ngcd[5].gd.cid = CID_Human;
- ngcd[5].gd.handle_controlevent = GFI_HumanChange;
- ngcd[5].creator = GTextFieldCreate;
- if ( sf->fullname==NULL || strstr(sf->fullname,"Untitled")==sf->fullname )
- d->human_untitled = true;
-
- nlabel[6].text = (unichar_t *) _("_Weight");
- nlabel[6].text_is_1byte = true;
- nlabel[6].text_in_resource = true;
- ngcd[6].gd.label = &nlabel[6];
- ngcd[6].gd.pos.x = ngcd[4].gd.pos.x; ngcd[6].gd.pos.y = ngcd[4].gd.pos.y+26;
- ngcd[6].gd.flags = gg_visible | gg_enabled;
- ngcd[6].creator = GLabelCreate;
-
- ngcd[7].gd.pos.x = ngcd[1].gd.pos.x; ngcd[7].gd.pos.y = ngcd[6].gd.pos.y-6; ngcd[7].gd.pos.width = 137;
- ngcd[7].gd.flags = gg_visible | gg_enabled;
- nlabel[7].text = (unichar_t *) (sf->weight?sf->weight:"Regular");
- nlabel[7].text_is_1byte = true;
- ngcd[7].gd.label = &nlabel[7];
- ngcd[7].gd.cid = CID_Weight;
- ngcd[7].creator = GTextFieldCreate;
-
- ngcd[8].gd.pos.x = 12; ngcd[8].gd.pos.y = ngcd[6].gd.pos.y+26;
- nlabel[8].text = (unichar_t *) _("_Version:");
- nlabel[8].text_is_1byte = true;
- nlabel[8].text_in_resource = true;
- ngcd[8].gd.label = &nlabel[8];
- ngcd[8].gd.flags = gg_visible | gg_enabled;
- ngcd[8].creator = GLabelCreate;
-
- ngcd[9].gd.pos.x = 115; ngcd[9].gd.pos.y = ngcd[8].gd.pos.y-6; ngcd[9].gd.pos.width = 137;
- ngcd[9].gd.flags = gg_visible | gg_enabled;
- nlabel[9].text = (unichar_t *) (sf->version?sf->version:"");
- nlabel[9].text_is_1byte = true;
- if ( sf->subfontcnt!=0 ) {
- sprintf( vbuf,"%g", sf->cidversion );
- nlabel[9].text = (unichar_t *) vbuf;
- }
- ngcd[9].gd.label = &nlabel[9];
- ngcd[9].gd.cid = CID_Version;
- ngcd[9].creator = GTextFieldCreate;
-
- ngcd[10].gd.pos.x = 12; ngcd[10].gd.pos.y = ngcd[8].gd.pos.y+28;
- nlabel[10].text = (unichar_t *) _("_Base Filename:");
- nlabel[10].text_is_1byte = true;
- nlabel[10].text_in_resource = true;
- ngcd[10].gd.label = &nlabel[10];
- ngcd[10].gd.popup_msg = (unichar_t *) _("Use this as the default base for the filename\nwhen generating a font." );
- ngcd[10].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- ngcd[10].creator = GLabelCreate;
-
- ngcd[11].gd.pos.x = 95; ngcd[11].gd.pos.y = ngcd[10].gd.pos.y-11;
-/* GT: The space in front of "Same" makes things line up better */
- nlabel[11].text = (unichar_t *) _(" Same as Fontname");
- nlabel[11].text_is_1byte = true;
- ngcd[11].gd.label = &nlabel[11];
- ngcd[11].gd.flags = sf->defbasefilename==NULL ? (gg_visible | gg_enabled | gg_cb_on ) : (gg_visible | gg_enabled);
- ngcd[11].gd.cid = CID_SameAsFontname;
- ngcd[11].creator = GRadioCreate;
-
- ngcd[12].gd.pos.x = 95; ngcd[12].gd.pos.y = ngcd[10].gd.pos.y+11;
- nlabel[12].text = (unichar_t *) "";
- nlabel[12].text_is_1byte = true;
- ngcd[12].gd.label = &nlabel[12];
- ngcd[12].gd.flags = sf->defbasefilename!=NULL ?
- (gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold ) :
- (gg_visible | gg_enabled | gg_rad_continueold);
- ngcd[12].gd.cid = CID_HasDefBase;
- ngcd[12].creator = GRadioCreate;
-
- ngcd[13].gd.pos.x = 115; ngcd[13].gd.pos.y = ngcd[12].gd.pos.y-4; ngcd[13].gd.pos.width = 137;
- ngcd[13].gd.flags = gg_visible | gg_enabled;
- nlabel[13].text = (unichar_t *) (sf->defbasefilename?sf->defbasefilename:"");
- nlabel[13].text_is_1byte = true;
- ngcd[13].gd.label = &nlabel[13];
- ngcd[13].gd.cid = CID_DefBaseName;
- ngcd[13].gd.handle_controlevent = GFI_DefBaseChange;
- ngcd[13].creator = GTextFieldCreate;
-
- ngcd[14].gd.pos.x = 12; ngcd[14].gd.pos.y = ngcd[10].gd.pos.y+22;
- ngcd[14].gd.flags = gg_visible | gg_enabled;
- nlabel[14].text = (unichar_t *) _("Copy_right:");
- nlabel[14].text_is_1byte = true;
- nlabel[14].text_in_resource = true;
- ngcd[14].gd.label = &nlabel[14];
- ngcd[14].creator = GLabelCreate;
-
- ngcd[15].gd.pos.x = 12; ngcd[15].gd.pos.y = ngcd[14].gd.pos.y+14;
- ngcd[15].gd.pos.width = ngcd[5].gd.pos.x+ngcd[5].gd.pos.width-26;
- ngcd[15].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
- if ( sf->copyright!=NULL ) {
- nlabel[15].text = (unichar_t *) sf->copyright;
- nlabel[15].text_is_1byte = true;
- ngcd[15].gd.label = &nlabel[15];
- }
- ngcd[15].gd.cid = CID_Notice;
- ngcd[15].creator = GTextAreaCreate;
-
- memset(&nb,0,sizeof(nb)); memset(&nb2,0,sizeof(nb2)); memset(&nb3,0,sizeof(nb3));
-
- narray3[0] = &ngcd[12]; narray3[1] = &ngcd[13]; narray3[2] = NULL;
-
- narray2[0] = &ngcd[10]; narray2[1] = &ngcd[11]; narray2[2] = NULL;
- narray2[3] = GCD_RowSpan; narray2[4] = &nb3; narray2[5] = NULL;
- narray2[6] = NULL;
-
- narray[0] = &ngcd[0]; narray[1] = &ngcd[1]; narray[2] = NULL;
- narray[3] = &ngcd[2]; narray[4] = &ngcd[3]; narray[5] = NULL;
- narray[6] = &ngcd[4]; narray[7] = &ngcd[5]; narray[8] = NULL;
- narray[9] = &ngcd[6]; narray[10] = &ngcd[7]; narray[11] = NULL;
- narray[12] = &ngcd[8]; narray[13] = &ngcd[9]; narray[14] = NULL;
- narray[15] = &nb2; narray[16] = GCD_ColSpan; narray[17] = NULL;
- narray[18] = &ngcd[14]; narray[19] = GCD_ColSpan; narray[20] = NULL;
- narray[21] = &ngcd[15]; narray[22] = GCD_ColSpan; narray[23] = NULL;
- narray[24] = NULL;
-
- nb3.gd.flags = gg_enabled|gg_visible;
- nb3.gd.u.boxelements = narray3;
- nb3.creator = GHBoxCreate;
-
- nb2.gd.flags = gg_enabled|gg_visible;
- nb2.gd.u.boxelements = narray2;
- nb2.creator = GHVBoxCreate;
-
- nb[0].gd.flags = gg_enabled|gg_visible;
- nb[0].gd.u.boxelements = narray;
- nb[0].creator = GHVBoxCreate;
-
-/******************************************************************************/
- memset(&xulabel,0,sizeof(xulabel));
- memset(&xugcd,0,sizeof(xugcd));
-
- xugcd[0].gd.pos.x = 12; xugcd[0].gd.pos.y = 10+6;
- xugcd[0].gd.flags = gg_visible | gg_enabled;
- xulabel[0].text = (unichar_t *) _("_XUID:");
- xulabel[0].text_is_1byte = true;
- xulabel[0].text_in_resource = true;
- xugcd[0].gd.label = &xulabel[0];
- xugcd[0].creator = GLabelCreate;
-
- xugcd[1].gd.pos.x = 103; xugcd[1].gd.pos.y = xugcd[0].gd.pos.y-6; xugcd[1].gd.pos.width = 142;
- xugcd[1].gd.flags = gg_visible | gg_enabled;
- if ( sf->xuid!=NULL ) {
- xulabel[1].text = (unichar_t *) sf->xuid;
- xulabel[1].text_is_1byte = true;
- xugcd[1].gd.label = &xulabel[1];
- }
- xugcd[1].gd.cid = CID_XUID;
- xugcd[1].creator = GTextFieldCreate;
-
- xugcd[2].gd.pos.x = 12; xugcd[2].gd.pos.y = xugcd[1].gd.pos.y+26+6;
- xulabel[2].text = (unichar_t *) _("_UniqueID:");
- xulabel[2].text_is_1byte = true;
- xulabel[2].text_in_resource = true;
- xugcd[2].gd.label = &xulabel[2];
- xugcd[2].gd.flags = gg_visible | gg_enabled;
- xugcd[2].creator = GLabelCreate;
-
- xugcd[3].gd.pos.x = xugcd[1].gd.pos.x; xugcd[3].gd.pos.y = xugcd[2].gd.pos.y-6; xugcd[3].gd.pos.width = 80;
- xugcd[3].gd.flags = gg_visible | gg_enabled;
- xulabel[3].text = (unichar_t *) "";
- xulabel[3].text_is_1byte = true;
- if ( sf->uniqueid!=0 ) {
- sprintf( uibuf, "%d", sf->uniqueid );
- xulabel[3].text = (unichar_t *) uibuf;
- }
- xugcd[3].gd.label = &xulabel[3];
- xugcd[3].gd.cid = CID_UniqueID;
- xugcd[3].creator = GTextFieldCreate;
-
- xugcd[4].gd.pos.x = 8; xugcd[4].gd.pos.y = xugcd[3].gd.pos.y+26+6;
- xulabel[4].text = (unichar_t *) _("(Adobe now considers XUID/UniqueID unnecessary)");
- xulabel[4].text_is_1byte = true;
- xulabel[4].text_in_resource = true;
- xugcd[4].gd.label = &xulabel[4];
- xugcd[4].gd.flags = gg_visible | gg_enabled;
- xugcd[4].creator = GLabelCreate;
-
- xuarray[0] = &xugcd[0]; xuarray[1] = &xugcd[1]; xuarray[2] = NULL;
- xuarray[3] = &xugcd[2]; xuarray[4] = &xugcd[3]; xuarray[5] = NULL;
- xuarray[6] = &xugcd[4]; xuarray[7] = GCD_ColSpan; xuarray[8] = NULL;
- xuarray[9] = GCD_Glue; xuarray[10] = GCD_Glue; xuarray[11] = NULL;
- xuarray[12] = NULL;
-
- memset(xub,0,sizeof(xub));
- xub[0].gd.flags = gg_enabled|gg_visible;
- xub[0].gd.u.boxelements = xuarray;
- xub[0].creator = GHVBoxCreate;
-
-/******************************************************************************/
- memset(&pslabel,0,sizeof(pslabel));
- memset(&psgcd,0,sizeof(psgcd));
-
- psgcd[0].gd.pos.x = 12; psgcd[0].gd.pos.y = 12;
- psgcd[0].gd.flags = gg_visible | gg_enabled;
- pslabel[0].text = (unichar_t *) _("_Ascent:");
- pslabel[0].text_is_1byte = true;
- pslabel[0].text_in_resource = true;
- psgcd[0].gd.label = &pslabel[0];
- psgcd[0].creator = GLabelCreate;
-
- psgcd[1].gd.pos.x = 103; psgcd[1].gd.pos.y = psgcd[0].gd.pos.y-6; psgcd[1].gd.pos.width = 47;
- psgcd[1].gd.flags = gg_visible | gg_enabled;
- sprintf( asbuf, "%d", sf->ascent );
- pslabel[1].text = (unichar_t *) asbuf;
- pslabel[1].text_is_1byte = true;
- psgcd[1].gd.label = &pslabel[1];
- psgcd[1].gd.cid = CID_Ascent;
- psgcd[1].gd.handle_controlevent = GFI_EmChanged;
- psgcd[1].creator = GTextFieldCreate;
-
- psgcd[2].gd.pos.x = 155; psgcd[2].gd.pos.y = psgcd[0].gd.pos.y;
- psgcd[2].gd.flags = gg_visible | gg_enabled;
- pslabel[2].text = (unichar_t *) _("_Descent:");
- pslabel[2].text_is_1byte = true;
- pslabel[2].text_in_resource = true;
- psgcd[2].gd.label = &pslabel[2];
- psgcd[2].creator = GLabelCreate;
-
- psgcd[3].gd.pos.x = 200; psgcd[3].gd.pos.y = psgcd[1].gd.pos.y; psgcd[3].gd.pos.width = 47;
- psgcd[3].gd.flags = gg_visible | gg_enabled;
- sprintf( dsbuf, "%d", sf->descent );
- pslabel[3].text = (unichar_t *) dsbuf;
- pslabel[3].text_is_1byte = true;
- psgcd[3].gd.label = &pslabel[3];
- psgcd[3].gd.cid = CID_Descent;
- psgcd[3].gd.handle_controlevent = GFI_EmChanged;
- psgcd[3].creator = GTextFieldCreate;
-
- psgcd[4].gd.pos.x = psgcd[0].gd.pos.x+5; psgcd[4].gd.pos.y = psgcd[0].gd.pos.y+24;
- psgcd[4].gd.flags = gg_visible | gg_enabled;
- pslabel[4].text = (unichar_t *) _(" _Em Size:");
- pslabel[4].text_is_1byte = true;
- pslabel[4].text_in_resource = true;
- psgcd[4].gd.label = &pslabel[4];
- psgcd[4].creator = GLabelCreate;
-
- psgcd[5].gd.pos.x = psgcd[1].gd.pos.x-20; psgcd[5].gd.pos.y = psgcd[1].gd.pos.y+24; psgcd[5].gd.pos.width = 67;
- psgcd[5].gd.flags = gg_visible | gg_enabled;
- sprintf( embuf, "%d", sf->descent+sf->ascent );
- pslabel[5].text = (unichar_t *) embuf;
- pslabel[5].text_is_1byte = true;
- psgcd[5].gd.label = &pslabel[5];
- psgcd[5].gd.cid = CID_Em;
- psgcd[5].gd.u.list = emsizes;
- psgcd[5].gd.handle_controlevent = GFI_EmChanged;
- psgcd[5].creator = GListFieldCreate;
-
- psgcd[6].gd.pos.x = psgcd[2].gd.pos.x; psgcd[6].gd.pos.y = psgcd[4].gd.pos.y-4;
- psgcd[6].gd.flags = gg_visible | gg_enabled | gg_cb_on;
- pslabel[6].text = (unichar_t *) _("_Scale Outlines");
- pslabel[6].text_is_1byte = true;
- pslabel[6].text_in_resource = true;
- psgcd[6].gd.label = &pslabel[6];
- psgcd[6].gd.cid = CID_Scale;
- psgcd[6].creator = GCheckBoxCreate;
-
-/* I've reversed the label, text field order in the gcd here because */
-/* that way the text field will be displayed on top of the label rather */
-/* than the reverse, and in Russian that's important translation of */
-/* "Italic Angle" is too long. Oops, no it's the next one, might as well leave in here though */
- psgcd[8].gd.pos.x = 12; psgcd[8].gd.pos.y = psgcd[5].gd.pos.y+26+6;
- psgcd[8].gd.flags = gg_visible | gg_enabled;
- pslabel[8].text = (unichar_t *) _("_Italic Angle:");
- pslabel[8].text_is_1byte = true;
- pslabel[8].text_in_resource = true;
- psgcd[8].gd.label = &pslabel[8];
- psgcd[8].creator = GLabelCreate;
-
- psgcd[7].gd.pos.x = 103; psgcd[7].gd.pos.y = psgcd[8].gd.pos.y-6;
- psgcd[7].gd.pos.width = 47;
- psgcd[7].gd.flags = gg_visible | gg_enabled;
- sprintf( iabuf, "%g", (double) sf->italicangle );
- pslabel[7].text = (unichar_t *) iabuf;
- pslabel[7].text_is_1byte = true;
- psgcd[7].gd.label = &pslabel[7];
- psgcd[7].gd.cid = CID_ItalicAngle;
- psgcd[7].creator = GTextFieldCreate;
-
- psgcd[9].gd.pos.y = psgcd[7].gd.pos.y;
- psgcd[9].gd.pos.width = -1; psgcd[9].gd.pos.height = 0;
- psgcd[9].gd.pos.x = psgcd[3].gd.pos.x+psgcd[3].gd.pos.width-
- GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- /*if ( strstrmatch(sf->fontname,"Italic")!=NULL ||strstrmatch(sf->fontname,"Oblique")!=NULL )*/
- psgcd[9].gd.flags = gg_visible | gg_enabled;
- pslabel[9].text = (unichar_t *) _("_Guess");
- pslabel[9].text_is_1byte = true;
- pslabel[9].text_in_resource = true;
- psgcd[9].gd.label = &pslabel[9];
- psgcd[9].gd.handle_controlevent = GFI_GuessItalic;
- psgcd[9].creator = GButtonCreate;
-
-/* I've reversed the label, text field order in the gcd here because */
-/* that way the text field will be displayed on top of the label rather */
-/* than the reverse, and in Russian that's important translation of */
-/* "Underline position" is too long. */
- psgcd[11].gd.pos.x = 12; psgcd[11].gd.pos.y = psgcd[7].gd.pos.y+26+6;
- psgcd[11].gd.flags = gg_visible | gg_enabled;
- pslabel[11].text = (unichar_t *) _("Underline _Position:");
- pslabel[11].text_is_1byte = true;
- pslabel[11].text_in_resource = true;
- psgcd[11].gd.label = &pslabel[11];
- psgcd[11].creator = GLabelCreate;
-
- psgcd[10].gd.pos.x = 103; psgcd[10].gd.pos.y = psgcd[11].gd.pos.y-6; psgcd[10].gd.pos.width = 47;
- psgcd[10].gd.flags = gg_visible | gg_enabled;
- sprintf( upbuf, "%g", (double) sf->upos );
- pslabel[10].text = (unichar_t *) upbuf;
- pslabel[10].text_is_1byte = true;
- psgcd[10].gd.label = &pslabel[10];
- psgcd[10].gd.cid = CID_UPos;
- psgcd[10].creator = GTextFieldCreate;
-
- psgcd[12].gd.pos.x = 155; psgcd[12].gd.pos.y = psgcd[11].gd.pos.y;
- psgcd[12].gd.flags = gg_visible | gg_enabled;
- pslabel[12].text = (unichar_t *) S_("Underline|_Height:");
- pslabel[12].text_is_1byte = true;
- pslabel[12].text_in_resource = true;
- psgcd[12].gd.label = &pslabel[12];
- psgcd[12].creator = GLabelCreate;
-
- psgcd[13].gd.pos.x = 200; psgcd[13].gd.pos.y = psgcd[10].gd.pos.y; psgcd[13].gd.pos.width = 47;
- psgcd[13].gd.flags = gg_visible | gg_enabled;
- sprintf( uwbuf, "%g", (double) sf->uwidth );
- pslabel[13].text = (unichar_t *) uwbuf;
- pslabel[13].text_is_1byte = true;
- psgcd[13].gd.label = &pslabel[13];
- psgcd[13].gd.cid = CID_UWidth;
- psgcd[13].creator = GTextFieldCreate;
-
- psgcd[14].gd.pos.x = 12; psgcd[14].gd.pos.y = psgcd[13].gd.pos.y+26;
- pslabel[14].text = (unichar_t *) _("Has _Vertical Metrics");
- pslabel[14].text_is_1byte = true;
- pslabel[14].text_in_resource = true;
- psgcd[14].gd.label = &pslabel[14];
- psgcd[14].gd.cid = CID_HasVerticalMetrics;
- psgcd[14].gd.flags = gg_visible | gg_enabled;
- if ( sf->hasvmetrics )
- psgcd[14].gd.flags |= gg_cb_on;
- psgcd[14].gd.handle_controlevent = GFI_VMetricsCheck;
- psgcd[14].creator = GCheckBoxCreate;
-
- psgcd[15].gd.pos.x = 12; psgcd[15].gd.pos.y = psgcd[14].gd.pos.y+22;
- pslabel[15].text = (unichar_t *) _("Vertical _Origin:");
- pslabel[15].text_is_1byte = true;
- pslabel[15].text_in_resource = true;
- psgcd[15].gd.label = &pslabel[15];
- psgcd[15].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled) : gg_visible;
- psgcd[15].gd.cid = CID_VOriginLab;
- psgcd[15].creator = GLabelCreate;
-
- psgcd[16].gd.pos.x = psgcd[7].gd.pos.x; psgcd[16].gd.pos.y = psgcd[15].gd.pos.y-4; psgcd[16].gd.pos.width = psgcd[15].gd.pos.width;
- psgcd[16].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled) : gg_visible;
- pslabel[16].text = (unichar_t *) "";
- pslabel[16].text_is_1byte = true;
- if ( sf->vertical_origin!=0 || sf->hasvmetrics ) {
- sprintf( vorig, "%d", sf->vertical_origin );
- pslabel[16].text = (unichar_t *) vorig;
- }
- psgcd[16].gd.label = &pslabel[16];
- psgcd[16].gd.cid = CID_VOrigin;
- psgcd[16].creator = GTextFieldCreate;
-
- psgcd[17].gd.pos.x = 12; psgcd[17].gd.pos.y = psgcd[16].gd.pos.y+22;
- pslabel[17].text = (unichar_t *) _("_Quadratic Splines");
- pslabel[17].text_is_1byte = true;
- pslabel[17].text_in_resource = true;
- psgcd[17].gd.label = &pslabel[17];
- psgcd[17].gd.flags = sf->order2 ? (gg_visible | gg_enabled | gg_cb_on | gg_utf8_popup) : (gg_visible | gg_enabled | gg_utf8_popup);
- psgcd[17].gd.cid = CID_IsOrder2;
- psgcd[17].creator = GCheckBoxCreate;
- psgcd[17].gd.popup_msg = (unichar_t *) _("Use quadratic (that is truetype) splines to hold the outlines of this\nfont rather than cubic (postscript) splines. Set this option if you\nare editing truetype font. Unset it if you are editing an opentype\nor postscript font (FontForge will convert to the appropriate\nspline type when it generates fonts so this is not required).");
-
-#ifdef FONTFORGE_CONFIG_TYPE3
- psgcd[18].gd.pos.x = 12; psgcd[18].gd.pos.y = psgcd[17].gd.pos.y+18;
- pslabel[18].text = (unichar_t *) _("_Outline Font");
- pslabel[18].text_is_1byte = true;
- pslabel[18].text_in_resource = true;
- psgcd[18].gd.label = &pslabel[18];
- psgcd[18].gd.flags = (!sf->strokedfont && !sf->multilayer)?
- (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
- psgcd[18].creator = GRadioCreate;
-
- psgcd[19].gd.pos.x = 12; psgcd[19].gd.pos.y = psgcd[18].gd.pos.y+14;
- pslabel[19].text = (unichar_t *) _("_Multi Layered Font");
- pslabel[19].text_is_1byte = true;
- pslabel[19].text_in_resource = true;
- psgcd[19].gd.label = &pslabel[19];
- psgcd[19].gd.flags = sf->multilayer ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on | gg_rad_continueold) : (gg_visible | gg_enabled | gg_utf8_popup | gg_rad_continueold);
- psgcd[19].gd.cid = CID_IsMultiLayer;
- psgcd[19].creator = GRadioCreate;
- psgcd[19].gd.popup_msg = (unichar_t *) _("Allow editing of multiple colors and shades, fills and strokes.\nMulti layered fonts can only be output as type3 or svg fonts.");
-
- psgcd[20].gd.pos.x = 12; psgcd[20].gd.pos.y = psgcd[19].gd.pos.y+14;
- pslabel[20].text = (unichar_t *) _("_Stroked Font");
- pslabel[20].text_is_1byte = true;
- pslabel[20].text_in_resource = true;
- psgcd[20].gd.label = &pslabel[20];
- psgcd[20].gd.flags = sf->strokedfont ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on) : (gg_visible | gg_enabled | gg_utf8_popup);
- psgcd[20].gd.cid = CID_IsStrokedFont;
- psgcd[20].creator = GRadioCreate;
- psgcd[20].gd.popup_msg = (unichar_t *) _("Glyphs will be composed of stroked lines rather than filled outlines.\nAll glyphs are stroked at the following width");
-
- k=21;
-#else
- psgcd[18].gd.pos.x = 12; psgcd[18].gd.pos.y = psgcd[17].gd.pos.y+16;
- pslabel[18].text = (unichar_t *) _("_Stroked Font");
- pslabel[18].text_is_1byte = true;
- pslabel[18].text_in_resource = true;
- psgcd[18].gd.label = &pslabel[18];
- psgcd[18].gd.flags = sf->strokedfont ? (gg_visible | gg_enabled | gg_utf8_popup | gg_cb_on) : (gg_visible | gg_enabled | gg_utf8_popup);
- psgcd[18].gd.cid = CID_IsStrokedFont;
- psgcd[18].creator = GCheckBoxCreate;
- psgcd[18].gd.popup_msg = (unichar_t *) _("Glyphs will be composed of stroked lines rather than filled outlines.\nAll glyphs are stroked at the following width");
-
- k=19;
-#endif
-
- psgcd[k].gd.pos.x = 12; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+20;
- pslabel[k].text = (unichar_t *) _("Stroke _Width:");
- pslabel[k].text_is_1byte = true;
- pslabel[k].text_in_resource = true;
- psgcd[k].gd.label = &pslabel[k];
- psgcd[k].gd.flags = gg_visible | gg_enabled;
- psgcd[k++].creator = GLabelCreate;
-
- sprintf( swbuf,"%g", (double) sf->strokewidth );
- psgcd[k].gd.pos.x = 115; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6; psgcd[k].gd.pos.width = 137;
- psgcd[k].gd.flags = gg_visible | gg_enabled;
- pslabel[k].text = (unichar_t *) swbuf;
- pslabel[k].text_is_1byte = true;
- psgcd[k].gd.label = &pslabel[k];
- psgcd[k].gd.cid = CID_StrokeWidth;
- psgcd[k++].creator = GTextFieldCreate;
-
- psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
- psgcd[k].gd.flags = gg_visible | gg_enabled;
- pslabel[k].text = (unichar_t *) _("Interpretation:");
- pslabel[k].text_is_1byte = true;
- pslabel[k].text_in_resource = true;
- psgcd[k].gd.label = &pslabel[k];
- psgcd[k++].creator = GLabelCreate;
-
- psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
- psgcd[k].gd.flags = gg_visible | gg_enabled;
- psgcd[k].gd.u.list = interpretations;
- psgcd[k].gd.cid = CID_Interpretation;
- psgcd[k].creator = GListButtonCreate;
- for ( i=0; interpretations[i].text!=NULL || interpretations[i].line; ++i ) {
- if ( (void *) (sf->uni_interp)==interpretations[i].userdata &&
- interpretations[i].text!=NULL ) {
- interpretations[i].selected = true;
- psgcd[k].gd.label = &interpretations[i];
- } else
- interpretations[i].selected = false;
- }
- ++k;
-
- psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y+32;
- psgcd[k].gd.flags = gg_visible | gg_enabled;
- pslabel[k].text = (unichar_t *) _("Name List:");
- pslabel[k].text_is_1byte = true;
- pslabel[k].text_in_resource = true;
- psgcd[k].gd.label = &pslabel[k];
- psgcd[k++].creator = GLabelCreate;
-
- psgcd[k].gd.pos.x = psgcd[k-2].gd.pos.x; psgcd[k].gd.pos.y = psgcd[k-1].gd.pos.y-6;
- psgcd[k].gd.flags = gg_visible | gg_enabled;
- psgcd[k].gd.cid = CID_Namelist;
- psgcd[k].creator = GListButtonCreate;
- nlnames = AllNamelistNames();
- for ( i=0; nlnames[i]!=NULL; ++i);
- namelistnames = gcalloc(i+1,sizeof(GTextInfo));
- for ( i=0; nlnames[i]!=NULL; ++i) {
- namelistnames[i].text = (unichar_t *) nlnames[i];
- namelistnames[i].text_is_1byte = true;
- if ( strcmp(_(sf->for_new_glyphs->title),nlnames[i])==0 ) {
- namelistnames[i].selected = true;
- psgcd[k].gd.label = &namelistnames[i];
- }
- }
- psgcd[k++].gd.u.list = namelistnames;
- free(nlnames);
-
-
- if ( sf->subfontcnt!=0 ) {
- for ( i=0; i<=13; ++i )
- psgcd[i].gd.flags &= ~gg_enabled;
- } else if ( sf->cidmaster!=NULL ) {
- for ( i=14; i<=16; ++i )
- psgcd[i].gd.flags &= ~gg_enabled;
- }
-
- psarray[0] = &psb2[0];
- psarray[1] = &psgcd[14];
- psarray[2] = &psb2[1];
- psarray[3] = &psgcd[17];
- psarray[4] = &psgcd[18];
-#ifdef FONTFORGE_CONFIG_TYPE3
- psarray[5] = &psgcd[19];
- psarray[6] = &psgcd[20];
- j=7;
-#else
- j=5;
-#endif
- psarray[j++] = &psb2[2];
- psrow = j;
- psarray[j++] = GCD_Glue;
- psarray[j++] = NULL;
-
- psarray2[0] = &psgcd[0]; psarray2[1] = &psgcd[1]; psarray2[2] = &psgcd[2]; psarray2[3] = &psgcd[3]; psarray2[4] = NULL;
- psarray2[5] = &psgcd[4]; psarray2[6] = &psgcd[5]; psarray2[7] = &psgcd[6]; psarray2[8] = GCD_ColSpan; psarray2[9] = NULL;
- psarray2[10] = &psgcd[8]; psarray2[11] = &psgcd[7]; psarray2[12] = &psgcd[9]; psarray2[13] = GCD_ColSpan; psarray2[14] = NULL;
- psarray2[15] = &psgcd[11]; psarray2[16] = &psgcd[10]; psarray2[17] = &psgcd[12]; psarray2[18] = &psgcd[13]; psarray2[19] = NULL;
- psarray2[20] = NULL;
-
- psarray3[0] = &psgcd[15]; psarray3[1] = &psgcd[16]; psarray3[2] = NULL;
-
- psarray4[0] = &psgcd[k-6]; psarray4[1] = &psgcd[k-5]; psarray4[2] = NULL;
- psarray4[3] = &psgcd[k-4]; psarray4[4] = &psgcd[k-3]; psarray4[5] = NULL;
- psarray4[6] = &psgcd[k-2]; psarray4[7] = &psgcd[k-1]; psarray4[8] = NULL;
- psarray4[9] = NULL;
-
- memset(psb,0,sizeof(psb));
- psb[0].gd.flags = gg_enabled|gg_visible;
- psb[0].gd.u.boxelements = psarray;
- psb[0].creator = GVBoxCreate;
-
- memset(psb2,0,sizeof(psb2));
- psb2[0].gd.flags = gg_enabled|gg_visible;
- psb2[0].gd.u.boxelements = psarray2;
- psb2[0].creator = GHVBoxCreate;
-
- psb2[1].gd.flags = gg_enabled|gg_visible;
- psb2[1].gd.u.boxelements = psarray3;
- psb2[1].creator = GHBoxCreate;
-
- psb2[2].gd.flags = gg_enabled|gg_visible;
- psb2[2].gd.u.boxelements = psarray4;
- psb2[2].creator = GHVBoxCreate;
-/******************************************************************************/
-
- memset(&plabel,0,sizeof(plabel));
- memset(&pgcd,0,sizeof(pgcd));
-
- pgcd[0].gd.pos.x = 10; pgcd[0].gd.pos.y = 6;
- pgcd[0].gd.pos.width = 240; pgcd[0].gd.pos.height = 8*12+10;
- pgcd[0].gd.flags = gg_visible | gg_enabled;
- pgcd[0].gd.cid = CID_PrivateEntries;
- pgcd[0].gd.u.list = PI_ListSet(sf);
- pgcd[0].gd.handle_controlevent = PI_ListSel;
- pgcd[0].creator = GListCreate;
-
- pgcd[1].gd.pos.x = 10; pgcd[1].gd.pos.y = pgcd[0].gd.pos.y+pgcd[0].gd.pos.height+10;
- pgcd[1].gd.pos.width = pgcd[0].gd.pos.width; pgcd[1].gd.pos.height = 8*12+10;
- pgcd[1].gd.flags = gg_visible | gg_enabled;
- pgcd[1].gd.cid = CID_PrivateValues;
- pgcd[1].creator = GTextAreaCreate;
-
- pgcd[2].gd.pos.x = 10; pgcd[2].gd.pos.y = 300-35-30;
- pgcd[2].gd.pos.width = -1; pgcd[2].gd.pos.height = 0;
- pgcd[2].gd.flags = gg_visible | gg_enabled ;
- plabel[2].text = (unichar_t *) _("_Add");
- plabel[2].text_is_1byte = true;
- plabel[2].text_in_resource = true;
- pgcd[2].gd.label = &plabel[2];
- pgcd[2].gd.handle_controlevent = PI_Add;
- pgcd[2].gd.cid = CID_Add;
- pgcd[2].creator = GButtonCreate;
-
- pgcd[3].gd.pos.x = (260)/2-GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor)-5;
- pgcd[3].gd.pos.y = pgcd[2].gd.pos.y;
- pgcd[3].gd.pos.width = -1; pgcd[3].gd.pos.height = 0;
- pgcd[3].gd.flags = gg_visible ;
- plabel[3].text = (unichar_t *) _("_Guess");
- plabel[3].text_is_1byte = true;
- plabel[3].text_in_resource = true;
- pgcd[3].gd.label = &plabel[3];
- pgcd[3].gd.handle_controlevent = PI_Guess;
- pgcd[3].gd.cid = CID_Guess;
- pgcd[3].creator = GButtonCreate;
-
- pgcd[4].gd.pos.x = -(260/2-GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor)-5);
- pgcd[4].gd.pos.y = pgcd[2].gd.pos.y;
- pgcd[4].gd.pos.width = -1; pgcd[4].gd.pos.height = 0;
- pgcd[4].gd.flags = gg_visible | gg_utf8_popup ;
-/* GT: This is an abbreviation for Histogram */
- plabel[4].text = (unichar_t *) _("_Hist.");
- plabel[4].text_is_1byte = true;
- plabel[4].text_in_resource = true;
- pgcd[4].gd.label = &plabel[4];
- pgcd[4].gd.handle_controlevent = PI_Hist;
- pgcd[4].gd.cid = CID_Hist;
- pgcd[4].gd.popup_msg = (unichar_t *) _("Histogram Dialog");
- pgcd[4].creator = GButtonCreate;
-
- pgcd[5].gd.pos.x = -10; pgcd[5].gd.pos.y = pgcd[2].gd.pos.y;
- pgcd[5].gd.pos.width = -1; pgcd[5].gd.pos.height = 0;
- pgcd[5].gd.flags = gg_visible | gg_enabled ;
- plabel[5].text = (unichar_t *) _("_Remove");
- plabel[5].text_is_1byte = true;
- plabel[5].text_in_resource = true;
- pgcd[5].gd.label = &plabel[5];
- pgcd[5].gd.handle_controlevent = PI_Delete;
- pgcd[5].gd.cid = CID_Remove;
- pgcd[5].creator = GButtonCreate;
-
- ppbuttons[0] = &pgcd[2]; ppbuttons[1] = &pgcd[3];
- ppbuttons[2] = &pgcd[4]; ppbuttons[3] = &pgcd[5]; ppbuttons[4] = NULL;
-
- pparray[0] = &pgcd[0]; pparray[1] = &pgcd[1]; pparray[2] = &ppbox[2];
- pparray[3] = NULL;
-
- memset(ppbox,0,sizeof(ppbox));
- ppbox[0].gd.flags = gg_enabled|gg_visible;
- ppbox[0].gd.u.boxelements = pparray;
- ppbox[0].creator = GVBoxCreate;
-
- ppbox[2].gd.flags = gg_enabled|gg_visible;
- ppbox[2].gd.u.boxelements = ppbuttons;
- ppbox[2].creator = GHBoxCreate;
-/******************************************************************************/
- memset(&vlabel,0,sizeof(vlabel));
- memset(&vgcd,0,sizeof(vgcd));
-
- vgcd[0].gd.pos.x = 10; vgcd[0].gd.pos.y = 12;
- vlabel[0].text = (unichar_t *) _("_Weight Class");
- vlabel[0].text_is_1byte = true;
- vlabel[0].text_in_resource = true;
- vgcd[0].gd.label = &vlabel[0];
- vgcd[0].gd.flags = gg_visible | gg_enabled;
- vgcd[0].creator = GLabelCreate;
-
- vgcd[1].gd.pos.x = 90; vgcd[1].gd.pos.y = vgcd[0].gd.pos.y-6; vgcd[1].gd.pos.width = 140;
- vgcd[1].gd.flags = gg_visible | gg_enabled;
- vgcd[1].gd.cid = CID_WeightClass;
- vgcd[1].gd.u.list = weightclass;
- vgcd[1].creator = GListFieldCreate;
-
- vgcd[2].gd.pos.x = 10; vgcd[2].gd.pos.y = vgcd[1].gd.pos.y+26+6;
- vlabel[2].text = (unichar_t *) _("Width _Class");
- vlabel[2].text_is_1byte = true;
- vlabel[2].text_in_resource = true;
- vgcd[2].gd.label = &vlabel[2];
- vgcd[2].gd.flags = gg_visible | gg_enabled;
- vgcd[2].creator = GLabelCreate;
-
- vgcd[3].gd.pos.x = 90; vgcd[3].gd.pos.y = vgcd[2].gd.pos.y-6;
- vgcd[3].gd.flags = gg_visible | gg_enabled;
- vgcd[3].gd.cid = CID_WidthClass;
- vgcd[3].gd.u.list = widthclass;
- vgcd[3].creator = GListButtonCreate;
-
- vgcd[4].gd.pos.x = 10; vgcd[4].gd.pos.y = vgcd[3].gd.pos.y+26+6;
- vlabel[4].text = (unichar_t *) _("P_FM Family");
- vlabel[4].text_is_1byte = true;
- vlabel[4].text_in_resource = true;
- vgcd[4].gd.label = &vlabel[4];
- vgcd[4].gd.flags = gg_visible | gg_enabled;
- vgcd[4].creator = GLabelCreate;
-
- vgcd[5].gd.pos.x = 90; vgcd[5].gd.pos.y = vgcd[4].gd.pos.y-6; vgcd[5].gd.pos.width = 140;
- vgcd[5].gd.flags = gg_visible | gg_enabled;
- vgcd[5].gd.cid = CID_PFMFamily;
- vgcd[5].gd.u.list = pfmfamily;
- vgcd[5].creator = GListButtonCreate;
-
- vgcd[6].gd.pos.x = 10; vgcd[6].gd.pos.y = vgcd[5].gd.pos.y+26+6;
- vlabel[6].text = (unichar_t *) _("_Embeddable");
- vlabel[6].text_is_1byte = true;
- vlabel[6].text_in_resource = true;
- vgcd[6].gd.label = &vlabel[6];
- vgcd[6].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- vgcd[6].gd.popup_msg = (unichar_t *) _("Can this font be embedded in a downloadable (pdf)\ndocument, and if so, what behaviors are permitted on\nboth the document and the font.");
- vgcd[6].creator = GLabelCreate;
-
- vgcd[7].gd.pos.x = 90; vgcd[7].gd.pos.y = vgcd[6].gd.pos.y-6;
- vgcd[7].gd.pos.width = 140;
- vgcd[7].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- vgcd[7].gd.cid = CID_FSType;
- vgcd[7].gd.u.list = fstype;
- vgcd[7].gd.popup_msg = vgcd[6].gd.popup_msg;
- vgcd[7].creator = GListButtonCreate;
- fstype[0].selected = fstype[1].selected =
- fstype[2].selected = fstype[3].selected = false;
- if ( sf->pfminfo.fstype&0x8 /* also catches the "not set" case == -1 */ )
- i = 2;
- else if ( sf->pfminfo.fstype&0x4 )
- i = 1;
- else if ( sf->pfminfo.fstype&0x2 )
- i = 0;
- else
- i = 3;
- fstype[i].selected = true;
- vgcd[7].gd.label = &fstype[i];
-
- vgcd[8].gd.pos.x = 20; vgcd[8].gd.pos.y = vgcd[7].gd.pos.y+26;
- vlabel[8].text = (unichar_t *) _("No Subsetting");
- vlabel[8].text_is_1byte = true;
- vgcd[8].gd.label = &vlabel[8];
- vgcd[8].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- if ( sf->pfminfo.fstype!=-1 && (sf->pfminfo.fstype&0x100) )
- vgcd[8].gd.flags |= gg_cb_on;
- vgcd[8].gd.popup_msg = (unichar_t *) _("If set then the entire font must be\nembedded in a document when any character is.\nOtherwise the document creator need\nonly include the characters it uses.");
- vgcd[8].gd.cid = CID_NoSubsetting;
- vgcd[8].creator = GCheckBoxCreate;
-
- vgcd[9].gd.pos.x = 110; vgcd[9].gd.pos.y = vgcd[8].gd.pos.y;
- vlabel[9].text = (unichar_t *) _("Only Embed Bitmaps");
- vlabel[9].text_is_1byte = true;
- vgcd[9].gd.label = &vlabel[9];
- vgcd[9].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- if ( sf->pfminfo.fstype!=-1 && ( sf->pfminfo.fstype&0x200 ))
- vgcd[9].gd.flags |= gg_cb_on;
- vgcd[9].gd.popup_msg = (unichar_t *) _("Only Bitmaps may be embedded.\nOutline descriptions may not be\n(if font file contains no bitmaps\nthen nothing may be embedded).");
- vgcd[9].gd.cid = CID_OnlyBitmaps;
- vgcd[9].creator = GCheckBoxCreate;
-
- vgcd[10].gd.pos.x = 10; vgcd[10].gd.pos.y = vgcd[9].gd.pos.y+24;
- vlabel[10].text = (unichar_t *) _("Vendor ID:");
- vlabel[10].text_is_1byte = true;
- vgcd[10].gd.label = &vlabel[10];
- vgcd[10].gd.flags = gg_visible | gg_enabled;
- vgcd[10].creator = GLabelCreate;
-
- vgcd[11].gd.pos.x = 90; vgcd[11].gd.pos.y = vgcd[11-1].gd.pos.y-4;
- vgcd[11].gd.pos.width = 50;
- vgcd[11].gd.flags = gg_visible | gg_enabled;
- /* value set later */
- vgcd[11].gd.cid = CID_Vendor;
- vgcd[11].creator = GTextFieldCreate;
-
- vgcd[12].gd.pos.x = 10; vgcd[12].gd.pos.y = vgcd[11].gd.pos.y+24+6;
- vlabel[12].text = (unichar_t *) _("_IBM Family:");
- vlabel[12].text_is_1byte = true;
- vlabel[12].text_in_resource = true;
- vgcd[12].gd.label = &vlabel[12];
- vgcd[12].gd.flags = gg_visible | gg_enabled;
- vgcd[12].creator = GLabelCreate;
-
- vgcd[13].gd.pos.x = 90; vgcd[13].gd.pos.y = vgcd[12].gd.pos.y-4; vgcd[13].gd.pos.width = vgcd[7].gd.pos.width;
- vgcd[13].gd.flags = gg_visible | gg_enabled;
- vgcd[13].gd.cid = CID_IBMFamily;
- vgcd[13].gd.u.list = ibmfamily;
- vgcd[13].creator = GListButtonCreate;
-
- vgcd[14].gd.pos.x = 10; vgcd[14].gd.pos.y = vgcd[13].gd.pos.y+24+6;
- vlabel[14].text = (unichar_t *) _("Weight, Width, Slope Only");
- vlabel[14].text_is_1byte = true;
- vlabel[14].text_in_resource = true;
- vgcd[14].gd.label = &vlabel[14];
- vgcd[14].gd.cid = CID_WeightWidthSlopeOnly;
- vgcd[14].gd.popup_msg = (unichar_t *) _("MS needs to know whether a font family's members differ\nonly in weight, width and slope (and not in other variables\nlike optical size)." );
- vgcd[14].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- vgcd[14].creator = GCheckBoxCreate;
-
- vgcd[15].gd.pos.x = 10; vgcd[15].gd.pos.y = vgcd[11].gd.pos.y+24+6;
- vlabel[15].text = (unichar_t *) _("_OS/2 Version");
- vlabel[15].text_is_1byte = true;
- vlabel[15].text_in_resource = true;
- vgcd[15].gd.label = &vlabel[15];
- vgcd[15].gd.popup_msg = (unichar_t *) _("The 'OS/2' table has changed slightly over the years,\nGenerally fields have been added, but occasionally their\nmeanings have been redefined." );
- vgcd[15].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- vgcd[15].creator = GLabelCreate;
-
- vgcd[16].gd.pos.x = 90; vgcd[16].gd.pos.y = vgcd[15].gd.pos.y-4; vgcd[16].gd.pos.width = vgcd[7].gd.pos.width;
- vgcd[16].gd.flags = gg_visible | gg_enabled;
- vgcd[16].gd.cid = CID_OS2Version;
- vgcd[16].gd.u.list = os2versions;
- vgcd[16].creator = GListFieldCreate;
-
- vradio[0] = GCD_Glue; vradio[1] = &vgcd[8]; vradio[2] = &vgcd[9]; vradio[3] = GCD_Glue; vradio[4] = NULL;
-
- varray[0] = &vgcd[15]; varray[1] = &vgcd[16]; varray[2] = NULL;
- varray[3] = &vgcd[0]; varray[4] = &vgcd[1]; varray[5] = NULL;
- varray[6] = &vgcd[2]; varray[7] = &vgcd[3]; varray[8] = NULL;
- varray[9] = &vgcd[4]; varray[10] = &vgcd[5]; varray[11] = NULL;
- varray[12] = &vgcd[6]; varray[13] = &vgcd[7]; varray[14] = NULL;
- varray[15] = &vbox[2]; varray[16] = GCD_ColSpan; varray[17] = NULL;
- varray[18] = &vgcd[10]; varray[19] = &vgcd[11]; varray[20] = NULL;
- varray[21] = &vgcd[12]; varray[22] = &vgcd[13]; varray[23] = NULL;
- varray[24] = &vgcd[14]; varray[25] = GCD_ColSpan; varray[26] = NULL;
- varray[27] = GCD_Glue; varray[28] = GCD_Glue; varray[29] = NULL;
- varray[30] = GCD_Glue; varray[31] = GCD_Glue; varray[32] = NULL;
- varray[33] = varray[37] = NULL;
-
- memset(vbox,0,sizeof(vbox));
- vbox[0].gd.flags = gg_enabled|gg_visible;
- vbox[0].gd.u.boxelements = varray;
- vbox[0].creator = GHVBoxCreate;
-
- vbox[2].gd.flags = gg_enabled|gg_visible;
- vbox[2].gd.u.boxelements = vradio;
- vbox[2].creator = GHBoxCreate;
-
-/******************************************************************************/
-
- memset(&metgcd,0,sizeof(metgcd));
- memset(&metlabel,'\0',sizeof(metlabel));
-
- i = j = 0;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = 9;
- metlabel[i].text = (unichar_t *) _("Win _Ascent Offset:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = (unichar_t *) _("Anything outside the OS/2 WinAscent &\nWinDescent fields will be clipped by windows.\nThis includes marks, etc. that have been repositioned by GPOS.\n(The descent field is usually positive.)\nIf the \"[] Is Offset\" checkbox is clear then\nany number you enter will be the value used in OS/2.\nIf set then any number you enter will be added to the\nfont's bounds. You should leave this\nfield 0 and check \"[*] Is Offset\" in most cases.");
- metgcd[i].gd.cid = CID_WinAscentLab;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_WinAscent;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
-
- metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
- metlabel[i].text = (unichar_t *) _("Is Offset");
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_WinAscentIsOff;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GCheckBoxCreate;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
- metlabel[i].text = (unichar_t *) _("Win _Descent Offset:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.cid = CID_WinDescentLab;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_WinDescent;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
-
- metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
- metlabel[i].text = (unichar_t *) _("Is Offset");
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_WinDescentIsOff;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GCheckBoxCreate;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
- metlabel[i].text = (unichar_t *) _("_Typo Ascent Offset:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = (unichar_t *) _("The type ascent&descent fields are>supposed<\nto specify the line spacing on windows.\nIn fact usually the win ascent/descent fields do.\n(The descent field is usually negative.)\nIf the \"[] Is Offset\" checkbox is clear then\nany number you enter will be the value used in OS/2.\nIf set then any number you enter will be added to the\nEm-size. You should leave this\nfield 0 and check \"[*] Is Offset\" in most cases.");
- metgcd[i].gd.cid = CID_TypoAscentLab;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_TypoAscent;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
-
- metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
- metlabel[i].text = (unichar_t *) _("Is Offset");
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_TypoAscentIsOff;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GCheckBoxCreate;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 5; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
- metlabel[i].text = (unichar_t *) _("Really use Typo metrics");
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_UseTypoMetrics;
- metgcd[i].gd.popup_msg = (unichar_t *) _("The spec already says that the typeo metrics should be\nused to determine line spacing. But so many\nprograms fail to follow the spec that MS desided a bit\nwas needed to remind them to do so.");
- metarray[j++] = &metgcd[i]; metarray[j++] = GCD_ColSpan; metarray[j++] = GCD_Glue;
- metgcd[i++].creator = GCheckBoxCreate;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
- metlabel[i].text = (unichar_t *) _("T_ypo Descent Offset:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.cid = CID_TypoDescentLab;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_TypoDescent;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
-
- metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
- metlabel[i].text = (unichar_t *) _("Is Offset");
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_TypoDescentIsOff;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GCheckBoxCreate;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
- metlabel[i].text = (unichar_t *) _("Typo Line _Gap:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the TypoLinegap field in the OS/2 table, used on MS Windows");
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* Line gap value set later */
- metgcd[i].gd.cid = CID_TypoLineGap;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
- metarray[j++] = GCD_Glue;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+4;
- metlabel[i].text = (unichar_t *) _("_HHead Ascent Offset:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = (unichar_t *) _("This specifies the line spacing on the mac.\n(The descent field is usually negative.)\nIf the \"[] Is Offset\" checkbox is clear then\nany number you enter will be the value used in hhea.\nIf set then any number you enter will be added to the\nfont's bounds. You should leave this\nfield 0 and check \"[*] Is Offset\" in most cases.");
- metgcd[i].gd.cid = CID_HHeadAscentLab;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_HHeadAscent;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
-
- metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
- metlabel[i].text = (unichar_t *) _("Is Offset");
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_HHeadAscentIsOff;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GCheckBoxCreate;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
- metlabel[i].text = (unichar_t *) _("HHead De_scent Offset:");
- metlabel[i].text_in_resource = true;
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.cid = CID_HHeadDescentLab;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_HHeadDescent;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
-
- metgcd[i].gd.pos.x = 178; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y;
- metlabel[i].text = (unichar_t *) _("Is Offset");
- metlabel[i].text_is_1byte = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* value set later */
- metgcd[i].gd.cid = CID_HHeadDescentIsOff;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metgcd[i].gd.handle_controlevent = GFI_AsDesIsOff;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GCheckBoxCreate;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-2].gd.pos.y+26+4;
- metlabel[i].text = (unichar_t *) _("HHead _Line Gap:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the linegap field in the hhea table, used on the mac");
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-4;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- /* Line gap value set later */
- metgcd[i].gd.cid = CID_LineGap;
- metgcd[i].gd.popup_msg = metgcd[i-1].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
- metarray[j++] = GCD_Glue;
- metarray[j++] = NULL;
-
- metgcd[i].gd.pos.x = 10; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y+26+6;
- metlabel[i].text = (unichar_t *) _("VHead _Column Spacing:");
- metlabel[i].text_is_1byte = true;
- metlabel[i].text_in_resource = true;
- metgcd[i].gd.label = &metlabel[i];
- metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled | gg_utf8_popup) : (gg_visible | gg_utf8_popup);
- metgcd[i].gd.popup_msg = (unichar_t *) _("Sets the linegap field in the vhea table.\nThis is the horizontal spacing between rows\nof vertically set text.");
- metgcd[i].gd.cid = CID_VLineGapLab;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GLabelCreate;
-
- metgcd[i].gd.pos.x = 125; metgcd[i].gd.pos.y = metgcd[i-1].gd.pos.y-6;
- metgcd[i].gd.pos.width = 50;
- metgcd[i].gd.flags = sf->hasvmetrics ? (gg_visible | gg_enabled | gg_utf8_popup) : (gg_visible | gg_utf8_popup);
- /* V Line gap value set later */
- metgcd[i].gd.cid = CID_VLineGap;
- metgcd[i].gd.popup_msg = metgcd[17].gd.popup_msg;
- metarray[j++] = &metgcd[i];
- metgcd[i++].creator = GTextFieldCreate;
- metarray[j++] = GCD_Glue;
- metarray[j++] = NULL;
- metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue; metarray[j++] = GCD_Glue;
-
- metarray[j++] = NULL; metarray[j++] = NULL;
-
- memset(metbox,0,sizeof(metbox));
- metbox[0].gd.flags = gg_enabled|gg_visible;
- metbox[0].gd.u.boxelements = metarray;
- metbox[0].creator = GHVBoxCreate;
-/******************************************************************************/
-
- memset(&ssgcd,0,sizeof(ssgcd));
- memset(&sslabel,'\0',sizeof(sslabel));
-
- i = j = 0;
-
- ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = 5;
- sslabel[i].text = (unichar_t *) S_("SubscriptSuperUse|Default");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* value set later */
- ssgcd[i].gd.cid = CID_SubSuperDefault;
- ssgcd[i].gd.handle_controlevent = GFI_SubSuperDefault;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GCheckBoxCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
- ssarray[j++] = NULL;
-
- ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+16;
- sslabel[i].text = (unichar_t *) _("Subscript");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
-
- ssgcd[i].gd.pos.x = 120; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-4;
-/* GT: X is a coordinate, the leading spaces help to align it */
- sslabel[i].text = (unichar_t *) _(" X");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
-
- ssgcd[i].gd.pos.x = 180; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
-/* GT: Y is a coordinate, the leading spaces help to align it */
- sslabel[i].text = (unichar_t *) _("Y");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
-
- ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+14+4;
- sslabel[i].text = (unichar_t *) _("Size");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
-
- ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SubXSize;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
-
- ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SubYSize;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
-
- ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
- sslabel[i].text = (unichar_t *) _("Offset");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
-
- ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SubXOffset;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
-
- ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SubYOffset;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
-
-
- ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
- sslabel[i].text = (unichar_t *) _("Superscript");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
- ssarray[j++] = NULL;
-
- ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
- sslabel[i].text = (unichar_t *) _("Size");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
-
- ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SuperXSize;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
-
- ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SuperYSize;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
-
- ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-3].gd.pos.y+26;
- sslabel[i].text = (unichar_t *) _("Offset");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
-
- ssgcd[i].gd.pos.x = 100; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SuperXOffset;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
-
- ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_SuperYOffset;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
-
-
- ssgcd[i].gd.pos.x = 5; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+30;
- sslabel[i].text = (unichar_t *) _("Strikeout");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
- ssarray[j++] = NULL;
-
- ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y+14+4;
- sslabel[i].text = (unichar_t *) _("Size");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
- ssarray[j++] = GCD_Glue;
-
- ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_StrikeoutSize;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
-
- ssgcd[i].gd.pos.x = 10; ssgcd[i].gd.pos.y = ssgcd[i-2].gd.pos.y+26;
- sslabel[i].text = (unichar_t *) _("Pos");
- sslabel[i].text_is_1byte = true;
- ssgcd[i].gd.label = &sslabel[i];
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GLabelCreate;
- ssarray[j++] = GCD_Glue;
-
- ssgcd[i].gd.pos.x = 160; ssgcd[i].gd.pos.y = ssgcd[i-1].gd.pos.y-6;
- ssgcd[i].gd.pos.width = 50;
- ssgcd[i].gd.flags = gg_visible | gg_enabled;
- /* set later */
- ssgcd[i].gd.cid = CID_StrikeoutPos;
- ssarray[j++] = &ssgcd[i];
- ssgcd[i++].creator = GTextFieldCreate;
- ssarray[j++] = GCD_Glue; ssarray[j++] = NULL;
-
- ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue; ssarray[j++] = GCD_Glue;
-
- ssarray[j++] = NULL; ssarray[j++] = NULL;
-
- memset(ssbox,0,sizeof(ssbox));
- ssbox[0].gd.flags = gg_enabled|gg_visible;
- ssbox[0].gd.u.boxelements = ssarray;
- ssbox[0].creator = GHVBoxCreate;
-/******************************************************************************/
- memset(&panlabel,0,sizeof(panlabel));
- memset(&pangcd,0,sizeof(pangcd));
-
- i = j = 0;
-
- pangcd[i].gd.pos.x = 5; pangcd[i].gd.pos.y = 5;
- panlabel[i].text = (unichar_t *) S_("PanoseUse|Default");
- panlabel[i].text_is_1byte = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- /* value set later */
- pangcd[i].gd.cid = CID_PanDefault;
- /*pangcd[i].gd.popup_msg = pangcd[i-1].gd.popup_msg;*/
- pangcd[i].gd.handle_controlevent = GFI_PanoseDefault;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GCheckBoxCreate;
- panarray[j++] = GCD_Glue; panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+14+4;
- panlabel[i].text = (unichar_t *) S_("Panose|_Family");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanFamilyLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanFamily;
- pangcd[i].gd.u.list = panfamily;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("_Serifs");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanSerifsLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanSerifs;
- pangcd[i].gd.u.list = panserifs;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) S_("Panose|_Weight");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanWeightLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanWeight;
- pangcd[i].gd.u.list = panweight;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("_Proportion");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanPropLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanProp;
- pangcd[i].gd.u.list = panprop;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("_Contrast");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanContrastLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanContrast;
- pangcd[i].gd.u.list = pancontrast;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("Stroke _Variation");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanStrokeVarLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanStrokeVar;
- pangcd[i].gd.u.list = panstrokevar;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("_Arm Style");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanArmStyleLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanArmStyle;
- pangcd[i].gd.u.list = panarmstyle;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("_Letterform");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanLetterformLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanLetterform;
- pangcd[i].gd.u.list = panletterform;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("_Midline");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanMidLineLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanMidLine;
- pangcd[i].gd.u.list = panmidline;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- pangcd[i].gd.pos.x = 20; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y+26+5;
- panlabel[i].text = (unichar_t *) _("_X-Height");
- panlabel[i].text_is_1byte = true;
- panlabel[i].text_in_resource = true;
- pangcd[i].gd.label = &panlabel[i];
- pangcd[i].gd.cid = CID_PanXHeightLab;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GLabelCreate;
-
- pangcd[i].gd.pos.x = 100; pangcd[i].gd.pos.y = pangcd[i-1].gd.pos.y-6; pangcd[i].gd.pos.width = 120;
- pangcd[i].gd.flags = gg_visible | gg_enabled;
- pangcd[i].gd.cid = CID_PanXHeight;
- pangcd[i].gd.u.list = panxheight;
- panarray[j++] = &pangcd[i];
- pangcd[i++].creator = GListButtonCreate;
- panarray[j++] = NULL;
-
- panarray[j++] = GCD_Glue; panarray[j++] = GCD_Glue;
-
- panarray[j++] = NULL; panarray[j++] = NULL;
-
- memset(panbox,0,sizeof(panbox));
- panbox[0].gd.flags = gg_enabled|gg_visible;
- panbox[0].gd.u.boxelements = panarray;
- panbox[0].creator = GHVBoxCreate;
-/******************************************************************************/
-
- memset(&vagcd,0,sizeof(vagcd));
- memset(&vaspects,'\0',sizeof(vaspects));
-
- i = 0;
- vaspects[i].text = (unichar_t *) _("Misc.");
- vaspects[i].text_is_1byte = true;
- vaspects[i++].gcd = vbox;
-
- vaspects[i].text = (unichar_t *) _("Metrics");
- vaspects[i].text_is_1byte = true;
- vaspects[i++].gcd = metbox;
-
- vaspects[i].text = (unichar_t *) _("Sub/Super");
- vaspects[i].text_is_1byte = true;
- vaspects[i++].gcd = ssbox;
-
- vaspects[i].text = (unichar_t *) _("Panose");
- vaspects[i].text_is_1byte = true;
- vaspects[i++].gcd = panbox;
-
- vagcd[0].gd.pos.x = 4; vagcd[0].gd.pos.y = 6;
- vagcd[0].gd.pos.width = 252;
- vagcd[0].gd.pos.height = 300;
- vagcd[0].gd.u.tabs = vaspects;
- vagcd[0].gd.flags = gg_visible | gg_enabled;
- /*vagcd[0].gd.handle_controlevent = GFI_TTFAspectChange;*/
- vagcd[0].gd.cid = CID_TTFTabs;
- vagcd[0].creator = GTabSetCreate;
-
-/******************************************************************************/
- memset(&gaspboxes,0,sizeof(gaspboxes));
- memset(&gaspgcd,0,sizeof(gaspgcd));
- memset(&gasplabel,0,sizeof(gasplabel));
- memset(&gaspgcd_def,0,sizeof(gaspgcd_def));
-
- GaspMatrixInit(&gaspmi,d);
-
- i = j = 0;
-
- gasplabel[i].text = (unichar_t *) S_("Gasp|_Version");
- gasplabel[i].text_is_1byte = true;
- gasplabel[i].text_in_resource = true;
- gaspgcd[i].gd.label = &gasplabel[i];
- gaspgcd[i].gd.flags = gg_visible | gg_enabled;
- gaspharray[j++] = &gaspgcd[i];
- gaspgcd[i++].creator = GLabelCreate;
-
- gaspgcd[i].gd.flags = gg_visible | gg_enabled;
- gaspgcd[i].gd.cid = CID_GaspVersion;
- gaspgcd[i].gd.label = &gaspversions[sf->gasp_version];
- gaspgcd[i].gd.u.list = gaspversions;
- gaspharray[j++] = &gaspgcd[i];
- gaspgcd[i].gd.handle_controlevent = GFI_GaspVersion;
- gaspgcd[i++].creator = GListButtonCreate;
- gaspharray[j++] = GCD_HPad10;
-
- gasplabel[i].text = (unichar_t *) _("Optimized For Cleartype");
- gasplabel[i].text_is_1byte = true;
- gasplabel[i].text_in_resource = true;
- gaspgcd[i].gd.label = &gasplabel[i];
- gaspgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gaspgcd[i].gd.cid = CID_HeadClearType;
- if ( sf->head_optimized_for_cleartype )
- gaspgcd[i].gd.flags |= gg_cb_on;
- gaspgcd[i].gd.popup_msg = (unichar_t *) _("Actually a bit in the 'head' table.\nIf unset then certain East Asian fonts will not be hinted");
- gaspharray[j++] = &gaspgcd[i];
- gaspgcd[i++].creator = GCheckBoxCreate;
- gaspharray[j++] = NULL;
-
- gaspboxes[2].gd.flags = gg_enabled|gg_visible;
- gaspboxes[2].gd.u.boxelements = gaspharray;
- gaspboxes[2].creator = GHBoxCreate;
-
- gaspvarray[0] = &gaspboxes[2];
-
- gaspgcd[i].gd.pos.width = 300; gaspgcd[i].gd.pos.height = 200;
- gaspgcd[i].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
- gaspgcd[i].gd.cid = CID_Gasp;
- gaspgcd[i].gd.u.matrix = &gaspmi;
- gaspgcd[i].gd.popup_msg = (unichar_t *) _(
- "The 'gasp' table gives you control over when grid-fitting and\n"
- "anti-aliased rasterizing are done.\n"
- "The table consists of an (ordered) list of pixel sizes each with\n"
- "a set of flags. Those flags apply to all pixel sizes bigger than\n"
- "the previous table entry but less than or equal to the current.\n"
- "The list must be terminated with a pixel size of 65535.\n"
- "Version 1 of the table contains two additional flags that\n"
- "apply to MS's ClearType rasterizer.\n\n"
- "The 'gasp' table only applies to truetype fonts.");
- gaspgcd[i].data = d;
- gaspgcd[i].creator = GMatrixEditCreate;
- gaspvarray[1] = &gaspgcd[i];
- gaspvarray[2] = NULL;
-
- gaspboxes[0].gd.flags = gg_enabled|gg_visible;
- gaspboxes[0].gd.u.boxelements = gaspvarray;
- gaspboxes[0].creator = GVBoxCreate;
-
- gaspgcd_def[0].gd.flags = gg_visible | gg_enabled;
- gasplabel[4].text = (unichar_t *) S_("Gasp|_Default");
- gasplabel[4].text_is_1byte = true;
- gasplabel[4].text_in_resource = true;
- gaspgcd_def[0].gd.label = &gasplabel[4];
- gaspgcd_def[0].gd.handle_controlevent = Gasp_Default;
- gaspgcd_def[0].creator = GButtonCreate;
-/******************************************************************************/
- memset(&tnlabel,0,sizeof(tnlabel));
- memset(&tngcd,0,sizeof(tngcd));
- memset(&tnboxes,0,sizeof(tnboxes));
-
- TNMatrixInit(&mi,d);
-
- tngcd[0].gd.pos.x = 5; tngcd[0].gd.pos.y = 6;
- tngcd[0].gd.flags = gg_visible | gg_enabled;
- tnlabel[0].text = (unichar_t *) _("Sort By:");
- tnlabel[0].text_is_1byte = true;
- tngcd[0].gd.label = &tnlabel[0];
- tngcd[0].creator = GLabelCreate;
- tnharray[0] = &tngcd[0];
-
- tngcd[1].gd.pos.x = 50; tngcd[1].gd.pos.y = tngcd[0].gd.pos.y-4;
- tngcd[1].gd.flags = gg_enabled | gg_visible;
- tngcd[1].gd.cid = CID_TNLangSort;
- tnlabel[1].text = (unichar_t *) _("_Language");
- tnlabel[1].text_is_1byte = true;
- tnlabel[1].text_in_resource = true;
- tngcd[1].gd.label = &tnlabel[1];
- tngcd[1].creator = GRadioCreate;
- tngcd[1].gd.handle_controlevent = GFI_SortBy;
- tnharray[1] = &tngcd[1];
-
- tngcd[2].gd.pos.x = 120; tngcd[2].gd.pos.y = tngcd[1].gd.pos.y;
- tngcd[2].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
- tngcd[2].gd.cid = CID_TNStringSort;
- tnlabel[2].text = (unichar_t *) _("_String Type");
- tnlabel[2].text_is_1byte = true;
- tnlabel[2].text_in_resource = true;
- tngcd[2].gd.label = &tnlabel[2];
- tngcd[2].creator = GRadioCreate;
- tngcd[2].gd.handle_controlevent = GFI_SortBy;
- tnharray[2] = &tngcd[2];
-
- tngcd[3].gd.pos.x = 195; tngcd[3].gd.pos.y = tngcd[1].gd.pos.y;
- tngcd[3].gd.flags = gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold;
- tnlabel[3].text = (unichar_t *) S_("SortingScheme|Default");
- tnlabel[3].text_is_1byte = true;
- tngcd[3].gd.label = &tnlabel[3];
- tngcd[3].creator = GRadioCreate;
- tngcd[3].gd.handle_controlevent = GFI_SortBy;
- tnharray[3] = &tngcd[3]; tnharray[4] = GCD_Glue; tnharray[5] = NULL;
-
- tngcd[4].gd.pos.x = 10; tngcd[4].gd.pos.y = tngcd[1].gd.pos.y+14;
- tngcd[4].gd.pos.width = 300; tngcd[4].gd.pos.height = 200;
- tngcd[4].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
- tngcd[4].gd.cid = CID_TNames;
- tngcd[4].gd.u.matrix = &mi;
- tngcd[4].gd.popup_msg = (unichar_t *) _(
- "To create a new name, left click on the <New> button, and select a locale.\n"
- "To change the locale, left click on it.\n"
- "To change the string type, left click on it.\n"
- "To change the text, left click in it and then type.\n"
- "To delete a name, right click on the name & select Delete from the menu.\n"
- "To associate or disassocate a truetype name to its postscript equivalent\n"
- "right click and select the appropriate menu item." );
- tngcd[4].data = d;
- tngcd[4].creator = GMatrixEditCreate;
-
- tngcd[5].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
-/* GT: when translating this please leave the "SIL Open Font License" in */
-/* GT: English (possibly translating it in parentheses). I believe there */
-/* GT: are legal reasons for this. */
-/* GT: So "A\303\261adir SIL Open Font License (licencia de fuentes libres)" */
- tnlabel[5].text = (unichar_t *) S_("Add SIL ");
- tnlabel[5].image_precedes = false;
- tnlabel[5].image = &OFL_logo;
- tnlabel[5].text_is_1byte = true;
- tnlabel[5].text_in_resource = true;
- tngcd[5].gd.label = &tnlabel[5];
- tngcd[5].gd.handle_controlevent = GFI_AddOFL;
- tngcd[5].gd.popup_msg = (unichar_t *) _(
- "The SIL Open Font License (OFL) is designed for free/libre/open font projects.\n"
- "Most other FLOSS licenses are designed for conventional software and are problematic for fonts.\n"
- "The OFL is a community-approved license and is well-suited for releasing fonts to be freely \n"
- "used, studied, copied, modified, embedded, merged and distributed while maintaining artistic integrity.\n"
- "You are encouraged you to use it if you can.\n"
- "\n"
- "For more details about the OFL - and the corresponding FAQ - see http://scripts.sil.org/OFL \n"
- "\n"
- "Simply press this button to add the OFL metadata to your font.\n"
- "\n");
- tngcd[5].creator = GButtonCreate;
-
- tngcd[6].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- tnlabel[6].text = (unichar_t *) S_("OFL website");
- tnlabel[6].text_is_1byte = true;
- tnlabel[6].text_in_resource = true;
- tngcd[6].gd.label = &tnlabel[6];
- tngcd[6].gd.handle_controlevent = GFI_HelpOFL;
- tngcd[6].gd.popup_msg = (unichar_t *) _(
- "\n"
- "Click here to go to http://scripts.sil.org/OFL \n"
- "to get all the details about the Open Font License \n"
- "and to read the corresponding FAQ. \n"
- "\n");
- tngcd[6].creator = GButtonCreate;
- tnharray2[0] = &tngcd[5]; tnharray2[1] = &tngcd[6]; tnharray2[2] = GCD_Glue; tnharray2[3] = NULL;
- tnvarray[0] = &tnboxes[2]; tnvarray[1] = &tngcd[4]; tnvarray[2] = &tnboxes[3]; tnvarray[3] = NULL;
-
- tnboxes[0].gd.flags = gg_enabled|gg_visible;
- tnboxes[0].gd.u.boxelements = tnvarray;
- tnboxes[0].creator = GVBoxCreate;
-
- tnboxes[2].gd.flags = gg_enabled|gg_visible;
- tnboxes[2].gd.u.boxelements = tnharray;
- tnboxes[2].creator = GHBoxCreate;
-
- tnboxes[3].gd.flags = gg_enabled|gg_visible;
- tnboxes[3].gd.u.boxelements = tnharray2;
- tnboxes[3].creator = GHBoxCreate;
-/******************************************************************************/
- memset(&comlabel,0,sizeof(comlabel));
- memset(&comgcd,0,sizeof(comgcd));
-
- comgcd[0].gd.pos.x = 10; comgcd[0].gd.pos.y = 10;
- comgcd[0].gd.pos.width = ngcd[11].gd.pos.width; comgcd[0].gd.pos.height = 230;
- comgcd[0].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
- comgcd[0].gd.cid = CID_Comment;
- comlabel[0].text = (unichar_t *) sf->comments;
- comlabel[0].text_is_1byte = true;
- if ( comlabel[0].text==NULL ) comlabel[0].text = (unichar_t *) "";
- comgcd[0].gd.label = &comlabel[0];
- comgcd[0].creator = GTextAreaCreate;
-
- comarray[0] = &comgcd[0]; comarray[1] = NULL;
- memset(combox,0,sizeof(combox));
- combox[0].gd.flags = gg_enabled|gg_visible;
- combox[0].gd.u.boxelements = comarray;
- combox[0].creator = GHBoxCreate;
-
-/******************************************************************************/
- memset(&mklabel,0,sizeof(mklabel));
- memset(&mkgcd,0,sizeof(mkgcd));
-
- mkgcd[0].gd.pos.x = 10; mkgcd[0].gd.pos.y = 10;
- mkgcd[0].gd.pos.width = ngcd[15].gd.pos.width; mkgcd[0].gd.pos.height = 200;
- mkgcd[0].gd.flags = gg_visible | gg_enabled;
- mkgcd[0].gd.cid = CID_MarkClasses;
- mkgcd[0].gd.u.list = MarkClassesList(sf);
- mkgcd[0].gd.handle_controlevent = GFI_MarkSelChanged;
- mkgcd[0].creator = GListCreate;
-
- mkgcd[1].gd.pos.x = 10; mkgcd[1].gd.pos.y = mkgcd[0].gd.pos.y+mkgcd[0].gd.pos.height+4;
- mkgcd[1].gd.pos.width = -1;
- mkgcd[1].gd.flags = gg_visible | gg_enabled;
-/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "_New...", ignore "Mark|" */
- mklabel[1].text = (unichar_t *) S_("Mark|_New...");
- mklabel[1].text_is_1byte = true;
- mklabel[1].text_in_resource = true;
- mkgcd[1].gd.label = &mklabel[1];
- mkgcd[1].gd.cid = CID_MarkNew;
- mkgcd[1].gd.handle_controlevent = GFI_MarkNew;
- mkgcd[1].creator = GButtonCreate;
-
- mkgcd[2].gd.pos.x = -10; mkgcd[2].gd.pos.y = mkgcd[1].gd.pos.y;
- mkgcd[2].gd.pos.width = -1;
- mkgcd[2].gd.flags = gg_visible;
- mklabel[2].text = (unichar_t *) _("_Edit...");
- mklabel[2].text_is_1byte = true;
- mklabel[2].text_in_resource = true;
- mkgcd[2].gd.label = &mklabel[2];
- mkgcd[2].gd.cid = CID_MarkEdit;
- mkgcd[2].gd.handle_controlevent = GFI_MarkEdit;
- mkgcd[2].creator = GButtonCreate;
-
- mkarray[0] = &mkgcd[0]; mkarray[1] = &mkbox[2]; mkarray[2] = NULL;
- mkarray2[0] = &mkgcd[1]; mkarray2[1] = GCD_Glue; mkarray2[2] = &mkgcd[2];
- mkarray2[3] = NULL;
- memset(mkbox,0,sizeof(mkbox));
- mkbox[0].gd.flags = gg_enabled|gg_visible;
- mkbox[0].gd.u.boxelements = mkarray;
- mkbox[0].creator = GVBoxCreate;
-
- mkbox[2].gd.flags = gg_enabled|gg_visible;
- mkbox[2].gd.u.boxelements = mkarray2;
- mkbox[2].creator = GHBoxCreate;
-/******************************************************************************/
- memset(&txlabel,0,sizeof(txlabel));
- memset(&txgcd,0,sizeof(txgcd));
-
- k=0;
- txlabel[k].text = (unichar_t *) U_("\316\244\316\265\316\247 General");
- txlabel[k].text_is_1byte = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = 10;
- txgcd[k].gd.flags = gg_visible | gg_enabled;
- txgcd[k].gd.cid = CID_TeXText;
- txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
- txgcd[k++].creator = GRadioCreate;
-
- txlabel[k].text = (unichar_t *) U_("\316\244\316\265\316\247 Math Symbol");
- txlabel[k].text_is_1byte = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.pos.x = 80; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
- txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
- txgcd[k].gd.cid = CID_TeXMathSym;
- txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
- txgcd[k++].creator = GRadioCreate;
-
- txlabel[k].text = (unichar_t *) U_("\316\244\316\265\316\247 Math Extension");
- txlabel[k].text_is_1byte = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.pos.x = 155; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y;
- txgcd[k].gd.flags = gg_visible | gg_enabled | gg_rad_continueold;
- txgcd[k].gd.cid = CID_TeXMathExt;
- txgcd[k].gd.handle_controlevent = GFI_TeXChanged;
- txgcd[k++].creator = GRadioCreate;
-
- for ( i=j=0; texparams[i]!=0; ++i ) {
- txlabel[k].text = (unichar_t *) texparams[i];
- txlabel[k].text_is_1byte = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.pos.x = 10; txgcd[k].gd.pos.y = txgcd[k-2].gd.pos.y+26;
- txgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- txgcd[k].gd.popup_msg = (unichar_t *) texpopups[i];
- txarray2[j++] = &txgcd[k];
- txgcd[k++].creator = GLabelCreate;
-
- txgcd[k].gd.pos.x = 70; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y-4;
- txgcd[k].gd.flags = gg_visible | gg_enabled;
- txgcd[k].gd.cid = CID_TeX + i;
- txarray2[j++] = &txgcd[k];
- txgcd[k++].creator = GTextFieldCreate;
- txarray2[j++] = GCD_Glue;
- txarray2[j++] = NULL;
- }
- txgcd[k-2].gd.cid = CID_TeXExtraSpLabel;
- txarray2[j++] = NULL;
-
-/* GT: More Parameters */
- txlabel[k].text = (unichar_t *) _("More Params");
- txlabel[k].text_is_1byte = true;
- txgcd[k].gd.label = &txlabel[k];
- txgcd[k].gd.pos.x = 20; txgcd[k].gd.pos.y = txgcd[k-1].gd.pos.y+26;
- txgcd[k].gd.flags = gg_visible | gg_enabled;
- txgcd[k].gd.handle_controlevent = GFI_MoreParams;
- txgcd[k].gd.cid = CID_MoreParams;
- txgcd[k++].creator = GButtonCreate;
-
- txarray[0] = &txbox[2]; txarray[1] = &txbox[3]; txarray[2] = &txbox[4]; txarray[3] = GCD_Glue; txarray[4] = NULL;
- txarray3[0] = &txgcd[0]; txarray3[1] = GCD_Glue; txarray3[2] = &txgcd[1];
- txarray3[3] = GCD_Glue; txarray3[4] = &txgcd[2]; txarray3[5] = NULL;
- txarray4[0] = GCD_Glue; txarray4[1] = &txgcd[k-1];
- txarray4[2] = txarray4[3] = txarray4[4] = GCD_Glue; txarray4[5] = NULL;
- memset(txbox,0,sizeof(txbox));
- txbox[0].gd.flags = gg_enabled|gg_visible;
- txbox[0].gd.u.boxelements = txarray;
- txbox[0].creator = GVBoxCreate;
-
- txbox[2].gd.flags = gg_enabled|gg_visible;
- txbox[2].gd.u.boxelements = txarray3;
- txbox[2].creator = GHBoxCreate;
-
- txbox[3].gd.flags = gg_enabled|gg_visible;
- txbox[3].gd.u.boxelements = txarray2;
- txbox[3].creator = GHVBoxCreate;
-
- txbox[4].gd.flags = gg_enabled|gg_visible;
- txbox[4].gd.u.boxelements = txarray4;
- txbox[4].creator = GHBoxCreate;
-/******************************************************************************/
- memset(&szlabel,0,sizeof(szlabel));
- memset(&szgcd,0,sizeof(szgcd));
-
- k=0;
-
- szlabel[k].text = (unichar_t *) _("De_sign Size:");
- szlabel[k].text_is_1byte = true;
- szlabel[k].text_in_resource = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = 9;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- szgcd[k].gd.popup_msg = (unichar_t *) _("The size (in points) for which this face was designed");
- szgcd[k++].creator = GLabelCreate;
-
- sprintf(dszbuf, "%.1f", sf->design_size/10.0);
- szlabel[k].text = (unichar_t *) dszbuf;
- szlabel[k].text_is_1byte = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
- szgcd[k].gd.pos.width = 60;
- szgcd[k].gd.flags = gg_visible | gg_enabled;
- szgcd[k].gd.cid = CID_DesignSize;
- szgcd[k++].creator = GTextFieldCreate;
-
- szlabel[k].text = (unichar_t *) S_("Size|Points");
- szlabel[k].text_is_1byte = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 134; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- szgcd[k].gd.popup_msg = (unichar_t *) _("The size (in points) for which this face was designed");
- szgcd[k++].creator = GLabelCreate;
-
- szlabel[k].text = (unichar_t *) _("Design Range");
- szlabel[k].text_is_1byte = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+24;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- szgcd[k].gd.popup_msg = (unichar_t *) _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
- szgcd[k++].creator = GLabelCreate;
-
- szgcd[k].gd.pos.x = 8; szgcd[k].gd.pos.y = GDrawPointsToPixels(NULL,szgcd[k-1].gd.pos.y+6);
- szgcd[k].gd.pos.width = pos.width-32; szgcd[k].gd.pos.height = GDrawPointsToPixels(NULL,36);
- szgcd[k].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- szgcd[k++].creator = GGroupCreate;
-
- szlabel[k].text = (unichar_t *) _("_Bottom:");
- szlabel[k].text_is_1byte = true;
- szlabel[k].text_in_resource = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+18;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- szgcd[k].gd.popup_msg = (unichar_t *) _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
- szgcd[k++].creator = GLabelCreate;
-
- sprintf(dsbbuf, "%.1f", sf->design_range_bottom/10.0);
- szlabel[k].text = (unichar_t *) dsbbuf;
- szlabel[k].text_is_1byte = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
- szgcd[k].gd.pos.width = 60;
- szgcd[k].gd.flags = gg_visible | gg_enabled;
- szgcd[k].gd.cid = CID_DesignBottom;
- szgcd[k++].creator = GTextFieldCreate;
-
- szlabel[k].text = (unichar_t *) _("_Top:");
- szlabel[k].text_is_1byte = true;
- szlabel[k].text_in_resource = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 140; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- szgcd[k].gd.popup_msg = (unichar_t *) _("The range of sizes (in points) to which this face applies.\nLower bound is exclusive, upper bound is inclusive.");
- szgcd[k++].creator = GLabelCreate;
-
- sprintf(dstbuf, "%.1f", sf->design_range_top/10.0);
- szlabel[k].text = (unichar_t *) dstbuf;
- szlabel[k].text_is_1byte = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 180; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
- szgcd[k].gd.pos.width = 60;
- szgcd[k].gd.flags = gg_visible | gg_enabled;
- szgcd[k].gd.cid = CID_DesignTop;
- szgcd[k++].creator = GTextFieldCreate;
-
- szlabel[k].text = (unichar_t *) _("Style _ID:");
- szlabel[k].text_is_1byte = true;
- szlabel[k].text_in_resource = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = GDrawPixelsToPoints(NULL,szgcd[k-5].gd.pos.y+szgcd[k-5].gd.pos.height)+10;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- szgcd[k].gd.popup_msg = (unichar_t *) _("This is an identifying number shared by all members of\nthis font family with the same style (I.e. 10pt Bold and\n24pt Bold would have the same id, but 10pt Italic would not");
- szgcd[k++].creator = GLabelCreate;
-
- sprintf(sibuf, "%d", sf->fontstyle_id);
- szlabel[k].text = (unichar_t *) sibuf;
- szlabel[k].text_is_1byte = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 70; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y-4;
- szgcd[k].gd.pos.width = 60;
- szgcd[k].gd.flags = gg_visible | gg_enabled;
- szgcd[k].gd.cid = CID_StyleID;
- szgcd[k++].creator = GTextFieldCreate;
-
- szlabel[k].text = (unichar_t *) _("Style Name:");
- szlabel[k].text_is_1byte = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.pos.x = 14; szgcd[k].gd.pos.y = szgcd[k-2].gd.pos.y+22;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- szgcd[k].gd.popup_msg = (unichar_t *) _("This provides a set of names used to identify the\nstyle of this font. Names may be translated into multiple\nlanguages (English is required, others are optional)\nAll fonts with the same Style ID should share this name.");
- szgcd[k++].creator = GLabelCreate;
-
- szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y+14;
- szgcd[k].gd.pos.width = ngcd[15].gd.pos.width; szgcd[k].gd.pos.height = 100;
- szgcd[k].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic;
- szgcd[k].gd.cid = CID_StyleName;
- szgcd[k].gd.handle_controlevent = GFI_StyleNameSelChanged;
- szgcd[k++].creator = GListCreate;
-
- szgcd[k].gd.pos.x = 10; szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y+szgcd[k-1].gd.pos.height+4;
- szgcd[k].gd.pos.width = -1;
- szgcd[k].gd.flags = gg_visible | gg_enabled;
- szlabel[k].text = (unichar_t *) S_("StyleName|_New...");
- szlabel[k].text_is_1byte = true;
- szlabel[k].text_in_resource = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.cid = CID_StyleNameNew;
- szgcd[k].gd.handle_controlevent = GFI_StyleNameNew;
- szgcd[k++].creator = GButtonCreate;
-
- szgcd[k].gd.pos.x = 20+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y;
- szgcd[k].gd.pos.width = -1;
- szgcd[k].gd.flags = gg_visible;
- szlabel[k].text = (unichar_t *) _("_Delete");
- szlabel[k].text_is_1byte = true;
- szlabel[k].text_in_resource = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.cid = CID_StyleNameDel;
- szgcd[k].gd.handle_controlevent = GFI_StyleNameDel;
- szgcd[k++].creator = GButtonCreate;
-
- szgcd[k].gd.pos.x = 10 + 2*(10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor));
- szgcd[k].gd.pos.y = szgcd[k-1].gd.pos.y;
- szgcd[k].gd.pos.width = -1;
- szgcd[k].gd.flags = gg_visible;
- szlabel[k].text = (unichar_t *) _("_Edit...");
- szlabel[k].text_is_1byte = true;
- szlabel[k].text_in_resource = true;
- szgcd[k].gd.label = &szlabel[k];
- szgcd[k].gd.cid = CID_StyleNameRename;
- szgcd[k].gd.handle_controlevent = GFI_StyleNameRename;
- szgcd[k++].creator = GButtonCreate;
-
- szarray[0] = &szbox[2];
- szarray[1] = &szbox[3];
- szarray[2] = &szbox[4];
- szarray[3] = &szgcd[11];
- szarray[4] = &szgcd[12];
- szarray[5] = &szbox[5];
- szarray[6] = NULL;
-
- szarray2[0] = &szgcd[0]; szarray2[1] = &szgcd[1]; szarray2[2] = &szgcd[2]; szarray2[3] = GCD_Glue; szarray2[4] = NULL;
- szarray3[0] = &szgcd[5]; szarray3[1] = &szgcd[6]; szarray3[2] = &szgcd[7]; szarray3[3] = &szgcd[8]; szarray3[4] = GCD_Glue; szarray3[5] = NULL;
- szarray3[6] = NULL;
- szarray4[0] = &szgcd[9]; szarray4[1] = &szgcd[10]; szarray4[2] = GCD_Glue; szarray4[3] = NULL;
- szarray5[0] = &szgcd[13]; szarray5[1] = GCD_Glue;
- szarray5[2] = &szgcd[14]; szarray5[3] = GCD_Glue;
- szarray5[4] = &szgcd[15]; szarray5[5] = NULL;
-
- memset(szbox,0,sizeof(szbox));
- szbox[0].gd.flags = gg_enabled|gg_visible;
- szbox[0].gd.u.boxelements = szarray;
- szbox[0].creator = GVBoxCreate;
-
- szbox[2].gd.flags = gg_enabled|gg_visible;
- szbox[2].gd.u.boxelements = szarray2;
- szbox[2].creator = GHBoxCreate;
-
- szbox[3].gd.flags = gg_enabled|gg_visible;
- szbox[3].gd.label = (GTextInfo *) &szgcd[3];
- szbox[3].gd.u.boxelements = szarray3;
- szbox[3].creator = GHVGroupCreate;
-
- szbox[4].gd.flags = gg_enabled|gg_visible;
- szbox[4].gd.u.boxelements = szarray4;
- szbox[4].creator = GHBoxCreate;
-
- szbox[5].gd.flags = gg_enabled|gg_visible;
- szbox[5].gd.u.boxelements = szarray5;
- szbox[5].creator = GHBoxCreate;
-
-/******************************************************************************/
- memset(&mcgcd,0,sizeof(mcgcd));
- memset(&mclabel,'\0',sizeof(mclabel));
-
- k=0;
- mclabel[k].text = (unichar_t *) _("Mac Style Set:");
- mclabel[k].text_is_1byte = true;
- mcgcd[k].gd.label = &mclabel[k];
- mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 7;
- mcgcd[k].gd.flags = gg_visible | gg_enabled;
- mcgcd[k++].creator = GLabelCreate;
-
- mclabel[k].text = (unichar_t *) _("Automatic");
- mclabel[k].text_is_1byte = true;
- mcgcd[k].gd.label = &mclabel[k];
- mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = 20;
- mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
- mcgcd[k].gd.cid = CID_MacAutomatic;
- mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
- mcgcd[k++].creator = GRadioCreate;
-
- mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = 20;
- mcgcd[k].gd.flags = (sf->macstyle!=-1) ? (gg_visible | gg_enabled | gg_cb_on | gg_rad_continueold) : (gg_visible | gg_enabled | gg_rad_continueold);
- mcgcd[k].gd.handle_controlevent = GFI_MacAutomatic;
- mcgcd[k++].creator = GRadioCreate;
-
- mcgcd[k].gd.pos.x = 110; mcgcd[k].gd.pos.y = 20;
- mcgcd[k].gd.pos.width = 120; mcgcd[k].gd.pos.height = 7*12+10;
- mcgcd[k].gd.flags = (sf->macstyle==-1) ? (gg_visible | gg_list_multiplesel) : (gg_visible | gg_enabled | gg_list_multiplesel);
- mcgcd[k].gd.cid = CID_MacStyles;
- mcgcd[k].gd.u.list = macstyles;
- mcgcd[k++].creator = GListCreate;
-
- mclabel[k].text = (unichar_t *) _("FOND Name:");
- mclabel[k].text_is_1byte = true;
- mcgcd[k].gd.label = &mclabel[k];
- mcgcd[k].gd.pos.x = 10; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y + mcgcd[k-1].gd.pos.height+8;
- mcgcd[k].gd.flags = gg_visible | gg_enabled;
- mcgcd[k++].creator = GLabelCreate;
-
- mclabel[k].text = (unichar_t *) sf->fondname;
- mclabel[k].text_is_1byte = true;
- mcgcd[k].gd.label = sf->fondname==NULL ? NULL : &mclabel[k];
- mcgcd[k].gd.pos.x = 90; mcgcd[k].gd.pos.y = mcgcd[k-1].gd.pos.y - 4;
- mcgcd[k].gd.flags = gg_visible | gg_enabled;
- mcgcd[k].gd.cid = CID_MacFOND;
- mcgcd[k++].creator = GTextFieldCreate;
-
-
- mcs = MacStyleCode(sf,NULL);
- for ( i=0; macstyles[i].text!=NULL; ++i )
- macstyles[i].selected = (mcs&(int) (intpt) macstyles[i].userdata)? 1 : 0;
-
- mcarray[0] = &mcgcd[0]; mcarray[1] = GCD_Glue; mcarray[2] = NULL;
- mcarray[3] = &mcbox[2]; mcarray[4] = &mcgcd[3]; mcarray[5] = NULL;
- mcarray[6] = &mcgcd[4]; mcarray[7] = &mcgcd[5]; mcarray[8] = NULL;
- mcarray[9] = GCD_Glue; mcarray[10] = GCD_Glue; mcarray[11] = NULL;
- mcarray[12] = NULL;
- mcarray2[0] = &mcgcd[1]; mcarray2[1] = &mcgcd[2]; mcarray2[2] = NULL;
- mcarray2[3] = GCD_Glue; mcarray2[4] = GCD_Glue; mcarray2[5] = NULL;
- mcarray2[6] = NULL;
-
- memset(mcbox,0,sizeof(mcbox));
- mcbox[0].gd.flags = gg_enabled|gg_visible;
- mcbox[0].gd.u.boxelements = mcarray;
- mcbox[0].creator = GHVBoxCreate;
-
- mcbox[2].gd.flags = gg_enabled|gg_visible;
- mcbox[2].gd.u.boxelements = mcarray2;
- mcbox[2].creator = GHVBoxCreate;
-
-/******************************************************************************/
- memset(&lksubgcd,0,sizeof(lksubgcd));
- memset(&lkgcd,0,sizeof(lkgcd));
- memset(&lkaspects,'\0',sizeof(lkaspects));
- memset(&lkbox,'\0',sizeof(lkbox));
- memset(&lkbuttonsgcd,'\0',sizeof(lkbuttonsgcd));
- memset(&lkbuttonslabel,'\0',sizeof(lkbuttonslabel));
-
- LookupSetup(&d->tables[0],sf->gsub_lookups);
- LookupSetup(&d->tables[1],sf->gpos_lookups);
-
- i=0;
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Moves the currently selected lookup to be first in the lookup ordering\nor moves the currently selected subtable to be first in its lookup.");
- lkbuttonslabel[i].text = (unichar_t *) _("_Top");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_LookupTop;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Moves the currently selected lookup before the previous lookup\nor moves the currently selected subtable before the previous subtable.");
- lkbuttonslabel[i].text = (unichar_t *) _("_Up");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_LookupUp;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Moves the currently selected lookup after the next lookup\nor moves the currently selected subtable after the next subtable.");
- lkbuttonslabel[i].text = (unichar_t *) _("_Down");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_LookupDown;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Moves the currently selected lookup to the end of the lookup chain\nor moves the currently selected subtable to be the last subtable in the lookup");
- lkbuttonslabel[i].text = (unichar_t *) _("_Bottom");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_LookupBottom;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupOrder;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Sorts the lookups in a default ordering based on feature tags");
- lkbuttonslabel[i].text = (unichar_t *) _("_Sort");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_LookupSort;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupSort;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled ;
- lkbuttonsgcd[i++].creator = GLineCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_enabled | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Adds a new lookup after the selected lookup\nor at the start of the lookup list if nothing is selected.");
- lkbuttonslabel[i].text = (unichar_t *) _("Add _Lookup");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_AddLookup;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddLookup;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Adds a new lookup subtable after the selected subtable\nor at the start of the lookup if nothing is selected.");
- lkbuttonslabel[i].text = (unichar_t *) _("Add Sub_table");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_AddSubtable;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupAddSubtable;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Edits a lookup or lookup subtable.");
- lkbuttonslabel[i].text = (unichar_t *) _("Edit _Metadata");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_EditMetadata;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditMetadata;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Edits the transformations in a lookup subtable.");
- lkbuttonslabel[i].text = (unichar_t *) _("_Edit Data");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_EditSubtable;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupEditSubtableContents;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Deletes any selected lookups and their subtables, or deletes any selected subtables.\nThis will also delete any transformations associated with those subtables.");
- lkbuttonslabel[i].text = (unichar_t *) _("De_lete");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_DeleteLookup;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupDeleteLookup;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Merges two selected (and compatible) lookups into one,\nor merges two selected subtables of a lookup into one");
- lkbuttonslabel[i].text = (unichar_t *) _("_Merge");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_MergeLookup;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupMergeLookup;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Reverts the lookup list to its original condition.\nBut any changes to subtable data will remain.");
- lkbuttonslabel[i].text = (unichar_t *) _("_Revert");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_RevertLookups;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupRevertLookup;
- lkbuttonsgcd[i++].creator = GButtonCreate;
-
- lkbuttonsarray[i] = &lkbuttonsgcd[i];
- lkbuttonsgcd[i].gd.flags = gg_visible | gg_utf8_popup ;
- lkbuttonsgcd[i].gd.popup_msg = (unichar_t *) _("Imports a lookup (and all its subtables) from another font.");
- lkbuttonslabel[i].text = (unichar_t *) _("_Import");
- lkbuttonslabel[i].text_is_1byte = true;
- lkbuttonslabel[i].text_in_resource = true;
- lkbuttonsgcd[i].gd.label = &lkbuttonslabel[i];
- lkbuttonsgcd[i].gd.cid = CID_ImportLookups;
- lkbuttonsgcd[i].gd.handle_controlevent = GFI_LookupImportLookup;
- lkbuttonsgcd[i++].creator = GButtonCreate;
- lkbuttonsarray[i] = GCD_Glue;
- lkbuttonsarray[i+1] = NULL;
-
- for ( i=0; i<2; ++i ) {
- lkaspects[i].text = (unichar_t *) (i?"GPOS":"GSUB");
- lkaspects[i].text_is_1byte = true;
- lkaspects[i].gcd = &lkbox[2*i];
-
- lksubgcd[i][0].gd.pos.x = 10; lksubgcd[i][0].gd.pos.y = 10;
- lksubgcd[i][0].gd.pos.width = ngcd[15].gd.pos.width;
- lksubgcd[i][0].gd.pos.height = 150;
- lksubgcd[i][0].gd.flags = gg_visible | gg_enabled;
- lksubgcd[i][0].gd.u.drawable_e_h = i ? gposlookups_e_h : gsublookups_e_h;
- lksubgcd[i][0].gd.cid = CID_LookupWin+i;
- lksubgcd[i][0].creator = GDrawableCreate;
-
- lksubgcd[i][1].gd.pos.x = 10; lksubgcd[i][1].gd.pos.y = 10;
- lksubgcd[i][1].gd.pos.height = 150;
- lksubgcd[i][1].gd.flags = gg_visible | gg_enabled | gg_sb_vert;
- lksubgcd[i][1].gd.cid = CID_LookupVSB+i;
- lksubgcd[i][1].gd.handle_controlevent = LookupsVScroll;
- lksubgcd[i][1].creator = GScrollBarCreate;
-
- lksubgcd[i][2].gd.pos.x = 10; lksubgcd[i][2].gd.pos.y = 10;
- lksubgcd[i][2].gd.pos.width = 150;
- lksubgcd[i][2].gd.flags = gg_visible | gg_enabled;
- lksubgcd[i][2].gd.cid = CID_LookupHSB+i;
- lksubgcd[i][2].gd.handle_controlevent = LookupsHScroll;
- lksubgcd[i][2].creator = GScrollBarCreate;
-
- lksubgcd[i][3].gd.pos.x = 10; lksubgcd[i][3].gd.pos.y = 10;
- lksubgcd[i][3].gd.pos.width = lksubgcd[i][3].gd.pos.height = _GScrollBar_Width;
- lksubgcd[i][3].gd.flags = gg_visible | gg_enabled | gg_tabset_nowindow;
- lksubgcd[i][3].creator = GDrawableCreate;
-
- lkarray[i][0] = &lksubgcd[i][0]; lkarray[i][1] = &lksubgcd[i][1]; lkarray[i][2] = NULL;
- lkarray[i][3] = &lksubgcd[i][2]; lkarray[i][4] = &lksubgcd[i][3]; lkarray[i][5] = NULL;
- lkarray[i][6] = NULL;
-
- lkbox[2*i].gd.flags = gg_enabled|gg_visible;
- lkbox[2*i].gd.u.boxelements = lkarray[i];
- lkbox[2*i].creator = GHVBoxCreate;
- }
-
- lkaspects[0].selected = true;
-
- lkgcd[0].gd.pos.x = 4; lkgcd[0].gd.pos.y = 10;
- lkgcd[0].gd.pos.width = 250;
- lkgcd[0].gd.pos.height = 260;
- lkgcd[0].gd.u.tabs = lkaspects;
- lkgcd[0].gd.flags = gg_visible | gg_enabled;
- lkgcd[0].gd.cid = CID_Lookups;
- lkgcd[0].gd.handle_controlevent = GFI_LookupAspectChange;
- lkgcd[0].creator = GTabSetCreate;
-
- lkharray[0] = &lkgcd[0]; lkharray[1] = &lkbox[4]; lkharray[2] = NULL;
-
- lkbox[4].gd.flags = gg_enabled|gg_visible;
- lkbox[4].gd.u.boxelements = lkbuttonsarray;
- lkbox[4].creator = GVBoxCreate;
-
- lkbox[5].gd.flags = gg_enabled|gg_visible;
- lkbox[5].gd.u.boxelements = lkharray;
- lkbox[5].creator = GHBoxCreate;
-
-
-/******************************************************************************/
- memset(&mfgcd,0,sizeof(mfgcd));
- memset(&mflabel,'\0',sizeof(mflabel));
- memset(mfbox,0,sizeof(mfbox));
-
- GCDFillMacFeat(mfgcd,mflabel,250,sf->features, false, mfbox, mfarray);
-/******************************************************************************/
-
- memset(&dlabel,0,sizeof(dlabel));
- memset(&dgcd,0,sizeof(dgcd));
-
- dlabel[0].text = (unichar_t *) _("Creation Date:");
- dlabel[0].text_is_1byte = true;
- dlabel[0].text_in_resource = true;
- dgcd[0].gd.label = &dlabel[0];
- dgcd[0].gd.pos.x = 12; dgcd[0].gd.pos.y = 6+6;
- dgcd[0].gd.flags = gg_visible | gg_enabled;
- dgcd[0].creator = GLabelCreate;
-
- t = sf->creationtime;
- tm = localtime(&t);
- strftime(createtime,sizeof(createtime),"%c",tm);
- tmpcreatetime = def2u_copy(createtime);
- dgcd[1].gd.pos.x = 115; dgcd[1].gd.pos.y = dgcd[0].gd.pos.y;
- dgcd[1].gd.flags = gg_visible | gg_enabled;
- dlabel[1].text = tmpcreatetime;
- dgcd[1].gd.label = &dlabel[1];
- dgcd[1].creator = GLabelCreate;
-
- dlabel[2].text = (unichar_t *) _("Modification Date:");
- dlabel[2].text_is_1byte = true;
- dlabel[2].text_in_resource = true;
- dgcd[2].gd.label = &dlabel[2];
- dgcd[2].gd.pos.x = 12; dgcd[2].gd.pos.y = dgcd[0].gd.pos.y+14;
- dgcd[2].gd.flags = gg_visible | gg_enabled;
- dgcd[2].creator = GLabelCreate;
-
- t = sf->modificationtime;
- tm = localtime(&t);
- strftime(modtime,sizeof(modtime),"%c",tm);
- tmpmodtime = def2u_copy(modtime);
- dgcd[3].gd.pos.x = 115; dgcd[3].gd.pos.y = dgcd[2].gd.pos.y;
- dgcd[3].gd.flags = gg_visible | gg_enabled;
- dlabel[3].text = tmpmodtime;
- dgcd[3].gd.label = &dlabel[3];
- dgcd[3].creator = GLabelCreate;
-
- darray[0] = &dgcd[0]; darray[1] = &dgcd[1]; darray[2] = NULL;
- darray[3] = &dgcd[2]; darray[4] = &dgcd[3]; darray[5] = NULL;
- darray[6] = GCD_Glue; darray[7] = GCD_Glue; darray[8] = NULL;
- darray[9] = NULL;
-
- memset(dbox,0,sizeof(dbox));
- dbox[0].gd.flags = gg_enabled|gg_visible;
- dbox[0].gd.u.boxelements = darray;
- dbox[0].creator = GHVBoxCreate;
-/******************************************************************************/
-
- memset(&ulabel,0,sizeof(ulabel));
- memset(&ugcd,0,sizeof(ugcd));
-
- ulabel[0].text = (unichar_t *) _("Include Empty Blocks");
- ulabel[0].text_is_1byte = true;
- ulabel[0].text_in_resource = true;
- ugcd[0].gd.label = &ulabel[0];
- ugcd[0].gd.pos.x = 12; ugcd[0].gd.pos.y = 10;
- ugcd[0].gd.flags = gg_visible | gg_enabled;
- ugcd[0].gd.handle_controlevent = GFI_UnicodeEmptiesChange;
- ugcd[0].gd.cid = CID_UnicodeEmpties;
- ugcd[0].creator = GCheckBoxCreate;
-
- ugcd[1].gd.pos.x = 12; ugcd[1].gd.pos.y = 30;
- ugcd[1].gd.pos.width = ngcd[15].gd.pos.width;
- ugcd[1].gd.pos.height = 200;
- ugcd[1].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- ugcd[1].gd.cid = CID_Unicode;
- ugcd[1].gd.handle_controlevent = GFI_UnicodeRangeChange;
- ugcd[1].gd.popup_msg = (unichar_t *) _("Click on a range to select characters in that range.\nDouble click on a range to see characters that should be\nin the range but aren't.");
- ugcd[1].creator = GListCreate;
-
- uarray[0] = &ugcd[0]; uarray[1] = &ugcd[1]; uarray[2] = NULL;
-
- memset(ubox,0,sizeof(ubox));
- ubox[0].gd.flags = gg_enabled|gg_visible;
- ubox[0].gd.u.boxelements = uarray;
- ubox[0].creator = GVBoxCreate;
-
-/******************************************************************************/
-
- memset(&mlabel,0,sizeof(mlabel));
- memset(&mgcd,0,sizeof(mgcd));
- memset(&aspects,'\0',sizeof(aspects));
-
- i = 0;
-
- aspects[i].text = (unichar_t *) _("Names");
- d->old_aspect = 0;
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = nb;
-
- aspects[i].text = (unichar_t *) _("General");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = psb;
-
- aspects[i].text = (unichar_t *) _("PS UID");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = xub;
-
- d->private_aspect = i;
- aspects[i].text = (unichar_t *) _("PS Private");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = ppbox;
-
- d->ttfv_aspect = i;
- aspects[i].text = (unichar_t *) _("OS/2");
- if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = vagcd;
-
- d->tn_aspect = i;
- if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
- aspects[i].text = (unichar_t *) _("TTF Names");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = tnboxes;
-
- if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
- aspects[i].text = (unichar_t *) _("Grid Fitting");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = gaspboxes;
-
- d->tx_aspect = i;
-/* xgettext won't use non-ASCII messages */
- aspects[i].text = (unichar_t *) U_("\316\244\316\265\316\247"); /* Tau epsilon Chi, in greek */
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = txbox;
-
- if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
- aspects[i].text = (unichar_t *) _("Size");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = szbox;
-
- aspects[i].text = (unichar_t *) _("Comment");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = combox;
-
- if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
- aspects[i].text = (unichar_t *) _("Mark Classes");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = mkbox;
-
-/* GT: OpenType GPOS/GSUB lookups */
- if ( sf->cidmaster!=NULL ) aspects[i].disabled = true;
- aspects[i].text = (unichar_t *) S_("OpenType|Lookups");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = &lkbox[5];
-
- aspects[i].text = (unichar_t *) _("Mac");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = mcbox;
-
- aspects[i].text = (unichar_t *) _("Mac Features");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = mfbox;
-
-#ifndef FONTFORGE_CONFIG_INFO_HORIZONTAL
- aspects[i].text = (unichar_t *) _("Dates");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = dbox;
-
- d->unicode_aspect = i;
- aspects[i].text = (unichar_t *) _("Unicode Ranges");
- aspects[i].text_is_1byte = true;
- aspects[i++].gcd = ubox;
-#endif
-
- aspects[defaspect].selected = true;
-
- mgcd[0].gd.pos.x = 4; mgcd[0].gd.pos.y = 6;
- mgcd[0].gd.u.tabs = aspects;
-#ifndef FONTFORGE_CONFIG_INFO_HORIZONTAL
- mgcd[0].gd.flags = gg_visible | gg_enabled | gg_tabset_vert;
- mgcd[0].gd.pos.width = 260+85;
- mgcd[0].gd.pos.height = 325;
-#else
- mgcd[0].gd.flags = gg_visible | gg_enabled;
- mgcd[0].gd.pos.width = 260;
- mgcd[0].gd.pos.height = 325;
-#endif
- mgcd[0].gd.handle_controlevent = GFI_AspectChange;
- mgcd[0].gd.cid = CID_Tabs;
- mgcd[0].creator = GTabSetCreate;
-
- mgcd[1].gd.pos.x = 30-3; mgcd[1].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
- mgcd[1].gd.pos.width = -1; mgcd[1].gd.pos.height = 0;
- mgcd[1].gd.flags = gg_visible | gg_enabled | gg_but_default;
- mlabel[1].text = (unichar_t *) _("_OK");
- mlabel[1].text_is_1byte = true;
- mlabel[1].text_in_resource = true;
- mgcd[1].gd.label = &mlabel[1];
- mgcd[1].gd.handle_controlevent = GFI_OK;
- mgcd[1].gd.cid = CID_OK;
- mgcd[1].creator = GButtonCreate;
-
- mgcd[2].gd.pos.x = -30; mgcd[2].gd.pos.y = mgcd[1].gd.pos.y+3;
- mgcd[2].gd.pos.width = -1; mgcd[2].gd.pos.height = 0;
- mgcd[2].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- mlabel[2].text = (unichar_t *) _("_Cancel");
- mlabel[2].text_is_1byte = true;
- mlabel[2].text_in_resource = true;
- mgcd[2].gd.label = &mlabel[2];
- mgcd[2].gd.handle_controlevent = GFI_Cancel;
- mgcd[2].gd.cid = CID_Cancel;
- mgcd[2].creator = GButtonCreate;
-
- mgcd[3].gd.pos.x = 2; mgcd[3].gd.pos.y = 2;
- mgcd[3].gd.pos.width = pos.width-4; mgcd[3].gd.pos.height = pos.height-4;
- mgcd[3].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- mgcd[3].gd.cid = CID_MainGroup;
- mgcd[3].creator = GGroupCreate;
-
- marray2[0] = marray2[2] = marray2[3] = marray2[4] = marray2[6] = GCD_Glue; marray2[7] = NULL;
- marray2[1] = &mgcd[1]; marray2[5] = &mgcd[2];
-
- marray[0] = &mgcd[0]; marray[1] = NULL;
- marray[2] = &mb2; marray[3] = NULL;
- marray[4] = GCD_Glue; marray[5] = NULL;
- marray[6] = NULL;
-
- memset(mb,0,sizeof(mb));
- mb[0].gd.pos.x = mb[0].gd.pos.y = 2;
- mb[0].gd.flags = gg_enabled|gg_visible;
- mb[0].gd.u.boxelements = marray;
- mb[0].creator = GHVBoxCreate;
-
- memset(&mb2,0,sizeof(mb2));
- mb2.gd.flags = gg_enabled|gg_visible;
- mb2.gd.u.boxelements = marray2;
- mb2.creator = GHBoxCreate;
-
- GGadgetsCreate(gw,mb);
- GMatrixEditSetNewText(tngcd[4].ret,S_("TrueTypeName|New"));
- GGadgetSelectOneListItem(gaspgcd[0].ret,sf->gasp_version);
- GMatrixEditSetNewText(gaspgcd[3].ret,S_("gaspTableEntry|New"));
- GMatrixEditAddButtons(gaspgcd[3].ret,gaspgcd_def);
- if ( sf->gasp_version==0 ) {
- GMatrixEditEnableColumn(gaspgcd[3].ret,3,false);
- GMatrixEditEnableColumn(gaspgcd[3].ret,4,false);
- }
- GHVBoxSetExpandableCol(gaspboxes[2].ret,2);
- GHVBoxSetExpandableRow(gaspboxes[0].ret,1);
-
- GHVBoxSetExpandableRow(mb[0].ret,0);
- GHVBoxSetExpandableCol(mb2.ret,gb_expandgluesame);
-
- GHVBoxSetExpandableCol(nb[0].ret,1);
- GHVBoxSetExpandableRow(nb[0].ret,7);
- GHVBoxSetExpandableCol(nb2.ret,1);
- GHVBoxSetExpandableCol(nb3.ret,1);
-
- GHVBoxSetExpandableCol(xub[0].ret,1);
- GHVBoxSetExpandableRow(xub[0].ret,3);
-
- GHVBoxSetExpandableRow(psb[0].ret,psrow);
- GHVBoxSetExpandableCol(psb2[0].ret,3);
- GHVBoxSetExpandableCol(psb2[1].ret,1);
- GHVBoxSetExpandableCol(psb2[2].ret,1);
-
- GHVBoxSetExpandableRow(ppbox[0].ret,0);
- GHVBoxSetExpandableCol(ppbox[2].ret,gb_samesize);
-
- GHVBoxSetExpandableRow(vbox[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(vbox[0].ret,1);
- GHVBoxSetExpandableCol(vbox[2].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(metbox[0].ret,10);
- GHVBoxSetExpandableCol(metbox[0].ret,1);
-
- GHVBoxSetExpandableRow(ssbox[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(ssbox[0].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(panbox[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(panbox[0].ret,1);
-
- GHVBoxSetExpandableRow(mkbox[0].ret,0);
- GHVBoxSetExpandableCol(mkbox[2].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(txbox[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(txbox[2].ret,gb_expandglue);
- GHVBoxSetExpandableCol(txbox[3].ret,gb_expandglue);
- GHVBoxSetExpandableCol(txbox[4].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(szbox[0].ret,4);
- GHVBoxSetPadding(szbox[2].ret,6,2);
- GHVBoxSetExpandableCol(szbox[2].ret,gb_expandglue);
- GHVBoxSetPadding(szbox[3].ret,6,2);
- GHVBoxSetExpandableCol(szbox[3].ret,gb_expandglue);
- GHVBoxSetPadding(szbox[4].ret,6,2);
- GHVBoxSetExpandableCol(szbox[4].ret,gb_expandglue);
- GHVBoxSetExpandableCol(szbox[5].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(tnboxes[0].ret,1);
- GHVBoxSetExpandableCol(tnboxes[2].ret,gb_expandglue);
- GHVBoxSetExpandableCol(tnboxes[3].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(mcbox[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(mcbox[0].ret,1);
- GHVBoxSetExpandableRow(mcbox[2].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(mfbox[0].ret,0);
- GHVBoxSetExpandableRow(mfbox[2].ret,gb_expandglue);
-
- GHVBoxSetExpandableRow(dbox[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(dbox[0].ret,1);
-
- GHVBoxSetExpandableRow(ubox[0].ret,1);
-
- GHVBoxSetExpandableCol(lkbox[0].ret,0);
- GHVBoxSetExpandableRow(lkbox[0].ret,0);
- GHVBoxSetPadding(lkbox[0].ret,0,0);
- GHVBoxSetExpandableCol(lkbox[2].ret,0);
- GHVBoxSetExpandableRow(lkbox[2].ret,0);
- GHVBoxSetPadding(lkbox[2].ret,0,0);
- GHVBoxSetExpandableRow(lkbox[4].ret,gb_expandglue);
- GHVBoxSetExpandableCol(lkbox[5].ret,0);
-
- GFI_LookupEnableButtons(d,true);
- GFI_LookupEnableButtons(d,false);
-
- memset(&rq,0,sizeof(rq));
- rq.family_name = sans;
- rq.point_size = 12;
- rq.weight = 400;
- d->font = GDrawInstanciateFont(GDrawGetDisplayOfWindow(gw),&rq);
- GDrawFontMetrics(d->font,&as,&ds,&ld);
- d->as = as; d->fh = as+ds;
-
- GTextInfoListFree(namelistnames);
- GTextInfoListFree(pgcd[0].gd.u.list);
-
- for ( i=0; i<mi.initial_row_cnt; ++i )
- free( mi.matrix_data[3*i+2].u.md_str );
- free( mi.matrix_data );
-
- free(tmpcreatetime);
- free(tmpmodtime);
-
- GHVBoxFitWindow(mb[0].ret);
-#if 0
- if ( GTabSetGetTabLines(mgcd[0].ret)>3 ) {
- int offset = (GTabSetGetTabLines(mgcd[0].ret)-2)*GDrawPointsToPixels(NULL,20);
- GDrawResize(gw,pos.width,pos.height+offset);
- }
-#endif
-
- GWidgetIndicateFocusGadget(ngcd[1].ret);
- ProcessListSel(d);
- GFI_AspectChange(mgcd[0].ret,NULL);
- GFI_InitMarkClasses(d);
- GGadgetSetList(GWidgetGetControl(gw,CID_StyleName),StyleNames(sf->fontstyle_name),false);
-
- GWidgetHidePalettes();
- GDrawSetVisible(gw,true);
-
- if ( sync ) {
- while ( !d->done )
- GDrawProcessOneEvent(NULL);
- }
-}
-
-void FontMenuFontInfo(void *_fv) {
- FontInfo( ((FontView *) _fv)->sf,-1,false);
-}
-
-void FontInfoDestroy(SplineFont *sf) {
- if ( sf->fontinfo )
- GFI_CancelClose( (struct gfi_data *) (sf->fontinfo) );
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-
-void FontInfoInit(void) {
- static int done = false;
- int i, j;
- static GTextInfo *needswork[] = {
- macstyles, widthclass, weightclass, fstype, pfmfamily, ibmfamily,
- panfamily, panserifs, panweight, panprop, pancontrast, panstrokevar,
- panarmstyle, panletterform, panmidline, panxheight, mslanguages,
- ttfnameids, interpretations, gridfit, antialias, os2versions,
- NULL
- };
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- static char **needswork2[] = { texparams, texpopups,
- mathparams, mathpopups, extparams, extpopups,
- NULL };
-#endif
- if ( done )
-return;
- done = true;
-#ifndef _NO_PYTHON
- scriptingSaveEnglishNames(ttfnameids,mslanguages);
-#endif
- for ( j=0; needswork[j]!=NULL; ++j ) {
- for ( i=0; needswork[j][i].text!=NULL; ++i )
- needswork[j][i].text = (unichar_t *) S_((char *) needswork[j][i].text);
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- for ( j=0; needswork2[j]!=NULL; ++j ) {
- for ( i=0; needswork2[j][i]!=NULL; ++i )
- needswork2[j][i] = _(needswork2[j][i]);
- }
-
- ci[0].title = S_(ci[0].title);
- ci[1].title = S_(ci[1].title);
- ci[2].title = S_(ci[2].title);
-
- gaspci[0].title = S_(gaspci[0].title);
- gaspci[1].title = S_(gaspci[1].title);
- gaspci[2].title = S_(gaspci[2].title);
- gaspci[3].title = S_(gaspci[3].title);
- gaspci[4].title = S_(gaspci[4].title);
-#endif
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontview.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontview.c
deleted file mode 100644
index f088bbb3c11..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fontview.c
+++ /dev/null
@@ -1,11163 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include "groups.h"
-#include "psfont.h"
-#include <gfile.h>
-#ifdef FONTFORGE_CONFIG_GTK
-#include <gtkutype.h>
-#else
-#include <ustring.h>
-#include <gkeysym.h>
-#include <utype.h>
-#include <chardata.h>
-#include <gresource.h>
-#endif
-#include <math.h>
-#include <unistd.h>
-
-#ifdef LUA_FF_LIB
-/* from views.h */
-extern void SFAddGlyphAndEncode(SplineFont *sf,SplineChar *sc,EncMap *basemap, int baseenc);
-extern void SFAddEncodingSlot(SplineFont *sf,int gid);
-extern void SFRemoveGlyph(SplineFont *sf,SplineChar *sc, int *flags);
-
-extern int unic_iscombining(int);
-extern int unic_isalpha(int);
-extern void gwwv_post_error(char *a, ...);
-#define Iscombining unic_iscombining
-#define Isalpha unic_isalpha
-#else
-#define Iscombining iscombining
-#define Isalpha isalpha
-#endif
-
-int onlycopydisplayed = 0;
-int copymetadata = 0;
-int copyttfinstr = 0;
-
-struct compressors compressors[] = {
- { ".gz", "gunzip", "gzip" },
- { ".bz2", "bunzip2", "bzip2" },
- { ".Z", "gunzip", "compress" },
- {NULL}
-};
-
-#define XOR_COLOR 0x505050
-#define FV_LAB_HEIGHT 15
-
-#ifdef FONTFORGE_CONFIG_GDRAW
-/* GTK window icons are set by glade */
-#ifdef BIGICONS
-#define fontview_width 32
-#define fontview_height 32
-static unsigned char fontview_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x02, 0x20, 0x80, 0x00,
- 0x82, 0x20, 0x86, 0x08, 0x42, 0x21, 0x8a, 0x14, 0xc2, 0x21, 0x86, 0x04,
- 0x42, 0x21, 0x8a, 0x14, 0x42, 0x21, 0x86, 0x08, 0x02, 0x20, 0x80, 0x00,
- 0xaa, 0xaa, 0xaa, 0xaa, 0x02, 0x20, 0x80, 0x00, 0x82, 0xa0, 0x8f, 0x18,
- 0x82, 0x20, 0x91, 0x24, 0x42, 0x21, 0x91, 0x02, 0x42, 0x21, 0x91, 0x02,
- 0x22, 0x21, 0x8f, 0x02, 0xe2, 0x23, 0x91, 0x02, 0x12, 0x22, 0x91, 0x02,
- 0x3a, 0x27, 0x91, 0x24, 0x02, 0xa0, 0x8f, 0x18, 0x02, 0x20, 0x80, 0x00,
- 0xfe, 0xff, 0xff, 0xff, 0x02, 0x20, 0x80, 0x00, 0x42, 0x20, 0x86, 0x18,
- 0xa2, 0x20, 0x8a, 0x04, 0xa2, 0x20, 0x86, 0x08, 0xa2, 0x20, 0x8a, 0x10,
- 0x42, 0x20, 0x8a, 0x0c, 0x82, 0x20, 0x80, 0x00, 0x02, 0x20, 0x80, 0x00,
- 0xaa, 0xaa, 0xaa, 0xaa, 0x02, 0x20, 0x80, 0x00};
-#else
-#define fontview2_width 16
-#define fontview2_height 16
-static unsigned char fontview2_bits[] = {
- 0x00, 0x07, 0x80, 0x08, 0x40, 0x17, 0x40, 0x15, 0x60, 0x09, 0x10, 0x02,
- 0xa0, 0x01, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0x50, 0x00, 0x52, 0x00,
- 0x55, 0x00, 0x5d, 0x00, 0x22, 0x00, 0x1c, 0x00};
-#endif
-
-extern int _GScrollBar_Width;
-
-static int fv_fontsize = -13, fv_fs_init=0;
-#endif
-
-enum glyphlable { gl_glyph, gl_name, gl_unicode, gl_encoding };
-int default_fv_font_size = 24, default_fv_antialias=true,
- default_fv_bbsized=true,
- default_fv_showhmetrics=false, default_fv_showvmetrics=false,
- default_fv_glyphlabel = gl_glyph;
-#define METRICS_BASELINE 0x0000c0
-#define METRICS_ORIGIN 0xc00000
-#define METRICS_ADVANCE 0x008000
-FontView *fv_list=NULL;
-
-#if defined(FONTFORGE_CONFIG_GTK)
-# define FV_From_MI(menuitem) \
- (FontView *) g_object_get_data( \
- G_OBJECT( gtk_widget_get_toplevel( GTK_WIDGET( menuitem ))),\
- "data" )
-#endif
-
-void FVToggleCharChanged(SplineChar *sc) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int i, j;
- int pos;
- FontView *fv;
-
- for ( fv = sc->parent->fv; fv!=NULL; fv=fv->nextsame ) {
- if ( fv->sf!=sc->parent ) /* Can happen in CID fonts if char's parent is not currently active */
- continue;
- if ( fv->v==NULL || fv->colcnt==0 ) /* Can happen in scripts */
- continue;
- for ( pos=0; pos<fv->map->enccount; ++pos ) if ( fv->map->map[pos]==sc->orig_pos ) {
- if ( fv->mapping!=NULL ) {
- for ( i=0; i<fv->mapcnt; ++i )
- if ( fv->mapping[i]==pos )
- break;
- if ( i==fv->mapcnt ) /* Not currently displayed */
- continue;
- pos = i;
- }
- i = pos / fv->colcnt;
- j = pos - i*fv->colcnt;
- i -= fv->rowoff;
- /* Normally we should be checking against fv->rowcnt (rather than <=rowcnt) */
- /* but every now and then the WM forces us to use a window size which doesn't */
- /* fit our expectations (maximized view) and we must be prepared for half */
- /* lines */
- if ( i>=0 && i<=fv->rowcnt ) {
-# ifdef FONTFORGE_CONFIG_GDRAW
- GRect r;
-#if 0
- Color bg;
- if ( sc->color!=COLOR_DEFAULT )
- bg = sc->color;
- else if ( sc->layers[ly_back].splines!=NULL || sc->layers[ly_back].images!=NULL )
- bg = 0x808080;
- else
- bg = GDrawGetDefaultBackground(GDrawGetDisplayOfWindow(fv->v));
-#endif
- r.x = j*fv->cbw+1; r.width = fv->cbw-1;
- r.y = i*fv->cbh+1; r.height = fv->lab_height-1;
- GDrawRequestExpose(fv->v,&r,false);
-#if 0
- GDrawSetXORBase(fv->v,bg);
- GDrawSetXORMode(fv->v);
- GDrawFillRect(fv->v,&r,0x000000);
- GDrawSetCopyMode(fv->v);
-#endif
-# elif defined(FONTFORGE_CONFIG_GTK)
- GdkGC *gc = fv->v->style->fg_gc[fv->v->state];
- GdkGCValues values;
- GdkColor bg;
- gdk_gc_get_values(gc,&values);
- bg.pixel = -1;
- if ( sc->color!=COLOR_DEFAULT ) {
- bg.red = ((sc->color>>16)&0xff)*0x101;
- bg.green = ((sc->color>>8 )&0xff)*0x101;
- bg.blue = ((sc->color )&0xff)*0x101;
- } else if ( sc->layers[ly_back].splines!=NULL || sc->layers[ly_back].images!=NULL )
- bg.red = bg.green = bg.blue = 0x8000;
- else
- bg = values.background;
- /* Bug!!! This only works on RealColor */
- bg.red ^= values.foreground.red;
- bg.green ^= values.foreground.green;
- bg.blue ^= values.foreground.blue;
- /* End bug */
- gdk_gc_set_function(gc,GDK_XOR);
- gdk_gc_set_foreground(gc, &bg);
- gdk_draw_rectangle(fv->v->window, gc, TRUE,
- j*fv->cbw+1, i*fv->cbh+1, fv->cbw-1, fv->lab_height);
- gdk_gc_set_values(gc,&values,
- GDK_GC_FOREGROUND | GDK_GC_FUNCTION );
-# endif
- }
- }
- }
-#endif
-}
-
-void FVMarkHintsOutOfDate(SplineChar *sc) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int i, j;
- int pos;
- FontView *fv;
-
- if ( sc->parent->onlybitmaps || sc->parent->multilayer || sc->parent->strokedfont || sc->parent->order2 )
-return;
- for ( fv = sc->parent->fv; fv!=NULL; fv=fv->nextsame ) {
- if ( fv->sf!=sc->parent ) /* Can happen in CID fonts if char's parent is not currently active */
- continue;
- if ( fv->v==NULL || fv->colcnt==0 ) /* Can happen in scripts */
- continue;
- for ( pos=0; pos<fv->map->enccount; ++pos ) if ( fv->map->map[pos]==sc->orig_pos ) {
- if ( fv->mapping!=NULL ) {
- for ( i=0; i<fv->mapcnt; ++i )
- if ( fv->mapping[i]==pos )
- break;
- if ( i==fv->mapcnt ) /* Not currently displayed */
- continue;
- pos = i;
- }
- i = pos / fv->colcnt;
- j = pos - i*fv->colcnt;
- i -= fv->rowoff;
- /* Normally we should be checking against fv->rowcnt (rather than <=rowcnt) */
- /* but every now and then the WM forces us to use a window size which doesn't */
- /* fit our expectations (maximized view) and we must be prepared for half */
- /* lines */
- if ( i>=0 && i<=fv->rowcnt ) {
-# ifdef FONTFORGE_CONFIG_GDRAW
- GRect r;
- Color hintcol = 0x0000ff;
- r.x = j*fv->cbw+1; r.width = fv->cbw-1;
- r.y = i*fv->cbh+1; r.height = fv->lab_height-1;
- GDrawDrawLine(fv->v,r.x,r.y,r.x,r.y+r.height-1,hintcol);
- GDrawDrawLine(fv->v,r.x+1,r.y,r.x+1,r.y+r.height-1,hintcol);
- GDrawDrawLine(fv->v,r.x+r.width-1,r.y,r.x+r.width-1,r.y+r.height-1,hintcol);
- GDrawDrawLine(fv->v,r.x+r.width-2,r.y,r.x+r.width-2,r.y+r.height-1,hintcol);
-# elif defined(FONTFORGE_CONFIG_GTK)
- GdkColor hintcol;
- GdkRectangle r;
- hintcol.red = hintcol.green = 0;
- hintcol.blue = 0xffff;
- gdk_gc_set_rgb_fg_color(fv->gc,&hintcol);
- r.x = j*fv->cbw+1; r.width = fv->cbw-1;
- r.y = i*fv->cbh+1; r.height = fv->lab_height-1;
- gdk_draw_line(GDK_DRAWABLE(fv->v),fv->gc,r.x,r.y,r.x,r.y+r.height-1);
- gdk_draw_line(GDK_DRAWABLE(fv->v),fv->gc,r.x+1,r.y,r.x+1,r.y+r.height-1);
- gdk_draw_line(GDK_DRAWABLE(fv->v),fv->gc,r.x+r.width-1,r.y,r.x+r.width-1,r.y+r.height-1);
- gdk_draw_line(GDK_DRAWABLE(fv->v),fv->gc,r.x+r.width-2,r.y,r.x+r.width-2,r.y+r.height-1);
-# endif
- }
- }
- }
-#endif
-}
-
-static void FVToggleCharSelected(FontView *fv,int enc) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int i, j;
-
- if ( fv->v==NULL || fv->colcnt==0 ) /* Can happen in scripts */
-return;
-
- i = enc / fv->colcnt;
- j = enc - i*fv->colcnt;
- i -= fv->rowoff;
- /* Normally we should be checking against fv->rowcnt (rather than <=rowcnt) */
- /* but every now and then the WM forces us to use a window size which doesn't */
- /* fit our expectations (maximized view) and we must be prepared for half */
- /* lines */
- if ( i>=0 && i<=fv->rowcnt ) {
-# ifdef FONTFORGE_CONFIG_GDRAW
- GRect r;
- r.x = j*fv->cbw+1; r.width = fv->cbw-1;
- r.y = i*fv->cbh+fv->lab_height+1; r.height = fv->cbw;
- GDrawSetXORBase(fv->v,GDrawGetDefaultBackground(GDrawGetDisplayOfWindow(fv->v)));
- GDrawSetXORMode(fv->v);
- GDrawFillRect(fv->v,&r,XOR_COLOR);
- GDrawSetCopyMode(fv->v);
-# elif defined(FONTFORGE_CONFIG_GTK)
- GdkGC *gc = fv->v->style->fg_gc[fv->v->state];
- GdkGCValues values;
- gdk_gc_get_values(gc,&values);
- gdk_gc_set_function(gc,GDK_XOR);
- gdk_gc_set_foreground(gc, &values.background);
- gdk_draw_rectangle(fv->v->window, gc, TRUE,
- j*fv->cbw+1, i*fv->cbh+fv->lab_height+1, fv->cbw-1, fv->cbw);
- gdk_gc_set_values(gc,&values,
- GDK_GC_FOREGROUND | GDK_GC_FUNCTION );
-# endif
- }
-#endif
-}
-
-void SFUntickAll(SplineFont *sf) {
- int i;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->ticked = false;
-}
-
-void FVDeselectAll(FontView *fv) {
- int i;
-
- for ( i=0; i<fv->map->enccount; ++i ) {
- if ( fv->selected[i] ) {
- fv->selected[i] = false;
- FVToggleCharSelected(fv,i);
- }
- }
- fv->sel_index = 0;
-}
-
-#ifndef LUA_FF_LIB
-static void FVInvertSelection(FontView *fv) {
- int i;
-
- for ( i=0; i<fv->map->enccount; ++i ) {
- fv->selected[i] = !fv->selected[i];
- FVToggleCharSelected(fv,i);
- }
- fv->sel_index = 1;
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void FVSelectAll(FontView *fv) {
- int i;
-
- for ( i=0; i<fv->map->enccount; ++i ) {
- if ( !fv->selected[i] ) {
- fv->selected[i] = true;
- FVToggleCharSelected(fv,i);
- }
- }
- fv->sel_index = 1;
-}
-
-static void FVSelectByName(FontView *fv) {
- int j, gid;
- char *ret, *end;
- SplineChar *sc;
- EncMap *map = fv->map;
- SplineFont *sf = fv->sf;
- struct altuni *alt;
-
- ret = gwwv_ask_string(_("Select all instances of the named glyph"),".notdef",_("Select all instances of the named glyph"));
- if ( ret==NULL )
-return;
- FVDeselectAll(fv);
- if (( *ret=='0' && ( ret[1]=='x' || ret[1]=='X' )) ||
- ((*ret=='u' || *ret=='U') && ret[1]=='+' )) {
- int uni = strtol(ret+2,&end,16);
- if ( *end!='\0' || uni<0 || uni>=0x110000 ) {
- free(ret);
- gwwv_post_error( _("Bad Number"),_("Bad Number") );
-return;
- }
- for ( j=0; j<map->enccount; ++j ) if ( (gid=map->map[j])!=-1 && (sc=sf->glyphs[gid])!=NULL ) {
- for ( alt=sc->altuni; alt!=NULL && alt->unienc!=uni; alt=alt->next );
- if ( sc->unicodeenc == uni || alt!=NULL ) {
- fv->selected[j] = true;
- FVToggleCharSelected(fv,j);
- }
- }
- } else {
- for ( j=0; j<map->enccount; ++j ) if ( (gid=map->map[j])!=-1 && (sc=sf->glyphs[gid])!=NULL ) {
- if ( strcmp(sc->name,ret)==0 ) {
- fv->selected[j] = true;
- FVToggleCharSelected(fv,j);
- }
- }
- }
- free(ret);
- fv->sel_index = 1;
-}
-
-static void FVSelectColor(FontView *fv, uint32 col, int door) {
- int i, any=0;
- uint32 sccol;
- SplineChar **glyphs = fv->sf->glyphs;
-
- for ( i=0; i<fv->map->enccount; ++i ) {
- int gid = fv->map->map[i];
- sccol = ( gid==-1 || glyphs[gid]==NULL ) ? COLOR_DEFAULT : glyphs[gid]->color;
- if ( (door && !fv->selected[i] && sccol==col) ||
- (!door && fv->selected[i]!=(sccol==col)) ) {
- fv->selected[i] = !fv->selected[i];
- if ( fv->selected[i] ) any = true;
- FVToggleCharSelected(fv,i);
- }
- }
- fv->sel_index = any;
-}
-
-static void FVReselect(FontView *fv, int newpos) {
- int i;
-
- if ( newpos<0 ) newpos = 0;
- else if ( newpos>=fv->map->enccount ) newpos = fv->map->enccount-1;
-
- if ( fv->pressed_pos<fv->end_pos ) {
- if ( newpos>fv->end_pos ) {
- for ( i=fv->end_pos+1; i<=newpos; ++i ) if ( !fv->selected[i] ) {
- fv->selected[i] = fv->sel_index;
- FVToggleCharSelected(fv,i);
- }
- } else if ( newpos<fv->pressed_pos ) {
- for ( i=fv->end_pos; i>fv->pressed_pos; --i ) if ( fv->selected[i] ) {
- fv->selected[i] = false;
- FVToggleCharSelected(fv,i);
- }
- for ( i=fv->pressed_pos-1; i>=newpos; --i ) if ( !fv->selected[i] ) {
- fv->selected[i] = fv->sel_index;
- FVToggleCharSelected(fv,i);
- }
- } else {
- for ( i=fv->end_pos; i>newpos; --i ) if ( fv->selected[i] ) {
- fv->selected[i] = false;
- FVToggleCharSelected(fv,i);
- }
- }
- } else {
- if ( newpos<fv->end_pos ) {
- for ( i=fv->end_pos-1; i>=newpos; --i ) if ( !fv->selected[i] ) {
- fv->selected[i] = fv->sel_index;
- FVToggleCharSelected(fv,i);
- }
- } else if ( newpos>fv->pressed_pos ) {
- for ( i=fv->end_pos; i<fv->pressed_pos; ++i ) if ( fv->selected[i] ) {
- fv->selected[i] = false;
- FVToggleCharSelected(fv,i);
- }
- for ( i=fv->pressed_pos+1; i<=newpos; ++i ) if ( !fv->selected[i] ) {
- fv->selected[i] = fv->sel_index;
- FVToggleCharSelected(fv,i);
- }
- } else {
- for ( i=fv->end_pos; i<newpos; ++i ) if ( fv->selected[i] ) {
- fv->selected[i] = false;
- FVToggleCharSelected(fv,i);
- }
- }
- }
- fv->end_pos = newpos;
-# ifdef FONTFORGE_CONFIG_GDRAW
- if ( newpos>=0 && newpos<fv->map->enccount && (i = fv->map->map[newpos])!=-1 &&
- fv->sf->glyphs[i]!=NULL &&
- fv->sf->glyphs[i]->unicodeenc>=0 && fv->sf->glyphs[i]->unicodeenc<0x10000 )
- GInsCharSetChar(fv->sf->glyphs[i]->unicodeenc);
-# endif
-}
-#endif
-
-static void _SplineFontSetUnChanged(SplineFont *sf) {
- int i;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int was = sf->changed;
- FontView *fvs;
-#endif
- BDFFont *bdf;
-
- sf->changed = false;
-#ifndef LUA_FF_LIB
- SFClearAutoSave(sf);
-#endif
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- if ( sf->glyphs[i]->changed ) {
- sf->glyphs[i]->changed = false;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCRefreshTitles(sf->glyphs[i]);
-#endif
- }
- for ( bdf=sf->bitmaps; bdf!=NULL; bdf=bdf->next )
- for ( i=0; i<bdf->glyphcnt; ++i ) if ( bdf->glyphs[i]!=NULL )
- bdf->glyphs[i]->changed = false;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( was && sf->fv!=NULL && sf->fv->v!=NULL )
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawRequestExpose(sf->fv->v,NULL,false);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_queue_draw(sf->fv->v);
-# endif
- if ( was )
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->next )
- FVSetTitle(fvs);
-#endif
- for ( i=0; i<sf->subfontcnt; ++i )
- _SplineFontSetUnChanged(sf->subfonts[i]);
-}
-
-void SplineFontSetUnChanged(SplineFont *sf) {
- int i;
-
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
- if ( sf->mm!=NULL ) sf = sf->mm->normal;
- _SplineFontSetUnChanged(sf);
- if ( sf->mm!=NULL )
- for ( i=0; i<sf->mm->instance_count; ++i )
- _SplineFontSetUnChanged(sf->mm->instances[i]);
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void FVFlattenAllBitmapSelections(FontView *fv) {
- BDFFont *bdf;
- int i;
-
- for ( bdf = fv->sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- for ( i=0; i<bdf->glyphcnt; ++i )
- if ( bdf->glyphs[i]!=NULL && bdf->glyphs[i]->selection!=NULL )
- BCFlattenFloat(bdf->glyphs[i]);
- }
-}
-
-static int AskChanged(SplineFont *sf) {
- int ret;
- char *buts[4];
- char *filename, *fontname;
-
- if ( sf->cidmaster!=NULL )
- sf = sf->cidmaster;
-
- filename = sf->filename;
- fontname = sf->fontname;
-
- if ( filename==NULL && sf->origname!=NULL &&
- sf->onlybitmaps && sf->bitmaps!=NULL && sf->bitmaps->next==NULL )
- filename = sf->origname;
- if ( filename==NULL ) filename = "untitled.sfd";
- filename = GFileNameTail(filename);
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[0] = _("_Save");
- buts[2] = _("_Cancel");
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[0] = GTK_STOCK_SAVE;
- buts[2] = GTK_STOCK_CANCEL;
-#endif
- buts[1] = _("_Don't Save");
- buts[3] = NULL;
- ret = gwwv_ask( _("Font changed"),(const char **) buts,0,2,_("Font %1$.40s in file %2$.40s has been changed.\nDo you want to save it?"),fontname,filename);
-return( ret );
-}
-
-static int RevertAskChanged(char *fontname,char *filename) {
- int ret;
- char *buts[3];
-
- if ( filename==NULL ) filename = "untitled.sfd";
- filename = GFileNameTail(filename);
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[0] = _("_Revert");
- buts[1] = _("_Cancel");
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[0] = GTK_STOCK_REVERT_TO_SAVED;
- buts[1] = GTK_STOCK_CANCEL;
-#endif
- buts[2] = NULL;
- ret = gwwv_ask( _("Font changed"),(const char **) buts,0,1,_("Font %1$.40s in file %2$.40s has been changed.\nReverting the file will lose those changes.\nIs that what you want?"),fontname,filename);
-return( ret==0 );
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-int _FVMenuGenerate(FontView *fv,int family) {
- FVFlattenAllBitmapSelections(fv);
-return( SFGenerateFont(fv->sf,family,fv->normal==NULL?fv->map:fv->normal) );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuGenerate(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- _FVMenuGenerate(fv,false);
-}
-
-static void FVMenuGenerateFamily(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- _FVMenuGenerate(fv,true);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Generate(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-
- _FVMenuGenerate(fv,false);
-}
-
-void FontViewMenu_GenerateFamily(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-
- _FVMenuGenerate(fv,true);
-}
-# endif
-
-extern int save_to_dir;
-
-static int SaveAs_FormatChange(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- GGadget *fc = GWidgetGetControl(GGadgetGetWindow(g),1000);
- char *oldname = GGadgetGetTitle8(fc);
- int *_s2d = GGadgetGetUserData(g);
- int s2d = GGadgetIsChecked(g);
- char *pt, *newname = galloc(strlen(oldname)+8);
-#ifdef VMS
- char *pt2;
-
- strcpy(newname,oldname);
- pt = strrchr(newname,'.');
- pt2 = strrchr(newname,'_');
- if ( pt==NULL )
- pt = pt2;
- else if ( pt2!=NULL && pt<pt2 )
- pt = pt2;
- if ( pt==NULL )
- pt = newname+strlen(newname);
- strcpy(pt,s2d ? "_sfdir" : ".sfd" );
-#else
- strcpy(newname,oldname);
- pt = strrchr(newname,'.');
- if ( pt==NULL )
- pt = newname+strlen(newname);
- strcpy(pt,s2d ? ".sfdir" : ".sfd" );
-#endif
- GGadgetSetTitle8(fc,newname);
- save_to_dir = *_s2d = s2d;
- SavePrefs();
- }
-return( true );
-}
-
-int _FVMenuSaveAs(FontView *fv) {
- char *temp;
- char *ret;
- char *filename;
- int ok;
- int s2d = fv->cidmaster!=NULL ? fv->cidmaster->save_to_dir :
- fv->sf->mm!=NULL ? fv->sf->mm->normal->save_to_dir :
- fv->sf->save_to_dir;
- GGadgetCreateData gcd;
- GTextInfo label;
-
-# ifdef FONTFORGE_CONFIG_GDRAW
- if ( fv->cidmaster!=NULL && fv->cidmaster->filename!=NULL )
- temp=def2utf8_copy(fv->cidmaster->filename);
- else if ( fv->sf->mm!=NULL && fv->sf->mm->normal->filename!=NULL )
- temp=def2utf8_copy(fv->sf->mm->normal->filename);
- else if ( fv->sf->filename!=NULL )
- temp=def2utf8_copy(fv->sf->filename);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gsize read, written;
-
- if ( fv->cidmaster!=NULL && fv->cidmaster->filename!=NULL )
- temp=g_filename_to_utf8(fv->cidmaster->filename,-1,&read,&written,NULL);
- else if ( fv->sf->mm!=NULL && fv->sf->mm->normal->filename!=NULL )
- temp=g_filename_to_utf8(fv->sf->mm->normal->filename,-1,&read,&written,NULL);
- else if ( fv->sf->filename!=NULL )
- temp=g_filename_to_utf8(fv->sf->filename,-1,&read,&written,NULL);
-#endif
- else {
- SplineFont *sf = fv->cidmaster?fv->cidmaster:
- fv->sf->mm!=NULL?fv->sf->mm->normal:fv->sf;
- char *fn = sf->defbasefilename ? sf->defbasefilename : sf->fontname;
- temp = galloc((strlen(fn)+10));
- strcpy(temp,fn);
- if ( sf->defbasefilename!=NULL )
- /* Don't add a default suffix, they've already told us what name to use */;
- else if ( fv->cidmaster!=NULL )
- strcat(temp,"CID");
- else if ( sf->mm==NULL )
- ;
- else if ( sf->mm->apple )
- strcat(temp,"Var");
- else
- strcat(temp,"MM");
-#ifdef VMS
- strcat(temp,save_to_dir ? "_sfdir" : ".sfd");
-#else
- strcat(temp,save_to_dir ? ".sfdir" : ".sfd");
-#endif
- s2d = save_to_dir;
- }
-
- memset(&gcd,0,sizeof(gcd));
- memset(&label,0,sizeof(label));
- gcd.gd.flags = s2d ? (gg_visible | gg_enabled | gg_cb_on) : (gg_visible | gg_enabled);
- label.text = (unichar_t *) _("Save as _Directory");
- label.text_is_1byte = true;
- label.text_in_resource = true;
- gcd.gd.label = &label;
- gcd.gd.handle_controlevent = SaveAs_FormatChange;
- gcd.data = &s2d;
- gcd.creator = GCheckBoxCreate;
-
- ret = gwwv_save_filename_with_gadget(_("Save as..."),temp,NULL,&gcd);
- free(temp);
- if ( ret==NULL )
-return( 0 );
-# ifdef FONTFORGE_CONFIG_GDRAW
- filename = utf82def_copy(ret);
-# elif defined(FONTFORGE_CONFIG_GTK)
- filename = g_filename_from_utf8(ret,-1,&read,&written,NULL);
-#endif
- free(ret);
- FVFlattenAllBitmapSelections(fv);
- fv->sf->compression = 0;
- ok = SFDWrite(filename,fv->sf,fv->map,fv->normal,s2d);
- if ( ok ) {
- SplineFont *sf = fv->cidmaster?fv->cidmaster:fv->sf->mm!=NULL?fv->sf->mm->normal:fv->sf;
- free(sf->filename);
- sf->filename = filename;
- sf->save_to_dir = s2d;
- free(sf->origname);
- sf->origname = copy(filename);
- sf->new = false;
- if ( sf->mm!=NULL ) {
- int i;
- for ( i=0; i<sf->mm->instance_count; ++i ) {
- free(sf->mm->instances[i]->filename);
- sf->mm->instances[i]->filename = filename;
- free(sf->mm->instances[i]->origname);
- sf->mm->instances[i]->origname = copy(filename);
- sf->mm->instances[i]->new = false;
- }
- }
- SplineFontSetUnChanged(sf);
- FVSetTitle(fv);
- } else
- free(filename);
-return( ok );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSaveAs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- _FVMenuSaveAs(fv);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SaveAs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-
- _FVMenuSaveAs(fv);
-}
-# endif
-
-int _FVMenuSave(FontView *fv) {
- int ret = 0;
- SplineFont *sf = fv->cidmaster?fv->cidmaster:
- fv->sf->mm!=NULL?fv->sf->mm->normal:
- fv->sf;
-
-#if 0 /* This seems inconsistant with normal behavior. Removed 6 Feb '04 */
- if ( sf->filename==NULL && sf->origname!=NULL &&
- sf->onlybitmaps && sf->bitmaps!=NULL && sf->bitmaps->next==NULL ) {
- /* If it's a single bitmap font then just save back to the bdf file */
- FVFlattenAllBitmapSelections(fv);
- ret = BDFFontDump(sf->origname,sf->bitmaps,EncodingName(sf->encoding_name),sf->bitmaps->res);
- if ( ret )
- SplineFontSetUnChanged(sf);
- } else
-#endif
- if ( sf->filename==NULL )
- ret = _FVMenuSaveAs(fv);
- else {
- FVFlattenAllBitmapSelections(fv);
- if ( !SFDWriteBak(sf,fv->map,fv->normal) )
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_post_error(_("Save Failed"),_("Save Failed"));
-#endif
- else {
- SplineFontSetUnChanged(sf);
- ret = true;
- }
- }
-return( ret );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSave(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- _FVMenuSave(fv);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Save(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-
- _FVMenuSave(fv);
-}
-# endif
-#endif
-
-void _FVCloseWindows(FontView *fv) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int i, j;
- BDFFont *bdf;
- MetricsView *mv, *mnext;
- SplineFont *sf = fv->cidmaster?fv->cidmaster:fv->sf->mm!=NULL?fv->sf->mm->normal : fv->sf;
-
- if ( fv->nextsame==NULL && fv->sf->fv==fv && fv->sf->kcld!=NULL )
- KCLD_End(fv->sf->kcld);
- if ( fv->nextsame==NULL && fv->sf->fv==fv && fv->sf->vkcld!=NULL )
- KCLD_End(fv->sf->vkcld);
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- CharView *cv, *next;
- for ( cv = sf->glyphs[i]->views; cv!=NULL; cv = next ) {
- next = cv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(cv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(cv->gw);
-# endif
- }
- if ( sf->glyphs[i]->charinfo )
- CharInfoDestroy(sf->glyphs[i]->charinfo);
- }
- if ( sf->mm!=NULL ) {
- MMSet *mm = sf->mm;
- for ( j=0; j<mm->instance_count; ++j ) {
- SplineFont *sf = mm->instances[j];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- CharView *cv, *next;
- for ( cv = sf->glyphs[i]->views; cv!=NULL; cv = next ) {
- next = cv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(cv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(cv->gw);
-# endif
- }
- if ( sf->glyphs[i]->charinfo )
- CharInfoDestroy(sf->glyphs[i]->charinfo);
- }
- for ( mv=sf->metrics; mv!=NULL; mv = mnext ) {
- mnext = mv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(mv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(mv->gw);
-# endif
- }
- }
- } else if ( sf->subfontcnt!=0 ) {
- for ( j=0; j<sf->subfontcnt; ++j ) {
- for ( i=0; i<sf->subfonts[j]->glyphcnt; ++i ) if ( sf->subfonts[j]->glyphs[i]!=NULL ) {
- CharView *cv, *next;
- for ( cv = sf->subfonts[j]->glyphs[i]->views; cv!=NULL; cv = next ) {
- next = cv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(cv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(cv->gw);
-# endif
- if ( sf->subfonts[j]->glyphs[i]->charinfo )
- CharInfoDestroy(sf->subfonts[j]->glyphs[i]->charinfo);
- }
- }
- for ( mv=sf->subfonts[j]->metrics; mv!=NULL; mv = mnext ) {
- mnext = mv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(mv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(mv->gw);
-# endif
- }
- }
- } else {
- for ( mv=sf->metrics; mv!=NULL; mv = mnext ) {
- mnext = mv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(mv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(mv->gw);
-# endif
- }
- }
- for ( bdf = sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- for ( i=0; i<bdf->glyphcnt; ++i ) if ( bdf->glyphs[i]!=NULL ) {
- BitmapView *bv, *next;
- for ( bv = bdf->glyphs[i]->views; bv!=NULL; bv = next ) {
- next = bv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(bv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(bv->gw);
-# endif
- }
- }
- }
- if ( fv->sf->fontinfo!=NULL )
- FontInfoDestroy(fv->sf);
- SVDetachFV(fv);
-#endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int SFAnyChanged(SplineFont *sf) {
- if ( sf->mm!=NULL ) {
- MMSet *mm = sf->mm;
- int i;
- if ( mm->changed )
-return( true );
- for ( i=0; i<mm->instance_count; ++i )
- if ( sf->mm->instances[i]->changed )
-return( true );
- /* Changes to the blended font aren't real (for adobe fonts) */
- if ( mm->apple && mm->normal->changed )
-return( true );
-
-return( false );
- } else
-return( sf->changed );
-}
-
-static int _FVMenuClose(FontView *fv) {
- int i;
- SplineFont *sf = fv->cidmaster?fv->cidmaster:fv->sf;
-
- if ( !SFCloseAllInstrs(fv->sf) )
-return( false );
-
- if ( fv->nextsame!=NULL || fv->sf->fv!=fv ) {
- /* There's another view, can close this one with no problems */
- } else if ( SFAnyChanged(sf) ) {
- i = AskChanged(fv->sf);
- if ( i==2 ) /* Cancel */
-return( false );
- if ( i==0 && !_FVMenuSave(fv)) /* Save */
-return(false);
- else
- SFClearAutoSave(sf); /* if they didn't save it, remove change record */
- }
- _FVCloseWindows(fv);
- if ( sf->filename!=NULL )
- RecentFilesRemember(sf->filename);
-#ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(fv->gw);
-#elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(fv->gw);
-#endif
-return( true );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-void MenuNew(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontNew();
-}
-
-static void FVMenuClose(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- DelayEvent((void (*)(void *)) _FVMenuClose, fv);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void Menu_New(GtkMenuItem *menuitem, gpointer user_data) {
- FontNew();
-}
-
-void FontViewMenu_Close(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-
- _FVMenuClose(fv);
-}
-
-gboolean FontView_RequestClose(GtkWidget *widget, GdkEvent *event,
- gpointer user_data) {
- FontView *fv = (FontView *) g_object_get_data(G_OBJECT(widget),"data");
-
- _FVMenuClose(fv);
-}
-# endif
-
-static void FVReattachCVs(SplineFont *old,SplineFont *new) {
- int i, j, pos;
- CharView *cv, *cvnext;
- SplineFont *sub;
-
- for ( i=0; i<old->glyphcnt; ++i ) {
- if ( old->glyphs[i]!=NULL && old->glyphs[i]->views!=NULL ) {
- if ( new->subfontcnt==0 ) {
- pos = SFFindExistingSlot(new,old->glyphs[i]->unicodeenc,old->glyphs[i]->name);
- sub = new;
- } else {
- pos = -1;
- for ( j=0; j<new->subfontcnt && pos==-1 ; ++j ) {
- sub = new->subfonts[j];
- pos = SFFindExistingSlot(sub,old->glyphs[i]->unicodeenc,old->glyphs[i]->name);
- }
- }
- if ( pos==-1 ) {
- for ( cv=old->glyphs[i]->views; cv!=NULL; cv = cvnext ) {
- cvnext = cv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(cv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(cv->gw);
-# endif
- }
- } else {
- for ( cv=old->glyphs[i]->views; cv!=NULL; cv = cvnext ) {
- cvnext = cv->next;
- CVChangeSC(cv,sub->glyphs[pos]);
- cv->layerheads[dm_grid] = &new->grid;
- }
- }
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawProcessPendingEvents(NULL); /* Don't want to many destroy_notify events clogging up the queue */
-# endif
- }
- }
-}
-#endif
-
-static char *Decompress(char *name, int compression) {
- char *dir = getenv("TMPDIR");
- char buf[1500];
- char *tmpfile;
-
- if ( dir==NULL ) dir = P_tmpdir;
- tmpfile = galloc(strlen(dir)+strlen(GFileNameTail(name))+2);
- strcpy(tmpfile,dir);
- strcat(tmpfile,"/");
- strcat(tmpfile,GFileNameTail(name));
- *strrchr(tmpfile,'.') = '\0';
-#if defined( _NO_SNPRINTF ) || defined( __VMS )
- sprintf( buf, "%s < %s > %s", compressors[compression].decomp, name, tmpfile );
-#else
- snprintf( buf, sizeof(buf), "%s < %s > %s", compressors[compression].decomp, name, tmpfile );
-#endif
- if ( system(buf)==0 )
-return( tmpfile );
- free(tmpfile);
-return( NULL );
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-static void _FVRevert(FontView *fv,int tobackup) {
- SplineFont *temp, *old = fv->cidmaster?fv->cidmaster:fv->sf;
- BDFFont *tbdf, *fbdf;
- BDFChar *bc;
- BitmapView *bv, *bvnext;
- MetricsView *mv, *mvnext;
- int i;
- FontView *fvs;
-
- if ( old->origname==NULL )
-return;
- if ( old->changed )
- if ( !RevertAskChanged(old->fontname,old->origname))
-return;
- if ( tobackup ) {
- /* we can only revert to backup if it's an sfd file. So we use filename*/
- /* here. In the normal case we revert to whatever file we read it from*/
- /* (sfd or not) so we use origname */
- char *buf = galloc(strlen(old->filename)+20);
- strcpy(buf,old->filename);
- if ( old->compression!=0 ) {
- char *tmpfile;
- strcat(buf,compressors[old->compression-1].ext);
- strcat(buf,"~");
- tmpfile = Decompress(buf,old->compression-1);
- if ( tmpfile==NULL )
- temp = NULL;
- else {
- temp = ReadSplineFont(tmpfile,0);
- unlink(tmpfile);
- free(tmpfile);
- }
- } else {
- strcat(buf,"~");
- temp = ReadSplineFont(buf,0);
- }
- free(buf);
- } else {
- if ( old->compression!=0 ) {
- char *tmpfile;
- char *buf = galloc(strlen(old->filename)+20);
- strcpy(buf,old->filename);
- strcat(buf,compressors[old->compression-1].ext);
- tmpfile = Decompress(buf,old->compression-1);
- if ( tmpfile==NULL )
- temp = NULL;
- else {
- temp = ReadSplineFont(tmpfile,0);
- unlink(tmpfile);
- free(tmpfile);
- }
- } else
- temp = ReadSplineFont(old->origname,0);
- }
- if ( temp==NULL ) {
-return;
- }
- if ( temp->filename!=NULL ) {
- free(temp->filename);
- temp->filename = copy(old->filename);
- }
- if ( temp->origname!=NULL ) {
- free(temp->origname);
- temp->origname = copy(old->origname);
- }
- temp->compression = old->compression;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVReattachCVs(old,temp);
- for ( i=0; i<old->subfontcnt; ++i )
- FVReattachCVs(old->subfonts[i],temp);
- for ( fbdf=old->bitmaps; fbdf!=NULL; fbdf=fbdf->next ) {
- for ( tbdf=temp->bitmaps; tbdf!=NULL; tbdf=tbdf->next )
- if ( tbdf->pixelsize==fbdf->pixelsize )
- break;
- for ( i=0; i<fv->sf->glyphcnt; ++i ) {
- if ( i<fbdf->glyphcnt && fbdf->glyphs[i]!=NULL && fbdf->glyphs[i]->views!=NULL ) {
- int pos = SFFindExistingSlot(temp,fv->sf->glyphs[i]->unicodeenc,fv->sf->glyphs[i]->name);
- bc = pos==-1 || tbdf==NULL?NULL:tbdf->glyphs[pos];
- if ( bc==NULL ) {
- for ( bv=fbdf->glyphs[i]->views; bv!=NULL; bv = bvnext ) {
- bvnext = bv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(bv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(bv->gw);
-# endif
- }
- } else {
- for ( bv=fbdf->glyphs[i]->views; bv!=NULL; bv = bvnext ) {
- bvnext = bv->next;
- BVChangeBC(bv,bc,true);
- }
- }
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawProcessPendingEvents(NULL); /* Don't want to many destroy_notify events clogging up the queue */
-# endif
- }
- }
- }
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
-# endif
- if ( fv->sf->fontinfo )
- FontInfoDestroy(fv->sf);
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- for ( mv=fvs->sf->metrics; mv!=NULL; mv = mvnext ) {
- /* Don't bother trying to fix up metrics views, just not worth it */
- mvnext = mv->next;
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawDestroyWindow(mv->gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_destroy(mv->gw);
-# endif
- }
- }
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
-# endif
-#endif
- if ( temp->map->enccount>fv->map->enccount ) {
- fv->selected = grealloc(fv->selected,temp->map->enccount);
- memset(fv->selected+fv->map->enccount,0,temp->map->enccount-fv->map->enccount);
- }
- EncMapFree(fv->map);
- fv->map = temp->map;
- SFClearAutoSave(old);
- temp->fv = fv->sf->fv;
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- fvs->sf = temp;
- FontViewReformatAll(fv->sf);
- SplineFontFree(old);
-}
-
-void FVRevert(FontView *fv) {
- _FVRevert(fv,false);
-}
-
-void FVRevertBackup(FontView *fv) {
- _FVRevert(fv,true);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuRevert(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RevertFile(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVRevert(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuRevertBackup(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RevertBackup(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVRevertBackup(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuRevertGlyph(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RevertGlyph(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i, gid;
- int nc_state = -1;
- SplineFont *sf = fv->sf;
- SplineChar *sc, *tsc;
- SplineChar temp;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Undoes **undoes;
- int layer, lc;
-#endif
- EncMap *map = fv->map;
- CharView *cvs;
-
- if ( fv->sf->sfd_version<2 )
- gwwv_post_error(_("Old sfd file"),_("This font comes from an old format sfd file. Not all aspects of it can be reverted successfully."));
-
- for ( i=0; i<map->enccount; ++i ) if ( fv->selected[i] && (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- tsc = sf->glyphs[gid];
- if ( tsc->namechanged ) {
- if ( nc_state==-1 ) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_post_error(_("Glyph Name Changed"),_("The name of glyph %.40s has changed. This is what I use to find the glyph in the file, so I cannot revert this glyph.\n(You will not be warned for subsequent glyphs.)"),tsc->name);
-#endif
- nc_state = 0;
- }
- } else {
- sc = SFDReadOneChar(sf,tsc->name);
- if ( sc==NULL ) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_post_error(_("Can't Find Glyph"),_("The glyph, %.80s, can't be found in the sfd file"),tsc->name);
-#endif
- tsc->namechanged = true;
- } else {
- SCPreserveState(tsc,true);
- SCPreserveBackground(tsc);
- temp = *tsc;
- tsc->dependents = NULL;
-#ifdef FONTFORGE_CONFIG_TYPE3
- lc = tsc->layer_cnt;
- undoes = galloc(lc*sizeof(Undoes *));
- for ( layer=0; layer<lc; ++layer ) {
- undoes[layer] = tsc->layers[layer].undoes;
- tsc->layers[layer].undoes = NULL;
- }
-#else
- tsc->layers[ly_back].undoes = tsc->layers[ly_fore].undoes = NULL;
-#endif
- SplineCharFreeContents(tsc);
- *tsc = *sc;
- chunkfree(sc,sizeof(SplineChar));
- tsc->parent = sf;
- tsc->dependents = temp.dependents;
- tsc->views = temp.views;
-#ifdef FONTFORGE_CONFIG_TYPE3
- for ( layer = 0; layer<lc && layer<tsc->layer_cnt; ++layer )
- tsc->layers[layer].undoes = undoes[layer];
- for ( ; layer<lc; ++layer )
- UndoesFree(undoes[layer]);
- free(undoes);
-#else
- tsc->layers[ly_fore].undoes = temp.layers[ly_fore].undoes;
- tsc->layers[ly_back].undoes = temp.layers[ly_back].undoes;
-#endif
- /* tsc->changed = temp.changed; */
- /* tsc->orig_pos = temp.orig_pos; */
- for ( cvs=tsc->views; cvs!=NULL; cvs=cvs->next ) {
- cvs->layerheads[dm_back] = &tsc->layers[ly_back];
- cvs->layerheads[dm_fore] = &tsc->layers[ly_fore];
- }
- RevertedGlyphReferenceFixup(tsc, sf);
- _SCCharChangedUpdate(tsc,false);
- }
- }
- }
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-void MenuPrefs(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void Menu_Preferences(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- DoPrefs();
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-void MenuSaveAll(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void Menu_SaveAll(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- FontView *fv;
-
- for ( fv = fv_list; fv!=NULL; fv = fv->next ) {
- if ( SFAnyChanged(fv->sf) && !_FVMenuSave(fv))
-return;
- }
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void _MenuExit(void *junk) {
- FontView *fv, *next;
-
- for ( fv = fv_list; fv!=NULL; fv = next ) {
- next = fv->next;
- if ( !_FVMenuClose(fv))
-return;
-#ifdef FONTFORGE_CONFIG_GDRAW
- if ( fv->nextsame!=NULL || fv->sf->fv!=fv ) {
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- }
-#endif
- }
- exit(0);
-}
-
-# ifdef FONTFORGE_CONFIG_GTK
-static void Menu_Exit(GtkMenuItem *menuitem, gpointer user_data) {
- _MenuExit(NULL);
-}
-
-char *GetPostscriptFontName(char *dir, int mult) {
- /* Some people use pf3 as an extension for postscript type3 fonts */
- /* Any of these extensions */
- static char wild[] = "*.{"
- "pfa,"
- "pfb,"
- "pt3,"
- "t42,"
- "sfd,"
- "ttf,"
- "bdf,"
- "otf,"
- "otb,"
- "cff,"
- "cef,"
- "gai,"
-#ifndef _NO_LIBXML
- "svg,"
-#endif
- "pf3,"
- "ttc,"
- "gsf,"
- "cid,"
- "bin,"
- "hqx,"
- "dfont,"
- "mf,"
- "ik,"
- "fon,"
- "fnt,"
- "pdb"
- "}"
-/* With any of these methods of compression */
- "{.gz,.Z,.bz2,}";
- gsize read, written;
- char *u_dir, *ret, *temp;
-
- u_dir = g_filename_to_utf8(dir,-1,&read,&written,NULL);
- ret = FVOpenFont(_("Open Font"), u_dir,wild,mult);
- temp = g_filename_from_utf8(ret,-1,&read,&written,NULL);
- free(u_dir); free(ret);
-
-return( temp );
-}
-
-void MergeKernInfo(SplineFont *sf,EncMap *map) {
-#ifndef __Mac
- static char wild[] = "*.{afm,tfm,ofm,pfm,bin,hqx,dfont,fea}";
- static char wild2[] = "*.{afm,amfm,tfm,ofm,pfm,bin,hqx,dfont,fea}";
-#else
- static char wild[] = "*"; /* Mac resource files generally don't have extensions */
- static char wild2[] = "*";
-#endif
- char *ret = gwwv_open_filename(_("Merge Feature Info"),NULL,
- sf->mm!=NULL?wild2:wild,NULL);
-
- if ( ret==NULL ) /* Cancelled */
-return;
-
- if ( !LoadKerningDataFromMetricsFile(sf,ret,map))
- gwwv_post_error( _("Failed to load kern data from %s"), ret);
- free(ret);
-}
-# elif defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuExit(GWindow base,struct gmenuitem *mi,GEvent *e) {
- _MenuExit(NULL);
-}
-
-void MenuExit(GWindow base,struct gmenuitem *mi,GEvent *e) {
- if ( e==NULL ) /* Not from the menu directly, but a shortcut */
- _MenuExit(NULL);
- else
- DelayEvent(_MenuExit,NULL);
-}
-
-char *GetPostscriptFontName(char *dir, int mult) {
- /* Some people use pf3 as an extension for postscript type3 fonts */
- unichar_t *ret;
- char *u_dir;
- char *temp;
-
- u_dir = def2utf8_copy(dir);
- ret = FVOpenFont(_("Open Font"), u_dir,mult);
- temp = u2def_copy(ret);
-
- free(ret);
-return( temp );
-}
-
-void MergeKernInfo(SplineFont *sf,EncMap *map) {
-#ifndef __Mac
- static char wild[] = "*.{afm,tfm,ofm,pfm,bin,hqx,dfont,fea}";
- static char wild2[] = "*.{afm,amfm,tfm,ofm,pfm,bin,hqx,dfont,fea}";
-#else
- static char wild[] = "*"; /* Mac resource files generally don't have extensions */
- static char wild2[] = "*";
-#endif
-#if defined(FONTFORGE_CONFIG_GTK)
- gsize read, written;
-#endif
- char *ret = gwwv_open_filename(_("Merge Feature Info"),NULL,
- sf->mm!=NULL?wild2:wild,NULL);
- char *temp;
-
- if ( ret==NULL )
-return; /* Cancelled */
-# ifdef FONTFORGE_CONFIG_GDRAW
- temp = utf82def_copy(ret);
-# elif defined(FONTFORGE_CONFIG_GTK)
- temp = g_utf8_to_filename(ret,-1,&read,&written,NULL);
-#endif
-
- if ( !LoadKerningDataFromMetricsFile(sf,temp,map))
- gwwv_post_error(_("Load of Kerning Metrics Failed"),_("Failed to load kern data from %s"), temp);
- free(ret); free(temp);
-}
-# endif
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuMergeKern(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_MergeKern(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- MergeKernInfo(fv->sf,fv->map);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-void MenuOpen(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void Menu_Open(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- char *temp;
- char *eod, *fpt, *file, *full;
- FontView *test; int fvcnt, fvtest;
-
- for ( fvcnt=0, test=fv_list; test!=NULL; ++fvcnt, test=test->next );
- do {
- temp = GetPostscriptFontName(NULL,true);
- if ( temp==NULL )
-return;
- eod = strrchr(temp,'/');
- *eod = '\0';
- file = eod+1;
- do {
- fpt = strstr(file,"; ");
- if ( fpt!=NULL ) *fpt = '\0';
- full = galloc(strlen(temp)+1+strlen(file)+1);
- strcpy(full,temp); strcat(full,"/"); strcat(full,file);
- ViewPostscriptFont(full);
- file = fpt+2;
- free(full);
- } while ( fpt!=NULL );
- free(temp);
- for ( fvtest=0, test=fv_list; test!=NULL; ++fvtest, test=test->next );
- } while ( fvtest==fvcnt ); /* did the load fail for some reason? try again */
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuContextualHelp(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ContextualHelp(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- help("fontview.html");
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-void MenuHelp(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void MenuHelp_Help(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- help("overview.html");
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-void MenuIndex(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void MenuHelp_Index(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- help("IndexFS.html");
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-void MenuLicense(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void MenuHelp_License(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- help("license.html");
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-void MenuAbout(GWindow base,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void MenuHelp_About(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- ShowAboutScreen();
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuImport(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Import(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int empty = fv->sf->onlybitmaps && fv->sf->bitmaps==NULL;
- BDFFont *bdf;
- FVImport(fv);
- if ( empty && fv->sf->bitmaps!=NULL ) {
- for ( bdf= fv->sf->bitmaps; bdf->next!=NULL; bdf = bdf->next );
- FVChangeDisplayBitmap(fv,bdf);
- }
-}
-
-static int FVSelCount(FontView *fv) {
- int i, cnt=0;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] ) ++cnt;
- if ( cnt>10 ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_OK");
- buts[1] = _("_Cancel");
- buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL };
-#endif
- if ( gwwv_ask(_("Many Windows"),(const char **) buts,0,1,_("This involves opening more than 10 windows.\nIs that really what you want?"))==1 )
-return( false );
- }
-return( true );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuOpenOutline(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_OpenOutline(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i;
- SplineChar *sc;
-
- if ( !FVSelCount(fv))
-return;
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] ) {
- sc = FVMakeChar(fv,i);
- CharViewCreate(sc,fv,i);
- }
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuOpenBitmap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_OpenBitmap(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i;
- SplineChar *sc;
-
- if ( fv->cidmaster==NULL ? (fv->sf->bitmaps==NULL) : (fv->cidmaster->bitmaps==NULL) )
-return;
- if ( !FVSelCount(fv))
-return;
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] ) {
- sc = FVMakeChar(fv,i);
- if ( sc!=NULL )
- BitmapViewCreatePick(i,fv);
- }
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-void _MenuWarnings(GWindow gw,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void WindowMenu_Warnings(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- ShowErrorWindow();
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuOpenMetrics(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_OpenMetrics(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- MetricsViewCreate(fv,NULL,fv->filled==fv->show?NULL:fv->show);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuPrint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Print(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- PrintDlg(fv,NULL,NULL);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuDisplay(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Display(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- DisplayDlg(fv->sf);
-}
-
-#if !defined(_NO_FFSCRIPT) || !defined(_NO_PYTHON)
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuExecute(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ExecScript(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- ScriptDlg(fv);
-}
-#endif
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuFontInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_FontInfo(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FontMenuFontInfo(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuFindProblems(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_FindProbs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FindProblems(fv,NULL,NULL);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuMetaFont(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Metafont(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-#ifdef GWW_TEST
- extern int ChangeWeight(SplineChar *sc,double factor,double add);
- int i, gid;
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] && (gid=fv->map->map[i])!=-1 && fv->sf->glyphs[gid]!=NULL )
- ChangeWeight(fv->sf->glyphs[gid],2.0,25);
-#else
- MetaFont(fv,NULL,NULL);
-#endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-#define MID_24 2001
-#define MID_36 2002
-#define MID_48 2004
-#define MID_72 2014
-#define MID_96 2015
-#define MID_AntiAlias 2005
-#define MID_Next 2006
-#define MID_Prev 2007
-#define MID_NextDef 2012
-#define MID_PrevDef 2013
-#define MID_ShowHMetrics 2016
-#define MID_ShowVMetrics 2017
-#define MID_Ligatures 2020
-#define MID_KernPairs 2021
-#define MID_AnchorPairs 2022
-#define MID_FitToEm 2023
-#define MID_DisplaySubs 2024
-#define MID_32x8 2025
-#define MID_16x4 2026
-#define MID_8x2 2027
-#define MID_BitmapMag 2028
-#define MID_CharInfo 2201
-#define MID_FindProblems 2216
-#define MID_MetaFont 2217
-#define MID_Transform 2202
-#define MID_Stroke 2203
-#define MID_RmOverlap 2204
-#define MID_Simplify 2205
-#define MID_Correct 2206
-#define MID_BuildAccent 2208
-#define MID_AvailBitmaps 2210
-#define MID_RegenBitmaps 2211
-#define MID_Autotrace 2212
-#define MID_Round 2213
-#define MID_MergeFonts 2214
-#define MID_InterpolateFonts 2215
-#define MID_ShowDependentRefs 2222
-#define MID_AddExtrema 2224
-#define MID_CleanupGlyph 2225
-#define MID_TilePath 2226
-#define MID_BuildComposite 2227
-#define MID_NLTransform 2228
-#define MID_Intersection 2229
-#define MID_FindInter 2230
-#define MID_Effects 2231
-#define MID_SimplifyMore 2233
-#define MID_ShowDependentSubs 2234
-#define MID_DefaultATT 2235
-#define MID_POV 2236
-#define MID_BuildDuplicates 2237
-#define MID_StrikeInfo 2238
-#define MID_FontCompare 2239
-#define MID_CanonicalStart 2242
-#define MID_CanonicalContours 2243
-#define MID_RemoveBitmaps 2244
-#define MID_Center 2600
-#define MID_Thirds 2601
-#define MID_SetWidth 2602
-#define MID_SetLBearing 2603
-#define MID_SetRBearing 2604
-#define MID_SetVWidth 2605
-#define MID_RmHKern 2606
-#define MID_RmVKern 2607
-#define MID_VKernByClass 2608
-#define MID_VKernFromH 2609
-#define MID_AutoHint 2501
-#define MID_ClearHints 2502
-#define MID_ClearWidthMD 2503
-#define MID_AutoInstr 2504
-#define MID_EditInstructions 2505
-#define MID_Editfpgm 2506
-#define MID_Editprep 2507
-#define MID_ClearInstrs 2508
-#define MID_HStemHist 2509
-#define MID_VStemHist 2510
-#define MID_BlueValuesHist 2511
-#define MID_Editcvt 2512
-#define MID_HintSubsPt 2513
-#define MID_AutoCounter 2514
-#define MID_DontAutoHint 2515
-#define MID_PrivateToCvt 2516
-#define MID_Editmaxp 2517
-#define MID_OpenBitmap 2700
-#define MID_OpenOutline 2701
-#define MID_Revert 2702
-#define MID_Recent 2703
-#define MID_Print 2704
-#define MID_ScriptMenu 2705
-#define MID_Display 2706
-#define MID_RevertGlyph 2707
-#define MID_RevertToBackup 2708
-#define MID_Cut 2101
-#define MID_Copy 2102
-#define MID_Paste 2103
-#define MID_Clear 2104
-#define MID_SelAll 2106
-#define MID_CopyRef 2107
-#define MID_UnlinkRef 2108
-#define MID_Undo 2109
-#define MID_Redo 2110
-#define MID_CopyWidth 2111
-#define MID_AllFonts 2122
-#define MID_DisplayedFont 2123
-#define MID_CharName 2124
-#define MID_RemoveUndoes 2114
-#define MID_CopyFgToBg 2115
-#define MID_ClearBackground 2116
-#define MID_CopyLBearing 2125
-#define MID_CopyRBearing 2126
-#define MID_CopyVWidth 2127
-#define MID_Join 2128
-#define MID_PasteInto 2129
-#define MID_SameGlyphAs 2130
-#define MID_RplRef 2131
-#define MID_PasteAfter 2132
-#define MID_TTFInstr 2134
-#define MID_CopyLookupData 2135
-#define MID_Convert2CID 2800
-#define MID_Flatten 2801
-#define MID_InsertFont 2802
-#define MID_InsertBlank 2803
-#define MID_CIDFontInfo 2804
-#define MID_RemoveFromCID 2805
-#define MID_ConvertByCMap 2806
-#define MID_FlattenByCMap 2807
-#define MID_ChangeSupplement 2808
-#define MID_Reencode 2830
-#define MID_ForceReencode 2831
-#define MID_AddUnencoded 2832
-#define MID_RemoveUnused 2833
-#define MID_DetachGlyphs 2834
-#define MID_DetachAndRemoveGlyphs 2835
-#define MID_LoadEncoding 2836
-#define MID_MakeFromFont 2837
-#define MID_RemoveEncoding 2838
-#define MID_DisplayByGroups 2839
-#define MID_Compact 2840
-#define MID_SaveNamelist 2841
-#define MID_RenameGlyphs 2842
-#define MID_NameGlyphs 2843
-#define MID_CreateMM 2900
-#define MID_MMInfo 2901
-#define MID_MMValid 2902
-#define MID_ChangeMMBlend 2903
-#define MID_BlendToNew 2904
-#define MID_ModifyComposition 20902
-#define MID_BuildSyllables 20903
-
-#define MID_Warnings 3000
-# endif
-#endif
-
-#ifndef LUA_FF_LIB
-/* returns -1 if nothing selected, if exactly one char return it, -2 if more than one */
-static int FVAnyCharSelected(FontView *fv) {
- int i, val=-1;
-
- for ( i=0; i<fv->map->enccount; ++i ) {
- if ( fv->selected[i]) {
- if ( val==-1 )
- val = i;
- else
-return( -2 );
- }
- }
-return( val );
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int FVAllSelected(FontView *fv) {
- int i, any = false;
- /* Is everything real selected? */
-
- for ( i=0; i<fv->sf->glyphcnt; ++i ) if ( SCWorthOutputting(fv->sf->glyphs[i])) {
- if ( !fv->selected[fv->map->backmap[i]] )
-return( false );
- any = true;
- }
-return( any );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCopyFrom(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- /*FontView *fv = (FontView *) GDrawGetUserData(gw);*/
-
- if ( mi->mid==MID_CharName )
- copymetadata = !copymetadata;
- else if ( mi->mid==MID_TTFInstr )
- copyttfinstr = !copyttfinstr;
- else
- onlycopydisplayed = (mi->mid==MID_DisplayedFont);
- SavePrefs();
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CopyFromAll(GtkMenuItem *menuitem, gpointer user_data) {
-
- onlycopydisplayed = false;
- SavePrefs();
-}
-
-void FontViewMenu_CopyFromDisplayed(GtkMenuItem *menuitem, gpointer user_data) {
-
- onlycopydisplayed = true;
- SavePrefs();
-}
-
-void FontViewMenu_CopyFromMetadata(GtkMenuItem *menuitem, gpointer user_data) {
-
- copymetadata = !copymetadata;
- SavePrefs();
-}
-# endif
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCopy(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Copy(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- FVCopy(fv,ct_fullcopy);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCopyLookupData(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CopyLookupData(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- FVCopy(fv,ct_lookups);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCopyRef(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CopyRef(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- FVCopy(fv,ct_reference);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCopyWidth(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- if ( mi->mid==MID_CopyVWidth && !fv->sf->hasvmetrics )
-return;
- FVCopyWidth(fv,mi->mid==MID_CopyWidth?ut_width:
- mi->mid==MID_CopyVWidth?ut_vwidth:
- mi->mid==MID_CopyLBearing?ut_lbearing:
- ut_rbearing);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CopyWidth(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- FVCopyWidth(fv,ut_width);
-}
-
-void FontViewMenu_CopyVWidth(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- if ( !fv->sf->hasvmetrics )
-return;
- FVCopyWidth(fv,ut_vwidth);
-}
-
-void FontViewMenu_CopyLBearing(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- FVCopyWidth(fv,ut_lbearing);
-}
-
-void FontViewMenu_CopyRBearing(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- FVCopyWidth(fv,ut_rbearing);
-}
-# endif
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuPaste(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Paste(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- PasteIntoFV(fv,false,NULL);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuPasteInto(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_PasteInto(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- PasteIntoFV(fv,true,NULL);
-}
-
-#ifdef FONTFORGE_CONFIG_PASTEAFTER
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuPasteAfter(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_PasteAfter(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int pos = FVAnyCharSelected(fv);
- if ( pos<0 )
-return;
- PasteIntoFV(fv,2,NULL);
-}
-#elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_PasteAfter(GtkMenuItem *menuitem, gpointer user_data) {
-}
-#endif
-#endif
-
-void AltUniRemove(SplineChar *sc,int uni) {
- struct altuni *altuni, *prev;
-
- if ( sc==NULL || uni==-1 )
-return;
-
- if ( sc->unicodeenc==uni && sc->altuni!=NULL ) {
- sc->unicodeenc = sc->altuni->unienc;
- sc->altuni->unienc = uni;
- }
-
- if ( sc->unicodeenc==uni )
-return;
- for ( prev=NULL, altuni=sc->altuni; altuni!=NULL && altuni->unienc!=uni;
- prev = altuni, altuni = altuni->next );
- if ( altuni ) {
- if ( prev==NULL )
- sc->altuni = altuni->next;
- else
- prev->next = altuni->next;
- altuni->next = NULL;
- AltUniFree(altuni);
- }
-}
-
-void AltUniAdd(SplineChar *sc,int uni) {
- struct altuni *altuni;
-
- if ( sc!=NULL && uni!=-1 && uni!=sc->unicodeenc ) {
- for ( altuni = sc->altuni; altuni!=NULL && altuni->unienc!=uni; altuni=altuni->next );
- if ( altuni==NULL ) {
- altuni = chunkalloc(sizeof(struct altuni));
- altuni->next = sc->altuni;
- sc->altuni = altuni;
- altuni->unienc = uni;
- }
- }
-}
-
-static void LinkEncToGid(FontView *fv,int enc, int gid) {
- EncMap *map = fv->map;
- int old_gid;
- int flags = -1;
- int j;
-
- if ( map->map[enc]!=-1 && map->map[enc]!=gid ) {
- SplineFont *sf = fv->sf;
- old_gid = map->map[enc];
- for ( j=0; j<map->enccount; ++j )
- if ( j!=enc && map->map[j]==old_gid )
- break;
- /* If the glyph is used elsewhere in the encoding then reusing this */
- /* slot causes no problems */
- if ( j==map->enccount ) {
- /* However if this is the only use and the glyph is interesting */
- /* then add it to the unencoded area. If it is uninteresting we*/
- /* can just get rid of it */
- if ( SCWorthOutputting(sf->glyphs[old_gid]) )
- SFAddEncodingSlot(sf,old_gid);
- else
- SFRemoveGlyph(sf,sf->glyphs[old_gid],&flags);
- }
- }
- map->map[enc] = gid;
- if ( map->backmap[gid]==-1 )
- map->backmap[gid] = enc;
- if ( map->enc!=&custom ) {
- int uni = UniFromEnc(enc,map->enc);
- AltUniAdd(fv->sf->glyphs[gid],uni);
- }
-}
-
-static void FVSameGlyphAs(FontView *fv) {
- SplineFont *sf = fv->sf;
- RefChar *base = CopyContainsRef(sf);
- int i;
- EncMap *map = fv->map;
-
- if ( base==NULL || fv->cidmaster!=NULL )
-return;
- for ( i=0; i<map->enccount; ++i ) if ( fv->selected[i] ) {
- LinkEncToGid(fv,i,base->orig_pos);
- }
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawRequestExpose(fv->v,NULL,false);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_queue_draw(fv->v);
-#endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSameGlyphAs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SameGlyphAs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVSameGlyphAs(fv);
-}
-#endif
-
-
-static void FVCopyFgtoBg(FontView *fv) {
- int i, gid;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL &&
- fv->sf->glyphs[gid]->layers[1].splines!=NULL )
- SCCopyFgToBg(fv->sf->glyphs[gid],true);
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCopyFgBg(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CopyFg2Bg(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVCopyFgtoBg( fv );
-}
-#endif
-
-void BCClearAll(BDFChar *bc) {
- if ( bc==NULL )
-return;
- BCPreserveState(bc);
- BCFlattenFloat(bc);
- memset(bc->bitmap,'\0',bc->bytes_per_line*(bc->ymax-bc->ymin+1));
- BCCompressBitmap(bc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- BCCharChangedUpdate(bc);
-#endif
-}
-
-void SCClearContents(SplineChar *sc) {
- RefChar *refs, *next;
- int layer;
-
- if ( sc==NULL )
-return;
- sc->widthset = false;
- sc->width = sc->parent->ascent+sc->parent->descent;
- for ( layer = ly_fore; layer<sc->layer_cnt; ++layer ) {
- SplinePointListsFree(sc->layers[layer].splines);
- sc->layers[layer].splines = NULL;
- for ( refs=sc->layers[layer].refs; refs!=NULL; refs = next ) {
- next = refs->next;
- SCRemoveDependent(sc,refs);
- }
- sc->layers[layer].refs = NULL;
- }
- AnchorPointsFree(sc->anchor);
- sc->anchor = NULL;
- StemInfosFree(sc->hstem); sc->hstem = NULL;
- StemInfosFree(sc->vstem); sc->vstem = NULL;
- DStemInfosFree(sc->dstem); sc->dstem = NULL;
- MinimumDistancesFree(sc->md); sc->md = NULL;
- free(sc->ttf_instrs);
- sc->ttf_instrs = NULL;
- sc->ttf_instrs_len = 0;
- SCOutOfDateBackground(sc);
-}
-
-void SCClearAll(SplineChar *sc) {
-
- if ( sc==NULL )
-return;
- if ( sc->layers[1].splines==NULL && sc->layers[ly_fore].refs==NULL && !sc->widthset &&
- sc->hstem==NULL && sc->vstem==NULL && sc->anchor==NULL &&
- (!copymetadata ||
- (sc->unicodeenc==-1 && strcmp(sc->name,".notdef")==0)))
-return;
- SCPreserveState(sc,2);
- if ( copymetadata ) {
- sc->unicodeenc = -1;
- free(sc->name);
- sc->name = copy(".notdef");
- PSTFree(sc->possub);
- sc->possub = NULL;
- }
- SCClearContents(sc);
- SCCharChangedUpdate(sc);
-}
-
-void SCClearBackground(SplineChar *sc) {
-
- if ( sc==NULL )
-return;
- if ( sc->layers[0].splines==NULL && sc->layers[ly_back].images==NULL )
-return;
- SCPreserveBackground(sc);
- SplinePointListsFree(sc->layers[0].splines);
- sc->layers[0].splines = NULL;
- ImageListsFree(sc->layers[ly_back].images);
- sc->layers[ly_back].images = NULL;
- SCOutOfDateBackground(sc);
- SCCharChangedUpdate(sc);
-}
-
-static int UnselectedDependents(FontView *fv, SplineChar *sc) {
- struct splinecharlist *dep;
-
- for ( dep=sc->dependents; dep!=NULL; dep=dep->next ) {
- if ( !fv->selected[fv->map->backmap[dep->sc->orig_pos]] )
-return( true );
- if ( UnselectedDependents(fv,dep->sc))
-return( true );
- }
-return( false );
-}
-
-void UnlinkThisReference(FontView *fv,SplineChar *sc) {
- /* We are about to clear out sc. But somebody refers to it and that we */
- /* aren't going to delete. So (if the user asked us to) instanciate sc */
- /* into all characters which refer to it and which aren't about to be */
- /* cleared out */
- struct splinecharlist *dep, *dnext;
-
- for ( dep=sc->dependents; dep!=NULL; dep=dnext ) {
- dnext = dep->next;
- if ( fv==NULL || !fv->selected[fv->map->backmap[dep->sc->orig_pos]]) {
- SplineChar *dsc = dep->sc;
- RefChar *rf, *rnext;
- /* May be more than one reference to us, colon has two refs to period */
- /* but only one dlist entry */
- for ( rf = dsc->layers[ly_fore].refs; rf!=NULL; rf=rnext ) {
- rnext = rf->next;
- if ( rf->sc == sc ) {
- /* Even if we were to preserve the state there would be no */
- /* way to undo the operation until we undid the delete... */
- SCRefToSplines(dsc,rf);
- SCUpdateAll(dsc);
- }
- }
- }
- }
-}
-
-#ifndef LUA_FF_LIB
-static void FVClear(FontView *fv) {
- int i;
- BDFFont *bdf;
- int refstate = 0;
- char *buts[6];
- int yes, unsel, gid;
- /* refstate==0 => ask, refstate==1 => clearall, refstate==-1 => skip all */
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] && (gid=fv->map->map[i])!=-1 ) {
- if ( !onlycopydisplayed || fv->filled==fv->show ) {
- /* If we are messing with the outline character, check for dependencies */
- if ( refstate<=0 && fv->sf->glyphs[gid]!=NULL &&
- fv->sf->glyphs[gid]->dependents!=NULL ) {
- unsel = UnselectedDependents(fv,fv->sf->glyphs[gid]);
- if ( refstate==-2 && unsel ) {
- UnlinkThisReference(fv,fv->sf->glyphs[gid]);
- } else if ( unsel ) {
- if ( refstate<0 )
- continue;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[0] = _("_Yes");
- buts[4] = _("_No");
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[0] = GTK_STOCK_YES;
- buts[4] = GTK_STOCK_NO;
-#endif
- buts[1] = _("Yes to _All");
- buts[2] = _("_Unlink All");
- buts[3] = _("No _to All");
- buts[5] = NULL;
- yes = gwwv_ask(_("Bad Reference"),(const char **) buts,2,4,_("You are attempting to clear %.30s which is referred to by\nanother character. Are you sure you want to clear it?"),fv->sf->glyphs[gid]->name);
- if ( yes==1 )
- refstate = 1;
- else if ( yes==2 ) {
- UnlinkThisReference(fv,fv->sf->glyphs[gid]);
- refstate = -2;
- } else if ( yes==3 )
- refstate = -1;
- if ( yes>=3 )
- continue;
- }
- }
- }
-
- if ( onlycopydisplayed && fv->filled==fv->show ) {
- SCClearAll(fv->sf->glyphs[gid]);
- } else if ( onlycopydisplayed ) {
- BCClearAll(fv->show->glyphs[gid]);
- } else {
- SCClearAll(fv->sf->glyphs[gid]);
- for ( bdf=fv->sf->bitmaps; bdf!=NULL; bdf = bdf->next )
- BCClearAll(bdf->glyphs[gid]);
- }
- }
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuClear(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Clear(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVClear( fv );
-}
-#endif
-
-static void FVClearBackground(FontView *fv) {
- SplineFont *sf = fv->sf;
- int i, gid;
-
- if ( onlycopydisplayed && fv->filled!=fv->show )
-return;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- SCClearBackground(sf->glyphs[gid]);
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuClearBackground(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ClearBackground(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVClearBackground( fv );
-}
-#endif
-
-static void FVJoin(FontView *fv) {
- SplineFont *sf = fv->sf;
- int i,changed,gid;
- extern float joinsnap;
-
- if ( onlycopydisplayed && fv->filled!=fv->show )
-return;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- SCPreserveState(sf->glyphs[gid],false);
- sf->glyphs[gid]->layers[ly_fore].splines = SplineSetJoin(sf->glyphs[gid]->layers[ly_fore].splines,true,joinsnap,&changed);
- if ( changed )
- SCCharChangedUpdate(sf->glyphs[gid]);
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuJoin(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Join(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVJoin( fv );
-}
-#endif
-
-static void FVUnlinkRef(FontView *fv) {
- int i,layer, gid;
- SplineChar *sc;
- RefChar *rf, *next;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && (sc = fv->sf->glyphs[gid])!=NULL &&
- sc->layers[ly_fore].refs!=NULL ) {
- SCPreserveState(sc,false);
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- for ( rf=sc->layers[ly_fore].refs; rf!=NULL ; rf=next ) {
- next = rf->next;
- SCRefToSplines(sc,rf);
- }
- }
- SCCharChangedUpdate(sc);
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuUnlinkRef(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_UnlinkRef(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVUnlinkRef( fv );
-}
-#endif
-
-void SFRemoveUndoes(SplineFont *sf,uint8 *selected, EncMap *map) {
- SplineFont *sf_main = sf->cidmaster? sf->cidmaster : sf, *ssf;
- int i,k, max, layer, gid;
- SplineChar *sc;
- BDFFont *bdf;
-
- if ( selected!=NULL || sf_main->subfontcnt==0 )
- max = sf->glyphcnt;
- else {
- max = 0;
- for ( k=0; k<sf_main->subfontcnt; ++k )
- if ( sf_main->subfonts[k]->glyphcnt>max ) max = sf_main->subfonts[k]->glyphcnt;
- }
- for ( i=0; ; ++i ) {
- if ( selected==NULL || sf_main->subfontcnt!=0 ) {
- if ( i>=max )
- break;
- gid = i;
- } else {
- if ( i>=map->enccount )
- break;
- if ( !selected[i])
- continue;
- gid = map->map[i];
- if ( gid==-1 )
- continue;
- }
- for ( bdf=sf_main->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- if ( bdf->glyphs[gid]!=NULL ) {
- UndoesFree(bdf->glyphs[gid]->undoes); bdf->glyphs[gid]->undoes = NULL;
- UndoesFree(bdf->glyphs[gid]->redoes); bdf->glyphs[gid]->redoes = NULL;
- }
- }
- k = 0;
- do {
- ssf = sf_main->subfontcnt==0? sf_main: sf_main->subfonts[k];
- if ( gid<ssf->glyphcnt && ssf->glyphs[gid]!=NULL ) {
- sc = ssf->glyphs[gid];
- for ( layer = 0; layer<sc->layer_cnt; ++layer ) {
- UndoesFree(sc->layers[layer].undoes); sc->layers[layer].undoes = NULL;
- UndoesFree(sc->layers[layer].redoes); sc->layers[layer].redoes = NULL;
- }
- }
- ++k;
- } while ( k<sf_main->subfontcnt );
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuRemoveUndoes(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RemoveUndoes(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SFRemoveUndoes(fv->sf,fv->selected,fv->map);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuUndo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Undo(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i,j,layer, gid;
- MMSet *mm = fv->sf->mm;
- int was_blended = mm!=NULL && mm->normal==fv->sf;
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL && !fv->sf->glyphs[gid]->ticked) {
- SplineChar *sc = fv->sf->glyphs[gid];
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- if ( sc->layers[layer].undoes!=NULL ) {
- SCDoUndo(sc,layer);
- if ( was_blended ) {
- for ( j=0; j<mm->instance_count; ++j )
- SCDoUndo(mm->instances[j]->glyphs[gid],layer);
- }
- }
- }
- sc->ticked = true;
- }
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuRedo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Redo(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i,j,layer, gid;
- MMSet *mm = fv->sf->mm;
- int was_blended = mm!=NULL && mm->normal==fv->sf;
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL && !fv->sf->glyphs[gid]->ticked) {
- SplineChar *sc = fv->sf->glyphs[gid];
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- if ( sc->layers[layer].redoes!=NULL ) {
- SCDoRedo(sc,layer);
- if ( was_blended ) {
- for ( j=0; j<mm->instance_count; ++j )
- SCDoRedo(mm->instances[j]->glyphs[gid],layer);
- }
- }
- }
- sc->ticked = true;
- }
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCut(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Cut(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVCopy(fv,ct_fullcopy);
- FVClear(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSelectAll(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SelectAll(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVSelectAll(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuInvertSelection(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_InvertSelection(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVInvertSelection(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuDeselectAll(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_DeselectAll(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVDeselectAll(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSelectByName(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SelectByName(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVSelectByName(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSelectWorthOutputting(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SelectWorthOutputting(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i, gid;
- EncMap *map = fv->map;
- SplineFont *sf = fv->sf;
-
- for ( i=0; i< map->enccount; ++i )
- fv->selected[i] = ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL &&
- SCWorthOutputting(sf->glyphs[gid]) );
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawRequestExpose(fv->v,NULL,false);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_queue_draw(fv->v);
-#endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSelectChanged(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SelectChangedGlyphs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i, gid;
- EncMap *map = fv->map;
- SplineFont *sf = fv->sf;
-
- for ( i=0; i< map->enccount; ++i )
- fv->selected[i] = ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL && sf->glyphs[gid]->changed );
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawRequestExpose(fv->v,NULL,false);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_queue_draw(fv->v);
-#endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSelectHintingNeeded(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SelectUnhintedGlyphs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i, gid;
- EncMap *map = fv->map;
- SplineFont *sf = fv->sf;
- int order2 = sf->order2;
-
- for ( i=0; i< map->enccount; ++i )
- fv->selected[i] = ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL &&
- ((!order2 && sf->glyphs[gid]->changedsincelasthinted ) ||
- ( order2 && sf->glyphs[gid]->layers[ly_fore].splines!=NULL &&
- sf->glyphs[gid]->ttf_instrs_len<=0 ) ||
- ( order2 && sf->glyphs[gid]->instructions_out_of_date )) );
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawRequestExpose(fv->v,NULL,false);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_queue_draw(fv->v);
-#endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSelectColor(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- FVSelectColor(fv,(uint32) (intpt) (mi->ti.userdata),(e->u.chr.state&ksm_shift)?1:0);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SelectDefault(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,COLOR_DEFAULT,false);
-}
-
-void FontViewMenu_SelectWhite(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,0xffffff,false);
-}
-
-void FontViewMenu_SelectRed(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,0xff0000,false);
-}
-
-void FontViewMenu_SelectGreen(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,0x00ff00,false);
-}
-
-void FontViewMenu_SelectBlue(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,0x0000ff,false);
-}
-
-void FontViewMenu_SelectYellow(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,0xffff00,false);
-}
-
-void FontViewMenu_SelectCyan(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,0x00ffff,false);
-}
-
-void FontViewMenu_SelectMagenta(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FVSelectColor(fv,0xff00ff,false);
-}
-
-void FontViewMenu_SelectColorPicker(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- GtkWidget *color_picker = gtk_color_selection_dialog_new(_("Select Color"));
- GtkWidget *color_sel = GTK_COLOR_SELECTION_DIALOG( color_picker )->colorsel;
- static GdkColor last_col;
-
- gtk_color_selection_set_current_color(
- GTK_COLOR_SELECTION( color_sel ), &last_col );
- if (gtk_dialog_run( GTK_DIALOG( color_picker )) == GTK_RESPONSE_ACCEPT) {
- gtk_color_selection_get_current_color(
- GTK_COLOR_SELECTION( color_sel ), &last_col );
- FVSelectColor(fv,((last_col.red>>8)<<16) |
- ((last_col.green>>8)<<8) |
- (last_col.blue>>8),
- false);
- }
- gtk_widget_destroy( color_picker );
-}
-# endif
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSelectByPST(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_SelectByAtt(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVSelectByPST(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuFindRpl(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_FindRpl(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- SVCreate(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuReplaceWithRef(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RplRef(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVReplaceOutlineWithReference(fv,.001);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuCharInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CharInfo(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int pos = FVAnyCharSelected(fv);
- if ( pos<0 )
-return;
- if ( fv->cidmaster!=NULL &&
- (fv->map->map[pos]==-1 || fv->sf->glyphs[fv->map->map[pos]]==NULL ))
-return;
- SCCharInfo(SFMakeChar(fv->sf,fv->map,pos),fv->map,pos);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuBDFInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_BDFInfo(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- if ( fv->sf->bitmaps==NULL )
-return;
- if ( fv->show!=fv->filled )
- SFBdfProperties(fv->sf,fv->map,fv->show);
- else
- SFBdfProperties(fv->sf,fv->map,NULL);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuShowDependentRefs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ShowDependentRefs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int pos = FVAnyCharSelected(fv);
- SplineChar *sc;
-
- if ( pos<0 || fv->map->map[pos]==-1 )
-return;
- sc = fv->sf->glyphs[fv->map->map[pos]];
- if ( sc==NULL || sc->dependents==NULL )
-return;
- SCRefBy(sc);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuShowDependentSubs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ShowDependentSubs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int pos = FVAnyCharSelected(fv);
- SplineChar *sc;
-
- if ( pos<0 || fv->map->map[pos]==-1 )
-return;
- sc = fv->sf->glyphs[fv->map->map[pos]];
- if ( sc==NULL )
-return;
- SCSubBy(sc);
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int getorigin(void *d,BasePoint *base,int index) {
- /*FontView *fv = (FontView *) d;*/
-
- base->x = base->y = 0;
- switch ( index ) {
- case 0: /* Character origin */
- /* all done */
- break;
- case 1: /* Center of selection */
- /*CVFindCenter(cv,base,!CVAnySel(cv,NULL,NULL,NULL,NULL));*/
- break;
- default:
-return( false );
- }
-return( true );
-}
-#endif
-
-void TransHints(StemInfo *stem,real mul1, real off1, real mul2, real off2, int round_to_int ) {
- HintInstance *hi;
-
- for ( ; stem!=NULL; stem=stem->next ) {
- stem->start = stem->start*mul1 + off1;
- stem->width *= mul1;
- if ( round_to_int ) {
- stem->start = rint(stem->start);
- stem->width = rint(stem->width);
- }
- if ( mul1<0 ) {
- stem->start += stem->width;
- stem->width = -stem->width;
- }
- for ( hi=stem->where; hi!=NULL; hi=hi->next ) {
- hi->begin = hi->begin*mul2 + off2;
- hi->end = hi->end*mul2 + off2;
- if ( round_to_int ) {
- hi->begin = rint(hi->begin);
- hi->end = rint(hi->end);
- }
- if ( mul2<0 ) {
- double temp = hi->begin;
- hi->begin = hi->end;
- hi->end = temp;
- }
- }
- }
-}
-
-void VrTrans(struct vr *vr,real transform[6]) {
- /* I'm interested in scaling and skewing. I think translation should */
- /* not affect these guys (they are offsets, so offsets should be */
- /* unchanged by translation */
- double x,y;
-
- x = vr->xoff; y=vr->yoff;
- vr->xoff = rint(transform[0]*x + transform[1]*y);
- vr->yoff = rint(transform[2]*x + transform[3]*y);
- x = vr->h_adv_off; y=vr->v_adv_off;
- vr->h_adv_off = rint(transform[0]*x + transform[1]*y);
- vr->v_adv_off = rint(transform[2]*x + transform[3]*y);
-}
-
-static void KCTrans(KernClass *kc,double scale) {
- /* Again these are offsets, so I don't apply translation */
- int i;
-
- for ( i=kc->first_cnt*kc->second_cnt-1; i>=0; --i )
- kc->offsets[i] = rint(scale*kc->offsets[i]);
-}
-
-/* If sel is specified then we decide how to transform references based on */
-/* whether the refered glyph is selected. (If we tranform a reference that */
-/* is selected we are, in effect, transforming it twice -- since the glyph */
-/* itself will be transformed -- so instead we just transform the offsets */
-/* of the reference */
-/* If sel is NULL then we transform the reference */
-/* if flags&fvt_partialreftrans then we always just transform the offsets */
-void FVTrans(FontView *fv,SplineChar *sc,real transform[6], uint8 *sel,
- enum fvtrans_flags flags) {
- RefChar *refs;
- real t[6];
- AnchorPoint *ap;
- int i,j;
- KernPair *kp;
- PST *pst;
-
- if ( sc->blended ) {
- int j;
- MMSet *mm = sc->parent->mm;
- for ( j=0; j<mm->instance_count; ++j )
- FVTrans(fv,mm->instances[j]->glyphs[sc->orig_pos],transform,sel,flags);
- }
-
- SCPreserveState(sc,true);
- if ( !(flags&fvt_dontmovewidth) )
- if ( transform[0]>0 && transform[3]>0 && transform[1]==0 && transform[2]==0 ) {
- int widthset = sc->widthset;
- SCSynchronizeWidth(sc,sc->width*transform[0]+transform[4],sc->width,fv);
- if ( !(flags&fvt_dontsetwidth) ) sc->widthset = widthset;
- sc->vwidth = sc->vwidth*transform[3]+transform[5];
- }
- if ( flags & fvt_scalepstpos ) {
- for ( kp=sc->kerns; kp!=NULL; kp=kp->next )
- kp->off = rint(kp->off*transform[0]);
- for ( kp=sc->vkerns; kp!=NULL; kp=kp->next )
- kp->off = rint(kp->off*transform[3]);
- for ( pst = sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_position )
- VrTrans(&pst->u.pos,transform);
- else if ( pst->type==pst_pair ) {
- VrTrans(&pst->u.pair.vr[0],transform);
- VrTrans(&pst->u.pair.vr[1],transform);
- } else if ( pst->type == pst_lcaret ) {
- int j;
- for ( j=0; j<pst->u.lcaret.cnt; ++j )
- pst->u.lcaret.carets[j] = rint(pst->u.lcaret.carets[j]*transform[0]+transform[4]);
- }
- }
- }
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next )
- ApTransform(ap,transform);
- for ( i=ly_fore; i<sc->layer_cnt; ++i ) {
- SplinePointListTransform(sc->layers[i].splines,transform,true);
- for ( refs = sc->layers[i].refs; refs!=NULL; refs=refs->next ) {
- if ( (sel!=NULL && sel[fv->map->backmap[refs->sc->orig_pos]]) ||
- (flags&fvt_partialreftrans)) {
- /* if the character referred to is selected then it's going to */
- /* be scaled too (or will have been) so we don't want to scale */
- /* it twice */
- t[4] = refs->transform[4]*transform[0] +
- refs->transform[5]*transform[2] +
- /*transform[4]*/0;
- t[5] = refs->transform[4]*transform[1] +
- refs->transform[5]*transform[3] +
- /*transform[5]*/0;
- t[0] = refs->transform[4]; t[1] = refs->transform[5];
- refs->transform[4] = t[4];
- refs->transform[5] = t[5];
- /* Now update the splines to match */
- t[4] -= t[0]; t[5] -= t[1];
- if ( t[4]!=0 || t[5]!=0 ) {
- t[0] = t[3] = 1; t[1] = t[2] = 0;
- for ( j=0; j<refs->layer_cnt; ++j )
- SplinePointListTransform(refs->layers[j].splines,t,true);
- }
- } else {
- for ( j=0; j<refs->layer_cnt; ++j )
- SplinePointListTransform(refs->layers[j].splines,transform,true);
- t[0] = refs->transform[0]*transform[0] +
- refs->transform[1]*transform[2];
- t[1] = refs->transform[0]*transform[1] +
- refs->transform[1]*transform[3];
- t[2] = refs->transform[2]*transform[0] +
- refs->transform[3]*transform[2];
- t[3] = refs->transform[2]*transform[1] +
- refs->transform[3]*transform[3];
- t[4] = refs->transform[4]*transform[0] +
- refs->transform[5]*transform[2] +
- transform[4];
- t[5] = refs->transform[4]*transform[1] +
- refs->transform[5]*transform[3] +
- transform[5];
- memcpy(refs->transform,t,sizeof(t));
- }
- RefCharFindBounds(refs);
- }
- }
- if ( transform[1]==0 && transform[2]==0 ) {
- if ( transform[0]==1 && transform[3]==1 &&
- transform[5]==0 && transform[4]!=0 &&
- sc->unicodeenc!=-1 && sc->unicodeenc<0x10000 &&
- Isalpha(sc->unicodeenc)) {
- SCUndoSetLBearingChange(sc,(int) rint(transform[4]));
- SCSynchronizeLBearing(sc,transform[4]); /* this moves the hints */
- } else {
- TransHints(sc->hstem,transform[3],transform[5],transform[0],transform[4],flags&fvt_round_to_int);
- TransHints(sc->vstem,transform[0],transform[4],transform[3],transform[5],flags&fvt_round_to_int);
- }
- }
- if ( flags&fvt_round_to_int )
- SCRound2Int(sc,1.0);
- if ( flags&fvt_dobackground ) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- ImageList *img;
-#endif
- SCPreserveBackground(sc);
- SplinePointListTransform(sc->layers[ly_back].splines,transform,true);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- for ( img = sc->layers[ly_back].images; img!=NULL; img=img->next )
- BackgroundImageTransform(sc, img, transform);
-#endif
- }
- SCCharChangedUpdate(sc);
-}
-
-void FVTransFunc(void *_fv,real transform[6],int otype, BVTFunc *bvts,
- enum fvtrans_flags flags ) {
- FontView *fv = _fv;
- real transx = transform[4], transy=transform[5];
- DBounds bb;
- BasePoint base;
- int i, cnt=0, gid;
- BDFFont *bdf;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-
-#if 0 /* Do this in scaletoem */
- if ( cnt>fv->sf->glyphcnt/2 ) {
- if ( transform[3]!=1.0 ) {
- if ( transform[2]==0 ) {
- fv->sf->pfminfo.os2_typoascent = rint( fv->sf->pfminfo.os2_typoascent * transform[3]);
- fv->sf->pfminfo.os2_typodescent = rint( fv->sf->pfminfo.os2_typodescent * transform[3]);
- fv->sf->pfminfo.os2_typolinegap = rint( fv->sf->pfminfo.os2_typolinegap * transform[3]);
- fv->sf->pfminfo.os2_winascent = rint( fv->sf->pfminfo.os2_winascent * transform[3]);
- fv->sf->pfminfo.os2_windescent = rint( fv->sf->pfminfo.os2_windescent * transform[3]);
- fv->sf->pfminfo.hhead_ascent = rint( fv->sf->pfminfo.hhead_ascent * transform[3]);
- fv->sf->pfminfo.hhead_descent = rint( fv->sf->pfminfo.hhead_descent * transform[3]);
- fv->sf->pfminfo.linegap = rint( fv->sf->pfminfo.linegap * transform[3]);
- fv->sf->pfminfo.os2_subysize = rint( fv->sf->pfminfo.os2_subysize * transform[3]);
- fv->sf->pfminfo.os2_subyoff = rint( fv->sf->pfminfo.os2_subyoff * transform[3]);
- fv->sf->pfminfo.os2_supysize = rint( fv->sf->pfminfo.os2_supysize * transform[3]);
- fv->sf->pfminfo.os2_supyoff = rint( fv->sf->pfminfo.os2_supyoff * transform[3]);
- fv->sf->pfminfo.os2_strikeysize = rint( fv->sf->pfminfo.os2_strikeysize * transform[3]);
- fv->sf->pfminfo.os2_strikeypos = rint( fv->sf->pfminfo.os2_strikeypos * transform[3]);
- fv->sf->pfminfo.upos *= transform[3];
- fv->sf->pfminfo.uwidth *= transform[3];
- }
- }
- if ( transform[1]==0 && transform[0]!=1.0 ) {
- fv->sf->pfminfo.vlinegap = rint( fv->sf->pfminfo.vlinegap * transform[0]);
- fv->sf->pfminfo.os2_subxsize = rint( fv->sf->pfminfo.os2_subxsize * transform[0]);
- fv->sf->pfminfo.os2_subxoff = rint( fv->sf->pfminfo.os2_subxoff * transform[0]);
- fv->sf->pfminfo.os2_supxsize = rint( fv->sf->pfminfo.os2_supxsize * transform[0]);
- fv->sf->pfminfo.os2_supxoff = rint( fv->sf->pfminfo.os2_supxoff * transform[0]);
- }
- }
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Transforming..."),_("Transforming..."),0,cnt,1);
-# endif
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) &&
- !fv->sf->glyphs[gid]->ticked ) {
- SplineChar *sc = fv->sf->glyphs[gid];
-
- if ( onlycopydisplayed && fv->show!=fv->filled ) {
- if ( fv->show->glyphs[gid]!=NULL )
- BCTrans(fv->show,fv->show->glyphs[gid],bvts,fv);
- } else {
- if ( otype==1 ) {
- SplineCharFindBounds(sc,&bb);
- base.x = (bb.minx+bb.maxx)/2;
- base.y = (bb.miny+bb.maxy)/2;
- transform[4]=transx+base.x-
- (transform[0]*base.x+transform[2]*base.y);
- transform[5]=transy+base.y-
- (transform[1]*base.x+transform[3]*base.y);
- }
- FVTrans(fv,sc,transform,fv->selected,flags);
- if ( !onlycopydisplayed ) {
- for ( bdf = fv->sf->bitmaps; bdf!=NULL; bdf=bdf->next )
- if ( gid<bdf->glyphcnt && bdf->glyphs[gid]!=NULL )
- BCTrans(bdf,bdf->glyphs[gid],bvts,fv);
- }
- }
- sc->ticked = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
- if ( flags&fvt_dogrid ) {
- SFPreserveGuide(fv->sf);
- SplinePointListTransform(fv->sf->grid.splines,transform,true);
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-
- if ( flags&fvt_scalekernclasses ) {
- KernClass *kc;
- SplineFont *sf = fv->cidmaster!=NULL ? fv->cidmaster : fv->sf;
- for ( kc=sf->kerns; kc!=NULL; kc=kc->next )
- KCTrans(kc,transform[0]);
- for ( kc=sf->vkerns; kc!=NULL; kc=kc->next )
- KCTrans(kc,transform[3]);
- }
-}
-
-static char *scaleString(char *string, double scale) {
- char *result;
- char *pt;
- char *end;
- double val;
-
- if ( string==NULL )
-return( NULL );
-
- while ( *string==' ' ) ++string;
- result = galloc(10*strlen(string)+1);
- if ( *string!='[' ) {
- val = strtod(string,&end);
- if ( end==string ) {
- free( result );
-return( NULL );
- }
- sprintf( result, "%g", val*scale);
-return( result );
- }
-
- pt = result;
- *pt++ = '[';
- ++string;
- while ( *string!='\0' && *string!=']' ) {
- val = strtod(string,&end);
- if ( end==string ) {
- free(result);
-return( NULL );
- }
- sprintf( pt, "%g ", val*scale);
- pt += strlen(pt);
- string = end;
- }
- if ( pt[-1] == ' ' ) pt[-1] = ']';
- else *pt++ = ']';
- *pt = '\0';
-return( result );
-}
-
-static char *iscaleString(char *string, double scale) {
- char *result;
- char *pt;
- char *end;
- double val;
-
- if ( string==NULL )
-return( NULL );
-
- while ( *string==' ' ) ++string;
- result = galloc(10*strlen(string)+1);
- if ( *string!='[' ) {
- val = strtod(string,&end);
- if ( end==string ) {
- free( result );
-return( NULL );
- }
- sprintf( result, "%g", rint(val*scale));
-return( result );
- }
-
- pt = result;
- *pt++ = '[';
- ++string;
- while ( *string!='\0' && *string!=']' ) {
- val = strtod(string,&end);
- if ( end==string ) {
- free(result);
-return( NULL );
- }
- sprintf( pt, "%g ", rint(val*scale));
- pt += strlen(pt);
- string = end;
- }
- if ( pt[-1] == ' ' ) pt[-1] = ']';
- else *pt++ = ']';
- *pt = '\0';
-return( result );
-}
-
-static void SFScalePrivate(SplineFont *sf,double scale) {
- static char *scalethese[] = {
- NULL
- };
- static char *integerscalethese[] = {
- "BlueValues", "OtherBlues",
- "FamilyBlues", "FamilyOtherBlues",
- "BlueShift", "BlueFuzz",
- "StdHW", "StdVW", "StemSnapH", "StemSnapV",
- NULL
- };
- int i;
-
- for ( i=0; integerscalethese[i]!=NULL; ++i ) {
- char *str = PSDictHasEntry(sf->private,integerscalethese[i]);
- char *new = iscaleString(str,scale);
- if ( new!=NULL )
- PSDictChangeEntry(sf->private,integerscalethese[i],new);
- free(new);
- }
- for ( i=0; scalethese[i]!=NULL; ++i ) {
- char *str = PSDictHasEntry(sf->private,scalethese[i]);
- char *new = scaleString(str,scale);
- if ( new!=NULL )
- PSDictChangeEntry(sf->private,scalethese[i],new);
- free(new);
- }
-}
-
-int SFScaleToEm(SplineFont *sf, int as, int des) {
- double scale;
- real transform[6];
- BVTFunc bvts;
- uint8 *oldselected = sf->fv->selected;
-
- scale = (as+des)/(double) (sf->ascent+sf->descent);
- sf->pfminfo.hhead_ascent = rint( sf->pfminfo.hhead_ascent * scale);
- sf->pfminfo.hhead_descent = rint( sf->pfminfo.hhead_descent * scale);
- sf->pfminfo.linegap = rint( sf->pfminfo.linegap * scale);
- sf->pfminfo.vlinegap = rint( sf->pfminfo.vlinegap * scale);
- sf->pfminfo.os2_winascent = rint( sf->pfminfo.os2_winascent * scale);
- sf->pfminfo.os2_windescent = rint( sf->pfminfo.os2_windescent * scale);
- sf->pfminfo.os2_typoascent = rint( sf->pfminfo.os2_typoascent * scale);
- sf->pfminfo.os2_typodescent = rint( sf->pfminfo.os2_typodescent * scale);
- sf->pfminfo.os2_typolinegap = rint( sf->pfminfo.os2_typolinegap * scale);
-
- sf->pfminfo.os2_subxsize = rint( sf->pfminfo.os2_subxsize * scale);
- sf->pfminfo.os2_subysize = rint( sf->pfminfo.os2_subysize * scale);
- sf->pfminfo.os2_subxoff = rint( sf->pfminfo.os2_subxoff * scale);
- sf->pfminfo.os2_subyoff = rint( sf->pfminfo.os2_subyoff * scale);
- sf->pfminfo.os2_supxsize = rint( sf->pfminfo.os2_supxsize * scale);
- sf->pfminfo.os2_supysize = rint(sf->pfminfo.os2_supysize * scale);
- sf->pfminfo.os2_supxoff = rint( sf->pfminfo.os2_supxoff * scale);
- sf->pfminfo.os2_supyoff = rint( sf->pfminfo.os2_supyoff * scale);
- sf->pfminfo.os2_strikeysize = rint( sf->pfminfo.os2_strikeysize * scale);
- sf->pfminfo.os2_strikeypos = rint( sf->pfminfo.os2_strikeypos * scale);
- sf->upos *= scale;
- sf->uwidth *= scale;
-
- if ( sf->private!=NULL )
- SFScalePrivate(sf,scale);
-
- if ( as+des == sf->ascent+sf->descent ) {
- if ( as!=sf->ascent && des!=sf->descent ) {
- sf->ascent = as; sf->descent = des;
- sf->changed = true;
- }
-return( false );
- }
-
- transform[0] = transform[3] = scale;
- transform[1] = transform[2] = transform[4] = transform[5] = 0;
- bvts.func = bvt_none;
- sf->fv->selected = galloc(sf->fv->map->enccount);
- memset(sf->fv->selected,1,sf->fv->map->enccount);
-
- sf->ascent = as; sf->descent = des;
-
- FVTransFunc(sf->fv,transform,0,&bvts,
- fvt_dobackground|fvt_round_to_int|fvt_dontsetwidth|fvt_scalekernclasses|fvt_scalepstpos);
- free(sf->fv->selected);
- sf->fv->selected = oldselected;
-
- if ( !sf->changed ) {
- sf->changed = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVSetTitle(sf->fv);
-#endif
- }
-
-return( true );
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void FVDoTransform(FontView *fv) {
- int flags=0x3;
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- if ( FVAllSelected(fv))
- flags = 0x7;
- TransformDlgCreate(fv,FVTransFunc,getorigin,flags,cvt_none);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuTransform(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Transform(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVDoTransform(fv);
-}
-
-#if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuPOV(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- struct pov_data pov_data;
- if ( FVAnyCharSelected(fv)==-1 || fv->sf->onlybitmaps )
-return;
- if ( PointOfViewDlg(&pov_data,fv->sf,false)==-1 )
-return;
- FVPointOfView(fv,&pov_data);
-}
-
-static void FVMenuNLTransform(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- NonLinearDlg(fv,NULL);
-}
-#elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_PointOfView(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- struct pov_data pov_data;
- if ( FVAnyCharSelected(fv)==-1 || fv->sf->onlybitmaps )
-return;
- if ( PointOfViewDlg(&pov_data,fv->sf,false)==-1 )
-return;
- FVPointOfView(fv,&pov_data);
-}
-
-void FontViewMenu_NonLinearTransform(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- if ( FVAnyCharSelected(fv)==-1 || fv->sf->onlybitmaps )
-return;
- NonLinearDlg(fv,NULL);
-}
-#endif
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuBitmaps(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- BitmapDlg(fv,NULL,mi->mid==MID_RemoveBitmaps?-1:(mi->mid==MID_AvailBitmaps) );
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_BitmapsAvail(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- BitmapDlg(fv,NULL,true );
-}
-
-void FontViewMenu_RegenBitmaps(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- BitmapDlg(fv,NULL,false );
-}
-
-void FontViewMenu_RemoveBitmaps(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- BitmapDlg(fv,NULL,-1 );
-}
-# endif
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuStroke(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ExpandStroke(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVStroke(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-# ifdef FONTFORGE_CONFIG_TILEPATH
-static void FVMenuTilePath(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- FVTile(fv);
-}
-# endif
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_TilePath(GtkMenuItem *menuitem, gpointer user_data) {
-# ifdef FONTFORGE_CONFIG_TILEPATH
- FontView *fv = FV_From_MI(menuitem);
- FVTile(fv);
-# endif
-}
-# endif
-#endif
-
-static void FVOverlap(FontView *fv,enum overlap_type ot) {
- int i, cnt=0, layer, gid;
- SplineChar *sc;
-
- /* We know it's more likely that we'll find a problem in the overlap code */
- /* than anywhere else, so let's save the current state against a crash */
- DoAutoSaves();
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Removing overlaps..."),_("Removing overlaps..."),0,cnt,1);
-# endif
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting((sc=fv->sf->glyphs[gid])) &&
- !sc->ticked ) {
- sc->ticked = true;
- if ( !SCRoundToCluster(sc,-2,false,.03,.12))
- SCPreserveState(sc,false);
- MinimumDistancesFree(sc->md);
- sc->md = NULL;
- for ( layer = ly_fore; layer<sc->layer_cnt; ++layer )
- sc->layers[layer].splines = SplineSetRemoveOverlap(sc,sc->layers[layer].splines,ot);
- SCCharChangedUpdate(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuOverlap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- if ( fv->sf->order2 || fv->sf->onlybitmaps )
-return;
-
- /* We know it's more likely that we'll find a problem in the overlap code */
- /* than anywhere else, so let's save the current state against a crash */
- DoAutoSaves();
-
- FVOverlap(fv,mi->mid==MID_RmOverlap ? over_remove :
- mi->mid==MID_Intersection ? over_intersect :
- over_findinter);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RemoveOverlap(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-
- /* We know it's more likely that we'll find a problem in the overlap code */
- /* than anywhere else, so let's save the current state against a crash */
- DoAutoSaves();
-
- FVOverlap(fv,over_remove);
-}
-
-void FontViewMenu_Intersect(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- DoAutoSaves();
- FVOverlap(fv,over_intersect);
-}
-
-void FontViewMenu_FindInter(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- DoAutoSaves();
- FVOverlap(fv,over_findinter);
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuInline(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Inline(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- OutlineDlg(fv,NULL,NULL,true);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuOutline(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Outline(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- OutlineDlg(fv,NULL,NULL,false);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuShadow(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Shadow(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- ShadowDlg(fv,NULL,NULL,false);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuWireframe(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Wireframe(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- ShadowDlg(fv,NULL,NULL,true);
-}
-#endif
-
-void _FVSimplify(FontView *fv,struct simplifyinfo *smpl) {
- int i, cnt=0, layer, gid;
- SplineChar *sc;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Simplifying..."),_("Simplifying..."),0,cnt,1);
-# endif
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i )
- if ( (gid=fv->map->map[i])!=-1 && SCWorthOutputting((sc=fv->sf->glyphs[gid])) &&
- fv->selected[i] && !sc->ticked ) {
- sc->ticked = true;
- SCPreserveState(sc,false);
- for ( layer = ly_fore; layer<sc->layer_cnt; ++layer )
- sc->layers[layer].splines = SplineCharSimplify(sc,sc->layers[layer].splines,smpl);
- SCCharChangedUpdate(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void FVSimplify(FontView *fv,int type) {
- static struct simplifyinfo smpls[] = {
- { sf_normal },
- { sf_normal,.75,.05,0,-1 },
- { sf_normal,.75,.05,0,-1 }};
- struct simplifyinfo *smpl = &smpls[type+1];
-
- if ( smpl->linelenmax==-1 || (type==0 && !smpl->set_as_default)) {
- smpl->err = (fv->sf->ascent+fv->sf->descent)/1000.;
- smpl->linelenmax = (fv->sf->ascent+fv->sf->descent)/100.;
- }
-
- if ( type==1 ) {
- if ( !SimplifyDlg(fv->sf,smpl))
-return;
- if ( smpl->set_as_default )
- smpls[1] = *smpl;
- }
- _FVSimplify(fv,smpl);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuSimplify(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVSimplify( (FontView *) GDrawGetUserData(gw),false );
-}
-
-static void FVMenuSimplifyMore(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVSimplify( (FontView *) GDrawGetUserData(gw),true );
-}
-
-static void FVMenuCleanup(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVSimplify( (FontView *) GDrawGetUserData(gw),-1 );
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Simplify(GtkMenuItem *menuitem, gpointer user_data) {
- FVSimplify( (FontView *) FV_From_MI(menuitem), false);
-}
-
-void FontViewMenu_SimplifyMore(GtkMenuItem *menuitem, gpointer user_data) {
- FVSimplify( (FontView *) FV_From_MI(menuitem), true);
-}
-
-void FontViewMenu_Cleanup(GtkMenuItem *menuitem, gpointer user_data) {
- FVSimplify( (FontView *) FV_From_MI(menuitem), -1);
-}
-#endif
-
-static void FVCanonicalStart(FontView *fv) {
- int i, gid;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 )
- SPLsStartToLeftmost(fv->sf->glyphs[gid]);
-}
-
-static void FVCanonicalContours(FontView *fv) {
- int i, gid;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 )
- CanonicalContours(fv->sf->glyphs[gid]);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuCanonicalStart(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVCanonicalStart( (FontView *) GDrawGetUserData(gw) );
-}
-
-static void FVMenuCanonicalContours(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVCanonicalContours( (FontView *) GDrawGetUserData(gw) );
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CanonicalStart(GtkMenuItem *menuitem, gpointer user_data) {
- FVCanonicalStart( (FontView *) FV_From_MI(menuitem));
-}
-
-void FontViewMenu_CanonicalContours(GtkMenuItem *menuitem, gpointer user_data) {
- FVCanonicalContours( (FontView *) FV_From_MI(menuitem));
-}
-#endif
-#endif
-
-static void FVAddExtrema(FontView *fv) {
- int i, cnt=0, layer, gid;
- SplineChar *sc;
- SplineFont *sf = fv->sf;
- int emsize = sf->ascent+sf->descent;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Adding points at Extrema..."),_("Adding points at Extrema..."),0,cnt,1);
-# endif
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting((sc = fv->sf->glyphs[gid])) &&
- !sc->ticked) {
- sc->ticked = true;
- SCPreserveState(sc,false);
- for ( layer = ly_fore; layer<sc->layer_cnt; ++layer )
- SplineCharAddExtrema(sc,sc->layers[layer].splines,ae_only_good,emsize);
- SCCharChangedUpdate(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuAddExtrema(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVAddExtrema( (FontView *) GDrawGetUserData(gw) );
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AddExtrema(GtkMenuItem *menuitem, gpointer user_data) {
- FVAddExtrema( (FontView *) FV_From_MI(menuitem) );
-# endif
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuCorrectDir(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CorrectDir(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i, cnt=0, changed, refchanged, preserved, layer, gid;
- int askedall=-1, asked;
- RefChar *ref, *next;
- SplineChar *sc;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Correcting Direction..."),_("Correcting Direction..."),0,cnt,1);
-# endif
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting((sc=fv->sf->glyphs[gid])) &&
- !sc->ticked ) {
- sc->ticked = true;
- changed = refchanged = preserved = false;
- asked = askedall;
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- for ( ref=sc->layers[layer].refs; ref!=NULL; ref=next ) {
- next = ref->next;
- if ( ref->transform[0]*ref->transform[3]<0 ||
- (ref->transform[0]==0 && ref->transform[1]*ref->transform[2]>0)) {
- if ( asked==-1 ) {
- char *buts[5];
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[2] = _("_Cancel");
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[2] = GTK_STOCK_CANCEL;
-#endif
- buts[0] = _("Unlink All");
- buts[1] = _("Unlink");
- buts[3] = NULL;
- asked = gwwv_ask(_("Flipped Reference"),(const char **) buts,0,2,_("%.50s contains a flipped reference. This cannot be corrected as is. Would you like me to unlink it and then correct it?"), sc->name );
- if ( asked==3 )
-return;
- else if ( asked==2 )
- break;
- else if ( asked==0 )
- askedall = 0;
- }
- if ( asked==0 || asked==1 ) {
- if ( !preserved ) {
- preserved = refchanged = true;
- SCPreserveState(sc,false);
- }
- SCRefToSplines(sc,ref);
- }
- }
- }
-
- if ( !preserved && sc->layers[layer].splines!=NULL ) {
- SCPreserveState(sc,false);
- preserved = true;
- }
- sc->layers[layer].splines = SplineSetsCorrect(sc->layers[layer].splines,&changed);
- }
- if ( changed || refchanged )
- SCCharChangedUpdate(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-#endif
-
-static void FVRound2Int(FontView *fv,real factor) {
- int i, cnt=0, gid;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Rounding to integer..."),_("Rounding to integer..."),0,cnt,1);
-# endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SplineChar *sc = fv->sf->glyphs[gid];
-
- SCPreserveState(sc,false);
- SCRound2Int( sc,factor);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuRound2Int(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVRound2Int( (FontView *) GDrawGetUserData(gw), 1.0 );
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RoundToInt(GtkMenuItem *menuitem, gpointer user_data) {
- FVRound2Int( (FontView *) FV_From_MI(menuitem), 1.0);
-# endif
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuRound2Hundredths(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVRound2Int( (FontView *) GDrawGetUserData(gw),100.0 );
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RoundToHundredths(GtkMenuItem *menuitem, gpointer user_data) {
- FVRound2Int( (FontView *) FV_From_MI(menuitem),100.0);
-# endif
-}
-
-static void FVCluster(FontView *fv) {
- int i, cnt=0, gid;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Rounding to integer..."),_("Rounding to integer..."),0,cnt,1);
-# endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SCRoundToCluster(fv->sf->glyphs[gid],-2,false,.1,.5);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuCluster(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVCluster( (FontView *) GDrawGetUserData(gw));
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Cluster(GtkMenuItem *menuitem, gpointer user_data) {
- FVCluster( (FontView *) FV_From_MI(menuitem));
-# endif
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuAutotrace(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Autotrace(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVAutoTrace(fv,e!=NULL && (e->u.mouse.state&ksm_shift));
-}
-#endif
-
-#ifndef LUA_FF_LIB
-void FVBuildAccent(FontView *fv,int onlyaccents) {
- int i, cnt=0, gid;
- SplineChar dummy;
- SplineChar *sc;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Building accented glyphs"),
- _("Building accented glyphs"),NULL,cnt,1);
-# endif
-
- SFUntickAll(fv->sf);
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] ) {
- gid = fv->map->map[i];
- sc = NULL;
- if ( gid!=-1 ) {
- sc = fv->sf->glyphs[gid];
- if ( sc!=NULL && sc->ticked )
- continue;
- }
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,i);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- else if ( !no_windowing_ui && sc->unicodeenc == 0x00c5 /* Aring */ &&
- sc->layers[ly_fore].splines!=NULL ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes");
- buts[1] = _("_No");
- buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_NO, NULL };
-#endif
- if ( gwwv_ask(U_("Replace Ã…"),(const char **) buts,0,1,U_("Are you sure you want to replace Ã…?\nThe ring will not join to the A."))==1 )
- continue;
- }
-#endif
- if ( SFIsSomethingBuildable(fv->sf,sc,onlyaccents) ) {
- sc = SFMakeChar(fv->sf,fv->map,i);
- sc->ticked = true;
- SCBuildComposit(fv->sf,sc,!onlycopydisplayed,fv);
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuBuildAccent(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVBuildAccent( (FontView *) GDrawGetUserData(gw), true );
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_BuildAccent(GtkMenuItem *menuitem, gpointer user_data) {
- FVBuildAccent( (FontView *) FV_From_MI(menuitem), true );
-# endif
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuBuildComposite(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVBuildAccent( (FontView *) GDrawGetUserData(gw), false );
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_BuildComposite(GtkMenuItem *menuitem, gpointer user_data) {
- FVBuildAccent( (FontView *) FV_From_MI(menuitem), false );
-# endif
-}
-#endif
-
-static int SFIsDuplicatable(SplineFont *sf, SplineChar *sc) {
- extern const int cns14pua[], amspua[];
- const int *pua = sf->uni_interp==ui_trad_chinese ? cns14pua : sf->uni_interp==ui_ams ? amspua : NULL;
- int baseuni = 0;
- const unichar_t *pt;
-
- if ( pua!=NULL && sc->unicodeenc>=0xe000 && sc->unicodeenc<=0xf8ff )
- baseuni = pua[sc->unicodeenc-0xe000];
- if ( baseuni==0 && ( pt = SFGetAlternate(sf,sc->unicodeenc,sc,false))!=NULL &&
- pt[0]!='\0' && pt[1]=='\0' )
- baseuni = pt[0];
- if ( baseuni!=0 && SFGetChar(sf,baseuni,NULL)!=NULL )
-return( true );
-
-return( false );
-}
-
-void FVBuildDuplicate(FontView *fv) {
- extern const int cns14pua[], amspua[];
- const int *pua = fv->sf->uni_interp==ui_trad_chinese ? cns14pua : fv->sf->uni_interp==ui_ams ? amspua : NULL;
- int i, cnt=0, gid;
- SplineChar dummy;
- const unichar_t *pt;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Building duplicate encodings"),
- _("Building duplicate encodings"),NULL,cnt,1);
-# endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] ) {
- SplineChar *sc;
- int baseuni = 0;
- if ( (gid = fv->map->map[i])==-1 || (sc = fv->sf->glyphs[gid])==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,i);
- if ( pua!=NULL && sc->unicodeenc>=0xe000 && sc->unicodeenc<=0xf8ff )
- baseuni = pua[sc->unicodeenc-0xe000];
- if ( baseuni==0 && ( pt = SFGetAlternate(fv->sf,sc->unicodeenc,sc,false))!=NULL &&
- pt[0]!='\0' && pt[1]=='\0' )
- baseuni = pt[0];
-
- if ( baseuni!=0 && (gid = SFFindExistingSlot(fv->sf,baseuni,NULL))!=-1 )
- LinkEncToGid(fv,i,gid);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuBuildDuplicate(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FVBuildDuplicate( (FontView *) GDrawGetUserData(gw));
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_BuildDuplicatem(GtkMenuItem *menuitem, gpointer user_data) {
- FVBuildDuplicate( (FontView *) FV_From_MI(menuitem));
-# endif
-}
-#endif
-#endif /* LUA_FF_LIB */
-
-#ifdef KOREAN
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuShowGroup(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- ShowGroup( ((FontView *) GDrawGetUserData(gw))->sf );
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ShowGroup(GtkMenuItem *menuitem, gpointer user_data) {
- ShowGroup( ((FontView *) FV_From_MI(menuitem))->sf );
-# endif
-}
-#endif
-#endif
-
-#if HANYANG
-static void FVMenuModifyComposition(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- if ( fv->sf->rules!=NULL )
- SFModifyComposition(fv->sf);
-}
-
-static void FVMenuBuildSyllables(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- if ( fv->sf->rules!=NULL )
- SFBuildSyllables(fv->sf);
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuCompareFonts(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CompareFonts(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FontCompareDlg(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuMergeFonts(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_MergeFonts(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVMergeFonts(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuInterpFonts(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Interpolate(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVInterpolateFonts(fv);
-}
-
-static void FVShowInfo(FontView *fv);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-void FVChangeChar(FontView *fv,int i) {
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( i!=-1 ) {
- FVDeselectAll(fv);
- fv->selected[i] = true;
- fv->sel_index = 1;
- fv->end_pos = fv->pressed_pos = i;
- FVToggleCharSelected(fv,i);
- FVScrollToChar(fv,i);
- FVShowInfo(fv);
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-void FVScrollToChar(FontView *fv,int i) {
-
- if ( fv->v==NULL || fv->colcnt==0 ) /* Can happen in scripts */
-return;
-
- if ( i!=-1 ) {
- if ( i/fv->colcnt<fv->rowoff || i/fv->colcnt >= fv->rowoff+fv->rowcnt ) {
- fv->rowoff = i/fv->colcnt;
- if ( fv->rowcnt>= 3 )
- --fv->rowoff;
- if ( fv->rowoff+fv->rowcnt>=fv->rowltot )
- fv->rowoff = fv->rowltot-fv->rowcnt;
- if ( fv->rowoff<0 ) fv->rowoff = 0;
- GScrollBarSetPos(fv->vsb,fv->rowoff);
- GDrawRequestExpose(fv->v,NULL,false);
- }
- }
-}
-
-static void _FVMenuChangeChar(FontView *fv,int mid ) {
- SplineFont *sf = fv->sf;
- EncMap *map = fv->map;
- int pos = FVAnyCharSelected(fv);
-
- if ( pos>=0 ) {
- if ( mid==MID_Next )
- ++pos;
- else if ( mid==MID_Prev )
- --pos;
- else if ( mid==MID_NextDef ) {
- for ( ++pos; pos<map->enccount &&
- (map->map[pos]==-1 || !SCWorthOutputting(sf->glyphs[map->map[pos]]) ||
- (fv->show!=fv->filled && fv->show->glyphs[map->map[pos]]==NULL ));
- ++pos );
- if ( pos>=map->enccount ) {
- int selpos = FVAnyCharSelected(fv);
- char *iconv_name = map->enc->iconv_name ? map->enc->iconv_name :
- map->enc->enc_name;
- if ( strstr(iconv_name,"2022")!=NULL && selpos<0x2121 )
- pos = 0x2121;
- else if ( strstr(iconv_name,"EUC")!=NULL && selpos<0xa1a1 )
- pos = 0xa1a1;
- else if ( map->enc->is_tradchinese ) {
- if ( strstrmatch(map->enc->enc_name,"HK")!=NULL &&
- selpos<0x8140 )
- pos = 0x8140;
- else
- pos = 0xa140;
- } else if ( map->enc->is_japanese ) {
- if ( strstrmatch(iconv_name,"SJIS")!=NULL ||
- (strstrmatch(iconv_name,"JIS")!=NULL && strstrmatch(iconv_name,"SHIFT")!=NULL )) {
- if ( selpos<0x8100 )
- pos = 0x8100;
- else if ( selpos<0xb000 )
- pos = 0xb000;
- }
- } else if ( map->enc->is_korean ) {
- if ( strstrmatch(iconv_name,"JOHAB")!=NULL ) {
- if ( selpos<0x8431 )
- pos = 0x8431;
- } else { /* Wansung, EUC-KR */
- if ( selpos<0xa1a1 )
- pos = 0xa1a1;
- }
- } else if ( map->enc->is_simplechinese ) {
- if ( strmatch(iconv_name,"EUC-CN")==0 && selpos<0xa1a1 )
- pos = 0xa1a1;
- }
- if ( pos>=map->enccount )
-return;
- }
- } else if ( mid==MID_PrevDef ) {
- for ( --pos; pos>=0 &&
- (map->map[pos]==-1 || !SCWorthOutputting(sf->glyphs[map->map[pos]]) ||
- (fv->show!=fv->filled && fv->show->glyphs[map->map[pos]]==NULL ));
- --pos );
- if ( pos<0 )
-return;
- }
- }
- if ( pos<0 ) pos = map->enccount-1;
- else if ( pos>= map->enccount ) pos = 0;
- if ( pos>=0 && pos<map->enccount )
- FVChangeChar(fv,pos);
-}
-
-static void FVMenuChangeChar(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- _FVMenuChangeChar(fv,mi->mid);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuGotoChar(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Goto(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int pos = GotoChar(fv->sf,fv->map);
- FVChangeChar(fv,pos);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuLigatures(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Ligatures(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SFShowLigatures(fv->sf,NULL);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuKernPairs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_KernPairs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SFKernClassTempDecompose(fv->sf,false);
- SFShowKernPairs(fv->sf,NULL,NULL);
- SFKernCleanup(fv->sf,false);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuAnchorPairs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AnchorPairs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SFShowKernPairs(fv->sf,NULL,mi->ti.userdata);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuShowAtt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ShowAtt(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- ShowAtt(fv->sf);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuDisplaySubs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_DisplaySubstitutions(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- if ( fv->cur_subtable!=0 ) {
- fv->cur_subtable = NULL;
- } else {
- SplineFont *sf = fv->sf;
- OTLookup *otf;
- struct lookup_subtable *sub;
- int cnt, k;
- char **names = NULL;
- if ( sf->cidmaster ) sf=sf->cidmaster;
- for ( k=0; k<2; ++k ) {
- cnt = 0;
- for ( otf = sf->gsub_lookups; otf!=NULL; otf=otf->next ) {
- if ( otf->lookup_type==gsub_single ) {
- for ( sub=otf->subtables; sub!=NULL; sub=sub->next ) {
- if ( names )
- names[cnt] = sub->subtable_name;
- ++cnt;
- }
- }
- }
- if ( cnt==0 )
- break;
- if ( names==NULL )
- names = galloc((cnt+3) * sizeof(char *));
- else {
- names[cnt++] = "-";
- names[cnt++] = _("New Lookup Subtable...");
- names[cnt] = NULL;
- }
- }
- sub = NULL;
- if ( names!=NULL ) {
- int ret = gwwv_choose(_("Display Substitution..."), (const char **) names, cnt, 0,
- _("Pick a substitution to display in the window."));
- if ( ret!=-1 )
- sub = SFFindLookupSubtable(sf,names[ret]);
- free(names);
- if ( ret==-1 )
-return;
- }
- if ( sub==NULL )
- sub = SFNewLookupSubtableOfType(sf,gsub_single,NULL);
- if ( sub!=NULL )
- fv->cur_subtable = sub;
- }
- GDrawRequestExpose(fv->v,NULL,false);
-}
-
-static void FVChangeDisplayFont(FontView *fv,BDFFont *bdf) {
- int samesize=0;
- int rcnt, ccnt;
- int oldr, oldc;
- int first_time = fv->show==NULL;
-
- if ( fv->v==NULL ) /* Can happen in scripts */
-return;
-
- if ( fv->show!=bdf ) {
- oldc = fv->cbw*fv->colcnt;
- oldr = fv->cbh*fv->rowcnt;
-
- fv->show = bdf;
- if ( fv->user_requested_magnify!=-1 )
- fv->magnify=fv->user_requested_magnify;
- else if ( bdf->pixelsize<20 ) {
- if ( bdf->pixelsize<=9 )
- fv->magnify = 3;
- else
- fv->magnify = 2;
- samesize = ( fv->show && fv->cbw == (bdf->pixelsize*fv->magnify)+1 );
- } else
- fv->magnify = 1;
- if ( !first_time && fv->cbw == fv->magnify*bdf->pixelsize+1 )
- samesize = true;
- fv->cbw = (bdf->pixelsize*fv->magnify)+1;
- fv->cbh = (bdf->pixelsize*fv->magnify)+1+fv->lab_height+1;
- fv->resize_expected = !samesize;
- ccnt = fv->sf->desired_col_cnt;
- rcnt = fv->sf->desired_row_cnt;
- if ((( bdf->pixelsize<=fv->sf->display_size || bdf->pixelsize<=-fv->sf->display_size ) &&
- fv->sf->top_enc!=-1 /* Not defaulting */ ) ||
- bdf->pixelsize<=48 ) {
- /* use the desired sizes */
- } else {
- if ( bdf->pixelsize>48 ) {
- ccnt = 8;
- rcnt = 2;
- } else if ( bdf->pixelsize>=96 ) {
- ccnt = 4;
- rcnt = 1;
- }
- if ( !first_time ) {
- if ( ccnt < oldc/fv->cbw )
- ccnt = oldc/fv->cbw;
- if ( rcnt < oldr/fv->cbh )
- rcnt = oldr/fv->cbh;
- }
- }
-#if defined(FONTFORGE_CONFIG_GTK)
- if ( samesize ) {
- gtk_widget_queue_draw(fv->v);
- } else {
- gtk_widget_set_size_request(fv->v,ccnt*fv->cbw+1,rcnt*fv->cbh+1);
- /* If we try to make the window smaller, we must force a resize */
- /* of the whole system, else the size will remain the same */
- /* Also when we get a resize event we must set the widget size */
- /* to be minimal so that the user can resize */
- if (( ccnt*fv->cbw < oldc || rcnt*fv->cbh < oldr ) && !first_time )
- gtk_window_resize( GTK_WINDOW(widget), 1,1 );
- }
-#elif defined(FONTFORGE_CONFIG_GDRAW)
- if ( samesize ) {
- GDrawRequestExpose(fv->v,NULL,false);
- } else {
- GDrawResize(fv->gw,
- ccnt*fv->cbw+1+GDrawPointsToPixels(fv->gw,_GScrollBar_Width),
- rcnt*fv->cbh+1+fv->mbh+fv->infoh);
- }
-#endif
- }
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-struct md_data {
- int done;
- int ish;
- FontView *fv;
-};
-
-static int md_e_h(GWindow gw, GEvent *e) {
- if ( e->type==et_close ) {
- struct md_data *d = GDrawGetUserData(gw);
- d->done = true;
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct md_data *d = GDrawGetUserData(gw);
- static int masks[] = { fvm_baseline, fvm_origin, fvm_advanceat, fvm_advanceto, -1 };
- int i, metrics;
- if ( GGadgetGetCid(e->u.control.g)==10 ) {
- metrics = 0;
- for ( i=0; masks[i]!=-1 ; ++i )
- if ( GGadgetIsChecked(GWidgetGetControl(gw,masks[i])))
- metrics |= masks[i];
- if ( d->ish )
- default_fv_showhmetrics = d->fv->showhmetrics = metrics;
- else
- default_fv_showvmetrics = d->fv->showvmetrics = metrics;
- }
- d->done = true;
- } else if ( e->type==et_char ) {
-#if 0
- if ( e->u.chr.keysym == GK_F1 || e->u.chr.keysym == GK_Help ) {
- help("fontinfo.html");
-return( true );
- }
-#endif
-return( false );
- }
-return( true );
-}
-
-static void FVMenuShowMetrics(GWindow fvgw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(fvgw);
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- struct md_data d;
- GGadgetCreateData gcd[7];
- GTextInfo label[6];
- int metrics = mi->mid==MID_ShowHMetrics ? fv->showhmetrics : fv->showvmetrics;
-
- d.fv = fv;
- d.done = 0;
- d.ish = mi->mid==MID_ShowHMetrics;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = d.ish?_("Show H. Metrics..."):_("Show V. Metrics...");
- pos.x = pos.y = 0;
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(170));
- pos.height = GDrawPointsToPixels(NULL,130);
- gw = GDrawCreateTopWindow(NULL,&pos,md_e_h,&d,&wattrs);
-
- memset(&label,0,sizeof(label));
- memset(&gcd,0,sizeof(gcd));
-
- label[0].text = (unichar_t *) _("Baseline");
- label[0].text_is_1byte = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 8; gcd[0].gd.pos.y = 8;
- gcd[0].gd.flags = gg_enabled|gg_visible|(metrics&fvm_baseline?gg_cb_on:0);
- gcd[0].gd.cid = fvm_baseline;
- gcd[0].creator = GCheckBoxCreate;
-
- label[1].text = (unichar_t *) _("Origin");
- label[1].text_is_1byte = true;
- gcd[1].gd.label = &label[1];
- gcd[1].gd.pos.x = 8; gcd[1].gd.pos.y = gcd[0].gd.pos.y+16;
- gcd[1].gd.flags = gg_enabled|gg_visible|(metrics&fvm_origin?gg_cb_on:0);
- gcd[1].gd.cid = fvm_origin;
- gcd[1].creator = GCheckBoxCreate;
-
- label[2].text = (unichar_t *) _("Advance Width as a Line");
- label[2].text_is_1byte = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.pos.x = 8; gcd[2].gd.pos.y = gcd[1].gd.pos.y+16;
- gcd[2].gd.flags = gg_enabled|gg_visible|gg_utf8_popup|(metrics&fvm_advanceat?gg_cb_on:0);
- gcd[2].gd.cid = fvm_advanceat;
- gcd[2].gd.popup_msg = (unichar_t *) _("Display the advance width as a line\nperpendicular to the advance direction");
- gcd[2].creator = GCheckBoxCreate;
-
- label[3].text = (unichar_t *) _("Advance Width as a Bar");
- label[3].text_is_1byte = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.pos.x = 8; gcd[3].gd.pos.y = gcd[2].gd.pos.y+16;
- gcd[3].gd.flags = gg_enabled|gg_visible|gg_utf8_popup|(metrics&fvm_advanceto?gg_cb_on:0);
- gcd[3].gd.cid = fvm_advanceto;
- gcd[3].gd.popup_msg = (unichar_t *) _("Display the advance width as a bar under the glyph\nshowing the extent of the advance");
- gcd[3].creator = GCheckBoxCreate;
-
- label[4].text = (unichar_t *) _("_OK");
- label[4].text_is_1byte = true;
- label[4].text_in_resource = true;
- gcd[4].gd.label = &label[4];
- gcd[4].gd.pos.x = 20-3; gcd[4].gd.pos.y = GDrawPixelsToPoints(NULL,pos.height)-35-3;
- gcd[4].gd.pos.width = -1; gcd[4].gd.pos.height = 0;
- gcd[4].gd.flags = gg_visible | gg_enabled | gg_but_default;
- gcd[4].gd.cid = 10;
- gcd[4].creator = GButtonCreate;
-
- label[5].text = (unichar_t *) _("_Cancel");
- label[5].text_is_1byte = true;
- label[5].text_in_resource = true;
- gcd[5].gd.label = &label[5];
- gcd[5].gd.pos.x = -20; gcd[5].gd.pos.y = gcd[4].gd.pos.y+3;
- gcd[5].gd.pos.width = -1; gcd[5].gd.pos.height = 0;
- gcd[5].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- gcd[5].creator = GButtonCreate;
-
- GGadgetsCreate(gw,gcd);
-
- GDrawSetVisible(gw,true);
- while ( !d.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-
- SavePrefs();
- GDrawRequestExpose(fv->v,NULL,false);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ShowMetrics(GtkMenuItem *menuitem, gpointer user_data) {
- GtkWidget *dlg = create_FontViewShowMetrics();
- int isv = strcmp(gtk_widget_get_name(menuitem),"show_v_metrics1")==0;
- int metrics = !isv ? fv->showhmetrics : fv->showvmetrics;
-
- if ( isv )
- gtk_window_set_title(GTK_WINDOW(dlg), _("Show Vertical Metrics"));
- gtk_toggle_button_set_active(lookup_widget(dlg,"baseline"),
- (metrics&fvm_baseline)?true:false);
- gtk_toggle_button_set_active(lookup_widget(dlg,"origin"),
- (metrics&fvm_origin)?true:false);
- gtk_toggle_button_set_active(lookup_widget(dlg,"AWBar"),
- (metrics&fvm_advanceto)?true:false);
- gtk_toggle_button_set_active(lookup_widget(dlg,"AWLine"),
- (metrics&fvm_advanceat)?true:false);
- if ( gtk_dialog_run( GTK_DIALOG (dlg)) == GTK_RESPONSE_ACCEPT ) {
- metrics = 0;
- if ( gtk_toggle_button_get_active(lookup_widget(dlg,"baseline")) )
- metrics |= fvm_baseline;
- if ( gtk_toggle_button_get_active(lookup_widget(dlg,"origin")) )
- metrics |= fvm_origin;
- if ( gtk_toggle_button_get_active(lookup_widget(dlg,"AWBar")) )
- metrics |= fvm_advanceto;
- if ( gtk_toggle_button_get_active(lookup_widget(dlg,"AWLine")) )
- metrics |= fvm_advanceat;
- if ( isv )
- fv->showvmetrics = metrics;
- else
- fv->showhmetrics = metrics;
- }
- gtk_widget_destroy( dlg );
-}
-#endif
-
-void FVChangeDisplayBitmap(FontView *fv,BDFFont *bdf) {
- FVChangeDisplayFont(fv,bdf);
- fv->sf->display_size = fv->show->pixelsize;
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuSize(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw), *fvs, *fvss;
- int dspsize = fv->filled->pixelsize;
- int changedmodifier = false;
-
- fv->magnify = 1;
- fv->user_requested_magnify = -1;
- if ( mi->mid == MID_24 )
- default_fv_font_size = dspsize = 24;
- else if ( mi->mid == MID_36 )
- default_fv_font_size = dspsize = 36;
- else if ( mi->mid == MID_48 )
- default_fv_font_size = dspsize = 48;
- else if ( mi->mid == MID_72 )
- default_fv_font_size = dspsize = 72;
- else if ( mi->mid == MID_96 )
- default_fv_font_size = dspsize = 96;
- else if ( mi->mid == MID_FitToEm ) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_PixelSize(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int dspsize = fv->filled->pixelsize;
- int changedmodifier = false;
- G_CONST_RETURN gchar *name = gtk_widget_get_name(menuitem);
-
- fv->magnify = 1;
- fv->user_requested_magnify = -1;
- if ( strstr(name,"24")!=NULL )
- default_fv_font_size = dspsize = 24;
- else if ( strstr(name,"36")!=NULL )
- default_fv_font_size = dspsize = 36;
- else if ( strstr(name,"48")!=NULL )
- default_fv_font_size = dspsize = 48;
- else if ( strstr(name,"72")!=NULL )
- default_fv_font_size = dspsize = 72;
- else if ( strstr(name,"96")!=NULL )
- default_fv_font_size = dspsize = 96;
- else if ( strcmp(name,"fit_to_em1")==0 ) {
-# endif
- default_fv_bbsized = fv->bbsized = !fv->bbsized;
- fv->sf->display_bbsized = fv->bbsized;
- changedmodifier = true;
- } else {
- default_fv_antialias = fv->antialias = !fv->antialias;
- fv->sf->display_antialias = fv->antialias;
- changedmodifier = true;
- }
-
- SavePrefs();
- if ( fv->filled!=fv->show || fv->filled->pixelsize != dspsize || changedmodifier ) {
- BDFFont *new, *old;
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- fvs->touched = false;
- while ( 1 ) {
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- if ( !fvs->touched )
- break;
- if ( fvs==NULL )
- break;
- old = fvs->filled;
- new = SplineFontPieceMeal(fvs->sf,dspsize,
- (fvs->antialias?pf_antialias:0)|(fvs->bbsized?pf_bbsized:0),
- NULL);
- for ( fvss=fvs; fvss!=NULL; fvss = fvss->nextsame ) {
- if ( fvss->filled==old ) {
- fvss->filled = new;
- fvss->antialias = fvs->antialias;
- fvss->bbsized = fvs->bbsized;
- if ( fvss->show==old || fvss==fv )
- FVChangeDisplayFont(fvss,new);
- fvss->touched = true;
- }
- }
- BDFFontFree(old);
- }
- fv->sf->display_size = -dspsize;
- if ( fv->cidmaster!=NULL ) {
- int i;
- for ( i=0; i<fv->cidmaster->subfontcnt; ++i )
- fv->cidmaster->subfonts[i]->display_size = -dspsize;
- }
- }
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuMagnify(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int magnify = fv->user_requested_magnify!=-1 ? fv->user_requested_magnify : fv->magnify;
- char def[20], *end, *ret;
- int val;
- BDFFont *show = fv->show;
-
- sprintf( def, "%d", magnify );
- ret = gwwv_ask_string(_("Bitmap Magnification..."),def,_("Please specify a bitmap magnification factor."));
- if ( ret==NULL )
-return;
- val = strtol(ret,&end,10);
- if ( val<1 || val>5 || *end!='\0' )
- gwwv_post_error( _("Bad Number"),_("Bad Number") );
- else {
- fv->user_requested_magnify = val;
- fv->show = fv->filled;
- FVChangeDisplayFont(fv,show);
- }
- free(ret);
-}
-#endif
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuWSize(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int h,v;
- extern int default_fv_col_count, default_fv_row_count;
-
- if ( mi->mid == MID_32x8 ) {
- h = 32; v=8;
- } else if ( mi->mid == MID_16x4 ) {
- h = 16; v=4;
- } else {
- h = 8; v=2;
- }
- GDrawResize(fv->gw,
- h*fv->cbw+1+GDrawPointsToPixels(fv->gw,_GScrollBar_Width),
- v*fv->cbh+1+fv->mbh+fv->infoh);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_WindowSize(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- G_CONST_RETURN gchar *name = gtk_widget_get_name(menuitem);
- int h=8,v=2;
- extern int default_fv_col_count, default_fv_row_count;
-
- sscanf(name,"%dx%d", &h, &v );
- gtk_widget_set_size_request(fv->v,h*fv->cbw+1,v*fv->cbh+1);
-# endif
- fv->sf->desired_col_cnt = default_fv_col_count = h;
- fv->sf->desired_row_cnt = default_fv_row_count = v;
-
- SavePrefs();
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuGlyphLabel(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- default_fv_glyphlabel = fv->glyphlabel = mi->mid;
-
- GDrawRequestExpose(fv->v,NULL,false);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_GlyphLabel(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- G_CONST_RETURN gchar *name = gtk_widget_get_name(menuitem);
-
- if ( strstr(name,"glyph_image")!=NULL )
- default_fv_glyphlabel = fv->glyphlabel = gl_glyph;
- else if ( strstr(name,"glyph_name")!=NULL )
- default_fv_glyphlabel = fv->glyphlabel = gl_name;
- else if ( strstr(name,"unicode")!=NULL )
- default_fv_glyphlabel = fv->glyphlabel = gl_unicode;
- else if ( strstr(name,"encoding")!=NULL )
- default_fv_glyphlabel = fv->glyphlabel = gl_encoding;
-
- gtk_widget_queue_draw(fv->v);
-# endif
-
- SavePrefs();
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuShowBitmap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- BDFFont *bdf = mi->ti.userdata;
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ShowBitmap(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- BDFFont *bdf = user_data;
-# endif
-
- FVChangeDisplayBitmap(fv,bdf); /* Let's not change any of the others */
-}
-
-void FVShowFilled(FontView *fv) {
- FontView *fvs;
-
- fv->magnify = 1;
- fv->user_requested_magnify = 1;
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- if ( fvs->show!=fvs->filled )
- FVChangeDisplayFont(fvs,fvs->filled);
- fv->sf->display_size = -fv->filled->pixelsize;
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-void FVMetricsCenter(FontView *fv,int docenter) {
- int i, gid;
- SplineChar *sc;
- DBounds bb;
- IBounds ib;
- real transform[6];
- BVTFunc bvts[2];
- BDFFont *bdf;
-
- transform[0] = transform[3] = 1.0;
- transform[1] = transform[2] = transform[5] = 0.0;
- bvts[1].func = bvt_none;
- bvts[0].func = bvt_transmove; bvts[0].y = 0;
- if ( !fv->sf->onlybitmaps ) {
- for ( i=0; i<fv->map->enccount; ++i ) {
- if ( fv->selected[i] && (gid=fv->map->map[i])!=-1 &&
- (sc = fv->sf->glyphs[gid])!=NULL ) {
- SplineCharFindBounds(sc,&bb);
- if ( docenter )
- transform[4] = (sc->width-(bb.maxx-bb.minx))/2 - bb.minx;
- else
- transform[4] = (sc->width-(bb.maxx-bb.minx))/3 - bb.minx;
- if ( transform[4]!=0 ) {
- FVTrans(fv,sc,transform,NULL,fvt_dontmovewidth);
- bvts[0].x = transform[4];
- for ( bdf = fv->sf->bitmaps; bdf!=NULL; bdf=bdf->next )
- if ( gid<bdf->glyphcnt && bdf->glyphs[gid]!=NULL )
- BCTrans(bdf,bdf->glyphs[gid],bvts,fv);
- }
- }
- }
- } else {
- double scale = (fv->sf->ascent+fv->sf->descent)/(double) (fv->show->pixelsize);
- for ( i=0; i<fv->map->enccount; ++i ) {
- if ( fv->selected[i] && (gid=fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL ) {
- BDFChar *bc = fv->show->glyphs[gid];
- if ( bc==NULL ) bc = BDFMakeChar(fv->show,fv->map,i);
- BDFCharFindBounds(bc,&ib);
- if ( docenter )
- transform[4] = scale * ((bc->width-(ib.maxx-ib.minx))/2 - ib.minx);
- else
- transform[4] = scale * ((bc->width-(ib.maxx-ib.minx))/3 - ib.minx);
- if ( transform[4]!=0 ) {
- FVTrans(fv,fv->sf->glyphs[gid],transform,NULL,fvt_dontmovewidth);
- bvts[0].x = transform[4];
- for ( bdf = fv->sf->bitmaps; bdf!=NULL; bdf=bdf->next )
- if ( gid<bdf->glyphcnt && bdf->glyphs[gid]!=NULL )
- BCTrans(bdf,bdf->glyphs[gid],bvts,fv);
- }
- }
- }
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCenter(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Center(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVMetricsCenter(fv,mi->mid==MID_Center);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuSetWidth(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- if ( mi->mid == MID_SetVWidth && !fv->sf->hasvmetrics )
-return;
- FVSetWidth(fv,mi->mid==MID_SetWidth ?wt_width:
- mi->mid==MID_SetLBearing?wt_lbearing:
- mi->mid==MID_SetRBearing?wt_rbearing:
- wt_vwidth);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Setwidth(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- G_CONST_RETURN gchar *name = gtk_widget_get_name(menuitem);
-
- if ( FVAnyCharSelected(fv)==-1 )
-return;
- if ( strcmp(name,"set_vertical_advance1")==0 && !fv->sf->hasvmetrics )
-return;
- FVSetWidth(fv,strcmp(name,"set_width1")==0 ?wt_width:
- strcmp(name,"set_lbearing1")==0?wt_lbearing:
- strcmp(name,"set_rbearing1")==0?wt_rbearing:
- wt_vwidth);
-# endif
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuAutoWidth(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AutoWidth(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVAutoWidth(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuAutoKern(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AutoKern(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVAutoKern(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuKernByClasses(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_KernClasses(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- ShowKernClasses(fv->sf,NULL,false);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuVKernByClasses(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_VKernClasses(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- ShowKernClasses(fv->sf,NULL,true);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuRemoveKern(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RemoveKP(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVRemoveKerns(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuRemoveVKern(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RemoveVKP(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVRemoveVKerns(fv);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuKPCloseup(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_KernPairCloseup(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] )
- break;
- KernPairD(fv->sf,i==fv->map->enccount?NULL:
- fv->map->map[i]==-1?NULL:
- fv->sf->glyphs[fv->map->map[i]],NULL,false);
-}
-
-# if defined(FONTFORGE_CONFIG_GDRAW)
-static void FVMenuVKernFromHKern(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_VKernFromH(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
- FVVKernFromHKern(fv);
-}
-#endif
-
-#ifndef LUA_FF_LIB
-static void FVAutoHint(FontView *fv) {
- int i, cnt=0, gid;
- BlueData *bd = NULL, _bd;
- SplineChar *sc;
-
- if ( fv->sf->mm==NULL ) {
- QuickBlues(fv->sf,&_bd);
- bd = &_bd;
- }
-
- /* Tick the ones we don't want to AH, untick the ones that need AH */
- for ( gid = 0; gid<fv->sf->glyphcnt; ++gid ) if ( (sc = fv->sf->glyphs[gid])!=NULL )
- sc->ticked = true;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(sc = fv->sf->glyphs[gid]) ) {
- ++cnt;
- sc->ticked = false;
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Auto Hinting Font..."),_("Auto Hinting Font..."),0,cnt,1);
-# endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- sc = fv->sf->glyphs[gid];
- sc->manualhints = false;
- /* Hint undoes are done in _SplineCharAutoHint */
- SFSCAutoHint(sc,bd);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- GDrawRequestExpose(fv->v,NULL,false); /* Clear any changedsincelasthinted marks */
-#endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuAutoHint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AutoHint(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVAutoHint( fv );
-}
-#endif
-
-static void FVAutoHintSubs(FontView *fv) {
- int i, cnt=0, gid;
-
- if ( fv->sf->mm!=NULL && fv->sf->mm->apple )
-return;
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Finding Substitution Points..."),_("Finding Substitution Points..."),0,cnt,1);
-# endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SplineChar *sc = fv->sf->glyphs[gid];
- SCFigureHintMasks(sc);
- SCUpdateAll(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuAutoHintSubs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AutoHintSubs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVAutoHintSubs( fv );
-}
-#endif
-
-static void FVAutoCounter(FontView *fv) {
- int i, cnt=0, gid;
-
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Finding Counter Masks..."),_("Finding Counter Masks..."),0,cnt,1);
-# endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SplineChar *sc = fv->sf->glyphs[gid];
- SCFigureCounterMasks(sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
- break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuAutoCounter(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AutoCounter(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVAutoCounter( fv );
-}
-#endif
-
-static void FVDontAutoHint(FontView *fv) {
- int i, gid;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SplineChar *sc = fv->sf->glyphs[gid];
- sc->manualhints = true;
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuDontAutoHint(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_DontAutoHint(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVDontAutoHint( fv );
-}
-#endif
-
-static void FVAutoInstr(FontView *fv) {
- BlueData bd;
- int i, cnt=0, gid;
-
- QuickBlues(fv->sf,&bd);
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- SCWorthOutputting(fv->sf->glyphs[gid]) )
- ++cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_start_indicator(10,_("Auto Instructing Font..."),_("Auto Instructing Font..."),0,cnt,1);
-# endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SplineChar *sc = fv->sf->glyphs[gid];
- SCAutoInstr(sc,&bd);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- break;
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-}
-
-static void FVClearInstrs(FontView *fv) {
- SplineChar *sc;
- int i, gid;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
- if ( !SFCloseAllInstrs(fv->sf))
-return;
-#endif
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting((sc = fv->sf->glyphs[gid])) ) {
- if ( sc->ttf_instrs_len!=0 ) {
- free(sc->ttf_instrs);
- sc->ttf_instrs = NULL;
- sc->ttf_instrs_len = 0;
- sc->instructions_out_of_date = false;
- SCCharChangedUpdate(sc);
- sc->complained_about_ptnums = false;
- }
- }
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuAutoInstr(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AutoInstr(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVAutoInstr( fv );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuEditInstrs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_EditInstrs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int index = FVAnyCharSelected(fv);
- SplineChar *sc;
- if ( index<0 )
-return;
- sc = SFMakeChar(fv->sf,fv->map,index);
- SCEditInstructions(sc);
-}
-#endif /* LUA_FF_LIB */
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuEditTable(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- SFEditTable(fv->sf,
- mi->mid==MID_Editprep?CHR('p','r','e','p'):
- mi->mid==MID_Editfpgm?CHR('f','p','g','m'):
- mi->mid==MID_Editmaxp?CHR('m','a','x','p'):
- CHR('c','v','t',' '));
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_EditTable(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- G_CONST_RETURN gchar *name = gtk_widget_get_name(menuitem);
- SFEditTable(fv->sf,
- strcmp(name,"edit_prep1")==0?CHR('p','r','e','p'):
- strcmp(name,"edit_fpgm1")==0?CHR('f','p','g','m'):
- CHR('c','v','t',' '));
-}
-# endif
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuPrivateToCvt(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_PrivateToCvt(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- CVT_ImportPrivate(fv->sf);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuClearInstrs(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ClearInstrs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVClearInstrs(fv);
-}
-#endif
-
-#ifndef LUA_FF_LIB
-static void FVClearHints(FontView *fv) {
- int i, gid;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SplineChar *sc = fv->sf->glyphs[gid];
- sc->manualhints = true;
- SCPreserveHints(sc);
- SCClearHints(sc);
- SCUpdateAll(sc);
-#if 0
- if ( !gwwv_progress_next())
- break;
-#endif
- }
-#if 0
- gwwv_progress_end_indicator();
-#endif
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuClearHints(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ClearHints(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- FVClearHints(fv);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuClearWidthMD(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ClearWidthMD(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- int i, changed, gid;
- MinimumDistance *md, *prev, *next;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] &&
- (gid = fv->map->map[i])!=-1 && SCWorthOutputting(fv->sf->glyphs[gid]) ) {
- SplineChar *sc = fv->sf->glyphs[gid];
- prev=NULL; changed = false;
- for ( md=sc->md; md!=NULL; md=next ) {
- next = md->next;
- if ( md->sp2==NULL ) {
- if ( prev==NULL )
- sc->md = next;
- else
- prev->next = next;
- chunkfree(md,sizeof(MinimumDistance));
- changed = true;
- } else
- prev = md;
- }
- if ( changed ) {
- sc->manualhints = true;
- SCOutOfDateBackground(sc);
- SCUpdateAll(sc);
- }
- }
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuHistograms(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- SFHistogram(fv->sf, NULL, FVAnyCharSelected(fv)!=-1?fv->selected:NULL,
- fv->map,
- mi->mid==MID_HStemHist ? hist_hstem :
- mi->mid==MID_VStemHist ? hist_vstem :
- hist_blues);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Histograms(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- G_CONST_RETURN gchar *name = gtk_widget_get_name(menuitem);
- SFHistogram(fv->sf, NULL, FVAnyCharSelected(fv)!=-1?fv->selected:NULL,
- strcmp(name,"hstem1")==0 ? hist_hstem :
- strcmp(name,"vstem1")==0 ? hist_vstem :
- hist_blues);
-# endif
-
-void FVSetTitle(FontView *fv) {
-# ifdef FONTFORGE_CONFIG_GDRAW
- unichar_t *title, *ititle, *temp;
- char *file=NULL;
- char *enc;
- int len;
-
- if ( fv->gw==NULL ) /* In scripting */
-return;
-
- enc = SFEncodingName(fv->sf,fv->normal?fv->normal:fv->map);
- len = strlen(fv->sf->fontname)+1 + strlen(enc)+6;
- if ( fv->cidmaster!=NULL ) {
- if ( (file = fv->cidmaster->filename)==NULL )
- file = fv->cidmaster->origname;
- } else {
- if ( (file = fv->sf->filename)==NULL )
- file = fv->sf->origname;
- }
- if ( file!=NULL )
- len += 2+strlen(file);
- title = galloc((len+1)*sizeof(unichar_t));
- uc_strcpy(title,fv->sf->fontname);
- if ( fv->sf->changed )
- uc_strcat(title,"*");
- if ( file!=NULL ) {
- uc_strcat(title," ");
- temp = def2u_copy(GFileNameTail(file));
- u_strcat(title,temp);
- free(temp);
- }
- uc_strcat(title, " (" );
- if ( fv->normal ) { utf82u_strcat(title,_("Compact")); uc_strcat(title," "); }
- uc_strcat(title,enc);
- uc_strcat(title, ")" );
- free(enc);
-
- ititle = uc_copy(fv->sf->fontname);
- GDrawSetWindowTitles(fv->gw,title,ititle);
- free(title);
- free(ititle);
-# elif defined(FONTFORGE_CONFIG_GTK)
- char *title, *ititle, *temp;
- char *file=NULL;
- char *enc;
- int len;
- gsize read, written;
-
- if ( fv->gw==NULL ) /* In scripting */
-return;
-
- enc = SFEncodingName(fv->sf,fv->map);
- len = strlen(fv->sf->fontname)+1 + strlen(enc)+4;
- if ( fv->cidmaster!=NULL ) {
- if ( (file = fv->cidmaster->filename)==NULL )
- file = fv->cidmaster->origname;
- } else {
- if ( (file = fv->sf->filename)==NULL )
- file = fv->sf->origname;
- }
- if ( file!=NULL )
- len += 2+strlen(file);
- title = galloc((len+1));
- strcpy(title,fv->sf->fontname);
- if ( fv->sf->changed )
- strcat(title,"*");
- if ( file!=NULL ) {
- char *temp;
- strcat(title," ");
- temp = g_filename_to_utf8(GFileNameTail(file),-1,&read,&written,NULL);
- strcat(title,temp);
- free(temp);
- }
- strcat(title, " (" );
- strcat(title,enc);
- strcat(title, ")" );
- free(enc);
-
- gdk_window_set_icon_name( GTK_WIDGET(fv->gw)->window, fv->sf->fontname );
- gtk_window_set_title( GTK_WINDOW(fv->gw), title );
- free(title);
-# endif
-}
-
-static void CIDSetEncMap(FontView *fv, SplineFont *new ) {
- int gcnt = new->glyphcnt;
-
- if ( fv->cidmaster!=NULL && gcnt!=fv->sf->glyphcnt ) {
- int i;
- if ( fv->map->encmax<gcnt ) {
- fv->map->map = grealloc(fv->map->map,gcnt*sizeof(int));
- fv->map->backmap = grealloc(fv->map->backmap,gcnt*sizeof(int));
- fv->map->backmax = fv->map->encmax = gcnt;
- }
- for ( i=0; i<gcnt; ++i )
- fv->map->map[i] = fv->map->backmap[i] = i;
- if ( gcnt<fv->map->enccount )
- memset(fv->selected+gcnt,0,fv->map->enccount-gcnt);
- else {
- free(fv->selected);
- fv->selected = gcalloc(gcnt,sizeof(char));
- }
- fv->map->enccount = gcnt;
- }
- fv->sf = new;
- new->fv = fv;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVSetTitle(fv);
- FontViewReformatOne(fv);
-#endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuShowSubFont(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-static void FontViewMenu_ShowSubFont(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *new = mi->ti.userdata;
- MetricsView *mv, *mvnext;
- BDFFont *newbdf;
- int wascompact = fv->normal!=NULL;
-
- for ( mv=fv->sf->metrics; mv!=NULL; mv = mvnext ) {
- /* Don't bother trying to fix up metrics views, just not worth it */
- mvnext = mv->next;
- GDrawDestroyWindow(mv->gw);
- }
- if ( wascompact ) {
- EncMapFree(fv->map);
- fv->map = fv->normal;
- fv->normal = NULL;
- fv->selected = grealloc(fv->selected,fv->map->enccount);
- memset(fv->selected,0,fv->map->enccount);
- }
- CIDSetEncMap(fv,new);
- if ( wascompact ) {
- fv->normal = EncMapCopy(fv->map);
- CompactEncMap(fv->map,fv->sf);
- FontViewReformatOne(fv);
- FVSetTitle(fv);
- }
- newbdf = SplineFontPieceMeal(fv->sf,fv->filled->pixelsize,
- (fv->antialias?pf_antialias:0)|(fv->bbsized?pf_bbsized:0),
- NULL);
- BDFFontFree(fv->filled);
- if ( fv->filled == fv->show )
- fv->show = newbdf;
- fv->filled = newbdf;
- GDrawRequestExpose(fv->v,NULL,true);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuConvert2CID(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Convert2CID(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster;
-
- if ( cidmaster!=NULL )
-return;
- MakeCIDMaster(fv->sf,fv->map,false,NULL,NULL);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuConvertByCMap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ConvertByCMap(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster;
-
- if ( cidmaster!=NULL )
-return;
- MakeCIDMaster(fv->sf,fv->map,true,NULL,NULL);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuFlatten(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Flatten(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster;
-
- if ( cidmaster==NULL )
-return;
- SFFlatten(cidmaster);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuFlattenByCMap(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_FlattenByCMap(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster;
-
- if ( cidmaster==NULL )
-return;
- SFFlattenByCMap(cidmaster,NULL);
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void FVInsertInCID(FontView *fv,SplineFont *sf) {
- SplineFont *cidmaster = fv->cidmaster;
- SplineFont **subs;
- int i;
-
- subs = galloc((cidmaster->subfontcnt+1)*sizeof(SplineFont *));
- for ( i=0; i<cidmaster->subfontcnt && cidmaster->subfonts[i]!=fv->sf; ++i )
- subs[i] = cidmaster->subfonts[i];
- subs[i] = sf;
- if ( sf->uni_interp == ui_none || sf->uni_interp == ui_unset )
- sf->uni_interp = cidmaster->uni_interp;
- for ( ; i<cidmaster->subfontcnt ; ++i )
- subs[i+1] = cidmaster->subfonts[i];
- ++cidmaster->subfontcnt;
- free(cidmaster->subfonts);
- cidmaster->subfonts = subs;
- cidmaster->changed = true;
- sf->cidmaster = cidmaster;
-
- CIDSetEncMap(fv,sf);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuInsertFont(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_InsertFont(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster;
- SplineFont *new;
- struct cidmap *map;
- char *filename;
- extern NameList *force_names_when_opening;
-
- if ( cidmaster==NULL || cidmaster->subfontcnt>=255 ) /* Open type allows 1 byte to specify the fdselect */
-return;
-
- filename = GetPostscriptFontName(NULL,false);
- if ( filename==NULL )
-return;
- new = LoadSplineFont(filename,0);
- free(filename);
- if ( new==NULL )
-return;
- if ( new->fv == fv ) /* Already part of us */
-return;
- if ( new->fv != NULL ) {
- if ( new->fv->gw!=NULL )
- GDrawRaise(new->fv->gw);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_post_error(_("Please close font"),_("Please close %s before inserting it into a CID font"),new->origname);
-#endif
-return;
- }
- EncMapFree(new->map);
- if ( force_names_when_opening!=NULL )
- SFRenameGlyphsToNamelist(new,force_names_when_opening );
-
- map = FindCidMap(cidmaster->cidregistry,cidmaster->ordering,cidmaster->supplement,cidmaster);
- SFEncodeToMap(new,map);
- if ( !PSDictHasEntry(new->private,"lenIV"))
- PSDictChangeEntry(new->private,"lenIV","1"); /* It's 4 by default, in CIDs the convention seems to be 1 */
- new->display_antialias = fv->sf->display_antialias;
- new->display_bbsized = fv->sf->display_bbsized;
- new->display_size = fv->sf->display_size;
- FVInsertInCID(fv,new);
- CIDMasterAsDes(new);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuInsertBlank(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_InsertBlank(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster, *sf;
- struct cidmap *map;
-
- if ( cidmaster==NULL || cidmaster->subfontcnt>=255 ) /* Open type allows 1 byte to specify the fdselect */
-return;
- map = FindCidMap(cidmaster->cidregistry,cidmaster->ordering,cidmaster->supplement,cidmaster);
- sf = SplineFontBlank(MaxCID(map));
- sf->glyphcnt = sf->glyphmax;
- sf->cidmaster = cidmaster;
- sf->display_antialias = fv->sf->display_antialias;
- sf->display_bbsized = fv->sf->display_bbsized;
- sf->display_size = fv->sf->display_size;
- sf->private = gcalloc(1,sizeof(struct psdict));
- PSDictChangeEntry(sf->private,"lenIV","1"); /* It's 4 by default, in CIDs the convention seems to be 1 */
- FVInsertInCID(fv,sf);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuRemoveFontFromCID(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- char *buts[3];
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RemoveFontFromCID(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- static char *buts[] = { GTK_STOCK_REMOVE, GTK_STOCK_CANCEL, NULL };
-# endif
- SplineFont *cidmaster = fv->cidmaster, *sf = fv->sf, *replace;
- int i;
- MetricsView *mv, *mnext;
- FontView *fvs;
-
- if ( cidmaster==NULL || cidmaster->subfontcnt<=1 ) /* Can't remove last font */
-return;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[0] = _("_Remove"); buts[1] = _("_Cancel"); buts[2] = NULL;
-#endif
- if ( gwwv_ask(_("_Remove Font"),(const char **) buts,0,1,_("Are you sure you wish to remove sub-font %1$.40s from the CID font %2$.40s"),
- sf->fontname,cidmaster->fontname)==1 )
-return;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- CharView *cv, *next;
- for ( cv = sf->glyphs[i]->views; cv!=NULL; cv = next ) {
- next = cv->next;
- GDrawDestroyWindow(cv->gw);
- }
- }
- GDrawProcessPendingEvents(NULL);
- for ( mv=fv->sf->metrics; mv!=NULL; mv = mnext ) {
- mnext = mv->next;
- GDrawDestroyWindow(mv->gw);
- }
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- /* Just in case... */
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
-
- for ( i=0; i<cidmaster->subfontcnt; ++i )
- if ( cidmaster->subfonts[i]==sf )
- break;
- replace = i==0?cidmaster->subfonts[1]:cidmaster->subfonts[i-1];
- while ( i<cidmaster->subfontcnt-1 ) {
- cidmaster->subfonts[i] = cidmaster->subfonts[i+1];
- ++i;
- }
- --cidmaster->subfontcnt;
-
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- if ( fvs->sf==sf )
- CIDSetEncMap(fvs,replace);
- }
- FontViewReformatAll(fv->sf);
- SplineFontFree(sf);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCIDFontInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CIDFontInfo(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster;
-
- if ( cidmaster==NULL )
-return;
- FontInfo(cidmaster,-1,false);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuChangeSupplement(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ChangeSupplement(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- SplineFont *cidmaster = fv->cidmaster;
- struct cidmap *cidmap;
- char buffer[20];
- char *ret, *end;
- int supple;
-
- if ( cidmaster==NULL )
-return;
- sprintf(buffer,"%d",cidmaster->supplement);
- ret = gwwv_ask_string(_("Change Supplement..."),buffer,_("Please specify a new supplement for %.20s-%.20s"),
- cidmaster->cidregistry,cidmaster->ordering);
- if ( ret==NULL )
-return;
- supple = strtol(ret,&end,10);
- if ( *end!='\0' || supple<=0 ) {
- free(ret);
- gwwv_post_error( _("Bad Number"),_("Bad Number") );
-return;
- }
- free(ret);
- if ( supple!=cidmaster->supplement ) {
- /* this will make noises if it can't find an appropriate cidmap */
- cidmap = FindCidMap(cidmaster->cidregistry,cidmaster->ordering,supple,cidmaster);
- cidmaster->supplement = supple;
- FVSetTitle(fv);
- }
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuReencode(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- Encoding *enc = NULL;
- EncMap *map;
-
- enc = FindOrMakeEncoding(mi->ti.userdata);
- if ( enc==&custom )
- fv->map->enc = &custom;
- else {
- map = EncMapFromEncoding(fv->sf,enc);
- fv->selected = grealloc(fv->selected,map->enccount);
- memset(fv->selected,0,map->enccount);
- EncMapFree(fv->map);
- fv->map = map;
- }
- if ( fv->normal!=NULL ) {
- EncMapFree(fv->normal);
- fv->normal = NULL;
- }
- SFReplaceEncodingBDFProps(fv->sf,fv->map);
- FVSetTitle(fv);
- FontViewReformatOne(fv);
-}
-
-static void FVMenuForceEncode(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- Encoding *enc = NULL;
- int oldcnt = fv->map->enccount;
-
- enc = FindOrMakeEncoding(mi->ti.userdata);
- SFForceEncoding(fv->sf,fv->map,enc);
- if ( oldcnt < fv->map->enccount ) {
- fv->selected = grealloc(fv->selected,fv->map->enccount);
- memset(fv->selected+oldcnt,0,fv->map->enccount-oldcnt);
- }
- if ( fv->normal!=NULL ) {
- EncMapFree(fv->normal);
- fv->normal = NULL;
- }
- SFReplaceEncodingBDFProps(fv->sf,fv->map);
- FVSetTitle(fv);
- FontViewReformatOne(fv);
-}
-
-static void FVMenuDisplayByGroups(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- DisplayGroups(fv);
-}
-
-static void FVMenuDefineGroups(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- DefineGroups(fv);
-}
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Reencode(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-void FontViewMenu_ForceEncode(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuMMValid(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_MMValid(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- MMSet *mm = fv->sf->mm;
-
- if ( mm==NULL )
-return;
- MMValid(mm,true);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuCreateMM(GWindow gw,struct gmenuitem *mi,GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_CreateMM(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- MMWizard(NULL);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuMMInfo(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_MMInfo(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- MMSet *mm = fv->sf->mm;
-
- if ( mm==NULL )
-return;
- MMWizard(mm);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuChangeMMBlend(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ChangeDefWeights(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- MMSet *mm = fv->sf->mm;
-
- if ( mm==NULL || mm->apple )
-return;
- MMChangeBlend(mm,fv,false);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuBlendToNew(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_Blend(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- MMSet *mm = fv->sf->mm;
-
- if ( mm==NULL )
-return;
- MMChangeBlend(mm,fv,true);
-}
-#endif
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void cflistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- /*FontView *fv = (FontView *) GDrawGetUserData(gw);*/
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_AllFonts:
- mi->ti.checked = !onlycopydisplayed;
- break;
- case MID_DisplayedFont:
- mi->ti.checked = onlycopydisplayed;
- break;
- case MID_CharName:
- mi->ti.checked = copymetadata;
- break;
- case MID_TTFInstr:
- mi->ti.checked = copyttfinstr;
- break;
- }
- }
-}
-
-static void sllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- fv = fv;
-}
-
-static void htlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int anychars = FVAnyCharSelected(fv);
- int multilayer = fv->sf->multilayer;
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_AutoHint:
- mi->ti.disabled = anychars==-1 || multilayer;
- break;
- case MID_HintSubsPt:
- mi->ti.disabled = fv->sf->order2 || anychars==-1 || multilayer;
- if ( fv->sf->mm!=NULL && fv->sf->mm->apple )
- mi->ti.disabled = true;
- break;
- case MID_AutoCounter: case MID_DontAutoHint:
- mi->ti.disabled = fv->sf->order2 || anychars==-1 || multilayer;
- break;
- case MID_AutoInstr: case MID_EditInstructions:
- mi->ti.disabled = !fv->sf->order2 || anychars==-1 || multilayer;
- break;
- case MID_PrivateToCvt:
- mi->ti.disabled = !fv->sf->order2 || multilayer ||
- fv->sf->private==NULL || fv->sf->cvt_dlg!=NULL;
- break;
- case MID_Editfpgm: case MID_Editprep: case MID_Editcvt: case MID_Editmaxp:
- mi->ti.disabled = !fv->sf->order2 || multilayer;
- break;
- case MID_ClearHints: case MID_ClearWidthMD: case MID_ClearInstrs:
- mi->ti.disabled = anychars==-1;
- break;
- }
- }
-}
-
-static void fllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int anychars = FVAnyCharSelected(fv);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Revert:
- mi->ti.disabled = fv->sf->origname==NULL || fv->sf->new;
- break;
- case MID_RevertToBackup:
- /* We really do want to use filename here and origname above */
- mi->ti.disabled = true;
- if ( fv->sf->filename!=NULL ) {
- if ( fv->sf->backedup == bs_dontknow ) {
- char *buf = galloc(strlen(fv->sf->filename)+20);
- strcpy(buf,fv->sf->filename);
- if ( fv->sf->compression!=0 )
- strcat(buf,compressors[fv->sf->compression-1].ext);
- strcat(buf,"~");
- if ( access(buf,F_OK)==0 )
- fv->sf->backedup = bs_backedup;
- else
- fv->sf->backedup = bs_not;
- free(buf);
- }
- if ( fv->sf->backedup == bs_backedup )
- mi->ti.disabled = false;
- }
- break;
- case MID_RevertGlyph:
- mi->ti.disabled = fv->sf->origname==NULL || fv->sf->sfd_version<2 || anychars==-1 || fv->sf->compression!=0;
- break;
- case MID_Recent:
- mi->ti.disabled = !RecentFilesAny();
- break;
- case MID_ScriptMenu:
- mi->ti.disabled = script_menu_names[0]==NULL;
- break;
- case MID_Print:
- mi->ti.disabled = fv->sf->onlybitmaps;
- break;
- case MID_Display:
- mi->ti.disabled = (fv->sf->onlybitmaps && fv->sf->bitmaps==NULL) ||
- fv->sf->multilayer;
- break;
- }
- }
-}
-
-static void edlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int pos = FVAnyCharSelected(fv), i, gid;
- int not_pasteable = pos==-1 ||
- (!CopyContainsSomething() &&
-#ifndef _NO_LIBPNG
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/png") &&
-#endif
-#ifndef _NO_LIBXML
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/svg") &&
-#endif
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/bmp") &&
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/eps") &&
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/ps"));
- RefChar *base = CopyContainsRef(fv->sf);
- int base_enc = base!=NULL ? fv->map->backmap[base->orig_pos] : -1;
-
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Paste: case MID_PasteInto:
- mi->ti.disabled = not_pasteable;
- break;
-#ifdef FONTFORGE_CONFIG_PASTEAFTER
- case MID_PasteAfter:
- mi->ti.disabled = not_pasteable || pos<0;
- break;
-#endif
- case MID_SameGlyphAs:
- mi->ti.disabled = not_pasteable || base==NULL || fv->cidmaster!=NULL ||
- base_enc==-1 ||
- fv->selected[base_enc]; /* Can't be self-referential */
- break;
- case MID_Join:
- case MID_Cut: case MID_Copy: case MID_Clear:
- case MID_CopyWidth: case MID_CopyLBearing: case MID_CopyRBearing:
- case MID_CopyRef: case MID_UnlinkRef:
- case MID_RemoveUndoes: case MID_CopyFgToBg:
- case MID_RplRef:
- mi->ti.disabled = pos==-1;
- break;
- case MID_CopyLookupData:
- mi->ti.disabled = pos==-1 || (fv->sf->gpos_lookups==NULL && fv->sf->gsub_lookups==NULL);
- break;
- case MID_CopyVWidth:
- mi->ti.disabled = pos==-1 || !fv->sf->hasvmetrics;
- break;
- case MID_ClearBackground:
- mi->ti.disabled = true;
- if ( pos!=-1 && !( onlycopydisplayed && fv->filled!=fv->show )) {
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL )
- if ( fv->sf->glyphs[gid]->layers[ly_back].images!=NULL ||
- fv->sf->glyphs[gid]->layers[ly_back].splines!=NULL ) {
- mi->ti.disabled = false;
- break;
- }
- }
- break;
- case MID_Undo:
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL )
- if ( fv->sf->glyphs[gid]->layers[ly_fore].undoes!=NULL )
- break;
- mi->ti.disabled = i==fv->map->enccount;
- break;
- case MID_Redo:
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL )
- if ( fv->sf->glyphs[gid]->layers[ly_fore].redoes!=NULL )
- break;
- mi->ti.disabled = i==fv->map->enccount;
- break;
- }
- }
-}
-
-static void trlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int anychars = FVAnyCharSelected(fv);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Transform:
- mi->ti.disabled = anychars==-1;
- break;
- case MID_NLTransform: case MID_POV:
- mi->ti.disabled = anychars==-1 || fv->sf->onlybitmaps;
- break;
- }
- }
-}
-
-static void ellistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int anychars = FVAnyCharSelected(fv), gid;
- int anybuildable, anytraceable;
- int order2 = fv->sf->order2;
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_CharInfo:
- mi->ti.disabled = anychars<0 || (gid = fv->map->map[anychars])==-1 ||
- (fv->cidmaster!=NULL && fv->sf->glyphs[gid]==NULL);
- break;
- case MID_StrikeInfo:
- mi->ti.disabled = fv->sf->bitmaps==NULL;
- break;
- case MID_FindProblems:
- mi->ti.disabled = anychars==-1;
- break;
- case MID_Transform:
- mi->ti.disabled = anychars==-1;
- /* some Transformations make sense on bitmaps now */
- break;
- case MID_AddExtrema:
- mi->ti.disabled = anychars==-1 || fv->sf->onlybitmaps;
- break;
- case MID_Simplify:
- case MID_Stroke: case MID_RmOverlap:
- mi->ti.disabled = anychars==-1 || fv->sf->onlybitmaps;
- break;
- case MID_MetaFont: case MID_Effects:
- mi->ti.disabled = anychars==-1 || fv->sf->onlybitmaps || order2;
- break;
- case MID_Round: case MID_Correct:
- mi->ti.disabled = anychars==-1 || fv->sf->onlybitmaps;
- break;
-#ifdef FONTFORGE_CONFIG_TILEPATH
- case MID_TilePath:
- mi->ti.disabled = anychars==-1 || fv->sf->onlybitmaps || ClipBoardToSplineSet()==NULL || order2;
- break;
-#endif
- case MID_AvailBitmaps:
- mi->ti.disabled = fv->sf->mm!=NULL;
- break;
- case MID_RegenBitmaps: case MID_RemoveBitmaps:
- mi->ti.disabled = fv->sf->bitmaps==NULL || fv->sf->onlybitmaps ||
- fv->sf->mm!=NULL;
- break;
- case MID_BuildAccent:
- anybuildable = false;
- if ( anychars!=-1 ) {
- int i;
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] ) {
- SplineChar *sc=NULL, dummy;
- gid = fv->map->map[i];
- if ( gid!=-1 )
- sc = fv->sf->glyphs[gid];
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,i);
- if ( SFIsSomethingBuildable(fv->sf,sc,false) ||
- SFIsDuplicatable(fv->sf,sc)) {
- anybuildable = true;
- break;
- }
- }
- }
- mi->ti.disabled = !anybuildable;
- break;
- case MID_Autotrace:
- anytraceable = false;
- if ( FindAutoTraceName()!=NULL && anychars!=-1 ) {
- int i;
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL &&
- fv->sf->glyphs[gid]->layers[ly_back].images!=NULL ) {
- anytraceable = true;
- break;
- }
- }
- mi->ti.disabled = !anytraceable;
- break;
- case MID_MergeFonts:
- mi->ti.disabled = fv->sf->bitmaps!=NULL && fv->sf->onlybitmaps;
- break;
- case MID_FontCompare:
- mi->ti.disabled = fv_list->next==NULL;
- break;
- case MID_InterpolateFonts:
- mi->ti.disabled = fv->sf->onlybitmaps;
- break;
- }
- }
-}
-
-static void mtlistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int anychars = FVAnyCharSelected(fv);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Center: case MID_Thirds: case MID_SetWidth:
- case MID_SetLBearing: case MID_SetRBearing:
- mi->ti.disabled = anychars==-1;
- break;
- case MID_SetVWidth:
- mi->ti.disabled = anychars==-1 || !fv->sf->hasvmetrics;
- break;
- case MID_VKernByClass:
- case MID_VKernFromH:
- case MID_RmVKern:
- mi->ti.disabled = !fv->sf->hasvmetrics;
- break;
- }
- }
-}
-
-#if HANYANG
-static void hglistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- if ( mi->mid==MID_BuildSyllables || mi->mid==MID_ModifyComposition )
- mi->ti.disabled = fv->sf->rules==NULL;
- }
-}
-
-static GMenuItem2 hglist[] = {
- { { (unichar_t *) N_("_New Composition..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("New Composition...|Ctl+Shft+N"), NULL, NULL, MenuNewComposition },
- { { (unichar_t *) N_("_Modify Composition..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Modify Composition...|No Shortcut"), NULL, NULL, FVMenuModifyComposition, MID_ModifyComposition },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Build Syllables"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Build Syllables|No Shortcut"), NULL, NULL, FVMenuBuildSyllables, MID_BuildSyllables },
- { NULL }
-};
-#endif
-
-static void balistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- if ( mi->mid==MID_BuildAccent || mi->mid==MID_BuildComposite ) {
- int anybuildable = false;
- int onlyaccents = mi->mid==MID_BuildAccent;
- int i, gid;
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] ) {
- SplineChar *sc=NULL, dummy;
- if ( (gid=fv->map->map[i])!=-1 )
- sc = fv->sf->glyphs[gid];
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,i);
- if ( SFIsSomethingBuildable(fv->sf,sc,onlyaccents)) {
- anybuildable = true;
- break;
- }
- }
- mi->ti.disabled = !anybuildable;
- } else if ( mi->mid==MID_BuildDuplicates ) {
- int anybuildable = false;
- int i, gid;
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] ) {
- SplineChar *sc=NULL, dummy;
- if ( (gid=fv->map->map[i])!=-1 )
- sc = fv->sf->glyphs[gid];
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,i);
- if ( SFIsDuplicatable(fv->sf,sc)) {
- anybuildable = true;
- break;
- }
- }
- mi->ti.disabled = !anybuildable;
- }
- }
-}
-
-static void delistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int i = FVAnyCharSelected(fv);
- int gid = i<0 ? -1 : fv->map->map[i];
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_ShowDependentRefs:
- mi->ti.disabled = gid<0 || fv->sf->glyphs[gid]==NULL ||
- fv->sf->glyphs[gid]->dependents == NULL;
- break;
- case MID_ShowDependentSubs:
- mi->ti.disabled = gid<0 || fv->sf->glyphs[gid]==NULL ||
- !SCUsedBySubs(fv->sf->glyphs[gid]);
- break;
- }
- }
-}
-
-static GMenuItem2 dummyitem[] = { { (unichar_t *) N_("Font|_New"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, NULL };
-static GMenuItem2 fllist[] = {
- { { (unichar_t *) N_("Font|_New"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("New|Ctl+N"), NULL, NULL, MenuNew },
-#if HANYANG
- { { (unichar_t *) N_("_Hangul"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, NULL, hglist, hglistcheck, NULL, 0 },
-#endif
- { { (unichar_t *) N_("_Open"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'O' }, H_("Open|Ctl+O"), NULL, NULL, MenuOpen },
- { { (unichar_t *) N_("Recen_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, NULL, dummyitem, MenuRecentBuild, NULL, MID_Recent },
- { { (unichar_t *) N_("_Close"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Close|Ctl+Shft+Q"), NULL, NULL, FVMenuClose },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Save"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Save|Ctl+S"), NULL, NULL, FVMenuSave },
- { { (unichar_t *) N_("S_ave as..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'a' }, H_("Save as...|Ctl+Shft+S"), NULL, NULL, FVMenuSaveAs },
- { { (unichar_t *) N_("Save A_ll"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, H_("Save All|Alt+Ctl+S"), NULL, NULL, MenuSaveAll },
- { { (unichar_t *) N_("_Generate Fonts..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'G' }, H_("Generate Fonts...|Ctl+Shft+G"), NULL, NULL, FVMenuGenerate },
- { { (unichar_t *) N_("Generate Mac _Family..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Generate Mac Family...|Alt+Ctl+G"), NULL, NULL, FVMenuGenerateFamily },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Import..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Import...|Ctl+Shft+I"), NULL, NULL, FVMenuImport },
- { { (unichar_t *) N_("_Merge Feature Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Merge Kern Info...|Alt+Ctl+Shft+K"), NULL, NULL, FVMenuMergeKern },
- { { (unichar_t *) N_("_Revert File"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Revert File|Ctl+Shft+R"), NULL, NULL, FVMenuRevert, MID_Revert },
- { { (unichar_t *) N_("Revert To _Backup"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Revert To Backup|No Shortcut"), NULL, NULL, FVMenuRevertBackup, MID_RevertToBackup },
- { { (unichar_t *) N_("Revert Gl_yph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Revert Glyph|Alt+Ctl+R"), NULL, NULL, FVMenuRevertGlyph, MID_RevertGlyph },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Print..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Print...|Ctl+P"), NULL, NULL, FVMenuPrint, MID_Print },
- { { (unichar_t *) N_("_Display..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, H_("Display...|Alt+Ctl+P"), NULL, NULL, FVMenuDisplay, MID_Display },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
-#if !defined(_NO_FFSCRIPT) || !defined(_NO_PYTHON)
- { { (unichar_t *) N_("E_xecute Script..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'x' }, H_("Execute Script...|Ctl+."), NULL, NULL, FVMenuExecute },
- { { (unichar_t *) N_("Script Menu"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Script Menu|No Shortcut"), dummyitem, MenuScriptsBuild, NULL, MID_ScriptMenu },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
-#endif
- { { (unichar_t *) N_("Pr_eferences..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'e' }, H_("Preferences...|No Shortcut"), NULL, NULL, MenuPrefs },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Quit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'Q' }, H_("Quit|Ctl+Q"), NULL, NULL, FVMenuExit },
- { NULL }
-};
-
-static GMenuItem2 cflist[] = {
- { { (unichar_t *) N_("_All Fonts"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'A' }, H_("All Fonts|No Shortcut"), NULL, NULL, FVMenuCopyFrom, MID_AllFonts },
- { { (unichar_t *) N_("_Displayed Font"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'D' }, H_("Displayed Font|No Shortcut"), NULL, NULL, FVMenuCopyFrom, MID_DisplayedFont },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Glyph _Metadata"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'N' }, H_("Glyph Metadata|No Shortcut"), NULL, NULL, FVMenuCopyFrom, MID_CharName },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_TrueType Instructions"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'N' }, H_("TrueType Instructions|No Shortcut"), NULL, NULL, FVMenuCopyFrom, MID_TTFInstr },
- { NULL }
-};
-
-static GMenuItem2 sclist[] = {
- { { (unichar_t *) N_("Color|Default"), &def_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) COLOR_DEFAULT, NULL, 0, 1, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Default|No Shortcut"), NULL, NULL, FVMenuSelectColor },
- { { NULL, &white_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0xffffff, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, '\0' }, NULL, NULL, NULL, FVMenuSelectColor },
- { { NULL, &red_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0xff0000, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, '\0' }, NULL, NULL, NULL, FVMenuSelectColor },
- { { NULL, &green_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0x00ff00, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, '\0' }, NULL, NULL, NULL, FVMenuSelectColor },
- { { NULL, &blue_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0x0000ff, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, '\0' }, NULL, NULL, NULL, FVMenuSelectColor },
- { { NULL, &yellow_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0xffff00, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, '\0' }, NULL, NULL, NULL, FVMenuSelectColor },
- { { NULL, &cyan_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0x00ffff, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, '\0' }, NULL, NULL, NULL, FVMenuSelectColor },
- { { NULL, &magenta_image, COLOR_DEFAULT, COLOR_DEFAULT, (void *) 0xff00ff, NULL, 0, 1, 0, 0, 0, 0, 0, 0, 0, '\0' }, NULL, NULL, NULL, FVMenuSelectColor },
- { NULL }
-};
-
-static GMenuItem2 sllist[] = {
- { { (unichar_t *) N_("Select _All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Select All|Ctl+A"), NULL, NULL, FVMenuSelectAll },
- { { (unichar_t *) N_("_Invert Selection"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Invert Selection|Ctl+Escape"), NULL, NULL, FVMenuInvertSelection },
- { { (unichar_t *) N_("_Deselect All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Deselect All|Escape"), NULL, NULL, FVMenuDeselectAll },
- { { (unichar_t *) N_("_Select by Color"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Select by Color|No Shortcut"), sclist },
- { { (unichar_t *) N_("Select by _Name..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Select by Name...|No Shortcut"), NULL, NULL, FVMenuSelectByName },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Glyphs Worth Outputting"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Glyphs Worth Outputting|No Shortcut"), NULL,NULL, FVMenuSelectWorthOutputting },
- { { (unichar_t *) N_("_Changed Glyphs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Changed Glyphs|No Shortcut"), NULL,NULL, FVMenuSelectChanged },
- { { (unichar_t *) N_("_Hinting Needed"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Hinting Needed|No Shortcut"), NULL,NULL, FVMenuSelectHintingNeeded },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Selec_t By Lookup Subtable..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Select By Lookup Subtable...|No Shortcut"), NULL, NULL, FVMenuSelectByPST },
- { NULL }
-};
-
-static GMenuItem2 edlist[] = {
- { { (unichar_t *) N_("_Undo"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 1, 0, 0, 0, 0, 0, 1, 1, 0, 'U' }, H_("Undo|Ctl+Z"), NULL, NULL, FVMenuUndo, MID_Undo },
- { { (unichar_t *) N_("_Redo"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 1, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Redo|Ctl+Y"), NULL, NULL, FVMenuRedo, MID_Redo},
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Cu_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, H_("Cut|Ctl+X"), NULL, NULL, FVMenuCut, MID_Cut },
- { { (unichar_t *) N_("_Copy"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Copy|Ctl+C"), NULL, NULL, FVMenuCopy, MID_Copy },
- { { (unichar_t *) N_("C_opy Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Copy Reference|Ctl+G"), NULL, NULL, FVMenuCopyRef, MID_CopyRef },
- { { (unichar_t *) N_("Copy _Lookup Data"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Copy Lookup Data|Alt+Ctl+C"), NULL, NULL, FVMenuCopyLookupData, MID_CopyLookupData },
- { { (unichar_t *) N_("Copy _Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, H_("Copy Width|Ctl+W"), NULL, NULL, FVMenuCopyWidth, MID_CopyWidth },
- { { (unichar_t *) N_("Copy _VWidth"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("Copy VWidth|No Shortcut"), NULL, NULL, FVMenuCopyWidth, MID_CopyVWidth },
- { { (unichar_t *) N_("Co_py LBearing"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'p' }, H_("Copy LBearing|No Shortcut"), NULL, NULL, FVMenuCopyWidth, MID_CopyLBearing },
- { { (unichar_t *) N_("Copy RBearin_g"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'g' }, H_("Copy RBearing|No Shortcut"), NULL, NULL, FVMenuCopyWidth, MID_CopyRBearing },
- { { (unichar_t *) N_("_Paste"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Paste|Ctl+V"), NULL, NULL, FVMenuPaste, MID_Paste },
- { { (unichar_t *) N_("Paste Into"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Paste Into|Ctl+Shft+V"), NULL, NULL, FVMenuPasteInto, MID_PasteInto },
-#ifdef FONTFORGE_CONFIG_PASTEAFTER
- { { (unichar_t *) N_("Paste After"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Paste After|Alt+Ctl+Shft+V"), NULL, NULL, FVMenuPasteAfter, MID_PasteAfter },
-#endif
- { { (unichar_t *) N_("Sa_me Glyph As"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'm' }, H_("Same Glyph As|No Shortcut"), NULL, NULL, FVMenuSameGlyphAs, MID_SameGlyphAs },
- { { (unichar_t *) N_("C_lear"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, H_("Clear|No Shortcut"), NULL, NULL, FVMenuClear, MID_Clear },
- { { (unichar_t *) N_("Clear _Background"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Clear Background|No Shortcut"), NULL, NULL, FVMenuClearBackground, MID_ClearBackground },
- { { (unichar_t *) N_("Copy _Fg To Bg"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Copy Fg To Bg|Ctl+Shft+C"), NULL, NULL, FVMenuCopyFgBg, MID_CopyFgToBg },
- { { (unichar_t *) N_("_Join"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'J' }, H_("Join|Ctl+Shft+J"), NULL, NULL, FVMenuJoin, MID_Join },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Select"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, NULL, sllist, sllistcheck },
- { { (unichar_t *) N_("F_ind / Replace..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'i' }, H_("Find / Replace...|Alt+Ctl+F"), NULL, NULL, FVMenuFindRpl },
- { { (unichar_t *) N_("Replace with Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'i' }, H_("Replace with Reference|Alt+Ctl+Shft+F"), NULL, NULL, FVMenuReplaceWithRef, MID_RplRef },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("U_nlink Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'U' }, H_("Unlink Reference|Ctl+U"), NULL, NULL, FVMenuUnlinkRef, MID_UnlinkRef },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Copy _From"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, NULL, cflist, cflistcheck, NULL, 0 },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Remo_ve Undoes"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'e' }, H_("Remove Undoes|No Shortcut"), NULL, NULL, FVMenuRemoveUndoes, MID_RemoveUndoes },
- { NULL }
-};
-
-static GMenuItem2 smlist[] = {
- { { (unichar_t *) N_("_Simplify"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Simplify|Ctl+Shft+M"), NULL, NULL, FVMenuSimplify, MID_Simplify },
- { { (unichar_t *) N_("Simplify More..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Simplify More...|Alt+Ctl+Shft+M"), NULL, NULL, FVMenuSimplifyMore, MID_SimplifyMore },
- { { (unichar_t *) N_("Clea_nup Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Cleanup Glyph|No Shortcut"), NULL, NULL, FVMenuCleanup, MID_CleanupGlyph },
- { { (unichar_t *) N_("Canonical Start _Point"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Canonical Start Point|No Shortcut"), NULL, NULL, FVMenuCanonicalStart, MID_CanonicalStart },
- { { (unichar_t *) N_("Canonical _Contours"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'n' }, H_("Canonical Contours|No Shortcut"), NULL, NULL, FVMenuCanonicalContours, MID_CanonicalContours },
- { NULL }
-};
-
-static GMenuItem2 rmlist[] = {
- { { (unichar_t *) N_("_Remove Overlap"), &GIcon_rmoverlap, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'O' }, H_("Remove Overlap|Ctl+Shft+O"), NULL, NULL, FVMenuOverlap, MID_RmOverlap },
- { { (unichar_t *) N_("_Intersect"), &GIcon_intersection, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Intersect|No Shortcut"), NULL, NULL, FVMenuOverlap, MID_Intersection },
- { { (unichar_t *) N_("_Find Intersections"), &GIcon_findinter, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'O' }, H_("Find Intersections|No Shortcut"), NULL, NULL, FVMenuOverlap, MID_FindInter },
- { NULL }
-};
-
-static GMenuItem2 eflist[] = {
- { { (unichar_t *) N_("_Inline"), &GIcon_inline, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'O' }, H_("Inline|No Shortcut"), NULL, NULL, FVMenuInline },
- { { (unichar_t *) N_("_Outline"), &GIcon_outline, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Outline|No Shortcut"), NULL, NULL, FVMenuOutline },
- { { (unichar_t *) N_("_Shadow"), &GIcon_shadow, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Shadow|No Shortcut"), NULL, NULL, FVMenuShadow },
- { { (unichar_t *) N_("_Wireframe"), &GIcon_wireframe, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, true, 0, 0, 0, 0, 1, 1, 0, 'W' }, H_("Wireframe|No Shortcut"), NULL, NULL, FVMenuWireframe },
- { NULL }
-};
-
-static GMenuItem2 balist[] = {
- { { (unichar_t *) N_("_Build Accented Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Build Accented Glyph|Ctl+Shft+A"), NULL, NULL, FVMenuBuildAccent, MID_BuildAccent },
- { { (unichar_t *) N_("Build _Composite Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Build Composite Glyph|No Shortcut"), NULL, NULL, FVMenuBuildComposite, MID_BuildComposite },
- { { (unichar_t *) N_("Buil_d Duplicate Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Build Duplicate Glyph|No Shortcut"), NULL, NULL, FVMenuBuildDuplicate, MID_BuildDuplicates },
-#ifdef KOREAN
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) _STR_ShowGrp, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, NULL, NULL, NULL, FVMenuShowGroup },
-#endif
- { NULL }
-};
-
-static GMenuItem2 delist[] = {
- { { (unichar_t *) N_("_References..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'u' }, H_("References...|Alt+Ctl+I"), NULL, NULL, FVMenuShowDependentRefs, MID_ShowDependentRefs },
- { { (unichar_t *) N_("_Substitutions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Substitutions...|No Shortcut"), NULL, NULL, FVMenuShowDependentSubs, MID_ShowDependentSubs },
- { NULL }
-};
-
-static GMenuItem2 trlist[] = {
- { { (unichar_t *) N_("_Transform..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Transform...|No Shortcut"), NULL, NULL, FVMenuTransform, MID_Transform },
- { { (unichar_t *) N_("_Point of View Projection..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Point of View Projection...|Ctl+Shft+<"), NULL, NULL, FVMenuPOV, MID_POV },
- { { (unichar_t *) N_("_Non Linear Transform..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Non Linear Transform...|Ctl+Shft+|"), NULL, NULL, FVMenuNLTransform, MID_NLTransform },
- { NULL }
-};
-
-static GMenuItem2 rndlist[] = {
- { { (unichar_t *) N_("To _Int"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("To Int|Ctl+Shft+_"), NULL, NULL, FVMenuRound2Int, MID_Round },
- { { (unichar_t *) N_("To _Hundredths"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("To Hundredths|No Shortcut"), NULL, NULL, FVMenuRound2Hundredths, 0 },
- { { (unichar_t *) N_("_Cluster"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Cluster|No Shortcut"), NULL, NULL, FVMenuCluster },
- { NULL }
-};
-
-static GMenuItem2 ellist[] = {
- { { (unichar_t *) N_("_Font Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Font Info...|Ctl+Shft+F"), NULL, NULL, FVMenuFontInfo },
- { { (unichar_t *) N_("Glyph _Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Glyph Info...|Ctl+I"), NULL, NULL, FVMenuCharInfo, MID_CharInfo },
- { { (unichar_t *) N_("BDF Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("BDF Info...|No Shortcut"), NULL, NULL, FVMenuBDFInfo, MID_StrikeInfo },
- { { (unichar_t *) N_("S_how Dependent"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, NULL, delist, delistcheck },
- { { (unichar_t *) N_("Find Pr_oblems..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Find Problems...|Ctl+E"), NULL, NULL, FVMenuFindProblems, MID_FindProblems },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Bitm_ap Strikes Available..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Bitmap Strikes Available...|Ctl+Shft+B"), NULL, NULL, FVMenuBitmaps, MID_AvailBitmaps },
- { { (unichar_t *) N_("Regenerate _Bitmap Glyphs..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Regenerate Bitmap Glyphs...|Ctl+B"), NULL, NULL, FVMenuBitmaps, MID_RegenBitmaps },
- { { (unichar_t *) N_("Remove Bitmap Glyphs..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Remove Bitmap Glyphs...|No Shortcut"), NULL, NULL, FVMenuBitmaps, MID_RemoveBitmaps },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Transformations"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, NULL, trlist, trlistcheck, NULL, MID_Transform },
- { { (unichar_t *) N_("_Expand Stroke..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, H_("Expand Stroke...|Ctl+Shft+E"), NULL, NULL, FVMenuStroke, MID_Stroke },
-#ifdef FONTFORGE_CONFIG_TILEPATH
- { { (unichar_t *) N_("Tile _Path..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Tile Path...|No Shortcut"), NULL, NULL, FVMenuTilePath, MID_TilePath },
-#endif
- { { (unichar_t *) N_("O_verlap"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'O' }, NULL, rmlist, NULL, NULL, MID_RmOverlap },
- { { (unichar_t *) N_("_Simplify"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, NULL, smlist, NULL, NULL, MID_Simplify },
- { { (unichar_t *) N_("Add E_xtrema"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'x' }, H_("Add Extrema|Ctl+Shft+X"), NULL, NULL, FVMenuAddExtrema, MID_AddExtrema },
- { { (unichar_t *) N_("Roun_d"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, NULL, rndlist, NULL, NULL, MID_Round },
- { { (unichar_t *) N_("Effects"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, NULL, eflist, NULL, NULL, MID_Effects },
- { { (unichar_t *) N_("_Meta Font..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Meta Font...|Ctl+Shft+!"), NULL, NULL, FVMenuMetaFont, MID_MetaFont },
- { { (unichar_t *) N_("Autot_race"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'r' }, H_("Autotrace|Ctl+Shft+T"), NULL, NULL, FVMenuAutotrace, MID_Autotrace },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Correct Direction"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, H_("Correct Direction|Ctl+Shft+D"), NULL, NULL, FVMenuCorrectDir, MID_Correct },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("B_uild"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, NULL, balist, balistcheck, NULL, MID_BuildAccent },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Merge Fonts..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Merge Fonts...|No Shortcut"), NULL, NULL, FVMenuMergeFonts, MID_MergeFonts },
- { { (unichar_t *) N_("Interpo_late Fonts..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'p' }, H_("Interpolate Fonts...|No Shortcut"), NULL, NULL, FVMenuInterpFonts, MID_InterpolateFonts },
- { { (unichar_t *) N_("Compare Fonts..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'p' }, H_("Compare Fonts...|No Shortcut"), NULL, NULL, FVMenuCompareFonts, MID_FontCompare },
- { NULL }
-};
-
-static GMenuItem2 dummyall[] = {
- { { (unichar_t *) N_("All"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 1, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("All|No Shortcut"), NULL, NULL, NULL },
- NULL
-};
-
-/* Builds up a menu containing all the anchor classes */
-static void aplistbuild(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- extern void GMenuItemArrayFree(GMenuItem *mi);
-
- GMenuItemArrayFree(mi->sub);
- mi->sub = NULL;
-
- _aplistbuild(mi,fv->sf,FVMenuAnchorPairs);
-}
-
-static GMenuItem2 cblist[] = {
- { { (unichar_t *) N_("_Kern Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("Kern Pairs|No Shortcut"), NULL, NULL, FVMenuKernPairs, MID_KernPairs },
- { { (unichar_t *) N_("_Anchored Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("Anchored Pairs|No Shortcut"), dummyall, aplistbuild, NULL, MID_AnchorPairs },
- { { (unichar_t *) N_("_Ligatures"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'L' }, H_("Ligatures|No Shortcut"), NULL, NULL, FVMenuLigatures, MID_Ligatures },
- NULL
-};
-
-static void cblistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- SplineFont *sf = fv->sf;
- int i, anyligs=0, anykerns=0, gid;
- PST *pst;
-
- if ( sf->kerns ) anykerns=true;
- for ( i=0; i<fv->map->enccount; ++i ) if ( (gid = fv->map->map[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- for ( pst=sf->glyphs[gid]->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type==pst_ligature ) {
- anyligs = true;
- if ( anykerns )
- break;
- }
- }
- if ( sf->glyphs[gid]->kerns!=NULL ) {
- anykerns = true;
- if ( anyligs )
- break;
- }
- }
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Ligatures:
- mi->ti.disabled = !anyligs;
- break;
- case MID_KernPairs:
- mi->ti.disabled = !anykerns;
- break;
- case MID_AnchorPairs:
- mi->ti.disabled = sf->anchor==NULL;
- break;
- }
- }
-}
-
-
-static GMenuItem2 gllist[] = {
- { { (unichar_t *) N_("_Glyph Image"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'K' }, H_("Glyph Image|No Shortcut"), NULL, NULL, FVMenuGlyphLabel, gl_glyph },
- { { (unichar_t *) N_("_Name"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'K' }, H_("Name|No Shortcut"), NULL, NULL, FVMenuGlyphLabel, gl_name },
- { { (unichar_t *) N_("_Unicode"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'L' }, H_("Unicode|No Shortcut"), NULL, NULL, FVMenuGlyphLabel, gl_unicode },
- { { (unichar_t *) N_("_Encoding Hex"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'L' }, H_("Encoding Hex|No Shortcut"), NULL, NULL, FVMenuGlyphLabel, gl_encoding },
- NULL
-};
-
-static void gllistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- mi->ti.checked = fv->glyphlabel == mi->mid;
- }
-}
-
-static GMenuItem2 emptymenu[] = {
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { NULL }
-};
-
-static void FVEncodingMenuBuild(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- extern void GMenuItemArrayFree(GMenuItem *mi);
-
- if ( mi->sub!=NULL ) {
- GMenuItemArrayFree(mi->sub);
- mi->sub = NULL;
- }
- mi->sub = GetEncodingMenu(FVMenuReencode,fv->map->enc);
-}
-
-static void FVForceEncodingMenuBuild(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- extern void GMenuItemArrayFree(GMenuItem *mi);
-
- if ( mi->sub!=NULL ) {
- GMenuItemArrayFree(mi->sub);
- mi->sub = NULL;
- }
- mi->sub = GetEncodingMenu(FVMenuForceEncode,fv->map->enc);
-}
-
-static void FVMenuAddUnencoded(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- char *ret, *end;
- int cnt, i;
- EncMap *map = fv->map;
-
- /* Add unused unencoded slots in the map */
- ret = gwwv_ask_string(_("Add Encoding Slots..."),"1",fv->cidmaster?_("How many CID slots do you wish to add?"):_("How many unencoded glyph slots do you wish to add?"));
- if ( ret==NULL )
-return;
- cnt = strtol(ret,&end,10);
- if ( *end!='\0' || cnt<=0 ) {
- free(ret);
- gwwv_post_error( _("Bad Number"),_("Bad Number") );
-return;
- }
- free(ret);
- if ( fv->normal!=NULL ) {
- /* If it's compacted, lose the base encoding and the fact that it's */
- /* compact and make it be custom. That's what Alexey Kryukov asked */
- /* for */
- EncMapFree(fv->normal);
- fv->normal = NULL;
- fv->map->enc = &custom;
- FVSetTitle(fv);
- }
- if ( fv->cidmaster ) {
- SplineFont *sf = fv->sf;
- FontView *fvs;
- if ( sf->glyphcnt+cnt<sf->glyphmax )
- sf->glyphs = grealloc(sf->glyphs,(sf->glyphmax = sf->glyphcnt+cnt+10)*sizeof(SplineChar *));
- memset(sf->glyphs+sf->glyphcnt,0,cnt*sizeof(SplineChar *));
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- EncMap *map = fvs->map;
- if ( map->enccount+cnt>=map->encmax )
- map->map = grealloc(map->map,(map->encmax += cnt+10)*sizeof(int));
- if ( sf->glyphcnt+cnt<map->backmax )
- map->backmap = grealloc(map->map,(map->backmax += cnt+10)*sizeof(int));
- for ( i=map->enccount; i<map->enccount+cnt; ++i )
- map->map[i] = map->backmap[i] = i;
- fvs->selected = grealloc(fvs->selected,(map->enccount+cnt));
- memset(fvs->selected+map->enccount,0,cnt);
- map->enccount += cnt;
- if ( fv->filled!=NULL ) {
- if ( fv->filled->glyphmax<sf->glyphmax )
- fv->filled->glyphs = grealloc(fv->filled->glyphs,(sf->glyphmax = sf->glyphcnt+cnt+10)*sizeof(BDFChar *));
- memset(fv->filled->glyphs+fv->filled->glyphcnt,0,cnt*sizeof(BDFChar *));
- fv->filled->glyphcnt = fv->filled->glyphmax = sf->glyphcnt+cnt;
- }
- }
- sf->glyphcnt += cnt;
- FontViewReformatAll(fv->sf);
- } else {
- if ( map->enccount+cnt>=map->encmax )
- map->map = grealloc(map->map,(map->encmax += cnt+10)*sizeof(int));
- for ( i=map->enccount; i<map->enccount+cnt; ++i )
- map->map[i] = -1;
- fv->selected = grealloc(fv->selected,(map->enccount+cnt));
- memset(fv->selected+map->enccount,0,cnt);
- map->enccount += cnt;
- FontViewReformatOne(fv);
- FVScrollToChar(fv,map->enccount-cnt);
- }
-}
-
-static void FVMenuRemoveUnused(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- SplineFont *sf = fv->sf;
- EncMap *map = fv->map;
- int oldcount = map->enccount;
- int gid, i;
- int flags = -1;
-
- for ( i=map->enccount-1; i>=0 && ((gid=map->map[i])==-1 || !SCWorthOutputting(sf->glyphs[gid]));
- --i ) {
- if ( gid!=-1 )
- SFRemoveGlyph(sf,sf->glyphs[gid],&flags);
- map->enccount = i;
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- /* We reduced the encoding, so don't really need to reallocate the selection */
- /* array. It's just bigger than it needs to be. */
- if ( oldcount!=map->enccount )
- FontViewReformatOne(fv);
-#endif
-}
-
-static void FVMenuCompact(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int oldcount = fv->map->enccount;
-
- if ( fv->normal!=NULL ) {
- EncMapFree(fv->map);
- fv->map = fv->normal;
- fv->normal = NULL;
- fv->selected = grealloc(fv->selected,fv->map->enccount);
- memset(fv->selected,0,fv->map->enccount);
- } else {
- /* We reduced the encoding, so don't really need to reallocate the selection */
- /* array. It's just bigger than it needs to be. */
- fv->normal = EncMapCopy(fv->map);
- CompactEncMap(fv->map,fv->sf);
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( oldcount!=fv->map->enccount )
- FontViewReformatOne(fv);
- FVSetTitle(fv);
-#endif
-}
-
-static void FVMenuDetachGlyphs(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int i, j, gid;
- EncMap *map = fv->map;
- int altered = false;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontView *fvs;
-#endif
- SplineFont *sf = fv->sf;
-
- for ( i=0; i<map->enccount; ++i ) if ( fv->selected[i] && (gid=map->map[i])!=-1 ) {
- altered = true;
- map->map[i] = -1;
- if ( map->backmap[gid]==i ) {
- for ( j=map->enccount-1; j>=0 && map->map[j]!=gid; --j );
- map->backmap[gid] = j;
- }
- if ( sf->glyphs[gid]!=NULL && sf->glyphs[gid]->altuni != NULL && map->enc!=&custom )
- AltUniRemove(sf->glyphs[gid],UniFromEnc(i,map->enc));
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( altered )
- for ( fvs = fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- GDrawRequestExpose(fvs->v,NULL,false);
-#endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuDetachAndRemoveGlyphs(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- char *buts[3];
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_DetachAndRemoveGlyphs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- static char *buts[] = { GTK_STOCK_REMOVE, GTK_STOCK_CANCEL, NULL };
-# endif
- int i, j, gid;
- EncMap *map = fv->map;
- SplineFont *sf = fv->sf;
- int flags = -1;
- int changed = false, altered = false;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontView *fvs;
-#endif
-
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[0] = _("_Remove");
- buts[1] = _("_Cancel");
- buts[2] = NULL;
-#endif
-
- if ( gwwv_ask(_("Detach & Remo_ve Glyphs..."),(const char **) buts,0,1,_("Are you sure you wish to remove these glyphs? This operation cannot be undone."))==1 )
-return;
-
- for ( i=0; i<map->enccount; ++i ) if ( fv->selected[i] && (gid=map->map[i])!=-1 ) {
- altered = true;
- map->map[i] = -1;
- if ( map->backmap[gid]==i ) {
- for ( j=map->enccount-1; j>=0 && map->map[j]!=gid; --j );
- map->backmap[gid] = j;
- if ( j==-1 ) {
- SFRemoveGlyph(sf,sf->glyphs[gid],&flags);
- changed = true;
- } else if ( sf->glyphs[gid]!=NULL && sf->glyphs[gid]->altuni != NULL && map->enc!=&custom )
- AltUniRemove(sf->glyphs[gid],UniFromEnc(i,map->enc));
- }
- }
- if ( changed && !fv->sf->changed ) {
- fv->sf->changed = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- for ( fvs = sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- FVSetTitle(fvs);
-#endif
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( altered )
- for ( fvs = sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- GDrawRequestExpose(fvs->v,NULL,false);
-#endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuAddEncodingName(GWindow gw,struct gmenuitem *mi, GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_AddEncodingName(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- char *ret;
- Encoding *enc;
-
- /* Search the iconv database for the named encoding */
- ret = gwwv_ask_string(_("Add Encoding Name..."),NULL,_("Please provide the name of an encoding in the iconv database which you want in the menu."));
- if ( ret==NULL )
-return;
- enc = FindOrMakeEncoding(ret);
- if ( enc==NULL )
- gwwv_post_error(_("Invalid Encoding"),_("Invalid Encoding"));
- free(ret);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuLoadEncoding(GWindow gw,struct gmenuitem *mi, GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_LoadEncoding(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- LoadEncodingFile();
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuMakeFromFont(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_MakeFromFont(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- (void) MakeEncoding(fv->sf,fv->map);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuRemoveEncoding(GWindow gw,struct gmenuitem *mi, GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RemoveEncoding(GtkMenuItem *menuitem, gpointer user_data) {
-# endif
- RemoveEncoding();
-}
-
-static int isuniname(char *name) {
- int i;
- if ( name[0]!='u' || name[1]!='n' || name[2]!='i' )
-return( false );
- for ( i=3; i<7; ++i )
- if ( name[i]<'0' || (name[i]>'9' && name[i]<'A') || name[i]>'F' )
-return( false );
- if ( name[7]!='\0' )
-return( false );
-
-return( true );
-}
-
-static int isuname(char *name) {
- int i;
- if ( name[0]!='u' )
-return( false );
- for ( i=1; i<5; ++i )
- if ( name[i]<'0' || (name[i]>'9' && name[i]<'A') || name[i]>'F' )
-return( false );
- if ( name[5]!='\0' )
-return( false );
-
-return( true );
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuMakeNamelist(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_MakeNamelist(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- gsize read, written;
-# endif
- char buffer[1025];
- char *filename, *temp;
- FILE *file;
- SplineChar *sc;
- int i;
-
- snprintf(buffer, sizeof(buffer),"%s/%s.nam", getPfaEditDir(buffer), fv->sf->fontname );
-# ifdef FONTFORGE_CONFIG_GDRAW
- temp = def2utf8_copy(buffer);
-# elif defined(FONTFORGE_CONFIG_GTK)
- temp = g_filename_to_utf8(buffer,-1,&read,&written,NULL);
-#endif
- filename = gwwv_save_filename(_("Make Namelist"), temp,"*.nam");
- free(temp);
- if ( filename==NULL )
-return;
-# ifdef FONTFORGE_CONFIG_GDRAW
- temp = utf82def_copy(filename);
-# elif defined(FONTFORGE_CONFIG_GTK)
- temp = g_utf8_to_filename(filename,-1,&read,&written,NULL);
-#endif
- file = fopen(temp,"w");
- free(temp);
- if ( file==NULL ) {
- gwwv_post_error(_("Namelist creation failed"),_("Could not write %s"), filename);
- free(filename);
-return;
- }
- for ( i=0; i<fv->sf->glyphcnt; ++i ) {
- if ( (sc = fv->sf->glyphs[i])!=NULL && sc->unicodeenc!=-1 ) {
- if ( !isuniname(sc->name) && !isuname(sc->name ) )
- fprintf( file, "0x%04X %s\n", sc->unicodeenc, sc->name );
- }
- }
- fclose(file);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuLoadNamelist(GWindow gw,struct gmenuitem *mi, GEvent *e) {
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_LoadNamelist(GtkMenuItem *menuitem, gpointer user_data) {
- gsize read, written;
-# endif
- /* Read in a name list and copy it into the prefs dir so that we'll find */
- /* it in the future */
- /* Be prepared to update what we've already got if names match */
- char buffer[1025];
- char *ret = gwwv_open_filename(_("Load Namelist"),NULL,
- "*.nam",NULL);
- char *temp, *pt;
- char *buts[3];
- FILE *old, *new;
- int ch, ans;
- NameList *nl;
-
- if ( ret==NULL )
-return; /* Cancelled */
-# ifdef FONTFORGE_CONFIG_GDRAW
- temp = utf82def_copy(ret);
-# elif defined(FONTFORGE_CONFIG_GTK)
- temp = g_utf8_to_filename(ret,-1,&read,&written,NULL);
-#endif
- pt = strrchr(temp,'/');
- if ( pt==NULL )
- pt = temp;
- else
- ++pt;
- snprintf(buffer,sizeof(buffer),"%s/%s", getPfaEditDir(buffer), pt);
- if ( access(buffer,F_OK)==0 ) {
- buts[0] = _("_Replace");
-#if defined(FONTFORGE_CONFIG_GDRAW)
- buts[1] = _("_Cancel");
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[1] = GTK_STOCK_CANCEL;
-#endif
- buts[2] = NULL;
- ans = gwwv_ask( _("Replace"),(const char **) buts,0,1,_("A name list with this name already exists. Replace it?"));
- if ( ans==1 ) {
- free(temp);
- free(ret);
-return;
- }
- }
-
- old = fopen( temp,"r");
- if ( old==NULL ) {
- gwwv_post_error(_("No such file"),_("Could not read %s"), ret );
- free(ret); free(temp);
-return;
- }
- if ( (nl = LoadNamelist(temp))==NULL ) {
- gwwv_post_error(_("Bad namelist file"),_("Could not parse %s"), ret );
- free(ret); free(temp);
-return;
- }
- free(ret); free(temp);
- if ( nl->uses_unicode ) {
- if ( nl->a_utf8_name!=NULL )
- ff_post_notice(_("Non-ASCII glyphnames"),_("This namelist contains at least one non-ASCII glyph name, namely: %s"), nl->a_utf8_name );
- else
- ff_post_notice(_("Non-ASCII glyphnames"),_("This namelist is based on a namelist which contains non-ASCII glyph names"));
- }
-
- new = fopen( buffer,"w");
- if ( new==NULL ) {
- gwwv_post_error(_("Create failed"),_("Could not write %s"), buffer );
-return;
- }
-
- while ( (ch=getc(old))!=EOF )
- putc(ch,new);
- fclose(old);
- fclose(new);
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuRenameByNamelist(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_RenameByNamelist(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-# endif
- char **namelists = AllNamelistNames();
- int i;
- int ret;
- NameList *nl;
- extern int allow_utf8_glyphnames;
-
- for ( i=0; namelists[i]!=NULL; ++i );
- ret = gwwv_choose(_("Rename by NameList"),(const char **) namelists,i,0,_("Rename the glyphs in this font to the names found in the selected namelist"));
- if ( ret==-1 )
-return;
- nl = NameListByName(namelists[ret]);
- if ( nl==NULL ) {
- IError("Couldn't find namelist");
-return;
- } else if ( nl!=NULL && nl->uses_unicode && !allow_utf8_glyphnames) {
- gwwv_post_error(_("Namelist contains non-ASCII names"),_("Glyph names should be limited to characters in the ASCII character set, but there are names in this namelist which use characters outside that range."));
-return;
- }
- SFRenameGlyphsToNamelist(fv->sf,nl);
-# if defined(FONTFORGE_CONFIG_GDRAW)
- GDrawRequestExpose(fv->v,NULL,false);
-# elif defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_queue_draw(fv->v);
-# endif
-}
-
-# ifdef FONTFORGE_CONFIG_GDRAW
-static void FVMenuNameGlyphs(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_NameGlyphs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- gsize read, written;
-# endif
- /* Read a file containing a list of names, and add an unencoded glyph for */
- /* each name */
- char buffer[33];
- char *ret = gwwv_open_filename(_("Load glyph names"),NULL, "*",NULL);
- char *temp, *pt;
- FILE *file;
- int ch;
- SplineChar *sc;
- FontView *fvs;
-
- if ( ret==NULL )
-return; /* Cancelled */
-# ifdef FONTFORGE_CONFIG_GDRAW
- temp = utf82def_copy(ret);
-# elif defined(FONTFORGE_CONFIG_GTK)
- temp = g_utf8_to_filename(ret,-1,&read,&written,NULL);
-#endif
-
- file = fopen( temp,"r");
- if ( file==NULL ) {
- gwwv_post_error(_("No such file"),_("Could not read %s"), ret );
- free(ret); free(temp);
-return;
- }
- pt = buffer;
- forever {
- ch = getc(file);
- if ( ch!=EOF && !isspace(ch)) {
- if ( pt<buffer+sizeof(buffer)-1 )
- *pt++ = ch;
- } else {
- if ( pt!=buffer ) {
- *pt = '\0';
- sc = NULL;
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- EncMap *map = fvs->map;
- if ( map->enccount+1>=map->encmax )
- map->map = grealloc(map->map,(map->encmax += 20)*sizeof(int));
- map->map[map->enccount] = -1;
- fvs->selected = grealloc(fvs->selected,(map->enccount+1));
- memset(fvs->selected+map->enccount,0,1);
- ++map->enccount;
- if ( sc==NULL ) {
- sc = SFMakeChar(fv->sf,map,map->enccount-1);
- free(sc->name);
- sc->name = copy(buffer);
- sc->comment = copy("."); /* Mark as something for sfd file */
- /*SCLigDefault(sc);*/
- }
- map->map[map->enccount-1] = sc->orig_pos;
- map->backmap[sc->orig_pos] = map->enccount-1;
- }
- pt = buffer;
- }
- if ( ch==EOF )
- break;
- }
- }
- fclose(file);
- free(ret); free(temp);
- FontViewReformatAll(fv->sf);
-}
-
-static GMenuItem2 enlist[] = {
- { { (unichar_t *) N_("_Reencode"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, H_("Reencode|No Shortcut"), emptymenu, FVEncodingMenuBuild, NULL, MID_Reencode },
- { { (unichar_t *) N_("_Compact"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'C' }, H_("Compact|No Shortcut"), NULL, NULL, FVMenuCompact, MID_Compact },
- { { (unichar_t *) N_("_Force Encoding"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Force Encoding|No Shortcut"), emptymenu, FVForceEncodingMenuBuild, NULL, MID_ForceReencode },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Add Encoding Slots..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Add Encoding Slots...|No Shortcut"), NULL, NULL, FVMenuAddUnencoded, MID_AddUnencoded },
- { { (unichar_t *) N_("Remove _Unused Slots"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Remove Unused Slots|No Shortcut"), NULL, NULL, FVMenuRemoveUnused, MID_RemoveUnused },
- { { (unichar_t *) N_("_Detach Glyphs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Detach Glyphs|No Shortcut"), NULL, NULL, FVMenuDetachGlyphs, MID_DetachGlyphs },
- { { (unichar_t *) N_("Detach & Remo_ve Glyphs..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Detach & Remove Glyphs...|No Shortcut"), NULL, NULL, FVMenuDetachAndRemoveGlyphs, MID_DetachAndRemoveGlyphs },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Add E_ncoding Name..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Add Encoding Name...|No Shortcut"), NULL, NULL, FVMenuAddEncodingName },
- { { (unichar_t *) N_("_Load Encoding..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Load Encoding...|No Shortcut"), NULL, NULL, FVMenuLoadEncoding, MID_LoadEncoding },
- { { (unichar_t *) N_("Ma_ke From Font..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Make From Font...|No Shortcut"), NULL, NULL, FVMenuMakeFromFont, MID_MakeFromFont },
- { { (unichar_t *) N_("Remove En_coding..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Remove Encoding...|No Shortcut"), NULL, NULL, FVMenuRemoveEncoding, MID_RemoveEncoding },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Display By _Groups..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Display By Groups...|No Shortcut"), NULL, NULL, FVMenuDisplayByGroups, MID_DisplayByGroups },
- { { (unichar_t *) N_("D_efine Groups..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Define Groups...|No Shortcut"), NULL, NULL, FVMenuDefineGroups },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Save Namelist of Font..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Save Namelist of Font...|No Shortcut"), NULL, NULL, FVMenuMakeNamelist, MID_SaveNamelist },
- { { (unichar_t *) N_("L_oad Namelist..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Load Namelist...|No Shortcut"), NULL, NULL, FVMenuLoadNamelist },
- { { (unichar_t *) N_("Rename Gl_yphs..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Rename Glyphs...|No Shortcut"), NULL, NULL, FVMenuRenameByNamelist, MID_RenameGlyphs },
- { { (unichar_t *) N_("Cre_ate Named Glyphs..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Create Named Glyphs...|No Shortcut"), NULL, NULL, FVMenuNameGlyphs, MID_NameGlyphs },
- { NULL }
-};
-
-static void enlistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int i, gid;
- SplineFont *sf = fv->sf;
- EncMap *map = fv->map;
- int anyglyphs = false;
-
- for ( i=map->enccount-1; i>=0 ; --i )
- if ( fv->selected[i] && (gid=map->map[i])!=-1 )
- anyglyphs = true;
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Compact:
- mi->ti.checked = fv->normal!=NULL;
- break;
- case MID_Reencode: case MID_ForceReencode:
- mi->ti.disabled = fv->cidmaster!=NULL;
- break;
-#if 0
- case MID_AddUnencoded:
- mi->ti.disabled = fv->normal!=NULL;
- break;
-#endif
- case MID_DetachGlyphs: case MID_DetachAndRemoveGlyphs:
- mi->ti.disabled = !anyglyphs;
- break;
- case MID_RemoveUnused:
- gid = map->map[map->enccount-1];
- mi->ti.disabled = gid!=-1 && SCWorthOutputting(sf->glyphs[gid]);
- break;
- case MID_MakeFromFont:
- mi->ti.disabled = fv->cidmaster!=NULL || map->enccount>1024;
- break;
- case MID_RemoveEncoding:
- break;
- case MID_DisplayByGroups:
- mi->ti.disabled = fv->cidmaster!=NULL || group_root==NULL;
- break;
- case MID_NameGlyphs:
- mi->ti.disabled = fv->normal!=NULL || fv->cidmaster!=NULL;
- break;
- case MID_RenameGlyphs: case MID_SaveNamelist:
- mi->ti.disabled = fv->cidmaster!=NULL;
- break;
- }
- }
-}
-
-static GMenuItem2 vwlist[] = {
- { { (unichar_t *) N_("_Next Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'N' }, H_("Next Glyph|Ctl+]"), NULL, NULL, FVMenuChangeChar, MID_Next },
- { { (unichar_t *) N_("_Prev Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Prev Glyph|Ctl+["), NULL, NULL, FVMenuChangeChar, MID_Prev },
- { { (unichar_t *) N_("Next _Defined Glyph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, H_("Next Defined Glyph|Alt+Ctl+]"), NULL, NULL, FVMenuChangeChar, MID_NextDef },
- { { (unichar_t *) N_("Prev Defined Gl_yph"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'a' }, H_("Prev Defined Glyph|Alt+Ctl+["), NULL, NULL, FVMenuChangeChar, MID_PrevDef },
- { { (unichar_t *) N_("_Goto"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'G' }, H_("Goto|Ctl+Shft+>"), NULL, NULL, FVMenuGotoChar },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Show ATT"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, H_("Show ATT|No Shortcut"), NULL, NULL, FVMenuShowAtt },
- { { (unichar_t *) N_("Display S_ubstitutions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'u' }, H_("Display Substitutions...|No Shortcut"), NULL, NULL, FVMenuDisplaySubs, MID_DisplaySubs },
- { { (unichar_t *) N_("Com_binations"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'b' }, NULL, cblist, cblistcheck },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Label Glyph By"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'b' }, NULL, gllist, gllistcheck },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("S_how H. Metrics..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("Show H. Metrics...|No Shortcut"), NULL, NULL, FVMenuShowMetrics, MID_ShowHMetrics },
- { { (unichar_t *) N_("Show _V. Metrics..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("Show V. Metrics...|No Shortcut"), NULL, NULL, FVMenuShowMetrics, MID_ShowVMetrics },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("32x8 cell window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '2' }, H_("32x8 cell window|Ctl+Shft+%"), NULL, NULL, FVMenuWSize, MID_32x8 },
- { { (unichar_t *) N_("1_6x4 cell window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '3' }, H_("16x4 cell window|Ctl+Shft+^"), NULL, NULL, FVMenuWSize, MID_16x4 },
- { { (unichar_t *) N_("_8x2 cell window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '3' }, H_("8x2 cell window|Ctl+Shft+*"), NULL, NULL, FVMenuWSize, MID_8x2 },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_24 pixel outline"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '2' }, H_("24 pixel outline|Ctl+2"), NULL, NULL, FVMenuSize, MID_24 },
- { { (unichar_t *) N_("_36 pixel outline"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '3' }, H_("36 pixel outline|Ctl+3"), NULL, NULL, FVMenuSize, MID_36 },
- { { (unichar_t *) N_("_48 pixel outline"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '4' }, H_("48 pixel outline|Ctl+4"), NULL, NULL, FVMenuSize, MID_48 },
- { { (unichar_t *) N_("_72 pixel outline"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '4' }, H_("72 pixel outline|Ctl+7"), NULL, NULL, FVMenuSize, MID_72 },
- { { (unichar_t *) N_("_96 pixel outline"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, '4' }, H_("96 pixel outline|Ctl+9"), NULL, NULL, FVMenuSize, MID_96 },
- { { (unichar_t *) N_("_Anti Alias"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'A' }, H_("Anti Alias|Ctl+5"), NULL, NULL, FVMenuSize, MID_AntiAlias },
- { { (unichar_t *) N_("_Fit to em"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'F' }, H_("Fit to em|Ctl+6"), NULL, NULL, FVMenuSize, MID_FitToEm },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Bitmap _Magnification..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 1, 0, 0, 0, 1, 1, 0, 'F' }, H_("Bitmap Magnification...|No Shortcut"), NULL, NULL, FVMenuMagnify, MID_BitmapMag },
- { NULL }, /* Some extra room to show bitmaps */
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }
-};
-
-static void vwlistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int anychars = FVAnyCharSelected(fv);
- int i, base;
- BDFFont *bdf;
- char buffer[50];
- extern void GMenuItemArrayFree(GMenuItem *mi);
- extern GMenuItem *GMenuItem2ArrayCopy(GMenuItem2 *mi, uint16 *cnt);
- int pos;
- SplineFont *sf = fv->sf;
- EncMap *map = fv->map;
- OTLookup *otl;
-
- for ( i=0; vwlist[i].ti.text==NULL || strcmp((char *) vwlist[i].ti.text, _("Bitmap _Magnification..."))!=0; ++i );
- base = i+1;
- for ( i=base; vwlist[i].ti.text!=NULL; ++i ) {
- free( vwlist[i].ti.text);
- vwlist[i].ti.text = NULL;
- }
-
- vwlist[base-1].ti.disabled = true;
- if ( sf->bitmaps!=NULL ) {
- for ( bdf = sf->bitmaps, i=base;
- i<sizeof(vwlist)/sizeof(vwlist[0])-1 && bdf!=NULL;
- ++i, bdf = bdf->next ) {
- if ( BDFDepth(bdf)==1 )
- sprintf( buffer, _("%d pixel bitmap"), bdf->pixelsize );
- else
- sprintf( buffer, _("%d@%d pixel bitmap"),
- bdf->pixelsize, BDFDepth(bdf) );
- vwlist[i].ti.text = (unichar_t *) uc_copy(buffer);
- vwlist[i].ti.checkable = true;
- vwlist[i].ti.checked = bdf==fv->show;
- vwlist[i].ti.userdata = bdf;
- vwlist[i].invoke = FVMenuShowBitmap;
- vwlist[i].ti.fg = vwlist[i].ti.bg = COLOR_DEFAULT;
- if ( bdf==fv->show )
- vwlist[base-1].ti.disabled = false;
- }
- }
- GMenuItemArrayFree(mi->sub);
- mi->sub = GMenuItem2ArrayCopy(vwlist,NULL);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Next: case MID_Prev:
- mi->ti.disabled = anychars<0;
- break;
- case MID_NextDef:
- pos = anychars+1;
- if ( anychars<0 ) pos = map->enccount;
- for ( ; pos<map->enccount &&
- (map->map[pos]==-1 || !SCWorthOutputting(sf->glyphs[map->map[pos]]));
- ++pos );
- mi->ti.disabled = pos==map->enccount;
- break;
- case MID_PrevDef:
- for ( pos = anychars-1; pos>=0 &&
- (map->map[pos]==-1 || !SCWorthOutputting(sf->glyphs[map->map[pos]]));
- --pos );
- mi->ti.disabled = pos<0;
- break;
- case MID_DisplaySubs: { SplineFont *_sf = sf;
- mi->ti.checked = fv->cur_subtable!=NULL;
- if ( _sf->cidmaster ) _sf = _sf->cidmaster;
- for ( otl=_sf->gsub_lookups; otl!=NULL; otl=otl->next )
- if ( otl->lookup_type == gsub_single && otl->subtables!=NULL )
- break;
- mi->ti.disabled = otl==NULL;
- } break;
- case MID_ShowHMetrics:
- /*mi->ti.checked = fv->showhmetrics;*/
- break;
- case MID_ShowVMetrics:
- /*mi->ti.checked = fv->showvmetrics;*/
- mi->ti.disabled = !sf->hasvmetrics;
- break;
- case MID_32x8:
- mi->ti.checked = (fv->rowcnt==8 && fv->colcnt==32);
- break;
- case MID_16x4:
- mi->ti.checked = (fv->rowcnt==4 && fv->colcnt==16);
- break;
- case MID_8x2:
- mi->ti.checked = (fv->rowcnt==2 && fv->colcnt==8);
- break;
- case MID_24:
- mi->ti.checked = (fv->show!=NULL && fv->show==fv->filled && fv->show->pixelsize==24);
- mi->ti.disabled = sf->onlybitmaps && fv->show!=fv->filled;
- break;
- case MID_36:
- mi->ti.checked = (fv->show!=NULL && fv->show==fv->filled && fv->show->pixelsize==36);
- mi->ti.disabled = sf->onlybitmaps && fv->show!=fv->filled;
- break;
- case MID_48:
- mi->ti.checked = (fv->show!=NULL && fv->show==fv->filled && fv->show->pixelsize==48);
- mi->ti.disabled = sf->onlybitmaps && fv->show!=fv->filled;
- break;
- case MID_72:
- mi->ti.checked = (fv->show!=NULL && fv->show==fv->filled && fv->show->pixelsize==72);
- mi->ti.disabled = sf->onlybitmaps && fv->show!=fv->filled;
- break;
- case MID_96:
- mi->ti.checked = (fv->show!=NULL && fv->show==fv->filled && fv->show->pixelsize==96);
- mi->ti.disabled = sf->onlybitmaps && fv->show!=fv->filled;
- break;
- case MID_AntiAlias:
- mi->ti.checked = (fv->show!=NULL && fv->show->clut!=NULL);
- mi->ti.disabled = sf->onlybitmaps && fv->show!=fv->filled;
- break;
- case MID_FitToEm:
- mi->ti.checked = (fv->show!=NULL && !fv->show->bbsized);
- mi->ti.disabled = sf->onlybitmaps && fv->show!=fv->filled;
- break;
- }
- }
-}
-
-static GMenuItem2 histlist[] = {
- { { (unichar_t *) N_("_HStem"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("HStem|No Shortcut"), NULL, NULL, FVMenuHistograms, MID_HStemHist },
- { { (unichar_t *) N_("_VStem"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("VStem|No Shortcut"), NULL, NULL, FVMenuHistograms, MID_VStemHist },
- { { (unichar_t *) N_("BlueValues"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("BlueValues|No Shortcut"), NULL, NULL, FVMenuHistograms, MID_BlueValuesHist },
- { NULL }
-};
-
-static GMenuItem2 htlist[] = {
- { { (unichar_t *) N_("Auto_Hint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("AutoHint|Ctl+Shft+H"), NULL, NULL, FVMenuAutoHint, MID_AutoHint },
- { { (unichar_t *) N_("Hint _Substitution Pts"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("Hint Substitution Pts|No Shortcut"), NULL, NULL, FVMenuAutoHintSubs, MID_HintSubsPt },
- { { (unichar_t *) N_("Auto _Counter Hint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("Auto Counter Hint|No Shortcut"), NULL, NULL, FVMenuAutoCounter, MID_AutoCounter },
- { { (unichar_t *) N_("_Don't AutoHint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("Don't AutoHint|No Shortcut"), NULL, NULL, FVMenuDontAutoHint, MID_DontAutoHint },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Auto_Instr"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("AutoInstr|Ctl+T"), NULL, NULL, FVMenuAutoInstr, MID_AutoInstr },
- { { (unichar_t *) N_("_Edit Instructions..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, H_("Edit Instructions...|No Shortcut"), NULL, NULL, FVMenuEditInstrs, MID_EditInstructions },
- { { (unichar_t *) N_("Edit 'fpgm'..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Edit 'fpgm'...|No Shortcut"), NULL, NULL, FVMenuEditTable, MID_Editfpgm },
- { { (unichar_t *) N_("Edit 'prep'..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Edit 'prep'...|No Shortcut"), NULL, NULL, FVMenuEditTable, MID_Editprep },
- { { (unichar_t *) N_("Edit 'maxp'..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Edit 'maxp'...|No Shortcut"), NULL, NULL, FVMenuEditTable, MID_Editmaxp },
- { { (unichar_t *) N_("Edit 'cvt '..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Edit 'cvt '...|No Shortcut"), NULL, NULL, FVMenuEditTable, MID_Editcvt },
- { { (unichar_t *) N_("Private to 'cvt'"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Private to 'cvt'|No Shortcut"), NULL, NULL, FVMenuPrivateToCvt, MID_PrivateToCvt },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Clear Hints"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Clear Hints|No Shortcut"), NULL, NULL, FVMenuClearHints, MID_ClearHints },
- { { (unichar_t *) N_("Clear _Width MD"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Clear Width MD|No Shortcut"), NULL, NULL, FVMenuClearWidthMD, MID_ClearWidthMD },
- { { (unichar_t *) N_("Clear Instructions"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Clear Instructions|No Shortcut"), NULL, NULL, FVMenuClearInstrs, MID_ClearInstrs },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Histograms"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, H_("Histograms|No Shortcut"), histlist },
- { NULL }
-};
-
-static GMenuItem2 mtlist[] = {
- { { (unichar_t *) N_("_Center in Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Center in Width|No Shortcut"), NULL, NULL, FVMenuCenter, MID_Center },
- { { (unichar_t *) N_("_Thirds in Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, H_("Thirds in Width|No Shortcut"), NULL, NULL, FVMenuCenter, MID_Thirds },
- { { (unichar_t *) N_("Set _Width..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, H_("Set Width...|Ctl+Shft+L"), NULL, NULL, FVMenuSetWidth, MID_SetWidth },
- { { (unichar_t *) N_("Set _LBearing..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'L' }, H_("Set LBearing...|Ctl+L"), NULL, NULL, FVMenuSetWidth, MID_SetLBearing },
- { { (unichar_t *) N_("Set _RBearing..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Set RBearing...|Ctl+R"), NULL, NULL, FVMenuSetWidth, MID_SetRBearing },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Set _Vertical Advance..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, H_("Set Vertical Advance...|No Shortcut"), NULL, NULL, FVMenuSetWidth, MID_SetVWidth },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Auto Width..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("Auto Width...|Ctl+Shft+W"), NULL, NULL, FVMenuAutoWidth },
- { { (unichar_t *) N_("Auto _Kern..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("Auto Kern...|Ctl+Shft+K"), NULL, NULL, FVMenuAutoKern },
- { { (unichar_t *) N_("Ker_n By Classes..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("Kern By Classes...|No Shortcut"), NULL, NULL, FVMenuKernByClasses },
- { { (unichar_t *) N_("Remove All Kern _Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Remove All Kern Pairs|No Shortcut"), NULL, NULL, FVMenuRemoveKern, MID_RmHKern },
- { { (unichar_t *) N_("Kern Pair Closeup..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Kern Pair Closeup...|No Shortcut"), NULL, NULL, FVMenuKPCloseup },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("VKern By Classes..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'K' }, H_("VKern By Classes...|No Shortcut"), NULL, NULL, FVMenuVKernByClasses, MID_VKernByClass },
- { { (unichar_t *) N_("VKern From HKern"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("VKern From HKern|No Shortcut"), NULL, NULL, FVMenuVKernFromHKern, MID_VKernFromH },
- { { (unichar_t *) N_("Remove All VKern Pairs"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, H_("Remove All VKern Pairs|No Shortcut"), NULL, NULL, FVMenuRemoveVKern, MID_RmVKern },
- { NULL }
-};
-
-static GMenuItem2 cdlist[] = {
- { { (unichar_t *) N_("_Convert to CID"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Convert to CID|No Shortcut"), NULL, NULL, FVMenuConvert2CID, MID_Convert2CID },
- { { (unichar_t *) N_("Convert By C_Map"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, H_("Convert By CMap|No Shortcut"), NULL, NULL, FVMenuConvertByCMap, MID_ConvertByCMap },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Flatten"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("Flatten|No Shortcut"), NULL, NULL, FVMenuFlatten, MID_Flatten },
- { { (unichar_t *) N_("Fl_attenByCMap"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, H_("FlattenByCMap|No Shortcut"), NULL, NULL, FVMenuFlattenByCMap, MID_FlattenByCMap },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Insert F_ont..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, H_("Insert Font...|No Shortcut"), NULL, NULL, FVMenuInsertFont, MID_InsertFont },
- { { (unichar_t *) N_("Insert _Blank"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("Insert Blank|No Shortcut"), NULL, NULL, FVMenuInsertBlank, MID_InsertBlank },
- { { (unichar_t *) N_("_Remove Font"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'R' }, H_("Remove Font|No Shortcut"), NULL, NULL, FVMenuRemoveFontFromCID, MID_RemoveFromCID },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Change Supplement..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Change Supplement...|No Shortcut"), NULL, NULL, FVMenuChangeSupplement, MID_ChangeSupplement },
- { { (unichar_t *) N_("C_ID Font Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("CID Font Info...|No Shortcut"), NULL, NULL, FVMenuCIDFontInfo, MID_CIDFontInfo },
- { NULL }, /* Extra room to show sub-font names */
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL }, { NULL },
- { NULL }
-};
-
-static void cdlistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int i, base, j;
- extern void GMenuItemArrayFree(GMenuItem *mi);
- extern GMenuItem *GMenuItem2ArrayCopy(GMenuItem2 *mi, uint16 *cnt);
- SplineFont *sub, *cidmaster = fv->cidmaster;
-
- for ( i=0; cdlist[i].mid!=MID_CIDFontInfo; ++i );
- base = i+2;
- for ( i=base; cdlist[i].ti.text!=NULL; ++i ) {
- free( cdlist[i].ti.text);
- cdlist[i].ti.text = NULL;
- }
-
- cdlist[base-1].ti.fg = cdlist[base-1].ti.bg = COLOR_DEFAULT;
- if ( cidmaster==NULL ) {
- cdlist[base-1].ti.line = false;
- } else {
- cdlist[base-1].ti.line = true;
- for ( j = 0, i=base;
- i<sizeof(cdlist)/sizeof(cdlist[0])-1 && j<cidmaster->subfontcnt;
- ++i, ++j ) {
- sub = cidmaster->subfonts[j];
- cdlist[i].ti.text = uc_copy(sub->fontname);
- cdlist[i].ti.checkable = true;
- cdlist[i].ti.checked = sub==fv->sf;
- cdlist[i].ti.userdata = sub;
- cdlist[i].invoke = FVMenuShowSubFont;
- cdlist[i].ti.fg = cdlist[i].ti.bg = COLOR_DEFAULT;
- }
- }
- GMenuItemArrayFree(mi->sub);
- mi->sub = GMenuItem2ArrayCopy(cdlist,NULL);
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_Convert2CID: case MID_ConvertByCMap:
- mi->ti.disabled = cidmaster!=NULL || fv->sf->mm!=NULL;
- break;
- case MID_InsertFont: case MID_InsertBlank:
- /* OpenType allows at most 255 subfonts (PS allows more, but why go to the effort to make safe font check that? */
- mi->ti.disabled = cidmaster==NULL || cidmaster->subfontcnt>=255;
- break;
- case MID_RemoveFromCID:
- mi->ti.disabled = cidmaster==NULL || cidmaster->subfontcnt<=1;
- break;
- case MID_Flatten: case MID_FlattenByCMap: case MID_CIDFontInfo:
- case MID_ChangeSupplement:
- mi->ti.disabled = cidmaster==NULL;
- break;
- }
- }
-}
-
-static GMenuItem2 mmlist[] = {
-/* GT: Here (and following) MM means "MultiMaster" */
- { { (unichar_t *) N_("_Create MM..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Create MM...|No Shortcut"), NULL, NULL, FVMenuCreateMM, MID_CreateMM },
- { { (unichar_t *) N_("MM _Validity Check"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("MM Validity Check|No Shortcut"), NULL, NULL, FVMenuMMValid, MID_MMValid },
- { { (unichar_t *) N_("MM _Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("MM Info...|No Shortcut"), NULL, NULL, FVMenuMMInfo, MID_MMInfo },
- { { (unichar_t *) N_("_Blend to New Font..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Blend to New Font...|No Shortcut"), NULL, NULL, FVMenuBlendToNew, MID_BlendToNew },
- { { (unichar_t *) N_("MM Change Default _Weights..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("MM Change Default Weights...|No Shortcut"), NULL, NULL, FVMenuChangeMMBlend, MID_ChangeMMBlend },
- { NULL }, /* Extra room to show sub-font names */
-};
-
-static void mmlistcheck(GWindow gw,struct gmenuitem *mi, GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int i, base, j;
- extern void GMenuItemArrayFree(GMenuItem *mi);
- extern GMenuItem *GMenuItem2ArrayCopy(GMenuItem2 *mi, uint16 *cnt);
- MMSet *mm = fv->sf->mm;
- SplineFont *sub;
- GMenuItem2 *mml;
-
- for ( i=0; mmlist[i].mid!=MID_ChangeMMBlend; ++i );
- base = i+2;
- if ( mm==NULL )
- mml = mmlist;
- else {
- mml = gcalloc(base+mm->instance_count+2,sizeof(GMenuItem2));
- memcpy(mml,mmlist,sizeof(mmlist));
- mml[base-1].ti.fg = mml[base-1].ti.bg = COLOR_DEFAULT;
- mml[base-1].ti.line = true;
- for ( j = 0, i=base; j<mm->instance_count+1; ++i, ++j ) {
- if ( j==0 )
- sub = mm->normal;
- else
- sub = mm->instances[j-1];
- mml[i].ti.text = uc_copy(sub->fontname);
- mml[i].ti.checkable = true;
- mml[i].ti.checked = sub==fv->sf;
- mml[i].ti.userdata = sub;
- mml[i].invoke = FVMenuShowSubFont;
- mml[i].ti.fg = mml[i].ti.bg = COLOR_DEFAULT;
- }
- }
- GMenuItemArrayFree(mi->sub);
- mi->sub = GMenuItem2ArrayCopy(mml,NULL);
- if ( mml!=mmlist ) {
- for ( i=base; mml[i].ti.text!=NULL; ++i )
- free( mml[i].ti.text);
- free(mml);
- }
-
- for ( mi = mi->sub; mi->ti.text!=NULL || mi->ti.line ; ++mi ) {
- switch ( mi->mid ) {
- case MID_CreateMM:
- mi->ti.disabled = false;
- break;
- case MID_MMInfo: case MID_MMValid: case MID_BlendToNew:
- mi->ti.disabled = mm==NULL;
- break;
- case MID_ChangeMMBlend:
- mi->ti.disabled = mm==NULL || mm->apple;
- break;
- }
- }
-}
-
-static GMenuItem2 wnmenu[] = {
- { { (unichar_t *) N_("New O_utline Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'u' }, H_("New Outline Window|Ctl+H"), NULL, NULL, FVMenuOpenOutline, MID_OpenOutline },
- { { (unichar_t *) N_("New _Bitmap Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'B' }, H_("New Bitmap Window|Ctl+J"), NULL, NULL, FVMenuOpenBitmap, MID_OpenBitmap },
- { { (unichar_t *) N_("New _Metrics Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("New Metrics Window|Ctl+K"), NULL, NULL, FVMenuOpenMetrics },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Warnings"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, H_("Warnings|No Shortcut"), NULL, NULL, _MenuWarnings, MID_Warnings },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { NULL }
-};
-
-static void FVWindowMenuBuild(GWindow gw,struct gmenuitem *mi,GEvent *e) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
- int anychars = FVAnyCharSelected(fv);
- struct gmenuitem *wmi;
-
- WindowMenuBuild(gw,mi,e);
- for ( wmi = mi->sub; wmi->ti.text!=NULL || wmi->ti.line ; ++wmi ) {
- switch ( wmi->mid ) {
- case MID_OpenOutline:
- wmi->ti.disabled = anychars==-1;
- break;
- case MID_OpenBitmap:
- wmi->ti.disabled = anychars==-1 || fv->sf->bitmaps==NULL;
- break;
- case MID_Warnings:
- wmi->ti.disabled = ErrorWindowExists();
- break;
- }
- }
-}
-
-GMenuItem2 helplist[] = {
- { { (unichar_t *) N_("_Help"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, H_("Help|F1"), NULL, NULL, FVMenuContextualHelp },
- { { (unichar_t *) N_("_Overview"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Overview|Shft+F1"), NULL, NULL, MenuHelp },
- { { (unichar_t *) N_("_Index"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, H_("Index|Ctl+F1"), NULL, NULL, MenuIndex },
- { { (unichar_t *) N_("_About..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("About...|No Shortcut"), NULL, NULL, MenuAbout },
- { { (unichar_t *) N_("_License..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'A' }, H_("License...|No Shortcut"), NULL, NULL, MenuLicense },
- { NULL }
-};
-
-GMenuItem fvpopupmenu[] = {
- { { (unichar_t *) N_("Cu_t"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 't' }, '\0', ksm_control, NULL, NULL, FVMenuCut, MID_Cut },
- { { (unichar_t *) N_("_Copy"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, '\0', ksm_control, NULL, NULL, FVMenuCopy, MID_Copy },
- { { (unichar_t *) N_("C_opy Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'o' }, '\0', ksm_control, NULL, NULL, FVMenuCopyRef, MID_CopyRef },
- { { (unichar_t *) N_("Copy _Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, '\0', ksm_control, NULL, NULL, FVMenuCopyWidth, MID_CopyWidth },
- { { (unichar_t *) N_("_Paste"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'P' }, '\0', ksm_control, NULL, NULL, FVMenuPaste, MID_Paste },
- { { (unichar_t *) N_("C_lear"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, 0, 0, NULL, NULL, FVMenuClear, MID_Clear },
- { { (unichar_t *) N_("Copy _Fg To Bg"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuCopyFgBg, MID_CopyFgToBg },
- { { (unichar_t *) N_("U_nlink Reference"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'U' }, '\0', ksm_control, NULL, NULL, FVMenuUnlinkRef, MID_UnlinkRef },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Glyph _Info..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, '\0', ksm_control, NULL, NULL, FVMenuCharInfo, MID_CharInfo },
- { { (unichar_t *) N_("_Transform..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'T' }, '\0', ksm_control, NULL, NULL, FVMenuTransform, MID_Transform },
- { { (unichar_t *) N_("_Expand Stroke..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuStroke, MID_Stroke },
-/* { { (unichar_t *) N_("_Remove Overlap"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'O' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuOverlap, MID_RmOverlap },*/
-/* { { (unichar_t *) N_("_Simplify"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'S' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuSimplify, MID_Simplify },*/
-/* { { (unichar_t *) N_("Add E_xtrema"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'x' }, 'X', ksm_control|ksm_shift, NULL, NULL, FVMenuAddExtrema, MID_AddExtrema },*/
- { { (unichar_t *) N_("To _Int"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'I' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuRound2Int, MID_Round },
- { { (unichar_t *) N_("_Correct Direction"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'D' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuCorrectDir, MID_Correct },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("Auto_Hint"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuAutoHint, MID_AutoHint },
- { { NULL, NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 1, 0, 0, }},
- { { (unichar_t *) N_("_Center in Width"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, '\0', ksm_control, NULL, NULL, FVMenuCenter, MID_Center },
- { { (unichar_t *) N_("Set _Width..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuSetWidth, MID_SetWidth },
- { { (unichar_t *) N_("Set _Vertical Advance..."), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, '\0', ksm_control|ksm_shift, NULL, NULL, FVMenuSetWidth, MID_SetVWidth },
- { NULL }
-};
-
-static GMenuItem2 mblist[] = {
- { { (unichar_t *) N_("_File"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'F' }, NULL, fllist, fllistcheck },
- { { (unichar_t *) N_("_Edit"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'E' }, NULL, edlist, edlistcheck },
- { { (unichar_t *) N_("E_lement"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'l' }, NULL, ellist, ellistcheck },
- { { (unichar_t *) N_("H_ints"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'i' }, NULL, htlist, htlistcheck },
- { { (unichar_t *) N_("E_ncoding"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, NULL, enlist, enlistcheck },
- { { (unichar_t *) N_("_View"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'V' }, NULL, vwlist, vwlistcheck },
- { { (unichar_t *) N_("_Metrics"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'M' }, NULL, mtlist, mtlistcheck },
- { { (unichar_t *) N_("_CID"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'C' }, NULL, cdlist, cdlistcheck },
-/* GT: Here (and following) MM means "MultiMaster" */
- { { (unichar_t *) N_("MM"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, '\0' }, NULL, mmlist, mmlistcheck },
- { { (unichar_t *) N_("_Window"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'W' }, NULL, wnmenu, FVWindowMenuBuild, NULL },
- { { (unichar_t *) N_("_Help"), NULL, COLOR_DEFAULT, COLOR_DEFAULT, NULL, NULL, 0, 0, 0, 0, 0, 0, 1, 1, 0, 'H' }, NULL, helplist, NULL },
- { NULL }
-};
-# elif defined(FONTFORGE_CONFIG_GTK)
-void FontViewMenu_ActivateCopyFrom(GtkMenuItem *menuitem, gpointer user_data) {
- GtkWidget *w;
-
- w = lookup_widget( menuitem, "all_fonts1" );
- gtk_widget_set_sensitive(w,!onlycopydisplayed);
-
- w = lookup_widget( menuitem, "displayed_fonts1" );
- gtk_widget_set_sensitive(w,onlycopydisplayed);
-
- w = lookup_widget( menuitem, "char_metadata1" );
- gtk_widget_set_sensitive(w,copymetadata);
-}
-
-struct fv_any {
- FontView *fv;
- int anychars;
- void (*callback)(GtkWidget *w,gpointer user_data);
-};
-
-static void activate_file_items(GtkWidget *w, gpointer user_data) {
- struct fv_any *fv_any = (struct fv_any *) user_data;
- G_CONST_RETURN gchar *name = gtk_widget_get_name( GTK_WIDGET(w));
-
- if ( strcmp(name,"open_outline_window1")==0 )
- gtk_widget_set_sensitive(w,fv_any->anychars!=-1);
- else if ( strcmp(name,"open_bitmap_window1")==0 )
- gtk_widget_set_sensitive(w,fv_any->anychars!=-1 && fv_any->fv->sf->bitmaps!=NULL);
- else if ( strcmp(name,"revert_file1")==0 )
- gtk_widget_set_sensitive(w,fv_any->fv->sf->origname!=NULL);
- else if ( strcmp(name,"revert_glyph1")==0 )
- gtk_widget_set_sensitive(w,fv_any->anychars!=-1 && fv_any->fv->sf->origname!=NULL);
- else if ( strcmp(name,"recent1")==0 )
- gtk_widget_set_sensitive(w,RecentFilesAny());
- else if ( strcmp(name,"script_menu1")==0 )
- gtk_widget_set_sensitive(w,script_menu_names[0]!=NULL);
- else if ( strcmp(name,"print2")==0 )
- gtk_widget_set_sensitive(w,!fv_any->fv->onlybitmaps);
- else if ( strcmp(name,"display1")==0 )
- gtk_widget_set_sensitive(w,!((fv->sf->onlybitmaps && fv->sf->bitmaps==NULL) ||
- fv->sf->multilayer));
-}
-
-void FontViewMenu_ActivateFile(GtkMenuItem *menuitem, gpointer user_data) {
- struct fv_any data;
-
- data.fv = FV_From_MI(menuitem);
- data.anychars = FVAnyCharSelected(data.fv);
-
- gtk_container_foreach( GTK_CONTAINER( gtk_menu_item_get_submenu(menuitem )),
- activate_file_items, &data );
-}
-
-void FontViewMenu_ActivateEdit(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int pos = FVAnyCharSelected(fv), i;
- /* I can only determine the contents of the clipboard asyncronously */
- /* hence I can't check to see if it contains something that is pastable */
- /* So all I can do with paste is check that something is selected */
-#if 0
- int not_pasteable = pos==-1 ||
- (!CopyContainsSomething() &&
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/png") &&
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/svg") &&
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/bmp") &&
- !GDrawSelectionHasType(fv->gw,sn_clipboard,"image/eps"));
-#endif
- RefChar *base = CopyContainsRef(fv->sf);
- GtkWidget *w;
- int gid;
- static char *poslist[] = { "cut2", "copy2", "copy_reference1", "copy_width1",
- "copy_lbearing1", "copy_rbearing1", "paste2", "paste_into1",
- "paste_after1", "same_glyph_as1", "clear2", "clear_background1",
- "copy_fg_to_bg1", "join1", "replace_with_reference1",
- "unlink_reference1", "remove_undoes1", NULL };
-
- w = lookup_widget( menuitem, "undo2" );
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL ) {
- if ( fv->sf->glyphs[gid]->layers[ly_fore].undoes!=NULL )
- break;
- gtk_widget_set_sensitive(w,i!=fv->map->enccount);
-
- w = lookup_widget( menuitem, "redo2" );
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid = fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL ) {
- if ( fv->sf->glyphs[gid]->layers[ly_fore].redoes!=NULL )
- break;
- gtk_widget_set_sensitive(w,i!=fv->map->enccount);
-
- for ( i=0; poslist[i]!=NULL; ++i ) {
- w = lookup_widget( menuitem, poslist[i] );
- if ( w!=NULL )
- gtk_widget_set_sensitive(w,pos!=-1);
- }
-
- w = lookup_widget( menuitem, "copy_vwidth1" );
- if ( w!=NULL )
- gtk_widget_set_sensitive(w,pos!=-1 && fv->sf->hasvmetrics);
-
-# ifndef FONTFORGE_CONFIG_PASTEAFTER
- w = lookup_widget( menuitem, "paste_after1" );
- gtk_widget_hide(w);
-# endif
-}
-
-void FontViewMenu_ActivateDependents(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int anychars = FVAnyCharSelected(fv);
- int anygid = anychars<0 ? -1 : fv->map->map[anychars];
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "references1" ),
- anygid>=0 &&
- fv->sf->glyphs[anygid]!=NULL &&
- fv->sf->glyphs[anygid]->dependents != NULL);
- gtk_widget_set_sensitive(lookup_widget( menuitem, "substitutions1" ),
- anygid>=0 &&
- fv->sf->glyphs[anygid]!=NULL &&
- SCUsedBySubs(fv->sf->glyphs[anygid]));
-}
-
-void FontViewMenu_ActivateAAT(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- FontView *ofv;
- int anychars = FVAnyCharSelected(fv);
- int anygid = anychars<0 ? -1 : fv->map->map[anychars];
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "default_att1" ),
- anygid>=0 );
- for ( ofv=fv_list; ofv!=NULL && ofv->sf==fv->sf; ofv = ofv->next );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "copy_features_to_font1" ),
- ofv!=NULL );
-}
-
-void FontViewMenu_ActivateBuild(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int anybuildable = false;
- int anybuildableaccents = false;
- int i, gid;
-
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] && (gid=fv->map->map[i])!=-1 ) {
- SplineChar *sc, dummy;
- sc = fv->sf->glyphs[gid];
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,i);
- if ( SFIsSomethingBuildable(fv->sf,sc,true)) {
- anybuildableaccents = anybuildable = true;
- break;
- else if ( SFIsSomethingBuildable(fv->sf,sc,false))
- anybuildable = true;
- }
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "build_accented_char1" ),
- anybuildableaccents );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "build_composite_char1" ),
- anybuildable );
-}
-
-void FontViewMenu_ActivateElement(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int anychars = FVAnyCharSelected(fv);
- int anygid = anychars<0 ? -1 : fv->map->map[anychars];
- int anybuildable, anytraceable;
- int order2 = fv->sf->order2;
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "char_info1" ),
- anygid>=0 &&
- (fv->cidmaster==NULL || fv->sf->glyphs[anygid]!=NULL));
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "find_problems1" ),
- anygid!=-1);
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "transform1" ),
- anygid!=-1);
- gtk_widget_set_sensitive(lookup_widget( menuitem, "non_linear_transform1" ),
- anygid!=-1);
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "add_extrema1" ),
- anygid!=-1 && !fv->sf->onlybitmaps );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "round_to_int1" ),
- anygid!=-1 && !fv->sf->onlybitmaps );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "correct_direction1" ),
- anygid!=-1 && !fv->sf->onlybitmaps );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "simplify3" ),
- anygid!=-1 && !fv->sf->onlybitmaps );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "meta_font1" ),
- anygid!=-1 && !fv->sf->onlybitmaps && !order2 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "expand_stroke1" ),
- anygid!=-1 && !fv->sf->onlybitmaps && !order2 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "overlap1" ),
- anygid!=-1 && !fv->sf->onlybitmaps && !order2 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "effects1" ),
- anygid!=-1 && !fv->sf->onlybitmaps && !order2 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "tilepath1" ),
- anygid!=-1 && !fv->sf->onlybitmaps && !order2 );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "bitmaps_available1" ),
- fv->mm==NULL );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "regenerate_bitmaps1" ),
- fv->mm==NULL && fv->sf->bitmaps!=NULL && !fv->sf->onlybitmaps );
-
- anybuildable = false;
- if ( anygid!=-1 ) {
- int i, gid;
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] ) {
- SplineChar *sc=NULL, dummy;
- if ( (gid=fv->map->map[i])!=-1 )
- sc = fv->sf->glyphs[gid];
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,i);
- if ( SFIsSomethingBuildable(fv->sf,sc,false)) {
- anybuildable = true;
- break;
- }
- }
- }
- gtk_widget_set_sensitive(lookup_widget( menuitem, "build1" ),
- anybuildable );
-
- anytraceable = false;
- if ( FindAutoTraceName()!=NULL && anychars!=-1 ) {
- int i;
- for ( i=0; i<fv->map->enccount; ++i )
- if ( fv->selected[i] && (gid=fv->map->map[i])!=-1 &&
- fv->sf->glyphs[gid]!=NULL &&
- fv->sf->glyphs[gid]->layers[ly_back].images!=NULL ) {
- anytraceable = true;
- break;
- }
- }
- gtk_widget_set_sensitive(lookup_widget( menuitem, "autotrace1" ),
- anytraceable );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "interpolate_fonts1" ),
- !fv->sf->onlybitmaps );
-
-#ifndef FONTFORGE_CONFIG_NONLINEAR
- w = lookup_widget( menuitem, "non_linear_transform1" );
- gtk_widget_hide(w);
-#endif
-#ifndef FONTFORGE_CONFIG_TILEPATH
- w = lookup_widget( menuitem, "tilepath1" );
- gtk_widget_hide(w);
-#endif
-}
-
-void FontViewMenu_ActivateHints(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int anychars = FVAnyCharSelected(fv);
- int anygid = anychars<0 ? -1 : fv->map->map[anychars];
- int multilayer = fv->sf->multilayer;
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "autohint1" ),
- anygid!=-1 && !multilayer );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "hint_subsitution_pts1" ),
- !fv->sf->order2 && anygid!=-1 && !multilayer );
- if ( fv->sf->mm!=NULL && fv->sf->mm->apple )
- gtk_widget_set_sensitive(lookup_widget( menuitem, "hint_subsitution_pts1" ),
- false);
- gtk_widget_set_sensitive(lookup_widget( menuitem, "auto_counter_hint1" ),
- !fv->sf->order2 && anygid!=-1 && !multilayer );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "dont_autohint1" ),
- !fv->sf->order2 && anygid!=-1 && !multilayer );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "autoinstr1" ),
- fv->sf->order2 && anygid!=-1 && !multilayer );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "edit_instructions1" ),
- fv->sf->order2 && anygid>=0 && !multilayer );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "edit_fpgm1" ),
- fv->sf->order2 && !multilayer );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "edit_prep1" ),
- fv->sf->order2 && !multilayer );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "edit_cvt_1" ),
- fv->sf->order2 && !multilayer );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "clear_hints1" ),
- anygid!=-1 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "clear_width_md1" ),
- anygid!=-1 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "clear_instructions1" ),
- fv->sf->order2 && anygid!=-1 );
-}
-
-/* Builds up a menu containing all the anchor classes */
-void FontViewMenu_ActivateAnchoredPairs(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
-
- _aplistbuild(menuitem,fv->sf,FVMenuAnchorPairs);
-}
-
-void FontViewMenu_ActivateCombinations(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- SplineFont *sf = fv->sf;
- int i, gid, anyligs=0, anykerns=0;
- PST *pst;
-
- if ( sf->kerns ) anykerns=true;
- for ( i=0; i<map->enccount; ++i ) if ( (gid=fv->map->map[i]!=-1 && sf->glyphs[gid]!=NULL ) {
- for ( pst=sf->glyphs[gid]->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type==pst_ligature ) {
- anyligs = true;
- if ( anykerns )
- break;
- }
- }
- if ( sf->glyphs[gid]->kerns!=NULL ) {
- anykerns = true;
- if ( anyligs )
- break;
- }
- }
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "ligatures2" ),
- anyligs);
- gtk_widget_set_sensitive(lookup_widget( menuitem, "kern_pairs1" ),
- anykerns);
- gtk_widget_set_sensitive(lookup_widget( menuitem, "anchored_pairs1" ),
- sf->anchor!=NULL);
-}
-
-void FontViewMenu_ActivateView(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int anychars = FVAnyCharSelected(fv);
- int i,gid;
- BDFFont *bdf;
- int pos;
- SplineFont *sf = fv->sf;
- EncMap *map = fv->map;
- GtkWidget *menu = gtk_menu_item_get_submenu(menuitem);
- GList *kids, *next;
- static int sizes[] = { 24, 36, 48, 72, 96, 0 };
-
- /* First remove anything we might have added previously */
- for ( kids = GTK_MENU_SHELL(menu)->children; kids!=NULL; kids = next ) {
- GtkWidget *w = kids->data;
- next = kids->next;
- if ( strcmp(gtk_widget_get_name(w),"temporary")==0 )
- gtk_container_remove(GTK_CONTAINER(menu),w);
- }
-
- /* Then add any pre-built bitmap sizes */
- if ( sf->bitmaps!=NULL ) {
- GtkWidget *w;
-
- w = gtk_separator_menu_item_new();
- gtk_widget_show(w);
- gtk_widget_set_name(w,"temporary");
- gtk_menu_shell_append(GTK_MENU_SHELL(menu),w);
-
- for ( bdf = sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- if ( BDFDepth(bdf)==1 )
- sprintf( buffer, _("%d pixel bitmap"), bdf->pixelsize );
- else
- sprintf( buffer, _("%d@%d pixel bitmap"),
- bdf->pixelsize, BDFDepth(bdf) );
- w = gtk_check_menu_item_new_with_label( buffer );
- gtk_widget_show(w);
- gtk_widget_set_name(w,"temporary");
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(w), bdf==fv->show );
- g_signal_connect ( G_OBJECT( w ), "activate",
- G_CALLBACK (FontViewMenu_ShowBitmap),
- bdf);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu),w);
- }
- }
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "next_char1" ),
- anychars>=0 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "prev_char1" ),
- anychars>=0 );
- if ( anychars<0 ) pos = map->enccount;
- else for ( pos = anychars+1; pos<map->enccount &&
- (map->map[pos]==-1 || !SCWorthOutputting(sf->glyphs[map->map[pos]]));
- ++pos );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "prev_char1" ),
- pos!=map->enccount );
- for ( pos=anychars-1; pos>=0 &&
- (map->map[pos]==-1 || !SCWorthOutputting(sf->glyphs[map->map[pos]]));
- --pos );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "prev_char1" ),
- pos>=0 );
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
- lookup_widget( menuitem, "encoded_view1" )),
- !fv->sf->compacted);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
- lookup_widget( menuitem, "compacted_view1" )),
- fv->sf->compacted);
- gtk_widget_set_sensitive(lookup_widget( menuitem, "show_v_metrics1" ),
- fv->sf->hasvmetrics );
-
- for ( i=0; sizes[i]!=NULL; ++i ) {
- char buffer[80];
- sprintf( buffer, "%d_pixel_outline1", sizes[i]);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
- lookup_widget( menuitem, buffer )),
- (fv->show!=NULL && fv->show==fv->filled && fv->show->pixelsize==sizes[i]));
- gtk_widget_set_sensitive(lookup_widget( menuitem, buffer ),
- !fv->sf->onlybitmaps || fv->show==fv->filled );
- }
-
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
- lookup_widget( menuitem, "anti_alias1" )),
- (fv->show!=NULL && fv->show->clut!=NULL));
- gtk_widget_set_sensitive(lookup_widget( menuitem, "anti_alias1" ),
- !fv->sf->onlybitmaps || fv->show==fv->filled );
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
- lookup_widget( menuitem, "fit_to_em1" )),
- (fv->show!=NULL && !fv->show->bbsized));
- gtk_widget_set_sensitive(lookup_widget( menuitem, "fit_to_em1" ),
- !fv->sf->onlybitmaps || fv->show==fv->filled );
-}
-
-void FontViewMenu_ActivateMetrics(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int anychars = FVAnyCharSelected(fv);
- char *argnames[] = { "center_in_width1", "thirds_in_width1", "set_width1",
- "set_lbearing1", "set_rbearing1", "set_vertical_advance1", NULL };
- char *vnames[] = { "vkern_by_classes1", "vkern_from_hkern1",
- "remove_all_vkern_pairs1", NULL };
-
- for ( i=0; argnames[i]!=NULL; ++i )
- gtk_widget_set_sensitive(lookup_widget( menuitem, argnames[i] ),
- anychars!=-1 );
- if ( !fv->sf->hasvmetrics )
- gtk_widget_set_sensitive(lookup_widget( menuitem, "set_vertical_advance1" ),
- false );
- for ( i=0; vnames[i]!=NULL; ++i )
- gtk_widget_set_sensitive(lookup_widget( menuitem, vnames[i] ),
- fv->sf->hasvmetrics );
-}
-
-void FontViewMenu_ActivateCID(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int i, j;
- SplineFont *sub, *cidmaster = fv->cidmaster;
- GtkWidget *menu = gtk_menu_item_get_submenu(menuitem);
- GList *kids, *next;
-
- /* First remove anything we might have added previously */
- for ( kids = GTK_MENU_SHELL(menu)->children; kids!=NULL; kids = next ) {
- GtkWidget *w = kids->data;
- next = kids->next;
- if ( strcmp(gtk_widget_get_name(w),"temporary")==0 )
- gtk_container_remove(GTK_CONTAINER(menu),w);
- }
-
- /* Then add any sub-fonts */
- if ( cidmaster!=NULL ) {
- GtkWidget *w;
-
- w = gtk_separator_menu_item_new();
- gtk_widget_show(w);
- gtk_widget_set_name(w,"temporary");
- gtk_menu_shell_append(GTK_MENU_SHELL(menu),w);
-
- for ( j = 0; j<cidmaster->subfontcnt; ++j ) {
- sub = cidmaster->subfonts[j];
- w = gtk_check_menu_item_new_with_label( sub->fontname );
- gtk_widget_show(w);
- gtk_widget_set_name(w,"temporary");
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(w), sub==fv->sf );
- g_signal_connect ( G_OBJECT( w ), "activate",
- G_CALLBACK (FontViewMenu_ShowSubFont),
- sub);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu),w);
- }
- }
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "convert_to_cid1" ),
- cidmaster==NULL && fv->sf->mm==NULL );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "convert_by_cmap1" ),
- cidmaster==NULL && fv->sf->mm==NULL );
-
- /* OpenType allows at most 255 subfonts (PS allows more, but why go to the effort to make safe font check that? */
- gtk_widget_set_sensitive(lookup_widget( menuitem, "insert_font1" ),
- cidmaster!=NULL && cidmaster->subfontcnt<255 );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "insert_empty_font1" ),
- cidmaster!=NULL && cidmaster->subfontcnt<255 );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "remove_font1" ),
- cidmaster!=NULL && cidmaster->subfontcnt>1 );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "flatten1" ),
- cidmaster!=NULL );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "flatten_by_cmap1" ),
- cidmaster!=NULL );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "cid_font_info1" ),
- cidmaster!=NULL );
-}
-
-void FontViewMenu_ActivateMM(GtkMenuItem *menuitem, gpointer user_data) {
- FontView *fv = FV_From_MI(menuitem);
- int i, base, j;
- MMSet *mm = fv->sf->mm;
- SplineFont *sub;
- GMenuItem *mml;
- GtkWidget *menu = gtk_menu_item_get_submenu(menuitem);
- GList *kids, *next;
-
- /* First remove anything we might have added previously */
- for ( kids = GTK_MENU_SHELL(menu)->children; kids!=NULL; kids = next ) {
- GtkWidget *w = kids->data;
- next = kids->next;
- if ( strcmp(gtk_widget_get_name(w),"temporary")==0 )
- gtk_container_remove(GTK_CONTAINER(menu),w);
- }
-
- /* Then add any sub-fonts */
- if ( mm!=NULL ) {
- GtkWidget *w;
-
- w = gtk_separator_menu_item_new();
- gtk_widget_show(w);
- gtk_widget_set_name(w,"temporary");
- gtk_menu_shell_append(GTK_MENU_SHELL(menu),w);
-
- for ( j = 0; j<mm->instance_count+1; ++j ) {
- if ( j==0 )
- sub = mm->normal;
- else
- sub = mm->instances[j-1];
- w = gtk_check_menu_item_new_with_label( sub->fontname );
- gtk_widget_show(w);
- gtk_widget_set_name(w,"temporary");
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(w), sub==fv->sf );
- g_signal_connect ( G_OBJECT( w ), "activate",
- G_CALLBACK (FontViewMenu_ShowSubFont),
- sub);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu),w);
- }
- }
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "mm_validity_check1" ),
- mm!=NULL );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "mm_info1" ),
- mm!=NULL );
- gtk_widget_set_sensitive(lookup_widget( menuitem, "blend_to_new_font1" ),
- mm!=NULL );
-
- gtk_widget_set_sensitive(lookup_widget( menuitem, "mm_change_def_weights1" ),
- mm!=NULL && !mm->apple );
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static int FeatureTrans(FontView *fv, int enc) {
- SplineChar *sc;
- PST *pst;
- char *pt;
- int gid;
-
- if ( enc<0 || enc>=fv->map->enccount || (gid = fv->map->map[enc])==-1 )
-return( -1 );
- if ( fv->cur_subtable==NULL )
-return( gid );
-
- sc = fv->sf->glyphs[gid];
- if ( sc==NULL )
-return( -1 );
- for ( pst = sc->possub; pst!=NULL; pst=pst->next ) {
- if (( pst->type == pst_substitution || pst->type == pst_alternate ) &&
- pst->subtable == fv->cur_subtable )
- break;
- }
- if ( pst==NULL )
-return( -1 );
- pt = strchr(pst->u.subs.variant,' ');
- if ( pt!=NULL )
- *pt = '\0';
- gid = SFFindExistingSlot(fv->sf, -1, pst->u.subs.variant );
- if ( pt!=NULL )
- *pt = ' ';
-return( gid );
-}
-
-void FVRefreshChar(FontView *fv,int gid) {
- BDFChar *bdfc;
- int i, j, enc;
- MetricsView *mv;
-
- /* Can happen in scripts */ /* Can happen if we do an AutoHint when generating a tiny font for freetype context */
- if ( fv->v==NULL || fv->colcnt==0 || fv->sf->glyphs[gid]== NULL )
-return;
- if ( fv->cur_subtable==NULL && strchr(fv->sf->glyphs[gid]->name,'.')!=NULL ) {
- char *temp = copy(fv->sf->glyphs[gid]->name);
- SplineChar *sc2;
- *strchr(temp,'.') = '\0';
- sc2 = SFGetChar(fv->sf,-1,temp);
- if ( sc2!=NULL && sc2->orig_pos!=gid )
- gid = sc2->orig_pos;
- free(temp);
- }
-
- for ( fv=fv->sf->fv; fv!=NULL; fv = fv->nextsame ) {
- for ( mv=fv->sf->metrics; mv!=NULL; mv=mv->next )
- MVRefreshChar(mv,fv->sf->glyphs[gid]);
- bdfc = fv->show->glyphs[gid];
- /* A glyph may be encoded in several places, all need updating */
- for ( enc = 0; enc<fv->map->enccount; ++enc ) if ( fv->map->map[enc]==gid ) {
- i = enc / fv->colcnt;
- j = enc - i*fv->colcnt;
- i -= fv->rowoff;
- if ( i>=0 && i<fv->rowcnt ) {
- struct _GImage base;
- GImage gi;
- GClut clut;
- GRect old, box;
-
- if ( bdfc==NULL )
- bdfc = BDFPieceMeal(fv->show,gid);
- if ( bdfc==NULL )
- continue;
-
- memset(&gi,'\0',sizeof(gi));
- memset(&base,'\0',sizeof(base));
- if ( bdfc->byte_data ) {
- gi.u.image = &base;
- base.image_type = it_index;
- base.clut = fv->show->clut;
- GDrawSetDither(NULL, false); /* on 8 bit displays we don't want any dithering */
- base.trans = -1;
- /*base.clut->trans_index = 0;*/
- } else {
- memset(&clut,'\0',sizeof(clut));
- gi.u.image = &base;
- base.image_type = it_mono;
- base.clut = &clut;
- clut.clut_len = 2;
- clut.clut[0] = GDrawGetDefaultBackground(NULL);
- }
-
- base.data = bdfc->bitmap;
- base.bytes_per_line = bdfc->bytes_per_line;
- base.width = bdfc->xmax-bdfc->xmin+1;
- base.height = bdfc->ymax-bdfc->ymin+1;
- box.x = j*fv->cbw+1; box.width = fv->cbw-1;
- box.y = i*fv->cbh+fv->lab_height+1; box.height = fv->cbw;
- GDrawPushClip(fv->v,&box,&old);
- GDrawFillRect(fv->v,&box,GDrawGetDefaultBackground(NULL));
- if ( fv->magnify>1 ) {
- GDrawDrawImageMagnified(fv->v,&gi,NULL,
- j*fv->cbw+(fv->cbw-1-fv->magnify*base.width)/2,
- i*fv->cbh+fv->lab_height+1+fv->magnify*(fv->show->ascent-bdfc->ymax),
- fv->magnify*base.width,fv->magnify*base.height);
- } else
- GDrawDrawImage(fv->v,&gi,NULL,
- j*fv->cbw+(fv->cbw-1-base.width)/2,
- i*fv->cbh+fv->lab_height+1+fv->show->ascent-bdfc->ymax);
- GDrawPopClip(fv->v,&old);
- if ( fv->selected[enc] ) {
- GDrawSetXORBase(fv->v,GDrawGetDefaultBackground(GDrawGetDisplayOfWindow(fv->v)));
- GDrawSetXORMode(fv->v);
- GDrawFillRect(fv->v,&box,XOR_COLOR);
- GDrawSetCopyMode(fv->v);
- }
- GDrawSetDither(NULL, true);
- }
- }
- }
-}
-
-void FVRegenChar(FontView *fv,SplineChar *sc) {
- struct splinecharlist *dlist;
- MetricsView *mv;
-
- if ( fv->v==NULL ) /* Can happen in scripts */
-return;
-
- /* sc->changedsincelasthinted = true;*/ /* Why was this here? */
- if ( sc->orig_pos>=fv->filled->glyphcnt )
- IError("Character out of bounds in bitmap font %d>=%d", sc->orig_pos, fv->filled->glyphcnt );
- else
- BDFCharFree(fv->filled->glyphs[sc->orig_pos]);
- fv->filled->glyphs[sc->orig_pos] = NULL;
- /* FVRefreshChar does NOT do this for us */
- for ( mv=fv->sf->metrics; mv!=NULL; mv=mv->next )
- MVRegenChar(mv,sc);
-
- FVRefreshChar(fv,sc->orig_pos);
-#if HANYANG
- if ( sc->compositionunit && fv->sf->rules!=NULL )
- Disp_RefreshChar(fv->sf,sc);
-#endif
-
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next )
- FVRegenChar(fv,dlist->sc);
-}
-#endif
-
-int32 UniFromEnc(int enc, Encoding *encname) {
- char from[20];
- unichar_t to[20];
- ICONV_CONST char *fpt;
- char *tpt;
- size_t fromlen, tolen;
-
- if ( encname->is_custom || encname->is_original )
-return( -1 );
- if ( enc>=encname->char_cnt )
-return( -1 );
- if ( encname->is_unicodebmp || encname->is_unicodefull )
-return( enc );
- if ( encname->unicode!=NULL )
-return( encname->unicode[enc] );
- else if ( encname->tounicode ) {
- /* To my surprise, on RH9, doing a reset on conversion of CP1258->UCS2 */
- /* causes subsequent calls to return garbage */
- if ( encname->iso_2022_escape_len ) {
- tolen = sizeof(to); fromlen = 0;
- iconv(encname->tounicode,NULL,&fromlen,NULL,&tolen); /* Reset state */
- }
- fpt = from; tpt = (char *) to; tolen = sizeof(to);
- if ( encname->has_1byte && enc<256 ) {
- *(char *) fpt = enc;
- fromlen = 1;
- } else if ( encname->has_2byte ) {
- if ( encname->iso_2022_escape_len )
- strncpy(from,encname->iso_2022_escape,encname->iso_2022_escape_len );
- fromlen = encname->iso_2022_escape_len;
- from[fromlen++] = enc>>8;
- from[fromlen++] = enc&0xff;
- }
- if ( iconv(encname->tounicode,&fpt,&fromlen,&tpt,&tolen)==(size_t) -1 )
-return( -1 );
- if ( tpt-(char *) to == 0 ) {
- /* This strange call appears to be what we need to make CP1258->UCS2 */
- /* work. It's supposed to reset the state and give us the shift */
- /* out. As there is no state, and no shift out I have no idea why*/
- /* this works, but it does. */
- if ( iconv(encname->tounicode,NULL,&fromlen,&tpt,&tolen)==(size_t) -1 )
-return( -1 );
- }
- if ( tpt-(char *) to == sizeof(unichar_t) )
-return( to[0] );
-#ifdef UNICHAR_16
- else if ( tpt-(char *) to == 4 && to[0]>=0xd800 && to[0]<0xdc00 && to[1]>=0xdc00 )
-return( ((to[0]-0xd800)<<10) + (to[1]-0xdc00) + 0x10000 );
-#endif
- } else if ( encname->tounicode_func!=NULL ) {
-return( (encname->tounicode_func)(enc) );
- }
-return( -1 );
-}
-
-int32 EncFromUni(int32 uni, Encoding *enc) {
- unichar_t from[20];
- unsigned char to[20];
- ICONV_CONST char *fpt;
- char *tpt;
- size_t fromlen, tolen;
- int i;
-
- if ( enc->is_custom || enc->is_original || enc->is_compact )
-return( -1 );
- if ( enc->is_unicodebmp || enc->is_unicodefull )
-return( uni<enc->char_cnt ? uni : -1 );
-
- if ( enc->unicode!=NULL ) {
- for ( i=0; i<enc->char_cnt; ++i ) {
- if ( enc->unicode[i]==uni )
-return( i );
- }
-return( -1 );
- } else if ( enc->fromunicode!=NULL ) {
- /* I don't see how there can be any state to reset in this direction */
- /* So I don't reset it */
-#ifdef UNICHAR_16
- if ( uni<0x10000 ) {
- from[0] = uni;
- fromlen = sizeof(unichar_t);
- } else {
- uni -= 0x10000;
- from[0] = 0xd800 + (uni>>10);
- from[1] = 0xdc00 + (uni&0x3ff);
- fromlen = 2*sizeof(unichar_t);
- }
-#else
- from[0] = uni;
- fromlen = sizeof(unichar_t);
-#endif
- fpt = (char *) from; tpt = (char *) to; tolen = sizeof(to);
- iconv(enc->fromunicode,NULL,NULL,NULL,NULL); /* reset shift in/out, etc. */
- if ( iconv(enc->fromunicode,&fpt,&fromlen,&tpt,&tolen)==(size_t) -1 )
-return( -1 );
- if ( tpt-(char *) to == 1 )
-return( to[0] );
- if ( enc->iso_2022_escape_len!=0 ) {
- if ( tpt-(char *) to == enc->iso_2022_escape_len+2 &&
- strncmp((char *) to,enc->iso_2022_escape,enc->iso_2022_escape_len)==0 )
-return( (to[enc->iso_2022_escape_len]<<8) | to[enc->iso_2022_escape_len+1] );
- } else {
- if ( tpt-(char *) to == sizeof(unichar_t) )
-return( (to[0]<<8) | to[1] );
- }
- } else if ( enc->fromunicode_func!=NULL ) {
-return( (enc->fromunicode_func)(uni) );
- }
-return( -1 );
-}
-
-int32 EncFromName(const char *name,enum uni_interp interp,Encoding *encname) {
- int i;
- if ( encname->psnames!=NULL ) {
- for ( i=0; i<encname->char_cnt; ++i )
- if ( encname->psnames[i]!=NULL && strcmp(name,encname->psnames[i])==0 )
-return( i );
- }
- i = UniFromName(name,interp,encname);
- if ( i==-1 && strlen(name)==4 ) {
- /* MS says use this kind of name, Adobe says use the one above */
- char *end;
- i = strtol(name,&end,16);
- if ( i<0 || i>0xffff || *end!='\0' )
-return( -1 );
- }
-return( EncFromUni(i,encname));
-}
-
-SplineChar *SCBuildDummy(SplineChar *dummy,SplineFont *sf,EncMap *map,int i) {
- static char namebuf[100];
-#ifdef FONTFORGE_CONFIG_TYPE3
- static Layer layers[2];
-#endif
-
- memset(dummy,'\0',sizeof(*dummy));
- dummy->color = COLOR_DEFAULT;
- dummy->layer_cnt = 2;
-#ifdef FONTFORGE_CONFIG_TYPE3
- dummy->layers = layers;
-#endif
- if ( sf->cidmaster!=NULL ) {
- /* CID fonts don't have encodings, instead we must look up the cid */
- if ( sf->cidmaster->loading_cid_map )
- dummy->unicodeenc = -1;
- else
- dummy->unicodeenc = CID2NameUni(FindCidMap(sf->cidmaster->cidregistry,sf->cidmaster->ordering,sf->cidmaster->supplement,sf->cidmaster),
- i,namebuf,sizeof(namebuf));
- } else
- dummy->unicodeenc = UniFromEnc(i,map->enc);
-
- if ( sf->cidmaster!=NULL )
- dummy->name = namebuf;
- else if ( map->enc->psnames!=NULL && i<map->enc->char_cnt &&
- map->enc->psnames[i]!=NULL )
- dummy->name = map->enc->psnames[i];
- else if ( dummy->unicodeenc==-1 )
- dummy->name = NULL;
- else
- dummy->name = (char *) StdGlyphName(namebuf,dummy->unicodeenc,sf->uni_interp,sf->for_new_glyphs);
- if ( dummy->name==NULL ) {
- /*if ( dummy->unicodeenc!=-1 || i<256 )
- dummy->name = ".notdef";
- else*/ {
- int j;
- sprintf( namebuf, "NameMe.%d", i);
- j=0;
- while ( SFFindExistingSlot(sf,-1,namebuf)!=-1 )
- sprintf( namebuf, "NameMe.%d.%d", i, ++j);
- dummy->name = namebuf;
- }
- }
- dummy->width = dummy->vwidth = sf->ascent+sf->descent;
- if ( dummy->unicodeenc>0 && dummy->unicodeenc<0x10000 &&
- Iscombining(dummy->unicodeenc)) {
- /* Mark characters should be 0 width */
- dummy->width = 0;
- /* Except in monospaced fonts on windows, where they should be the */
- /* same width as everything else */
- }
- /* Actually, in a monospace font, all glyphs should be the same width */
- /* whether mark or not */
- if ( sf->pfminfo.panose_set && sf->pfminfo.panose[3]==9 &&
- sf->glyphcnt>0 ) {
- for ( i=sf->glyphcnt-1; i>=0; --i )
- if ( SCWorthOutputting(sf->glyphs[i])) {
- dummy->width = sf->glyphs[i]->width;
- break;
- }
- }
- dummy->parent = sf;
- dummy->orig_pos = 0xffff;
-return( dummy );
-}
-
- static SplineChar *_SFMakeChar(SplineFont *sf,EncMap *map,int enc) {
- SplineChar dummy, *sc;
- SplineFont *ssf;
- int j, real_uni, gid;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer *l;
-#endif
- extern const int cns14pua[], amspua[];
-
- if ( enc>=map->enccount )
- gid = -1;
- else
- gid = map->map[enc];
- if ( sf->subfontcnt!=0 && gid!=-1 ) {
- ssf = NULL;
- for ( j=0; j<sf->subfontcnt; ++j )
- if ( gid<sf->subfonts[j]->glyphcnt ) {
- ssf = sf->subfonts[j];
- if ( ssf->glyphs[gid]!=NULL ) {
-return( ssf->glyphs[gid] );
- }
- }
- sf = ssf;
- }
-
- if ( gid==-1 || (sc = sf->glyphs[gid])==NULL ) {
- if (( map->enc->is_unicodebmp || map->enc->is_unicodefull ) &&
- ( enc>=0xe000 && enc<=0xf8ff ) &&
- ( sf->uni_interp==ui_ams || sf->uni_interp==ui_trad_chinese ) &&
- ( real_uni = (sf->uni_interp==ui_ams ? amspua : cns14pua)[enc-0xe000])!=0 ) {
- if ( real_uni<map->enccount ) {
- SplineChar *sc;
- /* if necessary, create the real unicode code point */
- /* and then make us be a duplicate of it */
- sc = _SFMakeChar(sf,map,real_uni);
- map->map[enc] = gid = sc->orig_pos;
- SCCharChangedUpdate(sc);
-return( sc );
- }
- }
-
- SCBuildDummy(&dummy,sf,map,enc);
- if ((sc = SFGetChar(sf,dummy.unicodeenc,dummy.name))!=NULL ) {
- map->map[enc] = sc->orig_pos;
-return( sc );
- }
- sc = SplineCharCreate();
-#ifdef FONTFORGE_CONFIG_TYPE3
- l = sc->layers;
- *sc = dummy;
- sc->layers = l; /* It's empty, no need to copy dummy's layers */
- if ( sf->strokedfont ) {
- l[ly_fore].dostroke = true;
- l[ly_fore].dofill = false;
- }
-#else
- *sc = dummy;
-#endif
- sc->name = copy(sc->name);
- /*SCLigDefault(sc);*/
- SFAddGlyphAndEncode(sf,sc,map,enc);
- }
-return( sc );
-}
-
-SplineChar *SFMakeChar(SplineFont *sf,EncMap *map, int enc) {
- int gid;
-
- if ( enc==-1 )
-return( NULL );
- if ( enc>=map->enccount )
- gid = -1;
- else
- gid = map->map[enc];
- if ( sf->mm!=NULL && (gid==-1 || sf->glyphs[gid]==NULL) ) {
- int j;
- _SFMakeChar(sf->mm->normal,map,enc);
- for ( j=0; j<sf->mm->instance_count; ++j )
- _SFMakeChar(sf->mm->instances[j],map,enc);
- }
-return( _SFMakeChar(sf,map,enc));
-}
-
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
-static void AddSubPST(SplineChar *sc,struct lookup_subtable *sub,char *variant) {
- PST *pst;
-
- pst = chunkalloc(sizeof(PST));
- pst->type = pst_substitution;
- pst->subtable = sub;
- pst->u.alt.components = copy(variant);
- pst->next = sc->possub;
- sc->possub = pst;
-}
-
-SplineChar *FVMakeChar(FontView *fv,int enc) {
- SplineFont *sf = fv->sf;
- SplineChar *base_sc = SFMakeChar(sf,fv->map,enc), *feat_sc = NULL;
- int feat_gid = FeatureTrans(fv,enc);
-
- if ( fv->cur_subtable==NULL )
-return( base_sc );
-
- if ( feat_gid==-1 ) {
- int uni = -1;
- FeatureScriptLangList *fl = fv->cur_subtable->lookup->features;
-
- if ( base_sc->unicodeenc>=0x600 && base_sc->unicodeenc<=0x6ff &&
- fl!=NULL &&
- (fl->featuretag == CHR('i','n','i','t') ||
- fl->featuretag == CHR('m','e','d','i') ||
- fl->featuretag == CHR('f','i','n','a') ||
- fl->featuretag == CHR('i','s','o','l')) ) {
- uni = fl->featuretag == CHR('i','n','i','t') ? ArabicForms[base_sc->unicodeenc-0x600].initial :
- fl->featuretag == CHR('m','e','d','i') ? ArabicForms[base_sc->unicodeenc-0x600].medial :
- fl->featuretag == CHR('f','i','n','a') ? ArabicForms[base_sc->unicodeenc-0x600].final :
- fl->featuretag == CHR('i','s','o','l') ? ArabicForms[base_sc->unicodeenc-0x600].isolated :
- -1;
- feat_sc = SFGetChar(sf,uni,NULL);
- if ( feat_sc!=NULL )
-return( feat_sc );
- }
- feat_sc = SplineCharCreate();
- feat_sc->parent = sf;
- feat_sc->unicodeenc = uni;
- if ( uni!=-1 ) {
- feat_sc->name = galloc(8);
- feat_sc->unicodeenc = uni;
- sprintf( feat_sc->name,"uni%04X", uni );
- } else if ( fv->cur_subtable->suffix!=NULL ) {
- feat_sc->name = galloc(strlen(base_sc->name)+strlen(fv->cur_subtable->suffix)+2);
- sprintf( feat_sc->name, "%s.%s", base_sc->name, fv->cur_subtable->suffix );
- } else if ( fl==NULL ) {
- feat_sc->name = strconcat(base_sc->name,".unknown");
- } else if ( fl->ismac ) {
- /* mac feature/setting */
- feat_sc->name = galloc(strlen(base_sc->name)+14);
- sprintf( feat_sc->name,"%s.m%d_%d", base_sc->name,
- (int) (fl->featuretag>>16),
- (int) ((fl->featuretag)&0xffff) );
- } else {
- /* OpenType feature tag */
- feat_sc->name = galloc(strlen(base_sc->name)+6);
- sprintf( feat_sc->name,"%s.%c%c%c%c", base_sc->name,
- (int) (fl->featuretag>>24),
- (int) ((fl->featuretag>>16)&0xff),
- (int) ((fl->featuretag>>8)&0xff),
- (int) ((fl->featuretag)&0xff) );
- }
- SFAddGlyphAndEncode(sf,feat_sc,fv->map,fv->map->enccount);
- AddSubPST(base_sc,fv->cur_subtable,feat_sc->name);
-return( feat_sc );
- } else
-return( base_sc );
-}
-#else
-SplineChar *FVMakeChar(FontView *fv,int enc) {
- SplineFont *sf = fv->sf;
-return( SFMakeChar(sf,fv->map,enc) );
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static GImage *GImageCropAndRotate(GImage *unrot) {
- struct _GImage *unbase = unrot->u.image, *rbase;
- int xmin = unbase->width, xmax = -1, ymin = unbase->height, ymax = -1;
- int i,j, ii;
- GImage *rot;
-
- for ( i=0; i<unbase->height; ++i ) {
- for ( j=0; j<unbase->width; ++j ) {
- if ( !(unbase->data[i*unbase->bytes_per_line+(j>>3)]&(0x80>>(j&7))) ) {
- if ( j<xmin ) xmin = j;
- if ( j>xmax ) xmax = j;
- if ( i>ymax ) ymax = i;
- if ( i<ymin ) ymin = i;
- }
- }
- }
- if ( xmax==-1 )
-return( NULL );
-
- rot = GImageCreate(it_mono,ymax-ymin+1,xmax-xmin+1);
- if ( rot==NULL )
-return( NULL );
- rbase = rot->u.image;
- memset(rbase->data,-1,rbase->height*rbase->bytes_per_line);
- for ( i=ymin; i<=ymax; ++i ) {
- for ( j=xmin; j<=xmax; ++j ) {
- if ( !(unbase->data[i*unbase->bytes_per_line+(j>>3)]&(0x80>>(j&7)) )) {
- ii = ymax-i;
- rbase->data[(j-xmin)*rbase->bytes_per_line+(ii>>3)] &= ~(0x80>>(ii&7));
- }
- }
- }
- rbase->trans = 1;
-return( rot );
-}
-
-static GImage *UniGetRotatedGlyph(FontView *fv, SplineChar *sc,int uni) {
- SplineFont *sf = fv->sf;
- int cid=-1;
- static GWindow pixmap=NULL;
- GRect r;
- unichar_t buf[2];
- GImage *unrot, *rot;
- SplineFont *cm = sf->cidmaster;
-
- if ( uni!=-1 )
- /* Do nothing */;
- else if ( sscanf(sc->name,"vertuni%x", (unsigned *) &uni)==1 )
- /* All done */;
- else if ( cm!=NULL &&
- ((cid=CIDFromName(sc->name,cm))!=-1 ||
- sscanf( sc->name, "cid-%d", &cid)==1 || /* Obsolete names */
- sscanf( sc->name, "vertcid_%d", &cid)==1 ||
- sscanf( sc->name, "cid_%d", &cid)==1 )) {
- uni = CID2Uni(FindCidMap(cm->cidregistry,cm->ordering,cm->supplement,cm),
- cid);
- }
- if ( uni&0x10000 ) uni -= 0x10000; /* Bug in some old cidmap files */
- if ( uni<0 || uni>0xffff )
-return( NULL );
-
- if ( pixmap==NULL ) {
- pixmap = GDrawCreateBitmap(NULL,2*fv->lab_height,2*fv->lab_height,NULL);
- if ( pixmap==NULL )
-return( NULL );
- GDrawSetFont(pixmap,sf->fv->fontset[0]);
- }
- r.x = r.y = 0;
- r.width = r.height = 2*fv->lab_height;
- GDrawFillRect(pixmap,&r,1);
- buf[0] = uni; buf[1] = 0;
- GDrawDrawText(pixmap,2,fv->lab_height,buf,1,NULL,0);
- unrot = GDrawCopyScreenToImage(pixmap,&r);
- if ( unrot==NULL )
-return( NULL );
-
- rot = GImageCropAndRotate(unrot);
- GImageDestroy(unrot);
-return( rot );
-}
-
-#if 0
-static int Use2ByteEnc(FontView *fv,SplineChar *sc, unichar_t *buf,FontMods *mods) {
- int ch1 = sc->enc>>8, ch2 = sc->enc&0xff, newch;
- Encoding *enc = fv->map->enc;
- unsigned short *subtable;
-
- retry:
- switch ( enc ) {
- case em_big5: case em_big5hkscs:
- if ( !GDrawFontHasCharset(fv->fontset[0],em_big5))
-return( false);
- if ( ch1<0xa1 || ch1>0xf9 || ch2<0x40 || ch2>0xfe || sc->enc> 0xf9fe )
-return( false );
- mods->has_charset = true; mods->charset = em_big5;
- buf[0] = sc->enc;
- buf[1] = 0;
-return( true );
- break;
- case em_sjis:
- if ( !GDrawFontHasCharset(fv->fontset[0],em_jis208))
-return( false);
- if ( ch1>=129 && ch1<=159 )
- ch1-=112;
- else if ( ch1>=0xe0 && ch1<=0xef )
- ch1-=176;
- else
-return( false );
- ch1<<=1;
- if ( ch2 == 127 )
-return( false );
- else if ( ch2>=159 )
- ch2-=126;
- else if ( ch2>127 ) {
- --ch1;
- ch2 -= 32;
- } else {
- -- ch1;
- ch2 -= 31;
- }
- mods->has_charset = true; mods->charset = em_jis208;
- buf[0] = (ch1<<8) | ch2;
- buf[1] = 0;
-return( true );
- break;
- case em_wansung:
- if ( !GDrawFontHasCharset(fv->fontset[0],em_ksc5601))
-return( false);
- if ( ch1<0xa1 || ch1>0xfd || ch2<0xa1 || ch2>0xfe || sc->enc > 0xfdfe )
-return( false );
- mods->has_charset = true; mods->charset = em_ksc5601;
- buf[0] = sc->enc-0x8080;
- buf[1] = 0;
-return( true );
- break;
- case em_jisgb:
- if ( !GDrawFontHasCharset(fv->fontset[0],em_gb2312))
-return( false);
- if ( ch1<0xa1 || ch1>0xfd || ch2<0xa1 || ch2>0xfe || sc->enc > 0xfdfe )
-return( false );
- mods->has_charset = true; mods->charset = em_gb2312;
- buf[0] = sc->enc-0x8080;
- buf[1] = 0;
-return( true );
- break;
- case em_ksc5601: case em_jis208: case em_jis212: case em_gb2312:
- if ( !GDrawFontHasCharset(fv->fontset[0],enc))
-return( false);
- if ( ch1<0x21 || ch1>0x7e || ch2<0x21 || ch2>0x7e )
-return( false );
- mods->has_charset = true; mods->charset = enc;
- buf[0] = (ch1<<8)|ch2;
- buf[1] = 0;
-return( true );
- break;
- default:
- /* If possible, look at the unicode font using the appropriate glyphs */
- /* for the CJ language for which the font was designed */
- ch1 = sc->unicodeenc>>8, ch2 = sc->unicodeenc&0xff;
- switch ( fv->sf->uni_interp ) {
- case ui_japanese:
- if ( ch1>=jis_from_unicode.first && ch1<=jis_from_unicode.last &&
- (subtable = jis_from_unicode.table[ch1-jis_from_unicode.first])!=NULL &&
- (newch = subtable[ch2])!=0 ) {
- if ( newch&0x8000 ) {
- if ( GDrawFontHasCharset(fv->fontset[0],em_jis212)) {
- enc = em_jis212;
- newch &= ~0x8000;
- ch1 = newch>>8; ch2 = newch&0xff;
- } else
-return( false );
- } else {
- if ( GDrawFontHasCharset(fv->fontset[0],em_jis208)) {
- enc = em_jis208;
- ch1 = newch>>8; ch2 = newch&0xff;
- } else
-return( false );
- }
- } else
-return( false );
- break;
- case ui_korean:
- /* Don't know what to do about korean hanga chars */
- /* No ambiguity for hangul */
-return( false );
- break;
- case ui_trad_chinese:
- if ( ch1>=big5hkscs_from_unicode.first && ch1<=big5hkscs_from_unicode.last &&
- (subtable = big5hkscs_from_unicode.table[ch1-big5hkscs_from_unicode.first])!=NULL &&
- (newch = subtable[ch2])!=0 &&
- GDrawFontHasCharset(fv->fontset[0],em_big5)) {
- enc = em_big5hkscs;
- ch1 = newch>>8; ch2 = newch&0xff;
- } else
-return( false );
- break;
- case ui_simp_chinese:
- if ( ch1>=gb2312_from_unicode.first && ch1<=gb2312_from_unicode.last &&
- (subtable = gb2312_from_unicode.table[ch1-gb2312_from_unicode.first])!=NULL &&
- (newch = subtable[ch2])!=0 &&
- GDrawFontHasCharset(fv->fontset[0],em_gb2312)) {
- enc = em_gb2312;
- ch1 = newch>>8; ch2 = newch&0xff;
- } else
-return( false );
- break;
- default:
-return( false );
- }
- goto retry;
- }
-}
-#endif
-
-/* Mathmatical Alphanumeric Symbols in the 1d400-1d7ff range are styled */
-/* variants on latin, greek, and digits */
-#define _uni_bold 0x1
-#define _uni_italic 0x2
-#define _uni_script (1<<2)
-#define _uni_fraktur (2<<2)
-#define _uni_doublestruck (3<<2)
-#define _uni_sans (4<<2)
-#define _uni_mono (5<<2)
-#define _uni_fontmax (6<<2)
-#define _uni_latin 0
-#define _uni_greek 1
-#define _uni_digit 2
-
-static int latinmap[] = {
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
- 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
- '\0'
-};
-static int greekmap[] = {
- 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, 0x399, 0x39a,
- 0x39b, 0x39c, 0x39d, 0x39e, 0x39f, 0x3a0, 0x3a1, 0x3f4, 0x3a3, 0x3a4,
- 0x3a5, 0x3a6, 0x3a7, 0x3a8, 0x3a9, 0x2207,
- 0x3b1, 0x3b2, 0x3b3, 0x3b4, 0x3b5, 0x3b6, 0x3b7, 0x3b8, 0x3b9, 0x3ba,
- 0x3bb, 0x3bc, 0x3bd, 0x3be, 0x3bf, 0x3c0, 0x3c1, 0x3c2, 0x3c3, 0x3c4,
- 0x3c5, 0x3c6, 0x3c7, 0x3c8, 0x3c9,
- 0x2202, 0x3f5, 0x3d1, 0x3f0, 0x3d5, 0x3f1, 0x3d6,
- 0
-};
-static int digitmap[] = { '0', '1', '2', '3', '4', '5', '6','7','8','9', '\0' };
-static int *maps[] = { latinmap, greekmap, digitmap };
-
-static struct { int start, last; int styles; int charset; } mathmap[] = {
- { 0x1d400, 0x1d433, _uni_bold, _uni_latin },
- { 0x1d434, 0x1d467, _uni_italic, _uni_latin },
- { 0x1d468, 0x1d49b, _uni_bold|_uni_italic, _uni_latin },
- { 0x1d49c, 0x1d4cf, _uni_script, _uni_latin },
- { 0x1d4d0, 0x1d503, _uni_script|_uni_bold, _uni_latin },
- { 0x1d504, 0x1d537, _uni_fraktur, _uni_latin },
- { 0x1d538, 0x1d56b, _uni_doublestruck, _uni_latin },
- { 0x1d56c, 0x1d59f, _uni_fraktur|_uni_bold, _uni_latin },
- { 0x1d5a0, 0x1d5d3, _uni_sans, _uni_latin },
- { 0x1d5d4, 0x1d607, _uni_sans|_uni_bold, _uni_latin },
- { 0x1d608, 0x1d63b, _uni_sans|_uni_italic, _uni_latin },
- { 0x1d63c, 0x1d66f, _uni_sans|_uni_bold|_uni_italic, _uni_latin },
- { 0x1d670, 0x1d6a3, _uni_mono, _uni_latin },
- { 0x1d6a8, 0x1d6e1, _uni_bold, _uni_greek },
- { 0x1d6e2, 0x1d71b, _uni_italic, _uni_greek },
- { 0x1d71c, 0x1d755, _uni_bold|_uni_italic, _uni_greek },
- { 0x1d756, 0x1d78f, _uni_sans|_uni_bold, _uni_greek },
- { 0x1d790, 0x1d7c9, _uni_sans|_uni_bold|_uni_italic, _uni_greek },
- { 0x1d7ce, 0x1d7d7, _uni_bold, _uni_digit },
- { 0x1d7d8, 0x1d7e1, _uni_doublestruck, _uni_digit },
- { 0x1d7e2, 0x1d7eb, _uni_sans, _uni_digit },
- { 0x1d7ec, 0x1d7f5, _uni_sans|_uni_bold, _uni_digit },
- { 0x1d7f6, 0x1d7ff, _uni_mono, _uni_digit },
- { 0, 0 }
-};
-
-static GFont *FVCheckFont(FontView *fv,int type) {
- FontRequest rq;
- int family = type>>2;
- char *fontnames;
- unichar_t *ufontnames;
-
- static char *resourcenames[] = { "FontView.SerifFamily", "FontView.ScriptFamily",
- "FontView.FrakturFamily", "FontView.DoubleStruckFamily",
- "FontView.SansFamily", "FontView.MonoFamily", NULL };
- static char *defaultfontnames[] = {
- "times,serif,caslon,clearlyu,unifont",
- "script,formalscript,clearlyu,unifont",
- "fraktur,clearlyu,unifont",
- "doublestruck,clearlyu,unifont",
- "helvetica,caliban,sansserif,sans,clearlyu,unifont",
- "courier,monospace,caslon,clearlyu,unifont",
- NULL
- };
-
- if ( fv->fontset[type]==NULL ) {
- fontnames = GResourceFindString(resourcenames[family]);
- if ( fontnames==NULL )
- fontnames = defaultfontnames[family];
- ufontnames = uc_copy(fontnames);
-
- memset(&rq,0,sizeof(rq));
- rq.family_name = ufontnames;
- rq.point_size = -13;
- rq.weight = (type&_uni_bold) ? 700:400;
- rq.style = (type&_uni_italic) ? fs_italic : 0;
- fv->fontset[type] = GDrawInstanciateFont(GDrawGetDisplayOfWindow(fv->v),&rq);
- }
-return( fv->fontset[type] );
-}
-
-extern unichar_t adobes_pua_alts[0x200][3];
-
-static void do_Adobe_Pua(unichar_t *buf,int sob,int uni) {
- int i, j;
-
- for ( i=j=0; j<sob-1 && i<3; ++i ) {
- int ch = adobes_pua_alts[uni-0xf600][i];
- if ( ch==0 )
- break;
- if ( ch>=0xf600 && ch<=0xf7ff && adobes_pua_alts[ch-0xf600]!=0 ) {
- do_Adobe_Pua(buf+j,sob-j,ch);
- while ( buf[j]!=0 ) ++j;
- } else
- buf[j++] = ch;
- }
- buf[j] = 0;
-}
-
-static void FVExpose(FontView *fv,GWindow pixmap,GEvent *event) {
- int i, j, width, gid;
- int changed;
- GRect old, old2, box, r;
- GClut clut;
- struct _GImage base;
- GImage gi;
- SplineChar dummy;
- int styles, laststyles=0;
- GImage *rotated=NULL;
- int em = fv->sf->ascent+fv->sf->descent;
- int yorg = fv->magnify*(fv->show->ascent-fv->sf->vertical_origin*fv->show->pixelsize/em);
- Color bg, def_fg;
-
- def_fg = GDrawGetDefaultForeground(NULL);
- memset(&gi,'\0',sizeof(gi));
- memset(&base,'\0',sizeof(base));
- if ( fv->show->clut!=NULL ) {
- gi.u.image = &base;
- base.image_type = it_index;
- base.clut = fv->show->clut;
- GDrawSetDither(NULL, false);
- base.trans = -1;
- /*base.clut->trans_index = 0;*/
- } else {
- memset(&clut,'\0',sizeof(clut));
- gi.u.image = &base;
- base.image_type = it_mono;
- base.clut = &clut;
- clut.clut_len = 2;
- clut.clut[0] = GDrawGetDefaultBackground(NULL);
- }
-
- GDrawSetFont(pixmap,fv->fontset[0]);
- GDrawSetLineWidth(pixmap,0);
- GDrawPushClip(pixmap,&event->u.expose.rect,&old);
- GDrawFillRect(pixmap,NULL,GDrawGetDefaultBackground(NULL));
- for ( i=0; i<=fv->rowcnt; ++i ) {
- GDrawDrawLine(pixmap,0,i*fv->cbh,fv->width,i*fv->cbh,def_fg);
- GDrawDrawLine(pixmap,0,i*fv->cbh+fv->lab_height,fv->width,i*fv->cbh+fv->lab_height,0x808080);
- }
- for ( i=0; i<=fv->colcnt; ++i )
- GDrawDrawLine(pixmap,i*fv->cbw,0,i*fv->cbw,fv->height,def_fg);
- for ( i=event->u.expose.rect.y/fv->cbh; i<=fv->rowcnt &&
- (event->u.expose.rect.y+event->u.expose.rect.height+fv->cbh-1)/fv->cbh; ++i ) for ( j=0; j<fv->colcnt; ++j ) {
- int index = (i+fv->rowoff)*fv->colcnt+j;
- int feat_gid;
- styles = 0;
- SplineChar *sc;
- if ( fv->mapping!=NULL ) {
- if ( index>=fv->mapcnt ) index = fv->map->enccount;
- else
- index = fv->mapping[index];
- }
- if ( index < fv->map->enccount && index!=-1 ) {
- unichar_t buf[60]; char cbuf[8];
- char utf8_buf[8];
- int use_utf8 = false;
- Color fg;
- FontMods *mods=NULL;
- extern const int amspua[];
- int uni;
- struct cidmap *cidmap = NULL;
- sc = (gid=fv->map->map[index])!=-1 ? fv->sf->glyphs[gid]: NULL;
-
- if ( fv->cidmaster!=NULL )
- cidmap = FindCidMap(fv->cidmaster->cidregistry,fv->cidmaster->ordering,fv->cidmaster->supplement,fv->cidmaster);
-
- if ( ( fv->map->enc==&custom && index<256 ) ||
- ( fv->map->enc!=&custom && index<fv->map->enc->char_cnt ) ||
- ( cidmap!=NULL && index<MaxCID(cidmap) ))
- fg = def_fg;
- else
- fg = 0x505050;
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,index);
- uni = sc->unicodeenc;
- buf[0] = buf[1] = 0;
- if ( fv->sf->uni_interp==ui_ams && uni>=0xe000 && uni<=0xf8ff &&
- amspua[uni-0xe000]!=0 )
- uni = amspua[uni-0xe000];
- switch ( fv->glyphlabel ) {
- case gl_name:
- uc_strncpy(buf,sc->name,sizeof(buf)/sizeof(buf[0]));
- styles = _uni_sans;
- break;
- case gl_unicode:
- if ( sc->unicodeenc!=-1 ) {
- sprintf(cbuf,"%04x",sc->unicodeenc);
- uc_strcpy(buf,cbuf);
- } else
- uc_strcpy(buf,"?");
- styles = _uni_sans;
- break;
- case gl_encoding:
- if ( fv->map->enc->only_1byte ||
- (fv->map->enc->has_1byte && index<256))
- sprintf(cbuf,"%02x",index);
- else
- sprintf(cbuf,"%04x",index);
- uc_strcpy(buf,cbuf);
- styles = _uni_sans;
- break;
- case gl_glyph:
- if ( uni==0xad )
- buf[0] = '-';
- else if ( fv->sf->uni_interp==ui_adobe && uni>=0xf600 && uni<=0xf7ff &&
- adobes_pua_alts[uni-0xf600]!=0 ) {
- use_utf8 = false;
- do_Adobe_Pua(buf,sizeof(buf),uni);
- } else if ( uni>=0x1d400 && uni<=0x1d7ff ) {
- int i;
- for ( i=0; mathmap[i].start!=0; ++i ) {
- if ( uni<=mathmap[i].last ) {
- buf[0] = maps[mathmap[i].charset][uni-mathmap[i].start];
- styles = mathmap[i].styles;
- break;
- }
- }
- } else if ( uni>=0xe0020 && uni<=0xe007e ) {
- buf[0] = uni-0xe0000; /* A map of Ascii for language names */
-#if HANYANG
- } else if ( sc->compositionunit ) {
- if ( sc->jamo<19 )
- buf[0] = 0x1100+sc->jamo;
- else if ( sc->jamo<19+21 )
- buf[0] = 0x1161 + sc->jamo-19;
- else /* Leave a hole for the blank char */
- buf[0] = 0x11a8 + sc->jamo-(19+21+1);
-#endif
- } else if ( uni>0 && uni<unicode4_size ) {
- char *pt = utf8_buf;
- use_utf8 = true;
- if ( uni<=0x7f )
- *pt ++ = uni;
- else if ( uni<=0x7ff ) {
- *pt++ = 0xc0 | (uni>>6);
- *pt++ = 0x80 | (uni&0x3f);
- } else if ( uni<=0xffff ) {
- *pt++ = 0xe0 | (uni>>12);
- *pt++ = 0x80 | ((uni>>6)&0x3f);
- *pt++ = 0x80 | (uni&0x3f);
- } else {
- uint32 val = uni-0x10000;
- int u = ((val&0xf0000)>>16)+1, z=(val&0x0f000)>>12, y=(val&0x00fc0)>>6, x=val&0x0003f;
- *pt++ = 0xf0 | (u>>2);
- *pt++ = 0x80 | ((u&3)<<4) | z;
- *pt++ = 0x80 | y;
- *pt++ = 0x80 | x;
- }
- *pt = '\0';
- } else {
- char *pt = strchr(sc->name,'.');
- buf[0] = '?';
- fg = 0xff0000;
- if ( pt!=NULL ) {
- int i, n = pt-sc->name;
- char *end;
- SplineFont *cm = fv->sf->cidmaster;
- if ( n==7 && sc->name[0]=='u' && sc->name[1]=='n' && sc->name[2]=='i' &&
- (i=strtol(sc->name+3,&end,16), end-sc->name==7))
- buf[0] = i;
- else if ( n>=5 && n<=7 && sc->name[0]=='u' &&
- (i=strtol(sc->name+1,&end,16), end-sc->name==n))
- buf[0] = i;
- else if ( cm!=NULL && (i=CIDFromName(sc->name,cm))!=-1 ) {
- int uni;
- uni = CID2Uni(FindCidMap(cm->cidregistry,cm->ordering,cm->supplement,cm),
- i);
- if ( uni!=-1 )
- buf[0] = uni;
- } else {
- int uni;
- *pt = '\0';
- uni = UniFromName(sc->name,fv->sf->uni_interp,fv->map->enc);
- if ( uni!=-1 )
- buf[0] = uni;
- *pt = '.';
- }
- if ( strstr(pt,".vert")!=NULL )
- rotated = UniGetRotatedGlyph(fv,sc,buf[0]!='?'?buf[0]:-1);
- if ( buf[0]!='?' ) {
- fg = def_fg;
- if ( strstr(pt,".italic")!=NULL )
- styles = _uni_italic|_uni_mono;
- }
- } else if ( strncmp(sc->name,"hwuni",5)==0 ) {
- int uni=-1;
- sscanf(sc->name,"hwuni%x", (unsigned *) &uni );
- if ( uni!=-1 ) buf[0] = uni;
- } else if ( strncmp(sc->name,"italicuni",9)==0 ) {
- int uni=-1;
- sscanf(sc->name,"italicuni%x", (unsigned *) &uni );
- if ( uni!=-1 ) { buf[0] = uni; styles=_uni_italic|_uni_mono; }
- fg = def_fg;
- } else if ( strncmp(sc->name,"vertcid_",8)==0 ||
- strncmp(sc->name,"vertuni",7)==0 ) {
- rotated = UniGetRotatedGlyph(fv,sc,-1);
- }
- }
- break;
- }
- bg = COLOR_DEFAULT;
- r.x = j*fv->cbw+1; r.width = fv->cbw-1;
- r.y = i*fv->cbh+1; r.height = fv->lab_height-1;
- if ( sc->layers[ly_back].splines!=NULL || sc->layers[ly_back].images!=NULL ||
- sc->color!=COLOR_DEFAULT ) {
- bg = sc->color!=COLOR_DEFAULT?sc->color:0x808080;
- GDrawFillRect(pixmap,&r,bg);
- }
- if ( (!fv->sf->order2 && sc->changedsincelasthinted ) ||
- ( fv->sf->order2 && sc->layers[ly_fore].splines!=NULL &&
- sc->ttf_instrs_len<=0 ) ||
- ( fv->sf->order2 && sc->instructions_out_of_date ) ) {
- Color hintcol = 0x0000ff;
- if ( fv->sf->order2 && sc->instructions_out_of_date && sc->ttf_instrs_len>0 )
- hintcol = 0xff0000;
- GDrawDrawLine(pixmap,r.x,r.y,r.x,r.y+r.height-1,hintcol);
- GDrawDrawLine(pixmap,r.x+1,r.y,r.x+1,r.y+r.height-1,hintcol);
- GDrawDrawLine(pixmap,r.x+2,r.y,r.x+2,r.y+r.height-1,hintcol);
- GDrawDrawLine(pixmap,r.x+r.width-1,r.y,r.x+r.width-1,r.y+r.height-1,hintcol);
- GDrawDrawLine(pixmap,r.x+r.width-2,r.y,r.x+r.width-2,r.y+r.height-1,hintcol);
- GDrawDrawLine(pixmap,r.x+r.width-3,r.y,r.x+r.width-3,r.y+r.height-1,hintcol);
- }
- if ( rotated!=NULL ) {
- GDrawPushClip(pixmap,&r,&old2);
- GDrawDrawImage(pixmap,rotated,NULL,j*fv->cbw+2,i*fv->cbh+2);
- GDrawPopClip(pixmap,&old2);
- GImageDestroy(rotated);
- rotated = NULL;
- } else if ( use_utf8 ) {
- GTextBounds size;
- if ( styles!=laststyles ) GDrawSetFont(pixmap,FVCheckFont(fv,styles));
- width = GDrawGetText8Bounds(pixmap,utf8_buf,-1,mods,&size);
- if ( size.lbearing==0 && size.rbearing==0 ) {
- utf8_buf[0] = 0xe0 | (0xfffd>>12);
- utf8_buf[1] = 0x80 | ((0xfffd>>6)&0x3f);
- utf8_buf[2] = 0x80 | (0xfffd&0x3f);
- utf8_buf[3] = 0;
- width = GDrawGetText8Bounds(pixmap,utf8_buf,-1,mods,&size);
- }
- width = size.rbearing - size.lbearing+1;
- if ( width >= fv->cbw-1 ) {
- GDrawPushClip(pixmap,&r,&old2);
- width = fv->cbw-1;
- }
- if ( sc->unicodeenc<0x80 || sc->unicodeenc>=0xa0 )
- GDrawDrawText8(pixmap,j*fv->cbw+(fv->cbw-1-width)/2-size.lbearing,i*fv->cbh+fv->lab_as+1,utf8_buf,-1,mods,fg);
- if ( width >= fv->cbw-1 )
- GDrawPopClip(pixmap,&old2);
- laststyles = styles;
- } else {
- if ( styles!=laststyles ) GDrawSetFont(pixmap,FVCheckFont(fv,styles));
- width = GDrawGetTextWidth(pixmap,buf,-1,mods);
- if ( width >= fv->cbw-1 ) {
- GDrawPushClip(pixmap,&r,&old2);
- width = fv->cbw-1;
- }
- if ( sc->unicodeenc<0x80 || sc->unicodeenc>=0xa0 )
- GDrawDrawText(pixmap,j*fv->cbw+(fv->cbw-1-width)/2,i*fv->cbh+fv->lab_as+1,buf,-1,mods,fg);
- if ( width >= fv->cbw-1 )
- GDrawPopClip(pixmap,&old2);
- laststyles = styles;
- }
- changed = sc->changed;
- if ( fv->sf->onlybitmaps )
- changed = gid==-1 || fv->show->glyphs[gid]==NULL? false : fv->show->glyphs[gid]->changed;
- if ( changed ) {
- GRect r;
- r.x = j*fv->cbw+1; r.width = fv->cbw-1;
- r.y = i*fv->cbh+1; r.height = fv->lab_height-1;
- if ( bg == COLOR_DEFAULT )
- bg = GDrawGetDefaultBackground(GDrawGetDisplayOfWindow(fv->v));
- GDrawSetXORBase(pixmap,bg);
- GDrawSetXORMode(pixmap);
- GDrawFillRect(pixmap,&r,0x000000);
- GDrawSetCopyMode(pixmap);
- }
- }
-
- feat_gid = FeatureTrans(fv,index);
- sc = feat_gid!=-1 ? fv->sf->glyphs[feat_gid]: NULL;
- if ( !SCWorthOutputting(sc) ) {
- int x = j*fv->cbw+1, xend = x+fv->cbw-2;
- int y = i*fv->cbh+fv->lab_height+1, yend = y+fv->cbw-1;
- GDrawDrawLine(pixmap,x,y,xend,yend,0xd08080);
- GDrawDrawLine(pixmap,x,yend,xend,y,0xd08080);
- }
- if ( sc!=NULL ) {
- BDFChar *bdfc;
-
- if ( fv->show!=NULL && fv->show->piecemeal &&
- feat_gid!=-1 && fv->show->glyphs[feat_gid]==NULL &&
- fv->sf->glyphs[feat_gid]!=NULL )
- BDFPieceMeal(fv->show,feat_gid);
-
- if ( fv->show!=NULL && feat_gid!=-1 &&
- feat_gid < fv->show->glyphcnt &&
- fv->show->glyphs[feat_gid]==NULL &&
- SCWorthOutputting(fv->sf->glyphs[feat_gid]) ) {
- /* If we have an outline but no bitmap for this slot */
- box.x = j*fv->cbw+1; box.width = fv->cbw-2;
- box.y = i*fv->cbh+fv->lab_height+2; box.height = box.width+1;
- GDrawDrawRect(pixmap,&box,0xff0000);
- ++box.x; ++box.y; box.width -= 2; box.height -= 2;
- GDrawDrawRect(pixmap,&box,0xff0000);
-/* When reencoding a font we can find times where index>=show->charcnt */
- } else if ( fv->show!=NULL && feat_gid<fv->show->glyphcnt && feat_gid!=-1 &&
- fv->show->glyphs[feat_gid]!=NULL ) {
- bdfc = fv->show->glyphs[feat_gid];
- base.data = bdfc->bitmap;
- base.bytes_per_line = bdfc->bytes_per_line;
- base.width = bdfc->xmax-bdfc->xmin+1;
- base.height = bdfc->ymax-bdfc->ymin+1;
- box.x = j*fv->cbw; box.width = fv->cbw;
- box.y = i*fv->cbh+fv->lab_height+1; box.height = box.width+1;
- GDrawPushClip(pixmap,&box,&old2);
- if ( !fv->sf->onlybitmaps && fv->show!=fv->filled &&
- sc->layers[ly_fore].splines==NULL && sc->layers[ly_fore].refs==NULL &&
- !sc->widthset &&
- !(bdfc->xmax<=0 && bdfc->xmin==0 && bdfc->ymax<=0 && bdfc->ymax==0) ) {
- /* If we have a bitmap but no outline character... */
- GRect b;
- b.x = box.x+1; b.y = box.y+1; b.width = box.width-2; b.height = box.height-2;
- GDrawDrawRect(pixmap,&b,0x008000);
- ++b.x; ++b.y; b.width -= 2; b.height -= 2;
- GDrawDrawRect(pixmap,&b,0x008000);
- }
- /* I assume that the bitmap image matches the bounding*/
- /* box. In some bitmap fonts the bitmap has white space on the*/
- /* right. This can throw off the centering algorithem */
- if ( fv->magnify>1 ) {
- GDrawDrawImageMagnified(pixmap,&gi,NULL,
- j*fv->cbw+(fv->cbw-1-fv->magnify*base.width)/2,
- i*fv->cbh+fv->lab_height+1+fv->magnify*(fv->show->ascent-bdfc->ymax),
- fv->magnify*base.width,fv->magnify*base.height);
- } else
- GDrawDrawImage(pixmap,&gi,NULL,
- j*fv->cbw+(fv->cbw-1-base.width)/2,
- i*fv->cbh+fv->lab_height+1+fv->show->ascent-bdfc->ymax);
- if ( fv->showhmetrics ) {
- int x1, x0 = j*fv->cbw+(fv->cbw-1-fv->magnify*base.width)/2- bdfc->xmin*fv->magnify;
- /* Draw advance width & horizontal origin */
- if ( fv->showhmetrics&fvm_origin )
- GDrawDrawLine(pixmap,x0,i*fv->cbh+fv->lab_height+yorg-3,x0,
- i*fv->cbh+fv->lab_height+yorg+2,METRICS_ORIGIN);
- x1 = x0 + bdfc->width;
- if ( fv->showhmetrics&fvm_advanceat )
- GDrawDrawLine(pixmap,x1,i*fv->cbh+fv->lab_height+1,x1,
- (i+1)*fv->cbh-1,METRICS_ADVANCE);
- if ( fv->showhmetrics&fvm_advanceto )
- GDrawDrawLine(pixmap,x0,(i+1)*fv->cbh-2,x1,
- (i+1)*fv->cbh-2,METRICS_ADVANCE);
- }
- if ( fv->showvmetrics ) {
- int x0 = j*fv->cbw+(fv->cbw-1-fv->magnify*base.width)/2- bdfc->xmin*fv->magnify
- + fv->magnify*fv->show->pixelsize/2;
- int y0 = i*fv->cbh+fv->lab_height+yorg;
- int yvw = y0 + fv->magnify*sc->vwidth*fv->show->pixelsize/em;
- if ( fv->showvmetrics&fvm_baseline )
- GDrawDrawLine(pixmap,x0,i*fv->cbh+fv->lab_height+1,x0,
- (i+1)*fv->cbh-1,METRICS_BASELINE);
- if ( fv->showvmetrics&fvm_advanceat )
- GDrawDrawLine(pixmap,j*fv->cbw,yvw,(j+1)*fv->cbw,
- yvw,METRICS_ADVANCE);
- if ( fv->showvmetrics&fvm_advanceto )
- GDrawDrawLine(pixmap,j*fv->cbw+2,y0,j*fv->cbw+2,
- yvw,METRICS_ADVANCE);
- if ( fv->showvmetrics&fvm_origin )
- GDrawDrawLine(pixmap,x0-3,i*fv->cbh+fv->lab_height+yorg,x0+2,i*fv->cbh+fv->lab_height+yorg,METRICS_ORIGIN);
- }
- GDrawPopClip(pixmap,&old2);
- }
- }
- if ( index<fv->map->enccount && fv->selected[index] ) {
- box.x = j*fv->cbw+1; box.width = fv->cbw-1;
- box.y = i*fv->cbh+fv->lab_height+1; box.height = fv->cbw;
- GDrawSetXORMode(pixmap);
- GDrawSetXORBase(pixmap,GDrawGetDefaultBackground(NULL));
- GDrawFillRect(pixmap,&box,XOR_COLOR);
- GDrawSetCopyMode(pixmap);
- }
- }
- if ( fv->showhmetrics&fvm_baseline ) {
- int baseline = (fv->sf->ascent*fv->magnify*fv->show->pixelsize)/em+1;
- for ( i=0; i<=fv->rowcnt; ++i )
- GDrawDrawLine(pixmap,0,i*fv->cbh+fv->lab_height+baseline,fv->width,i*fv->cbh+fv->lab_height+baseline,METRICS_BASELINE);
- }
- GDrawPopClip(pixmap,&old);
- GDrawSetDither(NULL, true);
-}
-
-static char *chosung[] = { "G", "GG", "N", "D", "DD", "L", "M", "B", "BB", "S", "SS", "", "J", "JJ", "C", "K", "T", "P", "H", NULL };
-static char *jungsung[] = { "A", "AE", "YA", "YAE", "EO", "E", "YEO", "YE", "O", "WA", "WAE", "OE", "YO", "U", "WEO", "WE", "WI", "YU", "EU", "YI", "I", NULL };
-static char *jongsung[] = { "", "G", "GG", "GS", "N", "NJ", "NH", "D", "L", "LG", "LM", "LB", "LS", "LT", "LP", "LH", "M", "B", "BS", "S", "SS", "NG", "J", "C", "K", "T", "P", "H", NULL };
-
-static void FVDrawInfo(FontView *fv,GWindow pixmap,GEvent *event) {
- GRect old, r;
- char buffer[250], *pt;
- unichar_t ubuffer[250];
- Color bg = GDrawGetDefaultBackground(GDrawGetDisplayOfWindow(pixmap));
- SplineChar *sc, dummy;
- SplineFont *sf = fv->sf;
- EncMap *map = fv->map;
- int gid;
- int uni;
- Color fg = 0xff0000;
- int ulen, tlen;
-
- if ( event->u.expose.rect.y+event->u.expose.rect.height<=fv->mbh )
-return;
-
- GDrawSetFont(pixmap,fv->fontset[0]);
- GDrawPushClip(pixmap,&event->u.expose.rect,&old);
-
- r.x = 0; r.width = fv->width; r.y = fv->mbh; r.height = fv->infoh;
- GDrawFillRect(pixmap,&r,bg);
- if ( fv->end_pos>=map->enccount || fv->pressed_pos>=map->enccount ||
- fv->end_pos<0 || fv->pressed_pos<0 )
- fv->end_pos = fv->pressed_pos = -1; /* Can happen after reencoding */
- if ( fv->end_pos == -1 )
-return;
-
- if ( map->remap!=NULL ) {
- int localenc = fv->end_pos;
- struct remap *remap = map->remap;
- while ( remap->infont!=-1 ) {
- if ( localenc>=remap->infont && localenc<=remap->infont+(remap->lastenc-remap->firstenc) ) {
- localenc += remap->firstenc-remap->infont;
- break;
- }
- ++remap;
- }
- sprintf( buffer, "%-5d (0x%04x) ", localenc, localenc );
- } else if ( map->enc->only_1byte ||
- (map->enc->has_1byte && fv->end_pos<256))
- sprintf( buffer, "%-3d (0x%02x) ", fv->end_pos, fv->end_pos );
- else
- sprintf( buffer, "%-5d (0x%04x) ", fv->end_pos, fv->end_pos );
- sc = (gid=fv->map->map[fv->end_pos])!=-1 ? sf->glyphs[gid] : NULL;
- SCBuildDummy(&dummy,sf,fv->map,fv->end_pos);
- if ( sc==NULL ) sc = &dummy;
- uni = dummy.unicodeenc!=-1 ? dummy.unicodeenc : sc->unicodeenc;
- if ( uni!=-1 )
- sprintf( buffer+strlen(buffer), "U+%04X", uni );
- else
- sprintf( buffer+strlen(buffer), "U+????" );
- sprintf( buffer+strlen(buffer), " %.*s", (int) (sizeof(buffer)-strlen(buffer)-1),
- sc->name );
-
- strcat(buffer," ");
- utf82u_strcpy(ubuffer,buffer);
- ulen = u_strlen(ubuffer);
-
- if ( uni==-1 && (pt=strchr(sc->name,'.'))!=NULL && pt-sc->name<30 ) {
- strncpy(buffer,sc->name,pt-sc->name);
- buffer[(pt-sc->name)] = '\0';
- uni = UniFromName(buffer,fv->sf->uni_interp,map->enc);
- if ( uni!=-1 ) {
- sprintf( buffer, "U+%04X ", uni );
- uc_strcat(ubuffer,buffer);
- }
- fg = 0x707070;
- }
- if ( uni!=-1 && uni<0x110000 && _UnicodeNameAnnot!=NULL &&
- _UnicodeNameAnnot[uni>>16][(uni>>8)&0xff][uni&0xff].name!=NULL ) {
- uc_strncat(ubuffer, _UnicodeNameAnnot[uni>>16][(uni>>8)&0xff][uni&0xff].name, 80);
- } else if ( uni>=0xAC00 && uni<=0xD7A3 ) {
- sprintf( buffer, "Hangul Syllable %s%s%s",
- chosung[(uni-0xAC00)/(21*28)],
- jungsung[(uni-0xAC00)/28%21],
- jongsung[(uni-0xAC00)%28] );
- uc_strncat(ubuffer,buffer,80);
- } else if ( uni!=-1 ) {
- uc_strncat(ubuffer, UnicodeRange(uni),80);
- }
-
- tlen = GDrawDrawText(pixmap,10,fv->mbh+fv->lab_as,ubuffer,ulen,NULL,0xff0000);
- GDrawDrawText(pixmap,10+tlen,fv->mbh+fv->lab_as,ubuffer+ulen,-1,NULL,fg);
- GDrawPopClip(pixmap,&old);
-}
-
-static void FVShowInfo(FontView *fv) {
- GRect r;
-
- if ( fv->v==NULL ) /* Can happen in scripts */
-return;
-
- r.x = 0; r.width = fv->width; r.y = fv->mbh; r.height = fv->infoh;
- GDrawRequestExpose(fv->gw,&r,false);
-}
-
-static void FVChar(FontView *fv,GEvent *event) {
- int i,pos, cnt, gid;
-
-#if MyMemory
- if ( event->u.chr.keysym == GK_F2 ) {
- fprintf( stderr, "Malloc debug on\n" );
- __malloc_debug(5);
- } else if ( event->u.chr.keysym == GK_F3 ) {
- fprintf( stderr, "Malloc debug off\n" );
- __malloc_debug(0);
- }
-#endif
-
- if ( event->u.chr.keysym=='s' &&
- (event->u.chr.state&ksm_control) &&
- (event->u.chr.state&ksm_meta) )
- MenuSaveAll(NULL,NULL,NULL);
- else if ( event->u.chr.keysym=='q' &&
- (event->u.chr.state&ksm_control) &&
- (event->u.chr.state&ksm_meta) )
- MenuExit(NULL,NULL,NULL);
- else if ( event->u.chr.keysym=='I' &&
- (event->u.chr.state&ksm_shift) &&
- (event->u.chr.state&ksm_meta) )
- FVMenuCharInfo(fv->gw,NULL,NULL);
- else if ( (event->u.chr.keysym=='[' || event->u.chr.keysym==']') &&
- (event->u.chr.state&ksm_control) ) {
- _FVMenuChangeChar(fv,event->u.chr.keysym=='['?MID_Prev:MID_Next);
- } else if ( (event->u.chr.keysym=='{' || event->u.chr.keysym=='}') &&
- (event->u.chr.state&ksm_control) ) {
- _FVMenuChangeChar(fv,event->u.chr.keysym=='{'?MID_PrevDef:MID_NextDef);
- } else if ( event->u.chr.keysym=='\\' && (event->u.chr.state&ksm_control) ) {
- /* European keyboards need a funky modifier to get \ */
- FVDoTransform(fv);
-#if !defined(_NO_FFSCRIPT) || !defined(_NO_PYTHON)
- } else if ( isdigit(event->u.chr.keysym) && (event->u.chr.state&ksm_control) &&
- (event->u.chr.state&ksm_meta) ) {
- /* The Script menu isn't always up to date, so we might get one of */
- /* the shortcuts here */
- int index = event->u.chr.keysym-'1';
- if ( index<0 ) index = 9;
- if ( script_filenames[index]!=NULL )
- ExecuteScriptFile(fv,script_filenames[index]);
-#endif
- } else if ( event->u.chr.keysym == GK_Left ||
- event->u.chr.keysym == GK_Tab ||
- event->u.chr.keysym == GK_BackTab ||
- event->u.chr.keysym == GK_Up ||
- event->u.chr.keysym == GK_Right ||
- event->u.chr.keysym == GK_Down ||
- event->u.chr.keysym == GK_KP_Left ||
- event->u.chr.keysym == GK_KP_Up ||
- event->u.chr.keysym == GK_KP_Right ||
- event->u.chr.keysym == GK_KP_Down ||
- event->u.chr.keysym == GK_Home ||
- event->u.chr.keysym == GK_KP_Home ||
- event->u.chr.keysym == GK_End ||
- event->u.chr.keysym == GK_KP_End ||
- event->u.chr.keysym == GK_Page_Up ||
- event->u.chr.keysym == GK_KP_Page_Up ||
- event->u.chr.keysym == GK_Prior ||
- event->u.chr.keysym == GK_Page_Down ||
- event->u.chr.keysym == GK_KP_Page_Down ||
- event->u.chr.keysym == GK_Next ) {
- int end_pos = fv->end_pos;
- /* We move the currently selected char. If there is none, then pick */
- /* something on the screen */
- if ( end_pos==-1 )
- end_pos = (fv->rowoff+fv->rowcnt/2)*fv->colcnt;
- switch ( event->u.chr.keysym ) {
- case GK_Tab:
- pos = end_pos;
- do {
- if ( event->u.chr.state&ksm_shift )
- --pos;
- else
- ++pos;
- if ( pos>=fv->map->enccount ) pos = 0;
- else if ( pos<0 ) pos = fv->map->enccount-1;
- } while ( pos!=end_pos &&
- ((gid=fv->map->map[pos])==-1 || !SCWorthOutputting(fv->sf->glyphs[gid])));
- if ( pos==end_pos ) ++pos;
- if ( pos>=fv->map->enccount ) pos = 0;
- break;
-#if GK_Tab!=GK_BackTab
- case GK_BackTab:
- pos = end_pos;
- do {
- --pos;
- if ( pos<0 ) pos = fv->map->enccount-1;
- } while ( pos!=end_pos &&
- ((gid=fv->map->map[pos])==-1 || !SCWorthOutputting(fv->sf->glyphs[gid])));
- if ( pos==end_pos ) --pos;
- if ( pos<0 ) pos = 0;
- break;
-#endif
- case GK_Left: case GK_KP_Left:
- pos = end_pos-1;
- break;
- case GK_Right: case GK_KP_Right:
- pos = end_pos+1;
- break;
- case GK_Up: case GK_KP_Up:
- pos = end_pos-fv->colcnt;
- break;
- case GK_Down: case GK_KP_Down:
- pos = end_pos+fv->colcnt;
- break;
- case GK_End: case GK_KP_End:
- pos = fv->map->enccount;
- break;
- case GK_Home: case GK_KP_Home:
- pos = 0;
- if ( fv->sf->top_enc!=-1 && fv->sf->top_enc<fv->map->enccount )
- pos = fv->sf->top_enc;
- else {
- pos = SFFindSlot(fv->sf,fv->map,'A',NULL);
- if ( pos==-1 ) pos = 0;
- }
- break;
- case GK_Page_Up: case GK_KP_Page_Up:
-#if GK_Prior!=GK_Page_Up
- case GK_Prior:
-#endif
- pos = (fv->rowoff-fv->rowcnt+1)*fv->colcnt;
- break;
- case GK_Page_Down: case GK_KP_Page_Down:
-#if GK_Next!=GK_Page_Down
- case GK_Next:
-#endif
- pos = (fv->rowoff+fv->rowcnt+1)*fv->colcnt;
- break;
- }
- if ( pos<0 ) pos = 0;
- if ( pos>=fv->map->enccount ) pos = fv->map->enccount-1;
- if ( event->u.chr.state&ksm_shift && event->u.chr.keysym!=GK_Tab && event->u.chr.keysym!=GK_BackTab ) {
- FVReselect(fv,pos);
- } else {
- FVDeselectAll(fv);
- fv->selected[pos] = true;
- FVToggleCharSelected(fv,pos);
- fv->pressed_pos = pos;
- fv->sel_index = 1;
- }
- fv->end_pos = pos;
- FVShowInfo(fv);
- FVScrollToChar(fv,pos);
- } else if ( event->u.chr.keysym == GK_Help ) {
- MenuHelp(NULL,NULL,NULL); /* Menu does F1 */
- } else if ( event->u.chr.keysym == GK_Escape ) {
- FVDeselectAll(fv);
- } else if ( event->u.chr.chars[0]=='\r' || event->u.chr.chars[0]=='\n' ) {
- for ( i=cnt=0; i<fv->map->enccount && cnt<10; ++i ) if ( fv->selected[i] ) {
- SplineChar *sc = SFMakeChar(fv->sf,fv->map,i);
- if ( fv->show==fv->filled ) {
- CharViewCreate(sc,fv,i);
- } else {
- BDFFont *bdf = fv->show;
- BitmapViewCreate(BDFMakeGID(bdf,sc->orig_pos),bdf,fv,i);
- }
- ++cnt;
- }
- } else if ( event->u.chr.chars[0]<=' ' || event->u.chr.chars[1]!='\0' ) {
- /* Do Nothing */;
- } else {
- SplineFont *sf = fv->sf;
- for ( i=0; i<sf->glyphcnt; ++i ) {
- if ( sf->glyphs[i]!=NULL )
- if ( sf->glyphs[i]->unicodeenc==event->u.chr.chars[0] )
- break;
- }
- if ( i==sf->glyphcnt ) {
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->map->map[i]==-1 ) {
- SplineChar dummy;
- SCBuildDummy(&dummy,sf,fv->map,i);
- if ( dummy.unicodeenc==event->u.chr.chars[0] )
- break;
- }
- } else
- i = fv->map->backmap[i];
- if ( i!=fv->map->enccount && i!=-1 )
- FVChangeChar(fv,i);
- }
-}
-
-static void uc_annot_strncat(unichar_t *to, const char *from, int len) {
- register unichar_t ch;
-
- to += u_strlen(to);
- while ( (ch = *(unsigned char *) from++) != '\0' && --len>=0 ) {
- if ( from[-2]=='\t' ) {
- if ( ch=='*' ) ch = 0x2022;
- else if ( ch=='x' ) ch = 0x2192;
- else if ( ch==':' ) ch = 0x224d;
- else if ( ch=='#' ) ch = 0x2245;
- } else if ( ch=='\t' ) {
- *(to++) = ' ';
- ch = ' ';
- }
- *(to++) = ch;
- }
- *to = 0;
-}
-
-void SCPreparePopup(GWindow gw,SplineChar *sc,struct remap *remap, int localenc,
- int actualuni) {
- static unichar_t space[810];
- char cspace[162];
- int upos=-1;
- int done = false;
-
- /* If a glyph is multiply mapped then the inbuild unicode enc may not be */
- /* the actual one used to access the glyph */
- if ( remap!=NULL ) {
- while ( remap->infont!=-1 ) {
- if ( localenc>=remap->infont && localenc<=remap->infont+(remap->lastenc-remap->firstenc) ) {
- localenc += remap->firstenc-remap->infont;
- break;
- }
- ++remap;
- }
- }
-
- if ( actualuni!=-1 )
- upos = actualuni;
- else if ( sc->unicodeenc!=-1 )
- upos = sc->unicodeenc;
-#if HANYANG
- else if ( sc->compositionunit ) {
- if ( sc->jamo<19 )
- upos = 0x1100+sc->jamo;
- else if ( sc->jamo<19+21 )
- upos = 0x1161 + sc->jamo-19;
- else /* Leave a hole for the blank char */
- upos = 0x11a8 + sc->jamo-(19+21+1);
- }
-#endif
- else {
-#if defined( _NO_SNPRINTF ) || defined( __VMS )
- sprintf( cspace, "%u 0x%x U+???? \"%.25s\" ", localenc, localenc, sc->name==NULL?"":sc->name );
-#else
- snprintf( cspace, sizeof(cspace), "%u 0x%x U+???? \"%.25s\" ", localenc, localenc, sc->name==NULL?"":sc->name );
-#endif
- uc_strcpy(space,cspace);
- done = true;
- }
- if ( done )
- /* Do Nothing */;
- else if ( upos<0x110000 && _UnicodeNameAnnot!=NULL &&
- _UnicodeNameAnnot[upos>>16][(upos>>8)&0xff][upos&0xff].name!=NULL ) {
-#if defined( _NO_SNPRINTF ) || defined( __VMS )
- sprintf( cspace, "%u 0x%x U+%04x \"%.25s\" %.100s", localenc, localenc, upos, sc->name==NULL?"":sc->name,
- _UnicodeNameAnnot[upos>>16][(upos>>8)&0xff][upos&0xff].name);
-#else
- snprintf( cspace, sizeof(cspace), "%u 0x%x U+%04x \"%.25s\" %.100s", localenc, localenc, upos, sc->name==NULL?"":sc->name,
- _UnicodeNameAnnot[upos>>16][(upos>>8)&0xff][upos&0xff].name);
-#endif
- utf82u_strcpy(space,cspace);
- } else if ( upos>=0xAC00 && upos<=0xD7A3 ) {
-#if defined( _NO_SNPRINTF ) || defined( __VMS )
- sprintf( cspace, "%u 0x%x U+%04x \"%.25s\" Hangul Syllable %s%s%s",
- localenc, localenc, upos, sc->name==NULL?"":sc->name,
- chosung[(upos-0xAC00)/(21*28)],
- jungsung[(upos-0xAC00)/28%21],
- jongsung[(upos-0xAC00)%28] );
-#else
- snprintf( cspace, sizeof(cspace), "%u 0x%x U+%04x \"%.25s\" Hangul Syllable %s%s%s",
- localenc, localenc, upos, sc->name==NULL?"":sc->name,
- chosung[(upos-0xAC00)/(21*28)],
- jungsung[(upos-0xAC00)/28%21],
- jongsung[(upos-0xAC00)%28] );
-#endif
- utf82u_strcpy(space,cspace);
- } else {
-#if defined( _NO_SNPRINTF ) || defined( __VMS )
- sprintf( cspace, "%u 0x%x U+%04x \"%.25s\" %.50s", localenc, localenc, upos, sc->name==NULL?"":sc->name,
- UnicodeRange(upos));
-#else
- snprintf( cspace, sizeof(cspace), "%u 0x%x U+%04x \"%.25s\" %.50s", localenc, localenc, upos, sc->name==NULL?"":sc->name,
- UnicodeRange(upos));
-#endif
- utf82u_strcpy(space,cspace);
- }
- if ( upos>=0 && upos<0x110000 && _UnicodeNameAnnot!=NULL &&
- _UnicodeNameAnnot[upos>>16][(upos>>8)&0xff][upos&0xff].annot!=NULL ) {
- int left = sizeof(space)/sizeof(space[0]) - u_strlen(space)-1;
- if ( left>4 ) {
- uc_strcat(space,"\n");
- uc_annot_strncat(space,_UnicodeNameAnnot[upos>>16][(upos>>8)&0xff][upos&0xff].annot,left-2);
- }
- }
- if ( sc->comment!=NULL ) {
- int left = sizeof(space)/sizeof(space[0]) - u_strlen(space)-1;
- if ( left>4 ) {
- uc_strcat(space,"\n\n");
- utf82u_strncpy(space+u_strlen(space),sc->comment,left-2);
- }
- }
- GGadgetPreparePopup(gw,space);
-}
-
-static void noop(void *_fv) {
-}
-
-static void *ddgencharlist(void *_fv,int32 *len) {
- int i,j,cnt, gid;
- FontView *fv = (FontView *) _fv;
- SplineFont *sf = fv->sf;
- EncMap *map = fv->map;
- char *data;
-
- for ( i=cnt=0; i<map->enccount; ++i ) if ( fv->selected[i] && (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL )
- cnt += strlen(sf->glyphs[gid]->name)+1;
- data = galloc(cnt+1); data[0] = '\0';
- for ( cnt=0, j=1 ; j<=fv->sel_index; ++j ) {
- for ( i=cnt=0; i<map->enccount; ++i )
- if ( fv->selected[i] && (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- strcpy(data+cnt,sf->glyphs[gid]->name);
- cnt += strlen(sf->glyphs[gid]->name);
- strcpy(data+cnt++," ");
- }
- }
- if ( cnt>0 )
- data[--cnt] = '\0';
- *len = cnt;
-return( data );
-}
-
-static void FVMouse(FontView *fv,GEvent *event) {
- int pos = (event->u.mouse.y/fv->cbh + fv->rowoff)*fv->colcnt + event->u.mouse.x/fv->cbw;
- int gid;
- int realpos = pos;
- SplineChar *sc, dummy;
- int dopopup = true;
- extern int OpenCharsInNewWindow;
-
- if ( event->type==et_mousedown )
- CVPaletteDeactivate();
- if ( pos<0 ) {
- pos = 0;
- dopopup = false;
- } else if ( pos>=fv->map->enccount ) {
- pos = fv->map->enccount-1;
- if ( pos<0 ) /* No glyph slots in font */
-return;
- dopopup = false;
- }
-
- sc = (gid=fv->map->map[pos])!=-1 ? fv->sf->glyphs[gid] : NULL;
- if ( sc==NULL )
- sc = SCBuildDummy(&dummy,fv->sf,fv->map,pos);
- if ( event->type == et_mouseup && event->u.mouse.clicks==2 ) {
- if ( fv->cur_subtable!=NULL ) {
- sc = FVMakeChar(fv,pos);
- pos = fv->map->backmap[sc->orig_pos];
- }
- if ( sc==&dummy ) {
- sc = SFMakeChar(fv->sf,fv->map,pos);
- gid = fv->map->map[pos];
- }
- if ( fv->show==fv->filled ) {
- SplineFont *sf = fv->sf;
- gid = -1;
- if ( !OpenCharsInNewWindow )
- for ( gid=sf->glyphcnt-1; gid>=0; --gid )
- if ( sf->glyphs[gid]!=NULL && sf->glyphs[gid]->views!=NULL )
- break;
- if ( gid!=-1 ) {
- CharView *cv = sf->glyphs[gid]->views;
- CVChangeSC(cv,sc);
- GDrawSetVisible(cv->gw,true);
- GDrawRaise(cv->gw);
- } else
- CharViewCreate(sc,fv,pos);
- } else {
- BDFFont *bdf = fv->show;
- BDFChar *bc =BDFMakeGID(bdf,gid);
- gid = -1;
- if ( !OpenCharsInNewWindow )
- for ( gid=bdf->glyphcnt-1; gid>=0; --gid )
- if ( bdf->glyphs[gid]!=NULL && bdf->glyphs[gid]->views!=NULL )
- break;
- if ( gid!=-1 ) {
- BitmapView *bv = bdf->glyphs[gid]->views;
- BVChangeBC(bv,bc,true);
- GDrawSetVisible(bv->gw,true);
- GDrawRaise(bv->gw);
- } else
- BitmapViewCreate(bc,bdf,fv,pos);
- }
- } else if ( event->type == et_mousemove ) {
- if ( dopopup )
- SCPreparePopup(fv->v,sc,fv->map->remap,pos,sc==&dummy?dummy.unicodeenc: UniFromEnc(pos,fv->map->enc));
- }
- if ( event->type == et_mousedown ) {
- if ( fv->drag_and_drop ) {
- GDrawSetCursor(fv->v,ct_mypointer);
- fv->any_dd_events_sent = fv->drag_and_drop = false;
- }
- if ( !(event->u.mouse.state&ksm_shift) && event->u.mouse.clicks<=1 ) {
- if ( !fv->selected[pos] )
- FVDeselectAll(fv);
- else if ( event->u.mouse.button!=3 ) {
- fv->drag_and_drop = fv->has_dd_no_cursor = true;
- fv->any_dd_events_sent = false;
- GDrawSetCursor(fv->v,ct_prohibition);
- GDrawGrabSelection(fv->v,sn_drag_and_drop);
- GDrawAddSelectionType(fv->v,sn_drag_and_drop,"STRING",fv,0,sizeof(char),
- ddgencharlist,noop);
- }
- }
- fv->pressed_pos = fv->end_pos = pos;
- FVShowInfo(fv);
- if ( !fv->drag_and_drop ) {
- if ( !(event->u.mouse.state&ksm_shift))
- fv->sel_index = 1;
- else if ( fv->sel_index<255 )
- ++fv->sel_index;
- if ( fv->pressed!=NULL )
- GDrawCancelTimer(fv->pressed);
- else if ( event->u.mouse.state&ksm_shift ) {
- fv->selected[pos] = fv->selected[pos] ? 0 : fv->sel_index;
- FVToggleCharSelected(fv,pos);
- } else if ( !fv->selected[pos] ) {
- fv->selected[pos] = fv->sel_index;
- FVToggleCharSelected(fv,pos);
- }
- if ( event->u.mouse.button==3 )
- GMenuCreatePopupMenu(fv->v,event, fvpopupmenu);
- else
- fv->pressed = GDrawRequestTimer(fv->v,200,100,NULL);
- }
- } else if ( fv->drag_and_drop ) {
- if ( event->u.mouse.x>=0 && event->u.mouse.y>=-fv->mbh-fv->infoh-4 &&
- event->u.mouse.x<=fv->width+20 && event->u.mouse.y<fv->height ) {
- if ( !fv->has_dd_no_cursor ) {
- fv->has_dd_no_cursor = true;
- GDrawSetCursor(fv->v,ct_prohibition);
- }
- } else {
- if ( fv->has_dd_no_cursor ) {
- fv->has_dd_no_cursor = false;
- GDrawSetCursor(fv->v,ct_ddcursor);
- }
- GDrawPostDragEvent(fv->v,event,event->type==et_mouseup?et_drop:et_drag);
- fv->any_dd_events_sent = true;
- }
- if ( event->type==et_mouseup ) {
- fv->drag_and_drop = fv->has_dd_no_cursor = false;
- GDrawSetCursor(fv->v,ct_mypointer);
- if ( !fv->any_dd_events_sent )
- FVDeselectAll(fv);
- fv->any_dd_events_sent = false;
- }
- } else if ( fv->pressed!=NULL ) {
- int showit = realpos!=fv->end_pos;
- FVReselect(fv,realpos);
- if ( showit )
- FVShowInfo(fv);
- if ( event->type==et_mouseup ) {
- GDrawCancelTimer(fv->pressed);
- fv->pressed = NULL;
- }
- }
- if ( event->type==et_mouseup && dopopup )
- SCPreparePopup(fv->v,sc,fv->map->remap,pos,sc==&dummy?dummy.unicodeenc: UniFromEnc(pos,fv->map->enc));
- if ( event->type==et_mouseup )
- SVAttachFV(fv,2);
-}
-
-#if defined(FONTFORGE_CONFIG_GTK)
-gboolean FontView_ViewportResize(GtkWidget *widget, GdkEventConfigure *event,
- gpointer user_data) {
- extern int default_fv_row_count, default_fv_col_count;
- int cc, rc;
- FontView *fv = (FontView *) g_object_get_data( widget, "data" );
-
- cc = (event->width-1)/fv->cbw; rc = (event->height-1)/fv->cbh;
- if ( cc==0 ) cc = 1; if ( rc==0 ) rc = 1;
-
- if ( event->width==fv->width || event->height==fv->height )
- /* Ok, the window manager didn't change the size. */
- else if ( event->width!=cc*fv->cbw+1 || event->height!=rc*fv->cbh+1 ) {
- gtk_widget_set_size_request( widget, cc*fv->cbw+1, rc*fv->cbh+1);
-return TRUE;
- }
- gtk_widget_set_size_request( lookup_widget(widget,"view"), 1, 1 );
- fv->width = width; fv->height = height;
-
- default_fv_row_count = rc;
- default_fv_col_count = cc;
- SavePrefs();
-
-return TRUE;
-}
-#elif defined(FONTFORGE_CONFIG_GDRAW)
-static void FVResize(FontView *fv,GEvent *event) {
- extern int default_fv_row_count, default_fv_col_count;
- GRect pos,screensize;
- int topchar;
-
- if ( fv->colcnt!=0 )
- topchar = fv->rowoff*fv->colcnt;
- else if ( fv->sf->top_enc!=-1 && fv->sf->top_enc<fv->map->enccount )
- topchar = fv->sf->top_enc;
- else {
- /* Position on 'A' if it exists */
- topchar = SFFindSlot(fv->sf,fv->map,'A',NULL);
- if ( topchar==-1 ) {
- for ( topchar=0; topchar<fv->map->enccount; ++topchar )
- if ( fv->map->map[topchar]!=-1 && fv->sf->glyphs[fv->map->map[topchar]]!=NULL )
- break;
- if ( topchar==fv->map->enccount )
- topchar = 0;
- }
- }
- if ( !event->u.resize.sized )
- /* WM isn't responding to my resize requests, so no point in trying */;
- else if ( (event->u.resize.size.width-
- GDrawPointsToPixels(fv->gw,_GScrollBar_Width)-1)%fv->cbw!=0 ||
- (event->u.resize.size.height-fv->mbh-fv->infoh-1)%fv->cbh!=0 ) {
- int cc = (event->u.resize.size.width+fv->cbw/2-
- GDrawPointsToPixels(fv->gw,_GScrollBar_Width)-1)/fv->cbw;
- int rc = (event->u.resize.size.height-fv->mbh-fv->infoh-1)/fv->cbh;
- if ( cc<=0 ) cc = 1;
- if ( rc<=0 ) rc = 1;
- GDrawGetSize(GDrawGetRoot(NULL),&screensize);
- if ( cc*fv->cbw+GDrawPointsToPixels(fv->gw,_GScrollBar_Width)+10>screensize.width )
- --cc;
- if ( rc*fv->cbh+fv->mbh+fv->infoh+20>screensize.height )
- --rc;
- GDrawResize(fv->gw,
- cc*fv->cbw+1+GDrawPointsToPixels(fv->gw,_GScrollBar_Width),
- rc*fv->cbh+1+fv->mbh+fv->infoh);
- /* somehow KDE loses this event of mine so to get even the vague effect */
- /* we can't just return */
-/*return;*/
- }
-
- pos.width = GDrawPointsToPixels(fv->gw,_GScrollBar_Width);
- pos.height = event->u.resize.size.height-fv->mbh-fv->infoh;
- pos.x = event->u.resize.size.width-pos.width; pos.y = fv->mbh+fv->infoh;
- GGadgetResize(fv->vsb,pos.width,pos.height);
- GGadgetMove(fv->vsb,pos.x,pos.y);
- pos.width = pos.x; pos.x = 0;
- GDrawResize(fv->v,pos.width,pos.height);
-
- fv->width = pos.width; fv->height = pos.height;
- fv->colcnt = (fv->width-1)/fv->cbw;
- if ( fv->colcnt<1 ) fv->colcnt = 1;
- fv->rowcnt = (fv->height-1)/fv->cbh;
- if ( fv->rowcnt<1 ) fv->rowcnt = 1;
- fv->rowltot = (fv->map->enccount+fv->colcnt-1)/fv->colcnt;
-
- GScrollBarSetBounds(fv->vsb,0,fv->rowltot,fv->rowcnt);
- fv->rowoff = topchar/fv->colcnt;
- if ( fv->rowoff>=fv->rowltot-fv->rowcnt )
- fv->rowoff = fv->rowltot-fv->rowcnt;
- if ( fv->rowoff<0 ) fv->rowoff =0;
- GScrollBarSetPos(fv->vsb,fv->rowoff);
- GDrawRequestExpose(fv->gw,NULL,true);
- GDrawRequestExpose(fv->v,NULL,true);
-
- default_fv_row_count = fv->rowcnt;
- default_fv_col_count = fv->colcnt;
- SavePrefs();
-}
-#endif
-
-static void FVTimer(FontView *fv,GEvent *event) {
-
- if ( event->u.timer.timer==fv->pressed ) {
- GEvent e;
- GDrawGetPointerPosition(fv->v,&e);
- if ( e.u.mouse.y<0 || e.u.mouse.y >= fv->height ) {
- real dy = 0;
- if ( e.u.mouse.y<0 )
- dy = -1;
- else if ( e.u.mouse.y>=fv->height )
- dy = 1;
- if ( fv->rowoff+dy<0 )
- dy = 0;
- else if ( fv->rowoff+dy+fv->rowcnt > fv->rowltot )
- dy = 0;
- fv->rowoff += dy;
- if ( dy!=0 ) {
- GScrollBarSetPos(fv->vsb,fv->rowoff);
- GDrawScroll(fv->v,NULL,0,dy*fv->cbh);
- }
- }
- } else if ( event->u.timer.timer==fv->resize ) {
- /* It's a delayed resize event (for kde which sends continuous resizes) */
- fv->resize = NULL;
- FVResize(fv,(GEvent *) (event->u.timer.userdata));
- } else if ( event->u.timer.userdata!=NULL ) {
- /* It's a delayed function call */
- void (*func)(FontView *) = (void (*)(FontView *)) (event->u.timer.userdata);
- func(fv);
- }
-}
-
-void FVDelay(FontView *fv,void (*func)(FontView *)) {
- GDrawRequestTimer(fv->v,100,0,(void *) func);
-}
-
-static void FVScroll(FontView *fv,struct sbevent *sb) {
- int newpos = fv->rowoff;
-
- switch( sb->type ) {
- case et_sb_top:
- newpos = 0;
- break;
- case et_sb_uppage:
- newpos -= fv->rowcnt;
- break;
- case et_sb_up:
- --newpos;
- break;
- case et_sb_down:
- ++newpos;
- break;
- case et_sb_downpage:
- newpos += fv->rowcnt;
- break;
- case et_sb_bottom:
- newpos = fv->rowltot-fv->rowcnt;
- break;
- case et_sb_thumb:
- case et_sb_thumbrelease:
- newpos = sb->pos;
- break;
- }
- if ( newpos>fv->rowltot-fv->rowcnt )
- newpos = fv->rowltot-fv->rowcnt;
- if ( newpos<0 ) newpos =0;
- if ( newpos!=fv->rowoff ) {
- int diff = newpos-fv->rowoff;
- fv->rowoff = newpos;
- GScrollBarSetPos(fv->vsb,fv->rowoff);
- GDrawScroll(fv->v,NULL,0,diff*fv->cbh);
- }
-}
-
-static int v_e_h(GWindow gw, GEvent *event) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- if (( event->type==et_mouseup || event->type==et_mousedown ) &&
- (event->u.mouse.button==4 || event->u.mouse.button==5) ) {
-return( GGadgetDispatchEvent(fv->vsb,event));
- }
-
- GGadgetPopupExternalEvent(event);
- switch ( event->type ) {
- case et_expose:
- GDrawSetLineWidth(gw,0);
- FVExpose(fv,gw,event);
- break;
- case et_char:
- FVChar(fv,event);
- break;
- case et_mousemove: case et_mousedown: case et_mouseup:
- if ( event->type==et_mousedown )
- GDrawSetGIC(gw,fv->gic,0,20);
- FVMouse(fv,event);
- break;
- case et_timer:
- FVTimer(fv,event);
- break;
- case et_focus:
- if ( event->u.focus.gained_focus ) {
- GDrawSetGIC(gw,fv->gic,0,20);
-#if 0
- CVPaletteDeactivate();
-#endif
- }
- break;
- }
-return( true );
-}
-
-void FontViewReformatOne(FontView *fv) {
- FontView *fvs;
-
- if ( fv->v==NULL || fv->colcnt==0 ) /* Can happen in scripts */
-return;
-
- GDrawSetCursor(fv->v,ct_watch);
- fv->rowltot = (fv->map->enccount+fv->colcnt-1)/fv->colcnt;
- GScrollBarSetBounds(fv->vsb,0,fv->rowltot,fv->rowcnt);
- if ( fv->rowoff>fv->rowltot-fv->rowcnt ) {
- fv->rowoff = fv->rowltot-fv->rowcnt;
- if ( fv->rowoff<0 ) fv->rowoff =0;
- GScrollBarSetPos(fv->vsb,fv->rowoff);
- }
- for ( fvs=fv->sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- if ( fvs!=fv && fvs->sf==fv->sf )
- break;
- GDrawRequestExpose(fv->v,NULL,false);
- GDrawSetCursor(fv->v,ct_pointer);
-}
-
-void FontViewReformatAll(SplineFont *sf) {
- BDFFont *new, *old;
- FontView *fvs, *fv;
-
- if ( sf->fv->v==NULL || sf->fv->colcnt==0 ) /* Can happen in scripts */
-return;
-
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- fvs->touched = false;
- while ( 1 ) {
- for ( fv=sf->fv; fv!=NULL && fv->touched; fv=fv->nextsame );
- if ( fv==NULL )
- break;
- old = fv->filled;
- /* In CID fonts fv->sf may not be same as sf */
- new = SplineFontPieceMeal(fv->sf,fv->filled->pixelsize,
- (fv->antialias?pf_antialias:0)|(fv->bbsized?pf_bbsized:0),
- NULL);
- for ( fvs=fv; fvs!=NULL; fvs=fvs->nextsame )
- if ( fvs->filled == old ) {
- fvs->filled = new;
- if ( fvs->show == old )
- fvs->show = new;
- fvs->touched = true;
- }
- BDFFontFree(old);
- }
- for ( fv=sf->fv; fv!=NULL; fv=fv->nextsame ) {
- GDrawSetCursor(fv->v,ct_watch);
- fv->rowltot = (fv->map->enccount+fv->colcnt-1)/fv->colcnt;
- GScrollBarSetBounds(fv->vsb,0,fv->rowltot,fv->rowcnt);
- if ( fv->rowoff>fv->rowltot-fv->rowcnt ) {
- fv->rowoff = fv->rowltot-fv->rowcnt;
- if ( fv->rowoff<0 ) fv->rowoff =0;
- GScrollBarSetPos(fv->vsb,fv->rowoff);
- }
- GDrawRequestExpose(fv->v,NULL,false);
- GDrawSetCursor(fv->v,ct_pointer);
- }
-}
-
-static int fv_e_h(GWindow gw, GEvent *event) {
- FontView *fv = (FontView *) GDrawGetUserData(gw);
-
- if (( event->type==et_mouseup || event->type==et_mousedown ) &&
- (event->u.mouse.button==4 || event->u.mouse.button==5) ) {
-return( GGadgetDispatchEvent(fv->vsb,event));
- }
-
- switch ( event->type ) {
- case et_selclear:
- ClipboardClear();
- break;
- case et_expose:
- GDrawSetLineWidth(gw,0);
- FVDrawInfo(fv,gw,event);
- break;
- case et_resize:
- /* KDE sends a continuous stream of resize events, and gets very */
- /* confused if I start resizing the window myself, try to wait for */
- /* the user to finish before responding to resizes */
- if ( event->u.resize.sized || fv->resize_expected ) {
- if ( fv->resize )
- GDrawCancelTimer(fv->resize);
- fv->resize_event = *event;
- fv->resize = GDrawRequestTimer(fv->v,300,0,(void *) &fv->resize_event);
- fv->resize_expected = false;
- }
- break;
- case et_char:
- FVChar(fv,event);
- break;
- case et_controlevent:
- switch ( event->u.control.subtype ) {
- case et_scrollbarchange:
- FVScroll(fv,&event->u.control.u.sb);
- break;
- }
- break;
- case et_close:
- FVMenuClose(gw,NULL,NULL);
- break;
- case et_create:
- fv->next = fv_list;
- fv_list = fv;
- break;
- case et_destroy:
- if ( fv_list==fv )
- fv_list = fv->next;
- else {
- FontView *n;
- for ( n=fv_list; n->next!=fv; n=n->next );
- n->next = fv->next;
- }
- if ( fv_list!=NULL ) /* Freeing a large font can take forever, and if we're just going to exit there's no real reason to do so... */
- FontViewFree(fv);
- break;
- }
-return( true );
-}
-
-static void FontViewOpenKids(FontView *fv) {
- int k, i;
- SplineFont *sf = fv->sf, *_sf;
-
- if ( sf->cidmaster!=NULL )
- sf = sf->cidmaster;
-
- k=0;
- do {
- _sf = sf->subfontcnt==0 ? sf : sf->subfonts[k];
- for ( i=0; i<_sf->glyphcnt; ++i )
- if ( _sf->glyphs[i]!=NULL && _sf->glyphs[i]->wasopen ) {
- _sf->glyphs[i]->wasopen = false;
- CharViewCreate(_sf->glyphs[i],fv,-1);
- }
- ++k;
- } while ( k<sf->subfontcnt );
-}
-#endif
-
-FontView *_FontViewCreate(SplineFont *sf) {
- FontView *fv = gcalloc(1,sizeof(FontView));
- int i;
- int ps = sf->display_size<0 ? -sf->display_size :
- sf->display_size==0 ? default_fv_font_size : sf->display_size;
-
- if ( ps>200 ) ps = 128;
-
- fv->nextsame = sf->fv;
- sf->fv = fv;
- if ( sf->mm!=NULL ) {
- sf->mm->normal->fv = fv;
- for ( i = 0; i<sf->mm->instance_count; ++i )
- sf->mm->instances[i]->fv = fv;
- }
- if ( sf->subfontcnt==0 ) {
- fv->sf = sf;
- if ( fv->nextsame!=NULL ) {
- fv->map = EncMapCopy(fv->nextsame->map);
- fv->normal = fv->nextsame->normal==NULL ? NULL : EncMapCopy(fv->nextsame->normal);
- } else if ( sf->compacted ) {
- fv->normal = sf->map;
- fv->map = CompactEncMap(EncMapCopy(sf->map),sf);
- } else {
- fv->map = sf->map;
- fv->normal = NULL;
- }
- } else {
- fv->cidmaster = sf;
- for ( i=0; i<sf->subfontcnt; ++i )
- sf->subfonts[i]->fv = fv;
- for ( i=0; i<sf->subfontcnt; ++i ) /* Search for a subfont that contains more than ".notdef" (most significant in .gai fonts) */
- if ( sf->subfonts[i]->glyphcnt>1 ) {
- fv->sf = sf->subfonts[i];
- break;
- }
- if ( fv->sf==NULL )
- fv->sf = sf->subfonts[0];
- sf = fv->sf;
- if ( fv->nextsame==NULL ) EncMapFree(sf->map);
- fv->map = EncMap1to1(sf->glyphcnt);
- }
- fv->selected = gcalloc(fv->map->enccount,sizeof(char));
- fv->user_requested_magnify = -1;
- fv->magnify = (ps<=9)? 3 : (ps<20) ? 2 : 1;
- fv->cbw = (ps*fv->magnify)+1;
- fv->cbh = (ps*fv->magnify)+1+fv->lab_height+1;
- fv->antialias = sf->display_antialias;
- fv->bbsized = sf->display_bbsized;
- fv->glyphlabel = default_fv_glyphlabel;
-
- fv->end_pos = -1;
-return( fv );
-}
-
-#ifndef LUA_FF_LIB
-static void FontViewInit(void) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- mb2DoGetText(mblist);
- mbDoGetText(fvpopupmenu);
-#endif
-}
-#endif
-
-FontView *FontViewCreate(SplineFont *sf) {
- FontView *fv = _FontViewCreate(sf);
-#if defined(FONTFORGE_CONFIG_GTK)
- static int done = false;
- GtkWidget *status;
- PangoContext *context;
- PangoFont *font;
- PangoFontMetrics *fm;
- int as, ds;
- BDFFont *bdf;
-
- if ( !done ) { FontViewInit(); done=true;}
-
- fv->gw = create_FontView();
- g_object_set_data (G_OBJECT (fv->gw), "data", fv );
- fv->v = lookup_widget( fv->gw,"view" );
- status = lookup_widget( fv->gw,"status" );
- context = gtk_widget_get_pango_context( status );
- fv->gc = gdk_gc_new( fv->v );
- gdk_gc_copy(fv->gc,fv->v->style->fg_gc[fv->v->state]);
- font = pango_context_load_font( context, pango_context_get_font_description(context));
- fm = pango_font_get_metrics(font,NULL);
- as = pango_font_metrics_get_ascent(fm);
- ds = pango_font_metrics_get_descent(fm);
- fv->infoh = (as+ds)/1024;
- gtk_widget_set_size_request(status,0,fv->infoh);
-
- context = gtk_widget_get_pango_context( fv->v );
- font = pango_context_load_font( context, pango_context_get_font_description(context));
- fm = pango_font_get_metrics(font,NULL);
- as = pango_font_metrics_get_ascent(fm);
- ds = pango_font_metrics_get_descent(fm);
- fv->lab_height = (as+ds)/1024;
- fv->lab_as = as/1024;
-
- g_object_set_data( fv->gw, "data", fv );
- g_object_set_data( fv->v , "data", fv );
-
- {
- GdkGC *gc = fv->v->style->fg_gc[fv->v->state];
- GdkGCValues values;
- gdk_gc_get_values(gc,&values);
- default_background = COLOR_CREATE(
- ((values.background.red &0xff00)>>8) |
- ((values.background.green&0xff00)>>8) |
- ((values.background.blue &0xff00)>>8));
- }
-#elif defined(FONTFORGE_CONFIG_GDRAW)
- static int done = false;
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetData gd;
- GRect gsize;
- FontRequest rq;
- /* sadly, clearlyu is too big for the space I've got */
- static unichar_t monospace[] = { 'f','o','n','t','v','i','e','w',',','c','o','u','r','i','e','r',',','m', 'o', 'n', 'o', 's', 'p', 'a', 'c', 'e',',','c','a','s','l','o','n',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };
- static unichar_t *fontnames=NULL;
- static GWindow icon = NULL;
- static int nexty=0;
- GRect size;
- BDFFont *bdf;
- int as,ds,ld;
-
- if ( !done ) { FontViewInit(); done=true;}
- if ( icon==NULL ) {
-#ifdef BIGICONS
- icon = GDrawCreateBitmap(NULL,fontview_width,fontview_height,fontview_bits);
-#else
- icon = GDrawCreateBitmap(NULL,fontview2_width,fontview2_height,fontview2_bits);
-#endif
- }
-
- GDrawGetSize(GDrawGetRoot(NULL),&size);
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_icon;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.cursor = ct_pointer;
- wattrs.icon = icon;
- pos.width = sf->desired_col_cnt*fv->cbw+1;
- pos.height = sf->desired_row_cnt*fv->cbh+1;
- pos.x = size.width-pos.width-30; pos.y = nexty;
- nexty += 2*fv->cbh+50;
- if ( nexty+pos.height > size.height )
- nexty = 0;
- fv->gw = gw = GDrawCreateTopWindow(NULL,&pos,fv_e_h,fv,&wattrs);
- FVSetTitle(fv);
-
- if ( !fv_fs_init )
- fv_fontsize = -GResourceFindInt("FontView.FontSize",13);
-
- memset(&gd,0,sizeof(gd));
- gd.flags = gg_visible | gg_enabled;
- helplist[0].invoke = FVMenuContextualHelp;
- gd.u.menu2 = mblist;
- fv->mb = GMenu2BarCreate( gw, &gd, NULL);
- GGadgetGetSize(fv->mb,&gsize);
- fv->mbh = gsize.height;
- fv->infoh = 1-fv_fontsize;
- fv->lab_height = FV_LAB_HEIGHT-13-fv_fontsize;
-
- gd.pos.y = fv->mbh+fv->infoh; gd.pos.height = pos.height;
- gd.pos.width = GDrawPointsToPixels(gw,_GScrollBar_Width);
- gd.pos.x = pos.width;
- gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels|gg_sb_vert;
- fv->vsb = GScrollBarCreate(gw,&gd,fv);
-
- wattrs.mask = wam_events|wam_cursor;
- pos.x = 0; pos.y = fv->mbh+fv->infoh;
- fv->v = GWidgetCreateSubWindow(gw,&pos,v_e_h,fv,&wattrs);
- GDrawSetVisible(fv->v,true);
-
- fv->gic = GDrawCreateInputContext(fv->v,gic_root|gic_orlesser);
- GDrawSetGIC(fv->v,fv->gic,0,20);
-
- if ( fontnames==NULL ) {
- fontnames = uc_copy(GResourceFindString("FontView.FontFamily"));
- if ( fontnames==NULL )
- fontnames = monospace;
- }
- fv->fontset = gcalloc(_uni_fontmax,sizeof(GFont *));
- memset(&rq,0,sizeof(rq));
- rq.family_name = fontnames;
- rq.point_size = fv_fontsize;
- rq.weight = 400;
- fv->fontset[0] = GDrawInstanciateFont(GDrawGetDisplayOfWindow(gw),&rq);
- GDrawSetFont(fv->v,fv->fontset[0]);
- GDrawFontMetrics(fv->fontset[0],&as,&ds,&ld);
- fv->lab_as = as;
-#endif
- fv->showhmetrics = default_fv_showhmetrics;
- fv->showvmetrics = default_fv_showvmetrics && sf->hasvmetrics;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( fv->nextsame!=NULL ) {
- fv->filled = fv->nextsame->filled;
- bdf = fv->nextsame->show;
- } else {
- bdf = SplineFontPieceMeal(fv->sf,sf->display_size<0?-sf->display_size:default_fv_font_size,
- (fv->antialias?pf_antialias:0)|(fv->bbsized?pf_bbsized:0),
- NULL);
- fv->filled = bdf;
- if ( sf->display_size>0 ) {
- for ( bdf=sf->bitmaps; bdf!=NULL && bdf->pixelsize!=sf->display_size ;
- bdf=bdf->next );
- if ( bdf==NULL )
- bdf = fv->filled;
- }
- if ( sf->onlybitmaps && bdf==fv->filled && sf->bitmaps!=NULL )
- bdf = sf->bitmaps;
- }
- fv->cbw = -1;
- FVChangeDisplayFont(fv,bdf);
-#endif
-
-#if defined(FONTFORGE_CONFIG_GTK)
- gtk_widget_show(fv->gw);
-#elif defined(FONTFORGE_CONFIG_GDRAW)
- /*GWidgetHidePalettes();*/
- GDrawSetVisible(gw,true);
- FontViewOpenKids(fv);
-#endif
-return( fv );
-}
-
-#ifdef LUA_FF_LIB
-
-extern void SplineFontMetaData(SplineFont *sf,struct fontdict *fd) ;
-
-static SplineFont *SFReadPostscriptInfo(char *filename) {
- FontDict *fd=NULL;
- SplineFont *sf=NULL;
- fd = ReadPSFont(filename);
- if ( fd!=NULL ) {
- if ( fd->sf!=NULL ) {
- sf = fd->sf;
- } else {
- sf = SplineFontEmpty();
- SplineFontMetaData(sf,fd);
- if ( fd->wascff ) {
- SplineFontFree(sf);
- sf = fd->sf;
- }
- }
- }
- PSFontFree(fd);
- return( sf );
-}
-#endif
-
-static SplineFont *SFReadPostscript(char *filename) {
- FontDict *fd=NULL;
- SplineFont *sf=NULL;
-# ifdef FONTFORGE_CONFIG_GDRAW
- gwwv_progress_change_stages(2);
- fd = ReadPSFont(filename);
- gwwv_progress_next_stage();
- gwwv_progress_change_line2(_("Interpreting Glyphs"));
-# elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_change_stages(2);
- fd = ReadPSFont(filename);
- gwwv_progress_next_stage();
- gwwv_progress_change_line2(_("Interpreting Glyphs"));
-# else
- fd = ReadPSFont(filename);
-# endif
- if ( fd!=NULL ) {
- sf = SplineFontFromPSFont(fd);
- PSFontFree(fd);
- if ( sf!=NULL )
- CheckAfmOfPostscript(sf,filename,sf->map);
- }
-return( sf );
-}
-
-
-/* This does not check currently existing fontviews, and should only be used */
-/* by LoadSplineFont (which does) and by RevertFile (which knows what it's doing) */
-SplineFont *ReadSplineFont(char *filename,enum openflags openflags) {
- SplineFont *sf;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- char ubuf[250], *temp;
-#endif
- int fromsfd = false;
- int i;
- char *pt, *strippedname, *oldstrippedname, *tmpfile=NULL, *paren=NULL, *fullname=filename;
- int len;
- FILE *foo;
- int checked;
- int compression=0;
-
- if ( filename==NULL )
-return( NULL );
-
- strippedname = filename;
- pt = strrchr(filename,'/');
- if ( pt==NULL ) pt = filename;
- if ( (paren=strchr(pt,'('))!=NULL && strchr(paren,')')!=NULL ) {
- strippedname = copy(filename);
- strippedname[paren-filename] = '\0';
- }
-
- pt = strrchr(strippedname,'.');
- i = -1;
- if ( pt!=NULL ) for ( i=0; compressors[i].ext!=NULL; ++i )
- if ( strcmp(compressors[i].ext,pt)==0 )
- break;
- oldstrippedname = strippedname;
- if ( i==-1 || compressors[i].ext==NULL ) i=-1;
- else {
- tmpfile = Decompress(strippedname,i);
- if ( tmpfile!=NULL ) {
- strippedname = tmpfile;
- } else {
- gwwv_post_error(_("Decompress Failed!"),_("Decompress Failed!"));
-return( NULL );
- }
- compression = i+1;
- if ( strippedname!=filename && paren!=NULL ) {
- fullname = galloc(strlen(strippedname)+strlen(paren)+1);
- strcpy(fullname,strippedname);
- strcat(fullname,paren);
- } else
- fullname = strippedname;
- }
-
- /* If there are no pfaedit windows, give them something to look at */
- /* immediately. Otherwise delay a bit */
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- strcpy(ubuf,_("Loading font from "));
- len = strlen(ubuf);
-# ifdef FONTFORGE_CONFIG_GDRAW
- strncat(ubuf,temp = def2utf8_copy(GFileNameTail(fullname)),100);
-# elif defined(FONTFORGE_CONFIG_GTK)
- {
- gsize read, written;
- strncat(ubuf,temp = g_filename_to_utf8(GFileNameTail(fullname),-1,&read,&written,NULL),100);
- }
-#endif
- free(temp);
- ubuf[100+len] = '\0';
- gwwv_progress_start_indicator(fv_list==NULL?0:10,_("Loading..."),ubuf,_("Reading Glyphs"),0,1);
- gwwv_progress_enable_stop(0);
- if ( fv_list==NULL && !no_windowing_ui ) { GDrawSync(NULL); GDrawProcessPendingEvents(NULL); }
-#else
- len = 0;
-#endif
-
- sf = NULL;
- foo = fopen(strippedname,"rb");
-
- checked = false;
-/* checked == false => not checked */
-/* checked == 'u' => UFO */
-/* checked == 't' => TTF/OTF */
-/* checked == 'p' => pfb/general postscript */
-/* checked == 'P' => pdf */
-/* checked == 'c' => cff */
-/* checked == 'S' => svg */
-/* checked == 'f' => sfd */
-/* checked == 'F' => sfdir */
-/* checked == 'b' => bdf */
-/* checked == 'i' => ikarus */
-#ifndef LUA_FF_LIB
- if ( GFileIsDir(strippedname) ) {
- char *temp = galloc(strlen(strippedname)+strlen("/glyphs/contents.plist")+1);
- strcpy(temp,strippedname);
- strcat(temp,"/glyphs/contents.plist");
- if ( GFileExists(temp)) {
- sf = SFReadUFO(strippedname,0);
- checked = 'u';
- } else {
- strcpy(temp,strippedname);
- strcat(temp,"/font.props");
- if ( GFileExists(temp)) {
- sf = SFDirRead(strippedname);
- checked = 'F';
- }
- }
- free(temp);
- if ( foo!=NULL )
- fclose(foo);
- } else if ( foo!=NULL ) {
-#else
- {
-#endif
- /* Try to guess the file type from the first few characters... */
- int ch1 = getc(foo);
- int ch2 = getc(foo);
- int ch3 = getc(foo);
- int ch4 = getc(foo);
- int ch5 = getc(foo);
- int ch6 = getc(foo);
- int ch7 = getc(foo);
- int ch9, ch10;
- fseek(foo, 98, SEEK_SET);
- ch9 = getc(foo);
- ch10 = getc(foo);
- fclose(foo);
- if (( ch1==0 && ch2==1 && ch3==0 && ch4==0 ) ||
- (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O') ||
- (ch1=='t' && ch2=='r' && ch3=='u' && ch4=='e') ||
- (ch1=='t' && ch2=='t' && ch3=='c' && ch4=='f') ) {
- sf = SFReadTTF(fullname,0,openflags);
- checked = 't';
- } else if (( ch1=='%' && ch2=='!' ) ||
- ( ch1==0x80 && ch2=='\01' ) ) { /* PFB header */
- sf = SFReadPostscript(fullname);
- checked = 'p';
-#ifndef LUA_FF_LIB
- } else if ( ch1=='%' && ch2=='P' && ch3=='D' && ch4=='F' ) {
- sf = SFReadPdfFont(fullname,openflags);
- checked = 'P';
-#endif
- } else if ( ch1==1 && ch2==0 && ch3==4 ) {
- sf = CFFParse(fullname);
- checked = 'c';
- } else if ( ch1=='<' && ch2=='?' && (ch3=='x'||ch3=='X') && (ch4=='m'||ch4=='M') ) {
- sf = SFReadSVG(fullname,0);
- checked = 'S';
- } else if ( ch1==0xef && ch2==0xbb && ch3==0xbf &&
- ch4=='<' && ch5=='?' && (ch6=='x'||ch6=='X') && (ch7=='m'||ch7=='M') ) {
- /* UTF-8 SVG with initial byte ordering mark */
- sf = SFReadSVG(fullname,0);
- checked = 'S';
-#if 0 /* I'm not sure if this is a good test for mf files... */
- } else if ( ch1=='%' && ch2==' ' ) {
- sf = SFFromMF(fullname);
-#endif
-#ifndef LUA_FF_LIB
- } else if ( ch1=='S' && ch2=='p' && ch3=='l' && ch4=='i' ) {
- sf = SFDRead(fullname);
- checked = 'f';
- fromsfd = true;
- } else if ( ch1=='S' && ch2=='T' && ch3=='A' && ch4=='R' ) {
- sf = SFFromBDF(fullname,0,false);
- checked = 'b';
- } else if ( ch1=='\1' && ch2=='f' && ch3=='c' && ch4=='p' ) {
- sf = SFFromBDF(fullname,2,false);
- } else if ( ch9=='I' && ch10=='K' && ch3==0 && ch4==55 ) {
- /* Ikarus font type appears at word 50 (byte offset 98) */
- /* Ikarus name section length (at word 2, byte offset 2) was 55 in the 80s at URW */
- checked = 'i';
- sf = SFReadIkarus(fullname);
-#endif
- } /* Too hard to figure out a valid mark for a mac resource file */
- }
-
- if ( sf!=NULL )
- /* good */;
-#ifndef LUA_FF_LIB
- else if (( strmatch(fullname+strlen(fullname)-4, ".sfd")==0 ||
- strmatch(fullname+strlen(fullname)-5, ".sfd~")==0 ) && checked!='f' ) {
- sf = SFDRead(fullname);
- fromsfd = true;
- }
-#endif
- else if (( strmatch(fullname+strlen(fullname)-4, ".ttf")==0 ||
- strmatch(fullname+strlen(strippedname)-4, ".ttc")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".gai")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".otf")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".otb")==0 ) && checked!='t') {
- sf = SFReadTTF(fullname,0,openflags);
- } else if ( strmatch(fullname+strlen(fullname)-4, ".svg")==0 && checked!='S' ) {
- sf = SFReadSVG(fullname,0);
- } else if ( strmatch(fullname+strlen(fullname)-4, ".ufo")==0 && checked!='u' ) {
- sf = SFReadUFO(fullname,0);
-#ifndef LUA_FF_LIB
- } else if ( strmatch(fullname+strlen(fullname)-4, ".bdf")==0 && checked!='b' ) {
- sf = SFFromBDF(fullname,0,false);
- } else if ( strmatch(fullname+strlen(fullname)-2, "pk")==0 ) {
- sf = SFFromBDF(fullname,1,true);
- } else if ( strmatch(fullname+strlen(fullname)-2, "gf")==0 ) {
- sf = SFFromBDF(fullname,3,true);
- } else if ( strmatch(fullname+strlen(fullname)-4, ".pcf")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".pmf")==0 ) {
- /* Sun seems to use a variant of the pcf format which they call pmf */
- /* the encoding actually starts at 0x2000 and the one I examined was */
- /* for a pixel size of 200. Some sort of printer font? */
- sf = SFFromBDF(fullname,2,false);
-#endif
- } else if ( strmatch(fullname+strlen(strippedname)-4, ".bin")==0 ||
- strmatch(fullname+strlen(strippedname)-4, ".hqx")==0 ||
- strmatch(fullname+strlen(strippedname)-6, ".dfont")==0 ) {
- sf = SFReadMacBinary(fullname,0,openflags);
-#ifndef LUA_FF_LIB
- } else if ( strmatch(fullname+strlen(strippedname)-4, ".fon")==0 ||
- strmatch(fullname+strlen(strippedname)-4, ".fnt")==0 ) {
- sf = SFReadWinFON(fullname,0);
- } else if ( strmatch(fullname+strlen(strippedname)-4, ".pdb")==0 ) {
- sf = SFReadPalmPdb(fullname,0);
-#endif
- } else if ( (strmatch(fullname+strlen(fullname)-4, ".pfa")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".pfb")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".pf3")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".cid")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".gsf")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".pt3")==0 ||
- strmatch(fullname+strlen(fullname)-3, ".ps")==0 ) && checked!='p' ) {
- sf = SFReadPostscript(fullname);
- } else if ( strmatch(fullname+strlen(fullname)-4, ".cff")==0 && checked!='c' ) {
- sf = CFFParse(fullname);
-#ifndef LUA_FF_LIB
- } else if ( strmatch(fullname+strlen(fullname)-3, ".mf")==0 ) {
- sf = SFFromMF(fullname);
- } else if ( strmatch(fullname+strlen(fullname)-4, ".pdf")==0 && checked!='P' ) {
- sf = SFReadPdfFont(fullname,openflags);
- } else if ( strmatch(fullname+strlen(fullname)-3, ".ik")==0 && checked!='i' ) {
- sf = SFReadIkarus(fullname);
-#endif
- } else {
- sf = SFReadMacBinary(fullname,0,openflags);
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_end_indicator();
-# endif
-
- if ( sf!=NULL ) {
- SplineFont *norm = sf->mm!=NULL ? sf->mm->normal : sf;
- if ( compression!=0 ) {
- free(sf->filename);
- *strrchr(oldstrippedname,'.') = '\0';
- sf->filename = copy( oldstrippedname );
- }
- if ( fromsfd )
- sf->compression = compression;
- free( norm->origname );
- if ( sf->chosenname!=NULL && strippedname==filename ) {
- norm->origname = galloc(strlen(filename)+strlen(sf->chosenname)+8);
- strcpy(norm->origname,filename);
- strcat(norm->origname,"(");
- strcat(norm->origname,sf->chosenname);
- strcat(norm->origname,")");
- } else
- norm->origname = copy(filename);
- free( sf->chosenname ); sf->chosenname = NULL;
- if ( sf->mm!=NULL ) {
- int j;
- for ( j=0; j<sf->mm->instance_count; ++j ) {
- free(sf->mm->instances[j]->origname);
- sf->mm->instances[j]->origname = copy(norm->origname);
- }
- }
- } else if ( !GFileExists(filename) )
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Couldn't open font"),_("The requested file, %.100s, does not exist"),GFileNameTail(filename));
-#else
- gwwv_post_error(_("Couldn't open font"),_("The requested file, %.100s, does not exist"),GFileNameTail(filename));
-#endif
- else if ( !GFileReadable(filename) )
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Couldn't open font"),_("You do not have permission to read %.100s"),GFileNameTail(filename));
-#else
- gwwv_post_error(_("Couldn't open font"),_("You do not have permission to read %.100s"),GFileNameTail(filename));
-#endif
- else
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Couldn't open font"),_("%.100s is not in a known format (or is so badly corrupted as to be unreadable)"),GFileNameTail(filename));
-#else
- gwwv_post_error(_("Couldn't open font"),_("%.100s is not in a known format (or is so badly corrupted as to be unreadable)"),GFileNameTail(filename));
-#endif
-
- if ( oldstrippedname!=filename )
- free(oldstrippedname);
- if ( fullname!=filename && fullname!=strippedname )
- free(fullname);
- if ( tmpfile!=NULL ) {
- unlink(tmpfile);
- free(tmpfile);
- }
- if ( (openflags&of_fstypepermitted) && sf!=NULL && (sf->pfminfo.fstype&0xff)==0x0002 ) {
- /* Ok, they have told us from a script they have access to the font */
- } else if ( !fromsfd && sf!=NULL && (sf->pfminfo.fstype&0xff)==0x0002 ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes"); buts[1] = _("_No"); buts[2] = NULL;
- if ( gwwv_ask(_("Restricted Font"),(const char **) buts,1,1,_("This font is marked with an FSType of 2 (Restricted\nLicense). That means it is not editable without the\npermission of the legal owner.\n\nDo you have such permission?"))==1 ) {
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_NO, NULL };
- if ( gwwv_ask(_("Restricted Font"),(const char **) buts,1,1,_("This font is marked with an FSType of 2 (Restricted\nLicense). That means it is not editable without the\npermission of the legal owner.\n\nDo you have such permission?"))==1 ) {
-#else
- if ( true ) { /* In a script, if they didn't explicitly say so, fail */
-#endif
- SplineFontFree(sf);
-return( NULL );
- }
- }
-return( sf );
-}
-
-#ifdef LUA_FF_LIB
-SplineFont *ReadSplineFontInfo(char *filename,enum openflags openflags) {
- SplineFont *sf, *sf_ptr;
- char **fontlist;
- char *pt =NULL, *strippedname=filename, *paren=NULL, *fullname=filename;
- FILE *foo = NULL;
- int checked = 0;
- char s[512] = {0};
-
- if ( filename==NULL )
-return( NULL );
-
- pt = strrchr(filename,'/');
- if ( pt==NULL ) pt = filename;
- if ( (paren=strchr(pt,'('))!=NULL && strchr(paren,')')!=NULL ) {
- strippedname = copy(filename);
- strippedname[paren-filename] = '\0';
- }
-
- sf = NULL;
- foo = fopen(strippedname,"rb");
- checked = false;
- if ( foo!=NULL ) {
- /* Try to guess the file type from the first few characters... */
- int ch1 = getc(foo);
- int ch2 = getc(foo);
- int ch3 = getc(foo);
- int ch4 = getc(foo);
- fclose(foo);
- if (( ch1==0 && ch2==1 && ch3==0 && ch4==0 ) ||
- (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O') ||
- (ch1=='t' && ch2=='r' && ch3=='u' && ch4=='e') ) {
- sf = SFReadTTFInfo(fullname,0,openflags);
- checked = 't';
- } else if ((ch1=='t' && ch2=='t' && ch3=='c' && ch4=='f')) {
- /* read all fonts in a collection */
- fontlist = NamesReadTTF(fullname);
- if (fontlist) {
- while (*fontlist != NULL) {
- snprintf(s,511, "%s(%s)", fullname,*fontlist);
- sf_ptr = SFReadTTFInfo(s,0,openflags);
- if (sf != NULL)
- sf_ptr->next = sf;
- sf = sf_ptr;
- fontlist++;
- }
- }
- } else if (( ch1=='%' && ch2=='!' ) ||
- ( ch1==0x80 && ch2=='\01' ) ) { /* PFB header */
- sf = SFReadPostscriptInfo(fullname);
- checked = 'p';
- } else if ( ch1==1 && ch2==0 && ch3==4 ) {
- sf = CFFParseInfo(fullname);
- checked = 'c';
- } /* Too hard to figure out a valid mark for a mac resource file */
- }
-
- if ( sf!=NULL )
- /* good */;
- else if (( strmatch(fullname+strlen(fullname)-4, ".ttf")==0 ||
- strmatch(fullname+strlen(strippedname)-4, ".ttc")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".gai")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".otf")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".otb")==0 ) && checked!='t') {
- sf = SFReadTTFInfo(fullname,0,openflags);
- } else if ( (strmatch(fullname+strlen(fullname)-4, ".pfa")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".pfb")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".pf3")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".cid")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".gsf")==0 ||
- strmatch(fullname+strlen(fullname)-4, ".pt3")==0 ||
- strmatch(fullname+strlen(fullname)-3, ".ps")==0 ) && checked!='p' ) {
- sf = SFReadPostscriptInfo(fullname);
- } else if ( strmatch(fullname+strlen(fullname)-4, ".cff")==0 && checked!='c' ) {
- sf = CFFParseInfo(fullname);
- } else {
- sf = SFReadMacBinaryInfo(fullname,0,openflags);
- }
-
- if ( sf==NULL ) {
- if ( !GFileExists(filename) )
- gwwv_post_error(_("Couldn't open font"),_("The requested file, %.100s, does not exist"),GFileNameTail(filename));
- else if ( !GFileReadable(filename) )
- gwwv_post_error(_("Couldn't open font"),_("You do not have permission to read %.100s"),GFileNameTail(filename));
- else
- gwwv_post_error(_("Couldn't open font"),_("%.100s is not in a known format (or is so badly corrupted as to be unreadable)"),GFileNameTail(filename));
- }
- if ( fullname!=filename && fullname!=strippedname )
- free(fullname);
- return( sf );
-}
-#endif
-
-static SplineFont *AbsoluteNameCheck(char *filename) {
- char buffer[1025];
- FontView *fv;
-
- GFileGetAbsoluteName(filename,buffer,sizeof(buffer));
- for ( fv=fv_list; fv!=NULL ; fv=fv->next ) {
- if ( fv->sf->filename!=NULL && strcmp(fv->sf->filename,buffer)==0 )
-return( fv->sf );
- else if ( fv->sf->origname!=NULL && strcmp(fv->sf->origname,buffer)==0 )
-return( fv->sf );
- }
-return( NULL );
-}
-
-char *ToAbsolute(char *filename) {
- char buffer[1025];
-
- GFileGetAbsoluteName(filename,buffer,sizeof(buffer));
-return( copy(buffer));
-}
-
-SplineFont *LoadSplineFont(char *filename,enum openflags openflags) {
- FontView *fv;
- SplineFont *sf;
- char *pt, *ept, *tobefreed1=NULL, *tobefreed2=NULL;
- static char *extens[] = { ".sfd", ".pfa", ".pfb", ".ttf", ".otf", ".ps", ".cid", ".bin", ".dfont", ".PFA", ".PFB", ".TTF", ".OTF", ".PS", ".CID", ".BIN", ".DFONT", NULL };
- int i;
-
- if ( filename==NULL )
-return( NULL );
-
- if (( pt = strrchr(filename,'/'))==NULL ) pt = filename;
- if ( strchr(pt,'.')==NULL ) {
- /* They didn't give an extension. If there's a file with no extension */
- /* see if it's a valid font file (and if so use the extensionless */
- /* filename), otherwise guess at an extension */
- /* For some reason Adobe distributes CID keyed fonts (both OTF and */
- /* postscript) as extensionless files */
- int ok = false;
- FILE *test = fopen(filename,"rb");
- if ( test!=NULL ) {
-#if 0
- int ch1 = getc(test);
- int ch2 = getc(test);
- int ch3 = getc(test);
- int ch4 = getc(test);
- if ( ch1=='%' ) ok = true;
- else if (( ch1==0 && ch2==1 && ch3==0 && ch4==0 ) ||
- ( ch1==0 && ch2==2 && ch3==0 && ch4==0 ) ||
- /* Windows 3.1 Chinese version used this version for some arphic fonts */
- /* See discussion on freetype list, july 2004 */
- (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O') ||
- (ch1=='t' && ch2=='r' && ch3=='u' && ch4=='e') ||
- (ch1=='t' && ch2=='t' && ch3=='c' && ch4=='f') ) ok = true;
- else if ( ch1=='S' && ch2=='p' && ch3=='l' && ch4=='i' ) ok = true;
-#endif
- ok = true; /* Mac resource files are too hard to check for */
- /* If file exists, assume good */
- fclose(test);
- }
- if ( !ok ) {
- tobefreed1 = galloc(strlen(filename)+8);
- strcpy(tobefreed1,filename);
- ept = tobefreed1+strlen(tobefreed1);
- for ( i=0; extens[i]!=NULL; ++i ) {
- strcpy(ept,extens[i]);
- if ( GFileExists(tobefreed1))
- break;
- }
- if ( extens[i]!=NULL )
- filename = tobefreed1;
- else {
- free(tobefreed1);
- tobefreed1 = NULL;
- }
- }
- } else
- tobefreed1 = NULL;
-
- sf = NULL;
- /* Only one view per font */
- for ( fv=fv_list; fv!=NULL && sf==NULL; fv=fv->next ) {
- if ( fv->sf->filename!=NULL && strcmp(fv->sf->filename,filename)==0 )
- sf = fv->sf;
- else if ( fv->sf->origname!=NULL && strcmp(fv->sf->origname,filename)==0 )
- sf = fv->sf;
- }
- if ( sf==NULL && *filename!='/' )
- sf = AbsoluteNameCheck(filename);
- if ( sf==NULL && *filename!='/' )
- filename = tobefreed2 = ToAbsolute(filename);
-
- if ( sf==NULL )
- sf = ReadSplineFont(filename,openflags);
-
- free(tobefreed1);
- free(tobefreed2);
-return( sf );
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-FontView *ViewPostscriptFont(char *filename) {
- SplineFont *sf = LoadSplineFont(filename,0);
- extern NameList *force_names_when_opening;
- if ( sf==NULL )
-return( NULL );
- if ( sf->fv==NULL && force_names_when_opening!=NULL )
- SFRenameGlyphsToNamelist(sf,force_names_when_opening );
-#if 0
- if ( sf->fv!=NULL ) {
- GDrawSetVisible(sf->fv->gw,true);
- GDrawRaise(sf->fv->gw);
-return( sf->fv );
- }
-#endif
-return( FontViewCreate(sf)); /* Always make a new view now */
-}
-
-FontView *FontNew(void) {
-return( FontViewCreate(SplineFontNew()));
-}
-#endif
-
-void FontViewFree(FontView *fv) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int i;
- FontView *prev;
- FontView *fvs;
-#endif
- if ( fv->sf == NULL ) /* Happens when usurping a font to put it into an MM */
- BDFFontFree(fv->filled);
- else if ( fv->nextsame==NULL && fv->sf->fv==fv ) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- EncMapFree(fv->map);
-#endif
- SplineFontFree(fv->cidmaster?fv->cidmaster:fv->sf);
- BDFFontFree(fv->filled);
- } else {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- EncMapFree(fv->map);
- for ( fvs=fv->sf->fv, i=0 ; fvs!=NULL; fvs = fvs->nextsame )
- if ( fvs->filled==fv->filled ) ++i;
- if ( i==1 )
- BDFFontFree(fv->filled);
- if ( fv->sf->fv==fv ) {
- if ( fv->cidmaster==NULL )
- fv->sf->fv = fv->nextsame;
- else {
- fv->cidmaster->fv = fv->nextsame;
- for ( i=0; i<fv->cidmaster->subfontcnt; ++i )
- fv->cidmaster->subfonts[i]->fv = fv->nextsame;
- }
- } else {
- for ( prev = fv->sf->fv; prev->nextsame!=fv; prev=prev->nextsame );
- prev->nextsame = fv->nextsame;
- }
-#endif
- }
- DictionaryFree(fv->fontvars);
- free(fv->fontvars);
- free(fv->selected);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- free(fv->fontset);
-#ifndef _NO_PYTHON
- PyFF_FreeFV(fv);
-#endif
-#endif
- free(fv);
-}
-
-void FVFakeMenus(FontView *fv,int cmd) {
- switch ( cmd ) {
-#ifndef LUA_FF_LIB
- case 0: /* Cut */
- FVCopy(fv,ct_fullcopy);
- FVClear(fv);
- break;
- case 1:
- FVCopy(fv,ct_fullcopy);
- break;
- case 2: /* Copy reference */
- FVCopy(fv,ct_lookups);
- break;
- case 3:
- FVCopyWidth(fv,ut_width);
- break;
-#endif
- case 4:
- PasteIntoFV(fv,false,NULL);
- break;
-#ifndef LUA_FF_LIB
- case 5:
- FVClear(fv);
- break;
-#endif
- case 6:
- FVClearBackground(fv);
- break;
- case 7:
- FVCopyFgtoBg(fv);
- break;
- case 8:
- FVUnlinkRef(fv);
- break;
- case 9:
- PasteIntoFV(fv,true,NULL);
- break;
-#ifndef LUA_FF_LIB
- case 10:
- FVCopyWidth(fv,ut_vwidth);
- break;
- case 11:
- FVCopyWidth(fv,ut_lbearing);
- break;
- case 12:
- FVCopyWidth(fv,ut_rbearing);
- break;
-#endif
- case 13:
- FVJoin(fv);
- break;
- case 14:
- FVSameGlyphAs(fv);
- break;
-
- case 100:
- FVOverlap(fv,over_remove);
- break;
-#if 0 /* Not used any more */
- case 101:
- FVSimplify(fv,false);
- break;
-#endif
- case 102:
- FVAddExtrema(fv);
- break;
- case 103:
- FVRound2Int(fv,1.0);
- break;
- case 104:
- FVOverlap(fv,over_intersect);
- break;
- case 105:
- FVOverlap(fv,over_findinter);
- break;
-
-#ifndef LUA_FF_LIB
- case 200:
- FVAutoHint(fv);
- break;
- case 201:
- FVClearHints(fv);
- break;
- case 202:
- FVAutoInstr(fv);
- break;
- case 203:
- FVAutoHintSubs(fv);
- break;
- case 204:
- FVAutoCounter(fv);
- break;
- case 205:
- FVDontAutoHint(fv);
- break;
- case 206:
- FVClearInstrs(fv);
- break;
-#endif
- }
-}
-
-int FVWinInfo(FontView *fv, int *cc, int *rc) {
- if ( fv==NULL || fv->colcnt==0 || fv->rowcnt==0 ) {
- *cc = 16; *rc = 4;
-return( -1 );
- }
-
- *cc = fv->colcnt;
- *rc = fv->rowcnt;
-
-return( fv->rowoff*fv->colcnt );
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fvfonts.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fvfonts.c
deleted file mode 100644
index eeb8d836dca..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/fvfonts.c
+++ /dev/null
@@ -1,1911 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include "ustring.h"
-#include "utype.h"
-#include "gfile.h"
-#include "chardata.h"
-
-#ifdef LUA_FF_LIB
-extern void SFAddGlyphAndEncode(SplineFont *sf,SplineChar *sc,EncMap *basemap, int baseenc);
-extern void gwwv_post_error(char *a, ...);
-#endif
-
-static RefChar *RefCharsCopy(RefChar *ref) {
- RefChar *rhead=NULL, *last=NULL, *cur;
-
- while ( ref!=NULL ) {
- cur = RefCharCreate();
-#ifdef FONTFORGE_CONFIG_TYPE3
- { struct reflayer *layers = cur->layers; int layer;
- layers = grealloc(layers,ref->layer_cnt*sizeof(struct reflayer));
- memcpy(layers,ref->layers,ref->layer_cnt*sizeof(struct reflayer));
- *cur = *ref;
- cur->layers = layers;
- for ( layer=0; layer<cur->layer_cnt; ++layer ) {
- cur->layers[layer].splines = NULL;
- cur->layers[layer].images = NULL;
- }
- }
-#else
- *cur = *ref;
- cur->layers[0].splines = NULL; /* Leave the old sc, we'll fix it later */
-#endif
- if ( cur->sc!=NULL )
- cur->orig_pos = cur->sc->orig_pos;
- cur->next = NULL;
- if ( rhead==NULL )
- rhead = cur;
- else
- last->next = cur;
- last = cur;
- ref = ref->next;
- }
-return( rhead );
-}
-
-static OTLookup *MCConvertLookup(struct sfmergecontext *mc,OTLookup *otl) {
- int l;
- OTLookup *newotl;
-
- if ( mc==NULL || mc->sf_from==mc->sf_to )
-return( otl ); /* No translation needed */
-
- for ( l=0; l<mc->lcnt; ++l ) {
- if ( mc->lks[l].from == otl )
- break;
- }
- if ( l==mc->lcnt )
-return( NULL );
- if ( mc->lks[l].to!=NULL )
-return( mc->lks[l].to );
-
- mc->lks[l].to = newotl = chunkalloc(sizeof(struct lookup_subtable));
- newotl->lookup_name = strconcat(mc->prefix,otl->lookup_name);
- newotl->lookup_type = otl->lookup_type;
- newotl->lookup_flags = otl->lookup_flags;
- newotl->features = FeatureListCopy(otl->features);
- newotl->store_in_afm = otl->store_in_afm;
-return( newotl );
-}
-
-struct lookup_subtable *MCConvertSubtable(struct sfmergecontext *mc,struct lookup_subtable *sub) {
- int s;
- struct lookup_subtable *newsub;
-
- if ( mc==NULL || mc->sf_from==mc->sf_to )
-return( sub ); /* No translation needed */
- if ( mc->prefix==NULL ) {
- int lcnt, scnt;
- OTLookup *otl;
- struct lookup_subtable *subs;
- int isgpos, doit;
- char *temp;
-
- /* Not initialized */
- if ( mc->sf_from->cidmaster ) mc->sf_from = mc->sf_from->cidmaster;
- else if ( mc->sf_from->mm!=NULL ) mc->sf_from = mc->sf_from->mm->normal;
- if ( mc->sf_to->cidmaster ) mc->sf_to = mc->sf_to->cidmaster;
- else if ( mc->sf_to->mm!=NULL ) mc->sf_to = mc->sf_to->mm->normal;
- if ( mc->sf_from == mc->sf_to )
-return( sub );
- mc->prefix = strconcat(mc->sf_from->fontname,"-");
- for ( doit = 0; doit<2; ++doit ) {
- lcnt = scnt = 0;
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- for ( otl = isgpos ? mc->sf_from->gpos_lookups : mc->sf_from->gsub_lookups; otl!=NULL; otl=otl->next ) {
- if ( doit ) {
- mc->lks[lcnt].from = otl;
- temp = strconcat(mc->prefix,otl->lookup_name);
- mc->lks[lcnt].to = SFFindLookup(mc->sf_to,temp);
- free(temp);
- mc->lks[lcnt].old = mc->lks[lcnt].to!=NULL;
- }
- ++lcnt;
- for ( subs=otl->subtables; subs!=NULL; subs=subs->next ) {
- if ( doit ) {
- mc->subs[scnt].from = subs;
- temp = strconcat(mc->prefix,subs->subtable_name);
- mc->subs[scnt].to = SFFindLookupSubtable(mc->sf_to,temp);
- free(temp);
- mc->subs[scnt].old = mc->subs[scnt].to!=NULL;
- }
- ++scnt;
- }
- }
- }
- if ( !doit ) {
- mc->lcnt = lcnt; mc->scnt = scnt;
- mc->lks = gcalloc(lcnt,sizeof(struct lookup_cvt));
- mc->subs = gcalloc(scnt,sizeof(struct sub_cvt));
- }
- }
- }
-
- for ( s=0; s<mc->scnt; ++s ) {
- if ( mc->subs[s].from == sub )
- break;
- }
- if ( s==mc->scnt )
-return( NULL );
- if ( mc->subs[s].to!=NULL )
-return( mc->subs[s].to );
-
- mc->subs[s].to = newsub = chunkalloc(sizeof(struct lookup_subtable));
- newsub->subtable_name = strconcat(mc->prefix,sub->subtable_name);
- newsub->lookup = MCConvertLookup(mc,sub->lookup);
- newsub->anchor_classes = sub->anchor_classes;
- newsub->per_glyph_pst_or_kern = sub->per_glyph_pst_or_kern;
-return( newsub );
-}
-
-#ifndef LUA_FF_LIB
-
-AnchorClass *MCConvertAnchorClass(struct sfmergecontext *mc,AnchorClass *ac) {
- int a;
- AnchorClass *newac;
-
- if ( mc==NULL || mc->sf_from==mc->sf_to )
-return( ac ); /* No translation needed */
- if ( mc->acnt==0 ) {
- int acnt;
- AnchorClass *testac, *testac2;
- int doit;
- char *temp;
-
- /* Not initialized */
- for ( doit = 0; doit<2; ++doit ) {
- acnt = 0;
- for ( testac=mc->sf_from->anchor; testac!=NULL; testac=testac->next ) {
- if ( doit ) {
- mc->acs[acnt].from = testac;
- temp = strconcat(mc->prefix,testac->name);
- for ( testac2 = mc->sf_to->anchor; testac2!=NULL; testac2=testac2->next )
- if ( strcmp(testac2->name,temp)==0 )
- break;
- mc->acs[acnt].to = testac2;
- free(temp);
- mc->acs[acnt].old = mc->acs[acnt].to!=NULL;
- }
- ++acnt;
- }
- if ( !doit ) {
- mc->acnt = acnt;
- mc->acs = gcalloc(acnt,sizeof(struct ac_cvt));
- }
- }
- }
-
- for ( a=0; a<mc->acnt; ++a ) {
- if ( mc->acs[a].from == ac )
- break;
- }
- if ( a==mc->acnt )
-return( NULL );
- if ( mc->acs[a].to!=NULL )
-return( mc->acs[a].to );
-
- mc->acs[a].to = newac = chunkalloc(sizeof(AnchorClass));
- newac->name = strconcat(mc->prefix,ac->name);
- newac->subtable = MCConvertSubtable(mc,ac->subtable);
- newac->next = mc->sf_to->anchor;
- mc->sf_to->anchor = newac;
-return( newac );
-}
-
-void SFFinishMergeContext(struct sfmergecontext *mc) {
- int l,s,slast, isgpos;
- OTLookup *otl, *last;
- struct lookup_subtable *sub_last;
-
- if ( mc->prefix==NULL ) /* Nothing to do, never initialized, no lookups needed */
-return;
-
- /* Get all the subtables in the right order */
- for ( s=0; s<mc->scnt; s=slast ) {
- if ( mc->subs[s].to==NULL )
- continue;
- otl = mc->subs[s].to->lookup;
- sub_last = otl->subtables = mc->subs[s].to;
- for ( slast=s+1; slast<mc->scnt; ++slast ) {
- if ( mc->subs[slast].to==NULL )
- continue;
- if ( mc->subs[slast].to->lookup!=otl )
- break;
- sub_last->next = mc->subs[slast].to;
- sub_last = sub_last->next;
- }
- sub_last->next = NULL;
- }
-
- /* Then order the lookups. Leave the old lookups as they are, insert the */
- /* new at the end of the list */
- last = NULL;
- for ( l=0; l<mc->lcnt; ++l ) {
- if ( mc->lks[l].to==NULL || mc->lks[l].old )
- continue;
- otl = mc->lks[l].to;
- isgpos = (otl->lookup_type>=gpos_start);
- if ( last==NULL || (last->lookup_type>=gpos_start)!=isgpos) {
- last = isgpos ? mc->sf_to->gpos_lookups : mc->sf_to->gsub_lookups;
- if ( last!=NULL )
- while ( last->next!=NULL )
- last = last->next;
- }
- if ( last!=NULL )
- last->next = otl;
- else if ( isgpos )
- mc->sf_to->gpos_lookups = otl;
- else
- mc->sf_to->gsub_lookups = otl;
- last = otl;
- }
-
- free(mc->prefix);
- free(mc->lks);
- free(mc->subs);
- free(mc->acs);
-}
-#endif
-
-PST *PSTCopy(PST *base,SplineChar *sc,struct sfmergecontext *mc) {
- PST *head=NULL, *last=NULL, *cur;
-
- for ( ; base!=NULL; base = base->next ) {
- cur = chunkalloc(sizeof(PST));
- *cur = *base;
- cur->subtable = MCConvertSubtable(mc,base->subtable);
- if ( cur->type==pst_ligature ) {
- cur->u.lig.components = copy(cur->u.lig.components);
- cur->u.lig.lig = sc;
- } else if ( cur->type==pst_pair ) {
- cur->u.pair.paired = copy(cur->u.pair.paired);
- cur->u.pair.vr = chunkalloc(sizeof( struct vr [2]));
- memcpy(cur->u.pair.vr,base->u.pair.vr,sizeof(struct vr [2]));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- cur->u.pair.vr[0].adjust = ValDevTabCopy(base->u.pair.vr[0].adjust);
- cur->u.pair.vr[1].adjust = ValDevTabCopy(base->u.pair.vr[1].adjust);
-#endif
- } else if ( cur->type==pst_lcaret ) {
- cur->u.lcaret.carets = galloc(cur->u.lcaret.cnt*sizeof(uint16));
- memcpy(cur->u.lcaret.carets,base->u.lcaret.carets,cur->u.lcaret.cnt*sizeof(uint16));
- } else if ( cur->type==pst_substitution || cur->type==pst_multiple || cur->type==pst_alternate )
- cur->u.subs.variant = copy(cur->u.subs.variant);
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- }
-return( head );
-}
-
-static AnchorPoint *AnchorPointsDuplicate(AnchorPoint *base,SplineChar *sc) {
- AnchorPoint *head=NULL, *last=NULL, *cur;
- AnchorClass *ac;
-
- for ( ; base!=NULL; base = base->next ) {
- cur = chunkalloc(sizeof(AnchorPoint));
- *cur = *base;
- cur->next = NULL;
- for ( ac=sc->parent->anchor; ac!=NULL; ac=ac->next )
- if ( strcmp(ac->name,base->anchor->name)==0 )
- break;
- cur->anchor = ac;
- if ( ac==NULL ) {
- LogError( "No matching AnchorClass for %s", base->anchor->name);
- chunkfree(cur,sizeof(AnchorPoint));
- } else {
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- }
- }
-return( head );
-}
-
-#ifndef LUA_FF_LIB
-static void AnchorClassesAdd(SplineFont *into, SplineFont *from, struct sfmergecontext *mc) {
- AnchorClass *fac, *iac, *last, *cur;
-
- if ( into->cidmaster!=NULL )
- into = into->cidmaster;
- if ( from->cidmaster!=NULL )
- from = from->cidmaster;
-
- for ( fac = from->anchor; fac!=NULL; fac=fac->next ) {
- last = NULL;
- for ( iac=into->anchor; iac!=NULL; iac=iac->next ) {
- if ( strcmp(iac->name,fac->name)==0 )
- break;
- last = iac;
- }
- if ( iac==NULL ) {
- cur = chunkalloc(sizeof(AnchorClass));
- *cur = *fac;
- cur->next = NULL;
- cur->name = copy(cur->name);
- cur->subtable = MCConvertSubtable(mc,cur->subtable);
- if ( last==NULL )
- into->anchor = cur;
- else
- last->next = cur;
- } else {
- /* Just use the one that's there and hope it's right. Not sure */
- /* what else we can do... */
- }
- }
-}
-
-static void FPSTsAdd(SplineFont *into, SplineFont *from,struct sfmergecontext *mc) {
- FPST *fpst, *nfpst, *last;
- int i,k;
-
- last = NULL;
- if ( into->possub!=NULL )
- for ( last = into->possub; last->next!=NULL; last=last->next );
- for ( fpst = from->possub; fpst!=NULL; fpst=fpst->next ) {
- nfpst = FPSTCopy(fpst);
- nfpst->subtable = MCConvertSubtable(mc,fpst->subtable);
- nfpst->subtable->fpst = nfpst;
- for ( i=0; i<nfpst->rule_cnt; ++i ) {
- struct fpst_rule *r = &nfpst->rules[i], *oldr = &fpst->rules[i];
- for ( k=0; k<r->lookup_cnt; ++k ) {
- r->lookups[k].lookup = MCConvertLookup(mc,oldr->lookups[k].lookup);
- }
- }
- if ( last==NULL )
- into->possub = nfpst;
- else
- last->next = nfpst;
- last = nfpst;
- }
-}
-
-static void ASMsAdd(SplineFont *into, SplineFont *from,struct sfmergecontext *mc) {
- ASM *sm, *nsm, *last;
- int i;
-
- last = NULL;
- if ( into->sm!=NULL )
- for ( last = into->sm; last->next!=NULL; last=last->next );
- for ( sm = from->sm; sm!=NULL; sm=sm->next ) {
- nsm = chunkalloc(sizeof(ASM));
- *nsm = *sm;
- nsm->subtable = MCConvertSubtable(mc,sm->subtable);
- nsm->subtable->sm = nsm;
- nsm->classes = galloc(nsm->class_cnt*sizeof(char *));
- for ( i=0; i<nsm->class_cnt; ++i )
- nsm->classes[i] = copy(sm->classes[i]);
- nsm->state = galloc(nsm->class_cnt*nsm->state_cnt*sizeof(struct asm_state));
- memcpy(nsm->state,sm->state,nsm->class_cnt*nsm->state_cnt*sizeof(struct asm_state));
- if ( nsm->type == asm_kern ) {
- for ( i=nsm->class_cnt*nsm->state_cnt-1; i>=0; --i ) {
- nsm->state[i].u.kern.kerns = galloc(nsm->state[i].u.kern.kcnt*sizeof(int16));
- memcpy(nsm->state[i].u.kern.kerns,sm->state[i].u.kern.kerns,nsm->state[i].u.kern.kcnt*sizeof(int16));
- }
- } else if ( nsm->type == asm_context ) {
- for ( i=0; i<nsm->class_cnt*nsm->state_cnt; ++i ) {
- nsm->state[i].u.context.mark_lookup = MCConvertLookup(mc,
- nsm->state[i].u.context.mark_lookup);
- nsm->state[i].u.context.cur_lookup = MCConvertLookup(mc,
- nsm->state[i].u.context.cur_lookup);
- }
- } else if ( nsm->type == asm_insert ) {
- for ( i=nsm->class_cnt*nsm->state_cnt-1; i>=0; --i ) {
- nsm->state[i].u.insert.mark_ins = copy(sm->state[i].u.insert.mark_ins);
- nsm->state[i].u.insert.cur_ins = copy(sm->state[i].u.insert.cur_ins);
- }
- }
- }
-}
-
-static KernClass *_KernClassCopy(KernClass *kc,SplineFont *into,SplineFont *from,struct sfmergecontext *mc) {
- KernClass *nkc;
-
- nkc = KernClassCopy(kc);
- nkc->subtable = MCConvertSubtable(mc,kc->subtable);
- nkc->subtable->kc = nkc;
-return( nkc );
-}
-
-static void KernClassesAdd(SplineFont *into, SplineFont *from,struct sfmergecontext *mc) {
- /* Is this a good idea? We could end up with two kern classes that do */
- /* the same thing and strange sets of slis so that they didn't all fit */
- /* in one lookup... */
- KernClass *kc, *last, *cur;
-
- last = NULL;
- if ( into->kerns!=NULL )
- for ( last = into->kerns; last->next!=NULL; last=last->next );
- for ( kc=from->kerns; kc!=NULL; kc=kc->next ) {
- cur = _KernClassCopy(kc,into,from,mc);
- if ( last==NULL )
- into->kerns = cur;
- else
- last->next = cur;
- last = cur;
- }
-
- last = NULL;
- if ( into->vkerns!=NULL )
- for ( last = into->vkerns; last->next!=NULL; last=last->next )
- for ( kc=from->vkerns; kc!=NULL; kc=kc->next ) {
- cur = _KernClassCopy(kc,into,from,mc);
- if ( last==NULL )
- into->vkerns = cur;
- else
- last->next = cur;
- last = cur;
- }
-}
-#endif
-
-static struct altuni *AltUniCopy(struct altuni *altuni,SplineFont *noconflicts) {
- struct altuni *head=NULL, *last=NULL, *cur;
-
- while ( altuni!=NULL ) {
- if ( noconflicts==NULL || SFGetChar(noconflicts,altuni->unienc,NULL)==NULL ) {
- cur = chunkalloc(sizeof(struct altuni));
- cur->unienc = altuni->unienc;
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- }
- altuni = altuni->next;
- }
-return( head );
-}
-
-SplineChar *SplineCharCopy(SplineChar *sc,SplineFont *into,struct sfmergecontext *mc) {
- SplineChar *nsc = SplineCharCreate();
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer *layers = nsc->layers;
- int layer;
-
- *nsc = *sc;
- if ( sc->layer_cnt!=2 )
- layers = grealloc(layers,sc->layer_cnt*sizeof(Layer));
- memcpy(layers,sc->layers,sc->layer_cnt*sizeof(Layer));
- nsc->layers = layers;
- for ( layer = ly_back; layer<sc->layer_cnt; ++layer ) {
- layers[layer].splines = SplinePointListCopy(layers[layer].splines);
- layers[layer].refs = RefCharsCopy(layers[layer].refs);
- layers[layer].images = ImageListCopy(layers[layer].images);
- layers[layer].undoes = NULL;
- layers[layer].redoes = NULL;
- }
-#else
- *nsc = *sc;
- nsc->layers[ly_fore].splines = SplinePointListCopy(nsc->layers[ly_fore].splines);
- nsc->layers[ly_fore].refs = RefCharsCopy(nsc->layers[ly_fore].refs);
- nsc->layers[ly_back].splines = SplinePointListCopy(nsc->layers[ly_back].splines);
- nsc->layers[ly_back].images = ImageListCopy(nsc->layers[ly_back].images);
-#endif
- nsc->parent = into;
- nsc->orig_pos = -2;
- nsc->name = copy(sc->name);
- nsc->hstem = StemInfoCopy(nsc->hstem);
- nsc->vstem = StemInfoCopy(nsc->vstem);
- nsc->anchor = AnchorPointsDuplicate(nsc->anchor,nsc);
- nsc->views = NULL;
- nsc->changed = true;
- nsc->dependents = NULL; /* Fix up later when we know more */
- nsc->layers[ly_fore].undoes = nsc->layers[ly_back].undoes = NULL;
- nsc->layers[ly_fore].redoes = nsc->layers[ly_back].redoes = NULL;
- if ( nsc->ttf_instrs_len!=0 ) {
- nsc->ttf_instrs = galloc(nsc->ttf_instrs_len);
- memcpy(nsc->ttf_instrs,sc->ttf_instrs,nsc->ttf_instrs_len);
- }
- nsc->kerns = NULL;
- nsc->possub = PSTCopy(nsc->possub,nsc,mc);
- nsc->altuni = AltUniCopy(nsc->altuni,into);
- if ( sc->parent!=NULL && into->order2!=sc->parent->order2 )
- SCConvertOrder(nsc,into->order2);
-return(nsc);
-}
-
-#ifndef LUA_FF_LIB
-static KernPair *KernsCopy(KernPair *kp,int *mapping,SplineFont *into,
- struct sfmergecontext *mc) {
- KernPair *head = NULL, *last=NULL, *new;
- int index;
-
- while ( kp!=NULL ) {
- if ( (index=mapping[kp->sc->orig_pos])>=0 && index<into->glyphcnt &&
- into->glyphs[index]!=NULL ) {
- new = chunkalloc(sizeof(KernPair));
- new->off = kp->off;
- new->subtable = MCConvertSubtable(mc,kp->subtable);
- new->sc = into->glyphs[index];
- if ( head==NULL )
- head = new;
- else
- last->next = new;
- last = new;
- }
- kp = kp->next;
- }
-return( head );
-}
-
-
-BDFChar *BDFCharCopy(BDFChar *bc) {
- BDFChar *nbc = galloc(sizeof( BDFChar ));
-
- *nbc = *bc;
- nbc->views = NULL;
- nbc->selection = NULL;
- nbc->undoes = NULL;
- nbc->redoes = NULL;
- nbc->bitmap = galloc((nbc->ymax-nbc->ymin+1)*nbc->bytes_per_line);
- memcpy(nbc->bitmap,bc->bitmap,(nbc->ymax-nbc->ymin+1)*nbc->bytes_per_line);
-return( nbc );
-}
-
-void BitmapsCopy(SplineFont *to, SplineFont *from, int to_index, int from_index ) {
- BDFFont *f_bdf, *t_bdf;
-
- /* We assume that the bitmaps are ordered. They should be */
- for ( t_bdf=to->bitmaps, f_bdf=from->bitmaps; t_bdf!=NULL && f_bdf!=NULL; ) {
- if ( t_bdf->pixelsize == f_bdf->pixelsize ) {
- if ( f_bdf->glyphs[from_index]!=NULL ) {
- BDFCharFree(t_bdf->glyphs[to_index]);
- t_bdf->glyphs[to_index] = BDFCharCopy(f_bdf->glyphs[from_index]);
- t_bdf->glyphs[to_index]->sc = to->glyphs[to_index];
- t_bdf->glyphs[to_index]->orig_pos = to_index;
- }
- t_bdf = t_bdf->next;
- f_bdf = f_bdf->next;
- } else if ( t_bdf->pixelsize < f_bdf->pixelsize ) {
- t_bdf = t_bdf->next;
- f_bdf = f_bdf->next;
- }
- }
-}
-#endif
-
-#define GN_HSIZE 257
-
-struct glyphnamebucket {
- SplineChar *sc;
- struct glyphnamebucket *next;
-};
-
-struct glyphnamehash {
- struct glyphnamebucket *table[GN_HSIZE];
-};
-
-#ifndef __GNUC__
-# define __inline__
-#endif
-
-static __inline__ int hashname(const char *pt) {
- int val = 0;
-
- while ( *pt ) {
- val = (val<<3)|((val>>29)&0x7);
- val ^= (unsigned char)(*pt-'!');
- pt++;
- }
- val ^= (val>>16);
- val &= 0xffff;
- val %= GN_HSIZE;
-return( val );
-}
-
-static void _GlyphHashFree(SplineFont *sf) {
- struct glyphnamebucket *test, *next;
- int i;
-
- if ( sf->glyphnames==NULL )
-return;
- for ( i=0; i<GN_HSIZE; ++i ) {
- for ( test = sf->glyphnames->table[i]; test!=NULL; test = next ) {
- next = test->next;
- chunkfree(test,sizeof(struct glyphnamebucket));
- }
- }
- free(sf->glyphnames);
- sf->glyphnames = NULL;
-}
-
-void GlyphHashFree(SplineFont *sf) {
- _GlyphHashFree(sf);
- if ( sf->cidmaster )
- _GlyphHashFree(sf->cidmaster);
-}
-
-static void GlyphHashCreate(SplineFont *sf) {
- int i, k, hash;
- SplineFont *_sf;
- struct glyphnamehash *gnh;
- struct glyphnamebucket *new;
-
- if ( sf->glyphnames!=NULL )
-return;
- sf->glyphnames = gnh = gcalloc(1,sizeof(*gnh));
- k = 0;
- do {
- _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
- /* I walk backwards because there are some ttf files where multiple */
- /* glyphs get the same name. In the cases I've seen only one of these */
- /* has an encoding. That's the one we want. It will be earlier in the */
- /* font than the others. If we build the list backwards then it will */
- /* be the top name in the bucket, and will be the one we return */
- for ( i=_sf->glyphcnt-1; i>=0; --i ) if ( _sf->glyphs[i]!=NULL ) {
- new = chunkalloc(sizeof(struct glyphnamebucket));
- new->sc = _sf->glyphs[i];
- hash = hashname(new->sc->name);
- new->next = gnh->table[hash];
- gnh->table[hash] = new;
- }
- ++k;
- } while ( k<sf->subfontcnt );
-}
-
-void SFHashGlyph(SplineFont *sf,SplineChar *sc) {
- /* sc just got added to the font. Put it in the lookup */
- int hash;
- struct glyphnamebucket *new;
-
- if ( sf->glyphnames==NULL )
-return; /* No hash table, nothing to update */
-
- new = chunkalloc(sizeof(struct glyphnamebucket));
- new->sc = sc;
- hash = hashname(sc->name);
- new->next = sf->glyphnames->table[hash];
- sf->glyphnames->table[hash] = new;
-}
-
-static SplineChar *SFHashName(SplineFont *sf,const char *name) {
- struct glyphnamebucket *test;
-
- if ( sf->glyphnames==NULL )
- GlyphHashCreate(sf);
-
- for ( test=sf->glyphnames->table[hashname(name)]; test!=NULL; test = test->next )
- if ( strcmp(test->sc->name,name)==0 )
-return( test->sc );
-
-return( NULL );
-}
-
-/* Find the position in the glyph list where this code point/name is found. */
-/* Returns -1 else on error */
-int SFFindGID(SplineFont *sf, int unienc, const char *name ) {
- struct altuni *altuni;
- int gid;
- SplineChar *sc;
-
- if ( unienc!=-1 ) {
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
- if ( sf->glyphs[gid]->unicodeenc == unienc )
-return( gid );
- for ( altuni = sf->glyphs[gid]->altuni; altuni!=NULL; altuni=altuni->next ) {
- if ( altuni->unienc == unienc )
-return( gid );
- }
- }
- }
- if ( name!=NULL ) {
- sc = SFHashName(sf,name);
- if ( sc!=NULL )
-return( sc->orig_pos );
- }
-
-return ( -1 );
-}
-
-/* Find the position in the current encoding where this code point/name should*/
-/* be found. (or for unencoded glyphs where it is found). Returns -1 else */
-int SFFindSlot(SplineFont *sf, EncMap *map, int unienc, const char *name ) {
- int index=-1, pos;
-
- if ( (map->enc->is_custom || map->enc->is_compact ||
- map->enc->is_original) && unienc!=-1 ) {
- if ( unienc<map->enccount && map->map[unienc]!=-1 &&
- sf->glyphs[map->map[unienc]]!=NULL &&
- sf->glyphs[map->map[unienc]]->unicodeenc==unienc )
- index = unienc;
- else for ( index = map->enccount-1; index>=0; --index ) {
- if ( (pos = map->map[index])!=-1 && sf->glyphs[pos]!=NULL &&
- sf->glyphs[pos]->unicodeenc==unienc )
- break;
- }
- } else if ( unienc!=-1 &&
- ((unienc<0x10000 && map->enc->is_unicodebmp) ||
- (unienc<0x110000 && map->enc->is_unicodefull))) {
- index = unienc;
- } else if ( unienc!=-1 ) {
- index = EncFromUni(unienc,map->enc);
- if ( index<0 || index>=map->enccount ) {
- for ( index=map->enc->char_cnt; index<map->enccount; ++index )
- if ( (pos = map->map[index])!=-1 && sf->glyphs[pos]!=NULL &&
- sf->glyphs[pos]->unicodeenc==unienc )
- break;
- if ( index>=map->enccount )
- index = -1;
- }
- }
- if ( index==-1 && name!=NULL ) {
- SplineChar *sc = SFHashName(sf,name);
- if ( sc!=NULL ) index = map->backmap[sc->orig_pos];
- if ( index==-1 ) {
- unienc = UniFromName(name,sf->uni_interp,map->enc);
- if ( unienc!=-1 )
-return( SFFindSlot(sf,map,unienc,NULL));
- if ( map->enc->psnames!=NULL ) {
- for ( index = map->enc->char_cnt-1; index>=0; --index )
- if ( map->enc->psnames[index]!=NULL &&
- strcmp(map->enc->psnames[index],name)==0 )
-return( index );
- }
- }
- }
-
-return( index );
-}
-
-int SFCIDFindExistingChar(SplineFont *sf, int unienc, const char *name ) {
- int j,ret;
-
- if ( sf->subfonts==NULL && sf->cidmaster==NULL )
-return( SFFindExistingSlot(sf,unienc,name));
- if ( sf->cidmaster!=NULL )
- sf=sf->cidmaster;
- for ( j=0; j<sf->subfontcnt; ++j )
- if (( ret = SFFindExistingSlot(sf,unienc,name))!=-1 )
-return( ret );
-return( -1 );
-}
-
-int SFCIDFindCID(SplineFont *sf, int unienc, const char *name ) {
- int j,ret;
- struct cidmap *cidmap;
-
- if ( sf->cidmaster!=NULL || sf->subfontcnt!=0 ) {
- if ( sf->cidmaster!=NULL )
- sf=sf->cidmaster;
- cidmap = FindCidMap(sf->cidregistry,sf->ordering,sf->supplement,sf);
- ret = NameUni2CID(cidmap,unienc,name);
- if ( ret!=-1 )
-return( ret );
- }
-
- if ( sf->subfonts==NULL && sf->cidmaster==NULL )
-return( SFFindGID(sf,unienc,name));
-
- if ( sf->cidmaster!=NULL )
- sf=sf->cidmaster;
- for ( j=0; j<sf->subfontcnt; ++j )
- if (( ret = SFFindGID(sf,unienc,name))!=-1 )
-return( ret );
-
-return( -1 );
-}
-
-int SFHasCID(SplineFont *sf,int cid) {
- int i;
- /* What subfont (if any) contains this cid? */
- if ( sf->cidmaster!=NULL )
- sf=sf->cidmaster;
- for ( i=0; i<sf->subfontcnt; ++i )
- if ( cid<sf->subfonts[i]->glyphcnt &&
- SCWorthOutputting(sf->subfonts[i]->glyphs[cid]) )
-return( i );
- for ( i=0; i<sf->subfontcnt; ++i )
- if ( cid<sf->subfonts[i]->glyphcnt && sf->subfonts[i]->glyphs[cid]!=NULL )
-return( i );
-
-return( -1 );
-}
-
-SplineChar *SFGetChar(SplineFont *sf, int unienc, const char *name ) {
- int ind;
- int j;
-
- ind = SFCIDFindCID(sf,unienc,name);
- if ( ind==-1 )
-return( NULL );
-
- if ( sf->subfonts==NULL && sf->cidmaster==NULL )
-return( sf->glyphs[ind]);
-
- if ( sf->cidmaster!=NULL )
- sf=sf->cidmaster;
-
- j = SFHasCID(sf,ind);
- if ( j==-1 )
-return( NULL );
-
-return( sf->subfonts[j]->glyphs[ind] );
-}
-
-#ifndef LUA_FF_LIB
-SplineChar *SFGetOrMakeChar(SplineFont *sf, int unienc, const char *name ) {
- SplineChar *sc=NULL;
-
- if ( sf->fv!=NULL ) {
- int ind = SFFindSlot(sf,sf->fv->map,unienc,name);
- if ( ind!=-1 )
- sc = SFMakeChar(sf,sf->fv->map,ind);
- } else
- sc = SFGetChar(sf,unienc,name);
- if ( sc==NULL && (unienc!=-1 || name!=NULL)) {
- sc = SplineCharCreate();
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( sf->strokedfont ) {
- sc->layers[ly_fore].dostroke = true;
- sc->layers[ly_fore].dofill = false;
- }
-#endif
- sc->unicodeenc = unienc;
- if ( name!=NULL )
- sc->name = copy(name);
- else {
- char buffer[40];
- sprintf(buffer,"glyph%d", sf->glyphcnt);
- sc->name = copy(buffer);
- }
- SFAddGlyphAndEncode(sf,sc,NULL,-1);
- /*SCLigDefault(sc);*/
- }
-return( sc );
-}
-#endif
-
-static int _SFFindExistingSlot(SplineFont *sf, int unienc, const char *name ) {
- int gid = -1;
- struct altuni *altuni;
-
- if ( unienc!=-1 ) {
- for ( gid=sf->glyphcnt-1; gid>=0; --gid ) if ( sf->glyphs[gid]!=NULL ) {
- if ( sf->glyphs[gid]->unicodeenc==unienc )
- break;
- for ( altuni=sf->glyphs[gid]->altuni ; altuni!=NULL && altuni->unienc!=unienc ;
- altuni=altuni->next );
- if ( altuni!=NULL )
- break;
- }
- }
- if ( gid==-1 && name!=NULL ) {
- SplineChar *sc = SFHashName(sf,name);
- if ( sc==NULL )
-return( -1 );
- gid = sc->orig_pos;
- }
-return( gid );
-}
-
-int SFFindExistingSlot(SplineFont *sf, int unienc, const char *name ) {
- int gid = _SFFindExistingSlot(sf,unienc,name);
-
- if ( gid==-1 || !SCWorthOutputting(sf->glyphs[gid]) )
-return( -1 );
-
-return( gid );
-}
-
-
-#ifndef LUA_FF_LIB
-
-static void MFixupSC(SplineFont *sf, SplineChar *sc,int i) {
- RefChar *ref, *prev;
- FontView *fvs;
-
- sc->orig_pos = i;
- sc->parent = sf;
- retry:
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- /* The sc in the ref is from the old font. It's got to be in the */
- /* new font too (was either already there or just got copied) */
- ref->orig_pos = SFFindExistingSlot(sf,ref->sc->unicodeenc,ref->sc->name);
- if ( ref->orig_pos==-1 ) {
- IError("Bad reference, can't fix it up");
- if ( ref==sc->layers[ly_fore].refs ) {
- sc->layers[ly_fore].refs = ref->next;
- goto retry;
- } else {
- for ( prev=sc->layers[ly_fore].refs; prev->next!=ref; prev=prev->next );
- prev->next = ref->next;
- chunkfree(ref,sizeof(*ref));
- ref = prev;
- }
- } else {
- ref->sc = sf->glyphs[ref->orig_pos];
- if ( ref->sc->orig_pos==-2 )
- MFixupSC(sf,ref->sc,ref->orig_pos);
- SCReinstanciateRefChar(sc,ref);
- SCMakeDependent(sc,ref->sc);
- }
- }
- /* I shan't automagically generate bitmaps for any bdf fonts */
- /* but I have copied over the ones which match */
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame ) if ( fvs->filled!=NULL )
- fvs->filled->glyphs[i] = SplineCharRasterize(sc,fvs->filled->pixelsize);
-}
-
-static void MergeFixupRefChars(SplineFont *sf) {
- int i;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->orig_pos==-2 ) {
- MFixupSC(sf,sf->glyphs[i], i);
- }
-}
-
-int SFHasChar(SplineFont *sf, int unienc, const char *name ) {
- SplineChar *sc = SFGetChar(sf,unienc,name);
-
-return( SCWorthOutputting(sc) );
-}
-
-static void FVMergeRefigureMapSel(FontView *fv,SplineFont *into,SplineFont *o_sf,
- int *mapping, int emptypos, int cnt) {
- int extras, doit, i;
- EncMap *map = fv->map;
- int base = map->enccount;
-
- base = map->enccount;
-
- for ( doit=0; doit<2; ++doit ) {
- extras = 0;
- for ( i=0; i<o_sf->glyphcnt; ++i ) if ( mapping[i]>=emptypos ) {
- int index = SFFindSlot(into,map,o_sf->glyphs[i]->unicodeenc,o_sf->glyphs[i]->name);
- if ( !doit ) {
- if ( index==-1 )
- ++extras;
- } else {
- if ( index==-1 )
- index = base+ extras++;
- map->map[index] = mapping[i];
- map->backmap[mapping[i]] = index;
- }
- }
- if ( !doit ) {
- if ( into->glyphcnt+cnt>map->backmax ) {
- map->backmap = grealloc(map->backmap,(into->glyphcnt+cnt)*sizeof(int));
- map->backmax = into->glyphcnt+cnt;
- }
- memset(map->backmap+into->glyphcnt,-1,cnt*sizeof(int));
- if ( map->enccount+extras>map->encmax ) {
- map->map = grealloc(map->map,(map->enccount+extras)*sizeof(int));
- map->encmax = map->enccount+extras;
- }
- memset(map->map+map->enccount,-1,extras*sizeof(int));
- map->enccount += extras;
- }
- }
- if ( extras!=0 ) {
- fv->selected = grealloc(fv->selected,map->enccount);
- memset(fv->selected+map->enccount-extras,0,extras);
- }
-}
-
-static void _MergeFont(SplineFont *into,SplineFont *other,struct sfmergecontext *mc) {
- int i,cnt, doit, emptypos, index, k;
- SplineFont *o_sf, *bitmap_into;
- BDFFont *bdf;
- FontView *fvs;
- int *mapping;
-
- emptypos = into->glyphcnt;
- mapping = galloc(other->glyphcnt*sizeof(int));
- memset(mapping,-1,other->glyphcnt*sizeof(int));
-
- bitmap_into = into->cidmaster!=NULL? into->cidmaster : into;
-
- for ( doit=0; doit<2; ++doit ) {
- cnt = 0;
- k = 0;
- do {
- o_sf = ( other->subfonts==NULL ) ? other : other->subfonts[k];
- for ( i=0; i<o_sf->glyphcnt; ++i ) if ( o_sf->glyphs[i]!=NULL ) {
- if ( doit && (index = mapping[i])!=-1 ) {
- /* Bug here. Suppose someone has a reference to our empty */
- /* char */
- SplineCharFree(into->glyphs[index]);
- into->glyphs[index] = SplineCharCopy(o_sf->glyphs[i],into,mc);
- if ( into->bitmaps!=NULL && other->bitmaps!=NULL )
- BitmapsCopy(bitmap_into,other,index,i);
- } else if ( !doit ) {
- if ( !SCWorthOutputting(o_sf->glyphs[i] ))
- /* Don't bother to copy it */;
- else if ( !SFHasChar(into,o_sf->glyphs[i]->unicodeenc,o_sf->glyphs[i]->name)) {
- /* Possible for a font to contain a glyph not worth outputting */
- if ( (index = _SFFindExistingSlot(into,o_sf->glyphs[i]->unicodeenc,o_sf->glyphs[i]->name))==-1 )
- index = emptypos+cnt++;
- mapping[i] = index;
- }
- }
- }
- if ( !doit ) {
- if ( emptypos+cnt >= into->glyphcnt && emptypos+cnt>0 ) {
- into->glyphs = grealloc(into->glyphs,(emptypos+cnt)*sizeof(SplineChar *));
- memset(into->glyphs+emptypos,0,cnt*sizeof(SplineChar *));
- for ( bdf = bitmap_into->bitmaps; bdf!=NULL; bdf=bdf->next )
- if ( emptypos+cnt > bdf->glyphcnt ) {
- bdf->glyphs = grealloc(bdf->glyphs,(emptypos+cnt)*sizeof(BDFChar *));
- memset(bdf->glyphs+emptypos,0,cnt*sizeof(BDFChar *));
- bdf->glyphmax = bdf->glyphcnt = emptypos+cnt;
- }
- for ( fvs = into->fv; fvs!=NULL; fvs=fvs->nextsame )
- if ( fvs->filled!=NULL ) {
- fvs->filled->glyphs = grealloc(fvs->filled->glyphs,(emptypos+cnt)*sizeof(BDFChar *));
- memset(fvs->filled->glyphs+emptypos,0,cnt*sizeof(BDFChar *));
- fvs->filled->glyphmax = fvs->filled->glyphcnt = emptypos+cnt;
- }
- for ( fvs = into->fv; fvs!=NULL; fvs=fvs->nextsame )
- if ( fvs->sf == into )
- FVMergeRefigureMapSel(fvs,into,o_sf,mapping,emptypos,cnt);
- into->glyphcnt = into->glyphmax = emptypos+cnt;
- }
- }
- ++k;
- } while ( k<other->subfontcnt );
- }
- for ( i=0; i<other->glyphcnt; ++i ) if ( (index=mapping[i])!=-1 )
- into->glyphs[index]->kerns = KernsCopy(other->glyphs[i]->kerns,mapping,into,mc);
- free(mapping);
- GlyphHashFree(into);
- MergeFixupRefChars(into);
- if ( other->fv==NULL )
- SplineFontFree(other);
- into->changed = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontViewReformatAll(into);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- GlyphHashFree(into);
-}
-
-static void __MergeFont(SplineFont *into,SplineFont *other) {
- struct sfmergecontext mc;
-
- memset(&mc,0,sizeof(mc));
- mc.sf_from = other; mc.sf_to = into;
-
- AnchorClassesAdd(into,other,&mc);
- FPSTsAdd(into,other,&mc);
- ASMsAdd(into,other,&mc);
- KernClassesAdd(into,other,&mc);
-
- _MergeFont(into,other,&mc);
-}
-
-static void CIDMergeFont(SplineFont *into,SplineFont *other) {
- int i,j,k;
- SplineFont *i_sf, *o_sf;
- FontView *fvs;
- struct sfmergecontext mc;
-
- memset(&mc,0,sizeof(mc));
- mc.sf_from = other; mc.sf_to = into;
-
- AnchorClassesAdd(into,other,&mc);
- FPSTsAdd(into,other,&mc);
- ASMsAdd(into,other,&mc);
- KernClassesAdd(into,other,&mc);
-
- k = 0;
- do {
- o_sf = other->subfonts[k];
- i_sf = into->subfonts[k];
- for ( i=o_sf->glyphcnt-1; i>=0 && o_sf->glyphs[i]==NULL; --i );
- if ( i>=i_sf->glyphcnt ) {
- i_sf->glyphs = grealloc(i_sf->glyphs,(i+1)*sizeof(SplineChar *));
- for ( j=i_sf->glyphcnt; j<=i; ++j )
- i_sf->glyphs[j] = NULL;
- for ( fvs = i_sf->fv; fvs!=NULL; fvs=fvs->nextsame )
- if ( fvs->sf==i_sf ) {
- fvs->selected = grealloc(fvs->selected,i+1);
- for ( j=i_sf->glyphcnt; j<=i; ++j )
- fvs->selected[j] = false;
- }
- i_sf->glyphcnt = i_sf->glyphmax = i+1;
- }
- for ( i=0; i<o_sf->glyphcnt; ++i ) if ( o_sf->glyphs[i]!=NULL ) {
- if ( o_sf->glyphs[i]->layers[ly_fore].splines==NULL && o_sf->glyphs[i]->layers[ly_fore].refs==NULL &&
- !o_sf->glyphs[i]->widthset )
- /* Don't bother to copy it */;
- else if ( SFHasCID(into,i)==-1 ) {
- SplineCharFree(i_sf->glyphs[i]);
- i_sf->glyphs[i] = SplineCharCopy(o_sf->glyphs[i],i_sf,&mc);
- if ( into->bitmaps!=NULL && other->bitmaps!=NULL )
- BitmapsCopy(into,other,i,i);
- }
- }
- MergeFixupRefChars(i_sf);
- ++k;
- } while ( k<other->subfontcnt );
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FontViewReformatAll(into);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- into->changed = true;
- GlyphHashFree(into);
-}
-
-void MergeFont(FontView *fv,SplineFont *other) {
-
- if ( fv->sf==other ) {
- gwwv_post_error(_("Merging Problem"),_("Merging a font with itself achieves nothing"));
-return;
- }
- if ( fv->sf->cidmaster!=NULL && other->subfonts!=NULL &&
- (strcmp(fv->sf->cidmaster->cidregistry,other->cidregistry)!=0 ||
- strcmp(fv->sf->cidmaster->ordering,other->ordering)!=0 ||
- fv->sf->cidmaster->supplement<other->supplement ||
- fv->sf->cidmaster->subfontcnt<other->subfontcnt )) {
- gwwv_post_error(_("Merging Problem"),_("When merging two CID keyed fonts, they must have the same Registry and Ordering, and the font being merged into (the mergee) must have a supplement which is at least as recent as the other's. Furthermore the mergee must have at least as many subfonts as the merger."));
-return;
- }
- /* Ok. when merging CID fonts... */
- /* If fv is normal and other is CID then just flatten other and merge everything into fv */
- /* If fv is CID and other is normal then merge other into the currently active font */
- /* If both are CID then merge each subfont seperately */
- if ( fv->sf->cidmaster!=NULL && other->subfonts!=NULL )
- CIDMergeFont(fv->sf->cidmaster,other);
- else
- __MergeFont(fv->sf,other);
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void MergeAskFilename(FontView *fv) {
- char *filename = GetPostscriptFontName(NULL,true);
- SplineFont *sf;
- char *eod, *fpt, *file, *full;
-
- if ( filename==NULL )
-return;
- eod = strrchr(filename,'/');
- *eod = '\0';
- file = eod+1;
- do {
- fpt = strstr(file,"; ");
- if ( fpt!=NULL ) *fpt = '\0';
- full = galloc(strlen(filename)+1+strlen(file)+1);
- strcpy(full,filename); strcat(full,"/"); strcat(full,file);
- sf = LoadSplineFont(full,0);
- if ( sf!=NULL && sf->fv==NULL )
- EncMapFree(sf->map);
- free(full);
- if ( sf==NULL )
- /* Do Nothing */;
- else if ( sf->fv==fv )
- gwwv_post_error(_("Merging Problem"),_("Merging a font with itself achieves nothing"));
- else
- MergeFont(fv,sf);
- file = fpt+2;
- } while ( fpt!=NULL );
- free(filename);
-}
-
-GTextInfo *BuildFontList(FontView *except) {
- FontView *fv;
- int cnt=0;
- GTextInfo *tf;
-
- for ( fv=fv_list; fv!=NULL; fv = fv->next )
- ++cnt;
- tf = gcalloc(cnt+3,sizeof(GTextInfo));
- for ( fv=fv_list, cnt=0; fv!=NULL; fv = fv->next ) if ( fv!=except ) {
- tf[cnt].fg = tf[cnt].bg = COLOR_DEFAULT;
- tf[cnt].text = (unichar_t *) fv->sf->fontname;
- tf[cnt].text_is_1byte = true;
- ++cnt;
- }
- tf[cnt++].line = true;
- tf[cnt].fg = tf[cnt].bg = COLOR_DEFAULT;
- tf[cnt].text_is_1byte = true;
- tf[cnt++].text = (unichar_t *) _("Other ...");
-return( tf );
-}
-
-void TFFree(GTextInfo *tf) {
-/*
- int i;
-
- for ( i=0; tf[i].text!=NULL || tf[i].line ; ++i )
- if ( !tf[i].text_in_resource )
- free( tf[i].text );
-*/
- free(tf);
-}
-
-struct mf_data {
- int done;
- FontView *fv;
- GGadget *other;
- GGadget *amount;
-};
-
-static int MF_OK(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- struct mf_data *d = GDrawGetUserData(gw);
- int i, index = GGadgetGetFirstListSelectedItem(d->other);
- FontView *fv;
- for ( i=0, fv=fv_list; fv!=NULL; fv=fv->next ) {
- if ( fv==d->fv )
- continue;
- if ( i==index )
- break;
- ++i;
- }
- if ( fv==NULL )
- MergeAskFilename(d->fv);
- else
- MergeFont(d->fv,fv->sf);
- d->done = true;
- }
-return( true );
-}
-
-static int MF_Cancel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- struct mf_data *d = GDrawGetUserData(gw);
- d->done = true;
- }
-return( true );
-}
-
-static int mv_e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- struct mf_data *d = GDrawGetUserData(gw);
- d->done = true;
- } else if ( event->type == et_char ) {
-return( false );
- }
-return( true );
-}
-
-void FVMergeFonts(FontView *fv) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[6];
- GTextInfo label[6];
- struct mf_data d;
- char buffer[80];
-
- /* If there's only one font loaded, then it's the current one, and there's*/
- /* no point asking the user if s/he wants to merge any of the loaded */
- /* fonts, go directly to searching the disk */
- if ( fv_list==fv && fv_list->next==NULL )
- MergeAskFilename(fv);
- else {
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Merge Fonts...");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,150));
- pos.height = GDrawPointsToPixels(NULL,88);
- gw = GDrawCreateTopWindow(NULL,&pos,mv_e_h,&d,&wattrs);
-
- memset(&label,0,sizeof(label));
- memset(&gcd,0,sizeof(gcd));
-
- sprintf( buffer, _("Font to merge into %.20s"), fv->sf->fontname );
- label[0].text = (unichar_t *) buffer;
- label[0].text_is_1byte = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 12; gcd[0].gd.pos.y = 6;
- gcd[0].gd.flags = gg_visible | gg_enabled;
- gcd[0].creator = GLabelCreate;
-
- gcd[1].gd.pos.x = 15; gcd[1].gd.pos.y = 21;
- gcd[1].gd.pos.width = 120;
- gcd[1].gd.flags = gg_visible | gg_enabled;
- gcd[1].gd.u.list = BuildFontList(fv);
- gcd[1].gd.label = &gcd[1].gd.u.list[0];
- gcd[1].gd.u.list[0].selected = true;
- gcd[1].creator = GListButtonCreate;
-
- gcd[2].gd.pos.x = 15-3; gcd[2].gd.pos.y = 55-3;
- gcd[2].gd.pos.width = -1; gcd[2].gd.pos.height = 0;
- gcd[2].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[2].text = (unichar_t *) _("_OK");
- label[2].text_is_1byte = true;
- label[2].text_in_resource = true;
- gcd[2].gd.mnemonic = 'O';
- gcd[2].gd.label = &label[2];
- gcd[2].gd.handle_controlevent = MF_OK;
- gcd[2].creator = GButtonCreate;
-
- gcd[3].gd.pos.x = -15; gcd[3].gd.pos.y = 55;
- gcd[3].gd.pos.width = -1; gcd[3].gd.pos.height = 0;
- gcd[3].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[3].text = (unichar_t *) _("_Cancel");
- label[3].text_is_1byte = true;
- label[3].text_in_resource = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.mnemonic = 'C';
- gcd[3].gd.handle_controlevent = MF_Cancel;
- gcd[3].creator = GButtonCreate;
-
- GGadgetsCreate(gw,gcd);
-
- memset(&d,'\0',sizeof(d));
- d.other = gcd[1].ret;
- d.fv = fv;
-
- GWidgetHidePalettes();
- GDrawSetVisible(gw,true);
- while ( !d.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
- TFFree(gcd[1].gd.u.list);
- }
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-#ifndef LUA_FF_LIB
-static RefChar *InterpRefs(RefChar *base, RefChar *other, real amount, SplineChar *sc) {
- RefChar *head=NULL, *last=NULL, *cur;
- RefChar *test;
- int i;
-
- for ( test = other; test!=NULL; test=test->next )
- test->checked = false;
-
- while ( base!=NULL ) {
- for ( test = other; test!=NULL; test=test->next ) {
- if ( test->checked )
- /* Do nothing */;
- else if ( test->unicode_enc==base->unicode_enc &&
- (test->unicode_enc!=-1 || strcmp(test->sc->name,base->sc->name)==0 ) )
- break;
- }
- if ( test!=NULL ) {
- test->checked = true;
- cur = RefCharCreate();
- *cur = *base;
- cur->orig_pos = cur->sc->orig_pos;
- for ( i=0; i<6; ++i )
- cur->transform[i] = base->transform[i] + amount*(other->transform[i]-base->transform[i]);
- cur->layers[0].splines = NULL;
- cur->checked = false;
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- } else
- LogError( _("In character %s, could not find reference to %s\n"),
- sc->name, base->sc->name );
- base = base->next;
- if ( test==other && other!=NULL )
- other = other->next;
- }
-return( head );
-}
-
-static void InterpPoint(SplineSet *cur, SplinePoint *base, SplinePoint *other, real amount ) {
- SplinePoint *p = chunkalloc(sizeof(SplinePoint));
- int order2 = base->prev!=NULL ? base->prev->order2 : base->next!=NULL ? base->next->order2 : false;
-
- p->me.x = base->me.x + amount*(other->me.x-base->me.x);
- p->me.y = base->me.y + amount*(other->me.y-base->me.y);
- if ( order2 && base->prev!=NULL && (base->prev->islinear || other->prev->islinear ))
- p->prevcp = p->me;
- else {
- p->prevcp.x = base->prevcp.x + amount*(other->prevcp.x-base->prevcp.x);
- p->prevcp.y = base->prevcp.y + amount*(other->prevcp.y-base->prevcp.y);
- if ( order2 && cur->first!=NULL ) {
- /* In the normal course of events this isn't needed, but if we have */
- /* a different number of points on one path than on the other then */
- /* all hell breaks lose without this */
- cur->last->nextcp.x = p->prevcp.x = (cur->last->nextcp.x+p->prevcp.x)/2;
- cur->last->nextcp.y = p->prevcp.y = (cur->last->nextcp.y+p->prevcp.y)/2;
- }
- }
- if ( order2 && base->next!=NULL && (base->next->islinear || other->next->islinear ))
- p->nextcp = p->me;
- else {
- p->nextcp.x = base->nextcp.x + amount*(other->nextcp.x-base->nextcp.x);
- p->nextcp.y = base->nextcp.y + amount*(other->nextcp.y-base->nextcp.y);
- }
- p->nonextcp = ( p->nextcp.x==p->me.x && p->nextcp.y==p->me.y );
- p->noprevcp = ( p->prevcp.x==p->me.x && p->prevcp.y==p->me.y );
- p->prevcpdef = base->prevcpdef && other->prevcpdef;
- p->nextcpdef = base->nextcpdef && other->nextcpdef;
- p->selected = false;
- p->pointtype = (base->pointtype==other->pointtype)?base->pointtype:pt_corner;
- /*p->flex = 0;*/
- if ( cur->first==NULL )
- cur->first = p;
- else
- SplineMake(cur->last,p,order2);
- cur->last = p;
-}
-
-static SplineSet *InterpSplineSet(SplineSet *base, SplineSet *other, real amount, SplineChar *sc) {
- SplineSet *cur = chunkalloc(sizeof(SplineSet));
- SplinePoint *bp, *op;
-
- for ( bp=base->first, op = other->first; ; ) {
- InterpPoint(cur,bp,op,amount);
- if ( bp->next == NULL && op->next == NULL )
-return( cur );
- if ( bp->next!=NULL && op->next!=NULL &&
- bp->next->to==base->first && op->next->to==other->first ) {
- SplineMake(cur->last,cur->first,bp->next->order2);
- cur->last = cur->first;
-return( cur );
- }
- if ( bp->next == NULL || bp->next->to==base->first ) {
- LogError( _("In character %s, there are too few points on a path in the base\n"), sc->name);
- if ( bp->next!=NULL ) {
- if ( bp->next->order2 ) {
- cur->last->nextcp.x = cur->first->prevcp.x = (cur->last->nextcp.x+cur->first->prevcp.x)/2;
- cur->last->nextcp.y = cur->first->prevcp.y = (cur->last->nextcp.y+cur->first->prevcp.y)/2;
- }
- SplineMake(cur->last,cur->first,bp->next->order2);
- cur->last = cur->first;
- }
-return( cur );
- } else if ( op->next==NULL || op->next->to==other->first ) {
- LogError( _("In character %s, there are too many points on a path in the base\n"), sc->name);
- while ( bp->next!=NULL && bp->next->to!=base->first ) {
- bp = bp->next->to;
- InterpPoint(cur,bp,op,amount);
- }
- if ( bp->next!=NULL ) {
- if ( bp->next->order2 ) {
- cur->last->nextcp.x = cur->first->prevcp.x = (cur->last->nextcp.x+cur->first->prevcp.x)/2;
- cur->last->nextcp.y = cur->first->prevcp.y = (cur->last->nextcp.y+cur->first->prevcp.y)/2;
- }
- SplineMake(cur->last,cur->first,bp->next->order2);
- cur->last = cur->first;
- }
-return( cur );
- }
- bp = bp->next->to;
- op = op->next->to;
- }
-}
-
-static SplineSet *InterpSplineSets(SplineSet *base, SplineSet *other, real amount, SplineChar *sc) {
- SplineSet *head=NULL, *last=NULL, *cur;
-
- /* we could do something really complex to try and figure out which spline*/
- /* set goes with which, but I'm not sure that it would really accomplish */
- /* much, if things are off the computer probably won't figure it out */
- /* Could use path open/closed, direction, point count */
- while ( base!=NULL && other!=NULL ) {
- cur = InterpSplineSet(base,other,amount,sc);
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- base = base->next;
- other = other->next;
- }
-return( head );
-}
-
-static int SCSameChar(SplineChar *sc1,SplineChar *sc2) {
- if ( sc1->unicodeenc!=-1 )
-return( sc1->unicodeenc==sc2->unicodeenc );
-
-return( strcmp(sc1->name,sc2->name)==0 );
-}
-
-static KernPair *InterpKerns(KernPair *kp1, KernPair *kp2, real amount,
- SplineFont *new, SplineChar *scnew) {
- KernPair *head=NULL, *last, *nkp, *k;
-
- last = NULL;
- if ( kp1==NULL || kp2==NULL )
-return( NULL );
- while ( kp1!=NULL ) {
- for ( k=kp2; k!=NULL && !SCSameChar(k->sc,kp1->sc); k=k->next );
- if ( k!=NULL ) {
- if ( k==kp2 ) kp2 = kp2->next;
- nkp = chunkalloc(sizeof(KernPair));
- nkp->sc = new->glyphs[kp1->sc->orig_pos];
- nkp->off = kp1->off + amount*(k->off-kp1->off);
- nkp->subtable = SFSubTableFindOrMake(new,CHR('k','e','r','n'),
- SCScriptFromUnicode(scnew),gpos_pair);
- if ( head==NULL )
- head = nkp;
- else
- last->next = nkp;
- last = nkp;
- }
- kp1 = kp1->next;
- }
-return( head );
-}
-#endif
-
-#ifdef FONTFORGE_CONFIG_TYPE3
-static uint32 InterpColor( uint32 col1,uint32 col2, real amount ) {
- int r1, g1, b1, r2, b2, g2;
-
- r1 = (col1>>16)&0xff;
- r2 = (col2>>16)&0xff;
- g1 = (col1>>8 )&0xff;
- g2 = (col2>>8 )&0xff;
- b1 = (col1 )&0xff;
- b2 = (col2 )&0xff;
- r1 += amount * (r2-r1);
- g1 += amount * (g2-g1);
- b1 += amount * (b2-b1);
-return( (r1<<16) | (g1<<8) | b1 );
-}
-
-static void LayerInterpolate(Layer *to,Layer *base,Layer *other,real amount,SplineChar *sc, int lc) {
-
- /* to already has things set to default values, so when an error occurs */
- /* I just leave things as the default (and don't need to set it again) */
- if ( base->dostroke==other->dostroke )
- to->dostroke = base->dostroke;
- else
- LogError( _("Different settings on whether to stroke in layer %d of %s\n"), lc, sc->name );
- if ( base->dofill==other->dofill )
- to->dofill = base->dofill;
- else
- LogError( "Different settings on whether to fill in layer %d of %s\n", lc, sc->name );
- if ( base->fill_brush.col==COLOR_INHERITED && other->fill_brush.col==COLOR_INHERITED )
- to->fill_brush.col = COLOR_INHERITED;
- else if ( base->fill_brush.col!=COLOR_INHERITED && other->fill_brush.col!=COLOR_INHERITED )
- to->fill_brush.col = InterpColor( base->fill_brush.col,other->fill_brush.col, amount );
- else
- LogError( "Different settings on whether to inherit fill color in layer %d of %s\n", lc, sc->name );
- if ( base->fill_brush.opacity<0 && other->fill_brush.opacity<0 )
- to->fill_brush.opacity = WIDTH_INHERITED;
- else if ( base->fill_brush.opacity>=0 && other->fill_brush.opacity>=0 )
- to->fill_brush.opacity = base->fill_brush.opacity + amount*(other->fill_brush.opacity-base->fill_brush.opacity);
- else
- LogError( "Different settings on whether to inherit fill opacity in layer %d of %s\n", lc, sc->name );
- if ( base->stroke_pen.brush.col==COLOR_INHERITED && other->stroke_pen.brush.col==COLOR_INHERITED )
- to->stroke_pen.brush.col = COLOR_INHERITED;
- else if ( base->stroke_pen.brush.col!=COLOR_INHERITED && other->stroke_pen.brush.col!=COLOR_INHERITED )
- to->stroke_pen.brush.col = InterpColor( base->stroke_pen.brush.col,other->stroke_pen.brush.col, amount );
- else
- LogError( "Different settings on whether to inherit fill color in layer %d of %s\n", lc, sc->name );
- if ( base->stroke_pen.brush.opacity<0 && other->stroke_pen.brush.opacity<0 )
- to->stroke_pen.brush.opacity = WIDTH_INHERITED;
- else if ( base->stroke_pen.brush.opacity>=0 && other->stroke_pen.brush.opacity>=0 )
- to->stroke_pen.brush.opacity = base->stroke_pen.brush.opacity + amount*(other->stroke_pen.brush.opacity-base->stroke_pen.brush.opacity);
- else
- LogError( "Different settings on whether to inherit stroke opacity in layer %d of %s\n", lc, sc->name );
- if ( base->stroke_pen.width<0 && other->stroke_pen.width<0 )
- to->stroke_pen.width = WIDTH_INHERITED;
- else if ( base->stroke_pen.width>=0 && other->stroke_pen.width>=0 )
- to->stroke_pen.width = base->stroke_pen.width + amount*(other->stroke_pen.width-base->stroke_pen.width);
- else
- LogError( "Different settings on whether to inherit stroke width in layer %d of %s\n", lc, sc->name );
- if ( base->stroke_pen.linecap==other->stroke_pen.linecap )
- to->stroke_pen.linecap = base->stroke_pen.linecap;
- else
- LogError( "Different settings on stroke linecap in layer %d of %s\n", lc, sc->name );
- if ( base->stroke_pen.linejoin==other->stroke_pen.linejoin )
- to->stroke_pen.linejoin = base->stroke_pen.linejoin;
- else
- LogError( "Different settings on stroke linejoin in layer %d of %s\n", lc, sc->name );
-
- to->splines = InterpSplineSets(base->splines,other->splines,amount,sc);
- to->refs = InterpRefs(base->refs,other->refs,amount,sc);
- if ( base->images!=NULL || other->images!=NULL )
- LogError( "I can't even imagine how to attempt to interpolate images in layer %d of %s\n", lc, sc->name );
-}
-#endif
-
-#ifndef LUA_FF_LIB
-static void InterpolateChar(SplineFont *new, int orig_pos, SplineChar *base, SplineChar *other, real amount) {
- SplineChar *sc;
-
- if ( base==NULL || other==NULL )
-return;
- sc = SplineCharCreate();
- sc->orig_pos = orig_pos;
- sc->unicodeenc = base->unicodeenc;
- new->glyphs[orig_pos] = sc;
- if ( orig_pos+1>new->glyphcnt )
- new->glyphcnt = orig_pos+1;
- sc->parent = new;
- sc->changed = true;
- sc->views = NULL;
- sc->dependents = NULL;
- sc->layers[ly_back].splines = NULL;
- sc->layers[ly_back].images = NULL;
- sc->layers[ly_fore].undoes = sc->layers[ly_back].undoes = NULL;
- sc->layers[ly_fore].redoes = sc->layers[ly_back].redoes = NULL;
- sc->kerns = NULL;
- sc->name = copy(base->name);
- sc->width = base->width + amount*(other->width-base->width);
- sc->vwidth = base->vwidth + amount*(other->vwidth-base->vwidth);
- sc->lsidebearing = base->lsidebearing + amount*(other->lsidebearing-base->lsidebearing);
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( base->parent->multilayer && other->parent->multilayer ) {
- int lc = base->layer_cnt,i;
- if ( lc!=other->layer_cnt ) {
- LogError( "Different numbers of layers in %s\n", base->name );
- if ( other->layer_cnt<lc ) lc = other->layer_cnt;
- }
- if ( lc>2 ) {
- sc->layers = grealloc(sc->layers,lc*sizeof(Layer));
- for ( i=ly_fore+1; i<lc; ++i )
- LayerDefault(&sc->layers[i]);
- }
- for ( i=ly_fore; i<lc; ++i )
- LayerInterpolate(&sc->layers[i],&base->layers[i],&other->layers[i],amount,sc,i);
- } else
-#endif
- {
- sc->layers[ly_fore].splines = InterpSplineSets(base->layers[ly_fore].splines,other->layers[ly_fore].splines,amount,sc);
- sc->layers[ly_fore].refs = InterpRefs(base->layers[ly_fore].refs,other->layers[ly_fore].refs,amount,sc);
- }
- sc->changedsincelasthinted = true;
- sc->widthset = base->widthset;
- sc->glyph_class = base->glyph_class;
-}
-
-static void IFixupSC(SplineFont *sf, SplineChar *sc,int i) {
- RefChar *ref;
-
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) if ( !ref->checked ) {
- /* The sc in the ref is from the base font. It's got to be in the */
- /* new font too (the ref only gets created if it's present in both fonts)*/
- ref->checked = true;
- ref->orig_pos = SFFindExistingSlot(sf,ref->sc->unicodeenc,ref->sc->name);
- ref->sc = sf->glyphs[ref->orig_pos];
- IFixupSC(sf,ref->sc,ref->orig_pos);
- SCReinstanciateRefChar(sc,ref);
- SCMakeDependent(sc,ref->sc);
- }
-}
-
-static void InterpFixupRefChars(SplineFont *sf) {
- int i;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- IFixupSC(sf,sf->glyphs[i], i);
- }
-}
-
-SplineFont *InterpolateFont(SplineFont *base, SplineFont *other, real amount,
- Encoding *enc) {
- SplineFont *new;
- int i, index;
-
- if ( base==other ) {
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Interpolating Problem"),_("Interpolating a font with itself achieves nothing"));
-#else
- gwwv_post_error(_("Interpolating Problem"),_("Interpolating a font with itself achieves nothing"));
-#endif
-return( NULL );
- } else if ( base->order2!=other->order2 ) {
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Interpolating Problem"),_("Interpolating between fonts with different spline orders (i.e. between postscript and truetype)"));
-#else
- gwwv_post_error(_("Interpolating Problem"),_("Interpolating between fonts with different spline orders (i.e. between postscript and truetype)"));
-#endif
-return( NULL );
- }
-#ifdef FONTFORGE_CONFIG_TYPE3
- else if ( base->multilayer && other->multilayer ) {
-# if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Interpolating Problem"),_("Interpolating between fonts with different editing types (ie. between type3 and type1)"));
-# else
- gwwv_post_error(_("Interpolating Problem"),_("Interpolating between fonts with different editing types (ie. between type3 and type1)"));
-# endif
-return( NULL );
- }
-#endif
- new = SplineFontBlank(base->glyphcnt);
- new->ascent = base->ascent + amount*(other->ascent-base->ascent);
- new->descent = base->descent + amount*(other->descent-base->descent);
- for ( i=0; i<base->glyphcnt; ++i ) if ( base->glyphs[i]!=NULL ) {
- index = SFFindExistingSlot(other,base->glyphs[i]->unicodeenc,base->glyphs[i]->name);
- if ( index!=-1 && other->glyphs[index]!=NULL ) {
- InterpolateChar(new,i,base->glyphs[i],other->glyphs[index],amount);
- if ( new->glyphs[i]!=NULL )
- new->glyphs[i]->kerns = InterpKerns(base->glyphs[i]->kerns,
- other->glyphs[index]->kerns,amount,new,new->glyphs[i]);
- }
- }
- InterpFixupRefChars(new);
- new->changed = true;
- new->map = EncMapFromEncoding(new,enc);
-return( new );
-}
-#endif
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void InterAskFilename(FontView *fv, real amount) {
- char *filename = GetPostscriptFontName(NULL,false);
- SplineFont *sf;
-
- if ( filename==NULL )
-return;
- sf = LoadSplineFont(filename,0);
- if ( sf!=NULL && sf->fv==NULL )
- EncMapFree(sf->map);
- free(filename);
- if ( sf==NULL )
-return;
- FontViewCreate(InterpolateFont(fv->sf,sf,amount,fv->map->enc));
-}
-
-#define CID_Amount 1000
-static double last_amount=50;
-
-static int IF_OK(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- struct mf_data *d = GDrawGetUserData(gw);
- int i, index = GGadgetGetFirstListSelectedItem(d->other);
- FontView *fv;
- int err=false;
- real amount;
-
- amount = GetReal8(gw,CID_Amount, _("Amount"),&err);
- if ( err )
-return( true );
- last_amount = amount;
- for ( i=0, fv=fv_list; fv!=NULL; fv=fv->next ) {
- if ( fv==d->fv )
- continue;
- if ( i==index )
- break;
- ++i;
- }
- if ( fv==NULL )
- InterAskFilename(d->fv,last_amount/100.0);
- else
- FontViewCreate(InterpolateFont(d->fv->sf,fv->sf,last_amount/100.0,d->fv->map->enc));
- d->done = true;
- }
-return( true );
-}
-
-void FVInterpolateFonts(FontView *fv) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[8];
- GTextInfo label[8];
- struct mf_data d;
- char buffer[80]; char buf2[30];
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Interpolate Fonts...");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,200));
- pos.height = GDrawPointsToPixels(NULL,118);
- gw = GDrawCreateTopWindow(NULL,&pos,mv_e_h,&d,&wattrs);
-
- memset(&label,0,sizeof(label));
- memset(&gcd,0,sizeof(gcd));
-
- sprintf( buffer, _("Interpolating between %.20s and:"), fv->sf->fontname );
- label[0].text = (unichar_t *) buffer;
- label[0].text_is_1byte = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 12; gcd[0].gd.pos.y = 6;
- gcd[0].gd.flags = gg_visible | gg_enabled;
- gcd[0].creator = GLabelCreate;
-
- gcd[1].gd.pos.x = 20; gcd[1].gd.pos.y = 21;
- gcd[1].gd.pos.width = 110;
- gcd[1].gd.flags = gg_visible | gg_enabled;
- gcd[1].gd.u.list = BuildFontList(fv);
- if ( gcd[1].gd.u.list[0].text!=NULL ) {
- gcd[1].gd.label = &gcd[1].gd.u.list[0];
- gcd[1].gd.u.list[0].selected = true;
- } else {
- gcd[1].gd.label = &gcd[1].gd.u.list[1];
- gcd[1].gd.u.list[1].selected = true;
- gcd[1].gd.flags = gg_visible;
- }
- gcd[1].creator = GListButtonCreate;
-
- sprintf( buf2, "%g", last_amount );
- label[2].text = (unichar_t *) buf2;
- label[2].text_is_1byte = true;
- gcd[2].gd.pos.x = 20; gcd[2].gd.pos.y = 51;
- gcd[2].gd.pos.width = 40;
- gcd[2].gd.flags = gg_visible | gg_enabled;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.cid = CID_Amount;
- gcd[2].creator = GTextFieldCreate;
-
- gcd[3].gd.pos.x = 5; gcd[3].gd.pos.y = 51+6;
- gcd[3].gd.flags = gg_visible | gg_enabled;
-/* GT: The dialog looks like: */
-/* GT: Interpolating between <fontname> and: */
-/* GT: <list of possible fonts> */
-/* GT: by <50>% */
-/* GT: So "by" means how much to interpolate. */
- label[3].text = (unichar_t *) _("by");
- label[3].text_is_1byte = true;
- gcd[3].gd.label = &label[3];
- gcd[3].creator = GLabelCreate;
-
- gcd[4].gd.pos.x = 20+40+3; gcd[4].gd.pos.y = 51+6;
- gcd[4].gd.flags = gg_visible | gg_enabled;
- label[4].text = (unichar_t *) "%";
- label[4].text_is_1byte = true;
- gcd[4].gd.label = &label[4];
- gcd[4].creator = GLabelCreate;
-
- gcd[5].gd.pos.x = 15-3; gcd[5].gd.pos.y = 85-3;
- gcd[5].gd.pos.width = -1; gcd[5].gd.pos.height = 0;
- gcd[5].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[5].text = (unichar_t *) _("_OK");
- label[5].text_is_1byte = true;
- label[5].text_in_resource = true;
- gcd[5].gd.mnemonic = 'O';
- gcd[5].gd.label = &label[5];
- gcd[5].gd.handle_controlevent = IF_OK;
- gcd[5].creator = GButtonCreate;
-
- gcd[6].gd.pos.x = -15; gcd[6].gd.pos.y = 85;
- gcd[6].gd.pos.width = -1; gcd[6].gd.pos.height = 0;
- gcd[6].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[6].text = (unichar_t *) _("_Cancel");
- label[6].text_is_1byte = true;
- label[6].text_in_resource = true;
- gcd[6].gd.label = &label[6];
- gcd[6].gd.mnemonic = 'C';
- gcd[6].gd.handle_controlevent = MF_Cancel;
- gcd[6].creator = GButtonCreate;
-
- GGadgetsCreate(gw,gcd);
-
- memset(&d,'\0',sizeof(d));
- d.other = gcd[1].ret;
- d.fv = fv;
-
- GWidgetHidePalettes();
- GDrawSetVisible(gw,true);
- while ( !d.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
- TFFree(gcd[1].gd.u.list);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/kernclass.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/kernclass.c
deleted file mode 100644
index 0a56a6e1108..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/kernclass.c
+++ /dev/null
@@ -1,3059 +0,0 @@
-/* Copyright (C) 2003-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-#include <gkeysym.h>
-#include <string.h>
-#include <ustring.h>
-#include <utype.h>
-#include <math.h>
-
-typedef struct kernclassdlg {
- struct kernclasslistdlg *kcld;
- KernClass *orig;
- struct lookup_subtable *subtable;
- int first_cnt, second_cnt;
- int16 *offsets;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- DeviceTable *adjusts;
- DeviceTable active_adjust; /* The one that is currently active */
-#endif
- GWindow gw, cw, kw;
- GFont *font;
- int fh, as;
- int kernh, kernw; /* Width of the box containing the kerning val */
- int xstart, ystart; /* This is where the headers start */
- int xstart2, ystart2; /* This is where the data start */
- int width, height, fullwidth;
- int canceldrop, sbdrop;
- int offleft, offtop;
- GGadget *hsb, *vsb;
- int isedit, off;
- int st_pos;
- BDFChar *fsc, *ssc;
- int pixelsize;
- int magfactor;
- int top;
- int downpos, down, within, orig_kern;
-/* For the kern pair dlg */
- int done;
- SplineFont *sf;
- SplineChar *sc1, *sc2;
- int isv, iskernpair;
- SplineChar *scf, *scs;
- struct kernclassdlg *next;
-} KernClassDlg;
-
-typedef struct kernclasslistdlg {
- SplineFont *sf;
- GWindow gw;
- int isv;
-} KernClassListDlg;
-
-#define KCL_Width 200
-#define KCL_Height 173
-#define KC_Width 400
-#define KC_Height 424
-#define KC_CANCELDROP 33
-
-#define CID_Subtable 1001
-
-#define CID_List 1040
-#define CID_New 1041
-#define CID_Delete 1042
-#define CID_Edit 1043
-
-#define CID_ClassList 1007 /* And 1107 for second char */
-#define CID_ClassNew 1008
-#define CID_ClassDel 1009
-#define CID_ClassEdit 1010
-#define CID_ClassLabel 1011
-#define CID_ClassUp 1012
-#define CID_ClassDown 1013
-#define CID_ClassSelect 1014
-
-#define CID_OK 1015
-#define CID_Cancel 1016
-
-#define CID_Set 1020
-#define CID_Select 1021
-#define CID_GlyphList 1022
-#define CID_Prev 1023
-#define CID_Next 1024
-
-#define CID_First 1030
-#define CID_Second 1031
-#define CID_KernOffset 1032
-#define CID_Prev2 1033
-#define CID_Next2 1034
-#define CID_Group3 1035
-#define CID_DisplaySize 1036
-#define CID_Correction 1037
-#define CID_FreeType 1038
-#define CID_Magnifications 1039
-
-extern int _GScrollBar_Width;
-
-static GTextInfo magnifications[] = {
- { (unichar_t *) "100%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 1, 0, 1},
- { (unichar_t *) "200%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "300%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "400%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }
-};
-
-static int KCD_SBReset(KernClassDlg *);
-static void KCD_HShow(KernClassDlg *, int pos);
-static void KCD_VShow(KernClassDlg *, int pos);
-
-static GTextInfo **KCLookupSubtableArray(SplineFont *sf,int isv) {
- int cnt;
- KernClass *kc, *head = isv ? sf->vkerns : sf->kerns;
- GTextInfo **ti;
-
- if ( sf->cidmaster!=NULL ) sf=sf->cidmaster;
- else if ( sf->mm!=NULL ) sf = sf->mm->normal;
-
- for ( kc=head, cnt=0; kc!=NULL; kc=kc->next, ++cnt );
- ti = gcalloc(cnt+1,sizeof(GTextInfo*));
- for ( kc=head, cnt=0; kc!=NULL; kc=kc->next, ++cnt ) {
- ti[cnt] = gcalloc(1,sizeof(GTextInfo));
- ti[cnt]->fg = ti[cnt]->bg = COLOR_DEFAULT;
- ti[cnt]->text = utf82u_copy(kc->subtable->subtable_name);
- }
- ti[cnt] = gcalloc(1,sizeof(GTextInfo));
-return( ti );
-}
-
-static GTextInfo *KCLookupSubtableList(SplineFont *sf,int isv) {
- int cnt;
- KernClass *kc, *head = isv ? sf->vkerns : sf->kerns;
- GTextInfo *ti;
-
- if ( sf->cidmaster!=NULL ) sf=sf->cidmaster;
- else if ( sf->mm!=NULL ) sf = sf->mm->normal;
-
- for ( kc=head, cnt=0; kc!=NULL; kc=kc->next, ++cnt );
- ti = gcalloc(cnt+1,sizeof(GTextInfo));
- for ( kc=head, cnt=0; kc!=NULL; kc=kc->next, ++cnt )
- ti[cnt].text = utf82u_copy(kc->subtable->subtable_name);
-return( ti );
-}
-
-/* ************************************************************************** */
-/* **************************** Edit/Add a Class **************************** */
-/* ************************************************************************** */
-
-static int KCD_ToSelection(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(kcd->gw,CID_GlyphList));
- SplineFont *sf = kcd->sf;
- FontView *fv = sf->fv;
- const unichar_t *end;
- int pos, found=-1;
- char *nm;
-
- GDrawSetVisible(fv->gw,true);
- GDrawRaise(fv->gw);
- memset(fv->selected,0,fv->map->enccount);
- while ( *ret ) {
- end = u_strchr(ret,' ');
- if ( end==NULL ) end = ret+u_strlen(ret);
- nm = cu_copybetween(ret,end);
- for ( ret = end; isspace(*ret); ++ret);
- if (( pos = SFFindSlot(sf,fv->map,-1,nm))!=-1 ) {
- if ( found==-1 ) found = pos;
- fv->selected[pos] = true;
- }
- free(nm);
- }
-
- if ( found!=-1 )
- FVScrollToChar(fv,found);
- GDrawRequestExpose(fv->v,NULL,false);
- }
-return( true );
-}
-
-static int KCD_FromSelection(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- SplineFont *sf = kcd->sf;
- FontView *fv = sf->fv;
- unichar_t *vals, *pt;
- int i, len, max, gid;
- SplineChar *sc;
-
- for ( i=len=max=0; i<fv->map->enccount; ++i ) if ( fv->selected[i]) {
- sc = SFMakeChar(sf,fv->map,i);
- len += strlen(sc->name)+1;
- if ( fv->selected[i]>max ) max = fv->selected[i];
- }
- pt = vals = galloc((len+1)*sizeof(unichar_t));
- *pt = '\0';
- /* in a class the order of selection is irrelevant */
- for ( i=0; i<fv->map->enccount; ++i ) if ( fv->selected[i] && (gid=fv->map->map[i])!=-1) {
- uc_strcpy(pt,sf->glyphs[gid]->name);
- pt += u_strlen(pt);
- *pt++ = ' ';
- }
- if ( pt>vals ) pt[-1]='\0';
-
- GGadgetSetTitle(GWidgetGetControl(kcd->gw,CID_GlyphList),vals);
- }
-return( true );
-}
-
-static int KCD_Prev(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- GDrawSetVisible(kcd->cw,false);
- }
-return( true );
-}
-
-static int isEverythingElse(unichar_t *text) {
- /* GT: The string "{Everything Else}" is used in the context of a list */
- /* GT: of classes (a set of kerning classes) where class 0 designates the */
- /* GT: default class containing all glyphs not specified in the other classes */
- unichar_t *everything_else = utf82u_copy( _("{Everything Else}") );
- int ret = u_strcmp(text,everything_else);
- free(everything_else);
-return( ret==0 );
-}
-
-static int KCD_Next(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- char *ret = GGadgetGetTitle8(GWidgetGetControl(kcd->gw,CID_GlyphList));
- GGadget *list = GWidgetGetControl( kcd->gw, CID_ClassList+kcd->off );
- int i;
- char *pt;
- int which = GGadgetGetFirstListSelectedItem(list);
-
- for ( pt=ret; *pt==' '; ++pt );
-
- if ( which==0 && *pt=='\0' )
- /* Class 0 may contain no glyphs */;
- else if ( !CCD_NameListCheck(kcd->sf,ret,true,_("Bad Class")) ||
- CCD_InvalidClassList(ret,list,kcd->isedit)) {
- free(ret);
-return( true );
- }
-
- if ( kcd->isedit ) {
- if ( which==0 && *pt=='\0' )
- GListChangeLine8(list,0,_("{Everything Else}"));
- else
- GListChangeLine8(list,GGadgetGetFirstListSelectedItem(list),ret);
- } else {
- GListAppendLine8(list,ret,false);
- if ( kcd->off==0 ) {
- kcd->offsets = grealloc(kcd->offsets,(kcd->first_cnt+1)*kcd->second_cnt*sizeof(int16));
- memset(kcd->offsets+kcd->first_cnt*kcd->second_cnt,
- 0, kcd->second_cnt*sizeof(int16));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- kcd->adjusts = grealloc(kcd->adjusts,(kcd->first_cnt+1)*kcd->second_cnt*sizeof(DeviceTable));
- memset(kcd->adjusts+kcd->first_cnt*kcd->second_cnt,
- 0, kcd->second_cnt*sizeof(DeviceTable));
-#endif
- ++kcd->first_cnt;
- } else {
- int16 *new = galloc(kcd->first_cnt*(kcd->second_cnt+1)*sizeof(int16));
- for ( i=0; i<kcd->first_cnt; ++i ) {
- memcpy(new+i*(kcd->second_cnt+1),kcd->offsets+i*kcd->second_cnt,
- kcd->second_cnt*sizeof(int16));
- new[i*(kcd->second_cnt+1)+kcd->second_cnt] = 0;
- }
- free( kcd->offsets );
- kcd->offsets = new;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- {
- DeviceTable *new = galloc(kcd->first_cnt*(kcd->second_cnt+1)*sizeof(DeviceTable));
- for ( i=0; i<kcd->first_cnt; ++i ) {
- memcpy(new+i*(kcd->second_cnt+1),kcd->adjusts+i*kcd->second_cnt,
- kcd->second_cnt*sizeof(DeviceTable));
- memset(&new[i*(kcd->second_cnt+1)+kcd->second_cnt],0,sizeof(DeviceTable));
- }
- free( kcd->adjusts );
- kcd->adjusts = new;
- }
-#endif
- ++kcd->second_cnt;
- }
- KCD_SBReset(kcd);
- }
- GDrawSetVisible(kcd->cw,false); /* This will give us an expose so we needed ask for one */
- free(ret);
- }
-return( true );
-}
-
-static void _KCD_DoEditNew(KernClassDlg *kcd,int isedit,int off) {
- static unichar_t nullstr[] = { 0 };
-
- kcd->isedit = isedit;
- kcd->off = off;
- if ( isedit ) {
- GGadget *list = GWidgetGetControl( kcd->gw, CID_ClassList+off);
- GTextInfo *selected = GGadgetGetListItemSelected(list);
- int which = GGadgetGetFirstListSelectedItem(list);
- if ( selected==NULL )
-return;
- if ( off==0 && which==0 && isEverythingElse(selected->text))
- GGadgetSetTitle(GWidgetGetControl(kcd->cw,CID_GlyphList),nullstr);
- else
- GGadgetSetTitle(GWidgetGetControl(kcd->cw,CID_GlyphList),selected->text);
- } else {
- GGadgetSetTitle(GWidgetGetControl(kcd->cw,CID_GlyphList),nullstr);
- }
- GWidgetIndicateFocusGadget(GWidgetGetControl(kcd->cw,CID_GlyphList));
- GDrawSetVisible(kcd->cw,true);
-}
-
-/* ************************************************************************** */
-/* ************************** Kern Class Display **************************** */
-/* ************************************************************************** */
-
-static void KPD_DoCancel(KernClassDlg *kcd) {
- BDFCharFree(kcd->fsc); BDFCharFree(kcd->ssc);
- kcd->fsc = kcd->ssc = NULL;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kcd->active_adjust.corrections); kcd->active_adjust.corrections = NULL;
-#endif
- kcd->done = true;
-}
-
-static int KPD_Cancel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- KPD_DoCancel(kcd);
- }
-return( true );
-}
-
-static int KPD_FinishKP(KernClassDlg *);
-
-static int KPD_OK(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- if ( !KPD_FinishKP(kcd))
-return( true );
- BDFCharFree(kcd->fsc); BDFCharFree(kcd->ssc);
- kcd->fsc = kcd->ssc = NULL;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kcd->active_adjust.corrections); kcd->active_adjust.corrections = NULL;
-#endif
- kcd->done = true;
- }
-return( true );
-}
-
-static int KCD_Prev2(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- BDFCharFree(kcd->fsc); BDFCharFree(kcd->ssc);
- kcd->fsc = kcd->ssc = NULL;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kcd->active_adjust.corrections); kcd->active_adjust.corrections = NULL;
-#endif
- GDrawSetVisible(kcd->kw,false);
- }
-return( true );
-}
-
-static int KCD_Next2(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(kcd->gw,CID_KernOffset));
- unichar_t *end;
- int val = u_strtol(ret,&end,10);
-
- if ( val<-32768 || val>32767 || *end!='\0' ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error( _("Bad Number"), _("Bad Number") );
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error( _("Bad Number"), _("Bad Number") );
-#endif
-return( true );
- }
- kcd->offsets[kcd->st_pos] = val;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kcd->adjusts[kcd->st_pos].corrections);
- kcd->adjusts[kcd->st_pos] = kcd->active_adjust;
- kcd->active_adjust.corrections = NULL;
-#endif
-
- BDFCharFree(kcd->fsc); BDFCharFree(kcd->ssc);
- kcd->fsc = kcd->ssc = NULL;
- GDrawSetVisible(kcd->kw,false); /* This will give us an expose so we needed ask for one */
- }
-return( true );
-}
-
-void KCD_DrawGlyph(GWindow pixmap,int x,int baseline,BDFChar *bdfc,int mag) {
- struct _GImage base;
- GImage gi;
- GClut clut;
-
- memset(&gi,'\0',sizeof(gi));
- memset(&base,'\0',sizeof(base));
- memset(&clut,'\0',sizeof(clut));
- gi.u.image = &base;
- base.clut = &clut;
- if ( !bdfc->byte_data ) {
- base.image_type = it_mono;
- clut.clut_len = 2;
- clut.clut[0] = GDrawGetDefaultBackground(NULL);
- clut.clut[1] = 0x000000;
- } else {
- int scale, l;
- Color fg, bg;
- scale = bdfc->depth == 8 ? 8 : 4;
- base.image_type = it_index;
- clut.clut_len = 1<<scale;
- bg = GDrawGetDefaultBackground(NULL);
- fg = GDrawGetDefaultForeground(NULL);
- for ( l=0; l<(1<<scale); ++l )
- clut.clut[l] =
- COLOR_CREATE(
- COLOR_RED(bg) + (l*(COLOR_RED(fg)-COLOR_RED(bg)))/((1<<scale)-1),
- COLOR_GREEN(bg) + (l*(COLOR_GREEN(fg)-COLOR_GREEN(bg)))/((1<<scale)-1),
- COLOR_BLUE(bg) + (l*(COLOR_BLUE(fg)-COLOR_BLUE(bg)))/((1<<scale)-1) );
- }
- base.data = bdfc->bitmap;
- base.bytes_per_line = bdfc->bytes_per_line;
- base.width = bdfc->xmax-bdfc->xmin+1;
- base.height = bdfc->ymax-bdfc->ymin+1;
- x += mag*bdfc->xmin;
- if ( mag==1 )
- GDrawDrawImage(pixmap,&gi,NULL,x,baseline-bdfc->ymax);
- else
- GDrawDrawImageMagnified(pixmap, &gi, NULL,
- x,baseline-mag*bdfc->ymax,
- base.width*mag,base.height*mag);
-}
-
-static int KCD_RightToLeft(KernClassDlg *kcd) {
- if ( kcd->subtable!=NULL )
-return( kcd->subtable->lookup->lookup_flags&pst_r2l );
-
- if ( kcd->scf!=NULL ) {
- uint32 script = SCScriptFromUnicode(kcd->scf);
- if ( script!=DEFAULT_SCRIPT )
-return( ScriptIsRightToLeft( script ));
- }
- if ( kcd->scs!=NULL ) {
- uint32 script = SCScriptFromUnicode(kcd->scs);
- if ( script!=DEFAULT_SCRIPT )
-return( ScriptIsRightToLeft( script ));
- }
-return( false );
-}
-
-static void KCD_KernMouse(KernClassDlg *kcd,GEvent *event) {
- int x, y, width;
- char buf[20];
- unichar_t ubuf[20];
- int kern, pkern;
- double scale;
-
- scale = kcd->pixelsize/(double) (kcd->sf->ascent+kcd->sf->descent);
- kern = u_strtol(_GGadgetGetTitle(GWidgetGetControl(kcd->kw,CID_KernOffset)),NULL,10);
- pkern = kcd->magfactor*rint( kern*scale ); /* rounding can't include magnification */
-
- if ( !kcd->isv ) {
- /* Horizontal */
- width = kcd->magfactor*((kcd->fsc!=NULL?kcd->fsc->width:0)+(kcd->ssc!=NULL?kcd->ssc->width:0))+pkern;
- x = (kcd->fullwidth - width)/2;
-
- if ( KCD_RightToLeft(kcd) ) {
- if ( kcd->ssc!=NULL )
- width -= kcd->magfactor*kcd->ssc->width;
- } else {
- if ( kcd->fsc!=NULL ) {
- x += kcd->magfactor*kcd->fsc->width + pkern;
- width -= kcd->magfactor*kcd->fsc->width + pkern;
- }
- }
-
- if ( event->u.mouse.y<kcd->top || event->u.mouse.y>kcd->top+2*kcd->pixelsize*kcd->magfactor ||
- event->u.mouse.x<x || event->u.mouse.x>x+width ) {
- if ( event->type == et_mousedown )
-return;
- if ( kcd->within ) {
- GDrawSetCursor(kcd->kw,ct_pointer);
- if ( kcd->down && kcd->orig_kern!=kern ) {
- sprintf(buf, "%d", kcd->orig_kern);
- uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_KernOffset),ubuf);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
- kcd->within = false;
- }
- if ( event->type==et_mouseup )
- kcd->down = false;
-return;
- }
-
- if ( !kcd->within ) {
- GDrawSetCursor(kcd->kw,ct_leftright);
- kcd->within = true;
- }
- if ( event->type == et_mousedown ) {
- kcd->orig_kern = kern;
- kcd->down = true;
- kcd->downpos = event->u.mouse.x;
- } else if ( kcd->down ) {
- /* I multiply by 2 here because I center the glyphs, so the kerning */
- /* changes in both directions */
- int nkern = kcd->orig_kern + rint(2*(event->u.mouse.x-kcd->downpos)/scale/kcd->magfactor);
- if ( kern!=nkern ) {
- sprintf(buf, "%d", nkern);
- uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_KernOffset),ubuf);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
- if ( event->type==et_mouseup ) {
- kcd->down = false;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( nkern!=kcd->orig_kern && kcd->active_adjust.corrections!=NULL ) {
- free(kcd->active_adjust.corrections);
- kcd->active_adjust.corrections = NULL;
- ubuf[0] = '0'; ubuf[1] = '\0';
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_Correction),ubuf);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
-#endif
- }
- }
- } else {
- /* Vertical */
- y = kcd->top + kcd->pixelsize/3;
- width = (kcd->ssc!=NULL ? kcd->magfactor*rint(kcd->ssc->sc->vwidth * scale) : 0);
- if ( kcd->fsc!=NULL )
- y += kcd->magfactor*rint(kcd->fsc->sc->vwidth * scale) + pkern;
- x = (kcd->fullwidth/2 - kcd->pixelsize/2)*kcd->magfactor;
-
- if ( event->u.mouse.y<y || event->u.mouse.y>y+width ||
- event->u.mouse.x<x || event->u.mouse.x>x+kcd->pixelsize ) {
- if ( event->type == et_mousedown )
-return;
- if ( kcd->within ) {
- GDrawSetCursor(kcd->kw,ct_pointer);
- if ( kcd->down && kcd->orig_kern!=kern ) {
- sprintf(buf, "%d", kcd->orig_kern);
- uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_KernOffset),ubuf);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
- kcd->within = false;
- }
- if ( event->type==et_mouseup )
- kcd->down = false;
-return;
- }
-
- if ( !kcd->within ) {
- GDrawSetCursor(kcd->kw,ct_updown);
- kcd->within = true;
- }
- if ( event->type == et_mousedown ) {
- kcd->orig_kern = kern;
- kcd->down = true;
- kcd->downpos = event->u.mouse.y;
- } else if ( kcd->down ) {
- int nkern = kcd->orig_kern + rint((event->u.mouse.y-kcd->downpos)/scale)/kcd->magfactor;
- if ( kern!=nkern ) {
- sprintf(buf, "%d", nkern);
- uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_KernOffset),ubuf);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
- if ( event->type==et_mouseup ) {
- kcd->down = false;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( nkern!=kcd->orig_kern && kcd->active_adjust.corrections!=NULL ) {
- free(kcd->active_adjust.corrections);
- kcd->active_adjust.corrections = NULL;
- ubuf[0] = '0'; ubuf[1] = '\0';
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_Correction),ubuf);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
-#endif
- }
- }
- }
-}
-
-static void KCD_KernExpose(KernClassDlg *kcd,GWindow pixmap,GEvent *event) {
- GRect *area = &event->u.expose.rect;
- GRect rect;
- GRect old1;
- int x, y;
- SplineFont *sf = kcd->sf;
- int em = sf->ascent+sf->descent;
- int as = kcd->magfactor*rint(sf->ascent*kcd->pixelsize/(double) em);
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(kcd->gw,CID_KernOffset));
- int kern = u_strtol(ret,NULL,10);
- int baseline, xbaseline;
-
- if ( area->y+area->height<kcd->top )
-return;
- if ( area->y>kcd->top+3*kcd->pixelsize ||
- (!kcd->isv && area->y>kcd->top+2*kcd->pixelsize ))
-return;
-
- rect.x = 0; rect.y = kcd->top;
- rect.width = kcd->fullwidth;
- rect.height = kcd->isv ? 3*kcd->pixelsize*kcd->magfactor : 2*kcd->pixelsize*kcd->magfactor;
- GDrawPushClip(pixmap,&rect,&old1);
-
- kern = kcd->magfactor*rint(kern*kcd->pixelsize/(double) em);
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- { int correction;
- unichar_t *end;
-
- ret = _GGadgetGetTitle(GWidgetGetControl(kcd->gw,CID_Correction));
- correction = u_strtol(ret,&end,10);
- while ( *end==' ' ) ++end;
- if ( *end=='\0' && correction>=-128 && correction<=127 )
- kern += correction*kcd->magfactor;
- }
-#endif
-
- if ( !kcd->isv ) {
- x = (kcd->fullwidth-( kcd->magfactor*(kcd->fsc!=NULL?kcd->fsc->width:0)+
- kcd->magfactor*(kcd->ssc!=NULL?kcd->ssc->width:0)+
- kern))/2;
- baseline = kcd->top + as + kcd->magfactor*kcd->pixelsize/2;
- if ( KCD_RightToLeft(kcd) ) {
- if ( kcd->ssc!=NULL ) {
- KCD_DrawGlyph(pixmap,x,baseline,kcd->ssc,kcd->magfactor);
- x += kcd->magfactor*kcd->ssc->width + kern;
- }
- if ( kcd->fsc!=NULL )
- KCD_DrawGlyph(pixmap,x,baseline,kcd->fsc,kcd->magfactor);
- } else {
- if ( kcd->fsc!=NULL ) {
- KCD_DrawGlyph(pixmap,x,baseline,kcd->fsc,kcd->magfactor);
- x += kcd->fsc->width*kcd->magfactor + kern;
- }
- if ( kcd->ssc!=NULL )
- KCD_DrawGlyph(pixmap,x,baseline,kcd->ssc,kcd->magfactor);
- }
- } else {
- /* I don't support top to bottom vertical */
- y = kcd->top + kcd->magfactor*kcd->pixelsize/3 + as;
- xbaseline = kcd->fullwidth/2;
- if ( kcd->fsc!=NULL ) {
- KCD_DrawGlyph(pixmap,xbaseline-kcd->magfactor*kcd->pixelsize/2,y,kcd->fsc,kcd->magfactor);
- y += kcd->magfactor*rint(kcd->fsc->sc->vwidth * kcd->pixelsize/(double) em) + kern;
- }
- if ( kcd->ssc!=NULL )
- KCD_DrawGlyph(pixmap,xbaseline-kcd->magfactor*kcd->pixelsize/2,y,kcd->ssc,kcd->magfactor);
- }
- GDrawPopClip(pixmap,&old1);
-}
-
-static int KCD_KernOffChanged(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged )
- GDrawRequestExpose(kcd->kw,NULL,false);
-return( true );
-}
-
-static void KCD_UpdateGlyph(KernClassDlg *kcd,int which) {
- BDFChar **scpos = which==0 ? &kcd->fsc : &kcd->ssc;
- SplineChar **possc = which==0 ? &kcd->scf : &kcd->scs;
- SplineChar *sc;
- char *temp;
- void *freetypecontext=NULL;
-
- BDFCharFree(*scpos);
- *scpos = NULL;
- if ( kcd->iskernpair ) {
- temp = cu_copy(_GGadgetGetTitle(GWidgetGetControl(kcd->kw,
- which==0 ? CID_First : CID_Second )));
- } else {
- GTextInfo *sel = GGadgetGetListItemSelected(GWidgetGetControl(kcd->kw,
- which==0 ? CID_First : CID_Second ));
- if ( sel==NULL )
-return;
- temp = cu_copy(sel->text);
- }
-
- *possc = sc = SFGetChar(kcd->sf,-1,temp);
- free(temp);
- if ( sc==NULL )
-return;
- if ( GGadgetIsChecked(GWidgetGetControl(kcd->gw,CID_FreeType)) )
- freetypecontext = FreeTypeFontContext(sc->parent,sc,sc->parent->fv);
- if ( freetypecontext ) {
- *scpos = SplineCharFreeTypeRasterize(freetypecontext,sc->orig_pos,kcd->pixelsize,8);
- FreeTypeFreeContext(freetypecontext);
- } else
- *scpos = SplineCharAntiAlias(sc,kcd->pixelsize,4);
-}
-
-static int KCD_DisplaySizeChanged(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(kcd->gw,CID_DisplaySize));
- unichar_t *end;
- int pixelsize = u_strtol(ret,&end,10);
-
- while ( *end==' ' ) ++end;
- if ( pixelsize>4 && pixelsize<400 && *end=='\0' ) {
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- unichar_t ubuf[20]; char buffer[20];
- ubuf[0] = '0'; ubuf[1] = '\0';
- if ( kcd->active_adjust.corrections!=NULL &&
- pixelsize>=kcd->active_adjust.first_pixel_size &&
- pixelsize<=kcd->active_adjust.last_pixel_size ) {
- sprintf( buffer, "%d", kcd->active_adjust.corrections[
- pixelsize-kcd->active_adjust.first_pixel_size]);
- uc_strcpy(ubuf,buffer);
- }
- GGadgetSetTitle(GWidgetGetControl(kcd->gw,CID_Correction),ubuf);
-#endif
- kcd->pixelsize = pixelsize;
- KCD_UpdateGlyph(kcd,0);
- KCD_UpdateGlyph(kcd,1);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
- }
-return( true );
-}
-
-static int KCD_MagnificationChanged(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- int mag = GGadgetGetFirstListSelectedItem(GWidgetGetControl(kcd->gw,CID_Magnifications));
-
- if ( mag!=-1 && mag!=kcd->magfactor-1 ) {
- kcd->magfactor = mag+1;
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
- }
-return( true );
-}
-
-static int KCB_FreeTypeChanged(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- KCD_UpdateGlyph(kcd,0);
- KCD_UpdateGlyph(kcd,1);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
-return( true );
-}
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
-static int KCD_CorrectionChanged(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(kcd->gw,CID_Correction));
- unichar_t *end;
- int correction = u_strtol(ret,&end,10);
-
- while ( *end==' ' ) ++end;
- if ( *end!='\0' )
-return( true );
- if ( correction<-128 || correction>127 ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error(_("Value out of range"),_("Value out of range"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error( _("Out of Range"), _("Corrections must be between -128 and 127 (and should be smaller)") );
-#endif
-return( true );
- }
-
- DeviceTableSet(&kcd->active_adjust,kcd->pixelsize,correction);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
-return( true );
-}
-#endif
-
-static void KPD_RestoreGlyphs(KernClassDlg *kcd) {
- if ( kcd->scf!=NULL )
- GGadgetSetTitle8(GWidgetGetControl(kcd->gw,CID_First),kcd->scf->name);
- if ( kcd->scs!=NULL )
- GGadgetSetTitle8(GWidgetGetControl(kcd->gw,CID_Second),kcd->scs->name);
-}
-
-static int KPD_FinishKP(KernClassDlg *kcd) {
- KernPair *kp;
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(kcd->gw,CID_KernOffset));
- int offset = u_strtol(ret,NULL,10);
-
- if ( kcd->scf!=NULL && kcd->scs!=NULL ) {
- for ( kp = kcd->isv?kcd->scf->vkerns:kcd->scf->kerns; kp!=NULL && kp->sc!=kcd->scs; kp=kp->next );
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( kp==NULL && offset==0 && kcd->active_adjust.corrections==NULL )
-return(true);
-#else
- if ( kp==NULL && offset==0 )
-return(true);
-#endif
- if ( kcd->subtable==NULL ) {
- gwwv_post_error(_("No lookup selected"),_("You must select a lookup subtable to contain this kerning pair" ));
-return(false);
- }
- if ( kp==NULL ) {
- kp = chunkalloc(sizeof(KernPair));
- kp->next = kcd->isv?kcd->scf->vkerns:kcd->scf->kerns;
- kp->sc = kcd->scs;
- if ( kcd->isv )
- kcd->scf->vkerns = kp;
- else
- kcd->scf->kerns = kp;
- }
- kp->subtable = kcd->subtable;
- kp->off = offset;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( kp->adjust!=NULL && kcd->active_adjust.corrections!=NULL ) {
- free(kp->adjust->corrections);
- *kp->adjust = kcd->active_adjust;
- } else if ( kcd->active_adjust.corrections!=NULL ) {
- kp->adjust = chunkalloc(sizeof(DeviceTable));
- *kp->adjust = kcd->active_adjust;
- } else if ( kp->adjust!=NULL ) {
- DeviceTableFree(kp->adjust);
- kp->adjust = NULL;
- }
- memset(&kcd->active_adjust,0,sizeof(DeviceTable));
-#endif
- }
-return( true );
-}
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
-static void KCD_SetDevTab(KernClassDlg *kcd) {
- unichar_t ubuf[20];
-
- ubuf[0] = '0'; ubuf[1] = '\0';
- GGadgetClearList(GWidgetGetControl(kcd->gw,CID_DisplaySize));
- if ( kcd->active_adjust.corrections!=NULL ) {
- int i;
- int len = kcd->active_adjust.last_pixel_size - kcd->active_adjust.first_pixel_size +1;
- char buffer[20];
- GTextInfo **ti = galloc((len+1)*sizeof(GTextInfo *));
- for ( i=0; i<len; ++i ) {
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- sprintf( buffer, "%d", i+kcd->active_adjust.first_pixel_size);
- ti[i]->text = uc_copy(buffer);
- ti[i]->fg = ti[i]->bg = COLOR_DEFAULT;
- }
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(GWidgetGetControl(kcd->gw,CID_DisplaySize),ti,false);
- if ( kcd->pixelsize>=kcd->active_adjust.first_pixel_size &&
- kcd->pixelsize<=kcd->active_adjust.last_pixel_size ) {
- sprintf( buffer, "%d", kcd->active_adjust.corrections[
- kcd->pixelsize-kcd->active_adjust.first_pixel_size]);
- uc_strcpy(ubuf,buffer);
- }
- }
- GGadgetSetTitle(GWidgetGetControl(kcd->gw,CID_Correction),ubuf);
-}
-#endif
-
-static void KP_SelectSubtable(KernClassDlg *kcd,struct lookup_subtable *sub) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_Subtable),&len);
- int i, new_pos = -1;
-
- for ( i=0; i<len; ++i ) if ( !ti[i]->line ) {
- if ( ti[i]->userdata == sub )
- break;
- else if ( ti[i]->userdata == NULL )
- new_pos = i;
- }
- if ( i==len )
- i = new_pos;
- if ( i!=-1 )
- GGadgetSelectOneListItem(GWidgetGetControl(kcd->gw,CID_Subtable),i);
- if ( sub!=NULL )
- kcd->subtable = sub;
-}
-
-static int KP_Subtable(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- GTextInfo *ti;
- struct lookup_subtable *sub;
- struct subtable_data sd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- ti = GGadgetGetListItemSelected(g);
- if ( ti!=NULL ) {
- if ( ti->userdata!=NULL )
- kcd->subtable = ti->userdata;
- else {
- memset(&sd,0,sizeof(sd));
- sd.flags = (kcd->isv ? sdf_verticalkern : sdf_horizontalkern ) |
- sdf_kernpair;
- sub = SFNewLookupSubtableOfType(kcd->sf,gpos_pair,&sd);
- if ( sub!=NULL ) {
- kcd->subtable = sub;
- GGadgetSetList(g,SFSubtablesOfType(kcd->sf,gpos_pair,false),false);
- }
- KP_SelectSubtable(kcd,kcd->subtable);
- }
- }
- }
-return( true );
-}
-
-static void KPD_PairSearch(KernClassDlg *kcd) {
- int offset = 0;
- KernPair *kp=NULL;
- char buf[20];
- unichar_t ubuf[20];
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kcd->active_adjust.corrections); kcd->active_adjust.corrections = NULL;
-#endif
- if ( kcd->scf!=NULL && kcd->scs!=NULL ) {
- for ( kp = kcd->isv?kcd->scf->vkerns:kcd->scf->kerns; kp!=NULL && kp->sc!=kcd->scs; kp=kp->next );
- if ( kp!=NULL ) {
- offset = kp->off;
- KP_SelectSubtable(kcd,kp->subtable);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( kp->adjust!=NULL ) {
- int len = kp->adjust->last_pixel_size-kp->adjust->first_pixel_size+1;
- kcd->active_adjust = *kp->adjust;
- kcd->active_adjust.corrections = galloc(len);
- memcpy(kcd->active_adjust.corrections,kp->adjust->corrections,len);
- }
-#endif
- }
- }
- if ( kp==NULL && kcd->scf!=NULL ) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_Subtable),&len);
- uint32 script = SCScriptFromUnicode(kcd->scf);
- int i;
- struct lookup_subtable *sub = NULL;
-
- for ( i=0; i<len; ++i ) {
- struct lookup_subtable *test = ti[i]->userdata;
- if ( test!=NULL && ScriptInFeatureScriptList(script,test->lookup->features)) {
- sub = test;
- break;
- }
- }
- KP_SelectSubtable(kcd,sub);
- }
-
- sprintf(buf, "%d", offset);
- uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_KernOffset),ubuf);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- KCD_SetDevTab(kcd);
-#endif
-}
-
-static void KPD_BuildKernList(KernClassDlg *kcd) {
- int len;
- KernPair *kp;
- GTextInfo **ti;
-
- len = 0;
- if ( kcd->scf!=NULL )
- for ( kp=kcd->isv?kcd->scf->vkerns:kcd->scf->kerns, len=0; kp!=NULL; kp=kp->next )
- ++len;
- ti = gcalloc(len+1,sizeof(GTextInfo*));
- if ( kcd->scf!=NULL )
- for ( kp=kcd->isv?kcd->scf->vkerns:kcd->scf->kerns, len=0; kp!=NULL; kp=kp->next, ++len ) {
- ti[len] = gcalloc(1,sizeof(GTextInfo));
- ti[len]->fg = ti[len]->bg = COLOR_DEFAULT;
- ti[len]->text = uc_copy(kp->sc->name);
- }
- ti[len] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(GWidgetGetControl(kcd->gw,CID_Second),ti,false);
-}
-
-static int KCD_GlyphSelected(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int which = GGadgetGetCid(g)==CID_Second;
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- KCD_UpdateGlyph(kcd,which);
- GDrawRequestExpose(kcd->kw,NULL,false);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- if ( !KPD_FinishKP(kcd)) {
- KPD_RestoreGlyphs(kcd);
-return( true );
- }
- KCD_UpdateGlyph(kcd,which);
- if ( which==0 )
- KPD_BuildKernList(kcd);
- KPD_PairSearch(kcd);
- GDrawRequestExpose(kcd->kw,NULL,false);
- }
-return( true );
-}
-
-static GTextInfo **TiNamesFromClass(GGadget *list,int class_index) {
- /* Return a list containing all the names in this class */
- unichar_t *upt, *end;
- unichar_t *line;
- GTextInfo *classti;
- GTextInfo **ti;
- int i, k;
-
- classti = GGadgetGetListItem(list,class_index);
- if ( classti==NULL || uc_strcmp(classti->text,_("{Everything Else}"))==0 ) {
- i=0;
- ti = galloc((i+1)*sizeof(GTextInfo*));
- } else {
- line = GGadgetGetListItem(list,class_index)->text;
- for ( k=0 ; k<2; ++k ) {
- for ( i=0, upt=line; *upt; ) {
- while ( *upt==' ' ) ++upt;
- if ( *upt=='\0' )
- break;
- for ( end = upt; *end!='\0' && *end!=' '; ++end );
- if ( k==1 ) {
- ti[i] = gcalloc(1,sizeof(GTextInfo));
- ti[i]->text = u_copyn(upt,end-upt);
- ti[i]->bg = ti[i]->fg = COLOR_DEFAULT;
- }
- ++i;
- upt = end;
- }
- if ( k==0 )
- ti = galloc((i+1)*sizeof(GTextInfo*));
- }
- }
- if ( i>0 )
- ti[0]->selected = true;
- ti[i] = gcalloc(1,sizeof(GTextInfo));
-return( ti );
-}
-
-static void KCD_EditOffset(KernClassDlg *kcd) {
- int first = kcd->st_pos/kcd->second_cnt, second = kcd->st_pos%kcd->second_cnt;
- char buf[12];
- unichar_t ubuf[12];
- GTextInfo **ti;
- static unichar_t nullstr[] = { 0 };
-
- if ( second==0 )
- ff_post_notice(_("Class 0"),_("The kerning values for class 0 (\"Everything Else\") should always be 0"));
- GGadgetSetList(GWidgetGetControl(kcd->kw,CID_First),
- ti = TiNamesFromClass(GWidgetGetControl(kcd->gw,CID_ClassList),first),false);
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_First),
- ti==NULL || ti[0]->text==NULL ? nullstr: ti[0]->text);
- GGadgetSetList(GWidgetGetControl(kcd->kw,CID_Second),
- ti = TiNamesFromClass(GWidgetGetControl(kcd->gw,CID_ClassList+100),second),false);
- GGadgetSetTitle(GWidgetGetControl(kcd->kw,CID_Second),
- ti==NULL || ti[0]->text==NULL ? nullstr: ti[0]->text);
- KCD_UpdateGlyph(kcd,0);
- KCD_UpdateGlyph(kcd,1);
-
- sprintf( buf, "%d", kcd->offsets[kcd->st_pos]);
- uc_strcpy(ubuf,buf);
- GGadgetSetTitle(GWidgetGetControl(kcd->gw,CID_KernOffset),ubuf);
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- kcd->active_adjust = kcd->adjusts[kcd->st_pos];
- if ( kcd->active_adjust.corrections!=NULL ) {
- int len = kcd->active_adjust.last_pixel_size - kcd->active_adjust.first_pixel_size +1;
- kcd->active_adjust.corrections = galloc(len);
- memcpy(kcd->active_adjust.corrections,kcd->adjusts[kcd->st_pos].corrections,len);
- }
- KCD_SetDevTab(kcd);
-#endif
-
- GDrawSetVisible(kcd->kw,true);
-}
-
-/* ************************************************************************** */
-/* *************************** Kern Class Dialog **************************** */
-/* ************************************************************************** */
-
-static int KC_OK(GGadget *g, GEvent *e) {
- SplineFont *sf;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- KernClass *kc;
- int i;
- int32 len;
- GTextInfo **ti;
-
- sf = kcd->sf;
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
- else if ( sf->mm!=NULL ) sf = sf->mm->normal;
-
- if ( GDrawIsVisible(kcd->cw))
-return( KCD_Next(g,e));
- else if ( GDrawIsVisible(kcd->kw))
-return( KCD_Next2(g,e));
-
- kc = kcd->orig;
- for ( i=1; i<kc->first_cnt; ++i )
- free( kc->firsts[i]);
- for ( i=1; i<kc->second_cnt; ++i )
- free( kc->seconds[i]);
- free(kc->firsts);
- free(kc->seconds);
- free(kc->offsets);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kc->adjusts);
-#endif
- kc->first_cnt = kcd->first_cnt;
- kc->second_cnt = kcd->second_cnt;
- kc->firsts = galloc(kc->first_cnt*sizeof(char *));
- kc->seconds = galloc(kc->second_cnt*sizeof(char *));
- kc->firsts[0] = kc->seconds[0] = NULL;
- ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_ClassList),&len);
- if ( uc_strcmp(ti[0]->text,_("{Everything Else}"))!=0 )
- kc->firsts[0] = cu_copy(ti[0]->text);
- for ( i=1; i<kc->first_cnt; ++i )
- kc->firsts[i] = cu_copy(ti[i]->text);
- ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_ClassList+100),&len);
- for ( i=1; i<kc->second_cnt; ++i )
- kc->seconds[i] = cu_copy(ti[i]->text);
- kc->offsets = kcd->offsets;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- kc->adjusts = kcd->adjusts;
-#endif
- kcd->sf->changed = true;
- sf->changed = true;
-
- GDrawDestroyWindow(kcd->gw);
- }
-return( true );
-}
-
-static void KC_DoCancel(KernClassDlg *kcd) {
- if ( kcd->iskernpair )
- KPD_DoCancel(kcd);
- else {
- free(kcd->offsets);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- { int i;
- for ( i=0; i<kcd->first_cnt*kcd->second_cnt; ++i )
- free(kcd->adjusts[i].corrections);
- }
- free(kcd->adjusts);
-#endif
- GDrawDestroyWindow(kcd->gw);
- }
-}
-
-static int KC_Cancel(GGadget *g, GEvent *e) {
- KernClassDlg *kcd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- kcd = GDrawGetUserData(GGadgetGetWindow(g));
- if ( GDrawIsVisible(kcd->cw))
-return( KCD_Prev(g,e));
- else if ( GDrawIsVisible(kcd->kw))
-return( KCD_Prev2(g,e));
-
- KC_DoCancel(kcd);
- }
-return( true );
-}
-
-static void _KCD_EnableButtons(KernClassDlg *kcd,int off) {
- GGadget *list = GWidgetGetControl(kcd->gw,CID_ClassList+off);
- int32 i, len, j;
- GTextInfo **ti;
-
- ti = GGadgetGetList(list,&len);
- i = GGadgetGetFirstListSelectedItem(list);
- GGadgetSetEnabled(GWidgetGetControl(kcd->gw,CID_ClassDel+off),i>=1);
- for ( j=len-1; j>i; --j )
- if ( ti[j]->selected )
- break;
- GGadgetSetEnabled(GWidgetGetControl(kcd->gw,CID_ClassEdit+off),(i>=1 || off==0) && j==i);
- GGadgetSetEnabled(GWidgetGetControl(kcd->gw,CID_ClassUp+off),i>=2);
- GGadgetSetEnabled(GWidgetGetControl(kcd->gw,CID_ClassDown+off),i>=1 && j<len-1);
-}
-
-static void OffsetMoveClasses(KernClassDlg *kcd, int dir, GTextInfo **movethese, int off ) {
- int16 *new;
- int i,j,k;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- DeviceTable *newd;
-#endif
-
- movethese[0]->selected = false;
-
- new = galloc(kcd->first_cnt*kcd->second_cnt*sizeof(int16));
- memcpy(new,kcd->offsets,kcd->first_cnt*kcd->second_cnt*sizeof(int16));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- newd = galloc(kcd->first_cnt*kcd->second_cnt*sizeof(DeviceTable));
- memcpy(newd,kcd->adjusts,kcd->first_cnt*kcd->second_cnt*sizeof(DeviceTable));
-#endif
- if ( off==0 ) {
- for ( i=1; i<kcd->first_cnt; ++i ) {
- if ( movethese[i]->selected ) {
- for ( k=i; k<kcd->first_cnt && movethese[k]->selected; ++k );
- memcpy(new+(i+dir)*kcd->second_cnt,kcd->offsets+i*kcd->second_cnt,
- (k-i)*kcd->second_cnt*sizeof(int16));
- if ( dir>0 )
- memcpy(new+i*kcd->second_cnt,kcd->offsets+k*kcd->second_cnt,
- kcd->second_cnt*sizeof(int16));
- else
- memcpy(new+(k-1)*kcd->second_cnt,kcd->offsets+(i-1)*kcd->second_cnt,
- kcd->second_cnt*sizeof(int16));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- memcpy(newd+(i+dir)*kcd->second_cnt,kcd->adjusts+i*kcd->second_cnt,
- (k-i)*kcd->second_cnt*sizeof(DeviceTable));
- if ( dir>0 )
- memcpy(newd+i*kcd->second_cnt,kcd->adjusts+k*kcd->second_cnt,
- kcd->second_cnt*sizeof(DeviceTable));
- else
- memcpy(newd+(k-1)*kcd->second_cnt,kcd->adjusts+(i-1)*kcd->second_cnt,
- kcd->second_cnt*sizeof(DeviceTable));
-#endif
- i=k-1;
- }
- }
- } else {
- for ( i=0; i<kcd->first_cnt; ++i ) {
- for ( j=0; j<kcd->second_cnt; ++j ) {
- if ( movethese[j]->selected ) {
- for ( k=j; k<kcd->second_cnt && movethese[k]->selected; ++k );
- memcpy(new+i*kcd->second_cnt+(j+dir),kcd->offsets+i*kcd->second_cnt+j,
- (k-j)*sizeof(int16));
- if ( dir>0 )
- new[i*kcd->second_cnt+j] = kcd->offsets[i*kcd->second_cnt+k];
- else
- new[i*kcd->second_cnt+k-1] = kcd->offsets[i*kcd->second_cnt+j-1];
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- memcpy(newd+i*kcd->second_cnt+(j+dir),kcd->offsets+i*kcd->second_cnt+j,
- (k-j)*sizeof(DeviceTable));
- if ( dir>0 )
- newd[i*kcd->second_cnt+j] = kcd->adjusts[i*kcd->second_cnt+k];
- else
- newd[i*kcd->second_cnt+k-1] = kcd->adjusts[i*kcd->second_cnt+j-1];
-#endif
- j = k-1;
- }
- }
- }
- }
-
- free(kcd->offsets);
- kcd->offsets = new;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kcd->adjusts);
- kcd->adjusts = newd;
-#endif
-}
-
-static int KCD_Up(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassUp;
- GGadget *list = GWidgetGetControl(kcd->gw,CID_ClassList+off);
- int32 len;
-
- OffsetMoveClasses(kcd,-1,GGadgetGetList(list,&len),off);
- GListMoveSelected(list,-1);
- _KCD_EnableButtons(kcd,off);
- KCD_SBReset(kcd);
- GDrawRequestExpose(kcd->gw,NULL,false);
- }
-return( true );
-}
-
-static int KCD_Down(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassDown;
- GGadget *list = GWidgetGetControl(kcd->gw,CID_ClassList+off);
- int32 len;
-
- OffsetMoveClasses(kcd,1,GGadgetGetList(list,&len),off);
- GListMoveSelected(list,1);
- _KCD_EnableButtons(kcd,off);
- KCD_SBReset(kcd);
- GDrawRequestExpose(kcd->gw,NULL,false);
- }
-return( true );
-}
-
-static void OffsetRemoveClasses(KernClassDlg *kcd, GTextInfo **removethese, int off ) {
- int16 *new;
- int i,j,k, remove_cnt;
- int old_cnt = off==0 ? kcd->first_cnt : kcd->second_cnt;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- DeviceTable *newd;
-#endif
-
- removethese[0]->selected = false;
- for ( remove_cnt=i=0; i<old_cnt; ++i )
- if ( removethese[i]->selected )
- ++remove_cnt;
- if ( remove_cnt==0 )
-return;
-
- if ( off==0 ) {
- new = galloc((kcd->first_cnt-remove_cnt)*kcd->second_cnt*sizeof(int16));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- newd = galloc((kcd->first_cnt-remove_cnt)*kcd->second_cnt*sizeof(DeviceTable));
-#endif
- for ( i=k=0; i<kcd->first_cnt; ++i ) {
-#ifndef FONTFORGE_CONFIG_DEVICETABLES
- if ( !removethese[i]->selected )
- memcpy(new+(k++)*kcd->second_cnt,kcd->offsets+i*kcd->second_cnt,kcd->second_cnt*sizeof(int16));
-#else
- if ( !removethese[i]->selected ) {
- memcpy(new+k*kcd->second_cnt,kcd->offsets+i*kcd->second_cnt,kcd->second_cnt*sizeof(int16));
- memcpy(newd+(k++)*kcd->second_cnt,kcd->adjusts+i*kcd->second_cnt,kcd->second_cnt*sizeof(DeviceTable));
- } else {
- for ( j=0; j<kcd->second_cnt; ++j )
- free(kcd->adjusts[i*kcd->second_cnt+j].corrections);
- }
-#endif
- }
- kcd->first_cnt = k;
- } else {
- new = galloc(kcd->first_cnt*(kcd->second_cnt-remove_cnt)*sizeof(int16));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- newd = galloc(kcd->first_cnt*(kcd->second_cnt-remove_cnt)*sizeof(DeviceTable));
-#endif
- for ( i=0; i<kcd->first_cnt; ++i ) {
- for ( j=k=0; j<kcd->second_cnt; ++j ) {
-#ifndef FONTFORGE_CONFIG_DEVICETABLES
- if ( !removethese[j]->selected )
- new[i*(kcd->second_cnt-remove_cnt)+(k++)] = kcd->offsets[i*kcd->second_cnt+j];
-#else
- if ( !removethese[j]->selected ) {
- new[i*(kcd->second_cnt-remove_cnt)+k] = kcd->offsets[i*kcd->second_cnt+j];
- newd[i*(kcd->second_cnt-remove_cnt)+(k++)] = kcd->adjusts[i*kcd->second_cnt+j];
- } else
- free(kcd->adjusts[i*kcd->second_cnt+j].corrections);
-#endif
- }
- }
- kcd->second_cnt -= remove_cnt;
- }
-
- free(kcd->offsets);
- kcd->offsets = new;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(kcd->adjusts);
- kcd->adjusts = newd;
-#endif
-}
-
-static int KCD_Delete(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassDel;
- GGadget *list = GWidgetGetControl(kcd->gw,CID_ClassList+off);
- int32 len;
-
- OffsetRemoveClasses(kcd,GGadgetGetList(list,&len),off);
- GListDelSelected(list);
- _KCD_EnableButtons(kcd,off);
- KCD_SBReset(kcd);
- GDrawRequestExpose(kcd->gw,NULL,false);
- }
-return( true );
-}
-
-static int KCD_Edit(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassEdit;
- if ( GGadgetGetFirstListSelectedItem(GWidgetGetControl(kcd->gw,CID_ClassList+off))>0 )
- _KCD_DoEditNew(kcd,true,off);
- }
-return( true );
-}
-
-static int KCD_New(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassNew;
- _KCD_DoEditNew(kcd,false,off);
- }
-return( true );
-}
-
-static int KCD_ClassSelected(GGadget *g, GEvent *e) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassList;
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- _KCD_EnableButtons(kcd,off);
- if ( off==0 )
- KCD_VShow(kcd,GGadgetGetFirstListSelectedItem(g));
- else
- KCD_HShow(kcd,GGadgetGetFirstListSelectedItem(g));
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- /* Class 0 can contain something real on the first character but not the second */
- if ( off==0 || GGadgetGetFirstListSelectedItem(g)>0 )
- _KCD_DoEditNew(kcd,true,off);
- }
-return( true );
-}
-
-static int KCD_TextSelect(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- KernClassDlg *kcd = GDrawGetUserData(GGadgetGetWindow(g));
- int off = GGadgetGetCid(g)-CID_ClassSelect;
- const unichar_t *name = _GGadgetGetTitle(g);
- GGadget *list = GWidgetGetControl(kcd->gw,CID_ClassList+off);
- int32 len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- int nlen=u_strlen(name);
- unichar_t *start, *pt;
- int i;
-
- for ( i=0; i<len; ++i ) {
- for ( start = ti[i]->text; start!=NULL && *start!='\0'; ) {
- while ( *start==' ' ) ++start;
- for ( pt=start; *pt!='\0' && *pt!=' '; ++pt );
- if ( pt-start == nlen && u_strncmp(name,start,nlen)==0 ) {
- GGadgetSelectOneListItem(list,i);
- GGadgetScrollListToPos(list,i);
- _KCD_EnableButtons(kcd,off);
- if ( off==0 )
- KCD_VShow(kcd,i);
- else
- KCD_HShow(kcd,i);
-return( true );
- }
- start = pt;
- }
- }
-
- /* Otherwise deselect everything */
- if ( nlen!=0 )
- for ( i=0; i<len; ++i )
- GGadgetSelectListItem(list,i,false);
- }
-return( true );
-}
-
-static void KCD_Mouse(KernClassDlg *kcd,GEvent *event) {
- static unichar_t space[200];
- char buf[30];
- int32 len;
- GTextInfo **ti;
- int pos = ((event->u.mouse.y-kcd->ystart2)/kcd->kernh + kcd->offtop) * kcd->second_cnt +
- (event->u.mouse.x-kcd->xstart2)/kcd->kernw + kcd->offleft;
-
- GGadgetEndPopup();
-
- if (( event->type==et_mouseup || event->type==et_mousedown ) &&
- (event->u.mouse.button==4 || event->u.mouse.button==5) ) {
- GGadgetDispatchEvent(kcd->vsb,event);
-return;
- }
-
- if ( event->u.mouse.x<kcd->xstart || event->u.mouse.x>kcd->xstart2+kcd->fullwidth ||
- event->u.mouse.y<kcd->ystart || event->u.mouse.y>kcd->ystart2+kcd->height )
-return;
-
- if ( event->type==et_mousemove ) {
- int c = (event->u.mouse.x - kcd->xstart2)/kcd->kernw + kcd->offleft;
- int s = (event->u.mouse.y - kcd->ystart2)/kcd->kernh + kcd->offtop;
- space[0] = '\0';
- if ( event->u.mouse.y>=kcd->ystart2 && s<kcd->first_cnt ) {
- sprintf( buf, "First Class %d\n", s );
- uc_strcpy(space,buf);
- ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_ClassList),&len);
- len = u_strlen(space);
- u_strncpy(space+len,ti[s]->text,(sizeof(space)/sizeof(space[0]))/2-2 - len);
- uc_strcat(space,"\n");
- }
- if ( event->u.mouse.x>=kcd->xstart2 && c<kcd->second_cnt ) {
- sprintf( buf, "Second Class %d\n", c );
- uc_strcat(space,buf);
- ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_ClassList+100),&len);
- len = u_strlen(space);
- u_strncpy(space+len,ti[c]->text,(sizeof(space)/sizeof(space[0]))-1 - len);
- }
- if ( space[0]=='\0' )
-return;
- if ( space[u_strlen(space)-1]=='\n' )
- space[u_strlen(space)-1]='\0';
- GGadgetPreparePopup(kcd->gw,space);
- } else if ( event->u.mouse.x<kcd->xstart2 || event->u.mouse.y<kcd->ystart2 )
-return;
- else if ( event->type==et_mousedown )
- kcd->st_pos = pos;
- else if ( event->type==et_mouseup ) {
- if ( pos==kcd->st_pos )
- KCD_EditOffset(kcd);
- }
-}
-
-static void KCD_Expose(KernClassDlg *kcd,GWindow pixmap,GEvent *event) {
- GRect *area = &event->u.expose.rect;
- GRect rect, select;
- GRect clip,old1,old2;
- int len, i, j, x, y;
- unichar_t ubuf[8];
- char buf[100];
- int32 tilen;
- GTextInfo **ti;
-
- if ( area->y+area->height<kcd->ystart )
-return;
- if ( area->y>kcd->ystart2+kcd->height )
-return;
-
- GDrawPushClip(pixmap,area,&old1);
- GDrawSetFont(pixmap,kcd->font);
- GDrawSetLineWidth(pixmap,0);
- rect.x = kcd->xstart; rect.y = kcd->ystart;
- rect.width = kcd->width+(kcd->xstart2-kcd->xstart);
- rect.height = kcd->height+(kcd->ystart2-kcd->ystart);
- clip = rect;
- GDrawPushClip(pixmap,&clip,&old2);
-
- /* In the offsets list, show which classes are selected above in the class*/
- /* lists */
- ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_ClassList),&tilen);
- for ( i=0 ; kcd->offtop+i<=kcd->first_cnt && (i-1)*kcd->kernh<kcd->height; ++i ) {
- if ( i+kcd->offtop<tilen && ti[i+kcd->offtop]->selected ) {
- select.x = kcd->xstart+1; select.y = kcd->ystart2+i*kcd->kernh+1;
- select.width = rect.width-1; select.height = kcd->kernh-1;
- GDrawFillRect(pixmap,&select,0xffff00);
- }
- }
- ti = GGadgetGetList(GWidgetGetControl(kcd->gw,CID_ClassList+100),&tilen);
- for ( i=0 ; kcd->offleft+i<=kcd->second_cnt && (i-1)*kcd->kernw<kcd->fullwidth; ++i ) {
- if ( i+kcd->offleft<tilen && ti[i+kcd->offleft]->selected ) {
- select.x = kcd->xstart2+i*kcd->kernw+1; select.y = kcd->ystart+1;
- select.width = kcd->kernw-1; select.height = rect.height-1;
- GDrawFillRect(pixmap,&select,0xffff00);
- }
- }
-
- for ( i=0 ; kcd->offtop+i<=kcd->first_cnt && (i-1)*kcd->kernh<kcd->height; ++i ) {
- GDrawDrawLine(pixmap,kcd->xstart,kcd->ystart2+i*kcd->kernh,kcd->xstart+rect.width,kcd->ystart2+i*kcd->kernh,
- 0x808080);
- if ( i+kcd->offtop<kcd->first_cnt ) {
- sprintf( buf, "%d", i+kcd->offtop );
- uc_strcpy(ubuf,buf);
- len = GDrawGetTextWidth(pixmap,ubuf,-1,NULL);
- GDrawDrawText(pixmap,kcd->xstart+(kcd->kernw-len)/2,kcd->ystart2+i*kcd->kernh+kcd->as+1,
- ubuf,-1,NULL,0xff0000);
- }
- }
- for ( i=0 ; kcd->offleft+i<=kcd->second_cnt && (i-1)*kcd->kernw<kcd->fullwidth; ++i ) {
- GDrawDrawLine(pixmap,kcd->xstart2+i*kcd->kernw,kcd->ystart,kcd->xstart2+i*kcd->kernw,kcd->ystart+rect.height,
- 0x808080);
- if ( i+kcd->offleft<kcd->second_cnt ) {
- sprintf( buf, "%d", i+kcd->offleft );
- uc_strcpy(ubuf,buf);
- len = GDrawGetTextWidth(pixmap,ubuf,-1,NULL);
- GDrawDrawText(pixmap,kcd->xstart2+i*kcd->kernw+(kcd->kernw-len)/2,kcd->ystart+kcd->as+1,
- ubuf,-1,NULL,0xff0000);
- }
- }
-
- for ( i=0 ; kcd->offtop+i<kcd->first_cnt && (i-1)*kcd->kernh<kcd->height; ++i ) {
- y = kcd->ystart2+i*kcd->kernh;
- if ( y>area->y+area->height )
- break;
- if ( y+kcd->kernh<area->y )
- continue;
- for ( j=0 ; kcd->offleft+j<kcd->second_cnt && (j-1)*kcd->kernw<kcd->fullwidth; ++j ) {
- x = kcd->xstart2+j*kcd->kernw;
- if ( x>area->x+area->width )
- break;
- if ( x+kcd->kernw<area->x )
- continue;
-
- sprintf( buf, "%d", kcd->offsets[(i+kcd->offtop)*kcd->second_cnt+j+kcd->offleft] );
- uc_strcpy(ubuf,buf);
- len = GDrawGetTextWidth(pixmap,ubuf,-1,NULL);
- GDrawDrawText(pixmap,x+kcd->kernw-3-len,y+kcd->as+1,
- ubuf,-1,NULL,0x000000);
- }
- }
-
- GDrawDrawLine(pixmap,kcd->xstart,kcd->ystart2,kcd->xstart+rect.width,kcd->ystart2,
- 0x000000);
- GDrawDrawLine(pixmap,kcd->xstart2,kcd->ystart,kcd->xstart2,kcd->ystart+rect.height,
- 0x000000);
- GDrawPopClip(pixmap,&old2);
- GDrawPopClip(pixmap,&old1);
- GDrawDrawRect(pixmap,&rect,0x000000);
- rect.y += rect.height;
- rect.x += rect.width;
- LogoExpose(pixmap,event,&rect,dm_fore);
-}
-
-static int KCD_SBReset(KernClassDlg *kcd) {
- int oldtop = kcd->offtop, oldleft = kcd->offleft;
-
- if ( kcd->height>=kcd->kernh )
- GScrollBarSetBounds(kcd->vsb,0,kcd->first_cnt, kcd->height/kcd->kernh);
- if ( kcd->width>=kcd->kernw )
- GScrollBarSetBounds(kcd->hsb,0,kcd->second_cnt, kcd->width/kcd->kernw);
- if ( kcd->offtop + (kcd->height/kcd->kernh) >= kcd->first_cnt )
- kcd->offtop = kcd->first_cnt - (kcd->height/kcd->kernh);
- if ( kcd->offtop < 0 ) kcd->offtop = 0;
- if ( kcd->offleft + (kcd->width/kcd->kernw) >= kcd->second_cnt )
- kcd->offleft = kcd->second_cnt - (kcd->width/kcd->kernw);
- if ( kcd->offleft < 0 ) kcd->offleft = 0;
- GScrollBarSetPos(kcd->vsb,kcd->offtop);
- GScrollBarSetPos(kcd->hsb,kcd->offleft);
-
-return( oldtop!=kcd->offtop || oldleft!=kcd->offleft );
-}
-
-static void KCD_HShow(KernClassDlg *kcd, int pos) {
- if ( pos>=0 && pos<kcd->second_cnt ) {
-#if 0
- if ( pos>=kcd->offleft && pos<kcd->offleft+(kcd->width/kcd->kernw) )
-return; /* Already visible */
-#endif
- --pos; /* One line of context */
- if ( pos + (kcd->width/kcd->kernw) >= kcd->second_cnt )
- pos = kcd->second_cnt - (kcd->width/kcd->kernw);
- if ( pos < 0 ) pos = 0;
- kcd->offleft = pos;
- GScrollBarSetPos(kcd->hsb,pos);
- }
- GDrawRequestExpose(kcd->gw,NULL,false);
-}
-
-static void KCD_HScroll(KernClassDlg *kcd,struct sbevent *sb) {
- int newpos = kcd->offleft;
- GRect rect;
-
- switch( sb->type ) {
- case et_sb_top:
- newpos = 0;
- break;
- case et_sb_uppage:
- if ( kcd->width/kcd->kernw == 1 )
- --newpos;
- else
- newpos -= kcd->width/kcd->kernw - 1;
- break;
- case et_sb_up:
- --newpos;
- break;
- case et_sb_down:
- ++newpos;
- break;
- case et_sb_downpage:
- if ( kcd->width/kcd->kernw == 1 )
- ++newpos;
- else
- newpos += kcd->width/kcd->kernw - 1;
- break;
- case et_sb_bottom:
- newpos = kcd->second_cnt - (kcd->width/kcd->kernw);
- break;
- case et_sb_thumb:
- case et_sb_thumbrelease:
- newpos = sb->pos;
- break;
- }
- if ( newpos + (kcd->width/kcd->kernw) >= kcd->second_cnt )
- newpos = kcd->second_cnt - (kcd->width/kcd->kernw);
- if ( newpos < 0 ) newpos = 0;
- if ( newpos!=kcd->offleft ) {
- int diff = newpos-kcd->offleft;
- kcd->offleft = newpos;
- GScrollBarSetPos(kcd->hsb,newpos);
- rect.x = kcd->xstart2+1; rect.y = kcd->ystart;
- rect.width = kcd->width-1;
- rect.height = kcd->height+(kcd->ystart2-kcd->ystart);
- GDrawScroll(kcd->gw,&rect,-diff*kcd->kernw,0);
- }
-}
-
-static void KCD_VShow(KernClassDlg *kcd, int pos) {
- if ( pos>=0 && pos<kcd->first_cnt ) {
-#if 0
- if ( pos>=kcd->offtop && pos<kcd->offtop+(kcd->height/kcd->kernh) )
-return; /* Already visible */
-#endif
- --pos; /* One line of context */
- if ( pos + (kcd->height/kcd->kernh) >= kcd->first_cnt )
- pos = kcd->first_cnt - (kcd->height/kcd->kernh);
- if ( pos < 0 ) pos = 0;
- kcd->offtop = pos;
- GScrollBarSetPos(kcd->vsb,pos);
- }
- GDrawRequestExpose(kcd->gw,NULL,false);
-}
-
-static void KCD_VScroll(KernClassDlg *kcd,struct sbevent *sb) {
- int newpos = kcd->offtop;
- GRect rect;
-
- switch( sb->type ) {
- case et_sb_top:
- newpos = 0;
- break;
- case et_sb_uppage:
- if ( kcd->height/kcd->kernh == 1 )
- --newpos;
- else
- newpos -= kcd->height/kcd->kernh - 1;
- break;
- case et_sb_up:
- --newpos;
- break;
- case et_sb_down:
- ++newpos;
- break;
- case et_sb_downpage:
- if ( kcd->height/kcd->kernh == 1 )
- ++newpos;
- else
- newpos += kcd->height/kcd->kernh - 1;
- break;
- case et_sb_bottom:
- newpos = kcd->first_cnt - (kcd->height/kcd->kernh);
- break;
- case et_sb_thumb:
- case et_sb_thumbrelease:
- newpos = sb->pos;
- break;
- }
- if ( newpos + (kcd->height/kcd->kernh) >= kcd->first_cnt )
- newpos = kcd->first_cnt - (kcd->height/kcd->kernh);
- if ( newpos < 0 ) newpos = 0;
- if ( newpos!=kcd->offtop ) {
- int diff = newpos-kcd->offtop;
- kcd->offtop = newpos;
- GScrollBarSetPos(kcd->vsb,newpos);
- rect.x = kcd->xstart; rect.y = kcd->ystart2+1;
- rect.width = kcd->width+(kcd->xstart2-kcd->xstart);
- rect.height = kcd->height-1;
- GDrawScroll(kcd->gw,&rect,0,diff*kcd->kernh);
- }
-}
-
-static void KCD_Drop(KernClassDlg *kcd, GEvent *event) {
- DropChars2Text(kcd->gw,GWidgetGetControl(kcd->cw,CID_GlyphList),event);
-}
-
-static int subkern_e_h(GWindow gw, GEvent *event) {
- KernClassDlg *kcd = GDrawGetUserData(gw);
-
- switch ( event->type ) {
- case et_char:
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("metricsview.html#kernclass");
-return( true );
- } else if ( event->u.chr.keysym=='q' && (event->u.chr.state&ksm_control)) {
- if ( event->u.chr.state&ksm_shift )
- KC_DoCancel(kcd);
- else
- MenuExit(NULL,NULL,NULL);
-return( true );
- }
-return( false );
- case et_mouseup: case et_mousedown: case et_mousemove:
- KCD_KernMouse(kcd,event);
- break;
- case et_expose:
- KCD_KernExpose(kcd,gw,event);
- break;
- case et_drop:
- KCD_Drop(kcd,event);
- break;
- }
-return( true );
-}
-
-static int subkcd_e_h(GWindow gw, GEvent *event) {
- KernClassDlg *kcd = GDrawGetUserData(gw);
-
- switch ( event->type ) {
- case et_char:
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("metricsview.html#kernclass");
-return( true );
- } else if ( event->u.chr.keysym=='q' && (event->u.chr.state&ksm_control)) {
- if ( event->u.chr.state&ksm_shift )
- KC_DoCancel(kcd);
- else
- MenuExit(NULL,NULL,NULL);
-return( true );
- }
-return( false );
- }
-return( true );
-}
-
-static int kcd_e_h(GWindow gw, GEvent *event) {
- KernClassDlg *kcd = GDrawGetUserData(gw);
-
- switch ( event->type ) {
- case et_close:
- KC_DoCancel(kcd);
- break;
- case et_char:
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help(kcd->iskernpair ? "metricsview.html#kernpair":
- "metricsview.html#kernclass");
-return( true );
- }
-return( false );
- break;
- case et_destroy:
- if ( kcd!=NULL ) {
- SplineFont *sf = kcd->sf;
- KernClassListDlg *kcld = kcd->isv ? sf->vkcld : sf->kcld;
- KernClassDlg *prev, *test;
- for ( prev=NULL, test=sf->kcd; test!=NULL && test!=kcd; prev=test, test=test->next );
- if ( test==kcd ) {
- if ( prev==NULL )
- sf->kcd = test->next;
- else
- prev->next = test->next;
- }
- if ( kcld!=NULL ) {
- GGadgetSetList(GWidgetGetControl(kcld->gw,CID_List),
- KCLookupSubtableArray(sf,kcd->isv),false);
- }
- free(kcd);
- }
- break;
- case et_mouseup: case et_mousemove: case et_mousedown:
- if ( kcd->iskernpair )
- KCD_KernMouse(kcd,event);
- else
- KCD_Mouse(kcd,event);
- break;
- case et_expose:
- if ( kcd->iskernpair )
- KCD_KernExpose(kcd,gw,event);
- else
- KCD_Expose(kcd,gw,event);
- break;
- case et_resize: {
- GRect wsize, csize;
-
- GDrawGetSize(kcd->gw,&wsize);
-
- kcd->fullwidth = wsize.width;
- if ( kcd->cw!=NULL ) {
- GDrawResize(kcd->cw,wsize.width,wsize.height);
- GDrawResize(kcd->kw,wsize.width,wsize.height);
- GGadgetGetSize(kcd->hsb,&csize);
- kcd->width = csize.width;
- kcd->xstart2 = csize.x;
- GGadgetGetSize(kcd->vsb,&csize);
- kcd->ystart2 = csize.y;
- kcd->height = csize.height;
- kcd->xstart = kcd->xstart2-kcd->kernw;
- kcd->ystart = kcd->ystart2-kcd->fh-1;
- KCD_SBReset(kcd);
- GDrawRequestExpose(kcd->kw,NULL,false);
- GDrawRequestExpose(kcd->cw,NULL,false);
- } else {
- kcd->width = wsize.width-kcd->xstart2-5;
- kcd->height = wsize.height-kcd->ystart2;
- }
- GDrawRequestExpose(kcd->gw,NULL,false);
- } break;
- case et_controlevent:
- switch( event->u.control.subtype ) {
- case et_scrollbarchange:
- if ( event->u.control.g == kcd->hsb )
- KCD_HScroll(kcd,&event->u.control.u.sb);
- else
- KCD_VScroll(kcd,&event->u.control.u.sb);
- break;
- }
- break;
- }
-return( true );
-}
-
-static int AddClassList(GGadgetCreateData *gcd, GTextInfo *label, int k, int off,
- int x, int y, int width, GGadgetCreateData **harray,
- GGadgetCreateData **varray ) {
- int blen = GIntGetResource(_NUM_Buttonsize);
- int space = 10;
-
- harray[0] = GCD_HPad10;
- label[k].text = (unichar_t *) (x<20?_("First Char"):_("Second Char"));
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = x+10; gcd[k].gd.pos.y = y;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.cid = CID_ClassLabel+off;
- gcd[k++].creator = GLabelCreate;
- harray[1] = &gcd[k-1]; harray[2] = GCD_Glue;
-
- label[k].image = &GIcon_up;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = x+100; gcd[k].gd.pos.y = y-3;
- gcd[k].gd.pos.height = 19;
- gcd[k].gd.flags = gg_visible|gg_utf8_popup;
- gcd[k].gd.handle_controlevent = KCD_Up;
- gcd[k].gd.popup_msg = (unichar_t *) _("Move selected class up");
- gcd[k].gd.cid = CID_ClassUp+off;
- gcd[k++].creator = GButtonCreate;
- harray[3] = &gcd[k-1];
-
- label[k].image = &GIcon_down;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = x+120; gcd[k].gd.pos.y = y-3;
- gcd[k].gd.pos.height = 19;
- gcd[k].gd.flags = gg_visible|gg_utf8_popup;
- gcd[k].gd.handle_controlevent = KCD_Down;
- gcd[k].gd.popup_msg = (unichar_t *) _("Move selected class down");
- gcd[k].gd.cid = CID_ClassDown+off;
- gcd[k++].creator = GButtonCreate;
- harray[4] = &gcd[k-1]; harray[5] = GCD_Glue; harray[6] = NULL;
-
- gcd[k].gd.flags = gg_enabled|gg_visible;
- gcd[k].gd.u.boxelements = harray;
- gcd[k++].creator = GHBoxCreate;
- varray[0] = &gcd[k-1];
-
- gcd[k].gd.pos.x = x; gcd[k].gd.pos.y = y+17;
- gcd[k].gd.pos.width = width;
- gcd[k].gd.pos.height = 8*12+10;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_list_multiplesel;
- gcd[k].gd.handle_controlevent = KCD_ClassSelected;
- gcd[k].gd.cid = CID_ClassList+off;
- gcd[k++].creator = GListCreate;
- varray[1] = &gcd[k-1];
-
- label[k].text = (unichar_t *) S_("Class|New...");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = x; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+gcd[k-1].gd.pos.height+10;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.handle_controlevent = KCD_New;
- gcd[k].gd.cid = CID_ClassNew+off;
- gcd[k++].creator = GButtonCreate;
- harray[7] = &gcd[k-1]; harray[8] = GCD_Glue;
-
- label[k].text = (unichar_t *) _("Edit...");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = x+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = KCD_Edit;
- gcd[k].gd.cid = CID_ClassEdit+off;
- gcd[k++].creator = GButtonCreate;
- harray[9] = &gcd[k-1]; harray[10] = GCD_Glue;
-
- label[k].text = (unichar_t *) _("Delete");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+blen+space; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible;
- gcd[k].gd.handle_controlevent = KCD_Delete;
- gcd[k].gd.cid = CID_ClassDel+off;
- gcd[k++].creator = GButtonCreate;
- harray[11] = &gcd[k-1]; harray[12] = NULL;
-
- gcd[k].gd.flags = gg_enabled|gg_visible;
- gcd[k].gd.u.boxelements = harray+7;
- gcd[k++].creator = GHBoxCreate;
- varray[2] = &gcd[k-1];
-
-/* GT: Select the class containing the glyph named in the following text field */
- label[k].text = (unichar_t *) _("Select Glyph Class:");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = gcd[k-3].gd.pos.x+5; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+26+4;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.popup_msg = (unichar_t *) _("Select the class containing the named glyph");
- gcd[k++].creator = GLabelCreate;
- harray[13] = &gcd[k-1];
-
- gcd[k].gd.pos.x = gcd[k-1].gd.pos.x+100; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
- gcd[k].gd.pos.width = 80;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.popup_msg = (unichar_t *) _("Select the class containing the named glyph");
- gcd[k].gd.handle_controlevent = KCD_TextSelect;
- gcd[k].gd.cid = CID_ClassSelect+off;
- gcd[k++].creator = GTextFieldCreate;
- harray[14] = &gcd[k-1]; harray[15] = NULL;
-
- gcd[k].gd.flags = gg_enabled|gg_visible;
- gcd[k].gd.u.boxelements = harray+13;
- gcd[k++].creator = GHBoxCreate;
- varray[3] = &gcd[k-1]; varray[4] = NULL;
-
- gcd[k].gd.flags = gg_enabled|gg_visible;
- gcd[k].gd.u.boxelements = varray;
- gcd[k++].creator = GVBoxCreate;
-
-return( k );
-}
-
-static void FillShowKerningWindow(KernClassDlg *kcd, int for_class, SplineFont *sf) {
- GGadgetCreateData gcd[30], hbox, flagbox, hvbox, buttonbox, mainbox[2];
- GGadgetCreateData *harray[10], *hvarray[14], *flagarray[4], *buttonarray[9], *varray[12];
- GTextInfo label[30];
- int k,j;
- char buffer[20];
- GRect pos;
-
- kcd->top = GDrawPointsToPixels(kcd->gw,100);
- kcd->pixelsize = 150;
- kcd->magfactor = 1;
-
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
- memset(&hbox,0,sizeof(hbox));
- memset(&flagbox,0,sizeof(flagbox));
- memset(&hvbox,0,sizeof(hvbox));
- memset(&buttonbox,0,sizeof(buttonbox));
- memset(&mainbox,0,sizeof(mainbox));
- k = j = 0;
-
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = 5;
- gcd[k].gd.pos.width = 120;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- gcd[k].gd.handle_controlevent = KCD_GlyphSelected;
- gcd[k].gd.cid = CID_First;
- gcd[k++].creator = for_class ? GListButtonCreate : GTextFieldCreate;
- harray[0] = &gcd[k-1];
-
- gcd[k].gd.pos.x = 130; gcd[k].gd.pos.y = 5;
- gcd[k].gd.pos.width = 120;
- gcd[k].gd.flags = gg_visible | gg_enabled;
- if ( !for_class ) gcd[k].gd.flags |= gg_list_alphabetic;
- gcd[k].gd.handle_controlevent = KCD_GlyphSelected;
- gcd[k].gd.cid = CID_Second;
- gcd[k++].creator = for_class ? GListButtonCreate : GListFieldCreate;
- harray[1] = &gcd[k-1];
-
- label[k].text = (unichar_t *) _("Use FreeType");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 260; gcd[k].gd.pos.y = 7;
- if ( !hasFreeType() )
- gcd[k].gd.flags = gg_visible;
- else
- gcd[k].gd.flags = gg_enabled|gg_visible|gg_cb_on;
- gcd[k].gd.cid = CID_FreeType;
- gcd[k].gd.handle_controlevent = KCB_FreeTypeChanged;
- gcd[k++].creator = GCheckBoxCreate;
- harray[2] = GCD_Glue; harray[3] = &gcd[k-1];
- harray[4] = GCD_Glue; harray[5] = GCD_Glue;
- harray[6] = GCD_Glue; harray[7] = GCD_Glue; harray[8] = NULL;
-
- hbox.gd.flags = gg_enabled|gg_visible;
- hbox.gd.u.boxelements = harray;
- hbox.creator = GHBoxCreate;
- varray[j++] = &hbox; varray[j++] = NULL;
-
- label[k].text = (unichar_t *) _("Display Size:");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 30; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k++].creator = GLabelCreate;
- hvarray[0] = &gcd[k-1];
-
- sprintf( buffer, "%d", kcd->pixelsize );
- label[k].text = (unichar_t *) buffer;
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 92; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
- gcd[k].gd.pos.width = 80;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k].gd.cid = CID_DisplaySize;
- gcd[k].gd.handle_controlevent = KCD_DisplaySizeChanged;
-#ifndef FONTFORGE_CONFIG_DEVICETABLES
- gcd[k++].creator = GTextFieldCreate;
-#else
- gcd[k++].creator = GListFieldCreate;
-#endif
- hvarray[1] = &gcd[k-1];
-
- label[k].text = (unichar_t *) _("Magnification:");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 185; gcd[k].gd.pos.y = gcd[k-2].gd.pos.y;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k++].creator = GLabelCreate;
- hvarray[2] = &gcd[k-1];
-
-#ifndef FONTFORGE_CONFIG_DEVICETABLES
- gcd[k].gd.pos.x = 255; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
-#else
- gcd[k].gd.pos.x = 305; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
-#endif
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k].gd.cid = CID_Magnifications;
- gcd[k].gd.u.list = magnifications;
- gcd[k].gd.handle_controlevent = KCD_MagnificationChanged;
- gcd[k++].creator = GListButtonCreate;
- hvarray[3] = &gcd[k-1]; hvarray[4] = GCD_Glue; hvarray[5] = NULL;
-
- label[k].text = (unichar_t *) _("Kern Offset:");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 30; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y+30;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k++].creator = GLabelCreate;
- hvarray[6] = &gcd[k-1];
-
- gcd[k].gd.pos.x = 90; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
- gcd[k].gd.pos.width = 60;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k].gd.cid = CID_KernOffset;
- gcd[k].gd.handle_controlevent = KCD_KernOffChanged;
- gcd[k++].creator = GTextFieldCreate;
- hvarray[7] = &gcd[k-1];
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- label[k].text = (unichar_t *) _("Device Table Correction:");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 185; gcd[k].gd.pos.y = gcd[k-2].gd.pos.y;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k++].creator = GLabelCreate;
- hvarray[8] = &gcd[k-1];
-
- label[k].text = (unichar_t *) "0";
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 305; gcd[k].gd.pos.y = gcd[k-1].gd.pos.y-4;
- gcd[k].gd.pos.width = 60;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- gcd[k].gd.cid = CID_Correction;
- gcd[k].gd.handle_controlevent = KCD_CorrectionChanged;
- gcd[k++].creator = GTextFieldCreate;
- hvarray[9] = &gcd[k-1];
-#else
- hvarray[8] = GCD_Glue;
- hvarray[9] = GCD_Glue;
-#endif
- hvarray[10] = GCD_Glue;
- hvarray[11] = NULL; hvarray[12] = NULL;
-
- hvbox.gd.flags = gg_enabled|gg_visible;
- hvbox.gd.u.boxelements = hvarray;
- hvbox.creator = GHVBoxCreate;
- varray[j++] = &hvbox; varray[j++] = NULL;
-
- varray[j++] = GCD_Glue; varray[j++] = NULL;
-
- GDrawGetSize(kcd->kw,&pos);
-
- if ( !for_class ) {
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = -40;
- gcd[k].gd.flags = gg_enabled ;
- label[k].text = (unichar_t *) _("Lookup subtable:");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k++].creator = GLabelCreate;
- flagarray[0] = &gcd[k-1];
-
- gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = KC_Height-KC_CANCELDROP-27;
- gcd[k].gd.pos.width = GDrawPixelsToPoints(kcd->kw,pos.width)-20;
- gcd[k].gd.flags = gg_enabled|gg_visible;
- gcd[k].gd.cid = CID_Subtable;
- gcd[k].gd.handle_controlevent = KP_Subtable;
- gcd[k++].creator = GListButtonCreate;
- flagarray[1] = &gcd[k-1]; flagarray[2] = GCD_Glue; flagarray[3] = NULL;
-
- flagbox.gd.flags = gg_enabled|gg_visible;
- flagbox.gd.u.boxelements = flagarray;
- flagbox.creator = GHBoxCreate;
- varray[j++] = &flagbox; varray[j++] = NULL;
- }
-
- label[k].text = (unichar_t *) (for_class ? _("< _Prev") : _("_OK"));
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 30; gcd[k].gd.pos.y = KC_Height-KC_CANCELDROP;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible|gg_enabled;
- if ( !for_class ) gcd[k].gd.flags |= gg_but_default;
- gcd[k].gd.handle_controlevent = for_class ? KCD_Prev2 : KPD_OK;
- gcd[k].gd.cid = CID_Prev2;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) (for_class ? _("_Next >") : _("_Cancel"));
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = -30+3; gcd[k].gd.pos.y = KC_Height-KC_CANCELDROP;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible|gg_enabled ;
- if ( !for_class ) gcd[k].gd.flags |= gg_but_cancel;
- gcd[k].gd.handle_controlevent = for_class ? KCD_Next2 : KPD_Cancel;
- gcd[k].gd.cid = CID_Next2;
- gcd[k++].creator = GButtonCreate;
-
- buttonarray[0] = GCD_Glue; buttonarray[1] = &gcd[k-2]; buttonarray[2] = GCD_Glue;
- buttonarray[3] = GCD_Glue; buttonarray[4] = &gcd[k-1]; buttonarray[5] = GCD_Glue;
- buttonarray[6] = NULL;
- buttonbox.gd.flags = gg_enabled|gg_visible;
- buttonbox.gd.u.boxelements = buttonarray;
- buttonbox.creator = GHBoxCreate;
- varray[j++] = &buttonbox; varray[j++] = NULL; varray[j++] = NULL;
-
- mainbox[0].gd.pos.x = mainbox[0].gd.pos.y = 2;
- mainbox[0].gd.flags = gg_enabled|gg_visible;
- mainbox[0].gd.u.boxelements = varray;
- mainbox[0].creator = GHVGroupCreate;
-
- GGadgetsCreate(kcd->kw,mainbox);
-
- GHVBoxSetExpandableRow(mainbox[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(hbox.ret,gb_expandglue);
- GHVBoxSetExpandableCol(hvbox.ret,gb_expandglue);
- GHVBoxSetExpandableCol(buttonbox.ret,gb_expandgluesame);
- if ( !for_class ) {
- GHVBoxSetExpandableCol(flagbox.ret,gb_expandglue);
- GGadgetSetList(flagarray[1]->ret,SFSubtablesOfType(sf,gpos_pair,false),false);
- }
-}
-#endif
-
-void KernClassD(KernClass *kc, SplineFont *sf, int isv) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- GRect pos, subpos;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[46], classbox, hvbox, buttonbox, mainbox[2];
- GGadgetCreateData selbox, *selarray[7], pane2[2];
- GGadgetCreateData *harray1[17], *harray2[17], *varray1[5], *varray2[5];
- GGadgetCreateData *hvarray[13], *buttonarray[8], *varray[15], *harrayclasses[6];
- GTextInfo label[46];
- KernClassDlg *kcd;
- int i, kc_width, vi, y, k;
- static unichar_t courier[] = { 'c', 'o', 'u', 'r', 'i', 'e', 'r', ',', 'm','o','n','o','s','p','a','c','e',',','c','l','e','a','r','l','y','u',',', 'u','n','i','f','o','n','t', '\0' };
- int as, ds, ld, sbsize;
- FontRequest rq;
- static unichar_t kernw[] = { '-', '1', '2', '3', '4', '5', 0 };
- GWindow gw;
- char titlebuf[300];
-
- for ( kcd = sf->kcd; kcd!=NULL && kcd->orig!=kc; kcd = kcd->next );
- if ( kcd!=NULL ) {
- GDrawSetVisible(kcd->gw,true);
- GDrawRaise(kcd->gw);
-return;
- }
- kcd = gcalloc(1,sizeof(KernClassDlg));
- kcd->orig = kc;
- kcd->subtable = kc->subtable;
- kcd->sf = sf;
- kcd->isv = isv;
- kcd->next = sf->kcd;
- sf->kcd = kcd;
-
- kcd->first_cnt = kc->first_cnt;
- kcd->second_cnt = kc->second_cnt;
- kcd->offsets = galloc(kc->first_cnt*kc->second_cnt*sizeof(int16));
- memcpy(kcd->offsets,kc->offsets,kc->first_cnt*kc->second_cnt*sizeof(int16));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- kcd->adjusts = galloc(kc->first_cnt*kc->second_cnt*sizeof(DeviceTable));
- memcpy(kcd->adjusts,kc->adjusts,kc->first_cnt*kc->second_cnt*sizeof(DeviceTable));
- for ( i=0; i<kcd->first_cnt*kcd->second_cnt; ++i ) {
- if ( kcd->adjusts[i].corrections!=NULL ) {
- int len = kcd->adjusts[i].last_pixel_size-kcd->adjusts[i].first_pixel_size+1;
- kcd->adjusts[i].corrections = galloc(len);
- memcpy(kcd->adjusts[i].corrections,kc->adjusts[i].corrections,len);
- }
- }
-#endif
-
- memset(&wattrs,0,sizeof(wattrs));
- memset(&gcd,0,sizeof(gcd));
- memset(&classbox,0,sizeof(classbox));
- memset(&hvbox,0,sizeof(hvbox));
- memset(&buttonbox,0,sizeof(buttonbox));
- memset(&mainbox,0,sizeof(mainbox));
- memset(&label,0,sizeof(label));
-
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = false;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
-/* GT: The %s is the name of the lookup subtable containing this kerning class */
- snprintf( titlebuf, sizeof(titlebuf), _("Kerning by Classes: %s"), kc->subtable->subtable_name );
- wattrs.utf8_window_title = titlebuf ;
- wattrs.is_dlg = false;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,KC_Width));
- pos.height = GDrawPointsToPixels(NULL,KC_Height);
- kcd->gw = gw = GDrawCreateTopWindow(NULL,&pos,kcd_e_h,kcd,&wattrs);
-
- kc_width = GDrawPixelsToPoints(NULL,pos.width*100/GGadgetScale(100));
-
- memset(&rq,'\0',sizeof(rq));
- rq.point_size = 12;
- rq.weight = 400;
- rq.family_name = courier;
- kcd->font = GDrawInstanciateFont(GDrawGetDisplayOfWindow(gw),&rq);
- GDrawFontMetrics(kcd->font,&as,&ds,&ld);
- kcd->fh = as+ds; kcd->as = as;
- GDrawSetFont(gw,kcd->font);
-
- kcd->kernh = kcd->fh+3;
- kcd->kernw = GDrawGetTextWidth(gw,kernw,-1,NULL)+3;
-
- i = 0;
- snprintf( titlebuf, sizeof(titlebuf), _("Lookup Subtable: %s"), kc->subtable->subtable_name );
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = 5;
- gcd[i].gd.flags = gg_visible | gg_enabled;
- label[i].text = (unichar_t *) titlebuf;
- label[i].text_is_1byte = true;
- gcd[i].gd.label = &label[i];
- gcd[i++].creator = GLabelCreate;
- varray[0] = &gcd[i-1]; varray[1] = NULL;
-
- gcd[i].gd.pos.x = 10; gcd[i].gd.pos.y = GDrawPointsToPixels(gw,gcd[i-1].gd.pos.y+17);
- gcd[i].gd.pos.width = pos.width-20;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_pos_in_pixels;
- gcd[i++].creator = GLineCreate;
- varray[2] = &gcd[i-1]; varray[3] = NULL;
-
- y = gcd[i-2].gd.pos.y+23;
- i = AddClassList(gcd,label,i,0,5,y,(kc_width-20)/2,harray1,varray1);
- harrayclasses[0] = &gcd[i-1];
- i = AddClassList(gcd,label,i,100,(kc_width-20)/2+10,y,(kc_width-20)/2,harray2,varray2);
- harrayclasses[2] = &gcd[i-1]; harrayclasses[3] = NULL;
-
- gcd[i].gd.pos.height = 20;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_line_vert;
- gcd[i++].creator = GLineCreate;
- harrayclasses[1] = &gcd[i-1];
-
- classbox.gd.flags = gg_enabled|gg_visible;
- classbox.gd.u.boxelements = harrayclasses;
- classbox.creator = GHBoxCreate;
- varray[4] = &classbox; varray[5] = NULL;
-
- gcd[i].gd.pos.x = 10; gcd[i].gd.pos.y = GDrawPointsToPixels(gw,gcd[i-1].gd.pos.y+27);
- gcd[i].gd.pos.width = pos.width-20;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_pos_in_pixels;
- gcd[i++].creator = GLineCreate;
- varray[6] = &gcd[i-1]; varray[7] = NULL;
-
- kcd->canceldrop = GDrawPointsToPixels(gw,KC_CANCELDROP);
- kcd->sbdrop = kcd->canceldrop+GDrawPointsToPixels(gw,7);
- gcd[i].gd.pos.width = kcd->kernw;
- gcd[i].gd.pos.height = kcd->kernh;
- gcd[i].gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels;
- gcd[i++].creator = GSpacerCreate;
- hvarray[0] = &gcd[i-1]; hvarray[1] = GCD_Glue; hvarray[2] = GCD_Glue; hvarray[3] = NULL;
-
- gcd[i].gd.pos.width = kcd->kernw;
- gcd[i].gd.pos.height = 4*kcd->kernh;
- gcd[i].gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels;
- gcd[i++].creator = GSpacerCreate;
-
- vi = i;
- gcd[i].gd.pos.width = sbsize = GDrawPointsToPixels(gw,_GScrollBar_Width);
- gcd[i].gd.pos.x = pos.width-sbsize;
- gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+8;
- gcd[i].gd.pos.height = pos.height-gcd[i].gd.pos.y-sbsize-kcd->sbdrop;
- gcd[i].gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels|gg_sb_vert;
- gcd[i++].creator = GScrollBarCreate;
- hvarray[4] = &gcd[i-2]; hvarray[5] = GCD_Glue; hvarray[6] = &gcd[i-1]; hvarray[7] = NULL;
-
- gcd[i].gd.pos.height = sbsize;
- gcd[i].gd.pos.y = pos.height-sbsize-8;
- gcd[i].gd.pos.x = 4;
- gcd[i].gd.pos.width = pos.width-sbsize;
- gcd[i].gd.flags = gg_visible|gg_enabled|gg_pos_in_pixels;
- gcd[i++].creator = GScrollBarCreate;
- hvarray[8] = GCD_Glue; hvarray[9] = &gcd[i-1]; hvarray[10] = GCD_Glue; hvarray[11] = NULL;
- hvarray[12] = NULL;
- kcd->width = gcd[i-1].gd.pos.width;
- kcd->xstart = 5;
-
- hvbox.gd.flags = gg_enabled|gg_visible;
- hvbox.gd.u.boxelements = hvarray;
- hvbox.creator = GHVBoxCreate;
- varray[8] = &hvbox; varray[9] = NULL;
-
- gcd[i].gd.pos.x = 10; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+24+3;
- gcd[i].gd.pos.width = -1;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_OK");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.handle_controlevent = KC_OK;
- gcd[i].gd.cid = CID_OK;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = -10; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
- gcd[i].gd.pos.width = -1;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.handle_controlevent = KC_Cancel;
- gcd[i].gd.cid = CID_Cancel;
- gcd[i++].creator = GButtonCreate;
-
- buttonarray[0] = GCD_Glue; buttonarray[1] = &gcd[i-2]; buttonarray[2] = GCD_Glue;
- buttonarray[3] = GCD_Glue; buttonarray[4] = &gcd[i-1]; buttonarray[5] = GCD_Glue;
- buttonarray[6] = NULL;
- buttonbox.gd.flags = gg_enabled|gg_visible;
- buttonbox.gd.u.boxelements = buttonarray;
- buttonbox.creator = GHBoxCreate;
- varray[10] = &buttonbox; varray[11] = NULL; varray[12] = NULL;
-
- mainbox[0].gd.pos.x = mainbox[0].gd.pos.y = 2;
- mainbox[0].gd.flags = gg_enabled|gg_visible;
- mainbox[0].gd.u.boxelements = varray;
- mainbox[0].creator = GHVGroupCreate;
-
- GGadgetsCreate(kcd->gw,mainbox);
- kcd->vsb = gcd[vi].ret;
- kcd->hsb = gcd[vi+1].ret;
-
- GHVBoxSetExpandableRow(mainbox[0].ret,4);
-
- GHVBoxSetExpandableCol(buttonbox.ret,gb_expandgluesame);
-
- GHVBoxSetPadding(hvbox.ret,0,0);
- GHVBoxSetExpandableRow(hvbox.ret,1);
- GHVBoxSetExpandableCol(hvbox.ret,1);
-
- for ( i=0; i<2; ++i ) {
- GGadgetCreateData *box = harrayclasses[2*i], **boxarray = box->gd.u.boxelements;
- GHVBoxSetExpandableRow(box->ret,1);
- GHVBoxSetExpandableCol(boxarray[0]->ret,gb_expandglue);
- GHVBoxSetExpandableCol(boxarray[2]->ret,gb_expandgluesame);
- GHVBoxSetExpandableCol(boxarray[3]->ret,1);
- }
-
- for ( i=0; i<2; ++i ) {
- GGadget *list = GWidgetGetControl(kcd->gw,CID_ClassList+i*100);
- if ( i==0 && kcd->orig!=NULL && kcd->orig->firsts!=NULL && kcd->orig->firsts[0]!=NULL ) {
- /* OpenType can set class 0 of the first classes by using a coverage*/
- /* table with more glyphs than are present in all the other classes */
- unichar_t *temp = uc_copy(kcd->orig->firsts[0]);
- GListAppendLine(list,temp,false);
- free(temp);
- } else
- GListAppendLine8(list,_("{Everything Else}"),false);
- if ( kcd->orig!=NULL ) {
- for ( k=1; k<(&kcd->first_cnt)[i]; ++k ) {
- unichar_t *temp = uc_copy((&kcd->orig->firsts)[i][k]);
- GListAppendLine(list,temp,false);
- free(temp);
- }
- }
- }
-
- wattrs.mask = wam_events;
- subpos = pos; subpos.x = subpos.y = 0;
- kcd->cw = GWidgetCreateSubWindow(kcd->gw,&subpos,subkcd_e_h,kcd,&wattrs);
-
- memset(&selbox,0,sizeof(selbox));
- memset(&buttonbox,0,sizeof(buttonbox));
- memset(pane2,0,sizeof(pane2));
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
- k = 0;
-
- label[k].text = (unichar_t *) _("Set From Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = 5;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set this glyph list to be the characters selected in the fontview");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = KCD_FromSelection;
- gcd[k].gd.cid = CID_Set;
- gcd[k++].creator = GButtonCreate;
- selarray[0] = &gcd[k-1]; selarray[1] = GCD_Glue;
-
- label[k].text = (unichar_t *) _("Select In Font");
- label[k].text_is_1byte = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 110; gcd[k].gd.pos.y = 5;
- gcd[k].gd.popup_msg = (unichar_t *) _("Set the fontview's selection to be the characters named here");
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- gcd[k].gd.handle_controlevent = KCD_ToSelection;
- gcd[k].gd.cid = CID_Select;
- gcd[k++].creator = GButtonCreate;
- selarray[2] = &gcd[k-1]; selarray[3] = GCD_Glue;
- selarray[4] = GCD_Glue; selarray[5] = GCD_Glue; selarray[6] = NULL;
-
- selbox.gd.flags = gg_enabled|gg_visible;
- selbox.gd.u.boxelements = selarray;
- selbox.creator = GHBoxCreate;
- varray[0] = &selbox; varray[1] = NULL;
-
- gcd[k].gd.pos.x = 5; gcd[k].gd.pos.y = 30;
- gcd[k].gd.pos.width = KC_Width-25; gcd[k].gd.pos.height = 8*13+4;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_textarea_wrap;
- gcd[k].gd.cid = CID_GlyphList;
- gcd[k++].creator = GTextAreaCreate;
- varray[2] = &gcd[k-1]; varray[3] = NULL;
- varray[4] = GCD_Glue; varray[5] = NULL;
-
- label[k].text = (unichar_t *) _("< _Prev");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = 30; gcd[k].gd.pos.y = KC_Height-KC_CANCELDROP;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible|gg_enabled /*| gg_but_cancel*/;
- gcd[k].gd.handle_controlevent = KCD_Prev;
- gcd[k].gd.cid = CID_Prev;
- gcd[k++].creator = GButtonCreate;
-
- label[k].text = (unichar_t *) _("_Next >");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.pos.x = -30+3; gcd[k].gd.pos.y = KC_Height-KC_CANCELDROP;
- gcd[k].gd.pos.width = -1;
- gcd[k].gd.flags = gg_visible|gg_enabled /*| gg_but_default*/;
- gcd[k].gd.handle_controlevent = KCD_Next;
- gcd[k].gd.cid = CID_Next;
- gcd[k++].creator = GButtonCreate;
-
- buttonarray[0] = GCD_Glue; buttonarray[1] = &gcd[k-2]; buttonarray[2] = GCD_Glue;
- buttonarray[3] = GCD_Glue; buttonarray[4] = &gcd[k-1]; buttonarray[5] = GCD_Glue;
- buttonarray[6] = NULL;
- buttonbox.gd.flags = gg_enabled|gg_visible;
- buttonbox.gd.u.boxelements = buttonarray;
- buttonbox.creator = GHBoxCreate;
- varray[6] = &buttonbox; varray[7] = NULL; varray[8] = NULL;
-
- pane2[0].gd.pos.x = pane2[0].gd.pos.y = 2;
- pane2[0].gd.flags = gg_enabled|gg_visible;
- pane2[0].gd.u.boxelements = varray;
- pane2[0].creator = GHVGroupCreate;
-
- GGadgetsCreate(kcd->cw,pane2);
-
- GHVBoxSetExpandableRow(pane2[0].ret,gb_expandglue);
- GHVBoxSetExpandableCol(selbox.ret,gb_expandglue);
- GHVBoxSetExpandableCol(buttonbox.ret,gb_expandgluesame);
-
-
- kcd->kw = GWidgetCreateSubWindow(kcd->gw,&subpos,subkern_e_h,kcd,&wattrs);
- FillShowKerningWindow(kcd, true, kcd->sf);
-
- GHVBoxFitWindow(mainbox[0].ret);
- GDrawSetVisible(kcd->gw,true);
-#endif
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-static int KCL_New(GGadget *g, GEvent *e) {
- KernClassListDlg *kcld;
- struct subtable_data sd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- kcld = GDrawGetUserData(GGadgetGetWindow(g));
- memset(&sd,0,sizeof(sd));
- sd.flags = (kcld->isv ? sdf_verticalkern : sdf_horizontalkern ) |
- sdf_kernclass;
- SFNewLookupSubtableOfType(kcld->sf,gpos_pair,&sd);
- }
-return( true );
-}
-
-static int KCL_Delete(GGadget *g, GEvent *e) {
- int32 len; int i,j;
- GTextInfo **old, **new;
- GGadget *list;
- KernClassListDlg *kcld;
- KernClassDlg *kcd;
- KernClass *p, *kc, *n;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- kcld = GDrawGetUserData(GGadgetGetWindow(g));
- list = GWidgetGetControl(kcld->gw,CID_List);
- old = GGadgetGetList(list,&len);
- new = gcalloc(len+1,sizeof(GTextInfo *));
- p = NULL; kc = kcld->isv ? kcld->sf->vkerns : kcld->sf->kerns;
- for ( i=j=0; i<len; ++i, kc = n ) {
- n = kc->next;
- if ( !old[i]->selected ) {
- new[j] = galloc(sizeof(GTextInfo));
- *new[j] = *old[i];
- new[j]->text = u_copy(new[j]->text);
- ++j;
- p = kc;
- } else {
- if ( p!=NULL )
- p->next = n;
- else if ( kcld->isv )
- kcld->sf->vkerns = n;
- else
- kcld->sf->kerns = n;
- kc->next = NULL;
- for ( kcd=kcld->sf->kcd; kcd!=NULL && kcd->orig!=kc; kcd=kcd->next );
- if ( kcd!=NULL )
- KC_DoCancel(kcd);
- KernClassListFree(kc);
- }
- }
- new[j] = gcalloc(1,sizeof(GTextInfo));
- GGadgetSetList(list,new,false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Delete),false);
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_Edit),false);
- }
-return( true );
-}
-
-static int KCL_Edit(GGadget *g, GEvent *e) {
- int sel, i;
- KernClassListDlg *kcld;
- KernClass *kc;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- kcld = GDrawGetUserData(GGadgetGetWindow(g));
- sel = GGadgetGetFirstListSelectedItem(GWidgetGetControl(GGadgetGetWindow(g),CID_List));
- if ( sel==-1 )
-return( true );
- for ( kc=kcld->isv?kcld->sf->vkerns:kcld->sf->kerns, i=0; i<sel; kc=kc->next, ++i );
- KernClassD(kc,kcld->sf,kcld->isv);
- }
-return( true );
-}
-
-static int KCL_Done(GGadget *g, GEvent *e) {
- KernClassListDlg *kcld;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- kcld = GDrawGetUserData(GGadgetGetWindow(g));
- GDrawDestroyWindow(kcld->gw);
- }
-return( true );
-}
-
-static int KCL_SelChanged(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- KernClassListDlg *kcld = GDrawGetUserData(GGadgetGetWindow(g));
- int sel = GGadgetGetFirstListSelectedItem(g);
- GGadgetSetEnabled(GWidgetGetControl(kcld->gw,CID_Delete),sel!=-1);
- GGadgetSetEnabled(GWidgetGetControl(kcld->gw,CID_Edit),sel!=-1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- KernClassListDlg *kcld = GDrawGetUserData(GGadgetGetWindow(g));
- e->u.control.subtype = et_buttonactivate;
- e->u.control.g = GWidgetGetControl(kcld->gw,CID_Edit);
- KCL_Edit(e->u.control.g,e);
- }
-return( true );
-}
-
-static int kcl_e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- KernClassListDlg *kcld = GDrawGetUserData(gw);
- GDrawDestroyWindow(kcld->gw);
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("metricsview.html#kernclass");
-return( true );
- }
-return( false );
- } else if ( event->type == et_destroy ) {
- KernClassListDlg *kcld = GDrawGetUserData(gw);
- if ( kcld->isv )
- kcld->sf->vkcld = NULL;
- else
- kcld->sf->kcld = NULL;
- free(kcld);
- }
-return( true );
-}
-
-void ShowKernClasses(SplineFont *sf,MetricsView *mv,int isv) {
- KernClassListDlg *kcld;
- GRect pos;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[7], boxes[4], *varray[10], *harray[9], *harray2[5];
- GTextInfo label[7];
- int kcl_width = KCL_Width, temp;
-
- if ( sf->kcld && !isv ) {
- GDrawSetVisible(sf->kcld->gw,true);
- GDrawRaise(sf->kcld->gw);
-return;
- } else if ( sf->vkcld && isv ) {
- GDrawSetVisible(sf->vkcld->gw,true);
- GDrawRaise(sf->vkcld->gw);
-return;
- }
-
- kcld = gcalloc(1,sizeof(KernClassListDlg));
- kcld->sf = sf;
- kcld->isv = isv;
- if ( isv )
- sf->vkcld = kcld;
- else
- sf->kcld = kcld;
-
- memset(&wattrs,0,sizeof(wattrs));
- memset(&gcd,0,sizeof(gcd));
- memset(&label,0,sizeof(label));
- memset(boxes,0,sizeof(boxes));
-
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = false;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = isv?_("VKern By Classes..."):_("Kern By Classes...");
- wattrs.is_dlg = false;
- pos.x = pos.y = 0;
- temp = 40 + 300*GIntGetResource(_NUM_Buttonsize)/GGadgetScale(100);
- if ( kcl_width<temp ) kcl_width = temp;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,kcl_width));
- pos.height = GDrawPointsToPixels(NULL,KCL_Height);
- kcld->gw = GDrawCreateTopWindow(NULL,&pos,kcl_e_h,kcld,&wattrs);
-
- gcd[0].gd.pos.x = 5; gcd[0].gd.pos.y = 5;
- gcd[0].gd.pos.width = kcl_width-10; gcd[0].gd.pos.height = 7*12+10;
- gcd[0].gd.flags = gg_visible | gg_enabled | gg_list_multiplesel;
- gcd[0].gd.cid = CID_List;
- gcd[0].gd.u.list = KCLookupSubtableList(sf,isv);
- gcd[0].gd.handle_controlevent = KCL_SelChanged;
- gcd[0].creator = GListCreate;
- varray[0] = &gcd[0]; varray[1] = NULL;
-
- gcd[1].gd.pos.x = 10; gcd[1].gd.pos.y = gcd[0].gd.pos.y+gcd[0].gd.pos.height+4;
- gcd[1].gd.flags = gg_visible | gg_enabled;
- label[1].text = (unichar_t *) S_("KernClass|_New Lookup...");
- label[1].text_is_1byte = true;
- label[1].text_in_resource = true;
- gcd[1].gd.label = &label[1];
- gcd[1].gd.cid = CID_New;
- gcd[1].gd.handle_controlevent = KCL_New;
- gcd[1].creator = GButtonCreate;
- harray[0] = GCD_Glue; harray[1] = &gcd[1];
-
- gcd[2].gd.pos.x = 20+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor); gcd[2].gd.pos.y = gcd[1].gd.pos.y;
- gcd[2].gd.flags = gg_visible;
- label[2].text = (unichar_t *) _("_Delete");
- label[2].text_is_1byte = true;
- label[2].text_in_resource = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.cid = CID_Delete;
- gcd[2].gd.handle_controlevent = KCL_Delete;
- gcd[2].creator = GButtonCreate;
- harray[2] = GCD_Glue; harray[3] = &gcd[2];
-
- gcd[3].gd.pos.x = -10; gcd[3].gd.pos.y = gcd[1].gd.pos.y;
- gcd[3].gd.pos.width = -1;
- gcd[3].gd.flags = gg_visible;
- label[3].text = (unichar_t *) _("_Edit...");
- label[3].text_is_1byte = true;
- label[3].text_in_resource = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.cid = CID_Edit;
- gcd[3].gd.handle_controlevent = KCL_Edit;
- gcd[3].creator = GButtonCreate;
- harray[4] = GCD_Glue; harray[5] = &gcd[3]; harray[6] = GCD_Glue; harray[7] = NULL;
-
- boxes[0].gd.flags = gg_enabled|gg_visible;
- boxes[0].gd.u.boxelements = harray;
- boxes[0].creator = GHBoxCreate;
- varray[2] = &boxes[0]; varray[3] = NULL;
-
- gcd[4].gd.pos.x = 10; gcd[4].gd.pos.y = gcd[1].gd.pos.y+28;
- gcd[4].gd.pos.width = kcl_width-20;
- gcd[4].gd.flags = gg_visible;
- gcd[4].creator = GLineCreate;
- varray[4] = &gcd[4]; varray[5] = NULL;
-
- gcd[5].gd.pos.x = (kcl_width-GIntGetResource(_NUM_Buttonsize))/2; gcd[5].gd.pos.y = gcd[4].gd.pos.y+7;
- gcd[5].gd.flags = gg_visible|gg_enabled|gg_but_default|gg_but_cancel;
- label[5].text = (unichar_t *) _("_Done");
- label[5].text_is_1byte = true;
- label[5].text_in_resource = true;
- gcd[5].gd.label = &label[5];
- gcd[5].gd.handle_controlevent = KCL_Done;
- gcd[5].creator = GButtonCreate;
- harray2[0] = GCD_Glue; harray2[1] = &gcd[5]; harray2[2] = GCD_Glue; harray2[3] = NULL;
-
- boxes[1].gd.flags = gg_enabled|gg_visible;
- boxes[1].gd.u.boxelements = harray2;
- boxes[1].creator = GHBoxCreate;
- varray[6] = &boxes[1]; varray[7] = NULL; varray[8] = NULL;
-
- boxes[2].gd.pos.x = boxes[0].gd.pos.y = 2;
- boxes[2].gd.flags = gg_enabled|gg_visible;
- boxes[2].gd.u.boxelements = varray;
- boxes[2].creator = GHVGroupCreate;
-
- GGadgetsCreate(kcld->gw,&boxes[2]);
- GHVBoxSetExpandableRow(boxes[2].ret,0);
- GHVBoxSetExpandableCol(boxes[0].ret,gb_expandgluesame);
- GHVBoxSetExpandableCol(boxes[1].ret,gb_expandgluesame);
- GDrawSetVisible(kcld->gw,true);
-}
-
-void KCLD_End(KernClassListDlg *kcld) {
- KernClassDlg *kcd, *kcdnext;
- for ( kcd= kcld->sf->kcd; kcd!=NULL; kcd=kcdnext ) {
- kcdnext = kcd->next;
- KC_DoCancel(kcd);
- }
- if ( kcld==NULL )
-return;
- GDrawDestroyWindow(kcld->gw);
-}
-
-void KCLD_MvDetach(KernClassListDlg *kcld,MetricsView *mv) {
- if ( kcld==NULL )
-return;
-}
-
-/* ************************************************************************** */
-/* *************************** Kern Pair Dialog **************************** */
-/* ************************************************************************** */
-
-void KernPairD(SplineFont *sf,SplineChar *sc1,SplineChar *sc2,int isv) {
- GRect pos;
- GWindowAttrs wattrs;
- KernClassDlg kcd;
- GWindow gw;
- int gid;
-
- if ( sc1==NULL ) {
- FontView *fv = sf->fv;
- int start = fv->rowoff*fv->colcnt, end = start+fv->rowcnt*fv->colcnt;
- int i;
- for ( i=start; i<end && i<fv->map->enccount; ++i )
- if ( (gid=fv->map->map[i])!=-1 && sf->glyphs[gid]!=NULL &&
- (isv ? sf->glyphs[gid]->vkerns : sf->glyphs[gid]->kerns)!=NULL )
- break;
- if ( i==end || i==fv->map->enccount ) {
- for ( i=0; i<fv->map->enccount; ++i )
- if ( (gid=fv->map->map[i])!=-1 && sf->glyphs[gid]!=NULL &&
- (isv ? sf->glyphs[gid]->vkerns : sf->glyphs[gid]->kerns)!=NULL )
- break;
- }
- if ( i==fv->map->enccount ) {
- for ( i=start; i<end && i<fv->map->enccount; ++i )
- if ( (gid=fv->map->map[i])!=-1 && sf->glyphs[gid]!=NULL )
- break;
- if ( i==end || i==fv->map->enccount ) {
- for ( i=0; i<fv->map->enccount; ++i )
- if ( (gid=fv->map->map[i])!=-1 && sf->glyphs[gid]!=NULL )
- break;
- }
- }
- if ( i!=fv->map->enccount )
- sc1 = sf->glyphs[gid];
- }
- if ( sc2==NULL && sc1!=NULL && (isv ? sc1->vkerns : sc1->kerns)!=NULL )
- sc2 = (isv ? sc1->vkerns : sc1->kerns)->sc;
-
- memset(&kcd,0,sizeof(kcd));
- kcd.sf = sf;
- kcd.scf = sc1;
- kcd.scs = sc2;
- kcd.isv = isv;
- kcd.iskernpair = true;
-
- memset(&wattrs,0,sizeof(wattrs));
-
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = true;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Kern Pair Closeup...");
- wattrs.is_dlg = true;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,KC_Width));
- pos.height = GDrawPointsToPixels(NULL,KC_Height);
- kcd.gw = gw = GDrawCreateTopWindow(NULL,&pos,kcd_e_h,&kcd,&wattrs);
- kcd.canceldrop = GDrawPointsToPixels(gw,KC_CANCELDROP);
-
-
- kcd.kw = gw;
- FillShowKerningWindow(&kcd, false, kcd.sf);
-
- if ( sc1!=NULL ) {
- unichar_t *utemp;
- GGadgetSetTitle(GWidgetGetControl(kcd.gw,CID_First),(utemp=uc_copy(sc1->name)));
- free(utemp);
- KPD_BuildKernList(&kcd);
- KCD_UpdateGlyph(&kcd,0);
- }
- if ( sc2!=NULL ) {
- unichar_t *utemp;
- GGadgetSetTitle(GWidgetGetControl(kcd.gw,CID_Second),(utemp=uc_copy(sc2->name)));
- free(utemp);
- KCD_UpdateGlyph(&kcd,1);
- KPD_PairSearch(&kcd);
- }
-
- GDrawSetVisible(kcd.gw,true);
- while ( !kcd.done )
- GDrawProcessOneEvent(NULL);
- GDrawSetUserData(kcd.gw,NULL);
- GDrawDestroyWindow(kcd.gw);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-int KernClassContains(KernClass *kc, char *name1, char *name2, int ordered ) {
- int infirst=0, insecond=0, scpos1=0, kwpos1=0, scpos2=0, kwpos2=0;
- int i;
-
- for ( i=1; i<kc->first_cnt; ++i ) {
- if ( PSTContains(kc->firsts[i],name1) ) {
- scpos1 = i;
- if ( ++infirst>=3 ) /* The name occurs twice??? */
- break;
- } else if ( PSTContains(kc->firsts[i],name2) ) {
- kwpos1 = i;
- if ( (infirst+=2)>=3 )
- break;
- }
- }
- if ( infirst==0 || infirst>3 )
-return( 0 );
- for ( i=1; i<kc->second_cnt; ++i ) {
- if ( PSTContains(kc->seconds[i],name1) ) {
- scpos2 = i;
- if ( ++insecond>=3 )
- break;
- } else if ( PSTContains(kc->seconds[i],name2) ) {
- kwpos2 = i;
- if ( (insecond+=2)>=3 )
- break;
- }
- }
- if ( insecond==0 || insecond>3 )
-return( 0 );
- if ( (infirst&1) && (insecond&2) ) {
- if ( kc->offsets[scpos1*kc->second_cnt+kwpos2]!=0 )
-return( kc->offsets[scpos1*kc->second_cnt+kwpos2] );
- }
- if ( !ordered ) {
- if ( (infirst&2) && (insecond&1) ) {
- if ( kc->offsets[kwpos1*kc->second_cnt+scpos2]!=0 )
-return( kc->offsets[kwpos1*kc->second_cnt+scpos2] );
- }
- }
-return( 0 );
-}
-
-/* ************************************************************************** */
-/* ******************************* kerning ****************************** */
-/* ************************************************************************** */
-
-static int KCFindName(char *name, char **classnames, int cnt ) {
- int i;
- char *pt, *end, ch;
-
- for ( i=0; i<cnt; ++i ) {
- if ( classnames[i]==NULL )
- continue;
- for ( pt = classnames[i]; *pt; pt=end+1 ) {
- end = strchr(pt,' ');
- if ( end==NULL ) end = pt+strlen(pt);
- ch = *end;
- *end = '\0';
- if ( strcmp(pt,name)==0 ) {
- *end = ch;
-return( i );
- }
- *end = ch;
- if ( ch=='\0' )
- break;
- }
- }
-return( 0 );
-}
-
-int KCFindIndex(KernClass *kc,char *name1, char *name2) {
- int f,l;
-
- f = KCFindName(name1,kc->firsts,kc->first_cnt);
- l = KCFindName(name2,kc->seconds,kc->second_cnt);
- if ( (f!=0 || kc->firsts[0]!=NULL) && l!=0 )
-return( f*kc->second_cnt+l );
-
-return( -1 );
-}
-
-KernClass *SFFindKernClass(SplineFont *sf,SplineChar *first,SplineChar *last,
- int *index,int allow_zero) {
- int i,f,l;
- KernClass *kc;
-
- for ( i=0; i<=allow_zero; ++i ) {
- for ( kc=sf->kerns; kc!=NULL; kc=kc->next ) {
- f = KCFindName(first->name,kc->firsts,kc->first_cnt);
- l = KCFindName(last->name,kc->seconds,kc->second_cnt);
- if ( (f!=0 || kc->firsts[0]!=NULL) && l!=0 ) {
- if ( i || kc->offsets[f*kc->second_cnt+l]!=0 ) {
- *index = f*kc->second_cnt+l;
-return( kc );
- }
- }
- }
- }
-return( NULL );
-}
-
-KernClass *SFFindVKernClass(SplineFont *sf,SplineChar *first,SplineChar *last,
- int *index,int allow_zero) {
- int i,f,l;
- KernClass *kc;
-
- for ( i=0; i<=allow_zero; ++i ) {
- for ( kc=sf->vkerns; kc!=NULL; kc=kc->next ) {
- f = KCFindName(first->name,kc->firsts,kc->first_cnt);
- l = KCFindName(last->name,kc->seconds,kc->second_cnt);
- if ( (f!=0 || kc->firsts[0]!=NULL) && l!=0 ) {
- if ( i || kc->offsets[f*kc->second_cnt+l]!=0 ) {
- *index = f*kc->second_cnt+l;
-return( kc );
- }
- }
- }
- }
-return( NULL );
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lff.opt b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lff.opt
deleted file mode 100644
index d8925e52fde..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lff.opt
+++ /dev/null
@@ -1 +0,0 @@
-[-.libs]libfontforge.exe/share
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lookups.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lookups.c
deleted file mode 100644
index 6ed72fe40af..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/lookups.c
+++ /dev/null
@@ -1,6916 +0,0 @@
-/* Copyright (C) 2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include <chardata.h>
-#include <utype.h>
-#include <ustring.h>
-#include <math.h>
-#include <locale.h>
-#include <stdlib.h>
-#include "ttf.h"
-#include <gkeysym.h>
-
-static int uint32_cmp(const void *_ui1, const void *_ui2) {
- if ( *(uint32 *) _ui1 > *(uint32 *)_ui2 )
-return( 1 );
- if ( *(uint32 *) _ui1 < *(uint32 *)_ui2 )
-return( -1 );
-
-return( 0 );
-}
-
-static int lang_cmp(const void *_ui1, const void *_ui2) {
- /* The default language is magic, and should come first in the list even */
- /* if that is not true alphabetical order */
- if ( *(uint32 *) _ui1 == DEFAULT_LANG )
-return( -1 );
- if ( *(uint32 *) _ui2 == DEFAULT_LANG )
-return( 1 );
-
- if ( *(uint32 *) _ui1 > *(uint32 *)_ui2 )
-return( 1 );
- if ( *(uint32 *) _ui1 < *(uint32 *)_ui2 )
-return( -1 );
-
-return( 0 );
-}
-
-int FeatureTagInFeatureScriptList(uint32 tag, FeatureScriptLangList *fl) {
-
- while ( fl!=NULL ) {
- if ( fl->featuretag==tag )
-return( true );
- fl = fl->next;
- }
-return( false );
-}
-
-int ScriptInFeatureScriptList(uint32 script, FeatureScriptLangList *fl) {
- struct scriptlanglist *sl;
-
- while ( fl!=NULL ) {
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- if ( sl->script == script )
-return( true );
- }
- fl = fl->next;
- }
-return( false );
-}
-
-int FeatureScriptTagInFeatureScriptList(uint32 feature, uint32 script, FeatureScriptLangList *fl) {
- struct scriptlanglist *sl;
-
- while ( fl!=NULL ) {
- if ( fl->featuretag == feature ) {
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- if ( sl->script == script )
-return( true );
- }
- }
- fl = fl->next;
- }
-return( false );
-}
-
-int DefaultLangTagInOneScriptList(struct scriptlanglist *sl) {
- int l;
-
- for ( l=0; l<sl->lang_cnt; ++l ) {
- uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
- if ( lang==DEFAULT_LANG )
-return( true );
- }
-return( false );
-}
-
-struct scriptlanglist *DefaultLangTagInScriptList(struct scriptlanglist *sl, int DFLT_ok) {
-
- while ( sl!=NULL ) {
- if ( DFLT_ok || sl->script!=DEFAULT_SCRIPT ) {
- if ( DefaultLangTagInOneScriptList(sl))
-return( sl );
- }
- sl = sl->next;
- }
-return( NULL );
-}
-
-uint32 *SFScriptsInLookups(SplineFont *sf,int gpos) {
- /* Presumes that either SFFindUnusedLookups or SFFindClearUnusedLookupBits */
- /* has been called first */
- /* Since MS will sometimes ignore a script if it isn't found in both */
- /* GPOS and GSUB we want to return the same script list no matter */
- /* what the setting of gpos ... so we totally ignore that argument */
- /* and always look at both sets of lookups */
-
-/* Sergey Malkin from MicroSoft tells me:
- Each shaping engine in Uniscribe can decide on its requirements for
- layout tables - some of them require both GSUB and GPOS, in some cases
- any table present is enough, or it can work without any table.
-
- Sometimes, purpose of the check is to determine if font is supporting
- particular script - if required tables are not there font is just
- rejected by this shaping engine. Sometimes, shaping engine can not just
- reject the font because there are fonts using older shaping technologies
- we still have to support, so it uses some logic when to fallback to
- legacy layout code.
-
- In your case this is Hebrew, where both tables are required to use
- OpenType processing. Arabic requires both tables too, Latin requires
- GSUB to execute GPOS. But in general, if you have both tables you should
- be safe with any script to get fully featured OpenType shaping.
-
-In other words, if we have a Hebrew font with just GPOS features they won't work,
-and MS will not use the font at all. We must add a GSUB table. In the unlikely
-event that we had a hebrew font with only GSUB it would not work either.
-
-So if we want our lookups to have a chance of executing under Uniscribe we
-better make sure that both tables have the same script set.
-
-(Sergey says we could optimize a little: A Latin GSUB table will run without
-a GPOS, but he says the GPOS won't work without a GSUB.)
-*/
- int cnt=0, tot=0, i;
- uint32 *scripts = NULL;
- OTLookup *test;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
-
- /* So here always give scripts for both (see comment above) no */
- /* matter what they asked for */
- for ( gpos=0; gpos<2; ++gpos ) {
- for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
- if ( test->unused )
- continue;
- for ( fl=test->features; fl!=NULL; fl=fl->next ) {
- if ( fl->ismac )
- continue;
- for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
- for ( i=0; i<cnt; ++i ) {
- if ( sl->script==scripts[i] )
- break;
- }
- if ( i==cnt ) {
- if ( cnt>=tot )
- scripts = grealloc(scripts,(tot+=10)*sizeof(uint32));
- scripts[cnt++] = sl->script;
- }
- }
- }
- }
- }
-
- if ( cnt==0 )
-return( NULL );
-
- /* We want our scripts in alphabetic order */
- qsort(scripts,cnt,sizeof(uint32),uint32_cmp);
- /* add a 0 entry to mark the end of the list */
- if ( cnt>=tot )
- scripts = grealloc(scripts,(tot+1)*sizeof(uint32));
- scripts[cnt] = 0;
-return( scripts );
-}
-
-uint32 *SFLangsInScript(SplineFont *sf,int gpos,uint32 script) {
- /* However, the language lists (I think) are distinct */
- /* But giving a value of -1 for gpos will give us the set of languages in */
- /* both tables (for this script) */
- int cnt=0, tot=0, i, g, l;
- uint32 *langs = NULL;
- OTLookup *test;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
-
- for ( g=0; g<2; ++g ) {
- if (( gpos==0 && g==1 ) || ( gpos==1 && g==0 ))
- continue;
- for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
- if ( test->unused )
- continue;
- for ( fl=test->features; fl!=NULL; fl=fl->next ) {
- for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
- if ( sl->script==script ) {
- for ( l=0; l<sl->lang_cnt; ++l ) {
- int lang;
- if ( l<MAX_LANG )
- lang = sl->langs[l];
- else
- lang = sl->morelangs[l-MAX_LANG];
- for ( i=0; i<cnt; ++i ) {
- if ( lang==langs[i] )
- break;
- }
- if ( i==cnt ) {
- if ( cnt>=tot )
- langs = grealloc(langs,(tot+=10)*sizeof(uint32));
- langs[cnt++] = lang;
- }
- }
- }
- }
- }
- }
- }
-
- if ( cnt==0 ) {
- /* We add dummy script entries. Because Uniscribe will refuse to */
- /* process some scripts if they don't have an entry in both GPOS */
- /* an GSUB. So if a script appears in either table, force it to */
- /* appear in both. That means we can get scripts with no lookups */
- /* and hence no languages. It seems that Uniscribe doesn't like */
- /* that either. So give each such script a dummy default language */
- /* entry. This is what VOLT does */
- langs = gcalloc(2,sizeof(uint32));
- langs[0] = DEFAULT_LANG;
-return( langs );
- }
-
- /* We want our languages in alphabetic order */
- qsort(langs,cnt,sizeof(uint32),lang_cmp);
- /* add a 0 entry to mark the end of the list */
- if ( cnt>=tot )
- langs = grealloc(langs,(tot+1)*sizeof(uint32));
- langs[cnt] = 0;
-return( langs );
-}
-
-uint32 *SFFeaturesInScriptLang(SplineFont *sf,int gpos,uint32 script,uint32 lang) {
- int cnt=0, tot=0, i, l, isg;
- uint32 *features = NULL;
- OTLookup *test;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
-
- if ( sf->cidmaster ) sf=sf->cidmaster;
- for ( isg = 0; isg<2; ++isg ) {
- if ( gpos!=-1 && isg!=gpos )
- continue;
- for ( test = isg ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
- if ( test->unused )
- continue;
- for ( fl=test->features; fl!=NULL; fl=fl->next ) {
- if ( fl->ismac )
- continue;
- if ( script==0xffffffff ) {
- for ( i=0; i<cnt; ++i ) {
- if ( fl->featuretag==features[i] )
- break;
- }
- if ( i==cnt ) {
- if ( cnt>=tot )
- features = grealloc(features,(tot+=10)*sizeof(uint32));
- features[cnt++] = fl->featuretag;
- }
- } else for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
- if ( sl->script==script ) {
- for ( l=0; l<sl->lang_cnt; ++l ) {
- int testlang;
- if ( l<MAX_LANG )
- testlang = sl->langs[l];
- else
- testlang = sl->morelangs[l-MAX_LANG];
- if ( testlang==lang ) {
- for ( i=0; i<cnt; ++i ) {
- if ( fl->featuretag==features[i] )
- break;
- }
- if ( i==cnt ) {
- if ( cnt>=tot )
- features = grealloc(features,(tot+=10)*sizeof(uint32));
- features[cnt++] = fl->featuretag;
- }
- }
- }
- }
- }
- }
- }
- }
-
- if ( sf->design_size!=0 && gpos ) {
- /* The 'size' feature is like no other. It has no lookups and so */
- /* we will never find it in the normal course of events. If the */
- /* user has specified a design size, then every script/lang combo */
- /* gets a 'size' feature which contains no lookups but feature */
- /* params */
- if ( cnt>=tot )
- features = grealloc(features,(tot+=2)*sizeof(uint32));
- features[cnt++] = CHR('s','i','z','e');
- }
-
- if ( cnt==0 )
-return( gcalloc(1,sizeof(uint32)) );
-
- /* We don't care if our features are in alphabetical order here */
- /* all that matters is whether the complete list of features is */
- /* ordering here would be irrelevant */
- /* qsort(features,cnt,sizeof(uint32),uint32_cmp); */
-
- /* add a 0 entry to mark the end of the list */
- if ( cnt>=tot )
- features = grealloc(features,(tot+1)*sizeof(uint32));
- features[cnt] = 0;
-return( features );
-}
-
-OTLookup **SFLookupsInScriptLangFeature(SplineFont *sf,int gpos,uint32 script,uint32 lang, uint32 feature) {
- int cnt=0, tot=0, l;
- OTLookup **lookups = NULL;
- OTLookup *test;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
-
- for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
- if ( test->unused )
- continue;
- for ( fl=test->features; fl!=NULL; fl=fl->next ) {
- if ( fl->featuretag==feature ) {
- for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
- if ( sl->script==script ) {
- for ( l=0; l<sl->lang_cnt; ++l ) {
- int testlang;
- if ( l<MAX_LANG )
- testlang = sl->langs[l];
- else
- testlang = sl->morelangs[l-MAX_LANG];
- if ( testlang==lang ) {
- if ( cnt>=tot )
- lookups = grealloc(lookups,(tot+=10)*sizeof(OTLookup *));
- lookups[cnt++] = test;
- goto found;
- }
- }
- }
- }
- }
- }
- found:;
- }
-
- if ( cnt==0 )
-return( NULL );
-
- /* lookup order is irrelevant here. might as well leave it in invocation order */
- /* add a 0 entry to mark the end of the list */
- if ( cnt>=tot )
- lookups = grealloc(lookups,(tot+1)*sizeof(OTLookup *));
- lookups[cnt] = 0;
-return( lookups );
-}
-
-static int LigaturesFirstComponentGID(SplineFont *sf,char *components) {
- int gid, ch;
- char *pt;
-
- for ( pt = components; *pt!='\0' && *pt!=' '; ++pt );
- ch = *pt; *pt = '\0';
- gid = SFFindExistingSlot(sf,-1,components);
- *pt = ch;
-return( gid );
-}
-
-static int PSTValid(SplineFont *sf,PST *pst) {
- char *start, *pt, ch;
- int ret;
-
- switch ( pst->type ) {
- case pst_position:
-return( true );
- case pst_pair:
-return( SCWorthOutputting(SFGetChar(sf,-1,pst->u.pair.paired)) );
- case pst_substitution: case pst_alternate: case pst_multiple:
- case pst_ligature:
- for ( start = pst->u.mult.components; *start ; ) {
- for ( pt=start; *pt && *pt!=' '; ++pt );
- ch = *pt; *pt = '\0';
- ret = SCWorthOutputting(SFGetChar(sf,-1,start));
- *pt = ch;
- if ( !ret )
-return( false );
- if ( ch==0 )
- start = pt;
- else
- start = pt+1;
- }
- }
-return( true );
-}
-
-SplineChar **SFGlyphsWithPSTinSubtable(SplineFont *sf,struct lookup_subtable *subtable) {
- uint8 *used = gcalloc(sf->glyphcnt,sizeof(uint8));
- SplineChar **glyphs, *sc;
- int i, k, gid, cnt;
- KernPair *kp;
- PST *pst;
- int ispair = subtable->lookup->lookup_type == gpos_pair;
- int isliga = subtable->lookup->lookup_type == gsub_ligature;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) {
- if ( ispair ) {
- for ( k=0; k<2; ++k ) {
- for ( kp= k ? sc->kerns : sc->vkerns; kp!=NULL ; kp=kp->next ) {
- if ( !SCWorthOutputting(kp->sc))
- continue;
- if ( kp->subtable == subtable ) {
- used[i] = true;
- goto continue_;
- }
- }
- }
- }
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable == subtable && PSTValid(sf,pst)) {
- if ( !isliga ) {
- used[i] = true;
- goto continue_;
- } else {
- gid = LigaturesFirstComponentGID(sf,pst->u.lig.components);
- pst->u.lig.lig = sc;
- if ( gid!=-1 )
- used[gid] = true;
- /* can't continue here. ffi might be "f+f+i" and "ff+i" */
- /* and we need to mark both "f" and "ff" as used */
- }
- }
- }
- continue_: ;
- }
-
- for ( i=cnt=0 ; i<sf->glyphcnt; ++i )
- if ( used[i] )
- ++cnt;
-
- if ( cnt==0 ) {
- free(used);
-return( NULL );
- }
- glyphs = galloc((cnt+1)*sizeof(SplineChar *));
- for ( i=cnt=0 ; i<sf->glyphcnt; ++i ) {
- if ( used[i] )
- glyphs[cnt++] = sf->glyphs[i];
- }
- glyphs[cnt] = NULL;
- free(used);
-return( glyphs );
-}
-
-SplineChar **SFGlyphsWithLigatureinLookup(SplineFont *sf,struct lookup_subtable *subtable) {
- uint8 *used = gcalloc(sf->glyphcnt,sizeof(uint8));
- SplineChar **glyphs, *sc;
- int i, cnt;
- PST *pst;
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable == subtable ) {
- used[i] = true;
- goto continue_;
- }
- }
- continue_: ;
- }
-
- for ( i=cnt=0 ; i<sf->glyphcnt; ++i )
- if ( used[i] )
- ++cnt;
-
- if ( cnt==0 ) {
- free(used);
-return( NULL );
- }
-
- glyphs = galloc((cnt+1)*sizeof(SplineChar *));
- for ( i=cnt=0 ; i<sf->glyphcnt; ++i ) {
- if ( used[i] )
- glyphs[cnt++] = sf->glyphs[i];
- }
- glyphs[cnt] = NULL;
- free(used);
-return( glyphs );
-}
-
-void SFFindUnusedLookups(SplineFont *sf) {
- OTLookup *test;
- struct lookup_subtable *sub;
- int gpos;
- AnchorClass *ac;
- AnchorPoint *ap;
- SplineChar *sc;
- KernPair *kp;
- PST *pst;
- int k,gid,isv;
- SplineFont *_sf = sf;
-
- if ( _sf->cidmaster ) _sf = _sf->cidmaster;
-
- /* Some things are obvious. If a subtable consists of a kernclass or some */
- /* such, then obviously it is used. But more distributed info takes more */
- /* work. So mark anything easy as used, and anything difficult as unused */
- /* We'll work on the difficult things later */
- for ( gpos=0; gpos<2; ++gpos ) {
- for ( test = gpos ? _sf->gpos_lookups : _sf->gsub_lookups; test!=NULL; test = test->next ) {
- for ( sub = test->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub->kc!=NULL || sub->fpst!=NULL || sub->sm!=NULL ) {
- sub->unused = false;
- continue;
- }
- sub->unused = true;
- /* We'll turn the following bit back on if there turns out */
- /* to be an anchor class attached to it -- that is subtly */
- /* different than being unused -- unused will be set if all */
- /* acs are unused, this bit will be on if there are unused */
- /* classes that still refer to us. */
- sub->anchor_classes = false;
- }
- }
- }
-
- /* To be useful an anchor class must have both at least one base and one mark */
- /* (for cursive anchors that means at least one entry and at least one exit) */
- /* Start by assuming the worst */
- for ( ac = _sf->anchor; ac!=NULL; ac=ac->next )
- ac->has_mark = ac->has_base = false;
-
- /* Ok, for each glyph, look at all lookups (or anchor classes) it affects */
- /* and mark the appropriate parts of them as used */
- k = 0;
- do {
- sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( SCWorthOutputting(sc = sf->glyphs[gid]) ) {
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
- switch ( ap->type ) {
- case at_mark: case at_centry:
- ap->anchor->has_mark = true;
- break;
- case at_basechar: case at_baselig: case at_basemark:
- case at_cexit:
- ap->anchor->has_base = true;
- break;
- }
- }
- for ( isv=0; isv<2; ++isv ) {
- for ( kp= isv ? sc->kerns : sc->vkerns ; kp!=NULL; kp=kp->next ) {
- if ( SCWorthOutputting(kp->sc))
- kp->subtable->unused = false;
- }
- }
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==NULL )
- continue;
- if ( !PSTValid(sf,pst))
- continue;
- pst->subtable->unused = false;
- }
- }
- ++k;
- } while ( k<_sf->subfontcnt );
-
- /* Finally for any anchor class that has both a mark and a base then it is */
- /* used, and its lookup is also used */
- /* Also, even if unused, as long as the anchor class exists we must keep */
- /* the subtable around */
- for ( ac = _sf->anchor; ac!=NULL; ac=ac->next ) {
- ac->subtable->anchor_classes = true;
- if ( ac->has_mark && ac->has_base )
- ac->subtable->unused = false;
- }
-
- /* Now for each lookup, a lookup is unused if ALL subtables are unused */
- for ( gpos=0; gpos<2; ++gpos ) {
- for ( test = gpos ? _sf->gpos_lookups : _sf->gsub_lookups; test!=NULL; test = test->next ) {
- test->unused = test->empty = true;
- for ( sub=test->subtables; sub!=NULL; sub=sub->next ) {
- if ( !sub->unused )
- test->unused = false;
- if ( !sub->unused && !sub->anchor_classes ) {
- test->empty = false;
- break;
- }
- }
- }
- }
-}
-
-void SFFindClearUnusedLookupBits(SplineFont *sf) {
- OTLookup *test;
- int gpos;
-
- for ( gpos=0; gpos<2; ++gpos ) {
- for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
- test->unused = false;
- test->empty = false;
- test->def_lang_checked = false;
- }
- }
-}
-
-static void SFRemoveAnchorPointsOfAC(SplineFont *sf,AnchorClass *ac) {
- int gid;
- SplineChar *sc;
- AnchorPoint *ap, *prev, *next;
-
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc = sf->glyphs[gid])!=NULL ) {
- for ( prev=NULL, ap=sc->anchor; ap!=NULL; ap=next ) {
- next = ap->next;
- if ( ap->anchor!=ac )
- prev = ap;
- else {
- if ( prev==NULL )
- sc->anchor = next;
- else
- prev->next = next;
- ap->next = NULL;
- AnchorPointsFree(ap);
- }
- }
- }
-}
-
-static void RemoveNestedReferences(SplineFont *sf,int isgpos,OTLookup *dying) {
- OTLookup *otl;
- struct lookup_subtable *sub;
- int i,j,k;
-
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl = otl->next ) {
- if ( otl->lookup_type==morx_context ) {
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- ASM *sm = sub->sm;
- if ( sm->type==asm_context ) {
- for ( i=0; i<sm->state_cnt*sm->class_cnt; ++i ) {
- struct asm_state *state = &sm->state[i];
- if ( state->u.context.mark_lookup == otl )
- state->u.context.mark_lookup = NULL;
- if ( state->u.context.cur_lookup == otl )
- state->u.context.cur_lookup = NULL;
- }
- }
- }
- /* Reverse chaining tables do not reference lookups. The match pattern*/
- /* is a (exactly one) coverage table, and each glyph in that table */
- /* as an inline replacement. There is no lookup to do the replacement*/
- /* (so we ignore it here) */
- } else if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ||
- otl->lookup_type==gpos_context || otl->lookup_type==gpos_contextchain ) {
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- FPST *fpst = sub->fpst;
- for ( i=0; i<fpst->rule_cnt; ++i ) {
- for ( j=0; j<fpst->rules[i].lookup_cnt; ++j ) {
- if ( fpst->rules[i].lookups[j].lookup == otl ) {
- for ( k=j+1; k<fpst->rules[i].lookup_cnt; ++k )
- fpst->rules[i].lookups[k-1] = fpst->rules[i].lookups[k];
- --fpst->rules[i].lookup_cnt;
- --j;
- }
- }
- }
- }
- }
- }
-}
-
-void SFRemoveUnusedLookupSubTables(SplineFont *sf,
- int remove_incomplete_anchorclasses,
- int remove_unused_lookups) {
- int gpos;
- struct lookup_subtable *sub, *subnext, *prev;
- AnchorClass *ac, *acprev, *acnext;
- OTLookup *otl, *otlprev, *otlnext;
-
- otlprev = NULL;
- /* Presumes someone has called SFFindUnusedLookups first */
-
- if ( remove_incomplete_anchorclasses ) {
- for ( acprev=NULL, ac=sf->anchor; ac!=NULL; ac=acnext ) {
- acnext = ac->next;
- if ( ac->has_mark && ac->has_base )
- acprev = ac;
- else {
- SFRemoveAnchorPointsOfAC(sf,ac);
- ac->next = NULL;
- AnchorClassesFree(ac);
- if ( acprev==NULL )
- sf->anchor = acnext;
- else
- acprev = acnext;
- }
- }
- }
-
- for ( gpos=0; gpos<2; ++gpos ) {
- for ( otl = gpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl = otlnext ) {
- otlnext = otl->next;
- if ( remove_unused_lookups && (otl->empty ||
- (otl->unused && remove_incomplete_anchorclasses)) ) {
- if ( otlprev!=NULL )
- otlprev->next = otlnext;
- else if ( gpos )
- sf->gpos_lookups = otlnext;
- else
- sf->gsub_lookups = otlnext;
- RemoveNestedReferences(sf,gpos,otl);
- OTLookupFree(otl);
- } else {
- for ( prev=NULL, sub=otl->subtables; sub!=NULL; sub=subnext ) {
- subnext = sub->next;
- if ( sub->unused &&
- (!sub->anchor_classes ||
- remove_incomplete_anchorclasses )) {
- if ( prev==NULL )
- otl->subtables = subnext;
- else
- prev->next = subnext;
- free(sub->subtable_name);
- chunkfree(sub,sizeof(*sub));
- } else
- prev = sub;
- }
- }
- }
- }
-}
-
-void SFRemoveLookupSubTable(SplineFont *sf,struct lookup_subtable *sub) {
- OTLookup *otl = sub->lookup;
- struct lookup_subtable *subprev, *subtest;
-
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
-
- if ( sub->sm!=NULL ) {
- ASM *prev = NULL, *test;
- for ( test=sf->sm; test!=NULL && test!=sub->sm; prev=test, test=test->next );
- if ( prev==NULL )
- sf->sm = sub->sm->next;
- else
- prev->next = sub->sm->next;
- sub->sm->next = NULL;
- ASMFree(sub->sm);
- sub->sm = NULL;
- } else if ( sub->fpst!=NULL ) {
- FPST *prev = NULL, *test;
- for ( test=sf->possub; test!=NULL && test!=sub->fpst; prev=test, test=test->next );
- if ( prev==NULL )
- sf->possub = sub->fpst->next;
- else
- prev->next = sub->fpst->next;
- sub->fpst->next = NULL;
- FPSTFree(sub->fpst);
- sub->fpst = NULL;
- } else if ( sub->kc!=NULL ) {
- KernClass *prev = NULL, *test;
- for ( test=sf->kerns; test!=NULL && test!=sub->kc; prev=test, test=test->next );
- if ( test!=NULL ) {
- if ( prev==NULL )
- sf->kerns = sub->kc->next;
- else
- prev->next = sub->kc->next;
- } else {
- for ( prev=NULL,test=sf->vkerns; test!=NULL && test!=sub->kc; prev=test, test=test->next );
- if ( prev==NULL )
- sf->vkerns = sub->kc->next;
- else
- prev->next = sub->kc->next;
- }
- sub->kc->next = NULL;
- KernClassListFree(sub->kc);
- sub->kc = NULL;
- } else if ( otl->lookup_type==gpos_cursive || otl->lookup_type==gpos_mark2base ||
- otl->lookup_type==gpos_mark2ligature || otl->lookup_type==gpos_mark2mark ) {
- AnchorClass *ac, *acnext;
- for ( ac=sf->anchor; ac!=NULL; ac=acnext ) {
- acnext = ac->next;
- if ( ac->subtable==sub )
- SFRemoveAnchorClass(sf,ac);
- }
- } else {
- int i,k,v;
- SplineChar *sc;
- SplineFont *_sf;
- PST *pst, *prev, *next;
- KernPair *kp, *kpprev, *kpnext;
- k=0;
- i = 0;
- do {
- _sf = sf->subfontcnt==0 ? sf : sf->subfonts[i];
- for ( i=0; i<_sf->glyphcnt; ++i ) if ( (sc=_sf->glyphs[i])!=NULL ) {
- for ( pst=sc->possub, prev=NULL ; pst!=NULL; pst=next ) {
- next = pst->next;
- if ( pst->subtable==sub ) {
- if ( prev==NULL )
- sc->possub = next;
- else
- prev->next = next;
- pst->next = NULL;
- PSTFree(pst);
- } else
- prev = pst;
- }
- for ( v=0; v<2; ++v ) {
- for ( kp=v ? sc->vkerns : sc->kerns, kpprev=NULL ; kp!=NULL; kp=kpnext ) {
- kpnext = kp->next;
- if ( kp->subtable==sub ) {
- if ( kpprev!=NULL )
- kpprev->next = kpnext;
- else if ( v )
- sc->vkerns = kpnext;
- else
- sc->kerns = kpnext;
- kp->next = NULL;
- KernPairsFree(kp);
- } else
- kpprev = kp;
- }
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- }
-
- subprev = NULL;
- for ( subtest = otl->subtables; subtest!=NULL && subtest!=sub; subprev = subtest, subtest=subtest->next );
- if ( subprev==NULL )
- otl->subtables = sub->next;
- else
- subprev->next = sub->next;
- free(sub->subtable_name);
- free(sub->suffix);
- chunkfree(sub,sizeof(struct lookup_subtable));
-}
-
-void SFRemoveLookup(SplineFont *sf,OTLookup *otl) {
- OTLookup *test, *prev;
- int isgpos;
- struct lookup_subtable *sub, *subnext;
-
- if ( sf->cidmaster ) sf = sf->cidmaster;
-
- for ( sub = otl->subtables; sub!=NULL; sub=subnext ) {
- subnext = sub->next;
- SFRemoveLookupSubTable(sf,sub);
- }
-
- for ( prev=NULL, test=sf->gpos_lookups; test!=NULL && test!=otl; prev=test, test=test->next );
- if ( test==NULL ) {
- isgpos = false;
- for ( prev=NULL, test=sf->gsub_lookups; test!=NULL && test!=otl; prev=test, test=test->next );
- } else
- isgpos = true;
- if ( prev!=NULL )
- prev->next = otl->next;
- else if ( isgpos )
- sf->gpos_lookups = otl->next;
- else
- sf->gsub_lookups = otl->next;
-
- RemoveNestedReferences(sf,isgpos,otl);
-
- otl->next = NULL;
- OTLookupFree(otl);
-}
-
-struct lookup_subtable *SFFindLookupSubtable(SplineFont *sf,char *name) {
- int isgpos;
- OTLookup *otl;
- struct lookup_subtable *sub;
-
- if ( sf->cidmaster ) sf = sf->cidmaster;
-
- if ( name==NULL )
-return( NULL );
-
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups ; otl!=NULL; otl=otl->next ) {
- for ( sub = otl->subtables; sub!=NULL; sub=sub->next ) {
- if ( strcmp(name,sub->subtable_name)==0 )
-return( sub );
- }
- }
- }
-return( NULL );
-}
-
-struct lookup_subtable *SFFindLookupSubtableAndFreeName(SplineFont *sf,char *name) {
- struct lookup_subtable *sub = SFFindLookupSubtable(sf,name);
- free(name);
-return( sub );
-}
-
-OTLookup *SFFindLookup(SplineFont *sf,char *name) {
- int isgpos;
- OTLookup *otl;
-
- if ( sf->cidmaster ) sf = sf->cidmaster;
-
- if ( name==NULL )
-return( NULL );
-
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups ; otl!=NULL; otl=otl->next ) {
- if ( strcmp(name,otl->lookup_name)==0 )
-return( otl );
- }
- }
-return( NULL );
-}
-
-void FListAppendScriptLang(FeatureScriptLangList *fl,uint32 script_tag,uint32 lang_tag) {
- struct scriptlanglist *sl;
- int l;
-
- for ( sl = fl->scripts; sl!=NULL && sl->script!=script_tag; sl=sl->next );
- if ( sl==NULL ) {
- sl = chunkalloc(sizeof(struct scriptlanglist));
- sl->script = script_tag;
- sl->next = fl->scripts;
- fl->scripts = sl;
- }
- for ( l=0; l<MAX_LANG && l<sl->lang_cnt && sl->langs[l]!=lang_tag; ++l );
- if ( l>=MAX_LANG && l<sl->lang_cnt ) {
- while ( l<sl->lang_cnt && sl->morelangs[l-MAX_LANG]!=lang_tag )
- ++l;
- }
- if ( l>=sl->lang_cnt ) {
- if ( l<MAX_LANG )
- sl->langs[l] = lang_tag;
- else {
- if ( l%MAX_LANG == 0 )
- sl->morelangs = grealloc(sl->morelangs,l*sizeof(uint32));
- /* We've just allocated MAX_LANG-1 more than we need */
- /* so we don't do quite some many allocations */
- sl->morelangs[l-MAX_LANG] = lang_tag;
- }
- ++sl->lang_cnt;
- }
-}
-
-void FListsAppendScriptLang(FeatureScriptLangList *fl,uint32 script_tag,uint32 lang_tag) {
- while ( fl!=NULL ) {
- FListAppendScriptLang(fl,script_tag,lang_tag);
- fl=fl->next;
- }
-}
-
-static char *SuffixFromTags(FeatureScriptLangList *fl) {
- static struct { uint32 tag; char *suffix; } tags2suffix[] = {
- { CHR('v','r','t','2'), "vert" }, /* Will check for vrt2 later */
- { CHR('o','n','u','m'), "oldstyle" },
- { CHR('s','u','p','s'), "superior" },
- { CHR('s','u','b','s'), "inferior" },
- { CHR('s','w','s','h'), "swash" },
- { CHR('f','w','i','d'), "full" },
- { CHR('h','w','i','d'), "hw" },
- { 0 }
- };
- int i;
-
- while ( fl!=NULL ) {
- for ( i=0; tags2suffix[i].tag!=0; ++i )
- if ( tags2suffix[i].tag==fl->featuretag )
-return( copy( tags2suffix[i].suffix ));
- fl = fl->next;
- }
-return( NULL );
-}
-
-
-#ifdef LUA_FF_LIB
-/* ma = State Machine, un = Unknown */
-char *lookup_type_names[2][10] =
- { { "us", "ss", "ms", "as", "ls", "cs", "ks", "es", "rk" },
- { "up", "sp", "pp", "ca", "mb", "ml", "mm", "cp", "kp","ep" }};
-#else
-char *lookup_type_names[2][10] =
- { { N_("Undefined substitution"), N_("Single Substitution"), N_("Multiple Substitution"),
- N_("Alternate Substitution"), N_("Ligature Substitution"), N_("Contextual Substitution"),
- N_("Contextual Chaining Substitution"), N_("Extension"),
- N_("Reverse Contextual Chaining Substitution") },
- { N_("Undefined positioning"), N_("Single Positioning"), N_("Pairwise Positioning (kerning)"),
- N_("Cursive attachment"), N_("Mark to base attachment"),
- N_("Mark to Ligature attachment"), N_("Mark to Mark attachment"),
- N_("Contextual Positioning"), N_("Contextual Chaining Positioning"),
- N_("Extension") }};
-#endif
-
-void NameOTLookup(OTLookup *otl,SplineFont *sf) {
- char *userfriendly = NULL, *script;
- FeatureScriptLangList *fl;
- char *lookuptype;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- extern GTextInfo scripts[];
-#endif
- char *format;
- struct lookup_subtable *subtable;
- int k;
-
- if ( otl->lookup_name==NULL ) {
- for ( k=0; k<2; ++k ) {
- for ( fl=otl->features; fl!=NULL ; fl=fl->next ) {
- /* look first for a feature attached to a default language */
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI /* because of the Gdraw dependant TagFullname */
- if ( k==1 || DefaultLangTagInScriptList(fl->scripts,false)!=NULL ) {
- userfriendly = TagFullName(sf,fl->featuretag, fl->ismac, true);
- if ( userfriendly!=NULL )
- break;
- }
-#endif
- }
- if ( userfriendly!=NULL )
- break;
- }
- if ( userfriendly==NULL ) {
- if ( (otl->lookup_type&0xff)>= 0xf0 )
-#ifdef LUA_FF_LIB
- lookuptype = "ma";
-#else
- lookuptype = _("State Machine");
-#endif
- else if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
- lookuptype = _(lookup_type_names[otl->lookup_type>>8][otl->lookup_type&0xff]);
- else
-#ifdef LUA_FF_LIB
- lookuptype = "un";
-#else
- lookuptype = S_("LookupType|Unknown");
-#endif
- for ( fl=otl->features; fl!=NULL && !fl->ismac; fl=fl->next );
- if ( fl==NULL )
- userfriendly = copy(lookuptype);
- else {
- userfriendly = galloc( strlen(lookuptype) + 10);
-#ifdef LUA_FF_LIB
- sprintf( userfriendly, "%s_%c%c%c%c", lookuptype,
-#else
- sprintf( userfriendly, "%s '%c%c%c%c'", lookuptype,
-#endif
- fl->featuretag>>24,
- fl->featuretag>>16,
- fl->featuretag>>8 ,
- fl->featuretag );
- }
- }
- script = NULL;
- if ( fl==NULL ) fl = otl->features;
- if ( fl!=NULL && fl->scripts!=NULL ) {
- char buf[8];
- /*int j;*/
- struct scriptlanglist *sl, *found, *found2;
- uint32 script_tag = fl->scripts->script;
- found = found2 = NULL;
- for ( sl = fl->scripts; sl!=NULL; sl=sl->next ) {
- if ( sl->script == DEFAULT_SCRIPT )
- /* Ignore it */;
- else if ( DefaultLangTagInOneScriptList(sl)) {
- if ( found==NULL )
- found = sl;
- else {
- found = found2 = NULL;
- break;
- }
- } else if ( found2 == NULL )
- found2 = sl;
- else
- found2 = (struct scriptlanglist *) -1;
- }
- if ( found==NULL && found2!=NULL && found2 != (struct scriptlanglist *) -1 )
- found = found2;
- if ( found!=NULL ) {
- script_tag = found->script;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- for ( j=0; scripts[j].text!=NULL && script_tag!=(uint32) (intpt) scripts[j].userdata; ++j );
- if ( scripts[j].text!=NULL )
- script = copy( S_((char *) scripts[j].text) );
- else {
-#else
- {
-#endif
-#ifdef LUA_FF_LIB
- buf[0] = fl->scripts->script>>24;
- buf[1] = (fl->scripts->script>>16)&0xff;
- buf[2] = (fl->scripts->script>>8)&0xff;
- buf[3] = fl->scripts->script&0xff;
- buf[4] = 0;
-#else
- buf[0] = '\'';
- buf[1] = fl->scripts->script>>24;
- buf[2] = (fl->scripts->script>>16)&0xff;
- buf[3] = (fl->scripts->script>>8)&0xff;
- buf[4] = fl->scripts->script&0xff;
- buf[5] = '\'';
- buf[6] = 0;
-#endif
- script = copy(buf);
- }
- }
- }
-/* GT: This string is used to generate a name for each OpenType lookup. */
-/* GT: The %s will be filled with the user friendly name of the feature used to invoke the lookup */
-/* GT: The second %s (if present) is the script */
-/* GT: While the %d is the index into the lookup list and is used to disambiguate it */
-/* GT: In case that is needed */
- if ( script!=NULL ) {
-#ifdef LUA_FF_LIB
- format = "%s_%s_l_%d";
-#else
- format = _("%s in %s lookup %d");
-#endif
- otl->lookup_name = galloc( strlen(userfriendly)+strlen(format)+strlen(script)+10 );
- sprintf( otl->lookup_name, format, userfriendly, script, otl->lookup_index );
- } else {
-#ifdef LUA_FF_LIB
- format = "%s_l_%d";
-#else
- format = _("%s lookup %d");
-#endif
- otl->lookup_name = galloc( strlen(userfriendly)+strlen(format)+10 );
- sprintf( otl->lookup_name, format, userfriendly, otl->lookup_index );
- }
- free(script);
- free(userfriendly);
- }
-
- if ( otl->subtables==NULL )
- /* IError( _("Lookup with no subtables"))*/;
- else {
- int cnt = 0;
- for ( subtable = otl->subtables; subtable!=NULL; subtable=subtable->next, ++cnt )
- if ( subtable->subtable_name==NULL ) {
- if ( subtable==otl->subtables && subtable->next==NULL )
-/* GT: This string is used to generate a name for an OpenType lookup subtable. */
-/* GT: %s is the lookup name */
-#ifdef LUA_FF_LIB
- format = "%s_s";
-#else
- format = _("%s subtable");
-#endif
- else if ( subtable->per_glyph_pst_or_kern )
-/* GT: This string is used to generate a name for an OpenType lookup subtable. */
-/* GT: %s is the lookup name, %d is the index of the subtable in the lookup */
-#ifdef LUA_FF_LIB
- format = "%s_g_%d";
-#else
- format = _("%s per glyph data %d");
-#endif
- else if ( subtable->kc!=NULL )
-#ifdef LUA_FF_LIB
- format = "%s_k_%d";
-#else
- format = _("%s kerning class %d");
-#endif
- else if ( subtable->fpst!=NULL )
-#ifdef LUA_FF_LIB
- format = "%s_c_%d";
-#else
- format = _("%s contextual %d");
-#endif
- else if ( subtable->anchor_classes )
-#ifdef LUA_FF_LIB
- format = "%s_a_%d";
-#else
- format = _("%s anchor %d");
-#endif
- else {
- IError("Subtable status not filled in for %dth subtable of %s", cnt, otl->lookup_name );
- format = "%s !!!!!!!! %d";
- }
- subtable->subtable_name = galloc( strlen(otl->lookup_name)+strlen(format)+10 );
- sprintf( subtable->subtable_name, format, otl->lookup_name, cnt );
- }
- }
- if ( otl->lookup_type==gsub_ligature ) {
- for ( fl=otl->features; fl!=NULL; fl=fl->next )
- if ( fl->featuretag==CHR('l','i','g','a') || fl->featuretag==CHR('r','l','i','g'))
- otl->store_in_afm = true;
- }
-
- if ( otl->lookup_type==gsub_single )
- for ( subtable = otl->subtables; subtable!=NULL; subtable=subtable->next )
- subtable->suffix = SuffixFromTags(otl->features);
-}
-
-static void LangOrder(struct scriptlanglist *sl) {
- int i,j;
- uint32 lang, lang2;
-
- for ( i=0; i<sl->lang_cnt; ++i ) {
- lang = i<MAX_LANG ? sl->langs[i] : sl->morelangs[i-MAX_LANG];
- for ( j=i+1; j<sl->lang_cnt; ++j ) {
- lang2 = j<MAX_LANG ? sl->langs[j] : sl->morelangs[j-MAX_LANG];
- if ( lang>lang2 ) {
- if ( i<MAX_LANG )
- sl->langs[i] = lang2;
- else
- sl->morelangs[i-MAX_LANG] = lang2;
- if ( j<MAX_LANG )
- sl->langs[j] = lang;
- else
- sl->morelangs[j-MAX_LANG] = lang;
- lang = lang2;
- }
- }
- }
-}
-
-static struct scriptlanglist *SLOrder(struct scriptlanglist *sl) {
- int i,j, cnt;
- struct scriptlanglist *sl2, *space[30], **allocked=NULL, **test = space;
-
- for ( sl2=sl, cnt=0; sl2!=NULL; sl2=sl2->next, ++cnt )
- LangOrder(sl2);
- if ( cnt<=1 )
-return( sl );
- if ( cnt>30 )
- test = allocked = galloc(cnt*sizeof(struct scriptlanglist *));
- for ( sl2=sl, cnt=0; sl2!=NULL; sl2=sl2->next, ++cnt )
- test[cnt] = sl2;
- for ( i=0; i<cnt; ++i ) for ( j=i+1; j<cnt; ++j ) {
- if ( test[i]->script > test[j]->script ) {
- struct scriptlanglist *temp;
- temp = test[i];
- test[i] = test[j];
- test[j] = temp;
- }
- }
- sl = test[0];
- for ( i=1; i<cnt; ++i )
- test[i-1]->next = test[i];
- test[i-1]->next = NULL;
- free( allocked );
-return( sl );
-}
-
-FeatureScriptLangList *FLOrder(FeatureScriptLangList *fl) {
- int i,j, cnt;
- FeatureScriptLangList *fl2, *space[30], **allocked=NULL, **test = space;
-
- for ( fl2=fl, cnt=0; fl2!=NULL; fl2=fl2->next, ++cnt )
- fl2->scripts = SLOrder(fl2->scripts);
- if ( cnt<=1 )
-return( fl );
- if ( cnt>30 )
- test = allocked = galloc(cnt*sizeof(FeatureScriptLangList *));
- for ( fl2=fl, cnt=0; fl2!=NULL; fl2=fl2->next, ++cnt )
- test[cnt] = fl2;
- for ( i=0; i<cnt; ++i ) for ( j=i+1; j<cnt; ++j ) {
- if ( test[i]->featuretag > test[j]->featuretag ) {
- FeatureScriptLangList *temp;
- temp = test[i];
- test[i] = test[j];
- test[j] = temp;
- }
- }
- fl = test[0];
- for ( i=1; i<cnt; ++i )
- test[i-1]->next = test[i];
- test[i-1]->next = NULL;
- free( allocked );
-return( fl );
-}
-
-struct scriptlanglist *SLCopy(struct scriptlanglist *sl) {
- struct scriptlanglist *newsl;
-
- newsl = chunkalloc(sizeof(struct scriptlanglist));
- *newsl = *sl;
- newsl->next = NULL;
-
- if ( sl->lang_cnt>MAX_LANG ) {
- newsl->morelangs = galloc((newsl->lang_cnt-MAX_LANG)*sizeof(uint32));
- memcpy(newsl->morelangs,sl->morelangs,(newsl->lang_cnt-MAX_LANG)*sizeof(uint32));
- }
-return( newsl );
-}
-
-FeatureScriptLangList *FeatureListCopy(FeatureScriptLangList *fl) {
- FeatureScriptLangList *newfl;
- struct scriptlanglist *sl, *prev;
-
- newfl = chunkalloc(sizeof(FeatureScriptLangList));
- *newfl = *fl;
- newfl->next = NULL;
-
- prev = NULL;
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- if ( prev==NULL )
- newfl->scripts = prev = SLCopy(sl);
- else {
- prev->next = SLCopy(sl);
- prev = prev->next;
- }
- }
-return( newfl );
-}
-
-static void LangMerge(struct scriptlanglist *into, struct scriptlanglist *from) {
- int i,j;
- uint32 flang, tlang;
-
- for ( i=0 ; i<from->lang_cnt; ++i ) {
- flang = i<MAX_LANG ? from->langs[i] : from->morelangs[i-MAX_LANG];
- for ( j=0; j<into->lang_cnt; ++j ) {
- tlang = j<MAX_LANG ? into->langs[j] : into->morelangs[j-MAX_LANG];
- if ( tlang==flang )
- break;
- }
- if ( j==into->lang_cnt ) {
- if ( into->lang_cnt<MAX_LANG )
- into->langs[into->lang_cnt++] = flang;
- else {
- into->morelangs = grealloc(into->morelangs,(into->lang_cnt+1-MAX_LANG)*sizeof(uint32));
- into->morelangs[into->lang_cnt++-MAX_LANG] = flang;
- }
- }
- }
-}
-
-void SLMerge(FeatureScriptLangList *into, struct scriptlanglist *fsl) {
- struct scriptlanglist *isl;
-
- for ( ; fsl!=NULL; fsl = fsl->next ) {
- for ( isl=into->scripts; isl!=NULL; isl=isl->next ) {
- if ( fsl->script==isl->script )
- break;
- }
- if ( isl!=NULL )
- LangMerge(fsl,isl);
- else {
- isl = SLCopy(fsl);
- isl->next = into->scripts;
- into->scripts = isl;
- }
- }
-}
-
-void FLMerge(OTLookup *into, OTLookup *from) {
- /* Merge the feature list from "from" into "into" */
- FeatureScriptLangList *ifl, *ffl;
-
- /* first check for common featuretags and merge the scripts of each */
- for ( ffl = from->features; ffl!=NULL; ffl = ffl->next ) {
- for ( ifl=into->features; ifl!=NULL; ifl=ifl->next ) {
- if ( ffl->featuretag==ifl->featuretag )
- break;
- }
- if ( ifl!=NULL )
- SLMerge(ffl,ifl->scripts);
- else {
- ifl = FeatureListCopy(ffl);
- ifl->next = into->features;
- into->features = ifl;
- }
- }
- into->features = FLOrder(into->features);
-}
-
-void SFSubTablesMerge(SplineFont *_sf,struct lookup_subtable *subfirst,
- struct lookup_subtable *subsecond) {
- int lookup_type = subfirst->lookup->lookup_type;
- int gid,k,isv;
- SplineChar *sc;
- SplineFont *sf = _sf;
- PST *pst, *fpst, *spst, *pstprev, *pstnext;
- KernPair *fkp, *skp, *kpprev, *kpnext;
- AnchorClass *ac;
-
- if ( lookup_type != subsecond->lookup->lookup_type ) {
- IError("Attempt to merge lookup subtables with mismatch types");
-return;
- }
- if ( lookup_type != gsub_single &&
- lookup_type != gsub_multiple &&
- lookup_type != gsub_alternate &&
- lookup_type != gsub_ligature &&
- lookup_type != gpos_single &&
- lookup_type != gpos_pair &&
- lookup_type != gpos_cursive &&
- lookup_type != gpos_mark2base &&
- lookup_type != gpos_mark2ligature &&
- lookup_type != gpos_mark2mark ) {
- IError("Attempt to merge lookup subtables with bad types");
-return;
- } else if ( subfirst->kc!=NULL || subsecond->kc != NULL ) {
- IError("Attempt to merge lookup subtables with kerning classes");
-return;
- }
-
- if ( lookup_type==gpos_cursive || lookup_type==gpos_mark2base ||
- lookup_type==gpos_mark2ligature || lookup_type==gpos_mark2mark ) {
- for ( ac = sf->anchor; ac!=NULL ; ac=ac->next )
- if ( ac->subtable == subsecond )
- ac->subtable = subfirst;
- } else {
- k=0;
- do {
- sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
- if ( lookup_type==gsub_single || lookup_type==gsub_multiple ||
- lookup_type==gsub_alternate || lookup_type==gpos_single ) {
- fpst = spst = NULL;
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable == subfirst ) {
- fpst = pst;
- if ( spst!=NULL )
- break;
- } else if ( pst->subtable == subsecond ) {
- spst = pst;
- if ( fpst!=NULL )
- break;
- }
- }
- if ( fpst==NULL && spst!=NULL )
- spst->subtable = subfirst;
- else if ( spst!=NULL ) {
- LogError(_("The glyph, %s, contains a %s from %s and one from %s.\nThe one from %s will be removed.\n"),
- sc->name,
- lookup_type==gpos_single ? _("positioning") : _("substitution"),
- subfirst->subtable_name, subsecond->subtable_name,
- subsecond->subtable_name );
- pstprev = NULL;
- for ( pst=sc->possub; pst!=NULL && pst!=spst; pstprev=pst, pst=pst->next );
- if ( pstprev==NULL )
- sc->possub = spst->next;
- else
- pstprev = spst->next;
- spst->next = NULL;
- PSTFree(spst);
- }
- } else if ( lookup_type==gsub_ligature || lookup_type==gpos_pair ) {
- pstprev = NULL;
- for ( spst=sc->possub; spst!=NULL ; spst = pstnext ) {
- pstnext = spst->next;
- if ( spst->subtable == subsecond ) {
- for ( fpst=sc->possub; fpst!=NULL; fpst=fpst->next ) {
- if ( fpst->subtable == subfirst &&
- strcmp(fpst->u.lig.components,spst->u.lig.components)==0 )
- break;
- }
- if ( fpst==NULL )
- spst->subtable = subfirst;
- else {
- LogError(_("The glyph, %s, contains the same %s from %s and from %s.\nThe one from %s will be removed.\n"),
- sc->name,
- lookup_type==gsub_ligature ? _("ligature") : _("kern pair"),
- subfirst->subtable_name, subsecond->subtable_name,
- subsecond->subtable_name );
- if ( pstprev==NULL )
- sc->possub = pstnext;
- else
- pstprev->next = pstnext;
- spst->next = NULL;
- PSTFree(spst);
- spst = pstprev;
- }
- }
- pstprev = spst;
- }
- for ( isv=0; isv<2; ++isv ) {
- kpprev = NULL;
- for ( skp=isv ? sc->vkerns : sc->kerns; skp!=NULL ; skp = kpnext ) {
- kpnext = skp->next;
- if ( skp->subtable == subsecond ) {
- for ( fkp=isv ? sc->vkerns : sc->kerns; fkp!=NULL; fkp=fkp->next ) {
- if ( fkp->subtable == subfirst && fkp->sc==skp->sc )
- break;
- }
- if ( fkp==NULL )
- skp->subtable = subfirst;
- else {
- LogError(_("The glyph, %s, contains the same kern pair from %s and from %s.\nThe one from %s will be removed.\n"),
- sc->name,
- subfirst->subtable_name, subsecond->subtable_name,
- subsecond->subtable_name );
- if ( kpprev!=NULL )
- kpprev->next = kpnext;
- else if ( isv )
- sc->vkerns = kpnext;
- else
- sc->kerns = kpnext;
- skp->next = NULL;
- KernPairsFree(skp);
- skp = kpprev;
- }
- }
- kpprev = skp;
- }
- }
- }
- }
- ++k;
- } while ( k<_sf->subfontcnt );
- }
-}
-
-/* ************************************************************************** */
-/* ******************************* copy lookup ****************************** */
-/* ************************************************************************** */
-
-static char **ClassCopy(int class_cnt,char **classes) {
- char **newclasses;
- int i;
-
- if ( classes==NULL || class_cnt==0 )
-return( NULL );
- newclasses = galloc(class_cnt*sizeof(char *));
- for ( i=0; i<class_cnt; ++i )
- newclasses[i] = copy(classes[i]);
-return( newclasses );
-}
-
-static OTLookup *OTLookupCopyNested(SplineFont *to_sf,SplineFont *from_sf, char *prefix,
- OTLookup *from_otl) {
- char *newname;
- OTLookup *to_nested_otl;
-
- if ( from_otl==NULL )
-return( NULL );
- newname = strconcat(prefix,from_otl->lookup_name);
- to_nested_otl = SFFindLookup(to_sf,newname);
- free(newname);
- if ( to_nested_otl==NULL )
- to_nested_otl = OTLookupCopyInto(to_sf,from_sf, from_otl);
-return( to_nested_otl );
-}
-
-static KernClass *SF_AddKernClass(SplineFont *to_sf,KernClass *kc, struct lookup_subtable *sub,
- SplineFont *from_sf, char *prefix) {
- KernClass *newkc;
-
- newkc = chunkalloc(sizeof(KernClass));
- *newkc = *kc;
- newkc->subtable = sub;
- if ( sub->vertical_kerning ) {
- newkc->next = to_sf->vkerns;
- to_sf->vkerns = newkc;
- } else {
- newkc->next = to_sf->kerns;
- to_sf->kerns = newkc;
- }
-
- newkc->firsts = ClassCopy(newkc->first_cnt,newkc->firsts);
- newkc->seconds = ClassCopy(newkc->second_cnt,newkc->seconds);
- newkc->offsets = galloc(newkc->first_cnt*newkc->first_cnt*sizeof(int16));
- memcpy(newkc->offsets,kc->offsets,newkc->first_cnt*newkc->first_cnt*sizeof(int16));
-return( newkc );
-}
-
-static FPST *SF_AddFPST(SplineFont *to_sf,FPST *fpst, struct lookup_subtable *sub,
- SplineFont *from_sf, char *prefix) {
- FPST *newfpst;
- int i, k, cur;
-
- newfpst = chunkalloc(sizeof(FPST));
- *newfpst = *fpst;
- newfpst->subtable = sub;
- newfpst->next = to_sf->possub;
- to_sf->possub = newfpst;
-
- newfpst->nclass = ClassCopy(newfpst->nccnt,newfpst->nclass);
- newfpst->bclass = ClassCopy(newfpst->bccnt,newfpst->bclass);
- newfpst->fclass = ClassCopy(newfpst->fccnt,newfpst->fclass);
-
- newfpst->rules = galloc(newfpst->rule_cnt*sizeof(struct fpst_rule));
- memcpy(newfpst->rules,fpst->rules,newfpst->rule_cnt*sizeof(struct fpst_rule));
-
- cur = 0;
- for ( i=0; i<newfpst->rule_cnt; ++i ) {
- struct fpst_rule *r = &newfpst->rules[i], *oldr = &fpst->rules[i];
-
- r->lookups = galloc(r->lookup_cnt*sizeof(struct seqlookup));
- memcpy(r->lookups,oldr->lookups,r->lookup_cnt*sizeof(struct seqlookup));
- for ( k=0; k<r->lookup_cnt; ++k ) {
- r->lookups[k].lookup = OTLookupCopyNested(to_sf,from_sf, prefix,
- r->lookups[k].lookup);
- }
-
- switch ( newfpst->format ) {
- case pst_glyphs:
- r->u.glyph.names = copy( r->u.glyph.names );
- r->u.glyph.back = copy( r->u.glyph.back );
- r->u.glyph.fore = copy( r->u.glyph.fore );
- break;
- case pst_class:
- r->u.class.nclasses = galloc( r->u.class.ncnt*sizeof(uint16));
- memcpy(r->u.class.nclasses,oldr->u.class.nclasses, r->u.class.ncnt*sizeof(uint16));
- r->u.class.bclasses = galloc( r->u.class.bcnt*sizeof(uint16));
- memcpy(r->u.class.bclasses,oldr->u.class.bclasses, r->u.class.ncnt*sizeof(uint16));
- r->u.class.fclasses = galloc( r->u.class.fcnt*sizeof(uint16));
- memcpy(r->u.class.fclasses,oldr->u.class.fclasses, r->u.class.fcnt*sizeof(uint16));
- break;
- case pst_coverage:
- r->u.coverage.ncovers = ClassCopy( r->u.coverage.ncnt, r->u.coverage.ncovers );
- r->u.coverage.bcovers = ClassCopy( r->u.coverage.bcnt, r->u.coverage.bcovers );
- r->u.coverage.fcovers = ClassCopy( r->u.coverage.fcnt, r->u.coverage.fcovers );
- break;
- case pst_reversecoverage:
- r->u.rcoverage.ncovers = ClassCopy( r->u.rcoverage.always1, r->u.rcoverage.ncovers );
- r->u.rcoverage.bcovers = ClassCopy( r->u.rcoverage.bcnt, r->u.rcoverage.bcovers );
- r->u.rcoverage.fcovers = ClassCopy( r->u.rcoverage.fcnt, r->u.rcoverage.fcovers );
- r->u.rcoverage.replacements = copy( r->u.rcoverage.replacements );
- break;
- }
- }
-return( newfpst );
-}
-
-static ASM *SF_AddASM(SplineFont *to_sf,ASM *sm, struct lookup_subtable *sub,
- SplineFont *from_sf, char *prefix) {
- ASM *newsm;
- int i;
-
- newsm = chunkalloc(sizeof(ASM));
- *newsm = *sm;
- newsm->subtable = sub;
- newsm->next = to_sf->sm;
- to_sf->sm = newsm;
- to_sf->changed = true;
- newsm->classes = ClassCopy(newsm->class_cnt, newsm->classes);
- newsm->state = galloc(newsm->class_cnt*newsm->state_cnt*sizeof(struct asm_state));
- memcpy(newsm->state,sm->state,
- newsm->class_cnt*newsm->state_cnt*sizeof(struct asm_state));
- if ( newsm->type == asm_kern ) {
- for ( i=newsm->class_cnt*newsm->state_cnt-1; i>=0; --i ) {
- newsm->state[i].u.kern.kerns = galloc(newsm->state[i].u.kern.kcnt*sizeof(int16));
- memcpy(newsm->state[i].u.kern.kerns,sm->state[i].u.kern.kerns,newsm->state[i].u.kern.kcnt*sizeof(int16));
- }
- } else if ( newsm->type == asm_insert ) {
- for ( i=0; i<newsm->class_cnt*newsm->state_cnt; ++i ) {
- struct asm_state *this = &newsm->state[i];
- this->u.insert.mark_ins = copy(this->u.insert.mark_ins);
- this->u.insert.cur_ins = copy(this->u.insert.cur_ins);
- }
- } else if ( newsm->type == asm_context ) {
- for ( i=0; i<newsm->class_cnt*newsm->state_cnt; ++i ) {
- newsm->state[i].u.context.mark_lookup = OTLookupCopyNested(to_sf,from_sf, prefix,
- newsm->state[i].u.context.mark_lookup);
- newsm->state[i].u.context.cur_lookup = OTLookupCopyNested(to_sf,from_sf, prefix,
- newsm->state[i].u.context.cur_lookup);
- }
- }
-return( newsm );
-}
-
-static SplineChar *SCFindOrMake(SplineFont *into,SplineChar *fromsc) {
- int to_index;
-
- if ( into->cidmaster==NULL && into->fv!=NULL ) {
- to_index = SFFindSlot(into,into->fv->map,fromsc->unicodeenc,fromsc->name);
- if ( to_index==-1 )
-return( NULL );
-return( SFMakeChar(into,into->fv->map,to_index));
- }
-return( SFGetChar(into,fromsc->unicodeenc,fromsc->name));
-}
-
-static void SF_SCAddAP(SplineChar *tosc,AnchorPoint *ap, AnchorClass *newac) {
- AnchorPoint *newap;
-
- newap = chunkalloc(sizeof(AnchorPoint));
- *newap = *ap;
- newap->anchor = newac;
- newap->next = tosc->anchor;
- tosc->anchor = newap;
-}
-
-static void SF_AddAnchorClasses(SplineFont *to_sf,struct lookup_subtable *from_sub, struct lookup_subtable *sub,
- SplineFont *from_sf, char *prefix) {
- AnchorClass *ac, *nac;
- int k, gid;
- SplineFont *fsf;
- AnchorPoint *ap;
- SplineChar *fsc, *tsc;
-
- for ( ac=from_sf->anchor; ac!=NULL; ac=ac->next ) if ( ac->subtable==from_sub ) {
- nac = chunkalloc(sizeof(AnchorClass));
- *nac = *ac;
- nac->subtable = sub;
- nac->name = strconcat(prefix,nac->name);
- nac->next = to_sf->anchor;
- to_sf->anchor = nac;
-
- k=0;
- do {
- fsf = from_sf->subfontcnt==0 ? from_sf : from_sf->subfonts[k];
- for ( gid = 0; gid<fsf->glyphcnt; ++gid ) if ( (fsc = fsf->glyphs[gid])!=NULL ) {
- for ( ap=fsc->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor==ac ) {
- tsc = SCFindOrMake(to_sf,fsc);
- if ( tsc==NULL )
- break;
- SF_SCAddAP(tsc,ap,nac);
- }
- }
- }
- ++k;
- } while ( k<from_sf->subfontcnt );
- }
-}
-
-static int SF_SCAddPST(SplineChar *tosc,PST *pst,struct lookup_subtable *sub) {
- PST *newpst;
-
- newpst = chunkalloc(sizeof(PST));
- *newpst = *pst;
- newpst->subtable = sub;
- newpst->next = tosc->possub;
- tosc->possub = newpst;
-
- switch( newpst->type ) {
- case pst_pair:
- newpst->u.pair.paired = copy(pst->u.pair.paired);
- newpst->u.pair.vr = chunkalloc(sizeof(struct vr [2]));
- memcpy(newpst->u.pair.vr,pst->u.pair.vr,sizeof(struct vr [2]));
- break;
- case pst_ligature:
- newpst->u.lig.lig = tosc;
- /* Fall through */
- case pst_substitution:
- case pst_alternate:
- case pst_multiple:
- newpst->u.subs.variant = copy(pst->u.subs.variant);
- break;
- }
-return( true );
-}
-
-static int SF_SCAddKP(SplineChar *tosc,KernPair *kp,struct lookup_subtable *sub,
- int isvkern, SplineFont *to_sf ) {
- SplineChar *tosecond;
- KernPair *newkp;
-
- tosecond = SFGetChar(to_sf,kp->sc->unicodeenc,kp->sc->name);
- if ( tosecond==NULL )
-return( false );
-
- newkp = chunkalloc(sizeof(KernPair));
- *newkp = *kp;
- newkp->subtable = sub;
- newkp->sc = tosecond;
- if ( isvkern ) {
- newkp->next = tosc->vkerns;
- tosc->vkerns = newkp;
- } else {
- newkp->next = tosc->kerns;
- tosc->kerns = newkp;
- }
-return(true);
-}
-
-static void SF_AddPSTKern(SplineFont *to_sf,struct lookup_subtable *from_sub, struct lookup_subtable *sub,
- SplineFont *from_sf, char *prefix) {
- int k, gid, isv;
- SplineFont *fsf;
- SplineChar *fsc, *tsc;
- PST *pst;
- KernPair *kp;
- int iskern = sub->lookup->lookup_type==gpos_pair;
-
- k=0;
- do {
- fsf = from_sf->subfontcnt==0 ? from_sf : from_sf->subfonts[k];
- for ( gid = 0; gid<fsf->glyphcnt; ++gid ) if ( (fsc = fsf->glyphs[gid])!=NULL ) {
- tsc = (SplineChar *) -1;
- for ( pst = fsc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==from_sub ) {
- if ( tsc==(SplineChar *) -1 ) {
- tsc = SCFindOrMake(to_sf,fsc);
- if ( tsc==NULL )
- break;
- }
- SF_SCAddPST(tsc,pst,sub);
- }
- }
- if ( tsc!=NULL && iskern ) {
- for ( isv=0; isv<2 && tsc!=NULL; ++isv ) {
- for ( kp= isv ? fsc->vkerns : fsc->kerns; kp!=NULL; kp=kp->next ) {
- if ( kp->subtable==sub ) {
- /* Kerning data tend to be individualistic. Only copy if */
- /* glyphs exist */
- if ( tsc==(SplineChar *) -1 ) {
- tsc = SFGetChar(to_sf,fsc->unicodeenc,fsc->name);
- if ( tsc==NULL )
- break;
- }
- SF_SCAddKP(tsc,kp,sub,isv,to_sf);
- }
- }
- }
- }
- }
- ++k;
- } while ( k<from_sf->subfontcnt );
-}
-
-static void SortInsertLookup(SplineFont *sf, OTLookup *newotl) {
- int isgpos = newotl->lookup_type>=gpos_start;
- int pos, i, k;
- OTLookup *prev, *otl;
-
- pos = FeatureOrderId(isgpos,newotl->features);
- for ( prev=NULL, otl= isgpos ? sf->gpos_lookups : sf->gsub_lookups ;
- otl!=NULL && FeatureOrderId(isgpos,newotl->features)<pos;
- prev = otl, otl=otl->next );
- newotl->next = otl;
- if ( prev!=NULL )
- prev->next = newotl;
- else if ( isgpos )
- sf->gpos_lookups = newotl;
- else
- sf->gsub_lookups = newotl;
-
- if ( sf->fontinfo ) {
- struct lkdata *lk = &sf->fontinfo->tables[isgpos];
- if ( lk->cnt>=lk->max )
- lk->all = grealloc(lk->all,(lk->max+=10)*sizeof(struct lkinfo));
- for ( i=0; i<lk->cnt && FeatureOrderId(isgpos,lk->all[i].lookup->features)<pos; ++i );
- for ( k=lk->cnt; k>i+1; --k )
- lk->all[k] = lk->all[k-1];
- memset(&lk->all[k],0,sizeof(struct lkinfo));
- lk->all[k].lookup = newotl;
- ++lk->cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- GFI_LookupScrollbars(sf->fontinfo,isgpos, true);
- GFI_LookupEnableButtons(sf->fontinfo,isgpos);
-#endif
- }
-}
-
-OTLookup *OTLookupCopyInto(SplineFont *into_sf,SplineFont *from_sf, OTLookup *from_otl) {
- OTLookup *otl = chunkalloc(sizeof(OTLookup));
- struct lookup_subtable *sub, *last, *from_sub;
- char *prefix = strconcat(from_sf->fontname,"-");
-
- into_sf->changed = true;
-
- *otl = *from_otl;
- otl->lookup_name = strconcat(prefix,from_otl->lookup_name);
- otl->features = FeatureListCopy(from_otl->features);
- otl->next = NULL; otl->subtables = NULL;
- SortInsertLookup(into_sf,otl);
-
- last = NULL;
- for ( from_sub = from_otl->subtables; from_sub!=NULL; from_sub=from_sub->next ) {
- sub = chunkalloc(sizeof(struct lookup_subtable));
- *sub = *from_sub;
- sub->lookup = otl;
- sub->subtable_name = strconcat(prefix,from_sub->subtable_name);
- sub->suffix = copy(sub->suffix);
- if ( from_sub->kc!=NULL )
- sub->kc = SF_AddKernClass(into_sf, from_sub->kc, sub, from_sf, prefix);
- else if ( from_sub->fpst!=NULL )
- sub->fpst = SF_AddFPST(into_sf, from_sub->fpst, sub, from_sf, prefix);
- else if ( from_sub->sm!=NULL )
- sub->sm = SF_AddASM(into_sf, from_sub->sm, sub, from_sf, prefix);
- else if ( from_sub->anchor_classes )
- SF_AddAnchorClasses(into_sf, from_sub, sub, from_sf, prefix);
- else
- SF_AddPSTKern(into_sf, from_sub, sub, from_sf, prefix);
- }
-return( otl );
-}
-
-/* ************************************************************************** */
-/* ****************************** Apply lookups ***************************** */
-/* ************************************************************************** */
-
-struct lookup_data {
- struct opentype_str *str;
- int cnt, max;
-
- uint32 script;
- SplineFont *sf;
-
- struct lookup_subtable *lig_owner;
- int lcnt, lmax;
- SplineChar ***ligs; /* For each ligature we have an array of SplineChars that are its components preceded by the ligature glyph itself */
- /* NULL terminated */
-};
-
-static int ApplyLookupAtPos(uint32 tag, OTLookup *otl,struct lookup_data *data,int pos);
-
-static void LigatureFree(struct lookup_data *data) {
- int i;
-
- if ( data->ligs==NULL )
-return;
- for ( i=0; data->ligs[i]!=NULL; ++i )
- free(data->ligs[i]);
-}
-
-static void LigatureSearch(struct lookup_subtable *sub, struct lookup_data *data) {
- SplineFont *sf = data->sf;
- int gid, ccnt, cnt, ch, err;
- SplineChar *sc;
- PST *pst;
- char *pt, *start;
-
- LigatureFree(data);
- cnt = 0;
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) if ( pst->subtable==sub ) {
- for ( pt = pst->u.lig.components, ccnt=0; *pt; ++pt )
- if ( *pt==' ' )
- ++ccnt;
- if ( cnt>=data->lmax )
- data->ligs = grealloc(data->ligs,(data->lmax+=100)*sizeof(SplineChar **));
- data->ligs[cnt] = galloc((ccnt+3)*sizeof(SplineChar *));
- data->ligs[cnt][0] = sc;
- ccnt = 1;
- err = 0;
- for ( pt = pst->u.lig.components; *pt; ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- for ( start=pt; *pt!='\0' && *pt!=' '; ++pt );
- ch = *pt; *pt = '\0';
- data->ligs[cnt][ccnt++] = SFGetChar(sf,-1,start);
- *pt = ch;
- if ( data->ligs[cnt][ccnt-1]==NULL )
- err = 1;
- }
- if ( !err )
- data->ligs[cnt++][ccnt] = NULL;
- }
- }
- if ( cnt>=data->lmax )
- data->ligs = grealloc(data->ligs,(data->lmax+=1)*sizeof(SplineChar **));
- data->ligs[cnt] = NULL;
- data->lcnt = cnt;
-}
-
-static int GlyphNameInClass(char *name,char *class ) {
- char *pt;
- int len = strlen(name);
-
- pt = class;
- while ( (pt=strstr(pt,name))!=NULL ) {
- if ( pt==NULL )
-return( false );
- if ( (pt==class || pt[-1]==' ') && (pt[len]=='\0' || pt[len]==' '))
-return( true );
- pt+=len;
- }
-
-return( false );
-}
-
-static int skipglyphs(int lookup_flags, struct lookup_data *data, int pos) {
- int mc, glyph_class;
- /* The lookup flags tell us what glyphs to ignore. Skip over anything we */
- /* should ignore */
-
- if ( lookup_flags==0 )
-return( pos );
- mc = (lookup_flags>>8);
- if ( mc<0 || mc>=data->sf->mark_class_cnt )
- mc = 0;
- while ( pos<data->cnt ) {
- glyph_class = gdefclass(data->str[pos].sc);
- /* 1=>base, 2=>ligature, 3=>mark, 4=>component?, 0=>.notdef */
- if ( (glyph_class==1 && (lookup_flags&pst_ignorebaseglyphs)) ||
- (glyph_class==2 && (lookup_flags&pst_ignoreligatures)) ||
- (glyph_class==3 && (lookup_flags&pst_ignorecombiningmarks)) ||
- (glyph_class==3 && mc!=0 &&
- !GlyphNameInClass(data->str[pos].sc->name,data->sf->mark_classes[mc])) ) {
- ++pos;
- } else
- break;
- }
-return( pos );
-}
-
-static int bskipglyphs(int lookup_flags, struct lookup_data *data, int pos) {
- int mc, glyph_class;
- /* The lookup flags tell us what glyphs to ignore. Skip over anything we */
- /* should ignore. Here we skip backward */
-
- if ( lookup_flags==0 )
-return( pos );
- mc = (lookup_flags>>8);
- if ( mc<0 || mc>=data->sf->mark_class_cnt )
- mc = 0;
- while ( pos>=0 ) {
- glyph_class = gdefclass(data->str[pos].sc);
- /* 1=>base, 2=>ligature, 3=>mark, 4=>component?, 0=>.notdef */
- if ( (glyph_class==1 && (lookup_flags&pst_ignorebaseglyphs)) ||
- (glyph_class==2 && (lookup_flags&pst_ignoreligatures)) ||
- (glyph_class==3 && (lookup_flags&pst_ignorecombiningmarks)) ||
- (glyph_class==3 && mc!=0 &&
- !GlyphNameInClass(data->str[pos].sc->name,data->sf->mark_classes[mc])) ) {
- --pos;
- } else
- break;
- }
-return( pos );
-}
-
-static int ContextualMatch(struct lookup_subtable *sub,struct lookup_data *data,
- int pos, struct fpst_rule **_rule) {
- int i, cpos, retpos, r;
- FPST *fpst = sub->fpst;
- int lookup_flags = sub->lookup->lookup_flags;
- char *pt;
-
- /* If we should skip the current glyph then don't try for a match here */
- cpos = skipglyphs(lookup_flags,data,pos);
- if ( cpos!=pos )
-return( 0 );
-
- for ( r=0; r<fpst->rule_cnt; ++r ) {
- struct fpst_rule *rule = &fpst->rules[r];
- for ( i=pos; i<data->cnt; ++i )
- data->str[i].context_pos = -1;
-
-/* Handle backtrack (backtrace in the rule is stored in reverse textual order) */
- if ( fpst->type == pst_chainpos || fpst->type == pst_chainsub ) {
- if ( fpst->format==pst_glyphs ) {
- pt = rule->u.glyph.back;
- for ( i=bskipglyphs(lookup_flags,data,pos-1), cpos=0; i>=0; i = bskipglyphs(lookup_flags,data,i-1)) {
- char *name = data->str[i].sc->name;
- int len = strlen( name );
- if ( strncmp(name,pt,len)!=0 || (pt[len]!='\0' && pt[len]!=' '))
- break;
- pt += len;
- while ( *pt==' ' ) ++pt;
- }
- if ( *pt!='\0' )
- continue; /* didn't match */
- } else if ( fpst->format==pst_class ) {
- for ( i=bskipglyphs(lookup_flags,data,pos-1), cpos=0; i>=0 && cpos<rule->u.class.bcnt; i = bskipglyphs(lookup_flags,data,i-1)) {
- if ( !GlyphNameInClass(data->str[i].sc->name,fpst->bclass[rule->u.class.bclasses[cpos]]) )
- break;
- ++cpos;
- }
- if ( cpos!=rule->u.class.bcnt )
- continue; /* didn't match */
- } else if ( fpst->format==pst_coverage ) {
- for ( i=bskipglyphs(lookup_flags,data,pos-1), cpos=0; i>=0 && cpos<rule->u.coverage.bcnt; i = bskipglyphs(lookup_flags,data,i-1)) {
- if ( !GlyphNameInClass(data->str[i].sc->name,rule->u.coverage.bcovers[cpos]) )
- break;
- ++cpos;
- }
- if ( cpos<rule->u.coverage.bcnt )
- continue; /* didn't match */
- }
- }
-/* Handle Match */
- if ( fpst->format==pst_glyphs ) {
- pt = rule->u.glyph.names;
- for ( i=pos, cpos=0; i<data->cnt && *pt!='\0'; i = skipglyphs(lookup_flags,data,i+1)) {
- char *name = data->str[i].sc->name;
- int len = strlen( name );
- if ( strncmp(name,pt,len)!=0 || (pt[len]!='\0' && pt[len]!=' '))
- break;
- data->str[i].context_pos = cpos++;
- pt += len;
- while ( *pt==' ' ) ++pt;
- }
- if ( *pt!='\0' )
- continue; /* didn't match */
- } else if ( fpst->format==pst_class ) {
- for ( i=pos, cpos=0; i<data->cnt && cpos<rule->u.class.ncnt; i = skipglyphs(lookup_flags,data,i+1)) {
- if ( !GlyphNameInClass(data->str[i].sc->name,fpst->nclass[rule->u.class.nclasses[cpos]]) )
- break;
- data->str[i].context_pos = cpos++;
- }
- if ( cpos<rule->u.class.ncnt )
- continue; /* didn't match */
- } else if ( fpst->format==pst_coverage ) {
- for ( i=pos, cpos=0; i<data->cnt && cpos<rule->u.coverage.ncnt; i = skipglyphs(lookup_flags,data,i+1)) {
- if ( !GlyphNameInClass(data->str[i].sc->name,rule->u.coverage.ncovers[cpos]) )
- break;
- data->str[i].context_pos = cpos++;
- }
- if ( cpos<rule->u.coverage.ncnt )
- continue; /* didn't match */
- } else
-return( 0 ); /* Not ready to deal with reverse chainging */
-
- retpos = i;
-/* Handle lookahead */
- if ( fpst->type == pst_chainpos || fpst->type == pst_chainsub ) {
- if ( fpst->format==pst_glyphs ) {
- pt = rule->u.glyph.fore;
- for ( i=retpos; i<data->cnt && *pt!='\0'; i = skipglyphs(lookup_flags,data,i+1)) {
- char *name = data->str[i].sc->name;
- int len = strlen( name );
- if ( strncmp(name,pt,len)!=0 || (pt[len]!='\0' && pt[len]!=' '))
- break;
- pt += len;
- while ( *pt==' ' ) ++pt;
- }
- if ( *pt!='\0' )
- continue; /* didn't match */
- } else if ( fpst->format==pst_class ) {
- for ( i=retpos, cpos=0; i<data->cnt && cpos<rule->u.class.fcnt; i = skipglyphs(lookup_flags,data,i+1)) {
- if ( !GlyphNameInClass(data->str[i].sc->name,fpst->fclass[rule->u.class.fclasses[cpos]]) )
- break;
- cpos++;
- }
- if ( cpos<rule->u.class.fcnt )
- continue; /* didn't match */
- } else if ( fpst->format==pst_coverage ) {
- for ( i=retpos, cpos=0; i<data->cnt && cpos<rule->u.coverage.fcnt; i = skipglyphs(lookup_flags,data,i+1)) {
- if ( !GlyphNameInClass(data->str[i].sc->name,rule->u.coverage.fcovers[cpos]) )
- break;
- cpos++;
- }
- if ( cpos<rule->u.coverage.fcnt )
- continue; /* didn't match */
- }
- }
- *_rule = rule;
-return( retpos );
- }
-return( 0 );
-}
-
-static int ApplySingleSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- PST *pst;
- SplineChar *sc;
-
- for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
- if ( pst==NULL )
-return( 0 );
-
- sc = SFGetChar(data->sf,-1,pst->u.subs.variant);
- if ( sc==NULL )
-return( 0 );
- data->str[pos].sc = sc;
-return( pos+1 );
-}
-
-static int ApplyMultSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- PST *pst;
- SplineChar *sc;
- char *start, *pt;
- int mcnt, ch, i;
- SplineChar *mults[20];
-
- for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
- if ( pst==NULL )
-return( 0 );
-
- mcnt = 0;
- for ( start = pst->u.alt.components; *start==' '; ++start);
- for ( ; *start; ) {
- for ( pt=start; *pt!='\0' && *pt!=' '; ++pt );
- ch = *pt; *pt = '\0';
- sc = SFGetChar(data->sf,-1,start);
- *pt = ch;
- if ( sc==NULL )
-return( 0 );
- if ( mcnt<20 ) mults[mcnt++] = sc;
- while ( *pt==' ' ) ++pt;
- start = pt;
- }
-
- if ( mcnt==0 ) {
- /* Is this legal? that is can we remove a glyph with an empty multiple? */
- for ( i=pos+1; i<data->cnt; ++i )
- data->str[i-1] = data->str[i];
- --data->cnt;
-return( pos );
- } else if ( mcnt==1 ) {
- data->str[pos].sc = mults[0];
-return( pos+1 );
- } else {
- if ( data->cnt+mcnt-1 >= data->max )
- data->str = grealloc(data->str,(data->max+=mcnt) * sizeof( struct opentype_str ));
- for ( i=data->cnt-1; i>pos; --i )
- data->str[i+mcnt-1] = data->str[i];
- memset(data->str+pos,0,mcnt*sizeof(struct opentype_str));
- for ( i=0; i<mcnt; ++i ) {
- data->str[pos+i].sc = mults[i];
- data->str[pos+i].orig_index = data->str[pos].orig_index;
- }
-return( pos+mcnt );
- }
-}
-
-static int ApplyAltSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- PST *pst;
- SplineChar *sc;
- char *start, *pt, ch;
-
- for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
- if ( pst==NULL )
-return( 0 );
-
- for ( start = pst->u.alt.components; *start==' '; ++start);
- for ( ; *start; ) {
- for ( pt=start; *pt!='\0' && *pt!=' '; ++pt );
- ch = *pt; *pt = '\0';
- sc = SFGetChar(data->sf,-1,start);
- *pt = ch;
- if ( sc!=NULL ) {
- data->str[pos].sc = sc;
-return( pos+1 );
- }
- while ( *pt==' ' ) ++pt;
- start = pt;
- }
-return( 0 );
-}
-
-static int ApplyLigatureSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- int i,k, lpos, npos;
- int lookup_flags = sub->lookup->lookup_flags;
- int match_found = -1, match_len=0;
-
- if ( data->lig_owner!=sub )
- LigatureSearch(sub,data);
- for ( i=0; i<data->lcnt; ++i ) {
- if ( data->ligs[i][1]==data->str[pos].sc ) {
- lpos = 0;
- npos = pos+1;
- for ( k=2; data->ligs[i][k]!=NULL; ++k ) {
- npos = skipglyphs(lookup_flags,data,npos);
- if ( npos>=data->cnt || data->str[npos].sc != data->ligs[i][k] )
- break;
- ++npos;
- }
- if ( data->ligs[i][k]==NULL ) {
- if ( match_found==-1 || k>match_len ) {
- match_found = i;
- match_len = k;
- }
- }
- }
- }
- if ( match_found!=-1 ) {
- /* Matched. Remove the component glyphs, and note which component */
- /* any intervening marks should be attached to */
- data->str[pos].sc = data->ligs[match_found][0];
- npos = pos+1;
- for ( k=2; data->ligs[match_found][k]!=NULL; ++k ) {
- lpos = skipglyphs(lookup_flags,data,npos);
- for ( ; npos<lpos; ++npos )
- data->str[npos].lig_pos = k-2;
- /* Remove this glyph */
- for ( ++lpos; lpos<data->cnt; ++lpos )
- data->str[lpos-1] = data->str[lpos];
- --data->cnt;
- }
- /* Any marks after the last component (which should be attached */
- /* to it) will not have been tagged, so do that now */
- lpos = skipglyphs(lookup_flags,data,npos);
- for ( ; npos<lpos; ++npos )
- data->str[npos].lig_pos = k-2;
-return( pos+1 );
- }
-
-return( 0 );
-}
-
-static int ApplyContextual(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- /* On this level there is no difference between GPOS/GSUB contextuals */
- /* If the contextual matches, then we apply the lookups, otherwise we */
- /* don't. Now the lookups will be different, but we don't care here */
- struct fpst_rule *rule;
- int retpos, i,j;
-
- retpos = ContextualMatch(sub,data,pos,&rule);
- if ( retpos==0 )
-return( 0 );
- for ( i=0; i<rule->lookup_cnt; ++i ) {
- for ( j=pos; j<data->cnt; ++j ) {
- if ( data->str[j].context_pos == rule->lookups[i].seq ) {
- ApplyLookupAtPos(0,rule->lookups[i].lookup,data,j);
- break;
- }
- }
- }
-return( retpos );
-}
-
-static int ApplySinglePosAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- PST *pst;
-
- for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
- if ( pst==NULL )
-return( 0 );
-
- data->str[pos].vr.xoff += pst->u.pos.xoff;
- data->str[pos].vr.yoff += pst->u.pos.yoff;
- data->str[pos].vr.h_adv_off += pst->u.pos.h_adv_off;
- data->str[pos].vr.v_adv_off += pst->u.pos.v_adv_off;
-return( pos+1 );
-}
-
-static int ApplyPairPosAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- PST *pst;
- int npos, isv, within;
- KernPair *kp;
-
- npos = skipglyphs(sub->lookup->lookup_flags,data,pos+1);
- if ( npos>=data->cnt )
-return( 0 );
- if ( sub->kc!=NULL ) {
- within = KCFindIndex(sub->kc,data->str[pos].sc->name,data->str[npos].sc->name);
- if ( within==-1 )
-return( 0 );
- data->str[pos].kc_index = within;
- data->str[pos].kc = sub->kc;
- if ( sub->vertical_kerning )
- data->str[pos].vr.v_adv_off += sub->kc->offsets[within];
- else if ( sub->lookup->lookup_flags & pst_r2l )
- data->str[npos].vr.h_adv_off += sub->kc->offsets[within];
- else
- data->str[pos].vr.h_adv_off += sub->kc->offsets[within];
-return( pos+1 );
- } else {
- for ( pst=data->str[pos].sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==sub && strcmp(pst->u.pair.paired,data->str[npos].sc->name)==0 ) {
- data->str[pos].vr.xoff += pst->u.pair.vr[0].xoff;
- data->str[pos].vr.yoff += pst->u.pair.vr[0].yoff;
- data->str[pos].vr.h_adv_off += pst->u.pair.vr[0].h_adv_off;
- data->str[pos].vr.v_adv_off += pst->u.pair.vr[0].v_adv_off;
- data->str[npos].vr.xoff += pst->u.pair.vr[1].xoff;
- data->str[npos].vr.yoff += pst->u.pair.vr[1].yoff;
- data->str[npos].vr.h_adv_off += pst->u.pair.vr[1].h_adv_off;
- data->str[npos].vr.v_adv_off += pst->u.pair.vr[1].v_adv_off;
-return( pos+1 ); /* We do NOT want to return npos+1 */
- }
- }
- for ( isv = 0; isv<2; ++isv ) {
- for ( kp = isv ? data->str[pos].sc->vkerns : data->str[pos].sc->kerns; kp!=NULL; kp=kp->next ) {
- if ( kp->subtable == sub && kp->sc == data->str[npos].sc ) {
- data->str[pos].kp = kp;
- if ( isv )
- data->str[pos].vr.v_adv_off += kp->off;
- else if ( sub->lookup->lookup_flags & pst_r2l )
- data->str[npos].vr.h_adv_off += kp->off;
- else
- data->str[pos].vr.h_adv_off += kp->off;
-return( pos+1 );
- }
- }
- }
- }
-
-return( 0 );
-}
-
-static int ApplyAnchorPosAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
- AnchorPoint *ap1, *ap2;
- int npos;
-
- npos = skipglyphs(sub->lookup->lookup_flags,data,pos+1);
- if ( npos>=data->cnt )
-return( 0 );
- if ( sub->lookup->lookup_type == gpos_cursive ) {
- for ( ap1=data->str[pos].sc->anchor; ap1!=NULL ; ap1=ap1->next ) {
- if ( ap1->anchor->subtable==sub && ap1->type==at_cexit ) {
- for ( ap2 = data->str[npos].sc->anchor; ap2!=NULL; ap2=ap2->next ) {
- if ( ap2->anchor==ap1->anchor && ap2->type==at_centry )
- break;
- }
- if ( ap2!=NULL )
- break;
- }
- }
- } else if ( sub->lookup->lookup_type == gpos_mark2ligature ) {
- for ( ap1=data->str[pos].sc->anchor; ap1!=NULL ; ap1=ap1->next ) {
- if ( ap1->anchor->subtable==sub && ap1->type==at_baselig &&
- ap1->lig_index == data->str[npos].lig_pos ) {
- for ( ap2 = data->str[npos].sc->anchor; ap2!=NULL; ap2=ap2->next ) {
- if ( ap2->anchor==ap1->anchor && ap2->type==at_mark )
- break;
- }
- if ( ap2!=NULL )
- break;
- }
- }
- } else {
- for ( ap1=data->str[pos].sc->anchor; ap1!=NULL ; ap1=ap1->next ) {
- if ( ap1->anchor->subtable==sub && (ap1->type==at_basechar || ap1->type==at_basemark)) {
- for ( ap2 = data->str[npos].sc->anchor; ap2!=NULL; ap2=ap2->next ) {
- if ( ap2->anchor==ap1->anchor && ap2->type==at_mark )
- break;
- }
- if ( ap2!=NULL )
- break;
- }
- }
- }
- if ( ap1==NULL )
-return( 0 );
-
- data->str[npos].vr.yoff = ap1->me.y - ap2->me.y;
- if ( sub->lookup->lookup_flags&pst_r2l ) {
- data->str[npos].vr.xoff = -(ap1->me.x - ap2->me.x);
- } else {
- data->str[npos].vr.xoff = ap1->me.x - ap2->me.x - data->str[pos].sc->width;
- }
-return( pos+1 );
-}
-
-static int ConditionalTagOk(uint32 tag, OTLookup *otl,struct lookup_data *data,int pos) {
- int npos, bpos;
- uint32 script;
- int before_in_script, after_in_script;
-
- if ( tag==CHR('i','n','i','t') || tag==CHR('i','s','o','l') ||
- tag==CHR('f','i','n','a') || tag==CHR('m','e','d','i') ) {
- npos = skipglyphs(otl->lookup_flags,data,pos+1);
- bpos = bskipglyphs(otl->lookup_flags,data,pos-1);
- script = SCScriptFromUnicode(data->str[pos].sc);
- before_in_script = (bpos>=0 && SCScriptFromUnicode(data->str[bpos].sc)==script);
- after_in_script = (npos<data->cnt && SCScriptFromUnicode(data->str[npos].sc)==script);
- if ( tag==CHR('i','n','i','t') )
-return( !before_in_script && after_in_script );
- else if ( tag==CHR('i','s','o','l') )
-return( !before_in_script && !after_in_script );
- else if ( tag==CHR('f','i','n','a') )
-return( before_in_script && !after_in_script );
- else
-return( before_in_script && after_in_script );
- }
-
-return( true );
-}
-
-static int ApplyLookupAtPos(uint32 tag, OTLookup *otl,struct lookup_data *data,int pos) {
- struct lookup_subtable *sub;
- int newpos;
-
- /* Some tags imply a conditional check. Do that now */
- if ( !ConditionalTagOk(tag,otl,data,pos))
-return( 0 );
-
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- switch ( otl->lookup_type ) {
- case gsub_single:
- newpos = ApplySingleSubsAtPos(sub,data,pos);
- break;
- case gsub_multiple:
- newpos = ApplyMultSubsAtPos(sub,data,pos);
- break;
- case gsub_alternate:
- newpos = ApplyAltSubsAtPos(sub,data,pos);
- break;
- case gsub_ligature:
- newpos = ApplyLigatureSubsAtPos(sub,data,pos);
- break;
- case gsub_context:
- newpos = ApplyContextual(sub,data,pos);
- break;
- case gsub_contextchain:
- newpos = ApplyContextual(sub,data,pos);
- break;
- case gsub_reversecchain:
- newpos = ApplySingleSubsAtPos(sub,data,pos);
- break;
-
- case gpos_single:
- newpos = ApplySinglePosAtPos(sub,data,pos);
- break;
- case gpos_pair:
- newpos = ApplyPairPosAtPos(sub,data,pos);
- break;
- case gpos_cursive:
- newpos = ApplyAnchorPosAtPos(sub,data,pos);
- break;
- case gpos_mark2base:
- newpos = ApplyAnchorPosAtPos(sub,data,pos);
- break;
- case gpos_mark2ligature:
- newpos = ApplyAnchorPosAtPos(sub,data,pos);
- break;
- case gpos_mark2mark:
- newpos = ApplyAnchorPosAtPos(sub,data,pos);
- break;
- case gpos_context:
- newpos = ApplyContextual(sub,data,pos);
- break;
- case gpos_contextchain:
- newpos = ApplyContextual(sub,data,pos);
- break;
- default:
- /* apple state machines */
- newpos = 0;
- break;
- }
- /* if a subtable worked, we don't try to apply the next one */
- if ( newpos!=0 )
-return( newpos );
- }
-return( 0 );
-}
-
-static void ApplyLookup(uint32 tag, OTLookup *otl,struct lookup_data *data) {
- int pos, npos;
-
- for ( pos = 0; pos<data->cnt; ) {
- npos = ApplyLookupAtPos(tag,otl,data,pos);
- if ( npos==0 )
- npos = pos+1;
- pos = npos;
- }
-}
-
-static uint32 FSLLMatches(FeatureScriptLangList *fl,uint32 *flist,uint32 script,uint32 lang) {
- int i,l;
- struct scriptlanglist *sl;
-
- while ( fl!=NULL ) {
- for ( i=0; flist[i]!=0; ++i ) {
- if ( fl->featuretag==flist[i] )
- break;
- }
- if ( flist[i]!=0 ) {
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- if ( sl->script == script ) {
- for ( l=0; l<sl->lang_cnt; ++l )
- if ( (l<MAX_LANG && sl->langs[l]==lang) ||
- (l>=MAX_LANG && sl->morelangs[l-MAX_LANG]==lang))
-return( fl->featuretag );
- }
- }
- }
- fl = fl->next;
- }
-return( 0 );
-}
-
-/* This routine takes a string of glyphs and applies the opentype transformations */
-/* indicated by the features (and script and language) we are passed, it returns */
-/* a transformed string with substitutions applied and containing positioning */
-/* info */
-struct opentype_str *ApplyTickedFeatures(SplineFont *sf,uint32 *flist, uint32 script, uint32 lang,
- SplineChar **glyphs) {
- int isgpos, cnt;
- OTLookup *otl;
- struct lookup_data data;
- uint32 *langs, templang;
- int i;
-
- memset(&data,0,sizeof(data));
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt );
- data.str = gcalloc(cnt+1,sizeof(struct opentype_str));
- data.cnt = data.max = cnt;
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt ) {
- data.str[cnt].sc = glyphs[cnt];
- data.str[cnt].orig_index = cnt;
- }
- if ( sf->cidmaster!=NULL ) sf=sf->cidmaster;
- data.sf = sf;
-
- /* Indic glyph reordering???? */
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- /* Check that this table has an entry for this language */
- /* if it doesn't use the default language */
- /* GPOS/GSUB may have different language sets, so we must be prepared */
- templang = lang;
- langs = SFLangsInScript(sf,isgpos,script);
- for ( i=0; langs[i]!=0 && langs[i]!=lang; ++i );
- if ( langs[i]==0 )
- templang = DEFAULT_LANG;
- free(langs);
-
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL ; otl = otl->next ) {
- uint32 tag;
- if ( (tag=FSLLMatches(otl->features,flist,script,templang))!=0 )
- ApplyLookup(tag,otl,&data);
- }
- }
- LigatureFree(&data);
- free(data.ligs);
-
- data.str = grealloc(data.str,(data.cnt+1)*sizeof(struct opentype_str));
- memset(&data.str[data.cnt],0,sizeof(struct opentype_str));
-return( data.str );
-}
-
-/* ************************************************************************** */
-/* ******************************* UI routines ****************************** */
-/* ************************************************************************** */
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-GTextInfo **SFLookupListFromType(SplineFont *sf, int lookup_type ) {
- int isgpos = (lookup_type>=gpos_start);
- int k, cnt;
- OTLookup *otl;
- GTextInfo **ti;
-
- for ( k=0; k<2; ++k ) {
- cnt = 0;
- for ( otl= isgpos ? sf->gpos_lookups : sf->gsub_lookups ; otl!=NULL; otl=otl->next ) {
- if ( lookup_type==gsub_start || lookup_type==gpos_start ||
- otl->lookup_type == lookup_type ) {
- if ( k ) {
- ti[cnt] = gcalloc(1,sizeof(GTextInfo));
- ti[cnt]->userdata = (void *) otl;
- ti[cnt]->fg = ti[cnt]->bg = COLOR_DEFAULT;
- ti[cnt]->text = utf82u_copy(otl->lookup_name);
- }
- ++cnt;
- }
- }
- if ( !k )
- ti = gcalloc(cnt+2,sizeof(GTextInfo *));
- else
- ti[cnt] = gcalloc(1,sizeof(GTextInfo));
- }
-return( ti );
-}
-
-/* ************************************************************************** */
-/* ********************** Lookup dialog and subdialogs ********************** */
-/* ************************************************************************** */
-
-static GTextInfo gsub_lookuptypes[] = {
- { (unichar_t *) N_("Lookup Type|Unspecified"), NULL, 0, 0, (void *) ot_undef, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Single Substitution"), NULL, 0, 0, (void *) gsub_single, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Multiple Substitution"), NULL, 0, 0, (void *) gsub_multiple, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Alternate Substitution"), NULL, 0, 0, (void *) gsub_alternate, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Ligature Substitution"), NULL, 0, 0, (void *) gsub_ligature, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Contextual Substitution"), NULL, 0, 0, (void *) gsub_context, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Contextual Chaining Substitution"), NULL, 0, 0, (void *) gsub_contextchain, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Reverse Chaining Substitution"), NULL, 0, 0, (void *) gsub_reversecchain, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL, NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 1}, /* Line */
- { (unichar_t *) N_("Mac Indic State Machine"), NULL, 0, 0, (void *) morx_indic, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mac Contextual State Machine"), NULL, 0, 0, (void *) morx_context, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mac Insertion State Machine"), NULL, 0, 0, (void *) morx_insert, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo gpos_lookuptypes[] = {
- { (unichar_t *) N_("Lookup Type|Unspecified"), NULL, 0, 0, (void *) ot_undef, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Single Position"), NULL, 0, 0, (void *) gpos_single, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Pair Position (kerning)"), NULL, 0, 0, (void *) gpos_pair, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Cursive Position"), NULL, 0, 0, (void *) gpos_cursive, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mark to Base Position"), NULL, 0, 0, (void *) gpos_mark2base, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mark to Ligature Position"), NULL, 0, 0, (void *) gpos_mark2ligature, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mark to Mark Position"), NULL, 0, 0, (void *) gpos_mark2mark, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Contextual Position"), NULL, 0, 0, (void *) gpos_context, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Contextual Chaining Position"), NULL, 0, 0, (void *) gpos_contextchain, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL, NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 1}, /* Line */
- { (unichar_t *) N_("Mac Kerning State Machine"), NULL, 0, 0, (void *) kern_statemachine, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-static GTextInfo *lookuptypes[2] = { gsub_lookuptypes, gpos_lookuptypes };
-
- /* see also list in tottfgpos.c mapping code points to scripts */
-GTextInfo scripts[] = {
-/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "Arabic", ignore "Script|" */
- { (unichar_t *) N_("Script|Arabic"), NULL, 0, 0, (void *) CHR('a','r','a','b'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Aramaic"), NULL, 0, 0, (void *) CHR('a','r','a','m'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Armenian"), NULL, 0, 0, (void *) CHR('a','r','m','n'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Avestan"), NULL, 0, 0, (void *) CHR('a','v','e','s'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Balinese"), NULL, 0, 0, (void *) CHR('b','a','l','i'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Batak"), NULL, 0, 0, (void *) CHR('b','a','t','k'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Bengali"), NULL, 0, 0, (void *) CHR('b','e','n','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Bengali2"), NULL, 0, 0, (void *) CHR('b','n','g','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bliss Symbolics"), NULL, 0, 0, (void *) CHR('b','l','i','s'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bopomofo"), NULL, 0, 0, (void *) CHR('b','o','p','o'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) NU_("BrÄhmÄ«"), NULL, 0, 0, (void *) CHR('b','r','a','h'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Braille"), NULL, 0, 0, (void *) CHR('b','r','a','i'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Buginese"), NULL, 0, 0, (void *) CHR('b','u','g','i'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Buhid"), NULL, 0, 0, (void *) CHR('b','u','h','d'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Byzantine Music"), NULL, 0, 0, (void *) CHR('b','y','z','m'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Canadian Syllabics"), NULL, 0, 0, (void *) CHR('c','a','n','s'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Cham"), NULL, 0, 0, (void *) CHR('c','h','a','m'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Cherokee"), NULL, 0, 0, (void *) CHR('c','h','e','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Cirth"), NULL, 0, 0, (void *) CHR('c','i','r','t'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("CJK Ideographic"), NULL, 0, 0, (void *) CHR('h','a','n','i'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Coptic"), NULL, 0, 0, (void *) CHR('c','o','p','t'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Cypro-Minoan"), NULL, 0, 0, (void *) CHR('c','p','r','t'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Cypriot syllabary"), NULL, 0, 0, (void *) CHR('c','p','m','n'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Cyrillic"), NULL, 0, 0, (void *) CHR('c','y','r','l'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Default"), NULL, 0, 0, (void *) CHR('D','F','L','T'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Deseret (Mormon)"), NULL, 0, 0, (void *) CHR('d','s','r','t'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Devanagari"), NULL, 0, 0, (void *) CHR('d','e','v','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Devanagari2"), NULL, 0, 0, (void *) CHR('d','e','v','2'), NULL, false, false, false, false, false, false, true },
-/* { (unichar_t *) N_("Egyptian demotic"), NULL, 0, 0, (void *) CHR('e','g','y','d'), NULL, false, false, false, false, false, false, true }, */
-/* { (unichar_t *) N_("Egyptian hieratic"), NULL, 0, 0, (void *) CHR('e','g','y','h'), NULL, false, false, false, false, false, false, true }, */
-/* GT: Someone asked if FontForge actually was prepared generate hieroglyph output */
-/* GT: because of this string. No. But OpenType and Unicode have placeholders for */
-/* GT: dealing with these scripts against the day someone wants to use them. So */
-/* GT: FontForge must be prepared to deal with those placeholders if nothing else. */
-/* { (unichar_t *) N_("Egyptian hieroglyphs"), NULL, 0, 0, (void *) CHR('e','g','y','p'), NULL, false, false, false, false, false, false, true }, */
- { (unichar_t *) N_("Script|Ethiopic"), NULL, 0, 0, (void *) CHR('e','t','h','i'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Georgian"), NULL, 0, 0, (void *) CHR('g','e','o','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Glagolitic"), NULL, 0, 0, (void *) CHR('g','l','a','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gothic"), NULL, 0, 0, (void *) CHR('g','o','t','h'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Greek"), NULL, 0, 0, (void *) CHR('g','r','e','k'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Gujarati"), NULL, 0, 0, (void *) CHR('g','u','j','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Gujarati2"), NULL, 0, 0, (void *) CHR('g','j','r','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gurmukhi"), NULL, 0, 0, (void *) CHR('g','u','r','u'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gurmukhi2"), NULL, 0, 0, (void *) CHR('g','u','r','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hangul Jamo"), NULL, 0, 0, (void *) CHR('j','a','m','o'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hangul"), NULL, 0, 0, (void *) CHR('h','a','n','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) NU_("Script|Hanunóo"), NULL, 0, 0, (void *) CHR('h','a','n','o'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Hebrew"), NULL, 0, 0, (void *) CHR('h','e','b','r'), NULL, false, false, false, false, false, false, true },
-/* { (unichar_t *) N_("Pahawh Hmong"), NULL, 0, 0, (void *) CHR('h','m','n','g'), NULL, false, false, false, false, false, false, true },*/
-/* { (unichar_t *) N_("Indus (Harappan)"), NULL, 0, 0, (void *) CHR('i','n','d','s'), NULL, false, false, false, false, false, false, true },*/
- { (unichar_t *) N_("Script|Javanese"), NULL, 0, 0, (void *) CHR('j','a','v','a'), NULL, false, false, false, false, false, false, true },
-/* { (unichar_t *) N_("Kayah Li"), NULL, 0, 0, (void *) CHR('k','a','l','i'), NULL, false, false, false, false, false, false, true },*/
- { (unichar_t *) N_("Hiragana & Katakana"), NULL, 0, 0, (void *) CHR('k','a','n','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) NU_("Kharoṣṭhī"), NULL, 0, 0, (void *) CHR('k','h','a','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Kannada"), NULL, 0, 0, (void *) CHR('k','n','d','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Kannada2"), NULL, 0, 0, (void *) CHR('k','n','d','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Khmer"), NULL, 0, 0, (void *) CHR('k','h','m','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Kharosthi"), NULL, 0, 0, (void *) CHR('k','h','a','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Lao") , NULL, 0, 0, (void *) CHR('l','a','o',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Latin"), NULL, 0, 0, (void *) CHR('l','a','t','n'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) NU_("Lepcha (Róng)"), NULL, 0, 0, (void *) CHR('l','e','p','c'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Limbu"), NULL, 0, 0, (void *) CHR('l','i','m','b'), NULL, false, false, false, false, false, false, true }, /* Not in ISO 15924 !!!!!, just guessing */
- { (unichar_t *) N_("Linear A"), NULL, 0, 0, (void *) CHR('l','i','n','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Linear B"), NULL, 0, 0, (void *) CHR('l','i','n','b'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Mandaean"), NULL, 0, 0, (void *) CHR('m','a','n','d'), NULL, false, false, false, false, false, false, true },
-/* { (unichar_t *) N_("Mayan hieroglyphs"), NULL, 0, 0, (void *) CHR('m','a','y','a'), NULL, false, false, false, false, false, false, true },*/
- { (unichar_t *) NU_("Script|MalayÄlam"), NULL, 0, 0, (void *) CHR('m','l','y','m'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) NU_("Script|MalayÄlam2"), NULL, 0, 0, (void *) CHR('m','l','y','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) NU_("Mathematical Alphanumeric Symbols"), NULL, 0, 0, (void *) CHR('m','a','t','h'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Mongolian"), NULL, 0, 0, (void *) CHR('m','o','n','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Musical"), NULL, 0, 0, (void *) CHR('m','u','s','i'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Myanmar"), NULL, 0, 0, (void *) CHR('m','y','m','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("N'Ko"), NULL, 0, 0, (void *) CHR('n','k','o',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ogham"), NULL, 0, 0, (void *) CHR('o','g','a','m'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Old Italic (Etruscan, Oscan, etc.)"), NULL, 0, 0, (void *) CHR('i','t','a','l'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Old Permic"), NULL, 0, 0, (void *) CHR('p','e','r','m'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Old Persian cuneiform"), NULL, 0, 0, (void *) CHR('x','p','e','o'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Oriya"), NULL, 0, 0, (void *) CHR('o','r','y','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Oriya2"), NULL, 0, 0, (void *) CHR('o','r','y','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Osmanya"), NULL, 0, 0, (void *) CHR('o','s','m','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Pahlavi"), NULL, 0, 0, (void *) CHR('p','a','l','v'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Phags-pa"), NULL, 0, 0, (void *) CHR('p','h','a','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Phoenician"), NULL, 0, 0, (void *) CHR('p','h','n','x'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Phaistos"), NULL, 0, 0, (void *) CHR('p','h','s','t'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Pollard Phonetic"), NULL, 0, 0, (void *) CHR('p','l','r','d'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Rongorongo"), NULL, 0, 0, (void *) CHR('r','o','r','o'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Runic"), NULL, 0, 0, (void *) CHR('r','u','n','r'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Shavian"), NULL, 0, 0, (void *) CHR('s','h','a','w'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Sinhala"), NULL, 0, 0, (void *) CHR('s','i','n','h'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Sumero-Akkadian Cuneiform"), NULL, 0, 0, (void *) CHR('x','s','u','x'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Syloti Nagri"), NULL, 0, 0, (void *) CHR('s','y','l','o'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Syriac"), NULL, 0, 0, (void *) CHR('s','y','r','c'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Tagalog"), NULL, 0, 0, (void *) CHR('t','g','l','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Tagbanwa"), NULL, 0, 0, (void *) CHR('t','a','g','b'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tai Le"), NULL, 0, 0, (void *) CHR('t','a','l','e'), NULL, false, false, false, false, false, false, true }, /* Not in ISO 15924 !!!!!, just guessing */
- { (unichar_t *) N_("Tai Lu"), NULL, 0, 0, (void *) CHR('t','a','l','a'), NULL, false, false, false, false, false, false, true }, /* Not in ISO 15924 !!!!!, just guessing */
- { (unichar_t *) N_("Script|Tamil"), NULL, 0, 0, (void *) CHR('t','a','m','l'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Tamil2"), NULL, 0, 0, (void *) CHR('t','m','l','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Telugu"), NULL, 0, 0, (void *) CHR('t','e','l','u'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Telugu2"), NULL, 0, 0, (void *) CHR('t','e','l','2'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tengwar"), NULL, 0, 0, (void *) CHR('t','e','n','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Thaana"), NULL, 0, 0, (void *) CHR('t','h','a','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Thai"), NULL, 0, 0, (void *) CHR('t','h','a','i'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Tibetan"), NULL, 0, 0, (void *) CHR('t','i','b','t'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tifinagh (Berber)"), NULL, 0, 0, (void *) CHR('t','f','n','g'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Ugaritic"), NULL, 0, 0, (void *) CHR('u','g','r','t'), NULL, false, false, false, false, false, false, true }, /* Not in ISO 15924 !!!!!, just guessing */
- { (unichar_t *) N_("Script|Vai"), NULL, 0, 0, (void *) CHR('v','a','i',' '), NULL, false, false, false, false, false, false, true },
-/* { (unichar_t *) N_("Visible Speech"), NULL, 0, 0, (void *) CHR('v','i','s','p'), NULL, false, false, false, false, false, false, true },*/
- { (unichar_t *) N_("Cuneiform, Ugaritic"), NULL, 0, 0, (void *) CHR('x','u','g','a'), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Script|Yi") , NULL, 0, 0, (void *) CHR('y','i',' ',' '), NULL, false, false, false, false, false, false, true },
-/* { (unichar_t *) N_("Private Use Script 1") , NULL, 0, 0, (void *) CHR('q','a','a','a'), NULL, false, false, false, false, false, false, true },*/
-/* { (unichar_t *) N_("Private Use Script 2") , NULL, 0, 0, (void *) CHR('q','a','a','b'), NULL, false, false, false, false, false, false, true },*/
-/* { (unichar_t *) N_("Undetermined Script") , NULL, 0, 0, (void *) CHR('z','y','y','y'), NULL, false, false, false, false, false, false, true },*/
-/* { (unichar_t *) N_("Uncoded Script") , NULL, 0, 0, (void *) CHR('z','z','z','z'), NULL, false, false, false, false, false, false, true },*/
- { NULL }
-};
-
-GTextInfo languages[] = {
- { (unichar_t *) N_("Abaza"), NULL, 0, 0, (void *) CHR('A','B','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Abkhazian"), NULL, 0, 0, (void *) CHR('A','B','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Adyghe"), NULL, 0, 0, (void *) CHR('A','D','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Afrikaans"), NULL, 0, 0, (void *) CHR('A','F','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Afar"), NULL, 0, 0, (void *) CHR('A','F','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Agaw"), NULL, 0, 0, (void *) CHR('A','G','W',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Altai"), NULL, 0, 0, (void *) CHR('A','L','T',' '), NULL, false, false, false, false, false, false, true },
-/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "Amharic", ignore "Lang|" */
- { (unichar_t *) N_("Lang|Amharic"), NULL, 0, 0, (void *) CHR('A','M','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Arabic"), NULL, 0, 0, (void *) CHR('A','R','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Aari"), NULL, 0, 0, (void *) CHR('A','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Arakanese"), NULL, 0, 0, (void *) CHR('A','R','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Assamese"), NULL, 0, 0, (void *) CHR('A','S','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Athapaskan"), NULL, 0, 0, (void *) CHR('A','T','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Avar"), NULL, 0, 0, (void *) CHR('A','V','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Awadhi"), NULL, 0, 0, (void *) CHR('A','W','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Aymara"), NULL, 0, 0, (void *) CHR('A','Y','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Azeri"), NULL, 0, 0, (void *) CHR('A','Z','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Badaga"), NULL, 0, 0, (void *) CHR('B','A','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Baghelkhandi"), NULL, 0, 0, (void *) CHR('B','A','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Balkar"), NULL, 0, 0, (void *) CHR('B','A','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Baule"), NULL, 0, 0, (void *) CHR('B','A','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Berber"), NULL, 0, 0, (void *) CHR('B','B','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bench"), NULL, 0, 0, (void *) CHR('B','C','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bible Cree"), NULL, 0, 0, (void *) CHR('B','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Belarussian"), NULL, 0, 0, (void *) CHR('B','E','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bemba"), NULL, 0, 0, (void *) CHR('B','E','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Bengali"), NULL, 0, 0, (void *) CHR('B','E','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bulgarian"), NULL, 0, 0, (void *) CHR('B','G','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bhili"), NULL, 0, 0, (void *) CHR('B','H','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bhojpuri"), NULL, 0, 0, (void *) CHR('B','H','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bikol"), NULL, 0, 0, (void *) CHR('B','I','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bilen"), NULL, 0, 0, (void *) CHR('B','I','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Blackfoot"), NULL, 0, 0, (void *) CHR('B','K','F',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Balochi"), NULL, 0, 0, (void *) CHR('B','L','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Balante"), NULL, 0, 0, (void *) CHR('B','L','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Balti"), NULL, 0, 0, (void *) CHR('B','L','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bambara"), NULL, 0, 0, (void *) CHR('B','M','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bamileke"), NULL, 0, 0, (void *) CHR('B','M','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Breton"), NULL, 0, 0, (void *) CHR('B','R','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Brahui"), NULL, 0, 0, (void *) CHR('B','R','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Braj Bhasha"), NULL, 0, 0, (void *) CHR('B','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Burmese"), NULL, 0, 0, (void *) CHR('B','R','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Bashkir"), NULL, 0, 0, (void *) CHR('B','S','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Beti"), NULL, 0, 0, (void *) CHR('B','T','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Catalan"), NULL, 0, 0, (void *) CHR('C','A','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Cebuano"), NULL, 0, 0, (void *) CHR('C','E','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chechen"), NULL, 0, 0, (void *) CHR('C','H','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chaha Gurage"), NULL, 0, 0, (void *) CHR('C','H','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chattisgarhi"), NULL, 0, 0, (void *) CHR('C','H','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chichewa"), NULL, 0, 0, (void *) CHR('C','H','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chukchi"), NULL, 0, 0, (void *) CHR('C','H','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chipewyan"), NULL, 0, 0, (void *) CHR('C','H','P',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Cherokee"), NULL, 0, 0, (void *) CHR('C','H','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chuvash"), NULL, 0, 0, (void *) CHR('C','H','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Comorian"), NULL, 0, 0, (void *) CHR('C','M','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Coptic"), NULL, 0, 0, (void *) CHR('C','O','P',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Cree"), NULL, 0, 0, (void *) CHR('C','R','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Carrier"), NULL, 0, 0, (void *) CHR('C','R','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Crimean Tatar"), NULL, 0, 0, (void *) CHR('C','R','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Church Slavonic"), NULL, 0, 0, (void *) CHR('C','S','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Czech"), NULL, 0, 0, (void *) CHR('C','S','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Danish"), NULL, 0, 0, (void *) CHR('D','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dargwa"), NULL, 0, 0, (void *) CHR('D','A','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Default"), NULL, 0, 0, (void *) DEFAULT_LANG, NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Woods Cree"), NULL, 0, 0, (void *) CHR('D','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("German (Standard)"), NULL, 0, 0, (void *) CHR('D','E','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dogri"), NULL, 0, 0, (void *) CHR('D','G','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dhivehi"), NULL, 0, 0, (void *) CHR('D','H','V',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Djerma"), NULL, 0, 0, (void *) CHR('D','J','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dangme"), NULL, 0, 0, (void *) CHR('D','N','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dinka"), NULL, 0, 0, (void *) CHR('D','N','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dungan"), NULL, 0, 0, (void *) CHR('D','U','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dzongkha"), NULL, 0, 0, (void *) CHR('D','Z','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ebira"), NULL, 0, 0, (void *) CHR('E','B','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Eastern Cree"), NULL, 0, 0, (void *) CHR('E','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Edo"), NULL, 0, 0, (void *) CHR('E','D','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Efik"), NULL, 0, 0, (void *) CHR('E','F','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Greek"), NULL, 0, 0, (void *) CHR('E','L','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("English"), NULL, 0, 0, (void *) CHR('E','N','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Erzya"), NULL, 0, 0, (void *) CHR('E','R','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Spanish"), NULL, 0, 0, (void *) CHR('E','S','P',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Estonian"), NULL, 0, 0, (void *) CHR('E','T','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Basque"), NULL, 0, 0, (void *) CHR('E','U','Q',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Evenki"), NULL, 0, 0, (void *) CHR('E','V','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Even"), NULL, 0, 0, (void *) CHR('E','V','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ewe"), NULL, 0, 0, (void *) CHR('E','W','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("French Antillean"), NULL, 0, 0, (void *) CHR('F','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Farsi"), NULL, 0, 0, (void *) CHR('F','A','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Finnish"), NULL, 0, 0, (void *) CHR('F','I','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Fijian"), NULL, 0, 0, (void *) CHR('F','J','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Flemish"), NULL, 0, 0, (void *) CHR('F','L','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Forest Nenets"), NULL, 0, 0, (void *) CHR('F','N','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Fon"), NULL, 0, 0, (void *) CHR('F','O','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Faroese"), NULL, 0, 0, (void *) CHR('F','O','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("French (Standard)"), NULL, 0, 0, (void *) CHR('F','R','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Frisian"), NULL, 0, 0, (void *) CHR('F','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Friulian"), NULL, 0, 0, (void *) CHR('F','R','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Futa"), NULL, 0, 0, (void *) CHR('F','T','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Fulani"), NULL, 0, 0, (void *) CHR('F','U','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ga"), NULL, 0, 0, (void *) CHR('G','A','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gaelic"), NULL, 0, 0, (void *) CHR('G','A','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gagauz"), NULL, 0, 0, (void *) CHR('G','A','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Galician"), NULL, 0, 0, (void *) CHR('G','A','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Garshuni"), NULL, 0, 0, (void *) CHR('G','A','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Garhwali"), NULL, 0, 0, (void *) CHR('G','A','W',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Ge'ez"), NULL, 0, 0, (void *) CHR('G','E','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gilyak"), NULL, 0, 0, (void *) CHR('G','I','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gumuz"), NULL, 0, 0, (void *) CHR('G','M','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Gondi"), NULL, 0, 0, (void *) CHR('G','O','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Greenlandic"), NULL, 0, 0, (void *) CHR('G','R','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Garo"), NULL, 0, 0, (void *) CHR('G','R','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Guarani"), NULL, 0, 0, (void *) CHR('G','U','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Gujarati"), NULL, 0, 0, (void *) CHR('G','U','J',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Haitian"), NULL, 0, 0, (void *) CHR('H','A','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Halam"), NULL, 0, 0, (void *) CHR('H','A','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Harauti"), NULL, 0, 0, (void *) CHR('H','A','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hausa"), NULL, 0, 0, (void *) CHR('H','A','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hawaiin"), NULL, 0, 0, (void *) CHR('H','A','W',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hammer-Banna"), NULL, 0, 0, (void *) CHR('H','B','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hiligaynon"), NULL, 0, 0, (void *) CHR('H','I','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hindi"), NULL, 0, 0, (void *) CHR('H','I','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("High Mari"), NULL, 0, 0, (void *) CHR('H','M','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hindko"), NULL, 0, 0, (void *) CHR('H','N','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ho"), NULL, 0, 0, (void *) CHR('H','O',' ',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Harari"), NULL, 0, 0, (void *) CHR('H','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Croatian"), NULL, 0, 0, (void *) CHR('H','R','V',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Hungarian"), NULL, 0, 0, (void *) CHR('H','U','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Armenian"), NULL, 0, 0, (void *) CHR('H','Y','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Igbo"), NULL, 0, 0, (void *) CHR('I','B','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ijo"), NULL, 0, 0, (void *) CHR('I','J','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ilokano"), NULL, 0, 0, (void *) CHR('I','L','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Indonesian"), NULL, 0, 0, (void *) CHR('I','N','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ingush"), NULL, 0, 0, (void *) CHR('I','N','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Inuktitut"), NULL, 0, 0, (void *) CHR('I','N','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Irish"), NULL, 0, 0, (void *) CHR('I','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Irish Traditional"), NULL, 0, 0, (void *) CHR('I','R','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Icelandic"), NULL, 0, 0, (void *) CHR('I','S','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Inari Sami"), NULL, 0, 0, (void *) CHR('I','S','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Italian"), NULL, 0, 0, (void *) CHR('I','T','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Hebrew"), NULL, 0, 0, (void *) CHR('I','W','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Javanese"), NULL, 0, 0, (void *) CHR('J','A','V',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Yiddish"), NULL, 0, 0, (void *) CHR('J','I','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) CHR('J','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Judezmo"), NULL, 0, 0, (void *) CHR('J','U','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Jula"), NULL, 0, 0, (void *) CHR('J','U','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kabardian"), NULL, 0, 0, (void *) CHR('K','A','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kachchi"), NULL, 0, 0, (void *) CHR('K','A','C',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kalenjin"), NULL, 0, 0, (void *) CHR('K','A','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Kannada"), NULL, 0, 0, (void *) CHR('K','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Karachay"), NULL, 0, 0, (void *) CHR('K','A','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Georgian"), NULL, 0, 0, (void *) CHR('K','A','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kazakh"), NULL, 0, 0, (void *) CHR('K','A','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kebena"), NULL, 0, 0, (void *) CHR('K','E','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Khutsuri Georgian"), NULL, 0, 0, (void *) CHR('K','G','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Khakass"), NULL, 0, 0, (void *) CHR('K','H','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Khanty-Kazim"), NULL, 0, 0, (void *) CHR('K','H','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Khmer"), NULL, 0, 0, (void *) CHR('K','H','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Khanty-Shurishkar"), NULL, 0, 0, (void *) CHR('K','H','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Khanty-Vakhi"), NULL, 0, 0, (void *) CHR('K','H','V',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Khowar"), NULL, 0, 0, (void *) CHR('K','H','W',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kikuyu"), NULL, 0, 0, (void *) CHR('K','I','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kirghiz"), NULL, 0, 0, (void *) CHR('K','I','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kisii"), NULL, 0, 0, (void *) CHR('K','I','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kokni"), NULL, 0, 0, (void *) CHR('K','K','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kalmyk"), NULL, 0, 0, (void *) CHR('K','L','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kamba"), NULL, 0, 0, (void *) CHR('K','M','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kumaoni"), NULL, 0, 0, (void *) CHR('K','M','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Komo"), NULL, 0, 0, (void *) CHR('K','M','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Komso"), NULL, 0, 0, (void *) CHR('K','M','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kanuri"), NULL, 0, 0, (void *) CHR('K','N','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kodagu"), NULL, 0, 0, (void *) CHR('K','O','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Konkani"), NULL, 0, 0, (void *) CHR('K','O','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kikongo"), NULL, 0, 0, (void *) CHR('K','O','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Komi-Permyak"), NULL, 0, 0, (void *) CHR('K','O','P',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) CHR('K','O','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Komi-Zyrian"), NULL, 0, 0, (void *) CHR('K','O','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kpelle"), NULL, 0, 0, (void *) CHR('K','P','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Krio"), NULL, 0, 0, (void *) CHR('K','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Karakalpak"), NULL, 0, 0, (void *) CHR('K','R','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Karelian"), NULL, 0, 0, (void *) CHR('K','R','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Karaim"), NULL, 0, 0, (void *) CHR('K','R','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Karen"), NULL, 0, 0, (void *) CHR('K','R','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Koorete"), NULL, 0, 0, (void *) CHR('K','R','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kashmiri"), NULL, 0, 0, (void *) CHR('K','S','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Khasi"), NULL, 0, 0, (void *) CHR('K','S','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kildin Sami"), NULL, 0, 0, (void *) CHR('K','S','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kui"), NULL, 0, 0, (void *) CHR('K','U','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kulvi"), NULL, 0, 0, (void *) CHR('K','U','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kumyk"), NULL, 0, 0, (void *) CHR('K','U','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kurdish"), NULL, 0, 0, (void *) CHR('K','U','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kurukh"), NULL, 0, 0, (void *) CHR('K','U','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Kuy"), NULL, 0, 0, (void *) CHR('K','U','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Koryak"), NULL, 0, 0, (void *) CHR('K','Y','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ladin"), NULL, 0, 0, (void *) CHR('L','A','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lahuli"), NULL, 0, 0, (void *) CHR('L','A','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lak"), NULL, 0, 0, (void *) CHR('L','A','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lambani"), NULL, 0, 0, (void *) CHR('L','A','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Lao"), NULL, 0, 0, (void *) CHR('L','A','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Latin"), NULL, 0, 0, (void *) CHR('L','A','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Laz"), NULL, 0, 0, (void *) CHR('L','A','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("L-Cree"), NULL, 0, 0, (void *) CHR('L','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ladakhi"), NULL, 0, 0, (void *) CHR('L','D','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lezgi"), NULL, 0, 0, (void *) CHR('L','E','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lingala"), NULL, 0, 0, (void *) CHR('L','I','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Low Mari"), NULL, 0, 0, (void *) CHR('L','M','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Limbu"), NULL, 0, 0, (void *) CHR('L','M','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lomwe"), NULL, 0, 0, (void *) CHR('L','M','W',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lower Sorbian"), NULL, 0, 0, (void *) CHR('L','S','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lule Sami"), NULL, 0, 0, (void *) CHR('L','S','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lithuanian"), NULL, 0, 0, (void *) CHR('L','T','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Luba"), NULL, 0, 0, (void *) CHR('L','U','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Luganda"), NULL, 0, 0, (void *) CHR('L','U','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Luhya"), NULL, 0, 0, (void *) CHR('L','U','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Luo"), NULL, 0, 0, (void *) CHR('L','U','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Latvian"), NULL, 0, 0, (void *) CHR('L','V','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Majang"), NULL, 0, 0, (void *) CHR('M','A','J',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Makua"), NULL, 0, 0, (void *) CHR('M','A','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Malayalam Traditional"), NULL, 0, 0, (void *) CHR('M','A','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Mansi"), NULL, 0, 0, (void *) CHR('M','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Marathi"), NULL, 0, 0, (void *) CHR('M','A','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Marwari"), NULL, 0, 0, (void *) CHR('M','A','W',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Mbundu"), NULL, 0, 0, (void *) CHR('M','B','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Manchu"), NULL, 0, 0, (void *) CHR('M','C','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Moose Cree"), NULL, 0, 0, (void *) CHR('M','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Mende"), NULL, 0, 0, (void *) CHR('M','D','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Me'en"), NULL, 0, 0, (void *) CHR('M','E','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Mizo"), NULL, 0, 0, (void *) CHR('M','I','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Macedonian"), NULL, 0, 0, (void *) CHR('M','K','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Male"), NULL, 0, 0, (void *) CHR('M','L','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Malagasy"), NULL, 0, 0, (void *) CHR('M','L','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Malinke"), NULL, 0, 0, (void *) CHR('M','L','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Malayalam Reformed"), NULL, 0, 0, (void *) CHR('M','L','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Malay"), NULL, 0, 0, (void *) CHR('M','L','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Mandinka"), NULL, 0, 0, (void *) CHR('M','N','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Mongolian"), NULL, 0, 0, (void *) CHR('M','N','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Manipuri"), NULL, 0, 0, (void *) CHR('M','N','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Maninka"), NULL, 0, 0, (void *) CHR('M','N','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Manx Gaelic"), NULL, 0, 0, (void *) CHR('M','N','X',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Moksha"), NULL, 0, 0, (void *) CHR('M','O','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Moldavian"), NULL, 0, 0, (void *) CHR('M','O','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Mon"), NULL, 0, 0, (void *) CHR('M','O','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Moroccan"), NULL, 0, 0, (void *) CHR('M','O','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Maori"), NULL, 0, 0, (void *) CHR('M','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Maithili"), NULL, 0, 0, (void *) CHR('M','T','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Maltese"), NULL, 0, 0, (void *) CHR('M','T','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Mundari"), NULL, 0, 0, (void *) CHR('M','U','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Naga-Assamese"), NULL, 0, 0, (void *) CHR('N','A','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Nanai"), NULL, 0, 0, (void *) CHR('N','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Naskapi"), NULL, 0, 0, (void *) CHR('N','A','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("N-Cree"), NULL, 0, 0, (void *) CHR('N','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ndebele"), NULL, 0, 0, (void *) CHR('N','D','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ndonga"), NULL, 0, 0, (void *) CHR('N','D','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Nepali"), NULL, 0, 0, (void *) CHR('N','E','P',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Newari"), NULL, 0, 0, (void *) CHR('N','E','W',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Norway House Cree"), NULL, 0, 0, (void *) CHR('N','H','C',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Nisi"), NULL, 0, 0, (void *) CHR('N','I','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Niuean"), NULL, 0, 0, (void *) CHR('N','I','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Nkole"), NULL, 0, 0, (void *) CHR('N','K','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Dutch"), NULL, 0, 0, (void *) CHR('N','L','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Nogai"), NULL, 0, 0, (void *) CHR('N','O','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Norwegian"), NULL, 0, 0, (void *) CHR('N','O','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Northern Sami"), NULL, 0, 0, (void *) CHR('N','S','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Northern Tai"), NULL, 0, 0, (void *) CHR('N','T','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Esperanto"), NULL, 0, 0, (void *) CHR('N','T','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Nynorsk"), NULL, 0, 0, (void *) CHR('N','Y','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Oji-Cree"), NULL, 0, 0, (void *) CHR('O','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ojibway"), NULL, 0, 0, (void *) CHR('O','J','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Oriya"), NULL, 0, 0, (void *) CHR('O','R','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Oromo"), NULL, 0, 0, (void *) CHR('O','R','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ossetian"), NULL, 0, 0, (void *) CHR('O','S','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Palestinian Aramaic"), NULL, 0, 0, (void *) CHR('P','A','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Pali"), NULL, 0, 0, (void *) CHR('P','A','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Punjabi"), NULL, 0, 0, (void *) CHR('P','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Palpa"), NULL, 0, 0, (void *) CHR('P','A','P',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Pashto"), NULL, 0, 0, (void *) CHR('P','A','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Polytonic Greek"), NULL, 0, 0, (void *) CHR('P','G','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Pilipino"), NULL, 0, 0, (void *) CHR('P','I','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Palaung"), NULL, 0, 0, (void *) CHR('P','L','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Polish"), NULL, 0, 0, (void *) CHR('P','L','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Provencal"), NULL, 0, 0, (void *) CHR('P','R','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Portuguese"), NULL, 0, 0, (void *) CHR('P','T','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chin"), NULL, 0, 0, (void *) CHR('Q','I','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Rajasthani"), NULL, 0, 0, (void *) CHR('R','A','J',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("R-Cree"), NULL, 0, 0, (void *) CHR('R','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Russian Buriat"), NULL, 0, 0, (void *) CHR('R','B','U',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Riang"), NULL, 0, 0, (void *) CHR('R','I','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Rhaeto-Romanic"), NULL, 0, 0, (void *) CHR('R','M','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Romanian"), NULL, 0, 0, (void *) CHR('R','O','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Romany"), NULL, 0, 0, (void *) CHR('R','O','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Rusyn"), NULL, 0, 0, (void *) CHR('R','S','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ruanda"), NULL, 0, 0, (void *) CHR('R','U','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Russian"), NULL, 0, 0, (void *) CHR('R','U','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sadri"), NULL, 0, 0, (void *) CHR('S','A','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sanskrit"), NULL, 0, 0, (void *) CHR('S','A','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Santali"), NULL, 0, 0, (void *) CHR('S','A','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sayisi"), NULL, 0, 0, (void *) CHR('S','A','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sekota"), NULL, 0, 0, (void *) CHR('S','E','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Selkup"), NULL, 0, 0, (void *) CHR('S','E','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sango"), NULL, 0, 0, (void *) CHR('S','G','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Shan"), NULL, 0, 0, (void *) CHR('S','H','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sibe"), NULL, 0, 0, (void *) CHR('S','I','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sidamo"), NULL, 0, 0, (void *) CHR('S','I','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Silte Gurage"), NULL, 0, 0, (void *) CHR('S','I','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Skolt Sami"), NULL, 0, 0, (void *) CHR('S','K','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Slovak"), NULL, 0, 0, (void *) CHR('S','K','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Slavey"), NULL, 0, 0, (void *) CHR('S','L','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Slovenian"), NULL, 0, 0, (void *) CHR('S','L','V',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Somali"), NULL, 0, 0, (void *) CHR('S','M','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Samoan"), NULL, 0, 0, (void *) CHR('S','M','O',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sena"), NULL, 0, 0, (void *) CHR('S','N','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sindhi"), NULL, 0, 0, (void *) CHR('S','N','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Sinhalese"), NULL, 0, 0, (void *) CHR('S','N','H',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Soninke"), NULL, 0, 0, (void *) CHR('S','N','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sodo Gurage"), NULL, 0, 0, (void *) CHR('S','O','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sotho"), NULL, 0, 0, (void *) CHR('S','O','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Albanian"), NULL, 0, 0, (void *) CHR('S','Q','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Serbian"), NULL, 0, 0, (void *) CHR('S','R','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Saraiki"), NULL, 0, 0, (void *) CHR('S','R','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Serer"), NULL, 0, 0, (void *) CHR('S','R','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("South Slavey"), NULL, 0, 0, (void *) CHR('S','S','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Southern Sami"), NULL, 0, 0, (void *) CHR('S','S','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Suri"), NULL, 0, 0, (void *) CHR('S','U','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Svan"), NULL, 0, 0, (void *) CHR('S','V','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Swedish"), NULL, 0, 0, (void *) CHR('S','V','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Swadaya Aramaic"), NULL, 0, 0, (void *) CHR('S','W','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Swahili"), NULL, 0, 0, (void *) CHR('S','W','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Swazi"), NULL, 0, 0, (void *) CHR('S','W','Z',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Sutu"), NULL, 0, 0, (void *) CHR('S','X','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Syriac"), NULL, 0, 0, (void *) CHR('S','Y','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tabasaran"), NULL, 0, 0, (void *) CHR('T','A','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tajiki"), NULL, 0, 0, (void *) CHR('T','A','J',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Tamil"), NULL, 0, 0, (void *) CHR('T','A','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tatar"), NULL, 0, 0, (void *) CHR('T','A','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("TH-Cree"), NULL, 0, 0, (void *) CHR('T','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Telugu"), NULL, 0, 0, (void *) CHR('T','E','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tongan"), NULL, 0, 0, (void *) CHR('T','G','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tigre"), NULL, 0, 0, (void *) CHR('T','G','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tigrinya"), NULL, 0, 0, (void *) CHR('T','G','Y',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Thai"), NULL, 0, 0, (void *) CHR('T','H','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tahitian"), NULL, 0, 0, (void *) CHR('T','H','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Lang|Tibetan"), NULL, 0, 0, (void *) CHR('T','I','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Turkmen"), NULL, 0, 0, (void *) CHR('T','K','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Temne"), NULL, 0, 0, (void *) CHR('T','M','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tswana"), NULL, 0, 0, (void *) CHR('T','N','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tundra Nenets"), NULL, 0, 0, (void *) CHR('T','N','E',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tonga"), NULL, 0, 0, (void *) CHR('T','N','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Todo"), NULL, 0, 0, (void *) CHR('T','O','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Turkish"), NULL, 0, 0, (void *) CHR('T','R','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tsonga"), NULL, 0, 0, (void *) CHR('T','S','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Turoyo Aramaic"), NULL, 0, 0, (void *) CHR('T','U','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tulu"), NULL, 0, 0, (void *) CHR('T','U','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Tuvin"), NULL, 0, 0, (void *) CHR('T','U','V',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Twi"), NULL, 0, 0, (void *) CHR('T','W','I',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Udmurt"), NULL, 0, 0, (void *) CHR('U','D','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Ukrainian"), NULL, 0, 0, (void *) CHR('U','K','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Urdu"), NULL, 0, 0, (void *) CHR('U','R','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Upper Sorbian"), NULL, 0, 0, (void *) CHR('U','S','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Uyghur"), NULL, 0, 0, (void *) CHR('U','Y','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Uzbek"), NULL, 0, 0, (void *) CHR('U','Z','B',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Venda"), NULL, 0, 0, (void *) CHR('V','E','N',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Vietnamese"), NULL, 0, 0, (void *) CHR('V','I','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Wa"), NULL, 0, 0, (void *) CHR('W','A',' ',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Wagdi"), NULL, 0, 0, (void *) CHR('W','A','G',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("West-Cree"), NULL, 0, 0, (void *) CHR('W','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Welsh"), NULL, 0, 0, (void *) CHR('W','E','L',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Wolof"), NULL, 0, 0, (void *) CHR('W','L','F',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Xhosa"), NULL, 0, 0, (void *) CHR('X','H','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Yakut"), NULL, 0, 0, (void *) CHR('Y','A','K',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Yoruba"), NULL, 0, 0, (void *) CHR('Y','B','A',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Y-Cree"), NULL, 0, 0, (void *) CHR('Y','C','R',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Yi Classic"), NULL, 0, 0, (void *) CHR('Y','I','C',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Yi Modern"), NULL, 0, 0, (void *) CHR('Y','I','M',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chinese Phonetic"), NULL, 0, 0, (void *) CHR('Z','H','P',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chinese Simplified"), NULL, 0, 0, (void *) CHR('Z','H','S',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Chinese Traditional"), NULL, 0, 0, (void *) CHR('Z','H','T',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Zande"), NULL, 0, 0, (void *) CHR('Z','N','D',' '), NULL, false, false, false, false, false, false, true },
- { (unichar_t *) N_("Zulu"), NULL, 0, 0, (void *) CHR('Z','U','L',' '), NULL, false, false, false, false, false, false, true },
- { NULL }
-};
-
-struct opentype_feature_friendlynames friendlies[] = {
-/* I added these first three features to allow round-trip conversion of tfm files */
- { CHR('I','T','L','C'), "ITLC", N_("Italic Correction"), gpos_single_mask },
- { CHR('T','C','H','L'), "TCHL", N_("TeX Glyphlist"), gsub_alternate_mask },
- { CHR('T','E','X','L'), "TEXL", N_("TeX Extension List"), gsub_multiple_mask },
-/* Normal OpenType features follow */
- { CHR('a','a','l','t'), "aalt", N_("Access All Alternates"), gsub_single_mask|gsub_alternate_mask },
- { CHR('a','b','v','f'), "abvf", N_("Above Base Forms"), gsub_single_mask },
- { CHR('a','b','v','m'), "abvm", N_("Above Base Mark"), gpos_mark2base_mask|gpos_mark2ligature_mask },
- { CHR('a','b','v','s'), "abvs", N_("Above Base Substitutions"), gsub_ligature_mask },
- { CHR('a','f','r','c'), "afrc", N_("Vertical Fractions"), gsub_ligature_mask },
- { CHR('a','k','h','n'), "akhn", N_("Akhand"), gsub_ligature_mask },
- { CHR('a','l','i','g'), "alig", N_("Ancient Ligatures"), gsub_ligature_mask },
- { CHR('b','l','w','f'), "blwf", N_("Below Base Forms"), gsub_ligature_mask },
- { CHR('b','l','w','m'), "blwm", N_("Below Base Mark"), gpos_mark2base_mask|gpos_mark2ligature_mask },
- { CHR('b','l','w','s'), "blws", N_("Below Base Substitutions"), gsub_ligature_mask },
- { CHR('c','2','p','c'), "c2pc", N_("Capitals to Petite Capitals"), gsub_single_mask },
- { CHR('c','2','s','c'), "c2sc", N_("Capitals to Small Capitals"), gsub_single_mask },
- { CHR('c','a','l','t'), "calt", N_("Contextual Alternates"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('c','a','s','e'), "case", N_("Case-Sensitive Forms"), gsub_single_mask|gpos_single_mask },
- { CHR('c','c','m','p'), "ccmp", N_("Glyph Composition/Decomposition"), gsub_multiple_mask|gsub_ligature_mask },
- { CHR('c','l','i','g'), "clig", N_("Contextual Ligatures"), gsub_reversecchain_mask },
- { CHR('c','p','s','p'), "cpsp", N_("Capital Spacing"), gpos_single_mask },
- { CHR('c','s','w','h'), "cswh", N_("Contextual Swash"), gsub_reversecchain_mask },
- { CHR('c','u','r','s'), "curs", N_("Cursive Attachment"), gpos_cursive_mask },
- { CHR('d','i','s','t'), "dist", N_("Distance"), gpos_pair_mask },
- { CHR('d','l','i','g'), "dlig", N_("Discretionary Ligatures"), gsub_ligature_mask },
- { CHR('d','n','o','m'), "dnom", N_("Denominators"), gsub_single_mask },
- { CHR('e','x','p','t'), "expt", N_("Expert Forms"), gsub_single_mask },
- { CHR('f','a','l','t'), "falt", N_("Final Glyph On Line"), gsub_alternate_mask },
- { CHR('f','i','n','2'), "fin2", N_("Terminal Forms #2"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('f','i','n','3'), "fin3", N_("Terminal Forms #3"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('f','i','n','a'), "fina", N_("Terminal Forms"), gsub_single_mask },
- { CHR('f','r','a','c'), "frac", N_("Diagonal Fractions"), gsub_single_mask|gsub_ligature_mask },
- { CHR('f','w','i','d'), "fwid", N_("Full Widths"), gsub_single_mask|gpos_single_mask },
- { CHR('h','a','l','f'), "half", N_("Half Forms"), gsub_ligature_mask },
- { CHR('h','a','l','n'), "haln", N_("Halant Forms"), gsub_ligature_mask },
- { CHR('h','a','l','t'), "halt", N_("Alternative Half Widths"), gpos_single_mask },
- { CHR('h','i','s','t'), "hist", N_("Historical Forms"), gsub_single_mask },
- { CHR('h','k','n','a'), "hkna", N_("Horizontal Kana Alternatives"), gsub_single_mask },
- { CHR('h','l','i','g'), "hlig", N_("Historic Ligatures"), gsub_ligature_mask },
- { CHR('h','n','g','l'), "hngl", N_("Hanja to Hangul"), gsub_single_mask|gsub_alternate_mask },
- { CHR('h','w','i','d'), "hwid", N_("Half Widths"), gsub_single_mask|gpos_single_mask },
- { CHR('i','n','i','t'), "init", N_("Initial Forms"), gsub_single_mask },
- { CHR('i','s','o','l'), "isol", N_("Isolated Forms"), gsub_single_mask },
- { CHR('i','t','a','l'), "ital", N_("Italics"), gsub_single_mask },
- { CHR('j','a','l','t'), "jalt", N_("Justification Alternatives"), gsub_alternate_mask },
- { CHR('j','p','7','8'), "jp78", N_("JIS78 Forms"), gsub_single_mask|gsub_alternate_mask },
- { CHR('j','p','8','3'), "jp83", N_("JIS83 Forms"), gsub_single_mask },
- { CHR('j','p','9','0'), "jp90", N_("JIS90 Forms"), gsub_single_mask },
- { CHR('k','e','r','n'), "kern", N_("Horizontal Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask|kern_statemachine_mask },
- { CHR('l','f','b','d'), "lfbd", N_("Left Bounds"), gpos_single_mask },
- { CHR('l','i','g','a'), "liga", N_("Standard Ligatures"), gsub_ligature_mask },
- { CHR('l','j','m','o'), "ljmo", N_("Leading Jamo Forms"), gsub_ligature_mask },
- { CHR('l','n','u','m'), "lnum", N_("Lining Figures"), gsub_single_mask },
- { CHR('l','o','c','l'), "locl", N_("Localized Forms"), gsub_single_mask },
- { CHR('m','a','r','k'), "mark", N_("Mark Positioning"), gpos_mark2base_mask|gpos_mark2ligature_mask },
- { CHR('m','e','d','2'), "med2", N_("Medial Forms 2"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('m','e','d','i'), "medi", N_("Medial Forms"), gsub_single_mask },
- { CHR('m','g','r','k'), "mgrk", N_("Mathematical Greek"), gsub_single_mask },
- { CHR('m','k','m','k'), "mkmk", N_("Mark to Mark"), gpos_mark2mark_mask },
- { CHR('m','s','e','t'), "mset", N_("Mark Positioning via Substitution"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('n','a','l','t'), "nalt", N_("Alternate Annotation Forms"), gsub_single_mask|gsub_alternate_mask },
- { CHR('n','u','k','t'), "nukt", N_("Nukta Forms"), gsub_ligature_mask },
- { CHR('n','u','m','r'), "numr", N_("Numerators"), gsub_single_mask },
- { CHR('o','n','u','m'), "onum", N_("Oldstyle Figures"), gsub_single_mask },
- { CHR('o','p','b','d'), "opbd", N_("Optical Bounds"), gpos_single_mask },
- { CHR('o','r','d','n'), "ordn", N_("Ordinals"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('o','r','n','m'), "ornm", N_("Ornaments"), gsub_single_mask|gsub_alternate_mask },
- { CHR('p','a','l','t'), "palt", N_("Proportional Alternate Metrics"), gpos_single_mask },
- { CHR('p','c','a','p'), "pcap", N_("Lowercase to Petite Capitals"), gsub_single_mask },
- { CHR('p','n','u','m'), "pnum", N_("Proportional Numbers"), gsub_single_mask },
- { CHR('p','r','e','f'), "pref", N_("Pre Base Forms"), gsub_ligature_mask },
- { CHR('p','r','e','s'), "pres", N_("Pre Base Substitutions"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
- { CHR('p','s','t','f'), "pstf", N_("Post Base Forms"), gsub_ligature_mask },
- { CHR('p','s','t','s'), "psts", N_("Post Base Substitutions"), gsub_ligature_mask },
- { CHR('p','w','i','d'), "pwid", N_("Proportional Width"), gsub_single_mask },
- { CHR('q','w','i','d'), "qwid", N_("Quarter Widths"), gsub_single_mask|gpos_single_mask },
- { CHR('r','a','n','d'), "rand", N_("Randomize"), gsub_alternate_mask },
- { CHR('r','l','i','g'), "rlig", N_("Required Ligatures"), gsub_ligature_mask },
- { CHR('r','p','h','f'), "rphf", N_("Reph Form"), gsub_ligature_mask },
- { CHR('r','t','b','d'), "rtbd", N_("Right Bounds"), gpos_single_mask },
- { CHR('r','t','l','a'), "rtla", N_("Right to Left Alternates"), gsub_single_mask },
- { CHR('r','u','b','y'), "ruby", N_("Ruby Notational Forms"), gsub_single_mask },
- { CHR('s','a','l','t'), "salt", N_("Stylistic Alternatives"), gsub_single_mask|gsub_alternate_mask },
- { CHR('s','i','n','f'), "sinf", N_("Scientific Inferiors"), gsub_single_mask },
- { CHR('s','m','c','p'), "smcp", N_("Lowercase to Small Capitals"), gsub_single_mask },
- { CHR('s','m','p','l'), "smpl", N_("Simplified Forms"), gsub_single_mask },
- { CHR('s','s','0','1'), "ss01", N_("Style Set 1"), gsub_single_mask },
- { CHR('s','s','0','2'), "ss02", N_("Style Set 2"), gsub_single_mask },
- { CHR('s','s','0','3'), "ss03", N_("Style Set 3"), gsub_single_mask },
- { CHR('s','s','0','4'), "ss04", N_("Style Set 4"), gsub_single_mask },
- { CHR('s','s','0','5'), "ss05", N_("Style Set 5"), gsub_single_mask },
- { CHR('s','s','0','6'), "ss06", N_("Style Set 6"), gsub_single_mask },
- { CHR('s','s','0','7'), "ss07", N_("Style Set 7"), gsub_single_mask },
- { CHR('s','s','0','8'), "ss08", N_("Style Set 8"), gsub_single_mask },
- { CHR('s','s','0','9'), "ss09", N_("Style Set 9"), gsub_single_mask },
- { CHR('s','s','1','0'), "ss10", N_("Style Set 10"), gsub_single_mask },
- { CHR('s','s','1','1'), "ss11", N_("Style Set 11"), gsub_single_mask },
- { CHR('s','s','1','2'), "ss12", N_("Style Set 12"), gsub_single_mask },
- { CHR('s','s','1','3'), "ss13", N_("Style Set 13"), gsub_single_mask },
- { CHR('s','s','1','4'), "ss14", N_("Style Set 14"), gsub_single_mask },
- { CHR('s','s','1','5'), "ss15", N_("Style Set 15"), gsub_single_mask },
- { CHR('s','s','1','6'), "ss16", N_("Style Set 16"), gsub_single_mask },
- { CHR('s','s','1','7'), "ss17", N_("Style Set 17"), gsub_single_mask },
- { CHR('s','s','1','8'), "ss18", N_("Style Set 18"), gsub_single_mask },
- { CHR('s','s','1','9'), "ss19", N_("Style Set 19"), gsub_single_mask },
- { CHR('s','s','2','0'), "ss20", N_("Style Set 20"), gsub_single_mask },
- { CHR('s','u','b','s'), "subs", N_("Subscript"), gsub_single_mask },
- { CHR('s','u','p','s'), "sups", N_("Superscript"), gsub_single_mask },
- { CHR('s','w','s','h'), "swsh", N_("Swash"), gsub_single_mask|gsub_alternate_mask },
- { CHR('t','i','t','l'), "titl", N_("Titling"), gsub_single_mask },
- { CHR('t','j','m','o'), "tjmo", N_("Trailing Jamo Forms"), gsub_ligature_mask },
- { CHR('t','n','a','m'), "tnam", N_("Traditional Name Forms"), gsub_single_mask },
- { CHR('t','n','u','m'), "tnum", N_("Tabular Numbers"), gsub_single_mask },
- { CHR('t','r','a','d'), "trad", N_("Traditional Forms"), gsub_single_mask|gsub_alternate_mask },
- { CHR('t','w','i','d'), "twid", N_("Third Widths"), gsub_single_mask|gpos_single_mask },
- { CHR('u','n','i','c'), "unic", N_("Unicase"), gsub_single_mask },
- { CHR('v','a','l','t'), "valt", N_("Alternate Vertical Metrics"), gpos_single_mask },
- { CHR('v','a','t','u'), "vatu", N_("Vattu Variants"), gsub_ligature_mask },
- { CHR('v','e','r','t'), "vert", N_("Vertical Alternates (obs)"), gsub_single_mask },
- { CHR('v','h','a','l'), "vhal", N_("Alternate Vertical Half Metrics"), gpos_single_mask },
- { CHR('v','j','m','o'), "vjmo", N_("Vowel Jamo Forms"), gsub_ligature_mask },
- { CHR('v','k','n','a'), "vkna", N_("Vertical Kana Alternates"), gsub_single_mask },
- { CHR('v','k','r','n'), "vkrn", N_("Vertical Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask|kern_statemachine_mask },
- { CHR('v','p','a','l'), "vpal", N_("Proportional Alternate Vertical Metrics"), gpos_single_mask },
- { CHR('v','r','t','2'), "vrt2", N_("Vertical Rotation & Alternates"), gsub_single_mask },
- { CHR('z','e','r','o'), "zero", N_("Slashed Zero"), gsub_single_mask },
-/* This is my hack for setting the "Required feature" field of a script */
- { CHR(' ','R','Q','D'), " RQD", N_("Required feature"), gsub_single_mask|gsub_multiple_mask|gsub_alternate_mask|gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|gsub_reversecchain_mask|morx_context_mask|gpos_single_mask|gpos_pair_mask|gpos_cursive_mask|gpos_mark2base_mask|gpos_mark2ligature_mask|gpos_mark2mark_mask|gpos_context_mask|gpos_contextchain_mask },
- { 0, NULL, 0 }
-};
-
-static char *LK_LangsDlg(GGadget *, int r, int c);
-static char *LK_ScriptsDlg(GGadget *, int r, int c);
-static struct col_init scriptci[] = {
-/* GT: English uses "script" to mean a general writing system (latin, greek, kanji) */
-/* GT: and the cursive handwriting style. Here we mean the general writing system. */
- { me_stringchoicetag , NULL, scripts, NULL, N_("writing system|Script") },
- { me_funcedit, LK_LangsDlg, NULL, NULL, N_("Language(s)") },
- };
-static struct col_init featureci[] = {
- { me_stringchoicetrans , NULL, NULL, NULL, N_("Feature") },
- { me_funcedit, LK_ScriptsDlg, NULL, NULL, N_("Script(s) & Language(s)") },
- };
-
-void LookupUIInit(void) {
- static int done = false;
- int i, j;
- static GTextInfo *needswork[] = {
- scripts, languages, gpos_lookuptypes, gsub_lookuptypes,
- NULL
- };
-
- if ( done )
-return;
- done = true;
- for ( j=0; needswork[j]!=NULL; ++j ) {
- for ( i=0; needswork[j][i].text!=NULL; ++i )
- needswork[j][i].text = (unichar_t *) S_((char *) needswork[j][i].text);
- }
- for ( i=0; friendlies[i].friendlyname!=NULL; ++i )
- friendlies[i].friendlyname = S_(friendlies[i].friendlyname);
-
- featureci[0].title = S_(featureci[0].title);
- featureci[1].title = S_(featureci[1].title);
- scriptci[0].title = S_(scriptci[0].title);
- scriptci[1].title = S_(scriptci[1].title);
-}
-
-#define CID_LookupType 1000
-#define CID_LookupFeatures 1001
-#define CID_Lookup_R2L 1002
-#define CID_Lookup_IgnBase 1003
-#define CID_Lookup_IgnLig 1004
-#define CID_Lookup_IgnMark 1005
-#define CID_Lookup_ProcessMark 1006
-#define CID_LookupName 1007
-#define CID_LookupAfm 1008
-#define CID_OK 1009
-#define CID_Cancel 1010
-
-#define CID_FeatureScripts 1020
-#define CID_ShowAnchors 1021
-
-struct lookup_dlg {
- OTLookup *orig;
- SplineFont *sf;
- GWindow gw, scriptgw;
- int isgpos;
- int done, scriptdone, name_has_been_set;
- int ok;
- char *scriptret;
-};
-
-static int langs_e_h(GWindow gw, GEvent *event) {
- int *done = GDrawGetUserData(gw);
-
- if ( event->type==et_close ) {
- *done = true;
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("lookups.html#scripts-dlg");
-return( true );
- }
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- switch ( GGadgetGetCid(event->u.control.g)) {
- case CID_OK:
- *done = 2;
- break;
- case CID_Cancel:
- *done = true;
- break;
- }
- }
-return( true );
-}
-
-static char *LK_LangsDlg(GGadget *g, int r, int c) {
- int rows, i;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- char *langstr = strings[2*r+c].u.md_str, *pt, *start;
- unsigned char tagstr[4], warnstr[8];
- uint32 tag;
- int warn_cnt = 0;
- int j,done=0;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[5], *varray[6], *harray[7], boxes[3];
- GTextInfo label[5];
- GRect pos;
- GWindow gw;
- int32 len;
- GTextInfo **ti;
- char *ret;
-
- for ( i=0; languages[i].text!=NULL; ++i )
- languages[i].selected = false;
-
- for ( start= langstr; *start; ) {
- memset(tagstr,' ',sizeof(tagstr));
- for ( pt=start, j=0; *pt!='\0' && *pt!=','; ++pt, ++j ) {
- if ( j<4 )
- tagstr[j] = *pt;
- }
- if ( *pt==',' ) ++pt;
- tag = (tagstr[0]<<24) | (tagstr[1]<<16) | (tagstr[2]<<8) | tagstr[3];
- for ( i=0; languages[i].text!=NULL; ++i )
- if ( languages[i].userdata == (void *) (intpt) tag ) {
- languages[i].selected = true;
- break;
- }
- if ( languages[i].text==NULL ) {
- ++warn_cnt;
- memcpy(warnstr,tagstr,4);
- warnstr[4] = '\0';
- }
- start = pt;
- }
- if ( warn_cnt!=0 ) {
- if ( warn_cnt==1 )
- gwwv_post_error(_("Unknown Language"),_("The language, '%s', is not in the list of known languages and will be omitted"), warnstr );
- else
- gwwv_post_error(_("Unknown Language"),_("Several language tags, including '%s', are not in the list of known languages and will be omitted"), warnstr );
- }
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Language List");
- wattrs.is_dlg = true;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,150));
- pos.height = GDrawPointsToPixels(NULL,193);
- gw = GDrawCreateTopWindow(NULL,&pos,langs_e_h,&done,&wattrs);
-
- memset(&gcd,0,sizeof(gcd));
- memset(&boxes,0,sizeof(boxes));
- memset(&label,0,sizeof(label));
-
- i = 0;
- gcd[i].gd.pos.x = 10; gcd[i].gd.pos.y = 5;
- gcd[i].gd.pos.height = 12*12+6;
- gcd[i].gd.flags = gg_enabled|gg_visible|gg_list_alphabetic|gg_list_multiplesel|gg_utf8_popup;
- gcd[i].gd.u.list = languages;
- gcd[i].gd.cid = 0;
- gcd[i].gd.popup_msg = (unichar_t *) _(
- "Select as many languages as needed\n"
- "Hold down the control key when clicking\n"
- "to make disjoint selections.");
- varray[0] = &gcd[i]; varray[1] = NULL;
- gcd[i++].creator = GListCreate;
-
- gcd[i].gd.pos.x = 15-3; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+gcd[i-1].gd.pos.height+5;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_OK");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.mnemonic = 'O';
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_OK;
- harray[0] = GCD_Glue; harray[1] = &gcd[i]; harray[2] = GCD_Glue;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = -15; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.mnemonic = 'C';
- gcd[i].gd.cid = CID_Cancel;
- harray[3] = GCD_Glue; harray[4] = &gcd[i]; harray[5] = GCD_Glue; harray[6] = NULL;
- gcd[i++].creator = GButtonCreate;
-
- boxes[2].gd.flags = gg_enabled|gg_visible;
- boxes[2].gd.u.boxelements = harray;
- boxes[2].creator = GHBoxCreate;
- varray[2] = &boxes[2]; varray[3] = NULL; varray[4] = NULL;
-
- boxes[0].gd.pos.x = boxes[0].gd.pos.y = 2;
- boxes[0].gd.flags = gg_enabled|gg_visible;
- boxes[0].gd.u.boxelements = varray;
- boxes[0].creator = GHVGroupCreate;
-
- GGadgetsCreate(gw,boxes);
- GHVBoxSetExpandableRow(boxes[0].ret,0);
- GHVBoxSetExpandableCol(boxes[2].ret,gb_expandgluesame);
- GHVBoxFitWindow(boxes[0].ret);
-
- GDrawSetVisible(gw,true);
- retry:
- while ( !done )
- GDrawProcessOneEvent(NULL);
- ret = NULL;
- ti = GGadgetGetList(gcd[0].ret,&len);
- if ( done==2 ) {
- int lcnt=0;
- for ( i=0; i<len; ++i ) {
- if ( ti[i]->selected )
- ++lcnt;
- }
- if ( lcnt==0 ) {
- gwwv_post_error(_("Language Missing"),_("You must select at least one language.\nUse the \"Default\" language if nothing else fits."));
- done = 0;
- goto retry;
- }
- ret = galloc(5*lcnt+1);
- *ret = '\0';
- pt = ret;
- for ( i=0; i<len; ++i ) {
- if ( done==2 && ti[i]->selected ) {
- uint32 tag = (uint32) (intpt) (ti[i]->userdata);
- *pt++ = tag>>24;
- *pt++ = tag>>16;
- *pt++ = tag>>8;
- *pt++ = tag&0xff;
- *pt++ = ',';
- }
- }
- if ( pt!=ret )
- pt[-1] = '\0';
- }
- GDrawDestroyWindow(gw);
-return( ret );
-}
-
-static void LK_NewScript(GGadget *g,int row) {
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- /* What's a good default lang list for a new script? */
- /* well it depends on what the script is, but we don't know that yet */
- /* dflt is safe */
-
- strings[2*row+1].u.md_str = copy("dflt");
-}
-
-static void ScriptMatrixInit(struct matrixinit *mi,char *scriptstr) {
- struct matrix_data *md;
- int k, cnt;
- char *start, *scriptend, *langsend;
-
- memset(mi,0,sizeof(*mi));
- mi->col_cnt = 2;
- mi->col_init = scriptci;
-
- md = NULL;
- for ( k=0; k<2; ++k ) {
- cnt = 0;
- for ( start = scriptstr; *start; ) {
- for ( scriptend=start; *scriptend!='\0' && *scriptend!='{'; ++scriptend );
- langsend = scriptend;
- if ( *scriptend=='{' )
- for ( langsend=scriptend+1; *langsend!='\0' && *langsend!='}'; ++langsend );
- if ( k ) {
- md[2*cnt+0].u.md_str = copyn(start,scriptend-start);
- if ( *scriptend=='{' )
- md[2*cnt+1].u.md_str = copyn(scriptend+1,langsend-(scriptend+1));
- else
- md[2*cnt+1].u.md_str = copy("");
- }
- ++cnt;
- if ( *langsend=='}' ) ++langsend;
- if ( *langsend==' ' ) ++langsend;
- start = langsend;
- }
- if ( md==NULL )
- md = gcalloc(2*(cnt+10),sizeof(struct matrix_data));
- }
- mi->matrix_data = md;
- mi->initial_row_cnt = cnt;
-
- mi->initrow = LK_NewScript;
- mi->finishedit = NULL;
- mi->candelete = NULL;
- mi->popupmenu = NULL;
- mi->handle_key = NULL;
- mi->bigedittitle = NULL;
-}
-
-static int Script_OK(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- int rows, i, j, script_cnt, lang_cnt;
- struct matrix_data *strings = GMatrixEditGet(GWidgetGetControl(ld->scriptgw,CID_FeatureScripts), &rows);
- char *pt, *start, *ret, *rpt;
- char foo[4];
-
- if ( rows==0 ) {
- gwwv_post_error(_("No scripts"),_("You must select at least one script if you provide a feature tag."));
-return(true);
- }
- script_cnt = rows;
- lang_cnt = 0;
- for ( i=0; i<rows; ++i ) {
- if ( strlen(strings[2*i+0].u.md_str)>4 ) {
- gwwv_post_error(_("Bad script tag"),_("The script tag on line %d (%s) is too long. It may be at most 4 letters"),
- i+1, strings[2*i+0].u.md_str);
-return(true);
- } else {
- for ( pt=strings[2*i+0].u.md_str; *pt!='\0' ; ++pt )
- if ( *pt>0x7e ) {
- gwwv_post_error(_("Bad script tag"),_("The script tag on line %d (%s) should be in ASCII.\n"),
- i+1, strings[2*i+0].u.md_str);
-return( true );
- }
- }
- /* Now check the languages */
- if ( *strings[2*i+1].u.md_str=='\0' ) {
- gwwv_post_error(_("No languages"),_("You must select at least one language for each script."));
-return(true);
- }
- for ( start=strings[2*i+1].u.md_str; *start!='\0'; ) {
- for ( pt=start; *pt!=',' && *pt!='\0'; ++pt ) {
- if ( *pt>0x7e ) {
- gwwv_post_error(_("Bad language tag"),_("A language tag on line %d (%s) should be in ASCII.\n"),
- i+1, strings[2*i+1].u.md_str);
-return( true );
- }
- }
- if ( pt-start>4 ) {
- gwwv_post_error(_("Bad language tag"),_("A language tag on line %d (%s) is too long. It may be at most 4 letters"),
- i+1, strings[2*i+0].u.md_str);
-return(true);
- }
- ++lang_cnt;
- start = pt;
- if ( *start==',' ) ++start;
- }
- }
-
- /* Ok, we validated the script lang list. Now parse it */
- rpt = ret = galloc(6*script_cnt+5*lang_cnt+10);
- for ( i=0; i<rows; ++i ) {
- memset(foo,' ',sizeof(foo));
- for ( j=0, pt = strings[2*i+0].u.md_str; j<4 && *pt; foo[j++] = *pt++ );
- strncpy(rpt,foo,4);
- rpt += 4;
- *rpt++ = '{';
- /* Now do the languages */
- for ( start=strings[2*i+1].u.md_str; *start!='\0'; ) {
- memset(foo,' ',sizeof(foo));
- for ( j=0,pt=start; *pt!=',' && *pt!='\0'; ++pt )
- foo[j++] = *pt;
- strncpy(rpt,foo,4);
- rpt += 4; *rpt++ = ',';
- if ( *pt==',' ) ++pt;
- start = pt;
- }
- if ( rpt>ret && rpt[-1]==',' )
- rpt[-1] = '}';
- *rpt++ = ' ';
- }
- if ( rpt>ret && rpt[-1]==' ' ) rpt[-1] = '\0';
- else *rpt = '\0';
- ld->scriptdone = true;
- ld->scriptret = ret;
- }
-return( true );
-}
-
-static int Script_Cancel(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- ld->scriptdone = true;
- ld->scriptret = NULL;
- }
-return( true );
-}
-
-static int script_e_h(GWindow gw, GEvent *event) {
-
- if ( event->type==et_close ) {
- struct lookup_dlg *ld = GDrawGetUserData(gw);
- ld->scriptdone = true;
- ld->scriptret = NULL;
- } else if ( event->type == et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("lookups.html#scripts-dlg");
-return( true );
- }
-return( false );
- }
-
-return( true );
-}
-
-static char *LK_ScriptsDlg(GGadget *g, int r, int c) {
- int rows, i, k, j;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- char *scriptstr = strings[2*r+c].u.md_str;
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[4], boxes[3];
- GGadgetCreateData *varray[6], *harray3[8];
- GTextInfo label[4];
- struct matrixinit mi;
-
- ld->scriptdone = 0;
- ld->scriptret = NULL;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.is_dlg = true;
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Script(s)...");
- pos.x = pos.y = 0;
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268));
- pos.height = GDrawPointsToPixels(NULL,375);
- ld->scriptgw = gw = GDrawCreateTopWindow(NULL,&pos,script_e_h,ld,&wattrs);
-
- ScriptMatrixInit(&mi,scriptstr);
-
- memset(&gcd,0,sizeof(gcd));
- memset(&boxes,0,sizeof(boxes));
- memset(&label,0,sizeof(label));
- k=j=0;
- gcd[k].gd.pos.x = 10; gcd[k].gd.pos.y = gcd[1].gd.pos.y+14;
- gcd[k].gd.pos.width = 300; gcd[k].gd.pos.height = 90;
- gcd[k].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
- gcd[k].gd.cid = CID_FeatureScripts;
- gcd[k].gd.u.matrix = &mi;
- gcd[k].gd.popup_msg = (unichar_t *) _(
- "Each feature is active for a specific set of\n"
- "scripts and languages.\n"
- "Usually only one script is specified, but\n"
- "occasionally more will be.\n"
- "A script is a four letter OpenType script tag\n");
- gcd[k].creator = GMatrixEditCreate;
- varray[j++] = &gcd[k++]; varray[j++] = NULL;
-
- gcd[k].gd.pos.x = 30-3;
- gcd[k].gd.pos.width = -1; gcd[k].gd.pos.height = 0;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[k].text = (unichar_t *) _("_OK");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.handle_controlevent = Script_OK;
- gcd[k].gd.cid = CID_OK;
- gcd[k++].creator = GButtonCreate;
-
- gcd[k].gd.pos.x = -30;
- gcd[k].gd.pos.width = -1; gcd[k].gd.pos.height = 0;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[k].text = (unichar_t *) _("_Cancel");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.handle_controlevent = Script_Cancel;
- gcd[k].gd.cid = CID_Cancel;
- gcd[k++].creator = GButtonCreate;
-
- harray3[0] = harray3[2] = harray3[3] = harray3[4] = harray3[6] = GCD_Glue;
- harray3[7] = NULL;
- harray3[1] = &gcd[k-2]; harray3[5] = &gcd[k-1];
-
- boxes[0].gd.flags = gg_enabled|gg_visible;
- boxes[0].gd.u.boxelements = harray3;
- boxes[0].creator = GHBoxCreate;
- varray[j++] = &boxes[0]; varray[j++] = NULL; varray[j] = NULL;
-
- boxes[1].gd.pos.x = boxes[1].gd.pos.y = 2;
- boxes[1].gd.flags = gg_enabled|gg_visible;
- boxes[1].gd.u.boxelements = varray;
- boxes[1].creator = GHVGroupCreate;
-
- GGadgetsCreate(gw,boxes+1);
-
- for ( i=0; i<mi.initial_row_cnt; ++i ) {
- free( mi.matrix_data[2*i+0].u.md_str );
- free( mi.matrix_data[2*i+1].u.md_str );
- }
- free( mi.matrix_data );
-
- GMatrixEditSetNewText(gcd[0].ret,S_("OpenTypeFeature|New"));
- GHVBoxSetExpandableRow(boxes[1].ret,0);
- GHVBoxSetExpandableCol(boxes[0].ret,gb_expandgluesame);
-
- GHVBoxFitWindow(boxes[1].ret);
-
- GDrawSetVisible(gw,true);
- while ( !ld->scriptdone )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-return( ld->scriptret );
-}
-
-static FeatureScriptLangList *LK_ParseFL(struct matrix_data *strings, int rows ) {
- int i,j;
- char *pt, *start;
- FeatureScriptLangList *fl, *fhead, *flast;
- struct scriptlanglist *sl, *slast;
- unsigned char foo[4];
- uint32 *langs=NULL;
- int lmax=0, lcnt=0;
- int feature, setting;
-
- fhead = flast = NULL;
- for ( i=0; i<rows; ++i ) {
- fl = chunkalloc(sizeof(FeatureScriptLangList));
- if ( sscanf(strings[2*i+0].u.md_str,"<%d,%d>", &feature, &setting )== 2 ) {
- fl->ismac = true;
- fl->featuretag = (feature<<16)|setting;
- } else {
- memset(foo,' ',sizeof(foo));
- for ( j=0, pt = strings[2*i+0].u.md_str; j<4 && *pt; foo[j++] = *pt++ );
- fl->featuretag = (foo[0]<<24) | (foo[1]<<16) | (foo[2]<<8) | foo[3];
- }
- if ( flast==NULL )
- fhead = fl;
- else
- flast->next = fl;
- flast = fl;
- /* Now do the script langs */
- slast = NULL;
- for ( start=strings[2*i+1].u.md_str; *start!='\0'; ) {
- memset(foo,' ',sizeof(foo));
- for ( j=0,pt=start; *pt!='{' && *pt!='\0'; ++pt )
- foo[j++] = *pt;
- sl = chunkalloc(sizeof( struct scriptlanglist ));
- sl->script = (foo[0]<<24) | (foo[1]<<16) | (foo[2]<<8) | foo[3];
- if ( slast==NULL )
- fl->scripts = sl;
- else
- slast->next = sl;
- slast = sl;
- if ( *pt!='{' ) {
- sl->lang_cnt = 1;
- sl->langs[0] = DEFAULT_LANG;
- start = pt;
- } else {
- lcnt=0;
- for ( start=pt+1; *start!='}' && *start!='\0' ; ) {
- memset(foo,' ',sizeof(foo));
- for ( j=0,pt=start; *pt!='}' && *pt!=',' && *pt!='\0'; foo[j++] = *pt++ );
- if ( lcnt>=lmax )
- langs = grealloc(langs,(lmax+=20)*sizeof(uint32));
- langs[lcnt++] = (foo[0]<<24) | (foo[1]<<16) | (foo[2]<<8) | foo[3];
- start = ( *pt==',' ) ? pt+1 : pt;
- }
- if ( *start=='}' ) ++start;
- for ( j=0; j<lcnt && j<MAX_LANG; ++j )
- sl->langs[j] = langs[j];
- if ( lcnt>MAX_LANG ) {
- sl->morelangs = galloc((lcnt-MAX_LANG)*sizeof(uint32));
- for ( ; j<lcnt; ++j )
- sl->morelangs[j-MAX_LANG] = langs[j];
- }
- sl->lang_cnt = lcnt;
- }
- while ( *start==' ' ) ++start;
- }
- }
- free(langs);
-return( fhead );
-}
-
-static void LK_FinishEdit(GGadget *g,int row, int col, int wasnew) {
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
-
- if ( col==0 ) {
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
-
- if ( !ld->isgpos &&
- (strcmp(strings[row].u.md_str,"liga")==0 ||
- strcmp(strings[row].u.md_str,"rlig")==0 ))
- GGadgetSetChecked( GWidgetGetControl(ld->gw,CID_LookupAfm ), true );
- }
- if ( row==0 && !ld->name_has_been_set && ld->orig->features==NULL ) {
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- OTLookup *otl = ld->orig;
- int old_type = otl->lookup_type;
- FeatureScriptLangList *oldfl = otl->features;
-
- otl->lookup_type = (intpt) GGadgetGetListItemSelected(GWidgetGetControl(ld->gw,CID_LookupType))->userdata;
- otl->features = LK_ParseFL(strings,rows);
- NameOTLookup(otl,ld->sf);
- GGadgetSetTitle8(GWidgetGetControl(ld->gw,CID_LookupName),otl->lookup_name);
- free(otl->lookup_name); otl->lookup_name = NULL;
- FeatureScriptLangListFree(otl->features); otl->features = oldfl;
- otl->lookup_type = old_type;
- }
-}
-
-static void LK_NewFeature(GGadget *g,int row) {
- int rows;
- struct matrix_data *strings = GMatrixEditGet(g, &rows);
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- SplineFont *sf, *_sf = ld->sf;
- SplineChar *sc;
- /* What's a good default script / lang list for a new feature? */
- /* well it depends on what the feature is, and on what's inside the lookup */
- /* Neither of those has been set yet. */
- /* So... give them everything we can think of. They can remove stuff */
- /* which is inappropriate */
- uint32 scripts[20], script, *langs;
- int scnt = 0, i, l;
- int gid, k;
- char *buf;
- int bmax, bpos;
-
- k=0;
- do {
- sf = k<_sf->subfontcnt ? _sf->subfonts[k] : _sf;
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc = sf->glyphs[gid])!=NULL ) {
- script = SCScriptFromUnicode(sc);
- for ( i=0; i<scnt; ++i )
- if ( script == scripts[i] )
- break;
- if ( i==scnt ) {
- scripts[scnt++] = script;
- if ( scnt>=20 ) /* If they've got lots of scripts, enumerating them all won't be much use... */
- break;
- }
- }
- ++k;
- } while ( k<_sf->subfontcnt && scnt<20 );
-
- if ( scnt==0 )
- scripts[scnt++] = DEFAULT_SCRIPT;
-
- buf = galloc(bmax = 100);
- bpos = 0;
- for ( i=0; i<scnt; ++i ) {
- langs = SFLangsInScript(sf,-1,scripts[i]);
- for ( l=0; langs[l]!=0; ++l );
- if ( bpos + 5+5*l+4 > bmax )
- buf = grealloc( buf, bmax += 5+5*l+100 );
- sprintf( buf+bpos, "%c%c%c%c{", scripts[i]>>24, scripts[i]>>16, scripts[i]>>8, scripts[i] );
- bpos+=5;
- for ( l=0; langs[l]!=0; ++l ) {
- sprintf( buf+bpos, "%c%c%c%c,", langs[l]>>24, langs[l]>>16, langs[l]>>8, langs[l] );
- bpos += 5;
- }
- if ( l>0 )
- --bpos;
- strcpy(buf+bpos,"} ");
- bpos += 2;
- free(langs);
- }
- if ( bpos>0 )
- buf[bpos-1] = '\0';
-
- strings[2*row+1].u.md_str = copy(buf);
- free(buf);
-}
-
-static void LKMatrixInit(struct matrixinit *mi,OTLookup *otl) {
- struct matrix_data *md;
- int k, cnt,j;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
- char featbuf[32], *buf=NULL;
- int blen=0, bpos=0;
-
- memset(mi,0,sizeof(*mi));
- mi->col_cnt = 2;
- mi->col_init = featureci;
-
- md = NULL;
- for ( k=0; k<2; ++k ) {
- cnt = 0;
- for ( fl=otl->features; fl!=NULL; fl=fl->next ) {
- if ( k ) {
- if ( fl->ismac )
- sprintf( featbuf, "<%d,%d>", fl->featuretag>>16, fl->featuretag&0xffff );
- else
- sprintf( featbuf, "%c%c%c%c", fl->featuretag>>24, fl->featuretag>>16,
- fl->featuretag>>8, fl->featuretag );
- md[2*cnt+0].u.md_str = copy(featbuf);
- bpos=0;
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
- if ( bpos+4/*script*/+1/*open brace*/+5*sl->lang_cnt+1+2 > blen )
- buf = grealloc(buf,blen+=5+5*sl->lang_cnt+3+200);
- sprintf( buf+bpos, "%c%c%c%c{", sl->script>>24, sl->script>>16,
- sl->script>>8, sl->script );
- bpos+=5;
- for ( j=0; j<sl->lang_cnt; ++j ) {
- uint32 tag = j<MAX_LANG ? sl->langs[j] : sl->morelangs[j-MAX_LANG];
- sprintf( buf+bpos, "%c%c%c%c,", tag>>24, tag>>16,
- tag>>8, tag );
- bpos+=5;
- }
- if ( sl->lang_cnt!=0 )
- --bpos;
- buf[bpos++] = '}';
- buf[bpos++] = ' ';
- }
- if ( bpos>0 )
- --bpos;
- buf[bpos] = '\0';
- md[2*cnt+1].u.md_str = copy(buf);
- }
- ++cnt;
- }
- if ( md==NULL )
- md = gcalloc(2*(cnt+10),sizeof(struct matrix_data));
- }
- mi->matrix_data = md;
- mi->initial_row_cnt = cnt;
-
- mi->initrow = LK_NewFeature;
- mi->finishedit = LK_FinishEdit;
- mi->candelete = NULL;
- mi->popupmenu = NULL;
- mi->handle_key = NULL;
- mi->bigedittitle = NULL;
- free(buf);
-}
-
-static GTextInfo *SFMarkClassList(SplineFont *sf,int class) {
- int i;
- GTextInfo *ti;
-
- if ( sf->cidmaster ) sf = sf->cidmaster;
- else if ( sf->mm!=NULL ) sf=sf->mm->normal;
-
- i = sf->mark_class_cnt;
- ti = gcalloc(i+4,sizeof( GTextInfo ));
- ti[0].text = utf82u_copy( _("All"));
- ti[0].selected = class==0;
- for ( i=1; i<sf->mark_class_cnt; ++i ) {
- ti[i].text = (unichar_t *) copy(sf->mark_class_names[i]);
- ti[i].text_is_1byte = true;
- if ( i==class ) ti[i].selected = true;
- }
-return( ti );
-}
-
-static int MaskFromLookupType(int lookup_type ) {
- switch ( lookup_type ) {
- case gsub_single: case gsub_multiple: case gsub_alternate:
- case gsub_ligature: case gsub_context: case gsub_contextchain:
-return( 1<<(lookup_type-1));
- case gsub_reversecchain:
-return( gsub_reversecchain_mask );
- case morx_indic: case morx_context: case morx_insert:
-return( morx_indic_mask<<(lookup_type-morx_indic) );
- case gpos_single: case gpos_pair: case gpos_cursive:
- case gpos_mark2base: case gpos_mark2ligature: case gpos_mark2mark:
- case gpos_context: case gpos_contextchain:
-return( gpos_single_mask<<(lookup_type-gpos_single) );
- case kern_statemachine:
-return( kern_statemachine_mask );
- default:
-return( 0 );
- }
-}
-
-static GTextInfo *FeatureListFromLookupType(int lookup_type) {
- int k, i, cnt, mask;
- GTextInfo *ti;
-
- mask = MaskFromLookupType( lookup_type );
- for ( k=0; k<2; ++k ) {
- cnt = 0;
- for ( i=0; friendlies[i].tag!=0; ++i ) if ( friendlies[i].masks&mask ) {
- if ( k ) {
- ti[cnt].text = (unichar_t *) copy( friendlies[i].friendlyname );
- ti[cnt].text_is_1byte = true;
- ti[cnt].userdata = friendlies[i].tagstr;
- }
- ++cnt;
- }
- if ( cnt==0 ) {
- if ( k ) {
- ti[cnt].text = (unichar_t *) copy( _("You must choose a lookup type") );
- ti[cnt].text_is_1byte = true;
- ti[cnt].userdata = "????";
- }
- ++cnt;
- }
- if ( !k )
- ti = gcalloc(cnt+1,sizeof(GTextInfo));
- }
-return( ti );
-}
-
-static int Lookup_NameChanged(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- if ( *_GGadgetGetTitle(g)!='\0' )
- ld->name_has_been_set = true;
- }
-return( true );
-}
-
-static int LK_TypeChanged(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- int lookup_type = (intpt) GGadgetGetListItemSelected(g)->userdata;
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- GTextInfo *ti = FeatureListFromLookupType( lookup_type );
- GMatrixEditSetColumnChoices( GWidgetGetControl(ld->gw,CID_LookupFeatures), 0, ti );
- GTextInfoListFree(ti);
- if ( !ld->isgpos ) {
- GGadgetSetEnabled( GWidgetGetControl(ld->gw,CID_LookupAfm ), lookup_type==gsub_ligature );
- if ( lookup_type!=gsub_ligature )
- GGadgetSetChecked( GWidgetGetControl(ld->gw,CID_LookupAfm ), false );
- }
- }
-return( true );
-}
-
-static int Lookup_OK(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- int lookup_type = (intpt) GGadgetGetListItemSelected(GWidgetGetControl(ld->gw,CID_LookupType))->userdata;
- int rows, i, isgpos;
- struct matrix_data *strings = GMatrixEditGet(GWidgetGetControl(ld->gw,CID_LookupFeatures), &rows);
- char *pt, *start, *name;
- OTLookup *otl = ld->orig, *test;
- int flags, afm;
- FeatureScriptLangList *fhead;
-
- if ( lookup_type==ot_undef ) {
- gwwv_post_error(_("No Lookup Type Selected"),_("You must select a Lookup Type."));
-return(true);
- }
- if ( *_GGadgetGetTitle(GWidgetGetControl(ld->gw,CID_LookupName))=='\0' ) {
- gwwv_post_error(_("Unnamed lookup"),_("You must name the lookup."));
-return(true);
- }
- for ( i=0; i<rows; ++i ) {
- if ( sscanf(strings[2*i+0].u.md_str,"<%*d,%*d>" )== 2 )
- /* It's a mac feature/setting */;
- else if ( strlen(strings[2*i+0].u.md_str)>4 ) {
- gwwv_post_error(_("Bad feature tag"),_("The feature tag on line %d (%s) is too long. It may be at most 4 letters (or it could be a mac feature setting, two numbers in brokets <3,4>)"),
- i+1, strings[2*i+0].u.md_str);
-return(true);
- } else {
- for ( pt=strings[2*i+0].u.md_str; *pt!='\0' ; ++pt )
- if ( *pt>0x7e ) {
- gwwv_post_error(_("Bad feature tag"),_("The feature tag on line %d (%s) should be in ASCII.\n"),
- i+1, strings[2*i+0].u.md_str);
-return( true );
- }
- }
- /* Now check the script langs */
- for ( start=strings[2*i+1].u.md_str; *start!='\0'; ) {
- for ( pt=start; *pt!='{' && *pt!='\0'; ++pt ) {
- if ( *pt>0x7e ) {
- gwwv_post_error(_("Bad script tag"),_("A script tag on line %d (%s) should be in ASCII.\n"),
- i+1, strings[2*i+1].u.md_str);
-return( true );
- }
- }
- if ( pt-start>4 ) {
- gwwv_post_error(_("Bad script tag"),_("A script tag on line %d (%s) is too long. It may be at most 4 letters"),
- i+1, strings[2*i+0].u.md_str);
-return(true);
- }
- if ( *pt=='{' ) {
- for ( start=pt+1; *start!='}' && *start!='\0' ; ) {
- for ( pt=start; *pt!='}' && *pt!=',' && *pt!='\0'; ++pt ) {
- if ( *pt>0x7e ) {
- gwwv_post_error(_("Bad language tag"),_("A language tag on line %d (%s) should be in ASCII.\n"),
- i+1, strings[2*i+1].u.md_str);
-return( true );
- }
- }
- if ( pt-start>4 ) {
- gwwv_post_error(_("Bad language tag"),_("A language tag on line %d (%s) is too long. It may be at most 4 letters"),
- i+1, strings[2*i+0].u.md_str);
-return(true);
- }
- start = ( *pt==',' ) ? pt+1 : pt;
- }
- if ( *start=='}' ) ++start;
- } else
- start = pt;
- while ( *start==' ' ) ++start;
- }
- }
- name = GGadgetGetTitle8(GWidgetGetControl(ld->gw,CID_LookupName));
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- for ( test = isgpos ? ld->sf->gpos_lookups : ld->sf->gsub_lookups; test!=NULL; test=test->next ) {
- if ( test!=otl && strcmp(test->lookup_name,name)==0 ) {
- gwwv_post_error(_("Lookup name already used"),_("This name has already been used for another lookup.\nLookup names must be unique.") );
- free(name);
-return(true);
- }
- }
- }
-
- flags = 0;
- if ( GGadgetIsChecked(GWidgetGetControl(ld->gw,CID_Lookup_R2L)) ) flags |= pst_r2l;
- if ( GGadgetIsChecked(GWidgetGetControl(ld->gw,CID_Lookup_IgnBase)) ) flags |= pst_ignorebaseglyphs;
- if ( GGadgetIsChecked(GWidgetGetControl(ld->gw,CID_Lookup_IgnLig)) ) flags |= pst_ignoreligatures;
- if ( GGadgetIsChecked(GWidgetGetControl(ld->gw,CID_Lookup_IgnMark)) ) flags |= pst_ignorecombiningmarks;
- flags |= ((intpt) GGadgetGetListItemSelected(GWidgetGetControl(ld->gw,CID_Lookup_ProcessMark))->userdata)<<8;
-
- if ( !ld->isgpos )
- afm = GGadgetIsChecked( GWidgetGetControl(ld->gw,CID_LookupAfm ));
- else
- afm = false;
-
- /* Ok, we validated the feature script lang list. Now parse it */
- fhead = LK_ParseFL(strings,rows);
- free( otl->lookup_name );
- FeatureScriptLangListFree( otl->features );
- otl->lookup_name = name;
- otl->lookup_type = lookup_type;
- otl->lookup_flags = flags;
- otl->features = FLOrder(fhead);
- otl->store_in_afm = afm;
- ld->done = true;
- ld->ok = true;
- }
-return( true );
-}
-
-static int Lookup_Cancel(GGadget *g, GEvent *e) {
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct lookup_dlg *ld = GDrawGetUserData(GGadgetGetWindow(g));
- ld->done = true;
- ld->ok = false;
- }
-return( true );
-}
-
-static int lookup_e_h(GWindow gw, GEvent *event) {
-
- if ( event->type==et_close ) {
- struct lookup_dlg *ld = GDrawGetUserData(gw);
- ld->done = true;
- ld->ok = false;
- } else if ( event->type == et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("lookups.html#Add-Lookup");
-return( true );
- }
-return( false );
- }
-
-return( true );
-}
-
-int EditLookup(OTLookup *otl,int isgpos,SplineFont *sf) {
- /* Ok we must provide a lookup type (but only if otl->type==ot_undef) */
- /* a set of lookup flags */
- /* a name */
- /* A potentially empty set of features, scripts and languages */
- /* afm */
- /* check to make sure the name isn't a duplicate */
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[14], boxes[7];
- GGadgetCreateData *harray1[4], *varray[14], *flagharray[4], *flagarray[12],
- *harray2[4], *harray3[8];
- GTextInfo label[14];
- struct lookup_dlg ld;
- struct matrixinit mi;
- int class, i, k, vpos;
-
- LookupUIInit();
-
- memset(&ld,0,sizeof(ld));
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.is_dlg = true;
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Lookup...");
- pos.x = pos.y = 0;
- pos.width =GDrawPointsToPixels(NULL,GGadgetScale(268));
- pos.height = GDrawPointsToPixels(NULL,375);
- ld.gw = gw = GDrawCreateTopWindow(NULL,&pos,lookup_e_h,&ld,&wattrs);
-
- ld.orig = otl;
- ld.sf = sf;
- ld.isgpos = isgpos;
-
- memset(boxes,0,sizeof(boxes));
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
-
- label[0].text = (unichar_t *) _("Type:");
- label[0].text_is_1byte = true;
- label[0].text_in_resource = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 12; gcd[0].gd.pos.y = 6+6;
- gcd[0].gd.flags = gg_visible | gg_enabled;
- gcd[0].creator = GLabelCreate;
-
- gcd[1].gd.pos.x = 100; gcd[1].gd.pos.y = 6; gcd[1].gd.pos.width = 200;
- gcd[1].gd.flags = otl->lookup_type!=ot_undef && otl->subtables!=NULL?
- (gg_visible| gg_utf8_popup) : (gg_visible | gg_enabled| gg_utf8_popup);
- gcd[1].gd.cid = CID_LookupType;
- gcd[1].gd.u.list = lookuptypes[isgpos];
- gcd[1].gd.handle_controlevent = LK_TypeChanged;
- gcd[1].gd.popup_msg = (unichar_t *) _(
- "Each lookup may contain many transformations,\n"
- "but each transformation must be of the same type.");
- gcd[1].creator = GListButtonCreate;
-
- for ( i=0; lookuptypes[isgpos][i].text!=NULL || lookuptypes[isgpos][i].line; ++i ) {
- if ( (void *) otl->lookup_type == lookuptypes[isgpos][i].userdata &&
- !lookuptypes[isgpos][i].line) {
- lookuptypes[isgpos][i].selected = true;
- gcd[1].gd.label = &lookuptypes[isgpos][i];
- } else
- lookuptypes[isgpos][i].selected = false;
- }
- harray1[0] = &gcd[0]; harray1[1] = &gcd[1]; harray1[2] = GCD_Glue; harray1[3] = NULL;
- boxes[0].gd.flags = gg_enabled|gg_visible;
- boxes[0].gd.u.boxelements = harray1;
- boxes[0].creator = GHBoxCreate;
- varray[0] = &boxes[0]; varray[1] = NULL;
-
- LKMatrixInit(&mi,otl);
- featureci[0].enum_vals = FeatureListFromLookupType(otl->lookup_type);
-
- gcd[2].gd.pos.x = 10; gcd[2].gd.pos.y = gcd[1].gd.pos.y+14;
- gcd[2].gd.pos.width = 300; gcd[2].gd.pos.height = 90;
- gcd[2].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
- gcd[2].gd.cid = CID_LookupFeatures;
- gcd[2].gd.u.matrix = &mi;
- gcd[2].gd.popup_msg = (unichar_t *) _(
- "Most lookups will be attached to a feature\n"
- "active in a specific script for certain languages.\n"
- "In some cases lookups will not be attached to any\n"
- "feature, but will be invoked by another lookup,\n"
- "a conditional one. In other cases a lookup might\n"
- "be attached to several features.\n"
- "A feature is either a four letter OpenType feature\n"
- "tag, or a two number mac <feature,setting> combination.");
- gcd[2].creator = GMatrixEditCreate;
- varray[2] = &gcd[2]; varray[3] = NULL;
-
-
- gcd[3].gd.pos.x = 5; gcd[3].gd.pos.y = 5;
- gcd[3].gd.flags = gg_visible | gg_enabled | (otl->lookup_flags&pst_r2l?gg_cb_on:0);
- label[3].text = (unichar_t *) _("Right To Left");
- label[3].text_is_1byte = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.cid = CID_Lookup_R2L;
- gcd[3].creator = GCheckBoxCreate;
- flagarray[0] = &gcd[3]; flagarray[1] = NULL;
-
- gcd[4].gd.pos.x = 5; gcd[4].gd.pos.y = gcd[3].gd.pos.y+15;
- gcd[4].gd.flags = gg_visible | gg_enabled | (otl->lookup_flags&pst_ignorebaseglyphs?gg_cb_on:0);
- label[4].text = (unichar_t *) _("Ignore Base Glyphs");
- label[4].text_is_1byte = true;
- gcd[4].gd.label = &label[4];
- gcd[4].gd.cid = CID_Lookup_IgnBase;
- gcd[4].creator = GCheckBoxCreate;
- flagarray[2] = &gcd[4]; flagarray[3] = NULL;
-
- gcd[5].gd.pos.x = 5; gcd[5].gd.pos.y = gcd[4].gd.pos.y+15;
- gcd[5].gd.flags = gg_visible | gg_enabled | (otl->lookup_flags&pst_ignoreligatures?gg_cb_on:0);
- label[5].text = (unichar_t *) _("Ignore Ligatures");
- label[5].text_is_1byte = true;
- gcd[5].gd.label = &label[5];
- gcd[5].gd.cid = CID_Lookup_IgnLig;
- gcd[5].creator = GCheckBoxCreate;
- flagarray[4] = &gcd[5]; flagarray[5] = NULL;
-
- gcd[6].gd.pos.x = 5; gcd[6].gd.pos.y = gcd[5].gd.pos.y+15;
- gcd[6].gd.flags = gg_visible | gg_enabled | (otl->lookup_flags&pst_ignorecombiningmarks?gg_cb_on:0);
- label[6].text = (unichar_t *) _("Ignore Combining Marks");
- label[6].text_is_1byte = true;
- gcd[6].gd.label = &label[6];
- gcd[6].gd.cid = CID_Lookup_IgnMark;
- gcd[6].creator = GCheckBoxCreate;
- flagarray[6] = &gcd[6]; flagarray[7] = NULL;
-
-/* GT: Process is a verb here and Mark is a noun. */
-/* GT: Marks of the given mark class are to be processed */
- label[7].text = (unichar_t *) _("Process Marks:");
- label[7].text_is_1byte = true;
- gcd[7].gd.label = &label[7];
- gcd[7].gd.pos.x = 5; gcd[7].gd.pos.y = gcd[6].gd.pos.y+16;
- gcd[7].gd.flags = sf->mark_class_cnt<=1 ? gg_visible : (gg_enabled|gg_visible);
- gcd[7].creator = GLabelCreate;
- flagharray[0] = &gcd[7];
-
- gcd[8].gd.pos.x = 10; gcd[8].gd.pos.y = gcd[7].gd.pos.y;
- gcd[8].gd.pos.width = 140;
- gcd[8].gd.flags = gcd[7].gd.flags;
- if ( (class = ((otl->lookup_flags&0xff00)>>8) )>= sf->mark_class_cnt )
- class = 0;
- gcd[8].gd.u.list = SFMarkClassList(sf,class);
- gcd[8].gd.label = &gcd[8].gd.u.list[class];
- gcd[8].gd.cid = CID_Lookup_ProcessMark;
- gcd[8].creator = GListButtonCreate;
- flagharray[1] = &gcd[8]; flagharray[2] = GCD_Glue; flagharray[3] = NULL;
-
- boxes[1].gd.flags = gg_enabled|gg_visible;
- boxes[1].gd.u.boxelements = flagharray;
- boxes[1].creator = GHBoxCreate;
-
- flagarray[8] = &boxes[1]; flagarray[9] = NULL; flagarray[10] = NULL;
-
- boxes[2].gd.pos.x = boxes[2].gd.pos.y = 2;
- boxes[2].gd.flags = gg_enabled|gg_visible;
- boxes[2].gd.u.boxelements = flagarray;
- boxes[2].creator = GHVGroupCreate;
- varray[4] = &boxes[2]; varray[5] = NULL;
-
- label[9].text = (unichar_t *) _("Lookup Name:");
- label[9].text_is_1byte = true;
- gcd[9].gd.label = &label[9];
- gcd[9].gd.pos.x = 5; gcd[9].gd.pos.y = gcd[8].gd.pos.y+16;
- gcd[9].gd.flags = gg_enabled|gg_visible;
- gcd[9].creator = GLabelCreate;
- harray2[0] = &gcd[9];
-
- label[10].text = (unichar_t *) otl->lookup_name;
- label[10].text_is_1byte = true;
- gcd[10].gd.pos.x = 10; gcd[10].gd.pos.y = gcd[9].gd.pos.y;
- gcd[10].gd.pos.width = 140;
- gcd[10].gd.flags = gcd[9].gd.flags;
- gcd[10].gd.label = otl->lookup_name==NULL ? NULL : &label[10];
- gcd[10].gd.cid = CID_LookupName;
- gcd[10].gd.handle_controlevent = Lookup_NameChanged;
- gcd[10].creator = GTextFieldCreate;
- harray2[1] = &gcd[10]; harray2[2] = NULL;
- if ( otl->lookup_name!=NULL && *otl->lookup_name!='\0' )
- ld.name_has_been_set = true;
-
- boxes[3].gd.flags = gg_enabled|gg_visible;
- boxes[3].gd.u.boxelements = harray2;
- boxes[3].creator = GHBoxCreate;
- varray[6] = &boxes[3]; varray[7] = NULL;
-
- k = 11; vpos = 8;
- if ( !isgpos ) {
- gcd[11].gd.pos.x = 5; gcd[11].gd.pos.y = gcd[5].gd.pos.y+15;
- gcd[11].gd.flags = otl->lookup_type!=gsub_ligature ? gg_visible :
- otl->store_in_afm ? (gg_visible | gg_enabled | gg_cb_on) :
- (gg_visible | gg_enabled);
- label[11].text = (unichar_t *) _("Store ligature data in AFM files");
- label[11].text_is_1byte = true;
- gcd[11].gd.label = &label[11];
- gcd[11].gd.cid = CID_LookupAfm;
- gcd[11].creator = GCheckBoxCreate;
- varray[8] = &gcd[11]; varray[9] = NULL;
- k = 12; vpos = 10;
- }
-
- gcd[k].gd.pos.x = 30-3;
- gcd[k].gd.pos.width = -1; gcd[k].gd.pos.height = 0;
- gcd[k].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[k].text = (unichar_t *) _("_OK");
- label[k].text_is_1byte = true;
- label[k].text_in_resource = true;
- gcd[k].gd.label = &label[k];
- gcd[k].gd.handle_controlevent = Lookup_OK;
- gcd[k].gd.cid = CID_OK;
- gcd[k].creator = GButtonCreate;
-
- gcd[k+1].gd.pos.x = -30;
- gcd[k+1].gd.pos.width = -1; gcd[k+1].gd.pos.height = 0;
- gcd[k+1].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[k+1].text = (unichar_t *) _("_Cancel");
- label[k+1].text_is_1byte = true;
- label[k+1].text_in_resource = true;
- gcd[k+1].gd.label = &label[k+1];
- gcd[k+1].gd.handle_controlevent = Lookup_Cancel;
- gcd[k+1].gd.cid = CID_Cancel;
- gcd[k+1].creator = GButtonCreate;
-
- harray3[0] = harray3[2] = harray3[3] = harray3[4] = harray3[6] = GCD_Glue;
- harray3[7] = NULL;
- harray3[1] = &gcd[k]; harray3[5] = &gcd[k+1];
-
- boxes[4].gd.flags = gg_enabled|gg_visible;
- boxes[4].gd.u.boxelements = harray3;
- boxes[4].creator = GHBoxCreate;
- varray[vpos++] = &boxes[4]; varray[vpos++] = NULL; varray[vpos] = NULL;
-
- boxes[5].gd.pos.x = boxes[5].gd.pos.y = 2;
- boxes[5].gd.flags = gg_enabled|gg_visible;
- boxes[5].gd.u.boxelements = varray;
- boxes[5].creator = GHVGroupCreate;
-
- GGadgetsCreate(gw,boxes+5);
-
- GTextInfoListFree(gcd[8].gd.u.list);
-
- for ( i=0; i<mi.initial_row_cnt; ++i ) {
- free( mi.matrix_data[2*i+0].u.md_str );
- free( mi.matrix_data[2*i+1].u.md_str );
- }
- free( mi.matrix_data );
-
- GMatrixEditSetNewText(gcd[2].ret,S_("OpenTypeFeature|New"));
- GHVBoxSetExpandableRow(boxes[5].ret,1);
- GHVBoxSetExpandableCol(boxes[4].ret,gb_expandgluesame);
- GHVBoxSetExpandableCol(boxes[3].ret,1);
- GHVBoxSetExpandableCol(boxes[1].ret,1);
- GHVBoxSetExpandableCol(boxes[0].ret,gb_expandglue);
-
- GHVBoxFitWindow(boxes[5].ret);
-
- GDrawSetVisible(gw,true);
- while ( !ld.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-
-return( ld.ok );
-}
-#endif
-
-static int _FeatureOrderId( int isgpos,uint32 tag ) {
- /* This is the order in which features should be executed */
-
- if ( !isgpos ) switch ( tag ) {
-/* GSUB ordering */
- case CHR('c','c','m','p'): /* Must be first? */
-return( -2 );
- case CHR('l','o','c','l'): /* Language dependent letter forms (serbian uses some different glyphs than russian) */
-return( -1 );
- case CHR('i','s','o','l'):
-return( 0 );
- case CHR('j','a','l','t'): /* must come after 'isol' */
-return( 1 );
- case CHR('f','i','n','a'):
-return( 2 );
- case CHR('f','i','n','2'):
- case CHR('f','a','l','t'): /* must come after 'fina' */
-return( 3 );
- case CHR('f','i','n','3'):
-return( 4 );
- case CHR('m','e','d','i'):
-return( 5 );
- case CHR('m','e','d','2'):
-return( 6 );
- case CHR('i','n','i','t'):
-return( 7 );
-
- case CHR('r','t','l','a'):
-return( 100 );
- case CHR('s','m','c','p'): case CHR('c','2','s','c'):
-return( 200 );
-
- case CHR('r','l','i','g'):
-return( 300 );
- case CHR('c','a','l','t'):
-return( 301 );
- case CHR('l','i','g','a'):
-return( 302 );
- case CHR('d','l','i','g'): case CHR('h','l','i','g'):
-return( 303 );
- case CHR('c','s','w','h'):
-return( 304 );
- case CHR('m','s','e','t'):
-return( 305 );
-
- case CHR('f','r','a','c'):
-return( 306 );
-
-/* Indic processing */
- case CHR('n','u','k','t'):
- case CHR('p','r','e','f'):
-return( 301 );
- case CHR('a','k','h','n'):
-return( 302 );
- case CHR('r','p','h','f'):
-return( 303 );
- case CHR('b','l','w','f'):
-return( 304 );
- case CHR('h','a','l','f'):
- case CHR('a','b','v','f'):
-return( 305 );
- case CHR('p','s','t','f'):
-return( 306 );
- case CHR('v','a','t','u'):
-return( 307 );
-
- case CHR('p','r','e','s'):
-return( 310 );
- case CHR('b','l','w','s'):
-return( 311 );
- case CHR('a','b','v','s'):
-return( 312 );
- case CHR('p','s','t','s'):
-return( 313 );
- case CHR('c','l','i','g'):
-return( 314 );
-
- case CHR('h','a','l','n'):
-return( 320 );
-/* end indic ordering */
-
- case CHR('a','f','r','c'):
- case CHR('l','j','m','o'):
- case CHR('v','j','m','o'):
-return( 350 );
- case CHR('v','r','t','2'): case CHR('v','e','r','t'):
-return( 1010 ); /* Documented to come last */
-
-/* Unknown things come after everything but vert/vrt2 */
- default:
-return( 1000 );
-
- } else switch ( tag ) {
-/* GPOS ordering */
- case CHR('c','u','r','s'):
-return( 0 );
- case CHR('d','i','s','t'):
-return( 100 );
- case CHR('b','l','w','m'):
-return( 201 );
- case CHR('a','b','v','m'):
-return( 202 );
- case CHR('k','e','r','n'):
-return( 300 );
- case CHR('m','a','r','k'):
-return( 400 );
- case CHR('m','k','m','k'):
-return( 500 );
-/* Unknown things come after everything */
- default:
-return( 1000 );
- }
-}
-
-int FeatureOrderId( int isgpos,FeatureScriptLangList *fl ) {
- int pos = 9999, temp;
-
- if ( fl==NULL )
-return( 0 );
-
- while ( fl!=NULL ) {
- temp = _FeatureOrderId(isgpos,fl->featuretag );
- if ( temp<pos ) pos = temp;
- fl = fl->next;
- }
-return( pos );
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-static OTLookup *CreateAndSortNewLookupOfType(SplineFont *sf, int lookup_type) {
- OTLookup *newotl;
- int isgpos = lookup_type>=gpos_start;
-
- newotl = chunkalloc(sizeof(OTLookup));
- newotl->lookup_type = lookup_type;
- if ( !EditLookup(newotl,isgpos,sf)) {
- chunkfree(newotl,sizeof(OTLookup));
-return( NULL );
- }
- SortInsertLookup(sf, newotl);
-return( newotl );
-}
-#endif
-
-/* ************************************************************************** */
-/* ***************************** Anchor Subtable **************************** */
-/* ************************************************************************** */
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
-typedef struct anchorclassdlg {
- SplineFont *sf;
- struct lookup_subtable *sub;
- GWindow gw;
- int mag, pixelsize;
- int orig_pos, orig_value, down;
- BDFFont *display;
- int done;
-} AnchorClassDlg, PSTKernDlg;
-#define CID_Anchors 2001
-
-#define CID_PSTList 2001
-#define CID_Alpha 2002
-#define CID_Unicode 2003
-#define CID_Scripts 2004
-#define CID_BaseChar 2005
-#define CID_Suffix 2006
-
-#define CID_KernDisplay 2022
-#define CID_PixelSize 2023
-#define CID_Magnification 2024
-
-static GTextInfo magnifications[] = {
- { (unichar_t *) "100%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 1, 0, 1},
- { (unichar_t *) "200%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "300%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) "400%", NULL, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }
-};
-
-static AnchorClass *SFAddAnchorClass(SplineFont *sf,struct lookup_subtable *sub,
- char *name) {
- AnchorClass *ac;
-
- ac = chunkalloc(sizeof(AnchorClass));
- ac->name = copy(name);
- ac->type = sub->lookup->lookup_type == gpos_mark2base ? act_mark :
- sub->lookup->lookup_type == gpos_mark2ligature ? act_mklg :
- sub->lookup->lookup_type == gpos_cursive ? act_curs :
- act_mkmk;
- ac->subtable = sub;
- ac->next = sf->anchor;
- sf->anchor = ac;
-return( ac );
-}
-
-static int AnchorClassD_ShowAnchors(GGadget *g, GEvent *e) {
- AnchorClassDlg *acd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct matrix_data *classes;
- int32 class_cnt;
- int row;
- AnchorClass *ac;
-
- acd = GDrawGetUserData(GGadgetGetWindow(g));
- classes = GMatrixEditGet(GWidgetGetControl(acd->gw,CID_Anchors), &class_cnt);
- row = GMatrixEditGetActiveRow(GWidgetGetControl(acd->gw,CID_Anchors));
- if ( row==-1 )
-return( true );
- for ( ac = acd->sf->anchor; ac!=NULL; ac=ac->next )
- if ( strcmp(ac->name,classes[row].u.md_str)==0 )
- break;
- if ( ac==NULL ) {
- ac = SFAddAnchorClass(acd->sf,acd->sub,classes[row].u.md_str);
- } else if ( ac->subtable!=acd->sub ) {
- gwwv_post_error(_("Name in use"),_("The name, %.80s, has already been used to identify an anchor class in a different lookup subtable (%.80s)"),
- ac->name, ac->subtable->subtable_name );
-return( true );
- }
- AnchorControlClass(acd->sf,ac);
- }
-return( true );
-}
-
-static void AC_EnableOtherButtons(GGadget *g,int r, int c) {
- GGadgetSetEnabled(GWidgetGetControl(GGadgetGetWindow(g),CID_ShowAnchors),
- r!=-1 );
-}
-
-static int AC_OK(GGadget *g, GEvent *e) {
- AnchorClassDlg *acd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct matrix_data *classes;
- int32 class_cnt;
- int i, justtest;
- AnchorClass *ac, *acnext;
-
- acd = GDrawGetUserData(GGadgetGetWindow(g));
- classes = GMatrixEditGet(GWidgetGetControl(acd->gw,CID_Anchors), &class_cnt);
- for ( justtest=1; justtest>=0 ; --justtest ) {
- for ( ac = acd->sf->anchor; ac!=NULL; ac=ac->next )
- ac->processed = false;
- for ( i=0; i<class_cnt; ++i ) {
- if ( *classes[i].u.md_str=='\0' )
- continue; /* Ignore blank lines. They pressed return once too much or something */
- for ( ac = acd->sf->anchor; ac!=NULL; ac=ac->next )
- if ( strcmp(ac->name,classes[i].u.md_str)==0 )
- break;
- if ( ac==NULL ) {
- if ( !justtest ) {
- ac = SFAddAnchorClass(acd->sf,acd->sub,classes[i].u.md_str);
- ac->processed = true;
- }
- } else if ( ac->subtable!=acd->sub ) {
- gwwv_post_error(_("Name in use"),_("The name, %.80s, has already been used to identify an anchor class in a different lookup subtable (%.80s)"),
- ac->name, ac->subtable->subtable_name );
-return( true );
- } else if ( ac->processed ) {
- gwwv_post_error(_("Name in use"),_("The name, %.80s, is used twice in this subtable"),
- ac->name );
-return( true );
- } else
- ac->processed = true;
- }
- for ( ac = acd->sf->anchor; ac!=NULL; ac=acnext ) {
- acnext = ac->next;
- if ( !ac->processed && ac->subtable == acd->sub ) {
- if ( justtest ) {
- char *buts[3];
- buts[0] = _("_Remove"); buts[1] = _("_Cancel"); buts[2]=NULL;
- if ( gwwv_ask(_("Remove Anchor Class?"),(const char **) buts,0,1,_("Do you really want to remove the anchor class, %.80s?\nThis will remove all anchor points associated with that class."))==1 )
-return( true );
- } else
- SFRemoveAnchorClass(acd->sf,ac);
- }
- }
- }
- acd->done = true;
- }
-return( true );
-}
-
-static void AC_DoCancel(AnchorClassDlg *acd) {
- acd->done = true;
-}
-
-static int AC_Cancel(GGadget *g, GEvent *e) {
- AnchorClassDlg *acd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- acd = GDrawGetUserData(GGadgetGetWindow(g));
- AC_DoCancel(acd);
- }
-return( true );
-}
-
-static int acd_e_h(GWindow gw, GEvent *event) {
- AnchorClassDlg *acd = GDrawGetUserData(gw);
-
- switch ( event->type ) {
- case et_close:
- AC_DoCancel(acd);
- break;
- case et_char:
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("lookups.html#Anchor");
-return( true );
- }
-return( false );
- break;
- case et_destroy:
- break;
- case et_mouseup: case et_mousemove: case et_mousedown:
- break;
- case et_expose:
- break;
- case et_resize:
- break;
- }
-return( true );
-}
-
-static void ACDMatrixInit(struct matrixinit *mi,SplineFont *sf, struct lookup_subtable *sub) {
- int cnt;
- AnchorClass *ac;
- struct matrix_data *md;
- static struct col_init ci[1] = {
- { me_string , NULL, NULL, NULL, N_("Anchor Class Name") }
- };
- static int initted = false;
-
- if ( !initted ) {
- initted = true;
- ci[0].title = S_(ci[0].title);
- }
-
- memset(mi,0,sizeof(*mi));
- mi->col_cnt = 1;
- mi->col_init = ci;
-
- for ( ac=sf->anchor, cnt=0; ac!=NULL; ac=ac->next )
- if ( ac->subtable == sub )
- ++cnt;
- if ( cnt==0 ) {
- md = gcalloc(1,sizeof(struct matrix_data));
- mi->initial_row_cnt = 0;
- } else {
- md = gcalloc(cnt,sizeof(struct matrix_data));
- for ( ac=sf->anchor, cnt=0; ac!=NULL; ac=ac->next )
- if ( ac->subtable == sub )
- md[cnt++].u.md_str = ac->name;
- mi->initial_row_cnt = cnt;
- }
- mi->matrix_data = md;
-}
-#endif
-
-/* Anchor list, [new], [delete], [edit], [show first mark/entry], [show first base/exit] */
-/* [ok], [cancel] */
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void AnchorClassD(SplineFont *sf, struct lookup_subtable *sub) {
- GRect pos;
- GWindowAttrs wattrs;
- AnchorClassDlg acd;
- GWindow gw;
- char buffer[200];
- GGadgetCreateData gcd[6], buttonbox, mainbox[2];
- GGadgetCreateData *buttonarray[8], *varray[7];
- GTextInfo label[6];
- int i;
- struct matrixinit mi;
-
- memset(&acd,0,sizeof(acd));
- acd.sf = sf;
- acd.sub = sub;
-
- memset(&wattrs,0,sizeof(wattrs));
- memset(&gcd,0,sizeof(gcd));
- memset(&buttonbox,0,sizeof(buttonbox));
- memset(&mainbox,0,sizeof(mainbox));
- memset(&label,0,sizeof(label));
-
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = true;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- snprintf(buffer,sizeof(buffer),_("Anchor classes in subtable %.80s"),
- sub->subtable_name );
- wattrs.utf8_window_title = buffer;
- wattrs.is_dlg = true;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,300));
- pos.height = GDrawPointsToPixels(NULL,200);
- acd.gw = gw = GDrawCreateTopWindow(NULL,&pos,acd_e_h,&acd,&wattrs);
-
- i = 0;
-
- ACDMatrixInit(&mi,sf,sub);
- gcd[i].gd.pos.width = 300; gcd[i].gd.pos.height = 200;
- gcd[i].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
- gcd[i].gd.cid = CID_Anchors;
- gcd[i].gd.u.matrix = &mi;
- gcd[i].data = &acd;
- gcd[i++].creator = GMatrixEditCreate;
- varray[0] = &gcd[i-1]; varray[1] = NULL;
-
- gcd[i].gd.pos.x = 10; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+24+3;
- gcd[i].gd.pos.width = -1;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_OK");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.handle_controlevent = AC_OK;
- gcd[i].gd.cid = CID_OK;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = -10; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
- gcd[i].gd.pos.width = -1;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.handle_controlevent = AC_Cancel;
- gcd[i].gd.cid = CID_Cancel;
- gcd[i++].creator = GButtonCreate;
-
- buttonarray[0] = GCD_Glue; buttonarray[1] = &gcd[i-2]; buttonarray[2] = GCD_Glue;
- buttonarray[3] = GCD_Glue; buttonarray[4] = &gcd[i-1]; buttonarray[5] = GCD_Glue;
- buttonarray[6] = NULL;
- buttonbox.gd.flags = gg_enabled|gg_visible;
- buttonbox.gd.u.boxelements = buttonarray;
- buttonbox.creator = GHBoxCreate;
- varray[2] = &buttonbox; varray[3] = NULL; varray[4] = NULL;
-
- mainbox[0].gd.pos.x = mainbox[0].gd.pos.y = 2;
- mainbox[0].gd.flags = gg_enabled|gg_visible;
- mainbox[0].gd.u.boxelements = varray;
- mainbox[0].creator = GHVGroupCreate;
-
- GGadgetsCreate(acd.gw,mainbox);
- GHVBoxSetExpandableRow(mainbox[0].ret,0);
- GHVBoxSetExpandableCol(buttonbox.ret,gb_expandgluesame);
-
- gcd[i].gd.flags = gg_visible | gg_enabled;
- label[i].text = (unichar_t *) S_("Anchor Control...");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_ShowAnchors;
- gcd[i].gd.handle_controlevent = AnchorClassD_ShowAnchors;
- gcd[i].creator = GButtonCreate;
-
- GMatrixEditAddButtons(gcd[0].ret,gcd+i);
- GMatrixEditSetOtherButtonEnable(gcd[0].ret,AC_EnableOtherButtons);
- GMatrixEditSetNewText(gcd[0].ret,S_("New Anchor Class"));
-
- GDrawSetVisible(acd.gw,true);
- while ( !acd.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(acd.gw);
-}
-#endif
-
-/* ************************************************************************** */
-/* ********************** Single/Double Glyph Subtables ********************* */
-/* ************************************************************************** */
-
-#ifndef LUA_FF_LIB
-
-static int isalphabetic = true, byscripts = true, stemming=true;
-int lookup_hideunused = true;
-static int ispair;
-
-struct sortinfo {
- char *glyphname; /* We replace the glyph name with a pointer to*/
- /* this structure, but must restore it when */
- /* finished sorting */
- SplineChar *sc; /* The glyph itself */
- SplineChar *base; /* The base of Agrave would be A */
- uint32 script;
-};
-
-static void SortPrep(PSTKernDlg *pstkd, struct matrix_data *md, struct sortinfo *si) {
-
- si->glyphname = md->u.md_str;
- md->u.md_ival = (intpt) si;
-
- si->sc = SFGetChar(pstkd->sf,-1,si->glyphname);
- if ( si->sc==NULL )
-return;
- if ( byscripts )
- si->script = SCScriptFromUnicode(si->sc);
- if ( stemming ) {
- const unichar_t *alt=NULL;
- int uni = si->sc->unicodeenc;
- char *pt;
-
- if ( isdecompositionnormative(uni) &&
- unicode_alternates[uni>>8]!=NULL &&
- (alt = unicode_alternates[uni>>8][uni&0xff])!=NULL )
- si->base = SFGetChar(pstkd->sf,alt[0],NULL);
- if ( si->base==NULL &&
- ((pt=strchr(si->glyphname,'.'))!=NULL ||
- (pt=strchr(si->glyphname,'_'))!=NULL )) {
- int ch = *pt;
- *pt = '\0';
- si->base = SFGetChar(pstkd->sf,-1,si->glyphname);
- *pt = ch;
- }
- if ( si->base==NULL )
- si->base = si->sc;
- }
-}
-
-static void SortUnPrep(struct matrix_data *md) {
- struct sortinfo *si = (struct sortinfo *) (md->u.md_ival);
-
- md->u.md_str = si->glyphname;
-}
-
-static int _md_cmp(const struct sortinfo *md1, const struct sortinfo *md2) {
-
- if ( md1->sc==NULL || md2->sc==NULL ) {
- if ( md1->sc!=NULL )
-return( 1 );
- else if ( md2->sc!=NULL )
-return( -1 );
- else
-return( strcmp( md1->glyphname,md2->glyphname ));
- }
-
- if ( byscripts && md1->script!=md2->script ) {
- if ( md1->script==DEFAULT_SCRIPT )
-return( 1 );
- else if ( md2->script==DEFAULT_SCRIPT )
-return( -1 );
- if ( md1->script>md2->script )
-return( 1 );
- else
-return( -1 );
- }
-
- if ( !isalphabetic ) {
- int uni1;
- int uni2;
-
- if ( stemming ) {
- /* First ignore case */
- uni1 = (md1->base->unicodeenc!=-1)? md1->base->unicodeenc : 0xffffff;
- uni2 = (md2->base->unicodeenc!=-1)? md2->base->unicodeenc : 0xffffff;
- if ( uni1<0x10000 && islower(uni1)) uni1 = toupper(uni1);
- if ( uni2<0x10000 && islower(uni2)) uni2 = toupper(uni2);
-
- if ( uni1>uni2 )
-return( 1 );
- else if ( uni1<uni2 )
-return( -1 );
-
- uni1 = (md1->base->unicodeenc!=-1)? md1->base->unicodeenc : 0xffffff;
- uni2 = (md2->base->unicodeenc!=-1)? md2->base->unicodeenc : 0xffffff;
- if ( uni1>uni2 )
-return( 1 );
- else if ( uni1<uni2 )
-return( -1 );
- }
-
- uni1 = (md1->sc->unicodeenc!=-1)? md1->sc->unicodeenc : 0xffffff;
- uni2 = (md2->sc->unicodeenc!=-1)? md2->sc->unicodeenc : 0xffffff;
- if ( uni1>uni2 )
-return( 1 );
- else if ( uni1<uni2 )
-return( -1 );
- } else {
- if ( stemming ) {
- int ret;
- ret = strcasecmp(md1->base->name,md2->base->name);
- if ( ret!=0 )
-return( ret );
- ret = strcmp(md1->base->name,md2->base->name);
- if ( ret!=0 )
-return( ret );
- }
- }
-return( strcmp(md1->glyphname,md2->glyphname));
-}
-
-static int md_cmp(const void *_md1, const void *_md2) {
- const struct matrix_data *md1 = _md1, *md2 = _md2;
- int ret = _md_cmp((struct sortinfo *) md1->u.md_ival,(struct sortinfo *) md2->u.md_ival);
-
- if ( ret==0 && ispair )
- ret = _md_cmp((struct sortinfo *) md1[1].u.md_ival,(struct sortinfo *) md2[1].u.md_ival);
-return( ret );
-}
-
-static void PSTKD_DoSort(PSTKernDlg *pstkd,struct matrix_data *psts,int rows,int cols) {
- struct sortinfo *primary, *secondary=NULL;
- int i;
-
- if ( pstkd->gw!=NULL && GWidgetGetControl(pstkd->gw,CID_Alpha)!=NULL ) {
- isalphabetic = GGadgetIsChecked(GWidgetGetControl(pstkd->gw,CID_Alpha));
- byscripts = GGadgetIsChecked(GWidgetGetControl(pstkd->gw,CID_Scripts));
- stemming = GGadgetIsChecked(GWidgetGetControl(pstkd->gw,CID_BaseChar));
- }
- primary = gcalloc(rows,sizeof(struct sortinfo));
- ispair = pstkd->sub->lookup->lookup_type == gpos_pair;
- if ( ispair )
- secondary = gcalloc(rows,sizeof(struct sortinfo));
- for ( i=0; i<rows; ++i ) {
- SortPrep(pstkd,&psts[i*cols+0],&primary[i]);
- if ( ispair )
- SortPrep(pstkd,&psts[i*cols+1],&secondary[i]);
- }
- qsort( psts, rows, cols*sizeof(struct matrix_data), md_cmp);
- for ( i=0; i<rows; ++i ) {
- SortUnPrep(&psts[i*cols+0]);
- if ( ispair )
- SortUnPrep(&psts[i*cols+1]);
- }
- free(primary);
- free(secondary);
-}
-
-static void PSTMatrixInit(struct matrixinit *mi,SplineFont *_sf, struct lookup_subtable *sub, PSTKernDlg *pstkd) {
- int cnt;
- struct matrix_data *md;
- static struct col_init simplesubsci[2] = {
- { me_string , NULL, NULL, NULL, N_("Base Glyph Name") },
- { me_string, NULL, NULL, NULL, N_("Replacement Glyph Name") }
- };
- static struct col_init ligatureci[2] = {
- { me_string , NULL, NULL, NULL, N_("Ligature Glyph Name") },
- { me_string, NULL, NULL, NULL, N_("Source Glyph Names") }
- };
- static struct col_init altmultsubsci[2] = {
- { me_string , NULL, NULL, NULL, N_("Base Glyph Name") },
- { me_string, NULL, NULL, NULL, N_("Replacement Glyph Names") }
- };
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
-#define SIM_DX 1
-#define SIM_DY 3
-#define SIM_DX_ADV 5
-#define SIM_DY_ADV 7
-#define PAIR_DX1 2
-#define PAIR_DY1 4
-#define PAIR_DX_ADV1 6
-#define PAIR_DY_ADV1 8
-#define PAIR_DX2 10
-#define PAIR_DY2 12
-#define PAIR_DX_ADV2 14
-#define PAIR_DY_ADV2 16
- static struct col_init simpleposci[] = {
- { me_string , NULL, NULL, NULL, N_("Base Glyph Name") },
- { me_int, NULL, NULL, NULL, NU_("∆x") }, /* delta-x */
-/* GT: "Adjust" here means Device Table based pixel adjustments, an OpenType */
-/* GT: concept which allows small corrections for small pixel sizes where */
-/* GT: rounding errors (in kerning for example) may smush too glyphs together */
-/* GT: or space them too far apart. Generally not a problem for big pixelsizes*/
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆y") }, /* delta-y */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆x_adv") }, /* delta-x-adv */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆y_adv") }, /* delta-y-adv */
- { me_string, NULL, NULL, NULL, N_("Adjust") }
- };
- static struct col_init pairposci[] = {
- { me_string , NULL, NULL, NULL, N_("First Glyph Name") },
- { me_string , NULL, NULL, NULL, N_("Second Glyph Name") },
- { me_int, NULL, NULL, NULL, NU_("∆x #1") }, /* delta-x */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆y #1") }, /* delta-y */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆x_adv #1") }, /* delta-x-adv */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆y_adv #1") }, /* delta-y-adv */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆x #2") }, /* delta-x */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆y #2") }, /* delta-y */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆x_adv #2") }, /* delta-x-adv */
- { me_string, NULL, NULL, NULL, N_("Adjust") },
- { me_int, NULL, NULL, NULL, NU_("∆y_adv #2") }, /* delta-y-adv */
- { me_string, NULL, NULL, NULL, N_("Adjust") }
- };
-#else
-#define SIM_DX 1
-#define SIM_DY 2
-#define SIM_DX_ADV 3
-#define SIM_DY_ADV 4
-#define PAIR_DX1 2
-#define PAIR_DY1 3
-#define PAIR_DX_ADV1 4
-#define PAIR_DY_ADV1 5
-#define PAIR_DX2 6
-#define PAIR_DY2 7
-#define PAIR_DX_ADV2 8
-#define PAIR_DY_ADV2 9
- static struct col_init simpleposci[5] = {
- { me_string , NULL, NULL, NULL, N_("Base Glyph Name") },
- { me_int, NULL, NULL, NULL, NU_("∆x") }, /* delta-x */
- { me_int, NULL, NULL, NULL, NU_("∆y") }, /* delta-y */
- { me_int, NULL, NULL, NULL, NU_("∆x_adv") }, /* delta-x-adv */
- { me_int, NULL, NULL, NULL, NU_("∆y_adv") } /* delta-y-adv */
- };
- static struct col_init pairposci[10] = {
- { me_string , NULL, NULL, NULL, N_("First Glyph Name") },
- { me_string , NULL, NULL, NULL, N_("Second Glyph Name") },
- { me_int, NULL, NULL, NULL, NU_("∆x #1") }, /* delta-x */
- { me_int, NULL, NULL, NULL, NU_("∆y #1") }, /* delta-y */
- { me_int, NULL, NULL, NULL, NU_("∆x_adv #1") }, /* delta-x-adv */
- { me_int, NULL, NULL, NULL, NU_("∆y_adv #1") }, /* delta-y-adv */
- { me_int, NULL, NULL, NULL, NU_("∆x #2") }, /* delta-x */
- { me_int, NULL, NULL, NULL, NU_("∆y #2") }, /* delta-y */
- { me_int, NULL, NULL, NULL, NU_("∆x_adv #2") }, /* delta-x-adv */
- { me_int, NULL, NULL, NULL, NU_("∆y_adv #2") } /* delta-y-adv */
- };
-#endif
- static struct { int ltype; int cnt; struct col_init *ci; } fuf[] = {
- { gsub_single, sizeof(simplesubsci)/sizeof(struct col_init), simplesubsci },
- { gsub_multiple, sizeof(altmultsubsci)/sizeof(struct col_init), altmultsubsci },
- { gsub_alternate, sizeof(altmultsubsci)/sizeof(struct col_init), altmultsubsci },
- { gsub_ligature, sizeof(ligatureci)/sizeof(struct col_init), ligatureci },
- { gpos_single, sizeof(simpleposci)/sizeof(struct col_init), simpleposci },
- { gpos_pair, sizeof(pairposci)/sizeof(struct col_init), pairposci },
- { 0 }
- };
- static int initted = false;
- int lookup_type = sub->lookup->lookup_type;
- int isv, r2l = sub->lookup->lookup_flags&pst_r2l;
- int i,j, gid,k;
- SplineFont *sf;
- SplineChar *sc;
- PST *pst;
- KernPair *kp;
-
- if ( !initted ) {
- initted = true;
- for ( i=0; fuf[i].ltype!=0; ++i ) if ( fuf[i].ltype!=gsub_alternate ) {
- for ( j=0; j<fuf[i].cnt; ++j )
- fuf[i].ci[j].title = S_(fuf[i].ci[j].title);
- }
- }
-
- memset(mi,0,sizeof(*mi));
- for ( i=0; fuf[i].ltype!=0 && fuf[i].ltype!=lookup_type; ++i );
- if ( fuf[i].ltype==0 ) {
- IError( "Unknown lookup type in PSTMatrixInit");
- i -= 2;
- }
- mi->col_cnt = fuf[i].cnt;
- mi->col_init = fuf[i].ci;
-
- for ( j=0; j<2; ++j ) {
- cnt = 0;
- k = 0;
- do {
- sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
- for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
- for ( pst = sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable == sub ) {
- if ( j ) {
- md[cnt*mi->col_cnt].u.md_str = copy( sc->name );
- switch ( lookup_type ) {
- case gsub_single:
- md[cnt*mi->col_cnt+1].u.md_str = copy(pst->u.subs.variant);
- break;
- case gsub_multiple:
- case gsub_alternate:
- md[cnt*mi->col_cnt+1].u.md_str = copy(pst->u.mult.components);
- break;
- case gsub_ligature:
- md[cnt*mi->col_cnt+1].u.md_str = copy(pst->u.lig.components);
- break;
- case gpos_single:
- md[cnt*mi->col_cnt+SIM_DX].u.md_ival = pst->u.pos.xoff;
- md[cnt*mi->col_cnt+SIM_DY].u.md_ival = pst->u.pos.yoff;
- md[cnt*mi->col_cnt+SIM_DX_ADV].u.md_ival = pst->u.pos.h_adv_off;
- md[cnt*mi->col_cnt+SIM_DY_ADV].u.md_ival = pst->u.pos.v_adv_off;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- ValDevTabToStrings(md,cnt*mi->col_cnt+SIM_DX+1,pst->u.pos.adjust);
-#endif
- break;
- case gpos_pair:
- md[cnt*mi->col_cnt+1].u.md_str = copy( pst->u.pair.paired );
- md[cnt*mi->col_cnt+PAIR_DX1].u.md_ival = pst->u.pair.vr[0].xoff;
- md[cnt*mi->col_cnt+PAIR_DY1].u.md_ival = pst->u.pair.vr[0].yoff;
- md[cnt*mi->col_cnt+PAIR_DX_ADV1].u.md_ival = pst->u.pair.vr[0].h_adv_off;
- md[cnt*mi->col_cnt+PAIR_DY_ADV1].u.md_ival = pst->u.pair.vr[0].v_adv_off;
- md[cnt*mi->col_cnt+PAIR_DX2].u.md_ival = pst->u.pair.vr[1].xoff;
- md[cnt*mi->col_cnt+PAIR_DY2].u.md_ival = pst->u.pair.vr[1].yoff;
- md[cnt*mi->col_cnt+PAIR_DX_ADV2].u.md_ival = pst->u.pair.vr[1].h_adv_off;
- md[cnt*mi->col_cnt+PAIR_DY_ADV2].u.md_ival = pst->u.pair.vr[1].v_adv_off;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- ValDevTabToStrings(md,cnt*mi->col_cnt+PAIR_DX1+1,pst->u.pair.vr[0].adjust);
- ValDevTabToStrings(md,cnt*mi->col_cnt+PAIR_DX2+1,pst->u.pair.vr[1].adjust);
-#endif
- break;
- }
- }
- ++cnt;
- }
- }
- if ( lookup_type==gpos_pair ) {
- for ( isv=0; isv<2; ++isv ) {
- for ( kp = isv ? sc->vkerns : sc->kerns ; kp!=NULL; kp=kp->next ) {
- if ( kp->subtable == sub ) {
- if ( j ) {
- md[cnt*mi->col_cnt+0].u.md_str = copy( sc->name );
- md[cnt*mi->col_cnt+1].u.md_str = copy( kp->sc->name );
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( isv ) {
- md[cnt*mi->col_cnt+PAIR_DY_ADV1].u.md_ival = kp->off;
- DevTabToString(&md[cnt*mi->col_cnt+PAIR_DY_ADV1+1].u.md_str,kp->adjust);
- } else if ( r2l ) {
- md[cnt*mi->col_cnt+PAIR_DY_ADV1].u.md_ival = kp->off;
- DevTabToString(&md[cnt*mi->col_cnt+PAIR_DY_ADV1+1].u.md_str,kp->adjust);
- } else {
- md[cnt*mi->col_cnt+PAIR_DX_ADV1].u.md_ival = kp->off;
- DevTabToString(&md[cnt*mi->col_cnt+PAIR_DX_ADV1+1].u.md_str,kp->adjust);
- }
-#else
- if ( isv )
- md[cnt*mi->col_cnt+PAIR_DY_ADV1].u.md_ival = kp->off;
- else if ( r2l )
- md[cnt*mi->col_cnt+PAIR_DX_ADV2].u.md_ival = kp->off;
- else
- md[cnt*mi->col_cnt+PAIR_DX_ADV1].u.md_ival = kp->off;
-#endif
- }
- ++cnt;
- }
- }
- }
- }
- }
- ++k;
- } while ( k<_sf->subfontcnt );
- if ( !j ) {
- mi->initial_row_cnt = cnt;
- if ( cnt==0 ) {
- md = gcalloc(mi->col_cnt,sizeof(struct matrix_data));
- break;
- } else {
- md = gcalloc(mi->col_cnt*cnt,sizeof(struct matrix_data));
- }
- }
- }
- PSTKD_DoSort(pstkd,md,cnt,mi->col_cnt);
- mi->matrix_data = md;
-}
-
-static int PSTKD_Sort(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- GGadget *pstk = GWidgetGetControl(pstkd->gw,CID_PSTList);
- int rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *old = GMatrixEditGet(pstk,&rows);
- PSTKD_DoSort(pstkd,old,rows,cols);
- GGadgetRedraw(pstk);
- }
-return( true );
-}
-
-static void PSTKD_DoHideUnused(PSTKernDlg *pstkd) {
- GGadget *pstk = GWidgetGetControl(pstkd->gw,CID_PSTList);
- int rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *old = GMatrixEditGet(pstk,&rows);
- uint8 cols_used[20];
- int r, col, startc, tot;
-
- startc = ( pstkd->sub->lookup->lookup_type == gpos_single ) ? 1 : 2;
- if ( lookup_hideunused ) {
- memset(cols_used,0,sizeof(cols_used));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- for ( r=0; r<rows; ++r ) {
- for ( col=startc; col<cols; col+=2 ) {
- if ( old[cols*r+col].u.md_ival!=0 )
- cols_used[col] = true;
- if ( old[cols*r+col+1].u.md_str!=NULL && *old[cols*r+col+1].u.md_str!='\0' )
- cols_used[col+1] = true;
- }
- }
-#else
- for ( r=0; r<rows; ++r ) {
- for ( col=startc; col<cols; ++col ) {
- if ( old[cols*r+col].u.md_ival!=0 )
- cols_used[col] = true;
- }
- }
-#endif
- /* If no columns used (no info yet, all info is to preempt a kernclass and sets to 0) */
- /* then show what we expect to be the default column for this kerning mode*/
- for ( col=startc, tot=0; col<cols; ++col )
- tot += cols_used[col];
- if ( tot==0 ) {
- if ( startc==1 ) {
- cols_used[SIM_DX] = cols_used[SIM_DY] =
- cols_used[SIM_DX_ADV] = cols_used[SIM_DY_ADV] = true;
- } else {
- if ( pstkd->sub->vertical_kerning )
- cols_used[PAIR_DY_ADV1] = true;
- else if ( pstkd->sub->lookup->lookup_flags&pst_r2l )
- cols_used[PAIR_DX_ADV2] = true;
- else
- cols_used[PAIR_DX_ADV1] = true;
- }
- }
- for ( col=startc; col<cols; ++col )
- GMatrixEditShowColumn(pstk,col,cols_used[col]);
- } else {
- for ( col=startc; col<cols; ++col )
- GMatrixEditShowColumn(pstk,col,true);
- }
- GWidgetToDesiredSize(pstkd->gw);
-
- GGadgetRedraw(pstk);
-}
-
-static int PSTKD_HideUnused(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_radiochanged ) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- lookup_hideunused = GGadgetIsChecked(g);
- PSTKD_DoHideUnused(pstkd);
- GGadgetRedraw(GWidgetGetControl(pstkd->gw,CID_PSTList));
- }
-return( true );
-}
-
-static int PSTKD_MagnificationChanged(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- int mag = GGadgetGetFirstListSelectedItem(g);
-
- if ( mag!=-1 && mag!=pstkd->mag-1 ) {
- pstkd->mag = mag+1;
- GGadgetRedraw(GWidgetGetControl(pstkd->gw,CID_KernDisplay));
- }
- }
-return( true );
-}
-
-static int PSTKD_DisplaySizeChanged(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_textchanged ) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- const unichar_t *ret = _GGadgetGetTitle(GWidgetGetControl(pstkd->gw,CID_PixelSize));
- unichar_t *end;
- int pixelsize = u_strtol(ret,&end,10);
-
- while ( *end==' ' ) ++end;
- if ( pixelsize>4 && pixelsize<400 && *end=='\0' ) {
- pstkd->pixelsize = pixelsize;
- if ( pstkd->display!=NULL ) {
- BDFFontFree(pstkd->display);
- pstkd->display = NULL;
- }
- GGadgetRedraw(GWidgetGetControl(pstkd->gw,CID_KernDisplay));
- }
- }
-return( true );
-}
-
-static void PSTKD_METextChanged(GGadget *g, int r, int c, GGadget *text) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- GGadgetRedraw(GWidgetGetControl(pstkd->gw,CID_KernDisplay));
-}
-
-static int FigureValue(struct matrix_data *old,int rcol,int c, int startc,
- GGadget *tf,double scale, int pixelsize) {
- int val;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- char *str, *freeme=NULL;
- DeviceTable dt;
-#endif
-
- if ( c==startc && tf!=NULL )
- val = u_strtol(_GGadgetGetTitle(tf),NULL,10);
- else
- val = old[rcol+startc].u.md_ival;
- val = rint(val*scale);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( c==startc+1 && tf!=NULL )
- str = freeme = GGadgetGetTitle8(tf);
- else
- str = old[rcol+startc+1].u.md_str;
- memset(&dt,0,sizeof(dt));
- DeviceTableParse(&dt,str);
- if ( pixelsize>=dt.first_pixel_size && pixelsize<=dt.last_pixel_size && dt.corrections!=NULL )
- val += dt.corrections[pixelsize-dt.first_pixel_size];
- free(dt.corrections);
- free(freeme);
-#endif
-return( val );
-}
-
-static int ParsePSTKVR(PSTKernDlg *pstkd,GGadget *pstk,int startc,struct vr *vr) {
- int rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *old = _GMatrixEditGet(pstk,&rows);
- GGadget *tf = _GMatrixEditGetActiveTextField(pstk);
- int r = GMatrixEditGetActiveRow(pstk);
- int c = GMatrixEditGetActiveCol(pstk);
- double scale = pstkd->pixelsize/(double) (pstkd->sf->ascent+pstkd->sf->descent);
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- vr->xoff = FigureValue(old,r*cols,c,startc,tf,scale,pstkd->pixelsize);
- vr->yoff = FigureValue(old,r*cols,c,startc+2,tf,scale,pstkd->pixelsize);
- vr->h_adv_off = FigureValue(old,r*cols,c,startc+4,tf,scale,pstkd->pixelsize);
- vr->v_adv_off = FigureValue(old,r*cols,c,startc+6,tf,scale,pstkd->pixelsize);
-#else
- vr->xoff = FigureValue(old,r*cols,c,startc,tf,scale,pstkd->pixelsize);
- vr->yoff = FigureValue(old,r*cols,c,startc+1,tf,scale,pstkd->pixelsize);
- vr->h_adv_off = FigureValue(old,r*cols,c,startc+2,tf,scale,pstkd->pixelsize);
- vr->v_adv_off = FigureValue(old,r*cols,c,startc+3,tf,scale,pstkd->pixelsize);
-#endif
-return( true );
-}
-
-static void PSTKern_DrawGlyph(GWindow pixmap,int x,int y, BDFChar *bc, int mag) {
- /* x,y is the location of the origin of the glyph, they need to */
- /* be adjusted by the images xmin, ymax, etc. */
- struct _GImage base;
- GImage gi;
- GClut clut;
- int scale, l;
- Color fg, bg;
-
- scale = bc->depth == 8 ? 8 : 4;
-
- memset(&gi,'\0',sizeof(gi));
- memset(&base,'\0',sizeof(base));
- memset(&clut,'\0',sizeof(clut));
- gi.u.image = &base;
- base.clut = &clut;
- base.data = bc->bitmap;
- base.bytes_per_line = bc->bytes_per_line;
- base.width = bc->xmax-bc->xmin+1;
- base.height = bc->ymax-bc->ymin+1;
- base.image_type = it_index;
- clut.clut_len = 1<<scale;
- bg = GDrawGetDefaultBackground(NULL);
- fg = GDrawGetDefaultForeground(NULL);
- for ( l=0; l<(1<<scale); ++l )
- clut.clut[l] =
- COLOR_CREATE(
- COLOR_RED(bg) + (l*(COLOR_RED(fg)-COLOR_RED(bg)))/((1<<scale)-1),
- COLOR_GREEN(bg) + (l*(COLOR_GREEN(fg)-COLOR_GREEN(bg)))/((1<<scale)-1),
- COLOR_BLUE(bg) + (l*(COLOR_BLUE(fg)-COLOR_BLUE(bg)))/((1<<scale)-1) );
-
- x += bc->xmin;
- y -= bc->ymax;
-
- if ( mag==1 )
- GDrawDrawImage(pixmap,&gi,NULL,x,y);
- else
- GDrawDrawImageMagnified(pixmap, &gi, NULL,
- x*mag,y*mag,
- base.width*mag,base.height*mag);
-}
-
-static void PSTKern_Expose(GWindow pixmap, PSTKernDlg *pstkd) {
- GGadget *pstk = GWidgetGetControl(pstkd->gw,CID_PSTList);
- int r;
- int rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *old = _GMatrixEditGet(pstk,&rows);
- SplineChar *sc1, *sc2;
- BDFChar *bc1, *bc2;
- struct vr vr1, vr2;
- int xorig, yorig;
- GRect size;
- int mag = pstkd->mag;
-
- if ( (r = GMatrixEditGetActiveRow(pstk))==-1 )
-return; /* No kerning pair is active */
- if ( old[r*cols+0].u.md_str==NULL || old[r*cols+1].u.md_str==NULL )
-return; /* No glyphs specified to kern */
- sc1 = SFGetChar(pstkd->sf,-1,old[r*cols+0].u.md_str);
- sc2 = SFGetChar(pstkd->sf,-1,old[r*cols+1].u.md_str);
- if ( sc1==NULL || sc2==NULL )
-return; /* The names specified weren't in the font */
-
- if ( !ParsePSTKVR(pstkd,pstk,PAIR_DX1,&vr1) ||
- !ParsePSTKVR(pstkd,pstk,PAIR_DX2,&vr2) )
-return; /* Couldn't parse the numeric kerning info */
-
- if ( pstkd->display==NULL )
- pstkd->display = SplineFontPieceMeal(pstkd->sf,pstkd->pixelsize,pf_antialias,NULL);
- bc1 = BDFPieceMeal(pstkd->display,sc1->orig_pos);
- bc2 = BDFPieceMeal(pstkd->display,sc2->orig_pos);
-
- GDrawGetSize(GDrawableGetWindow(GWidgetGetControl(pstkd->gw,CID_KernDisplay)),&size);
- if ( pstkd->sub->vertical_kerning ) {
- double scale = pstkd->pixelsize/(double) (pstkd->sf->ascent+pstkd->sf->descent);
- int vwidth1 = rint( sc1->vwidth*scale ), vwidth2 = rint( sc2->vwidth*scale );
- xorig = size.width/10;
- yorig = size.height/20;
- xorig /= mag; yorig /= mag;
- PSTKern_DrawGlyph(pixmap,xorig+vr1.xoff,yorig+vwidth1+vr1.yoff, bc1, mag);
- PSTKern_DrawGlyph(pixmap,xorig+vr2.xoff,yorig+vwidth1+vwidth2+vr1.v_adv_off-vr2.yoff, bc2, mag);
- } else if ( pstkd->sub->lookup->lookup_flags&pst_r2l ) {
- xorig = 9*size.width/10;
- yorig = pstkd->sf->ascent*size.height/(pstkd->sf->ascent+pstkd->sf->descent);
- GDrawDrawLine(pixmap,xorig,0,xorig,size.height, 0x808080);
- GDrawDrawLine(pixmap,0,yorig,size.width,yorig, 0x808080);
- xorig /= mag; yorig /= mag;
- PSTKern_DrawGlyph(pixmap,xorig-bc1->width-vr1.h_adv_off-vr1.xoff,yorig+vr1.yoff, bc1, mag);
- PSTKern_DrawGlyph(pixmap,xorig-bc1->width-vr1.h_adv_off-bc2->width-vr2.h_adv_off-vr2.xoff,yorig+vr2.yoff, bc2, mag);
- } else {
- xorig = size.width/10;
- yorig = pstkd->sf->ascent*size.height/(pstkd->sf->ascent+pstkd->sf->descent);
- GDrawDrawLine(pixmap,xorig,0,xorig,size.height, 0x808080);
- GDrawDrawLine(pixmap,0,yorig,size.width,yorig, 0x808080);
- xorig /= mag; yorig /= mag;
- PSTKern_DrawGlyph(pixmap,xorig+vr1.xoff,yorig+vr1.yoff, bc1, mag);
- PSTKern_DrawGlyph(pixmap,xorig+bc1->width+vr1.h_adv_off+vr2.xoff,yorig+vr2.yoff, bc2, mag);
- }
-}
-
-static void PSTKern_Mouse(PSTKernDlg *pstkd,GEvent *event) {
- GGadget *pstk = GWidgetGetControl(pstkd->gw,CID_PSTList);
- int r;
- int rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *old = _GMatrixEditGet(pstk,&rows);
- int c = GMatrixEditGetActiveCol(pstk);
- GGadget *tf = _GMatrixEditGetActiveTextField(pstk);
- double scale = pstkd->pixelsize/(double) (pstkd->sf->ascent+pstkd->sf->descent);
- int diff, col;
- char buffer[20];
-
- if ( (r = GMatrixEditGetActiveRow(pstk))==-1 )
-return; /* No kerning pair is active */
-
- if ( pstkd->sub->vertical_kerning ) {
- diff = event->u.mouse.y - pstkd->orig_pos;
- col = PAIR_DY_ADV1;
- } else if ( pstkd->sub->lookup->lookup_flags&pst_r2l ) {
- diff = pstkd->orig_pos - event->u.mouse.y;
- col = PAIR_DX_ADV2;
- } else {
- diff = event->u.mouse.x - pstkd->orig_pos;
- col = PAIR_DX_ADV1;
- }
-
- if ( event->type == et_mousedown ) {
- pstkd->down = true;
- pstkd->orig_pos = pstkd->sub->vertical_kerning ? event->u.mouse.y : event->u.mouse.x;
- pstkd->orig_value = FigureValue(old,r*cols,c,col,tf,1.0,-1);
- } else if ( pstkd->down ) {
- diff = rint(diff/scale);
- if ( col==c && tf!=NULL ) {
- sprintf( buffer, "%d", pstkd->orig_value + diff);
- GGadgetSetTitle8(tf,buffer);
- GGadgetRedraw(tf);
- } else {
- old[r*cols+col].u.md_ival = pstkd->orig_value + diff;
- GGadgetRedraw(pstk);
- }
- GGadgetRedraw(GWidgetGetControl(pstkd->gw,CID_KernDisplay));
- if ( event->type == et_mouseup )
- pstkd->down = false;
- }
-}
-
-static int pstkern_e_h(GWindow gw, GEvent *event) {
- switch ( event->type ) {
- case et_char:
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("lookups.html#Pair");
-return( true );
- }
-return( false );
- case et_expose:
- PSTKern_Expose(gw,GDrawGetUserData(gw));
-return( true );
- case et_mousedown: case et_mouseup: case et_mousemove:
- PSTKern_Mouse(GDrawGetUserData(gw),event);
-return( true );
- }
-return( true );
-}
-
-static int SCReasonable(SplineChar *sc) {
- if ( sc==NULL )
-return( false );
- if ( strcmp(sc->name,".notdef")==0 ||
- strcmp(sc->name,".null")==0 ||
- strcmp(sc->name,"nonmarkingreturn")==0 )
-return( false );
-
-return( true );
-}
-
-static struct matrix_data *MDCopy(struct matrix_data *old,int rows,int cols) {
- struct matrix_data *md = galloc(rows*cols*sizeof(struct matrix_data));
- int r;
-
- memcpy(md,old,rows*cols*sizeof(struct matrix_data));
- for ( r=0; r<rows; ++r ) {
- md[r*cols+0].u.md_str = copy(md[r*cols+0].u.md_str);
- if ( cols==2 /* subs, lig, alt, etc. */ || cols==10 /* kerning */ )
- md[r*cols+1].u.md_str = copy(md[r*cols+1].u.md_str);
- }
-return( md );
-}
-
-static int SCNameUnused(char *name,struct matrix_data *old,int rows,int cols) {
- int r;
-
- for ( r=0; r<rows; ++r ) {
- if ( old[r*cols+0].u.md_str!=NULL && strcmp(old[r*cols+0].u.md_str,name)==0 ) {
- if (( cols==2 && (old[r*cols+1].u.md_str == NULL || *old[r*cols+1].u.md_str=='\0')) ||
- (cols==5 && old[r*cols+1].u.md_ival==0 &&
- old[r*cols+2].u.md_ival==0 &&
- old[r*cols+3].u.md_ival==0 &&
- old[r*cols+4].u.md_ival==0 ))
-return( r ); /* There's an entry, but it's blank, fill it if we can */
- else
-return( -1 );
- }
- }
-return( r ); /* Off end of list */
-}
-
-static int SCIsLigature(SplineChar *sc) {
- int len;
- const unichar_t *alt=NULL;
-
- if ( strchr(sc->name,'_')!=NULL )
-return( true );
- len = strlen( sc->name );
- if ( strncmp(sc->name,"uni",3)==0 && (len-3)%4==0 && len>7 )
-return( true );
-
- if ( sc->unicodeenc==-1 || sc->unicodeenc>=0x10000 )
-return( false );
- else if ( isdecompositionnormative(sc->unicodeenc) &&
- unicode_alternates[sc->unicodeenc>>8]!=NULL &&
- (alt = unicode_alternates[sc->unicodeenc>>8][sc->unicodeenc&0xff])!=NULL ) {
- if ( alt[1]=='\0' )
-return( false ); /* Single replacements aren't ligatures */
- else if ( iscombining(alt[1]) && ( alt[2]=='\0' || iscombining(alt[2])))
-return( false ); /* Nor am I interested in accented letters */
- else
-return( true );
- } else
-return( false );
-}
-
-static void PSTKD_DoPopulate(PSTKernDlg *pstkd,char *suffix) {
- GGadget *pstk = GWidgetGetControl(pstkd->gw,CID_PSTList);
- int rows, row_max, old_rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *old = GMatrixEditGet(pstk,&rows), *psts;
- int pos;
- int gid,k;
- SplineChar *sc, *alt;
- SplineFont *sf;
-
- psts = MDCopy(old,rows,cols);
- old_rows = row_max = rows;
- k = 0;
- do {
- sf = pstkd->sf->subfontcnt==0 ? pstkd->sf : pstkd->sf->subfonts[k];
- for ( gid=0; gid<sf->glyphcnt; ++gid ) {
- if ( SCReasonable(sc = sf->glyphs[gid]) &&
- ScriptInFeatureScriptList(SCScriptFromUnicode(sc),
- pstkd->sub->lookup->features) &&
- (pos = SCNameUnused(sc->name,old,old_rows,cols))!=-1 &&
- (pstkd->sub->lookup->lookup_type!=gsub_ligature ||
- SCIsLigature(sc)) ) {
- alt = NULL;
- if ( suffix!=NULL ) {
- alt = SuffixCheck(sc,suffix);
- if ( alt==NULL )
- continue;
- }
- if ( pos==old_rows ) {
- pos = rows;
- if ( rows>=row_max ) {
- if ( row_max< sf->glyphcnt-10 )
- row_max = sf->glyphcnt;
- else
- row_max += 15;
- psts = grealloc(psts,row_max*cols*sizeof(struct matrix_data));
- }
- memset(psts+rows*cols,0,cols*sizeof(struct matrix_data));
- psts[rows*cols+0].u.md_str = copy(sc->name);
- ++rows;
- }
- if ( alt!=NULL )
- psts[pos*cols+1].u.md_str = copy(alt->name);
- else if ( pstkd->sub->lookup->lookup_type!=gpos_pair )
- SCSubtableDefaultSubsCheck(sc,pstkd->sub,psts,cols,pos);
- }
- }
- ++k;
- } while ( k<pstkd->sf->subfontcnt );
- if ( rows<row_max )
- psts = grealloc(psts,rows*cols*sizeof(struct matrix_data));
- PSTKD_DoSort(pstkd,psts,rows,cols);
- GMatrixEditSet(pstk,psts,rows,false);
- GGadgetRedraw(pstk);
-}
-
-static void PSTKD_SetSuffix(PSTKernDlg *pstkd) {
- char *suffix;
-
- if ( pstkd->sub->lookup->lookup_type!=gsub_single )
-return; /* Not applicable */
-
- suffix = GGadgetGetTitle8(GWidgetGetControl(pstkd->gw,CID_Suffix));
- if ( *suffix!='\0' && ( suffix[0]!='.' || suffix[1]!='\0' )) {
- free(pstkd->sub->suffix);
- pstkd->sub->suffix = ( *suffix=='.' ) ? copy(suffix+1): copy(suffix);
- free(suffix);
- }
-}
-
-static int PSTKD_PopulateWithSuffix(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- char *suffix = GGadgetGetTitle8(GWidgetGetControl(pstkd->gw,CID_Suffix));
- if ( *suffix!='\0' && ( suffix[0]!='.' || suffix[1]!='\0' )) {
- PSTKD_DoPopulate(pstkd,suffix);
- PSTKD_SetSuffix(pstkd);
- }
- free(suffix);
- }
-return( true );
-}
-
-static int PSTKD_Populate(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- PSTKD_SetSuffix(pstkd);
- PSTKD_DoPopulate(pstkd,NULL);
- }
-return( true );
-}
-
-static int PSTKD_RemoveEmpty(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- PSTKernDlg *pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- GGadget *pstk = GWidgetGetControl(pstkd->gw,CID_PSTList);
- int rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *old = GMatrixEditGet(pstk,&rows), *psts=NULL;
- int r, empty, rm_cnt, j;
-
- for ( r=rows-1, rm_cnt=0; r>=0; --r ) {
- if ( pstkd->sub->lookup->lookup_type==gpos_single )
- empty = old[r*cols+SIM_DX].u.md_ival==0 &&
- old[r*cols+SIM_DY].u.md_ival==0 &&
- old[r*cols+SIM_DX_ADV].u.md_ival==0 &&
- old[r*cols+SIM_DY_ADV].u.md_ival==0;
- else
- empty = old[r*cols+1].u.md_str == NULL || *old[r*cols+1].u.md_str=='\0';
- if ( empty ) {
- if ( psts==NULL )
- psts = MDCopy(old,rows,cols);
- free(psts[r*cols+0].u.md_str);
- if ( cols!=5 )
- free(psts[r*cols+1].u.md_str);
- for ( j=r+1; j<rows-rm_cnt; ++j )
- memcpy(psts+(j-1)*cols,psts+j*cols,
- cols*sizeof(struct matrix_data));
- ++rm_cnt;
- }
- }
- if ( rm_cnt!=0 ) {
- psts = grealloc(psts,(rows-rm_cnt)*cols*sizeof(struct matrix_data));
- GMatrixEditSet(pstk,psts,rows-rm_cnt,false);
- }
- }
-return( true );
-}
-
-static int PSTKD_Ok(GGadget *g, GEvent *e) {
- PSTKernDlg *pstkd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- GGadget *pstk = GWidgetGetControl(pstkd->gw,CID_PSTList);
- int rows, cols = GMatrixEditGetColCnt(pstk);
- struct matrix_data *psts = GMatrixEditGet(pstk,&rows);
- int r, r1, k, gid, isv, ch;
- char *pt, *start;
- int lookup_type = pstkd->sub->lookup->lookup_type;
- SplineFont *sf = NULL;
- SplineChar *sc, *found;
- char *buts[3];
- KernPair *kp, *kpprev, *kpnext;
- PST *pst, *pstprev, *pstnext;
- int _t = lookup_type == gpos_single ? pst_position
- : lookup_type == gpos_pair ? pst_pair
- : lookup_type == gsub_single ? pst_substitution
- : lookup_type == gsub_alternate ? pst_alternate
- : lookup_type == gsub_multiple ? pst_multiple
- : pst_ligature;
-
- /* First check for errors */
- /* Glyph names that aren't in the font */
- for ( r=0; r<rows; ++r ) {
- if ( SFGetChar(pstkd->sf,-1,psts[r*cols+0].u.md_str)==NULL ) {
- gwwv_post_error( _("Missing glyph"),_("There is no glyph named %s in the font"),
- psts[cols*r+0].u.md_str );
-return( true );
- }
- }
- /* Empty entries */
- if ( cols==2 || cols==10 ) {
- for ( r=0; r<rows; ++r ) {
- start = psts[cols*r+1].u.md_str;
- if ( start==NULL ) start="";
- while ( *start== ' ' ) ++start;
- if ( *start=='\0' ) {
- gwwv_post_error( _("Missing glyph name"),_("You must specify a replacement glyph for %s"),
- psts[cols*r+0].u.md_str );
-return( true );
- }
- /* Replacements which aren't in the font */
- while ( *start ) {
- for ( pt=start; *pt!='\0' && *pt!=' '; ++pt );
- ch = *pt; *pt='\0';
- found = SFGetChar(pstkd->sf,-1,start);
- if ( found==NULL ) {
- buts[0] = _("_Yes");
- buts[1] = _("_Cancel");
- buts[2] = NULL;
- if ( gwwv_ask(_("Missing glyph"),(const char **) buts,0,1,_("For glyph %.60s you refer to a glyph named %.80s, which is not in the font yet. Was this intentional?"),
- psts[cols*r+0].u.md_str, start)==1 ) {
- *pt = ch;
-return( true );
- }
- }
- *pt = ch;
- while ( *pt== ' ' ) ++pt;
- start = pt;
- }
- }
- }
- /* Duplicate entries */
- for ( r=0; r<rows; ++r ) {
- for ( r1=r+1; r1<rows; ++r1 ) {
- if ( strcmp(psts[r*cols+0].u.md_str,psts[r1*cols+0].u.md_str)==0 ) {
- if ( lookup_type==gpos_pair || lookup_type==gsub_ligature ) {
- if ( strcmp(psts[r*cols+1].u.md_str,psts[r1*cols+1].u.md_str)==0 ) {
- gwwv_post_error( _("Duplicate data"),_("There are two entries for the same glyph set (%.80s and %.80s)"),
- psts[cols*r+0].u.md_str, psts[cols*r+1].u.md_str );
-return( true );
- }
- } else {
- gwwv_post_error( _("Duplicate data"),_("There are two entries for the same glyph (%.80s)"),
- psts[cols*r+0].u.md_str );
-return( true );
- }
- }
- }
- }
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- /* Check for badly specified device tables */
- if ( _t==pst_position || _t==pst_pair ) {
- int startc = _t==pst_position ? SIM_DX+1 : PAIR_DX1+1;
- int low, high, c;
- for ( r=0; r<rows; ++r ) {
- for ( c=startc; c<cols; c+=2 ) {
- if ( !DeviceTableOK(psts[r*cols+c].u.md_str,&low,&high) ) {
- gwwv_post_error( _("Bad Device Table Adjustment"),_("A device table adjustment specified for %.80s is invalid"),
- psts[cols*r+0].u.md_str );
-return( true );
- }
- }
- }
- }
-#endif
-
- /* Ok, if we get here then there should be no errors and we can parse */
- /* First mark all the current things as unused */
- k=0;
- do {
- sf = pstkd->sf->subfontcnt==0 ? pstkd->sf : pstkd->sf->subfonts[k];
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc = sf->glyphs[gid])!=NULL ) {
- for ( pst = sc->possub; pst!=NULL; pst=pst->next )
- pst->ticked = false;
- for ( isv=0; isv<2; ++isv )
- for ( kp = isv ? sc->vkerns : sc->kerns; kp!=NULL; kp=kp->next )
- kp->kcid = 0;
- }
- ++k;
- } while ( k<pstkd->sf->subfontcnt );
-
- if ( lookup_type!=gpos_pair ) {
- for ( r=0; r<rows; ++r ) {
- sc = SFGetChar(pstkd->sf,-1,psts[cols*r+0].u.md_str);
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable == pstkd->sub && !pst->ticked )
- break;
- }
- if ( pst==NULL ) {
- pst = chunkalloc(sizeof(PST));
- pst->type = _t;
- pst->subtable = pstkd->sub;
- pst->next = sc->possub;
- sc->possub = pst;
- } else if ( lookup_type!=gpos_single )
- free( pst->u.subs.variant );
- pst->ticked = true;
- if ( lookup_type==gpos_single ) {
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- VRDevTabParse(&pst->u.pos,&psts[cols*r+SIM_DX+1]);
-#endif
- pst->u.pos.xoff = psts[cols*r+SIM_DX].u.md_ival;
- pst->u.pos.yoff = psts[cols*r+SIM_DY].u.md_ival;
- pst->u.pos.h_adv_off = psts[cols*r+SIM_DX_ADV].u.md_ival;
- pst->u.pos.v_adv_off = psts[cols*r+SIM_DY_ADV].u.md_ival;
- } else {
- pst->u.subs.variant = copy( psts[cols*r+1].u.md_str );
- if ( lookup_type==gsub_ligature )
- pst->u.lig.lig = sc;
- }
- }
- } else if ( lookup_type==gpos_pair ) {
- for ( r=0; r<rows; ++r ) {
- sc = SFGetChar(pstkd->sf,-1,psts[cols*r+0].u.md_str);
- KpMDParse(pstkd->sf,sc,pstkd->sub,psts,rows,cols,r);
- }
- }
-
- /* Now free anything with this subtable which did not get ticked */
- k=0;
- do {
- sf = pstkd->sf->subfontcnt==0 ? pstkd->sf : pstkd->sf->subfonts[k];
- for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc = sf->glyphs[gid])!=NULL ) {
- for ( pstprev=NULL, pst = sc->possub; pst!=NULL; pst=pstnext ) {
- pstnext = pst->next;
- if ( pst->ticked || pst->subtable!=pstkd->sub )
- pstprev = pst;
- else {
- if ( pstprev==NULL )
- sc->possub = pstnext;
- else
- pstprev->next = pstnext;
- pst->next = NULL;
- PSTFree(pst);
- }
- }
- for ( isv=0; isv<2; ++isv ) {
- for ( kpprev=NULL, kp = isv ? sc->vkerns : sc->kerns; kp!=NULL; kp=kpnext ) {
- kpnext = kp->next;
- if ( kp->kcid!=0 || kp->subtable!=pstkd->sub )
- kpprev = kp;
- else {
- if ( kpprev!=NULL )
- kpprev->next = kpnext;
- else if ( isv )
- sc->vkerns = kpnext;
- else
- sc->kerns = kpnext;
- kp->next = NULL;
- KernPairsFree(kp);
- }
- }
- }
- }
- ++k;
- } while ( k<pstkd->sf->subfontcnt );
- PSTKD_SetSuffix(pstkd);
- pstkd->done = true;
- }
-return( true );
-}
-
-static void PSTKD_DoCancel(PSTKernDlg *pstkd) {
- pstkd->done = true;
-}
-
-static int PSTKD_Cancel(GGadget *g, GEvent *e) {
- PSTKernDlg *pstkd;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- pstkd = GDrawGetUserData(GGadgetGetWindow(g));
- PSTKD_DoCancel(pstkd);
- }
-return( true );
-}
-
-static int pstkd_e_h(GWindow gw, GEvent *event) {
- PSTKernDlg *pstkd = GDrawGetUserData(gw);
-
- switch ( event->type ) {
- case et_close:
- PSTKD_DoCancel(pstkd);
- break;
- case et_char:
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- int lookup_type = pstkd->sub->lookup->lookup_type;
- if ( lookup_type==gpos_single )
- help("lookups.html#Single-pos");
- else if ( lookup_type==gpos_pair )
- help("lookups.html#Pair");
- else
- help("lookups.html#basic-subs");
-return( true );
- }
-return( false );
- break;
- case et_destroy:
- break;
- case et_mouseup: case et_mousemove: case et_mousedown:
- break;
- case et_expose:
- break;
- case et_resize:
- break;
- }
-return( true );
-}
-
-
-static void PSTKernD(SplineFont *sf, struct lookup_subtable *sub) {
- PSTKernDlg pstkd;
- GRect pos;
- GWindowAttrs wattrs;
- char title[300];
- struct matrixinit mi;
- GGadgetCreateData gcd[15], buttongcd[3], box[5];
- GGadgetCreateData *h1array[8], *h2array[7], *h3array[7], *varray[16];
- GTextInfo label[15], buttonlabel[2];
- int i,k,mi_pos, mi_k;
-
- memset(&pstkd,0,sizeof(pstkd));
- pstkd.sf = sf;
- pstkd.sub = sub;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_isdlg|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = true;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- snprintf(title,sizeof(title), _("Lookup Subtable, %s"), sub->subtable_name );
- wattrs.utf8_window_title = title;
- wattrs.is_dlg = true;
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,300));
- pos.height = GDrawPointsToPixels(NULL,400);
- pstkd.gw = GDrawCreateTopWindow(NULL,&pos,pstkd_e_h,&pstkd,&wattrs);
-
- memset(&gcd,0,sizeof(gcd));
- memset(&buttongcd,0,sizeof(buttongcd));
- memset(&box,0,sizeof(box));
- memset(&label,0,sizeof(label));
- memset(&buttonlabel,0,sizeof(buttonlabel));
-
- i = k = 0;
- label[i].text = (unichar_t *) _("_Alphabetic");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = 5+4;
- gcd[i].gd.flags = isalphabetic ? (gg_enabled|gg_visible|gg_cb_on|gg_utf8_popup) : (gg_enabled|gg_visible|gg_utf8_popup);
- gcd[i].gd.popup_msg = (unichar_t *) _("Sort this display based on the alphabetic name of the glyph");
- gcd[i].gd.handle_controlevent = PSTKD_Sort;
- gcd[i].gd.cid = CID_Alpha;
- gcd[i].creator = GRadioCreate;
- h1array[0] = &gcd[i++];
-
- label[i].text = (unichar_t *) _("_Unicode");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = 5+4;
- gcd[i].gd.flags = !isalphabetic ? (gg_enabled|gg_visible|gg_cb_on|gg_utf8_popup) : (gg_enabled|gg_visible|gg_utf8_popup);
- gcd[i].gd.popup_msg = (unichar_t *) _("Sort this display based on the unicode code of the glyph");
- gcd[i].gd.handle_controlevent = PSTKD_Sort;
- gcd[i].gd.cid = CID_Unicode;
- gcd[i].creator = GRadioCreate;
- h1array[1] = &gcd[i++]; h1array[2] = GCD_HPad10;
-
- label[i].text = (unichar_t *) _("_By Base Char");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = 5+4;
- gcd[i].gd.flags = stemming ? (gg_enabled|gg_visible|gg_cb_on|gg_utf8_popup) : (gg_enabled|gg_visible|gg_utf8_popup);
- gcd[i].gd.popup_msg = (unichar_t *) _("Sort first using the base glyph (if any).\nThus Agrave would sort with A");
- gcd[i].gd.handle_controlevent = PSTKD_Sort;
- gcd[i].gd.cid = CID_BaseChar;
- gcd[i].creator = GCheckBoxCreate;
- h1array[3] = &gcd[i++]; h1array[4] = GCD_HPad10;
-
- label[i].text = (unichar_t *) _("By _Scripts");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = 5+4;
- gcd[i].gd.flags = byscripts ? (gg_enabled|gg_visible|gg_cb_on|gg_utf8_popup) : (gg_enabled|gg_visible|gg_utf8_popup);
- gcd[i].gd.popup_msg = (unichar_t *) _("Sort first using the glyph's script.\nThus A and Z would sort together\nwhile Alpha would sort with Omega and not A");
- if ( sub->lookup->features==NULL ||
- (sub->lookup->features->next==NULL &&
- (sub->lookup->features->scripts==NULL ||
- sub->lookup->features->scripts->next==NULL)))
- gcd[i].gd.flags = gg_visible|gg_cb_on; /* If there is only one script, we can't really sort by it */
- gcd[i].gd.handle_controlevent = PSTKD_Sort;
- gcd[i].gd.cid = CID_Scripts;
- gcd[i].creator = GCheckBoxCreate;
- h1array[5] = &gcd[i++]; h1array[6] = GCD_Glue; h1array[7] = NULL;
-
- box[0].gd.flags = gg_enabled|gg_visible;
- box[0].gd.u.boxelements = h1array;
- box[0].creator = GHBoxCreate;
- varray[k++] = &box[0]; varray[k++] = NULL;
-
- if ( sub->lookup->lookup_type == gpos_pair || sub->lookup->lookup_type == gpos_single ) {
- label[i].text = (unichar_t *) _("_Hide Unused Columns");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = 5+4;
- gcd[i].gd.flags = lookup_hideunused ? (gg_enabled|gg_visible|gg_cb_on|gg_utf8_popup) : (gg_enabled|gg_visible|gg_utf8_popup);
- gcd[i].gd.popup_msg = (unichar_t *) _("Don't display columns of 0s.\nThe OpenType lookup allows for up to 8 kinds\nof data, but almost all lookups will use just one or two.\nOmitting the others makes the behavior clearer.");
- gcd[i].gd.handle_controlevent = PSTKD_HideUnused;
- gcd[i].creator = GCheckBoxCreate;
- varray[k++] = &gcd[i++]; varray[k++] = NULL;
- }
-
- PSTMatrixInit(&mi,sf,sub,&pstkd);
- mi_pos = i;
- gcd[i].gd.pos.height = 200;
- gcd[i].gd.flags = gg_enabled | gg_visible | gg_utf8_popup;
- gcd[i].gd.cid = CID_PSTList;
- gcd[i].gd.u.matrix = &mi;
- gcd[i].data = &pstkd;
- gcd[i].creator = GMatrixEditCreate;
- mi_k = k;
- varray[k++] = &gcd[i++]; varray[k++] = NULL;
-
- buttonlabel[0].text = (unichar_t *) _("_Populate");
- buttonlabel[0].text_is_1byte = true;
- buttonlabel[0].text_in_resource = true;
- buttongcd[0].gd.label = &buttonlabel[0];
- buttongcd[0].gd.pos.x = 5; buttongcd[0].gd.pos.y = 5+4;
- buttongcd[0].gd.flags = sub->lookup->features==NULL ? gg_visible|gg_utf8_popup :
- gg_enabled|gg_visible|gg_utf8_popup;
- buttongcd[0].gd.popup_msg = (unichar_t *) _("Add entries for all glyphs in the scripts to which this lookup applies.\nWhen FontForge can find a default value it will add that too.");
- buttongcd[0].gd.handle_controlevent = PSTKD_Populate;
- buttongcd[0].creator = GButtonCreate;
-
- buttonlabel[1].text = (unichar_t *) _("_Remove Empty");
- buttonlabel[1].text_is_1byte = true;
- buttonlabel[1].text_in_resource = true;
- buttongcd[1].gd.label = &buttonlabel[1];
- buttongcd[1].gd.pos.x = 5; buttongcd[1].gd.pos.y = 5+4;
- buttongcd[1].gd.flags = sub->lookup->features==NULL ? gg_visible|gg_utf8_popup :
- gg_enabled|gg_visible|gg_utf8_popup;
- buttongcd[1].gd.popup_msg = (unichar_t *)
- (sub->lookup->lookup_type == gpos_single ? _("Remove all \"empty\" entries -- those where all fields are 0") :
- sub->lookup->lookup_type == gpos_pair ? _("Remove all \"empty\" entries -- entries with no second glyph") :
- sub->lookup->lookup_type == gsub_ligature ? _("Remove all \"empty\" entries -- those with no source glyphs") :
- _("Remove all \"empty\" entries -- those with no replacement glyphs"));
- buttongcd[1].gd.handle_controlevent = PSTKD_RemoveEmpty;
- buttongcd[1].creator = GButtonCreate;
-
- if ( sub->lookup->lookup_type == gsub_single ) {
- label[i].text = (unichar_t *) _("_Default Using Suffix:");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = 5+4;
- gcd[i].gd.flags = gg_enabled|gg_visible|gg_utf8_popup;
- gcd[i].gd.popup_msg = (unichar_t *) _(
- "Add entries to the lookup based on the following suffix.\n"
- "So if the suffix is set to \"superior\" and the font\n"
- "contains glyphs named \"A\" and \"A.superior\" (and the\n"
- "lookup applies to the latin script), then FontForge will\n"
- "add an entry mapping \"A\" -> \"A.superior\"." );
- gcd[i].gd.handle_controlevent = PSTKD_PopulateWithSuffix;
- gcd[i].creator = GButtonCreate;
- h2array[0] = &gcd[i++];
-
- label[i].text = (unichar_t *) sub->suffix;
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = sub->suffix==NULL ? NULL : &label[i];
- gcd[i].gd.flags = gg_enabled|gg_visible|gg_utf8_popup;
- gcd[i].gd.popup_msg = (unichar_t *) _(
- "Add entries to the lookup based on this suffix.\n"
- "So if this is set to \"superior\" and the font\n"
- "contains glyphs named \"A\" and \"A.superior\" (and the\n"
- "lookup applies to the latin script), then FontForge will\n"
- "add an entry mapping \"A\" -> \"A.superior\"." );
- gcd[i].gd.cid = CID_Suffix;
- gcd[i].creator = GTextFieldCreate;
- h2array[1] = &gcd[i++]; h2array[2] = GCD_Glue; h2array[3] = NULL;
-
- box[1].gd.flags = gg_enabled|gg_visible;
- box[1].gd.u.boxelements = h2array;
- box[1].creator = GHBoxCreate;
- varray[k++] = &box[1]; varray[k++] = NULL;
- } else if ( sub->lookup->lookup_type == gpos_pair ) {
- label[i].text = (unichar_t *) _("Size:");
- label[i].text_is_1byte = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 30; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+30;
- gcd[i].gd.flags = gg_visible|gg_enabled ;
- gcd[i++].creator = GLabelCreate;
- h2array[0] = &gcd[i-1];
-
- pstkd.pixelsize = 150;
- label[i].text = (unichar_t *) "150";
- label[i].text_is_1byte = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 92; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y-4;
- gcd[i].gd.pos.width = 80;
- gcd[i].gd.flags = gg_visible|gg_enabled ;
- gcd[i].gd.cid = CID_PixelSize;
- gcd[i].gd.handle_controlevent = PSTKD_DisplaySizeChanged;
- gcd[i++].creator = GTextFieldCreate;
- h2array[1] = &gcd[i-1]; h2array[2] = GCD_HPad10;
-
-/* GT: Short for "Magnification" */
- label[i].text = (unichar_t *) _("Mag:");
- label[i].text_is_1byte = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 185; gcd[i].gd.pos.y = gcd[i-2].gd.pos.y;
- gcd[i].gd.flags = gg_visible|gg_enabled ;
- gcd[i++].creator = GLabelCreate;
- h2array[3] = &gcd[i-1];
-
- pstkd.mag = 1;
- gcd[i].gd.flags = gg_visible|gg_enabled ;
- gcd[i].gd.cid = CID_Magnification;
- gcd[i].gd.u.list = magnifications;
- gcd[i].gd.handle_controlevent = PSTKD_MagnificationChanged;
- gcd[i++].creator = GListButtonCreate;
- h2array[4] = &gcd[i-1]; h2array[5] = GCD_Glue; h2array[6] = NULL;
-
- box[1].gd.flags = gg_enabled|gg_visible;
- box[1].gd.u.boxelements = h2array;
- box[1].creator = GHBoxCreate;
- varray[k++] = &box[1]; varray[k++] = NULL;
-
- gcd[i].gd.pos.width = 200;
- gcd[i].gd.pos.height = 200;
- gcd[i].gd.flags = gg_visible | gg_enabled;
- gcd[i].gd.u.drawable_e_h = pstkern_e_h;
- gcd[i].gd.cid = CID_KernDisplay;
- gcd[i].creator = GDrawableCreate;
- varray[k++] = &gcd[i++]; varray[k++] = NULL;
- }
-
- gcd[i].gd.pos.x = 10; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+24+3;
- gcd[i].gd.pos.width = -1;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_OK");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.handle_controlevent = PSTKD_Ok;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = -10; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
- gcd[i].gd.pos.width = -1;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.handle_controlevent = PSTKD_Cancel;
- gcd[i].gd.cid = CID_Cancel;
- gcd[i++].creator = GButtonCreate;
-
- h3array[0] = GCD_Glue; h3array[1] = &gcd[i-2]; h3array[2] = GCD_Glue;
- h3array[3] = GCD_Glue; h3array[4] = &gcd[i-1]; h3array[5] = GCD_Glue;
- h3array[6] = NULL;
-
- box[2].gd.flags = gg_enabled|gg_visible;
- box[2].gd.u.boxelements = h3array;
- box[2].creator = GHBoxCreate;
- varray[k++] = &box[2]; varray[k++] = NULL; varray[k++] = NULL;
-
- box[3].gd.pos.x = box[3].gd.pos.y = 2;
- box[3].gd.flags = gg_enabled|gg_visible;
- box[3].gd.u.boxelements = varray;
- box[3].creator = GHVGroupCreate;
-
- GGadgetsCreate(pstkd.gw,box+3);
- GHVBoxSetExpandableRow(box[3].ret,mi_k/2);
- GHVBoxSetExpandableCol(box[2].ret,gb_expandgluesame);
- if ( sub->lookup->lookup_type == gsub_single || sub->lookup->lookup_type==gpos_pair )
- GHVBoxSetExpandableCol(box[1].ret,gb_expandglue);
- GHVBoxSetExpandableCol(box[0].ret,gb_expandglue);
- GMatrixEditAddButtons(gcd[mi_pos].ret,buttongcd);
- if ( sub->lookup->lookup_type == gpos_pair )
- GMatrixEditSetTextChangeReporter(gcd[mi_pos].ret,PSTKD_METextChanged);
- if ( sub->lookup->lookup_type == gpos_pair || sub->lookup->lookup_type == gpos_single )
- PSTKD_DoHideUnused(&pstkd);
- /* GHVBoxFitWindow(boxes[3].ret); */ /* Done in DoHide */
-
- GDrawSetVisible(pstkd.gw,true);
-
- while ( !pstkd.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(pstkd.gw);
- if ( pstkd.display!=NULL ) {
- BDFFontFree(pstkd.display);
- pstkd.display = NULL;
- }
-}
-
-
-/* ************************************************************************** */
-/* *************************** Subtable Selection *************************** */
-/* ************************************************************************** */
-
-static int SubtableNameInUse(char *subname, SplineFont *sf, struct lookup_subtable *exclude) {
- int isgpos, i, j;
- OTLookup *otl;
- struct lookup_subtable *sub;
-
- if ( sf->fontinfo!=NULL ) {
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- struct lkdata *lk = &sf->fontinfo->tables[isgpos];
- for ( i=0; i<lk->cnt; ++i ) {
- if ( lk->all[i].deleted )
- continue;
- for ( j=0; j<lk->all[i].subtable_cnt; ++j ) {
- if ( lk->all[i].subtables[j].deleted || lk->all[i].subtables[j].subtable==exclude )
- continue;
- if ( strcmp(lk->all[i].subtables[j].subtable->subtable_name,subname)==0 )
-return( true );
- }
- }
- }
- } else {
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub==exclude )
- continue;
- if ( strcmp(sub->subtable_name,subname)==0 )
-return( true );
- }
- }
- }
- }
-return( false );
-}
-
-int EditSubtable(struct lookup_subtable *sub,int isgpos,SplineFont *sf,
- struct subtable_data *sd) {
- char *def = sub->subtable_name;
- int new = def==NULL;
- char *freeme = NULL;
- int name_search;
-
- if ( new ) {
- def = freeme = galloc(strlen(sub->lookup->lookup_name)+10);
- name_search = 1;
- do {
- sprintf( def, "%s-%d", sub->lookup->lookup_name, name_search++ );
- } while ( SubtableNameInUse(def,sf,sub));
- }
- forever {
- def = gwwv_ask_string(_("Please name this subtable"),def,_("Please name this subtable"));
- free(freeme);
- if ( def==NULL )
-return( false );
- freeme = def;
- if ( SubtableNameInUse(def,sf,sub) )
- gwwv_post_notice(_("Duplicate name"),_("There is already a subtable with that name, please pick another."));
- else
- break;
- }
- free(sub->subtable_name);
- sub->subtable_name = def;
- if ( new && sub->lookup->lookup_type == gsub_single )
- sub->suffix = SuffixFromTags(sub->lookup->features);
- if ( new && (sd==NULL || !(sd->flags&sdf_dontedit)) )
- _LookupSubtableContents(sf, sub, sd);
-return( true );
-}
-
-static struct lookup_subtable *NewSubtable(OTLookup *otl,int isgpos,SplineFont *sf, struct subtable_data *sd) {
- struct lookup_subtable *sub, *last;
- int i,j;
-
- sub = chunkalloc(sizeof(struct lookup_subtable));
- sub->lookup = otl;
- if ( !EditSubtable(sub,isgpos,sf,sd)) {
- chunkfree(sub,sizeof(struct lookup_subtable));
-return( NULL );
- }
- if ( otl->subtables==NULL )
- otl->subtables = sub;
- else {
- for ( last=otl->subtables; last->next!=NULL; last=last->next );
- last->next = sub;
- }
- if ( sf->fontinfo!=NULL ) {
- struct lkdata *lk = &sf->fontinfo->tables[isgpos];
- for ( i=0; i<lk->cnt && lk->all[i].lookup!=otl; ++i );
- if ( i==lk->cnt ) {
- IError( "Lookup missing from FontInfo lookup list");
- } else {
- if ( lk->all[i].subtable_cnt>=lk->all[i].subtable_max )
- lk->all[i].subtables = grealloc(lk->all[i].subtables,(lk->all[i].subtable_max+=10)*sizeof(struct lksubinfo));
- j = lk->all[i].subtable_cnt++;
- memset(&lk->all[i].subtables[j],0,sizeof(struct lksubinfo));
- lk->all[i].subtables[j].subtable = sub;
- GFI_LookupScrollbars(sf->fontinfo,isgpos, true);
- GFI_LookupEnableButtons(sf->fontinfo,isgpos);
- }
- }
-return( sub );
-}
-
-GTextInfo **SFSubtablesOfType(SplineFont *sf, int lookup_type, int kernclass) {
- int isgpos = (lookup_type>=gpos_start);
- int k, cnt, lcnt, pos;
- OTLookup *otl;
- struct lookup_subtable *sub;
- GTextInfo **ti;
-
- if ( sf->cidmaster != NULL ) sf=sf->cidmaster;
- else if ( sf->mm != NULL ) sf = sf->mm->normal;
-
- for ( k=0; k<2; ++k ) {
- cnt = lcnt = pos = 0;
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
- if ( otl->lookup_type==lookup_type && otl->subtables!=NULL ) {
- if ( k ) {
- ti[pos] = gcalloc(1,sizeof(GTextInfo));
- ti[pos]->text = galloc((utf82u_strlen(otl->lookup_name)+2)*sizeof(unichar_t));
- ti[pos]->text[0] = ' ';
- utf82u_strcpy(ti[pos]->text+1,otl->lookup_name);
- ti[pos]->fg = ti[pos]->bg = COLOR_DEFAULT;
- ti[pos++]->disabled = true;
- }
- ++lcnt;
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- if ( lookup_type!=gpos_pair || kernclass==-1 ||
- (kernclass && sub->kc!=NULL) ||
- (!kernclass && sub->per_glyph_pst_or_kern)) {
- if ( k ) {
- ti[pos] = gcalloc(1,sizeof(GTextInfo));
- ti[pos]->text = utf82u_copy(sub->subtable_name);
- ti[pos]->fg = ti[pos]->bg = COLOR_DEFAULT;
- ti[pos++]->userdata = sub;
- }
- ++cnt;
- }
- }
- }
- }
- if ( !k ) {
- ti = gcalloc(cnt+lcnt+3,sizeof(GTextInfo*));
- } else {
- ti[pos] = gcalloc(1,sizeof(GTextInfo));
- ti[pos]->fg = ti[pos]->bg = COLOR_DEFAULT;
- ti[pos++]->line = true;
- ti[pos] = gcalloc(1,sizeof(GTextInfo));
- ti[pos]->fg = ti[pos]->bg = COLOR_DEFAULT;
- ti[pos++]->text = utf82u_copy(_("New Lookup Subtable..."));
- ti[pos] = gcalloc(1,sizeof(GTextInfo));
-return( ti );
- }
- }
- /* We'll never get here */
-return( NULL );
-}
-
-GTextInfo *SFSubtableListOfType(SplineFont *sf, int lookup_type, int kernclass) {
- GTextInfo **temp, *ti;
- int cnt;
-
- temp = SFSubtablesOfType(sf,lookup_type,kernclass);
- if ( temp==NULL )
-return( NULL );
- for ( cnt=0; temp[cnt]->text!=NULL || temp[cnt]->line; ++cnt );
- ti = gcalloc(cnt+1,sizeof(GTextInfo));
- for ( cnt=0; temp[cnt]->text!=NULL || temp[cnt]->line; ++cnt ) {
- ti[cnt] = *temp[cnt];
- free(temp[cnt]);
- }
- free(temp);
-return( ti );
-}
-
-struct lookup_subtable *SFNewLookupSubtableOfType(SplineFont *sf, int lookup_type, struct subtable_data *sd ) {
- int isgpos = (lookup_type>=gpos_start);
- OTLookup *otl, *found=NULL;
- int cnt, ans;
- struct lookup_subtable *sub;
- char **choices;
-
- if ( sf->cidmaster ) sf=sf->cidmaster;
-
- cnt = 0;
- for ( otl=isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next )
- if ( otl->lookup_type==lookup_type )
- ++cnt;
- if ( cnt==0 ) {
- /* There are no lookups of this type, so there is nothing for them to */
- /* pick from. So we must create a new lookup for them, and then add */
- /* a subtable to it */
- found = CreateAndSortNewLookupOfType(sf,lookup_type);
- if ( found==NULL )
-return( NULL );
- sub = NewSubtable(found,isgpos,sf,sd);
- /* even if they canceled the subtable creation they are now stuck */
- /* with the lookup */
-return( sub );
- }
-
- /* I thought briefly that if cnt were 1 I might want to automagically */
- /* create a subtable in that lookup... but no. Still give them the */
- /* option of creating a new lookup */
-
- choices = galloc((cnt+2)*sizeof(char *));
- for ( cnt=0, otl=isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next )
- if ( otl->lookup_type==lookup_type )
- choices[cnt++] = otl->lookup_name;
- choices[cnt++] = _("Create a new lookup");
- choices[cnt] = NULL;
- ans = gwwv_choose(_("Add a subtable to which lookup?"),(const char **) choices,cnt,cnt-1,
- _("Add a subtable to which lookup?"));
- if ( ans==-1 )
- found = NULL;
- else if ( ans==cnt )
- found = CreateAndSortNewLookupOfType(sf,lookup_type);
- else {
- found = NULL;
- for ( cnt=0, otl=isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
- if ( otl->lookup_type==lookup_type ) {
- if ( cnt==ans ) {
- found = otl;
- break;
- } else
- ++cnt;
- }
- }
- }
- free(choices);
- if ( found==NULL )
-return( NULL );
-
-return( NewSubtable(found,isgpos,sf,sd));
-}
-#endif
-
-int VerticalKernFeature(SplineFont *sf, OTLookup *otl, int ask) {
- FeatureScriptLangList *fl;
- struct lookup_subtable *sub;
- KernClass *kc;
-#ifndef LUA_FF_LIB
- char *buts[3];
-#endif
-
- for ( fl=otl->features; fl!=NULL; fl=fl->next ) {
- if ( fl->featuretag==CHR('k','e','r','n') )
-return( false );
- else if ( fl->featuretag==CHR('v','k','r','n') )
-return( true );
- }
-
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub->kc!=NULL ) {
- for ( kc=sf->kerns; kc!=NULL; kc=kc->next )
- if ( kc==sub->kc )
-return( false );
- for ( kc=sf->vkerns; kc!=NULL; kc=kc->next )
- if ( kc==sub->kc )
-return( true );
- }
- }
-
- if ( !ask )
-return( -1 );
-
-#ifndef LUA_FF_LIB
- buts[0] = _("_Horizontal"); buts[1] = _("_Vertical"); buts[2] = NULL;
-return( gwwv_ask(_("Kerning direction"),(const char **) buts,0,1,_("Is this horizontal or vertical kerning data?")) );
-#else
-return( -1 );
-#endif
-}
-
-#ifndef LUA_FF_LIB
-void _LookupSubtableContents(SplineFont *sf, struct lookup_subtable *sub,
- struct subtable_data *sd) {
- int lookup_type = sub->lookup->lookup_type;
-
- if ( (lookup_type == gsub_context || lookup_type == gsub_contextchain ||
- lookup_type == gsub_reversecchain ||
- lookup_type == gpos_context || lookup_type == gpos_contextchain) &&
- sub->fpst==NULL ) {
- sub->fpst = chunkalloc(sizeof(FPST));
- sub->fpst->type = lookup_type == gsub_context ? pst_contextsub :
- lookup_type == gsub_contextchain ? pst_chainsub :
- lookup_type == gsub_reversecchain ? pst_reversesub :
- lookup_type == gpos_context ? pst_contextpos :
- pst_chainpos;
- sub->fpst->subtable = sub;
- sub->fpst->next = sf->possub;
- sf->possub = sub->fpst;
- } else if ( (lookup_type == morx_indic ||
- lookup_type == morx_context ||
- lookup_type == morx_insert ||
- lookup_type == kern_statemachine) &&
- sub->sm==NULL ) {
- sub->sm = chunkalloc(sizeof(ASM));
- sub->sm->type = lookup_type == morx_indic ? asm_indic :
- lookup_type == morx_context ? asm_context :
- lookup_type == morx_insert ? asm_insert :
- asm_kern;
- sub->sm->subtable = sub;
- sub->sm->next = sf->sm;
- sf->sm = sub->sm;
- } else if ( lookup_type==gpos_pair &&
- sub->kc==NULL &&
- !sub->per_glyph_pst_or_kern ) {
- char *buts[4];
- int asked;
-
- if ( sd!=NULL && sd->flags&sdf_verticalkern )
- sub->vertical_kerning = true;
- else if ( sd!=NULL && sd->flags&sdf_horizontalkern )
- sub->vertical_kerning = false;
- else
- sub->vertical_kerning = VerticalKernFeature(sf,sub->lookup,true);
-
- if ( sd!=NULL && sd->flags&sdf_kernclass )
- asked = 1;
- else if ( sd!=NULL && sd->flags&sdf_kernclass )
- asked = 0;
- else {
- buts[0] = _("_Pairs"); buts[1] = _("C_lasses"); buts[2] = _("_Cancel"); buts[3]=NULL;
- asked = gwwv_ask(_("Kerning format"),(const char **) buts,0,1,_("Kerning may be specified either by classes of glyphs\nor by pairwise combinatins of individual glyphs.\nWhich do you want for this subtable?") );
- if ( asked==2 )
-return;
- }
- if ( asked==0 )
- sub->per_glyph_pst_or_kern = true;
- else {
- sub->kc = chunkalloc(sizeof(KernClass));
- if ( sub->vertical_kerning ) {
- sub->kc->next = sf->vkerns;
- sf->vkerns = sub->kc;
- } else {
- sub->kc->next = sf->kerns;
- sf->kerns = sub->kc;
- }
- sub->kc->subtable = sub;
- sub->kc->first_cnt = sub->kc->second_cnt = 1;
- sub->kc->offsets = gcalloc(1,sizeof(int16));
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- sub->kc->adjusts = gcalloc(1,sizeof(DeviceTable));
-#endif
- }
- }
-
- if ( sub->fpst && sf->fontinfo!=NULL ) {
- if ( sf->fontinfo->ccd )
-return;
- sf->fontinfo->ccd = ContextChainEdit(sf,sub->fpst,sf->fontinfo,NULL);
- } else if ( sub->sm && sf->fontinfo!=NULL ) {
- if ( sf->fontinfo->smd!=NULL )
-return;
- sf->fontinfo->smd = StateMachineEdit(sf,sub->sm,sf->fontinfo);
- } else if ( sub->kc!=NULL ) {
- KernClassD(sub->kc,sf,sub->vertical_kerning);
- } else if ( sub->lookup->lookup_type>=gpos_cursive &&
- sub->lookup->lookup_type<=gpos_mark2mark )
- AnchorClassD(sf,sub);
- else
- PSTKernD(sf,sub);
-}
-#endif
-
-struct lookup_subtable *SFSubTableMake(SplineFont *sf,uint32 tag,uint32 script,
- int lookup_type ) {
- OTLookup **base;
- OTLookup *otl, *found=NULL;
- int isgpos = lookup_type>=gpos_start;
- struct lookup_subtable *sub;
- int isnew = false;
-
- if ( sf->cidmaster ) sf = sf->cidmaster;
- base = isgpos ? &sf->gpos_lookups : &sf->gsub_lookups;
- for ( otl= *base; otl!=NULL; otl=otl->next ) {
- if ( otl->lookup_type==lookup_type &&
- FeatureScriptTagInFeatureScriptList(tag,script,otl->features) ) {
- found = otl;
- }
- }
-
- if ( found==NULL ) {
- found = chunkalloc(sizeof(OTLookup));
- found->lookup_type = lookup_type;
- found->features = chunkalloc(sizeof(FeatureScriptLangList));
- found->features->featuretag = tag;
- found->features->scripts = chunkalloc(sizeof(struct scriptlanglist));
- found->features->scripts->script = script;
- found->features->scripts->langs[0] = DEFAULT_LANG;
- found->features->scripts->lang_cnt = 1;
-
- SortInsertLookup(sf, found);
- isnew = true;
- }
-
- sub = chunkalloc(sizeof(struct lookup_subtable));
- sub->next = found->subtables;
- found->subtables = sub;
- sub->lookup = found;
-
- if ( isnew )
- NameOTLookup(found,sf);
-return( sub );
-}
-
-struct lookup_subtable *SFSubTableFindOrMake(SplineFont *sf,uint32 tag,uint32 script,
- int lookup_type ) {
- OTLookup **base;
- OTLookup *otl, *found=NULL;
- int isgpos = lookup_type>=gpos_start;
- struct lookup_subtable *sub;
- int isnew = false;
-
- if ( sf->cidmaster ) sf = sf->cidmaster;
- base = isgpos ? &sf->gpos_lookups : &sf->gsub_lookups;
- for ( otl= *base; otl!=NULL; otl=otl->next ) {
- if ( otl->lookup_type==lookup_type &&
- FeatureScriptTagInFeatureScriptList(tag,script,otl->features) ) {
- for ( sub = otl->subtables; sub!=NULL; sub=sub->next )
- if ( sub->kc==NULL )
-return( sub );
- found = otl;
- }
- }
-
- if ( found==NULL ) {
- found = chunkalloc(sizeof(OTLookup));
- found->lookup_type = lookup_type;
- found->features = chunkalloc(sizeof(FeatureScriptLangList));
- found->features->featuretag = tag;
- found->features->scripts = chunkalloc(sizeof(struct scriptlanglist));
- found->features->scripts->script = script;
- found->features->scripts->langs[0] = DEFAULT_LANG;
- found->features->scripts->lang_cnt = 1;
-
- SortInsertLookup(sf, found);
- isnew = true;
- }
-
- sub = chunkalloc(sizeof(struct lookup_subtable));
- sub->next = found->subtables;
- found->subtables = sub;
- sub->lookup = found;
- sub->per_glyph_pst_or_kern = true;
-
- if ( isnew )
- NameOTLookup(found,sf);
-return( sub );
-}
-
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/macbinary.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/macbinary.c
deleted file mode 100644
index f70103edf9d..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/macbinary.c
+++ /dev/null
@@ -1,3212 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <math.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <ustring.h>
-#include "ttf.h"
-#include "psfont.h"
-#if __Mac
-# include <ctype.h>
-# include </Developer/Headers/FlatCarbon/Files.h>
-#else
-# include <utype.h>
-#undef __Mac
-#define __Mac 0
-#endif
-
-
-#ifdef LUA_FF_LIB
-/* no need for iconv here, since PS is 8-bit legacy */
-#define Isspace(a) ((a)==' '|| ((a) >= '\t' && (a) <= '\r'))
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#define Isalpha(a) (((a)>='a' && (a)<='z') || ((a)>='A' && (a)<='Z'))
-#define Islower(a) ((a)>='a' && (a)<='z')
-#define Isupper(a) ((a)>='A' && (a)<='Z')
-#define Isalnum(a) (Isalpha(a)||Isdigit(a))
-#define Ishexdigit(a) (((a)>='0' && (a)<='9')||((a)>='a' && (a)<='f')||((a)>='A' && (a)<='F'))
-static int Tolower (int c) {
- if (Isupper(c))
- return c-32;
- else
- return c;
-}
-#else
-#define Islower islower
-#define Tolower tolower
-#define Isspace isspace
-#define Isdigit isdigit
-#define Isalpha isalpha
-#define Isalnum isalnum
-#define Ishexdigit ishexdigit
-#endif
-
-
-
-
-const int mac_dpi = 72;
-/* I had always assumed that the mac still believed in 72dpi screens, but I */
-/* see that in geneva under OS/9, the pointsize does not match the pixel */
-/* size of the font. But the dpi is not constant (and the differences */
-/* excede those supplied by rounding errors) varying between 96 and 84dpi */
-
-/* A Mac Resource fork */
-/* http://developer.apple.com/techpubs/mac/MoreToolbox/MoreToolbox-9.html */
-/* begins with a 16 byte header containing: */
-/* resource start offset */
-/* map start offset */
-/* resource length */
-/* map length */
-/* then 256-16 bytes of zeros */
-/* the resource section consists of (many) */
-/* 4 byte length count */
-/* resource data */
-/* the map section contains */
-/* A copy of the 16 byte header */
-/* a 4 byte mac internal value (I hope) */
-/* another 4 bytes of mac internal values (I hope) */
-/* a 2 byte offset from the start of the map section to the list of resource types */
-/* a 2 byte offset from the start of the map section to the list of resource names */
-/* The resource type list consists of */
-/* a 2 byte count of the number of resource types (-1) */
-/* (many copies of) */
-/* a 4 byte resource type ('FOND' for example) */
-/* a 2 byte count of the number of resources of this type (-1) */
-/* a 2 byte offset from the type list start to the resource table */
-/* a resource table looks like */
-/* a 2 byte offset from the resource name table to a pascal */
-/* string containing this resource's name (or 0xffff for none) */
-/* 1 byte of resource flags */
-/* 3 bytes of offset from the resource section to the length & */
-/* data of this instance of the resource type */
-/* 4 bytes of 0 */
-/* The resource name section consists of */
-/* a bunch of pascal strings (ie. preceded by a length byte) */
-
-/* The POST resource isn't noticeably documented, it's pretty much a */
-/* straight copy of the pfb file cut up into 0x800 byte chunks. */
-/* (each section of the pfb file has it's own set of chunks, the last may be smaller than 0x800) */
-/* The NFNT resource http://developer.apple.com/techpubs/mac/Text/Text-250.html */
-/* The FOND resource http://developer.apple.com/techpubs/mac/Text/Text-269.html */
-/* The sfnt resource is basically a copy of the ttf file */
-
-/* A MacBinary file */
-/* http://www.lazerware.com/formats/macbinary.html */
-/* begins with a 128 byte header */
-/* (which specifies lengths for data/resource forks) */
-/* (and contains mac type/creator data) */
-/* (and other stuff) */
-/* (and finally a crc checksum) */
-/* is followed by the data section (padded to a mult of 128 bytes) */
-/* is followed by the resource section (padded to a mult of 128 bytes) */
-
-/* Crc code taken from: */
-/* http://www.ctan.org/tex-archive/tools/macutils/crc/ */
-/* MacBinary files use the same CRC that binhex does (in the MacBinary header) */
-extern unsigned long binhex_crc(unsigned char *buffer,int size);
-
-/* ******************************** Creation ******************************** */
-
-#ifndef LUA_FF_LIB
-static uint16 HashToId(char *fontname,SplineFont *sf,EncMap *map) {
- int low = 128, high = 0x3fff;
- /* A FOND ID should be between these two numbers for roman script (I think) */
- uint32 hash = 0;
- int i, gid;
- SplineChar *sc;
-
- /* Figure out what language we've got */
- /* I'm not bothering with all of the apple scripts, and I don't know */
- /* what to do about cjk fonts */
- if ( sf->cidmaster!=NULL || sf->subfontcnt!=0 ) {
- if ( sf->cidmaster != NULL ) sf = sf->cidmaster;
- if ( sf->ordering != NULL ) {
- if ( strstrmatch(sf->ordering,"Japan")!=NULL ) {
- low = 0x4000; high = 0x41ff;
- } else if ( strstrmatch(sf->ordering,"Korea")!=NULL ) {
- low = 0x4400; high = 0x45ff;
- } else if ( strstrmatch(sf->ordering,"CNS")!=NULL ) {
- low = 0x4200; high = 0x43ff;
- } else if ( strstrmatch(sf->ordering,"GB")!=NULL ) {
- low = 0x7200; high = 0x73ff;
- }
- }
- } else if ( map->enc->is_tradchinese ) {
- low = 0x4200; high = 0x43ff;
- } else if ( map->enc->is_japanese ) {
- low = 0x4000; high = 0x41ff;
- } else if ( map->enc->is_korean ) {
- low = 0x4400; high = 0x45ff;
- } else if ( map->enc->is_simplechinese ) {
- low = 0x7200; high = 0x73ff;
- } else for ( i=0; i<map->enccount && i<256; ++i ) if ( (gid=map->map[i])!=-1 && (sc = sf->glyphs[gid])!=NULL ) {
- /* Japanese between 0x4000 and 0x41ff */
- /* Trad Chinese 0x4200 and 0x43ff */
- /* Simp Chinese 0x7200 and 0x73ff */
- /* Korean 0x4400 and 0x45ff */
- if (( sc->unicodeenc>=0x0600 && sc->unicodeenc<0x0700 ) ||
- ( sc->unicodeenc>=0xFB50 && sc->unicodeenc<0xfe00 )) {
- /* arabic */
- low = 0x4600; high = 0x47ff;
- break;
- } else if (( sc->unicodeenc>=0x0590 && sc->unicodeenc<0x0600 ) ||
- ( sc->unicodeenc>=0xFB1d && sc->unicodeenc<0xFB50 )) {
- /* hebrew */
- low = 0x4800; high = 0x49ff;
- break;
- } else if ((( sc->unicodeenc>=0x0370 && sc->unicodeenc<0x0400 ) ||
- ( sc->unicodeenc>=0x1f00 && sc->unicodeenc<0x2000 )) &&
- sc->unicodeenc!=0x3c0 ) { /* In mac encoding */
- /* greek */
- low = 0x4a00; high = 0x4bff;
- break;
- } else if ( sc->unicodeenc>=0x0400 && sc->unicodeenc<0x0530 ) {
- /* cyrillic */
- low = 0x4c00; high = 0x4dff;
- break;
- /* hebrew/arabic symbols 4e00-4fff */
- } else if ( sc->unicodeenc>=0x0900 && sc->unicodeenc<0x0980 ) {
- /* devanagari */
- low = 0x5000; high = 0x51ff;
- break;
- } else if ( sc->unicodeenc>=0x0980 && sc->unicodeenc<0x0a00 ) {
- /* bengali: script=13 */
- low = 0x5800; high = 0x59ff;
- break;
- }
- }
- while ( *fontname ) {
- int temp = (hash>>28)&0xf;
- hash = (hash<<4) | temp;
- hash ^= *fontname++-' ';
- }
- hash %= (high-low+1);
- hash += low;
-return( hash );
-}
-
-static int IsMacMonospaced(SplineFont *sf,EncMap *map) {
- /* Only look at first 256 */
- int i;
- double width = 0x80000000;
-
- for ( i=0; i<256 && i<map->enccount; ++i ) {
- int gid = map->map[i];
- if ( gid!=-1 && SCWorthOutputting(sf->glyphs[gid]) ) {
- if ( width == 0x80000000 )
- width = sf->glyphs[gid]->width;
- else if ( sf->glyphs[gid]->width!=width )
-return( false );
- }
- }
-return( true );
-}
-
-SplineChar *SFFindExistingCharMac(SplineFont *sf,EncMap *map,int unienc) {
- int i, gid;
-
- for ( i=0; i<map->enccount && i<256; ++i )
- if ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL && sf->glyphs[gid]->unicodeenc==unienc )
-return( sf->glyphs[gid] );
-return( NULL );
-}
-
-static double SFMacWidthMax(SplineFont *sf, EncMap *map) {
- /* Only look at first 256 */
- int i, gid;
- double width = -1;
-
- for ( i=0; i<256 && i<map->enccount; ++i ) {
- if ( (gid=map->map[i])!=-1 && SCWorthOutputting(sf->glyphs[gid]) ) {
- if ( sf->glyphs[gid]->width>width )
- width = sf->glyphs[gid]->width;
- }
- }
- if ( width<0 ) /* No chars, or widths the mac doesn't support */
-return( 0 );
-
-return( width );
-}
-
-static int SFMacAnyKerns(SplineFont *sf, EncMap *map) {
- /* Only look at first 256 */
- int i, cnt=0, gid;
- KernPair *kp;
-
- for ( i=0; i<256 && i<map->enccount; ++i ) {
- if ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- for ( kp=sf->glyphs[gid]->kerns; kp!=NULL; kp=kp->next )
- if ( map->backmap[kp->sc->orig_pos]<256 )
- ++cnt;
- }
- }
-return( cnt );
-}
-
-struct resource {
- uint32 pos;
- uint8 flags;
- uint16 id;
- char *name;
- uint32 nameloc;
- uint32 nameptloc;
-};
-
-struct resourcetype {
- uint32 tag;
- struct resource *res;
- uint32 resloc;
-};
-
-struct macbinaryheader {
- char *macfilename;
- char *binfilename; /* if macfilename is null and this is set we will figure out macfilename by removing .bin */
- uint32 type;
- uint32 creator;
-};
-
-static struct resource *PSToResources(FILE *res,FILE *pfbfile) {
- /* split the font up into as many small resources as we need and return */
- /* an array pointing to the start of each */
- struct stat statb;
- int cnt, type;
- struct resource *resstarts;
- int len,i;
-
- fstat(fileno(pfbfile),&statb);
- cnt = 3*(statb.st_size+0x800)/(0x800-2)+1; /* should be (usually) a vast over estimate */
- resstarts = gcalloc(cnt+1,sizeof(struct resource));
-
- cnt = 0;
- forever {
- if ( getc(pfbfile)!=0x80 ) {
- IError("We made a pfb file, but didn't get one. Hunh?" );
-return( NULL );
- }
- type = getc(pfbfile);
- if ( type==3 ) {
- /* 501 appears to be magic */
- /* postscript resources seem to have flags of 0 */
- resstarts[cnt].id = 501+cnt;
- resstarts[cnt++].pos = ftell(res);
- putlong(res,2); /* length */
- putc(5,res); /* eof mark */
- putc(0,res);
- break;
- }
- len = getc(pfbfile);
- len |= (getc(pfbfile))<<8;
- len |= (getc(pfbfile))<<16;
- len |= (getc(pfbfile))<<24;
- while ( len>0 ) {
- int ilen = len;
- if ( ilen>0x800-2 )
- ilen = 0x800-2;
- len -= ilen;
- resstarts[cnt].id = 501+cnt;
- resstarts[cnt++].pos = ftell(res);
- putlong(res,ilen+2); /* length */
- putc(type,res); /* section type mark */
- putc(0,res);
- for ( i=0; i<ilen; ++i )
- putc(getc(pfbfile),res);
- }
- }
- resstarts[cnt].pos = 0;
-return( resstarts );
-}
-
-static uint32 TTFToResource(FILE *res,FILE *ttffile) {
- /* A truetype font just gets dropped into a resource */
- struct stat statb;
- int ch;
- uint32 resstart;
-
- fstat(fileno(ttffile),&statb);
- resstart = ftell(res);
-
- putlong(res,statb.st_size);
- while ( (ch=getc(ttffile))!=EOF )
- putc(ch,res);
-return( resstart );
-}
-
-static int BDFCCopyBitmaps(uint8 **rows,int offset,BDFChar *bdfc, BDFFont *bdf) {
- int i, r, y, ipos, j, c;
-
- y = bdf->ascent-1; r = i = 0;
- if ( bdfc->ymax > bdf->ascent-1 )
- i = bdfc->ymax-(bdf->ascent-1);
- else if ( bdfc->ymax<bdf->ascent-1 ) {
- r = bdf->ascent-1-bdfc->ymax;
- y = bdfc->ymax;
- }
- for ( ; y>=bdfc->ymin && y>=-bdf->descent; --y, ++i ) {
- /* Mac characters may not extend above the ascent or below the descent */
- /* but bdf chars can, so if a bdf char does, just ignore that part */
- ipos = i*bdfc->bytes_per_line;
- for ( j=0,c=offset; j<=bdfc->xmax-bdfc->xmin; ++j, ++c ) {
- if ( bdfc->bitmap[ipos+(j>>3)] & (1<<(7-(j&7))) )
- rows[r][c>>3] |= (1<<(7-(c&7)));
- }
- ++r;
- }
-return( offset + bdfc->xmax-bdfc->xmin+1 );
-}
-
-static uint32 BDFToNFNT(FILE *res, BDFFont *bdf, EncMap *map) {
- short widths[258], lbearings[258], locs[258]/*, idealwidths[256]*/;
- uint8 **rows = galloc(bdf->pixelsize*sizeof(uint8 *));
- int i, k, width, kernMax=1, descentMax=bdf->descent-1, rectMax=1, widMax=3;
- uint32 rlenpos = ftell(res), end, owloc, owpos;
- int gid;
-
- for ( i=width=0; i<256 && i<map->enccount; ++i ) {
- if ( (gid = map->map[i])!=-1 && gid<bdf->glyphcnt && bdf->glyphs[gid]!=NULL ) {
- width += bdf->glyphs[gid]->xmax+1-bdf->glyphs[gid]->xmin;
- if ( bdf->glyphs[gid]->width>widMax )
- widMax = bdf->glyphs[gid]->width;
- if ( bdf->glyphs[gid]->xmax+1-bdf->glyphs[gid]->xmin>rectMax )
- rectMax = bdf->glyphs[gid]->xmax+1-bdf->glyphs[gid]->xmin;
- if ( bdf->glyphs[gid]->xmin<kernMax )
- kernMax = bdf->glyphs[gid]->xmin;
- if ( bdf->glyphs[gid]->ymin<-descentMax )
- descentMax = -bdf->glyphs[gid]->ymin;
- }
- }
- if ( descentMax>bdf->descent ) descentMax = bdf->descent;
- ++width; /* For the "undefined character */
- for ( k=0; k<bdf->pixelsize; ++k )
- rows[k] = gcalloc((width+7)/8 + 4 , sizeof(uint8));
- for ( i=width=0; i<256 ; ++i ) {
- locs[i] = width;
- if ( i>=map->enccount || (gid=map->map[i])==-1 || gid>=bdf->glyphcnt || bdf->glyphs[gid]==NULL ||
- !SCWorthOutputting(bdf->glyphs[gid]->sc) ) {
- lbearings[i] = 0xff;
- widths[i] = 0xff;
- /*idealwidths[i] = 1<<12; */ /* 1 em */
- } else {
- lbearings[i] = bdf->glyphs[gid]->xmin-kernMax;
- widths[i] = bdf->glyphs[gid]->width<0?0:
- bdf->glyphs[gid]->width>=256?255:
- bdf->glyphs[gid]->width;
- /*idealwidths[i] = bdf->glyphs[gid]->sc->width*(1<<12)/(bdf->sf->ascent+bdf->sf->descent);*/
- width = BDFCCopyBitmaps(rows,width,bdf->glyphs[gid],bdf);
- }
- }
- /* Now for the "undefined character", just a simple vertical bar */
- locs[i] = width;
- lbearings[i] = 1;
- widths[i++] = 3;
- /*idealwidths[i++] = (3<<12)/bdf->pixelsize;*/
- for ( k = 1; k<bdf->pixelsize-1; ++k )
- rows[k][width>>3] |= (1<<(7-(width&7)));
- /* And one more entry to give a size to the last character */
- locs[i] = ++width;
- lbearings[i] = widths[i] = 0xff;
- /*idealwidths[i] = 0;*/
-
- /* Mac magic */
- lbearings[0] = widths[0] = 0;
- lbearings['\r'] = widths['\r'] = 0;
- lbearings['\t'] = 0; widths['\t'] = 6;
-
- /* We've finished the bitmap conversion, now save it... */
- putlong(res,0); /* Length, to be filled in later */
- putshort(res,IsMacMonospaced(bdf->sf,map)?0xb000:0x9000); /* fontType */
- putshort(res,0);
- putshort(res,255);
- putshort(res,widMax);
- putshort(res,kernMax);
- putshort(res,-descentMax);
- putshort(res,rectMax);
- putshort(res,bdf->pixelsize);
- owpos = ftell(res);
- putshort(res,0);
- putshort(res,bdf->ascent);
- putshort(res,bdf->descent);
- putshort(res,(short) (bdf->sf->pfminfo.linegap*bdf->pixelsize/(bdf->sf->ascent+bdf->sf->descent)) );
- putshort(res,(width+15)>>4);
- /* bitmaps */
- for ( k=0; k<bdf->pixelsize; ++k ) {
- for ( i=0; i<((width+15)>>4) ; ++i ) {
- putc(rows[k][2*i],res);
- putc(rows[k][2*i+1],res);
- }
- }
- for ( i=0; i<258; ++i )
- putshort(res,locs[i]);
- owloc = ftell(res); /* valgrind reports an error here (but not above). god knows why */
- for ( i=0; i<258; ++i ) {
- putc(lbearings[i],res);
- putc(widths[i],res);
- }
- end = ftell(res);
- fseek(res,rlenpos,SEEK_SET);
- putlong(res,end-rlenpos-4);
- fseek(res,owpos,SEEK_SET);
- putshort(res,(owloc-owpos)/2);
- fseek(res,0,SEEK_END);
-
- for ( k=0; k<bdf->pixelsize; ++k )
- free(rows[k]);
- free(rows);
-
-return(rlenpos);
-}
-
-static uint32 DummyNFNT(FILE *res, BDFFont *bdf, EncMap *map) {
- /* This produces a stub NFNT which appears when the real data lives inside */
- /* an sfnt (truetype) resource. We still need to produce an NFNT to tell */
- /* the system that the pointsize is available. This NFNT has almost nothing */
- /* in it, just the initial header, no metrics, no bitmaps */
- int i, width, kernMax=1, descentMax=bdf->descent-1, rectMax=1, widMax=3;
- uint32 rlenpos = ftell(res);
- int gid;
-
- for ( i=width=0; i<256 && i<map->enccount; ++i ) if ( (gid=map->map[i])!=-1 && gid<bdf->glyphcnt && bdf->glyphs[gid]!=NULL ) {
- width += bdf->glyphs[gid]->xmax+1-bdf->glyphs[gid]->xmin;
- if ( bdf->glyphs[gid]->width>widMax )
- widMax = bdf->glyphs[gid]->width;
- if ( bdf->glyphs[gid]->xmax+1-bdf->glyphs[gid]->xmin>rectMax )
- rectMax = bdf->glyphs[gid]->xmax+1-bdf->glyphs[gid]->xmin;
- if ( bdf->glyphs[gid]->xmin<kernMax )
- kernMax = bdf->glyphs[gid]->xmin;
- if ( bdf->glyphs[gid]->ymin<-descentMax )
- descentMax = -bdf->glyphs[gid]->ymin;
- }
- if ( descentMax>bdf->descent ) descentMax = bdf->descent;
-
- putlong(res,26); /* Length */
- putshort(res,SFOneWidth(bdf->sf)!=-1?0xf000:0xd000); /* fontType */
- putshort(res,0);
- putshort(res,255);
- putshort(res,widMax);
- putshort(res,kernMax);
- putshort(res,-descentMax);
- putshort(res,rectMax);
- putshort(res,bdf->pixelsize);
- putshort(res,0);
- putshort(res,bdf->ascent);
- putshort(res,bdf->descent);
- putshort(res,(short) (bdf->sf->pfminfo.linegap*bdf->pixelsize/(bdf->sf->ascent+bdf->sf->descent)) );
- putshort(res,0);
-
-return(rlenpos);
-}
-
-static struct resource *SFToNFNTs(FILE *res, SplineFont *sf, int32 *sizes,
- EncMap *map) {
- int i, baseresid = HashToId(sf->fontname,sf,map);
- struct resource *resstarts;
- BDFFont *bdf;
-
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
-
- for ( i=0; sizes[i]!=0; ++i );
- resstarts = gcalloc(i+1,sizeof(struct resource));
-
- for ( i=0; sizes[i]!=0; ++i ) {
- if ( (sizes[i]>>16)!=1 )
- continue;
- if ( (sizes[i]&0xffff)>=256 )
- continue;
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(sizes[i]&0xffff) || BDFDepth(bdf)!=1); bdf=bdf->next );
- if ( bdf==NULL )
- continue;
- resstarts[i].id = baseresid+bdf->pixelsize;
- resstarts[i].pos = BDFToNFNT(res,bdf,map);
- /* NFNTs seem to have resource flags of 0 */
- }
-return(resstarts);
-}
-
-static struct resource *SFsToNFNTs(FILE *res, struct sflist *sfs,int baseresid) {
- int i, j, cnt;
- struct resource *resstarts;
- BDFFont *bdf;
- struct sflist *sfi;
- SplineFont *sf;
-
- cnt = 0;
- for ( sfi=sfs; sfi!=NULL; sfi=sfi->next ) {
- if ( sfi->sizes!=NULL ) {
- for ( i=0; sfi->sizes[i]!=0; ++i );
- cnt += i;
- sfi->ids = gcalloc(i+1,sizeof(int));
- sfi->bdfs = gcalloc(i+1,sizeof(BDFFont *));
- }
- }
-
- resstarts = gcalloc(cnt+1,sizeof(struct resource));
-
- cnt = 0;
- for ( sfi=sfs; sfi!=NULL; sfi=sfi->next ) {
- sf = sfi->sf;
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
- j=0;
- if ( sfi->sizes ) for ( i=0; sfi->sizes[i]!=0; ++i ) {
- if ( (sfi->sizes[i]>>16)!=1 )
- continue;
- if ( (sfi->sizes[i]&0xffff)>=256 )
- continue;
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(sfi->sizes[i]&0xffff) || BDFDepth(bdf)!=1); bdf=bdf->next );
- if ( bdf==NULL )
- continue;
- sfi->ids[j] = baseresid;
- sfi->bdfs[j] = bdf;
- resstarts[cnt+j].id = baseresid++;
- resstarts[cnt+j++].pos = BDFToNFNT(res,bdf,sfi->map);
- /* NFNTs seem to have resource flags of 0 */
- }
- cnt += j;
- }
-return(resstarts);
-}
-
-static struct resource *BuildDummyNFNTlist(FILE *res, SplineFont *sf,
- int32 *sizes, int baseresid, EncMap *map) {
- int i;
- struct resource *resstarts;
- BDFFont *bdf;
-
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
-
- for ( i=0; sizes[i]!=0; ++i );
- resstarts = gcalloc(i+1,sizeof(struct resource));
-
- for ( i=0; sizes[i]!=0; ++i ) {
- if ( (sizes[i]>>16)!=1 )
- continue;
- if ( (sizes[i]&0xffff)>=256 )
- continue;
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(sizes[i]&0xffff) || BDFDepth(bdf)!=1); bdf=bdf->next );
- if ( bdf==NULL )
- continue;
- resstarts[i].id = baseresid+(sizes[i]&0xffff);
- resstarts[i].pos = DummyNFNT(res,bdf,map);
- /* NFNTs seem to have resource flags of 0 */
- }
-return(resstarts);
-}
-
-static struct resource *BuildDummyNFNTfamilyList(FILE *res, struct sflist *sfs,
- int baseresid) {
- int i,j,cnt;
- struct resource *resstarts;
- BDFFont *bdf;
- struct sflist *sfi;
- SplineFont *sf;
-
- cnt = 0;
- for ( sfi=sfs; sfi!=NULL; sfi=sfi->next ) {
- if ( sfi->sizes!=NULL ) {
- for ( i=0; sfi->sizes[i]!=0; ++i );
- cnt += i;
- sfi->ids = gcalloc(i+1,sizeof(int));
- sfi->bdfs = gcalloc(i+1,sizeof(BDFFont *));
- }
- }
-
- resstarts = gcalloc(cnt+1,sizeof(struct resource));
-
- cnt = 0;
- for ( sfi=sfs; sfi!=NULL; sfi=sfi->next ) {
- sf = sfi->sf;
- j = 0;
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
- if ( sfi->sizes ) for ( i=0; sfi->sizes[i]!=0; ++i ) {
- if ( (sfi->sizes[i]>>16)!=1 )
- continue;
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(sfi->sizes[i]&0xffff) || BDFDepth(bdf)!=1); bdf=bdf->next );
- if ( bdf==NULL )
- continue;
- sfi->ids[j] = baseresid;
- sfi->bdfs[j] = bdf;
- resstarts[cnt+j].id = baseresid++;
- resstarts[cnt+j++].pos = DummyNFNT(res,bdf,sfi->map);
- /* NFNTs seem to have resource flags of 0 */
- }
- cnt += j;
- }
-return(resstarts);
-}
-#endif
-
-enum psstyle_flags { psf_bold = 1, psf_italic = 2, psf_outline = 4,
- psf_shadow = 0x8, psf_condense = 0x10, psf_extend = 0x20 };
-
-uint16 _MacStyleCode( char *styles, SplineFont *sf, uint16 *psstylecode ) {
- unsigned short stylecode= 0, psstyle=0;
-
- if ( strstrmatch( styles, "Bold" ) || strstrmatch(styles,"Demi") ||
- strstrmatch( styles,"Heav") || strstrmatch(styles,"Blac") ||
-/* A few fonts have German/French styles in their names */
- strstrmatch( styles,"Fett") || strstrmatch(styles,"Gras") ) {
- stylecode = sf_bold;
- psstyle = psf_bold;
- } else if ( sf!=NULL && sf->weight!=NULL &&
- (strstrmatch( sf->weight, "Bold" ) || strstrmatch(sf->weight,"Demi") ||
- strstrmatch( sf->weight,"Heav") || strstrmatch(sf->weight,"Blac") ||
- strstrmatch( sf->weight,"Fett") || strstrmatch(sf->weight,"Gras")) ) {
- stylecode = sf_bold;
- psstyle = psf_bold;
- }
- /* URW uses four leter abbreviations of Italic and Oblique */
- /* Somebody else uses two letter abbrevs */
- if ( (sf!=NULL && sf->italicangle!=0) ||
- strstrmatch( styles, "Ital" ) ||
- strstrmatch( styles, "Obli" ) ||
- strstrmatch(styles, "Slanted") ||
- strstrmatch(styles, "Kurs") ||
- strstr( styles,"It" ) ) {
- stylecode |= sf_italic;
- psstyle |= psf_italic;
- }
- if ( strstrmatch( styles, "Underline" ) ) {
- stylecode |= sf_underline;
- }
- if ( strstrmatch( styles, "Outl" ) ) {
- stylecode |= sf_outline;
- psstyle |= psf_outline;
- }
- if ( strstr(styles,"Shadow")!=NULL ) {
- stylecode |= sf_shadow;
- psstyle |= psf_shadow;
- }
- if ( strstrmatch( styles, "Cond" ) || strstr( styles,"Cn") ||
- strstrmatch( styles, "Narrow") ) {
- stylecode |= sf_condense;
- psstyle |= psf_condense;
- }
- if ( strstrmatch( styles, "Exte" ) || strstr( styles,"Ex") ) {
- stylecode |= sf_extend;
- psstyle |= psf_extend;
- }
- if ( (psstyle&psf_extend) && (psstyle&psf_condense) ) {
- if ( sf!=NULL )
- LogError( _("Warning: %s(%s) is both extended and condensed. That's impossible.\n"),
- sf->fontname, sf->origname );
- else
- LogError( _("Warning: Both extended and condensed. That's impossible.\n") );
- psstyle &= ~psf_extend;
- stylecode &= ~sf_extend;
- }
- if ( psstylecode!=NULL )
- *psstylecode = psstyle;
-return( stylecode );
-}
-
-uint16 MacStyleCode( SplineFont *sf, uint16 *psstylecode ) {
- char *styles;
-
- if ( sf->cidmaster!=NULL )
- sf = sf->cidmaster;
-
- if ( sf->macstyle!=-1 ) {
- if ( psstylecode!=NULL )
- *psstylecode = (sf->macstyle&0x3)|((sf->macstyle&0x6c)>>1);
-return( sf->macstyle );
- }
-
- styles = SFGetModifiers(sf);
-return( _MacStyleCode(styles,sf,psstylecode));
-}
-
-#ifndef LUA_FF_LIB
-static uint32 SFToFOND(FILE *res,SplineFont *sf,uint32 id,int dottf,
- int32 *sizes, EncMap *map) {
- uint32 rlenpos = ftell(res), widoffpos, widoffloc, kernloc, styleloc, end;
- int i,j,k,cnt, strcnt, fontclass, stylecode, glyphenc, geoffset, realstylecode;
- int gid;
- KernPair *kp;
- DBounds b;
- char *pt;
- /* Fonds are generally marked system heap and sometimes purgeable (resource flags) */
-
- putlong(res,0); /* Fill in length later */
- putshort(res,IsMacMonospaced(sf,map)?0x9000:0x1000);
- putshort(res,id);
- putshort(res,0); /* First character */
- putshort(res,255); /* Last character */
- putshort(res,(short) ((sf->ascent*(1<<12))/(sf->ascent+sf->descent)));
- putshort(res,-(short) ((sf->descent*(1<<12))/(sf->ascent+sf->descent)));
- putshort(res,(short) ((sf->pfminfo.linegap*(1<<12))/(sf->ascent+sf->descent)));
- putshort(res,(short) ((SFMacWidthMax(sf,map)*(1<<12))/(sf->ascent+sf->descent)));
- widoffpos = ftell(res);
- putlong(res,0); /* Fill in width offset later */
- putlong(res,0); /* Fill in kern offset later */
- putlong(res,0); /* Fill in style offset later */
- for ( i=0; i<9; ++i )
- putshort(res,0); /* Extra width values */
- putlong(res,0); /* Script for international */
- putshort(res,2); /* FOND version */
-
- /* Font association table */
- stylecode = realstylecode = MacStyleCode( sf, NULL );
- stylecode = 0; /* Debug !!!! */
- for ( i=j=0; sizes!=NULL && sizes[i]!=0; ++i )
- if ( (sizes[i]>>16)==1 && (sizes[i]&0xffff)<256 )
- ++j;
- if ( dottf ) {
- putshort(res,j+1-1); /* Number of faces */
- putshort(res,0); /* it's scaleable */
- putshort(res,stylecode);
- putshort(res,id); /* Give it the same ID as the fond */
- } else
- putshort(res,j-1); /* Number of faces */
- if ( sizes!=NULL ) {
- for ( i=0; sizes[i]!=0; ++i ) if (( sizes[i]>>16) == 1 ) {
- putshort(res,sizes[i]&0xffff);
- putshort(res,stylecode);
- putshort(res,id+(sizes[i]&0xffff)); /* make up a unique ID */
- }
- }
-
- /* offset table */
- putshort(res,1-1); /* One table */
- putlong(res,6); /* Offset from start of otab to next byte */
-
- /* bounding box table */
- putshort(res,1-1); /* One bounding box */
- SplineFontFindBounds(sf,&b);
- putshort(res,stylecode);
- putshort(res,b.minx*(1<<12)/(sf->ascent+sf->descent));
- putshort(res,b.miny*(1<<12)/(sf->ascent+sf->descent));
- putshort(res,b.maxx*(1<<12)/(sf->ascent+sf->descent));
- putshort(res,b.maxy*(1<<12)/(sf->ascent+sf->descent));
-
- widoffloc = ftell(res);
- putshort(res,1-1); /* One style in the width table too */
- putshort(res,stylecode);
- for ( k=0; k<=256; ++k ) {
- if ( k>=map->enccount || k==256 || (gid=map->map[k])==-1 || sf->glyphs[gid]==NULL )
- putshort(res,1<<12); /* 1 em is default size */
- else
- putshort(res,sf->glyphs[gid]->width*(1<<12)/(sf->ascent+sf->descent));
- }
-
- kernloc = 0;
- if (( cnt = SFMacAnyKerns(sf,map))>0 ) {
- kernloc = ftell(res);
- putshort(res,1-1); /* One style in the width table too */
- putshort(res,stylecode); /* style */
- putshort(res,cnt); /* Count of kerning pairs */
- for ( k=0; k<256 && k<map->enccount; ++k ) {
- if ( (gid=map->map[k])!=-1 && sf->glyphs[gid]!=NULL ) {
- for ( kp=sf->glyphs[gid]->kerns; kp!=NULL; kp=kp->next )
- if ( map->backmap[kp->sc->orig_pos]<256 ) {
- putc(k,res);
- putc(map->backmap[kp->sc->orig_pos],res);
- putshort(res,kp->off*(1<<12)/(sf->ascent+sf->descent));
- }
- }
- }
- }
-
- /* Fontographer referenced a postscript font even in truetype FONDs */
- styleloc = ftell(res);
- fontclass = 0x1; /* font name needs coordinating? Font has its own encoding */
- if ( !(realstylecode&sf_outline) ) fontclass |= 4;
- if ( realstylecode&sf_bold ) fontclass |= 0x18;
- if ( realstylecode&psf_italic ) fontclass |= 0x40;
- if ( realstylecode&psf_condense ) fontclass |= 0x80;
- if ( realstylecode&psf_extend ) fontclass |= 0x100;
- putshort(res,fontclass); /* fontClass */
- geoffset = ftell(res);
- putlong(res,0); /* Offset to glyph encoding table */ /* Fill in later */
- putlong(res,0); /* Reserved, MBZ */
- if ( strnmatch(sf->familyname,sf->fontname,strlen(sf->familyname))!=0 )
- strcnt = 1;
- else if ( strmatch(sf->familyname,sf->fontname)==0 )
- strcnt = 1;
- else if ( sf->fontname[strlen(sf->familyname)]=='-' )
- strcnt = 4;
- else
- strcnt = 3;
- for ( k=0; k<48; ++k )
- putc(strcnt==1?1:2,res); /* All indeces point to this font */
- putshort(res,strcnt); /* strcnt strings */
- pt = sf->fontname+strlen(sf->familyname);
- if ( strcnt==1 ) {
- putc(strlen(sf->fontname),res); /* basename is full name */
- /* Mac expects this to be upper case */
- if ( Islower(*sf->fontname)) putc(toupper(*sf->fontname),res);
- else putc(*sf->fontname,res);
- fwrite(sf->fontname+1,1,strlen(sf->fontname+1),res);
- } else {
- putc(strlen(sf->familyname),res);/* basename */
- if ( Islower(*sf->familyname)) putc(toupper(*sf->familyname),res);
- else putc(*sf->familyname,res);
- fwrite(sf->familyname+1,1,strlen(sf->familyname+1),res);
- if ( strcnt==3 ) {
- putc(1,res); /* index string is one byte long */
- putc(3,res); /* plain name is basename with string 2 */
- putc(strlen(pt),res); /* length of... */
- fwrite(pt,1,strlen(pt),res); /* everything else */
- } else {
- putc(2,res); /* index string is two bytes long */
- putc(3,res); /* plain name is basename with hyphen */
- putc(4,res); /* and everything else */
- putc(1,res); /* Length of ... */
- putc('-',res); /* String containing hyphen */
- ++pt; /* skip over hyphen */
- putc(strlen(pt),res); /* length of ... */
- fwrite(pt,1,strlen(pt),res); /* everything else */
- }
- }
- /* Greg: record offset for glyph encoding table */
- /* We assume that the bitmap and postscript fonts are encoded similarly */
- /* and so a null vector will do. */
- /* GWW: Hmm. ATM refuses to use postscript fonts that have */
- /* glyph encoding tables. Printer drivers use them ok. ATM will only */
- /* work on fonts with mac roman encodings */
- if ( strmatch(map->enc->enc_name,"mac")!=0 &&
- strmatch(map->enc->enc_name,"macintosh")!=0 &&
- strmatch(map->enc->enc_name,"macroman")!=0 ) {
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- if ( !dottf ) ff_post_notice(_("The generated font won't work with ATM"),_("ATM requires that fonts be encoded with the Macintosh Latin encoding. This postscript font will print fine, but only the bitmap versions will be displayed on the screen"));
-#endif
- glyphenc = ftell( res );
- fseek(res,geoffset,SEEK_SET);
- putlong(res,glyphenc-geoffset+2);
- fseek(res,glyphenc,SEEK_SET);
-#if 1
- putshort(res,0);
-#else
- putshort(res,sf->charcnt>256?128:sf->charcnt-128);
- for ( i=0x80; i<sf->charcnt && i<256; ++i ) {
- SplineChar *sc, dummy;
- putc(i,res);
- sc = SCBuildDummy(&dummy,sf,i);
- putc(strlen(sc->name),res);
- fwrite(sc->name,1,strlen(sc->name),res);
- }
-#endif
- }
-
- end = ftell(res);
- fseek(res,widoffpos,SEEK_SET);
- putlong(res,widoffloc-rlenpos-4); /* Fill in width offset */
- putlong(res,kernloc!=0?kernloc-rlenpos-4:0); /* Fill in kern offset */
- putlong(res,styleloc!=0?styleloc-rlenpos-4:0); /* Fill in style offset */
-
- fseek(res,rlenpos,SEEK_SET);
- putlong(res,end-rlenpos-4); /* resource length */
- fseek(res,end,SEEK_SET);
-return(rlenpos);
-}
-
-static void putpnsstring(FILE *res,char *fontname,int len) {
- putc(len,res);
- if ( *fontname && len>0 ) {
- if ( Islower(*fontname))
- putc(toupper(*fontname),res);
- else
- putc(*fontname,res);
- --len;
- for ( ++fontname; *fontname && len>0; ++fontname, --len )
- putc(*fontname,res);
- }
-}
-
-static void putpsstring(FILE *res,char *fontname) {
- putc(strlen(fontname),res);
- if ( *fontname ) {
- for ( ; *fontname; ++fontname )
- putc(*fontname,res);
- }
-}
-
-struct sflistlist {
- struct sflist *sfs;
- struct sflistlist *next;
- char *fondname;
-};
-
-static struct sflistlist *FondSplitter(struct sflist *sfs,int *fondcnt) {
- struct sflist *psfaces[48], *sfi, *last, *start;
- struct sflistlist *sfsl=NULL, *lastl=NULL, *cur, *test;
- uint16 psstyle;
- int fc = 0;
-
- sfi = sfs;
- if ( sfi->sf->fondname==NULL ) {
- memset(psfaces,0,sizeof(psfaces));
- MacStyleCode(sfi->sf,&psstyle);
- last = NULL;
- while ( sfi->sf->fondname==NULL && psfaces[psstyle]==NULL ) {
- psfaces[psstyle] = sfi;
- last = sfi;
- sfi = sfi->next;
- if ( sfi==NULL )
- break;
- MacStyleCode(sfi->sf,&psstyle);
- }
- cur = gcalloc(1,sizeof(struct sflistlist));
- cur->sfs = sfs;
- last->next = NULL;
- for ( last=sfi; last!=NULL; last=last->next )
- if ( last->sf->fondname!=NULL && strcmp(last->sf->fondname,sfs->sf->familyname)==0 )
- break;
- cur->fondname = copy( last==NULL ? sfs->sf->familyname : sfs->sf->fontname );
- lastl = sfsl = cur;
- ++fc;
- }
- while ( sfi!=NULL ) {
- start = sfi;
- if ( sfi->sf->fondname==NULL ) {
- last = sfi;
- sfi = sfi->next;
- } else {
- memset(psfaces,0,sizeof(psfaces));
- MacStyleCode(sfi->sf,&psstyle);
- while ( sfi!=NULL && sfi->sf->fondname!=NULL &&
- strcmp(sfi->sf->fondname,start->sf->fondname)==0 &&
- psfaces[psstyle]==NULL ) {
- psfaces[psstyle] = sfi;
- last = sfi;
- sfi = sfi->next;
- if ( sfi==NULL )
- break;
- MacStyleCode(sfi->sf,&psstyle);
- }
- }
- cur = gcalloc(1,sizeof(struct sflistlist));
- test = NULL;
- if ( start->sf->fondname!=NULL ) {
- for ( test = sfsl; test!=NULL; test=test->next )
- if ( strcmp(test->fondname,start->sf->fondname)==0 )
- break;
- if ( test==NULL )
- cur->fondname = copy(start->sf->fondname);
- }
- if ( cur->fondname==NULL )
- cur->fondname = copy(start->sf->fontname);
- if ( lastl!=NULL ) lastl->next = cur;
- lastl = cur;
- cur->sfs = start;
- last->next = NULL;
- if ( sfsl==NULL )
- sfsl = cur;
- ++fc;
- }
- *fondcnt = fc;
-return( sfsl );
-}
-
-static void SFListListFree(struct sflistlist *sfsl) {
- struct sflist *last = NULL;
- struct sflistlist *sfli, *sflnext;
- /* free the fond list and restore the sfs list */
-
- for ( sfli=sfsl; sfli!=NULL; sfli = sflnext ) {
- sflnext = sfli->next;
- if ( last!=NULL )
- last->next = sfli->sfs;
- for ( last = sfli->sfs; last->next!=NULL; last = last->next );
- free(sfli->fondname);
- free(sfli);
- }
-}
-
-static uint32 SFsToFOND(FILE *res,struct sflist *sfs,uint32 id,int format,int bf) {
- uint32 rlenpos = ftell(res), widoffpos, widoffloc, kernloc, styleloc, end;
- int i,j,k,cnt, scnt, kcnt, pscnt, strcnt, fontclass, glyphenc, geoffset;
- int gid;
- int size;
- uint16 psstyle, stylecode;
- int exact, famlen, has_hyphen;
- char *familyname;
- KernPair *kp;
- DBounds b;
- /* Fonds are generally marked system heap and sometimes purgeable (resource flags) */
- struct sflist *faces[96];
- struct sflist *psfaces[48];
- SplineFont *sf;
- struct sflist *sfi;
- char *pt;
-
- memset(faces,0,sizeof(faces));
- memset(psfaces,0,sizeof(psfaces));
- for ( sfi = sfs ; sfi!=NULL; sfi = sfi->next ) {
- stylecode = MacStyleCode(sfi->sf,&psstyle);
- if ( sfs->next==NULL ) /* FONDs with a single entry should make that entry be "regular" no matter what we think it really is */
- stylecode = psstyle = 0;
- if ( faces[stylecode]==NULL )
- faces[stylecode] = sfi;
- if ( psfaces[psstyle]==NULL )
- psfaces[psstyle] = sfi;
- }
- sf = faces[0]->sf;
-
- putlong(res,0); /* Fill in length later */
- putshort(res,IsMacMonospaced(sf,faces[0]->map)?0x9000:0x1000);
- putshort(res,id);
- putshort(res,0); /* First character */
- putshort(res,255); /* Last character */
- putshort(res,(short) ((sf->ascent*(1<<12))/(sf->ascent+sf->descent)));
- putshort(res,-(short) ((sf->descent*(1<<12))/(sf->ascent+sf->descent)));
- putshort(res,(short) ((sf->pfminfo.linegap*(1<<12))/(sf->ascent+sf->descent)));
- putshort(res,(short) ((SFMacWidthMax(sf,faces[0]->map)*(1<<12))/(sf->ascent+sf->descent)));
- widoffpos = ftell(res);
- putlong(res,0); /* Fill in width offset later */
- putlong(res,0); /* Fill in kern offset later */
- putlong(res,0); /* Fill in style offset later */
- for ( i=0; i<9; ++i )
- putshort(res,0); /* Extra width values */
- putlong(res,0); /* Script for international */
- putshort(res,2); /* FOND version */
-
- /* Font association table */
- for ( i=cnt=scnt=kcnt=0; i<96; ++i ) if ( faces[i]!=NULL ) {
- ++scnt;
- if ( faces[i]->id!=0 ) ++cnt;
- if ( faces[i]->ids!=NULL )
- for ( j=0; faces[i]->ids[j]!=0; ++j ) ++cnt;
- if ( SFMacAnyKerns(faces[i]->sf,faces[i]->map)>0 )
- ++kcnt;
- }
- putshort(res,cnt-1); /* Number of faces */
- /* do ttf faces (if any) first */
- for ( i=cnt=0; i<96; ++i ) if ( faces[i]!=NULL && faces[i]->id!=0 ) {
- putshort(res,0); /* it's scaleable */
- putshort(res,i); /* style */
- putshort(res,faces[i]->id);
- }
- /* then do bitmap faces (if any) */ /* Ordered by size damn it */
- for ( size=1; size<256; ++size ) {
- for ( i=0; i<96; ++i ) if ( faces[i]!=NULL && faces[i]->ids!=NULL ) {
- for ( j=0; faces[i]->ids[j]!=0 ; ++j ) {
- int pointsize = rint( (faces[i]->bdfs[j]->pixelsize*72.0/mac_dpi) );
- if ( pointsize==size ) {
- putshort(res,size);
- putshort(res,i); /* style */
- putshort(res,faces[i]->ids[j]);
- }
- }
- }
- }
-
- /* offset table */
- putshort(res,1-1); /* One table */
- putlong(res,6); /* Offset from start of otab to next byte */
-
- /* bounding box table */
- putshort(res,scnt-1); /* One bounding box per style */
- for ( i=0; i<96; ++i ) if ( faces[i]!=NULL ) {
- SplineFontFindBounds(faces[i]->sf,&b);
- putshort(res,i); /* style */
- putshort(res,b.minx*(1<<12)/(faces[i]->sf->ascent+faces[i]->sf->descent));
- putshort(res,b.miny*(1<<12)/(faces[i]->sf->ascent+faces[i]->sf->descent));
- putshort(res,b.maxx*(1<<12)/(faces[i]->sf->ascent+faces[i]->sf->descent));
- putshort(res,b.maxy*(1<<12)/(faces[i]->sf->ascent+faces[i]->sf->descent));
- }
-
- widoffloc = ftell(res);
- putshort(res,scnt-1); /* One set of width metrics per style */
- for ( i=0; i<96; ++i ) if ( faces[i]!=NULL ) {
- putshort(res,i);
- for ( k=0; k<=257; ++k ) {
- if ( k>=faces[i]->map->enccount || k>=256 ||
- (gid=faces[i]->map->map[k])==-1 || faces[i]->sf->glyphs[gid]==NULL )
- putshort(res,1<<12); /* 1 em is default size */
- else
- putshort(res,faces[i]->sf->glyphs[gid]->width*(1<<12)/(faces[i]->sf->ascent+faces[i]->sf->descent));
- }
- }
-
- kernloc = 0;
- if ( kcnt>0 ) {
- kernloc = ftell(res);
- putshort(res,kcnt-1); /* Number of styles with kern pairs */
- for ( i=0; i<96; ++i ) if ( faces[i]!=NULL && ( cnt = SFMacAnyKerns(faces[i]->sf,faces[i]->map))>0 ) {
- putshort(res,i); /* style */
- putshort(res,cnt); /* Count of kerning pairs */
- for ( k=0; k<256 && k<faces[i]->map->enccount; ++k ) {
- if ( (gid=faces[i]->map->map[k])!=-1 && faces[i]->sf->glyphs[gid]!=NULL ) {
- for ( kp=faces[i]->sf->glyphs[gid]->kerns; kp!=NULL; kp=kp->next )
- if ( faces[i]->map->backmap[kp->sc->orig_pos]<256 ) {
- putc(k,res);
- putc(faces[i]->map->backmap[kp->sc->orig_pos],res);
- putshort(res,kp->off*(1<<12)/(sf->ascent+sf->descent));
- }
- }
- }
- }
- }
-
- /* Fontographer referenced a postscript font even in truetype FONDs */
- styleloc = ftell(res);
-
- exact = false;
- familyname = psfaces[0]->sf->fontname;
- famlen = strlen(familyname);
- if ( (pt=strchr(familyname,'-'))!=NULL )
- famlen = pt-familyname;
- else if ( strnmatch(psfaces[0]->sf->familyname,psfaces[0]->sf->fontname,
- strlen(psfaces[0]->sf->familyname))==0 )
- famlen = strlen(psfaces[0]->sf->familyname);
- has_hyphen = (familyname[famlen]=='-');
- for ( i=pscnt=0; i<48; ++i ) if ( psfaces[i]!=NULL ) {
- ++pscnt;
- if ( strncmp(psfaces[i]->sf->fontname,familyname,famlen)!=0 ) {
- while ( famlen>0 ) {
- --famlen;
- if ( strncmp(psfaces[i]->sf->fontname,familyname,famlen)==0 )
- break;
- }
- }
- }
- if ( famlen!=0 ) for ( i=0; i<48; ++i ) if ( psfaces[i]!=NULL ) {
- if ( psfaces[i]->sf->fontname[famlen]==0 )
- exact = true;
- }
- fontclass = 0x1;
- if ( psfaces[psf_outline]==NULL ) fontclass |= 4;
- if ( psfaces[psf_bold]!=NULL ) fontclass |= 0x18;
- if ( psfaces[psf_italic]!=NULL ) fontclass |= 0x40;
- if ( psfaces[psf_condense]!=NULL ) fontclass |= 0x80;
- if ( psfaces[psf_extend]!=NULL ) fontclass |= 0x100;
- putshort(res,fontclass); /* fontClass */
- geoffset = ftell(res);
- putlong(res,0); /* Offset to glyph encoding table */ /* Fill in later */
- putlong(res,0); /* Reserved, MBZ */
- strcnt = 1/* Family Name */ + pscnt-exact /* count of format strings */ +
- has_hyphen +
- pscnt-exact /* count of additional strings */;
- /* indeces to format strings */
- for ( i=0,pscnt=2; i<48; ++i )
- if ( psfaces[i]!=NULL && psfaces[i]->sf->fontname[famlen]!=0 )
- putc(pscnt++,res);
- else if ( exact )
- putc(1,res);
- else
- putc(2,res);
- putshort(res,strcnt); /* strcnt strings */
- putpnsstring(res,familyname,famlen);
- if ( has_hyphen ) has_hyphen = pscnt++; /* Space for hyphen if present */
- /* Now the format strings */
- for ( i=0; i<48; ++i ) if ( psfaces[i]!=NULL ) {
- if ( psfaces[i]->sf->fontname[famlen]!=0 ) {
- if ( has_hyphen && psfaces[i]->sf->fontname[famlen]==' ' ) {
- putc(2,res);
- putc(has_hyphen,res);
- putc(pscnt++,res);
- } else {
- putc(1,res); /* Familyname with the following */
- putc(pscnt++,res);
- }
- }
- }
- if ( has_hyphen ) {
- putc(1,res);
- putc('-',res);
- }
- /* Now the additional names */
- for ( i=0; i<48; ++i ) if ( psfaces[i]!=NULL ) {
- if ( psfaces[i]->sf->fontname[famlen]!=0 )
- putpsstring(res,psfaces[i]->sf->fontname+famlen);
- }
- /* Greg: record offset for glyph encoding table */
- /* We assume that the bitmap and postscript fonts are encoded similarly */
- /* and so a null vector will do. */
- /* GWW: Hmm. ATM refuses to use postscript fonts that have */
- /* glyph encoding tables. Printer drivers use them ok. ATM will only */
- /* work on fonts with mac roman encodings */
- if ( strmatch(psfaces[0]->map->enc->enc_name,"mac")!=0 &&
- strmatch(psfaces[0]->map->enc->enc_name,"macintosh")!=0 &&
- strmatch(psfaces[0]->map->enc->enc_name,"macroman")!=0 ) {
- if ( format==ff_pfbmacbin )
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- ff_post_notice(_("The generated font won't work with ATM"),_("ATM requires that fonts be encoded with the Macintosh Latin encoding. This postscript font will print fine, but only the bitmap versions will be displayed on the screen"));
-#endif
- glyphenc = ftell( res );
- fseek(res,geoffset,SEEK_SET);
- putlong(res,glyphenc-geoffset+2);
- fseek(res,glyphenc,SEEK_SET);
- putshort(res,0); /* Greg: an empty Glyph encoding table */
- }
-
- end = ftell(res);
- fseek(res,widoffpos,SEEK_SET);
- putlong(res,widoffloc-rlenpos-4); /* Fill in width offset */
- putlong(res,kernloc!=0?kernloc-rlenpos-4:0); /* Fill in kern offset */
- putlong(res,styleloc!=0?styleloc-rlenpos-4:0); /* Fill in style offset */
-
- fseek(res,rlenpos,SEEK_SET);
- putlong(res,end-rlenpos-4); /* resource length */
- fseek(res,end,SEEK_SET);
-return(rlenpos);
-}
-
-/* I presume this routine is called after all resources have been written */
-static void DumpResourceMap(FILE *res,struct resourcetype *rtypes,enum fontformat format) {
- uint32 rfork_base = format>=ff_ttfdfont?0:128; /* space for mac binary header */
- uint32 resource_base = rfork_base+0x100;
- uint32 rend, rtypesstart, mend, namestart;
- int i,j;
-
- fseek(res,0,SEEK_END);
- rend = ftell(res);
-
- if ( format<ff_ttfdfont ) {
- /* Duplicate resource header */
- putlong(res,0x100); /* start of resource data */
- putlong(res,rend-rfork_base); /* start of resource map */
- putlong(res,rend-rfork_base-0x100); /* length of resource data */
- putlong(res,0); /* don't know the length of the map section yet */
- } else {
- for ( i=0; i<16; ++i ) /* 16 bytes of zeroes */
- putc(0,res);
- }
-
- putlong(res,0); /* Some mac specific thing I don't understand */
- putshort(res,0); /* another */
- putshort(res,0); /* another */
-
- putshort(res,4+ftell(res)-rend); /* Offset to resource types */
- putshort(res,0); /* Don't know where the names go yet */
-
- rtypesstart = ftell(res);
- for ( i=0; rtypes[i].tag!=0; ++i );
- putshort(res,i-1); /* Count of different types */
- for ( i=0; rtypes[i].tag!=0; ++i ) {
- putlong(res,rtypes[i].tag); /* Resource type */
- putshort(res,0); /* Number of resources of this type */
- putshort(res,0); /* Offset to the resource list */
- }
-
- /* Now the resource lists... */
- for ( i=0; rtypes[i].tag!=0; ++i ) {
- rtypes[i].resloc = ftell(res);
- for ( j=0; rtypes[i].res[j].pos!=0; ++j ) {
- putshort(res,rtypes[i].res[j].id);
- rtypes[i].res[j].nameptloc = ftell(res);
- putshort(res,0xffff); /* assume no name at first */
- putc(rtypes[i].res[j].flags,res); /* resource flags */
- /* three byte resource offset */
- putc( ((rtypes[i].res[j].pos-resource_base)>>16)&0xff, res );
- putc( ((rtypes[i].res[j].pos-resource_base)>>8)&0xff, res );
- putc( ((rtypes[i].res[j].pos-resource_base)&0xff), res );
- putlong(res,0);
- }
- }
- namestart = ftell(res);
- /* Now the names, if any */
- for ( i=0; rtypes[i].tag!=0; ++i ) {
- for ( j=0; rtypes[i].res[j].pos!=0; ++j ) {
- if ( rtypes[i].res[j].name!=NULL ) {
- rtypes[i].res[j].nameloc = ftell(res);
- putc(strlen(rtypes[i].res[j].name),res); /* Length */
- fwrite(rtypes[i].res[j].name,1,strlen(rtypes[i].res[j].name),res);
- }
- }
- }
- mend = ftell(res);
-
- /* Repeat the rtypes list now we know where they go */
- fseek(res,rtypesstart+2,SEEK_SET); /* skip over the count */
- for ( i=0; rtypes[i].tag!=0; ++i ) {
- putlong(res,rtypes[i].tag); /* Resource type */
- for ( j=0; rtypes[i].res[j].pos!=0; ++j );
- putshort(res,j-1); /* Number of resources of this type */
- putshort(res,rtypes[i].resloc-rtypesstart);
- }
- /* And go back and fixup any name pointers */
- for ( i=0; rtypes[i].tag!=0; ++i ) {
- for ( j=0; rtypes[i].res[j].pos!=0; ++j ) {
- if ( rtypes[i].res[j].name!=NULL ) {
- fseek(res,rtypes[i].res[j].nameptloc,SEEK_SET);
- putshort(res,rtypes[i].res[j].nameloc-namestart);
- }
- }
- }
-
- fseek(res,rend,SEEK_SET);
- /* Fixup duplicate header (and offset to the name list) */
- if ( format<ff_ttfdfont ) {
- putlong(res,0x100); /* start of resource data */
- putlong(res,rend-rfork_base); /* start of resource map */
- putlong(res,rend-rfork_base-0x100); /* length of resource data */
- putlong(res,mend-rend); /* length of map section */
- } else {
- for ( i=0; i<16; ++i )
- putc(0,res);
- }
-
- putlong(res,0); /* Some mac specific thing I don't understand */
- putshort(res,0); /* another */
- putshort(res,0); /* another */
-
- putshort(res,4+ftell(res)-rend); /* Offset to resource types */
- putshort(res,namestart-rend); /* name section */
-
- fseek(res,rfork_base,SEEK_SET);
- /* Fixup main resource header */
- putlong(res,0x100); /* start of resource data */
- putlong(res,rend-rfork_base); /* start of resource map */
- putlong(res,rend-rfork_base-0x100); /* length of resource data */
- putlong(res,mend-rend); /* length of map section */
-}
-
-long mactime(void) {
- time_t now;
- int i;
-
- time(&now);
- /* convert from 1970 based time to 1904 based time */
- now += (1970-1904)*365L*24*60*60;
- for ( i=1904; i<1970; i+=4 )
- now += 24*60*60;
- /* Ignore any leap seconds -- Sorry Steve */
-return( now );
-}
-
-static int DumpMacBinaryHeader(FILE *res,struct macbinaryheader *mb) {
-#if !__Mac
- uint8 header[128], *hpt; char buffer[256], *pt, *dpt;
- uint32 len;
- time_t now;
- int crc;
-
- if ( mb->macfilename==NULL ) {
- char *pt = strrchr(mb->binfilename,'/');
- if ( pt==NULL ) pt = mb->binfilename;
- else ++pt;
- strcpy(buffer,pt);
- dpt = strrchr(buffer,'.');
- if ( dpt==NULL ) {
- buffer[0] = '_';
- strcpy(buffer+1,pt);
- } else
- *dpt = '\0';
- mb->macfilename = buffer;
- buffer[63] = '\0';
- }
-
- memset(header,'\0',sizeof(header));
- hpt = header;
- *hpt++ = '\0'; /* version number */
- /* Mac Filename */
- pt = mb->macfilename;
- *hpt++ = strlen( pt );
- while ( *pt )
- *hpt++ = *pt++;
- while ( hpt<header+65 )
- *hpt++ = '\0';
- /* Mac File Type */
- *hpt++ = mb->type>>24; *hpt++ = mb->type>>16; *hpt++ = mb->type>>8; *hpt++ = mb->type;
- /* Mac Creator */
- *hpt++ = mb->creator>>24; *hpt++ = mb->creator>>16; *hpt++ = mb->creator>>8; *hpt++ = mb->creator;
- *hpt++ = '\0'; /* No finder flags set */
- *hpt++ = '\0'; /* (byte 74) MBZ */
- *hpt++ = '\0'; *hpt++ = '\0'; /* Vert Position in folder */
- *hpt++ = '\0'; *hpt++ = '\0'; /* Hor Position in folder */
- *hpt++ = '\0'; *hpt++ = '\0'; /* window or folder id??? */
- *hpt++ = '\0'; /* protected bit ??? */
- *hpt++ = '\0'; /* (byte 82) MBZ */
- /* Data fork length */
- *hpt++ = '\0'; *hpt++ = '\0'; *hpt++ = '\0'; *hpt++ = '\0';
- /* Resource fork length */
- fseek(res,0,SEEK_END);
- len = ftell(res)-sizeof(header);
- *hpt++ = len>>24; *hpt++ = len>>16; *hpt++ = len>>8; *hpt++ = len;
- /* Pad resource fork to be a multiple of 128 bytes */
- while ( (len&127)!=0 )
- { putc('\0',res); ++len; }
-
- /* Creation time, (seconds from 1/1/1904) */
- now = mactime();
- time(&now);
- *hpt++ = now>>24; *hpt++ = now>>16; *hpt++ = now>>8; *hpt++ = now;
- /* Modification time, (seconds from 1/1/1904) */
- *hpt++ = now>>24; *hpt++ = now>>16; *hpt++ = now>>8; *hpt++ = now;
-
- *hpt++ = '\0'; *hpt++ = '\0'; /* Get Info comment length */
- *hpt++ = 0; /* More finder flags */
-
-/* MacBinary 3 */
- memcpy(header+102,"mBIN",4);
- header[106] = 0; /* Script. I assume 0 is latin */
- header[107] = 0; /* extended finder flags */
-/* End of MacBinary 3 */
- header[122] = 130; /* MacBinary version 3, written in (129 is MB2) */
- header[123] = 129; /* MacBinary Version 2, needed to read */
-
- crc = binhex_crc(header,124);
- header[124] = crc>>8;
- header[125] = crc;
-
- fseek(res,0,SEEK_SET);
- fwrite(header,1,sizeof(header),res);
-return( true );
-#else
- int ret;
- FSRef ref, parentref;
- short macfile;
- char *buf, *dirname, *pt, *fname;
- HFSUniStr255 resforkname;
- FSCatalogInfo info;
- long len;
- unichar_t *filename;
- ByteCount whocares;
- /* When on the mac let's just create a real resource fork. We do this by */
- /* creating a mac file with a resource fork, opening that fork, and */
- /* dumping all the data in the temporary file after the macbinary header */
-
- /* The mac file routines are really lovely. I can't convert a pathspec to */
- /* an FSRef unless the file exists. That is incredibly stupid and annoying of them */
- /* But the directory should exist... */
- fname = mb->macfilename?mb->macfilename:mb->binfilename;
- dirname = copy(fname);
- pt = strrchr(dirname,'/');
- if ( pt!=NULL )
- pt[1] = '\0';
- else {
- free(dirname);
- dirname = copy(".");
- }
- ret=FSPathMakeRef( (uint8 *) dirname,&parentref,NULL);
- free(dirname);
- if ( ret!=noErr )
-return( false );
-
- pt = strrchr(fname,'/');
- filename = def2u_copy(pt==NULL?fname:pt+1);
- ((FInfo *) (info.finderInfo))->fdType = mb->type;
- ((FInfo *) (info.finderInfo))->fdCreator = mb->creator;
- ret = FSCreateFileUnicode(&parentref,u_strlen(filename), (UniChar *) filename,
- kFSCatInfoFinderInfo, &info, &ref, NULL);
- free(filename);
- if ( ret==dupFNErr ) {
- /* File already exists, create failed, didn't get an FSRef */
- ret=FSPathMakeRef( (uint8 *) fname,&ref,NULL);
- }
- if ( ret!=noErr )
-return( false );
-
- FSGetResourceForkName(&resforkname);
- FSCreateFork(&ref,resforkname.length,resforkname.unicode); /* I don't think this is needed, but it doesn't hurt... */
- ret = FSOpenFork(&ref,resforkname.length,resforkname.unicode,fsWrPerm,&macfile);
- if ( ret!=noErr )
-return( false );
- FSSetForkSize(macfile,fsFromStart,0);/* Truncate it just in case it existed... */
- fseek(res,128,SEEK_SET); /* Everything after the mac binary header in */
- /* the temp file is resource fork */
- buf = galloc(8*1024);
- while ( (len=fread(buf,1,8*1024,res))>0 )
- FSWriteFork(macfile,fsAtMark,0,len,buf,&whocares);
- FSCloseFork(macfile);
- free(buf);
-return( true );
-#endif
-}
-
-static void WriteDummyMacHeaders(FILE *res) {
- /* Leave space for the mac binary header (128bytes) and the mac resource */
- /* file header (256 bytes) */
- int i;
- for ( i=0; i<128; ++i )
- putc(0,res);
- for ( i=0; i<256; ++i )
- putc(0,res);
-}
-
-static void WriteDummyDFontHeaders(FILE *res) {
- /* Leave space for the mac resource file header (256 bytes) */
- /* dfonts have the format of a data fork resource file (which I've never */
- /* seen documented, but appears to be just like a resource fork except */
- /* the first 16 bytes are not duplicated at the map */
- int i;
- for ( i=0; i<256; ++i )
- putc(0,res);
-}
-
- /* The mac has rules about what the filename should be for a postscript*/
- /* font. If you deviate from those rules the font will not be found */
- /* The font name must begin with a capital letter */
- /* The filename is designed by modifying the font name */
- /* After the initial capital there can be at most 4 lower case letters (or digits) */
- /* in the filename, any additional lc letters (or digits) in the fontname are ignored */
- /* Every subsequent capital will be followed by at most 2 lc letters */
- /* special characters ("-$", etc.) are removed entirely */
- /* So Times-Bold => TimesBol, HelveticaDemiBold => HelveDemBol */
- /* MacBinary limits the name to 63 characters, I dunno what happens if */
- /* we excede that */
-static void MakeMacPSName(char buffer[63],SplineFont *sf) {
- char *pt, *spt, *lcpt;
-
- for ( pt = buffer, spt = sf->fontname; *spt && pt<buffer+63-1; ++spt ) {
- if ( Isupper(*spt) || spt==sf->fontname ) {
- *pt++ = *spt;
- lcpt = (spt==sf->fontname?spt+5:spt+3);
- } else if ( (Islower(*spt) || Isdigit(*spt)) && spt<lcpt )
- *pt++ = *spt;
- }
- *pt = '\0';
-}
-
-int WriteMacPSFont(char *filename,SplineFont *sf,enum fontformat format,
- int flags,EncMap *map) {
-#ifndef LUA_FF_LIB
- FILE *res, *temppfb;
- int ret = 1;
- struct resourcetype resources[2];
- struct macbinaryheader header;
- int lcfn = false, lcfam = false;
- char buffer[63];
-#if __Mac
- char *pt;
-#endif
-
- temppfb = tmpfile();
- if ( temppfb==NULL )
-return( 0 );
-
- /* The mac has rules about what the filename should be for a postscript*/
- /* font. If you deviate from those rules the font will not be found */
- /* The font name must begin with a capital letter */
- /* The filename is designed by modifying the font name */
- /* After the initial capital there can be at most 4 lower case letters (or digits) */
- /* in the filename, any additional lc letters (or digits) in the fontname are ignored */
- /* Every subsequent capital will be followed by at most 2 lc letters */
- /* special characters ("-$", etc.) are removed entirely */
- /* So Times-Bold => TimesBol, HelveticaDemiBold => HelveDemBol */
- /* MacBinary limits the name to 63 characters, I dunno what happens if */
- /* we excede that */
- if ( Islower(*sf->fontname)) { *sf->fontname = toupper(*sf->fontname); lcfn = true; }
- if ( Islower(*sf->familyname)) { *sf->familyname = toupper(*sf->familyname); lcfam = true; }
- MakeMacPSName(buffer,sf);
-
- ret = _WritePSFont(temppfb,sf,ff_pfb,flags,map,NULL);
- if ( lcfn ) *sf->fontname = Tolower(*sf->fontname);
- if ( lcfam ) *sf->familyname = Tolower(*sf->familyname);
- if ( ret==0 || ferror(temppfb) ) {
- fclose(temppfb);
-return( 0 );
- }
-
- if ( __Mac && format==ff_pfbmacbin )
- res = tmpfile();
- else
- res = fopen(filename,"wb+");
- if ( res==NULL ) {
- fclose(temppfb);
-return( 0 );
- }
-
- WriteDummyMacHeaders(res);
- memset(resources,'\0',sizeof(resources));
- rewind(temppfb);
-
- resources[0].tag = CHR('P','O','S','T');
- resources[0].res = PSToResources(res,temppfb);
- fclose(temppfb);
- DumpResourceMap(res,resources,format);
- free( resources[0].res );
-
-#if __Mac
- header.macfilename = galloc(strlen(filename)+strlen(buffer)+1);
- strcpy(header.macfilename,filename);
- pt = strrchr(header.macfilename,'/');
- if ( pt==NULL ) pt=header.macfilename-1;
- strcpy(pt+1,buffer);
-#else
- header.macfilename = buffer;
-#endif
- /* Adobe uses a creator of ASPF (Adobe Systems Postscript Font I assume) */
- /* Fontographer uses ACp1 (Altsys Corp. Postscript type 1???) */
- /* Both include an FREF, BNDL, ICON* and comment */
- /* I shan't bother with that... It'll look ugly with no icon, but oh well */
- header.type = CHR('L','W','F','N');
- header.creator = CHR('G','W','p','1');
- ret = DumpMacBinaryHeader(res,&header);
- if ( ferror(res) ) ret = 0;
- if ( fclose(res)==-1 ) ret = 0;
-#if __Mac
- free(header.macfilename);
-#endif
-return( ret );
-#else
-return( 0 );
-#endif
-}
-
-int WriteMacTTFFont(char *filename,SplineFont *sf,enum fontformat format,
- int32 *bsizes, enum bitmapformat bf,int flags,EncMap *map) {
- FILE *res, *tempttf;
- int ret = 1, r;
- struct resourcetype resources[4];
- struct resource rlist[3][2], *dummynfnts=NULL;
- struct macbinaryheader header;
-
- tempttf = tmpfile();
- if ( tempttf==NULL )
-return( 0 );
-
- if ( _WriteTTFFont(tempttf,sf,format==ff_none?ff_none:
- format==ff_ttfmacbin?ff_ttf:
- format-1,bsizes,bf,flags,map)==0 || ferror(tempttf) ) {
- fclose(tempttf);
-return( 0 );
- }
- if ( bf!=bf_ttf && bf!=bf_sfnt_dfont )
- bsizes = NULL; /* as far as the FOND for the truetype is concerned anyway */
-
- if ( __Mac && format==ff_ttfmacbin )
- res = tmpfile();
- else
- res = fopen(filename,"wb+");
- if ( res==NULL ) {
- fclose(tempttf);
-return( 0 );
- }
-
- if ( format!=ff_ttfmacbin )
- WriteDummyDFontHeaders(res);
- else
- WriteDummyMacHeaders(res);
- memset(rlist,'\0',sizeof(rlist));
- memset(resources,'\0',sizeof(resources));
- rewind(tempttf);
-
- r = 0;
- resources[r].tag = CHR('s','f','n','t');
- resources[r++].res = rlist[0];
- rlist[0][0].pos = TTFToResource(res,tempttf);
- rlist[0][0].id = HashToId(sf->fontname,sf,map);
- rlist[0][0].flags = 0x00; /* sfnts generally have resource flags 0x20 */
- if ( bsizes!=NULL ) {
- resources[r].tag = CHR('N','F','N','T');
- resources[r++].res = dummynfnts = BuildDummyNFNTlist(res,sf,bsizes,rlist[0][0].id,map);
- }
- resources[r].tag = CHR('F','O','N','D');
- resources[r].res = rlist[1];
- rlist[1][0].pos = SFToFOND(res,sf,rlist[0][0].id,true,bsizes,map);
- rlist[1][0].flags = 0x00; /* I've seen FONDs with resource flags 0, 0x20, 0x60 */
- rlist[1][0].id = rlist[0][0].id;
- rlist[1][0].name = sf->fondname ? sf->fondname : sf->familyname;
- fclose(tempttf);
- DumpResourceMap(res,resources,format);
- free(dummynfnts);
-
- ret = true;
- if ( format==ff_ttfmacbin ) {
- header.macfilename = NULL;
- header.binfilename = filename;
- /* Fontographer uses the old suitcase format for both bitmaps and ttf */
- header.type = CHR('F','F','I','L');
- header.creator = CHR('D','M','O','V');
- ret = DumpMacBinaryHeader(res,&header);
- }
- if ( ferror(res) ) ret = false;
- if ( fclose(res)==-1 ) ret = 0;
-return( ret );
-}
-
-int WriteMacBitmaps(char *filename,SplineFont *sf, int32 *sizes, int is_dfont,
- EncMap *map) {
- FILE *res;
- int ret = 1;
- struct resourcetype resources[3];
- struct resource rlist[2][2];
- struct macbinaryheader header;
- char *binfilename, *pt, *dpt;
-
- /* The filename we've been given is for the outline font, which might or */
- /* might not be stuffed inside a bin file */
- binfilename = galloc(strlen(filename)+strlen(".bmap.dfont")+1);
- strcpy(binfilename,filename);
- pt = strrchr(binfilename,'/');
- if ( pt==NULL ) pt = binfilename; else ++pt;
- dpt = strrchr(pt,'.');
- if ( dpt==NULL )
- dpt = pt+strlen(pt);
- else if ( strmatch(dpt,".bin")==0 || strmatch(dpt,".dfont")==0 ) {
- *dpt = '\0';
- dpt = strrchr(pt,'.');
- if ( dpt==NULL )
- dpt = pt+strlen(pt);
- }
- strcpy(dpt,is_dfont?".bmap.dfont":__Mac?".bmap":".bmap.bin");
-
- if ( __Mac && !is_dfont )
- res = tmpfile();
- else
- res = fopen(binfilename,"wb+");
- if ( res==NULL ) {
- free(binfilename);
-return( 0 );
- }
-
- if ( is_dfont )
- WriteDummyDFontHeaders(res);
- else
- WriteDummyMacHeaders(res);
- memset(rlist,'\0',sizeof(rlist));
- memset(resources,'\0',sizeof(resources));
-
- resources[0].tag = CHR('N','F','N','T');
- resources[0].res = SFToNFNTs(res,sf,sizes,map);
- resources[1].tag = CHR('F','O','N','D');
- resources[1].res = rlist[1];
- rlist[1][0].id = HashToId(sf->fontname,sf,map);
- rlist[1][0].pos = SFToFOND(res,sf,rlist[1][0].id,false,sizes,map);
- rlist[1][0].name = sf->fondname ? sf->fondname : sf->familyname;
- DumpResourceMap(res,resources,is_dfont?ff_ttfdfont:ff_ttfmacbin);
-
- ret = true;
- if ( !is_dfont ) {
- header.macfilename = NULL;
- header.binfilename = binfilename;
- /* Fontographer uses the old suitcase format for both bitmaps and ttf */
- header.type = CHR('F','F','I','L');
- header.creator = CHR('D','M','O','V');
- ret = DumpMacBinaryHeader(res,&header);
- }
- if ( ferror(res)) ret = false;
- if ( fclose(res)==-1 ) ret = 0;
- free(resources[0].res);
- free(binfilename);
-return( ret );
-}
-
-/* We have to worry about these font formats:
- ff_pfbmacbin, ff_ttfmacbin, ff_ttfdfont, ff_otfdfont, ff_otfciddfont, ff_none
- bf_ttf, bf_sfnt_dfont, bf_nfntmacbin,
- bf_nfntdfont I no long support this. OS/X doesn't support NFNTs so there's no point
-*/
-
-int WriteMacFamily(char *filename,struct sflist *sfs,enum fontformat format,
- enum bitmapformat bf,int flags, EncMap *map) {
- FILE *res;
- int ret = 1, r, i;
- struct resourcetype resources[4];
- struct resource *rlist;
- struct macbinaryheader header;
- struct sflist *sfi, *sfsub;
- char buffer[80];
- int freefilename = 0;
- char *pt;
- int id, fondcnt;
- struct sflistlist *sfsl, *sfli;
-
- if ( format==ff_pfbmacbin ) {
- for ( sfi=sfs; sfi!=NULL; sfi = sfi->next ) {
- char *tempname;
- MakeMacPSName(buffer,sfi->sf);
-#if !__Mac
- strcat(buffer,".bin");
-#endif
- tempname = galloc(strlen(filename)+strlen(buffer)+1);
- strcpy(tempname,filename);
- pt = strrchr(tempname,'/');
- if ( pt==NULL ) pt=tempname-1;
- strcpy(pt+1,buffer);
- if ( strcmp(tempname,filename)==0 ) {
- char *tf = galloc(strlen(filename)+20);
- strcpy(tf,filename);
- filename = tf;
- freefilename = true;
- pt = strrchr(filename,'.');
- if ( pt==NULL || pt<strrchr(filename,'/'))
- pt = filename+strlen(filename)+1;
-#if __Mac
- strcpy(pt-1,".fam");
-#else
- strcpy(pt-1,".fam.bin");
-#endif
- }
- if ( WriteMacPSFont(tempname,sfi->sf,format,flags,sfi->map)==0 )
-return( 0 );
- free(tempname);
- }
- } else if ( format!=ff_none || bf==bf_sfnt_dfont ) {
- for ( sfi=sfs; sfi!=NULL; sfi = sfi->next ) {
- sfi->tempttf = tmpfile();
- if ( sfi->tempttf==NULL ||
- _WriteTTFFont(sfi->tempttf,sfi->sf,format==ff_none?ff_none:
- format==ff_ttfmacbin?ff_ttf:
- format-1,sfi->sizes,bf,flags,sfi->map)==0 ||
- ferror(sfi->tempttf) ) {
- for ( sfsub=sfs; sfsub!=sfi; sfsub=sfsub->next )
- fclose( sfsub->tempttf );
-return( 0 );
- }
- rewind(sfi->tempttf);
- }
- }
-
- if ( __Mac && (format==ff_ttfmacbin || format==ff_pfbmacbin ||
- (format==ff_none && bf==bf_nfntmacbin)))
- res = tmpfile();
- else
- res = fopen(filename,"wb+");
- if ( res==NULL ) {
- for ( sfsub=sfs; sfsub!=NULL; sfsub=sfsub->next )
- fclose( sfsub->tempttf );
-return( 0 );
- }
-
- if ( format==ff_ttfdfont || format==ff_otfdfont || format==ff_otfciddfont ||
- bf==bf_sfnt_dfont /*|| (format==ff_none && bf==bf_nfntdfont)*/)
- WriteDummyDFontHeaders(res);
- else
- WriteDummyMacHeaders(res);
- memset(resources,'\0',sizeof(resources));
-
- id = HashToId(sfs->sf->fontname,sfs->sf,sfs->map);
-
- r = 0;
- if ( format==ff_ttfmacbin || format==ff_ttfdfont || format==ff_otfdfont ||
- format==ff_otfciddfont || (format==ff_none && bf==bf_sfnt_dfont )) {
- resources[r].tag = CHR('s','f','n','t');
- for ( sfi=sfs, i=0; sfi!=NULL; sfi=sfi->next, ++i );
- resources[r].res = gcalloc(i+1,sizeof(struct resource));
- for ( sfi=sfs, i=0; sfi!=NULL; sfi=sfi->next, ++i ) {
- resources[r].res[i].pos = TTFToResource(res,sfi->tempttf);
- resources[r].res[i].id = sfi->id = id+i;
- resources[r].res[i].flags = 0x00; /* sfnts generally have resource flags 0x20 */
- fclose(sfi->tempttf);
- }
- ++r;
- if ( bf==bf_ttf || bf==bf_sfnt_dfont ) {
- resources[r].tag = CHR('N','F','N','T');
- resources[r++].res = BuildDummyNFNTfamilyList(res,sfs,id);
- }
- }
- if ( bf==bf_nfntmacbin /*|| bf==bf_nfntdfont */) {
- resources[r].tag = CHR('N','F','N','T');
- resources[r++].res = SFsToNFNTs(res,sfs,id);
- }
-
- sfsl = FondSplitter(sfs,&fondcnt);
- rlist = gcalloc(fondcnt+1,sizeof(struct resource));
- resources[r].tag = CHR('F','O','N','D');
- resources[r++].res = rlist;
- for ( i=0, sfli=sfsl; i<fondcnt && sfli!=NULL; ++i, sfli = sfli->next ) {
- rlist[i].pos = SFsToFOND(res,sfli->sfs,id,format,bf);
- rlist[i].flags = 0x00; /* I've seen FONDs with resource flags 0, 0x20, 0x60 */
- rlist[i].id = id+i;
- rlist[i].name = sfli->fondname;
- }
- DumpResourceMap(res,resources,format!=ff_none?format:
- bf==bf_nfntmacbin?ff_ttfmacbin:ff_ttfdfont);
- SFListListFree(sfsl);
- for ( i=0; i<r; ++i )
- free(resources[i].res);
-
- ret = true;
- if ( format==ff_ttfmacbin || format==ff_pfbmacbin ||
- (format==ff_none && bf==bf_nfntmacbin) ) {
- header.macfilename = NULL;
- header.binfilename = filename;
- /* Fontographer uses the old suitcase format for both bitmaps and ttf */
- header.type = CHR('F','F','I','L');
- header.creator = CHR('D','M','O','V');
- ret = DumpMacBinaryHeader(res,&header);
- }
- if ( ferror(res) ) ret = false;
- if ( fclose(res)==-1 ) ret = 0;
- if ( freefilename )
- free(filename);
- for ( sfi=sfs; sfi!=NULL; sfi=sfi->next ) {
- free( sfi->ids );
- free( sfi->bdfs );
- }
-return( ret );
-}
-
-void SfListFree(struct sflist *sfs) {
- struct sflist *sfi;
-
- while ( sfs!=NULL ) {
- sfi = sfs->next;
- free(sfs->sizes);
- EncMapFree(sfs->map);
- chunkfree(sfs,sizeof(struct sflist));
- sfs = sfi;
- }
-}
-#endif
-
-/* ******************************** Reading ********************************* */
-
-static SplineFont *SearchPostscriptResources(FILE *f,long rlistpos,int subcnt,long rdata_pos,
- long name_list, int flags) {
- long here = ftell(f);
- long *offsets, lenpos;
- int rname = -1, tmp;
- int ch1, ch2;
- int len, type, i, j, rlen;
- unsigned short id, *rsrcids;
- /* I don't pretend to understand the rational behind the format of a */
- /* postscript font. It appears to be split up into chunks where the */
- /* maximum chunk size is 0x800, each section (ascii, binary, ascii, eof) */
- /* has its own set of chunks (ie chunks don't cross sections) */
- char *buffer=NULL;
- int max = 0;
- FILE *pfb;
- FontDict *fd;
- SplineFont *sf;
-
- fseek(f,rlistpos,SEEK_SET);
- rsrcids = gcalloc(subcnt,sizeof(short));
- offsets = gcalloc(subcnt,sizeof(long));
- for ( i=0; i<subcnt; ++i ) {
- rsrcids[i] = getushort(f);
- tmp = (short) getushort(f);
- if ( rname==-1 ) rname = tmp;
- /* flags = */ getc(f);
- ch1 = getc(f); ch2 = getc(f);
- offsets[i] = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
- /* mbz = */ getlong(f);
- }
-
- pfb = tmpfile();
- if ( pfb==NULL ) {
- LogError( _("Can't open temporary file for postscript output\n") );
- fseek(f,here,SEEK_SET );
- free(offsets);
-return(NULL);
- }
-
- putc(0x80,pfb);
- putc(1,pfb);
- lenpos = ftell(pfb);
- putc(0,pfb);
- putc(0,pfb);
- putc(0,pfb);
- putc(0,pfb);
- len = 0; type = 1;
- id = 501;
- for ( i=0; i<subcnt; ++i ) {
- for ( j=0; j<subcnt; ++j )
- if ( rsrcids[j]==id )
- break;
- if ( j == subcnt ) {
- LogError( _("Missing POST resource %u\n"), id );
- break;
- }
- id = id + 1;
- fseek(f,offsets[j],SEEK_SET);
- rlen = getlong(f);
- ch1 = getc(f); ch2 = getc(f);
- rlen -= 2; /* those two bytes don't count as real data */
- if ( ch1==type )
- len += rlen;
- else {
- long hold = ftell(pfb);
- fseek(pfb,lenpos,SEEK_SET);
- putc(len>>24,pfb);
- putc((len>>16)&0xff,pfb);
- putc((len>>8)&0xff,pfb);
- putc(len&0xff,pfb);
- fseek(pfb,hold,SEEK_SET);
- if ( ch1==5 ) /* end of font mark */
- break;
- putc(0x80,pfb);
- putc(ch1,pfb);
- lenpos = ftell(pfb);
- putc(0,pfb);
- putc(0,pfb);
- putc(0,pfb);
- putc(0,pfb);
- type = ch1;
- len = rlen;
- }
- if ( rlen>max ) {
- free(buffer);
- max = rlen;
- if ( max<0x800 ) max = 0x800;
- buffer=galloc(max);
- if ( buffer==NULL ) {
- LogError( _("Out of memory\n") );
- exit( 1 );
- }
- }
- fread(buffer,1,rlen,f);
- fwrite(buffer,1,rlen,pfb);
- }
- free(buffer);
- free(offsets);
- free(rsrcids);
- putc(0x80,pfb);
- putc(3,pfb);
- fseek(pfb,lenpos,SEEK_SET);
- putc(len>>24,pfb);
- putc((len>>16)&0xff,pfb);
- putc((len>>8)&0xff,pfb);
- putc(len&0xff,pfb);
- fseek(f,here,SEEK_SET);
- rewind(pfb);
- if ( flags&ttf_onlynames )
-return( (SplineFont *) _NamesReadPostscript(pfb) ); /* This closes the font for us */
-
- fd = _ReadPSFont(pfb);
- sf = NULL;
- if ( fd!=NULL ) {
- sf = SplineFontFromPSFont(fd);
- PSFontFree(fd);
- /* There is no FOND in a postscript file, so we can't read any kerning*/
- }
- fclose(pfb);
-return( sf );
-}
-
-static SplineFont *SearchTtfResources(FILE *f,long rlistpos,int subcnt,long rdata_pos,
- long name_list,char *filename,int flags,enum openflags openflags) {
- long here, start = ftell(f);
- long roff;
- int rname = -1;
- int ch1, ch2;
- int len, i, rlen, ilen;
- /* The sfnt resource is just a copy of the ttf file */
- char *buffer=NULL;
- int max = 0;
- FILE *ttf;
- SplineFont *sf;
- int which = 0;
- char **names;
- char *pt,*lparen;
- char *chosenname=NULL;
-
- fseek(f,rlistpos,SEEK_SET);
- if ( subcnt>1 || (flags&ttf_onlynames) ) {
- names = gcalloc(subcnt+1,sizeof(char *));
- for ( i=0; i<subcnt; ++i ) {
- /* resource id = */ getushort(f);
- /* rname = (short) */ getushort(f);
- /* flags = */ getc(f);
- ch1 = getc(f); ch2 = getc(f);
- roff = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
- /* mbz = */ getlong(f);
- here = ftell(f);
- names[i] = TTFGetFontName(f,roff+4,roff+4);
- if ( names[i]==NULL ) {
- char buffer[32];
- sprintf( buffer, "Nameless%d", i );
- names[i] = copy(buffer);
- }
- fseek(f,here,SEEK_SET);
- }
- if ( flags&ttf_onlynames ) {
-return( (SplineFont *) names );
- }
- if ((pt = strrchr(filename,'/'))==NULL ) pt = filename;
- if ( (lparen = strchr(pt,'('))!=NULL && strchr(lparen,')')!=NULL ) {
- char *find = copy(lparen+1);
- pt = strchr(find,')');
- if ( pt!=NULL ) *pt='\0';
- for ( which=subcnt-1; which>=0; --which )
- if ( strcmp(names[which],find)==0 )
- break;
- if ( which==-1 ) {
- char *fn = copy(filename);
- fn[lparen-filename] = '\0';
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_post_error(_("Not in Collection"),_("%s is not in %.100s"),find,fn);
-#endif
- free(fn);
- }
- free(find);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- } else if ( no_windowing_ui )
- which = 0;
- else
- which = gwwv_choose(_("Pick a font, any font..."),(const char **) names,subcnt,0,_("There are multiple fonts in this file, pick one"));
-#else
- } else
- which = 0;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- if ( lparen==NULL && which!=-1 )
- chosenname = copy(names[which]);
- for ( i=0; i<subcnt; ++i )
- free(names[i]);
- free(names);
- fseek(f,rlistpos,SEEK_SET);
- }
-
- for ( i=0; i<subcnt; ++i ) {
- /* resource id = */ getushort(f);
- rname = (short) getushort(f);
- /* flags = */ getc(f);
- ch1 = getc(f); ch2 = getc(f);
- roff = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
- /* mbz = */ getlong(f);
- if ( i!=which )
- continue;
- here = ftell(f);
-
- ttf = tmpfile();
- if ( ttf==NULL ) {
- LogError( _("Can't open temporary file for truetype output.\n") );
- continue;
- }
-
- fseek(f,roff,SEEK_SET);
- ilen = rlen = getlong(f);
- if ( rlen>16*1024 )
- ilen = 16*1024;
- if ( ilen>max ) {
- free(buffer);
- max = ilen;
- if ( max<0x800 ) max = 0x800;
- buffer=malloc(max);
- }
- for ( len=0; len<rlen; ) {
- int temp = ilen;
- if ( rlen-len<ilen ) temp = rlen-len;
- temp = fread(buffer,1,temp,f);
- if ( temp==EOF )
- break;
- fwrite(buffer,1,temp,ttf);
- len += temp;
- }
- rewind(ttf);
- sf = _SFReadTTF(ttf,flags,openflags,NULL,NULL);
- fclose(ttf);
- if ( sf!=NULL ) {
- free(buffer);
- fseek(f,start,SEEK_SET);
- if ( sf->chosenname==NULL ) sf->chosenname = chosenname;
-return( sf );
- }
- fseek(f,here,SEEK_SET);
- }
- free(chosenname);
- free(buffer);
- fseek(f,start,SEEK_SET);
-return( NULL );
-}
-
-typedef struct fond {
- char *fondname;
- int first, last;
- int assoc_cnt;
- struct assoc {
- short size, style, id;
- } *assoc;
- /* size==0 => scalable */
- /* style>>8 is the bit depth (0=>1, 1=>2, 2=>4, 3=>8) */
- /* search order for ID is sfnt, NFNT, FONT */
- int stylewidthcnt;
- struct stylewidths {
- short style;
- short *widthtab; /* 4.12 fixed number with the width specified as a fraction of an em */
- } *stylewidths;
- int stylekerncnt;
- struct stylekerns {
- short style;
- int kernpairs;
- struct kerns {
- unsigned char ch1, ch2;
- short offset; /* 4.12 */
- } *kerns;
- } *stylekerns;
- char *psnames[48];
- struct fond *next;
-} FOND;
-
-struct MacFontRec {
- short fontType;
- short firstChar;
- short lastChar;
- short widthMax;
- short kernMax; /* bb learing */
- short Descent; /* maximum negative distance below baseline*/
- short fRectWidth; /* bounding box width */
- short fRectHeight; /* bounding box height */
- unsigned short *offsetWidths;/* offset to start of offset/width table */
- /* 0xffff => undefined, else high byte is offset in locTable, */
- /* low byte is width */
- short ascent;
- short descent;
- short leading;
- short rowWords; /* shorts per row */
- unsigned short *fontImage; /* rowWords*fRectHeight */
- /* Images for all characters plus one extra for undefined */
- unsigned short *locs; /* lastchar-firstchar+3 words */
- /* Horizontal offset to start of n'th character. Note: applies */
- /* to each row. Missing characters have same loc as following */
-};
-
-static void FondListFree(FOND *list) {
- FOND *next;
- int i;
-
- while ( list!=NULL ) {
- next = list->next;
- free(list->assoc);
- for ( i=0; i<list->stylewidthcnt; ++i )
- free(list->stylewidths[i].widthtab);
- free(list->stylewidths);
- for ( i=0; i<list->stylekerncnt; ++i )
- free(list->stylekerns[i].kerns);
- free(list->stylekerns);
- for ( i=0; i<48; ++i )
- free(list->psnames[i]);
- free(list);
- list = next;
- }
-}
-
-/* There's probably only one fond in the file, but there could be more so be */
-/* prepared... */
-/* I want the fond: */
-/* to get the fractional widths for the SWIDTH entry on bdf */
-/* to get the font name */
-/* to get the font association tables */
-/* to get the style flags */
-/* http://developer.apple.com/techpubs/mac/Text/Text-269.html */
-static FOND *BuildFondList(FILE *f,long rlistpos,int subcnt,long rdata_pos,
- long name_list,int flags) {
- long here, start = ftell(f);
- long offset;
- int rname = -1;
- char name[300];
- int ch1, ch2;
- int i, j, k, cnt, isfixed;
- FOND *head=NULL, *cur;
- long widoff, kernoff, styleoff;
-
- fseek(f,rlistpos,SEEK_SET);
- for ( i=0; i<subcnt; ++i ) {
- /* resource id = */ getushort(f);
- rname = (short) getushort(f);
- /* flags = */ getc(f);
- ch1 = getc(f); ch2 = getc(f);
- offset = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
- /* mbz = */ getlong(f);
- here = ftell(f);
-
- cur = gcalloc(1,sizeof(FOND));
- cur->next = head;
- head = cur;
-
- if ( rname!=-1 ) {
- fseek(f,name_list+rname,SEEK_SET);
- ch1 = getc(f);
- fread(name,1,ch1,f);
- name[ch1] = '\0';
- cur->fondname = copy(name);
- }
-
- offset += 4;
- fseek(f,offset,SEEK_SET);
- isfixed = getushort(f)&0x8000?1:0;
- /* family id = */ getushort(f);
- cur->first = getushort(f);
- cur->last = getushort(f);
-/* on a 1 point font... */
- /* ascent = */ getushort(f);
- /* descent = */ getushort(f);
- /* leading = */ getushort(f);
- /* widmax = */ getushort(f);
- if ( (widoff = getlong(f))!=0 ) widoff += offset;
- if ( (kernoff = getlong(f))!=0 ) kernoff += offset;
- if ( (styleoff = getlong(f))!=0 ) styleoff += offset;
- for ( j=0; j<9; ++j )
- getushort(f);
- /* internal & undefined, for international scripts = */ getlong(f);
- /* version = */ getushort(f);
- cur->assoc_cnt = getushort(f)+1;
- cur->assoc = gcalloc(cur->assoc_cnt,sizeof(struct assoc));
- for ( j=0; j<cur->assoc_cnt; ++j ) {
- cur->assoc[j].size = getushort(f);
- cur->assoc[j].style = getushort(f);
- cur->assoc[j].id = getushort(f);
- }
- if ( widoff!=0 ) {
- fseek(f,widoff,SEEK_SET);
- cnt = getushort(f)+1;
- cur->stylewidthcnt = cnt;
- cur->stylewidths = gcalloc(cnt,sizeof(struct stylewidths));
- for ( j=0; j<cnt; ++j ) {
- cur->stylewidths[j].style = getushort(f);
- cur->stylewidths[j].widthtab = galloc((cur->last-cur->first+3)*sizeof(short));
- for ( k=cur->first; k<=cur->last+2; ++k )
- cur->stylewidths[j].widthtab[k] = getushort(f);
- }
- }
- if ( kernoff!=0 && (flags&ttf_onlykerns) ) {
- fseek(f,kernoff,SEEK_SET);
- cnt = getushort(f)+1;
- cur->stylekerncnt = cnt;
- cur->stylekerns = gcalloc(cnt,sizeof(struct stylekerns));
- for ( j=0; j<cnt; ++j ) {
- cur->stylekerns[j].style = getushort(f);
- cur->stylekerns[j].kernpairs = getushort(f);
- cur->stylekerns[j].kerns = galloc(cur->stylekerns[j].kernpairs*sizeof(struct kerns));
- for ( k=0; k<cur->stylekerns[j].kernpairs; ++k ) {
- cur->stylekerns[j].kerns[k].ch1 = getc(f);
- cur->stylekerns[j].kerns[k].ch2 = getc(f);
- cur->stylekerns[j].kerns[k].offset = getushort(f);
- }
- }
- }
- if ( styleoff!=0 ) {
- uint8 stringoffsets[48];
- int strcnt, stringlen, format;
- char **strings, *pt;
- fseek(f,styleoff,SEEK_SET);
- /* class = */ getushort(f);
- /* glyph encoding offset = */ getlong(f);
- /* reserved = */ getlong(f);
- for ( j=0; j<48; ++j )
- stringoffsets[j] = getc(f);
- strcnt = getushort(f);
- strings = galloc(strcnt*sizeof(char *));
- for ( j=0; j<strcnt; ++j ) {
- stringlen = getc(f);
- strings[j] = galloc(stringlen+2);
- strings[j][0] = stringlen;
- strings[j][stringlen+1] = '\0';
- for ( k=0; k<stringlen; ++k )
- strings[j][k+1] = getc(f);
- }
- for ( j=0; j<48; ++j ) {
- for ( k=j-1; k>=0; --k )
- if ( stringoffsets[j]==stringoffsets[k] )
- break;
- if ( k!=-1 )
- continue; /* this style doesn't exist */
- format = stringoffsets[j]-1;
- stringlen = strings[0][0];
- if ( format!=0 )
- for ( k=0; k<strings[format][0]; ++k )
- stringlen += strings[ strings[format][k+1]-1 ][0];
- pt = cur->psnames[j] = galloc(stringlen+1);
- strcpy(pt,strings[ 0 ]+1);
- pt += strings[ 0 ][0];
- if ( format!=0 )
- for ( k=0; k<strings[format][0]; ++k ) {
- strcpy(pt,strings[ strings[format][k+1]-1 ]+1);
- pt += strings[ strings[format][k+1]-1 ][0];
- }
- *pt = '\0';
- }
- for ( j=0; j<strcnt; ++j )
- free(strings[j]);
- free(strings);
- }
- fseek(f,here,SEEK_SET);
- }
- fseek(f,start,SEEK_SET);
-return( head );
-}
-
-static BDFChar *NFNTCvtBitmap(struct MacFontRec *font,int index,SplineFont *sf,int gid) {
- BDFChar *bdfc;
- int i,j, bits, bite, bit;
-
- bdfc = chunkalloc(sizeof(BDFChar));
- bdfc->xmin = (font->offsetWidths[index]>>8)+font->kernMax;
- bdfc->xmax = bdfc->xmin + font->locs[index+1]-font->locs[index]-1;
- if ( bdfc->xmax<bdfc->xmin )
- bdfc->xmax = bdfc->xmin; /* Empty glyph mark */
- bdfc->ymin = -font->descent;
- bdfc->ymax = font->ascent-1;
- bdfc->width = font->offsetWidths[index]&0xff;
- bdfc->vwidth = font->ascent + font->descent;
- bdfc->bytes_per_line = ((bdfc->xmax-bdfc->xmin)>>3) + 1;
- bdfc->bitmap = gcalloc(bdfc->bytes_per_line*font->fRectHeight,sizeof(uint8));
- bdfc->orig_pos = gid;
- bdfc->sc = sf->glyphs[gid];
-
- bits = font->locs[index]; bite = font->locs[index+1];
- for ( i=0; i<font->fRectHeight; ++i ) {
- uint16 *test = font->fontImage + i*font->rowWords;
- uint8 *bpt = bdfc->bitmap + i*bdfc->bytes_per_line;
- for ( bit=bits, j=0; bit<bite; ++bit, ++j ) {
- if ( test[bit>>4]&(0x8000>>(bit&0xf)) )
- bpt[j>>3] |= (0x80>>(j&7));
- }
- }
- BCCompressBitmap(bdfc);
-return( bdfc );
-}
-
-static void LoadNFNT(FILE *f,long offset, SplineFont *sf, int size) {
- long here = ftell(f);
- long baseow;
- long ow;
- int i,gid;
- struct MacFontRec font;
- BDFFont *bdf;
- SplineChar *sc;
-
- offset += 4; /* skip over the length */
- fseek(f,offset,SEEK_SET);
- memset(&font,'\0',sizeof(struct MacFontRec));
- font.fontType = getushort(f);
- font.firstChar = getushort(f);
- font.lastChar = getushort(f);
- font.widthMax = getushort(f);
- font.kernMax = (short) getushort(f);
- font.Descent = (short) getushort(f);
- font.fRectWidth = getushort(f);
- font.fRectHeight = getushort(f);
- baseow = ftell(f);
- ow = getushort(f);
- font.ascent = getushort(f);
- font.descent = getushort(f);
- if ( font.Descent>=0 ) {
- ow |= (font.Descent<<16);
- font.Descent = -font.descent; /* Possibly overkill, but should be safe */
- }
- font.leading = getushort(f);
- font.rowWords = getushort(f);
- if ( font.rowWords!=0 ) {
- font.fontImage = gcalloc(font.rowWords*font.fRectHeight,sizeof(short));
- font.locs = gcalloc(font.lastChar-font.firstChar+3,sizeof(short));
- font.offsetWidths = gcalloc(font.lastChar-font.firstChar+3,sizeof(short));
- for ( i=0; i<font.rowWords*font.fRectHeight; ++i )
- font.fontImage[i] = getushort(f);
- for ( i=0; i<font.lastChar-font.firstChar+3; ++i )
- font.locs[i] = getushort(f);
- fseek(f,baseow+2*ow,SEEK_SET);
- for ( i=0; i<font.lastChar-font.firstChar+3; ++i )
- font.offsetWidths[i] = getushort(f);
- }
- fseek(f,here,SEEK_SET);
- if ( font.rowWords==0 )
-return;
-
- /* Now convert the FONT record to one of my BDF structs */
- bdf = gcalloc(1,sizeof(BDFFont));
- bdf->sf = sf;
- bdf->next = sf->bitmaps;
- sf->bitmaps = bdf;
- bdf->glyphcnt = bdf->glyphmax = sf->glyphcnt;
- bdf->pixelsize = font.ascent+font.descent;
- bdf->glyphs = gcalloc(sf->glyphcnt,sizeof(BDFChar *));
- bdf->ascent = font.ascent;
- bdf->descent = font.descent;
- bdf->res = 72;
- for ( i=font.firstChar; i<=font.lastChar+1; ++i ) {
- if ( i!=font.lastChar+1 )
- sc = SFMakeChar(sf,sf->map,i);
- else {
- sc = SFGetChar(sf,-1,".notdef");
- if ( sc==NULL )
- break;
- }
- gid = sc->orig_pos;
- bdf->glyphs[gid] = NFNTCvtBitmap(&font,i-font.firstChar,sf,gid);
- if ( !sf->glyphs[gid]->widthset ) {
- sf->glyphs[gid]->width = bdf->glyphs[gid]->width*(sf->ascent+sf->descent)/bdf->pixelsize;
- sf->glyphs[gid]->widthset = true;
- }
- }
-
- free(font.fontImage);
- free(font.locs);
- free(font.offsetWidths);
-}
-
-static char *BuildName(char *family,int style) {
- char buffer[350];
-
- strncpy(buffer,family,200);
- if ( style!=0 )
- strcat(buffer,"-");
- if ( style&sf_bold )
- strcat(buffer,"Bold");
- if ( style&sf_italic )
- strcat(buffer,"Italic");
- if ( style&sf_underline )
- strcat(buffer,"Underline");
- if ( style&sf_outline )
- strcat(buffer,"Outline");
- if ( style&sf_shadow )
- strcat(buffer,"Shadow");
- if ( style&sf_condense )
- strcat(buffer,"Condensed");
- if ( style&sf_extend )
- strcat(buffer,"Extended");
-return( copy(buffer));
-}
-
-static int GuessStyle(char *fontname,int *styles,int style_cnt) {
- int which, style;
- char *stylenames = _GetModifiers(fontname,NULL,NULL);
-
- style = _MacStyleCode(stylenames,NULL,NULL);
- for ( which = style_cnt; which>=0; --which )
- if ( styles[which] == style )
-return( which );
-
-return( -1 );
-}
-
-static FOND *PickFOND(FOND *fondlist,char *filename,char **name, int *style) {
- int i,j;
- FOND *test;
- uint8 stylesused[96];
- char **names;
- int cnt, which;
- char *pt, *lparen;
- FOND **fonds = NULL, *fond = NULL;
- int *styles = NULL;
- char *find = NULL;
-
- if ((pt = strrchr(filename,'/'))!=NULL ) pt = filename;
- if ( (lparen = strchr(filename,'('))!=NULL && strchr(lparen,')')!=NULL ) {
- find = copy(lparen+1);
- pt = strchr(find,')');
- if ( pt!=NULL ) *pt='\0';
- for ( test=fondlist; test!=NULL; test=test->next ) {
- for ( i=0; i<48; ++i )
- if ( test->psnames[i]!=NULL && strcmp(find,test->psnames[i])==0 ) {
- *style = (i&3) | ((i&~3)<<1); /* PS styles skip underline bit */
- *name = copy(test->psnames[i]);
-return( test );
- }
- }
- }
-
- /* The file may contain multiple families, and each family may contain */
- /* multiple styles (and each style may contain multiple sizes, but that's */
- /* not an issue for us here) */
- names = NULL;
- for ( i=0; i<2; ++i ) {
- cnt = 0;
- for ( test=fondlist; test!=NULL; test=test->next ) if ( test->fondname!=NULL ) {
- memset(stylesused,0,sizeof(stylesused));
- for ( j=0; j<test->assoc_cnt; ++j ) {
- if ( test->assoc[j].size!=0 && !stylesused[test->assoc[j].style]) {
- stylesused[test->assoc[j].style]=true;
- if ( names!=NULL ) {
- names[cnt] = BuildName(test->fondname,test->assoc[j].style);
- styles[cnt] = test->assoc[j].style;
- fonds[cnt] = test;
- }
- ++cnt;
- }
- }
- }
- if ( names==NULL ) {
- names = gcalloc(cnt+1,sizeof(char *));
- fonds = galloc(cnt*sizeof(FOND *));
- styles = galloc(cnt*sizeof(int));
- }
- }
-
- if ( find!=NULL ) {
- for ( which=cnt-1; which>=0; --which )
- if ( strcmp(names[which],find)==0 )
- break;
- if ( which==-1 && strstrmatch(find,test->fondname)!=NULL )
- which = GuessStyle(find,styles,cnt);
- if ( which==-1 ) {
- char *fn = copy(filename);
- fn[lparen-filename] = '\0';
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_post_error(_("Not in Collection"),_("%s is not in %.100s"),find,fn);
-#endif
- free(fn);
- }
- free(find);
- } else if ( cnt==1 )
- which = 0;
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- else if ( no_windowing_ui )
- which = 0;
- else
- which = gwwv_choose(_("Pick a font, any font..."),(const char **) names,cnt,0,
- _("There are multiple fonts in this file, pick one"));
-#elif defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- else
- which = 0;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
- if ( which!=-1 ) {
- fond = fonds[which];
- *name = copy(names[which]);
- *style = styles[which];
- }
- for ( i=0; i<cnt; ++i )
- free(names[i]);
- free(names); free(fonds); free(styles);
- if ( which==-1 )
-return( NULL );
-
-return( fond );
-}
-
-static SplineFont *SearchBitmapResources(FILE *f,long rlistpos,int subcnt,long rdata_pos,
- long name_list,char *filename,FOND *fondlist,int flags) {
- long start = ftell(f);
- long roff;
- int rname = -1;
- int ch1, ch2;
- int i,j;
- int res_id;
- char *name;
- FOND *fond;
- int style;
- SplineFont *sf;
- int find_id;
- SplineChar *sc;
-
- fond = PickFOND(fondlist,filename,&name,&style);
- if ( fond==NULL )
-return( NULL );
-
- find_id=-1;
- if ( flags&ttf_onlyonestrike ) {
- int biggest = 0;
- for ( i=0; i<fond->assoc_cnt; ++i ) {
- if ( fond->assoc[i].style==style && fond->assoc[i].size>biggest ) {
- biggest = fond->assoc[i].size;
- find_id = fond->assoc[i].id;
- }
- }
- }
-
- sf = SplineFontBlank(257);
- free(sf->fontname); sf->fontname = name;
- free(sf->familyname); sf->familyname = copy(fond->fondname);
- sf->fondname = copy(fond->fondname);
- free(sf->fullname); sf->fullname = copy(name);
- free(sf->origname); sf->origname = NULL;
- if ( style & sf_bold ) {
- free(sf->weight); sf->weight = copy("Bold");
- }
- free(sf->copyright); sf->copyright = NULL;
- free(sf->comments); sf->comments = NULL;
-
- sf->map = EncMapNew(257,257,FindOrMakeEncoding("mac"));
-
- for ( i=0; i<fond->stylewidthcnt; ++i ) {
- if ( fond->stylewidths[i].style == style ) {
- short *widths = fond->stylewidths[i].widthtab;
- for ( j=fond->first; j<=fond->last; ++j ) {
- sc = SFMakeChar(sf,sf->map,j);
- sc->width = ((widths[j-fond->first]*1000L+(1<<11))>>12);
- sc->widthset = true;
- }
- sc = SplineCharCreate();
- sc->parent = sf;
- sc->orig_pos = sf->glyphcnt;
- sf->glyphs[sf->glyphcnt++] = sc;
- sc->name = copy(".notdef");
- sc->width = (widths[fond->last+1-fond->first]*1000L+(1<<11))>>12;
- sc->widthset = true;
- }
- }
-
- fseek(f,rlistpos,SEEK_SET);
- for ( i=0; i<subcnt; ++i ) {
- res_id = getushort(f);
- rname = (short) getushort(f);
- /* flags = */ getc(f);
- ch1 = getc(f); ch2 = getc(f);
- roff = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
- /* mbz = */ getlong(f);
- for ( j=fond->assoc_cnt-1; j>=0; --j )
- if ( (find_id!=-1 && res_id==find_id) ||
- ( fond->assoc[j].style==style && fond->assoc[j].id==res_id &&
- fond->assoc[j].size!=0 ) )
- LoadNFNT(f,roff,sf,fond->assoc[j].size);
- }
- fseek(f,start,SEEK_SET);
-
- sf->onlybitmaps = true;
- SFOrderBitmapList(sf);
-return( sf );
-}
-
-/* Look for kerning info and merge it into the currently existing font "into" */
-static SplineFont *FindFamilyStyleKerns(SplineFont *into,EncMap *map,FOND *fondlist,char *filename) {
- char *name;
- int style;
- FOND *fond;
- int i,j;
- int ch1, ch2, offset;
- KernPair *kp;
- SplineChar *sc1, *sc2;
-
- fond = PickFOND(fondlist,filename,&name,&style);
- if ( fond==NULL || into==NULL )
-return( NULL );
- for ( i=0; i<fond->stylekerncnt; ++i )
- if ( fond->stylekerns[i].style==style )
- break;
- if ( i==fond->stylekerncnt ) {
- LogError(_("No kerning table for %s\n"), name );
- free(name);
-return( NULL );
- }
- for ( j=0; j<fond->stylekerns[i].kernpairs; ++j ) {
- ch1 = fond->stylekerns[i].kerns[j].ch1;
- ch2 = fond->stylekerns[i].kerns[j].ch2;
- offset = (fond->stylekerns[i].kerns[j].offset*(into->ascent+into->descent)+(1<<11))>>12;
- sc1 = SFMakeChar(into,map,ch1);
- sc2 = SFMakeChar(into,map,ch2);
- for ( kp=sc1->kerns; kp!=NULL; kp=kp->next )
- if ( kp->sc==sc2 )
- break;
- if ( kp==NULL ) {
- uint32 script;
- kp = chunkalloc(sizeof(KernPair));
- kp->sc = sc2;
- kp->next = sc1->kerns;
- sc1->kerns = kp;
- script = SCScriptFromUnicode(sc1);
- if ( script==DEFAULT_SCRIPT )
- script = SCScriptFromUnicode(sc2);
- kp->subtable = SFSubTableFindOrMake(sc1->parent,CHR('k','e','r','n'),
- script, gpos_pair);
- }
- kp->off = offset;
- }
-return( into );
-}
-
-/* Look for a bare truetype font in a binhex/macbinary wrapper */
-static SplineFont *MightBeTrueType(FILE *binary,int32 pos,int32 dlen,int flags,
- enum openflags openflags) {
- FILE *temp = tmpfile();
- char *buffer = galloc(8192);
- int len;
- SplineFont *sf;
-
- if ( flags&ttf_onlynames ) {
- char **ret;
- char *temp = TTFGetFontName(binary,pos,pos);
- if ( temp==NULL )
-return( NULL );
- ret = galloc(2*sizeof(char *));
- ret[0] = temp;
- ret[1] = NULL;
-return( (SplineFont *) ret );
- }
-
- fseek(binary,pos,SEEK_SET);
- while ( dlen>0 ) {
- len = dlen > 8192 ? 8192 : dlen;
- len = fread(buffer,1,dlen > 8192 ? 8192 : dlen,binary);
- if ( len==0 )
- break;
- fwrite(buffer,1,len,temp);
- dlen -= len;
- }
- rewind(temp);
- sf = _SFReadTTF(temp,flags,openflags,NULL,NULL);
- fclose(temp);
- free(buffer);
-return( sf );
-}
-
-static SplineFont *IsResourceFork(FILE *f, long offset,char *filename,int flags,
- enum openflags openflags, SplineFont *into,EncMap *map) {
- /* If it is a good resource fork then the first 16 bytes are repeated */
- /* at the location specified in bytes 4-7 */
- /* We include an offset because if we are looking at a mac binary file */
- /* the resource fork will actually start somewhere in the middle of the */
- /* file, not at the beginning */
- unsigned char buffer[16], buffer2[16];
- long rdata_pos, map_pos, type_list, name_list, rpos;
- int32 rdata_len, map_len;
- unsigned long tag;
- int i, cnt, subcnt, nfnt_subcnt=0, font_subcnt=0, fond_subcnt=0;
- SplineFont *sf;
- uint32 nfnt_pos=0, font_pos=0, fond_pos=0;
- FOND *fondlist=NULL;
-
- fseek(f,offset,SEEK_SET);
- if ( fread(buffer,1,16,f)!=16 )
-return( NULL );
- rdata_pos = offset + ((buffer[0]<<24)|(buffer[1]<<16)|(buffer[2]<<8)|buffer[3]);
- map_pos = offset + ((buffer[4]<<24)|(buffer[5]<<16)|(buffer[6]<<8)|buffer[7]);
- rdata_len = ((buffer[8]<<24)|(buffer[9]<<16)|(buffer[10]<<8)|buffer[11]);
- map_len = ((buffer[12]<<24)|(buffer[13]<<16)|(buffer[14]<<8)|buffer[15]);
- if ( rdata_pos+rdata_len!=map_pos || rdata_len==0 )
-return( NULL );
- fseek(f,map_pos,SEEK_SET);
- buffer2[15] = buffer[15]+1; /* make it be different */
- if ( fread(buffer2,1,16,f)!=16 )
-return( NULL );
-
-/* Apple's data fork resources appear to have a bunch of zeroes here instead */
-/* of a copy of the first 16 bytes */
- for ( i=0; i<16; ++i )
- if ( buffer2[i]!=0 )
- break;
- if ( i!=16 ) {
- for ( i=0; i<16; ++i )
- if ( buffer[i]!=buffer2[i] )
-return( NULL );
- }
- getlong(f); /* skip the handle to the next resource map */
- getushort(f); /* skip the file resource number */
- getushort(f); /* skip the attributes */
- type_list = map_pos + getushort(f);
- name_list = map_pos + getushort(f);
-
- fseek(f,type_list,SEEK_SET);
- cnt = getushort(f)+1;
- for ( i=0; i<cnt; ++i ) {
- tag = getlong(f);
- /* printf( "%c%c%c%c\n", tag>>24, (tag>>16)&0xff, (tag>>8)&0xff, tag&0xff );*/
- subcnt = getushort(f)+1;
- rpos = type_list+getushort(f);
- sf = NULL;
- if ( tag==CHR('P','O','S','T') && !(flags&(ttf_onlystrikes|ttf_onlykerns))) /* No FOND */
- sf = SearchPostscriptResources(f,rpos,subcnt,rdata_pos,name_list,flags);
- else if ( tag==CHR('s','f','n','t') && !(flags&ttf_onlykerns))
- sf = SearchTtfResources(f,rpos,subcnt,rdata_pos,name_list,filename,flags,openflags);
- else if ( tag==CHR('N','F','N','T') ) {
- nfnt_pos = rpos;
- nfnt_subcnt = subcnt;
- } else if ( tag==CHR('F','O','N','T') ) {
- font_pos = rpos;
- font_subcnt = subcnt;
- } else if ( tag==CHR('F','O','N','D') ) {
- fond_pos = rpos;
- fond_subcnt = subcnt;
- }
- if ( sf!=NULL )
-return( sf );
- }
- if ( flags&ttf_onlynames ) /* Not interested in bitmap resources here */
-return( NULL );
-
- if ( flags&ttf_onlykerns ) { /* For kerns */
- if ( fond_subcnt!=0 )
- fondlist = BuildFondList(f,fond_pos,fond_subcnt,rdata_pos,name_list,flags);
- into = FindFamilyStyleKerns(into,map,fondlist,filename);
- FondListFree(fondlist);
-return( into );
- }
- /* Ok. If no outline font, try for a bitmap */
- if ( nfnt_subcnt==0 ) {
- nfnt_pos = font_pos;
- nfnt_subcnt = font_subcnt;
- }
- if ( nfnt_subcnt!=0 ) {
- if ( fond_subcnt!=0 )
- fondlist = BuildFondList(f,fond_pos,fond_subcnt,rdata_pos,name_list,flags);
- sf = SearchBitmapResources(f,nfnt_pos,nfnt_subcnt,rdata_pos,name_list,
- filename,fondlist,flags);
- FondListFree(fondlist);
- if ( sf!=NULL )
-return( sf );
- }
-return( (SplineFont *) -1 ); /* It's a valid resource file, but just has no fonts */
-}
-
-#if __Mac
-static SplineFont *HasResourceFork(char *filename,int flags,enum openflags openflags,
- SplineFont *into,EncMap *map) {
- /* If we're on a mac, we can try to see if we've got a real resource fork */
- /* (if we do, copy it into a temporary data file and then manipulate that)*/
- SplineFont *ret;
- FILE *resfork;
- char *tempfn=filename, *pt, *lparen, *respath;
-
- if (( pt=strrchr(filename,'/'))==NULL ) pt = filename;
- if ( (lparen = strchr(pt,'('))!=NULL && strchr(lparen,')')!=NULL ) {
- tempfn = copy(filename);
- tempfn[lparen-filename] = '\0';
- }
- respath = galloc(strlen(tempfn)+strlen("/rsrc")+1);
- strcpy(respath,tempfn);
- strcat(respath,"/rsrc");
- resfork = fopen(respath,"r");
- free(respath);
- if ( tempfn!=filename )
- free(tempfn);
- if ( resfork==NULL )
-return( NULL );
- ret = IsResourceFork(resfork,0,filename,flags,openflags,into,map);
- fclose(resfork);
-return( ret );
-}
-#endif
-
-static SplineFont *IsResourceInBinary(FILE *f,char *filename,int flags,
- enum openflags openflags, SplineFont *into,EncMap *map) {
- unsigned char header[128];
- unsigned long offset, dlen, rlen;
-
- if ( fread(header,1,128,f)!=128 )
-return( NULL );
- if ( header[0]!=0 || header[74]!=0 || header[82]!=0 || header[1]<=0 ||
- header[1]>33 || header[63]!=0 || header[2+header[1]]!=0 )
-return( NULL );
- dlen = ((header[0x53]<<24)|(header[0x54]<<16)|(header[0x55]<<8)|header[0x56]);
- rlen = ((header[0x57]<<24)|(header[0x58]<<16)|(header[0x59]<<8)|header[0x5a]);
- /* 128 bytes for header, then the dlen is padded to a 128 byte boundary */
- offset = 128 + ((dlen+127)&~127);
-/* Look for a bare truetype font in a binhex/macbinary wrapper */
- if ( dlen!=0 && rlen<=dlen) {
- int pos = ftell(f);
- fread(header,1,4,f);
- header[5] = '\0';
- if ( strcmp((char *) header,"OTTO")==0 || strcmp((char *) header,"true")==0 ||
- strcmp((char *) header,"ttcf")==0 ||
- (header[0]==0 && header[1]==1 && header[2]==0 && header[3]==0))
-return( MightBeTrueType(f,pos,dlen,flags,openflags));
- }
-return( IsResourceFork(f,offset,filename,flags,openflags,into,map));
-}
-
-static int lastch=0, repeat = 0;
-static void outchr(FILE *binary, int ch) {
- int i;
-
- if ( repeat ) {
- if ( ch==0 ) {
- /* no repeat, output a literal 0x90 (the repeat flag) */
- lastch=0x90;
- putc(lastch,binary);
- } else {
- for ( i=1; i<ch; ++i )
- putc(lastch,binary);
- }
- repeat = 0;
- } else if ( ch==0x90 ) {
- repeat = 1;
- } else {
- putc(ch,binary);
- lastch = ch;
- }
-}
-
-static SplineFont *IsResourceInHex(FILE *f,char *filename,int flags,enum openflags openflags,
- SplineFont *into,EncMap *map) {
- /* convert file from 6bit to 8bit */
- /* interesting data is enclosed between two colons */
- FILE *binary = tmpfile();
- char *sixbit = "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr";
- int ch, val, cnt, i, dlen, rlen;
- unsigned char header[20]; char *pt;
- SplineFont *ret;
-
- if ( binary==NULL ) {
- LogError( _("can't create temporary file\n") );
-return( NULL );
- }
-
- lastch = repeat = 0;
- while ( (ch=getc(f))!=':' ); /* There may be comments before file start */
- cnt = val = 0;
- while ( (ch=getc(f))!=':' ) {
- if ( Isspace(ch))
- continue;
- for ( pt=sixbit; *pt!=ch && *pt!='\0'; ++pt );
- if ( *pt=='\0' ) {
- fclose(binary);
-return( NULL );
- }
- val = (val<<6) | (pt-sixbit);
- if ( ++cnt==4 ) {
- outchr(binary,(val>>16)&0xff);
- outchr(binary,(val>>8)&0xff);
- outchr(binary,val&0xff);
- val = cnt = 0;
- }
- }
- if ( cnt!=0 ) {
- if ( cnt==1 )
- outchr(binary,val<<2);
- else if ( cnt==2 ) {
- val<<=4;
- outchr(binary,(val>>8)&0xff);
- outchr(binary,val&0xff);
- } else if ( cnt==3 ) {
- val<<=6;
- outchr(binary,(val>>16)&0xff);
- outchr(binary,(val>>8)&0xff);
- outchr(binary,val&0xff);
- }
- }
-
- rewind(binary);
- ch = getc(binary); /* Name length */
- /* skip name */
- for ( i=0; i<ch; ++i )
- getc(binary);
- if ( getc(binary)!='\0' ) {
- fclose(binary);
-return( NULL );
- }
- fread(header,1,20,binary);
- dlen = (header[10]<<24)|(header[11]<<16)|(header[12]<<8)|header[13];
- rlen = (header[14]<<24)|(header[15]<<16)|(header[16]<<8)|header[17];
-/* Look for a bare truetype font in a binhex/macbinary wrapper */
- if ( dlen!=0 && rlen<dlen ) {
- int pos = ftell(binary);
- fread(header,1,4,binary);
- header[5] = '\0';
- if ( strcmp((char *) header,"OTTO")==0 || strcmp((char *) header,"true")==0 ||
- strcmp((char *) header,"ttcf")==0 ||
- (header[0]==0 && header[1]==1 && header[2]==0 && header[3]==0)) {
- ret = MightBeTrueType(binary,pos,dlen,flags,openflags);
- fclose(binary);
-return( ret );
- }
- }
- if ( rlen==0 ) {
- fclose(binary);
-return( NULL );
- }
-
- ret = IsResourceFork(binary,ftell(binary)+dlen+2,filename,flags,openflags,into,map);
-
- fclose(binary);
-return( ret );
-}
-
-static SplineFont *IsResourceInFile(char *filename,int flags,enum openflags openflags,
- SplineFont *into, EncMap *map) {
- FILE *f;
- char *spt, *pt;
- SplineFont *sf;
- char *temp=filename, *lparen;
-
- if (( pt=strrchr(filename,'/'))==NULL ) pt = filename;
- if ( (lparen = strchr(pt,'('))!=NULL && strchr(lparen,')')!=NULL ) {
- temp = copy(filename);
- temp[lparen-filename] = '\0';
- }
- f = fopen(temp,"rb");
- if ( temp!=filename ) free(temp);
- if ( f==NULL )
-return( NULL );
- spt = strrchr(filename,'/');
- if ( spt==NULL ) spt = filename;
- pt = strrchr(spt,'.');
- if ( pt!=NULL && (pt[1]=='b' || pt[1]=='B') && (pt[2]=='i' || pt[2]=='I') &&
- (pt[3]=='n' || pt[3]=='N') && (pt[4]=='\0' || pt[4]=='(') ) {
- if ( (sf = IsResourceInBinary(f,filename,flags,openflags,into,map))) {
- fclose(f);
-return( sf );
- }
- } else if ( pt!=NULL && (pt[1]=='h' || pt[1]=='H') && (pt[2]=='q' || pt[2]=='Q') &&
- (pt[3]=='x' || pt[3]=='X') && (pt[4]=='\0' || pt[4]=='(')) {
- if ( (sf = IsResourceInHex(f,filename,flags,openflags,into,map))) {
- fclose(f);
-return( sf );
- }
- }
-
- sf = IsResourceFork(f,0,filename,flags,openflags,into,map);
- fclose(f);
-#if __Mac
- if ( sf==NULL )
- sf = HasResourceFork(filename,flags,openflags,into,map);
-#endif
-return( sf );
-}
-
-static SplineFont *FindResourceFile(char *filename,int flags,enum openflags openflags,
- SplineFont *into,EncMap *map) {
- char *spt, *pt, *dpt;
- char buffer[1400];
- SplineFont *sf;
-
- if ( (sf = IsResourceInFile(filename,flags,openflags,into,map)))
-return( sf );
-
- /* Well, look in the resource fork directory (if it exists), the resource */
- /* fork is placed there in a seperate file on (some) non-Mac disks */
- strcpy(buffer,filename);
- spt = strrchr(buffer,'/');
- if ( spt==NULL ) { spt = buffer; pt = filename; }
- else { ++spt; pt = filename + (spt-buffer); }
- strcpy(spt,"resource.frk/");
- strcat(spt,pt);
- if ( (sf=IsResourceInFile(buffer,flags,openflags,into,map)))
-return( sf );
-
- /* however the resource fork does not appear to do long names properly */
- /* names are always lower case 8.3, do some simple things to check */
- spt = strrchr(buffer,'/')+1;
- for ( pt=spt; *pt; ++pt )
- if ( Isupper( *pt ))
- *pt = Tolower( *pt );
- dpt = strchr(spt,'.');
- if ( dpt==NULL ) dpt = spt+strlen(spt);
- if ( dpt-spt>8 || strlen(dpt)>4 ) {
- char exten[8];
- strncpy(exten,dpt,7);
- exten[4] = '\0'; /* it includes the dot */
- if ( dpt-spt>6 )
- dpt = spt+6;
- *dpt++ = '~';
- *dpt++ = '1';
- strcpy(dpt,exten);
- }
-return( IsResourceInFile(buffer,flags,openflags,into,map));
-}
-
-SplineFont *SFReadMacBinary(char *filename,int flags,enum openflags openflags) {
- SplineFont *sf = FindResourceFile(filename,flags,openflags,NULL,NULL);
-
- if ( sf==NULL )
- LogError( _("Couldn't find a font file named %s\n"), filename );
- else if ( sf==(SplineFont *) (-1) ) {
- LogError( _("%s is a mac resource file but contains no postscript or truetype fonts\n"), filename );
- sf = NULL;
- }
-return( sf );
-}
-
-#ifdef LUA_FF_LIB
-SplineFont *SFReadMacBinaryInfo(char *filename,int flags,enum openflags openflags) {
- SplineFont *sf = FindResourceFile(filename,flags,openflags,NULL,NULL);
-
- if ( sf==NULL )
- LogError( _("Couldn't find a font file named %s\n"), filename );
- else if ( sf==(SplineFont *) (-1) ) {
- LogError( _("%s is a mac resource file but contains no postscript or truetype fonts\n"), filename );
- sf = NULL;
- }
-return( sf );
-}
-#endif
-
-int LoadKerningDataFromMacFOND(SplineFont *sf, char *filename,EncMap *map) {
- if ( FindResourceFile(filename,ttf_onlykerns,0,sf,map)==NULL )
-return ( false );
-
-return( true );
-}
-
-char **NamesReadMacBinary(char *filename) {
-return( (char **) FindResourceFile(filename,ttf_onlynames,0,NULL,NULL));
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/namelist.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/namelist.c
deleted file mode 100644
index c290afaa8ab..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/namelist.c
+++ /dev/null
@@ -1,19852 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "pfaeditui.h"
-#include "ustring.h"
-#include <utype.h>
-
-extern int recognizePUA;
-
-#ifdef LUA_FF_LIB
-extern int unic_isalpha(int);
-#define Isalpha unic_isalpha
-#else
-#define Isalpha isalpha
-#endif
-
-
-static struct psaltnames {
- char *name;
- int unicode;
- int provenance; /* 1=> Adobe PUA, 2=>AMS PUA, 3=>TeX */
-} psaltnames[5487];
-
-static NameList agl_sans, agl, adobepua, greeksc, tex, ams;
-NameList *namelist_for_new_fonts = &agl;
-
- /* Adobe's standard names are wrong for: */
- /* 0x0162 is named Tcommaaccent, 0x21A should be */
- /* 0x0163 is named tcommaaccent, 0x21B should be */
-/* The following have been corrected (at least by intent) or removed */
- /* 0xf6be is named dotlessj, 0x237 should be */
- /* 0x2206 is named Delta, 0x394 should be */
- /* 0x2126 is named Omega, 0x3A9 should be */
- /* 0x00b5 is named mu, 0x3BC should be */
-
-static int psnamesinited=false;
-#define HASH_SIZE 257
-struct psbucket { const char *name; int uni; struct psbucket *prev; } *psbuckets[HASH_SIZE];
-
-static int hashname(const char *_name) {
- const unsigned char *name = (const unsigned char *) _name;
- int hash=0;
-
- while ( *name ) {
- if ( *name<=' ' )
- break;
- hash = (hash<<3)|((hash>>29)&0x7);
- hash ^= *name++-(' '+1);
- }
- hash ^= (hash>>16);
- hash &= 0xffff;
-return( hash%HASH_SIZE );
-}
-
-static void psaddbucket(const char *name, int uni) {
- int hash = hashname(name);
- struct psbucket *buck = gcalloc(1,sizeof(struct psbucket));
-
- buck->name = name;
- buck->uni = uni;
- buck->prev = psbuckets[hash];
- psbuckets[hash] = buck;
-}
-
-static void NameListHash(NameList *nl) {
- int i,j,k;
- for ( i=0; i<17; ++i ) if ( nl->unicode[i]!=NULL ) {
- for ( j=0; j<256; ++j ) if ( nl->unicode[i][j]!=NULL ) {
- for ( k=0; k<256; ++k ) if ( nl->unicode[i][j][k]!=NULL )
- psaddbucket(nl->unicode[i][j][k],(i<<16)|(j<<8)|k );
- }
- }
-}
-
-static void psinitnames(void) {
- int i;
- NameList *nl;
-
- agl.next = &agl_sans;
- agl_sans.next = &adobepua;
- adobepua.next = &greeksc;
- greeksc.next = &tex;
- tex.next = &ams;
-
- for ( i=0; psaltnames[i].name!=NULL ; ++i )
- psaddbucket(psaltnames[i].name,psaltnames[i].unicode);
- for ( nl=&agl; nl!=NULL; nl=nl->next )
- NameListHash(nl);
- psnamesinited = true;
-}
-
-#ifndef LUA_FF_LIB
-static void psreinitnames(void) {
- /* If we reread a (loaded) namelist file, then we must remove the old defn*/
- /* which means we must remove all the old hash entries before we can put */
- /* in the new ones */
- int i;
- struct psbucket *cur, *prev;
- NameList *nl;
-
- for ( i=0; i<HASH_SIZE; ++i ) {
- for ( cur = psbuckets[i]; cur!=NULL; cur=prev ) {
- prev = cur->prev;
- chunkfree(cur,sizeof(struct psbucket));
- }
- psbuckets[i] = NULL;
- }
-
- for ( i=0; psaltnames[i].name!=NULL ; ++i )
- psaddbucket(psaltnames[i].name,psaltnames[i].unicode);
- for ( nl=&agl; nl!=NULL; nl=nl->next )
- NameListHash(nl);
-}
-#endif
-
-int UniFromName(const char *name,enum uni_interp interp,Encoding *encname) {
- int i = -1;
- char *end;
- struct psbucket *buck;
-
- if ( strncmp(name,"uni",3)==0 ) {
- i = strtol(name+3,&end,16);
- if ( *end || end-name!=7 ) /* uniXXXXXXXX means a ligature of uniXXXX and uniXXXX */
- i = -1;
- } else if ( (name[0]=='U' || name[0]=='u') && name[1]=='+' &&
- (strlen(name)==6 || strlen(name)==7)) {
- /* Unifont uses this convention */
- i = strtol(name+2,&end,16);
- if ( *end )
- i = -1;
- } else if ( name[0]=='u' && strlen(name)>=5 ) {
- i = strtol(name+1,&end,16);
- if ( *end )
- i = -1;
- else if ( encname!=NULL && !encname->is_unicodefull &&
- (interp==ui_ams || interp==ui_trad_chinese)) {
- int j;
- extern const int cns14pua[], amspua[];
- const int *pua = interp==ui_ams ? amspua : cns14pua;
- for ( j=0xf8ff-0xe000; j>=0; --j )
- if ( pua[j]==i ) {
- i = j+0xe000;
- break;
- }
- }
- } else if ( name[0]!='\0' && name[1]=='\0' )
- i = ((unsigned char *) name)[0];
- if ( i==-1 ) {
- if ( !psnamesinited )
- psinitnames();
- for ( buck = psbuckets[hashname(name)]; buck!=NULL; buck=buck->prev )
- if ( strcmp(buck->name,name)==0 )
- break;
- if ( buck!=NULL )
- i = buck->uni;
- }
- if ( !recognizePUA && i>=0xe000 && i<=0xf8ff )
- i = -1;
-return( i );
-}
-
-const char *StdGlyphName(char *buffer, int uni,enum uni_interp interp,NameList *for_this_font) {
- const char *name = NULL;
- NameList *nl;
- int up, ub, uc;
-
- if ( for_this_font==NULL )
- for_this_font = namelist_for_new_fonts;
- else if ( for_this_font==(NameList *) -1 )
- for_this_font = &agl;
- if ( (uni>=0 && uni<' ') ||
- (uni>=0x7f && uni<0xa0) )
- /* standard controls */;
- else if ( uni!=-1 ) {
- if ( uni>=0xe000 && uni<=0xf8ff &&
- (interp==ui_trad_chinese || for_this_font==&ams)) {
- extern const int cns14pua[], amspua[];
- const int *pua = interp==ui_trad_chinese ? cns14pua : amspua;
- if ( pua[uni-0xe000]!=0 )
- uni = pua[uni-0xe000];
- }
- up = uni>>16;
- ub = (uni&0xff00)>>8;
- uc = (uni&0xff);
- if ( up<17 )
- for ( nl=for_this_font; nl!=NULL; nl=nl->basedon ) {
- if ( nl->unicode[up]!=NULL && nl->unicode[up][ub]!=NULL &&
- (name = nl->unicode[up][ub][uc])!=NULL )
- break;
- }
- }
- if ( name==NULL ) {
- if ( uni>=0x10000 )
- sprintf( buffer, "u%04X", uni);
- else
- sprintf( buffer, "uni%04X", uni);
- name = buffer;
- }
-return( name );
-}
-
-#ifndef LUA_FF_LIB
-#define RefMax 40
-
-static int transcmp(RefChar *r1, RefChar *r2) {
- double d1, d2;
-
- if ( r1->transform[4]<r2->transform[4] )
-return( -1 );
- else if ( r1->transform[4]>r2->transform[4] )
-return( 1 );
- if ( (d1 = r1->transform[5])<0 ) d1 = -d1;
- if ( (d2 = r2->transform[5])<0 ) d2 = -d2;
- if ( d1<d2 )
-return( -1 );
- else if ( d1==d2 )
-return( 0 );
- else
-return( 1 );
-}
-
-static int FindAllRefs(SplineChar *sc,SplineChar *rsc[RefMax], int *au) {
- RefChar *refs[RefMax], *alp[RefMax], *out[RefMax];
- RefChar *ref;
- int layer, rcnt, acnt, ocnt, i,j;
- int alluni;
- /* We also order the reference. The order stored in the splinechar doesn't*/
- /* mean anything, so try and guess what is intended semantically. */
-
- if ( sc==NULL )
-return( 0 );
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer )
- if ( sc->layers[layer].splines!=NULL || sc->layers[layer].images!=NULL )
-return( 0 );
- rcnt = 0;
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- for ( ref = sc->layers[layer].refs; ref!=NULL; ref = ref->next ) {
- if ( rcnt>=RefMax )
-return( 0 );
- refs[rcnt++] = ref;
- }
- }
- alluni = true;
- for ( i=0; i<rcnt; ++i ) {
- if ( refs[i]->sc->unicodeenc==-1 ) {
- alluni = false;
- break;
- }
- }
- if ( !alluni ) {
- /* If not all unicode we can't make any guesses about meaning, so */
- /* order by transformation */
- for ( i=0; i<rcnt; ++i ) for ( j=i+1; j<rcnt; ++j ) {
- if ( transcmp(refs[i],refs[j])>0 ) {
- ref = refs[i];
- refs[i] = refs[j];
- refs[j] = ref;
- }
- }
- } else {
- acnt = 0;
- for ( i=0; i<rcnt; ++i ) {
- if ( Isalpha(refs[i]->sc->unicodeenc )) {
- alp[acnt++] = refs[i];
- --rcnt;
- for ( j=i; j<rcnt; ++j )
- refs[j] = refs[j+1];
- --i;
- }
- }
- for ( i=0; i<acnt; ++i ) for ( j=i+1; j<acnt; ++j ) {
- if ( transcmp(alp[i],alp[j])>0 ) {
- ref = alp[i];
- alp[i] = alp[j];
- alp[j] = ref;
- }
- }
- for ( i=0; i<rcnt; ++i ) for ( j=i+1; j<rcnt; ++j ) {
- if ( transcmp(refs[i],refs[j])>0 ) {
- ref = refs[i];
- refs[i] = refs[j];
- refs[j] = ref;
- }
- }
- if ( acnt!=0 ) {
- int a=0, r=0;
- real cutpoint;
- ocnt = 0;
- out[ocnt++] = alp[a++];
- forever {
- if ( a<acnt ) cutpoint = (alp[a]->transform[4]+3*alp[a-1]->transform[4])/4;
- else cutpoint = 1e30;
- while ( r<rcnt && refs[r]->transform[4]<cutpoint )
- out[ocnt++] = refs[r++];
- if ( a>=acnt )
- break;
- out[ocnt++] = alp[a++];
- }
- memcpy(refs,out,ocnt*sizeof(RefChar *));
- rcnt = ocnt;
- }
- }
- for ( i=0; i<rcnt; ++i )
- rsc[i] = refs[i]->sc;
- /* alluni now means can be written as uniXXXX.XXXX.XXXX... */
- for ( i=0; i<rcnt; ++i ) {
- if ( refs[i]->sc->unicodeenc>0x10000 ) {
- alluni = false;
- break;
- }
- }
- *au = alluni;
-return( rcnt );
-}
-
-/* Return a list of all alternate or standard glyph names for this encoding */
-char **AllGlyphNames(int uni, NameList *for_this_font, SplineChar *sc) {
- int cnt, k, j, i, len;
- NameList *nl, *nl2, *nl3;
- char **names = NULL;
- const char *name;
- int up, ub, uc;
- char buffer[40], *pt;
- SplineChar *refs[RefMax];
- int rcnt, alluni;
-
- rcnt = FindAllRefs(sc,refs,&alluni);
-
- up = uni>>16;
- ub = (uni&0xff00)>>8;
- uc = (uni&0xff);
-
- for ( k=0; k<2; ++k ) {
- cnt = 0;
- /* try the default namelist first to put that at the head of the list */
- name = NULL;
- nl = nl3 = NULL;
- if ( uni>=0 && up<17 ) {
- if ( for_this_font!=NULL ) {
- for ( nl3=for_this_font; nl3!=NULL; nl3=nl3->basedon ) {
- if ( nl3->unicode[up]!=NULL && nl3->unicode[up][ub]!=NULL &&
- (name = nl3->unicode[up][ub][uc])!=NULL )
- break;
- }
- if ( name!=NULL ) {
- if ( names )
- names[cnt] = copy(name);
- ++cnt;
- }
- }
- if ( for_this_font!=namelist_for_new_fonts ) {
- for ( nl=namelist_for_new_fonts; nl!=NULL; nl=nl->basedon ) if ( nl!=nl3 ) {
- if ( nl->unicode[up]!=NULL && nl->unicode[up][ub]!=NULL &&
- (name = nl->unicode[up][ub][uc])!=NULL )
- break;
- }
- if ( name!=NULL ) {
- if ( names )
- names[cnt] = copy(name);
- ++cnt;
- }
- }
- for ( nl2 = &agl; nl2!=NULL; nl2=nl2->next ) if ( nl2!=nl && nl2!=nl3) {
- if ( nl2->unicode[up]!=NULL && nl2->unicode[up][ub]!=NULL &&
- (name = nl2->unicode[up][ub][uc])!=NULL ) {
- if ( names )
- names[cnt] = copy(name);
- ++cnt;
- }
- }
- for ( i=0; psaltnames[i].name!=NULL ; ++i ) {
- if ( psaltnames[i].unicode==uni ) {
- if ( names )
- names[cnt] = copy(psaltnames[i].name);
- ++cnt;
- }
- }
- if ( uni<0x10000 ) {
- if ( names ) {
- sprintf( buffer, "uni%04X", uni);
- names[cnt] = copy(buffer);
- }
- ++cnt;
- }
- if ( names ) {
- sprintf( buffer, "u%04X", uni);
- names[cnt] = copy(buffer);
- }
- ++cnt;
- }
- if ( rcnt>1 && alluni && (uni<0 || (uni>=0xe000 && uni<0xf900) || uni>=0xf0000 ) ) {
- if ( names ) {
- names[cnt] = galloc(4+4*rcnt);
- strcpy(names[cnt],"uni");
- pt = names[cnt]+3;
- for ( i=0; i<rcnt; ++i ) {
- if ( refs[i]->unicodeenc==0x131 || refs[i]->unicodeenc==0x237 ||
- refs[i]->unicodeenc==0xf6be )
- sprintf( pt,"%04X", refs[i]->unicodeenc==0x131?'i':'j' );
- else
- sprintf( pt,"%04X", CanonicalCombiner(refs[i]->unicodeenc));
- pt += 4;
- }
- }
- ++cnt;
- }
- if ( rcnt>1 ) {
- if ( names ) {
- for ( i=len=0; i<rcnt; ++i )
- len += strlen( refs[i]->name )+1;
- names[cnt] = pt = galloc(len);
- for ( i=len=0; i<rcnt; ++i ) {
- strcpy(pt,refs[i]->name);
- pt += strlen(pt);
- *pt++ = '_';
- }
- pt[-1] = '\0';
- }
- ++cnt;
- }
- if ( uni<0 || up>=17 ) {
- if ( names )
- names[cnt] = copy(".notdef");
- ++cnt;
- }
- if ( k==0 ) {
- names = galloc((cnt+1)*sizeof(char *));
- names[cnt] = NULL;
- }
- }
- /* Remove any names from multiiple namelists */
- for ( i=0; i<cnt; ++i ) for ( j=i+1; j<cnt; ++j ) {
- if ( strcmp(names[i],names[j])==0 ) {
- for ( k=j+1; k<cnt; ++k )
- names[k-1] = names[k];
- names[--cnt] = NULL;
- --j;
- }
- }
-return( names );
-}
-
-
-char **AllNamelistNames(void) {
- NameList *nl;
- int cnt;
- char **names;
-
- for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt );
- names = galloc((cnt+1) *sizeof(char *));
- for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt )
- names[cnt] = copy(_(nl->title));
- names[cnt] = NULL;
-return( names );
-}
-#endif
-
-#if 0
-uint8 *AllNamelistUnicodes(void) {
- NameList *nl;
- int cnt;
- uint8 *uses;
-
- for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt );
- uses = galloc((cnt+1) *sizeof(uint8));
- for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt )
- uses[cnt] = nl->uses_unicode;
- uses[cnt] = 0xff;
-return( uses );
-}
-#endif
-
-NameList *DefaultNameListForNewFonts(void) {
-return( namelist_for_new_fonts );
-}
-
-#ifndef LUA_FF_LIB
-NameList *NameListByName(char *name) {
- NameList *nl;
- for ( nl = &agl; nl!=NULL; nl=nl->next ) {
- if ( strcmp(_(nl->title),name)==0 || strcmp(nl->title,name)==0 )
-return( nl );
- }
-return( NULL );
-}
-
-static void NameListFreeContents(NameList *nl) {
- int np, nb, nc, i;
-
- for ( np=0; np<17; ++np ) if ( nl->unicode[np]!=NULL ) {
- for ( nb=0; nb<256; ++nb ) if ( nl->unicode[np][nb]!=NULL ) {
- for ( nc=0; nc<256; ++nc ) if ( nl->unicode[np][nb][nc]!=NULL )
- free((char *)nl->unicode[np][nb][nc] );
- free( (char **) nl->unicode[np][nb]);
- }
- free( (char ***) nl->unicode[np]);
- }
- free( nl->title );
- if ( nl->renames!=NULL ) {
- for ( i=0; nl->renames[i].from!=NULL; ++i ) {
- free(nl->renames[i].from);
- free(nl->renames[i].to);
- }
- free(nl->renames);
- }
- free(nl->a_utf8_name);
-}
-
-static void NameListFree(NameList *nl) {
- NameListFreeContents(nl);
- chunkfree(nl,sizeof(NameList));
-}
-#endif
-/* ************************************************************************** */
-
-#ifndef LUA_FF_LIB
-
-#include <sys/types.h>
-#include <dirent.h>
-
-NameList *LoadNamelist(char *filename) {
- FILE *file = fopen(filename,"r");
- NameList *nl, *nl2;
- char buffer[400];
- char *pt, *end, *test;
- int uni;
- int len;
- int up, ub, uc;
- int rn_cnt=0, rn_max = 0;
- int uses_unicode = false;
-# if defined(FONTFORGE_CONFIG_GTK)
- gsize read, written;
-# endif
-
- if ( file==NULL )
-return( NULL );
-
- if ( !psnamesinited )
- psinitnames();
-
- nl = chunkalloc(sizeof(NameList));
- pt = strrchr(filename,'/');
- if ( pt==NULL ) pt = filename; else ++pt;
-# if defined(FONTFORGE_CONFIG_GTK)
- nl->title = g_filename_to_utf8(pt,-1,&read,&written,NULL);
-# else
- nl->title = def2utf8_copy(pt);
-# endif
- pt = strrchr(nl->title,'.');
- if ( pt!=NULL ) *pt = '\0';
-
- while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
- if ( buffer[0]=='#' || buffer[0]=='\n' || buffer[0]=='\r' )
- continue;
- len = strlen( buffer );
- if ( buffer[len-1]=='\n' ) buffer[--len] = '\0';
- if ( buffer[len-1]=='\r' ) buffer[--len] = '\0';
- if ( strncmp(buffer,"Based:",6)==0 ) {
- for ( pt=buffer+6; *pt==' ' || *pt=='\t'; ++pt);
- for ( nl2 = &agl; nl2!=NULL; nl2 = nl2->next )
- if ( strcmp( nl2->title,pt )==0 )
- break;
- if ( nl2==NULL ) {
- gwwv_post_error(_("NameList base missing"),_("NameList %s based on %s which could not be found"), nl->title, pt );
- NameListFree(nl);
-return( NULL );
- } else if ( nl->basedon!=NULL ) {
- gwwv_post_error(_("NameList based twice"),_("NameList %s based on two NameLists"), nl->title );
- NameListFree(nl);
-return( NULL );
- }
- nl->basedon = nl2;
- } else if ( strncmp(buffer,"Rename:",7)==0 ) {
- for ( pt=buffer+7; *pt==' ' || *pt=='\t'; ++pt);
- for ( test=pt; *test!=' ' && *test!='\t' && *test!='\0'; ++test );
- if ( *test=='\0' ) {
- gwwv_post_error(_("NameList parsing error"),_("Missing rename \"to\" name %s\n%s"), nl->title, buffer );
- NameListFree(nl);
-return( NULL );
- }
- *test='\0';
- for ( ++test; *test==' ' || *test=='\t'; ++test);
- if ( (test[0]=='-' || test[0]=='=') && test[1]=='>' )
- for ( test+=2; *test==' ' || *test=='\t'; ++test);
- if ( *test=='\0' ) {
- gwwv_post_error(_("NameList parsing error"),_("Missing rename \"to\" name %s\n%s"), nl->title, buffer );
- NameListFree(nl);
-return( NULL );
- }
- if ( rn_cnt>=rn_max-1 )
- nl->renames = grealloc(nl->renames,(rn_max+=20)*sizeof(struct renames));
- nl->renames[rn_cnt].from = copy(pt);
- nl->renames[rn_cnt].to = copy(test);
- nl->renames[++rn_cnt].from = NULL; /* End mark */
- } else {
- pt = buffer;
- if ( *pt=='0' && (pt[1]=='x' || pt[1]=='X'))
- pt += 2;
- else if (( *pt=='u' || *pt=='U') && pt[1]=='+' )
- pt += 2;
- uni = strtol(pt,&end,16);
- if ( end==pt || uni<0 || uni>=unicode4_size ) {
- gwwv_post_error(_("NameList parsing error"),_("Bad unicode value when parsing %s\n%s"), nl->title, buffer );
- NameListFree(nl);
-return( NULL );
- }
- pt = end;
- while ( *pt==' ' || *pt==';' || *pt=='\t' ) ++pt;
- if ( *pt=='\0' ) {
- gwwv_post_error(_("NameList parsing error"),_("Missing name when parsing %s for unicode %x"), nl->title, uni );
- NameListFree(nl);
-return( NULL );
- }
- for ( test=pt; *test; ++test ) {
- if ( (*test<=' ' && *test>=0) ||
- *test=='(' || *test=='[' || *test=='{' || *test=='<' ||
- *test==')' || *test==']' || *test=='}' || *test=='>' ||
- *test=='%' || *test=='/' ) {
- gwwv_post_error(_("NameList parsing error"),_("Bad name when parsing %s for unicode %x"), nl->title, uni );
- NameListFree(nl);
-return( NULL );
- }
- if ( *test&0x80 ) {
- uses_unicode = true;
- if ( nl->a_utf8_name==NULL )
- nl->a_utf8_name = copy(pt);
- }
- }
- up = uni>>16;
- ub = (uni&0xff00)>>8;
- uc = uni&0xff;
- if ( nl->unicode[up]==NULL )
- nl->unicode[up] = gcalloc(256,sizeof(char **));
- if ( nl->unicode[up][ub]==NULL )
- nl->unicode[up][ub] = gcalloc(256,sizeof(char *));
- if ( nl->unicode[up][ub][uc]==NULL )
- nl->unicode[up][ub][uc]=copy(pt);
- else {
- gwwv_post_error(_("NameList parsing error"),_("Multiple names when parsing %s for unicode %x"), nl->title, uni );
- NameListFree(nl);
-return( NULL );
- }
- }
- }
-
- nl->uses_unicode = uses_unicode;
- if ( nl->basedon!=NULL && nl->basedon->uses_unicode )
- nl->uses_unicode = true;
- fclose(file);
- for ( nl2 = &agl; nl2->next!=NULL; nl2=nl2->next ) {
- if ( strcmp(nl2->title,nl->title)==0 ) { /* Replace old version */
- NameList *next = nl2->next;
- NameListFreeContents(nl2);
- *nl2 = *nl;
- nl2->next = next;
- chunkfree(nl,sizeof(NameList));
- psreinitnames();
-return( nl2 );
- }
- }
- NameListHash(nl);
- nl2->next = nl;
-return( nl );
-}
-
-static int isnamelist(char *filename) {
- char *pt;
-
- pt = strrchr(filename,'.');
- if ( pt==NULL )
-return( false );
- if ( strcmp(pt,".nam")==0 )
-return( true );
-
-return( false );
-}
-
-void LoadNamelistDir(char *dir) {
- char prefdir[1024];
- DIR *diro;
- struct dirent *ent;
- char buffer[1025];
-
- if ( dir == NULL )
- dir = getPfaEditDir(prefdir);
- if ( dir == NULL )
-return;
-
- diro = opendir(dir);
- if ( diro==NULL ) /* It's ok not to have any */
-return;
-
- while ( (ent = readdir(diro))!=NULL ) {
- if ( isnamelist(ent->d_name) ) {
- sprintf( buffer, "%s/%s", dir, ent->d_name );
- LoadNamelist(buffer);
- }
- }
- closedir(diro);
-}
-#endif
-
-#ifndef LUA_FF_LIB
-/* ************************************************************************** */
-const char *RenameGlyphToNamelist(char *buffer, SplineChar *sc,NameList *old,NameList *new) {
- int i, up, ub, uc, ch;
- char space[80]; /* glyph names are supposed to be less<=31 chars */
- char tempbuf[32];
- char *pt, *start, *opt, *oend; const char *newsubname;
- SplineChar *tempsc;
- NameList *nl;
-
- if ( sc->unicodeenc!=-1 ) {
- up = sc->unicodeenc>>16;
- ub = (sc->unicodeenc>>8)&0xff;
- uc = (sc->unicodeenc&0xff);
- for ( nl=new; nl!=NULL; nl=nl->basedon )
- if ( nl->unicode[up]!=NULL && nl->unicode[up][ub]!=NULL && nl->unicode[up][ub][uc]!=NULL )
-return( nl->unicode[up][ub][uc] );
- if ( up==0 )
- sprintf( buffer, "uni%04X", sc->unicodeenc );
- else
- sprintf( buffer, "u%04X", sc->unicodeenc );
-return( buffer );
- } else {
- if ( old!=NULL && old->renames!=NULL ) {
- for ( i=0; old->renames[i].from!=NULL; ++i )
- if ( strcmp(sc->name,old->renames[i].from)==0 )
-return( old->renames[i].to );
- }
- if ( new->renames!=NULL ) {
- for ( i=0; new->renames[i].from!=NULL; ++i )
- if ( strcmp(sc->name,new->renames[i].to)==0 )
-return( new->renames[i].from );
- }
- if ( strlen(sc->name)>sizeof(space)-1 )
-return( sc->name );
- strcpy(space,sc->name);
- opt = buffer; oend = buffer+31;
- start = space;
- /* Check for composite names f_i, A.small */
- while ( *start ) {
- for ( pt=start; *pt!='\0' && *pt!='.' && *pt!='_'; ++pt );
- if ( *pt=='\0' && start==space )
-return( sc->name );
- ch = *pt;
- *pt = '\0';
- tempsc = SFGetChar(sc->parent,-1,start);
- if ( tempsc==NULL )
-return( sc->name );
- newsubname = RenameGlyphToNamelist(tempbuf,tempsc,old,new);
- while ( opt<oend && *newsubname )
- *opt++ = *newsubname++;
- if ( *newsubname )
-return( sc->name );
- if ( ch=='\0' ) {
- *opt = '\0';
-return( buffer );
- } else if ( ch=='.' ) {
- /* don't attempt to translate anything after a '.' just copy that litterally */
- while ( opt<oend && *pt )
- *opt++ = *pt++;
- if ( *pt )
-return( sc->name );
- *opt = '\0';
-return( buffer );
- } else { /* _ */
- *opt++ = '_';
- start = pt+1;
- }
- }
- *opt = '\0';
-return( buffer );
- }
-}
-
-void SFRenameGlyphsToNamelist(SplineFont *sf,NameList *new) {
- int gid;
- char buffer[40]; const char *name;
- SplineChar *sc;
-
- if ( new==NULL )
-return;
-
- for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
- name = RenameGlyphToNamelist(buffer,sc,sf->for_new_glyphs,new);
- if ( name!=sc->name ) {
- free(sc->name);
- sc->name = copy(name);
- }
- }
- sf->for_new_glyphs = new;
-}
-
-
-char **SFTemporaryRenameGlyphsToNamelist(SplineFont *sf,NameList *new) {
- int gid;
- char buffer[40]; const char *name;
- SplineChar *sc;
- char **ret;
-
- if ( new==NULL )
-return( NULL );
-
- ret = gcalloc(sf->glyphcnt,sizeof(char *));
- for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
- name = RenameGlyphToNamelist(buffer,sc,sf->for_new_glyphs,new);
- if ( name!=sc->name ) {
- ret[gid] = sc->name;
- sc->name = copy(name);
- }
- }
-return( ret );
-}
-
-void SFTemporaryRestoreGlyphNames(SplineFont *sf,char **former) {
- int gid;
- SplineChar *sc;
-
- for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
- if ( former[gid]!=NULL ) {
- free(sc->name);
- sc->name = former[gid];
- }
- }
- free(former);
-}
-
-#endif
-/* ************************************************************************** */
-static const char *agl_sans_p0_b0[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "space",
- "exclam",
- "quotedbl",
- "numbersign",
- "dollar",
- "percent",
- "ampersand",
- "quotesingle",
- "parenleft",
- "parenright",
- "asterisk",
- "plus",
- "comma",
- "hyphen",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
- "equal",
- "greater",
- "question",
- "at",
- "A",
- "B",
- "C",
- "D",
- "E",
- "F",
- "G",
- "H",
- "I",
- "J",
- "K",
- "L",
- "M",
- "N",
- "O",
- "P",
- "Q",
- "R",
- "S",
- "T",
- "U",
- "V",
- "W",
- "X",
- "Y",
- "Z",
- "bracketleft",
- "backslash",
- "bracketright",
- "asciicircum",
- "underscore",
- "grave",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "braceleft",
- "bar",
- "braceright",
- "asciitilde",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "exclamdown",
- "cent",
- "sterling",
- "currency",
- "yen",
- "brokenbar",
- "section",
- "dieresis",
- "copyright",
- "ordfeminine",
- "guillemotleft",
- "logicalnot",
- NULL,
- "registered",
- "macron",
- "degree",
- "plusminus",
- NULL,
- NULL,
- "acute",
- NULL,
- "paragraph",
- "periodcentered",
- "cedilla",
- NULL,
- "ordmasculine",
- "guillemotright",
- "onequarter",
- "onehalf",
- "threequarters",
- "questiondown",
- "Agrave",
- "Aacute",
- "Acircumflex",
- "Atilde",
- "Adieresis",
- "Aring",
- "AE",
- "Ccedilla",
- "Egrave",
- "Eacute",
- "Ecircumflex",
- "Edieresis",
- "Igrave",
- "Iacute",
- "Icircumflex",
- "Idieresis",
- "Eth",
- "Ntilde",
- "Ograve",
- "Oacute",
- "Ocircumflex",
- "Otilde",
- "Odieresis",
- "multiply",
- "Oslash",
- "Ugrave",
- "Uacute",
- "Ucircumflex",
- "Udieresis",
- "Yacute",
- "Thorn",
- "germandbls",
- "agrave",
- "aacute",
- "acircumflex",
- "atilde",
- "adieresis",
- "aring",
- "ae",
- "ccedilla",
- "egrave",
- "eacute",
- "ecircumflex",
- "edieresis",
- "igrave",
- "iacute",
- "icircumflex",
- "idieresis",
- "eth",
- "ntilde",
- "ograve",
- "oacute",
- "ocircumflex",
- "otilde",
- "odieresis",
- "divide",
- "oslash",
- "ugrave",
- "uacute",
- "ucircumflex",
- "udieresis",
- "yacute",
- "thorn",
- "ydieresis"
-};
-
-static const char *agl_sans_p0_b1[] = {
- "Amacron",
- "amacron",
- "Abreve",
- "abreve",
- "Aogonek",
- "aogonek",
- "Cacute",
- "cacute",
- "Ccircumflex",
- "ccircumflex",
- "Cdotaccent",
- "cdotaccent",
- "Ccaron",
- "ccaron",
- "Dcaron",
- "dcaron",
- "Dcroat",
- "dcroat",
- "Emacron",
- "emacron",
- "Ebreve",
- "ebreve",
- "Edotaccent",
- "edotaccent",
- "Eogonek",
- "eogonek",
- "Ecaron",
- "ecaron",
- "Gcircumflex",
- "gcircumflex",
- "Gbreve",
- "gbreve",
- "Gdotaccent",
- "gdotaccent",
- "Gcommaaccent",
- "gcommaaccent",
- "Hcircumflex",
- "hcircumflex",
- "Hbar",
- "hbar",
- "Itilde",
- "itilde",
- "Imacron",
- "imacron",
- "Ibreve",
- "ibreve",
- "Iogonek",
- "iogonek",
- "Idotaccent",
- "dotlessi",
- "IJ",
- "ij",
- "Jcircumflex",
- "jcircumflex",
- "Kcommaaccent",
- "kcommaaccent",
- "kgreenlandic",
- "Lacute",
- "lacute",
- "Lcommaaccent",
- "lcommaaccent",
- "Lcaron",
- "lcaron",
- "Ldot",
- "ldot",
- "Lslash",
- "lslash",
- "Nacute",
- "nacute",
- "Ncommaaccent",
- "ncommaaccent",
- "Ncaron",
- "ncaron",
- "napostrophe",
- "Eng",
- "eng",
- "Omacron",
- "omacron",
- "Obreve",
- "obreve",
- "Ohungarumlaut",
- "ohungarumlaut",
- "OE",
- "oe",
- "Racute",
- "racute",
- "Rcommaaccent",
- "rcommaaccent",
- "Rcaron",
- "rcaron",
- "Sacute",
- "sacute",
- "Scircumflex",
- "scircumflex",
- "Scedilla",
- "scedilla",
- "Scaron",
- "scaron",
- NULL,
- NULL,
- "Tcaron",
- "tcaron",
- "Tbar",
- "tbar",
- "Utilde",
- "utilde",
- "Umacron",
- "umacron",
- "Ubreve",
- "ubreve",
- "Uring",
- "uring",
- "Uhungarumlaut",
- "uhungarumlaut",
- "Uogonek",
- "uogonek",
- "Wcircumflex",
- "wcircumflex",
- "Ycircumflex",
- "ycircumflex",
- "Ydieresis",
- "Zacute",
- "zacute",
- "Zdotaccent",
- "zdotaccent",
- "Zcaron",
- "zcaron",
- "longs",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "florin",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Ohorn",
- "ohorn",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Uhorn",
- "uhorn",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Gcaron",
- "gcaron",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Aringacute",
- "aringacute",
- "AEacute",
- "aeacute",
- "Oslashacute",
- "oslashacute"
-};
-
-static const char *agl_sans_p0_b2[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Scommaaccent",
- "scommaaccent",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "circumflex",
- "caron",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "breve",
- "dotaccent",
- "ring",
- "ogonek",
- "tilde",
- "hungarumlaut",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b3[] = {
- "gravecomb",
- "acutecomb",
- NULL,
- "tildecomb",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "hookabovecomb",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "dotbelowcomb",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "tonos",
- "dieresistonos",
- "Alphatonos",
- "anoteleia",
- "Epsilontonos",
- "Etatonos",
- "Iotatonos",
- NULL,
- "Omicrontonos",
- NULL,
- "Upsilontonos",
- "Omegatonos",
- "iotadieresistonos",
- "Alpha",
- "Beta",
- "Gamma",
- "Delta",
- "Epsilon",
- "Zeta",
- "Eta",
- "Theta",
- "Iota",
- "Kappa",
- "Lambda",
- "Mu",
- "Nu",
- "Xi",
- "Omicron",
- "Pi",
- "Rho",
- NULL,
- "Sigma",
- "Tau",
- "Upsilon",
- "Phi",
- "Chi",
- "Psi",
- "Omega",
- "Iotadieresis",
- "Upsilondieresis",
- "alphatonos",
- "epsilontonos",
- "etatonos",
- "iotatonos",
- "upsilondieresistonos",
- "alpha",
- "beta",
- "gamma",
- "delta",
- "epsilon",
- "zeta",
- "eta",
- "theta",
- "iota",
- "kappa",
- "lambda",
- "mu",
- "nu",
- "xi",
- "omicron",
- "pi",
- "rho",
- "sigma1",
- "sigma",
- "tau",
- "upsilon",
- "phi",
- "chi",
- "psi",
- "omega",
- "iotadieresis",
- "upsilondieresis",
- "omicrontonos",
- "upsilontonos",
- "omegatonos",
- NULL,
- NULL,
- "theta1",
- "Upsilon1",
- NULL,
- NULL,
- "phi1",
- "omega1",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b1e[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Wgrave",
- "wgrave",
- "Wacute",
- "wacute",
- "Wdieresis",
- "wdieresis",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Ygrave",
- "ygrave",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b20[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "figuredash",
- "endash",
- "emdash",
- NULL,
- NULL,
- "underscoredbl",
- "quoteleft",
- "quoteright",
- "quotesinglbase",
- "quotereversed",
- "quotedblleft",
- "quotedblright",
- "quotedblbase",
- NULL,
- "dagger",
- "daggerdbl",
- "bullet",
- NULL,
- "onedotenleader",
- "twodotenleader",
- "ellipsis",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "perthousand",
- NULL,
- "minute",
- "second",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "guilsinglleft",
- "guilsinglright",
- NULL,
- "exclamdbl",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "fraction",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "colonmonetary",
- NULL,
- "franc",
- "lira",
- NULL,
- NULL,
- "peseta",
- NULL,
- NULL,
- NULL,
- "dong",
- "Euro",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b21[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Ifraktur",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "weierstrass",
- NULL,
- NULL,
- NULL,
- "Rfraktur",
- NULL,
- "prescription",
- NULL,
- NULL,
- NULL,
- "trademark",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "estimated",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "aleph",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "onethird",
- "twothirds",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "oneeighth",
- "threeeighths",
- "fiveeighths",
- "seveneighths",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "arrowleft",
- "arrowup",
- "arrowright",
- "arrowdown",
- "arrowboth",
- "arrowupdn",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "arrowupdnbse",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "carriagereturn",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "arrowdblleft",
- "arrowdblup",
- "arrowdblright",
- "arrowdbldown",
- "arrowdblboth",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b22[] = {
- "universal",
- NULL,
- "partialdiff",
- "existential",
- NULL,
- "emptyset",
- NULL,
- "gradient",
- "element",
- "notelement",
- NULL,
- "suchthat",
- NULL,
- NULL,
- NULL,
- "product",
- NULL,
- "summation",
- "minus",
- NULL,
- NULL,
- NULL,
- NULL,
- "asteriskmath",
- NULL,
- NULL,
- "radical",
- NULL,
- NULL,
- "proportional",
- "infinity",
- "orthogonal",
- "angle",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "logicaland",
- "logicalor",
- "intersection",
- "union",
- "integral",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "therefore",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "similar",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "congruent",
- NULL,
- NULL,
- "approxequal",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "notequal",
- "equivalence",
- NULL,
- NULL,
- "lessequal",
- "greaterequal",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "propersubset",
- "propersuperset",
- "notsubset",
- NULL,
- "reflexsubset",
- "reflexsuperset",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "circleplus",
- NULL,
- "circlemultiply",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "perpendicular",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "dotmath",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b23[] = {
- NULL,
- NULL,
- "house",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "revlogicalnot",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "integraltp",
- "integralbt",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "angleleft",
- "angleright",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b25[] = {
- "SF100000",
- NULL,
- "SF110000",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "SF010000",
- NULL,
- NULL,
- NULL,
- "SF030000",
- NULL,
- NULL,
- NULL,
- "SF020000",
- NULL,
- NULL,
- NULL,
- "SF040000",
- NULL,
- NULL,
- NULL,
- "SF080000",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "SF090000",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "SF060000",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "SF070000",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "SF050000",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "SF430000",
- "SF240000",
- "SF510000",
- "SF520000",
- "SF390000",
- "SF220000",
- "SF210000",
- "SF250000",
- "SF500000",
- "SF490000",
- "SF380000",
- "SF280000",
- "SF270000",
- "SF260000",
- "SF360000",
- "SF370000",
- "SF420000",
- "SF190000",
- "SF200000",
- "SF230000",
- "SF470000",
- "SF480000",
- "SF410000",
- "SF450000",
- "SF460000",
- "SF400000",
- "SF540000",
- "SF530000",
- "SF440000",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "upblock",
- NULL,
- NULL,
- NULL,
- "dnblock",
- NULL,
- NULL,
- NULL,
- "block",
- NULL,
- NULL,
- NULL,
- "lfblock",
- NULL,
- NULL,
- NULL,
- "rtblock",
- "ltshade",
- "shade",
- "dkshade",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "filledbox",
- "H22073",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "H18543",
- "H18551",
- "filledrect",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "triagup",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "triagrt",
- NULL,
- "triagdn",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "triaglf",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "lozenge",
- "circle",
- NULL,
- NULL,
- NULL,
- "H18533",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "invbullet",
- "invcircle",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "openbullet",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_sans_p0_b26[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "smileface",
- "invsmileface",
- "sun",
- NULL,
- NULL,
- NULL,
- "female",
- NULL,
- "male",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "spade",
- NULL,
- NULL,
- "club",
- NULL,
- "heart",
- "diamond",
- NULL,
- NULL,
- NULL,
- "musicalnote",
- "musicalnotedbl",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char **agl_sans_p0[] = {
- agl_sans_p0_b0,
- agl_sans_p0_b1,
- agl_sans_p0_b2,
- agl_sans_p0_b3,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- agl_sans_p0_b1e,
- NULL,
- agl_sans_p0_b20,
- agl_sans_p0_b21,
- agl_sans_p0_b22,
- agl_sans_p0_b23,
- NULL,
- agl_sans_p0_b25,
- agl_sans_p0_b26,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static NameList agl_sans = {
- NULL,
- N_("AGL without afii"),
- { agl_sans_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-/* ************************************************************************** */
-static const char *agl_p0_b1[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Tcommaaccent",
- "tcommaaccent",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_p0_b2[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57929",
- "afii64937",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_p0_b4[] = {
- NULL,
- "afii10023",
- "afii10051",
- "afii10052",
- "afii10053",
- "afii10054",
- "afii10055",
- "afii10056",
- "afii10057",
- "afii10058",
- "afii10059",
- "afii10060",
- "afii10061",
- NULL,
- "afii10062",
- "afii10145",
- "afii10017",
- "afii10018",
- "afii10019",
- "afii10020",
- "afii10021",
- "afii10022",
- "afii10024",
- "afii10025",
- "afii10026",
- "afii10027",
- "afii10028",
- "afii10029",
- "afii10030",
- "afii10031",
- "afii10032",
- "afii10033",
- "afii10034",
- "afii10035",
- "afii10036",
- "afii10037",
- "afii10038",
- "afii10039",
- "afii10040",
- "afii10041",
- "afii10042",
- "afii10043",
- "afii10044",
- "afii10045",
- "afii10046",
- "afii10047",
- "afii10048",
- "afii10049",
- "afii10065",
- "afii10066",
- "afii10067",
- "afii10068",
- "afii10069",
- "afii10070",
- "afii10072",
- "afii10073",
- "afii10074",
- "afii10075",
- "afii10076",
- "afii10077",
- "afii10078",
- "afii10079",
- "afii10080",
- "afii10081",
- "afii10082",
- "afii10083",
- "afii10084",
- "afii10085",
- "afii10086",
- "afii10087",
- "afii10088",
- "afii10089",
- "afii10090",
- "afii10091",
- "afii10092",
- "afii10093",
- "afii10094",
- "afii10095",
- "afii10096",
- "afii10097",
- NULL,
- "afii10071",
- "afii10099",
- "afii10100",
- "afii10101",
- "afii10102",
- "afii10103",
- "afii10104",
- "afii10105",
- "afii10106",
- "afii10107",
- "afii10108",
- "afii10109",
- NULL,
- "afii10110",
- "afii10193",
- NULL,
- NULL,
- "afii10146",
- "afii10194",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii10147",
- "afii10195",
- "afii10148",
- "afii10196",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii10050",
- "afii10098",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii10846",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_p0_b5[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57799",
- "afii57801",
- "afii57800",
- "afii57802",
- "afii57793",
- "afii57794",
- "afii57795",
- "afii57798",
- "afii57797",
- "afii57806",
- NULL,
- "afii57796",
- "afii57807",
- "afii57839",
- "afii57645",
- "afii57841",
- "afii57842",
- "afii57804",
- "afii57803",
- "afii57658",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57664",
- "afii57665",
- "afii57666",
- "afii57667",
- "afii57668",
- "afii57669",
- "afii57670",
- "afii57671",
- "afii57672",
- "afii57673",
- "afii57674",
- "afii57675",
- "afii57676",
- "afii57677",
- "afii57678",
- "afii57679",
- "afii57680",
- "afii57681",
- "afii57682",
- "afii57683",
- "afii57684",
- "afii57685",
- "afii57686",
- "afii57687",
- "afii57688",
- "afii57689",
- "afii57690",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57716",
- "afii57717",
- "afii57718",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_p0_b6[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57388",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57403",
- NULL,
- NULL,
- NULL,
- "afii57407",
- NULL,
- "afii57409",
- "afii57410",
- "afii57411",
- "afii57412",
- "afii57413",
- "afii57414",
- "afii57415",
- "afii57416",
- "afii57417",
- "afii57418",
- "afii57419",
- "afii57420",
- "afii57421",
- "afii57422",
- "afii57423",
- "afii57424",
- "afii57425",
- "afii57426",
- "afii57427",
- "afii57428",
- "afii57429",
- "afii57430",
- "afii57431",
- "afii57432",
- "afii57433",
- "afii57434",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57440",
- "afii57441",
- "afii57442",
- "afii57443",
- "afii57444",
- "afii57445",
- "afii57446",
- "afii57470",
- "afii57448",
- "afii57449",
- "afii57450",
- "afii57451",
- "afii57452",
- "afii57453",
- "afii57454",
- "afii57455",
- "afii57456",
- "afii57457",
- "afii57458",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57392",
- "afii57393",
- "afii57394",
- "afii57395",
- "afii57396",
- "afii57397",
- "afii57398",
- "afii57399",
- "afii57400",
- "afii57401",
- "afii57381",
- NULL,
- NULL,
- "afii63167",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57511",
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57506",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57507",
- NULL,
- "afii57512",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57513",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57508",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57505",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57509",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57514",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57519",
- NULL,
- NULL,
- "afii57534",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_p0_b20[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii61664",
- "afii301",
- "afii299",
- "afii300",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii00208",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii61573",
- "afii61574",
- "afii61575",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii57636",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *agl_p0_b21[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii61248",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii61289",
- NULL,
- NULL,
- "afii61352",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char **agl_p0[] = {
- NULL,
- agl_p0_b1,
- agl_p0_b2,
- NULL,
- agl_p0_b4,
- agl_p0_b5,
- agl_p0_b6,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- agl_p0_b20,
- agl_p0_b21,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static NameList agl = {
- &agl_sans,
- N_("Adobe Glyph List"),
- { agl_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-/* ************************************************************************** */
-static const char *adobepua_p0_bf6[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "perthousand.oldstyle",
- "cent.denominator",
- "dollar.denominator",
- "hyphen.denominator",
- "parenleft.denominator",
- "parenright.denominator",
- "cent.numerator",
- "dollar.numerator",
- "hyphen.numerator",
- "parenleft.numerator",
- "parenright.numerator",
- "at.cap",
- "commaaccent.cap",
- "commaaccent.small",
- "pi.math",
- "h.superior",
- "zero.slash",
- "zero.fitted",
- "two.fitted",
- "three.fitted",
- "four.fitted",
- "five.fitted",
- "six.fitted",
- "seven.fitted",
- "eight.fitted",
- "nine.fitted",
- "percent.oldstyle",
- "zero.taboldstyle",
- "one.taboldstyle",
- "two.taboldstyle",
- "three.taboldstyle",
- "four.taboldstyle",
- "five.taboldstyle",
- "six.taboldstyle",
- "seven.taboldstyle",
- "eight.taboldstyle",
- "nine.taboldstyle",
- "colonmonetary.taboldstyle",
- "Euro.taboldstyle",
- "florin.taboldstyle",
- "numbersign.taboldstyle",
- "sterling.taboldstyle",
- "yen.taboldstyle",
- "dollar.taboldstyle",
- "cent.taboldstyle",
- "zero.denominator",
- "one.denominator",
- "two.denominator",
- "three.denominator",
- "four.denominator",
- "five.denominator",
- "six.denominator",
- "seven.denominator",
- "eight.denominator",
- "nine.denominator",
- "comma.denominator",
- "period.denominator",
- "zero.numerator",
- "one.numerator",
- "two.numerator",
- "three.numerator",
- "four.numerator",
- "five.numerator",
- "six.numerator",
- "seven.numerator",
- "eight.numerator",
- "nine.numerator",
- "comma.numerator",
- "period.numerator",
- "Abreve.small",
- "Amacron.small",
- "Aogonek.small",
- "AEacute.small",
- "Cacute.small",
- "Ccaron.small",
- "Ccircumflex.small",
- "Cdotaccent.small",
- "Dcaron.small",
- "Dcroat.small",
- "Ebreve.small",
- "Ecaron.small",
- "Edotaccent.small",
- "Emacron.small",
- "Eng.small",
- "Eogonek.small",
- "Gbreve.small",
- "Gcircumflex.small",
- "Gcommaaccent.small",
- "Gdotaccent.small",
- "Hbar.small",
- "Hcircumflex.small",
- "Ibreve.small",
- "IJ.small",
- "Imacron.small",
- "Iogonek.small",
- "Itilde.small",
- "Jcircumflex.small",
- "Kcommaaccent.small",
- "Lacute.small",
- "Lcaron.small",
- "Lcommaaccent.small",
- "Ldot.small",
- "Nacute.small",
- "Ncaron.small",
- "Ncommaaccent.small",
- "Obreve.small",
- "Ohungarumlaut.small",
- "Omacron.small",
- "Oslashacute.small",
- "Racute.small",
- "Rcaron.small",
- "Rcommaaccent.small",
- "Sacute.small",
- "Scedilla.small",
- "Scircumflex.small",
- "Scommaaccent.small",
- "Tbar.small",
- "Tcaron.small",
- "Tcommaaccent.small",
- "Ubreve.small",
- "Uhungarumlaut.small",
- "Umacron.small",
- "Uogonek.small",
- "Uring.small",
- "Utilde.small",
- "Wacute.small",
- "Wcircumflex.small",
- "Wdieresis.small",
- "Wgrave.small",
- "Ycircumflex.small",
- "Ygrave.small",
- "Zacute.small",
- "Zdotaccent.small",
- "Idotaccent.small",
- "parenleft.cap",
- "parenright.cap",
- "bracketleft.cap",
- "bracketright.cap",
- "braceleft.cap",
- "braceright.cap",
- "exclamdown.cap",
- "questiondown.cap",
- "guillemotleft.cap",
- "guillemotright.cap",
- "guilsinglleft.cap",
- "guilsinglright.cap",
- "hyphen.cap",
- "endash.cap",
- "emdash.cap",
- "periodcentered.cap",
- "j.dotless",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "afii10068.ital",
- "afii10066.ital",
- "afii10069.ital",
- "afii10081.ital",
- "afii10084.ital",
- "acute.cap",
- "caron.cap",
- "dieresis.cap",
- "space_uni0308_uni0301.cap",
- "space_uni0308_uni0300.cap",
- "grave.cap",
- "hungarumlaut.cap",
- "macron.cap",
- "breve.cyrcap",
- "circumflex.cyrcap",
- "space_uni030F.cap",
- "breve.cyr",
- "circumflex.cyr",
- "space_uni030F",
- "space_uni0308_uni0301",
- "space_uni0308_uni0300",
- "copyright.serif",
- "registered.serif",
- "trademark.serif",
- "one.fitted",
- "R_p",
- "uni2014.alt",
- "cent.inferior",
- "cent.superior",
- "comma.inferior",
- "comma.superior",
- "dollar.inferior",
- "dollar.superior",
- "hyphen.inferior",
- "hyphen.superior",
- "period.inferior",
- "period.superior",
- "a.superior",
- "b.superior",
- "d.superior",
- "e.superior",
- "i.superior",
- "l.superior",
- "m.superior",
- "o.superior",
- "r.superior",
- "s.superior",
- "t.superior",
- "breve.sc",
- "caron.sc",
- "circumflex.sc",
- "dotaccent.sc",
- "hungarumlaut.sc",
- "lslash.sc",
- "oe.sc",
- "ogonek.sc",
- "ring.sc",
- "scaron.sc",
- "tilde.sc",
- "zcaron.sc"
-};
-
-static const char *adobepua_p0_bf7[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "exclam.sc",
- NULL,
- NULL,
- "dollar.oldstyle",
- NULL,
- "ampersand.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "zero.oldstyle",
- "one.oldstyle",
- "two.oldstyle",
- "three.oldstyle",
- "four.oldstyle",
- "five.oldstyle",
- "six.oldstyle",
- "seven.oldstyle",
- "eight.oldstyle",
- "nine.oldstyle",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "question.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "grave.sc",
- "a.sc",
- "b.sc",
- "c.sc",
- "d.sc",
- "e.sc",
- "f.sc",
- "g.sc",
- "h.sc",
- "i.sc",
- "j.sc",
- "k.sc",
- "l.sc",
- "m.sc",
- "n.sc",
- "o.sc",
- "p.sc",
- "q.sc",
- "r.sc",
- "s.sc",
- "t.sc",
- "u.sc",
- "v.sc",
- "w.sc",
- "x.sc",
- "y.sc",
- "z.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "exclamdown.sc",
- "cent.oldstyle",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "dieresis.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "macron.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- "acute.sc",
- NULL,
- NULL,
- NULL,
- "cedilla.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "questiondown.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "agrave.sc",
- "aacute.sc",
- "acircumflex.sc",
- "atilde.sc",
- "adieresis.sc",
- "aring.sc",
- "ae.sc",
- "ccedilla.sc",
- "egrave.sc",
- "eacute.sc",
- "ecircumflex.sc",
- "edieresis.sc",
- "igrave.sc",
- "iacute.sc",
- "icircumflex.sc",
- "idieresis.sc",
- "eth.sc",
- "ntilde.sc",
- "ograve.sc",
- "oacute.sc",
- "ocircumflex.sc",
- "otilde.sc",
- "odieresis.sc",
- NULL,
- "oslash.sc",
- "ugrave.sc",
- "uacute.sc",
- "ucircumflex.sc",
- "udieresis.sc",
- "yacute.sc",
- "thorn.sc",
- "ydieresis.sc"
-};
-
-static const char *adobepua_p0_bf8[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "registered.sans",
- "copyright.sans",
- "trademark.sans",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *adobepua_p0_bfb[] = {
- "f_f",
- "f_i",
- "f_l",
- "f_f_i",
- "f_f_l",
- "longs_t",
- "s_t",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char **adobepua_p0[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- adobepua_p0_bf6,
- adobepua_p0_bf7,
- adobepua_p0_bf8,
- NULL,
- NULL,
- adobepua_p0_bfb,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static NameList adobepua = {
- &agl,
- N_("AGL with PUA"),
- { adobepua_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-/* ************************************************************************** */
-static const char *greeksc_p0_bf5[] = {
- "alpha.sc",
- "beta.sc",
- "gamma.sc",
- "delta.sc",
- "epsilon.sc",
- "zeta.sc",
- "eta.sc",
- "theta.sc",
- "iota.sc",
- "kappa.sc",
- "lambda.sc",
- "mu.sc",
- "nu.sc",
- "xi.sc",
- "omicron.sc",
- "pi.sc",
- "rho.sc",
- NULL,
- "sigma.sc",
- "tau.sc",
- "upsilon.sc",
- "phi.sc",
- "chi.sc",
- "psi.sc",
- "omega.sc",
- "iotadieresis.sc",
- "upsilondieresis.sc",
- "alphaiota.sc",
- "etaiota.sc",
- "omegaiota.sc",
- "prosgegrammeni.sc",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char **greeksc_p0[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- greeksc_p0_bf5,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static NameList greeksc = {
- &adobepua,
- N_("Greek small caps"),
- { greeksc_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-/* ************************************************************************** */
-static const char *tex_p0_b20[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "closure",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "leftharpoonaccent",
- "rightharpoonaccent",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_b21[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "shortleftarrow",
- "shortuparrow",
- "shortrightarrow",
- "shortdownarrow",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "leftwavyarrow",
- "rightwavyarrow",
- NULL,
- "twoheaduparrow",
- NULL,
- "twoheaddownarrow",
- NULL,
- NULL,
- NULL,
- "mapsup",
- NULL,
- "mapsdown",
- "updownarrowbar",
- NULL,
- NULL,
- NULL,
- NULL,
- "leftrightwavyarrow",
- NULL,
- "downzigzagarrow",
- NULL,
- NULL,
- "Ldsh",
- "Rdsh",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "acwopencirclearrow",
- "cwopencirclearrow",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "updownarrows",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Nwarrow",
- "Nearrow",
- "Searrow",
- "Swarrow",
- NULL,
- NULL,
- "longleftzigzagarrow",
- "rightzigzagarrow",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "barleftarrow",
- "rightarrowbar",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "downuparrows",
- "rightthreearrows",
- "nvleftarrow",
- "nvrightarrow",
- "nvleftrightarrow",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_b22[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "ltrpar",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "difference",
- NULL,
- "ac",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "approxident",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "arceq",
- NULL,
- "veeeq",
- "stareq",
- NULL,
- "eqdef",
- "measeq",
- NULL,
- NULL,
- NULL,
- NULL,
- "Equiv",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "prurel",
- "scurel",
- NULL,
- NULL,
- NULL,
- NULL,
- "origof",
- "imageof",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "eqless",
- "eqgtr",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "disin",
- NULL,
- "isins",
- "isindot",
- NULL,
- NULL,
- "isinvb",
- "isinE",
- "nisd",
- NULL,
- "nis",
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_b23[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "invnot",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "turnednot",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "solbar",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "rangledownzigzagarrow",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_b27[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "longrightzigzagarrow"
-};
-
-static const char *tex_p0_b29[] = {
- NULL,
- NULL,
- "nvLeftarrow",
- "nvRightarrow",
- "nvLeftrightarrow",
- "twoheadmapsto",
- NULL,
- NULL,
- "downarrowbarred",
- "uparrowbarred",
- "Uuparrow",
- "Ddownarrow",
- "leftbkarrow",
- "rightbkarrow",
- "leftdbkarrow",
- NULL,
- NULL,
- "rightdotarrow",
- "baruparrow",
- "downarrowbar",
- NULL,
- NULL,
- "twoheadrightarrowtail",
- NULL,
- NULL,
- "lefttail",
- "righttail",
- "leftdbltail",
- "rightdbltail",
- "diamondleftarrow",
- "rightarrowdiamond",
- "diamondleftarrowbar",
- "barrightarrowdiamond",
- "nwsearrow",
- "neswarrow",
- "hknwarrow",
- "hknearrow",
- "hksearrow",
- "hkswarrow",
- NULL,
- NULL,
- NULL,
- NULL,
- "rdiagovfdiag",
- "fdiagovrdiag",
- "seovnearrow",
- "neovsearrow",
- "fdiagovnearrow",
- "rdiagovsearrow",
- "neovnwarrow",
- "nwovnearrow",
- "rightcurvedarrow",
- NULL,
- NULL,
- "leftdowncurvedarrow",
- "rightdowncurvedarrow",
- "cwhalfcirclearrow",
- "acwhalfcirclearrow",
- NULL,
- "acwundercurvearrow",
- "curvearrowrightminus",
- "curvearrowleftplus",
- "cwundercurvearrow",
- NULL,
- NULL,
- NULL,
- "rightarrowshortleftarrow",
- "leftarrowshortrightarrow",
- "shortrightarrowleftarrow",
- "rightarrowplus",
- "leftarrowplus",
- "rightarrowx",
- "leftrightarrowcircle",
- "twoheaduparrowcircle",
- "leftrightharpoonupdown",
- "leftrightharpoondownup",
- "updownharpoonrightleft",
- "updownharpoonleftright",
- "leftrightharpoonupup",
- "updownharpoonrightright",
- "leftrightharpoondowndown",
- "updownharpoonleftleft",
- "barleftharpoonup",
- "rightharpoonupbar",
- "barupharpoonright",
- "downharpoonrightbar",
- "barleftharpoondown",
- "rightharpoondownbar",
- "barupharpoonleft",
- "downharpoonleftbar",
- "leftharpoonupbar",
- "barrightharpoonup",
- "upharpoonrightbar",
- "bardownharpoonright",
- "leftharpoondownbar",
- "barrightharpoondown",
- "upharpoonleftbar",
- "bardownharpoonleft",
- "leftharpoonsupdown",
- "upharpoonsleftright",
- "rightharpoonsupdown",
- "downharpoonsleftright",
- "leftrightharpoonsup",
- "leftrightharpoonsdown",
- "rightleftharpoonsup",
- "rightleftharpoonsdown",
- "leftharpoonupdash",
- "dashleftharpoondown",
- "rightharpoonupdash",
- "dashrightharpoondown",
- "updownharpoonsleftright",
- "downupharpoonsleftright",
- "rightimply",
- "equalrightarrow",
- "similarrightarrow",
- "leftarrowsimilar",
- "rightarrowsimilar",
- "rightarrowapprox",
- "ltlarr",
- "leftarrowless",
- "gtrarr",
- "subrarr",
- "leftarrowsubset",
- "suplarr",
- "leftfishtail",
- "rightfishtail",
- "upfishtail",
- "downfishtail",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "rtriltri",
- "ltrivb",
- "vbrtri",
- "lfbowtie",
- "rfbowtie",
- "fbowtie",
- "lftimes",
- "rftimes",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "eqvparsl",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "ruledelayed",
- NULL,
- "dsol",
- "rsolbar",
- "xsol",
- "xbsol",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_b2a[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "congdot",
- NULL,
- NULL,
- "approxeqq",
- NULL,
- NULL,
- "eqqsim",
- "Coloneq",
- "eqeq",
- NULL,
- NULL,
- "equivDD",
- "ltcir",
- "gtcir",
- "ltquest",
- "gtquest",
- NULL,
- NULL,
- "lesdot",
- "gesdot",
- "lesdoto",
- "gesdoto",
- "lesdotor",
- "gesdotol",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "lsime",
- "gsime",
- "lsimg",
- "gsiml",
- "lgE",
- "glE",
- "lesges",
- "gesles",
- NULL,
- NULL,
- "elsdot",
- "egsdot",
- NULL,
- NULL,
- NULL,
- NULL,
- "simless",
- "simgtr",
- "simlE",
- "simgE",
- "Lt",
- "Gt",
- NULL,
- "glj",
- "gla",
- "ltcc",
- "gtcc",
- "lescc",
- "gescc",
- "smt",
- "lat",
- "smte",
- "late",
- "bumpeqq",
- NULL,
- NULL,
- NULL,
- NULL,
- "prE",
- "scE",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Pr",
- "Sc",
- "subsetdot",
- "supsetdot",
- "subsetplus",
- "supsetplus",
- "submult",
- "supmult",
- "subedot",
- "supedot",
- NULL,
- NULL,
- "subsim",
- "supsim",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "csub",
- "csup",
- "csube",
- "csupe",
- "subsup",
- "supsub",
- "subsub",
- "supsup",
- "suphsub",
- "supdsub",
- "forkv",
- "topfork",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "Barv",
- "vBar",
- "vBarv",
- "barV",
- "Vbar",
- "Not",
- "bNot",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_be2[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "rightdbkarrow",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "nrightwavyarrow",
- NULL,
- "nrightcurvedarrow",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "race",
- "acE",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_be3[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "lesg",
- "gesl",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "smtes",
- "lates",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "bsolhsub",
- "suphsol",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "congruence",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_be4[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "mostpos",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *tex_p0_be6[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "varrightfishtail",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char **tex_p0[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- tex_p0_b20,
- tex_p0_b21,
- tex_p0_b22,
- tex_p0_b23,
- NULL,
- NULL,
- NULL,
- tex_p0_b27,
- NULL,
- tex_p0_b29,
- tex_p0_b2a,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- tex_p0_be2,
- tex_p0_be3,
- tex_p0_be4,
- NULL,
- tex_p0_be6,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static NameList tex = {
- &agl,
- NU_("ΤεΧ Names"),
- { tex_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-/* ************************************************************************** */
-static const char *ams_p0_be2[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni219D0338",
- NULL,
- "uni29330338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2192.short",
- "uni2190.short",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni222AFE00",
- "uni2229FE00",
- "uni2294FE00",
- "uni2293FE00",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni223E0332.reversed",
- "uni223E0333",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2269FE00",
- NULL,
- NULL,
- "uni2268FE00",
- "uni22670338",
- "uni2A7E0338",
- "uni2A7D0338",
- "uni22660338",
- NULL,
- "uni2224.short",
- "uni2226.short",
- "uni228220D2",
- "uni228620D2",
- "uni2AC50338",
- "uni228320D2",
- "uni2AC60338",
- "uni228720D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2ACBFE00",
- "uni228AFE00",
- "uni228BFE00",
- "uni2ACCFE00",
- "uni224B0338",
- NULL,
- NULL,
- NULL,
- NULL,
- "uni226420D2",
- "uni226520D2",
- "uni003C20D2",
- "uni003E20D2",
- "uni2A6D0338",
- "uni224820D2",
- "uni2A700338",
- NULL,
- "uni2AA120D2",
- "uni2AA220D2",
- "uni226A0338",
- "uni226B0338",
- "uni22D80338",
- "uni22D90338",
- "uni22B520D2",
- "uni22B420D2",
- NULL,
- NULL,
- NULL,
- "uni006A.dotless",
- "uni210F.var",
- NULL,
- NULL,
- "uni222020D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_be3[] = {
- NULL,
- "uni2223.short",
- "uni2225.short",
- NULL,
- NULL,
- NULL,
- "uni2248.bold",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni22DAFE00",
- "uni22DBFE00",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2AACFE00",
- "uni2AADFE00",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni220B20D2",
- "uni220D0338",
- NULL,
- NULL,
- "uni220820D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2A15.up",
- "uni2A16.up",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni226120E5",
- "uni003D20E5",
- "uni2AFD20E5",
- "uni22500338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni22020338",
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2A10.up",
- NULL,
- "uni2A12.up",
- "uni2A13.up",
- "uni2A14.up",
- "uni2A17.up",
- "uni2A11.up",
- NULL,
- "uni22F50338",
- NULL,
- "uni22F90338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2026.em",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni220A0338",
- "uni227320D2",
- "uni227220D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni223E.reversed",
- NULL,
- NULL,
- NULL,
- NULL,
- "uni0265.superscript",
- "uni0252.superscript",
- NULL,
- NULL,
- NULL,
- "uni2A0F.up",
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2A9B20D2",
- "uni2A9C20D2",
- "uni2A9B0338",
- "uni2A9C0338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_be4[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni223E.var",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni223C20D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_be5[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2A3CFE00",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2AAF0338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni224220D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2AB00338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_be6[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- "uni228F0338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni22900338",
- "uni224E0338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2205.var",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni0077.subscript",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni1D0B.reversed",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni025102DE",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni025B02DE",
- "uni025402DE",
- NULL,
- "uni03C9.inverted",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni297D.var",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni223C.bold",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_be8[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni227E0338",
- "uni227F0338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2216.var",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni224F0338",
- "uni22420338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_bea[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni00730336",
- NULL,
- "uni006C0321",
- NULL,
- NULL,
- "uni03040304",
- NULL,
- NULL,
- "uni229CFE00",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni03020302",
- NULL,
- "uni03030303",
- "uni033103310331",
- "uni0331033103310331",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni03070302",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni03040303",
- "uni03310330",
- "uni03040308",
- "uni03300331",
- NULL,
- "uni00640321",
- "uni00680321",
- "uni006B0321",
- "uni00780321",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni00730321",
- "uni007A0321",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2034.notsup",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2A0B.up",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni227620D2",
- "uni227720D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_bec[] = {
- NULL,
- NULL,
- "uni2A3DFE00",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_bed[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni220A20D2",
- "uni220D20D2",
- "uni22F60338",
- "uni22FD0338",
- "uni22F620D2",
- "uni22FD20D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2295FE00",
- "uni2297FE00",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni224320D2",
- "uni224520D2",
- NULL,
- "uni2A6C0338",
- "uni2A6C20D2",
- "uni2A7020D2",
- "uni224D20D2",
- "uni223F.reversed",
- "uni003D20D2",
- NULL,
- "uni226120D2",
- "uni22630338",
- "uni226320D2",
- NULL,
- NULL,
- "uni2A7D20D2",
- "uni2A7E20D2",
- "uni226620D2",
- "uni226720D2",
- "uni2A950338",
- "uni2A960338",
- "uni2A9520D2",
- "uni2A9620D2",
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2A990338",
- "uni2A9A0338",
- "uni2A9920D2",
- "uni2A9A20D2",
- "uni2272FE00",
- "uni2273FE00",
- "uni2A9DFE00",
- "uni2A9EFE00",
- NULL,
- NULL,
- "uni227A20D2",
- "uni227B20D2",
- "uni227C20D2",
- "uni227D20D2",
- "uni22DE20D2",
- "uni22DF20D2",
- "uni22DE0338",
- "uni22DF0338",
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2AC520D2",
- "uni2AC620D2",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2AF40338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2A0A.lgdisplay",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni220A.narrow",
- "uni220D.narrow",
- NULL,
- "u1D6FB.narrow",
- "uni002820090029",
- "uni002822C50029",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_bee[] = {
- "stixEE00",
- "stixEE01",
- "stixEE02",
- "stixEE03",
- "stixEE04",
- "stixEE05",
- "stixEE06",
- "stixEE07",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "stixEE10",
- "stixEE11",
- "stixEE12",
- "stixEE13",
- "stixEE14",
- "stixEE15",
- "stixEE16",
- "stixEE17",
- "stixEE18",
- "stixEE19",
- "stixEE1A",
- "stixEE1B",
- "stixEE1C",
- "stixEE1D",
- "stixEE1E",
- "stixEE1F",
- "stixEE20",
- "stixEE21",
- "stixEE22",
- "stixEE23",
- "stixEE24",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "stixEE30",
- "stixEE31",
- "stixEE32",
- "stixEE33",
- "stixEE34",
- "stixEE35",
- "stixEE36",
- "stixEE37",
- "stixEE38",
- "stixEE39",
- "stixEE3A",
- "stixEE3B",
- "stixEE3C",
- "stixEE3D",
- "stixEE3E",
- NULL,
- "stixEE40",
- "stixEE41",
- "stixEE42",
- "stixEE43",
- "stixEE44",
- "stixEE45",
- "stixEE46",
- "stixEE47",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "stixEE50",
- "stixEE51",
- "stixEE52",
- "stixEE53",
- "stixEE54",
- "stixEE55",
- "stixEE56",
- "stixEE57",
- "stixEE58",
- "stixEE59",
- "stixEE5A",
- "stixEE5B",
- "stixEE5C",
- "stixEE5D",
- "stixEE5E",
- "stixEE5F",
- "stixEE60",
- "stixEE61",
- "stixEE62",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "stixEE70",
- "stixEE71",
- "stixEE72",
- "stixEE73",
- "stixEE74",
- "stixEE75",
- "stixEE76",
- "stixEE77",
- "stixEE78",
- "stixEE79",
- "stixEE7A",
- "stixEE7B",
- "stixEE7C",
- "stixEE7D",
- "stixEE7E",
- "stixEE7F",
- "stixEE80",
- "stixEE81",
- "stixEE82",
- "stixEE83",
- "stixEE84",
- "stixEE85",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "stixEE90",
- "stixEE91",
- "stixEE92",
- "stixEE93",
- "stixEE94",
- "stixEE95",
- "stixEE96",
- "stixEE97",
- "stixEE98",
- "stixEE99",
- "stixEE9A",
- "stixEE9B",
- "stixEE9C",
- "stixEE9D",
- "stixEE9E",
- "stixEE9F",
- "stixEEA0",
- "stixEEA1",
- "stixEEA2",
- "stixEEA3",
- "stixEEA4",
- "stixEEA5",
- "stixEEA6",
- "stixEEA7",
- "stixEEA8",
- "stixEEA9",
- "stixEEAA",
- "stixEEAB",
- "stixEEAC",
- NULL,
- NULL,
- NULL,
- "stixEEB0",
- "stixEEB1",
- "stixEEB2",
- "stixEEB3",
- "stixEEB4",
- "stixEEB5",
- "stixEEB6",
- "stixEEB7",
- "stixEEB8",
- "stixEEB9",
- "stixEEBA",
- "stixEEBB",
- "stixEEBC",
- "stixEEBD",
- "stixEEBE",
- "stixEEBF",
- "stixEEC0",
- "stixEEC1",
- "stixEEC2",
- "stixEEC3",
- "stixEEC4",
- "stixEEC5",
- "stixEEC6",
- "stixEEC7",
- "stixEEC8",
- "stixEEC9",
- "stixEECA",
- "stixEECB",
- NULL,
- "stixEECD",
- "stixEECE",
- "stixEECF",
- "stixEED0",
- "stixEED1",
- "stixEED2",
- "stixEED3",
- "stixEED4",
- "stixEED5",
- "stixEED6",
- "stixEED7",
- "stixEED8",
- "stixEED9",
- "stixEEDA",
- "stixEEDB",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_bf4[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni29CF0338",
- "uni29D00338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2AA10338",
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2AA20338",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char *ams_p0_bf5[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- "uni2191.short",
- "uni2193.short",
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static const char **ams_p0[] = {
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- ams_p0_be2,
- ams_p0_be3,
- ams_p0_be4,
- ams_p0_be5,
- ams_p0_be6,
- NULL,
- ams_p0_be8,
- NULL,
- ams_p0_bea,
- NULL,
- ams_p0_bec,
- ams_p0_bed,
- ams_p0_bee,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- ams_p0_bf4,
- ams_p0_bf5,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static NameList ams = {
- &tex,
- N_("AMS Names"),
- { ams_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-/* ************************************************************************** */
-
-static struct psaltnames psaltnames[] = {
- { "AEmacron", 0x01e2 },
- { "AEsmall", 0xf7e6 },
- { "Aacutesmall", 0xf7e1 },
- { "Abreveacute", 0x1eae },
- { "Abrevecyrillic", 0x04d0 },
- { "Abrevedotbelow", 0x1eb6 },
- { "Abrevegrave", 0x1eb0 },
- { "Abrevehookabove", 0x1eb2 },
- { "Abrevetilde", 0x1eb4 },
- { "Acaron", 0x01cd },
- { "Acircle", 0x24b6 },
- { "Acircumflexacute", 0x1ea4 },
- { "Acircumflexdotbelow", 0x1eac },
- { "Acircumflexgrave", 0x1ea6 },
- { "Acircumflexhookabove", 0x1ea8 },
- { "Acircumflexsmall", 0xf7e2 },
- { "Acircumflextilde", 0x1eaa },
- { "Acute", 0xf6c9 },
- { "Acutesmall", 0xf7b4 },
- { "Acyrillic", 0x0410 },
- { "Adblgrave", 0x0200 },
- { "Adieresiscyrillic", 0x04d2 },
- { "Adieresismacron", 0x01de },
- { "Adieresissmall", 0xf7e4 },
- { "Adotbelow", 0x1ea0 },
- { "Adotmacron", 0x01e0 },
- { "Agravesmall", 0xf7e0 },
- { "Ahookabove", 0x1ea2 },
- { "Aiecyrillic", 0x04d4 },
- { "Ainvertedbreve", 0x0202 },
- { "Amonospace", 0xff21 },
- { "Aringbelow", 0x1e00 },
- { "Aringsmall", 0xf7e5 },
- { "Asmall", 0xf761 },
- { "Atildesmall", 0xf7e3 },
- { "Aybarmenian", 0x0531 },
- { "Bcircle", 0x24b7 },
- { "Bdotaccent", 0x1e02 },
- { "Bdotbelow", 0x1e04 },
- { "Becyrillic", 0x0411 },
- { "Benarmenian", 0x0532 },
- { "Bhook", 0x0181 },
- { "Blinebelow", 0x1e06 },
- { "Bmonospace", 0xff22 },
- { "Brevesmall", 0xf6f4 },
- { "Bsmall", 0xf762 },
- { "Btopbar", 0x0182 },
- { "Caarmenian", 0x053e },
- { "Caron", 0xf6ca },
- { "Caronsmall", 0xf6f5 },
- { "Ccedillaacute", 0x1e08 },
- { "Ccedillasmall", 0xf7e7 },
- { "Ccircle", 0x24b8 },
- { "Cdot", 0x010a },
- { "Cedillasmall", 0xf7b8 },
- { "Chaarmenian", 0x0549 },
- { "Cheabkhasiancyrillic", 0x04bc },
- { "Checyrillic", 0x0427 },
- { "Chedescenderabkhasiancyrillic", 0x04be },
- { "Chedescendercyrillic", 0x04b6 },
- { "Chedieresiscyrillic", 0x04f4 },
- { "Cheharmenian", 0x0543 },
- { "Chekhakassiancyrillic", 0x04cb },
- { "Cheverticalstrokecyrillic", 0x04b8 },
- { "Chook", 0x0187 },
- { "Circumflexsmall", 0xf6f6 },
- { "Cmonospace", 0xff23 },
- { "Coarmenian", 0x0551 },
- { "Csmall", 0xf763 },
- { "DZ", 0x01f1 },
- { "DZcaron", 0x01c4 },
- { "Daarmenian", 0x0534 },
- { "Dafrican", 0x0189 },
- { "Dcedilla", 0x1e10 },
- { "Dcircle", 0x24b9 },
- { "Dcircumflexbelow", 0x1e12 },
- { "Ddotaccent", 0x1e0a },
- { "Ddotbelow", 0x1e0c },
- { "Decyrillic", 0x0414 },
- { "Deicoptic", 0x03ee },
- { "Deltagreek", 0x0394 },
- { "Dhook", 0x018a },
- { "Dieresis", 0xf6cb },
- { "diaeresis", 0x00a8 },
- { "Diaeresis", 0xf6cb },
- { "DieresisAcute", 0xf6cc },
- { "DieresisGrave", 0xf6cd },
- { "Dieresissmall", 0xf7a8 },
- { "Digammagreek", 0x03dc },
- { "Djecyrillic", 0x0402 },
- { "Dlinebelow", 0x1e0e },
- { "Dmonospace", 0xff24 },
- { "Dotaccentsmall", 0xf6f7 },
- { "Dslash", 0x0110 },
- { "Dsmall", 0xf764 },
- { "Dtopbar", 0x018b },
- { "Dz", 0x01f2 },
- { "Dzcaron", 0x01c5 },
- { "Dzeabkhasiancyrillic", 0x04e0 },
- { "Dzecyrillic", 0x0405 },
- { "Dzhecyrillic", 0x040f },
- { "Eacutesmall", 0xf7e9 },
- { "Ecedillabreve", 0x1e1c },
- { "Echarmenian", 0x0535 },
- { "Ecircle", 0x24ba },
- { "Ecircumflexacute", 0x1ebe },
- { "Ecircumflexbelow", 0x1e18 },
- { "Ecircumflexdotbelow", 0x1ec6 },
- { "Ecircumflexgrave", 0x1ec0 },
- { "Ecircumflexhookabove", 0x1ec2 },
- { "Ecircumflexsmall", 0xf7ea },
- { "Ecircumflextilde", 0x1ec4 },
- { "Ecyrillic", 0x0404 },
- { "Edblgrave", 0x0204 },
- { "Edieresissmall", 0xf7eb },
- { "Edot", 0x0116 },
- { "Edotbelow", 0x1eb8 },
- { "Efcyrillic", 0x0424 },
- { "Egravesmall", 0xf7e8 },
- { "Eharmenian", 0x0537 },
- { "Ehookabove", 0x1eba },
- { "Eightroman", 0x2167 },
- { "Einvertedbreve", 0x0206 },
- { "Eiotifiedcyrillic", 0x0464 },
- { "Elcyrillic", 0x041b },
- { "Elevenroman", 0x216a },
- { "Emacronacute", 0x1e16 },
- { "Emacrongrave", 0x1e14 },
- { "Emcyrillic", 0x041c },
- { "Emonospace", 0xff25 },
- { "Encyrillic", 0x041d },
- { "Endescendercyrillic", 0x04a2 },
- { "Enghecyrillic", 0x04a4 },
- { "Enhookcyrillic", 0x04c7 },
- { "Eopen", 0x0190 },
- { "Ercyrillic", 0x0420 },
- { "Ereversed", 0x018e },
- { "Ereversedcyrillic", 0x042d },
- { "Escyrillic", 0x0421 },
- { "Esdescendercyrillic", 0x04aa },
- { "Esh", 0x01a9 },
- { "Esmall", 0xf765 },
- { "Etarmenian", 0x0538 },
- { "Ethsmall", 0xf7f0 },
- { "Etilde", 0x1ebc },
- { "Etildebelow", 0x1e1a },
- { "Ezh", 0x01b7 },
- { "Ezhcaron", 0x01ee },
- { "Ezhreversed", 0x01b8 },
- { "Fcircle", 0x24bb },
- { "Fdotaccent", 0x1e1e },
- { "Feharmenian", 0x0556 },
- { "Feicoptic", 0x03e4 },
- { "Fhook", 0x0191 },
- { "Fitacyrillic", 0x0472 },
- { "Fiveroman", 0x2164 },
- { "Fmonospace", 0xff26 },
- { "Fourroman", 0x2163 },
- { "Fsmall", 0xf766 },
- { "GBsquare", 0x3387 },
- { "Gacute", 0x01f4 },
- { "Gammaafrican", 0x0194 },
- { "Gangiacoptic", 0x03ea },
- { "Gcedilla", 0x0122 },
- { "Gcircle", 0x24bc },
- { "Gdot", 0x0120 },
- { "Gecyrillic", 0x0413 },
- { "Ghadarmenian", 0x0542 },
- { "Ghemiddlehookcyrillic", 0x0494 },
- { "Ghestrokecyrillic", 0x0492 },
- { "Gheupturncyrillic", 0x0490 },
- { "Ghook", 0x0193 },
- { "Gimarmenian", 0x0533 },
- { "Gjecyrillic", 0x0403 },
- { "Gmacron", 0x1e20 },
- { "Gmonospace", 0xff27 },
- { "Grave", 0xf6ce },
- { "Gravesmall", 0xf760 },
- { "Gsmall", 0xf767 },
- { "Gsmallhook", 0x029b },
- { "Gstroke", 0x01e4 },
- { "HPsquare", 0x33cb },
- { "Haabkhasiancyrillic", 0x04a8 },
- { "Hadescendercyrillic", 0x04b2 },
- { "Hardsigncyrillic", 0x042a },
- { "Hbrevebelow", 0x1e2a },
- { "Hcedilla", 0x1e28 },
- { "Hcircle", 0x24bd },
- { "Hdieresis", 0x1e26 },
- { "Hdotaccent", 0x1e22 },
- { "Hdotbelow", 0x1e24 },
- { "Hmonospace", 0xff28 },
- { "Hoarmenian", 0x0540 },
- { "Horicoptic", 0x03e8 },
- { "Hsmall", 0xf768 },
- { "Hungarumlaut", 0xf6cf },
- { "Hungarumlautsmall", 0xf6f8 },
- { "Hzsquare", 0x3390 },
- { "IAcyrillic", 0x042f },
- { "IUcyrillic", 0x042e },
- { "Iacutesmall", 0xf7ed },
- { "Icaron", 0x01cf },
- { "Icircle", 0x24be },
- { "Icircumflexsmall", 0xf7ee },
- { "Icyrillic", 0x0406 },
- { "Idblgrave", 0x0208 },
- { "Idieresisacute", 0x1e2e },
- { "Idieresiscyrillic", 0x04e4 },
- { "Idieresissmall", 0xf7ef },
- { "Idot", 0x0130 },
- { "Idotbelow", 0x1eca },
- { "Iebrevecyrillic", 0x04d6 },
- { "Iecyrillic", 0x0415 },
- { "Igravesmall", 0xf7ec },
- { "Ihookabove", 0x1ec8 },
- { "Iicyrillic", 0x0418 },
- { "Iinvertedbreve", 0x020a },
- { "Iishortcyrillic", 0x0419 },
- { "Imacroncyrillic", 0x04e2 },
- { "Imonospace", 0xff29 },
- { "Iniarmenian", 0x053b },
- { "Iocyrillic", 0x0401 },
- { "Iotaafrican", 0x0196 },
- { "Ismall", 0xf769 },
- { "Istroke", 0x0197 },
- { "Itildebelow", 0x1e2c },
- { "Izhitsacyrillic", 0x0474 },
- { "Izhitsadblgravecyrillic", 0x0476 },
- { "Jaarmenian", 0x0541 },
- { "Jcircle", 0x24bf },
- { "Jecyrillic", 0x0408 },
- { "Jheharmenian", 0x054b },
- { "Jmonospace", 0xff2a },
- { "Jsmall", 0xf76a },
- { "KBsquare", 0x3385 },
- { "KKsquare", 0x33cd },
- { "Kabashkircyrillic", 0x04a0 },
- { "Kacute", 0x1e30 },
- { "Kacyrillic", 0x041a },
- { "Kadescendercyrillic", 0x049a },
- { "Kahookcyrillic", 0x04c3 },
- { "Kastrokecyrillic", 0x049e },
- { "Kaverticalstrokecyrillic", 0x049c },
- { "Kcaron", 0x01e8 },
- { "Kcedilla", 0x0136 },
- { "Kcircle", 0x24c0 },
- { "Kdotbelow", 0x1e32 },
- { "Keharmenian", 0x0554 },
- { "Kenarmenian", 0x053f },
- { "Khacyrillic", 0x0425 },
- { "Kheicoptic", 0x03e6 },
- { "Khook", 0x0198 },
- { "Kjecyrillic", 0x040c },
- { "Klinebelow", 0x1e34 },
- { "Kmonospace", 0xff2b },
- { "Koppacyrillic", 0x0480 },
- { "Koppagreek", 0x03de },
- { "Ksicyrillic", 0x046e },
- { "Ksmall", 0xf76b },
- { "LJ", 0x01c7 },
- { "LL", 0xf6bf },
- { "Lcedilla", 0x013b },
- { "Lcircle", 0x24c1 },
- { "Lcircumflexbelow", 0x1e3c },
- { "Ldotaccent", 0x013f },
- { "Ldotbelow", 0x1e36 },
- { "Ldotbelowmacron", 0x1e38 },
- { "Liwnarmenian", 0x053c },
- { "Lj", 0x01c8 },
- { "Ljecyrillic", 0x0409 },
- { "Llinebelow", 0x1e3a },
- { "Lmonospace", 0xff2c },
- { "Lslashsmall", 0xf6f9 },
- { "Lsmall", 0xf76c },
- { "MBsquare", 0x3386 },
- { "Macron", 0xf6d0 },
- { "Macronsmall", 0xf7af },
- { "Macute", 0x1e3e },
- { "Mcircle", 0x24c2 },
- { "Mdotaccent", 0x1e40 },
- { "Mdotbelow", 0x1e42 },
- { "Menarmenian", 0x0544 },
- { "Mmonospace", 0xff2d },
- { "Msmall", 0xf76d },
- { "Mturned", 0x019c },
- { "NJ", 0x01ca },
- { "Ncedilla", 0x0145 },
- { "Ncircle", 0x24c3 },
- { "Ncircumflexbelow", 0x1e4a },
- { "Ndotaccent", 0x1e44 },
- { "Ndotbelow", 0x1e46 },
- { "Nhookleft", 0x019d },
- { "Nineroman", 0x2168 },
- { "Nj", 0x01cb },
- { "Njecyrillic", 0x040a },
- { "Nlinebelow", 0x1e48 },
- { "Nmonospace", 0xff2e },
- { "Nowarmenian", 0x0546 },
- { "Nsmall", 0xf76e },
- { "Ntildesmall", 0xf7f1 },
- { "OEsmall", 0xf6fa },
- { "Oacutesmall", 0xf7f3 },
- { "Obarredcyrillic", 0x04e8 },
- { "Obarreddieresiscyrillic", 0x04ea },
- { "Ocaron", 0x01d1 },
- { "Ocenteredtilde", 0x019f },
- { "Ocircle", 0x24c4 },
- { "Ocircumflexacute", 0x1ed0 },
- { "Ocircumflexdotbelow", 0x1ed8 },
- { "Ocircumflexgrave", 0x1ed2 },
- { "Ocircumflexhookabove", 0x1ed4 },
- { "Ocircumflexsmall", 0xf7f4 },
- { "Ocircumflextilde", 0x1ed6 },
- { "Ocyrillic", 0x041e },
- { "Odblacute", 0x0150 },
- { "Odblgrave", 0x020c },
- { "Odieresiscyrillic", 0x04e6 },
- { "Odieresissmall", 0xf7f6 },
- { "Odotbelow", 0x1ecc },
- { "Ogoneksmall", 0xf6fb },
- { "Ogravesmall", 0xf7f2 },
- { "Oharmenian", 0x0555 },
- { "Ohm", 0x2126 },
- { "Ohookabove", 0x1ece },
- { "Ohornacute", 0x1eda },
- { "Ohorndotbelow", 0x1ee2 },
- { "Ohorngrave", 0x1edc },
- { "Ohornhookabove", 0x1ede },
- { "Ohorntilde", 0x1ee0 },
- { "Oi", 0x01a2 },
- { "Oinvertedbreve", 0x020e },
- { "Omacronacute", 0x1e52 },
- { "Omacrongrave", 0x1e50 },
- { "Omegacyrillic", 0x0460 },
- { "Omegagreek", 0x03a9 },
- { "Omegaroundcyrillic", 0x047a },
- { "Omegatitlocyrillic", 0x047c },
- { "Omonospace", 0xff2f },
- { "Oneroman", 0x2160 },
- { "Oogonek", 0x01ea },
- { "Oogonekmacron", 0x01ec },
- { "Oopen", 0x0186 },
- { "Oslashsmall", 0xf7f8 },
- { "Osmall", 0xf76f },
- { "Ostrokeacute", 0x01fe },
- { "Otcyrillic", 0x047e },
- { "Otildeacute", 0x1e4c },
- { "Otildedieresis", 0x1e4e },
- { "Otildesmall", 0xf7f5 },
- { "Pacute", 0x1e54 },
- { "Pcircle", 0x24c5 },
- { "Pdotaccent", 0x1e56 },
- { "Pecyrillic", 0x041f },
- { "Peharmenian", 0x054a },
- { "Pemiddlehookcyrillic", 0x04a6 },
- { "Phook", 0x01a4 },
- { "Piwrarmenian", 0x0553 },
- { "Pmonospace", 0xff30 },
- { "Psicyrillic", 0x0470 },
- { "Psmall", 0xf770 },
- { "Qcircle", 0x24c6 },
- { "Qmonospace", 0xff31 },
- { "Qsmall", 0xf771 },
- { "Raarmenian", 0x054c },
- { "Rcedilla", 0x0156 },
- { "Rcircle", 0x24c7 },
- { "Rdblgrave", 0x0210 },
- { "Rdotaccent", 0x1e58 },
- { "Rdotbelow", 0x1e5a },
- { "Rdotbelowmacron", 0x1e5c },
- { "Reharmenian", 0x0550 },
- { "Ringsmall", 0xf6fc },
- { "Rinvertedbreve", 0x0212 },
- { "Rlinebelow", 0x1e5e },
- { "Rmonospace", 0xff32 },
- { "Rsmall", 0xf772 },
- { "Rsmallinverted", 0x0281 },
- { "Rsmallinvertedsuperior", 0x02b6 },
- { "Sacutedotaccent", 0x1e64 },
- { "Sampigreek", 0x03e0 },
- { "Scarondotaccent", 0x1e66 },
- { "Scaronsmall", 0xf6fd },
- { "Schwa", 0x018f },
- { "Schwacyrillic", 0x04d8 },
- { "Schwadieresiscyrillic", 0x04da },
- { "Scircle", 0x24c8 },
- { "Sdotaccent", 0x1e60 },
- { "Sdotbelow", 0x1e62 },
- { "Sdotbelowdotaccent", 0x1e68 },
- { "Seharmenian", 0x054d },
- { "Sevenroman", 0x2166 },
- { "Shaarmenian", 0x0547 },
- { "Shacyrillic", 0x0428 },
- { "Shchacyrillic", 0x0429 },
- { "Sheicoptic", 0x03e2 },
- { "Shhacyrillic", 0x04ba },
- { "Shimacoptic", 0x03ec },
- { "Sixroman", 0x2165 },
- { "Smonospace", 0xff33 },
- { "Softsigncyrillic", 0x042c },
- { "Ssmall", 0xf773 },
- { "Stigmagreek", 0x03da },
- { "Tcedilla", 0x0162 },
- { "Tcircle", 0x24c9 },
- { "Tcircumflexbelow", 0x1e70 },
- { "Tdotaccent", 0x1e6a },
- { "Tdotbelow", 0x1e6c },
- { "Tecyrillic", 0x0422 },
- { "Tedescendercyrillic", 0x04ac },
- { "Tenroman", 0x2169 },
- { "Tetsecyrillic", 0x04b4 },
- { "Thook", 0x01ac },
- { "Thornsmall", 0xf7fe },
- { "Threeroman", 0x2162 },
- { "Tildesmall", 0xf6fe },
- { "Tiwnarmenian", 0x054f },
- { "Tlinebelow", 0x1e6e },
- { "Tmonospace", 0xff34 },
- { "Toarmenian", 0x0539 },
- { "Tonefive", 0x01bc },
- { "Tonesix", 0x0184 },
- { "Tonetwo", 0x01a7 },
- { "Tretroflexhook", 0x01ae },
- { "Tsecyrillic", 0x0426 },
- { "Tshecyrillic", 0x040b },
- { "Tsmall", 0xf774 },
- { "Twelveroman", 0x216b },
- { "Tworoman", 0x2161 },
- { "Uacutesmall", 0xf7fa },
- { "Ucaron", 0x01d3 },
- { "Ucircle", 0x24ca },
- { "Ucircumflexbelow", 0x1e76 },
- { "Ucircumflexsmall", 0xf7fb },
- { "Ucyrillic", 0x0423 },
- { "Udblacute", 0x0170 },
- { "Udblgrave", 0x0214 },
- { "Udieresisacute", 0x01d7 },
- { "Udieresisbelow", 0x1e72 },
- { "Udieresiscaron", 0x01d9 },
- { "Udieresiscyrillic", 0x04f0 },
- { "Udieresisgrave", 0x01db },
- { "Udieresismacron", 0x01d5 },
- { "Udieresissmall", 0xf7fc },
- { "Udotbelow", 0x1ee4 },
- { "Ugravesmall", 0xf7f9 },
- { "Uhookabove", 0x1ee6 },
- { "Uhornacute", 0x1ee8 },
- { "Uhorndotbelow", 0x1ef0 },
- { "Uhorngrave", 0x1eea },
- { "Uhornhookabove", 0x1eec },
- { "Uhorntilde", 0x1eee },
- { "Uhungarumlautcyrillic", 0x04f2 },
- { "Uinvertedbreve", 0x0216 },
- { "Ukcyrillic", 0x0478 },
- { "Umacroncyrillic", 0x04ee },
- { "Umacrondieresis", 0x1e7a },
- { "Umonospace", 0xff35 },
- { "Upsilonacutehooksymbolgreek", 0x03d3 },
- { "Upsilonafrican", 0x01b1 },
- { "Upsilondieresishooksymbolgreek", 0x03d4 },
- { "Upsilonhooksymbol", 0x03d2 },
- { "Ushortcyrillic", 0x040e },
- { "Usmall", 0xf775 },
- { "Ustraightcyrillic", 0x04ae },
- { "Ustraightstrokecyrillic", 0x04b0 },
- { "Utildeacute", 0x1e78 },
- { "Utildebelow", 0x1e74 },
- { "Vcircle", 0x24cb },
- { "Vdotbelow", 0x1e7e },
- { "Vecyrillic", 0x0412 },
- { "Vewarmenian", 0x054e },
- { "Vhook", 0x01b2 },
- { "Vmonospace", 0xff36 },
- { "Voarmenian", 0x0548 },
- { "Vsmall", 0xf776 },
- { "Vtilde", 0x1e7c },
- { "Wcircle", 0x24cc },
- { "Wdotaccent", 0x1e86 },
- { "Wdotbelow", 0x1e88 },
- { "Wmonospace", 0xff37 },
- { "Wsmall", 0xf777 },
- { "Xcircle", 0x24cd },
- { "Xdieresis", 0x1e8c },
- { "Xdotaccent", 0x1e8a },
- { "Xeharmenian", 0x053d },
- { "Xmonospace", 0xff38 },
- { "Xsmall", 0xf778 },
- { "Yacutesmall", 0xf7fd },
- { "Yatcyrillic", 0x0462 },
- { "Ycircle", 0x24ce },
- { "Ydieresissmall", 0xf7ff },
- { "Ydotaccent", 0x1e8e },
- { "Ydotbelow", 0x1ef4 },
- { "Yericyrillic", 0x042b },
- { "Yerudieresiscyrillic", 0x04f8 },
- { "Yhook", 0x01b3 },
- { "Yhookabove", 0x1ef6 },
- { "Yiarmenian", 0x0545 },
- { "Yicyrillic", 0x0407 },
- { "Yiwnarmenian", 0x0552 },
- { "Ymonospace", 0xff39 },
- { "Ysmall", 0xf779 },
- { "Ytilde", 0x1ef8 },
- { "Yusbigcyrillic", 0x046a },
- { "Yusbigiotifiedcyrillic", 0x046c },
- { "Yuslittlecyrillic", 0x0466 },
- { "Yuslittleiotifiedcyrillic", 0x0468 },
- { "Zaarmenian", 0x0536 },
- { "Zcaronsmall", 0xf6ff },
- { "Zcircle", 0x24cf },
- { "Zcircumflex", 0x1e90 },
- { "Zdot", 0x017b },
- { "Zdotbelow", 0x1e92 },
- { "Zecyrillic", 0x0417 },
- { "Zedescendercyrillic", 0x0498 },
- { "Zedieresiscyrillic", 0x04de },
- { "Zhearmenian", 0x053a },
- { "Zhebrevecyrillic", 0x04c1 },
- { "Zhecyrillic", 0x0416 },
- { "Zhedescendercyrillic", 0x0496 },
- { "Zhedieresiscyrillic", 0x04dc },
- { "Zlinebelow", 0x1e94 },
- { "Zmonospace", 0xff3a },
- { "Zsmall", 0xf77a },
- { "Zstroke", 0x01b5 },
- { "aabengali", 0x0986 },
- { "aadeva", 0x0906 },
- { "aagujarati", 0x0a86 },
- { "aagurmukhi", 0x0a06 },
- { "aamatragurmukhi", 0x0a3e },
- { "aarusquare", 0x3303 },
- { "aavowelsignbengali", 0x09be },
- { "aavowelsigndeva", 0x093e },
- { "aavowelsigngujarati", 0x0abe },
- { "abbreviationmarkarmenian", 0x055f },
- { "abbreviationsigndeva", 0x0970 },
- { "abengali", 0x0985 },
- { "abopomofo", 0x311a },
- { "abreveacute", 0x1eaf },
- { "abrevecyrillic", 0x04d1 },
- { "abrevedotbelow", 0x1eb7 },
- { "abrevegrave", 0x1eb1 },
- { "abrevehookabove", 0x1eb3 },
- { "abrevetilde", 0x1eb5 },
- { "acaron", 0x01ce },
- { "acircle", 0x24d0 },
- { "acircumflexacute", 0x1ea5 },
- { "acircumflexdotbelow", 0x1ead },
- { "acircumflexgrave", 0x1ea7 },
- { "acircumflexhookabove", 0x1ea9 },
- { "acircumflextilde", 0x1eab },
- { "acutebelowcmb", 0x0317 },
- { "acutecmb", 0x0301 },
- { "acutedeva", 0x0954 },
- { "acutelowmod", 0x02cf },
- { "acutetonecmb", 0x0341 },
- { "acyrillic", 0x0430 },
- { "adblgrave", 0x0201 },
- { "addakgurmukhi", 0x0a71 },
- { "adeva", 0x0905 },
- { "adieresiscyrillic", 0x04d3 },
- { "adieresismacron", 0x01df },
- { "adotbelow", 0x1ea1 },
- { "adotmacron", 0x01e1 },
- { "aekorean", 0x3150 },
- { "aemacron", 0x01e3 },
- { "afii08941", 0x20a4 },
- { "afii10063", 0xf6c4 },
- { "afii10064", 0xf6c5 },
- { "afii10192", 0xf6c6 },
- { "afii10831", 0xf6c7 },
- { "afii10832", 0xf6c8 },
- { "afii57694", 0xfb2a },
- { "afii57695", 0xfb2b },
- { "afii57700", 0xfb4b },
- { "afii57705", 0xfb1f },
- { "afii57723", 0xfb35 },
- { "agujarati", 0x0a85 },
- { "agurmukhi", 0x0a05 },
- { "ahiragana", 0x3042 },
- { "ahookabove", 0x1ea3 },
- { "aibengali", 0x0990 },
- { "aibopomofo", 0x311e },
- { "aideva", 0x0910 },
- { "aiecyrillic", 0x04d5 },
- { "aigujarati", 0x0a90 },
- { "aigurmukhi", 0x0a10 },
- { "aimatragurmukhi", 0x0a48 },
- { "ainarabic", 0x0639 },
- { "ainfinalarabic", 0xfeca },
- { "aininitialarabic", 0xfecb },
- { "ainmedialarabic", 0xfecc },
- { "ainvertedbreve", 0x0203 },
- { "aivowelsignbengali", 0x09c8 },
- { "aivowelsigndeva", 0x0948 },
- { "aivowelsigngujarati", 0x0ac8 },
- { "akatakana", 0x30a2 },
- { "akatakanahalfwidth", 0xff71 },
- { "akorean", 0x314f },
- { "alef", 0x05d0 },
- { "alefarabic", 0x0627 },
- { "alefdageshhebrew", 0xfb30 },
- { "aleffinalarabic", 0xfe8e },
- { "alefhamzaabovearabic", 0x0623 },
- { "alefhamzaabovefinalarabic", 0xfe84 },
- { "alefhamzabelowarabic", 0x0625 },
- { "alefhamzabelowfinalarabic", 0xfe88 },
- { "alefhebrew", 0x05d0 },
- { "aleflamedhebrew", 0xfb4f },
- { "alefmaddaabovearabic", 0x0622 },
- { "alefmaddaabovefinalarabic", 0xfe82 },
- { "alefmaksuraarabic", 0x0649 },
- { "alefmaksurafinalarabic", 0xfef0 },
- { "alefmaksurainitialarabic", 0xfef3 },
- { "alefmaksuramedialarabic", 0xfef4 },
- { "alefpatahhebrew", 0xfb2e },
- { "alefqamatshebrew", 0xfb2f },
- { "allequal", 0x224c },
- { "amonospace", 0xff41 },
- { "ampersandmonospace", 0xff06 },
- { "ampersandsmall", 0xf726 },
- { "amsquare", 0x33c2 },
- { "anbopomofo", 0x3122 },
- { "angbopomofo", 0x3124 },
- { "angkhankhuthai", 0x0e5a },
- { "anglebracketleft", 0x3008 },
- { "anglebracketleftvertical", 0xfe3f },
- { "anglebracketright", 0x3009 },
- { "anglebracketrightvertical", 0xfe40 },
- { "angstrom", 0x212b },
- { "anudattadeva", 0x0952 },
- { "anusvarabengali", 0x0982 },
- { "anusvaradeva", 0x0902 },
- { "anusvaragujarati", 0x0a82 },
- { "apaatosquare", 0x3300 },
- { "aparen", 0x249c },
- { "apostrophearmenian", 0x055a },
- { "apostrophemod", 0x02bc },
- { "apple", 0xf8ff },
- { "approaches", 0x2250 },
- { "approxequalorimage", 0x2252 },
- { "approximatelyequal", 0x2245 },
- { "araeaekorean", 0x318e },
- { "araeakorean", 0x318d },
- { "arc", 0x2312 },
- { "arighthalfring", 0x1e9a },
- { "aringbelow", 0x1e01 },
- { "arrowdashdown", 0x21e3 },
- { "arrowdashleft", 0x21e0 },
- { "arrowdashright", 0x21e2 },
- { "arrowdashup", 0x21e1 },
- { "arrowdownleft", 0x2199 },
- { "arrowdownright", 0x2198 },
- { "arrowdownwhite", 0x21e9 },
- { "arrowheaddownmod", 0x02c5 },
- { "arrowheadleftmod", 0x02c2 },
- { "arrowheadrightmod", 0x02c3 },
- { "arrowheadupmod", 0x02c4 },
- { "arrowhorizex", 0xf8e7 },
- { "arrowleftdbl", 0x21d0 },
- { "arrowleftdblstroke", 0x21cd },
- { "arrowleftoverright", 0x21c6 },
- { "arrowleftwhite", 0x21e6 },
- { "arrowrightdblstroke", 0x21cf },
- { "arrowrightheavy", 0x279e },
- { "arrowrightoverleft", 0x21c4 },
- { "arrowrightwhite", 0x21e8 },
- { "arrowtableft", 0x21e4 },
- { "arrowtabright", 0x21e5 },
- { "arrowupdownbase", 0x21a8 },
- { "arrowupleft", 0x2196 },
- { "arrowupleftofdown", 0x21c5 },
- { "arrowupright", 0x2197 },
- { "arrowupwhite", 0x21e7 },
- { "arrowvertex", 0xf8e6 },
- { "asciicircummonospace", 0xff3e },
- { "asciitildemonospace", 0xff5e },
- { "ascript", 0x0251 },
- { "ascriptturned", 0x0252 },
- { "asmallhiragana", 0x3041 },
- { "asmallkatakana", 0x30a1 },
- { "asmallkatakanahalfwidth", 0xff67 },
- { "asteriskaltonearabic", 0x066d },
- { "asteriskarabic", 0x066d },
- { "asteriskmonospace", 0xff0a },
- { "asterisksmall", 0xfe61 },
- { "asterism", 0x2042 },
- { "asuperior", 0xf6e9 },
- { "asymptoticallyequal", 0x2243 },
- { "atmonospace", 0xff20 },
- { "atsmall", 0xfe6b },
- { "aturned", 0x0250 },
- { "aubengali", 0x0994 },
- { "aubopomofo", 0x3120 },
- { "audeva", 0x0914 },
- { "augujarati", 0x0a94 },
- { "augurmukhi", 0x0a14 },
- { "aulengthmarkbengali", 0x09d7 },
- { "aumatragurmukhi", 0x0a4c },
- { "auvowelsignbengali", 0x09cc },
- { "auvowelsigndeva", 0x094c },
- { "auvowelsigngujarati", 0x0acc },
- { "avagrahadeva", 0x093d },
- { "aybarmenian", 0x0561 },
- { "ayin", 0x05e2 },
- { "ayinaltonehebrew", 0xfb20 },
- { "ayinhebrew", 0x05e2 },
- { "babengali", 0x09ac },
- { "backslashmonospace", 0xff3c },
- { "badeva", 0x092c },
- { "bagujarati", 0x0aac },
- { "bagurmukhi", 0x0a2c },
- { "bahiragana", 0x3070 },
- { "bahtthai", 0x0e3f },
- { "bakatakana", 0x30d0 },
- { "barmonospace", 0xff5c },
- { "bbopomofo", 0x3105 },
- { "bcircle", 0x24d1 },
- { "bdotaccent", 0x1e03 },
- { "bdotbelow", 0x1e05 },
- { "beamedsixteenthnotes", 0x266c },
- { "because", 0x2235 },
- { "becyrillic", 0x0431 },
- { "beharabic", 0x0628 },
- { "behfinalarabic", 0xfe90 },
- { "behinitialarabic", 0xfe91 },
- { "behiragana", 0x3079 },
- { "behmedialarabic", 0xfe92 },
- { "behmeeminitialarabic", 0xfc9f },
- { "behmeemisolatedarabic", 0xfc08 },
- { "behnoonfinalarabic", 0xfc6d },
- { "bekatakana", 0x30d9 },
- { "benarmenian", 0x0562 },
- { "bet", 0x05d1 },
- { "betasymbolgreek", 0x03d0 },
- { "betdagesh", 0xfb31 },
- { "betdageshhebrew", 0xfb31 },
- { "bethebrew", 0x05d1 },
- { "betrafehebrew", 0xfb4c },
- { "bhabengali", 0x09ad },
- { "bhadeva", 0x092d },
- { "bhagujarati", 0x0aad },
- { "bhagurmukhi", 0x0a2d },
- { "bhook", 0x0253 },
- { "bihiragana", 0x3073 },
- { "bikatakana", 0x30d3 },
- { "bilabialclick", 0x0298 },
- { "bindigurmukhi", 0x0a02 },
- { "birusquare", 0x3331 },
- { "blackcircle", 0x25cf },
- { "blackdiamond", 0x25c6 },
- { "blackdownpointingtriangle", 0x25bc },
- { "blackleftpointingpointer", 0x25c4 },
- { "blackleftpointingtriangle", 0x25c0 },
- { "blacklenticularbracketleft", 0x3010 },
- { "blacklenticularbracketleftvertical", 0xfe3b },
- { "blacklenticularbracketright", 0x3011 },
- { "blacklenticularbracketrightvertical", 0xfe3c },
- { "blacklowerlefttriangle", 0x25e3 },
- { "blacklowerrighttriangle", 0x25e2 },
- { "blackrectangle", 0x25ac },
- { "blackrightpointingpointer", 0x25ba },
- { "blackrightpointingtriangle", 0x25b6 },
- { "blacksmallsquare", 0x25aa },
- { "blacksmilingface", 0x263b },
- { "blacksquare", 0x25a0 },
- { "blackstar", 0x2605 },
- { "blackupperlefttriangle", 0x25e4 },
- { "blackupperrighttriangle", 0x25e5 },
- { "blackuppointingsmalltriangle", 0x25b4 },
- { "blackuppointingtriangle", 0x25b2 },
- { "blank", 0x2423 },
- { "blinebelow", 0x1e07 },
- { "bmonospace", 0xff42 },
- { "bobaimaithai", 0x0e1a },
- { "bohiragana", 0x307c },
- { "bokatakana", 0x30dc },
- { "bparen", 0x249d },
- { "bqsquare", 0x33c3 },
- { "braceex", 0xf8f4 },
- { "braceleftbt", 0xf8f3 },
- { "braceleftmid", 0xf8f2 },
- { "braceleftmonospace", 0xff5b },
- { "braceleftsmall", 0xfe5b },
- { "bracelefttp", 0xf8f1 },
- { "braceleftvertical", 0xfe37 },
- { "bracerightbt", 0xf8fe },
- { "bracerightmid", 0xf8fd },
- { "bracerightmonospace", 0xff5d },
- { "bracerightsmall", 0xfe5c },
- { "bracerighttp", 0xf8fc },
- { "bracerightvertical", 0xfe38 },
- { "bracketleftbt", 0xf8f0 },
- { "bracketleftex", 0xf8ef },
- { "bracketleftmonospace", 0xff3b },
- { "bracketlefttp", 0xf8ee },
- { "bracketrightbt", 0xf8fb },
- { "bracketrightex", 0xf8fa },
- { "bracketrightmonospace", 0xff3d },
- { "bracketrighttp", 0xf8f9 },
- { "brevebelowcmb", 0x032e },
- { "brevecmb", 0x0306 },
- { "breveinvertedbelowcmb", 0x032f },
- { "breveinvertedcmb", 0x0311 },
- { "breveinverteddoublecmb", 0x0361 },
- { "bridgebelowcmb", 0x032a },
- { "bridgeinvertedbelowcmb", 0x033a },
- { "bstroke", 0x0180 },
- { "bsuperior", 0xf6ea },
- { "btopbar", 0x0183 },
- { "buhiragana", 0x3076 },
- { "bukatakana", 0x30d6 },
- { "bulletinverse", 0x25d8 },
- { "bulletoperator", 0x2219 },
- { "bullseye", 0x25ce },
- { "caarmenian", 0x056e },
- { "cabengali", 0x099a },
- { "cadeva", 0x091a },
- { "cagujarati", 0x0a9a },
- { "cagurmukhi", 0x0a1a },
- { "calsquare", 0x3388 },
- { "candrabindubengali", 0x0981 },
- { "candrabinducmb", 0x0310 },
- { "candrabindudeva", 0x0901 },
- { "candrabindugujarati", 0x0a81 },
- { "capslock", 0x21ea },
- { "careof", 0x2105 },
- { "caronbelowcmb", 0x032c },
- { "caroncmb", 0x030c },
- { "cbopomofo", 0x3118 },
- { "ccedillaacute", 0x1e09 },
- { "ccircle", 0x24d2 },
- { "ccurl", 0x0255 },
- { "cdot", 0x010b },
- { "cdsquare", 0x33c5 },
- { "cedillacmb", 0x0327 },
- { "centigrade", 0x2103 },
- { "centinferior", 0xf6df },
- { "centmonospace", 0xffe0 },
- { "centoldstyle", 0xf7a2 },
- { "centsuperior", 0xf6e0 },
- { "chaarmenian", 0x0579 },
- { "chabengali", 0x099b },
- { "chadeva", 0x091b },
- { "chagujarati", 0x0a9b },
- { "chagurmukhi", 0x0a1b },
- { "chbopomofo", 0x3114 },
- { "cheabkhasiancyrillic", 0x04bd },
- { "checkmark", 0x2713 },
- { "checyrillic", 0x0447 },
- { "chedescenderabkhasiancyrillic", 0x04bf },
- { "chedescendercyrillic", 0x04b7 },
- { "chedieresiscyrillic", 0x04f5 },
- { "cheharmenian", 0x0573 },
- { "chekhakassiancyrillic", 0x04cc },
- { "cheverticalstrokecyrillic", 0x04b9 },
- { "chieuchacirclekorean", 0x3277 },
- { "chieuchaparenkorean", 0x3217 },
- { "chieuchcirclekorean", 0x3269 },
- { "chieuchkorean", 0x314a },
- { "chieuchparenkorean", 0x3209 },
- { "chochangthai", 0x0e0a },
- { "chochanthai", 0x0e08 },
- { "chochingthai", 0x0e09 },
- { "chochoethai", 0x0e0c },
- { "chook", 0x0188 },
- { "cieucacirclekorean", 0x3276 },
- { "cieucaparenkorean", 0x3216 },
- { "cieuccirclekorean", 0x3268 },
- { "cieuckorean", 0x3148 },
- { "cieucparenkorean", 0x3208 },
- { "cieucuparenkorean", 0x321c },
- { "circleot", 0x2299 },
- { "circlepostalmark", 0x3036 },
- { "circlewithlefthalfblack", 0x25d0 },
- { "circlewithrighthalfblack", 0x25d1 },
- { "circumflexbelowcmb", 0x032d },
- { "circumflexcmb", 0x0302 },
- { "clear", 0x2327 },
- { "clickalveolar", 0x01c2 },
- { "clickdental", 0x01c0 },
- { "clicklateral", 0x01c1 },
- { "clickretroflex", 0x01c3 },
- { "clubsuitblack", 0x2663 },
- { "clubsuitwhite", 0x2667 },
- { "cmcubedsquare", 0x33a4 },
- { "cmonospace", 0xff43 },
- { "cmsquaredsquare", 0x33a0 },
- { "coarmenian", 0x0581 },
- { "colonmonospace", 0xff1a },
- { "colonsign", 0x20a1 },
- { "colonsmall", 0xfe55 },
- { "colontriangularhalfmod", 0x02d1 },
- { "colontriangularmod", 0x02d0 },
- { "commaabovecmb", 0x0313 },
- { "commaaboverightcmb", 0x0315 },
- { "commaaccent", 0xf6c3 },
- { "commaarabic", 0x060c },
- { "commaarmenian", 0x055d },
- { "commainferior", 0xf6e1 },
- { "commamonospace", 0xff0c },
- { "commareversedabovecmb", 0x0314 },
- { "commareversedmod", 0x02bd },
- { "commasmall", 0xfe50 },
- { "commasuperior", 0xf6e2 },
- { "commaturnedabovecmb", 0x0312 },
- { "commaturnedmod", 0x02bb },
- { "compass", 0x263c },
- { "contourintegral", 0x222e },
- { "control", 0x2303 },
- { "controlACK", 0x0006 },
- { "controlBEL", 0x0007 },
- { "controlBS", 0x0008 },
- { "controlCAN", 0x0018 },
- { "controlCR", 0x000d },
- { "controlDC1", 0x0011 },
- { "controlDC2", 0x0012 },
- { "controlDC3", 0x0013 },
- { "controlDC4", 0x0014 },
- { "controlDEL", 0x007f },
- { "controlDLE", 0x0010 },
- { "controlEM", 0x0019 },
- { "controlENQ", 0x0005 },
- { "controlEOT", 0x0004 },
- { "controlESC", 0x001b },
- { "controlETB", 0x0017 },
- { "controlETX", 0x0003 },
- { "controlFF", 0x000c },
- { "controlFS", 0x001c },
- { "controlGS", 0x001d },
- { "controlHT", 0x0009 },
- { "controlLF", 0x000a },
- { "controlNAK", 0x0015 },
- { "controlRS", 0x001e },
- { "controlSI", 0x000f },
- { "controlSO", 0x000e },
- { "controlSOT", 0x0002 },
- { "controlSTX", 0x0001 },
- { "controlSUB", 0x001a },
- { "controlSYN", 0x0016 },
- { "controlUS", 0x001f },
- { "controlVT", 0x000b },
- { "copyrightsans", 0xf8e9 },
- { "copyrightserif", 0xf6d9 },
- { "cornerbracketleft", 0x300c },
- { "cornerbracketlefthalfwidth", 0xff62 },
- { "cornerbracketleftvertical", 0xfe41 },
- { "cornerbracketright", 0x300d },
- { "cornerbracketrighthalfwidth", 0xff63 },
- { "cornerbracketrightvertical", 0xfe42 },
- { "corporationsquare", 0x337f },
- { "cosquare", 0x33c7 },
- { "coverkgsquare", 0x33c6 },
- { "cparen", 0x249e },
- { "cruzeiro", 0x20a2 },
- { "cstretched", 0x0297 },
- { "curlyand", 0x22cf },
- { "curlyor", 0x22ce },
- { "cyrBreve", 0xf6d1 },
- { "cyrFlex", 0xf6d2 },
- { "cyrbreve", 0xf6d4 },
- { "cyrflex", 0xf6d5 },
- { "daarmenian", 0x0564 },
- { "dabengali", 0x09a6 },
- { "dadarabic", 0x0636 },
- { "dadeva", 0x0926 },
- { "dadfinalarabic", 0xfebe },
- { "dadinitialarabic", 0xfebf },
- { "dadmedialarabic", 0xfec0 },
- { "dagesh", 0x05bc },
- { "dageshhebrew", 0x05bc },
- { "dagujarati", 0x0aa6 },
- { "dagurmukhi", 0x0a26 },
- { "dahiragana", 0x3060 },
- { "dakatakana", 0x30c0 },
- { "dalarabic", 0x062f },
- { "dalet", 0x05d3 },
- { "daletdagesh", 0xfb33 },
- { "daletdageshhebrew", 0xfb33 },
- { "dalethatafpatah", 0x05d3 },
- { "dalethatafpatahhebrew", 0x05d3 },
- { "dalethatafsegol", 0x05d3 },
- { "dalethatafsegolhebrew", 0x05d3 },
- { "dalethebrew", 0x05d3 },
- { "dalethiriq", 0x05d3 },
- { "dalethiriqhebrew", 0x05d3 },
- { "daletholam", 0x05d3 },
- { "daletholamhebrew", 0x05d3 },
- { "daletpatah", 0x05d3 },
- { "daletpatahhebrew", 0x05d3 },
- { "daletqamats", 0x05d3 },
- { "daletqamatshebrew", 0x05d3 },
- { "daletqubuts", 0x05d3 },
- { "daletqubutshebrew", 0x05d3 },
- { "daletsegol", 0x05d3 },
- { "daletsegolhebrew", 0x05d3 },
- { "daletsheva", 0x05d3 },
- { "daletshevahebrew", 0x05d3 },
- { "dalettsere", 0x05d3 },
- { "dalettserehebrew", 0x05d3 },
- { "dalfinalarabic", 0xfeaa },
- { "dammaarabic", 0x064f },
- { "dammalowarabic", 0x064f },
- { "dammatanaltonearabic", 0x064c },
- { "dammatanarabic", 0x064c },
- { "danda", 0x0964 },
- { "dargahebrew", 0x05a7 },
- { "dargalefthebrew", 0x05a7 },
- { "dasiapneumatacyrilliccmb", 0x0485 },
- { "dblGrave", 0xf6d3 },
- { "dblanglebracketleft", 0x300a },
- { "dblanglebracketleftvertical", 0xfe3d },
- { "dblanglebracketright", 0x300b },
- { "dblanglebracketrightvertical", 0xfe3e },
- { "dblarchinvertedbelowcmb", 0x032b },
- { "dblarrowleft", 0x21d4 },
- { "dblarrowright", 0x21d2 },
- { "dbldanda", 0x0965 },
- { "dblgrave", 0xf6d6 },
- { "dblgravecmb", 0x030f },
- { "dblintegral", 0x222c },
- { "dbllowline", 0x2017 },
- { "dbllowlinecmb", 0x0333 },
- { "dbloverlinecmb", 0x033f },
- { "dblprimemod", 0x02ba },
- { "dblverticalbar", 0x2016 },
- { "dblverticallineabovecmb", 0x030e },
- { "dbopomofo", 0x3109 },
- { "dbsquare", 0x33c8 },
- { "dcedilla", 0x1e11 },
- { "dcircle", 0x24d3 },
- { "dcircumflexbelow", 0x1e13 },
- { "ddabengali", 0x09a1 },
- { "ddadeva", 0x0921 },
- { "ddagujarati", 0x0aa1 },
- { "ddagurmukhi", 0x0a21 },
- { "ddalarabic", 0x0688 },
- { "ddalfinalarabic", 0xfb89 },
- { "dddhadeva", 0x095c },
- { "ddhabengali", 0x09a2 },
- { "ddhadeva", 0x0922 },
- { "ddhagujarati", 0x0aa2 },
- { "ddhagurmukhi", 0x0a22 },
- { "ddotaccent", 0x1e0b },
- { "ddotbelow", 0x1e0d },
- { "decimalseparatorarabic", 0x066b },
- { "decimalseparatorpersian", 0x066b },
- { "decyrillic", 0x0434 },
- { "dehihebrew", 0x05ad },
- { "dehiragana", 0x3067 },
- { "deicoptic", 0x03ef },
- { "dekatakana", 0x30c7 },
- { "deleteleft", 0x232b },
- { "deleteright", 0x2326 },
- { "deltaturned", 0x018d },
- { "denominatorminusonenumeratorbengali", 0x09f8 },
- { "dezh", 0x02a4 },
- { "dhabengali", 0x09a7 },
- { "dhadeva", 0x0927 },
- { "dhagujarati", 0x0aa7 },
- { "dhagurmukhi", 0x0a27 },
- { "dhook", 0x0257 },
- { "dialytikatonos", 0x0385 },
- { "dialytikatonoscmb", 0x0344 },
- { "diamondsuitwhite", 0x2662 },
- { "dieresisacute", 0xf6d7 },
- { "dieresisbelowcmb", 0x0324 },
- { "dieresiscmb", 0x0308 },
- { "dieresisgrave", 0xf6d8 },
- { "dihiragana", 0x3062 },
- { "dikatakana", 0x30c2 },
- { "dittomark", 0x3003 },
- { "divides", 0x2223 },
- { "divisionslash", 0x2215 },
- { "djecyrillic", 0x0452 },
- { "dlinebelow", 0x1e0f },
- { "dlsquare", 0x3397 },
- { "dmacron", 0x0111 },
- { "dmonospace", 0xff44 },
- { "dochadathai", 0x0e0e },
- { "dodekthai", 0x0e14 },
- { "dohiragana", 0x3069 },
- { "dokatakana", 0x30c9 },
- { "dollarinferior", 0xf6e3 },
- { "dollarmonospace", 0xff04 },
- { "dollaroldstyle", 0xf724 },
- { "dollarsmall", 0xfe69 },
- { "dollarsuperior", 0xf6e4 },
- { "dorusquare", 0x3326 },
- { "dotaccentcmb", 0x0307 },
- { "dotbelowcmb", 0x0323 },
- { "dotkatakana", 0x30fb },
- { "dotlessj", 0x0237 }, /* !!!! AGL Still says this is 0xf6be */
- { "dotlessjstrokehook", 0x0284 },
- { "dottedcircle", 0x25cc },
- { "doubleyodpatah", 0xfb1f },
- { "doubleyodpatahhebrew", 0xfb1f },
- { "downtackbelowcmb", 0x031e },
- { "downtackmod", 0x02d5 },
- { "dparen", 0x249f },
- { "dsuperior", 0xf6eb },
- { "dtail", 0x0256 },
- { "dtopbar", 0x018c },
- { "duhiragana", 0x3065 },
- { "dukatakana", 0x30c5 },
- { "dz", 0x01f3 },
- { "dzaltone", 0x02a3 },
- { "dzcaron", 0x01c6 },
- { "dzcurl", 0x02a5 },
- { "dzeabkhasiancyrillic", 0x04e1 },
- { "dzecyrillic", 0x0455 },
- { "dzhecyrillic", 0x045f },
- { "earth", 0x2641 },
- { "ebengali", 0x098f },
- { "ebopomofo", 0x311c },
- { "ecandradeva", 0x090d },
- { "ecandragujarati", 0x0a8d },
- { "ecandravowelsigndeva", 0x0945 },
- { "ecandravowelsigngujarati", 0x0ac5 },
- { "ecedillabreve", 0x1e1d },
- { "echarmenian", 0x0565 },
- { "echyiwnarmenian", 0x0587 },
- { "ecircle", 0x24d4 },
- { "ecircumflexacute", 0x1ebf },
- { "ecircumflexbelow", 0x1e19 },
- { "ecircumflexdotbelow", 0x1ec7 },
- { "ecircumflexgrave", 0x1ec1 },
- { "ecircumflexhookabove", 0x1ec3 },
- { "ecircumflextilde", 0x1ec5 },
- { "ecyrillic", 0x0454 },
- { "edblgrave", 0x0205 },
- { "edeva", 0x090f },
- { "edot", 0x0117 },
- { "edotbelow", 0x1eb9 },
- { "eegurmukhi", 0x0a0f },
- { "eematragurmukhi", 0x0a47 },
- { "efcyrillic", 0x0444 },
- { "egujarati", 0x0a8f },
- { "eharmenian", 0x0567 },
- { "ehbopomofo", 0x311d },
- { "ehiragana", 0x3048 },
- { "ehookabove", 0x1ebb },
- { "eibopomofo", 0x311f },
- { "eightarabic", 0x0668 },
- { "eightbengali", 0x09ee },
- { "eightcircle", 0x2467 },
- { "eightcircleinversesansserif", 0x2791 },
- { "eightdeva", 0x096e },
- { "eighteencircle", 0x2471 },
- { "eighteenparen", 0x2485 },
- { "eighteenperiod", 0x2499 },
- { "eightgujarati", 0x0aee },
- { "eightgurmukhi", 0x0a6e },
- { "eighthackarabic", 0x0668 },
- { "eighthangzhou", 0x3028 },
- { "eighthnotebeamed", 0x266b },
- { "eightideographicparen", 0x3227 },
- { "eightinferior", 0x2088 },
- { "eightmonospace", 0xff18 },
- { "eightoldstyle", 0xf738 },
- { "eightparen", 0x247b },
- { "eightperiod", 0x248f },
- { "eightpersian", 0x06f8 },
- { "eightroman", 0x2177 },
- { "eightsuperior", 0x2078 },
- { "eightthai", 0x0e58 },
- { "einvertedbreve", 0x0207 },
- { "eiotifiedcyrillic", 0x0465 },
- { "ekatakana", 0x30a8 },
- { "ekatakanahalfwidth", 0xff74 },
- { "ekonkargurmukhi", 0x0a74 },
- { "ekorean", 0x3154 },
- { "elcyrillic", 0x043b },
- { "elevencircle", 0x246a },
- { "elevenparen", 0x247e },
- { "elevenperiod", 0x2492 },
- { "elevenroman", 0x217a },
- { "ellipsisvertical", 0x22ee },
- { "emacronacute", 0x1e17 },
- { "emacrongrave", 0x1e15 },
- { "emcyrillic", 0x043c },
- { "emdashvertical", 0xfe31 },
- { "emonospace", 0xff45 },
- { "emphasismarkarmenian", 0x055b },
- { "enbopomofo", 0x3123 },
- { "encyrillic", 0x043d },
- { "endashvertical", 0xfe32 },
- { "endescendercyrillic", 0x04a3 },
- { "engbopomofo", 0x3125 },
- { "enghecyrillic", 0x04a5 },
- { "enhookcyrillic", 0x04c8 },
- { "enspace", 0x2002 },
- { "eokorean", 0x3153 },
- { "eopen", 0x025b },
- { "eopenclosed", 0x029a },
- { "eopenreversed", 0x025c },
- { "eopenreversedclosed", 0x025e },
- { "eopenreversedhook", 0x025d },
- { "eparen", 0x24a0 },
- { "equalmonospace", 0xff1d },
- { "equalsmall", 0xfe66 },
- { "equalsuperior", 0x207c },
- { "erbopomofo", 0x3126 },
- { "ercyrillic", 0x0440 },
- { "ereversed", 0x0258 },
- { "ereversedcyrillic", 0x044d },
- { "escyrillic", 0x0441 },
- { "esdescendercyrillic", 0x04ab },
- { "esh", 0x0283 },
- { "eshcurl", 0x0286 },
- { "eshortdeva", 0x090e },
- { "eshortvowelsigndeva", 0x0946 },
- { "eshreversedloop", 0x01aa },
- { "eshsquatreversed", 0x0285 },
- { "esmallhiragana", 0x3047 },
- { "esmallkatakana", 0x30a7 },
- { "esmallkatakanahalfwidth", 0xff6a },
- { "esuperior", 0xf6ec },
- { "etarmenian", 0x0568 },
- { "etilde", 0x1ebd },
- { "etildebelow", 0x1e1b },
- { "etnahtafoukhhebrew", 0x0591 },
- { "etnahtafoukhlefthebrew", 0x0591 },
- { "etnahtahebrew", 0x0591 },
- { "etnahtalefthebrew", 0x0591 },
- { "eturned", 0x01dd },
- { "eukorean", 0x3161 },
- { "euro", 0x20ac },
- { "evowelsignbengali", 0x09c7 },
- { "evowelsigndeva", 0x0947 },
- { "evowelsigngujarati", 0x0ac7 },
- { "exclamarmenian", 0x055c },
- { "exclamdownsmall", 0xf7a1 },
- { "exclammonospace", 0xff01 },
- { "exclamsmall", 0xf721 },
- { "ezh", 0x0292 },
- { "ezhcaron", 0x01ef },
- { "ezhcurl", 0x0293 },
- { "ezhreversed", 0x01b9 },
- { "ezhtail", 0x01ba },
- { "fadeva", 0x095e },
- { "fagurmukhi", 0x0a5e },
- { "fahrenheit", 0x2109 },
- { "fathaarabic", 0x064e },
- { "fathalowarabic", 0x064e },
- { "fathatanarabic", 0x064b },
- { "fbopomofo", 0x3108 },
- { "fcircle", 0x24d5 },
- { "fdotaccent", 0x1e1f },
- { "feharabic", 0x0641 },
- { "feharmenian", 0x0586 },
- { "fehfinalarabic", 0xfed2 },
- { "fehinitialarabic", 0xfed3 },
- { "fehmedialarabic", 0xfed4 },
- { "feicoptic", 0x03e5 },
- { "ff", 0xfb00 },
- { "ffi", 0xfb03 },
- { "ffl", 0xfb04 },
- { "fi", 0xfb01 },
- { "fifteencircle", 0x246e },
- { "fifteenparen", 0x2482 },
- { "fifteenperiod", 0x2496 },
- { "finalkaf", 0x05da },
- { "finalkafdagesh", 0xfb3a },
- { "finalkafdageshhebrew", 0xfb3a },
- { "finalkafhebrew", 0x05da },
- { "finalkafqamats", 0x05da },
- { "finalkafqamatshebrew", 0x05da },
- { "finalkafsheva", 0x05da },
- { "finalkafshevahebrew", 0x05da },
- { "finalmem", 0x05dd },
- { "finalmemhebrew", 0x05dd },
- { "finalnun", 0x05df },
- { "finalnunhebrew", 0x05df },
- { "finalpe", 0x05e3 },
- { "finalpehebrew", 0x05e3 },
- { "finaltsadi", 0x05e5 },
- { "finaltsadihebrew", 0x05e5 },
- { "firsttonechinese", 0x02c9 },
- { "fisheye", 0x25c9 },
- { "fitacyrillic", 0x0473 },
- { "fivearabic", 0x0665 },
- { "fivebengali", 0x09eb },
- { "fivecircle", 0x2464 },
- { "fivecircleinversesansserif", 0x278e },
- { "fivedeva", 0x096b },
- { "fivegujarati", 0x0aeb },
- { "fivegurmukhi", 0x0a6b },
- { "fivehackarabic", 0x0665 },
- { "fivehangzhou", 0x3025 },
- { "fiveideographicparen", 0x3224 },
- { "fiveinferior", 0x2085 },
- { "fivemonospace", 0xff15 },
- { "fiveoldstyle", 0xf735 },
- { "fiveparen", 0x2478 },
- { "fiveperiod", 0x248c },
- { "fivepersian", 0x06f5 },
- { "fiveroman", 0x2174 },
- { "fivesuperior", 0x2075 },
- { "fivethai", 0x0e55 },
- { "fl", 0xfb02 },
- { "fmonospace", 0xff46 },
- { "fmsquare", 0x3399 },
- { "fofanthai", 0x0e1f },
- { "fofathai", 0x0e1d },
- { "fongmanthai", 0x0e4f },
- { "forall", 0x2200 },
- { "fourarabic", 0x0664 },
- { "fourbengali", 0x09ea },
- { "fourcircle", 0x2463 },
- { "fourcircleinversesansserif", 0x278d },
- { "fourdeva", 0x096a },
- { "fourgujarati", 0x0aea },
- { "fourgurmukhi", 0x0a6a },
- { "fourhackarabic", 0x0664 },
- { "fourhangzhou", 0x3024 },
- { "fourideographicparen", 0x3223 },
- { "fourinferior", 0x2084 },
- { "fourmonospace", 0xff14 },
- { "fournumeratorbengali", 0x09f7 },
- { "fouroldstyle", 0xf734 },
- { "fourparen", 0x2477 },
- { "fourperiod", 0x248b },
- { "fourpersian", 0x06f4 },
- { "fourroman", 0x2173 },
- { "foursuperior", 0x2074 },
- { "fourteencircle", 0x246d },
- { "fourteenparen", 0x2481 },
- { "fourteenperiod", 0x2495 },
- { "fourthai", 0x0e54 },
- { "fourthtonechinese", 0x02cb },
- { "fparen", 0x24a1 },
- { "gabengali", 0x0997 },
- { "gacute", 0x01f5 },
- { "gadeva", 0x0917 },
- { "gafarabic", 0x06af },
- { "gaffinalarabic", 0xfb93 },
- { "gafinitialarabic", 0xfb94 },
- { "gafmedialarabic", 0xfb95 },
- { "gagujarati", 0x0a97 },
- { "gagurmukhi", 0x0a17 },
- { "gahiragana", 0x304c },
- { "gakatakana", 0x30ac },
- { "gammalatinsmall", 0x0263 },
- { "gammasuperior", 0x02e0 },
- { "gangiacoptic", 0x03eb },
- { "gbopomofo", 0x310d },
- { "gcedilla", 0x0123 },
- { "gcircle", 0x24d6 },
- { "gdot", 0x0121 },
- { "gecyrillic", 0x0433 },
- { "gehiragana", 0x3052 },
- { "gekatakana", 0x30b2 },
- { "geometricallyequal", 0x2251 },
- { "gereshaccenthebrew", 0x059c },
- { "gereshhebrew", 0x05f3 },
- { "gereshmuqdamhebrew", 0x059d },
- { "gershayimaccenthebrew", 0x059e },
- { "gershayimhebrew", 0x05f4 },
- { "getamark", 0x3013 },
- { "ghabengali", 0x0998 },
- { "ghadarmenian", 0x0572 },
- { "ghadeva", 0x0918 },
- { "ghagujarati", 0x0a98 },
- { "ghagurmukhi", 0x0a18 },
- { "ghainarabic", 0x063a },
- { "ghainfinalarabic", 0xfece },
- { "ghaininitialarabic", 0xfecf },
- { "ghainmedialarabic", 0xfed0 },
- { "ghemiddlehookcyrillic", 0x0495 },
- { "ghestrokecyrillic", 0x0493 },
- { "gheupturncyrillic", 0x0491 },
- { "ghhadeva", 0x095a },
- { "ghhagurmukhi", 0x0a5a },
- { "ghook", 0x0260 },
- { "ghzsquare", 0x3393 },
- { "gihiragana", 0x304e },
- { "gikatakana", 0x30ae },
- { "gimarmenian", 0x0563 },
- { "gimel", 0x05d2 },
- { "gimeldagesh", 0xfb32 },
- { "gimeldageshhebrew", 0xfb32 },
- { "gimelhebrew", 0x05d2 },
- { "gjecyrillic", 0x0453 },
- { "glottalinvertedstroke", 0x01be },
- { "glottalstop", 0x0294 },
- { "glottalstopinverted", 0x0296 },
- { "glottalstopmod", 0x02c0 },
- { "glottalstopreversed", 0x0295 },
- { "glottalstopreversedmod", 0x02c1 },
- { "glottalstopreversedsuperior", 0x02e4 },
- { "glottalstopstroke", 0x02a1 },
- { "glottalstopstrokereversed", 0x02a2 },
- { "gmacron", 0x1e21 },
- { "gmonospace", 0xff47 },
- { "gohiragana", 0x3054 },
- { "gokatakana", 0x30b4 },
- { "gparen", 0x24a2 },
- { "gpasquare", 0x33ac },
- { "gravebelowcmb", 0x0316 },
- { "gravecmb", 0x0300 },
- { "gravedeva", 0x0953 },
- { "gravelowmod", 0x02ce },
- { "gravemonospace", 0xff40 },
- { "gravetonecmb", 0x0340 },
- { "greaterequalorless", 0x22db },
- { "greatermonospace", 0xff1e },
- { "greaterorequivalent", 0x2273 },
- { "greaterorless", 0x2277 },
- { "greateroverequal", 0x2267 },
- { "greatersmall", 0xfe65 },
- { "gscript", 0x0261 },
- { "gstroke", 0x01e5 },
- { "guhiragana", 0x3050 },
- { "gukatakana", 0x30b0 },
- { "guramusquare", 0x3318 },
- { "gysquare", 0x33c9 },
- { "haabkhasiancyrillic", 0x04a9 },
- { "haaltonearabic", 0x06c1 },
- { "habengali", 0x09b9 },
- { "hadescendercyrillic", 0x04b3 },
- { "hadeva", 0x0939 },
- { "hagujarati", 0x0ab9 },
- { "hagurmukhi", 0x0a39 },
- { "haharabic", 0x062d },
- { "hahfinalarabic", 0xfea2 },
- { "hahinitialarabic", 0xfea3 },
- { "hahiragana", 0x306f },
- { "hahmedialarabic", 0xfea4 },
- { "haitusquare", 0x332a },
- { "hakatakana", 0x30cf },
- { "hakatakanahalfwidth", 0xff8a },
- { "halantgurmukhi", 0x0a4d },
- { "hamzaarabic", 0x0621 },
- { "hamzadammaarabic", 0x0621 },
- { "hamzadammatanarabic", 0x0621 },
- { "hamzafathaarabic", 0x0621 },
- { "hamzafathatanarabic", 0x0621 },
- { "hamzalowarabic", 0x0621 },
- { "hamzalowkasraarabic", 0x0621 },
- { "hamzalowkasratanarabic", 0x0621 },
- { "hamzasukunarabic", 0x0621 },
- { "hangulfiller", 0x3164 },
- { "hardsigncyrillic", 0x044a },
- { "harpoonleftbarbup", 0x21bc },
- { "harpoonrightbarbup", 0x21c0 },
- { "hasquare", 0x33ca },
- { "hatafpatah", 0x05b2 },
- { "hatafpatah16", 0x05b2 },
- { "hatafpatah23", 0x05b2 },
- { "hatafpatah2f", 0x05b2 },
- { "hatafpatahhebrew", 0x05b2 },
- { "hatafpatahnarrowhebrew", 0x05b2 },
- { "hatafpatahquarterhebrew", 0x05b2 },
- { "hatafpatahwidehebrew", 0x05b2 },
- { "hatafqamats", 0x05b3 },
- { "hatafqamats1b", 0x05b3 },
- { "hatafqamats28", 0x05b3 },
- { "hatafqamats34", 0x05b3 },
- { "hatafqamatshebrew", 0x05b3 },
- { "hatafqamatsnarrowhebrew", 0x05b3 },
- { "hatafqamatsquarterhebrew", 0x05b3 },
- { "hatafqamatswidehebrew", 0x05b3 },
- { "hatafsegol", 0x05b1 },
- { "hatafsegol17", 0x05b1 },
- { "hatafsegol24", 0x05b1 },
- { "hatafsegol30", 0x05b1 },
- { "hatafsegolhebrew", 0x05b1 },
- { "hatafsegolnarrowhebrew", 0x05b1 },
- { "hatafsegolquarterhebrew", 0x05b1 },
- { "hatafsegolwidehebrew", 0x05b1 },
- { "hbopomofo", 0x310f },
- { "hbrevebelow", 0x1e2b },
- { "hcedilla", 0x1e29 },
- { "hcircle", 0x24d7 },
- { "hdieresis", 0x1e27 },
- { "hdotaccent", 0x1e23 },
- { "hdotbelow", 0x1e25 },
- { "he", 0x05d4 },
- { "heartsuitblack", 0x2665 },
- { "heartsuitwhite", 0x2661 },
- { "hedagesh", 0xfb34 },
- { "hedageshhebrew", 0xfb34 },
- { "hehaltonearabic", 0x06c1 },
- { "heharabic", 0x0647 },
- { "hehebrew", 0x05d4 },
- { "hehfinalaltonearabic", 0xfba7 },
- { "hehfinalalttwoarabic", 0xfeea },
- { "hehfinalarabic", 0xfeea },
- { "hehhamzaabovefinalarabic", 0xfba5 },
- { "hehhamzaaboveisolatedarabic", 0xfba4 },
- { "hehinitialaltonearabic", 0xfba8 },
- { "hehinitialarabic", 0xfeeb },
- { "hehiragana", 0x3078 },
- { "hehmedialaltonearabic", 0xfba9 },
- { "hehmedialarabic", 0xfeec },
- { "heiseierasquare", 0x337b },
- { "hekatakana", 0x30d8 },
- { "hekatakanahalfwidth", 0xff8d },
- { "hekutaarusquare", 0x3336 },
- { "henghook", 0x0267 },
- { "herutusquare", 0x3339 },
- { "het", 0x05d7 },
- { "hethebrew", 0x05d7 },
- { "hhook", 0x0266 },
- { "hhooksuperior", 0x02b1 },
- { "hieuhacirclekorean", 0x327b },
- { "hieuhaparenkorean", 0x321b },
- { "hieuhcirclekorean", 0x326d },
- { "hieuhkorean", 0x314e },
- { "hieuhparenkorean", 0x320d },
- { "hihiragana", 0x3072 },
- { "hikatakana", 0x30d2 },
- { "hikatakanahalfwidth", 0xff8b },
- { "hiriq", 0x05b4 },
- { "hiriq14", 0x05b4 },
- { "hiriq21", 0x05b4 },
- { "hiriq2d", 0x05b4 },
- { "hiriqhebrew", 0x05b4 },
- { "hiriqnarrowhebrew", 0x05b4 },
- { "hiriqquarterhebrew", 0x05b4 },
- { "hiriqwidehebrew", 0x05b4 },
- { "hlinebelow", 0x1e96 },
- { "hmonospace", 0xff48 },
- { "hoarmenian", 0x0570 },
- { "hohipthai", 0x0e2b },
- { "hohiragana", 0x307b },
- { "hokatakana", 0x30db },
- { "hokatakanahalfwidth", 0xff8e },
- { "holam", 0x05b9 },
- { "holam19", 0x05b9 },
- { "holam26", 0x05b9 },
- { "holam32", 0x05b9 },
- { "holamhebrew", 0x05b9 },
- { "holamnarrowhebrew", 0x05b9 },
- { "holamquarterhebrew", 0x05b9 },
- { "holamwidehebrew", 0x05b9 },
- { "honokhukthai", 0x0e2e },
- { "hookcmb", 0x0309 },
- { "hookpalatalizedbelowcmb", 0x0321 },
- { "hookretroflexbelowcmb", 0x0322 },
- { "hoonsquare", 0x3342 },
- { "horicoptic", 0x03e9 },
- { "horizontalbar", 0x2015 },
- { "horncmb", 0x031b },
- { "hotsprings", 0x2668 },
- { "hparen", 0x24a3 },
- { "hsuperior", 0x02b0 },
- { "hturned", 0x0265 },
- { "huhiragana", 0x3075 },
- { "huiitosquare", 0x3333 },
- { "hukatakana", 0x30d5 },
- { "hukatakanahalfwidth", 0xff8c },
- { "hungarumlautcmb", 0x030b },
- { "hv", 0x0195 },
- { "hypheninferior", 0xf6e5 },
- { "hyphenmonospace", 0xff0d },
- { "hyphensmall", 0xfe63 },
- { "hyphensuperior", 0xf6e6 },
- { "hyphentwo", 0x2010 },
- { "iacyrillic", 0x044f },
- { "ibengali", 0x0987 },
- { "ibopomofo", 0x3127 },
- { "icaron", 0x01d0 },
- { "icircle", 0x24d8 },
- { "icyrillic", 0x0456 },
- { "idblgrave", 0x0209 },
- { "ideographearthcircle", 0x328f },
- { "ideographfirecircle", 0x328b },
- { "ideographicallianceparen", 0x323f },
- { "ideographiccallparen", 0x323a },
- { "ideographiccentrecircle", 0x32a5 },
- { "ideographicclose", 0x3006 },
- { "ideographiccomma", 0x3001 },
- { "ideographiccommaleft", 0xff64 },
- { "ideographiccongratulationparen", 0x3237 },
- { "ideographiccorrectcircle", 0x32a3 },
- { "ideographicearthparen", 0x322f },
- { "ideographicenterpriseparen", 0x323d },
- { "ideographicexcellentcircle", 0x329d },
- { "ideographicfestivalparen", 0x3240 },
- { "ideographicfinancialcircle", 0x3296 },
- { "ideographicfinancialparen", 0x3236 },
- { "ideographicfireparen", 0x322b },
- { "ideographichaveparen", 0x3232 },
- { "ideographichighcircle", 0x32a4 },
- { "ideographiciterationmark", 0x3005 },
- { "ideographiclaborcircle", 0x3298 },
- { "ideographiclaborparen", 0x3238 },
- { "ideographicleftcircle", 0x32a7 },
- { "ideographiclowcircle", 0x32a6 },
- { "ideographicmedicinecircle", 0x32a9 },
- { "ideographicmetalparen", 0x322e },
- { "ideographicmoonparen", 0x322a },
- { "ideographicnameparen", 0x3234 },
- { "ideographicperiod", 0x3002 },
- { "ideographicprintcircle", 0x329e },
- { "ideographicreachparen", 0x3243 },
- { "ideographicrepresentparen", 0x3239 },
- { "ideographicresourceparen", 0x323e },
- { "ideographicrightcircle", 0x32a8 },
- { "ideographicsecretcircle", 0x3299 },
- { "ideographicselfparen", 0x3242 },
- { "ideographicsocietyparen", 0x3233 },
- { "ideographicspace", 0x3000 },
- { "ideographicspecialparen", 0x3235 },
- { "ideographicstockparen", 0x3231 },
- { "ideographicstudyparen", 0x323b },
- { "ideographicsunparen", 0x3230 },
- { "ideographicsuperviseparen", 0x323c },
- { "ideographicwaterparen", 0x322c },
- { "ideographicwoodparen", 0x322d },
- { "ideographiczero", 0x3007 },
- { "ideographmetalcircle", 0x328e },
- { "ideographmooncircle", 0x328a },
- { "ideographnamecircle", 0x3294 },
- { "ideographsuncircle", 0x3290 },
- { "ideographwatercircle", 0x328c },
- { "ideographwoodcircle", 0x328d },
- { "ideva", 0x0907 },
- { "idieresisacute", 0x1e2f },
- { "idieresiscyrillic", 0x04e5 },
- { "idotbelow", 0x1ecb },
- { "iebrevecyrillic", 0x04d7 },
- { "iecyrillic", 0x0435 },
- { "ieungacirclekorean", 0x3275 },
- { "ieungaparenkorean", 0x3215 },
- { "ieungcirclekorean", 0x3267 },
- { "ieungkorean", 0x3147 },
- { "ieungparenkorean", 0x3207 },
- { "igujarati", 0x0a87 },
- { "igurmukhi", 0x0a07 },
- { "ihiragana", 0x3044 },
- { "ihookabove", 0x1ec9 },
- { "iibengali", 0x0988 },
- { "iicyrillic", 0x0438 },
- { "iideva", 0x0908 },
- { "iigujarati", 0x0a88 },
- { "iigurmukhi", 0x0a08 },
- { "iimatragurmukhi", 0x0a40 },
- { "iinvertedbreve", 0x020b },
- { "iishortcyrillic", 0x0439 },
- { "iivowelsignbengali", 0x09c0 },
- { "iivowelsigndeva", 0x0940 },
- { "iivowelsigngujarati", 0x0ac0 },
- { "ikatakana", 0x30a4 },
- { "ikatakanahalfwidth", 0xff72 },
- { "ikorean", 0x3163 },
- { "ilde", 0x02dc },
- { "iluyhebrew", 0x05ac },
- { "imacroncyrillic", 0x04e3 },
- { "imageorapproximatelyequal", 0x2253 },
- { "imatragurmukhi", 0x0a3f },
- { "imonospace", 0xff49 },
- { "increment", 0x2206 },
- { "iniarmenian", 0x056b },
- { "integralbottom", 0x2321 },
- { "integralex", 0xf8f5 },
- { "integraltop", 0x2320 },
- { "intisquare", 0x3305 },
- { "iocyrillic", 0x0451 },
- { "iotalatin", 0x0269 },
- { "iparen", 0x24a4 },
- { "irigurmukhi", 0x0a72 },
- { "ismallhiragana", 0x3043 },
- { "ismallkatakana", 0x30a3 },
- { "ismallkatakanahalfwidth", 0xff68 },
- { "issharbengali", 0x09fa },
- { "istroke", 0x0268 },
- { "isuperior", 0xf6ed },
- { "iterationhiragana", 0x309d },
- { "iterationkatakana", 0x30fd },
- { "itildebelow", 0x1e2d },
- { "iubopomofo", 0x3129 },
- { "iucyrillic", 0x044e },
- { "ivowelsignbengali", 0x09bf },
- { "ivowelsigndeva", 0x093f },
- { "ivowelsigngujarati", 0x0abf },
- { "izhitsacyrillic", 0x0475 },
- { "izhitsadblgravecyrillic", 0x0477 },
- { "jaarmenian", 0x0571 },
- { "jabengali", 0x099c },
- { "jadeva", 0x091c },
- { "jagujarati", 0x0a9c },
- { "jagurmukhi", 0x0a1c },
- { "jbopomofo", 0x3110 },
- { "jcaron", 0x01f0 },
- { "jcircle", 0x24d9 },
- { "jcrossedtail", 0x029d },
- { "jdotlessstroke", 0x025f },
- { "jecyrillic", 0x0458 },
- { "jeemarabic", 0x062c },
- { "jeemfinalarabic", 0xfe9e },
- { "jeeminitialarabic", 0xfe9f },
- { "jeemmedialarabic", 0xfea0 },
- { "jeharabic", 0x0698 },
- { "jehfinalarabic", 0xfb8b },
- { "jhabengali", 0x099d },
- { "jhadeva", 0x091d },
- { "jhagujarati", 0x0a9d },
- { "jhagurmukhi", 0x0a1d },
- { "jheharmenian", 0x057b },
- { "jis", 0x3004 },
- { "jmonospace", 0xff4a },
- { "jparen", 0x24a5 },
- { "jsuperior", 0x02b2 },
- { "kabashkircyrillic", 0x04a1 },
- { "kabengali", 0x0995 },
- { "kacute", 0x1e31 },
- { "kacyrillic", 0x043a },
- { "kadescendercyrillic", 0x049b },
- { "kadeva", 0x0915 },
- { "kaf", 0x05db },
- { "kafarabic", 0x0643 },
- { "kafdagesh", 0xfb3b },
- { "kafdageshhebrew", 0xfb3b },
- { "kaffinalarabic", 0xfeda },
- { "kafhebrew", 0x05db },
- { "kafinitialarabic", 0xfedb },
- { "kafmedialarabic", 0xfedc },
- { "kafrafehebrew", 0xfb4d },
- { "kagujarati", 0x0a95 },
- { "kagurmukhi", 0x0a15 },
- { "kahiragana", 0x304b },
- { "kahookcyrillic", 0x04c4 },
- { "kakatakana", 0x30ab },
- { "kakatakanahalfwidth", 0xff76 },
- { "kappasymbolgreek", 0x03f0 },
- { "kapyeounmieumkorean", 0x3171 },
- { "kapyeounphieuphkorean", 0x3184 },
- { "kapyeounpieupkorean", 0x3178 },
- { "kapyeounssangpieupkorean", 0x3179 },
- { "karoriisquare", 0x330d },
- { "kashidaautoarabic", 0x0640 },
- { "kashidaautonosidebearingarabic", 0x0640 },
- { "kasmallkatakana", 0x30f5 },
- { "kasquare", 0x3384 },
- { "kasraarabic", 0x0650 },
- { "kasratanarabic", 0x064d },
- { "kastrokecyrillic", 0x049f },
- { "katahiraprolongmarkhalfwidth", 0xff70 },
- { "kaverticalstrokecyrillic", 0x049d },
- { "kbopomofo", 0x310e },
- { "kcalsquare", 0x3389 },
- { "kcaron", 0x01e9 },
- { "kcedilla", 0x0137 },
- { "kcircle", 0x24da },
- { "kdotbelow", 0x1e33 },
- { "keharmenian", 0x0584 },
- { "kehiragana", 0x3051 },
- { "kekatakana", 0x30b1 },
- { "kekatakanahalfwidth", 0xff79 },
- { "kenarmenian", 0x056f },
- { "kesmallkatakana", 0x30f6 },
- { "khabengali", 0x0996 },
- { "khacyrillic", 0x0445 },
- { "khadeva", 0x0916 },
- { "khagujarati", 0x0a96 },
- { "khagurmukhi", 0x0a16 },
- { "khaharabic", 0x062e },
- { "khahfinalarabic", 0xfea6 },
- { "khahinitialarabic", 0xfea7 },
- { "khahmedialarabic", 0xfea8 },
- { "kheicoptic", 0x03e7 },
- { "khhadeva", 0x0959 },
- { "khhagurmukhi", 0x0a59 },
- { "khieukhacirclekorean", 0x3278 },
- { "khieukhaparenkorean", 0x3218 },
- { "khieukhcirclekorean", 0x326a },
- { "khieukhkorean", 0x314b },
- { "khieukhparenkorean", 0x320a },
- { "khokhaithai", 0x0e02 },
- { "khokhonthai", 0x0e05 },
- { "khokhuatthai", 0x0e03 },
- { "khokhwaithai", 0x0e04 },
- { "khomutthai", 0x0e5b },
- { "khook", 0x0199 },
- { "khorakhangthai", 0x0e06 },
- { "khzsquare", 0x3391 },
- { "kihiragana", 0x304d },
- { "kikatakana", 0x30ad },
- { "kikatakanahalfwidth", 0xff77 },
- { "kiroguramusquare", 0x3315 },
- { "kiromeetorusquare", 0x3316 },
- { "kirosquare", 0x3314 },
- { "kiyeokacirclekorean", 0x326e },
- { "kiyeokaparenkorean", 0x320e },
- { "kiyeokcirclekorean", 0x3260 },
- { "kiyeokkorean", 0x3131 },
- { "kiyeokparenkorean", 0x3200 },
- { "kiyeoksioskorean", 0x3133 },
- { "kjecyrillic", 0x045c },
- { "klinebelow", 0x1e35 },
- { "klsquare", 0x3398 },
- { "kmcubedsquare", 0x33a6 },
- { "kmonospace", 0xff4b },
- { "kmsquaredsquare", 0x33a2 },
- { "kohiragana", 0x3053 },
- { "kohmsquare", 0x33c0 },
- { "kokaithai", 0x0e01 },
- { "kokatakana", 0x30b3 },
- { "kokatakanahalfwidth", 0xff7a },
- { "kooposquare", 0x331e },
- { "koppacyrillic", 0x0481 },
- { "koreanstandardsymbol", 0x327f },
- { "koroniscmb", 0x0343 },
- { "kparen", 0x24a6 },
- { "kpasquare", 0x33aa },
- { "ksicyrillic", 0x046f },
- { "ktsquare", 0x33cf },
- { "kturned", 0x029e },
- { "kuhiragana", 0x304f },
- { "kukatakana", 0x30af },
- { "kukatakanahalfwidth", 0xff78 },
- { "kvsquare", 0x33b8 },
- { "kwsquare", 0x33be },
- { "labengali", 0x09b2 },
- { "ladeva", 0x0932 },
- { "lagujarati", 0x0ab2 },
- { "lagurmukhi", 0x0a32 },
- { "lakkhangyaothai", 0x0e45 },
- { "lamaleffinalarabic", 0xfefc },
- { "lamalefhamzaabovefinalarabic", 0xfef8 },
- { "lamalefhamzaaboveisolatedarabic", 0xfef7 },
- { "lamalefhamzabelowfinalarabic", 0xfefa },
- { "lamalefhamzabelowisolatedarabic", 0xfef9 },
- { "lamalefisolatedarabic", 0xfefb },
- { "lamalefmaddaabovefinalarabic", 0xfef6 },
- { "lamalefmaddaaboveisolatedarabic", 0xfef5 },
- { "lamarabic", 0x0644 },
- { "lambdastroke", 0x019b },
- { "lamed", 0x05dc },
- { "lameddagesh", 0xfb3c },
- { "lameddageshhebrew", 0xfb3c },
- { "lamedhebrew", 0x05dc },
- { "lamedholam", 0x05dc },
- { "lamedholamdagesh", 0x05dc },
- { "lamedholamdageshhebrew", 0x05dc },
- { "lamedholamhebrew", 0x05dc },
- { "lamfinalarabic", 0xfede },
- { "lamhahinitialarabic", 0xfcca },
- { "laminitialarabic", 0xfedf },
- { "lamjeeminitialarabic", 0xfcc9 },
- { "lamkhahinitialarabic", 0xfccb },
- { "lamlamhehisolatedarabic", 0xfdf2 },
- { "lammedialarabic", 0xfee0 },
- { "lammeemhahinitialarabic", 0xfd88 },
- { "lammeeminitialarabic", 0xfccc },
- { "lammeemjeeminitialarabic", 0xfedf },
- { "lammeemkhahinitialarabic", 0xfedf },
- { "largecircle", 0x25ef },
- { "lbar", 0x019a },
- { "lbelt", 0x026c },
- { "lbopomofo", 0x310c },
- { "lcedilla", 0x013c },
- { "lcircle", 0x24db },
- { "lcircumflexbelow", 0x1e3d },
- { "ldotaccent", 0x0140 },
- { "ldotbelow", 0x1e37 },
- { "ldotbelowmacron", 0x1e39 },
- { "leftangleabovecmb", 0x031a },
- { "lefttackbelowcmb", 0x0318 },
- { "lessequalorgreater", 0x22da },
- { "lessmonospace", 0xff1c },
- { "lessorequivalent", 0x2272 },
- { "lessorgreater", 0x2276 },
- { "lessoverequal", 0x2266 },
- { "lesssmall", 0xfe64 },
- { "lezh", 0x026e },
- { "lhookretroflex", 0x026d },
- { "liwnarmenian", 0x056c },
- { "lj", 0x01c9 },
- { "ljecyrillic", 0x0459 },
- { "ll", 0xf6c0 },
- { "lladeva", 0x0933 },
- { "llagujarati", 0x0ab3 },
- { "llinebelow", 0x1e3b },
- { "llladeva", 0x0934 },
- { "llvocalicbengali", 0x09e1 },
- { "llvocalicdeva", 0x0961 },
- { "llvocalicvowelsignbengali", 0x09e3 },
- { "llvocalicvowelsigndeva", 0x0963 },
- { "lmiddletilde", 0x026b },
- { "lmonospace", 0xff4c },
- { "lmsquare", 0x33d0 },
- { "lochulathai", 0x0e2c },
- { "logicalnotreversed", 0x2310 },
- { "lolingthai", 0x0e25 },
- { "lowlinecenterline", 0xfe4e },
- { "lowlinecmb", 0x0332 },
- { "lowlinedashed", 0xfe4d },
- { "lparen", 0x24a7 },
- { "lsquare", 0x2113 },
- { "lsuperior", 0xf6ee },
- { "luthai", 0x0e26 },
- { "lvocalicbengali", 0x098c },
- { "lvocalicdeva", 0x090c },
- { "lvocalicvowelsignbengali", 0x09e2 },
- { "lvocalicvowelsigndeva", 0x0962 },
- { "lxsquare", 0x33d3 },
- { "mabengali", 0x09ae },
- { "macronbelowcmb", 0x0331 },
- { "macroncmb", 0x0304 },
- { "macronlowmod", 0x02cd },
- { "macronmonospace", 0xffe3 },
- { "macute", 0x1e3f },
- { "madeva", 0x092e },
- { "magujarati", 0x0aae },
- { "magurmukhi", 0x0a2e },
- { "mahapakhhebrew", 0x05a4 },
- { "mahapakhlefthebrew", 0x05a4 },
- { "mahiragana", 0x307e },
- { "maichattawalowleftthai", 0xf895 },
- { "maichattawalowrightthai", 0xf894 },
- { "maichattawathai", 0x0e4b },
- { "maichattawaupperleftthai", 0xf893 },
- { "maieklowleftthai", 0xf88c },
- { "maieklowrightthai", 0xf88b },
- { "maiekthai", 0x0e48 },
- { "maiekupperleftthai", 0xf88a },
- { "maihanakatleftthai", 0xf884 },
- { "maihanakatthai", 0x0e31 },
- { "maitaikhuleftthai", 0xf889 },
- { "maitaikhuthai", 0x0e47 },
- { "maitholowleftthai", 0xf88f },
- { "maitholowrightthai", 0xf88e },
- { "maithothai", 0x0e49 },
- { "maithoupperleftthai", 0xf88d },
- { "maitrilowleftthai", 0xf892 },
- { "maitrilowrightthai", 0xf891 },
- { "maitrithai", 0x0e4a },
- { "maitriupperleftthai", 0xf890 },
- { "maiyamokthai", 0x0e46 },
- { "makatakana", 0x30de },
- { "makatakanahalfwidth", 0xff8f },
- { "mansyonsquare", 0x3347 },
- { "maqafhebrew", 0x05be },
- { "mars", 0x2642 },
- { "masoracirclehebrew", 0x05af },
- { "masquare", 0x3383 },
- { "mbopomofo", 0x3107 },
- { "mbsquare", 0x33d4 },
- { "mcircle", 0x24dc },
- { "mcubedsquare", 0x33a5 },
- { "mdotaccent", 0x1e41 },
- { "mdotbelow", 0x1e43 },
- { "meemarabic", 0x0645 },
- { "meemfinalarabic", 0xfee2 },
- { "meeminitialarabic", 0xfee3 },
- { "meemmedialarabic", 0xfee4 },
- { "meemmeeminitialarabic", 0xfcd1 },
- { "meemmeemisolatedarabic", 0xfc48 },
- { "meetorusquare", 0x334d },
- { "mehiragana", 0x3081 },
- { "meizierasquare", 0x337e },
- { "mekatakana", 0x30e1 },
- { "mekatakanahalfwidth", 0xff92 },
- { "mem", 0x05de },
- { "memdagesh", 0xfb3e },
- { "memdageshhebrew", 0xfb3e },
- { "memhebrew", 0x05de },
- { "menarmenian", 0x0574 },
- { "merkhahebrew", 0x05a5 },
- { "merkhakefulahebrew", 0x05a6 },
- { "merkhakefulalefthebrew", 0x05a6 },
- { "merkhalefthebrew", 0x05a5 },
- { "mhook", 0x0271 },
- { "mhzsquare", 0x3392 },
- { "middledotkatakanahalfwidth", 0xff65 },
- { "middot", 0x00b7 },
- { "mieumacirclekorean", 0x3272 },
- { "mieumaparenkorean", 0x3212 },
- { "mieumcirclekorean", 0x3264 },
- { "mieumkorean", 0x3141 },
- { "mieumpansioskorean", 0x3170 },
- { "mieumparenkorean", 0x3204 },
- { "mieumpieupkorean", 0x316e },
- { "mieumsioskorean", 0x316f },
- { "mihiragana", 0x307f },
- { "mikatakana", 0x30df },
- { "mikatakanahalfwidth", 0xff90 },
- { "minusbelowcmb", 0x0320 },
- { "minuscircle", 0x2296 },
- { "minusmod", 0x02d7 },
- { "minusplus", 0x2213 },
- { "miribaarusquare", 0x334a },
- { "mirisquare", 0x3349 },
- { "mlonglegturned", 0x0270 },
- { "mlsquare", 0x3396 },
- { "mmcubedsquare", 0x33a3 },
- { "mmonospace", 0xff4d },
- { "mmsquaredsquare", 0x339f },
- { "mohiragana", 0x3082 },
- { "mohmsquare", 0x33c1 },
- { "mokatakana", 0x30e2 },
- { "mokatakanahalfwidth", 0xff93 },
- { "molsquare", 0x33d6 },
- { "momathai", 0x0e21 },
- { "moverssquare", 0x33a7 },
- { "moverssquaredsquare", 0x33a8 },
- { "mparen", 0x24a8 },
- { "mpasquare", 0x33ab },
- { "mssquare", 0x33b3 },
- { "msuperior", 0xf6ef },
- { "mturned", 0x026f },
- { "mu1", 0x00b5 },
- { "muasquare", 0x3382 },
- { "muchgreater", 0x226b },
- { "muchless", 0x226a },
- { "mufsquare", 0x338c },
- { "mugreek", 0x03bc },
- { "mugsquare", 0x338d },
- { "muhiragana", 0x3080 },
- { "mukatakana", 0x30e0 },
- { "mukatakanahalfwidth", 0xff91 },
- { "mulsquare", 0x3395 },
- { "mumsquare", 0x339b },
- { "munahhebrew", 0x05a3 },
- { "munahlefthebrew", 0x05a3 },
- { "musicflatsign", 0x266d },
- { "musicsharpsign", 0x266f },
- { "mussquare", 0x33b2 },
- { "muvsquare", 0x33b6 },
- { "muwsquare", 0x33bc },
- { "mvmegasquare", 0x33b9 },
- { "mvsquare", 0x33b7 },
- { "mwmegasquare", 0x33bf },
- { "mwsquare", 0x33bd },
- { "nabengali", 0x09a8 },
- { "nabla", 0x2207 },
- { "nadeva", 0x0928 },
- { "nagujarati", 0x0aa8 },
- { "nagurmukhi", 0x0a28 },
- { "nahiragana", 0x306a },
- { "nakatakana", 0x30ca },
- { "nakatakanahalfwidth", 0xff85 },
- { "nasquare", 0x3381 },
- { "nbopomofo", 0x310b },
- { "nbspace", 0x00a0 },
- { "ncedilla", 0x0146 },
- { "ncircle", 0x24dd },
- { "ncircumflexbelow", 0x1e4b },
- { "ndotaccent", 0x1e45 },
- { "ndotbelow", 0x1e47 },
- { "nehiragana", 0x306d },
- { "nekatakana", 0x30cd },
- { "nekatakanahalfwidth", 0xff88 },
- { "newsheqelsign", 0x20aa },
- { "nfsquare", 0x338b },
- { "ngabengali", 0x0999 },
- { "ngadeva", 0x0919 },
- { "ngagujarati", 0x0a99 },
- { "ngagurmukhi", 0x0a19 },
- { "ngonguthai", 0x0e07 },
- { "nhiragana", 0x3093 },
- { "nhookleft", 0x0272 },
- { "nhookretroflex", 0x0273 },
- { "nieunacirclekorean", 0x326f },
- { "nieunaparenkorean", 0x320f },
- { "nieuncieuckorean", 0x3135 },
- { "nieuncirclekorean", 0x3261 },
- { "nieunhieuhkorean", 0x3136 },
- { "nieunkorean", 0x3134 },
- { "nieunpansioskorean", 0x3168 },
- { "nieunparenkorean", 0x3201 },
- { "nieunsioskorean", 0x3167 },
- { "nieuntikeutkorean", 0x3166 },
- { "nihiragana", 0x306b },
- { "nikatakana", 0x30cb },
- { "nikatakanahalfwidth", 0xff86 },
- { "nikhahitleftthai", 0xf899 },
- { "nikhahitthai", 0x0e4d },
- { "ninearabic", 0x0669 },
- { "ninebengali", 0x09ef },
- { "ninecircle", 0x2468 },
- { "ninecircleinversesansserif", 0x2792 },
- { "ninedeva", 0x096f },
- { "ninegujarati", 0x0aef },
- { "ninegurmukhi", 0x0a6f },
- { "ninehackarabic", 0x0669 },
- { "ninehangzhou", 0x3029 },
- { "nineideographicparen", 0x3228 },
- { "nineinferior", 0x2089 },
- { "ninemonospace", 0xff19 },
- { "nineoldstyle", 0xf739 },
- { "nineparen", 0x247c },
- { "nineperiod", 0x2490 },
- { "ninepersian", 0x06f9 },
- { "nineroman", 0x2178 },
- { "ninesuperior", 0x2079 },
- { "nineteencircle", 0x2472 },
- { "nineteenparen", 0x2486 },
- { "nineteenperiod", 0x249a },
- { "ninethai", 0x0e59 },
- { "nj", 0x01cc },
- { "njecyrillic", 0x045a },
- { "nkatakana", 0x30f3 },
- { "nkatakanahalfwidth", 0xff9d },
- { "nlegrightlong", 0x019e },
- { "nlinebelow", 0x1e49 },
- { "nmonospace", 0xff4e },
- { "nmsquare", 0x339a },
- { "nnabengali", 0x09a3 },
- { "nnadeva", 0x0923 },
- { "nnagujarati", 0x0aa3 },
- { "nnagurmukhi", 0x0a23 },
- { "nnnadeva", 0x0929 },
- { "nohiragana", 0x306e },
- { "nokatakana", 0x30ce },
- { "nokatakanahalfwidth", 0xff89 },
- { "nonbreakingspace", 0x00a0 },
- { "nonenthai", 0x0e13 },
- { "nonuthai", 0x0e19 },
- { "noonarabic", 0x0646 },
- { "noonfinalarabic", 0xfee6 },
- { "noonghunnaarabic", 0x06ba },
- { "noonghunnafinalarabic", 0xfb9f },
- { "noonhehinitialarabic", 0xfee7 },
- { "nooninitialarabic", 0xfee7 },
- { "noonjeeminitialarabic", 0xfcd2 },
- { "noonjeemisolatedarabic", 0xfc4b },
- { "noonmedialarabic", 0xfee8 },
- { "noonmeeminitialarabic", 0xfcd5 },
- { "noonmeemisolatedarabic", 0xfc4e },
- { "noonnoonfinalarabic", 0xfc8d },
- { "notcontains", 0x220c },
- { "notelementof", 0x2209 },
- { "notgreater", 0x226f },
- { "notgreaternorequal", 0x2271 },
- { "notgreaternorless", 0x2279 },
- { "notidentical", 0x2262 },
- { "notless", 0x226e },
- { "notlessnorequal", 0x2270 },
- { "notparallel", 0x2226 },
- { "notprecedes", 0x2280 },
- { "notsucceeds", 0x2281 },
- { "notsuperset", 0x2285 },
- { "nowarmenian", 0x0576 },
- { "nparen", 0x24a9 },
- { "nssquare", 0x33b1 },
- { "nsuperior", 0x207f },
- { "nuhiragana", 0x306c },
- { "nukatakana", 0x30cc },
- { "nukatakanahalfwidth", 0xff87 },
- { "nuktabengali", 0x09bc },
- { "nuktadeva", 0x093c },
- { "nuktagujarati", 0x0abc },
- { "nuktagurmukhi", 0x0a3c },
- { "numbersignmonospace", 0xff03 },
- { "numbersignsmall", 0xfe5f },
- { "numeralsigngreek", 0x0374 },
- { "numeralsignlowergreek", 0x0375 },
- { "numero", 0x2116 },
- { "nun", 0x05e0 },
- { "nundagesh", 0xfb40 },
- { "nundageshhebrew", 0xfb40 },
- { "nunhebrew", 0x05e0 },
- { "nvsquare", 0x33b5 },
- { "nwsquare", 0x33bb },
- { "nyabengali", 0x099e },
- { "nyadeva", 0x091e },
- { "nyagujarati", 0x0a9e },
- { "nyagurmukhi", 0x0a1e },
- { "oangthai", 0x0e2d },
- { "obarred", 0x0275 },
- { "obarredcyrillic", 0x04e9 },
- { "obarreddieresiscyrillic", 0x04eb },
- { "obengali", 0x0993 },
- { "obopomofo", 0x311b },
- { "ocandradeva", 0x0911 },
- { "ocandragujarati", 0x0a91 },
- { "ocandravowelsigndeva", 0x0949 },
- { "ocandravowelsigngujarati", 0x0ac9 },
- { "ocaron", 0x01d2 },
- { "ocircle", 0x24de },
- { "ocircumflexacute", 0x1ed1 },
- { "ocircumflexdotbelow", 0x1ed9 },
- { "ocircumflexgrave", 0x1ed3 },
- { "ocircumflexhookabove", 0x1ed5 },
- { "ocircumflextilde", 0x1ed7 },
- { "ocyrillic", 0x043e },
- { "odblacute", 0x0151 },
- { "odblgrave", 0x020d },
- { "odeva", 0x0913 },
- { "odieresiscyrillic", 0x04e7 },
- { "odotbelow", 0x1ecd },
- { "oekorean", 0x315a },
- { "ogonekcmb", 0x0328 },
- { "ogujarati", 0x0a93 },
- { "oharmenian", 0x0585 },
- { "ohiragana", 0x304a },
- { "ohookabove", 0x1ecf },
- { "ohornacute", 0x1edb },
- { "ohorndotbelow", 0x1ee3 },
- { "ohorngrave", 0x1edd },
- { "ohornhookabove", 0x1edf },
- { "ohorntilde", 0x1ee1 },
- { "oi", 0x01a3 },
- { "oinvertedbreve", 0x020f },
- { "okatakana", 0x30aa },
- { "okatakanahalfwidth", 0xff75 },
- { "okorean", 0x3157 },
- { "olehebrew", 0x05ab },
- { "omacronacute", 0x1e53 },
- { "omacrongrave", 0x1e51 },
- { "omdeva", 0x0950 },
- { "omegacyrillic", 0x0461 },
- { "omegalatinclosed", 0x0277 },
- { "omegaroundcyrillic", 0x047b },
- { "omegatitlocyrillic", 0x047d },
- { "omgujarati", 0x0ad0 },
- { "omonospace", 0xff4f },
- { "onearabic", 0x0661 },
- { "onebengali", 0x09e7 },
- { "onecircle", 0x2460 },
- { "onecircleinversesansserif", 0x278a },
- { "onedeva", 0x0967 },
- { "onefitted", 0xf6dc },
- { "onegujarati", 0x0ae7 },
- { "onegurmukhi", 0x0a67 },
- { "onehackarabic", 0x0661 },
- { "onehangzhou", 0x3021 },
- { "oneideographicparen", 0x3220 },
- { "oneinferior", 0x2081 },
- { "onemonospace", 0xff11 },
- { "onenumeratorbengali", 0x09f4 },
- { "oneoldstyle", 0xf731 },
- { "oneparen", 0x2474 },
- { "oneperiod", 0x2488 },
- { "onepersian", 0x06f1 },
- { "oneroman", 0x2170 },
- { "onesuperior", 0x00b9 },
- { "onethai", 0x0e51 },
- { "oogonek", 0x01eb },
- { "oogonekmacron", 0x01ed },
- { "oogurmukhi", 0x0a13 },
- { "oomatragurmukhi", 0x0a4b },
- { "oopen", 0x0254 },
- { "oparen", 0x24aa },
- { "option", 0x2325 },
- { "oshortdeva", 0x0912 },
- { "oshortvowelsigndeva", 0x094a },
- { "osmallhiragana", 0x3049 },
- { "osmallkatakana", 0x30a9 },
- { "osmallkatakanahalfwidth", 0xff6b },
- { "ostrokeacute", 0x01ff },
- { "osuperior", 0xf6f0 },
- { "otcyrillic", 0x047f },
- { "otildeacute", 0x1e4d },
- { "otildedieresis", 0x1e4f },
- { "oubopomofo", 0x3121 },
- { "overline", 0x203e },
- { "overlinecenterline", 0xfe4a },
- { "overlinecmb", 0x0305 },
- { "overlinedashed", 0xfe49 },
- { "overlinedblwavy", 0xfe4c },
- { "overlinewavy", 0xfe4b },
- { "overscore", 0x00af },
- { "ovowelsignbengali", 0x09cb },
- { "ovowelsigndeva", 0x094b },
- { "ovowelsigngujarati", 0x0acb },
- { "paampssquare", 0x3380 },
- { "paasentosquare", 0x332b },
- { "pabengali", 0x09aa },
- { "pacute", 0x1e55 },
- { "padeva", 0x092a },
- { "pagedown", 0x21df },
- { "pageup", 0x21de },
- { "pagujarati", 0x0aaa },
- { "pagurmukhi", 0x0a2a },
- { "pahiragana", 0x3071 },
- { "paiyannoithai", 0x0e2f },
- { "pakatakana", 0x30d1 },
- { "palatalizationcyrilliccmb", 0x0484 },
- { "palochkacyrillic", 0x04c0 },
- { "pansioskorean", 0x317f },
- { "parallel", 0x2225 },
- { "parenleftaltonearabic", 0xfd3e },
- { "parenleftbt", 0xf8ed },
- { "parenleftex", 0xf8ec },
- { "parenleftinferior", 0x208d },
- { "parenleftmonospace", 0xff08 },
- { "parenleftsmall", 0xfe59 },
- { "parenleftsuperior", 0x207d },
- { "parenlefttp", 0xf8eb },
- { "parenleftvertical", 0xfe35 },
- { "parenrightaltonearabic", 0xfd3f },
- { "parenrightbt", 0xf8f8 },
- { "parenrightex", 0xf8f7 },
- { "parenrightinferior", 0x208e },
- { "parenrightmonospace", 0xff09 },
- { "parenrightsmall", 0xfe5a },
- { "parenrightsuperior", 0x207e },
- { "parenrighttp", 0xf8f6 },
- { "parenrightvertical", 0xfe36 },
- { "paseqhebrew", 0x05c0 },
- { "pashtahebrew", 0x0599 },
- { "pasquare", 0x33a9 },
- { "patah", 0x05b7 },
- { "patah11", 0x05b7 },
- { "patah1d", 0x05b7 },
- { "patah2a", 0x05b7 },
- { "patahhebrew", 0x05b7 },
- { "patahnarrowhebrew", 0x05b7 },
- { "patahquarterhebrew", 0x05b7 },
- { "patahwidehebrew", 0x05b7 },
- { "pazerhebrew", 0x05a1 },
- { "pbopomofo", 0x3106 },
- { "pcircle", 0x24df },
- { "pdotaccent", 0x1e57 },
- { "pe", 0x05e4 },
- { "pecyrillic", 0x043f },
- { "pedagesh", 0xfb44 },
- { "pedageshhebrew", 0xfb44 },
- { "peezisquare", 0x333b },
- { "pefinaldageshhebrew", 0xfb43 },
- { "peharabic", 0x067e },
- { "peharmenian", 0x057a },
- { "pehebrew", 0x05e4 },
- { "pehfinalarabic", 0xfb57 },
- { "pehinitialarabic", 0xfb58 },
- { "pehiragana", 0x307a },
- { "pehmedialarabic", 0xfb59 },
- { "pekatakana", 0x30da },
- { "pemiddlehookcyrillic", 0x04a7 },
- { "perafehebrew", 0xfb4e },
- { "percentarabic", 0x066a },
- { "percentmonospace", 0xff05 },
- { "percentsmall", 0xfe6a },
- { "periodarmenian", 0x0589 },
- { "periodhalfwidth", 0xff61 },
- { "periodinferior", 0xf6e7 },
- { "periodmonospace", 0xff0e },
- { "periodsmall", 0xfe52 },
- { "periodsuperior", 0xf6e8 },
- { "perispomenigreekcmb", 0x0342 },
- { "pfsquare", 0x338a },
- { "phabengali", 0x09ab },
- { "phadeva", 0x092b },
- { "phagujarati", 0x0aab },
- { "phagurmukhi", 0x0a2b },
- { "phieuphacirclekorean", 0x327a },
- { "phieuphaparenkorean", 0x321a },
- { "phieuphcirclekorean", 0x326c },
- { "phieuphkorean", 0x314d },
- { "phieuphparenkorean", 0x320c },
- { "philatin", 0x0278 },
- { "phinthuthai", 0x0e3a },
- { "phisymbolgreek", 0x03d5 },
- { "phook", 0x01a5 },
- { "phophanthai", 0x0e1e },
- { "phophungthai", 0x0e1c },
- { "phosamphaothai", 0x0e20 },
- { "pieupacirclekorean", 0x3273 },
- { "pieupaparenkorean", 0x3213 },
- { "pieupcieuckorean", 0x3176 },
- { "pieupcirclekorean", 0x3265 },
- { "pieupkiyeokkorean", 0x3172 },
- { "pieupkorean", 0x3142 },
- { "pieupparenkorean", 0x3205 },
- { "pieupsioskiyeokkorean", 0x3174 },
- { "pieupsioskorean", 0x3144 },
- { "pieupsiostikeutkorean", 0x3175 },
- { "pieupthieuthkorean", 0x3177 },
- { "pieuptikeutkorean", 0x3173 },
- { "pihiragana", 0x3074 },
- { "pikatakana", 0x30d4 },
- { "pisymbolgreek", 0x03d6 },
- { "piwrarmenian", 0x0583 },
- { "plusbelowcmb", 0x031f },
- { "pluscircle", 0x2295 },
- { "plusmod", 0x02d6 },
- { "plusmonospace", 0xff0b },
- { "plussmall", 0xfe62 },
- { "plussuperior", 0x207a },
- { "pmonospace", 0xff50 },
- { "pmsquare", 0x33d8 },
- { "pohiragana", 0x307d },
- { "pointingindexdownwhite", 0x261f },
- { "pointingindexleftwhite", 0x261c },
- { "pointingindexrightwhite", 0x261e },
- { "pointingindexupwhite", 0x261d },
- { "pokatakana", 0x30dd },
- { "poplathai", 0x0e1b },
- { "postalmark", 0x3012 },
- { "postalmarkface", 0x3020 },
- { "pparen", 0x24ab },
- { "precedes", 0x227a },
- { "primemod", 0x02b9 },
- { "primereversed", 0x2035 },
- { "projective", 0x2305 },
- { "prolongedkana", 0x30fc },
- { "propellor", 0x2318 },
- { "proportion", 0x2237 },
- { "psicyrillic", 0x0471 },
- { "psilipneumatacyrilliccmb", 0x0486 },
- { "pssquare", 0x33b0 },
- { "puhiragana", 0x3077 },
- { "pukatakana", 0x30d7 },
- { "pvsquare", 0x33b4 },
- { "pwsquare", 0x33ba },
- { "qadeva", 0x0958 },
- { "qadmahebrew", 0x05a8 },
- { "qafarabic", 0x0642 },
- { "qaffinalarabic", 0xfed6 },
- { "qafinitialarabic", 0xfed7 },
- { "qafmedialarabic", 0xfed8 },
- { "qamats", 0x05b8 },
- { "qamats10", 0x05b8 },
- { "qamats1a", 0x05b8 },
- { "qamats1c", 0x05b8 },
- { "qamats27", 0x05b8 },
- { "qamats29", 0x05b8 },
- { "qamats33", 0x05b8 },
- { "qamatsde", 0x05b8 },
- { "qamatshebrew", 0x05b8 },
- { "qamatsnarrowhebrew", 0x05b8 },
- { "qamatsqatanhebrew", 0x05b8 },
- { "qamatsqatannarrowhebrew", 0x05b8 },
- { "qamatsqatanquarterhebrew", 0x05b8 },
- { "qamatsqatanwidehebrew", 0x05b8 },
- { "qamatsquarterhebrew", 0x05b8 },
- { "qamatswidehebrew", 0x05b8 },
- { "qarneyparahebrew", 0x059f },
- { "qbopomofo", 0x3111 },
- { "qcircle", 0x24e0 },
- { "qhook", 0x02a0 },
- { "qmonospace", 0xff51 },
- { "qof", 0x05e7 },
- { "qofdagesh", 0xfb47 },
- { "qofdageshhebrew", 0xfb47 },
- { "qofhatafpatah", 0x05e7 },
- { "qofhatafpatahhebrew", 0x05e7 },
- { "qofhatafsegol", 0x05e7 },
- { "qofhatafsegolhebrew", 0x05e7 },
- { "qofhebrew", 0x05e7 },
- { "qofhiriq", 0x05e7 },
- { "qofhiriqhebrew", 0x05e7 },
- { "qofholam", 0x05e7 },
- { "qofholamhebrew", 0x05e7 },
- { "qofpatah", 0x05e7 },
- { "qofpatahhebrew", 0x05e7 },
- { "qofqamats", 0x05e7 },
- { "qofqamatshebrew", 0x05e7 },
- { "qofqubuts", 0x05e7 },
- { "qofqubutshebrew", 0x05e7 },
- { "qofsegol", 0x05e7 },
- { "qofsegolhebrew", 0x05e7 },
- { "qofsheva", 0x05e7 },
- { "qofshevahebrew", 0x05e7 },
- { "qoftsere", 0x05e7 },
- { "qoftserehebrew", 0x05e7 },
- { "qparen", 0x24ac },
- { "quarternote", 0x2669 },
- { "qubuts", 0x05bb },
- { "qubuts18", 0x05bb },
- { "qubuts25", 0x05bb },
- { "qubuts31", 0x05bb },
- { "qubutshebrew", 0x05bb },
- { "qubutsnarrowhebrew", 0x05bb },
- { "qubutsquarterhebrew", 0x05bb },
- { "qubutswidehebrew", 0x05bb },
- { "questionarabic", 0x061f },
- { "questionarmenian", 0x055e },
- { "questiondownsmall", 0xf7bf },
- { "questiongreek", 0x037e },
- { "questionmonospace", 0xff1f },
- { "questionsmall", 0xf73f },
- { "quotedblmonospace", 0xff02 },
- { "quotedblprime", 0x301e },
- { "quotedblprimereversed", 0x301d },
- { "quoteleftreversed", 0x201b },
- { "quoterightn", 0x0149 },
- { "quotesinglemonospace", 0xff07 },
- { "raarmenian", 0x057c },
- { "rabengali", 0x09b0 },
- { "radeva", 0x0930 },
- { "radicalex", 0xf8e5 },
- { "radoverssquare", 0x33ae },
- { "radoverssquaredsquare", 0x33af },
- { "radsquare", 0x33ad },
- { "rafe", 0x05bf },
- { "rafehebrew", 0x05bf },
- { "ragujarati", 0x0ab0 },
- { "ragurmukhi", 0x0a30 },
- { "rahiragana", 0x3089 },
- { "rakatakana", 0x30e9 },
- { "rakatakanahalfwidth", 0xff97 },
- { "ralowerdiagonalbengali", 0x09f1 },
- { "ramiddlediagonalbengali", 0x09f0 },
- { "ramshorn", 0x0264 },
- { "ratio", 0x2236 },
- { "rbopomofo", 0x3116 },
- { "rcedilla", 0x0157 },
- { "rcircle", 0x24e1 },
- { "rdblgrave", 0x0211 },
- { "rdotaccent", 0x1e59 },
- { "rdotbelow", 0x1e5b },
- { "rdotbelowmacron", 0x1e5d },
- { "referencemark", 0x203b },
- { "registersans", 0xf8e8 },
- { "registerserif", 0xf6da },
- { "reharabic", 0x0631 },
- { "reharmenian", 0x0580 },
- { "rehfinalarabic", 0xfeae },
- { "rehiragana", 0x308c },
- { "rehyehaleflamarabic", 0x0631 },
- { "rekatakana", 0x30ec },
- { "rekatakanahalfwidth", 0xff9a },
- { "resh", 0x05e8 },
- { "reshdageshhebrew", 0xfb48 },
- { "reshhatafpatah", 0x05e8 },
- { "reshhatafpatahhebrew", 0x05e8 },
- { "reshhatafsegol", 0x05e8 },
- { "reshhatafsegolhebrew", 0x05e8 },
- { "reshhebrew", 0x05e8 },
- { "reshhiriq", 0x05e8 },
- { "reshhiriqhebrew", 0x05e8 },
- { "reshholam", 0x05e8 },
- { "reshholamhebrew", 0x05e8 },
- { "reshpatah", 0x05e8 },
- { "reshpatahhebrew", 0x05e8 },
- { "reshqamats", 0x05e8 },
- { "reshqamatshebrew", 0x05e8 },
- { "reshqubuts", 0x05e8 },
- { "reshqubutshebrew", 0x05e8 },
- { "reshsegol", 0x05e8 },
- { "reshsegolhebrew", 0x05e8 },
- { "reshsheva", 0x05e8 },
- { "reshshevahebrew", 0x05e8 },
- { "reshtsere", 0x05e8 },
- { "reshtserehebrew", 0x05e8 },
- { "reversedtilde", 0x223d },
- { "reviahebrew", 0x0597 },
- { "reviamugrashhebrew", 0x0597 },
- { "rfishhook", 0x027e },
- { "rfishhookreversed", 0x027f },
- { "rhabengali", 0x09dd },
- { "rhadeva", 0x095d },
- { "rhook", 0x027d },
- { "rhookturned", 0x027b },
- { "rhookturnedsuperior", 0x02b5 },
- { "rhosymbolgreek", 0x03f1 },
- { "rhotichookmod", 0x02de },
- { "rieulacirclekorean", 0x3271 },
- { "rieulaparenkorean", 0x3211 },
- { "rieulcirclekorean", 0x3263 },
- { "rieulhieuhkorean", 0x3140 },
- { "rieulkiyeokkorean", 0x313a },
- { "rieulkiyeoksioskorean", 0x3169 },
- { "rieulkorean", 0x3139 },
- { "rieulmieumkorean", 0x313b },
- { "rieulpansioskorean", 0x316c },
- { "rieulparenkorean", 0x3203 },
- { "rieulphieuphkorean", 0x313f },
- { "rieulpieupkorean", 0x313c },
- { "rieulpieupsioskorean", 0x316b },
- { "rieulsioskorean", 0x313d },
- { "rieulthieuthkorean", 0x313e },
- { "rieultikeutkorean", 0x316a },
- { "rieulyeorinhieuhkorean", 0x316d },
- { "rightangle", 0x221f },
- { "righttackbelowcmb", 0x0319 },
- { "righttriangle", 0x22bf },
- { "rihiragana", 0x308a },
- { "rikatakana", 0x30ea },
- { "rikatakanahalfwidth", 0xff98 },
- { "ringbelowcmb", 0x0325 },
- { "ringcmb", 0x030a },
- { "ringhalfleft", 0x02bf },
- { "ringhalfleftarmenian", 0x0559 },
- { "ringhalfleftbelowcmb", 0x031c },
- { "ringhalfleftcentered", 0x02d3 },
- { "ringhalfright", 0x02be },
- { "ringhalfrightbelowcmb", 0x0339 },
- { "ringhalfrightcentered", 0x02d2 },
- { "rinvertedbreve", 0x0213 },
- { "rittorusquare", 0x3351 },
- { "rlinebelow", 0x1e5f },
- { "rlongleg", 0x027c },
- { "rlonglegturned", 0x027a },
- { "rmonospace", 0xff52 },
- { "rohiragana", 0x308d },
- { "rokatakana", 0x30ed },
- { "rokatakanahalfwidth", 0xff9b },
- { "roruathai", 0x0e23 },
- { "rparen", 0x24ad },
- { "rrabengali", 0x09dc },
- { "rradeva", 0x0931 },
- { "rragurmukhi", 0x0a5c },
- { "rreharabic", 0x0691 },
- { "rrehfinalarabic", 0xfb8d },
- { "rrvocalicbengali", 0x09e0 },
- { "rrvocalicdeva", 0x0960 },
- { "rrvocalicgujarati", 0x0ae0 },
- { "rrvocalicvowelsignbengali", 0x09c4 },
- { "rrvocalicvowelsigndeva", 0x0944 },
- { "rrvocalicvowelsigngujarati", 0x0ac4 },
- { "rsuperior", 0xf6f1 },
- { "rturned", 0x0279 },
- { "rturnedsuperior", 0x02b4 },
- { "ruhiragana", 0x308b },
- { "rukatakana", 0x30eb },
- { "rukatakanahalfwidth", 0xff99 },
- { "rupeemarkbengali", 0x09f2 },
- { "rupeesignbengali", 0x09f3 },
- { "rupiah", 0xf6dd },
- { "ruthai", 0x0e24 },
- { "rvocalicbengali", 0x098b },
- { "rvocalicdeva", 0x090b },
- { "rvocalicgujarati", 0x0a8b },
- { "rvocalicvowelsignbengali", 0x09c3 },
- { "rvocalicvowelsigndeva", 0x0943 },
- { "rvocalicvowelsigngujarati", 0x0ac3 },
- { "sabengali", 0x09b8 },
- { "sacutedotaccent", 0x1e65 },
- { "sadarabic", 0x0635 },
- { "sadeva", 0x0938 },
- { "sadfinalarabic", 0xfeba },
- { "sadinitialarabic", 0xfebb },
- { "sadmedialarabic", 0xfebc },
- { "sagujarati", 0x0ab8 },
- { "sagurmukhi", 0x0a38 },
- { "sahiragana", 0x3055 },
- { "sakatakana", 0x30b5 },
- { "sakatakanahalfwidth", 0xff7b },
- { "sallallahoualayhewasallamarabic", 0xfdfa },
- { "samekh", 0x05e1 },
- { "samekhdagesh", 0xfb41 },
- { "samekhdageshhebrew", 0xfb41 },
- { "samekhhebrew", 0x05e1 },
- { "saraaathai", 0x0e32 },
- { "saraaethai", 0x0e41 },
- { "saraaimaimalaithai", 0x0e44 },
- { "saraaimaimuanthai", 0x0e43 },
- { "saraamthai", 0x0e33 },
- { "saraathai", 0x0e30 },
- { "saraethai", 0x0e40 },
- { "saraiileftthai", 0xf886 },
- { "saraiithai", 0x0e35 },
- { "saraileftthai", 0xf885 },
- { "saraithai", 0x0e34 },
- { "saraothai", 0x0e42 },
- { "saraueeleftthai", 0xf888 },
- { "saraueethai", 0x0e37 },
- { "saraueleftthai", 0xf887 },
- { "sarauethai", 0x0e36 },
- { "sarauthai", 0x0e38 },
- { "sarauuthai", 0x0e39 },
- { "sbopomofo", 0x3119 },
- { "scarondotaccent", 0x1e67 },
- { "schwa", 0x0259 },
- { "schwacyrillic", 0x04d9 },
- { "schwadieresiscyrillic", 0x04db },
- { "schwahook", 0x025a },
- { "scircle", 0x24e2 },
- { "sdotaccent", 0x1e61 },
- { "sdotbelow", 0x1e63 },
- { "sdotbelowdotaccent", 0x1e69 },
- { "seagullbelowcmb", 0x033c },
- { "secondtonechinese", 0x02ca },
- { "seenarabic", 0x0633 },
- { "seenfinalarabic", 0xfeb2 },
- { "seeninitialarabic", 0xfeb3 },
- { "seenmedialarabic", 0xfeb4 },
- { "segol", 0x05b6 },
- { "segol13", 0x05b6 },
- { "segol1f", 0x05b6 },
- { "segol2c", 0x05b6 },
- { "segolhebrew", 0x05b6 },
- { "segolnarrowhebrew", 0x05b6 },
- { "segolquarterhebrew", 0x05b6 },
- { "segoltahebrew", 0x0592 },
- { "segolwidehebrew", 0x05b6 },
- { "seharmenian", 0x057d },
- { "sehiragana", 0x305b },
- { "sekatakana", 0x30bb },
- { "sekatakanahalfwidth", 0xff7e },
- { "semicolonarabic", 0x061b },
- { "semicolonmonospace", 0xff1b },
- { "semicolonsmall", 0xfe54 },
- { "semivoicedmarkkana", 0x309c },
- { "semivoicedmarkkanahalfwidth", 0xff9f },
- { "sentisquare", 0x3322 },
- { "sentosquare", 0x3323 },
- { "sevenarabic", 0x0667 },
- { "sevenbengali", 0x09ed },
- { "sevencircle", 0x2466 },
- { "sevencircleinversesansserif", 0x2790 },
- { "sevendeva", 0x096d },
- { "sevengujarati", 0x0aed },
- { "sevengurmukhi", 0x0a6d },
- { "sevenhackarabic", 0x0667 },
- { "sevenhangzhou", 0x3027 },
- { "sevenideographicparen", 0x3226 },
- { "seveninferior", 0x2087 },
- { "sevenmonospace", 0xff17 },
- { "sevenoldstyle", 0xf737 },
- { "sevenparen", 0x247a },
- { "sevenperiod", 0x248e },
- { "sevenpersian", 0x06f7 },
- { "sevenroman", 0x2176 },
- { "sevensuperior", 0x2077 },
- { "seventeencircle", 0x2470 },
- { "seventeenparen", 0x2484 },
- { "seventeenperiod", 0x2498 },
- { "seventhai", 0x0e57 },
- { "sfthyphen", 0x00ad },
- { "shaarmenian", 0x0577 },
- { "shabengali", 0x09b6 },
- { "shacyrillic", 0x0448 },
- { "shaddaarabic", 0x0651 },
- { "shaddadammaarabic", 0xfc61 },
- { "shaddadammatanarabic", 0xfc5e },
- { "shaddafathaarabic", 0xfc60 },
- { "shaddafathatanarabic", 0x0651 },
- { "shaddakasraarabic", 0xfc62 },
- { "shaddakasratanarabic", 0xfc5f },
- { "shadedark", 0x2593 },
- { "shadelight", 0x2591 },
- { "shademedium", 0x2592 },
- { "shadeva", 0x0936 },
- { "shagujarati", 0x0ab6 },
- { "shagurmukhi", 0x0a36 },
- { "shalshelethebrew", 0x0593 },
- { "shbopomofo", 0x3115 },
- { "shchacyrillic", 0x0449 },
- { "sheenarabic", 0x0634 },
- { "sheenfinalarabic", 0xfeb6 },
- { "sheeninitialarabic", 0xfeb7 },
- { "sheenmedialarabic", 0xfeb8 },
- { "sheicoptic", 0x03e3 },
- { "sheqel", 0x20aa },
- { "sheqelhebrew", 0x20aa },
- { "sheva", 0x05b0 },
- { "sheva115", 0x05b0 },
- { "sheva15", 0x05b0 },
- { "sheva22", 0x05b0 },
- { "sheva2e", 0x05b0 },
- { "shevahebrew", 0x05b0 },
- { "shevanarrowhebrew", 0x05b0 },
- { "shevaquarterhebrew", 0x05b0 },
- { "shevawidehebrew", 0x05b0 },
- { "shhacyrillic", 0x04bb },
- { "shimacoptic", 0x03ed },
- { "shin", 0x05e9 },
- { "shindagesh", 0xfb49 },
- { "shindageshhebrew", 0xfb49 },
- { "shindageshshindot", 0xfb2c },
- { "shindageshshindothebrew", 0xfb2c },
- { "shindageshsindot", 0xfb2d },
- { "shindageshsindothebrew", 0xfb2d },
- { "shindothebrew", 0x05c1 },
- { "shinhebrew", 0x05e9 },
- { "shinshindot", 0xfb2a },
- { "shinshindothebrew", 0xfb2a },
- { "shinsindot", 0xfb2b },
- { "shinsindothebrew", 0xfb2b },
- { "shook", 0x0282 },
- { "sigmafinal", 0x03c2 },
- { "sigmalunatesymbolgreek", 0x03f2 },
- { "sihiragana", 0x3057 },
- { "sikatakana", 0x30b7 },
- { "sikatakanahalfwidth", 0xff7c },
- { "siluqhebrew", 0x05bd },
- { "siluqlefthebrew", 0x05bd },
- { "sindothebrew", 0x05c2 },
- { "siosacirclekorean", 0x3274 },
- { "siosaparenkorean", 0x3214 },
- { "sioscieuckorean", 0x317e },
- { "sioscirclekorean", 0x3266 },
- { "sioskiyeokkorean", 0x317a },
- { "sioskorean", 0x3145 },
- { "siosnieunkorean", 0x317b },
- { "siosparenkorean", 0x3206 },
- { "siospieupkorean", 0x317d },
- { "siostikeutkorean", 0x317c },
- { "sixarabic", 0x0666 },
- { "sixbengali", 0x09ec },
- { "sixcircle", 0x2465 },
- { "sixcircleinversesansserif", 0x278f },
- { "sixdeva", 0x096c },
- { "sixgujarati", 0x0aec },
- { "sixgurmukhi", 0x0a6c },
- { "sixhackarabic", 0x0666 },
- { "sixhangzhou", 0x3026 },
- { "sixideographicparen", 0x3225 },
- { "sixinferior", 0x2086 },
- { "sixmonospace", 0xff16 },
- { "sixoldstyle", 0xf736 },
- { "sixparen", 0x2479 },
- { "sixperiod", 0x248d },
- { "sixpersian", 0x06f6 },
- { "sixroman", 0x2175 },
- { "sixsuperior", 0x2076 },
- { "sixteencircle", 0x246f },
- { "sixteencurrencydenominatorbengali", 0x09f9 },
- { "sixteenparen", 0x2483 },
- { "sixteenperiod", 0x2497 },
- { "sixthai", 0x0e56 },
- { "slashmonospace", 0xff0f },
- { "slong", 0x017f },
- { "slongdotaccent", 0x1e9b },
- { "smonospace", 0xff53 },
- { "sofpasuqhebrew", 0x05c3 },
- { "softhyphen", 0x00ad },
- { "softsigncyrillic", 0x044c },
- { "sohiragana", 0x305d },
- { "sokatakana", 0x30bd },
- { "sokatakanahalfwidth", 0xff7f },
- { "soliduslongoverlaycmb", 0x0338 },
- { "solidusshortoverlaycmb", 0x0337 },
- { "sorusithai", 0x0e29 },
- { "sosalathai", 0x0e28 },
- { "sosothai", 0x0e0b },
- { "sosuathai", 0x0e2a },
- { "spacehackarabic", 0x0020 },
- { "spadesuitblack", 0x2660 },
- { "spadesuitwhite", 0x2664 },
- { "sparen", 0x24ae },
- { "squarebelowcmb", 0x033b },
- { "squarecc", 0x33c4 },
- { "squarecm", 0x339d },
- { "squarediagonalcrosshatchfill", 0x25a9 },
- { "squarehorizontalfill", 0x25a4 },
- { "squarekg", 0x338f },
- { "squarekm", 0x339e },
- { "squarekmcapital", 0x33ce },
- { "squareln", 0x33d1 },
- { "squarelog", 0x33d2 },
- { "squaremg", 0x338e },
- { "squaremil", 0x33d5 },
- { "squaremm", 0x339c },
- { "squaremsquared", 0x33a1 },
- { "squareorthogonalcrosshatchfill", 0x25a6 },
- { "squareupperlefttolowerrightfill", 0x25a7 },
- { "squareupperrighttolowerleftfill", 0x25a8 },
- { "squareverticalfill", 0x25a5 },
- { "squarewhitewithsmallblack", 0x25a3 },
- { "srsquare", 0x33db },
- { "ssabengali", 0x09b7 },
- { "ssadeva", 0x0937 },
- { "ssagujarati", 0x0ab7 },
- { "ssangcieuckorean", 0x3149 },
- { "ssanghieuhkorean", 0x3185 },
- { "ssangieungkorean", 0x3180 },
- { "ssangkiyeokkorean", 0x3132 },
- { "ssangnieunkorean", 0x3165 },
- { "ssangpieupkorean", 0x3143 },
- { "ssangsioskorean", 0x3146 },
- { "ssangtikeutkorean", 0x3138 },
- { "ssuperior", 0xf6f2 },
- { "sterlingmonospace", 0xffe1 },
- { "strokelongoverlaycmb", 0x0336 },
- { "strokeshortoverlaycmb", 0x0335 },
- { "subset", 0x2282 },
- { "subsetnotequal", 0x228a },
- { "subsetorequal", 0x2286 },
- { "succeeds", 0x227b },
- { "suhiragana", 0x3059 },
- { "sukatakana", 0x30b9 },
- { "sukatakanahalfwidth", 0xff7d },
- { "sukunarabic", 0x0652 },
- { "superset", 0x2283 },
- { "supersetnotequal", 0x228b },
- { "supersetorequal", 0x2287 },
- { "svsquare", 0x33dc },
- { "syouwaerasquare", 0x337c },
- { "tabengali", 0x09a4 },
- { "tackdown", 0x22a4 },
- { "tackleft", 0x22a3 },
- { "tadeva", 0x0924 },
- { "tagujarati", 0x0aa4 },
- { "tagurmukhi", 0x0a24 },
- { "taharabic", 0x0637 },
- { "tahfinalarabic", 0xfec2 },
- { "tahinitialarabic", 0xfec3 },
- { "tahiragana", 0x305f },
- { "tahmedialarabic", 0xfec4 },
- { "taisyouerasquare", 0x337d },
- { "takatakana", 0x30bf },
- { "takatakanahalfwidth", 0xff80 },
- { "tatweelarabic", 0x0640 },
- { "tav", 0x05ea },
- { "tavdages", 0xfb4a },
- { "tavdagesh", 0xfb4a },
- { "tavdageshhebrew", 0xfb4a },
- { "tavhebrew", 0x05ea },
- { "tbopomofo", 0x310a },
- { "tccurl", 0x02a8 },
- { "tcedilla", 0x0163 },
- { "tcheharabic", 0x0686 },
- { "tchehfinalarabic", 0xfb7b },
- { "tchehinitialarabic", 0xfb7c },
- { "tchehmedialarabic", 0xfb7d },
- { "tchehmeeminitialarabic", 0xfb7c },
- { "tcircle", 0x24e3 },
- { "tcircumflexbelow", 0x1e71 },
- { "tdieresis", 0x1e97 },
- { "tdotaccent", 0x1e6b },
- { "tdotbelow", 0x1e6d },
- { "tecyrillic", 0x0442 },
- { "tedescendercyrillic", 0x04ad },
- { "teharabic", 0x062a },
- { "tehfinalarabic", 0xfe96 },
- { "tehhahinitialarabic", 0xfca2 },
- { "tehhahisolatedarabic", 0xfc0c },
- { "tehinitialarabic", 0xfe97 },
- { "tehiragana", 0x3066 },
- { "tehjeeminitialarabic", 0xfca1 },
- { "tehjeemisolatedarabic", 0xfc0b },
- { "tehmarbutaarabic", 0x0629 },
- { "tehmarbutafinalarabic", 0xfe94 },
- { "tehmedialarabic", 0xfe98 },
- { "tehmeeminitialarabic", 0xfca4 },
- { "tehmeemisolatedarabic", 0xfc0e },
- { "tehnoonfinalarabic", 0xfc73 },
- { "tekatakana", 0x30c6 },
- { "tekatakanahalfwidth", 0xff83 },
- { "telephone", 0x2121 },
- { "telephoneblack", 0x260e },
- { "telishagedolahebrew", 0x05a0 },
- { "telishaqetanahebrew", 0x05a9 },
- { "tencircle", 0x2469 },
- { "tenideographicparen", 0x3229 },
- { "tenparen", 0x247d },
- { "tenperiod", 0x2491 },
- { "tenroman", 0x2179 },
- { "tesh", 0x02a7 },
- { "tet", 0x05d8 },
- { "tetdagesh", 0xfb38 },
- { "tetdageshhebrew", 0xfb38 },
- { "tethebrew", 0x05d8 },
- { "tetsecyrillic", 0x04b5 },
- { "tevirhebrew", 0x059b },
- { "tevirlefthebrew", 0x059b },
- { "thabengali", 0x09a5 },
- { "thadeva", 0x0925 },
- { "thagujarati", 0x0aa5 },
- { "thagurmukhi", 0x0a25 },
- { "thalarabic", 0x0630 },
- { "thalfinalarabic", 0xfeac },
- { "thanthakhatlowleftthai", 0xf898 },
- { "thanthakhatlowrightthai", 0xf897 },
- { "thanthakhatthai", 0x0e4c },
- { "thanthakhatupperleftthai", 0xf896 },
- { "theharabic", 0x062b },
- { "thehfinalarabic", 0xfe9a },
- { "thehinitialarabic", 0xfe9b },
- { "thehmedialarabic", 0xfe9c },
- { "thereexists", 0x2203 },
- { "thetasymbolgreek", 0x03d1 },
- { "thieuthacirclekorean", 0x3279 },
- { "thieuthaparenkorean", 0x3219 },
- { "thieuthcirclekorean", 0x326b },
- { "thieuthkorean", 0x314c },
- { "thieuthparenkorean", 0x320b },
- { "thirteencircle", 0x246c },
- { "thirteenparen", 0x2480 },
- { "thirteenperiod", 0x2494 },
- { "thonangmonthothai", 0x0e11 },
- { "thook", 0x01ad },
- { "thophuthaothai", 0x0e12 },
- { "thothahanthai", 0x0e17 },
- { "thothanthai", 0x0e10 },
- { "thothongthai", 0x0e18 },
- { "thothungthai", 0x0e16 },
- { "thousandcyrillic", 0x0482 },
- { "thousandsseparatorarabic", 0x066c },
- { "thousandsseparatorpersian", 0x066c },
- { "threearabic", 0x0663 },
- { "threebengali", 0x09e9 },
- { "threecircle", 0x2462 },
- { "threecircleinversesansserif", 0x278c },
- { "threedeva", 0x0969 },
- { "threegujarati", 0x0ae9 },
- { "threegurmukhi", 0x0a69 },
- { "threehackarabic", 0x0663 },
- { "threehangzhou", 0x3023 },
- { "threeideographicparen", 0x3222 },
- { "threeinferior", 0x2083 },
- { "threemonospace", 0xff13 },
- { "threenumeratorbengali", 0x09f6 },
- { "threeoldstyle", 0xf733 },
- { "threeparen", 0x2476 },
- { "threeperiod", 0x248a },
- { "threepersian", 0x06f3 },
- { "threequartersemdash", 0xf6de },
- { "threeroman", 0x2172 },
- { "threesuperior", 0x00b3 },
- { "threethai", 0x0e53 },
- { "thzsquare", 0x3394 },
- { "tihiragana", 0x3061 },
- { "tikatakana", 0x30c1 },
- { "tikatakanahalfwidth", 0xff81 },
- { "tikeutacirclekorean", 0x3270 },
- { "tikeutaparenkorean", 0x3210 },
- { "tikeutcirclekorean", 0x3262 },
- { "tikeutkorean", 0x3137 },
- { "tikeutparenkorean", 0x3202 },
- { "tildebelowcmb", 0x0330 },
- { "tildecmb", 0x0303 },
- { "tildedoublecmb", 0x0360 },
- { "tildeoperator", 0x223c },
- { "tildeoverlaycmb", 0x0334 },
- { "tildeverticalcmb", 0x033e },
- { "timescircle", 0x2297 },
- { "tipehahebrew", 0x0596 },
- { "tipehalefthebrew", 0x0596 },
- { "tippigurmukhi", 0x0a70 },
- { "titlocyrilliccmb", 0x0483 },
- { "tiwnarmenian", 0x057f },
- { "tlinebelow", 0x1e6f },
- { "tmonospace", 0xff54 },
- { "toarmenian", 0x0569 },
- { "tohiragana", 0x3068 },
- { "tokatakana", 0x30c8 },
- { "tokatakanahalfwidth", 0xff84 },
- { "tonebarextrahighmod", 0x02e5 },
- { "tonebarextralowmod", 0x02e9 },
- { "tonebarhighmod", 0x02e6 },
- { "tonebarlowmod", 0x02e8 },
- { "tonebarmidmod", 0x02e7 },
- { "tonefive", 0x01bd },
- { "tonesix", 0x0185 },
- { "tonetwo", 0x01a8 },
- { "tonsquare", 0x3327 },
- { "topatakthai", 0x0e0f },
- { "tortoiseshellbracketleft", 0x3014 },
- { "tortoiseshellbracketleftsmall", 0xfe5d },
- { "tortoiseshellbracketleftvertical", 0xfe39 },
- { "tortoiseshellbracketright", 0x3015 },
- { "tortoiseshellbracketrightsmall", 0xfe5e },
- { "tortoiseshellbracketrightvertical", 0xfe3a },
- { "totaothai", 0x0e15 },
- { "tpalatalhook", 0x01ab },
- { "tparen", 0x24af },
- { "trademarksans", 0xf8ea },
- { "trademarkserif", 0xf6db },
- { "tretroflexhook", 0x0288 },
- { "ts", 0x02a6 },
- { "tsadi", 0x05e6 },
- { "tsadidagesh", 0xfb46 },
- { "tsadidageshhebrew", 0xfb46 },
- { "tsadihebrew", 0x05e6 },
- { "tsecyrillic", 0x0446 },
- { "tsere", 0x05b5 },
- { "tsere12", 0x05b5 },
- { "tsere1e", 0x05b5 },
- { "tsere2b", 0x05b5 },
- { "tserehebrew", 0x05b5 },
- { "tserenarrowhebrew", 0x05b5 },
- { "tserequarterhebrew", 0x05b5 },
- { "tserewidehebrew", 0x05b5 },
- { "tshecyrillic", 0x045b },
- { "tsuperior", 0xf6f3 },
- { "ttabengali", 0x099f },
- { "ttadeva", 0x091f },
- { "ttagujarati", 0x0a9f },
- { "ttagurmukhi", 0x0a1f },
- { "tteharabic", 0x0679 },
- { "ttehfinalarabic", 0xfb67 },
- { "ttehinitialarabic", 0xfb68 },
- { "ttehmedialarabic", 0xfb69 },
- { "tthabengali", 0x09a0 },
- { "tthadeva", 0x0920 },
- { "tthagujarati", 0x0aa0 },
- { "tthagurmukhi", 0x0a20 },
- { "tturned", 0x0287 },
- { "tuhiragana", 0x3064 },
- { "tukatakana", 0x30c4 },
- { "tukatakanahalfwidth", 0xff82 },
- { "tusmallhiragana", 0x3063 },
- { "tusmallkatakana", 0x30c3 },
- { "tusmallkatakanahalfwidth", 0xff6f },
- { "twelvecircle", 0x246b },
- { "twelveparen", 0x247f },
- { "twelveperiod", 0x2493 },
- { "twelveroman", 0x217b },
- { "twentycircle", 0x2473 },
- { "twentyhangzhou", 0x5344 },
- { "twentyparen", 0x2487 },
- { "twentyperiod", 0x249b },
- { "twoarabic", 0x0662 },
- { "twobengali", 0x09e8 },
- { "twocircle", 0x2461 },
- { "twocircleinversesansserif", 0x278b },
- { "twodeva", 0x0968 },
- { "twodotleader", 0x2025 },
- { "twodotleadervertical", 0xfe30 },
- { "twogujarati", 0x0ae8 },
- { "twogurmukhi", 0x0a68 },
- { "twohackarabic", 0x0662 },
- { "twohangzhou", 0x3022 },
- { "twoideographicparen", 0x3221 },
- { "twoinferior", 0x2082 },
- { "twomonospace", 0xff12 },
- { "twonumeratorbengali", 0x09f5 },
- { "twooldstyle", 0xf732 },
- { "twoparen", 0x2475 },
- { "twoperiod", 0x2489 },
- { "twopersian", 0x06f2 },
- { "tworoman", 0x2171 },
- { "twostroke", 0x01bb },
- { "twosuperior", 0x00b2 },
- { "twothai", 0x0e52 },
- { "ubar", 0x0289 },
- { "ubengali", 0x0989 },
- { "ubopomofo", 0x3128 },
- { "ucaron", 0x01d4 },
- { "ucircle", 0x24e4 },
- { "ucircumflexbelow", 0x1e77 },
- { "ucyrillic", 0x0443 },
- { "udattadeva", 0x0951 },
- { "udblacute", 0x0171 },
- { "udblgrave", 0x0215 },
- { "udeva", 0x0909 },
- { "udieresisacute", 0x01d8 },
- { "udieresisbelow", 0x1e73 },
- { "udieresiscaron", 0x01da },
- { "udieresiscyrillic", 0x04f1 },
- { "udieresisgrave", 0x01dc },
- { "udieresismacron", 0x01d6 },
- { "udotbelow", 0x1ee5 },
- { "ugujarati", 0x0a89 },
- { "ugurmukhi", 0x0a09 },
- { "uhiragana", 0x3046 },
- { "uhookabove", 0x1ee7 },
- { "uhornacute", 0x1ee9 },
- { "uhorndotbelow", 0x1ef1 },
- { "uhorngrave", 0x1eeb },
- { "uhornhookabove", 0x1eed },
- { "uhorntilde", 0x1eef },
- { "uhungarumlautcyrillic", 0x04f3 },
- { "uinvertedbreve", 0x0217 },
- { "ukatakana", 0x30a6 },
- { "ukatakanahalfwidth", 0xff73 },
- { "ukcyrillic", 0x0479 },
- { "ukorean", 0x315c },
- { "umacroncyrillic", 0x04ef },
- { "umacrondieresis", 0x1e7b },
- { "umatragurmukhi", 0x0a41 },
- { "umonospace", 0xff55 },
- { "underscoremonospace", 0xff3f },
- { "underscorevertical", 0xfe33 },
- { "underscorewavy", 0xfe4f },
- { "uparen", 0x24b0 },
- { "upperdothebrew", 0x05c4 },
- { "upsilonlatin", 0x028a },
- { "uptackbelowcmb", 0x031d },
- { "uptackmod", 0x02d4 },
- { "uragurmukhi", 0x0a73 },
- { "ushortcyrillic", 0x045e },
- { "usmallhiragana", 0x3045 },
- { "usmallkatakana", 0x30a5 },
- { "usmallkatakanahalfwidth", 0xff69 },
- { "ustraightcyrillic", 0x04af },
- { "ustraightstrokecyrillic", 0x04b1 },
- { "utildeacute", 0x1e79 },
- { "utildebelow", 0x1e75 },
- { "uubengali", 0x098a },
- { "uudeva", 0x090a },
- { "uugujarati", 0x0a8a },
- { "uugurmukhi", 0x0a0a },
- { "uumatragurmukhi", 0x0a42 },
- { "uuvowelsignbengali", 0x09c2 },
- { "uuvowelsigndeva", 0x0942 },
- { "uuvowelsigngujarati", 0x0ac2 },
- { "uvowelsignbengali", 0x09c1 },
- { "uvowelsigndeva", 0x0941 },
- { "uvowelsigngujarati", 0x0ac1 },
- { "vadeva", 0x0935 },
- { "vagujarati", 0x0ab5 },
- { "vagurmukhi", 0x0a35 },
- { "vakatakana", 0x30f7 },
- { "vav", 0x05d5 },
- { "vavdagesh", 0xfb35 },
- { "vavdagesh65", 0xfb35 },
- { "vavdageshhebrew", 0xfb35 },
- { "vavhebrew", 0x05d5 },
- { "vavholam", 0xfb4b },
- { "vavholamhebrew", 0xfb4b },
- { "vavvavhebrew", 0x05f0 },
- { "vavyodhebrew", 0x05f1 },
- { "vcircle", 0x24e5 },
- { "vdotbelow", 0x1e7f },
- { "vecyrillic", 0x0432 },
- { "veharabic", 0x06a4 },
- { "vehfinalarabic", 0xfb6b },
- { "vehinitialarabic", 0xfb6c },
- { "vehmedialarabic", 0xfb6d },
- { "vekatakana", 0x30f9 },
- { "venus", 0x2640 },
- { "verticalbar", 0x007c },
- { "verticallineabovecmb", 0x030d },
- { "verticallinebelowcmb", 0x0329 },
- { "verticallinelowmod", 0x02cc },
- { "verticallinemod", 0x02c8 },
- { "vewarmenian", 0x057e },
- { "vhook", 0x028b },
- { "vikatakana", 0x30f8 },
- { "viramabengali", 0x09cd },
- { "viramadeva", 0x094d },
- { "viramagujarati", 0x0acd },
- { "visargabengali", 0x0983 },
- { "visargadeva", 0x0903 },
- { "visargagujarati", 0x0a83 },
- { "vmonospace", 0xff56 },
- { "voarmenian", 0x0578 },
- { "voicediterationhiragana", 0x309e },
- { "voicediterationkatakana", 0x30fe },
- { "voicedmarkkana", 0x309b },
- { "voicedmarkkanahalfwidth", 0xff9e },
- { "vokatakana", 0x30fa },
- { "vparen", 0x24b1 },
- { "vtilde", 0x1e7d },
- { "vturned", 0x028c },
- { "vuhiragana", 0x3094 },
- { "vukatakana", 0x30f4 },
- { "waekorean", 0x3159 },
- { "wahiragana", 0x308f },
- { "wakatakana", 0x30ef },
- { "wakatakanahalfwidth", 0xff9c },
- { "wakorean", 0x3158 },
- { "wasmallhiragana", 0x308e },
- { "wasmallkatakana", 0x30ee },
- { "wattosquare", 0x3357 },
- { "wavedash", 0x301c },
- { "wavyunderscorevertical", 0xfe34 },
- { "wawarabic", 0x0648 },
- { "wawfinalarabic", 0xfeee },
- { "wawhamzaabovearabic", 0x0624 },
- { "wawhamzaabovefinalarabic", 0xfe86 },
- { "wbsquare", 0x33dd },
- { "wcircle", 0x24e6 },
- { "wdotaccent", 0x1e87 },
- { "wdotbelow", 0x1e89 },
- { "wehiragana", 0x3091 },
- { "wekatakana", 0x30f1 },
- { "wekorean", 0x315e },
- { "weokorean", 0x315d },
- { "whitebullet", 0x25e6 },
- { "whitecircle", 0x25cb },
- { "whitecircleinverse", 0x25d9 },
- { "whitecornerbracketleft", 0x300e },
- { "whitecornerbracketleftvertical", 0xfe43 },
- { "whitecornerbracketright", 0x300f },
- { "whitecornerbracketrightvertical", 0xfe44 },
- { "whitediamond", 0x25c7 },
- { "whitediamondcontainingblacksmalldiamond", 0x25c8 },
- { "whitedownpointingsmalltriangle", 0x25bf },
- { "whitedownpointingtriangle", 0x25bd },
- { "whiteleftpointingsmalltriangle", 0x25c3 },
- { "whiteleftpointingtriangle", 0x25c1 },
- { "whitelenticularbracketleft", 0x3016 },
- { "whitelenticularbracketright", 0x3017 },
- { "whiterightpointingsmalltriangle", 0x25b9 },
- { "whiterightpointingtriangle", 0x25b7 },
- { "whitesmallsquare", 0x25ab },
- { "whitesmilingface", 0x263a },
- { "whitesquare", 0x25a1 },
- { "whitestar", 0x2606 },
- { "whitetelephone", 0x260f },
- { "whitetortoiseshellbracketleft", 0x3018 },
- { "whitetortoiseshellbracketright", 0x3019 },
- { "whiteuppointingsmalltriangle", 0x25b5 },
- { "whiteuppointingtriangle", 0x25b3 },
- { "wihiragana", 0x3090 },
- { "wikatakana", 0x30f0 },
- { "wikorean", 0x315f },
- { "wmonospace", 0xff57 },
- { "wohiragana", 0x3092 },
- { "wokatakana", 0x30f2 },
- { "wokatakanahalfwidth", 0xff66 },
- { "won", 0x20a9 },
- { "wonmonospace", 0xffe6 },
- { "wowaenthai", 0x0e27 },
- { "wparen", 0x24b2 },
- { "wring", 0x1e98 },
- { "wsuperior", 0x02b7 },
- { "wturned", 0x028d },
- { "wynn", 0x01bf },
- { "xabovecmb", 0x033d },
- { "xbopomofo", 0x3112 },
- { "xcircle", 0x24e7 },
- { "xdieresis", 0x1e8d },
- { "xdotaccent", 0x1e8b },
- { "xeharmenian", 0x056d },
- { "xmonospace", 0xff58 },
- { "xparen", 0x24b3 },
- { "xsuperior", 0x02e3 },
- { "yaadosquare", 0x334e },
- { "yabengali", 0x09af },
- { "yadeva", 0x092f },
- { "yaekorean", 0x3152 },
- { "yagujarati", 0x0aaf },
- { "yagurmukhi", 0x0a2f },
- { "yahiragana", 0x3084 },
- { "yakatakana", 0x30e4 },
- { "yakatakanahalfwidth", 0xff94 },
- { "yakorean", 0x3151 },
- { "yamakkanthai", 0x0e4e },
- { "yasmallhiragana", 0x3083 },
- { "yasmallkatakana", 0x30e3 },
- { "yasmallkatakanahalfwidth", 0xff6c },
- { "yatcyrillic", 0x0463 },
- { "ycircle", 0x24e8 },
- { "ydotaccent", 0x1e8f },
- { "ydotbelow", 0x1ef5 },
- { "yeharabic", 0x064a },
- { "yehbarreearabic", 0x06d2 },
- { "yehbarreefinalarabic", 0xfbaf },
- { "yehfinalarabic", 0xfef2 },
- { "yehhamzaabovearabic", 0x0626 },
- { "yehhamzaabovefinalarabic", 0xfe8a },
- { "yehhamzaaboveinitialarabic", 0xfe8b },
- { "yehhamzaabovemedialarabic", 0xfe8c },
- { "yehinitialarabic", 0xfef3 },
- { "yehmedialarabic", 0xfef4 },
- { "yehmeeminitialarabic", 0xfcdd },
- { "yehmeemisolatedarabic", 0xfc58 },
- { "yehnoonfinalarabic", 0xfc94 },
- { "yehthreedotsbelowarabic", 0x06d1 },
- { "yekorean", 0x3156 },
- { "yenmonospace", 0xffe5 },
- { "yeokorean", 0x3155 },
- { "yeorinhieuhkorean", 0x3186 },
- { "yerahbenyomohebrew", 0x05aa },
- { "yerahbenyomolefthebrew", 0x05aa },
- { "yericyrillic", 0x044b },
- { "yerudieresiscyrillic", 0x04f9 },
- { "yesieungkorean", 0x3181 },
- { "yesieungpansioskorean", 0x3183 },
- { "yesieungsioskorean", 0x3182 },
- { "yetivhebrew", 0x059a },
- { "yhook", 0x01b4 },
- { "yhookabove", 0x1ef7 },
- { "yiarmenian", 0x0575 },
- { "yicyrillic", 0x0457 },
- { "yikorean", 0x3162 },
- { "yinyang", 0x262f },
- { "yiwnarmenian", 0x0582 },
- { "ymonospace", 0xff59 },
- { "yod", 0x05d9 },
- { "yoddagesh", 0xfb39 },
- { "yoddageshhebrew", 0xfb39 },
- { "yodhebrew", 0x05d9 },
- { "yodyodhebrew", 0x05f2 },
- { "yodyodpatahhebrew", 0xfb1f },
- { "yohiragana", 0x3088 },
- { "yoikorean", 0x3189 },
- { "yokatakana", 0x30e8 },
- { "yokatakanahalfwidth", 0xff96 },
- { "yokorean", 0x315b },
- { "yosmallhiragana", 0x3087 },
- { "yosmallkatakana", 0x30e7 },
- { "yosmallkatakanahalfwidth", 0xff6e },
- { "yotgreek", 0x03f3 },
- { "yoyaekorean", 0x3188 },
- { "yoyakorean", 0x3187 },
- { "yoyakthai", 0x0e22 },
- { "yoyingthai", 0x0e0d },
- { "yparen", 0x24b4 },
- { "ypogegrammeni", 0x037a },
- { "ypogegrammenigreekcmb", 0x0345 },
- { "yr", 0x01a6 },
- { "yring", 0x1e99 },
- { "ysuperior", 0x02b8 },
- { "ytilde", 0x1ef9 },
- { "yturned", 0x028e },
- { "yuhiragana", 0x3086 },
- { "yuikorean", 0x318c },
- { "yukatakana", 0x30e6 },
- { "yukatakanahalfwidth", 0xff95 },
- { "yukorean", 0x3160 },
- { "yusbigcyrillic", 0x046b },
- { "yusbigiotifiedcyrillic", 0x046d },
- { "yuslittlecyrillic", 0x0467 },
- { "yuslittleiotifiedcyrillic", 0x0469 },
- { "yusmallhiragana", 0x3085 },
- { "yusmallkatakana", 0x30e5 },
- { "yusmallkatakanahalfwidth", 0xff6d },
- { "yuyekorean", 0x318b },
- { "yuyeokorean", 0x318a },
- { "yyabengali", 0x09df },
- { "yyadeva", 0x095f },
- { "zaarmenian", 0x0566 },
- { "zadeva", 0x095b },
- { "zagurmukhi", 0x0a5b },
- { "zaharabic", 0x0638 },
- { "zahfinalarabic", 0xfec6 },
- { "zahinitialarabic", 0xfec7 },
- { "zahiragana", 0x3056 },
- { "zahmedialarabic", 0xfec8 },
- { "zainarabic", 0x0632 },
- { "zainfinalarabic", 0xfeb0 },
- { "zakatakana", 0x30b6 },
- { "zaqefgadolhebrew", 0x0595 },
- { "zaqefqatanhebrew", 0x0594 },
- { "zarqahebrew", 0x0598 },
- { "zayin", 0x05d6 },
- { "zayindagesh", 0xfb36 },
- { "zayindageshhebrew", 0xfb36 },
- { "zayinhebrew", 0x05d6 },
- { "zbopomofo", 0x3117 },
- { "zcircle", 0x24e9 },
- { "zcircumflex", 0x1e91 },
- { "zcurl", 0x0291 },
- { "zdot", 0x017c },
- { "zdotbelow", 0x1e93 },
- { "zecyrillic", 0x0437 },
- { "zedescendercyrillic", 0x0499 },
- { "zedieresiscyrillic", 0x04df },
- { "zehiragana", 0x305c },
- { "zekatakana", 0x30bc },
- { "zeroarabic", 0x0660 },
- { "zerobengali", 0x09e6 },
- { "zerodeva", 0x0966 },
- { "zerogujarati", 0x0ae6 },
- { "zerogurmukhi", 0x0a66 },
- { "zerohackarabic", 0x0660 },
- { "zeroinferior", 0x2080 },
- { "zeromonospace", 0xff10 },
- { "zerooldstyle", 0xf730 },
- { "zeropersian", 0x06f0 },
- { "zerosuperior", 0x2070 },
- { "zerothai", 0x0e50 },
- { "zerowidthjoiner", 0xfeff },
- { "zerowidthnonjoiner", 0x200c },
- { "zerowidthspace", 0x200b },
- { "zhbopomofo", 0x3113 },
- { "zhearmenian", 0x056a },
- { "zhebrevecyrillic", 0x04c2 },
- { "zhecyrillic", 0x0436 },
- { "zhedescendercyrillic", 0x0497 },
- { "zhedieresiscyrillic", 0x04dd },
- { "zihiragana", 0x3058 },
- { "zikatakana", 0x30b8 },
- { "zinorhebrew", 0x05ae },
- { "zlinebelow", 0x1e95 },
- { "zmonospace", 0xff5a },
- { "zohiragana", 0x305e },
- { "zokatakana", 0x30be },
- { "zparen", 0x24b5 },
- { "zretroflexhook", 0x0290 },
- { "zstroke", 0x01b6 },
- { "zuhiragana", 0x305a },
- { "zukatakana", 0x30ba },
- { "dotaccent.cap", 0xefed },
- { "breve.cap", 0xefee },
- { "ogonek.cap", 0xeff1 },
- { "cedilla.cap", 0xeff2 },
- { "ring.cap", 0xeff3 },
- { "tilde.cap", 0xeff5 },
- { "circumflex.cap", 0xeff7 },
- { "a1", 0x2701 },
- { "a2", 0x2702 },
- { "a202", 0x2703 },
- { "a3", 0x2704 },
- { "a4", 0x260e },
- { "a5", 0x2706 },
- { "a119", 0x2707 },
- { "a118", 0x2708 },
- { "a117", 0x2709 },
- { "a11", 0x261b },
- { "a12", 0x261e },
- { "a13", 0x270c },
- { "a14", 0x270d },
- { "a15", 0x270e },
- { "a16", 0x270f },
- { "a105", 0x2710 },
- { "a17", 0x2711 },
- { "a18", 0x2712 },
- { "a19", 0x2713 },
- { "a20", 0x2714 },
- { "a21", 0x2715 },
- { "a22", 0x2716 },
- { "a23", 0x2717 },
- { "a24", 0x2718 },
- { "a25", 0x2719 },
- { "a26", 0x271a },
- { "a27", 0x271b },
- { "a28", 0x271c },
- { "a6", 0x271d },
- { "a7", 0x271e },
- { "a8", 0x271f },
- { "a9", 0x2720 },
- { "a10", 0x2721 },
- { "a29", 0x2722 },
- { "a30", 0x2723 },
- { "a31", 0x2724 },
- { "a32", 0x2725 },
- { "a33", 0x2726 },
- { "a34", 0x2727 },
- { "a35", 0x2605 },
- { "a36", 0x2729 },
- { "a37", 0x272a },
- { "a38", 0x272b },
- { "a39", 0x272c },
- { "a40", 0x272d },
- { "a41", 0x272e },
- { "a42", 0x272f },
- { "a43", 0x2730 },
- { "a44", 0x2731 },
- { "a45", 0x2732 },
- { "a46", 0x2733 },
- { "a47", 0x2734 },
- { "a48", 0x2735 },
- { "a49", 0x2736 },
- { "a50", 0x2737 },
- { "a51", 0x2738 },
- { "a52", 0x2739 },
- { "a53", 0x273a },
- { "a54", 0x273b },
- { "a55", 0x273c },
- { "a56", 0x273d },
- { "a57", 0x273e },
- { "a58", 0x273f },
- { "a59", 0x2740 },
- { "a60", 0x2741 },
- { "a61", 0x2742 },
- { "a62", 0x2743 },
- { "a63", 0x2744 },
- { "a64", 0x2745 },
- { "a65", 0x2746 },
- { "a66", 0x2747 },
- { "a67", 0x2748 },
- { "a68", 0x2749 },
- { "a69", 0x274a },
- { "a70", 0x274b },
- { "a71", 0x25cf },
- { "a72", 0x274d },
- { "a73", 0x25a0 },
- { "a74", 0x274f },
- { "a203", 0x2750 },
- { "a75", 0x2751 },
- { "a204", 0x2752 },
- { "a76", 0x25b2 },
- { "a77", 0x25bc },
- { "a78", 0x25c6 },
- { "a79", 0x2756 },
- { "a81", 0x25d7 },
- { "a82", 0x2758 },
- { "a83", 0x2759 },
- { "a84", 0x275a },
- { "a97", 0x275b },
- { "a98", 0x275c },
- { "a99", 0x275d },
- { "a100", 0x275e },
- { "a89", 0x2768 },
- { "a90", 0x2769 },
- { "a93", 0x276a },
- { "a94", 0x276b },
- { "a91", 0x276c },
- { "a92", 0x276d },
- { "a205", 0x276e },
- { "a85", 0x276f },
- { "a206", 0x2770 },
- { "a86", 0x2771 },
- { "a87", 0x2772 },
- { "a88", 0x2773 },
- { "a95", 0x2774 },
- { "a96", 0x2775 },
- { "a101", 0x2761 },
- { "a102", 0x2762 },
- { "a103", 0x2763 },
- { "a104", 0x2764 },
- { "a106", 0x2765 },
- { "a107", 0x2766 },
- { "a108", 0x2767 },
- { "a112", 0x2663 },
- { "a111", 0x2666 },
- { "a110", 0x2665 },
- { "a109", 0x2660 },
- { "a120", 0x2460 },
- { "a121", 0x2461 },
- { "a122", 0x2462 },
- { "a123", 0x2463 },
- { "a124", 0x2464 },
- { "a125", 0x2465 },
- { "a126", 0x2466 },
- { "a127", 0x2467 },
- { "a128", 0x2468 },
- { "a129", 0x2469 },
- { "a130", 0x2776 },
- { "a131", 0x2777 },
- { "a132", 0x2778 },
- { "a133", 0x2779 },
- { "a134", 0x277a },
- { "a135", 0x277b },
- { "a136", 0x277c },
- { "a137", 0x277d },
- { "a138", 0x277e },
- { "a139", 0x277f },
- { "a140", 0x2780 },
- { "a141", 0x2781 },
- { "a142", 0x2782 },
- { "a143", 0x2783 },
- { "a144", 0x2784 },
- { "a145", 0x2785 },
- { "a146", 0x2786 },
- { "a147", 0x2787 },
- { "a148", 0x2788 },
- { "a149", 0x2789 },
- { "a150", 0x278a },
- { "a151", 0x278b },
- { "a152", 0x278c },
- { "a153", 0x278d },
- { "a154", 0x278e },
- { "a155", 0x278f },
- { "a156", 0x2790 },
- { "a157", 0x2791 },
- { "a158", 0x2792 },
- { "a159", 0x2793 },
- { "a160", 0x2794 },
- { "a161", 0x2192 },
- { "a163", 0x2194 },
- { "a164", 0x2195 },
- { "a196", 0x2798 },
- { "a165", 0x2799 },
- { "a192", 0x279a },
- { "a166", 0x279b },
- { "a167", 0x279c },
- { "a168", 0x279d },
- { "a169", 0x279e },
- { "a170", 0x279f },
- { "a171", 0x27a0 },
- { "a172", 0x27a1 },
- { "a173", 0x27a2 },
- { "a162", 0x27a3 },
- { "a174", 0x27a4 },
- { "a175", 0x27a5 },
- { "a176", 0x27a6 },
- { "a177", 0x27a7 },
- { "a178", 0x27a8 },
- { "a179", 0x27a9 },
- { "a193", 0x27aa },
- { "a180", 0x27ab },
- { "a199", 0x27ac },
- { "a181", 0x27ad },
- { "a200", 0x27ae },
- { "a182", 0x27af },
- { "a201", 0x27b1 },
- { "a183", 0x27b2 },
- { "a184", 0x27b3 },
- { "a197", 0x27b4 },
- { "a185", 0x27b5 },
- { "a194", 0x27b6 },
- { "a198", 0x27b7 },
- { "a186", 0x27b8 },
- { "a195", 0x27b9 },
- { "a187", 0x27ba },
- { "a188", 0x27bb },
- { "a189", 0x27bc },
- { "a190", 0x27bd },
- { "a191", 0x27be },
- { "register.sans", 0xf8e8 },
- { "register.serif", 0xf6da },
- { "one.superior", 0x00b9 },
- { "two.superior", 0x00b2 },
- { "three.superior", 0x00b3 },
- { "parenleft.superior", 0x207d },
- { "parenright.superior", 0x207e },
- { "n.superior", 0x207f },
- { "parenleft.inferior", 0x208d },
- { "parenright.inferior", 0x208e },
- { "zero.superior", 0x2070 },
- { "four.superior", 0x2074 },
- { "five.superior", 0x2075 },
- { "six.superior", 0x2076 },
- { "seven.superior", 0x2077 },
- { "eight.superior", 0x2078 },
- { "nine.superior", 0x2079 },
- { "zero.inferior", 0x2080 },
- { "one.inferior", 0x2081 },
- { "two.inferior", 0x2082 },
- { "three.inferior", 0x2083 },
- { "four.inferior", 0x2084 },
- { "five.inferior", 0x2085 },
- { "six.inferior", 0x2086 },
- { "seven.inferior", 0x2087 },
- { "eight.inferior", 0x2088 },
- { "nine.inferior", 0x2089 },
- { "mu.greek", 0x03bc },
- { "Delta.greek", 0x0394 },
- { "Omega.greek", 0x03a9 },
- { "sigma.end", 0x03c2 },
- { "beta.alt", 0x03d0 },
- { "kappa.alt", 0x03f0 },
- { "theta.alt", 0x03d1 },
- { "Upsilon.alt", 0x03d2 },
- { "phi.alt", 0x03d5 },
- { "pi.alt", 0x03d6 },
- { "A.cyr", 0x0410 },
- { "Ghe.up", 0x0490 },
- { "I.cyr", 0x0418 },
- { "I.short", 0x0419 },
- { "O.cyr", 0x041e },
- { "U.cyr", 0x0423 },
- { "E.cyr", 0x042d },
- { "Ie.ukran", 0x0404 },
- { "I.ukran", 0x0406 },
- { "U.short", 0x040e },
- { "a.cyr", 0x0430 },
- { "ghe.up", 0x0491 },
- { "i.cyr", 0x0438 },
- { "i.short", 0x0439 },
- { "o.cyr", 0x043e },
- { "u.cyr", 0x0443 },
- { "e.cyr", 0x044d },
- { "ie.ukran", 0x0454 },
- { "i.ukran", 0x0456 },
- { "u.short", 0x045e },
- { "ghe.ital", 0xf6c4 },
- { "afii10068.ital", 0xf6c4 },
- { "afii10066.ital", 0xf6c5 },
- { "be.alt", 0xf6c5 },
- { "afii10069.ital", 0xf6c6 },
- { "de.ital", 0xf6c6 },
- { "afii10081.ital", 0xf6c7 },
- { "pe.ital", 0xf6c7 },
- { "afii10084.ital", 0xf6c8 },
- { "te.ital", 0xf6c8 },
- { "Omega.math", 0x2126 },
- { "Delta.math", 0x2206 },
- { "afii57689_afii57804", 0xfb2a },
- { "afii57689_afii57803", 0xfb2b },
- { "afii57669_afii57806", 0xfb4b },
- { "afii57718_afii57798", 0xfb1f },
- { "afii57669_afii57807", 0xfb35 },
- { ".null", 0x0000 },
- { "dialytika_perispomeni", 0x1fc1 },
- { "psili_varia", 0x1fcd },
- { "psili_oxia", 0x1fce },
- { "psili_perispomeni", 0x1fcf },
- { "dasia_varia", 0x1fdd },
- { "dasia_oxia", 0x1fde },
- { "dasia_perispomeni", 0x1fdf },
- { "dialytika_varia", 0x1fed },
- { "dialytika_oxia", 0x1fee },
- { "Alphaacute", 0x1fbb },
- { "Alphaasper", 0x1f09 },
- { "Alphaasperacute", 0x1f0d },
- { "Alphaaspergrave", 0x1f0b },
- { "Alphaaspertilde", 0x1f0f },
- { "Alphabreve", 0x1fb8 },
- { "Alphagrave", 0x1fba },
- { "Alphaiotasub", 0x1fbc },
- { "Alphaiotasubasper", 0x1f89 },
- { "Alphaiotasubasperacute", 0x1f8d },
- { "Alphaiotasubaspergrave", 0x1f8b },
- { "Alphaiotasubaspertilde", 0x1f8f },
- { "Alphaiotasublenis", 0x1f88 },
- { "Alphaiotasublenisacute", 0x1f8c },
- { "Alphaiotasublenisgrave", 0x1f8a },
- { "Alphaiotasublenistilde", 0x1f8e },
- { "Alphalenis", 0x1f08 },
- { "Alphalenisacute", 0x1f0c },
- { "Alphalenisgrave", 0x1f0a },
- { "Alphalenistilde", 0x1f0e },
- { "Alphamacron", 0x1fb9 },
- { "Epsilonacute", 0x1fc9 },
- { "Epsilonasper", 0x1f19 },
- { "Epsilonasperacute", 0x1f1d },
- { "Epsilonaspergrave", 0x1f1b },
- { "Epsilongrave", 0x1fc8 },
- { "Epsilonlenis", 0x1f18 },
- { "Epsilonlenisacute", 0x1f1c },
- { "Epsilonlenisgrave", 0x1f1a },
- { "Etaacute", 0x1fcb },
- { "Etaasper", 0x1f29 },
- { "Etaasperacute", 0x1f2d },
- { "Etaaspergrave", 0x1f2b },
- { "Etaaspertilde", 0x1f2f },
- { "Etagrave", 0x1fca },
- { "Etaiotasub", 0x1fcc },
- { "Etaiotasubasper", 0x1f99 },
- { "Etaiotasubasperacute", 0x1f9d },
- { "Etaiotasubaspergrave", 0x1f9b },
- { "Etaiotasubaspertilde", 0x1f9f },
- { "Etaiotasublenis", 0x1f98 },
- { "Etaiotasublenisacute", 0x1f9c },
- { "Etaiotasublenisgrave", 0x1f9a },
- { "Etaiotasublenistilde", 0x1f9e },
- { "Etalenis", 0x1f28 },
- { "Etalenisacute", 0x1f2c },
- { "Etalenisgrave", 0x1f2a },
- { "Etalenistilde", 0x1f2e },
- { "Iotaacute", 0x1fdb },
- { "Iotaasper", 0x1f39 },
- { "Iotaasperacute", 0x1f3d },
- { "Iotaaspergrave", 0x1f3b },
- { "Iotaaspertilde", 0x1f3f },
- { "Iotabreve", 0x1fd8 },
- { "Iotagrave", 0x1fda },
- { "Iotalenis", 0x1f38 },
- { "Iotalenisacute", 0x1f3c },
- { "Iotalenisgrave", 0x1f3a },
- { "Iotalenistilde", 0x1f3e },
- { "Iotamacron", 0x1fd9 },
- { "Omegaacute", 0x1ffb },
- { "Omegaasper", 0x1f69 },
- { "Omegaasperacute", 0x1f6d },
- { "Omegaaspergrave", 0x1f6b },
- { "Omegaaspertilde", 0x1f6f },
- { "Omegagrave", 0x1ffa },
- { "Omegaiotasub", 0x1ffc },
- { "Omegaiotasubasper", 0x1fa9 },
- { "Omegaiotasubasperacute", 0x1fad },
- { "Omegaiotasubaspergrave", 0x1fab },
- { "Omegaiotasubaspertilde", 0x1faf },
- { "Omegaiotasublenis", 0x1fa8 },
- { "Omegaiotasublenisacute", 0x1fac },
- { "Omegaiotasublenisgrave", 0x1faa },
- { "Omegaiotasublenistilde", 0x1fae },
- { "Omegalenis", 0x1f68 },
- { "Omegalenisacute", 0x1f6c },
- { "Omegalenisgrave", 0x1f6a },
- { "Omegalenistilde", 0x1f6e },
- { "Omicronacute", 0x1ff9 },
- { "Omicronasper", 0x1f49 },
- { "Omicronasperacute", 0x1f4d },
- { "Omicronaspergrave", 0x1f4b },
- { "Omicrongrave", 0x1ff8 },
- { "Omicronlenis", 0x1f48 },
- { "Omicronlenisacute", 0x1f4c },
- { "Omicronlenisgrave", 0x1f4a },
- { "Rhoasper", 0x1fec },
- { "Upsilonacute", 0x1feb },
- { "Upsilonasper", 0x1f59 },
- { "Upsilonasperacute", 0x1f5d },
- { "Upsilonaspergrave", 0x1f5b },
- { "Upsilonaspertilde", 0x1f5f },
- { "Upsilonbreve", 0x1fe8 },
- { "Upsilongrave", 0x1fea },
- { "Upsilonmacron", 0x1fe9 },
- { "numeralsign", 0x0374 },
- { "lownumeralsign", 0x0375 },
- { "lowcomma", 0x037a },
- { "stigma", 0x03da },
- { "koppa", 0x03de },
- { "sampi", 0x03e0 },
- { "lenis", 0x1fbd },
- { "iotasubscript", 0x1fbe },
- { "dieresistilde", 0x1fc1 },
- { "lenisgrave", 0x1fcd },
- { "lenisacute", 0x1fce },
- { "lenistilde", 0x1fcf },
- { "aspergrave", 0x1fdd },
- { "asperacute", 0x1fde },
- { "aspertilde", 0x1fdf },
- { "dialytikagrave", 0x1fed },
- { "dialytikaacute", 0x1fee },
- { "asper", 0x1ffe },
- { "alphalenis", 0x1f00 },
- { "alphaasper", 0x1f01 },
- { "alphalenisgrave", 0x1f02 },
- { "alphaaspergrave", 0x1f03 },
- { "alphalenisacute", 0x1f04 },
- { "alphaasperacute", 0x1f05 },
- { "alphalenistilde", 0x1f06 },
- { "alphaaspertilde", 0x1f07 },
- { "epsilonlenis", 0x1f10 },
- { "epsilonasper", 0x1f11 },
- { "epsilonlenisgrave", 0x1f12 },
- { "epsilonaspergrave", 0x1f13 },
- { "epsilonlenisacute", 0x1f14 },
- { "epsilonasperacute", 0x1f15 },
- { "etalenis", 0x1f20 },
- { "etaasper", 0x1f21 },
- { "etalenisgrave", 0x1f22 },
- { "etaaspergrave", 0x1f23 },
- { "etalenisacute", 0x1f24 },
- { "etaasperacute", 0x1f25 },
- { "etalenistilde", 0x1f26 },
- { "etaaspertilde", 0x1f27 },
- { "iotalenis", 0x1f30 },
- { "iotaasper", 0x1f31 },
- { "iotalenisgrave", 0x1f32 },
- { "iotaaspergrave", 0x1f33 },
- { "iotalenisacute", 0x1f34 },
- { "iotaasperacute", 0x1f35 },
- { "iotalenistilde", 0x1f36 },
- { "iotaaspertilde", 0x1f37 },
- { "omicronlenis", 0x1f40 },
- { "omicronasper", 0x1f41 },
- { "omicronlenisgrave", 0x1f42 },
- { "omicronaspergrave", 0x1f43 },
- { "omicronlenisacute", 0x1f44 },
- { "omicronasperacute", 0x1f45 },
- { "upsilonlenis", 0x1f50 },
- { "upsilonasper", 0x1f51 },
- { "upsilonlenisgrave", 0x1f52 },
- { "upsilonaspergrave", 0x1f53 },
- { "upsilonlenisacute", 0x1f54 },
- { "upsilonasperacute", 0x1f55 },
- { "upsilonlenistilde", 0x1f56 },
- { "upsilonaspertilde", 0x1f57 },
- { "omegalenis", 0x1f60 },
- { "omegaasper", 0x1f61 },
- { "omegalenisgrave", 0x1f62 },
- { "omegaaspergrave", 0x1f63 },
- { "omegalenisacute", 0x1f64 },
- { "omegaasperacute", 0x1f65 },
- { "omegalenistilde", 0x1f66 },
- { "omegaaspertilde", 0x1f67 },
- { "alphagrave", 0x1f70 },
- { "alphaacute", 0x1f71 },
- { "epsilongrave", 0x1f72 },
- { "epsilonacute", 0x1f73 },
- { "etagrave", 0x1f74 },
- { "etaacute", 0x1f75 },
- { "iotagrave", 0x1f76 },
- { "iotaacute", 0x1f77 },
- { "omicrongrave", 0x1f78 },
- { "omicronacute", 0x1f79 },
- { "upsilongrave", 0x1f7a },
- { "upsilonacute", 0x1f7b },
- { "omegagrave", 0x1f7c },
- { "omegaacute", 0x1f7d },
- { "alphaiotasublenis", 0x1f80 },
- { "alphaiotasubasper", 0x1f81 },
- { "alphaiotasublenisgrave", 0x1f82 },
- { "alphaiotasubaspergrave", 0x1f83 },
- { "alphaiotasublenisacute", 0x1f84 },
- { "alphaiotasubasperacute", 0x1f85 },
- { "alphaiotasublenistilde", 0x1f86 },
- { "alphaiotasubaspertilde", 0x1f87 },
- { "etaiotasublenis", 0x1f90 },
- { "etaiotasubasper", 0x1f91 },
- { "etaiotasublenisgrave", 0x1f92 },
- { "etaiotasubaspergrave", 0x1f93 },
- { "etaiotasublenisacute", 0x1f94 },
- { "etaiotasubasperacute", 0x1f95 },
- { "etaiotasublenistilde", 0x1f96 },
- { "etaiotasubaspertilde", 0x1f97 },
- { "omegaiotasublenis", 0x1fa0 },
- { "omegaiotasubasper", 0x1fa1 },
- { "omegaiotasublenisgrave", 0x1fa2 },
- { "omegaiotasubaspergrave", 0x1fa3 },
- { "omegaiotasublenisacute", 0x1fa4 },
- { "omegaiotasubasperacute", 0x1fa5 },
- { "omegaiotasublenistilde", 0x1fa6 },
- { "omegaiotasubaspertilde", 0x1fa7 },
- { "alphabreve", 0x1fb0 },
- { "alphamacron", 0x1fb1 },
- { "alphaiotasubgrave", 0x1fb2 },
- { "alphaiotasub", 0x1fb3 },
- { "alphatilde", 0x1fb6 },
- { "alphaiotasubtilde", 0x1fb7 },
- { "etaiotasubgrave", 0x1fc2 },
- { "etaiotasub", 0x1fc3 },
- { "etaiotasubacute", 0x1fc4 },
- { "etatilde", 0x1fc6 },
- { "etaiotasubtilde", 0x1fc7 },
- { "iotabreve", 0x1fd0 },
- { "iotamacron", 0x1fd1 },
- { "iotadieresisgrave", 0x1fd2 },
- { "iotadieresisacute", 0x1fd3 },
- { "iotatilde", 0x1fd6 },
- { "iotadieresistilde", 0x1fd7 },
- { "upsilonbreve", 0x1fe0 },
- { "upsilonmacron", 0x1fe1 },
- { "upsilondieresisgrave", 0x1fe2 },
- { "upsilondieresisacute", 0x1fe3 },
- { "rholenis", 0x1fe4 },
- { "rhoasper", 0x1fe5 },
- { "upsilontilde", 0x1fe6 },
- { "omegaiotasubgrave", 0x1ff2 },
- { "omegaiotasub", 0x1ff3 },
- { "omegaiotasubacute", 0x1ff4 },
- { "omegatilde", 0x1ff6 },
- { "omegaiotasubtilde", 0x1ff7 },
- { "alphaiotasubacute", 0x1fb4 },
- { "upsilondieresistilde", 0x1fe7 },
- { "digamma", 0xefd5 },
- { "Be", 0x0411 },
- { "Ve", 0x0412 },
- { "Ghe", 0x0413 },
- { "De", 0x0414 },
- { "Ie", 0x0415 },
- { "Zhe", 0x0416 },
- { "Ze", 0x0417 },
- { "Ka", 0x041a },
- { "El", 0x041b },
- { "Em", 0x041c },
- { "En", 0x041d },
- { "Pe", 0x041f },
- { "Er", 0x0420 },
- { "Es", 0x0421 },
- { "Te", 0x0422 },
- { "Ef", 0x0424 },
- { "Ha", 0x0425 },
- { "Tse", 0x0426 },
- { "Che", 0x0427 },
- { "Sha", 0x0428 },
- { "Shcha", 0x0429 },
- { "Hard", 0x042a },
- { "Yeru", 0x042b },
- { "Soft", 0x042c },
- { "Yu", 0x042e },
- { "Ya", 0x042f },
- { "Io", 0x0401 },
- { "Dje", 0x0402 },
- { "Gje", 0x0403 },
- { "Dze", 0x0405 },
- { "Yi", 0x0407 },
- { "Je", 0x0408 },
- { "Lje", 0x0409 },
- { "Nje", 0x040a },
- { "Tshe", 0x040b },
- { "Kje", 0x040c },
- { "Dzhe", 0x040f },
- { "Yat", 0x0462 },
- { "Fita", 0x0472 },
- { "Izhitsa", 0x0474 },
- { "be", 0x0431 },
- { "ve", 0x0432 },
- { "ghe", 0x0433 },
- { "de", 0x0434 },
- { "ie", 0x0435 },
- { "zhe", 0x0436 },
- { "ze", 0x0437 },
- { "ka", 0x043a },
- { "el", 0x043b },
- { "em", 0x043c },
- { "en", 0x043d },
- { "er", 0x0440 },
- { "es", 0x0441 },
- { "te", 0x0442 },
- { "ef", 0x0444 },
- { "ha", 0x0445 },
- { "tse", 0x0446 },
- { "che", 0x0447 },
- { "sha", 0x0448 },
- { "shcha", 0x0449 },
- { "hard", 0x044a },
- { "yeru", 0x044b },
- { "soft", 0x044c },
- { "yu", 0x044e },
- { "ya", 0x044f },
- { "io", 0x0451 },
- { "dje", 0x0452 },
- { "gje", 0x0453 },
- { "dze", 0x0455 },
- { "yi", 0x0457 },
- { "je", 0x0458 },
- { "lje", 0x0459 },
- { "nje", 0x045a },
- { "tshe", 0x045b },
- { "kje", 0x045c },
- { "dzhe", 0x045f },
- { "yat", 0x0463 },
- { "fita", 0x0473 },
- { "izhitsa", 0x0475 },
- { "litre", 0x2113 },
- { "Dotaccent", 0xefed },
- { "Breve", 0xefee },
- { "Ogonek", 0xeff1 },
- { "Cedilla", 0xeff2 },
- { "Ring", 0xeff3 },
- { "Tilde", 0xeff5 },
- { "Circumflex", 0xeff7 },
- { "dbar", 0x0111 },
- { "st", 0xfb06 },
- { "TeXtext32", 0x0337 },
- { "DD070", 0x2014 },
- { "monospacedash", 0x2014 },
- { "Dash1cent", 0x2015 },
- { "apostrophereverse", 0x201b },
- { "Pts", 0x20a7 },
- { "SM760000", 0x2195 },
- { "SM770000", 0x21a8 },
- { "SP320000", 0x2219 },
- { "SD630000", 0x22c5 },
- { "SM790000", 0x2302 },
- { "caretinverted", 0x2304 },
- { "SM680000", 0x2310 },
- { "SA420000", 0x2319 },
- { "BorderULCorner1", 0x231c },
- { "DD010", 0x231c },
- { "DD101", 0x231c },
- { "BorderURCorner1", 0x231d },
- { "DD012", 0x231d },
- { "DD104", 0x231d },
- { "BorderLLCorner1", 0x231e },
- { "DD014", 0x231e },
- { "DD109", 0x231e },
- { "BorderLRCorner1", 0x231f },
- { "DD015", 0x231f },
- { "DD112", 0x231f },
- { "SS260000", 0x2320 },
- { "SS270000", 0x2321 },
- { "hook", 0x2440 },
- { "chair", 0x2441 },
- { "fork", 0x2442 },
- { "SF600000", 0x2580 },
- { "BorderLower1", 0x2581 },
- { "DD011", 0x2581 },
- { "DD021", 0x2581 },
- { "DD110", 0x2581 },
- { "Flower1l", 0x2581 },
- { "SF570000", 0x2584 },
- { "SF610000", 0x2588 },
- { "Tile", 0x2588 },
- { "HalfTile", 0x258c },
- { "SF580000", 0x258c },
- { "BorderLeftVertical1", 0x258f },
- { "DD013", 0x258f },
- { "DD034", 0x258f },
- { "DD105", 0x258f },
- { "Flower1d", 0x258f },
- { "SF590000", 0x2590 },
- { "SF140000", 0x2591 },
- { "SF150000", 0x2592 },
- { "SF160000", 0x2593 },
- { "BorderUpper1", 0x2594 },
- { "DD024", 0x2594 },
- { "DD102", 0x2594 },
- { "BorderRightVertical1", 0x2595 },
- { "DD031", 0x2595 },
- { "DD106", 0x2595 },
- { "Flower2dr", 0x2595 },
- { "SM600000", 0x25b2 },
- { "SM590000", 0x25b6 },
- { "SV040000", 0x25bc },
- { "SM630000", 0x25c0 },
- { "SM750000", 0x25cb },
- { "SM570001", 0x25d8 },
- { "SM750002", 0x25d9 },
- { "ShootingStar", 0x2604 },
- { "DD130", 0x2605 },
- { "StarDingbat1", 0x2605 },
- { "TheSun", 0x2609 },
- { "FleuronLeft", 0x2619 },
- { "cross", 0x2629 },
- { "SS000000", 0x263a },
- { "SS010000", 0x263b },
- { "SM690000", 0x263c },
- { "TheMoon", 0x263d },
- { "Moon", 0x263e },
- { "Mercury", 0x263f },
- { "Venus", 0x2640 },
- { "Earth", 0x2641 },
- { "Mars", 0x2642 },
- { "Jupiter", 0x2643 },
- { "Saturn", 0x2644 },
- { "Uranus", 0x2645 },
- { "Neptune", 0x2646 },
- { "Pluto", 0x2647 },
- { "Aries", 0x2648 },
- { "Taurus", 0x2649 },
- { "Gemini", 0x264a },
- { "Cancer", 0x264b },
- { "Leo", 0x264c },
- { "Virgo", 0x264d },
- { "Libra", 0x264e },
- { "Scorpio", 0x264f },
- { "Sagittarius", 0x2650 },
- { "Capricorn", 0x2651 },
- { "Aquarius", 0x2652 },
- { "Pisces", 0x2653 },
- { "diamondopen", 0x2662 },
- { "FleuronCenter", 0x2766 },
- { "FleuronRight", 0x2767 },
- { "st1", 0xfb06 },
- { "zeroslash", 0xf638 },
- { "pi1", 0x03d6 },
- { "hyphen-minus", 0x002d },
- { "hyphenminus", 0x002d },
- { "nonmarkingreturn", 0x000c },
- { "micro", 0x00b5 },
- { "Dmacron", 0x0110 },
- { "kra", 0x0138 },
- { "bbar", 0x0180 },
- { "Dbar", 0x0189 },
- { "deltaturn", 0x018d },
- { "Eturn", 0x018e },
- { "Epsilonlatin", 0x0190 },
- { "Gammalatin", 0x0194 },
- { "Iotalatin", 0x0196 },
- { "Ibar", 0x0197 },
- { "lambdabar", 0x019b },
- { "mcapturn", 0x019c },
- { "Nhook", 0x019d },
- { "nleg", 0x019e },
- { "Obar", 0x019f },
- { "OI", 0x01a2 },
- { "YR", 0x01a6 },
- { "eshlooprev", 0x01aa },
- { "Trthook", 0x01ae },
- { "Upsilonlatin", 0x01b1 },
- { "Vcursive", 0x01b2 },
- { "Zbar", 0x01b5 },
- { "zbar", 0x01b6 },
- { "Yogh", 0x01b7 },
- { "Yoghrev", 0x01b8 },
- { "yoghrev", 0x01b9 },
- { "yoghtail", 0x01ba },
- { "twobar", 0x01bb },
- { "glottalstopbarinv", 0x01be },
- { "pipe", 0x01c0 },
- { "pipedbl", 0x01c1 },
- { "pipedblbar", 0x01c2 },
- { "exclamlatin", 0x01c3 },
- { "DZhacek", 0x01c4 },
- { "Dzhacek", 0x01c5 },
- { "dzhacek", 0x01c6 },
- { "Ahacek", 0x01cd },
- { "ahacek", 0x01ce },
- { "Ihacek", 0x01cf },
- { "ihacek", 0x01d0 },
- { "Ohacek", 0x01d1 },
- { "ohacek", 0x01d2 },
- { "Uhacek", 0x01d3 },
- { "uhacek", 0x01d4 },
- { "Udieresishacek", 0x01d9 },
- { "udieresishacek", 0x01da },
- { "eturn", 0x01dd },
- { "Gbar", 0x01e4 },
- { "gbar", 0x01e5 },
- { "Ghacek", 0x01e6 },
- { "ghacek", 0x01e7 },
- { "Khacek", 0x01e8 },
- { "khacek", 0x01e9 },
- { "Yoghhacek", 0x01ee },
- { "yoghhacek", 0x01ef },
- { "jhacek", 0x01f0 },
- { "aturn", 0x0250 },
- { "ascriptturn", 0x0252 },
- { "cturn", 0x0254 },
- { "drthook", 0x0256 },
- { "erev", 0x0258 },
- { "epsilonlatin", 0x025b },
- { "epsilonlatinrev", 0x025c },
- { "epsilonlatinrevhook", 0x025d },
- { "epsilonlatinrevclosed", 0x025e },
- { "jdotlessbar", 0x025f },
- { "gcursive", 0x0261 },
- { "Gsmallcap", 0x0262 },
- { "gammalatin", 0x0263 },
- { "babygamma", 0x0264 },
- { "hturn", 0x0265 },
- { "ibar", 0x0268 },
- { "Ismallcap", 0x026a },
- { "lmidtilde", 0x026b },
- { "lrthook", 0x026d },
- { "lyogh", 0x026e },
- { "mturn", 0x026f },
- { "mturndescend", 0x0270 },
- { "nlftlfthook", 0x0272 },
- { "nrthook", 0x0273 },
- { "Nsmallcap", 0x0274 },
- { "obar", 0x0275 },
- { "OEsmallcap", 0x0276 },
- { "omegaclosed", 0x0277 },
- { "rturn", 0x0279 },
- { "rturnascend", 0x027a },
- { "rturnrthook", 0x027b },
- { "rdescend", 0x027c },
- { "rrthook", 0x027d },
- { "rfishhookrev", 0x027f },
- { "Rsmallcap", 0x0280 },
- { "Rsmallcapinv", 0x0281 },
- { "srthook", 0x0282 },
- { "jhookdblbar", 0x0284 },
- { "eshshortrev", 0x0285 },
- { "tturn", 0x0287 },
- { "trthook", 0x0288 },
- { "vscript", 0x028b },
- { "vturn", 0x028c },
- { "wturn", 0x028d },
- { "yturn", 0x028e },
- { "Ysmallcap", 0x028f },
- { "zrthook", 0x0290 },
- { "yogh", 0x0292 },
- { "yoghcurl", 0x0293 },
- { "glottalstoprevinv", 0x0295 },
- { "glottalstopinv", 0x0296 },
- { "cstretch", 0x0297 },
- { "kiss", 0x0298 },
- { "Bsmallcap", 0x0299 },
- { "epsilonclosed", 0x029a },
- { "Gsmallcaphook", 0x029b },
- { "Hsmallcap", 0x029c },
- { "jcrosstail", 0x029d },
- { "kturn", 0x029e },
- { "Lsmallcap", 0x029f },
- { "glottalstopbar", 0x02a1 },
- { "glottalstopbarrev", 0x02a2 },
- { "dyogh", 0x02a4 },
- { "hsuper", 0x02b0 },
- { "hhooksuper", 0x02b1 },
- { "jsuper", 0x02b2 },
- { "rsuper", 0x02b3 },
- { "rturnsuper", 0x02b4 },
- { "rturnrthooksuper", 0x02b5 },
- { "Rturnsuper", 0x02b6 },
- { "wsuper", 0x02b7 },
- { "ysuper", 0x02b8 },
- { "primedblmod", 0x02ba },
- { "quoteleftmod", 0x02bb },
- { "apostrophe", 0x02bc },
- { "apostropherev", 0x02bd },
- { "ringrighthalfsuper", 0x02be },
- { "ringlefthalfsuper", 0x02bf },
- { "glottal", 0x02c0 },
- { "glottalrev", 0x02c1 },
- { "fronted", 0x02c2 },
- { "backed", 0x02c3 },
- { "raised", 0x02c4 },
- { "lowered", 0x02c5 },
- { "linevert", 0x02c8 },
- { "macronmodifier", 0x02c9 },
- { "acutemodifier", 0x02ca },
- { "gravemodifier", 0x02cb },
- { "linevertsub", 0x02cc },
- { "macronsub", 0x02cd },
- { "gravesub", 0x02ce },
- { "acutesub", 0x02cf },
- { "length", 0x02d0 },
- { "halflength", 0x02d1 },
- { "ringrighthalfcenter", 0x02d2 },
- { "ringlefthalfsup", 0x02d3 },
- { "tackupmid", 0x02d4 },
- { "tackdownmid", 0x02d5 },
- { "rhotichook", 0x02de },
- { "gammasuper", 0x02e0 },
- { "lsuper", 0x02e1 },
- { "ssuper", 0x02e2 },
- { "xsuper", 0x02e3 },
- { "glottalrevsuper", 0x02e4 },
- { "toneextrahigh", 0x02e5 },
- { "tonehigh", 0x02e6 },
- { "tonemid", 0x02e7 },
- { "tonelow", 0x02e8 },
- { "toneextralow", 0x02e9 },
- { "gravenosp", 0x0300 },
- { "acutenosp", 0x0301 },
- { "circumflexnosp", 0x0302 },
- { "tildenosp", 0x0303 },
- { "macronnosp", 0x0304 },
- { "overscorenosp", 0x0305 },
- { "brevenosp", 0x0306 },
- { "dotnosp", 0x0307 },
- { "dieresisnosp", 0x0308 },
- { "hooksupnosp", 0x0309 },
- { "ringnosp", 0x030a },
- { "acutedblnosp", 0x030b },
- { "haceknosp", 0x030c },
- { "linevertnosp", 0x030d },
- { "linevertdblnosp", 0x030e },
- { "gravedblnosp", 0x030f },
- { "candrabindunosp", 0x0310 },
- { "breveinvnosp", 0x0311 },
- { "commaturnsupnosp", 0x0312 },
- { "apostrophesupnosp", 0x0313 },
- { "commasuprevnosp", 0x0314 },
- { "commasuprightnosp", 0x0315 },
- { "gravesubnosp", 0x0316 },
- { "acutesubnosp", 0x0317 },
- { "tackleftsubnosp", 0x0318 },
- { "tackrightsubnosp", 0x0319 },
- { "anglesupnosp", 0x031a },
- { "hornnosp", 0x031b },
- { "ringlefthalfsubnosp", 0x031c },
- { "tackupsubnosp", 0x031d },
- { "tackdownsubnosp", 0x031e },
- { "plussubnosp", 0x031f },
- { "minussubnosp", 0x0320 },
- { "hooksubpalatnosp", 0x0321 },
- { "hooksubretronosp", 0x0322 },
- { "dotsubnosp", 0x0323 },
- { "dotdblsubnosp", 0x0324 },
- { "ringsubnosp", 0x0325 },
- { "commasubnosp", 0x0326 },
- { "cedillanosp", 0x0327 },
- { "ogoneknosp", 0x0328 },
- { "linevertsubnosp", 0x0329 },
- { "bridgesubnosp", 0x032a },
- { "archdblsubnosp", 0x032b },
- { "haceksubnosp", 0x032c },
- { "circumflexsubnosp", 0x032d },
- { "brevesubnosp", 0x032e },
- { "breveinvsubnosp", 0x032f },
- { "tildesubnosp", 0x0330 },
- { "macronsubnosp", 0x0331 },
- { "underscorenosp", 0x0332 },
- { "underscoredblnosp", 0x0333 },
- { "tildemidnosp", 0x0334 },
- { "barmidshortnosp", 0x0335 },
- { "barmidlongnosp", 0x0336 },
- { "slashshortnosp", 0x0337 },
- { "slashlongnosp", 0x0338 },
- { "ringrighthalfsubnosp", 0x0339 },
- { "bridgeinvsubnosp", 0x033a },
- { "squaresubnosp", 0x033b },
- { "seagullsubnosp", 0x033c },
- { "xsupnosp", 0x033d },
- { "tildevertsupnosp", 0x033e },
- { "overscoredblnosp", 0x033f },
- { "graveleftnosp", 0x0340 },
- { "acuterightnosp", 0x0341 },
- { "wavyoverscorenosp", 0x0342 },
- { "zigzagoverscorenosp", 0x0343 },
- { "diaeresistonosnosp", 0x0344 },
- { "iotasubnosp", 0x0345 },
- { "iotasub", 0x037a },
- { "diaeresistonos", 0x0385 },
- { "iotadiaeresistonos", 0x0390 },
- { "Iotadiaeresis", 0x03aa },
- { "Upsilondiaeresis", 0x03ab },
- { "upsilondiaeresistonos", 0x03b0 },
- { "iotadiaeresis", 0x03ca },
- { "upsilondiaeresis", 0x03cb },
- { "betacurled", 0x03d0 },
- { "thetascript", 0x03d1 },
- { "Upsilonhook", 0x03d2 },
- { "Upsilonhooktonos", 0x03d3 },
- { "Upsilonhookdiaeresis", 0x03d4 },
- { "phiscript", 0x03d5 },
- { "omegapi", 0x03d6 },
- { "Stigma", 0x03da },
- { "stigma", 0x03db },
- { "Digamma", 0x03dc },
- { "digamma", 0x03dd },
- { "Koppa", 0x03de },
- { "koppa", 0x03df },
- { "Sampi", 0x03e0 },
- { "sampi", 0x03e1 },
- { "Shei", 0x03e2 },
- { "shei", 0x03e3 },
- { "Fei", 0x03e4 },
- { "fei", 0x03e5 },
- { "Khei", 0x03e6 },
- { "khei", 0x03e7 },
- { "Hori", 0x03e8 },
- { "hori", 0x03e9 },
- { "Gangia", 0x03ea },
- { "gangia", 0x03eb },
- { "Shima", 0x03ec },
- { "shima", 0x03ed },
- { "Dei", 0x03ee },
- { "dei", 0x03ef },
- { "kappascript", 0x03f0 },
- { "sigmalunate", 0x03f2 },
- { "Io", 0x0401 },
- { "Dje", 0x0402 },
- { "Gje", 0x0403 },
- { "Ecyril", 0x0404 },
- { "Dze", 0x0405 },
- { "Icyril", 0x0406 },
- { "Yi", 0x0407 },
- { "Je", 0x0408 },
- { "Lje", 0x0409 },
- { "Nje", 0x040a },
- { "Tshe", 0x040b },
- { "Kje", 0x040c },
- { "Ucyrilbreve", 0x040e },
- { "Dzhe", 0x040f },
- { "Acyril", 0x0410 },
- { "Be", 0x0411 },
- { "Ve", 0x0412 },
- { "Ge", 0x0413 },
- { "De", 0x0414 },
- { "Ie", 0x0415 },
- { "Zhe", 0x0416 },
- { "Ze", 0x0417 },
- { "Ii", 0x0418 },
- { "Iibreve", 0x0419 },
- { "Ka", 0x041a },
- { "El", 0x041b },
- { "Em", 0x041c },
- { "En", 0x041d },
- { "Ocyril", 0x041e },
- { "Pecyril", 0x041f },
- { "Er", 0x0420 },
- { "Es", 0x0421 },
- { "Te", 0x0422 },
- { "Ucyril", 0x0423 },
- { "Ef", 0x0424 },
- { "Kha", 0x0425 },
- { "Tse", 0x0426 },
- { "Che", 0x0427 },
- { "Sha", 0x0428 },
- { "Shcha", 0x0429 },
- { "Hard", 0x042a },
- { "Yeri", 0x042b },
- { "Soft", 0x042c },
- { "Ecyrilrev", 0x042d },
- { "Iu", 0x042e },
- { "Ia", 0x042f },
- { "acyril", 0x0430 },
- { "be", 0x0431 },
- { "ve", 0x0432 },
- { "ge", 0x0433 },
- { "de", 0x0434 },
- { "ie", 0x0435 },
- { "zhe", 0x0436 },
- { "ze", 0x0437 },
- { "ii", 0x0438 },
- { "iibreve", 0x0439 },
- { "ka", 0x043a },
- { "el", 0x043b },
- { "em", 0x043c },
- { "en", 0x043d },
- { "ocyril", 0x043e },
- { "pecyril", 0x043f },
- { "er", 0x0440 },
- { "es", 0x0441 },
- { "te", 0x0442 },
- { "ucyril", 0x0443 },
- { "ef", 0x0444 },
- { "kha", 0x0445 },
- { "tse", 0x0446 },
- { "che", 0x0447 },
- { "sha", 0x0448 },
- { "shcha", 0x0449 },
- { "hard", 0x044a },
- { "yeri", 0x044b },
- { "soft", 0x044c },
- { "ecyrilrev", 0x044d },
- { "iu", 0x044e },
- { "ia", 0x044f },
- { "io", 0x0451 },
- { "dje", 0x0452 },
- { "gje", 0x0453 },
- { "ecyril", 0x0454 },
- { "dze", 0x0455 },
- { "icyril", 0x0456 },
- { "yi", 0x0457 },
- { "je", 0x0458 },
- { "lje", 0x0459 },
- { "nje", 0x045a },
- { "tshe", 0x045b },
- { "kje", 0x045c },
- { "ucyrilbreve", 0x045e },
- { "dzhe", 0x045f },
- { "Yat", 0x0462 },
- { "yat", 0x0463 },
- { "Yusbig", 0x046a },
- { "yusbig", 0x046b },
- { "Psicyril", 0x0470 },
- { "psicyril", 0x0471 },
- { "Fita", 0x0472 },
- { "fita", 0x0473 },
- { "Izhitsa", 0x0474 },
- { "izhitsa", 0x0475 },
- { "Izhitsagravedbl", 0x0476 },
- { "izhitsagravedbl", 0x0477 },
- { "Digraphuk", 0x0478 },
- { "digraphuk", 0x0479 },
- { "Omegaround", 0x047a },
- { "omegaround", 0x047b },
- { "Omegatitlo", 0x047c },
- { "omegatitlo", 0x047d },
- { "OT", 0x047e },
- { "ot", 0x047f },
- { "Geupturn", 0x0490 },
- { "geupturn", 0x0491 },
- { "Gebar", 0x0492 },
- { "gebar", 0x0493 },
- { "Gehook", 0x0494 },
- { "gehook", 0x0495 },
- { "Zhertdes", 0x0496 },
- { "zhertdes", 0x0497 },
- { "Zecedilla", 0x0498 },
- { "zecedilla", 0x0499 },
- { "Kartdes", 0x049a },
- { "kartdes", 0x049b },
- { "Kavertbar", 0x049c },
- { "kavertbar", 0x049d },
- { "Kabar", 0x049e },
- { "kabar", 0x049f },
- { "GeKarev", 0x04a0 },
- { "gekarev", 0x04a1 },
- { "Enrtdes", 0x04a2 },
- { "enrtdes", 0x04a3 },
- { "EnGe", 0x04a4 },
- { "enge", 0x04a5 },
- { "Pehook", 0x04a6 },
- { "pehook", 0x04a7 },
- { "Ohook", 0x04a8 },
- { "ohook", 0x04a9 },
- { "Escedilla", 0x04aa },
- { "escedilla", 0x04ab },
- { "Tertdes", 0x04ac },
- { "tertdes", 0x04ad },
- { "Ustrt", 0x04ae },
- { "ustrt", 0x04af },
- { "Ustrtbar", 0x04b0 },
- { "ustrtbar", 0x04b1 },
- { "Khartdes", 0x04b2 },
- { "khartdes", 0x04b3 },
- { "TeTse", 0x04b4 },
- { "tetse", 0x04b5 },
- { "Chertdes", 0x04b6 },
- { "chertdes", 0x04b7 },
- { "Chevertbar", 0x04b8 },
- { "chevertbar", 0x04b9 },
- { "Hcyril", 0x04ba },
- { "hcyril", 0x04bb },
- { "Iehook", 0x04bc },
- { "iehook", 0x04bd },
- { "Iehookogonek", 0x04be },
- { "iehookogonek", 0x04bf },
- { "Icyril1", 0x04c0 },
- { "Zhebreve", 0x04c1 },
- { "zhebreve", 0x04c2 },
- { "Kahook", 0x04c3 },
- { "kahook", 0x04c4 },
- { "Enhook", 0x04c7 },
- { "enhook", 0x04c8 },
- { "Cheleftdes", 0x04cb },
- { "cheleftdes", 0x04cc },
- { "qibuts", 0x05bb },
- { "meteg", 0x05bd },
- { "maqaf", 0x05be },
- { "paseq", 0x05c0 },
- { "shindot", 0x05c1 },
- { "sindot", 0x05c2 },
- { "sofpasuq", 0x05c3 },
- { "kaffinal", 0x05da },
- { "memfinal", 0x05dd },
- { "nunfinal", 0x05df },
- { "pefinal", 0x05e3 },
- { "tsadifinal", 0x05e5 },
- { "vavdbl", 0x05f0 },
- { "vavyod", 0x05f1 },
- { "yoddbl", 0x05f2 },
- { "geresh", 0x05f3 },
- { "gershayim", 0x05f4 },
- { "varika", 0x05f5 },
- { "enquad", 0x2000 },
- { "emquad", 0x2001 },
- { "emspace", 0x2003 },
- { "threeperemspace", 0x2004 },
- { "fourperemspace", 0x2005 },
- { "sixperemspace", 0x2006 },
- { "figurespace", 0x2007 },
- { "punctuationspace", 0x2008 },
- { "thinspace", 0x2009 },
- { "hairspace", 0x200a },
- { "zerospace", 0x200b },
- { "zeronojoin", 0x200c },
- { "zerojoin", 0x200d },
- { "hyphennobreak", 0x2011 },
- { "quotedash", 0x2015 },
- { "dashdbl", 0x2016 },
- { "quotesinglrev", 0x201b },
- { "quotedblrev", 0x201f },
- { "trianglebullet", 0x2023 },
- { "onedotlead", 0x2024 },
- { "twodotlead", 0x2025 },
- { "hyphendot", 0x2027 },
- { "lineseparator", 0x2028 },
- { "paragraphseparator", 0x2029 },
- { "lre", 0x202a },
- { "rle", 0x202b },
- { "pdf", 0x202c },
- { "lro", 0x202d },
- { "rlo", 0x202e },
- { "pertenthousand", 0x2031 },
- { "prime", 0x2032 },
- { "primedbl", 0x2033 },
- { "primetriple", 0x2034 },
- { "primerev", 0x2035 },
- { "primedblrev", 0x2036 },
- { "primetriplerev", 0x2037 },
- { "caret", 0x2038 },
- { "refmark", 0x203b },
- { "interrobang", 0x203d },
- { "tie", 0x2040 },
- { "caretinsert", 0x2041 },
- { "hyphenbullet", 0x2043 },
- { "minussuperior", 0x207b },
- { "plusinferior", 0x208a },
- { "equalinferior", 0x208c },
- { "eurocurrency", 0x20a0 },
- { "coloncurrency", 0x20a1 },
- { "mill", 0x20a5 },
- { "naira", 0x20a6 },
- { "pesetas", 0x20a7 },
- { "rupee", 0x20a8 },
- { "newsheqel", 0x20aa },
- { "accountof", 0x2100 },
- { "addresssubject", 0x2101 },
- { "Cbb", 0x2102 },
- { "degreecentigrade", 0x2103 },
- { "CL", 0x2104 },
- { "cadauna", 0x2106 },
- { "Euler", 0x2107 },
- { "scruple", 0x2108 },
- { "degreefarenheit", 0x2109 },
- { "Hscript", 0x210b },
- { "Hblackletter", 0x210c },
- { "Hbb", 0x210d },
- { "planck", 0x210e },
- { "planckover2pi", 0x210f },
- { "Iscript", 0x2110 },
- { "Lscript", 0x2112 },
- { "lscript", 0x2113 },
- { "lbbar", 0x2114 },
- { "Nbb", 0x2115 },
- { "recordright", 0x2117 },
- { "Pbb", 0x2119 },
- { "Qbb", 0x211a },
- { "Rscript", 0x211b },
- { "Rfractur", 0x211c },
- { "Rbb", 0x211d },
- { "Rx", 0x211e },
- { "response", 0x211f },
- { "servicemark", 0x2120 },
- { "tel", 0x2121 },
- { "versicle", 0x2123 },
- { "Zbb", 0x2124 },
- { "ounce", 0x2125 },
- { "ohm", 0x2126 },
- { "mho", 0x2127 },
- { "Zblackletter", 0x2128 },
- { "iotaturn", 0x2129 },
- { "degreekelvin", 0x212a },
- { "Bscript", 0x212c },
- { "Cblackletter", 0x212d },
- { "escript", 0x212f },
- { "Escript", 0x2130 },
- { "Fscript", 0x2131 },
- { "Fturn", 0x2132 },
- { "Mscript", 0x2133 },
- { "u0scrip", 0x2134 },
- { "alephmath", 0x2135 },
- { "gimelmath", 0x2137 },
- { "dalethmath", 0x2138 },
- { "twothird", 0x2154 },
- { "onefifth", 0x2155 },
- { "twofifths", 0x2156 },
- { "threefifths", 0x2157 },
- { "fourfifths", 0x2158 },
- { "onesixth", 0x2159 },
- { "fivesixths", 0x215a },
- { "onenumerator", 0x215f },
- { "arrowlongboth", 0x2194 },
- { "arrowlongbothv", 0x2195 },
- { "arrownorthwest", 0x2196 },
- { "arrownortheast", 0x2197 },
- { "arrowsoutheast", 0x2198 },
- { "arrowsouthwest", 0x2199 },
- { "arrowleftnot", 0x219a },
- { "arrowrightnot", 0x219b },
- { "arrowwaveleft", 0x219c },
- { "arrowwaveright", 0x219d },
- { "dblarrowheadleft", 0x219e },
- { "dblarrowheadup", 0x219f },
- { "dblarrowheadright", 0x21a0 },
- { "dblarrowheaddown", 0x21a1 },
- { "arrowtailleft", 0x21a2 },
- { "arrowtailright", 0x21a3 },
- { "arrowbarleft", 0x21a4 },
- { "arrowbarup", 0x21a5 },
- { "arrowbarright", 0x21a6 },
- { "arrowbardown", 0x21a7 },
- { "arrowbothvbase", 0x21a8 },
- { "arrowhookleft", 0x21a9 },
- { "arrowhookright", 0x21aa },
- { "arrowloopleft", 0x21ab },
- { "arrowloopright", 0x21ac },
- { "arrowwaveboth", 0x21ad },
- { "arrowlongbothnot", 0x21ae },
- { "arrowzigzag", 0x21af },
- { "arrowrightdown", 0x21b4 },
- { "carriagerreturn", 0x21b5 },
- { "arrowsemanticlockw", 0x21b6 },
- { "arrowsemclockw", 0x21b7 },
- { "home", 0x21b8 },
- { "tableftright", 0x21b9 },
- { "arrowanticlockw", 0x21ba },
- { "arrowclockw", 0x21bb },
- { "arrowlefttophalf", 0x21bc },
- { "arrowleftbothalf", 0x21bd },
- { "harpoonupright", 0x21be },
- { "harpoonupleft", 0x21bf },
- { "arrowrighttophalf", 0x21c0 },
- { "arrowrightbothalf", 0x21c1 },
- { "harpoondownright", 0x21c2 },
- { "harpoondownleft", 0x21c3 },
- { "arrowparrrightleft", 0x21c4 },
- { "dblarrowupdown", 0x21c5 },
- { "arrowparrleftright", 0x21c6 },
- { "dblarrowup", 0x21c8 },
- { "dblarrowdown", 0x21ca },
- { "harpoonleftright", 0x21cb },
- { "harpoonrightleft", 0x21cc },
- { "arrowdblleftnot", 0x21cd },
- { "arrowdbllongbothnot", 0x21ce },
- { "arrowdblrightnot", 0x21cf },
- { "arrowdbllongboth", 0x21d4 },
- { "arrowdbllongbothv", 0x21d5 },
- { "arrowdblnw", 0x21d6 },
- { "arrowdblne", 0x21d7 },
- { "arrowdblse", 0x21d8 },
- { "arrowdblsw", 0x21d9 },
- { "arrowtripleleft", 0x21da },
- { "arrowtripleright", 0x21db },
- { "arrowsquiggleleft", 0x21dc },
- { "arrowsquiggleright", 0x21dd },
- { "arrowopenleft", 0x21e6 },
- { "arrowopenup", 0x21e7 },
- { "arrowopenright", 0x21e8 },
- { "arrowopendown", 0x21e9 },
- { "complement", 0x2201 },
- { "notexistential", 0x2204 },
- { "elementsmall", 0x220a },
- { "owner", 0x220b },
- { "notowner", 0x220c },
- { "ownersmall", 0x220d },
- { "eop", 0x220e },
- { "coproduct", 0x2210 },
- { "dotplus", 0x2214 },
- { "slashmath", 0x2215 },
- { "backslashmath", 0x2216 },
- { "ringoperator", 0x2218 },
- { "bulletmath", 0x2219 },
- { "cuberoot", 0x221b },
- { "fourthroot", 0x221c },
- { "measuredangle", 0x2221 },
- { "sphericalangle", 0x2222 },
- { "notbar", 0x2224 },
- { "parallelto", 0x2225 },
- { "notbardbl", 0x2226 },
- { "integraldbl", 0x222c },
- { "integraltrpl", 0x222d },
- { "contintegral", 0x222e },
- { "surfintegral", 0x222f },
- { "volintegral", 0x2230 },
- { "clwintegral", 0x2231 },
- { "clwcontintegral", 0x2232 },
- { "cclwcontintegral", 0x2233 },
- { "dotminus", 0x2238 },
- { "excess", 0x2239 },
- { "geomproportion", 0x223a },
- { "homothetic", 0x223b },
- { "revsimilar", 0x223d },
- { "lazysinv", 0x223e },
- { "sine", 0x223f },
- { "wreathproduct", 0x2240 },
- { "notsimilar", 0x2241 },
- { "minustilde", 0x2242 },
- { "asymptequal", 0x2243 },
- { "notasymptequal", 0x2244 },
- { "approxorequal", 0x2245 },
- { "approxnotequal", 0x2246 },
- { "notapproxequal", 0x2247 },
- { "almostequal", 0x2248 },
- { "notalmostequal", 0x2249 },
- { "almostorequal", 0x224a },
- { "tildetrpl", 0x224b },
- { "equivasymptotic", 0x224d },
- { "geomequivalent", 0x224e },
- { "difference", 0x224f },
- { "approachlimit", 0x2250 },
- { "geomequal", 0x2251 },
- { "imageorapproxequal", 0x2253 },
- { "colonequal", 0x2254 },
- { "equalcolon", 0x2255 },
- { "ringinequal", 0x2256 },
- { "ringequal", 0x2257 },
- { "corresponds", 0x2258 },
- { "estimates", 0x2259 },
- { "equiangular", 0x225a },
- { "starequal", 0x225b },
- { "deltaequal", 0x225c },
- { "definequal", 0x225d },
- { "measurequal", 0x225e },
- { "questionequal", 0x225f },
- { "notequivalence", 0x2262 },
- { "strictequivalence", 0x2263 },
- { "lessdblequal", 0x2266 },
- { "greaterdblequal", 0x2267 },
- { "lessnotdblequal", 0x2268 },
- { "greaternotdblequal", 0x2269 },
- { "lessmuch", 0x226a },
- { "greatermuch", 0x226b },
- { "between", 0x226c },
- { "notequivasymptotic", 0x226d },
- { "notlessequal", 0x2270 },
- { "notgreaterequal", 0x2271 },
- { "lessequivlnt", 0x2272 },
- { "greaterequivlnt", 0x2273 },
- { "notlessequivlnt", 0x2274 },
- { "notgreaterequivlnt", 0x2275 },
- { "notlessgreater", 0x2278 },
- { "notgreaterless", 0x2279 },
- { "follows", 0x227b },
- { "precedesequal", 0x227c },
- { "followsequal", 0x227d },
- { "precedequivlnt", 0x227e },
- { "followsequivlnt", 0x227f },
- { "notpreceeds", 0x2280 },
- { "notfollows", 0x2281 },
- { "notpropersubset", 0x2284 },
- { "notpropersuperset", 0x2285 },
- { "notreflexsubset", 0x2288 },
- { "notreflexsuperset", 0x2289 },
- { "multiset", 0x228c },
- { "multiplymultiset", 0x228d },
- { "unionmulti", 0x228e },
- { "squareimage", 0x228f },
- { "squareoriginal", 0x2290 },
- { "subsetsqequal", 0x2291 },
- { "supersetsqequal", 0x2292 },
- { "intersectionsq", 0x2293 },
- { "unionsq", 0x2294 },
- { "circleminus", 0x2296 },
- { "circledivide", 0x2298 },
- { "circledot", 0x2299 },
- { "circlering", 0x229a },
- { "circleasterisk", 0x229b },
- { "circleequal", 0x229c },
- { "circlevertbar", 0x229d },
- { "squareplus", 0x229e },
- { "squareminus", 0x229f },
- { "squaremultiply", 0x22a0 },
- { "squaredot", 0x22a1 },
- { "turnstileleft", 0x22a2 },
- { "turnstileright", 0x22a3 },
- { "latticetop", 0x22a4 },
- { "assertion", 0x22a6 },
- { "truestate", 0x22a7 },
- { "satisfy", 0x22a8 },
- { "force", 0x22a9 },
- { "tacktrpl", 0x22aa },
- { "forceextr", 0x22ab },
- { "notturnstileleft", 0x22ac },
- { "notsatisfy", 0x22ad },
- { "notforce", 0x22ae },
- { "notforceextr", 0x22af },
- { "lowerrank", 0x22b0 },
- { "higherrank", 0x22b1 },
- { "triangleright", 0x22b2 },
- { "triangleleft", 0x22b3 },
- { "triangleftequal", 0x22b4 },
- { "triangrightequal", 0x22b5 },
- { "original", 0x22b6 },
- { "image", 0x22b7 },
- { "multimap", 0x22b8 },
- { "hermitconjmatrix", 0x22b9 },
- { "intercal", 0x22ba },
- { "xor", 0x22bb },
- { "nand", 0x22bc },
- { "nor", 0x22bd },
- { "rightanglearc", 0x22be },
- { "narylogicaland", 0x22c0 },
- { "narylogicalor", 0x22c1 },
- { "naryintersection", 0x22c2 },
- { "naryunion", 0x22c3 },
- { "diamondmath", 0x22c4 },
- { "divideonmultiply", 0x22c7 },
- { "bowtie", 0x22c8 },
- { "multicloseleft", 0x22c9 },
- { "multicloseright", 0x22ca },
- { "multiopenleft", 0x22cb },
- { "multiopenright", 0x22cc },
- { "revasymptequal", 0x22cd },
- { "curlor", 0x22ce },
- { "curland", 0x22cf },
- { "subsetdbl", 0x22d0 },
- { "supersetdbl", 0x22d1 },
- { "uniondbl", 0x22d2 },
- { "intersectiondbl", 0x22d3 },
- { "fork", 0x22d4 },
- { "equalparallel", 0x22d5 },
- { "lessdot", 0x22d6 },
- { "greaterdot", 0x22d7 },
- { "verymuchless", 0x22d8 },
- { "verymuchgreater", 0x22d9 },
- { "lessequalgreater", 0x22da },
- { "greaterequalless", 0x22db },
- { "equalless", 0x22dc },
- { "equalgreater", 0x22dd },
- { "equalprecedes", 0x22de },
- { "equalfollows", 0x22df },
- { "preceedsnotequal", 0x22e0 },
- { "followsnotequal", 0x22e1 },
- { "notsubsetsqequal", 0x22e2 },
- { "notsupersetsqequal", 0x22e3 },
- { "sqimageornotequal", 0x22e4 },
- { "sqoriginornotequal", 0x22e5 },
- { "lessnotequivlnt", 0x22e6 },
- { "greaternotequivlnt", 0x22e7 },
- { "preceedsnotsimilar", 0x22e8 },
- { "followsnotequivlnt", 0x22e9 },
- { "nottriangleleft", 0x22ea },
- { "nottriangleright", 0x22eb },
- { "nottriangleleftequal", 0x22ec },
- { "nottrianglerightequal", 0x22ed },
- { "vertellipsis", 0x22ee },
- { "midhorizellipsis", 0x22ef },
- { "upslopeellipsis", 0x22f0 },
- { "downslopeellipsis", 0x22f1 },
- { "perspcorrespond", 0x2306 },
- { "ceilingleft", 0x2308 },
- { "ceilingright", 0x2309 },
- { "floorleft", 0x230a },
- { "floorright", 0x230b },
- { "slurabove", 0x2322 },
- { "slurbelow", 0x2323 },
- { "null", 0x2400 },
- { "startofhead", 0x2401 },
- { "starttext", 0x2402 },
- { "endtext", 0x2403 },
- { "endtrans", 0x2404 },
- { "enquiry", 0x2405 },
- { "acknowledge", 0x2406 },
- { "bell", 0x2407 },
- { "backspace", 0x2408 },
- { "horiztab", 0x2409 },
- { "linefeed", 0x240a },
- { "verttab", 0x240b },
- { "formfeed", 0x240c },
- { "shiftout", 0x240e },
- { "shiftin", 0x240f },
- { "datalinkescape", 0x2410 },
- { "devcon1", 0x2411 },
- { "devcon2", 0x2412 },
- { "devcon3", 0x2413 },
- { "devcon4", 0x2414 },
- { "negacknowledge", 0x2415 },
- { "synch", 0x2416 },
- { "endtransblock", 0x2417 },
- { "cancel", 0x2418 },
- { "endmedium", 0x2419 },
- { "substitute", 0x241a },
- { "escape", 0x241b },
- { "fileseparator", 0x241c },
- { "groupseparator", 0x241d },
- { "recordseparator", 0x241e },
- { "unitseparator", 0x241f },
- { "spaceliteral", 0x2420 },
- { "delete", 0x2421 },
- { "blankb", 0x2422 },
- { "spaceopenbox", 0x2423 },
- { "newline", 0x2424 },
- { "lthorizform", 0x2500 },
- { "hvhorizform", 0x2501 },
- { "ltvertform", 0x2502 },
- { "hvvertform", 0x2503 },
- { "ltdashtriphorizform", 0x2504 },
- { "hvdashtriphorizform", 0x2505 },
- { "ltdashtripvertform", 0x2506 },
- { "hvdashtripvertform", 0x2507 },
- { "ltdashquadhorizform", 0x2508 },
- { "hvdashquadhorizform", 0x2509 },
- { "ltdashquadvertform", 0x250a },
- { "hvdashquadvertform", 0x250b },
- { "ltdnrtform", 0x250c },
- { "dnltrthvform", 0x250d },
- { "dnhvrtltform", 0x250e },
- { "hvdnrtform", 0x250f },
- { "ltdnleftform", 0x2510 },
- { "dnltlefthvform", 0x2511 },
- { "dnhvleftltform", 0x2512 },
- { "hvdnleftform", 0x2513 },
- { "ltuprtform", 0x2514 },
- { "upltrthvform", 0x2515 },
- { "uphvrtltform", 0x2516 },
- { "hvuprtform", 0x2517 },
- { "ltupleftform", 0x2518 },
- { "upltlefthvform", 0x2519 },
- { "uphvleftltform", 0x251a },
- { "hvupleftform", 0x251b },
- { "ltvertrightform", 0x251c },
- { "vertltrthvform", 0x251d },
- { "uphvrtdnltform", 0x251e },
- { "dnhvrtupltform", 0x251f },
- { "verthvrtltform", 0x2520 },
- { "dnltrtuphvform", 0x2521 },
- { "upltrtdnhvform", 0x2522 },
- { "hvvertrtform", 0x2523 },
- { "ltvertleftform", 0x2524 },
- { "vtltlefthvform", 0x2525 },
- { "uphvleftdnltform", 0x2526 },
- { "dnhvleftupltform", 0x2527 },
- { "verthvleftltform", 0x2528 },
- { "dnltleftuphvform", 0x2529 },
- { "upltleftdnhvform", 0x252a },
- { "hvvertleftform", 0x252b },
- { "ltdnhorizform", 0x252c },
- { "lefthvrtdnltform", 0x252d },
- { "rthvleftdnltform", 0x252e },
- { "dnlthorizhvform", 0x252f },
- { "dnhvhorizltform", 0x2530 },
- { "rtltrtdnhvform", 0x2531 },
- { "leftltrtdnhvform", 0x2532 },
- { "hvdnhorizform", 0x2533 },
- { "ltuphorizform", 0x2534 },
- { "lefthvrtupltform", 0x2535 },
- { "rthvleftupltform", 0x2536 },
- { "uplthorizhvform", 0x2537 },
- { "uphvhorizltform", 0x2538 },
- { "rtltleftuphvform", 0x2539 },
- { "leftltrtuphvform", 0x253a },
- { "hvuphorizform", 0x253b },
- { "ltverthorizform", 0x253c },
- { "lefthvrtvertltform", 0x253d },
- { "rthvleftvertltform", 0x253e },
- { "vertlthorizhvform", 0x253f },
- { "uphvdnhorizltform", 0x2540 },
- { "dnhvuphorizltform", 0x2541 },
- { "verthvhorizltform", 0x2542 },
- { "leftuphvrtdnltform", 0x2543 },
- { "rtuphvleftdnltform", 0x2544 },
- { "leftdnhvrtupltform", 0x2545 },
- { "rtdnhvleftupltform", 0x2546 },
- { "dnltuphorizhvform", 0x2547 },
- { "upltdnhorizhvform", 0x2548 },
- { "rtltleftverthvform", 0x2549 },
- { "leftltrtverthvform", 0x254a },
- { "hvverthorizform", 0x254b },
- { "ltdashdblhorizform", 0x254c },
- { "hvdashdblhorizform", 0x254d },
- { "ltdashdblvertform", 0x254e },
- { "hvdashdblvertform", 0x254f },
- { "horizdblbar", 0x2550 },
- { "vertdblbar", 0x2551 },
- { "dnrtdblform", 0x2552 },
- { "dndblrtform", 0x2553 },
- { "dbldnrtform", 0x2554 },
- { "dnleftdblform", 0x2555 },
- { "dndblleftform", 0x2556 },
- { "dbldnleftform", 0x2557 },
- { "uprtdblform", 0x2558 },
- { "updblrtform", 0x2559 },
- { "dbluprtform", 0x255a },
- { "upleftdblform", 0x255b },
- { "updblleftform", 0x255c },
- { "dblupleftform", 0x255d },
- { "vertrtdblform", 0x255e },
- { "vertdblrtform", 0x255f },
- { "dblvertrtform", 0x2560 },
- { "vertleftdblform", 0x2561 },
- { "vertdblleftform", 0x2562 },
- { "dblvertleftform", 0x2563 },
- { "dnhorizdblform", 0x2564 },
- { "dndblhorizform", 0x2565 },
- { "dbldnhorizform", 0x2566 },
- { "uphorizdblform", 0x2567 },
- { "updblhorizform", 0x2568 },
- { "dbluphorizform", 0x2569 },
- { "verthorizdblform", 0x256a },
- { "vertdblhorizform", 0x256b },
- { "dblverthorizform", 0x256c },
- { "ltarcdnrtform", 0x256d },
- { "ltarcdnleftform", 0x256e },
- { "ltarcupleftform", 0x256f },
- { "ltarcuprtform", 0x2570 },
- { "forwarddiagonal", 0x2571 },
- { "backwarddiagonal", 0x2572 },
- { "ltdiagonalcross", 0x2573 },
- { "dneighthblock", 0x2581 },
- { "dnquarterblock", 0x2582 },
- { "dnthreeeighthblock", 0x2583 },
- { "dnfiveeighthblock", 0x2585 },
- { "dnthreequarterblock", 0x2586 },
- { "dnseveneighthblock", 0x2587 },
- { "lfseveneighthblock", 0x2589 },
- { "lfthreequarterblock", 0x258a },
- { "lffiveeighthblock", 0x258b },
- { "lfthreeeighthblock", 0x258d },
- { "lfquarterblock", 0x258e },
- { "lfeighthblock", 0x258f },
- { "upeighthblock", 0x2594 },
- { "rteighthblock", 0x2595 },
- { "box", 0x25a1 },
- { "boxrounded", 0x25a2 },
- { "boxnested", 0x25a3 },
- { "boxhorizhatch", 0x25a4 },
- { "boxverthatch", 0x25a5 },
- { "boxcrosshatch", 0x25a6 },
- { "boxleftdiaghatch", 0x25a7 },
- { "boxrtdiaghatch", 0x25a8 },
- { "boxcrossdiaghatch", 0x25a9 },
- { "smallboxfilled", 0x25aa },
- { "smallbox", 0x25ab },
- { "rectangle", 0x25ad },
- { "filledvertrect", 0x25ae },
- { "vertrectangle", 0x25af },
- { "filledparallelogram", 0x25b0 },
- { "parallelogram", 0x25b1 },
- { "triangle", 0x25b3 },
- { "smalltrianglesld", 0x25b4 },
- { "smalltriangle", 0x25b5 },
- { "trianglerightsld1", 0x25b6 },
- { "triangleright1", 0x25b7 },
- { "smalltrianglerightsld", 0x25b8 },
- { "smalltriangleright", 0x25b9 },
- { "triagrtopen", 0x25bb },
- { "triangleinv", 0x25bd },
- { "smalltriangleinvsld", 0x25be },
- { "smalltriangleinv", 0x25bf },
- { "triangleleftsld1", 0x25c0 },
- { "triangleleft1", 0x25c1 },
- { "smalltriangleleftsld", 0x25c2 },
- { "smalltriangleleft", 0x25c3 },
- { "triaglfopen", 0x25c5 },
- { "diamondrhombsolid", 0x25c6 },
- { "diamondrhomb", 0x25c7 },
- { "diamondrhombnested", 0x25c8 },
- { "circledash", 0x25cc },
- { "circleverthatch", 0x25cd },
- { "circlesolid", 0x25cf },
- { "circleleftsld", 0x25d0 },
- { "circlerightsld", 0x25d1 },
- { "circlebottomsld", 0x25d2 },
- { "circletopsld", 0x25d3 },
- { "circlenesld", 0x25d4 },
- { "circlenwopen", 0x25d5 },
- { "semicircleleftsld", 0x25d6 },
- { "semicirclelertsld", 0x25d7 },
- { "invsemicircleup", 0x25da },
- { "invsemicircledn", 0x25db },
- { "nwquadarc", 0x25dc },
- { "nequadarc", 0x25dd },
- { "sequadarc", 0x25de },
- { "swquadarc", 0x25df },
- { "toparc", 0x25e0 },
- { "bottomarc", 0x25e1 },
- { "trianglesesld", 0x25e2 },
- { "triangleswsld", 0x25e3 },
- { "tranglenwsld", 0x25e4 },
- { "trianglenesld", 0x25e5 },
- { "squareleftsld", 0x25e7 },
- { "squarerightsld", 0x25e8 },
- { "squarenwsld", 0x25e9 },
- { "squaresesld", 0x25ea },
- { "squarevertbisect", 0x25eb },
- { "triangledot", 0x25ec },
- { "triangleleftsld", 0x25ed },
- { "trianglerightsld", 0x25ee },
- { "heartopen", 0x2661 },
- { "diamondopen", 0x2662 },
- { "spadeopen", 0x2664 },
- { "Omegaiotasubleniscircumflex", 0x1fae },
- { "Omegaleniscircumflex", 0x1f6e },
- { "Upsilonaspercircumflex", 0x1f5f },
- { "dieresiscircumflex", 0x1fc1 },
- { "leniscircumflex", 0x1fcf },
- { "aspercircumflex", 0x1fdf },
- { "alphaleniscircumflex", 0x1f06 },
- { "alphaaspercircumflex", 0x1f07 },
- { "etaleniscircumflex", 0x1f26 },
- { "etaaspercircumflex", 0x1f27 },
- { "iotaleniscircumflex", 0x1f36 },
- { "iotaaspercircumflex", 0x1f37 },
- { "upsilonleniscircumflex", 0x1f56 },
- { "upsilonaspercircumflex", 0x1f57 },
- { "omegaleniscircumflex", 0x1f66 },
- { "omegaaspercircumflex", 0x1f67 },
- { "alphaiotasubleniscircumflex", 0x1f86 },
- { "alphaiotasubaspercircumflex", 0x1f87 },
- { "etaiotasubleniscircumflex", 0x1f96 },
- { "etaiotasubaspercircumflex", 0x1f97 },
- { "omegaiotasubleniscircumflex", 0x1fa6 },
- { "omegaiotasubaspercircumflex", 0x1fa7 },
- { "alphacircumflex", 0x1fb6 },
- { "alphaiotasubcircumflex", 0x1fb7 },
- { "etacircumflex", 0x1fc6 },
- { "etaiotasubcircumflex", 0x1fc7 },
- { "iotacircumflex", 0x1fd6 },
- { "iotadieresiscircumflex", 0x1fd7 },
- { "upsiloncircumflex", 0x1fe6 },
- { "omegacircumflex", 0x1ff6 },
- { "omegaiotasubcircumflex", 0x1ff7 },
- { "upsilondieresiscircumflex", 0x1fe7 },
- { "dialytika", 0x0308 },
- { "koronis", 0x1fbd },
- { "prosgegrammeni", 0x1fbe },
- { "psili", 0x1fbf },
- { "perispomeni", 0x1fc0 },
- { "varia", 0x1fef },
- { "oxia", 0x1ffd },
- { "dasia", 0x1ffe },
- { "Alphasmall", 0xf500 },
- { "Betasmall", 0xf501 },
- { "Gammasmall", 0xf502 },
- { "Deltasmall", 0xf503 },
- { "Epsilonsmall", 0xf504 },
- { "Zetasmall", 0xf505 },
- { "Etasmall", 0xf506 },
- { "Thetasmall", 0xf507 },
- { "Iotasmall", 0xf508 },
- { "Kappasmall", 0xf509 },
- { "Lambdasmall", 0xf50a },
- { "Musmall", 0xf50b },
- { "Nusmall", 0xf50c },
- { "Xismall", 0xf50d },
- { "Omicronsmall", 0xf50e },
- { "Pismall", 0xf50f },
- { "Rhosmall", 0xf510 },
- { "Sigmasmall", 0xf512 },
- { "Tausmall", 0xf513 },
- { "Upsilonsmall", 0xf514 },
- { "Phismall", 0xf515 },
- { "Chismall", 0xf516 },
- { "Psismall", 0xf517 },
- { "Omegasmall", 0xf518 },
- { "Iotadieresissmall", 0xf519 },
- { "Upsilondieresissmall", 0xf51a },
- { "uni2A0B.lgdisplay", 0xea57 },
- { "uni2A0B.uplgdisplay", 0xea57 },
- { "uni2A15.lgdisplay", 0xe376 },
- { "uni2A15.uplgdisplay", 0xe376 },
- { "uni2A16.lgdisplay", 0xe377 },
- { "uni2A16.uplgdisplay", 0xe377 },
- { "uni2A10.lgdisplay", 0xe395 },
- { "uni2A10.uplgdisplay", 0xe395 },
- { "uni2A12.lgdisplay", 0xe397 },
- { "uni2A12.uplgdisplay", 0xe397 },
- { "uni2A13.lgdisplay", 0xe398 },
- { "uni2A13.uplgdisplay", 0xe398 },
- { "uni2A14.lgdisplay", 0xe399 },
- { "uni2A14.uplgdisplay", 0xe399 },
- { "uni2A17.lgdisplay", 0xe39a },
- { "uni2A17.uplgdisplay", 0xe39a },
- { "uni2A11.uplgdisplay", 0xe39b },
- { "uni2A11.lgdisplay", 0xe39b },
- { "uni2A0F.lgdisplay", 0xe3d3 },
- { "uni2A0F.uplgdisplay", 0xe3d3 },
-/* From Richard Kinch's TeX list of glyph aliases */
- { "fscript", 0x192 },
- { "fraction1", 0x2215 },
- { "negationslash", 0x2215 },
- { "circleR", 0xae },
- { "circlecopyrt", 0xa9 },
- { "smile", 0x263a },
- { "Ifractur", 0x2111 },
- { "Rfractur", 0x211C },
- { "Omegainv", 0x2127 },
- { "mho", 0x2127 },
- { "alephmath", 0x2135 },
- { "beth", 0x2136 },
- { "bethmath", 0x2136 },
- { "gimelmath", 0x2137 },
- { "daleth", 0x2138 },
- { "daletmath", 0x2138 },
- { "arrowbothv", 0x2195 },
- { "prime1", 0x2032 },
- { "primerev1", 0x2035 },
- { "primereverse", 0x2035 },
- { "followsequal1", 0x227d },
- { "similarequal", 0x2243 },
- { "square", 0x25a1 },
- { "squaresolid", 0x25a0 },
- { "squaresmallsolid", 0x25aa },
- { "diamondsolid", 0x25c6 },
- { "clockwise", 0x21bb },
- { "anticlockwise", 0x21ba },
- { "forces", 0x22a9 },
- { "forcesbar", 0x22aa },
- { "satisfies", 0x22a8 },
- { "dblarrowdwn", 0x21ca },
- { "shiftleft", 0x2196 },
- { "shiftright", 0x2197 },
- { "squiggleright", 0x21dd },
- { "squiggleleft", 0x21dc },
- { "squiggleleftright", 0x21ad },
- { "curlyleft", 0x21ab },
- { "curlyright", 0x21ac },
- { "followsorequal", 0x227d },
- { "equalsdots", 0x2251 },
- { "defines", 0x225c },
- { "ng", 0x014b },
- { "Ng", 0x014a },
- { "visiblespace", 0x2420 },
- { "dslash", 0x0111 },
- { "tie1", 0x2040 },
- { "arrowdblbothv", 0x21d5 },
- { "precedesequal1", 0x227c },
- { "greaterorsimilar", 0x2273 },
- { "precedesorequal", 0x227e },
- { "lessorsimilar", 0x2272 },
- { "equalorgreater", 0x22dd },
- { "lessorequalslant", 0x2264 },
- { "equaldotrightleft", 0x2253 },
- { "equaldotleftright", 0x2252 },
- { "followsorcurly", 0x227d },
- { "greaterorequalslant", 0x2265 },
- { "trianglerightequal", 0x22b5 },
- { "triangleleftequal", 0x22b4 },
- { "triangledownsld", 0x25bc },
- { "arrowaxisright", 0x2192 },
- { "arrowaxisleft", 0x2190 },
- { "trianglesolid", 0x25b2 },
- { "greaterlessequal", 0x22db },
- { "orunderscore", 0x22bb },
- { "frown", 0x2322 },
- { "uprise", 0x22cf },
- { "downfall", 0x22ce },
- { "subsetdblequal", 0x2286 },
- { "supersetdblequal", 0x2287 },
- { "Finv", 0x2132 },
- { "notarrowboth", 0x21ae },
- { "archleftdown", 0x21b6 },
- { "archrightdown", 0x21b7 },
- { "notdblarrowleft", 0x21cd },
- { "notdblarrowboth", 0x21ce },
- { "notdblarrowright", 0x21cf },
- { "epsiloninv", 0x220a },
- { "equalorsimilar", 0x2242 },
- { "notprecedes", 0x2280 },
- { "notsubseteql", 0x2288 },
- { "notsuperseteql", 0x2289 },
- { "subsetnoteql", 0x228a },
- { "supersetnoteql", 0x228b },
- { "notturnstile", 0x22ac },
- { "notforcesextra", 0x22af },
- { "dividemultiply", 0x22c7 },
- { "notprecedesoreql", 0x22e0 },
- { "notfollowsoreql", 0x22e1 },
- { "lessornotsimilar", 0x22e6 },
- { "greaterornotsimilar", 0x22e7 },
- { "precedeornoteqvlnt", 0x22e8 },
- { "followornoteqvlnt", 0x22e9 },
- { "nottriangeqlleft", 0x22ec },
- { "nottriangeqlright", 0x22ed },
- { "angbracketleft", 0x3008 },
- { "angbracketright", 0x3009 },
- { "check", 0x2713 },
- { "circleS", 0x24c8 },
- { "rightanglenw", 0x250c },
- { "rightanglene", 0x2510 },
- { "rightanglesw", 0x2514 },
- { "rightanglese", 0x2518 },
- { "Yen", 0x00a5 },
- { "permill", 0x2030 },
- { "recipe", 0x211e },
- { "pertenmill", 0x2031 },
- { "lnot", 0x00ac },
- { "circleP", 0x2117 },
- { "surd", 0x221a },
- { "asciigrave", 0x60 },
- { "asciigrave", 0x60 },
- { "asciiacute", 0xb4 },
- { "asciidieresis", 0xa8 },
- { "pilcrow", 0xb6 },
-/* Useful names to use to find glyphs */
- { "circumflexcomb", 0x302 },
- { "macroncomb", 0x304 },
- { "brevecomb", 0x306 },
- { "diaeresiscomb", 0x308 },
- { "caroncomb", 0x30c },
- { "vrachycomb", 0x306 },
- { "psilicomb", 0x313 },
- { "dasiacomb", 0x314 },
- { "psilivaria", 0x1fcd },
- { "psilioxia", 0x1fce },
- { "psiliperispomeni", 0x1fcf },
- { "dasiavaria", 0x1fdd },
- { "dasiaoxia", 0x1fde },
- { "dasiaperispomeni", 0x1fdf },
- { "dialytikavaria", 0x1fed },
- { "dialytikaoxia", 0x1fee },
- { "dialytikaperispomeni", 0x1fc1 },
-/* Adobe spells diaeresis the American way, as dieresis */
- { "diaeresis", 0xa8 },
- { "Adiaeresis", 0xC4 },
- { "Ediaeresis", 0xCB },
- { "Idiaeresis", 0xCF },
- { "Odiaeresis", 0xD6 },
- { "Udiaeresis", 0xDC },
- { "adiaeresis", 0xE4 },
- { "ediaeresis", 0xEB },
- { "idiaeresis", 0xEF },
- { "odiaeresis", 0xF6 },
- { "udiaeresis", 0xFC },
- { "Ydiaeresis", 0x178 },
- { "diaeresistonos", 0x385 },
- { "iotadiaeresistonos", 0x390 },
- { "Iotadiaeresis", 0x3AA },
- { "Upsilondiaeresis", 0x3AB },
- { "upsilondiaeresistonos", 0x3B0 },
- { "iotadiaeresis", 0x3CA },
- { "upsilondiaeresis", 0x3CB },
- { "Wdiaeresis", 0x1e84 },
- { "wdiaeresis", 0x1e85 },
- { "ETH", 0xd0 },
- { "THORN", 0xde },
- { "ssharp", 0xdf },
- { "Ooblique", 0xd8 },
- { "notsign", 0xac },
-/* Sun has used "masculine" for ordmasculine */
- {NULL}
-};
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ofl.h b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ofl.h
deleted file mode 100644
index bafa27e9e87..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ofl.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "splinefont.h"
-
-extern struct str_lang_data {
- enum ttfnames strid;
- int lang;
- char **data;
-} ofl_str_lang_data[];
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pfaeditui.h b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pfaeditui.h
deleted file mode 100644
index b4fd05a7a27..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pfaeditui.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef _PFAEDITUI_H_
-#define _PFAEDITUI_H_
-
-#include "pfaedit.h"
-
-extern void help(char *filename);
-extern int FontForgeMain( int argc, char **argv );
-
-#if defined(FONTFORGE_CONFIG_GTK)
-# include <gtk/gtk.h>
-# include "interface.h"
-# include "callbacks.h"
-# include "support.h"
-# include "views.h"
-extern GdkCursor *ct_magplus, *ct_magminus, *ct_mypointer,
- *ct_circle, *ct_square, *ct_triangle, *ct_pen,
- *ct_ruler, *ct_knife, *ct_rotate, *ct_skew, *ct_scale, *ct_flip,
- *ct_3drotate, *ct_perspective,
- *ct_updown, *ct_leftright, *ct_nesw, *ct_nwse,
- *ct_rect, *ct_elipse, *ct_poly, *ct_star, *ct_filledrect, *ct_filledelipse,
- *ct_pencil, *ct_shift, *ct_line, *ct_myhand, *ct_setwidth,
- *ct_kerning, *ct_rbearing, *ct_lbearing, *ct_eyedropper,
- *ct_prohibition, *ct_ddcursor;
-
-/*
-extern GImage GIcon_midtangent, GIcon_midcurve, GIcon_midcorner;
-extern GImage GIcon_tangent, GIcon_curve, GIcon_corner, GIcon_ruler,
- GIcon_pointer, GIcon_magnify, GIcon_pen, GIcon_knife, GIcon_scale,
- GIcon_flip, GIcon_rotate, GIcon_skew,
- GIcon_squarecap, GIcon_roundcap, GIcon_buttcap,
- GIcon_miterjoin, GIcon_roundjoin, GIcon_beveljoin,
- GIcon_rect, GIcon_elipse, GIcon_rrect, GIcon_poly, GIcon_star,
- GIcon_pencil, GIcon_shift, GIcon_line, GIcon_hand,
- GIcon_press2ptr, GIcon_freehand, GIcon_greyfree;
-extern GImage GIcon_smallskew, GIcon_smallscale, GIcon_smallrotate,
- GIcon_smallflip, GIcon_smalltangent, GIcon_smallcorner,
- GIcon_smallcurve, GIcon_smallmag, GIcon_smallknife, GIcon_smallpen,
- GIcon_smallpointer, GIcon_smallruler, GIcon_smallelipse,
- GIcon_smallrect, GIcon_smallpoly, GIcon_smallstar,
- GIcon_smallpencil, GIcon_smallhand,
- GIcon_FontForgeLogo, GIcon_FontForgeBack, GIcon_FontForgeGuide;
-extern GImage GIcon_sel2ptr, GIcon_rightpointer, GIcon_angle, GIcon_distance,
- GIcon_selectedpoint, GIcon_mag;
-extern GImage GIcon_menumark;
-extern GImage GIcon_rmoverlap, GIcon_exclude, GIcon_intersection, GIcon_findinter;
-extern GImage GIcon_outline, GIcon_inline, GIcon_shadow, GIcon_wireframe;
-extern GImage def_image, red_image, blue_image, green_image, magenta_image,
- yellow_image, cyan_image, white_image;
-extern GImage GIcon_continue, GIcon_stepout, GIcon_stepover, GIcon_stepinto,
- GIcon_watchpnt, GIcon_menudelta, GIcon_exit;
-extern GImage GIcon_Stopped, GIcon_Stop;
-extern GWindow logo_icon;
-
-extern GTextInfo encodingtypes[];
-extern GTextInfo *EncodingTypesFindEnc(GTextInfo *encodingtypes, Encoding *enc);
-extern Encoding *ParseEncodingNameFromList(GGadget *listfield);
-extern GTextInfo *GetEncodingTypes(void);
-*/
-
-extern void InitCursors(void);
-
-/*
-extern real GetReal(GWindow gw,int cid,char *name,int *err);
-extern int GetInt(GWindow gw,int cid,char *name,int *err);
-extern void Protest(char *label);
-extern real GetCalmReal8(GWindow gw,int cid,char *namer,int *err);
-extern real GetReal8(GWindow gw,int cid,char *namer,int *err);
-extern int GetInt8(GWindow gw,int cid,char *namer,int *err);
-extern void Protest8(char *labelr);
-*/
-
-/* I would like these to be const ints, but gcc doesn't treat them as consts */
-/*
-#define et_sb_halfup et_sb_thumbrelease+1
-#define et_sb_halfdown et_sb_thumbrelease+2
-*/
-
-#elif defined( FONTFORGE_CONFIG_GDRAW )
-
-# include "gdraw.h"
-# include "gwidget.h"
-# include "ggadget.h"
-# include "views.h"
-
-extern GCursor ct_magplus, ct_magminus, ct_mypointer,
- ct_circle, ct_square, ct_triangle, ct_pen,
- ct_ruler, ct_knife, ct_rotate, ct_skew, ct_scale, ct_flip,
- ct_3drotate, ct_perspective,
- ct_updown, ct_leftright, ct_nesw, ct_nwse,
- ct_rect, ct_elipse, ct_poly, ct_star, ct_filledrect, ct_filledelipse,
- ct_pencil, ct_shift, ct_line, ct_myhand, ct_setwidth,
- ct_kerning, ct_rbearing, ct_lbearing, ct_eyedropper,
- ct_prohibition, ct_ddcursor;
-extern GImage GIcon_midtangent, GIcon_midcurve, GIcon_midcorner;
-extern GImage GIcon_tangent, GIcon_curve, GIcon_corner, GIcon_ruler,
- GIcon_pointer, GIcon_magnify, GIcon_pen, GIcon_knife, GIcon_scale,
- GIcon_flip, GIcon_rotate, GIcon_skew,
- GIcon_3drotate, GIcon_perspective,
- GIcon_squarecap, GIcon_roundcap, GIcon_buttcap,
- GIcon_miterjoin, GIcon_roundjoin, GIcon_beveljoin,
- GIcon_rect, GIcon_elipse, GIcon_rrect, GIcon_poly, GIcon_star,
- GIcon_pencil, GIcon_shift, GIcon_line, GIcon_hand,
- GIcon_press2ptr, GIcon_freehand, GIcon_greyfree;
-extern GImage GIcon_smallskew, GIcon_smallscale, GIcon_smallrotate,
- GIcon_small3drotate, GIcon_smallperspective,
- GIcon_smallflip, GIcon_smalltangent, GIcon_smallcorner,
- GIcon_smallcurve, GIcon_smallmag, GIcon_smallknife, GIcon_smallpen,
- GIcon_smallpointer, GIcon_smallruler, GIcon_smallelipse,
- GIcon_smallrect, GIcon_smallpoly, GIcon_smallstar,
- GIcon_smallpencil, GIcon_smallhand,
- GIcon_FontForgeLogo, GIcon_FontForgeBack, GIcon_FontForgeGuide;
-extern GImage GIcon_lock;
-extern GImage GIcon_menumark;
-extern GImage GIcon_rmoverlap, GIcon_exclude, GIcon_intersection, GIcon_findinter;
-extern GImage GIcon_outline, GIcon_inline, GIcon_shadow, GIcon_wireframe;
-extern GImage def_image, red_image, blue_image, green_image, magenta_image,
- yellow_image, cyan_image, white_image;
-extern GImage GIcon_continue, GIcon_stepout, GIcon_stepover, GIcon_stepinto,
- GIcon_watchpnt, GIcon_menudelta, GIcon_exit;
-extern GImage GIcon_Stopped, GIcon_Stop;
-extern GWindow logo_icon;
-extern GImage GIcon_sel2ptr, GIcon_rightpointer, GIcon_angle, GIcon_distance,
- GIcon_selectedpoint, GIcon_mag;
-extern GImage GIcon_up, GIcon_down;
-extern GImage OFL_logo;
-
-extern GTextInfo encodingtypes[];
-extern GTextInfo *EncodingTypesFindEnc(GTextInfo *encodingtypes, Encoding *enc);
-extern Encoding *ParseEncodingNameFromList(GGadget *listfield);
-extern GTextInfo *GetEncodingTypes(void);
-
-extern void InitCursors(void);
-extern void InitToolIconClut(Color bg);
-
-extern real GetReal(GWindow gw,int cid,char *name,int *err);
-extern int GetInt(GWindow gw,int cid,char *name,int *err);
-extern void Protest(char *label);
-extern real GetCalmReal8(GWindow gw,int cid,char *namer,int *err);
-extern real GetReal8(GWindow gw,int cid,char *namer,int *err);
-extern int GetInt8(GWindow gw,int cid,char *namer,int *err);
-extern void Protest8(char *labelr);
-
-/* I would like these to be const ints, but gcc doesn't treat them as consts */
-#define et_sb_halfup et_sb_thumbrelease+1
-#define et_sb_halfdown et_sb_thumbrelease+2
-#else
-# include "views.h"
-#endif
-
-extern FontView *fv_list;
-
-extern struct openfilefilters { char *name, *filter; } def_font_filters[], *user_font_filters;
-extern int default_font_filter_index;
-
-#if !defined( FONTFORGE_CONFIG_CAPSLOCK_FOR_ALT ) || FONTFORGE_CONFIG_CAPSLOCK_FOR_ALT==0
-# define ksm_alt ksm_meta
-#elif FONTFORGE_CONFIG_CAPSLOCK_FOR_ALT-2 == 0 /* I use this peculiar construction just in case it is defined as the empty string */
-# define ksm_alt (ksm_meta|ksm_capslock)
-#else
-# define ksm_alt ksm_capslock
-#endif
-
-#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/prefs.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/prefs.c
deleted file mode 100644
index 3b4dad9d716..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/prefs.c
+++ /dev/null
@@ -1,2282 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include "groups.h"
-#include "plugins.h"
-#include <charset.h>
-#include <gfile.h>
-#include <gresource.h>
-#include <ustring.h>
-#include <gkeysym.h>
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <locale.h>
-#include <time.h>
-#include <sys/time.h>
-#include <stdlib.h>
-
-#include "ttf.h"
-
-#if HAVE_LANGINFO_H
-#ifndef LUA_FF_LIB
-# include <langinfo.h>
-#endif
-#endif
-
-#ifndef N_
-#define N_(a) a
-#endif
-
-int splash = 1;
-int adjustwidth = true;
-int adjustlbearing = true;
-Encoding *default_encoding = NULL;
-int autohint_before_rasterize = 1;
-int autohint_before_generate = 1;
-int use_freetype_to_rasterize_fv = 1;
-int OpenCharsInNewWindow = 1;
-int ItalicConstrained=true;
-int accent_offset = 6;
-int GraveAcuteCenterBottom = 1;
-int PreferSpacingAccents = true;
-int CharCenterHighest = 1;
-int ask_user_for_resolution = true;
-int stop_at_join = false;
-int cv_auto_goto = true;
-int recognizePUA = true;
-float arrowAmount=1;
-float snapdistance=3.5;
-float joinsnap=0;
-char *BDFFoundry=NULL;
-char *TTFFoundry=NULL;
-char *xuid=NULL;
-char *SaveTablesPref=NULL;
-char *RecentFiles[RECENT_MAX] = { NULL };
-/*struct cvshows CVShows = { 1, 1, 1, 1, 1, 0, 1 };*/ /* in charview */
-/* int default_fv_font_size = 24; */ /* in fontview */
-/* int default_fv_antialias = false */ /* in fontview */
-/* int default_fv_bbsized = false */ /* in fontview */
-int default_fv_row_count = 4;
-int default_fv_col_count = 16;
-extern int default_fv_showhmetrics; /* in fontview */
-extern int default_fv_showvmetrics; /* in fontview */
-extern int default_fv_glyphlabel; /* in fontview */
-int save_to_dir = 0; /* in fontview, use sfdir rather than sfd */
-extern int palettes_docked; /* in cvpalettes */
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-extern int cvvisible[2], bvvisible[3]; /* in cvpalettes.c */
-#endif
-extern int maxundoes; /* in cvundoes */
-extern int prefer_cjk_encodings; /* in parsettf */
-extern int onlycopydisplayed, copymetadata, copyttfinstr;
-extern struct cvshows CVShows;
-extern int oldformatstate; /* in savefontdlg.c */
-extern int oldbitmapstate; /* in savefontdlg.c */
-extern int old_ttf_flags; /* in savefontdlg.c */
-extern int old_ps_flags; /* in savefontdlg.c */
-extern int old_otf_flags; /* in savefontdlg.c */
-extern int oldsystem; /* in bitmapdlg.c */
-#ifndef LUA_FF_LIB
-extern int preferpotrace; /* in autotrace.c */
-extern int autotrace_ask; /* in autotrace.c */
-extern int mf_ask; /* in autotrace.c */
-extern int mf_clearbackgrounds; /* in autotrace.c */
-extern int mf_showerrors; /* in autotrace.c */
-extern char *mf_args; /* in autotrace.c */
-#endif
-static int glyph_2_name_map=0; /* was in tottf.c, now a flag in savefont options dlg */
-extern int coverageformatsallowed; /* in tottfgpos.c */
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-extern int debug_wins; /* in cvdebug.c */
-extern int gridfit_dpi, gridfit_depth; /* in cvgridfit.c */
-extern float gridfit_pointsize; /* in cvgridfit.c */
-#endif
-extern int hint_diagonal_ends; /* in stemdb.c */
-extern int hint_diagonal_intersections; /* in stemdb.c */
-extern int hint_bounding_boxes; /* in stemdb.c */
-unichar_t *script_menu_names[SCRIPT_MENU_MAX];
-char *script_filenames[SCRIPT_MENU_MAX];
-static char *xdefs_filename;
-int new_em_size = 1000;
-int new_fonts_are_order2 = false;
-int loaded_fonts_same_as_new = false;
-int use_second_indic_scripts = false;
-char *helpdir;
-char *othersubrsfile;
-extern MacFeat *default_mac_feature_map, /* from macenc.c */
- *user_mac_feature_map;
-int updateflex = false;
-int allow_utf8_glyphnames = false;
-int clear_tt_instructions_when_needed = true;
-int ask_user_for_cmap = false;
-
-extern int rectelipse, polystar, regular_star; /* from cvpalettes.c */
-extern int center_out[2]; /* from cvpalettes.c */
-extern float rr_radius; /* from cvpalettes.c */
-extern int ps_pointcnt; /* from cvpalettes.c */
-extern float star_percent; /* from cvpalettes.c */
-
-NameList *force_names_when_opening=NULL;
-NameList *force_names_when_saving=NULL;
-extern NameList *namelist_for_new_fonts;
-
-int default_font_filter_index=0;
-struct openfilefilters *user_font_filters = NULL;
-static int alwaysgenapple=false, alwaysgenopentype=false;
-
-static int pointless;
-
- /* These first three must match the values in macenc.c */
-#define CID_Features 101
-#define CID_FeatureDel 103
-#define CID_FeatureEdit 105
-
-#define CID_Mapping 102
-#define CID_MappingDel 104
-#define CID_MappingEdit 106
-
-#define CID_ScriptMNameBase 200
-#define CID_ScriptMFileBase (200+SCRIPT_MENU_MAX)
-#define CID_ScriptMBrowseBase (200+2*SCRIPT_MENU_MAX)
-
-#define CID_PrefsBase 1000
-#define CID_PrefsOffset 100
-#define CID_PrefsBrowseOffset (CID_PrefsOffset/2)
-
-/* ************************************************************************** */
-/* ***************************** mac data ***************************** */
-/* ************************************************************************** */
-
-struct macsettingname macfeat_otftag[] = {
- { 1, 0, CHR('r','l','i','g') }, /* Required ligatures */
- { 1, 2, CHR('l','i','g','a') }, /* Common ligatures */
- { 1, 4, CHR('d','l','i','g') }, /* rare ligatures => discretionary */
-#if 0
- { 1, 4, CHR('h','l','i','g') }, /* rare ligatures => historic */
- { 1, 4, CHR('a','l','i','g') }, /* rare ligatures => ?ancient? */
-#endif
- /* 2, 1, partially connected cursive */
- { 2, 2, CHR('i','s','o','l') }, /* Arabic forms */
- { 2, 2, CHR('c','a','l','t') }, /* ??? */
- /* 3, 1, all caps */
- /* 3, 2, all lower */
- { 3, 3, CHR('s','m','c','p') }, /* small caps */
- /* 3, 4, initial caps */
- /* 3, 5, initial caps, small caps */
- { 4, 0, CHR('v','r','t','2') }, /* vertical forms => vertical rotation */
-#if 0
- { 4, 0, CHR('v','k','n','a') }, /* vertical forms => vertical kana */
-#endif
- { 6, 0, CHR('t','n','u','m') }, /* monospace numbers => Tabular numbers */
- { 10, 1, CHR('s','u','p','s') }, /* superior vertical position => superscript */
- { 10, 2, CHR('s','u','b','s') }, /* inferior vertical position => subscript */
-#if 0
- { 10, 3, CHR('s','u','p','s') }, /* ordinal vertical position => superscript */
-#endif
- { 11, 1, CHR('a','f','r','c') }, /* vertical fraction => fraction ligature */
- { 11, 2, CHR('f','r','a','c') }, /* diagonal fraction => fraction ligature */
- { 16, 1, CHR('o','r','n','m') }, /* vertical fraction => fraction ligature */
- { 20, 0, CHR('t','r','a','d') }, /* traditional characters => traditional forms */
-#if 0
- { 20, 0, CHR('t','n','a','m') }, /* traditional characters => traditional names */
-#endif
- { 20, 1, CHR('s','m','p','l') }, /* simplified characters */
- { 20, 2, CHR('j','p','7','8') }, /* jis 1978 */
- { 20, 3, CHR('j','p','8','3') }, /* jis 1983 */
- { 20, 4, CHR('j','p','9','0') }, /* jis 1990 */
- { 21, 0, CHR('o','n','u','m') }, /* lower case number => old style numbers */
- { 22, 0, CHR('p','w','i','d') }, /* proportional text => proportional widths */
- { 22, 2, CHR('h','w','i','d') }, /* half width text => half widths */
- { 22, 3, CHR('f','w','i','d') }, /* full width text => full widths */
- { 25, 0, CHR('f','w','i','d') }, /* full width kana => full widths */
- { 25, 1, CHR('p','w','i','d') }, /* proportional kana => proportional widths */
- { 26, 0, CHR('f','w','i','d') }, /* full width ideograph => full widths */
- { 26, 1, CHR('p','w','i','d') }, /* proportional ideograph => proportional widths */
- { 103, 0, CHR('h','w','i','d') }, /* half width cjk roman => half widths */
- { 103, 1, CHR('p','w','i','d') }, /* proportional cjk roman => proportional widths */
- { 103, 3, CHR('f','w','i','d') }, /* full width cjk roman => full widths */
- { 0, 0, 0 }
-}, *user_macfeat_otftag;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void UserSettingsFree(void) {
-
- free( user_macfeat_otftag );
- user_macfeat_otftag = NULL;
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-static int UserSettingsDiffer(void) {
- int i,j;
-
- if ( user_macfeat_otftag==NULL )
-return( false );
-
- for ( i=0; user_macfeat_otftag[i].otf_tag!=0; ++i );
- for ( j=0; macfeat_otftag[j].otf_tag!=0; ++j );
- if ( i!=j )
-return( true );
- for ( i=0; user_macfeat_otftag[i].otf_tag!=0; ++i ) {
- for ( j=0; macfeat_otftag[j].otf_tag!=0; ++j ) {
- if ( macfeat_otftag[j].mac_feature_type ==
- user_macfeat_otftag[i].mac_feature_type &&
- macfeat_otftag[j].mac_feature_setting ==
- user_macfeat_otftag[i].mac_feature_setting &&
- macfeat_otftag[j].otf_tag ==
- user_macfeat_otftag[i].otf_tag )
- break;
- }
- if ( macfeat_otftag[j].otf_tag==0 )
-return( true );
- }
-return( false );
-}
-
-/**************************************************************************** */
-
-
-/* don't use mnemonics 'C' or 'O' (Cancel & OK) */
-enum pref_types { pr_int, pr_real, pr_bool, pr_enum, pr_encoding, pr_string,
- pr_file, pr_namelist };
-struct enums { char *name; int value; };
-
-struct enums fvsize_enums[] = { {NULL} };
-
-static struct prefs_list {
- char *name;
- /* In the prefs file the untranslated name will always be used, but */
- /* in the UI that name may be translated. */
- enum pref_types type;
- void *val;
- void *(*get)(void);
- void (*set)(void *);
- char mn;
- struct enums *enums;
- unsigned int dontdisplay: 1;
- char *popup;
-} general_list[] = {
- { N_("ResourceFile"), pr_file, &xdefs_filename, NULL, NULL, 'R', NULL, 0, N_("When FontForge starts up, it loads display related resources from a\nproperty on the screen. Sometimes it is useful to be able to store\nthese resources in a file. These resources are only read at start\nup, so changing this has no effect until the next time you start\nFontForge.") },
- { N_("HelpDir"), pr_file, &helpdir, NULL, NULL, 'H', NULL, 0, N_("The directory on your local system in which FontForge will search for help\nfiles. If a file is not found there, then FontForge will look for it on the net.") },
- { N_("OtherSubrsFile"), pr_file, &othersubrsfile, NULL, NULL, 'O', NULL, 0, N_("If you wish to replace Adobe's OtherSubrs array (for Type1 fonts)\nwith an array of your own, set this to point to a file containing\na list of up to 14 PostScript subroutines. Each subroutine must\nbe preceded by a line starting with '%%%%' (any text before the\nfirst '%%%%' line will be treated as an initial copyright notice).\nThe first three subroutines are for flex hints, the next for hint\nsubstitution (this MUST be present), the 14th (or 13 as the\nnumbering actually starts with 0) is for counter hints.\nThe subroutines should not be enclosed in a [ ] pair.") },
- { N_("FreeTypeInFontView"), pr_bool, &use_freetype_to_rasterize_fv, NULL, NULL, 'O', NULL, 0, N_("Use the FreeType rasterizer (when available)\nto rasterize glyphs in the font view.\nThis generally results in better quality.") },
- { N_("AutoHint"), pr_bool, &autohint_before_rasterize, NULL, NULL, 'A', NULL, 0, N_("AutoHint before rasterizing") },
- { N_("SplashScreen"), pr_bool, &splash, NULL, NULL, 'S', NULL, 0, N_("Show splash screen on start-up") },
- { NULL }
-},
- new_list[] = {
- { N_("NewCharset"), pr_encoding, &default_encoding, NULL, NULL, 'N', NULL, 0, N_("Default encoding for\nnew fonts") },
- { N_("NewEmSize"), pr_int, &new_em_size, NULL, NULL, 'S', NULL, 0, N_("The default size of the Em-Square in a newly created font.") },
- { N_("NewFontsQuadratic"), pr_bool, &new_fonts_are_order2, NULL, NULL, 'Q', NULL, 0, N_("Whether new fonts should contain splines of quadratic (truetype)\nor cubic (postscript & opentype).") },
- { N_("LoadedFontsAsNew"), pr_bool, &loaded_fonts_same_as_new, NULL, NULL, 'L', NULL, 0, N_("Whether fonts loaded from the disk should retain their splines\nwith the original order (quadratic or cubic), or whether the\nsplines should be converted to the default order for new fonts\n(see NewFontsQuadratic).") },
- { NULL }
-},
- open_list[] = {
- { N_("PreferCJKEncodings"), pr_bool, &prefer_cjk_encodings, NULL, NULL, 'C', NULL, 0, N_("When loading a truetype or opentype font which has both a unicode\nand a CJK encoding table, use this flag to specify which\nshould be loaded for the font.") },
- { N_("AskUserForCMap"), pr_bool, &ask_user_for_cmap, NULL, NULL, 'O', NULL, 0, N_("When loading a font in sfnt format (TrueType, OpenType, etc.),\nask the user to specify which cmap to use initially.") },
- { N_("PreserveTables"), pr_string, &SaveTablesPref, NULL, NULL, 'P', NULL, 0, N_("Enter a list of 4 letter table tags, separated by commas.\nFontForge will make a binary copy of these tables when it\nloads a True/OpenType font, and will output them (unchanged)\nwhen it generates the font. Do not include table tags which\nFontForge thinks it understands.") },
- { NULL }
-},
- navigation_list[] = {
- { N_("GlyphAutoGoto"), pr_bool, &cv_auto_goto, NULL, NULL, '\0', NULL, 0, N_("Typing a normal character in the glyph view window changes the window to look at that character") },
- { N_("OpenCharsInNewWindow"), pr_bool, &OpenCharsInNewWindow, NULL, NULL, '\0', NULL, 0, N_("When double clicking on a character in the font view\nopen that character in a new window, otherwise\nreuse an existing one.") },
- { NULL }
-},
- editing_list[] = {
- { N_("ItalicConstrained"), pr_bool, &ItalicConstrained, NULL, NULL, '\0', NULL, 0, N_("In the Outline View, the Shift key constrains motion to be parallel to the ItalicAngle rather than constraining it to be vertical.") },
- { N_("ArrowMoveSize"), pr_real, &arrowAmount, NULL, NULL, '\0', NULL, 0, N_("The number of em-units by which an arrow key will move a selected point") },
- { N_("SnapDistance"), pr_real, &snapdistance, NULL, NULL, '\0', NULL, 0, N_("When the mouse pointer is within this many pixels\nof one of the various interesting features (baseline,\nwidth, grid splines, etc.) the pointer will snap\nto that feature.") },
- { N_("JoinSnap"), pr_real, &joinsnap, NULL, NULL, '\0', NULL, 0, N_("The Edit->Join command will join points which are this close together\nA value of 0 means they must be coincident") },
- { N_("StopAtJoin"), pr_bool, &stop_at_join, NULL, NULL, '\0', NULL, 0, N_("When dragging points in the outline view a join may occur\n(two open contours may connect at their endpoints). When\nthis is On a join will cause FontForge to stop moving the\nselection (as if the user had released the mouse button).\nThis is handy if your fingers are inclined to wiggle a bit.") },
- { N_("CopyMetaData"), pr_bool, &copymetadata, NULL, NULL, '\0', NULL, 0, N_("When copying glyphs from the font view, also copy the\nglyphs' metadata (name, encoding, comment, etc).") },
- { N_("UndoDepth"), pr_int, &maxundoes, NULL, NULL, '\0', NULL, 0, N_("The maximum number of Undoes/Redoes stored in a glyph") },
- { N_("UpdateFlex"), pr_bool, &updateflex, NULL, NULL, '\0', NULL, 0, N_("Figure out flex hints after every change") },
- { NULL }
-},
- sync_list[] = {
- { N_("AutoWidthSync"), pr_bool, &adjustwidth, NULL, NULL, '\0', NULL, 0, N_("Changing the width of a glyph\nchanges the widths of all accented\nglyphs based on it.") },
- { N_("AutoLBearingSync"), pr_bool, &adjustlbearing, NULL, NULL, '\0', NULL, 0, N_("Changing the left side bearing\nof a glyph adjusts the lbearing\nof other references in all accented\nglyphs based on it.") },
- { NULL }
-},
- tt_list[] = {
- { N_("ClearInstrsBigChanges"), pr_bool, &clear_tt_instructions_when_needed, NULL, NULL, 'C', NULL, 0, N_("Instructions in a TrueType font refer to\npoints by number, so if you edit a glyph\nin such a way that some points have different\nnumbers (add points, remove them, etc.) then\nthe instructions will be applied to the wrong\npoints with disasterous results.\n Normally FontForge will remove the instructions\nif it detects that the points have been renumbered\nin order to avoid the above problem. You may turn\nthis behavior off -- but be careful!") },
- { N_("CopyTTFInstrs"), pr_bool, &copyttfinstr, NULL, NULL, '\0', NULL, 0, N_("When copying glyphs from the font view, also copy the\nglyphs' metadata (name, encoding, comment, etc).") },
- { NULL }
-},
- accent_list[] = {
- { N_("AccentOffsetPercent"), pr_int, &accent_offset, NULL, NULL, '\0', NULL, 0, N_("The percentage of an em by which an accent is offset from its base glyph in Build Accent") },
- { N_("AccentCenterLowest"), pr_bool, &GraveAcuteCenterBottom, NULL, NULL, '\0', NULL, 0, N_("When placing grave and acute accents above letters, should\nFontForge center them based on their full width, or\nshould it just center based on the lowest point\nof the accent.") },
- { N_("CharCenterHighest"), pr_bool, &CharCenterHighest, NULL, NULL, '\0', NULL, 0, N_("When centering an accent over a glyph, should the accent\nbe centered on the highest point(s) of the glyph,\nor the middle of the glyph?") },
- { N_("PreferSpacingAccents"), pr_bool, &PreferSpacingAccents, NULL, NULL, '\0', NULL, 0, N_("Use spacing accents (Unicode: 02C0-02FF) rather than\ncombining accents (Unicode: 0300-036F) when\nbuilding accented glyphs.") },
- { NULL }
-},
- args_list[] = {
-#ifndef LUA_FF_LIB
- { N_("PreferPotrace"), pr_bool, &preferpotrace, NULL, NULL, '\0', NULL, 0, N_("FontForge supports two different helper applications to do autotracing\n autotrace and potrace\nIf your system only has one it will use that one, if you have both\nuse this option to tell FontForge which to pick.") },
- { N_("AutotraceArgs"), pr_string, NULL, GetAutoTraceArgs, SetAutoTraceArgs, '\0', NULL, 0, N_("Extra arguments for configuring the autotrace program\n(either autotrace or potrace)") },
- { N_("AutotraceAsk"), pr_bool, &autotrace_ask, NULL, NULL, '\0', NULL, 0, N_("Ask the user for autotrace arguments each time autotrace is invoked") },
- { N_("MfArgs"), pr_string, &mf_args, NULL, NULL, '\0', NULL, 0, N_("Commands to pass to mf (metafont) program, the filename will follow these") },
- { N_("MfAsk"), pr_bool, &mf_ask, NULL, NULL, '\0', NULL, 0, N_("Ask the user for mf commands each time mf is invoked") },
- { N_("MfClearBg"), pr_bool, &mf_clearbackgrounds, NULL, NULL, '\0', NULL, 0, N_("FontForge loads large images into the background of each glyph\nprior to autotracing them. You may retain those\nimages to look at after mf processing is complete, or\nremove them to save space") },
- { N_("MfShowErr"), pr_bool, &mf_showerrors, NULL, NULL, '\0', NULL, 0, N_("MetaFont (mf) generates lots of verbiage to stdout.\nMost of the time I find it an annoyance but it is\nimportant to see if something goes wrong.") },
-#endif
- { NULL }
-},
- fontinfo_list[] = {
- { N_("FoundryName"), pr_string, &BDFFoundry, NULL, NULL, 'F', NULL, 0, N_("Name used for foundry field in bdf\nfont generation") },
- { N_("TTFFoundry"), pr_string, &TTFFoundry, NULL, NULL, 'T', NULL, 0, N_("Name used for Vendor ID field in\nttf (OS/2 table) font generation.\nMust be no more than 4 characters") },
- { N_("NewFontNameList"), pr_namelist, &namelist_for_new_fonts, NULL, NULL, '\0', NULL, 0, N_("FontForge will use this namelist when assigning\nglyph names to code points in a new font.") },
- { N_("RecognizePUANames"), pr_bool, &recognizePUA, NULL, NULL, 'U', NULL, 0, N_("Once upon a time, Adobe assigned PUA (public use area) encodings\nfor many stylistic variants of characters (small caps, old style\nnumerals, etc.). Adobe no longer believes this to be a good idea,\nand recommends that these encodings be ignored.\n\n The assignments were originally made because most applications\ncould not handle OpenType features for accessing variants. Adobe\nnow believes that all apps that matter can now do so. Applications\nlike Word and OpenOffice still can't handle these features, so\n fontforge's default behavior is to ignore Adobe's current\nrecommendations.\n\nNote: This does not affect figuring out unicode from the font's encoding,\nit just controls determining unicode from a name.") },
- { N_("UnicodeGlyphNames"), pr_bool, &allow_utf8_glyphnames, NULL, NULL, 'O', NULL, 0, N_("Allow the full unicode character set in glyph names.\nThis does not conform to adobe's glyph name standard.\nSuch names should be for internal use only and\nshould NOT end up in production fonts." ) },
- { N_("XUID-Base"), pr_string, &xuid, NULL, NULL, 'X', NULL, 0, N_("If specified this should be a space separated list of integers each\nless than 16777216 which uniquely identify your organization\nFontForge will generate a random number for the final component.") },
- { NULL }
-},
- generate_list[] = {
- { N_("AskBDFResolution"), pr_bool, &ask_user_for_resolution, NULL, NULL, 'B', NULL, 0, N_("When generating a set of BDF fonts ask the user\nto specify the screen resolution of the fonts\notherwise FontForge will guess depending on the pixel size.") },
- { N_("HintForGen"), pr_bool, &autohint_before_generate, NULL, NULL, 'H', NULL, 0, N_("AutoHint changed glyphs before generating a font") },
- { NULL }
-},
- hints_list[] = {
- { N_("HintBoundingBoxes"), pr_bool, &hint_bounding_boxes, NULL, NULL, '\0', NULL, 0, N_("FontForge will place vertical or horizontal hints to describe the bounding boxes of suitable glyphs.") },
- { N_("HintDiagonalEnds"), pr_bool, &hint_diagonal_ends, NULL, NULL, '\0', NULL, 0, N_("FontForge will place vertical or horizontal hints at the ends of diagonal stems.") },
- { N_("HintDiagonalInter"), pr_bool, &hint_diagonal_intersections, NULL, NULL, '\0', NULL, 0, N_("FontForge will place vertical or horizontal hints at the intersections of diagonal stems.") },
- { NULL }
-},
- opentype_list[] = {
- { N_("UseNewIndicScripts"), pr_bool, &use_second_indic_scripts, NULL, NULL, 'C', NULL, 0, N_("MS has changed (in August 2006) the inner workings of their Indic shaping\nengine, and to disambiguate this change has created a parallel set of script\ntags (generally ending in '2') for Indic writing systems. If you are working\nwith the new system set this flag, if you are working with the old unset it.\n(if you aren't doing Indic work, this flag is irrelevant).") },
- { NULL }
-},
-/* These are hidden, so will never appear in ui, hence, no "N_(" */
- hidden_list[] = {
- { "AntiAlias", pr_bool, &default_fv_antialias, NULL, NULL, '\0', NULL, 1 },
- { "DefaultFVShowHmetrics", pr_int, &default_fv_showhmetrics, NULL, NULL, '\0', NULL, 1 },
- { "DefaultFVShowVmetrics", pr_int, &default_fv_showvmetrics, NULL, NULL, '\0', NULL, 1 },
- { "DefaultFVSize", pr_int, &default_fv_font_size, NULL, NULL, 'S', NULL, 1 },
- { "DefaultFVRowCount", pr_int, &default_fv_row_count, NULL, NULL, 'S', NULL, 1 },
- { "DefaultFVColCount", pr_int, &default_fv_col_count, NULL, NULL, 'S', NULL, 1 },
- { "DefaultFVGlyphLabel", pr_int, &default_fv_glyphlabel, NULL, NULL, 'S', NULL, 1 },
- { "SaveToDir", pr_int, &save_to_dir, NULL, NULL, 'S', NULL, 1 },
- { "OnlyCopyDisplayed", pr_bool, &onlycopydisplayed, NULL, NULL, '\0', NULL, 1 },
-#ifndef LUA_FF_LIB
- { "PalettesDocked", pr_bool, &palettes_docked, NULL, NULL, '\0', NULL, 1 },
-#endif
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- { "CVVisible0", pr_bool, &cvvisible[0], NULL, NULL, '\0', NULL, 1 },
- { "CVVisible1", pr_bool, &cvvisible[1], NULL, NULL, '\0', NULL, 1 },
- { "BVVisible0", pr_bool, &bvvisible[0], NULL, NULL, '\0', NULL, 1 },
- { "BVVisible1", pr_bool, &bvvisible[1], NULL, NULL, '\0', NULL, 1 },
- { "BVVisible2", pr_bool, &bvvisible[2], NULL, NULL, '\0', NULL, 1 },
- { "MarkExtrema", pr_int, &CVShows.markextrema, NULL, NULL, '\0', NULL, 1 },
- { "MarkPointsOfInflect", pr_int, &CVShows.markpoi, NULL, NULL, '\0', NULL, 1 },
- { "ShowRulers", pr_bool, &CVShows.showrulers, NULL, NULL, '\0', NULL, 1, N_("Display rulers in the Outline Glyph View") },
- { "ShowCPInfo", pr_int, &CVShows.showcpinfo, NULL, NULL, '\0', NULL, 1 },
- { "ShowSideBearings", pr_int, &CVShows.showsidebearings, NULL, NULL, '\0', NULL, 1 },
- { "ShowPoints", pr_bool, &CVShows.showpoints, NULL, NULL, '\0', NULL, 1 },
- { "ShowFilled", pr_int, &CVShows.showfilled, NULL, NULL, '\0', NULL, 1 },
- { "ShowTabs", pr_int, &CVShows.showtabs, NULL, NULL, '\0', NULL, 1 },
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-#ifndef LUA_FF_LIB
- { "DefaultScreenDpiSystem", pr_int, &oldsystem, NULL, NULL, '\0', NULL, 1 },
- { "DefaultOutputFormat", pr_int, &oldformatstate, NULL, NULL, '\0', NULL, 1 },
- { "DefaultBitmapFormat", pr_int, &oldbitmapstate, NULL, NULL, '\0', NULL, 1 },
- { "DefaultTTFflags", pr_int, &old_ttf_flags, NULL, NULL, '\0', NULL, 1 },
- { "DefaultPSflags", pr_int, &old_ps_flags, NULL, NULL, '\0', NULL, 1 },
- { "DefaultOTFflags", pr_int, &old_otf_flags, NULL, NULL, '\0', NULL, 1 },
- { "PageWidth", pr_int, &pagewidth, NULL, NULL, '\0', NULL, 1 },
- { "PageHeight", pr_int, &pageheight, NULL, NULL, '\0', NULL, 1 },
- { "PrintType", pr_int, &printtype, NULL, NULL, '\0', NULL, 1 },
- { "PrintCommand", pr_string, &printcommand, NULL, NULL, '\0', NULL, 1 },
- { "PageLazyPrinter", pr_string, &printlazyprinter, NULL, NULL, '\0', NULL, 1 },
- { "RegularStar", pr_bool, &regular_star, NULL, NULL, '\0', NULL, 1 },
- { "PolyStar", pr_bool, &polystar, NULL, NULL, '\0', NULL, 1 },
- { "RectEllipse", pr_bool, &rectelipse, NULL, NULL, '\0', NULL, 1 },
- { "RectCenterOut", pr_bool, &center_out[0], NULL, NULL, '\0', NULL, 1 },
- { "EllipseCenterOut", pr_bool, &center_out[1], NULL, NULL, '\0', NULL, 1 },
- { "PolyStartPointCnt", pr_int, &ps_pointcnt, NULL, NULL, '\0', NULL, 1 },
- { "RoundRectRadius", pr_real, &rr_radius, NULL, NULL, '\0', NULL, 1 },
- { "StarPercent", pr_real, &star_percent, NULL, NULL, '\0', NULL, 1 },
- { "CoverageFormatsAllowed", pr_int, &coverageformatsallowed, NULL, NULL, '\0', NULL, 1 },
-#endif
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- { "DebugWins", pr_int, &debug_wins, NULL, NULL, '\0', NULL, 1 },
- { "GridFitDpi", pr_int, &gridfit_dpi, NULL, NULL, '\0', NULL, 1 },
- { "GridFitDepth", pr_int, &gridfit_depth, NULL, NULL, '\0', NULL, 1 },
- { "GridFitPointSize", pr_real, &gridfit_pointsize, NULL, NULL, '\0', NULL, 1 },
-#endif
- { "ForceNamesWhenOpening", pr_namelist, &force_names_when_opening, NULL, NULL, '\0', NULL, 1 },
- { "ForceNamesWhenSaving", pr_namelist, &force_names_when_saving, NULL, NULL, '\0', NULL, 1 },
- { "DefaultFontFilterIndex", pr_int, &default_font_filter_index, NULL, NULL, '\0', NULL, 1 },
- { NULL }
-},
- oldnames[] = {
- { "DumpGlyphMap", pr_bool, &glyph_2_name_map, NULL, NULL, '\0', NULL, 0, N_("When generating a truetype or opentype font it is occasionally\nuseful to know the mapping between truetype glyph ids and\nglyph names. Setting this option will cause FontForge to\nproduce a file (with extension .g2n) containing those data.") },
- { "DefaultTTFApple", pr_int, &pointless, NULL, NULL, '\0', NULL, 1 },
- { "AcuteCenterBottom", pr_bool, &GraveAcuteCenterBottom, NULL, NULL, '\0', NULL, 1, N_("When placing grave and acute accents above letters, should\nFontForge center them based on their full width, or\nshould it just center based on the lowest point\nof the accent.") },
- { "AlwaysGenApple", pr_bool, &alwaysgenapple, NULL, NULL, 'A', NULL, 0, N_("Apple and MS/Adobe differ about the format of truetype and opentype files.\nThis controls the default setting of the Apple checkbox in the\nFile->Generate Font dialog.\nThe main differences are:\n Bitmap data are stored in different tables\n Scaled composite glyphs are treated differently\n Use of GSUB rather than morx(t)/feat\n Use of GPOS rather than kern/opbd\n Use of GDEF rather than lcar/prop\nIf both this and OpenType are set, both formats are generated") },
- { "AlwaysGenOpenType", pr_bool, &alwaysgenopentype, NULL, NULL, 'O', NULL, 0, N_("Apple and MS/Adobe differ about the format of truetype and opentype files.\nThis controls the default setting of the OpenType checkbox in the\nFile->Generate Font dialog.\nThe main differences are:\n Bitmap data are stored in different tables\n Scaled composite glyphs are treated differently\n Use of GSUB rather than morx(t)/feat\n Use of GPOS rather than kern/opbd\n Use of GDEF rather than lcar/prop\nIf both this and Apple are set, both formats are generated") },
- { NULL }
-},
- *prefs_list[] = { general_list, new_list, open_list, navigation_list, sync_list, editing_list, accent_list, args_list, fontinfo_list, generate_list, tt_list, opentype_list, hints_list, hidden_list, NULL },
- *load_prefs_list[] = { general_list, new_list, open_list, navigation_list, sync_list, editing_list, accent_list, args_list, fontinfo_list, generate_list, tt_list, opentype_list, hints_list, hidden_list, oldnames, NULL };
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-struct visible_prefs_list { char *tab_name; int nest; struct prefs_list *pl; } visible_prefs_list[] = {
- { N_("Generic"), 0, general_list},
- { N_("New Font"), 0, new_list},
- { N_("Open Font"), 0, open_list},
- { N_("Navigation"), 0, navigation_list},
- { N_("Editing"), 0, editing_list},
- { N_("Synchronize"), 1, sync_list},
- { N_("TT"), 1, tt_list},
- { N_("Accents"), 1, accent_list},
- { N_("Apps"), 1, args_list},
- { N_("Font Info"), 0, fontinfo_list},
- { N_("Generate"), 0, generate_list},
- { N_("PS Hints"), 1, hints_list},
- { N_("OpenType"), 1, opentype_list},
- { 0 }
- };
-
-#define TOPICS (sizeof(visible_prefs_list)/sizeof(visible_prefs_list[0])-1)
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-int GetPrefs(char *name,Val *val) {
- int i,j;
-
- /* Support for obsolete preferences */
-#ifndef LUA_FF_LIB
- alwaysgenapple=(old_ttf_flags&ttf_flag_applemode)?1:0;
- alwaysgenopentype=(old_ttf_flags&ttf_flag_otmode)?1:0;
-#else
- alwaysgenapple=0;
- alwaysgenopentype=0;
-#endif
-
- for ( i=0; prefs_list[i]!=NULL; ++i ) for ( j=0; prefs_list[i][j].name!=NULL; ++j ) {
- if ( strcmp(prefs_list[i][j].name,name)==0 ) {
- struct prefs_list *pf = &prefs_list[i][j];
- if ( pf->type == pr_bool || pf->type == pr_int ) {
- val->type = v_int;
- val->u.ival = *((int *) (pf->val));
- } else if ( pf->type == pr_string || pf->type == pr_file ) {
- val->type = v_str;
- val->u.sval = copy( *((char **) (pf->val)));
- } else if ( pf->type == pr_encoding ) {
- val->type = v_str;
- if ( *((NameList **) (pf->val))==NULL )
- val->u.sval = copy( "NULL" );
- else
- val->u.sval = copy( (*((Encoding **) (pf->val)))->enc_name );
- } else if ( pf->type == pr_namelist ) {
- val->type = v_str;
- val->u.sval = copy( (*((NameList **) (pf->val)))->title );
- } else if ( pf->type == pr_real ) {
- val->type = v_real;
- val->u.fval = *((float *) (pf->val));
- } else
-return( false );
-
-return( true );
- }
- }
-return( false );
-}
-
-static void CheckObsoletePrefs(void) {
-#ifndef LUA_FF_LIB
- if ( alwaysgenapple==false ) {
- old_ttf_flags &= ~ttf_flag_applemode;
- old_otf_flags &= ~ttf_flag_applemode;
- } else if ( alwaysgenapple==true ) {
- old_ttf_flags |= ttf_flag_applemode;
- old_otf_flags |= ttf_flag_applemode;
- }
- if ( alwaysgenopentype==false ) {
- old_ttf_flags &= ~ttf_flag_otmode;
- old_otf_flags &= ~ttf_flag_otmode;
- } else if ( alwaysgenopentype==true ) {
- old_ttf_flags |= ttf_flag_otmode;
- old_otf_flags |= ttf_flag_otmode;
- }
-#endif
-}
-
-int SetPrefs(char *name,Val *val1, Val *val2) {
- int i,j;
-
- /* Support for obsolete preferences */
- alwaysgenapple=-1; alwaysgenopentype=-1;
-
- for ( i=0; prefs_list[i]!=NULL; ++i ) for ( j=0; prefs_list[i][j].name!=NULL; ++j ) {
- if ( strcmp(prefs_list[i][j].name,name)==0 ) {
- struct prefs_list *pf = &prefs_list[i][j];
- if ( pf->type == pr_bool || pf->type == pr_int ) {
- if ( (val1->type!=v_int && val1->type!=v_unicode) || val2!=NULL )
-return( -1 );
- *((int *) (pf->val)) = val1->u.ival;
- } else if ( pf->type == pr_real ) {
- if ( val1->type==v_real && val2==NULL )
- *((float *) (pf->val)) = val1->u.fval;
- else if ( val1->type!=v_int || (val2!=NULL && val2->type!=v_int ))
-return( -1 );
- else
- *((float *) (pf->val)) = (val2==NULL ? val1->u.ival : val1->u.ival / (double) val2->u.ival);
- } else if ( pf->type == pr_string || pf->type == pr_file ) {
- if ( val1->type!=v_str || val2!=NULL )
-return( -1 );
- if ( pf->set ) {
- pf->set( val1->u.sval );
- } else {
- free( *((char **) (pf->val)));
- *((char **) (pf->val)) = copy( val1->u.sval );
- }
- } else if ( pf->type == pr_encoding ) {
- if ( val2!=NULL )
-return( -1 );
- else if ( val1->type==v_str && pf->val == &default_encoding) {
- Encoding *enc = FindOrMakeEncoding(val1->u.sval);
- if ( enc==NULL )
-return( -1 );
- *((Encoding **) (pf->val)) = enc;
- } else
-return( -1 );
- } else if ( pf->type == pr_namelist ) {
- if ( val2!=NULL )
-return( -1 );
- else if ( val1->type==v_str ) {
-#ifndef LUA_FF_LIB
- NameList *nl = NameListByName(val1->u.sval);
- if ( strcmp(val1->u.sval,"NULL")==0 && pf->val != &namelist_for_new_fonts )
- nl = NULL;
- else if ( nl==NULL )
- return( -1 );
- *((NameList **) (pf->val)) = nl;
-#endif
- } else
- return( -1 );
- } else
-return( false );
-
- CheckObsoletePrefs();
- SavePrefs();
-return( true );
- }
- }
-return( false );
-}
-
-static char *getPfaEditPrefs(void) {
- static char *prefs=NULL;
- char buffer[1025];
-
- if ( prefs!=NULL )
-return( prefs );
- if ( getPfaEditDir(buffer)==NULL )
-return( NULL );
- sprintf(buffer,"%s/prefs", getPfaEditDir(buffer));
- prefs = copy(buffer);
-return( prefs );
-}
-
-char *getPfaEditShareDir(void) {
- static char *sharedir=NULL;
- static int set=false;
- char *pt = NULL;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- int len;
-#endif
-
- if ( set )
-return( sharedir );
-
- set = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- pt = strstr(GResourceProgramDir,"/bin");
-#endif
- if ( pt==NULL )
-return( NULL );
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- len = (pt-GResourceProgramDir)+strlen("/share/fontforge")+1;
- sharedir = galloc(len);
- strncpy(sharedir,GResourceProgramDir,pt-GResourceProgramDir);
- strcpy(sharedir+(pt-GResourceProgramDir),"/share/fontforge");
-return( sharedir );
-#endif
-return( NULL );
-}
-
-#if !defined(FONTFORGE_CONFIG_GTK)
-#ifndef LUA_FF_LIB
-# include <charset.h> /* we still need the charsets & encoding to set local_encoding */
-static int encmatch(const char *enc,int subok) {
- static struct { char *name; int enc; } encs[] = {
- { "US-ASCII", e_usascii },
- { "ASCII", e_usascii },
- { "ISO646-NO", e_iso646_no },
- { "ISO646-SE", e_iso646_se },
- { "LATIN1", e_iso8859_1 },
- { "ISO-8859-1", e_iso8859_1 },
- { "ISO-8859-2", e_iso8859_2 },
- { "ISO-8859-3", e_iso8859_3 },
- { "ISO-8859-4", e_iso8859_4 },
- { "ISO-8859-5", e_iso8859_4 },
- { "ISO-8859-6", e_iso8859_4 },
- { "ISO-8859-7", e_iso8859_4 },
- { "ISO-8859-8", e_iso8859_4 },
- { "ISO-8859-9", e_iso8859_4 },
- { "ISO-8859-10", e_iso8859_10 },
- { "ISO-8859-11", e_iso8859_11 },
- { "ISO-8859-13", e_iso8859_13 },
- { "ISO-8859-14", e_iso8859_14 },
- { "ISO-8859-15", e_iso8859_15 },
- { "ISO_8859-1", e_iso8859_1 },
- { "ISO_8859-2", e_iso8859_2 },
- { "ISO_8859-3", e_iso8859_3 },
- { "ISO_8859-4", e_iso8859_4 },
- { "ISO_8859-5", e_iso8859_4 },
- { "ISO_8859-6", e_iso8859_4 },
- { "ISO_8859-7", e_iso8859_4 },
- { "ISO_8859-8", e_iso8859_4 },
- { "ISO_8859-9", e_iso8859_4 },
- { "ISO_8859-10", e_iso8859_10 },
- { "ISO_8859-11", e_iso8859_11 },
- { "ISO_8859-13", e_iso8859_13 },
- { "ISO_8859-14", e_iso8859_14 },
- { "ISO_8859-15", e_iso8859_15 },
- { "ISO8859-1", e_iso8859_1 },
- { "ISO8859-2", e_iso8859_2 },
- { "ISO8859-3", e_iso8859_3 },
- { "ISO8859-4", e_iso8859_4 },
- { "ISO8859-5", e_iso8859_4 },
- { "ISO8859-6", e_iso8859_4 },
- { "ISO8859-7", e_iso8859_4 },
- { "ISO8859-8", e_iso8859_4 },
- { "ISO8859-9", e_iso8859_4 },
- { "ISO8859-10", e_iso8859_10 },
- { "ISO8859-11", e_iso8859_11 },
- { "ISO8859-13", e_iso8859_13 },
- { "ISO8859-14", e_iso8859_14 },
- { "ISO8859-15", e_iso8859_15 },
- { "ISO88591", e_iso8859_1 },
- { "ISO88592", e_iso8859_2 },
- { "ISO88593", e_iso8859_3 },
- { "ISO88594", e_iso8859_4 },
- { "ISO88595", e_iso8859_4 },
- { "ISO88596", e_iso8859_4 },
- { "ISO88597", e_iso8859_4 },
- { "ISO88598", e_iso8859_4 },
- { "ISO88599", e_iso8859_4 },
- { "ISO885910", e_iso8859_10 },
- { "ISO885911", e_iso8859_11 },
- { "ISO885913", e_iso8859_13 },
- { "ISO885914", e_iso8859_14 },
- { "ISO885915", e_iso8859_15 },
- { "8859_1", e_iso8859_1 },
- { "8859_2", e_iso8859_2 },
- { "8859_3", e_iso8859_3 },
- { "8859_4", e_iso8859_4 },
- { "8859_5", e_iso8859_4 },
- { "8859_6", e_iso8859_4 },
- { "8859_7", e_iso8859_4 },
- { "8859_8", e_iso8859_4 },
- { "8859_9", e_iso8859_4 },
- { "8859_10", e_iso8859_10 },
- { "8859_11", e_iso8859_11 },
- { "8859_13", e_iso8859_13 },
- { "8859_14", e_iso8859_14 },
- { "8859_15", e_iso8859_15 },
- { "KOI8-R", e_koi8_r },
- { "KOI8R", e_koi8_r },
- { "WINDOWS-1252", e_win },
- { "CP1252", e_win },
- { "Big5", e_big5 },
- { "Big-5", e_big5 },
- { "BigFive", e_big5 },
- { "Big-Five", e_big5 },
- { "Big5HKSCS", e_big5hkscs },
- { "Big5-HKSCS", e_big5hkscs },
- { "UTF-8", e_utf8 },
- { "ISO-10646/UTF-8", e_utf8 },
- { "ISO_10646/UTF-8", e_utf8 },
- { "UCS2", e_unicode },
- { "UCS-2", e_unicode },
- { "UCS-2-INTERNAL", e_unicode },
- { "ISO-10646", e_unicode },
- { "ISO_10646", e_unicode },
-#if 0
- { "eucJP", e_euc },
- { "EUC-JP", e_euc },
- { "ujis", ??? },
- { "EUC-KR", e_euckorean },
-#endif
- { NULL }};
- int i;
-#if HAVE_ICONV_H
- static char *last_complaint;
-#endif
- char buffer[80];
-
-#if HAVE_ICONV_H
- iconv_t test;
- free(iconv_local_encoding_name);
- iconv_local_encoding_name= NULL;
-#endif
-
- if ( strchr(enc,'@')!=NULL && strlen(enc)<sizeof(buffer)-1 ) {
- strcpy(buffer,enc);
- *strchr(buffer,'@') = '\0';
- enc = buffer;
- }
-
- for ( i=0; encs[i].name!=NULL; ++i )
- if ( strmatch(enc,encs[i].name)==0 )
-return( encs[i].enc );
-
- if ( subok ) {
- for ( i=0; encs[i].name!=NULL; ++i )
- if ( strstrmatch(enc,encs[i].name)!=NULL )
-return( encs[i].enc );
-
-#if HAVE_ICONV_H
- /* I only try to use iconv if the encoding doesn't match one I support*/
- /* loading iconv unicode data takes a while */
- test = iconv_open(enc,FindUnicharName());
- if ( test==(iconv_t) (-1) || test==NULL ) {
- if ( last_complaint==NULL || strcmp(last_complaint,enc)!=0 ) {
- fprintf( stderr, "Neither FontForge nor iconv() supports your encoding (%s) we will pretend\n you asked for latin1 instead.\n", enc );
- free( last_complaint );
- last_complaint = copy(enc);
- }
- } else {
- if ( last_complaint==NULL || strcmp(last_complaint,enc)!=0 ) {
- fprintf( stderr, "FontForge does not support your encoding (%s), it will try to use iconv()\n or it will pretend the local encoding is latin1\n", enc );
- free( last_complaint );
- last_complaint = copy(enc);
- }
- iconv_local_encoding_name= copy(enc);
- iconv_close(test);
- }
-#else
- fprintf( stderr, "FontForge does not support your encoding (%s), it will pretend the local encoding is latin1\n", enc );
-#endif
-
-return( e_iso8859_1 );
- }
-return( e_unknown );
-}
-
-static int DefaultEncoding(void) {
- const char *loc;
- int enc;
-
-#if HAVE_LANGINFO_H
- loc = nl_langinfo(CODESET);
- enc = encmatch(loc,false);
- if ( enc!=e_unknown )
-return( enc );
-#endif
- loc = getenv("LC_ALL");
- if ( loc==NULL ) loc = getenv("LC_CTYPE");
- /*if ( loc==NULL ) loc = getenv("LC_MESSAGES");*/
- if ( loc==NULL ) loc = getenv("LANG");
-
- if ( loc==NULL )
-return( e_iso8859_1 );
-
- enc = encmatch(loc,false);
- if ( enc==e_unknown ) {
- loc = strrchr(loc,'.');
- if ( loc==NULL )
-return( e_iso8859_1 );
- enc = encmatch(loc+1,true);
- }
- if ( enc==e_unknown )
-return( e_iso8859_1 );
-
-return( enc );
-}
-#endif
-#endif
-
-static void ParseMacMapping(char *pt,struct macsettingname *ms) {
- char *end;
-
- ms->mac_feature_type = strtol(pt,&end,10);
- if ( *end==',' ) ++end;
- ms->mac_feature_setting = strtol(end,&end,10);
- if ( *end==' ' ) ++end;
- ms->otf_tag =
- ((end[0]&0xff)<<24) |
- ((end[1]&0xff)<<16) |
- ((end[2]&0xff)<<8) |
- (end[3]&0xff);
-}
-
-#ifndef LUA_FF_LIB
-static void ParseNewMacFeature(FILE *p,char *line) {
- fseek(p,-(strlen(line)-strlen("MacFeat:")),SEEK_CUR);
- line[strlen("MacFeat:")] ='\0';
- default_mac_feature_map = SFDParseMacFeatures(p,line);
- fseek(p,-strlen(line),SEEK_CUR);
- if ( user_mac_feature_map!=NULL )
- MacFeatListFree(user_mac_feature_map);
- user_mac_feature_map = default_mac_feature_map;
-}
-#endif
-
-static void DefaultXUID(void) {
- /* Adobe has assigned PfaEdit a base XUID of 1021. Each new user is going */
- /* to get a couple of random numbers appended to that, hoping that will */
- /* make for a fairly safe system. */
- /* FontForge will use the same scheme */
- int r1 = 0, r2 = 0;
- char buffer[50];
-#ifndef LUA_FF_LIB /* TH odd, the crosscompiler gets ld errors from gettimeofday() */
- struct timeval tv;
-
- gettimeofday(&tv,NULL);
- srand(tv.tv_usec);
- do {
- r1 = rand()&0x3ff;
- } while ( r1==0 ); /* I reserve "0" for me! */
- gettimeofday(&tv,NULL);
- srandom(tv.tv_usec+1);
- r2 = random();
-#endif
- sprintf( buffer, "1021 %d %d", r1, r2 );
- free(xuid);
- xuid = copy(buffer);
-}
-
-static void DefaultHelp(void) {
- if ( helpdir==NULL ) {
-#ifdef DOCDIR
- helpdir = copy(DOCDIR "/");
-#elif defined(SHAREDIR)
- helpdir = copy(SHAREDIR "/../doc/fontforge/");
-#else
- helpdir = copy("/usr/local/share/doc/fontforge/");
-#endif
- }
-}
-
-void SetDefaults(void) {
-
- DefaultXUID();
- DefaultHelp();
-}
-
-void LoadPrefs(void) {
- char *prefs = getPfaEditPrefs();
- FILE *p;
- char line[1100];
- int i=0, j=0, ri=0, mn=0, ms=0, fn=0, ff=0, filt_max=0;
- int msp=0, msc=0;
- char *pt;
- struct prefs_list *pl;
-
-#if !defined(NOPLUGIN)
- LoadPluginDir(NULL);
-#endif
- LoadPfaEditEncodings();
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- LoadGroupList();
-#endif
-
- if ( prefs!=NULL && (p=fopen(prefs,"r"))!=NULL ) {
- while ( fgets(line,sizeof(line),p)!=NULL ) {
- if ( *line=='#' )
- continue;
- pt = strchr(line,':');
- if ( pt==NULL )
- continue;
- for ( j=0; load_prefs_list[j]!=NULL; ++j ) {
- for ( i=0; load_prefs_list[j][i].name!=NULL; ++i )
- if ( strncmp(line,load_prefs_list[j][i].name,pt-line)==0 )
- break;
- if ( load_prefs_list[j][i].name!=NULL )
- break;
- }
- pl = NULL;
- if ( load_prefs_list[j]!=NULL )
- pl = &load_prefs_list[j][i];
- for ( ++pt; *pt=='\t'; ++pt );
- if ( line[strlen(line)-1]=='\n' )
- line[strlen(line)-1] = '\0';
- if ( line[strlen(line)-1]=='\r' )
- line[strlen(line)-1] = '\0';
- if ( pl==NULL ) {
- if ( strncmp(line,"Recent:",strlen("Recent:"))==0 && ri<RECENT_MAX )
- RecentFiles[ri++] = copy(pt);
- else if ( strncmp(line,"MenuScript:",strlen("MenuScript:"))==0 && ms<SCRIPT_MENU_MAX )
- script_filenames[ms++] = copy(pt);
- else if ( strncmp(line,"MenuName:",strlen("MenuName:"))==0 && mn<SCRIPT_MENU_MAX )
- script_menu_names[mn++] = utf82u_copy(pt);
- else if ( strncmp(line,"FontFilterName:",strlen("FontFilterName:"))==0 ) {
- if ( fn>=filt_max )
- user_font_filters = grealloc(user_font_filters,((filt_max+=10)+1)*sizeof( struct openfilefilters));
- user_font_filters[fn].filter = NULL;
- user_font_filters[fn++].name = copy(pt);
- user_font_filters[fn].name = NULL;
- } else if ( strncmp(line,"FontFilter:",strlen("FontFilter:"))==0 ) {
- if ( ff<filt_max )
- user_font_filters[ff++].filter = copy(pt);
- } else if ( strncmp(line,"MacMapCnt:",strlen("MacSetCnt:"))==0 ) {
- sscanf( pt, "%d", &msc );
- msp = 0;
- user_macfeat_otftag = gcalloc(msc+1,sizeof(struct macsettingname));
- } else if ( strncmp(line,"MacMapping:",strlen("MacMapping:"))==0 && msp<msc ) {
- ParseMacMapping(pt,&user_macfeat_otftag[msp++]);
-#ifndef LUA_FF_LIB
- } else if ( strncmp(line,"MacFeat:",strlen("MacFeat:"))==0 ) {
- ParseNewMacFeature(p,line);
-#endif
- }
- continue;
- }
- switch ( pl->type ) {
- case pr_encoding:
- { Encoding *enc = FindOrMakeEncoding(pt);
- if ( enc==NULL )
- enc = FindOrMakeEncoding("ISO8859-1");
- if ( enc==NULL )
- enc = &custom;
- *((Encoding **) (pl->val)) = enc;
- }
- break;
- case pr_namelist:
-#ifndef LUA_FF_LIB
- { NameList *nl = NameListByName(pt);
- if ( strcmp(pt,"NULL")==0 && pl->val != &namelist_for_new_fonts )
- *((NameList **) (pl->val)) = NULL;
- else if ( nl!=NULL )
- *((NameList **) (pl->val)) = nl;
- }
-#endif
- break;
- case pr_bool: case pr_int:
- sscanf( pt, "%d", (int *) pl->val );
- break;
- case pr_real:
- sscanf( pt, "%f", (float *) pl->val );
- break;
- case pr_string: case pr_file:
- if ( *pt=='\0' ) pt=NULL;
- if ( pl->val!=NULL )
- *((char **) (pl->val)) = copy(pt);
- else
- (pl->set)(copy(pt));
- break;
- case pr_enum:
- break;
- }
- }
- fclose(p);
- }
-#if defined(FONTFORGE_CONFIG_GTK)
- /* Nothing */;
-#else
-#ifndef LUA_FF_LIB
- local_encoding = DefaultEncoding();
-#endif
-#endif
-#if defined(FONTFORGE_CONFIG_GDRAW)
- if ( xdefs_filename!=NULL )
- GResourceAddResourceFile(xdefs_filename,GResourceProgramName);
-#endif
-#ifndef LUA_FF_LIB
- if ( othersubrsfile!=NULL && ReadOtherSubrsFile(othersubrsfile)<=0 )
- fprintf( stderr, "Failed to read OtherSubrs from %s\n", othersubrsfile );
-
-#endif
- if ( glyph_2_name_map ) {
-#ifndef LUA_FF_LIB
- old_ttf_flags |= ttf_flag_glyphmap;
- old_otf_flags |= ttf_flag_glyphmap;
-#endif
- }
-#ifndef LUA_FF_LIB
- LoadNamelistDir(NULL);
-#endif
-}
-
-void PrefDefaultEncoding(void) {
-#ifndef LUA_FF_LIB
- local_encoding = DefaultEncoding();
-#endif
-}
-
-void _SavePrefs(void) {
- char *prefs = getPfaEditPrefs();
- FILE *p;
- int i, j;
- char *temp;
- struct prefs_list *pl;
-
- if ( prefs==NULL )
-return;
- if ( (p=fopen(prefs,"w"))==NULL )
-return;
-
- for ( j=0; prefs_list[j]!=NULL; ++j ) for ( i=0; prefs_list[j][i].name!=NULL; ++i ) {
- pl = &prefs_list[j][i];
- switch ( pl->type ) {
- case pr_encoding:
- fprintf( p, "%s:\t%s\n", pl->name, (*((Encoding **) (pl->val)))->enc_name );
- break;
- case pr_namelist:
- fprintf( p, "%s:\t%s\n", pl->name, *((NameList **) (pl->val))==NULL ? "NULL" :
- (*((NameList **) (pl->val)))->title );
- break;
- case pr_bool: case pr_int:
- fprintf( p, "%s:\t%d\n", pl->name, *(int *) (pl->val) );
- break;
- case pr_real:
- fprintf( p, "%s:\t%g\n", pl->name, (double) *(float *) (pl->val) );
- break;
- case pr_string: case pr_file:
- if ( (pl->val)!=NULL )
- temp = *(char **) (pl->val);
- else
- temp = (char *) (pl->get());
- if ( temp!=NULL )
- fprintf( p, "%s:\t%s\n", pl->name, temp );
- if ( (pl->val)==NULL )
- free(temp);
- break;
- case pr_enum:
- break;
- }
- }
-
- for ( i=0; i<RECENT_MAX && RecentFiles[i]!=NULL; ++i )
- fprintf( p, "Recent:\t%s\n", RecentFiles[i]);
- for ( i=0; i<SCRIPT_MENU_MAX && script_filenames[i]!=NULL; ++i ) {
- fprintf( p, "MenuScript:\t%s\n", script_filenames[i]);
- fprintf( p, "MenuName:\t%s\n", temp = u2utf8_copy(script_menu_names[i]));
- free(temp);
- }
- if ( user_font_filters!=NULL ) {
- for ( i=0; user_font_filters[i].name!=NULL; ++i ) {
- fprintf( p, "FontFilterName:\t%s\n", user_font_filters[i].name);
- fprintf( p, "FontFilter:\t%s\n", user_font_filters[i].filter);
- }
- }
- if ( user_macfeat_otftag!=NULL && UserSettingsDiffer()) {
- for ( i=0; user_macfeat_otftag[i].otf_tag!=0; ++i );
- fprintf( p, "MacMapCnt: %d\n", i );
- for ( i=0; user_macfeat_otftag[i].otf_tag!=0; ++i ) {
- fprintf( p, "MacMapping: %d,%d %c%c%c%c\n",
- user_macfeat_otftag[i].mac_feature_type,
- user_macfeat_otftag[i].mac_feature_setting,
- (int) (user_macfeat_otftag[i].otf_tag>>24),
- (int) ((user_macfeat_otftag[i].otf_tag>>16)&0xff),
- (int) ((user_macfeat_otftag[i].otf_tag>>8)&0xff),
- (int) (user_macfeat_otftag[i].otf_tag&0xff) );
- }
- }
-
-#ifndef LUA_FF_LIB
- if ( UserFeaturesDiffer())
- SFDDumpMacFeat(p,default_mac_feature_map);
-#endif
- fclose(p);
-}
-
-void SavePrefs(void) {
- extern int running_script;
- if ( running_script )
-return;
- _SavePrefs();
-}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-struct pref_data {
- int done;
-};
-
-static int Prefs_ScriptBrowse(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- GGadget *tf = GWidgetGetControl(gw,GGadgetGetCid(g)-SCRIPT_MENU_MAX);
- char *cur = GGadgetGetTitle8(tf); char *ret;
-
- if ( *cur=='\0' ) cur=NULL;
- ret = gwwv_open_filename(_("Call Script"), cur, "*.pe", NULL);
- free(cur);
- if ( ret==NULL )
-return(true);
- GGadgetSetTitle8(tf,ret);
- free(ret);
- }
-return( true );
-}
-
-static int Prefs_BrowseFile(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- GGadget *tf = GWidgetGetControl(gw,GGadgetGetCid(g)-CID_PrefsBrowseOffset);
- char *cur = GGadgetGetTitle8(tf); char *ret;
- struct prefs_list *pl = GGadgetGetUserData(tf);
-
- ret = gwwv_open_filename(pl->name, *cur=='\0'? NULL : cur, NULL, NULL);
- free(cur);
- if ( ret==NULL )
-return(true);
- GGadgetSetTitle8(tf,ret);
- free(ret);
- }
-return( true );
-}
-
-static GTextInfo *Pref_MappingList(int use_user) {
- struct macsettingname *msn = use_user && user_macfeat_otftag!=NULL ?
- user_macfeat_otftag :
- macfeat_otftag;
- GTextInfo *ti;
- int i;
- char buf[60];
-
- for ( i=0; msn[i].otf_tag!=0; ++i );
- ti = gcalloc(i+1,sizeof( GTextInfo ));
-
- for ( i=0; msn[i].otf_tag!=0; ++i ) {
- sprintf(buf,"%3d,%2d %c%c%c%c",
- msn[i].mac_feature_type, msn[i].mac_feature_setting,
- (int) (msn[i].otf_tag>>24), (int) ((msn[i].otf_tag>>16)&0xff), (int) ((msn[i].otf_tag>>8)&0xff), (int) (msn[i].otf_tag&0xff) );
- ti[i].text = uc_copy(buf);
- }
-return( ti );
-}
-
-void GListAddStr(GGadget *list,unichar_t *str, void *ud) {
- int32 i,len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- GTextInfo **replace = galloc((len+2)*sizeof(GTextInfo *));
-
- replace[len+1] = gcalloc(1,sizeof(GTextInfo));
- for ( i=0; i<len; ++i ) {
- replace[i] = galloc(sizeof(GTextInfo));
- *replace[i] = *ti[i];
- replace[i]->text = u_copy(ti[i]->text);
- }
- replace[i] = gcalloc(1,sizeof(GTextInfo));
- replace[i]->fg = replace[i]->bg = COLOR_DEFAULT;
- replace[i]->text = str;
- replace[i]->userdata = ud;
- GGadgetSetList(list,replace,false);
-}
-
-void GListReplaceStr(GGadget *list,int index, unichar_t *str, void *ud) {
- int32 i,len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- GTextInfo **replace = galloc((len+2)*sizeof(GTextInfo *));
-
- for ( i=0; i<len; ++i ) {
- replace[i] = galloc(sizeof(GTextInfo));
- *replace[i] = *ti[i];
- if ( i!=index )
- replace[i]->text = u_copy(ti[i]->text);
- }
- replace[i] = gcalloc(1,sizeof(GTextInfo));
- replace[index]->text = str;
- replace[index]->userdata = ud;
- GGadgetSetList(list,replace,false);
-}
-
-struct setdata {
- GWindow gw;
- GGadget *list;
- GGadget *flist;
- GGadget *feature;
- GGadget *set_code;
- GGadget *otf;
- GGadget *ok;
- GGadget *cancel;
- int index;
- int done;
- unichar_t *ret;
-};
-
-static int set_e_h(GWindow gw, GEvent *event) {
- struct setdata *sd = GDrawGetUserData(gw);
- int i;
- int32 len;
- GTextInfo **ti;
- const unichar_t *ret1; unichar_t *end;
- int on, feat, val1, val2;
- unichar_t ubuf[4];
- char buf[40];
-
- if ( event->type==et_close ) {
- sd->done = true;
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("prefs.html#Features");
-return( true );
- }
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- if ( event->u.control.g == sd->cancel ) {
- sd->done = true;
- } else if ( event->u.control.g == sd->ok ) {
- ret1 = _GGadgetGetTitle(sd->set_code);
- on = u_strtol(ret1,&end,10);
- if ( *end!='\0' ) {
- gwwv_post_error(_("Bad Number"),_("Bad Number"));
-return( true );
- }
- ret1 = _GGadgetGetTitle(sd->feature);
- feat = u_strtol(ret1,&end,10);
- if ( *end!='\0' && *end!=' ' ) {
- gwwv_post_error(_("Bad Number"),_("Bad Number"));
-return( true );
- }
- ti = GGadgetGetList(sd->list,&len);
- for ( i=0; i<len; ++i ) if ( i!=sd->index ) {
- val1 = u_strtol(ti[i]->text,&end,10);
- val2 = u_strtol(end+1,NULL,10);
- if ( val1==feat && val2==on ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- static char *buts[3];
- buts[0] = _("_Yes");
- buts[1] = _("_No");
- buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_NO, NULL };
-#endif
- if ( gwwv_ask(_("This feature, setting combination is already used"),(const char **) buts,0,1,
- _("This feature, setting combination is already used\nDo you really wish to reuse it?"))==1 )
-return( true );
- }
- }
-
- ret1 = _GGadgetGetTitle(sd->otf);
- if ( (ubuf[0] = ret1[0])==0 )
- ubuf[0] = ubuf[1] = ubuf[2] = ubuf[3] = ' ';
- else if ( (ubuf[1] = ret1[1])==0 )
- ubuf[1] = ubuf[2] = ubuf[3] = ' ';
- else if ( (ubuf[2] = ret1[2])==0 )
- ubuf[2] = ubuf[3] = ' ';
- else if ( (ubuf[3] = ret1[3])==0 )
- ubuf[3] = ' ';
- len = u_strlen(ret1);
- if ( len<2 || len>4 || ubuf[0]>=0x7f || ubuf[1]>=0x7f || ubuf[2]>=0x7f || ubuf[3]>=0x7f ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error(_("Tag too long"),_("Feature tags must be exactly 4 ASCII characters"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Tag too long"),_("Feature tags must be exactly 4 ASCII characters"));
-#endif
-return( true );
- }
- sprintf(buf,"%3d,%2d %c%c%c%c",
- feat, on,
- ubuf[0], ubuf[1], ubuf[2], ubuf[3]);
- sd->done = true;
- sd->ret = uc_copy(buf);
- }
- }
-return( true );
-}
-
-static unichar_t *AskSetting(struct macsettingname *temp,GGadget *list, int index,GGadget *flist) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[17];
- GTextInfo label[17];
- struct setdata sd;
- char buf[20];
- unichar_t ubuf3[6];
- int32 len, i;
- GTextInfo **ti;
-
- memset(&sd,0,sizeof(sd));
- sd.list = list;
- sd.flist = flist;
- sd.index = index;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Mapping");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,240));
- pos.height = GDrawPointsToPixels(NULL,120);
- gw = GDrawCreateTopWindow(NULL,&pos,set_e_h,&sd,&wattrs);
- sd.gw = gw;
-
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
-
- label[0].text = (unichar_t *) _("_Feature:");
- label[0].text_is_1byte = true;
- label[0].text_in_resource = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 5; gcd[0].gd.pos.y = 5+4;
- gcd[0].gd.flags = gg_enabled|gg_visible;
- gcd[0].creator = GLabelCreate;
-
- gcd[1].gd.pos.x = 50; gcd[1].gd.pos.y = 5; gcd[1].gd.pos.width = 170;
- gcd[1].gd.flags = gg_enabled|gg_visible;
- gcd[1].creator = GListButtonCreate;
-
- label[2].text = (unichar_t *) _("Setting");
- label[2].text_is_1byte = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.pos.x = 5; gcd[2].gd.pos.y = gcd[0].gd.pos.y+26;
- gcd[2].gd.flags = gg_enabled|gg_visible;
- gcd[2].creator = GLabelCreate;
-
- sprintf( buf, "%d", temp->mac_feature_setting );
- label[3].text = (unichar_t *) buf;
- label[3].text_is_1byte = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.pos.x = gcd[1].gd.pos.x; gcd[3].gd.pos.y = gcd[2].gd.pos.y-4; gcd[3].gd.pos.width = 50;
- gcd[3].gd.flags = gg_enabled|gg_visible;
- gcd[3].creator = GTextFieldCreate;
-
- label[4].text = (unichar_t *) _("_Tag:");
- label[4].text_is_1byte = true;
- label[4].text_in_resource = true;
- gcd[4].gd.label = &label[4];
- gcd[4].gd.pos.x = 5; gcd[4].gd.pos.y = gcd[3].gd.pos.y+26;
- gcd[4].gd.flags = gg_enabled|gg_visible;
- gcd[4].creator = GLabelCreate;
-
- ubuf3[0] = temp->otf_tag>>24; ubuf3[1] = (temp->otf_tag>>16)&0xff; ubuf3[2] = (temp->otf_tag>>8)&0xff; ubuf3[3] = temp->otf_tag&0xff; ubuf3[4] = 0;
- label[5].text = ubuf3;
- gcd[5].gd.label = &label[5];
- gcd[5].gd.pos.x = gcd[3].gd.pos.x; gcd[5].gd.pos.y = gcd[4].gd.pos.y-4; gcd[5].gd.pos.width = 50;
- gcd[5].gd.flags = gg_enabled|gg_visible;
- /*gcd[5].gd.u.list = tags;*/
- gcd[5].creator = GTextFieldCreate;
-
- gcd[6].gd.pos.x = 13-3; gcd[6].gd.pos.y = gcd[5].gd.pos.y+30;
- gcd[6].gd.pos.width = -1; gcd[6].gd.pos.height = 0;
- gcd[6].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[6].text = (unichar_t *) _("_OK");
- label[6].text_is_1byte = true;
- label[6].text_in_resource = true;
- gcd[6].gd.label = &label[6];
- /*gcd[6].gd.handle_controlevent = Prefs_Ok;*/
- gcd[6].creator = GButtonCreate;
-
- gcd[7].gd.pos.x = -13; gcd[7].gd.pos.y = gcd[7-1].gd.pos.y+3;
- gcd[7].gd.pos.width = -1; gcd[7].gd.pos.height = 0;
- gcd[7].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[7].text = (unichar_t *) _("_Cancel");
- label[7].text_is_1byte = true;
- label[7].text_in_resource = true;
- gcd[7].gd.label = &label[7];
- gcd[7].creator = GButtonCreate;
-
- GGadgetsCreate(gw,gcd);
- sd.feature = gcd[1].ret;
- sd.set_code = gcd[3].ret;
- sd.otf = gcd[5].ret;
- sd.ok = gcd[6].ret;
- sd.cancel = gcd[7].ret;
-
- ti = GGadgetGetList(flist,&len);
- GGadgetSetList(sd.feature,ti,true);
- for ( i=0; i<len; ++i ) {
- int val = u_strtol(ti[i]->text,NULL,10);
- if ( val==temp->mac_feature_type ) {
- GGadgetSetTitle(sd.feature,ti[i]->text);
- break;
- }
- }
-
- GDrawSetVisible(gw,true);
- GWidgetIndicateFocusGadget(gcd[1].ret);
- while ( !sd.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-
-return( sd.ret );
-}
-
-static void ChangeSetting(GGadget *list,int index,GGadget *flist) {
- struct macsettingname temp;
- int32 len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- char *str;
- unichar_t *ustr;
-
- str = cu_copy(ti[index]->text);
- ParseMacMapping(str,&temp);
- free(str);
- if ( (ustr=AskSetting(&temp,list,index,flist))==NULL )
-return;
- GListReplaceStr(list,index,ustr,NULL);
-}
-
-static int Pref_NewMapping(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- GGadget *list = GWidgetGetControl(gw,CID_Mapping);
- GGadget *flist = GWidgetGetControl(GDrawGetParentWindow(gw),CID_Features);
- struct macsettingname temp;
- unichar_t *str;
-
- memset(&temp,0,sizeof(temp));
- temp.mac_feature_type = -1;
- if ( (str=AskSetting(&temp,list,-1,flist))==NULL )
-return( true );
- GListAddStr(list,str,NULL);
- /*free(str);*/
- }
-return( true );
-}
-
-static int Pref_DelMapping(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- GListDelSelected(GWidgetGetControl(gw,CID_Mapping));
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_MappingDel),false);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_MappingEdit),false);
- }
-return( true );
-}
-
-static int Pref_EditMapping(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GDrawGetParentWindow(GGadgetGetWindow(g));
- GGadget *list = GWidgetGetControl(gw,CID_Mapping);
- GGadget *flist = GWidgetGetControl(gw,CID_Features);
- ChangeSetting(list,GGadgetGetFirstListSelectedItem(list),flist);
- }
-return( true );
-}
-
-static int Pref_MappingSel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(g,&len);
- GWindow gw = GGadgetGetWindow(g);
- int i, sel_cnt=0;
- for ( i=0; i<len; ++i )
- if ( ti[i]->selected ) ++sel_cnt;
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_MappingDel),sel_cnt!=0);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_MappingEdit),sel_cnt==1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- GGadget *flist = GWidgetGetControl( GDrawGetParentWindow(GGadgetGetWindow(g)),CID_Features);
- ChangeSetting(g,e->u.control.u.list.changed_index!=-1?e->u.control.u.list.changed_index:
- GGadgetGetFirstListSelectedItem(g),flist);
- }
-return( true );
-}
-
-static int Pref_DefaultMapping(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GGadget *list = GWidgetGetControl(GGadgetGetWindow(g),CID_Mapping);
- GTextInfo *ti, **arr;
- uint16 cnt;
-
- ti = Pref_MappingList(false);
- arr = GTextInfoArrayFromList(ti,&cnt);
- GGadgetSetList(list,arr,false);
- GTextInfoListFree(ti);
- }
-return( true );
-}
-
-static int Prefs_Ok(GGadget *g, GEvent *e) {
- int i, j, mi;
- int err=0, enc;
- struct pref_data *p;
- GWindow gw;
- const unichar_t *ret;
- const unichar_t *names[SCRIPT_MENU_MAX], *scripts[SCRIPT_MENU_MAX];
- struct prefs_list *pl;
- GTextInfo **list;
- int32 len;
- int maxl, t;
- char *str;
-
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- gw = GGadgetGetWindow(g);
- p = GDrawGetUserData(gw);
- for ( i=0; i<SCRIPT_MENU_MAX; ++i ) {
- names[i] = _GGadgetGetTitle(GWidgetGetControl(gw,CID_ScriptMNameBase+i));
- scripts[i] = _GGadgetGetTitle(GWidgetGetControl(gw,CID_ScriptMFileBase+i));
- if ( *names[i]=='\0' ) names[i] = NULL;
- if ( *scripts[i]=='\0' ) scripts[i] = NULL;
- if ( scripts[i]==NULL && names[i]!=NULL ) {
- gwwv_post_error(_("Menu name with no associated script"),_("Menu name with no associated script"));
-return( true );
- } else if ( scripts[i]!=NULL && names[i]==NULL ) {
- gwwv_post_error(_("Script with no associated menu name"),_("Script with no associated menu name"));
-return( true );
- }
- }
- for ( i=mi=0; i<SCRIPT_MENU_MAX; ++i ) {
- if ( names[i]!=NULL ) {
- names[mi] = names[i];
- scripts[mi] = scripts[i];
- ++mi;
- }
- }
- for ( j=0; visible_prefs_list[j].tab_name!=0; ++j ) for ( i=0; visible_prefs_list[j].pl[i].name!=NULL; ++i ) {
- pl = &visible_prefs_list[j].pl[i];
- /* before assigning values, check for any errors */
- /* if any errors, then NO values should be assigned, in case they cancel */
- if ( pl->dontdisplay )
- continue;
- if ( pl->type==pr_int ) {
- GetInt8(gw,j*CID_PrefsOffset+CID_PrefsBase+i,pl->name,&err);
- } else if ( pl->type==pr_int ) {
- GetReal8(gw,j*CID_PrefsOffset+CID_PrefsBase+i,pl->name,&err);
- }
- }
- if ( err )
-return( true );
-
- for ( j=0; visible_prefs_list[j].tab_name!=0; ++j ) for ( i=0; visible_prefs_list[j].pl[i].name!=NULL; ++i ) {
- pl = &visible_prefs_list[j].pl[i];
- if ( pl->dontdisplay )
- continue;
- switch( pl->type ) {
- case pr_int:
- *((int *) (pl->val)) = GetInt8(gw,j*CID_PrefsOffset+CID_PrefsBase+i,pl->name,&err);
- break;
- case pr_bool:
- *((int *) (pl->val)) = GGadgetIsChecked(GWidgetGetControl(gw,j*CID_PrefsOffset+CID_PrefsBase+i));
- break;
- case pr_real:
- *((float *) (pl->val)) = GetReal8(gw,j*CID_PrefsOffset+CID_PrefsBase+i,pl->name,&err);
- break;
- case pr_encoding:
- { Encoding *e;
- e = ParseEncodingNameFromList(GWidgetGetControl(gw,j*CID_PrefsOffset+CID_PrefsBase+i));
- if ( e!=NULL )
- *((Encoding **) (pl->val)) = e;
- enc = 1; /* So gcc doesn't complain about unused. It is unused, but why add the ifdef and make the code even messier? Sigh. icc complains anyway */
- }
- break;
- case pr_namelist:
- { NameList *nl;
- GTextInfo *ti = GGadgetGetListItemSelected(GWidgetGetControl(gw,j*CID_PrefsOffset+CID_PrefsBase+i));
- if ( ti!=NULL ) {
- char *name = u2utf8_copy(ti->text);
- nl = NameListByName(name);
- free(name);
- if ( nl!=NULL && nl->uses_unicode && !allow_utf8_glyphnames)
- gwwv_post_error(_("Namelist contains non-ASCII names"),_("Glyph names should be limited to characters in the ASCII character set, but there are names in this namelist which use characters outside that range."));
- else if ( nl!=NULL )
- *((NameList **) (pl->val)) = nl;
- }
- }
- break;
- case pr_string: case pr_file:
- ret = _GGadgetGetTitle(GWidgetGetControl(gw,j*CID_PrefsOffset+CID_PrefsBase+i));
- if ( pl->val!=NULL ) {
- free( *((char **) (pl->val)) );
- *((char **) (pl->val)) = NULL;
- if ( ret!=NULL && *ret!='\0' )
- *((char **) (pl->val)) = /* u2def_*/ cu_copy(ret);
- } else {
- char *cret = cu_copy(ret);
- (pl->set)(cret);
- free(cret);
- }
- break;
- }
- }
- for ( i=0; i<SCRIPT_MENU_MAX; ++i ) {
- free(script_menu_names[i]); script_menu_names[i] = NULL;
- free(script_filenames[i]); script_filenames[i] = NULL;
- }
- for ( i=0; i<mi; ++i ) {
- script_menu_names[i] = u_copy(names[i]);
- script_filenames[i] = u2def_copy(scripts[i]);
- }
-
- list = GGadgetGetList(GWidgetGetControl(gw,CID_Mapping),&len);
- UserSettingsFree();
- user_macfeat_otftag = galloc((len+1)*sizeof(struct macsettingname));
- user_macfeat_otftag[len].otf_tag = 0;
- maxl = 0;
- for ( i=0; i<len; ++i ) {
- t = u_strlen(list[i]->text);
- if ( t>maxl ) maxl = t;
- }
- str = galloc(maxl+3);
- for ( i=0; i<len; ++i ) {
- u2encoding_strncpy(str,list[i]->text,maxl+1,e_mac);
- ParseMacMapping(str,&user_macfeat_otftag[i]);
- }
- free(str);
-
- Prefs_ReplaceMacFeatures(GWidgetGetControl(gw,CID_Features));
-
- if ( xuid!=NULL ) {
- char *pt;
- for ( pt=xuid; *pt==' ' ; ++pt );
- if ( *pt=='[' ) { /* People who know PS well, might want to put brackets arround the xuid base array, but I don't want them */
- pt = copy(pt+1);
- free( xuid );
- xuid = pt;
- }
- for ( pt=xuid+strlen(xuid)-1; pt>xuid && *pt==' '; --pt );
- if ( pt >= xuid && *pt==']' ) *pt = '\0';
- }
-
- p->done = true;
- SavePrefs();
- if ( maxundoes==0 ) { FontView *fv;
- for ( fv=fv_list ; fv!=NULL; fv=fv->next )
- SFRemoveUndoes(fv->sf,NULL,NULL);
- }
- if ( othersubrsfile!=NULL && ReadOtherSubrsFile(othersubrsfile)<=0 )
- fprintf( stderr, "Failed to read OtherSubrs from %s\n", othersubrsfile );
- }
-return( true );
-}
-
-static int Prefs_Cancel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct pref_data *p = GDrawGetUserData(GGadgetGetWindow(g));
- MacFeatListFree(GGadgetGetUserData((GWidgetGetControl(
- GGadgetGetWindow(g),CID_Features))));
- p->done = true;
- }
-return( true );
-}
-
-static int e_h(GWindow gw, GEvent *event) {
- if ( event->type==et_close ) {
- struct pref_data *p = GDrawGetUserData(gw);
- p->done = true;
- MacFeatListFree(GGadgetGetUserData((GWidgetGetControl(gw,CID_Features))));
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("prefs.html");
-return( true );
- }
-return( false );
- }
-return( true );
-}
-
-static void PrefsInit(void) {
- static int done = false;
- int i;
-
- if ( done )
-return;
- done = true;
- for ( i=0; visible_prefs_list[i].tab_name!=NULL; ++i )
- visible_prefs_list[i].tab_name = _(visible_prefs_list[i].tab_name);
-}
-
-void DoPrefs(void) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData *pgcd, gcd[5], sgcd[45], mgcd[3], mfgcd[9], msgcd[9];
- GGadgetCreateData mfboxes[3], *mfarray[14];
- GGadgetCreateData mpboxes[3], *mparray[14];
- GGadgetCreateData sboxes[2], *sarray[50];
- GGadgetCreateData mboxes[3], *varray[5], *harray[8];
- GTextInfo *plabel, **list, label[5], slabel[45], *plabels[TOPICS+5], mflabels[9], mslabels[9];
- GTabInfo aspects[TOPICS+5], subaspects[3];
- GGadgetCreateData **hvarray, boxes[2*TOPICS];
- struct pref_data p;
- int i, gc, sgc, j, k, line, line_max, y, y2, ii, si;
- int32 llen;
- char buf[20];
- int gcnt[20];
- static unichar_t nullstr[] = { 0 };
- struct prefs_list *pl;
- char *tempstr;
- static unichar_t monospace[] = { 'c','o','u','r','i','e','r',',','m', 'o', 'n', 'o', 's', 'p', 'a', 'c', 'e',',','c','a','s','l','o','n',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };
- FontRequest rq;
- GFont *font;
-
- PrefsInit();
-
- MfArgsInit();
- for ( k=line_max=0; visible_prefs_list[k].tab_name!=0; ++k ) {
- for ( i=line=gcnt[k]=0; visible_prefs_list[k].pl[i].name!=NULL; ++i ) {
- if ( visible_prefs_list[k].pl[i].dontdisplay )
- continue;
- gcnt[k] += 2;
- if ( visible_prefs_list[k].pl[i].type==pr_bool ) ++gcnt[k];
- else if ( visible_prefs_list[k].pl[i].type==pr_file ) ++gcnt[k];
- ++line;
- }
- if ( visible_prefs_list[k].pl == args_list ) {
- gcnt[k] += 6;
- line += 6;
- }
- if ( line>line_max ) line_max = line;
- }
-
- memset(&p,'\0',sizeof(p));
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Preferences...");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,290));
- pos.height = GDrawPointsToPixels(NULL,line_max*26+69);
- gw = GDrawCreateTopWindow(NULL,&pos,e_h,&p,&wattrs);
-
- memset(sgcd,0,sizeof(sgcd));
- memset(slabel,0,sizeof(slabel));
- memset(&mfgcd,0,sizeof(mfgcd));
- memset(&msgcd,0,sizeof(msgcd));
- memset(&mflabels,0,sizeof(mflabels));
- memset(&mslabels,0,sizeof(mslabels));
- memset(&mfboxes,0,sizeof(mfboxes));
- memset(&mpboxes,0,sizeof(mpboxes));
- memset(&sboxes,0,sizeof(sboxes));
- memset(&boxes,0,sizeof(boxes));
-
- GCDFillMacFeat(mfgcd,mflabels,250,default_mac_feature_map, true, mfboxes, mfarray);
-
- sgc = 0;
-
- msgcd[sgc].gd.pos.x = 6; msgcd[sgc].gd.pos.y = 6;
- msgcd[sgc].gd.pos.width = 250; msgcd[sgc].gd.pos.height = 16*12+10;
- msgcd[sgc].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic | gg_list_multiplesel;
- msgcd[sgc].gd.cid = CID_Mapping;
- msgcd[sgc].gd.u.list = Pref_MappingList(true);
- msgcd[sgc].gd.handle_controlevent = Pref_MappingSel;
- msgcd[sgc++].creator = GListCreate;
- mparray[0] = &msgcd[sgc-1];
-
- msgcd[sgc].gd.pos.x = 6; msgcd[sgc].gd.pos.y = msgcd[sgc-1].gd.pos.y+msgcd[sgc-1].gd.pos.height+10;
- msgcd[sgc].gd.flags = gg_visible | gg_enabled;
- mslabels[sgc].text = (unichar_t *) S_("MacMap|_New...");
- mslabels[sgc].text_is_1byte = true;
- mslabels[sgc].text_in_resource = true;
- msgcd[sgc].gd.label = &mslabels[sgc];
- msgcd[sgc].gd.handle_controlevent = Pref_NewMapping;
- msgcd[sgc++].creator = GButtonCreate;
- mparray[4] = GCD_Glue; mparray[5] = &msgcd[sgc-1];
-
- msgcd[sgc].gd.pos.x = msgcd[sgc-1].gd.pos.x+10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- msgcd[sgc].gd.pos.y = msgcd[sgc-1].gd.pos.y;
- msgcd[sgc].gd.flags = gg_visible ;
- mslabels[sgc].text = (unichar_t *) _("_Delete");
- mslabels[sgc].text_is_1byte = true;
- mslabels[sgc].text_in_resource = true;
- msgcd[sgc].gd.label = &mslabels[sgc];
- msgcd[sgc].gd.cid = CID_MappingDel;
- msgcd[sgc].gd.handle_controlevent = Pref_DelMapping;
- msgcd[sgc++].creator = GButtonCreate;
- mparray[5] = GCD_Glue; mparray[6] = &msgcd[sgc-1];
-
- msgcd[sgc].gd.pos.x = msgcd[sgc-1].gd.pos.x+10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- msgcd[sgc].gd.pos.y = msgcd[sgc-1].gd.pos.y;
- msgcd[sgc].gd.flags = gg_visible ;
- mslabels[sgc].text = (unichar_t *) _("_Edit...");
- mslabels[sgc].text_is_1byte = true;
- mslabels[sgc].text_in_resource = true;
- msgcd[sgc].gd.label = &mslabels[sgc];
- msgcd[sgc].gd.cid = CID_MappingEdit;
- msgcd[sgc].gd.handle_controlevent = Pref_EditMapping;
- msgcd[sgc++].creator = GButtonCreate;
- mparray[7] = GCD_Glue; mparray[8] = &msgcd[sgc-1];
-
- msgcd[sgc].gd.pos.x = msgcd[sgc-1].gd.pos.x+10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- msgcd[sgc].gd.pos.y = msgcd[sgc-1].gd.pos.y;
- msgcd[sgc].gd.flags = gg_visible | gg_enabled;
- mslabels[sgc].text = (unichar_t *) S_("MacMapping|Default");
- mslabels[sgc].text_is_1byte = true;
- mslabels[sgc].text_in_resource = true;
- msgcd[sgc].gd.label = &mslabels[sgc];
- msgcd[sgc].gd.handle_controlevent = Pref_DefaultMapping;
- msgcd[sgc++].creator = GButtonCreate;
- mparray[9] = GCD_Glue; mparray[10] = &msgcd[sgc-1];
- mparray[11] = GCD_Glue; mparray[12] = NULL;
-
- mpboxes[2].gd.flags = gg_enabled|gg_visible;
- mpboxes[2].gd.u.boxelements = mparray+4;
- mpboxes[2].creator = GHBoxCreate;
- mparray[1] = GCD_Glue;
- mparray[2] = &mpboxes[2];
- mparray[3] = NULL;
-
- mpboxes[0].gd.flags = gg_enabled|gg_visible;
- mpboxes[0].gd.u.boxelements = mparray;
- mpboxes[0].creator = GVBoxCreate;
-
- sgc = 0;
- y2=5;
- si = 0;
-
- slabel[sgc].text = (unichar_t *) _("Menu Name");
- slabel[sgc].text_is_1byte = true;
- sgcd[sgc].gd.label = &slabel[sgc];
- sgcd[sgc].gd.popup_msg = (unichar_t *) _("You may create a script menu containing up to 10 frequently used scripts.\nEach entry in the menu needs both a name to display in the menu and\na script file to execute. The menu name may contain any unicode characters.\nThe button labeled \"...\" will allow you to browse for a script file.");
- sgcd[sgc].gd.pos.x = 8;
- sgcd[sgc].gd.pos.y = y2;
- sgcd[sgc].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- sgcd[sgc++].creator = GLabelCreate;
- sarray[si++] = &sgcd[sgc-1];
-
- slabel[sgc].text = (unichar_t *) _("Script File");
- slabel[sgc].text_is_1byte = true;
- sgcd[sgc].gd.label = &slabel[sgc];
- sgcd[sgc].gd.popup_msg = (unichar_t *) _("You may create a script menu containing up to 10 frequently used scripts\nEach entry in the menu needs both a name to display in the menu and\na script file to execute. The menu name may contain any unicode characters.\nThe button labeled \"...\" will allow you to browse for a script file.");
- sgcd[sgc].gd.pos.x = 110;
- sgcd[sgc].gd.pos.y = y2;
- sgcd[sgc].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- sgcd[sgc++].creator = GLabelCreate;
- sarray[si++] = &sgcd[sgc-1];
- sarray[si++] = GCD_Glue;
- sarray[si++] = NULL;
-
- y2 += 14;
-
- for ( i=0; i<SCRIPT_MENU_MAX; ++i ) {
- sgcd[sgc].gd.pos.x = 8; sgcd[sgc].gd.pos.y = y2;
- sgcd[sgc].gd.flags = gg_visible | gg_enabled | gg_text_xim;
- slabel[sgc].text = script_menu_names[i]==NULL?nullstr:script_menu_names[i];
- sgcd[sgc].gd.label = &slabel[sgc];
- sgcd[sgc].gd.cid = i+CID_ScriptMNameBase;
- sgcd[sgc++].creator = GTextFieldCreate;
- sarray[si++] = &sgcd[sgc-1];
-
- sgcd[sgc].gd.pos.x = 110; sgcd[sgc].gd.pos.y = y2;
- sgcd[sgc].gd.flags = gg_visible | gg_enabled;
- slabel[sgc].text = (unichar_t *) (script_filenames[i]==NULL?"":script_filenames[i]);
- slabel[sgc].text_is_1byte = true;
- sgcd[sgc].gd.label = &slabel[sgc];
- sgcd[sgc].gd.cid = i+CID_ScriptMFileBase;
- sgcd[sgc++].creator = GTextFieldCreate;
- sarray[si++] = &sgcd[sgc-1];
-
- sgcd[sgc].gd.pos.x = 210; sgcd[sgc].gd.pos.y = y2;
- sgcd[sgc].gd.flags = gg_visible | gg_enabled;
- slabel[sgc].text = (unichar_t *) _("...");
- slabel[sgc].text_is_1byte = true;
- sgcd[sgc].gd.label = &slabel[sgc];
- sgcd[sgc].gd.cid = i+CID_ScriptMBrowseBase;
- sgcd[sgc].gd.handle_controlevent = Prefs_ScriptBrowse;
- sgcd[sgc++].creator = GButtonCreate;
- sarray[si++] = &sgcd[sgc-1];
- sarray[si++] = NULL;
-
- y2 += 26;
- }
- sarray[si++] = GCD_Glue; sarray[si++] = GCD_Glue; sarray[si++] = GCD_Glue;
- sarray[si++] = NULL;
- sarray[si++] = NULL;
-
- sboxes[0].gd.flags = gg_enabled|gg_visible;
- sboxes[0].gd.u.boxelements = sarray;
- sboxes[0].creator = GHVBoxCreate;
-
- memset(&mgcd,0,sizeof(mgcd));
- memset(&mgcd,0,sizeof(mgcd));
- memset(&subaspects,'\0',sizeof(subaspects));
- memset(&label,0,sizeof(label));
- memset(&gcd,0,sizeof(gcd));
- memset(&aspects,'\0',sizeof(aspects));
- aspects[0].selected = true;
-
- for ( k=0; visible_prefs_list[k].tab_name!=0; ++k ) {
- pgcd = gcalloc(gcnt[k]+4,sizeof(GGadgetCreateData));
- plabel = gcalloc(gcnt[k]+4,sizeof(GTextInfo));
- hvarray = gcalloc((gcnt[k]+6)*5+2,sizeof(GGadgetCreateData *));
-
- aspects[k].text = (unichar_t *) visible_prefs_list[k].tab_name;
- aspects[k].text_is_1byte = true;
- aspects[k].gcd = &boxes[2*k];
- aspects[k].nesting = visible_prefs_list[k].nest;
- plabels[k] = plabel;
-
- gc = si = 0;
- for ( i=line=0, y=5; visible_prefs_list[k].pl[i].name!=NULL; ++i ) {
- pl = &visible_prefs_list[k].pl[i];
- if ( pl->dontdisplay )
- continue;
- plabel[gc].text = (unichar_t *) _(pl->name);
- plabel[gc].text_is_1byte = true;
- pgcd[gc].gd.label = &plabel[gc];
- pgcd[gc].gd.mnemonic = '\0';
- pgcd[gc].gd.popup_msg = (unichar_t *) _(pl->popup);
- pgcd[gc].gd.pos.x = 8;
- pgcd[gc].gd.pos.y = y + 6;
- pgcd[gc].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- pgcd[gc++].creator = GLabelCreate;
- hvarray[si++] = &pgcd[gc-1];
-
- plabel[gc].text_is_1byte = true;
- pgcd[gc].gd.label = &plabel[gc];
- pgcd[gc].gd.mnemonic = '\0';
- pgcd[gc].gd.popup_msg = (unichar_t *) _(pl->popup);
- pgcd[gc].gd.pos.x = 110;
- pgcd[gc].gd.pos.y = y;
- pgcd[gc].gd.flags = gg_visible | gg_enabled | gg_utf8_popup;
- pgcd[gc].data = pl;
- pgcd[gc].gd.cid = k*CID_PrefsOffset+CID_PrefsBase+i;
- switch ( pl->type ) {
- case pr_bool:
- plabel[gc].text = (unichar_t *) _("On");
- pgcd[gc].gd.pos.y += 3;
- pgcd[gc++].creator = GRadioCreate;
- hvarray[si++] = &pgcd[gc-1];
- pgcd[gc] = pgcd[gc-1];
- pgcd[gc].gd.pos.x += 50;
- pgcd[gc].gd.cid = 0;
- pgcd[gc].gd.label = &plabel[gc];
- plabel[gc].text = (unichar_t *) _("Off");
- plabel[gc].text_is_1byte = true;
- hvarray[si++] = &pgcd[gc];
- hvarray[si++] = GCD_Glue;
- if ( *((int *) pl->val))
- pgcd[gc-1].gd.flags |= gg_cb_on;
- else
- pgcd[gc].gd.flags |= gg_cb_on;
- ++gc;
- y += 22;
- break;
- case pr_int:
- sprintf(buf,"%d", *((int *) pl->val));
- plabel[gc].text = (unichar_t *) copy( buf );
- pgcd[gc++].creator = GTextFieldCreate;
- hvarray[si++] = &pgcd[gc-1];
- hvarray[si++] = GCD_Glue; hvarray[si++] = GCD_Glue;
- y += 26;
- break;
- case pr_real:
- sprintf(buf,"%g", *((float *) pl->val));
- plabel[gc].text = (unichar_t *) copy( buf );
- pgcd[gc++].creator = GTextFieldCreate;
- hvarray[si++] = &pgcd[gc-1];
- hvarray[si++] = GCD_Glue; hvarray[si++] = GCD_Glue;
- y += 26;
- break;
- case pr_encoding:
- pgcd[gc].gd.u.list = GetEncodingTypes();
- pgcd[gc].gd.label = EncodingTypesFindEnc(pgcd[gc].gd.u.list,
- *(Encoding **) pl->val);
- for ( ii=0; pgcd[gc].gd.u.list[ii].text!=NULL ||pgcd[gc].gd.u.list[ii].line; ++ii )
- if ( pgcd[gc].gd.u.list[ii].userdata!=NULL &&
- (strcmp(pgcd[gc].gd.u.list[ii].userdata,"Compacted")==0 ||
- strcmp(pgcd[gc].gd.u.list[ii].userdata,"Original")==0 ))
- pgcd[gc].gd.u.list[ii].disabled = true;
- pgcd[gc].creator = GListFieldCreate;
- pgcd[gc].gd.pos.width = 160;
- if ( pgcd[gc].gd.label==NULL ) pgcd[gc].gd.label = &encodingtypes[0];
- ++gc;
- hvarray[si++] = &pgcd[gc-1];
- hvarray[si++] = GCD_ColSpan; hvarray[si++] = GCD_ColSpan;
- y += 28;
- break;
- case pr_namelist:
- { char **nlnames = AllNamelistNames();
- int cnt;
- GTextInfo *namelistnames;
- for ( cnt=0; nlnames[cnt]!=NULL; ++cnt);
- namelistnames = gcalloc(cnt+1,sizeof(GTextInfo));
- for ( cnt=0; nlnames[cnt]!=NULL; ++cnt) {
- namelistnames[cnt].text = (unichar_t *) nlnames[cnt];
- namelistnames[cnt].text_is_1byte = true;
- if ( strcmp(_((*(NameList **) (pl->val))->title),nlnames[cnt])==0 ) {
- namelistnames[cnt].selected = true;
- pgcd[gc].gd.label = &namelistnames[cnt];
- }
- }
- pgcd[gc].gd.u.list = namelistnames;
- pgcd[gc].creator = GListButtonCreate;
- pgcd[gc].gd.pos.width = 160;
- ++gc;
- hvarray[si++] = &pgcd[gc-1];
- hvarray[si++] = GCD_ColSpan; hvarray[si++] = GCD_ColSpan;
- y += 28;
- } break;
- case pr_string: case pr_file:
- if ( pl->set==SetAutoTraceArgs || ((char **) pl->val)==&mf_args )
- pgcd[gc].gd.pos.width = 160;
- if ( pl->val!=NULL )
- tempstr = *((char **) (pl->val));
- else
- tempstr = (char *) ((pl->get)());
- if ( tempstr!=NULL )
- plabel[gc].text = /* def2u_*/ uc_copy( tempstr );
- else if ( ((char **) pl->val)==&BDFFoundry )
- plabel[gc].text = /* def2u_*/ uc_copy( "FontForge" );
- else
- plabel[gc].text = /* def2u_*/ uc_copy( "" );
- plabel[gc].text_is_1byte = false;
- pgcd[gc++].creator = GTextFieldCreate;
- hvarray[si++] = &pgcd[gc-1];
- if ( pl->type==pr_file ) {
- pgcd[gc] = pgcd[gc-1];
- pgcd[gc-1].gd.pos.width = 140;
- hvarray[si++] = GCD_ColSpan;
- pgcd[gc].gd.pos.x += 145;
- pgcd[gc].gd.cid += CID_PrefsBrowseOffset;
- pgcd[gc].gd.label = &plabel[gc];
- plabel[gc].text = (unichar_t *) "...";
- plabel[gc].text_is_1byte = true;
- pgcd[gc].gd.handle_controlevent = Prefs_BrowseFile;
- pgcd[gc++].creator = GButtonCreate;
- hvarray[si++] = &pgcd[gc-1];
- } else if ( pl->set==SetAutoTraceArgs || ((char **) pl->val)==&mf_args ) {
- hvarray[si++] = GCD_ColSpan;
- hvarray[si++] = GCD_Glue;
- } else {
- hvarray[si++] = GCD_Glue;
- hvarray[si++] = GCD_Glue;
- }
- y += 26;
- if ( pl->val==NULL )
- free(tempstr);
- break;
- }
- ++line;
- hvarray[si++] = NULL;
- }
- if ( visible_prefs_list[k].pl == args_list ) {
- static char *text[] = {
-/* GT: See the long comment at "Property|New" */
-/* GT: This and the next few strings show a limitation of my widget set which */
-/* GT: cannot handle multi-line text labels. These strings should be concatenated */
-/* GT: (after striping off "Prefs|App|") together, translated, and then broken up */
-/* GT: to fit the dialog. There is an extra blank line, not used in English, */
-/* GT: into which your text may extend if needed. */
- N_("Prefs|App|Normally FontForge will find applications by searching for"),
- N_("Prefs|App|them in your PATH environment variable, if you want"),
- N_("Prefs|App|to alter that behavior you may set an environment"),
- N_("Prefs|App|variable giving the full path spec of the application."),
- N_("Prefs|App|FontForge recognizes BROWSER, MF and AUTOTRACE."),
- N_("Prefs|App| "), /* A blank line */
- NULL };
- y += 8;
- for ( i=0; text[i]!=0; ++i ) {
- plabel[gc].text = (unichar_t *) S_(text[i]);
- plabel[gc].text_is_1byte = true;
- pgcd[gc].gd.label = &plabel[gc];
- pgcd[gc].gd.pos.x = 8;
- pgcd[gc].gd.pos.y = y;
- pgcd[gc].gd.flags = gg_visible | gg_enabled;
- pgcd[gc++].creator = GLabelCreate;
- hvarray[si++] = &pgcd[gc-1];
- hvarray[si++] = GCD_ColSpan; hvarray[si++] = GCD_ColSpan;
- hvarray[si++] = NULL;
- y += 12;
- }
- }
- if ( y>y2 ) y2 = y;
- hvarray[si++] = GCD_Glue; hvarray[si++] = GCD_Glue;
- hvarray[si++] = GCD_Glue; hvarray[si++] = GCD_Glue;
- hvarray[si++] = NULL;
- hvarray[si++] = NULL;
- boxes[2*k].gd.flags = gg_enabled|gg_visible;
- boxes[2*k].gd.u.boxelements = hvarray;
- boxes[2*k].creator = GHVBoxCreate;
- }
-
- aspects[k].text = (unichar_t *) _("Script Menu");
- aspects[k].text_is_1byte = true;
- aspects[k++].gcd = sboxes;
-
- subaspects[0].text = (unichar_t *) _("Features");
- subaspects[0].text_is_1byte = true;
- subaspects[0].gcd = mfboxes;
-
- subaspects[1].text = (unichar_t *) _("Mapping");
- subaspects[1].text_is_1byte = true;
- subaspects[1].gcd = mpboxes;
-
- mgcd[0].gd.pos.x = 4; gcd[0].gd.pos.y = 6;
- mgcd[0].gd.pos.width = GDrawPixelsToPoints(NULL,pos.width)-20;
- mgcd[0].gd.pos.height = y2;
- mgcd[0].gd.u.tabs = subaspects;
- mgcd[0].gd.flags = gg_visible | gg_enabled;
- mgcd[0].creator = GTabSetCreate;
-
- aspects[k].text = (unichar_t *) _("Mac");
- aspects[k].text_is_1byte = true;
- aspects[k++].gcd = mgcd;
-
- gc = 0;
-
- gcd[gc].gd.pos.x = gcd[gc].gd.pos.y = 2;
- gcd[gc].gd.pos.width = pos.width-4; gcd[gc].gd.pos.height = pos.height-2;
- gcd[gc].gd.flags = gg_enabled | gg_visible | gg_pos_in_pixels;
- gcd[gc++].creator = GGroupCreate;
-
- gcd[gc].gd.pos.x = 4; gcd[gc].gd.pos.y = 6;
- gcd[gc].gd.pos.width = GDrawPixelsToPoints(NULL,pos.width)-8;
- gcd[gc].gd.pos.height = y2+20+18+4;
- gcd[gc].gd.u.tabs = aspects;
- gcd[gc].gd.flags = gg_visible | gg_enabled | gg_tabset_vert;
- gcd[gc++].creator = GTabSetCreate;
- varray[0] = &gcd[gc-1]; varray[1] = NULL;
-
- y = gcd[gc-1].gd.pos.y+gcd[gc-1].gd.pos.height;
-
- gcd[gc].gd.pos.x = 30-3; gcd[gc].gd.pos.y = y+5-3;
- gcd[gc].gd.pos.width = -1; gcd[gc].gd.pos.height = 0;
- gcd[gc].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[gc].text = (unichar_t *) _("_OK");
- label[gc].text_is_1byte = true;
- label[gc].text_in_resource = true;
- gcd[gc].gd.mnemonic = 'O';
- gcd[gc].gd.label = &label[gc];
- gcd[gc].gd.handle_controlevent = Prefs_Ok;
- gcd[gc++].creator = GButtonCreate;
- harray[0] = GCD_Glue; harray[1] = &gcd[gc-1]; harray[2] = GCD_Glue; harray[3] = GCD_Glue;
-
- gcd[gc].gd.pos.x = -30; gcd[gc].gd.pos.y = gcd[gc-1].gd.pos.y+3;
- gcd[gc].gd.pos.width = -1; gcd[gc].gd.pos.height = 0;
- gcd[gc].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[gc].text = (unichar_t *) _("_Cancel");
- label[gc].text_is_1byte = true;
- label[gc].text_in_resource = true;
- gcd[gc].gd.label = &label[gc];
- gcd[gc].gd.mnemonic = 'C';
- gcd[gc].gd.handle_controlevent = Prefs_Cancel;
- gcd[gc++].creator = GButtonCreate;
- harray[4] = GCD_Glue; harray[5] = &gcd[gc-1]; harray[6] = GCD_Glue; harray[7] = NULL;
-
- memset(mboxes,0,sizeof(mboxes));
- mboxes[2].gd.flags = gg_enabled|gg_visible;
- mboxes[2].gd.u.boxelements = harray;
- mboxes[2].creator = GHBoxCreate;
- varray[2] = &mboxes[2];
- varray[3] = NULL;
- varray[4] = NULL;
-
- mboxes[0].gd.pos.x = mboxes[0].gd.pos.y = 2;
- mboxes[0].gd.flags = gg_enabled|gg_visible;
- mboxes[0].gd.u.boxelements = varray;
- mboxes[0].creator = GHVGroupCreate;
-
- y = GDrawPointsToPixels(NULL,y+37);
- gcd[0].gd.pos.height = y-4;
-
- GGadgetsCreate(gw,mboxes);
- GTextInfoListFree(mfgcd[0].gd.u.list);
- GTextInfoListFree(msgcd[0].gd.u.list);
-
- GHVBoxSetExpandableRow(mboxes[0].ret,0);
- GHVBoxSetExpandableCol(mboxes[2].ret,gb_expandgluesame);
- GHVBoxSetExpandableRow(mfboxes[0].ret,0);
- GHVBoxSetExpandableCol(mfboxes[2].ret,gb_expandgluesame);
- GHVBoxSetExpandableRow(mpboxes[0].ret,0);
- GHVBoxSetExpandableCol(mpboxes[2].ret,gb_expandgluesame);
- GHVBoxSetExpandableRow(sboxes[0].ret,gb_expandglue);
- for ( k=0; k<TOPICS; ++k )
- GHVBoxSetExpandableRow(boxes[2*k].ret,gb_expandglue);
-
- memset(&rq,0,sizeof(rq));
- rq.family_name = monospace;
- rq.point_size = 12;
- rq.weight = 400;
- font = GDrawInstanciateFont(GDrawGetDisplayOfWindow(gw),&rq);
- GGadgetSetFont(mfgcd[0].ret,font);
- GGadgetSetFont(msgcd[0].ret,font);
- GHVBoxFitWindow(mboxes[0].ret);
-
- for ( k=0; visible_prefs_list[k].tab_name!=0; ++k ) for ( gc=0,i=0; visible_prefs_list[k].pl[i].name!=NULL; ++i ) {
- GGadgetCreateData *gcd = aspects[k].gcd[0].gd.u.boxelements[0];
- pl = &visible_prefs_list[k].pl[i];
- if ( pl->dontdisplay )
- continue;
- switch ( pl->type ) {
- case pr_bool:
- ++gc;
- break;
- case pr_encoding: {
- GGadget *g = gcd[gc+1].ret;
- list = GGadgetGetList(g,&llen);
- for ( j=0; j<llen ; ++j ) {
- if ( list[j]->text!=NULL &&
- (void *) (intpt) ( *((int *) pl->val)) == list[j]->userdata )
- list[j]->selected = true;
- else
- list[j]->selected = false;
- }
- if ( gcd[gc+1].gd.u.list!=encodingtypes )
- GTextInfoListFree(gcd[gc+1].gd.u.list);
- } break;
- case pr_namelist:
- free(gcd[gc+1].gd.u.list);
- break;
- case pr_string: case pr_file: case pr_int: case pr_real:
- free(plabels[k][gc+1].text);
- if ( pl->type==pr_file )
- ++gc;
- break;
- }
- gc += 2;
- }
-
- for ( k=0; visible_prefs_list[k].tab_name!=0; ++k ) {
- free(aspects[k].gcd->gd.u.boxelements[0]);
- free(aspects[k].gcd->gd.u.boxelements);
- free(plabels[k]);
- }
-
- GWidgetHidePalettes();
- GDrawSetVisible(gw,true);
- while ( !p.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
-#ifndef LUA_FF_LIB
-void RecentFilesRemember(char *filename) {
- int i;
-
- for ( i=0; i<RECENT_MAX && RecentFiles[i]!=NULL; ++i )
- if ( strcmp(RecentFiles[i],filename)==0 )
- break;
-
- if ( i<RECENT_MAX && RecentFiles[i]!=NULL ) {
- if ( i!=0 ) {
- filename = RecentFiles[i];
- RecentFiles[i] = RecentFiles[0];
- RecentFiles[0] = filename;
- }
- } else {
- if ( RecentFiles[RECENT_MAX-1]!=NULL )
- free( RecentFiles[RECENT_MAX-1]);
- for ( i=RECENT_MAX-1; i>0; --i )
- RecentFiles[i] = RecentFiles[i-1];
- RecentFiles[0] = copy(filename);
- }
- SavePrefs();
-}
-#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinefill.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinefill.c
deleted file mode 100644
index 0334054ac81..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinefill.c
+++ /dev/null
@@ -1,1864 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaedit.h"
-#include <stdio.h>
-#include <string.h>
-#include <ustring.h>
-#include <math.h>
-#include "gdraw.h"
-#include "splinefont.h"
-#include "edgelist.h"
-
-uint32 default_background = 0xffffff; /* white */
-
-static void HintsFree(Hints *h) {
- Hints *hnext;
- for ( ; h!=NULL; h = hnext ) {
- hnext = h->next;
- free(h);
- }
-}
-
-static void _FreeEdgeList(EdgeList *es) {
- int i;
-
- /* edges will be NULL if the user tries to make an enormous bitmap */
- /* if the linear size is bigger than several thousand, we just */
- /* ignore the request */
- if ( es->edges!=NULL ) {
- for ( i=0; i<es->cnt; ++i ) {
- Edge *e, *next;
- for ( e = es->edges[i]; e!=NULL; e = next ) {
- next = e->esnext;
- free(e);
- }
- es->edges[i] = NULL;
- }
- }
-}
-
-void FreeEdges(EdgeList *es) {
- _FreeEdgeList(es);
- free(es->edges);
- free(es->interesting);
- HintsFree(es->hhints);
- HintsFree(es->vhints);
-}
-
-extended IterateSplineSolve(const Spline1D *sp, extended tmin, extended tmax,
- extended sought,double err) {
- extended t, low, high, test;
- Spline1D temp;
- int cnt;
-
- /* Now the closed form CubicSolver can have rounding errors so if we know */
- /* the spline to be monotonic, an iterative approach is more accurate */
-
- temp = *sp;
- temp.d -= sought;
-
- if ( temp.a==0 && temp.b==0 && temp.c!=0 ) {
- t = -temp.d/(extended) temp.c;
- if ( t<0 || t>1 )
-return( -1 );
-return( t );
- }
-
- low = ((temp.a*tmin+temp.b)*tmin+temp.c)*tmin+temp.d;
- high = ((temp.a*tmax+temp.b)*tmax+temp.c)*tmax+temp.d;
- if ( low<err && low>-err )
-return(tmin);
- if ( high<err && high>-err )
-return(tmax);
- if (( low<0 && high>0 ) ||
- ( low>0 && high<0 )) {
-
- for ( cnt=0; cnt<1000; ++cnt ) { /* Avoid impossible error limits */
- t = (tmax+tmin)/2;
- test = ((temp.a*t+temp.b)*t+temp.c)*t+temp.d;
- if ( test>-err && test<err )
-return( t );
- if ( (low<0 && test<0) || (low>0 && test>0) )
- tmin=t;
- else
- tmax = t;
- }
-return( (tmax+tmin)/2 );
- }
-return( -1 );
-}
-
-double TOfNextMajor(Edge *e, EdgeList *es, double sought_m ) {
- /* We want to find t so that Mspline(t) = sought_m */
- /* the curve is monotonic */
- Spline1D *msp = &e->spline->splines[es->major];
- double new_t;
-
- if ( es->is_overlap ) {
-
- /* if we've adjusted the height then we won't be able to find it restricting */
- /* t between [0,1] as we do. So it's a special case. (this is to handle */
- /* hstem hints) */
- if ( e->max_adjusted && sought_m==e->mmax ) {
- e->m_cur = sought_m;
-return( e->up?1.0:0.0 );
- }
-
- new_t = IterateSplineSolve(msp,e->t_mmin,e->t_mmax,(sought_m+es->mmin)/es->scale,.001);
- if ( new_t==-1 )
- IError( "No Solution");
- e->m_cur = (((msp->a*new_t + msp->b)*new_t+msp->c)*new_t + msp->d)*es->scale - es->mmin;
-return( new_t );
- } else {
- Spline *sp = e->spline;
-
- if ( sp->islinear ) {
- new_t = e->t_cur + (sought_m-e->m_cur)/(es->scale * msp->c);
- e->m_cur = (msp->c*new_t + msp->d)*es->scale - es->mmin;
-return( new_t );
- }
- /* if we have a spline that is nearly horizontal at its max. endpoint */
- /* then finding A value of t for which y has the right value isn't good */
- /* enough (at least not when finding intersections) */
- if ( sought_m+1>e->mmax ) {
- e->m_cur = e->mmax;
-return( e->t_mmax );
- }
-
- /* if we've adjusted the height then we won't be able to find it restricting */
- /* t between [0,1] as we do. So it's a special case. (this is to handle */
- /* hstem hints) */
- if ( e->max_adjusted && sought_m==e->mmax ) {
- e->m_cur = sought_m;
-return( e->up?1.0:0.0 );
- }
- new_t = IterateSplineSolve(msp,e->t_mmin,e->t_mmax,(sought_m+es->mmin)/es->scale,.001);
- if ( new_t==-1 )
- IError( "No Solution");
- e->m_cur = (((msp->a*new_t + msp->b)*new_t+msp->c)*new_t + msp->d)*es->scale - es->mmin;
-return( new_t );
- }
-}
-
-static int SlopeLess(Edge *e, Edge *p, int other) {
- Spline1D *osp = &e->spline->splines[other];
- Spline1D *psp = &p->spline->splines[other];
- Spline1D *msp = &e->spline->splines[!other];
- Spline1D *qsp = &p->spline->splines[!other];
- real os = (3*osp->a*e->t_cur+2*osp->b)*e->t_cur+osp->c,
- ps = (3*psp->a*p->t_cur+2*psp->b)*p->t_cur+psp->c;
- real ms = (3*msp->a*e->t_cur+2*msp->b)*e->t_cur+msp->c,
- qs = (3*qsp->a*p->t_cur+2*qsp->b)*p->t_cur+qsp->c;
- if ( ms<.0001 && ms>-.0001 ) ms = 0;
- if ( qs<.0001 && qs>-.0001 ) qs = 0;
- if ( qs==0 ) {
- if ( p->t_cur==1 ) {
- qs = (3*qsp->a*.9999+2*qsp->b)*.9999+qsp->c;
- ps = (3*psp->a*.9999+2*psp->b)*.9999+psp->c;
- } else {
- qs = (3*qsp->a*(p->t_cur+.0001)+2*qsp->b)*(p->t_cur+.0001)+qsp->c;
- ps = (3*psp->a*(p->t_cur+.0001)+2*psp->b)*(p->t_cur+.0001)+psp->c;
- }
- }
- if ( ms==0 ) {
- if ( e->t_cur==1 ) {
- ms = (3*msp->a*.9999+2*msp->b)*.9999+msp->c;
- os = (3*osp->a*.9999+2*osp->b)*.9999+osp->c;
- } else {
- ms = (3*msp->a*(e->t_cur+.0001)+2*msp->b)*(e->t_cur+.0001)+msp->c;
- os = (3*osp->a*(e->t_cur+.0001)+2*osp->b)*(e->t_cur+.0001)+osp->c;
- }
- }
- if ( e->t_cur-e->tmin > e->tmax-e->t_cur ) { os = -os; ms = -ms; }
- if ( p->t_cur-p->tmin > p->tmax-p->t_cur ) { ps = -ps; qs = -qs; }
- if ( ms!=0 && qs!=0 ) { os /= ms; ps /= qs; }
- else if ( ms==0 && qs==0 ) /* Do Nothing */;
- else if ( (ms==0 && os>0) || (qs==0 && ps<0) ) /* Does this make sense? */
-return( false );
- else if ( (ms==0 && os<0) || (qs==0 && ps>0) ) /* Does this make sense? */
-return( true );
-
- if ( os==ps || ms==0 || qs==0 )
-return( e->o_mmax<p->o_mmax );
-
-return( os<ps );
-}
-
-static void AddEdge(EdgeList *es, Spline *sp, real tmin, real tmax ) {
- Edge *e, *pr;
- real m1, m2;
- int mpos;
- Hints *hint;
- Spline1D *msp = &sp->splines[es->major], *osp = &sp->splines[es->other];
-
- e = gcalloc(1,sizeof(Edge));
- e->spline = sp;
-
- m1 = ( ((msp->a*tmin+msp->b)*tmin+msp->c)*tmin + msp->d ) * es->scale;
- m2 = ( ((msp->a*tmax+msp->b)*tmax+msp->c)*tmax + msp->d ) * es->scale;
- if ( m1>m2 ) {
- e->mmin = m2;
- e->t_mmin = tmax;
- e->mmax = m1;
- e->t_mmax = tmin;
- e->up = false;
- } else {
- e->mmax = m2;
- e->t_mmax = tmax;
- e->mmin = m1;
- e->t_mmin = tmin;
- e->up = true;
- }
- if ( RealNear(e->mmin,es->mmin)) e->mmin = es->mmin;
- e->o_mmin = ( ((osp->a*e->t_mmin+osp->b)*e->t_mmin+osp->c)*e->t_mmin + osp->d ) * es->scale;
- e->o_mmax = ( ((osp->a*e->t_mmax+osp->b)*e->t_mmax+osp->c)*e->t_mmax + osp->d ) * es->scale;
- e->mmin -= es->mmin; e->mmax -= es->mmin;
- e->t_cur = e->t_mmin;
- e->o_cur = e->o_mmin;
- e->m_cur = e->mmin;
- e->last_opos = e->last_mpos = -2;
- e->tmin = tmin; e->tmax = tmax;
-
- if ( e->mmin<0 || e->mmin>=e->mmax ) {
- /*IError("Probably not serious, but we've got a zero length spline in AddEdge in %s",es->sc==NULL?<nameless>:es->sc->name);*/
- free(e);
-return;
- }
-
- if ( es->sc!=NULL ) for ( hint=es->hhints; hint!=NULL; hint=hint->next ) {
- if ( hint->adjustb ) {
- if ( e->m_cur>hint->b1 && e->m_cur<hint->b2 ) {
- e->m_cur = e->mmin = hint->ab;
- e->min_adjusted = true;
- } else if ( e->mmax>hint->b1 && e->mmax<hint->b2 ) {
- e->mmax = hint->ab;
- e->max_adjusted = true;
- }
- } else if ( hint->adjuste ) {
- if ( e->m_cur>hint->e1 && e->m_cur<hint->e2 ) {
- e->m_cur = e->mmin = hint->ae;
- e->min_adjusted = true;
- } else if ( e->mmax>hint->e1 && e->mmax<hint->e2 ) {
- e->mmax = hint->ae;
- e->max_adjusted = true;
- }
- }
- }
-
- mpos = (int) ceil(e->m_cur);
- if ( mpos>e->mmax || mpos>=es->cnt ) {
- free(e);
-return;
- }
-
- if ( e->m_cur!=ceil(e->m_cur) ) {
- /* bring the new edge up to its first scan line */
- e->t_cur = TOfNextMajor(e,es,ceil(e->m_cur));
- e->o_cur = ( ((osp->a*e->t_cur+osp->b)*e->t_cur+osp->c)*e->t_cur + osp->d ) * es->scale;
- }
-
- e->before = es->last;
- if ( es->last!=NULL )
- es->last->after = e;
- if ( es->last==NULL )
- es->splinesetfirst = e;
- es->last = e;
-
- if ( es->edges[mpos]==NULL || e->o_cur<es->edges[mpos]->o_cur ||
- (e->o_cur==es->edges[mpos]->o_cur && SlopeLess(e,es->edges[mpos],es->other))) {
- e->esnext = es->edges[mpos];
- es->edges[mpos] = e;
- } else {
- for ( pr=es->edges[mpos]; pr->esnext!=NULL && pr->esnext->o_cur<e->o_cur ;
- pr = pr->esnext );
- /* When two splines share a vertex which is a local minimum, then */
- /* o_cur will be equal for both (to the vertex's o value) and so */
- /* the above code randomly picked one to go first. That screws up */
- /* the overlap code, which wants them properly ordered from the */
- /* start. so look at the end point, nope the end point isn't always */
- /* meaningful, look at the slope... */
- if ( pr->esnext!=NULL && pr->esnext->o_cur==e->o_cur &&
- SlopeLess(e,pr->esnext,es->other)) {
- pr = pr->esnext;
- }
- e->esnext = pr->esnext;
- pr->esnext = e;
- }
- if ( es->interesting ) {
- /* Mark the other end of the spline as interesting */
- es->interesting[(int) ceil(e->mmax)]=1;
- }
-}
-
-static void AddMajorEdge(EdgeList *es, Spline *sp) {
- Edge *e, *pr;
- real m1;
- Spline1D *msp = &sp->splines[es->major], *osp = &sp->splines[es->other];
-
- e = gcalloc(1,sizeof(Edge));
- e->spline = sp;
-
- e->mmin = e->mmax = m1 = msp->d * es->scale - es->mmin;
- e->t_mmin = 0;
- e->t_mmax = 1;
- e->up = false;
- e->o_mmin = osp->d * es->scale;
- e->o_mmax = ( osp->a + osp->b + osp->c + osp->d ) * es->scale;
- if ( e->o_mmin == e->o_mmax ) { /* Just a point? */
- free(e);
-return;
- }
- if ( e->mmin<0 )
- IError("Grg!");
-
- if ( ceil(e->m_cur)>e->mmax ) {
- free(e);
-return;
- }
-
- if ( es->majors==NULL || es->majors->mmin>=m1 ) {
- e->esnext = es->majors;
- es->majors = e;
- } else {
- for ( pr=es->majors; pr->esnext!=NULL && pr->esnext->mmin<m1; pr = pr->esnext );
- e->esnext = pr->esnext;
- pr->esnext = e;
- }
-}
-
-static void AddSpline(EdgeList *es, Spline *sp ) {
- real t1=2, t2=2, t;
- real b2_fourac;
- real fm, tm;
- Spline1D *msp = &sp->splines[es->major], *osp = &sp->splines[es->other];
-
- /* Find the points of extrema on the curve discribing y behavior */
- if ( !RealNear(msp->a,0) ) {
- /* cubic, possibly 2 extrema (possibly none) */
- b2_fourac = 4*msp->b*msp->b - 12*msp->a*msp->c;
- if ( b2_fourac>=0 ) {
- b2_fourac = sqrt(b2_fourac);
- t1 = CheckExtremaForSingleBitErrors(msp,(-2*msp->b - b2_fourac) / (6*msp->a));
- t2 = CheckExtremaForSingleBitErrors(msp,(-2*msp->b + b2_fourac) / (6*msp->a));
- if ( t1>t2 ) { real temp = t1; t1 = t2; t2 = temp; }
- else if ( t1==t2 ) t2 = 2.0;
-
- /* check for curves which have such a small slope they might */
- /* as well be horizontal */
- fm = es->major==1?sp->from->me.y:sp->from->me.x;
- tm = es->major==1?sp->to->me.y:sp->to->me.x;
- if ( fm==tm ) {
- real m1, m2, d1, d2;
- m1 = m2 = fm;
- if ( t1>0 && t1<1 )
- m1 = ((msp->a*t1+msp->b)*t1+msp->c)*t1 + msp->d;
- if ( t2>0 && t2<1 )
- m2 = ((msp->a*t2+msp->b)*t2+msp->c)*t2 + msp->d;
- d1 = (m1-fm)*es->scale;
- d2 = (m2-fm)*es->scale;
- if ( d1>-.5 && d1<.5 && d2>-.5 && d2<.5 ) {
- sp->ishorvert = true;
- if ( es->genmajoredges )
- AddMajorEdge(es,sp);
-return; /* Pretend it's horizontal, ignore it */
- }
- }
- }
- } else if ( !RealNear(msp->b,0) ) {
- /* Quadratic, at most one extremum */
- t1 = -msp->c/(2.0*msp->b);
- } else if ( !RealNear(msp->c,0) ) {
- /* linear, no points of extrema */
- } else {
- sp->ishorvert = true;
- if ( es->genmajoredges )
- AddMajorEdge(es,sp);
-return; /* Horizontal line, ignore it */
- }
-
- if ( RealNear(t1,0)) t1=0;
- if ( RealNear(t1,1)) t1=1;
- if ( RealNear(t2,0)) t2=0;
- if ( RealNear(t2,1)) t2=1;
- if ( RealNear(t1,t2)) t2=2;
- t=0;
- if ( t1>0 && t1<1 ) {
- AddEdge(es,sp,0,t1);
- t = t1;
- }
- if ( t2>0 && t2<1 ) {
- AddEdge(es,sp,t,t2);
- t = t2;
- }
- AddEdge(es,sp,t,1.0);
- if ( es->interesting ) {
- /* Also store up points of extrema in X as interesting (we got the endpoints, just internals now)*/
- extended ot1, ot2;
- int mpos;
- SplineFindExtrema(osp,&ot1,&ot2);
- if ( ot1>0 && ot1<1 ) {
- mpos = (int) ceil( ( ((msp->a*ot1+msp->b)*ot1+msp->c)*ot1+msp->d )*es->scale-es->mmin );
- es->interesting[mpos] = 1;
- }
- if ( ot2>0 && ot2<1 ) {
- mpos = (int) ceil( ( ((msp->a*ot2+msp->b)*ot2+msp->c)*ot2+msp->d )*es->scale-es->mmin );
- es->interesting[mpos] = 1;
- }
- }
-}
-
-void FindEdgesSplineSet(SplinePointList *spl, EdgeList *es) {
- Spline *spline, *first;
-
- for ( ; spl!=NULL; spl = spl->next ) if ( spl->first->prev!=NULL && spl->first->prev->from!=spl->first ) {
- first = NULL;
- es->last = es->splinesetfirst = NULL;
- /* Set so there is no previous point!!! */
- for ( spline = spl->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
- AddSpline(es,spline);
- if ( first==NULL ) first = spline;
- }
- if ( es->last!=NULL ) {
- es->splinesetfirst->before = es->last;
- es->last->after = es->splinesetfirst;
- }
- }
-}
-
-
-#ifndef LUA_FF_LIB
-
-static void FindEdges(SplineChar *sc, EdgeList *es) {
- RefChar *rf;
-
- for ( rf=sc->layers[ly_fore].refs; rf!=NULL; rf = rf->next )
- FindEdgesSplineSet(rf->layers[0].splines,es);
-
- FindEdgesSplineSet(sc->layers[ly_fore].splines,es);
-}
-#endif
-
-Edge *ActiveEdgesInsertNew(EdgeList *es, Edge *active,int i) {
- Edge *apt, *pr, *npt;
-
- for ( pr=NULL, apt=active, npt=es->edges[(int) i]; apt!=NULL && npt!=NULL; ) {
- if ( npt->o_cur<apt->o_cur ) {
- npt->aenext = apt;
- if ( pr==NULL )
- active = npt;
- else
- pr->aenext = npt;
- pr = npt;
- npt = npt->esnext;
- } else {
- pr = apt;
- apt = apt->aenext;
- }
- }
- while ( npt!=NULL ) {
- npt->aenext = NULL;
- if ( pr==NULL )
- active = npt;
- else
- pr->aenext = npt;
- pr = npt;
- npt = npt->esnext;
- }
-return( active );
-}
-
-Edge *ActiveEdgesRefigure(EdgeList *es, Edge *active,real i) {
- Edge *apt, *pr;
- int any;
-
- /* first remove any entry which doesn't intersect the new scan line */
- /* (ie. stopped on last line) */
- for ( pr=NULL, apt=active; apt!=NULL; apt = apt->aenext ) {
- if ( apt->mmax<i ) {
- if ( pr==NULL )
- active = apt->aenext;
- else
- pr->aenext = apt->aenext;
- } else
- pr = apt;
- }
- /* then move the active list to the next line */
- for ( apt=active; apt!=NULL; apt = apt->aenext ) {
- Spline1D *osp = &apt->spline->splines[es->other];
- apt->t_cur = TOfNextMajor(apt,es,i);
- apt->o_cur = ( ((osp->a*apt->t_cur+osp->b)*apt->t_cur+osp->c)*apt->t_cur + osp->d ) * es->scale;
- }
- /* reorder list */
- if ( active!=NULL ) {
- any = true;
- while ( any ) {
- any = false;
- for ( pr=NULL, apt=active; apt->aenext!=NULL; ) {
- if ( apt->o_cur <= apt->aenext->o_cur ) {
- /* still ordered */;
- pr = apt;
- apt = apt->aenext;
- } else if ( pr==NULL ) {
- active = apt->aenext;
- apt->aenext = apt->aenext->aenext;
- active->aenext = apt;
- /* don't need to set any, since this reorder can't disorder the list */
- pr = active;
- } else {
- pr->aenext = apt->aenext;
- apt->aenext = apt->aenext->aenext;
- pr->aenext->aenext = apt;
- any = true;
- pr = pr->aenext;
- }
- }
- }
- }
- /* Insert new nodes */
- active = ActiveEdgesInsertNew(es,active,i);
-return( active );
-}
-
-#ifndef LUA_FF_LIB
-Edge *ActiveEdgesFindStem(Edge *apt, Edge **prev, real i) {
- int cnt=apt->up?1:-1;
- Edge *pr, *e;
-
- for ( pr=apt, e=apt->aenext; e!=NULL && cnt!=0; pr=e, e=e->aenext ) {
- if ( pr->up!=e->up )
- cnt += (e->up?1:-1);
- else if ( (pr->before==e || pr->after==e ) &&
- (( pr->mmax==i && e->mmin==i ) ||
- ( pr->mmin==i && e->mmax==i )) )
- /* This just continues the line and doesn't change count */;
- else
- cnt += (e->up?1:-1);
- }
- /* color a horizontal line that comes out of the last vertex */
- if ( e!=NULL && (e->before==pr || e->after==pr) &&
- (( pr->mmax==i && e->mmin==i ) ||
- ( pr->mmin==i && e->mmax==i )) ) {
- pr = e;
- e = e->aenext;
- } else if ( e!=NULL && ((pr->up && !e->up) || (!pr->up && e->up)) &&
- pr->spline!=e->spline &&
- ((pr->after==e && pr->spline->to->next!=NULL &&
- pr->spline->to->next!=e->spline &&
- pr->spline->to->next->to->next==e->spline ) ||
- (pr->before==e && pr->spline->from->prev!=NULL &&
- pr->spline->from->prev!=e->spline &&
- pr->spline->from->prev->from->prev!=e->spline )) &&
- ((pr->mmax == i && e->mmax==i ) ||
- (pr->mmin == i && e->mmin==i )) ) {
- pr = e;
- }
- *prev = pr;
-return( e );
-}
-
-static int isvstem(EdgeList *es,real stem,int *vval) {
- Hints *hint;
-
- for ( hint=es->vhints; hint!=NULL ; hint=hint->next ) {
- if ( stem>=hint->b1 && stem<=hint->b2 ) {
- *vval = hint->ab;
-return( true );
- } else if ( stem>=hint->e1 && stem<=hint->e2 ) {
- *vval = hint->ae;
-return( true );
- }
- }
-return( false );
-}
-
-static void FillChar(EdgeList *es) {
- Edge *active=NULL, *apt, *pr, *e, *prev;
- int i, k, end, width, oldk;
- uint8 *bpt;
-
- for ( i=0; i<es->cnt; ++i ) {
- active = ActiveEdgesRefigure(es,active,i);
-
- /* process scanline */
- bpt = es->bitmap+((es->cnt-1-i)*es->bytes_per_line);
- for ( apt=active; apt!=NULL; ) {
- e = ActiveEdgesFindStem(apt,&prev,i);
- pr = prev;
- width = rint(pr->o_cur-apt->o_cur);
- if ( width<=0 ) width=1;
- k=rint(apt->o_cur-es->omin);
- if ( k<0 ) k=0;
- end =rint(pr->o_cur-es->omin);
- if ( end-k > width-1 ) {
- int kval = -999999, eval= -999999;
- if ( isvstem(es,apt->o_cur,&kval) )
- k = kval;
- if ( isvstem(es,pr->o_cur,&eval))
- end = eval;
- if ( end-k > width-1 ) {
- if ( k!=kval && (end==eval || (apt->o_cur-es->omin)-k > end-(pr->o_cur-es->omin) ))
- ++k;
- else if ( end!=eval )
- --end;
- }
- }
- oldk = k;
- if ( apt->last_mpos==i-1 || pr->last_mpos==i-1 ) {
- int lx1=apt->last_opos, lx2=pr->last_opos;
- if ( apt->last_mpos!=i-1 ) lx1 = lx2;
- else if ( pr->last_mpos!=i-1 ) lx2 = lx1;
- if ( lx1>lx2 ) { int temp = lx1; lx1=lx2; lx2=temp; }
- if ( lx2<k-1 ) {
- int mid = (lx2+k)/2;
- for ( ; lx2<mid; ++lx2 )
- bpt[(lx2>>3)+es->bytes_per_line] |= (1<<(7-(lx2&7)));
- for ( ; lx2<k; ++lx2 )
- bpt[(lx2>>3)] |= (1<<(7-(lx2&7)));
- } else if ( lx1>end+1 ) {
- int mid = (lx1+end)/2;
- for ( ; lx1<mid; --lx1 )
- bpt[(lx1>>3)+es->bytes_per_line] |= (1<<(7-(lx1&7)));
- for ( ; lx1<end; --lx1 )
- bpt[(lx1>>3)] |= (1<<(7-(lx1&7)));
- }
- }
- for ( ; k<=end; ++k )
- bpt[k>>3] |= (1<<(7-(k&7)));
- apt->last_mpos = pr->last_mpos = i;
- apt->last_opos = oldk;
- pr->last_opos = end;
- apt = e;
- }
- }
-}
-
-static void InitializeHints(SplineChar *sc, EdgeList *es) {
- Hints *hint, *last;
- StemInfo *s;
- real t1, t2;
- int k,end,width;
-
- /* we only care about hstem hints, and only if they fail to cross a */
- /* vertical pixel boundary. If that happens, adjust either the top */
- /* or bottom position so that a boundary forcing is crossed. Any */
- /* vertexes at those points will be similarly adjusted later... */
-
- last = NULL; es->hhints = NULL;
- for ( s=sc->hstem; s!=NULL; s=s->next ) {
- hint = gcalloc(1,sizeof(Hints));
- hint->base = s->start; hint->width = s->width;
- if ( last==NULL ) es->hhints = hint;
- else last->next = hint;
- last = hint;
- hint->adjuste = hint->adjustb = false;
- t1 = hint->base*es->scale -es->mmin;
- t2 = (hint->base+hint->width)*es->scale -es->mmin;
- if ( floor(t1)==floor(t2) && t1!=floor(t1) && t2!=floor(t2) ) {
- if ( t1<t2 ) {
- if ( t1-floor(t1) > ceil(t2)-t2 ) {
- hint->adjuste = true;
- hint->ae = ceil(t2);
- } else {
- hint->adjustb = true;
- hint->ab = floor(t1);
- }
- } else {
- if ( t2-floor(t2) > ceil(t1)-t1 ) {
- hint->adjustb = true;
- hint->ab = ceil(t1);
- } else {
- hint->adjuste = true;
- hint->ae = floor(t2);
- }
- }
- }
- hint->b1 = t1-.2; hint->b2 = t1 + .2;
- hint->e1 = t2-.2; hint->e2 = t2 + .2;
- }
-
- /* Nope. We care about vstems too now, but in a different case */
- last = NULL; es->vhints = NULL;
- for ( s=sc->vstem; s!=NULL; s=s->next ) {
- hint = gcalloc(1,sizeof(Hints));
- hint->base = s->start; hint->width = s->width;
- if ( last==NULL ) es->vhints = hint;
- else last->next = hint;
- last = hint;
- if ( hint->width<0 ) {
- width = -rint(-hint->width*es->scale);
- t1 = (hint->base+hint->width)*es->scale;
- t2 = hint->base*es->scale;
- } else {
- width = rint(hint->width*es->scale);
- t1 = hint->base*es->scale;
- t2 = (hint->base+hint->width)*es->scale;
- }
- k = rint(t1-es->omin); end = rint(t2-es->omin);
- if ( end-k > width-1 )
- if ( end-k > width-1 ) {
- if ( (t1-es->omin)-k > end-(t2-es->omin) )
- ++k;
- else
- --end;
- }
- hint->ab = k; hint->ae = end;
- hint->b1 = t1-.2; hint->b2 = t1 + .2;
- hint->e1 = t2-.2; hint->e2 = t2 + .2;
- }
-}
-#endif
-
-/* After a bitmap has been compressed, it's sizes may not comply with the */
-/* expectations for saving images */
-void BCRegularizeBitmap(BDFChar *bdfc) {
- int bpl =(bdfc->xmax-bdfc->xmin)/8+1;
- int i;
-
- if ( bdfc->bytes_per_line!=bpl ) {
- uint8 *bitmap = galloc(bpl*(bdfc->ymax-bdfc->ymin+1));
- for ( i=0; i<=(bdfc->ymax-bdfc->ymin); ++i )
- memcpy(bitmap+i*bpl,bdfc->bitmap+i*bdfc->bytes_per_line,bpl);
- free(bdfc->bitmap);
- bdfc->bitmap= bitmap;
- bdfc->bytes_per_line = bpl;
- }
-}
-
-void BCRegularizeGreymap(BDFChar *bdfc) {
- int bpl = bdfc->xmax-bdfc->xmin+1;
- int i;
-
- if ( bdfc->bytes_per_line!=bpl ) {
- uint8 *bitmap = galloc(bpl*(bdfc->ymax-bdfc->ymin+1));
- for ( i=0; i<=(bdfc->ymax-bdfc->ymin); ++i )
- memcpy(bitmap+i*bpl,bdfc->bitmap+i*bdfc->bytes_per_line,bpl);
- free(bdfc->bitmap);
- bdfc->bitmap= bitmap;
- bdfc->bytes_per_line = bpl;
- }
-}
-
-void BCCompressBitmap(BDFChar *bdfc) {
- /* Now we may have allocated a bit more than we need to the bitmap */
- /* check to see if there are any unused rows or columns.... */
- int i,j,any, off, last;
-
- /* we can use the same code to lop off rows whether we deal with bytes or bits */
- for ( i=0; i<bdfc->ymax-bdfc->ymin; ++i ) {
- any = 0;
- for ( j=0; j<bdfc->bytes_per_line; ++j )
- if ( bdfc->bitmap[i*bdfc->bytes_per_line+j]!=0 ) any = 1;
- if ( any )
- break;
- }
- if ( i!=0 ) {
- bdfc->ymax -= i;
- memmove(bdfc->bitmap,bdfc->bitmap+i*bdfc->bytes_per_line,(bdfc->ymax-bdfc->ymin+1)*bdfc->bytes_per_line );
- }
-
- for ( i=bdfc->ymax-bdfc->ymin; i>0; --i ) {
- any = 0;
- for ( j=0; j<bdfc->bytes_per_line; ++j )
- if ( bdfc->bitmap[i*bdfc->bytes_per_line+j]!=0 ) any = 1;
- if ( any )
- break;
- }
- if ( i!=bdfc->ymax-bdfc->ymin ) {
- bdfc->ymin += bdfc->ymax-bdfc->ymin-i;
- }
-
- if ( !bdfc->byte_data ) {
- for ( j=0; j<bdfc->xmax-bdfc->xmin; ++j ) {
- any = 0;
- for ( i=0; i<bdfc->ymax-bdfc->ymin+1; ++i )
- if ( bdfc->bitmap[i*bdfc->bytes_per_line+(j>>3)] & (1<<(7-(j&7))) )
- any = 1;
- if ( any )
- break;
- }
- off = j;
- if ( off/8>0 ) {
- for ( i=0; i<bdfc->ymax-bdfc->ymin+1; ++i ) {
- memmove(bdfc->bitmap+i*bdfc->bytes_per_line,
- bdfc->bitmap+i*bdfc->bytes_per_line+off/8,
- bdfc->bytes_per_line-off/8);
- memset(bdfc->bitmap+(i+1)*bdfc->bytes_per_line-off/8,
- 0, off/8);
- }
- bdfc->xmin += off-off%8;
- off %= 8;
- }
- if ( off!=0 ) {
- for ( i=0; i<bdfc->ymax-bdfc->ymin+1; ++i ) {
- last = 0;
- for ( j=bdfc->bytes_per_line-1; j>=0; --j ) {
- int index = i*bdfc->bytes_per_line+j;
- int temp = bdfc->bitmap[index]>>(8-off);
- bdfc->bitmap[index] = (bdfc->bitmap[index]<<off)|last;
- last = temp;
- }
- if ( last!=0 )
- IError("Sigh");
- }
- bdfc->xmin += off;
- }
-
- for ( j=bdfc->xmax-bdfc->xmin; j>0; --j ) {
- any = 0;
- for ( i=0; i<bdfc->ymax-bdfc->ymin+1; ++i )
- if ( bdfc->bitmap[i*bdfc->bytes_per_line+(j>>3)] & (1<<(7-(j&7))) )
- any = 1;
- if ( any )
- break;
- }
- if ( j!=bdfc->xmax+bdfc->xmin ) {
- bdfc->xmax -= bdfc->xmax-bdfc->xmin-j;
- }
- BCRegularizeBitmap(bdfc);
- } else {
- for ( j=0; j<bdfc->xmax-bdfc->xmin; ++j ) {
- any = 0;
- for ( i=0; i<bdfc->ymax-bdfc->ymin+1; ++i )
- if ( bdfc->bitmap[i*bdfc->bytes_per_line+j] != 0 )
- any = 1;
- if ( any )
- break;
- }
- off = j;
- if ( off!=0 ) {
- for ( i=0; i<bdfc->ymax-bdfc->ymin+1; ++i ) {
- memmove(bdfc->bitmap+i*bdfc->bytes_per_line,
- bdfc->bitmap+i*bdfc->bytes_per_line+off,
- bdfc->bytes_per_line-off);
- memset(bdfc->bitmap+(i+1)*bdfc->bytes_per_line-off,
- 0, off);
- }
- bdfc->xmin += off;
- }
-
- for ( j=bdfc->xmax-bdfc->xmin; j>0; --j ) {
- any = 0;
- for ( i=0; i<bdfc->ymax-bdfc->ymin+1; ++i )
- if ( bdfc->bitmap[i*bdfc->bytes_per_line+j] != 0 )
- any = 1;
- if ( any )
- break;
- }
- if ( j!=bdfc->xmax+bdfc->xmin ) {
- bdfc->xmax -= bdfc->xmax-bdfc->xmin-j;
- }
- BCRegularizeGreymap(bdfc);
- }
- if ( bdfc->xmax<bdfc->xmin || bdfc->ymax<bdfc->ymin ) {
- bdfc->ymax = bdfc->ymin-1;
- bdfc->xmax = bdfc->xmin-1;
- }
-}
-
-#ifndef LUA_FF_LIB
-static void Bresenham(uint8 *bytemap,EdgeList *es,int x1,int x2,int y1,int y2,
- int grey) {
- int dx, dy, incr1, incr2, d, x, y;
- int incr3;
- int bytes_per_line = es->bytes_per_line<<3;
- int ymax = es->cnt;
-
- /* We are guarenteed x1<=x2 */
- dx = x2-x1;
- if ( (dy = y1-y2)<0 ) dy=-dy;
- if ( dx>=dy ) {
- d = 2 * dy - dx;
- incr1 = 2*dy;
- incr2 = 2*(dy-dx);
- incr3 = y2>y1 ? 1 : -1;
- x = x1;
- y = y1;
- if ( x>=0 && y>=0 && x<bytes_per_line && y<ymax )
- bytemap[y*bytes_per_line+x] = grey;
- while ( x<x2 ) {
- ++x;
- if ( d<0 )
- d += incr1;
- else {
- y += incr3;
- d += incr2;
- }
- if ( x>=0 && y>=0 && x<bytes_per_line && y<ymax )
- bytemap[y*bytes_per_line+x] = grey;
- }
- } else {
- if ( y1>y2 ) {
- incr1 = y1; y1 = y2; y2 = incr1;
- incr1 = x1; x1 = x2; x2 = incr1;
- }
- d = 2 * dx - dy;
- incr1 = 2*dx;
- incr2 = 2*(dx-dy);
- incr3 = x2>x1 ? 1 : -1;
- x = x1;
- y = y1;
- if ( x>=0 && y>=0 && x<bytes_per_line && y<ymax )
- bytemap[y*bytes_per_line+x] = grey;
- while ( y<y2 ) {
- ++y;
- if ( d<0 )
- d += incr1;
- else {
- x += incr3;
- d += incr2;
- }
- if ( x>=0 && y>=0 && x<bytes_per_line && y<ymax )
- bytemap[y*bytes_per_line+x] = grey;
- }
- }
-}
-
-static void StrokeLine(uint8 *bytemap,IPoint *from, IPoint *to,EdgeList *es,int grey,int width) {
- int x1, x2, y1, y2;
- int dx, dy;
- int i, w2;
-
- x1 = from->x - es->omin;
- x2 = to->x - es->omin;
- if ( (y1 = (es->cnt-1 - (from->y - es->mmin)))<0 ) y1=0;
- if ( (y2 = (es->cnt-1 - (to->y - es->mmin)))<0 ) y2=0;
-
- if ( x1>x2 ) {
- dx = x1; x1 = x2; x2 = dx;
- dy = y1; y1 = y2; y2 = dy;
- }
-
- if ( width>1 ) {
- w2 = width/2;
- dx = x2-x1;
- if ( (dy = y1-y2)<0 ) dy=-dy;
- if ( dy>2*dx ) {
- x1 -= w2; x2 -= w2;
- for ( i=0; i<width; ++i )
- Bresenham(bytemap,es,x1+i,x2+i,y1,y2,grey);
- } else if ( dx>2*dy ) {
- y1 -= w2; y2 -= w2;
- for ( i=0; i<width; ++i )
- Bresenham(bytemap,es,x1,x2,y1+i,y2+i,grey);
- } else if ( y2>y1 ) {
- width *= 1.414; w2 = width/2;
- x1-=w2/2; y1+=w2/2; x2-=w2/2; y2+=w2/2;
- for ( i=0; 2*i<width; ++i ) {
- Bresenham(bytemap,es,x1+i,x2+i,y1-i,y2-i,grey);
- Bresenham(bytemap,es,x1+i+1,x2+i+1,y1-i,y2-i,grey);
- }
- } else {
- width *= 1.414; w2 = width/2;
- x1-=w2/2; y1-=w2/2; x2-=w2/2; y2-=w2/2;
- for ( i=0; 2*i<width; ++i ) {
- Bresenham(bytemap,es,x1+i,x2+i,y1+i,y2+i,grey);
- Bresenham(bytemap,es,x1+i+1,x2+i+1,y1+i,y2+i,grey);
- }
- }
- } else
- Bresenham(bytemap,es,x1,x2,y1,y2,grey);
-}
-
-static void StrokeSS(uint8 *bytemap,EdgeList *es,int width,int grey,SplineSet *ss) {
- LinearApprox *lap;
- LineList *line, *prev;
- Spline *spline, *first;
-
- for ( ; ss!=NULL; ss=ss->next ) {
- first = NULL;
- for ( spline = ss->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
- lap = SplineApproximate(spline,es->scale);
- if ( lap->lines!=NULL ) {
- for ( prev = lap->lines, line=prev->next; line!=NULL; prev = line, line=line->next )
- StrokeLine(bytemap,&prev->here,&line->here,es,grey,width);
- }
- if ( first == NULL ) first = spline;
- }
- }
-}
-
-static void StrokeGlyph(uint8 *bytemap,EdgeList *es,real wid, SplineChar *sc) {
- RefChar *ref;
- int width = rint(wid*es->scale);
-
- StrokeSS(bytemap,es,width,0xff,sc->layers[ly_fore].splines);
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref = ref->next )
- StrokeSS(bytemap,es,width,0xff,ref->layers[0].splines);
-}
-#endif
-
-#ifdef FONTFORGE_CONFIG_TYPE3
-static void StrokePaths(uint8 *bytemap,EdgeList *es,Layer *layer,Layer *alt) {
- uint32 col;
- int width;
- int grey;
-
- if ( layer->stroke_pen.brush.col!=COLOR_INHERITED )
- col = layer->stroke_pen.brush.col;
- else if ( alt!=NULL && alt->stroke_pen.brush.col!=COLOR_INHERITED )
- col = alt->stroke_pen.brush.col;
- else
- col = 0x000000;
- if ( layer->stroke_pen.width!=WIDTH_INHERITED )
- width = rint(layer->stroke_pen.width*layer->stroke_pen.trans[0]*es->scale);
- else if ( alt!=NULL && alt->stroke_pen.width!=WIDTH_INHERITED )
- width = rint(alt->stroke_pen.width*alt->stroke_pen.trans[0]*es->scale);
- else
- width = 1;
- grey = ( ((col>>16)&0xff)*3 + ((col>>8)&0xff)*6 + (col&0xff) )/ 10;
- /* but our internal greymap convention is backwards */
- grey = 255-grey;
-
- StrokeSS(bytemap,es,width,grey,layer->splines);
-}
-
-static void SetByteMapToGrey(uint8 *bytemap,EdgeList *es,Layer *layer,Layer *alt) {
- uint32 col;
- int grey,i,j;
- uint8 *pt, *bpt;
-
- if ( layer->fill_brush.col!=COLOR_INHERITED )
- col = layer->fill_brush.col;
- else if ( alt!=NULL && alt->fill_brush.col!=COLOR_INHERITED )
- col = alt->fill_brush.col;
- else
- col = 0x000000;
- grey = ( ((col>>16)&0xff)*3 + ((col>>8)&0xff)*6 + (col&0xff) )/ 10;
- /* but our internal greymap convention is backwards */
- grey = 255-grey;
-
- for ( i=0; i<es->cnt; ++i ) {
- bpt = es->bitmap + i*es->bytes_per_line;
- pt = bytemap + i*8*es->bytes_per_line;
- for ( j=0; j<8*es->bytes_per_line; ++j ) {
- if ( bpt[j>>3]&(0x80>>(j&7)) )
- pt[j] = grey;
- }
- }
-}
-
-#ifdef FONTFORGE_CONFIG_GTK
-static void FillImages(uint8 *bytemap,EdgeList *es,ImageList *img,Layer *layer,Layer *alt) {
-}
-#else
-static void FillImages(uint8 *bytemap,EdgeList *es,ImageList *img,Layer *layer,Layer *alt) {
- uint32 fillcol, col;
- int grey,i,j,x1,x2,y1,y2,jj,ii;
-
- if ( layer->fill_brush.col!=COLOR_INHERITED )
- fillcol = layer->fill_brush.col;
- else if ( alt!=NULL && alt->fill_brush.col!=COLOR_INHERITED )
- fillcol = alt->fill_brush.col;
- else
- fillcol = 0x000000;
-
- while ( img!=NULL ) {
- struct _GImage *base = img->image->list_len==0?
- img->image->u.image:img->image->u.images[0];
-
- y1 = es->cnt-1 - (img->yoff*es->scale - es->mmin);
- y2 = es->cnt-1 - ((img->yoff-base->height*img->yscale)*es->scale -es->mmin);
- x1 = img->xoff*es->scale - es->omin;
- x2 = (img->xoff+base->width*img->xscale)*es->scale - es->omin;
- if ( y1==y2 || x1==x2 ) /* too small to show */
- continue;
- for ( i=0; i<=y2-y1; ++i ) {
- if ( i+y1<0 || i+y1>=es->cnt ) /* Shouldn't happen, rounding errors might gives us off by 1s though */
- continue;
- ii = i*(base->height-1)/(y2-y1);
- for ( j=0; j<x2-x1; ++j ) {
- if ( j+x1<0 || j+x1>=8*es->bytes_per_line )
- continue;
- jj = j*(base->width-1)/(x2-x1);
- if ( base->image_type==it_true )
- col = ((uint32 *) (base->data + ii*base->bytes_per_line))[jj];
- else if ( base->image_type==it_index ) {
- col = (base->data + ii*base->bytes_per_line)[jj];
- col = base->clut->clut[col];
- } else if ( layer->dofill && base->trans!=-1) { /* Equivalent to imagemask */
- if ( (base->trans==0 && !( (base->data + ii*base->bytes_per_line)[jj>>3]&(0x80>>(jj&7)) ) ) ||
- (base->trans!=0 && ( (base->data + ii*base->bytes_per_line)[jj>>3]&(0x80>>(jj&7)) ) ))
- continue; /* transparent */
- col = fillcol;
- } else {
- int index = 0;
- if ( (base->data + ii*base->bytes_per_line)[jj>>3]&(0x80>>(j&7)) )
- index = 1;
- if ( base->clut!=NULL ) {
- col = base->clut->clut[index];
- if ( col==0xb0b0b0 ) col = 0xffffff;
- } else if ( index==1 )
- col = 0xffffff;
- else
- col = 0x000000;
- }
- grey = ( ((col>>16)&0xff)*3 + ((col>>8)&0xff)*6 + (col&0xff) )/ 10;
- /* but our internal greymap convention is backwards */
- grey = 255-grey;
- bytemap[(i+y1)*8*es->bytes_per_line + j+x1] = grey;
- }
- }
- img = img->next;
- }
-}
-#endif
-
-static void ProcessLayer(uint8 *bytemap,EdgeList *es,Layer *layer,
- Layer *alt) {
- ImageList *img;
-
- if ( !layer->fillfirst && layer->dostroke )
- StrokePaths(bytemap,es,layer,alt);
- if ( layer->dofill ) {
- memset(es->bitmap,0,es->cnt*es->bytes_per_line);
- FindEdgesSplineSet(layer->splines,es);
- FillChar(es);
- SetByteMapToGrey(bytemap,es,layer,alt);
- _FreeEdgeList(es);
- }
- for ( img = layer->images; img!=NULL; img=img->next )
- FillImages(bytemap,es,img,layer,alt);
- if ( layer->fillfirst && layer->dostroke )
- StrokePaths(bytemap,es,layer,alt);
-}
-#endif
-
-#ifndef LUA_FF_LIB
-
-static void FlattenBytemap(EdgeList *es,uint8 *bytemap) {
- int i,j;
- uint8 *bpt, *pt;
-
- memset(es->bitmap,0,es->cnt*es->bytes_per_line);
- for ( i=0; i<es->cnt; ++i ) {
- bpt = es->bitmap + i*es->bytes_per_line;
- pt = bytemap + i*8*es->bytes_per_line;
- for ( j=0; j<8*es->bytes_per_line; ++j )
- if ( pt[j]>=128 )
- bpt[j>>3] |= (0x80>>(j&7));
- }
-}
-
-static int FigureBitmap(EdgeList *es,uint8 *bytemap, int is_aa) {
- if ( is_aa ) {
- free(es->bitmap);
- es->bitmap = bytemap;
-return( 8 );
- } else {
- FlattenBytemap(es,bytemap);
- free(bytemap);
-return( 0 );
- }
-}
-
-
-/* Yes, I really do want a double, even though it will almost always be an */
-/* integer value there are a few cases (fill pattern for charview) where */
-/* I need more precision and the pixelsize itself is largely irrelevant */
-/* (I care about the scale though) */
-static BDFChar *_SplineCharRasterize(SplineChar *sc, double pixelsize, int is_aa) {
- EdgeList es;
- DBounds b;
- BDFChar *bdfc;
- int depth = 0;
-
- if ( sc==NULL )
-return( NULL );
- memset(&es,'\0',sizeof(es));
- if ( sc==NULL ) {
- es.mmin = es.mmax = es.omin = es.omax = 0;
- es.bitmap = gcalloc(1,1);
- es.bytes_per_line = 1;
- is_aa = false;
- } else {
- SplineCharFindBounds(sc,&b);
- es.scale = (pixelsize-.1) / (real) (sc->parent->ascent+sc->parent->descent);
- es.mmin = floor(b.miny*es.scale);
- es.mmax = ceil(b.maxy*es.scale);
- es.omin = b.minx*es.scale;
- es.omax = b.maxx*es.scale;
- es.cnt = (int) (es.mmax-es.mmin) + 1;
- if ( es.cnt<4000 && es.omax-es.omin<4000 && es.cnt>1 ) {
- es.edges = gcalloc(es.cnt,sizeof(Edge *));
- es.sc = sc;
- es.major = 1; es.other = 0;
- es.bytes_per_line = ((int) ceil(es.omax-es.omin) + 8)/8;
- es.bitmap = gcalloc(es.cnt*es.bytes_per_line,1);
-
- InitializeHints(sc,&es);
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( sc->parent->multilayer ) {
- uint8 *bytemap = gcalloc(es.cnt*es.bytes_per_line*8,1);
- int layer, i;
- RefChar *rf;
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- ProcessLayer(bytemap,&es,&sc->layers[layer],NULL);
-
- for ( rf=sc->layers[layer].refs; rf!=NULL; rf = rf->next ) {
- for ( i=0; i<rf->layer_cnt; ++i ) {
- ProcessLayer(bytemap,&es,(Layer *) (&rf->layers[i]),
- &sc->layers[layer]);
- }
- }
- }
- depth = FigureBitmap(&es,bytemap,is_aa);
- } else
-#endif
- if ( sc->parent->strokedfont ) {
- uint8 *bytemap = gcalloc(es.cnt*es.bytes_per_line*8,1);
- StrokeGlyph(bytemap,&es,sc->parent->strokewidth,sc);
- depth = FigureBitmap(&es,bytemap,is_aa);
- } else {
- FindEdges(sc,&es);
- FillChar(&es);
- depth = 0;
- }
- } else {
- /* If they want a bitmap so enormous it threatens our memory */
- /* then just give 'em a blank. It's probably by mistake anyway */
- es.mmin = es.mmax = es.omin = es.omax = 0;
- es.bitmap = gcalloc(1,1);
- es.bytes_per_line = 1;
- }
- }
-
- bdfc = chunkalloc(sizeof(BDFChar));
- bdfc->sc = sc;
- bdfc->xmin = rint(es.omin);
- bdfc->ymin = es.mmin;
- bdfc->xmax = (int) ceil(es.omax-es.omin) + bdfc->xmin;
- bdfc->ymax = es.mmax;
- if ( sc!=NULL ) {
- bdfc->width = rint(sc->width*pixelsize / (real) (sc->parent->ascent+sc->parent->descent));
- bdfc->vwidth = rint(sc->vwidth*pixelsize / (real) (sc->parent->ascent+sc->parent->descent));
- bdfc->orig_pos = sc->orig_pos;
- }
- bdfc->bitmap = es.bitmap;
- bdfc->depth = depth;
- bdfc->bytes_per_line = es.bytes_per_line;
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( depth==8 ) {
- bdfc->byte_data = true;
- bdfc->bytes_per_line *= 8;
- }
-#endif
- BCCompressBitmap(bdfc);
- FreeEdges(&es);
-return( bdfc );
-}
-
-BDFChar *SplineCharRasterize(SplineChar *sc, double pixelsize) {
-return( _SplineCharRasterize(sc,pixelsize,false));
-}
-
-BDFFont *SplineFontToBDFHeader(SplineFont *_sf, int pixelsize, int indicate) {
- BDFFont *bdf = gcalloc(1,sizeof(BDFFont));
- int i;
- real scale;
- char size[40];
- char aa[200];
- int max;
- SplineFont *sf; /* The complexity here is to pick the appropriate subfont of a CID font */
-
- sf = _sf;
- max = sf->glyphcnt;
- for ( i=0; i<_sf->subfontcnt; ++i ) {
- sf = _sf->subfonts[i];
- if ( sf->glyphcnt>max ) max = sf->glyphcnt;
- }
- scale = pixelsize / (real) (sf->ascent+sf->descent);
-
- if ( indicate ) {
- sprintf(size,_("%d pixels"), pixelsize );
- strcpy(aa,_("Generating bitmap font"));
- if ( sf->fontname!=NULL ) {
- strcat(aa,": ");
- strncat(aa,sf->fontname,sizeof(aa)-strlen(aa));
- aa[sizeof(aa)-1] = '\0';
- }
- gwwv_progress_start_indicator(10,_("Rasterizing..."),
- aa,size,sf->glyphcnt,1);
- gwwv_progress_enable_stop(0);
- }
- bdf->sf = _sf;
- bdf->glyphcnt = bdf->glyphmax = max;
- bdf->pixelsize = pixelsize;
- bdf->glyphs = galloc(max*sizeof(BDFChar *));
- bdf->ascent = rint(sf->ascent*scale);
- bdf->descent = pixelsize-bdf->ascent;
- bdf->res = -1;
-return( bdf );
-}
-#endif
-
-#ifndef LUA_FF_LIB
-#if 0
-/* This code was an attempt to do better at rasterizing by making a big bitmap*/
-/* and shrinking it down. It did make curved edges look better, but it made */
-/* straight edges worse. So I don't think it's worth it. */
-static int countsquare(BDFChar *bc, int i, int j, int linear_scale) {
- int ii,jj,jjj, cnt;
- uint8 *bpt;
-
- cnt = 0;
- for ( ii=0; ii<linear_scale; ++ii ) {
- if ( i*linear_scale+ii>bc->ymax-bc->ymin )
- break;
- bpt = bc->bitmap + (i*linear_scale+ii)*bc->bytes_per_line;
- for ( jj=0; jj<linear_scale; ++jj ) {
- jjj = j*linear_scale+jj;
- if ( jjj>bc->xmax-bc->xmin )
- break;
- if ( bpt[jjj>>3]& (1<<(7-(jjj&7))) )
- ++cnt;
- }
- }
-return( cnt );
-}
-
-static int makesleftedge(BDFChar *bc, int i, int j, int linear_scale) {
- int ii,jjj;
- uint8 *bpt;
-
- for ( ii=0; ii<linear_scale; ++ii ) {
- if ( i*linear_scale+ii>bc->ymax-bc->ymin )
-return( false );
- bpt = bc->bitmap + (i*linear_scale+ii)*bc->bytes_per_line;
- jjj = j*linear_scale;
- if ( !( bpt[jjj>>3]& (1<<(7-(jjj&7))) ))
-return( false );
- }
-return( true );
-}
-
-static int makesbottomedge(BDFChar *bc, int i, int j, int linear_scale) {
- int jj,jjj;
- uint8 *bpt;
-
- for ( jj=0; jj<linear_scale; ++jj ) {
- jjj = j*linear_scale+jj;
- if ( jjj>bc->xmax-bc->xmin )
-return( false );
- bpt = bc->bitmap + (i*linear_scale)*bc->bytes_per_line;
- if ( !( bpt[jjj>>3]& (1<<(7-(jjj&7))) ))
-return( false );
- }
-return( true );
-}
-
-static int makesline(BDFChar *bc, int i, int j, int linear_scale) {
- int ii,jj,jjj;
- int across, any, alltop, allbottom; /* alltop is sometimes allleft, and allbottom allright */
- uint8 *bpt;
- /* If we have a line that goes all the way across a square then we want */
- /* to turn on the pixel that corresponds to that square. Exception: */
- /* if that line is on an edge of the square, and the square adjacent to */
- /* it has more pixels, then let the adjacent square get the pixel */
- /* if two squares are essentially equal, choose the top one */
-
- across = alltop = allbottom = true;
- for ( ii=0; ii<linear_scale; ++ii ) {
- if ( i*linear_scale+ii>bc->ymax-bc->ymin ) {
- across = alltop = allbottom = false;
- break;
- }
- bpt = bc->bitmap + (i*linear_scale+ii)*bc->bytes_per_line;
- jjj = j*linear_scale;
- if ( !( bpt[jjj>>3]& (1<<(7-(jjj&7))) ))
- allbottom = 0;
- jjj += linear_scale-1;
- if ( jjj>bc->xmax-bc->xmin )
- alltop = false;
- else if ( !( bpt[jjj>>3]& (1<<(7-(jjj&7))) ))
- alltop = 0;
- any = false;
- for ( jj=0; jj<linear_scale; ++jj ) {
- jjj = j*linear_scale+jj;
- if ( jjj>bc->xmax-bc->xmin )
- break;
- if ( bpt[jjj>>3]& (1<<(7-(jjj&7))) )
- any = true;
- }
- if ( !any )
- across = false;
- }
- if ( across ) {
- if ( (!alltop && !allbottom ) || (alltop && allbottom))
-return( true );
- if ( allbottom ) {
- if ( j==0 )
-return( true );
- if ( countsquare(bc,i,j-1,linear_scale)>=linear_scale*linear_scale/2 )
-return( false );
-return( true );
- }
- if ( alltop ) {
- if ( j==(bc->xmax-bc->xmin)/linear_scale )
-return( true );
- if ( countsquare(bc,i,j+1,linear_scale)>=linear_scale*linear_scale/2 )
-return( false );
- if ( makesleftedge(bc,i,j+1,linear_scale))
-return( false );
-return( true );
- }
- }
-
- /* now the other dimension */
- across = alltop = allbottom = true;
- for ( jj=0; jj<linear_scale; ++jj ) {
- jjj = j*linear_scale+jj;
- if ( jjj>bc->xmax-bc->xmin ) {
- across = alltop = allbottom = false;
- break;
- }
- bpt = bc->bitmap + (i*linear_scale)*bc->bytes_per_line;
- if ( !( bpt[jjj>>3]& (1<<(7-(jjj&7))) ))
- allbottom = 0;
- if ( i*linear_scale + linear_scale-1>bc->ymax-bc->ymin )
- alltop = 0;
- else {
- bpt = bc->bitmap + (i*linear_scale+linear_scale-1)*bc->bytes_per_line;
- if ( !( bpt[jjj>>3]& (1<<(7-(jjj&7))) ))
- alltop = 0;
- }
- any = false;
- for ( ii=0; ii<linear_scale; ++ii ) {
- if ( (i*linear_scale+ii)>bc->xmax-bc->xmin )
- break;
- bpt = bc->bitmap + (i*linear_scale+ii)*bc->bytes_per_line;
- if ( bpt[jjj>>3]& (1<<(7-(jjj&7))) )
- any = true;
- }
- if ( !any )
- across = false;
- }
- if ( across ) {
- if ( (!alltop && !allbottom ) || (alltop && allbottom))
-return( true );
- if ( allbottom ) {
- if ( i==0 )
-return( true );
- if ( countsquare(bc,i-1,j,linear_scale)>=linear_scale*linear_scale/2 )
-return( false );
-return( true );
- }
- if ( alltop ) {
- if ( i==(bc->ymax-bc->ymin)/linear_scale )
-return( true );
- if ( countsquare(bc,i+1,j,linear_scale)>=linear_scale*linear_scale/2 )
-return( false );
- if ( makesbottomedge(bc,i+1,j,linear_scale))
-return( false );
-return( true );
- }
- }
-
-return( false ); /* No line */
-}
-
-/* Make a much larger bitmap than we need, and then shrink it */
-static void BDFCShrinkBitmap(BDFChar *bc, int linear_scale) {
- BDFChar new;
- int i,j, mid = linear_scale*linear_scale/2;
- int cnt;
- uint8 *pt;
-
- if ( bc==NULL )
-return;
-
- memset(&new,'\0',sizeof(new));
- new.xmin = floor( ((real) bc->xmin)/linear_scale );
- new.ymin = floor( ((real) bc->ymin)/linear_scale );
- new.xmax = new.xmin + (bc->xmax-bc->xmin+linear_scale-1)/linear_scale;
- new.ymax = new.ymin + (bc->ymax-bc->ymin+linear_scale-1)/linear_scale;
- new.width = rint( ((real) bc->width)/linear_scale );
-
- new.bytes_per_line = (new.xmax-new.xmin+1);
- new.enc = bc->enc;
- new.sc = bc->sc;
- new.byte_data = true;
- new.bitmap = gcalloc( (new.ymax-new.ymin+1) * new.bytes_per_line, sizeof(uint8));
- for ( i=0; i<=new.ymax-new.ymin; ++i ) {
- pt = new.bitmap + i*new.bytes_per_line;
- for ( j=0; j<=new.xmax-new.xmin; ++j ) {
- cnt = countsquare(bc,i,j,linear_scale);
- if ( cnt>=mid )
- pt[j>>3] |= (1<<(7-(j&7)));
- else if ( cnt>=linear_scale && makesline(bc,i,j,linear_scale))
- pt[j>>3] |= (1<<(7-(j&7)));
- }
- }
- free(bc->bitmap);
- *bc = new;
-}
-
-BDFChar *SplineCharSlowerRasterize(SplineChar *sc, int pixelsize) {
- BDFChar *bc;
- int linear_scale = 1;
-
- if ( pixelsize<=30 )
- linear_scale = 4;
- else if ( pixelsize<=40 )
- linear_scale = 3;
- else if ( pixelsize<=60 )
- linear_scale = 2;
-
- bc = SplineCharRasterize(sc,pixelsize*linear_scale);
- if ( linear_scale==1 )
-return( bc );
- BDFCShrinkBitmap(bc,linear_scale);
-return( bc );
-}
-
-BDFFont *SplineFontRasterize(SplineFont *_sf, int pixelsize, int indicate, int slower) {
-#else
-BDFFont *SplineFontRasterize(SplineFont *_sf, int pixelsize, int indicate) {
-#endif
- BDFFont *bdf = SplineFontToBDFHeader(_sf,pixelsize,indicate);
- int i,k;
- SplineFont *sf=_sf; /* The complexity here is to pick the appropriate subfont of a CID font */
-
- for ( i=0; i<bdf->glyphcnt; ++i ) {
- if ( _sf->subfontcnt!=0 ) {
- for ( k=0; k<_sf->subfontcnt; ++k ) if ( _sf->subfonts[k]->glyphcnt>i ) {
- sf = _sf->subfonts[k];
- if ( SCWorthOutputting(sf->glyphs[i]))
- break;
- }
- }
-#if 0
- bdf->glyphs[i] = slower ? SplineCharSlowerRasterize(sf->glyphs[i],pixelsize):
- SplineCharRasterize(sf->glyphs[i],pixelsize);
-#else
- bdf->glyphs[i] = SplineCharRasterize(sf->glyphs[i],pixelsize);
-#endif
-#if defined(FONTFORGE_CONFIG_GDRAW)
- if ( indicate ) gwwv_progress_next();
-#elif defined(FONTFORGE_CONFIG_GTK)
- if ( indicate ) gwwv_progress_next();
-#endif
- }
-#if defined(FONTFORGE_CONFIG_GDRAW)
- if ( indicate ) gwwv_progress_end_indicator();
-#elif defined(FONTFORGE_CONFIG_GTK)
- if ( indicate ) gwwv_progress_end_indicator();
-#endif
-return( bdf );
-}
-
-void BDFCAntiAlias(BDFChar *bc, int linear_scale) {
- BDFChar new;
- int i,j, max = linear_scale*linear_scale-1;
- uint8 *bpt, *pt;
-
- if ( bc==NULL )
-return;
-
- memset(&new,'\0',sizeof(new));
- new.xmin = floor( ((real) bc->xmin)/linear_scale );
- new.ymin = floor( ((real) bc->ymin)/linear_scale );
- new.xmax = new.xmin + (bc->xmax-bc->xmin+linear_scale-1)/linear_scale;
- new.ymax = new.ymin + (bc->ymax-bc->ymin+linear_scale-1)/linear_scale;
- new.width = rint( ((real) bc->width)/linear_scale );
-
- new.bytes_per_line = (new.xmax-new.xmin+1);
- new.orig_pos = bc->orig_pos;
- new.sc = bc->sc;
- new.byte_data = true;
- new.depth = max==3 ? 2 : max==15 ? 4 : 8;
- new.bitmap = gcalloc( (new.ymax-new.ymin+1) * new.bytes_per_line, sizeof(uint8));
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( bc->depth>1 ) {
- uint32 *sum = gcalloc(new.bytes_per_line,sizeof(uint32));
- for ( i=0; i<=bc->ymax-bc->ymin; ++i ) {
- bpt = bc->bitmap + i*bc->bytes_per_line;
- for ( j=0; j<=bc->xmax-bc->xmin; ++j ) {
- sum[j/linear_scale] += bpt[j];
- }
- if ( (i+1)%linear_scale==0 ) {
- pt = new.bitmap + (i/linear_scale)*new.bytes_per_line;
- for ( j=(bc->xmax-bc->xmin)/linear_scale-1; j>=0 ; --j ) {
- int val = rint( (sum[j]+128)/255 );
- if ( val>max ) val = max;
- pt[j] = val;
- }
- memset(sum,0,new.bytes_per_line*sizeof(uint32));
- }
- }
- } else {
-#else
- {
-#endif
- for ( i=0; i<=bc->ymax-bc->ymin; ++i ) {
- bpt = bc->bitmap + i*bc->bytes_per_line;
- pt = new.bitmap + (i/linear_scale)*new.bytes_per_line;
- for ( j=0; j<=bc->xmax-bc->xmin; ++j ) {
- if ( bpt[(j>>3)] & (1<<(7-(j&7))) )
- /* we can get values between 0..2^n we want values between 0..(2^n-1) */
- if ( pt[ j/linear_scale ]!=max )
- ++pt[ j/linear_scale ];
- }
- }
- }
- free(bc->bitmap);
- *bc = new;
-}
-#endif
-
-#ifndef LUA_FF_LIB
-GClut *_BDFClut(int linear_scale) {
- int scale = linear_scale*linear_scale, i;
- Color bg = default_background;
- int bgr=((bg>>16)&0xff), bgg=((bg>>8)&0xff), bgb= (bg&0xff);
- GClut *clut;
-
- clut = gcalloc(1,sizeof(GClut));
- clut->clut_len = scale;
- clut->is_grey = (bgr==bgg && bgb==bgr);
- clut->trans_index = -1;
- for ( i=0; i<scale; ++i ) {
- clut->clut[i] =
- COLOR_CREATE( bgr- (i*(bgr))/(scale-1),
- bgg- (i*(bgg))/(scale-1),
- bgb- (i*(bgb))/(scale-1));
- }
- clut->clut[scale-1] = 0; /* avoid rounding errors */
-return( clut );
-}
-
-void BDFClut(BDFFont *bdf, int linear_scale) {
- bdf->clut = _BDFClut(linear_scale);
-}
-#endif
-
-int BDFDepth(BDFFont *bdf) {
- if ( bdf->clut==NULL )
-return( 1 );
-
-return( bdf->clut->clut_len==256 ? 8 :
- bdf->clut->clut_len==16 ? 4 : 2);
-}
-
-#ifndef LUA_FF_LIB
-BDFChar *SplineCharAntiAlias(SplineChar *sc, int pixelsize, int linear_scale) {
- BDFChar *bc;
-
- bc = _SplineCharRasterize(sc,pixelsize*linear_scale,true);
- if ( linear_scale!=1 )
- BDFCAntiAlias(bc,linear_scale);
- BCCompressBitmap(bc);
-return( bc );
-}
-
-BDFFont *SplineFontAntiAlias(SplineFont *_sf, int pixelsize, int linear_scale) {
- BDFFont *bdf;
- int i,k;
- real scale;
- char size[40];
- char aa[200];
- int max;
- SplineFont *sf; /* The complexity here is to pick the appropriate subfont of a CID font */
-
- if ( linear_scale==1 )
-return( SplineFontRasterize(_sf,pixelsize,true));
-
- bdf = gcalloc(1,sizeof(BDFFont));
- sf = _sf;
- max = sf->glyphcnt;
- for ( i=0; i<_sf->subfontcnt; ++i ) {
- sf = _sf->subfonts[i];
- if ( sf->glyphcnt>max ) max = sf->glyphcnt;
- }
- scale = pixelsize / (real) (sf->ascent+sf->descent);
-
- sprintf(size,_("%d pixels"), pixelsize );
- strcpy(aa,_("Generating anti-alias font"));
- if ( sf->fontname!=NULL ) {
- strcat(aa,": ");
- strncat(aa,sf->fontname,sizeof(aa)-strlen(aa));
- aa[sizeof(aa)-1] = '\0';
- }
- gwwv_progress_start_indicator(10,_("Rasterizing..."),
- aa,size,sf->glyphcnt,1);
- gwwv_progress_enable_stop(0);
-
- if ( linear_scale>16 ) linear_scale = 16; /* can't deal with more than 256 levels of grey */
- if ( linear_scale<=1 ) linear_scale = 2;
- bdf->sf = _sf;
- bdf->glyphcnt = bdf->glyphmax = max;
- bdf->pixelsize = pixelsize;
- bdf->glyphs = galloc(max*sizeof(BDFChar *));
- bdf->ascent = rint(sf->ascent*scale);
- bdf->descent = pixelsize-bdf->ascent;
- bdf->res = -1;
- for ( i=0; i<max; ++i ) {
- if ( _sf->subfontcnt!=0 ) {
- for ( k=0; k<_sf->subfontcnt; ++k ) if ( _sf->subfonts[k]->glyphcnt>i ) {
- sf = _sf->subfonts[k];
- if ( SCWorthOutputting(sf->glyphs[i]))
- break;
- }
- scale = pixelsize / (real) (sf->ascent+sf->descent);
- }
- bdf->glyphs[i] = SplineCharRasterize(sf->glyphs[i],pixelsize*linear_scale);
- BDFCAntiAlias(bdf->glyphs[i],linear_scale);
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_progress_next();
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_next();
-#endif
- }
- BDFClut(bdf,linear_scale);
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_progress_end_indicator();
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_end_indicator();
-#endif
-return( bdf );
-}
-
-
-BDFChar *BDFPieceMeal(BDFFont *bdf, int index) {
- SplineChar *sc;
- extern int use_freetype_to_rasterize_fv;
-
- if ( index==-1 )
-return( NULL );
- if ( bdf->glyphcnt<bdf->sf->glyphcnt ) {
- if ( bdf->glyphmax<bdf->sf->glyphcnt )
- bdf->glyphs = grealloc(bdf->glyphs,(bdf->glyphmax = bdf->sf->glyphmax)*sizeof(BDFChar *));
- memset(bdf->glyphs+bdf->glyphcnt,0,(bdf->glyphmax-bdf->glyphcnt)*sizeof(SplineChar *));
- bdf->glyphcnt = bdf->sf->glyphcnt;
- }
- sc = bdf->sf->glyphs[index];
- if ( sc==NULL )
-return(NULL);
- if ( bdf->freetype_context )
-#ifndef LUA_FF_LIB
- bdf->glyphs[index] = SplineCharFreeTypeRasterize(bdf->freetype_context,
- sc->orig_pos,bdf->truesize,bdf->clut?8:1);
-#endif
- ;
- else {
-#ifndef LUA_FF_LIB
- if ( use_freetype_to_rasterize_fv && !sc->parent->multilayer &&
- !sc->parent->strokedfont )
- bdf->glyphs[index] = SplineCharFreeTypeRasterizeNoHints(sc,
- bdf->truesize,bdf->clut?4:1);
- else
-#endif
- bdf->glyphs[index] = NULL;
- if ( bdf->glyphs[index]==NULL ) {
- if ( bdf->clut )
- bdf->glyphs[index] = SplineCharAntiAlias(sc,bdf->truesize,4);
- else
- bdf->glyphs[index] = SplineCharRasterize(sc,bdf->truesize);
- }
- }
-return( bdf->glyphs[index] );
-}
-
-/* Piecemeal fonts are only used as the display font in the fontview */
-/* as such they are simple fonts (ie. we only display the current cid subfont) */
-BDFFont *SplineFontPieceMeal(SplineFont *sf,int pixelsize,int flags,void *ftc) {
- BDFFont *bdf = gcalloc(1,sizeof(BDFFont));
- real scale;
- int truesize = pixelsize;
-
- if ( flags&pf_bbsized ) {
- DBounds bb;
- SplineFontQuickConservativeBounds(sf,&bb);
- if ( bb.maxy<sf->ascent ) bb.maxy = sf->ascent;
- if ( bb.miny>-sf->descent ) bb.miny = -sf->descent;
- /* Ignore absurd values */
- if ( bb.maxy>10*(sf->ascent+sf->descent) ) bb.maxy = 2*(sf->ascent+sf->descent);
- if ( bb.maxx>10*(sf->ascent+sf->descent) ) bb.maxx = 2*(sf->ascent+sf->descent);
- if ( bb.miny<-10*(sf->ascent+sf->descent) ) bb.miny = -2*(sf->ascent+sf->descent);
- if ( bb.minx<-10*(sf->ascent+sf->descent) ) bb.minx = -2*(sf->ascent+sf->descent);
- scale = pixelsize/ (real) (bb.maxy-bb.miny);
- bdf->ascent = rint(bb.maxy*scale);
- truesize = rint( (sf->ascent+sf->descent)*scale );
- } else {
- scale = pixelsize / (real) (sf->ascent+sf->descent);
- bdf->ascent = rint(sf->ascent*scale);
- }
-
- bdf->sf = sf;
- bdf->glyphcnt = bdf->glyphmax = sf->glyphcnt;
- bdf->pixelsize = pixelsize;
- bdf->glyphs = gcalloc(sf->glyphcnt,sizeof(BDFChar *));
- bdf->descent = pixelsize-bdf->ascent;
- bdf->piecemeal = true;
- bdf->bbsized = (flags&pf_bbsized)?1:0;
- bdf->res = -1;
- bdf->truesize = truesize;
- bdf->freetype_context = ftc;
- if ( ftc && (flags&pf_antialias) )
- BDFClut(bdf,16);
- else if ( flags&pf_antialias )
- BDFClut(bdf,4);
-return( bdf );
-}
-#endif
-
-void BDFCharFree(BDFChar *bdfc) {
- if ( bdfc==NULL )
-return;
- free(bdfc->bitmap);
- chunkfree(bdfc,sizeof(BDFChar));
-}
-
-void BDFPropsFree(BDFFont *bdf) {
- int i;
-
- for ( i=0; i<bdf->prop_cnt; ++i ) {
- free(bdf->props[i].name);
- if ( (bdf->props[i].type&~prt_property)==prt_string ||
- (bdf->props[i].type&~prt_property)==prt_atom )
- free(bdf->props[i].u.str);
- }
- free( bdf->props );
-}
-
-void BDFFontFree(BDFFont *bdf) {
- int i;
-
- if ( bdf==NULL )
-return;
- for ( i=0; i<bdf->glyphcnt; ++i )
- BDFCharFree(bdf->glyphs[i]);
- free(bdf->glyphs);
- if ( bdf->clut!=NULL )
- free(bdf->clut);
-#ifndef LUA_FF_LIB
- if ( bdf->freetype_context!=NULL )
- FreeTypeFreeContext(bdf->freetype_context);
-#endif
- BDFPropsFree(bdf);
- free( bdf->foundry );
- free(bdf);
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamp.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamp.c
deleted file mode 100644
index b34fc8db12b..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamp.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <time.h>
-
-const time_t source_modtime = 1181260092;
-const char *source_modtime_str = "16:48 7-Jun-2007";
-const char *source_version_str = "20070607";
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamper.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamper.c
deleted file mode 100644
index a476bb837bc..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stamper.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <stdio.h>
-#include <time.h>
-
-static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
- "Aug", "Sep", "Oct", "Nov", "Dec", NULL };
-int main() {
- time_t now;
- struct tm *tm;
-
- time(&now);
- tm = localtime(&now);
- printf( "#include <time.h>\n\n" );
- printf( "const time_t source_modtime = %ld;\n", now);
- printf( "const char *source_modtime_str = \"%02d:%02d %d-%s-%d\";\n",
- tm->tm_hour, tm->tm_min,
- tm->tm_mday, months[tm->tm_mon], tm->tm_year+1900 );
- printf( "const char *source_version_str = \"%04d%02d%02d\";\n",
- tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday );
-return( 0 );
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/start.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/start.c
deleted file mode 100644
index 97e1c948661..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/start.c
+++ /dev/null
@@ -1,935 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include <gfile.h>
-#ifdef FONTFORGE_CONFIG_GDRAW
-# include <gresource.h>
-# include <ustring.h>
-#elif defined( FONTFORGE_CONFIG_GTK )
-# include "interface.h"
-# include "callbacks.h"
-# include "support.h"
-#endif
-#include <time.h>
-#include <sys/time.h>
-#include <locale.h>
-#include <unistd.h>
-#if !defined(_NO_LIBUNINAMESLIST) && !defined(_STATIC_LIBUNINAMESLIST) && !defined(NODYNAMIC)
-# include <dynamic.h>
-#endif
-#ifdef __Mac
-# include <stdlib.h> /* getenv,setenv */
-#endif
-
-int32 unicode_from_adobestd[256] = {0}; /* fix 64bit aligns */
-
-struct lconv localeinfo;
-char *coord_sep = ","; /* Not part of locale data */
-const struct unicode_nameannot * const *const *_UnicodeNameAnnot = NULL;
-
-#ifndef LUA_FF_LIB
-static void initadobeenc(void) {
- int i,j;
-
- for ( i=0; i<0x100; ++i ) {
- if ( strcmp(AdobeStandardEncoding[i],".notdef")==0 )
- unicode_from_adobestd[i] = 0xfffd;
- else {
- j = UniFromName(AdobeStandardEncoding[i],ui_none,&custom);
- if ( j==-1 ) j = 0xfffd;
- unicode_from_adobestd[i] = j;
- }
- }
-}
-
-static void inituninameannot(void) {
-#if 1 || _NO_LIBUNINAMESLIST
- _UnicodeNameAnnot = NULL;
-#elif defined(_STATIC_LIBUNINAMESLIST) || defined(NODYNAMIC)
- extern const struct unicode_nameannot * const * const UnicodeNameAnnot[];
- _UnicodeNameAnnot = UnicodeNameAnnot;
-#else
- DL_CONST void *libuninames=NULL;
- const char *loc = getenv("LC_ALL");
-# ifdef LIBDIR
- char full[1024], buf[100];
-# else
- char buf[100];
-#endif
- int i;
-
- if ( loc==NULL ) loc = getenv("LC_MESSAGES");
- if ( loc==NULL ) loc = getenv("LANG");
- for ( i=0; i<4; ++i ) {
- strcpy(buf,"libuninameslist-");
- if ( i==3 )
- buf[strlen(buf)-1] = '\0';
- /* Use the default name */
- else if ( i==2 ) {
- if ( loc==NULL || strlen( loc )<2 )
- continue;
- strncat(buf,loc,2);
- } else if ( i==1 ) {
- if ( loc==NULL || strlen( loc )<5 )
- continue;
- strncat(buf,loc,5);
- } else if ( i==0 ) {
- if ( loc==NULL || strlen( loc )<6 )
- continue;
- strcat(buf,loc);
- }
- strcat(buf, SO_EXT );
-
-# ifdef LIBDIR
-# if !defined(_NO_SNPRINTF) && !defined(VMS)
- snprintf( full, sizeof(full), "%s/%s", LIBDIR, buf );
-# else
- sprintf( full, "%s/%s", LIBDIR, buf );
-# endif
- libuninames = dlopen( full,RTLD_LAZY);
-# endif
- if ( libuninames==NULL )
- libuninames = dlopen( buf,RTLD_LAZY);
- if ( libuninames!=NULL ) {
- _UnicodeNameAnnot = dlsym(libuninames,"UnicodeNameAnnot");
-return;
- }
- }
-#endif
-}
-#endif
-
-void doversion(void) {
- extern const char *source_version_str;
-#ifdef FONTFORGE_CONFIG_TYPE3
- printf( "fontforge %s-ML\n", source_version_str );
-#else
- printf( "fontforge %s\n", source_version_str );
-#endif
-exit(0);
-}
-
-#ifndef LUA_FF_LIB
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static void _dousage(void) {
- printf( "fontforge [options] [fontfiles]\n" );
- printf( "\t-new\t\t\t (creates a new font)\n" );
-#if HANYANG
- printf( "\t-newkorean\t\t (creates a new korean font)\n" );
-#endif
- printf( "\t-recover none|auto|clean (control error recovery)\n" );
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- printf( "\t-nosplash\t\t (no splash screen)\n" );
-#endif
- printf( "\t-display display-name\t (sets the X display)\n" );
-#ifdef FONTFORGE_CONFIG_GDRAW
- printf( "\t-depth val\t\t (sets the display depth if possible)\n" );
- printf( "\t-vc val\t\t\t (sets the visual class if possible)\n" );
- printf( "\t-cmap current|copy|private\t (sets the type of colormap)\n" );
- printf( "\t-dontopenxdevices\t (in case that fails)\n" );
- printf( "\t-sync\t\t\t (syncs the display, debugging)\n" );
- printf( "\t-keyboard ibm|mac|sun|ppc (generates appropriate hotkeys in menus)\n" );
-#endif
-#if MyMemory
- printf( "\t-memory\t\t\t (turns on memory checks, debugging)\n" );
-#endif
- printf( "\t-usage\t\t\t (displays this message, and exits)\n" );
- printf( "\t-help\t\t\t (displays this message, invokes a browser)\n\t\t\t\t (Using the BROWSER environment variable)\n" );
- printf( "\t-version\t\t (prints the version of fontforge and exits)\n" );
- printf( "\t-lang=py\t\t use python for scripts\n" );
- printf( "\t-lang=ff\t\t use fontforge's legacy scripting language\n" );
- printf( "\t-script scriptfile\t (executes scriptfile)\n" );
- printf( "\t\tmust be the first option (or follow -lang).\n" );
- printf( "\t\tAll others passed to scriptfile.\n" );
- printf( "\t-dry scriptfile\t (syntax checks scriptfile)\n" );
- printf( "\t\tmust be the first option. All others passed to scriptfile.\n" );
- printf( "\t-c script-string\t (executes argument as scripting cmds)\n" );
- printf( "\t\tmust be the first option. All others passed to the script.\n" );
- printf( "\n" );
- printf( "FontForge will read postscript (pfa, pfb, ps, cid), opentype (otf),\n" );
- printf( "\ttruetype (ttf,ttc), macintosh resource fonts (dfont,bin,hqx),\n" );
- printf( "\tand bdf and pcf fonts. It will also read it's own format --\n" );
- printf( "\tsfd files.\n" );
- printf( "If no fontfiles are specified (and -new is not either and there's nothing\n" );
- printf( "\tto recover) then fontforge will produce an open font dlg.\n" );
- printf( "If a scriptfile is specified then FontForge will not open the X display\n" );
- printf( "\tnor will it process any additional arguments. It will execute the\n" );
- printf( "\tscriptfile and give it any remaining arguments\n" );
- printf( "If the first argument is an executable filename, and that file's first\n" );
- printf( "\tline contains \"fontforge\" then it will be treated as a scriptfile.\n\n" );
- printf( "For more information see:\n\thttp://fontforge.sourceforge.net/\n" );
- printf( "Send bug reports to:\tfontforge-devel@lists.sourceforge.net\n" );
-}
-
-static void dousage(void) {
- _dousage();
-exit(0);
-}
-
-static void dohelp(void) {
- _dousage();
- help("overview.html");
-exit(0);
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-#endif
-
-/* TH oddly ,the crosscompiler gets errors from gettimeofday() */
-
-#ifndef LUA_FF_LIB
-static void initrand(void) {
- struct timeval tv;
-
- gettimeofday(&tv,NULL);
- srand(tv.tv_usec);
-}
-
-static void initlibrarysearchpath(void) {
-#ifdef __Mac
- /* If the user has not set library path, then point it at fink */
- /* otherwise leave alone. On the mac people often use fink to */
- /* install image libs. For some reason fink installs in a place */
- /* the dynamic loader doesn't find */
- /* (And fink's attempts to set the PATH variables generally don't work */
- setenv("DYLD_LIBRARY_PATH","/sw/lib",0);
-#endif
-}
-#endif
-
-struct delayed_event {
- void *data;
- void (*func)(void *);
-};
-
-#ifdef FONTFORGE_CONFIG_GTK
-
-static void splash_window_tooltip_fun( GtkWidget *splashw ) {
- static char *foolishness[] = {
-/* GT: These strings are for fun. If they are offensive of incomprehensible */
-/* GT: simply translate them as something dull like: "FontForge" */
-/* GT: Someone said this first quote was a political slogan. If anything, it */
-/* GT: is intended as a satire */
- N_("A free press discriminates\nagainst the illiterate."),
- N_("A free press discriminates\nagainst the illiterate."),
-/* GT: The following are mostly misquotations of fairly well-known bits of */
-/* GT: English literature. Trying to translate them literally may miss the */
-/* GT: point. Finding something appropriate in the literature of your own */
-/* GT: language and then twisting it might be closer to the original intent. */
-/* GT: Or just translate them all as "FontForge" and don't worry about them. */
-/* GT: Misquotation of an old latin drinking song */
- N_("Gaudeamus Ligature!"),
- N_("Gaudeamus Ligature!"),
-/* GT: Misquotation of the Gospel of John */
- N_("In the beginning was the letter...")
-/* GT: Misquotation of As You Like It, II, vii, 139-143 */
- N_("All the world's a page,\n"
- "And all the men and women merely letters;\n"
- "They have their ligatures and hyphenations,\n"
- "And one man in his time forms many words."),
-/* GT: Misquotation of The Wind in the Willows */
- N_("There is nothing, absolutely nothing,\n"
- "half so much worth doing\n"
- "as simply messing about with fonts"),
-/* GT: The New Hacker's Dictionary attributes this to XEROX PARC */
-/* GT: A misquotation of "Ontogeny recapitulates phylogeny" */
- N_("fontology recapitulates file-ogeny")
- };
- GtkTooltips *tips;
-
- tips = gtk_tooltips_new();
- gtk_tooltips_set_tip( tips, splashw, _(foolishness[rand()%(sizeof(foolishness)/sizeof(foolishness[0]))]), NULL );
-}
-
-void ShowAboutScreen(void) {
- GtkWidget *splashw, *version;
- char buffer[200];
- extern const char *source_modtime_str;
- extern const char *source_version_str;
-
- splashw = create_FontForgeSplash ();
- splash_window_tooltip_fun( splashw );
- version = lookup_widget(splashw,"Version");
- if ( version!=NULL ) {
-#ifdef FONTFORGE_CONFIG_TYPE3
- sprintf( buffer, "Version: %s (%s-ML)", source_modtime_str, source_version_str);
-#else
- sprintf( buffer, "Version: %s (%s)", source_modtime_str, source_version_str);
-#endif
- gtk_label_set_text(GTK_LABEL( version ),buffer);
- }
- gtk_widget_show (splashw);
-}
-
-static int DoDelayedEvents(gpointer data) {
- struct delayed_event *info = (struct delayed_event *) data;
-
- if ( info!=NULL ) {
- (info->func)(info->data);
- chunkfree(info,sizeof(struct delayed_event));
- }
-return( FALSE ); /* cancel timer */
-}
-
-void DelayEvent(void (*func)(void *), void *data) {
- struct delayed_event *info = chunkalloc(sizeof(struct delayed_event));
-
- info->data = data;
- info->func = func;
-
- gtk_timeout_add(100,DoDelayedEvents,info);
-}
-
-static int _DoAutoSaves( gpointer ignored ) {
- DoAutoSaves();
-return( TRUE ); /* Continue timer */
-}
-
-struct argcontext {
- int argc;
- char **argv;
- int recover;
-};
-
-static int ParseArgs( gpointer data ) {
- struct argcontext *args = data;
- int argc = args->argc;
- char **argv = args->argv;
- int recover = args->recover;
- int any, i;
- int next_recent = 0;
-
- any = 0;
- if ( recover==-1 )
- CleanAutoRecovery();
- else if ( recover )
- any = DoAutoRecovery();
-
- for ( i=1; i<argc; ++i ) {
- char buffer[1025];
- char *pt = argv[i];
-
- if ( pt[0]=='-' && pt[1]=='-' )
- ++pt;
- if ( strcmp(pt,"-new")==0 ) {
- FontNew();
- any = 1;
-#if HANYANG
- } else if ( strcmp(pt,"-newkorean")==0 ) {
- MenuNewComposition(NULL,NULL,NULL);
- any = 1;
-#endif
- } else if ( strcmp(pt,"-last")==0 ) {
- if ( next_recent<RECENT_MAX && RecentFiles[next_recent]!=NULL )
- if ( ViewPostscriptFont(RecentFiles[next_recent++]))
- any = 1;
- } else if ( strcmp(pt,"-sync")==0 || strcmp(pt,"-memory")==0 ||
- strcmp(pt,"-nosplash")==0 || strcmp(pt,"-recover=none")==0 ||
- strcmp(pt,"-recover=clean")==0 || strcmp(pt,"-recover=auto")==0 ||
- strcmp(pt,"-dontopenxdevices")==0 )
- /* Already done, needed to be before display opened */;
- else if ( (strcmp(pt,"-depth")==0 || strcmp(pt,"-vc")==0 ||
- strcmp(pt,"-cmap")==0 || strcmp(pt,"-colormap")==0 ||
- strcmp(pt,"-keyboard")==0 ||
- strcmp(pt,"-display")==0 || strcmp(pt,"-recover")==0 ) &&
- i<argc-1 )
- ++i; /* Already done, needed to be before display opened */
- else {
- GFileGetAbsoluteName(argv[i],buffer,sizeof(buffer));
- if ( GFileIsDir(buffer)) {
- char *fname;
- fname = galloc(strlen(buffer)+strlen("glyphs/contents.plist")+1);
- strcpy(fname,buffer); strcat(fname,"glyphs/contents.plist");
- if ( GFileExists(fname)) {
- /* It's probably a Unified Font Object directory */
- free(fname);
- if ( ViewPostscriptFont(buffer) )
- any = 1;
- } else {
- strcpy(fname,buffer); strcat(fname,"/font.props");
- if ( GFileExists(fname)) {
- /* It's probably a sf dir collection */
- free(fname);
- if ( ViewPostscriptFont(buffer) )
- any = 1;
- } else {
- free(fname);
- if ( buffer[strlen(buffer)-1]!='/' ) {
- /* If dirname doesn't end in "/" we'll be looking in parent dir */
- buffer[strlen(buffer)+1]='\0';
- buffer[strlen(buffer)] = '/';
- }
- fname = GetPostscriptFontName(buffer,false);
- if ( fname!=NULL )
- ViewPostscriptFont(fname);
- any = 1; /* Even if we didn't get a font, don't bring up dlg again */
- free(fname);
- }
- }
- } else if ( ViewPostscriptFont(buffer)!=0 )
- any = 1;
- }
- }
- if ( !any )
- Menu_Open(NULL,NULL);
-return( FALSE ); /* Cancel timer */
-}
-
-#elif defined( FONTFORGE_CONFIG_GDRAW )
-static void BuildCharHook(GDisplay *gd) {
- GWidgetCreateInsChar();
-}
-
-static void InsCharHook(GDisplay *gd,unichar_t ch) {
- GInsCharSetChar(ch);
-}
-
-extern GImage splashimage;
-static GWindow splashw;
-static GTimer *autosave_timer, *splasht;
-static GFont *splash_font, *splash_italic;
-static int as,fh, linecnt;
-static unichar_t msg[350];
-static unichar_t *lines[20], *is, *ie;
-
-void ShowAboutScreen(void) {
- static int first=1;
-
- if ( first ) {
- GDrawResize(splashw,splashimage.u.image->width,splashimage.u.image->height+linecnt*fh);
- first = false;
- }
- if ( splasht!=NULL )
- GDrawCancelTimer(splasht);
- splasht=NULL;
- GDrawSetVisible(splashw,true);
-}
-
-static void SplashLayout() {
- unichar_t *start, *pt, *lastspace;
- extern const char *source_modtime_str;
- extern const char *source_version_str;
-
- uc_strcpy(msg, "When my father finished his book on Renaissance printing (The Craft of Printing and the Publication of Shakespeare's Works) he told me that I would have to write the chapter on computer typography. This is my attempt to do so.");
-
- GDrawSetFont(splashw,splash_font);
- linecnt = 0;
- lines[linecnt++] = msg-1;
- for ( start = msg; *start!='\0'; start = pt ) {
- lastspace = NULL;
- for ( pt=start; ; ++pt ) {
- if ( *pt==' ' || *pt=='\0' ) {
- if ( GDrawGetTextWidth(splashw,start,pt-start,NULL)<splashimage.u.image->width-10 )
- lastspace = pt;
- else
- break;
- if ( *pt=='\0' )
- break;
- }
- }
- if ( lastspace!=NULL )
- pt = lastspace;
- lines[linecnt++] = pt;
- if ( *pt ) ++pt;
- }
- uc_strcpy(pt, " FontForge used to be named PfaEdit.");
- pt += u_strlen(pt);
- lines[linecnt++] = pt;
- uc_strcpy(pt," Version: ");;
- uc_strcat(pt,source_modtime_str);
- uc_strcat(pt," (");
- uc_strcat(pt,source_version_str);
-#ifdef FONTFORGE_CONFIG_TYPE3
- uc_strcat(pt,"-ML");
-#endif
- uc_strcat(pt,")");
- lines[linecnt++] = pt+u_strlen(pt);
- lines[linecnt] = NULL;
- is = u_strchr(msg,'(');
- ie = u_strchr(msg,')');
-}
-
-void DelayEvent(void (*func)(void *), void *data) {
- struct delayed_event *info = gcalloc(1,sizeof(struct delayed_event));
-
- info->data = data;
- info->func = func;
- GDrawRequestTimer(splashw,100,0,info);
-}
-
-static void DoDelayedEvents(GEvent *event) {
- GTimer *t = event->u.timer.timer;
- struct delayed_event *info = (struct delayed_event *) (event->u.timer.userdata);
-
- if ( info!=NULL ) {
- (info->func)(info->data);
- free(info);
- }
- GDrawCancelTimer(t);
-}
-
-static int splash_e_h(GWindow gw, GEvent *event) {
- static int splash_cnt;
- GRect old;
- int i, y, x;
- static char *foolishness[] = {
-/* GT: These strings are for fun. If they are offensive of incomprehensible */
-/* GT: simply translate them as something dull like: "FontForge" */
- N_("A free press discriminates\nagainst the illiterate."),
- N_("A free press discriminates\nagainst the illiterate."),
- N_("Gaudeamus Ligature!"),
- N_("Gaudeamus Ligature!"),
- N_("In the beginning was the letter..."),
- };
-
- if ( event->type == et_expose ) {
- GDrawPushClip(gw,&event->u.expose.rect,&old);
- GDrawDrawImage(gw,&splashimage,NULL,0,0);
- GDrawSetFont(gw,splash_font);
- y = splashimage.u.image->height + as + fh/2;
- for ( i=1; i<linecnt; ++i ) {
- if ( is>=lines[i-1]+1 && is<lines[i] ) {
- x = 8+GDrawDrawText(gw,8,y,lines[i-1]+1,is-lines[i-1]-1,NULL,0x000000);
- GDrawSetFont(gw,splash_italic);
- GDrawDrawText(gw,x,y,is,lines[i]-is,NULL,0x000000);
- } else if ( ie>=lines[i-1]+1 && ie<lines[i] ) {
- x = 8+GDrawDrawText(gw,8,y,lines[i-1]+1,ie-lines[i-1]-1,NULL,0x000000);
- GDrawSetFont(gw,splash_font);
- GDrawDrawText(gw,x,y,ie,lines[i]-ie,NULL,0x000000);
- } else
- GDrawDrawText(gw,8,y,lines[i-1]+1,lines[i]-lines[i-1]-1,NULL,0x000000);
- y += fh;
- }
- GDrawPopClip(gw,&old);
- } else if ( event->type == et_map ) {
- splash_cnt = 0;
- } else if ( event->type == et_timer && event->u.timer.timer==autosave_timer ) {
- DoAutoSaves();
- } else if ( event->type == et_timer && event->u.timer.timer==splasht ) {
- if ( ++splash_cnt==1 )
- GDrawResize(gw,splashimage.u.image->width,splashimage.u.image->height-24);
- else if ( splash_cnt==2 )
- GDrawResize(gw,splashimage.u.image->width,splashimage.u.image->height);
- else if ( splash_cnt>=7 ) {
- GGadgetEndPopup();
- GDrawSetVisible(gw,false);
- GDrawCancelTimer(splasht);
- splasht = NULL;
- }
- } else if ( event->type == et_timer ) {
- DoDelayedEvents(event);
- } else if ( event->type==et_char || event->type==et_mousedown ||
- event->type==et_close ) {
- GGadgetEndPopup();
- GDrawSetVisible(gw,false);
- } else if ( event->type==et_mousemove ) {
- GGadgetPreparePopup8(gw,_(foolishness[rand()%(sizeof(foolishness)/sizeof(foolishness[0]))]) );
- }
-return( true );
-}
-
-static void AddR(char *prog, char *name, char *val ) {
- char *full = galloc(strlen(name)+strlen(val)+4);
- strcpy(full,name);
- strcat(full,": ");
- strcat(full,val);
- GResourceAddResourceString(full,prog);
-}
-#endif
-
-#ifndef LUA_FF_LIB
-#ifdef FONTFORGE_CONFIG_NO_WINDOWING_UI
-static char * GResourceProgramDir=NULL;
-#endif
-
-static char *getLocaleDir(void) {
- static char *sharedir=NULL;
- static int set=false;
- char *pt;
- int len;
-
- if ( set )
-return( sharedir );
-
- set = true;
- pt = strstr(GResourceProgramDir,"/bin");
- if ( pt==NULL ) {
-#ifdef PREFIX
-return( PREFIX "/share/locale" );
-#else
- pt = GResourceProgramDir + strlen(GResourceProgramDir);
-#endif
- }
- len = (pt-GResourceProgramDir)+strlen("/share/locale")+1;
- sharedir = galloc(len);
- strncpy(sharedir,GResourceProgramDir,pt-GResourceProgramDir);
- strcpy(sharedir+(pt-GResourceProgramDir),"/share/locale");
-return( sharedir );
-}
-#endif
-
-#if defined(__Mac) && !(defined(FONTFORGE_CONFIG_NO_WINDOWING_UI) || defined( X_DISPLAY_MISSING ))
-static int uses_local_x(int argc,char **argv) {
- int i;
- char *arg;
-
- for ( i=1; i<argc; ++i ) {
- arg = argv[i];
- if ( *arg=='-' ) {
- if ( arg[0]=='-' && arg[1]=='-' )
- ++arg;
- if ( strcmp(arg,"-display")==0 )
-return( false ); /* we use a different display */
- if ( strcmp(arg,"-c")==0 )
-return( false ); /* we use a script string, no x display at all */
- if ( strcmp(arg,"-script")==0 )
-return( false ); /* we use a script, no x display at all */
- if ( strcmp(arg,"-")==0 )
-return( false ); /* script on stdin */
- } else {
- /* Is this argument a script file ? */
- FILE *temp = fopen(argv[i],"r");
- char buffer[200];
- if ( temp==NULL )
-return( true ); /* not a script file, so need local local X */
- buffer[0] = '\0';
- fgets(buffer,sizeof(buffer),temp);
- fclose(temp);
- if ( buffer[0]=='#' && buffer[1]=='!' &&
- (strstr(buffer,"pfaedit")!=NULL || strstr(buffer,"fontforge")!=NULL )) {
-return( false ); /* is a script file, so no need for X */
-
-return( true ); /* not a script, so needs X */
- }
- }
- }
-return( true );
-}
-#endif
-
-#ifndef LUA_FF_LIB
-int FontForgeMain( int argc, char **argv ) {
- extern const char *source_modtime_str;
- const char *load_prefs = getenv("FONTFORGE_LOADPREFS");
-#if !defined( FONTFORGE_CONFIG_NO_WINDOWING_UI )
- int i;
- extern int splash;
- int recover=1;
-#endif
-#ifdef FONTFORGE_CONFIG_GDRAW
- int any;
- int next_recent=0;
- GRect pos;
- GWindowAttrs wattrs;
- char *display = NULL;
- FontRequest rq;
- static unichar_t times[] = { 't', 'i', 'm', 'e', 's',',','c','l','e','a','r','l','y','u',',','u','n','i','f','o','n','t', '\0' };
- int ds, ld;
-#elif defined( FONTFORGE_CONFIG_GTK )
- GtkWidget *splashw;
- GtkWidget *notices;
- gchar *home_dir, *rc_path;
- struct argcontext args;
-#elif defined( FONTFORGE_CONFIG_NO_WINDOWING_UI )
-#else
-# error FontForge has not been properly configured.
-/* One of FONTFORGE_CONFIG_GDRAW, FONTFORGE_CONFIG_GTK, FONTFORGE_CONFIG_NO_WINDOWING_UI */
-/* must be set */
-#endif
-
-#ifdef FONTFORGE_CONFIG_TYPE3
- fprintf( stderr, "Copyright (c) 2000-2007 by George Williams.\n Executable based on sources from %s-ML.\n",
- source_modtime_str );
-#else
- fprintf( stderr, "Copyright (c) 2000-2007 by George Williams.\n Executable based on sources from %s.\n",
- source_modtime_str );
-#endif
- setlocale(LC_ALL,"");
- localeinfo = *localeconv();
- coord_sep = ",";
- if ( *localeinfo.decimal_point=='.' ) coord_sep=",";
- else if ( *localeinfo.decimal_point!='.' ) coord_sep=" ";
- if ( getenv("FF_SCRIPT_IN_LATIN1") ) use_utf8_in_script=false;
-
-#if !defined( FONTFORGE_CONFIG_NO_WINDOWING_UI )
- GResourceSetProg(argv[0]);
-#endif
-#if defined( FONTFORGE_CONFIG_GTK )
- gtk_set_locale ();
-
- home_dir = (gchar*) g_get_home_dir();
- rc_path = g_strdup_printf("%s/.fontforgerc", home_dir);
- gtk_rc_add_default_file(rc_path);
- g_free(rc_path);
-
- gtk_init (&argc, &argv);
-
- add_pixmap_directory (PIXMAP_DIR);
-#endif
-
-#if !defined( FONTFORGE_CONFIG_NO_WINDOWING_UI )
- GMenuSetShortcutDomain("FontForge-MenuShortCuts");
-#endif
- bind_textdomain_codeset("FontForge-MenuShortCuts","UTF-8");
- bindtextdomain("FontForge-MenuShortCuts", getLocaleDir());
- bind_textdomain_codeset("FontForge","UTF-8");
- bindtextdomain("FontForge", getLocaleDir());
- textdomain("FontForge");
-#if !defined( FONTFORGE_CONFIG_GTK )
-#if !defined( FONTFORGE_CONFIG_NO_WINDOWING_UI )
- GResourceUseGetText();
-#endif
-#endif
-
-#if defined(__Mac) && !(defined(FONTFORGE_CONFIG_NO_WINDOWING_UI) || defined( X_DISPLAY_MISSING ))
- /* Start X if they haven't already done so. Well... try anyway */
- /* Must be before we change DYLD_LIBRARY_PATH or X won't start */
- if ( uses_local_x(argc,argv) && getenv("DISPLAY")==NULL ) {
- system( "open /Applications/Utilities/X11.app/" );
- setenv("DISPLAY",":0.0",0);
- }
-#endif
-
- SetDefaults();
- if ( load_prefs!=NULL && strcasecmp(load_prefs,"Always")==0 )
- LoadPrefs();
- else
- PrefDefaultEncoding();
- if ( default_encoding==NULL )
- default_encoding=FindOrMakeEncoding("ISO8859-1");
- if ( default_encoding==NULL )
- default_encoding=&custom; /* In case iconv is broken */
- initlibrarysearchpath();
- initrand();
- initadobeenc();
- inituninameannot();
- CheckIsScript(argc,argv); /* Will run the script and exit if it is a script */
- /* If there is no UI, there is always a script */
- /* and we will never return from the above */
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( load_prefs==NULL ||
- (strcasecmp(load_prefs,"Always")!=0 && /* Already loaded */
- strcasecmp(load_prefs,"Never")!=0 ))
- LoadPrefs();
- for ( i=1; i<argc; ++i ) {
- char *pt = argv[i];
- if ( pt[0]=='-' && pt[1]=='-' )
- ++pt;
-# if defined( FONTFORGE_CONFIG_GTK )
- if ( strcmp(pt,"-sync")==0 )
- gwwv_x11_synchronize();
-# else
- if ( strcmp(pt,"-sync")==0 )
- GResourceAddResourceString("Gdraw.Synchronize: true",argv[0]);
- else if ( strcmp(pt,"-depth")==0 && i<argc-1 )
- AddR(argv[0],"Gdraw.Depth", argv[++i]);
- else if ( strcmp(pt,"-vc")==0 && i<argc-1 )
- AddR(argv[0],"Gdraw.VisualClass", argv[++i]);
- else if ( (strcmp(pt,"-cmap")==0 || strcmp(pt,"-colormap")==0) && i<argc-1 )
- AddR(argv[0],"Gdraw.Colormap", argv[++i]);
- else if ( (strcmp(pt,"-dontopenxdevices")==0) )
- AddR(argv[0],"Gdraw.DontOpenXDevices", "true");
- else if ( strcmp(pt,"-keyboard")==0 && i<argc-1 )
- AddR(argv[0],"Gdraw.Keyboard", argv[++i]);
- else if ( strcmp(pt,"-display")==0 && i<argc-1 )
- display = argv[++i];
-# endif
-# if MyMemory
- else if ( strcmp(pt,"-memory")==0 )
- __malloc_debug(5);
-# endif
- else if ( strcmp(pt,"-nosplash")==0 )
- splash = 0;
- else if ( strcmp(pt,"-recover")==0 && i<argc-1 ) {
- ++i;
- if ( strcmp(argv[i],"none")==0 )
- recover=0;
- else if ( strcmp(argv[i],"clean")==0 )
- recover= -1;
- else if ( strcmp(argv[i],"auto")==0 )
- recover= 1;
- else {
- fprintf( stderr, "Invalid argument to -recover, must be none, auto or clean\n" );
- dousage();
- }
- } else if ( strcmp(pt,"-recover=none")==0 ) {
- recover = 0;
- } else if ( strcmp(pt,"-recover=clean")==0 ) {
- recover = -1;
- }
- else if ( strcmp(pt,"-help")==0 )
- dohelp();
- else if ( strcmp(pt,"-usage")==0 )
- dousage();
- else if ( strcmp(pt,"-version")==0 )
- doversion();
- }
-
-# ifdef FONTFORGE_CONFIG_GDRAW
- GDrawCreateDisplays(display,argv[0]);
- default_background = GDrawGetDefaultBackground(screen_display);
- InitToolIconClut(default_background);
-# endif
- InitCursors();
-
-# ifdef FONTFORGE_CONFIG_GTK
- if ( splash ) {
- splashw = create_FontForgeSplash ();
- splash_window_tooltip_fun( splashw );
- notices = lookup_widget(splashw,"Notices");
- if ( notices!=NULL )
- gtk_widget_hide(notices);
- gtk_widget_show (splashw);
- }
-
- gtk_timeout_add(30*1000,_DoAutoSaves,NULL); /* Check for autosave every 30 seconds */
-
- args.argc = argc; args.argv = argv; args.recover = recover;
- gtk_timeout_add(100,ParseArgs,&args);
- /* Parse arguments within the main loop */
-
- gtk_main ();
-# else /* Gdraw */
- /* the splash screen used not to have a title bar (wam_nodecor) */
- /* but I found I needed to know how much the window manager moved */
- /* the window around, which I can determine if I have a positioned */
- /* decorated window created at the begining */
- /* Actually I don't care any more */
- wattrs.mask = wam_events|wam_cursor|wam_bordwidth|wam_backcol|wam_positioned|wam_utf8_wtitle|wam_isdlg;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.positioned = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = "FontForge";
- wattrs.border_width = 2;
- wattrs.background_color = 0xffffff;
- wattrs.is_dlg = true;
- pos.x = pos.y = 200;
- pos.width = splashimage.u.image->width;
- pos.height = splashimage.u.image->height-56; /* 54 */
- splashw = GDrawCreateTopWindow(NULL,&pos,splash_e_h,NULL,&wattrs);
- memset(&rq,0,sizeof(rq));
- rq.family_name = times;
- rq.point_size = 12;
- rq.weight = 400;
- splash_font = GDrawInstanciateFont(NULL,&rq);
- rq.style = fs_italic;
- splash_italic = GDrawInstanciateFont(NULL,&rq);
- GDrawSetFont(splashw,splash_font);
- GDrawFontMetrics(splash_font,&as,&ds,&ld);
- fh = as+ds+ld;
- SplashLayout();
- if ( splash ) {
- GDrawSetVisible(splashw,true);
- GDrawSync(NULL);
- GDrawProcessPendingEvents(NULL);
- GDrawProcessPendingEvents(NULL);
- splasht = GDrawRequestTimer(splashw,1000,1000,NULL);
- }
- autosave_timer=GDrawRequestTimer(splashw,60*1000,30*1000,NULL);
-
- GDrawProcessPendingEvents(NULL);
- GDrawSetBuildCharHooks(BuildCharHook,InsCharHook);
-
- any = 0;
- if ( recover==-1 )
- CleanAutoRecovery();
- else if ( recover )
- any = DoAutoRecovery();
-
- for ( i=1; i<argc; ++i ) {
- char buffer[1025];
- char *pt = argv[i];
-
- GDrawProcessPendingEvents(NULL);
- if ( pt[0]=='-' && pt[1]=='-' )
- ++pt;
- if ( strcmp(pt,"-new")==0 ) {
- FontNew();
- any = 1;
-# if HANYANG
- } else if ( strcmp(pt,"-newkorean")==0 ) {
- MenuNewComposition(NULL,NULL,NULL);
- any = 1;
-# endif
- } else if ( strcmp(pt,"-last")==0 ) {
- if ( next_recent<RECENT_MAX && RecentFiles[next_recent]!=NULL )
- if ( ViewPostscriptFont(RecentFiles[next_recent++]))
- any = 1;
- } else if ( strcmp(pt,"-sync")==0 || strcmp(pt,"-memory")==0 ||
- strcmp(pt,"-nosplash")==0 || strcmp(pt,"-recover=none")==0 ||
- strcmp(pt,"-recover=clean")==0 || strcmp(pt,"-recover=auto")==0 ||
- strcmp(pt,"-dontopenxdevices")==0 )
- /* Already done, needed to be before display opened */;
- else if ( (strcmp(pt,"-depth")==0 || strcmp(pt,"-vc")==0 ||
- strcmp(pt,"-cmap")==0 || strcmp(pt,"-colormap")==0 ||
- strcmp(pt,"-keyboard")==0 ||
- strcmp(pt,"-display")==0 || strcmp(pt,"-recover")==0 ) &&
- i<argc-1 )
- ++i; /* Already done, needed to be before display opened */
- else {
- GFileGetAbsoluteName(argv[i],buffer,sizeof(buffer));
- if ( GFileIsDir(buffer)) {
- char *fname;
- fname = galloc(strlen(buffer)+strlen("/glyphs/contents.plist")+1);
- strcpy(fname,buffer); strcat(fname,"/glyphs/contents.plist");
- if ( GFileExists(fname)) {
- /* It's probably a Unified Font Object directory */
- free(fname);
- if ( ViewPostscriptFont(buffer) )
- any = 1;
- } else {
- strcpy(fname,buffer); strcat(fname,"/font.props");
- if ( GFileExists(fname)) {
- /* It's probably a sf dir collection */
- free(fname);
- if ( ViewPostscriptFont(buffer) )
- any = 1;
- } else {
- free(fname);
- if ( buffer[strlen(buffer)-1]!='/' ) {
- /* If dirname doesn't end in "/" we'll be looking in parent dir */
- buffer[strlen(buffer)+1]='\0';
- buffer[strlen(buffer)] = '/';
- }
- fname = GetPostscriptFontName(buffer,false);
- if ( fname!=NULL )
- ViewPostscriptFont(fname);
- any = 1; /* Even if we didn't get a font, don't bring up dlg again */
- free(fname);
- }
- }
- } else if ( ViewPostscriptFont(buffer)!=0 )
- any = 1;
- }
- }
- if ( !any )
- MenuOpen(NULL,NULL,NULL);
- GDrawEventLoop(NULL);
-# endif
-#endif
-return( 0 );
-}
-#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stemdb.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stemdb.c
deleted file mode 100644
index 2e608c71703..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stemdb.c
+++ /dev/null
@@ -1,2428 +0,0 @@
-/* Copyright (C) 2005-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaedit.h"
-#include "edgelist2.h"
-#include "stemdb.h"
-#include <math.h>
-
-/* A diagonal end is like the top or bottom of a slash. Should we add a vertical stem at the end? */
-/* A diagonal corner is like the bottom of circumflex. Should we add a horizontal stem */
-int hint_diagonal_ends = 0,
- hint_diagonal_intersections = 0,
- hint_bounding_boxes = 1;
-
-static const double slope_error = .05;
- /* If the dot vector of a slope and the normal of another slope is less */
- /* than this error, then we say they are close enough to be colinear */
-static double dist_error_hv = 3;
-static double dist_error_diag = 6;
- /* It's easy to get horizontal/vertical lines aligned properly */
- /* it is more difficult to get diagonal ones done */
- /* The "A" glyph in Apple's Times.dfont(Roman) is off by 6 in one spot */
-
-struct st {
- Spline *s;
- double st, lt;
-};
-
-static int SplineFigureOpticalSlope(Spline *s,int start_at_from,BasePoint *dir) {
- /* Sometimes splines have tiny control points, and to the eye the slope */
- /* of the spline has nothing to do with that specified by the cps. */
- /* So see if the spline is straightish and figure the slope based on */
- /* some average direction */
- /* dir is a input output parameter. */
- /* it should be initialized to the unit vector determined by the appropriate cp */
- /* if the function returns true, it will be set to a unit vector in the average direction */
- BasePoint pos, *base, average_dir, normal;
- double t, len, incr, off;
-
- if ( start_at_from ) {
- incr = -.1;
- base = &s->from->me;
- } else {
- incr = .1;
- base = &s->to->me;
- }
-
- t = .5-incr;
- memset(&average_dir,0,sizeof(average_dir));
- while ( t>0 && t<1.0 ) {
- pos.x = ((s->splines[0].a*t+s->splines[0].b)*t+s->splines[0].c)*t+s->splines[0].d;
- pos.y = ((s->splines[1].a*t+s->splines[1].b)*t+s->splines[1].c)*t+s->splines[1].d;
-
- average_dir.x += (pos.x-base->x); average_dir.y += (pos.y-base->y);
- t += incr;
- }
-
- len = sqrt(average_dir.x*average_dir.x + average_dir.y*average_dir.y);
- if ( len==0 )
-return( false );
- average_dir.x /= len; average_dir.y /= len;
- normal.x = average_dir.y; normal.y = - average_dir.x;
-
- t = .5-incr;
- while ( t>0 && t<1.0 ) {
- pos.x = ((s->splines[0].a*t+s->splines[0].b)*t+s->splines[0].c)*t+s->splines[0].d;
- pos.y = ((s->splines[1].a*t+s->splines[1].b)*t+s->splines[1].c)*t+s->splines[1].d;
- off = (pos.x-base->x)*normal.x + (pos.y-base->y)*normal.y;
- if ( off<-dist_error_hv || off>dist_error_hv )
-return( false );
- t += incr;
- }
-
- off = dir->x*normal.x + dir->y*normal.y;
- if ( off<slope_error ) {
- /* prefer the direction which is closer to horizontal/vertical */
- double dx, dy, ax, ay, d, a;
- if ( (dx=dir->x)<0 ) dx = -dx;
- if ( (dy=dir->y)<0 ) dy = -dy;
- d = (dx<dy) ? dx : dy;
- if ( (ax=average_dir.x)<0 ) ax = -ax;
- if ( (ay=average_dir.y)<0 ) ay = -ay;
- a = (ax<ay) ? ax : ay;
- if ( d<a )
-return( false );
- }
-
- *dir = average_dir;
-return( true );
-}
-
-static void PointInit(struct glyphdata *gd,SplinePoint *sp, SplineSet *ss) {
- struct pointdata *pd;
- double len;
-
- if ( sp->ttfindex==0xffff || sp->ttfindex==0xfffe )
-return;
- pd = &gd->points[sp->ttfindex];
- pd->sp = sp;
- pd->ss = ss;
-
- if ( sp->next==NULL ) {
- pd->nextunit.x = ss->first->me.x - sp->me.x;
- pd->nextunit.y = ss->first->me.y - sp->me.y;
- pd->nextlinear = true;
- } else if ( sp->next->knownlinear ) {
- pd->nextunit.x = sp->next->to->me.x - sp->me.x;
- pd->nextunit.y = sp->next->to->me.y - sp->me.y;
- pd->nextlinear = true;
- } else if ( sp->nonextcp ) {
- pd->nextunit.x = sp->next->to->prevcp.x - sp->me.x;
- pd->nextunit.y = sp->next->to->prevcp.y - sp->me.y;
- } else {
- pd->nextunit.x = sp->nextcp.x - sp->me.x;
- pd->nextunit.y = sp->nextcp.y - sp->me.y;
- }
- len = sqrt(pd->nextunit.x*pd->nextunit.x + pd->nextunit.y*pd->nextunit.y);
- if ( len==0 )
- pd->nextzero = true;
- else {
- pd->nextlen = len;
- pd->nextunit.x /= len;
- pd->nextunit.y /= len;
- if ( sp->next!=NULL && !sp->next->knownlinear )
- SplineFigureOpticalSlope(sp->next,true,&pd->nextunit);
- if ( pd->nextunit.x<slope_error && pd->nextunit.x>-slope_error ) {
- pd->nextunit.x = 0; pd->nextunit.y = pd->nextunit.y>0 ? 1 : -1;
- } else if ( pd->nextunit.y<slope_error && pd->nextunit.y>-slope_error ) {
- pd->nextunit.y = 0; pd->nextunit.x = pd->nextunit.x>0 ? 1 : -1;
- }
- if ( pd->nextunit.y==0 ) pd->next_hor = true;
- else if ( pd->nextunit.x==0 ) pd->next_ver = true;
- }
-
- if ( sp->prev==NULL ) {
- pd->prevunit.x = ss->last->me.x - sp->me.x;
- pd->prevunit.y = ss->last->me.y - sp->me.y;
- pd->prevlinear = true;
- } else if ( sp->prev->knownlinear ) {
- pd->prevunit.x = sp->prev->from->me.x - sp->me.x;
- pd->prevunit.y = sp->prev->from->me.y - sp->me.y;
- pd->prevlinear = true;
- } else if ( sp->noprevcp ) {
- pd->prevunit.x = sp->prev->from->nextcp.x - sp->me.x;
- pd->prevunit.y = sp->prev->from->nextcp.y - sp->me.y;
- } else {
- pd->prevunit.x = sp->prevcp.x - sp->me.x;
- pd->prevunit.y = sp->prevcp.y - sp->me.y;
- }
- len = sqrt(pd->prevunit.x*pd->prevunit.x + pd->prevunit.y*pd->prevunit.y);
- if ( len==0 )
- pd->prevzero = true;
- else {
- pd->prevlen = len;
- pd->prevunit.x /= len;
- pd->prevunit.y /= len;
- if ( sp->prev!=NULL && !sp->prev->knownlinear )
- SplineFigureOpticalSlope(sp->prev,false,&pd->prevunit);
- if ( pd->prevunit.x<slope_error && pd->prevunit.x>-slope_error ) {
- pd->prevunit.x = 0; pd->prevunit.y = pd->prevunit.y>0 ? 1 : -1;
- } else if ( pd->prevunit.y<slope_error && pd->prevunit.y>-slope_error ) {
- pd->prevunit.y = 0; pd->prevunit.x = pd->prevunit.x>0 ? 1 : -1;
- }
- if ( pd->prevunit.y==0 ) pd->prev_hor = true;
- else if ( pd->prevunit.x==0 ) pd->prev_ver = true;
- }
- {
- double same = pd->prevunit.x*pd->nextunit.x + pd->prevunit.y*pd->nextunit.y;
- if ( same<-.95 )
- pd->colinear = true;
- }
- if ( hint_diagonal_intersections ) {
- if ( pd->prev_hor || pd->prev_ver )
- /* It IS horizontal or vertical. No need to fake it */;
- else if ( RealNear(pd->nextunit.x,-pd->prevunit.x) &&
- RealNear(pd->nextunit.y,pd->prevunit.y) && !pd->nextzero)
- pd->symetrical_h = true;
- else if ( RealNear(pd->nextunit.y,-pd->prevunit.y) &&
- RealNear(pd->nextunit.x,pd->prevunit.x) && !pd->nextzero)
- pd->symetrical_v = true;
- }
-}
-
-static int BBoxIntersectsLine(Spline *s,Spline *line) {
- double t,x,y;
- DBounds b;
-
- b.minx = b.maxx = s->from->me.x;
- b.miny = b.maxy = s->from->me.y;
- if ( s->to->me.x<b.minx ) b.minx = s->to->me.x;
- else if ( s->to->me.x>b.maxx ) b.maxx = s->to->me.x;
- if ( s->to->me.y<b.miny ) b.miny = s->to->me.y;
- else if ( s->to->me.y>b.maxy ) b.maxy = s->to->me.y;
- if ( s->to->prevcp.x<b.minx ) b.minx = s->to->prevcp.x;
- else if ( s->to->prevcp.x>b.maxx ) b.maxx = s->to->prevcp.x;
- if ( s->to->prevcp.y<b.miny ) b.miny = s->to->prevcp.y;
- else if ( s->to->prevcp.y>b.maxy ) b.maxy = s->to->prevcp.y;
- if ( s->from->nextcp.x<b.minx ) b.minx = s->from->nextcp.x;
- else if ( s->from->nextcp.x>b.maxx ) b.maxx = s->from->nextcp.x;
- if ( s->from->nextcp.y<b.miny ) b.miny = s->from->nextcp.y;
- else if ( s->from->nextcp.y>b.maxy ) b.maxy = s->from->nextcp.y;
-
- if ( line->splines[0].c!=0 ) {
- t = (b.minx-line->splines[0].d)/line->splines[0].c;
- y = line->splines[1].c*t+line->splines[1].d;
- if ( y>=b.miny && y<=b.maxy )
-return( true );
- t = (b.maxx-line->splines[0].d)/line->splines[0].c;
- y = line->splines[1].c*t+line->splines[1].d;
- if ( y>=b.miny && y<=b.maxy )
-return( true );
- }
- if ( line->splines[1].c!=0 ) {
- t = (b.miny-line->splines[1].d)/line->splines[1].c;
- x = line->splines[0].c*t+line->splines[0].d;
- if ( x>=b.minx && x<=b.maxx )
-return( true );
- t = (b.maxy-line->splines[1].d)/line->splines[1].c;
- x = line->splines[0].c*t+line->splines[0].d;
- if ( x>=b.minx && x<=b.maxx )
-return( true );
- }
-return( false );
-}
-
-static int stcmp(const void *_p1, const void *_p2) {
- const struct st *stpt1 = _p1, *stpt2 = _p2;
- if ( stpt1->lt>stpt2->lt )
-return( 1 );
- else if ( stpt1->lt<stpt2->lt )
-return( -1 );
-
-return( 0 );
-}
-
-static int LineType(struct st *st,int i, int cnt,Spline *line) {
- SplinePoint *sp;
- BasePoint nextcp, prevcp, here;
- double dn, dp;
-
- if ( st[i].st>.01 && st[i].st<.99 )
-return( 0 ); /* Not near an end-point, just a normal line */
- if ( i+1>=cnt )
-return( 0 ); /* No following spline */
- if ( st[i+1].st>.01 && st[i+1].st<.99 )
-return( 0 ); /* Following spline not near an end-point, can't */
- /* match to this one, just a normal line */
- if ( st[i].st<.5 && st[i+1].st>.5 ) {
- if ( st[i+1].s->to->next!=st[i].s )
-return( 0 );
- sp = st[i].s->from;
- } else if ( st[i].st>.5 && st[i+1].st<.5 ) {
- if ( st[i].s->to->next!=st[i+1].s )
-return( 0 );
- sp = st[i].s->to;
- } else
-return( 0 );
-
- if ( !sp->nonextcp )
- nextcp = sp->nextcp;
- else
- nextcp = sp->next->to->me;
- if ( !sp->noprevcp )
- prevcp = sp->prevcp;
- else
- prevcp = sp->prev->from->me;
- here.x = line->splines[0].c*(st[i].st+st[i+1].st)/2 + line->splines[0].d;
- here.y = line->splines[1].c*(st[i].st+st[i+1].st)/2 + line->splines[1].d;
-
- nextcp.x -= here.x; nextcp.y -= here.y;
- prevcp.x -= here.x; prevcp.y -= here.y;
-
- dn = nextcp.x*line->splines[1].c - nextcp.y*line->splines[0].c;
- dp = prevcp.x*line->splines[1].c - prevcp.y*line->splines[0].c;
- if ( dn*dp<0 ) /* splines away move on opposite sides of the line */
-return( 1 ); /* Treat this line and the next as one */
- /* We assume that a rounding error gave us one erroneous intersection (or we went directly through the endpoint) */
- else
-return( 2 ); /* Ignore both this line and the next */
- /* Intersects both in a normal fashion */
-}
-
-static int MonotonicOrder(Spline **sspace,Spline *line,struct st *stspace) {
- Spline *s;
- int i,j,k,cnt;
- BasePoint pts[9];
- extended lts[10], sts[10];
-
- for ( i=j=0; (s=sspace[j])!=NULL; ++j ) {
- if ( BBoxIntersectsLine(s,line) ) {
- /* Lines parallel to the direction we are testing just get in the */
- /* way and don't add any useful info */
- if ( s->islinear &&
- RealNear(line->splines[0].c*s->splines[1].c,
- line->splines[1].c*s->splines[0].c))
- continue;
- if ( SplinesIntersect(line,s,pts,lts,sts)<=0 )
- continue;
- for ( k=0; sts[k]!=-1; ++k ) {
- if ( sts[k]>=0 && sts[k]<=1 ) {
- stspace[i].s = s;
- stspace[i].lt = lts[k];
- stspace[i++].st = sts[k];
- }
- }
- }
- }
- stspace[i].s = NULL;
- cnt = i;
- qsort(stspace,cnt,sizeof(struct st),stcmp);
-return( cnt );
-}
-
-static Spline *MonotonicFindAlong(Spline *line,struct st *stspace,int cnt,
- Spline *findme, double *other_t) {
- Spline *s;
- int i;
- int eo; /* I do horizontal/vertical by winding number */
- /* But figuring winding number with respect to a */
- /* diagonal line is hard. So I use even-odd */
- /* instead. */
-
- eo = 0;
- for ( i=0; i<cnt; ++i ) {
- s = stspace[i].s;
- if ( s==findme ) {
- if ( (eo&1) && i>0 ) {
- *other_t = stspace[i-1].st;
-return( stspace[i-1].s );
- } else if ( !(eo&1) && i+1<cnt ) {
- *other_t = stspace[i+1].st;
-return( stspace[i+1].s );
- }
- fprintf( stderr, "MonotonicFindAlong: Ran out of intersections.\n" );
-return( NULL );
- }
- if ( i+1<cnt && stspace[i+1].s==findme )
- ++eo;
- else switch ( LineType(stspace,i,cnt,line) ) {
- case 0: /* Normal spline */
- ++eo;
- break;
- case 1: /* Intersects at end-point & next entry is other side */
- ++eo; /* And the two sides continue in approximately the */
- ++i; /* same direction */
- break;
- case 2: /* Intersects at end-point & next entry is other side */
- ++i; /* And the two sides go in opposite directions */
- break;
- }
- }
- fprintf( stderr, "MonotonicFindAlong: Never found our spline.\n" );
-return( NULL );
-}
-
-static int MonotonicFindStemBounds(Spline *line,struct st *stspace,int cnt,
- struct stemdata *stem ) {
- int i,j;
- int eo; /* I do horizontal/vertical by winding number */
- /* But figuring winding number with respect to a */
- /* diagonal line is hard. So I use even-odd */
- /* instead. */
- double pos, npos;
-
- eo = 0;
- for ( i=0; i<cnt; ++i ) {
- pos = (line->splines[0].c*stspace[i].lt + line->splines[0].d - stem->left.x)*stem->l_to_r.x +
- (line->splines[1].c*stspace[i].lt + line->splines[1].d - stem->left.y)*stem->l_to_r.y;
- npos = 99999999;
- if ( i+1<cnt )
- npos = (line->splines[0].c*stspace[i+1].lt + line->splines[0].d - stem->left.x)*stem->l_to_r.x +
- (line->splines[1].c*stspace[i+1].lt + line->splines[1].d - stem->left.y)*stem->l_to_r.y;
-
- if ( fabs(npos)<fabs(pos) )
- /* Then npos is closer to the base of the stem and is what we want*/;
- else if ( pos>-dist_error_diag && pos<dist_error_diag ) {
- if ( (eo&1) && i>0 )
- j = i-1;
- else if ( !(eo&1) && i+1<cnt )
- j = i+1;
- else
-return( false );
- pos = (line->splines[0].c*stspace[j].lt + line->splines[0].d - stem->left.x)*stem->l_to_r.x +
- (line->splines[1].c*stspace[j].lt + line->splines[1].d - stem->left.y)*stem->l_to_r.y;
-return( pos>=stem->width-dist_error_diag && pos<=stem->width+dist_error_diag );
- }
- if ( i+1<cnt && npos>-dist_error_diag && npos<dist_error_diag )
- ++eo;
- else switch ( LineType(stspace,i,cnt,line) ) {
- case 0: /* Normal spline */
- ++eo;
- break;
- case 1: /* Intersects at end-point & next entry is other side */
- ++eo; /* And the two sides continue in approximately the */
- ++i; /* same direction */
- break;
- case 2: /* Intersects at end-point & next entry is other side */
- ++i; /* And the two sides go in opposite directions */
- break;
- }
- }
-return( false );
-}
-
-static int MatchWinding(struct monotonic ** space,int i,int nw,int winding,int which) {
- struct monotonic *m;
- int j;
-
- if (( nw<0 && winding>0 ) || (nw>0 && winding<0)) {
- winding = nw;
- for ( j=i-1; j>=0; --j ) {
- m = space[j];
- winding += ((&m->xup)[which] ? 1 : -1 );
- if ( winding==0 )
-return( j );
- }
- } else {
- winding = nw;
- for ( j=i+1; space[j]!=NULL; ++j ) {
- m = space[j];
- winding += ((&m->xup)[which] ? 1 : -1 );
- if ( winding==0 )
-return( j );
- }
- }
-return( -1 );
-}
-
-static Spline *FindMatchingHVEdge(struct glyphdata *gd, struct pointdata *pd,
- int is_next, double *other_t ) {
- double test, t;
- int which;
- Spline *s;
- Monotonic *m;
- int winding, nw, i,j;
- struct monotonic **space;
- BasePoint *dir, d, hv;
- nw = 0;
- /* Things are difficult if we go exactly through the point. Move off */
- /* to the side a tiny bit and hope that doesn't matter */
- if ( is_next==2 ) {
- /* Consider the case of the bottom of the circumflex (or a chevron) */
- /* Think of it as a flattend breve. It is symetrical and we want to */
- /* note the vertical distance between the two points that define */
- /* the bottom, so treat them as a funky stem */
- /* \ \ / / */
- /* \ \ / / */
- /* \ \ / / */
- /* \ + / */
- /* \ / */
- /* + */
- hv.x = pd->symetrical_h ? 1.0 : 0.0;
- hv.y = pd->symetrical_v ? 1.0 : 0.0;
- dir = &hv;
- t = .001;
- s = pd->sp->next; /* Could just as easily be prev */
- } else if ( is_next ) {
- s = pd->sp->next;
- t = .001;
- dir = &pd->nextunit;
- } else {
- s = pd->sp->prev;
- t = .999;
- dir = &pd->prevunit;
- }
- if ( (d.x = dir->x)<0 ) d.x = -d.x;
- if ( (d.y = dir->y)<0 ) d.y = -d.y;
- which = d.x<d.y; /* closer to vertical */
-
- if ( s==NULL ) /* Somehow we got an open contour? */
-return( NULL );
-
- test = ((s->splines[which].a*t+s->splines[which].b)*t+s->splines[which].c)*t+s->splines[which].d;
- MonotonicFindAt(gd->ms,which,test,space = gd->space);
-
- winding = 0;
- for ( i=0; space[i]!=NULL; ++i ) {
- m = space[i];
- nw = ((&m->xup)[which] ? 1 : -1 );
- if ( m->s == s && t>=m->tstart && t<=m->tend )
- break;
- winding += nw;
- }
- if ( space[i]==NULL ) {
- fprintf( stderr, "FindMatchinHVEdge didn't\n" );
-return( NULL );
- }
-
- j = MatchWinding(space,i,nw,winding,which);
- if ( j!=-1 ) {
- *other_t = space[j]->t;
-return( space[j]->s );
- }
-
- fprintf( stderr, "FindMatchingHVEdge fell into an impossible position\n" );
-return( NULL );
-}
-
-static void MakeVirtualLine(struct glyphdata *gd,BasePoint *perturbed,
- BasePoint *dir,Spline *myline,SplinePoint *end1, SplinePoint *end2) {
- BasePoint norm, absnorm;
- double t1, t2;
-
- if ( gd->stspace==NULL ) {
- int i, cnt;
- SplineSet *spl;
- Spline *s, *first;
- for ( i=0; i<2; ++i ) {
- cnt = 0;
- for ( spl=gd->sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
- first = NULL;
- if ( spl->first->prev!=NULL ) {
- for ( s=spl->first->next; s!=first; s=s->to->next ) {
- if ( first==NULL ) first = s;
- if ( i )
- gd->sspace[cnt] = s;
- ++cnt;
- }
- }
- }
- if ( !i ) {
- gd->scnt = cnt;
- gd->sspace = galloc((cnt+1)*sizeof(Spline *));
- } else
- gd->sspace[cnt] = NULL;
- }
- gd->stspace = galloc((3*cnt+2)*sizeof(struct st));
- SplineCharFindBounds(gd->sc,&gd->size);
- gd->size.minx -= 10; gd->size.miny -= 10;
- gd->size.maxx += 10; gd->size.maxy += 10;
- }
-
- norm.x = -dir->y;
- norm.y = dir->x;
- absnorm = norm;
- if ( absnorm.x<0 ) absnorm.x = -absnorm.x;
- if ( absnorm.y<0 ) absnorm.y = -absnorm.y;
-
- memset(myline,0,sizeof(*myline));
- memset(end1,0,sizeof(*end1));
- memset(end2,0,sizeof(*end2));
- myline->knownlinear = myline->islinear = true;
-
- if ( absnorm.x > absnorm.y ) {
- /* Greater change in x than in y */
- t1 = (gd->size.minx-perturbed->x)/norm.x;
- t2 = (gd->size.maxx-perturbed->x)/norm.x;
- myline->splines[0].d = gd->size.minx;
- myline->splines[0].c = gd->size.maxx-gd->size.minx;
- myline->splines[1].d = perturbed->y+t1*norm.y;
- myline->splines[1].c = (t2-t1)*norm.y;
- } else {
- t1 = (gd->size.miny-perturbed->y)/norm.y;
- t2 = (gd->size.maxy-perturbed->y)/norm.y;
- myline->splines[1].d = gd->size.miny;
- myline->splines[1].c = gd->size.maxy-gd->size.miny;
- myline->splines[0].d = perturbed->x+t1*norm.x;
- myline->splines[0].c = (t2-t1)*norm.x;
- }
- end1->me.x = myline->splines[0].d;
- end2->me.x = myline->splines[0].d + myline->splines[0].c;
- end1->me.y = myline->splines[1].d;
- end2->me.y = myline->splines[1].d + myline->splines[1].c;
- end1->nextcp = end1->prevcp = end1->me;
- end2->nextcp = end2->prevcp = end2->me;
- end1->nonextcp = end1->noprevcp = end2->nonextcp = end2->noprevcp = true;
- end1->next = myline; end2->prev = myline;
- myline->from = end1; myline->to = end2;
-}
-
-static Spline *FindMatchingEdge(struct glyphdata *gd, struct pointdata *pd,
- int is_next, int only_hv ) {
- BasePoint *dir, perturbed, diff;
- Spline myline;
- SplinePoint end1, end2;
- double *other_t = is_next==2 ? &pd->both_e_t : is_next ? &pd->next_e_t : &pd->prev_e_t;
- double t;
- Spline *s;
- int cnt;
-
- if ( ( is_next && (pd->next_hor || pd->next_ver)) ||
- ( !is_next && ( pd->prev_hor || pd->prev_ver )) ||
- is_next == 2 )
-return( FindMatchingHVEdge(gd,pd,is_next,other_t));
- if ( only_hv ) {
- if (( is_next && ((pd->nextunit.y>-3*slope_error && pd->nextunit.y<3*slope_error) || (pd->nextunit.x>-3*slope_error && pd->nextunit.x<3*slope_error))) ||
- ( !is_next && ((pd->prevunit.y>-3*slope_error && pd->prevunit.y<3*slope_error) || (pd->prevunit.x>-3*slope_error && pd->prevunit.x<3*slope_error))))
- /* Close to vertical/horizontal */;
- else
-return( NULL );
- }
-
- if ( is_next ) {
- dir = &pd->nextunit;
- t = .001;
- s = pd->sp->next;
- } else {
- dir = &pd->prevunit;
- t = .999;
- s = pd->sp->prev;
- }
- if ( s==NULL )
-return( NULL );
- diff.x = s->to->me.x-s->from->me.x; diff.y = s->to->me.y-s->from->me.y;
- if ( diff.x<.03 && diff.x>-.03 && diff.y<.03 && diff.y>-.03 )
-return( NULL );
-
- /* Don't base the line on the current point, we run into rounding errors */
- /* where lines that should intersect it don't. Instead perturb it a tiny*/
- /* bit in the direction along the spline */
- forever {
- perturbed.x = ((s->splines[0].a*t+s->splines[0].b)*t+s->splines[0].c)*t+s->splines[0].d;
- perturbed.y = ((s->splines[1].a*t+s->splines[1].b)*t+s->splines[1].c)*t+s->splines[1].d;
- if ( !RealWithin(perturbed.x,pd->sp->me.x,.01) ||
- !RealWithin(perturbed.y,pd->sp->me.y,.01) )
- break;
- if ( t<.5 ) {
- t *= 2;
- if ( t>.5 )
- break;
- } else {
- t = 1- 2*(1-t);
- if ( t<.5 )
- break;
- }
- }
-
- MakeVirtualLine(gd,&perturbed,dir,&myline,&end1,&end2);
- /* prev_e_t = next_e_t = both_e_t =. This is where these guys are set */
- cnt = MonotonicOrder(gd->sspace,&myline,gd->stspace);
-return( MonotonicFindAlong(&myline,gd->stspace,cnt,s,other_t));
-}
-
-static int StillStem(struct glyphdata *gd, double t, int isnext,
- BasePoint *pos, struct stemdata *stem ) {
- Spline myline;
- SplinePoint end1, end2;
- int cnt, ret, neg;
-
- neg = 0;
- if ( stem->width<0 ) {
- neg = 1;
- stem->width = -stem->width;
- }
- MakeVirtualLine(gd,pos,&stem->unit,&myline,&end1,&end2);
- cnt = MonotonicOrder(gd->sspace,&myline,gd->stspace);
- ret = MonotonicFindStemBounds(&myline,gd->stspace,cnt,stem);
- if ( neg )
- stem->width = -stem->width;
-return( ret );
-}
-
-/* In TrueType I want to make sure that everything on a diagonal line remains */
-/* on the same line. Hence we compute the line. Also we are interested in */
-/* points that are on the intersection of two lines */
-static struct linedata *BuildLine(struct glyphdata *gd,struct pointdata *pd,int is_next ) {
- int i;
- BasePoint *dir, *base;
- struct pointdata **pspace = gd->pspace;
- int pcnt=0;
- double dist_error;
- struct linedata *line;
- double n_s_err, p_s_err, off;
-
- dir = is_next ? &pd->nextunit : &pd->prevunit;
- dist_error = ( dir->x==0 || dir->y==0 ) ? dist_error_hv : dist_error_diag ; /* Diagonals are harder to align */
- if ( dir->x==0 && dir->y==0 )
-return( NULL );
- base = &pd->sp->me;
-
- for ( i= (pd - gd->points)+1; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL ) {
- struct pointdata *pd2 = &gd->points[i];
- off = (pd2->sp->me.x-base->x)*dir->y - (pd2->sp->me.y-base->y)*dir->x;
- if ( off>dist_error || off<-dist_error )
- continue;
- n_s_err = dir->x*pd2->nextunit.y - dir->y*pd2->nextunit.x;
- p_s_err = dir->x*pd2->prevunit.y - dir->y*pd2->prevunit.x;
- if ( (n_s_err<slope_error && n_s_err>-slope_error && pd2->nextline==NULL ) ||
- (p_s_err<slope_error && p_s_err>-slope_error && pd2->prevline==NULL ))
- pspace[pcnt++] = pd2;
- }
-
- if ( pcnt==0 )
-return( NULL );
- if ( pcnt==1 ) {
- /* if the line consists of just these two points, only count it as */
- /* a true line if the two form a line */
- if ( (pd->sp->next->to!=pspace[0]->sp || !pd->sp->next->knownlinear) &&
- ( pd->sp->prev->from!=pspace[0]->sp || !pd->sp->prev->knownlinear ))
-return( NULL );
- }
-
- line = &gd->lines[gd->linecnt++];
- line->pcnt = pcnt+1;
- line->points = galloc((pcnt+1)*sizeof(struct pointdata *));
- line->points[0] = pd;
- line->unitvector = *dir;
- line->online = *base;
- for ( i=0; i<pcnt; ++i ) {
- n_s_err = dir->x*pspace[i]->nextunit.y - dir->y*pspace[i]->nextunit.x;
- p_s_err = dir->x*pspace[i]->prevunit.y - dir->y*pspace[i]->prevunit.x;
- if ( n_s_err<slope_error && n_s_err>-slope_error && pspace[i]->nextline==NULL ) {
- pspace[i]->nextline = line;
- if ( pspace[i]->colinear )
- pspace[i]->prevline = line;
- }
- if ( p_s_err<slope_error && p_s_err>-slope_error && pspace[i]->prevline==NULL ) {
- pspace[i]->prevline = line;
- if ( pspace[i]->colinear )
- pspace[i]->nextline = line;
- }
- line->points[i+1] = pspace[i];
- }
-return( line );
-}
-
-static struct stem_chunk *AddToStem(struct stemdata *stem,struct pointdata *pd1,struct pointdata *pd2,
- int is_next1, int is_next2, struct pointdata *pd2potential ) {
- struct stem_chunk *chunk;
- BasePoint *dir = &stem->unit;
- BasePoint *test = &pd1->sp->me;
- double off, dist_error;
- int j;
- struct pointdata *pd1potential = pd1;
-
- dist_error = ( dir->x==0 || dir->y==0 ) ? dist_error_hv : dist_error_diag; /* Diagonals are harder to align */
-
- off = (test->x-stem->left.x)*dir->y - (test->y-stem->left.y)*dir->x;
- if ( off>dist_error || off<-dist_error ) {
- struct pointdata *pd = pd1;
- int in = is_next1;
- pd1 = pd2; is_next1 = is_next2;
- pd2 = pd; is_next2 = in;
- pd1potential = pd2potential; pd2potential = NULL;
- }
-
- chunk = NULL;
- for ( j=stem->chunk_cnt-1; j>=0; --j ) {
- chunk = &stem->chunks[j];
- if ( chunk->l==pd1 && chunk->r==pd2 )
- break;
- }
-
- if ( j<0 ) {
- stem->chunks = grealloc(stem->chunks,(stem->chunk_cnt+1)*sizeof(struct stem_chunk));
- chunk = &stem->chunks[stem->chunk_cnt++];
- chunk->l = pd1;
- chunk->r = pd2;
- chunk->lpotential = pd1potential;
- chunk->rpotential = pd2potential;
- chunk->lnext = is_next1;
- chunk->rnext = is_next2;
- chunk->stemcheat = false;
- }
- if ( pd1!=NULL ) {
- if ( is_next1 ) {
- if ( pd1->nextstem == NULL ) {
- pd1->nextstem = stem;
- pd1->next_is_l = true;
-#if 0 /* They can be different, if so we need to figure which is better */
- if ( pd1->colinear )
- pd1->prevstem = stem;
-#endif
- }
- } else {
- if ( pd1->prevstem == NULL ) {
- pd1->prevstem = stem;
- pd1->prev_is_l = true;
- }
- }
- }
- if ( pd2!=NULL ) {
- if ( is_next2 ) {
- if ( pd2->nextstem == NULL ) {
- pd2->nextstem = stem;
- pd2->next_is_l = false; /* It's r */
- }
- } else {
- if ( pd2->prevstem == NULL ) {
- pd2->prevstem = stem;
- pd2->prev_is_l = false;
- }
- }
- }
-return( chunk );
-}
-
-static int OnStem(struct stemdata *stem,BasePoint *test) {
- double dist_error, off;
- BasePoint *dir = &stem->unit;
-
- dist_error = ( dir->x==0 || dir->y==0 ) ? dist_error_hv : dist_error_diag; /* Diagonals are harder to align */
-
- off = (test->x-stem->left.x)*dir->y - (test->y-stem->left.y)*dir->x;
- if ( off<dist_error && off>-dist_error )
-return( true );
-
- off = (test->x-stem->right.x)*dir->y - (test->y-stem->right.y)*dir->x;
- if ( off<=dist_error && off>=-dist_error )
-return( true );
-
-return( false );
-}
-
-static struct stemdata *FindStem(struct glyphdata *gd,struct pointdata *pd,
- BasePoint *dir,SplinePoint *match, int is_next2) {
- int j;
- BasePoint *mdir;
- struct pointdata *pd2;
- struct stemdata *stem;
- double err;
-
- if ( match->ttfindex==0xffff )
-return( NULL ); /* Point doesn't really exist */
-
- if ( gd->only_hv &&
- (dir->x<-slope_error || dir->x>slope_error) &&
- (dir->y<-slope_error || dir->y>slope_error)) {
- /* Not close enough to hor/vert, unless it's a serif */
- if ( pd->sp->next->to!=match && pd->sp->prev->from!=match )
-return( NULL );
- }
-
- pd2 = &gd->points[match->ttfindex];
-
- mdir = is_next2 ? &pd2->nextunit : &pd2->prevunit;
- if ( mdir->x==0 && mdir->y==0 )
-return( NULL );
- err = mdir->x*dir->y - mdir->y*dir->x;
- if (( err<slope_error && err>-slope_error ) ||
- (( dir->x>.99 || dir->x<-.99 || dir->y>.99 || dir->y<-.99 ) &&
- (pd->sp->next->to==match || pd->sp->prev->from==match) &&
- err<3*slope_error && err>-3*slope_error )) {
- /* Special check for cm serifs */
- stem = is_next2 ? pd2->nextstem : pd2->prevstem;
- if ( stem!=NULL && OnStem(stem,&pd->sp->me))
-return( stem );
-
- for ( j=0; j<gd->stemcnt; ++j ) {
- err = gd->stems[j].unit.x*dir->y - gd->stems[j].unit.y*dir->x;
- if ( err<slope_error && err>-slope_error &&
- OnStem(&gd->stems[j],&pd->sp->me) && OnStem(&gd->stems[j],&pd2->sp->me)) {
-return( &gd->stems[j] );
- }
- }
- if ( dir->y>.99 || dir->y<-.99 ) {
- for ( j=0; j<gd->stemcnt; ++j ) {
- if ( (gd->stems[j].unit.y>.99 || gd->stems[j].unit.y<-.99) &&
- ((match->me.x==gd->stems[j].left.x && pd->sp->me.x==gd->stems[j].right.x) ||
- (match->me.x==gd->stems[j].right.x && pd->sp->me.x==gd->stems[j].left.x))) {
- gd->stems[j].unit.x = gd->stems[j].l_to_r.y = 0;
- gd->stems[j].unit.y = ( gd->stems[j].unit.y*dir->y<0 ) ? -1 : 1;
- gd->stems[j].l_to_r.x = gd->stems[j].unit.y;
-return( &gd->stems[j] );
- }
- }
- } else if ( dir->x>.99 || dir->x<-.99 ) {
- for ( j=0; j<gd->stemcnt; ++j ) {
- if (( gd->stems[j].unit.x>.99 || gd->stems[j].unit.x<-.99 ) &&
- ((match->me.y==gd->stems[j].left.y && pd->sp->me.y==gd->stems[j].right.y) ||
- (match->me.y==gd->stems[j].right.y && pd->sp->me.y==gd->stems[j].left.y))) {
- gd->stems[j].unit.y = gd->stems[j].l_to_r.x = 0;
- gd->stems[j].unit.x = ( gd->stems[j].unit.x*dir->x<0 ) ? -1 : 1;
- gd->stems[j].l_to_r.y = gd->stems[j].unit.x;
-return( &gd->stems[j] );
- }
- }
- }
-return( (struct stemdata *) (-1) );
- }
-return( NULL );
-}
-
-static struct stemdata *NewStem(struct glyphdata *gd,BasePoint *dir,
- BasePoint *pos1, BasePoint *pos2) {
- struct stemdata * stem = &gd->stems[gd->stemcnt++];
-
- stem->unit = *dir;
- if ( dir->x+dir->y<0 ) {
- stem->unit.x = -stem->unit.x;
- stem->unit.y = -stem->unit.y;
- }
- if (( stem->unit.x>stem->unit.y && pos1->y<pos2->y ) ||
- (stem->unit.y>=stem->unit.x && pos1->x<pos2->x )) {
- stem->left = *pos1;
- stem->right = *pos2;
- } else {
- stem->left = *pos2;
- stem->right = *pos1;
- }
- /* Guess at which normal we want */
- stem->l_to_r.x = dir->y; stem->l_to_r.y = -dir->x;
- /* If we guessed wrong, use the other */
- if ( (stem->right.x-stem->left.x)*stem->l_to_r.x +
- (stem->right.y-stem->left.y)*stem->l_to_r.y < 0 ) {
- stem->l_to_r.x = -stem->l_to_r.x;
- stem->l_to_r.y = -stem->l_to_r.y;
- }
- stem->chunks = NULL;
- stem->chunk_cnt = 0;
-return( stem );
-}
-
-static int ParallelToDir(SplinePoint *sp,int checknext, BasePoint *dir,
- BasePoint *opposite,SplinePoint *basesp) {
- BasePoint n, o, *base = &basesp->me;
- double len, err;
-
- if ( checknext ) {
- if ( sp->next!=NULL && sp->next->knownlinear ) {
- n.x = sp->next->to->me.x - sp->me.x;
- n.y = sp->next->to->me.y - sp->me.y;
- } else {
- n.x = sp->nextcp.x - sp->me.x;
- n.y = sp->nextcp.y - sp->me.y;
- }
- len = n.x*n.x + n.y*n.y;
- if ( len == 0 )
-return( false );
- len = sqrt(len);
- n.x /= len;
- n.y /= len;
- } else {
- if ( sp->prev!=NULL && sp->prev->knownlinear ) {
- n.x = sp->prev->from->me.x - sp->me.x;
- n.y = sp->prev->from->me.y - sp->me.y;
- } else {
- n.x = sp->prevcp.x - sp->me.x;
- n.y = sp->prevcp.y - sp->me.y;
- }
- len = n.x*n.x + n.y*n.y;
- if ( len == 0 )
-return( false );
- len = sqrt(len);
- n.x /= len;
- n.y /= len;
- }
- err = n.x*dir->y - n.y*dir->x;
- if (( dir->x>.99 || dir->x<-.99 || dir->y>.99 || dir->y<-.99 ) &&
- (sp->next->to==basesp || sp->prev->from==basesp) ) {
- /* special check for serifs */
- if ( err>3*slope_error || err<-3*slope_error )
-return( false );
- } else {
- if ( err>slope_error || err<-slope_error )
-return( false );
- }
-
- /* Now sp must be on the same side of the spline as opposite */
- o.x = opposite->x-base->x; o.y = opposite->y-base->y;
- n.x = sp->me.x-base->x; n.y = sp->me.y-base->y;
- if ( ( o.x*dir->y - o.y*dir->x )*( n.x*dir->y - n.y*dir->x ) < 0 )
-return( false );
-
-return( true );
-}
-
-static int NearlyParallel(BasePoint *dir,Spline *other, double t) {
- BasePoint odir;
- double olen, dot;
-
- odir.x = (3*other->splines[0].a*t+2*other->splines[0].b)*t+other->splines[0].c;
- odir.y = (3*other->splines[1].a*t+2*other->splines[1].b)*t+other->splines[1].c;
- olen = sqrt(odir.x*odir.x + odir.y*odir.y);
- if ( olen==0 )
-return( false );
- odir.x /= olen; odir.y /= olen;
- dot = dir->x*odir.x + dir->y*odir.y;
- if ( dot>.95 || dot<-.95 ) /* cos(18) = .95 */
-return( true );
-
-return( false );
-}
-
-static double NormalDist(BasePoint *to, BasePoint *from, BasePoint *perp) {
- double len = (to->x-from->x)*perp->y - (to->y-from->y)*perp->x;
- if ( len<0 ) len = -len;
-return( len );
-}
-
-static int NewIsBetter(struct stemdata *stem,struct pointdata *pd,
- struct pointdata *newcomer, double width) {
- double stemwidth;
- int i, cnt;
- double newd, oldd;
- struct pointdata *former;
-
- stemwidth = (stem->left.x-stem->right.x)*stem->unit.y -
- (stem->left.y-stem->right.y)*stem->unit.x;
- if ( stemwidth<0 ) stemwidth = -stemwidth;
-
- if ( width>= stemwidth )
-return( false );
-
- for ( i=cnt=0; i<stem->chunk_cnt; ++i ) {
- former = NULL;
- if ( stem->chunks[i].r==pd || stem->chunks[i].rpotential==pd )
- former = stem->chunks[i].l==NULL ? stem->chunks[i].lpotential : stem->chunks[i].l;
- else if ( stem->chunks[i].l==pd || stem->chunks[i].lpotential==pd )
- former = stem->chunks[i].r==NULL ? stem->chunks[i].rpotential : stem->chunks[i].r;
- if ( former!=NULL ) {
- oldd = (former->sp->me.x-pd->sp->me.x)*stem->unit.x +
- (former->sp->me.y-pd->sp->me.y)*stem->unit.y;
- newd = (newcomer->sp->me.x-pd->sp->me.x)*stem->unit.x +
- (newcomer->sp->me.y-pd->sp->me.y)*stem->unit.y;
- if ( oldd<0 ) oldd = -oldd;
- if ( newd<0 ) newd = -newd;
- if ( newd>oldd ) {
- /* The old stem is wider, but the points are closer */
- /* if they are much further appart than the improvement we get from making the width smaller... */
- if ( (newd-oldd) > 4*(stemwidth-width) )
-return( false );
- }
- }
- if ( stem->chunks[i].r==pd || stem->chunks[i].l==pd )
- ++cnt;
- }
-
- if ( cnt>=2 )
-return( false );
-return( true );
-}
-
-static void MakePDPotential(struct stemdata *stem,struct pointdata *pd) {
- int i;
-
- for ( i=0; i<stem->chunk_cnt; ++i ) {
- if ( stem->chunks[i].l==pd ) {
- stem->chunks[i].lpotential = pd;
- stem->chunks[i].l=NULL;
- }
- if ( stem->chunks[i].r==pd ) {
- stem->chunks[i].rpotential=pd;
- stem->chunks[i].r=NULL;
- }
- }
-}
-
-static struct stemdata *TestStem(struct glyphdata *gd,struct pointdata *pd,
- BasePoint *dir,SplinePoint *match, int is_next, int is_next2) {
- struct pointdata *pd2, *pd2potential;
- struct stemdata *stem, *stem2 = (struct stemdata *) (-2);
- double width;
-
- if ( match->ttfindex==0xffff )
-return( NULL );
- width = (match->me.x-pd->sp->me.x)*dir->y - (match->me.y-pd->sp->me.y)*dir->x;
- if ( width<0 ) width = -width;
- if ( width<.5 )
-return( NULL ); /* Zero width stems aren't interesting */
- if ( (is_next && pd->sp->next->to==match) || (!is_next && pd->sp->prev->from==match) )
-return( NULL ); /* Don't want a stem between two splines that intersect */
-
- stem = FindStem(gd,pd,dir,match,is_next2);
- if ( stem==NULL )
-return( NULL );
-
- pd2 = &gd->points[match->ttfindex];
- stem2 = NULL;
- /* OK, we've got a valid stem between us and pd2. Now see if we get the */
- /* same stem when we look at pd2. If we do, then all is happy and nice */
- /* and we can add both points to the stem. If not, then we're sort of */
- /* happy, but we can only add pd to the stem */
- if ( pd2->nextstem==stem )
- stem2 = stem;
- else if ( pd2->prevstem==stem )
- stem2 = stem;
- else if ( is_next2 && pd2->nextstem!=NULL && NewIsBetter(pd2->nextstem,pd2,pd,width) ) {
- MakePDPotential(pd2->nextstem,pd2);
- pd2->nextstem = NULL;
- stem2 = stem;
- } else if ( !is_next2 && pd2->prevstem!=NULL && NewIsBetter(pd2->prevstem,pd2,pd,width) ) {
- MakePDPotential(pd2->prevstem,pd2);
- pd2->prevstem = NULL;
- stem2 = stem;
- } else if ( (is_next2 && pd2->nextstem==NULL) || (!is_next2 && pd2->prevstem==NULL) ) {
- stem2 = stem;
- } else
- stem2 = NULL;
-
- pd2potential = pd2;
- if ( stem2==NULL )
- pd2 = NULL;
-
- if ( stem==(struct stemdata *) (-1) )
- stem = NewStem(gd,dir,&pd->sp->me,&match->me);
-
- AddToStem(stem,pd,pd2,is_next,is_next2,pd2potential);
-return( stem );
-}
-
-static double FindSameSlope(Spline *s,BasePoint *dir,double close_to) {
- double a,b,c, desc;
- double t1,t2;
- double d1, d2;
-
- if ( s==NULL )
-return( -1e4 );
-
- a = dir->x*s->splines[1].a*3 - dir->y*s->splines[0].a*3;
- b = dir->x*s->splines[1].b*2 - dir->y*s->splines[0].b*2;
- c = dir->x*s->splines[1].c - dir->y*s->splines[0].c ;
- if ( a!=0 ) {
- desc = b*b - 4*a*c;
- if ( desc<0 )
-return( -1e4 );
- desc = sqrt(desc);
- t1 = (-b+desc)/(2*a);
- t2 = (-b-desc)/(2*a);
- if ( (d1=t1-close_to)<0 ) d1 = -d1;
- if ( (d2=t2-close_to)<0 ) d2 = -d2;
- if ( d2<d1 && t2>=-.001 && t2<=1.001 )
- t1 = t2;
- } else if ( b!=0 )
- t1 = -c/b;
- else
-return( -1e4 );
-
-return( t1 );
-}
-
-static struct stemdata *HalfStem(struct glyphdata *gd,struct pointdata *pd,
- BasePoint *dir,Spline *other,double other_t,int is_next) {
- /* Find the spot on other where the slope is the same as dir */
- double t1;
- double width, err;
- BasePoint match;
- struct stemdata *stem = NULL;
- int j;
-
- t1 = FindSameSlope(other,dir,other_t);
- if ( t1==-1e4 )
-return( NULL );
- if ( t1<0 && other->from->prev!=NULL && gd->points[other->from->ttfindex].colinear ) {
- other = other->from->prev;
- t1 = FindSameSlope(other,dir,1.0);
- } else if ( t1>1 && other->to->next!=NULL && gd->points[other->to->ttfindex].colinear ) {
- other = other->to->next;
- t1 = FindSameSlope(other,dir,0.0);
- }
-
- if ( t1<-.001 || t1>1.001 )
-return( NULL );
-
- /* Ok. the opposite edge has the right slope at t1 */
- /* Now see if we can make a one sided stem out of these two */
- match.x = ((other->splines[0].a*t1+other->splines[0].b)*t1+other->splines[0].c)*t1+other->splines[0].d;
- match.y = ((other->splines[1].a*t1+other->splines[1].b)*t1+other->splines[1].c)*t1+other->splines[1].d;
-
- width = (match.x-pd->sp->me.x)*dir->y - (match.y-pd->sp->me.y)*dir->x;
- /* offset = (match.x-pd->sp->me.x)*dir->x + (match.y-pd->sp->me.y)*dir->y;*/
- if ( width<.5 && width>-.5 )
-return( NULL ); /* Zero width stems aren't interesting */
-
- if ( isnan(t1))
- IError( "NaN value in HalfStem" );
-
- if ( is_next ) {
- pd->nextedge = other;
- pd->next_e_t = t1;
- } else {
- pd->prevedge = other;
- pd->prev_e_t = t1;
- }
-
- stem = NULL;
- for ( j=0; j<gd->stemcnt; ++j ) {
- err = gd->stems[j].unit.x*dir->y - gd->stems[j].unit.y*dir->x;
- if ( err<slope_error && err>-slope_error &&
- OnStem(&gd->stems[j],&pd->sp->me) && OnStem(&gd->stems[j],&match)) {
- stem = &gd->stems[j];
- break;
- }
- }
- if ( stem==NULL )
- stem = NewStem(gd,dir,&pd->sp->me,&match);
- AddToStem(stem,pd,NULL,is_next,false,NULL);
-return( stem );
-}
-
-static struct stemdata *FindOrMakeHVStem(struct glyphdata *gd,
- struct pointdata *pd, struct pointdata *pd2, int is_h) {
- int i;
- struct stemdata *stem;
- BasePoint dir;
-
- stem = NULL;
- memset(&dir,0,sizeof(dir));
- if ( is_h ) {
- dir.x = 1;
- for ( i=0; i<gd->stemcnt; ++i ) {
- stem = &gd->stems[i];
- if ( stem->unit.x==1 &&
- ((stem->left.y==pd->sp->me.y && stem->right.y==pd2->sp->me.y) ||
- (stem->left.y==pd2->sp->me.y && stem->right.y==pd->sp->me.y)))
- break;
- }
- if ( i==gd->stemcnt ) stem=NULL;
- } else {
- dir.y = 1;
- for ( i=0; i<gd->stemcnt; ++i ) {
- stem = &gd->stems[i];
- if ( stem->unit.y==1 &&
- ((stem->left.x==pd->sp->me.x && stem->right.x==pd2->sp->me.x) ||
- (stem->left.x==pd2->sp->me.x && stem->right.x==pd->sp->me.x)))
- break;
- }
- if ( i==gd->stemcnt ) stem=NULL;
- }
- if ( stem==NULL )
- stem = NewStem(gd,&dir,&pd->sp->me,&pd2->sp->me);
-return( stem );
-}
-
-static struct stemdata *EdgeStem(struct glyphdata *gd,struct pointdata *pd) {
- struct pointdata *pd2;
- /* suppose we have something like */
- /* *--* */
- /* \ \ */
- /* \ \ */
- /* Then let's create a vertical stem between the two points */
- /* (and a horizontal stem if the thing is rotated 90 degrees) */
- struct stemdata *stem = NULL;
- struct stem_chunk *chunk;
- double width, length1, length2;
-
- if ( !hint_diagonal_ends )
-return( NULL );
-
- if ( !gd->only_hv ||
- pd->sp->next==NULL || pd->sp->next->to->next==NULL )
-return( NULL );
- pd2 = &gd->points[pd->sp->next->to->ttfindex];
- if ( (pd->sp->me.x!=pd2->sp->me.x && pd->sp->me.y!=pd2->sp->me.y ) ||
- pd->sp->prev==NULL || !pd->sp->prev->knownlinear ||
- pd2->sp->next==NULL || !pd2->sp->next->knownlinear )
-return( NULL );
- if ( !UnitsParallel(&pd2->nextunit,&pd->prevunit ) )
-return( NULL );
- if ( pd->prevunit.x==0 || pd->prevunit.y==0 ) /* Must be diagonal */
-return( NULL );
-
- length1 = (pd->sp->prev->from->me.x-pd->sp->me.x)*(pd->sp->prev->from->me.x-pd->sp->me.x) +
- (pd->sp->prev->from->me.y-pd->sp->me.y)*(pd->sp->prev->from->me.y-pd->sp->me.y);
- length2 = (pd2->sp->next->to->me.x-pd2->sp->me.x)*(pd2->sp->next->to->me.x-pd2->sp->me.x) +
- (pd2->sp->next->to->me.y-pd2->sp->me.y)*(pd2->sp->next->to->me.y-pd2->sp->me.y);
- if ( length2<length1 )
- length1 = length2;
-
- if ( pd->sp->me.x==pd2->sp->me.x )
- width = pd->sp->me.y-pd2->sp->me.y;
- else
- width = pd->sp->me.x-pd2->sp->me.x;
-
- if ( width*width>length1 )
-return( NULL );
-
- stem = FindOrMakeHVStem(gd,pd,pd2,pd->sp->me.x==pd2->sp->me.x);
- chunk = AddToStem(stem,pd,pd2,false,true,NULL);
- chunk->stemcheat = true;
-return( stem );
-}
-
-static int ConnectsAcross(struct glyphdata *gd,SplinePoint *sp,int is_next,Spline *findme) {
- struct pointdata *pd = &gd->points[sp->ttfindex];
- Spline *other, *test;
- BasePoint *dir;
-
- if ( is_next )
- other = pd->nextedge;
- else
- other = pd->prevedge;
-
- if ( other==findme )
-return( true );
- if ( other==NULL )
-return( false );
-
- dir = &gd->points[other->to->ttfindex].nextunit;
- test = other->to->next;
- while ( test!=NULL &&
- gd->points[test->from->ttfindex].nextunit.x * dir->x +
- gd->points[test->from->ttfindex].nextunit.y * dir->y >= 0 ) {
- if ( test==findme )
-return( true );
- test = test->to->next;
- if ( test==other )
- break;
- }
-
- dir = &gd->points[other->from->ttfindex].prevunit;
- test = other->from->prev;
- while ( test!=NULL &&
- gd->points[test->to->ttfindex].prevunit.x * dir->x +
- gd->points[test->to->ttfindex].prevunit.y * dir->y >= 0 ) {
- if ( test==findme )
-return( true );
- test = test->from->prev;
- if ( test==other )
- break;
- }
-
-return( false );
-}
-
-static void BuildStem(struct glyphdata *gd,struct pointdata *pd,int is_next ) {
- BasePoint *dir;
- Spline *other, *cur;
- double t;
- double tod, fromd;
- struct stemdata *stem;
- int tp, fp;
- BasePoint opposite;
-
- if ( is_next ) {
- dir = &pd->nextunit;
- other = pd->nextedge;
- cur = pd->sp->next;
- t = pd->next_e_t;
- } else {
- dir = &pd->prevunit;
- other = pd->prevedge;
- cur = pd->sp->prev;
- t = pd->prev_e_t;
- }
- if ( other==NULL )
-return;
-
- opposite.x = ((other->splines[0].a*t+other->splines[0].b)*t+other->splines[0].c)*t+other->splines[0].d;
- opposite.y = ((other->splines[1].a*t+other->splines[1].b)*t+other->splines[1].c)*t+other->splines[1].d;
-
- tp = ParallelToDir(other->to,false,dir,&opposite,pd->sp);
- fp = ParallelToDir(other->from,true,dir,&opposite,pd->sp);
- stem = NULL;
- if ( is_next )
- stem = EdgeStem(gd,pd);
- if ( !tp && !fp )
-return;
-
- /* We have several conflicting metrics for getting the "better" stem */
- /* Generally we prefer the stem with the smaller width (but not always. See tilde) */
- /* Generally we prefer the stem formed by the point closer to the intersection */
- tod = (1-t)*NormalDist(&other->to->me,&pd->sp->me,dir);
- fromd = t*NormalDist(&other->from->me,&pd->sp->me,dir);
- stem = NULL;
- if ( (tp && (tod<fromd)) ||
- (tp && !fp && (tod<2*fromd)) ||
- (tp && !fp && (ConnectsAcross(gd,other->to,false,cur) ||
- NearlyParallel(dir,other,t))))
- stem = TestStem(gd,pd,dir, other->to, is_next, false);
- if ( stem==NULL && ((fp && (fromd<tod)) ||
- (fp && !tp && (fromd<2*tod)) ||
- (fp && !tp && (ConnectsAcross(gd,other->from,true,cur) ||
- NearlyParallel(dir,other,t)))))
- stem = TestStem(gd,pd,dir, other->from, is_next,true);
- if ( stem==NULL && cur!=NULL && !other->knownlinear && !cur->knownlinear )
- stem = HalfStem(gd,pd,dir,other,t,is_next);
-}
-
-static void DiagonalCornerStem(struct glyphdata *gd,struct pointdata *pd) {
- Spline *other = pd->bothedge;
- struct pointdata *pfrom = &gd->points[other->from->ttfindex],
- *pto = &gd->points[other->to->ttfindex],
- *pd2 = NULL, *pd3=NULL;
- double width, length;
- struct stemdata *stem;
- struct stem_chunk *chunk;
-
- if ( pd->symetrical_h && pto->symetrical_h && pd->both_e_t>.9 )
- pd2 = pto;
- else if ( pd->symetrical_h && pfrom->symetrical_h && pd->both_e_t<.1 )
- pd2 = pfrom;
- else if ( pd->symetrical_v && pto->symetrical_v && pd->both_e_t>.9 )
- pd2 = pto;
- else if ( pd->symetrical_v && pfrom->symetrical_v && pd->both_e_t<.1 )
- pd2 = pfrom;
- else if ( pd->symetrical_h && other->islinear && other->splines[1].c==0 ) {
- pd2 = pfrom;
- pd3 = pto;
- } else if ( pd->symetrical_v && other->islinear && other->splines[0].c==0 ) {
- pd2 = pfrom;
- pd3 = pto;
- } else
-return;
-
- if ( pd->symetrical_v )
- width = (pd->sp->me.x-pd2->sp->me.x);
- else
- width = (pd->sp->me.y-pd2->sp->me.y);
- length = (pd->sp->next->to->me.x-pd->sp->me.x)*(pd->sp->next->to->me.x-pd->sp->me.x) +
- (pd->sp->next->to->me.y-pd->sp->me.y)*(pd->sp->next->to->me.y-pd->sp->me.y);
- if ( width*width>length )
-return;
-
- stem = FindOrMakeHVStem(gd,pd,pd2,pd->symetrical_h);
- chunk = AddToStem(stem,pd,pd2,false,true,NULL);
- if ( pd3==NULL )
- chunk->stemcheat = 2;
- else {
- chunk->stemcheat = 3;
- chunk = AddToStem(stem,pd,pd3,false,true,NULL);
- chunk->stemcheat = 3;
- }
-}
-
-static int swidth_cmp(const void *_p1, const void *_p2) {
- const struct stemdata * const *stpt1 = _p1, * const *stpt2 = _p2;
- const struct stemdata *s1 = *stpt1, *s2 = *stpt2;
- if ( s1->width>s2->width )
-return( 1 );
- else if ( s1->width<s2->width )
-return( -1 );
-
-return( 0 );
-}
-
-static int IsL(BasePoint *bp,struct stemdata *stem) {
- double offl, offr;
-
- offl = (bp->x-stem->left.x)*stem->l_to_r.x + (bp->y-stem->left.y)*stem->l_to_r.y;
- if ( offl<0 ) offl = -offl;
- offr = (bp->x-stem->right.x)*stem->l_to_r.x + (bp->y-stem->right.y)*stem->l_to_r.y;
- if ( offr<0 ) offr = -offr;
-return( offl < offr );
-}
-
-static struct pointdata *PotentialAdd(struct glyphdata *gd,struct stemdata *stem,
- struct pointdata *pd, int is_next ) {
-
- if ( is_next && (pd->nextstem==NULL || pd->nextstem->toobig )) {
- pd->nextstem = stem;
- pd->next_is_l = IsL(&pd->sp->me,stem);
-return( pd );
- } else if ( !is_next && (pd->prevstem==NULL || pd->prevstem->toobig )) {
- pd->prevstem = stem;
- pd->prev_is_l = IsL(&pd->sp->me,stem);
-return( pd );
- }
-return( NULL );
-}
-
-static int IsClosestPotential(struct stemdata **sspace,int cur,int goodcnt,
- int is_l,struct stem_chunk *chunk) {
- struct pointdata *search;
- double mydist, dist;
- SplinePoint *sp1, *sp2;
- int i,j;
-
- if ( is_l ) {
- if ( chunk->r==NULL )
-return( false );
- search = chunk->lpotential;
- sp1 = search->sp; sp2 = chunk->r->sp;
- mydist = (sp1->me.x-sp2->me.x)*(sp1->me.x-sp2->me.x) +
- (sp1->me.y-sp2->me.y)*(sp1->me.y-sp2->me.y);
- } else {
- if ( chunk->l==NULL )
-return( false );
- search = chunk->rpotential;
- sp1 = search->sp; sp2 = chunk->l->sp;
- mydist = (sp1->me.x-sp2->me.x)*(sp1->me.x-sp2->me.x) +
- (sp1->me.y-sp2->me.y)*(sp1->me.y-sp2->me.y);
- }
- for ( i=cur+1; i<goodcnt; ++i ) {
- struct stemdata *stem = sspace[i];
- for ( j=0; j<stem->chunk_cnt; ++j ) {
- struct stem_chunk *chunk = &stem->chunks[j];
- if ( is_l && chunk->r!=NULL && chunk->l==NULL && chunk->lpotential==search ) {
- sp2 = chunk->r->sp;
- dist = (sp1->me.x-sp2->me.x)*(sp1->me.x-sp2->me.x) +
- (sp1->me.y-sp2->me.y)*(sp1->me.y-sp2->me.y);
- if ( dist<mydist )
-return( false );
- } else if ( !is_l && chunk->l!=NULL && chunk->r==NULL && chunk->rpotential==search ) {
- sp2 = chunk->l->sp;
- dist = (sp1->me.x-sp2->me.x)*(sp1->me.x-sp2->me.x) +
- (sp1->me.y-sp2->me.y)*(sp1->me.y-sp2->me.y);
- if ( dist<mydist )
-return( false );
- }
- }
- }
-return( true );
-}
-
-int UnitsParallel(BasePoint *u1,BasePoint *u2) {
- double dot = u1->x*u2->x + u1->y*u2->y;
-return( dot>.95 || dot < -.95 );
-}
-
-static void FixupT(struct stemdata *stem,struct pointdata *pd,int isnext) {
- /* When we calculated "next/prev_e_t" we deliberately did not use pd1->me */
- /* (because things get hard at intersections) so our t is only an approx-*/
- /* imation. We can do a lot better now */
- Spline *s;
- Spline myline;
- SplinePoint end1, end2;
- double width,t,sign, len, dot;
- BasePoint pts[9];
- extended lts[10], sts[10];
- BasePoint diff;
-
- width = (stem->right.x-stem->left.x)*stem->unit.y - (stem->right.y-stem->left.y)*stem->unit.x;
- s = isnext ? pd->nextedge : pd->prevedge;
- if ( s==NULL )
-return;
- diff.x = s->to->me.x-s->from->me.x; diff.y = s->to->me.y-s->from->me.y;
- if ( diff.x<.001 && diff.x>-.001 && diff.y<.001 && diff.y>-.001 )
-return; /* Zero length splines give us NaNs */
- len = sqrt( diff.x*diff.x + diff.y*diff.y );
- dot = (diff.x*stem->unit.x + diff.y*stem->unit.y)/len;
- if ( dot < .0004 && dot > -.0004 )
-return; /* It's orthogonal to our stem */
-
- if (( stem->unit.x==1 || stem->unit.x==-1 ) && s->knownlinear )
- t = (pd->sp->me.x-s->from->me.x)/(s->to->me.x-s->from->me.x);
- else if (( stem->unit.y==1 || stem->unit.y==-1 ) && s->knownlinear )
- t = (pd->sp->me.y-s->from->me.y)/(s->to->me.y-s->from->me.y);
- else {
- memset(&myline,0,sizeof(myline));
- memset(&end1,0,sizeof(end1));
- memset(&end2,0,sizeof(end2));
- sign = ( (isnext && pd->next_is_l) || (!isnext && pd->prev_is_l)) ? 1 : -1;
- myline.knownlinear = myline.islinear = true;
- end1.me = pd->sp->me;
- end2.me.x = pd->sp->me.x+1.1*sign*width*stem->l_to_r.x;
- end2.me.y = pd->sp->me.y+1.1*sign*width*stem->l_to_r.y;
- end1.nextcp = end1.prevcp = end1.me;
- end2.nextcp = end2.prevcp = end2.me;
- end1.nonextcp = end1.noprevcp = end2.nonextcp = end2.noprevcp = true;
- end1.next = &myline; end2.prev = &myline;
- myline.from = &end1; myline.to = &end2;
- myline.splines[0].d = end1.me.x;
- myline.splines[0].c = end2.me.x-end1.me.x;
- myline.splines[1].d = end1.me.y;
- myline.splines[1].c = end2.me.y-end1.me.y;
- if ( SplinesIntersect(&myline,s,pts,lts,sts)<=0 )
-return;
- t = sts[0];
- }
- if ( isnan(t))
- IError( "NaN value in FixupT" );
- if ( isnext )
- pd->next_e_t = t;
- else
- pd->prev_e_t = t;
-}
-
-static int StemIsActiveAt(struct glyphdata *gd,struct stemdata *stem,double stempos ) {
- BasePoint pos;
- int which;
- double test;
- struct monotonic **space, *m;
- int winding, nw, i,j;
- m = NULL; nw = 0;
- pos.x = stem->left.x + stempos*stem->unit.x;
- pos.y = stem->left.y + stempos*stem->unit.y;
-
- if ( stem->unit.x==0 || stem->unit.y==0 ) {
- which = stem->unit.x==0;
- MonotonicFindAt(gd->ms,which,((real *) &pos.x)[which],space = gd->space);
- test = ((real *) &pos.x)[!which] - dist_error_hv;
-
- winding = 0;
- for ( i=0; space[i]!=NULL; ++i ) {
- m = space[i];
- nw = ((&m->xup)[which] ? 1 : -1 );
- if ( m->other>=test )
- break;
- winding += nw;
- }
- if ( space[i]==NULL || m->other>test+2*dist_error_hv )
-return( false );
- j = MatchWinding(space,i,nw,winding,which);
- if ( j==-1 )
-return( false );
- m = space[j];
- if ( m->other>=((real *) &stem->right.x)[!which]-dist_error_hv &&
- m->other<=((real *) &stem->right.x)[!which]+dist_error_hv )
-return( true );
-return( false );
- } else {
- Spline myline;
- SplinePoint end1, end2;
- int cnt;
- MakeVirtualLine(gd,&pos,&stem->unit,&myline,&end1,&end2);
- cnt = MonotonicOrder(gd->sspace,&myline,gd->stspace);
-return( MonotonicFindStemBounds(&myline,gd->stspace,cnt,stem));
- }
-}
-
-static int WalkSpline(struct glyphdata *gd, SplinePoint *sp,int gonext,struct stemdata *stem,BasePoint *res) {
- int i;
- double off,diff;
- double incr;
- double t=.5;
- Spline *s;
- BasePoint pos, good;
- /* Some splines have tiny control points and are almost flat */
- /* think of them as lines then rather than treating them as curves */
- /* figure out how long they remain within a few orthoganal units of */
- /* the point */
-
- if ( gonext ) {
- s = sp->next;
- incr = .25;
- *res = sp->nextcp;
- } else {
- s = sp->prev;
- incr = -.25;
- *res = sp->prevcp;
- }
- good = *res;
- for ( i=0; i<6; ++i ) {
- pos.x = ((s->splines[0].a*t+s->splines[0].b)*t+s->splines[0].c)*t+s->splines[0].d;
- pos.y = ((s->splines[1].a*t+s->splines[1].b)*t+s->splines[1].c)*t+s->splines[1].d;
- diff = (pos.x-sp->me.x)*stem->l_to_r.x +
- (pos.y-sp->me.y)*stem->l_to_r.y;
- if ( diff>=-dist_error_hv && diff<dist_error_hv && StillStem(gd,t,gonext,&pos,stem)) {
- good = pos;
- t += incr;
- } else
- t -= incr;
- incr/=2;
- }
- off = (res->x-sp->me.x)*stem->unit.x + (res->y-sp->me.y)*stem->unit.y;
- diff = (good.x-sp->me.x)*stem->unit.x + (good.y-sp->me.y)*stem->unit.y;
- if (( off>0 && diff>off ) || ( off<0 && diff<off )) {
- *res = good;
-return( false ); /* Treat as a funny line */
- }
-return( true ); /* Treat as curved */
-}
-
-static BasePoint *AdjustForImperfectSlopeMatch(SplinePoint *sp,BasePoint *pos,
- struct stemdata *stem,BasePoint *temp) {
- double off;
-
- off = (pos->x-sp->me.x)*stem->l_to_r.x +
- (pos->y-sp->me.y)*stem->l_to_r.y;
- if ( off<0 ) off=-off;
- if ( off<=dist_error_hv )
-return( pos );
-
- temp->x = sp->me.x + dist_error_hv*(pos->x-sp->me.x)/off;
- temp->y = sp->me.y + dist_error_hv*(pos->y-sp->me.y)/off;
-return( temp );
-}
-
-static int AddLineSegment(struct stemdata *stem, struct segment *space, int cnt,
- struct pointdata *pd, struct glyphdata *gd ) {
- double s, e;
- BasePoint stemp, etemp, stemp2, etemp2;
- BasePoint *start, *end;
- int scurved = false, ecurved = false;
- SplinePoint *sp, *psp, *nsp;
- double b;
-
- if ( pd==NULL || (sp = pd->sp)==NULL || sp->ticked ||
- sp->next==NULL || sp->prev==NULL )
-return( cnt );
- end = &sp->me;
- start = &sp->me;
- if ( UnitsParallel(&pd->nextunit,&stem->unit)) {
- if ( sp->next->knownlinear ) {
- nsp = sp->next->to;
- end = &nsp->me;
- if ( nsp->next!=NULL && !nsp->next->knownlinear && !nsp->ticked &&
- UnitsParallel(&gd->points[nsp->ttfindex].nextunit,&stem->unit)) {
- WalkSpline(gd,nsp,true,stem,&etemp);
- end = &etemp;
- nsp->ticked = true;
- }
- } else {
- WalkSpline(gd,sp,true,stem,&etemp);
- ecurved = true;
- end = &etemp;
- }
- } else {
- if ( !WalkSpline(gd,sp,true,stem,&etemp))
- end = &etemp;
- }
- if ( UnitsParallel(&pd->prevunit,&stem->unit)) {
- if ( sp->prev->knownlinear ) {
- psp = sp->prev->from;
- start = &psp->me;
- if ( psp->prev!=NULL && !psp->prev->knownlinear && !psp->ticked &&
- UnitsParallel(&gd->points[psp->ttfindex].prevunit,&stem->unit)) {
- WalkSpline(gd,psp,false,stem,&stemp);
- start = &stemp;
- psp->ticked = true;
- }
- } else {
- WalkSpline(gd,sp,false,stem,&stemp);
- scurved = true;
- start = &stemp;
- }
- } else {
- if ( !WalkSpline(gd,sp,false,stem,&stemp))
- start = &stemp;
- }
-
- sp->ticked = true;
-
- /* Now if the segment sp-start doesn't have exactly the right slope, then */
- /* we can only use that bit of it which is less than a standard error */
- start = AdjustForImperfectSlopeMatch(sp,start,stem,&stemp2);
- end = AdjustForImperfectSlopeMatch(sp,end,stem,&etemp2);
-
- s = (start->x-stem->left.x)*stem->unit.x +
- (start->y-stem->left.y)*stem->unit.y;
- e = ( end->x-stem->left.x)*stem->unit.x +
- ( end->y-stem->left.y)*stem->unit.y;
- b = 0;
- if ( scurved || ecurved ) {
- b = (sp->me.x-stem->left.x)*stem->unit.x +
- (sp->me.y-stem->left.y)*stem->unit.y;
- if ( scurved )
- s = b + (s-b)*1.3;
- if ( ecurved )
- e = b + (e-b)*1.3;
- }
- if ( s==e )
-return( cnt );
- if ( s>e ) {
- double t = s;
- int c = scurved;
- s = e;
- e = t;
- scurved = ecurved;
- ecurved = c;
- }
- space[cnt].start = s;
- space[cnt].end = e;
- space[cnt].base = b;
- space[cnt].curved= scurved | (ecurved?2:0);
-return( cnt+1 );
-}
-
-static int segment_cmp(const void *_s1, const void *_s2) {
- const struct segment *s1 = _s1, *s2 = _s2;
- if ( s1->start<s2->start )
-return( -1 );
- else if ( s1->start>s2->start )
-return( 1 );
-
-return( 0 );
-}
-
-static int proj_cmp(const void *_p1, const void *_p2) {
- struct pointdata * const *p1 = _p1, * const *p2 = _p2;
- if ( (*p1)->projection<(*p2)->projection )
-return( -1 );
- else if ( (*p1)->projection>(*p2)->projection )
-return( 1 );
-
-return( 0 );
-}
-
-static int InActive(double projection,struct segment *segments, int cnt) {
- int i;
-
- for ( i=0; i<cnt; ++i ) {
- if ( projection<=segments[i].end )
-return( projection>=segments[i].start );
- }
-return( false );
-}
-
-static int MergeSegments(struct segment *space, int cnt) {
- int i,j;
-
- for ( i=j=0; i<cnt; ++i, ++j ) {
- if ( i!=j )
- space[j] = space[i];
- while ( i+1<cnt && space[i+1].start<space[j].end ) {
- if ( space[i+1].end>space[j].end ) {
- space[j].end = space[i+1].end;
- space[j].curved = (space[j].curved&1) | (space[i+1].curved&2);
- }
- ++i;
- }
- }
-return( j );
-}
-
-static void FigureStemActive(struct glyphdata *gd, struct stemdata *stem) {
- int i, j, pcnt=0;
- struct pointdata *pd, **pspace = gd->pspace;
- struct segment *lspace = gd->lspace, *rspace = gd->rspace;
- struct segment *bothspace = gd->bothspace, *activespace = gd->activespace;
- int lcnt, rcnt, bcnt, bpos, acnt;
- double width, last, len, clen;
-
- width = (stem->left.x-stem->right.x)*stem->unit.y -
- (stem->left.y-stem->right.y)*stem->unit.x;
- stem->width=width;
-
- for ( i=0; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL )
- gd->points[i].sp->ticked = false;
-
- lcnt = rcnt = 0;
- for ( i=0; i<stem->chunk_cnt; ++i ) {
- lcnt = AddLineSegment(stem,lspace,lcnt,stem->chunks[i].l, gd );
- if ( stem->chunks[i].lpotential!=stem->chunks[i].l )
- lcnt = AddLineSegment(stem,lspace,lcnt,stem->chunks[i].lpotential, gd );
- rcnt = AddLineSegment(stem,rspace,rcnt,stem->chunks[i].r, gd );
- if ( stem->chunks[i].rpotential!=stem->chunks[i].r )
- rcnt = AddLineSegment(stem,rspace,rcnt,stem->chunks[i].rpotential, gd );
- }
- bcnt = 0;
- if ( lcnt!=0 && rcnt!=0 ) {
- if ( lcnt==1 && rcnt==1 && lspace[0].curved && rspace[0].curved ) {
- double gap;
- if ( lspace[0].start>rspace[0].end )
- gap = lspace[0].start-rspace[0].end;
- else if ( rspace[0].start>lspace[0].end )
- gap = rspace[0].start-lspace[0].end;
- else
- gap = 0;
- if ( gap < (lspace[0].end-lspace[0].start + rspace[0].end-rspace[0].start)/2 ) {
- if ( lspace[0].base<rspace[0].start )
- rspace[0].start = lspace[0].base;
- else if ( lspace[0].base>rspace[0].end )
- rspace[0].end = lspace[0].base;
- if ( rspace[0].base<lspace[0].start )
- lspace[0].start = rspace[0].base;
- else if ( rspace[0].base>lspace[0].end )
- lspace[0].end = rspace[0].base;
- }
- }
- qsort(lspace,lcnt,sizeof(struct segment),segment_cmp);
- qsort(rspace,rcnt,sizeof(struct segment),segment_cmp);
- lcnt = MergeSegments(lspace,lcnt);
- rcnt = MergeSegments(rspace,rcnt);
- for ( i=j=bcnt=0; i<lcnt && j<rcnt; ++i ) {
- while ( j<rcnt && rspace[j].end<=lspace[i].start )
- ++j;
- while ( j<rcnt && rspace[j].start<=lspace[i].end ) {
- double s = lspace[i].start;
- double e = lspace[i].end;
- if ( rspace[j].start>s )
- s = rspace[j].start;
- if ( rspace[j].end<e )
- e = rspace[j].end;
- bothspace[bcnt ].curved= rspace[j].curved || lspace[i].curved;
- bothspace[bcnt ].start = s;
- bothspace[bcnt++].end = e;
- if ( rspace[j].end>lspace[i].end )
- break;
- ++j;
- }
- }
- }
-
- acnt = 0;
- if ( bcnt!=0 ) {
- for ( i=0; i<gd->pcnt; ++i ) if ( (pd = &gd->points[i])->sp!=NULL ) {
- /* Let's say we have a stem. And then inside that stem we have */
- /* another rectangle. So our first stem isn't really a stem any */
- /* more (because we hit another edge first), yet it's still reasonable*/
- /* to align the original stem */
- /* Now suppose the rectangle is rotated a bit so we can't make */
- /* a stem from it. What do we do here? */
- double inverseproj = (pd->sp->me.x-stem->right.x)*stem->unit.y -
- (pd->sp->me.y-stem->right.y)*stem->unit.x;
- if ( (width>0 && inverseproj>=0 && inverseproj<=width) ||
- (width<0 && inverseproj<=0 && inverseproj>=-width)) {
- pd->projection = (pd->sp->me.x - stem->left.x)*stem->unit.x +
- (pd->sp->me.y - stem->left.y)*stem->unit.y;
- if ( InActive(pd->projection,bothspace,bcnt) )
- pspace[pcnt++] = pd;
- }
- }
- qsort(pspace,pcnt,sizeof(struct pointdata *),proj_cmp);
-
- bpos = i = 0;
- while ( bpos<bcnt ) {
- if ( bothspace[bpos].curved ) {
- activespace[acnt++] = bothspace[bpos++];
- } else {
- last = bothspace[bpos].start;
- while ( i<pcnt && pspace[i]->projection<bothspace[bpos].end ) {
- if ( last<pspace[i]->projection ) {
- if ( StemIsActiveAt(gd,stem,(1.001*last+pspace[i]->projection)/2.001) ) {
- if ( acnt==0 || activespace[acnt-1].end!=last ) {
- activespace[acnt ].curved = bothspace[bpos].curved;
- activespace[acnt++].start = last;
- }
- activespace[acnt-1].end = pspace[i]->projection;
- }
- last = pspace[i]->projection;
- }
- ++i;
- }
- if ( StemIsActiveAt(gd,stem,(1.001*last+bothspace[bpos].end)/2.001) ) {
- if ( acnt==0 || activespace[acnt-1].end!=last ) {
- activespace[acnt ].curved = bothspace[bpos].curved;
- activespace[acnt++].start = last;
- }
- activespace[acnt-1].end = bothspace[bpos].end;
- }
- ++bpos;
- }
- }
- }
-
- for ( i=0; i<stem->chunk_cnt; ++i ) {
- struct stem_chunk *chunk = &stem->chunks[i];
- if ( chunk->stemcheat==3 && chunk->l!=NULL && chunk->r!=NULL &&
- i+1<stem->chunk_cnt &&
- stem->chunks[i+1].stemcheat==3 && chunk->l==stem->chunks[i+1].l ) {
- SplinePoint *sp = chunk->l->sp;
- double proj = (sp->me.x - stem->left.x) *stem->unit.x +
- (sp->me.y - stem->left.y) *stem->unit.y;
- SplinePoint *sp2 = chunk->r->sp, *sp3 = stem->chunks[i+1].r->sp;
- double proj2 = (sp2->me.x - stem->left.x) *stem->unit.x +
- (sp2->me.y - stem->left.y) *stem->unit.y;
- double proj3 = (sp3->me.x - stem->left.x) *stem->unit.x +
- (sp3->me.y - stem->left.y) *stem->unit.y;
- activespace[acnt ].curved = false;
- if ( proj2<proj3 ) {
- activespace[acnt ].start = proj2;
- activespace[acnt ].end = proj3;
- } else {
- activespace[acnt ].start = proj3;
- activespace[acnt ].end = proj2;
- }
- activespace[acnt++].base = proj;
- ++i;
- } else if ( chunk->stemcheat==4 && chunk->l!=NULL && chunk->r!=NULL ) {
- SplinePoint *sp = chunk->l->sp;
- SplinePoint *sp2 = chunk->r->sp;
- double proj = (sp->me.x - stem->left.x) *stem->unit.x +
- (sp->me.y - stem->left.y) *stem->unit.y;
- double proj2 = (sp2->me.x - stem->left.x) *stem->unit.x +
- (sp2->me.y - stem->left.y) *stem->unit.y;
- activespace[acnt ].curved = false;
- if ( proj2<proj ) {
- activespace[acnt ].start = proj2;
- activespace[acnt ].end = proj;
- } else {
- activespace[acnt ].start = proj;
- activespace[acnt ].end = proj2;
- }
- activespace[acnt++].base = proj;
- ++i;
- } else if ( chunk->stemcheat && chunk->l!=NULL && chunk->r!=NULL ) {
- SplinePoint *sp = chunk->l->sp;
- double proj = (sp->me.x - stem->left.x) *stem->unit.x +
- (sp->me.y - stem->left.y) *stem->unit.y, orig_proj=proj;
- SplinePoint *other = chunk->lnext ? sp->next->to : sp->prev->from;
- double len = (other->me.x-sp->me.x) * stem->unit.x +
- (other->me.y-sp->me.y) * stem->unit.y;
- double width = (stem->width<0) ? -stem->width : stem->width;
- if ( chunk->stemcheat==2 )
- proj -= width/2;
- else if ( len<0 )
- proj -= width;
- activespace[acnt ].curved = true;
- activespace[acnt ].start = proj;
- activespace[acnt ].end = proj+width;
- activespace[acnt++].base = orig_proj;
- }
- }
-
- stem->activecnt = acnt;
- if ( acnt!=0 ) {
- stem->active = galloc(acnt*sizeof(struct segment));
- memcpy(stem->active,activespace,acnt*sizeof(struct segment));
- }
- if ( stem->width<0 )
- stem->width = -stem->width;
-
- len = clen = 0;
- for ( i=0; i<acnt; ++i ) {
- if ( stem->active[i].curved )
- clen += stem->active[i].end-stem->active[i].start;
- else
- len += stem->active[i].end-stem->active[i].start;
- }
- stem->len = len; stem->clen = len+clen;
-}
-
-static void GDStemsFixupIntersects(struct glyphdata *gd) {
- int i,j;
-
- for ( i=0; i<gd->stemcnt; ++i ) {
- struct stemdata *stem = &gd->stems[i];
- for ( j=0; j<stem->chunk_cnt; ++j ) {
- struct stem_chunk *chunk = &stem->chunks[j];
- if ( chunk->l!=NULL && stem==chunk->l->nextstem )
- FixupT(stem,chunk->l,true);
- if ( chunk->l!=NULL && stem==chunk->l->prevstem )
- FixupT(stem,chunk->l,false);
- if ( chunk->r!=NULL && stem==chunk->r->nextstem )
- FixupT(stem,chunk->r,true);
- if ( chunk->r!=NULL && stem==chunk->r->prevstem )
- FixupT(stem,chunk->r,false);
- }
- }
-}
-
-static void GDFindMismatchedParallelStems(struct glyphdata *gd) {
- int i;
- struct pointdata *pd;
- double width;
-
- for ( i=0; i<gd->stemcnt; ++i ) {
- struct stemdata *stem = &gd->stems[i];
-
- width = (stem->left.x-stem->right.x)*stem->unit.y -
- (stem->left.y-stem->right.y)*stem->unit.x;
- if ( width<0 ) width = -width;
- stem->width = width;
- }
-
- for ( i=0; i<gd->pcnt; ++i ) if ( (pd = &gd->points[i])->sp!=NULL && pd->colinear ) {
- if ( pd->nextstem!=NULL && pd->prevstem!=NULL &&
- pd->nextstem != pd->prevstem ) {
- if ( pd->nextstem->width<pd->prevstem->width ) {
- MakePDPotential(pd->prevstem,pd);
- pd->prevstem = pd->nextstem;
- } else {
- MakePDPotential(pd->nextstem,pd);
- pd->nextstem = pd->prevstem;
- }
- }
- }
-}
-
-static void GDFindUnlikelyStems(struct glyphdata *gd) {
- double width;
- int i;
- double em = (gd->sc->parent->ascent+gd->sc->parent->descent);
-
- GDStemsFixupIntersects(gd);
-
- GDFindMismatchedParallelStems(gd);
-
- /* If a stem has straight edges, and it is wider than tall */
- /* then it is unlikely to be a real stem */
- for ( i=0; i<gd->stemcnt; ++i ) {
- struct stemdata *stem = &gd->stems[i];
-
- width = stem->width;
- stem->toobig = ( width<=em/8 && 2.0*stem->clen < width ) ||
- ( width>em/8 && width<=em/4 && 1.5*stem->clen < width ) ||
- ( width>em/4 && stem->clen < width );
- }
-}
-
-static void AddOpposite(struct glyphdata *gd,struct stem_chunk *chunk,
- struct stemdata *stem) {
- Spline *s;
- double t;
- struct pointdata **other;
-
- if ( chunk->l!=NULL ) {
- if ( chunk->l->nextstem == stem ) {
- s = chunk->l->nextedge;
- t = chunk->l->next_e_t;
- } else {
- s = chunk->l->prevedge;
- t = chunk->l->prev_e_t;
- }
- other = &chunk->r;
- } else {
- if ( chunk->r->nextstem == stem ) {
- s = chunk->r->nextedge;
- t = chunk->r->next_e_t;
- } else {
- s = chunk->r->prevedge;
- t = chunk->r->prev_e_t;
- }
- other = &chunk->l;
- }
- if ( s!=NULL && s->knownlinear ) {
- struct pointdata *fpd = &gd->points[s->from->ttfindex];
- struct pointdata *tpd = &gd->points[s->to->ttfindex];
- if ( fpd->nextstem==NULL && OnStem(stem,&fpd->sp->me)) {
- fpd->nextstem = stem;
- fpd->next_is_l = chunk->l==NULL;
- if ( t<.5 )
- *other = fpd;
- }
- if ( tpd->prevstem == NULL && OnStem(stem,&tpd->sp->me)) {
- tpd->prevstem = stem;
- tpd->prev_is_l = chunk->l==NULL;
- if ( t>.5 )
- *other = tpd;
- }
- }
-}
-
-static void CheckForBoundingBoxHints(struct glyphdata *gd) {
- /* Adobe seems to add hints at the bounding boxes of glyphs with no hints */
- int hcnt=0, vcnt=0, i;
- struct stemdata *stem;
- SplinePoint *minx, *maxx, *miny, *maxy;
- SplineFont *sf;
- int emsize;
- struct stem_chunk *chunk;
-
- for ( i=0; i<gd->stemcnt; ++i ) {
- stem = &gd->stems[i];
- if ( stem->toobig )
- break;
- if ( stem->unit.x > .9 || stem->unit.x < -.9 )
- ++hcnt;
- else
- ++vcnt;
- }
- if ( hcnt!=0 && vcnt!=0 )
-return;
-
- minx = maxx = miny = maxy = NULL;
- for ( i=0; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL ) {
- SplinePoint *sp = gd->points[i].sp;
- if ( minx==NULL )
- minx = maxx = miny = maxy = sp;
- else {
- if ( minx->me.x>sp->me.x )
- minx = sp;
- else if ( maxx->me.x<sp->me.x )
- maxx = sp;
- if ( miny->me.y>sp->me.y )
- miny = sp;
- else if ( maxy->me.y<sp->me.y )
- maxy = sp;
- }
- }
-
- if ( minx==NULL ) /* No contours */
-return;
-
- sf = gd->sc->parent;
- emsize = sf->ascent+sf->descent;
-
- if ( hcnt==0 && maxy->me.y!=miny->me.y && maxy->me.y-miny->me.y<emsize/2 ) {
- struct pointdata *pd = &gd->points[maxy->ttfindex],
- *pd2 = &gd->points[miny->ttfindex];
- stem = FindOrMakeHVStem(gd,pd,pd2,true);
- chunk = AddToStem(stem,pd,pd2,false,true,NULL);
- chunk->stemcheat = 4;
- FigureStemActive(gd,stem);
- stem->toobig = false;
- stem->clen += stem->width;
- }
-
- if ( vcnt==0 && maxx->me.x!=minx->me.x && maxx->me.x-minx->me.x<emsize/2 ) {
- struct pointdata *pd = &gd->points[maxx->ttfindex],
- *pd2 = &gd->points[minx->ttfindex];
- stem = FindOrMakeHVStem(gd,pd,pd2,false);
- chunk = AddToStem(stem,pd,pd2,false,true,NULL);
- chunk->stemcheat = 4;
- FigureStemActive(gd,stem);
- stem->toobig = false;
- stem->clen += stem->width;
- }
-}
-
-struct glyphdata *GlyphDataBuild(SplineChar *sc, int only_hv) {
- struct glyphdata *gd;
- int i,j;
- SplineSet *ss;
- SplinePoint *sp;
- Monotonic *m;
- int cnt, goodcnt;
- struct stemdata **sspace;
- int em = sc->parent!=NULL ? sc->parent->ascent+sc->parent->descent : 1000;
-
- /* We can't hint type3 fonts, so the only layer we care about is ly_fore */
- /* We shan't try to hint references yet */
- if ( sc->layers[ly_fore].splines==NULL )
-return( NULL );
-
- dist_error_hv = .003*em;
- dist_error_diag = .006*em;
-
- gd = gcalloc(1,sizeof(struct glyphdata));
- gd->only_hv = only_hv;
-
- /* SSToMContours can clean up the splinesets (remove 0 length splines) */
- /* so it must be called BEFORE everything else (even though logically */
- /* that doesn't make much sense). Otherwise we might have a pointer */
- /* to something since freed */
- gd->ms = SSsToMContours(sc->layers[ly_fore].splines,over_remove); /* second argument is meaningless here */
-
- gd->realcnt = gd->pcnt = SCNumberPoints(sc);
- for ( i=0, ss=sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next, ++i );
- gd->ccnt = i;
- gd->contourends = galloc((i+1)*sizeof(int));
- for ( i=0, ss=sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next, ++i ) {
- SplinePoint *last;
- if ( ss->first->prev!=NULL )
- last = ss->first->prev->from;
- else
- last = ss->last;
- if ( last->ttfindex==0xffff )
- gd->contourends[i] = last->nextcpindex;
- else
- gd->contourends[i] = last->ttfindex;
- }
- gd->contourends[i] = -1;
- gd->sc = sc;
- gd->sf = sc->parent;
- gd->fudge = (sc->parent->ascent+sc->parent->descent)/500;
-
- /* Create temporary point numbers for the implied points. We need this */
- /* for metafont if nothing else */
- for ( ss= sc->layers[ly_fore].splines; ss!=NULL; ss = ss->next ) {
- for ( sp = ss->first; ; ) {
- if ( sp->ttfindex == 0xffff )
- sp->ttfindex = gd->pcnt++;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
- gd->norefpcnt = gd->pcnt;
- /* And for 0xfffe points such as those used in glyphs with order2 glyphs */
- /* with references. */
- for ( ss= sc->layers[ly_fore].splines; ss!=NULL; ss = ss->next ) {
- for ( sp = ss->first; ; ) {
- if ( sp->ttfindex == 0xfffe )
- sp->ttfindex = gd->pcnt++;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
-
- gd->points = gcalloc(gd->pcnt,sizeof(struct pointdata));
- for ( ss=sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) if ( ss->first->prev!=NULL ) {
- for ( sp=ss->first; ; ) {
- PointInit(gd,sp,ss);
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
-
- /*gd->ms = SSsToMContours(sc->layers[ly_fore].splines,over_remove);*/ /* second argument is meaningless here */
- for ( m=gd->ms, cnt=0; m!=NULL; m=m->linked, ++cnt );
- gd->space = galloc((cnt+2)*sizeof(Monotonic*));
- gd->mcnt = cnt;
-
- for ( i=0; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL ) {
- struct pointdata *pd = &gd->points[i];
- if ( !pd->nextzero )
- pd->nextedge = FindMatchingEdge(gd,pd,true,only_hv);
- if ( !pd->prevzero )
- pd->prevedge = FindMatchingEdge(gd,pd,false,only_hv);
- if ( only_hv && (pd->symetrical_h || pd->symetrical_v ))
- pd->bothedge = FindMatchingEdge(gd,pd,2,only_hv);
-
- }
-
-#if 0
- /* Consider the slash character. We have a diagonal stem capped with two */
- /* horizontal lines. From the upper right corner, a line drawn normal to*/
- /* the right diagonal stem will intersect the top cap, very close to the*/
- /* upper right corner. That isn't interesting information */
- for ( i=0; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL ) {
- struct pointdata *pd = &gd->points[i];
- if ( pd->nextedge == pd->sp->prev && pd->next_e_t>.9 &&
- gd->points[pd->sp->prev->from->ttfindex].prevedge == pd->sp->next ) {
- pd->nextedge = pd->sp->prev->from->prev;
- pd->next_e_t = 1;
- }
- if ( pd->prevedge == pd->sp->next && pd->prev_e_t<.1 &&
- gd->points[pd->sp->next->to->ttfindex].nextedge == pd->sp->prev ) {
- pd->prevedge = pd->sp->next->to->next;
- pd->prev_e_t = 0;
- }
- }
-#endif
-
- /* There will never be more lines than there are points (counting next/prev as separate) */
- gd->lines = galloc(2*gd->pcnt*sizeof(struct linedata));
- gd->linecnt = 0;
- gd->pspace = galloc(gd->pcnt*sizeof(struct pointdata *));
- for ( i=0; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL ) {
- struct pointdata *pd = &gd->points[i];
- if (( !only_hv || pd->next_hor || pd->next_ver ) && pd->nextline==NULL ) {
- pd->nextline = BuildLine(gd,pd,true);
- if ( pd->colinear )
- pd->prevline = pd->nextline;
- }
- if (( !only_hv || pd->prev_hor || pd->prev_ver ) && pd->prevline==NULL ) {
- pd->prevline = BuildLine(gd,pd,false);
- if ( pd->colinear && pd->nextline == NULL )
- pd->nextline = pd->prevline;
- }
- }
-
- /* There will never be more stems than there are points (counting next/prev as separate) */
- gd->stems = gcalloc(2*gd->pcnt,sizeof(struct stemdata));
- gd->stemcnt = 0; /* None used so far */
- for ( i=0; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL ) {
- struct pointdata *pd = &gd->points[i];
- if ( pd->nextedge!=NULL /*&& pd->nextstem==NULL*/ )
- BuildStem(gd,pd,true);
- if ( pd->prevedge!=NULL /*&& pd->prevstem==NULL*/ )
- BuildStem(gd,pd,false);
- if ( pd->bothedge!=NULL )
- DiagonalCornerStem(gd,pd);
- }
- for ( i=0; i<gd->pcnt; ++i ) if ( gd->points[i].sp!=NULL ) {
- struct pointdata *pd = &gd->points[i];
- if ( pd->nextstem==NULL && pd->colinear ) {
- pd->nextstem = pd->prevstem;
- pd->next_is_l = pd->prev_is_l;
- } else if ( pd->prevstem==NULL && pd->colinear ) {
- pd->prevstem = pd->nextstem;
- pd->prev_is_l = pd->next_is_l;
- }
- }
-
- sspace = galloc(gd->stemcnt*sizeof(struct stemdata *));
- for ( i=j=0; i<gd->stemcnt; ++i ) /*if ( !gd->stems[i].toobig )*/
- sspace[j++] = &gd->stems[i];
- goodcnt = j;
- qsort(sspace,goodcnt,sizeof(struct stemdata *),swidth_cmp);
-
- /* we were cautious about assigning points to stems, go back now and see */
- /* if there are any low-quality matches which remain unassigned, and if */
- /* so then assign them to the stem they almost fit on. */
- /* If there are multiple stems, find the one which is closest to this point */
- for ( i=0; i<goodcnt; ++i ) {
- struct stemdata *stem = sspace[i];
- for ( j=0; j<stem->chunk_cnt; ++j ) {
- struct stem_chunk *chunk = &stem->chunks[j];
- if ( chunk->l==NULL && chunk->lpotential!=NULL &&
- IsClosestPotential(sspace,i,goodcnt,true,chunk))
- chunk->l = PotentialAdd(gd,stem,chunk->lpotential,chunk->lnext);
- if ( chunk->r==NULL && chunk->rpotential!=NULL &&
- IsClosestPotential(sspace,i,goodcnt,false,chunk))
- chunk->r = PotentialAdd(gd,stem,chunk->rpotential,chunk->rnext);
- }
- }
- for ( i=0; i<goodcnt; ++i ) {
- struct stemdata *stem = sspace[i];
- for ( j=0; j<stem->chunk_cnt; ++j ) {
- struct stem_chunk *chunk = &stem->chunks[j];
- if (( chunk->l!=NULL && chunk->r==NULL ) ||
- ( chunk->l==NULL && chunk->r!=NULL ))
- AddOpposite(gd,chunk,stem);
- }
- }
- free(sspace);
-
- gd->lspace = galloc(gd->pcnt*sizeof(struct segment));
- gd->rspace = galloc(gd->pcnt*sizeof(struct segment));
- gd->bothspace = galloc(3*gd->pcnt*sizeof(struct segment));
- gd->activespace = galloc(3*gd->pcnt*sizeof(struct segment));
- for ( i=j=0; i<gd->stemcnt; ++i )
- FigureStemActive(gd,&gd->stems[i]);
-
- if ( only_hv && hint_bounding_boxes )
- CheckForBoundingBoxHints(gd);
-
- FreeMonotonics(gd->ms); gd->ms = NULL;
- free(gd->space); gd->space = NULL;
- free(gd->sspace); gd->sspace = NULL;
- free(gd->stspace); gd->stspace = NULL;
- free(gd->pspace); gd->pspace = NULL;
- free(gd->lspace); gd->lspace = NULL;
- free(gd->rspace); gd->rspace = NULL;
- free(gd->bothspace); gd->bothspace = NULL;
- free(gd->activespace); gd->activespace = NULL;
-
- GDFindUnlikelyStems(gd);
-
-return( gd );
-}
-
-void GlyphDataFree(struct glyphdata *gd) {
- int i;
-
- /* Restore implicit points */
- for ( i=gd->realcnt; i<gd->norefpcnt; ++i )
- gd->points[i].sp->ttfindex = 0xffff;
- for ( i=gd->norefpcnt; i<gd->pcnt; ++i )
- gd->points[i].sp->ttfindex = 0xfffe;
-
- for ( i=0; i<gd->linecnt; ++i )
- free(gd->lines[i].points);
- for ( i=0; i<gd->stemcnt; ++i ) {
- free(gd->stems[i].chunks);
- free(gd->stems[i].active);
- }
- free(gd->lines);
- free(gd->stems);
- free(gd->contourends);
- free(gd->points);
- free(gd);
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottf.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottf.c
deleted file mode 100644
index d132be86f6f..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottf.c
+++ /dev/null
@@ -1,5768 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaedit.h"
-#include <math.h>
-#include <unistd.h>
-#include <time.h>
-#include <locale.h>
-#include <utype.h>
-#include <ustring.h>
-#include <chardata.h>
-#include <gwidget.h>
-
-#ifdef __CygWin
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
-#endif
-
-#ifdef LUA_FF_LIB
-extern int unic_islefttoright(int);
-extern int unic_isdigit(int);
-#define islefttoright unic_islefttoright
-#define isdigit unic_isdigit
-#endif
-
-
-#include "ttf.h"
-
-/* This file produces a ttf file given a splinefont. */
-
-/* ************************************************************************** */
-
-/* Required tables:
- cmap encoding
- head header data
- hhea horizontal metrics header data
- hmtx horizontal metrics (widths, lsidebearing)
- maxp various maxima in the font
- name various names associated with the font
- post postscript names and other stuff
-Required by windows but not mac
- OS/2 bleah.
-Required for TrueType
- loca pointers to the glyphs
- glyf character shapes
-Required for OpenType (Postscript)
- CFF A complete postscript CFF font here with all its internal tables
-Required for bitmaps
- bdat/EBDT bitmap data
- bloc/EBLC pointers to bitmaps
- bhed for apple bitmap only fonts, replaces head
-Optional for bitmaps
- EBSC bitmap scaling table (used in windows "bitmap-only" fonts)
-"Advanced Typograpy"
- Apple
- feat (mapping between morx features and 'name' names)
- kern (if data are present)
- lcar (ligature caret, if data present)
- morx (substitutions, if data present)
- prop (glyph properties, if data present)
- opbd (optical bounds, if data present)
- OpenType
- GPOS (opentype, if kern,anchor data are present)
- GSUB (opentype, if ligature (other subs) data are present)
- GDEF (opentype, if anchor data are present)
-Apple variation tables (for distortable (multiple master type) fonts)
- fvar (font variations)
- gvar (glyph variations)
- cvar (cvt variations)
- avar (axis variations)
-additional tables
- cvt for hinting
- gasp to control when things should be hinted
- fpgm for hinting (currently only copied and dumped verbatim)
- prep for hinting (currently only copied and dumped verbatim)
-FontForge
- PfEd My own table
-TeX
- TeX TeX specific info (stuff that used to live in tfm files)
-*/
-
-const char *ttfstandardnames[258] = {
-".notdef",
-".null",
-"nonmarkingreturn",
-"space",
-"exclam",
-"quotedbl",
-"numbersign",
-"dollar",
-"percent",
-"ampersand",
-"quotesingle",
-"parenleft",
-"parenright",
-"asterisk",
-"plus",
-"comma",
-"hyphen",
-"period",
-"slash",
-"zero",
-"one",
-"two",
-"three",
-"four",
-"five",
-"six",
-"seven",
-"eight",
-"nine",
-"colon",
-"semicolon",
-"less",
-"equal",
-"greater",
-"question",
-"at",
-"A",
-"B",
-"C",
-"D",
-"E",
-"F",
-"G",
-"H",
-"I",
-"J",
-"K",
-"L",
-"M",
-"N",
-"O",
-"P",
-"Q",
-"R",
-"S",
-"T",
-"U",
-"V",
-"W",
-"X",
-"Y",
-"Z",
-"bracketleft",
-"backslash",
-"bracketright",
-"asciicircum",
-"underscore",
-"grave",
-"a",
-"b",
-"c",
-"d",
-"e",
-"f",
-"g",
-"h",
-"i",
-"j",
-"k",
-"l",
-"m",
-"n",
-"o",
-"p",
-"q",
-"r",
-"s",
-"t",
-"u",
-"v",
-"w",
-"x",
-"y",
-"z",
-"braceleft",
-"bar",
-"braceright",
-"asciitilde",
-"Adieresis",
-"Aring",
-"Ccedilla",
-"Eacute",
-"Ntilde",
-"Odieresis",
-"Udieresis",
-"aacute",
-"agrave",
-"acircumflex",
-"adieresis",
-"atilde",
-"aring",
-"ccedilla",
-"eacute",
-"egrave",
-"ecircumflex",
-"edieresis",
-"iacute",
-"igrave",
-"icircumflex",
-"idieresis",
-"ntilde",
-"oacute",
-"ograve",
-"ocircumflex",
-"odieresis",
-"otilde",
-"uacute",
-"ugrave",
-"ucircumflex",
-"udieresis",
-"dagger",
-"degree",
-"cent",
-"sterling",
-"section",
-"bullet",
-"paragraph",
-"germandbls",
-"registered",
-"copyright",
-"trademark",
-"acute",
-"dieresis",
-"notequal",
-"AE",
-"Oslash",
-"infinity",
-"plusminus",
-"lessequal",
-"greaterequal",
-"yen",
-"mu",
-"partialdiff",
-"summation",
-"product",
-"pi",
-"integral",
-"ordfeminine",
-"ordmasculine",
-"Omega",
-"ae",
-"oslash",
-"questiondown",
-"exclamdown",
-"logicalnot",
-"radical",
-"florin",
-"approxequal",
-"Delta",
-"guillemotleft",
-"guillemotright",
-"ellipsis",
-"nonbreakingspace",
-"Agrave",
-"Atilde",
-"Otilde",
-"OE",
-"oe",
-"endash",
-"emdash",
-"quotedblleft",
-"quotedblright",
-"quoteleft",
-"quoteright",
-"divide",
-"lozenge",
-"ydieresis",
-"Ydieresis",
-"fraction",
-"currency",
-"guilsinglleft",
-"guilsinglright",
-"fi",
-"fl",
-"daggerdbl",
-"periodcentered",
-"quotesinglbase",
-"quotedblbase",
-"perthousand",
-"Acircumflex",
-"Ecircumflex",
-"Aacute",
-"Edieresis",
-"Egrave",
-"Iacute",
-"Icircumflex",
-"Idieresis",
-"Igrave",
-"Oacute",
-"Ocircumflex",
-"apple",
-"Ograve",
-"Uacute",
-"Ucircumflex",
-"Ugrave",
-"dotlessi",
-"circumflex",
-"tilde",
-"macron",
-"breve",
-"dotaccent",
-"ring",
-"cedilla",
-"hungarumlaut",
-"ogonek",
-"caron",
-"Lslash",
-"lslash",
-"Scaron",
-"scaron",
-"Zcaron",
-"zcaron",
-"brokenbar",
-"Eth",
-"eth",
-"Yacute",
-"yacute",
-"Thorn",
-"thorn",
-"minus",
-"multiply",
-"onesuperior",
-"twosuperior",
-"threesuperior",
-"onehalf",
-"onequarter",
-"threequarters",
-"franc",
-"Gbreve",
-"gbreve",
-"Idotaccent",
-"Scedilla",
-"scedilla",
-"Cacute",
-"cacute",
-"Ccaron",
-"ccaron",
-"dcroat"
-};
-
-static int uniranges[][3] = {
- { 0x20, 0x7e, 0 }, /* Basic Latin */
- { 0xa0, 0xff, 1 }, /* Latin-1 Supplement */
- { 0x100, 0x17f, 2 }, /* Latin Extended-A */
- { 0x180, 0x24f, 3 }, /* Latin Extended-B */
- { 0x250, 0x2af, 4 }, /* IPA Extensions */
- { 0x2b0, 0x2ff, 5 }, /* Spacing Modifier Letters */
- { 0x300, 0x36f, 6 }, /* Combining Diacritical Marks */
- { 0x370, 0x3ff, 7 }, /* Greek */
- { 0x400, 0x52f, 9 }, /* Cyrillic / Cyrillic Supplement */
- { 0x530, 0x58f, 10 }, /* Armenian */
- { 0x590, 0x5ff, 11 }, /* Hebrew */
- { 0x600, 0x6ff, 13 }, /* Arabic */
- { 0x700, 0x74f, 71 }, /* Syriac */
- { 0x780, 0x7bf, 72 }, /* Thaana */
- { 0x900, 0x97f, 15 }, /* Devanagari */
- { 0x980, 0x9ff, 16 }, /* Bengali */
- { 0xa00, 0xa7f, 17 }, /* Gurmukhi */
- { 0xa80, 0xaff, 18 }, /* Gujarati */
- { 0xb00, 0xb7f, 19 }, /* Oriya */
- { 0xb80, 0xbff, 20 }, /* Tamil */
- { 0xc00, 0xc7f, 21 }, /* Telugu */
- { 0xc80, 0xcff, 22 }, /* Kannada */
- { 0xd00, 0xd7f, 23 }, /* Malayalam */
- { 0xd80, 0xdff, 73 }, /* Sinhala */
- { 0xe00, 0xe7f, 24 }, /* Thai */
- { 0xe80, 0xeff, 25 }, /* Lao */
- { 0xf00, 0xfbf, 70 }, /* Tibetan */
- { 0x1000, 0x109f, 74 }, /* Myanmar */
- { 0x10a0, 0x10ff, 26 }, /* Georgian */
- { 0x1100, 0x11ff, 28 }, /* Hangul Jamo */
- { 0x1200, 0x137f, 75 }, /* Ethiopic */
- { 0x13a0, 0x13ff, 76 }, /* Cherokee */
- { 0x1400, 0x167f, 77 }, /* Unified Canadian Aboriginal Symbols */
- { 0x1680, 0x169f, 78 }, /* Ogham */
- { 0x16a0, 0x16ff, 79 }, /* Runic */
- { 0x1700, 0x177f, 84 }, /* Tagalog / Harunoo / Buhid / Tagbanwa */
- { 0x1780, 0x17ff, 80 }, /* Khmer */
- { 0x1800, 0x18af, 81 }, /* Mongolian */
- /* { 0x1900, 0x194f, }, Limbu */
- /* { 0x1950, 0x197f, }, Tai le */
- /* { 0x19e0, 0x19ff, }, Khmer Symbols */
- /* { 0x1d00, 0x1d7f, }, Phonetic Extensions */
- { 0x1e00, 0x1eff, 29 }, /* Latin Extended Additional */
- { 0x1f00, 0x1fff, 30 }, /* Greek Extended */
- { 0x2000, 0x206f, 31 }, /* General Punctuation */
- { 0x2070, 0x209f, 32 }, /* Superscripts and Subscripts */
- { 0x20a0, 0x20cf, 33 }, /* Currency Symbols */
- { 0x20d0, 0x20ff, 34 }, /* Combining Marks for Symbols */
- { 0x2100, 0x214f, 35 }, /* Letterlike Symbols */
- { 0x2150, 0x218f, 36 }, /* Number Forms */
- { 0x2190, 0x21ff, 37 }, /* Arrows */
- { 0x2200, 0x22ff, 38 }, /* Mathematical Operators */
- { 0x2300, 0x237f, 39 }, /* Miscellaneous Technical */
- { 0x2400, 0x243f, 40 }, /* Control Pictures */
- { 0x2440, 0x245f, 41 }, /* Optical Character Recognition */
- { 0x2460, 0x24ff, 42 }, /* Enclosed Alphanumerics */
- { 0x2500, 0x257f, 43 }, /* Box Drawing */
- { 0x2580, 0x259f, 44 }, /* Block Elements */
- { 0x25a0, 0x25ff, 45 }, /* Geometric Shapes */
- { 0x2600, 0x267f, 46 }, /* Miscellaneous Symbols */
- { 0x2700, 0x27bf, 47 }, /* Dingbats */
- { 0x27c0, 0x27ef, 38 }, /* Miscellaneous Mathematical Symbols-A */
- { 0x27f0, 0x27ff, 37 }, /* Supplementary Arrows-A */
- { 0x2800, 0x28ff, 82 }, /* Braille Patterns */
- { 0x2900, 0x297f, 37 }, /* Supplementary Arrows-B */
- { 0x2980, 0x2aff, 38 }, /* Miscellaneous Mathematical Symbols-B /
- Supplemental Mathematical Operators */
- { 0x2e80, 0x2fff, 59 }, /* CJK Radicals Supplement / Kangxi Radicals /
- Ideographic Description Characters */
- { 0x3000, 0x303f, 48 }, /* CJK Symbols and Punctuation */
- { 0x3040, 0x309f, 49 }, /* Hiragana */
- { 0x30a0, 0x30ff, 50 }, /* Katakana */
- { 0x3100, 0x312f, 51 }, /* Bopomofo */
- { 0x3130, 0x318f, 52 }, /* Hangul Compatibility Jamo */
- { 0x3190, 0x319f, 59 }, /* Kanbun */
- { 0x31a0, 0x31bf, 51 }, /* Bopomofo Extended */
- { 0x31f0, 0x31ff, 50 }, /* Katakana Phonetic Extensions */
- { 0x3200, 0x32ff, 54 }, /* Enclosed CJK Letters and Months */
- { 0x3300, 0x33ff, 55 }, /* CJK compatability */
- { 0x3400, 0x4dbf, 59 }, /* CJK Unified Ideographs Extension A */
- /* { 0x4dc0, 0x4dff, }, Yijing Hexagram Symbols */
- { 0x4e00, 0x9fff, 59 }, /* CJK Unified Ideographs */
- { 0xa000, 0xa4cf, 81 }, /* Yi Syllables / Yi Radicals */
- { 0xac00, 0xd7af, 56 }, /* Hangul */
- { 0xe000, 0xf8ff, 60 }, /* Private Use Area */
-
- { 0xf900, 0xfaff, 61 }, /* CJK Compatibility Ideographs */
- /* 12 ideographs in The IBM 32 Compatibility Additions are CJK unified
- ideographs despite their names: see The Unicode Standard 4.0, p.475 */
- { 0xfa0e, 0xfa0f, 59 },
- { 0xfa10, 0xfa10, 61 },
- { 0xfa11, 0xfa11, 59 },
- { 0xfa12, 0xfa12, 61 },
- { 0xfa13, 0xfa14, 59 },
- { 0xfa15, 0xfa1e, 61 },
- { 0xfa1f, 0xfa1f, 59 },
- { 0xfa20, 0xfa20, 61 },
- { 0xfa21, 0xfa21, 59 },
- { 0xfa22, 0xfa22, 61 },
- { 0xfa23, 0xfa24, 59 },
- { 0xfa25, 0xfa26, 61 },
- { 0xfa27, 0xfa29, 59 },
- { 0xfa2a, 0xfaff, 61 }, /* CJK Compatibility Ideographs */
-
- { 0xfb00, 0xfb4f, 62 }, /* Alphabetic Presentation Forms */
- { 0xfb50, 0xfdff, 63 }, /* Arabic Presentation Forms-A */
- { 0xfe00, 0xfe0f, 91 }, /* Variation Selectors */
- { 0xfe20, 0xfe2f, 64 }, /* Combining Half Marks */
- { 0xfe30, 0xfe4f, 65 }, /* CJK Compatibility Forms */
- { 0xfe50, 0xfe6f, 66 }, /* Small Form Variants */
- { 0xfe70, 0xfeef, 67 }, /* Arabic Presentation Forms-B */
- { 0xff00, 0xffef, 68 }, /* Halfwidth and Fullwidth Forms */
- { 0xfff0, 0xffff, 69 }, /* Specials */
-
- /* { 0x10000, 0x1007f, }, Linear B Syllabary */
- /* { 0x10080, 0x100ff, }, Linear B Ideograms */
- /* { 0x10100, 0x1013f, }, Aegean Numbers */
- { 0x10300, 0x1032f, 85 }, /* Old Italic */
- { 0x10330, 0x1034f, 86 }, /* Gothic */
- { 0x10400, 0x1044f, 87 }, /* Deseret */
- /* { 0x10450, 0x1047f, }, Shavian */
- /* { 0x10480, 0x104af, }, Osmanya */
- /* { 0x10800, 0x1083f, }, Cypriot Syllabary */
- { 0x1d000, 0x1d1ff, 88 }, /* Byzantine Musical Symbols / Musical Symbols */
- /* { 0x1d300, 0x1d35f, }, Tai Xuan Jing Symbols */
- { 0x1d400, 0x1d7ff, 89 }, /* Mathematical Alphanumeric Symbols */
- { 0x20000, 0x2a6df, 59 }, /* CJK Unified Ideographs Extension B */
- { 0x2f800, 0x2fa1f, 61 }, /* CJK Compatibility Ideographs Supplement */
- { 0xe0000, 0xe007f, 92 }, /* Tags */
- { 0xe0100, 0xe01ef, 91 }, /* Variation Selectors Supplement */
- { 0xf0000, 0xffffd, 90 }, /* Supplementary Private Use Area-A */
- { 0x100000, 0x10fffd, 90 }, /* Supplementary Private Use Area-B */
-};
-
-static int32 getuint32(FILE *ttf) {
- int ch1 = getc(ttf);
- int ch2 = getc(ttf);
- int ch3 = getc(ttf);
- int ch4 = getc(ttf);
- if ( ch4==EOF )
-return( EOF );
-return( (ch1<<24)|(ch2<<16)|(ch3<<8)|ch4 );
-}
-
-void putshort(FILE *file,int sval) {
- putc((sval>>8)&0xff,file);
- putc(sval&0xff,file);
-}
-
-void putlong(FILE *file,int val) {
- putc((val>>24)&0xff,file);
- putc((val>>16)&0xff,file);
- putc((val>>8)&0xff,file);
- putc(val&0xff,file);
-}
-#define dumpabsoffset putlong
-
-static void dumpoffset(FILE *file,int offsize,int val) {
- if ( offsize==1 )
- putc(val,file);
- else if ( offsize==2 )
- putshort(file,val);
- else if ( offsize==3 ) {
- putc((val>>16)&0xff,file);
- putc((val>>8)&0xff,file);
- putc(val&0xff,file);
- } else
- putlong(file,val);
-}
-
-static void put2d14(FILE *file,real dval) {
- int val;
- int mant;
-
- val = floor(dval);
- mant = floor(16384.*(dval-val));
- val = (val<<14) | mant;
- putshort(file,val);
-}
-
-void putfixed(FILE *file,real dval) {
- int val;
- int mant;
-
- val = floor(dval);
- mant = floor(65536.*(dval-val));
- val = (val<<16) | mant;
- putlong(file,val);
-}
-
-int ttfcopyfile(FILE *ttf, FILE *other, int pos, char *tab_name) {
- int ch;
- int ret = 1;
-
- if ( ferror(ttf) || ferror(other)) {
- IError("Disk error of some nature. Perhaps no space on device?\nGenerated font will be unusable" );
- } else if ( pos!=ftell(ttf)) {
- IError("File Offset wrong for ttf table (%s), %d expected %d", tab_name, ftell(ttf), pos );
- }
- rewind(other);
- while (( ch = getc(other))!=EOF )
- putc(ch,ttf);
- if ( ferror(other)) ret = 0;
- if ( fclose(other)) ret = 0;
-return( ret );
-}
-
-static void FigureFullMetricsEnd(SplineFont *sf,struct glyphinfo *gi, int istt ) {
- /* We can reduce the size of the width array by removing a run at the end */
- /* of the same width. So start at the end, find the width of the last */
- /* character we'll output, then run backwards as long as we've got the */
- /* same width */
- /* (do same thing for vertical metrics too */
- int i, lasti, lastv, lastdefault = istt ? 3 : 1;
- int width, vwidth;
-
- lasti = lastv = gi->gcnt-1;
- for ( i=gi->gcnt-1; i>lastdefault && gi->bygid[i]==-1; --i );
- if ( i>=lastdefault ) {
- width = sf->glyphs[gi->bygid[i]]->width;
- vwidth = sf->glyphs[gi->bygid[i]]->vwidth;
- lasti = lastv = i;
- for ( i=lasti-1; i>=lastdefault; --i ) {
- if ( SCWorthOutputting(sf->glyphs[gi->bygid[i]]) ) {
- if ( sf->glyphs[gi->bygid[i]]->width!=width )
- break;
- else
- lasti = i;
- }
- }
- gi->lasthwidth = lasti;
- if ( sf->hasvmetrics ) {
- for ( i=lastv-1; i>=lastdefault; --i ) {
- if ( SCWorthOutputting(sf->glyphs[gi->bygid[i]]) ) {
- if ( sf->glyphs[gi->bygid[i]]->vwidth!=vwidth )
- break;
- else
- lastv = i;
- }
- }
- gi->lastvwidth = lastv;
- }
- } else {
- gi->lasthwidth = 0;
- gi->lastvwidth = 0;
- }
-}
-
-static void dumpghstruct(struct glyphinfo *gi,struct glyphhead *gh) {
-
- putshort(gi->glyphs,gh->numContours);
- putshort(gi->glyphs,gh->xmin);
- putshort(gi->glyphs,gh->ymin);
- putshort(gi->glyphs,gh->xmax);
- putshort(gi->glyphs,gh->ymax);
- if ( gh->xmin<gi->xmin ) gi->xmin = gh->xmin;
- if ( gh->ymin<gi->ymin ) gi->ymin = gh->ymin;
- if ( gh->xmax>gi->xmax ) gi->xmax = gh->xmax;
- if ( gh->ymax>gi->ymax ) gi->ymax = gh->ymax;
-}
-
-static void ttfdumpmetrics(SplineChar *sc,struct glyphinfo *gi,DBounds *b) {
-
- if ( sc->ttf_glyph<=gi->lasthwidth )
- putshort(gi->hmtx,sc->width);
- putshort(gi->hmtx,b->minx);
- if ( sc->parent->hasvmetrics ) {
- if ( sc->ttf_glyph<=gi->lastvwidth )
- putshort(gi->vmtx,sc->vwidth);
- putshort(gi->vmtx,sc->parent->vertical_origin-b->maxy);
- }
- if ( sc->ttf_glyph==gi->lasthwidth )
- gi->hfullcnt = sc->ttf_glyph+1;
- if ( sc->ttf_glyph==gi->lastvwidth )
- gi->vfullcnt = sc->ttf_glyph+1;
-}
-
-static SplineSet *SCttfApprox(SplineChar *sc) {
- SplineSet *head=NULL, *last=NULL, *ss, *tss;
- RefChar *ref;
-
- for ( ss=sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- tss = sc->parent->order2 ? SplinePointListCopy1(ss) : SSttfApprox(ss);
- if ( head==NULL ) head = tss;
- else last->next = tss;
- last = tss;
- }
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- for ( ss=ref->layers[0].splines; ss!=NULL; ss=ss->next ) {
- tss = sc->parent->order2 ? SplinePointListCopy1(ss) : SSttfApprox(ss);
- if ( head==NULL ) head = tss;
- else last->next = tss;
- last = tss;
- }
- }
-return( head );
-}
-
-#define _On_Curve 1
-#define _X_Short 2
-#define _Y_Short 4
-#define _Repeat 8
-#define _X_Same 0x10
-#define _Y_Same 0x20
-
-int SSAddPoints(SplineSet *ss,int ptcnt,BasePoint *bp, char *flags) {
- SplinePoint *sp, *first, *nextsp;
- int startcnt = ptcnt;
-
- if ( ss->first->prev!=NULL &&
- ss->first->prev->from->nextcpindex==startcnt ) {
- if ( flags!=NULL ) flags[ptcnt] = 0;
- bp[ptcnt].x = rint(ss->first->prevcp.x);
- bp[ptcnt++].y = rint(ss->first->prevcp.y);
- } else if ( ss->first->ttfindex!=ptcnt && ss->first->ttfindex!=0xfffe )
- IError("Unexpected point count in SSAddPoints" );
-
- first = NULL;
- for ( sp=ss->first; sp!=first ; ) {
- if ( sp->ttfindex!=0xffff ) {
- if ( flags!=NULL ) flags[ptcnt] = _On_Curve;
- bp[ptcnt].x = rint(sp->me.x);
- bp[ptcnt].y = rint(sp->me.y);
- sp->ttfindex = ptcnt++;
- } else if ( !SPInterpolate( sp ) ) {
- /* If an on curve point is midway between two off curve points*/
- /* it may be omitted and will be interpolated on read in */
- if ( flags!=NULL ) flags[ptcnt] = _On_Curve;
- bp[ptcnt].x = rint(sp->me.x);
- bp[ptcnt].y = rint(sp->me.y);
- sp->ttfindex = ptcnt++;
- }
- nextsp = sp->next!=NULL ? sp->next->to : NULL;
- if ( sp->nextcpindex == startcnt )
- /* This control point is actually our first point, not our last */
- break;
- if ( (sp->nextcpindex !=0xffff && sp->nextcpindex!=0xfffe ) ||
- !sp->nonextcp ) {
- if ( flags!=NULL ) flags[ptcnt] = 0;
- bp[ptcnt].x = rint(sp->nextcp.x);
- bp[ptcnt++].y = rint(sp->nextcp.y);
- }
- if ( nextsp==NULL )
- break;
- if ( first==NULL ) first = sp;
- sp = nextsp;
- }
-return( ptcnt );
-}
-
-static void dumppointarrays(struct glyphinfo *gi,BasePoint *bp, char *fs, int pc) {
- BasePoint last;
- int i,flags;
- int lastflag, flagcnt;
-
- if ( gi->maxp->maxPoints<pc )
- gi->maxp->maxPoints = pc;
-
- /* flags */
- last.x = last.y = 0;
- lastflag = -1; flagcnt = 0;
- for ( i=0; i<pc; ++i ) {
- flags = 0;
- if ( fs==NULL || fs[i] )
- flags = _On_Curve; /* points are on curve */
- if ( last.x==bp[i].x )
- flags |= _X_Same;
- else if ( bp[i].x-last.x>-256 && bp[i].x-last.x<255 ) {
- flags |= _X_Short;
- if ( bp[i].x>=last.x )
- flags |= _X_Same; /* In this context it means positive */
- }
- if ( last.y==bp[i].y )
- flags |= _Y_Same;
- else if ( bp[i].y-last.y>-256 && bp[i].y-last.y<255 ) {
- flags |= _Y_Short;
- if ( bp[i].y>=last.y )
- flags |= _Y_Same; /* In this context it means positive */
- }
- last = bp[i];
- if ( lastflag==-1 ) {
- lastflag = flags;
- flagcnt = 0;
- } else if ( flags!=lastflag ) {
- if ( flagcnt!=0 )
- lastflag |= _Repeat;
- putc(lastflag,gi->glyphs);
- if ( flagcnt!=0 )
- putc(flagcnt,gi->glyphs);
- lastflag = flags;
- flagcnt = 0;
- } else {
- if ( ++flagcnt == 255 ) {
- putc(lastflag|_Repeat,gi->glyphs);
- putc(255,gi->glyphs);
- lastflag = -1;
- flagcnt = 0;
- }
- }
- }
- if ( lastflag!=-1 ) {
- if ( flagcnt!=0 )
- lastflag |= _Repeat;
- putc(lastflag,gi->glyphs);
- if ( flagcnt!=0 )
- putc(flagcnt,gi->glyphs);
- }
-
- /* xcoords */
- last.x = 0;
- for ( i=0; i<pc; ++i ) {
- if ( last.x==bp[i].x )
- /* Do Nothing */;
- else if ( bp[i].x-last.x>-256 && bp[i].x-last.x<255 ) {
- if ( bp[i].x>=last.x )
- putc(bp[i].x-last.x,gi->glyphs);
- else
- putc(last.x-bp[i].x,gi->glyphs);
- } else
- putshort(gi->glyphs,bp[i].x-last.x);
- last.x = bp[i].x;
- }
- /* ycoords */
- last.y = 0;
- for ( i=0; i<pc; ++i ) {
- if ( last.y==bp[i].y )
- /* Do Nothing */;
- else if ( bp[i].y-last.y>-256 && bp[i].y-last.y<255 ) {
- if ( bp[i].y>=last.y )
- putc(bp[i].y-last.y,gi->glyphs);
- else
- putc(last.y-bp[i].y,gi->glyphs);
- } else
- putshort(gi->glyphs,bp[i].y-last.y);
- last.y = bp[i].y;
- }
- if ( ftell(gi->glyphs)&1 ) /* Pad the file so that the next glyph */
- putc('\0',gi->glyphs); /* on a word boundary */
-}
-
-static void dumpinstrs(struct glyphinfo *gi,uint8 *instrs,int cnt) {
- int i;
-
- if ( (gi->flags&ttf_flag_nohints) ) {
- putshort(gi->glyphs,0);
-return;
- }
- /* Do we ever want to call AutoHint and AutoInst here? I think not. */
-
- if ( gi->maxp->maxglyphInstr<cnt ) gi->maxp->maxglyphInstr=cnt;
- putshort(gi->glyphs,cnt);
- for ( i=0; i<cnt; ++i )
- putc( instrs[i],gi->glyphs );
-}
-
-static void dumpmissingglyph(SplineFont *sf,struct glyphinfo *gi,int fixedwidth) {
- /* Or .notdef */
- struct glyphhead gh;
- BasePoint bp[10];
- uint8 instrs[50];
- int stemcvt, stem;
-
- gi->pointcounts[gi->next_glyph] = 8;
- gi->loca[gi->next_glyph++] = ftell(gi->glyphs);
- gi->maxp->maxContours = 2;
-
- gh.numContours = 2;
- gh.ymin = 0;
- gh.ymax = 2*(sf->ascent+sf->descent)/3;
- gh.xmax = (sf->ascent+sf->descent)/3;
- gh.xmin = stem = gh.xmax/10;
- gh.xmax += stem;
- if ( gh.ymax>sf->ascent ) gh.ymax = sf->ascent;
- dumpghstruct(gi,&gh);
-
- stemcvt = TTF_getcvtval(gi->sf,stem);
-
- bp[0].x = stem; bp[0].y = 0;
- bp[1].x = stem; bp[1].y = gh.ymax;
- bp[2].x = gh.xmax; bp[2].y = gh.ymax;
- bp[3].x = gh.xmax; bp[3].y = 0;
-
- bp[4].x = 2*stem; bp[4].y = stem;
- bp[5].x = gh.xmax-stem; bp[5].y = stem;
- bp[6].x = gh.xmax-stem; bp[6].y = gh.ymax-stem;
- bp[7].x = 2*stem; bp[7].y = gh.ymax-stem;
-
- instrs[0] = 0xb1; /* Pushb, 2byte */
- instrs[1] = 1; /* Point 1 */
- instrs[2] = 0; /* Point 0 */
- instrs[3] = 0x2f; /* MDAP, rounded (pt0) */
- instrs[4] = 0x3c; /* ALIGNRP, (pt1 same pos as pt0)*/
- instrs[5] = 0xb2; /* Pushb, 3byte */
- instrs[6] = 7; /* Point 7 */
- instrs[7] = 4; /* Point 4 */
- instrs[8] = stemcvt; /* CVT entry for our stem width */
- instrs[9] = 0xe0+0x0d; /* MIRP, don't set rp0, minimum, rounded, black */
- instrs[10] = 0x32; /* SHP[rp2] (pt7 same pos as pt4) */
- instrs[11] = 0xb1; /* Pushb, 2byte */
- instrs[12] = 6; /* Point 6 */
- instrs[13] = 5; /* Point 5 */
- instrs[14] = 0xc0+0x1c; /* MDRP, set rp0, minimum, rounded, grey */
- instrs[15] = 0x3c; /* ALIGNRP, (pt6 same pos as pt5)*/
- instrs[16] = 0xb2; /* Pushb, 3byte */
- instrs[17] = 3; /* Point 3 */
- instrs[18] = 2; /* Point 2 */
- instrs[19] = stemcvt; /* CVT entry for our stem width */
- instrs[20] = 0xe0+0x0d; /* MIRP, dont set rp0, minimum, rounded, black */
- instrs[21] = 0x32; /* SHP[rp2] (pt3 same pos as pt2) */
-
- instrs[22] = 0x00; /* SVTCA, y axis */
-
- instrs[23] = 0xb1; /* Pushb, 2byte */
- instrs[24] = 3; /* Point 3 */
- instrs[25] = 0; /* Point 0 */
- instrs[26] = 0x2f; /* MDAP, rounded */
- instrs[27] = 0x3c; /* ALIGNRP, (pt3 same height as pt0)*/
- instrs[28] = 0xb2; /* Pushb, 3byte */
- instrs[29] = 5; /* Point 5 */
- instrs[30] = 4; /* Point 4 */
- instrs[31] = stemcvt; /* CVT entry for our stem width */
- instrs[32] = 0xe0+0x0d; /* MIRP, don't set rp0, minimum, rounded, black */
- instrs[33] = 0x32; /* SHP[rp2] (pt5 same height as pt4) */
- instrs[34] = 0xb2; /* Pushb, 3byte */
- instrs[35] = 7; /* Point 7 */
- instrs[36] = 6; /* Point 6 */
- instrs[37] = TTF_getcvtval(gi->sf,bp[6].y); /* CVT entry for top height */
- instrs[38] = 0xe0+0x1c; /* MIRP, set rp0, minimum, rounded, grey */
- instrs[39] = 0x3c; /* ALIGNRP (pt7 same height as pt6) */
- instrs[40] = 0xb2; /* Pushb, 3byte */
- instrs[41] = 1; /* Point 1 */
- instrs[42] = 2; /* Point 2 */
- instrs[43] = stemcvt; /* CVT entry for our stem width */
- instrs[44] = 0xe0+0x0d; /* MIRP, dont set rp0, minimum, rounded, black */
- instrs[45] = 0x32; /* SHP[rp2] (pt1 same height as pt2) */
-
- /* We've touched all points in all dimensions */
- /* Don't need any IUP */
-
- /* end contours array */
- putshort(gi->glyphs,4-1);
- putshort(gi->glyphs,8-1);
- /* instruction length&instructions */
- dumpinstrs(gi,instrs,46);
-
- dumppointarrays(gi,bp,NULL,8);
-
- if ( fixedwidth==-1 )
- putshort(gi->hmtx,gh.xmax + 2*stem);
- else
- putshort(gi->hmtx,fixedwidth);
- putshort(gi->hmtx,stem);
- if ( sf->hasvmetrics ) {
- putshort(gi->vmtx,sf->ascent+sf->descent);
- putshort(gi->vmtx,sf->vertical_origin-gh.ymax);
- }
-}
-
-static void dumpblankglyph(struct glyphinfo *gi,SplineFont *sf,int fixedwidth) {
- int advance = gi->next_glyph==1?0:fixedwidth==-1?(sf->ascent+sf->descent)/3:
- fixedwidth;
- /* For reasons quite obscure to me, glyph 1 has an advance width of 0 */
- /* even in a mono-spaced font like CourierNew.ttf */
-
- /* These don't get a glyph header, because there are no contours */
- gi->pointcounts[gi->next_glyph] = 0;
- gi->loca[gi->next_glyph++] = ftell(gi->glyphs);
- putshort(gi->hmtx,advance);
- putshort(gi->hmtx,0);
- if ( sf->hasvmetrics ) {
- putshort(gi->vmtx,gi->next_glyph==2?0:(sf->ascent+sf->descent));
- putshort(gi->vmtx,0);
- }
-}
-
-static void dumpspace(SplineChar *sc, struct glyphinfo *gi) {
- /* These don't get a glyph header, because there are no contours */
- DBounds b;
- gi->pointcounts[gi->next_glyph] = 0;
- gi->loca[gi->next_glyph++] = ftell(gi->glyphs);
- memset(&b,0,sizeof(b));
- ttfdumpmetrics(sc,gi,&b);
-}
-
-static int IsTTFRefable(SplineChar *sc) {
- RefChar *ref;
-
- if ( sc->layers[ly_fore].refs==NULL || sc->layers[ly_fore].splines!=NULL )
-return( false );
-
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( ref->transform[0]<-2 || ref->transform[0]>1.999939 ||
- ref->transform[1]<-2 || ref->transform[1]>1.999939 ||
- ref->transform[2]<-2 || ref->transform[2]>1.999939 ||
- ref->transform[3]<-2 || ref->transform[3]>1.999939 )
-return( false );
- }
-return( true );
-}
-
-static int RefDepth(RefChar *ref) {
- int rd, temp;
- SplineChar *sc = ref->sc;
-
- if ( sc->layers[ly_fore].refs==NULL || sc->layers[ly_fore].splines!=NULL )
-return( 1 );
- rd = 0;
- for ( ref = sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( ref->transform[0]>=-2 || ref->transform[0]<=1.999939 ||
- ref->transform[1]>=-2 || ref->transform[1]<=1.999939 ||
- ref->transform[2]>=-2 || ref->transform[2]<=1.999939 ||
- ref->transform[3]>=-2 || ref->transform[3]<=1.999939 ) {
- temp = RefDepth(ref);
- if ( temp>rd ) rd = temp;
- }
- }
-return( rd+1 );
-}
-
-static void CountCompositeMaxPts(SplineChar *sc,struct glyphinfo *gi) {
- RefChar *ref;
- int ptcnt = 0, index;
-
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( ref->sc->ttf_glyph==-1 )
- continue;
- index = ref->sc->ttf_glyph;
- if ( gi->pointcounts[index]==-1 )
- CountCompositeMaxPts(ref->sc,gi);
- ptcnt += gi->pointcounts[index];
- }
- gi->pointcounts[sc->ttf_glyph] = ptcnt;
- if ( gi->maxp->maxCompositPts<ptcnt ) gi->maxp->maxCompositPts=ptcnt;
-}
-
-/* In order3 fonts we figure out the composite point counts at the end */
-/* when we know how many points are in each sub-glyph */
-static void RefigureCompositeMaxPts(SplineFont *sf,struct glyphinfo *gi) {
- int i;
-
- for ( i=0; i<gi->gcnt; ++i ) if ( gi->bygid[i]!=-1 && sf->glyphs[gi->bygid[i]]->ttf_glyph!=-1 ) {
- if ( sf->glyphs[gi->bygid[i]]->layers[ly_fore].splines==NULL &&
- sf->glyphs[gi->bygid[i]]->layers[ly_fore].refs!=NULL &&
- gi->pointcounts[i]== -1 )
- CountCompositeMaxPts(sf->glyphs[gi->bygid[i]],gi);
- }
-}
-
-static void dumpcomposite(SplineChar *sc, struct glyphinfo *gi) {
- struct glyphhead gh;
- DBounds bb;
- int i, ptcnt, ctcnt, flags, sptcnt, rd;
- SplineSet *ss;
- RefChar *ref;
- SplineChar *isc = sc->ttf_instrs==NULL && sc->parent->mm!=NULL && sc->parent->mm->apple ?
- sc->parent->mm->normal->glyphs[sc->orig_pos] : sc;
- int arg1, arg2;
-
-#if 0
- if ( autohint_before_generate && sc->changedsincelasthinted &&
- !sc->manualhints )
- if ( !(gi->flags&ttf_flag_nohints) )
- SplineCharAutoHint(sc,NULL);
-#endif
-
- gi->loca[gi->next_glyph] = ftell(gi->glyphs);
-
- SplineCharFindBounds(sc,&bb);
- gh.numContours = -1;
- gh.xmin = floor(bb.minx); gh.ymin = floor(bb.miny);
- gh.xmax = ceil(bb.maxx); gh.ymax = ceil(bb.maxy);
- dumpghstruct(gi,&gh);
-
- i=ptcnt=ctcnt=0;
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next, ++i ) {
- if ( ref->sc->ttf_glyph==-1 ) {
- /*if ( sc->layers[ly_fore].refs->next==NULL || any )*/
- continue;
- }
- flags = 0;
- if ( ref->round_translation_to_grid )
- flags |= _ROUND;
- if ( ref->use_my_metrics )
- flags |= _USE_MY_METRICS;
- if ( ref->next!=NULL )
- flags |= _MORE; /* More components */
- else if ( isc->ttf_instrs_len!=0 ) /* Composits also inherit instructions */
- flags |= _INSTR; /* Instructions appear after last ref */
- if ( ref->transform[1]!=0 || ref->transform[2]!=0 )
- flags |= _MATRIX; /* Need a full matrix */
- else if ( ref->transform[0]!=ref->transform[3] )
- flags |= _XY_SCALE; /* different xy scales */
- else if ( ref->transform[0]!=1. )
- flags |= _SCALE; /* xy scale is same */
- if ( ref->point_match ) {
- arg1 = ref->match_pt_base;
- arg2 = ref->match_pt_ref;
- } else {
- arg1 = rint(ref->transform[4]);
- arg2 = rint(ref->transform[5]);
- flags |= _ARGS_ARE_XY|_UNSCALED_OFFSETS;
- /* The values I output are the values I want to see */
- /* There is some very strange stuff wrongly-documented on the apple*/
- /* site about how these should be interpretted when there are */
- /* scale factors, or rotations */
- /* That description does not match the behavior of their rasterizer*/
- /* I've reverse engineered something else (see parsettf.c) */
- /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
- /* Adobe says that setting bit 12 means that this will not happen */
- /* Apple doesn't mention bit 12 though...(but they do support it) */
- }
- if ( arg1<-128 || arg1>127 ||
- arg2<-128 || arg2>127 )
- flags |= _ARGS_ARE_WORDS;
- putshort(gi->glyphs,flags);
- putshort(gi->glyphs,ref->sc->ttf_glyph==-1?0:ref->sc->ttf_glyph);
- if ( flags&_ARGS_ARE_WORDS ) {
- putshort(gi->glyphs,(short)arg1);
- putshort(gi->glyphs,(short)arg2);
- } else {
- putc((char) arg1,gi->glyphs);
- putc((char) arg2,gi->glyphs);
- }
- if ( flags&_MATRIX ) {
- put2d14(gi->glyphs,ref->transform[0]);
- put2d14(gi->glyphs,ref->transform[1]);
- put2d14(gi->glyphs,ref->transform[2]);
- put2d14(gi->glyphs,ref->transform[3]);
- } else if ( flags&_XY_SCALE ) {
- put2d14(gi->glyphs,ref->transform[0]);
- put2d14(gi->glyphs,ref->transform[3]);
- } else if ( flags&_SCALE ) {
- put2d14(gi->glyphs,ref->transform[0]);
- }
- sptcnt = SSTtfNumberPoints(ref->layers[0].splines);
- for ( ss=ref->layers[0].splines; ss!=NULL ; ss=ss->next ) {
- ++ctcnt;
- }
- if ( sc->parent->order2 )
- ptcnt += sptcnt;
- else if ( ptcnt>=0 && gi->pointcounts[ref->sc->ttf_glyph==-1?0:ref->sc->ttf_glyph]>=0 )
- ptcnt += gi->pointcounts[ref->sc->ttf_glyph==-1?0:ref->sc->ttf_glyph];
- else
- ptcnt = -1;
- rd = RefDepth(ref);
- if ( rd>gi->maxp->maxcomponentdepth )
- gi->maxp->maxcomponentdepth = rd;
- }
-
- if ( isc->ttf_instrs_len!=0 )
- dumpinstrs(gi,isc->ttf_instrs,isc->ttf_instrs_len);
-
- gi->pointcounts[gi->next_glyph++] = ptcnt;
- if ( gi->maxp->maxnumcomponents<i ) gi->maxp->maxnumcomponents = i;
- if ( gi->maxp->maxCompositPts<ptcnt ) gi->maxp->maxCompositPts=ptcnt;
- if ( gi->maxp->maxCompositCtrs<ctcnt ) gi->maxp->maxCompositCtrs=ctcnt;
-
- ttfdumpmetrics(sc,gi,&bb);
- if ( ftell(gi->glyphs)&1 ) /* Pad the file so that the next glyph */
- putc('\0',gi->glyphs); /* on a word boundary, can only happen if odd number of instrs */
-}
-
-static void dumpglyph(SplineChar *sc, struct glyphinfo *gi) {
- struct glyphhead gh;
- DBounds bb;
- SplineSet *ss, *ttfss;
- int contourcnt, ptcnt, origptcnt;
- BasePoint *bp;
- char *fs;
- SplineChar *isc = sc->ttf_instrs==NULL && sc->parent->mm!=NULL && sc->parent->mm->apple ?
- sc->parent->mm->normal->glyphs[sc->orig_pos] : sc;
-
-/* I haven't seen this documented, but ttf rasterizers are unhappy with a */
-/* glyph that consists of a single point. Glyphs containing two single points*/
-/* are ok, glyphs with a single point and anything else are ok, glyphs with */
-/* a line are ok. But a single point is not ok. Dunno why */
- if (( sc->layers[ly_fore].splines==NULL && sc->layers[ly_fore].refs==NULL ) ||
- ( sc->layers[ly_fore].refs==NULL &&
- (sc->layers[ly_fore].splines->first->next==NULL ||
- sc->layers[ly_fore].splines->first->next->to == sc->layers[ly_fore].splines->first) &&
- sc->layers[ly_fore].splines->next==NULL) ) {
- dumpspace(sc,gi);
-return;
- }
-
- gi->loca[gi->next_glyph] = ftell(gi->glyphs);
-
- if ( isc->ttf_instrs!=NULL )
- initforinstrs(sc);
-
- ttfss = SCttfApprox(sc);
- ptcnt = SSTtfNumberPoints(ttfss);
- for ( ss=ttfss, contourcnt=0; ss!=NULL; ss=ss->next ) {
- ++contourcnt;
- }
- origptcnt = ptcnt;
-
- SplineCharFindBounds(sc,&bb);
- /* MicroSoft's font validator has a bug. It only looks at the points */
- /* when calculating the bounding box, and complains when I look at */
- /* the splines for internal extrema. I presume it does this because */
- /* all the extrema are supposed to be points (and it complains about */
- /* that error too), but it would lead to rasterization problems if */
- /* we did what they want */
- gh.numContours = contourcnt;
- gh.xmin = floor(bb.minx); gh.ymin = floor(bb.miny);
- gh.xmax = ceil(bb.maxx); gh.ymax = ceil(bb.maxy);
- dumpghstruct(gi,&gh);
- if ( contourcnt>gi->maxp->maxContours ) gi->maxp->maxContours = contourcnt;
- if ( ptcnt>gi->maxp->maxPoints ) gi->maxp->maxPoints = ptcnt;
-
- bp = galloc(ptcnt*sizeof(BasePoint));
- fs = galloc(ptcnt);
- ptcnt = contourcnt = 0;
- for ( ss=ttfss; ss!=NULL; ss=ss->next ) {
- ptcnt = SSAddPoints(ss,ptcnt,bp,fs);
- putshort(gi->glyphs,ptcnt-1);
- }
- if ( ptcnt!=origptcnt )
- IError( "Point count wrong calculated=%d, actual=%d in %.20s", origptcnt, ptcnt, sc->name );
- gi->pointcounts[gi->next_glyph++] = ptcnt;
-
- dumpinstrs(gi,isc->ttf_instrs,isc->ttf_instrs_len);
-
- dumppointarrays(gi,bp,fs,ptcnt);
- SplinePointListsFree(ttfss);
- free(bp);
- free(fs);
-
- ttfdumpmetrics(sc,gi,&bb);
-}
-
-void SFDummyUpCIDs(struct glyphinfo *gi,SplineFont *sf) {
- int i,j,k,max;
- int *bygid;
-
- max = 0;
- for ( k=0; k<sf->subfontcnt; ++k )
- if ( sf->subfonts[k]->glyphcnt>max ) max = sf->subfonts[k]->glyphcnt;
- if ( max == 0 )
-return;
-
- sf->glyphs = gcalloc(max,sizeof(SplineChar *));
- sf->glyphcnt = sf->glyphmax = max;
- for ( k=0; k<sf->subfontcnt; ++k )
- for ( i=0; i<sf->subfonts[k]->glyphcnt; ++i ) if ( sf->subfonts[k]->glyphs[i]!=NULL )
- sf->glyphs[i] = sf->subfonts[k]->glyphs[i];
-
- if ( gi==NULL )
-return;
-
- bygid = galloc((sf->glyphcnt+3)*sizeof(int));
- memset(bygid,0xff, (sf->glyphcnt+3)*sizeof(int));
-
- j=1;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( bygid[0]== -1 && strcmp(sf->glyphs[i]->name,".notdef")==0 ) {
- sf->glyphs[i]->ttf_glyph = 0;
- bygid[0] = i;
- } else if ( SCWorthOutputting(sf->glyphs[i])) {
- sf->glyphs[i]->ttf_glyph = j;
- bygid[j++] = i;
- }
- }
- gi->bygid = bygid;
- gi->gcnt = j;
-}
-
-static void AssignNotdefNull(SplineFont *sf,int *bygid, int iscff) {
- int i;
-
- /* The first three glyphs are magic, glyph 0 is .notdef */
- /* glyph 1 is .null and glyph 2 is nonmarking return */
- /* We may generate them automagically */
-
- bygid[0] = bygid[1] = bygid[2] = -1;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( bygid[0]== -1 && strcmp(sf->glyphs[i]->name,".notdef")==0 ) {
- sf->glyphs[i]->ttf_glyph = 0;
- bygid[0] = i;
- } else if ( !iscff && bygid[1]== -1 &&
- (strcmp(sf->glyphs[i]->name,".null")==0 ||
- (i==1 && strcmp(sf->glyphs[1]->name,"glyph1")==0)) ) {
- sf->glyphs[i]->ttf_glyph = 1;
- bygid[1] = i;
- } else if ( !iscff && bygid[2]== -1 &&
- (strcmp(sf->glyphs[i]->name,"nonmarkingreturn")==0 ||
- (i==2 && strcmp(sf->glyphs[2]->name,"glyph2")==0)) ) {
- sf->glyphs[i]->ttf_glyph = 2;
- bygid[2] = i;
- }
- }
-}
-
-static int AssignTTFGlyph(struct glyphinfo *gi,SplineFont *sf,EncMap *map,int iscff) {
- int *bygid = galloc((sf->glyphcnt+3)*sizeof(int));
- int i,j;
-
- memset(bygid,0xff, (sf->glyphcnt+3)*sizeof(int));
-
- AssignNotdefNull(sf,bygid,iscff);
-
- j = iscff ? 1 : 3;
- for ( i=0; i<map->enccount; ++i ) if ( map->map[i]!=-1 ) {
- SplineChar *sc = sf->glyphs[map->map[i]];
- if ( SCWorthOutputting(sc) && sc->ttf_glyph==-1
-#if HANYANG
- && (!iscff || !sc->compositionunit)
-#endif
- ) {
- sc->ttf_glyph = j;
- bygid[j++] = sc->orig_pos;
- }
- }
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- SplineChar *sc = sf->glyphs[i];
- if ( SCWorthOutputting(sc) && sc->ttf_glyph==-1
-#if HANYANG
- && (!iscff || !sc->compositionunit)
-#endif
- ) {
- sc->ttf_glyph = j;
- bygid[j++] = i;
- }
- }
- gi->bygid = bygid;
- gi->gcnt = j;
-return j;
-}
-
-static int AssignTTFBitGlyph(struct glyphinfo *gi,SplineFont *sf,EncMap *map,int32 *bsizes) {
- int i, j;
- BDFFont *bdf;
- int *bygid = galloc((sf->glyphcnt+3)*sizeof(int));
-
- memset(bygid,0xff, (sf->glyphcnt+3)*sizeof(int));
-
- AssignNotdefNull(sf,bygid,false);
-
- for ( bdf = sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- for ( j=0; bsizes[j]!=0 && ((bsizes[j]&0xffff)!=bdf->pixelsize || (bsizes[j]>>16)!=BDFDepth(bdf)); ++j );
- if ( bsizes[j]==0 )
- continue;
- for ( i=0; i<bdf->glyphcnt; ++i ) if ( !IsntBDFChar(bdf->glyphs[i]) )
- sf->glyphs[i]->ttf_glyph = -2;
- }
-
- j = 3;
- for ( i=0; i<map->enccount; ++i ) if ( map->map[i]!=-1 ) {
- SplineChar *sc = sf->glyphs[map->map[i]];
- if ( sc->ttf_glyph==-2 ) {
- sc->ttf_glyph = j;
- bygid[j++] = sc->orig_pos;
- }
- }
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- SplineChar *sc = sf->glyphs[i];
- if ( sc->ttf_glyph==-2 ) {
- sc->ttf_glyph = j;
- bygid[j++] = i;
- }
- }
-
- gi->bygid = bygid;
- gi->gcnt = j;
-return j;
-}
-
-static int dumpglyphs(SplineFont *sf,struct glyphinfo *gi) {
- int i;
- int fixed = gi->fixed_width;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_change_stages(2+gi->strikecnt);
-#endif
- QuickBlues(sf,&gi->bd);
- /*FindBlues(sf,gi->blues,NULL);*/
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_next_stage();
-#endif
-
- if ( !gi->onlybitmaps ) {
- if ( sf->order2 )
- for ( i=0; i<sf->glyphcnt; ++i ) {
- SplineChar *sc = sf->glyphs[i];
- if ( SCWorthOutputting(sc) )
- if ( !SCPointsNumberedProperly(sc)) {
- free(sc->ttf_instrs); sc->ttf_instrs = NULL;
- sc->ttf_instrs_len = 0;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCMarkInstrDlgAsChanged(sc);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- SCNumberPoints(sc);
- }
- }
- }
-
- gi->maxp->numGlyphs = gi->gcnt;
- gi->loca = galloc((gi->maxp->numGlyphs+1)*sizeof(uint32));
- gi->pointcounts = galloc((gi->maxp->numGlyphs+1)*sizeof(int32));
- memset(gi->pointcounts,-1,(gi->maxp->numGlyphs+1)*sizeof(int32));
- gi->next_glyph = 0;
- gi->glyphs = tmpfile();
- gi->hmtx = tmpfile();
- if ( sf->hasvmetrics )
- gi->vmtx = tmpfile();
- FigureFullMetricsEnd(sf,gi,true);
-
- if ( fixed!=-1 ) {
- gi->lasthwidth = 3;
- gi->hfullcnt = 3;
- }
- for ( i=0; i<gi->gcnt; ++i ) {
- if ( i==0 ) {
- if ( gi->bygid[0]!=-1 && (fixed==-1 || sf->glyphs[gi->bygid[0]]->width==fixed))
- dumpglyph(sf->glyphs[gi->bygid[0]],gi);
- else
- dumpmissingglyph(sf,gi,fixed);
- } else if ( i<=2 && gi->bygid[i]==-1 )
- dumpblankglyph(gi,sf,fixed);
- else if ( gi->onlybitmaps ) {
- if ( gi->bygid[i]!=-1 && sf->glyphs[gi->bygid[i]]->ttf_glyph>0 )
- dumpspace(sf->glyphs[gi->bygid[i]],gi);
- } else {
- if ( gi->bygid[i]!=-1 && sf->glyphs[gi->bygid[i]]->ttf_glyph>0 ) {
- if ( IsTTFRefable(sf->glyphs[gi->bygid[i]]) )
- dumpcomposite(sf->glyphs[gi->bygid[i]],gi);
- else
- dumpglyph(sf->glyphs[gi->bygid[i]],gi);
- }
- }
- if ( (ftell(gi->glyphs)&3) != 0 ) {
- /* Apple says glyphs must be 16bit aligned */
- if ( ftell(gi->glyphs)&1 )
- putc('\0',gi->glyphs);
- /* MS says glyphs should be 32bit aligned */
- if ( ftell(gi->glyphs)&2 )
- putshort(gi->glyphs,0);
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next())
-return( false );
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-
- /* extra location entry points to end of last glyph */
- gi->loca[gi->next_glyph] = ftell(gi->glyphs);
- /* Microsoft's Font Validator wants the last loca entry to point into the */
- /* glyph table. I think that's an error on their part, but it's so easy */
- /* to fix, I might as well (instead of pointing to right after the table)*/
- /* Sigh. But if I do that, it complains that there's extra stuff in the */
- /* glyph table. There's just no pleasing them */
- /* putlong(gi->glyphs,0);*/
- gi->glyph_len = ftell(gi->glyphs);
- gi->hmtxlen = ftell(gi->hmtx);
- /* pad out to four bytes */
- if ( gi->hmtxlen&2 ) putshort(gi->hmtx,0);
- if ( gi->loca[gi->next_glyph]&3 ) {
- for ( i=4-(gi->loca[gi->next_glyph]&3); i>0; --i )
- putc('\0',gi->glyphs);
- }
- if ( sf->hasvmetrics ) {
- gi->vmtxlen = ftell(gi->vmtx);
- if ( gi->vmtxlen&2 ) putshort(gi->vmtx,0);
- }
- if ( !sf->order2 )
- RefigureCompositeMaxPts(sf,gi);
- free(gi->pointcounts);
-
-return( true );
-}
-
-/* Generate a null glyf and loca table for X opentype bitmaps */
-static int dumpnoglyphs(SplineFont *sf,struct glyphinfo *gi) {
-
- gi->glyphs = tmpfile();
- gi->glyph_len = 0;
- /* loca gets built in dummyloca */
-return( true );
-}
-
-/* Standard names for cff */
-extern const char *cffnames[];
-extern const int nStdStrings;
-
-static int storesid(struct alltabs *at,char *str) {
- int i;
- FILE *news;
- char *pt;
- long pos;
-
- if ( str!=NULL ) { /* NULL is the magic string at end of array */
- for ( i=0; cffnames[i]!=NULL; ++i ) {
- if ( strcmp(cffnames[i],str)==0 )
-return( i );
- }
- }
-
- pos = ftell(at->sidf)+1;
- if ( pos>=65536 && !at->sidlongoffset ) {
- at->sidlongoffset = true;
- news = tmpfile();
- rewind(at->sidh);
- for ( i=0; i<at->sidcnt; ++i )
- putlong(news,getushort(at->sidh));
- fclose(at->sidh);
- at->sidh = news;
- }
- if ( at->sidlongoffset )
- putlong(at->sidh,pos);
- else
- putshort(at->sidh,pos);
-
- if ( str!=NULL ) {
- for ( pt=str; *pt; ++pt )
- putc(*pt,at->sidf);
- }
-return( at->sidcnt++ + nStdStrings );
-}
-
-static void dumpint(FILE *cfff,int num) {
-
- if ( num>=-107 && num<=107 )
- putc(num+139,cfff);
- else if ( num>=108 && num<=1131 ) {
- num -= 108;
- putc((num>>8)+247,cfff);
- putc(num&0xff,cfff);
- } else if ( num>=-1131 && num<=-108 ) {
- num = -num;
- num -= 108;
- putc((num>>8)+251,cfff);
- putc(num&0xff,cfff);
- } else if ( num>=-32768 && num<32768 ) {
- putc(28,cfff);
- putc(num>>8,cfff);
- putc(num&0xff,cfff);
- } else { /* In dict data we have 4 byte ints, in type2 strings we don't */
- putc(29,cfff);
- putc((num>>24)&0xff,cfff);
- putc((num>>16)&0xff,cfff);
- putc((num>>8)&0xff,cfff);
- putc(num&0xff,cfff);
- }
-}
-
-static void dumpdbl(FILE *cfff,double d) {
- if ( d-rint(d)>-.00001 && d-rint(d)<.00001 )
- dumpint(cfff,(int) d);
- else {
- /* The type2 strings have a fixed format, but the dict data does not */
- char buffer[20], *pt;
- int sofar,n,odd;
- sprintf( buffer, "%g", d);
- sofar = 0; odd=true;
- putc(30,cfff); /* Start a double */
- for ( pt=buffer; *pt; ++pt ) {
- if ( isdigit(*pt) )
- n = *pt-'0';
- else if ( *pt=='.' )
- n = 0xa;
- else if ( *pt=='-' )
- n = 0xe;
- else if (( *pt=='E' || *pt=='e') && pt[1]=='-' ) {
- n = 0xc;
- ++pt;
- } else if ( *pt=='E' || *pt=='e')
- n = 0xb;
- else
- n = 0; /* Should never happen */
- if ( odd ) {
- sofar = n<<4;
- odd = false;
- } else {
- putc(sofar|n,cfff);
- sofar=0;
- odd = true;
- }
- }
- if ( sofar==0 )
- putc(0xff,cfff);
- else
- putc(sofar|0xf,cfff);
- }
-}
-
-static void dumpoper(FILE *cfff,int oper ) {
- if ( oper!=-1 ) {
- if ( oper>=256 )
- putc(oper>>8,cfff);
- putc(oper&0xff,cfff);
- }
-}
-
-static void dumpdbloper(FILE *cfff,double d, int oper ) {
- dumpdbl(cfff,d);
- dumpoper(cfff,oper);
-}
-
-static void dumpintoper(FILE *cfff,int v, int oper ) {
- dumpint(cfff,v);
- dumpoper(cfff,oper);
-}
-
-static void dumpsizedint(FILE *cfff,int big,int num, int oper ) {
- if ( big ) {
- putc(29,cfff);
- putc((num>>24)&0xff,cfff);
- putc((num>>16)&0xff,cfff);
- putc((num>>8)&0xff,cfff);
- putc(num&0xff,cfff);
- } else {
- putc(28,cfff);
- putc(num>>8,cfff);
- putc(num&0xff,cfff);
- }
- dumpoper(cfff,oper);
-}
-
-static void dumpsid(FILE *cfff,struct alltabs *at,char *str,int oper) {
- if ( str==NULL )
-return;
- dumpint(cfff,storesid(at,str));
- dumpoper(cfff,oper);
-}
-
-static void DumpStrDouble(char *pt,FILE *cfff,int oper) {
- real d;
- if ( *pt=='[' ) ++pt; /* For StdHW, StdVW */
- d = strtod(pt,NULL);
- dumpdbloper(cfff,d,oper);
-}
-
-static void DumpDblArray(real *arr,int n,FILE *cfff, int oper) {
- int mi,i;
-
- for ( mi=n-1; mi>=0 && arr[mi]==0; --mi );
- if ( mi<0 )
-return;
- dumpdbl(cfff,arr[0]);
- for ( i=1; i<=mi; ++i )
- dumpdbl(cfff,arr[i]-arr[i-1]);
- dumpoper(cfff,oper);
-}
-
-static void DumpStrArray(char *pt,FILE *cfff,int oper) {
- real d, last=0;
- char *end;
-
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
-return;
- if ( *pt=='[' ) ++pt;
- while ( *pt==' ' ) ++pt;
- while ( *pt!=']' && *pt!='\0' ) {
- d = strtod(pt,&end);
- if ( pt==end ) /* User screwed up. Should be a number */
- break;
- dumpdbl(cfff,d-last);
- last = d;
- pt = end;
- while ( *pt==' ' ) ++pt;
- }
- dumpoper(cfff,oper);
-}
-
-static void dumpcffheader(SplineFont *sf,FILE *cfff) {
- putc('\1',cfff); /* Major version: 1 */
- putc('\0',cfff); /* Minor version: 0 */
- putc('\4',cfff); /* Header size in bytes */
- putc('\4',cfff); /* Absolute Offset size. */
- /* I don't think there are any absolute offsets that aren't encoded */
- /* in a dict as numbers (ie. inherently variable sized items) */
-}
-
-static void dumpcffnames(SplineFont *sf,FILE *cfff) {
- char *pt;
-
- putshort(cfff,1); /* One font name */
- putc('\1',cfff); /* Offset size */
- putc('\1',cfff); /* Offset to first name */
- putc('\1'+strlen(sf->fontname),cfff);
- for ( pt=sf->fontname; *pt; ++pt )
- putc(*pt,cfff);
-}
-
-static void dumpcffcharset(SplineFont *sf,struct alltabs *at) {
- int i;
-
- at->gn_sid = gcalloc(at->gi.gcnt,sizeof(uint32));
- putc(0,at->charset);
- /* I always use a format 0 charset. ie. an array of SIDs in random order */
-
- /* First element must be ".notdef" and is omitted */
-
- for ( i=1; i<at->gi.gcnt; ++i )
- if ( at->gi.bygid[i]!=-1 && SCWorthOutputting(sf->glyphs[at->gi.bygid[i]])) {
- at->gn_sid[i] = storesid(at,sf->glyphs[at->gi.bygid[i]]->name);
- putshort(at->charset,at->gn_sid[i]);
- }
-}
-
-static void dumpcffcidset(SplineFont *sf,struct alltabs *at) {
- int gid, start;
-
- putc(2,at->charset);
-
- start = -1; /* Glyph 0 always maps to CID 0, and is omitted */
- for ( gid = 1; gid<at->gi.gcnt; ++gid ) {
- if ( start==-1 )
- start = gid;
- else if ( at->gi.bygid[gid]-at->gi.bygid[start]!=gid-start ) {
- putshort(at->charset,at->gi.bygid[start]);
- putshort(at->charset,at->gi.bygid[gid-1]-at->gi.bygid[start]);
- start = gid;
- }
- }
- if ( start!=-1 ) {
- putshort(at->charset,at->gi.bygid[start]);
- putshort(at->charset,at->gi.bygid[gid-1]-at->gi.bygid[start]);
- }
-}
-
-static void dumpcfffdselect(SplineFont *sf,struct alltabs *at) {
- int cid, k, lastfd, cnt;
- int gid;
-
- putc(3,at->fdselect);
- putshort(at->fdselect,0); /* number of ranges, fill in later */
-
- for ( k=0; k<sf->subfontcnt; ++k )
- if ( SCWorthOutputting(sf->subfonts[k]->glyphs[0]))
- break;
- if ( k==sf->subfontcnt ) --k; /* If CID 0 not defined, put it in last font */
- putshort(at->fdselect,0);
- putc(k,at->fdselect);
- lastfd = k;
- cnt = 1;
- for ( gid = 1; gid<at->gi.gcnt; ++gid ) {
- cid = at->gi.bygid[gid];
- for ( k=0; k<sf->subfontcnt; ++k ) {
- if ( cid<sf->subfonts[k]->glyphcnt &&
- SCWorthOutputting(sf->subfonts[k]->glyphs[cid]) )
- break;
- }
- if ( k==sf->subfontcnt )
- /* Doesn't map to a glyph, irrelevant */;
- else {
- if ( k!=lastfd ) {
- putshort(at->fdselect,gid);
- putc(k,at->fdselect);
- lastfd = k;
- ++cnt;
- }
- }
- }
- putshort(at->fdselect,gid);
- fseek(at->fdselect,1,SEEK_SET);
- putshort(at->fdselect,cnt);
- fseek(at->fdselect,0,SEEK_END);
-}
-
-static void dumpcffencoding(SplineFont *sf,struct alltabs *at) {
- int i, cnt, anydups;
- uint32 start_pos = ftell(at->encoding);
- SplineChar *sc;
- EncMap *map = at->map;
-
- putc(0,at->encoding);
- /* I always use a format 0 encoding. ie. an array of glyph indexes */
- putc(0xff,at->encoding); /* fixup later */
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->ticked = false;
-
- cnt = 0;
- anydups = 0;
- for ( i=0; i<256 && i<map->enccount; ++i ) if ( map->map[i]!=-1 && (sc=sf->glyphs[map->map[i]])!=NULL ) {
- if ( sc->ttf_glyph>255 )
- continue;
- if ( sc->ticked ) {
- ++anydups;
- } else if ( sc->ttf_glyph>0 ) {
- if ( cnt>=255 )
- break;
- putc(i,at->encoding);
- ++cnt;
- sc->ticked = true;
- }
- }
- if ( anydups ) {
- fseek(at->encoding,start_pos,SEEK_SET);
- putc(0x80,at->encoding);
- putc(cnt,at->encoding);
- fseek(at->encoding,0,SEEK_END);
- putc(anydups,at->encoding);
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->ticked = false;
- for ( i=0; i<256 && i<map->enccount; ++i ) if ( map->map[i]!=-1 && (sc=sf->glyphs[map->map[i]])!=NULL ) {
- if ( sc->ttf_glyph>255 )
- continue;
- if ( sc->ticked ) {
- putc(i,at->encoding);
- putshort(at->encoding,at->gn_sid[sc->ttf_glyph]);
- }
- sc->ticked = true;
- }
- } else {
- fseek(at->encoding,start_pos+1,SEEK_SET);
- putc(cnt,at->encoding);
- fseek(at->encoding,0,SEEK_END);
- }
- free( at->gn_sid );
- at->gn_sid = NULL;
-}
-
-static void _dumpcffstrings(FILE *file, struct pschars *strs) {
- int i, len, offsize;
-
- /* First figure out the offset size */
- len = 1;
- for ( i=0; i<strs->next; ++i )
- len += strs->lens[i];
-
- /* Then output the index size and offsets */
- putshort( file, strs->next );
- if ( strs->next!=0 ) {
- /* presumably offsets are unsigned. But the docs don't state this in the obvious place */
- offsize = len<=255?1:len<=65535?2:len<=0xffffff?3:4;
- putc(offsize,file);
- len = 1;
- for ( i=0; i<strs->next; ++i ) {
- dumpoffset(file,offsize,len);
- len += strs->lens[i];
- }
- dumpoffset(file,offsize,len);
-
- /* last of all the strings */
- for ( i=0; i<strs->next; ++i ) {
- uint8 *pt = strs->values[i], *end = pt+strs->lens[i];
- while ( pt<end )
- putc( *pt++, file );
- }
- }
-}
-
-static FILE *dumpcffstrings(struct pschars *strs) {
- FILE *file = tmpfile();
- _dumpcffstrings(file,strs);
- PSCharsFree(strs);
-return( file );
-}
-
-int SFFigureDefWidth(SplineFont *sf, int *_nomwid) {
- uint16 *widths; uint32 *cumwid;
- int nomwid, defwid, i, sameval=(int) 0x80000000, maxw=0, allsame=true;
- int cnt,j;
-
- for ( i=0; i<sf->glyphcnt; ++i )
- if ( SCWorthOutputting(sf->glyphs[i]) ) {
- if ( maxw<sf->glyphs[i]->width ) maxw = sf->glyphs[i]->width;
- if ( sameval == 0x8000000 )
- sameval = sf->glyphs[i]->width;
- else if ( sameval!=sf->glyphs[i]->width )
- allsame = false;
- }
- if ( allsame ) {
- nomwid = defwid = sameval;
- } else {
- ++maxw;
- if ( maxw>65535 ) maxw = 3*(sf->ascent+sf->descent);
- widths = gcalloc(maxw,sizeof(uint16));
- cumwid = gcalloc(maxw,sizeof(uint32));
- defwid = 0; cnt=0;
- for ( i=0; i<sf->glyphcnt; ++i )
- if ( SCWorthOutputting(sf->glyphs[i]) &&
- sf->glyphs[i]->width>=0 &&
- sf->glyphs[i]->width<maxw )
- if ( ++widths[sf->glyphs[i]->width] > cnt ) {
- defwid = sf->glyphs[i]->width;
- cnt = widths[defwid];
- }
- widths[defwid] = 0;
- for ( i=0; i<maxw; ++i )
- for ( j=-107; j<=107; ++j )
- if ( i+j>=0 && i+j<maxw )
- cumwid[i] += widths[i+j];
- cnt = 0; nomwid = 0;
- for ( i=0; i<maxw; ++i )
- if ( cnt<cumwid[i] ) {
- cnt = cumwid[i];
- nomwid = i;
- }
- free(widths); free(cumwid);
- }
- if ( _nomwid!=NULL )
- *_nomwid = nomwid;
-return( defwid );
-}
-
-static void ATFigureDefWidth(SplineFont *sf, struct alltabs *at, int subfont) {
- int nomwid, defwid;
-
- defwid = SFFigureDefWidth(sf,&nomwid);
- if ( subfont==-1 )
- at->defwid = defwid;
- else
- at->fds[subfont].defwid = defwid;
- if ( subfont==-1 )
- at->nomwid = nomwid;
- else
- at->fds[subfont].nomwid = nomwid;
-}
-
-static void dumpcffprivate(SplineFont *sf,struct alltabs *at,int subfont,
- int subrcnt) {
- char *pt;
- FILE *private = subfont==-1?at->private:at->fds[subfont].private;
- int mi,i;
- real bluevalues[14], otherblues[10];
- real snapcnt[12];
- real stemsnaph[12], stemsnapv[12];
- real stdhw[1], stdvw[1];
- int hasblue=0, hash=0, hasv=0, bs;
- int nomwid, defwid;
- EncMap *map = at->map;
- double bluescale;
-
- /* The private dict is not in an index, so no index header. Just the data */
-
- if ( subfont==-1 )
- defwid = at->defwid;
- else
- defwid = at->fds[subfont].defwid;
- dumpintoper(private,defwid,20); /* Default Width */
- if ( subfont==-1 )
- nomwid = at->nomwid;
- else
- nomwid = at->fds[subfont].nomwid;
- dumpintoper(private,nomwid,21); /* Nominative Width */
-
- bs = SplineFontIsFlexible(sf,at->gi.flags);
- hasblue = PSDictHasEntry(sf->private,"BlueValues")!=NULL;
- hash = PSDictHasEntry(sf->private,"StdHW")!=NULL;
- hasv = PSDictHasEntry(sf->private,"StdVW")!=NULL;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_change_stages(2+autohint_before_generate+!hasblue);
-#endif
- if ( autohint_before_generate ) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_change_line1(_("Auto Hinting Font..."));
-#endif
- SplineFontAutoHint(sf);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_next_stage();
-#endif
- }
-
- otherblues[0] = otherblues[1] = bluevalues[0] = bluevalues[1] = 0;
- if ( !hasblue ) {
- FindBlues(sf,bluevalues,otherblues);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_next_stage();
-#endif
- }
-
- stdhw[0] = stdvw[0] = 0;
- if ( !hash ) {
- FindHStems(sf,stemsnaph,snapcnt);
- mi = -1;
- for ( i=0; stemsnaph[i]!=0 && i<12; ++i )
- if ( mi==-1 ) mi = i;
- else if ( snapcnt[i]>snapcnt[mi] ) mi = i;
- if ( mi!=-1 ) stdhw[0] = stemsnaph[mi];
- }
-
- if ( !hasv ) {
- FindVStems(sf,stemsnapv,snapcnt);
- mi = -1;
- for ( i=0; stemsnapv[i]!=0 && i<12; ++i )
- if ( mi==-1 ) mi = i;
- else if ( snapcnt[i]>snapcnt[mi] ) mi = i;
- if ( mi!=-1 ) stdvw[0] = stemsnapv[mi];
- }
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_change_line1(_("Saving OpenType Font"));
-#endif
-
- if ( hasblue )
- DumpStrArray(PSDictHasEntry(sf->private,"BlueValues"),private,6);
- else
- DumpDblArray(bluevalues,sizeof(bluevalues)/sizeof(bluevalues[0]),private,6);
- if ( (pt=PSDictHasEntry(sf->private,"OtherBlues"))!=NULL )
- DumpStrArray(pt,private,7);
- else if ( !hasblue )
- DumpDblArray(otherblues,sizeof(otherblues)/sizeof(otherblues[0]),private,7);
- if ( (pt=PSDictHasEntry(sf->private,"FamilyBlues"))!=NULL )
- DumpStrArray(pt,private,8);
- bluescale = BlueScaleFigure(sf->private,bluevalues,otherblues);
- if ( (pt=PSDictHasEntry(sf->private,"FamilyOtherBlues"))!=NULL )
- DumpStrArray(pt,private,9);
- if ( (pt=PSDictHasEntry(sf->private,"BlueScale"))!=NULL )
- DumpStrDouble(pt,private,(12<<8)+9);
- else if ( bluescale!=-1 )
- dumpdbloper(private,bluescale,(12<<8)+9);
- if ( (pt=PSDictHasEntry(sf->private,"BlueShift"))!=NULL )
- DumpStrDouble(pt,private,(12<<8)+10);
- else
- dumpintoper(private,bs,(12<<8)+10);
- if ( (pt=PSDictHasEntry(sf->private,"BlueFuzz"))!=NULL )
- DumpStrDouble(pt,private,(12<<8)+11);
- if ( hash ) {
- DumpStrDouble(PSDictHasEntry(sf->private,"StdHW"),private,10);
- if ( (pt=PSDictHasEntry(sf->private,"StemSnapH"))!=NULL )
- DumpStrArray(pt,private,(12<<8)|12);
- } else {
- if ( stdhw[0]!=0 )
- dumpdbloper(private,stdhw[0],10);
- DumpDblArray(stemsnaph,sizeof(stemsnaph)/sizeof(stemsnaph[0]),private,(12<<8)|12);
- }
- if ( hasv ) {
- DumpStrDouble(PSDictHasEntry(sf->private,"StdVW"),private,11);
- if ( (pt=PSDictHasEntry(sf->private,"StemSnapV"))!=NULL )
- DumpStrArray(pt,private,(12<<8)|13);
- } else {
- if ( stdvw[0]!=0 )
- dumpdbloper(private,stdvw[0],11);
- DumpDblArray(stemsnapv,sizeof(stemsnapv)/sizeof(stemsnapv[0]),private,(12<<8)|13);
- }
- if ( (pt=PSDictHasEntry(sf->private,"ForceBold"))!=NULL ) {
- dumpintoper(private,*pt=='t'||*pt=='T',(12<<8)|14);
- } else if ( sf->weight!=NULL &&
- (strstrmatch(sf->weight,"Bold")!=NULL ||
- strstrmatch(sf->weight,"Demi")!=NULL ||
- strstrmatch(sf->weight,"Fett")!=NULL ||
- strstrmatch(sf->weight,"Gras")!=NULL ||
- strstrmatch(sf->weight,"Heavy")!=NULL ||
- strstrmatch(sf->weight,"Black")!=NULL))
- dumpintoper(private,1,(12<<8)|14);
- if ( (pt=PSDictHasEntry(sf->private,"LanguageGroup"))!=NULL )
- DumpStrDouble(pt,private,(12<<8)+17);
- else if ( map->enc->is_japanese ||
- map->enc->is_korean ||
- map->enc->is_tradchinese ||
- map->enc->is_simplechinese )
- dumpintoper(private,1,(12<<8)|17);
- if ( (pt=PSDictHasEntry(sf->private,"ExpansionFactor"))!=NULL )
- DumpStrDouble(pt,private,(12<<8)+18);
- if ( subrcnt!=0 )
- dumpsizedint(private,false,ftell(private)+3+1,19); /* Subrs */
-
- if ( subfont==-1 )
- at->privatelen = ftell(private);
- else
- at->fds[subfont].privatelen = ftell(private);
-}
-
-/* When we exit this the topdict is not complete, we still need to fill in */
-/* values for charset,encoding,charstrings and private. Then we need to go */
-/* back and fill in the table length (at lenpos) */
-static void dumpcfftopdict(SplineFont *sf,struct alltabs *at) {
- char *pt, *end;
- FILE *cfff = at->cfff;
- DBounds b;
-
- putshort(cfff,1); /* One top dict */
- putc('\2',cfff); /* Offset size */
- putshort(cfff,1); /* Offset to topdict */
- at->lenpos = ftell(cfff);
- putshort(cfff,0); /* placeholder for final position (final offset in index points beyond last element) */
- dumpsid(cfff,at,sf->version,0);
- dumpsid(cfff,at,sf->copyright,1);
- dumpsid(cfff,at,sf->fullname?sf->fullname:sf->fontname,2);
- dumpsid(cfff,at,sf->familyname,3);
- dumpsid(cfff,at,sf->weight,4);
- if ( at->gi.fixed_width!=-1 ) dumpintoper(cfff,1,(12<<8)|1);
- if ( sf->italicangle!=0 ) dumpdbloper(cfff,sf->italicangle,(12<<8)|2);
- if ( sf->upos!=-100 ) dumpdbloper(cfff,sf->upos,(12<<8)|3);
- if ( sf->uwidth!=50 ) dumpdbloper(cfff,sf->uwidth,(12<<8)|4);
- if ( sf->strokedfont ) {
- dumpintoper(cfff,2,(12<<8)|5);
- dumpdbloper(cfff,sf->strokewidth,(12<<8)|8);
- }
- /* We'll never set CharstringType */
- if ( sf->ascent+sf->descent!=1000 ) {
- dumpdbl(cfff,1.0/(sf->ascent+sf->descent));
- dumpint(cfff,0);
- dumpint(cfff,0);
- dumpdbl(cfff,1.0/(sf->ascent+sf->descent));
- dumpint(cfff,0);
- dumpintoper(cfff,0,(12<<8)|7);
- }
- if ( sf->uniqueid!=-1 )
- dumpintoper(cfff, sf->uniqueid?sf->uniqueid:4000000 + (rand()&0x3ffff), 13 );
- SplineFontFindBounds(sf,&b);
- at->gi.xmin = b.minx;
- at->gi.ymin = b.miny;
- at->gi.xmax = b.maxx;
- at->gi.ymax = b.maxy;
- dumpdbl(cfff,floor(b.minx));
- dumpdbl(cfff,floor(b.miny));
- dumpdbl(cfff,ceil(b.maxx));
- dumpdbloper(cfff,ceil(b.maxy),5);
- /* We'll never set StrokeWidth */
- if ( sf->xuid!=NULL ) {
- pt = sf->xuid; if ( *pt=='[' ) ++pt;
- while ( *pt && *pt!=']' ) {
- dumpint(cfff,strtol(pt,&end,10));
- if ( pt==end ) /* garbage in XUID */
- break;
- for ( pt = end; *pt==' '; ++pt );
- }
- putc(14,cfff);
- if ( sf->changed_since_xuidchanged )
- SFIncrementXUID(sf);
- }
- /* Offset to charset (oper=15) needed here */
- /* Offset to encoding (oper=16) needed here (not for CID )*/
- /* Offset to charstrings (oper=17) needed here */
- /* Length of, and Offset to private (oper=18) needed here (not for CID )*/
-}
-
-static int dumpcffdict(SplineFont *sf,struct alltabs *at) {
- FILE *fdarray = at->fdarray;
- int pstart;
- /* according to the PSRef Man v3, only fontname, fontmatrix and private */
- /* appear in this dictionary */
-
- dumpsid(fdarray,at,sf->fontname,(12<<8)|38);
- if ( sf->ascent+sf->descent!=1000 ) {
- dumpdbl(fdarray,1.0/(sf->ascent+sf->descent));
- dumpint(fdarray,0);
- dumpint(fdarray,0);
- dumpdbl(fdarray,1.0/(sf->ascent+sf->descent));
- dumpint(fdarray,0);
- dumpintoper(fdarray,0,(12<<8)|7);
- }
- pstart = ftell(fdarray);
- dumpsizedint(fdarray,false,0,-1); /* private length */
- dumpsizedint(fdarray,true,0,18); /* private offset */
-return( pstart );
-}
-
-static void dumpcffdictindex(SplineFont *sf,struct alltabs *at) {
- int i;
- int pos;
-
- putshort(at->fdarray,sf->subfontcnt);
- putc('\2',at->fdarray); /* DICTs aren't very big, and there are at most 255 */
- putshort(at->fdarray,1); /* Offset to first dict */
- for ( i=0; i<sf->subfontcnt; ++i )
- putshort(at->fdarray,0); /* Dump offset placeholders (note there's one extra to mark the end) */
- pos = ftell(at->fdarray)-1;
- for ( i=0; i<sf->subfontcnt; ++i ) {
- at->fds[i].fillindictmark = dumpcffdict(sf->subfonts[i],at);
- at->fds[i].eodictmark = ftell(at->fdarray);
- if ( at->fds[i].eodictmark>65536 )
- IError("The DICT INDEX got too big, result won't work");
- }
- fseek(at->fdarray,2*sizeof(short)+sizeof(char),SEEK_SET);
- for ( i=0; i<sf->subfontcnt; ++i )
- putshort(at->fdarray,at->fds[i].eodictmark-pos);
- fseek(at->fdarray,0,SEEK_END);
-}
-
-static void dumpcffcidtopdict(SplineFont *sf,struct alltabs *at) {
- char *pt, *end;
- FILE *cfff = at->cfff;
- DBounds b;
- int cidcnt=0, k;
-
- for ( k=0; k<sf->subfontcnt; ++k )
- if ( sf->subfonts[k]->glyphcnt>cidcnt ) cidcnt = sf->subfonts[k]->glyphcnt;
-
- putshort(cfff,1); /* One top dict */
- putc('\2',cfff); /* Offset size */
- putshort(cfff,1); /* Offset to topdict */
- at->lenpos = ftell(cfff);
- putshort(cfff,0); /* placeholder for final position */
- dumpsid(cfff,at,sf->cidregistry,-1);
- dumpsid(cfff,at,sf->ordering,-1);
- dumpintoper(cfff,sf->supplement,(12<<8)|30); /* ROS operator must be first */
- dumpdbloper(cfff,sf->cidversion,(12<<8)|31);
- dumpintoper(cfff,cidcnt,(12<<8)|34);
- dumpintoper(cfff, sf->uniqueid?sf->uniqueid:4000000 + (rand()&0x3ffff), (12<<8)|35 );
-
- dumpsid(cfff,at,sf->copyright,1);
- dumpsid(cfff,at,sf->fullname?sf->fullname:sf->fontname,2);
- dumpsid(cfff,at,sf->familyname,3);
- dumpsid(cfff,at,sf->weight,4);
- /* FontMatrix (identity here, real ones in sub fonts)*/
- /* Actually there is no fontmatrix in the adobe cid font I'm looking at */
- /* which means it should default to [.001...] but it doesn't so the */
- /* docs aren't completely accurate */
- /* I now see I've no idea what the FontMatrix means in a CID keyed font */
- /* it seems to be ignored everywhere */
-#if 0
- dumpdbl(cfff,1.0);
- dumpint(cfff,0);
- dumpint(cfff,0);
- dumpdbl(cfff,1.0);
- dumpint(cfff,0);
- dumpintoper(cfff,0,(12<<8)|7);
-#endif
-
- CIDFindBounds(sf,&b);
- at->gi.xmin = b.minx;
- at->gi.ymin = b.miny;
- at->gi.xmax = b.maxx;
- at->gi.ymax = b.maxy;
- dumpdbl(cfff,floor(b.minx));
- dumpdbl(cfff,floor(b.miny));
- dumpdbl(cfff,ceil(b.maxx));
- dumpdbloper(cfff,ceil(b.maxy),5);
- /* We'll never set StrokeWidth */
- if ( sf->xuid!=NULL ) {
- pt = sf->xuid; if ( *pt=='[' ) ++pt;
- while ( *pt && *pt!=']' ) {
- dumpint(cfff,strtol(pt,&end,10));
- for ( pt = end; *pt==' '; ++pt );
- }
- putc(14,cfff);
- if ( sf->changed_since_xuidchanged )
- SFIncrementXUID(sf);
- }
-#if 0
- /* Acrobat doesn't seem to care about a private dict here. Ghostscript */
- /* dies. Tech Note: 5176.CFF.PDF, top of page 23 says: */
- /* A Private DICT is required, but may be specified as having */
- /* a length of 0 if there are no non-default values to be stored*/
- /* No indication >where< it is required. I assumed everywhere. Perhaps */
- /* just in basefonts? */
- dumpint(cfff,0); /* Docs say a private dict is required and they don't specifically omit CID top dicts */
- dumpintoper(cfff,0,18); /* But they do say it can be zero */
-#endif
- /* Offset to charset (oper=15) needed here */
- /* Offset to charstrings (oper=17) needed here */
- /* Offset to FDArray (oper=12,36) needed here */
- /* Offset to FDSelect (oper=12,37) needed here */
-}
-
-static int isStdEncoding(SplineFont *sf,EncMap *map) {
- int i;
-
- for ( i=0; i<256 && i<map->enccount; ++i ) if ( map->map[i]!=-1 && sf->glyphs[map->map[i]]!=NULL )
- if ( sf->glyphs[map->map[i]]->unicodeenc!=-1 )
- if ( sf->glyphs[map->map[i]]->unicodeenc!=unicode_from_adobestd[i] )
-return( 0 );
-
-return( 1 );
-}
-
-static void finishup(SplineFont *sf,struct alltabs *at) {
- int strlen, shlen, glen,enclen,csetlen,cstrlen,prvlen;
- int base, eotop, strhead;
- int output_enc = ( at->format==ff_cff && !isStdEncoding(sf,at->map));
-
- storesid(at,NULL); /* end the strings index */
- strlen = ftell(at->sidf) + (shlen = ftell(at->sidh));
- glen = sizeof(short); /* Single entry: 0, no globals */
- enclen = ftell(at->encoding);
- csetlen = ftell(at->charset);
- cstrlen = ftell(at->charstrings);
- prvlen = ftell(at->private);
- base = ftell(at->cfff);
- if ( base+6*3+strlen+glen+enclen+csetlen+cstrlen+prvlen > 32767 ) {
- at->cfflongoffset = true;
- base += 5*5+4;
- } else
- base += 5*3+4;
- strhead = 2+(at->sidcnt>1);
- base += strhead;
-
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen,15); /* Charset */
- if ( output_enc ) /* encoding offset */
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen,16); /* encoding offset */
- else {
- dumpsizedint(at->cfff,at->cfflongoffset,0,16);
- enclen = 0;
- }
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+enclen,17);/* charstrings */
- dumpsizedint(at->cfff,at->cfflongoffset,at->privatelen,-1);
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+enclen+cstrlen,18); /* private size */
- eotop = base-strhead-at->lenpos-1;
- if ( at->cfflongoffset ) {
- fseek(at->cfff,3,SEEK_SET);
- putc(4,at->cfff);
- }
- fseek(at->cfff,at->lenpos,SEEK_SET);
- putshort(at->cfff,eotop);
- fseek(at->cfff,0,SEEK_END);
-
- /* String Index */
- putshort(at->cfff,at->sidcnt-1);
- if ( at->sidcnt!=1 ) { /* Everybody gets an added NULL */
- putc(at->sidlongoffset?4:2,at->cfff);
- if ( !ttfcopyfile(at->cfff,at->sidh,base,"CFF-StringBase")) at->error = true;
- if ( !ttfcopyfile(at->cfff,at->sidf,base+shlen,"CFF-StringData")) at->error = true;
- }
-
- /* Global Subrs */
- putshort(at->cfff,0);
-
- /* Charset */
- if ( !ttfcopyfile(at->cfff,at->charset,base+strlen+glen,"CFF-Charset")) at->error = true;
-
- /* Encoding */
- if ( !ttfcopyfile(at->cfff,at->encoding,base+strlen+glen+csetlen,"CFF-Encoding")) at->error = true;
-
- /* Char Strings */
- if ( !ttfcopyfile(at->cfff,at->charstrings,base+strlen+glen+csetlen+enclen,"CFF-CharStrings")) at->error = true;
-
- /* Private & Subrs */
- if ( !ttfcopyfile(at->cfff,at->private,base+strlen+glen+csetlen+enclen+cstrlen,"CFF-Private")) at->error = true;
-}
-
-static void finishupcid(SplineFont *sf,struct alltabs *at) {
- int strlen, shlen, glen,csetlen,cstrlen,fdsellen,fdarrlen,prvlen;
- int base, eotop, strhead;
- int i;
-
- storesid(at,NULL); /* end the strings index */
- strlen = ftell(at->sidf) + (shlen = ftell(at->sidh));
- glen = ftell(at->globalsubrs);
- /* No encodings */
- csetlen = ftell(at->charset);
- fdsellen = ftell(at->fdselect);
- cstrlen = ftell(at->charstrings);
- fdarrlen = ftell(at->fdarray);
- base = ftell(at->cfff);
-
- at->cfflongoffset = true;
- base += 5*4+4+2; /* two of the opers below are two byte opers */
- strhead = 2+(at->sidcnt>1);
- base += strhead;
-
- prvlen = 0;
- for ( i=0; i<sf->subfontcnt; ++i ) {
- fseek(at->fdarray,at->fds[i].fillindictmark,SEEK_SET);
- dumpsizedint(at->fdarray,false,at->fds[i].privatelen,-1); /* Private len */
- dumpsizedint(at->fdarray,true,base+strlen+glen+csetlen+fdsellen+cstrlen+fdarrlen+prvlen,18); /* Private offset */
- prvlen += ftell(at->fds[i].private); /* private & subrs */
- }
-
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen,15); /* charset */
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen,(12<<8)|37); /* fdselect */
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+fdsellen,17); /* charstrings */
- dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+fdsellen+cstrlen,(12<<8)|36); /* fdarray */
- eotop = base-strhead-at->lenpos-1;
- fseek(at->cfff,at->lenpos,SEEK_SET);
- putshort(at->cfff,eotop);
- fseek(at->cfff,0,SEEK_END);
-
- /* String Index */
- putshort(at->cfff,at->sidcnt-1);
- if ( at->sidcnt!=1 ) { /* Everybody gets an added NULL */
- putc(at->sidlongoffset?4:2,at->cfff);
- if ( !ttfcopyfile(at->cfff,at->sidh,base,"CFF-StringBase")) at->error = true;
- if ( !ttfcopyfile(at->cfff,at->sidf,base+shlen,"CFF-StringData")) at->error = true;
- }
-
- /* Global Subrs */
- if ( !ttfcopyfile(at->cfff,at->globalsubrs,base+strlen,"CFF-GlobalSubrs")) at->error = true;
-
- /* Charset */
- if ( !ttfcopyfile(at->cfff,at->charset,base+strlen+glen,"CFF-Charset")) at->error = true;
-
- /* FDSelect */
- if ( !ttfcopyfile(at->cfff,at->fdselect,base+strlen+glen+csetlen,"CFF-FDSelect")) at->error = true;
-
- /* Char Strings */
- if ( !ttfcopyfile(at->cfff,at->charstrings,base+strlen+glen+csetlen+fdsellen,"CFF-CharStrings")) at->error = true;
-
- /* FDArray (DICT Index) */
- if ( !ttfcopyfile(at->cfff,at->fdarray,base+strlen+glen+csetlen+fdsellen+cstrlen,"CFF-FDArray")) at->error = true;
-
- /* Private & Subrs */
- prvlen = 0;
- for ( i=0; i<sf->subfontcnt; ++i ) {
- int temp = ftell(at->fds[i].private);
- if ( !ttfcopyfile(at->cfff,at->fds[i].private,
- base+strlen+glen+csetlen+fdsellen+cstrlen+fdarrlen+prvlen,"CFF-PrivateSubrs")) at->error = true;
- prvlen += temp;
- }
-
- free(at->fds);
-}
-
-static int dumpcffhmtx(struct alltabs *at,SplineFont *sf,int bitmaps) {
- DBounds b;
- SplineChar *sc;
- int i,cnt;
- int dovmetrics = sf->hasvmetrics;
- int width = at->gi.fixed_width;
-
- at->gi.hmtx = tmpfile();
- if ( dovmetrics )
- at->gi.vmtx = tmpfile();
- FigureFullMetricsEnd(sf,&at->gi,bitmaps); /* Bitmap fonts use ttf convention of 3 magic glyphs */
- if ( at->gi.bygid[0]!=-1 && (sf->glyphs[at->gi.bygid[0]]->width==width || width==-1 )) {
- putshort(at->gi.hmtx,sf->glyphs[at->gi.bygid[0]]->width);
- SplineCharFindBounds(sf->glyphs[at->gi.bygid[0]],&b);
- putshort(at->gi.hmtx,b.minx);
- if ( dovmetrics ) {
- putshort(at->gi.vmtx,sf->glyphs[at->gi.bygid[0]]->vwidth);
- putshort(at->gi.vmtx,sf->vertical_origin-b.miny);
- }
- } else {
- putshort(at->gi.hmtx,width==-1?(sf->ascent+sf->descent)/2:width);
- putshort(at->gi.hmtx,0);
- if ( dovmetrics ) {
- putshort(at->gi.vmtx,sf->ascent+sf->descent);
- putshort(at->gi.vmtx,0);
- }
- }
- cnt = 1;
- if ( bitmaps ) {
- if ( width==-1 ) width = (sf->ascent+sf->descent)/3;
- putshort(at->gi.hmtx,width);
- putshort(at->gi.hmtx,0);
- if ( dovmetrics ) {
- putshort(at->gi.vmtx,sf->ascent+sf->descent);
- putshort(at->gi.vmtx,0);
- }
- putshort(at->gi.hmtx,width);
- putshort(at->gi.hmtx,0);
- if ( dovmetrics ) {
- putshort(at->gi.vmtx,sf->ascent+sf->descent);
- putshort(at->gi.vmtx,0);
- }
- cnt = 3;
- }
-
- for ( i=cnt; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- sc = sf->glyphs[at->gi.bygid[i]];
- if ( SCWorthOutputting(sc) ) {
- if ( i<=at->gi.lasthwidth )
- putshort(at->gi.hmtx,sc->width);
- SplineCharFindBounds(sc,&b);
- putshort(at->gi.hmtx,b.minx);
- if ( dovmetrics ) {
- if ( i<=at->gi.lastvwidth )
- putshort(at->gi.vmtx,sc->vwidth);
- putshort(at->gi.vmtx,sf->vertical_origin-b.maxy);
- }
- ++cnt;
- if ( i==at->gi.lasthwidth )
- at->gi.hfullcnt = cnt;
- if ( i==at->gi.lastvwidth )
- at->gi.vfullcnt = cnt;
- }
- }
- at->gi.hmtxlen = ftell(at->gi.hmtx);
- if ( at->gi.hmtxlen&2 ) putshort(at->gi.hmtx,0);
- if ( dovmetrics ) {
- at->gi.vmtxlen = ftell(at->gi.vmtx);
- if ( at->gi.vmtxlen&2 ) putshort(at->gi.vmtx,0);
- }
-
- at->gi.maxp->numGlyphs = cnt;
-return( true );
-}
-
-static void dumpcffcidhmtx(struct alltabs *at,SplineFont *_sf) {
- DBounds b;
- SplineChar *sc;
- int cid,i,cnt=0,max;
- SplineFont *sf = NULL;
- int dovmetrics = _sf->hasvmetrics;
-
- at->gi.hmtx = tmpfile();
- if ( dovmetrics )
- at->gi.vmtx = tmpfile();
- FigureFullMetricsEnd(_sf,&at->gi,false);
-
- max = 0;
- for ( i=0; i<_sf->subfontcnt; ++i )
- if ( max<_sf->subfonts[i]->glyphcnt )
- max = _sf->subfonts[i]->glyphcnt;
- for ( cid = 0; cid<max; ++cid ) {
- for ( i=0; i<_sf->subfontcnt; ++i ) {
- sf = _sf->subfonts[i];
- if ( cid<sf->glyphcnt && SCWorthOutputting(sf->glyphs[cid]))
- break;
- }
- if ( i!=_sf->subfontcnt ) {
- sc = sf->glyphs[cid];
- if ( sc->ttf_glyph<=at->gi.lasthwidth )
- putshort(at->gi.hmtx,sc->width);
- SplineCharFindBounds(sc,&b);
- putshort(at->gi.hmtx,b.minx);
- if ( dovmetrics ) {
- if ( sc->ttf_glyph<=at->gi.lastvwidth )
- putshort(at->gi.vmtx,sc->vwidth);
- putshort(at->gi.vmtx,sf->vertical_origin-b.maxy);
- }
- ++cnt;
- if ( sc->ttf_glyph==at->gi.lasthwidth )
- at->gi.hfullcnt = cnt;
- if ( sc->ttf_glyph==at->gi.lastvwidth )
- at->gi.vfullcnt = cnt;
- } else if ( cid==0 ) {
- /* Create a dummy entry for .notdef */
- sf = _sf->subfonts[0];
- putshort(at->gi.hmtx,sf->ascent+sf->descent);
- putshort(at->gi.hmtx,0);
- ++cnt;
- if ( dovmetrics ) {
- putshort(at->gi.vmtx,sf->ascent+sf->descent);
- putshort(at->gi.vmtx,0);
- }
- }
- }
- at->gi.hmtxlen = ftell(at->gi.hmtx);
- if ( at->gi.hmtxlen&2 ) putshort(at->gi.hmtx,0);
- if ( dovmetrics ) {
- at->gi.vmtxlen = ftell(at->gi.vmtx);
- if ( at->gi.vmtxlen&2 ) putshort(at->gi.vmtx,0);
- }
-
- at->gi.maxp->numGlyphs = cnt;
-}
-
-static int dumptype2glyphs(SplineFont *sf,struct alltabs *at) {
- int i;
- struct pschars *subrs, *chrs;
-
- at->cfff = tmpfile();
- at->sidf = tmpfile();
- at->sidh = tmpfile();
- at->charset = tmpfile();
- at->encoding = tmpfile();
- at->private = tmpfile();
-
- dumpcffheader(sf,at->cfff);
- dumpcffnames(sf,at->cfff);
- dumpcffcharset(sf,at);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_change_stages(2+at->gi.strikecnt);
-#endif
-
- ATFigureDefWidth(sf,at,-1);
- if ((chrs =SplineFont2ChrsSubrs2(sf,at->nomwid,at->defwid,at->gi.bygid,at->gi.gcnt,at->gi.flags,&subrs))==NULL )
-return( false );
- dumpcffprivate(sf,at,-1,subrs->next);
- if ( subrs->next!=0 )
- _dumpcffstrings(at->private,subrs);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_next_stage();
-#endif
- at->charstrings = dumpcffstrings(chrs);
- PSCharsFree(subrs);
- if ( at->charstrings == NULL )
-return( false );
- if ( at->format==ff_cff && !isStdEncoding(sf,at->map))
- dumpcffencoding(sf,at); /* Do this after we've assigned glyph ids */
- dumpcfftopdict(sf,at);
- finishup(sf,at);
-
- at->cfflen = ftell(at->cfff);
- if ( at->cfflen&3 ) {
- for ( i=4-(at->cfflen&3); i>0; --i )
- putc('\0',at->cfff);
- }
-
- if ( at->format!=ff_cff )
- dumpcffhmtx(at,sf,false);
- free(at->gn_sid); at->gn_sid=NULL;
-return( true );
-}
-
-static int dumpcidglyphs(SplineFont *sf,struct alltabs *at) {
- int i;
- struct pschars *glbls = NULL, *chrs;
-
- at->cfff = tmpfile();
- at->sidf = tmpfile();
- at->sidh = tmpfile();
- at->charset = tmpfile();
- at->fdselect = tmpfile();
- at->fdarray = tmpfile();
- at->globalsubrs = tmpfile();
-
- at->fds = gcalloc(sf->subfontcnt,sizeof(struct fd2data));
- for ( i=0; i<sf->subfontcnt; ++i ) {
- at->fds[i].private = tmpfile();
- ATFigureDefWidth(sf->subfonts[i],at,i);
- }
- if ( (chrs = CID2ChrsSubrs2(sf,at->fds,at->gi.flags,&glbls))==NULL )
-return( false );
- for ( i=0; i<sf->subfontcnt; ++i ) {
- dumpcffprivate(sf->subfonts[i],at,i,at->fds[i].subrs->next);
- if ( at->fds[i].subrs->next!=0 )
- _dumpcffstrings(at->fds[i].private,at->fds[i].subrs);
- PSCharsFree(at->fds[i].subrs);
- }
- _dumpcffstrings(at->globalsubrs,glbls);
- PSCharsFree(glbls);
-
- dumpcffheader(sf,at->cfff);
- dumpcffnames(sf,at->cfff);
- dumpcffcidset(sf,at);
- dumpcfffdselect(sf,at);
- dumpcffdictindex(sf,at);
- if ( (at->charstrings = dumpcffstrings(chrs))==NULL )
-return( false );
- dumpcffcidtopdict(sf,at);
- finishupcid(sf,at);
-
- at->cfflen = ftell(at->cfff);
- if ( at->cfflen&3 ) {
- for ( i=4-(at->cfflen&3); i>0; --i )
- putc('\0',at->cfff);
- }
-
- if ( at->format!=ff_cffcid )
- dumpcffcidhmtx(at,sf);
-return( true );
-}
-
-static int AnyInstructions(SplineFont *sf) {
- int i;
-
- if ( sf->subfontcnt!=0 ) {
- for ( i=0; i<sf->subfontcnt; ++i )
- if ( AnyInstructions(sf->subfonts[i]))
-return( true );
- } else {
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( sf->glyphs[i]->ttf_instrs_len!=0 )
-return( true );
- }
- }
-return( false );
-}
-
-#ifdef _HAS_LONGLONG
-void cvt_unix_to_1904( long long time, int32 result[2]) {
- uint32 date1970[4], tm[4];
- uint32 year[2];
- int i;
-
- tm[0] = time &0xffff;
- tm[1] = (time>>16)&0xffff;
- tm[2] = (time>>32)&0xffff;
- tm[3] = (time>>48)&0xffff;
-#else
-void cvt_unix_to_1904( long time, int32 result[2]) {
- int32 date1970[4], tm[4];
- uint32 year[2];
- int i;
-
- tm[0] = time &0xffff;
- tm[1] = (time>>16)&0xffff;
- tm[2] = 0;
- tm[3] = 0;
-#endif
- memset(date1970,0,sizeof(date1970));
- year[0] = (60*60*24*365L)&0xffff;
- year[1] = (60*60*24*365L)>>16;
- for ( i=1904; i<1970; ++i ) {
- date1970[0] += year[0];
- date1970[1] += year[1];
- if ( (i&3)==0 && (i%100!=0 || i%400==0))
- date1970[0] += 24*60*60L; /* Leap year */
- date1970[1] += (date1970[0]>>16);
- date1970[0] &= 0xffff;
- date1970[2] += date1970[1]>>16;
- date1970[1] &= 0xffff;
- date1970[3] += date1970[2]>>16;
- date1970[2] &= 0xffff;
- }
-
- for ( i=0; i<3; ++i ) {
- tm[i] += date1970[i];
- tm[i+1] += tm[i]>>16;
- tm[i] &= 0xffff;
- }
- tm[3] -= date1970[3];
-
- result[0] = (tm[1]<<16) | tm[0];
- result[1] = (tm[3]<<16) | tm[2];
-}
-
-static void sethead(struct head *head,SplineFont *sf,struct alltabs *at) {
- time_t now;
- int i, lr, rl, indic_rearrange, arabic;
- ASM *sm;
-
- lr = rl = arabic = 0;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- SplineChar *sc = sf->glyphs[at->gi.bygid[i]];
- int uni = sc->unicodeenc ;
- if ( SCRightToLeft(sc) )
- rl = 1;
- else if (( uni!=-1 && uni<0x10000 && islefttoright(uni)) ||
- (uni>=0x10300 && uni<0x107ff))
- lr = 1;
- if ( SCScriptFromUnicode(sc)==CHR('a','r','a','b') )
- arabic = 1;
- }
-
- head->version = 0x00010000;
- if ( sf->subfontcnt!=0 ) {
- int val, mant;
- val = floor(sf->cidversion);
- mant = floor(65536.*(sf->cidversion-val));
- head->revision = (val<<16) | mant;
- } else if ( sf->version!=NULL ) {
- char *pt=sf->version;
- double dval;
- int val, mant;
- while ( *pt && !isdigit(*pt) && *pt!='.' ) ++pt;
- if ( *pt ) {
- dval = strtod(pt,NULL);
- val = floor(dval);
- mant = floor(65536.*(dval-val));
- head->revision = (val<<16) | mant;
- }
- }
- head->checksumAdj = 0;
- head->magicNum = 0x5f0f3cf5;
- head->flags = 8|2|1; /* baseline at 0, lsbline at 0, round ppem */
- if ( AnyInstructions(sf))
- head->flags = 0x10|8|4|2|1; /* baseline at 0, lsbline at 0, round ppem, instructions may depend on point size, instructions change metrics */
-/* Apple flags */
- if ( sf->hasvmetrics )
- head->flags |= (1<<5); /* designed to be layed out vertically */
- /* Bit 6 must be zero */
- if ( arabic )
- head->flags |= (1<<7);
- if ( sf->sm )
- head->flags |= (1<<8); /* has metamorphesis effects */
- if ( rl )
- head->flags |= (1<<9);
- indic_rearrange = 0;
- for ( sm = sf->sm; sm!=NULL; sm=sm->next )
- if ( sm->type == asm_indic )
- indic_rearrange = true;
- if ( indic_rearrange )
- head->flags |= (1<<10);
-/* End apple flags */
- if ( sf->head_optimized_for_cleartype )
- head->flags |= (1<<13);
- head->emunits = sf->ascent+sf->descent;
- head->macstyle = MacStyleCode(sf,NULL);
- head->lowestreadable = 8;
- head->locais32 = 1;
-
- /* I assume we've always got some neutrals (spaces, punctuation) */
- if ( lr && rl )
- head->dirhint = 0;
- else if ( rl )
- head->dirhint = -2;
- else
- head->dirhint = 2;
- if ( rl )
- head->flags |= (1<<9); /* Apple documents this */
- /* if there are any indic characters, set bit 10 */
-
- time(&now); /* seconds since 1970, need to convert to seconds since 1904 */
- cvt_unix_to_1904(now,head->modtime);
- memcpy(head->createtime,head->modtime,sizeof(head->modtime));
-}
-
-static void sethhead(struct hhead *hhead,struct hhead *vhead,struct alltabs *at, SplineFont *sf) {
- int i, width, rbearing, height, bbearing;
- int ymax, ymin, xmax, xmin, off;
- DBounds bb;
- /* Might as well fill in the vhead even if we don't use it */
- /* we just won't dump it out if we don't want it */
-
- width = 0x80000000; rbearing = 0x7fffffff; height = 0x80000000; bbearing=0x7fffffff;
- xmax = ymax = 0x80000000; xmin = ymin = 0x7fffffff;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- SplineChar *sc = sf->glyphs[at->gi.bygid[i]];
- SplineCharFindBounds(sc,&bb);
- if ( sc->width>width ) width = sc->width;
- if ( sc->vwidth>height ) height = sc->vwidth;
- if ( sc->width-bb.maxx < rbearing ) rbearing = sc->width-bb.maxx;
- if ( sc->vwidth-bb.maxy < bbearing ) bbearing = sc->vwidth-bb.maxy;
- if ( bb.maxy > ymax ) ymax = bb.maxy;
- if ( bb.miny < ymin ) ymin = bb.miny;
- if ( bb.maxx > xmax ) xmax = bb.maxx;
- if ( bb.minx < xmin ) xmin = bb.minx;
- }
-
- if ( at->head.ymax>ymax ) ymax = at->head.ymax; /* If generated .notdef glyph is bigger than real glyphs */
- if ( at->head.ymin<ymin ) ymin = at->head.ymin;
-
- if ( ymax==0 && ymin==0 ) {
- /* this can happen in a bitmap only font */
- ymax = sf->ascent;
- ymin = -sf->descent;
- }
- hhead->version = 0x00010000;
- if ( sf->pfminfo.hheadascent_add )
- hhead->ascender = ymax + sf->pfminfo.hhead_ascent;
- else
- hhead->ascender = sf->pfminfo.hhead_ascent;
- if ( sf->pfminfo.hheadascent_add )
- hhead->descender = ymin + sf->pfminfo.hhead_descent;
- else
- hhead->descender = sf->pfminfo.hhead_descent;
- hhead->linegap = sf->pfminfo.linegap;
-
- vhead->version = 0x00011000;
- off = (sf->ascent+sf->descent)/2;
- vhead->ascender = xmax-off;
- vhead->descender = xmin-off;
- vhead->linegap = sf->pfminfo.linegap;
-
- at->isfixed = at->gi.fixed_width!=-1;
- hhead->maxwidth = width;
- hhead->minlsb = at->head.xmin;
- hhead->minrsb = rbearing;
- /* Apple's ftxvalidator says the the min sidebearing should be 0 even if it isn't */
- if ( hhead->minlsb>0 ) hhead->minlsb = 0;
- if ( hhead->minrsb>0 ) hhead->minrsb = 0;
- hhead->maxextent = at->head.xmax;
- if ( sf->italicangle==0 )
- hhead->caretSlopeRise = 1;
- else {
- hhead->caretSlopeRise = 100;
- hhead->caretSlopeRun = (int) rint(100*tan(-sf->italicangle*3.1415926535897/180.));
- }
-
- vhead->maxwidth = height;
- vhead->minlsb = at->head.ymin;
- vhead->minrsb = bbearing;
- vhead->maxextent = at->head.ymax;
- vhead->caretSlopeRise = 0;
- vhead->caretSlopeRun = 1;
- /* Are there vertical oblique fonts? */
-
- hhead->numMetrics = at->gi.hfullcnt;
- vhead->numMetrics = at->gi.vfullcnt;
-}
-
-static void setvorg(struct vorg *vorg, SplineFont *sf) {
- vorg->majorVersion = 1;
- vorg->minorVersion = 0;
- vorg->defaultVertOriginY = sf->vertical_origin;
- vorg->numVertOriginYMetrics = 0;
-}
-
-static void OS2WeightCheck(struct pfminfo *pfminfo,char *weight) {
- if ( weight==NULL ) {
- /* default it */
- } else if ( strstrmatch(weight,"medi")!=NULL ) {
- pfminfo->weight = 500;
- pfminfo->panose[2] = 6;
- } else if ( strstrmatch(weight,"demi")!=NULL ||
- strstrmatch(weight,"halb")!=NULL ||
- (strstrmatch(weight,"semi")!=NULL &&
- strstrmatch(weight,"bold")!=NULL) ) {
- pfminfo->weight = 600;
- pfminfo->panose[2] = 7;
- } else if ( strstrmatch(weight,"bold")!=NULL ||
- strstrmatch(weight,"fett")!=NULL ||
- strstrmatch(weight,"gras")!=NULL ) {
- pfminfo->weight = 700;
- pfminfo->panose[2] = 8;
- } else if ( strstrmatch(weight,"heavy")!=NULL ) {
- pfminfo->weight = 800;
- pfminfo->panose[2] = 9;
- } else if ( strstrmatch(weight,"black")!=NULL ) {
- pfminfo->weight = 900;
- pfminfo->panose[2] = 10;
- } else if ( strstrmatch(weight,"nord")!=NULL ) {
- pfminfo->weight = 950;
- pfminfo->panose[2] = 11;
- } else if ( strstrmatch(weight,"thin")!=NULL ) {
- pfminfo->weight = 100;
- pfminfo->panose[2] = 2;
- } else if ( strstrmatch(weight,"extra")!=NULL ||
- strstrmatch(weight,"light")!=NULL ) {
- pfminfo->weight = 200;
- pfminfo->panose[2] = 3;
- } else if ( strstrmatch(weight,"light")!=NULL ) {
- pfminfo->weight = 300;
- pfminfo->panose[2] = 4;
- }
-}
-
-void SFDefaultOS2Simple(struct pfminfo *pfminfo,SplineFont *sf) {
- pfminfo->pfmfamily = 0x11;
- pfminfo->panose[0] = 2;
- pfminfo->weight = 400;
- pfminfo->panose[2] = 5;
- pfminfo->width = 5;
- pfminfo->panose[3] = 3;
- pfminfo->winascent_add = pfminfo->windescent_add = true;
- pfminfo->hheadascent_add = pfminfo->hheaddescent_add = true;
- pfminfo->typoascent_add = pfminfo->typodescent_add = true;
- pfminfo->os2_winascent = pfminfo->os2_windescent = 0;
-
- if ( sf->subfonts!=NULL ) sf = sf->subfonts[0];
- pfminfo->linegap = pfminfo->vlinegap = pfminfo->os2_typolinegap =
- rint(.09*(sf->ascent+sf->descent));
-}
-
-void SFDefaultOS2SubSuper(struct pfminfo *pfminfo,int emsize,double italic_angle) {
- double s = sin(italic_angle*3.1415926535897932/180.0);
- pfminfo->os2_supysize = pfminfo->os2_subysize = .7*emsize;
- pfminfo->os2_supxsize = pfminfo->os2_subxsize = .65*emsize;
- pfminfo->os2_subyoff = .14*emsize;
- pfminfo->os2_supyoff = .48*emsize;
- pfminfo->os2_supxoff = s*pfminfo->os2_supyoff;
- pfminfo->os2_subxoff = -s*pfminfo->os2_subyoff;
- pfminfo->os2_strikeysize = 102*emsize/2048;
- pfminfo->os2_strikeypos = 530*emsize/2048;
-}
-
-void SFDefaultOS2Info(struct pfminfo *pfminfo,SplineFont *sf,char *fontname) {
- int samewid= -1;
- char *weight = sf->cidmaster==NULL ? sf->weight : sf->cidmaster->weight;
-
- if ( sf->pfminfo.pfmset ) {
- if ( pfminfo!=&sf->pfminfo )
- *pfminfo = sf->pfminfo;
- if ( !pfminfo->panose_set ) {
- struct pfminfo info;
- memset(&info,0,sizeof(info));
- sf->pfminfo.pfmset = false;
- SFDefaultOS2Info(&info,sf,fontname);
- sf->pfminfo.pfmset = true;
- memcpy(pfminfo->panose,info.panose,sizeof(info.panose));
- }
- } else {
- struct pfminfo hold;
- if ( pfminfo->hheadset || pfminfo->vheadset )
- hold = *pfminfo;
- else
- hold.hheadset = hold.vheadset = false;
- memset(pfminfo,'\0',sizeof(*pfminfo));
- SFDefaultOS2Simple(pfminfo,sf);
- samewid = CIDOneWidth(sf);
-
- pfminfo->pfmfamily = 0x10;
- if ( samewid>0 ) {
- pfminfo->pfmfamily = 0x30;
- /* pfminfo->panose[3] = 9; */ /* This is done later */
- } else if ( strstrmatch(fontname,"sans")!=NULL )
- pfminfo->pfmfamily = 0x20;
- else if ( strstrmatch(fontname,"script")!=NULL ) {
- pfminfo->pfmfamily = 0x40;
- pfminfo->panose[0] = 3;
- }
- if ( samewid==-1 )
- pfminfo->pfmfamily |= 0x1; /* Else it assumes monospace */
-
-/* urw uses 4 character abreviations */
- if ( weight!=NULL )
- OS2WeightCheck(pfminfo,weight);
- OS2WeightCheck(pfminfo,fontname);
-
- if ( strstrmatch(fontname,"ultra")!=NULL &&
- strstrmatch(fontname,"condensed")!=NULL ) {
- pfminfo->width = 1;
- pfminfo->panose[3] = 8;
- } else if ( strstrmatch(fontname,"extra")!=NULL &&
- strstrmatch(fontname,"condensed")!=NULL ) {
- pfminfo->width = 2;
- pfminfo->panose[3] = 8;
- } else if ( strstrmatch(fontname,"semi")!=NULL &&
- strstrmatch(fontname,"condensed")!=NULL ) {
- pfminfo->width = 4;
- pfminfo->panose[3] = 6;
- } else if ( strstrmatch(fontname,"condensed")!=NULL ||
- strstrmatch(fontname,"narrow")!=NULL ) {
- pfminfo->width = 3;
- pfminfo->panose[3] = 6;
- } else if ( strstrmatch(fontname,"ultra")!=NULL &&
- strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 9;
- pfminfo->panose[3] = 7;
- } else if ( strstrmatch(fontname,"extra")!=NULL &&
- strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 8;
- pfminfo->panose[3] = 7;
- } else if ( strstrmatch(fontname,"semi")!=NULL &&
- strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 6;
- pfminfo->panose[3] = 5;
- } else if ( strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 7;
- pfminfo->panose[3] = 5;
- }
- if ( samewid>0 )
- pfminfo->panose[3] = 9;
- if ( hold.hheadset ) {
- pfminfo->hheadset = true;
- pfminfo->hheadascent_add = hold.hheadascent_add;
- pfminfo->hheaddescent_add = hold.hheaddescent_add;
- pfminfo->hhead_ascent = hold.hhead_ascent;
- pfminfo->hhead_descent = hold.hhead_descent;
- pfminfo->linegap = hold.linegap;
- }
- if ( hold.vheadset ) {
- pfminfo->vheadset = true;
- pfminfo->vlinegap = hold.vlinegap;
- }
- }
- if ( !pfminfo->subsuper_set )
- SFDefaultOS2SubSuper(pfminfo,sf->ascent+sf->descent,sf->italicangle);
-}
-
-void OS2FigureCodePages(SplineFont *sf, uint32 CodePage[2]) {
- int i;
- uint32 latin1[8];
- int has_ascii, has_latin1;
-
- memset(latin1,0,sizeof(latin1));
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( sf->glyphs[i]->unicodeenc<256 && sf->glyphs[i]->unicodeenc>=0 )
- latin1[(sf->glyphs[i]->unicodeenc>>5)] |= 1<<(sf->glyphs[i]->unicodeenc&31);
- }
-
- has_ascii = latin1[1]==0xffffffff && latin1[2]==0xffffffff &&
- (latin1[3]&0x7fffffff)==0x7fffffff; /* DEL is not a char */
- has_latin1 = has_ascii && (latin1[5]&~1&~(1<<0xd))== (~1&~(1<<0xd)) && /* Ignore nobreak space, softhyphen */
- latin1[6]==0xffffffff && latin1[7] == 0xffffffff;
- CodePage[0] = CodePage[1] = 0;
- if ( has_ascii ) CodePage[1] |= 1U<<31; /* US (Ascii I assume) */
- if ( has_latin1 ) CodePage[0] |= 1U<<30; /* WE/latin1 */
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( sf->glyphs[i]->unicodeenc==0xde && has_ascii )
- CodePage[0] |= 1<<0; /* (ANSI) Latin1 */
- else if ( sf->glyphs[i]->unicodeenc==0x13d && has_ascii ) {
- CodePage[0] |= 1<<1; /* latin2 */
- CodePage[1] |= 1<<26; /* latin2 */
- } else if ( sf->glyphs[i]->unicodeenc==0x411 ) {
- CodePage[0] |= 1<<2; /* cyrillic */
- CodePage[1] |= 1<<17; /* MS DOS Russian */
- CodePage[1] |= 1<<25; /* IBM Cyrillic */
- } else if ( sf->glyphs[i]->unicodeenc==0x386 ) {
- CodePage[0] |= 1<<3; /* greek */
- CodePage[1] |= 1<<16; /* IBM Greek */
- CodePage[1] |= 1<<28; /* Greek, former 437 G */
- } else if ( sf->glyphs[i]->unicodeenc==0x130 && has_ascii ) {
- CodePage[0] |= 1<<4; /* turkish */
- CodePage[1] |= 1<<24; /* IBM turkish */
- } else if ( sf->glyphs[i]->unicodeenc==0x5d0 ) {
- CodePage[0] |= 1<<5; /* hebrew */
- CodePage[1] |= 1<<21; /* hebrew */
- } else if ( sf->glyphs[i]->unicodeenc==0x631 ) {
- CodePage[0] |= 1<<6; /* arabic */
- CodePage[1] |= 1<<19; /* arabic */
- CodePage[1] |= 1<<29; /* arabic; ASMO 708 */
- } else if ( sf->glyphs[i]->unicodeenc==0x157 && has_ascii ) {
- CodePage[0] |= 1<<7; /* baltic */
- CodePage[1] |= 1<<27; /* baltic */
- } else if ( sf->glyphs[i]->unicodeenc==0x20AB && has_ascii ) {
- CodePage[0] |= 1<<8; /* vietnamese */
- } else if ( sf->glyphs[i]->unicodeenc==0xe45 )
- CodePage[0] |= 1<<16; /* thai */
- else if ( sf->glyphs[i]->unicodeenc==0x30a8 )
- CodePage[0] |= 1<<17; /* japanese */
- else if ( sf->glyphs[i]->unicodeenc==0x3105 )
- CodePage[0] |= 1<<18; /* simplified chinese */
- else if ( sf->glyphs[i]->unicodeenc==0x3131 )
- CodePage[0] |= 1<<19; /* korean wansung */
- else if ( sf->glyphs[i]->unicodeenc==0x592E )
- CodePage[0] |= 1<<20; /* traditional chinese */
- else if ( sf->glyphs[i]->unicodeenc==0xacf4 )
- CodePage[0] |= 1<<21; /* korean Johab */
- else if ( sf->glyphs[i]->unicodeenc==0x2030 && has_ascii )
- CodePage[0] |= 1U<<29; /* mac roman */
- else if ( sf->glyphs[i]->unicodeenc==0x2665 && has_ascii )
- CodePage[0] |= 1U<<30; /* OEM */
-#if 0 /* the symbol bit doesn't mean it contains the glyphs in symbol */
- /* rather that one is using a symbol encoding. Or that there are */
- /* glyphs with unicode encoding between 0xf000 and 0xf0ff, in which */
- /* case those guys should be given a symbol encoding */
- /* There's a bug in the way otf fonts handle this (but not ttf) and */
- /* they only seem to list the symbol glyphs */
- else if ( sf->glyphs[i]->unicodeenc==0x21d4 )
- CodePage[0] |= 1U<<31; /* symbol */
-#else
- /* This doesn't work well either. In ttf fonts the bit is ignored */
- /* in otf fonts the bit means "ignore all other bits" */
- else if ( sf->glyphs[i]->unicodeenc>=0xf000 && sf->glyphs[i]->unicodeenc<=0xf0ff )
- CodePage[0] |= 1U<<31; /* symbol */
-#endif
- else if ( sf->glyphs[i]->unicodeenc==0xc3 && has_ascii )
- CodePage[1] |= 1<<18; /* MS-DOS Nordic */
- else if ( sf->glyphs[i]->unicodeenc==0xe9 && has_ascii )
- CodePage[1] |= 1<<20; /* MS-DOS Canadian French */
- else if ( sf->glyphs[i]->unicodeenc==0xf5 && has_ascii )
- CodePage[1] |= 1<<23; /* MS-DOS Portuguese */
- else if ( sf->glyphs[i]->unicodeenc==0xfe && has_ascii )
- CodePage[1] |= 1<<22; /* MS-DOS Icelandic */
- }
-}
-
-static void WinBB(SplineFont *sf,uint16 *winascent,uint16 *windescent,struct alltabs *at) {
- /* The windows ascent/descent is calculated on the ymin/max of the */
- /* glyphs in the so called ANSI character set. I'm going to pretend */
- /* that's Latin1 with a few additions */
- /* Well, that's what is documented, but the documentation says contradictory */
- /* things. I believe that winAscent should be the same as hhea.ascent */
-
- *winascent = at->head.ymax;
- *windescent = -at->head.ymin; /* Should be positive */
- if ( sf->cidmaster!=NULL )
- sf = sf->cidmaster;
-
- if ( sf->pfminfo.winascent_add )
- *winascent += sf->pfminfo.os2_winascent;
- else
- *winascent = sf->pfminfo.os2_winascent;
- if ( sf->pfminfo.windescent_add )
- *windescent += sf->pfminfo.os2_windescent;
- else
- *windescent = sf->pfminfo.os2_windescent;
-}
-
-static void setos2(struct os2 *os2,struct alltabs *at, SplineFont *sf,
- enum fontformat format) {
- int i,j,cnt1,cnt2,first,last,avg1,avg2,gid;
- char *pt;
- static int const weightFactors[26] = { 64, 14, 27, 35, 100, 20, 14, 42, 63,
- 3, 6, 35, 20, 56, 56, 17, 4, 49, 56, 71, 31, 10, 18, 3, 18, 2 };
- EncMap *map;
-
- os2->version = 1;
- if ( format==ff_otf || format==ff_otfcid )
- os2->version = 3;
- if ( sf->os2_version!=0 )
- os2->version = sf->os2_version;
-
- os2->weightClass = sf->pfminfo.weight;
- os2->widthClass = sf->pfminfo.width;
- os2->fstype = 0x8;
- if ( sf->pfminfo.fstype!=-1 )
- os2->fstype = sf->pfminfo.fstype;
- if ( !sf->pfminfo.subsuper_set )
- SFDefaultOS2SubSuper(&sf->pfminfo,sf->ascent+sf->descent,sf->italicangle);
- os2->ysupYSize = sf->pfminfo.os2_supysize;
- os2->ysubXSize = sf->pfminfo.os2_subxsize;
- os2->ysubYSize = sf->pfminfo.os2_subysize;
- os2->ysupXSize = sf->pfminfo.os2_supxsize;
- os2->ysubYOff = sf->pfminfo.os2_subyoff;
- os2->ysubXOff = sf->pfminfo.os2_subxoff;
- os2->ysupXOff = sf->pfminfo.os2_supxoff;
- os2->ysupYOff = sf->pfminfo.os2_supyoff;
- os2->yStrikeoutSize = sf->pfminfo.os2_strikeysize;
- os2->yStrikeoutPos = sf->pfminfo.os2_strikeypos;
- os2->fsSel = (at->head.macstyle&1?32:0)|(at->head.macstyle&2?1:0);
- if ( sf->fullname!=NULL && strstrmatch(sf->fullname,"outline")!=NULL )
- os2->fsSel |= 8;
- if ( os2->fsSel==0 && sf->pfminfo.weight==400 )
- os2->fsSel = 64; /* Regular */
- if ( os2->version>=4 ) {
- if ( strstrmatch(sf->fontname,"Obli")==0 ) {
- os2->fsSel &= ~1; /* Turn off Italic */
- os2->fsSel |= 512; /* Turn on Oblique */
- }
- if ( sf->use_typo_metrics )
- os2->fsSel |= 128; /* Don't use win ascent/descent for line spacing */
- if ( sf->weight_width_slope_only )
- os2->fsSel |= 256;
- }
-/* David Lemon @Adobe.COM
-1) The sTypoAscender and sTypoDescender values should sum to 2048 in
-a 2048-unit font. They indicate the position of the em square
-relative to the baseline.
-GWW: Almost, sTypoAscender-sTypoDescender == EmSize
-
-2) The usWinAscent and usWinDescent values represent the maximum
-height and depth of specific glyphs within the font, and some
-applications will treat them as the top and bottom of the font
-bounding box. (the "ANSI" glyphs)
-GWW: That's what's documented. But it means non-ANSI glyphs get clipped. So the
-docs are wrong.
-*/
- if ( sf->pfminfo.typoascent_add )
- os2->ascender = sf->ascent + sf->pfminfo.os2_typoascent;
- else
- os2->ascender = sf->pfminfo.os2_typoascent;
- if ( sf->pfminfo.typodescent_add )
- os2->descender = -sf->descent + sf->pfminfo.os2_typodescent; /* Should be neg */
- else
- os2->descender = sf->pfminfo.os2_typodescent;
- WinBB(sf,&os2->winascent,&os2->windescent,at);
- os2->linegap = sf->pfminfo.os2_typolinegap;
- os2->sFamilyClass = sf->pfminfo.os2_family_class;
-
- avg1 = avg2 = last = 0; first = 0xffff;
- cnt1 = cnt2 = 0;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( SCWorthOutputting(sf->glyphs[i]) &&
- sf->glyphs[i]->unicodeenc!=-1 ) {
- if ( sf->glyphs[i]->unicodeenc > 0xffff )
- os2->unicoderange[57>>5] |= (1<<(57&31));
- for ( j=0; j<sizeof(uniranges)/sizeof(uniranges[0]); ++j )
- if ( sf->glyphs[i]->unicodeenc>=uniranges[j][0] &&
- sf->glyphs[i]->unicodeenc<=uniranges[j][1] ) {
- int bit = uniranges[j][2];
- os2->unicoderange[bit>>5] |= (1<<(bit&31));
- break;
- }
- /* Don't include the dummy glyphs (.notdef, .null, etc.) they aren't */
- /* really encoded. Don't include glyphs out of BMP, OS/2 uses shorts */
- /* for the first/last char and can't represent them. */
- /* If no BMP glyphs, then first should be 0xffff. If any outside */
- /* BMP then last is 0xffff */
- if ( sf->glyphs[i]->ttf_glyph>2 ) {
- if ( sf->glyphs[i]->unicodeenc<=0xffff ) {
- if ( sf->glyphs[i]->unicodeenc<first ) first = sf->glyphs[i]->unicodeenc;
- if ( sf->glyphs[i]->unicodeenc>last ) last = sf->glyphs[i]->unicodeenc;
- } else {
- last = 0xffff;
- }
- }
- if ( sf->glyphs[i]->width!=0 ) {
- avg2 += sf->glyphs[i]->width; ++cnt2;
- }
- if ( sf->glyphs[i]->unicodeenc==' ') {
- avg1 += sf->glyphs[i]->width * 166; ++cnt1;
- } else if (sf->glyphs[i]->unicodeenc>='a' && sf->glyphs[i]->unicodeenc<='z') {
- avg1 += sf->glyphs[i]->width * weightFactors[sf->glyphs[i]->unicodeenc-'a']; ++cnt1;
- }
- }
- }
- if ( format==ff_ttfsym ) /* MS Symbol font has this set to zero. Does it matter? */
- memset(os2->unicoderange,0,sizeof(os2->unicoderange));
-
- if ( sf->pfminfo.pfmset )
- strncpy(os2->achVendID,sf->pfminfo.os2_vendor,4);
- else if ( TTFFoundry!=NULL )
- strncpy(os2->achVendID,TTFFoundry,4);
- else
- memcpy(os2->achVendID,"PfEd",4);
- for ( pt=os2->achVendID; pt<os2->achVendID && *pt!='\0'; ++pt );
- while ( pt<os2->achVendID ) *pt++ = ' '; /* Pad with spaces not NUL */
-
- /* v1,2 & v3,4 have different ways of calculating avgCharWid. */
- /* but I'm told that using the v3 way breaks display of CJK fonts in windows */
- os2->avgCharWid = 500;
- os2->v1_avgCharWid = os2->v3_avgCharWid = 0;
- if ( cnt1==27 )
- os2->v1_avgCharWid = avg1/1000;
- if ( cnt2!=0 )
- os2->v3_avgCharWid = avg2/cnt2;
- memcpy(os2->panose,sf->pfminfo.panose,sizeof(os2->panose));
- map = at->map;
- if ( format==ff_ttfsym ) {
- os2->ulCodePage[0] = 0x80000000;
- os2->ulCodePage[1] = 0;
- first = 255; last = 0;
- for ( i=0; i<map->enccount && i<255; ++i )
- if ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL &&
- sf->glyphs[gid]->ttf_glyph!=-1 ) {
- if ( i<first ) first = i;
- if ( i>last ) last = i;
- }
- os2->firstcharindex = 0xf000 + first; /* This gets mapped to space */
- os2->lastcharindex = 0xf000 + last;
- } else {
- os2->firstcharindex = first;
- os2->lastcharindex = last;
- OS2FigureCodePages(sf, os2->ulCodePage);
- /* Herbert Duerr: */
- /* Some old versions of Windows do not provide access to all */
- /* glyphs in a font if the fonts contains non-PUA symbols */
- /* and thus only has sets the codepage flag for symbol */
- /* => a workaround for this problem on Windows legacy versions */
- /* is to use an OS2-table version without codepage flags */
- /* GWW: */
- /* This sounds to me like a windows bug rather than one in ff */
- /* and this is a work-around for windows. As far as I can tell */
- /* ff is setting the codepage field properly, it's just that */
- /* windows doesn't interpret that bit correctly */
- /* GWW: Things get worse. Windows no longer accepts a version 0 */
- /* for OS/2. FontLab simply lies and says we have a latin1 */
- /* code page when we don't. */
- if( format!=ff_ttfsym )
- if( (os2->ulCodePage[0]&~(1U<<31))==0 && os2->ulCodePage[1]==0 )
- os2->ulCodePage[0] |= 1;
- }
-
- if ( os2->version>=2 ) {
- BlueData bd;
-
- QuickBlues(sf,&bd); /* This handles cid fonts properly */
- os2->xHeight = (bd.xheight >= 0.0 ? bd.xheight : 0);
- os2->capHeight = (bd.caph >= 0.0 ? bd.caph : 0);
- os2->defChar = 0;
- if ( format==ff_otf || format==ff_otfcid )
- os2->defChar = ' ';
- os2->breakChar = ' ';
- os2->maxContext = 1; /* Kerning will set this to 2, ligature to whatever */
- }
-
- if ( os2->version>=3 && os2->v3_avgCharWid!=0 )
- os2->avgCharWid = os2->v3_avgCharWid;
- else if ( os2->v1_avgCharWid!=0 )
- os2->avgCharWid = os2->v1_avgCharWid;
- else if ( os2->v3_avgCharWid!=0 )
- os2->avgCharWid = os2->v3_avgCharWid;
-}
-
-static void redoloca(struct alltabs *at) {
- int i;
-
- at->loca = tmpfile();
- if ( at->head.locais32 ) {
- for ( i=0; i<=at->maxp.numGlyphs; ++i )
- putlong(at->loca,at->gi.loca[i]);
- at->localen = sizeof(int32)*(at->maxp.numGlyphs+1);
- } else {
- for ( i=0; i<=at->maxp.numGlyphs; ++i )
- putshort(at->loca,at->gi.loca[i]/2);
- at->localen = sizeof(int16)*(at->maxp.numGlyphs+1);
- if ( ftell(at->loca)&2 )
- putshort(at->loca,0);
- }
- if ( at->format!=ff_type42 && at->format!=ff_type42cid ) {
- free(at->gi.loca);
- at->gi.loca = NULL;
- }
-}
-
-static void dummyloca(struct alltabs *at) {
-
- at->loca = tmpfile();
- if ( at->head.locais32 ) {
- putlong(at->loca,0);
- at->localen = sizeof(int32);
- } else {
- putshort(at->loca,0);
- at->localen = sizeof(int16);
- putshort(at->loca,0); /* pad it */
- }
-}
-
-static void redohead(struct alltabs *at) {
- at->headf = tmpfile();
-
- putlong(at->headf,at->head.version);
- putlong(at->headf,at->head.revision);
- putlong(at->headf,at->head.checksumAdj);
- putlong(at->headf,at->head.magicNum);
- putshort(at->headf,at->head.flags);
- putshort(at->headf,at->head.emunits);
- putlong(at->headf,at->head.createtime[1]);
- putlong(at->headf,at->head.createtime[0]);
- putlong(at->headf,at->head.modtime[1]);
- putlong(at->headf,at->head.modtime[0]);
- putshort(at->headf,at->head.xmin);
- putshort(at->headf,at->head.ymin);
- putshort(at->headf,at->head.xmax);
- putshort(at->headf,at->head.ymax);
- putshort(at->headf,at->head.macstyle);
- putshort(at->headf,at->head.lowestreadable);
- putshort(at->headf,at->head.dirhint);
- putshort(at->headf,at->head.locais32);
- putshort(at->headf,at->head.glyphformat);
-
- at->headlen = ftell(at->headf);
- if ( (at->headlen&2)!=0 )
- putshort(at->headf,0);
-}
-
-static void redohhead(struct alltabs *at,int isv) {
- int i;
- struct hhead *head;
- FILE *f;
-
- if ( !isv ) {
- f = at->hheadf = tmpfile();
- head = &at->hhead;
- } else {
- f = at->vheadf = tmpfile();
- head = &at->vhead;
- }
-
- putlong(f,head->version);
- putshort(f,head->ascender);
- putshort(f,head->descender);
- putshort(f,head->linegap);
- putshort(f,head->maxwidth);
- putshort(f,head->minlsb);
- putshort(f,head->minrsb);
- putshort(f,head->maxextent);
- putshort(f,head->caretSlopeRise);
- putshort(f,head->caretSlopeRun);
- for ( i=0; i<5; ++i )
- putshort(f,head->mbz[i]);
- putshort(f,head->metricformat);
- putshort(f,head->numMetrics);
-
- if ( !isv ) {
- at->hheadlen = ftell(f);
- if ( (at->hheadlen&2)!=0 )
- putshort(f,0);
- } else {
- at->vheadlen = ftell(f);
- if ( (at->vheadlen&2)!=0 )
- putshort(f,0);
- }
-}
-
-static void redovorg(struct alltabs *at) {
-
- at->vorgf = tmpfile();
- putshort(at->vorgf,at->vorg.majorVersion);
- putshort(at->vorgf,at->vorg.minorVersion);
- putshort(at->vorgf,at->vorg.defaultVertOriginY);
- putshort(at->vorgf,at->vorg.numVertOriginYMetrics);
-
- at->vorglen = ftell(at->vorgf);
- if ( (at->vorglen&2)!=0 )
- putshort(at->vorgf,0);
-}
-
-static void redomaxp(struct alltabs *at,enum fontformat format) {
- at->maxpf = tmpfile();
-
- putlong(at->maxpf,at->maxp.version);
- putshort(at->maxpf,at->maxp.numGlyphs);
- if ( format!=ff_otf && format!=ff_otfcid ) {
- putshort(at->maxpf,at->maxp.maxPoints);
- putshort(at->maxpf,at->maxp.maxContours);
- putshort(at->maxpf,at->maxp.maxCompositPts);
- putshort(at->maxpf,at->maxp.maxCompositCtrs);
- putshort(at->maxpf,at->maxp.maxZones);
- putshort(at->maxpf,at->maxp.maxTwilightPts);
- putshort(at->maxpf,at->maxp.maxStorage);
- putshort(at->maxpf,at->maxp.maxFDEFs);
- putshort(at->maxpf,at->maxp.maxIDEFs);
- putshort(at->maxpf,at->maxp.maxStack);
- putshort(at->maxpf,at->maxp.maxglyphInstr);
- putshort(at->maxpf,at->maxp.maxnumcomponents);
- putshort(at->maxpf,at->maxp.maxcomponentdepth);
- }
-
- at->maxplen = ftell(at->maxpf);
- if ( (at->maxplen&2)!=0 )
- putshort(at->maxpf,0);
-}
-
-static void redoos2(struct alltabs *at) {
- int i;
- at->os2f = tmpfile();
-
- putshort(at->os2f,at->os2.version);
- putshort(at->os2f,at->os2.avgCharWid);
- putshort(at->os2f,at->os2.weightClass);
- putshort(at->os2f,at->os2.widthClass);
- putshort(at->os2f,at->os2.fstype);
- putshort(at->os2f,at->os2.ysubXSize);
- putshort(at->os2f,at->os2.ysubYSize);
- putshort(at->os2f,at->os2.ysubXOff);
- putshort(at->os2f,at->os2.ysubYOff);
- putshort(at->os2f,at->os2.ysupXSize);
- putshort(at->os2f,at->os2.ysupYSize);
- putshort(at->os2f,at->os2.ysupXOff);
- putshort(at->os2f,at->os2.ysupYOff);
- putshort(at->os2f,at->os2.yStrikeoutSize);
- putshort(at->os2f,at->os2.yStrikeoutPos);
- putshort(at->os2f,at->os2.sFamilyClass);
- for ( i=0; i<10; ++i )
- putc(at->os2.panose[i],at->os2f);
- for ( i=0; i<4; ++i )
- putlong(at->os2f,at->os2.unicoderange[i]);
- for ( i=0; i<4; ++i )
- putc(at->os2.achVendID[i],at->os2f);
- putshort(at->os2f,at->os2.fsSel);
- putshort(at->os2f,at->os2.firstcharindex);
- putshort(at->os2f,at->os2.lastcharindex);
- putshort(at->os2f,at->os2.ascender);
- putshort(at->os2f,at->os2.descender);
- putshort(at->os2f,at->os2.linegap);
- putshort(at->os2f,at->os2.winascent);
- putshort(at->os2f,at->os2.windescent);
- if ( at->os2.version>=1 ) {
- putlong(at->os2f,at->os2.ulCodePage[0]);
- putlong(at->os2f,at->os2.ulCodePage[1]);
- }
-
- if ( at->os2.version>=2 ) {
- putshort(at->os2f,at->os2.xHeight);
- putshort(at->os2f,at->os2.capHeight);
- putshort(at->os2f,at->os2.defChar);
- putshort(at->os2f,at->os2.breakChar);
- putshort(at->os2f,at->os2.maxContext);
- }
-
- at->os2len = ftell(at->os2f);
- if ( (at->os2len&2)!=0 )
- putshort(at->os2f,0);
-}
-
-#if 0
-static int icomp(const void *a, const void *b) {
- return *(int *)a - *(int *)b;
-}
-#endif
-
-static void dumpgasp(struct alltabs *at, SplineFont *sf) {
- int i;
-
- at->gaspf = tmpfile();
- if ( sf->gasp_cnt==0 ) {
- putshort(at->gaspf,0); /* Old version number */
- /* For fonts with no instructions always dump a gasp table which */
- /* asks for grey and no grid fit */
- putshort(at->gaspf,1);
- putshort(at->gaspf,0xffff); /* Upper bound on pixels/em for this range */
- putshort(at->gaspf,0x2); /* Grey scale, no gridfitting */
- /* No hints, so no grids to fit */
- } else {
- putshort(at->gaspf,sf->gasp_version); /* New version number, with clear type info */
- putshort(at->gaspf,sf->gasp_cnt);
- for ( i=0; i<sf->gasp_cnt; ++i ) {
- putshort(at->gaspf,sf->gasp[i].ppem);
- putshort(at->gaspf,sf->gasp[i].flags);
- }
- }
- at->gasplen = ftell(at->gaspf);
- /* This table is always 32 bit aligned */
-}
-
-#if 0
-static void dumpmacstr(FILE *file,unichar_t *str) {
- int ch;
- unsigned char *table;
-
- do {
- ch = *str++;
- if ( ch==0 )
- putc('\0',file);
- else if ( (ch>>8)>=mac_from_unicode.first && (ch>>8)<=mac_from_unicode.last &&
- (table = mac_from_unicode.table[(ch>>8)-mac_from_unicode.first])!=NULL &&
- table[ch&0xff]!=0 )
- putc(table[ch&0xff],file);
- else
- putc('?',file); /* if we were to omit an unencoded char all our position calculations would be off */
- } while ( ch!='\0' );
-}
-#endif
-
-static void dumpstr(FILE *file,char *str) {
- do {
- putc(*str,file);
- } while ( *str++!='\0' );
-}
-
-#if 0
-static void dumpc2ustr(FILE *file,char *str) {
- do {
- putc('\0',file);
- putc(*str,file);
- } while ( *str++!='\0' );
-}
-#endif
-
-static void dumpustr(FILE *file,char *utf8_str) {
- unichar_t *ustr = utf82u_copy(utf8_str), *pt=ustr;
- do {
- putc(*pt>>8,file);
- putc(*pt&0xff,file);
- } while ( *pt++!='\0' );
- free(ustr);
-}
-
-static void dumppstr(FILE *file,char *str) {
- putc(strlen(str),file);
- fwrite(str,sizeof(char),strlen(str),file);
-}
-
-char *utf8_verify_copy(const char *str) {
- /* When given a postscript string it SHOULD be in ASCII. But it will often*/
- /* contain a copyright symbol (sometimes in latin1, sometimes in macroman)*/
- /* unfortunately both encodings use 0xa9 for copyright so we can't distinguish */
- /* guess that it's latin1 (or that copyright is the only odd char which */
- /* means a latin1 conversion will work for macs too). */
-
- if ( str==NULL )
-return( NULL );
-
- if ( utf8_valid(str))
-return( copy(str)); /* Either in ASCII (good) or appears to be utf8*/
-return( latin1_2_utf8_copy(str));
-}
-
-/* Oh. If the encoding is symbol (platform=3, specific=0) then Windows won't */
-/* accept the font unless the name table also has entries for (3,0). I'm not */
-/* sure if this is the case for the CJK encodings (docs don't mention that) */
-/* but let's do it just in case */
-void DefaultTTFEnglishNames(struct ttflangname *dummy, SplineFont *sf) {
- time_t now;
- struct tm *tm;
- char buffer[200];
-
- if ( dummy->names[ttf_copyright]==NULL || *dummy->names[ttf_copyright]=='\0' )
- dummy->names[ttf_copyright] = utf8_verify_copy(sf->copyright);
- if ( dummy->names[ttf_family]==NULL || *dummy->names[ttf_family]=='\0' )
- dummy->names[ttf_family] = utf8_verify_copy(sf->familyname);
- if ( dummy->names[ttf_subfamily]==NULL || *dummy->names[ttf_subfamily]=='\0' )
- dummy->names[ttf_subfamily] = utf8_verify_copy(SFGetModifiers(sf));
- if ( dummy->names[ttf_uniqueid]==NULL || *dummy->names[ttf_uniqueid]=='\0' ) {
- time(&now);
- tm = localtime(&now);
- sprintf( buffer, "%s : %s : %d-%d-%d",
- BDFFoundry?BDFFoundry:TTFFoundry?TTFFoundry:"FontForge 2.0",
- sf->fullname!=NULL?sf->fullname:sf->fontname,
- tm->tm_mday, tm->tm_mon+1, tm->tm_year+1900 );
- dummy->names[ttf_uniqueid] = copy(buffer);
- }
- if ( dummy->names[ttf_fullname]==NULL || *dummy->names[ttf_fullname]=='\0' )
- dummy->names[ttf_fullname] = utf8_verify_copy(sf->fullname);
- if ( dummy->names[ttf_version]==NULL || *dummy->names[ttf_version]=='\0' ) {
- if ( sf->subfontcnt!=0 )
- sprintf( buffer, "Version %f ", sf->cidversion );
- else if ( sf->version!=NULL )
- sprintf(buffer,"Version %.20s ", sf->version);
- else
- strcpy(buffer,"Version 1.0" );
- dummy->names[ttf_version] = copy(buffer);
- }
- if ( dummy->names[ttf_postscriptname]==NULL || *dummy->names[ttf_postscriptname]=='\0' )
- dummy->names[ttf_postscriptname] = utf8_verify_copy(sf->fontname);
-}
-
-typedef struct {
- uint16 platform;
- uint16 specific;
- uint16 lang;
- uint16 strid;
- uint16 len;
- uint16 offset;
-} NameEntry;
-
-typedef struct {
- FILE *strings;
- int cur, max;
- enum fontformat format;
- Encoding *encoding_name;
- NameEntry *entries;
- int applemode;
-} NamTab;
-
-static int compare_entry(const void *_mn1, const void *_mn2) {
- const NameEntry *mn1 = _mn1, *mn2 = _mn2;
-
- if ( mn1->platform!=mn2->platform )
-return( mn1->platform - mn2->platform );
- if ( mn1->specific!=mn2->specific )
-return( mn1->specific - mn2->specific );
- if ( mn1->lang!=mn2->lang )
-return( mn1->lang - mn2->lang );
-
-return( mn1->strid-mn2->strid );
-}
-
-static void AddEncodedName(NamTab *nt,char *utf8name,uint16 lang,uint16 strid) {
- NameEntry *ne;
- int maclang, macenc= -1, specific;
- char *macname = NULL;
-
- if ( strid==ttf_postscriptname && lang!=0x409 )
-return; /* Should not happen, but it did */
-
- if ( nt->cur+6>=nt->max ) {
- if ( nt->cur==0 )
- nt->entries = galloc((nt->max=100)*sizeof(NameEntry));
- else
- nt->entries = grealloc(nt->entries,(nt->max+=100)*sizeof(NameEntry));
- }
-
- ne = nt->entries + nt->cur;
-
- ne->platform = 3; /* Windows */
- ne->specific = 1; /* unicode */
- ne->lang = lang;
- ne->strid = strid;
- ne->offset = ftell(nt->strings);
- ne->len = 2*utf82u_strlen(utf8name);
- dumpustr(nt->strings,utf8name);
- ++ne;
-
- if ( nt->format==ff_ttfsym ) {
- *ne = ne[-1];
- ne->specific = 0; /* Windows "symbol" */
- ++ne;
- }
-
- maclang = WinLangToMac(lang);
- if ( !nt->applemode && lang!=0x409 )
- maclang = 0xffff;
- if ( maclang!=0xffff ) {
-#ifdef FONTFORGE_CONFIG_APPLE_UNICODE_NAMES
- if ( strid!=ttf_postscriptname ) {
- *ne = ne[-1];
- ne->platform = 0; /* Mac unicode */
- ne->specific = 0; /* 3 => Unicode 2.0 semantics */ /* 0 ("default") is also a reasonable value */
- ne->lang = maclang;
- ++ne;
- }
-#endif
-
- macenc = MacEncFromMacLang(maclang);
- macname = Utf8ToMacStr(utf8name,macenc,maclang);
- if ( macname!=NULL ) {
- ne->platform = 1; /* apple non-unicode encoding */
- ne->specific = macenc; /* whatever */
- ne->lang = maclang;
- ne->strid = strid;
- ne->offset = ftell(nt->strings);
- ne->len = strlen(macname);
- dumpstr(nt->strings,macname);
- ++ne;
- free(macname);
- }
- }
-
- specific = nt->encoding_name->is_korean ? 5 : /* Wansung, korean */
- nt->encoding_name->is_japanese ? 2 : /* SJIS */
- nt->encoding_name->is_simplechinese ? 3 :/* packed gb2312, don't know the real name */
- strmatch(nt->encoding_name->enc_name,"EUC-GB12345")==0 ? 3 :/* Lie */
- nt->encoding_name->is_tradchinese ? 4 : /* Big5, traditional Chinese */
- -1;
- if ( specific != -1 ) {
- ne->platform = 3; /* windows */
- ne->specific = specific; /* whatever */
- ne->lang = lang;
- ne->strid = strid;
- if ( macname!=NULL &&
- (( specific== 2 && macenc==1 ) || /* Japanese */
- ( specific== 3 && macenc==25 ) || /* simplified chinese */
- ( specific== 4 && macenc==2 ) || /* traditional chinese */
- ( specific== 5 && macenc==3 )) ) { /* wansung korean */
- ne->offset = ne[-1].offset;
- ne->len = ne[-1].len;
- } else {
- char *space, *encname, *out;
- ICONV_CONST char *in;
- Encoding *enc;
- size_t inlen, outlen;
- ne->offset = ftell(nt->strings);
- encname = nt->encoding_name->is_japanese ? "SJIS" :
- strmatch(nt->encoding_name->enc_name,"JOHAB")==0 ? "JOHAB" :
- nt->encoding_name->is_korean ? "EUC-KR" :
- nt->encoding_name->is_simplechinese ? "EUC-CN" :
- nt->encoding_name->enc_name;
- enc = FindOrMakeEncoding(encname);
- if ( enc==NULL )
- --ne;
- else {
- unichar_t *uin = utf82u_copy(utf8name);
- outlen = 3*strlen(utf8name)+10;
- out = space = galloc(outlen+2);
- in = (char *) uin; inlen = 2*u_strlen(uin);
- iconv(enc->fromunicode,NULL,NULL,NULL,NULL); /* should not be needed, but just in case */
- iconv(enc->fromunicode,&in,&inlen,&out,&outlen);
- out[0] = '\0'; out[1] = '\0';
- ne->offset = ftell(nt->strings);
- ne->len = strlen(space);
- dumpstr(nt->strings,space);
- free(space); free(uin);
- }
- }
- ++ne;
- }
- nt->cur = ne - nt->entries;
-}
-
-static void AddMacName(NamTab *nt,struct macname *mn, int strid) {
- NameEntry *ne;
-
- if ( nt->cur+1>=nt->max ) {
- if ( nt->cur==0 )
- nt->entries = galloc((nt->max=100)*sizeof(NameEntry));
- else
- nt->entries = grealloc(nt->entries,(nt->max+=100)*sizeof(NameEntry));
- }
-
- ne = nt->entries + nt->cur;
-
- ne->platform = 1; /* apple non-unicode encoding */
- ne->specific = mn->enc; /* whatever */
- ne->lang = mn->lang;
- ne->strid = strid;
- ne->offset = ftell(nt->strings);
- ne->len = strlen(mn->name);
- dumpstr(nt->strings,mn->name);
-
- ++nt->cur;
-}
-
-/* There's an inconsistancy here. Apple's docs say there most be only one */
-/* nameid==6 and that name must be ascii (presumably plat=1, spec=0, lang=0) */
-/* The opentype docs say there must be two (psl=1,0,0 & psl=3,1,0x409) any */
-/* others are to be ignored */
-/* A representative from Apple says they will change their spec to accept */
-/* the opentype version, and tells me that they don't currently care */
-/* So ignore this */
-/* Undocumented fact: Windows insists on having a UniqueID string 3,1 */
-static void dumpnames(struct alltabs *at, SplineFont *sf,enum fontformat format) {
- int i,j;
- struct ttflangname dummy, *cur, *useng = NULL;
- struct macname *mn;
- struct other_names *on, *onn;
- NamTab nt;
- struct otfname *otfn;
-
- memset(&nt,0,sizeof(nt));
- nt.encoding_name = at->map->enc;
- nt.format = format;
- nt.applemode = at->applemode;
- nt.strings = tmpfile();
-
- memset(&dummy,0,sizeof(dummy));
- for ( cur=sf->names; cur!=NULL; cur=cur->next ) {
- if ( cur->lang==0x409 ) {
- dummy = *cur;
- useng = cur;
- break;
- }
- }
- DefaultTTFEnglishNames(&dummy, sf);
-
- for ( i=0; i<ttf_namemax; ++i ) if ( dummy.names[i]!=NULL )
- AddEncodedName(&nt,dummy.names[i],0x409,i);
- for ( cur=sf->names; cur!=NULL; cur=cur->next ) {
- if ( cur->lang!=0x409 )
- for ( i=0; i<ttf_namemax; ++i )
- if ( cur->names[i]!=NULL )
- AddEncodedName(&nt,cur->names[i],cur->lang,i);
- }
-
- /* The examples I've seen of the feature table only contain platform==mac */
- /* so I'm not including apple unicode */
- if ( at->feat_name!=NULL ) {
- for ( i=0; at->feat_name[i].strid!=0; ++i ) {
- for ( mn=at->feat_name[i].mn; mn!=NULL; mn=mn->next )
- AddMacName(&nt,mn,at->feat_name[i].strid);
-#if 0 /* I'm not sure why I keep track of these alternates */
- /* Dumping them out like this is a bad idea. It might be worth */
- /* something if we searched through the alternate sets for languages */
- /* not found in the main set, but at the moment I don't think so */
- /* What happens now is that I get duplicate names output */
- for ( mn=at->feat_name[i].smn; mn!=NULL; mn=mn->next )
- AddMacName(&nt,mn,at->feat_name[i].strid);
-#endif
- }
- }
- /* And the names used by the fvar table aren't mac unicode either */
- for ( on = at->other_names; on!=NULL; on=onn ) {
- for ( mn = on->mn; mn!=NULL ; mn = mn->next )
- AddMacName(&nt,mn,on->strid);
- onn = on->next;
- chunkfree(on,sizeof(*on));
- }
- /* Wow, the GPOS 'size' feature uses the name table in a very mac-like way*/
- if ( at->fontstyle_name_strid!=0 && sf->fontstyle_name!=NULL ) {
- for ( otfn = sf->fontstyle_name; otfn!=NULL; otfn = otfn->next )
- AddEncodedName(&nt,otfn->name,otfn->lang,at->fontstyle_name_strid);
- }
-
- qsort(nt.entries,nt.cur,sizeof(NameEntry),compare_entry);
-
- at->name = tmpfile();
- putshort(at->name,0); /* format */
- putshort(at->name,nt.cur); /* numrec */
- putshort(at->name,(3+nt.cur*6)*sizeof(int16)); /* offset to strings */
-
- for ( i=0; i<nt.cur; ++i ) {
- putshort(at->name,nt.entries[i].platform);
- putshort(at->name,nt.entries[i].specific);
- putshort(at->name,nt.entries[i].lang);
- putshort(at->name,nt.entries[i].strid);
- putshort(at->name,nt.entries[i].len);
- putshort(at->name,nt.entries[i].offset);
- }
- if ( !ttfcopyfile(at->name,nt.strings,(3+nt.cur*6)*sizeof(int16),"name-data"))
- at->error = true;
-
- at->namelen = ftell(at->name);
- if ( (at->namelen&3)!=0 )
- for ( j= 4-(at->namelen&3); j>0; --j )
- putc('\0',at->name);
-
- for ( i=0; i<ttf_namemax; ++i )
- if ( useng==NULL || dummy.names[i]!=useng->names[i] )
- free( dummy.names[i]);
- free( nt.entries );
- free( at->feat_name );
-}
-
-static void dumppost(struct alltabs *at, SplineFont *sf, enum fontformat format) {
- int pos, i,j, shouldbe;
- int shorttable = (format==ff_otf || format==ff_otfcid ||
- (at->gi.flags&ttf_flag_shortps));
- uint32 here;
-
- at->post = tmpfile();
-
- putlong(at->post,shorttable?0x00030000:0x00020000); /* formattype */
- putfixed(at->post,sf->italicangle);
- putshort(at->post,sf->upos);
- putshort(at->post,sf->uwidth);
- putlong(at->post,at->isfixed);
- putlong(at->post,0); /* no idea about memory */
- putlong(at->post,0); /* no idea about memory */
- putlong(at->post,0); /* no idea about memory */
- putlong(at->post,0); /* no idea about memory */
- if ( !shorttable ) {
- here = ftell(at->post);
- putshort(at->post,at->maxp.numGlyphs);
-
- shouldbe = 0;
- for ( i=0, pos=0; i<at->gi.gcnt; ++i ) {
- if ( at->gi.bygid[i]!=-1 && sf->glyphs[at->gi.bygid[i]]!=NULL ) {
- SplineChar *sc = sf->glyphs[at->gi.bygid[i]];
- while ( i>shouldbe ) {
- if ( shouldbe==0 )
- putshort(at->post,0); /* glyph 0 is named .notdef */
- else if ( shouldbe==1 )
- putshort(at->post,1); /* glyphs 1&2 are .null and cr */
- else if ( shouldbe==2 )
- putshort(at->post,2); /* or something */
- else
- putshort(at->post,0);
- ++shouldbe;
- }
- if ( strcmp(sc->name,".notdef")==0 )
- putshort(at->post,0);
- else {
- for ( j=0; j<258; ++j )
- if ( strcmp(sc->name,ttfstandardnames[j])==0 )
- break;
- if ( j!=258 )
- putshort(at->post,j);
- else {
- putshort(at->post,pos+258);
- ++pos;
- }
- }
- ++shouldbe;
- }
- }
-
- if ( shouldbe!=at->maxp.numGlyphs ) {
- fseek(at->post,here,SEEK_SET);
- putshort(at->post,shouldbe);
- fseek(at->post,0,SEEK_END);
- }
- if ( pos!=0 ) {
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- SplineChar *sc = sf->glyphs[at->gi.bygid[i]];
- if ( strcmp(sc->name,".notdef")==0 )
- /* Do Nothing */;
- else {
- for ( j=0; j<258; ++j )
- if ( strcmp(sc->name,ttfstandardnames[j])==0 )
- break;
- if ( j!=258 )
- /* Do Nothing */;
- else
- dumppstr(at->post,sc->name);
- }
- }
- }
- }
- at->postlen = ftell(at->post);
- if ( (at->postlen&3)!=0 )
- for ( j= 4-(at->postlen&3); j>0; --j )
- putc('\0',at->post);
-}
-
-static FILE *_Gen816Enc(SplineFont *sf,int *tlen,EncMap *map) {
- int i, j, complained, pos, k, subheadindex, jj, isbig5=false;
- uint16 table[256];
- struct subhead subheads[128];
- uint16 *glyphs;
- uint16 tempglyphs[256];
- int base, lbase, basebound, subheadcnt, planesize, plane0size;
- int base2, base2bound;
- FILE *sub;
- char *encname = map->enc->iconv_name!=NULL ? map->enc->iconv_name : map->enc->enc_name;
-
- *tlen = 0;
-
- base2 = -1; base2bound = -2;
- if ( map->enc->is_tradchinese && strstrmatch(encname,"hkscs")!=NULL ) {
- base = 0x81;
- basebound = 0xfe;
- subheadcnt = basebound-base+1;
- lbase = 0x40;
- planesize = 191;
- } else if ( map->enc->is_tradchinese || sf->uni_interp==ui_trad_chinese) {
- base = 0xa1;
- basebound = 0xf9; /* wcl-02.ttf's cmap claims to go up to fc, but everything after f9 is invalid (according to what I know of big5, f9 should be the end) */
- subheadcnt = basebound-base+1;
- lbase = 0x40;
- planesize = 191;
- isbig5 = true;
- } else if ( strstrmatch(encname,"euc")!=NULL ) {
- base = 0xa1;
- basebound = 0xfd;
- lbase = 0xa1;
- subheadcnt = basebound-base+1;
- planesize = 0xfe - lbase +1;
- } else if ( strstrmatch(encname,"johab")!=NULL ) {
- base = 0x84;
- basebound = 0xf9;
- lbase = 0x31;
- subheadcnt = basebound-base+1;
- planesize = 0xfe -0x31+1; /* Stupid gcc bug, thinks 0xfe- is ambiguous (exponant) */
- } else if ( strstrmatch(encname,"sjis")!=NULL || strstrmatch(encname,"cp932")!=NULL ) {
- base = 129;
- basebound = 159;
- lbase = 64;
- planesize = 252 - lbase +1;
- base2 = 0xe0;
- /* SJIS supports "user defined characters" between 0xf040 and 0xfcfc */
- /* there probably won't be any, but allow space for them if there are*/
- for ( base2bound=0xfc00; base2bound>0xefff; --base2bound )
- if ( base2bound<map->enccount && map->map[base2bound]!=-1 &&
- SCWorthOutputting(sf->glyphs[map->map[base2bound]]))
- break;
- base2bound >>= 8;
- subheadcnt = basebound-base + 1 + base2bound-base2 + 1;
- } else {
- IError( "Unsupported 8/16 encoding %s\n", map->enc->enc_name );
-return( NULL );
- }
- plane0size = base2==-1? base : base2;
- i=0;
- if ( base2!=-1 ) {
- for ( i=basebound; i<base2 && i<map->enccount; ++i )
- if ( map->map[i]==-1 )
- continue;
- else if ( SCWorthOutputting(sf->glyphs[map->map[i]]))
- break;
- if ( i==base2 || i==map->enccount )
- i = 0;
- }
- if ( i==0 ) {
- for ( i=0; i<base && i<map->enccount; ++i )
- if ( map->map[i]==-1 )
- continue;
- else if ( SCWorthOutputting(sf->glyphs[map->map[i]]))
- break;
- }
-#if 0
- if ( i==base || i==sf->glyphcnt )
-return( NULL ); /* Doesn't have the single byte entries */
- /* Can use the normal 16 bit encoding scheme */
- /* Always do an 8/16, and we'll do a unicode table too now... */
-#endif
-
- if ( base2!=-1 ) {
- for ( i=base; i<=basebound && i<map->enccount; ++i )
- if ( map->map[i]!=-1 && SCWorthOutputting(sf->glyphs[map->map[i]])) {
- gwwv_post_error(_("Bad Encoding"),_("There is a single byte character (%d) using one of the slots needed for double byte characters"),i);
- break;
- }
- if ( i==basebound+1 )
- for ( i=base2; i<256 && i<map->enccount; ++i )
- if ( map->map[i]!=-1 && SCWorthOutputting(sf->glyphs[map->map[i]])) {
- gwwv_post_error(_("Bad Encoding"),_("There is a single byte character (%d) using one of the slots needed for double byte characters"),i);
- break;
- }
- } else {
- for ( i=base; i<=256 && i<map->enccount; ++i )
- if ( map->map[i]!=-1 && SCWorthOutputting(sf->glyphs[map->map[i]])) {
- gwwv_post_error(_("Bad Encoding"),_("There is a single byte character (%d) using one of the slots needed for double byte characters"),i);
- break;
- }
- }
- for ( i=256; i<(base<<8) && i<map->enccount; ++i )
- if ( map->map[i]!=-1 && SCWorthOutputting(sf->glyphs[map->map[i]])) {
- gwwv_post_error(_("Bad Encoding"),_("There is a character (%d) which cannot be encoded"),i);
- break;
- }
- if ( i==(base<<8) && base2==-1 )
- for ( i=((basebound+1)<<8); i<0x10000 && i<map->enccount; ++i )
- if ( map->map[i]!=-1 && SCWorthOutputting(sf->glyphs[map->map[i]])) {
- gwwv_post_error(_("Bad Encoding"),_("There is a character (%d) which cannot be encoded"),i);
- break;
- }
-
- memset(table,'\0',sizeof(table));
- for ( i=base; i<=basebound; ++i )
- table[i] = 8*(i-base+1);
- for ( i=base2; i<=base2bound; ++i )
- table[i] = 8*(i-base2+basebound-base+1+1);
- memset(subheads,'\0',sizeof(subheads));
- subheads[0].first = 0; subheads[0].cnt = plane0size;
- for ( i=1; i<subheadcnt+1; ++i ) {
- subheads[i].first = lbase;
- subheads[i].cnt = planesize;
- }
- glyphs = gcalloc(subheadcnt*planesize+plane0size,sizeof(uint16));
- subheads[0].rangeoff = 0;
- for ( i=0; i<plane0size && i<map->enccount; ++i )
- if ( map->map[i]!=-1 && sf->glyphs[map->map[i]]!=NULL &&
- sf->glyphs[map->map[i]]->ttf_glyph!=-1 )
- glyphs[i] = sf->glyphs[map->map[i]]->ttf_glyph;
-
- pos = 1;
-
- complained = false;
- subheadindex = 1;
- for ( jj=0; jj<2 || (base2==-1 && jj<1); ++jj )
- for ( j=((jj==0?base:base2)<<8); j<=((jj==0?basebound:base2bound)<<8); j+= 0x100 ) {
- for ( i=0; i<lbase; ++i )
- if ( !complained && map->map[i+j]!=-1 &&
- SCWorthOutputting(sf->glyphs[map->map[i+j]])) {
- gwwv_post_error(_("Bad Encoding"),_("There is a character (%d) which is not normally in the encoding"),i+j);
- complained = true;
- }
- if ( isbig5 ) {
- /* big5 has a gap here. Does johab? */
- for ( i=0x7f; i<0xa1; ++i )
- if ( !complained && map->map[i+j]!=-1 &&
- SCWorthOutputting(sf->glyphs[map->map[i+j]])) {
- gwwv_post_error(_("Bad Encoding"),_("There is a character (%d) which is not normally in the encoding"),i+j);
- complained = true;
- }
- }
- memset(tempglyphs,0,sizeof(tempglyphs));
- for ( i=0; i<planesize; ++i )
- if ( map->map[j+lbase+i]!=-1 && sf->glyphs[map->map[j+lbase+i]]!=NULL &&
- sf->glyphs[map->map[j+lbase+i]]->ttf_glyph!=-1 )
- tempglyphs[i] = sf->glyphs[map->map[j+lbase+i]]->ttf_glyph;
- for ( i=1; i<pos; ++i ) {
- int delta = 0;
- for ( k=0; k<planesize; ++k )
- if ( tempglyphs[k]==0 && glyphs[plane0size+(i-1)*planesize+k]==0 )
- /* Still matches */;
- else if ( tempglyphs[k]==0 || glyphs[plane0size+(i-1)*planesize+k]==0 )
- break; /* Doesn't match */
- else if ( delta==0 )
- delta = (uint16) (tempglyphs[k]-glyphs[plane0size+(i-1)*planesize+k]);
- else if ( tempglyphs[k]==(uint16) (glyphs[plane0size+(i-1)*planesize+k]+delta) )
- /* Still matches */;
- else
- break;
- if ( k==planesize ) {
- subheads[subheadindex].delta = delta;
- subheads[subheadindex].rangeoff = plane0size+(i-1)*planesize;
- break;
- }
- }
- if ( subheads[subheadindex].rangeoff==0 ) {
- memcpy(glyphs+(pos-1)*planesize+plane0size,tempglyphs,planesize*sizeof(uint16));
- subheads[subheadindex].rangeoff = plane0size+(pos++-1)*planesize ;
- }
- ++subheadindex;
- }
-
- /* fixup offsets */
- /* my rangeoffsets are indexes into the glyph array. That's nice and */
- /* simple. Unfortunately ttf says they are offsets from the current */
- /* location in the file (sort of) so we now fix them up. */
- for ( i=0; i<subheadcnt+1; ++i )
- subheads[i].rangeoff = subheads[i].rangeoff*sizeof(uint16) +
- (subheadcnt-i)*sizeof(struct subhead) + sizeof(uint16);
-
- sub = tmpfile();
- if ( sub==NULL )
-return( NULL );
-
- putshort(sub,2); /* 8/16 format */
- putshort(sub,0); /* Subtable length, we'll come back and fix this */
- putshort(sub,0); /* version/language, not meaningful in ms systems */
- for ( i=0; i<256; ++i )
- putshort(sub,table[i]);
- for ( i=0; i<subheadcnt+1; ++i ) {
- putshort(sub,subheads[i].first);
- putshort(sub,subheads[i].cnt);
- putshort(sub,subheads[i].delta);
- putshort(sub,subheads[i].rangeoff);
- }
- for ( i=0; i<(pos-1)*planesize+plane0size; ++i )
- putshort(sub,glyphs[i]);
- free(glyphs);
-
- *tlen = ftell(sub);
- fseek(sub,2,SEEK_SET);
- putshort(sub,*tlen); /* Length, I said we'd come back to it */
- rewind( sub );
-return( sub );
-}
-
-static FILE *Needs816Enc(SplineFont *sf,int *tlen,EncMap *map, FILE **apple, int *appletlen) {
- FILE *sub;
- char *encname = map->enc->iconv_name!=NULL ? map->enc->iconv_name : map->enc->enc_name;
- EncMap *oldmap = map;
- EncMap *applemap = NULL;
- Encoding *enc;
-
- *tlen = 0;
- if ( apple!=NULL ) {
- *apple = NULL;
- *appletlen = 0;
- }
- if ( sf->cidmaster!=NULL || sf->subfontcnt!=0 )
-return( NULL );
- if ( (strstrmatch(encname,"big")!=NULL && strchr(encname,'5')!=NULL) ||
- strstrmatch(encname,"johab")!=NULL ||
- strstrmatch(encname,"sjis")!=NULL ||
- strstrmatch(encname,"cp932")!=NULL ||
- strstrmatch(encname,"euc-kr")!=NULL ||
- strstrmatch(encname,"euc-cn")!=NULL )
- /* Already properly encoded */;
- else if ( strstrmatch(encname,"2022")!=NULL &&
- (strstrmatch(encname,"JP2")!=NULL ||
- strstrmatch(encname,"JP-2")!=NULL ||
- strstrmatch(encname,"JP-3")!=NULL ))
-return( NULL ); /* No 8/16 encoding for JP2 nor JP3 */
- else if ( sf->uni_interp>=ui_japanese && sf->uni_interp<=ui_korean ) {
- enc = FindOrMakeEncoding(
- sf->uni_interp==ui_japanese ? "sjis" :
- sf->uni_interp==ui_trad_chinese ? "big5" :
- sf->uni_interp==ui_simp_chinese ? "euc-cn" :
- "euc-kr");
- if ( map->enc!=enc ) {
- map = EncMapFromEncoding(sf,enc);
- encname = map->enc->iconv_name!=NULL ? map->enc->iconv_name : map->enc->enc_name;
- }
- } else
-return( NULL );
-
- /* Both MS and Apple extend sjis. I don't know how to get iconv to give me*/
- /* apple's encoding though. So I generate one 8/16 table for MS based on */
- /* their extension (cp932), and another table based on plain sjis for Apple*/
- /* Don't know if this is true of other cjk encodings... for the moment I */
- /* will just use standard encodings for them */
- if ( strstrmatch(encname,"sjis")!=NULL ) {
- enc = FindOrMakeEncoding("cp932");
- if ( enc!=NULL ) {
- applemap = map;
- map = EncMapFromEncoding(sf,enc);
- }
- } else if ( strstrmatch(encname,"cp932")!=NULL )
- applemap = EncMapFromEncoding(sf,FindOrMakeEncoding("sjis"));
-
- if ( applemap!=NULL )
- *apple = _Gen816Enc(sf,appletlen,applemap);
- sub = _Gen816Enc(sf,tlen,map);
-
- if ( applemap!=NULL && applemap!=oldmap )
- EncMapFree(applemap);
- if ( map!=oldmap )
- EncMapFree(map);
-return( sub );
-}
-
-static FILE *NeedsUCS4Table(SplineFont *sf,int *ucs4len,EncMap *map) {
- int i=0,j,group;
- FILE *format12;
- SplineChar *sc;
- EncMap *freeme = NULL;
- struct altuni *altuni;
-
- if ( map->enc->is_unicodefull )
- i=0x10000;
- else if ( map->enc->is_custom )
- i = 0;
- else
- i = map->enc->char_cnt;
- for ( ; i<map->enccount; ++i ) {
- if ( map->map[i]!=-1 && SCWorthOutputting(sf->glyphs[map->map[i]]) ) {
- if ( sf->glyphs[map->map[i]]->unicodeenc>=0x10000 )
- break;
- for ( altuni=sf->glyphs[map->map[i]]->altuni; altuni!=NULL && altuni->unienc<0x10000;
- altuni=altuni->next );
- if ( altuni!=NULL )
- break;
- }
- }
-
- if ( i>=map->enccount )
-return(NULL);
-
- if ( !map->enc->is_unicodefull )
- map = freeme = EncMapFromEncoding(sf,FindOrMakeEncoding("ucs4"));
-
- format12 = tmpfile();
- if ( format12==NULL )
-return( NULL );
-
- putshort(format12,12); /* Subtable format */
- putshort(format12,0); /* padding */
- putlong(format12,0); /* Length, we'll come back to this */
- putlong(format12,0); /* language */
- putlong(format12,0); /* Number of groups, we'll come back to this */
-
- group = 0;
- for ( i=0; i<map->enccount; ++i ) if ( map->map[i]!=-1 && SCWorthOutputting(sf->glyphs[map->map[i]]) && sf->glyphs[map->map[i]]->unicodeenc!=-1 ) {
- sc = sf->glyphs[map->map[i]];
- for ( j=i+1; j<map->enccount && map->map[j]!=-1 &&
- SCWorthOutputting(sf->glyphs[map->map[j]]) &&
- sf->glyphs[map->map[j]]->unicodeenc!=-1 &&
- sf->glyphs[map->map[j]]->ttf_glyph==sc->ttf_glyph+j-i; ++j );
- --j;
- putlong(format12,i); /* start char code */
- putlong(format12,j); /* end char code */
- putlong(format12,sc->ttf_glyph);
- ++group;
- i=j; /* move to the start of the next group */
- }
- *ucs4len = ftell(format12);
- fseek(format12,4,SEEK_SET);
- putlong(format12,*ucs4len); /* Length, I said we'd come back to it */
- putlong(format12,0); /* language */
- putlong(format12,group); /* Number of groups */
- rewind( format12 );
-
- if ( freeme!=NULL )
- EncMapFree(freeme);
-return( format12 );
-}
-
-static FILE *NeedsUCS2Table(SplineFont *sf,int *ucs2len,EncMap *map) {
- /* We always want a format 4 2byte unicode encoding map */
- uint32 *avail = galloc(65536*sizeof(uint32));
- int i,j,l;
- int segcnt, cnt=0, delta, rpos;
- struct cmapseg { uint16 start, end; uint16 delta; uint16 rangeoff; } *cmapseg;
- uint16 *ranges;
- SplineChar *sc;
- FILE *format4 = tmpfile();
-
- memset(avail,0xff,65536*sizeof(uint32));
- if ( map->enc->is_unicodebmp || map->enc->is_unicodefull ) { int gid;
- for ( i=0; i<65536 && i<map->enccount; ++i ) if ( (gid=map->map[i])!=-1 && sf->glyphs[gid]!=NULL && sf->glyphs[gid]->ttf_glyph!=-1 ) {
- avail[i] = gid;
- ++cnt;
- }
- } else {
- struct altuni *altuni;
- for ( i=0; i<sf->glyphcnt; ++i ) {
- if ( (sc=sf->glyphs[i])!=NULL && sc->ttf_glyph!=-1 ) {
- if ( sc->unicodeenc>=0 && sc->unicodeenc<=0xffff ) {
- avail[sc->unicodeenc] = i;
- ++cnt;
- }
- for ( altuni=sc->altuni; altuni!=NULL; altuni = altuni->next ) {
- if ( altuni->unienc>=0 && altuni->unienc<=0xffff ) {
- avail[altuni->unienc] = i;
- ++cnt;
- }
- }
- }
- }
- }
-
- j = -1;
- for ( i=segcnt=0; i<65536; ++i ) {
- if ( avail[i]!=0xffffffff && j==-1 ) {
- j=i;
- ++segcnt;
- } else if ( j!=-1 && avail[i]==0xffffffff )
- j = -1;
- }
- cmapseg = gcalloc(segcnt+1,sizeof(struct cmapseg));
- ranges = galloc(cnt*sizeof(int16));
- j = -1;
- for ( i=segcnt=0; i<65536; ++i ) {
- if ( avail[i]!=0xffffffff && j==-1 ) {
- j=i;
- cmapseg[segcnt].start = j;
- ++segcnt;
- } else if ( j!=-1 && avail[i]==0xffffffff ) {
- cmapseg[segcnt-1].end = i-1;
- j = -1;
- }
- }
- if ( j!=-1 )
- cmapseg[segcnt-1].end = i-1;
- /* create a dummy segment to mark the end of the table */
- cmapseg[segcnt].start = cmapseg[segcnt].end = 0xffff;
- cmapseg[segcnt++].delta = 1;
- rpos = 0;
- for ( i=0; i<segcnt-1; ++i ) {
- l = avail[cmapseg[i].start];
- sc = sf->glyphs[l];
- delta = sc->ttf_glyph-cmapseg[i].start;
- for ( j=cmapseg[i].start; j<=cmapseg[i].end; ++j ) {
- l = avail[j];
- sc = sf->glyphs[l];
- if ( delta != sc->ttf_glyph-j )
- break;
- }
- if ( j>cmapseg[i].end )
- cmapseg[i].delta = delta;
- else {
- cmapseg[i].rangeoff = (rpos + (segcnt-i)) * sizeof(int16);
- for ( j=cmapseg[i].start; j<=cmapseg[i].end; ++j ) {
- l = avail[j];
- sc = sf->glyphs[l];
- ranges[rpos++] = sc->ttf_glyph;
- }
- }
- }
- free(avail);
-
-
- putshort(format4,4); /* format */
- putshort(format4,(8+4*segcnt+rpos)*sizeof(int16));
- putshort(format4,0); /* language/version */
- putshort(format4,2*segcnt); /* segcnt */
- for ( j=0,i=1; i<=segcnt; i<<=1, ++j );
- putshort(format4,i); /* 2*2^floor(log2(segcnt)) */
- putshort(format4,j-1);
- putshort(format4,2*segcnt-i);
- for ( i=0; i<segcnt; ++i )
- putshort(format4,cmapseg[i].end);
- putshort(format4,0);
- for ( i=0; i<segcnt; ++i )
- putshort(format4,cmapseg[i].start);
- for ( i=0; i<segcnt; ++i )
- putshort(format4,cmapseg[i].delta);
- for ( i=0; i<segcnt; ++i )
- putshort(format4,cmapseg[i].rangeoff);
- for ( i=0; i<rpos; ++i )
- putshort(format4,ranges[i]);
- free(ranges);
- free(cmapseg);
- *ucs2len = ftell(format4);
-return( format4 );
-}
-
-static void dumpcmap(struct alltabs *at, SplineFont *sf,enum fontformat format) {
- int i,enccnt, issmall, hasmac;
- uint16 table[256];
- SplineChar *sc;
- int alreadyprivate = false;
- int anyglyphs = 0;
- int wasotf = format==ff_otf || format==ff_otfcid;
- EncMap *map = at->map;
- int ucs4len=0, ucs2len=0, cjklen=0, applecjklen=0;
- FILE *format12, *format4, *format2, *apple2;
- int mspos, ucs4pos, cjkpos, applecjkpos;
-
- for ( i=at->gi.gcnt-1; i>0 ; --i ) if ( at->gi.bygid[i]!=-1 ) {
- if ( SCWorthOutputting(sf->glyphs[at->gi.bygid[i]])) {
- anyglyphs = true;
- if ( sf->glyphs[at->gi.bygid[i]]->unicodeenc!=-1 )
- break;
- }
- }
- if ( sf->subfontcnt==0 && !anyglyphs ) {
- gwwv_post_error(_("No Encoded Glyphs"),_("Warning: Font contained no glyphs"));
- }
- if ( sf->subfontcnt==0 && format!=ff_ttfsym) {
- if ( i==0 && anyglyphs ) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( map->enccount<=256 ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes"); buts[1] = _("_No"); buts[2] = NULL;
-#else
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_NO, NULL };
-#endif
- if ( gwwv_ask(_("No Encoded Glyphs"),(const char **) buts,0,1,_("This font contains no glyphs with unicode encodings.\nWould you like to use a \"Symbol\" encoding instead of Unicode?"))==0 )
- format = ff_ttfsym;
- } else
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- gwwv_post_error(_("No Encoded Glyphs"),_("This font contains no glyphs with unicode encodings.\nYou will probably not be able to use the output."));
- }
- }
-
- at->cmap = tmpfile();
-
- /* MacRoman encoding table */ /* Not going to bother with making this work for cid fonts */
- /* I now see that Apple doesn't restrict us to format 0 sub-tables (as */
- /* the docs imply) but instead also uses format 6 tables. Wildly in- */
- /* appropriate as they are for 2byte encodings, but Apple uses them */
- /* for one byte ones too */
- memset(table,'\0',sizeof(table));
- if ( !wasotf ) {
- table[29] = table[8] = table[0] = 1;
- table[9] = table[13] = 2;
- }
- for ( i=0; i<256 ; ++i ) {
- extern unichar_t MacRomanEnc[];
- /* sc = SFFindExistingCharMac(sf,map,MacRomanEnc[i]); */
- sc = SFGetChar(sf,MacRomanEnc[i],NULL);
- if ( sc!=NULL && sc->ttf_glyph!=-1 )
- table[i] = sc->ttf_glyph;
- }
- if ( table[0]==0 ) table[0] = 1;
-
- if ( format==ff_ttfsym ) {
- int acnt=0, pcnt=0;
- for ( i=0; i<map->enccount && i<0xffff; ++i ) {
- if ( map->map[i]!=-1 && sf->glyphs[map->map[i]]!=NULL &&
- sf->glyphs[map->map[i]]->ttf_glyph!=-1 ) {
- if ( i>=0xf000 && i<=0xf0ff )
- ++acnt;
- else if ( i>=0x20 && i<=0xff )
- ++pcnt;
- }
- }
- alreadyprivate = acnt>pcnt;
- memset(table,'\0',sizeof(table));
- if ( !wasotf ) {
- table[29] = table[8] = table[0] = 1;
- table[9] = table[13] = 2;
- }
- if ( !alreadyprivate ) {
- for ( i=0; i<map->enccount && i<256; ++i ) {
- if ( map->map[i]!=-1 && (sc = sf->glyphs[map->map[i]])!=NULL &&
- sc->ttf_glyph!=-1 )
- table[i] = sc->ttf_glyph;
- }
- } else {
- for ( i=0xf000; i<=0xf0ff && i<sf->glyphcnt; ++i ) {
- if ( map->map[i]!=-1 && (sc = sf->glyphs[map->map[i]])!=NULL &&
- sc->ttf_glyph!=-1 )
- table[i-0xf000] = sc->ttf_glyph;
- }
- }
- /* if the user has read in a ttf symbol file then it will already have */
- /* the right private use encoding, and we don't want to mess it up. */
- /* The alreadyprivate flag should detect this case */
- if ( !alreadyprivate ) {
- for ( i=0; i<map->enccount && i<256; ++i ) {
- if ( map->map[i]!=-1 && (sc = sf->glyphs[map->map[i]])!=NULL ) {
- sc->orig_pos = sc->unicodeenc;
- sc->unicodeenc = 0xf000 + i;
- }
- }
- for ( ; i<map->enccount; ++i ) {
- if ( map->map[i]!=-1 && (sc = sf->glyphs[map->map[i]])!=NULL ) {
- sc->orig_pos = sc->unicodeenc;
- sc->unicodeenc = -1;
- }
- }
- }
- }
-
- format4 = NeedsUCS2Table(sf,&ucs2len,map);
- format12 = NeedsUCS4Table(sf,&ucs4len,map);
- format2 = Needs816Enc(sf,&cjklen,map,&apple2,&applecjklen);
-
- /* Two/Three/Four encoding table pointers, one for ms, one for mac */
- /* usually one for mac big, just a copy of ms */
- /* plus we may have a format12 encoding for ucs4, mac doesn't support */
- /* plus we may have a format2 encoding for cjk, sometimes I know the codes for the mac... */
- /* sometimes the mac will have a slightly different cjk table */
- if ( format==ff_ttfsym ) {
- enccnt = 2;
- hasmac = 0;
- } else {
- hasmac = 1;
- enccnt = 3;
- if ( format12!=NULL )
- enccnt = 5;
- if ( format2!=NULL ) {
- if ( strstrmatch(map->enc->enc_name,"johab")!=NULL ) {
- ++enccnt;
- } else {
- enccnt+=2;
- hasmac=3;
- }
- }
- }
-
- putshort(at->cmap,0); /* version */
- putshort(at->cmap,enccnt); /* num tables */
-
- mspos = 2*sizeof(uint16)+enccnt*(2*sizeof(uint16)+sizeof(uint32));
- ucs4pos = mspos+ucs2len;
- cjkpos = ucs4pos+ucs4len;
- if ( apple2==NULL ) {
- applecjkpos = cjkpos;
- applecjklen = cjklen;
- } else
- applecjkpos = cjkpos + cjklen;
- /* applecjklen set above */
- if ( hasmac&1 ) {
- /* big mac table, just a copy of the ms table */
- putshort(at->cmap,0); /* mac unicode platform */
- putshort(at->cmap,3); /* Unicode 2.0 */
- putlong(at->cmap,mspos);
- }
- if ( format12!=NULL ) {
- /* full unicode mac table, just a copy of the ms table */
- putshort(at->cmap,0); /* mac unicode platform */
- putshort(at->cmap,4); /* Unicode 2.0, full unicode */
- putlong(at->cmap,ucs4pos);
- }
- putshort(at->cmap,1); /* mac platform */
- putshort(at->cmap,0); /* plat specific enc, script=roman */
- /* Even the symbol font on the mac claims a mac roman encoding */
- /* although it actually contains a symbol encoding. There is an*/
- /* "RSymbol" language listed for Mac (specific=8) but it isn't used*/
- putlong(at->cmap,applecjkpos+applecjklen); /* offset from tab start to sub tab start */
- if ( format2!=NULL && (hasmac&2) ) {
- /* mac cjk table, often a copy of the ms table */
- putshort(at->cmap,1); /* mac platform */
- putshort(at->cmap,
- map->enc->is_japanese || sf->uni_interp==ui_japanese ? 1 : /* SJIS */
- map->enc->is_korean || sf->uni_interp==ui_korean ? 3 : /* Korean */
- map->enc->is_simplechinese || sf->uni_interp==ui_simp_chinese ? 25 :/* Simplified Chinese */
- 2 ); /* Big5 */
- putlong(at->cmap,applecjkpos);
- }
-
- putshort(at->cmap,3); /* ms platform */
- putshort(at->cmap, /* plat specific enc */
- format==ff_ttfsym ? 0 : /* Symbol */
- 1 ); /* Unicode */
- putlong(at->cmap,mspos); /* offset from tab start to sub tab start */
-
- if ( format2!=NULL ) {
- putshort(at->cmap,3); /* ms platform */
- putshort(at->cmap, /* plat specific enc */
- strstrmatch(map->enc->enc_name,"johab")!=NULL ? 6 :
- map->enc->is_korean || sf->uni_interp==ui_korean ? 5 :
- map->enc->is_japanese || sf->uni_interp==ui_japanese ? 2 :
- map->enc->is_simplechinese || sf->uni_interp==ui_simp_chinese ? 3 :
- 4); /* Big5 */
- putlong(at->cmap,cjkpos); /* offset from tab start to sub tab start */
- }
-
- if ( format12!=NULL ) {
- putshort(at->cmap,3); /* ms platform */
- putshort(at->cmap,10); /* plat specific enc, ucs4 */
- putlong(at->cmap,ucs4pos); /* offset from tab start to sub tab start */
- }
- if ( format4!=NULL ) {
- if ( !ttfcopyfile(at->cmap,format4,mspos,"cmap-Unicode16")) at->error = true;
- }
- if ( format12!=NULL ) {
- if ( !ttfcopyfile(at->cmap,format12,ucs4pos,"cmap-Unicode32")) at->error = true;
- }
- if ( format2!=NULL ) {
- if ( !ttfcopyfile(at->cmap,format2,cjkpos,"cmap-cjk")) at->error = true;
- }
- if ( apple2!=NULL ) {
- if ( !ttfcopyfile(at->cmap,apple2,applecjkpos,"cmap-applecjk")) at->error = true;
- }
-
- /* Mac table */
- issmall = true;
- for ( i=0; i<256; ++i )
- if ( table[i]>=256 ) {
- issmall = false;
- break;
- }
- if ( issmall ) {
- putshort(at->cmap,0); /* format */
- putshort(at->cmap,262); /* length = 256bytes + 6 header bytes */
- putshort(at->cmap,0); /* language = english */
- for ( i=0; i<256; ++i )
- putc(table[i],at->cmap);
- } else {
- putshort(at->cmap,6); /* format 6 */
- putshort(at->cmap,522); /* length = 256short +10 header bytes */
- putshort(at->cmap,0); /* language = english */
- putshort(at->cmap,0); /* first code */
- putshort(at->cmap,256); /* entry count */
- for ( i=0; i<256; ++i )
- putshort(at->cmap,table[i]);
- }
-
- at->cmaplen = ftell(at->cmap);
- if ( (at->cmaplen&2)!=0 )
- putshort(at->cmap,0);
-
- if ( format==ff_ttfsym ) {
- if ( !alreadyprivate ) {
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- sf->glyphs[i]->unicodeenc = sf->glyphs[i]->orig_pos;
- sf->glyphs[i]->orig_pos = i;
- }
- }
- }
-}
-
-static int32 filecheck(FILE *file) {
- uint32 sum = 0, chunk;
-
- rewind(file);
- while ( 1 ) {
- chunk = getuint32(file);
- if ( feof(file))
- break;
- sum += chunk;
- }
-return( sum );
-}
-
-static void AbortTTF(struct alltabs *at, SplineFont *sf) {
- int i;
-
- if ( at->loca!=NULL )
- fclose(at->loca);
- if ( at->name!=NULL )
- fclose(at->name);
- if ( at->post!=NULL )
- fclose(at->post);
- if ( at->gpos!=NULL )
- fclose(at->gpos);
- if ( at->gsub!=NULL )
- fclose(at->gsub);
- if ( at->gdef!=NULL )
- fclose(at->gdef);
- if ( at->kern!=NULL )
- fclose(at->kern);
- if ( at->cmap!=NULL )
- fclose(at->cmap);
- if ( at->headf!=NULL )
- fclose(at->headf);
- if ( at->hheadf!=NULL )
- fclose(at->hheadf);
- if ( at->maxpf!=NULL )
- fclose(at->maxpf);
- if ( at->os2f!=NULL )
- fclose(at->os2f);
- if ( at->cvtf!=NULL )
- fclose(at->cvtf);
- if ( at->vheadf!=NULL )
- fclose(at->vheadf);
- if ( at->vorgf!=NULL )
- fclose(at->vorgf);
- if ( at->cfff!=NULL )
- fclose(at->cfff);
-
- if ( at->gi.glyphs!=NULL )
- fclose(at->gi.glyphs);
- if ( at->gi.hmtx!=NULL )
- fclose(at->gi.hmtx);
- if ( at->gi.vmtx!=NULL )
- fclose(at->gi.vmtx);
- if ( at->fpgmf!=NULL )
- fclose(at->fpgmf);
- if ( at->prepf!=NULL )
- fclose(at->prepf);
- if ( at->gaspf!=NULL )
- fclose(at->gaspf);
-
- if ( at->sidf!=NULL )
- fclose(at->sidf);
- if ( at->sidh!=NULL )
- fclose(at->sidh);
- if ( at->charset!=NULL )
- fclose(at->charset);
- if ( at->encoding!=NULL )
- fclose(at->encoding);
- if ( at->private!=NULL )
- fclose(at->private);
- if ( at->charstrings!=NULL )
- fclose(at->charstrings);
- if ( at->fdselect!=NULL )
- fclose(at->fdselect);
- if ( at->fdarray!=NULL )
- fclose(at->fdarray);
- if ( at->bdat!=NULL )
- fclose(at->bdat);
- if ( at->bloc!=NULL )
- fclose(at->bloc);
- if ( at->ebsc!=NULL )
- fclose(at->ebsc);
-
- if ( at->prop!=NULL )
- fclose(at->prop);
- if ( at->opbd!=NULL )
- fclose(at->opbd);
- if ( at->acnt!=NULL )
- fclose(at->acnt);
- if ( at->lcar!=NULL )
- fclose(at->lcar);
- if ( at->feat!=NULL )
- fclose(at->feat);
- if ( at->morx!=NULL )
- fclose(at->morx);
-
- if ( at->pfed!=NULL )
- fclose(at->pfed);
- if ( at->tex!=NULL )
- fclose(at->tex);
-
- if ( at->gvar!=NULL )
- fclose(at->gvar);
- if ( at->fvar!=NULL )
- fclose(at->fvar);
- if ( at->cvar!=NULL )
- fclose(at->cvar);
- if ( at->avar!=NULL )
- fclose(at->avar);
-
- for ( i=0; i<sf->subfontcnt; ++i ) {
- if ( at->fds[i].private!=NULL )
- fclose(at->fds[i].private);
- }
- if ( sf->subfontcnt!=0 ) {
- free(sf->glyphs);
- sf->glyphs = NULL;
- sf->glyphcnt = sf->glyphmax = 0;
- }
- if ( at->fds!=NULL )
- free( at->fds );
- free( at->gi.bygid );
-}
-
-int SFHasInstructions(SplineFont *sf) {
- int i;
-
- if ( sf->mm!=NULL && sf->mm->apple )
- sf = sf->mm->normal;
-
- if ( sf->subfontcnt!=0 )
-return( false ); /* Truetype doesn't support cid keyed fonts */
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( strcmp(sf->glyphs[i]->name,".notdef")==0 )
- continue; /* ff produces fonts with instructions in .notdef & not elsewhere. Ignore these */
- if ( sf->glyphs[i]->ttf_instrs!=NULL )
-return( true );
- }
-return( false );
-}
-
-static void MaxpFromTable(struct alltabs *at,SplineFont *sf) {
- struct ttf_table *maxp;
-
- maxp = SFFindTable(sf,CHR('m','a','x','p'));
- if ( maxp==NULL && sf->mm!=NULL && sf->mm->apple )
- maxp = SFFindTable(sf->mm->normal,CHR('m','a','x','p'));
- if ( maxp==NULL || maxp->len<13*sizeof(uint16) )
-return;
- /* We can figure out the others ourselves, but these depend on the contents */
- /* of uninterpretted tables */
- at->maxp.maxZones = memushort(maxp->data,maxp->len, 7*sizeof(uint16));
- at->maxp.maxTwilightPts = memushort(maxp->data,maxp->len, 8*sizeof(uint16));
- at->maxp.maxStorage = memushort(maxp->data,maxp->len, 9*sizeof(uint16));
- at->maxp.maxFDEFs = memushort(maxp->data,maxp->len, 10*sizeof(uint16));
- at->maxp.maxIDEFs = memushort(maxp->data,maxp->len, 11*sizeof(uint16));
- at->maxp.maxStack = memushort(maxp->data,maxp->len, 12*sizeof(uint16));
-}
-
-static FILE *dumpstoredtable(SplineFont *sf,uint32 tag,int *len) {
- struct ttf_table *tab = SFFindTable(sf,tag);
- FILE *out;
-
- if ( tab==NULL && sf->mm!=NULL && sf->mm->apple )
- tab = SFFindTable(sf->mm->normal,tag);
- if ( tab==NULL ) {
- *len = 0;
-return( NULL );
- }
-
- out = tmpfile();
- fwrite(tab->data,1,tab->len,out);
- if ( (tab->len&1))
- putc('\0',out);
- if ( (tab->len+1)&2 )
- putshort(out,0);
- *len = tab->len;
-return( out );
-}
-
-static FILE *dumpsavedtable(struct ttf_table *tab) {
- FILE *out;
-
- if ( tab==NULL )
-return( NULL );
-
- out = tmpfile();
- fwrite(tab->data,1,tab->len,out);
- if ( (tab->len&1))
- putc('\0',out);
- if ( (tab->len+1)&2 )
- putshort(out,0);
-return( out );
-}
-
-static int tagcomp(const void *_t1, const void *_t2) {
- struct taboff *t1 = (struct taboff *) _t1, *t2 = (struct taboff *) _t2;
-return( (int) (t1->tag - t2->tag) );
-}
-
-static int tcomp(const void *_t1, const void *_t2) {
- struct taboff *t1 = *((struct taboff **) _t1), *t2 = *((struct taboff **) _t2);
-return( t1->orderingval - t2->orderingval );
-}
-
-static int tcomp2(const void *_t1, const void *_t2) {
- struct taboff *t1 = *((struct taboff **) _t1), *t2 = *((struct taboff **) _t2);
- if ( t1->offset>t2->offset )
-return( 1 );
- else if ( t1->offset < t2->offset )
-return( -1 );
-return( 0 );
-}
-
-static int initTables(struct alltabs *at, SplineFont *sf,enum fontformat format,
- int32 *bsizes, enum bitmapformat bf,int flags) {
- int i, j, aborted, ebdtpos=0, eblcpos=0, offset;
- BDFFont *bdf;
- struct ttf_table *tab;
-
- if ( strmatch(at->map->enc->enc_name,"symbol")==0 && format==ff_ttf )
- format = ff_ttfsym;
-
- SFDefaultOS2Info(&sf->pfminfo,sf,sf->fontname);
-
- at->gi.xmin = at->gi.ymin = 15000;
- at->gi.sf = sf;
- if ( bf!=bf_ttf && bf!=bf_sfnt_dfont && bf!=bf_otb && bf!=bf_sfnt_ms )
- bsizes = NULL;
- if ( bsizes!=NULL ) {
- for ( i=j=0; bsizes[i]!=0; ++i ) {
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(bsizes[i]&0xffff) || BDFDepth(bdf)!=(bsizes[i]>>16)); bdf=bdf->next );
- if ( bdf!=NULL )
- bsizes[j++] = bsizes[i];
- else
- gwwv_post_error(_("Missing bitmap strike"), _("The font database does not contain a bitmap of size %d and depth %d"), bsizes[i]&0xffff, bsizes[i]>>16 );
- }
- bsizes[j] = 0;
- for ( i=0; bsizes[i]!=0; ++i );
- at->gi.strikecnt = i;
- if ( i==0 ) bsizes=NULL;
- }
-
- if ( sf->subfonts!=NULL ) {
- SFDummyUpCIDs(&at->gi,sf); /* life is easier if we ignore the seperate fonts of a cid keyed fonts and treat it as flat */
- } else if ( format!=ff_none )
- AssignTTFGlyph(&at->gi,sf,at->map,format==ff_otf);
- else {
- if ( bsizes==NULL ) {
- gwwv_post_error(_("No bitmap strikes"), _("No bitmap strikes"));
- AbortTTF(at,sf);
-return( false );
- }
- AssignTTFBitGlyph(&at->gi,sf,at->map,bsizes);
- }
-
- at->maxp.version = 0x00010000;
- if ( format==ff_otf || format==ff_otfcid || (format==ff_none && at->applemode) )
- at->maxp.version = 0x00005000;
- at->maxp.maxnumcomponents = 0;
- at->maxp.maxcomponentdepth = 0;
- at->maxp.maxZones = 2; /* 1 would probably do, don't use twilight */
- at->maxp.maxFDEFs = 1; /* Not even 1 */
- at->maxp.maxStorage = 1; /* Not even 1 */
- at->maxp.maxStack = 64; /* A guess, it's probably more like 8 */
- if ( format==ff_otf || format==ff_otfcid || (format==ff_none && at->applemode) )
- at->maxp.version = 0x00005000;
- else
- MaxpFromTable(at,sf);
- at->gi.maxp = &at->maxp;
- if ( format==ff_otf )
- aborted = !dumptype2glyphs(sf,at);
- else if ( format==ff_otfcid )
- aborted = !dumpcidglyphs(sf,at);
- else if ( format==ff_none && at->applebitmaps ) {
- aborted = !dumpcffhmtx(at,sf,true); /* There is no 'hmtx' table for apple bitmap only fonts */
- /* But we need some of the side effects of this */
- } else if ( format==ff_none && at->otbbitmaps ) {
- aborted = !dumpcffhmtx(at,sf,true);
- dumpnoglyphs(sf,&at->gi);
- } else if ( format==ff_none && at->msbitmaps ) {
- aborted = !dumpglyphs(sf,&at->gi);
- } else {
- struct ttf_table *tab;
- /* There's a typo in Adobe's docs, and the instructions in these tables*/
- /* need to be included in the max glyph instruction length */
- if ( (tab = SFFindTable(sf,CHR('f','p','g','m'))) != NULL ) {
- at->maxp.maxglyphInstr = tab->len;
- at->gi.has_instrs = true;
- }
- if ( (tab = SFFindTable(sf,CHR('p','r','e','p'))) != NULL ) {
- if ( at->maxp.maxglyphInstr < tab->len )
- at->maxp.maxglyphInstr = tab->len;
- at->gi.has_instrs = true;
- }
- at->gi.has_instrs = (SFFindTable(sf,CHR('f','p','g','m')) != NULL ||
- SFFindTable(sf,CHR('p','r','e','p')) != NULL);
- /* if format==ff_none the following will put out lots of space glyphs */
- aborted = !dumpglyphs(sf,&at->gi);
- }
- if ( format!=ff_type42 && format!=ff_type42cid ) {
-#ifndef LUA_FF_LIB
- if ( bsizes!=NULL && !aborted )
- ttfdumpbitmap(sf,at,bsizes);
- if ( bsizes!=NULL && format==ff_none && at->msbitmaps )
- ttfdumpbitmapscaling(sf,at,bsizes);
-#endif
- }
- if ( aborted ) {
- AbortTTF(at,sf);
-return( false );
- }
-
- if ( at->gi.xmin==15000 ) at->gi.xmin = 0;
- if ( at->gi.ymin==15000 ) at->gi.ymin = 0;
- if ( bsizes!=NULL && format==ff_none ) {
- if ( sf->ascent >at->gi.ymax ) at->gi.ymax = sf->ascent;
- if ( -sf->descent<at->gi.ymin ) at->gi.ymin = -sf->descent;
- }
- at->head.xmin = at->gi.xmin;
- at->head.ymin = at->gi.ymin;
- at->head.xmax = at->gi.xmax;
- at->head.ymax = at->gi.ymax;
-
- sethead(&at->head,sf,at);
- sethhead(&at->hhead,&at->vhead,at,sf);
- setvorg(&at->vorg,sf);
- setos2(&at->os2,at,sf,format); /* should precede kern/ligature output */
- if ( at->gi.glyph_len<0x20000 )
- at->head.locais32 = 0;
- if ( format==ff_none && at->otbbitmaps )
- dummyloca(at);
- else if ( format!=ff_otf && format!=ff_otfcid && bf!=bf_sfnt_dfont &&
- (format!=ff_none || (bsizes!=NULL && !at->applemode && at->opentypemode)) )
- redoloca(at);
- redohead(at);
- if ( format!=ff_none || !at->applemode ) /* No 'hhea' table for apple bitmap-only fonts */
- redohhead(at,false);
- if ( sf->hasvmetrics ) {
- redohhead(at,true);
- redovorg(at); /* I know, VORG is only meaningful in a otf font and I dump it out in ttf too. Well, it will help ME read the font back in, and it won't bother anyone else. So there. */
- }
- redomaxp(at,format);
- ttf_fftm_dump(sf,at);
-
- if ( format!=ff_type42 && format!=ff_type42cid ) {
- if ( at->opentypemode ) {
- SFFindUnusedLookups(sf);
- otf_dumpgpos(at,sf);
- otf_dumpgsub(at,sf);
- otf_dumpgdef(at,sf);
- }
- if ( at->dovariations )
- ttf_dumpvariations(at,sf);
-#ifndef LUA_FF_LIB
- if ( at->applemode ) {
- if ( !at->opentypemode )
- SFFindUnusedLookups(sf);
- ttf_dumpkerns(at,sf);
- aat_dumplcar(at,sf);
- aat_dumpmorx(at,sf); /* Sets the feat table too */
- aat_dumpopbd(at,sf);
- aat_dumpprop(at,sf);
- }
-#endif
- if ( !at->applemode && (!at->opentypemode || (at->gi.flags&ttf_flag_oldkern)) )
- ttf_dumpkerns(at,sf); /* everybody supports a mimimal kern table */
-
- dumpnames(at,sf,format); /* Must be after dumpmorx which may create extra names */
- /* GPOS 'size' can also create names */
- redoos2(at);
- }
- if ( format!=ff_otf && format!=ff_otfcid && format!=ff_none ) {
- if (( sf->gasp_cnt!=0 || !SFHasInstructions(sf))
- && format!=ff_type42 && format!=ff_type42cid )
- dumpgasp(at, sf);
- at->fpgmf = dumpstoredtable(sf,CHR('f','p','g','m'),&at->fpgmlen);
- at->prepf = dumpstoredtable(sf,CHR('p','r','e','p'),&at->preplen);
- at->cvtf = dumpstoredtable(sf,CHR('c','v','t',' '),&at->cvtlen);
- }
- for ( tab=sf->ttf_tab_saved; tab!=NULL; tab=tab->next )
- tab->temp = dumpsavedtable(tab);
- if ( format!=ff_type42 && format!=ff_type42cid ) {
- dumppost(at,sf,format);
- dumpcmap(at,sf,format);
-
- pfed_dump(at,sf);
- tex_dump(at,sf);
- }
- if ( sf->subfonts!=NULL ) {
- free(sf->glyphs); sf->glyphs = NULL;
- sf->glyphcnt = sf->glyphmax = 0;
- }
- free( at->gi.bygid );
- at->gi.gcnt = 0;
-
- if ( format==ff_otf || format==ff_otfcid ) {
- at->tabdir.version = CHR('O','T','T','O');
-#ifdef FONTFORGE_CONFIG_APPLE_ONLY_TTF /* This means that Windows will reject the font. In general not a good idea */
- } else if ( at->applemode && !at->opentypemode ) {
- at->tabdir.version = CHR('t','r','u','e');
-#endif
- } else {
- at->tabdir.version = 0x00010000;
- }
-
- i = 0;
-
- if ( format==ff_otf || format==ff_otfcid ) {
- at->tabdir.tabs[i].tag = CHR('C','F','F',' ');
- at->tabdir.tabs[i].length = at->cfflen;
- at->tabdir.tabs[i++].data = at->cfff;
- }
-
- if ( at->bdat!=NULL && (at->msbitmaps || at->otbbitmaps)) {
- ebdtpos = i;
- at->tabdir.tabs[i].tag = CHR('E','B','D','T');
- at->tabdir.tabs[i].length = at->bdatlen;
- at->tabdir.tabs[i++].data = at->bdat;
- }
-
- if ( at->bloc!=NULL && (at->msbitmaps || at->otbbitmaps)) {
- eblcpos = i;
- at->tabdir.tabs[i].tag = CHR('E','B','L','C');
- at->tabdir.tabs[i].data = at->bloc;
- at->tabdir.tabs[i++].length = at->bloclen;
- }
-
- if ( at->ebsc!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('E','B','S','C');
- at->tabdir.tabs[i].data = at->ebsc;
- at->tabdir.tabs[i++].length = at->ebsclen;
- }
-
- if ( at->fftmf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('F','F','T','M');
- at->tabdir.tabs[i].data = at->fftmf;
- at->tabdir.tabs[i++].length = at->fftmlen;
- }
-
- if ( at->gdef!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('G','D','E','F');
- at->tabdir.tabs[i].data = at->gdef;
- at->tabdir.tabs[i++].length = at->gdeflen;
- }
-
- if ( at->gpos!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('G','P','O','S');
- at->tabdir.tabs[i].data = at->gpos;
- at->tabdir.tabs[i++].length = at->gposlen;
- }
-
- if ( at->gsub!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('G','S','U','B');
- at->tabdir.tabs[i].data = at->gsub;
- at->tabdir.tabs[i++].length = at->gsublen;
- }
-
- if ( at->os2f!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('O','S','/','2');
- at->tabdir.tabs[i].data = at->os2f;
- at->tabdir.tabs[i++].length = at->os2len;
- }
-
- if ( at->pfed!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('P','f','E','d');
- at->tabdir.tabs[i].data = at->pfed;
- at->tabdir.tabs[i++].length = at->pfedlen;
- }
-
- if ( at->tex!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('T','e','X',' ');
- at->tabdir.tabs[i].data = at->tex;
- at->tabdir.tabs[i++].length = at->texlen;
- }
-
- if ( at->bdf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('B','D','F',' ');
- at->tabdir.tabs[i].data = at->bdf;
- at->tabdir.tabs[i++].length = at->bdflen;
- }
-
- if ( at->vorgf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('V','O','R','G');
- at->tabdir.tabs[i].data = at->vorgf;
- at->tabdir.tabs[i++].length = at->vorglen;
- }
-
- if ( at->acnt!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('a','c','n','t');
- at->tabdir.tabs[i].data = at->acnt;
- at->tabdir.tabs[i++].length = at->acntlen;
- }
-
- if ( at->bdat!=NULL && at->applebitmaps ) {
- at->tabdir.tabs[i].tag = CHR('b','d','a','t');
- if ( !at->msbitmaps ) {
- at->tabdir.tabs[i].data = at->bdat;
- at->tabdir.tabs[i++].length = at->bdatlen;
- } else {
- at->tabdir.tabs[i].data = NULL;
- at->tabdir.tabs[i].dup_of = ebdtpos;
- at->tabdir.tabs[i++].length = at->tabdir.tabs[ebdtpos].length;
- }
- }
-
- if ( format==ff_none && at->applebitmaps ) {
- /* Bitmap only fonts get a bhed table rather than a head */
- at->tabdir.tabs[i].tag = CHR('b','h','e','d');
- at->tabdir.tabs[i].data = at->headf;
- at->tabdir.tabs[i++].length = at->headlen;
- }
-
- if ( at->bloc!=NULL && at->applebitmaps ) {
- at->tabdir.tabs[i].tag = CHR('b','l','o','c');
- if ( !at->msbitmaps ) {
- at->tabdir.tabs[i].data = at->bloc;
- at->tabdir.tabs[i++].length = at->bloclen;
- } else {
- at->tabdir.tabs[i].data = NULL;
- at->tabdir.tabs[i].dup_of = eblcpos;
- at->tabdir.tabs[i++].length = at->tabdir.tabs[eblcpos].length;
- }
- }
-
- if ( at->cmap!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('c','m','a','p');
- at->tabdir.tabs[i].data = at->cmap;
- at->tabdir.tabs[i++].length = at->cmaplen;
- }
-
- if ( format!=ff_otf && format!=ff_otfcid && format!=ff_none ) {
- if ( at->cvtf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('c','v','t',' ');
- at->tabdir.tabs[i].data = at->cvtf;
- at->tabdir.tabs[i++].length = at->cvtlen;
- }
- }
-
- if ( at->feat!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('f','e','a','t');
- at->tabdir.tabs[i].data = at->feat;
- at->tabdir.tabs[i++].length = at->featlen;
- }
-
- if ( at->fpgmf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('f','p','g','m');
- at->tabdir.tabs[i].data = at->fpgmf;
- at->tabdir.tabs[i++].length = at->fpgmlen;
- }
-
- if ( at->gaspf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('g','a','s','p');
- at->tabdir.tabs[i].data = at->gaspf;
- at->tabdir.tabs[i++].length = at->gasplen;
- }
-
- if ( at->gi.glyphs!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('g','l','y','f');
- at->tabdir.tabs[i].data = at->gi.glyphs;
- at->tabdir.tabs[i++].length = at->gi.glyph_len;
- }
-
- if ( format!=ff_none || !at->applebitmaps ) {
- at->tabdir.tabs[i].tag = CHR('h','e','a','d');
- at->tabdir.tabs[i].data = at->headf;
- at->tabdir.tabs[i++].length = at->headlen;
- }
-
- if ( format!=ff_none || !at->applemode ) {
- at->tabdir.tabs[i].tag = CHR('h','h','e','a');
- at->tabdir.tabs[i].data = at->hheadf;
- at->tabdir.tabs[i++].length = at->hheadlen;
- } else if ( at->hheadf!=NULL ) {
- fclose(at->hheadf);
- at->hheadf = NULL;
- }
-
- if ( format!=ff_none || !at->applemode ) {
- at->tabdir.tabs[i].tag = CHR('h','m','t','x');
- at->tabdir.tabs[i].data = at->gi.hmtx;
- at->tabdir.tabs[i++].length = at->gi.hmtxlen;
- }
-
- if ( at->kern!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('k','e','r','n');
- at->tabdir.tabs[i].data = at->kern;
- at->tabdir.tabs[i++].length = at->kernlen;
- }
-
- if ( at->lcar!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('l','c','a','r');
- at->tabdir.tabs[i].data = at->lcar;
- at->tabdir.tabs[i++].length = at->lcarlen;
- }
-
- if ( at->loca!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('l','o','c','a');
- at->tabdir.tabs[i].data = at->loca;
- at->tabdir.tabs[i++].length = at->localen;
- }
-
- at->tabdir.tabs[i].tag = CHR('m','a','x','p');
- at->tabdir.tabs[i].data = at->maxpf;
- at->tabdir.tabs[i++].length = at->maxplen;
-
- if ( at->morx!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('m','o','r','x');
- at->tabdir.tabs[i].data = at->morx;
- at->tabdir.tabs[i++].length = at->morxlen;
- }
-
- if ( at->name!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('n','a','m','e');
- at->tabdir.tabs[i].data = at->name;
- at->tabdir.tabs[i++].length = at->namelen;
- }
-
- if ( at->opbd!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('o','p','b','d');
- at->tabdir.tabs[i].data = at->opbd;
- at->tabdir.tabs[i++].length = at->opbdlen;
- }
-
- if ( at->post!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('p','o','s','t');
- at->tabdir.tabs[i].data = at->post;
- at->tabdir.tabs[i++].length = at->postlen;
- }
-
- if ( format!=ff_otf && format!=ff_otfcid && format!=ff_none ) {
- if ( at->prepf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('p','r','e','p');
- at->tabdir.tabs[i].data = at->prepf;
- at->tabdir.tabs[i++].length = at->preplen;
- }
- }
-
- if ( at->prop!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('p','r','o','p');
- at->tabdir.tabs[i].data = at->prop;
- at->tabdir.tabs[i++].length = at->proplen;
- }
-
- if ( at->vheadf!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('v','h','e','a');
- at->tabdir.tabs[i].data = at->vheadf;
- at->tabdir.tabs[i++].length = at->vheadlen;
-
- at->tabdir.tabs[i].tag = CHR('v','m','t','x');
- at->tabdir.tabs[i].data = at->gi.vmtx;
- at->tabdir.tabs[i++].length = at->gi.vmtxlen;
- }
-
- if ( at->fvar!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('f','v','a','r');
- at->tabdir.tabs[i].data = at->fvar;
- at->tabdir.tabs[i++].length = at->fvarlen;
- }
- if ( at->gvar!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('g','v','a','r');
- at->tabdir.tabs[i].data = at->gvar;
- at->tabdir.tabs[i++].length = at->gvarlen;
- }
- if ( at->cvar!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('c','v','a','r');
- at->tabdir.tabs[i].data = at->cvar;
- at->tabdir.tabs[i++].length = at->cvarlen;
- }
- if ( at->avar!=NULL ) {
- at->tabdir.tabs[i].tag = CHR('a','v','a','r');
- at->tabdir.tabs[i].data = at->avar;
- at->tabdir.tabs[i++].length = at->avarlen;
- }
-
- if ( i>=MAX_TAB )
- IError("Miscalculation of number of tables needed. Up sizeof tabs array in struct tabdir in ttf.h" );
-
- for ( tab=sf->ttf_tab_saved; tab!=NULL && i<MAX_TAB; tab=tab->next ) {
- at->tabdir.tabs[i].tag = tab->tag;
- at->tabdir.tabs[i].data = tab->temp;
- at->tabdir.tabs[i++].length = tab->len;
- }
- if ( tab!=NULL )
- IError("Some user supplied tables omitted. Up sizeof tabs array in struct tabdir in ttf.h" );
-
- qsort(at->tabdir.tabs,i,sizeof(struct taboff),tagcomp);
-
- at->tabdir.numtab = i;
- at->tabdir.searchRange = (i<16?8:i<32?16:i<64?32:64)*16;
- at->tabdir.entrySel = (i<16?3:i<32?4:i<64?5:6);
- at->tabdir.rangeShift = at->tabdir.numtab*16-at->tabdir.searchRange;
- for ( i=0; i<at->tabdir.numtab; ++i ) {
- struct taboff *tab = &at->tabdir.tabs[i];
- at->tabdir.ordered[i] = tab;
-/* This is the ordering of tables in ARIAL. I've no idea why it makes a */
-/* difference to order them, time to do a seek seems likely to be small, but */
-/* other people make a big thing about ordering them so I'll do it. */
-/* I got bored after glyph. Adobe follows the same scheme for their otf fonts */
-/* so at least the world is consistant */
-/* On the other hand, MS Font validator has a different idea. Oh well */
-/* From: http://partners.adobe.com/asn/tech/type/opentype/recom.jsp */
-/* TrueType Ordering */
-/* head, hhea, maxp, OS/2, hmtx, LTSH, VDMX, hdmx, cmap, fpgm, prep, cvt, */
-/* loca, glyf, kern, name, post, gasp, PCLT, DSIG */
-/* CFF in OpenType Ordering */
-/* head, hhea, maxp, OS/2, name, cmap, post, CFF, (other tables, as convenient) */
- if ( format==ff_otf || format==ff_otfcid ) {
- tab->orderingval = tab->tag==CHR('h','e','a','d')? 1 :
- tab->tag==CHR('h','h','e','a')? 2 :
- tab->tag==CHR('m','a','x','p')? 3 :
- tab->tag==CHR('O','S','/','2')? 4 :
- tab->tag==CHR('n','a','m','e')? 5 :
- tab->tag==CHR('c','m','a','p')? 6 :
- tab->tag==CHR('p','o','s','t')? 7 :
- tab->tag==CHR('C','F','F',' ')? 8 :
- tab->tag==CHR('G','D','E','F')? 17 :
- tab->tag==CHR('G','S','U','B')? 18 :
- tab->tag==CHR('G','P','O','S')? 19 :
- 20;
- } else {
- tab->orderingval = tab->tag==CHR('h','e','a','d')? 1 :
- tab->tag==CHR('h','h','e','a')? 2 :
- tab->tag==CHR('m','a','x','p')? 3 :
- tab->tag==CHR('O','S','/','2')? 4 :
- tab->tag==CHR('h','m','t','x')? 5 :
- tab->tag==CHR('L','T','S','H')? 6 :
- tab->tag==CHR('V','D','M','X')? 7 :
- tab->tag==CHR('h','d','m','x')? 8 :
- tab->tag==CHR('c','m','a','p')? 9 :
- tab->tag==CHR('f','p','g','m')? 10 :
- tab->tag==CHR('p','r','e','p')? 11 :
- tab->tag==CHR('c','v','t',' ')? 12 :
- tab->tag==CHR('l','o','c','a')? 13 :
- tab->tag==CHR('g','l','y','f')? 14 :
- tab->tag==CHR('k','e','r','n')? 15 :
- tab->tag==CHR('n','a','m','e')? 16 :
- tab->tag==CHR('p','o','s','t')? 17 :
- tab->tag==CHR('g','a','s','p')? 18 :
- tab->tag==CHR('P','C','L','T')? 19 :
- tab->tag==CHR('D','S','I','G')? 20 :
- tab->tag==CHR('G','D','E','F')? 21 :
- tab->tag==CHR('G','S','U','B')? 22 :
- tab->tag==CHR('G','P','O','S')? 23 :
- 24;
- }
- }
-
- qsort(at->tabdir.ordered,at->tabdir.numtab,sizeof(struct taboff *),tcomp);
-
- offset = sizeof(int32)+4*sizeof(int16) + at->tabdir.numtab*4*sizeof(int32);
- for ( i=0; i<at->tabdir.numtab; ++i ) if ( at->tabdir.ordered[i]->data!=NULL ) {
- at->tabdir.ordered[i]->offset = offset;
- offset += ((at->tabdir.ordered[i]->length+3)>>2)<<2;
- at->tabdir.ordered[i]->checksum = filecheck(at->tabdir.ordered[i]->data);
- }
- for ( i=0; i<at->tabdir.numtab; ++i ) if ( at->tabdir.ordered[i]->data==NULL ) {
- struct taboff *tab = &at->tabdir.tabs[at->tabdir.ordered[i]->dup_of];
- at->tabdir.ordered[i]->offset = tab->offset;
- at->tabdir.ordered[i]->checksum = tab->checksum;
- }
-return( true );
-}
-
-static char *Tag2String(uint32 tag) {
- static char buffer[8];
-
- buffer[0] = tag>>24;
- buffer[1] = tag>>16;
- buffer[2] = tag>>8;
- buffer[3] = tag;
- buffer[4] = 0;
-return( buffer );
-}
-
-static void dumpttf(FILE *ttf,struct alltabs *at, enum fontformat format) {
- int32 checksum;
- int i, head_index=-1;
- /* I can't use fwrite because I (may) have to byte swap everything */
-
- putlong(ttf,at->tabdir.version);
- putshort(ttf,at->tabdir.numtab);
- putshort(ttf,at->tabdir.searchRange);
- putshort(ttf,at->tabdir.entrySel);
- putshort(ttf,at->tabdir.rangeShift);
- for ( i=0; i<at->tabdir.numtab; ++i ) {
- if ( at->tabdir.tabs[i].tag==CHR('h','e','a','d') || at->tabdir.tabs[i].tag==CHR('b','h','e','d') )
- head_index = i;
- putlong(ttf,at->tabdir.tabs[i].tag);
- putlong(ttf,at->tabdir.tabs[i].checksum);
- putlong(ttf,at->tabdir.tabs[i].offset);
- putlong(ttf,at->tabdir.tabs[i].length);
- }
-
- for ( i=0; i<at->tabdir.numtab; ++i ) if ( at->tabdir.ordered[i]->data!=NULL )
- if ( !ttfcopyfile(ttf,at->tabdir.ordered[i]->data,
- at->tabdir.ordered[i]->offset,Tag2String(at->tabdir.tabs[i].tag)))
- at->error = true;
-
- checksum = filecheck(ttf);
- checksum = 0xb1b0afba-checksum;
- if ( head_index!=-1 )
- fseek(ttf,at->tabdir.tabs[head_index].offset+2*sizeof(int32),SEEK_SET);
- putlong(ttf,checksum);
-
- /* ttfcopyfile closed all the files (except ttf) */
-}
-
-static void DumpGlyphToNameMap(char *fontname,SplineFont *sf) {
- char *d, *e;
- char *newname = galloc(strlen(fontname)+10);
- FILE *file;
- int i,k,max;
- SplineChar *sc;
-
- strcpy(newname,fontname);
- d = strrchr(newname,'/');
- if ( d==NULL ) d=newname;
- e = strrchr(d,'.');
- if ( e==NULL ) e = newname+strlen(newname);
- strcpy(e,".g2n");
-
- file = fopen(newname,"wb");
- if ( file==NULL ) {
- LogError( _("Failed to open glyph to name map file for writing: %s\n"), newname );
- free(newname);
-return;
- }
-
- if ( sf->subfontcnt==0 )
- max = sf->glyphcnt;
- else {
- for ( k=max=0; k<sf->subfontcnt; ++k )
- if ( sf->subfonts[k]->glyphcnt > max )
- max = sf->subfonts[k]->glyphcnt;
- }
- for ( i=0; i<max; ++i ) {
- sc = NULL;
- if ( sf->subfontcnt==0 )
- sc = sf->glyphs[i];
- else {
- for ( k=0; k<sf->subfontcnt; ++k ) if ( i<sf->subfonts[k]->glyphcnt )
- if ( (sc=sf->subfonts[k]->glyphs[i])!=NULL )
- break;
- }
- if ( sc!=NULL && sc->ttf_glyph!=-1 ) {
- fprintf( file, "GLYPHID %d\tPSNAME %s", sc->ttf_glyph, sc->name );
- if ( sc->unicodeenc!=-1 )
- fprintf( file, "\tUNICODE %04X", sc->unicodeenc );
- putc('\n',file);
- }
- }
- fclose(file);
- free(newname);
-}
-
-static int dumpcff(struct alltabs *at,SplineFont *sf,enum fontformat format,
- FILE *cff) {
- int ret;
-
- if ( format==ff_cff ) {
- AssignTTFGlyph(&at->gi,sf,at->map,true);
- ret = dumptype2glyphs(sf,at);
- } else {
- SFDummyUpCIDs(&at->gi,sf); /* life is easier if we ignore the seperate fonts of a cid keyed fonts and treat it as flat */
- ret = dumpcidglyphs(sf,at);
- free(sf->glyphs); sf->glyphs = NULL;
- sf->glyphcnt = sf->glyphmax = 0;
- }
- free( at->gi.bygid );
-
- if ( !ret )
- at->error = true;
- else if ( at->gi.flags & ps_flag_nocffsugar ) {
- if ( !ttfcopyfile(cff,at->cfff,0,"CFF"))
- at->error = true;
- } else {
- long len;
- char buffer[80];
- fprintf(cff,"%%!PS-Adobe-3.0 Resource-FontSet\n");
- fprintf(cff,"%%%%DocumentNeedResources:ProcSet (FontSetInit)\n");
- fprintf(cff,"%%%%Title: (FontSet/%s)\n", sf->fontname);
- fprintf(cff,"%%%%EndComments\n" );
- fprintf(cff,"%%%%IncludeResource: ProcSet(FontSetInit)\n" );
- fprintf(cff,"%%%%BeginResource: FontSet(%s)\n", sf->fontname );
- fprintf(cff,"/FontSetInit /ProcSet findresource begin\n" );
- fseek(at->cfff,0,SEEK_END);
- len = ftell(at->cfff);
- rewind(at->cfff);
- sprintf( buffer, "/%s %ld StartData\n", sf->fontname, len );
- fprintf(cff,"%%%%BeginData: %ld Binary Bytes\n", (long) (len+strlen(buffer)) );
- fputs(buffer,cff);
- if ( !ttfcopyfile(cff,at->cfff,ftell(cff),"CFF"))
- at->error = true;
- fprintf(cff,"\n%%%%EndData\n" );
- fprintf(cff,"%%%%EndResource\n" );
- fprintf(cff,"%%%%EOF\n" );
- }
-return( !at->error );
-}
-
-int _WriteTTFFont(FILE *ttf,SplineFont *sf,enum fontformat format,
- int32 *bsizes, enum bitmapformat bf,int flags,EncMap *map) {
- struct alltabs at;
- char *oldloc;
- int i;
-
- oldloc = setlocale(LC_NUMERIC,"C"); /* TrueType probably doesn't need this, but OpenType does for floats in dictionaries */
- if ( format==ff_otfcid || format== ff_cffcid ) {
- if ( sf->cidmaster ) sf = sf->cidmaster;
- } else {
- if ( sf->subfontcnt!=0 ) sf = sf->subfonts[0];
- }
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->ttf_glyph = -1;
-
- memset(&at,'\0',sizeof(struct alltabs));
- at.gi.flags = flags;
- at.gi.is_ttf = format == ff_ttf || format==ff_ttfsym || format==ff_ttfmacbin || format==ff_ttfdfont;
- at.applemode = (flags&ttf_flag_applemode)?1:0;
- at.opentypemode = (flags&ttf_flag_otmode)?1:0;
- at.msbitmaps = bsizes!=NULL && at.opentypemode;
- at.applebitmaps = bsizes!=NULL && at.applemode;
- at.gi.onlybitmaps = format==ff_none;
-
- if ( bf==bf_sfnt_dfont ) { at.msbitmaps = false; at.applebitmaps=true; at.opentypemode=false; at.gi.onlybitmaps=true;}
- if ( bf==bf_sfnt_ms ) { at.msbitmaps = true; at.applebitmaps=false; at.applemode=false; at.gi.onlybitmaps=true;}
- if ( bf==bf_otb ) { at.otbbitmaps = true; at.applebitmaps=at.msbitmaps=false; at.applemode=false; at.gi.onlybitmaps=true;}
-
- if ( bsizes!=NULL && !at.applebitmaps && !at.otbbitmaps && !at.msbitmaps )
- at.msbitmaps = true; /* They asked for bitmaps, but no bitmap type selected */
- at.gi.bsizes = bsizes;
- at.gi.fixed_width = CIDOneWidth(sf);
- at.isotf = format==ff_otf || format==ff_otfcid;
- at.format = format;
- at.next_strid = 256;
-#ifndef LUA_FF_LIB
- if ( at.applemode && sf->mm!=NULL && sf->mm->apple &&
- (format==ff_ttf || format==ff_ttfsym || format==ff_ttfmacbin ||
- format==ff_ttfdfont) &&
- MMValid(sf->mm,false)) {
- at.dovariations = true;
- at.gi.dovariations = true;
- sf = sf->mm->normal;
- }
-#endif
- at.sf = sf;
- at.map = map;
-
- if ( format==ff_cff || format==ff_cffcid ) {
- dumpcff(&at,sf,format,ttf);
- } else {
- if ( initTables(&at,sf,format,bsizes,bf,flags))
- dumpttf(ttf,&at,format);
- }
- setlocale(LC_NUMERIC,oldloc);
- if ( at.error || ferror(ttf))
-return( 0 );
-
-#ifdef __CygWin
- /* Modern versions of windows want the execute bit set on a ttf file */
- /* I've no idea what this corresponds to in windows, nor any idea on */
- /* how to set it from the windows UI, but this seems to work */
- {
- struct stat buf;
- fstat(fileno(ttf),&buf);
- fchmod(fileno(ttf),S_IXUSR | buf.st_mode );
- }
-#endif
-
-return( 1 );
-}
-
-int WriteTTFFont(char *fontname,SplineFont *sf,enum fontformat format,
- int32 *bsizes, enum bitmapformat bf,int flags,EncMap *map) {
- FILE *ttf;
- int ret;
-
- if (( ttf=fopen(fontname,"wb+"))==NULL )
-return( 0 );
- ret = _WriteTTFFont(ttf,sf,format,bsizes,bf,flags,map);
- if ( ret && (flags&ttf_flag_glyphmap) )
- DumpGlyphToNameMap(fontname,sf);
- if ( fclose(ttf)==-1 )
-return( 0 );
-return( ret );
-}
-
-struct hexout {
- FILE *type42;
- int bytesout;
-};
-
-static void dumphex(struct hexout *hexout,FILE *temp,int length) {
- int i, ch, ch1;
-
- if ( length&1 )
- LogError( _("Table length should not be odd\n") );
-
- while ( length>65534 ) {
- dumphex(hexout,temp,65534);
- length -= 65534;
- }
-
- fprintf( hexout->type42, " <\n " );
- hexout->bytesout = 0;
- for ( i=0; i<length; ++i ) {
- ch = getc(temp);
- if ( ch==EOF )
- break;
- if ( hexout->bytesout>=31 ) {
- fprintf( hexout->type42, "\n " );
- hexout->bytesout = 0;
- }
- ch1 = ch>>4;
- if ( ch1>=10 )
- ch1 += 'A'-10;
- else
- ch1 += '0';
- putc(ch1,hexout->type42);
- ch1 = ch&0xf;
- if ( ch1>=10 )
- ch1 += 'A'-10;
- else
- ch1 += '0';
- putc(ch1,hexout->type42);
- ++hexout->bytesout;
- }
- fprintf( hexout->type42, "\n 00\n >\n" );
-}
-
-static void dumptype42(FILE *type42,struct alltabs *at, enum fontformat format) {
- FILE *temp = tmpfile();
- struct hexout hexout;
- int i, length;
-
- dumpttf(temp,at,format);
- rewind(temp);
-
- hexout.type42 = type42;
- hexout.bytesout = 0;
-
- /* Resort the tables into file order */
- qsort(at->tabdir.ordered,at->tabdir.numtab,sizeof(struct taboff *),tcomp2);
-
- dumphex(&hexout,temp,at->tabdir.ordered[0]->offset);
-
- for ( i=0; i<at->tabdir.numtab; ++i ) {
- if ( at->tabdir.ordered[i]->length>65534 && at->tabdir.ordered[i]->tag==CHR('g','l','y','f')) {
- uint32 last = 0;
- int j;
- fseek(temp,at->tabdir.ordered[i]->offset,SEEK_SET);
- for ( j=0; j<at->maxp.numGlyphs; ++j ) {
- if ( at->gi.loca[j+1]-last > 65534 ) {
- dumphex(&hexout,temp,at->gi.loca[j]-last);
- last = at->gi.loca[j];
- }
- }
- dumphex(&hexout,temp,at->gi.loca[j]-last);
- } else {
- if ( i<at->tabdir.numtab-1 )
- length = at->tabdir.ordered[i+1]->offset-at->tabdir.ordered[i]->offset;
- else {
- fseek(temp,0,SEEK_END);
- length = ftell(temp)-at->tabdir.ordered[i]->offset;
- }
- fseek(temp,at->tabdir.ordered[i]->offset,SEEK_SET);
- dumphex(&hexout,temp,length);
- }
- }
-
- fclose( temp );
-}
-
-int _WriteType42SFNTS(FILE *type42,SplineFont *sf,enum fontformat format,
- int flags,EncMap *map) {
- struct alltabs at;
- char *oldloc;
- int i;
-
- oldloc = setlocale(LC_NUMERIC,"C"); /* TrueType probably doesn't need this, but OpenType does for floats in dictionaries */
- if ( sf->subfontcnt!=0 ) sf = sf->subfonts[0];
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->ttf_glyph = -1;
-
- memset(&at,'\0',sizeof(struct alltabs));
- at.gi.flags = flags;
- at.applemode = false;
- at.opentypemode = false;
- at.msbitmaps = false;
- at.otbbitmaps = false;
- at.gi.onlybitmaps = false;
- at.gi.bsizes = NULL;
- at.gi.fixed_width = CIDOneWidth(sf);
- at.isotf = false;
- at.format = format;
- at.next_strid = 256;
- at.sf = sf;
- at.map = map;
-
- if ( initTables(&at,sf,format,NULL,bf_none,flags))
- dumptype42(type42,&at,format);
- free(at.gi.loca);
-
- setlocale(LC_NUMERIC,oldloc);
- if ( at.error || ferror(type42))
-return( 0 );
-
-return( 1 );
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfgpos.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfgpos.c
deleted file mode 100644
index 8601514db81..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfgpos.c
+++ /dev/null
@@ -1,3444 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaeditui.h"
-#include <utype.h>
-#include <ustring.h>
-
-int coverageformatsallowed=3;
-
-#include "ttf.h"
-
-#ifdef LUA_FF_LIB
-extern void gwwv_post_error(char *a, ...);
-extern int unic_isrighttoleft (int);
-#define isrighttoleft unic_isrighttoleft
-#endif
-
-/* This file contains routines to create the otf gpos and gsub tables and their */
-/* attendant subtables */
-
-/* Undocumented fact: ATM (which does kerning for otf fonts in Word) can't handle features with multiple lookups */
-
-/* Undocumented fact: Only one feature with a given tag allowed per script/lang */
-/* So if we have multiple lookups with the same tag they must be merged into */
-/* one feature with many lookups */
-
-/* scripts (for opentype) that I understand */
- /* see also list in lookups.c mapping script tags to friendly names */
-
-static uint32 scripts[][15] = {
-/* Arabic */ { CHR('a','r','a','b'), 0x0600, 0x06ff, 0xfb50, 0xfdff, 0xfe70, 0xfeff },
-/* Aramaic */ { CHR('a','r','a','m'), 0x820, 0x83f },
-/* Armenian */ { CHR('a','r','m','n'), 0x0530, 0x058f, 0xfb13, 0xfb17 },
-/* Balinese */ { CHR('b','a','l','i'), 0x1b00, 0x1b7f },
-/* Bengali */ { CHR('b','e','n','g'), 0x0980, 0x09ff },
-/* Bliss symb */{ CHR('b','l','i','s'), 0x12200, 0x124ff },
-/* Bopomofo */ { CHR('b','o','p','o'), 0x3100, 0x312f, 0x31a0, 0x31bf },
-/* Braille */ { CHR('b','r','a','i'), 0x2800, 0x28ff },
-/* Buginese */ { CHR('b','u','g','i'), 0x1a00, 0x1a1f },
-/* Buhid */ { CHR('b','u','h','d'), 0x1740, 0x1753 },
-/* Byzantine M*/{ CHR('b','y','z','m'), 0x1d000, 0x1d0ff },
-/* Canadian Syl*/{CHR('c','a','n','s'), 0x1400, 0x167f },
-/* Cherokee */ { CHR('c','h','e','r'), 0x13a0, 0x13ff },
-/* Cirth */ { CHR('c','i','r','t'), 0x12080, 0x120ff },
-/* CJKIdeogra */{ CHR('h','a','n','i'), 0x3300, 0x9fff, 0xf900, 0xfaff, 0x020000, 0x02ffff },
-/* Coptic */ { CHR('c','o','p','t'), 0x2c80, 0x2cff },
-/* Cypriot */ { CHR('c','p','m','n'), 0x10800, 0x1083f },
-/* Cyrillic */ { CHR('c','y','r','l'), 0x0400, 0x052f },
-/* Deseret */ { CHR('d','s','r','t'), 0x10400, 0x1044f },
-/* Devanagari */{ CHR('d','e','v','a'), 0x0900, 0x097f },
-/* Ethiopic */ { CHR('e','t','h','i'), 0x1200, 0x139f },
-/* Georgian */ { CHR('g','e','o','r'), 0x1080, 0x10ff },
-/* Glagolitic */{ CHR('g','l','a','g'), 0x1080, 0x10ff },
-/* Gothic */ { CHR('g','o','t','h'), 0x10330, 0x1034a },
-/* Greek */ { CHR('g','r','e','k'), 0x0370, 0x03ff, 0x1f00, 0x1fff },
-/* Gujarati */ { CHR('g','u','j','r'), 0x0a80, 0x0aff },
-/* Gurmukhi */ { CHR('g','u','r','u'), 0x0a00, 0x0a7f },
-/* Hangul */ { CHR('h','a','n','g'), 0xac00, 0xd7af, 0x3130, 0x319f, 0xffa0, 0xff9f },
-/* Hanunoo */ { CHR('h','a','n','o'), 0x1720, 0x1734 },
- /* I'm not sure what the difference is between the 'hang' tag and the 'jamo' */
- /* tag. 'Jamo' is said to be the precomposed forms, but what's 'hang'? */
-/* Hebrew */ { CHR('h','e','b','r'), 0x0590, 0x05ff, 0xfb1e, 0xfb4f },
-#if 0 /* Hiragana used to have its own tag, but has since been merged with katakana */
-/* Hiragana */ { CHR('h','i','r','a'), 0x3040, 0x309f },
-#endif
-/* Hangul Jamo*/{ CHR('j','a','m','o'), 0x1100, 0x11ff, 0x3130, 0x319f, 0xffa0, 0xffdf },
-/* Katakana */ { CHR('k','a','n','a'), 0x3040, 0x30ff, 0xff60, 0xff9f },
-/* Javanese */ { CHR('j','a','v','a'), 0 }, /* MS has a tag, but there is no unicode range */
-/* Khmer */ { CHR('k','h','m','r'), 0x1780, 0x17ff },
-/* Kannada */ { CHR('k','n','d','a'), 0x0c80, 0x0cff },
-/* Kharosthi */ { CHR('k','h','a','r'), 0x10a00, 0x10a5f },
-/* Latin */ { CHR('l','a','t','n'), 0x0041, 0x005a, 0x0061, 0x007a,
- 0x00c0, 0x02af, 0x1d00, 0x1eff, 0xfb00, 0xfb0f, 0xff00, 0xff5f, 0, 0 },
-/* Lao */ { CHR('l','a','o',' '), 0x0e80, 0x0eff },
-/* Limbu */ { CHR('l','i','m','b'), 0x1900, 0x194f },
-/* Linear A */ { CHR('l','i','n','a'), 0x10180, 0x102cf },
-/* Linear B */ { CHR('l','i','n','b'), 0x10000, 0x100fa },
-/* Malayalam */ { CHR('m','l','y','m'), 0x0d00, 0x0d7f },
-/* Mathematical Alphanumeric Symbols */
- { CHR('m','a','t','h'), 0x1d400, 0x1d7ff },
-/* Mongolian */ { CHR('m','o','n','g'), 0x1800, 0x18af },
-/* Musical */ { CHR('m','u','s','i'), 0x1d100, 0x1d1ff },
-/* Myanmar */ { CHR('m','y','m','r'), 0x1000, 0x107f },
-/* N'Ko */ { CHR('n','k','o',' '), 0x07c0, 0x07fa },
-/* Ogham */ { CHR('o','g','a','m'), 0x1680, 0x169f },
-/* Old Italic */{ CHR('i','t','a','l'), 0x10300, 0x1031e },
-/* Old Permic */{ CHR('p','e','r','m'), 0x10350, 0x1037f },
-/* Old Persian cuneiform */
- { CHR('x','p','e','o'), 0x103a0, 0x103df },
-/* Oriya */ { CHR('o','r','y','a'), 0x0b00, 0x0b7f },
-/* Osmanya */ { CHR('o','s','m','a'), 0x10480, 0x104a9 },
-/* Phags-pa */ { CHR('p','h','a','g'), 0xa840, 0xa87f },
-/* Phoenician */{ CHR('p','h','n','x'), 0x10900, 0x1091f },
-/* Pollard */ { CHR('p','l','r','d'), 0x104b0, 0x104d9 },
-/* Runic */ { CHR('r','u','n','r'), 0x16a0, 0x16ff },
-/* Shavian */ { CHR('s','h','a','w'), 0x10450, 0x1047f },
-/* Sinhala */ { CHR('s','i','n','h'), 0x0d80, 0x0dff },
-/* Sumero-Akkadian Cuneiform */
- { CHR('x','s','u','x'), 0x12000, 0x1236e },
-/* Syloti Nagri */
- { CHR('s','y','l','o'), 0xa800, 0xa82f },
-/* Syriac */ { CHR('s','y','r','c'), 0x0700, 0x074f },
-/* Tagalog */ { CHR('t','a','g','l'), 0x1700, 0x1714 },
-/* Tagbanwa */ { CHR('t','a','g','b'), 0x1760, 0x1773 },
-/* Tai Le */ { CHR('t','a','l','e'), 0x1950, 0x1974 },
-/* Tai Lu */ { CHR('t','a','l','u'), 0x1980, 0x19df },
-/* Tamil */ { CHR('t','a','m','l'), 0x0b80, 0x0bff },
-/* Telugu */ { CHR('t','e','l','u'), 0x0c00, 0x0c7f },
-/* Tengwar */ { CHR('t','e','n','g'), 0x12000, 0x1207f },
-/* Thaana */ { CHR('t','h','a','a'), 0x0780, 0x07bf },
-/* Thai */ { CHR('t','h','a','i'), 0x0e00, 0x0e7f },
-/* Tibetan */ { CHR('t','i','b','t'), 0x0f00, 0x0fff },
-/* Tifinagh */ { CHR('t','f','n','g'), 0x2d30, 0x2d7f },
-/* Ugaritic */ { CHR('u','g','a','r'), 0x10380, 0x1039d },
-/* Yi */ { CHR('y','i',' ',' '), 0xa000, 0xa4c6 },
- { 0 }
-};
-
-int ScriptIsRightToLeft(uint32 script) {
- if ( script==CHR('a','r','a','b') || script==CHR('h','e','b','r') ||
- script==CHR('c','p','m','n') || script==CHR('k','h','a','r') ||
- script==CHR('s','y','r','c') || script==CHR('t','h','a','a') ||
- script==CHR('n','k','o',' '))
-return( true );
-
-return( false );
-}
-
-uint32 ScriptFromUnicode(int u,SplineFont *sf) {
- int s, k;
-
- if ( u!=-1 ) {
- for ( s=0; scripts[s][0]!=0; ++s ) {
- for ( k=1; scripts[s][k+1]!=0; k += 2 )
- if ( u>=scripts[s][k] && u<=scripts[s][k+1] )
- break;
- if ( scripts[s][k+1]!=0 )
- break;
- }
- if ( scripts[s][0]!=0 ) {
- extern int use_second_indic_scripts;
- uint32 script = scripts[s][0];
- if ( use_second_indic_scripts ) {
- /* MS has a parallel set of script tags for their new */
- /* Indic font shaper */
- if ( script == CHR('b','e','n','g' )) script = CHR('b','n','g','2');
- else if ( script == CHR('d','e','v','a' )) script = CHR('d','e','v','2');
- else if ( script == CHR('g','u','j','r' )) script = CHR('g','j','r','2');
- else if ( script == CHR('g','u','r','u' )) script = CHR('g','u','r','2');
- else if ( script == CHR('k','n','d','a' )) script = CHR('k','n','d','2');
- else if ( script == CHR('m','l','y','m' )) script = CHR('m','l','y','2');
- else if ( script == CHR('o','r','y','a' )) script = CHR('o','r','y','2');
- else if ( script == CHR('t','a','m','l' )) script = CHR('t','m','l','2');
- else if ( script == CHR('t','e','l','u' )) script = CHR('t','e','l','2');
- }
-return( script );
- }
- } else if ( sf!=NULL ) {
- if ( sf->cidmaster!=NULL || sf->subfontcnt!=0 ) {
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
- if ( strmatch(sf->ordering,"Identity")==0 )
-return( DEFAULT_SCRIPT );
- else if ( strmatch(sf->ordering,"Korean")==0 )
-return( CHR('h','a','n','g'));
- else
-return( CHR('h','a','n','i') );
- }
- }
-
-return( DEFAULT_SCRIPT );
-}
-
-uint32 SCScriptFromUnicode(SplineChar *sc) {
- char *pt;
- PST *pst;
- SplineFont *sf;
- int i; unsigned uni;
- FeatureScriptLangList *features;
-
- if ( sc==NULL )
-return( DEFAULT_SCRIPT );
-
- sf = sc->parent;
- if ( sc->unicodeenc!=-1 )
-return( ScriptFromUnicode( sc->unicodeenc,sf ));
-
- pt = sc->name;
- if ( *pt ) for ( ++pt; *pt!='\0' && *pt!='_' && *pt!='.'; ++pt );
- if ( *pt!='\0' ) {
- char *str = copyn(sc->name,pt-sc->name);
- int uni = sf==NULL || sf->fv==NULL ? UniFromName(str,ui_none,&custom) :
- UniFromName(str,sf->uni_interp,sf->fv->map->enc);
- free(str);
- if ( uni!=-1 )
-return( ScriptFromUnicode( uni,sf ));
- }
- /* Adobe ligature uniXXXXXXXX */
- if ( strncmp(sc->name,"uni",3)==0 && sscanf(sc->name+3,"%4x", &uni)==1 )
-return( ScriptFromUnicode( uni,sf ));
-
- if ( sf==NULL )
-return( DEFAULT_SCRIPT );
-
- if ( sf->cidmaster ) sf=sf->cidmaster;
- else if ( sf->mm!=NULL ) sf=sf->mm->normal;
- for ( i=0; i<2; ++i ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_lcaret )
- continue;
- for ( features = pst->subtable->lookup->features; features!=NULL; features=features->next ) {
- if ( features->scripts!=NULL )
-return( features->scripts->script );
- }
- }
- }
-return( ScriptFromUnicode( sc->unicodeenc,sf ));
-}
-
-int SCRightToLeft(SplineChar *sc) {
-
- if ( sc->unicodeenc>=0x10800 && sc->unicodeenc<=0x10fff )
-return( true ); /* Supplemental Multilingual Plane, RTL scripts */
- if ( sc->unicodeenc!=-1 && sc->unicodeenc<0x10000 )
-return( isrighttoleft(sc->unicodeenc ));
-
-return( ScriptIsRightToLeft(SCScriptFromUnicode(sc)));
-}
-
-static void GlyphMapFree(SplineChar ***map) {
- int i;
-
- if ( map==NULL )
-return;
- for ( i=0; map[i]!=NULL; ++i )
- free(map[i]);
- free(map);
-}
-
-static SplineChar **FindSubs(SplineChar *sc,struct lookup_subtable *sub) {
- SplineChar *spc[30], **space = spc;
- int max = sizeof(spc)/sizeof(spc[0]);
- int cnt=0;
- char *pt, *start;
- SplineChar *subssc, **ret;
- PST *pst;
-
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==sub ) {
- pt = pst->u.subs.variant;
- while ( 1 ) {
- while ( *pt==' ' ) ++pt;
- start = pt;
- pt = strchr(start,' ');
- if ( pt!=NULL )
- *pt = '\0';
- subssc = SFGetChar(sc->parent,-1,start);
- if ( subssc!=NULL && subssc->ttf_glyph!=-1 ) {
- if ( cnt>=max ) {
- if ( spc==space ) {
- space = galloc((max+=30)*sizeof(SplineChar *));
- memcpy(space,spc,(max-30)*sizeof(SplineChar *));
- } else
- space = grealloc(space,(max+=30)*sizeof(SplineChar *));
- }
- space[cnt++] = subssc;
- }
- if ( pt==NULL )
- break;
- *pt=' ';
- }
- }
- }
- if ( cnt==0 ) /* Might happen if the substitution names weren't in the font */
-return( NULL );
- ret = galloc((cnt+1)*sizeof(SplineChar *));
- memcpy(ret,space,cnt*sizeof(SplineChar *));
- ret[cnt] = NULL;
- if ( space!=spc )
- free(space);
-return( ret );
-}
-
-static SplineChar ***generateMapList(SplineChar **glyphs, struct lookup_subtable *sub) {
- int cnt;
- SplineChar *sc;
- int i;
- SplineChar ***maps=NULL;
-
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt );
- maps = galloc((cnt+1)*sizeof(SplineChar **));
- for ( i=0; i<cnt; ++i ) {
- sc = glyphs[i];
- maps[i] = FindSubs(sc,sub);
- }
- maps[cnt] = NULL;
-return( maps );
-}
-
-void AnchorClassDecompose(SplineFont *sf,AnchorClass *_ac, int classcnt, int *subcnts,
- SplineChar ***marks,SplineChar ***base,
- SplineChar ***lig,SplineChar ***mkmk,
- struct glyphinfo *gi) {
- /* Run through the font finding all characters with this anchor class */
- /* (and the cnt-1 classes after it) */
- /* and distributing in the four possible anchor types */
- int i,j,k,gid, gmax;
- struct sclist { int cnt; SplineChar **glyphs; } heads[at_max];
- AnchorPoint *test;
- AnchorClass *ac;
-
- memset(heads,0,sizeof(heads));
- memset(subcnts,0,classcnt*sizeof(int));
- memset(marks,0,classcnt*sizeof(SplineChar **));
- gmax = gi==NULL ? sf->glyphcnt : gi->gcnt;
- for ( j=0; j<2; ++j ) {
- for ( i=0; i<gmax; ++i ) if ( (gid = gi==NULL ? i : gi->bygid[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- for ( ac = _ac, k=0; k<classcnt; ac=ac->next ) if ( ac->matches ) {
- for ( test=sf->glyphs[gid]->anchor; test!=NULL ; test=test->next ) {
- if ( test->anchor==ac ) {
- if ( test->type==at_mark ) {
- if ( j )
- marks[k][subcnts[k]] = sf->glyphs[gid];
- ++subcnts[k];
- if ( ac->type!=act_mkmk )
- break;
- } else if ( test->type!=at_centry && test->type!=at_cexit ) {
- if ( heads[test->type].glyphs!=NULL ) {
- /* If we have multiple mark classes, we may use the same base glyph */
- /* with more than one mark class. But it should only appear once in */
- /* the output */
- if ( heads[test->type].cnt==0 ||
- heads[test->type].glyphs[heads[test->type].cnt-1]!=sf->glyphs[gid] ) {
- heads[test->type].glyphs[heads[test->type].cnt] = sf->glyphs[gid];
- ++heads[test->type].cnt;
- }
- } else
- ++heads[test->type].cnt;
- if ( ac->type!=act_mkmk )
- break;
- }
- }
- }
- ++k;
- }
- }
- if ( j==1 )
- break;
- for ( i=0; i<4; ++i )
- if ( heads[i].cnt!=0 ) {
- heads[i].glyphs = galloc((heads[i].cnt+1)*sizeof(SplineChar *));
- /* I used to set glyphs[cnt] to NULL here. But it turns out */
- /* cnt may be an overestimate on the first pass. So we can */
- /* only set it at the end of the second pass */
- heads[i].cnt = 0;
- }
- for ( k=0; k<classcnt; ++k ) if ( subcnts[k]!=0 ) {
- marks[k] = galloc((subcnts[k]+1)*sizeof(SplineChar *));
- marks[k][subcnts[k]] = NULL;
- subcnts[k] = 0;
- }
- }
- for ( i=0; i<4; ++i )
- if ( heads[i].glyphs!=NULL )
- heads[i].glyphs[heads[i].cnt] = NULL;
-
- *base = heads[at_basechar].glyphs;
- *lig = heads[at_baselig].glyphs;
- *mkmk = heads[at_basemark].glyphs;
-}
-
-SplineChar **EntryExitDecompose(SplineFont *sf,AnchorClass *ac,struct glyphinfo *gi) {
- /* Run through the font finding all characters with this anchor class */
- int i,j, cnt, gmax, gid;
- SplineChar **array;
- AnchorPoint *test;
-
- array=NULL;
- gmax = gi==NULL ? sf->glyphcnt : gi->gcnt;
- for ( j=0; j<2; ++j ) {
- cnt = 0;
- for ( i=0; i<gmax; ++i ) if ( (gid = gi==NULL ? i : gi->bygid[i])!=-1 && sf->glyphs[gid]!=NULL ) {
- for ( test=sf->glyphs[gid]->anchor; test!=NULL && test->anchor!=ac; test=test->next );
- if ( test!=NULL && (test->type==at_centry || test->type==at_cexit )) {
- if ( array!=NULL )
- array[cnt] = sf->glyphs[gid];
- ++cnt;
- }
- }
- if ( cnt==0 )
-return( NULL );
- if ( j==1 )
- break;
- array = galloc((cnt+1)*sizeof(SplineChar *));
- array[cnt] = NULL;
- }
-return( array );
-}
-
-static void AnchorGuessContext(SplineFont *sf,struct alltabs *at) {
- int i;
- int maxbase=0, maxmark=0, basec, markc;
- AnchorPoint *ap;
- int hascursive = 0;
-
- /* the order in which we examine the glyphs does not matter here, so */
- /* we needn't add the complexity running though in gid order */
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i] ) {
- basec = markc = 0;
- for ( ap = sf->glyphs[i]->anchor; ap!=NULL; ap=ap->next )
- if ( ap->type==at_basemark )
- ++markc;
- else if ( ap->type==at_basechar || ap->type==at_baselig )
- ++basec;
- else if ( ap->type==at_centry )
- hascursive = true;
- if ( basec>maxbase ) maxbase = basec;
- if ( markc>maxmark ) maxmark = markc;
- }
-
- if ( maxbase*(maxmark+1)>at->os2.maxContext )
- at->os2.maxContext = maxbase*(maxmark+1);
- if ( hascursive && at->os2.maxContext<2 )
- at->os2.maxContext=2;
-}
-
-static void dumpcoveragetable(FILE *gpos,SplineChar **glyphs) {
- int i, last = -2, range_cnt=0, start;
- /* the glyph list should already be sorted */
- /* figure out whether it is better (smaller) to use an array of glyph ids */
- /* or a set of glyph id ranges */
-
- for ( i=0; glyphs[i]!=NULL; ++i ) {
- if ( glyphs[i]->ttf_glyph<=last )
- IError("Glyphs must be ordered when creating coverage table");
- if ( glyphs[i]->ttf_glyph!=last+1 )
- ++range_cnt;
- last = glyphs[i]->ttf_glyph;
- }
- /* I think Windows will only accept format 2 coverage tables? */
- if ( !(coverageformatsallowed&2) || ((coverageformatsallowed&1) && i<=3*range_cnt )) {
- /* We use less space with a list of glyphs than with a set of ranges */
- putshort(gpos,1); /* Coverage format=1 => glyph list */
- putshort(gpos,i); /* count of glyphs */
- for ( i=0; glyphs[i]!=NULL; ++i )
- putshort(gpos,glyphs[i]->ttf_glyph); /* array of glyph IDs */
- } else {
- putshort(gpos,2); /* Coverage format=2 => range list */
- putshort(gpos,range_cnt); /* count of ranges */
- last = -2; start = -2; /* start is a index in our glyph array, last is ttf_glyph */
- for ( i=0; glyphs[i]!=NULL; ++i ) {
- if ( glyphs[i]->ttf_glyph!=last+1 ) {
- if ( last!=-2 ) {
- putshort(gpos,glyphs[start]->ttf_glyph); /* start glyph ID */
- putshort(gpos,last); /* end glyph ID */
- putshort(gpos,start); /* coverage index of start glyph */
- }
- start = i;
- }
- last = glyphs[i]->ttf_glyph;
- }
- if ( last!=-2 ) {
- putshort(gpos,glyphs[start]->ttf_glyph); /* start glyph ID */
- putshort(gpos,last); /* end glyph ID */
- putshort(gpos,start); /* coverage index of start glyph */
- }
- }
-}
-
-static int sc_ttf_order( const void *_sc1, const void *_sc2) {
- const SplineChar *sc1 = *(const SplineChar **) _sc1, *sc2 = *(const SplineChar **) _sc2;
-return( sc1->ttf_glyph - sc2->ttf_glyph );
-}
-
-static SplineChar **SFOrderedGlyphsWithPSTinSubtable(SplineFont *sf,struct lookup_subtable *sub) {
- SplineChar **glyphs = SFGlyphsWithPSTinSubtable(sf,sub);
- int cnt, i, k;
- if ( glyphs==NULL )
-return( NULL );
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt);
- qsort(glyphs,cnt,sizeof(SplineChar *),sc_ttf_order);
- if ( glyphs[0]->ttf_glyph==-1 ) {
- /* Not sure if this can happen, but it's easy to fix */
- for ( k=0; k<cnt && glyphs[k]->ttf_glyph==-1; ++k);
- for ( i=0; i<=cnt-k; ++i )
- glyphs[i] = glyphs[i+k];
- }
-return( glyphs );
-}
-
-SplineChar **SFGlyphsFromNames(SplineFont *sf,char *names) {
- int cnt, ch;
- char *pt, *end;
- SplineChar *sc, **glyphs;
-
- cnt = 0;
- for ( pt = names; *pt; pt = end+1 ) {
- ++cnt;
- end = strchr(pt,' ');
- if ( end==NULL )
- break;
- }
-
- glyphs = galloc((cnt+1)*sizeof(SplineChar *));
- cnt = 0;
- for ( pt = names; *pt; pt = end+1 ) {
- end = strchr(pt,' ');
- if ( end==NULL )
- end = pt+strlen(pt);
- ch = *end;
- *end = '\0';
- sc = SFGetChar(sf,-1,pt);
- if ( sc!=NULL && sc->ttf_glyph!=-1 )
- glyphs[cnt++] = sc;
- *end = ch;
- if ( ch=='\0' )
- break;
- }
- glyphs[cnt] = NULL;
-return( glyphs );
-}
-
-static SplineChar **OrderedGlyphsFromNames(SplineFont *sf,char *names) {
- SplineChar **glyphs = SFGlyphsFromNames(sf,names);
- int i,j;
-
- if ( glyphs==NULL || glyphs[0]==NULL )
-return( glyphs );
-
- for ( i=0; glyphs[i+1]!=NULL; ++i ) for ( j=i+1; glyphs[j]!=NULL; ++j ) {
- if ( glyphs[i]->ttf_glyph > glyphs[j]->ttf_glyph ) {
- SplineChar *sc = glyphs[i];
- glyphs[i] = glyphs[j];
- glyphs[j] = sc;
- }
- }
- if ( glyphs[0]!=NULL ) { /* Glyphs should not appear twice in the name list, just just in case they do... */
- for ( i=0; glyphs[i+1]!=NULL; ++i ) {
- if ( glyphs[i]==glyphs[i+1] ) {
- for ( j=i+1; glyphs[j]!=NULL; ++j )
- glyphs[j] = glyphs[j+1];
- }
- }
- }
-return( glyphs );
-}
-
-static void gposvrmaskeddump(FILE *gpos,int vf1,int mask,int offset) {
- if ( vf1&1 ) putshort(gpos,mask&1 ? offset : 0 );
- if ( vf1&2 ) putshort(gpos,mask&2 ? offset : 0 );
- if ( vf1&4 ) putshort(gpos,mask&4 ? offset : 0 );
- if ( vf1&8 ) putshort(gpos,mask&8 ? offset : 0 );
-}
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
-static int devtaboffsetsize(DeviceTable *dt) {
- int type = 1, i;
-
- for ( i=dt->last_pixel_size-dt->first_pixel_size; i>=0; --i ) {
- if ( dt->corrections[i]>=8 || dt->corrections[i]<-8 )
-return( 3 );
- else if ( dt->corrections[i]>=2 || dt->corrections[i]<-2 )
- type = 2;
- }
-return( type );
-}
-
-static void dumpgposdevicetable(FILE *gpos,DeviceTable *dt) {
- int type;
- int i,cnt,b;
-
- if ( dt==NULL || dt->corrections==NULL )
-return;
- type = devtaboffsetsize(dt);
- putshort(gpos,dt->first_pixel_size);
- putshort(gpos,dt->last_pixel_size );
- putshort(gpos,type);
- cnt = dt->last_pixel_size - dt->first_pixel_size + 1;
- if ( type==3 ) {
- for ( i=0; i<cnt; ++i )
- putc(dt->corrections[i],gpos);
- if ( cnt&1 )
- putc(0,gpos);
- } else if ( type==2 ) {
- for ( i=0; i<cnt; i+=4 ) {
- int val = 0;
- for ( b=0; b<4 && i+b<cnt; ++b )
- val |= (dt->corrections[i+b]&0x000f)<<(12-b*4);
- putshort(gpos,val);
- }
- } else {
- for ( i=0; i<cnt; i+=8 ) {
- int val = 0;
- for ( b=0; b<8 && i+b<cnt; ++b )
- val |= (dt->corrections[i+b]&0x0003)<<(14-b*2);
- putshort(gpos,val);
- }
- }
-}
-
-static int DevTabLen(DeviceTable *dt) {
- int type;
- int cnt;
-
- if ( dt==NULL || dt->corrections==NULL )
-return( 0 );
- cnt = dt->last_pixel_size - dt->first_pixel_size + 1;
- type = devtaboffsetsize(dt);
- if ( type==3 )
- cnt = (cnt+1)/2;
- else if ( type==2 )
- cnt = (cnt+3)/4;
- else
- cnt = (cnt+7)/8;
- cnt += 3; /* first, last, type */
-return( sizeof(uint16)*cnt );
-}
-
-static int ValDevTabLen(ValDevTab *vdt) {
-
- if ( vdt==NULL )
-return( 0 );
-
-return( DevTabLen(&vdt->xadjust) + DevTabLen(&vdt->yadjust) +
- DevTabLen(&vdt->xadv) + DevTabLen(&vdt->yadv) );
-}
-
-static int gposdumpvaldevtab(FILE *gpos,ValDevTab *vdt,int bits,int next_dev_tab ) {
-
- if ( bits&0x10 ) {
- if ( vdt==NULL || vdt->xadjust.corrections==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(&vdt->xadjust);
- }
- }
- if ( bits&0x20 ) {
- if ( vdt==NULL || vdt->yadjust.corrections==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(&vdt->yadjust);
- }
- }
- if ( bits&0x40 ) {
- if ( vdt==NULL || vdt->xadv.corrections==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(&vdt->xadv);
- }
- }
- if ( bits&0x80 ) {
- if ( vdt==NULL || vdt->yadv.corrections==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(&vdt->yadv);
- }
- }
-return( next_dev_tab );
-}
-
-static int gposmaskeddumpdevtab(FILE *gpos,DeviceTable *dt,int bits,int mask,
- int next_dev_tab ) {
-
- if ( bits&0x10 ) {
- if ( !(mask&0x10) || dt==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(dt);
- }
- }
- if ( bits&0x20 ) {
- if ( !(mask&0x20) || dt==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(dt);
- }
- }
- if ( bits&0x40 ) {
- if ( !(mask&0x40) || dt==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(dt);
- }
- }
- if ( bits&0x80 ) {
- if ( !(mask&0x80) || dt==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,next_dev_tab);
- next_dev_tab += DevTabLen(dt);
- }
- }
-return( next_dev_tab );
-}
-
-static int DevTabsSame(DeviceTable *dt1, DeviceTable *dt2) {
- DeviceTable _dt;
- int i;
-
- if ( dt1==NULL && dt2==NULL )
-return( true );
- if ( dt1==NULL ) {
- memset(&_dt,0,sizeof(_dt));
- dt1 = &_dt;
- }
- if ( dt2==NULL ) {
- memset(&_dt,0,sizeof(_dt));
- dt2 = &_dt;
- }
- if ( dt1->corrections==NULL && dt2->corrections==NULL )
-return( true );
- if ( dt1->corrections==NULL || dt2->corrections==NULL )
-return( false );
- if ( dt1->first_pixel_size!=dt2->first_pixel_size ||
- dt1->last_pixel_size!=dt2->last_pixel_size )
-return( false );
- for ( i=dt2->last_pixel_size-dt1->first_pixel_size; i>=0; --i )
- if ( dt1->corrections[i]!=dt2->corrections[i] )
-return( false );
-
-return( true );
-}
-
-static int ValDevTabsSame(ValDevTab *vdt1, ValDevTab *vdt2) {
- ValDevTab _vdt;
-
- if ( vdt1==NULL && vdt2==NULL )
-return( true );
- if ( vdt1==NULL ) {
- memset(&_vdt,0,sizeof(_vdt));
- vdt1 = &_vdt;
- }
- if ( vdt2==NULL ) {
- memset(&_vdt,0,sizeof(_vdt));
- vdt2 = &_vdt;
- }
-return( DevTabsSame(&vdt1->xadjust,&vdt2->xadjust) &&
- DevTabsSame(&vdt1->yadjust,&vdt2->yadjust) &&
- DevTabsSame(&vdt1->xadv,&vdt2->xadv) &&
- DevTabsSame(&vdt1->yadv,&vdt2->yadv) );
-}
-#endif
-
-static void dumpGPOSsimplepos(FILE *gpos,SplineFont *sf,struct lookup_subtable *sub ) {
- int cnt, cnt2;
- int32 coverage_pos, end;
- PST *pst, *first=NULL;
- int bits = 0, same=true;
- SplineChar **glyphs;
-
- glyphs = SFOrderedGlyphsWithPSTinSubtable(sf,sub);
- for ( cnt=cnt2=0; glyphs[cnt]!=NULL; ++cnt) {
- for ( pst=glyphs[cnt]->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==sub && pst->type==pst_position ) {
- if ( first==NULL ) first = pst;
- else if ( same ) {
- if ( first->u.pos.xoff!=pst->u.pos.xoff ||
- first->u.pos.yoff!=pst->u.pos.yoff ||
- first->u.pos.h_adv_off!=pst->u.pos.h_adv_off ||
- first->u.pos.v_adv_off!=pst->u.pos.v_adv_off )
- same = false;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( !ValDevTabsSame(pst->u.pos.adjust,first->u.pos.adjust))
- same = false;
-#endif
- }
- if ( pst->u.pos.xoff!=0 ) bits |= 1;
- if ( pst->u.pos.yoff!=0 ) bits |= 2;
- if ( pst->u.pos.h_adv_off!=0 ) bits |= 4;
- if ( pst->u.pos.v_adv_off!=0 ) bits |= 8;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( pst->u.pos.adjust!=NULL ) {
- if ( pst->u.pos.adjust->xadjust.corrections!=NULL ) bits |= 0x10;
- if ( pst->u.pos.adjust->yadjust.corrections!=NULL ) bits |= 0x20;
- if ( pst->u.pos.adjust->xadv.corrections!=NULL ) bits |= 0x40;
- if ( pst->u.pos.adjust->yadv.corrections!=NULL ) bits |= 0x80;
- }
-#endif
- ++cnt2;
- break;
- }
- }
- }
- if ( bits==0 ) bits=1;
- if ( cnt!=cnt2 )
- IError( "Count mismatch in dumpGPOSsimplepos#1 %d vs %d\n", cnt, cnt2 );
-
- putshort(gpos,same?1:2); /* 1 means all value records same */
- coverage_pos = ftell(gpos);
- putshort(gpos,0); /* offset to coverage table */
- putshort(gpos,bits);
- if ( same ) {
- if ( bits&1 ) putshort(gpos,first->u.pos.xoff);
- if ( bits&2 ) putshort(gpos,first->u.pos.yoff);
- if ( bits&4 ) putshort(gpos,first->u.pos.h_adv_off);
- if ( bits&8 ) putshort(gpos,first->u.pos.v_adv_off);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( bits&0xf0 ) {
- int next_dev_tab = ftell(gpos)-coverage_pos+2+
- sizeof(int16)*((bits&0x10?1:0) + (bits&0x20?1:0) + (bits&0x40?1:0) + (bits&0x80?1:0));
- if ( bits&0x10 ) { putshort(gpos,next_dev_tab); next_dev_tab += DevTabLen(&first->u.pos.adjust->xadjust); }
- if ( bits&0x20 ) { putshort(gpos,next_dev_tab); next_dev_tab += DevTabLen(&first->u.pos.adjust->yadjust); }
- if ( bits&0x40 ) { putshort(gpos,next_dev_tab); next_dev_tab += DevTabLen(&first->u.pos.adjust->xadv); }
- if ( bits&0x80 ) { putshort(gpos,next_dev_tab); next_dev_tab += DevTabLen(&first->u.pos.adjust->yadv); }
- if ( bits&0x10 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->xadjust);
- if ( bits&0x20 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->yadjust);
- if ( bits&0x40 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->xadv);
- if ( bits&0x80 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->yadv);
- if ( next_dev_tab!=ftell(gpos)-coverage_pos+2 )
- IError( "Device Table offsets wrong in simple positioning 2");
- }
-#endif
- } else {
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- int vr_size =
- sizeof(int16)*((bits&0x1?1:0) + (bits&0x2?1:0) + (bits&0x4?1:0) + (bits&0x8?1:0) +
- (bits&0x10?1:0) + (bits&0x20?1:0) + (bits&0x40?1:0) + (bits&0x80?1:0));
- int next_dev_tab = ftell(gpos)-coverage_pos+2+2+vr_size*cnt;
-#endif
- putshort(gpos,cnt);
- for ( cnt2 = 0; glyphs[cnt2]!=NULL; ++cnt2 ) {
- for ( pst=glyphs[cnt2]->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==sub && pst->type==pst_position ) {
- if ( bits&1 ) putshort(gpos,pst->u.pos.xoff);
- if ( bits&2 ) putshort(gpos,pst->u.pos.yoff);
- if ( bits&4 ) putshort(gpos,pst->u.pos.h_adv_off);
- if ( bits&8 ) putshort(gpos,pst->u.pos.v_adv_off);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- next_dev_tab = gposdumpvaldevtab(gpos,pst->u.pos.adjust,bits,
- next_dev_tab);
-#endif
- break;
- }
- }
- }
- if ( cnt!=cnt2 )
- IError( "Count mismatch in dumpGPOSsimplepos#3 %d vs %d\n", cnt, cnt2 );
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( bits&0xf0 ) {
- for ( cnt2 = 0; glyphs[cnt2]!=NULL; ++cnt2 ) {
- for ( pst=glyphs[cnt2]->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==sub && pst->type==pst_position ) {
- if ( bits&0x10 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->xadjust);
- if ( bits&0x20 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->yadjust);
- if ( bits&0x40 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->xadv);
- if ( bits&0x80 ) dumpgposdevicetable(gpos,&first->u.pos.adjust->yadv);
- }
- }
- }
- }
- if ( next_dev_tab!=ftell(gpos)-coverage_pos+2 )
- IError( "Device Table offsets wrong in simple positioning 2");
-#endif
- }
- end = ftell(gpos);
- fseek(gpos,coverage_pos,SEEK_SET);
- putshort(gpos,end-coverage_pos+2);
- fseek(gpos,end,SEEK_SET);
- dumpcoveragetable(gpos,glyphs);
- fseek(gpos,0,SEEK_END);
- free(glyphs);
-}
-
-struct sckppst {
- uint16 samewas;
- uint16 devtablen;
- uint16 tot;
- uint8 isv;
- uint8 subtable_too_big;
-/* The first few fields are only meaningful in the first structure in the array*/
-/* and provide information about the entire rest of the array */
- uint16 other_gid;
- SplineChar *sc;
- KernPair *kp;
- PST *pst;
-};
-
-static int cmp_gid( const void *_s1, const void *_s2 ) {
- const struct sckppst *s1 = _s1, *s2 = _s2;
-return( ((int) s1->other_gid) - ((int) s2->other_gid) );
-}
-
-static void dumpGPOSpairpos(FILE *gpos,SplineFont *sf,struct lookup_subtable *sub) {
- int cnt;
- int32 coverage_pos, offset_pos, end, start, pos;
- PST *pst;
- KernPair *kp;
- int vf1 = 0, vf2=0, i, j, k, tot, bit_cnt, v;
- int start_cnt, end_cnt;
- int chunk_cnt, chunk_max;
- SplineChar *sc, **glyphs, *gtemp;
- int isr2l = -1;
- struct sckppst **seconds;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- int devtablen;
-#endif
-
- /* Figure out all the data we need. First the glyphs with kerning info */
- /* then the glyphs to which they kern, and by how much */
- glyphs = SFOrderedGlyphsWithPSTinSubtable(sf,sub);
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt);
- seconds = galloc(cnt*sizeof(struct sckppst));
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt) {
- for ( k=0; k<2; ++k ) {
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- devtablen = 0;
-#endif
- tot = 0;
- for ( pst=glyphs[cnt]->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable==sub && pst->type==pst_pair &&
- (sc = SFGetChar(sf,-1,pst->u.pair.paired))!=NULL &&
- sc->ttf_glyph!=-1 ) {
- if ( k ) {
- seconds[cnt][tot].sc = sc;
- seconds[cnt][tot].other_gid = sc->ttf_glyph;
- seconds[cnt][tot].pst = pst;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- devtablen += ValDevTabLen(pst->u.pair.vr[0].adjust) +
- ValDevTabLen(pst->u.pair.vr[1].adjust);
-#endif
- }
- ++tot;
- }
- }
- for ( v=0; v<2; ++v ) {
- for ( kp = v ? glyphs[cnt]->vkerns : glyphs[cnt]->kerns; kp!=NULL; kp=kp->next ) {
- if ( kp->sc->ttf_glyph!=-1 ) {
- if ( k ) {
- seconds[cnt][tot].other_gid = kp->sc->ttf_glyph;
- seconds[cnt][tot].sc = kp->sc;
- seconds[cnt][tot].kp = kp;
- seconds[cnt][tot].isv = v;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- devtablen += DevTabLen(kp->adjust);
-#endif
- }
- ++tot;
- }
- }
- }
- if ( k==0 ) {
- seconds[cnt] = gcalloc(tot+1,sizeof(struct sckppst));
- } else {
- qsort(seconds[cnt],tot,sizeof(struct sckppst),cmp_gid);
- seconds[cnt][0].tot = tot;
- /* Devtablen is 0 unless we are configured for device tables */
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- seconds[cnt][0].devtablen = devtablen;
-#endif
- seconds[cnt][0].samewas = 0xffff;
- }
- }
- }
-
- /* Some fonts do a primitive form of class based kerning, several glyphs */
- /* can share the same list of second glyphs & offsets */
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt) {
- struct sckppst *test = seconds[cnt], *test2;
- for ( i=cnt-1; i>=0; --i ) {
- test2 = seconds[i];
- if ( test[0].tot != test2[0].tot )
- continue;
- for ( j=test[0].tot-1; j>=0; --j ) {
- if ( test[j].other_gid != test2[j].other_gid )
- break;
- if ( test[j].kp!=NULL && test2[j].kp!=NULL &&
- test[j].kp->off == test2[j].kp->off
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- && DevTabsSame(test[j].kp->adjust,test2[j].kp->adjust)
-#endif
- )
- /* So far, so good */;
- else if ( test[j].pst!=NULL && test2[j].pst!=NULL &&
- test[j].pst->u.pair.vr[0].xoff == test2[j].pst->u.pair.vr[0].xoff &&
- test[j].pst->u.pair.vr[0].yoff == test2[j].pst->u.pair.vr[0].yoff &&
- test[j].pst->u.pair.vr[0].h_adv_off == test2[j].pst->u.pair.vr[0].h_adv_off &&
- test[j].pst->u.pair.vr[0].v_adv_off == test2[j].pst->u.pair.vr[0].v_adv_off &&
- test[j].pst->u.pair.vr[1].xoff == test2[j].pst->u.pair.vr[1].xoff &&
- test[j].pst->u.pair.vr[1].yoff == test2[j].pst->u.pair.vr[1].yoff &&
- test[j].pst->u.pair.vr[1].h_adv_off == test2[j].pst->u.pair.vr[1].h_adv_off &&
- test[j].pst->u.pair.vr[1].v_adv_off == test2[j].pst->u.pair.vr[1].v_adv_off
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- && ValDevTabsSame(test[j].pst->u.pair.vr[0].adjust,test2[j].pst->u.pair.vr[0].adjust)
- && ValDevTabsSame(test[j].pst->u.pair.vr[1].adjust,test2[j].pst->u.pair.vr[1].adjust)
-#endif
- )
- /* That's ok too. */;
- else
- break;
- }
- if ( j>=0 )
- continue;
- test2[0].samewas = j;
- break;
- }
- }
-
- /* Ok, how many offsets must we output? Normall kerning will just use */
- /* one offset (with perhaps a device table), but the standard allows */
- /* us to adjust 8 different values (with 8 different device tables) */
- /* Find out which we need */
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt) {
- for ( tot=0 ; tot<seconds[cnt][0].tot; ++tot ) {
- if ( (pst=seconds[cnt][tot].pst)!=NULL ) {
- if ( pst->subtable==sub && pst->type==pst_pair ) {
- if ( pst->u.pair.vr[0].xoff!=0 ) vf1 |= 1;
- if ( pst->u.pair.vr[0].yoff!=0 ) vf1 |= 2;
- if ( pst->u.pair.vr[0].h_adv_off!=0 ) vf1 |= 4;
- if ( pst->u.pair.vr[0].v_adv_off!=0 ) vf1 |= 8;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( pst->u.pair.vr[0].adjust!=NULL ) {
- if ( pst->u.pair.vr[0].adjust->xadjust.corrections!=NULL ) vf1 |= 0x10;
- if ( pst->u.pair.vr[0].adjust->yadjust.corrections!=NULL ) vf1 |= 0x20;
- if ( pst->u.pair.vr[0].adjust->xadv.corrections!=NULL ) vf1 |= 0x40;
- if ( pst->u.pair.vr[0].adjust->yadv.corrections!=NULL ) vf1 |= 0x80;
- }
-#endif
- if ( pst->u.pair.vr[1].xoff!=0 ) vf2 |= 1;
- if ( pst->u.pair.vr[1].yoff!=0 ) vf2 |= 2;
- if ( pst->u.pair.vr[1].h_adv_off!=0 ) vf2 |= 4;
- if ( pst->u.pair.vr[1].v_adv_off!=0 ) vf2 |= 8;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( pst->u.pair.vr[1].adjust!=NULL ) {
- if ( pst->u.pair.vr[1].adjust->xadjust.corrections!=NULL ) vf2 |= 0x10;
- if ( pst->u.pair.vr[1].adjust->yadjust.corrections!=NULL ) vf2 |= 0x20;
- if ( pst->u.pair.vr[1].adjust->xadv.corrections!=NULL ) vf2 |= 0x40;
- if ( pst->u.pair.vr[1].adjust->yadv.corrections!=NULL ) vf2 |= 0x80;
- }
-#endif
- }
- }
- if ( (kp = seconds[cnt][tot].kp)!=NULL ) {
- int mask = 0, mask2=0;
- if ( !seconds[cnt][tot].isv && isr2l==-1 ) {
- SplineChar *sc = seconds[cnt][tot].sc;
- int known_r2l = SCRightToLeft(sc);
- if ( known_r2l )
- isr2l = true;
- else if ( SCScriptFromUnicode(sc)== DEFAULT_SCRIPT )
- continue;
- else
- isr2l = false;
- }
- if ( seconds[cnt][tot].isv )
- mask = 0x0008;
- else if ( isr2l )
- mask2 = 0x0004;
- else
- mask = 0x0004;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( kp->adjust!=NULL ) {
- mask |= mask<<4;
- mask2 |= mask2<<4;
- }
-#endif
- vf1 |= mask;
- vf2 |= mask2;
- }
- }
- }
- if ( isr2l==-1 ) isr2l = 0;
- if ( vf1==0 && vf2==0 ) vf1=1;
- bit_cnt = 0;
- for ( i=0; i<8; ++i ) {
- if ( vf1&(1<<i) ) ++bit_cnt;
- if ( vf2&(1<<i) ) ++bit_cnt;
- }
-
- chunk_max = chunk_cnt = 0;
- for ( start_cnt=0; start_cnt<cnt; start_cnt=end_cnt ) {
- int len = 5*2;
- for ( end_cnt=start_cnt; end_cnt<cnt; ++end_cnt ) {
- int glyph_len = 2; /* For the glyph's offset */
- if ( seconds[end_cnt][0].samewas==0xffff || seconds[end_cnt][0].samewas<start_cnt )
- glyph_len += (bit_cnt*2+2)*seconds[end_cnt][0].tot +
- seconds[end_cnt][0].devtablen;
- if ( glyph_len>65535 && end_cnt==start_cnt ) {
- LogError(_("Lookup subtable %s contains a glyph %s whose kerning information takes up more than 64k bytes\n"),
- sub->subtable_name, glyphs[start_cnt]->name );
- len += glyph_len;
- } else if ( len+glyph_len>65535 ) {
- if( start_cnt==0 )
- LogError(_("Lookup subtable %s had to be split into several subtables\nbecause it was too big.\n"),
- sub->subtable_name );
- break;
- } else
- len += glyph_len;
- }
- if ( start_cnt!=0 || end_cnt!=cnt ) {
- if ( chunk_cnt>=chunk_max )
- sub->extra_subtables = grealloc(sub->extra_subtables,((chunk_max+=10)+1)*sizeof(uint32));
- sub->extra_subtables[chunk_cnt++] = ftell(gpos);
- sub->extra_subtables[chunk_cnt] = -1;
- }
-
- start = ftell(gpos);
- putshort(gpos,1); /* 1 means char pairs (ie. not classes) */
- coverage_pos = ftell(gpos);
- putshort(gpos,0); /* offset to coverage table */
- putshort(gpos,vf1);
- putshort(gpos,vf2);
- putshort(gpos,end_cnt-start_cnt);
- offset_pos = ftell(gpos);
- for ( i=start_cnt; i<end_cnt; ++i )
- putshort(gpos,0); /* Fill in later */
- for ( i=start_cnt; i<end_cnt; ++i ) {
- if ( seconds[i][0].samewas>= start_cnt && seconds[i][0].samewas!=0xffff ) {
- /* It's the same as the glyph at samewas, so just copy the */
- /* offset from there. We don't need to do anything else */
- int offset;
- fseek(gpos,offset_pos+(seconds[i][0].samewas-start_cnt)*sizeof(uint16),SEEK_SET);
- offset = getushort(gpos);
- fseek(gpos,offset_pos+(i-start_cnt)*sizeof(uint16),SEEK_SET);
- putshort(gpos,offset);
- fseek(gpos,0,SEEK_END);
- continue;
- }
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- int next_dev_tab = ftell(gpos)-start;
- if ( (vf1&0xf0) || (vf2&0xf0) ) {
- for ( tot=0 ; tot<seconds[i][0].tot; ++tot ) {
- if ( (pst=seconds[i][tot].pst)!=NULL ) {
- if ( pst->u.pair.vr[0].adjust!=NULL ) {
- dumpgposdevicetable(gpos,&pst->u.pair.vr[0].adjust->xadjust);
- dumpgposdevicetable(gpos,&pst->u.pair.vr[0].adjust->yadjust);
- dumpgposdevicetable(gpos,&pst->u.pair.vr[0].adjust->xadv);
- dumpgposdevicetable(gpos,&pst->u.pair.vr[0].adjust->yadv);
- }
- if ( pst->u.pair.vr[1].adjust!=NULL ) {
- dumpgposdevicetable(gpos,&pst->u.pair.vr[1].adjust->xadjust);
- dumpgposdevicetable(gpos,&pst->u.pair.vr[1].adjust->yadjust);
- dumpgposdevicetable(gpos,&pst->u.pair.vr[1].adjust->xadv);
- dumpgposdevicetable(gpos,&pst->u.pair.vr[1].adjust->yadv);
- }
- }
- if ( (kp=seconds[i][tot].kp)!=NULL && kp->adjust!=NULL )
- dumpgposdevicetable(gpos,kp->adjust);
- }
- }
-#endif
- pos = ftell(gpos);
- fseek(gpos,offset_pos+(i-start_cnt)*sizeof(uint16),SEEK_SET);
- putshort(gpos,pos-start);
- fseek(gpos,pos,SEEK_SET);
-
- putshort(gpos,seconds[i][0].tot);
- for ( tot=0 ; tot<seconds[i][0].tot; ++tot ) {
- putshort(gpos,seconds[i][tot].other_gid);
- if ( (pst=seconds[i][tot].pst)!=NULL ) {
- if ( vf1&1 ) putshort(gpos,pst->u.pair.vr[0].xoff);
- if ( vf1&2 ) putshort(gpos,pst->u.pair.vr[0].yoff);
- if ( vf1&4 ) putshort(gpos,pst->u.pair.vr[0].h_adv_off);
- if ( vf1&8 ) putshort(gpos,pst->u.pair.vr[0].v_adv_off);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- next_dev_tab = gposdumpvaldevtab(gpos,pst->u.pair.vr[0].adjust,vf1,
- next_dev_tab);
-#endif
- if ( vf2&1 ) putshort(gpos,pst->u.pair.vr[1].xoff);
- if ( vf2&2 ) putshort(gpos,pst->u.pair.vr[1].yoff);
- if ( vf2&4 ) putshort(gpos,pst->u.pair.vr[1].h_adv_off);
- if ( vf2&8 ) putshort(gpos,pst->u.pair.vr[1].v_adv_off);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- next_dev_tab = gposdumpvaldevtab(gpos,pst->u.pair.vr[1].adjust,vf2,
- next_dev_tab);
-#endif
- } else if ( (kp=seconds[i][tot].kp)!=NULL ) {
- int mask=0, mask2=0;
- if ( seconds[i][tot].isv )
- mask = 0x8;
- else if ( isr2l )
- mask2 = 0x4;
- else
- mask = 0x4;
- gposvrmaskeddump(gpos,vf1,mask,kp->off);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- next_dev_tab = gposmaskeddumpdevtab(gpos,kp->adjust,vf1,mask<<4,
- next_dev_tab);
-#endif
- gposvrmaskeddump(gpos,vf2,mask2,kp->off);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- next_dev_tab = gposmaskeddumpdevtab(gpos,kp->adjust,vf2,mask2<<4,
- next_dev_tab);
-#endif
- }
- }
- }
- end = ftell(gpos);
- fseek(gpos,coverage_pos,SEEK_SET);
- putshort(gpos,end-start);
- fseek(gpos,end,SEEK_SET);
- gtemp = glyphs[end_cnt]; glyphs[end_cnt] = NULL;
- dumpcoveragetable(gpos,glyphs+start_cnt);
- glyphs[end_cnt] = gtemp;
- }
- for ( i=0; i<cnt; ++i )
- free(seconds[i]);
- free(seconds);
- free(glyphs);
-}
-
-uint16 *ClassesFromNames(SplineFont *sf,char **classnames,int class_cnt,
- int numGlyphs, SplineChar ***glyphs, int apple_kc) {
- uint16 *class;
- int i;
- char *pt, *end, ch;
- SplineChar *sc, **gs=NULL;
- int offset = (apple_kc && classnames[0]!=NULL);
-
- class = gcalloc(numGlyphs,sizeof(uint16));
- if ( glyphs ) *glyphs = gs = gcalloc(numGlyphs,sizeof(SplineChar *));
- for ( i=0; i<class_cnt; ++i ) {
- if ( i==0 && classnames[0]==NULL )
- continue;
- for ( pt = classnames[i]; *pt; pt = end+1 ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- end = strchr(pt,' ');
- if ( end==NULL )
- end = pt+strlen(pt);
- ch = *end;
- *end = '\0';
- sc = SFGetChar(sf,-1,pt);
- if ( sc!=NULL && sc->ttf_glyph!=-1 ) {
- class[sc->ttf_glyph] = i+offset;
- if ( gs!=NULL )
- gs[sc->ttf_glyph] = sc;
- }
- *end = ch;
- if ( ch=='\0' )
- break;
- }
- }
-return( class );
-}
-
-static SplineChar **GlyphsFromClasses(SplineChar **gs, int numGlyphs) {
- int i, cnt;
- SplineChar **glyphs;
-
- for ( i=cnt=0; i<numGlyphs; ++i )
- if ( gs[i]!=NULL ) ++cnt;
- glyphs = galloc((cnt+1)*sizeof(SplineChar *));
- for ( i=cnt=0; i<numGlyphs; ++i )
- if ( gs[i]!=NULL )
- glyphs[cnt++] = gs[i];
- glyphs[cnt++] = NULL;
- free(gs);
-return( glyphs );
-}
-
-static SplineChar **GlyphsFromInitialClasses(SplineChar **gs, int numGlyphs, uint16 *classes, uint16 *initial) {
- int i, j, cnt;
- SplineChar **glyphs;
-
- for ( i=cnt=0; i<numGlyphs; ++i ) {
- for ( j=0; initial[j]!=0xffff; ++j )
- if ( initial[j]==classes[i])
- break;
- if ( initial[j]!=0xffff && gs[i]!=NULL ) ++cnt;
- }
- glyphs = galloc((cnt+1)*sizeof(SplineChar *));
- for ( i=cnt=0; i<numGlyphs; ++i ) {
- for ( j=0; initial[j]!=0xffff; ++j )
- if ( initial[j]==classes[i])
- break;
- if ( initial[j]!=0xffff && gs[i]!=NULL )
- glyphs[cnt++] = gs[i];
- }
- glyphs[cnt++] = NULL;
-return( glyphs );
-}
-
-static void DumpClass(FILE *gpos,uint16 *class,int numGlyphs) {
- int ranges, i, cur, first= -1, last=-1, istart;
-
- for ( i=ranges=0; i<numGlyphs; ) {
- istart = i;
- cur = class[i];
- while ( i<numGlyphs && class[i]==cur )
- ++i;
- if ( cur!=0 ) {
- ++ranges;
- if ( first==-1 ) first = istart;
- last = i-1;
- }
- }
- if ( ranges*3+1>last-first+1+2 || first==-1 ) {
- if ( first==-1 ) first = last = 0;
- putshort(gpos,1); /* Format 1, list of all posibilities */
- putshort(gpos,first);
- putshort(gpos,last-first+1);
- for ( i=first; i<=last ; ++i )
- putshort(gpos,class[i]);
- } else {
- putshort(gpos,2); /* Format 2, series of ranges */
- putshort(gpos,ranges);
- for ( i=0; i<numGlyphs; ) {
- istart = i;
- cur = class[i];
- while ( i<numGlyphs && class[i]==cur )
- ++i;
- if ( cur!=0 ) {
- putshort(gpos,istart);
- putshort(gpos,i-1);
- putshort(gpos,cur);
- }
- }
- }
-}
-
-static int KernClassR2L(SplineFont *sf, KernClass *kc) {
- int i, ch, known_r2l ;
- char *pt, *start;
- SplineChar *sc;
-
- for ( i=1; i<kc->first_cnt; ++i ) {
- for ( start = kc->firsts[i]; *start ; ) {
- for ( pt=start; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- sc = SFGetChar(sf,-1,start);
- *pt = ch;
- if ( sc!=NULL ) {
- known_r2l = SCRightToLeft(sc);
- if ( known_r2l )
-return( true );
- else if ( SCScriptFromUnicode(sc)== DEFAULT_SCRIPT )
- /* Do Nothing */;
- else
-return( false );
- }
- while ( ch==' ' )
- ch = *++pt;
- start = pt;
- }
- }
-
- /* Eh? All the data were non-commital? Well, try the second set of classes*/
- for ( i=1; i<kc->second_cnt; ++i ) {
- for ( start = kc->seconds[i]; *start ; ) {
- for ( pt=start; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- sc = SFGetChar(sf,-1,start);
- *pt = ch;
- if ( sc!=NULL ) {
- known_r2l = SCRightToLeft(sc);
- if ( known_r2l )
-return( true );
- else if ( SCScriptFromUnicode(sc)== DEFAULT_SCRIPT )
- /* Do Nothing */;
- else
-return( false );
- }
- while ( ch==' ' )
- ch = *++pt;
- start = pt;
- }
- }
-
- /* We still don't have any idea? Well, lets just say it's l2r */
-return( false );
-}
-
-static void dumpgposkernclass(FILE *gpos,SplineFont *sf,
- struct lookup_subtable *sub, struct alltabs *at) {
- uint32 begin_off = ftell(gpos), pos;
- uint16 *class1, *class2;
- KernClass *kc = sub->kc, *test;
- SplineChar **glyphs;
- int i, isv, isr2l;
- int anydevtab = false;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- int next_devtab;
-#endif
-
- putshort(gpos,2); /* format 2 of the pair adjustment subtable */
- putshort(gpos,0); /* offset to coverage table */
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- for ( i=0; i<kc->first_cnt*kc->second_cnt; ++i ) {
- if ( kc->adjusts[i].corrections!=NULL ) {
- anydevtab = true;
- break;
- }
- }
-#endif
-
- for ( test=sf->vkerns; test!=NULL && test!=kc; test=test->next );
- isv = test==kc;
- isr2l = KernClassR2L(sf,kc);
-
- if ( isv ) {
- /* As far as I know there is no "bottom to top" writing direction */
- /* Oh. There is. Ogham, Runic */
- putshort(gpos,anydevtab?0x0088:0x0008); /* Alter YAdvance of first character */
- putshort(gpos,0x0000); /* leave second char alone */
- } else if ( isr2l ) {
- /* Right to left kerns modify the second character's width */
- /* this doesn't make sense to me, but who am I to argue */
- putshort(gpos,0x0000); /* leave first char alone */
- putshort(gpos,anydevtab?0x0044:0x0004); /* Alter XAdvance of second character */
- } else {
- putshort(gpos,anydevtab?0x0044:0x0004); /* Alter XAdvance of first character */
- putshort(gpos,0x0000); /* leave second char alone */
- }
- class1 = ClassesFromNames(sf,kc->firsts,kc->first_cnt,at->maxp.numGlyphs,&glyphs,false);
- glyphs = GlyphsFromClasses(glyphs,at->maxp.numGlyphs);
- class2 = ClassesFromNames(sf,kc->seconds,kc->second_cnt,at->maxp.numGlyphs,NULL,false);
- putshort(gpos,0); /* offset to first glyph classes */
- putshort(gpos,0); /* offset to second glyph classes */
- putshort(gpos,kc->first_cnt);
- putshort(gpos,kc->second_cnt);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- next_devtab = ftell(gpos)-begin_off + kc->first_cnt*kc->second_cnt*2*sizeof(uint16);
-#endif
- for ( i=0; i<kc->first_cnt*kc->second_cnt; ++i ) {
- putshort(gpos,kc->offsets[i]);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( anydevtab && kc->adjusts[i].corrections!=NULL ) {
- putshort(gpos,next_devtab);
- next_devtab += DevTabLen(&kc->adjusts[i]);
- } else if ( anydevtab )
- putshort(gpos,0);
-#endif
- }
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( anydevtab ) {
- for ( i=0; i<kc->first_cnt*kc->second_cnt; ++i ) {
- if ( kc->adjusts[i].corrections!=NULL )
- dumpgposdevicetable(gpos,&kc->adjusts[i]);
- }
- if ( next_devtab!=ftell(gpos)-begin_off )
- IError("Device table offsets screwed up in kerning class");
- }
-#endif
- pos = ftell(gpos);
- fseek(gpos,begin_off+4*sizeof(uint16),SEEK_SET);
- putshort(gpos,pos-begin_off);
- fseek(gpos,pos,SEEK_SET);
- DumpClass(gpos,class1,at->maxp.numGlyphs);
-
- pos = ftell(gpos);
- fseek(gpos,begin_off+5*sizeof(uint16),SEEK_SET);
- putshort(gpos,pos-begin_off);
- fseek(gpos,pos,SEEK_SET);
- DumpClass(gpos,class2,at->maxp.numGlyphs);
-
- pos = ftell(gpos);
- fseek(gpos,begin_off+sizeof(uint16),SEEK_SET);
- putshort(gpos,pos-begin_off);
- fseek(gpos,pos,SEEK_SET);
- dumpcoveragetable(gpos,glyphs);
-
- free(glyphs);
- free(class1);
- free(class2);
-}
-
-static void dumpanchor(FILE *gpos,AnchorPoint *ap, int is_ttf ) {
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- int base = ftell(gpos);
-#endif
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( ap->xadjust.corrections!=NULL || ap->yadjust.corrections!=NULL )
- putshort(gpos,3); /* format 3 w/ device tables */
- else
-#endif
- if ( ap->has_ttf_pt && is_ttf )
- putshort(gpos,2); /* format 2 w/ a matching ttf point index */
- else
- putshort(gpos,1); /* Anchor format 1 just location*/
- putshort(gpos,ap->me.x); /* X coord of attachment */
- putshort(gpos,ap->me.y); /* Y coord of attachment */
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( ap->xadjust.corrections!=NULL || ap->yadjust.corrections!=NULL ) {
- putshort(gpos,ap->xadjust.corrections==NULL?0:
- ftell(gpos)-base+4);
- putshort(gpos,ap->yadjust.corrections==NULL?0:
- ftell(gpos)-base+2+DevTabLen(&ap->xadjust));
- dumpgposdevicetable(gpos,&ap->xadjust);
- dumpgposdevicetable(gpos,&ap->yadjust);
- } else
-#endif
- if ( ap->has_ttf_pt && is_ttf )
- putshort(gpos,ap->ttf_pt_index);
-}
-
-static void dumpgposCursiveAttach(FILE *gpos, SplineFont *sf,
- struct lookup_subtable *sub,struct glyphinfo *gi) {
- AnchorClass *ac, *testac;
- SplineChar **entryexit;
- int cnt, offset,j;
- AnchorPoint *ap, *entry, *exit;
- uint32 coverage_offset, start;
-
- ac = NULL;
- for ( testac=sf->anchor; testac!=NULL; testac = testac->next ) {
- if ( testac->subtable == sub ) {
- if ( ac==NULL )
- ac = testac;
- else {
- gwwv_post_error(_("Two cursive anchor classes"),_("Two cursive anchor classes in the same subtable, %s"),
- sub->subtable_name);
- break;
- }
- }
- }
- if ( ac==NULL ) {
- IError( "Missing anchor class for %s", sub->subtable_name );
-return;
- }
- entryexit = EntryExitDecompose(sf,ac,gi);
- if ( entryexit==NULL )
-return;
-
- for ( cnt=0; entryexit[cnt]!=NULL; ++cnt );
-
- start = ftell(gpos);
- putshort(gpos,1); /* format 1 for this subtable */
- putshort(gpos,0); /* Fill in later, offset to coverage table */
- putshort(gpos,cnt); /* number of glyphs */
-
- offset = 6+2*2*cnt;
- for ( j=0; j<cnt; ++j ) {
- entry = exit = NULL;
- for ( ap=entryexit[j]->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor==ac && ap->type==at_centry ) entry = ap;
- if ( ap->anchor==ac && ap->type==at_cexit ) exit = ap;
- }
- if ( entry!=NULL ) {
- putshort(gpos,offset);
- offset += 6;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( entry->xadjust.corrections!=NULL || entry->yadjust.corrections!=NULL )
- offset += 4 + DevTabLen(&entry->xadjust) + DevTabLen(&entry->yadjust);
-#endif
- } else
- putshort(gpos,0);
- if ( exit!=NULL ) {
- putshort(gpos,offset);
- offset += 6;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( exit->xadjust.corrections!=NULL || exit->yadjust.corrections!=NULL )
- offset += 4 + DevTabLen(&exit->xadjust) + DevTabLen(&exit->yadjust);
- else
-#endif
- if ( gi->is_ttf && ap->has_ttf_pt )
- offset += 2;
- } else
- putshort(gpos,0);
- }
- for ( j=0; j<cnt; ++j ) {
- entry = exit = NULL;
- for ( ap=entryexit[j]->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor==ac && ap->type==at_centry ) entry = ap;
- if ( ap->anchor==ac && ap->type==at_cexit ) exit = ap;
- }
- if ( entry!=NULL )
- dumpanchor(gpos,entry,gi->is_ttf);
- if ( exit!=NULL )
- dumpanchor(gpos,exit,gi->is_ttf);
- }
- coverage_offset = ftell(gpos);
- dumpcoveragetable(gpos,entryexit);
- fseek(gpos,start+2,SEEK_SET);
- putshort(gpos,coverage_offset-start);
- fseek(gpos,0,SEEK_END);
-
- free(entryexit);
-}
-
-static int orderglyph(const void *_sc1,const void *_sc2) {
- SplineChar * const *sc1 = _sc1, * const *sc2 = _sc2;
-
-return( (*sc1)->ttf_glyph - (*sc2)->ttf_glyph );
-}
-
-static SplineChar **allmarkglyphs(SplineChar ***glyphlist, int classcnt) {
- SplineChar **glyphs;
- int i, tot, k;
-
- if ( classcnt==1 )
-return( glyphlist[0]);
-
- for ( i=tot=0; i<classcnt; ++i ) {
- for ( k=0; glyphlist[i][k]!=NULL; ++k );
- tot += k;
- }
- glyphs = galloc((tot+1)*sizeof(SplineChar *));
- for ( i=tot=0; i<classcnt; ++i ) {
- for ( k=0; glyphlist[i][k]!=NULL; ++k )
- glyphs[tot++] = glyphlist[i][k];
- }
- qsort(glyphs,tot,sizeof(SplineChar *),orderglyph);
- for ( i=k=0; i<tot; ++i ) {
- while ( i+1<tot && glyphs[i]==glyphs[i+1]) ++i;
- glyphs[k++] = glyphs[i];
- }
- glyphs[k] = NULL;
-return( glyphs );
-}
-
-static void dumpgposAnchorData(FILE *gpos,AnchorClass *_ac,
- enum anchor_type at,
- SplineChar ***marks,SplineChar **base,
- int classcnt, struct glyphinfo *gi) {
- AnchorClass *ac=NULL;
- int j,cnt,k,l, pos, offset, tot, max;
- uint32 coverage_offset, markarray_offset, subtable_start;
- AnchorPoint *ap = NULL, **aps;
- SplineChar **markglyphs;
-
- for ( cnt=0; base[cnt]!=NULL; ++cnt );
-
- subtable_start = ftell(gpos);
- putshort(gpos,1); /* format 1 for this subtable */
- putshort(gpos,0); /* Fill in later, offset to mark coverage table */
- putshort(gpos,0); /* Fill in later, offset to base coverage table */
- putshort(gpos,classcnt);
- putshort(gpos,0); /* Fill in later, offset to mark array */
- putshort(gpos,12); /* Offset to base array */
- /* Base array */
- putshort(gpos,cnt); /* Number of entries in array */
- if ( at==at_basechar || at==at_basemark ) {
- offset = 2;
- for ( l=0; l<3; ++l ) {
- for ( j=0; j<cnt; ++j ) {
- for ( k=0, ac=_ac; k<classcnt; ++k, ac=ac->next ) {
- for ( ap=base[j]->anchor; ap!=NULL && (ap->anchor!=ac || ap->type!=at);
- ap=ap->next );
- switch ( l ) {
- case 0:
- offset += 2;
- break;
- case 1:
- if ( ap==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,offset);
- offset += 6;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( ap->xadjust.corrections!=NULL || ap->yadjust.corrections!=NULL )
- offset += 4 + DevTabLen(&ap->xadjust) + DevTabLen(&ap->yadjust);
- else
-#endif
- if ( gi->is_ttf && ap->has_ttf_pt )
- offset += 2;
- }
- break;
- case 2:
- if ( ap!=NULL )
- dumpanchor(gpos,ap,gi->is_ttf);
- break;
- }
- }
- }
- }
- } else {
- offset = 2+2*cnt;
- max = 0;
- for ( j=0; j<cnt; ++j ) {
- putshort(gpos,offset);
- pos = tot = 0;
- for ( ap=base[j]->anchor; ap!=NULL ; ap=ap->next )
- for ( k=0, ac=_ac; k<classcnt; ++k, ac=ac->next ) {
- if ( ap->anchor==ac ) {
- if ( ap->lig_index>pos ) pos = ap->lig_index;
- ++tot;
- }
- }
- if ( pos>max ) max = pos;
- offset += 2+(pos+1)*classcnt*2+tot*6;
- /* 2 for component count, for each component an offset to an offset to an anchor record */
- }
- ++max;
- aps = galloc((classcnt*max)*sizeof(AnchorPoint *));
- for ( j=0; j<cnt; ++j ) {
- memset(aps,0,(classcnt*max)*sizeof(AnchorPoint *));
- pos = 0;
- for ( ap=base[j]->anchor; ap!=NULL ; ap=ap->next )
- for ( k=0, ac=_ac; k<classcnt; ++k, ac=ac->next ) {
- if ( ap->anchor==ac ) {
- if ( ap->lig_index>pos ) pos = ap->lig_index;
- aps[k*max+ap->lig_index] = ap;
- }
- }
- ++pos;
- putshort(gpos,pos);
- offset = 2+2*pos*classcnt;
- for ( l=0; l<pos; ++l ) {
- for ( k=0; k<classcnt; ++k ) {
- if ( aps[k*max+l]==NULL )
- putshort(gpos,0);
- else {
- putshort(gpos,offset);
- offset += 6;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( aps[k*max+l]->xadjust.corrections!=NULL || aps[k*max+l]->yadjust.corrections!=NULL )
- offset += 4 + DevTabLen(&aps[k*max+l]->xadjust) +
- DevTabLen(&aps[k*max+l]->yadjust);
- else
-#endif
- if ( gi->is_ttf && aps[k*max+l]->has_ttf_pt )
- offset += 2;
- }
- }
- }
- for ( l=0; l<pos; ++l ) {
- for ( k=0; k<classcnt; ++k ) {
- if ( aps[k*max+l]!=NULL ) {
- dumpanchor(gpos,aps[k*max+l],gi->is_ttf);
- }
- }
- }
- }
- free(aps);
- }
- coverage_offset = ftell(gpos);
- fseek(gpos,subtable_start+4,SEEK_SET);
- putshort(gpos,coverage_offset-subtable_start);
- fseek(gpos,0,SEEK_END);
- dumpcoveragetable(gpos,base);
-
- /* We tried sharing the mark table, (among all these sub-tables) but */
- /* that doesn't work because we need to be able to reorder the sub-tables */
- markglyphs = allmarkglyphs(marks,classcnt);
- coverage_offset = ftell(gpos);
- dumpcoveragetable(gpos,markglyphs);
- markarray_offset = ftell(gpos);
- for ( cnt=0; markglyphs[cnt]!=NULL; ++cnt );
- putshort(gpos,cnt);
- offset = 2+4*cnt;
- for ( j=0; j<cnt; ++j ) {
- if ( classcnt==0 ) {
- putshort(gpos,0); /* Only one class */
- ap = NULL;
- } else {
- for ( k=0, ac=_ac; k<classcnt; ac=ac->next ) {
- if ( ac->matches ) {
- for ( ap = markglyphs[j]->anchor; ap!=NULL && (ap->anchor!=ac || ap->type!=at_mark);
- ap=ap->next );
- if ( ap!=NULL )
- break;
- ++k;
- }
- }
- putshort(gpos,k);
- }
- putshort(gpos,offset);
- offset += 6;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( ap!=NULL && (ap->xadjust.corrections!=NULL || ap->yadjust.corrections!=NULL ))
- offset += 4 + DevTabLen(&ap->xadjust) + DevTabLen(&ap->yadjust);
- else
-#endif
- if ( gi->is_ttf && ap->has_ttf_pt )
- offset += 2;
- }
- for ( j=0; j<cnt; ++j ) {
- for ( k=0, ac=_ac; k<classcnt; ac=ac->next ) {
- if ( ac->matches ) {
- for ( ap = markglyphs[j]->anchor; ap!=NULL && (ap->anchor!=ac || ap->type!=at_mark);
- ap=ap->next );
- if ( ap!=NULL )
- break;
- ++k;
- }
- }
- dumpanchor(gpos,ap,gi->is_ttf);
- }
- if ( markglyphs!=marks[0] )
- free(markglyphs);
-
- fseek(gpos,subtable_start+2,SEEK_SET); /* mark coverage table offset */
- putshort(gpos,coverage_offset-subtable_start);
- fseek(gpos,4,SEEK_CUR);
- putshort(gpos,markarray_offset-subtable_start);
-
- fseek(gpos,0,SEEK_END);
-}
-
-static void dumpGSUBsimplesubs(FILE *gsub,SplineFont *sf,struct lookup_subtable *sub) {
- int cnt, diff, ok = true;
- int32 coverage_pos, end;
- SplineChar **glyphs, ***maps;
-
- glyphs = SFOrderedGlyphsWithPSTinSubtable(sf,sub);
- maps = generateMapList(glyphs,sub);
-
- diff = (*maps[0])->ttf_glyph - glyphs[0]->ttf_glyph;
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt)
- if ( diff!= maps[cnt][0]->ttf_glyph-glyphs[cnt]->ttf_glyph ) ok = false;
-
- if ( ok ) {
- putshort(gsub,1); /* delta format */
- coverage_pos = ftell(gsub);
- putshort(gsub,0); /* offset to coverage table */
- putshort(gsub,diff);
- } else {
- putshort(gsub,2); /* glyph list format */
- coverage_pos = ftell(gsub);
- putshort(gsub,0); /* offset to coverage table */
- putshort(gsub,cnt);
- for ( cnt = 0; glyphs[cnt]!=NULL; ++cnt )
- putshort(gsub,(*maps[cnt])->ttf_glyph);
- }
- end = ftell(gsub);
- fseek(gsub,coverage_pos,SEEK_SET);
- putshort(gsub,end-coverage_pos+2);
- fseek(gsub,end,SEEK_SET);
- dumpcoveragetable(gsub,glyphs);
-
- free(glyphs);
- GlyphMapFree(maps);
-}
-
-static void dumpGSUBmultiplesubs(FILE *gsub,SplineFont *sf,struct lookup_subtable *sub) {
- int cnt, offset;
- int32 coverage_pos, end;
- int gc;
- SplineChar **glyphs, ***maps;
-
- glyphs = SFOrderedGlyphsWithPSTinSubtable(sf,sub);
- maps = generateMapList(glyphs,sub);
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt);
-
- putshort(gsub,1); /* glyph list format */
- coverage_pos = ftell(gsub);
- putshort(gsub,0); /* offset to coverage table */
- putshort(gsub,cnt);
- offset = 6+2*cnt;
- for ( cnt = 0; glyphs[cnt]!=NULL; ++cnt ) {
- putshort(gsub,offset);
- for ( gc=0; maps[cnt][gc]!=NULL; ++gc );
- offset += 2+2*gc;
- }
- for ( cnt = 0; glyphs[cnt]!=NULL; ++cnt ) {
- for ( gc=0; maps[cnt][gc]!=NULL; ++gc );
- putshort(gsub,gc);
- for ( gc=0; maps[cnt][gc]!=NULL; ++gc )
- putshort(gsub,maps[cnt][gc]->ttf_glyph);
- }
- end = ftell(gsub);
- fseek(gsub,coverage_pos,SEEK_SET);
- putshort(gsub,end-coverage_pos+2);
- fseek(gsub,end,SEEK_SET);
- dumpcoveragetable(gsub,glyphs);
-
- free(glyphs);
- GlyphMapFree(maps);
-}
-
-static int AllToBeOutput(LigList *lig) {
- struct splinecharlist *cmp;
-
- if ( lig->lig->u.lig.lig->ttf_glyph==-1 ||
- lig->first->ttf_glyph==-1 )
-return( 0 );
- for ( cmp=lig->components; cmp!=NULL; cmp=cmp->next )
- if ( cmp->sc->ttf_glyph==-1 )
-return( 0 );
-return( true );
-}
-
-static void dumpGSUBligdata(FILE *gsub,SplineFont *sf,
- struct lookup_subtable *sub, struct alltabs *at) {
- int32 coverage_pos, next_val_pos, here, lig_list_start;
- int cnt, i, pcnt, lcnt, max=100, j;
- uint16 *offsets=NULL, *ligoffsets=galloc(max*sizeof(uint16));
- SplineChar **glyphs;
- LigList *ll;
- struct splinecharlist *scl;
-
- glyphs = SFOrderedGlyphsWithPSTinSubtable(sf,sub);
- cnt=0;
- if ( glyphs!=NULL ) for ( ; glyphs[cnt]!=NULL; ++cnt );
-
- putshort(gsub,1); /* only one format for ligatures */
- coverage_pos = ftell(gsub);
- putshort(gsub,0); /* offset to coverage table */
- putshort(gsub,cnt);
- next_val_pos = ftell(gsub);
- if ( glyphs!=NULL )
- offsets = galloc(cnt*sizeof(int16));
- for ( i=0; i<cnt; ++i )
- putshort(gsub,0);
- for ( i=0; i<cnt; ++i ) {
- offsets[i] = ftell(gsub)-coverage_pos+2;
- for ( pcnt = 0, ll = glyphs[i]->ligofme; ll!=NULL; ll=ll->next )
- if ( ll->lig->subtable==sub && AllToBeOutput(ll))
- ++pcnt;
- putshort(gsub,pcnt);
- if ( pcnt>=max ) {
- max = pcnt+100;
- ligoffsets = grealloc(ligoffsets,max*sizeof(int));
- }
- lig_list_start = ftell(gsub);
- for ( j=0; j<pcnt; ++j )
- putshort(gsub,0); /* Place holders */
- for ( pcnt=0, ll = glyphs[i]->ligofme; ll!=NULL; ll=ll->next ) {
- if ( ll->lig->subtable==sub && AllToBeOutput(ll)) {
- ligoffsets[pcnt] = ftell(gsub)-lig_list_start+2;
- putshort(gsub,ll->lig->u.lig.lig->ttf_glyph);
- for ( lcnt=0, scl=ll->components; scl!=NULL; scl=scl->next ) ++lcnt;
- putshort(gsub, lcnt+1);
- if ( lcnt+1>at->os2.maxContext )
- at->os2.maxContext = lcnt+1;
- for ( scl=ll->components; scl!=NULL; scl=scl->next )
- putshort(gsub, scl->sc->ttf_glyph );
- ++pcnt;
- }
- }
- fseek(gsub,lig_list_start,SEEK_SET);
- for ( j=0; j<pcnt; ++j )
- putshort(gsub,ligoffsets[j]);
- fseek(gsub,0,SEEK_END);
- }
- free(ligoffsets);
- if ( glyphs!=NULL ) {
- here = ftell(gsub);
- fseek(gsub,coverage_pos,SEEK_SET);
- putshort(gsub,here-coverage_pos+2);
- fseek(gsub,next_val_pos,SEEK_SET);
- for ( i=0; i<cnt; ++i )
- putshort(gsub,offsets[i]);
- fseek(gsub,here,SEEK_SET);
- dumpcoveragetable(gsub,glyphs);
- free(glyphs);
- free(offsets);
- }
-}
-
-static int ui16cmp(const void *_i1, const void *_i2) {
- if ( *(const uint16 *) _i1 > *(const uint16 *) _i2 )
-return( 1 );
- if ( *(const uint16 *) _i1 < *(const uint16 *) _i2 )
-return( -1 );
-
-return( 0 );
-}
-
-static uint16 *FigureInitialClasses(FPST *fpst) {
- uint16 *initial = galloc((fpst->nccnt+1)*sizeof(uint16));
- int i, cnt, j;
-
- for ( i=cnt=0; i<fpst->rule_cnt; ++i ) {
- for ( j=0; j<cnt ; ++j )
- if ( initial[j] == fpst->rules[i].u.class.nclasses[0] )
- break;
- if ( j==cnt )
- initial[cnt++] = fpst->rules[i].u.class.nclasses[0];
- }
- qsort(initial,cnt,sizeof(uint16),ui16cmp);
- initial[cnt] = 0xffff;
-return( initial );
-}
-
-static SplineChar **OrderedInitialGlyphs(SplineFont *sf,FPST *fpst) {
- SplineChar **glyphs, *sc;
- int i, j, cnt, ch;
- char *pt, *names;
-
- glyphs = galloc((fpst->rule_cnt+1)*sizeof(SplineChar *));
- for ( i=cnt=0; i<fpst->rule_cnt; ++i ) {
- names = fpst->rules[i].u.glyph.names;
- pt = strchr(names,' ');
- if ( pt==NULL ) pt = names+strlen(names);
- ch = *pt; *pt = '\0';
- sc = SFGetChar(sf,-1,names);
- *pt = ch;
- for ( j=0; j<cnt; ++j )
- if ( glyphs[j]==sc )
- break;
- if ( j==cnt && sc!=NULL )
- glyphs[cnt++] = sc;
- }
- glyphs[cnt] = NULL;
- if ( cnt==0 )
-return( glyphs );
-
- for ( i=0; glyphs[i+1]!=NULL; ++i ) for ( j=i+1; glyphs[j]!=NULL; ++j ) {
- if ( glyphs[i]->ttf_glyph > glyphs[j]->ttf_glyph ) {
- sc = glyphs[i];
- glyphs[i] = glyphs[j];
- glyphs[j] = sc;
- }
- }
-return( glyphs );
-}
-
-static int NamesStartWith(SplineChar *sc,char *names ) {
- char *pt;
-
- pt = strchr(names,' ');
- if ( pt==NULL ) pt = names+strlen(names);
- if ( pt-names!=strlen(sc->name))
-return( false );
-
-return( strncmp(sc->name,names,pt-names)==0 );
-}
-
-static int CntRulesStartingWith(FPST *fpst,SplineChar *sc) {
- int i, cnt;
-
- for ( i=cnt=0; i<fpst->rule_cnt; ++i ) {
- if ( NamesStartWith(sc,fpst->rules[i].u.glyph.names))
- ++cnt;
- }
-return( cnt );
-}
-
-static int CntRulesStartingWithClass(FPST *fpst,uint16 cval) {
- int i, cnt;
-
- for ( i=cnt=0; i<fpst->rule_cnt; ++i ) {
- if ( fpst->rules[i].u.class.nclasses[0]==cval )
- ++cnt;
- }
-return( cnt );
-}
-
-static void dumpg___ContextChainGlyphs(FILE *lfile,SplineFont *sf,
- struct lookup_subtable *sub, struct alltabs *at) {
- FPST *fpst = sub->fpst;
- int iscontext = fpst->type==pst_contextpos || fpst->type==pst_contextsub;
- uint32 base = ftell(lfile);
- int i,cnt, subcnt, j,k,l, maxcontext,curcontext;
- SplineChar **glyphs, **subglyphs;
- int lc;
-
- glyphs = OrderedInitialGlyphs(sf,fpst);
- for ( cnt=0; glyphs[cnt]!=NULL; ++cnt );
-
- putshort(lfile,1); /* Sub format 1 => glyph lists */
- putshort(lfile,(3+cnt)*sizeof(short)); /* offset to coverage */
- putshort(lfile,cnt);
- for ( i=0; i<cnt; ++i )
- putshort(lfile,0); /* Offset to rule */
- dumpcoveragetable(lfile,glyphs);
-
- maxcontext = 0;
-
- for ( i=0; i<cnt; ++i ) {
- uint32 pos = ftell(lfile);
- fseek(lfile,base+(3+i)*sizeof(short),SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- subcnt = CntRulesStartingWith(fpst,glyphs[i]);
- putshort(lfile,subcnt);
- for ( j=0; j<subcnt; ++j )
- putshort(lfile,0);
- for ( j=k=0; k<fpst->rule_cnt; ++k ) if ( NamesStartWith(glyphs[i],fpst->rules[k].u.glyph.names )) {
- uint32 subpos = ftell(lfile);
- fseek(lfile,pos+(1+j)*sizeof(short),SEEK_SET);
- putshort(lfile,subpos-pos);
- fseek(lfile,subpos,SEEK_SET);
-
- for ( l=lc=0; l<fpst->rules[k].lookup_cnt; ++l )
- if ( fpst->rules[k].lookups[l].lookup->lookup_index!=-1 )
- ++lc;
- if ( iscontext ) {
- subglyphs = SFGlyphsFromNames(sf,fpst->rules[k].u.glyph.names);
- for ( l=0; subglyphs[l]!=NULL; ++l );
- putshort(lfile,l);
- curcontext = l;
- putshort(lfile,lc);
- for ( l=1; subglyphs[l]!=NULL; ++l )
- putshort(lfile,subglyphs[l]->ttf_glyph);
- free(subglyphs);
- } else {
- subglyphs = SFGlyphsFromNames(sf,fpst->rules[k].u.glyph.back);
- for ( l=0; subglyphs[l]!=NULL; ++l );
- putshort(lfile,l);
- curcontext = l;
- for ( l=0; subglyphs[l]!=NULL; ++l )
- putshort(lfile,subglyphs[l]->ttf_glyph);
- free(subglyphs);
- subglyphs = SFGlyphsFromNames(sf,fpst->rules[k].u.glyph.names);
- for ( l=0; subglyphs[l]!=NULL; ++l );
- putshort(lfile,l);
- curcontext += l;
- for ( l=1; subglyphs[l]!=NULL; ++l )
- putshort(lfile,subglyphs[l]->ttf_glyph);
- free(subglyphs);
- subglyphs = SFGlyphsFromNames(sf,fpst->rules[k].u.glyph.fore);
- for ( l=0; subglyphs[l]!=NULL; ++l );
- putshort(lfile,l);
- curcontext += l;
- for ( l=0; subglyphs[l]!=NULL; ++l )
- putshort(lfile,subglyphs[l]->ttf_glyph);
- free(subglyphs);
- putshort(lfile,lc);
- }
- for ( l=0; l<fpst->rules[k].lookup_cnt; ++l )
- if ( fpst->rules[k].lookups[l].lookup->lookup_index!=-1 ) {
- putshort(lfile,fpst->rules[k].lookups[l].seq);
- putshort(lfile,fpst->rules[k].lookups[l].lookup->lookup_index);
- }
- ++j;
- if ( curcontext>maxcontext ) maxcontext = curcontext;
- }
- }
- free(glyphs);
-
- if ( maxcontext>at->os2.maxContext )
- at->os2.maxContext = maxcontext;
-}
-
-static void dumpg___ContextChainClass(FILE *lfile,SplineFont *sf,
- struct lookup_subtable *sub, struct alltabs *at) {
- FPST *fpst = sub->fpst;
- int iscontext = fpst->type==pst_contextpos || fpst->type==pst_contextsub;
- uint32 base = ftell(lfile), rulebase, pos, subpos, npos;
- uint16 *initialclasses, *iclass, *bclass, *lclass;
- SplineChar **iglyphs, **bglyphs, **lglyphs, **glyphs;
- int i,ii,cnt, subcnt, j,k,l , maxcontext,curcontext;
- int lc;
-
- putshort(lfile,2); /* Sub format 2 => class */
- putshort(lfile,0); /* offset to coverage table */
- if ( iscontext )
- putshort(lfile,0); /* offset to input classdef */
- else {
- putshort(lfile,0); /* offset to backtrack classdef */
- putshort(lfile,0); /* offset to input classdef */
- putshort(lfile,0); /* offset to lookahead classdef */
- }
- initialclasses = FigureInitialClasses(fpst);
- putshort(lfile,fpst->nccnt);
- rulebase = ftell(lfile);
- for ( cnt=0; cnt<fpst->nccnt; ++cnt )
- putshort(lfile,0);
-
- iclass = ClassesFromNames(sf,fpst->nclass,fpst->nccnt,at->maxp.numGlyphs,&iglyphs,false);
- lglyphs = bglyphs = NULL; bclass = lclass = NULL;
- if ( !iscontext ) {
- bclass = ClassesFromNames(sf,fpst->bclass,fpst->bccnt,at->maxp.numGlyphs,&bglyphs,false);
- lclass = ClassesFromNames(sf,fpst->fclass,fpst->fccnt,at->maxp.numGlyphs,&lglyphs,false);
- }
- pos = ftell(lfile);
- fseek(lfile,base+sizeof(uint16),SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- glyphs = GlyphsFromInitialClasses(iglyphs,at->maxp.numGlyphs,iclass,initialclasses);
- dumpcoveragetable(lfile,glyphs);
- free(glyphs);
- free(iglyphs); free(bglyphs); free(lglyphs);
-
- if ( iscontext ) {
- pos = ftell(lfile);
- fseek(lfile,base+2*sizeof(uint16),SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- DumpClass(lfile,iclass,at->maxp.numGlyphs);
- free(iclass);
- } else {
- pos = ftell(lfile);
- fseek(lfile,base+2*sizeof(uint16),SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- DumpClass(lfile,bclass,at->maxp.numGlyphs);
- if ( ClassesMatch(fpst->bccnt,fpst->bclass,fpst->nccnt,fpst->nclass)) {
- npos = pos;
- fseek(lfile,base+3*sizeof(uint16),SEEK_SET);
- putshort(lfile,npos-base);
- fseek(lfile,0,SEEK_END);
- } else {
- npos = ftell(lfile);
- fseek(lfile,base+3*sizeof(uint16),SEEK_SET);
- putshort(lfile,npos-base);
- fseek(lfile,npos,SEEK_SET);
- DumpClass(lfile,iclass,at->maxp.numGlyphs);
- }
- if ( ClassesMatch(fpst->fccnt,fpst->fclass,fpst->bccnt,fpst->bclass)) {
- fseek(lfile,base+4*sizeof(uint16),SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,0,SEEK_END);
- } else if ( ClassesMatch(fpst->fccnt,fpst->fclass,fpst->nccnt,fpst->nclass)) {
- fseek(lfile,base+4*sizeof(uint16),SEEK_SET);
- putshort(lfile,npos-base);
- fseek(lfile,0,SEEK_END);
- } else {
- pos = ftell(lfile);
- fseek(lfile,base+4*sizeof(uint16),SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- DumpClass(lfile,lclass,at->maxp.numGlyphs);
- }
- free(iclass); free(bclass); free(lclass);
- }
-
- ii=0;
- for ( i=0; i<fpst->nccnt; ++i ) {
- if ( initialclasses[ii]!=i ) {
- /* This class isn't an initial one, so leave it's rule pointer NULL */
- } else {
- ++ii;
- pos = ftell(lfile);
- fseek(lfile,rulebase+i*sizeof(short),SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- subcnt = CntRulesStartingWithClass(fpst,i);
- putshort(lfile,subcnt);
- for ( j=0; j<subcnt; ++j )
- putshort(lfile,0);
- for ( j=k=0; k<fpst->rule_cnt; ++k ) if ( i==fpst->rules[k].u.class.nclasses[0] ) {
- subpos = ftell(lfile);
- fseek(lfile,pos+(1+j)*sizeof(short),SEEK_SET);
- putshort(lfile,subpos-pos);
- fseek(lfile,subpos,SEEK_SET);
-
- for ( l=lc=0; l<fpst->rules[k].lookup_cnt; ++l )
- if ( fpst->rules[k].lookups[l].lookup->lookup_index!=-1 )
- ++lc;
- if ( iscontext ) {
- putshort(lfile,fpst->rules[k].u.class.ncnt);
- putshort(lfile,lc);
- for ( l=1; l<fpst->rules[k].u.class.ncnt; ++l )
- putshort(lfile,fpst->rules[k].u.class.nclasses[l]);
- } else {
- putshort(lfile,fpst->rules[k].u.class.bcnt);
- for ( l=0; l<fpst->rules[k].u.class.bcnt; ++l )
- putshort(lfile,fpst->rules[k].u.class.bclasses[l]);
- putshort(lfile,fpst->rules[k].u.class.ncnt);
- for ( l=1; l<fpst->rules[k].u.class.ncnt; ++l )
- putshort(lfile,fpst->rules[k].u.class.nclasses[l]);
- putshort(lfile,fpst->rules[k].u.class.fcnt);
- for ( l=0; l<fpst->rules[k].u.class.fcnt; ++l )
- putshort(lfile,fpst->rules[k].u.class.fclasses[l]);
- putshort(lfile,lc);
- }
- for ( l=0; l<fpst->rules[k].lookup_cnt; ++l )
- if ( fpst->rules[k].lookups[l].lookup->lookup_index!=-1 ) {
- putshort(lfile,fpst->rules[k].lookups[l].seq);
- putshort(lfile,fpst->rules[k].lookups[l].lookup->lookup_index);
- }
- ++j;
- }
- }
- }
- free(initialclasses);
-
- maxcontext = 0;
- for ( i=0; i<fpst->rule_cnt; ++i ) {
- curcontext = fpst->rules[i].u.class.ncnt+fpst->rules[i].u.class.bcnt+fpst->rules[i].u.class.fcnt;
- if ( curcontext>maxcontext ) maxcontext = curcontext;
- }
- if ( maxcontext>at->os2.maxContext )
- at->os2.maxContext = maxcontext;
-}
-
-static void dumpg___ContextChainCoverage(FILE *lfile,SplineFont *sf,
- struct lookup_subtable *sub, struct alltabs *at) {
- FPST *fpst = sub->fpst;
- int iscontext = fpst->type==pst_contextpos || fpst->type==pst_contextsub;
- uint32 base = ftell(lfile), ibase=0, lbase, bbase;
- int i, l;
- SplineChar **glyphs;
- int curcontext;
- int lc;
-
- if ( fpst->rule_cnt!=1 )
- IError("Bad rule cnt in coverage context lookup");
- if ( fpst->format==pst_reversecoverage && fpst->rules[0].u.rcoverage.always1!=1 )
- IError("Bad input count in reverse coverage lookup" );
-
- putshort(lfile,3); /* Sub format 3 => coverage */
- for ( l=lc=0; l<fpst->rules[0].lookup_cnt; ++l )
- if ( fpst->rules[0].lookups[l].lookup->lookup_index!=-1 )
- ++lc;
- if ( iscontext ) {
- putshort(lfile,fpst->rules[0].u.coverage.ncnt);
- putshort(lfile,lc);
- for ( i=0; i<fpst->rules[0].u.coverage.ncnt; ++i )
- putshort(lfile,0);
- for ( i=0; i<fpst->rules[0].lookup_cnt; ++i )
- if ( fpst->rules[0].lookups[i].lookup->lookup_index!=-1 ) {
- putshort(lfile,fpst->rules[0].lookups[i].seq);
- putshort(lfile,fpst->rules[0].lookups[i].lookup->lookup_index);
- }
- for ( i=0; i<fpst->rules[0].u.coverage.ncnt; ++i ) {
- uint32 pos = ftell(lfile);
- fseek(lfile,base+6+2*i,SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- glyphs = OrderedGlyphsFromNames(sf,fpst->rules[0].u.coverage.ncovers[i]);
- dumpcoveragetable(lfile,glyphs);
- free(glyphs);
- }
- } else {
- if ( fpst->format==pst_reversecoverage ) {
- ibase = ftell(lfile);
- putshort(lfile,0);
- }
- putshort(lfile,fpst->rules[0].u.coverage.bcnt);
- bbase = ftell(lfile);
- for ( i=0; i<fpst->rules[0].u.coverage.bcnt; ++i )
- putshort(lfile,0);
- if ( fpst->format==pst_coverage ) {
- putshort(lfile,fpst->rules[0].u.coverage.ncnt);
- ibase = ftell(lfile);
- for ( i=0; i<fpst->rules[0].u.coverage.ncnt; ++i )
- putshort(lfile,0);
- }
- putshort(lfile,fpst->rules[0].u.coverage.fcnt);
- lbase = ftell(lfile);
- for ( i=0; i<fpst->rules[0].u.coverage.fcnt; ++i )
- putshort(lfile,0);
- if ( fpst->format==pst_coverage ) {
- putshort(lfile,lc);
- for ( i=0; i<fpst->rules[0].lookup_cnt; ++i )
- if ( fpst->rules[0].lookups[i].lookup->lookup_index!=-1 ) {
- putshort(lfile,fpst->rules[0].lookups[i].seq);
- putshort(lfile,fpst->rules[0].lookups[i].lookup->lookup_index);
- }
- } else { /* reverse coverage */
- glyphs = SFGlyphsFromNames(sf,fpst->rules[0].u.rcoverage.replacements);
- for ( i=0; glyphs[i]!=0; ++i );
- putshort(lfile,i);
- for ( i=0; glyphs[i]!=0; ++i )
- putshort(lfile,glyphs[i]->ttf_glyph);
- }
- for ( i=0; i<fpst->rules[0].u.coverage.ncnt; ++i ) {
- uint32 pos = ftell(lfile);
- fseek(lfile,ibase+2*i,SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- glyphs = OrderedGlyphsFromNames(sf,fpst->rules[0].u.coverage.ncovers[i]);
- dumpcoveragetable(lfile,glyphs);
- free(glyphs);
- }
- for ( i=0; i<fpst->rules[0].u.coverage.bcnt; ++i ) {
- uint32 pos = ftell(lfile);
- fseek(lfile,bbase+2*i,SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- glyphs = OrderedGlyphsFromNames(sf,fpst->rules[0].u.coverage.bcovers[i]);
- dumpcoveragetable(lfile,glyphs);
- free(glyphs);
- }
- for ( i=0; i<fpst->rules[0].u.coverage.fcnt; ++i ) {
- uint32 pos = ftell(lfile);
- fseek(lfile,lbase+2*i,SEEK_SET);
- putshort(lfile,pos-base);
- fseek(lfile,pos,SEEK_SET);
- glyphs = OrderedGlyphsFromNames(sf,fpst->rules[0].u.coverage.fcovers[i]);
- dumpcoveragetable(lfile,glyphs);
- free(glyphs);
- }
- }
-
- curcontext = fpst->rules[0].u.coverage.ncnt+fpst->rules[0].u.coverage.bcnt+fpst->rules[0].u.coverage.fcnt;
- if ( curcontext>at->os2.maxContext )
- at->os2.maxContext = curcontext;
-}
-
-static void dumpg___ContextChain(FILE *lfile,SplineFont *sf,
- struct lookup_subtable *sub, struct alltabs *at) {
- FPST *fpst = sub->fpst;
-
- switch ( fpst->format ) {
- case pst_glyphs:
- dumpg___ContextChainGlyphs(lfile,sf,sub,at);
- break;
- case pst_class:
- dumpg___ContextChainClass(lfile,sf,sub,at);
- break;
- case pst_coverage:
- case pst_reversecoverage:
- dumpg___ContextChainCoverage(lfile,sf,sub,at);
- break;
- }
-
- fseek(lfile,0,SEEK_END);
-
-}
-
-static void AnchorsAway(FILE *lfile,SplineFont *sf,
- struct lookup_subtable *sub, struct glyphinfo *gi ) {
- SplineChar **base, **lig, **mkmk;
- AnchorClass *ac, *acfirst;
- SplineChar ***marks;
- int *subcnts;
- int cmax, classcnt;
- int i;
-
- marks = galloc((cmax=20)*sizeof(SplineChar **));
- subcnts = galloc(cmax*sizeof(int));
-
- classcnt = 0;
- acfirst = NULL;
- for ( ac=sf->anchor; ac!=NULL; ac = ac->next ) {
- ac->matches = false;
- if ( ac->subtable==sub && !ac->processed ) {
- if ( acfirst == NULL )
- acfirst = ac;
- if ( ac->type==act_curs )
- continue;
- else if ( ac->has_mark && ac->has_base ) {
- ac->matches = ac->processed = true;
- ++classcnt;
- }
- }
- }
- if ( classcnt>cmax ) {
- marks = grealloc(marks,(cmax=classcnt+10)*sizeof(SplineChar **));
- subcnts = grealloc(subcnts,cmax*sizeof(int));
- }
- AnchorClassDecompose(sf,acfirst,classcnt,subcnts,marks,&base,&lig,&mkmk,gi);
- switch ( sub->lookup->lookup_type ) {
- case gpos_mark2base:
- if ( marks[0]!=NULL && base!=NULL )
- dumpgposAnchorData(lfile,acfirst,at_basechar,marks,base,classcnt,gi);
- break;
- case gpos_mark2ligature:
- if ( marks[0]!=NULL && lig!=NULL )
- dumpgposAnchorData(lfile,acfirst,at_baselig,marks,lig,classcnt,gi);
- break;
- case gpos_mark2mark:
- if ( marks[0]!=NULL && mkmk!=NULL )
- dumpgposAnchorData(lfile,acfirst,at_basemark,marks,mkmk,classcnt,gi);
- break;
- default:
- break;
- }
- for ( i=0; i<classcnt; ++i )
- free(marks[i]);
- free(base);
- free(lig);
- free(mkmk);
- free(marks);
- free(subcnts);
-}
-
-static int lookup_size_cmp(const void *_l1, const void *_l2) {
- const OTLookup *l1 = _l1, *l2 = _l2;
-return( l1->lookup_length-l2->lookup_length );
-}
-
-static int FPSTRefersToOTL(FPST *fpst,OTLookup *otl) {
- int i, j;
-
- if ( fpst==NULL || fpst->type == pst_reversesub )
-return( false );
- for ( i=0; i<fpst->rule_cnt; ++i ) {
- for ( j=0; j< fpst->rules[i].lookup_cnt; ++j )
- if ( fpst->rules[i].lookups[j].lookup == otl )
-return( true );
- }
-return( false );
-}
-
-static int OnlyMac(OTLookup *otl, OTLookup *all) {
- FeatureScriptLangList *features = otl->features;
- int anymac = 0;
- struct lookup_subtable *sub;
-
- switch ( otl->lookup_type ) {
- /* These two lookup types are mac only */
- case kern_statemachine: case morx_indic: case morx_context: case morx_insert:
-return( true );
- /* These lookup types are OpenType only */
- case gsub_multiple: case gsub_alternate: case gsub_context:
- case gsub_contextchain: case gsub_reversecchain:
- case gpos_single: case gpos_cursive: case gpos_mark2base:
- case gpos_mark2ligature: case gpos_mark2mark:
- case gpos_context: case gpos_contextchain:
-return( false );
- /* These two can be expressed in both, and might be either */
- case gpos_pair: case gsub_single: case gsub_ligature:
- for ( features = otl->features; features!=NULL; features = features->next ) {
- if ( !features->ismac )
-return( false );
- else
- anymac = true;
- }
- /* Either it has no features at all (nested), or all its features */
- /* are mac feature settings. Even if all are mac feature settings it */
- /* might still be used as under control of a contextual feature */
- /* so in both cases check for nested */
- while ( all!=NULL ) {
- if ( all!=otl && !all->unused &&
- (all->lookup_type==gpos_context ||
- all->lookup_type==gpos_contextchain ||
- all->lookup_type==gsub_context ||
- all->lookup_type==gsub_contextchain /*||
- all->lookup_type==gsub_reversecchain*/ )) {
- for ( sub=all->subtables; sub!=NULL; sub=sub->next ) if ( !sub->unused && sub->fpst!=NULL ) {
- if ( FPSTRefersToOTL(sub->fpst,otl) )
-return( false );
- }
- }
- all = all->next;
- default:
- break;
- }
- if ( anymac )
-return( true );
- /* As far as I can tell, this lookup isn't used at all */
- /* Let's output it anyway, just in case we ever support some other */
- /* table that uses GPOS/GSUB lookups (I think JUST) */
-return( false );
- }
- /* Should never get here, but gcc probably thinks we might */
-return( true );
-}
-
-static FILE *G___figureLookups(SplineFont *sf,int is_gpos,
- struct alltabs *at) {
- OTLookup *otl;
- struct lookup_subtable *sub;
- int index, i;
- FILE *final;
- FILE *lfile = tmpfile();
- OTLookup **sizeordered;
- OTLookup *all = is_gpos ? sf->gpos_lookups : sf->gsub_lookups;
- char *buffer;
- int len;
-
- index = 0;
- for ( otl=all; otl!=NULL; otl=otl->next ) {
- if ( otl->unused || OnlyMac(otl,all))
- otl->lookup_index = -1;
- else
- otl->lookup_index = index++;
- }
- for ( otl=all; otl!=NULL; otl=otl->next ) {
- if ( otl->lookup_index!=-1 ) {
- otl->lookup_offset = ftell(lfile);
- for ( sub = otl->subtables; sub!=NULL; sub=sub->next ) {
- sub->extra_subtables = NULL;
- if ( sub->unused )
- sub->subtable_offset = -1;
- else {
- sub->subtable_offset = ftell(lfile);
- switch ( otl->lookup_type ) {
- /* GPOS lookup types */
- case gpos_single:
- dumpGPOSsimplepos(lfile,sf,sub);
- break;
-
- case gpos_pair:
- if ( at->os2.maxContext<2 )
- at->os2.maxContext = 2;
- if ( sub->kc!=NULL )
- dumpgposkernclass(lfile,sf,sub,at);
- else
- dumpGPOSpairpos(lfile,sf,sub);
- break;
-
- case gpos_cursive:
- dumpgposCursiveAttach(lfile,sf,sub,&at->gi);
- break;
-
- case gpos_mark2base:
- case gpos_mark2ligature:
- case gpos_mark2mark:
- AnchorsAway(lfile,sf,sub,&at->gi);
- break;
-
- case gpos_contextchain:
- case gpos_context:
- dumpg___ContextChain(lfile,sf,sub,at);
- break;
-
- /* GSUB lookup types */
- case gsub_single:
- dumpGSUBsimplesubs(lfile,sf,sub);
- break;
-
- case gsub_multiple:
- case gsub_alternate:
- dumpGSUBmultiplesubs(lfile,sf,sub);
- break;
-
- case gsub_ligature:
- dumpGSUBligdata(lfile,sf,sub,at);
- break;
-
- case gsub_contextchain:
- case gsub_context:
- case gsub_reversecchain:
- dumpg___ContextChain(lfile,sf,sub,at);
- break;
- default:
- break;
- }
- if ( ftell(lfile)-sub->subtable_offset==0 ) {
- IError( "Lookup sub table, %s in %s, contains no data.\n",
- sub->subtable_name, sub->lookup->lookup_name );
- sub->unused = true;
- sub->subtable_offset = -1;
- } else if ( sub->extra_subtables==NULL &&
- ftell(lfile)-sub->subtable_offset>65535 )
- IError( "Lookup sub table, %s in %s, is too big. Will not be useable.\n",
- sub->subtable_name, sub->lookup->lookup_name );
- }
- }
- otl->lookup_length = ftell(lfile)-otl->lookup_offset;
- }
- }
- if ( is_gpos )
- AnchorGuessContext(sf,at);
-
- /* We don't need to reorder short files */
- if ( ftell(lfile)<65536 )
-return( lfile );
-
- /* Order the lookups so that the smallest ones come first */
- /* thus we are less likely to need extension tables */
- /* I think it's better to order the entire lookup rather than ordering the*/
- /* subtables -- since the extension subtable would be required for all */
- /* subtables in the lookup, so might as well keep them all together */
- sizeordered = galloc(index*sizeof(OTLookup *));
- for ( otl=is_gpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next )
- if ( otl->lookup_index!=-1 )
- sizeordered[ otl->lookup_index ] = otl;
- qsort(sizeordered,index,sizeof(OTLookup *),lookup_size_cmp);
-
- final = tmpfile();
- buffer = galloc(32768);
- for ( i=0; i<index; ++i ) {
- otl = sizeordered[i];
- fseek(lfile,otl->lookup_offset,SEEK_SET);
- otl->lookup_offset = ftell(final);
- len = otl->lookup_length;
- while ( len>=32768 ) {
- int done = fread(buffer,1,32768,lfile);
- if ( done==EOF )
- break;
- fwrite(buffer,1,done,final);
- len -= done;
- }
- if ( len>0 && len<=32768 ) {
- int done = fread(buffer,1,len,lfile);
- if ( done==EOF )
- break;
- fwrite(buffer,1,done,final);
- }
- }
- free(buffer);
- free(sizeordered);
- fclose(lfile);
-return( final );
-}
-
-struct ginfo {
- int fmax, fcnt;
- struct feat_lookups {
- uint32 tag;
- int lcnt;
- OTLookup **lookups;
- int feature_id; /* Initially consecutive, but may be rearranged by sorting */
- } *feat_lookups;
- int sc;
- struct scriptset {
- uint32 script;
- int lc;
- struct langsys {
- uint32 lang;
- int fc;
- int *feature_id;
- int same_as;
- int32 offset;
- } *langsys;
- } *scripts;
-};
-
-static int FindOrMakeNewFeatureLookup(struct ginfo *ginfo,OTLookup **lookups,
- uint32 tag) {
- int i, j;
-
- for ( i=0; i<ginfo->fcnt; ++i ) {
- if ( ginfo->feat_lookups[i].tag!= tag )
- continue;
- if ( lookups==NULL && ginfo->feat_lookups[i].lookups==NULL ) /* 'size' feature */
-return( i );
- if ( lookups==NULL || ginfo->feat_lookups[i].lookups==NULL )
- continue;
- for ( j=0; lookups[j]!=NULL && ginfo->feat_lookups[i].lookups[j]!=NULL; ++j )
- if ( ginfo->feat_lookups[i].lookups[j]!=lookups[j] )
- break;
- if ( ginfo->feat_lookups[i].lookups[j]==lookups[j] ) {
- free(lookups);
-return( i );
- }
- }
- if ( ginfo->fcnt>=ginfo->fmax )
- ginfo->feat_lookups = grealloc(ginfo->feat_lookups,(ginfo->fmax+=20)*sizeof(struct feat_lookups));
- ginfo->feat_lookups[i].feature_id = i;
- ginfo->feat_lookups[i].tag = tag;
- ginfo->feat_lookups[i].lookups = lookups;
- j=0;
- if ( lookups!=NULL ) for ( ; lookups[j]!=NULL; ++j );
- ginfo->feat_lookups[i].lcnt = j;
- ++ginfo->fcnt;
-return( i );
-}
-
-static int feat_alphabetize(const void *_fl1, const void *_fl2) {
- const struct feat_lookups *fl1 = _fl1, *fl2 = _fl2;
-
- if ( fl1->tag<fl2->tag )
-return( -1 );
- if ( fl1->tag>fl2->tag )
-return( 1 );
-
-return( 0 );
-}
-
-static int numeric_order(const void *_i1, const void *_i2) {
- int i1 = *(const int *) _i1, i2 = *(const int *) _i2;
-
- if ( i1<i2 )
-return( -1 );
- if ( i1>i2 )
-return( 1 );
-
-return( 0 );
-}
-
-static int LangSysMatch(struct scriptset *s,int ils1, int ils2 ) {
- struct langsys *ls1 = &s->langsys[ils1], *ls2 = &s->langsys[ils2];
- int i;
-
- if ( ls1->fc!=ls2->fc )
-return( false );
- for ( i=0; i<ls1->fc; ++i )
- if ( ls1->feature_id[i]!=ls2->feature_id[i] )
-return( false );
-
-return( true );
-}
-
-static void FindFeatures(SplineFont *sf,int is_gpos,struct ginfo *ginfo) {
- uint32 *scripts, *langs, *features;
- OTLookup **lookups;
- int sc, lc, fc, j;
-
- memset(ginfo,0,sizeof(struct ginfo));
-
- scripts = SFScriptsInLookups(sf,is_gpos);
- if ( scripts==NULL ) /* All lookups unused */
-return;
- for ( sc=0; scripts[sc]!=0; ++sc );
- ginfo->scripts = galloc(sc*sizeof(struct scriptset));
- ginfo->sc = sc;
- for ( sc=0; scripts[sc]!=0; ++sc ) {
- langs = SFLangsInScript(sf,is_gpos,scripts[sc]);
- for ( lc=0; langs[lc]!=0; ++lc );
- ginfo->scripts[sc].script = scripts[sc];
- ginfo->scripts[sc].lc = lc;
- ginfo->scripts[sc].langsys = galloc(lc*sizeof(struct langsys));
- for ( lc=0; langs[lc]!=0; ++lc ) {
- features = SFFeaturesInScriptLang(sf,is_gpos,scripts[sc],langs[lc]);
- for ( fc=0; features[fc]!=0; ++fc );
- ginfo->scripts[sc].langsys[lc].lang = langs[lc];
- ginfo->scripts[sc].langsys[lc].fc = fc;
- ginfo->scripts[sc].langsys[lc].feature_id = galloc(fc*sizeof(int));
- ginfo->scripts[sc].langsys[lc].same_as = -1;
- for ( fc=0; features[fc]!=0; ++fc ) {
- lookups = SFLookupsInScriptLangFeature(sf,is_gpos,scripts[sc],langs[lc],features[fc]);
- ginfo->scripts[sc].langsys[lc].feature_id[fc] =
- FindOrMakeNewFeatureLookup(ginfo,lookups,features[fc]);
- /* lookups is freed or used by FindOrMakeNewFeatureLookup */
- }
- free(features);
- }
- free(langs);
- }
- free(scripts);
-
- qsort(ginfo->feat_lookups,ginfo->fcnt,sizeof(struct feat_lookups),feat_alphabetize);
-
- /* Now we've disordered the features. Find each feature_id and turn it back*/
- /* into a feature number */
- for ( sc=0; sc<ginfo->sc; ++sc ) {
- for ( lc=0; lc<ginfo->scripts[sc].lc; ++lc ) {
- int fcmax = ginfo->scripts[sc].langsys[lc].fc;
- int *feature_id = ginfo->scripts[sc].langsys[lc].feature_id;
- for ( fc=0; fc<fcmax; ++fc ) {
- int id = feature_id[fc];
- for ( j=0; j<ginfo->fcnt; ++j )
- if ( id==ginfo->feat_lookups[j].feature_id )
- break;
- feature_id[fc] = j;
- }
- qsort(feature_id,fcmax,sizeof(int),numeric_order);
- }
- /* See if there are langsys tables which use exactly the same features*/
- /* They can use the same entry in the file. This optimization seems */
- /* to be required for Japanese vertical writing to work in Uniscribe.*/
- for ( lc=0; lc<ginfo->scripts[sc].lc; ++lc ) {
- for ( j=0; j<lc; ++j )
- if ( LangSysMatch(&ginfo->scripts[sc],j,lc) ) {
- ginfo->scripts[sc].langsys[lc].same_as = j;
- break;
- }
- }
- }
-}
-
-
-static void dump_script_table(FILE *g___,struct scriptset *ss,struct ginfo *ginfo) {
- int i, lcnt, dflt_lang = -1;
- uint32 base;
- int j, req_index;
- uint32 offset;
-
- /* Count the languages, and find default */
- for ( lcnt=0; lcnt<ss->lc; ++lcnt )
- if ( ss->langsys[lcnt].lang==DEFAULT_LANG )
- dflt_lang = lcnt;
- if ( dflt_lang != -1 )
- --lcnt;
-
- base = ftell(g___);
- putshort(g___, 0 ); /* fill in later, Default Lang Sys */
- putshort(g___,lcnt);
- for ( i=0; i<ss->lc; ++i ) if ( i!=dflt_lang ) {
- putlong(g___,ss->langsys[i].lang); /* Language tag */
- putshort(g___,0); /* Fill in later, offset to langsys */
- }
-
- for ( lcnt=0; lcnt<ss->lc; ++lcnt ) {
- if ( ss->langsys[lcnt].same_as!=-1 )
- offset = ss->langsys[ ss->langsys[lcnt].same_as ].offset;
- else {
- offset = ftell(g___);
- ss->langsys[lcnt].offset = offset;
- }
- fseek(g___,lcnt==dflt_lang ? base :
- lcnt<dflt_lang ? base + 4 + lcnt*6 +4 :
- base + 4 + (lcnt-1)*6 +4 , SEEK_SET );
- putshort(g___,offset-base);
- fseek(g___,0,SEEK_END);
- if ( ss->langsys[lcnt].same_as==-1 ) {
- req_index = -1;
- for ( j=0; j<ss->langsys[lcnt].fc; ++j ) {
- if ( ginfo->feat_lookups[ ss->langsys[lcnt].feature_id[j] ].tag == REQUIRED_FEATURE ) {
- req_index = ss->langsys[lcnt].feature_id[j];
- break;
- }
- }
- putshort(g___,0); /* LookupOrder, always NULL */
- putshort(g___,req_index); /* index of required feature, if any */
- putshort(g___,ss->langsys[lcnt].fc - (req_index!=-1));
- /* count of non-required features */
- for ( j=0; j<ss->langsys[lcnt].fc; ++j ) if ( j!=req_index )
- putshort(g___,ss->langsys[lcnt].feature_id[j]);
- }
- }
-}
-
-static FILE *g___FigureExtensionSubTables(OTLookup *all,int startoffset,int is_gpos) {
- OTLookup *otf;
- struct lookup_subtable *sub;
- int len, len2, gotmore;
- FILE *efile;
- int i, offset, cnt;
- int any= false;
-
- if ( all==NULL )
-return( NULL );
- gotmore = true; cnt=len=0;
- while ( gotmore ) {
- gotmore = false;
- offset = startoffset + 8*cnt;
- for ( otf=all; otf!=NULL; otf=otf->next ) if ( otf->lookup_index!=-1 ) {
- if ( otf->needs_extension )
- continue;
- for ( sub = otf->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub->subtable_offset==-1 )
- continue;
- if ( sub->extra_subtables!=NULL ) {
- for ( i=0; sub->extra_subtables[i]!=-1; ++i ) {
- if ( sub->extra_subtables[i]+offset>65535 )
- break;
- }
- if ( sub->extra_subtables[i]!=-1 )
- break;
- } else if ( sub->subtable_offset+offset>65535 )
- break;
- }
- if ( sub!=NULL ) {
- if ( !any ) {
- ff_post_notice(_("Lookup potentially too big"),
- _("Lookup %s has an\noffset bigger than 65535 bytes. This means\nFontForge must use an extension lookup to output it.\nNot all applications support extension lookups."),
- otf->lookup_name );
- any = true;
- }
- otf->needs_extension = true;
- gotmore = true;
- len += 8*otf->subcnt;
- ++cnt;
- }
- offset -= 6+2*otf->subcnt;
- }
- }
-
- if ( cnt==0 ) /* No offset overflows */
-return( NULL );
-
- /* Now we've worked out which lookups need extension tables and marked them*/
- /* Generate the extension tables, and update the offsets to reflect the size */
- /* of the extensions */
- efile = tmpfile();
-
- len2 = 0;
- for ( otf=all; otf!=NULL; otf=otf->next ) if ( otf->lookup_index!=-1 ) {
- if ( otf->needs_extension ) {
- putshort(efile,1); /* exten subtable format (there's only one) */
- putshort(efile,otf->lookup_type&0xff);
- }
- for ( sub = otf->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub->subtable_offset==-1 )
- continue;
- if ( sub->extra_subtables!=NULL ) {
- for ( i=0; sub->extra_subtables[i]!=-1; ++i ) {
- sub->extra_subtables[i] += len;
- if ( otf->needs_extension ) {
- int off = ftell(efile);
- putshort(efile,1); /* exten subtable format (there's only one) */
- putshort(efile,otf->lookup_type&0xff);
- putlong(efile,sub->extra_subtables[i]-len2);
- sub->extra_subtables[i] = off;
- len2+=8;
- }
- }
- } else {
- sub->subtable_offset += len;
- if ( otf->needs_extension ) {
- int off = ftell(efile);
- putshort(efile,1); /* exten subtable format (there's only one) */
- putshort(efile,otf->lookup_type&0xff);
- putlong(efile,sub->subtable_offset-len2);
- sub->subtable_offset = off;
- len2+=8;
- }
- }
- }
- }
-
-return( efile );
-}
-
-static FILE *dumpg___info(struct alltabs *at, SplineFont *sf,int is_gpos) {
- /* Dump out either a gpos or a gsub table. gpos handles kerns, gsub ligs */
- /* we assume that SFFindUnusedLookups has been called */
- FILE *lfile, *g___, *efile;
- uint32 lookup_list_table_start, feature_list_table_start, here, scripts_start_offset;
- struct ginfo ginfo;
- int32 size_params_loc, size_params_ptr;
- int i,j, cnt, scnt, offset;
- OTLookup *otf, *all;
- struct lookup_subtable *sub;
- char *buf;
-
- FindFeatures(sf,is_gpos,&ginfo);
- if ( ginfo.sc==0 )
-return( NULL );
- lfile = G___figureLookups(sf,is_gpos,at);
-
- if ( ginfo.sc==0 && ftell(lfile)==0 ) {
- /* ftell(lfile)==0 => There are no lookups for this table */
- /* ginfo.sc==0 => There are no scripts. */
- /* If both are true then we don't need to output the table */
- /* It is perfectly possible to have lookups without scripts */
- /* (if some other table refered to them -- we don't currently */
- /* support this, but we might some day). */
- /* It is also possible to have scripts without lookups (to get */
- /* around a bug in Uniscribe which only processes some scripts */
- /* if both GPOS and GSUB entries are present. So we share scripts */
- /* between the two tables */
- fclose(lfile);
- /* if ginfo.sc==0 then there will be nothing to free in the ginfo struct*/
-return( NULL );
- }
-
- g___ = tmpfile();
-
- putlong(g___,0x10000); /* version number */
- putshort(g___,10); /* offset to script table */
- putshort(g___,0); /* offset to features. Come back for this */
- putshort(g___,0); /* offset to lookups. Come back for this */
-/* Now the scripts */
- scripts_start_offset = ftell(g___);
- putshort(g___,ginfo.sc);
- for ( i=0; i<ginfo.sc; ++i ) {
- putlong(g___,ginfo.scripts[i].script);
- putshort(g___,0); /* fix up later */
- }
-
- /* Ok, that was the script_list_table which gives each script an offset */
- /* Now for each script we provide a Script table which contains an */
- /* offset to a bunch of features for the default language, and a */
- /* a more complex situation for non-default languages. */
- offset=2+4; /* To the script pointer at the start of table */
- for ( i=0; i<ginfo.sc; ++i ) {
- here = ftell(g___);
- fseek(g___,scripts_start_offset+offset,SEEK_SET);
- putshort(g___,here-scripts_start_offset);
- offset+=6;
- fseek(g___,here,SEEK_SET);
- dump_script_table(g___,&ginfo.scripts[i],&ginfo);
- }
- /* And that should finish all the scripts/languages */
-
- /* so free the ginfo script/lang data */
- for ( i=0; i<ginfo.sc; ++i ) {
- for ( j=0; j<ginfo.scripts[i].lc; ++j ) {
- free( ginfo.scripts[i].langsys[j].feature_id );
- }
- free( ginfo.scripts[i].langsys );
- }
- free( ginfo.scripts );
-
-/* Now the features */
- feature_list_table_start = ftell(g___);
- fseek(g___,6,SEEK_SET);
- putshort(g___,feature_list_table_start);
- fseek(g___,0,SEEK_END);
- putshort(g___,ginfo.fcnt); /* Number of features */
- offset = 2+6*ginfo.fcnt; /* Offset to start of first feature table from beginning of feature_list */
- for ( i=0; i<ginfo.fcnt; ++i ) {
- putlong(g___,ginfo.feat_lookups[i].tag);
- putshort(g___,offset);
- offset += 4+2*ginfo.feat_lookups[i].lcnt;
- }
- /* for each feature, one feature table */
- size_params_ptr = 0;
- for ( i=0; i<ginfo.fcnt; ++i ) {
- if ( ginfo.feat_lookups[i].tag==CHR('s','i','z','e') )
- size_params_ptr = ftell(g___);
- putshort(g___,0); /* No feature params (we'll come back for 'size') */
- putshort(g___,ginfo.feat_lookups[i].lcnt);/* this many lookups */
- for ( j=0; j<ginfo.feat_lookups[i].lcnt; ++j )
- putshort(g___,ginfo.feat_lookups[i].lookups[j]->lookup_index );
- /* index of each lookup */
- }
- if ( size_params_ptr!=0 ) {
- size_params_loc = ftell(g___);
- fseek(g___,size_params_ptr,SEEK_SET);
- /* When Adobe first released fonts containing the 'size' feature */
- /* they did not follow the spec, and the offset to the size parameters */
- /* was relative to the wrong location. They claim (Aug 2006) that */
- /* this has been fixed. FF used to do what Adobe did. Many programs */
- /* expect broken sizes tables now. Therefore allow the user to chose */
- /* which kind to output */
-#if 0
- putshort(g___,size_params_loc-((at->gi.flags&ttf_flag_brokensize)?feature_list_table_start:size_params_ptr));
-#else
- putshort(g___,size_params_loc-size_params_ptr);
-#endif
- fseek(g___,size_params_loc,SEEK_SET);
- putshort(g___,sf->design_size);
- if ( sf->fontstyle_id!=0 || sf->fontstyle_name!=NULL ||
- sf->design_range_bottom!=0 || sf->design_range_top!=0 ) {
- putshort(g___,sf->fontstyle_id);
- at->fontstyle_name_strid = at->next_strid++;
- putshort(g___,at->fontstyle_name_strid);
- putshort(g___,sf->design_range_bottom);
- putshort(g___,sf->design_range_top);
- } else {
- putshort(g___,0);
- putshort(g___,0);
- putshort(g___,0);
- putshort(g___,0);
- }
- }
- /* And that should finish all the features */
-
- /* so free the ginfo feature data */
- for ( i=0; i<ginfo.fcnt; ++i )
- free( ginfo.feat_lookups[i].lookups );
- free( ginfo.feat_lookups );
-
-/* Now the lookups */
- all = is_gpos ? sf->gpos_lookups : sf->gsub_lookups;
- for ( cnt=0, otf = all; otf!=NULL; otf=otf->next ) {
- if ( otf->lookup_index!=-1 )
- ++cnt;
- }
- lookup_list_table_start = ftell(g___);
- fseek(g___,8,SEEK_SET);
- putshort(g___,lookup_list_table_start);
- fseek(g___,0,SEEK_END);
- putshort(g___,cnt);
- offset = 2+2*cnt; /* Offset to start of first lookup table from beginning of lookup list */
- for ( otf = all; otf!=NULL; otf=otf->next ) if ( otf->lookup_index!=-1 ) {
- putshort(g___,offset);
- for ( scnt=0, sub = otf->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub->subtable_offset==-1 )
- continue;
- else if ( sub->extra_subtables!=NULL ) {
- for ( i=0; sub->extra_subtables[i]!=-1; ++i )
- ++scnt;
- } else
- ++scnt;
- }
- otf->subcnt = scnt;
- offset += 6+2*scnt; /* 6 bytes header +2 per lookup */
- }
- offset -= 2+2*cnt;
- /* now the lookup tables */
- /* do we need any extension sub-tables? */
- efile=g___FigureExtensionSubTables(all,offset,is_gpos);
- for ( otf = all; otf!=NULL; otf=otf->next ) if ( otf->lookup_index!=-1 ) {
- putshort(g___,!otf->needs_extension ? (otf->lookup_type&0xff)
- : is_gpos ? 9 : 7);
- putshort(g___,otf->lookup_flags);
- putshort(g___,otf->subcnt);
- for ( sub = otf->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub->subtable_offset==-1 )
- continue;
- else if ( sub->extra_subtables!=NULL ) {
- for ( i=0; sub->extra_subtables[i]!=-1; ++i )
- putshort(g___,offset+sub->extra_subtables[i]);
- } else
- putshort(g___,offset+sub->subtable_offset);
-
- /* Offset to lookup data which is in the temp file */
- /* we keep adjusting offset so it reflects the distance between */
- /* here and the place where the temp file will start, and then */
- /* we need to skip l->offset bytes in the temp file */
- /* If it's a big GPOS/SUB table we may also need some extension */
- /* pointers, but FigureExtension will adjust for that */
- }
- offset -= 6+2*otf->subcnt;
- }
-
- buf = galloc(8096);
- if ( efile!=NULL ) {
- rewind(efile);
- while ( (i=fread(buf,1,8096,efile))>0 )
- fwrite(buf,1,i,g___);
- fclose(efile);
- }
- rewind(lfile);
- while ( (i=fread(buf,1,8096,lfile))>0 )
- fwrite(buf,1,i,g___);
- fclose(lfile);
- free(buf);
- for ( otf = all; otf!=NULL; otf=otf->next ) if ( otf->lookup_index!=-1 ) {
- for ( sub = otf->subtables; sub!=NULL; sub=sub->next ) {
- free(sub->extra_subtables);
- sub->extra_subtables = NULL;
- }
- }
-return( g___ );
-}
-
-void otf_dumpgpos(struct alltabs *at, SplineFont *sf) {
- /* Open Type, bless its annoying little heart, doesn't store kern info */
- /* in the kern table. Of course not, how silly of me to think it might */
- /* be consistent. It stores it in the much more complicated gpos table */
- AnchorClass *ac;
-
- for ( ac=sf->anchor; ac!=NULL; ac=ac->next )
- ac->processed = false;
-
- at->gpos = dumpg___info(at, sf,true);
- if ( at->gpos!=NULL ) {
- at->gposlen = ftell(at->gpos);
- if ( at->gposlen&1 ) putc('\0',at->gpos);
- if ( (at->gposlen+1)&2 ) putshort(at->gpos,0);
- }
-}
-
-void otf_dumpgsub(struct alltabs *at, SplineFont *sf) {
- /* substitutions such as: Ligatures, cjk vertical rotation replacement, */
- /* arabic forms, small caps, ... */
- SFLigaturePrepare(sf);
- at->gsub = dumpg___info(at, sf, false);
- if ( at->gsub!=NULL ) {
- at->gsublen = ftell(at->gsub);
- if ( at->gsublen&1 ) putc('\0',at->gsub);
- if ( (at->gsublen+1)&2 ) putshort(at->gsub,0);
- }
- SFLigatureCleanup(sf);
-}
-
-static int LigCaretCnt(SplineChar *sc) {
- PST *pst;
-
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_lcaret )
-return( pst->u.lcaret.cnt );
- }
-return( 0 );
-}
-
-static void DumpLigCarets(FILE *gdef,SplineChar *sc) {
- PST *pst;
- int i, j, offset;
-
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_lcaret )
- break;
- }
- if ( pst==NULL )
-return;
-
- if ( SCRightToLeft(sc) ) {
- for ( i=0; i<pst->u.lcaret.cnt-1; ++i )
- for ( j=i+1; j<pst->u.lcaret.cnt; ++j )
- if ( pst->u.lcaret.carets[i]<pst->u.lcaret.carets[j] ) {
- int16 temp = pst->u.lcaret.carets[i];
- pst->u.lcaret.carets[i] = pst->u.lcaret.carets[j];
- pst->u.lcaret.carets[j] = temp;
- }
- } else {
- for ( i=0; i<pst->u.lcaret.cnt-1; ++i )
- for ( j=i+1; j<pst->u.lcaret.cnt; ++j )
- if ( pst->u.lcaret.carets[i]>pst->u.lcaret.carets[j] ) {
- int16 temp = pst->u.lcaret.carets[i];
- pst->u.lcaret.carets[i] = pst->u.lcaret.carets[j];
- pst->u.lcaret.carets[j] = temp;
- }
- }
-
- putshort(gdef,pst->u.lcaret.cnt); /* this many carets */
- offset = sizeof(uint16) + sizeof(uint16)*pst->u.lcaret.cnt;
- for ( i=0; i<pst->u.lcaret.cnt; ++i ) {
- putshort(gdef,offset);
- offset+=4;
- }
- for ( i=0; i<pst->u.lcaret.cnt; ++i ) {
- putshort(gdef,1); /* Format 1 */
- putshort(gdef,pst->u.lcaret.carets[i]);
- }
-}
-
-int gdefclass(SplineChar *sc) {
- PST *pst;
- AnchorPoint *ap;
-
- if ( sc->glyph_class!=0 )
-return( sc->glyph_class-1 );
-
- if ( strcmp(sc->name,".notdef")==0 )
-return( 0 );
-
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_ligature )
-return( 2 ); /* Ligature */
- }
-
- ap=sc->anchor;
- while ( ap!=NULL && (ap->type==at_centry || ap->type==at_cexit) )
- ap = ap->next;
- if ( ap!=NULL && (ap->type==at_mark || ap->type==at_basemark) )
-return( 3 );
- else
-return( 1 );
- /* I not quite sure what a componant glyph is. Probably something that */
- /* is not in the cmap table and is referenced in other glyphs */
- /* Anyway I never return class 4 */ /* (I've never seen it used by others) */
-}
-
-void otf_dumpgdef(struct alltabs *at, SplineFont *sf) {
- /* In spite of what the open type docs say, this table does appear to be */
- /* required (at least the glyph class def table) if we do mark to base */
- /* positioning */
- /* I was wondering at the apperant contradiction: something can be both a */
- /* base glyph and a ligature component, but it appears that the component*/
- /* class is unused and everything is a base unless it is a ligature or */
- /* mark */
- /* All my example fonts ignore the attachment list subtable and the mark */
- /* attach class def subtable, so I shall too */
- /* Ah. Some indic fonts need the mark attach class subtable for greater */
- /* control of lookup flags */
- /* All my example fonts contain a ligature caret list subtable, which is */
- /* empty. Odd, but perhaps important */
- PST *pst;
- int i,j,k, lcnt, needsclass;
- int pos, offset;
- int cnt, start, last, lastval;
- SplineChar **glyphs, *sc;
-
- /* Don't look in the cidmaster if we are only dumping one subfont */
- if ( sf->cidmaster && sf->cidmaster->glyphs!=NULL ) sf = sf->cidmaster;
- else if ( sf->mm!=NULL ) sf=sf->mm->normal;
-
- glyphs = NULL;
- for ( k=0; k<2; ++k ) {
- lcnt = 0;
- needsclass = false;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- SplineChar *sc = sf->glyphs[at->gi.bygid[i]];
- if ( sc->glyph_class!=0 || gdefclass(sc)!=1 )
- needsclass = true;
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_lcaret ) {
- for ( j=pst->u.lcaret.cnt-1; j>=0; --j )
- if ( pst->u.lcaret.carets[j]!=0 )
- break;
- if ( j!=-1 )
- break;
- }
- }
- if ( pst!=NULL ) {
- if ( glyphs!=NULL ) glyphs[lcnt] = sc;
- ++lcnt;
- }
- }
- if ( lcnt==0 )
- break;
- if ( glyphs!=NULL )
- break;
- glyphs = galloc((lcnt+1)*sizeof(SplineChar *));
- glyphs[lcnt] = NULL;
- }
- if ( !needsclass && lcnt==0 && sf->mark_class_cnt==0 )
-return; /* No anchor positioning, no ligature carets */
-
- at->gdef = tmpfile();
- putlong(at->gdef,0x00010000); /* Version */
- putshort(at->gdef, needsclass ? 12 : 0 ); /* glyph class defn table */
- putshort(at->gdef, 0 ); /* attachment list table */
- putshort(at->gdef, 0 ); /* ligature caret table (come back and fix up later) */
- putshort(at->gdef, 0 ); /* mark attachment class table */
-
- /* Glyph class subtable */
- if ( needsclass ) {
- /* Mark shouldn't conflict with anything */
- /* Ligature is more important than Base */
- /* Component is not used */
-#if 1 /* ttx can't seem to support class format type 1 so let's output type 2 */
- for ( j=0; j<2; ++j ) {
- cnt = 0;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- sc = sf->glyphs[at->gi.bygid[i]];
- if ( sc!=NULL && sc->ttf_glyph!=-1 ) {
- lastval = gdefclass(sc);
- start = last = i;
- for ( ; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- sc = sf->glyphs[at->gi.bygid[i]];
- if ( gdefclass(sc)!=lastval )
- break;
- last = i;
- }
- --i;
- if ( lastval!=0 ) {
- if ( j==1 ) {
- putshort(at->gdef,start);
- putshort(at->gdef,last);
- putshort(at->gdef,lastval);
- }
- ++cnt;
- }
- }
- }
- if ( j==0 ) {
- putshort(at->gdef,2); /* class format 2, range list by class */
- putshort(at->gdef,cnt);
- }
- }
-#else
- putshort(at->gdef,1); /* class format 1 complete list of glyphs */
- putshort(at->gdef,0); /* First glyph */
- putshort(at->gdef,at->maxp.numGlyphs );
- j=0;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- for ( ; j<i; ++j )
- putshort(at->gdef,1); /* Any hidden characters (like notdef) default to base */
- putshort(at->gdef,gdefclass(sf->glyphs[at->gi.bygid[i]]));
- ++j;
- }
-#endif
- }
-
- /* Ligature caret subtable. Always include this if we have a GDEF */
- pos = ftell(at->gdef);
- fseek(at->gdef,8,SEEK_SET); /* location of lig caret table offset */
- putshort(at->gdef,pos);
- fseek(at->gdef,0,SEEK_END);
- if ( lcnt==0 ) {
- /* It always seems to be present, even if empty */
- putshort(at->gdef,4); /* Offset to (empty) coverage table */
- putshort(at->gdef,0); /* no ligatures */
- putshort(at->gdef,2); /* coverage table format 2 */
- putshort(at->gdef,0); /* no ranges in coverage table */
- } else {
- pos = ftell(at->gdef); /* coverage location */
- putshort(at->gdef,0); /* Offset to coverage table (fix up later) */
- putshort(at->gdef,lcnt);
- offset = 2*lcnt+4;
- for ( i=0; i<lcnt; ++i ) {
- putshort(at->gdef,offset);
- offset+=2+6*LigCaretCnt(glyphs[i]);
- }
- for ( i=0; i<lcnt; ++i )
- DumpLigCarets(at->gdef,glyphs[i]);
- offset = ftell(at->gdef);
- fseek(at->gdef,pos,SEEK_SET);
- putshort(at->gdef,offset-pos);
- fseek(at->gdef,0,SEEK_END);
- dumpcoveragetable(at->gdef,glyphs);
- }
-
- /* Mark Attachment Class Subtable */
- if ( sf->mark_class_cnt>0 ) {
- uint16 *mclasses = ClassesFromNames(sf,sf->mark_classes,sf->mark_class_cnt,at->maxp.numGlyphs,NULL,false);
- pos = ftell(at->gdef);
- fseek(at->gdef,10,SEEK_SET); /* location of mark attach table offset */
- putshort(at->gdef,pos);
- fseek(at->gdef,0,SEEK_END);
- DumpClass(at->gdef,mclasses,at->maxp.numGlyphs);
- free(mclasses);
- }
-
- at->gdeflen = ftell(at->gdef);
- if ( at->gdeflen&1 ) putc('\0',at->gdef);
- if ( (at->gdeflen+1)&2 ) putshort(at->gdef,0);
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfvar.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfvar.c
deleted file mode 100644
index ccc614693e0..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/tottfvar.c
+++ /dev/null
@@ -1,814 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaedit.h"
-#include "ttf.h"
-#include <math.h>
-#include <ustring.h>
-
-static int PtNumbersAreSet(SplineChar *sc) {
- struct splinecharlist *dep;
-
- if ( sc==NULL )
-return( false );
-
- if ( sc->ttf_instrs!=NULL )
-return( true );
- for ( dep= sc->dependents; dep!=NULL ; dep=dep->next )
- if ( dep->sc->ttf_instrs!=NULL )
-return( true );
-
-return( false );
-}
-
-static int AssignPtNumbers(MMSet *mm,int gid) {
- /* None of the instances has fixed point numbers. Make them match */
- int cnt=0;
- SplineSet **ss;
- SplinePoint **sp;
- int i;
- int allavg, alllines, stillmore, ret=true;
-
- ss = galloc((mm->instance_count+1)*sizeof(SplineSet *));
- sp = galloc((mm->instance_count+1)*sizeof(SplinePoint *));
- for ( i=0; i<mm->instance_count; ++i )
- ss[i] = mm->instances[i]->glyphs[gid]->layers[ly_fore].splines;
- ss[i] = mm->normal->glyphs[gid]->layers[ly_fore].splines;
-
- if ( ss[0]==NULL ) {
- stillmore = false;
- for ( i=0; i<=mm->instance_count; ++i )
- if ( ss[i]!=NULL ) stillmore = true;
- if ( stillmore )
-return( false );
-return( true );
- } else {
- stillmore = true;
- for ( i=0; i<=mm->instance_count; ++i )
- if ( ss[i]==NULL ) stillmore = false;
- if ( !stillmore )
-return( false );
- }
-
- forever {
- for ( i=0; i<=mm->instance_count; ++i )
- sp[i] = ss[i]->first;
- forever {
- allavg = alllines = true;
- for ( i=0; i<=mm->instance_count; ++i ) {
- if ( !RealNear(sp[i]->me.x,(sp[i]->nextcp.x+sp[i]->prevcp.x)/2) ||
- !RealNear(sp[i]->me.y,(sp[i]->nextcp.y+sp[i]->prevcp.y)/2) )
- allavg = false;
- if ( !sp[i]->nonextcp )
- alllines = false;
- }
- if ( sp[0] == ss[0]->first )
- allavg = false;
- for ( i=0; i<=mm->instance_count; ++i ) {
- if ( allavg )
- sp[i]->ttfindex = 0xffff;
- else
- sp[i]->ttfindex = cnt;
- }
- if ( !allavg )
- ++cnt;
- for ( i=0; i<=mm->instance_count; ++i ) {
- if ( alllines )
- sp[i]->nextcpindex = 0xffff;
- else
- sp[i]->nextcpindex = cnt;
- }
- if ( !alllines )
- ++cnt;
-
- if ( sp[0]->next==NULL ) {
- stillmore = false;
- for ( i=1; i<=mm->instance_count; ++i )
- if ( sp[i]->next!=NULL )
- stillmore = true;
- if ( stillmore )
- ret = false;
- break;
- }
- for ( i=1; i<=mm->instance_count; ++i )
- if ( sp[i]->next==NULL )
- stillmore = false;
- if ( !stillmore ) {
- ret = false;
- break;
- }
- sp[0] = sp[0]->next->to;
- for ( i=1; i<=mm->instance_count; ++i )
- sp[i] = sp[i]->next->to;
- if ( sp[0]==ss[0]->first ) {
- stillmore = false;
- for ( i=1; i<=mm->instance_count; ++i )
- if ( sp[i]!=ss[i]->first )
- stillmore = true;
- if ( stillmore )
- ret = false;
- break;
- }
- for ( i=1; i<=mm->instance_count; ++i ) {
- if ( sp[i]==ss[i]->first )
- stillmore = false;
- }
- if ( !stillmore ) {
- ret = false;
- break;
- }
- }
- if ( !ret )
- break;
- stillmore = true;
- for ( i=0; i<=mm->instance_count; ++i )
- ss[i] = ss[i]->next;
- if ( ss[0]==NULL ) {
- stillmore=false;
- for ( i=1; i<=mm->instance_count; ++i )
- if ( ss[i]!=NULL )
- stillmore = true;
- if ( stillmore )
- ret = true;
- break;
- }
- for ( i=1; i<=mm->instance_count; ++i )
- if ( ss[i]==NULL )
- stillmore = false;
- if ( !stillmore ) {
- ret = true;
- break;
- }
- }
- free(ss);
- free(sp);
-return( ret );
-}
-
-static int MatchPoints(SplineFont *sffixed, SplineFont *sfother, int gid) {
- SplineChar *fixed, *other;
- SplineSet *ss1, *ss2;
- SplinePoint *sp1, *sp2;
-
- fixed = sffixed->glyphs[gid]; other = sfother->glyphs[gid];
-
- if ( PtNumbersAreSet(other)) {
- /* Point numbers must match exactly, both are fixed */
- for ( ss1=fixed->layers[ly_fore].splines,
- ss2=other->layers[ly_fore].splines;
- ss1!=NULL && ss2!=NULL ;
- ss1 = ss1->next, ss2=ss2->next ) {
- for ( sp1=ss1->first, sp2=ss2->first; ; ) {
- if ( sp1->ttfindex!=sp2->ttfindex ||
- sp1->nextcpindex!=sp2->nextcpindex )
-return( false );
- if ( sp1->next==NULL || sp2->next==NULL ) {
- if ( sp1->next!=NULL || sp2->next!=NULL )
-return( false );
- break;
- }
- sp1 = sp1->next->to; sp2=sp2->next->to;
- if ( sp1==ss1->first || sp2==ss2->first ) {
- if ( sp1!=ss1->first || sp2!=ss2->first )
-return( false );
- break;
- }
- }
- }
-return( ss1==NULL && ss2==NULL );
- } else {
- for ( ss1=fixed->layers[ly_fore].splines,
- ss2=other->layers[ly_fore].splines;
- ss1!=NULL && ss2!=NULL ;
- ss1 = ss1->next, ss2=ss2->next ) {
- for ( sp1=ss1->first, sp2=ss2->first; ; ) {
- if ( sp1->ttfindex!=0xffff )
- sp2->ttfindex = sp1->ttfindex;
- else if ( !RealNear(sp2->me.x,(sp2->nextcp.x+sp2->prevcp.x)/2) ||
- !RealNear(sp2->me.y,(sp2->nextcp.y+sp2->prevcp.y)/2) )
-return( false );
- else
- sp2->ttfindex = 0xffff;
- if ( sp1->nextcpindex!=0xffff )
- sp2->nextcpindex = sp1->nextcpindex;
- else if ( !sp2->nonextcp )
-return( false );
- else
- sp2->nextcpindex = 0xffff;
- if ( sp1->next==NULL || sp2->next==NULL ) {
- if ( sp1->next!=NULL || sp2->next!=NULL )
-return( false );
- break;
- }
- sp1 = sp1->next->to; sp2=sp2->next->to;
- if ( sp1==ss1->first || sp2==ss2->first ) {
- if ( sp1!=ss1->first || sp2!=ss2->first )
-return( false );
- break;
- }
- }
- }
-return( ss1==NULL && ss2==NULL );
- }
-}
-
-int ContourPtNumMatch(MMSet *mm, int gid) {
- SplineFont *sf;
- int i;
-
- if ( !mm->apple )
-return( false );
-
- if ( gid>=mm->normal->glyphcnt )
-return( false );
- if ( !SCWorthOutputting(mm->normal->glyphs[gid] ) ) {
- for ( i=0; i<mm->instance_count; ++i ) {
- if ( gid>=mm->instances[i]->glyphcnt )
-return( false );
- if ( SCWorthOutputting(mm->instances[i]->glyphs[gid]))
-return( false );
- }
-return( true ); /* None is not worth outputting, and that's ok, they match */
- } else {
- for ( i=0; i<mm->instance_count; ++i ) {
- if ( gid>=mm->instances[i]->glyphcnt )
-return( false );
- if ( !SCWorthOutputting(mm->instances[i]->glyphs[gid]))
-return( false );
- }
- /* All are worth outputting */
- }
-
- if ( mm->normal->glyphs[gid]->layers[ly_fore].refs!=NULL && mm->normal->glyphs[gid]->layers[ly_fore].splines!=NULL )
-return( false );
- for ( i=0; i<mm->instance_count; ++i ) {
- if ( mm->instances[i]->glyphs[gid]->layers[ly_fore].refs!=NULL && mm->instances[i]->glyphs[gid]->layers[ly_fore].splines!=NULL )
-return( false );
- }
- if ( mm->normal->glyphs[gid]->layers[ly_fore].refs!=NULL ) {
- RefChar *r;
- int cnt, c;
- for ( r=mm->normal->glyphs[gid]->layers[ly_fore].refs, cnt=0; r!=NULL; r=r->next )
- ++cnt;
- for ( i=0; i<mm->instance_count; ++i ) {
- for ( r=mm->instances[i]->glyphs[gid]->layers[ly_fore].refs, c=0; r!=NULL; r=r->next )
- ++c;
- if ( c!=cnt )
-return( false );
- }
- }
-
- sf = NULL;
- if ( PtNumbersAreSet(mm->normal->glyphs[gid]) )
- sf = mm->normal;
- else {
- for ( i=0; i<mm->instance_count; ++i ) {
- if ( PtNumbersAreSet(mm->instances[i]->glyphs[gid])) {
- sf = mm->instances[i];
- break;
- }
- }
- }
- if ( sf==NULL )
- /* No instance has fixed points. Make sure all fonts are consistent */
-return( AssignPtNumbers(mm,gid));
-
- if ( sf!=mm->normal && !MatchPoints(sf,mm->normal,gid))
-return( false );
- for ( i=0; i<mm->instance_count; ++i ) if ( sf!=mm->instances[i] ) {
- if ( !MatchPoints(sf, mm->instances[i],gid) )
-return( false );
- }
-return( true );
-}
-
-static int SCPointCount(SplineChar *sc) {
- int ptcnt=0;
- RefChar *r;
-
- ptcnt = SSTtfNumberPoints(sc->layers[ly_fore].splines);
- for ( r=sc->layers[ly_fore].refs; r!=NULL ; r=r->next )
- ++ptcnt;
-return( ptcnt );
-}
-
-int16 **SCFindDeltas(MMSet *mm, int gid, int *_ptcnt) {
- /* When figuring out the deltas the first thing we must do is figure */
- /* out each point's number */
- int i, j, k, l, cnt, ptcnt;
- int16 **deltas;
- SplineSet *ss1, *ss2;
- SplinePoint *sp1, *sp2;
- RefChar *r1, *r2;
-
- if ( !ContourPtNumMatch(mm,gid))
-return( NULL );
- if ( !SCWorthOutputting(mm->normal->glyphs[gid]))
-return( NULL );
-
- *_ptcnt = ptcnt = SCPointCount(mm->normal->glyphs[gid])+4;
- deltas = galloc(2*mm->instance_count*sizeof(int16 *));
- for ( i=0; i<2*mm->instance_count; ++i )
- deltas[i] = gcalloc(ptcnt,sizeof(int16));
- for ( i=0; i<mm->instance_count; ++i ) {
- for ( ss1=mm->normal->glyphs[gid]->layers[ly_fore].splines,
- ss2=mm->instances[i]->glyphs[gid]->layers[ly_fore].splines;
- ss1!=NULL && ss2!=NULL ;
- ss1 = ss1->next, ss2=ss2->next ) {
- for ( sp1=ss1->first, sp2=ss2->first; ; ) {
- if ( sp1->ttfindex!=0xffff ) {
- deltas[2*i][sp1->ttfindex] = rint(sp2->me.x)-rint(sp1->me.x);
- deltas[2*i+1][sp1->ttfindex] = rint(sp2->me.y)-rint(sp1->me.y);
- }
- if ( sp1->nextcpindex != 0xffff ) {
- deltas[2*i][sp1->nextcpindex] = rint(sp2->nextcp.x)-rint(sp1->nextcp.x);
- deltas[2*i+1][sp1->nextcpindex] = rint(sp2->nextcp.y)-rint(sp1->nextcp.y);
- }
- if ( sp1->next==NULL )
- break;
- sp1 = sp1->next->to; sp2 = sp2->next->to;
- if ( sp1==ss1->first )
- break;
- }
- }
- for ( cnt=0,
- r1=mm->normal->glyphs[gid]->layers[ly_fore].refs,
- r2=mm->instances[i]->glyphs[gid]->layers[ly_fore].refs;
- r1!=NULL && r2!=NULL;
- r1=r1->next, r2=r2->next, ++cnt ) {
- deltas[2*i][cnt] = r2->transform[4]-r1->transform[4];
- deltas[2*i+1][cnt] = r2->transform[5]-r1->transform[5];
- }
- /* Phantom points */
- deltas[2*i][ptcnt-4] = 0; deltas[2*i+1][ptcnt-4] = 0; /* lbearing */
- deltas[2*i][ptcnt-3] = mm->instances[i]->glyphs[gid]->width -mm->normal->glyphs[gid]->width;
- deltas[2*i+1][ptcnt-3] = 0; /* horizontal advance */
- deltas[2*i][ptcnt-2] = 0; deltas[2*i+1][ptcnt-2] = 0; /* top bearing */
- deltas[2*i][ptcnt-1] = 0; /* vertical advance */
- deltas[2*i+1][ptcnt-1] = mm->instances[i]->glyphs[gid]->vwidth -mm->normal->glyphs[gid]->vwidth; /* horizontal advance */
- }
-
- /* Ok, each delta now contains the difference between the instance[i] points */
- /* and the base points. But that isn't good enough. We must subtract */
- /* [0,1] and [1,0] from [1,1], and then subtract [1,1,0] [1,0,1] [0,1,1] */
- /* from [1,1,1] and so on (also [-1,0] from [-1,1], etc.) */
- for ( j=1; j<mm->axis_count; ++j ) {
- for ( i=0; i<mm->instance_count; ++i ) {
- for ( k=cnt=0; k<mm->axis_count; ++k )
- if ( mm->positions[i*mm->axis_count+k]!=0 )
- ++cnt;
- if ( cnt==j ) {
- for ( l = 0; l<mm->instance_count; ++l ) if ( l!=i ) {
- for ( k=0; k<mm->axis_count; ++k )
- if ( mm->positions[i*mm->axis_count+k]!=0 &&
- mm->positions[l*mm->axis_count+k]!=mm->positions[i*mm->axis_count+k])
- break;
- if ( k==mm->axis_count ) {
- for ( k=0; k<ptcnt; ++k ) {
- deltas[2*l][k] -= deltas[2*i][k];
- deltas[2*l+1][k] -= deltas[2*i+1][k];
- }
- }
- }
- }
- }
- }
-
- /* If all variants of the glyph are the same, no point in having a gvar */
- /* entry for it */
- for ( i=0 ; i<mm->instance_count; ++i ) {
- for ( j=0; j<ptcnt; ++j )
- if ( deltas[i][j]!=0 )
- break;
- if ( j!=ptcnt )
- break;
- }
- if ( i==mm->instance_count ) {
- /* All zeros */
- for ( i=0 ; i<mm->instance_count; ++i )
- free(deltas[i]);
- free(deltas);
-return( NULL );
- }
-
-return( deltas );
-}
-
-int16 **CvtFindDeltas(MMSet *mm, int *_ptcnt) {
- int i, j, k, l, cnt, ptcnt;
- int16 **deltas;
- struct ttf_table *cvt, *icvt;
- for ( cvt = mm->normal->ttf_tables; cvt!=NULL && cvt->tag!=CHR('c','v','t',' '); cvt=cvt->next );
-
- if ( cvt==NULL )
-return( NULL );
-
- icvt = NULL;
- for ( i=0; i<mm->instance_count; ++i )
- if ( (icvt=mm->instances[i]->ttf_tables)!=NULL )
- break;
- if ( icvt==NULL ) /* No other cvt tables => no variation */
-return( NULL );
-
- *_ptcnt = ptcnt = cvt->len/2;
- deltas = gcalloc(mm->instance_count,sizeof(int16 *));
- for ( i=0; i<mm->instance_count; ++i ) if ( (icvt=mm->instances[i]->ttf_tables)!=NULL ) {
- deltas[i] = gcalloc(ptcnt,sizeof(int16));
- for ( j=0; j<ptcnt; ++j )
- deltas[i][j] = memushort(icvt->data,icvt->len, sizeof(uint16)*j)-
- memushort(cvt->data,cvt->len, sizeof(uint16)*j);
- }
-
- /* Ok, each delta now contains the difference between the instance[i] points */
- /* and the base points. But that isn't good enough. We must subtract */
- /* [0,1] and [1,0] from [1,1], and then subtract [1,1,0] [1,0,1] [0,1,1] */
- /* from [1,1,1] and so on (also [-1,0] from [-1,1], etc.) */
- for ( j=1; j<mm->axis_count; ++j ) {
- for ( i=0; i<mm->instance_count; ++i ) if ( deltas[i]!=NULL ) {
- for ( k=cnt=0; k<mm->axis_count; ++k )
- if ( mm->positions[i*mm->axis_count+k]!=0 )
- ++cnt;
- if ( cnt==j ) {
- for ( l = 0; l<mm->instance_count; ++l ) if ( l!=i && deltas[l]!=NULL ) {
- for ( k=0; k<mm->axis_count; ++k )
- if ( mm->positions[i*mm->axis_count+k]!=0 &&
- mm->positions[l*mm->axis_count+k]!=mm->positions[i*mm->axis_count+k])
- break;
- if ( k==mm->axis_count ) {
- for ( k=0; k<ptcnt; ++k )
- deltas[l][k] -= deltas[i][k];
- }
- }
- }
- }
- }
-
- /* If all variants of the cvt are the same, no point in having a gvar */
- /* entry for it */
- for ( i=0 ; i<mm->instance_count; ++i ) if ( deltas[i]!=NULL ) {
- for ( j=0; j<ptcnt; ++j )
- if ( deltas[i][j]!=0 )
- break;
- if ( j==ptcnt ) {
- free(deltas[i]);
- deltas[i] = NULL;
- }
- }
- for ( i=0 ; i<mm->instance_count; ++i )
- if ( deltas[i]!=NULL )
- break;
- if ( i==mm->instance_count ) {
- /* All zeros */
- free(deltas);
-return( NULL );
- }
-
-return( deltas );
-}
-
-static void ttf_dumpcvar(struct alltabs *at, MMSet *mm) {
- int16 **deltas;
- int ptcnt, cnt, pcnt;
- int i,j,rj,big;
- int tuple_size;
- uint32 start, end;
- uint16 *pts;
-
- deltas = CvtFindDeltas(mm,&ptcnt);
- for ( i=cnt=0; i<mm->instance_count; ++i )
- if ( deltas[i]!=NULL )
- ++cnt;
- if ( cnt==0 ) {
- free(deltas);
-return;
- }
-
- tuple_size = 4+2*mm->axis_count;
- at->cvar = tmpfile();
- putlong( at->cvar, 0x00010000 ); /* Format */
- putshort( at->cvar, cnt ); /* Number of instances with cvt tables (tuple count of interesting tuples) */
- putshort( at->cvar, 8+cnt*tuple_size ); /* Offset to data */
-
- for ( i=0; i<mm->instance_count; ++i ) if ( deltas[i]!=NULL ) {
- putshort( at->cvar, 0 ); /* tuple data size, figure out later */
- putshort( at->cvar, 0xa000 ); /* tuple coords follow, private points in data */
- for ( j=0; j<mm->axis_count; ++j )
- putshort( at->cvar, rint(16384*mm->positions[i*mm->axis_count+j]) );
- }
- if ( ftell( at->cvar )!=8+cnt*tuple_size )
- IError( "Data offset wrong" );
-
- for ( i=cnt=0; i<mm->instance_count; ++i ) if ( deltas[i]!=NULL ) {
- start = ftell(at->cvar);
- for ( j=pcnt=0; j<ptcnt; ++j )
- if ( deltas[i][j]!=0 )
- ++pcnt;
- pts = galloc(pcnt*sizeof(uint16));
- for ( j=pcnt=0; j<ptcnt; ++j )
- if ( deltas[i][j]!=0 )
- pts[pcnt++]=j;
-
- if ( pcnt>0x7f ) {
- putc(0x80|(pcnt>>8), at->cvar );
- putc(pcnt&0xff, at->cvar);
- } else
- putc(pcnt, at->cvar);
- for ( j=0; j<pcnt; ) {
- big = pts[j]>=0x80 ? 0x80 : 0;
- for ( rj=j+1 ; rj<j+0x80 && rj<pcnt && !big; ++rj )
- if ( pts[rj]-pts[rj-1]>=0x80 )
- big = 0x80;
-
- putc((rj-j-1)|big,at->cvar);
- if ( big ) {
- putshort(at->cvar,pts[j]);
- for ( ++j; j<rj; ++j )
- putshort(at->cvar,pts[j]-pts[j-1]);
- } else {
- putc(pts[j],at->cvar);
- for ( ++j; j<rj; ++j )
- putc(pts[j]-pts[j-1],at->cvar);
- }
- }
- /* Now output the corresponding deltas for those points */
- for ( j=0; j<pcnt; ) {
- if ( deltas[i][j]>0x7f || deltas[i][j]<0x80 ) {
- for ( rj=j+1; rj<j+0x40 && rj<pcnt; ++rj ) {
- if ( deltas[i][pts[rj]]>0x7f || deltas[i][pts[rj]]<0x80 ||
- (rj+1<j+0x40 && rj+1<pcnt && (deltas[i][pts[rj+1]]>0x7f || deltas[i][pts[rj+1]]<0x80)) )
- /* Keep going with a big run */;
- else
- break;
- }
- putc( (rj-j-1)|0x40,at->cvar );
- for ( ; j<rj ; ++j )
- putshort( at->cvar, deltas[i][pts[j]] );
- } else {
- for ( rj=j+1; rj<j+0x40 && rj<pcnt; ++rj ) {
- if ( deltas[i][pts[rj]]>0x7f || deltas[i][pts[rj]]<0x80 )
- break;
- }
- putc( rj-j-1,at->cvar );
- for ( ; j<rj ; ++j )
- putc( deltas[i][pts[j]], at->cvar );
- }
- }
- free(pts);
- end = ftell(at->cvar);
- fseek(at->cvar, 8+cnt*tuple_size, SEEK_SET);
- putshort(at->cvar,end-start);
- fseek(at->cvar, end, SEEK_SET);
- ++cnt;
- }
-
- for ( i=0; i<mm->instance_count; ++i )
- free( deltas[i] );
- free(deltas);
-
- at->cvarlen = ftell(at->cvar);
- if ( at->cvarlen&1 )
- putc('\0',at->cvar );
- if ( ftell(at->cvar)&2 )
- putshort(at->cvar,0);
-}
-
-static void dumpdeltas(struct alltabs *at,int16 *deltas,int ptcnt) {
- int j,rj;
-
- for ( j=0; j<ptcnt; ) {
- for ( rj=j; rj<ptcnt && rj<j+0x40 && deltas[rj]==0; ++rj );
- if ( rj!=j ) {
- putc((rj-j-1)|0x80,at->gvar);
- j = rj;
- continue;
- }
- if ( deltas[j]>0x7f || deltas[j]<0x80 ) {
- for ( rj=j+1; rj<j+0x40 && rj<ptcnt; ++rj ) {
- if ( deltas[rj]>0x7f || deltas[rj]<0x80 ||
- (rj+1<j+0x40 && rj+1<ptcnt && (deltas[rj+1]>0x7f || deltas[rj+1]<0x80)) )
- /* Keep going with a big run */;
- else
- break;
- }
- putc( (rj-j-1)|0x40,at->gvar );
- for ( ; j<rj ; ++j )
- putshort( at->gvar, deltas[j] );
- } else {
- for ( rj=j+1; rj<j+0x40 && rj<ptcnt; ++rj ) {
- if ( deltas[rj]>0x7f || deltas[rj]<0x80 ||
- (deltas[rj]==0 && rj+1<j+0x40 && rj+1<ptcnt &&
- deltas[rj+1]<=0x7f && deltas[rj+1]>=0x80 && deltas[rj+1]!=0 ))
- break;
- }
- putc( rj-j-1,at->gvar );
- for ( ; j<rj ; ++j )
- putc( deltas[j], at->gvar );
- }
- }
-}
-
-static void ttf_dumpgvar(struct alltabs *at, MMSet *mm) {
- int i,j, last;
- uint32 gcoordoff, glyphoffs, start, here, tupledataend, tupledatastart;
- int16 **deltas;
- int ptcnt;
-
- at->gvar = tmpfile();
- putlong( at->gvar, 0x00010000 ); /* Format */
- putshort( at->gvar, mm->axis_count );
- putshort( at->gvar, mm->instance_count ); /* Number of global tuples */
- gcoordoff = ftell(at->gvar);
- putlong( at->gvar, 0 ); /* Offset to global tuples, fix later */
- putshort( at->gvar,at->maxp.numGlyphs );
- putshort( at->gvar, 1 ); /* always output 32bit offsets */
- putlong( at->gvar, ftell(at->gvar)+4 + (at->maxp.numGlyphs+1)*4);
- glyphoffs = ftell(at->gvar);
- for ( i=0; i<=at->maxp.numGlyphs; ++i )
- putlong( at->gvar,0 );
-
- start = ftell( at->gvar );
- last = -1;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- deltas = SCFindDeltas(mm,at->gi.bygid[i],&ptcnt);
- if ( deltas==NULL )
- continue;
- here = ftell(at->gvar);
- fseek(at->gvar,glyphoffs+(last+1)*4,SEEK_SET);
- for ( ; last< i; ++last )
- putlong(at->gvar,here-start);
- fseek(at->gvar,here,SEEK_SET);
- putshort(at->gvar,mm->instance_count);
- putshort(at->gvar,4+4*mm->instance_count); /* offset to data */
- for ( j=0; j<mm->instance_count; ++j ) {
- putshort(at->gvar,0); /* tuple data size, fix later */
- putshort(at->gvar,0x2000|j); /* private points, tuple i */
- }
- for ( j=0; j<mm->instance_count; ++j ) {
- tupledatastart = ftell(at->gvar);
- putc('\0',at->gvar); /* Point list, all points */
- dumpdeltas(at,deltas[2*j],ptcnt);
- dumpdeltas(at,deltas[2*j+1],ptcnt);
- tupledataend = ftell(at->gvar);
- fseek(at->gvar,here+4+4*j,SEEK_SET);
- putshort( at->gvar,tupledataend-tupledatastart);
- fseek(at->gvar,tupledataend,SEEK_SET);
- free(deltas[2*j]); free(deltas[2*j+1]);
- }
- free(deltas);
- }
- here = ftell(at->gvar);
- fseek(at->gvar,glyphoffs+(last+1)*4,SEEK_SET);
- for ( ; last< at->maxp.numGlyphs; ++last )
- putlong(at->gvar,here-start);
- fseek(at->gvar,gcoordoff,SEEK_SET);
- putlong(at->gvar,here);
- fseek(at->gvar,here,SEEK_SET);
- for ( j=0; j<mm->instance_count; ++j ) {
- for ( i=0; i<mm->axis_count; ++i )
- putshort(at->gvar,rint(16384*mm->positions[j*mm->axis_count+i]));
- }
-
- at->gvarlen = ftell(at->gvar);
- if ( at->gvarlen&1 )
- putc('\0',at->gvar );
- if ( ftell(at->gvar)&2 )
- putshort(at->gvar,0);
-}
-
-
-static void ttf_dumpavar(struct alltabs *at, MMSet *mm) {
- int i,j;
-
- for ( i=0; i<mm->axis_count; ++i ) {
- if ( mm->axismaps[i].points>3 )
- break;
- }
- if ( i==mm->axis_count ) /* We only have simple axes */
-return; /* No need for a variation table */
-
- at->avar = tmpfile();
- putlong( at->avar, 0x00010000 ); /* Format */
- putlong( at->avar, mm->axis_count );
- for ( i=0; i<mm->axis_count; ++i ) {
- putshort( at->avar, mm->axismaps[i].points );
- for ( j=0; j<mm->axismaps[i].points; ++j ) {
- if ( mm->axismaps[i].designs[j]<mm->axismaps[i].def )
- putshort( at->avar, (mm->axismaps[i].designs[j]-mm->axismaps[i].def)*16384/
- (mm->axismaps[i].def-mm->axismaps[i].min));
- else
- putshort( at->avar, (mm->axismaps[i].designs[j]-mm->axismaps[i].def)*16384/
- (mm->axismaps[i].max-mm->axismaps[i].def));
- putshort( at->avar, mm->axismaps[i].blends[j]*16384);
- }
- }
-
- at->avarlen = ftell(at->avar);
- if ( at->avarlen&2 )
- putshort(at->avar,0);
-}
-
-static uint32 AxisNameToTag(char *name) {
- char buf[4];
- int i;
-
- if ( strmatch(name,"Weight")==0 )
-return( CHR('w','g','h','t'));
- if ( strmatch(name,"Width")==0 )
-return( CHR('w','d','t','h'));
- if ( strmatch(name,"OpticalSize")==0 )
-return( CHR('o','p','s','z'));
- if ( strmatch(name,"Slant")==0 )
-return( CHR('s','l','n','t'));
-
- memset(buf,0,sizeof(buf));
- for ( i=0; i<4 && name[i]!='\0'; ++i )
- buf[i] = name[i];
-return( CHR(buf[0],buf[1],buf[2],buf[3]));
-}
-
-static int AllocateStrId(struct alltabs *at,struct macname *mn) {
- struct other_names *on;
-
- if ( mn==NULL )
-return( 0 );
-
- on = chunkalloc(sizeof(struct other_names));
- on->strid = at->next_strid++;
- on->mn = mn;
- on->next = at->other_names;
- at->other_names = on;
-return( on->strid );
-}
-
-static void ttf_dumpfvar(struct alltabs *at, MMSet *mm) {
- int i,j;
-
- at->fvar = tmpfile();
- putlong( at->fvar, 0x00010000 ); /* Format */
- putshort( at->fvar, 16 ); /* Offset to first axis data */
- putshort( at->fvar, 2 ); /* Size count pairs */
- putshort( at->fvar, mm->axis_count );
- putshort( at->fvar, 20 ); /* Size of each axis record */
- putshort( at->fvar, mm->named_instance_count );
- putshort( at->fvar, 4+4*mm->axis_count );
-
- /* For each axis ... */
- for ( i=0; i<mm->axis_count; ++i ) {
- putlong( at->fvar, AxisNameToTag(mm->axes[i]) );
- putlong( at->fvar, rint(mm->axismaps[i].min*65536));
- putlong( at->fvar, rint(mm->axismaps[i].def*65536));
- putlong( at->fvar, rint(mm->axismaps[i].max*65536));
- putshort(at->fvar, 0 ); /* No flags defined for axes */
- putshort(at->fvar, AllocateStrId(at,mm->axismaps[i].axisnames));
- }
-
- /* For each named font ... */
- for ( i=0; i<mm->named_instance_count; ++i ) {
- putshort(at->fvar, AllocateStrId(at,mm->named_instances[i].names));
- putshort(at->fvar, 0 ); /* No flags here either */
- for ( j=0; j<mm->axis_count; ++j )
- putlong(at->fvar, rint(65536*mm->named_instances[i].coords[j]));
- }
-
- at->fvarlen = ftell(at->fvar);
- if ( at->fvarlen&2 ) /* I don't think this is ever hit */
- putshort(at->fvar,0);
-}
-
-void ttf_dumpvariations(struct alltabs *at, SplineFont *sf) {
- MMSet *mm = sf->mm;
- int i,j;
-
- for ( j=0; j<sf->glyphcnt; ++j ) if ( sf->glyphs[j]!=NULL ) {
- for ( i=0; i<mm->instance_count; ++i ) if ( mm->instances[i]->glyphs[j]!=NULL )
- mm->instances[i]->glyphs[j]->ttf_glyph = sf->glyphs[j]->ttf_glyph;
- }
-
- ttf_dumpfvar(at,mm);
- ttf_dumpgvar(at,mm);
- ttf_dumpcvar(at,mm);
- ttf_dumpavar(at,mm);
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ttfspecial.c b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ttfspecial.c
deleted file mode 100644
index 5ff917ba3ef..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ttfspecial.c
+++ /dev/null
@@ -1,1067 +0,0 @@
-/* Copyright (C) 2000-2007 by George Williams */
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
-
- * The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
-
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "pfaedit.h"
-#include <time.h>
-#include <utype.h>
-#include <ustring.h>
-#include <gdraw.h> /* For COLOR_DEFAULT */
-
-#include "ttf.h"
-
-/* This file contains routines to generate non-standard true/opentype tables */
-/* The first is the 'PfEd' table containing PfaEdit specific information */
-/* glyph comments & colours ... perhaps other info later */
-
-/* ************************************************************************** */
-/* ************************* The 'PfEd' table ************************* */
-/* ************************* Output ************************* */
-/* ************************************************************************** */
-
-/* 'PfEd' table format is as follows... */
-/* uint32 version number 0x00010000 */
-/* uint32 subtable count */
-/* struct { uint32 tab, offset } tag/offset for first subtable */
-/* struct { uint32 tab, offset } tag/offset for second subtable */
-/* ... */
-
-/* 'PfEd' 'fcmt' font comment subtable format */
-/* short version number 0 */
-/* short string length */
-/* String in latin1 (ASCII is better) */
-
-/* 'PfEd' 'cmnt' glyph comment subtable format */
-/* short version number 0 */
-/* short count-of-ranges */
-/* struct { short start-glyph, end-glyph, short offset } */
-/* ... */
-/* foreach glyph >=start-glyph, <=end-glyph(+1) */
-/* uint32 offset to glyph comment string (in UCS2) */
-/* ... */
-/* And one last offset pointing beyong the end of the last string to enable length calculations */
-/* String table in UCS2 (NUL terminated). All offsets from start*/
-/* of subtable */
-
-/* 'PfEd' 'colr' glyph colour subtable */
-/* short version number 0 */
-/* short count-of-ranges */
-/* struct { short start-glyph, end-glyph, uint32 colour (rgb) } */
-
-#define MAX_SUBTABLE_TYPES 3
-
-struct PfEd_subtabs {
- int next;
- struct {
- FILE *data;
- uint32 tag;
- uint32 offset;
- } subtabs[MAX_SUBTABLE_TYPES];
-};
-
-static void PfEd_FontComment(SplineFont *sf, struct PfEd_subtabs *pfed ) {
- FILE *fcmt;
- char *pt;
-
- if ( sf->comments==NULL || *sf->comments=='\0' )
-return;
- pfed->subtabs[pfed->next].tag = CHR('f','c','m','t');
- pfed->subtabs[pfed->next++].data = fcmt = tmpfile();
-
- putshort(fcmt,0); /* sub-table version number */
- putshort(fcmt,strlen(sf->comments));
- for ( pt = sf->comments; *pt; ++pt )
- putshort(fcmt,*pt);
- putshort(fcmt,0);
- if ( ftell(fcmt)&2 ) putshort(fcmt,0);
-}
-
-static void PfEd_GlyphComments(SplineFont *sf, struct PfEd_subtabs *pfed,
- struct glyphinfo *gi ) {
- int i, j, k, any, cnt, last, skipped;
- uint32 offset;
- SplineChar *sc, *sc2;
- FILE *cmnt;
- char *upt;
- uint32 uch;
-
- sc2 = NULL;
- any = 0;
- /* We don't need to check in bygid order. We just want to know existance */
- for ( i=0; i<sf->glyphcnt; ++i ) {
- if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->ttf_glyph!=-1 &&
- sf->glyphs[i]->comment!=NULL ) {
- any = true;
- break;
- }
- }
-
- if ( !any )
-return;
-
- pfed->subtabs[pfed->next].tag = CHR('c','m','n','t');
- pfed->subtabs[pfed->next++].data = cmnt = tmpfile();
-
- putshort(cmnt,0); /* sub-table version number */
-
- offset = 0;
- for ( j=0; j<4; ++j ) {
- cnt = 0;
- for ( i=0; i<gi->gcnt; ++i ) if ( gi->bygid[i]!=-1 ) {
- sc=sf->glyphs[gi->bygid[i]];
- if ( sc!=NULL && sc->comment!=NULL ) {
- last = i; skipped = false;
- for ( k=i+1; k<gi->gcnt; ++k ) {
- if ( gi->bygid[k]!=-1 )
- sc2 = sf->glyphs[gi->bygid[k]];
- if ( (gi->bygid[k]==-1 || sc2->comment==NULL) && skipped )
- break;
- if ( gi->bygid[k]!=-1 && sc2->comment!=NULL ) {
- last = k;
- skipped = false;
- } else
- skipped = true;
- }
- ++cnt;
- if ( j==1 ) {
- putshort(cmnt,i);
- putshort(cmnt,last);
- putlong(cmnt,offset);
- offset += sizeof(uint32)*(last-i+2);
- } else if ( j==2 ) {
- for ( ; i<=last; ++i ) {
- if ( gi->bygid[i]==-1 || (sc=sf->glyphs[gi->bygid[i]])->comment==NULL )
- putlong(cmnt,0);
- else {
- putlong(cmnt,offset);
- offset += sizeof(unichar_t)*(utf82u_strlen(sc->comment)+1);
- }
- }
- putlong(cmnt,offset); /* Guard data, to let us calculate the string lengths */
- } else if ( j==3 ) {
- for ( ; i<=last; ++i ) {
- if ( gi->bygid[i]==-1 || (sc=sf->glyphs[gi->bygid[i]])->comment==NULL )
- continue;
- for ( upt = sc->comment; (uch = utf8_ildb((const char **) &upt))!='\0'; ) {
- if ( uch<0x10000 )
- putshort(cmnt,uch);
- else {
- putshort(cmnt,0xd800|(uch/0x400));
- putshort(cmnt,0xdc00|(uch&0x3ff));
- }
- }
- putshort(cmnt,0);
- }
- }
- i = last;
- }
- }
- if ( j==0 ) {
- putshort(cmnt,cnt);
- offset = 2*sizeof(short) + cnt*(2*sizeof(short)+sizeof(uint32));
- }
- }
- if ( ftell(cmnt) & 2 )
- putshort(cmnt,0);
-}
-
-static void PfEd_Colours(SplineFont *sf, struct PfEd_subtabs *pfed, struct glyphinfo *gi ) {
- int i, j, k, any, cnt, last;
- SplineChar *sc, *sc2;
- FILE *colr;
-
- any = 0;
- for ( i=0; i<sf->glyphcnt; ++i ) {
- if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->ttf_glyph!=-1 &&
- sf->glyphs[i]->color!=COLOR_DEFAULT ) {
- any = true;
- break;
- }
- }
-
- if ( !any )
-return;
-
- pfed->subtabs[pfed->next].tag = CHR('c','o','l','r');
- pfed->subtabs[pfed->next++].data = colr = tmpfile();
-
- putshort(colr,0); /* sub-table version number */
- for ( j=0; j<2; ++j ) {
- cnt = 0;
- for ( i=0; i<gi->gcnt; ++i ) if ( gi->bygid[i]!=-1 ) {
- sc = sf->glyphs[gi->bygid[i]];
- if ( sc!=NULL && sc->color!=COLOR_DEFAULT ) {
- last = i;
- for ( k=i+1; k<gi->gcnt; ++k ) {
- if ( gi->bygid[k]==-1 )
- break;
- sc2 = sf->glyphs[gi->bygid[k]];
- if ( sc2->color != sc->color )
- break;
- last = k;
- }
- ++cnt;
- if ( j==1 ) {
- putshort(colr,i);
- putshort(colr,last);
- putlong(colr,sc->color);
- }
- i = last;
- }
- }
- if ( j==0 )
- putshort(colr,cnt);
- }
- if ( ftell(colr) & 2 )
- putshort(colr,0);
-}
-
-void pfed_dump(struct alltabs *at, SplineFont *sf) {
- struct PfEd_subtabs pfed;
- FILE *file;
- int i;
- uint32 offset;
-
- memset(&pfed,0,sizeof(pfed));
- if ( at->gi.flags & ttf_flag_pfed_comments ) {
- PfEd_FontComment(sf, &pfed );
- PfEd_GlyphComments(sf, &pfed, &at->gi );
- }
- if ( at->gi.flags & ttf_flag_pfed_colors )
- PfEd_Colours(sf, &pfed, &at->gi );
-
- if ( pfed.next==0 )
-return; /* No subtables */
-
- at->pfed = file = tmpfile();
- putlong(file, 0x00010000); /* Version number */
- putlong(file, pfed.next); /* sub-table count */
- offset = 2*sizeof(uint32) + 2*pfed.next*sizeof(uint32);
- for ( i=0; i<pfed.next; ++i ) {
- putlong(file,pfed.subtabs[i].tag);
- putlong(file,offset);
- fseek(pfed.subtabs[i].data,0,SEEK_END);
- pfed.subtabs[i].offset = offset;
- offset += ftell(pfed.subtabs[i].data);
- }
- for ( i=0; i<pfed.next; ++i ) {
- fseek(pfed.subtabs[i].data,0,SEEK_SET);
- ttfcopyfile(file,pfed.subtabs[i].data,pfed.subtabs[i].offset,"PfEd-subtable");
- }
- if ( ftell(file)&3 )
- IError("'PfEd' table not properly aligned");
- at->pfedlen = ftell(file);
-}
-
-/* ************************* The 'PfEd' table ************************* */
-/* ************************* Input ************************* */
-
-static void pfed_readfontcomment(FILE *ttf,struct ttfinfo *info,uint32 base) {
- int len;
- char *pt, *end;
-
- fseek(ttf,base,SEEK_SET);
- if ( getushort(ttf)!=0 )
-return; /* Bad version number */
- len = getushort(ttf);
- pt = galloc(len+1); /* data are stored as UCS2, but currently are ASCII */
- info->fontcomments = pt;
- end = pt+len;
- while ( pt<end )
- *pt++ = getushort(ttf);
- *pt = '\0';
-}
-
-static char *ReadUnicodeStr(FILE *ttf,uint32 offset,int len) {
- char *pt, *str;
- uint32 uch, uch2;
- int i;
-
- if ( len<0 )
-return( NULL );
-
- len>>=1;
- pt = str = galloc(3*len);
- fseek(ttf,offset,SEEK_SET);
- for ( i=0; i<len; ++i ) {
- uch = getushort(ttf);
- if ( uch>=0xd800 && uch<0xdc00 ) {
- uch2 = getushort(ttf);
- if ( uch2>=0xdc00 && uch2<0xe000 )
- uch = ((uch-0xd800)<<10) | (uch2&0x3ff);
- else {
- pt = utf8_idpb(pt,uch);
- uch = uch2;
- }
- }
- pt = utf8_idpb(pt,uch);
- }
- *pt++ = 0;
-return( grealloc(str,pt-str) );
-}
-
-static void pfed_readglyphcomments(FILE *ttf,struct ttfinfo *info,uint32 base) {
- int n, i, j;
- struct grange { int start, end; uint32 offset; } *grange;
- uint32 offset, next;
-
- fseek(ttf,base,SEEK_SET);
- if ( getushort(ttf)!=0 )
-return; /* Bad version number */
- n = getushort(ttf);
- grange = galloc(n*sizeof(struct grange));
- for ( i=0; i<n; ++i ) {
- grange[i].start = getushort(ttf);
- grange[i].end = getushort(ttf);
- grange[i].offset = getlong(ttf);
- if ( grange[i].start>grange[i].end || grange[i].end>info->glyph_cnt ) {
- LogError( _("Bad glyph range specified in glyph comment subtable of PfEd table\n") );
- grange[i].start = 1; grange[i].end = 0;
- }
- }
- for ( i=0; i<n; ++i ) {
- for ( j=grange[i].start; j<=grange[i].end; ++j ) {
- fseek( ttf,base+grange[i].offset+(j-grange[i].start)*sizeof(uint32),SEEK_SET);
- offset = getlong(ttf);
- next = getlong(ttf);
- info->chars[j]->comment = ReadUnicodeStr(ttf,base+offset,next-offset);
- if ( info->chars[j]->comment == NULL )
- LogError("Invalid comment string (negative length?) in 'PfEd' table for glyph %s.",
- info->chars[j]->name );
- }
- }
- free(grange);
-}
-
-static void pfed_readcolours(FILE *ttf,struct ttfinfo *info,uint32 base) {
- int n, i, j, start, end;
- uint32 col;
-
- fseek(ttf,base,SEEK_SET);
- if ( getushort(ttf)!=0 )
-return; /* Bad version number */
- n = getushort(ttf);
- for ( i=0; i<n; ++i ) {
- start = getushort(ttf);
- end = getushort(ttf);
- col = getlong(ttf);
- if ( start>end || end>info->glyph_cnt )
- LogError( _("Bad glyph range specified in colour subtable of PfEd table\n") );
- else {
- for ( j=start; j<=end; ++j )
- info->chars[j]->color = col;
- }
- }
-}
-
-void pfed_read(FILE *ttf,struct ttfinfo *info) {
- int n,i;
- struct tagoff { uint32 tag, offset; } tagoff[MAX_SUBTABLE_TYPES+30];
-
- fseek(ttf,info->pfed_start,SEEK_SET);
-
- if ( getlong(ttf)!=0x00010000 )
-return;
- n = getlong(ttf);
- if ( n>=MAX_SUBTABLE_TYPES+30 )
- n = MAX_SUBTABLE_TYPES+30;
- for ( i=0; i<n; ++i ) {
- tagoff[i].tag = getlong(ttf);
- tagoff[i].offset = getlong(ttf);
- }
- for ( i=0; i<n; ++i ) switch ( tagoff[i].tag ) {
- case CHR('f','c','m','t'):
- pfed_readfontcomment(ttf,info,info->pfed_start+tagoff[i].offset);
- break;
- case CHR('c','m','n','t'):
- pfed_readglyphcomments(ttf,info,info->pfed_start+tagoff[i].offset);
- break;
- case CHR('c','o','l','r'):
- pfed_readcolours(ttf,info,info->pfed_start+tagoff[i].offset);
- break;
- default:
- LogError( _("Unknown subtable '%c%c%c%c' in 'PfEd' table, ignored\n"),
- tagoff[i].tag>>24, (tagoff[i].tag>>16)&0xff, (tagoff[i].tag>>8)&0xff, tagoff[i].tag&0xff );
- break;
- }
-}
-
-/* 'TeX ' table format is as follows... */
-/* uint32 version number 0x00010000 */
-/* uint32 subtable count */
-/* struct { uint32 tab, offset } tag/offset for first subtable */
-/* struct { uint32 tab, offset } tag/offset for second subtable */
-/* ... */
-
-/* 'TeX ' 'ftpm' font parameter subtable format */
-/* short version number 0 */
-/* parameter count */
-/* array of { 4chr tag, value } */
-
-/* 'TeX ' 'htdp' per-glyph height/depth subtable format */
-/* short version number 0 */
-/* short glyph-count */
-/* array[glyph-count] of { int16 height,depth } */
-
-/* 'TeX ' 'sbsp' per-glyph sub/super script positioning subtable */
-/* short version number 0 */
-/* short glyph-count */
-/* array[glyph-count] of { int16 sub,super } */
-
-#undef MAX_SUBTABLE_TYPES
-#define MAX_SUBTABLE_TYPES 3
-
-struct TeX_subtabs {
- int next;
- struct {
- FILE *data;
- uint32 tag;
- uint32 offset;
- } subtabs[MAX_SUBTABLE_TYPES];
-};
-
-static uint32 tex_text_params[] = {
- TeX_Slant,
- TeX_Space,
- TeX_Stretch,
- TeX_Shrink,
- TeX_XHeight,
- TeX_Quad,
- TeX_ExtraSp,
- 0
-};
-static uint32 tex_math_params[] = {
- TeX_Slant,
- TeX_Space,
- TeX_Stretch,
- TeX_Shrink,
- TeX_XHeight,
- TeX_Quad,
- TeX_MathSp,
- TeX_Num1,
- TeX_Num2,
- TeX_Num3,
- TeX_Denom1,
- TeX_Denom2,
- TeX_Sup1,
- TeX_Sup2,
- TeX_Sup3,
- TeX_Sub1,
- TeX_Sub2,
- TeX_SupDrop,
- TeX_SubDrop,
- TeX_Delim1,
- TeX_Delim2,
- TeX_AxisHeight,
- 0};
-static uint32 tex_mathext_params[] = {
- TeX_Slant,
- TeX_Space,
- TeX_Stretch,
- TeX_Shrink,
- TeX_XHeight,
- TeX_Quad,
- TeX_MathSp,
- TeX_DefRuleThick,
- TeX_BigOpSpace1,
- TeX_BigOpSpace2,
- TeX_BigOpSpace3,
- TeX_BigOpSpace4,
- TeX_BigOpSpace5,
- 0};
-
-/* ************************************************************************** */
-/* ************************* The 'TeX ' table ************************* */
-/* ************************* Output ************************* */
-/* ************************************************************************** */
-
-static void TeX_dumpFontParams(SplineFont *sf, struct TeX_subtabs *tex, struct alltabs *at ) {
- FILE *fprm;
- int i,pcnt;
- uint32 *tags;
-
- if ( sf->texdata.type==tex_unset )
-return;
- tex->subtabs[tex->next].tag = CHR('f','t','p','m');
- tex->subtabs[tex->next++].data = fprm = tmpfile();
-
- putshort(fprm,0); /* sub-table version number */
- pcnt = sf->texdata.type==tex_math ? 22 : sf->texdata.type==tex_mathext ? 13 : 7;
- tags = sf->texdata.type==tex_math ? tex_math_params :
- sf->texdata.type==tex_mathext ? tex_mathext_params :
- tex_text_params;
- putshort(fprm,pcnt);
- for ( i=0; i<pcnt; ++i ) {
- putlong(fprm,tags[i]);
- putlong(fprm,sf->texdata.params[i]);
- }
- /* always aligned */
-}
-
-static void TeX_dumpHeightDepth(SplineFont *sf, struct TeX_subtabs *tex, struct alltabs *at ) {
- FILE *htdp;
- int i,j,k,last_g, gid;
- DBounds b;
-
- for ( i=at->gi.gcnt-1; i>=0; --i ) {
- gid = at->gi.bygid[i];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL &&
- (sf->glyphs[gid]->tex_height!=TEX_UNDEF || sf->glyphs[gid]->tex_depth!=TEX_UNDEF))
- break;
- }
- if ( i<0 ) /* No height/depth info */
-return;
-
- tex->subtabs[tex->next].tag = CHR('h','t','d','p');
- tex->subtabs[tex->next++].data = htdp = tmpfile();
-
- putshort(htdp,0); /* sub-table version number */
- putshort(htdp,sf->glyphs[gid]->ttf_glyph+1);/* data for this many glyphs */
-
- last_g = -1;
- for ( j=0; j<=i; ++j ) {
- gid = at->gi.bygid[j];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL ) {
- SplineChar *sc = sf->glyphs[gid];
- for ( k=last_g+1; k<sc->ttf_glyph; ++k ) {
- putshort(htdp,0);
- putshort(htdp,0);
- }
- if ( sc->tex_depth==TEX_UNDEF || sc->tex_height==TEX_UNDEF )
- SplineCharFindBounds(sc,&b);
- putshort( htdp, sc->tex_height==TEX_UNDEF ? b.maxy : sc->tex_height );
- putshort( htdp, sc->tex_depth==TEX_UNDEF ? -b.miny : sc->tex_depth );
- last_g = sc->ttf_glyph;
- }
- }
- /* always aligned */
-}
-
-static void TeX_dumpSubSuper(SplineFont *sf, struct TeX_subtabs *tex, struct alltabs *at ) {
- FILE *sbsp;
- int i,j,k,last_g, gid;
-
- for ( i=at->gi.gcnt-1; i>=0; --i ) {
- gid = at->gi.bygid[i];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL &&
- (sf->glyphs[gid]->tex_sub_pos!=TEX_UNDEF || sf->glyphs[gid]->tex_super_pos!=TEX_UNDEF))
- break;
- }
- if ( i<0 ) /* No sub/super info */
-return;
-
- tex->subtabs[tex->next].tag = CHR('s','b','s','p');
- tex->subtabs[tex->next++].data = sbsp = tmpfile();
-
- putshort(sbsp,0); /* sub-table version number */
- putshort(sbsp,sf->glyphs[gid]->ttf_glyph+1);/* data for this many glyphs */
-
- last_g = -1;
- for ( j=0; j<=i; ++j ) {
- gid = at->gi.bygid[j];
- if ( gid!=-1 && sf->glyphs[gid]!=NULL ) {
- SplineChar *sc = sf->glyphs[gid];
- for ( k=last_g+1; k<sc->ttf_glyph; ++k ) {
- putshort(sbsp,0);
- putshort(sbsp,0);
- }
- putshort( sbsp, sc->tex_sub_pos==TEX_UNDEF ? sc->width : sc->tex_sub_pos );
- putshort( sbsp, sc->tex_super_pos!=TEX_UNDEF ? sc->tex_super_pos :
- sc->tex_sub_pos!=TEX_UNDEF ? sc->width - sc->tex_sub_pos :
- 0 );
- last_g = sc->ttf_glyph;
- }
- }
- /* always aligned */
-}
-
-void tex_dump(struct alltabs *at, SplineFont *sf) {
- struct TeX_subtabs tex;
- FILE *file;
- int i;
- uint32 offset;
-
- if ( !(at->gi.flags & ttf_flag_TeXtable ))
-return;
-
- memset(&tex,0,sizeof(tex));
- TeX_dumpFontParams(sf,&tex,at);
- TeX_dumpHeightDepth(sf,&tex,at);
- TeX_dumpSubSuper(sf,&tex,at);
-
- if ( tex.next==0 )
-return; /* No subtables */
-
- at->tex = file = tmpfile();
- putlong(file, 0x00010000); /* Version number */
- putlong(file, tex.next); /* sub-table count */
- offset = 2*sizeof(uint32) + 2*tex.next*sizeof(uint32);
- for ( i=0; i<tex.next; ++i ) {
- putlong(file,tex.subtabs[i].tag);
- putlong(file,offset);
- fseek(tex.subtabs[i].data,0,SEEK_END);
- tex.subtabs[i].offset = offset;
- offset += ftell(tex.subtabs[i].data);
- }
- for ( i=0; i<tex.next; ++i ) {
- fseek(tex.subtabs[i].data,0,SEEK_SET);
- ttfcopyfile(file,tex.subtabs[i].data,tex.subtabs[i].offset,"TeX-subtable");
- }
- if ( ftell(file)&3 )
- IError("'TeX ' table not properly aligned");
- at->texlen = ftell(file);
-}
-
-/* ************************* The 'TeX ' table ************************* */
-/* ************************* Input ************************* */
-
-static void TeX_readFontParams(FILE *ttf,struct ttfinfo *info,uint32 base) {
- int i,pcnt;
- static uint32 *alltags[] = { tex_text_params, tex_math_params, tex_mathext_params };
- int j,k;
- uint32 tag;
- int32 val;
-
- fseek(ttf,base,SEEK_SET);
- if ( getushort(ttf)!=0 ) /* Don't know how to read this version of the subtable */
-return;
- pcnt = getushort(ttf);
- if ( pcnt==22 ) info->texdata.type = tex_math;
- else if ( pcnt==13 ) info->texdata.type = tex_mathext;
- else if ( pcnt>=7 ) info->texdata.type = tex_text;
- for ( i=0; i<pcnt; ++i ) {
- tag = getlong(ttf);
- val = getlong(ttf);
- for ( j=0; j<3; ++j ) {
- for ( k=0; alltags[j][k]!=0; ++k )
- if ( alltags[j][k]==tag )
- break;
- if ( alltags[j][k]==tag )
- break;
- }
- if ( j<3 )
- info->texdata.params[k] = val;
- }
-}
-
-static void TeX_readHeightDepth(FILE *ttf,struct ttfinfo *info,uint32 base) {
- int i,gcnt;
-
- fseek(ttf,base,SEEK_SET);
- if ( getushort(ttf)!=0 ) /* Don't know how to read this version of the subtable */
-return;
- gcnt = getushort(ttf);
- for ( i=0; i<gcnt && i<info->glyph_cnt; ++i ) {
- int h, d;
- h = getushort(ttf);
- d = getushort(ttf);
- if ( info->chars[i]!=NULL ) {
- info->chars[i]->tex_height = h;
- info->chars[i]->tex_depth = d;
- }
- }
-}
-
-static void TeX_readSubSuper(FILE *ttf,struct ttfinfo *info,uint32 base) {
- int i,gcnt;
-
- fseek(ttf,base,SEEK_SET);
- if ( getushort(ttf)!=0 ) /* Don't know how to read this version of the subtable */
-return;
- gcnt = getushort(ttf);
- for ( i=0; i<gcnt && i<info->glyph_cnt; ++i ) {
- int super, sub;
- sub = getushort(ttf);
- super = getushort(ttf);
- if ( info->chars[i]!=NULL ) {
- info->chars[i]->tex_sub_pos = sub;
- info->chars[i]->tex_super_pos = super;
- }
- }
-}
-
-void tex_read(FILE *ttf,struct ttfinfo *info) {
- int n,i;
- struct tagoff { uint32 tag, offset; } tagoff[MAX_SUBTABLE_TYPES+30];
-
- fseek(ttf,info->tex_start,SEEK_SET);
-
- if ( getlong(ttf)!=0x00010000 )
-return;
- n = getlong(ttf);
- if ( n>=MAX_SUBTABLE_TYPES+30 )
- n = MAX_SUBTABLE_TYPES+30;
- for ( i=0; i<n; ++i ) {
- tagoff[i].tag = getlong(ttf);
- tagoff[i].offset = getlong(ttf);
- }
- for ( i=0; i<n; ++i ) switch ( tagoff[i].tag ) {
- case CHR('f','t','p','m'):
- TeX_readFontParams(ttf,info,info->tex_start+tagoff[i].offset);
- break;
- case CHR('h','t','d','p'):
- TeX_readHeightDepth(ttf,info,info->tex_start+tagoff[i].offset);
- break;
- case CHR('s','b','s','p'):
- TeX_readSubSuper(ttf,info,info->tex_start+tagoff[i].offset);
- break;
- default:
- LogError( _("Unknown subtable '%c%c%c%c' in 'TeX ' table, ignored\n"),
- tagoff[i].tag>>24, (tagoff[i].tag>>16)&0xff, (tagoff[i].tag>>8)&0xff, tagoff[i].tag&0xff );
- break;
- }
-}
-
-/* ************************************************************************** */
-/* ************************* The 'BDF ' table ************************* */
-/* ************************* Output ************************* */
-/* ************************************************************************** */
-
-/* the BDF table is used to store BDF properties so that we can do round trip */
-/* conversion from BDF->otb->BDF without losing anything. */
-/* Format:
- USHORT version : 'BDF' table version number, must be 0x0001
- USHORT strikeCount : number of strikes in table
- ULONG stringTable : offset (from start of BDF table) to string table
-
-followed by an array of 'strikeCount' descriptors that look like:
- USHORT ppem : vertical pixels-per-EM for this strike
- USHORT num_items : number of items (properties and atoms), max is 255
-
-this array is followed by 'strikeCount' value sets. Each "value set" is
-an array of (num_items) items that look like:
- ULONG item_name : offset in string table to item name
- USHORT item_type : item type: 0 => non-property string (e.g. COMMENT)
- 1 => non-property atom (e.g. FONT)
- 2 => non-property int32
- 3 => non-property uint32
- 0x10 => flag for a property, ored
- with above value types)
- ULONG item_value : item value.
- strings => an offset into the string table
- to the corresponding string,
- without the surrending double-quotes
-
- atoms => an offset into the string table
-
- integers => the corresponding 32-bit value
-Then the string table of null terminated strings. These strings should be in
-ASCII.
-*/
-
-/* Internally FF stores BDF comments as one psuedo property per line. As you */
-/* might expect. But FreeType merges them into one large lump with newlines */
-/* between lines. Which means that BDF tables created by FreeType will be in*/
-/* that format. So we might as well be compatible. We will pack & unpack */
-/* comment lines */
-
-static int BDFPropCntMergedComments(BDFFont *bdf) {
- int i, cnt;
-
- cnt = 0;
- for ( i=0; i<bdf->prop_cnt; ++i ) {
- ++cnt;
- if ( strmatch(bdf->props[i].name,"COMMENT")==0 )
- break;
- }
- for ( ; i<bdf->prop_cnt; ++i ) {
- if ( strmatch(bdf->props[i].name,"COMMENT")==0 )
- continue;
- ++cnt;
- }
-return( cnt );
-}
-
-static char *MergeComments(BDFFont *bdf) {
- int len, i;
- char *str;
-
- len = 0;
- for ( i=0; i<bdf->prop_cnt; ++i ) {
- if ( strmatch(bdf->props[i].name,"COMMENT")==0 &&
- ((bdf->props[i].type & ~prt_property)==prt_string ||
- (bdf->props[i].type & ~prt_property)==prt_atom ))
- len += strlen( bdf->props[i].u.atom ) + 1;
- }
- if ( len==0 )
-return( copy( "" ));
-
- str = galloc( len+1 );
- len = 0;
- for ( i=0; i<bdf->prop_cnt; ++i ) {
- if ( strmatch(bdf->props[i].name,"COMMENT")==0 &&
- ((bdf->props[i].type & ~prt_property)==prt_string ||
- (bdf->props[i].type & ~prt_property)==prt_atom )) {
- strcpy(str+len,bdf->props[i].u.atom );
- len += strlen( bdf->props[i].u.atom ) + 1;
- str[len-1] = '\n';
- }
- }
- str[len-1] = '\0';
-return( str );
-}
-
-#define AMAX 50
-
-int ttf_bdf_dump(SplineFont *sf,struct alltabs *at,int32 *sizes) {
- FILE *strings;
- struct atomoff { char *name; int pos; } atomoff[AMAX];
- int acnt=0;
- int spcnt = 0;
- int i,j,k;
- BDFFont *bdf;
- long pos;
-
- for ( i=0; sizes[i]!=0; ++i ) {
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(sizes[i]&0xffff) || BDFDepth(bdf)!=(sizes[i]>>16)); bdf=bdf->next );
- if ( bdf!=NULL && bdf->prop_cnt!=0 )
- ++spcnt;
- }
- if ( spcnt==0 ) /* No strikes with properties */
-return(true);
-
- at->bdf = tmpfile();
- strings = tmpfile();
-
- putshort(at->bdf,0x0001);
- putshort(at->bdf,spcnt);
- putlong(at->bdf,0); /* offset to string table */
-
- for ( i=0; sizes[i]!=0; ++i ) {
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(sizes[i]&0xffff) || BDFDepth(bdf)!=(sizes[i]>>16)); bdf=bdf->next );
- if ( bdf!=NULL && bdf->prop_cnt!=0 ) {
- putshort(at->bdf,bdf->pixelsize);
- putshort(at->bdf,BDFPropCntMergedComments(bdf));
- }
- }
-
- for ( i=0; sizes[i]!=0; ++i ) {
- for ( bdf=sf->bitmaps; bdf!=NULL && (bdf->pixelsize!=(sizes[i]&0xffff) || BDFDepth(bdf)!=(sizes[i]>>16)); bdf=bdf->next );
- if ( bdf!=NULL && bdf->prop_cnt!=0 ) {
- int saw_comment=0;
- char *str;
- for ( j=0; j<bdf->prop_cnt; ++j ) {
- if ( strmatch(bdf->props[j].name,"COMMENT")==0 && saw_comment )
- continue;
- /* Try to reuse keyword names in string space */
- for ( k=0 ; k<acnt; ++k ) {
- if ( strcmp(atomoff[k].name,bdf->props[j].name)==0 )
- break;
- }
- if ( k>=acnt && k<AMAX ) {
- atomoff[k].name = bdf->props[j].name;
- atomoff[k].pos = ftell(strings);
- ++acnt;
- fwrite(atomoff[k].name,1,strlen(atomoff[k].name)+1,strings);
- }
- if ( k<acnt )
- putlong(at->bdf,atomoff[k].pos);
- else {
- putlong(at->bdf,ftell(strings));
- fwrite(bdf->props[j].name,1,strlen(bdf->props[j].name)+1,strings);
- }
- str = bdf->props[j].u.str;
- if ( strmatch(bdf->props[j].name,"COMMENT")==0 ) {
- str = MergeComments(bdf);
- saw_comment = true;
- }
- putshort(at->bdf,bdf->props[j].type);
- if ( (bdf->props[j].type & ~prt_property)==prt_string ||
- (bdf->props[j].type & ~prt_property)==prt_atom ) {
- putlong(at->bdf,ftell(strings));
- fwrite(str,1,strlen(str)+1,strings);
- if ( str!=bdf->props[j].u.str )
- free(str);
- } else {
- putlong(at->bdf,bdf->props[j].u.val);
- }
- }
- }
- }
-
- pos = ftell(at->bdf);
- fseek(at->bdf,4,SEEK_SET);
- putlong(at->bdf,pos);
- fseek(at->bdf,0,SEEK_END);
-
- if ( !ttfcopyfile(at->bdf,strings,pos,"BDF string table"))
-return( false );
-
- at->bdflen = ftell( at->bdf );
-
- /* Align table */
- if ( at->bdflen&1 )
- putc('\0',at->bdf);
- if ( (at->bdflen+1)&2 )
- putshort(at->bdf,0);
-
-return( true );
-}
-
-/* ************************* The 'BDF ' table ************************* */
-/* ************************* Input ************************* */
-
-static char *getstring(FILE *ttf,long start) {
- long here = ftell(ttf);
- int len, ch;
- char *str, *pt;
-
- fseek(ttf,start,SEEK_SET);
- for ( len=1; (ch=getc(ttf))>0 ; ++len );
- fseek(ttf,start,SEEK_SET);
- pt = str = galloc(len);
- while ( (ch=getc(ttf))>0 )
- *pt++ = ch;
- *pt = '\0';
- fseek(ttf,here,SEEK_SET);
-return( str );
-}
-
-/* COMMENTS get stored all in one lump by freetype. De-lump them */
-static int CheckForNewlines(BDFFont *bdf,int k) {
- char *pt, *start;
- int cnt, i;
-
- for ( cnt=0, pt = bdf->props[k].u.atom; *pt; ++pt )
- if ( *pt=='\n' )
- ++cnt;
- if ( cnt==0 )
-return( k );
-
- bdf->prop_cnt += cnt;
- bdf->props = grealloc(bdf->props, bdf->prop_cnt*sizeof( BDFProperties ));
-
- pt = strchr(bdf->props[k].u.atom,'\n');
- *pt = '\0'; ++pt;
- for ( i=1; i<=cnt; ++i ) {
- start = pt;
- while ( *pt!='\n' && *pt!='\0' ) ++pt;
- bdf->props[k+i].name = copy(bdf->props[k].name);
- bdf->props[k+i].type = bdf->props[k].type;
- bdf->props[k+i].u.atom = copyn(start,pt-start);
- if ( *pt=='\n' ) ++pt;
- }
- pt = copy( bdf->props[k].u.atom );
- free( bdf->props[k].u.atom );
- bdf->props[k].u.atom = pt;
-return( k+cnt );
-}
-
-void ttf_bdf_read(FILE *ttf,struct ttfinfo *info) {
- int strike_cnt, i,j,k;
- long string_start;
- struct bdfinfo { BDFFont *bdf; int cnt; } *bdfinfo;
- BDFFont *bdf;
-
- if ( info->bdf_start==0 )
-return;
- fseek(ttf,info->bdf_start,SEEK_SET);
- if ( getushort(ttf)!=1 )
-return;
- strike_cnt = getushort(ttf);
- string_start = getlong(ttf) + info->bdf_start;
-
- bdfinfo = galloc(strike_cnt*sizeof(struct bdfinfo));
- for ( i=0; i<strike_cnt; ++i ) {
- int ppem, num_items;
- ppem = getushort(ttf);
- num_items = getushort(ttf);
- for ( bdf=info->bitmaps; bdf!=NULL; bdf=bdf->next )
- if ( bdf->pixelsize==ppem )
- break;
- bdfinfo[i].bdf = bdf;
- bdfinfo[i].cnt = num_items;
- }
-
- for ( i=0; i<strike_cnt; ++i ) {
- if ( (bdf = bdfinfo[i].bdf) ==NULL )
- fseek(ttf,10*bdfinfo[i].cnt,SEEK_CUR);
- else {
- bdf->prop_cnt = bdfinfo[i].cnt;
- bdf->props = galloc(bdf->prop_cnt*sizeof(BDFProperties));
- for ( j=k=0; j<bdfinfo[i].cnt; ++j, ++k ) {
- long name = getlong(ttf);
- int type = getushort(ttf);
- long value = getlong(ttf);
- bdf->props[k].type = type;
- bdf->props[k].name = getstring(ttf,string_start+name);
- switch ( type&~prt_property ) {
- case prt_int: case prt_uint:
- bdf->props[k].u.val = value;
- if ( strcmp(bdf->props[k].name,"FONT_ASCENT")==0 &&
- value<=bdf->pixelsize ) {
- bdf->ascent = value;
- bdf->descent = bdf->pixelsize-value;
- }
- break;
- case prt_string: case prt_atom:
- bdf->props[k].u.str = getstring(ttf,string_start+value);
- k = CheckForNewlines(bdf,k);
- break;
- }
- }
- }
- }
-}
-
-
-/* ************************************************************************** */
-/* ************************* The 'FFTM' table ************************* */
-/* ************************* Output ************************* */
-/* ************************************************************************** */
-
-/* FontForge timestamp table */
-/* Contains: */
-/* date of fontforge sources */
-/* date of font's (not file's) creation */
-/* date of font's modification */
-int ttf_fftm_dump(SplineFont *sf,struct alltabs *at) {
- int32 results[2];
- extern const time_t source_modtime;
-
- at->fftmf = tmpfile();
-
- putlong(at->fftmf,0x00000001); /* Version */
-
- cvt_unix_to_1904(source_modtime,results);
- putlong(at->fftmf,results[1]);
- putlong(at->fftmf,results[0]);
-
- cvt_unix_to_1904(sf->creationtime,results);
- putlong(at->fftmf,results[1]);
- putlong(at->fftmf,results[0]);
-
- cvt_unix_to_1904(sf->modificationtime,results);
- putlong(at->fftmf,results[1]);
- putlong(at->fftmf,results[0]);
-
- at->fftmlen = ftell(at->fftmf); /* had better be 7*4 */
- /* It will never be misaligned */
- if ( (at->fftmlen&1)!=0 )
- putc(0,at->fftmf);
- if ( ((at->fftmlen+1)&2)!=0 )
- putshort(at->fftmf,0);
-return( true );
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/xlib.opt b/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/xlib.opt
deleted file mode 100644
index 8014a9e3977..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/xlib.opt
+++ /dev/null
@@ -1,13 +0,0 @@
-sys$library:libungif/lib
-sys$library:freetype/lib
-sys$library:tiff/lib
-sys$library:libjpeg/lib
-sys$library:libpng/lib
-sys$library:libz/lib
-sys$library:libuninameslist/lib
-sys$library:libxml/lib
-sys$library:intl/lib
-sys$library:iconv/lib
-sys$library:decw$xlibshr.exe/share
-sys$library:decw$xextlibshr.exe/share
-sys$share:vms_jackets.exe/share
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/src/ffdummies.c b/Build/source/texk/web2c/luatexdir/luafontforge/src/ffdummies.c
deleted file mode 100644
index dce8c116c0f..00000000000
--- a/Build/source/texk/web2c/luatexdir/luafontforge/src/ffdummies.c
+++ /dev/null
@@ -1,5552 +0,0 @@
-
-/* some dummy functions and variables so that a few ff source files can be ignored */
-
-#define FONTFORGE_CONFIG_NO_WINDOWING_UI 1
-
-#include "pfaeditui.h"
-#include <unistd.h>
-#include <math.h>
-#include <time.h>
-#include <locale.h>
-#include <utype.h>
-#include <chardata.h>
-#include <ustring.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "sd.h"
-
-#include "ttf.h" /* for macsettingname */
-
-void _gwwv_post_error(const char *fmt, va_list ap) ;
-
-/* some Gdraw routines for filesystem access */
-
-
-int GFileIsDir(const char *file) {
- char buffer[1000];
- sprintf(buffer,"%s/.",file);
-return( access(buffer,0)==0 );
-}
-
-int GFileExists(const char *file) {
-return( access(file,0)==0 );
-}
-
-char *GFileNameTail(const char *oldname) {
- char *pt;
-
- pt = strrchr(oldname,'/');
- if ( pt !=NULL )
-return( pt+1);
- else
-return( (char *)oldname );
-}
-
-
-char *GFileAppendFile(char *dir,char *name,int isdir) {
- char *ret, *pt;
-
- ret = galloc((strlen(dir)+strlen(name)+3));
- strcpy(ret,dir);
- pt = ret+strlen(ret);
- if ( pt>ret && pt[-1]!='/' )
- *pt++ = '/';
- strcpy(pt,name);
- if ( isdir ) {
- pt += strlen(pt);
- if ( pt>ret && pt[-1]!='/' ) {
- *pt++ = '/';
- *pt = '\0';
- }
- }
-return(ret);
-}
-
-int GFileReadable(char *file) {
-return( access(file,04)==0 );
-}
-
-static char dirname_[1024];
-
-
-char *GFileGetAbsoluteName(char *name, char *result, int rsiz) {
- /* result may be the same as name */
- char buffer[1000];
-
- if ( *name!='/' ) {
- char *pt, *spt, *rpt, *bpt;
-
- if ( dirname_[0]=='\0' ) {
- getcwd(dirname_,sizeof(dirname_));
- }
- strcpy(buffer,dirname_);
- if ( buffer[strlen(buffer)-1]!='/' )
- strcat(buffer,"/");
- strcat(buffer,name);
-
- /* Normalize out any .. */
- spt = rpt = buffer;
- while ( *spt!='\0' ) {
- if ( *spt=='/' ) ++spt;
- for ( pt = spt; *pt!='\0' && *pt!='/'; ++pt );
- if ( pt==spt ) /* Found // in a path spec, reduce to / (we've*/
- strcpy(spt,pt); /* skipped past the :// of the machine name) */
- else if ( pt==spt+1 && spt[0]=='.' ) /* Noop */
- strcpy(spt,pt);
- else if ( pt==spt+2 && spt[0]=='.' && spt[1]=='.' ) {
- for ( bpt=spt-2 ; bpt>rpt && *bpt!='/'; --bpt );
- if ( bpt>=rpt && *bpt=='/' ) {
- strcpy(bpt,pt);
- spt = bpt;
- } else {
- rpt = pt;
- spt = pt;
- }
- } else
- spt = pt;
- }
- name = buffer;
- if ( rsiz>sizeof(buffer)) rsiz = sizeof(buffer); /* Else valgrind gets unhappy */
- }
- if (result!=name) {
- strncpy(result,name,rsiz);
- result[rsiz-1]='\0';
- }
-return(result);
-}
-
-
-
-/* a gettext miss */
-
-char *sgettext(const char *msgid) {
- const char *msgval = msgid;
- char *found;
- if ( (found = strrchr (msgid, '|'))!=NULL )
- msgval = found+1;
- return (char *) msgval;
-}
-
-/* some utype.c macros, in function from */
-
-int unic_isrighttoleft (int c) {
- /* most of the holes are combining chars */
- if ((c==0x05be) || (c==0x05c0) || (c==0x05c3) || (c==0x05c6) ||
- (c>=0x05d0 && c<=0x05ea) ||
- (c>=0x05f0 && c<=0x05f4) ||
- (c>=0x0600 && c<=0x0603) ||
- (c==0x060b) || (c==0x060d) || (c==0x061b) ||
- (c>=0x061e && c<=0x061f) ||
- (c>=0x0621 && c<=0x063a) ||
- (c>=0x0640 && c<=0x064a) ||
- (c>=0x066d && c<=0x066f) ||
- (c>=0x0671 && c<=0x06d5) ||
- (c==0x06dd) ||
- (c>=0x06e5 && c<=0x06e6) ||
- (c>=0x06ee && c<=0x06ef) ||
- (c>=0x06fa && c<=0x070d) ||
- (c==0x0710) ||
- (c>=0x0712 && c<=0x072f) ||
- (c>=0x074d && c<=0x076d) ||
- (c>=0x0780 && c<=0x07a5) ||
- (c==0x07b1) ||
- (c>=0x07c0 && c<=0x07ea) ||
- (c>=0x07f4 && c<=0x07f5) ||
- (c==0x07fa) ||
- (c==0x200f) || (c==0x202b) || (c==0x202e) ||
- (c>=0xfb1d && c<=0xfb3c) ||
- (c==0xfb3e) ||
- (c>=0xfb40 && c<=0xfbb1) ||
- (c>=0xfbd3 && c<=0xfd3d) ||
- (c>=0xfd50 && c<=0xfd8f) ||
- (c>=0xfd92 && c<=0xfdc7) ||
- (c>=0xfdf0 && c<=0xfdfc) ||
- (c>=0xfe70 && c<=0xfefc)) {
- if ((c==0xfe75) || (c==0xfb42) ||
- (c==0xfb45) || (c==0xfb29) ||
- (c==0xfb37) || (c==0xfb1e)) {
- return 0;
- }
- return 1;
- }
- return 0;
-}
-
-int unic_islefttoright (int c) {
- if((c>=0x0041 && c<=0x005a) ||
- (c>=0x0061 && c<=0x007a) ||
- (c==0x00aa) || (c==0x00b5) || (c==0x00ba) ||
- (c>=0x00c0 && c<=0x00d6) ||
- (c>=0x00d8 && c<=0x00f6) ||
- (c>=0x00f8 && c<=0x02b8) ||
- (c>=0x02bb && c<=0x02c1) ||
- (c>=0x02d0 && c<=0x02d1) ||
- (c>=0x02e0 && c<=0x02e4) ||
- (c==0x02ee) ||
- (c>=0x037a && c<=0x037d) ||
- (c==0x0386) ||
- (c>=0x0388 && c<=0x038a) ||
- (c==0x038c) ||
- (c>=0x038e && c<=0x03a1) ||
- (c>=0x03a3 && c<=0x03ce) ||
- (c>=0x03d0 && c<=0x03f5) ||
- (c>=0x03f7 && c<=0x0482) ||
- (c>=0x048a && c<=0x0513) ||
- (c>=0x0531 && c<=0x0556) ||
- (c>=0x0559 && c<=0x055f) ||
- (c>=0x0561 && c<=0x0587) ||
- (c==0x0589) ||
- (c>=0x0903 && c<=0x0939) ||
- (c>=0x093d && c<=0x0940) ||
- (c>=0x0949 && c<=0x094c) ||
- (c==0x0950) ||
- (c>=0x0958 && c<=0x0961) ||
- (c>=0x0964 && c<=0x0970) ||
- (c>=0x097b && c<=0x097f) ||
- (c>=0x0982 && c<=0x0983) ||
- (c>=0x0985 && c<=0x098c) ||
- (c>=0x098f && c<=0x0990) ||
- (c>=0x0993 && c<=0x09a8) ||
- (c>=0x09aa && c<=0x09b0) ||
- (c==0x09b2) ||
- (c>=0x09b6 && c<=0x09b9) ||
- (c>=0x09bd && c<=0x09c0) ||
- (c>=0x09c7 && c<=0x09c8) ||
- (c>=0x09cb && c<=0x09cc) ||
- (c==0x09ce) ||
- (c==0x09d7) ||
- (c>=0x09dc && c<=0x09dd) ||
- (c>=0x09df && c<=0x09e1) ||
- (c>=0x09e6 && c<=0x09f1) ||
- (c>=0x09f4 && c<=0x09fa) ||
- (c==0x0a03) ||
- (c>=0x0a05 && c<=0x0a0a) ||
- (c>=0x0a0f && c<=0x0a10) ||
- (c>=0x0a13 && c<=0x0a28) ||
- (c>=0x0a2a && c<=0x0a30) ||
- (c>=0x0a32 && c<=0x0a33) ||
- (c>=0x0a35 && c<=0x0a36) ||
- (c>=0x0a38 && c<=0x0a39) ||
- (c>=0x0a3e && c<=0x0a40) ||
- (c>=0x0a59 && c<=0x0a5c) ||
- (c==0x0a5e) ||
- (c>=0x0a66 && c<=0x0a6f) ||
- (c>=0x0a72 && c<=0x0a74) ||
- (c==0x0a83) ||
- (c>=0x0a85 && c<=0x0a8d) ||
- (c>=0x0a8f && c<=0x0a91) ||
- (c>=0x0a93 && c<=0x0aa8) ||
- (c>=0x0aaa && c<=0x0ab0) ||
- (c>=0x0ab2 && c<=0x0ab3) ||
- (c>=0x0ab5 && c<=0x0ab9) ||
- (c>=0x0abd && c<=0x0ac0) ||
- (c==0x0ac9) ||
- (c>=0x0acb && c<=0x0acc) ||
- (c==0x0ad0) ||
- (c>=0x0ae0 && c<=0x0ae1) ||
- (c>=0x0ae6 && c<=0x0aef) ||
- (c>=0x0b02 && c<=0x0b03) ||
- (c>=0x0b05 && c<=0x0b0c) ||
- (c>=0x0b0f && c<=0x0b10) ||
- (c>=0x0b13 && c<=0x0b28) ||
- (c>=0x0b2a && c<=0x0b30) ||
- (c>=0x0b32 && c<=0x0b33) ||
- (c>=0x0b35 && c<=0x0b39) ||
- (c>=0x0b3d && c<=0x0b3e) ||
- (c==0x0b40) ||
- (c>=0x0b47 && c<=0x0b48) ||
- (c>=0x0b4b && c<=0x0b4c) ||
- (c==0x0b57) ||
- (c>=0x0b5c && c<=0x0b5d) ||
- (c>=0x0b5f && c<=0x0b61) ||
- (c>=0x0b66 && c<=0x0b71) ||
- (c==0x0b83) ||
- (c>=0x0b85 && c<=0x0b8a) ||
- (c>=0x0b8e && c<=0x0b90) ||
- (c>=0x0b92 && c<=0x0b95) ||
- (c>=0x0b99 && c<=0x0b9a) ||
- (c==0x0b9c) ||
- (c>=0x0b9e && c<=0x0b9f) ||
- (c>=0x0ba3 && c<=0x0ba4) ||
- (c>=0x0ba8 && c<=0x0baa) ||
- (c>=0x0bae && c<=0x0bb9) ||
- (c>=0x0bbe && c<=0x0bbf) ||
- (c>=0x0bc1 && c<=0x0bc2) ||
- (c>=0x0bc6 && c<=0x0bc8) ||
- (c>=0x0bca && c<=0x0bcc) ||
- (c==0x0bd7) ||
- (c>=0x0be6 && c<=0x0bf2) ||
- (c>=0x0c01 && c<=0x0c03) ||
- (c>=0x0c05 && c<=0x0c0c) ||
- (c>=0x0c0e && c<=0x0c10) ||
- (c>=0x0c12 && c<=0x0c28) ||
- (c>=0x0c2a && c<=0x0c33) ||
- (c>=0x0c35 && c<=0x0c39) ||
- (c>=0x0c41 && c<=0x0c44) ||
- (c>=0x0c60 && c<=0x0c61) ||
- (c>=0x0c66 && c<=0x0c6f) ||
- (c>=0x0c82 && c<=0x0c83) ||
- (c>=0x0c85 && c<=0x0c8c) ||
- (c>=0x0c8e && c<=0x0c90) ||
- (c>=0x0c92 && c<=0x0ca8) ||
- (c>=0x0caa && c<=0x0cb3) ||
- (c>=0x0cb5 && c<=0x0cb9) ||
- (c>=0x0cbd && c<=0x0cc4) ||
- (c>=0x0cc6 && c<=0x0cc8) ||
- (c>=0x0cca && c<=0x0ccb) ||
- (c>=0x0cd5 && c<=0x0cd6) ||
- (c==0x0cde) ||
- (c>=0x0ce0 && c<=0x0ce1) ||
- (c>=0x0ce6 && c<=0x0cef) ||
- (c>=0x0d02 && c<=0x0d03) ||
- (c>=0x0d05 && c<=0x0d0c) ||
- (c>=0x0d0e && c<=0x0d10) ||
- (c>=0x0d12 && c<=0x0d28) ||
- (c>=0x0d2a && c<=0x0d39) ||
- (c>=0x0d3e && c<=0x0d40) ||
- (c>=0x0d46 && c<=0x0d48) ||
- (c>=0x0d4a && c<=0x0d4c) ||
- (c==0x0d57) ||
- (c>=0x0d60 && c<=0x0d61) ||
- (c>=0x0d66 && c<=0x0d6f) ||
- (c>=0x0d82 && c<=0x0d83) ||
- (c>=0x0d85 && c<=0x0d96) ||
- (c>=0x0d9a && c<=0x0db1) ||
- (c>=0x0db3 && c<=0x0dbb) ||
- (c==0x0dbd) ||
- (c>=0x0dc0 && c<=0x0dc6) ||
- (c>=0x0dcf && c<=0x0dd1) ||
- (c>=0x0dd8 && c<=0x0ddf) ||
- (c>=0x0df2 && c<=0x0df4) ||
- (c>=0x0e01 && c<=0x0e30) ||
- (c>=0x0e32 && c<=0x0e33) ||
- (c>=0x0e40 && c<=0x0e46) ||
- (c>=0x0e4f && c<=0x0e5b) ||
- (c>=0x0e81 && c<=0x0e82) ||
- (c==0x0e84) ||
- (c>=0x0e87 && c<=0x0e88) ||
- (c==0x0e8a) ||
- (c==0x0e8d) ||
- (c>=0x0e94 && c<=0x0e97) ||
- (c>=0x0e99 && c<=0x0e9f) ||
- (c>=0x0ea1 && c<=0x0ea3) ||
- (c==0x0ea5) ||
- (c==0x0ea7) ||
- (c>=0x0eaa && c<=0x0eab) ||
- (c>=0x0ead && c<=0x0eb0) ||
- (c>=0x0eb2 && c<=0x0eb3) ||
- (c==0x0ebd) ||
- (c>=0x0ec0 && c<=0x0ec4) ||
- (c==0x0ec6) ||
- (c>=0x0ed0 && c<=0x0ed9) ||
- (c>=0x0edc && c<=0x0edd) ||
- (c>=0x0f00 && c<=0x0f17) ||
- (c>=0x0f1a && c<=0x0f34) ||
- (c==0x0f36) ||
- (c==0x0f38) ||
- (c>=0x0f3e && c<=0x0f47) ||
- (c>=0x0f49 && c<=0x0f6a) ||
- (c==0x0f7f) ||
- (c==0x0f85) ||
- (c>=0x0f88 && c<=0x0f8b) ||
- (c>=0x0fbe && c<=0x0fc5) ||
- (c>=0x0fc7 && c<=0x0fcc) ||
- (c>=0x0fcf && c<=0x0fd1) ||
- (c>=0x1000 && c<=0x1021) ||
- (c>=0x1023 && c<=0x1027) ||
- (c>=0x1029 && c<=0x102a) ||
- (c==0x102c) ||
- (c==0x1031) ||
- (c==0x1038) ||
- (c>=0x1040 && c<=0x1057) ||
- (c>=0x10a0 && c<=0x10c5) ||
- (c>=0x10d0 && c<=0x10fc) ||
- (c>=0x1100 && c<=0x1159) ||
- (c>=0x115f && c<=0x11a2) ||
- (c>=0x11a8 && c<=0x11f9) ||
- (c>=0x1200 && c<=0x1248) ||
- (c>=0x124a && c<=0x124d) ||
- (c>=0x1250 && c<=0x1256) ||
- (c==0x1258) ||
- (c>=0x125a && c<=0x125d) ||
- (c>=0x1260 && c<=0x1288) ||
- (c>=0x128a && c<=0x128d) ||
- (c>=0x1290 && c<=0x12b0) ||
- (c>=0x12b2 && c<=0x12b5) ||
- (c>=0x12b8 && c<=0x12be) ||
- (c==0x12c0) ||
- (c>=0x12c2 && c<=0x12c5) ||
- (c>=0x12c8 && c<=0x12d6) ||
- (c>=0x12d8 && c<=0x1310) ||
- (c>=0x1312 && c<=0x1315) ||
- (c>=0x1318 && c<=0x135a) ||
- (c>=0x1360 && c<=0x137c) ||
- (c>=0x1380 && c<=0x138f) ||
- (c>=0x13a0 && c<=0x13f4) ||
- (c>=0x1401 && c<=0x1676) ||
- (c>=0x1681 && c<=0x169a) ||
- (c>=0x16a0 && c<=0x16f0) ||
- (c>=0x1700 && c<=0x170c) ||
- (c>=0x170e && c<=0x1711) ||
- (c>=0x1720 && c<=0x1731) ||
- (c>=0x1735 && c<=0x1736) ||
- (c>=0x1740 && c<=0x1751) ||
- (c>=0x1760 && c<=0x176c) ||
- (c>=0x176e && c<=0x1770) ||
- (c>=0x1780 && c<=0x17b6) ||
- (c>=0x17be && c<=0x17c5) ||
- (c>=0x17c7 && c<=0x17c8) ||
- (c>=0x17d4 && c<=0x17da) ||
- (c==0x17dc) ||
- (c>=0x17e0 && c<=0x17e9) ||
- (c>=0x1810 && c<=0x1819) ||
- (c>=0x1820 && c<=0x1877) ||
- (c>=0x1880 && c<=0x18a8) ||
- (c>=0x1900 && c<=0x191c) ||
- (c>=0x1923 && c<=0x1926) ||
- (c>=0x1930 && c<=0x1931) ||
- (c>=0x1933 && c<=0x1938) ||
- (c>=0x1946 && c<=0x196d) ||
- (c>=0x1970 && c<=0x1974) ||
- (c>=0x1980 && c<=0x19a9) ||
- (c>=0x19b0 && c<=0x19c9) ||
- (c>=0x19d0 && c<=0x19d9) ||
- (c>=0x1a00 && c<=0x1a16) ||
- (c>=0x1a19 && c<=0x1a1b) ||
- (c>=0x1a1e && c<=0x1a1f) ||
- (c>=0x1b04 && c<=0x1b33) ||
- (c==0x1b35) ||
- (c==0x1b3b) ||
- (c>=0x1b3d && c<=0x1b41) ||
- (c>=0x1b43 && c<=0x1b4b) ||
- (c>=0x1b50 && c<=0x1b6a) ||
- (c>=0x1b74 && c<=0x1b7c) ||
- (c>=0x1d00 && c<=0x1dbf) ||
- (c>=0x1e00 && c<=0x1e9b) ||
- (c>=0x1ea0 && c<=0x1ef9) ||
- (c>=0x1f00 && c<=0x1f15) ||
- (c>=0x1f18 && c<=0x1f1d) ||
- (c>=0x1f20 && c<=0x1f45) ||
- (c>=0x1f48 && c<=0x1f4d) ||
- (c>=0x1f50 && c<=0x1f57) ||
- (c==0x1f59) ||
- (c==0x1f5b) ||
- (c==0x1f5d) ||
- (c>=0x1f5f && c<=0x1f7d) ||
- (c>=0x1f80 && c<=0x1fb4) ||
- (c>=0x1fb6 && c<=0x1fbc) ||
- (c==0x1fbe) ||
- (c>=0x1fc2 && c<=0x1fc4) ||
- (c>=0x1fc6 && c<=0x1fcc) ||
- (c>=0x1fd0 && c<=0x1fd3) ||
- (c>=0x1fd6 && c<=0x1fdb) ||
- (c>=0x1fe0 && c<=0x1fec) ||
- (c>=0x1ff2 && c<=0x1ff4) ||
- (c>=0x1ff6 && c<=0x1ffc) ||
- (c==0x200e) ||
- (c==0x202a) ||
- (c==0x202d) ||
- (c==0x2071) ||
- (c==0x207f) ||
- (c>=0x2090 && c<=0x2094) ||
- (c==0x2102) ||
- (c==0x2107) ||
- (c>=0x210a && c<=0x2113) ||
- (c==0x2115) ||
- (c>=0x2119 && c<=0x211d) ||
- (c==0x2124) ||
- (c==0x2126) ||
- (c==0x2128) ||
- (c>=0x212a && c<=0x212d) ||
- (c>=0x212f && c<=0x2139) ||
- (c>=0x213c && c<=0x213f) ||
- (c>=0x2145 && c<=0x2149) ||
- (c==0x214e) ||
- (c>=0x2160 && c<=0x2184) ||
- (c>=0x2336 && c<=0x237a) ||
- (c==0x2395) ||
- (c>=0x249c && c<=0x24e9) ||
- (c==0x26ac) ||
- (c>=0x2800 && c<=0x28ff) ||
- (c>=0x2c00 && c<=0x2c2e) ||
- (c>=0x2c30 && c<=0x2c5e) ||
- (c>=0x2c60 && c<=0x2c6c) ||
- (c>=0x2c74 && c<=0x2c77) ||
- (c>=0x2c80 && c<=0x2ce4) ||
- (c>=0x2d00 && c<=0x2d25) ||
- (c>=0x2d30 && c<=0x2d65) ||
- (c==0x2d6f) ||
- (c>=0x2d80 && c<=0x2d96) ||
- (c>=0x2da0 && c<=0x2da6) ||
- (c>=0x2da8 && c<=0x2dae) ||
- (c>=0x2db0 && c<=0x2db6) ||
- (c>=0x2db8 && c<=0x2dbe) ||
- (c>=0x2dc0 && c<=0x2dc6) ||
- (c>=0x2dc8 && c<=0x2dce) ||
- (c>=0x2dd0 && c<=0x2dd6) ||
- (c>=0x2dd8 && c<=0x2dde) ||
- (c>=0x3005 && c<=0x3007) ||
- (c>=0x3021 && c<=0x3029) ||
- (c>=0x3031 && c<=0x3035) ||
- (c>=0x3038 && c<=0x303c) ||
- (c>=0x3041 && c<=0x3096) ||
- (c>=0x309d && c<=0x309f) ||
- (c>=0x30a1 && c<=0x30fa) ||
- (c>=0x30fc && c<=0x30ff) ||
- (c>=0x3105 && c<=0x312c) ||
- (c>=0x3131 && c<=0x318e) ||
- (c>=0x3190 && c<=0x31b7) ||
- (c>=0x31f0 && c<=0x321c) ||
- (c>=0x3220 && c<=0x3243) ||
- (c>=0x3260 && c<=0x327b) ||
- (c>=0x327f && c<=0x32b0) ||
- (c>=0x32c0 && c<=0x32cb) ||
- (c>=0x32d0 && c<=0x32fe) ||
- (c>=0x3300 && c<=0x3376) ||
- (c>=0x337b && c<=0x33dd) ||
- (c>=0x33e0 && c<=0x33fe) ||
- (c>=0x3400 && c<=0x4db5) ||
- (c>=0x4e00 && c<=0x9fbb) ||
- (c>=0xa000 && c<=0xa48c) ||
- (c>=0xa800 && c<=0xa801) ||
- (c>=0xa803 && c<=0xa805) ||
- (c>=0xa807 && c<=0xa80a) ||
- (c>=0xa80c && c<=0xa824) ||
- (c==0xa827) ||
- (c>=0xa840 && c<=0xa873) ||
- (c>=0xac00 && c<=0xd7a3) ||
- (c>=0xd800 && c<=0xfa2d) ||
- (c>=0xfa30 && c<=0xfa6a) ||
- (c>=0xfa70 && c<=0xfad9) ||
- (c>=0xfb00 && c<=0xfb06) ||
- (c>=0xfb13 && c<=0xfb17) ||
- (c>=0xff21 && c<=0xff3a) ||
- (c>=0xff41 && c<=0xff5a) ||
- (c>=0xff66 && c<=0xffbe) ||
- (c>=0xffc2 && c<=0xffc7) ||
- (c>=0xffca && c<=0xffcf) ||
- (c>=0xffd2 && c<=0xffd7) ||
- (c>=0xffda && c<=0xffdc)) {
- return 1;
- }
- return 0;
-}
-
-int unic_isdigit (int c) {
- if ((c>=0x0030 && c<=0x0039) ||
- (c>=0x0660 && c<=0x0669) ||
- (c>=0x06f0 && c<=0x06f9) ||
- (c>=0x07c0 && c<=0x07c9) ||
- (c>=0x0966 && c<=0x096f) ||
- (c>=0x09e6 && c<=0x09ef) ||
- (c>=0x0a66 && c<=0x0a6f) ||
- (c>=0x0ae6 && c<=0x0aef) ||
- (c>=0x0b66 && c<=0x0b6f) ||
- (c>=0x0be6 && c<=0x0bef) ||
- (c>=0x0c66 && c<=0x0c6f) ||
- (c>=0x0ce6 && c<=0x0cef) ||
- (c>=0x0d66 && c<=0x0d6f) ||
- (c>=0x0e50 && c<=0x0e59) ||
- (c>=0x0ed0 && c<=0x0ed9) ||
- (c>=0x0f20 && c<=0x0f29) ||
- (c>=0x1040 && c<=0x1049) ||
- (c>=0x17e0 && c<=0x17e9) ||
- (c>=0x1810 && c<=0x1819) ||
- (c>=0x1946 && c<=0x194f) ||
- (c>=0x19d0 && c<=0x19d9) ||
- (c>=0x1b50 && c<=0x1b59) ||
- (c>=0xff10 && c<=0xff19))
- return 1;
- return 0;
-}
-
-
-int unic_iscombining (int c) {
- if ((c>=0x0300 && c<=0x0357) ||
- (c>=0x035d && c<=0x0362) ||
- (c>=0x0483 && c<=0x0486) ||
- (c>=0x07eb && c<=0x07f3) ||
- (c>=0x1b6b && c<=0x1b73) ||
- (c>=0x1dc4 && c<=0x1dca) ||
- (c>=0x1dfe && c<=0x1dff) ||
- (c==0x202a) ||
- (c>=0x20d0 && c<=0x20dc) ||
- (c==0x20e1) ||
- (c>=0x20e5 && c<=0x20e6) ||
- (c>=0x20ec && c<=0x20ef) ||
- (c>=0x3099 && c<=0x309a) ||
- (c>=0xfe20 && c<=0xfe23) )
- return 1;
- return 0;
-}
-
-/* cleaned out some of the incidental holes in ranges already, but
- there are more */
-
-int unic_isalpha (int c) {
- if((c>=0x0041&&c<=0x005a) ||
- (c>=0x0061&&c<=0x007a) ||
- (c==0x00aa) ||
- (c==0x00b5) ||
- (c==0x00ba) ||
- (c>=0x00c0&&c<=0x01bf) ||
- (c>=0x01c4&&c<=0x02af) ||
- (c==0x0345) ||
- (c>=0x037b&&c<=0x037d) ||
- (c==0x0386) ||
- (c>=0x0388&&c<=0x038a) ||
- (c==0x038c) ||
- (c>=0x038e&&c<=0x0481) ||
- (c>=0x048a&&c<=0x0513) ||
- (c>=0x0531&&c<=0x0556) ||
- (c>=0x0561&&c<=0x0587) ||
- (c>=0x05b0&&c<=0x05bd) ||
- (c==0x05bf) ||
- (c>=0x05c1&&c<=0x05c2) ||
- (c>=0x05c4&&c<=0x05c5) ||
- (c==0x05c7) ||
- (c>=0x0610&&c<=0x0615) ||
- (c>=0x064b&&c<=0x0657) ||
- (c>=0x0659&&c<=0x065e) ||
- (c==0x0670) ||
- (c>=0x06d6&&c<=0x06dc) ||
- (c>=0x06e1&&c<=0x06e4) ||
- (c>=0x06e7&&c<=0x06e8) ||
- (c==0x06ed) ||
- (c==0x0711) ||
- (c>=0x0730&&c<=0x073f) ||
- (c>=0x07a6&&c<=0x07b0) ||
- (c>=0x0901&&c<=0x0903) ||
- (c>=0x093e&&c<=0x094c) ||
- (c>=0x0962&&c<=0x0963) ||
- (c>=0x0981&&c<=0x0983) ||
- (c>=0x09be&&c<=0x09c4) ||
- (c>=0x09c7&&c<=0x09c8) ||
- (c>=0x09cb&&c<=0x09cc) ||
- (c==0x09d7) ||
- (c>=0x09e2&&c<=0x09e3) ||
- (c>=0x0a01&&c<=0x0a03) ||
- (c>=0x0a3e&&c<=0x0a42) ||
- (c>=0x0a47&&c<=0x0a48) ||
- (c>=0x0a4b&&c<=0x0a4c) ||
- (c>=0x0a70&&c<=0x0a71) ||
- (c>=0x0a81&&c<=0x0a83) ||
- (c>=0x0abe&&c<=0x0ac5) ||
- (c>=0x0ac7&&c<=0x0ac9) ||
- (c>=0x0acb&&c<=0x0acc) ||
- (c>=0x0ae2&&c<=0x0ae3) ||
- (c>=0x0b01&&c<=0x0b03) ||
- (c>=0x0b3e&&c<=0x0b43) ||
- (c>=0x0b47&&c<=0x0b48) ||
- (c>=0x0b4b&&c<=0x0b4c) ||
- (c>=0x0b56&&c<=0x0b57) ||
- (c==0x0b82) ||
- (c>=0x0bbe&&c<=0x0bc2) ||
- (c>=0x0bc6&&c<=0x0bc8) ||
- (c>=0x0bca&&c<=0x0bcc) ||
- (c==0x0bd7) ||
- (c>=0x0c01&&c<=0x0c03) ||
- (c>=0x0c3e&&c<=0x0c44) ||
- (c>=0x0c46&&c<=0x0c48) ||
- (c>=0x0c4a&&c<=0x0c4c) ||
- (c>=0x0c55&&c<=0x0c56) ||
- (c>=0x0c82&&c<=0x0c83) ||
- (c>=0x0cbe&&c<=0x0cc4) ||
- (c>=0x0cc6&&c<=0x0cc8) ||
- (c>=0x0cca&&c<=0x0ccc) ||
- (c>=0x0cd5&&c<=0x0cd6) ||
- (c>=0x0ce2&&c<=0x0ce3) ||
- (c>=0x0d02&&c<=0x0d03) ||
- (c>=0x0d3e&&c<=0x0d43) ||
- (c>=0x0d46&&c<=0x0d48) ||
- (c>=0x0d4a&&c<=0x0d4c) ||
- (c==0x0d57) ||
- (c>=0x0d82&&c<=0x0d83) ||
- (c>=0x0dcf&&c<=0x0dd4) ||
- (c==0x0dd6) ||
- (c>=0x0dd8&&c<=0x0ddf) ||
- (c>=0x0df2&&c<=0x0df3) ||
- (c==0x0e31) ||
- (c>=0x0e34&&c<=0x0e3a) ||
- (c==0x0e4d) ||
- (c==0x0eb1) ||
- (c>=0x0eb4&&c<=0x0eb9) ||
- (c>=0x0ebb&&c<=0x0ebc) ||
- (c==0x0ecd) ||
- (c>=0x0f71&&c<=0x0f81) ||
- (c>=0x0f90&&c<=0x0f97) ||
- (c>=0x0f99&&c<=0x0fbc) ||
- (c>=0x102c&&c<=0x1032) ||
- (c==0x1036) ||
- (c==0x1038) ||
- (c>=0x1056&&c<=0x1059) ||
- (c>=0x10a0&&c<=0x10c5) ||
- (c==0x135f) ||
- (c>=0x1712&&c<=0x1713) ||
- (c>=0x1732&&c<=0x1733) ||
- (c>=0x1752&&c<=0x1753) ||
- (c>=0x1772&&c<=0x1773) ||
- (c>=0x17b6&&c<=0x17c8) ||
- (c==0x18a9) ||
- (c>=0x1920&&c<=0x192b) ||
- (c>=0x1930&&c<=0x1938) ||
- (c>=0x19b0&&c<=0x19c0) ||
- (c>=0x19c8&&c<=0x19c9) ||
- (c>=0x1a17&&c<=0x1a1b) ||
- (c>=0x1b00&&c<=0x1b04) ||
- (c>=0x1b35&&c<=0x1b43) ||
- (c>=0x1d00&&c<=0x1d2b) ||
- (c>=0x1d62&&c<=0x1d77) ||
- (c>=0x1d79&&c<=0x1d9a) ||
- (c>=0x1e00&&c<=0x1e9b) ||
- (c>=0x1ea0&&c<=0x1ef9) ||
- (c>=0x1f00&&c<=0x1f15) ||
- (c>=0x1f18&&c<=0x1f1d) ||
- (c>=0x1f20&&c<=0x1f45) ||
- (c>=0x1f48&&c<=0x1f4d) ||
- (c>=0x1f50&&c<=0x1f57) ||
- (c==0x1f59) ||
- (c==0x1f5b) ||
- (c==0x1f5d) ||
- (c>=0x1f5f&&c<=0x1f7d) ||
- (c>=0x1f80&&c<=0x1fb4) ||
- (c>=0x1fb6&&c<=0x1fbc) ||
- (c==0x1fbe) ||
- (c>=0x1fc2&&c<=0x1fc4) ||
- (c>=0x1fc6&&c<=0x1fcc) ||
- (c>=0x1fd0&&c<=0x1fd3) ||
- (c>=0x1fd6&&c<=0x1fdb) ||
- (c>=0x1fe0&&c<=0x1fec) ||
- (c>=0x1ff2&&c<=0x1ff4) ||
- (c>=0x1ff6&&c<=0x1ffc) ||
- (c==0x2071) ||
- (c==0x207f) ||
- (c==0x2102) ||
- (c==0x2107) ||
- (c>=0x210a&&c<=0x2113) ||
- (c==0x2115) ||
- (c>=0x2119&&c<=0x211d) ||
- (c==0x2124) ||
- (c==0x2126) ||
- (c==0x2128) ||
- (c>=0x212a&&c<=0x212d) ||
- (c>=0x212f&&c<=0x2134) ||
- (c==0x2139) ||
- (c>=0x213c&&c<=0x213f) ||
- (c>=0x2145&&c<=0x2149) ||
- (c==0x214e) ||
- (c>=0x2183&&c<=0x2184) ||
- (c>=0x24b6&&c<=0x24e9) ||
- (c>=0x2c00&&c<=0x2c2e) ||
- (c>=0x2c30&&c<=0x2c5e) ||
- (c>=0x2c60&&c<=0x2c6c) ||
- (c>=0x2c74&&c<=0x2c77) ||
- (c>=0x2c80&&c<=0x2ce4) ||
- (c>=0x2d00&&c<=0x2d25) ||
- (c>=0xa823&&c<=0xa827) ||
- (c>=0xfb00&&c<=0xfb06) ||
- (c>=0xfb13&&c<=0xfb17) ||
- (c==0xfb1e) ||
- (c>=0xff21&&c<=0xff3a) ||
- (c>=0xff41&&c<=0xff5a)) {
- if (c==0x00d7||c==0x00f7||c==0x01bb||c==0x0294||c==0x03a2||c==0x03cf||c==0x03f6)
- return 0;
- else
- return 1;
- }
- return 0;
-}
-
-const unsigned short ____tolower[]= { 0,
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
- 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
- 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
- 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
- 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
- 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
- 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
- 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7,
- 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
- 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
- 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
- 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, 0x0107,
- 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, 0x010f,
- 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, 0x0117,
- 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, 0x011f,
- 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, 0x0127,
- 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, 0x012f,
- 0x0069, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, 0x0137,
- 0x0138, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140,
- 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148,
- 0x0148, 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f,
- 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157,
- 0x0159, 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f,
- 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167,
- 0x0169, 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f,
- 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177,
- 0x00ff, 0x017a, 0x017a, 0x017c, 0x017c, 0x017e, 0x017e, 0x017f,
- 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188,
- 0x0188, 0x0256, 0x0257, 0x018c, 0x018c, 0x018d, 0x01dd, 0x0259,
- 0x025b, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268,
- 0x0199, 0x0199, 0x019a, 0x019b, 0x026f, 0x0272, 0x019e, 0x0275,
- 0x01a1, 0x01a1, 0x01a3, 0x01a3, 0x01a5, 0x01a5, 0x0280, 0x01a8,
- 0x01a8, 0x0283, 0x01aa, 0x01ab, 0x01ad, 0x01ad, 0x0288, 0x01b0,
- 0x01b0, 0x028a, 0x028b, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x0292,
- 0x01b9, 0x01b9, 0x01ba, 0x01bb, 0x01bd, 0x01bd, 0x01be, 0x01bf,
- 0x01c0, 0x01c1, 0x01c2, 0x01c3, 0x01c6, 0x01c6, 0x01c6, 0x01c9,
- 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0,
- 0x01d0, 0x01d2, 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8,
- 0x01d8, 0x01da, 0x01da, 0x01dc, 0x01dc, 0x01dd, 0x01df, 0x01df,
- 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7,
- 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01ef,
- 0x01f0, 0x01f3, 0x01f3, 0x01f3, 0x01f5, 0x01f5, 0x0195, 0x01bf,
- 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff,
- 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207,
- 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f,
- 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217,
- 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f,
- 0x019e, 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227,
- 0x0229, 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f,
- 0x0231, 0x0231, 0x0233, 0x0233, 0x0234, 0x0235, 0x0236, 0x0237,
- 0x0238, 0x0239, 0x2c65, 0x023c, 0x023c, 0x019a, 0x2c66, 0x023f,
- 0x0240, 0x0242, 0x0242, 0x0180, 0x0289, 0x028c, 0x0247, 0x0247,
- 0x0249, 0x0249, 0x024b, 0x024b, 0x024d, 0x024d, 0x024f, 0x024f,
- 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257,
- 0x0258, 0x0259, 0x025a, 0x025b, 0x025c, 0x025d, 0x025e, 0x025f,
- 0x0260, 0x0261, 0x0262, 0x0263, 0x0264, 0x0265, 0x0266, 0x0267,
- 0x0268, 0x0269, 0x026a, 0x026b, 0x026c, 0x026d, 0x026e, 0x026f,
- 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277,
- 0x0278, 0x0279, 0x027a, 0x027b, 0x027c, 0x027d, 0x027e, 0x027f,
- 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287,
- 0x0288, 0x0289, 0x028a, 0x028b, 0x028c, 0x028d, 0x028e, 0x028f,
- 0x0290, 0x0291, 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297,
- 0x0298, 0x0299, 0x029a, 0x029b, 0x029c, 0x029d, 0x029e, 0x029f,
- 0x02a0, 0x02a1, 0x02a2, 0x02a3, 0x02a4, 0x02a5, 0x02a6, 0x02a7,
- 0x02a8, 0x02a9, 0x02aa, 0x02ab, 0x02ac, 0x02ad, 0x02ae, 0x02af,
- 0x02b0, 0x02b1, 0x02b2, 0x02b3, 0x02b4, 0x02b5, 0x02b6, 0x02b7,
- 0x02b8, 0x02b9, 0x02ba, 0x02bb, 0x02bc, 0x02bd, 0x02be, 0x02bf,
- 0x02c0, 0x02c1, 0x02c2, 0x02c3, 0x02c4, 0x02c5, 0x02c6, 0x02c7,
- 0x02c8, 0x02c9, 0x02ca, 0x02cb, 0x02cc, 0x02cd, 0x02ce, 0x02cf,
- 0x02d0, 0x02d1, 0x02d2, 0x02d3, 0x02d4, 0x02d5, 0x02d6, 0x02d7,
- 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x02de, 0x02df,
- 0x02e0, 0x02e1, 0x02e2, 0x02e3, 0x02e4, 0x02e5, 0x02e6, 0x02e7,
- 0x02e8, 0x02e9, 0x02ea, 0x02eb, 0x02ec, 0x02ed, 0x02ee, 0x02ef,
- 0x02f0, 0x02f1, 0x02f2, 0x02f3, 0x02f4, 0x02f5, 0x02f6, 0x02f7,
- 0x02f8, 0x02f9, 0x02fa, 0x02fb, 0x02fc, 0x02fd, 0x02fe, 0x02ff,
- 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307,
- 0x0308, 0x0309, 0x030a, 0x030b, 0x030c, 0x030d, 0x030e, 0x030f,
- 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317,
- 0x0318, 0x0319, 0x031a, 0x031b, 0x031c, 0x031d, 0x031e, 0x031f,
- 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327,
- 0x0328, 0x0329, 0x032a, 0x032b, 0x032c, 0x032d, 0x032e, 0x032f,
- 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337,
- 0x0338, 0x0339, 0x033a, 0x033b, 0x033c, 0x033d, 0x033e, 0x033f,
- 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x0345, 0x0346, 0x0347,
- 0x0348, 0x0349, 0x034a, 0x034b, 0x034c, 0x034d, 0x034e, 0x034f,
- 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357,
- 0x0358, 0x0359, 0x035a, 0x035b, 0x035c, 0x035d, 0x035e, 0x035f,
- 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367,
- 0x0368, 0x0369, 0x036a, 0x036b, 0x036c, 0x036d, 0x036e, 0x036f,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x037a, 0x037b, 0x037c, 0x037d, 0x037e, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x03ac, 0x0387,
- 0x03ad, 0x03ae, 0x03af, 0x0000, 0x03cc, 0x0000, 0x03cd, 0x03ce,
- 0x0390, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
- 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
- 0x03c0, 0x03c1, 0x0000, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
- 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03ac, 0x03ad, 0x03ae, 0x03af,
- 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
- 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
- 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
- 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000,
- 0x03d0, 0x03d1, 0x03d2, 0x03d3, 0x03d4, 0x03d5, 0x03d6, 0x03d7,
- 0x03d9, 0x03d9, 0x03db, 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df,
- 0x03e1, 0x03e1, 0x03e3, 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7,
- 0x03e9, 0x03e9, 0x03eb, 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03ef,
- 0x03f0, 0x03f1, 0x03f2, 0x03f3, 0x03b8, 0x03f5, 0x03f6, 0x03f8,
- 0x03f8, 0x03f2, 0x03fb, 0x03fb, 0x03fc, 0x037b, 0x037c, 0x037d,
- 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
- 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
- 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
- 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
- 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467,
- 0x0469, 0x0469, 0x046b, 0x046b, 0x046d, 0x046d, 0x046f, 0x046f,
- 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477,
- 0x0479, 0x0479, 0x047b, 0x047b, 0x047d, 0x047d, 0x047f, 0x047f,
- 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0000,
- 0x0488, 0x0489, 0x048b, 0x048b, 0x048d, 0x048d, 0x048f, 0x048f,
- 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497,
- 0x0499, 0x0499, 0x049b, 0x049b, 0x049d, 0x049d, 0x049f, 0x049f,
- 0x04a1, 0x04a1, 0x04a3, 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7,
- 0x04a9, 0x04a9, 0x04ab, 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af,
- 0x04b1, 0x04b1, 0x04b3, 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7,
- 0x04b9, 0x04b9, 0x04bb, 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf,
- 0x04cf, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8,
- 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04ce, 0x04cf,
- 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, 0x04d5, 0x04d7, 0x04d7,
- 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, 0x04dd, 0x04df, 0x04df,
- 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, 0x04e5, 0x04e7, 0x04e7,
- 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, 0x04ed, 0x04ef, 0x04ef,
- 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, 0x04f5, 0x04f7, 0x04f7,
- 0x04f9, 0x04f9, 0x04fb, 0x04fb, 0x04fd, 0x04fd, 0x04ff, 0x04ff,
- 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, 0x0507,
- 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, 0x050d, 0x050f, 0x050f,
- 0x0511, 0x0511, 0x0513, 0x0513, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
- 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
- 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
- 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
- 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0000,
- 0x0000, 0x0559, 0x055a, 0x055b, 0x055c, 0x055d, 0x055e, 0x055f,
- 0x0000, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
- 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
- 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
- 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
- 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587,
- 0x0000, 0x0589, 0x058a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597,
- 0x0598, 0x0599, 0x059a, 0x059b, 0x059c, 0x059d, 0x059e, 0x059f,
- 0x05a0, 0x05a1, 0x05a2, 0x05a3, 0x05a4, 0x05a5, 0x05a6, 0x05a7,
- 0x05a8, 0x05a9, 0x05aa, 0x05ab, 0x05ac, 0x05ad, 0x05ae, 0x05af,
- 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7,
- 0x05b8, 0x05b9, 0x05ba, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf,
- 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05c4, 0x05c5, 0x05c6, 0x05c7,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
- 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
- 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
- 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0600, 0x0601, 0x0602, 0x0603, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x060b, 0x060c, 0x060d, 0x060e, 0x060f,
- 0x0610, 0x0611, 0x0612, 0x0613, 0x0614, 0x0615, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x061e, 0x061f,
- 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
- 0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
- 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,
- 0x0650, 0x0651, 0x0652, 0x0653, 0x0654, 0x0655, 0x0656, 0x0657,
- 0x0658, 0x0659, 0x065a, 0x065b, 0x065c, 0x065d, 0x065e, 0x0000,
- 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667,
- 0x0668, 0x0669, 0x066a, 0x066b, 0x066c, 0x066d, 0x066e, 0x066f,
- 0x0670, 0x0671, 0x0672, 0x0673, 0x0674, 0x0675, 0x0676, 0x0677,
- 0x0678, 0x0679, 0x067a, 0x067b, 0x067c, 0x067d, 0x067e, 0x067f,
- 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0686, 0x0687,
- 0x0688, 0x0689, 0x068a, 0x068b, 0x068c, 0x068d, 0x068e, 0x068f,
- 0x0690, 0x0691, 0x0692, 0x0693, 0x0694, 0x0695, 0x0696, 0x0697,
- 0x0698, 0x0699, 0x069a, 0x069b, 0x069c, 0x069d, 0x069e, 0x069f,
- 0x06a0, 0x06a1, 0x06a2, 0x06a3, 0x06a4, 0x06a5, 0x06a6, 0x06a7,
- 0x06a8, 0x06a9, 0x06aa, 0x06ab, 0x06ac, 0x06ad, 0x06ae, 0x06af,
- 0x06b0, 0x06b1, 0x06b2, 0x06b3, 0x06b4, 0x06b5, 0x06b6, 0x06b7,
- 0x06b8, 0x06b9, 0x06ba, 0x06bb, 0x06bc, 0x06bd, 0x06be, 0x06bf,
- 0x06c0, 0x06c1, 0x06c2, 0x06c3, 0x06c4, 0x06c5, 0x06c6, 0x06c7,
- 0x06c8, 0x06c9, 0x06ca, 0x06cb, 0x06cc, 0x06cd, 0x06ce, 0x06cf,
- 0x06d0, 0x06d1, 0x06d2, 0x06d3, 0x06d4, 0x06d5, 0x06d6, 0x06d7,
- 0x06d8, 0x06d9, 0x06da, 0x06db, 0x06dc, 0x06dd, 0x06de, 0x06df,
- 0x06e0, 0x06e1, 0x06e2, 0x06e3, 0x06e4, 0x06e5, 0x06e6, 0x06e7,
- 0x06e8, 0x06e9, 0x06ea, 0x06eb, 0x06ec, 0x06ed, 0x06ee, 0x06ef,
- 0x06f0, 0x06f1, 0x06f2, 0x06f3, 0x06f4, 0x06f5, 0x06f6, 0x06f7,
- 0x06f8, 0x06f9, 0x06fa, 0x06fb, 0x06fc, 0x06fd, 0x06fe, 0x06ff,
- 0x0700, 0x0701, 0x0702, 0x0703, 0x0704, 0x0705, 0x0706, 0x0707,
- 0x0708, 0x0709, 0x070a, 0x070b, 0x070c, 0x070d, 0x0000, 0x070f,
- 0x0710, 0x0711, 0x0712, 0x0713, 0x0714, 0x0715, 0x0716, 0x0717,
- 0x0718, 0x0719, 0x071a, 0x071b, 0x071c, 0x071d, 0x071e, 0x071f,
- 0x0720, 0x0721, 0x0722, 0x0723, 0x0724, 0x0725, 0x0726, 0x0727,
- 0x0728, 0x0729, 0x072a, 0x072b, 0x072c, 0x072d, 0x072e, 0x072f,
- 0x0730, 0x0731, 0x0732, 0x0733, 0x0734, 0x0735, 0x0736, 0x0737,
- 0x0738, 0x0739, 0x073a, 0x073b, 0x073c, 0x073d, 0x073e, 0x073f,
- 0x0740, 0x0741, 0x0742, 0x0743, 0x0744, 0x0745, 0x0746, 0x0747,
- 0x0748, 0x0749, 0x074a, 0x0000, 0x0000, 0x074d, 0x074e, 0x074f,
- 0x0750, 0x0751, 0x0752, 0x0753, 0x0754, 0x0755, 0x0756, 0x0757,
- 0x0758, 0x0759, 0x075a, 0x075b, 0x075c, 0x075d, 0x075e, 0x075f,
- 0x0760, 0x0761, 0x0762, 0x0763, 0x0764, 0x0765, 0x0766, 0x0767,
- 0x0768, 0x0769, 0x076a, 0x076b, 0x076c, 0x076d, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0786, 0x0787,
- 0x0788, 0x0789, 0x078a, 0x078b, 0x078c, 0x078d, 0x078e, 0x078f,
- 0x0790, 0x0791, 0x0792, 0x0793, 0x0794, 0x0795, 0x0796, 0x0797,
- 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d, 0x079e, 0x079f,
- 0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a6, 0x07a7,
- 0x07a8, 0x07a9, 0x07aa, 0x07ab, 0x07ac, 0x07ad, 0x07ae, 0x07af,
- 0x07b0, 0x07b1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x07c0, 0x07c1, 0x07c2, 0x07c3, 0x07c4, 0x07c5, 0x07c6, 0x07c7,
- 0x07c8, 0x07c9, 0x07ca, 0x07cb, 0x07cc, 0x07cd, 0x07ce, 0x07cf,
- 0x07d0, 0x07d1, 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x07d6, 0x07d7,
- 0x07d8, 0x07d9, 0x07da, 0x07db, 0x07dc, 0x07dd, 0x07de, 0x07df,
- 0x07e0, 0x07e1, 0x07e2, 0x07e3, 0x07e4, 0x07e5, 0x07e6, 0x07e7,
- 0x07e8, 0x07e9, 0x07ea, 0x07eb, 0x07ec, 0x07ed, 0x07ee, 0x07ef,
- 0x07f0, 0x07f1, 0x07f2, 0x07f3, 0x07f4, 0x07f5, 0x07f6, 0x07f7,
- 0x07f8, 0x07f9, 0x07fa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0901, 0x0902, 0x0903, 0x0904, 0x0905, 0x0906, 0x0907,
- 0x0908, 0x0909, 0x090a, 0x090b, 0x090c, 0x090d, 0x090e, 0x090f,
- 0x0910, 0x0911, 0x0912, 0x0913, 0x0914, 0x0915, 0x0916, 0x0917,
- 0x0918, 0x0919, 0x091a, 0x091b, 0x091c, 0x091d, 0x091e, 0x091f,
- 0x0920, 0x0921, 0x0922, 0x0923, 0x0924, 0x0925, 0x0926, 0x0927,
- 0x0928, 0x0929, 0x092a, 0x092b, 0x092c, 0x092d, 0x092e, 0x092f,
- 0x0930, 0x0931, 0x0932, 0x0933, 0x0934, 0x0935, 0x0936, 0x0937,
- 0x0938, 0x0939, 0x0000, 0x0000, 0x093c, 0x093d, 0x093e, 0x093f,
- 0x0940, 0x0941, 0x0942, 0x0943, 0x0944, 0x0945, 0x0946, 0x0947,
- 0x0948, 0x0949, 0x094a, 0x094b, 0x094c, 0x094d, 0x0000, 0x0000,
- 0x0950, 0x0951, 0x0952, 0x0953, 0x0954, 0x0000, 0x0000, 0x0000,
- 0x0958, 0x0959, 0x095a, 0x095b, 0x095c, 0x095d, 0x095e, 0x095f,
- 0x0960, 0x0961, 0x0962, 0x0963, 0x0964, 0x0965, 0x0966, 0x0967,
- 0x0968, 0x0969, 0x096a, 0x096b, 0x096c, 0x096d, 0x096e, 0x096f,
- 0x0970, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x097b, 0x097c, 0x097d, 0x097e, 0x097f,
- 0x0000, 0x0981, 0x0982, 0x0983, 0x0000, 0x0985, 0x0986, 0x0987,
- 0x0988, 0x0989, 0x098a, 0x098b, 0x098c, 0x0000, 0x0000, 0x098f,
- 0x0990, 0x0000, 0x0000, 0x0993, 0x0994, 0x0995, 0x0996, 0x0997,
- 0x0998, 0x0999, 0x099a, 0x099b, 0x099c, 0x099d, 0x099e, 0x099f,
- 0x09a0, 0x09a1, 0x09a2, 0x09a3, 0x09a4, 0x09a5, 0x09a6, 0x09a7,
- 0x09a8, 0x0000, 0x09aa, 0x09ab, 0x09ac, 0x09ad, 0x09ae, 0x09af,
- 0x09b0, 0x0000, 0x09b2, 0x0000, 0x0000, 0x0000, 0x09b6, 0x09b7,
- 0x09b8, 0x09b9, 0x0000, 0x0000, 0x09bc, 0x09bd, 0x09be, 0x09bf,
- 0x09c0, 0x09c1, 0x09c2, 0x09c3, 0x09c4, 0x0000, 0x0000, 0x09c7,
- 0x09c8, 0x0000, 0x0000, 0x09cb, 0x09cc, 0x09cd, 0x09ce, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x09d7,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x09dc, 0x09dd, 0x0000, 0x09df,
- 0x09e0, 0x09e1, 0x09e2, 0x09e3, 0x0000, 0x0000, 0x09e6, 0x09e7,
- 0x09e8, 0x09e9, 0x09ea, 0x09eb, 0x09ec, 0x09ed, 0x09ee, 0x09ef,
- 0x09f0, 0x09f1, 0x09f2, 0x09f3, 0x09f4, 0x09f5, 0x09f6, 0x09f7,
- 0x09f8, 0x09f9, 0x09fa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0a01, 0x0a02, 0x0a03, 0x0000, 0x0a05, 0x0a06, 0x0a07,
- 0x0a08, 0x0a09, 0x0a0a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a0f,
- 0x0a10, 0x0000, 0x0000, 0x0a13, 0x0a14, 0x0a15, 0x0a16, 0x0a17,
- 0x0a18, 0x0a19, 0x0a1a, 0x0a1b, 0x0a1c, 0x0a1d, 0x0a1e, 0x0a1f,
- 0x0a20, 0x0a21, 0x0a22, 0x0a23, 0x0a24, 0x0a25, 0x0a26, 0x0a27,
- 0x0a28, 0x0000, 0x0a2a, 0x0a2b, 0x0a2c, 0x0a2d, 0x0a2e, 0x0a2f,
- 0x0a30, 0x0000, 0x0a32, 0x0a33, 0x0000, 0x0a35, 0x0a36, 0x0000,
- 0x0a38, 0x0a39, 0x0000, 0x0000, 0x0a3c, 0x0000, 0x0a3e, 0x0a3f,
- 0x0a40, 0x0a41, 0x0a42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a47,
- 0x0a48, 0x0000, 0x0000, 0x0a4b, 0x0a4c, 0x0a4d, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0a59, 0x0a5a, 0x0a5b, 0x0a5c, 0x0000, 0x0a5e, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a66, 0x0a67,
- 0x0a68, 0x0a69, 0x0a6a, 0x0a6b, 0x0a6c, 0x0a6d, 0x0a6e, 0x0a6f,
- 0x0a70, 0x0a71, 0x0a72, 0x0a73, 0x0a74, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0a81, 0x0a82, 0x0a83, 0x0000, 0x0a85, 0x0a86, 0x0a87,
- 0x0a88, 0x0a89, 0x0a8a, 0x0a8b, 0x0a8c, 0x0a8d, 0x0000, 0x0a8f,
- 0x0a90, 0x0a91, 0x0000, 0x0a93, 0x0a94, 0x0a95, 0x0a96, 0x0a97,
- 0x0a98, 0x0a99, 0x0a9a, 0x0a9b, 0x0a9c, 0x0a9d, 0x0a9e, 0x0a9f,
- 0x0aa0, 0x0aa1, 0x0aa2, 0x0aa3, 0x0aa4, 0x0aa5, 0x0aa6, 0x0aa7,
- 0x0aa8, 0x0000, 0x0aaa, 0x0aab, 0x0aac, 0x0aad, 0x0aae, 0x0aaf,
- 0x0ab0, 0x0000, 0x0ab2, 0x0ab3, 0x0000, 0x0ab5, 0x0ab6, 0x0ab7,
- 0x0ab8, 0x0ab9, 0x0000, 0x0000, 0x0abc, 0x0abd, 0x0abe, 0x0abf,
- 0x0ac0, 0x0ac1, 0x0ac2, 0x0ac3, 0x0ac4, 0x0ac5, 0x0000, 0x0ac7,
- 0x0ac8, 0x0ac9, 0x0000, 0x0acb, 0x0acc, 0x0acd, 0x0000, 0x0000,
- 0x0ad0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0ae0, 0x0ae1, 0x0ae2, 0x0ae3, 0x0000, 0x0000, 0x0ae6, 0x0ae7,
- 0x0ae8, 0x0ae9, 0x0aea, 0x0aeb, 0x0aec, 0x0aed, 0x0aee, 0x0aef,
- 0x0000, 0x0af1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0b01, 0x0b02, 0x0b03, 0x0000, 0x0b05, 0x0b06, 0x0b07,
- 0x0b08, 0x0b09, 0x0b0a, 0x0b0b, 0x0b0c, 0x0000, 0x0000, 0x0b0f,
- 0x0b10, 0x0000, 0x0000, 0x0b13, 0x0b14, 0x0b15, 0x0b16, 0x0b17,
- 0x0b18, 0x0b19, 0x0b1a, 0x0b1b, 0x0b1c, 0x0b1d, 0x0b1e, 0x0b1f,
- 0x0b20, 0x0b21, 0x0b22, 0x0b23, 0x0b24, 0x0b25, 0x0b26, 0x0b27,
- 0x0b28, 0x0000, 0x0b2a, 0x0b2b, 0x0b2c, 0x0b2d, 0x0b2e, 0x0b2f,
- 0x0b30, 0x0000, 0x0b32, 0x0b33, 0x0000, 0x0b35, 0x0b36, 0x0b37,
- 0x0b38, 0x0b39, 0x0000, 0x0000, 0x0b3c, 0x0b3d, 0x0b3e, 0x0b3f,
- 0x0b40, 0x0b41, 0x0b42, 0x0b43, 0x0000, 0x0000, 0x0000, 0x0b47,
- 0x0b48, 0x0000, 0x0000, 0x0b4b, 0x0b4c, 0x0b4d, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0b56, 0x0b57,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0b5c, 0x0b5d, 0x0000, 0x0b5f,
- 0x0b60, 0x0b61, 0x0000, 0x0000, 0x0000, 0x0000, 0x0b66, 0x0b67,
- 0x0b68, 0x0b69, 0x0b6a, 0x0b6b, 0x0b6c, 0x0b6d, 0x0b6e, 0x0b6f,
- 0x0b70, 0x0b71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0b82, 0x0b83, 0x0000, 0x0b85, 0x0b86, 0x0b87,
- 0x0b88, 0x0b89, 0x0b8a, 0x0000, 0x0000, 0x0000, 0x0b8e, 0x0b8f,
- 0x0b90, 0x0000, 0x0b92, 0x0b93, 0x0b94, 0x0b95, 0x0000, 0x0000,
- 0x0000, 0x0b99, 0x0b9a, 0x0000, 0x0b9c, 0x0000, 0x0b9e, 0x0b9f,
- 0x0000, 0x0000, 0x0000, 0x0ba3, 0x0ba4, 0x0000, 0x0000, 0x0000,
- 0x0ba8, 0x0ba9, 0x0baa, 0x0000, 0x0000, 0x0000, 0x0bae, 0x0baf,
- 0x0bb0, 0x0bb1, 0x0bb2, 0x0bb3, 0x0bb4, 0x0bb5, 0x0bb6, 0x0bb7,
- 0x0bb8, 0x0bb9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0bbe, 0x0bbf,
- 0x0bc0, 0x0bc1, 0x0bc2, 0x0000, 0x0000, 0x0000, 0x0bc6, 0x0bc7,
- 0x0bc8, 0x0000, 0x0bca, 0x0bcb, 0x0bcc, 0x0bcd, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0bd7,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0be6, 0x0be7,
- 0x0be8, 0x0be9, 0x0bea, 0x0beb, 0x0bec, 0x0bed, 0x0bee, 0x0bef,
- 0x0bf0, 0x0bf1, 0x0bf2, 0x0bf3, 0x0bf4, 0x0bf5, 0x0bf6, 0x0bf7,
- 0x0bf8, 0x0bf9, 0x0bfa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0c01, 0x0c02, 0x0c03, 0x0000, 0x0c05, 0x0c06, 0x0c07,
- 0x0c08, 0x0c09, 0x0c0a, 0x0c0b, 0x0c0c, 0x0000, 0x0c0e, 0x0c0f,
- 0x0c10, 0x0000, 0x0c12, 0x0c13, 0x0c14, 0x0c15, 0x0c16, 0x0c17,
- 0x0c18, 0x0c19, 0x0c1a, 0x0c1b, 0x0c1c, 0x0c1d, 0x0c1e, 0x0c1f,
- 0x0c20, 0x0c21, 0x0c22, 0x0c23, 0x0c24, 0x0c25, 0x0c26, 0x0c27,
- 0x0c28, 0x0000, 0x0c2a, 0x0c2b, 0x0c2c, 0x0c2d, 0x0c2e, 0x0c2f,
- 0x0c30, 0x0c31, 0x0c32, 0x0c33, 0x0000, 0x0c35, 0x0c36, 0x0c37,
- 0x0c38, 0x0c39, 0x0000, 0x0000, 0x0000, 0x0000, 0x0c3e, 0x0c3f,
- 0x0c40, 0x0c41, 0x0c42, 0x0c43, 0x0c44, 0x0000, 0x0c46, 0x0c47,
- 0x0c48, 0x0000, 0x0c4a, 0x0c4b, 0x0c4c, 0x0c4d, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0c55, 0x0c56, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0c60, 0x0c61, 0x0000, 0x0000, 0x0000, 0x0000, 0x0c66, 0x0c67,
- 0x0c68, 0x0c69, 0x0c6a, 0x0c6b, 0x0c6c, 0x0c6d, 0x0c6e, 0x0c6f,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0c82, 0x0c83, 0x0000, 0x0c85, 0x0c86, 0x0c87,
- 0x0c88, 0x0c89, 0x0c8a, 0x0c8b, 0x0c8c, 0x0000, 0x0c8e, 0x0c8f,
- 0x0c90, 0x0000, 0x0c92, 0x0c93, 0x0c94, 0x0c95, 0x0c96, 0x0c97,
- 0x0c98, 0x0c99, 0x0c9a, 0x0c9b, 0x0c9c, 0x0c9d, 0x0c9e, 0x0c9f,
- 0x0ca0, 0x0ca1, 0x0ca2, 0x0ca3, 0x0ca4, 0x0ca5, 0x0ca6, 0x0ca7,
- 0x0ca8, 0x0000, 0x0caa, 0x0cab, 0x0cac, 0x0cad, 0x0cae, 0x0caf,
- 0x0cb0, 0x0cb1, 0x0cb2, 0x0cb3, 0x0000, 0x0cb5, 0x0cb6, 0x0cb7,
- 0x0cb8, 0x0cb9, 0x0000, 0x0000, 0x0cbc, 0x0cbd, 0x0cbe, 0x0cbf,
- 0x0cc0, 0x0cc1, 0x0cc2, 0x0cc3, 0x0cc4, 0x0000, 0x0cc6, 0x0cc7,
- 0x0cc8, 0x0000, 0x0cca, 0x0ccb, 0x0ccc, 0x0ccd, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0cd5, 0x0cd6, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0cde, 0x0000,
- 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0000, 0x0000, 0x0ce6, 0x0ce7,
- 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x0cef,
- 0x0000, 0x0cf1, 0x0cf2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0d02, 0x0d03, 0x0000, 0x0d05, 0x0d06, 0x0d07,
- 0x0d08, 0x0d09, 0x0d0a, 0x0d0b, 0x0d0c, 0x0000, 0x0d0e, 0x0d0f,
- 0x0d10, 0x0000, 0x0d12, 0x0d13, 0x0d14, 0x0d15, 0x0d16, 0x0d17,
- 0x0d18, 0x0d19, 0x0d1a, 0x0d1b, 0x0d1c, 0x0d1d, 0x0d1e, 0x0d1f,
- 0x0d20, 0x0d21, 0x0d22, 0x0d23, 0x0d24, 0x0d25, 0x0d26, 0x0d27,
- 0x0d28, 0x0000, 0x0d2a, 0x0d2b, 0x0d2c, 0x0d2d, 0x0d2e, 0x0d2f,
- 0x0d30, 0x0d31, 0x0d32, 0x0d33, 0x0d34, 0x0d35, 0x0d36, 0x0d37,
- 0x0d38, 0x0d39, 0x0000, 0x0000, 0x0000, 0x0000, 0x0d3e, 0x0d3f,
- 0x0d40, 0x0d41, 0x0d42, 0x0d43, 0x0000, 0x0000, 0x0d46, 0x0d47,
- 0x0d48, 0x0000, 0x0d4a, 0x0d4b, 0x0d4c, 0x0d4d, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0d57,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0d60, 0x0d61, 0x0000, 0x0000, 0x0000, 0x0000, 0x0d66, 0x0d67,
- 0x0d68, 0x0d69, 0x0d6a, 0x0d6b, 0x0d6c, 0x0d6d, 0x0d6e, 0x0d6f,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0d82, 0x0d83, 0x0000, 0x0d85, 0x0d86, 0x0d87,
- 0x0d88, 0x0d89, 0x0d8a, 0x0d8b, 0x0d8c, 0x0d8d, 0x0d8e, 0x0d8f,
- 0x0d90, 0x0d91, 0x0d92, 0x0d93, 0x0d94, 0x0d95, 0x0d96, 0x0000,
- 0x0000, 0x0000, 0x0d9a, 0x0d9b, 0x0d9c, 0x0d9d, 0x0d9e, 0x0d9f,
- 0x0da0, 0x0da1, 0x0da2, 0x0da3, 0x0da4, 0x0da5, 0x0da6, 0x0da7,
- 0x0da8, 0x0da9, 0x0daa, 0x0dab, 0x0dac, 0x0dad, 0x0dae, 0x0daf,
- 0x0db0, 0x0db1, 0x0000, 0x0db3, 0x0db4, 0x0db5, 0x0db6, 0x0db7,
- 0x0db8, 0x0db9, 0x0dba, 0x0dbb, 0x0000, 0x0dbd, 0x0000, 0x0000,
- 0x0dc0, 0x0dc1, 0x0dc2, 0x0dc3, 0x0dc4, 0x0dc5, 0x0dc6, 0x0000,
- 0x0000, 0x0000, 0x0dca, 0x0000, 0x0000, 0x0000, 0x0000, 0x0dcf,
- 0x0dd0, 0x0dd1, 0x0dd2, 0x0dd3, 0x0dd4, 0x0000, 0x0dd6, 0x0000,
- 0x0dd8, 0x0dd9, 0x0dda, 0x0ddb, 0x0ddc, 0x0ddd, 0x0dde, 0x0ddf,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0df2, 0x0df3, 0x0df4, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
- 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
- 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
- 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
- 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
- 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
- 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
- 0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f,
- 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
- 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
- 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
- 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0e81, 0x0e82, 0x0000, 0x0e84, 0x0000, 0x0000, 0x0e87,
- 0x0e88, 0x0000, 0x0e8a, 0x0000, 0x0000, 0x0e8d, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0e94, 0x0e95, 0x0e96, 0x0e97,
- 0x0000, 0x0e99, 0x0e9a, 0x0e9b, 0x0e9c, 0x0e9d, 0x0e9e, 0x0e9f,
- 0x0000, 0x0ea1, 0x0ea2, 0x0ea3, 0x0000, 0x0ea5, 0x0000, 0x0ea7,
- 0x0000, 0x0000, 0x0eaa, 0x0eab, 0x0000, 0x0ead, 0x0eae, 0x0eaf,
- 0x0eb0, 0x0eb1, 0x0eb2, 0x0eb3, 0x0eb4, 0x0eb5, 0x0eb6, 0x0eb7,
- 0x0eb8, 0x0eb9, 0x0000, 0x0ebb, 0x0ebc, 0x0ebd, 0x0000, 0x0000,
- 0x0ec0, 0x0ec1, 0x0ec2, 0x0ec3, 0x0ec4, 0x0000, 0x0ec6, 0x0000,
- 0x0ec8, 0x0ec9, 0x0eca, 0x0ecb, 0x0ecc, 0x0ecd, 0x0000, 0x0000,
- 0x0ed0, 0x0ed1, 0x0ed2, 0x0ed3, 0x0ed4, 0x0ed5, 0x0ed6, 0x0ed7,
- 0x0ed8, 0x0ed9, 0x0000, 0x0000, 0x0edc, 0x0edd, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06, 0x0f07,
- 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e, 0x0f0f,
- 0x0f10, 0x0f11, 0x0f12, 0x0f13, 0x0f14, 0x0f15, 0x0f16, 0x0f17,
- 0x0f18, 0x0f19, 0x0f1a, 0x0f1b, 0x0f1c, 0x0f1d, 0x0f1e, 0x0f1f,
- 0x0f20, 0x0f21, 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26, 0x0f27,
- 0x0f28, 0x0f29, 0x0f2a, 0x0f2b, 0x0f2c, 0x0f2d, 0x0f2e, 0x0f2f,
- 0x0f30, 0x0f31, 0x0f32, 0x0f33, 0x0f34, 0x0f35, 0x0f36, 0x0f37,
- 0x0f38, 0x0f39, 0x0f3a, 0x0f3b, 0x0f3c, 0x0f3d, 0x0f3e, 0x0f3f,
- 0x0f40, 0x0f41, 0x0f42, 0x0f43, 0x0f44, 0x0f45, 0x0f46, 0x0f47,
- 0x0000, 0x0f49, 0x0f4a, 0x0f4b, 0x0f4c, 0x0f4d, 0x0f4e, 0x0f4f,
- 0x0f50, 0x0f51, 0x0f52, 0x0f53, 0x0f54, 0x0f55, 0x0f56, 0x0f57,
- 0x0f58, 0x0f59, 0x0f5a, 0x0f5b, 0x0f5c, 0x0f5d, 0x0f5e, 0x0f5f,
- 0x0f60, 0x0f61, 0x0f62, 0x0f63, 0x0f64, 0x0f65, 0x0f66, 0x0f67,
- 0x0f68, 0x0f69, 0x0f6a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0f71, 0x0f72, 0x0f73, 0x0f74, 0x0f75, 0x0f76, 0x0f77,
- 0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
- 0x0f80, 0x0f81, 0x0f82, 0x0f83, 0x0f84, 0x0f85, 0x0f86, 0x0f87,
- 0x0f88, 0x0f89, 0x0f8a, 0x0f8b, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0f90, 0x0f91, 0x0f92, 0x0f93, 0x0f94, 0x0f95, 0x0f96, 0x0f97,
- 0x0000, 0x0f99, 0x0f9a, 0x0f9b, 0x0f9c, 0x0f9d, 0x0f9e, 0x0f9f,
- 0x0fa0, 0x0fa1, 0x0fa2, 0x0fa3, 0x0fa4, 0x0fa5, 0x0fa6, 0x0fa7,
- 0x0fa8, 0x0fa9, 0x0faa, 0x0fab, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
- 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
- 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0000, 0x0fbe, 0x0fbf,
- 0x0fc0, 0x0fc1, 0x0fc2, 0x0fc3, 0x0fc4, 0x0fc5, 0x0fc6, 0x0fc7,
- 0x0fc8, 0x0fc9, 0x0fca, 0x0fcb, 0x0fcc, 0x0000, 0x0000, 0x0fcf,
- 0x0fd0, 0x0fd1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007,
- 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x100e, 0x100f,
- 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017,
- 0x1018, 0x1019, 0x101a, 0x101b, 0x101c, 0x101d, 0x101e, 0x101f,
- 0x1020, 0x1021, 0x0000, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027,
- 0x0000, 0x1029, 0x102a, 0x0000, 0x102c, 0x102d, 0x102e, 0x102f,
- 0x1030, 0x1031, 0x1032, 0x0000, 0x0000, 0x0000, 0x1036, 0x1037,
- 0x1038, 0x1039, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047,
- 0x1048, 0x1049, 0x104a, 0x104b, 0x104c, 0x104d, 0x104e, 0x104f,
- 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057,
- 0x1058, 0x1059, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2d00, 0x2d01, 0x2d02, 0x2d03, 0x2d04, 0x2d05, 0x2d06, 0x2d07,
- 0x2d08, 0x2d09, 0x2d0a, 0x2d0b, 0x2d0c, 0x2d0d, 0x2d0e, 0x2d0f,
- 0x2d10, 0x2d11, 0x2d12, 0x2d13, 0x2d14, 0x2d15, 0x2d16, 0x2d17,
- 0x2d18, 0x2d19, 0x2d1a, 0x2d1b, 0x2d1c, 0x2d1d, 0x2d1e, 0x2d1f,
- 0x2d20, 0x2d21, 0x2d22, 0x2d23, 0x2d24, 0x2d25, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7,
- 0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df,
- 0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7,
- 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10ef,
- 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7,
- 0x10f8, 0x10f9, 0x10fa, 0x10fb, 0x10fc, 0x0000, 0x0000, 0x0000,
- 0x1100, 0x1101, 0x1102, 0x1103, 0x1104, 0x1105, 0x1106, 0x1107,
- 0x1108, 0x1109, 0x110a, 0x110b, 0x110c, 0x110d, 0x110e, 0x110f,
- 0x1110, 0x1111, 0x1112, 0x1113, 0x1114, 0x1115, 0x1116, 0x1117,
- 0x1118, 0x1119, 0x111a, 0x111b, 0x111c, 0x111d, 0x111e, 0x111f,
- 0x1120, 0x1121, 0x1122, 0x1123, 0x1124, 0x1125, 0x1126, 0x1127,
- 0x1128, 0x1129, 0x112a, 0x112b, 0x112c, 0x112d, 0x112e, 0x112f,
- 0x1130, 0x1131, 0x1132, 0x1133, 0x1134, 0x1135, 0x1136, 0x1137,
- 0x1138, 0x1139, 0x113a, 0x113b, 0x113c, 0x113d, 0x113e, 0x113f,
- 0x1140, 0x1141, 0x1142, 0x1143, 0x1144, 0x1145, 0x1146, 0x1147,
- 0x1148, 0x1149, 0x114a, 0x114b, 0x114c, 0x114d, 0x114e, 0x114f,
- 0x1150, 0x1151, 0x1152, 0x1153, 0x1154, 0x1155, 0x1156, 0x1157,
- 0x1158, 0x1159, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x115f,
- 0x1160, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167,
- 0x1168, 0x1169, 0x116a, 0x116b, 0x116c, 0x116d, 0x116e, 0x116f,
- 0x1170, 0x1171, 0x1172, 0x1173, 0x1174, 0x1175, 0x1176, 0x1177,
- 0x1178, 0x1179, 0x117a, 0x117b, 0x117c, 0x117d, 0x117e, 0x117f,
- 0x1180, 0x1181, 0x1182, 0x1183, 0x1184, 0x1185, 0x1186, 0x1187,
- 0x1188, 0x1189, 0x118a, 0x118b, 0x118c, 0x118d, 0x118e, 0x118f,
- 0x1190, 0x1191, 0x1192, 0x1193, 0x1194, 0x1195, 0x1196, 0x1197,
- 0x1198, 0x1199, 0x119a, 0x119b, 0x119c, 0x119d, 0x119e, 0x119f,
- 0x11a0, 0x11a1, 0x11a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x11a8, 0x11a9, 0x11aa, 0x11ab, 0x11ac, 0x11ad, 0x11ae, 0x11af,
- 0x11b0, 0x11b1, 0x11b2, 0x11b3, 0x11b4, 0x11b5, 0x11b6, 0x11b7,
- 0x11b8, 0x11b9, 0x11ba, 0x11bb, 0x11bc, 0x11bd, 0x11be, 0x11bf,
- 0x11c0, 0x11c1, 0x11c2, 0x11c3, 0x11c4, 0x11c5, 0x11c6, 0x11c7,
- 0x11c8, 0x11c9, 0x11ca, 0x11cb, 0x11cc, 0x11cd, 0x11ce, 0x11cf,
- 0x11d0, 0x11d1, 0x11d2, 0x11d3, 0x11d4, 0x11d5, 0x11d6, 0x11d7,
- 0x11d8, 0x11d9, 0x11da, 0x11db, 0x11dc, 0x11dd, 0x11de, 0x11df,
- 0x11e0, 0x11e1, 0x11e2, 0x11e3, 0x11e4, 0x11e5, 0x11e6, 0x11e7,
- 0x11e8, 0x11e9, 0x11ea, 0x11eb, 0x11ec, 0x11ed, 0x11ee, 0x11ef,
- 0x11f0, 0x11f1, 0x11f2, 0x11f3, 0x11f4, 0x11f5, 0x11f6, 0x11f7,
- 0x11f8, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1200, 0x1201, 0x1202, 0x1203, 0x1204, 0x1205, 0x1206, 0x1207,
- 0x1208, 0x1209, 0x120a, 0x120b, 0x120c, 0x120d, 0x120e, 0x120f,
- 0x1210, 0x1211, 0x1212, 0x1213, 0x1214, 0x1215, 0x1216, 0x1217,
- 0x1218, 0x1219, 0x121a, 0x121b, 0x121c, 0x121d, 0x121e, 0x121f,
- 0x1220, 0x1221, 0x1222, 0x1223, 0x1224, 0x1225, 0x1226, 0x1227,
- 0x1228, 0x1229, 0x122a, 0x122b, 0x122c, 0x122d, 0x122e, 0x122f,
- 0x1230, 0x1231, 0x1232, 0x1233, 0x1234, 0x1235, 0x1236, 0x1237,
- 0x1238, 0x1239, 0x123a, 0x123b, 0x123c, 0x123d, 0x123e, 0x123f,
- 0x1240, 0x1241, 0x1242, 0x1243, 0x1244, 0x1245, 0x1246, 0x1247,
- 0x1248, 0x0000, 0x124a, 0x124b, 0x124c, 0x124d, 0x0000, 0x0000,
- 0x1250, 0x1251, 0x1252, 0x1253, 0x1254, 0x1255, 0x1256, 0x0000,
- 0x1258, 0x0000, 0x125a, 0x125b, 0x125c, 0x125d, 0x0000, 0x0000,
- 0x1260, 0x1261, 0x1262, 0x1263, 0x1264, 0x1265, 0x1266, 0x1267,
- 0x1268, 0x1269, 0x126a, 0x126b, 0x126c, 0x126d, 0x126e, 0x126f,
- 0x1270, 0x1271, 0x1272, 0x1273, 0x1274, 0x1275, 0x1276, 0x1277,
- 0x1278, 0x1279, 0x127a, 0x127b, 0x127c, 0x127d, 0x127e, 0x127f,
- 0x1280, 0x1281, 0x1282, 0x1283, 0x1284, 0x1285, 0x1286, 0x1287,
- 0x1288, 0x0000, 0x128a, 0x128b, 0x128c, 0x128d, 0x0000, 0x0000,
- 0x1290, 0x1291, 0x1292, 0x1293, 0x1294, 0x1295, 0x1296, 0x1297,
- 0x1298, 0x1299, 0x129a, 0x129b, 0x129c, 0x129d, 0x129e, 0x129f,
- 0x12a0, 0x12a1, 0x12a2, 0x12a3, 0x12a4, 0x12a5, 0x12a6, 0x12a7,
- 0x12a8, 0x12a9, 0x12aa, 0x12ab, 0x12ac, 0x12ad, 0x12ae, 0x12af,
- 0x12b0, 0x0000, 0x12b2, 0x12b3, 0x12b4, 0x12b5, 0x0000, 0x0000,
- 0x12b8, 0x12b9, 0x12ba, 0x12bb, 0x12bc, 0x12bd, 0x12be, 0x0000,
- 0x12c0, 0x0000, 0x12c2, 0x12c3, 0x12c4, 0x12c5, 0x0000, 0x0000,
- 0x12c8, 0x12c9, 0x12ca, 0x12cb, 0x12cc, 0x12cd, 0x12ce, 0x12cf,
- 0x12d0, 0x12d1, 0x12d2, 0x12d3, 0x12d4, 0x12d5, 0x12d6, 0x0000,
- 0x12d8, 0x12d9, 0x12da, 0x12db, 0x12dc, 0x12dd, 0x12de, 0x12df,
- 0x12e0, 0x12e1, 0x12e2, 0x12e3, 0x12e4, 0x12e5, 0x12e6, 0x12e7,
- 0x12e8, 0x12e9, 0x12ea, 0x12eb, 0x12ec, 0x12ed, 0x12ee, 0x12ef,
- 0x12f0, 0x12f1, 0x12f2, 0x12f3, 0x12f4, 0x12f5, 0x12f6, 0x12f7,
- 0x12f8, 0x12f9, 0x12fa, 0x12fb, 0x12fc, 0x12fd, 0x12fe, 0x12ff,
- 0x1300, 0x1301, 0x1302, 0x1303, 0x1304, 0x1305, 0x1306, 0x1307,
- 0x1308, 0x1309, 0x130a, 0x130b, 0x130c, 0x130d, 0x130e, 0x130f,
- 0x1310, 0x0000, 0x1312, 0x1313, 0x1314, 0x1315, 0x0000, 0x0000,
- 0x1318, 0x1319, 0x131a, 0x131b, 0x131c, 0x131d, 0x131e, 0x131f,
- 0x1320, 0x1321, 0x1322, 0x1323, 0x1324, 0x1325, 0x1326, 0x1327,
- 0x1328, 0x1329, 0x132a, 0x132b, 0x132c, 0x132d, 0x132e, 0x132f,
- 0x1330, 0x1331, 0x1332, 0x1333, 0x1334, 0x1335, 0x1336, 0x1337,
- 0x1338, 0x1339, 0x133a, 0x133b, 0x133c, 0x133d, 0x133e, 0x133f,
- 0x1340, 0x1341, 0x1342, 0x1343, 0x1344, 0x1345, 0x1346, 0x1347,
- 0x1348, 0x1349, 0x134a, 0x134b, 0x134c, 0x134d, 0x134e, 0x134f,
- 0x1350, 0x1351, 0x1352, 0x1353, 0x1354, 0x1355, 0x1356, 0x1357,
- 0x1358, 0x1359, 0x135a, 0x0000, 0x0000, 0x0000, 0x0000, 0x135f,
- 0x1360, 0x1361, 0x1362, 0x1363, 0x1364, 0x1365, 0x1366, 0x1367,
- 0x1368, 0x1369, 0x136a, 0x136b, 0x136c, 0x136d, 0x136e, 0x136f,
- 0x1370, 0x1371, 0x1372, 0x1373, 0x1374, 0x1375, 0x1376, 0x1377,
- 0x1378, 0x1379, 0x137a, 0x137b, 0x137c, 0x0000, 0x0000, 0x0000,
- 0x1380, 0x1381, 0x1382, 0x1383, 0x1384, 0x1385, 0x1386, 0x1387,
- 0x1388, 0x1389, 0x138a, 0x138b, 0x138c, 0x138d, 0x138e, 0x138f,
- 0x1390, 0x1391, 0x1392, 0x1393, 0x1394, 0x1395, 0x1396, 0x1397,
- 0x1398, 0x1399, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x13a0, 0x13a1, 0x13a2, 0x13a3, 0x13a4, 0x13a5, 0x13a6, 0x13a7,
- 0x13a8, 0x13a9, 0x13aa, 0x13ab, 0x13ac, 0x13ad, 0x13ae, 0x13af,
- 0x13b0, 0x13b1, 0x13b2, 0x13b3, 0x13b4, 0x13b5, 0x13b6, 0x13b7,
- 0x13b8, 0x13b9, 0x13ba, 0x13bb, 0x13bc, 0x13bd, 0x13be, 0x13bf,
- 0x13c0, 0x13c1, 0x13c2, 0x13c3, 0x13c4, 0x13c5, 0x13c6, 0x13c7,
- 0x13c8, 0x13c9, 0x13ca, 0x13cb, 0x13cc, 0x13cd, 0x13ce, 0x13cf,
- 0x13d0, 0x13d1, 0x13d2, 0x13d3, 0x13d4, 0x13d5, 0x13d6, 0x13d7,
- 0x13d8, 0x13d9, 0x13da, 0x13db, 0x13dc, 0x13dd, 0x13de, 0x13df,
- 0x13e0, 0x13e1, 0x13e2, 0x13e3, 0x13e4, 0x13e5, 0x13e6, 0x13e7,
- 0x13e8, 0x13e9, 0x13ea, 0x13eb, 0x13ec, 0x13ed, 0x13ee, 0x13ef,
- 0x13f0, 0x13f1, 0x13f2, 0x13f3, 0x13f4, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x1401, 0x1402, 0x1403, 0x1404, 0x1405, 0x1406, 0x1407,
- 0x1408, 0x1409, 0x140a, 0x140b, 0x140c, 0x140d, 0x140e, 0x140f,
- 0x1410, 0x1411, 0x1412, 0x1413, 0x1414, 0x1415, 0x1416, 0x1417,
- 0x1418, 0x1419, 0x141a, 0x141b, 0x141c, 0x141d, 0x141e, 0x141f,
- 0x1420, 0x1421, 0x1422, 0x1423, 0x1424, 0x1425, 0x1426, 0x1427,
- 0x1428, 0x1429, 0x142a, 0x142b, 0x142c, 0x142d, 0x142e, 0x142f,
- 0x1430, 0x1431, 0x1432, 0x1433, 0x1434, 0x1435, 0x1436, 0x1437,
- 0x1438, 0x1439, 0x143a, 0x143b, 0x143c, 0x143d, 0x143e, 0x143f,
- 0x1440, 0x1441, 0x1442, 0x1443, 0x1444, 0x1445, 0x1446, 0x1447,
- 0x1448, 0x1449, 0x144a, 0x144b, 0x144c, 0x144d, 0x144e, 0x144f,
- 0x1450, 0x1451, 0x1452, 0x1453, 0x1454, 0x1455, 0x1456, 0x1457,
- 0x1458, 0x1459, 0x145a, 0x145b, 0x145c, 0x145d, 0x145e, 0x145f,
- 0x1460, 0x1461, 0x1462, 0x1463, 0x1464, 0x1465, 0x1466, 0x1467,
- 0x1468, 0x1469, 0x146a, 0x146b, 0x146c, 0x146d, 0x146e, 0x146f,
- 0x1470, 0x1471, 0x1472, 0x1473, 0x1474, 0x1475, 0x1476, 0x1477,
- 0x1478, 0x1479, 0x147a, 0x147b, 0x147c, 0x147d, 0x147e, 0x147f,
- 0x1480, 0x1481, 0x1482, 0x1483, 0x1484, 0x1485, 0x1486, 0x1487,
- 0x1488, 0x1489, 0x148a, 0x148b, 0x148c, 0x148d, 0x148e, 0x148f,
- 0x1490, 0x1491, 0x1492, 0x1493, 0x1494, 0x1495, 0x1496, 0x1497,
- 0x1498, 0x1499, 0x149a, 0x149b, 0x149c, 0x149d, 0x149e, 0x149f,
- 0x14a0, 0x14a1, 0x14a2, 0x14a3, 0x14a4, 0x14a5, 0x14a6, 0x14a7,
- 0x14a8, 0x14a9, 0x14aa, 0x14ab, 0x14ac, 0x14ad, 0x14ae, 0x14af,
- 0x14b0, 0x14b1, 0x14b2, 0x14b3, 0x14b4, 0x14b5, 0x14b6, 0x14b7,
- 0x14b8, 0x14b9, 0x14ba, 0x14bb, 0x14bc, 0x14bd, 0x14be, 0x14bf,
- 0x14c0, 0x14c1, 0x14c2, 0x14c3, 0x14c4, 0x14c5, 0x14c6, 0x14c7,
- 0x14c8, 0x14c9, 0x14ca, 0x14cb, 0x14cc, 0x14cd, 0x14ce, 0x14cf,
- 0x14d0, 0x14d1, 0x14d2, 0x14d3, 0x14d4, 0x14d5, 0x14d6, 0x14d7,
- 0x14d8, 0x14d9, 0x14da, 0x14db, 0x14dc, 0x14dd, 0x14de, 0x14df,
- 0x14e0, 0x14e1, 0x14e2, 0x14e3, 0x14e4, 0x14e5, 0x14e6, 0x14e7,
- 0x14e8, 0x14e9, 0x14ea, 0x14eb, 0x14ec, 0x14ed, 0x14ee, 0x14ef,
- 0x14f0, 0x14f1, 0x14f2, 0x14f3, 0x14f4, 0x14f5, 0x14f6, 0x14f7,
- 0x14f8, 0x14f9, 0x14fa, 0x14fb, 0x14fc, 0x14fd, 0x14fe, 0x14ff,
- 0x1500, 0x1501, 0x1502, 0x1503, 0x1504, 0x1505, 0x1506, 0x1507,
- 0x1508, 0x1509, 0x150a, 0x150b, 0x150c, 0x150d, 0x150e, 0x150f,
- 0x1510, 0x1511, 0x1512, 0x1513, 0x1514, 0x1515, 0x1516, 0x1517,
- 0x1518, 0x1519, 0x151a, 0x151b, 0x151c, 0x151d, 0x151e, 0x151f,
- 0x1520, 0x1521, 0x1522, 0x1523, 0x1524, 0x1525, 0x1526, 0x1527,
- 0x1528, 0x1529, 0x152a, 0x152b, 0x152c, 0x152d, 0x152e, 0x152f,
- 0x1530, 0x1531, 0x1532, 0x1533, 0x1534, 0x1535, 0x1536, 0x1537,
- 0x1538, 0x1539, 0x153a, 0x153b, 0x153c, 0x153d, 0x153e, 0x153f,
- 0x1540, 0x1541, 0x1542, 0x1543, 0x1544, 0x1545, 0x1546, 0x1547,
- 0x1548, 0x1549, 0x154a, 0x154b, 0x154c, 0x154d, 0x154e, 0x154f,
- 0x1550, 0x1551, 0x1552, 0x1553, 0x1554, 0x1555, 0x1556, 0x1557,
- 0x1558, 0x1559, 0x155a, 0x155b, 0x155c, 0x155d, 0x155e, 0x155f,
- 0x1560, 0x1561, 0x1562, 0x1563, 0x1564, 0x1565, 0x1566, 0x1567,
- 0x1568, 0x1569, 0x156a, 0x156b, 0x156c, 0x156d, 0x156e, 0x156f,
- 0x1570, 0x1571, 0x1572, 0x1573, 0x1574, 0x1575, 0x1576, 0x1577,
- 0x1578, 0x1579, 0x157a, 0x157b, 0x157c, 0x157d, 0x157e, 0x157f,
- 0x1580, 0x1581, 0x1582, 0x1583, 0x1584, 0x1585, 0x1586, 0x1587,
- 0x1588, 0x1589, 0x158a, 0x158b, 0x158c, 0x158d, 0x158e, 0x158f,
- 0x1590, 0x1591, 0x1592, 0x1593, 0x1594, 0x1595, 0x1596, 0x1597,
- 0x1598, 0x1599, 0x159a, 0x159b, 0x159c, 0x159d, 0x159e, 0x159f,
- 0x15a0, 0x15a1, 0x15a2, 0x15a3, 0x15a4, 0x15a5, 0x15a6, 0x15a7,
- 0x15a8, 0x15a9, 0x15aa, 0x15ab, 0x15ac, 0x15ad, 0x15ae, 0x15af,
- 0x15b0, 0x15b1, 0x15b2, 0x15b3, 0x15b4, 0x15b5, 0x15b6, 0x15b7,
- 0x15b8, 0x15b9, 0x15ba, 0x15bb, 0x15bc, 0x15bd, 0x15be, 0x15bf,
- 0x15c0, 0x15c1, 0x15c2, 0x15c3, 0x15c4, 0x15c5, 0x15c6, 0x15c7,
- 0x15c8, 0x15c9, 0x15ca, 0x15cb, 0x15cc, 0x15cd, 0x15ce, 0x15cf,
- 0x15d0, 0x15d1, 0x15d2, 0x15d3, 0x15d4, 0x15d5, 0x15d6, 0x15d7,
- 0x15d8, 0x15d9, 0x15da, 0x15db, 0x15dc, 0x15dd, 0x15de, 0x15df,
- 0x15e0, 0x15e1, 0x15e2, 0x15e3, 0x15e4, 0x15e5, 0x15e6, 0x15e7,
- 0x15e8, 0x15e9, 0x15ea, 0x15eb, 0x15ec, 0x15ed, 0x15ee, 0x15ef,
- 0x15f0, 0x15f1, 0x15f2, 0x15f3, 0x15f4, 0x15f5, 0x15f6, 0x15f7,
- 0x15f8, 0x15f9, 0x15fa, 0x15fb, 0x15fc, 0x15fd, 0x15fe, 0x15ff,
- 0x1600, 0x1601, 0x1602, 0x1603, 0x1604, 0x1605, 0x1606, 0x1607,
- 0x1608, 0x1609, 0x160a, 0x160b, 0x160c, 0x160d, 0x160e, 0x160f,
- 0x1610, 0x1611, 0x1612, 0x1613, 0x1614, 0x1615, 0x1616, 0x1617,
- 0x1618, 0x1619, 0x161a, 0x161b, 0x161c, 0x161d, 0x161e, 0x161f,
- 0x1620, 0x1621, 0x1622, 0x1623, 0x1624, 0x1625, 0x1626, 0x1627,
- 0x1628, 0x1629, 0x162a, 0x162b, 0x162c, 0x162d, 0x162e, 0x162f,
- 0x1630, 0x1631, 0x1632, 0x1633, 0x1634, 0x1635, 0x1636, 0x1637,
- 0x1638, 0x1639, 0x163a, 0x163b, 0x163c, 0x163d, 0x163e, 0x163f,
- 0x1640, 0x1641, 0x1642, 0x1643, 0x1644, 0x1645, 0x1646, 0x1647,
- 0x1648, 0x1649, 0x164a, 0x164b, 0x164c, 0x164d, 0x164e, 0x164f,
- 0x1650, 0x1651, 0x1652, 0x1653, 0x1654, 0x1655, 0x1656, 0x1657,
- 0x1658, 0x1659, 0x165a, 0x165b, 0x165c, 0x165d, 0x165e, 0x165f,
- 0x1660, 0x1661, 0x1662, 0x1663, 0x1664, 0x1665, 0x1666, 0x1667,
- 0x1668, 0x1669, 0x166a, 0x166b, 0x166c, 0x166d, 0x166e, 0x166f,
- 0x1670, 0x1671, 0x1672, 0x1673, 0x1674, 0x1675, 0x1676, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1680, 0x1681, 0x1682, 0x1683, 0x1684, 0x1685, 0x1686, 0x1687,
- 0x1688, 0x1689, 0x168a, 0x168b, 0x168c, 0x168d, 0x168e, 0x168f,
- 0x1690, 0x1691, 0x1692, 0x1693, 0x1694, 0x1695, 0x1696, 0x1697,
- 0x1698, 0x1699, 0x169a, 0x169b, 0x169c, 0x0000, 0x0000, 0x0000,
- 0x16a0, 0x16a1, 0x16a2, 0x16a3, 0x16a4, 0x16a5, 0x16a6, 0x16a7,
- 0x16a8, 0x16a9, 0x16aa, 0x16ab, 0x16ac, 0x16ad, 0x16ae, 0x16af,
- 0x16b0, 0x16b1, 0x16b2, 0x16b3, 0x16b4, 0x16b5, 0x16b6, 0x16b7,
- 0x16b8, 0x16b9, 0x16ba, 0x16bb, 0x16bc, 0x16bd, 0x16be, 0x16bf,
- 0x16c0, 0x16c1, 0x16c2, 0x16c3, 0x16c4, 0x16c5, 0x16c6, 0x16c7,
- 0x16c8, 0x16c9, 0x16ca, 0x16cb, 0x16cc, 0x16cd, 0x16ce, 0x16cf,
- 0x16d0, 0x16d1, 0x16d2, 0x16d3, 0x16d4, 0x16d5, 0x16d6, 0x16d7,
- 0x16d8, 0x16d9, 0x16da, 0x16db, 0x16dc, 0x16dd, 0x16de, 0x16df,
- 0x16e0, 0x16e1, 0x16e2, 0x16e3, 0x16e4, 0x16e5, 0x16e6, 0x16e7,
- 0x16e8, 0x16e9, 0x16ea, 0x16eb, 0x16ec, 0x16ed, 0x16ee, 0x16ef,
- 0x16f0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1700, 0x1701, 0x1702, 0x1703, 0x1704, 0x1705, 0x1706, 0x1707,
- 0x1708, 0x1709, 0x170a, 0x170b, 0x170c, 0x0000, 0x170e, 0x170f,
- 0x1710, 0x1711, 0x1712, 0x1713, 0x1714, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1720, 0x1721, 0x1722, 0x1723, 0x1724, 0x1725, 0x1726, 0x1727,
- 0x1728, 0x1729, 0x172a, 0x172b, 0x172c, 0x172d, 0x172e, 0x172f,
- 0x1730, 0x1731, 0x1732, 0x1733, 0x1734, 0x1735, 0x1736, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1740, 0x1741, 0x1742, 0x1743, 0x1744, 0x1745, 0x1746, 0x1747,
- 0x1748, 0x1749, 0x174a, 0x174b, 0x174c, 0x174d, 0x174e, 0x174f,
- 0x1750, 0x1751, 0x1752, 0x1753, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1760, 0x1761, 0x1762, 0x1763, 0x1764, 0x1765, 0x1766, 0x1767,
- 0x1768, 0x1769, 0x176a, 0x176b, 0x176c, 0x0000, 0x176e, 0x176f,
- 0x1770, 0x0000, 0x1772, 0x1773, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1780, 0x1781, 0x1782, 0x1783, 0x1784, 0x1785, 0x1786, 0x1787,
- 0x1788, 0x1789, 0x178a, 0x178b, 0x178c, 0x178d, 0x178e, 0x178f,
- 0x1790, 0x1791, 0x1792, 0x1793, 0x1794, 0x1795, 0x1796, 0x1797,
- 0x1798, 0x1799, 0x179a, 0x179b, 0x179c, 0x179d, 0x179e, 0x179f,
- 0x17a0, 0x17a1, 0x17a2, 0x17a3, 0x17a4, 0x17a5, 0x17a6, 0x17a7,
- 0x17a8, 0x17a9, 0x17aa, 0x17ab, 0x17ac, 0x17ad, 0x17ae, 0x17af,
- 0x17b0, 0x17b1, 0x17b2, 0x17b3, 0x17b4, 0x17b5, 0x17b6, 0x17b7,
- 0x17b8, 0x17b9, 0x17ba, 0x17bb, 0x17bc, 0x17bd, 0x17be, 0x17bf,
- 0x17c0, 0x17c1, 0x17c2, 0x17c3, 0x17c4, 0x17c5, 0x17c6, 0x17c7,
- 0x17c8, 0x17c9, 0x17ca, 0x17cb, 0x17cc, 0x17cd, 0x17ce, 0x17cf,
- 0x17d0, 0x17d1, 0x17d2, 0x17d3, 0x17d4, 0x17d5, 0x17d6, 0x17d7,
- 0x17d8, 0x17d9, 0x17da, 0x17db, 0x17dc, 0x17dd, 0x0000, 0x0000,
- 0x17e0, 0x17e1, 0x17e2, 0x17e3, 0x17e4, 0x17e5, 0x17e6, 0x17e7,
- 0x17e8, 0x17e9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x17f0, 0x17f1, 0x17f2, 0x17f3, 0x17f4, 0x17f5, 0x17f6, 0x17f7,
- 0x17f8, 0x17f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1800, 0x1801, 0x1802, 0x1803, 0x1804, 0x1805, 0x1806, 0x1807,
- 0x1808, 0x1809, 0x180a, 0x180b, 0x180c, 0x180d, 0x180e, 0x0000,
- 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817,
- 0x1818, 0x1819, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827,
- 0x1828, 0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f,
- 0x1830, 0x1831, 0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837,
- 0x1838, 0x1839, 0x183a, 0x183b, 0x183c, 0x183d, 0x183e, 0x183f,
- 0x1840, 0x1841, 0x1842, 0x1843, 0x1844, 0x1845, 0x1846, 0x1847,
- 0x1848, 0x1849, 0x184a, 0x184b, 0x184c, 0x184d, 0x184e, 0x184f,
- 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855, 0x1856, 0x1857,
- 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e, 0x185f,
- 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867,
- 0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f,
- 0x1870, 0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1880, 0x1881, 0x1882, 0x1883, 0x1884, 0x1885, 0x1886, 0x1887,
- 0x1888, 0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f,
- 0x1890, 0x1891, 0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897,
- 0x1898, 0x1899, 0x189a, 0x189b, 0x189c, 0x189d, 0x189e, 0x189f,
- 0x18a0, 0x18a1, 0x18a2, 0x18a3, 0x18a4, 0x18a5, 0x18a6, 0x18a7,
- 0x18a8, 0x18a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1900, 0x1901, 0x1902, 0x1903, 0x1904, 0x1905, 0x1906, 0x1907,
- 0x1908, 0x1909, 0x190a, 0x190b, 0x190c, 0x190d, 0x190e, 0x190f,
- 0x1910, 0x1911, 0x1912, 0x1913, 0x1914, 0x1915, 0x1916, 0x1917,
- 0x1918, 0x1919, 0x191a, 0x191b, 0x191c, 0x0000, 0x0000, 0x0000,
- 0x1920, 0x1921, 0x1922, 0x1923, 0x1924, 0x1925, 0x1926, 0x1927,
- 0x1928, 0x1929, 0x192a, 0x192b, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1930, 0x1931, 0x1932, 0x1933, 0x1934, 0x1935, 0x1936, 0x1937,
- 0x1938, 0x1939, 0x193a, 0x193b, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1940, 0x0000, 0x0000, 0x0000, 0x1944, 0x1945, 0x1946, 0x1947,
- 0x1948, 0x1949, 0x194a, 0x194b, 0x194c, 0x194d, 0x194e, 0x194f,
- 0x1950, 0x1951, 0x1952, 0x1953, 0x1954, 0x1955, 0x1956, 0x1957,
- 0x1958, 0x1959, 0x195a, 0x195b, 0x195c, 0x195d, 0x195e, 0x195f,
- 0x1960, 0x1961, 0x1962, 0x1963, 0x1964, 0x1965, 0x1966, 0x1967,
- 0x1968, 0x1969, 0x196a, 0x196b, 0x196c, 0x196d, 0x0000, 0x0000,
- 0x1970, 0x1971, 0x1972, 0x1973, 0x1974, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1980, 0x1981, 0x1982, 0x1983, 0x1984, 0x1985, 0x1986, 0x1987,
- 0x1988, 0x1989, 0x198a, 0x198b, 0x198c, 0x198d, 0x198e, 0x198f,
- 0x1990, 0x1991, 0x1992, 0x1993, 0x1994, 0x1995, 0x1996, 0x1997,
- 0x1998, 0x1999, 0x199a, 0x199b, 0x199c, 0x199d, 0x199e, 0x199f,
- 0x19a0, 0x19a1, 0x19a2, 0x19a3, 0x19a4, 0x19a5, 0x19a6, 0x19a7,
- 0x19a8, 0x19a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x19b0, 0x19b1, 0x19b2, 0x19b3, 0x19b4, 0x19b5, 0x19b6, 0x19b7,
- 0x19b8, 0x19b9, 0x19ba, 0x19bb, 0x19bc, 0x19bd, 0x19be, 0x19bf,
- 0x19c0, 0x19c1, 0x19c2, 0x19c3, 0x19c4, 0x19c5, 0x19c6, 0x19c7,
- 0x19c8, 0x19c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x19d0, 0x19d1, 0x19d2, 0x19d3, 0x19d4, 0x19d5, 0x19d6, 0x19d7,
- 0x19d8, 0x19d9, 0x0000, 0x0000, 0x0000, 0x0000, 0x19de, 0x19df,
- 0x19e0, 0x19e1, 0x19e2, 0x19e3, 0x19e4, 0x19e5, 0x19e6, 0x19e7,
- 0x19e8, 0x19e9, 0x19ea, 0x19eb, 0x19ec, 0x19ed, 0x19ee, 0x19ef,
- 0x19f0, 0x19f1, 0x19f2, 0x19f3, 0x19f4, 0x19f5, 0x19f6, 0x19f7,
- 0x19f8, 0x19f9, 0x19fa, 0x19fb, 0x19fc, 0x19fd, 0x19fe, 0x19ff,
- 0x1a00, 0x1a01, 0x1a02, 0x1a03, 0x1a04, 0x1a05, 0x1a06, 0x1a07,
- 0x1a08, 0x1a09, 0x1a0a, 0x1a0b, 0x1a0c, 0x1a0d, 0x1a0e, 0x1a0f,
- 0x1a10, 0x1a11, 0x1a12, 0x1a13, 0x1a14, 0x1a15, 0x1a16, 0x1a17,
- 0x1a18, 0x1a19, 0x1a1a, 0x1a1b, 0x0000, 0x0000, 0x1a1e, 0x1a1f,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1b00, 0x1b01, 0x1b02, 0x1b03, 0x1b04, 0x1b05, 0x1b06, 0x1b07,
- 0x1b08, 0x1b09, 0x1b0a, 0x1b0b, 0x1b0c, 0x1b0d, 0x1b0e, 0x1b0f,
- 0x1b10, 0x1b11, 0x1b12, 0x1b13, 0x1b14, 0x1b15, 0x1b16, 0x1b17,
- 0x1b18, 0x1b19, 0x1b1a, 0x1b1b, 0x1b1c, 0x1b1d, 0x1b1e, 0x1b1f,
- 0x1b20, 0x1b21, 0x1b22, 0x1b23, 0x1b24, 0x1b25, 0x1b26, 0x1b27,
- 0x1b28, 0x1b29, 0x1b2a, 0x1b2b, 0x1b2c, 0x1b2d, 0x1b2e, 0x1b2f,
- 0x1b30, 0x1b31, 0x1b32, 0x1b33, 0x1b34, 0x1b35, 0x1b36, 0x1b37,
- 0x1b38, 0x1b39, 0x1b3a, 0x1b3b, 0x1b3c, 0x1b3d, 0x1b3e, 0x1b3f,
- 0x1b40, 0x1b41, 0x1b42, 0x1b43, 0x1b44, 0x1b45, 0x1b46, 0x1b47,
- 0x1b48, 0x1b49, 0x1b4a, 0x1b4b, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1b50, 0x1b51, 0x1b52, 0x1b53, 0x1b54, 0x1b55, 0x1b56, 0x1b57,
- 0x1b58, 0x1b59, 0x1b5a, 0x1b5b, 0x1b5c, 0x1b5d, 0x1b5e, 0x1b5f,
- 0x1b60, 0x1b61, 0x1b62, 0x1b63, 0x1b64, 0x1b65, 0x1b66, 0x1b67,
- 0x1b68, 0x1b69, 0x1b6a, 0x1b6b, 0x1b6c, 0x1b6d, 0x1b6e, 0x1b6f,
- 0x1b70, 0x1b71, 0x1b72, 0x1b73, 0x1b74, 0x1b75, 0x1b76, 0x1b77,
- 0x1b78, 0x1b79, 0x1b7a, 0x1b7b, 0x1b7c, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1d00, 0x1d01, 0x1d02, 0x1d03, 0x1d04, 0x1d05, 0x1d06, 0x1d07,
- 0x1d08, 0x1d09, 0x1d0a, 0x1d0b, 0x1d0c, 0x1d0d, 0x1d0e, 0x1d0f,
- 0x1d10, 0x1d11, 0x1d12, 0x1d13, 0x1d14, 0x1d15, 0x1d16, 0x1d17,
- 0x1d18, 0x1d19, 0x1d1a, 0x1d1b, 0x1d1c, 0x1d1d, 0x1d1e, 0x1d1f,
- 0x1d20, 0x1d21, 0x1d22, 0x1d23, 0x1d24, 0x1d25, 0x1d26, 0x1d27,
- 0x1d28, 0x1d29, 0x1d2a, 0x1d2b, 0x1d2c, 0x1d2d, 0x1d2e, 0x1d2f,
- 0x1d30, 0x1d31, 0x1d32, 0x1d33, 0x1d34, 0x1d35, 0x1d36, 0x1d37,
- 0x1d38, 0x1d39, 0x1d3a, 0x1d3b, 0x1d3c, 0x1d3d, 0x1d3e, 0x1d3f,
- 0x1d40, 0x1d41, 0x1d42, 0x1d43, 0x1d44, 0x1d45, 0x1d46, 0x1d47,
- 0x1d48, 0x1d49, 0x1d4a, 0x1d4b, 0x1d4c, 0x1d4d, 0x1d4e, 0x1d4f,
- 0x1d50, 0x1d51, 0x1d52, 0x1d53, 0x1d54, 0x1d55, 0x1d56, 0x1d57,
- 0x1d58, 0x1d59, 0x1d5a, 0x1d5b, 0x1d5c, 0x1d5d, 0x1d5e, 0x1d5f,
- 0x1d60, 0x1d61, 0x1d62, 0x1d63, 0x1d64, 0x1d65, 0x1d66, 0x1d67,
- 0x1d68, 0x1d69, 0x1d6a, 0x1d6b, 0x1d6c, 0x1d6d, 0x1d6e, 0x1d6f,
- 0x1d70, 0x1d71, 0x1d72, 0x1d73, 0x1d74, 0x1d75, 0x1d76, 0x1d77,
- 0x1d78, 0x1d79, 0x1d7a, 0x1d7b, 0x1d7c, 0x1d7d, 0x1d7e, 0x1d7f,
- 0x1d80, 0x1d81, 0x1d82, 0x1d83, 0x1d84, 0x1d85, 0x1d86, 0x1d87,
- 0x1d88, 0x1d89, 0x1d8a, 0x1d8b, 0x1d8c, 0x1d8d, 0x1d8e, 0x1d8f,
- 0x1d90, 0x1d91, 0x1d92, 0x1d93, 0x1d94, 0x1d95, 0x1d96, 0x1d97,
- 0x1d98, 0x1d99, 0x1d9a, 0x1d9b, 0x1d9c, 0x1d9d, 0x1d9e, 0x1d9f,
- 0x1da0, 0x1da1, 0x1da2, 0x1da3, 0x1da4, 0x1da5, 0x1da6, 0x1da7,
- 0x1da8, 0x1da9, 0x1daa, 0x1dab, 0x1dac, 0x1dad, 0x1dae, 0x1daf,
- 0x1db0, 0x1db1, 0x1db2, 0x1db3, 0x1db4, 0x1db5, 0x1db6, 0x1db7,
- 0x1db8, 0x1db9, 0x1dba, 0x1dbb, 0x1dbc, 0x1dbd, 0x1dbe, 0x1dbf,
- 0x1dc0, 0x1dc1, 0x1dc2, 0x1dc3, 0x1dc4, 0x1dc5, 0x1dc6, 0x1dc7,
- 0x1dc8, 0x1dc9, 0x1dca, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1dfe, 0x1dff,
- 0x1e01, 0x1e01, 0x1e03, 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07,
- 0x1e09, 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f,
- 0x1e11, 0x1e11, 0x1e13, 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17,
- 0x1e19, 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f,
- 0x1e21, 0x1e21, 0x1e23, 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27,
- 0x1e29, 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f,
- 0x1e31, 0x1e31, 0x1e33, 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37,
- 0x1e39, 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f,
- 0x1e41, 0x1e41, 0x1e43, 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47,
- 0x1e49, 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51, 0x1e53, 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57,
- 0x1e59, 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f,
- 0x1e61, 0x1e61, 0x1e63, 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67,
- 0x1e69, 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f,
- 0x1e71, 0x1e71, 0x1e73, 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77,
- 0x1e79, 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f,
- 0x1e81, 0x1e81, 0x1e83, 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87,
- 0x1e89, 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f,
- 0x1e91, 0x1e91, 0x1e93, 0x1e93, 0x1e95, 0x1e95, 0x1e96, 0x1e97,
- 0x1e98, 0x1e99, 0x1e9a, 0x1e9b, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7,
- 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf,
- 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7,
- 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf,
- 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7,
- 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf,
- 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7,
- 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
- 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
- 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x0000, 0x0000,
- 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x0000, 0x0000,
- 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
- 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
- 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
- 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
- 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x0000, 0x0000,
- 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x0000, 0x0000,
- 0x1f50, 0x1f51, 0x1f52, 0x1f53, 0x1f54, 0x1f55, 0x1f56, 0x1f57,
- 0x0000, 0x1f51, 0x0000, 0x1f53, 0x0000, 0x1f55, 0x0000, 0x1f57,
- 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
- 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
- 0x1f70, 0x1f71, 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1f76, 0x1f77,
- 0x1f78, 0x1f79, 0x1f7a, 0x1f7b, 0x1f7c, 0x1f7d, 0x0000, 0x0000,
- 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
- 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
- 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
- 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
- 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
- 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
- 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x0000, 0x1fb6, 0x1fb7,
- 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1fb3, 0x1fbd, 0x1fbe, 0x1fbf,
- 0x1fc0, 0x1fc1, 0x1fc2, 0x1fc3, 0x1fc4, 0x0000, 0x1fc6, 0x1fc7,
- 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1fc3, 0x1fcd, 0x1fce, 0x1fcf,
- 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x0000, 0x0000, 0x1fd6, 0x1fd7,
- 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x0000, 0x1fdd, 0x1fde, 0x1fdf,
- 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5, 0x1fe6, 0x1fe7,
- 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0x1fed, 0x1fee, 0x1fef,
- 0x0000, 0x0000, 0x1ff2, 0x1ff3, 0x1ff4, 0x0000, 0x1ff6, 0x1ff7,
- 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x1ff3, 0x1ffd, 0x1ffe, 0x0000,
- 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007,
- 0x2008, 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x200e, 0x200f,
- 0x2010, 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017,
- 0x2018, 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f,
- 0x2020, 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027,
- 0x2028, 0x2029, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0x202f,
- 0x2030, 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037,
- 0x2038, 0x2039, 0x203a, 0x203b, 0x203c, 0x203d, 0x203e, 0x203f,
- 0x2040, 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047,
- 0x2048, 0x2049, 0x204a, 0x204b, 0x204c, 0x204d, 0x204e, 0x204f,
- 0x2050, 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057,
- 0x2058, 0x2059, 0x205a, 0x205b, 0x205c, 0x205d, 0x205e, 0x205f,
- 0x2060, 0x2061, 0x2062, 0x2063, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f,
- 0x2070, 0x2071, 0x0000, 0x0000, 0x2074, 0x2075, 0x2076, 0x2077,
- 0x2078, 0x2079, 0x207a, 0x207b, 0x207c, 0x207d, 0x207e, 0x207f,
- 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087,
- 0x2088, 0x2089, 0x208a, 0x208b, 0x208c, 0x208d, 0x208e, 0x0000,
- 0x2090, 0x2091, 0x2092, 0x2093, 0x2094, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x20a0, 0x20a1, 0x20a2, 0x20a3, 0x20a4, 0x20a5, 0x20a6, 0x20a7,
- 0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac, 0x20ad, 0x20ae, 0x20af,
- 0x20b0, 0x20b1, 0x20b2, 0x20b3, 0x20b4, 0x20b5, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x20d0, 0x20d1, 0x20d2, 0x20d3, 0x20d4, 0x20d5, 0x20d6, 0x20d7,
- 0x20d8, 0x20d9, 0x20da, 0x20db, 0x20dc, 0x20dd, 0x20de, 0x20df,
- 0x20e0, 0x20e1, 0x20e2, 0x20e3, 0x20e4, 0x20e5, 0x20e6, 0x20e7,
- 0x20e8, 0x20e9, 0x20ea, 0x20eb, 0x20ec, 0x20ed, 0x20ee, 0x20ef,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107,
- 0x2108, 0x2109, 0x210a, 0x210b, 0x210c, 0x210d, 0x210e, 0x210f,
- 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117,
- 0x2118, 0x2119, 0x211a, 0x211b, 0x211c, 0x211d, 0x211e, 0x211f,
- 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x03c9, 0x2127,
- 0x2128, 0x2129, 0x006b, 0x00e5, 0x212c, 0x212d, 0x212e, 0x212f,
- 0x2130, 0x2131, 0x214e, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137,
- 0x2138, 0x2139, 0x213a, 0x213b, 0x213c, 0x213d, 0x213e, 0x213f,
- 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147,
- 0x2148, 0x2149, 0x214a, 0x214b, 0x214c, 0x214d, 0x214e, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157,
- 0x2158, 0x2159, 0x215a, 0x215b, 0x215c, 0x215d, 0x215e, 0x215f,
- 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
- 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
- 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
- 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
- 0x2180, 0x2181, 0x2182, 0x2184, 0x2184, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197,
- 0x2198, 0x2199, 0x219a, 0x219b, 0x219c, 0x219d, 0x219e, 0x219f,
- 0x21a0, 0x21a1, 0x21a2, 0x21a3, 0x21a4, 0x21a5, 0x21a6, 0x21a7,
- 0x21a8, 0x21a9, 0x21aa, 0x21ab, 0x21ac, 0x21ad, 0x21ae, 0x21af,
- 0x21b0, 0x21b1, 0x21b2, 0x21b3, 0x21b4, 0x21b5, 0x21b6, 0x21b7,
- 0x21b8, 0x21b9, 0x21ba, 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf,
- 0x21c0, 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7,
- 0x21c8, 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf,
- 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x21d5, 0x21d6, 0x21d7,
- 0x21d8, 0x21d9, 0x21da, 0x21db, 0x21dc, 0x21dd, 0x21de, 0x21df,
- 0x21e0, 0x21e1, 0x21e2, 0x21e3, 0x21e4, 0x21e5, 0x21e6, 0x21e7,
- 0x21e8, 0x21e9, 0x21ea, 0x21eb, 0x21ec, 0x21ed, 0x21ee, 0x21ef,
- 0x21f0, 0x21f1, 0x21f2, 0x21f3, 0x21f4, 0x21f5, 0x21f6, 0x21f7,
- 0x21f8, 0x21f9, 0x21fa, 0x21fb, 0x21fc, 0x21fd, 0x21fe, 0x21ff,
- 0x2200, 0x2201, 0x2202, 0x2203, 0x2204, 0x2205, 0x2206, 0x2207,
- 0x2208, 0x2209, 0x220a, 0x220b, 0x220c, 0x220d, 0x220e, 0x220f,
- 0x2210, 0x2211, 0x2212, 0x2213, 0x2214, 0x2215, 0x2216, 0x2217,
- 0x2218, 0x2219, 0x221a, 0x221b, 0x221c, 0x221d, 0x221e, 0x221f,
- 0x2220, 0x2221, 0x2222, 0x2223, 0x2224, 0x2225, 0x2226, 0x2227,
- 0x2228, 0x2229, 0x222a, 0x222b, 0x222c, 0x222d, 0x222e, 0x222f,
- 0x2230, 0x2231, 0x2232, 0x2233, 0x2234, 0x2235, 0x2236, 0x2237,
- 0x2238, 0x2239, 0x223a, 0x223b, 0x223c, 0x223d, 0x223e, 0x223f,
- 0x2240, 0x2241, 0x2242, 0x2243, 0x2244, 0x2245, 0x2246, 0x2247,
- 0x2248, 0x2249, 0x224a, 0x224b, 0x224c, 0x224d, 0x224e, 0x224f,
- 0x2250, 0x2251, 0x2252, 0x2253, 0x2254, 0x2255, 0x2256, 0x2257,
- 0x2258, 0x2259, 0x225a, 0x225b, 0x225c, 0x225d, 0x225e, 0x225f,
- 0x2260, 0x2261, 0x2262, 0x2263, 0x2264, 0x2265, 0x2266, 0x2267,
- 0x2268, 0x2269, 0x226a, 0x226b, 0x226c, 0x226d, 0x226e, 0x226f,
- 0x2270, 0x2271, 0x2272, 0x2273, 0x2274, 0x2275, 0x2276, 0x2277,
- 0x2278, 0x2279, 0x227a, 0x227b, 0x227c, 0x227d, 0x227e, 0x227f,
- 0x2280, 0x2281, 0x2282, 0x2283, 0x2284, 0x2285, 0x2286, 0x2287,
- 0x2288, 0x2289, 0x228a, 0x228b, 0x228c, 0x228d, 0x228e, 0x228f,
- 0x2290, 0x2291, 0x2292, 0x2293, 0x2294, 0x2295, 0x2296, 0x2297,
- 0x2298, 0x2299, 0x229a, 0x229b, 0x229c, 0x229d, 0x229e, 0x229f,
- 0x22a0, 0x22a1, 0x22a2, 0x22a3, 0x22a4, 0x22a5, 0x22a6, 0x22a7,
- 0x22a8, 0x22a9, 0x22aa, 0x22ab, 0x22ac, 0x22ad, 0x22ae, 0x22af,
- 0x22b0, 0x22b1, 0x22b2, 0x22b3, 0x22b4, 0x22b5, 0x22b6, 0x22b7,
- 0x22b8, 0x22b9, 0x22ba, 0x22bb, 0x22bc, 0x22bd, 0x22be, 0x22bf,
- 0x22c0, 0x22c1, 0x22c2, 0x22c3, 0x22c4, 0x22c5, 0x22c6, 0x22c7,
- 0x22c8, 0x22c9, 0x22ca, 0x22cb, 0x22cc, 0x22cd, 0x22ce, 0x22cf,
- 0x22d0, 0x22d1, 0x22d2, 0x22d3, 0x22d4, 0x22d5, 0x22d6, 0x22d7,
- 0x22d8, 0x22d9, 0x22da, 0x22db, 0x22dc, 0x22dd, 0x22de, 0x22df,
- 0x22e0, 0x22e1, 0x22e2, 0x22e3, 0x22e4, 0x22e5, 0x22e6, 0x22e7,
- 0x22e8, 0x22e9, 0x22ea, 0x22eb, 0x22ec, 0x22ed, 0x22ee, 0x22ef,
- 0x22f0, 0x22f1, 0x22f2, 0x22f3, 0x22f4, 0x22f5, 0x22f6, 0x22f7,
- 0x22f8, 0x22f9, 0x22fa, 0x22fb, 0x22fc, 0x22fd, 0x22fe, 0x22ff,
- 0x2300, 0x2301, 0x2302, 0x2303, 0x2304, 0x2305, 0x2306, 0x2307,
- 0x2308, 0x2309, 0x230a, 0x230b, 0x230c, 0x230d, 0x230e, 0x230f,
- 0x2310, 0x2311, 0x2312, 0x2313, 0x2314, 0x2315, 0x2316, 0x2317,
- 0x2318, 0x2319, 0x231a, 0x231b, 0x231c, 0x231d, 0x231e, 0x231f,
- 0x2320, 0x2321, 0x2322, 0x2323, 0x2324, 0x2325, 0x2326, 0x2327,
- 0x2328, 0x2329, 0x232a, 0x232b, 0x232c, 0x232d, 0x232e, 0x232f,
- 0x2330, 0x2331, 0x2332, 0x2333, 0x2334, 0x2335, 0x2336, 0x2337,
- 0x2338, 0x2339, 0x233a, 0x233b, 0x233c, 0x233d, 0x233e, 0x233f,
- 0x2340, 0x2341, 0x2342, 0x2343, 0x2344, 0x2345, 0x2346, 0x2347,
- 0x2348, 0x2349, 0x234a, 0x234b, 0x234c, 0x234d, 0x234e, 0x234f,
- 0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357,
- 0x2358, 0x2359, 0x235a, 0x235b, 0x235c, 0x235d, 0x235e, 0x235f,
- 0x2360, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367,
- 0x2368, 0x2369, 0x236a, 0x236b, 0x236c, 0x236d, 0x236e, 0x236f,
- 0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377,
- 0x2378, 0x2379, 0x237a, 0x237b, 0x237c, 0x237d, 0x237e, 0x237f,
- 0x2380, 0x2381, 0x2382, 0x2383, 0x2384, 0x2385, 0x2386, 0x2387,
- 0x2388, 0x2389, 0x238a, 0x238b, 0x238c, 0x238d, 0x238e, 0x238f,
- 0x2390, 0x2391, 0x2392, 0x2393, 0x2394, 0x2395, 0x2396, 0x2397,
- 0x2398, 0x2399, 0x239a, 0x239b, 0x239c, 0x239d, 0x239e, 0x239f,
- 0x23a0, 0x23a1, 0x23a2, 0x23a3, 0x23a4, 0x23a5, 0x23a6, 0x23a7,
- 0x23a8, 0x23a9, 0x23aa, 0x23ab, 0x23ac, 0x23ad, 0x23ae, 0x23af,
- 0x23b0, 0x23b1, 0x23b2, 0x23b3, 0x23b4, 0x23b5, 0x23b6, 0x23b7,
- 0x23b8, 0x23b9, 0x23ba, 0x23bb, 0x23bc, 0x23bd, 0x23be, 0x23bf,
- 0x23c0, 0x23c1, 0x23c2, 0x23c3, 0x23c4, 0x23c5, 0x23c6, 0x23c7,
- 0x23c8, 0x23c9, 0x23ca, 0x23cb, 0x23cc, 0x23cd, 0x23ce, 0x23cf,
- 0x23d0, 0x23d1, 0x23d2, 0x23d3, 0x23d4, 0x23d5, 0x23d6, 0x23d7,
- 0x23d8, 0x23d9, 0x23da, 0x23db, 0x23dc, 0x23dd, 0x23de, 0x23df,
- 0x23e0, 0x23e1, 0x23e2, 0x23e3, 0x23e4, 0x23e5, 0x23e6, 0x23e7,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407,
- 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f,
- 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417,
- 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f,
- 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447,
- 0x2448, 0x2449, 0x244a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
- 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f,
- 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477,
- 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f,
- 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487,
- 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f,
- 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497,
- 0x2498, 0x2499, 0x249a, 0x249b, 0x249c, 0x249d, 0x249e, 0x249f,
- 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7,
- 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af,
- 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x24d0, 0x24d1,
- 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9,
- 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1,
- 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9,
- 0x24d0, 0x24d1, 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7,
- 0x24d8, 0x24d9, 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df,
- 0x24e0, 0x24e1, 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7,
- 0x24e8, 0x24e9, 0x24ea, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef,
- 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0x24f5, 0x24f6, 0x24f7,
- 0x24f8, 0x24f9, 0x24fa, 0x24fb, 0x24fc, 0x24fd, 0x24fe, 0x24ff,
- 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506, 0x2507,
- 0x2508, 0x2509, 0x250a, 0x250b, 0x250c, 0x250d, 0x250e, 0x250f,
- 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516, 0x2517,
- 0x2518, 0x2519, 0x251a, 0x251b, 0x251c, 0x251d, 0x251e, 0x251f,
- 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526, 0x2527,
- 0x2528, 0x2529, 0x252a, 0x252b, 0x252c, 0x252d, 0x252e, 0x252f,
- 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537,
- 0x2538, 0x2539, 0x253a, 0x253b, 0x253c, 0x253d, 0x253e, 0x253f,
- 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
- 0x2548, 0x2549, 0x254a, 0x254b, 0x254c, 0x254d, 0x254e, 0x254f,
- 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557,
- 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f,
- 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567,
- 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x256d, 0x256e, 0x256f,
- 0x2570, 0x2571, 0x2572, 0x2573, 0x2574, 0x2575, 0x2576, 0x2577,
- 0x2578, 0x2579, 0x257a, 0x257b, 0x257c, 0x257d, 0x257e, 0x257f,
- 0x2580, 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587,
- 0x2588, 0x2589, 0x258a, 0x258b, 0x258c, 0x258d, 0x258e, 0x258f,
- 0x2590, 0x2591, 0x2592, 0x2593, 0x2594, 0x2595, 0x2596, 0x2597,
- 0x2598, 0x2599, 0x259a, 0x259b, 0x259c, 0x259d, 0x259e, 0x259f,
- 0x25a0, 0x25a1, 0x25a2, 0x25a3, 0x25a4, 0x25a5, 0x25a6, 0x25a7,
- 0x25a8, 0x25a9, 0x25aa, 0x25ab, 0x25ac, 0x25ad, 0x25ae, 0x25af,
- 0x25b0, 0x25b1, 0x25b2, 0x25b3, 0x25b4, 0x25b5, 0x25b6, 0x25b7,
- 0x25b8, 0x25b9, 0x25ba, 0x25bb, 0x25bc, 0x25bd, 0x25be, 0x25bf,
- 0x25c0, 0x25c1, 0x25c2, 0x25c3, 0x25c4, 0x25c5, 0x25c6, 0x25c7,
- 0x25c8, 0x25c9, 0x25ca, 0x25cb, 0x25cc, 0x25cd, 0x25ce, 0x25cf,
- 0x25d0, 0x25d1, 0x25d2, 0x25d3, 0x25d4, 0x25d5, 0x25d6, 0x25d7,
- 0x25d8, 0x25d9, 0x25da, 0x25db, 0x25dc, 0x25dd, 0x25de, 0x25df,
- 0x25e0, 0x25e1, 0x25e2, 0x25e3, 0x25e4, 0x25e5, 0x25e6, 0x25e7,
- 0x25e8, 0x25e9, 0x25ea, 0x25eb, 0x25ec, 0x25ed, 0x25ee, 0x25ef,
- 0x25f0, 0x25f1, 0x25f2, 0x25f3, 0x25f4, 0x25f5, 0x25f6, 0x25f7,
- 0x25f8, 0x25f9, 0x25fa, 0x25fb, 0x25fc, 0x25fd, 0x25fe, 0x25ff,
- 0x2600, 0x2601, 0x2602, 0x2603, 0x2604, 0x2605, 0x2606, 0x2607,
- 0x2608, 0x2609, 0x260a, 0x260b, 0x260c, 0x260d, 0x260e, 0x260f,
- 0x2610, 0x2611, 0x2612, 0x2613, 0x2614, 0x2615, 0x2616, 0x2617,
- 0x2618, 0x2619, 0x261a, 0x261b, 0x261c, 0x261d, 0x261e, 0x261f,
- 0x2620, 0x2621, 0x2622, 0x2623, 0x2624, 0x2625, 0x2626, 0x2627,
- 0x2628, 0x2629, 0x262a, 0x262b, 0x262c, 0x262d, 0x262e, 0x262f,
- 0x2630, 0x2631, 0x2632, 0x2633, 0x2634, 0x2635, 0x2636, 0x2637,
- 0x2638, 0x2639, 0x263a, 0x263b, 0x263c, 0x263d, 0x263e, 0x263f,
- 0x2640, 0x2641, 0x2642, 0x2643, 0x2644, 0x2645, 0x2646, 0x2647,
- 0x2648, 0x2649, 0x264a, 0x264b, 0x264c, 0x264d, 0x264e, 0x264f,
- 0x2650, 0x2651, 0x2652, 0x2653, 0x2654, 0x2655, 0x2656, 0x2657,
- 0x2658, 0x2659, 0x265a, 0x265b, 0x265c, 0x265d, 0x265e, 0x265f,
- 0x2660, 0x2661, 0x2662, 0x2663, 0x2664, 0x2665, 0x2666, 0x2667,
- 0x2668, 0x2669, 0x266a, 0x266b, 0x266c, 0x266d, 0x266e, 0x266f,
- 0x2670, 0x2671, 0x2672, 0x2673, 0x2674, 0x2675, 0x2676, 0x2677,
- 0x2678, 0x2679, 0x267a, 0x267b, 0x267c, 0x267d, 0x267e, 0x267f,
- 0x2680, 0x2681, 0x2682, 0x2683, 0x2684, 0x2685, 0x2686, 0x2687,
- 0x2688, 0x2689, 0x268a, 0x268b, 0x268c, 0x268d, 0x268e, 0x268f,
- 0x2690, 0x2691, 0x2692, 0x2693, 0x2694, 0x2695, 0x2696, 0x2697,
- 0x2698, 0x2699, 0x269a, 0x269b, 0x269c, 0x0000, 0x0000, 0x0000,
- 0x26a0, 0x26a1, 0x26a2, 0x26a3, 0x26a4, 0x26a5, 0x26a6, 0x26a7,
- 0x26a8, 0x26a9, 0x26aa, 0x26ab, 0x26ac, 0x26ad, 0x26ae, 0x26af,
- 0x26b0, 0x26b1, 0x26b2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2701, 0x2702, 0x2703, 0x2704, 0x0000, 0x2706, 0x2707,
- 0x2708, 0x2709, 0x0000, 0x0000, 0x270c, 0x270d, 0x270e, 0x270f,
- 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717,
- 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f,
- 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727,
- 0x0000, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f,
- 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737,
- 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f,
- 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747,
- 0x2748, 0x2749, 0x274a, 0x274b, 0x0000, 0x274d, 0x0000, 0x274f,
- 0x2750, 0x2751, 0x2752, 0x0000, 0x0000, 0x0000, 0x2756, 0x0000,
- 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x0000,
- 0x0000, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767,
- 0x2768, 0x2769, 0x276a, 0x276b, 0x276c, 0x276d, 0x276e, 0x276f,
- 0x2770, 0x2771, 0x2772, 0x2773, 0x2774, 0x2775, 0x2776, 0x2777,
- 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0x277f,
- 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787,
- 0x2788, 0x2789, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f,
- 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x0000, 0x0000, 0x0000,
- 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f,
- 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7,
- 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af,
- 0x0000, 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7,
- 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, 0x0000,
- 0x27c0, 0x27c1, 0x27c2, 0x27c3, 0x27c4, 0x27c5, 0x27c6, 0x27c7,
- 0x27c8, 0x27c9, 0x27ca, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x27d0, 0x27d1, 0x27d2, 0x27d3, 0x27d4, 0x27d5, 0x27d6, 0x27d7,
- 0x27d8, 0x27d9, 0x27da, 0x27db, 0x27dc, 0x27dd, 0x27de, 0x27df,
- 0x27e0, 0x27e1, 0x27e2, 0x27e3, 0x27e4, 0x27e5, 0x27e6, 0x27e7,
- 0x27e8, 0x27e9, 0x27ea, 0x27eb, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x27f0, 0x27f1, 0x27f2, 0x27f3, 0x27f4, 0x27f5, 0x27f6, 0x27f7,
- 0x27f8, 0x27f9, 0x27fa, 0x27fb, 0x27fc, 0x27fd, 0x27fe, 0x27ff,
- 0x2800, 0x2801, 0x2802, 0x2803, 0x2804, 0x2805, 0x2806, 0x2807,
- 0x2808, 0x2809, 0x280a, 0x280b, 0x280c, 0x280d, 0x280e, 0x280f,
- 0x2810, 0x2811, 0x2812, 0x2813, 0x2814, 0x2815, 0x2816, 0x2817,
- 0x2818, 0x2819, 0x281a, 0x281b, 0x281c, 0x281d, 0x281e, 0x281f,
- 0x2820, 0x2821, 0x2822, 0x2823, 0x2824, 0x2825, 0x2826, 0x2827,
- 0x2828, 0x2829, 0x282a, 0x282b, 0x282c, 0x282d, 0x282e, 0x282f,
- 0x2830, 0x2831, 0x2832, 0x2833, 0x2834, 0x2835, 0x2836, 0x2837,
- 0x2838, 0x2839, 0x283a, 0x283b, 0x283c, 0x283d, 0x283e, 0x283f,
- 0x2840, 0x2841, 0x2842, 0x2843, 0x2844, 0x2845, 0x2846, 0x2847,
- 0x2848, 0x2849, 0x284a, 0x284b, 0x284c, 0x284d, 0x284e, 0x284f,
- 0x2850, 0x2851, 0x2852, 0x2853, 0x2854, 0x2855, 0x2856, 0x2857,
- 0x2858, 0x2859, 0x285a, 0x285b, 0x285c, 0x285d, 0x285e, 0x285f,
- 0x2860, 0x2861, 0x2862, 0x2863, 0x2864, 0x2865, 0x2866, 0x2867,
- 0x2868, 0x2869, 0x286a, 0x286b, 0x286c, 0x286d, 0x286e, 0x286f,
- 0x2870, 0x2871, 0x2872, 0x2873, 0x2874, 0x2875, 0x2876, 0x2877,
- 0x2878, 0x2879, 0x287a, 0x287b, 0x287c, 0x287d, 0x287e, 0x287f,
- 0x2880, 0x2881, 0x2882, 0x2883, 0x2884, 0x2885, 0x2886, 0x2887,
- 0x2888, 0x2889, 0x288a, 0x288b, 0x288c, 0x288d, 0x288e, 0x288f,
- 0x2890, 0x2891, 0x2892, 0x2893, 0x2894, 0x2895, 0x2896, 0x2897,
- 0x2898, 0x2899, 0x289a, 0x289b, 0x289c, 0x289d, 0x289e, 0x289f,
- 0x28a0, 0x28a1, 0x28a2, 0x28a3, 0x28a4, 0x28a5, 0x28a6, 0x28a7,
- 0x28a8, 0x28a9, 0x28aa, 0x28ab, 0x28ac, 0x28ad, 0x28ae, 0x28af,
- 0x28b0, 0x28b1, 0x28b2, 0x28b3, 0x28b4, 0x28b5, 0x28b6, 0x28b7,
- 0x28b8, 0x28b9, 0x28ba, 0x28bb, 0x28bc, 0x28bd, 0x28be, 0x28bf,
- 0x28c0, 0x28c1, 0x28c2, 0x28c3, 0x28c4, 0x28c5, 0x28c6, 0x28c7,
- 0x28c8, 0x28c9, 0x28ca, 0x28cb, 0x28cc, 0x28cd, 0x28ce, 0x28cf,
- 0x28d0, 0x28d1, 0x28d2, 0x28d3, 0x28d4, 0x28d5, 0x28d6, 0x28d7,
- 0x28d8, 0x28d9, 0x28da, 0x28db, 0x28dc, 0x28dd, 0x28de, 0x28df,
- 0x28e0, 0x28e1, 0x28e2, 0x28e3, 0x28e4, 0x28e5, 0x28e6, 0x28e7,
- 0x28e8, 0x28e9, 0x28ea, 0x28eb, 0x28ec, 0x28ed, 0x28ee, 0x28ef,
- 0x28f0, 0x28f1, 0x28f2, 0x28f3, 0x28f4, 0x28f5, 0x28f6, 0x28f7,
- 0x28f8, 0x28f9, 0x28fa, 0x28fb, 0x28fc, 0x28fd, 0x28fe, 0x28ff,
- 0x2900, 0x2901, 0x2902, 0x2903, 0x2904, 0x2905, 0x2906, 0x2907,
- 0x2908, 0x2909, 0x290a, 0x290b, 0x290c, 0x290d, 0x290e, 0x290f,
- 0x2910, 0x2911, 0x2912, 0x2913, 0x2914, 0x2915, 0x2916, 0x2917,
- 0x2918, 0x2919, 0x291a, 0x291b, 0x291c, 0x291d, 0x291e, 0x291f,
- 0x2920, 0x2921, 0x2922, 0x2923, 0x2924, 0x2925, 0x2926, 0x2927,
- 0x2928, 0x2929, 0x292a, 0x292b, 0x292c, 0x292d, 0x292e, 0x292f,
- 0x2930, 0x2931, 0x2932, 0x2933, 0x2934, 0x2935, 0x2936, 0x2937,
- 0x2938, 0x2939, 0x293a, 0x293b, 0x293c, 0x293d, 0x293e, 0x293f,
- 0x2940, 0x2941, 0x2942, 0x2943, 0x2944, 0x2945, 0x2946, 0x2947,
- 0x2948, 0x2949, 0x294a, 0x294b, 0x294c, 0x294d, 0x294e, 0x294f,
- 0x2950, 0x2951, 0x2952, 0x2953, 0x2954, 0x2955, 0x2956, 0x2957,
- 0x2958, 0x2959, 0x295a, 0x295b, 0x295c, 0x295d, 0x295e, 0x295f,
- 0x2960, 0x2961, 0x2962, 0x2963, 0x2964, 0x2965, 0x2966, 0x2967,
- 0x2968, 0x2969, 0x296a, 0x296b, 0x296c, 0x296d, 0x296e, 0x296f,
- 0x2970, 0x2971, 0x2972, 0x2973, 0x2974, 0x2975, 0x2976, 0x2977,
- 0x2978, 0x2979, 0x297a, 0x297b, 0x297c, 0x297d, 0x297e, 0x297f,
- 0x2980, 0x2981, 0x2982, 0x2983, 0x2984, 0x2985, 0x2986, 0x2987,
- 0x2988, 0x2989, 0x298a, 0x298b, 0x298c, 0x298d, 0x298e, 0x298f,
- 0x2990, 0x2991, 0x2992, 0x2993, 0x2994, 0x2995, 0x2996, 0x2997,
- 0x2998, 0x2999, 0x299a, 0x299b, 0x299c, 0x299d, 0x299e, 0x299f,
- 0x29a0, 0x29a1, 0x29a2, 0x29a3, 0x29a4, 0x29a5, 0x29a6, 0x29a7,
- 0x29a8, 0x29a9, 0x29aa, 0x29ab, 0x29ac, 0x29ad, 0x29ae, 0x29af,
- 0x29b0, 0x29b1, 0x29b2, 0x29b3, 0x29b4, 0x29b5, 0x29b6, 0x29b7,
- 0x29b8, 0x29b9, 0x29ba, 0x29bb, 0x29bc, 0x29bd, 0x29be, 0x29bf,
- 0x29c0, 0x29c1, 0x29c2, 0x29c3, 0x29c4, 0x29c5, 0x29c6, 0x29c7,
- 0x29c8, 0x29c9, 0x29ca, 0x29cb, 0x29cc, 0x29cd, 0x29ce, 0x29cf,
- 0x29d0, 0x29d1, 0x29d2, 0x29d3, 0x29d4, 0x29d5, 0x29d6, 0x29d7,
- 0x29d8, 0x29d9, 0x29da, 0x29db, 0x29dc, 0x29dd, 0x29de, 0x29df,
- 0x29e0, 0x29e1, 0x29e2, 0x29e3, 0x29e4, 0x29e5, 0x29e6, 0x29e7,
- 0x29e8, 0x29e9, 0x29ea, 0x29eb, 0x29ec, 0x29ed, 0x29ee, 0x29ef,
- 0x29f0, 0x29f1, 0x29f2, 0x29f3, 0x29f4, 0x29f5, 0x29f6, 0x29f7,
- 0x29f8, 0x29f9, 0x29fa, 0x29fb, 0x29fc, 0x29fd, 0x29fe, 0x29ff,
- 0x2a00, 0x2a01, 0x2a02, 0x2a03, 0x2a04, 0x2a05, 0x2a06, 0x2a07,
- 0x2a08, 0x2a09, 0x2a0a, 0x2a0b, 0x2a0c, 0x2a0d, 0x2a0e, 0x2a0f,
- 0x2a10, 0x2a11, 0x2a12, 0x2a13, 0x2a14, 0x2a15, 0x2a16, 0x2a17,
- 0x2a18, 0x2a19, 0x2a1a, 0x2a1b, 0x2a1c, 0x2a1d, 0x2a1e, 0x2a1f,
- 0x2a20, 0x2a21, 0x2a22, 0x2a23, 0x2a24, 0x2a25, 0x2a26, 0x2a27,
- 0x2a28, 0x2a29, 0x2a2a, 0x2a2b, 0x2a2c, 0x2a2d, 0x2a2e, 0x2a2f,
- 0x2a30, 0x2a31, 0x2a32, 0x2a33, 0x2a34, 0x2a35, 0x2a36, 0x2a37,
- 0x2a38, 0x2a39, 0x2a3a, 0x2a3b, 0x2a3c, 0x2a3d, 0x2a3e, 0x2a3f,
- 0x2a40, 0x2a41, 0x2a42, 0x2a43, 0x2a44, 0x2a45, 0x2a46, 0x2a47,
- 0x2a48, 0x2a49, 0x2a4a, 0x2a4b, 0x2a4c, 0x2a4d, 0x2a4e, 0x2a4f,
- 0x2a50, 0x2a51, 0x2a52, 0x2a53, 0x2a54, 0x2a55, 0x2a56, 0x2a57,
- 0x2a58, 0x2a59, 0x2a5a, 0x2a5b, 0x2a5c, 0x2a5d, 0x2a5e, 0x2a5f,
- 0x2a60, 0x2a61, 0x2a62, 0x2a63, 0x2a64, 0x2a65, 0x2a66, 0x2a67,
- 0x2a68, 0x2a69, 0x2a6a, 0x2a6b, 0x2a6c, 0x2a6d, 0x2a6e, 0x2a6f,
- 0x2a70, 0x2a71, 0x2a72, 0x2a73, 0x2a74, 0x2a75, 0x2a76, 0x2a77,
- 0x2a78, 0x2a79, 0x2a7a, 0x2a7b, 0x2a7c, 0x2a7d, 0x2a7e, 0x2a7f,
- 0x2a80, 0x2a81, 0x2a82, 0x2a83, 0x2a84, 0x2a85, 0x2a86, 0x2a87,
- 0x2a88, 0x2a89, 0x2a8a, 0x2a8b, 0x2a8c, 0x2a8d, 0x2a8e, 0x2a8f,
- 0x2a90, 0x2a91, 0x2a92, 0x2a93, 0x2a94, 0x2a95, 0x2a96, 0x2a97,
- 0x2a98, 0x2a99, 0x2a9a, 0x2a9b, 0x2a9c, 0x2a9d, 0x2a9e, 0x2a9f,
- 0x2aa0, 0x2aa1, 0x2aa2, 0x2aa3, 0x2aa4, 0x2aa5, 0x2aa6, 0x2aa7,
- 0x2aa8, 0x2aa9, 0x2aaa, 0x2aab, 0x2aac, 0x2aad, 0x2aae, 0x2aaf,
- 0x2ab0, 0x2ab1, 0x2ab2, 0x2ab3, 0x2ab4, 0x2ab5, 0x2ab6, 0x2ab7,
- 0x2ab8, 0x2ab9, 0x2aba, 0x2abb, 0x2abc, 0x2abd, 0x2abe, 0x2abf,
- 0x2ac0, 0x2ac1, 0x2ac2, 0x2ac3, 0x2ac4, 0x2ac5, 0x2ac6, 0x2ac7,
- 0x2ac8, 0x2ac9, 0x2aca, 0x2acb, 0x2acc, 0x2acd, 0x2ace, 0x2acf,
- 0x2ad0, 0x2ad1, 0x2ad2, 0x2ad3, 0x2ad4, 0x2ad5, 0x2ad6, 0x2ad7,
- 0x2ad8, 0x2ad9, 0x2ada, 0x2adb, 0x2adc, 0x2add, 0x2ade, 0x2adf,
- 0x2ae0, 0x2ae1, 0x2ae2, 0x2ae3, 0x2ae4, 0x2ae5, 0x2ae6, 0x2ae7,
- 0x2ae8, 0x2ae9, 0x2aea, 0x2aeb, 0x2aec, 0x2aed, 0x2aee, 0x2aef,
- 0x2af0, 0x2af1, 0x2af2, 0x2af3, 0x2af4, 0x2af5, 0x2af6, 0x2af7,
- 0x2af8, 0x2af9, 0x2afa, 0x2afb, 0x2afc, 0x2afd, 0x2afe, 0x2aff,
- 0x2b00, 0x2b01, 0x2b02, 0x2b03, 0x2b04, 0x2b05, 0x2b06, 0x2b07,
- 0x2b08, 0x2b09, 0x2b0a, 0x2b0b, 0x2b0c, 0x2b0d, 0x2b0e, 0x2b0f,
- 0x2b10, 0x2b11, 0x2b12, 0x2b13, 0x2b14, 0x2b15, 0x2b16, 0x2b17,
- 0x2b18, 0x2b19, 0x2b1a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2b20, 0x2b21, 0x2b22, 0x2b23, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2c30, 0x2c31, 0x2c32, 0x2c33, 0x2c34, 0x2c35, 0x2c36, 0x2c37,
- 0x2c38, 0x2c39, 0x2c3a, 0x2c3b, 0x2c3c, 0x2c3d, 0x2c3e, 0x2c3f,
- 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47,
- 0x2c48, 0x2c49, 0x2c4a, 0x2c4b, 0x2c4c, 0x2c4d, 0x2c4e, 0x2c4f,
- 0x2c50, 0x2c51, 0x2c52, 0x2c53, 0x2c54, 0x2c55, 0x2c56, 0x2c57,
- 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x0000,
- 0x2c30, 0x2c31, 0x2c32, 0x2c33, 0x2c34, 0x2c35, 0x2c36, 0x2c37,
- 0x2c38, 0x2c39, 0x2c3a, 0x2c3b, 0x2c3c, 0x2c3d, 0x2c3e, 0x2c3f,
- 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47,
- 0x2c48, 0x2c49, 0x2c4a, 0x2c4b, 0x2c4c, 0x2c4d, 0x2c4e, 0x2c4f,
- 0x2c50, 0x2c51, 0x2c52, 0x2c53, 0x2c54, 0x2c55, 0x2c56, 0x2c57,
- 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x0000,
- 0x2c61, 0x2c61, 0x026b, 0x1d7d, 0x027d, 0x2c65, 0x2c66, 0x2c68,
- 0x2c68, 0x2c6a, 0x2c6a, 0x2c6c, 0x2c6c, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x2c74, 0x2c76, 0x2c76, 0x2c77,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2c81, 0x2c81, 0x2c83, 0x2c83, 0x2c85, 0x2c85, 0x2c87, 0x2c87,
- 0x2c89, 0x2c89, 0x2c8b, 0x2c8b, 0x2c8d, 0x2c8d, 0x2c8f, 0x2c8f,
- 0x2c91, 0x2c91, 0x2c93, 0x2c93, 0x2c95, 0x2c95, 0x2c97, 0x2c97,
- 0x2c99, 0x2c99, 0x2c9b, 0x2c9b, 0x2c9d, 0x2c9d, 0x2c9f, 0x2c9f,
- 0x2ca1, 0x2ca1, 0x2ca3, 0x2ca3, 0x2ca5, 0x2ca5, 0x2ca7, 0x2ca7,
- 0x2ca9, 0x2ca9, 0x2cab, 0x2cab, 0x2cad, 0x2cad, 0x2caf, 0x2caf,
- 0x2cb1, 0x2cb1, 0x2cb3, 0x2cb3, 0x2cb5, 0x2cb5, 0x2cb7, 0x2cb7,
- 0x2cb9, 0x2cb9, 0x2cbb, 0x2cbb, 0x2cbd, 0x2cbd, 0x2cbf, 0x2cbf,
- 0x2cc1, 0x2cc1, 0x2cc3, 0x2cc3, 0x2cc5, 0x2cc5, 0x2cc7, 0x2cc7,
- 0x2cc9, 0x2cc9, 0x2ccb, 0x2ccb, 0x2ccd, 0x2ccd, 0x2ccf, 0x2ccf,
- 0x2cd1, 0x2cd1, 0x2cd3, 0x2cd3, 0x2cd5, 0x2cd5, 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9, 0x2cdb, 0x2cdb, 0x2cdd, 0x2cdd, 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1, 0x2ce3, 0x2ce3, 0x2ce4, 0x2ce5, 0x2ce6, 0x2ce7,
- 0x2ce8, 0x2ce9, 0x2cea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2cf9, 0x2cfa, 0x2cfb, 0x2cfc, 0x2cfd, 0x2cfe, 0x2cff,
- 0x2d00, 0x2d01, 0x2d02, 0x2d03, 0x2d04, 0x2d05, 0x2d06, 0x2d07,
- 0x2d08, 0x2d09, 0x2d0a, 0x2d0b, 0x2d0c, 0x2d0d, 0x2d0e, 0x2d0f,
- 0x2d10, 0x2d11, 0x2d12, 0x2d13, 0x2d14, 0x2d15, 0x2d16, 0x2d17,
- 0x2d18, 0x2d19, 0x2d1a, 0x2d1b, 0x2d1c, 0x2d1d, 0x2d1e, 0x2d1f,
- 0x2d20, 0x2d21, 0x2d22, 0x2d23, 0x2d24, 0x2d25, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2d30, 0x2d31, 0x2d32, 0x2d33, 0x2d34, 0x2d35, 0x2d36, 0x2d37,
- 0x2d38, 0x2d39, 0x2d3a, 0x2d3b, 0x2d3c, 0x2d3d, 0x2d3e, 0x2d3f,
- 0x2d40, 0x2d41, 0x2d42, 0x2d43, 0x2d44, 0x2d45, 0x2d46, 0x2d47,
- 0x2d48, 0x2d49, 0x2d4a, 0x2d4b, 0x2d4c, 0x2d4d, 0x2d4e, 0x2d4f,
- 0x2d50, 0x2d51, 0x2d52, 0x2d53, 0x2d54, 0x2d55, 0x2d56, 0x2d57,
- 0x2d58, 0x2d59, 0x2d5a, 0x2d5b, 0x2d5c, 0x2d5d, 0x2d5e, 0x2d5f,
- 0x2d60, 0x2d61, 0x2d62, 0x2d63, 0x2d64, 0x2d65, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2d6f,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2d80, 0x2d81, 0x2d82, 0x2d83, 0x2d84, 0x2d85, 0x2d86, 0x2d87,
- 0x2d88, 0x2d89, 0x2d8a, 0x2d8b, 0x2d8c, 0x2d8d, 0x2d8e, 0x2d8f,
- 0x2d90, 0x2d91, 0x2d92, 0x2d93, 0x2d94, 0x2d95, 0x2d96, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2da0, 0x2da1, 0x2da2, 0x2da3, 0x2da4, 0x2da5, 0x2da6, 0x0000,
- 0x2da8, 0x2da9, 0x2daa, 0x2dab, 0x2dac, 0x2dad, 0x2dae, 0x0000,
- 0x2db0, 0x2db1, 0x2db2, 0x2db3, 0x2db4, 0x2db5, 0x2db6, 0x0000,
- 0x2db8, 0x2db9, 0x2dba, 0x2dbb, 0x2dbc, 0x2dbd, 0x2dbe, 0x0000,
- 0x2dc0, 0x2dc1, 0x2dc2, 0x2dc3, 0x2dc4, 0x2dc5, 0x2dc6, 0x0000,
- 0x2dc8, 0x2dc9, 0x2dca, 0x2dcb, 0x2dcc, 0x2dcd, 0x2dce, 0x0000,
- 0x2dd0, 0x2dd1, 0x2dd2, 0x2dd3, 0x2dd4, 0x2dd5, 0x2dd6, 0x0000,
- 0x2dd8, 0x2dd9, 0x2dda, 0x2ddb, 0x2ddc, 0x2ddd, 0x2dde, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2e00, 0x2e01, 0x2e02, 0x2e03, 0x2e04, 0x2e05, 0x2e06, 0x2e07,
- 0x2e08, 0x2e09, 0x2e0a, 0x2e0b, 0x2e0c, 0x2e0d, 0x2e0e, 0x2e0f,
- 0x2e10, 0x2e11, 0x2e12, 0x2e13, 0x2e14, 0x2e15, 0x2e16, 0x2e17,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x2e1c, 0x2e1d, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2e80, 0x2e81, 0x2e82, 0x2e83, 0x2e84, 0x2e85, 0x2e86, 0x2e87,
- 0x2e88, 0x2e89, 0x2e8a, 0x2e8b, 0x2e8c, 0x2e8d, 0x2e8e, 0x2e8f,
- 0x2e90, 0x2e91, 0x2e92, 0x2e93, 0x2e94, 0x2e95, 0x2e96, 0x2e97,
- 0x2e98, 0x2e99, 0x0000, 0x2e9b, 0x2e9c, 0x2e9d, 0x2e9e, 0x2e9f,
- 0x2ea0, 0x2ea1, 0x2ea2, 0x2ea3, 0x2ea4, 0x2ea5, 0x2ea6, 0x2ea7,
- 0x2ea8, 0x2ea9, 0x2eaa, 0x2eab, 0x2eac, 0x2ead, 0x2eae, 0x2eaf,
- 0x2eb0, 0x2eb1, 0x2eb2, 0x2eb3, 0x2eb4, 0x2eb5, 0x2eb6, 0x2eb7,
- 0x2eb8, 0x2eb9, 0x2eba, 0x2ebb, 0x2ebc, 0x2ebd, 0x2ebe, 0x2ebf,
- 0x2ec0, 0x2ec1, 0x2ec2, 0x2ec3, 0x2ec4, 0x2ec5, 0x2ec6, 0x2ec7,
- 0x2ec8, 0x2ec9, 0x2eca, 0x2ecb, 0x2ecc, 0x2ecd, 0x2ece, 0x2ecf,
- 0x2ed0, 0x2ed1, 0x2ed2, 0x2ed3, 0x2ed4, 0x2ed5, 0x2ed6, 0x2ed7,
- 0x2ed8, 0x2ed9, 0x2eda, 0x2edb, 0x2edc, 0x2edd, 0x2ede, 0x2edf,
- 0x2ee0, 0x2ee1, 0x2ee2, 0x2ee3, 0x2ee4, 0x2ee5, 0x2ee6, 0x2ee7,
- 0x2ee8, 0x2ee9, 0x2eea, 0x2eeb, 0x2eec, 0x2eed, 0x2eee, 0x2eef,
- 0x2ef0, 0x2ef1, 0x2ef2, 0x2ef3, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2f00, 0x2f01, 0x2f02, 0x2f03, 0x2f04, 0x2f05, 0x2f06, 0x2f07,
- 0x2f08, 0x2f09, 0x2f0a, 0x2f0b, 0x2f0c, 0x2f0d, 0x2f0e, 0x2f0f,
- 0x2f10, 0x2f11, 0x2f12, 0x2f13, 0x2f14, 0x2f15, 0x2f16, 0x2f17,
- 0x2f18, 0x2f19, 0x2f1a, 0x2f1b, 0x2f1c, 0x2f1d, 0x2f1e, 0x2f1f,
- 0x2f20, 0x2f21, 0x2f22, 0x2f23, 0x2f24, 0x2f25, 0x2f26, 0x2f27,
- 0x2f28, 0x2f29, 0x2f2a, 0x2f2b, 0x2f2c, 0x2f2d, 0x2f2e, 0x2f2f,
- 0x2f30, 0x2f31, 0x2f32, 0x2f33, 0x2f34, 0x2f35, 0x2f36, 0x2f37,
- 0x2f38, 0x2f39, 0x2f3a, 0x2f3b, 0x2f3c, 0x2f3d, 0x2f3e, 0x2f3f,
- 0x2f40, 0x2f41, 0x2f42, 0x2f43, 0x2f44, 0x2f45, 0x2f46, 0x2f47,
- 0x2f48, 0x2f49, 0x2f4a, 0x2f4b, 0x2f4c, 0x2f4d, 0x2f4e, 0x2f4f,
- 0x2f50, 0x2f51, 0x2f52, 0x2f53, 0x2f54, 0x2f55, 0x2f56, 0x2f57,
- 0x2f58, 0x2f59, 0x2f5a, 0x2f5b, 0x2f5c, 0x2f5d, 0x2f5e, 0x2f5f,
- 0x2f60, 0x2f61, 0x2f62, 0x2f63, 0x2f64, 0x2f65, 0x2f66, 0x2f67,
- 0x2f68, 0x2f69, 0x2f6a, 0x2f6b, 0x2f6c, 0x2f6d, 0x2f6e, 0x2f6f,
- 0x2f70, 0x2f71, 0x2f72, 0x2f73, 0x2f74, 0x2f75, 0x2f76, 0x2f77,
- 0x2f78, 0x2f79, 0x2f7a, 0x2f7b, 0x2f7c, 0x2f7d, 0x2f7e, 0x2f7f,
- 0x2f80, 0x2f81, 0x2f82, 0x2f83, 0x2f84, 0x2f85, 0x2f86, 0x2f87,
- 0x2f88, 0x2f89, 0x2f8a, 0x2f8b, 0x2f8c, 0x2f8d, 0x2f8e, 0x2f8f,
- 0x2f90, 0x2f91, 0x2f92, 0x2f93, 0x2f94, 0x2f95, 0x2f96, 0x2f97,
- 0x2f98, 0x2f99, 0x2f9a, 0x2f9b, 0x2f9c, 0x2f9d, 0x2f9e, 0x2f9f,
- 0x2fa0, 0x2fa1, 0x2fa2, 0x2fa3, 0x2fa4, 0x2fa5, 0x2fa6, 0x2fa7,
- 0x2fa8, 0x2fa9, 0x2faa, 0x2fab, 0x2fac, 0x2fad, 0x2fae, 0x2faf,
- 0x2fb0, 0x2fb1, 0x2fb2, 0x2fb3, 0x2fb4, 0x2fb5, 0x2fb6, 0x2fb7,
- 0x2fb8, 0x2fb9, 0x2fba, 0x2fbb, 0x2fbc, 0x2fbd, 0x2fbe, 0x2fbf,
- 0x2fc0, 0x2fc1, 0x2fc2, 0x2fc3, 0x2fc4, 0x2fc5, 0x2fc6, 0x2fc7,
- 0x2fc8, 0x2fc9, 0x2fca, 0x2fcb, 0x2fcc, 0x2fcd, 0x2fce, 0x2fcf,
- 0x2fd0, 0x2fd1, 0x2fd2, 0x2fd3, 0x2fd4, 0x2fd5, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-};
-
-
-int unic_tolower (int c) {
- if (c<0x3000) {
- return ____tolower[(c)+1];
- } else {
- if (c>=0xff21&&c<=0xff3a) {
- return c+ 32;
- } else if ((c>=0x3000 && c<=0x303f) || (c>=0x3041 && c<=0x3096) ||
- (c>=0x3099 && c<=0x30ff) || (c>=0x3105 && c<=0x312c) ||
- (c>=0x3131 && c<=0x318e) || (c>=0x3190 && c<=0x31b7) ||
- (c>=0x31c0 && c<=0x31cf) || (c>=0x31f0 && c<=0x321e) ||
- (c>=0x3220 && c<=0x3243) || (c>=0x3250 && c<=0x32fe) ||
- (c>=0x3300 && c<=0x4db5) || (c>=0x4dc0 && c<=0x9fbb) ||
- (c>=0xa000 && c<=0xa48c) || (c>=0xa490 && c<=0xa4c6) ||
- (c>=0xa700 && c<=0xa71a) || (c>=0xa720 && c<=0xa721) ||
- (c>=0xa800 && c<=0xa82b) || (c>=0xa840 && c<=0xa877) ||
- (c>=0xac00 && c<=0xd7a3) || (c>=0xd800 && c<=0xfa2d) ||
- (c>=0xfa30 && c<=0xfa6a) || (c>=0xfa70 && c<=0xfad9) ||
- (c>=0xfb00 && c<=0xfb06) || (c>=0xfb13 && c<=0xfb17) ||
- (c>=0xfb1d && c<=0xfb36) || (c>=0xfb38 && c<=0xfb3c) ||
- c==0xfb3e ||
- (c>=0xfb40 && c<=0xfb41) || (c>=0xfb43 && c<=0xfb44) ||
- (c>=0xfb46 && c<=0xfbb1) || (c>=0xfbd3 && c<=0xfd3f) ||
- (c>=0xfd50 && c<=0xfd8f) || (c>=0xfd92 && c<=0xfdc7) ||
- (c>=0xfdf0 && c<=0xfdfd) || (c>=0xfe00 && c<=0xfe19) ||
- (c>=0xfe20 && c<=0xfe23) || (c>=0xfe30 && c<=0xfe52) ||
- (c>=0xfe54 && c<=0xfe66) || (c>=0xfe68 && c<=0xfe6b) ||
- (c>=0xfe70 && c<=0xfe74) || (c>=0xfe76 && c<=0xfefc) ||
- c==0xfeff ||
- (c>=0xff01 && c<=0xff20) || (c>=0xff3b && c<=0xffbe) ||
- (c>=0xffc2 && c<=0xffc7) || (c>=0xffca && c<=0xffcf) ||
- (c>=0xffd2 && c<=0xffd7) || (c>=0xffda && c<=0xffdc) ||
- (c>=0xffe0 && c<=0xffe6) || (c>=0xffe8 && c<=0xffee) ||
- (c>=0xfff9 && c<=0xfffd)){
- return c;
- } else {
- return 0;
- }
- }
-}
-
-/* some error and process reporting stuff */
-
-char **gww_errors = NULL;
-int gww_error_count = 0;
-
-void _gwwv_post_error(const char *fmt, va_list args) {
- char *buf;
- buf = malloc(1024);
- if (buf==NULL) {
- perror("memory allocation failed");
- exit(EXIT_FAILURE);
- }
- vsnprintf(buf,1024,fmt,args);
- gww_errors = realloc(gww_errors, (gww_error_count+2)*sizeof(char *));
- if (gww_errors==NULL) {
- perror("memory allocation failed");
- exit(EXIT_FAILURE);
- }
- gww_errors[gww_error_count ] = buf ;
- gww_error_count ++;
- gww_errors[gww_error_count ] = NULL;
-
-}
-
-void gwwv_post_error(const char *fmt, ...) {
- va_list args;
- va_start (args, fmt);
- _gwwv_post_error(fmt,args);
- va_end (args);
-}
-
-
-void gwwv_errors_free (void) {
- int i;
- if (gww_error_count>0) {
- for (i=0;i<gww_error_count;i++) {
- free(gww_errors[i]);
- }
- free(gww_errors);
- gww_error_count = 0;
- gww_errors = NULL;
- }
-}
-
-void gwwv_post_notice (char *fmt, ...) { }
-void gwwv_ask (char *a) { }
-void gwwv_progress_change_line1 (char *a) { }
-void gwwv_progress_change_line2 (char *b) { }
-void gwwv_progress_next (void){ }
-void gwwv_progress_start_indicator (void) { }
-void gwwv_progress_end_indicator (void) { }
-void gwwv_progress_enable_stop (void) { }
-void gwwv_progress_resume_timer (void) { }
-void gwwv_progress_pause_timer (void) { }
-void gwwv_progress_next_stage (void) { }
-void gwwv_progress_change_stages (void) { }
-void gwwv_progress_change_total (void) { }
-void gwwv_progress_increment (void) { }
-
-void GWidgetError8(char *a, char *b) { }
-
-void GProgressChangeLine1_8 (char *a) { }
-void GProgressChangeLine2_8 (char *b) { }
-void GProgressChangeTotal (void) { }
-void GProgressNext (void){ }
-void GProgressStartIndicator (void) { }
-void GProgressEndIndicator (void) { }
-void GProgressEnableStop (void) { }
-void GProgressResumeTimer (void) { }
-void GProgressPauseTimer (void) { }
-void GProgressNextStage (void) { }
-void GProgressChangeStages (void) { }
-void GProgressIncrement (void) { }
-
-/* from plugins.c */
-
-void LoadPluginDir(void *a) { }
-
-/* from scripting.c */
-
-int no_windowing_ui = 1;
-int running_script = 1;
-int use_utf8_in_script = 1;
-
-void ScriptError( void *c, const char *msg ) { }
-
-void ScriptErrorString( void *c, const char *msg, const char *name) { }
-
-void ScriptErrorF( void *c, const char *format, ... ) { }
-
-void CheckIsScript(int argc, char *argv[]) { }
-
-void ExecuteScriptFile(FontView *fv, char *filename) { }
-
-void ScriptDlg(FontView *fv) { }
-
-struct dictentry {
- char *name;
- Val val;
-};
-
-struct dictionary {
- struct dictentry *entries;
- int cnt, max;
-};
-
-
-typedef struct array {
- int argc;
- Val *vals;
-} Array;
-
-static void arrayfree(Array *a) {
- int i;
-
- for ( i=0; i<a->argc; ++i ) {
- if ( a->vals[i].type==v_str )
- free(a->vals[i].u.sval);
- else if ( a->vals[i].type==v_arr )
- arrayfree(a->vals[i].u.aval);
- }
- free(a->vals);
- free(a);
-}
-
-
-void DictionaryFree(struct dictionary *dica) {
- int i;
-
- if ( dica==NULL )
-return;
-
- for ( i=0; i<dica->cnt; ++i ) {
- free(dica->entries[i].name );
- if ( dica->entries[i].val.type == v_str )
- free( dica->entries[i].val.u.sval );
- if ( dica->entries[i].val.type == v_arr )
- arrayfree( dica->entries[i].val.u.aval );
- }
- free( dica->entries );
-}
-
-
-char **GetFontNames(char *filename) {
- FILE *foo;
- char **ret = NULL;
-
- if ( GFileIsDir(filename)) {
-#if 0
- char *temp = galloc(strlen(filename)+strlen("/glyphs/contents.plist")+1);
- strcpy(temp,filename);
- strcat(temp,"/glyphs/contents.plist");
- if ( GFileExists(temp))
- ret = NamesReadUFO(filename);
- else
- {
- strcpy(temp,filename);
- strcat(temp,"/font.props");
- if ( GFileExists(temp))
- ret = NamesReadSFD(temp);
- /* The fonts.prop file will look just like an sfd file as far */
- /* as fontnames are concerned, we don't need a separate routine*/
- }
- free(temp);
-#endif
- } else {
- foo = fopen(filename,"rb");
- if ( foo!=NULL ) {
- /* Try to guess the file type from the first few characters... */
- int ch1 = getc(foo);
- int ch2 = getc(foo);
- int ch3 = getc(foo);
- int ch4 = getc(foo);
- int ch5, ch6;
- fseek(foo, 98, SEEK_SET);
- ch5 = getc(foo);
- ch6 = getc(foo);
- fclose(foo);
- if (( ch1==0 && ch2==1 && ch3==0 && ch4==0 ) ||
- (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O') ||
- (ch1=='t' && ch2=='r' && ch3=='u' && ch4=='e') ||
- (ch1=='t' && ch2=='t' && ch3=='c' && ch4=='f') ) {
- ret = NamesReadTTF(filename);
- } else if (( ch1=='%' && ch2=='!' ) ||
- ( ch1==0x80 && ch2=='\01' ) ) { /* PFB header */
- ret = NamesReadPostscript(filename);
-#if 0
- } else if ( ch1=='<' && ch2=='?' && (ch3=='x'||ch3=='X') && (ch4=='m'||ch4=='M') ) {
- ret = NamesReadSVG(filename);
- } else if ( ch1=='S' && ch2=='p' && ch3=='l' && ch4=='i' ) {
- ret = NamesReadSFD(filename);
-#endif
- } else if ( ch1==1 && ch2==0 && ch3==4 ) {
- ret = NamesReadCFF(filename);
- } else /* Too hard to figure out a valid mark for a mac resource file */
- ret = NamesReadMacBinary(filename);
- }
- }
-return( ret );
-}
-
-
-/* from svg.c */
-
-SplineChar *SCHasSubs(SplineChar *sc, uint32 tag) {
- PST *pst;
-
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type==pst_substitution &&
- FeatureTagInFeatureScriptList(tag,pst->subtable->lookup->features) )
-return( SFGetChar(sc->parent,-1,pst->u.subs.variant));
- }
-return( NULL );
-}
-
-int _ExportSVG(FILE *svg,SplineChar *sc) {
- return 0;
-}
-
-int WriteSVGFont(char *fontname,SplineFont *sf,enum fontformat format,int flags,
- EncMap *map) {
- return 1;
-}
-
-int HasSVG(void) { return 0; }
-
-
-SplineFont *SFReadSVG(char *filename, int flags) {
-return( NULL );
-}
-
-SplineSet *SplinePointListInterpretSVG(char *filename,char *memory, int memlen,
- int em_size,int ascent,int is_stroked) {
-return( NULL );
-}
-
-/* from ufo.c */
-
-int HasUFO(void) {
-return( false );
-}
-
-SplineFont *SFReadUFO(char *filename, int flags) {
-return( NULL );
-}
-
-SplineSet *SplinePointListInterpretGlif(char *filename,char *memory, int memlen,
- int em_size,int ascent,int is_stroked) {
-return( NULL );
-}
-
-int WriteUFOFont(char *basedir,SplineFont *sf,enum fontformat ff,int flags,
- EncMap *map) {
- return 1;
-}
-
-int _ExportGlif(FILE *glif,SplineChar *sc) {
-return 0;
-}
-
-/* from autosave.c, but much shortened */
-
-char *getPfaEditDir(char *buffer) {
- return( NULL );
-}
-
-void DoAutoSaves (void ) {}
-
-/* from dumppfa.c, but much shortened */
-
-const char *GetAuthor(void) {
- static char author[200] = { '\0' };
- const char *ret = NULL, *pt;
-
- if ((pt=getenv("USER"))!=NULL ) {
- strncpy(author,pt,sizeof(author));
- author[sizeof(author)-1] = '\0';
- ret = author;
- }
- return ret;
-}
-
-double BlueScaleFigure(struct psdict *private,real bluevalues[], real otherblues[]) {
- double max_diff=0, p1, p2;
- char *pt, *end;
- int i;
-
- if ( PSDictHasEntry(private,"BlueScale")!=NULL )
-return( -1 );
-
- pt = PSDictHasEntry(private,"BlueValues");
- if ( pt!=NULL ) {
- while ( *pt==' ' || *pt=='[' ) ++pt;
- forever {
- p1 = strtod(pt,&end);
- if ( end==pt )
- break;
- pt = end;
- p2 = strtod(pt,&end);
- if ( end==pt )
- break;
- if ( p2-p1 >max_diff ) max_diff = p2-p1;
- pt = end;
- }
- } else {
- for ( i=0; i<14 && (bluevalues[i]!=0 || bluevalues[i+1])!=0; i+=2 ) {
- if ( bluevalues[i+1] - bluevalues[i]>=max_diff )
- max_diff = bluevalues[i+1] - bluevalues[i];
- }
- }
-
- pt = PSDictHasEntry(private,"OtherBlues");
- if ( pt!=NULL ) {
- while ( *pt==' ' || *pt=='[' ) ++pt;
- forever {
- p1 = strtod(pt,&end);
- if ( end==pt )
- break;
- pt = end;
- p2 = strtod(pt,&end);
- if ( end==pt )
- break;
- if ( p2-p1 >max_diff ) max_diff = p2-p1;
- pt = end;
- }
- } else {
- for ( i=0; i<10 && (otherblues[i]!=0 || otherblues[i+1]!=0); i+=2 ) {
- if ( otherblues[i+1] - otherblues[i]>=max_diff )
- max_diff = otherblues[i+1] - otherblues[i];
- }
- }
- if ( max_diff<=0 )
-return( -1 );
- if ( 1/max_diff > .039625 )
-return( -1 );
-
-return( .99/max_diff );
-}
-
-/* from dumpbdf.c */
-
-int IsntBDFChar(BDFChar *bdfc) {
- if ( bdfc==NULL )
-return( true );
-
-return( !SCWorthOutputting(bdfc->sc));
-}
-
-/* form bitmapdlg.c (stubbed) */
-
-void SFOrderBitmapList(SplineFont *sf) {
-}
-
-/* from metafont.c, whole */
-
-void SCCopyFgToBg(SplineChar *sc, int show) {
- SplinePointList *fore, *end;
-
- SCPreserveBackground(sc);
- fore = SplinePointListCopy(sc->layers[ly_fore].splines);
- if ( fore!=NULL ) {
- SplinePointListsFree(sc->layers[ly_back].splines);
- sc->layers[ly_back].splines = NULL;
- for ( end = fore; end->next!=NULL; end = end->next );
- end->next = sc->layers[ly_back].splines;
- sc->layers[ly_back].splines = fore;
- if ( show )
- SCCharChangedUpdate(sc);
- }
-}
-
-
-/* from tottf.c, whole */
-#if 0
-
-void putshort(FILE *file,int sval) {
- putc((sval>>8)&0xff,file);
- putc(sval&0xff,file);
-}
-
-void putlong(FILE *file,int val) {
- putc((val>>24)&0xff,file);
- putc((val>>16)&0xff,file);
- putc((val>>8)&0xff,file);
- putc(val&0xff,file);
-}
-
-char *utf8_verify_copy(const char *str) {
- /* When given a postscript string it SHOULD be in ASCII. But it will often*/
- /* contain a copyright symbol (sometimes in latin1, sometimes in macroman)*/
- /* unfortunately both encodings use 0xa9 for copyright so we can't distinguish */
- /* guess that it's latin1 (or that copyright is the only odd char which */
- /* means a latin1 conversion will work for macs too). */
-
- if ( str==NULL )
-return( NULL );
-
- if ( utf8_valid(str))
-return( copy(str)); /* Either in ASCII (good) or appears to be utf8*/
-return( latin1_2_utf8_copy(str));
-}
-
-const char *ttfstandardnames[258] = {
-".notdef",
-".null",
-"nonmarkingreturn",
-"space",
-"exclam",
-"quotedbl",
-"numbersign",
-"dollar",
-"percent",
-"ampersand",
-"quotesingle",
-"parenleft",
-"parenright",
-"asterisk",
-"plus",
-"comma",
-"hyphen",
-"period",
-"slash",
-"zero",
-"one",
-"two",
-"three",
-"four",
-"five",
-"six",
-"seven",
-"eight",
-"nine",
-"colon",
-"semicolon",
-"less",
-"equal",
-"greater",
-"question",
-"at",
-"A",
-"B",
-"C",
-"D",
-"E",
-"F",
-"G",
-"H",
-"I",
-"J",
-"K",
-"L",
-"M",
-"N",
-"O",
-"P",
-"Q",
-"R",
-"S",
-"T",
-"U",
-"V",
-"W",
-"X",
-"Y",
-"Z",
-"bracketleft",
-"backslash",
-"bracketright",
-"asciicircum",
-"underscore",
-"grave",
-"a",
-"b",
-"c",
-"d",
-"e",
-"f",
-"g",
-"h",
-"i",
-"j",
-"k",
-"l",
-"m",
-"n",
-"o",
-"p",
-"q",
-"r",
-"s",
-"t",
-"u",
-"v",
-"w",
-"x",
-"y",
-"z",
-"braceleft",
-"bar",
-"braceright",
-"asciitilde",
-"Adieresis",
-"Aring",
-"Ccedilla",
-"Eacute",
-"Ntilde",
-"Odieresis",
-"Udieresis",
-"aacute",
-"agrave",
-"acircumflex",
-"adieresis",
-"atilde",
-"aring",
-"ccedilla",
-"eacute",
-"egrave",
-"ecircumflex",
-"edieresis",
-"iacute",
-"igrave",
-"icircumflex",
-"idieresis",
-"ntilde",
-"oacute",
-"ograve",
-"ocircumflex",
-"odieresis",
-"otilde",
-"uacute",
-"ugrave",
-"ucircumflex",
-"udieresis",
-"dagger",
-"degree",
-"cent",
-"sterling",
-"section",
-"bullet",
-"paragraph",
-"germandbls",
-"registered",
-"copyright",
-"trademark",
-"acute",
-"dieresis",
-"notequal",
-"AE",
-"Oslash",
-"infinity",
-"plusminus",
-"lessequal",
-"greaterequal",
-"yen",
-"mu",
-"partialdiff",
-"summation",
-"product",
-"pi",
-"integral",
-"ordfeminine",
-"ordmasculine",
-"Omega",
-"ae",
-"oslash",
-"questiondown",
-"exclamdown",
-"logicalnot",
-"radical",
-"florin",
-"approxequal",
-"Delta",
-"guillemotleft",
-"guillemotright",
-"ellipsis",
-"nonbreakingspace",
-"Agrave",
-"Atilde",
-"Otilde",
-"OE",
-"oe",
-"endash",
-"emdash",
-"quotedblleft",
-"quotedblright",
-"quoteleft",
-"quoteright",
-"divide",
-"lozenge",
-"ydieresis",
-"Ydieresis",
-"fraction",
-"currency",
-"guilsinglleft",
-"guilsinglright",
-"fi",
-"fl",
-"daggerdbl",
-"periodcentered",
-"quotesinglbase",
-"quotedblbase",
-"perthousand",
-"Acircumflex",
-"Ecircumflex",
-"Aacute",
-"Edieresis",
-"Egrave",
-"Iacute",
-"Icircumflex",
-"Idieresis",
-"Igrave",
-"Oacute",
-"Ocircumflex",
-"apple",
-"Ograve",
-"Uacute",
-"Ucircumflex",
-"Ugrave",
-"dotlessi",
-"circumflex",
-"tilde",
-"macron",
-"breve",
-"dotaccent",
-"ring",
-"cedilla",
-"hungarumlaut",
-"ogonek",
-"caron",
-"Lslash",
-"lslash",
-"Scaron",
-"scaron",
-"Zcaron",
-"zcaron",
-"brokenbar",
-"Eth",
-"eth",
-"Yacute",
-"yacute",
-"Thorn",
-"thorn",
-"minus",
-"multiply",
-"onesuperior",
-"twosuperior",
-"threesuperior",
-"onehalf",
-"onequarter",
-"threequarters",
-"franc",
-"Gbreve",
-"gbreve",
-"Idotaccent",
-"Scedilla",
-"scedilla",
-"Cacute",
-"cacute",
-"Ccaron",
-"ccaron",
-"dcroat"
-};
-
-int ttfcopyfile(FILE *ttf, FILE *other, int pos, char *tab_name) {
- int ch;
- int ret = 1;
-
- if ( ferror(ttf) || ferror(other)) {
- IError("Disk error of some nature. Perhaps no space on device?\nGenerated font will be unusable" );
- } else if ( pos!=ftell(ttf)) {
- IError("File Offset wrong for ttf table (%s), %d expected %d", tab_name, ftell(ttf), pos );
- }
- rewind(other);
- while (( ch = getc(other))!=EOF )
- putc(ch,ttf);
- if ( ferror(other)) ret = 0;
- if ( fclose(other)) ret = 0;
-return( ret );
-}
-
-
-
-static void OS2WeightCheck(struct pfminfo *pfminfo,char *weight) {
- if ( weight==NULL ) {
- /* default it */
- } else if ( strstrmatch(weight,"medi")!=NULL ) {
- pfminfo->weight = 500;
- pfminfo->panose[2] = 6;
- } else if ( strstrmatch(weight,"demi")!=NULL ||
- strstrmatch(weight,"halb")!=NULL ||
- (strstrmatch(weight,"semi")!=NULL &&
- strstrmatch(weight,"bold")!=NULL) ) {
- pfminfo->weight = 600;
- pfminfo->panose[2] = 7;
- } else if ( strstrmatch(weight,"bold")!=NULL ||
- strstrmatch(weight,"fett")!=NULL ||
- strstrmatch(weight,"gras")!=NULL ) {
- pfminfo->weight = 700;
- pfminfo->panose[2] = 8;
- } else if ( strstrmatch(weight,"heavy")!=NULL ) {
- pfminfo->weight = 800;
- pfminfo->panose[2] = 9;
- } else if ( strstrmatch(weight,"black")!=NULL ) {
- pfminfo->weight = 900;
- pfminfo->panose[2] = 10;
- } else if ( strstrmatch(weight,"nord")!=NULL ) {
- pfminfo->weight = 950;
- pfminfo->panose[2] = 11;
- } else if ( strstrmatch(weight,"thin")!=NULL ) {
- pfminfo->weight = 100;
- pfminfo->panose[2] = 2;
- } else if ( strstrmatch(weight,"extra")!=NULL ||
- strstrmatch(weight,"light")!=NULL ) {
- pfminfo->weight = 200;
- pfminfo->panose[2] = 3;
- } else if ( strstrmatch(weight,"light")!=NULL ) {
- pfminfo->weight = 300;
- pfminfo->panose[2] = 4;
- }
-}
-
-void SFDefaultOS2Simple(struct pfminfo *pfminfo,SplineFont *sf) {
- pfminfo->pfmfamily = 0x11;
- pfminfo->panose[0] = 2;
- pfminfo->weight = 400;
- pfminfo->panose[2] = 5;
- pfminfo->width = 5;
- pfminfo->panose[3] = 3;
- pfminfo->winascent_add = pfminfo->windescent_add = true;
- pfminfo->hheadascent_add = pfminfo->hheaddescent_add = true;
- pfminfo->typoascent_add = pfminfo->typodescent_add = true;
- pfminfo->os2_winascent = pfminfo->os2_windescent = 0;
-
- if ( sf->subfonts!=NULL ) sf = sf->subfonts[0];
- pfminfo->linegap = pfminfo->vlinegap = pfminfo->os2_typolinegap =
- rint(.09*(sf->ascent+sf->descent));
-}
-
-void SFDefaultOS2SubSuper(struct pfminfo *pfminfo,int emsize,double italic_angle) {
- double s = sin(italic_angle*3.1415926535897932/180.0);
- pfminfo->os2_supysize = pfminfo->os2_subysize = .7*emsize;
- pfminfo->os2_supxsize = pfminfo->os2_subxsize = .65*emsize;
- pfminfo->os2_subyoff = .14*emsize;
- pfminfo->os2_supyoff = .48*emsize;
- pfminfo->os2_supxoff = s*pfminfo->os2_supyoff;
- pfminfo->os2_subxoff = -s*pfminfo->os2_subyoff;
- pfminfo->os2_strikeysize = 102*emsize/2048;
- pfminfo->os2_strikeypos = 530*emsize/2048;
-}
-
-void SFDefaultOS2Info(struct pfminfo *pfminfo,SplineFont *sf,char *fontname) {
- int samewid= -1;
- char *weight = sf->cidmaster==NULL ? sf->weight : sf->cidmaster->weight;
-
- if ( sf->pfminfo.pfmset ) {
- if ( pfminfo!=&sf->pfminfo )
- *pfminfo = sf->pfminfo;
- if ( !pfminfo->panose_set ) {
- struct pfminfo info;
- memset(&info,0,sizeof(info));
- sf->pfminfo.pfmset = false;
- SFDefaultOS2Info(&info,sf,fontname);
- sf->pfminfo.pfmset = true;
- memcpy(pfminfo->panose,info.panose,sizeof(info.panose));
- }
- } else {
- struct pfminfo hold;
- if ( pfminfo->hheadset || pfminfo->vheadset )
- hold = *pfminfo;
- else
- hold.hheadset = hold.vheadset = false;
- memset(pfminfo,'\0',sizeof(*pfminfo));
- SFDefaultOS2Simple(pfminfo,sf);
- samewid = CIDOneWidth(sf);
-
- pfminfo->pfmfamily = 0x10;
- if ( samewid>0 ) {
- pfminfo->pfmfamily = 0x30;
- /* pfminfo->panose[3] = 9; */ /* This is done later */
- } else if ( strstrmatch(fontname,"sans")!=NULL )
- pfminfo->pfmfamily = 0x20;
- else if ( strstrmatch(fontname,"script")!=NULL ) {
- pfminfo->pfmfamily = 0x40;
- pfminfo->panose[0] = 3;
- }
- if ( samewid==-1 )
- pfminfo->pfmfamily |= 0x1; /* Else it assumes monospace */
-
-/* urw uses 4 character abreviations */
- if ( weight!=NULL )
- OS2WeightCheck(pfminfo,weight);
- OS2WeightCheck(pfminfo,fontname);
-
- if ( strstrmatch(fontname,"ultra")!=NULL &&
- strstrmatch(fontname,"condensed")!=NULL ) {
- pfminfo->width = 1;
- pfminfo->panose[3] = 8;
- } else if ( strstrmatch(fontname,"extra")!=NULL &&
- strstrmatch(fontname,"condensed")!=NULL ) {
- pfminfo->width = 2;
- pfminfo->panose[3] = 8;
- } else if ( strstrmatch(fontname,"semi")!=NULL &&
- strstrmatch(fontname,"condensed")!=NULL ) {
- pfminfo->width = 4;
- pfminfo->panose[3] = 6;
- } else if ( strstrmatch(fontname,"condensed")!=NULL ||
- strstrmatch(fontname,"narrow")!=NULL ) {
- pfminfo->width = 3;
- pfminfo->panose[3] = 6;
- } else if ( strstrmatch(fontname,"ultra")!=NULL &&
- strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 9;
- pfminfo->panose[3] = 7;
- } else if ( strstrmatch(fontname,"extra")!=NULL &&
- strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 8;
- pfminfo->panose[3] = 7;
- } else if ( strstrmatch(fontname,"semi")!=NULL &&
- strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 6;
- pfminfo->panose[3] = 5;
- } else if ( strstrmatch(fontname,"expanded")!=NULL ) {
- pfminfo->width = 7;
- pfminfo->panose[3] = 5;
- }
- if ( samewid>0 )
- pfminfo->panose[3] = 9;
- if ( hold.hheadset ) {
- pfminfo->hheadset = true;
- pfminfo->hheadascent_add = hold.hheadascent_add;
- pfminfo->hheaddescent_add = hold.hheaddescent_add;
- pfminfo->hhead_ascent = hold.hhead_ascent;
- pfminfo->hhead_descent = hold.hhead_descent;
- pfminfo->linegap = hold.linegap;
- }
- if ( hold.vheadset ) {
- pfminfo->vheadset = true;
- pfminfo->vlinegap = hold.vlinegap;
- }
- }
- if ( !pfminfo->subsuper_set )
- SFDefaultOS2SubSuper(pfminfo,sf->ascent+sf->descent,sf->italicangle);
-}
-
-void OS2FigureCodePages(SplineFont *sf, uint32 CodePage[2]) {
- int i;
- uint32 latin1[8];
- int has_ascii, has_latin1;
-
- memset(latin1,0,sizeof(latin1));
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( sf->glyphs[i]->unicodeenc<256 && sf->glyphs[i]->unicodeenc>=0 )
- latin1[(sf->glyphs[i]->unicodeenc>>5)] |= 1<<(sf->glyphs[i]->unicodeenc&31);
- }
-
- has_ascii = latin1[1]==0xffffffff && latin1[2]==0xffffffff &&
- (latin1[3]&0x7fffffff)==0x7fffffff; /* DEL is not a char */
- has_latin1 = has_ascii && (latin1[5]&~1&~(1<<0xd))== (~1&~(1<<0xd)) && /* Ignore nobreak space, softhyphen */
- latin1[6]==0xffffffff && latin1[7] == 0xffffffff;
- CodePage[0] = CodePage[1] = 0;
- if ( has_ascii ) CodePage[1] |= 1U<<31; /* US (Ascii I assume) */
- if ( has_latin1 ) CodePage[0] |= 1U<<30; /* WE/latin1 */
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( sf->glyphs[i]->unicodeenc==0xde && has_ascii )
- CodePage[0] |= 1<<0; /* (ANSI) Latin1 */
- else if ( sf->glyphs[i]->unicodeenc==0x13d && has_ascii ) {
- CodePage[0] |= 1<<1; /* latin2 */
- CodePage[1] |= 1<<26; /* latin2 */
- } else if ( sf->glyphs[i]->unicodeenc==0x411 ) {
- CodePage[0] |= 1<<2; /* cyrillic */
- CodePage[1] |= 1<<17; /* MS DOS Russian */
- CodePage[1] |= 1<<25; /* IBM Cyrillic */
- } else if ( sf->glyphs[i]->unicodeenc==0x386 ) {
- CodePage[0] |= 1<<3; /* greek */
- CodePage[1] |= 1<<16; /* IBM Greek */
- CodePage[1] |= 1<<28; /* Greek, former 437 G */
- } else if ( sf->glyphs[i]->unicodeenc==0x130 && has_ascii ) {
- CodePage[0] |= 1<<4; /* turkish */
- CodePage[1] |= 1<<24; /* IBM turkish */
- } else if ( sf->glyphs[i]->unicodeenc==0x5d0 ) {
- CodePage[0] |= 1<<5; /* hebrew */
- CodePage[1] |= 1<<21; /* hebrew */
- } else if ( sf->glyphs[i]->unicodeenc==0x631 ) {
- CodePage[0] |= 1<<6; /* arabic */
- CodePage[1] |= 1<<19; /* arabic */
- CodePage[1] |= 1<<29; /* arabic; ASMO 708 */
- } else if ( sf->glyphs[i]->unicodeenc==0x157 && has_ascii ) {
- CodePage[0] |= 1<<7; /* baltic */
- CodePage[1] |= 1<<27; /* baltic */
- } else if ( sf->glyphs[i]->unicodeenc==0x20AB && has_ascii ) {
- CodePage[0] |= 1<<8; /* vietnamese */
- } else if ( sf->glyphs[i]->unicodeenc==0xe45 )
- CodePage[0] |= 1<<16; /* thai */
- else if ( sf->glyphs[i]->unicodeenc==0x30a8 )
- CodePage[0] |= 1<<17; /* japanese */
- else if ( sf->glyphs[i]->unicodeenc==0x3105 )
- CodePage[0] |= 1<<18; /* simplified chinese */
- else if ( sf->glyphs[i]->unicodeenc==0x3131 )
- CodePage[0] |= 1<<19; /* korean wansung */
- else if ( sf->glyphs[i]->unicodeenc==0x592E )
- CodePage[0] |= 1<<20; /* traditional chinese */
- else if ( sf->glyphs[i]->unicodeenc==0xacf4 )
- CodePage[0] |= 1<<21; /* korean Johab */
- else if ( sf->glyphs[i]->unicodeenc==0x2030 && has_ascii )
- CodePage[0] |= 1U<<29; /* mac roman */
- else if ( sf->glyphs[i]->unicodeenc==0x2665 && has_ascii )
- CodePage[0] |= 1U<<30; /* OEM */
-#if 0 /* the symbol bit doesn't mean it contains the glyphs in symbol */
- /* rather that one is using a symbol encoding. Or that there are */
- /* glyphs with unicode encoding between 0xf000 and 0xf0ff, in which */
- /* case those guys should be given a symbol encoding */
- /* There's a bug in the way otf fonts handle this (but not ttf) and */
- /* they only seem to list the symbol glyphs */
- else if ( sf->glyphs[i]->unicodeenc==0x21d4 )
- CodePage[0] |= 1U<<31; /* symbol */
-#else
- /* This doesn't work well either. In ttf fonts the bit is ignored */
- /* in otf fonts the bit means "ignore all other bits" */
- else if ( sf->glyphs[i]->unicodeenc>=0xf000 && sf->glyphs[i]->unicodeenc<=0xf0ff )
- CodePage[0] |= 1U<<31; /* symbol */
-#endif
- else if ( sf->glyphs[i]->unicodeenc==0xc3 && has_ascii )
- CodePage[1] |= 1<<18; /* MS-DOS Nordic */
- else if ( sf->glyphs[i]->unicodeenc==0xe9 && has_ascii )
- CodePage[1] |= 1<<20; /* MS-DOS Canadian French */
- else if ( sf->glyphs[i]->unicodeenc==0xf5 && has_ascii )
- CodePage[1] |= 1<<23; /* MS-DOS Portuguese */
- else if ( sf->glyphs[i]->unicodeenc==0xfe && has_ascii )
- CodePage[1] |= 1<<22; /* MS-DOS Icelandic */
- }
-}
-
-#define _On_Curve 1
-#define _X_Short 2
-#define _Y_Short 4
-#define _Repeat 8
-#define _X_Same 0x10
-#define _Y_Same 0x20
-
-int SSAddPoints(SplineSet *ss,int ptcnt,BasePoint *bp, char *flags) {
- SplinePoint *sp, *first, *nextsp;
- int startcnt = ptcnt;
-
- if ( ss->first->prev!=NULL &&
- ss->first->prev->from->nextcpindex==startcnt ) {
- if ( flags!=NULL ) flags[ptcnt] = 0;
- bp[ptcnt].x = rint(ss->first->prevcp.x);
- bp[ptcnt++].y = rint(ss->first->prevcp.y);
- } else if ( ss->first->ttfindex!=ptcnt && ss->first->ttfindex!=0xfffe )
- IError("Unexpected point count in SSAddPoints" );
-
- first = NULL;
- for ( sp=ss->first; sp!=first ; ) {
- if ( sp->ttfindex!=0xffff ) {
- if ( flags!=NULL ) flags[ptcnt] = _On_Curve;
- bp[ptcnt].x = rint(sp->me.x);
- bp[ptcnt].y = rint(sp->me.y);
- sp->ttfindex = ptcnt++;
- } else if ( !SPInterpolate( sp ) ) {
- /* If an on curve point is midway between two off curve points*/
- /* it may be omitted and will be interpolated on read in */
- if ( flags!=NULL ) flags[ptcnt] = _On_Curve;
- bp[ptcnt].x = rint(sp->me.x);
- bp[ptcnt].y = rint(sp->me.y);
- sp->ttfindex = ptcnt++;
- }
- nextsp = sp->next!=NULL ? sp->next->to : NULL;
- if ( sp->nextcpindex == startcnt )
- /* This control point is actually our first point, not our last */
- break;
- if ( (sp->nextcpindex !=0xffff && sp->nextcpindex!=0xfffe ) ||
- !sp->nonextcp ) {
- if ( flags!=NULL ) flags[ptcnt] = 0;
- bp[ptcnt].x = rint(sp->nextcp.x);
- bp[ptcnt++].y = rint(sp->nextcp.y);
- }
- if ( nextsp==NULL )
- break;
- if ( first==NULL ) first = sp;
- sp = nextsp;
- }
-return( ptcnt );
-}
-
-
-#ifdef _HAS_LONGLONG
-void cvt_unix_to_1904( long long time, int32 result[2]) {
- uint32 date1970[4], tm[4];
- uint32 year[2];
- int i;
-
- tm[0] = time &0xffff;
- tm[1] = (time>>16)&0xffff;
- tm[2] = (time>>32)&0xffff;
- tm[3] = (time>>48)&0xffff;
-#else
-void cvt_unix_to_1904( long time, int32 result[2]) {
- int32 date1970[4], tm[4];
- uint32 year[2];
- int i;
-
- tm[0] = time &0xffff;
- tm[1] = (time>>16)&0xffff;
- tm[2] = 0;
- tm[3] = 0;
-#endif
- memset(date1970,0,sizeof(date1970));
- year[0] = (60*60*24*365L)&0xffff;
- year[1] = (60*60*24*365L)>>16;
- for ( i=1904; i<1970; ++i ) {
- date1970[0] += year[0];
- date1970[1] += year[1];
- if ( (i&3)==0 && (i%100!=0 || i%400==0))
- date1970[0] += 24*60*60L; /* Leap year */
- date1970[1] += (date1970[0]>>16);
- date1970[0] &= 0xffff;
- date1970[2] += date1970[1]>>16;
- date1970[1] &= 0xffff;
- date1970[3] += date1970[2]>>16;
- date1970[2] &= 0xffff;
- }
-
- for ( i=0; i<3; ++i ) {
- tm[i] += date1970[i];
- tm[i+1] += tm[i]>>16;
- tm[i] &= 0xffff;
- }
- tm[3] -= date1970[3];
-
- result[0] = (tm[1]<<16) | tm[0];
- result[1] = (tm[3]<<16) | tm[2];
-}
-
-#endif /* for tottf.c */
-
-/* from fvimportbdf.c */
-
-void SFCheckPSBitmap(SplineFont *sf) {
- /* full, was empty */
-}
-
- void SFDefaultAscent(SplineFont *sf) {
- /* stubbed */
-}
-
-
-/* from bdfinfo.c */
-
-int BdfPropHasInt(BDFFont *font,const char *key, int def ) {
- int i;
-
- for ( i=0; i<font->prop_cnt; ++i ) if ( strcmp(font->props[i].name,key)==0 ) {
- switch ( font->props[i].type&~prt_property ) {
- case prt_int: case prt_uint:
-return( font->props[i].u.val );
- break;
- }
- }
-return( def );
-}
-
-/* from tottfaat.c */
-
-int scriptsHaveDefault(struct scriptlanglist *sl) {
- int i;
-
- for ( ; sl!=NULL; sl=sl->next ) {
- for ( i=0; i<sl->lang_cnt; ++i ) {
- if ( (i<MAX_LANG && sl->langs[i]==DEFAULT_LANG) ||
- (i>=MAX_LANG && sl->morelangs[i-MAX_LANG]==DEFAULT_LANG)) {
-return( true );
- }
- }
- }
-return( false );
-}
-
-uint32 MacFeatureToOTTag(int featureType,int featureSetting) {
- int i;
- struct macsettingname *msn = user_macfeat_otftag ? user_macfeat_otftag : macfeat_otftag;
-
- for ( i=0; msn[i].otf_tag!=0; ++i )
- if ( msn[i].mac_feature_type == featureType &&
- msn[i].mac_feature_setting == featureSetting )
-return( msn[i].otf_tag );
-
-return( 0 );
-}
-
-int OTTagToMacFeature(uint32 tag, int *featureType,int *featureSetting) {
- int i;
- struct macsettingname *msn = user_macfeat_otftag ? user_macfeat_otftag : macfeat_otftag;
-
- for ( i=0; msn[i].otf_tag!=0; ++i )
- if ( msn[i].otf_tag == tag ) {
- *featureType = msn[i].mac_feature_type;
- *featureSetting = msn[i].mac_feature_setting;
-return( true );
- }
-
- *featureType = 0;
- *featureSetting = 0;
-return( false );
-}
-
-static void DumpKernClass(FILE *file, uint16 *class,int cnt,int add,int mul) {
- int i, first=-1, last=-1;
-
- for ( i=0; i<cnt; ++i ) {
- if ( class[i] ) last = i;
- if ( class[i] && first==-1 ) first = i;
- }
- putshort(file,first);
- putshort(file,last-first+1);
- for ( i=first; i<=last; ++i )
- putshort(file,class[i]*mul+add);
-}
-
-struct kerncounts {
- int cnt;
- int vcnt;
- int mh, mv;
- int kccnt;
- int vkccnt;
- int ksm;
- int hsubs;
- int *hbreaks;
- int vsubs;
- int *vbreaks;
-};
-
-static int CountKerns(struct alltabs *at, SplineFont *sf, struct kerncounts *kcnt) {
- int i, cnt, vcnt, j, kccnt=0, vkccnt=0, ksm=0, mh, mv;
- KernPair *kp;
- KernClass *kc;
- ASM *sm;
-
- cnt = mh = vcnt = mv = 0;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- j = 0;
- for ( kp = sf->glyphs[at->gi.bygid[i]]->kerns; kp!=NULL; kp=kp->next )
- if ( kp->off!=0 && LookupHasDefault(kp->subtable->lookup ))
- ++cnt, ++j;
- if ( j>mh ) mh=j;
- j=0;
- for ( kp = sf->glyphs[at->gi.bygid[i]]->vkerns; kp!=NULL; kp=kp->next )
- if ( kp->off!=0 && LookupHasDefault(kp->subtable->lookup ))
- ++vcnt, ++j;
- if ( j>mv ) mv=j;
- }
- kcnt->cnt = cnt;
- kcnt->vcnt = vcnt;
- kcnt->mh = mh;
- kcnt->mv = mv;
- kcnt->hbreaks = kcnt->vbreaks = NULL;
- if ( cnt>=10000 ) {
- /* the sub-table size is 6*cnt+14 or so and needs to be less 65535 */
- /* so break it up into little bits */
- /* We might not need this when applemode is set because the subtable */
- /* length is a long. BUT... there's a damn binsearch header with */
- /* shorts in it still */
- int b=0;
- kcnt->hbreaks = galloc((at->gi.gcnt+1)*sizeof(int));
- cnt = 0;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- j = 0;
- for ( kp = sf->glyphs[at->gi.bygid[i]]->kerns; kp!=NULL; kp=kp->next )
- if ( kp->off!=0 && LookupHasDefault(kp->subtable->lookup ))
- ++j;
- if ( (cnt+j)*6>64000L && cnt!=0 ) {
- kcnt->hbreaks[b++] = cnt;
- cnt = 0;
- }
- cnt += j;
- }
- kcnt->hbreaks[b++] = cnt;
- kcnt->hsubs = b;
- } else if ( cnt!=0 )
- kcnt->hsubs = 1;
- else
- kcnt->hsubs = 0;
- if ( vcnt>=10000 ) {
- int b=0;
- kcnt->vbreaks = galloc((at->gi.gcnt+1)*sizeof(int));
- vcnt = 0;
- for ( i=0; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
- j = 0;
- for ( kp = sf->glyphs[at->gi.bygid[i]]->vkerns; kp!=NULL; kp=kp->next )
- if ( kp->off!=0 && LookupHasDefault(kp->subtable->lookup))
- ++j;
- if ( (vcnt+j)*6>64000L && vcnt!=0 ) {
- kcnt->vbreaks[b++] = vcnt;
- vcnt = 0;
- }
- vcnt += j;
- }
- kcnt->vbreaks[b++] = vcnt;
- kcnt->vsubs = b;
- } else if ( vcnt!=0 )
- kcnt->vsubs = 1;
- else
- kcnt->vsubs = 0;
-
- if ( at->applemode ) { /* if we aren't outputting Apple's extensions to kerning (by classes, and by state machine) then don't check for those extensions */
- for ( kc=sf->kerns; kc!=NULL; kc = kc->next ) if ( LookupHasDefault(kc->subtable->lookup) )
- ++kccnt;
- for ( kc=sf->vkerns; kc!=NULL; kc = kc->next ) if ( LookupHasDefault(kc->subtable->lookup) )
- ++vkccnt;
- for ( sm=sf->sm; sm!=NULL; sm=sm->next )
- if ( sm->type == asm_kern )
- ++ksm;
- }
- kcnt->kccnt = kccnt;
- kcnt->vkccnt = vkccnt;
- kcnt->ksm = ksm;
-return( kcnt->hsubs + kcnt->vsubs + kccnt + vkccnt + ksm );
-}
-
-static void ttf_dumpsfkerns(struct alltabs *at, SplineFont *sf, int tupleIndex, int version) {
- struct kerncounts kcnt;
- int i, j, k, m, c, gid, tot, km;
- KernPair *kp;
- KernClass *kc;
- /*ASM *sm;*/
- uint16 *glnum, *offsets;
- int isv;
- int tupleMask = tupleIndex==-1 ? 0 : 0x2000;
- int b, bmax;
- int *breaks;
-
- if ( CountKerns(at,sf,&kcnt)==0 )
-return;
-
- if ( tupleIndex==-1 ) tupleIndex = 0;
-
- for ( isv=0; isv<2; ++isv ) {
- c = isv ? kcnt.vcnt : kcnt.cnt;
- bmax = isv ? kcnt.vsubs : kcnt.hsubs;
- breaks = isv ? kcnt.vbreaks : kcnt.hbreaks;
- if ( c!=0 ) {
- km = isv ? kcnt.mv : kcnt.mh;
- glnum = galloc(km*sizeof(uint16));
- offsets = galloc(km*sizeof(uint16));
- gid = 0;
- for ( b=0; b<bmax; ++b ) {
- c = bmax==1 ? c : breaks[b];
- if ( version==0 ) {
- putshort(at->kern,0); /* subtable version */
- putshort(at->kern,(7+3*c)*sizeof(uint16)); /* subtable length */
- putshort(at->kern,!isv); /* coverage, flags=hor/vert&format=0 */
- } else {
- putlong(at->kern,(8+3*c)*sizeof(uint16)); /* subtable length */
- /* Apple's new format has a completely different coverage format */
- putshort(at->kern,(isv?0x8000:0)| /* format 0, horizontal/vertical flags (coverage) */
- tupleMask);
- putshort(at->kern,tupleIndex);
- }
- putshort(at->kern,c);
- for ( i=1,j=0; i<=c; i<<=1, ++j );
- i>>=1; --j;
- putshort(at->kern,i*6); /* binary search headers */
- putshort(at->kern,j);
- putshort(at->kern,6*(c-i));
-
- for ( tot = 0; gid<at->gi.gcnt && tot<c; ++gid ) if ( at->gi.bygid[gid]!=-1 ) {
- SplineChar *sc = sf->glyphs[at->gi.bygid[gid]];
- m = 0;
- for ( kp = isv ? sc->vkerns : sc->kerns; kp!=NULL; kp=kp->next ) {
- if ( kp->off!=0 && LookupHasDefault(kp->subtable->lookup)) {
- /* order the pairs */
- for ( j=0; j<m; ++j )
- if ( kp->sc->ttf_glyph<glnum[j] )
- break;
- for ( k=m; k>j; --k ) {
- glnum[k] = glnum[k-1];
- offsets[k] = offsets[k-1];
- }
- glnum[j] = kp->sc->ttf_glyph;
- offsets[j] = kp->off;
- ++m;
- }
- }
- for ( j=0; j<m; ++j ) {
- putshort(at->kern,gid);
- putshort(at->kern,glnum[j]);
- putshort(at->kern,offsets[j]);
- }
- tot += m;
- }
- }
- free(offsets);
- free(glnum);
- }
- }
- free(kcnt.hbreaks); free(kcnt.vbreaks);
-
- if ( at->applemode ) for ( isv=0; isv<2; ++isv ) {
- for ( kc=isv ? sf->vkerns : sf->kerns; kc!=NULL; kc=kc->next ) if ( LookupHasDefault(kc->subtable->lookup) ) {
- /* If we are here, we must be using version 1 */
- uint32 len_pos = ftell(at->kern), pos;
- uint16 *class1, *class2;
- int first_cnt = kc->first_cnt;
-
- /* OpenType fonts can actually have a set of glyphs in class[0] of*/
- /* the first class. This happens when there are glyphs in the */
- /* coverage table which are not in any of the classes. Otherwise */
- /* class 0 is sort of useless in opentype */
- if ( kc->firsts[0]!=NULL )
- ++first_cnt;
-
- putlong(at->kern,0); /* subtable length */
- putshort(at->kern,(isv?0x8002:2)| /* format 2, horizontal/vertical flags (coverage) */
- tupleMask);
- putshort(at->kern,tupleIndex);
-
- putshort(at->kern,sizeof(uint16)*kc->second_cnt);
- putshort(at->kern,0); /* left classes */
- putshort(at->kern,0); /* right classes */
- putshort(at->kern,16); /* Offset to array, next byte */
-
- if ( kc->firsts[0]!=NULL ) {
- /* Create a dummy class to correspond to the mac's class 0 */
- /* all entries will be 0 */
- for ( i=0 ; i<kc->second_cnt; ++i )
- putshort(at->kern,0);
- }
- for ( i=0; i<kc->first_cnt*kc->second_cnt; ++i )
- putshort(at->kern,kc->offsets[i]);
-
- pos = ftell(at->kern);
- fseek(at->kern,len_pos+10,SEEK_SET);
- putshort(at->kern,pos-len_pos);
- fseek(at->kern,pos,SEEK_SET);
- class1 = ClassesFromNames(sf,kc->firsts,kc->first_cnt,at->maxp.numGlyphs,NULL,true);
- DumpKernClass(at->kern,class1,at->maxp.numGlyphs,16,sizeof(uint16)*kc->second_cnt);
- free(class1);
-
- pos = ftell(at->kern);
- fseek(at->kern,len_pos+12,SEEK_SET);
- putshort(at->kern,pos-len_pos);
- fseek(at->kern,pos,SEEK_SET);
- class2 = ClassesFromNames(sf,kc->seconds,kc->second_cnt,at->maxp.numGlyphs,NULL,true);
- DumpKernClass(at->kern,class2,at->maxp.numGlyphs,0,sizeof(uint16));
- free(class2);
-
- pos = ftell(at->kern);
- fseek(at->kern,len_pos,SEEK_SET);
- putlong(at->kern,pos-len_pos);
- fseek(at->kern,pos,SEEK_SET);
- }
- }
-
- if ( at->applemode ) if ( kcnt.ksm!=0 ) {
-#ifndef LUA_FF_LIB
- for ( sm=sf->sm; sm!=NULL; sm=sm->next ) if ( sm->type == asm_kern ) {
- uint32 len_pos = ftell(at->kern), pos;
-
- putlong(at->kern,0); /* subtable length */
- putshort(at->kern,((sm->flags&0x8000)?0x8001:1)| /* format 1, horizontal/vertical flags (coverage) */
- tupleMask);
- putshort(at->kern,tupleIndex);
- morx_dumpASM(at->kern,sm,at,sf);
-
- pos = ftell(at->kern);
- fseek(at->kern,len_pos,SEEK_SET);
- putlong(at->kern,pos-len_pos);
- fseek(at->kern,pos,SEEK_SET);
- }
-#endif
- }
-}
-
-void ttf_dumpkerns(struct alltabs *at, SplineFont *sf) {
- int i, mmcnt=0, sum;
- int version;
- MMSet *mm = at->dovariations ? sf->mm : NULL;
- struct kerncounts kcnt;
- int must_use_old_style = 0;
-
- if ( !at->applemode && (!at->opentypemode || (at->gi.flags&ttf_flag_oldkern)) ) {
- must_use_old_style = true;
- SFKernClassTempDecompose(sf,false);
- mm = NULL;
- } else {
- if ( mm!=NULL ) {
- for ( i=0; i<mm->instance_count; ++i ) {
- mmcnt += CountKerns(at,mm->instances[i],&kcnt);
- free(kcnt.hbreaks); free(kcnt.vbreaks);
- }
- sf = mm->normal;
- }
- }
-
- sum = CountKerns(at,sf,&kcnt);
- free(kcnt.hbreaks); free(kcnt.vbreaks);
- if ( sum==0 && mmcnt==0 ) {
- if ( must_use_old_style )
- SFKernCleanup(sf,false);
-return;
- }
-
- /* Old kerning format (version 0) uses 16 bit quantities */
- /* Apple's new format (version 0x00010000) uses 32 bit quantities */
- at->kern = tmpfile();
- if ( must_use_old_style ||
- ( kcnt.kccnt==0 && kcnt.vkccnt==0 && kcnt.ksm==0 && mmcnt==0 )) {
- /* MS does not support format 1,2,3 kern sub-tables so if we have them */
- /* we might as well admit that this table is for apple only and use */
- /* the new format apple recommends. Otherwise, use the old format */
- /* If we might need to store tuple data, use the new format */
- putshort(at->kern,0); /* version */
- putshort(at->kern,sum); /* number of subtables */
- version = 0;
- } else {
- putlong(at->kern,0x00010000); /* version */
- putlong(at->kern,sum+mmcnt); /* number of subtables */
- version = 1;
- }
-
- ttf_dumpsfkerns(at, sf, -1, version);
- if ( mm!=NULL ) {
- for ( i=0; i<mm->instance_count; ++i )
- ttf_dumpsfkerns(at, mm->instances[i], i, version);
- }
- if ( must_use_old_style )
- SFKernCleanup(sf,false);
-
- at->kernlen = ftell(at->kern);
- if ( at->kernlen&2 )
- putshort(at->kern,0); /* pad it */
-}
-
-
-int LookupHasDefault(OTLookup *otl) {
- FeatureScriptLangList *feats;
-
- if ( otl->def_lang_checked )
-return( otl->def_lang_found );
-
- otl->def_lang_checked = true;
- for ( feats=otl->features; feats!=NULL; feats = feats->next ) {
- if ( scriptsHaveDefault(feats->scripts) ) {
- otl->def_lang_found = true;
-return( true );
- }
- }
- otl->def_lang_found = false;
-return( false );
-}
-
-
-/* from sfd1.c, full */
-
-enum uni_interp interp_from_encoding(Encoding *enc,enum uni_interp interp) {
-
- if ( enc==NULL )
-return( interp );
-
- if ( enc->is_japanese )
- interp = ui_japanese;
- else if ( enc->is_korean )
- interp = ui_korean;
- else if ( enc->is_tradchinese )
- interp = ui_trad_chinese;
- else if ( enc->is_simplechinese )
- interp = ui_simp_chinese;
-return( interp );
-}
-
-/* from bitmapview.c */
-
-void BCCharChangedUpdate(BDFChar *bc) {
- /* full */
- bc->changed = true;
-}
-
-BDFChar *BDFMakeGID(BDFFont *bdf,int gid) {
- SplineFont *sf=bdf->sf;
- SplineChar *sc;
- BDFChar *bc;
- int i;
-
- if ( gid==-1 )
-return( NULL );
-
- if ( sf->cidmaster!=NULL || sf->subfonts!=NULL ) {
- int j = SFHasCID(sf,gid);
- if ( sf->cidmaster ) sf = sf->cidmaster;
- if ( j==-1 ) {
- for ( j=0; j<sf->subfontcnt; ++j )
- if ( gid<sf->subfonts[j]->glyphcnt )
- break;
- if ( j==sf->subfontcnt )
-return( NULL );
- }
- sf = sf->subfonts[j];
- }
- if ( (sc = sf->glyphs[gid])==NULL )
-return( NULL );
-
- if ( gid>=bdf->glyphcnt ) {
- if ( gid>=bdf->glyphmax )
- bdf->glyphs = grealloc(bdf->glyphs,(bdf->glyphmax=sf->glyphmax)*sizeof(BDFChar *));
- for ( i=bdf->glyphcnt; i<=gid; ++i )
- bdf->glyphs[i] = NULL;
- bdf->glyphcnt = sf->glyphcnt;
- }
- if ( (bc = bdf->glyphs[gid])==NULL ) {
-#ifndef LUA_FF_LIB
- if ( bc!=NULL )
- /* Done */;
- else if ( bdf->clut==NULL )
- bc = SplineCharRasterize(sc,bdf->pixelsize);
- else
- bc = SplineCharAntiAlias(sc,bdf->pixelsize,BDFDepth(bdf));
-#endif
- bdf->glyphs[gid] = bc;
- bc->orig_pos = gid;
- BCCharChangedUpdate(bc);
- }
-return( bc );
-}
-
-BDFChar *BDFMakeChar(BDFFont *bdf,EncMap *map,int enc) {
- SplineFont *sf=bdf->sf;
-
- if ( enc==-1 )
-return( NULL );
-
- if ( sf->cidmaster!=NULL ) {
- int j = SFHasCID(sf,enc);
- sf = sf->cidmaster;
- if ( j==-1 ) {
- for ( j=0; j<sf->subfontcnt; ++j )
- if ( enc<sf->subfonts[j]->glyphcnt )
- break;
- if ( j==sf->subfontcnt )
-return( NULL );
- }
- sf = sf->subfonts[j];
- }
- SFMakeChar(sf,map,enc);
-return( BDFMakeGID(bdf,map->map[enc]));
-}
-
-/* splinesaveafm.c */
-
-int SCDrawsSomething(SplineChar *sc) {
- int layer,l;
- RefChar *ref;
-
- if ( sc==NULL )
-return( false );
- for ( layer = ly_fore; layer<sc->layer_cnt; ++layer ) {
- if ( sc->layers[layer].splines!=NULL || sc->layers[layer].images!=NULL )
-return( true );
- for ( ref = sc->layers[layer].refs; ref!=NULL; ref=ref->next )
- for ( l=0; l<ref->layer_cnt; ++l )
- if ( ref->layers[l].splines!=NULL )
-return( true );
- }
-return( false );
-}
-
-int SCWorthOutputting(SplineChar *sc) {
-return( sc!=NULL &&
- ( SCDrawsSomething(sc) || sc->widthset || sc->anchor!=NULL ||
-#if HANYANG
- sc->compositionunit ||
-#endif
- sc->dependents!=NULL /*||
- sc->width!=sc->parent->ascent+sc->parent->descent*/ ) );
-}
-
-void SFKernCleanup(SplineFont *sf,int isv) {
- int i;
- KernPair *kp, *p, *n;
- OTLookup *otl, *otlp, *otln;
-
- if ( (!isv && sf->kerns==NULL) || (isv && sf->vkerns==NULL) ) /* can't have gotten messed up */
-return;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- for ( kp = isv ? sf->glyphs[i]->vkerns : sf->glyphs[i]->kerns, p=NULL; kp!=NULL; kp = n ) {
- n = kp->next;
- if ( kp->kcid!=0 ) {
- if ( p!=NULL )
- p->next = n;
- else if ( isv )
- sf->glyphs[i]->vkerns = n;
- else
- sf->glyphs[i]->kerns = n;
- chunkfree(kp,sizeof(*kp));
- } else
- p = kp;
- }
- }
- for ( otl=sf->gpos_lookups, otlp = NULL; otl!=NULL; otl = otln ) {
- otln = otl->next;
- if ( otl->temporary_kern ) {
- if ( otlp!=NULL )
- otlp->next = otln;
- else
- sf->gpos_lookups = otln;
- OTLookupFree(otl);
- } else
- otlp = otl;
- }
-}
-
-
-static void KCSfree(SplineChar ***scs,int cnt) {
- int i;
- for ( i=1; i<cnt; ++i )
- free( scs[i]);
- free(scs);
-}
-
-static SplineChar ***KernClassToSC(SplineFont *sf, char **classnames, int cnt) {
- SplineChar ***scs, *sc;
- int i,j;
- char *pt, *end, ch;
-
- scs = galloc(cnt*sizeof(SplineChar **));
- for ( i=1; i<cnt; ++i ) {
- for ( pt=classnames[i]-1, j=0; pt!=NULL; pt=strchr(pt+1,' ') )
- ++j;
- scs[i] = galloc((j+1)*sizeof(SplineChar *));
- for ( pt=classnames[i], j=0; *pt!='\0'; pt=end+1 ) {
- end = strchr(pt,' ');
- if ( end==NULL )
- end = pt+strlen(pt);
- ch = *end;
- *end = '\0';
- sc = SFGetChar(sf,-1,pt);
- if ( sc!=NULL )
- scs[i][j++] = sc;
- if ( ch=='\0' )
- break;
- *end = ch;
- }
- scs[i][j] = NULL;
- }
-return( scs );
-}
-
-static void AddTempKP(SplineChar *first,SplineChar *second,
- int16 offset, struct lookup_subtable *sub,uint16 kcid,int isv) {
- KernPair *kp;
-
- for ( kp=first->kerns; kp!=NULL; kp=kp->next )
- if ( kp->sc == second )
- break;
- if ( kp==NULL ) {
- kp = chunkalloc(sizeof(KernPair));
- kp->sc = second;
- kp->off = offset;
- kp->subtable = sub;
- kp->kcid = kcid;
- if ( isv ) {
- kp->next = first->vkerns;
- first->vkerns = kp;
- } else {
- kp->next = first->kerns;
- first->kerns = kp;
- }
- }
-}
-
-
-void SFKernClassTempDecompose(SplineFont *sf,int isv) {
- KernClass *kc, *head= isv ? sf->vkerns : sf->kerns;
- SplineChar ***first, ***last;
- int i, j, k, l;
- OTLookup *otl;
-
- for ( kc = head, i=0; kc!=NULL; kc = kc->next )
- kc->kcid = ++i;
- for ( kc = head; kc!=NULL; kc = kc->next ) {
-
- otl = chunkalloc(sizeof(OTLookup));
- otl->next = sf->gpos_lookups;
- sf->gpos_lookups = otl;
- otl->lookup_type = gpos_pair;
- otl->lookup_flags = kc->subtable->lookup->lookup_flags;
- otl->features = FeatureListCopy(kc->subtable->lookup->features);
- otl->lookup_name = copy(_("<Temporary kerning>"));
- otl->temporary_kern = otl->store_in_afm = true;
- otl->subtables = chunkalloc(sizeof(struct lookup_subtable));
- otl->subtables->lookup = otl;
- otl->subtables->per_glyph_pst_or_kern = true;
- otl->subtables->subtable_name = copy(_("<Temporary kerning>"));
-
- first = KernClassToSC(sf,kc->firsts,kc->first_cnt);
- last = KernClassToSC(sf,kc->seconds,kc->second_cnt);
- for ( i=1; i<kc->first_cnt; ++i ) for ( j=1; j<kc->second_cnt; ++j ) {
- if ( kc->offsets[i*kc->second_cnt+j]!=0 ) {
- for ( k=0; first[i][k]!=NULL; ++k )
- for ( l=0; last[j][l]!=NULL; ++l )
- AddTempKP(first[i][k],last[j][l],
- kc->offsets[i*kc->second_cnt+j],
- otl->subtables,kc->kcid,isv);
- }
- }
- KCSfree(first,kc->first_cnt);
- KCSfree(last,kc->second_cnt);
- }
-}
-
-int SFFindNotdef(SplineFont *sf, int fixed) {
- int notdefpos = -1, i, width=-1;
- /* If all glyphs have the same known width set fixed to it */
- /* If glyphs are proportional set fixed to -1 */
- /* If we don't know yet, set fixed to -2 */
-
- if ( fixed==-2 ) { /* Unknown */
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sf->glyphs[i]) ) {
- if ( strcmp(sf->glyphs[i]->name,".notdef")==0 ) {
- if ( notdefpos==-1 ) notdefpos = i;
- } else if ( width==-1 )
- width = sf->glyphs[i]->width;
- else if ( width!=sf->glyphs[i]->width )
- width = -2;
- }
- if ( width>=0 && sf->glyphcnt>2 && notdefpos>=0) {
- if ( width!=sf->glyphs[notdefpos]->width ) {
- notdefpos = -1;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sf->glyphs[i]) ) {
- if ( strcmp(sf->glyphs[i]->name,".notdef")==0 &&
- sf->glyphs[i]->width == width ) {
- notdefpos = i;
- break;
- }
- }
- }
- }
- } else if ( fixed>=0 ) { /* Known, fixed width */
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sf->glyphs[i]) ) {
- if ( strcmp(sf->glyphs[i]->name,".notdef")==0 &&
- sf->glyphs[i]->width == fixed )
-return( i );
- }
- } else { /* Known, variable width */
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sf->glyphs[i]) ) {
- if ( strcmp(sf->glyphs[i]->name,".notdef")==0 )
-return( i );
- }
- }
-
-return( notdefpos );
-}
-
-
-#ifdef LUA_FF_LIB
-/* no need for iconv here, since PS is 8-bit legacy */
-#define Isspace(a) ((a)==' '|| ((a) >= '\t' && (a) <= '\r'))
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#define Isalpha(a) (((a)>='a' && (a)<='z') || ((a)>='A' && (a)<='Z'))
-#define Isupper(a) ((a)>='A' && (a)<='Z')
-#define Isalnum(a) (Isalpha(a)||Isdigit(a))
-#define Ishexdigit(a) (((a)>='0' && (a)<='9')||((a)>='a' && (a)<='f')||((a)>='A' && (a)<='F'))
-#else
-#define Isspace isspace
-#define Isdigit isdigit
-#define Isalpha isalpha
-#define Isupper isupper
-#define Isalnum isalnum
-#define Ishexdigit ishexdigit
-#endif
-
-
-
-
-int CheckAfmOfPostscript(SplineFont *sf,char *psname, EncMap *map) {
- char *new, *pt;
- int ret;
- int wasuc=false;
-
- new = galloc(strlen(psname)+6);
- strcpy(new,psname);
- pt = strrchr(new,'.');
- if ( pt==NULL ) pt = new+strlen(new);
- else wasuc = Isupper(pt[1]);
-
- if ( sf->mm!=NULL ) {
- strcpy(pt,wasuc?".AMFM":".amfm");
- if ( !LoadKerningDataFromAmfm(sf,new,map)) {
- strcpy(pt,wasuc?".amfm":".AMFM");
- ret = LoadKerningDataFromAmfm(sf,new,map);
- } else
- ret = true;
- /* The above routine reads from the afm file if one exist */
- } else {
- strcpy(pt,wasuc?".AFM":".afm");
- if ( !LoadKerningDataFromAfm(sf,new,map)) {
- strcpy(pt,wasuc?".afm":".AFM");
- ret = LoadKerningDataFromAfm(sf,new,map);
- } else
- ret = true;
- }
- free(new);
-return( ret );
-}
-
-static void *mygets(FILE *file,char *buffer,int size) {
- char *end = buffer+size-1;
- char *pt = buffer;
- int ch;
-
- while ( (ch=getc(file))!=EOF && ch!='\r' && ch!='\n' && pt<end )
- *pt++ = ch;
- *pt = '\0';
- if ( ch==EOF && pt==buffer )
-return( NULL );
- if ( ch=='\r' ) {
- ch = getc(file);
- if ( ch!='\n' )
- ungetc(ch,file);
- }
-return( buffer );
-}
-
-
-/* ************************************************************************** */
-/* **************************** Reading AFM files *************************** */
-/* ************************************************************************** */
-static void KPInsert( SplineChar *sc1, SplineChar *sc2, int off, int isv ) {
- KernPair *kp;
- int32 script;
-
- if ( sc1!=NULL && sc2!=NULL ) {
- for ( kp=sc1->kerns; kp!=NULL && kp->sc!=sc2; kp = kp->next );
- if ( kp!=NULL )
- kp->off = off;
- else if ( off!=0 ) {
- kp = chunkalloc(sizeof(KernPair));
- kp->sc = sc2;
- kp->off = off;
- script = SCScriptFromUnicode(sc1);
- if ( script==DEFAULT_SCRIPT )
- script = SCScriptFromUnicode(sc2);
- kp->subtable = SFSubTableFindOrMake(sc1->parent,
- isv?CHR('v','k','r','n'):CHR('k','e','r','n'),
- script, gpos_pair);
- if ( isv ) {
- kp->next = sc1->vkerns;
- sc1->vkerns = kp;
- } else {
- kp->next = sc1->kerns;
- sc1->kerns = kp;
- }
- }
- }
-}
-
-int LoadKerningDataFromAfm(SplineFont *sf, char *filename,EncMap *map) {
- FILE *file = fopen(filename,"r");
- char buffer[200], *pt, *ept, ch;
- SplineChar *sc1, *sc2;
- int off, lx, ly, rx, ry;
- char name[44], second[44], lig[44], buf2[100];
- PST *liga;
- double scale = (sf->ascent+sf->descent)/1000.0;
-
- if ( file==NULL )
-return( 0 );
- gwwv_progress_change_line2(_("Reading AFM file"));
- while ( mygets(file,buffer,sizeof(buffer))!=NULL ) {
- if ( strncmp(buffer,"KPX",3)==0 || strncmp(buffer,"KPY",3)==0 ) {
- int isv = strncmp(buffer,"KPY",3)==0;
- for ( pt=buffer+3; Isspace(*pt); ++pt);
- for ( ept = pt; *ept!='\0' && !Isspace(*ept); ++ept );
- ch = *ept; *ept = '\0';
- sc1 = SFGetChar(sf,-1,pt);
- *ept = ch;
- for ( pt=ept; Isspace(*pt); ++pt);
- for ( ept = pt; *ept!='\0' && !Isspace(*ept); ++ept );
- ch = *ept; *ept = '\0';
- sc2 = SFGetChar(sf,-1,pt);
- *ept = ch;
- off = strtol(ept,NULL,10);
- KPInsert(sc1,sc2,rint(off*scale),isv);
- } else if ( buffer[0]=='C' && Isspace(buffer[1])) {
- char *pt;
- sc2 = NULL;
- for ( pt= strchr(buffer,';'); pt!=NULL; pt=strchr(pt+1,';') ) {
- if ( sscanf( pt, "; N %40s", name )==1 )
- sc2 = SFGetChar(sf,-1,name);
- else if ( sc2!=NULL &&
- sscanf( pt, "; B %d %d %d %d", &lx, &ly, &rx, &ry)==4 ) {
- sc2->xmin = lx;
- sc2->ymin = ly;
- sc2->xmax = rx;
- sc2->ymax = ry;
-
- }
- else if ( sc2!=NULL &&
- sscanf( pt, "; L %40s %40s", second, lig)==2 ) {
- sc1 = SFGetChar(sf,-1,lig);
- if ( sc1!=NULL ) {
- sprintf( buf2, "%s %s", name, second);
- for ( liga=sc1->possub; liga!=NULL; liga=liga->next ) {
- if ( liga->type == pst_ligature && strcmp(liga->u.lig.components,buf2)==0 )
- break;
- }
- if ( liga==NULL ) {
- liga = chunkalloc(sizeof(PST));
- liga->subtable = SFSubTableFindOrMake(sf,
- CHR('l','i','g','a'),SCScriptFromUnicode(sc2),
- gsub_ligature);
- liga->subtable->lookup->store_in_afm = true;
- liga->type = pst_ligature;
- liga->next = sc1->possub;
- sc1->possub = liga;
- liga->u.lig.lig = sc1;
- liga->u.lig.components = copy( buf2 );
- }
- }
- }
- }
- }
- }
- fclose(file);
-return( 1 );
-}
-
-static void CheckMMAfmFile(SplineFont *sf,char *amfm_filename,char *fontname,EncMap *map) {
- /* the afm file should be in the same directory as the amfm file */
- /* with the fontname as the filename */
- char *temp, *pt;
-
- free(sf->fontname);
- sf->fontname = copy(fontname);
-
- temp = galloc(strlen(amfm_filename)+strlen(fontname)+strlen(".afm")+1);
- strcpy(temp, amfm_filename);
- pt = strrchr(temp,'/');
- if ( pt==NULL ) pt = temp;
- else ++pt;
- strcpy(pt,fontname);
- pt += strlen(pt);
- strcpy(pt,".afm");
- if ( !LoadKerningDataFromAfm(sf,temp,map) ) {
- strcpy(pt,".AFM");
- LoadKerningDataFromAfm(sf,temp,map);
- }
- free(temp);
-}
-
-int LoadKerningDataFromAmfm(SplineFont *sf, char *filename,EncMap *map) {
- FILE *file=NULL;
- char buffer[280], *pt, lastname[257];
- int index, i;
- MMSet *mm = sf->mm;
-
- if ( mm!=NULL )
- file = fopen(filename,"r");
- pt = strstrmatch(filename,".amfm");
- if ( pt!=NULL ) {
- char *afmname = copy(filename);
- strcpy(afmname+(pt-filename),Isupper(pt[1])?".AFM":".afm");
- LoadKerningDataFromAfm(mm->normal,afmname,map);
- free(afmname);
- }
- if ( file==NULL )
-return( 0 );
-
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_progress_change_line2(_("Reading AFM file"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_change_line2(_("Reading AFM file"));
-#endif
- while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
- if ( strstrmatch(buffer,"StartMaster")!=NULL )
- break;
- }
- index = -1; lastname[0] = '\0';
- while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
- if ( strstrmatch(buffer,"EndMaster")!=NULL ) {
- if ( lastname[0]!='\0' && index!=-1 && index<mm->instance_count )
- CheckMMAfmFile(mm->instances[index],filename,lastname,map);
- index = -1; lastname[0] = '\0';
- } else if ( sscanf(buffer,"FontName %256s", lastname )== 1 ) {
- /* Do Nothing, all done */
- } else if ( (pt = strstr(buffer,"WeightVector"))!=NULL ) {
- pt += strlen("WeightVector");
- while ( *pt==' ' || *pt=='[' ) ++pt;
- i = 0;
- while ( *pt!=']' && *pt!='\0' ) {
- if ( *pt=='0' )
- ++i;
- else if ( *pt=='1' ) {
- index = i;
- break;
- }
- ++pt;
- }
- }
- }
- fclose(file);
-return( true );
-}
-
-
-/* from tottfgpos.c */
-
-#if 0
-static uint32 scripts[][15] = {
-/* Arabic */ { CHR('a','r','a','b'), 0x0600, 0x06ff, 0xfb50, 0xfdff, 0xfe70, 0xfeff },
-/* Aramaic */ { CHR('a','r','a','m'), 0x820, 0x83f },
-/* Armenian */ { CHR('a','r','m','n'), 0x0530, 0x058f, 0xfb13, 0xfb17 },
-/* Balinese */ { CHR('b','a','l','i'), 0x1b00, 0x1b7f },
-/* Bengali */ { CHR('b','e','n','g'), 0x0980, 0x09ff },
-/* Bliss symb */{ CHR('b','l','i','s'), 0x12200, 0x124ff },
-/* Bopomofo */ { CHR('b','o','p','o'), 0x3100, 0x312f, 0x31a0, 0x31bf },
-/* Braille */ { CHR('b','r','a','i'), 0x2800, 0x28ff },
-/* Buginese */ { CHR('b','u','g','i'), 0x1a00, 0x1a1f },
-/* Buhid */ { CHR('b','u','h','d'), 0x1740, 0x1753 },
-/* Byzantine M*/{ CHR('b','y','z','m'), 0x1d000, 0x1d0ff },
-/* Canadian Syl*/{CHR('c','a','n','s'), 0x1400, 0x167f },
-/* Cherokee */ { CHR('c','h','e','r'), 0x13a0, 0x13ff },
-/* Cirth */ { CHR('c','i','r','t'), 0x12080, 0x120ff },
-/* CJKIdeogra */{ CHR('h','a','n','i'), 0x3300, 0x9fff, 0xf900, 0xfaff, 0x020000, 0x02ffff },
-/* Coptic */ { CHR('c','o','p','t'), 0x2c80, 0x2cff },
-/* Cypriot */ { CHR('c','p','m','n'), 0x10800, 0x1083f },
-/* Cyrillic */ { CHR('c','y','r','l'), 0x0400, 0x052f },
-/* Deseret */ { CHR('d','s','r','t'), 0x10400, 0x1044f },
-/* Devanagari */{ CHR('d','e','v','a'), 0x0900, 0x097f },
-/* Ethiopic */ { CHR('e','t','h','i'), 0x1200, 0x139f },
-/* Georgian */ { CHR('g','e','o','r'), 0x1080, 0x10ff },
-/* Glagolitic */{ CHR('g','l','a','g'), 0x1080, 0x10ff },
-/* Gothic */ { CHR('g','o','t','h'), 0x10330, 0x1034a },
-/* Greek */ { CHR('g','r','e','k'), 0x0370, 0x03ff, 0x1f00, 0x1fff },
-/* Gujarati */ { CHR('g','u','j','r'), 0x0a80, 0x0aff },
-/* Gurmukhi */ { CHR('g','u','r','u'), 0x0a00, 0x0a7f },
-/* Hangul */ { CHR('h','a','n','g'), 0xac00, 0xd7af, 0x3130, 0x319f, 0xffa0, 0xff9f },
-/* Hanunoo */ { CHR('h','a','n','o'), 0x1720, 0x1734 },
- /* I'm not sure what the difference is between the 'hang' tag and the 'jamo' */
- /* tag. 'Jamo' is said to be the precomposed forms, but what's 'hang'? */
-/* Hebrew */ { CHR('h','e','b','r'), 0x0590, 0x05ff, 0xfb1e, 0xfb4f },
-#if 0 /* Hiragana used to have its own tag, but has since been merged with katakana */
-/* Hiragana */ { CHR('h','i','r','a'), 0x3040, 0x309f },
-#endif
-/* Hangul Jamo*/{ CHR('j','a','m','o'), 0x1100, 0x11ff, 0x3130, 0x319f, 0xffa0, 0xffdf },
-/* Katakana */ { CHR('k','a','n','a'), 0x3040, 0x30ff, 0xff60, 0xff9f },
-/* Javanese */ { CHR('j','a','v','a'), 0 }, /* MS has a tag, but there is no unicode range */
-/* Khmer */ { CHR('k','h','m','r'), 0x1780, 0x17ff },
-/* Kannada */ { CHR('k','n','d','a'), 0x0c80, 0x0cff },
-/* Kharosthi */ { CHR('k','h','a','r'), 0x10a00, 0x10a5f },
-/* Latin */ { CHR('l','a','t','n'), 0x0041, 0x005a, 0x0061, 0x007a,
- 0x00c0, 0x02af, 0x1d00, 0x1eff, 0xfb00, 0xfb0f, 0xff00, 0xff5f, 0, 0 },
-/* Lao */ { CHR('l','a','o',' '), 0x0e80, 0x0eff },
-/* Limbu */ { CHR('l','i','m','b'), 0x1900, 0x194f },
-/* Linear A */ { CHR('l','i','n','a'), 0x10180, 0x102cf },
-/* Linear B */ { CHR('l','i','n','b'), 0x10000, 0x100fa },
-/* Malayalam */ { CHR('m','l','y','m'), 0x0d00, 0x0d7f },
-/* Mathematical Alphanumeric Symbols */
- { CHR('m','a','t','h'), 0x1d400, 0x1d7ff },
-/* Mongolian */ { CHR('m','o','n','g'), 0x1800, 0x18af },
-/* Musical */ { CHR('m','u','s','i'), 0x1d100, 0x1d1ff },
-/* Myanmar */ { CHR('m','y','m','r'), 0x1000, 0x107f },
-/* N'Ko */ { CHR('n','k','o',' '), 0x07c0, 0x07fa },
-/* Ogham */ { CHR('o','g','a','m'), 0x1680, 0x169f },
-/* Old Italic */{ CHR('i','t','a','l'), 0x10300, 0x1031e },
-/* Old Permic */{ CHR('p','e','r','m'), 0x10350, 0x1037f },
-/* Old Persian cuneiform */
- { CHR('x','p','e','o'), 0x103a0, 0x103df },
-/* Oriya */ { CHR('o','r','y','a'), 0x0b00, 0x0b7f },
-/* Osmanya */ { CHR('o','s','m','a'), 0x10480, 0x104a9 },
-/* Phags-pa */ { CHR('p','h','a','g'), 0xa840, 0xa87f },
-/* Phoenician */{ CHR('p','h','n','x'), 0x10900, 0x1091f },
-/* Pollard */ { CHR('p','l','r','d'), 0x104b0, 0x104d9 },
-/* Runic */ { CHR('r','u','n','r'), 0x16a0, 0x16ff },
-/* Shavian */ { CHR('s','h','a','w'), 0x10450, 0x1047f },
-/* Sinhala */ { CHR('s','i','n','h'), 0x0d80, 0x0dff },
-/* Sumero-Akkadian Cuneiform */
- { CHR('x','s','u','x'), 0x12000, 0x1236e },
-/* Syloti Nagri */
- { CHR('s','y','l','o'), 0xa800, 0xa82f },
-/* Syriac */ { CHR('s','y','r','c'), 0x0700, 0x074f },
-/* Tagalog */ { CHR('t','a','g','l'), 0x1700, 0x1714 },
-/* Tagbanwa */ { CHR('t','a','g','b'), 0x1760, 0x1773 },
-/* Tai Le */ { CHR('t','a','l','e'), 0x1950, 0x1974 },
-/* Tai Lu */ { CHR('t','a','l','u'), 0x1980, 0x19df },
-/* Tamil */ { CHR('t','a','m','l'), 0x0b80, 0x0bff },
-/* Telugu */ { CHR('t','e','l','u'), 0x0c00, 0x0c7f },
-/* Tengwar */ { CHR('t','e','n','g'), 0x12000, 0x1207f },
-/* Thaana */ { CHR('t','h','a','a'), 0x0780, 0x07bf },
-/* Thai */ { CHR('t','h','a','i'), 0x0e00, 0x0e7f },
-/* Tibetan */ { CHR('t','i','b','t'), 0x0f00, 0x0fff },
-/* Tifinagh */ { CHR('t','f','n','g'), 0x2d30, 0x2d7f },
-/* Ugaritic */ { CHR('u','g','a','r'), 0x10380, 0x1039d },
-/* Yi */ { CHR('y','i',' ',' '), 0xa000, 0xa4c6 },
- { 0 }
-};
-
-int ScriptIsRightToLeft(uint32 script) {
- if ( script==CHR('a','r','a','b') || script==CHR('h','e','b','r') ||
- script==CHR('c','p','m','n') || script==CHR('k','h','a','r') ||
- script==CHR('s','y','r','c') || script==CHR('t','h','a','a') ||
- script==CHR('n','k','o',' '))
-return( true );
-
-return( false );
-}
-
-uint32 ScriptFromUnicode(int u,SplineFont *sf) {
- int s, k;
-
- if ( u!=-1 ) {
- for ( s=0; scripts[s][0]!=0; ++s ) {
- for ( k=1; scripts[s][k+1]!=0; k += 2 )
- if ( u>=scripts[s][k] && u<=scripts[s][k+1] )
- break;
- if ( scripts[s][k+1]!=0 )
- break;
- }
- if ( scripts[s][0]!=0 ) {
- extern int use_second_indic_scripts;
- uint32 script = scripts[s][0];
- if ( use_second_indic_scripts ) {
- /* MS has a parallel set of script tags for their new */
- /* Indic font shaper */
- if ( script == CHR('b','e','n','g' )) script = CHR('b','n','g','2');
- else if ( script == CHR('d','e','v','a' )) script = CHR('d','e','v','2');
- else if ( script == CHR('g','u','j','r' )) script = CHR('g','j','r','2');
- else if ( script == CHR('g','u','r','u' )) script = CHR('g','u','r','2');
- else if ( script == CHR('k','n','d','a' )) script = CHR('k','n','d','2');
- else if ( script == CHR('m','l','y','m' )) script = CHR('m','l','y','2');
- else if ( script == CHR('o','r','y','a' )) script = CHR('o','r','y','2');
- else if ( script == CHR('t','a','m','l' )) script = CHR('t','m','l','2');
- else if ( script == CHR('t','e','l','u' )) script = CHR('t','e','l','2');
- }
-return( script );
- }
- } else if ( sf!=NULL ) {
- if ( sf->cidmaster!=NULL || sf->subfontcnt!=0 ) {
- if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
- if ( strmatch(sf->ordering,"Identity")==0 )
-return( DEFAULT_SCRIPT );
- else if ( strmatch(sf->ordering,"Korean")==0 )
-return( CHR('h','a','n','g'));
- else
-return( CHR('h','a','n','i') );
- }
- }
-
-return( DEFAULT_SCRIPT );
-}
-
-uint32 SCScriptFromUnicode(SplineChar *sc) {
- char *pt;
- PST *pst;
- SplineFont *sf;
- int i; unsigned uni;
- FeatureScriptLangList *features;
-
- if ( sc==NULL )
-return( DEFAULT_SCRIPT );
-
- sf = sc->parent;
- if ( sc->unicodeenc!=-1 )
-return( ScriptFromUnicode( sc->unicodeenc,sf ));
-
- pt = sc->name;
- if ( *pt ) for ( ++pt; *pt!='\0' && *pt!='_' && *pt!='.'; ++pt );
- if ( *pt!='\0' ) {
- char *str = copyn(sc->name,pt-sc->name);
- int uni = sf==NULL || sf->fv==NULL ? UniFromName(str,ui_none,&custom) :
- UniFromName(str,sf->uni_interp,sf->fv->map->enc);
- free(str);
- if ( uni!=-1 )
-return( ScriptFromUnicode( uni,sf ));
- }
- /* Adobe ligature uniXXXXXXXX */
- if ( strncmp(sc->name,"uni",3)==0 && sscanf(sc->name+3,"%4x", &uni)==1 )
-return( ScriptFromUnicode( uni,sf ));
-
- if ( sf==NULL )
-return( DEFAULT_SCRIPT );
-
- if ( sf->cidmaster ) sf=sf->cidmaster;
- else if ( sf->mm!=NULL ) sf=sf->mm->normal;
- for ( i=0; i<2; ++i ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_lcaret )
- continue;
- for ( features = pst->subtable->lookup->features; features!=NULL; features=features->next ) {
- if ( features->scripts!=NULL )
-return( features->scripts->script );
- }
- }
- }
-return( ScriptFromUnicode( sc->unicodeenc,sf ));
-}
-
-SplineChar **SFGlyphsFromNames(SplineFont *sf,char *names) {
- int cnt, ch;
- char *pt, *end;
- SplineChar *sc, **glyphs;
-
- cnt = 0;
- for ( pt = names; *pt; pt = end+1 ) {
- ++cnt;
- end = strchr(pt,' ');
- if ( end==NULL )
- break;
- }
-
- glyphs = galloc((cnt+1)*sizeof(SplineChar *));
- cnt = 0;
- for ( pt = names; *pt; pt = end+1 ) {
- end = strchr(pt,' ');
- if ( end==NULL )
- end = pt+strlen(pt);
- ch = *end;
- *end = '\0';
- sc = SFGetChar(sf,-1,pt);
- if ( sc!=NULL && sc->ttf_glyph!=-1 )
- glyphs[cnt++] = sc;
- *end = ch;
- if ( ch=='\0' )
- break;
- }
- glyphs[cnt] = NULL;
-return( glyphs );
-}
-int gdefclass(SplineChar *sc) {
- PST *pst;
- AnchorPoint *ap;
-
- if ( sc->glyph_class!=0 )
-return( sc->glyph_class-1 );
-
- if ( strcmp(sc->name,".notdef")==0 )
-return( 0 );
-
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_ligature )
-return( 2 ); /* Ligature */
- }
-
- ap=sc->anchor;
- while ( ap!=NULL && (ap->type==at_centry || ap->type==at_cexit) )
- ap = ap->next;
- if ( ap!=NULL && (ap->type==at_mark || ap->type==at_basemark) )
-return( 3 );
- else
-return( 1 );
- /* I not quite sure what a componant glyph is. Probably something that */
- /* is not in the cmap table and is referenced in other glyphs */
- /* Anyway I never return class 4 */ /* (I've never seen it used by others) */
-}
-
-#endif /* tottfgpos.c */
-
-/* from charinfo.c */
-
-
-static int MultipleValues(char *name, int local) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes"); buts[1]=_("_No"); buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_CANCEL, NULL };
-#endif
- if ( gwwv_ask(_("Multiple"),(const char **) buts,0,1,_("There is already a glyph with this Unicode encoding\n(named %1$.40s, at local encoding %2$d).\nIs that what you want?"),name,local)==0 )
-return( true );
-#endif
-return( false );
-}
-
-static int MultipleNames(void) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-#if defined(FONTFORGE_CONFIG_GDRAW)
- char *buts[3];
- buts[0] = _("_Yes"); buts[1]=_("_Cancel"); buts[2] = NULL;
-#elif defined(FONTFORGE_CONFIG_GTK)
- static char *buts[] = { GTK_STOCK_YES, GTK_STOCK_CANCEL, NULL };
-#endif
- if ( gwwv_ask(_("Multiple"),(const char **) buts,0,1,_("There is already a glyph with this name,\ndo you want to swap names?"))==0 )
-return( true );
-#endif
-return( false );
-}
-
-int SCSetMetaData(SplineChar *sc,char *name,int unienc,const char *comment) {
- SplineFont *sf = sc->parent;
- int i, mv=0;
- int isnotdef, samename=false;
- struct altuni *alt;
-
- for ( alt=sc->altuni; alt!=NULL && alt->unienc!=unienc; alt=alt->next );
- if ( (sc->unicodeenc == unienc || alt!=NULL ) && strcmp(name,sc->name)==0 ) {
- samename = true; /* No change, it must be good */
- }
- if ( alt!=NULL || !samename ) {
- isnotdef = strcmp(name,".notdef")==0;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL && sf->glyphs[i]!=sc ) {
- if ( unienc!=-1 && sf->glyphs[i]->unicodeenc==unienc ) {
- if ( !mv && !MultipleValues(sf->glyphs[i]->name,i)) {
-return( false );
- }
- mv = 1;
- } else if ( !isnotdef && strcmp(name,sf->glyphs[i]->name)==0 ) {
- if ( !MultipleNames()) {
-return( false );
- }
- free(sf->glyphs[i]->name);
- sf->glyphs[i]->namechanged = true;
- if ( strncmp(sc->name,"uni",3)==0 && sf->glyphs[i]->unicodeenc!=-1) {
- char buffer[12];
- if ( sf->glyphs[i]->unicodeenc<0x10000 )
- sprintf( buffer,"uni%04X", sf->glyphs[i]->unicodeenc);
- else
- sprintf( buffer,"u%04X", sf->glyphs[i]->unicodeenc);
- sf->glyphs[i]->name = copy(buffer);
- } else {
- sf->glyphs[i]->name = sc->name;
- sc->name = NULL;
- }
- break;
- }
- }
- if ( sc->unicodeenc!=unienc ) {
- struct splinecharlist *scl;
- int layer;
- RefChar *ref;
-
- for ( scl=sc->dependents; scl!=NULL; scl=scl->next ) {
- for ( layer=ly_fore; layer<scl->sc->layer_cnt; ++layer )
- for ( ref = scl->sc->layers[layer].refs; ref!=NULL; ref=ref->next )
- if ( ref->sc==sc )
- ref->unicode_enc = unienc;
- }
- }
- }
- if ( alt!=NULL )
- alt->unienc = sc->unicodeenc;
- sc->unicodeenc = unienc;
- if ( sc->name==NULL || strcmp(name,sc->name)!=0 ) {
- free(sc->name);
- sc->name = copy(name);
- sc->namechanged = true;
- GlyphHashFree(sf);
- }
- sf->changed = true;
- if ( unienc>=0xe000 && unienc<=0xf8ff )
- /* Ok to name things in the private use area */;
- else if ( samename )
- /* Ok to name it itself */;
- else {
- FontView *fvs;
- for ( fvs=sf->fv; fvs!=NULL; fvs=fvs->nextsame ) {
- int enc = fvs->map->backmap[sc->orig_pos];
- if ( enc!=-1 && ((fvs->map->enc->only_1byte && enc<256) ||
- (fvs->map->enc->has_2byte && enc<65535 ))) {
- fvs->map->enc = &custom;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVSetTitle(fvs);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
- }
- }
- free(sc->comment); sc->comment = NULL;
- if ( comment!=NULL && *comment!='\0' )
- sc->comment = copy(comment);
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCRefreshTitles(sc);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-return( true );
-}
-
-/* from cvhints.c */
-
-void SCClearRounds(SplineChar *sc) {
- SplineSet *ss;
- SplinePoint *sp;
-
- for ( ss=sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
- for ( sp=ss->first; ; ) {
- sp->roundx = sp->roundy = false;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- }
-}
-
-
-/* from cvpointer.c */
-
-RefChar *HasUseMyMetrics(SplineChar *sc) {
- RefChar *r;
-
- for ( r=sc->layers[ly_fore].refs; r!=NULL; r=r->next )
- if ( r->use_my_metrics )
-return( r );
-
-return( NULL );
-}
-
-/* if they changed the width, then change the width on all bitmap chars of */
-/* ours, and if we are a letter, then change the width on all chars linked */
-/* to us which had the same width that we used to have (so if we change the */
-/* width of A, we'll also change that of À and Ä and ... */
-void SCSynchronizeWidth(SplineChar *sc,real newwidth, real oldwidth, FontView *flagfv) {
- BDFFont *bdf;
- struct splinecharlist *dlist;
- FontView *fv = sc->parent->fv;
- RefChar *r = HasUseMyMetrics(sc);
- int isprobablybase;
-
- sc->widthset = true;
- if( r!=NULL ) {
- if ( oldwidth==r->sc->width ) {
- sc->width = r->sc->width;
-return;
- }
- newwidth = r->sc->width;
- }
- if ( newwidth==oldwidth )
-return;
- sc->width = newwidth;
- for ( bdf=sc->parent->bitmaps; bdf!=NULL; bdf=bdf->next ) {
- BDFChar *bc = bdf->glyphs[sc->orig_pos];
- if ( bc!=NULL ) {
- int width = rint(sc->width*bdf->pixelsize / (real) (sc->parent->ascent+sc->parent->descent));
- if ( bc->width!=width ) {
- /*BCPreserveWidth(bc);*/ /* Bitmaps can't set width, so no undo for it */
- bc->width = width;
- BCCharChangedUpdate(bc);
- }
- }
- }
-
- if ( !adjustwidth )
-return;
-
- isprobablybase = true;
- if ( sc->unicodeenc==-1 || sc->unicodeenc>=0x10000 ||
- !unic_isalpha(sc->unicodeenc) || unic_iscombining(sc->unicodeenc))
- isprobablybase = false;
-
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next ) {
- RefChar *metrics = HasUseMyMetrics(dlist->sc);
- if ( metrics!=NULL && metrics->sc!=sc )
- continue;
- else if ( metrics==NULL && !isprobablybase )
- continue;
- if ( dlist->sc->width==oldwidth &&
- (flagfv==NULL || !flagfv->selected[flagfv->map->backmap[dlist->sc->orig_pos]])) {
- SCSynchronizeWidth(dlist->sc,newwidth,oldwidth,fv);
- if ( !dlist->sc->changed ) {
- dlist->sc->changed = true;
- if ( fv!=NULL )
- FVToggleCharChanged(dlist->sc);
- }
- SCUpdateAll(dlist->sc);
- }
- }
-}
-
-
-/* If they change the left bearing of a character, then in all chars */
-/* that depend on it should be adjusted too. */
-/* Also all vstem hints */
-/* I deliberately don't set undoes in the dependants. The change is not */
-/* in them, after all */
-void SCSynchronizeLBearing(SplineChar *sc,real off) {
- struct splinecharlist *dlist;
- RefChar *ref;
- DStemInfo *d;
- StemInfo *h;
- HintInstance *hi;
- int isprobablybase;
-
- for ( h=sc->vstem; h !=NULL; h=h->next )
- h->start += off;
- for ( h=sc->hstem; h !=NULL; h=h->next )
- for ( hi = h->where; hi!=NULL; hi=hi->next ) {
- hi->begin += off;
- hi->end += off;
- }
- for ( d=sc->dstem; d !=NULL; d=d->next ) {
- d->leftedgetop.x += off;
- d->rightedgetop.x += off;
- d->leftedgebottom.x += off;
- d->rightedgebottom.x += off;
- }
-
- if ( !adjustlbearing )
-return;
-
- isprobablybase = true;
- if ( sc->unicodeenc==-1 || sc->unicodeenc>=0x10000 ||
- !unic_isalpha(sc->unicodeenc) || unic_iscombining(sc->unicodeenc))
- isprobablybase = false;
-
- for ( dlist=sc->dependents; dlist!=NULL; dlist=dlist->next ) {
- RefChar *metrics = HasUseMyMetrics(dlist->sc);
- if ( metrics!=NULL && metrics->sc!=sc )
- continue;
- else if ( metrics==NULL && !isprobablybase )
- continue;
- else if ( metrics==NULL && sc->width!=dlist->sc->width )
- continue;
- SCPreserveState(dlist->sc,false);
- SplinePointListShift(dlist->sc->layers[ly_fore].splines,off,true);
- for ( ref = dlist->sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next )
- if ( ref->sc!=sc ) {
- SplinePointListShift(ref->layers[0].splines,off,true);
- ref->transform[4] += off;
- ref->bb.minx += off; ref->bb.maxx += off;
- }
- SCUpdateAll(dlist->sc);
- SCSynchronizeLBearing(dlist->sc,off);
- }
-}
-
-
-/* from cvgetinfo.c */
-
-void MDReplace(MinimumDistance *md,SplineSet *old,SplineSet *rpl) {
- /* Replace all the old points with the ones in rpl in the minimum distance hints */
- SplinePoint *osp, *rsp;
- MinimumDistance *test;
-
- if ( md==NULL )
-return;
-
- while ( old!=NULL && rpl!=NULL ) {
- osp = old->first; rsp = rpl->first;
- while ( 1 ) {
- for ( test=md; test!=NULL ; test=test->next ) {
- if ( test->sp1==osp )
- test->sp1 = rsp;
- if ( test->sp2==osp )
- test->sp2 = rsp;
- }
- if ( osp->next==NULL || rsp->next==NULL )
- break;
- osp = osp->next->to;
- rsp = rsp->next->to;
- if ( osp==old->first )
- break;
- }
- old = old->next;
- rpl = rpl->next;
- }
-}
-
-void SCOrderAP(SplineChar *sc) {
- int lc=0, cnt=0, out=false, i,j;
- AnchorPoint *ap, **array;
- /* Order so that first ligature index comes first */
-
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->lig_index<lc ) out = true;
- if ( ap->lig_index>lc ) lc = ap->lig_index;
- ++cnt;
- }
- if ( !out )
-return;
-
- array = galloc(cnt*sizeof(AnchorPoint *));
- for ( i=0, ap=sc->anchor; ap!=NULL; ++i, ap=ap->next )
- array[i] = ap;
- for ( i=0; i<cnt-1; ++i ) {
- for ( j=i+1; j<cnt; ++j ) {
- if ( array[i]->lig_index>array[j]->lig_index ) {
- ap = array[i];
- array[i] = array[j];
- array[j] = ap;
- }
- }
- }
- sc->anchor = array[0];
- for ( i=0; i<cnt-1; ++i )
- array[i]->next = array[i+1];
- array[cnt-1]->next = NULL;
- free( array );
-}
-
-/* autowidth.c */
-
-#define NOTREACHED -9999.0
-
-static real SplineFindMinXAtY(Spline *spline,real y,real min) {
- extended t,t1,t2,tbase,val;
- Spline1D *xsp;
-
- if ( y>spline->from->me.y && y>spline->from->nextcp.y &&
- y>spline->to->me.y && y>spline->to->prevcp.y )
-return( min );
- if ( y<spline->from->me.y && y<spline->from->nextcp.y &&
- y<spline->to->me.y && y<spline->to->prevcp.y )
-return( min );
- if ( min!=NOTREACHED ) {
- if ( min<=spline->from->me.x && min<=spline->from->nextcp.x &&
- min<=spline->to->me.x && min<=spline->to->prevcp.x )
-return( min );
- }
-
- xsp = &spline->splines[0];
- SplineFindExtrema(&spline->splines[1], &t1, &t2 );
- tbase = 0;
- if ( t1!=-1 ) {
- t = SplineSolve(&spline->splines[1],0,t1,y,.01);
- if ( t>=0 && t<=1 ) {
- val = ((xsp->a*t+xsp->b)*t+xsp->c)*t + xsp->d;
- if ( min==NOTREACHED || val<min )
- min = val;
- }
- tbase = t1;
- }
- if ( t2!=-1 ) {
- t = SplineSolve(&spline->splines[1],tbase,t2,y,.01);
- if ( t>=0 && t<=1 ) {
- val = ((xsp->a*t+xsp->b)*t+xsp->c)*t + xsp->d;
- if ( min==NOTREACHED || val<min )
- min = val;
- }
- tbase = t2;
- }
- t = SplineSolve(&spline->splines[1],tbase,1.0,y,.01);
- if ( t>=0 && t<=1 ) {
- val = ((xsp->a*t+xsp->b)*t+xsp->c)*t + xsp->d;
- if ( min==NOTREACHED || val<min )
- min = val;
- }
-return( min );
-}
-
-
-static real SSFindMinXAtY(SplineSet *spl,real y,real min) {
- Spline *sp, *first;
-
- while ( spl!=NULL ) {
- first = NULL;
- for ( sp = spl->first->next; sp!=NULL && sp!=first; sp = sp->to->next ) {
- min = SplineFindMinXAtY(sp,y,min);
- if ( first==NULL ) first = sp;
- }
- spl = spl->next;
- }
-return( min );
-}
-
-static real SCFindMinXAtY(SplineChar *sc,real y) {
- real min = NOTREACHED;
- RefChar *ref;
-
- min = SSFindMinXAtY(sc->layers[ly_fore].splines,y,NOTREACHED);
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next )
- min = SSFindMinXAtY(ref->layers[0].splines,y,min);
-return( min );
-}
-
-
-real SFGuessItalicAngle(SplineFont *sf) {
- static char *easyserif = "IBDEFHKLNPR";
- int i,si;
- real as, topx, bottomx;
- DBounds bb;
- double angle;
-
- for ( i=0; easyserif[i]!='\0'; ++i )
- if ( (si=SFFindExistingSlot(sf,easyserif[i],NULL))!=-1 && sf->glyphs[si]!=NULL )
- break;
- if ( easyserif[i]=='\0' ) /* can't guess */
-return( 0 );
-
- SplineCharFindBounds(sf->glyphs[si],&bb);
- as = bb.maxy-bb.miny;
-
- topx = SCFindMinXAtY(sf->glyphs[si],2*as/3+bb.miny);
- bottomx = SCFindMinXAtY(sf->glyphs[si],as/3+bb.miny);
- if ( topx==bottomx )
-return( 0 );
-
- angle = atan2(as/3,topx-bottomx)*180/3.1415926535897932-90;
- if ( angle<1 && angle>-1 ) angle = 0;
-return( angle );
-}
-
-
-/* from uiutil.c */
-
-void IError(const char *format,...) {
- char *newf;
- va_list ap;
- const char *ierr = "Internal Error: ";
- va_start(ap,format);
- newf = malloc(strlen(format)+strlen(ierr)+1);
- if (newf==NULL) {
- perror("memory allocation failed");
- exit(EXIT_FAILURE);
- }
- sprintf(newf,"%s%s",ierr,format);
- _gwwv_post_error(newf,ap);
- va_end(ap);
-}
-
-void LogError(const char *format,...) {
- va_list ap;
- va_start(ap,format);
- _gwwv_post_error(format,ap);
- va_end(ap);
-}
-
-void ff_post_notice(const char *title,const char *statement,...) {
- char *newf;
- va_list ap;
- va_start(ap,statement);
- newf = malloc(strlen(statement)+strlen(title)+3);
- if (newf==NULL) {
- perror("memory allocation failed");
- exit(EXIT_FAILURE);
- }
- sprintf(newf,"%s: %s",title,statement);
- _gwwv_post_error(newf,ap);
- va_end(ap);
-}
-
-
-/* from statemachine.c */
-
-
-typedef struct statemachinedlg {
- int state_cnt, class_cnt, index;
- struct asm_state *states;
- ASM *sm;
- SplineFont *sf;
- struct gfi_data *d;
- int isnew;
- int fh, as;
- int stateh, statew;
- int xstart, ystart; /* This is where the headers start */
- int xstart2, ystart2; /* This is where the data start */
- int width, height;
- int offleft, offtop;
- int canceldrop, sbdrop;
- int isedit;
- int st_pos;
- int edit_done, edit_ok;
-} SMD;
-
-
-SMD *StateMachineEdit(SplineFont *sf,ASM *sm,struct gfi_data *d) {
- /* complete. but prepocessed */
- SMD *smd = gcalloc(1,sizeof(SMD));
-return( smd );
-}
-
-/* from fvcomposite.c */
-
-#define BottomAccent 0x300
-#define TopAccent 0x345
-
-
-/* for accents between 0x300 and 345 these are some synonyms */
-/* type1 wants accented chars built with accents in the 0x2c? range */
-/* except for grave and acute which live in iso8859-1 range */
-/* this table is ordered on a best try basis */
-static const unichar_t accents[][4] = {
- { 0x2cb, 0x300, 0x60 }, /* grave */
- { 0x2ca, 0x301, 0xb4 }, /* acute */
- { 0x2c6, 0x302, 0x5e }, /* circumflex */
- { 0x2dc, 0x303, 0x7e }, /* tilde */
- { 0x2c9, 0x304, 0xaf }, /* macron */
- { 0x305, 0xaf }, /* overline, (macron is suggested as a syn, but it's not quite right) */
- { 0x2d8, 0x306 }, /* breve */
- { 0x2d9, 0x307, '.' }, /* dot above */
- { 0xa8, 0x308 }, /* diaeresis */
- { 0x2c0 }, /* hook above */
- { 0x2da, 0xb0 }, /* ring above */
- { 0x2dd }, /* real acute */
- { 0x2c7 }, /* caron */
- { 0x2c8, 0x384, 0x30d, '\'' }, /* vertical line, tonos */
- { 0x30e, '"' }, /* real vertical line */
- { 0 }, /* real grave */
- { 0 }, /* cand... */ /* 310 */
- { 0 }, /* inverted breve */
- { 0x2bb }, /* turned comma */
- { 0x2bc, 0x313, ',' }, /* comma above */
- { 0x2bd }, /* reversed comma */
- { 0x2bc, 0x315, ',' }, /* comma above right */
- { 0x316, 0x60, 0x2cb }, /* grave below */
- { 0x317, 0xb4, 0x2ca }, /* acute below */
- { 0 }, /* left tack */
- { 0 }, /* right tack */
- { 0 }, /* left angle */
- { 0 }, /* horn, sometimes comma but only if nothing better */
- { 0 }, /* half ring */
- { 0x2d4 }, /* up tack */
- { 0x2d5 }, /* down tack */
- { 0x2d6, 0x31f, '+' }, /* plus below */
- { 0x2d7, 0x320, '-' }, /* minus below */ /* 320 */
- { 0x2b2 }, /* hook */
- { 0 }, /* back hook */
- { 0x323, 0x2d9, '.' }, /* dot below */
- { 0x324, 0xa8 }, /* diaeresis below */
- { 0x325, 0x2da, 0xb0 }, /* ring below */
- { 0x326, 0x2bc, ',' }, /* comma below */
- { 0xb8 }, /* cedilla */
- { 0x2db }, /* ogonek */ /* 0x328 */
- { 0x329, 0x2c8, 0x384, '\'' }, /* vertical line below */
- { 0 }, /* bridge below */
- { 0 }, /* real arch below */
- { 0x32c, 0x2c7 }, /* caron below */
- { 0x32d, 0x2c6, 0x52 }, /* circumflex below */
- { 0x32e, 0x2d8 }, /* breve below */
- { 0 }, /* inverted breve below */
- { 0x330, 0x2dc, 0x7e }, /* tilde below */ /* 0x330 */
- { 0x331, 0xaf, 0x2c9 }, /* macron below */
- { 0x332, '_' }, /* low line */
- { 0 }, /* real low line */
- { 0x334, 0x2dc, 0x7e }, /* tilde overstrike */
- { 0x335, '-' }, /* line overstrike */
- { 0x336, '_' }, /* long line overstrike */
- { 0x337, '/' }, /* short solidus overstrike */
- { 0x338, '/' }, /* long solidus overstrike */ /* 0x338 */
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0 },
- { 0x340, 0x60, 0x2cb }, /* tone mark, left of circumflex */ /* 0x340 */
- { 0x341, 0xb4, 0x2ca }, /* tone mark, right of circumflex */
- { 0x342, 0x2dc, 0x7e }, /* perispomeni (tilde) */
- { 0x343, 0x2bc, ',' }, /* koronis */
- { 0 }, /* dialytika tonos (two accents) */
- { 0x37a }, /* ypogegrammeni */
- { 0xffff }
-};
-
-int CanonicalCombiner(int uni) {
- /* Translate spacing accents to combiners */
- int j,k;
-
- /* The above table will use these occasionally, but we don't want to */
- /* translate them. They aren't accents */
- if ( uni==',' || uni=='\'' || uni=='"' || uni=='~' || uni=='^' || uni=='-' ||
- uni=='+' || uni=='.' )
-return( uni );
-
- for ( j=0; accents[j][0]!=0xffff; ++j ) {
- for ( k=0; k<4; ++k ) {
- if ( uni==accents[j][k] ) {
- uni = 0x300+j;
- break;
- }
- }
- if ( uni>=0x300 && uni<0x370 )
- break;
- }
-return( uni );
-}
-
-/* from cvundoes.c */
-
-int maxundoes=0;
-
-void UndoesFree(Undoes *undo) { }
-
-Undoes *SCPreserveState(SplineChar *sc,int dohints) { return NULL; }
-Undoes *BCPreserveState(BDFChar *bc) { return NULL; }
-Undoes *SCPreserveBackground(SplineChar *sc) { return NULL;}
-Undoes *SFPreserveGuide(SplineFont *sf) { return NULL; }
-Undoes *SCPreserveLayer(SplineChar *sc,int layer, int dohints) { return NULL; }
-
-void SCUndoSetLBearingChange(SplineChar *sc,int lbc) {}
-void PasteAnchorClassMerge(SplineFont *sf,AnchorClass *into,AnchorClass *from) {}
-void PasteRemoveSFAnchors(SplineFont *sf) {}
-void PasteRemoveAnchorClass(SplineFont *sf,AnchorClass *dying) {}
-void CopyBufferClearCopiedFrom(SplineFont *dying) { }
-void PasteIntoFV(FontView *fv,int pasteinto,real trans[6]) { }
-
-RefChar *CopyContainsRef(SplineFont *sf) { return NULL; }
-
-int getAdobeEnc(char *name) {
- extern char *AdobeStandardEncoding[256];
- int i;
-
- for ( i=0; i<256; ++i )
- if ( strcmp(name,AdobeStandardEncoding[i])==0 )
- break;
- if ( i==256 ) i = -1;
-return( i );
-}
-
-
-/* stubs from bvedit.c */
-
-void BCTrans(BDFFont *bdf,BDFChar *bc,BVTFunc *bvts,FontView *fv ) {
-}
-void BDFCharFindBounds(BDFChar *bc,IBounds *bb) {
-}
-void BCFlattenFloat(BDFChar *bc ) {
-}
-
-/* from combinations.c */
-
-
-int PSTContains(const char *components,const char *name) {
- const char *pt;
- int len = strlen(name);
-
- for ( pt = strstr(components,name); pt!=NULL; pt = strstr(pt+len,name)) {
- if (( pt==components || pt[-1]==' ') && (pt[len]==' ' || pt[len]=='\0'))
-return( true );
- }
-return( false );
-}
-
-
-/* from mm.c (the stuff needed for Apple MM support) */
-
-
-char *MMAxisAbrev(char *axis_name) {
- if ( strcmp(axis_name,"Weight")==0 )
-return( "wt" );
- if ( strcmp(axis_name,"Width")==0 )
-return( "wd" );
- if ( strcmp(axis_name,"OpticalSize")==0 )
-return( "op" );
- if ( strcmp(axis_name,"Slant")==0 )
-return( "sl" );
-
-return( axis_name );
-}
-
-static double MMAxisUnmap(MMSet *mm,int axis,double ncv) {
- struct axismap *axismap = &mm->axismaps[axis];
- int j;
-
- if ( ncv<=axismap->blends[0] )
-return(axismap->designs[0]);
-
- for ( j=1; j<axismap->points; ++j ) {
- if ( ncv<=axismap->blends[j]) {
- double t = (ncv-axismap->blends[j-1])/(axismap->blends[j]-axismap->blends[j-1]);
-return( axismap->designs[j-1]+ t*(axismap->designs[j]-axismap->designs[j-1]) );
- }
- }
-
-return(axismap->designs[axismap->points-1]);
-}
-
-
-
-static char *_MMMakeFontname(MMSet *mm,real *normalized,char **fullname) {
- char *pt, *pt2, *hyphen=NULL;
- char *ret = NULL;
- int i,j;
-
- if ( mm->apple ) {
- for ( i=0; i<mm->named_instance_count; ++i ) {
- for ( j=0; j<mm->axis_count; ++j ) {
- if (( normalized[j] == -1 &&
- RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].min) ) ||
- ( normalized[j] == 0 &&
- RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].def) ) ||
- ( normalized[j] == 1 &&
- RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].max) ))
- /* A match so far */;
- else
- break;
- }
- if ( j==mm->axis_count )
- break;
- }
- if ( i!=mm->named_instance_count ) {
- char *styles = PickNameFromMacName(mm->named_instances[i].names);
- if ( styles==NULL )
- styles = FindEnglishNameInMacName(mm->named_instances[i].names);
- if ( styles!=NULL ) {
- ret = galloc(strlen(mm->normal->familyname)+ strlen(styles)+3 );
- strcpy(ret,mm->normal->familyname);
- hyphen = ret+strlen(ret);
- strcpy(hyphen," ");
- strcpy(hyphen+1,styles);
- free(styles);
- }
- }
- }
-
- if ( ret==NULL ) {
- pt = ret = galloc(strlen(mm->normal->familyname)+ mm->axis_count*15 + 1);
- strcpy(pt,mm->normal->familyname);
- pt += strlen(pt);
- *pt++ = '_';
- for ( i=0; i<mm->axis_count; ++i ) {
- if ( !mm->apple )
- sprintf( pt, " %d%s", (int) rint(MMAxisUnmap(mm,i,normalized[i])),
- MMAxisAbrev(mm->axes[i]));
- else
- sprintf( pt, " %.1f%s", MMAxisUnmap(mm,i,normalized[i]),
- MMAxisAbrev(mm->axes[i]));
- pt += strlen(pt);
- }
- if ( pt>ret && pt[-1]==' ' )
- --pt;
- *pt = '\0';
- }
-
- *fullname = ret;
-
- ret = copy(ret);
- for ( pt=*fullname, pt2=ret; *pt!='\0'; ++pt )
- if ( pt==hyphen )
- *pt2++ = '-';
- else if ( *pt!=' ' )
- *pt2++ = *pt;
- *pt2 = '\0';
-return( ret );
-}
-
-char *MMMakeMasterFontname(MMSet *mm,int ipos,char **fullname) {
-return( _MMMakeFontname(mm,&mm->positions[ipos*mm->axis_count],fullname));
-}
-
-/* from splinesaveafm.c */
-
-
-void SFLigatureCleanup(SplineFont *sf) {
- LigList *l, *next;
- struct splinecharlist *scl, *sclnext;
- int j;
-
- for ( j=0; j<sf->glyphcnt; ++j ) if ( sf->glyphs[j]!=NULL ) {
- for ( l = sf->glyphs[j]->ligofme; l!=NULL; l = next ) {
- next = l->next;
- for ( scl = l->components; scl!=NULL; scl = sclnext ) {
- sclnext = scl->next;
- chunkfree(scl,sizeof(struct splinecharlist));
- }
- if ( l->lig->temporary ) {
- free(l->lig->u.lig.components);
- chunkfree(l->lig,sizeof(PST));
- }
- free( l );
- }
- sf->glyphs[j]->ligofme = NULL;
- }
-}
-
-
-void SFLigaturePrepare(SplineFont *sf) {
- PST *lig;
- LigList *ll;
- int i,j,k,ch;
- char *pt, *ligstart;
- SplineChar *sc, *tsc;
- struct splinecharlist *head, *last;
- int ccnt, lcnt, lmax=20;
- LigList **all = galloc(lmax*sizeof(LigList *));
- ccnt = 0; /* for -Wall */
- /* First clear out any old stuff */
- for ( j=0; j<sf->glyphcnt; ++j ) if ( sf->glyphs[j]!=NULL )
- sf->glyphs[j]->ligofme = NULL;
-
- /* Attach all the ligatures to the first character of their components */
- /* Figure out what the components are, and if they all exist */
- /* we're only interested in the lig if all components are worth outputting */
- for ( i=0 ; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sf->glyphs[i]) && sf->glyphs[i]->possub!=NULL ) {
- for ( lig = sf->glyphs[i]->possub; lig!=NULL; lig=lig->next ) if ( lig->type==pst_ligature ) {
- ligstart = lig->u.lig.components;
- last = head = NULL; sc = NULL;
- for ( pt = ligstart; *pt!='\0'; ) {
- char *start = pt;
- for ( ; *pt!='\0' && *pt!=' '; ++pt );
- ch = *pt; *pt = '\0';
- tsc = SFGetChar(sf,-1,start);
- *pt = ch;
- if ( tsc!=NULL ) {
- if ( !SCWorthOutputting(tsc)) {
- sc = NULL;
- break;
- }
- if ( sc==NULL ) {
- sc = tsc;
- ccnt = 1;
- } else {
- struct splinecharlist *cur = chunkalloc(sizeof(struct splinecharlist));
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- cur->sc = tsc;
- cur->next = NULL;
- ++ccnt;
- }
- } else {
- sc = NULL;
- break;
- }
- while ( *pt==' ' ) ++pt;
- }
- if ( sc!=NULL ) {
- ll = galloc(sizeof(LigList));
- ll->lig = lig;
- ll->next = sc->ligofme;
- ll->first = sc;
- ll->components = head;
- ll->ccnt = ccnt;
- sc->ligofme = ll;
- } else {
- while ( head!=NULL ) {
- last = head->next;
- chunkfree(head,sizeof(*head));
- head = last;
- }
- }
- }
- }
- for ( i=0 ; i<sf->glyphcnt; ++i ) if ( (sc=sf->glyphs[i])!=NULL && sc->ligofme!=NULL ) {
- for ( ll=sc->ligofme, lcnt=0; ll!=NULL; ll=ll->next, ++lcnt );
- /* Finally, order the list so that the longest ligatures are first */
- if ( lcnt>1 ) {
- if ( lcnt>=lmax )
- all = grealloc(all,(lmax=lcnt+30)*sizeof(LigList *));
- for ( ll=sc->ligofme, k=0; ll!=NULL; ll=ll->next, ++k )
- all[k] = ll;
- for ( k=0; k<lcnt-1; ++k ) for ( j=k+1; j<lcnt; ++j )
- if ( all[k]->ccnt<all[j]->ccnt ) {
- ll = all[k];
- all[k] = all[j];
- all[j] = ll;
- }
- sc->ligofme = all[0];
- for ( k=0; k<lcnt-1; ++k )
- all[k]->next = all[k+1];
- all[k]->next = NULL;
- }
- }
- free( all );
-}
-
-/* from autohint.c, stubs for now */
-
-void FindBlues( SplineFont *sf, real blues[14], real otherblues[10]) {
-}
-
-void QuickBlues(SplineFont *_sf, BlueData *bd) {
-}
-
-void SplineFontAutoHint( SplineFont *sf) {
-}
-
-void SplineFontAutoHintRefs( SplineFont *_sf) {
-}
-
-void SplineCharAutoHint( SplineChar *sc, BlueData *bd ) {
-}
-
-
-/* from genttfinstrs.c */
-
-int TTF__getcvtval(SplineFont *sf,int val) {
- int i;
- struct ttf_table *cvt_tab = SFFindTable(sf,CHR('c','v','t',' '));
-
- if ( cvt_tab==NULL ) {
- cvt_tab = chunkalloc(sizeof(struct ttf_table));
- cvt_tab->tag = CHR('c','v','t',' ');
- cvt_tab->maxlen = 200;
- cvt_tab->data = galloc(100*sizeof(short));
- cvt_tab->next = sf->ttf_tables;
- sf->ttf_tables = cvt_tab;
- }
- for ( i=0; sizeof(uint16)*i<cvt_tab->len; ++i ) {
- int tval = (int16) memushort(cvt_tab->data,cvt_tab->len, sizeof(uint16)*i);
- if ( val>=tval-1 && val<=tval+1 )
-return( i );
- }
- if ( sizeof(uint16)*i>=cvt_tab->maxlen ) {
- if ( cvt_tab->maxlen==0 ) cvt_tab->maxlen = cvt_tab->len;
- cvt_tab->maxlen += 200;
- cvt_tab->data = grealloc(cvt_tab->data,cvt_tab->maxlen);
- }
- memputshort(cvt_tab->data,sizeof(uint16)*i,val);
- cvt_tab->len += sizeof(uint16);
-return( i );
-}
-
-int TTF_getcvtval(SplineFont *sf,int val) {
-
- /* by default sign is unimportant in the cvt */
- /* For some instructions anyway, but not for MIAP so this routine has */
- /* been broken in two. */
- if ( val<0 ) val = -val;
-return( TTF__getcvtval(sf,val));
-}
-
-
-
-struct ttf_table *SFFindTable(SplineFont *sf,uint32 tag) {
- struct ttf_table *tab;
-
- for ( tab=sf->ttf_tables; tab!=NULL && tab->tag!=tag; tab=tab->next );
-return( tab );
-}
-
-void initforinstrs(SplineChar *sc) {
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/ChangeLog b/Build/source/texk/web2c/luatexdir/luafontloader/ChangeLog
index b21d051c62b..b21d051c62b 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/ChangeLog
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/ff-config.in b/Build/source/texk/web2c/luatexdir/luafontloader/ff-config.in
index 786eb5fe54c..f36a6ebad3c 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/ff-config.in
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/ff-config.in
@@ -4,6 +4,8 @@
#ifndef FF_CONFIG_H
#define FF_CONFIG_H
+#define _NO_FFSCRIPT 1
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/AUTHORS b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/AUTHORS
index 9b6fb61e4f4..9b6fb61e4f4 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/AUTHORS
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/AUTHORS
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/INSTALL b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/INSTALL
index b42a17ac464..b42a17ac464 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/INSTALL
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/INSTALL
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/LICENSE b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/LICENSE
index e8c4d01364b..1788d6d0f59 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/LICENSE
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/LICENSE
@@ -1,4 +1,5 @@
-PfaEdit is copyright (C) 2000,2001,2002,2003 by George Williams
+FontForge is copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008
+by George Williams.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Makefile.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Makefile.in
new file mode 100644
index 00000000000..2264a813c90
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Makefile.in
@@ -0,0 +1,160 @@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+libdir = @libdir@
+mandir = @mandir@
+includedir = @includedir@
+sharedir = $(prefix)/share/fontforge
+pixmapsdir = $(sharedir)/pixmaps
+docdir = $(prefix)/share/doc/fontforge
+localedir = $(prefix)/share/locale
+pythondir = $(sharedir)/python
+
+srcdir = @srcdir@
+top_builddir = .
+
+LIBTOOL = @LIBTOOL@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+all: fontforge
+
+libs: libgunicode libgutils @GDRAW_LIB@
+
+fontforge: libgunicode libgutils @GDRAW_LIB@
+ ( cd fontforge ; $(MAKE) )
+
+libgunicode:
+ ( cd Unicode ; $(MAKE) )
+
+libgutils: libgunicode
+ ( cd gutils ; $(MAKE) )
+
+libgdraw: libgutils libgunicode
+ ( cd gdraw ; $(MAKE) )
+
+fontforgegtk: fontforge
+ ( cd gtkui ; $(MAKE) )
+
+clean:
+ ( cd fontforge ; $(MAKE) clean )
+ ( cd Unicode ; $(MAKE) clean )
+ ( cd gutils ; $(MAKE) clean )
+ ( cd gdraw ; $(MAKE) clean )
+ ( cd plugins ; $(MAKE) clean )
+ if test -d gtkui; then cd gtkui ; $(MAKE) clean ; fi
+ -( cd pyhook ; for dir in * ; do if test -d $$dir -a "$$dir" != "CVS" ; then rm -rf $$dir ; fi; done )
+ -rm -rf .libs
+
+distclean cleaner:
+ ( cd fontforge ; $(MAKE) distclean )
+ ( cd Unicode ; $(MAKE) distclean )
+ ( cd gutils ; $(MAKE) distclean )
+ ( cd gdraw ; $(MAKE) distclean )
+ ( cd plugins ; $(MAKE) distclean )
+ if test -d gtkui; then cd gtkui ; $(MAKE) distclean ; fi
+ -( cd pyhook ; rm setup.py ; for dir in * ; do if test -d $$dir -a "$$dir" != "CVS" ; then rm -rf $$dir ; fi; done)
+ -rm -rf .libs
+ -rm Makefile config.cache config.log config.status libtool fontforge.pc systemspecific inc/config.h
+
+install_libs: libs
+# You may need to be root to do the install
+ mkdir -p $(DESTDIR)$(libdir)
+ #-rm $(DESTDIR)$(libdir)/libgdraw.so* $(DESTDIR)$(libdir)/libgunicode.so.*
+ $(LIBTOOL) --mode=install $(INSTALL) -c libgunicode.la $(DESTDIR)$(libdir)/libgunicode.la
+ $(LIBTOOL) --mode=install $(INSTALL) -c libgutils.la $(DESTDIR)$(libdir)/libgutils.la
+ $(LIBTOOL) --mode=install $(INSTALL) -c libgioftp.la $(DESTDIR)$(libdir)/libgioftp.la
+#We don't build gdraw if no X
+ if test -r libgdraw.la ; then $(LIBTOOL) --mode=install $(INSTALL) -c libgdraw.la $(DESTDIR)$(libdir)/libgdraw.la ; fi
+#We don't always build libfontforge
+ if test -r libfontforge.la ; then $(LIBTOOL) --mode=install $(INSTALL) -c libfontforge.la $(DESTDIR)$(libdir)/libfontforge.la ; fi
+ $(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
+ mkdir -p $(DESTDIR)$(libdir)/pkgconfig
+ $(INSTALL_DATA) fontforge.pc $(DESTDIR)$(libdir)/pkgconfig
+
+install_incs:
+ mkdir -p $(DESTDIR)$(includedir)/fontforge
+ $(INSTALL_DATA) $(srcdir)/inc/*.h $(DESTDIR)$(includedir)/fontforge
+# $(INSTALL_DATA) `grep -L GGadget $(srcdir)/fontforge/*.h` $(DESTDIR)$(includedir)/fontforge
+ ( for file in $(srcdir)/fontforge/*.h ; do if grep GGadget $$file >/dev/null 2>&1 ; then echo pointless >/dev/null ; else $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/fontforge ; fi ; done )
+
+install_docs:
+ mkdir -p $(DESTDIR)$(docdir)
+ mkdir -p $(DESTDIR)$(docdir)/flags $(DESTDIR)$(docdir)/ja
+#explicit use of sh to make sure we don't invoke csh with different "if" syntax
+ -sh -c "if test -d $(srcdir)/htdocs/ja >/dev/null ; then mkdir -p $(DESTDIR)$(docdir)/ja ; fi"
+ -$(INSTALL_DATA) $(srcdir)/htdocs/*.{html,png,gif,pdf} $(DESTDIR)$(docdir)
+ -$(INSTALL_DATA) $(srcdir)/htdocs/flags/* $(DESTDIR)$(docdir)/flags
+ -$(INSTALL_DATA) $(srcdir)/htdocs/ja/* $(DESTDIR)$(docdir)/ja
+
+install_pycontrib:
+ mkdir -p $(DESTDIR)$(pythondir)
+ ( cd pycontrib ; $(INSTALL_DATA) *.py $(DESTDIR)$(pythondir) )
+
+install_prog:
+ mkdir -p $(DESTDIR)$(bindir)
+ mkdir -p $(DESTDIR)$(mandir)/man1
+ mkdir -p $(DESTDIR)$(sharedir)
+ mkdir -p $(DESTDIR)$(pixmapsdir)
+ $(LIBTOOL) --mode=install $(INSTALL) -c fontforge/fontforge $(DESTDIR)$(bindir)
+ $(LIBTOOL) --mode=install $(INSTALL) -c fontforge/sfddiff $(DESTDIR)$(bindir)
+ $(LIBTOOL) --mode=install $(INSTALL) -c fontforge/fontimage $(DESTDIR)$(bindir)
+ $(LIBTOOL) --mode=install $(INSTALL) -c fontforge/fontlint $(DESTDIR)$(bindir)
+# -rm -f $(DESTDIR)$(bindir)/pfaedit
+# (cd $(DESTDIR)$(bindir) ; ln -s fontforge pfaedit)
+# $(INSTALL_DATA) fontforge/pfaedit-*.ui $(DESTDIR)$(sharedir)
+#The next line will fail for most installs. If you have downloaded the cidmaps
+# this will install them. If you haven't it won't. You only need the cidmaps
+# if you are editing CID keyed files (and even then you can live without them
+ -$(INSTALL_DATA) $(srcdir)/cidmap/*.cidmap $(DESTDIR)$(sharedir) >/dev/null 2>&1
+ -$(INSTALL_DATA) $(srcdir)/fontforge/pixmaps/*.png $(DESTDIR)$(pixmapsdir)
+ $(INSTALL_DATA) $(srcdir)/fontforge/fontforge.1 $(DESTDIR)$(mandir)/man1
+ $(INSTALL_DATA) $(srcdir)/fontforge/sfddiff.1 $(DESTDIR)$(mandir)/man1
+ $(INSTALL_DATA) $(srcdir)/fontforge/fontimage.1 $(DESTDIR)$(mandir)/man1
+ $(INSTALL_DATA) $(srcdir)/fontforge/fontlint.1 $(DESTDIR)$(mandir)/man1
+
+install: $(DESTDIR)$(sharedir) all install_libs install_incs install_prog install_pycontrib
+# You may need to be root to do the install
+#explicit use of sh to make sure we don't invoke csh with different "if" syntax
+ sh -c "if test -d $(srcdir)/htdocs >/dev/null ; then $(MAKE) install_docs ; fi"
+ sh -c "if test -d fontforge/FontForge.app >/dev/null ; then rm -rf /Applications/FontForge.app ; mv fontforge/FontForge.app /Applications ; ln -s /usr/local/bin/fontforge /Applications/FontForge.app/Contents/MacOS/FontForge ; fi"
+ sh < systemspecific
+#we don't always create a setup.py
+ -(cd pyhook ; if test -r setup.py ; then python setup.py install --prefix=$(prefix) --root=$(DESTDIR); for dir in * ; do if test -d $$dir -a "$$dir" != "CVS" ; then rm -rf $$dir ; fi; done ; fi )
+
+install_py: $(DESTDIR)$(sharedir) all install_libs install_incs install_prog install_pycontrib
+# You may need to be root to do the install
+#explicit use of sh to make sure we don't invoke csh with different "if" syntax
+ sh -c "if test -d $(srcdir)/htdocs >/dev/null ; then $(MAKE) install_docs ; for dir in * ; do if test -d $$dir ; then rm -rf $$dir ; fi; done ; fi"
+ sh -c "if test -d fontforge/FontForge.app >/dev/null ; then rm -rf /Applications/FontForge.app ; mv fontforge/FontForge.app /Applications ; ln -s /usr/local/bin/fontforge /Applications/FontForge.app/Contents/MacOS/FontForge ; fi"
+ sh < systemspecific
+ -(cd pyhook ; python setup.py bdist --formats=gztar ; cp dist/fontforge-*.tar.gz $(DESTDIR)/tmp; for dir in * ; do if test -d $$dir -a "$$dir" != "CVS" ; then rm -rf $$dir ; fi; done )
+
+install_gtk: fontforgegtk
+ (cd gtkui ; $(MAKE) install )
+
+uninstall:
+ -rm $(DESTDIR)$(bindir)/fontforge
+ -rm $(DESTDIR)$(bindir)/sfddiff
+ -rm $(DESTDIR)$(bindir)/fontimage
+ -rm $(DESTDIR)$(bindir)/fontlint
+ -rm $(DESTDIR)$(sharedir)/pfaedit-*.ui
+ -rm $(DESTDIR)$(localedir)/*/LC_MESSAGES/FontForge.mo
+ -rm $(DESTDIR)$(mandir)/man1/fontimage.1
+ -rm $(DESTDIR)$(mandir)/man1/fontforge.1
+ -rm $(DESTDIR)$(mandir)/man1/sfddiff.1
+ -rm $(DESTDIR)$(mandir)/man1/fontlint.1
+ -rm $(DESTDIR)$(libdir)/libgdraw.*
+ -rm $(DESTDIR)$(libdir)/libgutils.*
+ -rm $(DESTDIR)$(libdir)/libgioftp.*
+ -rm $(DESTDIR)$(libdir)/libgunicode.*
+ -rm $(DESTDIR)$(libdir)/libfontforge.*
+ -rm $(DESTDIR)$(sharedir)/*.cidmap
+ -rm $(DESTDIR)$(includedir)/fontforge/*.h
+ -rm -rf $(DESTDIR)$(docdir)/*
+ -rm $(DESTDIR)$(libdir)/pkgconfig/fontforge.pc
+ -rm $(DESTDIR)$(pythondir)/*
+
+$(DESTDIR)$(sharedir):
+ mkdir -p $(DESTDIR)$(sharedir)
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ArabicForms.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ArabicForms.c
new file mode 100644
index 00000000000..7fe973b1c8e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ArabicForms.c
@@ -0,0 +1,260 @@
+#include <utype.h>
+
+struct arabicforms ArabicForms[] = {
+ { 0x0600, 0x0600, 0x0600, 0x0600, 0, 0, 0 },
+ { 0x0601, 0x0601, 0x0601, 0x0601, 0, 0, 0 },
+ { 0x0602, 0x0602, 0x0602, 0x0602, 0, 0, 0 },
+ { 0x0603, 0x0603, 0x0603, 0x0603, 0, 0, 0 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
+ { 0x0606, 0x0606, 0x0606, 0x0606, 0, 0, 0 },
+ { 0x0607, 0x0607, 0x0607, 0x0607, 0, 0, 0 },
+ { 0x0608, 0x0608, 0x0608, 0x0608, 0, 0, 0 },
+ { 0x0609, 0x0609, 0x0609, 0x0609, 0, 0, 0 },
+ { 0x060a, 0x060a, 0x060a, 0x060a, 0, 0, 0 },
+ { 0x060b, 0x060b, 0x060b, 0x060b, 0, 0, 0 },
+ { 0x060c, 0x060c, 0x060c, 0x060c, 0, 0, 0 },
+ { 0x060d, 0x060d, 0x060d, 0x060d, 0, 0, 0 },
+ { 0x060e, 0x060e, 0x060e, 0x060e, 0, 0, 0 },
+ { 0x060f, 0x060f, 0x060f, 0x060f, 0, 0, 0 },
+ { 0x0610, 0x0610, 0x0610, 0x0610, 0, 0, 0 },
+ { 0x0611, 0x0611, 0x0611, 0x0611, 0, 0, 0 },
+ { 0x0612, 0x0612, 0x0612, 0x0612, 0, 0, 0 },
+ { 0x0613, 0x0613, 0x0613, 0x0613, 0, 0, 0 },
+ { 0x0614, 0x0614, 0x0614, 0x0614, 0, 0, 0 },
+ { 0x0615, 0x0615, 0x0615, 0x0615, 0, 0, 0 },
+ { 0x0616, 0x0616, 0x0616, 0x0616, 0, 0, 0 },
+ { 0x0617, 0x0617, 0x0617, 0x0617, 0, 0, 0 },
+ { 0x0618, 0x0618, 0x0618, 0x0618, 0, 0, 0 },
+ { 0x0619, 0x0619, 0x0619, 0x0619, 0, 0, 0 },
+ { 0x061a, 0x061a, 0x061a, 0x061a, 0, 0, 0 },
+ { 0x061b, 0x061b, 0x061b, 0x061b, 0, 0, 0 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
+ { 0x061e, 0x061e, 0x061e, 0x061e, 0, 0, 0 },
+ { 0x061f, 0x061f, 0x061f, 0x061f, 0, 0, 0 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
+ { 0x0621, 0x0621, 0x0621, 0xfe80, 1, 0, 0 },
+ { 0x0622, 0x0622, 0xfe82, 0xfe81, 1, 0, 0 },
+ { 0x0623, 0x0623, 0xfe84, 0xfe83, 1, 0, 0 },
+ { 0x0624, 0x0624, 0xfe86, 0xfe85, 1, 0, 0 },
+ { 0x0625, 0x0625, 0xfe88, 0xfe87, 1, 0, 0 },
+ { 0xfe8b, 0xfe8c, 0xfe8a, 0xfe89, 1, 1, 0 },
+ { 0x0627, 0x0627, 0xfe8e, 0xfe8d, 1, 0, 0 },
+ { 0xfe91, 0xfe92, 0xfe90, 0xfe8f, 1, 1, 0 },
+ { 0x0629, 0x0629, 0xfe94, 0xfe93, 1, 0, 0 },
+ { 0xfe97, 0xfe98, 0xfe96, 0xfe95, 1, 1, 0 },
+ { 0xfe9b, 0xfe9c, 0xfe9a, 0xfe99, 1, 1, 0 },
+ { 0xfe9f, 0xfea0, 0xfe9e, 0xfe9d, 1, 1, 0 },
+ { 0xfea3, 0xfea4, 0xfea2, 0xfea1, 1, 1, 0 },
+ { 0xfea7, 0xfea8, 0xfea6, 0xfea5, 1, 1, 0 },
+ { 0x062f, 0x062f, 0xfeaa, 0xfea9, 1, 0, 0 },
+ { 0x0630, 0x0630, 0xfeac, 0xfeab, 1, 0, 0 },
+ { 0x0631, 0x0631, 0xfeae, 0xfead, 1, 0, 0 },
+ { 0x0632, 0x0632, 0xfeb0, 0xfeaf, 1, 0, 0 },
+ { 0xfeb3, 0xfeb4, 0xfeb2, 0xfeb1, 1, 1, 0 },
+ { 0xfeb7, 0xfeb8, 0xfeb6, 0xfeb5, 1, 1, 0 },
+ { 0xfebb, 0xfebc, 0xfeba, 0xfeb9, 1, 1, 0 },
+ { 0xfebf, 0xfec0, 0xfebe, 0xfebd, 1, 1, 0 },
+ { 0xfec3, 0xfec4, 0xfec2, 0xfec1, 1, 1, 0 },
+ { 0xfec7, 0xfec8, 0xfec6, 0xfec5, 1, 1, 0 },
+ { 0xfecb, 0xfecc, 0xfeca, 0xfec9, 1, 1, 0 },
+ { 0xfecf, 0xfed0, 0xfece, 0xfecd, 1, 1, 0 },
+ { 0x063b, 0x063b, 0x063b, 0x063b, 1, 0, 0 },
+ { 0x063c, 0x063c, 0x063c, 0x063c, 1, 0, 0 },
+ { 0x063d, 0x063d, 0x063d, 0x063d, 1, 0, 0 },
+ { 0x063e, 0x063e, 0x063e, 0x063e, 1, 0, 0 },
+ { 0x063f, 0x063f, 0x063f, 0x063f, 1, 0, 0 },
+ { 0x0640, 0x0640, 0x0640, 0x0640, 0, 0, 0 },
+ { 0xfed3, 0xfed4, 0xfed2, 0xfed1, 1, 1, 0 },
+ { 0xfed7, 0xfed8, 0xfed6, 0xfed5, 1, 1, 0 },
+ { 0xfedb, 0xfedc, 0xfeda, 0xfed9, 1, 1, 0 },
+ { 0xfedf, 0xfee0, 0xfede, 0xfedd, 1, 1, 1 },
+ { 0xfee3, 0xfee4, 0xfee2, 0xfee1, 1, 1, 0 },
+ { 0xfee7, 0xfee8, 0xfee6, 0xfee5, 1, 1, 0 },
+ { 0xfeeb, 0xfeec, 0xfeea, 0xfee9, 1, 1, 0 },
+ { 0x0648, 0x0648, 0xfeee, 0xfeed, 1, 0, 0 },
+ { 0x0649, 0x0649, 0xfef0, 0xfeef, 1, 0, 0 },
+ { 0xfef3, 0xfef4, 0xfef2, 0xfef1, 1, 1, 0 },
+ { 0x064b, 0x064b, 0x064b, 0x064b, 0, 0, 0 },
+ { 0x064c, 0x064c, 0x064c, 0x064c, 0, 0, 0 },
+ { 0x064d, 0x064d, 0x064d, 0x064d, 0, 0, 0 },
+ { 0x064e, 0x064e, 0x064e, 0x064e, 0, 0, 0 },
+ { 0x064f, 0x064f, 0x064f, 0x064f, 0, 0, 0 },
+ { 0x0650, 0x0650, 0x0650, 0x0650, 0, 0, 0 },
+ { 0x0651, 0x0651, 0x0651, 0x0651, 0, 0, 0 },
+ { 0x0652, 0x0652, 0x0652, 0x0652, 0, 0, 0 },
+ { 0x0653, 0x0653, 0x0653, 0x0653, 0, 0, 0 },
+ { 0x0654, 0x0654, 0x0654, 0x0654, 0, 0, 0 },
+ { 0x0655, 0x0655, 0x0655, 0x0655, 0, 0, 0 },
+ { 0x0656, 0x0656, 0x0656, 0x0656, 0, 0, 0 },
+ { 0x0657, 0x0657, 0x0657, 0x0657, 0, 0, 0 },
+ { 0x0658, 0x0658, 0x0658, 0x0658, 0, 0, 0 },
+ { 0x0659, 0x0659, 0x0659, 0x0659, 0, 0, 0 },
+ { 0x065a, 0x065a, 0x065a, 0x065a, 0, 0, 0 },
+ { 0x065b, 0x065b, 0x065b, 0x065b, 0, 0, 0 },
+ { 0x065c, 0x065c, 0x065c, 0x065c, 0, 0, 0 },
+ { 0x065d, 0x065d, 0x065d, 0x065d, 0, 0, 0 },
+ { 0x065e, 0x065e, 0x065e, 0x065e, 0, 0, 0 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
+ { 0x0660, 0x0660, 0x0660, 0x0660, 0, 0, 0 },
+ { 0x0661, 0x0661, 0x0661, 0x0661, 0, 0, 0 },
+ { 0x0662, 0x0662, 0x0662, 0x0662, 0, 0, 0 },
+ { 0x0663, 0x0663, 0x0663, 0x0663, 0, 0, 0 },
+ { 0x0664, 0x0664, 0x0664, 0x0664, 0, 0, 0 },
+ { 0x0665, 0x0665, 0x0665, 0x0665, 0, 0, 0 },
+ { 0x0666, 0x0666, 0x0666, 0x0666, 0, 0, 0 },
+ { 0x0667, 0x0667, 0x0667, 0x0667, 0, 0, 0 },
+ { 0x0668, 0x0668, 0x0668, 0x0668, 0, 0, 0 },
+ { 0x0669, 0x0669, 0x0669, 0x0669, 0, 0, 0 },
+ { 0x066a, 0x066a, 0x066a, 0x066a, 0, 0, 0 },
+ { 0x066b, 0x066b, 0x066b, 0x066b, 0, 0, 0 },
+ { 0x066c, 0x066c, 0x066c, 0x066c, 0, 0, 0 },
+ { 0x066d, 0x066d, 0x066d, 0x066d, 0, 0, 0 },
+ { 0x066e, 0x066e, 0x066e, 0x066e, 1, 0, 0 },
+ { 0x066f, 0x066f, 0x066f, 0x066f, 1, 0, 0 },
+ { 0x0670, 0x0670, 0x0670, 0x0670, 1, 0, 0 },
+ { 0x0671, 0x0671, 0xfb51, 0xfb50, 1, 0, 0 },
+ { 0x0672, 0x0672, 0x0672, 0x0672, 1, 0, 0 },
+ { 0x0673, 0x0673, 0x0673, 0x0673, 1, 0, 0 },
+ { 0x0674, 0x0674, 0x0674, 0x0674, 1, 0, 0 },
+ { 0x0675, 0x0675, 0x0675, 0x0675, 1, 0, 0 },
+ { 0x0676, 0x0676, 0x0676, 0x0676, 1, 0, 0 },
+ { 0x0677, 0x0677, 0x0677, 0xfbdd, 1, 0, 0 },
+ { 0x0678, 0x0678, 0x0678, 0x0678, 1, 0, 0 },
+ { 0xfb68, 0xfb69, 0xfb67, 0xfb66, 1, 1, 0 },
+ { 0xfb60, 0xfb61, 0xfb5f, 0xfb5e, 1, 1, 0 },
+ { 0xfb54, 0xfb55, 0xfb53, 0xfb52, 1, 1, 0 },
+ { 0x067c, 0x067c, 0x067c, 0x067c, 1, 0, 0 },
+ { 0x067d, 0x067d, 0x067d, 0x067d, 1, 0, 0 },
+ { 0xfb58, 0xfb59, 0xfb57, 0xfb56, 1, 1, 0 },
+ { 0xfb64, 0xfb65, 0xfb63, 0xfb62, 1, 1, 0 },
+ { 0xfb5c, 0xfb5d, 0xfb5b, 0xfb5a, 1, 1, 0 },
+ { 0x0681, 0x0681, 0x0681, 0x0681, 1, 0, 0 },
+ { 0x0682, 0x0682, 0x0682, 0x0682, 1, 0, 0 },
+ { 0xfb78, 0xfb79, 0xfb77, 0xfb76, 1, 1, 0 },
+ { 0xfb74, 0xfb75, 0xfb73, 0xfb72, 1, 1, 0 },
+ { 0x0685, 0x0685, 0x0685, 0x0685, 1, 0, 0 },
+ { 0xfb7c, 0xfb7d, 0xfb7b, 0xfb7a, 1, 1, 0 },
+ { 0xfb80, 0xfb81, 0xfb7f, 0xfb7e, 1, 1, 0 },
+ { 0x0688, 0x0688, 0xfb89, 0xfb88, 1, 0, 0 },
+ { 0x0689, 0x0689, 0x0689, 0x0689, 1, 0, 0 },
+ { 0x068a, 0x068a, 0x068a, 0x068a, 1, 0, 0 },
+ { 0x068b, 0x068b, 0x068b, 0x068b, 1, 0, 0 },
+ { 0x068c, 0x068c, 0xfb85, 0xfb84, 1, 0, 0 },
+ { 0x068d, 0x068d, 0xfb83, 0xfb82, 1, 0, 0 },
+ { 0x068e, 0x068e, 0xfb87, 0xfb86, 1, 0, 0 },
+ { 0x068f, 0x068f, 0x068f, 0x068f, 1, 0, 0 },
+ { 0x0690, 0x0690, 0x0690, 0x0690, 1, 0, 0 },
+ { 0x0691, 0x0691, 0xfb8d, 0xfb8c, 1, 0, 0 },
+ { 0x0692, 0x0692, 0x0692, 0x0692, 1, 0, 0 },
+ { 0x0693, 0x0693, 0x0693, 0x0693, 1, 0, 0 },
+ { 0x0694, 0x0694, 0x0694, 0x0694, 1, 0, 0 },
+ { 0x0695, 0x0695, 0x0695, 0x0695, 1, 0, 0 },
+ { 0x0696, 0x0696, 0x0696, 0x0696, 1, 0, 0 },
+ { 0x0697, 0x0697, 0x0697, 0x0697, 1, 0, 0 },
+ { 0x0698, 0x0698, 0xfb8b, 0xfb8a, 1, 0, 0 },
+ { 0x0699, 0x0699, 0x0699, 0x0699, 1, 0, 0 },
+ { 0x069a, 0x069a, 0x069a, 0x069a, 1, 0, 0 },
+ { 0x069b, 0x069b, 0x069b, 0x069b, 1, 0, 0 },
+ { 0x069c, 0x069c, 0x069c, 0x069c, 1, 0, 0 },
+ { 0x069d, 0x069d, 0x069d, 0x069d, 1, 0, 0 },
+ { 0x069e, 0x069e, 0x069e, 0x069e, 1, 0, 0 },
+ { 0x069f, 0x069f, 0x069f, 0x069f, 1, 0, 0 },
+ { 0x06a0, 0x06a0, 0x06a0, 0x06a0, 1, 0, 0 },
+ { 0x06a1, 0x06a1, 0x06a1, 0x06a1, 1, 0, 0 },
+ { 0x06a2, 0x06a2, 0x06a2, 0x06a2, 1, 0, 0 },
+ { 0x06a3, 0x06a3, 0x06a3, 0x06a3, 1, 0, 0 },
+ { 0xfb6c, 0xfb6d, 0xfb6b, 0xfb6a, 1, 1, 0 },
+ { 0x06a5, 0x06a5, 0x06a5, 0x06a5, 1, 0, 0 },
+ { 0xfb70, 0xfb71, 0xfb6f, 0xfb6e, 1, 1, 0 },
+ { 0x06a7, 0x06a7, 0x06a7, 0x06a7, 1, 0, 0 },
+ { 0x06a8, 0x06a8, 0x06a8, 0x06a8, 1, 0, 0 },
+ { 0xfb90, 0xfb91, 0xfb8f, 0xfb8e, 1, 1, 0 },
+ { 0x06aa, 0x06aa, 0x06aa, 0x06aa, 1, 0, 0 },
+ { 0x06ab, 0x06ab, 0x06ab, 0x06ab, 1, 0, 0 },
+ { 0x06ac, 0x06ac, 0x06ac, 0x06ac, 1, 0, 0 },
+ { 0xfbd5, 0xfbd6, 0xfbd4, 0xfbd3, 1, 1, 0 },
+ { 0x06ae, 0x06ae, 0x06ae, 0x06ae, 1, 0, 0 },
+ { 0xfb94, 0xfb95, 0xfb93, 0xfb92, 1, 1, 0 },
+ { 0x06b0, 0x06b0, 0x06b0, 0x06b0, 1, 0, 0 },
+ { 0xfb9c, 0xfb9d, 0xfb9b, 0xfb9a, 1, 1, 0 },
+ { 0x06b2, 0x06b2, 0x06b2, 0x06b2, 1, 0, 0 },
+ { 0xfb98, 0xfb99, 0xfb97, 0xfb96, 1, 1, 0 },
+ { 0x06b4, 0x06b4, 0x06b4, 0x06b4, 1, 0, 0 },
+ { 0x06b5, 0x06b5, 0x06b5, 0x06b5, 1, 0, 0 },
+ { 0x06b6, 0x06b6, 0x06b6, 0x06b6, 1, 0, 0 },
+ { 0x06b7, 0x06b7, 0x06b7, 0x06b7, 1, 0, 0 },
+ { 0x06b8, 0x06b8, 0x06b8, 0x06b8, 1, 0, 0 },
+ { 0x06b9, 0x06b9, 0x06b9, 0x06b9, 1, 0, 0 },
+ { 0x06ba, 0x06ba, 0xfb9f, 0xfb9e, 1, 0, 0 },
+ { 0xfba2, 0xfba3, 0xfba1, 0xfba0, 1, 1, 0 },
+ { 0x06bc, 0x06bc, 0x06bc, 0x06bc, 1, 0, 0 },
+ { 0x06bd, 0x06bd, 0x06bd, 0x06bd, 1, 0, 0 },
+ { 0xfbac, 0xfbad, 0xfbab, 0xfbaa, 1, 1, 0 },
+ { 0x06bf, 0x06bf, 0x06bf, 0x06bf, 1, 0, 0 },
+ { 0x06c0, 0x06c0, 0xfba5, 0xfba4, 1, 0, 0 },
+ { 0xfba8, 0xfba9, 0xfba7, 0xfba6, 1, 1, 0 },
+ { 0x06c2, 0x06c2, 0x06c2, 0x06c2, 1, 0, 0 },
+ { 0x06c3, 0x06c3, 0x06c3, 0x06c3, 1, 0, 0 },
+ { 0x06c4, 0x06c4, 0x06c4, 0x06c4, 1, 0, 0 },
+ { 0x06c5, 0x06c5, 0xfbe1, 0xfbe0, 1, 0, 0 },
+ { 0x06c6, 0x06c6, 0xfbda, 0xfbd9, 1, 0, 0 },
+ { 0x06c7, 0x06c7, 0xfbd8, 0xfbd7, 1, 0, 0 },
+ { 0x06c8, 0x06c8, 0xfbdc, 0xfbdb, 1, 0, 0 },
+ { 0x06c9, 0x06c9, 0xfbe3, 0xfbe2, 1, 0, 0 },
+ { 0x06ca, 0x06ca, 0x06ca, 0x06ca, 1, 0, 0 },
+ { 0x06cb, 0x06cb, 0xfbdf, 0xfbde, 1, 0, 0 },
+ { 0xfbfe, 0xfbff, 0xfbfd, 0xfbfc, 1, 1, 0 },
+ { 0x06cd, 0x06cd, 0x06cd, 0x06cd, 1, 0, 0 },
+ { 0x06ce, 0x06ce, 0x06ce, 0x06ce, 1, 0, 0 },
+ { 0x06cf, 0x06cf, 0x06cf, 0x06cf, 1, 0, 0 },
+ { 0xfbe6, 0xfbe7, 0xfbe5, 0xfbe4, 1, 1, 0 },
+ { 0x06d1, 0x06d1, 0x06d1, 0x06d1, 1, 0, 0 },
+ { 0x06d2, 0x06d2, 0xfbaf, 0xfbae, 1, 0, 0 },
+ { 0x06d3, 0x06d3, 0xfbb1, 0xfbb0, 1, 0, 0 },
+ { 0x06d4, 0x06d4, 0x06d4, 0x06d4, 0, 0, 0 },
+ { 0x06d5, 0x06d5, 0x06d5, 0x06d5, 1, 0, 0 },
+ { 0x06d6, 0x06d6, 0x06d6, 0x06d6, 0, 0, 0 },
+ { 0x06d7, 0x06d7, 0x06d7, 0x06d7, 0, 0, 0 },
+ { 0x06d8, 0x06d8, 0x06d8, 0x06d8, 0, 0, 0 },
+ { 0x06d9, 0x06d9, 0x06d9, 0x06d9, 0, 0, 0 },
+ { 0x06da, 0x06da, 0x06da, 0x06da, 0, 0, 0 },
+ { 0x06db, 0x06db, 0x06db, 0x06db, 0, 0, 0 },
+ { 0x06dc, 0x06dc, 0x06dc, 0x06dc, 0, 0, 0 },
+ { 0x06dd, 0x06dd, 0x06dd, 0x06dd, 0, 0, 0 },
+ { 0x06de, 0x06de, 0x06de, 0x06de, 0, 0, 0 },
+ { 0x06df, 0x06df, 0x06df, 0x06df, 0, 0, 0 },
+ { 0x06e0, 0x06e0, 0x06e0, 0x06e0, 0, 0, 0 },
+ { 0x06e1, 0x06e1, 0x06e1, 0x06e1, 0, 0, 0 },
+ { 0x06e2, 0x06e2, 0x06e2, 0x06e2, 0, 0, 0 },
+ { 0x06e3, 0x06e3, 0x06e3, 0x06e3, 0, 0, 0 },
+ { 0x06e4, 0x06e4, 0x06e4, 0x06e4, 0, 0, 0 },
+ { 0x06e5, 0x06e5, 0x06e5, 0x06e5, 0, 0, 0 },
+ { 0x06e6, 0x06e6, 0x06e6, 0x06e6, 0, 0, 0 },
+ { 0x06e7, 0x06e7, 0x06e7, 0x06e7, 0, 0, 0 },
+ { 0x06e8, 0x06e8, 0x06e8, 0x06e8, 0, 0, 0 },
+ { 0x06e9, 0x06e9, 0x06e9, 0x06e9, 0, 0, 0 },
+ { 0x06ea, 0x06ea, 0x06ea, 0x06ea, 0, 0, 0 },
+ { 0x06eb, 0x06eb, 0x06eb, 0x06eb, 0, 0, 0 },
+ { 0x06ec, 0x06ec, 0x06ec, 0x06ec, 0, 0, 0 },
+ { 0x06ed, 0x06ed, 0x06ed, 0x06ed, 0, 0, 0 },
+ { 0x06ee, 0x06ee, 0x06ee, 0x06ee, 1, 0, 0 },
+ { 0x06ef, 0x06ef, 0x06ef, 0x06ef, 1, 0, 0 },
+ { 0x06f0, 0x06f0, 0x06f0, 0x06f0, 0, 0, 0 },
+ { 0x06f1, 0x06f1, 0x06f1, 0x06f1, 0, 0, 0 },
+ { 0x06f2, 0x06f2, 0x06f2, 0x06f2, 0, 0, 0 },
+ { 0x06f3, 0x06f3, 0x06f3, 0x06f3, 0, 0, 0 },
+ { 0x06f4, 0x06f4, 0x06f4, 0x06f4, 0, 0, 0 },
+ { 0x06f5, 0x06f5, 0x06f5, 0x06f5, 0, 0, 0 },
+ { 0x06f6, 0x06f6, 0x06f6, 0x06f6, 0, 0, 0 },
+ { 0x06f7, 0x06f7, 0x06f7, 0x06f7, 0, 0, 0 },
+ { 0x06f8, 0x06f8, 0x06f8, 0x06f8, 0, 0, 0 },
+ { 0x06f9, 0x06f9, 0x06f9, 0x06f9, 0, 0, 0 },
+ { 0x06fa, 0x06fa, 0x06fa, 0x06fa, 1, 0, 0 },
+ { 0x06fb, 0x06fb, 0x06fb, 0x06fb, 1, 0, 0 },
+ { 0x06fc, 0x06fc, 0x06fc, 0x06fc, 1, 0, 0 },
+ { 0x06fd, 0x06fd, 0x06fd, 0x06fd, 0, 0, 0 },
+ { 0x06fe, 0x06fe, 0x06fe, 0x06fe, 0, 0, 0 },
+ { 0x06ff, 0x06ff, 0x06ff, 0x06ff, 1, 0, 0 }
+};
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/Makefile.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/Makefile.in
new file mode 100644
index 00000000000..ea21c43be1d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/Makefile.in
@@ -0,0 +1,36 @@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+top_srcdir = @top_srcdir@
+top_builddir = ..
+libdir = @libdir@
+VPATH = @srcdir@
+bindir = @bindir@
+
+GU_VERSION=3
+GU_REVISION=1
+GU_AGE=0
+
+LIBTOOL = @LIBTOOL@
+CC = @CC@
+
+libgunicode_OBJECTS = ArabicForms.lo alphabet.lo backtrns.lo char.lo \
+ cjk.lo memory.lo ucharmap.lo unialt.lo ustring.lo utype.lo \
+ gwwiconv.lo
+
+Incs = -I$(top_builddir)/inc -I$(top_srcdir)/inc -I/usr/pkg/include -I/usr/pkg/include/giflib
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(Incs) @WFLAGS@ @DEFS@
+
+../libgunicode.la: $(libgunicode_OBJECTS)
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -no-undefined @LDFLAGS@ -o ../libgunicode.la $(libgunicode_OBJECTS) \
+ @LIBS@ \
+ -rpath $(libdir) -version-info $(GU_VERSION):$(GU_REVISION):$(GU_AGE)
+
+%.lo: %.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<
+
+clean:
+ -rm -f *.o *.lo ../libgunicode.la .libs/*
+
+distclean cleaner:
+ -rm -f *.o *.lo ../libgunicode.la .libs/* Makefile
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/alphabet.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/alphabet.c
index 166a33208a7..166a33208a7 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/alphabet.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/alphabet.c
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/backtrns.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/backtrns.c
new file mode 100644
index 00000000000..f674dc3ba71
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/backtrns.c
@@ -0,0 +1,7434 @@
+static const unsigned long l_allzeros[256] = { 0 };
+static const unsigned long unicode_backtrans_0[] = {
+ 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff,
+ 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff,
+ 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff,
+ 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff, 0x0fffff,
+ 0x07ffff, 0x07ffff, 0x03ffff, 0x07ffff, 0x03ffff, 0x07ffff, 0x07ffff, 0x03ffff,
+ 0x07ffff, 0x07ffff, 0x03ffff, 0x07ffff, 0x07ffff, 0x03ffff, 0x07ffff, 0x07ffff,
+ 0x07ffdf, 0x07ffdf, 0x07ffdf, 0x07ffdf, 0x07ffdf, 0x07ffdf, 0x07ffdf, 0x07ffdf,
+ 0x07ffdf, 0x07ffdf, 0x07ffff, 0x07ffff, 0x07ffff, 0x07ffff, 0x07ffff, 0x07ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x07ffff, 0x037fff, 0x07ffff, 0x03ffff, 0x07ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff, 0x03ffff,
+ 0x03ffff, 0x03ffff, 0x03ffff, 0x07ffff, 0x07ffff, 0x07ffff, 0x437fff, 0x000001,
+ 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001,
+ 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001,
+ 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001,
+ 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001, 0x000001,
+ 0x037fff, 0x8c32101, 0x2032981, 0x20339c5, 0x9c109af, 0x203a181, 0x4109c1, 0xfa33bdf,
+ 0xda301cf, 0x4779c1, 0x8c32101, 0x88329c1, 0x0729c1, 0x013bff, 0x473981, 0x6432309,
+ 0xfa76bcf, 0xfa729c1, 0x88169c5, 0x88129c5, 0x8a3018f, 0x032985, 0x8a33981, 0x70369c5,
+ 0x8c3018f, 0x8812981, 0x8c32101, 0x88329c1, 0x8810981, 0x88109c5, 0x8810981, 0x8c32101,
+ 0x4433105, 0x443330f, 0x43330f, 0x433309, 0x433b0f, 0x433b09, 0x8c33b09, 0x433107,
+ 0x4433105, 0x4433b0f, 0x4433105, 0x43330f, 0x433105, 0x43330f, 0x43330f, 0x433305,
+ 0x8812201, 0x433105, 0x4433105, 0x4433b07, 0x43330f, 0x433b09, 0x433b0f, 0xfa5298f,
+ 0x8c33b09, 0x433105, 0x433b0f, 0x433b0d, 0x433b0f, 0x413203, 0x8c12201, 0x8c33b0f,
+ 0x5433105, 0x543330f, 0x43330f, 0x433309, 0x433b0f, 0x433b09, 0x8c33b09, 0x433107,
+ 0x5433105, 0x5433b0f, 0x5433105, 0x43330f, 0x5433105, 0x543330f, 0x43330f, 0x433305,
+ 0x8c12201, 0x433105, 0x5433105, 0x5433b07, 0x43330f, 0x433b09, 0x433b0f, 0xfa7698f,
+ 0xcc33b09, 0x5433105, 0x5433b0f, 0x433b0d, 0x5433b0f, 0x413203, 0x8c12201, 0x433101
+};
+
+static const unsigned long unicode_backtrans_1[] = {
+ 0x4400a08, 0x5400a08, 0x400002, 0x400002, 0x400a0a, 0x400a0a, 0x400802, 0x400802,
+ 0x400004, 0x400004, 0x401004, 0x401004, 0x400a0a, 0x400a0a, 0x400002, 0x400002,
+ 0x40020a, 0x8c0020a, 0x4400a08, 0x5400a08, 0x000000, 0x000000, 0x400808, 0x400808,
+ 0x400a0a, 0x400a0a, 0x4400002, 0x5400002, 0x400004, 0x400004, 0x400104, 0x400104,
+ 0x401004, 0x401004, 0x400a08, 0x000a08, 0x400004, 0x400004, 0x8c00004, 0x8c00004,
+ 0x400208, 0x400208, 0x400a08, 0x5400a08, 0x000000, 0x000000, 0x400a08, 0x400208,
+ 0x400104, 0x8c20104, 0x8c00000, 0x8c00000, 0x400004, 0x400004, 0x400a08, 0x400a08,
+ 0x8c00208, 0x400002, 0x400002, 0x400a08, 0x400a08, 0x400002, 0x400002, 0x8c00000,
+ 0x8c00000, 0x8c00802, 0x8c00802, 0x400802, 0x1400802, 0x400a08, 0x400a08, 0x400002,
+ 0x1400002, 0x8c00000, 0x8c00208, 0xcc00208, 0x4400a08, 0x5400a08, 0x000000, 0x000000,
+ 0x400002, 0x400002, 0x8c32000, 0xcc32000, 0x400002, 0x400002, 0x400808, 0x400808,
+ 0x400002, 0x400002, 0x400002, 0x400002, 0x400004, 0x400004, 0x400106, 0x400106,
+ 0x412a0a, 0x412a0a, 0x400002, 0x400002, 0x400002, 0x400002, 0x8c00208, 0x8c00208,
+ 0x400208, 0x400208, 0x400208, 0x5400208, 0x400004, 0x400004, 0x400002, 0x400002,
+ 0x400002, 0x400002, 0x400a08, 0x400a08, 0x401000, 0x401000, 0x401000, 0x401000,
+ 0x433000, 0x400802, 0x400802, 0x400806, 0x400806, 0x402a0a, 0x402a0a, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x070000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4400000, 0x5400000, 0x400000,
+ 0x5400000, 0x4400000, 0x5400000, 0x400000, 0x5400000, 0x400000, 0x5400000, 0x400000,
+ 0x5400000, 0x400000, 0x5400000, 0x400000, 0x5400000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x400000, 0x000000, 0x000000,
+ 0x000000, 0x1000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_2[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x5000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x5000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000040, 0x000040, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4030000, 0xfc6000a,
+ 0x000000, 0x5000000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x8c20006, 0xec2000e, 0x8c20000, 0x8c2000a, 0x8830000, 0x8c20002, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_3[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x400040, 0x400040, 0x400040, 0x000000,
+ 0x400040, 0x400040, 0x400040, 0x000000, 0x400040, 0x000000, 0x400040, 0x400040,
+ 0x400040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040,
+ 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040,
+ 0xfa40040, 0xfa40040, 0x000000, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040,
+ 0xfa40040, 0xfa60040, 0x400040, 0x400040, 0x400040, 0x400040, 0x400040, 0x400040,
+ 0x400040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040,
+ 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040,
+ 0xfa60040, 0xfa40040, 0x440040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040, 0xfa40040,
+ 0xfa40040, 0xfa40040, 0x400040, 0x400040, 0x400040, 0x400040, 0x400040, 0x000000,
+ 0x000000, 0x040000, 0x040000, 0x000000, 0x000000, 0x040000, 0x040000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_4[] = {
+ 0x000000, 0xda04010, 0x400010, 0x400010, 0x400010, 0x400010, 0x400010, 0x400010,
+ 0x400010, 0x400010, 0x400010, 0x400010, 0x400010, 0x000000, 0x400010, 0x400010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010, 0xda04010,
+ 0x000000, 0xda04010, 0x400010, 0x400010, 0x400010, 0x400010, 0x400010, 0x400010,
+ 0x400010, 0x400010, 0x400010, 0x400010, 0x400010, 0x000000, 0x400010, 0x400010,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_5[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080,
+ 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080,
+ 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080, 0x000080,
+ 0x000080, 0x000080, 0x000080, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_6[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000020, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000020, 0x000000, 0x000000, 0x000000, 0x000020,
+ 0x000000, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020,
+ 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020,
+ 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020,
+ 0x000020, 0x000020, 0x000020, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020,
+ 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020,
+ 0x000020, 0x000020, 0x000020, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020, 0x000020,
+ 0x000020, 0x000020, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_e[] = {
+ 0x000000, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000000, 0x000000, 0x000000, 0x000000, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400, 0x000400,
+ 0x000400, 0x000400, 0x000400, 0x000400, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_1e[] = {
+ 0x000000, 0x000000, 0x001000, 0x001000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x001000, 0x001000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x001000, 0x001000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x1000000,
+ 0x001000, 0x001000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x001000, 0x001000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x001000, 0x001000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x001000, 0x001000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x001000, 0x001000, 0x001000, 0x001000, 0x001000, 0x001000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x001000, 0x001000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_20[] = {
+ 0x000000, 0x000000, 0x000000, 0x200000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x200000, 0x000000, 0x000000, 0xe830000, 0xf830000, 0x200040, 0x9a00000, 0x000080,
+ 0xf830000, 0xf830800, 0x030000, 0x000000, 0xf830800, 0xf830800, 0x030800, 0x000000,
+ 0x8a30000, 0x8a30000, 0x2070000, 0x000000, 0x000000, 0xea00000, 0x7270000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x9a30000, 0x000000, 0xfa40000, 0x9a40000, 0x000000, 0x6000000, 0x000000, 0x000000,
+ 0x000000, 0x030000, 0x030000, 0xfa00000, 0x000000, 0x000000, 0x008080, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x060000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x1000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x8800000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8800000,
+ 0x000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x032000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_21[] = {
+ 0x000000, 0x000000, 0x000000, 0xfa00000, 0x000000, 0x6000000, 0x000000, 0x000000,
+ 0x000000, 0xe800000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x040000, 0x000000, 0x8800000, 0x000000, 0x000000, 0xdc00010, 0x000000,
+ 0x040000, 0x000000, 0x000000, 0x000000, 0x040000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0xc800000, 0x8c70000, 0x000000, 0x000000, 0x000000, 0x8800000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x8a00000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x040000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000,
+ 0xf800000, 0xf800000, 0xf800000, 0xf800000, 0xf800000, 0xf800000, 0xf800000, 0xf800000,
+ 0xf800000, 0xf800000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0xc800000, 0xc800000, 0xc800000, 0xc800000, 0xc800000, 0xc800000, 0xc800000, 0xc800000,
+ 0xc800000, 0xc800000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0xfa40000, 0xfa40000, 0xfac0000, 0xfa40000, 0x88c0000, 0x8880000, 0xe800000, 0xe800000,
+ 0xe800000, 0xe800000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x040000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x040000, 0x040000, 0x8a40000, 0x040000, 0x8a40000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_22[] = {
+ 0x8a40000, 0x000000, 0x8a60000, 0x8a40000, 0x000000, 0x040000, 0x020000, 0x8a40000,
+ 0x9a40000, 0x040000, 0x000000, 0x8a00000, 0x000000, 0x040000, 0x000000, 0x9860000,
+ 0x000000, 0x9860000, 0x240000, 0x000000, 0x000000, 0x6000000, 0x000000, 0x040000,
+ 0x000000, 0x004000, 0xfa64000, 0x000000, 0x000000, 0x9a40000, 0xfa60000, 0x6000000,
+ 0xfa40000, 0x000000, 0x000000, 0x6000000, 0x000000, 0x7000000, 0x000000, 0x9a40000,
+ 0x9a40000, 0xfa40000, 0xfa40000, 0xfa60000, 0x8a00000, 0x000000, 0xf800000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0xfa40000, 0xfa00000, 0x9800000, 0x1000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x2040000, 0x9a00000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x040000, 0x000000, 0x000000,
+ 0x1064000, 0x000000, 0x000000, 0x000000, 0x1000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0xea00000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0xfa60000, 0xfa40000, 0x000000, 0x000000, 0x9864000, 0x9864000, 0x6200000, 0x6200000,
+ 0x000000, 0x000000, 0x200000, 0x200000, 0x000000, 0x000000, 0x1000000, 0x1000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x8a40000, 0x8a40000, 0x040000, 0x000000, 0x8a40000, 0x8a40000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x6040000, 0x000000, 0x040000,
+ 0x000000, 0x7000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xfa40000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x6000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x040000, 0x040000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8800000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_23[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x9a00000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x044000, 0x044000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x040000, 0x040000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_24[] = {
+ 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000,
+ 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000,
+ 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000,
+ 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000,
+ 0x000000, 0x2000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0xd880000, 0xd880000, 0xd880000, 0xd880000, 0xd880000, 0xd880000, 0xd880000, 0xd880000,
+ 0xd880000, 0xd880000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0xd800000, 0xd800000, 0xd800000, 0xd800000,
+ 0xd800000, 0xd800000, 0xd800000, 0xd800000, 0xd800000, 0xd800000, 0x9800000, 0x9800000,
+ 0x9800000, 0x9800000, 0x9800000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_25[] = {
+ 0xfa04000, 0x9a00000, 0xfa04000, 0x9a00000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0xfa04000, 0x9800000, 0x9800000, 0x9a00000,
+ 0xfa04000, 0x9800000, 0x9800000, 0x9a00000, 0xfa04000, 0x9800000, 0x9800000, 0x9a00000,
+ 0xfa04000, 0x9800000, 0x9800000, 0x9a00000, 0xfa04000, 0x9a00000, 0x9800000, 0x9800000,
+ 0x9a00000, 0x9800000, 0x9800000, 0x9a00000, 0xfa04000, 0x9a00000, 0x9800000, 0x9800000,
+ 0x9a00000, 0x9800000, 0x9800000, 0x9a00000, 0xfa04000, 0x9800000, 0x9800000, 0x9a00000,
+ 0x9a00000, 0x9800000, 0x9800000, 0x9a00000, 0xfa04000, 0x9800000, 0x9800000, 0x9a00000,
+ 0x9a00000, 0x9800000, 0x9800000, 0x9a00000, 0xfa04000, 0x9800000, 0x9800000, 0x9a00000,
+ 0x9800000, 0x9800000, 0x9a00000, 0x9800000, 0x9800000, 0x9800000, 0x9800000, 0x9800000,
+ 0x9800000, 0x9800000, 0x9800000, 0x9a00000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x6004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000,
+ 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x6004000, 0x4004000,
+ 0x4004000, 0x6004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000, 0x4004000,
+ 0x4004000, 0x4004000, 0x6004000, 0x4004000, 0x4004000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x004000, 0x6000000, 0x6000000, 0x6000000, 0x6004000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6004000, 0x6000000, 0x6000000, 0x6000000, 0x6004000, 0x6000000, 0x6000000, 0x6000000,
+ 0x004000, 0x004000, 0x8804000, 0x004000, 0x6000000, 0x6000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0xfa84000, 0xfa00000, 0x000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0xfa80000, 0xfa00000, 0x000000, 0x000000, 0x8800000, 0x8800000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0xea80000, 0xea00000, 0x000000, 0x000000,
+ 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000, 0x000000, 0xfa80000, 0xfa00000,
+ 0x8800000, 0x8800000, 0x020000, 0xfa00000, 0x000000, 0x000000, 0xfa00000, 0xfa80000,
+ 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x080000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x200000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_26[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xfa80000, 0xfa00000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x8880000, 0x8800000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x080000, 0x8800000, 0x000000, 0x8880000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0xfa00000, 0x000000, 0xfa00000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x88c0000, 0x8800000, 0x000000, 0x88c0000, 0x8800000, 0x88c0000, 0x0c0000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8a00000, 0x000000, 0x8800000, 0x8a00000, 0x000000, 0x200000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_27[] = {
+ 0x000000, 0x080000, 0x080000, 0x080000, 0x080000, 0x000000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x000000, 0x000000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x000000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x4080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x000000, 0x080000, 0x000000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x000000, 0x000000, 0x000000, 0x080000, 0x000000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x000000,
+ 0x000000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x000000, 0x000000, 0x000000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x000000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000, 0x080000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_2e[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_2f[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_30[] = {
+ 0x7000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x000000, 0x5200000, 0x4200000, 0x4200000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6200000, 0x9a00000, 0xfa00000, 0xfa00000, 0x1000000, 0x1000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x200000, 0x6000000, 0x6000000, 0x000000,
+ 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x2000000, 0x000000, 0x2000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4200000, 0x4200000, 0x4200000, 0x4200000, 0x000000,
+ 0x000000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000,
+ 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0xda00000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x8a00000, 0x4200000, 0x4200000, 0x4200000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_31[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_32[] = {
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000, 0x8800000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x6000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_33[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0xe800000, 0xe800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0xe800000, 0xe800000, 0xe800000, 0x8800000,
+ 0x8800000, 0xe800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0xe800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x000000, 0x000000, 0x000000, 0x6000000, 0x8800000,
+ 0x8800000, 0x6000000, 0x6000000, 0x8800000, 0x000000, 0x6000000, 0x8800000, 0x000000,
+ 0x8800000, 0x000000, 0x000000, 0x8800000, 0x8800000, 0x8800000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_34[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_35[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_36[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_37[] = {
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_38[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_39[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_3a[] = {
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_3b[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_3c[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_3d[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_3e[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_3f[] = {
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_40[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_41[] = {
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_42[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_43[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_44[] = {
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_45[] = {
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_46[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_47[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_48[] = {
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_49[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_4a[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_4b[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_4c[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_4d[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_4e[] = {
+ 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0x4400000, 0x400000, 0x000000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7400000, 0xfa00000, 0x7200000, 0x6000000,
+ 0x7200000, 0xfa00000, 0x400000, 0x1000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x200000,
+ 0xfa00000, 0xfa00000, 0x5000000, 0x1000000, 0x5000000, 0x1000000, 0xfa00000, 0x6400000,
+ 0x000000, 0x4200000, 0x1000000, 0x400000, 0x5400000, 0x1000000, 0x6200000, 0x1000000,
+ 0x5400000, 0x000000, 0x5200000, 0x7400000, 0x5000000, 0xfa00000, 0x6400000, 0x4400000,
+ 0x7400000, 0x6200000, 0xfa00000, 0x6000000, 0x1000000, 0x400000, 0x5200000, 0x4000000,
+ 0xfa00000, 0xfa00000, 0x1000000, 0xfa00000, 0x6200000, 0x5000000, 0x1000000, 0x5200000,
+ 0x400000, 0x400000, 0xea00000, 0xfa00000, 0x400000, 0xfa00000, 0x000000, 0x7400000,
+ 0x7000000, 0x5000000, 0x000000, 0xfa00000, 0x1000000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x1000000, 0x400000, 0x7000000, 0x7000000, 0x1000000, 0x200000, 0xfa00000, 0x200000,
+ 0xfa00000, 0xfa00000, 0x4400000, 0x4000000, 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x1000000, 0x1000000, 0x200000, 0x400000, 0x000000, 0x000000, 0x1000000, 0x000000,
+ 0x400000, 0x7400000, 0x4000000, 0x8800000, 0x000000, 0x8800000, 0x000000, 0x000000,
+ 0x1000000, 0x1200000, 0x000000, 0xfa00000, 0x400000, 0x400000, 0x8800000, 0x8800000,
+ 0x4000000, 0x400000, 0x000000, 0x000000, 0x000000, 0x000000, 0xfa00000, 0x6400000,
+ 0x4200000, 0x4000000, 0xea00000, 0x6000000, 0x6000000, 0x4200000, 0xfa00000, 0x4000000,
+ 0xfa00000, 0x5200000, 0x200000, 0xfa00000, 0xfa00000, 0x7400000, 0xfa00000, 0x1000000,
+ 0x8800000, 0xfa00000, 0xfa00000, 0x7000000, 0xfa00000, 0xfa00000, 0x400000, 0x400000,
+ 0xda00000, 0x6200000, 0x5000000, 0xfa00000, 0x200000, 0x400000, 0xea00000, 0x7200000,
+ 0x5200000, 0xfa00000, 0xfa00000, 0x4000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x1000000,
+ 0xfa00000, 0x1000000, 0x000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x400000,
+ 0x200000, 0x000000, 0x1000000, 0x7200000, 0x000000, 0x1000000, 0xea00000, 0x4000000,
+ 0x000000, 0x6400000, 0xfa00000, 0x5000000, 0x4000000, 0x000000, 0x000000, 0x5000000,
+ 0xfa00000, 0xfa00000, 0x7200000, 0x7400000, 0xfa00000, 0x1000000, 0x7200000, 0xfa00000,
+ 0x6000000, 0x7000000, 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0x5200000, 0x200000,
+ 0x400000, 0x1000000, 0x000000, 0x1000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x400000, 0x6000000, 0xfa00000, 0x7200000, 0xfa00000,
+ 0x400000, 0x7400000, 0x400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x000000, 0x000000,
+ 0x7400000, 0x6000000, 0x5000000, 0x5000000, 0x1000000, 0x200000, 0x4200000, 0x400000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x7400000, 0x6000000, 0x7400000, 0xfa00000, 0xfa00000,
+ 0x4000000, 0x000000, 0x000000, 0xfa00000, 0x000000, 0x7400000, 0x400000, 0x7400000
+};
+
+static const unsigned long unicode_backtrans_4f[] = {
+ 0x6400000, 0xfa00000, 0x6400000, 0x4400000, 0x6000000, 0x6000000, 0x000000, 0x000000,
+ 0x6400000, 0xfa00000, 0xfa00000, 0xec00000, 0x400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0x400000, 0x5400000,
+ 0x7000000, 0x7400000, 0x5200000, 0x1000000, 0x200000, 0x6200000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x7000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x4000000, 0x4000000, 0x1000000, 0x1000000, 0x6000000, 0x6000000, 0x400000, 0xfa00000,
+ 0x7200000, 0x400000, 0x5000000, 0x6400000, 0xfa00000, 0x400000, 0xfa00000, 0x4400000,
+ 0xfa00000, 0x4400000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000, 0x6400000, 0x6000000,
+ 0x400000, 0x6000000, 0x4400000, 0xfa00000, 0x000000, 0x4000000, 0xfa00000, 0xea00000,
+ 0xec00000, 0x6400000, 0x000000, 0x4400000, 0x6400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x7200000, 0x6400000, 0xfa00000, 0x6400000, 0x7200000,
+ 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7200000, 0x7200000, 0x7400000,
+ 0x7400000, 0x6000000, 0x6000000, 0x7400000, 0x7000000, 0x1000000, 0x000000, 0x7000000,
+ 0x000000, 0xfa00000, 0x6400000, 0x6000000, 0x7400000, 0x000000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0x400000, 0x4000000, 0xfa00000, 0x7000000, 0x6200000, 0xfa00000, 0x6400000,
+ 0x6400000, 0x6400000, 0xec00000, 0x7200000, 0x7200000, 0x6400000, 0xfc00000, 0xfa00000,
+ 0x6000000, 0xec00000, 0x6400000, 0xfa00000, 0xfc00000, 0x6400000, 0xea00000, 0x6000000,
+ 0xfa00000, 0x7400000, 0xcc00000, 0xfa00000, 0x400000, 0xfa00000, 0x400000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x6400000, 0x400000, 0x7400000, 0x6000000, 0xea00000, 0x7400000,
+ 0xea00000, 0x400000, 0x6400000, 0xfa00000, 0x6000000, 0xfa00000, 0x6400000, 0x400000,
+ 0x1200000, 0x200000, 0x4000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x5000000, 0x1000000, 0x1000000, 0x4200000, 0x1000000, 0x200000, 0xfa00000, 0xfa00000,
+ 0x4000000, 0x000000, 0x6400000, 0x6000000, 0x000000, 0xfa00000, 0xea00000, 0x6400000,
+ 0x000000, 0x6400000, 0x6000000, 0x6400000, 0x400000, 0x4400000, 0x400000, 0xfa00000,
+ 0x6400000, 0x6400000, 0xea00000, 0xfa00000, 0xfa00000, 0x7400000, 0x400000, 0x6000000,
+ 0x4400000, 0xec00000, 0xfa00000, 0x6400000, 0x4400000, 0x6400000, 0xfa00000, 0x7400000,
+ 0x7200000, 0xfa00000, 0x400000, 0xe800000, 0xea00000, 0x000000, 0x6000000, 0xfa00000,
+ 0x7200000, 0x6000000, 0xfa00000, 0x6200000, 0x7400000, 0xfa00000, 0x7000000, 0xfa00000,
+ 0xec00000, 0xfa00000, 0x400000, 0x1200000, 0x4200000, 0x4200000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x6000000, 0x1000000, 0xfa00000, 0xfa00000,
+ 0x4400000, 0xf800000, 0x4400000, 0xfa00000, 0x6000000, 0xea00000, 0x6200000, 0x6000000,
+ 0xfa00000, 0x4000000, 0xfa00000, 0x000000, 0x400000, 0x4400000, 0x7200000, 0x400000
+};
+
+static const unsigned long unicode_backtrans_50[] = {
+ 0x6400000, 0x400000, 0x8800000, 0x4000000, 0x400000, 0x6200000, 0xea00000, 0x6400000,
+ 0x4000000, 0xea00000, 0x400000, 0xea00000, 0x7400000, 0xfa00000, 0x6400000, 0x7200000,
+ 0x400000, 0xea00000, 0xfa00000, 0x6400000, 0x7200000, 0x6000000, 0xea00000, 0x6400000,
+ 0x7400000, 0xfa00000, 0xfa00000, 0x6400000, 0xfc00000, 0x400000, 0xec00000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x6400000, 0xea00000, 0x8a00000, 0x7200000, 0xfa00000, 0xec00000,
+ 0xfa00000, 0x7200000, 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000, 0x5400000, 0x6000000,
+ 0x6400000, 0x6000000, 0x400000, 0x6400000, 0x4000000, 0x6400000, 0x200000, 0x6000000,
+ 0x000000, 0x200000, 0x1000000, 0xcc00000, 0x7000000, 0x000000, 0x1000000, 0x000000,
+ 0x6400000, 0x6400000, 0x400000, 0xfa00000, 0x000000, 0x6400000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0xea00000, 0x6400000, 0x6000000, 0x7400000, 0x6000000, 0x7400000, 0xfa00000,
+ 0x200000, 0x6400000, 0x400000, 0x6400000, 0x000000, 0xfa00000, 0x4200000, 0x6400000,
+ 0x4000000, 0x400000, 0xfa00000, 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0xfa00000, 0x4400000, 0x400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x5200000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6400000, 0x400000, 0x6200000, 0x6000000, 0xea00000, 0xea00000, 0xfa00000, 0x7000000,
+ 0x8a00000, 0x000000, 0x6000000, 0x1000000, 0x000000, 0x6200000, 0x1000000, 0x1000000,
+ 0xfa00000, 0x4400000, 0x6000000, 0x6400000, 0x400000, 0xfa00000, 0x400000, 0x6000000,
+ 0x5000000, 0x000000, 0x400000, 0x6000000, 0x6000000, 0xfa00000, 0x6400000, 0x400000,
+ 0x4400000, 0xea00000, 0x6400000, 0x400000, 0x6400000, 0x6000000, 0x6400000, 0x000000,
+ 0xea00000, 0xea00000, 0x6200000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x400000,
+ 0x400000, 0x400000, 0x6400000, 0x7000000, 0x000000, 0x1000000, 0x4000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x400000, 0x000000, 0xfa00000, 0xea00000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6000000, 0xfa00000, 0xea00000, 0x6200000, 0xea00000, 0x6000000, 0xea00000,
+ 0x6000000, 0x400000, 0x7400000, 0x7000000, 0x4000000, 0x6400000, 0xea00000, 0x6000000,
+ 0x400000, 0x6000000, 0x6200000, 0x400000, 0x6400000, 0xea00000, 0x6000000, 0x6400000,
+ 0x6000000, 0xea00000, 0xea00000, 0x6000000, 0x400000, 0x4200000, 0x6400000, 0xfa00000,
+ 0x4400000, 0xea00000, 0x000000, 0x6400000, 0x6400000, 0xea00000, 0xfa00000, 0x6000000,
+ 0x400000, 0x4000000, 0xfa00000, 0x6000000, 0x400000, 0x6400000, 0x8a00000, 0x4400000,
+ 0x6000000, 0x4000000, 0x400000, 0x6200000, 0x6400000, 0xea00000, 0x7400000, 0xfa00000,
+ 0x6400000, 0x6400000, 0x6000000, 0x000000, 0x7000000, 0xfa00000, 0x7200000, 0x6400000,
+ 0x6000000, 0x6400000, 0x400000, 0x7000000, 0x4000000, 0x7200000, 0x6400000, 0x000000,
+ 0x6000000, 0xea00000, 0x400000, 0xfa00000, 0x4000000, 0x6000000, 0x6400000, 0xe800000
+};
+
+static const unsigned long unicode_backtrans_51[] = {
+ 0xea00000, 0xca00000, 0x6200000, 0x6400000, 0xea00000, 0x6000000, 0xfc00000, 0x7400000,
+ 0x6400000, 0xea00000, 0x6000000, 0x7400000, 0x6400000, 0x4400000, 0x4400000, 0x000000,
+ 0x6400000, 0x6000000, 0xfa00000, 0x6000000, 0x6200000, 0x6200000, 0x200000, 0x6400000,
+ 0x6200000, 0x400000, 0x6200000, 0x400000, 0x6400000, 0x400000, 0x400000, 0xea00000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x400000,
+ 0x400000, 0x6000000, 0xea00000, 0x4000000, 0x400000, 0x6400000, 0x6000000, 0x400000,
+ 0x6000000, 0x6400000, 0xea00000, 0x6400000, 0x6400000, 0x6400000, 0x000000, 0xea00000,
+ 0x6400000, 0x6400000, 0xea00000, 0x6200000, 0xea00000, 0x6000000, 0x000000, 0x7200000,
+ 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0xea00000, 0xfa00000, 0x8a00000, 0x400000,
+ 0x200000, 0x1000000, 0xea00000, 0x400000, 0x7200000, 0x7400000, 0x5000000, 0x6400000,
+ 0x400000, 0x6000000, 0x7200000, 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x6400000,
+ 0x4000000, 0x6000000, 0xfa00000, 0x6000000, 0x400000, 0xfa00000, 0x400000, 0xe800000,
+ 0xfa00000, 0xea00000, 0xca00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x000000,
+ 0x1000000, 0xfa00000, 0x000000, 0x1000000, 0x5000000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x5000000, 0x000000, 0x1000000, 0xfa00000, 0x1000000, 0x400000, 0x000000,
+ 0xfa00000, 0x1000000, 0x5200000, 0x400000, 0x400000, 0x1200000, 0xca00000, 0x6000000,
+ 0x5000000, 0x7200000, 0xea00000, 0x400000, 0x1200000, 0xfa00000, 0x400000, 0x6200000,
+ 0x200000, 0x6200000, 0xfa00000, 0x6200000, 0x6000000, 0xfa00000, 0x5200000, 0xfa00000,
+ 0x6400000, 0x1200000, 0x4000000, 0x1000000, 0x5000000, 0x400000, 0x6000000, 0x000000,
+ 0xfa00000, 0x400000, 0x7200000, 0x400000, 0x7200000, 0xfa00000, 0x200000, 0x4000000,
+ 0x4200000, 0x200000, 0xea00000, 0x5200000, 0xfa00000, 0x400000, 0x4000000, 0x1000000,
+ 0x7200000, 0x7200000, 0x5200000, 0x5200000, 0x4200000, 0x5200000, 0xfa00000, 0xfa00000,
+ 0x4400000, 0x6000000, 0x400000, 0x1000000, 0x7400000, 0xfa00000, 0x6400000, 0x400000,
+ 0x1000000, 0x000000, 0x400000, 0x4000000, 0xfa00000, 0x6200000, 0xfa00000, 0x5000000,
+ 0x6400000, 0xda00000, 0x6000000, 0xfa00000, 0xfa00000, 0xea00000, 0x6000000, 0x5400000,
+ 0x6000000, 0x5400000, 0x4400000, 0x4400000, 0x6000000, 0x400000, 0x200000, 0x6000000,
+ 0x6400000, 0x000000, 0x000000, 0x5200000, 0xea00000, 0xfa00000, 0xec00000, 0x4000000,
+ 0x7200000, 0xfa00000, 0x4400000, 0x000000, 0x5000000, 0x400000, 0x200000, 0x200000,
+ 0x000000, 0x200000, 0x200000, 0x1000000, 0x000000, 0x5200000, 0x400000, 0x1000000,
+ 0xfa00000, 0xea00000, 0x400000, 0x7400000, 0x4400000, 0x7200000, 0xfa00000, 0x400000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x1000000, 0x5000000, 0xfa00000, 0x4200000, 0x1000000
+};
+
+static const unsigned long unicode_backtrans_52[] = {
+ 0xfa00000, 0x7400000, 0x5400000, 0xfa00000, 0x200000, 0x4400000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x6000000, 0xfa00000, 0x4200000, 0x6000000, 0x1000000, 0xfa00000, 0x000000,
+ 0x6000000, 0xfa00000, 0x7400000, 0x6400000, 0x200000, 0x400000, 0x7400000, 0xfa00000,
+ 0x1400000, 0x1000000, 0x1000000, 0x1000000, 0x6000000, 0xfa00000, 0x6000000, 0x4000000,
+ 0x5000000, 0x6000000, 0x400000, 0x000000, 0xfa00000, 0xea00000, 0x4000000, 0x4200000,
+ 0x7400000, 0xfa00000, 0xea00000, 0x1000000, 0x000000, 0x1000000, 0xfa00000, 0x000000,
+ 0xfa00000, 0x6400000, 0x6400000, 0x7200000, 0x4000000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x9a00000, 0xfa00000, 0xfa00000, 0x4400000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x7000000, 0x1000000, 0xfa00000, 0x6200000, 0x400000, 0x6000000, 0xea00000,
+ 0x000000, 0x6400000, 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000, 0x6000000, 0x200000,
+ 0x1000000, 0x1000000, 0x6000000, 0x000000, 0xfa00000, 0x6400000, 0xfa00000, 0x4400000,
+ 0x400000, 0x4000000, 0x6400000, 0xea00000, 0x7400000, 0xe800000, 0x7200000, 0x6400000,
+ 0x4400000, 0xfc00000, 0x6000000, 0x200000, 0x200000, 0x1200000, 0x400000, 0x1000000,
+ 0x4000000, 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0xfa00000,
+ 0x200000, 0x200000, 0xfa00000, 0x4200000, 0x6200000, 0xea00000, 0x000000, 0x6400000,
+ 0x6400000, 0x4400000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0x000000, 0xfa00000,
+ 0x6400000, 0x7000000, 0x7400000, 0xea00000, 0x6000000, 0x400000, 0x000000, 0xea00000,
+ 0xfa00000, 0xea00000, 0x6400000, 0x6000000, 0x6400000, 0xea00000, 0x000000, 0x4000000,
+ 0x5000000, 0xea00000, 0x8a00000, 0x7400000, 0x4200000, 0x400000, 0x6400000, 0x6400000,
+ 0x6400000, 0x6000000, 0x4400000, 0xfa00000, 0x400000, 0x1000000, 0x1000000, 0xfa00000,
+ 0xfa00000, 0x5000000, 0x1000000, 0xfa00000, 0xcc00000, 0x400000, 0x6400000, 0x400000,
+ 0x5000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7200000, 0x7200000, 0x6000000, 0x400000,
+ 0x400000, 0x1200000, 0x1000000, 0x1000000, 0x200000, 0x4200000, 0x400000, 0x400000,
+ 0x400000, 0x4200000, 0x400000, 0x6400000, 0x6200000, 0x400000, 0xfa00000, 0x1000000,
+ 0x6400000, 0xea00000, 0x6000000, 0xfa00000, 0x400000, 0xca00000, 0x400000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x000000, 0x1000000, 0x4400000, 0xea00000, 0x000000, 0x400000,
+ 0x5000000, 0x4400000, 0xfa00000, 0x6000000, 0x400000, 0xea00000, 0xfc00000, 0x6200000,
+ 0xfa00000, 0xea00000, 0x000000, 0xec00000, 0x400000, 0xea00000, 0xea00000, 0xfa00000,
+ 0x4200000, 0x4400000, 0xea00000, 0xea00000, 0xfa00000, 0x400000, 0x6200000, 0x200000,
+ 0x400000, 0x6400000, 0x400000, 0x6000000, 0x400000, 0x000000, 0x000000, 0x6000000,
+ 0x7400000, 0x6400000, 0x200000, 0xea00000, 0x6400000, 0xea00000, 0x400000, 0x6400000,
+ 0xea00000, 0x5200000, 0xfa00000, 0xe800000, 0x6000000, 0x000000, 0xfa00000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_53[] = {
+ 0x1400000, 0x4200000, 0x200000, 0x400000, 0x000000, 0xda00000, 0x7200000, 0x000000,
+ 0xfa00000, 0x6000000, 0x6400000, 0x6400000, 0x400000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0xfa00000, 0x6400000, 0x6000000, 0x400000, 0x000000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x7200000, 0x400000, 0x6400000, 0x7200000, 0x400000, 0x6400000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0xfa00000, 0x4000000, 0x400000, 0x1000000, 0x4400000,
+ 0x400000, 0x400000, 0xfa00000, 0x400000, 0x4400000, 0x6400000, 0x1000000, 0xea00000,
+ 0x6400000, 0x6200000, 0x4400000, 0x4200000, 0x6000000, 0x400000, 0x000000, 0x6000000,
+ 0x4200000, 0xfa00000, 0x1200000, 0x5200000, 0x6400000, 0x6400000, 0x7400000, 0xfa00000,
+ 0xea00000, 0xfa00000, 0x4400000, 0xfa00000, 0xe800000, 0x7200000, 0x200000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x400000, 0x6400000, 0xea00000, 0x5000000, 0x1000000,
+ 0x000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xea00000, 0x1000000, 0x1000000, 0xfa00000,
+ 0x200000, 0x400000, 0xfa00000, 0x400000, 0xfa00000, 0x4000000, 0xfa00000, 0x5000000,
+ 0xfa00000, 0x7400000, 0x1000000, 0x7400000, 0x5000000, 0x400000, 0xfa00000, 0x5000000,
+ 0x8800000, 0x5200000, 0x000000, 0x1000000, 0x6400000, 0x4400000, 0x7200000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x7200000, 0xda00000, 0xfa00000, 0x000000, 0xfa00000,
+ 0x7200000, 0x6400000, 0x1000000, 0x6200000, 0x6000000, 0xc800000, 0x4400000, 0xfa00000,
+ 0x000000, 0x000000, 0x7200000, 0x400000, 0xfa00000, 0x1000000, 0x1000000, 0x400000,
+ 0x400000, 0x1000000, 0x6000000, 0x1000000, 0x1000000, 0x1000000, 0x6400000, 0x6000000,
+ 0x000000, 0x000000, 0x6000000, 0xcc00000, 0x6400000, 0x1000000, 0x6200000, 0x6000000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x000000, 0x6000000, 0x7400000, 0x6000000, 0xfa00000,
+ 0xca00000, 0x400000, 0x5000000, 0x1000000, 0x6400000, 0xfa00000, 0xda00000, 0x6000000,
+ 0x5200000, 0x5200000, 0x4400000, 0x4400000, 0x6000000, 0xea00000, 0x5200000, 0x400000,
+ 0x4200000, 0x000000, 0x6400000, 0x200000, 0x6400000, 0x400000, 0x5200000, 0x400000,
+ 0x400000, 0x6000000, 0x400000, 0xfa00000, 0x000000, 0x400000, 0x000000, 0x1000000,
+ 0x400000, 0x5000000, 0x5200000, 0xea00000, 0x000000, 0x4400000, 0x000000, 0x000000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x5200000, 0xfa00000, 0x200000, 0x400000,
+ 0x4000000, 0x5000000, 0x4400000, 0x400000, 0xfa00000, 0x400000, 0xfa00000, 0xfa00000,
+ 0x5000000, 0x5200000, 0x4400000, 0xfa00000, 0x000000, 0x400000, 0x400000, 0x7200000,
+ 0x5400000, 0xea00000, 0xea00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7400000, 0x400000,
+ 0x7200000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7200000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x000000, 0x7400000, 0x5200000, 0x5200000,
+ 0xfa00000, 0x1000000, 0x200000, 0x7000000, 0x7000000, 0x1000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_54[] = {
+ 0x000000, 0x7200000, 0x400000, 0xfa00000, 0xfa00000, 0x000000, 0x7000000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x6200000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x7000000, 0x5400000, 0x4000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x6000000, 0x6000000, 0x4400000, 0xfa00000, 0x6000000, 0xfa00000, 0x7000000, 0xfa00000,
+ 0xfa00000, 0x5400000, 0x000000, 0x5000000, 0x6000000, 0x6000000, 0xfa00000, 0x7400000,
+ 0x7400000, 0xfa00000, 0x6400000, 0xfa00000, 0x7200000, 0x7200000, 0x7200000, 0x5400000,
+ 0x6000000, 0x7400000, 0x5000000, 0xe800000, 0x5400000, 0x7400000, 0x6200000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0xfa00000, 0x6200000, 0xfa00000, 0x000000,
+ 0x7200000, 0x6000000, 0xea00000, 0x7400000, 0x400000, 0x6000000, 0x7200000, 0x6400000,
+ 0xfa00000, 0x200000, 0xfa00000, 0x5000000, 0x000000, 0x4400000, 0x6200000, 0x6400000,
+ 0x1000000, 0x8a00000, 0x1000000, 0x1000000, 0x7000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x400000, 0x200000,
+ 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x7400000, 0x6000000, 0x7400000, 0x6400000,
+ 0xfa00000, 0x4400000, 0xca00000, 0x6400000, 0x6000000, 0x4400000, 0x400000, 0x6000000,
+ 0x6200000, 0xfa00000, 0x7000000, 0xfa00000, 0x6400000, 0xfa00000, 0x7200000, 0x7200000,
+ 0x7000000, 0x000000, 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x6400000, 0x7000000, 0x400000, 0x7200000, 0x4400000, 0xfa00000, 0x6000000,
+ 0x6400000, 0x400000, 0x000000, 0x7200000, 0xfa00000, 0x6400000, 0xfa00000, 0x5200000,
+ 0xfa00000, 0x6400000, 0x7200000, 0x4000000, 0x5000000, 0x7400000, 0x7400000, 0x4000000,
+ 0x6000000, 0x1000000, 0x7000000, 0x1000000, 0x4400000, 0x1000000, 0x4000000, 0x400000,
+ 0x6000000, 0x6400000, 0x6200000, 0x5000000, 0xda00000, 0x6200000, 0x7400000, 0x7400000,
+ 0xfa00000, 0x7400000, 0x7400000, 0xfa00000, 0xfa00000, 0x7400000, 0x6400000, 0x7200000,
+ 0x6000000, 0x7400000, 0x4200000, 0xfa00000, 0x5000000, 0x000000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x4400000, 0x6400000, 0x7400000, 0x6200000, 0xfa00000, 0x6200000, 0x7400000,
+ 0xfa00000, 0xfa00000, 0x7200000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000, 0x7200000,
+ 0xfa00000, 0xfa00000, 0x400000, 0x4000000, 0x5000000, 0x5400000, 0x7400000, 0x7000000,
+ 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x6000000, 0x1000000,
+ 0x200000, 0x1000000, 0x5000000, 0x000000, 0x1000000, 0x1000000, 0x7000000, 0x1000000,
+ 0x6400000, 0xea00000, 0x6200000, 0x4000000, 0x6000000, 0xfa00000, 0x7200000, 0x7000000,
+ 0xfa00000, 0x7200000, 0x7400000, 0x6000000, 0x400000, 0xfa00000, 0xfa00000, 0x4400000,
+ 0x000000, 0x6000000, 0xfa00000, 0x7000000, 0x000000, 0x000000, 0x400000, 0x6000000,
+ 0x6000000, 0x000000, 0xfa00000, 0x6000000, 0x7400000, 0x7200000, 0x400000, 0x7400000
+};
+
+static const unsigned long unicode_backtrans_55[] = {
+ 0x400000, 0x7400000, 0x4000000, 0x6000000, 0xea00000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0x6400000, 0x7400000, 0x6000000, 0x6000000, 0x6400000, 0x4400000, 0xec00000, 0x7200000,
+ 0xfa00000, 0x7000000, 0x6000000, 0x4000000, 0x7200000, 0x400000, 0x200000, 0x6000000,
+ 0x4000000, 0x000000, 0x6000000, 0x1000000, 0x8800000, 0x000000, 0x4000000, 0x000000,
+ 0x1000000, 0x000000, 0x1000000, 0x5000000, 0x1000000, 0x4000000, 0x6000000, 0x7000000,
+ 0x4000000, 0x000000, 0x7400000, 0x4400000, 0x7000000, 0x6000000, 0x7200000, 0xfa00000,
+ 0x7000000, 0xfa00000, 0x6400000, 0x7200000, 0x6000000, 0xec00000, 0x6400000, 0x7000000,
+ 0x6200000, 0x6200000, 0x000000, 0x6400000, 0x7400000, 0x400000, 0xfa00000, 0x5000000,
+ 0x6200000, 0x7400000, 0x000000, 0x7000000, 0xfa00000, 0x6200000, 0xfa00000, 0x4400000,
+ 0x6000000, 0x5400000, 0x7400000, 0x6000000, 0x200000, 0x6400000, 0x6000000, 0xea00000,
+ 0x7400000, 0x6400000, 0x6000000, 0xca00000, 0x000000, 0x7000000, 0xfa00000, 0x6200000,
+ 0x400000, 0x000000, 0x400000, 0x400000, 0x7200000, 0x4200000, 0xec00000, 0x6000000,
+ 0x400000, 0x7400000, 0x6000000, 0xea00000, 0x7400000, 0x7000000, 0x7400000, 0x1000000,
+ 0x000000, 0x4000000, 0x7000000, 0x4000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x1000000, 0x4000000, 0x000000, 0x7200000, 0xfa00000, 0x6000000, 0x7200000, 0x6400000,
+ 0xfa00000, 0x7400000, 0x7400000, 0x7200000, 0xfa00000, 0x000000, 0xcc00000, 0xfa00000,
+ 0x7400000, 0xfa00000, 0xfa00000, 0x7200000, 0x6000000, 0x6000000, 0x6400000, 0x7400000,
+ 0x4000000, 0x7400000, 0x6400000, 0x6400000, 0x7400000, 0x6000000, 0x000000, 0x400000,
+ 0xfa00000, 0xfa00000, 0xea00000, 0x000000, 0xfa00000, 0xfa00000, 0x200000, 0x7200000,
+ 0x000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0xfa00000,
+ 0x6200000, 0xca00000, 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0xea00000, 0x000000,
+ 0x4200000, 0x7000000, 0x6400000, 0x7000000, 0x4000000, 0x7000000, 0x200000, 0x1000000,
+ 0x000000, 0x5000000, 0x4000000, 0x7000000, 0x4000000, 0x1000000, 0x1000000, 0x6400000,
+ 0x6000000, 0x4400000, 0x6000000, 0x6400000, 0x7200000, 0xfa00000, 0x6400000, 0xea00000,
+ 0x6000000, 0x7400000, 0x6000000, 0x6400000, 0x7400000, 0x7000000, 0x6400000, 0x6000000,
+ 0x6000000, 0x7400000, 0x7400000, 0x7400000, 0xfa00000, 0x6000000, 0x7000000, 0x4400000,
+ 0x4400000, 0x6000000, 0xea00000, 0x6400000, 0xfa00000, 0x7000000, 0x4400000, 0xfa00000,
+ 0x000000, 0x7000000, 0x6400000, 0xfa00000, 0xfa00000, 0x7000000, 0x7000000, 0x6000000,
+ 0x7000000, 0x6400000, 0x5000000, 0x1000000, 0x5000000, 0x000000, 0x000000, 0x7000000,
+ 0x4000000, 0x4000000, 0x7000000, 0x1000000, 0x000000, 0x5000000, 0x6400000, 0x7200000,
+ 0x000000, 0x6200000, 0x6000000, 0x4000000, 0x6000000, 0xfa00000, 0xfa00000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_56[] = {
+ 0x7000000, 0x7000000, 0x6000000, 0x000000, 0x6000000, 0x4400000, 0xea00000, 0x000000,
+ 0x7400000, 0xfa00000, 0x400000, 0x000000, 0x7000000, 0x6400000, 0x7400000, 0x7400000,
+ 0x6400000, 0x4400000, 0x6400000, 0x6000000, 0xea00000, 0x6000000, 0x6200000, 0xea00000,
+ 0x1200000, 0x400000, 0x000000, 0x7200000, 0x6000000, 0x6000000, 0x5000000, 0x7000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x5000000, 0x1000000, 0x4000000, 0x000000, 0x7000000,
+ 0x000000, 0x6200000, 0x6000000, 0x000000, 0x7400000, 0x5000000, 0x6000000, 0xea00000,
+ 0x6400000, 0x1200000, 0xfa00000, 0x6400000, 0xfa00000, 0x6400000, 0xfa00000, 0x4400000,
+ 0x6200000, 0x7400000, 0x6000000, 0x7400000, 0x400000, 0x6400000, 0x6000000, 0x7400000,
+ 0x6400000, 0x6400000, 0x6200000, 0x4400000, 0x400000, 0x6000000, 0x6400000, 0x000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x400000, 0x7200000, 0x5400000, 0x7200000, 0x4400000,
+ 0x4200000, 0x000000, 0x4000000, 0xe800000, 0x5400000, 0x000000, 0x000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x6000000, 0x200000, 0x1000000, 0x4000000, 0x6400000, 0x000000,
+ 0x6400000, 0x4400000, 0x7400000, 0x6400000, 0x7200000, 0x6000000, 0x6400000, 0x000000,
+ 0xfa00000, 0x7400000, 0x7200000, 0xfa00000, 0x7200000, 0x6400000, 0x6000000, 0x6400000,
+ 0x6000000, 0x7400000, 0x6400000, 0x6000000, 0xea00000, 0x400000, 0x7000000, 0x6000000,
+ 0x6200000, 0x6000000, 0x4200000, 0x5000000, 0x5000000, 0x000000, 0x6000000, 0x6000000,
+ 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x7400000, 0xfa00000, 0x6200000,
+ 0x400000, 0x4000000, 0x4200000, 0x4400000, 0x6400000, 0x6000000, 0x7000000, 0x7200000,
+ 0x6000000, 0x000000, 0x4000000, 0x7000000, 0x200000, 0x6400000, 0x000000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6400000, 0x000000, 0x6000000, 0x6400000, 0x4400000, 0x4400000,
+ 0x200000, 0x4000000, 0x200000, 0x1000000, 0x4000000, 0xea00000, 0x6400000, 0x6400000,
+ 0x6400000, 0x400000, 0x6000000, 0x6400000, 0xec00000, 0x6400000, 0xea00000, 0x5000000,
+ 0x000000, 0x4400000, 0x6000000, 0x6400000, 0xea00000, 0x6000000, 0x6200000, 0x7400000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0xfa00000, 0x6000000, 0x6400000, 0x4000000,
+ 0x6200000, 0x6200000, 0x6200000, 0x6200000, 0x000000, 0x6400000, 0x6000000, 0x000000,
+ 0x6200000, 0x6400000, 0xfc00000, 0x6400000, 0x6400000, 0xec00000, 0x200000, 0x400000,
+ 0x400000, 0xea00000, 0x000000, 0x6200000, 0x7000000, 0x000000, 0x4000000, 0x7200000,
+ 0x200000, 0x400000, 0xfa00000, 0xfa00000, 0x400000, 0x7400000, 0xfa00000, 0x7400000,
+ 0xfa00000, 0x7400000, 0x5000000, 0x200000, 0x7400000, 0x6400000, 0x400000, 0x6400000,
+ 0x400000, 0x000000, 0x6000000, 0x7400000, 0x000000, 0x5400000, 0x6200000, 0x4000000,
+ 0xfa00000, 0x5400000, 0x200000, 0x200000, 0x1000000, 0x1000000, 0x400000, 0x6400000,
+ 0x000000, 0xfa00000, 0xfa00000, 0x000000, 0x000000, 0x5200000, 0x1000000, 0x7200000
+};
+
+static const unsigned long unicode_backtrans_57[] = {
+ 0x4200000, 0x6400000, 0x6400000, 0xfa00000, 0xfa00000, 0x000000, 0x1000000, 0x6400000,
+ 0xfa00000, 0x7200000, 0x7400000, 0xea00000, 0x6400000, 0xea00000, 0x000000, 0x200000,
+ 0x000000, 0x400000, 0xea00000, 0xea00000, 0x6000000, 0x4400000, 0xea00000, 0x000000,
+ 0xea00000, 0x000000, 0x6400000, 0x6400000, 0x7200000, 0x4400000, 0x6000000, 0xfa00000,
+ 0x6400000, 0x000000, 0x6400000, 0x7400000, 0x400000, 0x400000, 0x200000, 0x200000,
+ 0xfa00000, 0x7400000, 0x7400000, 0x000000, 0x7400000, 0xfa00000, 0x7400000, 0x7400000,
+ 0xfa00000, 0x000000, 0x4000000, 0x7400000, 0x6400000, 0x000000, 0x000000, 0x200000,
+ 0x200000, 0x1000000, 0x1000000, 0xfa00000, 0x000000, 0x4400000, 0x7400000, 0x4400000,
+ 0xfa00000, 0x6000000, 0xda00000, 0x4000000, 0x000000, 0x6400000, 0x4400000, 0xfa00000,
+ 0x000000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000, 0xfc00000, 0xfa00000, 0x7200000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x5000000,
+ 0x000000, 0x000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x1000000, 0xfa00000, 0x6400000, 0x000000, 0xfa00000, 0x400000, 0xfa00000, 0x4400000,
+ 0x7400000, 0x7200000, 0xfa00000, 0x7400000, 0x000000, 0x7400000, 0x8c00000, 0x7400000,
+ 0xec00000, 0x6400000, 0x6000000, 0x7400000, 0x6400000, 0xec00000, 0x7000000, 0x7400000,
+ 0x000000, 0x400000, 0x4400000, 0x7400000, 0xfc00000, 0x6000000, 0x4400000, 0x4200000,
+ 0x6000000, 0x400000, 0xfa00000, 0x7400000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0xca00000, 0x200000, 0x4000000, 0xfa00000, 0x7400000, 0x4000000, 0x000000, 0x6000000,
+ 0x4000000, 0x000000, 0x1000000, 0xfa00000, 0x6400000, 0x6400000, 0x000000, 0x6400000,
+ 0x6000000, 0x6400000, 0x6400000, 0x7000000, 0x4400000, 0x6400000, 0x6400000, 0x6400000,
+ 0xfa00000, 0x5400000, 0xfa00000, 0xfa00000, 0x7200000, 0x6000000, 0x1000000, 0x5400000,
+ 0x400000, 0x1400000, 0x4200000, 0x1000000, 0x400000, 0x1000000, 0x7000000, 0x000000,
+ 0x200000, 0x000000, 0x1000000, 0x200000, 0x5000000, 0x6000000, 0x6000000, 0x000000,
+ 0x7400000, 0x6000000, 0x6000000, 0x4000000, 0x6000000, 0x6400000, 0x4000000, 0x6000000,
+ 0x200000, 0x6000000, 0x7000000, 0xfa00000, 0x4000000, 0x000000, 0x6200000, 0xec00000,
+ 0xcc00000, 0x000000, 0x000000, 0xfa00000, 0x6400000, 0x000000, 0xfa00000, 0x7400000,
+ 0x6000000, 0x000000, 0x7200000, 0x200000, 0x7200000, 0x7400000, 0x200000, 0x4000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x6200000, 0x5400000, 0x4400000, 0xfa00000,
+ 0xfa00000, 0x6400000, 0x6000000, 0x6200000, 0x7400000, 0x6000000, 0x4400000, 0x6400000,
+ 0x000000, 0x6400000, 0x000000, 0x000000, 0x6000000, 0x7400000, 0x6000000, 0x5000000,
+ 0xec00000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0x6400000, 0x6400000, 0xea00000,
+ 0x7400000, 0xfa00000, 0xfa00000, 0x6000000, 0xea00000, 0x7400000, 0x4400000, 0x400000
+};
+
+static const unsigned long unicode_backtrans_58[] = {
+ 0xfa00000, 0x6000000, 0xfa00000, 0x4400000, 0x6400000, 0xea00000, 0xfa00000, 0x7000000,
+ 0xec00000, 0xec00000, 0xea00000, 0x7200000, 0x6400000, 0x7400000, 0x6000000, 0x000000,
+ 0x6000000, 0x1000000, 0x4000000, 0x000000, 0x6000000, 0x1200000, 0x000000, 0x000000,
+ 0x000000, 0x7200000, 0x000000, 0x6400000, 0x6000000, 0x6200000, 0xfc00000, 0x400000,
+ 0x7400000, 0xfa00000, 0x4000000, 0x6000000, 0xfa00000, 0x6000000, 0x4400000, 0xec00000,
+ 0x6000000, 0x6000000, 0xfa00000, 0x000000, 0x6000000, 0x6400000, 0x6000000, 0xea00000,
+ 0xfa00000, 0xea00000, 0x6400000, 0x6000000, 0xea00000, 0xfa00000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6400000, 0xca00000, 0x6000000, 0x000000, 0x6200000, 0x000000, 0x6400000,
+ 0x4200000, 0x200000, 0x000000, 0x000000, 0x5000000, 0x000000, 0x000000, 0x4000000,
+ 0x6000000, 0x6400000, 0xea00000, 0xea00000, 0x7400000, 0x7400000, 0x6000000, 0xec00000,
+ 0x400000, 0xfa00000, 0x6200000, 0x6000000, 0xfa00000, 0x6400000, 0x000000, 0xea00000,
+ 0xfa00000, 0x6200000, 0xea00000, 0x6000000, 0x4000000, 0x6000000, 0xfa00000, 0x4400000,
+ 0x000000, 0x8c00000, 0xea00000, 0x6000000, 0xec00000, 0x7000000, 0x000000, 0x400000,
+ 0x6400000, 0x4200000, 0x000000, 0x7200000, 0x5000000, 0x6000000, 0x000000, 0x6000000,
+ 0x200000, 0x6000000, 0x4200000, 0x4000000, 0x6000000, 0xea00000, 0x6000000, 0x000000,
+ 0x400000, 0xea00000, 0x6000000, 0x6000000, 0xec00000, 0x6000000, 0xfa00000, 0x6400000,
+ 0x7400000, 0x7400000, 0x6000000, 0xfa00000, 0x000000, 0xfa00000, 0x6000000, 0x6400000,
+ 0x6400000, 0xfc00000, 0x6400000, 0x6000000, 0x400000, 0x400000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6000000, 0x5000000, 0xfa00000, 0x6400000, 0x000000, 0x400000, 0x200000,
+ 0x6000000, 0x5000000, 0x5000000, 0x000000, 0xea00000, 0x6400000, 0xf800000, 0xfa00000,
+ 0x6400000, 0x6400000, 0x400000, 0x6000000, 0x000000, 0x6000000, 0x6400000, 0x4000000,
+ 0xfa00000, 0xfc00000, 0x4000000, 0x6200000, 0x6000000, 0x000000, 0xea00000, 0x6000000,
+ 0x4000000, 0x6400000, 0x400000, 0xea00000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x200000, 0x200000, 0xea00000, 0xca00000, 0x7400000, 0x6000000, 0xea00000, 0x6000000,
+ 0x000000, 0xfa00000, 0x6400000, 0x000000, 0x400000, 0xfa00000, 0x6000000, 0xea00000,
+ 0x6400000, 0x6000000, 0x200000, 0x4000000, 0x200000, 0x400000, 0xec00000, 0x6000000,
+ 0x4400000, 0xfa00000, 0x6400000, 0xea00000, 0x6400000, 0xfa00000, 0x6400000, 0x200000,
+ 0xea00000, 0xea00000, 0x6400000, 0x6000000, 0x4200000, 0x6400000, 0xea00000, 0xea00000,
+ 0x4000000, 0x400000, 0x6400000, 0x6000000, 0xfa00000, 0x200000, 0x000000, 0x6000000,
+ 0x6000000, 0x6400000, 0x000000, 0xfa00000, 0xfa00000, 0x000000, 0x1200000, 0xea00000,
+ 0x5200000, 0x200000, 0x4200000, 0x5400000, 0x6000000, 0x000000, 0x1000000, 0x200000,
+ 0x000000, 0xfa00000, 0xea00000, 0xca00000, 0x6200000, 0xea00000, 0x6000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_59[] = {
+ 0x000000, 0x000000, 0x5200000, 0x6000000, 0x5000000, 0x4400000, 0x6400000, 0x5000000,
+ 0x000000, 0x200000, 0x4200000, 0x400000, 0x6400000, 0x7000000, 0x6000000, 0xfa00000,
+ 0x200000, 0x4000000, 0x6400000, 0x400000, 0xfc00000, 0xfa00000, 0xfa00000, 0x6000000,
+ 0x200000, 0xfa00000, 0xfa00000, 0x200000, 0xfa00000, 0x400000, 0x000000, 0x5000000,
+ 0x6000000, 0x400000, 0xea00000, 0x400000, 0x7400000, 0x7200000, 0x000000, 0xfa00000,
+ 0x400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6200000, 0xfa00000, 0xfa00000, 0x7400000,
+ 0x400000, 0xfa00000, 0x4200000, 0x400000, 0x5000000, 0x400000, 0x400000, 0xfa00000,
+ 0x7200000, 0x1000000, 0x1000000, 0x000000, 0x7000000, 0x000000, 0xea00000, 0x400000,
+ 0x6000000, 0x1000000, 0x1000000, 0x400000, 0xfa00000, 0x6000000, 0x400000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x1000000, 0x000000, 0x000000, 0xfa00000, 0xfa00000,
+ 0xea00000, 0xfa00000, 0x400000, 0x6400000, 0xfa00000, 0xfa00000, 0x1000000, 0xfa00000,
+ 0x7200000, 0x400000, 0xfa00000, 0x400000, 0x6000000, 0x400000, 0x400000, 0x400000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x400000, 0x000000, 0x5200000, 0x000000, 0xea00000,
+ 0x200000, 0x6200000, 0xea00000, 0xec00000, 0x8a00000, 0xec00000, 0xea00000, 0x400000,
+ 0x6000000, 0x6000000, 0x6400000, 0xfa00000, 0xfa00000, 0x4400000, 0x7400000, 0x6000000,
+ 0xfa00000, 0x7400000, 0x000000, 0x6400000, 0x6400000, 0xfa00000, 0x6000000, 0x6000000,
+ 0x6000000, 0x7200000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x4000000, 0xfa00000, 0x400000, 0x400000, 0x7200000, 0x6400000, 0x6000000,
+ 0x6000000, 0x000000, 0x7400000, 0xfa00000, 0x4000000, 0x400000, 0xfa00000, 0xfc00000,
+ 0x6000000, 0xfa00000, 0x4000000, 0x200000, 0x000000, 0x6200000, 0x7000000, 0x4400000,
+ 0x6000000, 0x6000000, 0x6000000, 0x7200000, 0x7400000, 0xfa00000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x1000000, 0x1000000, 0x1000000, 0xca00000, 0x400000, 0x7400000, 0x7400000,
+ 0x4400000, 0x6000000, 0x7200000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x4400000,
+ 0x4000000, 0xfa00000, 0x6400000, 0xfa00000, 0x6400000, 0x6000000, 0xfa00000, 0x000000,
+ 0x6000000, 0x6400000, 0x000000, 0xec00000, 0x4400000, 0x6000000, 0xfa00000, 0x6000000,
+ 0x6400000, 0xca00000, 0x7400000, 0xfa00000, 0x6000000, 0x6400000, 0x6000000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0x7400000, 0xfa00000, 0xfa00000, 0x000000, 0x6000000, 0x1000000,
+ 0x7000000, 0xca00000, 0xfa00000, 0x6000000, 0xfa00000, 0xfc00000, 0x6400000, 0x400000,
+ 0x6000000, 0x6000000, 0x000000, 0x7400000, 0x6400000, 0x7200000, 0xea00000, 0x400000,
+ 0xfa00000, 0x6000000, 0xea00000, 0x4200000, 0xf800000, 0x6000000, 0xec00000, 0x4400000,
+ 0x4000000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x6200000, 0x6400000,
+ 0xc800000, 0x5000000, 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_5a[] = {
+ 0x6400000, 0xfa00000, 0x4000000, 0xfa00000, 0x1400000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x7200000, 0x6000000, 0x4000000, 0x7400000, 0x4400000, 0x400000, 0x6000000,
+ 0x000000, 0xfa00000, 0x4400000, 0x7400000, 0x000000, 0x6000000, 0x6000000, 0x6000000,
+ 0xfa00000, 0x6000000, 0x4200000, 0xe800000, 0xfa00000, 0x000000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0x4000000, 0x000000, 0x7400000, 0x4400000, 0xfa00000, 0x000000, 0x4400000,
+ 0x400000, 0xfa00000, 0x4400000, 0x4000000, 0x4000000, 0x6400000, 0x6000000, 0x200000,
+ 0x400000, 0x1000000, 0x1000000, 0x6000000, 0x1000000, 0x6200000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x6000000, 0x000000, 0x000000, 0xfa00000, 0x4000000, 0x6000000, 0x000000,
+ 0x7200000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x4400000, 0xfa00000, 0x6400000,
+ 0x6400000, 0xfa00000, 0x7000000, 0x000000, 0x6400000, 0x6000000, 0x000000, 0x000000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x4000000, 0x7400000, 0x6000000, 0x6000000,
+ 0x6000000, 0x4000000, 0xfa00000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x6000000, 0x4000000, 0xfa00000, 0x4400000, 0x6000000, 0x6400000, 0xea00000, 0x7400000,
+ 0x4000000, 0x6000000, 0x7200000, 0x4000000, 0x6200000, 0x6400000, 0x4000000, 0x000000,
+ 0x6000000, 0x4000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x7400000,
+ 0x6000000, 0x4000000, 0x7400000, 0x6400000, 0x6000000, 0x6000000, 0x4400000, 0x7200000,
+ 0x000000, 0x4000000, 0x4000000, 0x6000000, 0x6000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x6000000, 0x6400000, 0x6000000, 0x000000, 0x6000000, 0x6000000,
+ 0x6400000, 0x4000000, 0xfa00000, 0x6400000, 0x6000000, 0x6000000, 0x4400000, 0x6000000,
+ 0x000000, 0x4400000, 0xfa00000, 0xfa00000, 0x6400000, 0x6000000, 0x6400000, 0x6400000,
+ 0x4400000, 0x4000000, 0x6400000, 0x000000, 0x8800000, 0x6000000, 0x6000000, 0x6400000,
+ 0x000000, 0x6000000, 0x1000000, 0x4000000, 0x6400000, 0x000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6400000, 0x7400000, 0x7400000, 0x6000000, 0x7400000, 0x6000000, 0x6000000,
+ 0x7400000, 0x6000000, 0x6400000, 0x6400000, 0x6200000, 0x6200000, 0x7200000, 0x6400000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0x4000000, 0xec00000, 0x000000, 0x6400000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x6000000, 0x6200000, 0xfa00000, 0x6000000, 0x4000000, 0x4400000,
+ 0x200000, 0x000000, 0x1000000, 0x4000000, 0x1000000, 0x6000000, 0x7200000, 0x6200000,
+ 0x7000000, 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x6000000, 0x6000000, 0x6000000,
+ 0x7400000, 0xfa00000, 0x6000000, 0x7200000, 0x4000000, 0x6400000, 0xfa00000, 0x000000,
+ 0x6000000, 0xfa00000, 0x6400000, 0x7000000, 0x6000000, 0x6000000, 0x6400000, 0x000000,
+ 0x4000000, 0x1000000, 0x4000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000,
+ 0x6000000, 0x6000000, 0x4200000, 0x6200000, 0x000000, 0x6400000, 0x4000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_5b[] = {
+ 0x400000, 0x6400000, 0x6000000, 0x6000000, 0x000000, 0xe800000, 0x000000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x000000, 0xea00000, 0xea00000, 0x4000000, 0x000000, 0x6000000,
+ 0x6000000, 0x4000000, 0x000000, 0x6000000, 0x6000000, 0x4000000, 0xfa00000, 0x7400000,
+ 0x000000, 0x6400000, 0x6000000, 0x6400000, 0x000000, 0x6400000, 0x6000000, 0x4000000,
+ 0x6000000, 0x6400000, 0x200000, 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6000000, 0x000000, 0xea00000, 0x4000000, 0x6200000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6200000, 0x000000, 0x7200000, 0x000000, 0x7400000, 0x000000, 0x200000, 0x1000000,
+ 0x6400000, 0x000000, 0x000000, 0x000000, 0x6000000, 0x6000000, 0x6200000, 0x6000000,
+ 0xfa00000, 0x4400000, 0x000000, 0xea00000, 0x4000000, 0x6200000, 0x4000000, 0x6000000,
+ 0x6000000, 0x000000, 0x4000000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x4000000,
+ 0xfa00000, 0xfa00000, 0x400000, 0x7000000, 0xfa00000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0x1000000, 0xfa00000, 0x7200000, 0xfa00000, 0xfa00000, 0x400000, 0xfa00000,
+ 0x000000, 0x000000, 0x7000000, 0xfa00000, 0xfa00000, 0x7200000, 0x5200000, 0x000000,
+ 0x4400000, 0xfa00000, 0x1000000, 0xea00000, 0x7000000, 0x4000000, 0x6400000, 0x400000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x7200000, 0x4000000, 0xfa00000, 0x4000000, 0x6000000,
+ 0xea00000, 0x000000, 0xfa00000, 0x6000000, 0xcc00000, 0x7400000, 0x400000, 0x6400000,
+ 0x5200000, 0x7400000, 0x4000000, 0x7200000, 0x7400000, 0xfa00000, 0x400000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0xfa00000, 0x200000, 0x6400000, 0xfa00000,
+ 0x4400000, 0x400000, 0x6000000, 0xfc00000, 0x400000, 0xfa00000, 0xcc00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x5200000, 0x5000000, 0x4200000,
+ 0x1000000, 0x1000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000,
+ 0x6400000, 0x400000, 0x5000000, 0x1000000, 0xec00000, 0x6400000, 0xea00000, 0x400000,
+ 0xfa00000, 0x400000, 0x400000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x400000,
+ 0xfa00000, 0xfa00000, 0x400000, 0x000000, 0x400000, 0x1000000, 0x1000000, 0xfa00000,
+ 0xec00000, 0x6400000, 0xfa00000, 0xca00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x000000, 0x200000, 0x6000000, 0x6000000, 0xfa00000, 0x6400000, 0x6000000, 0x400000,
+ 0xfa00000, 0x6000000, 0xfa00000, 0xfa00000, 0xea00000, 0x4000000, 0x6400000, 0xcc00000,
+ 0x6400000, 0x6400000, 0x400000, 0x200000, 0x000000, 0x1200000, 0xfa00000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0xea00000, 0x6000000, 0xfa00000, 0xfa00000, 0xea00000, 0xea00000,
+ 0xfa00000, 0xea00000, 0x6000000, 0xea00000, 0xe800000, 0x000000, 0xfa00000, 0xec00000,
+ 0x7200000, 0x6400000, 0x6000000, 0x4200000, 0x400000, 0xea00000, 0xea00000, 0x000000,
+ 0xfa00000, 0x1000000, 0xfa00000, 0x1000000, 0x1000000, 0x400000, 0x200000, 0x5200000
+};
+
+static const unsigned long unicode_backtrans_5c[] = {
+ 0x000000, 0xfa00000, 0x200000, 0x6000000, 0xfa00000, 0x4200000, 0x1200000, 0xea00000,
+ 0xea00000, 0xfa00000, 0xfa00000, 0xea00000, 0x6400000, 0xea00000, 0xea00000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x4200000, 0x5000000, 0x7000000, 0xfa00000, 0x400000,
+ 0x1000000, 0x8800000, 0x7200000, 0x000000, 0x5000000, 0x1000000, 0x4400000, 0x6400000,
+ 0x4200000, 0x000000, 0x7200000, 0x4400000, 0xfa00000, 0x7000000, 0x400000, 0x1000000,
+ 0xea00000, 0x400000, 0x6000000, 0x400000, 0x7400000, 0x200000, 0x400000, 0x000000,
+ 0x6400000, 0xfa00000, 0x400000, 0x6000000, 0x1000000, 0x400000, 0x400000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x1200000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x7200000, 0x1000000, 0x000000, 0x6000000, 0xfa00000, 0xea00000, 0x6000000,
+ 0xfa00000, 0x5000000, 0x5200000, 0xfa00000, 0x6000000, 0xea00000, 0xfa00000, 0x7200000,
+ 0x7200000, 0xfa00000, 0x000000, 0x4200000, 0x6000000, 0xfa00000, 0x6000000, 0x000000,
+ 0x6000000, 0x7400000, 0x400000, 0x8800000, 0x6400000, 0x6000000, 0x5200000, 0x000000,
+ 0xfa00000, 0x1200000, 0xec00000, 0x7400000, 0xea00000, 0xfa00000, 0x1000000, 0x6400000,
+ 0x6400000, 0x6400000, 0x6000000, 0x000000, 0xea00000, 0x6400000, 0x7200000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x000000, 0x6000000, 0x6400000, 0x400000, 0x200000, 0x000000,
+ 0x000000, 0xfa00000, 0x7400000, 0x6400000, 0x6400000, 0x400000, 0x6000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x4000000, 0x6000000, 0x400000,
+ 0x7400000, 0x6000000, 0x6400000, 0x6000000, 0x7200000, 0x7000000, 0x000000, 0x6400000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x6000000, 0x7200000, 0x6000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x5000000, 0x5000000, 0x1000000, 0x5000000, 0x6400000, 0x4000000, 0x6400000,
+ 0x6400000, 0xea00000, 0x7400000, 0x7400000, 0x6000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x6200000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000, 0x7000000, 0x6000000, 0x6000000,
+ 0x6000000, 0xfa00000, 0x400000, 0xfa00000, 0x400000, 0xfc00000, 0x6200000, 0xfa00000,
+ 0xfa00000, 0x000000, 0xcc00000, 0x200000, 0x200000, 0x1000000, 0x8a00000, 0x1000000,
+ 0x8800000, 0x5000000, 0x4000000, 0x000000, 0x1000000, 0x200000, 0x6000000, 0x6200000,
+ 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x6000000, 0x000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x4000000, 0x7400000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x6400000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x000000, 0x400000, 0x6000000, 0x6000000,
+ 0x8a00000, 0x1200000, 0x000000, 0x000000, 0x1000000, 0x5000000, 0x1000000, 0x000000,
+ 0xfa00000, 0x4200000, 0x7200000, 0x000000, 0x6000000, 0x7200000, 0x6400000, 0xca00000,
+ 0xfa00000, 0x6400000, 0x400000, 0x000000, 0xec00000, 0x4000000, 0xea00000, 0x6000000,
+ 0x6000000, 0x6000000, 0x200000, 0xfa00000, 0x000000, 0xea00000, 0x000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_5d[] = {
+ 0x6000000, 0x6400000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x7400000, 0xfa00000,
+ 0x000000, 0x000000, 0x000000, 0x6200000, 0x6000000, 0xec00000, 0xfa00000, 0x6000000,
+ 0x4000000, 0xea00000, 0x6400000, 0x000000, 0xfa00000, 0x4200000, 0xfa00000, 0xea00000,
+ 0x4200000, 0xea00000, 0x6200000, 0x7200000, 0x000000, 0x6000000, 0x7000000, 0x6200000,
+ 0x6000000, 0x000000, 0x6200000, 0x6400000, 0x7400000, 0x6000000, 0x7400000, 0xfc00000,
+ 0x6000000, 0xfa00000, 0x000000, 0x400000, 0x4000000, 0x1000000, 0x7000000, 0x4000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x000000, 0x6000000, 0x7400000, 0x5000000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x000000, 0x6000000, 0x4400000, 0x7000000,
+ 0x4400000, 0x6000000, 0x7400000, 0xfa00000, 0xfa00000, 0x000000, 0x6200000, 0x000000,
+ 0xea00000, 0x6400000, 0x6200000, 0x000000, 0x000000, 0x6400000, 0x4000000, 0x4000000,
+ 0x1000000, 0x6400000, 0x000000, 0x5000000, 0x200000, 0x1000000, 0x6000000, 0x400000,
+ 0x400000, 0x400000, 0x6400000, 0x6000000, 0x400000, 0x6000000, 0x000000, 0x6000000,
+ 0x6000000, 0xfa00000, 0x400000, 0x7000000, 0xfa00000, 0x400000, 0x000000, 0xfa00000,
+ 0x4400000, 0x6000000, 0x6000000, 0x200000, 0x5000000, 0x000000, 0x200000, 0x6000000,
+ 0x000000, 0x6400000, 0x6400000, 0x4000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000,
+ 0x6000000, 0x6400000, 0x7200000, 0x400000, 0x6200000, 0x4000000, 0x6000000, 0xea00000,
+ 0x6400000, 0x6000000, 0x6400000, 0xca00000, 0x200000, 0x6000000, 0x4000000, 0x000000,
+ 0x200000, 0x000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x000000, 0x6000000,
+ 0x000000, 0x7400000, 0x6000000, 0x400000, 0x6000000, 0xfa00000, 0x6000000, 0x6400000,
+ 0xec00000, 0x6000000, 0xea00000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x6400000,
+ 0x6000000, 0x6000000, 0xe800000, 0x4400000, 0x6200000, 0x6000000, 0x6200000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x000000, 0x6400000, 0x6000000, 0x4000000, 0x7200000,
+ 0xec00000, 0x4400000, 0xea00000, 0x000000, 0xea00000, 0xea00000, 0x000000, 0x000000,
+ 0x6000000, 0x4000000, 0x6000000, 0x6400000, 0x000000, 0x1000000, 0x6000000, 0x6400000,
+ 0x000000, 0x6200000, 0x000000, 0x6400000, 0x200000, 0xfa00000, 0x400000, 0x6000000,
+ 0x400000, 0x6000000, 0xea00000, 0x200000, 0x6000000, 0x6000000, 0xea00000, 0x4000000,
+ 0x6400000, 0x400000, 0x000000, 0x5200000, 0x000000, 0xfa00000, 0xfa00000, 0x6000000,
+ 0x6400000, 0xfa00000, 0xf800000, 0x200000, 0x400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x1400000, 0x000000, 0xfa00000, 0x000000, 0x000000, 0xfa00000, 0x1000000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x4200000, 0x000000, 0xfa00000,
+ 0x400000, 0x6400000, 0x000000, 0x200000, 0x000000, 0xfa00000, 0xfa00000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_5e[] = {
+ 0x400000, 0x1000000, 0xfa00000, 0xfa00000, 0x6000000, 0x1000000, 0xfa00000, 0x400000,
+ 0x1000000, 0x4000000, 0x6000000, 0x4200000, 0xfa00000, 0x400000, 0x6000000, 0x1000000,
+ 0x1000000, 0xfa00000, 0x4400000, 0x000000, 0x7400000, 0x7400000, 0xfa00000, 0x6000000,
+ 0x7400000, 0xfa00000, 0x7200000, 0xfa00000, 0x1000000, 0xfa00000, 0x000000, 0x6400000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0xea00000, 0x1000000, 0x1000000,
+ 0x6400000, 0x6000000, 0x000000, 0xea00000, 0x000000, 0xfa00000, 0x5400000, 0x200000,
+ 0x200000, 0x1000000, 0x400000, 0xea00000, 0x6000000, 0x400000, 0xea00000, 0x7200000,
+ 0xfa00000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0xfa00000, 0x6400000, 0x8800000,
+ 0xea00000, 0x6000000, 0x5000000, 0x6200000, 0xfa00000, 0xfa00000, 0x000000, 0x8a00000,
+ 0x4000000, 0x400000, 0x6000000, 0x6400000, 0xfa00000, 0x6000000, 0x6200000, 0x6000000,
+ 0x400000, 0x400000, 0x000000, 0x6000000, 0x7200000, 0xfa00000, 0x400000, 0x6200000,
+ 0x6400000, 0x6000000, 0x000000, 0x7400000, 0x6400000, 0x6000000, 0x5400000, 0xea00000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0xea00000, 0x200000, 0x000000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6000000,
+ 0x6400000, 0x000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6200000, 0x7200000, 0x8800000,
+ 0xfa00000, 0xea00000, 0x5200000, 0xfa00000, 0xfa00000, 0xfa00000, 0xea00000, 0x5200000,
+ 0x7400000, 0x200000, 0x6000000, 0x4200000, 0xfa00000, 0x000000, 0x5000000, 0xfa00000,
+ 0x6000000, 0x6000000, 0xfa00000, 0x7400000, 0x6000000, 0x6000000, 0x400000, 0xfa00000,
+ 0x1000000, 0x1000000, 0x4000000, 0x1000000, 0x1000000, 0xfa00000, 0x7200000, 0xfa00000,
+ 0x000000, 0x5000000, 0xfa00000, 0x6000000, 0xfa00000, 0x000000, 0x1000000, 0x1000000,
+ 0xfa00000, 0x000000, 0x6400000, 0x6000000, 0x6400000, 0x7400000, 0xfa00000, 0xfa00000,
+ 0x6400000, 0x000000, 0x6400000, 0xea00000, 0x6400000, 0xfa00000, 0x6000000, 0x000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x7000000, 0x000000, 0x000000, 0x000000, 0x4400000, 0xfc00000, 0x400000,
+ 0x000000, 0x6200000, 0xea00000, 0x200000, 0x6000000, 0x6000000, 0x6400000, 0x6000000,
+ 0xea00000, 0xfa00000, 0xfa00000, 0x6400000, 0x6400000, 0x4000000, 0x6400000, 0x200000,
+ 0xca00000, 0x7400000, 0x7400000, 0xfa00000, 0x6400000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x6000000, 0xea00000, 0xfa00000, 0x6400000, 0x6200000, 0x6400000, 0xea00000,
+ 0xea00000, 0x6200000, 0xea00000, 0xea00000, 0x000000, 0x6400000, 0x6000000, 0x6000000,
+ 0x7200000, 0x6200000, 0x1000000, 0x400000, 0xea00000, 0x000000, 0x6000000, 0x6000000,
+ 0x200000, 0x6200000, 0x6000000, 0xea00000, 0x5200000, 0x000000, 0xfa00000, 0xfa00000,
+ 0x4200000, 0x4000000, 0xfa00000, 0xca00000, 0x4200000, 0x000000, 0x7200000, 0x7200000
+};
+
+static const unsigned long unicode_backtrans_5f[] = {
+ 0x1000000, 0xfa00000, 0x7400000, 0x1200000, 0xfa00000, 0x6000000, 0x400000, 0x6400000,
+ 0x7400000, 0x200000, 0xfa00000, 0x7200000, 0x4200000, 0x4200000, 0x4400000, 0xfa00000,
+ 0x200000, 0x9a00000, 0x6000000, 0xfa00000, 0xea00000, 0xfa00000, 0x200000, 0xfa00000,
+ 0xfa00000, 0x400000, 0x6000000, 0xfa00000, 0x400000, 0x6400000, 0x000000, 0xfa00000,
+ 0x1000000, 0x400000, 0x6400000, 0x6400000, 0x6400000, 0x5200000, 0xfa00000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x1000000, 0x400000, 0x400000, 0x7200000, 0x6400000, 0x1200000,
+ 0x6400000, 0xfa00000, 0x000000, 0x6000000, 0x400000, 0xea00000, 0x6400000, 0x6200000,
+ 0x6200000, 0x1000000, 0xd800000, 0x400000, 0xfa00000, 0x400000, 0x200000, 0x400000,
+ 0x7400000, 0x200000, 0x000000, 0x6000000, 0x6400000, 0x400000, 0x6000000, 0x400000,
+ 0xea00000, 0x6000000, 0xea00000, 0x6000000, 0xea00000, 0x4400000, 0xea00000, 0x6000000,
+ 0x5400000, 0x4200000, 0x1000000, 0x1200000, 0x6400000, 0x1000000, 0xfa00000, 0xfa00000,
+ 0x7400000, 0xea00000, 0x000000, 0x8c00000, 0x4200000, 0x7200000, 0x000000, 0x000000,
+ 0x400000, 0x5200000, 0xfa00000, 0x4400000, 0x7400000, 0x6000000, 0x9a00000, 0xec00000,
+ 0x000000, 0xfa00000, 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000, 0x000000, 0x6400000,
+ 0xfa00000, 0xfa00000, 0x4400000, 0x7200000, 0x6400000, 0x400000, 0x6000000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x400000, 0x5000000, 0xfa00000, 0x6400000, 0x6400000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0x7200000, 0x4200000, 0x1200000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0x7200000, 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x400000, 0x000000, 0x400000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0x200000, 0x000000, 0x1000000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x000000, 0x6000000, 0x7400000, 0x400000, 0xea00000, 0x6000000,
+ 0xea00000, 0xfa00000, 0x400000, 0x000000, 0x4400000, 0x6000000, 0x6000000, 0x4400000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0x6400000, 0x6400000, 0x7200000, 0xfa00000, 0x6400000,
+ 0x400000, 0x4400000, 0x6000000, 0x200000, 0x200000, 0xf800000, 0x6000000, 0xf800000,
+ 0x400000, 0xea00000, 0x4000000, 0x6000000, 0x7200000, 0xfa00000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x4000000, 0xfa00000, 0x5400000, 0xfa00000, 0x1000000, 0x400000,
+ 0x400000, 0x7400000, 0x000000, 0x400000, 0xfa00000, 0xfa00000, 0x000000, 0x7000000,
+ 0x7400000, 0x7400000, 0x7400000, 0x400000, 0x6400000, 0x6000000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x000000, 0x4000000, 0x200000, 0x7200000, 0x6400000, 0x4000000,
+ 0xfa00000, 0x7400000, 0x400000, 0x6000000, 0x7200000, 0x6000000, 0x000000, 0x1000000,
+ 0x6400000, 0x400000, 0x7400000, 0xfa00000, 0x400000, 0x7400000, 0x7400000, 0x6400000,
+ 0x200000, 0x7200000, 0x400000, 0x6400000, 0x6000000, 0xfa00000, 0x400000, 0x6000000,
+ 0x7200000, 0x000000, 0x6400000, 0x7200000, 0x400000, 0xfa00000, 0x1000000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_60[] = {
+ 0x7000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x400000,
+ 0x000000, 0x6000000, 0x7400000, 0x6000000, 0x6000000, 0x7400000, 0x7200000, 0xfa00000,
+ 0x6200000, 0x6000000, 0xfa00000, 0x6400000, 0x7400000, 0x7200000, 0xfa00000, 0x6400000,
+ 0x400000, 0x7200000, 0x6400000, 0x7200000, 0xfa00000, 0xfa00000, 0x6000000, 0x400000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x4000000, 0x6400000, 0xfa00000, 0x7200000, 0xfa00000,
+ 0xfa00000, 0x7200000, 0xfa00000, 0x7200000, 0x6000000, 0x6400000, 0x6000000, 0xfa00000,
+ 0x000000, 0x4200000, 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x000000, 0x6000000,
+ 0x000000, 0x6000000, 0x200000, 0x5000000, 0x1000000, 0x000000, 0x000000, 0x1000000,
+ 0x6400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0x6200000, 0x6400000,
+ 0x400000, 0x6400000, 0x4200000, 0x1200000, 0x6400000, 0xfa00000, 0x000000, 0x000000,
+ 0xfa00000, 0x400000, 0xda00000, 0x6000000, 0x6400000, 0xfa00000, 0x400000, 0x400000,
+ 0x6000000, 0xfa00000, 0x7200000, 0x6000000, 0x000000, 0xfc00000, 0x6000000, 0x6200000,
+ 0x200000, 0x400000, 0xfa00000, 0xfa00000, 0xfa00000, 0xea00000, 0x6000000, 0x7400000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x7200000, 0xfa00000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0xfa00000, 0x400000, 0x6000000, 0x1000000, 0x000000, 0x4200000, 0x1000000, 0x4200000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x4400000, 0x7400000,
+ 0x6000000, 0x6200000, 0x400000, 0x7200000, 0x7200000, 0xe800000, 0x6400000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x6400000, 0x200000, 0xfa00000, 0xfa00000, 0x6400000, 0x000000,
+ 0x6000000, 0x400000, 0x7200000, 0x400000, 0xfa00000, 0x6400000, 0xfa00000, 0x6200000,
+ 0x400000, 0x000000, 0xfa00000, 0xfa00000, 0x6000000, 0x7400000, 0x4400000, 0xfa00000,
+ 0xfa00000, 0x000000, 0x6400000, 0xfa00000, 0xcc00000, 0x400000, 0x1200000, 0xca00000,
+ 0x7400000, 0x200000, 0x200000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0xec00000, 0x7400000, 0xfa00000, 0xca00000, 0xfa00000, 0x6200000, 0xea00000, 0x6400000,
+ 0xfa00000, 0x6000000, 0x6000000, 0x7400000, 0xfa00000, 0xea00000, 0x6400000, 0x6000000,
+ 0x6000000, 0x6000000, 0x400000, 0x6000000, 0x6400000, 0xfa00000, 0x7200000, 0xea00000,
+ 0x6400000, 0x6400000, 0x7400000, 0x7400000, 0x6000000, 0x6000000, 0x6400000, 0x6400000,
+ 0x000000, 0xfa00000, 0x000000, 0x6200000, 0x6400000, 0x7400000, 0x000000, 0x4000000,
+ 0x7200000, 0x6400000, 0xfa00000, 0x6400000, 0xfa00000, 0x7400000, 0x4400000, 0xfa00000,
+ 0xfa00000, 0xea00000, 0x6400000, 0x4200000, 0x6000000, 0x400000, 0x7000000, 0x5200000,
+ 0x5200000, 0x5000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0xfa00000, 0xea00000, 0x6400000, 0xfa00000, 0x7200000, 0x6400000, 0xfa00000, 0x6200000,
+ 0x6400000, 0xfa00000, 0xfa00000, 0xea00000, 0x6400000, 0x4400000, 0x6000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_61[] = {
+ 0x7200000, 0xfa00000, 0x400000, 0x6200000, 0x6000000, 0x6000000, 0xfa00000, 0x4400000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x6000000, 0x4400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x6400000, 0x400000, 0x6400000, 0x6400000, 0x6400000, 0xfa00000, 0x6400000, 0x400000,
+ 0x6000000, 0x4400000, 0xfa00000, 0xea00000, 0x6400000, 0x6000000, 0x400000, 0xfa00000,
+ 0x1000000, 0x200000, 0x4400000, 0x7000000, 0x1000000, 0x000000, 0x1000000, 0xfa00000,
+ 0x6200000, 0x6000000, 0x400000, 0x7400000, 0x6200000, 0x000000, 0x6000000, 0x6000000,
+ 0xcc00000, 0x400000, 0x6000000, 0x000000, 0xea00000, 0x400000, 0x6400000, 0xec00000,
+ 0x000000, 0x400000, 0x000000, 0x6000000, 0x8a00000, 0x4200000, 0xea00000, 0xfa00000,
+ 0x6000000, 0x6400000, 0xca00000, 0x000000, 0xea00000, 0x6400000, 0x6400000, 0xea00000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0xea00000, 0xfa00000, 0x6200000, 0x7200000, 0x6000000,
+ 0x4000000, 0x1000000, 0x6000000, 0xea00000, 0x6000000, 0xfa00000, 0x6000000, 0x000000,
+ 0xea00000, 0xca00000, 0x6200000, 0x6000000, 0x4000000, 0xfa00000, 0x6400000, 0xea00000,
+ 0x4400000, 0x6000000, 0xfa00000, 0xea00000, 0xc800000, 0x6200000, 0x6000000, 0xfa00000,
+ 0xfa00000, 0x000000, 0x6000000, 0xea00000, 0x6400000, 0x000000, 0xea00000, 0x4200000,
+ 0xfa00000, 0x6200000, 0x6400000, 0x6200000, 0x6200000, 0x7200000, 0xea00000, 0xfa00000,
+ 0x400000, 0x6000000, 0x6000000, 0x400000, 0x6400000, 0xc800000, 0xea00000, 0x400000,
+ 0x6400000, 0xcc00000, 0xea00000, 0x6400000, 0x400000, 0x000000, 0x000000, 0x4200000,
+ 0x000000, 0x6000000, 0xea00000, 0x7400000, 0x6000000, 0x6400000, 0xfa00000, 0x000000,
+ 0xea00000, 0xea00000, 0x6400000, 0x6400000, 0xfa00000, 0x4000000, 0x6200000, 0x400000,
+ 0xcc00000, 0xca00000, 0xea00000, 0x6000000, 0x4400000, 0x7400000, 0x000000, 0x6400000,
+ 0x400000, 0x6000000, 0x6000000, 0x000000, 0xea00000, 0x400000, 0x000000, 0xfa00000,
+ 0x7400000, 0xfa00000, 0x6400000, 0xea00000, 0xfa00000, 0x6400000, 0xea00000, 0x6000000,
+ 0x6000000, 0x6000000, 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0xea00000, 0x5000000,
+ 0x6400000, 0x4400000, 0xea00000, 0x000000, 0x6400000, 0x000000, 0xfa00000, 0x6000000,
+ 0x4400000, 0x6400000, 0x7400000, 0xea00000, 0x000000, 0x6000000, 0x6200000, 0xea00000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000, 0x6200000, 0x6200000, 0x400000, 0x4400000,
+ 0x4200000, 0x1000000, 0x1000000, 0x4000000, 0x1000000, 0x400000, 0x6000000, 0x000000,
+ 0x6000000, 0x000000, 0x4000000, 0x000000, 0x400000, 0x400000, 0x6400000, 0x6400000,
+ 0x6000000, 0x400000, 0x4400000, 0x6200000, 0x6000000, 0x6400000, 0xfa00000, 0x6400000,
+ 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x400000, 0x6400000, 0x6000000, 0x400000,
+ 0x6000000, 0x6000000, 0xea00000, 0x000000, 0x200000, 0x7000000, 0xea00000, 0xea00000,
+ 0xea00000, 0x6000000, 0xea00000, 0x6000000, 0xea00000, 0x6200000, 0x6200000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_62[] = {
+ 0xea00000, 0x6400000, 0x000000, 0x6400000, 0x6400000, 0x000000, 0x1000000, 0xec00000,
+ 0xfa00000, 0x6200000, 0xfa00000, 0x1000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x1000000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x400000, 0x6200000, 0x7400000, 0xfa00000, 0x1000000,
+ 0x1000000, 0x6000000, 0xfa00000, 0x7200000, 0x400000, 0x200000, 0x200000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x7400000, 0x6400000, 0x7000000, 0x7000000, 0x200000, 0x6400000,
+ 0x000000, 0x6400000, 0xfa00000, 0x6400000, 0x5000000, 0x6000000, 0xfa00000, 0x200000,
+ 0xea00000, 0x8800000, 0x6200000, 0x7200000, 0xfa00000, 0x000000, 0xe800000, 0x5000000,
+ 0x200000, 0x4400000, 0x6000000, 0x200000, 0x000000, 0x7400000, 0xf800000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x7400000, 0x400000, 0x000000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0xfa00000, 0x5400000, 0xfa00000, 0x7200000, 0x000000,
+ 0x6400000, 0x7400000, 0x7400000, 0xfa00000, 0x7400000, 0x200000, 0x400000, 0x000000,
+ 0xfa00000, 0x6000000, 0x6400000, 0x7200000, 0x6400000, 0x000000, 0x6200000, 0x000000,
+ 0x6200000, 0x6000000, 0x6000000, 0x7200000, 0x6400000, 0x6000000, 0x7000000, 0x1000000,
+ 0x4200000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x7400000, 0xfa00000, 0x7400000,
+ 0x7000000, 0xea00000, 0x6000000, 0x7400000, 0x6000000, 0x000000, 0xfa00000, 0x6000000,
+ 0x000000, 0xfa00000, 0x6400000, 0x6000000, 0xfa00000, 0x6400000, 0x7200000, 0xfa00000,
+ 0xfa00000, 0x6000000, 0x4200000, 0x6200000, 0xfa00000, 0x4000000, 0x6000000, 0x6000000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0x000000, 0x6000000, 0x400000, 0x6400000, 0x6400000,
+ 0x4400000, 0xfa00000, 0xfa00000, 0x7200000, 0x6200000, 0xfa00000, 0x7200000, 0xfa00000,
+ 0xfa00000, 0x000000, 0x1000000, 0x9a00000, 0x200000, 0x4000000, 0x200000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x5000000, 0x1000000, 0x4400000, 0x000000,
+ 0x7400000, 0x6000000, 0x6000000, 0xfa00000, 0x7200000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0xfa00000, 0x000000, 0x6400000, 0x6000000, 0xfa00000, 0x6400000, 0x400000,
+ 0x6000000, 0xfa00000, 0x400000, 0x7200000, 0xfa00000, 0xfa00000, 0x6400000, 0x7400000,
+ 0x000000, 0x000000, 0xfa00000, 0x4000000, 0x7400000, 0x5200000, 0x7200000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x7200000, 0x6000000, 0xfa00000, 0xfa00000, 0x7400000, 0xea00000,
+ 0xfa00000, 0x6200000, 0xfa00000, 0xfa00000, 0xfa00000, 0x4400000, 0xfc00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x7400000, 0xfa00000, 0xfa00000, 0x200000, 0x000000, 0x5000000,
+ 0x200000, 0x200000, 0x1000000, 0x1000000, 0x000000, 0x5000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x400000, 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x6400000, 0xfa00000, 0x7400000, 0x6200000, 0x7200000, 0xfa00000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x7400000, 0x7400000, 0xfa00000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_63[] = {
+ 0x6000000, 0xfa00000, 0x7200000, 0x6400000, 0x400000, 0x000000, 0x000000, 0xfa00000,
+ 0x7200000, 0xfa00000, 0x400000, 0x6400000, 0x6200000, 0x6400000, 0x7000000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x000000, 0x6400000, 0x6000000, 0x6000000, 0x7400000, 0x000000,
+ 0x4400000, 0x200000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1200000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x200000,
+ 0x7200000, 0x6400000, 0x7400000, 0xfa00000, 0x6000000, 0x6400000, 0x4000000, 0xfa00000,
+ 0x000000, 0x4000000, 0x7000000, 0x6000000, 0x6000000, 0x4400000, 0x6400000, 0x4000000,
+ 0x6000000, 0x7400000, 0xfa00000, 0xe800000, 0x6400000, 0xfa00000, 0xea00000, 0x200000,
+ 0x6000000, 0x6400000, 0x7400000, 0x7400000, 0x6400000, 0x7000000, 0x7400000, 0x6000000,
+ 0x6000000, 0xfa00000, 0x6400000, 0x7400000, 0xfa00000, 0x7200000, 0x7400000, 0xfa00000,
+ 0xfa00000, 0x6000000, 0x400000, 0x400000, 0x6400000, 0xfa00000, 0x6000000, 0x6200000,
+ 0x6400000, 0x6000000, 0x6000000, 0x400000, 0x200000, 0x000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x4000000, 0x6400000, 0x400000, 0xfa00000,
+ 0xea00000, 0x7200000, 0x000000, 0x6200000, 0x4400000, 0x7400000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x7400000, 0xea00000, 0x000000, 0x400000, 0x6400000, 0x7200000, 0xfa00000,
+ 0x6400000, 0x4000000, 0xfa00000, 0xfa00000, 0x6400000, 0x6400000, 0x000000, 0xcc00000,
+ 0x7200000, 0x6000000, 0x7400000, 0xea00000, 0x6400000, 0x6000000, 0x000000, 0x7400000,
+ 0xfa00000, 0xfa00000, 0x7400000, 0x4000000, 0xfa00000, 0x6000000, 0x7200000, 0x7200000,
+ 0x7400000, 0x6000000, 0xfa00000, 0x000000, 0x6400000, 0x400000, 0xfa00000, 0x6000000,
+ 0xfa00000, 0x6400000, 0x400000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x6200000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0x7200000, 0x6400000, 0xfa00000, 0x400000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x6200000, 0x7200000, 0x7400000, 0x7400000, 0x6400000,
+ 0x7000000, 0x6000000, 0x200000, 0x1000000, 0x1200000, 0x200000, 0x000000, 0x1000000,
+ 0x1000000, 0x4000000, 0x1000000, 0x200000, 0x1000000, 0x6400000, 0x7200000, 0x000000,
+ 0xea00000, 0x4400000, 0x6000000, 0x6200000, 0xfa00000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x6400000, 0x7200000, 0x6000000, 0x6000000, 0x6000000, 0x7000000, 0x7400000, 0xfa00000,
+ 0xfa00000, 0x4400000, 0x7200000, 0x6400000, 0x400000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x6000000, 0xea00000, 0xea00000, 0x6400000, 0x6000000, 0x5000000, 0x6000000,
+ 0x7400000, 0xfa00000, 0x4000000, 0x7200000, 0x6000000, 0x6400000, 0x4000000, 0x6000000,
+ 0x6000000, 0x7200000, 0x7400000, 0x6000000, 0x400000, 0xf800000, 0xea00000, 0x6000000,
+ 0x6000000, 0x6000000, 0x7400000, 0x6400000, 0xfa00000, 0x6400000, 0xfa00000, 0x8800000,
+ 0x5400000, 0x6400000, 0x200000, 0x4000000, 0x4000000, 0x1000000, 0x4000000, 0x1000000
+};
+
+static const unsigned long unicode_backtrans_64[] = {
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x6200000, 0x4000000,
+ 0x000000, 0x6400000, 0x6400000, 0x7000000, 0x7000000, 0xea00000, 0x6000000, 0xfa00000,
+ 0x7400000, 0x000000, 0x6400000, 0x7200000, 0xfc00000, 0x6000000, 0xea00000, 0xea00000,
+ 0x6400000, 0x000000, 0x6000000, 0x7000000, 0xfa00000, 0x000000, 0x7400000, 0x6000000,
+ 0x7400000, 0x7000000, 0xec00000, 0x6000000, 0x6400000, 0x6400000, 0x7200000, 0x6000000,
+ 0x6200000, 0x400000, 0x7400000, 0x6000000, 0xfa00000, 0xfa00000, 0x6000000, 0x6400000,
+ 0x6400000, 0x000000, 0x4000000, 0x6000000, 0x7200000, 0x6400000, 0x6200000, 0x6000000,
+ 0x4000000, 0x6000000, 0xda00000, 0x4000000, 0x000000, 0x7400000, 0xea00000, 0x7400000,
+ 0x6000000, 0x7000000, 0x200000, 0x6000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x6400000, 0x000000, 0x6000000, 0x6200000, 0x400000,
+ 0x6000000, 0x6400000, 0x7400000, 0x6400000, 0x7400000, 0x000000, 0x000000, 0x000000,
+ 0xfa00000, 0x6000000, 0x4400000, 0x6400000, 0x6400000, 0x6400000, 0x7000000, 0x6400000,
+ 0xec00000, 0x6400000, 0x000000, 0x400000, 0x000000, 0x6000000, 0x6000000, 0x7200000,
+ 0x6000000, 0xfa00000, 0x000000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0xea00000,
+ 0x6000000, 0x4000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6200000, 0x6000000,
+ 0xfa00000, 0xf800000, 0xfa00000, 0x6400000, 0x4000000, 0x6400000, 0x000000, 0x6000000,
+ 0x000000, 0x000000, 0x7000000, 0x200000, 0x1000000, 0x7400000, 0x000000, 0x7400000,
+ 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x4000000, 0x000000, 0x6400000,
+ 0x6400000, 0xdc00000, 0xfa00000, 0xea00000, 0x000000, 0x7200000, 0x7000000, 0x6000000,
+ 0x6400000, 0x7400000, 0xea00000, 0x400000, 0x6000000, 0x6400000, 0xfa00000, 0x6400000,
+ 0x6000000, 0x400000, 0x6000000, 0x6400000, 0xfa00000, 0xea00000, 0x6400000, 0x000000,
+ 0x400000, 0x7200000, 0x000000, 0xea00000, 0x7400000, 0xfa00000, 0xfa00000, 0x4000000,
+ 0xfa00000, 0x6000000, 0xea00000, 0x6400000, 0x4000000, 0x1000000, 0x4000000, 0x1000000,
+ 0x1000000, 0x200000, 0x1000000, 0xea00000, 0x7200000, 0x6400000, 0x6400000, 0x6400000,
+ 0x5000000, 0xea00000, 0x7200000, 0x6000000, 0xec00000, 0xfa00000, 0x000000, 0xea00000,
+ 0x000000, 0x6400000, 0xec00000, 0x6400000, 0x400000, 0xfa00000, 0xfc00000, 0x6000000,
+ 0x7400000, 0x400000, 0xfa00000, 0x4000000, 0xea00000, 0x400000, 0x6000000, 0x7400000,
+ 0xfa00000, 0x6000000, 0xea00000, 0x6000000, 0x000000, 0x4000000, 0x1000000, 0x000000,
+ 0x6200000, 0xca00000, 0xfa00000, 0x6200000, 0x7400000, 0xcc00000, 0xfa00000, 0xca00000,
+ 0x6000000, 0x6400000, 0x4400000, 0x6000000, 0xea00000, 0x6400000, 0x000000, 0x6200000,
+ 0x6400000, 0x6200000, 0xea00000, 0x6000000, 0xea00000, 0x400000, 0x200000, 0x6400000,
+ 0x6000000, 0x000000, 0xea00000, 0x6400000, 0x6000000, 0x6200000, 0xea00000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_65[] = {
+ 0xfa00000, 0x6400000, 0x000000, 0x6000000, 0xec00000, 0x200000, 0x6000000, 0x6000000,
+ 0x400000, 0x7400000, 0x4400000, 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000,
+ 0x6000000, 0x4000000, 0x1000000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x6000000,
+ 0xfa00000, 0x6400000, 0x000000, 0x6400000, 0x6200000, 0xea00000, 0x4400000, 0x4400000,
+ 0x6000000, 0x6000000, 0x6400000, 0xea00000, 0x6200000, 0x7000000, 0x6400000, 0x000000,
+ 0x000000, 0x6400000, 0xea00000, 0xfa00000, 0xea00000, 0x6000000, 0x7400000, 0xfa00000,
+ 0x4000000, 0x400000, 0x6000000, 0x6000000, 0x5200000, 0x5200000, 0xfa00000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0x400000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0x000000, 0x6000000, 0x000000, 0x6400000, 0x000000, 0xfa00000, 0x6000000, 0x400000,
+ 0xfa00000, 0x7400000, 0x6000000, 0x000000, 0x1000000, 0xca00000, 0x8800000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x400000, 0x6000000, 0x6400000, 0x7200000, 0xfa00000, 0xea00000,
+ 0x6200000, 0x7200000, 0x000000, 0x1000000, 0x6000000, 0x7200000, 0xfa00000, 0x4400000,
+ 0x400000, 0x000000, 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0xfa00000, 0x6400000,
+ 0x6000000, 0x000000, 0x6000000, 0x5400000, 0xfa00000, 0xc800000, 0x000000, 0x6000000,
+ 0x1200000, 0x000000, 0xfa00000, 0x6000000, 0xfa00000, 0xea00000, 0x6000000, 0xfa00000,
+ 0xea00000, 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x400000, 0x8800000, 0x6000000,
+ 0x6000000, 0x6400000, 0xea00000, 0xea00000, 0x6000000, 0xcc00000, 0x4000000, 0xfa00000,
+ 0x4200000, 0x4200000, 0x400000, 0x5000000, 0xfa00000, 0x000000, 0x200000, 0x000000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x1000000, 0x6000000, 0x6400000, 0x6000000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x000000, 0xfa00000, 0xfa00000, 0x6400000, 0x6000000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x6000000, 0x400000, 0xfa00000, 0xfa00000, 0x400000, 0xfa00000,
+ 0x6000000, 0x1000000, 0x6000000, 0xfa00000, 0xea00000, 0x1200000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0x000000, 0x6400000, 0x6400000, 0x400000, 0x4000000, 0x6000000, 0xea00000,
+ 0x6000000, 0xfa00000, 0x000000, 0x6000000, 0xfa00000, 0xfa00000, 0x4000000, 0x6400000,
+ 0x000000, 0xfa00000, 0x6400000, 0x7200000, 0x7200000, 0xfa00000, 0x7200000, 0x000000,
+ 0x400000, 0x400000, 0x000000, 0xfa00000, 0xfa00000, 0x6000000, 0x7400000, 0xfa00000,
+ 0x6400000, 0x4000000, 0xfa00000, 0x6000000, 0x4400000, 0x000000, 0x7400000, 0xfa00000,
+ 0x400000, 0x200000, 0x6000000, 0x6200000, 0x000000, 0x6000000, 0x6000000, 0x6400000,
+ 0xda00000, 0x6200000, 0x7200000, 0xc800000, 0x000000, 0xfa00000, 0xfa00000, 0x1200000,
+ 0xfa00000, 0xfa00000, 0x000000, 0x000000, 0xfa00000, 0xfa00000, 0x7000000, 0x7000000,
+ 0x7400000, 0xfa00000, 0x6400000, 0x6000000, 0xec00000, 0x6400000, 0x1000000, 0x1000000,
+ 0x000000, 0x400000, 0xfa00000, 0xea00000, 0xe800000, 0xe800000, 0x400000, 0xcc00000
+};
+
+static const unsigned long unicode_backtrans_66[] = {
+ 0x7400000, 0x000000, 0x7200000, 0x7200000, 0x6400000, 0x6000000, 0xfa00000, 0xea00000,
+ 0x6400000, 0xec00000, 0xfa00000, 0x6000000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0xe800000, 0xec00000, 0x6400000, 0xfa00000, 0xfa00000, 0xfc00000, 0x400000, 0x000000,
+ 0x4000000, 0x1000000, 0x000000, 0x000000, 0x6200000, 0x7400000, 0xcc00000, 0xfa00000,
+ 0xfa00000, 0x6400000, 0x6400000, 0x4400000, 0x6400000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0x400000, 0x400000, 0x6400000, 0x400000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0xcc00000, 0xfc00000, 0x6000000, 0x6400000, 0xfa00000, 0x7200000, 0xfa00000, 0x400000,
+ 0x000000, 0x6400000, 0xe800000, 0x8800000, 0x1200000, 0x000000, 0x1000000, 0x200000,
+ 0x400000, 0xfa00000, 0xea00000, 0xfa00000, 0xca00000, 0x6400000, 0x400000, 0x6000000,
+ 0x4000000, 0xea00000, 0x6400000, 0xda00000, 0x7400000, 0x000000, 0x400000, 0xfa00000,
+ 0x000000, 0x6400000, 0x7200000, 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x5400000,
+ 0x400000, 0xec00000, 0x7000000, 0xec00000, 0x6400000, 0xea00000, 0xea00000, 0xfa00000,
+ 0x400000, 0x7400000, 0x6200000, 0x4000000, 0xfa00000, 0xe800000, 0xfa00000, 0xca00000,
+ 0xfa00000, 0x8a00000, 0x6400000, 0xcc00000, 0x6400000, 0x000000, 0xfa00000, 0xfa00000,
+ 0x7200000, 0x6000000, 0x6000000, 0xcc00000, 0xfa00000, 0x400000, 0xfa00000, 0xfc00000,
+ 0xec00000, 0x6400000, 0xfa00000, 0x6400000, 0x6400000, 0x4000000, 0x7400000, 0x400000,
+ 0x6400000, 0x200000, 0x1000000, 0x200000, 0xfa00000, 0x4000000, 0x6000000, 0xfa00000,
+ 0xea00000, 0xea00000, 0x6000000, 0x6400000, 0x7400000, 0x6400000, 0xca00000, 0x000000,
+ 0xec00000, 0xfa00000, 0x4400000, 0x000000, 0x6000000, 0x6000000, 0xfa00000, 0xfa00000,
+ 0xea00000, 0x6400000, 0x4400000, 0x400000, 0x400000, 0xfa00000, 0x000000, 0x6400000,
+ 0xec00000, 0x6000000, 0xea00000, 0x000000, 0x4400000, 0x000000, 0x200000, 0x1000000,
+ 0x7000000, 0x6000000, 0x6000000, 0xea00000, 0x000000, 0x4400000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x6400000, 0xec00000, 0xc800000, 0xfa00000, 0x6400000, 0x4000000, 0x6000000,
+ 0x6200000, 0xfa00000, 0x6000000, 0xec00000, 0x200000, 0x6000000, 0xfa00000, 0x4400000,
+ 0x6400000, 0x200000, 0x400000, 0x400000, 0xea00000, 0x000000, 0xe800000, 0xea00000,
+ 0x6400000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x4000000, 0x4400000, 0x6400000,
+ 0x000000, 0x000000, 0x6000000, 0x000000, 0x400000, 0x000000, 0xea00000, 0x000000,
+ 0x6000000, 0xfa00000, 0x6200000, 0x7400000, 0xfa00000, 0xfa00000, 0x6000000, 0x400000,
+ 0xea00000, 0x000000, 0x000000, 0x6000000, 0x6000000, 0x000000, 0xfa00000, 0x000000,
+ 0x6400000, 0x7200000, 0x000000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x000000,
+ 0xfa00000, 0x4000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x200000, 0x6000000, 0xfa00000,
+ 0xea00000, 0xfa00000, 0x8c00000, 0x400000, 0xfa00000, 0x200000, 0xfa00000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_67[] = {
+ 0xfa00000, 0x6000000, 0x4000000, 0xea00000, 0x6000000, 0x6400000, 0x000000, 0x400000,
+ 0xfa00000, 0xfa00000, 0x7000000, 0xfa00000, 0x4000000, 0xfa00000, 0x4400000, 0x6200000,
+ 0x7000000, 0x000000, 0x6000000, 0x6400000, 0xfa00000, 0xfa00000, 0x4200000, 0xfa00000,
+ 0x6000000, 0x4400000, 0x000000, 0xfa00000, 0x400000, 0xfa00000, 0xca00000, 0xfa00000,
+ 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x000000, 0x4000000, 0xfa00000, 0xea00000,
+ 0xfa00000, 0x000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xea00000, 0x1000000,
+ 0x000000, 0xfa00000, 0x000000, 0x6400000, 0xfa00000, 0x7000000, 0xca00000, 0x200000,
+ 0x6200000, 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0xfa00000, 0x6400000, 0x6200000,
+ 0x1000000, 0x200000, 0x1000000, 0x1000000, 0x4000000, 0x6400000, 0xfa00000, 0x6400000,
+ 0x7400000, 0xfa00000, 0x000000, 0x6000000, 0x7400000, 0x6000000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0x400000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x000000, 0x6200000, 0x6000000, 0x000000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0x7200000, 0x5200000, 0x4200000, 0x200000, 0x200000, 0x1200000, 0x400000, 0x4000000,
+ 0x1000000, 0x1000000, 0x7200000, 0x4000000, 0x6400000, 0xfa00000, 0x400000, 0xfa00000,
+ 0xfa00000, 0xea00000, 0x7200000, 0xfa00000, 0x6400000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0x6000000, 0x6000000, 0x6000000, 0xec00000, 0x7200000, 0x6000000, 0xfa00000, 0xfa00000,
+ 0x000000, 0x7400000, 0x000000, 0x6000000, 0x7400000, 0x6200000, 0x6000000, 0xfa00000,
+ 0x000000, 0xfa00000, 0x000000, 0xfa00000, 0x6200000, 0x6000000, 0x6400000, 0xcc00000,
+ 0xfa00000, 0x6400000, 0x6000000, 0xec00000, 0x6000000, 0xfa00000, 0x400000, 0xfa00000,
+ 0x7400000, 0x6400000, 0xfa00000, 0x400000, 0xfa00000, 0xfa00000, 0x1000000, 0x6000000,
+ 0x4200000, 0x200000, 0x1200000, 0x1000000, 0x4000000, 0x1000000, 0x200000, 0x1000000,
+ 0x1000000, 0x200000, 0x1000000, 0x1000000, 0x4000000, 0x1000000, 0x6000000, 0xfa00000,
+ 0xfc00000, 0x4400000, 0x6400000, 0xfa00000, 0x6200000, 0x7400000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x6200000, 0x6000000, 0x6400000, 0x400000, 0x400000, 0x8800000, 0x4000000,
+ 0x6400000, 0x7200000, 0x6400000, 0x7400000, 0xfa00000, 0x6400000, 0x6200000, 0x000000,
+ 0x6400000, 0x6400000, 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0x6200000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfc00000, 0xfa00000, 0xfa00000, 0x000000, 0x4000000, 0x4400000,
+ 0x7200000, 0x7400000, 0xfa00000, 0x6000000, 0x7400000, 0xfa00000, 0x7200000, 0x6000000,
+ 0x1000000, 0x400000, 0x7200000, 0x6000000, 0x6200000, 0x7000000, 0x6400000, 0x6200000,
+ 0x000000, 0xfa00000, 0x6000000, 0x6000000, 0xfa00000, 0x6000000, 0x6200000, 0xfa00000,
+ 0xfc00000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000, 0xea00000, 0xec00000, 0x6400000,
+ 0x6000000, 0x4400000, 0x6000000, 0x8a00000, 0x6000000, 0x1000000, 0xca00000, 0x7200000
+};
+
+static const unsigned long unicode_backtrans_68[] = {
+ 0x5000000, 0x4000000, 0x4200000, 0x4200000, 0x4200000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x4000000, 0x1000000, 0x1000000,
+ 0x4000000, 0x1000000, 0xe800000, 0xfa00000, 0x6400000, 0x000000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0x400000, 0x6000000, 0x4000000, 0x6000000, 0x7400000, 0x4200000, 0x6400000,
+ 0x6000000, 0xfa00000, 0xca00000, 0x000000, 0x000000, 0x6000000, 0x6000000, 0x400000,
+ 0x6400000, 0x7200000, 0xfa00000, 0x6200000, 0x400000, 0x6400000, 0x6000000, 0xec00000,
+ 0x400000, 0x6400000, 0x7200000, 0x7400000, 0x6200000, 0x6000000, 0x4000000, 0x5000000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x6400000, 0xfa00000, 0xfa00000, 0x5000000, 0x400000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7400000, 0x7400000, 0x7200000, 0x4000000,
+ 0xfa00000, 0x7000000, 0x5400000, 0x6000000, 0x7400000, 0x6200000, 0xfa00000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0xfa00000, 0x5400000, 0x4000000, 0x400000,
+ 0x400000, 0x200000, 0x000000, 0x400000, 0x200000, 0x4200000, 0x000000, 0x200000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1200000, 0x1000000, 0x5000000, 0x1000000, 0x1200000,
+ 0x1000000, 0x1000000, 0x000000, 0x7400000, 0x000000, 0xe800000, 0x6400000, 0x6400000,
+ 0x400000, 0x6400000, 0x6400000, 0x000000, 0x7200000, 0x6400000, 0xfa00000, 0x7200000,
+ 0x6000000, 0x6400000, 0x400000, 0x6400000, 0x6400000, 0x6000000, 0x6200000, 0xea00000,
+ 0x6000000, 0xfa00000, 0x6400000, 0x7200000, 0x4400000, 0xfa00000, 0x7400000, 0x6000000,
+ 0x4400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x200000, 0x000000, 0xfa00000,
+ 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0xea00000, 0x000000, 0x6400000, 0xfa00000,
+ 0x4400000, 0x000000, 0x400000, 0x6200000, 0x6400000, 0xea00000, 0x000000, 0xea00000,
+ 0x6200000, 0xec00000, 0xfa00000, 0x6400000, 0x6000000, 0x400000, 0x5200000, 0xfa00000,
+ 0xfa00000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0xea00000, 0x6400000, 0xfa00000, 0x6000000, 0xfa00000, 0xca00000, 0x000000,
+ 0x000000, 0x4200000, 0x200000, 0x400000, 0x200000, 0x4000000, 0x000000, 0x000000,
+ 0x1000000, 0x000000, 0x1000000, 0x4000000, 0xea00000, 0xcc00000, 0x6200000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x4200000, 0xfa00000, 0x6400000, 0xfa00000, 0x6000000, 0x400000,
+ 0x6400000, 0x6400000, 0xfa00000, 0x6400000, 0x6200000, 0xfa00000, 0x6400000, 0xea00000,
+ 0xfa00000, 0x400000, 0xfa00000, 0x000000, 0x6400000, 0x6400000, 0x6000000, 0xea00000,
+ 0xfa00000, 0x6200000, 0x000000, 0x7200000, 0x6000000, 0x400000, 0x6000000, 0xea00000,
+ 0xec00000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x400000, 0xfa00000, 0x6200000,
+ 0x7400000, 0x7400000, 0xea00000, 0x6000000, 0x6000000, 0x7400000, 0x6400000, 0x6000000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0x6400000, 0x7400000, 0x6400000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_69[] = {
+ 0xca00000, 0x5200000, 0x4000000, 0x4000000, 0x6200000, 0xfa00000, 0x6400000, 0x6000000,
+ 0x6200000, 0x4400000, 0x6400000, 0x7200000, 0x6200000, 0xfa00000, 0xfa00000, 0x6200000,
+ 0x7400000, 0x6400000, 0xfa00000, 0x6400000, 0x6000000, 0x6000000, 0x400000, 0x6400000,
+ 0x4000000, 0x4200000, 0x4200000, 0x4200000, 0x200000, 0x000000, 0x000000, 0x1000000,
+ 0x1000000, 0x200000, 0x200000, 0x200000, 0x1000000, 0x6200000, 0x200000, 0x8800000,
+ 0x200000, 0x000000, 0x6200000, 0x000000, 0x4000000, 0x1000000, 0x000000, 0x6000000,
+ 0xfa00000, 0x400000, 0x6000000, 0x6400000, 0x7200000, 0x6400000, 0x4200000, 0x6000000,
+ 0x6400000, 0x7200000, 0x000000, 0x6400000, 0x6000000, 0xfa00000, 0x4000000, 0xfa00000,
+ 0x6000000, 0x6000000, 0x7400000, 0x4000000, 0x6000000, 0x6400000, 0x4000000, 0x000000,
+ 0x6000000, 0x6400000, 0xea00000, 0x6000000, 0x6000000, 0x000000, 0x6400000, 0x6000000,
+ 0x000000, 0x6000000, 0x6000000, 0xea00000, 0xfa00000, 0xca00000, 0x6000000, 0xfc00000,
+ 0x6000000, 0xea00000, 0xfa00000, 0x6400000, 0x6200000, 0x7200000, 0xfa00000, 0x6000000,
+ 0xfa00000, 0xca00000, 0xea00000, 0xfc00000, 0x4400000, 0x6400000, 0x7400000, 0x4000000,
+ 0xec00000, 0x6400000, 0x6200000, 0xfa00000, 0x6400000, 0xea00000, 0xfa00000, 0xea00000,
+ 0x6400000, 0x7400000, 0x4400000, 0x4200000, 0x6200000, 0xea00000, 0x6000000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x6400000, 0x1200000, 0x200000, 0x200000, 0x400000,
+ 0x5400000, 0x200000, 0x7200000, 0x6000000, 0x1000000, 0x4000000, 0x7000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x4200000, 0x000000, 0x000000, 0x7400000, 0x6200000, 0x000000,
+ 0x6000000, 0x6200000, 0x400000, 0x6000000, 0x7200000, 0xfa00000, 0x6400000, 0x6000000,
+ 0x5400000, 0x6000000, 0x6000000, 0xfa00000, 0xfa00000, 0x000000, 0x6000000, 0x4000000,
+ 0x6200000, 0x6400000, 0x4000000, 0x6000000, 0x6000000, 0xec00000, 0x6400000, 0xfa00000,
+ 0x7400000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x7400000, 0xea00000, 0x6400000,
+ 0x6000000, 0x7200000, 0x4200000, 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x7400000,
+ 0x400000, 0x6000000, 0x400000, 0xfa00000, 0x6400000, 0x6000000, 0x6200000, 0x6200000,
+ 0x4000000, 0xfa00000, 0x6000000, 0xea00000, 0x6000000, 0x400000, 0x6000000, 0x200000,
+ 0x400000, 0x6000000, 0x7200000, 0xea00000, 0xfa00000, 0xea00000, 0x7200000, 0x6000000,
+ 0xfa00000, 0x4400000, 0x000000, 0x6200000, 0x7000000, 0x4000000, 0x4400000, 0x400000,
+ 0x200000, 0x6200000, 0x000000, 0x1000000, 0x000000, 0x200000, 0x200000, 0x1000000,
+ 0x1000000, 0x4000000, 0x6400000, 0x000000, 0x6000000, 0x6400000, 0x6000000, 0x6200000,
+ 0xea00000, 0x4000000, 0x8800000, 0x6200000, 0x6000000, 0x7200000, 0x6400000, 0x400000,
+ 0x000000, 0x6400000, 0x7200000, 0x6400000, 0x6000000, 0x400000, 0x6000000, 0x6000000,
+ 0x6000000, 0x4200000, 0x4000000, 0xea00000, 0x6000000, 0xfa00000, 0x6400000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_6a[] = {
+ 0x6400000, 0x6400000, 0xea00000, 0x4400000, 0x6000000, 0x6200000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6000000, 0xfa00000, 0x4200000, 0x4200000, 0x6000000, 0x000000, 0x6400000,
+ 0x000000, 0xec00000, 0x200000, 0xea00000, 0x6200000, 0x6400000, 0x6000000, 0xfa00000,
+ 0x7000000, 0xea00000, 0x4400000, 0x6200000, 0x4000000, 0x6400000, 0xea00000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x200000, 0xea00000, 0x400000, 0x6000000, 0x6000000, 0x6000000,
+ 0x7400000, 0x200000, 0x1200000, 0x4200000, 0x4000000, 0x4000000, 0x200000, 0x1000000,
+ 0x400000, 0x1000000, 0x6400000, 0x4000000, 0x6400000, 0xfa00000, 0x200000, 0x400000,
+ 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0x6000000, 0xfa00000, 0x7400000, 0x6400000,
+ 0x6000000, 0x6000000, 0x000000, 0x4000000, 0xfa00000, 0x4400000, 0x6400000, 0x7200000,
+ 0xea00000, 0x6400000, 0x400000, 0xea00000, 0x4000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x7400000, 0x6400000, 0xcc00000, 0xc800000, 0x6000000, 0x6400000, 0x6400000, 0x4000000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x7400000, 0x000000, 0x6000000, 0x6000000, 0xea00000,
+ 0x6000000, 0xfa00000, 0x6200000, 0x4000000, 0x6400000, 0x5000000, 0x6200000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6400000, 0xe800000, 0x000000, 0x6000000, 0x000000, 0x6000000,
+ 0x000000, 0x5400000, 0x200000, 0x400000, 0x4000000, 0x000000, 0x6000000, 0x000000,
+ 0x200000, 0x1000000, 0x4000000, 0x000000, 0x1000000, 0x000000, 0x6400000, 0x6200000,
+ 0xfa00000, 0x6400000, 0x4000000, 0x6400000, 0xfa00000, 0x6000000, 0x400000, 0x6400000,
+ 0x000000, 0xec00000, 0x4000000, 0x400000, 0x6000000, 0xea00000, 0xfa00000, 0x4000000,
+ 0x7200000, 0x7400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000,
+ 0x000000, 0x4000000, 0x6000000, 0x6400000, 0xea00000, 0x4400000, 0x6400000, 0x6400000,
+ 0x7200000, 0x6000000, 0xea00000, 0xea00000, 0x6000000, 0x6400000, 0x6000000, 0x4000000,
+ 0x6000000, 0x1000000, 0x200000, 0x5400000, 0x7200000, 0x6000000, 0x6200000, 0x6400000,
+ 0x400000, 0x4400000, 0x4000000, 0xea00000, 0x6400000, 0x4000000, 0x6000000, 0x6000000,
+ 0x6200000, 0x6000000, 0x6000000, 0xea00000, 0x000000, 0x6400000, 0x4400000, 0x400000,
+ 0x000000, 0x200000, 0xea00000, 0xea00000, 0x000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x4400000, 0x4400000, 0x4000000, 0x6000000, 0x6400000, 0x6000000, 0x000000, 0x6000000,
+ 0x6400000, 0x6200000, 0x000000, 0xea00000, 0x4400000, 0x400000, 0x400000, 0x000000,
+ 0x4000000, 0x6000000, 0xea00000, 0xea00000, 0x6400000, 0x6400000, 0x6200000, 0x6200000,
+ 0x6000000, 0x6000000, 0x000000, 0x000000, 0x400000, 0x6000000, 0x000000, 0x6400000,
+ 0x6200000, 0x000000, 0x6200000, 0x6000000, 0x6400000, 0x000000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6400000, 0x400000, 0x6000000, 0x000000, 0x000000, 0xc800000, 0x000000,
+ 0x6000000, 0x6000000, 0x6200000, 0xea00000, 0x6400000, 0x400000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_6b[] = {
+ 0x6000000, 0x000000, 0x6400000, 0x6400000, 0xea00000, 0x4200000, 0x400000, 0x400000,
+ 0x6000000, 0x6400000, 0xea00000, 0x6000000, 0x8800000, 0x000000, 0x000000, 0x6400000,
+ 0x6400000, 0x6400000, 0xea00000, 0x6000000, 0x000000, 0x000000, 0xea00000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6000000, 0x400000, 0x000000, 0x4200000, 0x6400000, 0x200000,
+ 0xfa00000, 0xfa00000, 0x1000000, 0xfa00000, 0x1400000, 0x6000000, 0x000000, 0x1200000,
+ 0x6400000, 0x000000, 0x000000, 0x400000, 0x6400000, 0x6000000, 0x000000, 0x6400000,
+ 0x000000, 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x4400000, 0x6400000, 0x7200000,
+ 0x6200000, 0x7200000, 0xfa00000, 0x6400000, 0x6000000, 0xea00000, 0xfa00000, 0x6400000,
+ 0x000000, 0x6000000, 0x6000000, 0x7200000, 0x000000, 0x6000000, 0xfc00000, 0xfa00000,
+ 0x6000000, 0x7200000, 0x6400000, 0x6000000, 0xfa00000, 0x6400000, 0xea00000, 0x000000,
+ 0xea00000, 0x6000000, 0x4400000, 0x200000, 0x6200000, 0x6000000, 0x6400000, 0x4000000,
+ 0x400000, 0x7200000, 0x000000, 0x6200000, 0x6000000, 0x400000, 0x6000000, 0xea00000,
+ 0x6400000, 0xea00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xf800000, 0xfa00000, 0x7400000,
+ 0x000000, 0x200000, 0xfa00000, 0x400000, 0x000000, 0x6000000, 0x400000, 0x4200000,
+ 0x400000, 0x000000, 0xe800000, 0x200000, 0x4200000, 0x400000, 0x6000000, 0xe800000,
+ 0xea00000, 0x7200000, 0x4000000, 0xfa00000, 0x1000000, 0x400000, 0x6400000, 0xea00000,
+ 0x6200000, 0x5000000, 0x7400000, 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0x1000000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0x1200000, 0x6000000, 0x7200000, 0x6000000, 0x6000000,
+ 0x000000, 0x6000000, 0x1000000, 0x1000000, 0x6000000, 0x6200000, 0xfa00000, 0x6400000,
+ 0xea00000, 0x6000000, 0x1000000, 0x7400000, 0x000000, 0x000000, 0xea00000, 0x6400000,
+ 0x6400000, 0x1000000, 0x6400000, 0x6400000, 0x6200000, 0x6000000, 0x6000000, 0x6000000,
+ 0x400000, 0x400000, 0x7200000, 0x6200000, 0x400000, 0x6400000, 0xec00000, 0xea00000,
+ 0x6400000, 0x200000, 0xea00000, 0x7200000, 0x1200000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0x400000, 0x400000, 0xea00000, 0x200000, 0xea00000, 0x6400000, 0x400000, 0xfa00000,
+ 0x6200000, 0xd800000, 0x1000000, 0x6400000, 0x6400000, 0xfa00000, 0xea00000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6000000, 0xfa00000, 0x6400000, 0xfa00000, 0x200000, 0xf800000,
+ 0x6000000, 0x000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x1000000, 0xfc00000, 0xf800000,
+ 0xea00000, 0x1000000, 0x6400000, 0xfa00000, 0x4000000, 0x000000, 0x6000000, 0x200000,
+ 0x6000000, 0x5400000, 0x6000000, 0x6400000, 0x6000000, 0x000000, 0x6400000, 0x6400000,
+ 0x6000000, 0x000000, 0x5000000, 0xfa00000, 0xea00000, 0x000000, 0x400000, 0x7200000,
+ 0x6000000, 0x400000, 0x6000000, 0x7200000, 0x000000, 0x1000000, 0x000000, 0x6400000,
+ 0x6000000, 0x7400000, 0x4000000, 0x6000000, 0x6000000, 0x7000000, 0x6000000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_6c[] = {
+ 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x6400000, 0x7400000, 0x7000000, 0x1000000,
+ 0xea00000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0x7400000, 0x400000, 0xfa00000,
+ 0x7400000, 0xfa00000, 0x400000, 0xfa00000, 0x7200000, 0x7000000, 0x7000000, 0x200000,
+ 0x7000000, 0x7400000, 0x7000000, 0x7200000, 0x4000000, 0x6000000, 0x000000, 0x7400000,
+ 0x6000000, 0x7000000, 0x1000000, 0xea00000, 0x7200000, 0x6000000, 0x7400000, 0x7400000,
+ 0x7400000, 0x1000000, 0x7000000, 0x6000000, 0x6400000, 0x000000, 0x7400000, 0x7000000,
+ 0x7000000, 0x4000000, 0x1000000, 0x6400000, 0xfa00000, 0x5400000, 0x6400000, 0xca00000,
+ 0xfa00000, 0x4000000, 0x4400000, 0x6400000, 0x000000, 0x5000000, 0xea00000, 0x6400000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0x000000, 0x000000, 0x7000000, 0x1000000,
+ 0x000000, 0x5000000, 0x7400000, 0x6400000, 0x6000000, 0x6400000, 0xea00000, 0x6400000,
+ 0xfa00000, 0x000000, 0x6400000, 0x000000, 0x7400000, 0xfa00000, 0x000000, 0xfa00000,
+ 0x4000000, 0x6400000, 0xca00000, 0x7400000, 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0x7000000, 0x200000, 0x000000, 0x1000000, 0x6000000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x7000000, 0xfa00000, 0x6400000, 0x000000, 0xec00000, 0x4000000, 0x6400000,
+ 0xfa00000, 0x6000000, 0xfa00000, 0x6200000, 0x7400000, 0x4000000, 0xfc00000, 0x000000,
+ 0x6400000, 0x5400000, 0xea00000, 0x6400000, 0x000000, 0xfa00000, 0xfa00000, 0x4000000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0xfc00000, 0xfc00000, 0xec00000,
+ 0xfa00000, 0x7400000, 0x6000000, 0x6000000, 0xfa00000, 0x6200000, 0x6000000, 0x7000000,
+ 0xfa00000, 0x000000, 0xea00000, 0xfa00000, 0xfc00000, 0xec00000, 0xea00000, 0x400000,
+ 0x6400000, 0xfa00000, 0xea00000, 0xfa00000, 0x6400000, 0x6000000, 0x000000, 0x5400000,
+ 0x000000, 0x1200000, 0x4200000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x5000000, 0xfa00000, 0x6000000, 0x7000000, 0xfa00000, 0x4000000,
+ 0x6400000, 0x7200000, 0x5400000, 0xfa00000, 0x6400000, 0x000000, 0x6000000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0x6200000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0xea00000, 0xec00000, 0x6000000, 0xfa00000, 0x7200000, 0x6400000, 0x6000000,
+ 0x000000, 0xfa00000, 0xfa00000, 0x4000000, 0xfa00000, 0x6400000, 0x4000000, 0x6400000,
+ 0x7400000, 0x6400000, 0x6400000, 0xfa00000, 0x7400000, 0xfa00000, 0x7400000, 0xfa00000,
+ 0x000000, 0x6200000, 0x6400000, 0xfa00000, 0x6400000, 0x6200000, 0x7000000, 0x4000000,
+ 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0x000000, 0x6400000,
+ 0xfa00000, 0x6400000, 0x5200000, 0xfc00000, 0x6400000, 0x6000000, 0xfc00000, 0xfa00000,
+ 0xfa00000, 0x7200000, 0x6400000, 0xfa00000, 0x400000, 0x7000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x6000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_6d[] = {
+ 0x6000000, 0x7000000, 0x4000000, 0x6000000, 0x7400000, 0x4000000, 0x4000000, 0x7400000,
+ 0x6000000, 0x6000000, 0x6400000, 0xfa00000, 0xfa00000, 0x6000000, 0x7400000, 0x6400000,
+ 0x6000000, 0xec00000, 0x7200000, 0x400000, 0x000000, 0x000000, 0x6000000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x7400000, 0xfa00000, 0x000000, 0x6000000, 0xfa00000, 0x6200000,
+ 0x6000000, 0x000000, 0x6000000, 0x000000, 0x4000000, 0xfa00000, 0x4400000, 0xfc00000,
+ 0x6400000, 0xea00000, 0xfa00000, 0x7200000, 0x6000000, 0x6000000, 0x7400000, 0x6400000,
+ 0x6000000, 0x7400000, 0xfa00000, 0x7200000, 0x6000000, 0xfa00000, 0xea00000, 0x6000000,
+ 0xea00000, 0xfc00000, 0x6000000, 0xfa00000, 0x7400000, 0xfa00000, 0xfa00000, 0x6400000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x1000000, 0x200000, 0x1200000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x4400000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0x4000000, 0xda00000, 0x000000, 0x7400000, 0x6400000,
+ 0x7000000, 0x6400000, 0x6000000, 0xfa00000, 0x6200000, 0x6400000, 0xfa00000, 0x6400000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0x000000, 0xea00000, 0x6000000, 0xfa00000, 0x7400000,
+ 0x6400000, 0x4000000, 0x4000000, 0x000000, 0xfa00000, 0x6000000, 0x6000000, 0xfa00000,
+ 0xfa00000, 0xea00000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x6000000, 0xe800000,
+ 0x6000000, 0x4000000, 0x7400000, 0x6000000, 0x6000000, 0xfa00000, 0x6000000, 0xec00000,
+ 0xfa00000, 0xf800000, 0x6000000, 0x6000000, 0xfa00000, 0xe800000, 0xfa00000, 0x4000000,
+ 0x6000000, 0xfc00000, 0x6400000, 0xfa00000, 0x7400000, 0xfa00000, 0x4400000, 0x6400000,
+ 0x6400000, 0x200000, 0x000000, 0x1200000, 0x200000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x5000000, 0x4000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x7400000, 0x7000000, 0x6400000, 0x000000, 0x7000000, 0xfa00000,
+ 0x000000, 0x4000000, 0xfa00000, 0x6000000, 0x6400000, 0xfa00000, 0x000000, 0x6400000,
+ 0x7200000, 0x4400000, 0x6000000, 0x6000000, 0x6200000, 0x6400000, 0x6000000, 0x7400000,
+ 0xfa00000, 0x000000, 0x6000000, 0x8800000, 0xfc00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x6400000, 0x6000000, 0x6400000, 0xfa00000, 0x7200000, 0x6000000, 0x400000, 0xec00000,
+ 0x6000000, 0xfa00000, 0x6200000, 0x6000000, 0x6000000, 0x6200000, 0x7400000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0xe800000, 0x6400000, 0x6000000, 0x7400000, 0xfa00000, 0x6400000,
+ 0x7400000, 0xfa00000, 0x6400000, 0x6000000, 0x7200000, 0x6400000, 0x7200000, 0x000000,
+ 0xea00000, 0x6400000, 0xea00000, 0xfa00000, 0x7200000, 0x6000000, 0xfa00000, 0x6400000,
+ 0x6400000, 0xfa00000, 0x6000000, 0xfa00000, 0x6400000, 0xea00000, 0x6400000, 0xfa00000,
+ 0x8800000, 0xfa00000, 0xea00000, 0xfa00000, 0x7400000, 0x6000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_6e[] = {
+ 0x6400000, 0x000000, 0x4000000, 0x6000000, 0x4400000, 0x7200000, 0x000000, 0x200000,
+ 0x200000, 0x200000, 0x5200000, 0x200000, 0x1000000, 0x1000000, 0x1000000, 0x4000000,
+ 0x1000000, 0x1000000, 0x000000, 0x200000, 0x1000000, 0x4200000, 0x1000000, 0x9800000,
+ 0x4000000, 0xea00000, 0xfa00000, 0xea00000, 0x6000000, 0x7200000, 0x400000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000, 0xfa00000, 0xea00000, 0x6400000,
+ 0x6000000, 0x5200000, 0x4000000, 0xfa00000, 0xea00000, 0xfa00000, 0x6200000, 0xfa00000,
+ 0x6000000, 0x6000000, 0xfc00000, 0x6000000, 0xf800000, 0x6000000, 0xec00000, 0x000000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x6400000, 0xec00000, 0xe800000, 0xea00000, 0x6000000,
+ 0x6000000, 0x6000000, 0x000000, 0xfa00000, 0xfc00000, 0x6400000, 0x6000000, 0x6000000,
+ 0x400000, 0x6400000, 0xea00000, 0x6400000, 0x000000, 0xfa00000, 0x7200000, 0x4400000,
+ 0x4000000, 0x6400000, 0x6400000, 0x7400000, 0x7400000, 0x6000000, 0xfa00000, 0x400000,
+ 0xfa00000, 0x4000000, 0x6000000, 0xfa00000, 0xec00000, 0x6400000, 0xec00000, 0xfa00000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0xea00000,
+ 0x6400000, 0x6000000, 0x000000, 0xfa00000, 0x000000, 0x000000, 0xfa00000, 0xea00000,
+ 0x000000, 0x6000000, 0xea00000, 0xec00000, 0x6000000, 0x000000, 0x4200000, 0x6000000,
+ 0x6000000, 0x6000000, 0x8800000, 0x400000, 0x4000000, 0x400000, 0x1200000, 0x1200000,
+ 0x200000, 0x000000, 0x200000, 0x1000000, 0x000000, 0x1000000, 0x5000000, 0x000000,
+ 0x6000000, 0x7000000, 0x000000, 0x4000000, 0x200000, 0x6400000, 0x6000000, 0x7200000,
+ 0xfa00000, 0x000000, 0x6000000, 0x6400000, 0x6000000, 0x000000, 0xea00000, 0x6000000,
+ 0x7200000, 0x6400000, 0x4000000, 0x6000000, 0xfa00000, 0xea00000, 0x6000000, 0xfa00000,
+ 0x6400000, 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000,
+ 0x000000, 0x000000, 0xfa00000, 0xe800000, 0x000000, 0x400000, 0x6400000, 0xfa00000,
+ 0x6000000, 0xfc00000, 0x7200000, 0x6400000, 0x7000000, 0x4000000, 0xfa00000, 0x7200000,
+ 0x4000000, 0x6000000, 0xfa00000, 0x5400000, 0x6000000, 0x7200000, 0x6000000, 0x6400000,
+ 0x6400000, 0x7400000, 0xfa00000, 0x6400000, 0xea00000, 0xea00000, 0x6000000, 0x7400000,
+ 0x6400000, 0xea00000, 0x6400000, 0xfa00000, 0xea00000, 0x6400000, 0xec00000, 0x7400000,
+ 0x6000000, 0xfa00000, 0x6000000, 0xfa00000, 0xfa00000, 0x7200000, 0x6000000, 0x1000000,
+ 0x6000000, 0x4000000, 0x5000000, 0x4000000, 0x6000000, 0x4200000, 0x1200000, 0x1000000,
+ 0x1000000, 0x1000000, 0x5000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x5000000, 0x5000000, 0x000000, 0x6400000, 0x6200000, 0x6400000, 0x6400000, 0xea00000,
+ 0x000000, 0x6000000, 0x6200000, 0x000000, 0xfa00000, 0x6000000, 0x6000000, 0x6200000,
+ 0xea00000, 0x7400000, 0x4000000, 0x6400000, 0x6000000, 0x6400000, 0xea00000, 0xea00000
+};
+
+static const unsigned long unicode_backtrans_6f[] = {
+ 0x6000000, 0xea00000, 0xfa00000, 0x6000000, 0x4400000, 0x6000000, 0xfa00000, 0x6000000,
+ 0x6400000, 0x7200000, 0x6400000, 0x4000000, 0x4400000, 0x6400000, 0x6000000, 0xfa00000,
+ 0x000000, 0x8a00000, 0x6000000, 0x7200000, 0xfa00000, 0xfa00000, 0x4400000, 0x4000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x400000, 0x6000000, 0x000000, 0x6000000, 0x6000000,
+ 0xfa00000, 0x6000000, 0xea00000, 0xea00000, 0x5000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x000000, 0x7400000, 0x7400000, 0xfa00000, 0xea00000, 0x7400000, 0x6000000, 0x7400000,
+ 0x6400000, 0xfa00000, 0xea00000, 0x7400000, 0x4000000, 0x6000000, 0x7400000, 0x6000000,
+ 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x4000000, 0x7200000, 0xea00000,
+ 0x6000000, 0xea00000, 0x000000, 0x6000000, 0x4000000, 0x200000, 0x1000000, 0x1000000,
+ 0x000000, 0x000000, 0x000000, 0x1000000, 0x000000, 0x1000000, 0x6000000, 0x6400000,
+ 0x6000000, 0xec00000, 0x6400000, 0x6400000, 0xea00000, 0x6000000, 0x4000000, 0xec00000,
+ 0xfa00000, 0x400000, 0xec00000, 0xea00000, 0x5200000, 0x6400000, 0xfc00000, 0xea00000,
+ 0x6000000, 0x6400000, 0xfc00000, 0x6000000, 0xea00000, 0x000000, 0x7200000, 0x6000000,
+ 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0xfa00000, 0xfa00000, 0x6200000,
+ 0xea00000, 0x000000, 0x7000000, 0x6000000, 0x5200000, 0x000000, 0x6000000, 0x6000000,
+ 0x7200000, 0x4000000, 0xfa00000, 0x6000000, 0xfa00000, 0xec00000, 0xec00000, 0x6000000,
+ 0x6200000, 0xca00000, 0x6200000, 0x400000, 0xfa00000, 0x6000000, 0x6200000, 0x6400000,
+ 0xfc00000, 0x7000000, 0x4000000, 0x6400000, 0x7400000, 0xfc00000, 0xfa00000, 0x000000,
+ 0xec00000, 0x200000, 0x6400000, 0x6400000, 0xec00000, 0x6000000, 0x6400000, 0xea00000,
+ 0x000000, 0x000000, 0x400000, 0x000000, 0x1000000, 0x4000000, 0x6000000, 0x4400000,
+ 0x6400000, 0x7200000, 0x6000000, 0xea00000, 0xea00000, 0x6400000, 0x6400000, 0xfc00000,
+ 0x6400000, 0x6000000, 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0xec00000, 0xec00000,
+ 0x6400000, 0xea00000, 0x6000000, 0xfa00000, 0x6000000, 0x4400000, 0x7400000, 0x000000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x4000000, 0x6400000, 0x6000000, 0xc800000, 0x6000000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0xea00000, 0x6000000, 0x400000, 0x6200000, 0x6400000,
+ 0x6400000, 0x7000000, 0xec00000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x000000, 0x1000000, 0x1000000, 0x4000000, 0x6200000, 0xea00000, 0x000000, 0x000000,
+ 0x6200000, 0x4000000, 0xcc00000, 0x6200000, 0x6000000, 0x6000000, 0x7400000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0xea00000, 0x000000, 0x6000000, 0x6000000,
+ 0x6400000, 0xec00000, 0x000000, 0xea00000, 0xea00000, 0x6000000, 0x7200000, 0xfa00000,
+ 0x6400000, 0xea00000, 0x6000000, 0x200000, 0x6000000, 0x400000, 0x4200000, 0x6000000,
+ 0x4000000, 0x400000, 0x6200000, 0x6000000, 0x6400000, 0x400000, 0xea00000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_70[] = {
+ 0x6400000, 0xea00000, 0x000000, 0x4000000, 0x6000000, 0xec00000, 0xec00000, 0x6400000,
+ 0x000000, 0xea00000, 0x6000000, 0xea00000, 0x6000000, 0x6400000, 0x6000000, 0xea00000,
+ 0x000000, 0xfa00000, 0x000000, 0x000000, 0x6000000, 0xea00000, 0x6000000, 0x6400000,
+ 0xea00000, 0x6000000, 0xfa00000, 0xfa00000, 0xe800000, 0xea00000, 0xca00000, 0xea00000,
+ 0x6400000, 0x6000000, 0x6000000, 0xfc00000, 0x6000000, 0x000000, 0x6200000, 0xea00000,
+ 0xe800000, 0x6000000, 0x6000000, 0x6000000, 0x4200000, 0x000000, 0x000000, 0xec00000,
+ 0x6200000, 0x6000000, 0x6200000, 0x6000000, 0x6400000, 0x7000000, 0x000000, 0xec00000,
+ 0x6000000, 0x7400000, 0x6000000, 0x6000000, 0x6400000, 0x000000, 0xea00000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x000000,
+ 0x6400000, 0x6400000, 0x6400000, 0x4400000, 0xfa00000, 0x4000000, 0x400000, 0x1000000,
+ 0xc800000, 0xea00000, 0x6000000, 0x000000, 0x4400000, 0x6400000, 0x6000000, 0x6000000,
+ 0xea00000, 0x000000, 0x6000000, 0x6000000, 0x4000000, 0xec00000, 0x7400000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0xea00000, 0x6400000, 0x6400000, 0x6000000, 0x4000000,
+ 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0x5400000, 0x1000000, 0x400000, 0x5200000,
+ 0xfa00000, 0x6000000, 0x000000, 0x000000, 0x6000000, 0x5400000, 0x7400000, 0x4000000,
+ 0xfa00000, 0x4000000, 0x6000000, 0x000000, 0xfa00000, 0xea00000, 0x5400000, 0x5000000,
+ 0x1000000, 0x4400000, 0x6000000, 0x6000000, 0x6000000, 0xfc00000, 0x6400000, 0x000000,
+ 0x000000, 0x5200000, 0xfa00000, 0x4000000, 0x000000, 0x000000, 0xfa00000, 0x4000000,
+ 0x000000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000, 0x7400000, 0x7400000, 0x400000,
+ 0xec00000, 0xfa00000, 0xe800000, 0x400000, 0x1000000, 0x1000000, 0x000000, 0x6000000,
+ 0x4000000, 0xe800000, 0x000000, 0x4000000, 0xec00000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x6000000, 0x000000, 0xfc00000, 0xfa00000, 0xfa00000, 0x7200000, 0xfa00000,
+ 0x6400000, 0x7400000, 0x000000, 0xfa00000, 0x6400000, 0x6000000, 0x000000, 0xfc00000,
+ 0xfa00000, 0xda00000, 0x6200000, 0x5000000, 0x5000000, 0x5000000, 0x6000000, 0x000000,
+ 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x4000000, 0x6000000, 0x6000000, 0x6000000,
+ 0xfa00000, 0x000000, 0x7400000, 0xea00000, 0x4000000, 0x6000000, 0x6000000, 0xea00000,
+ 0x4000000, 0x6400000, 0x6000000, 0x6400000, 0x6400000, 0x4400000, 0x4400000, 0x6000000,
+ 0xfc00000, 0xfa00000, 0x6000000, 0x1000000, 0x6400000, 0xea00000, 0x6000000, 0xda00000,
+ 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x7400000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x7000000,
+ 0x6000000, 0xca00000, 0x000000, 0x6000000, 0x6000000, 0x4000000, 0x6000000, 0x7000000,
+ 0x6000000, 0xfa00000, 0x6400000, 0x6000000, 0x6000000, 0xfa00000, 0x4000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_71[] = {
+ 0x6000000, 0x000000, 0x6000000, 0x400000, 0xec00000, 0x4400000, 0x6400000, 0x400000,
+ 0x000000, 0xfa00000, 0x7000000, 0x6400000, 0xec00000, 0x6000000, 0x6000000, 0x400000,
+ 0x7000000, 0x000000, 0x000000, 0x7000000, 0x200000, 0x1000000, 0x1000000, 0x6000000,
+ 0x1000000, 0xfa00000, 0xfa00000, 0x6000000, 0x6200000, 0x4000000, 0xec00000, 0x6000000,
+ 0x6400000, 0xea00000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0xfa00000, 0x000000,
+ 0x6000000, 0x4000000, 0x000000, 0x4400000, 0x4000000, 0x400000, 0x6000000, 0x7400000,
+ 0xfc00000, 0x7400000, 0x6000000, 0x4000000, 0x4000000, 0x4000000, 0xfa00000, 0x000000,
+ 0x400000, 0x000000, 0x6000000, 0x4000000, 0x200000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x5400000, 0x6400000, 0xec00000,
+ 0x000000, 0xea00000, 0xdc00000, 0x6400000, 0xfa00000, 0x6000000, 0xfa00000, 0x4000000,
+ 0xec00000, 0x4000000, 0x6400000, 0x6000000, 0x6000000, 0x200000, 0xea00000, 0x400000,
+ 0x6000000, 0xea00000, 0x6400000, 0x000000, 0xfc00000, 0x6000000, 0xfc00000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6200000, 0x6000000, 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000,
+ 0x7400000, 0xea00000, 0x6000000, 0x4000000, 0xea00000, 0x000000, 0xfa00000, 0x000000,
+ 0x6000000, 0x4000000, 0x7000000, 0x5000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x7000000, 0x400000, 0x5000000, 0x6000000, 0x4000000, 0xfa00000, 0x4000000, 0x000000,
+ 0x6400000, 0x6000000, 0x6000000, 0x000000, 0xfa00000, 0x6400000, 0x6000000, 0x6400000,
+ 0x4200000, 0xe800000, 0xfa00000, 0x000000, 0x4400000, 0x000000, 0x4000000, 0xfa00000,
+ 0x6000000, 0x4000000, 0xec00000, 0x000000, 0xfa00000, 0x200000, 0x4000000, 0x6000000,
+ 0x5000000, 0xfa00000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000,
+ 0x7400000, 0x6000000, 0xcc00000, 0x4000000, 0x6000000, 0x6000000, 0x000000, 0x6000000,
+ 0x7200000, 0x6000000, 0x6000000, 0x000000, 0xfa00000, 0x4000000, 0x000000, 0x6400000,
+ 0x6400000, 0xea00000, 0x6400000, 0x7400000, 0x4000000, 0x7000000, 0x000000, 0x4000000,
+ 0x6000000, 0xfa00000, 0xcc00000, 0x000000, 0x6000000, 0x6000000, 0xea00000, 0x6400000,
+ 0x6400000, 0xec00000, 0x6000000, 0xfa00000, 0x6400000, 0x6000000, 0x6000000, 0x6000000,
+ 0xea00000, 0xea00000, 0x6000000, 0x6400000, 0x400000, 0x000000, 0xfa00000, 0x6000000,
+ 0xea00000, 0x4000000, 0xea00000, 0x400000, 0xfa00000, 0xfa00000, 0x6400000, 0x200000,
+ 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x4000000, 0x000000, 0xea00000,
+ 0x7200000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0xfa00000, 0xea00000, 0xfa00000,
+ 0x6000000, 0x000000, 0x000000, 0x4000000, 0x6200000, 0xea00000, 0xfa00000, 0x000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x4200000, 0x4000000, 0x000000,
+ 0x6400000, 0x7200000, 0x000000, 0xea00000, 0xea00000, 0x6000000, 0xec00000, 0xea00000
+};
+
+static const unsigned long unicode_backtrans_72[] = {
+ 0xcc00000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0xfa00000, 0x6400000,
+ 0x400000, 0x4400000, 0x6000000, 0x000000, 0x6000000, 0x6200000, 0x4000000, 0x4000000,
+ 0xea00000, 0x000000, 0x000000, 0x6400000, 0x6000000, 0x4000000, 0x4000000, 0x4400000,
+ 0x000000, 0x6000000, 0x6400000, 0xea00000, 0x000000, 0x7400000, 0x6000000, 0x6400000,
+ 0x000000, 0x000000, 0x6000000, 0x6000000, 0x4400000, 0x000000, 0x6000000, 0x6000000,
+ 0x7200000, 0x6000000, 0xfa00000, 0x4400000, 0xfa00000, 0xea00000, 0x4000000, 0x400000,
+ 0xfa00000, 0x1000000, 0x8a00000, 0x000000, 0x400000, 0xfa00000, 0xfa00000, 0x1000000,
+ 0x7400000, 0x7400000, 0xea00000, 0xfa00000, 0x200000, 0xfa00000, 0xea00000, 0x7200000,
+ 0xca00000, 0x6400000, 0x6400000, 0x400000, 0x6000000, 0x400000, 0xea00000, 0xfa00000,
+ 0xfa00000, 0x6000000, 0x6000000, 0x6200000, 0xfa00000, 0x1000000, 0x400000, 0x6400000,
+ 0x4400000, 0x000000, 0xfa00000, 0x6400000, 0x000000, 0x4400000, 0x7400000, 0x4000000,
+ 0xea00000, 0xfa00000, 0x6400000, 0xfa00000, 0x4400000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0xfa00000, 0x6400000, 0x000000, 0x000000, 0x5000000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x6000000, 0x400000, 0x6000000, 0x000000, 0x7400000, 0x7400000,
+ 0x6000000, 0x400000, 0xfa00000, 0x6000000, 0x6200000, 0x1000000, 0x6000000, 0x6400000,
+ 0x6400000, 0xfa00000, 0x1000000, 0x6400000, 0x6400000, 0xea00000, 0x7200000, 0x7400000,
+ 0xfa00000, 0xfa00000, 0x4200000, 0x000000, 0x7400000, 0x6000000, 0x6000000, 0x4200000,
+ 0x6000000, 0x6400000, 0x1000000, 0x7000000, 0x6000000, 0x7400000, 0x6400000, 0x5000000,
+ 0x6000000, 0x6000000, 0x7200000, 0x6400000, 0x4000000, 0x6000000, 0x6200000, 0x6000000,
+ 0x6000000, 0x000000, 0x6000000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0x5000000,
+ 0x200000, 0x6000000, 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0xea00000,
+ 0x6400000, 0x6000000, 0x6000000, 0x000000, 0xfa00000, 0x5400000, 0x6400000, 0xfa00000,
+ 0x7000000, 0x400000, 0x4200000, 0x000000, 0x7400000, 0x6000000, 0x1200000, 0x1000000,
+ 0x1000000, 0x1200000, 0x6000000, 0x000000, 0x000000, 0x6000000, 0x400000, 0x6000000,
+ 0xe800000, 0x7400000, 0xfa00000, 0x7200000, 0xfa00000, 0x6000000, 0x6200000, 0x400000,
+ 0x1000000, 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0x5000000, 0xfa00000, 0x000000,
+ 0xfa00000, 0x6000000, 0x7200000, 0x000000, 0x6000000, 0x400000, 0x6400000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x6000000, 0x200000, 0x6000000, 0x000000, 0x1000000, 0x6400000,
+ 0x7200000, 0xfa00000, 0x4200000, 0x6000000, 0x6000000, 0x400000, 0x6000000, 0x000000,
+ 0x7000000, 0xfa00000, 0x6000000, 0x6000000, 0x1200000, 0x1200000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x7400000, 0x7400000, 0x000000, 0x6000000, 0x7200000,
+ 0xfa00000, 0xea00000, 0x7400000, 0x7400000, 0xfa00000, 0xea00000, 0x6400000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_73[] = {
+ 0x6000000, 0x7000000, 0x4400000, 0x1000000, 0x4400000, 0x400000, 0x000000, 0x6400000,
+ 0x6000000, 0x000000, 0xfa00000, 0x6400000, 0x6000000, 0x400000, 0x1000000, 0x6000000,
+ 0x4000000, 0x6000000, 0x6400000, 0x7400000, 0x000000, 0x1000000, 0xfa00000, 0x7200000,
+ 0x6400000, 0x6400000, 0x000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7400000, 0x200000,
+ 0x000000, 0x1000000, 0x7400000, 0x6000000, 0x400000, 0xfa00000, 0x6000000, 0x6400000,
+ 0x4400000, 0xfa00000, 0xda00000, 0xda00000, 0x5400000, 0x6000000, 0x5200000, 0x200000,
+ 0x6000000, 0x7400000, 0x6400000, 0x6000000, 0x7200000, 0x6400000, 0xea00000, 0xfa00000,
+ 0x5000000, 0x5000000, 0x6400000, 0x6400000, 0x6000000, 0x400000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0x4000000, 0x6000000, 0x6400000, 0xea00000, 0xea00000, 0x000000, 0x000000,
+ 0x4000000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x7400000, 0x6200000, 0x4200000,
+ 0xfc00000, 0x6000000, 0xfc00000, 0x000000, 0x000000, 0x000000, 0x400000, 0xfa00000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x6400000, 0x6400000, 0x6400000,
+ 0x7400000, 0x6000000, 0x6000000, 0x200000, 0x000000, 0x6000000, 0x6400000, 0x6400000,
+ 0xea00000, 0x6400000, 0xea00000, 0x6400000, 0x7400000, 0x1000000, 0x6400000, 0x7400000,
+ 0xea00000, 0x4400000, 0xea00000, 0x6000000, 0x4000000, 0xea00000, 0x6000000, 0x6400000,
+ 0xea00000, 0x400000, 0xea00000, 0xea00000, 0x6400000, 0x6000000, 0x7000000, 0x6000000,
+ 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0xfa00000, 0x6400000, 0xec00000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x6000000, 0xfa00000, 0x4000000, 0x000000, 0xfc00000, 0x4000000,
+ 0x400000, 0x1000000, 0x6000000, 0x6400000, 0xe800000, 0x6400000, 0xfa00000, 0xec00000,
+ 0xcc00000, 0x000000, 0x000000, 0x1000000, 0x4400000, 0x6000000, 0x4400000, 0xfc00000,
+ 0x6400000, 0x6000000, 0x7400000, 0x000000, 0x6000000, 0x6400000, 0x6400000, 0xc800000,
+ 0x6000000, 0xfa00000, 0x4400000, 0x7400000, 0x6000000, 0xec00000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0xfa00000, 0xfa00000, 0x6000000, 0x6400000, 0x6000000, 0x7400000,
+ 0x6000000, 0xec00000, 0x5000000, 0x7200000, 0x6400000, 0x400000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x000000, 0xfa00000, 0x6000000, 0x000000, 0x6400000, 0x6400000, 0x6000000,
+ 0x7200000, 0xdc00000, 0xfa00000, 0x6400000, 0xec00000, 0xfa00000, 0x4200000, 0xdc00000,
+ 0x5000000, 0x1000000, 0x6400000, 0x6400000, 0x6000000, 0x4000000, 0xec00000, 0x6000000,
+ 0x6000000, 0xfc00000, 0x6000000, 0x6000000, 0x6000000, 0xec00000, 0xfa00000, 0x000000,
+ 0xfa00000, 0x4400000, 0x4000000, 0xec00000, 0xc800000, 0xfa00000, 0xcc00000, 0x7400000,
+ 0x6000000, 0xfc00000, 0xea00000, 0x6000000, 0x000000, 0xfa00000, 0x6200000, 0x4000000,
+ 0x000000, 0x200000, 0x1000000, 0x4000000, 0x6400000, 0x6400000, 0x6000000, 0xcc00000,
+ 0x6200000, 0xcc00000, 0x6400000, 0x4400000, 0x6000000, 0xec00000, 0xea00000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_74[] = {
+ 0x6400000, 0xec00000, 0x4000000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000, 0xec00000,
+ 0x6000000, 0xfa00000, 0x7400000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x1000000,
+ 0x1000000, 0x4400000, 0x4000000, 0x8800000, 0x4000000, 0x4000000, 0x6000000, 0x4000000,
+ 0x000000, 0x4000000, 0x7400000, 0xfc00000, 0x4000000, 0x6000000, 0x4000000, 0x4000000,
+ 0xe800000, 0xe800000, 0xfa00000, 0x6000000, 0x6400000, 0xfa00000, 0xfc00000, 0x000000,
+ 0xfc00000, 0x6400000, 0xfc00000, 0xec00000, 0xfc00000, 0x6400000, 0xfc00000, 0xec00000,
+ 0xfc00000, 0x6400000, 0x6200000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x4000000,
+ 0xc800000, 0x4400000, 0xea00000, 0x000000, 0x5000000, 0x000000, 0x000000, 0xea00000,
+ 0xec00000, 0xfa00000, 0x6000000, 0xcc00000, 0xec00000, 0x4000000, 0x6400000, 0x4400000,
+ 0x4000000, 0x4000000, 0x6000000, 0xec00000, 0x000000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6400000, 0x4000000, 0x6000000, 0xfa00000, 0x4000000, 0xfc00000,
+ 0x000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xda00000, 0x4400000, 0xfa00000, 0xfa00000,
+ 0xca00000, 0x000000, 0xec00000, 0x6200000, 0xea00000, 0xc800000, 0x400000, 0x6400000,
+ 0xcc00000, 0xea00000, 0xea00000, 0x4400000, 0x4000000, 0x7400000, 0x6400000, 0xea00000,
+ 0x7200000, 0x6400000, 0x6400000, 0x6200000, 0x4000000, 0x6000000, 0x5200000, 0x1000000,
+ 0x000000, 0x6000000, 0x4000000, 0x000000, 0x6000000, 0x6000000, 0xfa00000, 0x6000000,
+ 0x7400000, 0x7400000, 0xc800000, 0xfa00000, 0x000000, 0x6400000, 0x6400000, 0xfc00000,
+ 0x6000000, 0xec00000, 0x6000000, 0xfa00000, 0x4000000, 0x4000000, 0x1000000, 0x400000,
+ 0x7400000, 0x400000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0x000000, 0x6000000,
+ 0xec00000, 0x4400000, 0x6400000, 0x4000000, 0xfc00000, 0x000000, 0xfa00000, 0xec00000,
+ 0x6400000, 0xec00000, 0x200000, 0xec00000, 0x4000000, 0xe800000, 0x6400000, 0xfa00000,
+ 0xfc00000, 0x7400000, 0xec00000, 0x6400000, 0x000000, 0x6000000, 0x400000, 0x6400000,
+ 0xea00000, 0x6400000, 0xec00000, 0x000000, 0x4000000, 0xec00000, 0x6000000, 0x6000000,
+ 0x6000000, 0xcc00000, 0x7000000, 0x6400000, 0x000000, 0xea00000, 0x6000000, 0xec00000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x8800000, 0x000000,
+ 0x4400000, 0x400000, 0xea00000, 0x6000000, 0x4400000, 0x000000, 0x000000, 0xea00000,
+ 0x4400000, 0x000000, 0x1000000, 0x4400000, 0xea00000, 0x6000000, 0x6000000, 0x6000000,
+ 0xec00000, 0x6000000, 0xec00000, 0x6400000, 0xfa00000, 0x6000000, 0x7400000, 0x6400000,
+ 0xfa00000, 0x6000000, 0xfa00000, 0xfa00000, 0x7400000, 0x6000000, 0xfa00000, 0x4200000,
+ 0x6400000, 0x6200000, 0x400000, 0x400000, 0x6000000, 0x000000, 0xfa00000, 0x1400000,
+ 0x4200000, 0x4200000, 0x4200000, 0x000000, 0x7400000, 0x6000000, 0x7200000, 0xfa00000,
+ 0x4200000, 0x000000, 0x400000, 0x6400000, 0x400000, 0x6000000, 0x6000000, 0x7400000
+};
+
+static const unsigned long unicode_backtrans_75[] = {
+ 0x6000000, 0x8800000, 0x6000000, 0x6200000, 0xfa00000, 0x4200000, 0x400000, 0x6000000,
+ 0x6000000, 0x000000, 0x000000, 0x6000000, 0x6200000, 0x7200000, 0x4200000, 0x7000000,
+ 0x6000000, 0xfa00000, 0x6400000, 0x7200000, 0x6000000, 0xea00000, 0x6400000, 0x6400000,
+ 0xfa00000, 0x5000000, 0xfa00000, 0x8800000, 0x7200000, 0x6000000, 0x4200000, 0xfa00000,
+ 0x400000, 0x6400000, 0x6000000, 0x8a00000, 0x400000, 0xfa00000, 0xea00000, 0x400000,
+ 0xfa00000, 0x7400000, 0x6400000, 0xfa00000, 0xfa00000, 0x7000000, 0x6000000, 0x7400000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x4000000, 0x5000000, 0x400000, 0xfa00000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x5200000, 0x200000, 0x6400000, 0x7400000, 0x6400000,
+ 0x7400000, 0x000000, 0x4000000, 0x400000, 0x200000, 0x1000000, 0x4200000, 0xec00000,
+ 0x7400000, 0x200000, 0x4200000, 0x7200000, 0xfa00000, 0x4200000, 0x7400000, 0xfa00000,
+ 0x400000, 0xca00000, 0x400000, 0xc800000, 0xfa00000, 0x4000000, 0x000000, 0x400000,
+ 0x000000, 0xfa00000, 0x7200000, 0xfa00000, 0xfa00000, 0xea00000, 0x400000, 0x6400000,
+ 0x4200000, 0x400000, 0xea00000, 0x6000000, 0x6200000, 0xfa00000, 0xfa00000, 0x4200000,
+ 0x000000, 0x200000, 0xfa00000, 0x6200000, 0x6000000, 0x4200000, 0x4000000, 0xec00000,
+ 0xea00000, 0x400000, 0x5000000, 0x200000, 0x1200000, 0x8800000, 0xea00000, 0x6200000,
+ 0xfa00000, 0x7400000, 0xcc00000, 0x400000, 0x400000, 0x6400000, 0x6400000, 0xfa00000,
+ 0x6000000, 0x400000, 0x200000, 0x5000000, 0x6000000, 0x400000, 0xfa00000, 0xea00000,
+ 0x000000, 0x200000, 0xea00000, 0xfa00000, 0x6000000, 0x4000000, 0xca00000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0x5400000, 0x400000, 0x7200000, 0x6400000, 0x1000000, 0x1000000,
+ 0x6000000, 0x7400000, 0x7200000, 0x000000, 0x400000, 0xfa00000, 0x4000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x6400000, 0x7200000, 0x7400000, 0xfa00000, 0x000000, 0x6000000,
+ 0x000000, 0x000000, 0x6000000, 0xfa00000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x7000000, 0xda00000, 0xfa00000, 0xfa00000, 0x5400000, 0xfa00000, 0x6000000, 0x000000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6400000,
+ 0x6400000, 0x6400000, 0xfa00000, 0x5200000, 0x7400000, 0xfa00000, 0x400000, 0xfa00000,
+ 0x5000000, 0x1000000, 0x7200000, 0x6000000, 0x6400000, 0xfa00000, 0x6400000, 0x6400000,
+ 0x6000000, 0x6000000, 0xfa00000, 0x000000, 0xfa00000, 0xfa00000, 0x1000000, 0x6400000,
+ 0xfa00000, 0xea00000, 0x6000000, 0xfa00000, 0x4400000, 0x6000000, 0x7200000, 0x6400000,
+ 0x6400000, 0x6400000, 0xfa00000, 0x7200000, 0x7400000, 0x000000, 0x7000000, 0x7400000,
+ 0x1000000, 0x200000, 0x1000000, 0x1000000, 0x400000, 0x6000000, 0x400000, 0x6400000,
+ 0xfa00000, 0x7400000, 0xea00000, 0x6200000, 0xfa00000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x7400000, 0xea00000, 0x6000000, 0xfa00000, 0x6000000, 0x6200000, 0x7200000
+};
+
+static const unsigned long unicode_backtrans_76[] = {
+ 0xfc00000, 0x7200000, 0x4400000, 0x7400000, 0x400000, 0x1000000, 0x000000, 0x4400000,
+ 0x6400000, 0x6200000, 0x7400000, 0x6200000, 0x7400000, 0xea00000, 0x000000, 0x6400000,
+ 0x7000000, 0x6000000, 0x400000, 0x6400000, 0x6000000, 0x7400000, 0x6400000, 0x1000000,
+ 0x1000000, 0xfc00000, 0x6000000, 0x7400000, 0x6400000, 0x6400000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0x6400000, 0xfa00000, 0x7400000, 0xfc00000, 0x6200000,
+ 0x6000000, 0x7400000, 0x1000000, 0x1000000, 0x4000000, 0x7400000, 0x000000, 0x6000000,
+ 0x7200000, 0x6000000, 0x6400000, 0x7400000, 0x7200000, 0x7400000, 0x000000, 0x000000,
+ 0x7400000, 0x400000, 0x6400000, 0xca00000, 0x7400000, 0x6000000, 0x1000000, 0x1000000,
+ 0x5400000, 0x400000, 0xea00000, 0x7400000, 0x400000, 0x400000, 0x6200000, 0x6200000,
+ 0x6200000, 0x6400000, 0x400000, 0x400000, 0xfa00000, 0x5000000, 0xc800000, 0x4000000,
+ 0x6000000, 0x4000000, 0xea00000, 0x6000000, 0x5000000, 0x400000, 0xfa00000, 0x6000000,
+ 0x6200000, 0x6400000, 0x6000000, 0x000000, 0x7200000, 0x000000, 0x1000000, 0x6400000,
+ 0x6000000, 0xea00000, 0x6200000, 0x1000000, 0xec00000, 0x6400000, 0x4000000, 0x4200000,
+ 0x200000, 0xea00000, 0x6200000, 0x1000000, 0xea00000, 0x6400000, 0x6400000, 0x5400000,
+ 0xea00000, 0x6400000, 0xea00000, 0x4000000, 0x4400000, 0x6000000, 0x4200000, 0x000000,
+ 0xfa00000, 0x6000000, 0x4200000, 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000, 0x6000000,
+ 0x200000, 0x6400000, 0x7000000, 0x200000, 0xfa00000, 0x400000, 0xfa00000, 0xfa00000,
+ 0x7200000, 0x6000000, 0x6000000, 0x7200000, 0x400000, 0x400000, 0xfa00000, 0x6000000,
+ 0xca00000, 0x1000000, 0x6000000, 0xfa00000, 0x000000, 0x6400000, 0x7200000, 0x000000,
+ 0x000000, 0x7200000, 0x6200000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x400000,
+ 0x400000, 0x4000000, 0x400000, 0x400000, 0x7400000, 0x4400000, 0x6400000, 0x400000,
+ 0x400000, 0x000000, 0x6400000, 0x6000000, 0x000000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x6200000, 0x1000000, 0x1000000, 0x000000, 0x7200000, 0x6000000, 0x000000, 0x4200000,
+ 0x6200000, 0x200000, 0xea00000, 0x6000000, 0x000000, 0x6400000, 0x6000000, 0xfa00000,
+ 0x000000, 0x400000, 0xfa00000, 0xea00000, 0x6000000, 0x7400000, 0xfa00000, 0x000000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x400000, 0x4400000, 0x7200000, 0x7400000, 0x1000000,
+ 0x1000000, 0x1000000, 0xfa00000, 0x6000000, 0x7400000, 0x000000, 0xda00000, 0x1200000,
+ 0x1000000, 0x4400000, 0x6000000, 0xfa00000, 0xea00000, 0x6000000, 0xea00000, 0xfa00000,
+ 0x400000, 0xea00000, 0x000000, 0xea00000, 0xea00000, 0x7200000, 0x6400000, 0xea00000,
+ 0x400000, 0x6000000, 0x6200000, 0x000000, 0x6400000, 0x6000000, 0xfa00000, 0x7000000,
+ 0x6400000, 0x7400000, 0xfa00000, 0x6000000, 0xfa00000, 0x6000000, 0x400000, 0x6000000,
+ 0xfa00000, 0x7400000, 0x6000000, 0x6200000, 0xfc00000, 0x000000, 0xfa00000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_77[] = {
+ 0x400000, 0xfa00000, 0x000000, 0x6000000, 0xfa00000, 0x6000000, 0x400000, 0x7200000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0xfa00000, 0x4200000, 0x1000000, 0x4400000, 0x4000000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x400000, 0x6400000, 0x000000, 0x400000,
+ 0x000000, 0x7400000, 0x7400000, 0x6200000, 0x400000, 0x6000000, 0xca00000, 0x7200000,
+ 0xfa00000, 0x000000, 0x7400000, 0x6000000, 0x4200000, 0x6200000, 0x5200000, 0x6000000,
+ 0x7400000, 0xfa00000, 0x000000, 0x4000000, 0x000000, 0x7400000, 0x400000, 0x7400000,
+ 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x7400000, 0x7400000, 0xfa00000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x6000000, 0xfa00000, 0x6400000, 0x6400000, 0x000000,
+ 0xda00000, 0x1000000, 0x400000, 0x5000000, 0x6000000, 0x6400000, 0x6400000, 0x7200000,
+ 0x000000, 0x000000, 0x6400000, 0x6000000, 0x6000000, 0xec00000, 0x6400000, 0x6400000,
+ 0x1000000, 0x1000000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0x6400000, 0x400000,
+ 0x4000000, 0x6000000, 0x7200000, 0xfa00000, 0x6400000, 0x000000, 0x6400000, 0x6400000,
+ 0x6400000, 0xfa00000, 0x7400000, 0xfa00000, 0x400000, 0x7200000, 0xfa00000, 0x6400000,
+ 0x7200000, 0x6000000, 0x6400000, 0xfa00000, 0x7400000, 0x6000000, 0x6000000, 0x6000000,
+ 0x400000, 0x000000, 0x4400000, 0x400000, 0x400000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0xfa00000, 0x4400000, 0x4000000, 0x6000000, 0x7400000, 0xfa00000, 0xfa00000,
+ 0x7400000, 0x6000000, 0x6000000, 0x6000000, 0x7400000, 0x7000000, 0x000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x000000, 0xea00000, 0x7400000, 0x7400000, 0x7200000, 0x6000000,
+ 0x000000, 0xfa00000, 0x1000000, 0x4000000, 0x400000, 0x6400000, 0x400000, 0x6000000,
+ 0x4000000, 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0xea00000, 0x7400000,
+ 0x7200000, 0x6000000, 0x7400000, 0x6000000, 0x000000, 0xfa00000, 0x000000, 0x7400000,
+ 0x6000000, 0x1000000, 0x7400000, 0x6000000, 0xfa00000, 0xea00000, 0x400000, 0x4400000,
+ 0xfa00000, 0x6400000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000, 0x6200000, 0x6000000,
+ 0x000000, 0x4200000, 0x6000000, 0xfa00000, 0xea00000, 0x7200000, 0x4400000, 0xfa00000,
+ 0x000000, 0x000000, 0x6000000, 0x4400000, 0x6000000, 0x4000000, 0x000000, 0x6200000,
+ 0x000000, 0x6400000, 0x6000000, 0x4000000, 0x6000000, 0x7200000, 0x6000000, 0x6000000,
+ 0x6000000, 0x400000, 0x400000, 0x6000000, 0x6000000, 0x6400000, 0x000000, 0xfa00000,
+ 0x6000000, 0x6400000, 0x6200000, 0xfa00000, 0xfa00000, 0x4000000, 0x6400000, 0x400000,
+ 0x6400000, 0x000000, 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0x4400000, 0x7200000,
+ 0x6000000, 0xfa00000, 0x400000, 0x1000000, 0x7400000, 0xfa00000, 0xfa00000, 0xea00000,
+ 0x6400000, 0x6400000, 0x6000000, 0xfa00000, 0x4400000, 0x000000, 0x1000000, 0x6000000,
+ 0x7400000, 0x6000000, 0x6000000, 0x6400000, 0x6200000, 0x7000000, 0x5000000, 0x1000000
+};
+
+static const unsigned long unicode_backtrans_78[] = {
+ 0x1000000, 0x1000000, 0xfa00000, 0x6000000, 0x000000, 0x6400000, 0x6400000, 0x000000,
+ 0x4000000, 0x7400000, 0x000000, 0x000000, 0x7200000, 0x7400000, 0x6400000, 0x6000000,
+ 0x6000000, 0x7400000, 0xfa00000, 0x6000000, 0x7200000, 0x200000, 0x1000000, 0x1000000,
+ 0x5000000, 0x000000, 0x1000000, 0x000000, 0x5000000, 0x7400000, 0x4000000, 0x7000000,
+ 0x6200000, 0x6400000, 0x6400000, 0x7400000, 0x000000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0x7000000, 0x6000000, 0x6000000, 0xf800000, 0x7400000, 0x6400000, 0x6000000,
+ 0x7400000, 0x6000000, 0xea00000, 0x6000000, 0xfa00000, 0x6400000, 0x000000, 0x7400000,
+ 0x7000000, 0x5000000, 0x1200000, 0x1000000, 0x5000000, 0x4000000, 0x1000000, 0x200000,
+ 0x1000000, 0x000000, 0x4000000, 0x6400000, 0x4400000, 0xfa00000, 0x000000, 0x5400000,
+ 0x6400000, 0x6000000, 0x6000000, 0x4000000, 0x7400000, 0x6000000, 0x7400000, 0x8800000,
+ 0x7000000, 0x4000000, 0x7400000, 0x4000000, 0x4000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x6400000, 0xfa00000, 0x6400000, 0x000000,
+ 0x6400000, 0x400000, 0x6000000, 0x400000, 0x6400000, 0x6000000, 0x4000000, 0x000000,
+ 0x6400000, 0x6000000, 0x7400000, 0xfa00000, 0xfa00000, 0x7000000, 0x7400000, 0xea00000,
+ 0x6000000, 0x6000000, 0x200000, 0x000000, 0x200000, 0x000000, 0x000000, 0x1000000,
+ 0x000000, 0x6000000, 0x4400000, 0x6000000, 0xfa00000, 0x000000, 0x6400000, 0x6000000,
+ 0x6000000, 0xca00000, 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6200000, 0xfa00000,
+ 0x4000000, 0x7000000, 0x400000, 0x000000, 0xfa00000, 0xda00000, 0xfa00000, 0x6400000,
+ 0x000000, 0xfa00000, 0x000000, 0x7200000, 0x6400000, 0x6200000, 0x6000000, 0xfa00000,
+ 0x7400000, 0x6000000, 0x7200000, 0x1000000, 0x1000000, 0x400000, 0x6400000, 0x7400000,
+ 0x6000000, 0x7400000, 0x6000000, 0xfa00000, 0x6400000, 0x7000000, 0x000000, 0xfa00000,
+ 0x6400000, 0xea00000, 0x6200000, 0x6000000, 0x6400000, 0x6400000, 0x000000, 0x4200000,
+ 0x7400000, 0x5400000, 0x7400000, 0x7400000, 0x7000000, 0x200000, 0x4000000, 0x000000,
+ 0x4000000, 0x5000000, 0xea00000, 0xec00000, 0xea00000, 0x400000, 0x7200000, 0x400000,
+ 0x000000, 0xfa00000, 0x000000, 0x6000000, 0x6000000, 0xfa00000, 0x200000, 0x4400000,
+ 0x6400000, 0x7400000, 0xfa00000, 0xfa00000, 0x6400000, 0x6000000, 0xec00000, 0x6000000,
+ 0xfa00000, 0x6200000, 0x4400000, 0x4400000, 0x7200000, 0x7400000, 0x400000, 0x4000000,
+ 0x4000000, 0x1000000, 0x6200000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x4400000, 0x6000000, 0x400000, 0x6200000,
+ 0xfa00000, 0x6000000, 0x6400000, 0x000000, 0xfa00000, 0x6000000, 0x4000000, 0xea00000,
+ 0x4000000, 0x4000000, 0x7400000, 0x6400000, 0x7200000, 0xc800000, 0x400000, 0x7400000,
+ 0x000000, 0x6000000, 0x7400000, 0xec00000, 0x6000000, 0x6200000, 0x6000000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_79[] = {
+ 0x400000, 0xfa00000, 0x6000000, 0x000000, 0x6000000, 0x7000000, 0x4400000, 0x200000,
+ 0x000000, 0x6000000, 0x000000, 0x000000, 0x6400000, 0x000000, 0xea00000, 0x000000,
+ 0x6400000, 0x6200000, 0x6200000, 0x7000000, 0x6000000, 0x000000, 0x8800000, 0x6000000,
+ 0x000000, 0x6200000, 0x400000, 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x400000,
+ 0x400000, 0x6000000, 0x000000, 0x6000000, 0x7000000, 0x6400000, 0x6200000, 0x6400000,
+ 0x6000000, 0x6400000, 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0x4000000, 0x6000000,
+ 0x000000, 0x6400000, 0x4000000, 0x4000000, 0x5400000, 0x6400000, 0x4000000, 0x000000,
+ 0x6000000, 0x6000000, 0xfa00000, 0x5400000, 0x5200000, 0x6400000, 0xfa00000, 0x6400000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x000000, 0x6400000, 0x6400000, 0x7400000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x6400000, 0x6000000, 0x000000, 0x000000, 0x6400000,
+ 0xea00000, 0x6400000, 0x6000000, 0x7200000, 0x6400000, 0x6200000, 0xfa00000, 0xfa00000,
+ 0x4400000, 0x4000000, 0xfa00000, 0xfc00000, 0xfc00000, 0xfa00000, 0xfa00000, 0x7200000,
+ 0xfa00000, 0x6000000, 0x5200000, 0x6000000, 0x6000000, 0xfa00000, 0x000000, 0x7400000,
+ 0xfa00000, 0x6400000, 0x6000000, 0x6400000, 0x000000, 0xfa00000, 0x000000, 0x1000000,
+ 0x6000000, 0x4000000, 0x6400000, 0x6000000, 0x6000000, 0x000000, 0x000000, 0x1200000,
+ 0x1000000, 0x6400000, 0xfa00000, 0x400000, 0x6400000, 0x6000000, 0x4400000, 0xea00000,
+ 0x5200000, 0xfa00000, 0x6000000, 0x4000000, 0x1200000, 0x1200000, 0x4000000, 0x4000000,
+ 0x6000000, 0x000000, 0x7200000, 0x6400000, 0x400000, 0xea00000, 0xea00000, 0xfa00000,
+ 0x6000000, 0xcc00000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6000000,
+ 0x6400000, 0x4000000, 0x7000000, 0x6400000, 0x6400000, 0x4200000, 0x000000, 0x4000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x000000, 0x6000000, 0x4000000, 0xea00000, 0xfa00000,
+ 0x6400000, 0x4400000, 0xea00000, 0x6400000, 0x6000000, 0x6000000, 0xea00000, 0x400000,
+ 0x6200000, 0xec00000, 0x6000000, 0xfa00000, 0x6400000, 0x000000, 0x6000000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x7200000, 0x7400000, 0x000000, 0xfa00000, 0xfa00000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0x400000, 0x1000000, 0x4400000, 0x6000000, 0x5000000, 0x400000,
+ 0x6400000, 0xfa00000, 0x8c00000, 0xfa00000, 0x4000000, 0x7000000, 0x6000000, 0x6400000,
+ 0x000000, 0xfa00000, 0xfa00000, 0x000000, 0x4400000, 0xfa00000, 0x6400000, 0x000000,
+ 0xfa00000, 0x000000, 0x400000, 0x000000, 0x6000000, 0x6400000, 0x6400000, 0xfa00000,
+ 0x6400000, 0x200000, 0x4400000, 0x7200000, 0xfa00000, 0x400000, 0xfa00000, 0xfa00000,
+ 0x000000, 0xfa00000, 0x6400000, 0x7400000, 0x6200000, 0x7400000, 0x6000000, 0x1000000,
+ 0x1200000, 0x4400000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x6000000, 0x6000000,
+ 0x7400000, 0x000000, 0x6000000, 0xfa00000, 0x400000, 0x1000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_7a[] = {
+ 0xfa00000, 0x000000, 0x7400000, 0x7400000, 0x6000000, 0xe800000, 0x5000000, 0x400000,
+ 0xea00000, 0x400000, 0x6400000, 0xfa00000, 0x6400000, 0xfa00000, 0x1200000, 0x000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0xfa00000, 0x6400000, 0x000000, 0xfa00000,
+ 0x6200000, 0xea00000, 0xfa00000, 0x6400000, 0xea00000, 0x000000, 0x7400000, 0xea00000,
+ 0xfa00000, 0x400000, 0x6000000, 0x1000000, 0x000000, 0x000000, 0x6000000, 0x400000,
+ 0x6000000, 0x000000, 0x4000000, 0x6400000, 0x000000, 0x4400000, 0xea00000, 0x6400000,
+ 0x6400000, 0xea00000, 0x200000, 0x1000000, 0x400000, 0x400000, 0x8800000, 0xfa00000,
+ 0x400000, 0x7400000, 0x4400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x4200000, 0xfa00000,
+ 0xea00000, 0x000000, 0x200000, 0x4200000, 0x6400000, 0x4400000, 0xfa00000, 0x6400000,
+ 0x6400000, 0xca00000, 0x6000000, 0x6000000, 0x6400000, 0xea00000, 0xea00000, 0x200000,
+ 0x200000, 0x1000000, 0x000000, 0x000000, 0x6000000, 0x400000, 0x6400000, 0xfa00000,
+ 0x6000000, 0x400000, 0x6000000, 0x6000000, 0x6400000, 0x400000, 0x000000, 0x6400000,
+ 0x6400000, 0xea00000, 0xea00000, 0x200000, 0x000000, 0x4400000, 0x000000, 0x6400000,
+ 0x6000000, 0xea00000, 0x400000, 0xea00000, 0x6000000, 0x6400000, 0x6000000, 0x000000,
+ 0xfa00000, 0x6000000, 0x000000, 0x000000, 0xfa00000, 0x6400000, 0xfa00000, 0x1000000,
+ 0x7400000, 0xfa00000, 0xfa00000, 0x6000000, 0x000000, 0xca00000, 0x6400000, 0xfa00000,
+ 0x7400000, 0xfa00000, 0x400000, 0x5200000, 0xfa00000, 0x6400000, 0x7400000, 0x6000000,
+ 0xfa00000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x1000000, 0x000000, 0x6000000,
+ 0x6400000, 0x5400000, 0xfa00000, 0xca00000, 0x6400000, 0xfa00000, 0x7200000, 0x7200000,
+ 0xfa00000, 0x6000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x6400000, 0xfa00000,
+ 0x7400000, 0x000000, 0x6000000, 0x6400000, 0x000000, 0x1000000, 0x1000000, 0x000000,
+ 0x7000000, 0xea00000, 0xea00000, 0x6000000, 0x7400000, 0x1000000, 0xea00000, 0xea00000,
+ 0x4200000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x6400000, 0x6200000, 0x6000000,
+ 0x6000000, 0x400000, 0xea00000, 0x4400000, 0x4400000, 0x000000, 0x6000000, 0x7200000,
+ 0x6000000, 0x6000000, 0x4000000, 0x4200000, 0xea00000, 0xea00000, 0x400000, 0xea00000,
+ 0x4200000, 0x4400000, 0xea00000, 0xfa00000, 0x400000, 0x200000, 0x400000, 0x4200000,
+ 0x000000, 0x6400000, 0x200000, 0x4200000, 0x000000, 0x200000, 0x1000000, 0x8800000,
+ 0x6000000, 0xfa00000, 0x4200000, 0x4400000, 0x4200000, 0xca00000, 0x1000000, 0xfa00000,
+ 0xfa00000, 0x200000, 0x4200000, 0xfa00000, 0x6000000, 0xfa00000, 0x7200000, 0x4000000,
+ 0x400000, 0x4400000, 0xca00000, 0x6400000, 0x400000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0x200000, 0x400000, 0x000000, 0x000000, 0x400000, 0x000000, 0xea00000, 0x6000000,
+ 0x200000, 0xfa00000, 0xfa00000, 0x6400000, 0x000000, 0x7400000, 0x4400000, 0xfa00000
+};
+
+static const unsigned long unicode_backtrans_7b[] = {
+ 0x6000000, 0x6000000, 0x200000, 0x1000000, 0x7200000, 0x6000000, 0x7200000, 0x400000,
+ 0x7200000, 0x6000000, 0x7200000, 0x5200000, 0x4000000, 0x000000, 0x6000000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x5400000, 0x1000000, 0x000000, 0x000000,
+ 0x6200000, 0xfa00000, 0x6000000, 0xfa00000, 0x000000, 0x6000000, 0xfa00000, 0x4400000,
+ 0xfa00000, 0x000000, 0x6000000, 0x6400000, 0x7000000, 0x7200000, 0xfa00000, 0x4400000,
+ 0x7200000, 0x4400000, 0x7400000, 0x7400000, 0xfa00000, 0xec00000, 0x7400000, 0x6400000,
+ 0x6400000, 0x7400000, 0x6000000, 0x7200000, 0x6400000, 0x6200000, 0x200000, 0x000000,
+ 0x7000000, 0xca00000, 0x1000000, 0x6000000, 0x1000000, 0x400000, 0x1000000, 0x400000,
+ 0x6400000, 0x400000, 0x4000000, 0x4000000, 0x6000000, 0x7200000, 0xea00000, 0x7400000,
+ 0x6200000, 0xfa00000, 0x6000000, 0xfa00000, 0xfa00000, 0xea00000, 0x6400000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0x4400000, 0xfa00000, 0x000000,
+ 0x7000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1200000, 0x000000, 0x000000,
+ 0xfc00000, 0x6000000, 0x5000000, 0x6000000, 0x6400000, 0x6200000, 0x6400000, 0x6200000,
+ 0x000000, 0x6400000, 0x400000, 0x000000, 0xca00000, 0x6400000, 0xfa00000, 0x4400000,
+ 0x6200000, 0x7200000, 0x7400000, 0x6400000, 0x6200000, 0xfa00000, 0x6000000, 0x7400000,
+ 0x6000000, 0x1000000, 0x200000, 0x5000000, 0x000000, 0x8800000, 0x1000000, 0x000000,
+ 0x1000000, 0x000000, 0x6000000, 0x000000, 0x6400000, 0x7000000, 0x200000, 0xea00000,
+ 0x6000000, 0x400000, 0x6000000, 0xea00000, 0x6000000, 0x7200000, 0x6400000, 0xea00000,
+ 0x7400000, 0x6400000, 0x4200000, 0x000000, 0xfa00000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0x6200000, 0x6200000, 0x8a00000, 0x6400000, 0x7200000, 0xfa00000, 0x400000, 0x200000,
+ 0x6400000, 0xfa00000, 0x5000000, 0x4000000, 0x6000000, 0x400000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1200000, 0x1000000, 0x7400000, 0xfa00000, 0x000000, 0x6400000,
+ 0x400000, 0xfa00000, 0x4400000, 0x000000, 0xfa00000, 0x6400000, 0x400000, 0x6000000,
+ 0xfa00000, 0x6000000, 0x400000, 0x400000, 0x400000, 0x400000, 0x6000000, 0x000000,
+ 0xea00000, 0xfa00000, 0x400000, 0x000000, 0xea00000, 0x400000, 0xfa00000, 0xfa00000,
+ 0x400000, 0xea00000, 0x6400000, 0x6200000, 0x7200000, 0x000000, 0x6000000, 0x4200000,
+ 0x4000000, 0x1000000, 0x8800000, 0x1000000, 0x6400000, 0x6000000, 0x400000, 0x400000,
+ 0x6000000, 0x7400000, 0x7400000, 0x6400000, 0x6000000, 0x7200000, 0x6000000, 0x6000000,
+ 0xea00000, 0x7000000, 0x6000000, 0x6000000, 0xea00000, 0x7200000, 0x7200000, 0x6000000,
+ 0x6400000, 0xea00000, 0x7400000, 0x6000000, 0x4000000, 0x200000, 0x1000000, 0x000000,
+ 0x6000000, 0x7000000, 0x6400000, 0x6200000, 0x6400000, 0x400000, 0x200000, 0x7200000,
+ 0x6400000, 0x6400000, 0x4400000, 0x6000000, 0x5400000, 0x6000000, 0x7400000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_7c[] = {
+ 0x6200000, 0x6400000, 0x6400000, 0x6400000, 0x400000, 0x6000000, 0x6400000, 0xfa00000,
+ 0x000000, 0x6400000, 0x6000000, 0x7400000, 0x7400000, 0x6200000, 0x6400000, 0x7400000,
+ 0x6000000, 0x6200000, 0xca00000, 0x200000, 0x200000, 0x4000000, 0x1000000, 0x200000,
+ 0x000000, 0x6400000, 0x000000, 0x4400000, 0x6000000, 0x6000000, 0xe800000, 0x7200000,
+ 0x6400000, 0xea00000, 0x6000000, 0x6200000, 0x000000, 0x6400000, 0x7400000, 0xfa00000,
+ 0x6400000, 0x6000000, 0xfa00000, 0xea00000, 0x6400000, 0x6000000, 0x000000, 0x000000,
+ 0x6000000, 0x400000, 0x000000, 0x6400000, 0x400000, 0x4000000, 0x400000, 0x6200000,
+ 0x7200000, 0x6400000, 0x400000, 0x6000000, 0x6000000, 0xea00000, 0xea00000, 0xfa00000,
+ 0x7200000, 0x1000000, 0x4000000, 0xea00000, 0x4000000, 0x6000000, 0x400000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6400000, 0x000000, 0xea00000, 0xfa00000, 0x000000, 0x200000,
+ 0x6200000, 0x4400000, 0x400000, 0x6400000, 0x6200000, 0x400000, 0x4200000, 0x6000000,
+ 0x200000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x4400000, 0x400000, 0x6200000,
+ 0xea00000, 0x400000, 0x000000, 0x6400000, 0xea00000, 0x6200000, 0x6000000, 0x6400000,
+ 0x000000, 0x6400000, 0x6000000, 0x6000000, 0xea00000, 0x4400000, 0x6400000, 0x6000000,
+ 0x4400000, 0x000000, 0x6400000, 0xfa00000, 0x5000000, 0x6200000, 0x000000, 0x000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x5000000, 0x5400000, 0x7400000, 0x4200000, 0x6000000,
+ 0x6000000, 0x6200000, 0x200000, 0xca00000, 0x6000000, 0x6000000, 0x4400000, 0x400000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x200000, 0x6000000, 0x6200000, 0x4000000, 0x400000,
+ 0x200000, 0x7000000, 0xfa00000, 0x000000, 0x6400000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0xfa00000, 0x000000, 0x000000, 0x200000, 0x5000000, 0x1000000, 0x7400000, 0xfa00000,
+ 0x400000, 0x6200000, 0x7200000, 0x6000000, 0x1200000, 0xfa00000, 0x4400000, 0xca00000,
+ 0x6200000, 0x000000, 0x1000000, 0x200000, 0x4000000, 0x200000, 0xda00000, 0x6000000,
+ 0x400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0x400000, 0x400000,
+ 0x4000000, 0xfa00000, 0x6400000, 0x6400000, 0x7400000, 0x7200000, 0xfa00000, 0x6400000,
+ 0x200000, 0x1000000, 0x4200000, 0x4000000, 0x400000, 0x7200000, 0x000000, 0x5400000,
+ 0x7400000, 0x4400000, 0xfa00000, 0x6000000, 0x7000000, 0x5400000, 0x6200000, 0x400000,
+ 0x6000000, 0x6000000, 0x6200000, 0x4400000, 0x6400000, 0x7400000, 0xfa00000, 0x7400000,
+ 0x200000, 0x7400000, 0x4400000, 0x000000, 0x7200000, 0x6400000, 0xea00000, 0xfa00000,
+ 0xfa00000, 0x000000, 0x6200000, 0x000000, 0x000000, 0x000000, 0x4400000, 0xea00000,
+ 0x7000000, 0x400000, 0x6000000, 0x400000, 0x6000000, 0x4000000, 0x6000000, 0x7200000,
+ 0x6000000, 0x6000000, 0x6200000, 0x4000000, 0x6200000, 0x4400000, 0x6200000, 0x6000000,
+ 0x7200000, 0x4000000, 0x200000, 0xfa00000, 0x4000000, 0x6000000, 0xea00000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_7d[] = {
+ 0xea00000, 0x6000000, 0xea00000, 0x6400000, 0xea00000, 0xea00000, 0xea00000, 0xec00000,
+ 0xec00000, 0x6400000, 0xfa00000, 0xea00000, 0x6000000, 0xea00000, 0x6000000, 0x6400000,
+ 0xea00000, 0x6400000, 0x6400000, 0x6400000, 0xea00000, 0x6200000, 0x6400000, 0xea00000,
+ 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x6200000, 0x6400000, 0x6400000, 0x6000000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0x400000, 0x000000, 0x4000000, 0x400000, 0x1000000,
+ 0x6000000, 0x6000000, 0x400000, 0xfa00000, 0xea00000, 0x400000, 0xea00000, 0xfa00000,
+ 0xea00000, 0x6400000, 0x6200000, 0xea00000, 0x000000, 0xea00000, 0x6000000, 0x000000,
+ 0x6000000, 0xea00000, 0xea00000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6200000,
+ 0x6400000, 0x6400000, 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x6400000,
+ 0x400000, 0x000000, 0x6000000, 0x200000, 0x200000, 0x4400000, 0x6200000, 0x6200000,
+ 0xea00000, 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x6200000, 0x400000,
+ 0x6000000, 0x400000, 0x4400000, 0x6200000, 0x6400000, 0x4400000, 0xea00000, 0x6000000,
+ 0x000000, 0xea00000, 0xea00000, 0x6200000, 0x000000, 0x400000, 0xea00000, 0x6400000,
+ 0xea00000, 0x6000000, 0xec00000, 0x6000000, 0x000000, 0x6000000, 0xfa00000, 0x6000000,
+ 0x6400000, 0xea00000, 0xea00000, 0xea00000, 0x000000, 0x200000, 0x8a00000, 0x1000000,
+ 0x400000, 0xea00000, 0x6400000, 0x6400000, 0x6000000, 0x6200000, 0x000000, 0xec00000,
+ 0x6000000, 0x6400000, 0x400000, 0x6400000, 0x6000000, 0x6400000, 0x6400000, 0x000000,
+ 0x6400000, 0x4200000, 0x000000, 0x4400000, 0x6400000, 0x6400000, 0xe800000, 0xea00000,
+ 0x000000, 0x6400000, 0x6000000, 0xea00000, 0x6000000, 0x000000, 0x6400000, 0x4400000,
+ 0x000000, 0x200000, 0x200000, 0x200000, 0xea00000, 0x6400000, 0x6400000, 0x6200000,
+ 0xe800000, 0x6000000, 0xea00000, 0x6200000, 0x4000000, 0x000000, 0x7400000, 0x6400000,
+ 0x4000000, 0x6000000, 0x6400000, 0x4200000, 0xea00000, 0xea00000, 0x7200000, 0x6200000,
+ 0x6200000, 0xea00000, 0xea00000, 0x4400000, 0xea00000, 0xea00000, 0x400000, 0x6400000,
+ 0xea00000, 0x6400000, 0xea00000, 0xea00000, 0x6000000, 0xea00000, 0xea00000, 0xea00000,
+ 0x6000000, 0x6000000, 0x6400000, 0x400000, 0x6400000, 0x6400000, 0x6400000, 0xea00000,
+ 0x000000, 0x6000000, 0xea00000, 0xea00000, 0x6400000, 0x4400000, 0x6400000, 0x4200000,
+ 0x4000000, 0x200000, 0x6200000, 0x4000000, 0x4000000, 0x200000, 0x8800000, 0x6400000,
+ 0xea00000, 0x6400000, 0xea00000, 0x6000000, 0x4200000, 0xea00000, 0xea00000, 0x6000000,
+ 0xea00000, 0xea00000, 0x400000, 0xe800000, 0x4200000, 0x4400000, 0x6400000, 0x6000000,
+ 0xea00000, 0xea00000, 0x6400000, 0x400000, 0xea00000, 0x400000, 0x6000000, 0xea00000,
+ 0x6000000, 0x6400000, 0x6200000, 0x6000000, 0xea00000, 0x4400000, 0x6400000, 0x6000000,
+ 0x000000, 0x6400000, 0x6400000, 0xea00000, 0x000000, 0x4000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_7e[] = {
+ 0x400000, 0x200000, 0x000000, 0x6000000, 0x200000, 0x200000, 0x000000, 0x4000000,
+ 0x6400000, 0xea00000, 0xea00000, 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6400000, 0x6200000, 0x6000000, 0x6000000, 0xec00000, 0x6000000, 0x6400000,
+ 0x000000, 0x000000, 0x6000000, 0xea00000, 0x6400000, 0xec00000, 0xea00000, 0xea00000,
+ 0x6400000, 0xea00000, 0x6200000, 0xea00000, 0x6000000, 0x6000000, 0x200000, 0x4400000,
+ 0x400000, 0x6000000, 0x6000000, 0xea00000, 0x400000, 0x6400000, 0xea00000, 0xec00000,
+ 0x6000000, 0xea00000, 0x6200000, 0x6400000, 0x6000000, 0x6200000, 0x6400000, 0xea00000,
+ 0x6000000, 0x6200000, 0x6200000, 0x7200000, 0x6000000, 0xea00000, 0xea00000, 0x6400000,
+ 0x6000000, 0xfa00000, 0x6000000, 0xea00000, 0x6400000, 0x6400000, 0xea00000, 0xfc00000,
+ 0x6000000, 0x6000000, 0x200000, 0x200000, 0x6000000, 0x200000, 0x400000, 0x000000,
+ 0x6400000, 0x6000000, 0xec00000, 0x6000000, 0xea00000, 0xea00000, 0x6200000, 0x6000000,
+ 0x6400000, 0x6200000, 0x6200000, 0x4000000, 0x6000000, 0x200000, 0xea00000, 0x6400000,
+ 0x6000000, 0xec00000, 0x6400000, 0x6000000, 0x000000, 0x4400000, 0x200000, 0x4200000,
+ 0x6000000, 0xea00000, 0xea00000, 0xec00000, 0x4000000, 0xea00000, 0x4400000, 0x6400000,
+ 0xea00000, 0x000000, 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6400000, 0xea00000, 0x6000000, 0x6200000, 0xea00000, 0x6200000, 0x6400000, 0x4200000,
+ 0x6000000, 0x6400000, 0xfa00000, 0x200000, 0x000000, 0x000000, 0x6400000, 0x4400000,
+ 0x6200000, 0x200000, 0x6400000, 0x6000000, 0xea00000, 0x6400000, 0x4200000, 0xea00000,
+ 0x200000, 0x6400000, 0x4200000, 0xea00000, 0x6200000, 0x6400000, 0xea00000, 0x6000000,
+ 0xec00000, 0x6000000, 0x6400000, 0xfa00000, 0xea00000, 0x400000, 0x400000, 0x5000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x5000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000
+};
+
+static const unsigned long unicode_backtrans_7f[] = {
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0xfa00000, 0x4000000,
+ 0xfa00000, 0x6000000, 0xfa00000, 0x400000, 0x400000, 0x6400000, 0x6400000, 0x6400000,
+ 0x4000000, 0x4000000, 0x1000000, 0x6400000, 0x7400000, 0x7200000, 0x000000, 0x4400000,
+ 0x6000000, 0x4000000, 0x6000000, 0x6000000, 0xea00000, 0x6200000, 0x4200000, 0x6400000,
+ 0xfa00000, 0x7200000, 0x4400000, 0x4400000, 0xfa00000, 0xfa00000, 0x000000, 0x1000000,
+ 0x7200000, 0x000000, 0x1000000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x7200000,
+ 0x6200000, 0x7400000, 0x1000000, 0x6400000, 0x400000, 0x6400000, 0x6400000, 0x6200000,
+ 0x7200000, 0x7200000, 0xfa00000, 0xea00000, 0x6000000, 0x6400000, 0xfa00000, 0x000000,
+ 0xea00000, 0x5400000, 0xfa00000, 0x6000000, 0x1000000, 0xea00000, 0x6000000, 0xea00000,
+ 0x4200000, 0xfa00000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x7400000, 0x6400000,
+ 0x400000, 0x1000000, 0x200000, 0x6200000, 0x000000, 0xea00000, 0x6200000, 0x6200000,
+ 0xea00000, 0x6000000, 0xfa00000, 0x6400000, 0xfa00000, 0x6400000, 0xfa00000, 0x4400000,
+ 0x400000, 0x6400000, 0x6000000, 0x4000000, 0xfa00000, 0x6000000, 0x6400000, 0x4400000,
+ 0x000000, 0x000000, 0xfa00000, 0x6000000, 0x6400000, 0x7200000, 0xfa00000, 0x1000000,
+ 0x6000000, 0x7400000, 0x6400000, 0x4200000, 0xfa00000, 0x6000000, 0x6400000, 0x7000000,
+ 0xea00000, 0xea00000, 0x400000, 0x000000, 0x6000000, 0x6400000, 0x4200000, 0x7200000,
+ 0x7000000, 0x6000000, 0xfa00000, 0x6000000, 0x4400000, 0x6000000, 0x6200000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0x7400000, 0xfa00000, 0x6000000, 0x7400000,
+ 0x6400000, 0xfa00000, 0x6000000, 0x6400000, 0x000000, 0xfa00000, 0x200000, 0x6000000,
+ 0x400000, 0x6000000, 0xfa00000, 0x6000000, 0xfa00000, 0x6000000, 0xfc00000, 0x6400000,
+ 0x6000000, 0x6000000, 0xea00000, 0x000000, 0xfa00000, 0xfa00000, 0x000000, 0x6000000,
+ 0x1000000, 0x000000, 0x000000, 0x6400000, 0x6000000, 0x4000000, 0x6000000, 0xfc00000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x6400000, 0x000000, 0x7400000, 0x7200000, 0x4000000,
+ 0x6400000, 0xfa00000, 0x6000000, 0xea00000, 0x6400000, 0x6000000, 0x7400000, 0x6400000,
+ 0xfa00000, 0x7000000, 0x6400000, 0x7200000, 0x6000000, 0x6000000, 0x000000, 0x6000000,
+ 0x6000000, 0xea00000, 0x4400000, 0x7200000, 0xfa00000, 0x6400000, 0x6400000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_80[] = {
+ 0xfa00000, 0xfa00000, 0x4000000, 0xfa00000, 0x7200000, 0xfa00000, 0xfa00000, 0x6400000,
+ 0x4400000, 0x8800000, 0x400000, 0x7200000, 0xfa00000, 0x7400000, 0x6400000, 0x6400000,
+ 0xfa00000, 0x6400000, 0x7200000, 0x400000, 0x7400000, 0xfa00000, 0x7400000, 0xfa00000,
+ 0xfa00000, 0x7200000, 0x000000, 0x6000000, 0x7200000, 0x4400000, 0x6400000, 0x6400000,
+ 0x5400000, 0x6200000, 0x1000000, 0x000000, 0x6400000, 0x5000000, 0x7400000, 0x1000000,
+ 0x7200000, 0x7000000, 0x7000000, 0x000000, 0x6400000, 0x8800000, 0x4400000, 0x4000000,
+ 0x6400000, 0x5000000, 0x000000, 0xfa00000, 0x6400000, 0x7400000, 0xfa00000, 0x7400000,
+ 0x1000000, 0x6400000, 0x400000, 0x5200000, 0x4400000, 0xfa00000, 0x6400000, 0xfa00000,
+ 0x400000, 0x000000, 0x1000000, 0xf800000, 0x400000, 0x000000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x000000, 0xfa00000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x7200000, 0x000000, 0x5000000, 0x000000, 0xea00000, 0x000000,
+ 0xfa00000, 0x000000, 0xfa00000, 0x4000000, 0x6000000, 0x6000000, 0xea00000, 0x200000,
+ 0x400000, 0x4200000, 0x4200000, 0x4000000, 0x6400000, 0x000000, 0x4400000, 0x6000000,
+ 0x200000, 0x1000000, 0x1000000, 0x000000, 0x6000000, 0x400000, 0x000000, 0xea00000,
+ 0xea00000, 0x7400000, 0xea00000, 0xea00000, 0x200000, 0x6400000, 0x6200000, 0xea00000,
+ 0x6000000, 0x6200000, 0x000000, 0x000000, 0x000000, 0xea00000, 0xea00000, 0xfa00000,
+ 0x5000000, 0x400000, 0x6000000, 0x1000000, 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x6000000, 0xfa00000, 0xfa00000, 0x000000, 0x400000, 0x6000000,
+ 0x6000000, 0x000000, 0x6000000, 0x7200000, 0x000000, 0x6000000, 0xfa00000, 0x000000,
+ 0x7200000, 0x6000000, 0x7200000, 0xfa00000, 0x7400000, 0xfa00000, 0x400000, 0x5000000,
+ 0x1000000, 0xfa00000, 0xfa00000, 0x6000000, 0x1000000, 0xfa00000, 0x400000, 0x4400000,
+ 0x000000, 0xfa00000, 0xfa00000, 0x7400000, 0x200000, 0x7200000, 0x7000000, 0xfa00000,
+ 0x000000, 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0x6000000, 0x4000000, 0x5000000,
+ 0x6400000, 0x400000, 0xfa00000, 0x000000, 0x5000000, 0x5000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x7000000, 0xfa00000, 0xfa00000, 0x6000000, 0x5200000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6000000, 0x000000, 0xfa00000, 0x7400000, 0xfa00000, 0x6400000,
+ 0x6000000, 0x6000000, 0x400000, 0x000000, 0x6400000, 0x6400000, 0x7200000, 0x7400000,
+ 0x6400000, 0x7200000, 0xfa00000, 0xfa00000, 0x7000000, 0x7200000, 0xfa00000, 0x000000,
+ 0x6400000, 0xfa00000, 0x000000, 0x6000000, 0xfa00000, 0xfa00000, 0x6000000, 0x1000000,
+ 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x5000000, 0x7400000, 0x400000, 0x7200000,
+ 0x7400000, 0xfa00000, 0x7400000, 0x7400000, 0xfa00000, 0x6000000, 0x5400000, 0x000000,
+ 0xfa00000, 0x6400000, 0x7400000, 0x6000000, 0x7200000, 0xfa00000, 0x6400000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_81[] = {
+ 0x6000000, 0x6000000, 0xfa00000, 0x4400000, 0x000000, 0xea00000, 0xfa00000, 0xca00000,
+ 0xea00000, 0x5200000, 0xfa00000, 0x400000, 0x4000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x5000000, 0x1000000, 0x5000000, 0x6000000, 0x7400000, 0x4400000,
+ 0xfc00000, 0x6000000, 0xda00000, 0xea00000, 0x400000, 0x6000000, 0x7400000, 0x6000000,
+ 0x400000, 0x6000000, 0x6000000, 0xea00000, 0x6400000, 0x6000000, 0x000000, 0x6400000,
+ 0x000000, 0xea00000, 0x4000000, 0xe800000, 0x7400000, 0x6000000, 0x000000, 0xfa00000,
+ 0x6400000, 0x1200000, 0x5000000, 0x200000, 0x4000000, 0x400000, 0x1000000, 0x4000000,
+ 0x1000000, 0xea00000, 0x6400000, 0x000000, 0x400000, 0x6000000, 0xfa00000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x6000000, 0x6000000, 0x400000, 0x7200000, 0x6400000,
+ 0x5000000, 0x000000, 0x7400000, 0xfa00000, 0x7400000, 0x6000000, 0xea00000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0x7200000, 0xfa00000, 0xfa00000, 0x4000000, 0x400000,
+ 0x000000, 0x5000000, 0x5000000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x200000,
+ 0x7400000, 0x6400000, 0x6000000, 0x000000, 0x6000000, 0xfa00000, 0xea00000, 0x7400000,
+ 0x400000, 0x7400000, 0x000000, 0xea00000, 0x000000, 0x5400000, 0x7200000, 0x6400000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0x7200000, 0x000000, 0x6000000, 0x6400000,
+ 0xea00000, 0xfa00000, 0xfa00000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0xfa00000,
+ 0xfa00000, 0x400000, 0x7200000, 0x6200000, 0x4400000, 0x400000, 0x6400000, 0x6000000,
+ 0xfa00000, 0x6000000, 0xfa00000, 0x6400000, 0x6000000, 0x6000000, 0x400000, 0xfa00000,
+ 0x400000, 0x1000000, 0x000000, 0x4200000, 0x000000, 0x6200000, 0x400000, 0x6000000,
+ 0x7400000, 0x6000000, 0xea00000, 0x7400000, 0xfa00000, 0xfa00000, 0x6400000, 0x6000000,
+ 0xea00000, 0x000000, 0x6400000, 0xfa00000, 0x200000, 0x4000000, 0x7000000, 0x6000000,
+ 0xfa00000, 0x6200000, 0x5000000, 0x6000000, 0x6000000, 0x000000, 0x6400000, 0x000000,
+ 0x6200000, 0x6000000, 0x6400000, 0xfa00000, 0x6400000, 0xea00000, 0x4000000, 0x6000000,
+ 0x200000, 0x6000000, 0xfa00000, 0x7400000, 0x6000000, 0xea00000, 0xea00000, 0xea00000,
+ 0xfa00000, 0x5000000, 0xfa00000, 0x7400000, 0x6000000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x4200000, 0x6200000, 0x7400000, 0x400000, 0x7000000, 0xea00000, 0x400000, 0x6400000,
+ 0x6000000, 0x6200000, 0x6000000, 0x200000, 0x000000, 0x6400000, 0x000000, 0x6400000,
+ 0xea00000, 0x6200000, 0x6200000, 0x6400000, 0x000000, 0x6400000, 0x6400000, 0xea00000,
+ 0x6200000, 0x6400000, 0x6000000, 0xfa00000, 0x4400000, 0xea00000, 0x6000000, 0xfa00000,
+ 0xea00000, 0x6000000, 0xfa00000, 0x400000, 0x7400000, 0xfa00000, 0x6000000, 0x4000000,
+ 0x400000, 0x400000, 0x6400000, 0xfa00000, 0xfa00000, 0x400000, 0x4400000, 0x6000000,
+ 0x6400000, 0x6400000, 0xea00000, 0xfa00000, 0xfa00000, 0x400000, 0xfa00000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_82[] = {
+ 0x7400000, 0x7200000, 0x7200000, 0x400000, 0x7000000, 0xfa00000, 0x1000000, 0xea00000,
+ 0xea00000, 0x6200000, 0xea00000, 0x6000000, 0xfa00000, 0xfa00000, 0x200000, 0x400000,
+ 0x7200000, 0x6000000, 0xfa00000, 0x400000, 0x7400000, 0x6000000, 0x6200000, 0x200000,
+ 0x4200000, 0x400000, 0x4400000, 0xfa00000, 0xfa00000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0xfc00000, 0x7400000, 0x1000000, 0x000000, 0x6000000, 0x4000000, 0x000000,
+ 0x7400000, 0x4200000, 0xfa00000, 0xfa00000, 0xfa00000, 0x5000000, 0x200000, 0x7000000,
+ 0x1000000, 0x1000000, 0x6400000, 0x7200000, 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x7200000, 0xfa00000, 0x6400000, 0x1000000, 0x6000000, 0x6000000, 0x5000000, 0x6000000,
+ 0xea00000, 0x000000, 0x6000000, 0x400000, 0x7400000, 0xec00000, 0x400000, 0xfa00000,
+ 0x000000, 0x7000000, 0x000000, 0x7400000, 0x000000, 0x000000, 0x6400000, 0x7400000,
+ 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x4000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x7200000, 0xea00000, 0x7200000, 0x6000000, 0x6400000, 0x200000, 0x6000000, 0x7200000,
+ 0x400000, 0x6000000, 0x4200000, 0x6400000, 0xea00000, 0x4000000, 0xea00000, 0x400000,
+ 0x7200000, 0x6000000, 0x200000, 0x6200000, 0x6000000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0x1000000, 0xea00000, 0xfa00000, 0x1000000, 0x7400000, 0x6000000, 0xca00000, 0x6200000,
+ 0xea00000, 0x5000000, 0x5000000, 0x4400000, 0x6000000, 0x7400000, 0xfa00000, 0x7400000,
+ 0x6400000, 0x400000, 0x1000000, 0x6400000, 0x7400000, 0x6000000, 0x000000, 0x4400000,
+ 0x1000000, 0x400000, 0x7400000, 0xfa00000, 0x000000, 0xfa00000, 0xfc00000, 0x7000000,
+ 0x6000000, 0x7400000, 0xfa00000, 0x6000000, 0x6400000, 0x000000, 0x400000, 0x1000000,
+ 0x7400000, 0xfa00000, 0xec00000, 0x6400000, 0x1000000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0x6400000, 0x7400000, 0x6000000, 0x6400000, 0x7400000, 0xfa00000, 0xda00000, 0x6400000,
+ 0x7400000, 0xfc00000, 0x5400000, 0x7200000, 0xfa00000, 0xfa00000, 0xfc00000, 0xfa00000,
+ 0x7400000, 0xfa00000, 0x400000, 0xfa00000, 0x7400000, 0x6000000, 0x6000000, 0xfc00000,
+ 0xfa00000, 0xfa00000, 0x6400000, 0xea00000, 0xec00000, 0xfa00000, 0x7400000, 0xcc00000,
+ 0x6000000, 0x1000000, 0x6000000, 0x6000000, 0x5000000, 0x200000, 0x400000, 0x1000000,
+ 0x1000000, 0x000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x4400000, 0xfa00000, 0xfa00000, 0x7200000, 0xfa00000, 0xfc00000, 0x6000000, 0xfa00000,
+ 0x5000000, 0x6200000, 0x400000, 0xfa00000, 0x7200000, 0x000000, 0xfa00000, 0xfa00000,
+ 0x7400000, 0xfa00000, 0x4400000, 0x7200000, 0x7400000, 0xfa00000, 0xfa00000, 0xea00000,
+ 0x6400000, 0x000000, 0x6400000, 0x7200000, 0x6000000, 0x6400000, 0x4000000, 0x7400000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x6200000, 0x7200000, 0x6000000, 0x6400000, 0x5400000,
+ 0x4000000, 0x7200000, 0x6200000, 0x7200000, 0x4000000, 0xcc00000, 0xec00000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_83[] = {
+ 0x6400000, 0xfc00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7200000, 0x7400000,
+ 0x7400000, 0xfa00000, 0x400000, 0x4400000, 0x7000000, 0x6000000, 0x1200000, 0x1000000,
+ 0x000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x6200000, 0xfa00000,
+ 0x4200000, 0x6000000, 0x5000000, 0x7400000, 0x7200000, 0x4400000, 0x6400000, 0x400000,
+ 0x6000000, 0x400000, 0x6400000, 0x200000, 0x6000000, 0x6000000, 0x6000000, 0x7000000,
+ 0xfa00000, 0x6000000, 0x6000000, 0xfa00000, 0x7400000, 0x7400000, 0x400000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x6200000, 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6400000,
+ 0xfa00000, 0xfa00000, 0x7400000, 0x6000000, 0x7400000, 0x4400000, 0x000000, 0x6000000,
+ 0xfa00000, 0x6000000, 0x6400000, 0x7400000, 0x6400000, 0x6200000, 0x1000000, 0xfc00000,
+ 0x6000000, 0xfa00000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0xfa00000,
+ 0x7200000, 0xfc00000, 0xfa00000, 0x6400000, 0x7400000, 0x400000, 0x6400000, 0x4400000,
+ 0x200000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x4000000, 0x5000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x400000, 0x000000, 0x000000, 0xea00000, 0x6000000, 0x6200000, 0x6000000, 0xfa00000,
+ 0x7400000, 0x000000, 0x6000000, 0xfa00000, 0x7200000, 0x7400000, 0x6000000, 0x6400000,
+ 0x400000, 0x6000000, 0x400000, 0x6000000, 0x400000, 0x5200000, 0x7400000, 0x6200000,
+ 0x6000000, 0xfa00000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x4000000, 0x7400000, 0x7200000, 0x6400000, 0x6400000, 0xea00000, 0x6000000,
+ 0xfc00000, 0x6400000, 0x6200000, 0x7400000, 0x5400000, 0x6400000, 0xfa00000, 0x200000,
+ 0x7200000, 0x000000, 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000,
+ 0x7200000, 0xfc00000, 0xfa00000, 0xfa00000, 0x4400000, 0x400000, 0x6000000, 0x6000000,
+ 0x7000000, 0x1200000, 0x1000000, 0x1000000, 0x1000000, 0x200000, 0x1000000, 0x1000000,
+ 0x1000000, 0x5000000, 0x1000000, 0x000000, 0x1000000, 0xfa00000, 0x4400000, 0x6400000,
+ 0x7400000, 0xfa00000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000,
+ 0x6000000, 0xec00000, 0xfa00000, 0x6000000, 0xfa00000, 0x4000000, 0x6200000, 0x7400000,
+ 0x400000, 0x6400000, 0x000000, 0xca00000, 0x7400000, 0x6000000, 0xfa00000, 0x6000000,
+ 0x7200000, 0x6000000, 0x000000, 0x6000000, 0xfa00000, 0x7400000, 0x6000000, 0x7200000,
+ 0x7200000, 0x7000000, 0x6000000, 0x6000000, 0x6000000, 0x7000000, 0x000000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x7400000, 0xea00000, 0x6000000, 0x4000000, 0x6000000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0xea00000, 0x6000000, 0x6400000, 0x200000,
+ 0x7400000, 0xfc00000, 0x6000000, 0x6200000, 0x6400000, 0xfa00000, 0x6000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_84[] = {
+ 0x000000, 0x7400000, 0x000000, 0xfa00000, 0xfa00000, 0x4000000, 0x7400000, 0x6200000,
+ 0x000000, 0x6000000, 0xec00000, 0x7200000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7400000,
+ 0x6000000, 0x7400000, 0x6000000, 0x6200000, 0x4000000, 0x400000, 0x4000000, 0x000000,
+ 0x5000000, 0x400000, 0x000000, 0x6000000, 0x5000000, 0x1000000, 0x000000, 0x000000,
+ 0x4200000, 0x4000000, 0x200000, 0x6000000, 0x5000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0xea00000, 0x200000, 0x6000000, 0xea00000, 0x6000000, 0x4000000, 0x6400000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0x6000000, 0x6200000, 0x6000000, 0x6000000,
+ 0xfa00000, 0x6400000, 0x6000000, 0x6000000, 0x7200000, 0xfa00000, 0x4000000, 0x6000000,
+ 0x6000000, 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x7200000, 0x6400000,
+ 0x4400000, 0xea00000, 0x4400000, 0x6000000, 0x6000000, 0x6400000, 0x6200000, 0x400000,
+ 0x6000000, 0x7400000, 0x6400000, 0x4000000, 0x6000000, 0x4000000, 0x6400000, 0xfa00000,
+ 0x4400000, 0x7400000, 0x7400000, 0xfa00000, 0x5400000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6400000, 0xfa00000, 0x4200000, 0xfa00000, 0x4400000, 0x6400000, 0xea00000, 0x6400000,
+ 0x6000000, 0x7200000, 0x400000, 0xfa00000, 0xfa00000, 0x7200000, 0x6200000, 0xea00000,
+ 0x6400000, 0x5200000, 0x4000000, 0x7400000, 0x6400000, 0xfa00000, 0x7400000, 0x6200000,
+ 0x7400000, 0x6200000, 0xfa00000, 0x000000, 0x400000, 0x6400000, 0x6000000, 0x4000000,
+ 0x4000000, 0x400000, 0x7200000, 0x000000, 0x200000, 0x400000, 0x6000000, 0x1000000,
+ 0x5000000, 0x1000000, 0x000000, 0x1200000, 0x1000000, 0x6000000, 0x7000000, 0x6000000,
+ 0xea00000, 0x6000000, 0x4400000, 0x4400000, 0xea00000, 0x400000, 0x4000000, 0x7000000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x6000000, 0xfa00000, 0x6000000, 0x6400000, 0x6200000,
+ 0x6000000, 0xfa00000, 0x6000000, 0x4000000, 0x6000000, 0x000000, 0x400000, 0x6000000,
+ 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x4200000, 0x6000000, 0x7400000,
+ 0x6000000, 0x6400000, 0xfa00000, 0x000000, 0x7400000, 0x000000, 0x6000000, 0x000000,
+ 0xfa00000, 0x7200000, 0x7400000, 0xea00000, 0xea00000, 0x5400000, 0x4400000, 0xfa00000,
+ 0xec00000, 0x7200000, 0xec00000, 0x000000, 0xfa00000, 0x6000000, 0xea00000, 0x6400000,
+ 0x400000, 0xfa00000, 0x7200000, 0xea00000, 0x6400000, 0xfa00000, 0x6000000, 0x6400000,
+ 0x7200000, 0xfa00000, 0x6000000, 0x7400000, 0x6000000, 0x000000, 0x7200000, 0x6000000,
+ 0x000000, 0x200000, 0xca00000, 0x6000000, 0x400000, 0x1000000, 0x4000000, 0x1000000,
+ 0x1000000, 0x4000000, 0x4000000, 0x1000000, 0x4000000, 0x5000000, 0x1000000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0xfa00000, 0x000000, 0xea00000, 0x6400000,
+ 0x7400000, 0x6400000, 0x6400000, 0x6000000, 0xea00000, 0x000000, 0x6000000, 0x6400000,
+ 0x4000000, 0x6000000, 0x6400000, 0x6400000, 0xfa00000, 0x6400000, 0x6000000, 0x7200000
+};
+
+static const unsigned long unicode_backtrans_85[] = {
+ 0x6200000, 0x000000, 0x6400000, 0x4400000, 0x000000, 0x4000000, 0x6200000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x6400000, 0x6000000,
+ 0x4400000, 0xfa00000, 0x6000000, 0xfa00000, 0xea00000, 0x6200000, 0x6000000, 0xfa00000,
+ 0xea00000, 0x6000000, 0xfa00000, 0x000000, 0x6400000, 0x6000000, 0xec00000, 0x7200000,
+ 0x6000000, 0xfa00000, 0x400000, 0xec00000, 0x6400000, 0xec00000, 0x6200000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x7400000, 0xfa00000, 0xea00000, 0x6000000, 0xec00000,
+ 0x6000000, 0x6000000, 0x400000, 0x4400000, 0x4400000, 0x200000, 0x400000, 0x1000000,
+ 0x5000000, 0x1000000, 0x1000000, 0x7000000, 0x1000000, 0xfa00000, 0x6000000, 0x8c00000,
+ 0x6200000, 0xea00000, 0x4000000, 0xfa00000, 0x6000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x7200000, 0xfa00000, 0x7200000, 0x4200000, 0x4000000, 0x6000000, 0xea00000, 0x400000,
+ 0x400000, 0x6400000, 0x4400000, 0xec00000, 0x6000000, 0x6200000, 0x7400000, 0x6200000,
+ 0x6200000, 0xfc00000, 0x4200000, 0x6000000, 0x400000, 0x6400000, 0x7400000, 0x4400000,
+ 0x6400000, 0x6400000, 0x6400000, 0xea00000, 0x7400000, 0x6000000, 0x6000000, 0x6000000,
+ 0xfa00000, 0xea00000, 0xea00000, 0x6400000, 0x6000000, 0xea00000, 0x6000000, 0x4400000,
+ 0x4000000, 0x6000000, 0x1000000, 0x4000000, 0x1000000, 0x6000000, 0x6000000, 0x6200000,
+ 0x6000000, 0x7400000, 0x7400000, 0x7400000, 0x6000000, 0x400000, 0x7200000, 0x400000,
+ 0x6200000, 0x6400000, 0x6000000, 0x6000000, 0xfa00000, 0x7400000, 0x6400000, 0xfa00000,
+ 0x6200000, 0x6400000, 0x6200000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0xfc00000,
+ 0x6200000, 0xea00000, 0x000000, 0x400000, 0xea00000, 0x6000000, 0x6000000, 0x4200000,
+ 0x6400000, 0x6200000, 0x6000000, 0xfa00000, 0x7200000, 0x6400000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x7200000, 0x400000, 0xea00000, 0x6400000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0x200000, 0x200000, 0x400000, 0x1200000, 0xfa00000,
+ 0xf800000, 0x6000000, 0x000000, 0x6000000, 0x6400000, 0x6000000, 0x6400000, 0x7400000,
+ 0x6400000, 0x7200000, 0xea00000, 0x000000, 0x400000, 0x6400000, 0x6400000, 0x6400000,
+ 0x6000000, 0xda00000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000,
+ 0x6000000, 0xfa00000, 0x400000, 0x6400000, 0x000000, 0xea00000, 0xec00000, 0xfa00000,
+ 0x7200000, 0x6000000, 0x6000000, 0x1000000, 0x000000, 0xfa00000, 0x4000000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x000000, 0xfa00000, 0xea00000, 0x6000000, 0x6400000,
+ 0x4400000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0xea00000, 0x6400000, 0x000000,
+ 0x6400000, 0xfa00000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x4000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x400000, 0x000000, 0x000000, 0x6400000, 0xea00000,
+ 0x6000000, 0x6200000, 0xea00000, 0xfa00000, 0x4400000, 0x6000000, 0x6200000, 0xfc00000
+};
+
+static const unsigned long unicode_backtrans_86[] = {
+ 0x6400000, 0x6000000, 0xca00000, 0x000000, 0x6400000, 0x7400000, 0xea00000, 0xea00000,
+ 0x000000, 0x6000000, 0xea00000, 0x6200000, 0x6000000, 0x4400000, 0x400000, 0x4000000,
+ 0x4400000, 0x7400000, 0x400000, 0x200000, 0x4000000, 0x000000, 0xda00000, 0xea00000,
+ 0x6400000, 0x6400000, 0xea00000, 0x6400000, 0x6000000, 0x000000, 0x6400000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x7400000,
+ 0x4000000, 0x7400000, 0x6000000, 0x000000, 0x6000000, 0xea00000, 0x6000000, 0x4200000,
+ 0x200000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x000000,
+ 0x7400000, 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x400000, 0x6000000, 0xea00000,
+ 0x6400000, 0x400000, 0x4400000, 0x6000000, 0x000000, 0x4000000, 0x6400000, 0x6000000,
+ 0x6000000, 0x000000, 0x000000, 0x6000000, 0x6000000, 0x7200000, 0xfa00000, 0x1000000,
+ 0xfa00000, 0x1000000, 0x6400000, 0x6400000, 0xfa00000, 0xea00000, 0x6400000, 0x400000,
+ 0x400000, 0x6400000, 0x1200000, 0xe800000, 0xea00000, 0x400000, 0xfa00000, 0xea00000,
+ 0x400000, 0x6400000, 0x7400000, 0x6400000, 0x6400000, 0x6000000, 0x000000, 0xea00000,
+ 0x6000000, 0x6400000, 0x6000000, 0x7200000, 0x5400000, 0x6000000, 0x7000000, 0x6400000,
+ 0x6000000, 0x7200000, 0x4000000, 0x6000000, 0x6000000, 0x400000, 0x400000, 0x6400000,
+ 0x000000, 0xfa00000, 0x7400000, 0x7200000, 0x7000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x400000, 0x000000, 0xfa00000, 0x7200000, 0xfa00000, 0x7400000, 0x6000000, 0x000000,
+ 0x6000000, 0x6400000, 0x4000000, 0xfa00000, 0x6000000, 0x7200000, 0x6400000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x000000, 0x7400000, 0x7000000, 0x6000000, 0x000000,
+ 0x4000000, 0x6400000, 0x6000000, 0xfa00000, 0xfa00000, 0x6000000, 0x400000, 0x7400000,
+ 0x7400000, 0xfa00000, 0x7200000, 0x200000, 0x1000000, 0x4400000, 0x000000, 0x7200000,
+ 0x7200000, 0x7400000, 0x4000000, 0x6400000, 0x7400000, 0x7400000, 0x7200000, 0x6400000,
+ 0x6400000, 0x6400000, 0x7000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000,
+ 0x7400000, 0x6400000, 0x6000000, 0x6400000, 0x7200000, 0x6400000, 0x7200000, 0xfa00000,
+ 0x6000000, 0x7200000, 0x1000000, 0xfa00000, 0x6000000, 0x200000, 0x1200000, 0x1000000,
+ 0x7000000, 0x7400000, 0x400000, 0x6000000, 0xfa00000, 0x400000, 0x6000000, 0x6400000,
+ 0x7000000, 0xfa00000, 0x6400000, 0xfa00000, 0x6400000, 0x6000000, 0x7200000, 0xfa00000,
+ 0x400000, 0x000000, 0x6000000, 0x6400000, 0xfa00000, 0x400000, 0x6000000, 0x400000,
+ 0x6000000, 0x7200000, 0x6000000, 0x6000000, 0x6200000, 0xfa00000, 0x1200000, 0x4200000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x7200000, 0x7200000, 0x6400000, 0x6200000, 0x400000, 0x400000, 0xfa00000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_87[] = {
+ 0xfa00000, 0x6000000, 0xfa00000, 0xfa00000, 0x6400000, 0x6400000, 0x6200000, 0x7400000,
+ 0xfa00000, 0x7200000, 0x7200000, 0x6400000, 0x6000000, 0x7200000, 0x6400000, 0x400000,
+ 0x400000, 0x6200000, 0x7200000, 0x7400000, 0x400000, 0x1000000, 0x000000, 0x1000000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x6000000, 0xfa00000, 0x000000, 0x7400000, 0x400000,
+ 0x6000000, 0x7400000, 0x7000000, 0x7400000, 0x6000000, 0x7200000, 0x6000000, 0x6000000,
+ 0x6400000, 0x7200000, 0x6000000, 0x000000, 0x6000000, 0x6000000, 0x7400000, 0x400000,
+ 0x6000000, 0x7400000, 0x6400000, 0x6000000, 0x7200000, 0x6000000, 0x000000, 0x7200000,
+ 0x6000000, 0x400000, 0x6400000, 0x7200000, 0x6400000, 0x400000, 0x7400000, 0x7200000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0x000000, 0x400000, 0x6000000, 0x1000000,
+ 0x1000000, 0x1200000, 0x000000, 0x200000, 0x7200000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x7200000, 0x6000000, 0xea00000, 0x6000000, 0xfa00000,
+ 0x6400000, 0x7200000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0xea00000,
+ 0x7200000, 0x6400000, 0x6000000, 0x7200000, 0x7400000, 0x7400000, 0xea00000, 0x6000000,
+ 0xea00000, 0x6000000, 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0x7200000, 0x6400000,
+ 0x5000000, 0x4400000, 0x400000, 0x6000000, 0xfa00000, 0x6000000, 0xfa00000, 0x6000000,
+ 0xea00000, 0x6000000, 0x6000000, 0x7400000, 0x1000000, 0x5000000, 0x1000000, 0x200000,
+ 0x000000, 0x6000000, 0xfa00000, 0x7400000, 0x6400000, 0x7400000, 0x4400000, 0x6400000,
+ 0x7400000, 0x6400000, 0x000000, 0x5400000, 0x4400000, 0xfa00000, 0x000000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x400000, 0x6000000, 0x7400000,
+ 0x6400000, 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0xfa00000,
+ 0x400000, 0x000000, 0xea00000, 0x6400000, 0x6000000, 0x4000000, 0x000000, 0x400000,
+ 0x1000000, 0x4000000, 0x6000000, 0x7200000, 0x7400000, 0x7400000, 0x6400000, 0x7200000,
+ 0x6000000, 0x4400000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6000000, 0xfa00000, 0x6200000, 0x6000000, 0x7200000, 0x6400000, 0x6400000,
+ 0x7200000, 0x4400000, 0x6000000, 0x6000000, 0xea00000, 0x6000000, 0x7200000, 0x200000,
+ 0x6400000, 0x6400000, 0x7400000, 0x7200000, 0x6000000, 0x000000, 0x4400000, 0x000000,
+ 0x200000, 0x7000000, 0x7200000, 0x7000000, 0x6000000, 0x400000, 0x4400000, 0x6000000,
+ 0x6000000, 0x6400000, 0x4400000, 0x7000000, 0x6400000, 0x6000000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x7000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x000000, 0x7400000, 0x6400000, 0xe800000, 0x6400000, 0x5000000, 0xea00000,
+ 0x000000, 0x400000, 0xea00000, 0x6400000, 0x6000000, 0x4000000, 0x6200000, 0x6200000,
+ 0x400000, 0xfa00000, 0x6400000, 0xea00000, 0x6000000, 0x000000, 0xfa00000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_88[] = {
+ 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x4000000, 0xea00000, 0x6400000, 0x000000,
+ 0x6000000, 0x6400000, 0x7400000, 0x6400000, 0x6000000, 0x6200000, 0x200000, 0x4200000,
+ 0x6400000, 0x6200000, 0x400000, 0x7400000, 0x6400000, 0x7200000, 0x7200000, 0x6000000,
+ 0x4400000, 0x6400000, 0x400000, 0x7400000, 0x6400000, 0x6000000, 0x400000, 0xec00000,
+ 0x6000000, 0x7200000, 0xfa00000, 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x4200000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x4400000, 0x6400000, 0x6000000,
+ 0x6400000, 0xea00000, 0x7400000, 0x6000000, 0x000000, 0x6400000, 0xea00000, 0x6000000,
+ 0x6000000, 0x7200000, 0x400000, 0xea00000, 0x7400000, 0x6000000, 0x6000000, 0x6000000,
+ 0xfa00000, 0x6400000, 0x4200000, 0x6400000, 0x7200000, 0x5400000, 0xca00000, 0x000000,
+ 0x6400000, 0x400000, 0x6400000, 0x6400000, 0xfa00000, 0xfa00000, 0x6400000, 0x4000000,
+ 0x000000, 0x400000, 0xea00000, 0xea00000, 0x1000000, 0x6400000, 0x6400000, 0xfa00000,
+ 0x400000, 0xfa00000, 0x6400000, 0xea00000, 0x400000, 0xea00000, 0x4200000, 0x400000,
+ 0x4400000, 0xfa00000, 0xfa00000, 0xfa00000, 0x5400000, 0x5000000, 0x000000, 0x6000000,
+ 0xfa00000, 0x7400000, 0x6000000, 0xfa00000, 0x1000000, 0x6000000, 0x5000000, 0x6000000,
+ 0xfa00000, 0x6400000, 0xfa00000, 0x000000, 0x6000000, 0x6200000, 0x6000000, 0xfa00000,
+ 0x000000, 0x6400000, 0x000000, 0x400000, 0x6000000, 0x7200000, 0xfa00000, 0xfa00000,
+ 0x6400000, 0xfa00000, 0xfa00000, 0x6000000, 0x5000000, 0x1000000, 0x000000, 0x4000000,
+ 0xfa00000, 0x6000000, 0x000000, 0xfa00000, 0x6000000, 0xfa00000, 0x6000000, 0x4000000,
+ 0x4000000, 0x6000000, 0xfa00000, 0x6000000, 0x000000, 0x6000000, 0xfa00000, 0xea00000,
+ 0x6400000, 0x6200000, 0x6400000, 0x6400000, 0x5400000, 0x000000, 0xea00000, 0x6400000,
+ 0x4400000, 0x6000000, 0x7200000, 0x000000, 0x7200000, 0x000000, 0x000000, 0x6000000,
+ 0x6400000, 0x000000, 0x6400000, 0xfa00000, 0x6000000, 0x1000000, 0x4200000, 0x000000,
+ 0x200000, 0x7200000, 0x6000000, 0x000000, 0xca00000, 0x4200000, 0x6000000, 0x7200000,
+ 0x6000000, 0x6000000, 0x6400000, 0x000000, 0x7000000, 0x6400000, 0x6400000, 0x4200000,
+ 0x6400000, 0xfa00000, 0xfa00000, 0x200000, 0x200000, 0x5200000, 0x1000000, 0x4000000,
+ 0x000000, 0x7000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x7400000, 0xca00000,
+ 0x6000000, 0x400000, 0x7400000, 0x400000, 0xfa00000, 0xfa00000, 0x6000000, 0x6000000,
+ 0x7200000, 0xfa00000, 0x6000000, 0x6400000, 0xea00000, 0xea00000, 0x6400000, 0xfa00000,
+ 0x000000, 0xea00000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x4000000, 0x6400000,
+ 0xfa00000, 0x000000, 0x000000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x6400000,
+ 0x7400000, 0x7400000, 0x6200000, 0xfa00000, 0xfa00000, 0xcc00000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x7200000, 0x6000000, 0x6000000, 0x7200000, 0xea00000, 0x7200000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_89[] = {
+ 0x4000000, 0x6400000, 0x7200000, 0x000000, 0x200000, 0x6000000, 0x6400000, 0xea00000,
+ 0x000000, 0x6000000, 0x7200000, 0x6000000, 0x6200000, 0x400000, 0x6400000, 0x400000,
+ 0xfa00000, 0x6000000, 0xfa00000, 0xfa00000, 0x6000000, 0x6400000, 0x6400000, 0x6000000,
+ 0xec00000, 0xfc00000, 0x7400000, 0x1000000, 0x400000, 0x200000, 0x6200000, 0x6000000,
+ 0x400000, 0x7000000, 0x6000000, 0x6000000, 0x4000000, 0xfa00000, 0x6400000, 0x6400000,
+ 0x400000, 0x6000000, 0xfa00000, 0x7200000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x7400000, 0x6400000, 0x6400000, 0x6000000, 0x1000000, 0x6400000, 0xfa00000, 0x6000000,
+ 0xea00000, 0x400000, 0x400000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x000000,
+ 0x400000, 0xfa00000, 0x6400000, 0x4200000, 0xfa00000, 0x400000, 0x6400000, 0x4000000,
+ 0x000000, 0x6400000, 0x000000, 0x6000000, 0x6200000, 0x4200000, 0x000000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x4000000, 0x000000, 0x6200000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x7200000, 0xfa00000,
+ 0x6200000, 0x6400000, 0x6400000, 0x6400000, 0xea00000, 0x4000000, 0x7200000, 0x000000,
+ 0x000000, 0x6000000, 0xea00000, 0x6400000, 0x6000000, 0x6200000, 0x6400000, 0x6200000,
+ 0x400000, 0x6000000, 0xea00000, 0x6400000, 0x6200000, 0x400000, 0x6000000, 0x4200000,
+ 0x000000, 0x6000000, 0x6400000, 0x7400000, 0x6400000, 0x400000, 0x6200000, 0xfa00000,
+ 0x4000000, 0xfa00000, 0x6000000, 0xfa00000, 0x000000, 0x6000000, 0xfa00000, 0xca00000,
+ 0x6200000, 0x4400000, 0x4200000, 0xea00000, 0x000000, 0x400000, 0x000000, 0xea00000,
+ 0x400000, 0x4000000, 0x000000, 0xea00000, 0x4400000, 0x6400000, 0xea00000, 0x6200000,
+ 0x6200000, 0x000000, 0x200000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6400000,
+ 0x400000, 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x4400000, 0x6200000, 0x4200000,
+ 0x000000, 0xca00000, 0xea00000, 0x000000, 0x6200000, 0x6000000, 0x6000000, 0x6200000,
+ 0x400000, 0x000000, 0xea00000, 0x200000, 0x400000, 0x400000, 0x6400000, 0x6400000,
+ 0x000000, 0x6000000, 0xea00000, 0x000000, 0x4400000, 0xea00000, 0x6000000, 0x6200000,
+ 0xea00000, 0x5000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0xfa00000, 0x6000000, 0x6400000, 0x6400000, 0x7400000, 0x400000,
+ 0x400000, 0x6000000, 0x7200000, 0x6000000, 0x7200000, 0x6200000, 0x1000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000, 0x7200000, 0x4200000,
+ 0x6000000, 0x6400000, 0x000000, 0x7400000, 0x6000000, 0x6400000, 0x000000, 0x1000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0xea00000, 0x000000, 0x6400000, 0x6000000,
+ 0xea00000, 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x400000, 0x6000000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_8a[] = {
+ 0xfa00000, 0x000000, 0xea00000, 0xea00000, 0x6400000, 0x400000, 0x000000, 0x7400000,
+ 0xea00000, 0x000000, 0xea00000, 0x000000, 0xea00000, 0x000000, 0xea00000, 0x6400000,
+ 0x6200000, 0x6400000, 0x6400000, 0xea00000, 0x400000, 0x6400000, 0xea00000, 0xea00000,
+ 0xea00000, 0x000000, 0x000000, 0xea00000, 0x4000000, 0xea00000, 0x6400000, 0xea00000,
+ 0x400000, 0x000000, 0x6400000, 0xea00000, 0x400000, 0xea00000, 0x400000, 0x6000000,
+ 0x000000, 0x4000000, 0xea00000, 0x4400000, 0x6400000, 0xea00000, 0x000000, 0x400000,
+ 0x6000000, 0xea00000, 0x000000, 0x200000, 0xea00000, 0x400000, 0xea00000, 0x400000,
+ 0x4000000, 0x6000000, 0xea00000, 0xea00000, 0x6200000, 0x4400000, 0x7400000, 0x6000000,
+ 0x6400000, 0x6200000, 0x000000, 0x400000, 0x6000000, 0x6400000, 0x6200000, 0x400000,
+ 0x7200000, 0x4400000, 0x6000000, 0x000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000,
+ 0xea00000, 0x6200000, 0x6200000, 0x400000, 0xea00000, 0xea00000, 0x6400000, 0x6400000,
+ 0x6400000, 0x6000000, 0x000000, 0xea00000, 0x400000, 0x400000, 0xea00000, 0x000000,
+ 0xea00000, 0x6400000, 0xea00000, 0xea00000, 0x000000, 0x400000, 0xea00000, 0x4400000,
+ 0x6000000, 0xea00000, 0x000000, 0x6200000, 0x6200000, 0xea00000, 0xea00000, 0x000000,
+ 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x6000000, 0xec00000, 0x6400000, 0x6400000,
+ 0x000000, 0xfc00000, 0x6400000, 0x6400000, 0x6200000, 0x000000, 0x4400000, 0x6400000,
+ 0x400000, 0x6000000, 0x6200000, 0x6400000, 0x6200000, 0xea00000, 0x6400000, 0xea00000,
+ 0x000000, 0x1200000, 0x1000000, 0x6400000, 0xea00000, 0xea00000, 0x000000, 0x6400000,
+ 0x4400000, 0x6200000, 0x6400000, 0xfa00000, 0x4000000, 0xea00000, 0x6400000, 0x400000,
+ 0xea00000, 0x6400000, 0x6200000, 0x000000, 0x4000000, 0x000000, 0xea00000, 0x400000,
+ 0xea00000, 0xea00000, 0x000000, 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x6400000,
+ 0xea00000, 0x4400000, 0xe800000, 0x6000000, 0x200000, 0x200000, 0x400000, 0x4400000,
+ 0xea00000, 0x000000, 0xea00000, 0x400000, 0x4000000, 0x000000, 0x6400000, 0x400000,
+ 0x6000000, 0xea00000, 0x6000000, 0x6400000, 0xea00000, 0x6000000, 0xec00000, 0xea00000,
+ 0x6000000, 0x000000, 0xea00000, 0x6400000, 0xea00000, 0x6000000, 0x6400000, 0xea00000,
+ 0x6400000, 0x6400000, 0x400000, 0xea00000, 0x200000, 0xea00000, 0x000000, 0xea00000,
+ 0x000000, 0x6400000, 0xea00000, 0x6400000, 0x6400000, 0x6400000, 0xea00000, 0x6400000,
+ 0x6000000, 0x6000000, 0x4200000, 0xea00000, 0xea00000, 0x6400000, 0x6200000, 0x6400000,
+ 0x6200000, 0xea00000, 0x6200000, 0x000000, 0x6200000, 0x000000, 0xea00000, 0xea00000,
+ 0x6000000, 0x000000, 0xc800000, 0xea00000, 0x400000, 0xea00000, 0xea00000, 0x6000000,
+ 0x6400000, 0xea00000, 0x6000000, 0x6200000, 0x6400000, 0x6400000, 0xec00000, 0xea00000,
+ 0xea00000, 0x000000, 0xea00000, 0x6000000, 0x6400000, 0x000000, 0xea00000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_8b[] = {
+ 0xea00000, 0xea00000, 0xea00000, 0x000000, 0xea00000, 0x6400000, 0x6400000, 0x7200000,
+ 0x6000000, 0x000000, 0x6400000, 0x6400000, 0x4200000, 0x6000000, 0xea00000, 0x6000000,
+ 0xea00000, 0x6400000, 0x6000000, 0x6000000, 0xea00000, 0x6000000, 0xea00000, 0xea00000,
+ 0x6000000, 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0xea00000, 0x6400000, 0x4400000,
+ 0xea00000, 0x200000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x7200000, 0x6000000,
+ 0xea00000, 0x000000, 0x6000000, 0xea00000, 0xea00000, 0x4400000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6000000, 0x000000, 0xea00000, 0x000000, 0x6000000, 0x6000000, 0x6400000,
+ 0x000000, 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x6200000, 0x4000000,
+ 0x6000000, 0xea00000, 0x6400000, 0x4400000, 0x400000, 0x6400000, 0x6400000, 0x6000000,
+ 0x6400000, 0xea00000, 0x6000000, 0x6000000, 0x4200000, 0x4400000, 0xea00000, 0xea00000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x6200000, 0x6000000,
+ 0xea00000, 0x6400000, 0xea00000, 0x200000, 0xea00000, 0x6000000, 0x4400000, 0x6200000,
+ 0x6000000, 0x000000, 0x4000000, 0x6400000, 0x000000, 0x6000000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x4000000, 0x6000000, 0x6200000, 0xfa00000, 0x6400000, 0x000000, 0xea00000,
+ 0xea00000, 0x200000, 0x200000, 0x000000, 0xea00000, 0x000000, 0x400000, 0xea00000,
+ 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x400000, 0xea00000, 0x6400000, 0x6000000,
+ 0xea00000, 0x4400000, 0x6000000, 0x4200000, 0x6400000, 0x6400000, 0x6000000, 0x000000,
+ 0x6000000, 0x000000, 0xea00000, 0x6400000, 0x6200000, 0x400000, 0x6200000, 0x400000,
+ 0xca00000, 0x000000, 0xea00000, 0xea00000, 0x6400000, 0x6400000, 0xea00000, 0x000000,
+ 0x6000000, 0x6200000, 0xea00000, 0x4000000, 0x6400000, 0x000000, 0x6400000, 0x6400000,
+ 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000
+};
+
+static const unsigned long unicode_backtrans_8c[] = {
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0xfa00000,
+ 0x400000, 0x6400000, 0x200000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0xea00000,
+ 0x000000, 0xfa00000, 0x6000000, 0x6000000, 0x000000, 0x6400000, 0xfa00000, 0x7400000,
+ 0xea00000, 0x7400000, 0xea00000, 0x6400000, 0xfa00000, 0x6000000, 0x6200000, 0x6400000,
+ 0x6200000, 0x4400000, 0x000000, 0x400000, 0x6400000, 0xfa00000, 0x6000000, 0x6400000,
+ 0x400000, 0x400000, 0xfa00000, 0x400000, 0x6000000, 0x6400000, 0x000000, 0x6000000,
+ 0x000000, 0xfa00000, 0x7200000, 0x400000, 0x6400000, 0x6000000, 0x6400000, 0x000000,
+ 0x6400000, 0x6400000, 0xfa00000, 0xfa00000, 0x6200000, 0x6400000, 0x000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x7400000, 0x000000, 0x6400000, 0x6400000, 0x6000000,
+ 0x7200000, 0xfa00000, 0xfa00000, 0x6400000, 0x200000, 0x6000000, 0x400000, 0x000000,
+ 0x6000000, 0x6000000, 0xfa00000, 0x000000, 0x6000000, 0x7200000, 0x6400000, 0x400000,
+ 0x000000, 0x7200000, 0xfa00000, 0x400000, 0xfa00000, 0x6200000, 0x200000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x6400000, 0x7200000, 0x6000000, 0x000000, 0x6000000,
+ 0x7200000, 0x6400000, 0x6000000, 0x4400000, 0x6400000, 0xea00000, 0xea00000, 0x4000000,
+ 0xea00000, 0xea00000, 0xea00000, 0x6000000, 0x6400000, 0x6000000, 0x000000, 0xea00000,
+ 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x4200000, 0x200000, 0xea00000,
+ 0xea00000, 0x000000, 0x6200000, 0xea00000, 0xea00000, 0x6000000, 0xea00000, 0xea00000,
+ 0xea00000, 0x6400000, 0x6400000, 0xea00000, 0xea00000, 0xea00000, 0x6000000, 0xea00000,
+ 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0x400000, 0xea00000,
+ 0xea00000, 0x400000, 0xea00000, 0x400000, 0x6000000, 0x4200000, 0x200000, 0x6400000,
+ 0x000000, 0xea00000, 0x6000000, 0xea00000, 0x4000000, 0x6400000, 0x4400000, 0x6000000,
+ 0x000000, 0x6400000, 0xea00000, 0x4200000, 0xea00000, 0x6400000, 0xea00000, 0x6000000,
+ 0xea00000, 0x6400000, 0xea00000, 0xea00000, 0xea00000, 0x6000000, 0xea00000, 0x6000000,
+ 0x6400000, 0x4000000, 0xea00000, 0x4000000, 0x6400000, 0xea00000, 0x6000000, 0x400000,
+ 0x6400000, 0x6000000, 0x4400000, 0x6000000, 0xe800000, 0x6400000, 0x000000, 0x4400000,
+ 0x6400000, 0x6000000, 0x6200000, 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0x400000
+};
+
+static const unsigned long unicode_backtrans_8d[] = {
+ 0x6000000, 0x400000, 0x6000000, 0x4400000, 0xea00000, 0xea00000, 0x6000000, 0xea00000,
+ 0xea00000, 0x6400000, 0xea00000, 0x4200000, 0x4000000, 0xea00000, 0x000000, 0x6200000,
+ 0x6200000, 0x4000000, 0x4400000, 0xea00000, 0x6200000, 0x6000000, 0xea00000, 0x6400000,
+ 0x4000000, 0x6000000, 0x000000, 0x6400000, 0x4000000, 0x5000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0xfa00000, 0x400000, 0xfa00000, 0x7200000,
+ 0x6000000, 0x6400000, 0x000000, 0xfa00000, 0x6400000, 0x7200000, 0x6400000, 0x6000000,
+ 0xfa00000, 0x200000, 0x6000000, 0xfa00000, 0xfa00000, 0x1000000, 0x7000000, 0xfa00000,
+ 0x6000000, 0x6000000, 0x4000000, 0x6000000, 0x000000, 0x6000000, 0x000000, 0x400000,
+ 0x6000000, 0x7200000, 0x4400000, 0x000000, 0x7400000, 0xfa00000, 0x000000, 0x000000,
+ 0x400000, 0x6000000, 0xfa00000, 0x1000000, 0x6000000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6400000, 0x7400000, 0x6000000, 0x6000000, 0x7000000, 0x6400000, 0x6000000, 0x000000,
+ 0x000000, 0xea00000, 0x000000, 0x6000000, 0x6000000, 0x000000, 0x400000, 0x7400000,
+ 0x6400000, 0x6000000, 0x000000, 0xfa00000, 0x000000, 0x6000000, 0x4400000, 0x6000000,
+ 0xea00000, 0x4000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6400000,
+ 0x000000, 0x1000000, 0x6400000, 0xfa00000, 0x7000000, 0x7400000, 0x6000000, 0x6400000,
+ 0x1000000, 0x6400000, 0xfa00000, 0x400000, 0x7400000, 0x000000, 0xfa00000, 0x7000000,
+ 0x4400000, 0x6000000, 0x6200000, 0x5000000, 0x1000000, 0x6400000, 0xfc00000, 0x6400000,
+ 0x6400000, 0x000000, 0x400000, 0xfa00000, 0xfa00000, 0x6000000, 0x7400000, 0xfa00000,
+ 0x6000000, 0x7400000, 0x000000, 0x6000000, 0x4400000, 0x6400000, 0x7200000, 0x7400000,
+ 0x6000000, 0x6400000, 0x7200000, 0xfa00000, 0x6000000, 0xfa00000, 0x1000000, 0x7200000,
+ 0x6000000, 0xea00000, 0x6000000, 0xfa00000, 0x7400000, 0x400000, 0x6000000, 0x6400000,
+ 0xfa00000, 0x6000000, 0x7200000, 0x7200000, 0x7400000, 0x000000, 0x6000000, 0xfa00000,
+ 0x6400000, 0x6400000, 0x6400000, 0xfa00000, 0x6400000, 0x1200000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x7000000, 0x1000000, 0x6200000, 0x7400000, 0x6000000, 0x6200000
+};
+
+static const unsigned long unicode_backtrans_8e[] = {
+ 0x6000000, 0x4400000, 0x6000000, 0x6000000, 0x6400000, 0x7400000, 0x6400000, 0x6000000,
+ 0x200000, 0x7200000, 0xfa00000, 0x400000, 0x1000000, 0x6000000, 0x4000000, 0xfa00000,
+ 0xea00000, 0x6400000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0x6400000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x7200000, 0xfa00000, 0x7200000,
+ 0x6400000, 0x6400000, 0x7400000, 0x7400000, 0x6000000, 0x6000000, 0x6400000, 0x6400000,
+ 0x4000000, 0x7000000, 0xda00000, 0x6000000, 0x1000000, 0x4000000, 0x7000000, 0x1000000,
+ 0xea00000, 0x7400000, 0x000000, 0x6400000, 0x6200000, 0xfa00000, 0x6400000, 0x400000,
+ 0x6400000, 0x7400000, 0x5000000, 0x000000, 0x6000000, 0x7400000, 0x6000000, 0x6000000,
+ 0x7400000, 0x7400000, 0xfa00000, 0x000000, 0xfa00000, 0x6000000, 0x4000000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0x7400000, 0x6200000, 0x6400000, 0x6400000, 0x4400000,
+ 0x6200000, 0x1000000, 0x1000000, 0x6000000, 0x6400000, 0x6200000, 0x6000000, 0x6000000,
+ 0x000000, 0xfa00000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0xea00000,
+ 0xea00000, 0x6400000, 0x6400000, 0x6200000, 0x6200000, 0x6000000, 0x7000000, 0x6000000,
+ 0x4000000, 0x7400000, 0x6000000, 0x000000, 0x7400000, 0x7400000, 0x000000, 0x7400000,
+ 0x1400000, 0x4400000, 0x7200000, 0x6000000, 0xfa00000, 0x4000000, 0xfa00000, 0x4000000,
+ 0x6000000, 0x400000, 0x6400000, 0x6400000, 0x7200000, 0x000000, 0x4000000, 0x1000000,
+ 0x4000000, 0xfa00000, 0x6400000, 0x400000, 0x6200000, 0x7200000, 0x6000000, 0xfa00000,
+ 0x6000000, 0x6400000, 0xea00000, 0x6200000, 0x6000000, 0xea00000, 0x6000000, 0x1000000,
+ 0x7400000, 0x6200000, 0x6400000, 0x6200000, 0x7200000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6000000, 0x200000, 0x6400000, 0x400000, 0x1000000, 0x6400000, 0x7400000, 0x6000000,
+ 0x6000000, 0x6200000, 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x4400000,
+ 0x6000000, 0x6400000, 0xea00000, 0xfa00000, 0xfa00000, 0x4400000, 0x400000, 0x1200000,
+ 0x4200000, 0x200000, 0x7000000, 0x400000, 0x000000, 0x400000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x7400000, 0x400000, 0x4000000, 0x6000000, 0x200000, 0x000000,
+ 0xec00000, 0x400000, 0x6000000, 0x4400000, 0x400000, 0x200000, 0x200000, 0x400000,
+ 0x200000, 0x6000000, 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x5000000, 0x6400000,
+ 0x000000, 0x6400000, 0xea00000, 0x6000000, 0x6400000, 0x000000, 0x000000, 0x6000000,
+ 0x6000000, 0x000000, 0x4000000, 0x6200000, 0x6400000, 0x6000000, 0x6000000, 0xea00000,
+ 0x6000000, 0x6000000, 0x4200000, 0x200000, 0x4000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6000000, 0x000000, 0xea00000, 0x6000000, 0x4400000, 0x6400000, 0x6000000,
+ 0x400000, 0x6400000, 0x4000000, 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000,
+ 0xea00000, 0x6400000, 0x6400000, 0xea00000, 0x6200000, 0x200000, 0xea00000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_8f[] = {
+ 0x6400000, 0x6000000, 0x6400000, 0xea00000, 0x000000, 0xea00000, 0x6000000, 0x6400000,
+ 0x6400000, 0xea00000, 0x6200000, 0x6000000, 0x200000, 0x6000000, 0x6000000, 0x400000,
+ 0x6400000, 0x6000000, 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0x6400000,
+ 0x6400000, 0x4200000, 0x6000000, 0xea00000, 0xea00000, 0xea00000, 0xec00000, 0xea00000,
+ 0x6400000, 0x400000, 0x000000, 0x6400000, 0x6000000, 0x6400000, 0xea00000, 0x8c00000,
+ 0x400000, 0xea00000, 0xea00000, 0x000000, 0x6400000, 0x4400000, 0x6400000, 0xea00000,
+ 0x4000000, 0x000000, 0x6000000, 0xea00000, 0x6400000, 0x6400000, 0x6400000, 0x6400000,
+ 0xea00000, 0xea00000, 0x400000, 0xea00000, 0x000000, 0x000000, 0xea00000, 0xea00000,
+ 0x6400000, 0x4400000, 0x6200000, 0x6400000, 0xea00000, 0xea00000, 0x6200000, 0x6400000,
+ 0x6000000, 0xea00000, 0x4000000, 0x6000000, 0x200000, 0xea00000, 0xea00000, 0x6400000,
+ 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x6200000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x4200000, 0xec00000, 0x6400000, 0xea00000,
+ 0x6000000, 0x6200000, 0xea00000, 0x6200000, 0x6200000, 0x400000, 0x5000000, 0x5000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0xfa00000, 0xfa00000, 0x400000, 0x1200000, 0x7200000,
+ 0x4400000, 0x400000, 0x000000, 0xfa00000, 0x400000, 0x4400000, 0xec00000, 0x4200000,
+ 0xfa00000, 0x1000000, 0x000000, 0x1000000, 0x000000, 0xea00000, 0x6200000, 0xea00000,
+ 0xfa00000, 0xfa00000, 0xea00000, 0x4000000, 0x6000000, 0x4400000, 0x5400000, 0x4200000,
+ 0x4400000, 0x5000000, 0x4200000, 0x4200000, 0x4200000, 0x1000000, 0x5400000, 0x6200000,
+ 0x400000, 0x5400000, 0xfa00000, 0x000000, 0x7200000, 0xfa00000, 0x6400000, 0x1000000,
+ 0x1000000, 0x6000000, 0x4400000, 0x6400000, 0x4000000, 0x6400000, 0xfa00000, 0x4000000,
+ 0x5400000, 0xfa00000, 0x6400000, 0x7400000, 0xfa00000, 0x7400000, 0x6000000, 0x6000000,
+ 0x1000000, 0x1000000, 0x4200000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x6400000, 0x6000000, 0x7200000, 0x6400000, 0x7400000, 0x7200000, 0xfa00000, 0x000000,
+ 0x7400000, 0x1200000, 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0x7400000, 0x200000,
+ 0xfa00000, 0x400000, 0x8800000, 0x1000000, 0x6200000, 0x6400000, 0x6400000, 0xfa00000,
+ 0x7200000, 0xda00000, 0x6200000, 0x6400000, 0x6000000, 0xfa00000, 0x6400000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_90[] = {
+ 0xfa00000, 0xfa00000, 0xfc00000, 0xfa00000, 0x7400000, 0xfa00000, 0xfa00000, 0x000000,
+ 0xcc00000, 0x1000000, 0x1000000, 0xfa00000, 0x6400000, 0xfa00000, 0x200000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0x5000000, 0x200000, 0xfa00000, 0xea00000, 0x7200000, 0xfa00000,
+ 0x400000, 0xea00000, 0xfa00000, 0x7400000, 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xea00000, 0x6000000, 0x000000, 0x1000000, 0x200000,
+ 0x400000, 0x400000, 0x400000, 0x000000, 0x400000, 0x7400000, 0xfa00000, 0x7400000,
+ 0x000000, 0xea00000, 0xea00000, 0x4400000, 0x6400000, 0xfa00000, 0x7200000, 0x4400000,
+ 0xfa00000, 0x200000, 0x000000, 0x1000000, 0xfa00000, 0x6000000, 0xfa00000, 0x6400000,
+ 0x000000, 0xfa00000, 0xfa00000, 0x400000, 0x7400000, 0x200000, 0x000000, 0xfa00000,
+ 0x000000, 0x6200000, 0xea00000, 0xea00000, 0x4400000, 0xfa00000, 0xea00000, 0x7200000,
+ 0xfa00000, 0xfa00000, 0x7200000, 0xfa00000, 0xea00000, 0xea00000, 0x4200000, 0x1000000,
+ 0x7200000, 0xea00000, 0x000000, 0x7400000, 0xea00000, 0xec00000, 0xea00000, 0x000000,
+ 0xea00000, 0xca00000, 0x7400000, 0xfa00000, 0x4000000, 0x1200000, 0x400000, 0x6400000,
+ 0x7200000, 0xea00000, 0x000000, 0x6000000, 0x4400000, 0xfa00000, 0xfa00000, 0xea00000,
+ 0x6400000, 0x000000, 0xea00000, 0x6000000, 0x7400000, 0xfa00000, 0x6200000, 0xea00000,
+ 0xea00000, 0x6400000, 0xea00000, 0x6000000, 0xea00000, 0xfa00000, 0x6000000, 0xfa00000,
+ 0xfa00000, 0xea00000, 0xfa00000, 0xfa00000, 0xea00000, 0x6400000, 0x6000000, 0xea00000,
+ 0xfc00000, 0x200000, 0xea00000, 0x7400000, 0x400000, 0x6000000, 0x400000, 0xea00000,
+ 0x6400000, 0xfa00000, 0x000000, 0x1000000, 0x6000000, 0xfc00000, 0x000000, 0x5400000,
+ 0x6400000, 0xfc00000, 0x000000, 0x7400000, 0x000000, 0x1000000, 0x6000000, 0x6000000,
+ 0x6400000, 0x7400000, 0xfc00000, 0xfa00000, 0x000000, 0x6400000, 0xfa00000, 0x6000000,
+ 0xca00000, 0x000000, 0xfa00000, 0x000000, 0x1000000, 0x000000, 0x5000000, 0xfa00000,
+ 0xfc00000, 0xfa00000, 0x6400000, 0x7400000, 0x7400000, 0xfa00000, 0x7400000, 0x000000,
+ 0xfa00000, 0x1000000, 0x1000000, 0x5000000, 0x000000, 0x6400000, 0x7400000, 0x6000000,
+ 0x000000, 0xfa00000, 0x000000, 0x6400000, 0x5400000, 0x7400000, 0x000000, 0x7400000,
+ 0x6400000, 0x000000, 0xfa00000, 0x6000000, 0x400000, 0x000000, 0x7200000, 0x1000000,
+ 0x1000000, 0x1000000, 0x400000, 0x1000000, 0x6000000, 0x6400000, 0x6000000, 0x7400000,
+ 0x6400000, 0x6400000, 0x6000000, 0x7200000, 0x7400000, 0x7400000, 0x8800000, 0x6400000,
+ 0x6000000, 0xfa00000, 0x7200000, 0x6000000, 0x6200000, 0x6400000, 0x1000000, 0x1000000,
+ 0xfa00000, 0x6000000, 0x6000000, 0x7400000, 0x6000000, 0xfa00000, 0x000000, 0x7400000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x7400000, 0xea00000, 0x400000, 0x200000,
+ 0x1000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0xfa00000, 0x7400000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_91[] = {
+ 0x6400000, 0x6000000, 0xfa00000, 0x6000000, 0x7400000, 0x6400000, 0x6400000, 0x6000000,
+ 0x6400000, 0x6000000, 0x000000, 0x6000000, 0x000000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6000000, 0xea00000, 0x000000, 0x6400000, 0x8800000, 0x6400000, 0x6400000,
+ 0x6400000, 0xfa00000, 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x7400000, 0x6000000,
+ 0x6400000, 0x6000000, 0x7400000, 0x7400000, 0x6000000, 0x400000, 0x6000000, 0xec00000,
+ 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0xea00000, 0x6400000, 0x7400000,
+ 0x6200000, 0x7400000, 0xea00000, 0x6000000, 0x6400000, 0x6000000, 0x6400000, 0x400000,
+ 0x6000000, 0x7400000, 0x6400000, 0x6000000, 0x400000, 0x400000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x000000, 0x7400000, 0x6000000, 0x6000000, 0x7000000, 0x6400000,
+ 0x6400000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x7400000,
+ 0x7000000, 0x4000000, 0xfa00000, 0x6400000, 0x200000, 0x6000000, 0x6200000, 0x7400000,
+ 0x6200000, 0x4400000, 0x7400000, 0x400000, 0x4000000, 0x1000000, 0x5000000, 0x6000000,
+ 0x6000000, 0x7400000, 0xfa00000, 0x7200000, 0x7400000, 0x7200000, 0x000000, 0x4400000,
+ 0x6000000, 0xfa00000, 0xfa00000, 0x000000, 0xfa00000, 0x400000, 0x7000000, 0x7000000,
+ 0x5000000, 0x1000000, 0x7200000, 0x6200000, 0x7400000, 0xfa00000, 0x5000000, 0xfa00000,
+ 0xfa00000, 0x7400000, 0x6400000, 0x400000, 0x4000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x6000000, 0x6400000, 0x6200000, 0x6400000, 0x6000000, 0x7400000, 0x6400000, 0xfa00000,
+ 0x000000, 0xfa00000, 0x6400000, 0xfa00000, 0x5000000, 0xfa00000, 0x4400000, 0x6000000,
+ 0x7200000, 0x7400000, 0xfa00000, 0x6400000, 0x400000, 0x400000, 0x000000, 0x200000,
+ 0x400000, 0x6000000, 0x7000000, 0x7000000, 0xea00000, 0x6000000, 0x6400000, 0x6000000,
+ 0x6000000, 0x6400000, 0x7200000, 0x7000000, 0x200000, 0x6000000, 0x400000, 0x6000000,
+ 0x6400000, 0x4000000, 0x7200000, 0xea00000, 0xec00000, 0x7400000, 0xfc00000, 0xfa00000,
+ 0x6400000, 0xec00000, 0x6400000, 0x6400000, 0xfa00000, 0xfa00000, 0x4400000, 0x6000000,
+ 0x200000, 0x6000000, 0x7200000, 0x4400000, 0x6400000, 0x6400000, 0x6000000, 0x400000,
+ 0xea00000, 0x6200000, 0x6400000, 0x6400000, 0x4000000, 0x6400000, 0x6200000, 0xfa00000,
+ 0x200000, 0xfa00000, 0x1000000, 0xea00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xea00000, 0xfa00000, 0x000000, 0x6400000, 0x6400000, 0x6000000, 0x4200000, 0xec00000,
+ 0xea00000, 0x6400000, 0x6400000, 0x200000, 0xfa00000, 0xea00000, 0x400000, 0x4200000,
+ 0x000000, 0x200000, 0x6000000, 0xea00000, 0x6400000, 0x4400000, 0x6200000, 0xea00000,
+ 0x6000000, 0x6400000, 0xec00000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x400000,
+ 0x400000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0xea00000, 0x4200000, 0x6400000,
+ 0x6000000, 0x6400000, 0x4000000, 0x400000, 0x200000, 0x6400000, 0x4000000, 0x6200000
+};
+
+static const unsigned long unicode_backtrans_92[] = {
+ 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000,
+ 0x4000000, 0x6400000, 0x6400000, 0x000000, 0x6400000, 0xea00000, 0x4200000, 0x6000000,
+ 0xec00000, 0xea00000, 0xec00000, 0x4400000, 0x6200000, 0x6200000, 0x6400000, 0xe800000,
+ 0x400000, 0x6000000, 0x6000000, 0x000000, 0x6400000, 0x400000, 0xea00000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6000000,
+ 0x4400000, 0x200000, 0x4000000, 0x4000000, 0x200000, 0x6000000, 0x6400000, 0x400000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0xea00000, 0x4400000, 0x6400000, 0x6200000,
+ 0x6400000, 0x6400000, 0xec00000, 0x000000, 0x4400000, 0x6000000, 0x6400000, 0xea00000,
+ 0xec00000, 0x4000000, 0x400000, 0x400000, 0x4200000, 0xea00000, 0x6400000, 0x400000,
+ 0x6200000, 0xea00000, 0x6400000, 0x6200000, 0x6000000, 0x6400000, 0x6400000, 0x6400000,
+ 0x6200000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x4000000, 0x6000000, 0xea00000,
+ 0x4400000, 0x400000, 0x6200000, 0xea00000, 0x400000, 0x4400000, 0xea00000, 0x4000000,
+ 0x6400000, 0x6400000, 0xca00000, 0x6000000, 0xea00000, 0xec00000, 0xea00000, 0x6400000,
+ 0x400000, 0x400000, 0x000000, 0x4000000, 0x6000000, 0x6000000, 0x4400000, 0x6400000,
+ 0x6400000, 0x200000, 0x6000000, 0x000000, 0x1000000, 0x400000, 0x6400000, 0x4400000,
+ 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6200000, 0x6400000,
+ 0xea00000, 0x4000000, 0x6000000, 0xea00000, 0x4000000, 0xea00000, 0x6000000, 0x6000000,
+ 0x6400000, 0x4400000, 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0x7400000, 0x4000000,
+ 0x000000, 0xea00000, 0x400000, 0xea00000, 0x6000000, 0x6200000, 0xea00000, 0x6400000,
+ 0xea00000, 0x6400000, 0x6200000, 0x6200000, 0xea00000, 0x6000000, 0x000000, 0x400000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x200000, 0x5000000, 0x400000,
+ 0x000000, 0x4000000, 0x6400000, 0xe800000, 0x6000000, 0x6000000, 0xec00000, 0xea00000,
+ 0x400000, 0xca00000, 0x4400000, 0x6400000, 0x6400000, 0x400000, 0x4000000, 0x4400000,
+ 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x6400000, 0x6400000,
+ 0x7400000, 0x6000000, 0x6000000, 0x6400000, 0xec00000, 0x6400000, 0x6400000, 0xea00000,
+ 0x6400000, 0x6000000, 0xea00000, 0x6400000, 0x4000000, 0x6400000, 0x000000, 0x6400000,
+ 0x6400000, 0x6400000, 0x000000, 0x4000000, 0x400000, 0x6400000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6400000, 0x000000, 0x4400000, 0xea00000, 0x4400000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6200000, 0xea00000, 0x4000000, 0x4400000, 0x200000, 0x6400000, 0x6000000,
+ 0x6400000, 0x6000000, 0x4200000, 0x4200000, 0x4000000, 0x000000, 0x4000000, 0x6000000,
+ 0xea00000, 0x6400000, 0x6200000, 0x6400000, 0xea00000, 0x4000000, 0x6000000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_93[] = {
+ 0x6400000, 0x6000000, 0x6400000, 0x4000000, 0xe800000, 0x000000, 0x6200000, 0x4000000,
+ 0x6400000, 0x6000000, 0x000000, 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x6200000,
+ 0xea00000, 0x400000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x000000,
+ 0xea00000, 0x6200000, 0xea00000, 0x6000000, 0x400000, 0x6400000, 0xec00000, 0xec00000,
+ 0xea00000, 0xec00000, 0xea00000, 0x6200000, 0xec00000, 0x6400000, 0xea00000, 0x6400000,
+ 0xea00000, 0x6400000, 0x6400000, 0xea00000, 0x4200000, 0x6000000, 0xea00000, 0xea00000,
+ 0x4000000, 0x4000000, 0x200000, 0x6400000, 0x6400000, 0x6200000, 0x6400000, 0x400000,
+ 0x6000000, 0x6000000, 0x200000, 0x200000, 0x6000000, 0x000000, 0x1000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4200000, 0x4000000, 0x6000000, 0x6400000,
+ 0xcc00000, 0x6400000, 0xe800000, 0xea00000, 0x6000000, 0xea00000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6400000, 0x6400000, 0x000000, 0xea00000, 0x6400000, 0x6200000, 0x6400000,
+ 0x6400000, 0x6000000, 0x6400000, 0xea00000, 0x6200000, 0x000000, 0x6400000, 0x4000000,
+ 0x6200000, 0x6000000, 0x4000000, 0x6000000, 0x6400000, 0x6400000, 0x4000000, 0x6400000,
+ 0x4000000, 0x4400000, 0x7400000, 0x4000000, 0x6200000, 0x6400000, 0xca00000, 0x400000,
+ 0x6400000, 0x6400000, 0x000000, 0x4400000, 0x4400000, 0xea00000, 0x6400000, 0x6000000,
+ 0x4000000, 0x6000000, 0x6400000, 0x6000000, 0xea00000, 0x4400000, 0xea00000, 0x400000,
+ 0x6400000, 0x4400000, 0x6400000, 0x6000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x400000, 0xea00000, 0x6400000, 0x6000000, 0x7400000,
+ 0x4000000, 0x6000000, 0x6400000, 0x000000, 0xea00000, 0x6400000, 0xea00000, 0x6200000,
+ 0x6400000, 0x6000000, 0xea00000, 0x6400000, 0x4000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x4000000, 0x6400000, 0x6000000, 0xec00000, 0x6400000, 0x6000000, 0x6400000, 0xea00000,
+ 0x6400000, 0x6400000, 0x6000000, 0x400000, 0xea00000, 0xca00000, 0x6200000, 0x6000000,
+ 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x400000, 0x6000000,
+ 0x4000000, 0x200000, 0x400000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x6000000, 0x400000, 0x6000000, 0xea00000, 0x6400000, 0x400000, 0x4400000, 0x6400000,
+ 0x6200000, 0x400000, 0x7400000, 0x4400000, 0x6400000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6200000, 0xea00000, 0x6000000, 0x4400000, 0x6000000, 0x6000000, 0x7200000, 0x6200000,
+ 0x6200000, 0x6400000, 0x6000000, 0x4000000, 0x6400000, 0x6200000, 0xec00000, 0x6400000,
+ 0x4000000, 0xea00000, 0x6400000, 0x6000000, 0xea00000, 0x200000, 0x6400000, 0x6400000,
+ 0x6200000, 0x000000, 0x000000, 0x000000, 0x6000000, 0x000000, 0x6000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x6000000, 0xe800000, 0x6400000,
+ 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_94[] = {
+ 0x6000000, 0x4400000, 0x400000, 0x6200000, 0xcc00000, 0x000000, 0x6000000, 0x6200000,
+ 0x4400000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x6400000,
+ 0x6200000, 0x6000000, 0x6000000, 0x6200000, 0x6200000, 0x6400000, 0x6400000, 0x4400000,
+ 0xea00000, 0x6200000, 0x200000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x400000,
+ 0x6000000, 0x200000, 0x000000, 0x000000, 0x4000000, 0xc800000, 0x4000000, 0x4000000,
+ 0x6000000, 0x6000000, 0x6000000, 0xea00000, 0x6000000, 0x4000000, 0x6400000, 0x400000,
+ 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x400000, 0xea00000, 0x6200000, 0x6000000,
+ 0xea00000, 0x6000000, 0x6200000, 0x6400000, 0x6000000, 0x6400000, 0x5000000, 0x6400000,
+ 0x6000000, 0x200000, 0x4000000, 0x4400000, 0xea00000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x6400000, 0x4000000, 0x000000, 0x6000000,
+ 0x6000000, 0xea00000, 0xea00000, 0x200000, 0x4000000, 0x6400000, 0x000000, 0x6000000,
+ 0x4000000, 0x400000, 0x200000, 0xca00000, 0x400000, 0x6000000, 0x6200000, 0x400000,
+ 0x6200000, 0x400000, 0x6200000, 0x6400000, 0x6000000, 0x4000000, 0x000000, 0x4000000,
+ 0x6400000, 0x6000000, 0x6200000, 0x7400000, 0x4000000, 0x6400000, 0x6400000, 0x6400000,
+ 0x6200000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6200000, 0x6000000, 0x6200000,
+ 0x6000000, 0x4000000, 0x000000, 0x4000000, 0x6200000, 0xea00000, 0x6200000, 0xea00000,
+ 0x6000000, 0x6200000, 0x6000000, 0x6400000, 0x400000, 0x5000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x1000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x5000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000
+};
+
+static const unsigned long unicode_backtrans_95[] = {
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000,
+ 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0xea00000,
+ 0x4400000, 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x400000, 0x5000000,
+ 0xea00000, 0x000000, 0x6200000, 0xea00000, 0x400000, 0x4000000, 0x6000000, 0x200000,
+ 0x6400000, 0xea00000, 0x200000, 0xea00000, 0x6400000, 0x6400000, 0x6400000, 0xea00000,
+ 0x6000000, 0xea00000, 0xe800000, 0xea00000, 0xea00000, 0x000000, 0x4200000, 0x4000000,
+ 0xea00000, 0x4200000, 0x000000, 0x6000000, 0x6000000, 0x400000, 0x6400000, 0x6400000,
+ 0x4200000, 0x6400000, 0x4200000, 0xea00000, 0xea00000, 0xea00000, 0x4400000, 0x4200000,
+ 0xea00000, 0x6400000, 0x4000000, 0x6400000, 0x6400000, 0xea00000, 0x6000000, 0x000000,
+ 0x6000000, 0xe800000, 0x200000, 0x000000, 0x400000, 0x6000000, 0x6400000, 0x6000000,
+ 0x000000, 0x6200000, 0x6400000, 0xea00000, 0xea00000, 0x6400000, 0x6200000, 0x6400000,
+ 0x6000000, 0x000000, 0x000000, 0x6200000, 0x000000, 0x6000000, 0x6400000, 0xea00000,
+ 0x6400000, 0x6400000, 0xea00000, 0x6400000, 0x6200000, 0x6200000, 0x000000, 0x000000,
+ 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0xea00000, 0xea00000, 0xea00000, 0x000000,
+ 0x200000, 0x400000, 0x6400000, 0x6000000, 0xea00000, 0x400000, 0x6400000, 0x6400000,
+ 0x6400000, 0xea00000, 0xea00000, 0x6000000, 0x6400000, 0x6200000, 0x400000, 0x000000,
+ 0x5000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x5000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_96[] = {
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x000000, 0xfa00000, 0x5400000, 0x6400000, 0x1000000,
+ 0x6000000, 0xfa00000, 0x7400000, 0x6000000, 0x6400000, 0x400000, 0x400000, 0x000000,
+ 0x6200000, 0x000000, 0xfa00000, 0x000000, 0x6400000, 0x6000000, 0xfa00000, 0x6200000,
+ 0x6000000, 0x7400000, 0xfa00000, 0x5400000, 0x1000000, 0x1000000, 0x1000000, 0x400000,
+ 0x4400000, 0x6400000, 0x6400000, 0xfa00000, 0x7400000, 0x7400000, 0x000000, 0xfa00000,
+ 0xfa00000, 0x4400000, 0xfa00000, 0x6000000, 0xfa00000, 0x5000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0x6200000,
+ 0xfa00000, 0x6000000, 0x400000, 0x6000000, 0x7400000, 0x1000000, 0x4400000, 0x400000,
+ 0x6400000, 0x000000, 0x000000, 0xfa00000, 0xea00000, 0xea00000, 0xea00000, 0xfa00000,
+ 0x000000, 0x7400000, 0xfa00000, 0xea00000, 0xfa00000, 0x200000, 0x200000, 0x1000000,
+ 0x1000000, 0x5000000, 0xfa00000, 0x6000000, 0x7200000, 0x6000000, 0x400000, 0x6000000,
+ 0xea00000, 0x6000000, 0x7200000, 0xea00000, 0x7400000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xea00000, 0x000000, 0x200000, 0x4400000, 0x6400000, 0xea00000, 0x6400000, 0x400000,
+ 0x6000000, 0x4400000, 0x400000, 0x6400000, 0x6400000, 0xfa00000, 0xfa00000, 0x6000000,
+ 0x7200000, 0x6400000, 0xea00000, 0xfa00000, 0x000000, 0xfa00000, 0xea00000, 0x5200000,
+ 0x1000000, 0x6400000, 0x6000000, 0x6000000, 0xfa00000, 0xea00000, 0x4400000, 0x7200000,
+ 0xfa00000, 0xfa00000, 0x400000, 0xea00000, 0xfa00000, 0x400000, 0x6000000, 0x400000,
+ 0x200000, 0x6000000, 0x6000000, 0xca00000, 0x6400000, 0x4400000, 0x400000, 0xfa00000,
+ 0xea00000, 0x6400000, 0xea00000, 0x000000, 0x6000000, 0x000000, 0x6400000, 0x400000,
+ 0x7200000, 0xea00000, 0x200000, 0x7400000, 0x6200000, 0x000000, 0x5200000, 0x8a00000,
+ 0x6200000, 0x7200000, 0x400000, 0xea00000, 0x7200000, 0x5000000, 0x1000000, 0x6000000,
+ 0xfa00000, 0xfa00000, 0x6000000, 0x6000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x6400000, 0xea00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x1000000,
+ 0x000000, 0x200000, 0x7400000, 0x6000000, 0x6000000, 0xfa00000, 0xea00000, 0x6000000,
+ 0x6400000, 0xea00000, 0x6400000, 0xea00000, 0xea00000, 0x6400000, 0x6400000, 0x6400000,
+ 0x1000000, 0x6000000, 0xea00000, 0xea00000, 0x000000, 0x6000000, 0x000000, 0x000000,
+ 0xfa00000, 0xfc00000, 0xfa00000, 0x200000, 0x000000, 0x000000, 0x000000, 0xfc00000,
+ 0xea00000, 0x6400000, 0xea00000, 0x1000000, 0x4000000, 0x6000000, 0xfa00000, 0xfa00000,
+ 0x6000000, 0xfa00000, 0x6400000, 0xea00000, 0x000000, 0x6000000, 0x1000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_97[] = {
+ 0xfa00000, 0x1000000, 0x6400000, 0x4400000, 0x7200000, 0x6400000, 0xfa00000, 0xfa00000,
+ 0x7200000, 0x7400000, 0x200000, 0x6000000, 0x000000, 0x7200000, 0x7200000, 0x7200000,
+ 0x6000000, 0xea00000, 0x6000000, 0xfa00000, 0x000000, 0x000000, 0xfa00000, 0x000000,
+ 0x6000000, 0xea00000, 0x400000, 0x4400000, 0xfa00000, 0x6400000, 0xfa00000, 0x6000000,
+ 0x6000000, 0x4400000, 0x6400000, 0x6400000, 0x6200000, 0x6000000, 0x6000000, 0xea00000,
+ 0x6400000, 0x6000000, 0x7200000, 0x6000000, 0x6000000, 0x1000000, 0x6000000, 0x6000000,
+ 0xfa00000, 0x4400000, 0xfa00000, 0x400000, 0x000000, 0x6000000, 0x4000000, 0x000000,
+ 0x7200000, 0xfa00000, 0x6000000, 0x000000, 0x000000, 0xea00000, 0x7200000, 0x6000000,
+ 0x4000000, 0x4400000, 0xea00000, 0x6400000, 0xea00000, 0x000000, 0x6200000, 0x6000000,
+ 0xea00000, 0x6200000, 0x400000, 0x6000000, 0x000000, 0x000000, 0x400000, 0x400000,
+ 0x000000, 0xc800000, 0x7200000, 0x1000000, 0x000000, 0x4400000, 0xfa00000, 0x4400000,
+ 0x6400000, 0x1200000, 0x6400000, 0x7400000, 0xca00000, 0x4000000, 0xfa00000, 0x4000000,
+ 0x7200000, 0xfa00000, 0xfa00000, 0x400000, 0x200000, 0x1000000, 0x6200000, 0x400000,
+ 0x6200000, 0xfa00000, 0x6400000, 0x200000, 0x6000000, 0xca00000, 0x6400000, 0x000000,
+ 0x6000000, 0x4200000, 0x6000000, 0x7400000, 0xfa00000, 0x000000, 0x7400000, 0xec00000,
+ 0x6400000, 0x200000, 0xea00000, 0x6400000, 0x7200000, 0x6400000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6200000, 0x6000000, 0x6000000, 0x6200000, 0x7200000, 0x200000, 0x4000000,
+ 0x6000000, 0x4400000, 0x6000000, 0xfa00000, 0x000000, 0xfa00000, 0x6000000, 0xea00000,
+ 0x200000, 0x1000000, 0x1000000, 0x000000, 0x7000000, 0x400000, 0x400000, 0x6400000,
+ 0x7200000, 0x6400000, 0x6400000, 0x4000000, 0x6200000, 0x6000000, 0x6400000, 0x4400000,
+ 0xfa00000, 0x6000000, 0x6400000, 0x7200000, 0x6000000, 0x6000000, 0x6200000, 0x000000,
+ 0xea00000, 0x000000, 0x6000000, 0xfa00000, 0x6400000, 0xfa00000, 0x6400000, 0x1000000,
+ 0x000000, 0x4400000, 0x5400000, 0x6200000, 0x5200000, 0x400000, 0x6400000, 0x6000000,
+ 0x4400000, 0x6400000, 0x4400000, 0x6000000, 0x400000, 0x4000000, 0x4400000, 0x6400000,
+ 0x4000000, 0x6400000, 0x4000000, 0x6200000, 0x6400000, 0x6400000, 0xea00000, 0x6400000,
+ 0x4200000, 0x6400000, 0x400000, 0xea00000, 0x6400000, 0x6400000, 0x6400000, 0x6000000,
+ 0x6400000, 0x400000, 0x4000000, 0xea00000, 0x6400000, 0x6000000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6400000, 0x000000, 0x400000, 0xea00000, 0x6400000, 0x6400000, 0x6000000,
+ 0x4400000, 0x6400000, 0x000000, 0x6000000, 0x400000, 0x6000000, 0x5000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x7200000, 0x4200000, 0x400000,
+ 0x6000000, 0x6400000, 0x4200000, 0xfa00000, 0x400000, 0x5200000, 0xfa00000, 0x400000,
+ 0x6400000, 0x6000000, 0x6400000, 0xea00000, 0x000000, 0x6000000, 0x6000000, 0xea00000
+};
+
+static const unsigned long unicode_backtrans_98[] = {
+ 0xe800000, 0xea00000, 0xea00000, 0xea00000, 0x6000000, 0xea00000, 0xea00000, 0x6400000,
+ 0xea00000, 0x000000, 0xec00000, 0x000000, 0xea00000, 0x6400000, 0x6400000, 0x6200000,
+ 0xea00000, 0xea00000, 0xea00000, 0xea00000, 0x4400000, 0x4000000, 0x6400000, 0xea00000,
+ 0xea00000, 0x400000, 0x200000, 0x6000000, 0x6400000, 0x6000000, 0x6400000, 0x4000000,
+ 0x6400000, 0x6200000, 0x000000, 0x4400000, 0x6200000, 0x400000, 0x6400000, 0x6000000,
+ 0x6000000, 0x6000000, 0x000000, 0x6400000, 0x200000, 0xea00000, 0x4400000, 0x6400000,
+ 0xec00000, 0x000000, 0x6400000, 0x4400000, 0x4200000, 0x6400000, 0x000000, 0x6200000,
+ 0xea00000, 0xe800000, 0x000000, 0xea00000, 0x200000, 0x200000, 0x400000, 0x000000,
+ 0x000000, 0x6000000, 0x000000, 0x6000000, 0x6400000, 0x6000000, 0xea00000, 0x4400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x4200000, 0xea00000, 0xea00000, 0xea00000, 0x6200000,
+ 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x8a00000, 0x200000, 0x400000, 0x6400000,
+ 0xea00000, 0x6400000, 0x8c00000, 0x6200000, 0x6000000, 0x6000000, 0xea00000, 0x6000000,
+ 0x6000000, 0x000000, 0x6400000, 0x6400000, 0x6000000, 0xec00000, 0x4400000, 0xea00000,
+ 0x4000000, 0x6000000, 0x6400000, 0xea00000, 0x4400000, 0x000000, 0x000000, 0xea00000,
+ 0x6200000, 0x6200000, 0x6000000, 0x6200000, 0x6200000, 0x5000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0xea00000, 0x6000000, 0x200000, 0x400000, 0x6000000, 0x6400000, 0x6400000, 0xea00000,
+ 0x400000, 0xea00000, 0x6000000, 0x6000000, 0x4400000, 0x000000, 0x6200000, 0x4400000,
+ 0x6400000, 0x4000000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x4200000, 0xea00000, 0x400000, 0x6200000, 0xc800000,
+ 0x4400000, 0x6000000, 0x4000000, 0x6000000, 0x6400000, 0x000000, 0x5000000, 0x000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0xea00000, 0xca00000, 0x000000, 0x5000000, 0xfa00000,
+ 0x4000000, 0xcc00000, 0xea00000, 0x6400000, 0x000000, 0x6400000, 0x4400000, 0x7400000,
+ 0x1000000, 0x6200000, 0x6400000, 0x6200000, 0x4000000, 0xea00000, 0x8a00000, 0xea00000,
+ 0x000000, 0x4000000, 0x6200000, 0x400000, 0xea00000, 0x4000000, 0x6400000, 0x000000,
+ 0x000000, 0x6000000, 0x6000000, 0x000000, 0xea00000, 0xea00000, 0xea00000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_99[] = {
+ 0x6000000, 0x000000, 0x6400000, 0xea00000, 0x000000, 0x6200000, 0x000000, 0x6400000,
+ 0x6400000, 0xea00000, 0xea00000, 0x000000, 0xea00000, 0x1000000, 0x4000000, 0x000000,
+ 0xfa00000, 0x6400000, 0x6200000, 0xea00000, 0x6200000, 0x6400000, 0x6400000, 0x6400000,
+ 0xea00000, 0x4000000, 0x6400000, 0x6400000, 0x4400000, 0x200000, 0xea00000, 0x6400000,
+ 0x8a00000, 0x6200000, 0x400000, 0x000000, 0x6200000, 0x6000000, 0x400000, 0x6400000,
+ 0xea00000, 0x6000000, 0x6000000, 0x6400000, 0x6200000, 0x6000000, 0x7200000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x400000, 0x6400000, 0x000000, 0x4000000,
+ 0x4000000, 0x4400000, 0x6400000, 0x4400000, 0x6400000, 0x6200000, 0x6200000, 0x6000000,
+ 0x4400000, 0x6400000, 0x4200000, 0x6000000, 0x000000, 0xea00000, 0x400000, 0x6400000,
+ 0x6400000, 0xea00000, 0x4000000, 0xea00000, 0xea00000, 0xcc00000, 0x6400000, 0x000000,
+ 0x6200000, 0xea00000, 0xea00000, 0x6000000, 0xfc00000, 0x7200000, 0x6000000, 0xea00000,
+ 0x6400000, 0x6400000, 0x000000, 0x6400000, 0x6400000, 0x4000000, 0x6400000, 0x6400000,
+ 0x400000, 0x6000000, 0x4000000, 0x5000000, 0x000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0xfa00000, 0x7200000,
+ 0x7200000, 0xfa00000, 0x000000, 0x4400000, 0x6000000, 0xec00000, 0x6000000, 0x400000,
+ 0x000000, 0x6000000, 0x000000, 0x6000000, 0x4000000, 0xfa00000, 0x6400000, 0x6000000,
+ 0xfa00000, 0x000000, 0x4000000, 0x6000000, 0xea00000, 0xea00000, 0xea00000, 0x6000000,
+ 0x6400000, 0xec00000, 0x6400000, 0xea00000, 0xea00000, 0x6400000, 0x000000, 0x000000,
+ 0x4000000, 0xec00000, 0x6400000, 0x6000000, 0x4200000, 0x6400000, 0x000000, 0x400000,
+ 0x000000, 0xea00000, 0x6000000, 0x6400000, 0x4200000, 0x4200000, 0x200000, 0x6000000,
+ 0x200000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0xea00000, 0xea00000, 0xea00000, 0x6400000, 0x6400000, 0xea00000, 0x6000000, 0x6000000,
+ 0x6200000, 0xec00000, 0x4400000, 0x6200000, 0x6400000, 0xea00000, 0x400000, 0xea00000,
+ 0x4000000, 0x4000000, 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0x4000000, 0x6400000,
+ 0x000000, 0x6000000, 0x6400000, 0x400000, 0x6400000, 0xea00000, 0x6200000, 0x000000,
+ 0x6400000, 0xea00000, 0x200000, 0x000000, 0x6400000, 0x4400000, 0x6000000, 0x6000000,
+ 0x6200000, 0x6400000, 0x6000000, 0x6200000, 0x6000000, 0x6400000, 0x6400000, 0xea00000
+};
+
+static const unsigned long unicode_backtrans_9a[] = {
+ 0x000000, 0xea00000, 0x6400000, 0x6400000, 0x6400000, 0x6200000, 0x6000000, 0x6000000,
+ 0x8800000, 0x6000000, 0x6000000, 0x6400000, 0x4400000, 0x6000000, 0xea00000, 0xea00000,
+ 0x4400000, 0x6400000, 0x200000, 0x200000, 0x6000000, 0x6000000, 0x6400000, 0x000000,
+ 0x000000, 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x4000000,
+ 0x6400000, 0x4000000, 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x4000000, 0x6400000,
+ 0x200000, 0x6000000, 0x6000000, 0xea00000, 0x6000000, 0x6400000, 0x6400000, 0x4000000,
+ 0xea00000, 0x6000000, 0x6000000, 0x400000, 0x6000000, 0x6400000, 0xec00000, 0xea00000,
+ 0x6400000, 0x6000000, 0x6000000, 0x4000000, 0x4000000, 0x6000000, 0x6200000, 0x6000000,
+ 0xea00000, 0x6400000, 0x6200000, 0xea00000, 0x6400000, 0xea00000, 0x6000000, 0x400000,
+ 0x6000000, 0x6000000, 0x6400000, 0x400000, 0x6400000, 0xea00000, 0x6400000, 0x6000000,
+ 0x6000000, 0x400000, 0x6000000, 0x6000000, 0x6400000, 0xea00000, 0x6400000, 0xea00000,
+ 0x4000000, 0x6000000, 0xea00000, 0xea00000, 0x4000000, 0x400000, 0x6000000, 0xea00000,
+ 0x6000000, 0x000000, 0xea00000, 0x4000000, 0x6200000, 0xea00000, 0x6000000, 0x6000000,
+ 0x6000000, 0xea00000, 0xea00000, 0x6200000, 0x5000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x5000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0xfa00000, 0x000000, 0x400000, 0x6000000, 0x400000, 0x6200000, 0x400000, 0x6400000,
+ 0x7200000, 0x7000000, 0x4400000, 0x6000000, 0x6400000, 0x400000, 0x5400000, 0x7000000,
+ 0xfa00000, 0x6400000, 0x5000000, 0x6400000, 0x7200000, 0x4000000, 0x6400000, 0x6400000,
+ 0x7200000, 0x7400000, 0x7000000, 0x400000, 0x200000, 0x1000000, 0x6400000, 0x6000000,
+ 0x400000, 0x000000, 0x6000000, 0x1000000, 0x1000000, 0x6000000, 0x400000, 0x6200000,
+ 0x6400000, 0x7200000, 0x6400000, 0xfa00000, 0xea00000, 0x6400000, 0x6400000, 0x4400000,
+ 0xfa00000, 0x000000, 0x000000, 0x400000, 0x6400000, 0x000000, 0x200000, 0x7200000,
+ 0x4400000, 0x7000000, 0x4200000, 0x6200000, 0x400000, 0x8c00000, 0x7200000, 0x6400000,
+ 0x000000, 0x400000, 0x200000, 0x7200000, 0x6400000, 0x7200000, 0xea00000, 0x7200000,
+ 0x000000, 0x6200000, 0x6400000, 0x6400000, 0x4200000, 0x400000, 0x6000000, 0x6200000,
+ 0x000000, 0x7400000, 0x6400000, 0x7200000, 0x6000000, 0x6400000, 0x6000000, 0x4400000
+};
+
+static const unsigned long unicode_backtrans_9b[] = {
+ 0x400000, 0x6400000, 0x4400000, 0x7400000, 0x6400000, 0x6400000, 0x6200000, 0x000000,
+ 0x7400000, 0x4400000, 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0x6400000, 0x5000000,
+ 0x6400000, 0x6000000, 0x6400000, 0x1000000, 0x4000000, 0x6000000, 0x6400000, 0x6000000,
+ 0x6200000, 0x6400000, 0xea00000, 0x400000, 0x400000, 0x000000, 0x6000000, 0x7200000,
+ 0x6400000, 0x000000, 0x6200000, 0x7200000, 0x6000000, 0x6200000, 0x400000, 0xea00000,
+ 0x6200000, 0x6200000, 0xca00000, 0x6400000, 0x000000, 0x4400000, 0x6200000, 0x7200000,
+ 0x000000, 0xea00000, 0x7200000, 0x6400000, 0x4400000, 0x6400000, 0x000000, 0x6400000,
+ 0x000000, 0x4400000, 0x6400000, 0x7200000, 0xfa00000, 0x400000, 0x6000000, 0x6000000,
+ 0x4000000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0x6000000, 0x1000000,
+ 0x7400000, 0x1000000, 0x6000000, 0x6400000, 0x6400000, 0x7200000, 0x6200000, 0xfa00000,
+ 0x4000000, 0x7200000, 0x6000000, 0x000000, 0xfa00000, 0x6400000, 0x6400000, 0x400000,
+ 0x6200000, 0x6000000, 0xea00000, 0x6400000, 0x000000, 0x000000, 0x400000, 0x6000000,
+ 0x6000000, 0x6400000, 0x000000, 0x400000, 0x6000000, 0x400000, 0x6400000, 0x6000000,
+ 0x6400000, 0x4000000, 0x400000, 0x400000, 0x6400000, 0x400000, 0x400000, 0xea00000,
+ 0x6000000, 0x6000000, 0x000000, 0x400000, 0x6200000, 0x6400000, 0x6000000, 0x6400000,
+ 0x400000, 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x4400000,
+ 0x6400000, 0x4000000, 0x6000000, 0x4200000, 0x400000, 0x6400000, 0x6400000, 0x6400000,
+ 0x6000000, 0x400000, 0x400000, 0x4400000, 0x000000, 0x4400000, 0xca00000, 0x4400000,
+ 0x6400000, 0xea00000, 0x6200000, 0x6200000, 0x400000, 0x6000000, 0x200000, 0x4200000,
+ 0x000000, 0x000000, 0x6400000, 0x6000000, 0x000000, 0x4400000, 0x6400000, 0xca00000,
+ 0x6200000, 0x6000000, 0x6000000, 0x000000, 0x6000000, 0x6000000, 0x6400000, 0x400000,
+ 0x6200000, 0x400000, 0x6200000, 0xea00000, 0x400000, 0x6200000, 0xea00000, 0x6000000,
+ 0x4400000, 0x400000, 0x400000, 0x000000, 0x200000, 0x6000000, 0x6000000, 0x400000,
+ 0x6400000, 0x6200000, 0x000000, 0x400000, 0x400000, 0x6000000, 0x400000, 0x6400000,
+ 0x6200000, 0x6400000, 0x000000, 0x6000000, 0x6000000, 0x000000, 0x6200000, 0x6400000,
+ 0x6400000, 0xea00000, 0x6200000, 0x000000, 0x000000, 0x000000, 0x400000, 0x4200000,
+ 0x400000, 0x200000, 0x200000, 0x6000000, 0x6200000, 0x6000000, 0xea00000, 0x6400000,
+ 0x400000, 0x6000000, 0x6000000, 0x6200000, 0x6000000, 0x4400000, 0x6000000, 0x400000,
+ 0x6000000, 0x6200000, 0x6200000, 0x200000, 0xea00000, 0x6400000, 0x6000000, 0x6400000,
+ 0xea00000, 0x4000000, 0x6400000, 0x6400000, 0x6000000, 0x4000000, 0x000000, 0x400000,
+ 0x6200000, 0x4200000, 0x200000, 0x400000, 0x4000000, 0x200000, 0x000000, 0x6400000,
+ 0x6400000, 0x400000, 0x400000, 0x000000, 0x000000, 0x6400000, 0x000000, 0x4400000
+};
+
+static const unsigned long unicode_backtrans_9c[] = {
+ 0x400000, 0x000000, 0x4400000, 0x000000, 0x200000, 0x6000000, 0x6200000, 0x6000000,
+ 0x6200000, 0x6200000, 0x4200000, 0x6400000, 0x4200000, 0xea00000, 0x6000000, 0x400000,
+ 0xca00000, 0x400000, 0xea00000, 0x6200000, 0x6200000, 0xca00000, 0x400000, 0x6000000,
+ 0x400000, 0x400000, 0x400000, 0x4200000, 0x6400000, 0x6000000, 0x400000, 0x4000000,
+ 0x4000000, 0x6200000, 0x400000, 0x6400000, 0x6200000, 0xea00000, 0x4400000, 0x400000,
+ 0x6400000, 0x6400000, 0x400000, 0x6000000, 0x6000000, 0x6200000, 0x200000, 0x4200000,
+ 0x200000, 0x6400000, 0xea00000, 0x6000000, 0x6000000, 0x4400000, 0x6400000, 0x6400000,
+ 0x000000, 0x6200000, 0x4200000, 0xea00000, 0x6000000, 0x6400000, 0x6200000, 0x6000000,
+ 0x6000000, 0x6400000, 0x000000, 0x400000, 0x6400000, 0x4400000, 0x6200000, 0x8a00000,
+ 0x6200000, 0xec00000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x4400000,
+ 0x6400000, 0x000000, 0x6200000, 0x4400000, 0x6400000, 0x6000000, 0x6400000, 0xea00000,
+ 0x6400000, 0x6000000, 0x200000, 0x400000, 0x400000, 0x4400000, 0x6400000, 0x6400000,
+ 0x6200000, 0x000000, 0x6000000, 0x6400000, 0x000000, 0x000000, 0x6000000, 0x6200000,
+ 0x6400000, 0x400000, 0x400000, 0x400000, 0x000000, 0x6000000, 0x6400000, 0x000000,
+ 0x400000, 0x6000000, 0x4400000, 0x6000000, 0x6000000, 0x6400000, 0x200000, 0x6400000,
+ 0x6200000, 0x6000000, 0x6000000, 0x4400000, 0x5000000, 0x000000, 0x000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x000000, 0x1000000, 0x000000, 0x000000, 0xea00000, 0x6400000, 0xea00000,
+ 0x000000, 0xea00000, 0x6000000, 0x200000, 0x200000, 0x6000000, 0x000000, 0x000000,
+ 0x200000, 0x6000000, 0x6400000, 0xea00000, 0xea00000, 0x6000000, 0xea00000, 0x6400000,
+ 0x000000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_9d[] = {
+ 0x6000000, 0x000000, 0x4400000, 0x6200000, 0x6000000, 0x6000000, 0x6200000, 0x6200000,
+ 0x6200000, 0xea00000, 0x000000, 0x400000, 0x4000000, 0x000000, 0x200000, 0x000000,
+ 0x6000000, 0x400000, 0x6200000, 0x000000, 0x6000000, 0x6200000, 0x4000000, 0x6400000,
+ 0x6400000, 0x6000000, 0x000000, 0xea00000, 0x400000, 0x6400000, 0x6400000, 0x6200000,
+ 0x6000000, 0x4000000, 0x6000000, 0x6200000, 0x000000, 0x6000000, 0xea00000, 0x000000,
+ 0xea00000, 0x6000000, 0x200000, 0x200000, 0x200000, 0x6000000, 0x6000000, 0x6400000,
+ 0x6400000, 0x6000000, 0x400000, 0x6400000, 0x4400000, 0x000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x4000000, 0x400000, 0xea00000, 0x400000, 0x6400000, 0x6200000, 0x6200000,
+ 0x6000000, 0x6200000, 0x6400000, 0x6400000, 0x4200000, 0x6400000, 0x200000, 0x400000,
+ 0x200000, 0x4000000, 0x6400000, 0x6000000, 0x6000000, 0x000000, 0x4000000, 0x6000000,
+ 0x4200000, 0xea00000, 0x6000000, 0x6400000, 0x6400000, 0x000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6200000, 0x6000000, 0x6000000, 0x6200000, 0xea00000, 0x4200000, 0x6400000,
+ 0xea00000, 0xea00000, 0x400000, 0x400000, 0x200000, 0x400000, 0x000000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6400000, 0x6400000, 0xea00000, 0x4000000, 0x4000000, 0x6200000,
+ 0x6400000, 0x6000000, 0xea00000, 0x6000000, 0x6000000, 0x6000000, 0x400000, 0x6400000,
+ 0x6000000, 0x6000000, 0x200000, 0x6400000, 0x4400000, 0x6000000, 0x4400000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x4400000, 0x6400000, 0x6000000, 0x6400000, 0x6200000,
+ 0x6000000, 0x6200000, 0x6400000, 0x6000000, 0x6000000, 0x400000, 0x400000, 0x200000,
+ 0x6000000, 0x000000, 0x6400000, 0x4400000, 0x6000000, 0x400000, 0x6400000, 0x6400000,
+ 0x6400000, 0x6000000, 0x6200000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x6200000, 0x4000000, 0x6000000, 0x6000000,
+ 0x6000000, 0xea00000, 0x6400000, 0x4200000, 0x6400000, 0x6000000, 0x400000, 0xea00000,
+ 0x000000, 0x6400000, 0x6200000, 0x6000000, 0xea00000, 0x6400000, 0x6000000, 0x6000000,
+ 0x6200000, 0x6400000, 0x6200000, 0x6200000, 0x6400000, 0x4000000, 0x6000000, 0x6400000,
+ 0x4000000, 0x6200000, 0x6200000, 0x6400000, 0xca00000, 0x6000000, 0x200000, 0x6400000,
+ 0x6000000, 0x4400000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6200000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6200000, 0x4400000, 0x6400000, 0x6400000, 0xec00000,
+ 0x6000000, 0x6200000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6400000,
+ 0x400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000, 0x6200000, 0x400000,
+ 0x6000000, 0x6400000, 0x000000, 0x6400000, 0x6000000, 0x6200000, 0x6400000, 0x6200000,
+ 0x6400000, 0x000000, 0xea00000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6000000,
+ 0xea00000, 0xea00000, 0xea00000, 0x6000000, 0x4000000, 0x6200000, 0x6400000, 0x6000000
+};
+
+static const unsigned long unicode_backtrans_9e[] = {
+ 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6400000,
+ 0x000000, 0x6000000, 0x4400000, 0x6000000, 0x4000000, 0x6000000, 0x4400000, 0x6000000,
+ 0x6400000, 0x6400000, 0x6400000, 0x6000000, 0x6000000, 0x6400000, 0x400000, 0x6000000,
+ 0x4000000, 0x6400000, 0xea00000, 0x6200000, 0x4400000, 0x6400000, 0xea00000, 0x5000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x000000, 0x1000000, 0x000000, 0x000000, 0x000000, 0x1000000, 0x000000, 0x1000000,
+ 0x1000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x000000, 0x000000,
+ 0x1000000, 0x1000000, 0x000000, 0x1000000, 0x000000, 0xea00000, 0x000000, 0x000000,
+ 0x200000, 0xea00000, 0x6400000, 0x4400000, 0x6400000, 0xea00000, 0x1000000, 0xfa00000,
+ 0x6400000, 0x4200000, 0x7400000, 0x6400000, 0x4400000, 0x4400000, 0x6000000, 0x7400000,
+ 0x7200000, 0x6000000, 0x6000000, 0x7200000, 0x6200000, 0x6000000, 0x6400000, 0x400000,
+ 0x4000000, 0x6200000, 0xfa00000, 0xfa00000, 0x6000000, 0x4200000, 0x4400000, 0xea00000,
+ 0x4400000, 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0xfa00000, 0x4400000, 0xfa00000,
+ 0x6000000, 0x6000000, 0x4000000, 0x000000, 0x6400000, 0xea00000, 0x5200000, 0x6000000,
+ 0x4400000, 0x6200000, 0x4200000, 0x4000000, 0x4400000, 0x6200000, 0x6400000, 0x4400000,
+ 0x6400000, 0x4000000, 0x000000, 0x400000, 0xfc00000, 0xec00000, 0x6000000, 0x6000000,
+ 0x1200000, 0x200000, 0x200000, 0xfa00000, 0x6200000, 0x5000000, 0xfa00000, 0x4200000,
+ 0x6000000, 0x4000000, 0x6000000, 0xe800000, 0x5200000, 0x000000, 0x4400000, 0x4000000,
+ 0x6400000, 0x1000000, 0x000000, 0x400000, 0x6200000, 0xfa00000, 0xfa00000, 0x7200000,
+ 0x6200000, 0xf800000, 0x200000, 0x6000000, 0xfa00000, 0x6400000, 0x6000000, 0x000000,
+ 0xfa00000, 0x200000, 0x6000000, 0xfa00000, 0xfa00000, 0x7200000, 0xea00000, 0x7400000,
+ 0x7200000, 0x000000, 0x5000000, 0x000000, 0x6400000, 0x7200000, 0x6000000, 0x7400000,
+ 0xea00000, 0x1000000, 0x1000000, 0x6000000, 0x400000, 0x6400000, 0x6400000, 0x7200000,
+ 0x6400000, 0x4400000, 0x6400000, 0x6000000, 0xea00000, 0x6400000, 0x6200000, 0x6200000,
+ 0x4400000, 0x7200000, 0x6000000, 0x7200000, 0x7200000, 0x6200000, 0x5000000, 0x6400000
+};
+
+static const unsigned long unicode_backtrans_9f[] = {
+ 0x6000000, 0x6000000, 0x4400000, 0x400000, 0x000000, 0x000000, 0x6000000, 0xea00000,
+ 0xca00000, 0x6400000, 0x6000000, 0x1000000, 0x000000, 0x1000000, 0xfa00000, 0x6400000,
+ 0x7400000, 0x400000, 0x6400000, 0xfa00000, 0x400000, 0x6200000, 0x6400000, 0x5400000,
+ 0x6000000, 0x7400000, 0x6400000, 0x6400000, 0x6000000, 0x000000, 0x6000000, 0x400000,
+ 0xfa00000, 0x200000, 0x7400000, 0x6000000, 0x6000000, 0x6000000, 0x4400000, 0x4000000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0x7200000, 0x6000000, 0x6000000, 0x7400000,
+ 0x6000000, 0x6400000, 0x6400000, 0x6000000, 0x6400000, 0x6000000, 0x6000000, 0x7400000,
+ 0x6000000, 0x5400000, 0x400000, 0xfa00000, 0x400000, 0x7400000, 0x7200000, 0x400000,
+ 0x6000000, 0x6400000, 0x6000000, 0x6400000, 0x5400000, 0x4400000, 0x6400000, 0x6400000,
+ 0x6000000, 0x6000000, 0xea00000, 0xea00000, 0x6000000, 0x6000000, 0xea00000, 0x6200000,
+ 0x5000000, 0x1000000, 0xea00000, 0x4400000, 0x6200000, 0x6400000, 0x6400000, 0x6400000,
+ 0x6400000, 0x6000000, 0x4400000, 0x6000000, 0x6000000, 0x6400000, 0x6400000, 0xea00000,
+ 0x6200000, 0xea00000, 0x4200000, 0x6200000, 0x6000000, 0x6000000, 0x6200000, 0xea00000,
+ 0x400000, 0x4400000, 0xea00000, 0x6000000, 0xea00000, 0x400000, 0x6400000, 0x6400000,
+ 0x6400000, 0x6400000, 0x6200000, 0x400000, 0x6000000, 0x6400000, 0x6200000, 0xea00000,
+ 0x6000000, 0x6000000, 0x6400000, 0x6000000, 0x000000, 0x400000, 0x6000000, 0x5000000,
+ 0x1000000, 0x000000, 0x000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000,
+ 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0x1000000, 0xea00000, 0x4000000, 0x400000,
+ 0xec00000, 0x6400000, 0x6400000, 0x000000, 0x6400000, 0xea00000, 0x400000, 0x400000,
+ 0x6000000, 0x5000000, 0x1000000, 0x1000000, 0xea00000, 0x200000, 0x400000, 0x5000000,
+ 0x7200000, 0x400000, 0x6400000, 0x400000, 0x6000000, 0x4400000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_ac[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_ad[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000
+};
+
+static const unsigned long unicode_backtrans_ae[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_af[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b0[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b1[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b2[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000
+};
+
+static const unsigned long unicode_backtrans_b3[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b4[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b5[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b6[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b7[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000
+};
+
+static const unsigned long unicode_backtrans_b8[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_b9[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_ba[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_bb[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000
+};
+
+static const unsigned long unicode_backtrans_bc[] = {
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_bd[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_be[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_bf[] = {
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c0[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c1[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c2[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c3[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c4[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000
+};
+
+static const unsigned long unicode_backtrans_c5[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000
+};
+
+static const unsigned long unicode_backtrans_c6[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c7[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c8[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_c9[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_ca[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_cb[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_cc[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_cd[] = {
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_ce[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_cf[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_d0[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_d1[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_d2[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_d3[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000
+};
+
+static const unsigned long unicode_backtrans_d4[] = {
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_d5[] = {
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_d6[] = {
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000
+};
+
+static const unsigned long unicode_backtrans_d7[] = {
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8800000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8800000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8000000, 0x8800000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x8000000,
+ 0x8800000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8800000, 0x8000000, 0x8000000,
+ 0x8000000, 0x8000000, 0x8000000, 0x8000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_e0[] = {
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x2000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_e1[] = {
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_e2[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x2000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_e3[] = {
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_e4[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x2000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_e5[] = {
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_e6[] = {
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_e7[] = {
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x5000000, 0x1000000, 0x1000000,
+ 0x5000000, 0x1000000, 0x5000000, 0x1000000, 0x5000000, 0x1000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x2000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_e8[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_e9[] = {
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_ea[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_eb[] = {
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x2000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_ec[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_ed[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_ee[] = {
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_ef[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_f0[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_f1[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_f2[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_f3[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_f4[] = {
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_f5[] = {
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x4000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_f6[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x4000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x4000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_f7[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000,
+ 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000
+};
+
+static const unsigned long unicode_backtrans_f8[] = {
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000,
+ 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x4000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x040000, 0x040000, 0x040000,
+ 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000,
+ 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000,
+ 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x040000, 0x060000
+};
+
+static const unsigned long unicode_backtrans_f9[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_fa[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_fb[] = {
+ 0x000000, 0x020000, 0x020000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_fe[] = {
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x6000000, 0x7000000, 0x000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000,
+ 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x7000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x4000000, 0x6000000, 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x000000,
+ 0x6000000, 0x6000000, 0x6000000, 0x6000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+static const unsigned long unicode_backtrans_ff[] = {
+ 0x000000, 0xfa00000, 0xd800000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xd800000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xf800000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xda00000, 0xfa00000, 0xda00000, 0x9a00000, 0xfa00000,
+ 0x9a00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000,
+ 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xfa00000, 0xd800000, 0x000000,
+ 0x000000, 0x008000, 0x008000, 0x008000, 0x2008000, 0x008000, 0x008000, 0x008000,
+ 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000,
+ 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000,
+ 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000,
+ 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000,
+ 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000,
+ 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000,
+ 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000, 0x008000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0xda00000, 0xda00000, 0xca00000, 0xfa00000, 0x4000000, 0xda00000, 0x8800000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x4000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000
+};
+
+const unsigned long *const unicode_backtrans[] = {
+ unicode_backtrans_0,
+ unicode_backtrans_1,
+ unicode_backtrans_2,
+ unicode_backtrans_3,
+ unicode_backtrans_4,
+ unicode_backtrans_5,
+ unicode_backtrans_6,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ unicode_backtrans_e,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ unicode_backtrans_1e,
+ l_allzeros,
+ unicode_backtrans_20,
+ unicode_backtrans_21,
+ unicode_backtrans_22,
+ unicode_backtrans_23,
+ unicode_backtrans_24,
+ unicode_backtrans_25,
+ unicode_backtrans_26,
+ unicode_backtrans_27,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ unicode_backtrans_2e,
+ unicode_backtrans_2f,
+ unicode_backtrans_30,
+ unicode_backtrans_31,
+ unicode_backtrans_32,
+ unicode_backtrans_33,
+ unicode_backtrans_34,
+ unicode_backtrans_35,
+ unicode_backtrans_36,
+ unicode_backtrans_37,
+ unicode_backtrans_38,
+ unicode_backtrans_39,
+ unicode_backtrans_3a,
+ unicode_backtrans_3b,
+ unicode_backtrans_3c,
+ unicode_backtrans_3d,
+ unicode_backtrans_3e,
+ unicode_backtrans_3f,
+ unicode_backtrans_40,
+ unicode_backtrans_41,
+ unicode_backtrans_42,
+ unicode_backtrans_43,
+ unicode_backtrans_44,
+ unicode_backtrans_45,
+ unicode_backtrans_46,
+ unicode_backtrans_47,
+ unicode_backtrans_48,
+ unicode_backtrans_49,
+ unicode_backtrans_4a,
+ unicode_backtrans_4b,
+ unicode_backtrans_4c,
+ unicode_backtrans_4d,
+ unicode_backtrans_4e,
+ unicode_backtrans_4f,
+ unicode_backtrans_50,
+ unicode_backtrans_51,
+ unicode_backtrans_52,
+ unicode_backtrans_53,
+ unicode_backtrans_54,
+ unicode_backtrans_55,
+ unicode_backtrans_56,
+ unicode_backtrans_57,
+ unicode_backtrans_58,
+ unicode_backtrans_59,
+ unicode_backtrans_5a,
+ unicode_backtrans_5b,
+ unicode_backtrans_5c,
+ unicode_backtrans_5d,
+ unicode_backtrans_5e,
+ unicode_backtrans_5f,
+ unicode_backtrans_60,
+ unicode_backtrans_61,
+ unicode_backtrans_62,
+ unicode_backtrans_63,
+ unicode_backtrans_64,
+ unicode_backtrans_65,
+ unicode_backtrans_66,
+ unicode_backtrans_67,
+ unicode_backtrans_68,
+ unicode_backtrans_69,
+ unicode_backtrans_6a,
+ unicode_backtrans_6b,
+ unicode_backtrans_6c,
+ unicode_backtrans_6d,
+ unicode_backtrans_6e,
+ unicode_backtrans_6f,
+ unicode_backtrans_70,
+ unicode_backtrans_71,
+ unicode_backtrans_72,
+ unicode_backtrans_73,
+ unicode_backtrans_74,
+ unicode_backtrans_75,
+ unicode_backtrans_76,
+ unicode_backtrans_77,
+ unicode_backtrans_78,
+ unicode_backtrans_79,
+ unicode_backtrans_7a,
+ unicode_backtrans_7b,
+ unicode_backtrans_7c,
+ unicode_backtrans_7d,
+ unicode_backtrans_7e,
+ unicode_backtrans_7f,
+ unicode_backtrans_80,
+ unicode_backtrans_81,
+ unicode_backtrans_82,
+ unicode_backtrans_83,
+ unicode_backtrans_84,
+ unicode_backtrans_85,
+ unicode_backtrans_86,
+ unicode_backtrans_87,
+ unicode_backtrans_88,
+ unicode_backtrans_89,
+ unicode_backtrans_8a,
+ unicode_backtrans_8b,
+ unicode_backtrans_8c,
+ unicode_backtrans_8d,
+ unicode_backtrans_8e,
+ unicode_backtrans_8f,
+ unicode_backtrans_90,
+ unicode_backtrans_91,
+ unicode_backtrans_92,
+ unicode_backtrans_93,
+ unicode_backtrans_94,
+ unicode_backtrans_95,
+ unicode_backtrans_96,
+ unicode_backtrans_97,
+ unicode_backtrans_98,
+ unicode_backtrans_99,
+ unicode_backtrans_9a,
+ unicode_backtrans_9b,
+ unicode_backtrans_9c,
+ unicode_backtrans_9d,
+ unicode_backtrans_9e,
+ unicode_backtrans_9f,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ unicode_backtrans_ac,
+ unicode_backtrans_ad,
+ unicode_backtrans_ae,
+ unicode_backtrans_af,
+ unicode_backtrans_b0,
+ unicode_backtrans_b1,
+ unicode_backtrans_b2,
+ unicode_backtrans_b3,
+ unicode_backtrans_b4,
+ unicode_backtrans_b5,
+ unicode_backtrans_b6,
+ unicode_backtrans_b7,
+ unicode_backtrans_b8,
+ unicode_backtrans_b9,
+ unicode_backtrans_ba,
+ unicode_backtrans_bb,
+ unicode_backtrans_bc,
+ unicode_backtrans_bd,
+ unicode_backtrans_be,
+ unicode_backtrans_bf,
+ unicode_backtrans_c0,
+ unicode_backtrans_c1,
+ unicode_backtrans_c2,
+ unicode_backtrans_c3,
+ unicode_backtrans_c4,
+ unicode_backtrans_c5,
+ unicode_backtrans_c6,
+ unicode_backtrans_c7,
+ unicode_backtrans_c8,
+ unicode_backtrans_c9,
+ unicode_backtrans_ca,
+ unicode_backtrans_cb,
+ unicode_backtrans_cc,
+ unicode_backtrans_cd,
+ unicode_backtrans_ce,
+ unicode_backtrans_cf,
+ unicode_backtrans_d0,
+ unicode_backtrans_d1,
+ unicode_backtrans_d2,
+ unicode_backtrans_d3,
+ unicode_backtrans_d4,
+ unicode_backtrans_d5,
+ unicode_backtrans_d6,
+ unicode_backtrans_d7,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ l_allzeros,
+ unicode_backtrans_e0,
+ unicode_backtrans_e1,
+ unicode_backtrans_e2,
+ unicode_backtrans_e3,
+ unicode_backtrans_e4,
+ unicode_backtrans_e5,
+ unicode_backtrans_e6,
+ unicode_backtrans_e7,
+ unicode_backtrans_e8,
+ unicode_backtrans_e9,
+ unicode_backtrans_ea,
+ unicode_backtrans_eb,
+ unicode_backtrans_ec,
+ unicode_backtrans_ed,
+ unicode_backtrans_ee,
+ unicode_backtrans_ef,
+ unicode_backtrans_f0,
+ unicode_backtrans_f1,
+ unicode_backtrans_f2,
+ unicode_backtrans_f3,
+ unicode_backtrans_f4,
+ unicode_backtrans_f5,
+ unicode_backtrans_f6,
+ unicode_backtrans_f7,
+ unicode_backtrans_f8,
+ unicode_backtrans_f9,
+ unicode_backtrans_fa,
+ unicode_backtrans_fb,
+ l_allzeros,
+ l_allzeros,
+ unicode_backtrans_fe,
+ unicode_backtrans_ff
+};
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/char.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/char.c
index 58efa6426de..b21811db032 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/char.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/char.c
@@ -29,13 +29,6 @@
#include <utype.h>
#include "ustring.h"
-#ifdef LUA_FF_LIB
-extern int unic_tolower(int);
-#define Tolower unic_tolower
-#else
-#define Tolower tolower
-#endif
-
char *strstart(const char *initial, const char *full) {
int ch1, ch2;
for (;;) {
@@ -53,8 +46,8 @@ char *strstartmatch(const char *initial, const char *full) {
ch1 = *initial++; ch2 = *full++ ;
if ( ch1=='\0' )
return( (char *) full );
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' )
return(NULL);
}
@@ -64,8 +57,8 @@ int strmatch(const char *str1, const char *str2) {
int ch1, ch2;
for (;;) {
ch1 = *str1++; ch2 = *str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' )
return(ch1-ch2);
}
@@ -75,8 +68,8 @@ int strnmatch(const char *str1, const char *str2, int n) {
int ch1, ch2;
for (;n-->0;) {
ch1 = *str1++; ch2 = *str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' )
return(ch1-ch2);
}
@@ -91,8 +84,8 @@ char *strstrmatch(const char *longer, const char *substr) {
str1 = lpt; str2 = substr;
for (;;) {
ch1 = *str1++; ch2 = *str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch2=='\0' )
return((char *) lpt);
if ( ch1!=ch2 )
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/cjk.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/cjk.c
index f3362ad43db..a2f01f3131a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/cjk.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/cjk.c
@@ -1107,8 +1107,8 @@ const unichar_t unicode_from_jis208[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x9fa5, 0x1c2a, 0xbfffe018, 0x4204f04f,
- 0x804ef70, 0x0000, 0x2288, 0x804f240, 0x42130a14, 0x40015360, 0xbfffe038, 0x804bcc9
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x9fa5, 0x1c2a, 0xbfffee18, 0x4204f04f,
+ 0x804ef70, 0x0000, 0x2288, 0x804f240, 0x42130a14, 0x40015360, 0xbfffee38, 0x804bcc9
};
const unichar_t unicode_from_jis212[] = {
@@ -2220,7 +2220,6 @@ const unichar_t unicode_from_jis212[] = {
0xff0e, 0x30fb, 0xff1a, 0xff1b, 0xff1f, 0xff01, 0x309b, 0x309c
};
-#ifndef LUA_FF_LIB
static const unsigned short jis_from_unicode_0[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -5805,11 +5804,8 @@ static const unsigned short * const jis_from_unicode_[] = {
jis_from_unicode_ff
};
-
struct charmap2 jis_from_unicode = { 0, 255, (unsigned short **) jis_from_unicode_, (unichar_t *) unicode_from_jis212 };
-#endif
-
const unichar_t unicode_from_big5[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -8886,7 +8882,6 @@ const unichar_t unicode_from_big5[] = {
0xfe4f, 0xffffffff, 0x00ff, 0x0000, 0x0100, 0x0002, 0x6000, 0x804f240
};
-#ifndef LUA_FF_LIB
static const unsigned short big5_from_unicode_0[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -12718,8 +12713,6 @@ static const unsigned short * const big5_from_unicode_[] = {
struct charmap2 big5_from_unicode = { 0, 255, (unsigned short **) big5_from_unicode_, (unichar_t *) unicode_from_big5 };
-#endif
-
const unichar_t unicode_from_big5hkscs[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -16820,8 +16813,6 @@ const unichar_t unicode_from_big5hkscs[] = {
0x79d4, 0xfefe, 0x00ff, 0x0000, 0x0100, 0x0005, 0x8000, 0x804f240
};
-#ifndef LUA_FF_LIB
-
static const unsigned short big5hkscs_from_unicode_0[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -22543,8 +22534,6 @@ static const unsigned short * const big5hkscs_from_unicode_[] = {
struct charmap2 big5hkscs_from_unicode = { 0, 255, (unsigned short **) big5hkscs_from_unicode_, (unichar_t *) unicode_from_big5hkscs };
-#endif
-
const unichar_t unicode_from_ksc5601[] = {
0x3164, 0x3001, 0x3002, 0x30fb, 0x2025, 0x22ef, 0x00a8, 0x3003,
0x2013, 0x2014, 0x2016, 0xff3c, 0xff5e, 0x2018, 0x2019, 0x201c,
@@ -23654,8 +23643,6 @@ const unichar_t unicode_from_ksc5601[] = {
0xffffffff, 0xffffffff, 0x0000, 0x0000, 0x79d4, 0x0004, 0x2288, 0x804f240
};
-#ifndef LUA_FF_LIB
-
static unsigned short ksc5601_from_unicode_0[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -28922,8 +28909,6 @@ static const unsigned short * const ksc5601_from_unicode_[] = {
struct charmap2 ksc5601_from_unicode = { 0, 255, (unsigned short **) ksc5601_from_unicode_, (unichar_t *) unicode_from_ksc5601 };
-#endif
-
const unichar_t unicode_from_johab[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -32896,8 +32881,6 @@ const unichar_t unicode_from_johab[] = {
0x3164, 0x3001, 0x3002, 0x30fb, 0x2025, 0x22ef, 0x00a8, 0x3003
};
-#ifndef LUA_FF_LIB
-
static unsigned short johab_from_unicode_0[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -38164,10 +38147,8 @@ static const unsigned short * const johab_from_unicode_[] = {
struct charmap2 johab_from_unicode = { 0, 255, (unsigned short **) johab_from_unicode_, (unichar_t *) unicode_from_johab };
-#endif
-
const unichar_t unicode_from_gb2312[] = {
- 0x3000, 0x3001, 0x3002, 0x30fb, 0x02c9, 0x02c7, 0x00a8, 0x3003,
+ 0x3000, 0x3001, 0x3002, 0x00b7, 0x02c9, 0x02c7, 0x00a8, 0x3003,
0x3005, 0x2014, 0xff5e, 0x2016, 0x2026, 0x2018, 0x2019, 0x201c,
0x201d, 0x3014, 0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c,
0x300d, 0x300e, 0x300f, 0x3016, 0x3017, 0x3010, 0x3011, 0x00b1,
@@ -38236,7 +38217,7 @@ const unichar_t unicode_from_gb2312[] = {
0xe78f, 0xe790, 0xe791, 0xe792, 0xe793, 0xfe35, 0xfe36, 0xfe39,
0xfe3a, 0xfe3f, 0xfe40, 0xfe3d, 0xfe3e, 0xfe41, 0xfe42, 0xfe43,
0xfe44, 0xe794, 0xe795, 0xfe3b, 0xfe3c, 0xfe37, 0xfe38, 0xfe31,
- 0xe796, 0xfe33, 0xfe34, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x205d, 0xfe33, 0xfe34, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0410, 0x0411, 0x0412, 0x0413,
0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a,
0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422,
@@ -39275,8 +39256,6 @@ const unichar_t unicode_from_gb2312[] = {
0x0100, 0x0003, 0x2288, 0x804f240, 0x0100, 0x0005, 0x00f8, 0x42130a14
};
-#ifndef LUA_FF_LIB
-
static unsigned short gb2312_from_unicode_0[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -39300,7 +39279,7 @@ static unsigned short gb2312_from_unicode_0[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x2168, 0x0000, 0x0000, 0x216c,
0x2127, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2163, 0x2140, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2163, 0x2140, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2124,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -39499,7 +39478,7 @@ static unsigned short gb2312_from_unicode_20[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2673, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -39764,7 +39743,7 @@ static unsigned short gb2312_from_unicode_30[] = {
0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567,
0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x256d, 0x256e, 0x256f,
0x2570, 0x2571, 0x2572, 0x2573, 0x2574, 0x2575, 0x2576, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x2124, 0x0000, 0x0000, 0x0000, 0x0000
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
static unsigned short gb2312_from_unicode_31[] = {
@@ -42691,7 +42670,7 @@ static unsigned short gb2312_from_unicode_e7[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2659, 0x265a, 0x265b,
- 0x265c, 0x265d, 0x265e, 0x265f, 0x266c, 0x266d, 0x2673, 0x0000,
+ 0x265c, 0x265d, 0x265e, 0x265f, 0x266c, 0x266d, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -43038,4 +43017,3 @@ static const unsigned short * const gb2312_from_unicode_[] = {
struct charmap2 gb2312_from_unicode = { 0, 255, (unsigned short **) gb2312_from_unicode_, (unichar_t *) unicode_from_gb2312 };
-#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/combiners.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/combiners.h
new file mode 100644
index 00000000000..d26960feb95
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/combiners.h
@@ -0,0 +1,1014 @@
+static const int poses300[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above, /* 0x310 */
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above|_CenterRight,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Above,
+ _Above|_Right|_Touching,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below, /* 0x320 */
+ _Below|_Touching,
+ _Below|_Touching,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below|_Touching,
+ _Below|_Touching, /* 0x328 */
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below, /* 0x330 */
+ _Below,
+ _Below,
+ _Below,
+ _Overstrike,
+ _Overstrike,
+ _Overstrike,
+ _Overstrike,
+ _Overstrike, /* 0x338 */
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Above,
+ _Above,
+ _Above,
+ _Above|_Left, /* 0x340 */
+ _Above|_Right,
+ _Above,
+ _Above,
+ _Above,
+ _Below,
+ 0
+};
+static const int poses360[] = {
+ _Above|_Joins2,
+ _Above|_Joins2,
+ _Below|_Joins2,
+ 0
+};
+static const int poses385[] = {
+ _Above
+};
+static const int poses483[] = {
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ 0
+};
+
+static const int poses488[] = {
+ _CenteredOutside, /* 8 down half-circles distributed in a circle around the character */
+ _CenteredOutside /* 8 commas rotated as moved around circle, bottom is normal comma */
+};
+
+static const int poses591[] = {
+ _Below,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Below|_CenterRight,
+ _Above,
+ _Above,
+ _Above|_LeftEdge,
+ _Below|_RightEdge,
+ _Below,
+ _Above|_CenterRight,
+ _Above|_RightEdge,
+ _Above|_CenterRight,
+ _Above,
+ _Above|_RightEdge, /* 05a0 */
+ _Above|_LeftEdge
+};
+
+static const int poses5A3[] = {
+ _Below,
+ _Below,
+ _Below|_CenterLeft,
+ _Below|_CenterLeft,
+ _Below,
+ _Above|_CenterLeft,
+ _Above|_LeftEdge,
+ _Below,
+ _Above,
+ _Above,
+ _Below|_RightEdge,
+ _Above|_LeftEdge,
+ _Above,
+ _Below, /* 05b0 */
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Above|_LeftEdge
+};
+
+static const int poses5BB[] = {
+ _Below,
+ _Overstrike,
+ _Below
+};
+
+static const int poses5BF[] = {
+ _Above
+};
+
+static const int poses5C1[] = {
+ _Above|_RightEdge,
+ _Above|_LeftEdge
+};
+
+static const int poses5C4[] = {
+ _Above
+};
+
+static const int poses64b[] = {
+ _Above,
+ _Above,
+ _Below,
+ _Above,
+ _Above,
+ _Below,
+ _Above,
+ _Above,
+ 0
+};
+
+static const int poses670[] = {
+ _Above
+};
+
+static const int poses6D6[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Overstrike,
+ _Overstrike,
+ _Above,
+ _Above, /* 6e0 */
+ _Above,
+ _Above,
+ _Below,
+ _Above
+};
+
+static const int poses6E7[] = {
+ _Above,
+ _Above
+};
+
+static const int poses6EA[] = {
+ _Below,
+ _Above,
+ _Above,
+ _Below
+};
+
+static const int poses711[] = {
+ _Above
+};
+
+static const int poses730[] = {
+ _Above,
+ _Below,
+ _CenteredOutside, /* Two dots, one above CenterRight, one below CenterLeft */
+ _Above,
+ _Below,
+ _Above,
+ _Above,
+ _Below,
+ _Below,
+ _Below,
+ _Above,
+ _Below,
+ _Below,
+ _Above,
+ _Below,
+ _Above,
+ _Above|_LeftEdge, /* 0740 */
+ _Above,
+ _Below,
+ _Above,
+ _Below,
+ _Above,
+ _Below,
+ _Above,
+ _Below,
+ _Above,
+ _Above
+};
+
+static const int poses7A6[] = {
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Below|_CenterLeft,
+ _Below|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+};
+
+static const int poses901[] = {
+ _Above,
+ _Above,
+ _Right
+};
+
+static const int poses93C[] = {
+ _Below
+};
+
+static const int poses93E[] = {
+ _Right,
+ _Left,
+ _Right, /* 940 */
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Above,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Right,
+ _Right,
+ _Right,
+ _Right,
+ _Below|_CenterRight
+};
+
+static const int poses951[] = {
+ _Above,
+ _Below,
+ _Above,
+ _Above
+};
+
+static const int poses962[] = {
+ _Below,
+ _Below
+};
+
+static const int poses981[] = {
+ _Above,
+ _Right,
+ _Right
+};
+
+static const int poses9BC[] = {
+ _Below
+};
+
+static const int poses9BE[] = {
+ _Right,
+ _Left,
+ _Right,
+ _Below,
+ _Below,
+ _Below,
+ _Below|_CenterRight
+};
+
+static const int poses9C7[] = {
+ _Left,
+ _Left
+};
+
+static const int poses9CB[] = {
+ _Overstrike,
+ _Overstrike,
+ _Below
+};
+
+static const int poses9D7[] = {
+ _Right
+};
+
+static const int poses9E2[] = {
+ _Below,
+ _Below
+};
+
+static const int posesA02[] = {
+ _Above
+};
+
+static const int posesA3C[] = {
+ _Below
+};
+
+static const int posesA3E[] = {
+ _Right,
+ _Left,
+ _Right, /* 0a40 */
+ _Below,
+ _Below
+};
+
+static const int posesA47[] = {
+ _Above|_CenterLeft,
+ _Above|_CenterLeft
+};
+
+static const int posesA4B[] = {
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Below
+};
+
+static const int posesA70[] = {
+ _Above,
+ _Above
+};
+
+static const int posesA81[] = {
+ _Above,
+ _Above,
+ _Right
+};
+
+static const int posesABC[] = {
+ _Below
+};
+
+static const int posesABE[] = {
+ _Right,
+ _Left,
+ _Right,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Above
+};
+
+static const int posesAC7[] = {
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Right
+};
+
+static const int posesACB[] = {
+ _Right,
+ _Right,
+ _Below|_CenterRight
+};
+
+static const int posesB01[] = {
+ _Above,
+ _Above,
+ _Right
+};
+
+static const int posesB3C[] = {
+ _Below
+};
+
+static const int posesB3E[] = {
+ _Right,
+ _Above,
+ _Right, /* 0b40 */
+ _Below,
+ _Below,
+ _Below
+};
+
+static const int posesB47[] = {
+ _Left,
+ _Outside|_Left|_Above
+};
+
+static const int posesB4B[] = {
+ _CenteredOutside,
+ _CenteredOutside,
+ _Below
+};
+
+static const int posesB56[] = {
+ _Above,
+ _Right,
+};
+
+static const int posesB82[] = {
+ _Above,
+ _Right
+};
+
+static const int posesBBE[] = {
+ _Right,
+ _Right,
+ _Above,
+ _Right,
+ _Right
+};
+
+static const int posesBC6[] = {
+ _Left,
+ _Left,
+ _Left
+};
+
+static const int posesBCA[] = {
+ _CenteredOutside,
+ _CenteredOutside,
+ _CenteredOutside,
+ _Above
+};
+
+static const int posesBD7[] = {
+ _Right
+};
+
+static const int posesC01[] = {
+ _Right,
+ _Right,
+ _Right
+};
+
+static const int posesC3E[] = {
+ _Above|_CenterRight,
+ _Above,
+ _Above,
+ _Right,
+ _Right,
+ _Right,
+ _Right
+};
+
+static const int posesC46[] = {
+ _Above,
+ _Above,
+ _CenteredOutside
+};
+
+static const int posesC4A[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above
+};
+
+static const int posesC55[] = {
+ _Above,
+ _Below
+};
+
+static const int posesC82[] = {
+ _Right,
+ _Right
+};
+
+static const int posesCBE[] = {
+ _Right,
+ _Above,
+ _Outside|_Above|_Right,
+ _Right,
+ _Right,
+ _Right,
+ _Right
+};
+
+static const int posesCC6[] = {
+ _Above,
+ _Outside|_Above|_Right,
+ _Outside|_Above|_Right
+};
+
+static const int posesCCA[] = {
+ _Outside|_Above|_Right,
+ _Outside|_Above|_Right,
+ _Above,
+ _Above
+};
+
+static const int posesCD5[] = {
+ _Right,
+ _Right
+};
+
+static const int posesD02[] = {
+ _Right,
+ _Right
+};
+
+static const int posesD3E[] = {
+ _Right,
+ _Right,
+ _Right,
+ _Below|_Right,
+ _Below|_Right,
+ _Below
+};
+
+static const int posesD46[] = {
+ _Left,
+ _Left,
+ _Left
+};
+
+static const int posesD4A[] = {
+ _Outside|_Left|_Right,
+ _Outside|_Left|_Right,
+ _Outside|_Left|_Right,
+ _Above|_Right
+};
+
+static const int posesD57[] = {
+ _Right
+};
+
+static const int posesD82[] = {
+ _Right,
+ _Right
+};
+
+static const int posesDCA[] = {
+ _Right
+};
+
+static const int posesDCF[] = {
+ _Right,
+ _Right,
+ _Right,
+ _Above,
+ _Above,
+ _Below
+};
+
+static const int posesDD6[] = {
+ _Below
+};
+
+static const int posesDD8[] = {
+ _Right,
+ _Left,
+ _CenteredOutside,
+ _Left,
+ _CenteredOutside,
+ _CenteredOutside,
+ _CenteredOutside,
+ _Right
+};
+
+static const int posesDF2[] = {
+ _Right,
+ _Right
+};
+
+static const int posesE31[] = {
+ _Above
+};
+
+static const int posesE34[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Below|_Right,
+ _Below|_CenterRight,
+ _Below|_Right
+};
+
+static const int posesE47[] = {
+ _Above,
+ _Above|_Right,
+ _Above,
+ _Above,
+ _Above|_CenterRight,
+ _Above,
+ _Above|_Right,
+ _Above|_Right,
+};
+
+static const int posesEB1[] = {
+ _Above
+};
+
+static const int posesEB4[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Below,
+ _Below
+};
+
+static const int posesEBB[] = {
+ _Above,
+ _Below
+};
+
+static const int posesEC8[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above
+};
+
+static const int posesF18[] = {
+ _Below|_Right
+};
+
+static const int posesF35[] = {
+ _Below
+};
+
+static const int posesF37[] = {
+ _Below
+};
+
+static const int posesF39[] = {
+ _Above|_Right|_Touching
+};
+
+static const int posesF3E[] = {
+ _Below|_Right,
+ _Below|_Left
+};
+
+static const int posesF71[] = {
+ _Below,
+ _Above,
+ _Outside|_Above|_Below,
+ _Below,
+ _Below,
+ _Outside|_Above|_Below,
+ _Outside|_Above|_Below,
+ _Outside|_Above|_Below,
+ _Outside|_Above|_Below,
+ _Above|_CenterLeft,
+ _Above|_CenterLeft,
+ _Above,
+ _Above,
+ _Above,
+ _Right,
+ _Above, /* 0f80 */
+ _Outside|_Above|_Below,
+ _Above,
+ _Above,
+ _Below|_Left
+};
+
+static const int posesF86[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above
+};
+
+static const int posesF90[] = {
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below
+};
+
+static const int posesF99[] = {
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below,
+ _Below
+};
+
+static const int posesFC6[] = {
+ _Below
+};
+
+static const int poses102C[] = {
+ _Right,
+ _Above,
+ _Above,
+ _Below,
+ _Below, /* 1030 */
+ _Left,
+ _Above
+};
+
+static const int poses1036[] = {
+ _Above,
+ _Below,
+ _Right,
+ _Above
+};
+
+static const int poses1056[] = {
+ _Right,
+ _Right,
+ _Below,
+ _Below
+};
+
+static const int poses17B4[] = {
+ _Overstrike,
+ _Overstrike,
+ _Right,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Below,
+ _Below,
+ _Below,
+ _Outside|_Left|_Above,
+ _CenteredOutside,
+ _CenteredOutside, /* 17c0 */
+ _Left,
+ _Left,
+ _Left,
+ _CenteredOutside,
+ _CenteredOutside,
+ _Above,
+ _Right,
+ _Right,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Above|_CenterRight,
+ _Above|_CenterRight,
+ _Above,
+ _Above|_CenterRight, /* 17d0 */
+ _Above,
+ _Below,
+ _Above
+};
+
+static const int poses18A9[] = {
+ _Above|_Left
+};
+
+static const int poses1FBD[] = { /* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
+ _Above,
+ _Right,
+ _Above,
+ _Above,
+ _Above
+};
+
+static const int poses1FCD[] = { /* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
+ _Above,
+ _Above,
+ _Above
+};
+
+static const int poses1FDD[] = { /* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
+ _Above,
+ _Above,
+ _Above
+};
+
+static const int poses1FED[] = { /* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
+ _Above,
+ _Above,
+ _Above
+};
+
+static const int poses1FFD[] = { /* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
+ _Above,
+ _Above
+};
+
+static const int poses20D0[] = {
+ _Above,
+ _Above,
+ _Overstrike,
+ _Overstrike,
+ _Above,
+ _Above,
+ _Above,
+ _Above,
+ _Overstrike,
+ _Overstrike,
+ _Overstrike,
+ _Above,
+ _Above,
+ _CenteredOutside,
+ _CenteredOutside,
+ _CenteredOutside,
+ _Overstrike,
+ _Above,
+ _CenteredOutside,
+ _CenteredOutside
+};
+
+static const int poses302A[] = {
+ _Below|_Left,
+ _Above|_Left,
+ _Above|_Right,
+ _Below|_Right,
+ _Left,
+ _Left
+};
+
+static const int poses3099[] = {
+ _Above|_Right,
+ _Above|_Right,
+};
+
+static const int posesFB1E[] = {
+ _Above
+};
+
+static const int posesFE20[] = {
+ _Above,
+ _Above,
+ _Above,
+ _Above
+};
+
+const static struct {
+ int low, high;
+ const int *pos;
+} combiners[] = {
+ { 0x300, 0x345, poses300 },
+ { 0x360, 0x362, poses360 },
+ { 0x385, 0x385, poses385 },
+ { 0x483, 0x486, poses483 },
+ { 0x488, 0x489, poses488 },
+ { 0x591, 0x5A1, poses591 },
+ { 0x5A3, 0x5B9, poses5A3 },
+ { 0x5BB, 0x5BD, poses5BB },
+ { 0x5BF, 0x5BF, poses5BF },
+ { 0x5C1, 0x5C2, poses5C1 },
+ { 0x5C4, 0x5C4, poses5C4 },
+ { 0x64b, 0x655, poses64b },
+ { 0x670, 0x670, poses670 },
+ { 0x6D6, 0x6E4, poses6D6 },
+ { 0x6E7, 0x6E8, poses6E7 },
+ { 0x6EA, 0x6ED, poses6EA },
+ { 0x711, 0x711, poses711 },
+ { 0x730, 0x74A, poses730 },
+ { 0x7A6, 0x7B0, poses7A6 },
+ { 0x901, 0x903, poses901 },
+ { 0x93C, 0x93C, poses93C },
+ { 0x93E, 0x94D, poses93E },
+ { 0x951, 0x954, poses951 },
+ { 0x962, 0x963, poses962 },
+ { 0x981, 0x983, poses981 },
+ { 0x9BC, 0x9BC, poses9BC },
+ { 0x9BE, 0x9C4, poses9BE },
+ { 0x9C7, 0x9C8, poses9C7 },
+ { 0x9CB, 0x9CD, poses9CB },
+ { 0x9D7, 0x9D7, poses9D7 },
+ { 0x9E2, 0x9E3, poses9E2 },
+ { 0xA02, 0xA02, posesA02 },
+ { 0xA3C, 0xA3C, posesA3C },
+ { 0xA3E, 0xA42, posesA3E },
+ { 0xA47, 0xA48, posesA47 },
+ { 0xA4B, 0xA4D, posesA4B },
+ { 0xA70, 0xA71, posesA70 },
+ { 0xA81, 0xA83, posesA81 },
+ { 0xABC, 0xABC, posesABC },
+ { 0xABE, 0xAC5, posesABE },
+ { 0xAC7, 0xAC9, posesAC7 },
+ { 0xACB, 0xACD, posesACB },
+ { 0xB01, 0xB03, posesB01 },
+ { 0xB3C, 0xB3C, posesB3C },
+ { 0xB3E, 0xB43, posesB3E },
+ { 0xB47, 0xB48, posesB47 },
+ { 0xB4B, 0xB4D, posesB4B },
+ { 0xB56, 0xB56, posesB56 },
+ { 0xB82, 0xB83, posesB82 },
+ { 0xBBE, 0xBC2, posesBBE },
+ { 0xBC6, 0xBC8, posesBC6 },
+ { 0xBCA, 0xBCD, posesBCA },
+ { 0xBD7, 0xBD7, posesBD7 },
+ { 0xC01, 0xC03, posesC01 },
+ { 0xC3E, 0xC44, posesC3E },
+ { 0xC46, 0xC48, posesC46 },
+ { 0xC4A, 0xC4D, posesC4A },
+ { 0xC55, 0xC56, posesC55 },
+ { 0xC82, 0xC83, posesC82 },
+ { 0xCBE, 0xCC4, posesCBE },
+ { 0xCC6, 0xCC8, posesCC6 },
+ { 0xCCA, 0xCCD, posesCCA },
+ { 0xCD5, 0xCD6, posesCD5 },
+ { 0xD02, 0xD03, posesD02 },
+ { 0xD3E, 0xD43, posesD3E },
+ { 0xD46, 0xD48, posesD46 },
+ { 0xD4A, 0xD4D, posesD4A },
+ { 0xD57, 0xD57, posesD57 },
+ { 0xD82, 0xD83, posesD82 },
+ { 0xDCA, 0xDCA, posesDCA },
+ { 0xDCF, 0xDD4, posesDCF },
+ { 0xDD6, 0xDD6, posesDD6 },
+ { 0xDD8, 0xDDF, posesDD8 },
+ { 0xDF2, 0xDF3, posesDF2 },
+ { 0xE31, 0xE31, posesE31 },
+ { 0xE34, 0xE3A, posesE34 },
+ { 0xE47, 0xE4e, posesE47 },
+ { 0xEB1, 0xEB1, posesEB1 },
+ { 0xEB4, 0xEB9, posesEB4 },
+ { 0xEBB, 0xEBC, posesEBB },
+ { 0xEC8, 0xECD, posesEC8 },
+ { 0xF18, 0xF19, posesF18 },
+ { 0xF35, 0xF35, posesF35 },
+ { 0xF37, 0xF37, posesF37 },
+ { 0xF39, 0xF39, posesF39 },
+ { 0xF3E, 0xF3F, posesF3E },
+ { 0xF71, 0xF84, posesF71 },
+ { 0xF86, 0xF87, posesF86 },
+ { 0xF90, 0xF97, posesF90 },
+ { 0xF99, 0xFBC, posesF99 },
+ { 0xFC6, 0xFC6, posesFC6 },
+ { 0x102c, 0x1032, poses102C },
+ { 0x1036, 0x1039, poses1036 },
+ { 0x1056, 0x1059, poses1056 },
+ { 0x17B4, 0x17D3, poses17B4 },
+ { 0x18A9, 0x18A9, poses18A9 },
+ { 0x1FBD, 0x1FC2, poses1FBD },
+ { 0x1FCD, 0x1FCF, poses1FCD },
+ { 0x1FDD, 0x1FDF, poses1FDD },
+ { 0x1FED, 0x1FEF, poses1FED },
+ { 0x1FFD, 0x1FFE, poses1FFD },
+ { 0x20D0, 0x20E3, poses20D0 },
+ { 0x302A, 0x302F, poses302A },
+ { 0x3099, 0x309A, poses3099 },
+ { 0xFB1E, 0xFB1E, posesFB1E },
+ { 0xFE20, 0xFB23, posesFE20 },
+ { 0 }
+};
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/dump.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/dump.c
new file mode 100644
index 00000000000..5b0796e2d55
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/dump.c
@@ -0,0 +1,994 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include "../inc/charset.h"
+#include "../inc/basics.h"
+
+char *alphabets[] = { "8859-1.TXT", "8859-2.TXT", "8859-3.TXT", "8859-4.TXT",
+ "8859-5.TXT", "8859-6.TXT", "8859-7.TXT", "8859-8.TXT", "8859-9.TXT",
+ "8859-10.TXT", "8859-11.TXT", "8859-13.TXT", "8859-14.TXT", "8859-15.TXT",
+ "koi8r.TXT", "JIS0201.txt", "WIN.TXT", "MacRoman.TXT",
+ "MacSYMBOL.TXT", "zapfding.TXT", /*"MacCYRILLIC.TXT",*/ NULL };
+char *alnames[] = { "i8859_1", "i8859_2", "i8859_3", "i8859_4",
+ "i8859_5", "i8859_6", "i8859_7", "i8859_8", "i8859_9",
+ "i8859_10", "i8859_11", "i8859_13", "i8859_14", "i8859_15",
+ "koi8_r", "jis201", "win", "mac",
+ "MacSymbol", "ZapfDingbats", /*"MacCyrillic",*/ NULL };
+int almaps[] = { em_iso8859_1, em_iso8859_2, em_iso8859_3, em_iso8859_4,
+ em_iso8859_5, em_iso8859_6, em_iso8859_7, em_iso8859_8, em_iso8859_9,
+ em_iso8859_10, em_iso8859_11, em_iso8859_13, em_iso8859_14, em_iso8859_15,
+ em_koi8_r, em_jis201, em_win, em_mac, em_symbol, em_zapfding,
+ -1 };
+
+
+char *cjk[] = { "JIS0208.TXT", "JIS0212.TXT", "BIG5.TXT", "GB2312.TXT",
+ "HANGUL.TXT", "Big5HKSCS.txt", NULL };
+/* I'm only paying attention to Wansung encoding (in HANGUL.TXT) which is 94x94 */
+/* I used to look at OLD5601, but that maps to Unicode 1.0, and Hangul's moved*/
+char *adobecjk[] = { "aj16cid2code.txt", "aj20cid2code.txt", "ac15cid2code.txt",
+ "ag15cid2code.txt", "ak12cid2code.txt", NULL };
+/* I'm told that most of the mappings provided on the Unicode site go to */
+/* Unicode 1.* and that CJK have been moved radically since. So instead */
+/* of the unicode site's files, try using adobe's which claim they are */
+/* up to date. These may be found in: */
+/* ftp://ftp.ora.com/pub/examples/nutshell/ujip/adobe/samples/{aj14,aj20,ak12,ac13,ag14}/cid2code.txt */
+/* they may be bundled up in a tar file, I forget exactly... */
+char *cjknames[] = { "jis208", "jis212", "big5", "gb2312", "ksc5601", "big5hkscs", NULL };
+int cjkmaps[] = { em_jis208, em_jis212, em_big5, em_gb2312, em_ksc5601, em_big5hkscs };
+
+unsigned long *used[256];
+
+static void dumpalphas(FILE *output, FILE *header) {
+ FILE *file;
+ int i,j,k, first, last;
+ long _orig, _unicode, mask;
+ unichar_t unicode[256];
+ unsigned char *table[256], *plane;
+ char buffer[200];
+
+ fprintf(output, "#include <chardata.h>\n\n" );
+ fprintf(output, "const unsigned char c_allzeros[256] = { 0 };\n\n" );
+
+ for ( k=0; k<256; ++k ) table[k] = NULL;
+
+ for ( j=0; alphabets[j]!=NULL; ++j ) {
+ file = fopen( alphabets[j], "r" );
+ if ( file==NULL ) {
+ fprintf( stderr, "Can't open %s\n", alphabets[j]);
+ } else {
+ for ( i=0; i<160; ++i )
+ unicode[i] = i;
+ for ( ; i<256; ++i )
+ unicode[i] = 0;
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' )
+ continue;
+ sscanf(buffer, "0x%lx 0x%lx", (unsigned long *) &_orig, (unsigned long *) &_unicode);
+ unicode[_orig] = _unicode;
+ if ( table[_unicode>>8]==NULL ) {
+ plane = table[_unicode>>8] = calloc(256,1);
+ if ( j==0 && (_unicode>>8)==0 )
+ for ( k=0; k<256; ++k )
+ plane[k] = k;
+ else if ( j==0 )
+ for ( k=0; k<128; ++k )
+ plane[k] = k;
+ }
+ table[_unicode>>8][_unicode&0xff] = _orig;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ if ( almaps[j]!=-1 )
+ used[_unicode>>8][_unicode&0xff] |= (1<<almaps[j]);
+ }
+ fclose(file);
+
+ fprintf( header, "extern const unichar_t unicode_from_%s[];\n", alnames[j] );
+ fprintf( output, "const unichar_t unicode_from_%s[] = {\n", alnames[j] );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+
+ first = last = -1;
+ for ( k=0; k<256; ++k ) {
+ if ( table[k]!=NULL ) {
+ if ( first==-1 ) first = k;
+ last = k;
+ plane = table[k];
+ fprintf( output, "static const unsigned char %s_from_unicode_%x[] = {\n", alnames[j], k );
+ for ( i=0; i<256-16; i+=16 )
+ fprintf( output, " 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7],
+ plane[i+8], plane[i+9], plane[i+10], plane[i+11],
+ plane[i+12], plane[i+13], plane[i+14], plane[i+15]);
+ fprintf( output, " 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7],
+ plane[i+8], plane[i+9], plane[i+10], plane[i+11],
+ plane[i+12], plane[i+13], plane[i+14], plane[i+15]);
+ }
+ }
+ fprintf( output, "static const unsigned char * const %s_from_unicode_[] = {\n", alnames[j] );
+ for ( k=first; k<=last; ++k )
+ if ( table[k]!=NULL )
+ fprintf( output, " %s_from_unicode_%x%s", alnames[j], k, k!=last?",\n":"\n" );
+ else
+ fprintf( output, " c_allzeros,\n" );
+ fprintf( output, "};\n\n" );
+ fprintf( header, "extern struct charmap %s_from_unicode;\n", alnames[j]);
+ fprintf( output, "struct charmap %s_from_unicode = { %d, %d, (unsigned char **) %s_from_unicode_, (unichar_t *) unicode_from_%s };\n\n",
+ alnames[j], first, last, alnames[j], alnames[j]);
+
+ for ( k=first; k<=last; ++k ) {
+ free(table[k]);
+ table[k]=NULL;
+ }
+ }
+ }
+
+/* Mac Symbol appears as a font even on unix. Cyrillic does not but so what?
+ for ( j=0; alphabets[j]!=NULL; ++j )
+ if ( strcmp(alphabets[j],"MacSYMBOL.TXT")==0 ) alphabets[j]=NULL;
+*/
+
+ fprintf( header, "\nextern unichar_t *unicode_from_alphabets[];\n" );
+#if 0
+ fprintf( output, "\n/* the windows charset is a superset of latin1. Many PC centric users think */\n" );
+ fprintf( output, "/* IT is the standard charset for the web and try to use &#153; for &#2122; */\n" );
+ fprintf( output, "/* so even if we expect latin1, let's check for windows too, can't hurt. */\n" );
+ fprintf( output, "unichar_t *unicode_from_alphabets[]={\n" );
+ fprintf( output, " unicode_from_win, 0,0, unicode_from_win, \n" );
+#else
+ fprintf( output, "unichar_t *unicode_from_alphabets[]={\n" );
+ fprintf( output, " (unichar_t *) unicode_from_win, 0,0,\n (unichar_t *) unicode_from_i8859_1, \n" );
+#endif
+ for ( j=1; alphabets[j]!=NULL; ++j )
+ fprintf( output, " (unichar_t *) unicode_from_%s,\n", alnames[j] );
+ fprintf( output, " (unichar_t *) unicode_from_%s,\t/* Place holder for user-defined map */\n", alnames[0] );
+ fprintf( output, " 0\n" );
+ fprintf( output, "};\n" );
+ fprintf( header, "extern struct charmap *alphabets_from_unicode[];\n" );
+ fprintf( output, "\nstruct charmap *alphabets_from_unicode[]={ 0,0,0,\n" );
+ for ( j=0; alphabets[j]!=NULL; ++j )
+ fprintf( output, " &%s_from_unicode,\n", alnames[j] );
+ fprintf( output, " &%s_from_unicode,\t/* Place holder for user-defined map*/\n", alnames[0] );
+ fprintf( output, " 0\n" );
+ fprintf( output, "};\n" );
+
+ fprintf( header, "\n" );
+
+ for ( i=0; i<=255; ++i )
+ used[0][i] |= 1; /* Map this plane entirely to 8859-1 */
+ mask = 0;
+ for ( j=0; alphabets[j]!=NULL; ++j )
+ if ( almaps[j]!=-1 )
+ mask |= (1<<almaps[j]);
+ for ( i=0; i<' '; ++i )
+ used[0][i] |= mask;
+}
+
+#if 0
+static char base64[64] = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+ 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
+ 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
+
+static unsigned char nigori[48] = {
+ 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+};
+static unsigned char maru[48] = {
+ 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,2,2,2,2,2,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+};
+
+static void dumprandom(FILE *output,FILE *header) {
+ int inbase64[128], i;
+
+ for ( i=0; i<128; ++i )
+ inbase64[i] = -1;
+ for ( i=0; i<64; ++i )
+ inbase64[base64[i]] = i;
+ fprintf( header, "extern signed char inbase64[128];\n" );
+ fprintf( output, "signed char inbase64[128] = {\n" );
+ for ( i=0; i<128; i+= 16 )
+ fprintf( output, " %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d, %2d%s\n",
+ inbase64[i], inbase64[i+1], inbase64[i+2], inbase64[i+3],
+ inbase64[i+4], inbase64[i+5], inbase64[i+6], inbase64[i+7],
+ inbase64[i+8], inbase64[i+9], inbase64[i+10], inbase64[i+11],
+ inbase64[i+12], inbase64[i+13], inbase64[i+14], inbase64[i+15],
+ i==128-16?"":",");
+ fprintf( output, "};\n" );
+
+ fprintf( header, "/* Need to subtract 0xb0 from jis206 before indexing this array */\n" );
+ fprintf( header, "extern char nigori[48];\n" );
+ fprintf( output, "char nigori[48] = {\n" );
+ for ( i=0; i<48; i+= 16 )
+ fprintf( output, " %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d%s\n",
+ nigori[i], nigori[i+1], nigori[i+2], nigori[i+3],
+ nigori[i+4], nigori[i+5], nigori[i+6], nigori[i+7],
+ nigori[i+8], nigori[i+9], nigori[i+10], nigori[i+11],
+ nigori[i+12], nigori[i+13], nigori[i+14], nigori[i+15],
+ i==48-16?"":",");
+ fprintf( output, "};\n" );
+
+ fprintf( header, "/* Need to subtract 0xb0 from jis206 before indexing this array */\n" );
+ fprintf( header, "extern char maru[48];\n" );
+ fprintf( output, "char maru[48] = {\n" );
+ for ( i=0; i<48; i+= 16 )
+ fprintf( output, " %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d%s\n",
+ maru[i], maru[i+1], maru[i+2], maru[i+3],
+ maru[i+4], maru[i+5], maru[i+6], maru[i+7],
+ maru[i+8], maru[i+9], maru[i+10], maru[i+11],
+ maru[i+12], maru[i+13], maru[i+14], maru[i+15],
+ i==48-16?"":",");
+ fprintf( output, "};\n" );
+
+ fprintf( header, "\n" );
+}
+#endif
+
+#define VERTMARK 0x1000000
+
+static int ucs2_score(int val) { /* Supplied by KANOU Hiroki */
+ if ( val>=0x2e80 && val<=0x2fff )
+return( 1 ); /* New CJK Radicals are least important */
+ else if ( val>=VERTMARK )
+return( 0 ); /* Then vertical guys */
+ /* only we can't handle vertical here */
+ else if ( val>=0xf000 && val<=0xffff )
+return( 3 );
+/* else if (( val>=0x3400 && val<0x3dff ) || (val>=0x4000 && val<=0x4dff))*/
+ else if ( val>=0x3400 && val<=0x4dff )
+return( 4 );
+ else
+return( 5 );
+}
+
+static int getnth(char *buffer, int col) {
+ int i, val=0, best;
+ char *end;
+ int vals[10];
+
+ if ( col==1 ) {
+ /* first column is decimal, others are hex */
+ if ( !isdigit(*buffer))
+return( -1 );
+ while ( isdigit(*buffer))
+ val = 10*val + *buffer++-'0';
+return( val );
+ }
+ for ( i=1; i<col; ++buffer ) {
+ if ( *buffer=='\t' )
+ ++i;
+ else if ( *buffer=='\0' )
+return( -1 );
+ }
+ val = strtol(buffer,&end,16);
+ if ( end==buffer )
+return( -1 );
+ if ( *end=='v' ) {
+ val += VERTMARK;
+ ++end;
+ }
+ if ( *end==',' ) {
+ /* Multiple guess... now we've got to pick one */
+ vals[0] = val;
+ i = 1;
+ while ( *end==',' && i<9 ) {
+ buffer = end+1;
+ vals[i] = strtol(buffer,&end,16);
+ if ( *end=='v' ) {
+ vals[i] += VERTMARK;
+ ++end;
+ }
+ ++i;
+ }
+ vals[i] = 0;
+ best = 0; val = -1;
+ for ( i=0; vals[i]!=0; ++i ) {
+ if ( ucs2_score(vals[i])>best ) {
+ val = vals[i];
+ best = ucs2_score(vals[i]);
+ }
+ }
+ }
+
+ if ( val >= VERTMARK )
+return( -1 );
+
+return( val );
+}
+
+static void dumpjis(FILE *output,FILE *header) {
+ FILE *file;
+ int i,j,k, first, last;
+ long _orig, _unicode;
+ unichar_t unicode208[94*94], unicode212[94*94];
+ unichar_t *table[256], *plane;
+ char buffer[400];
+
+ memset(table,0,sizeof(table));
+
+ j=0;
+ file = fopen( adobecjk[j], "r" );
+ if ( file==NULL ) {
+ fprintf( stderr, "Can't open %s\n", adobecjk[j]);
+ } else {
+ memset(unicode208,0,sizeof(unicode208));
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' )
+ continue;
+ _orig = getnth(buffer,2);
+ if ( _orig==-1 )
+ continue;
+ _unicode = getnth(buffer,22);
+ if ( _unicode==-1 ) {
+ fprintf( stderr, "Eh? JIS 208-1997 %lx is unencoded\n", _orig );
+ continue;
+ }
+ if ( _unicode>0xffff ) {
+ fprintf( stderr, "Eh? JIS 208-1997 %lx is outside of BMP\n", _orig );
+ continue;
+ }
+ if ( table[_unicode>>8]==NULL )
+ table[_unicode>>8] = calloc(256,sizeof(unichar_t));
+ table[_unicode>>8][_unicode&0xff] = _orig;
+ _orig -= 0x2121;
+ _orig = (_orig>>8)*94 + (_orig&0xff);
+ if ( _orig>=94*94 )
+ fprintf( stderr, "Attempt to index with %ld\n", _orig );
+ else {
+ unicode208[_orig] = _unicode;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ used[_unicode>>8][_unicode&0xff] |= (1<<em_jis208);
+ }
+ }
+ fclose(file);
+ }
+
+ j=1;
+ file = fopen( adobecjk[j], "r" );
+ if ( file==NULL ) {
+ fprintf( stderr, "Can't open %s\n", adobecjk[j]);
+ } else {
+ memset(unicode212,0,sizeof(unicode212));
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' )
+ continue;
+ _orig = getnth(buffer,2);
+ if ( _orig==-1 )
+ continue;
+ _unicode = getnth(buffer,7);
+ if ( _unicode==-1 ) {
+ fprintf( stderr, "Eh? JIS 212-1990 %lx is unencoded\n", _orig );
+ continue;
+ }
+ if ( _unicode>0xffff ) {
+ fprintf( stderr, "Eh? JIS 212-1990 %lx is out of BMP U+%lx\n", _orig, _unicode );
+ continue;
+ }
+ if ( table[_unicode>>8]==NULL )
+ table[_unicode>>8] = calloc(256,sizeof(unichar_t));
+ if ( table[_unicode>>8][_unicode&0xff]==0 )
+ table[_unicode>>8][_unicode&0xff] = _orig|0x8000;
+ else
+ fprintf( stderr, "JIS clash at JIS212 %lx, unicode %lx\n", _orig, _unicode ); /* there are said to be a few of these, I'll just always map to 208 */
+ _orig -= 0x2121;
+ _orig = (_orig>>8)*94 + (_orig&0xff);
+ if ( _orig>=94*94 )
+ fprintf( stderr, "Attempt to index JIS212 with %ld\n", _orig );
+ else {
+ unicode212[_orig] = _unicode;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ used[_unicode>>8][_unicode&0xff] |= (1<<em_jis212);
+ }
+ }
+ fclose(file);
+ }
+
+ j=0;
+ fprintf( header, "extern const unichar_t unicode_from_%s[];\n", cjknames[j] );
+ fprintf( output, "const unichar_t unicode_from_%s[] = {\n", cjknames[j] );
+ for ( i=0; i<sizeof(unicode208)/sizeof(unicode208[0]); i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ unicode208[i], unicode208[i+1], unicode208[i+2], unicode208[i+3],
+ unicode208[i+4], unicode208[i+5], unicode208[i+6], unicode208[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ unicode208[i], unicode208[i+1], unicode208[i+2], unicode208[i+3],
+ unicode208[i+4], unicode208[i+5], unicode208[i+6], unicode208[i+7]);
+ j=1;
+ fprintf( header, "extern const unichar_t unicode_from_%s[];\n", cjknames[j] );
+ fprintf( output, "const unichar_t unicode_from_%s[] = {\n", cjknames[j] );
+ for ( i=0; i<sizeof(unicode212)/sizeof(unicode212[0]); i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ unicode212[i], unicode212[i+1], unicode212[i+2], unicode212[i+3],
+ unicode212[i+4], unicode212[i+5], unicode212[i+6], unicode212[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ unicode212[i], unicode212[i+1], unicode212[i+2], unicode212[i+3],
+ unicode212[i+4], unicode212[i+5], unicode212[i+6], unicode212[i+7]);
+
+ first = last = -1;
+ for ( k=0; k<256; ++k ) {
+ if ( table[k]!=NULL ) {
+ if ( first==-1 ) first = k;
+ last = k;
+ plane = table[k];
+ fprintf( output, "static const unsigned short jis_from_unicode_%x[] = {\n", k );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ }
+ }
+ fprintf( output, "static const unsigned short * const jis_from_unicode_[] = {\n" );
+ for ( k=first; k<=last; ++k )
+ if ( table[k]!=NULL )
+ fprintf( output, " jis_from_unicode_%x%s", k, k!=last?",\n":"\n" );
+ else
+ fprintf( output, " u_allzeros,\n" );
+ fprintf( output, "};\n\n" );
+ fprintf( header, "extern struct charmap2 jis_from_unicode;\n" );
+ fprintf( output, "struct charmap2 jis_from_unicode = { %d, %d, (unsigned short **) jis_from_unicode_, (unichar_t *) unicode_from_%s };\n\n",
+ first, last, cjknames[j]);
+
+ for ( k=first; k<=last; ++k )
+ free(table[k]);
+}
+
+static void dumpbig5(FILE *output,FILE *header) {
+ FILE *file;
+ int i,j,k, first, last;
+ long _orig, _unicode;
+ unichar_t unicode[0x6000];
+ unichar_t *table[256], *plane;
+ char buffer[400];
+
+ j = 2;
+
+ memset(table,0,sizeof(table));
+
+ file = fopen( adobecjk[j], "r" );
+ if ( file==NULL ) {
+ fprintf( stderr, "Can't open %s\n", adobecjk[j]);
+ } else {
+ memset(unicode,0,sizeof(unicode));
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' )
+ continue;
+ _orig = getnth(buffer,3);
+ if ( /*_orig==-1*/ _orig<0xa100 )
+ continue;
+ _unicode = getnth(buffer,11);
+ if ( _unicode==-1 ) {
+ if ( _orig==0xa1c3 )
+ _unicode = 0xFFE3;
+ else if ( _orig==0xa1c5 )
+ _unicode = 0x2cd;
+ else if ( _orig==0xa1fe )
+ _unicode = 0xff0f;
+ else if ( _orig==0xa240 )
+ _unicode = 0xff3c;
+ else if ( _orig==0xa2cc )
+ _unicode = 0x5341;
+ else if ( _orig==0xa2ce )
+ _unicode = 0x5345;
+ else if ( _orig==0xa15a )
+ _unicode = 0x2574;
+ }
+ if ( _unicode==-1 ) {
+ fprintf( stderr, "Eh? BIG5 %lx is unencoded\n", _orig );
+ continue;
+ }
+ if ( _unicode>0xffff ) {
+ fprintf( stderr, "Eh? BIG5 %lx is out of BMP U+%lx\n", _orig, _unicode );
+ continue;
+ }
+ unicode[_orig-0xa100] = _unicode;
+ if ( table[_unicode>>8]==NULL )
+ table[_unicode>>8] = calloc(256,sizeof(unichar_t));
+ table[_unicode>>8][_unicode&0xff] = _orig;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ used[_unicode>>8][_unicode&0xff] |= (1<<em_big5);
+ }
+ fclose(file);
+
+ fprintf( header, "/* Subtract 0xa100 before indexing this array */\n" );
+ fprintf( header, "extern const unichar_t unicode_from_%s[];\n", cjknames[j] );
+ fprintf( output, "const unichar_t unicode_from_%s[] = {\n", cjknames[j] );
+ for ( i=0; i<sizeof(unicode)/sizeof(unicode[0]); i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+
+ first = last = -1;
+ for ( k=0; k<256; ++k ) {
+ if ( table[k]!=NULL ) {
+ if ( first==-1 ) first = k;
+ last = k;
+ plane = table[k];
+ fprintf( output, "static const unsigned short %s_from_unicode_%x[] = {\n", cjknames[j], k );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ }
+ }
+ fprintf( output, "static const unsigned short * const %s_from_unicode_[] = {\n", cjknames[j] );
+ for ( k=first; k<=last; ++k )
+ if ( table[k]!=NULL )
+ fprintf( output, " %s_from_unicode_%x%s", cjknames[j], k, k!=last?",\n":"\n" );
+ else
+ fprintf( output, " u_allzeros,\n" );
+ fprintf( output, "};\n\n" );
+ fprintf( header, "extern struct charmap2 %s_from_unicode;\n", cjknames[j]);
+ fprintf( output, "struct charmap2 %s_from_unicode = { %d, %d, (unsigned short **) %s_from_unicode_, (unichar_t *) unicode_from_%s };\n\n",
+ cjknames[j], first, last, cjknames[j], cjknames[j]);
+
+ for ( k=first; k<=last; ++k )
+ free(table[k]);
+ }
+}
+
+static void dumpbig5hkscs(FILE *output,FILE *header) {
+ FILE *file;
+ int i,j,k, first, last;
+ long _orig, _unicode;
+ unichar_t unicode[0x8000];
+ unichar_t *table[256], *plane;
+ char buffer[400];
+
+ j=5;
+
+ memset(table,0,sizeof(table));
+
+ file = fopen( cjk[j], "r" );
+ if ( file==NULL ) {
+ fprintf( stderr, "Can't open %s\n", cjk[j] );
+ } else {
+ memset(unicode,0,sizeof(unicode));
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' )
+ continue;
+ if ( sscanf( buffer, "U+%lx: %lx", (unsigned long *) &_unicode, (unsigned long *) &_orig )!=2 )
+ continue;
+ if ( _orig<0x8140 )
+ continue;
+ if ( _unicode==-1 ) {
+ fprintf( stderr, "Eh? BIG5HKSCS %lx is unencoded\n", _orig );
+ continue;
+ }
+ unicode[_orig-0x8100] = _unicode;
+ if ( table[_unicode>>8]==NULL )
+ table[_unicode>>8] = calloc(256,sizeof(unichar_t));
+ table[_unicode>>8][_unicode&0xff] = _orig;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ used[_unicode>>8][_unicode&0xff] |= (1<<em_big5hkscs);
+ }
+ fclose(file);
+
+ fprintf( header, "/* Subtract 0x8100 before indexing this array */\n" );
+ fprintf( header, "extern const unichar_t unicode_from_%s[];\n", cjknames[j] );
+ fprintf( output, "const unichar_t unicode_from_%s[] = {\n", cjknames[j] );
+ for ( i=0; i<sizeof(unicode)/sizeof(unicode[0]); i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+
+ first = last = -1;
+ for ( k=0; k<256; ++k ) {
+ if ( table[k]!=NULL ) {
+ if ( first==-1 ) first = k;
+ last = k;
+ plane = table[k];
+ fprintf( output, "static const unsigned short %s_from_unicode_%x[] = {\n", cjknames[j], k );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ }
+ }
+ fprintf( output, "static const unsigned short * const %s_from_unicode_[] = {\n", cjknames[j] );
+ for ( k=first; k<=last; ++k )
+ if ( table[k]!=NULL )
+ fprintf( output, " %s_from_unicode_%x%s", cjknames[j], k, k!=last?",\n":"\n" );
+ else
+ fprintf( output, " u_allzeros,\n" );
+ fprintf( output, "};\n\n" );
+ fprintf( header, "extern struct charmap2 %s_from_unicode;\n", cjknames[j]);
+ fprintf( output, "struct charmap2 %s_from_unicode = { %d, %d, (unsigned short **) %s_from_unicode_, (unichar_t *) unicode_from_%s };\n\n",
+ cjknames[j], first, last, cjknames[j], cjknames[j]);
+
+ for ( k=first; k<=last; ++k )
+ free(table[k]);
+ }
+}
+
+static void dumpWansung(FILE *output,FILE *header) {
+ FILE *file;
+ int i,j=4,k, first, last;
+ long _orig, _unicode, _johab;
+ unichar_t unicode[94*94], junicode[0x7c00];
+ unichar_t *table[256], *plane, *jtable[256];
+ char buffer[400];
+ /* Johab high=[0x84-0xf9] low=[0x31-0xfe] */
+
+ memset(table,0,sizeof(table));
+ memset(jtable,0,sizeof(jtable));
+
+ file = fopen( adobecjk[j], "r" );
+ if ( file==NULL ) {
+ fprintf( stderr, "Can't open %s\n", adobecjk[j]);
+ } else {
+ memset(unicode,0,sizeof(unicode));
+ memset(junicode,0,sizeof(junicode));
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' )
+ continue;
+ _johab = getnth(buffer,7);
+ _orig = getnth(buffer,2);
+ _unicode = getnth(buffer,11);
+ if ( _unicode==-1 ) {
+ if ( _orig>=0x2121 && (_orig&0xff)>=0x21 && _orig<=0x7e7e && (_orig&0xff)<=0x7e )
+ fprintf( stderr, "Eh? Wansung %lx is unencoded\n", _orig );
+ else if ( _johab>=0x8431 && _johab<=0xf9fe )
+ fprintf( stderr, "Eh? Johab %lx is unencoded\n", _johab );
+ continue;
+ }
+ if ( _unicode>0xffff ) {
+ if ( _orig>=0x2121 && (_orig&0xff)>=0x21 && _orig<=0x7e7e && (_orig&0xff)<=0x7e )
+ fprintf( stderr, "Eh? Wansung %lx is out of BMP U+%lx\n", _orig, _unicode );
+ else if ( _johab>=0x8431 && _johab<=0xf9fe )
+ fprintf( stderr, "Eh? Johab %lx is out of BMP U+%lx\n", _johab, _unicode );
+ continue;
+ }
+ if ( _orig>=0x2121 && (_orig&0xff)>=0x21 && _orig<=0x7e7e && (_orig&0xff)<=0x7e ) {
+ if ( table[_unicode>>8]==NULL )
+ table[_unicode>>8] = calloc(256,sizeof(unichar_t));
+ table[_unicode>>8][_unicode&0xff] = _orig;
+ _orig -= 0x2121;
+ _orig = (_orig>>8)*94 + (_orig&0xff);
+ if ( _orig>=94*94 ) {
+ fprintf( stderr, "Not 94x94\n" );
+ continue;
+ }
+ unicode[_orig] = _unicode;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ used[_unicode>>8][_unicode&0xff] |= (1<<cjkmaps[j]);
+ }
+ if ( _johab>=0x8431 && _johab<=0xf9fe ) {
+ if ( jtable[_unicode>>8]==NULL )
+ jtable[_unicode>>8] = calloc(256,sizeof(unichar_t));
+ jtable[_unicode>>8][_unicode&0xff] = _johab;
+ _johab -= 0x8400;
+ junicode[_johab] = _unicode;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ used[_unicode>>8][_unicode&0xff] |= (1<<em_johab);
+ }
+ }
+ fclose(file);
+ }
+
+ /* First Wansung */
+ fprintf( header, "extern const unichar_t unicode_from_%s[];\n", cjknames[j] );
+ fprintf( output, "const unichar_t unicode_from_%s[] = {\n", cjknames[j] );
+ for ( i=0; i<sizeof(unicode)/sizeof(unicode[0]); i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+
+ first = last = -1;
+ for ( k=0; k<256; ++k ) {
+ if ( table[k]!=NULL ) {
+ if ( first==-1 ) first = k;
+ last = k;
+ plane = table[k];
+ fprintf( output, "static unsigned short %s_from_unicode_%x[] = {\n", cjknames[j], k );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ }
+ }
+ fprintf( output, "static const unsigned short * const %s_from_unicode_[] = {\n", cjknames[j] );
+ for ( k=first; k<=last; ++k )
+ if ( table[k]!=NULL )
+ fprintf( output, " %s_from_unicode_%x%s", cjknames[j], k, k!=last?",\n":"\n" );
+ else
+ fprintf( output, " u_allzeros,\n" );
+ fprintf( output, "};\n\n" );
+ fprintf( header, "extern struct charmap2 %s_from_unicode;\n", cjknames[j]);
+ fprintf( output, "struct charmap2 %s_from_unicode = { %d, %d, (unsigned short **) %s_from_unicode_, (unichar_t *) unicode_from_%s };\n\n",
+ cjknames[j], first, last, cjknames[j], cjknames[j]);
+
+ if ( first==-1 )
+ fprintf( stderr, "No Hangul\n" );
+ else for ( k=first; k<=last; ++k ) {
+ free(table[k]);
+ table[k]=NULL;
+ }
+
+ /* Then Johab */
+ fprintf( header, "/* Subtract 0x8400 before indexing this array */\n" );
+ fprintf( header, "extern const unichar_t unicode_from_johab[];\n" );
+ fprintf( output, "const unichar_t unicode_from_johab[] = {\n" );
+ for ( i=0; i<sizeof(junicode)/sizeof(junicode[0]); i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ junicode[i], junicode[i+1], junicode[i+2], junicode[i+3],
+ junicode[i+4], junicode[i+5], junicode[i+6], junicode[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ junicode[i], junicode[i+1], junicode[i+2], junicode[i+3],
+ junicode[i+4], junicode[i+5], junicode[i+6], junicode[i+7]);
+
+ first = last = -1;
+ for ( k=0; k<256; ++k ) {
+ if ( jtable[k]!=NULL ) {
+ if ( first==-1 ) first = k;
+ last = k;
+ plane = jtable[k];
+ fprintf( output, "static unsigned short johab_from_unicode_%x[] = {\n", k );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ }
+ }
+ fprintf( output, "static const unsigned short * const johab_from_unicode_[] = {\n" );
+ for ( k=first; k<=last; ++k )
+ if ( jtable[k]!=NULL )
+ fprintf( output, " johab_from_unicode_%x%s", k, k!=last?",\n":"\n" );
+ else
+ fprintf( output, " u_allzeros,\n" );
+ fprintf( output, "};\n\n" );
+ fprintf( header, "extern struct charmap2 johab_from_unicode;\n" );
+ fprintf( output, "struct charmap2 johab_from_unicode = { %d, %d, (unsigned short **) johab_from_unicode_, (unichar_t *) unicode_from_johab };\n\n",
+ first, last );
+
+ if ( first==-1 )
+ fprintf( stderr, "No Johab\n" );
+ else for ( k=first; k<=last; ++k ) {
+ free(table[k]);
+ table[k]=NULL;
+ }
+}
+
+static void dumpgb2312(FILE *output,FILE *header) {
+ FILE *file;
+ int i,j,k, first, last;
+ long _orig, _unicode;
+ unichar_t unicode[94*94];
+ unichar_t *table[256], *plane;
+ char buffer[400];
+
+ memset(table,0,sizeof(table));
+
+ j = 3;
+ file = fopen( adobecjk[j], "r" );
+ if ( file==NULL ) {
+ fprintf( stderr, "Can't open %s\n", adobecjk[j]);
+ } else {
+ memset(unicode,0,sizeof(unicode));
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' )
+ continue;
+ _orig = getnth(buffer,2);
+ if ( _orig==-1 )
+ continue;
+ _unicode = getnth(buffer,14);
+ if ( _unicode==-1 ) {
+ fprintf( stderr, "Eh? GB2312-80 %lx is unencoded\n", _orig );
+ continue;
+ }
+ if ( _unicode>0xffff ) {
+ fprintf( stderr, "Eh? GB2312-80 %lx is out of BMP U+%lx\n", _orig, _unicode );
+ continue;
+ }
+ if ( table[_unicode>>8]==NULL )
+ table[_unicode>>8] = calloc(256,sizeof(unichar_t));
+ table[_unicode>>8][_unicode&0xff] = _orig;
+ _orig -= 0x2121;
+ _orig = (_orig>>8)*94 + (_orig&0xff);
+ unicode[_orig] = _unicode;
+ if ( used[_unicode>>8]==NULL ) {
+ used[_unicode>>8] = calloc(256,sizeof(long));
+ }
+ used[_unicode>>8][_unicode&0xff] |= (1<<cjkmaps[j]);
+ }
+ fclose(file);
+ }
+
+ fprintf( header, "extern const unichar_t unicode_from_%s[];\n", cjknames[j] );
+ fprintf( output, "const unichar_t unicode_from_%s[] = {\n", cjknames[j] );
+ for ( i=0; i<sizeof(unicode)/sizeof(unicode[0]); i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ unicode[i], unicode[i+1], unicode[i+2], unicode[i+3],
+ unicode[i+4], unicode[i+5], unicode[i+6], unicode[i+7]);
+
+ first = last = -1;
+ for ( k=0; k<256; ++k ) {
+ if ( table[k]!=NULL ) {
+ if ( first==-1 ) first = k;
+ last = k;
+ plane = table[k];
+ fprintf( output, "static unsigned short %s_from_unicode_%x[] = {\n", cjknames[j], k );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ fprintf( output, " 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ }
+ }
+ fprintf( output, "static const unsigned short * const %s_from_unicode_[] = {\n", cjknames[j] );
+ for ( k=first; k<=last; ++k )
+ if ( table[k]!=NULL )
+ fprintf( output, " %s_from_unicode_%x%s", cjknames[j], k, k!=last?",\n":"\n" );
+ else
+ fprintf( output, " u_allzeros,\n" );
+ fprintf( output, "};\n\n" );
+ fprintf( header, "extern struct charmap2 %s_from_unicode;\n", cjknames[j]);
+ fprintf( output, "struct charmap2 %s_from_unicode = { %d, %d, (unsigned short **) %s_from_unicode_, (unichar_t *) unicode_from_%s };\n\n",
+ cjknames[j], first, last, cjknames[j], cjknames[j]);
+
+ if ( first==-1 )
+ fprintf( stderr, "No 94x94\n" );
+ else for ( k=first; k<=last; ++k ) {
+ free(table[k]);
+ table[k]=NULL;
+ }
+}
+
+static void dumpcjks(FILE *output,FILE *header) {
+
+ fprintf(output, "#include <chardata.h>\n\n" );
+ fprintf(output, "const unsigned short u_allzeros[256] = { 0 };\n\n" );
+
+ dumpjis(output,header);
+ dumpbig5(output,header);
+ dumpbig5hkscs(output,header);
+ dumpWansung(output,header);
+ dumpgb2312(output,header);
+}
+
+static void dumptrans(FILE *output, FILE *header) {
+ unsigned long *plane;
+ int k, i;
+
+ fprintf(output, "static const unsigned long l_allzeros[256] = { 0 };\n" );
+ for ( k=0; k<256; ++k ) {
+ if ( used[k]!=NULL ) {
+ plane = used[k];
+ fprintf( output, "static const unsigned long unicode_backtrans_%x[] = {\n", k );
+ for ( i=0; i<256-8; i+=8 )
+ fprintf( output, " 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx,\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ fprintf( output, " 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx, 0x%06lx\n};\n\n",
+ plane[i], plane[i+1], plane[i+2], plane[i+3],
+ plane[i+4], plane[i+5], plane[i+6], plane[i+7]);
+ }
+ }
+ fprintf( header, "\n/* a mask for each character saying what charset(s) it may be found in */\n" );
+ fprintf( header, "extern const unsigned long * const unicode_backtrans[];\n" );
+ fprintf( output, "const unsigned long *const unicode_backtrans[] = {\n" );
+ for ( k=0; k<256; ++k )
+ if ( used[k]!=NULL )
+ fprintf( output, " unicode_backtrans_%x%s", k, k!=255?",\n":"\n" );
+ else
+ fprintf( output, " l_allzeros,\n" );
+ fprintf( output, "};\n" );
+}
+
+int main(int argc, char **argv) {
+ FILE *output, *header;
+
+ if (( output = fopen( "alphabet.c", "w" ))==NULL ) {
+ fprintf( stderr, "Can't open %s\n", "alphabet.c" );
+return 1;
+ }
+ if (( header = fopen( "chardata.h", "w" ))==NULL ) {
+ fprintf( stderr, "Can't open %s\n", "chardata.h" );
+return 1;
+ }
+
+ fprintf( header, "#include \"basics.h\"\n\n" );
+ fprintf( header, "struct charmap {\n int first, last;\n unsigned char **table;\n unichar_t *totable;\n};\n" );
+ fprintf( header, "struct charmap2 {\n int first, last;\n unsigned short **table;\n unichar_t *totable;\n};\n\n" );
+
+ dumpalphas(output,header);
+ /*dumprandom(output,header);*/
+ fclose(output);
+
+ if (( output = fopen( "cjk.c", "w" ))==NULL ) {
+ fprintf( stderr, "Can't open %s\n", "cjk.c" );
+return 1;
+ }
+ dumpcjks(output,header);
+ if (( output = fopen( "backtrns.c", "w" ))==NULL ) {
+ fprintf( stderr, "Can't open %s\n", "cjk.c" );
+return 1;
+ }
+ dumptrans(output,header);
+
+ /* This really should be in make ctype, but putting it there causes all */
+ /* sorts of build problems in things happen out of order */
+ fprintf( header,"\nextern const unichar_t *const * const unicode_alternates[];\n" );
+
+ fclose(output); fclose(header);
+return 0;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/gwwiconv.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/gwwiconv.c
index a2033e499f6..5576de5c18e 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/gwwiconv.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/gwwiconv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2007 by George Williams */
+/* Copyright (C) 2004-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -34,7 +34,7 @@
#include <stdio.h>
#ifdef LUA_FF_LIB
-extern void LogError(const char *fmt,...);
+extern void LUAUI_LogError(const char *fmt,...);
#endif
#ifndef HAVE_ICONV_H
@@ -66,13 +66,19 @@ static void endian_detector(void) {
static enum encoding name_to_enc(const char *encname) {
struct { const char *name; enum encoding enc; } map[] = {
+ { "UCS-2-INTERNAL", e_unicode },
{ "UCS2", e_unicode },
{ "UCS-2", e_unicode },
- { "UCS-2-INTERNAL", e_unicode },
+ { "UCS-2LE", e_unicode },
+ { "UCS-2BE", e_unicode },
+ { "UNICODELITTLE", e_unicode },
+ { "UNICODEBIG", e_unicode },
{ "ISO-10646/UCS2", e_unicode },
{ "ISO-10646/USC2", e_unicode }, /* Old typo */
{ "UCS4", e_ucs4 },
{ "UCS-4", e_ucs4 },
+ { "UCS-4LE", e_ucs4 },
+ { "UCS-4BE", e_ucs4 },
{ "UCS-4-INTERNAL", e_ucs4 },
{ "ISO-10646/UCS4", e_ucs4 },
{ "iso8859-1", e_iso8859_1 },
@@ -148,9 +154,9 @@ return( (iconv_t)(-1) );
#else
} else if ( stuff.from!=e_ucs4 && stuff.to!=e_ucs4 ) {
#ifdef LUA_FF_LIB
- LogError("Bad call to gww_iconv_open, neither arg is UCS4 (%s->%s)", fromenc, toenc);
+ LUAUI_LogError("Bad call to gww_iconv_open, neither arg is UCS4 (%s->%s)", fromenc, toenc);
#else
- fprintf( stderr, "Bad call to gww_iconv_open, neither arg is UCS4 (%s->%s)\n" , fromenc, toenc);
+ fprintf( stderr, "Bad call to gww_iconv_open, neither arg is UCS4\n" );
#endif
return( (iconv_t)(-1) );
#endif
@@ -236,7 +242,6 @@ return( (size_t) -1 ); /* Incomplete multi-byte sequence */
} else
return( (size_t) -1 );
}
-#ifndef LUA_FF_LIB
} else if ( cd->to==e_johab || cd->to==e_big5 || cd->to==e_big5hkscs ) {
struct charmap2 *table = cd->to==e_johab ? &johab_from_unicode :
cd->to==e_big5 ? &big5_from_unicode :
@@ -369,7 +374,6 @@ return( (size_t) -1 );
} else
return( (size_t) -1 );
}
-#endif
} else if ( cd->to==e_utf8 ) {
while ( *inlen>1 && *outlen>0 ) {
unichar_t uch;
@@ -446,7 +450,6 @@ return( (size_t) -1 ); /* Incomplete multi-byte sequence */
} else
return( (size_t) -1 );
}
-#ifndef LUA_FF_LIB
} else if ( cd->to==e_johab || cd->to==e_big5 || cd->to==e_big5hkscs ) {
struct charmap2 *table = cd->to==e_johab ? &johab_from_unicode :
cd->to==e_big5 ? &big5_from_unicode :
@@ -579,7 +582,6 @@ return( (size_t) -1 );
} else
return( (size_t) -1 );
}
-#endif
} else if ( cd->to==e_utf8 ) {
while ( *inlen>1 && *outlen>0 ) {
int uch;
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/memory.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/memory.c
index a8458c4c6bd..62c14eb730e 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/memory.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/memory.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ucharmap.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ucharmap.c
new file mode 100644
index 00000000000..316234246a9
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ucharmap.c
@@ -0,0 +1,675 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifdef VMS /* these three lines from Jacob Jansen, Open VMS port */
+# include <vms_jackets.h>
+#endif
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <gwwiconv.h>
+#include <stddef.h>
+#include <ustring.h>
+#include <utype.h>
+#include <charset.h>
+#include <chardata.h>
+
+int local_encoding = e_iso8859_1;
+#if HAVE_ICONV_H
+char *iconv_local_encoding_name = NULL;
+#endif
+
+static int bad_enc_warn = false;
+
+/* Does not handle conversions to Extended unix */
+
+unichar_t *encoding2u_strncpy(unichar_t *uto, const char *_from, int n, enum encoding cs) {
+ unichar_t *upt=uto;
+ const unichar_t *table;
+ int offset;
+ const unsigned char *from = (const unsigned char *) _from;
+
+ if ( cs<e_first2byte ) {
+ table = unicode_from_alphabets[cs];
+ if ( table==NULL ) {
+ while ( *from && n>0 ) {
+ *upt++ = *(unsigned char *) (from++);
+ --n;
+ }
+ } else {
+ while ( *from && n>0 ) {
+ *upt ++ = table[*(unsigned char *) (from++)];
+ --n;
+ }
+ }
+ } else if ( cs<e_unicode ) {
+ *uto = '\0';
+ switch ( cs ) {
+ default:
+ if ( !bad_enc_warn ) {
+ bad_enc_warn = true;
+ fprintf( stderr, "Unexpected encoding %d, I'll pretend it's latin1\n", cs );
+ }
+return( encoding2u_strncpy(uto,_from,n,e_iso8859_1));
+ case e_johab: case e_big5: case e_big5hkscs:
+ if ( cs==e_big5 ) {
+ offset = 0xa100;
+ table = unicode_from_big5;
+ } else if ( cs==e_big5hkscs ) {
+ offset = 0x8100;
+ table = unicode_from_big5hkscs;
+ } else {
+ offset = 0x8400;
+ table = unicode_from_johab;
+ }
+ while ( *from && n>0 ) {
+ if ( *from>=(offset>>8) && from[1]!='\0' ) {
+ *upt++ = table[ ((*from<<8) | from[1]) - offset ];
+ from += 2;
+ } else
+ *upt++ = *from++;
+ --n;
+ }
+ break;
+ case e_wansung:
+ while ( *from && n>0 ) {
+ if ( *from>=0xa1 && from[1]>=0xa1 ) {
+ *upt++ = unicode_from_ksc5601[ (*from-0xa1)*94+(from[1]-0xa1) ];
+ from += 2;
+ } else
+ *upt++ = *from++;
+ --n;
+ }
+ break;
+ case e_jisgb:
+ while ( *from && n>0 ) {
+ if ( *from>=0xa1 && from[1]>=0xa1 ) {
+ *upt++ = unicode_from_gb2312[ (*from-0xa1)*94+(from[1]-0xa1) ];
+ from += 2;
+ } else
+ *upt++ = *from++;
+ --n;
+ }
+ break;
+ case e_sjis:
+ while ( *from && n>0 ) {
+ if ( *from<127 || ( *from>=161 && *from<=223 )) {
+ *upt++ = unicode_from_jis201[*from++];
+ } else {
+ int ch1 = *from++;
+ int ch2 = *from++;
+ if ( ch1 >= 129 && ch1<= 159 )
+ ch1 -= 112;
+ else
+ ch1 -= 176;
+ ch1 <<= 1;
+ if ( ch2>=159 )
+ ch2-= 126;
+ else if ( ch2>127 ) {
+ --ch1;
+ ch2 -= 32;
+ } else {
+ --ch1;
+ ch2 -= 31;
+ }
+ *upt++ = unicode_from_jis208[(ch1-0x21)*94+(ch2-0x21)];
+ }
+ --n;
+ }
+ break;
+ }
+ } else if ( cs==e_unicode ) {
+ unichar_t *ufrom = (unichar_t *) from;
+ while ( *ufrom && n>0 ) {
+ *upt++ = *ufrom++;
+ --n;
+ }
+ } else if ( cs==e_unicode_backwards ) {
+ unichar_t *ufrom = (unichar_t *) from;
+ while ( *ufrom && n>0 ) {
+ unichar_t ch = (*ufrom>>8)||((*ufrom&0xff)<<8);
+ *upt++ = ch;
+ ++ufrom;
+ --n;
+ }
+ } else if ( cs==e_utf8 ) {
+ while ( *from && n>0 ) {
+ if ( *from<=127 )
+ *upt = *from++;
+ else if ( *from<=0xdf ) {
+ if ( from[1]>=0x80 ) {
+ *upt = ((*from&0x1f)<<6) | (from[1]&0x3f);
+ from += 2;
+ } else {
+ ++from; /* Badly formed utf */
+ *upt = 0xfffd;
+ }
+ } else if ( *from<=0xef ) {
+ if ( from[1]>=0x80 && from[2]>=0x80 ) {
+ *upt = ((*from&0xf)<<12) | ((from[1]&0x3f)<<6) | (from[2]&0x3f);
+ from += 3;
+ } else {
+ ++from; /* Badly formed utf */
+ *upt = 0xfffd;
+ }
+ } else if ( n>2 ) {
+ if ( from[1]>=0x80 && from[2]>=0x80 && from[3]>=0x80 ) {
+ int w = ( ((*from&0x7)<<2) | ((from[1]&0x30)>>4) )-1;
+ *upt++ = 0xd800 | (w<<6) | ((from[1]&0xf)<<2) | ((from[2]&0x30)>>4);
+ *upt = 0xdc00 | ((from[2]&0xf)<<6) | (from[3]&0x3f);
+ from += 4;
+ } else {
+ ++from; /* Badly formed utf */
+ *upt = 0xfffd;
+ }
+ } else {
+ /* no space for surrogate */
+ from += 4;
+ }
+ ++upt;
+ }
+ } else {
+ if ( !bad_enc_warn ) {
+ bad_enc_warn = true;
+ fprintf( stderr, "Unexpected encoding %d, I'll pretend it's latin1\n", cs );
+ }
+return( encoding2u_strncpy(uto,_from,n,e_iso8859_1));
+ }
+
+ if ( n>0 )
+ *upt = '\0';
+
+return( uto );
+}
+
+char *u2encoding_strncpy(char *to, const unichar_t *ufrom, int n, enum encoding cs) {
+ char *pt = to;
+
+ /* we just ignore anything that doesn't fit in the encoding we look at */
+ if ( cs<e_first2byte ) {
+ struct charmap *table = NULL;
+ unsigned char *plane;
+ table = alphabets_from_unicode[cs];
+ if ( table==NULL ) { /* ASCII */
+ while ( *ufrom && n>0 ) {
+ int ch = *ufrom;
+ if ( ch<127 ) {
+ *pt++ = ch;
+ --n;
+ }
+ ++ufrom;
+ }
+ } else {
+ while ( *ufrom && n>0 ) {
+ int highch = *ufrom>>8, ch;
+ if ( highch>=table->first && highch<=table->last &&
+ (plane = table->table[highch])!=NULL &&
+ (ch=plane[*ufrom&0xff])!=0 ) {
+ *pt++ = ch;
+ --n;
+ }
+ ++ufrom;
+ }
+ }
+ if ( n>0 )
+ *pt = '\0';
+ } else if ( cs<e_unicode ) {
+ struct charmap2 *table;
+ unsigned short *plane;
+ unsigned char *plane1;
+
+ *to = '\0';
+ switch ( cs ) {
+ default:
+ if ( !bad_enc_warn ) {
+ bad_enc_warn = true;
+ fprintf( stderr, "Unexpected encoding %d, I'll pretend it's latin1\n", cs );
+ }
+return( u2encoding_strncpy(to,ufrom,n,e_iso8859_1));
+ case e_johab: case e_big5: case e_big5hkscs:
+ table = cs==e_big5 ? &big5_from_unicode :
+ cs==e_big5hkscs ? &big5hkscs_from_unicode :
+ &johab_from_unicode;
+ while ( *ufrom && n>0 ) {
+ int highch = *ufrom>>8, ch;
+ if ( *ufrom<0x80 ) {
+ *pt++ = *ufrom;
+ --n;
+ } else if ( highch>=table->first && highch<=table->last &&
+ (plane = table->table[highch-table->first])!=NULL &&
+ (ch=plane[*ufrom&0xff])!=0 ) {
+ *pt++ = ch>>8;
+ *pt++ = ch&0xff;
+ n -= 2;
+ }
+ ufrom ++;
+ }
+ break;
+ case e_wansung:
+ while ( *ufrom && n>0 ) {
+ int highch = *ufrom>>8, ch;
+ if ( *ufrom<0x80 ) {
+ *pt++ = *ufrom;
+ --n;
+ } else if ( highch>=ksc5601_from_unicode.first && highch<=ksc5601_from_unicode.last &&
+ (plane = ksc5601_from_unicode.table[highch-ksc5601_from_unicode.first])!=NULL &&
+ (ch=plane[*ufrom&0xff])!=0 ) {
+ *pt++ = (ch>>8) + 0x80;
+ *pt++ = (ch&0xff) + 0x80;
+ n -= 2;
+ }
+ ufrom ++;
+ }
+ break;
+ case e_jisgb:
+ while ( *ufrom && n>0 ) {
+ int highch = *ufrom>>8, ch;
+ if ( *ufrom<0x80 ) {
+ *pt++ = *ufrom;
+ --n;
+ } else if ( highch>=gb2312_from_unicode.first && highch<=gb2312_from_unicode.last &&
+ (plane = gb2312_from_unicode.table[highch-gb2312_from_unicode.first])!=NULL &&
+ (ch=plane[*ufrom&0xff])!=0 ) {
+ *pt++ = (ch>>8) + 0x80;
+ *pt++ = (ch&0xff) + 0x80;
+ n -= 2;
+ }
+ ufrom ++;
+ }
+ break;
+ case e_sjis:
+ while ( *ufrom && n>0 ) {
+ int highch = *ufrom>>8, ch;
+ if ( highch>=jis201_from_unicode.first && highch<=jis201_from_unicode.last &&
+ (plane1 = jis201_from_unicode.table[highch-jis201_from_unicode.first])!=NULL &&
+ (ch=plane1[*ufrom&0xff])!=0 ) {
+ *pt++ = ch;
+ --n;
+ } else if ( *ufrom<' ' ) { /* control chars */
+ *pt++ = *ufrom;
+ --n;
+ } else if ( highch>=jis_from_unicode.first && highch<=jis_from_unicode.last &&
+ (plane = jis_from_unicode.table[highch-jis_from_unicode.first])!=NULL &&
+ (ch=plane[*ufrom&0xff])!=0 && ch<0x8000 ) { /* no jis212 */
+ int j1 = ch>>8, j2 = ch&0xff;
+ int ro = j1<95 ? 112 : 176;
+ int co = (j1&1) ? (j2>95?32:31) : 126;
+ *pt++ = ((j1+1)>>1)+ro;
+ *pt++ = j2+co;
+ n -= 2;
+ }
+ ++ufrom;
+ }
+ break;
+ }
+ if ( n>0 )
+ *pt = '\0';
+ } else if ( cs==e_unicode ) {
+ unichar_t *uto = (unichar_t *) to;
+ while ( *ufrom && n>1 ) {
+ *uto++ = *ufrom++;
+ n-=sizeof(unichar_t);
+ }
+ if ( n>1 )
+ *uto = '\0';
+ } else if ( cs==e_unicode_backwards ) {
+ unichar_t *uto = (unichar_t *) to;
+ while ( *ufrom && n>sizeof(unichar_t)-1 ) {
+#ifdef UNICHAR_16
+ unichar_t ch = (*ufrom>>8)|((*ufrom&0xff)<<8);
+#else
+ unichar_t ch = (*ufrom>>24)|((*ufrom>>8)&0xff00)|
+ ((*ufrom<<8)&0xff0000)|(*ufrom<<24);
+#endif
+ *uto++ = ch;
+ ++ufrom;
+ n-=sizeof(unichar_t);
+ }
+ if ( n>1 )
+ *uto = '\0';
+ } else if ( cs==e_utf8 ) {
+ while ( *ufrom ) {
+ if ( *ufrom<0x80 ) {
+ if ( n<=1 )
+ break;
+ *pt++ = *ufrom;
+ --n;
+ } else if ( *ufrom<0x800 ) {
+ if ( n<=2 )
+ break;
+ *pt++ = 0xc0 | (*ufrom>>6);
+ *pt++ = 0x80 | (*ufrom&0x3f);
+ n -= 2;
+ } else if ( *ufrom>=0xd800 && *ufrom<0xdc00 && ufrom[1]>=0xdc00 && ufrom[1]<0xe000 ) {
+ int u = ((*ufrom>>6)&0xf)+1, y = ((*ufrom&3)<<4) | ((ufrom[1]>>6)&0xf);
+ if ( n<=4 )
+ break;
+ *pt++ = 0xf0 | (u>>2);
+ *pt++ = 0x80 | ((u&3)<<4) | ((*ufrom>>2)&0xf);
+ *pt++ = 0x80 | y;
+ *pt++ = 0x80 | (ufrom[1]&0x3f);
+ n -= 4;
+ } else {
+ if ( n<=3 )
+ break;
+ *pt++ = 0xe0 | (*ufrom>>12);
+ *pt++ = 0x80 | ((*ufrom>>6)&0x3f);
+ *pt++ = 0x80 | (*ufrom&0x3f);
+ }
+ ++ufrom;
+ }
+ if ( n>1 )
+ *pt = '\0';
+ } else {
+ if ( !bad_enc_warn ) {
+ bad_enc_warn = true;
+ fprintf( stderr, "Unexpected encoding %d, I'll pretend it's latin1\n", cs );
+ }
+return( u2encoding_strncpy(to,ufrom,n,e_iso8859_1));
+ }
+
+return( to );
+}
+
+#if HAVE_ICONV_H
+static char *old_local_name=NULL;
+static iconv_t to_unicode=(iconv_t) (-1), from_unicode=(iconv_t) (-1);
+static iconv_t to_utf8=(iconv_t) (-1), from_utf8=(iconv_t) (-1);
+#ifdef UNICHAR_16
+static char *names[] = { "UCS-2-INTERNAL", "UCS-2", "UCS2", "ISO-10646/UCS2", "UNICODE", NULL };
+static char *namesle[] = { "UCS-2LE", "UNICODELITTLE", NULL };
+static char *namesbe[] = { "UCS-2BE", "UNICODEBIG", NULL };
+#else
+static char *names[] = { "UCS-4-INTERNAL", "UCS-4", "UCS4", "ISO-10646-UCS-4", "UTF-32", NULL };
+static char *namesle[] = { "UCS-4LE", "UTF-32LE", NULL };
+static char *namesbe[] = { "UCS-4BE", "UTF-32BE", NULL };
+#endif
+static char *unicode_name = NULL;
+static int byteswapped = false;
+
+static int BytesNormal(iconv_t latin1_2_unicode) {
+#ifdef UNICHAR_16
+ union {
+ short s;
+ char c[2];
+ } u[8];
+#else
+ union {
+ int s;
+ char c[4];
+ } u[8];
+#endif
+ char *from = "A", *to = &u[0].c[0];
+ size_t in_left = 1, out_left = sizeof(u);
+ memset(u,0,sizeof(u));
+ iconv( latin1_2_unicode, (iconv_arg2_t) &from, &in_left, &to, &out_left);
+ if ( u[0].s=='A' )
+return( true );
+
+return( false );
+}
+
+static int my_iconv_setup(void) {
+ char **testnames;
+ int i;
+ union {
+ short s;
+ char c[2];
+ } u;
+ iconv_t test;
+
+ if ( iconv_local_encoding_name==NULL ) {
+ if ( to_unicode!=(iconv_t) (-1) ) {
+ iconv_close(to_unicode);
+ iconv_close(from_unicode);
+ to_unicode = from_unicode = (iconv_t) (-1);
+ }
+return(false);
+ }
+ if ( old_local_name!=NULL && strcmp(old_local_name,iconv_local_encoding_name)==0 )
+return( to_unicode!=(iconv_t) (-1) );
+
+ free(old_local_name);
+ old_local_name = copy(iconv_local_encoding_name);
+ to_utf8 = iconv_open("UTF-8",iconv_local_encoding_name);
+ from_utf8 = iconv_open(iconv_local_encoding_name,"UTF-8");
+
+ if ( unicode_name==NULL ) {
+ u.c[0] = 0x1; u.c[1] = 0x2;
+ if ( u.s==0x201 ) { /* Little endian */
+ testnames = namesle;
+ } else {
+ testnames = namesbe;
+ }
+ for ( i=0; testnames[i]!=NULL; ++i ) {
+ test = iconv_open(testnames[i],"ISO-8859-1");
+ if ( test!=(iconv_t) -1 && test!=NULL ) {
+ iconv_close(test);
+ unicode_name = testnames[i];
+ break;
+ }
+ }
+ if ( unicode_name==NULL ) {
+ for ( i=0; names[i]!=NULL; ++i ) {
+ test = iconv_open(names[i],"ISO-8859-1");
+ if ( test!=(iconv_t) -1 && test!=NULL ) {
+ byteswapped = !BytesNormal(test);
+ iconv_close(test);
+ unicode_name = names[i];
+ break;
+ }
+ }
+ }
+ }
+ if ( unicode_name == NULL ) {
+ fprintf( stderr, "Could not find a name for Unicode which iconv could understand.\n" );
+return( false );
+ } else if ( byteswapped ) {
+ fprintf( stderr, "The only name for Unicode that iconv understood produced unexpected results.\nPerhaps %s was byte swapped.\n", unicode_name );
+return( false );
+ }
+
+ to_unicode = iconv_open(unicode_name,iconv_local_encoding_name);
+ from_unicode = iconv_open(iconv_local_encoding_name,unicode_name);
+ if ( to_unicode == (iconv_t) (-1) || to_utf8 == (iconv_t) (-1) ) {
+ fprintf( stderr, "iconv failed to understand encoding %s\n",
+ iconv_local_encoding_name);
+return( false );
+ }
+return( true );
+}
+#endif
+
+unichar_t *def2u_strncpy(unichar_t *uto, const char *from, int n) {
+#if HAVE_ICONV_H
+ if ( my_iconv_setup() ) {
+ size_t in_left = n, out_left = sizeof(unichar_t)*n;
+ char *cto = (char *) uto;
+ iconv(to_unicode, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
+ if ( cto<((char *) uto)+2*n) *cto++ = '\0';
+ if ( cto<((char *) uto)+2*n) *cto++ = '\0';
+#ifndef UNICHAR_16
+ if ( cto<((char *) uto)+4*n) *cto++ = '\0';
+ if ( cto<((char *) uto)+4*n) *cto++ = '\0';
+#endif
+return( uto );
+ }
+#endif
+return( encoding2u_strncpy(uto,from,n,local_encoding));
+}
+
+char *u2def_strncpy(char *to, const unichar_t *ufrom, int n) {
+#if HAVE_ICONV_H
+ if ( my_iconv_setup() ) {
+ size_t in_left = sizeof(unichar_t)*n, out_left = n;
+ char *cfrom = (char *) ufrom, *cto=to;
+ iconv(from_unicode, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
+ if ( cto<to+n ) *cto++ = '\0';
+ if ( cto<to+n ) *cto++ = '\0';
+#ifndef UNICHAR_16
+ if ( cto<to+n ) *cto++ = '\0';
+ if ( cto<to+n ) *cto++ = '\0';
+#endif
+return( to );
+ }
+#endif
+return( u2encoding_strncpy(to,ufrom,n,local_encoding));
+}
+
+unichar_t *def2u_copy(const char *from) {
+ int len;
+ unichar_t *uto, *ret;
+
+ if ( from==NULL )
+return( NULL );
+ len = strlen(from);
+ uto = galloc((len+1)*sizeof(unichar_t));
+#if HAVE_ICONV_H
+ if ( my_iconv_setup() ) {
+ size_t in_left = len, out_left = sizeof(unichar_t)*len;
+ char *cto = (char *) uto;
+ iconv(to_unicode, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
+ *cto++ = '\0';
+ *cto++ = '\0';
+#ifndef UNICHAR_16
+ *cto++ = '\0';
+ *cto++ = '\0';
+#endif
+return( uto );
+ }
+#endif
+ ret = encoding2u_strncpy(uto,from,len,local_encoding);
+ if ( ret==NULL )
+ free( uto );
+ else
+ uto[len] = '\0';
+return( ret );
+}
+
+char *u2def_copy(const unichar_t *ufrom) {
+ int len;
+ char *to, *ret;
+
+ if ( ufrom==NULL )
+return( NULL );
+ len = u_strlen(ufrom);
+#if HAVE_ICONV_H
+ if ( my_iconv_setup() ) {
+ size_t in_left = sizeof(unichar_t)*len, out_left = 3*len;
+ char *cfrom = (char *) ufrom, *cto;
+ cto = to = galloc(3*len+2);
+ iconv(from_unicode, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
+ *cto++ = '\0';
+ *cto++ = '\0';
+#ifndef UNICHAR_16
+ *cto++ = '\0';
+ *cto++ = '\0';
+#endif
+return( to );
+ }
+#endif
+ if ( local_encoding==e_utf8 )
+ len *= 3;
+ if ( local_encoding>=e_first2byte )
+ len *= 2;
+ to = galloc(len+sizeof(unichar_t));
+ ret = u2encoding_strncpy(to,ufrom,len,local_encoding);
+ if ( ret==NULL )
+ free( to );
+ else if ( local_encoding<e_first2byte )
+ to[len] = '\0';
+ else {
+ to[len] = '\0';
+ to[len+1] = '\0';
+ }
+return( ret );
+}
+
+char *def2utf8_copy(const char *from) {
+ int len;
+ char *ret;
+ unichar_t *temp, *uto;
+
+ if ( from==NULL )
+return( NULL );
+ len = strlen(from);
+#if HAVE_ICONV_H
+ if ( my_iconv_setup() ) {
+ size_t in_left = len, out_left = 3*(len+1);
+ char *cto = (char *) galloc(3*(len+1)), *cret = cto;
+ iconv(to_utf8, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
+ *cto++ = '\0';
+ *cto++ = '\0';
+#ifndef UNICHAR_16
+ *cto++ = '\0';
+ *cto++ = '\0';
+#endif
+return( cret );
+ }
+#endif
+ uto = galloc(sizeof(unichar_t)*(len+1));
+ temp = encoding2u_strncpy(uto,from,len,local_encoding);
+ if ( temp==NULL ) {
+ free( uto );
+return( NULL );
+ }
+ uto[len] = '\0';
+ ret = u2utf8_copy(uto);
+ free(uto);
+return( ret );
+}
+
+char *utf82def_copy(const char *ufrom) {
+ int len;
+ char *ret;
+ unichar_t *u2from;
+
+ if ( ufrom==NULL )
+return( NULL );
+ len = strlen(ufrom);
+#if HAVE_ICONV_H
+ if ( my_iconv_setup() ) {
+ size_t in_left = len, out_left = 3*len;
+ char *cfrom = (char *) ufrom, *cto, *to;
+ cto = to = galloc(3*len+2);
+ iconv(from_utf8, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
+ *cto++ = '\0';
+ *cto++ = '\0';
+#ifndef UNICHAR_16
+ *cto++ = '\0';
+ *cto++ = '\0';
+#endif
+return( to );
+ }
+#endif
+ if ( local_encoding==e_utf8 )
+return( copy( ufrom )); /* Well that's easy */
+ u2from = utf82u_copy(ufrom);
+ ret = u2def_copy(u2from);
+ free(u2from);
+return( ret );
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/unialt.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/unialt.c
new file mode 100644
index 00000000000..77b8e6cf700
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/unialt.c
@@ -0,0 +1,8885 @@
+#include <chardata.h>
+
+static const unichar_t str_a0[] = { 0x0020, 0 };
+static const unichar_t str_a8[] = { 0x0020, 0x0308, 0 };
+static const unichar_t str_aa[] = { 0x0061, 0 };
+static const unichar_t str_af[] = { 0x0020, 0x0304, 0 };
+static const unichar_t str_b2[] = { 0x0032, 0 };
+static const unichar_t str_b3[] = { 0x0033, 0 };
+static const unichar_t str_b4[] = { 0x0020, 0x0301, 0 };
+static const unichar_t str_b5[] = { 0x03bc, 0 };
+static const unichar_t str_b8[] = { 0x0020, 0x0327, 0 };
+static const unichar_t str_b9[] = { 0x0031, 0 };
+static const unichar_t str_ba[] = { 0x006f, 0 };
+static const unichar_t str_bc[] = { 0x0031, 0x2044, 0x0034, 0 };
+static const unichar_t str_bd[] = { 0x0031, 0x2044, 0x0032, 0 };
+static const unichar_t str_be[] = { 0x0033, 0x2044, 0x0034, 0 };
+static const unichar_t str_c0[] = { 0x0041, 0x0300, 0 };
+static const unichar_t str_c1[] = { 0x0041, 0x0301, 0 };
+static const unichar_t str_c2[] = { 0x0041, 0x0302, 0 };
+static const unichar_t str_c3[] = { 0x0041, 0x0303, 0 };
+static const unichar_t str_c4[] = { 0x0041, 0x0308, 0 };
+static const unichar_t str_c5[] = { 0x0041, 0x030a, 0 };
+static const unichar_t str_c7[] = { 0x0043, 0x0327, 0 };
+static const unichar_t str_c8[] = { 0x0045, 0x0300, 0 };
+static const unichar_t str_c9[] = { 0x0045, 0x0301, 0 };
+static const unichar_t str_ca[] = { 0x0045, 0x0302, 0 };
+static const unichar_t str_cb[] = { 0x0045, 0x0308, 0 };
+static const unichar_t str_cc[] = { 0x0049, 0x0300, 0 };
+static const unichar_t str_cd[] = { 0x0049, 0x0301, 0 };
+static const unichar_t str_ce[] = { 0x0049, 0x0302, 0 };
+static const unichar_t str_cf[] = { 0x0049, 0x0308, 0 };
+static const unichar_t str_d1[] = { 0x004e, 0x0303, 0 };
+static const unichar_t str_d2[] = { 0x004f, 0x0300, 0 };
+static const unichar_t str_d3[] = { 0x004f, 0x0301, 0 };
+static const unichar_t str_d4[] = { 0x004f, 0x0302, 0 };
+static const unichar_t str_d5[] = { 0x004f, 0x0303, 0 };
+static const unichar_t str_d6[] = { 0x004f, 0x0308, 0 };
+static const unichar_t str_d9[] = { 0x0055, 0x0300, 0 };
+static const unichar_t str_da[] = { 0x0055, 0x0301, 0 };
+static const unichar_t str_db[] = { 0x0055, 0x0302, 0 };
+static const unichar_t str_dc[] = { 0x0055, 0x0308, 0 };
+static const unichar_t str_dd[] = { 0x0059, 0x0301, 0 };
+static const unichar_t str_e0[] = { 0x0061, 0x0300, 0 };
+static const unichar_t str_e1[] = { 0x0061, 0x0301, 0 };
+static const unichar_t str_e2[] = { 0x0061, 0x0302, 0 };
+static const unichar_t str_e3[] = { 0x0061, 0x0303, 0 };
+static const unichar_t str_e4[] = { 0x0061, 0x0308, 0 };
+static const unichar_t str_e5[] = { 0x0061, 0x030a, 0 };
+static const unichar_t str_e7[] = { 0x0063, 0x0327, 0 };
+static const unichar_t str_e8[] = { 0x0065, 0x0300, 0 };
+static const unichar_t str_e9[] = { 0x0065, 0x0301, 0 };
+static const unichar_t str_ea[] = { 0x0065, 0x0302, 0 };
+static const unichar_t str_eb[] = { 0x0065, 0x0308, 0 };
+static const unichar_t str_ec[] = { 0x0069, 0x0300, 0 };
+static const unichar_t str_ed[] = { 0x0069, 0x0301, 0 };
+static const unichar_t str_ee[] = { 0x0069, 0x0302, 0 };
+static const unichar_t str_ef[] = { 0x0069, 0x0308, 0 };
+static const unichar_t str_f1[] = { 0x006e, 0x0303, 0 };
+static const unichar_t str_f2[] = { 0x006f, 0x0300, 0 };
+static const unichar_t str_f3[] = { 0x006f, 0x0301, 0 };
+static const unichar_t str_f4[] = { 0x006f, 0x0302, 0 };
+static const unichar_t str_f5[] = { 0x006f, 0x0303, 0 };
+static const unichar_t str_f6[] = { 0x006f, 0x0308, 0 };
+static const unichar_t str_f9[] = { 0x0075, 0x0300, 0 };
+static const unichar_t str_fa[] = { 0x0075, 0x0301, 0 };
+static const unichar_t str_fb[] = { 0x0075, 0x0302, 0 };
+static const unichar_t str_fc[] = { 0x0075, 0x0308, 0 };
+static const unichar_t str_fd[] = { 0x0079, 0x0301, 0 };
+static const unichar_t str_ff[] = { 0x0079, 0x0308, 0 };
+static const unichar_t str_100[] = { 0x0041, 0x0304, 0 };
+static const unichar_t str_101[] = { 0x0061, 0x0304, 0 };
+static const unichar_t str_102[] = { 0x0041, 0x0306, 0 };
+static const unichar_t str_103[] = { 0x0061, 0x0306, 0 };
+static const unichar_t str_104[] = { 0x0041, 0x0328, 0 };
+static const unichar_t str_105[] = { 0x0061, 0x0328, 0 };
+static const unichar_t str_106[] = { 0x0043, 0x0301, 0 };
+static const unichar_t str_107[] = { 0x0063, 0x0301, 0 };
+static const unichar_t str_108[] = { 0x0043, 0x0302, 0 };
+static const unichar_t str_109[] = { 0x0063, 0x0302, 0 };
+static const unichar_t str_10a[] = { 0x0043, 0x0307, 0 };
+static const unichar_t str_10b[] = { 0x0063, 0x0307, 0 };
+static const unichar_t str_10c[] = { 0x0043, 0x030c, 0 };
+static const unichar_t str_10d[] = { 0x0063, 0x030c, 0 };
+static const unichar_t str_10e[] = { 0x0044, 0x030c, 0 };
+static const unichar_t str_10f[] = { 0x0064, 0x030c, 0 };
+static const unichar_t str_110[] = { 0x00d0, 0 };
+static const unichar_t str_112[] = { 0x0045, 0x0304, 0 };
+static const unichar_t str_113[] = { 0x0065, 0x0304, 0 };
+static const unichar_t str_114[] = { 0x0045, 0x0306, 0 };
+static const unichar_t str_115[] = { 0x0065, 0x0306, 0 };
+static const unichar_t str_116[] = { 0x0045, 0x0307, 0 };
+static const unichar_t str_117[] = { 0x0065, 0x0307, 0 };
+static const unichar_t str_118[] = { 0x0045, 0x0328, 0 };
+static const unichar_t str_119[] = { 0x0065, 0x0328, 0 };
+static const unichar_t str_11a[] = { 0x0045, 0x030c, 0 };
+static const unichar_t str_11b[] = { 0x0065, 0x030c, 0 };
+static const unichar_t str_11c[] = { 0x0047, 0x0302, 0 };
+static const unichar_t str_11d[] = { 0x0067, 0x0302, 0 };
+static const unichar_t str_11e[] = { 0x0047, 0x0306, 0 };
+static const unichar_t str_11f[] = { 0x0067, 0x0306, 0 };
+static const unichar_t str_120[] = { 0x0047, 0x0307, 0 };
+static const unichar_t str_121[] = { 0x0067, 0x0307, 0 };
+static const unichar_t str_122[] = { 0x0047, 0x0327, 0 };
+static const unichar_t str_123[] = { 0x0067, 0x0327, 0 };
+static const unichar_t str_124[] = { 0x0048, 0x0302, 0 };
+static const unichar_t str_125[] = { 0x0068, 0x0302, 0 };
+static const unichar_t str_128[] = { 0x0049, 0x0303, 0 };
+static const unichar_t str_129[] = { 0x0069, 0x0303, 0 };
+static const unichar_t str_12a[] = { 0x0049, 0x0304, 0 };
+static const unichar_t str_12b[] = { 0x0069, 0x0304, 0 };
+static const unichar_t str_12c[] = { 0x0049, 0x0306, 0 };
+static const unichar_t str_12d[] = { 0x0069, 0x0306, 0 };
+static const unichar_t str_12e[] = { 0x0049, 0x0328, 0 };
+static const unichar_t str_12f[] = { 0x0069, 0x0328, 0 };
+static const unichar_t str_130[] = { 0x0049, 0x0307, 0 };
+static const unichar_t str_132[] = { 0x0049, 0x004a, 0 };
+static const unichar_t str_133[] = { 0x0069, 0x006a, 0 };
+static const unichar_t str_134[] = { 0x004a, 0x0302, 0 };
+static const unichar_t str_135[] = { 0x006a, 0x0302, 0 };
+static const unichar_t str_136[] = { 0x004b, 0x0327, 0 };
+static const unichar_t str_137[] = { 0x006b, 0x0327, 0 };
+static const unichar_t str_138[] = { 0x03ba, 0 };
+static const unichar_t str_139[] = { 0x004c, 0x0301, 0 };
+static const unichar_t str_13a[] = { 0x006c, 0x0301, 0 };
+static const unichar_t str_13b[] = { 0x004c, 0x0327, 0 };
+static const unichar_t str_13c[] = { 0x006c, 0x0327, 0 };
+static const unichar_t str_13d[] = { 0x004c, 0x030c, 0 };
+static const unichar_t str_13e[] = { 0x006c, 0x030c, 0 };
+static const unichar_t str_13f[] = { 0x004c, 0x00b7, 0 };
+static const unichar_t str_140[] = { 0x006c, 0x00b7, 0 };
+static const unichar_t str_143[] = { 0x004e, 0x0301, 0 };
+static const unichar_t str_144[] = { 0x006e, 0x0301, 0 };
+static const unichar_t str_145[] = { 0x004e, 0x0327, 0 };
+static const unichar_t str_146[] = { 0x006e, 0x0327, 0 };
+static const unichar_t str_147[] = { 0x004e, 0x030c, 0 };
+static const unichar_t str_148[] = { 0x006e, 0x030c, 0 };
+static const unichar_t str_149[] = { 0x02bc, 0x006e, 0 };
+static const unichar_t str_14c[] = { 0x004f, 0x0304, 0 };
+static const unichar_t str_14d[] = { 0x006f, 0x0304, 0 };
+static const unichar_t str_14e[] = { 0x004f, 0x0306, 0 };
+static const unichar_t str_14f[] = { 0x006f, 0x0306, 0 };
+static const unichar_t str_150[] = { 0x004f, 0x030b, 0 };
+static const unichar_t str_151[] = { 0x006f, 0x030b, 0 };
+static const unichar_t str_152[] = { 0x004f, 0x0045, 0 };
+static const unichar_t str_153[] = { 0x006f, 0x0065, 0 };
+static const unichar_t str_154[] = { 0x0052, 0x0301, 0 };
+static const unichar_t str_155[] = { 0x0072, 0x0301, 0 };
+static const unichar_t str_156[] = { 0x0052, 0x0327, 0 };
+static const unichar_t str_157[] = { 0x0072, 0x0327, 0 };
+static const unichar_t str_158[] = { 0x0052, 0x030c, 0 };
+static const unichar_t str_159[] = { 0x0072, 0x030c, 0 };
+static const unichar_t str_15a[] = { 0x0053, 0x0301, 0 };
+static const unichar_t str_15b[] = { 0x0073, 0x0301, 0 };
+static const unichar_t str_15c[] = { 0x0053, 0x0302, 0 };
+static const unichar_t str_15d[] = { 0x0073, 0x0302, 0 };
+static const unichar_t str_15e[] = { 0x0053, 0x0327, 0 };
+static const unichar_t str_15f[] = { 0x0073, 0x0327, 0 };
+static const unichar_t str_160[] = { 0x0053, 0x030c, 0 };
+static const unichar_t str_161[] = { 0x0073, 0x030c, 0 };
+static const unichar_t str_162[] = { 0x0054, 0x0327, 0 };
+static const unichar_t str_163[] = { 0x0074, 0x0327, 0 };
+static const unichar_t str_164[] = { 0x0054, 0x030c, 0 };
+static const unichar_t str_165[] = { 0x0074, 0x030c, 0 };
+static const unichar_t str_168[] = { 0x0055, 0x0303, 0 };
+static const unichar_t str_169[] = { 0x0075, 0x0303, 0 };
+static const unichar_t str_16a[] = { 0x0055, 0x0304, 0 };
+static const unichar_t str_16b[] = { 0x0075, 0x0304, 0 };
+static const unichar_t str_16c[] = { 0x0055, 0x0306, 0 };
+static const unichar_t str_16d[] = { 0x0075, 0x0306, 0 };
+static const unichar_t str_16e[] = { 0x0055, 0x030a, 0 };
+static const unichar_t str_16f[] = { 0x0075, 0x030a, 0 };
+static const unichar_t str_170[] = { 0x0055, 0x030b, 0 };
+static const unichar_t str_171[] = { 0x0075, 0x030b, 0 };
+static const unichar_t str_172[] = { 0x0055, 0x0328, 0 };
+static const unichar_t str_173[] = { 0x0075, 0x0328, 0 };
+static const unichar_t str_174[] = { 0x0057, 0x0302, 0 };
+static const unichar_t str_175[] = { 0x0077, 0x0302, 0 };
+static const unichar_t str_176[] = { 0x0059, 0x0302, 0 };
+static const unichar_t str_177[] = { 0x0079, 0x0302, 0 };
+static const unichar_t str_178[] = { 0x0059, 0x0308, 0 };
+static const unichar_t str_179[] = { 0x005a, 0x0301, 0 };
+static const unichar_t str_17a[] = { 0x007a, 0x0301, 0 };
+static const unichar_t str_17b[] = { 0x005a, 0x0307, 0 };
+static const unichar_t str_17c[] = { 0x007a, 0x0307, 0 };
+static const unichar_t str_17d[] = { 0x005a, 0x030c, 0 };
+static const unichar_t str_17e[] = { 0x007a, 0x030c, 0 };
+static const unichar_t str_17f[] = { 0x0073, 0 };
+static const unichar_t str_182[] = { 0x0402, 0 };
+static const unichar_t str_189[] = { 0x00d0, 0 };
+static const unichar_t str_19e[] = { 0x03b7, 0 };
+static const unichar_t str_19f[] = { 0x0398, 0 };
+static const unichar_t str_1a0[] = { 0x004f, 0x031b, 0 };
+static const unichar_t str_1a1[] = { 0x006f, 0x031b, 0 };
+static const unichar_t str_1a9[] = { 0x03a3, 0 };
+static const unichar_t str_1af[] = { 0x0055, 0x031b, 0 };
+static const unichar_t str_1b0[] = { 0x0075, 0x031b, 0 };
+static const unichar_t str_1c0[] = { 0x007c, 0 };
+static const unichar_t str_1c1[] = { 0x007c, 0x007c, 0 };
+static const unichar_t str_1c4[] = { 0x0044, 0x017d, 0 };
+static const unichar_t str_1c5[] = { 0x0044, 0x017e, 0 };
+static const unichar_t str_1c6[] = { 0x0064, 0x017e, 0 };
+static const unichar_t str_1c7[] = { 0x004c, 0x004a, 0 };
+static const unichar_t str_1c8[] = { 0x004c, 0x006a, 0 };
+static const unichar_t str_1c9[] = { 0x006c, 0x006a, 0 };
+static const unichar_t str_1ca[] = { 0x004e, 0x004a, 0 };
+static const unichar_t str_1cb[] = { 0x004e, 0x006a, 0 };
+static const unichar_t str_1cc[] = { 0x006e, 0x006a, 0 };
+static const unichar_t str_1cd[] = { 0x0041, 0x030c, 0 };
+static const unichar_t str_1ce[] = { 0x0061, 0x030c, 0 };
+static const unichar_t str_1cf[] = { 0x0049, 0x030c, 0 };
+static const unichar_t str_1d0[] = { 0x0069, 0x030c, 0 };
+static const unichar_t str_1d1[] = { 0x004f, 0x030c, 0 };
+static const unichar_t str_1d2[] = { 0x006f, 0x030c, 0 };
+static const unichar_t str_1d3[] = { 0x0055, 0x030c, 0 };
+static const unichar_t str_1d4[] = { 0x0075, 0x030c, 0 };
+static const unichar_t str_1d5[] = { 0x00dc, 0x0304, 0 };
+static const unichar_t str_1d6[] = { 0x00fc, 0x0304, 0 };
+static const unichar_t str_1d7[] = { 0x00dc, 0x0301, 0 };
+static const unichar_t str_1d8[] = { 0x00fc, 0x0301, 0 };
+static const unichar_t str_1d9[] = { 0x00dc, 0x030c, 0 };
+static const unichar_t str_1da[] = { 0x00fc, 0x030c, 0 };
+static const unichar_t str_1db[] = { 0x00dc, 0x0300, 0 };
+static const unichar_t str_1dc[] = { 0x00fc, 0x0300, 0 };
+static const unichar_t str_1de[] = { 0x00c4, 0x0304, 0 };
+static const unichar_t str_1df[] = { 0x00e4, 0x0304, 0 };
+static const unichar_t str_1e0[] = { 0x0226, 0x0304, 0 };
+static const unichar_t str_1e1[] = { 0x0227, 0x0304, 0 };
+static const unichar_t str_1e2[] = { 0x00c6, 0x0304, 0 };
+static const unichar_t str_1e3[] = { 0x00e6, 0x0304, 0 };
+static const unichar_t str_1e6[] = { 0x0047, 0x030c, 0 };
+static const unichar_t str_1e7[] = { 0x0067, 0x030c, 0 };
+static const unichar_t str_1e8[] = { 0x004b, 0x030c, 0 };
+static const unichar_t str_1e9[] = { 0x006b, 0x030c, 0 };
+static const unichar_t str_1ea[] = { 0x004f, 0x0328, 0 };
+static const unichar_t str_1eb[] = { 0x006f, 0x0328, 0 };
+static const unichar_t str_1ec[] = { 0x01ea, 0x0304, 0 };
+static const unichar_t str_1ed[] = { 0x01eb, 0x0304, 0 };
+static const unichar_t str_1ee[] = { 0x01b7, 0x030c, 0 };
+static const unichar_t str_1ef[] = { 0x0292, 0x030c, 0 };
+static const unichar_t str_1f0[] = { 0x006a, 0x030c, 0 };
+static const unichar_t str_1f1[] = { 0x0044, 0x005a, 0 };
+static const unichar_t str_1f2[] = { 0x0044, 0x007a, 0 };
+static const unichar_t str_1f3[] = { 0x0064, 0x007a, 0 };
+static const unichar_t str_1f4[] = { 0x0047, 0x0301, 0 };
+static const unichar_t str_1f5[] = { 0x0067, 0x0301, 0 };
+static const unichar_t str_1f8[] = { 0x004e, 0x0300, 0 };
+static const unichar_t str_1f9[] = { 0x006e, 0x0300, 0 };
+static const unichar_t str_1fa[] = { 0x00c5, 0x0301, 0 };
+static const unichar_t str_1fb[] = { 0x00e5, 0x0301, 0 };
+static const unichar_t str_1fc[] = { 0x00c6, 0x0301, 0 };
+static const unichar_t str_1fd[] = { 0x00e6, 0x0301, 0 };
+static const unichar_t str_1fe[] = { 0x00d8, 0x0301, 0 };
+static const unichar_t str_1ff[] = { 0x00f8, 0x0301, 0 };
+static const unichar_t str_200[] = { 0x0041, 0x030f, 0 };
+static const unichar_t str_201[] = { 0x0061, 0x030f, 0 };
+static const unichar_t str_202[] = { 0x0041, 0x0311, 0 };
+static const unichar_t str_203[] = { 0x0061, 0x0311, 0 };
+static const unichar_t str_204[] = { 0x0045, 0x030f, 0 };
+static const unichar_t str_205[] = { 0x0065, 0x030f, 0 };
+static const unichar_t str_206[] = { 0x0045, 0x0311, 0 };
+static const unichar_t str_207[] = { 0x0065, 0x0311, 0 };
+static const unichar_t str_208[] = { 0x0049, 0x030f, 0 };
+static const unichar_t str_209[] = { 0x0069, 0x030f, 0 };
+static const unichar_t str_20a[] = { 0x0049, 0x0311, 0 };
+static const unichar_t str_20b[] = { 0x0069, 0x0311, 0 };
+static const unichar_t str_20c[] = { 0x004f, 0x030f, 0 };
+static const unichar_t str_20d[] = { 0x006f, 0x030f, 0 };
+static const unichar_t str_20e[] = { 0x004f, 0x0311, 0 };
+static const unichar_t str_20f[] = { 0x006f, 0x0311, 0 };
+static const unichar_t str_210[] = { 0x0052, 0x030f, 0 };
+static const unichar_t str_211[] = { 0x0072, 0x030f, 0 };
+static const unichar_t str_212[] = { 0x0052, 0x0311, 0 };
+static const unichar_t str_213[] = { 0x0072, 0x0311, 0 };
+static const unichar_t str_214[] = { 0x0055, 0x030f, 0 };
+static const unichar_t str_215[] = { 0x0075, 0x030f, 0 };
+static const unichar_t str_216[] = { 0x0055, 0x0311, 0 };
+static const unichar_t str_217[] = { 0x0075, 0x0311, 0 };
+static const unichar_t str_218[] = { 0x0053, 0x0326, 0 };
+static const unichar_t str_219[] = { 0x0073, 0x0326, 0 };
+static const unichar_t str_21a[] = { 0x0054, 0x0326, 0 };
+static const unichar_t str_21b[] = { 0x0074, 0x0326, 0 };
+static const unichar_t str_21e[] = { 0x0048, 0x030c, 0 };
+static const unichar_t str_21f[] = { 0x0068, 0x030c, 0 };
+static const unichar_t str_226[] = { 0x0041, 0x0307, 0 };
+static const unichar_t str_227[] = { 0x0061, 0x0307, 0 };
+static const unichar_t str_228[] = { 0x0045, 0x0327, 0 };
+static const unichar_t str_229[] = { 0x0065, 0x0327, 0 };
+static const unichar_t str_22a[] = { 0x00d6, 0x0304, 0 };
+static const unichar_t str_22b[] = { 0x00f6, 0x0304, 0 };
+static const unichar_t str_22c[] = { 0x00d5, 0x0304, 0 };
+static const unichar_t str_22d[] = { 0x00f5, 0x0304, 0 };
+static const unichar_t str_22e[] = { 0x004f, 0x0307, 0 };
+static const unichar_t str_22f[] = { 0x006f, 0x0307, 0 };
+static const unichar_t str_230[] = { 0x022e, 0x0304, 0 };
+static const unichar_t str_231[] = { 0x022f, 0x0304, 0 };
+static const unichar_t str_232[] = { 0x0059, 0x0304, 0 };
+static const unichar_t str_233[] = { 0x0079, 0x0304, 0 };
+static const unichar_t str_269[] = { 0x03b9, 0 };
+static const unichar_t str_278[] = { 0x03a6, 0 };
+static const unichar_t str_292[] = { 0x01b7, 0 };
+static const unichar_t str_299[] = { 0x0432, 0 };
+static const unichar_t str_29c[] = { 0x043d, 0 };
+static const unichar_t str_2b0[] = { 0x0068, 0 };
+static const unichar_t str_2b1[] = { 0x0266, 0 };
+static const unichar_t str_2b2[] = { 0x006a, 0 };
+static const unichar_t str_2b3[] = { 0x0072, 0 };
+static const unichar_t str_2b4[] = { 0x0279, 0 };
+static const unichar_t str_2b5[] = { 0x027b, 0 };
+static const unichar_t str_2b6[] = { 0x0281, 0 };
+static const unichar_t str_2b7[] = { 0x0077, 0 };
+static const unichar_t str_2b8[] = { 0x0079, 0 };
+static const unichar_t str_2b9[] = { 0x0027, 0 };
+static const unichar_t str_2ba[] = { 0x0022, 0 };
+static const unichar_t str_2bc[] = { 0x0027, 0 };
+static const unichar_t str_2c4[] = { 0x005e, 0 };
+static const unichar_t str_2c6[] = { 0x005e, 0 };
+static const unichar_t str_2c8[] = { 0x0027, 0 };
+static const unichar_t str_2d8[] = { 0x0020, 0x0306, 0 };
+static const unichar_t str_2d9[] = { 0x0020, 0x0307, 0 };
+static const unichar_t str_2da[] = { 0x0020, 0x030a, 0 };
+static const unichar_t str_2db[] = { 0x0020, 0x0328, 0 };
+static const unichar_t str_2dc[] = { 0x0020, 0x0303, 0 };
+static const unichar_t str_2dd[] = { 0x0020, 0x030b, 0 };
+static const unichar_t str_2e0[] = { 0x0263, 0 };
+static const unichar_t str_2e1[] = { 0x006c, 0 };
+static const unichar_t str_2e2[] = { 0x0073, 0 };
+static const unichar_t str_2e3[] = { 0x0078, 0 };
+static const unichar_t str_2e4[] = { 0x0295, 0 };
+static const unichar_t str_301[] = { 0x00b4, 0 };
+static const unichar_t str_302[] = { 0x005e, 0 };
+static const unichar_t str_303[] = { 0x007e, 0 };
+static const unichar_t str_308[] = { 0x00a8, 0 };
+static const unichar_t str_30a[] = { 0x00b0, 0 };
+static const unichar_t str_30b[] = { 0x0022, 0 };
+static const unichar_t str_30e[] = { 0x0022, 0 };
+static const unichar_t str_327[] = { 0x00b8, 0 };
+static const unichar_t str_340[] = { 0x0300, 0 };
+static const unichar_t str_341[] = { 0x0301, 0 };
+static const unichar_t str_343[] = { 0x0313, 0 };
+static const unichar_t str_344[] = { 0x0308, 0x0301, 0 };
+static const unichar_t str_374[] = { 0x02b9, 0 };
+static const unichar_t str_375[] = { 0x02cf, 0 };
+static const unichar_t str_37a[] = { 0x0020, 0x0345, 0 };
+static const unichar_t str_37e[] = { 0x003b, 0 };
+static const unichar_t str_384[] = { 0x0020, 0x0301, 0 };
+static const unichar_t str_385[] = { 0x00a8, 0x0301, 0 };
+static const unichar_t str_386[] = { 0x0391, 0x0301, 0 };
+static const unichar_t str_387[] = { 0x00b7, 0 };
+static const unichar_t str_388[] = { 0x0395, 0x0301, 0 };
+static const unichar_t str_389[] = { 0x0397, 0x0301, 0 };
+static const unichar_t str_38a[] = { 0x0399, 0x0301, 0 };
+static const unichar_t str_38c[] = { 0x039f, 0x0301, 0 };
+static const unichar_t str_38e[] = { 0x03a5, 0x0301, 0 };
+static const unichar_t str_38f[] = { 0x03a9, 0x0301, 0 };
+static const unichar_t str_390[] = { 0x03ca, 0x0301, 0 };
+static const unichar_t str_391[] = { 0x0041, 0 };
+static const unichar_t str_392[] = { 0x0042, 0 };
+static const unichar_t str_393[] = { 0x0413, 0 };
+static const unichar_t str_395[] = { 0x0045, 0 };
+static const unichar_t str_396[] = { 0x005a, 0 };
+static const unichar_t str_397[] = { 0x0048, 0 };
+static const unichar_t str_399[] = { 0x0049, 0 };
+static const unichar_t str_39a[] = { 0x004b, 0 };
+static const unichar_t str_39c[] = { 0x004d, 0 };
+static const unichar_t str_39d[] = { 0x004e, 0 };
+static const unichar_t str_39f[] = { 0x004f, 0 };
+static const unichar_t str_3a1[] = { 0x0050, 0 };
+static const unichar_t str_3a4[] = { 0x0054, 0 };
+static const unichar_t str_3a5[] = { 0x0059, 0 };
+static const unichar_t str_3a7[] = { 0x0058, 0 };
+static const unichar_t str_3aa[] = { 0x0399, 0x0308, 0 };
+static const unichar_t str_3ab[] = { 0x03a5, 0x0308, 0 };
+static const unichar_t str_3ac[] = { 0x03b1, 0x0301, 0 };
+static const unichar_t str_3ad[] = { 0x03b5, 0x0301, 0 };
+static const unichar_t str_3ae[] = { 0x03b7, 0x0301, 0 };
+static const unichar_t str_3af[] = { 0x03b9, 0x0301, 0 };
+static const unichar_t str_3b0[] = { 0x03cb, 0x0301, 0 };
+static const unichar_t str_3ba[] = { 0x0138, 0 };
+static const unichar_t str_3bf[] = { 0x006f, 0 };
+static const unichar_t str_3c1[] = { 0x0070, 0 };
+static const unichar_t str_3c7[] = { 0x0078, 0 };
+static const unichar_t str_3ca[] = { 0x03b9, 0x0308, 0 };
+static const unichar_t str_3cb[] = { 0x03c5, 0x0308, 0 };
+static const unichar_t str_3cc[] = { 0x03bf, 0x0301, 0 };
+static const unichar_t str_3cd[] = { 0x03c5, 0x0301, 0 };
+static const unichar_t str_3ce[] = { 0x03c9, 0x0301, 0 };
+static const unichar_t str_3d0[] = { 0x03b2, 0 };
+static const unichar_t str_3d1[] = { 0x03b8, 0 };
+static const unichar_t str_3d2[] = { 0x03a5, 0 };
+static const unichar_t str_3d3[] = { 0x03d2, 0x0301, 0 };
+static const unichar_t str_3d4[] = { 0x03d2, 0x0308, 0 };
+static const unichar_t str_3d5[] = { 0x03c6, 0 };
+static const unichar_t str_3d6[] = { 0x03c0, 0 };
+static const unichar_t str_3f0[] = { 0x03ba, 0 };
+static const unichar_t str_3f1[] = { 0x03c1, 0 };
+static const unichar_t str_3f2[] = { 0x03c2, 0 };
+static const unichar_t str_3f4[] = { 0x0398, 0 };
+static const unichar_t str_3f5[] = { 0x03b5, 0 };
+static const unichar_t str_3f9[] = { 0x03a3, 0 };
+static const unichar_t str_400[] = { 0x0415, 0x0300, 0 };
+static const unichar_t str_401[] = { 0x0415, 0x0308, 0 };
+static const unichar_t str_403[] = { 0x0413, 0x0301, 0 };
+static const unichar_t str_405[] = { 0x0053, 0 };
+static const unichar_t str_406[] = { 0x0049, 0 };
+static const unichar_t str_407[] = { 0x0406, 0x0308, 0 };
+static const unichar_t str_408[] = { 0x004a, 0 };
+static const unichar_t str_40c[] = { 0x041a, 0x0301, 0 };
+static const unichar_t str_40d[] = { 0x0418, 0x0300, 0 };
+static const unichar_t str_40e[] = { 0x0423, 0x0306, 0 };
+static const unichar_t str_410[] = { 0x0041, 0 };
+static const unichar_t str_412[] = { 0x0042, 0 };
+static const unichar_t str_413[] = { 0x0393, 0 };
+static const unichar_t str_415[] = { 0x0045, 0 };
+static const unichar_t str_419[] = { 0x0418, 0x0306, 0 };
+static const unichar_t str_41a[] = { 0x004b, 0 };
+static const unichar_t str_41c[] = { 0x004d, 0 };
+static const unichar_t str_41d[] = { 0x0048, 0 };
+static const unichar_t str_41e[] = { 0x004f, 0 };
+static const unichar_t str_41f[] = { 0x03a0, 0 };
+static const unichar_t str_420[] = { 0x0050, 0 };
+static const unichar_t str_421[] = { 0x0043, 0 };
+static const unichar_t str_422[] = { 0x0054, 0 };
+static const unichar_t str_424[] = { 0x03a6, 0 };
+static const unichar_t str_425[] = { 0x0058, 0 };
+static const unichar_t str_430[] = { 0x0061, 0 };
+static const unichar_t str_435[] = { 0x0065, 0 };
+static const unichar_t str_439[] = { 0x0438, 0x0306, 0 };
+static const unichar_t str_43a[] = { 0x03ba, 0 };
+static const unichar_t str_43e[] = { 0x006f, 0 };
+static const unichar_t str_43f[] = { 0x03c0, 0 };
+static const unichar_t str_440[] = { 0x0070, 0 };
+static const unichar_t str_441[] = { 0x0063, 0 };
+static const unichar_t str_443[] = { 0x0079, 0 };
+static const unichar_t str_445[] = { 0x0078, 0 };
+static const unichar_t str_450[] = { 0x0435, 0x0300, 0 };
+static const unichar_t str_451[] = { 0x0435, 0x0308, 0 };
+static const unichar_t str_453[] = { 0x0433, 0x0301, 0 };
+static const unichar_t str_455[] = { 0x0073, 0 };
+static const unichar_t str_456[] = { 0x0069, 0 };
+static const unichar_t str_457[] = { 0x0456, 0x0308, 0 };
+static const unichar_t str_458[] = { 0x006a, 0 };
+static const unichar_t str_45c[] = { 0x043a, 0x0301, 0 };
+static const unichar_t str_45d[] = { 0x0438, 0x0300, 0 };
+static const unichar_t str_45e[] = { 0x0443, 0x0306, 0 };
+static const unichar_t str_470[] = { 0x03a8, 0 };
+static const unichar_t str_471[] = { 0x03c8, 0 };
+static const unichar_t str_476[] = { 0x0474, 0x030f, 0 };
+static const unichar_t str_477[] = { 0x0475, 0x030f, 0 };
+static const unichar_t str_4ae[] = { 0x0059, 0 };
+static const unichar_t str_4c0[] = { 0x0049, 0 };
+static const unichar_t str_4c1[] = { 0x0416, 0x0306, 0 };
+static const unichar_t str_4c2[] = { 0x0436, 0x0306, 0 };
+static const unichar_t str_4d0[] = { 0x0410, 0x0306, 0 };
+static const unichar_t str_4d1[] = { 0x0430, 0x0306, 0 };
+static const unichar_t str_4d2[] = { 0x0410, 0x0308, 0 };
+static const unichar_t str_4d3[] = { 0x0430, 0x0308, 0 };
+static const unichar_t str_4d4[] = { 0x00c6, 0 };
+static const unichar_t str_4d5[] = { 0x00e6, 0 };
+static const unichar_t str_4d6[] = { 0x0415, 0x0306, 0 };
+static const unichar_t str_4d7[] = { 0x0435, 0x0306, 0 };
+static const unichar_t str_4da[] = { 0x04d8, 0x0308, 0 };
+static const unichar_t str_4db[] = { 0x04d9, 0x0308, 0 };
+static const unichar_t str_4dc[] = { 0x0416, 0x0308, 0 };
+static const unichar_t str_4dd[] = { 0x0436, 0x0308, 0 };
+static const unichar_t str_4de[] = { 0x0417, 0x0308, 0 };
+static const unichar_t str_4df[] = { 0x0437, 0x0308, 0 };
+static const unichar_t str_4e0[] = { 0x01b7, 0 };
+static const unichar_t str_4e1[] = { 0x0292, 0 };
+static const unichar_t str_4e2[] = { 0x0418, 0x0304, 0 };
+static const unichar_t str_4e3[] = { 0x0438, 0x0304, 0 };
+static const unichar_t str_4e4[] = { 0x0418, 0x0308, 0 };
+static const unichar_t str_4e5[] = { 0x0438, 0x0308, 0 };
+static const unichar_t str_4e6[] = { 0x041e, 0x0308, 0 };
+static const unichar_t str_4e7[] = { 0x043e, 0x0308, 0 };
+static const unichar_t str_4e8[] = { 0x0398, 0 };
+static const unichar_t str_4e9[] = { 0x03b8, 0 };
+static const unichar_t str_4ea[] = { 0x04e8, 0x0308, 0 };
+static const unichar_t str_4eb[] = { 0x04e9, 0x0308, 0 };
+static const unichar_t str_4ec[] = { 0x042d, 0x0308, 0 };
+static const unichar_t str_4ed[] = { 0x044d, 0x0308, 0 };
+static const unichar_t str_4ee[] = { 0x0423, 0x0304, 0 };
+static const unichar_t str_4ef[] = { 0x0443, 0x0304, 0 };
+static const unichar_t str_4f0[] = { 0x0423, 0x0308, 0 };
+static const unichar_t str_4f1[] = { 0x0443, 0x0308, 0 };
+static const unichar_t str_4f2[] = { 0x0423, 0x030b, 0 };
+static const unichar_t str_4f3[] = { 0x0443, 0x030b, 0 };
+static const unichar_t str_4f4[] = { 0x0427, 0x0308, 0 };
+static const unichar_t str_4f5[] = { 0x0447, 0x0308, 0 };
+static const unichar_t str_4f8[] = { 0x042b, 0x0308, 0 };
+static const unichar_t str_4f9[] = { 0x044b, 0x0308, 0 };
+static const unichar_t str_54f[] = { 0x0053, 0 };
+static const unichar_t str_555[] = { 0x004f, 0 };
+static const unichar_t str_570[] = { 0x0068, 0 };
+static const unichar_t str_578[] = { 0x006e, 0 };
+static const unichar_t str_57a[] = { 0x0270, 0 };
+static const unichar_t str_57d[] = { 0x0075, 0 };
+static const unichar_t str_581[] = { 0x0261, 0 };
+static const unichar_t str_582[] = { 0x0269, 0 };
+static const unichar_t str_584[] = { 0x0066, 0 };
+static const unichar_t str_585[] = { 0x006f, 0 };
+static const unichar_t str_587[] = { 0x0565, 0x0582, 0 };
+static const unichar_t str_589[] = { 0x003a, 0 };
+static const unichar_t str_5f0[] = { 0x05d5, 0x05d5, 0 };
+static const unichar_t str_5f1[] = { 0x05d5, 0x05d9, 0 };
+static const unichar_t str_5f2[] = { 0x05d9, 0x05d9, 0 };
+static const unichar_t str_60c[] = { 0x2018, 0 };
+static const unichar_t str_621[] = { 0xfe80, 0 };
+static const unichar_t str_622[] = { 0x0627, 0x0653, 0 };
+static const unichar_t str_623[] = { 0x0627, 0x0654, 0 };
+static const unichar_t str_624[] = { 0x0648, 0x0654, 0 };
+static const unichar_t str_625[] = { 0x0627, 0x0655, 0 };
+static const unichar_t str_626[] = { 0x064a, 0x0654, 0 };
+static const unichar_t str_627[] = { 0xfe8d, 0 };
+static const unichar_t str_628[] = { 0xfe8f, 0 };
+static const unichar_t str_629[] = { 0xfe93, 0 };
+static const unichar_t str_62a[] = { 0xfe95, 0 };
+static const unichar_t str_62b[] = { 0xfe99, 0 };
+static const unichar_t str_62c[] = { 0xfe9d, 0 };
+static const unichar_t str_62d[] = { 0xfea1, 0 };
+static const unichar_t str_62e[] = { 0xfea5, 0 };
+static const unichar_t str_62f[] = { 0xfea9, 0 };
+static const unichar_t str_630[] = { 0xfeab, 0 };
+static const unichar_t str_631[] = { 0xfead, 0 };
+static const unichar_t str_632[] = { 0xfeaf, 0 };
+static const unichar_t str_633[] = { 0xfeb1, 0 };
+static const unichar_t str_634[] = { 0xfeb5, 0 };
+static const unichar_t str_635[] = { 0xfeb9, 0 };
+static const unichar_t str_636[] = { 0xfebd, 0 };
+static const unichar_t str_637[] = { 0xfec1, 0 };
+static const unichar_t str_638[] = { 0xfec5, 0 };
+static const unichar_t str_639[] = { 0xfec9, 0 };
+static const unichar_t str_63a[] = { 0xfecd, 0 };
+static const unichar_t str_641[] = { 0xfed1, 0 };
+static const unichar_t str_642[] = { 0xfed5, 0 };
+static const unichar_t str_643[] = { 0xfed9, 0 };
+static const unichar_t str_644[] = { 0xfedd, 0 };
+static const unichar_t str_645[] = { 0xfee1, 0 };
+static const unichar_t str_646[] = { 0xfee5, 0 };
+static const unichar_t str_647[] = { 0xfee9, 0 };
+static const unichar_t str_648[] = { 0xfeed, 0 };
+static const unichar_t str_649[] = { 0xfeef, 0 };
+static const unichar_t str_64a[] = { 0xfef1, 0 };
+static const unichar_t str_66a[] = { 0x0025, 0 };
+static const unichar_t str_66c[] = { 0x002c, 0 };
+static const unichar_t str_66d[] = { 0x22c6, 0 };
+static const unichar_t str_671[] = { 0xfb50, 0 };
+static const unichar_t str_675[] = { 0x0627, 0x0674, 0 };
+static const unichar_t str_676[] = { 0x0648, 0x0674, 0 };
+static const unichar_t str_677[] = { 0x06c7, 0x0674, 0 };
+static const unichar_t str_678[] = { 0x064a, 0x0674, 0 };
+static const unichar_t str_679[] = { 0xfb66, 0 };
+static const unichar_t str_67a[] = { 0xfb5e, 0 };
+static const unichar_t str_67b[] = { 0xfb52, 0 };
+static const unichar_t str_67e[] = { 0xfb56, 0 };
+static const unichar_t str_67f[] = { 0xfb62, 0 };
+static const unichar_t str_680[] = { 0xfb5a, 0 };
+static const unichar_t str_683[] = { 0xfb76, 0 };
+static const unichar_t str_684[] = { 0xfb72, 0 };
+static const unichar_t str_686[] = { 0xfb7a, 0 };
+static const unichar_t str_687[] = { 0xfb7e, 0 };
+static const unichar_t str_688[] = { 0xfb88, 0 };
+static const unichar_t str_68c[] = { 0xfb84, 0 };
+static const unichar_t str_68d[] = { 0xfb82, 0 };
+static const unichar_t str_68e[] = { 0xfb86, 0 };
+static const unichar_t str_691[] = { 0xfb8c, 0 };
+static const unichar_t str_698[] = { 0xfb8a, 0 };
+static const unichar_t str_6a4[] = { 0xfb6a, 0 };
+static const unichar_t str_6a6[] = { 0xfb6e, 0 };
+static const unichar_t str_6a9[] = { 0xfb8e, 0 };
+static const unichar_t str_6ad[] = { 0xfbd3, 0 };
+static const unichar_t str_6af[] = { 0xfb92, 0 };
+static const unichar_t str_6b1[] = { 0xfb9a, 0 };
+static const unichar_t str_6b3[] = { 0xfb96, 0 };
+static const unichar_t str_6ba[] = { 0xfb9e, 0 };
+static const unichar_t str_6bb[] = { 0xfba0, 0 };
+static const unichar_t str_6be[] = { 0xfbaa, 0 };
+static const unichar_t str_6c0[] = { 0x06d5, 0x0654, 0 };
+static const unichar_t str_6c1[] = { 0xfba6, 0 };
+static const unichar_t str_6c2[] = { 0x06c1, 0x0654, 0 };
+static const unichar_t str_6c5[] = { 0xfbe0, 0 };
+static const unichar_t str_6c6[] = { 0xfbd9, 0 };
+static const unichar_t str_6c7[] = { 0xfbd7, 0 };
+static const unichar_t str_6c8[] = { 0xfbdb, 0 };
+static const unichar_t str_6c9[] = { 0xfbe2, 0 };
+static const unichar_t str_6cb[] = { 0xfbde, 0 };
+static const unichar_t str_6cc[] = { 0xfbfc, 0 };
+static const unichar_t str_6d0[] = { 0xfbe4, 0 };
+static const unichar_t str_6d2[] = { 0xfbae, 0 };
+static const unichar_t str_6d3[] = { 0x06d2, 0x0654, 0 };
+static const unichar_t str_6d4[] = { 0x00b7, 0 };
+static const unichar_t str_929[] = { 0x0928, 0x093c, 0 };
+static const unichar_t str_931[] = { 0x0930, 0x093c, 0 };
+static const unichar_t str_934[] = { 0x0933, 0x093c, 0 };
+static const unichar_t str_958[] = { 0x0915, 0x093c, 0 };
+static const unichar_t str_959[] = { 0x0916, 0x093c, 0 };
+static const unichar_t str_95a[] = { 0x0917, 0x093c, 0 };
+static const unichar_t str_95b[] = { 0x091c, 0x093c, 0 };
+static const unichar_t str_95c[] = { 0x0921, 0x093c, 0 };
+static const unichar_t str_95d[] = { 0x0922, 0x093c, 0 };
+static const unichar_t str_95e[] = { 0x092b, 0x093c, 0 };
+static const unichar_t str_95f[] = { 0x092f, 0x093c, 0 };
+static const unichar_t str_9cb[] = { 0x09c7, 0x09be, 0 };
+static const unichar_t str_9cc[] = { 0x09c7, 0x09d7, 0 };
+static const unichar_t str_9dc[] = { 0x09a1, 0x09bc, 0 };
+static const unichar_t str_9dd[] = { 0x09a2, 0x09bc, 0 };
+static const unichar_t str_9df[] = { 0x09af, 0x09bc, 0 };
+static const unichar_t str_a33[] = { 0x0a32, 0x0a3c, 0 };
+static const unichar_t str_a36[] = { 0x0a38, 0x0a3c, 0 };
+static const unichar_t str_a59[] = { 0x0a16, 0x0a3c, 0 };
+static const unichar_t str_a5a[] = { 0x0a17, 0x0a3c, 0 };
+static const unichar_t str_a5b[] = { 0x0a1c, 0x0a3c, 0 };
+static const unichar_t str_a5e[] = { 0x0a2b, 0x0a3c, 0 };
+static const unichar_t str_b48[] = { 0x0b47, 0x0b56, 0 };
+static const unichar_t str_b4b[] = { 0x0b47, 0x0b3e, 0 };
+static const unichar_t str_b4c[] = { 0x0b47, 0x0b57, 0 };
+static const unichar_t str_b5c[] = { 0x0b21, 0x0b3c, 0 };
+static const unichar_t str_b5d[] = { 0x0b22, 0x0b3c, 0 };
+static const unichar_t str_b94[] = { 0x0b92, 0x0bd7, 0 };
+static const unichar_t str_bca[] = { 0x0bc6, 0x0bbe, 0 };
+static const unichar_t str_bcb[] = { 0x0bc7, 0x0bbe, 0 };
+static const unichar_t str_bcc[] = { 0x0bc6, 0x0bd7, 0 };
+static const unichar_t str_c48[] = { 0x0c46, 0x0c56, 0 };
+static const unichar_t str_cc0[] = { 0x0cbf, 0x0cd5, 0 };
+static const unichar_t str_cc7[] = { 0x0cc6, 0x0cd5, 0 };
+static const unichar_t str_cc8[] = { 0x0cc6, 0x0cd6, 0 };
+static const unichar_t str_cca[] = { 0x0cc6, 0x0cc2, 0 };
+static const unichar_t str_ccb[] = { 0x0cca, 0x0cd5, 0 };
+static const unichar_t str_d4a[] = { 0x0d46, 0x0d3e, 0 };
+static const unichar_t str_d4b[] = { 0x0d47, 0x0d3e, 0 };
+static const unichar_t str_d4c[] = { 0x0d46, 0x0d57, 0 };
+static const unichar_t str_dda[] = { 0x0dd9, 0x0dca, 0 };
+static const unichar_t str_ddc[] = { 0x0dd9, 0x0dcf, 0 };
+static const unichar_t str_ddd[] = { 0x0ddc, 0x0dca, 0 };
+static const unichar_t str_dde[] = { 0x0dd9, 0x0ddf, 0 };
+static const unichar_t str_e33[] = { 0x0e4d, 0x0e32, 0 };
+static const unichar_t str_eb3[] = { 0x0ecd, 0x0eb2, 0 };
+static const unichar_t str_edc[] = { 0x0eab, 0x0e99, 0 };
+static const unichar_t str_edd[] = { 0x0eab, 0x0ea1, 0 };
+static const unichar_t str_f0c[] = { 0x0f0b, 0 };
+static const unichar_t str_f43[] = { 0x0f42, 0x0fb7, 0 };
+static const unichar_t str_f4d[] = { 0x0f4c, 0x0fb7, 0 };
+static const unichar_t str_f52[] = { 0x0f51, 0x0fb7, 0 };
+static const unichar_t str_f57[] = { 0x0f56, 0x0fb7, 0 };
+static const unichar_t str_f5c[] = { 0x0f5b, 0x0fb7, 0 };
+static const unichar_t str_f69[] = { 0x0f40, 0x0fb5, 0 };
+static const unichar_t str_f73[] = { 0x0f71, 0x0f72, 0 };
+static const unichar_t str_f75[] = { 0x0f71, 0x0f74, 0 };
+static const unichar_t str_f76[] = { 0x0fb2, 0x0f80, 0 };
+static const unichar_t str_f77[] = { 0x0fb2, 0x0f81, 0 };
+static const unichar_t str_f78[] = { 0x0fb3, 0x0f80, 0 };
+static const unichar_t str_f79[] = { 0x0fb3, 0x0f81, 0 };
+static const unichar_t str_f81[] = { 0x0f71, 0x0f80, 0 };
+static const unichar_t str_f93[] = { 0x0f92, 0x0fb7, 0 };
+static const unichar_t str_f9d[] = { 0x0f9c, 0x0fb7, 0 };
+static const unichar_t str_fa2[] = { 0x0fa1, 0x0fb7, 0 };
+static const unichar_t str_fa7[] = { 0x0fa6, 0x0fb7, 0 };
+static const unichar_t str_fac[] = { 0x0fab, 0x0fb7, 0 };
+static const unichar_t str_fb9[] = { 0x0f90, 0x0fb5, 0 };
+static const unichar_t str_1026[] = { 0x1025, 0x102e, 0 };
+static const unichar_t str_10fc[] = { 0x10dc, 0 };
+static const unichar_t str_1101[] = { 0x1100, 0x1100, 0 };
+static const unichar_t str_1104[] = { 0x1103, 0x1103, 0 };
+static const unichar_t str_1108[] = { 0x1107, 0x1107, 0 };
+static const unichar_t str_110a[] = { 0x1109, 0x1109, 0 };
+static const unichar_t str_110d[] = { 0x110c, 0x110c, 0 };
+static const unichar_t str_1113[] = { 0x1102, 0x1100, 0 };
+static const unichar_t str_1114[] = { 0x1102, 0x1102, 0 };
+static const unichar_t str_1115[] = { 0x1102, 0x1103, 0 };
+static const unichar_t str_1116[] = { 0x1102, 0x1107, 0 };
+static const unichar_t str_1117[] = { 0x1103, 0x1100, 0 };
+static const unichar_t str_1118[] = { 0x1105, 0x1102, 0 };
+static const unichar_t str_1119[] = { 0x1105, 0x1105, 0 };
+static const unichar_t str_111a[] = { 0x1105, 0x1112, 0 };
+static const unichar_t str_111b[] = { 0x1105, 0x110b, 0 };
+static const unichar_t str_111c[] = { 0x1106, 0x1107, 0 };
+static const unichar_t str_111d[] = { 0x1106, 0x110b, 0 };
+static const unichar_t str_111e[] = { 0x1107, 0x1100, 0 };
+static const unichar_t str_111f[] = { 0x1107, 0x1102, 0 };
+static const unichar_t str_1120[] = { 0x1107, 0x1103, 0 };
+static const unichar_t str_1121[] = { 0x1107, 0x1109, 0 };
+static const unichar_t str_1122[] = { 0x1107, 0x1109, 0x1100, 0 };
+static const unichar_t str_1123[] = { 0x1107, 0x1109, 0x1103, 0 };
+static const unichar_t str_1124[] = { 0x1107, 0x1109, 0x1107, 0 };
+static const unichar_t str_1125[] = { 0x1107, 0x1109, 0x1109, 0 };
+static const unichar_t str_1126[] = { 0x1107, 0x1109, 0x110c, 0 };
+static const unichar_t str_1127[] = { 0x1107, 0x110c, 0 };
+static const unichar_t str_1128[] = { 0x1107, 0x110e, 0 };
+static const unichar_t str_1129[] = { 0x1107, 0x1110, 0 };
+static const unichar_t str_112a[] = { 0x1107, 0x1111, 0 };
+static const unichar_t str_112b[] = { 0x1107, 0x110b, 0 };
+static const unichar_t str_112c[] = { 0x1107, 0x1107, 0x110b, 0 };
+static const unichar_t str_112d[] = { 0x1109, 0x1100, 0 };
+static const unichar_t str_112e[] = { 0x1109, 0x1102, 0 };
+static const unichar_t str_112f[] = { 0x1109, 0x1103, 0 };
+static const unichar_t str_1130[] = { 0x1109, 0x1105, 0 };
+static const unichar_t str_1131[] = { 0x1109, 0x1106, 0 };
+static const unichar_t str_1132[] = { 0x1109, 0x1107, 0 };
+static const unichar_t str_1133[] = { 0x1109, 0x1107, 0x1100, 0 };
+static const unichar_t str_1134[] = { 0x1109, 0x1109, 0x1109, 0 };
+static const unichar_t str_1135[] = { 0x1109, 0x110b, 0 };
+static const unichar_t str_1136[] = { 0x1109, 0x110c, 0 };
+static const unichar_t str_1137[] = { 0x1109, 0x110e, 0 };
+static const unichar_t str_1138[] = { 0x1109, 0x110f, 0 };
+static const unichar_t str_1139[] = { 0x1109, 0x1110, 0 };
+static const unichar_t str_113a[] = { 0x1109, 0x1111, 0 };
+static const unichar_t str_113b[] = { 0x1109, 0x1112, 0 };
+static const unichar_t str_113d[] = { 0x113c, 0x113c, 0 };
+static const unichar_t str_113f[] = { 0x113e, 0x113e, 0 };
+static const unichar_t str_1141[] = { 0x110b, 0x1100, 0 };
+static const unichar_t str_1142[] = { 0x110b, 0x1103, 0 };
+static const unichar_t str_1143[] = { 0x110b, 0x1106, 0 };
+static const unichar_t str_1144[] = { 0x110b, 0x1107, 0 };
+static const unichar_t str_1145[] = { 0x110b, 0x1109, 0 };
+static const unichar_t str_1146[] = { 0x110b, 0x1140, 0 };
+static const unichar_t str_1147[] = { 0x110b, 0x110b, 0 };
+static const unichar_t str_1148[] = { 0x110b, 0x110c, 0 };
+static const unichar_t str_1149[] = { 0x110b, 0x110e, 0 };
+static const unichar_t str_114a[] = { 0x110b, 0x1110, 0 };
+static const unichar_t str_114b[] = { 0x110b, 0x1111, 0 };
+static const unichar_t str_114d[] = { 0x110c, 0x110b, 0 };
+static const unichar_t str_114f[] = { 0x114e, 0x114e, 0 };
+static const unichar_t str_1151[] = { 0x1150, 0x1150, 0 };
+static const unichar_t str_1152[] = { 0x110e, 0x110f, 0 };
+static const unichar_t str_1153[] = { 0x110e, 0x1112, 0 };
+static const unichar_t str_1156[] = { 0x1111, 0x1107, 0 };
+static const unichar_t str_1157[] = { 0x1111, 0x110b, 0 };
+static const unichar_t str_1158[] = { 0x1112, 0x1112, 0 };
+static const unichar_t str_1162[] = { 0x1161, 0x1175, 0 };
+static const unichar_t str_1164[] = { 0x1163, 0x1175, 0 };
+static const unichar_t str_1166[] = { 0x1165, 0x1175, 0 };
+static const unichar_t str_1168[] = { 0x1167, 0x1175, 0 };
+static const unichar_t str_116a[] = { 0x1169, 0x1161, 0 };
+static const unichar_t str_116b[] = { 0x1169, 0x1162, 0 };
+static const unichar_t str_116c[] = { 0x1169, 0x1175, 0 };
+static const unichar_t str_116f[] = { 0x116e, 0x1165, 0 };
+static const unichar_t str_1170[] = { 0x116e, 0x1166, 0 };
+static const unichar_t str_1171[] = { 0x116e, 0x1175, 0 };
+static const unichar_t str_1174[] = { 0x1173, 0x1175, 0 };
+static const unichar_t str_1176[] = { 0x1161, 0x1169, 0 };
+static const unichar_t str_1177[] = { 0x1161, 0x116e, 0 };
+static const unichar_t str_1178[] = { 0x1163, 0x1169, 0 };
+static const unichar_t str_1179[] = { 0x1163, 0x116d, 0 };
+static const unichar_t str_117a[] = { 0x1165, 0x1169, 0 };
+static const unichar_t str_117b[] = { 0x1165, 0x116e, 0 };
+static const unichar_t str_117c[] = { 0x1165, 0x1173, 0 };
+static const unichar_t str_117d[] = { 0x1167, 0x1169, 0 };
+static const unichar_t str_117e[] = { 0x1167, 0x116e, 0 };
+static const unichar_t str_117f[] = { 0x1169, 0x1165, 0 };
+static const unichar_t str_1180[] = { 0x1169, 0x1166, 0 };
+static const unichar_t str_1181[] = { 0x1169, 0x1168, 0 };
+static const unichar_t str_1182[] = { 0x1169, 0x1169, 0 };
+static const unichar_t str_1183[] = { 0x1169, 0x116e, 0 };
+static const unichar_t str_1184[] = { 0x116d, 0x1163, 0 };
+static const unichar_t str_1185[] = { 0x116d, 0x1164, 0 };
+static const unichar_t str_1186[] = { 0x116d, 0x1167, 0 };
+static const unichar_t str_1187[] = { 0x116d, 0x1169, 0 };
+static const unichar_t str_1188[] = { 0x116d, 0x1175, 0 };
+static const unichar_t str_1189[] = { 0x116e, 0x1161, 0 };
+static const unichar_t str_118a[] = { 0x116e, 0x1162, 0 };
+static const unichar_t str_118b[] = { 0x116e, 0x1165, 0x1173, 0 };
+static const unichar_t str_118c[] = { 0x116e, 0x1168, 0 };
+static const unichar_t str_118d[] = { 0x116e, 0x116e, 0 };
+static const unichar_t str_118e[] = { 0x1172, 0x1161, 0 };
+static const unichar_t str_118f[] = { 0x1172, 0x1165, 0 };
+static const unichar_t str_1190[] = { 0x1172, 0x1166, 0 };
+static const unichar_t str_1191[] = { 0x1172, 0x1167, 0 };
+static const unichar_t str_1192[] = { 0x1172, 0x1168, 0 };
+static const unichar_t str_1193[] = { 0x1172, 0x116e, 0 };
+static const unichar_t str_1194[] = { 0x1172, 0x1175, 0 };
+static const unichar_t str_1195[] = { 0x1173, 0x116e, 0 };
+static const unichar_t str_1196[] = { 0x1173, 0x1173, 0 };
+static const unichar_t str_1197[] = { 0x1174, 0x116e, 0 };
+static const unichar_t str_1198[] = { 0x1175, 0x1161, 0 };
+static const unichar_t str_1199[] = { 0x1175, 0x1163, 0 };
+static const unichar_t str_119a[] = { 0x1175, 0x1169, 0 };
+static const unichar_t str_119b[] = { 0x1175, 0x116e, 0 };
+static const unichar_t str_119c[] = { 0x1175, 0x1173, 0 };
+static const unichar_t str_119d[] = { 0x1175, 0x119e, 0 };
+static const unichar_t str_119f[] = { 0x119e, 0x1165, 0 };
+static const unichar_t str_11a0[] = { 0x119e, 0x116e, 0 };
+static const unichar_t str_11a1[] = { 0x119e, 0x1175, 0 };
+static const unichar_t str_11a2[] = { 0x119e, 0x119e, 0 };
+static const unichar_t str_11a8[] = { 0x1100, 0 };
+static const unichar_t str_11a9[] = { 0x11a8, 0x11a8, 0 };
+static const unichar_t str_11aa[] = { 0x11a8, 0x11ba, 0 };
+static const unichar_t str_11ab[] = { 0x1102, 0 };
+static const unichar_t str_11ac[] = { 0x11ab, 0x11bd, 0 };
+static const unichar_t str_11ad[] = { 0x11ab, 0x11c2, 0 };
+static const unichar_t str_11ae[] = { 0x1103, 0 };
+static const unichar_t str_11af[] = { 0x1105, 0 };
+static const unichar_t str_11b0[] = { 0x11af, 0x11a8, 0 };
+static const unichar_t str_11b1[] = { 0x11af, 0x11b7, 0 };
+static const unichar_t str_11b2[] = { 0x11af, 0x11b8, 0 };
+static const unichar_t str_11b3[] = { 0x11af, 0x11ba, 0 };
+static const unichar_t str_11b4[] = { 0x11af, 0x11c0, 0 };
+static const unichar_t str_11b5[] = { 0x11af, 0x11c1, 0 };
+static const unichar_t str_11b6[] = { 0x11af, 0x11c2, 0 };
+static const unichar_t str_11b7[] = { 0x1106, 0 };
+static const unichar_t str_11b8[] = { 0x1107, 0 };
+static const unichar_t str_11b9[] = { 0x11b8, 0x11ba, 0 };
+static const unichar_t str_11ba[] = { 0x1109, 0 };
+static const unichar_t str_11bb[] = { 0x11ba, 0x11ba, 0 };
+static const unichar_t str_11bc[] = { 0x110b, 0 };
+static const unichar_t str_11bd[] = { 0x110c, 0 };
+static const unichar_t str_11be[] = { 0x110e, 0 };
+static const unichar_t str_11bf[] = { 0x110f, 0 };
+static const unichar_t str_11c0[] = { 0x1110, 0 };
+static const unichar_t str_11c1[] = { 0x1111, 0 };
+static const unichar_t str_11c2[] = { 0x1112, 0 };
+static const unichar_t str_11c3[] = { 0x11a8, 0x11af, 0 };
+static const unichar_t str_11c4[] = { 0x11a8, 0x11ba, 0x11a8, 0 };
+static const unichar_t str_11c5[] = { 0x11ab, 0x11a8, 0 };
+static const unichar_t str_11c6[] = { 0x11ab, 0x11ae, 0 };
+static const unichar_t str_11c7[] = { 0x11ab, 0x11ba, 0 };
+static const unichar_t str_11c8[] = { 0x11ab, 0x11eb, 0 };
+static const unichar_t str_11c9[] = { 0x11ab, 0x11c0, 0 };
+static const unichar_t str_11ca[] = { 0x11ae, 0x11a8, 0 };
+static const unichar_t str_11cb[] = { 0x11ae, 0x11af, 0 };
+static const unichar_t str_11cc[] = { 0x11af, 0x11a8, 0x11ba, 0 };
+static const unichar_t str_11cd[] = { 0x11af, 0x11ab, 0 };
+static const unichar_t str_11ce[] = { 0x11af, 0x11ae, 0 };
+static const unichar_t str_11cf[] = { 0x11af, 0x11ae, 0x11c2, 0 };
+static const unichar_t str_11d0[] = { 0x11af, 0x11af, 0 };
+static const unichar_t str_11d1[] = { 0x11af, 0x11b7, 0x11a8, 0 };
+static const unichar_t str_11d2[] = { 0x11af, 0x11b7, 0x11ba, 0 };
+static const unichar_t str_11d3[] = { 0x11af, 0x11b8, 0x11ba, 0 };
+static const unichar_t str_11d4[] = { 0x11af, 0x11b8, 0x11c2, 0 };
+static const unichar_t str_11d5[] = { 0x11af, 0x11e6, 0 };
+static const unichar_t str_11d6[] = { 0x11af, 0x11ba, 0x11ba, 0 };
+static const unichar_t str_11d7[] = { 0x11af, 0x11eb, 0 };
+static const unichar_t str_11d8[] = { 0x11af, 0x11bf, 0 };
+static const unichar_t str_11d9[] = { 0x11af, 0x11f9, 0 };
+static const unichar_t str_11da[] = { 0x11b7, 0x11a8, 0 };
+static const unichar_t str_11db[] = { 0x11b7, 0x11af, 0 };
+static const unichar_t str_11dc[] = { 0x11b7, 0x11b8, 0 };
+static const unichar_t str_11dd[] = { 0x11b7, 0x11ba, 0 };
+static const unichar_t str_11de[] = { 0x11b7, 0x11ba, 0x11ba, 0 };
+static const unichar_t str_11df[] = { 0x11b7, 0x11eb, 0 };
+static const unichar_t str_11e0[] = { 0x11b7, 0x11be, 0 };
+static const unichar_t str_11e1[] = { 0x11b7, 0x11c2, 0 };
+static const unichar_t str_11e2[] = { 0x11b7, 0x11bc, 0 };
+static const unichar_t str_11e3[] = { 0x11b8, 0x11af, 0 };
+static const unichar_t str_11e4[] = { 0x11b8, 0x11c1, 0 };
+static const unichar_t str_11e5[] = { 0x11b8, 0x11c2, 0 };
+static const unichar_t str_11e6[] = { 0x11b8, 0x11bc, 0 };
+static const unichar_t str_11e7[] = { 0x11ba, 0x11a8, 0 };
+static const unichar_t str_11e8[] = { 0x11ba, 0x11ae, 0 };
+static const unichar_t str_11e9[] = { 0x11ba, 0x11af, 0 };
+static const unichar_t str_11ea[] = { 0x11ba, 0x11b8, 0 };
+static const unichar_t str_11eb[] = { 0x1140, 0 };
+static const unichar_t str_11ec[] = { 0x11bc, 0x11a8, 0 };
+static const unichar_t str_11ed[] = { 0x11bc, 0x11a8, 0x11a8, 0 };
+static const unichar_t str_11ee[] = { 0x11bc, 0x11bc, 0 };
+static const unichar_t str_11ef[] = { 0x11bc, 0x11bf, 0 };
+static const unichar_t str_11f0[] = { 0x114c, 0 };
+static const unichar_t str_11f1[] = { 0x11f0, 0x11ba, 0 };
+static const unichar_t str_11f2[] = { 0x11f0, 0x11eb, 0 };
+static const unichar_t str_11f3[] = { 0x11c1, 0x11b8, 0 };
+static const unichar_t str_11f4[] = { 0x11c1, 0x11bc, 0 };
+static const unichar_t str_11f5[] = { 0x11c2, 0x11ab, 0 };
+static const unichar_t str_11f6[] = { 0x11c2, 0x11af, 0 };
+static const unichar_t str_11f7[] = { 0x11c2, 0x11b7, 0 };
+static const unichar_t str_11f8[] = { 0x11c2, 0x11b8, 0 };
+static const unichar_t str_11f9[] = { 0x1159, 0 };
+static const unichar_t str_13a0[] = { 0x0044, 0 };
+static const unichar_t str_13a1[] = { 0x0052, 0 };
+static const unichar_t str_13a2[] = { 0x0054, 0 };
+static const unichar_t str_13a9[] = { 0x0423, 0 };
+static const unichar_t str_13aa[] = { 0x0041, 0 };
+static const unichar_t str_13ab[] = { 0x004a, 0 };
+static const unichar_t str_13ac[] = { 0x0045, 0 };
+static const unichar_t str_13b1[] = { 0x0393, 0 };
+static const unichar_t str_13b3[] = { 0x0057, 0 };
+static const unichar_t str_13b7[] = { 0x004d, 0 };
+static const unichar_t str_13bb[] = { 0x0048, 0 };
+static const unichar_t str_13be[] = { 0x0398, 0 };
+static const unichar_t str_13c0[] = { 0x0047, 0 };
+static const unichar_t str_13c2[] = { 0x0068, 0 };
+static const unichar_t str_13c3[] = { 0x005a, 0 };
+static const unichar_t str_13cf[] = { 0x042c, 0 };
+static const unichar_t str_13d9[] = { 0x0056, 0 };
+static const unichar_t str_13da[] = { 0x0053, 0 };
+static const unichar_t str_13de[] = { 0x004c, 0 };
+static const unichar_t str_13df[] = { 0x0043, 0 };
+static const unichar_t str_13e2[] = { 0x0050, 0 };
+static const unichar_t str_13e6[] = { 0x004b, 0 };
+static const unichar_t str_13f4[] = { 0x0042, 0 };
+static const unichar_t str_1b06[] = { 0x1b05, 0x1b35, 0 };
+static const unichar_t str_1b08[] = { 0x1b07, 0x1b35, 0 };
+static const unichar_t str_1b0a[] = { 0x1b09, 0x1b35, 0 };
+static const unichar_t str_1b0c[] = { 0x1b0b, 0x1b35, 0 };
+static const unichar_t str_1b0e[] = { 0x1b0d, 0x1b35, 0 };
+static const unichar_t str_1b12[] = { 0x1b11, 0x1b35, 0 };
+static const unichar_t str_1b3b[] = { 0x1b3a, 0x1b35, 0 };
+static const unichar_t str_1b3d[] = { 0x1b3c, 0x1b35, 0 };
+static const unichar_t str_1b40[] = { 0x1b3e, 0x1b35, 0 };
+static const unichar_t str_1b41[] = { 0x1b3f, 0x1b35, 0 };
+static const unichar_t str_1b43[] = { 0x1b42, 0x1b35, 0 };
+static const unichar_t str_1d2c[] = { 0x0041, 0 };
+static const unichar_t str_1d2d[] = { 0x00c6, 0 };
+static const unichar_t str_1d2e[] = { 0x0042, 0 };
+static const unichar_t str_1d30[] = { 0x0044, 0 };
+static const unichar_t str_1d31[] = { 0x0045, 0 };
+static const unichar_t str_1d32[] = { 0x018e, 0 };
+static const unichar_t str_1d33[] = { 0x0047, 0 };
+static const unichar_t str_1d34[] = { 0x0048, 0 };
+static const unichar_t str_1d35[] = { 0x0049, 0 };
+static const unichar_t str_1d36[] = { 0x004a, 0 };
+static const unichar_t str_1d37[] = { 0x004b, 0 };
+static const unichar_t str_1d38[] = { 0x004c, 0 };
+static const unichar_t str_1d39[] = { 0x004d, 0 };
+static const unichar_t str_1d3a[] = { 0x004e, 0 };
+static const unichar_t str_1d3c[] = { 0x004f, 0 };
+static const unichar_t str_1d3d[] = { 0x0222, 0 };
+static const unichar_t str_1d3e[] = { 0x0050, 0 };
+static const unichar_t str_1d3f[] = { 0x0052, 0 };
+static const unichar_t str_1d40[] = { 0x0054, 0 };
+static const unichar_t str_1d41[] = { 0x0055, 0 };
+static const unichar_t str_1d42[] = { 0x0057, 0 };
+static const unichar_t str_1d43[] = { 0x0061, 0 };
+static const unichar_t str_1d44[] = { 0x0250, 0 };
+static const unichar_t str_1d45[] = { 0x0251, 0 };
+static const unichar_t str_1d46[] = { 0x1d02, 0 };
+static const unichar_t str_1d47[] = { 0x0062, 0 };
+static const unichar_t str_1d48[] = { 0x0064, 0 };
+static const unichar_t str_1d49[] = { 0x0065, 0 };
+static const unichar_t str_1d4a[] = { 0x0259, 0 };
+static const unichar_t str_1d4b[] = { 0x025b, 0 };
+static const unichar_t str_1d4c[] = { 0x025c, 0 };
+static const unichar_t str_1d4d[] = { 0x0067, 0 };
+static const unichar_t str_1d4f[] = { 0x006b, 0 };
+static const unichar_t str_1d50[] = { 0x006d, 0 };
+static const unichar_t str_1d51[] = { 0x014b, 0 };
+static const unichar_t str_1d52[] = { 0x006f, 0 };
+static const unichar_t str_1d53[] = { 0x0254, 0 };
+static const unichar_t str_1d54[] = { 0x1d16, 0 };
+static const unichar_t str_1d55[] = { 0x1d17, 0 };
+static const unichar_t str_1d56[] = { 0x0070, 0 };
+static const unichar_t str_1d57[] = { 0x0074, 0 };
+static const unichar_t str_1d58[] = { 0x0075, 0 };
+static const unichar_t str_1d59[] = { 0x1d1d, 0 };
+static const unichar_t str_1d5a[] = { 0x026f, 0 };
+static const unichar_t str_1d5b[] = { 0x0076, 0 };
+static const unichar_t str_1d5c[] = { 0x1d25, 0 };
+static const unichar_t str_1d5d[] = { 0x03b2, 0 };
+static const unichar_t str_1d5e[] = { 0x03b3, 0 };
+static const unichar_t str_1d5f[] = { 0x03b4, 0 };
+static const unichar_t str_1d60[] = { 0x03c6, 0 };
+static const unichar_t str_1d61[] = { 0x03c7, 0 };
+static const unichar_t str_1d62[] = { 0x0069, 0 };
+static const unichar_t str_1d63[] = { 0x0072, 0 };
+static const unichar_t str_1d64[] = { 0x0075, 0 };
+static const unichar_t str_1d65[] = { 0x0076, 0 };
+static const unichar_t str_1d66[] = { 0x03b2, 0 };
+static const unichar_t str_1d67[] = { 0x03b3, 0 };
+static const unichar_t str_1d68[] = { 0x03c1, 0 };
+static const unichar_t str_1d69[] = { 0x03c6, 0 };
+static const unichar_t str_1d6a[] = { 0x03c7, 0 };
+static const unichar_t str_1d78[] = { 0x043d, 0 };
+static const unichar_t str_1d9b[] = { 0x0252, 0 };
+static const unichar_t str_1d9c[] = { 0x0063, 0 };
+static const unichar_t str_1d9d[] = { 0x0255, 0 };
+static const unichar_t str_1d9e[] = { 0x00f0, 0 };
+static const unichar_t str_1d9f[] = { 0x025c, 0 };
+static const unichar_t str_1da0[] = { 0x0066, 0 };
+static const unichar_t str_1da1[] = { 0x025f, 0 };
+static const unichar_t str_1da2[] = { 0x0261, 0 };
+static const unichar_t str_1da3[] = { 0x0265, 0 };
+static const unichar_t str_1da4[] = { 0x0268, 0 };
+static const unichar_t str_1da5[] = { 0x0269, 0 };
+static const unichar_t str_1da6[] = { 0x026a, 0 };
+static const unichar_t str_1da7[] = { 0x1d7b, 0 };
+static const unichar_t str_1da8[] = { 0x029d, 0 };
+static const unichar_t str_1da9[] = { 0x026d, 0 };
+static const unichar_t str_1daa[] = { 0x1d85, 0 };
+static const unichar_t str_1dab[] = { 0x029f, 0 };
+static const unichar_t str_1dac[] = { 0x0271, 0 };
+static const unichar_t str_1dad[] = { 0x0270, 0 };
+static const unichar_t str_1dae[] = { 0x0272, 0 };
+static const unichar_t str_1daf[] = { 0x0273, 0 };
+static const unichar_t str_1db0[] = { 0x0274, 0 };
+static const unichar_t str_1db1[] = { 0x0275, 0 };
+static const unichar_t str_1db2[] = { 0x0278, 0 };
+static const unichar_t str_1db3[] = { 0x0282, 0 };
+static const unichar_t str_1db4[] = { 0x0283, 0 };
+static const unichar_t str_1db5[] = { 0x01ab, 0 };
+static const unichar_t str_1db6[] = { 0x0289, 0 };
+static const unichar_t str_1db7[] = { 0x028a, 0 };
+static const unichar_t str_1db8[] = { 0x1d1c, 0 };
+static const unichar_t str_1db9[] = { 0x028b, 0 };
+static const unichar_t str_1dba[] = { 0x028c, 0 };
+static const unichar_t str_1dbb[] = { 0x007a, 0 };
+static const unichar_t str_1dbc[] = { 0x0290, 0 };
+static const unichar_t str_1dbd[] = { 0x0291, 0 };
+static const unichar_t str_1dbe[] = { 0x0292, 0 };
+static const unichar_t str_1dbf[] = { 0x03b8, 0 };
+static const unichar_t str_1e00[] = { 0x0041, 0x0325, 0 };
+static const unichar_t str_1e01[] = { 0x0061, 0x0325, 0 };
+static const unichar_t str_1e02[] = { 0x0042, 0x0307, 0 };
+static const unichar_t str_1e03[] = { 0x0062, 0x0307, 0 };
+static const unichar_t str_1e04[] = { 0x0042, 0x0323, 0 };
+static const unichar_t str_1e05[] = { 0x0062, 0x0323, 0 };
+static const unichar_t str_1e06[] = { 0x0042, 0x0331, 0 };
+static const unichar_t str_1e07[] = { 0x0062, 0x0331, 0 };
+static const unichar_t str_1e08[] = { 0x00c7, 0x0301, 0 };
+static const unichar_t str_1e09[] = { 0x00e7, 0x0301, 0 };
+static const unichar_t str_1e0a[] = { 0x0044, 0x0307, 0 };
+static const unichar_t str_1e0b[] = { 0x0064, 0x0307, 0 };
+static const unichar_t str_1e0c[] = { 0x0044, 0x0323, 0 };
+static const unichar_t str_1e0d[] = { 0x0064, 0x0323, 0 };
+static const unichar_t str_1e0e[] = { 0x0044, 0x0331, 0 };
+static const unichar_t str_1e0f[] = { 0x0064, 0x0331, 0 };
+static const unichar_t str_1e10[] = { 0x0044, 0x0327, 0 };
+static const unichar_t str_1e11[] = { 0x0064, 0x0327, 0 };
+static const unichar_t str_1e12[] = { 0x0044, 0x032d, 0 };
+static const unichar_t str_1e13[] = { 0x0064, 0x032d, 0 };
+static const unichar_t str_1e14[] = { 0x0112, 0x0300, 0 };
+static const unichar_t str_1e15[] = { 0x0113, 0x0300, 0 };
+static const unichar_t str_1e16[] = { 0x0112, 0x0301, 0 };
+static const unichar_t str_1e17[] = { 0x0113, 0x0301, 0 };
+static const unichar_t str_1e18[] = { 0x0045, 0x032d, 0 };
+static const unichar_t str_1e19[] = { 0x0065, 0x032d, 0 };
+static const unichar_t str_1e1a[] = { 0x0045, 0x0330, 0 };
+static const unichar_t str_1e1b[] = { 0x0065, 0x0330, 0 };
+static const unichar_t str_1e1c[] = { 0x0228, 0x0306, 0 };
+static const unichar_t str_1e1d[] = { 0x0229, 0x0306, 0 };
+static const unichar_t str_1e1e[] = { 0x0046, 0x0307, 0 };
+static const unichar_t str_1e1f[] = { 0x0066, 0x0307, 0 };
+static const unichar_t str_1e20[] = { 0x0047, 0x0304, 0 };
+static const unichar_t str_1e21[] = { 0x0067, 0x0304, 0 };
+static const unichar_t str_1e22[] = { 0x0048, 0x0307, 0 };
+static const unichar_t str_1e23[] = { 0x0068, 0x0307, 0 };
+static const unichar_t str_1e24[] = { 0x0048, 0x0323, 0 };
+static const unichar_t str_1e25[] = { 0x0068, 0x0323, 0 };
+static const unichar_t str_1e26[] = { 0x0048, 0x0308, 0 };
+static const unichar_t str_1e27[] = { 0x0068, 0x0308, 0 };
+static const unichar_t str_1e28[] = { 0x0048, 0x0327, 0 };
+static const unichar_t str_1e29[] = { 0x0068, 0x0327, 0 };
+static const unichar_t str_1e2a[] = { 0x0048, 0x032e, 0 };
+static const unichar_t str_1e2b[] = { 0x0068, 0x032e, 0 };
+static const unichar_t str_1e2c[] = { 0x0049, 0x0330, 0 };
+static const unichar_t str_1e2d[] = { 0x0069, 0x0330, 0 };
+static const unichar_t str_1e2e[] = { 0x00cf, 0x0301, 0 };
+static const unichar_t str_1e2f[] = { 0x00ef, 0x0301, 0 };
+static const unichar_t str_1e30[] = { 0x004b, 0x0301, 0 };
+static const unichar_t str_1e31[] = { 0x006b, 0x0301, 0 };
+static const unichar_t str_1e32[] = { 0x004b, 0x0323, 0 };
+static const unichar_t str_1e33[] = { 0x006b, 0x0323, 0 };
+static const unichar_t str_1e34[] = { 0x004b, 0x0331, 0 };
+static const unichar_t str_1e35[] = { 0x006b, 0x0331, 0 };
+static const unichar_t str_1e36[] = { 0x004c, 0x0323, 0 };
+static const unichar_t str_1e37[] = { 0x006c, 0x0323, 0 };
+static const unichar_t str_1e38[] = { 0x1e36, 0x0304, 0 };
+static const unichar_t str_1e39[] = { 0x1e37, 0x0304, 0 };
+static const unichar_t str_1e3a[] = { 0x004c, 0x0331, 0 };
+static const unichar_t str_1e3b[] = { 0x006c, 0x0331, 0 };
+static const unichar_t str_1e3c[] = { 0x004c, 0x032d, 0 };
+static const unichar_t str_1e3d[] = { 0x006c, 0x032d, 0 };
+static const unichar_t str_1e3e[] = { 0x004d, 0x0301, 0 };
+static const unichar_t str_1e3f[] = { 0x006d, 0x0301, 0 };
+static const unichar_t str_1e40[] = { 0x004d, 0x0307, 0 };
+static const unichar_t str_1e41[] = { 0x006d, 0x0307, 0 };
+static const unichar_t str_1e42[] = { 0x004d, 0x0323, 0 };
+static const unichar_t str_1e43[] = { 0x006d, 0x0323, 0 };
+static const unichar_t str_1e44[] = { 0x004e, 0x0307, 0 };
+static const unichar_t str_1e45[] = { 0x006e, 0x0307, 0 };
+static const unichar_t str_1e46[] = { 0x004e, 0x0323, 0 };
+static const unichar_t str_1e47[] = { 0x006e, 0x0323, 0 };
+static const unichar_t str_1e48[] = { 0x004e, 0x0331, 0 };
+static const unichar_t str_1e49[] = { 0x006e, 0x0331, 0 };
+static const unichar_t str_1e4a[] = { 0x004e, 0x032d, 0 };
+static const unichar_t str_1e4b[] = { 0x006e, 0x032d, 0 };
+static const unichar_t str_1e4c[] = { 0x00d5, 0x0301, 0 };
+static const unichar_t str_1e4d[] = { 0x00f5, 0x0301, 0 };
+static const unichar_t str_1e4e[] = { 0x00d5, 0x0308, 0 };
+static const unichar_t str_1e4f[] = { 0x00f5, 0x0308, 0 };
+static const unichar_t str_1e50[] = { 0x014c, 0x0300, 0 };
+static const unichar_t str_1e51[] = { 0x014d, 0x0300, 0 };
+static const unichar_t str_1e52[] = { 0x014c, 0x0301, 0 };
+static const unichar_t str_1e53[] = { 0x014d, 0x0301, 0 };
+static const unichar_t str_1e54[] = { 0x0050, 0x0301, 0 };
+static const unichar_t str_1e55[] = { 0x0070, 0x0301, 0 };
+static const unichar_t str_1e56[] = { 0x0050, 0x0307, 0 };
+static const unichar_t str_1e57[] = { 0x0070, 0x0307, 0 };
+static const unichar_t str_1e58[] = { 0x0052, 0x0307, 0 };
+static const unichar_t str_1e59[] = { 0x0072, 0x0307, 0 };
+static const unichar_t str_1e5a[] = { 0x0052, 0x0323, 0 };
+static const unichar_t str_1e5b[] = { 0x0072, 0x0323, 0 };
+static const unichar_t str_1e5c[] = { 0x1e5a, 0x0304, 0 };
+static const unichar_t str_1e5d[] = { 0x1e5b, 0x0304, 0 };
+static const unichar_t str_1e5e[] = { 0x0052, 0x0331, 0 };
+static const unichar_t str_1e5f[] = { 0x0072, 0x0331, 0 };
+static const unichar_t str_1e60[] = { 0x0053, 0x0307, 0 };
+static const unichar_t str_1e61[] = { 0x0073, 0x0307, 0 };
+static const unichar_t str_1e62[] = { 0x0053, 0x0323, 0 };
+static const unichar_t str_1e63[] = { 0x0073, 0x0323, 0 };
+static const unichar_t str_1e64[] = { 0x015a, 0x0307, 0 };
+static const unichar_t str_1e65[] = { 0x015b, 0x0307, 0 };
+static const unichar_t str_1e66[] = { 0x0160, 0x0307, 0 };
+static const unichar_t str_1e67[] = { 0x0161, 0x0307, 0 };
+static const unichar_t str_1e68[] = { 0x1e62, 0x0307, 0 };
+static const unichar_t str_1e69[] = { 0x1e63, 0x0307, 0 };
+static const unichar_t str_1e6a[] = { 0x0054, 0x0307, 0 };
+static const unichar_t str_1e6b[] = { 0x0074, 0x0307, 0 };
+static const unichar_t str_1e6c[] = { 0x0054, 0x0323, 0 };
+static const unichar_t str_1e6d[] = { 0x0074, 0x0323, 0 };
+static const unichar_t str_1e6e[] = { 0x0054, 0x0331, 0 };
+static const unichar_t str_1e6f[] = { 0x0074, 0x0331, 0 };
+static const unichar_t str_1e70[] = { 0x0054, 0x032d, 0 };
+static const unichar_t str_1e71[] = { 0x0074, 0x032d, 0 };
+static const unichar_t str_1e72[] = { 0x0055, 0x0324, 0 };
+static const unichar_t str_1e73[] = { 0x0075, 0x0324, 0 };
+static const unichar_t str_1e74[] = { 0x0055, 0x0330, 0 };
+static const unichar_t str_1e75[] = { 0x0075, 0x0330, 0 };
+static const unichar_t str_1e76[] = { 0x0055, 0x032d, 0 };
+static const unichar_t str_1e77[] = { 0x0075, 0x032d, 0 };
+static const unichar_t str_1e78[] = { 0x0168, 0x0301, 0 };
+static const unichar_t str_1e79[] = { 0x0169, 0x0301, 0 };
+static const unichar_t str_1e7a[] = { 0x016a, 0x0308, 0 };
+static const unichar_t str_1e7b[] = { 0x016b, 0x0308, 0 };
+static const unichar_t str_1e7c[] = { 0x0056, 0x0303, 0 };
+static const unichar_t str_1e7d[] = { 0x0076, 0x0303, 0 };
+static const unichar_t str_1e7e[] = { 0x0056, 0x0323, 0 };
+static const unichar_t str_1e7f[] = { 0x0076, 0x0323, 0 };
+static const unichar_t str_1e80[] = { 0x0057, 0x0300, 0 };
+static const unichar_t str_1e81[] = { 0x0077, 0x0300, 0 };
+static const unichar_t str_1e82[] = { 0x0057, 0x0301, 0 };
+static const unichar_t str_1e83[] = { 0x0077, 0x0301, 0 };
+static const unichar_t str_1e84[] = { 0x0057, 0x0308, 0 };
+static const unichar_t str_1e85[] = { 0x0077, 0x0308, 0 };
+static const unichar_t str_1e86[] = { 0x0057, 0x0307, 0 };
+static const unichar_t str_1e87[] = { 0x0077, 0x0307, 0 };
+static const unichar_t str_1e88[] = { 0x0057, 0x0323, 0 };
+static const unichar_t str_1e89[] = { 0x0077, 0x0323, 0 };
+static const unichar_t str_1e8a[] = { 0x0058, 0x0307, 0 };
+static const unichar_t str_1e8b[] = { 0x0078, 0x0307, 0 };
+static const unichar_t str_1e8c[] = { 0x0058, 0x0308, 0 };
+static const unichar_t str_1e8d[] = { 0x0078, 0x0308, 0 };
+static const unichar_t str_1e8e[] = { 0x0059, 0x0307, 0 };
+static const unichar_t str_1e8f[] = { 0x0079, 0x0307, 0 };
+static const unichar_t str_1e90[] = { 0x005a, 0x0302, 0 };
+static const unichar_t str_1e91[] = { 0x007a, 0x0302, 0 };
+static const unichar_t str_1e92[] = { 0x005a, 0x0323, 0 };
+static const unichar_t str_1e93[] = { 0x007a, 0x0323, 0 };
+static const unichar_t str_1e94[] = { 0x005a, 0x0331, 0 };
+static const unichar_t str_1e95[] = { 0x007a, 0x0331, 0 };
+static const unichar_t str_1e96[] = { 0x0068, 0x0331, 0 };
+static const unichar_t str_1e97[] = { 0x0074, 0x0308, 0 };
+static const unichar_t str_1e98[] = { 0x0077, 0x030a, 0 };
+static const unichar_t str_1e99[] = { 0x0079, 0x030a, 0 };
+static const unichar_t str_1e9a[] = { 0x0061, 0x02be, 0 };
+static const unichar_t str_1e9b[] = { 0x017f, 0x0307, 0 };
+static const unichar_t str_1ea0[] = { 0x0041, 0x0323, 0 };
+static const unichar_t str_1ea1[] = { 0x0061, 0x0323, 0 };
+static const unichar_t str_1ea2[] = { 0x0041, 0x0309, 0 };
+static const unichar_t str_1ea3[] = { 0x0061, 0x0309, 0 };
+static const unichar_t str_1ea4[] = { 0x00c2, 0x0301, 0 };
+static const unichar_t str_1ea5[] = { 0x00e2, 0x0301, 0 };
+static const unichar_t str_1ea6[] = { 0x00c2, 0x0300, 0 };
+static const unichar_t str_1ea7[] = { 0x00e2, 0x0300, 0 };
+static const unichar_t str_1ea8[] = { 0x00c2, 0x0309, 0 };
+static const unichar_t str_1ea9[] = { 0x00e2, 0x0309, 0 };
+static const unichar_t str_1eaa[] = { 0x00c2, 0x0303, 0 };
+static const unichar_t str_1eab[] = { 0x00e2, 0x0303, 0 };
+static const unichar_t str_1eac[] = { 0x1ea0, 0x0302, 0 };
+static const unichar_t str_1ead[] = { 0x1ea1, 0x0302, 0 };
+static const unichar_t str_1eae[] = { 0x0102, 0x0301, 0 };
+static const unichar_t str_1eaf[] = { 0x0103, 0x0301, 0 };
+static const unichar_t str_1eb0[] = { 0x0102, 0x0300, 0 };
+static const unichar_t str_1eb1[] = { 0x0103, 0x0300, 0 };
+static const unichar_t str_1eb2[] = { 0x0102, 0x0309, 0 };
+static const unichar_t str_1eb3[] = { 0x0103, 0x0309, 0 };
+static const unichar_t str_1eb4[] = { 0x0102, 0x0303, 0 };
+static const unichar_t str_1eb5[] = { 0x0103, 0x0303, 0 };
+static const unichar_t str_1eb6[] = { 0x1ea0, 0x0306, 0 };
+static const unichar_t str_1eb7[] = { 0x1ea1, 0x0306, 0 };
+static const unichar_t str_1eb8[] = { 0x0045, 0x0323, 0 };
+static const unichar_t str_1eb9[] = { 0x0065, 0x0323, 0 };
+static const unichar_t str_1eba[] = { 0x0045, 0x0309, 0 };
+static const unichar_t str_1ebb[] = { 0x0065, 0x0309, 0 };
+static const unichar_t str_1ebc[] = { 0x0045, 0x0303, 0 };
+static const unichar_t str_1ebd[] = { 0x0065, 0x0303, 0 };
+static const unichar_t str_1ebe[] = { 0x00ca, 0x0301, 0 };
+static const unichar_t str_1ebf[] = { 0x00ea, 0x0301, 0 };
+static const unichar_t str_1ec0[] = { 0x00ca, 0x0300, 0 };
+static const unichar_t str_1ec1[] = { 0x00ea, 0x0300, 0 };
+static const unichar_t str_1ec2[] = { 0x00ca, 0x0309, 0 };
+static const unichar_t str_1ec3[] = { 0x00ea, 0x0309, 0 };
+static const unichar_t str_1ec4[] = { 0x00ca, 0x0303, 0 };
+static const unichar_t str_1ec5[] = { 0x00ea, 0x0303, 0 };
+static const unichar_t str_1ec6[] = { 0x1eb8, 0x0302, 0 };
+static const unichar_t str_1ec7[] = { 0x1eb9, 0x0302, 0 };
+static const unichar_t str_1ec8[] = { 0x0049, 0x0309, 0 };
+static const unichar_t str_1ec9[] = { 0x0069, 0x0309, 0 };
+static const unichar_t str_1eca[] = { 0x0049, 0x0323, 0 };
+static const unichar_t str_1ecb[] = { 0x0069, 0x0323, 0 };
+static const unichar_t str_1ecc[] = { 0x004f, 0x0323, 0 };
+static const unichar_t str_1ecd[] = { 0x006f, 0x0323, 0 };
+static const unichar_t str_1ece[] = { 0x004f, 0x0309, 0 };
+static const unichar_t str_1ecf[] = { 0x006f, 0x0309, 0 };
+static const unichar_t str_1ed0[] = { 0x00d4, 0x0301, 0 };
+static const unichar_t str_1ed1[] = { 0x00f4, 0x0301, 0 };
+static const unichar_t str_1ed2[] = { 0x00d4, 0x0300, 0 };
+static const unichar_t str_1ed3[] = { 0x00f4, 0x0300, 0 };
+static const unichar_t str_1ed4[] = { 0x00d4, 0x0309, 0 };
+static const unichar_t str_1ed5[] = { 0x00f4, 0x0309, 0 };
+static const unichar_t str_1ed6[] = { 0x00d4, 0x0303, 0 };
+static const unichar_t str_1ed7[] = { 0x00f4, 0x0303, 0 };
+static const unichar_t str_1ed8[] = { 0x1ecc, 0x0302, 0 };
+static const unichar_t str_1ed9[] = { 0x1ecd, 0x0302, 0 };
+static const unichar_t str_1eda[] = { 0x01a0, 0x0301, 0 };
+static const unichar_t str_1edb[] = { 0x01a1, 0x0301, 0 };
+static const unichar_t str_1edc[] = { 0x01a0, 0x0300, 0 };
+static const unichar_t str_1edd[] = { 0x01a1, 0x0300, 0 };
+static const unichar_t str_1ede[] = { 0x01a0, 0x0309, 0 };
+static const unichar_t str_1edf[] = { 0x01a1, 0x0309, 0 };
+static const unichar_t str_1ee0[] = { 0x01a0, 0x0303, 0 };
+static const unichar_t str_1ee1[] = { 0x01a1, 0x0303, 0 };
+static const unichar_t str_1ee2[] = { 0x01a0, 0x0323, 0 };
+static const unichar_t str_1ee3[] = { 0x01a1, 0x0323, 0 };
+static const unichar_t str_1ee4[] = { 0x0055, 0x0323, 0 };
+static const unichar_t str_1ee5[] = { 0x0075, 0x0323, 0 };
+static const unichar_t str_1ee6[] = { 0x0055, 0x0309, 0 };
+static const unichar_t str_1ee7[] = { 0x0075, 0x0309, 0 };
+static const unichar_t str_1ee8[] = { 0x01af, 0x0301, 0 };
+static const unichar_t str_1ee9[] = { 0x01b0, 0x0301, 0 };
+static const unichar_t str_1eea[] = { 0x01af, 0x0300, 0 };
+static const unichar_t str_1eeb[] = { 0x01b0, 0x0300, 0 };
+static const unichar_t str_1eec[] = { 0x01af, 0x0309, 0 };
+static const unichar_t str_1eed[] = { 0x01b0, 0x0309, 0 };
+static const unichar_t str_1eee[] = { 0x01af, 0x0303, 0 };
+static const unichar_t str_1eef[] = { 0x01b0, 0x0303, 0 };
+static const unichar_t str_1ef0[] = { 0x01af, 0x0323, 0 };
+static const unichar_t str_1ef1[] = { 0x01b0, 0x0323, 0 };
+static const unichar_t str_1ef2[] = { 0x0059, 0x0300, 0 };
+static const unichar_t str_1ef3[] = { 0x0079, 0x0300, 0 };
+static const unichar_t str_1ef4[] = { 0x0059, 0x0323, 0 };
+static const unichar_t str_1ef5[] = { 0x0079, 0x0323, 0 };
+static const unichar_t str_1ef6[] = { 0x0059, 0x0309, 0 };
+static const unichar_t str_1ef7[] = { 0x0079, 0x0309, 0 };
+static const unichar_t str_1ef8[] = { 0x0059, 0x0303, 0 };
+static const unichar_t str_1ef9[] = { 0x0079, 0x0303, 0 };
+static const unichar_t str_1f00[] = { 0x03b1, 0x0313, 0 };
+static const unichar_t str_1f01[] = { 0x03b1, 0x0314, 0 };
+static const unichar_t str_1f02[] = { 0x1f00, 0x0300, 0 };
+static const unichar_t str_1f03[] = { 0x1f01, 0x0300, 0 };
+static const unichar_t str_1f04[] = { 0x1f00, 0x0301, 0 };
+static const unichar_t str_1f05[] = { 0x1f01, 0x0301, 0 };
+static const unichar_t str_1f06[] = { 0x1f00, 0x0342, 0 };
+static const unichar_t str_1f07[] = { 0x1f01, 0x0342, 0 };
+static const unichar_t str_1f08[] = { 0x0391, 0x0313, 0 };
+static const unichar_t str_1f09[] = { 0x0391, 0x0314, 0 };
+static const unichar_t str_1f0a[] = { 0x1f08, 0x0300, 0 };
+static const unichar_t str_1f0b[] = { 0x1f09, 0x0300, 0 };
+static const unichar_t str_1f0c[] = { 0x1f08, 0x0301, 0 };
+static const unichar_t str_1f0d[] = { 0x1f09, 0x0301, 0 };
+static const unichar_t str_1f0e[] = { 0x1f08, 0x0342, 0 };
+static const unichar_t str_1f0f[] = { 0x1f09, 0x0342, 0 };
+static const unichar_t str_1f10[] = { 0x03b5, 0x0313, 0 };
+static const unichar_t str_1f11[] = { 0x03b5, 0x0314, 0 };
+static const unichar_t str_1f12[] = { 0x1f10, 0x0300, 0 };
+static const unichar_t str_1f13[] = { 0x1f11, 0x0300, 0 };
+static const unichar_t str_1f14[] = { 0x1f10, 0x0301, 0 };
+static const unichar_t str_1f15[] = { 0x1f11, 0x0301, 0 };
+static const unichar_t str_1f18[] = { 0x0395, 0x0313, 0 };
+static const unichar_t str_1f19[] = { 0x0395, 0x0314, 0 };
+static const unichar_t str_1f1a[] = { 0x1f18, 0x0300, 0 };
+static const unichar_t str_1f1b[] = { 0x1f19, 0x0300, 0 };
+static const unichar_t str_1f1c[] = { 0x1f18, 0x0301, 0 };
+static const unichar_t str_1f1d[] = { 0x1f19, 0x0301, 0 };
+static const unichar_t str_1f20[] = { 0x03b7, 0x0313, 0 };
+static const unichar_t str_1f21[] = { 0x03b7, 0x0314, 0 };
+static const unichar_t str_1f22[] = { 0x1f20, 0x0300, 0 };
+static const unichar_t str_1f23[] = { 0x1f21, 0x0300, 0 };
+static const unichar_t str_1f24[] = { 0x1f20, 0x0301, 0 };
+static const unichar_t str_1f25[] = { 0x1f21, 0x0301, 0 };
+static const unichar_t str_1f26[] = { 0x1f20, 0x0342, 0 };
+static const unichar_t str_1f27[] = { 0x1f21, 0x0342, 0 };
+static const unichar_t str_1f28[] = { 0x0397, 0x0313, 0 };
+static const unichar_t str_1f29[] = { 0x0397, 0x0314, 0 };
+static const unichar_t str_1f2a[] = { 0x1f28, 0x0300, 0 };
+static const unichar_t str_1f2b[] = { 0x1f29, 0x0300, 0 };
+static const unichar_t str_1f2c[] = { 0x1f28, 0x0301, 0 };
+static const unichar_t str_1f2d[] = { 0x1f29, 0x0301, 0 };
+static const unichar_t str_1f2e[] = { 0x1f28, 0x0342, 0 };
+static const unichar_t str_1f2f[] = { 0x1f29, 0x0342, 0 };
+static const unichar_t str_1f30[] = { 0x03b9, 0x0313, 0 };
+static const unichar_t str_1f31[] = { 0x03b9, 0x0314, 0 };
+static const unichar_t str_1f32[] = { 0x1f30, 0x0300, 0 };
+static const unichar_t str_1f33[] = { 0x1f31, 0x0300, 0 };
+static const unichar_t str_1f34[] = { 0x1f30, 0x0301, 0 };
+static const unichar_t str_1f35[] = { 0x1f31, 0x0301, 0 };
+static const unichar_t str_1f36[] = { 0x1f30, 0x0342, 0 };
+static const unichar_t str_1f37[] = { 0x1f31, 0x0342, 0 };
+static const unichar_t str_1f38[] = { 0x0399, 0x0313, 0 };
+static const unichar_t str_1f39[] = { 0x0399, 0x0314, 0 };
+static const unichar_t str_1f3a[] = { 0x1f38, 0x0300, 0 };
+static const unichar_t str_1f3b[] = { 0x1f39, 0x0300, 0 };
+static const unichar_t str_1f3c[] = { 0x1f38, 0x0301, 0 };
+static const unichar_t str_1f3d[] = { 0x1f39, 0x0301, 0 };
+static const unichar_t str_1f3e[] = { 0x1f38, 0x0342, 0 };
+static const unichar_t str_1f3f[] = { 0x1f39, 0x0342, 0 };
+static const unichar_t str_1f40[] = { 0x03bf, 0x0313, 0 };
+static const unichar_t str_1f41[] = { 0x03bf, 0x0314, 0 };
+static const unichar_t str_1f42[] = { 0x1f40, 0x0300, 0 };
+static const unichar_t str_1f43[] = { 0x1f41, 0x0300, 0 };
+static const unichar_t str_1f44[] = { 0x1f40, 0x0301, 0 };
+static const unichar_t str_1f45[] = { 0x1f41, 0x0301, 0 };
+static const unichar_t str_1f48[] = { 0x039f, 0x0313, 0 };
+static const unichar_t str_1f49[] = { 0x039f, 0x0314, 0 };
+static const unichar_t str_1f4a[] = { 0x1f48, 0x0300, 0 };
+static const unichar_t str_1f4b[] = { 0x1f49, 0x0300, 0 };
+static const unichar_t str_1f4c[] = { 0x1f48, 0x0301, 0 };
+static const unichar_t str_1f4d[] = { 0x1f49, 0x0301, 0 };
+static const unichar_t str_1f50[] = { 0x03c5, 0x0313, 0 };
+static const unichar_t str_1f51[] = { 0x03c5, 0x0314, 0 };
+static const unichar_t str_1f52[] = { 0x1f50, 0x0300, 0 };
+static const unichar_t str_1f53[] = { 0x1f51, 0x0300, 0 };
+static const unichar_t str_1f54[] = { 0x1f50, 0x0301, 0 };
+static const unichar_t str_1f55[] = { 0x1f51, 0x0301, 0 };
+static const unichar_t str_1f56[] = { 0x1f50, 0x0342, 0 };
+static const unichar_t str_1f57[] = { 0x1f51, 0x0342, 0 };
+static const unichar_t str_1f59[] = { 0x03a5, 0x0314, 0 };
+static const unichar_t str_1f5b[] = { 0x1f59, 0x0300, 0 };
+static const unichar_t str_1f5d[] = { 0x1f59, 0x0301, 0 };
+static const unichar_t str_1f5f[] = { 0x1f59, 0x0342, 0 };
+static const unichar_t str_1f60[] = { 0x03c9, 0x0313, 0 };
+static const unichar_t str_1f61[] = { 0x03c9, 0x0314, 0 };
+static const unichar_t str_1f62[] = { 0x1f60, 0x0300, 0 };
+static const unichar_t str_1f63[] = { 0x1f61, 0x0300, 0 };
+static const unichar_t str_1f64[] = { 0x1f60, 0x0301, 0 };
+static const unichar_t str_1f65[] = { 0x1f61, 0x0301, 0 };
+static const unichar_t str_1f66[] = { 0x1f60, 0x0342, 0 };
+static const unichar_t str_1f67[] = { 0x1f61, 0x0342, 0 };
+static const unichar_t str_1f68[] = { 0x03a9, 0x0313, 0 };
+static const unichar_t str_1f69[] = { 0x03a9, 0x0314, 0 };
+static const unichar_t str_1f6a[] = { 0x1f68, 0x0300, 0 };
+static const unichar_t str_1f6b[] = { 0x1f69, 0x0300, 0 };
+static const unichar_t str_1f6c[] = { 0x1f68, 0x0301, 0 };
+static const unichar_t str_1f6d[] = { 0x1f69, 0x0301, 0 };
+static const unichar_t str_1f6e[] = { 0x1f68, 0x0342, 0 };
+static const unichar_t str_1f6f[] = { 0x1f69, 0x0342, 0 };
+static const unichar_t str_1f70[] = { 0x03b1, 0x0300, 0 };
+static const unichar_t str_1f71[] = { 0x03ac, 0 };
+static const unichar_t str_1f72[] = { 0x03b5, 0x0300, 0 };
+static const unichar_t str_1f73[] = { 0x03ad, 0 };
+static const unichar_t str_1f74[] = { 0x03b7, 0x0300, 0 };
+static const unichar_t str_1f75[] = { 0x03ae, 0 };
+static const unichar_t str_1f76[] = { 0x03b9, 0x0300, 0 };
+static const unichar_t str_1f77[] = { 0x03af, 0 };
+static const unichar_t str_1f78[] = { 0x03bf, 0x0300, 0 };
+static const unichar_t str_1f79[] = { 0x03cc, 0 };
+static const unichar_t str_1f7a[] = { 0x03c5, 0x0300, 0 };
+static const unichar_t str_1f7b[] = { 0x03cd, 0 };
+static const unichar_t str_1f7c[] = { 0x03c9, 0x0300, 0 };
+static const unichar_t str_1f7d[] = { 0x03ce, 0 };
+static const unichar_t str_1f80[] = { 0x1f00, 0x0345, 0 };
+static const unichar_t str_1f81[] = { 0x1f01, 0x0345, 0 };
+static const unichar_t str_1f82[] = { 0x1f02, 0x0345, 0 };
+static const unichar_t str_1f83[] = { 0x1f03, 0x0345, 0 };
+static const unichar_t str_1f84[] = { 0x1f04, 0x0345, 0 };
+static const unichar_t str_1f85[] = { 0x1f05, 0x0345, 0 };
+static const unichar_t str_1f86[] = { 0x1f06, 0x0345, 0 };
+static const unichar_t str_1f87[] = { 0x1f07, 0x0345, 0 };
+static const unichar_t str_1f88[] = { 0x1f08, 0x0345, 0 };
+static const unichar_t str_1f89[] = { 0x1f09, 0x0345, 0 };
+static const unichar_t str_1f8a[] = { 0x1f0a, 0x0345, 0 };
+static const unichar_t str_1f8b[] = { 0x1f0b, 0x0345, 0 };
+static const unichar_t str_1f8c[] = { 0x1f0c, 0x0345, 0 };
+static const unichar_t str_1f8d[] = { 0x1f0d, 0x0345, 0 };
+static const unichar_t str_1f8e[] = { 0x1f0e, 0x0345, 0 };
+static const unichar_t str_1f8f[] = { 0x1f0f, 0x0345, 0 };
+static const unichar_t str_1f90[] = { 0x1f20, 0x0345, 0 };
+static const unichar_t str_1f91[] = { 0x1f21, 0x0345, 0 };
+static const unichar_t str_1f92[] = { 0x1f22, 0x0345, 0 };
+static const unichar_t str_1f93[] = { 0x1f23, 0x0345, 0 };
+static const unichar_t str_1f94[] = { 0x1f24, 0x0345, 0 };
+static const unichar_t str_1f95[] = { 0x1f25, 0x0345, 0 };
+static const unichar_t str_1f96[] = { 0x1f26, 0x0345, 0 };
+static const unichar_t str_1f97[] = { 0x1f27, 0x0345, 0 };
+static const unichar_t str_1f98[] = { 0x1f28, 0x0345, 0 };
+static const unichar_t str_1f99[] = { 0x1f29, 0x0345, 0 };
+static const unichar_t str_1f9a[] = { 0x1f2a, 0x0345, 0 };
+static const unichar_t str_1f9b[] = { 0x1f2b, 0x0345, 0 };
+static const unichar_t str_1f9c[] = { 0x1f2c, 0x0345, 0 };
+static const unichar_t str_1f9d[] = { 0x1f2d, 0x0345, 0 };
+static const unichar_t str_1f9e[] = { 0x1f2e, 0x0345, 0 };
+static const unichar_t str_1f9f[] = { 0x1f2f, 0x0345, 0 };
+static const unichar_t str_1fa0[] = { 0x1f60, 0x0345, 0 };
+static const unichar_t str_1fa1[] = { 0x1f61, 0x0345, 0 };
+static const unichar_t str_1fa2[] = { 0x1f62, 0x0345, 0 };
+static const unichar_t str_1fa3[] = { 0x1f63, 0x0345, 0 };
+static const unichar_t str_1fa4[] = { 0x1f64, 0x0345, 0 };
+static const unichar_t str_1fa5[] = { 0x1f65, 0x0345, 0 };
+static const unichar_t str_1fa6[] = { 0x1f66, 0x0345, 0 };
+static const unichar_t str_1fa7[] = { 0x1f67, 0x0345, 0 };
+static const unichar_t str_1fa8[] = { 0x1f68, 0x0345, 0 };
+static const unichar_t str_1fa9[] = { 0x1f69, 0x0345, 0 };
+static const unichar_t str_1faa[] = { 0x1f6a, 0x0345, 0 };
+static const unichar_t str_1fab[] = { 0x1f6b, 0x0345, 0 };
+static const unichar_t str_1fac[] = { 0x1f6c, 0x0345, 0 };
+static const unichar_t str_1fad[] = { 0x1f6d, 0x0345, 0 };
+static const unichar_t str_1fae[] = { 0x1f6e, 0x0345, 0 };
+static const unichar_t str_1faf[] = { 0x1f6f, 0x0345, 0 };
+static const unichar_t str_1fb0[] = { 0x03b1, 0x0306, 0 };
+static const unichar_t str_1fb1[] = { 0x03b1, 0x0304, 0 };
+static const unichar_t str_1fb2[] = { 0x1f70, 0x0345, 0 };
+static const unichar_t str_1fb3[] = { 0x03b1, 0x0345, 0 };
+static const unichar_t str_1fb4[] = { 0x03ac, 0x0345, 0 };
+static const unichar_t str_1fb6[] = { 0x03b1, 0x0342, 0 };
+static const unichar_t str_1fb7[] = { 0x1fb6, 0x0345, 0 };
+static const unichar_t str_1fb8[] = { 0x0391, 0x0306, 0 };
+static const unichar_t str_1fb9[] = { 0x0391, 0x0304, 0 };
+static const unichar_t str_1fba[] = { 0x0391, 0x0300, 0 };
+static const unichar_t str_1fbb[] = { 0x0386, 0 };
+static const unichar_t str_1fbc[] = { 0x0391, 0x0345, 0 };
+static const unichar_t str_1fbd[] = { 0x0020, 0x0313, 0 };
+static const unichar_t str_1fbe[] = { 0x03b9, 0 };
+static const unichar_t str_1fbf[] = { 0x0020, 0x0313, 0 };
+static const unichar_t str_1fc0[] = { 0x0020, 0x0342, 0 };
+static const unichar_t str_1fc1[] = { 0x00a8, 0x0342, 0 };
+static const unichar_t str_1fc2[] = { 0x1f74, 0x0345, 0 };
+static const unichar_t str_1fc3[] = { 0x03b7, 0x0345, 0 };
+static const unichar_t str_1fc4[] = { 0x03ae, 0x0345, 0 };
+static const unichar_t str_1fc6[] = { 0x03b7, 0x0342, 0 };
+static const unichar_t str_1fc7[] = { 0x1fc6, 0x0345, 0 };
+static const unichar_t str_1fc8[] = { 0x0395, 0x0300, 0 };
+static const unichar_t str_1fc9[] = { 0x0388, 0 };
+static const unichar_t str_1fca[] = { 0x0397, 0x0300, 0 };
+static const unichar_t str_1fcb[] = { 0x0389, 0 };
+static const unichar_t str_1fcc[] = { 0x0397, 0x0345, 0 };
+static const unichar_t str_1fcd[] = { 0x1fbf, 0x0300, 0 };
+static const unichar_t str_1fce[] = { 0x1fbf, 0x0301, 0 };
+static const unichar_t str_1fcf[] = { 0x1fbf, 0x0342, 0 };
+static const unichar_t str_1fd0[] = { 0x03b9, 0x0306, 0 };
+static const unichar_t str_1fd1[] = { 0x03b9, 0x0304, 0 };
+static const unichar_t str_1fd2[] = { 0x03ca, 0x0300, 0 };
+static const unichar_t str_1fd3[] = { 0x0390, 0 };
+static const unichar_t str_1fd6[] = { 0x03b9, 0x0342, 0 };
+static const unichar_t str_1fd7[] = { 0x03ca, 0x0342, 0 };
+static const unichar_t str_1fd8[] = { 0x0399, 0x0306, 0 };
+static const unichar_t str_1fd9[] = { 0x0399, 0x0304, 0 };
+static const unichar_t str_1fda[] = { 0x0399, 0x0300, 0 };
+static const unichar_t str_1fdb[] = { 0x038a, 0 };
+static const unichar_t str_1fdd[] = { 0x1ffe, 0x0300, 0 };
+static const unichar_t str_1fde[] = { 0x1ffe, 0x0301, 0 };
+static const unichar_t str_1fdf[] = { 0x1ffe, 0x0342, 0 };
+static const unichar_t str_1fe0[] = { 0x03c5, 0x0306, 0 };
+static const unichar_t str_1fe1[] = { 0x03c5, 0x0304, 0 };
+static const unichar_t str_1fe2[] = { 0x03cb, 0x0300, 0 };
+static const unichar_t str_1fe3[] = { 0x03b0, 0 };
+static const unichar_t str_1fe4[] = { 0x03c1, 0x0313, 0 };
+static const unichar_t str_1fe5[] = { 0x03c1, 0x0314, 0 };
+static const unichar_t str_1fe6[] = { 0x03c5, 0x0342, 0 };
+static const unichar_t str_1fe7[] = { 0x03cb, 0x0342, 0 };
+static const unichar_t str_1fe8[] = { 0x03a5, 0x0306, 0 };
+static const unichar_t str_1fe9[] = { 0x03a5, 0x0304, 0 };
+static const unichar_t str_1fea[] = { 0x03a5, 0x0300, 0 };
+static const unichar_t str_1feb[] = { 0x038e, 0 };
+static const unichar_t str_1fec[] = { 0x03a1, 0x0314, 0 };
+static const unichar_t str_1fed[] = { 0x00a8, 0x0300, 0 };
+static const unichar_t str_1fee[] = { 0x0385, 0 };
+static const unichar_t str_1fef[] = { 0x0060, 0 };
+static const unichar_t str_1ff2[] = { 0x1f7c, 0x0345, 0 };
+static const unichar_t str_1ff3[] = { 0x03c9, 0x0345, 0 };
+static const unichar_t str_1ff4[] = { 0x03ce, 0x0345, 0 };
+static const unichar_t str_1ff6[] = { 0x03c9, 0x0342, 0 };
+static const unichar_t str_1ff7[] = { 0x1ff6, 0x0345, 0 };
+static const unichar_t str_1ff8[] = { 0x039f, 0x0300, 0 };
+static const unichar_t str_1ff9[] = { 0x038c, 0 };
+static const unichar_t str_1ffa[] = { 0x03a9, 0x0300, 0 };
+static const unichar_t str_1ffb[] = { 0x038f, 0 };
+static const unichar_t str_1ffc[] = { 0x03a9, 0x0345, 0 };
+static const unichar_t str_1ffd[] = { 0x00b4, 0 };
+static const unichar_t str_1ffe[] = { 0x0020, 0x0314, 0 };
+static const unichar_t str_2000[] = { 0x2002, 0 };
+static const unichar_t str_2001[] = { 0x2003, 0 };
+static const unichar_t str_2002[] = { 0x0020, 0 };
+static const unichar_t str_2003[] = { 0x0020, 0 };
+static const unichar_t str_2004[] = { 0x0020, 0 };
+static const unichar_t str_2005[] = { 0x0020, 0 };
+static const unichar_t str_2006[] = { 0x0020, 0 };
+static const unichar_t str_2007[] = { 0x0020, 0 };
+static const unichar_t str_2008[] = { 0x0020, 0 };
+static const unichar_t str_2009[] = { 0x0020, 0 };
+static const unichar_t str_200a[] = { 0x0020, 0 };
+static const unichar_t str_2010[] = { 0x002d, 0 };
+static const unichar_t str_2011[] = { 0x2010, 0 };
+static const unichar_t str_2012[] = { 0x002d, 0 };
+static const unichar_t str_2013[] = { 0x002d, 0 };
+static const unichar_t str_2014[] = { 0x002d, 0 };
+static const unichar_t str_2015[] = { 0x002d, 0 };
+static const unichar_t str_2016[] = { 0x007c, 0x007c, 0 };
+static const unichar_t str_2017[] = { 0x0020, 0x0333, 0 };
+static const unichar_t str_2018[] = { 0x0060, 0 };
+static const unichar_t str_2019[] = { 0x0027, 0 };
+static const unichar_t str_201c[] = { 0x0022, 0 };
+static const unichar_t str_201d[] = { 0x0022, 0 };
+static const unichar_t str_2024[] = { 0x002e, 0 };
+static const unichar_t str_2025[] = { 0x002e, 0x002e, 0 };
+static const unichar_t str_2026[] = { 0x002e, 0x002e, 0x002e, 0 };
+static const unichar_t str_202f[] = { 0x0020, 0 };
+static const unichar_t str_2032[] = { 0x0027, 0 };
+static const unichar_t str_2033[] = { 0x2032, 0x2032, 0 };
+static const unichar_t str_2034[] = { 0x2032, 0x2032, 0x2032, 0 };
+static const unichar_t str_2035[] = { 0x0060, 0 };
+static const unichar_t str_2036[] = { 0x2035, 0x2035, 0 };
+static const unichar_t str_2037[] = { 0x2035, 0x2035, 0x2035, 0 };
+static const unichar_t str_2039[] = { 0x003c, 0 };
+static const unichar_t str_203a[] = { 0x003e, 0 };
+static const unichar_t str_203c[] = { 0x0021, 0x0021, 0 };
+static const unichar_t str_203e[] = { 0x0020, 0x0305, 0 };
+static const unichar_t str_2047[] = { 0x003f, 0x003f, 0 };
+static const unichar_t str_2048[] = { 0x003f, 0x0021, 0 };
+static const unichar_t str_2049[] = { 0x0021, 0x003f, 0 };
+static const unichar_t str_2057[] = { 0x2032, 0x2032, 0x2032, 0x2032, 0 };
+static const unichar_t str_205f[] = { 0x0020, 0 };
+static const unichar_t str_2070[] = { 0x0030, 0 };
+static const unichar_t str_2071[] = { 0x0069, 0 };
+static const unichar_t str_2074[] = { 0x0034, 0 };
+static const unichar_t str_2075[] = { 0x0035, 0 };
+static const unichar_t str_2076[] = { 0x0036, 0 };
+static const unichar_t str_2077[] = { 0x0037, 0 };
+static const unichar_t str_2078[] = { 0x0038, 0 };
+static const unichar_t str_2079[] = { 0x0039, 0 };
+static const unichar_t str_207a[] = { 0x002b, 0 };
+static const unichar_t str_207b[] = { 0x2212, 0 };
+static const unichar_t str_207c[] = { 0x003d, 0 };
+static const unichar_t str_207d[] = { 0x0028, 0 };
+static const unichar_t str_207e[] = { 0x0029, 0 };
+static const unichar_t str_207f[] = { 0x006e, 0 };
+static const unichar_t str_2080[] = { 0x0030, 0 };
+static const unichar_t str_2081[] = { 0x0031, 0 };
+static const unichar_t str_2082[] = { 0x0032, 0 };
+static const unichar_t str_2083[] = { 0x0033, 0 };
+static const unichar_t str_2084[] = { 0x0034, 0 };
+static const unichar_t str_2085[] = { 0x0035, 0 };
+static const unichar_t str_2086[] = { 0x0036, 0 };
+static const unichar_t str_2087[] = { 0x0037, 0 };
+static const unichar_t str_2088[] = { 0x0038, 0 };
+static const unichar_t str_2089[] = { 0x0039, 0 };
+static const unichar_t str_208a[] = { 0x002b, 0 };
+static const unichar_t str_208b[] = { 0x2212, 0 };
+static const unichar_t str_208c[] = { 0x003d, 0 };
+static const unichar_t str_208d[] = { 0x0028, 0 };
+static const unichar_t str_208e[] = { 0x0029, 0 };
+static const unichar_t str_2090[] = { 0x0061, 0 };
+static const unichar_t str_2091[] = { 0x0065, 0 };
+static const unichar_t str_2092[] = { 0x006f, 0 };
+static const unichar_t str_2093[] = { 0x0078, 0 };
+static const unichar_t str_2094[] = { 0x0259, 0 };
+static const unichar_t str_20a8[] = { 0x0052, 0x0073, 0 };
+static const unichar_t str_2100[] = { 0x0061, 0x002f, 0x0063, 0 };
+static const unichar_t str_2101[] = { 0x0061, 0x002f, 0x0073, 0 };
+static const unichar_t str_2102[] = { 0x0043, 0 };
+static const unichar_t str_2103[] = { 0x00b0, 0x0043, 0 };
+static const unichar_t str_2105[] = { 0x0063, 0x002f, 0x006f, 0 };
+static const unichar_t str_2106[] = { 0x0063, 0x002f, 0x0075, 0 };
+static const unichar_t str_2107[] = { 0x0190, 0 };
+static const unichar_t str_2109[] = { 0x00b0, 0x0046, 0 };
+static const unichar_t str_210a[] = { 0x0067, 0 };
+static const unichar_t str_210b[] = { 0x0048, 0 };
+static const unichar_t str_210c[] = { 0x0048, 0 };
+static const unichar_t str_210d[] = { 0x0048, 0 };
+static const unichar_t str_210e[] = { 0x0068, 0 };
+static const unichar_t str_210f[] = { 0x0127, 0 };
+static const unichar_t str_2110[] = { 0x0049, 0 };
+static const unichar_t str_2111[] = { 0x0049, 0 };
+static const unichar_t str_2112[] = { 0x004c, 0 };
+static const unichar_t str_2113[] = { 0x006c, 0 };
+static const unichar_t str_2115[] = { 0x004e, 0 };
+static const unichar_t str_2116[] = { 0x004e, 0x006f, 0 };
+static const unichar_t str_2119[] = { 0x0050, 0 };
+static const unichar_t str_211a[] = { 0x0051, 0 };
+static const unichar_t str_211b[] = { 0x0052, 0 };
+static const unichar_t str_211c[] = { 0x0052, 0 };
+static const unichar_t str_211d[] = { 0x0052, 0 };
+static const unichar_t str_2120[] = { 0x0053, 0x004d, 0 };
+static const unichar_t str_2121[] = { 0x0054, 0x0045, 0x004c, 0 };
+static const unichar_t str_2122[] = { 0x0054, 0x004d, 0 };
+static const unichar_t str_2124[] = { 0x005a, 0 };
+static const unichar_t str_2126[] = { 0x03a9, 0 };
+static const unichar_t str_2128[] = { 0x005a, 0 };
+static const unichar_t str_212a[] = { 0x004b, 0 };
+static const unichar_t str_212b[] = { 0x00c5, 0 };
+static const unichar_t str_212c[] = { 0x0042, 0 };
+static const unichar_t str_212d[] = { 0x0043, 0 };
+static const unichar_t str_212f[] = { 0x0065, 0 };
+static const unichar_t str_2130[] = { 0x0045, 0 };
+static const unichar_t str_2131[] = { 0x0046, 0 };
+static const unichar_t str_2133[] = { 0x004d, 0 };
+static const unichar_t str_2134[] = { 0x006f, 0 };
+static const unichar_t str_2135[] = { 0x05d0, 0 };
+static const unichar_t str_2136[] = { 0x05d1, 0 };
+static const unichar_t str_2137[] = { 0x05d2, 0 };
+static const unichar_t str_2138[] = { 0x05d3, 0 };
+static const unichar_t str_2139[] = { 0x0069, 0 };
+static const unichar_t str_213b[] = { 0x0046, 0x0041, 0x0058, 0 };
+static const unichar_t str_213c[] = { 0x03c0, 0 };
+static const unichar_t str_213d[] = { 0x03b3, 0 };
+static const unichar_t str_213e[] = { 0x0393, 0 };
+static const unichar_t str_213f[] = { 0x03a0, 0 };
+static const unichar_t str_2140[] = { 0x2211, 0 };
+static const unichar_t str_2145[] = { 0x0044, 0 };
+static const unichar_t str_2146[] = { 0x0064, 0 };
+static const unichar_t str_2147[] = { 0x0065, 0 };
+static const unichar_t str_2148[] = { 0x0069, 0 };
+static const unichar_t str_2149[] = { 0x006a, 0 };
+static const unichar_t str_2153[] = { 0x0031, 0x2044, 0x0033, 0 };
+static const unichar_t str_2154[] = { 0x0032, 0x2044, 0x0033, 0 };
+static const unichar_t str_2155[] = { 0x0031, 0x2044, 0x0035, 0 };
+static const unichar_t str_2156[] = { 0x0032, 0x2044, 0x0035, 0 };
+static const unichar_t str_2157[] = { 0x0033, 0x2044, 0x0035, 0 };
+static const unichar_t str_2158[] = { 0x0034, 0x2044, 0x0035, 0 };
+static const unichar_t str_2159[] = { 0x0031, 0x2044, 0x0036, 0 };
+static const unichar_t str_215a[] = { 0x0035, 0x2044, 0x0036, 0 };
+static const unichar_t str_215b[] = { 0x0031, 0x2044, 0x0038, 0 };
+static const unichar_t str_215c[] = { 0x0033, 0x2044, 0x0038, 0 };
+static const unichar_t str_215d[] = { 0x0035, 0x2044, 0x0038, 0 };
+static const unichar_t str_215e[] = { 0x0037, 0x2044, 0x0038, 0 };
+static const unichar_t str_215f[] = { 0x0031, 0x2044, 0 };
+static const unichar_t str_2160[] = { 0x0049, 0 };
+static const unichar_t str_2161[] = { 0x0049, 0x0049, 0 };
+static const unichar_t str_2162[] = { 0x0049, 0x0049, 0x0049, 0 };
+static const unichar_t str_2163[] = { 0x0049, 0x0056, 0 };
+static const unichar_t str_2164[] = { 0x0056, 0 };
+static const unichar_t str_2165[] = { 0x0056, 0x0049, 0 };
+static const unichar_t str_2166[] = { 0x0056, 0x0049, 0x0049, 0 };
+static const unichar_t str_2167[] = { 0x0056, 0x0049, 0x0049, 0x0049, 0 };
+static const unichar_t str_2168[] = { 0x0049, 0x0058, 0 };
+static const unichar_t str_2169[] = { 0x0058, 0 };
+static const unichar_t str_216a[] = { 0x0058, 0x0049, 0 };
+static const unichar_t str_216b[] = { 0x0058, 0x0049, 0x0049, 0 };
+static const unichar_t str_216c[] = { 0x004c, 0 };
+static const unichar_t str_216d[] = { 0x0043, 0 };
+static const unichar_t str_216e[] = { 0x0044, 0 };
+static const unichar_t str_216f[] = { 0x004d, 0 };
+static const unichar_t str_2170[] = { 0x0069, 0 };
+static const unichar_t str_2171[] = { 0x0069, 0x0069, 0 };
+static const unichar_t str_2172[] = { 0x0069, 0x0069, 0x0069, 0 };
+static const unichar_t str_2173[] = { 0x0069, 0x0076, 0 };
+static const unichar_t str_2174[] = { 0x0076, 0 };
+static const unichar_t str_2175[] = { 0x0076, 0x0069, 0 };
+static const unichar_t str_2176[] = { 0x0076, 0x0069, 0x0069, 0 };
+static const unichar_t str_2177[] = { 0x0076, 0x0069, 0x0069, 0x0069, 0 };
+static const unichar_t str_2178[] = { 0x0069, 0x0078, 0 };
+static const unichar_t str_2179[] = { 0x0078, 0 };
+static const unichar_t str_217a[] = { 0x0078, 0x0069, 0 };
+static const unichar_t str_217b[] = { 0x0078, 0x0069, 0x0069, 0 };
+static const unichar_t str_217c[] = { 0x006c, 0 };
+static const unichar_t str_217d[] = { 0x0063, 0 };
+static const unichar_t str_217e[] = { 0x0064, 0 };
+static const unichar_t str_217f[] = { 0x006d, 0 };
+static const unichar_t str_219a[] = { 0x2190, 0x0338, 0 };
+static const unichar_t str_219b[] = { 0x2192, 0x0338, 0 };
+static const unichar_t str_21ae[] = { 0x2194, 0x0338, 0 };
+static const unichar_t str_21cd[] = { 0x21d0, 0x0338, 0 };
+static const unichar_t str_21ce[] = { 0x21d4, 0x0338, 0 };
+static const unichar_t str_21cf[] = { 0x21d2, 0x0338, 0 };
+static const unichar_t str_2204[] = { 0x2203, 0x0338, 0 };
+static const unichar_t str_2205[] = { 0x00d8, 0 };
+static const unichar_t str_2206[] = { 0x0394, 0 };
+static const unichar_t str_2209[] = { 0x2208, 0x0338, 0 };
+static const unichar_t str_220c[] = { 0x220b, 0x0338, 0 };
+static const unichar_t str_220f[] = { 0x03a0, 0 };
+static const unichar_t str_2211[] = { 0x03a3, 0 };
+static const unichar_t str_2212[] = { 0x002d, 0 };
+static const unichar_t str_2215[] = { 0x002f, 0 };
+static const unichar_t str_2216[] = { 0x005c, 0 };
+static const unichar_t str_2217[] = { 0x002a, 0 };
+static const unichar_t str_2218[] = { 0x00b0, 0 };
+static const unichar_t str_2219[] = { 0x00b7, 0 };
+static const unichar_t str_2223[] = { 0x007c, 0 };
+static const unichar_t str_2224[] = { 0x2223, 0x0338, 0 };
+static const unichar_t str_2225[] = { 0x007c, 0x007c, 0 };
+static const unichar_t str_2226[] = { 0x2225, 0x0338, 0 };
+static const unichar_t str_222c[] = { 0x222b, 0x222b, 0 };
+static const unichar_t str_222d[] = { 0x222b, 0x222b, 0x222b, 0 };
+static const unichar_t str_222f[] = { 0x222e, 0x222e, 0 };
+static const unichar_t str_2230[] = { 0x222e, 0x222e, 0x222e, 0 };
+static const unichar_t str_2236[] = { 0x003a, 0 };
+static const unichar_t str_223c[] = { 0x007e, 0 };
+static const unichar_t str_2241[] = { 0x223c, 0x0338, 0 };
+static const unichar_t str_2244[] = { 0x2243, 0x0338, 0 };
+static const unichar_t str_2247[] = { 0x2245, 0x0338, 0 };
+static const unichar_t str_2249[] = { 0x2248, 0x0338, 0 };
+static const unichar_t str_2260[] = { 0x003d, 0x0338, 0 };
+static const unichar_t str_2262[] = { 0x2261, 0x0338, 0 };
+static const unichar_t str_226a[] = { 0x00ab, 0 };
+static const unichar_t str_226b[] = { 0x00bb, 0 };
+static const unichar_t str_226d[] = { 0x224d, 0x0338, 0 };
+static const unichar_t str_226e[] = { 0x003c, 0x0338, 0 };
+static const unichar_t str_226f[] = { 0x003e, 0x0338, 0 };
+static const unichar_t str_2270[] = { 0x2264, 0x0338, 0 };
+static const unichar_t str_2271[] = { 0x2265, 0x0338, 0 };
+static const unichar_t str_2274[] = { 0x2272, 0x0338, 0 };
+static const unichar_t str_2275[] = { 0x2273, 0x0338, 0 };
+static const unichar_t str_2278[] = { 0x2276, 0x0338, 0 };
+static const unichar_t str_2279[] = { 0x2277, 0x0338, 0 };
+static const unichar_t str_2280[] = { 0x227a, 0x0338, 0 };
+static const unichar_t str_2281[] = { 0x227b, 0x0338, 0 };
+static const unichar_t str_2284[] = { 0x2282, 0x0338, 0 };
+static const unichar_t str_2285[] = { 0x2283, 0x0338, 0 };
+static const unichar_t str_2288[] = { 0x2286, 0x0338, 0 };
+static const unichar_t str_2289[] = { 0x2287, 0x0338, 0 };
+static const unichar_t str_2299[] = { 0x0298, 0 };
+static const unichar_t str_22ac[] = { 0x22a2, 0x0338, 0 };
+static const unichar_t str_22ad[] = { 0x22a8, 0x0338, 0 };
+static const unichar_t str_22ae[] = { 0x22a9, 0x0338, 0 };
+static const unichar_t str_22af[] = { 0x22ab, 0x0338, 0 };
+static const unichar_t str_22c4[] = { 0x25ca, 0 };
+static const unichar_t str_22c5[] = { 0x00b7, 0 };
+static const unichar_t str_22e0[] = { 0x227c, 0x0338, 0 };
+static const unichar_t str_22e1[] = { 0x227d, 0x0338, 0 };
+static const unichar_t str_22e2[] = { 0x2291, 0x0338, 0 };
+static const unichar_t str_22e3[] = { 0x2292, 0x0338, 0 };
+static const unichar_t str_22ea[] = { 0x22b2, 0x0338, 0 };
+static const unichar_t str_22eb[] = { 0x22b3, 0x0338, 0 };
+static const unichar_t str_22ec[] = { 0x22b4, 0x0338, 0 };
+static const unichar_t str_22ed[] = { 0x22b5, 0x0338, 0 };
+static const unichar_t str_22ef[] = { 0x00b7, 0x00b7, 0x00b7, 0 };
+static const unichar_t str_2303[] = { 0x005e, 0 };
+static const unichar_t str_2329[] = { 0x3008, 0 };
+static const unichar_t str_232a[] = { 0x3009, 0 };
+static const unichar_t str_2373[] = { 0x03b9, 0 };
+static const unichar_t str_2374[] = { 0x03c1, 0 };
+static const unichar_t str_2375[] = { 0x03c9, 0 };
+static const unichar_t str_237a[] = { 0x03b1, 0 };
+static const unichar_t str_2400[] = { 0x004e, 0x0055, 0x004c, 0 };
+static const unichar_t str_2401[] = { 0x0053, 0x004f, 0x0048, 0 };
+static const unichar_t str_2402[] = { 0x0053, 0x0054, 0x0058, 0 };
+static const unichar_t str_2403[] = { 0x0045, 0x0054, 0x0058, 0 };
+static const unichar_t str_2404[] = { 0x0045, 0x004f, 0x0054, 0 };
+static const unichar_t str_2405[] = { 0x0045, 0x004e, 0x0041, 0 };
+static const unichar_t str_2406[] = { 0x0041, 0x0043, 0x004b, 0 };
+static const unichar_t str_2407[] = { 0x0042, 0x0045, 0x004c, 0 };
+static const unichar_t str_2408[] = { 0x0042, 0x0053, 0 };
+static const unichar_t str_2409[] = { 0x0048, 0x0054, 0 };
+static const unichar_t str_240a[] = { 0x004c, 0x0046, 0 };
+static const unichar_t str_240b[] = { 0x0056, 0x0054, 0 };
+static const unichar_t str_240c[] = { 0x0046, 0x0046, 0 };
+static const unichar_t str_240d[] = { 0x0043, 0x0052, 0 };
+static const unichar_t str_240e[] = { 0x0053, 0x004f, 0 };
+static const unichar_t str_240f[] = { 0x0053, 0x0049, 0 };
+static const unichar_t str_2410[] = { 0x0044, 0x004c, 0x0045, 0 };
+static const unichar_t str_2411[] = { 0x0044, 0x0043, 0x0031, 0 };
+static const unichar_t str_2412[] = { 0x0044, 0x0043, 0x0032, 0 };
+static const unichar_t str_2413[] = { 0x0044, 0x0043, 0x0033, 0 };
+static const unichar_t str_2414[] = { 0x0044, 0x0043, 0x0034, 0 };
+static const unichar_t str_2415[] = { 0x004e, 0x0041, 0x004b, 0 };
+static const unichar_t str_2416[] = { 0x0053, 0x0059, 0x004e, 0 };
+static const unichar_t str_2417[] = { 0x0045, 0x0054, 0x0042, 0 };
+static const unichar_t str_2418[] = { 0x0043, 0x0041, 0x004e, 0 };
+static const unichar_t str_2419[] = { 0x0045, 0x004d, 0 };
+static const unichar_t str_241a[] = { 0x0053, 0x0055, 0x0042, 0 };
+static const unichar_t str_241b[] = { 0x0045, 0x0053, 0x0043, 0 };
+static const unichar_t str_241c[] = { 0x0046, 0x0053, 0 };
+static const unichar_t str_241d[] = { 0x0047, 0x0053, 0 };
+static const unichar_t str_241e[] = { 0x0052, 0x0053, 0 };
+static const unichar_t str_241f[] = { 0x0055, 0x0053, 0 };
+static const unichar_t str_2420[] = { 0x0053, 0x0050, 0 };
+static const unichar_t str_2421[] = { 0x0044, 0x0045, 0x004c, 0 };
+static const unichar_t str_2422[] = { 0x0180, 0 };
+static const unichar_t str_2460[] = { 0x0031, 0x20dd, 0 };
+static const unichar_t str_2461[] = { 0x0032, 0x20dd, 0 };
+static const unichar_t str_2462[] = { 0x0033, 0x20dd, 0 };
+static const unichar_t str_2463[] = { 0x0034, 0x20dd, 0 };
+static const unichar_t str_2464[] = { 0x0035, 0x20dd, 0 };
+static const unichar_t str_2465[] = { 0x0036, 0x20dd, 0 };
+static const unichar_t str_2466[] = { 0x0037, 0x20dd, 0 };
+static const unichar_t str_2467[] = { 0x0038, 0x20dd, 0 };
+static const unichar_t str_2468[] = { 0x0039, 0x20dd, 0 };
+static const unichar_t str_2469[] = { 0x0031, 0x0030, 0x20dd, 0 };
+static const unichar_t str_246a[] = { 0x0031, 0x0031, 0x20dd, 0 };
+static const unichar_t str_246b[] = { 0x0031, 0x0032, 0x20dd, 0 };
+static const unichar_t str_246c[] = { 0x0031, 0x0033, 0x20dd, 0 };
+static const unichar_t str_246d[] = { 0x0031, 0x0034, 0x20dd, 0 };
+static const unichar_t str_246e[] = { 0x0031, 0x0035, 0x20dd, 0 };
+static const unichar_t str_246f[] = { 0x0031, 0x0036, 0x20dd, 0 };
+static const unichar_t str_2470[] = { 0x0031, 0x0037, 0x20dd, 0 };
+static const unichar_t str_2471[] = { 0x0031, 0x0038, 0x20dd, 0 };
+static const unichar_t str_2472[] = { 0x0031, 0x0039, 0x20dd, 0 };
+static const unichar_t str_2473[] = { 0x0032, 0x0030, 0x20dd, 0 };
+static const unichar_t str_2474[] = { 0x0028, 0x0031, 0x0029, 0 };
+static const unichar_t str_2475[] = { 0x0028, 0x0032, 0x0029, 0 };
+static const unichar_t str_2476[] = { 0x0028, 0x0033, 0x0029, 0 };
+static const unichar_t str_2477[] = { 0x0028, 0x0034, 0x0029, 0 };
+static const unichar_t str_2478[] = { 0x0028, 0x0035, 0x0029, 0 };
+static const unichar_t str_2479[] = { 0x0028, 0x0036, 0x0029, 0 };
+static const unichar_t str_247a[] = { 0x0028, 0x0037, 0x0029, 0 };
+static const unichar_t str_247b[] = { 0x0028, 0x0038, 0x0029, 0 };
+static const unichar_t str_247c[] = { 0x0028, 0x0039, 0x0029, 0 };
+static const unichar_t str_247d[] = { 0x0028, 0x0031, 0x0030, 0x0029, 0 };
+static const unichar_t str_247e[] = { 0x0028, 0x0031, 0x0031, 0x0029, 0 };
+static const unichar_t str_247f[] = { 0x0028, 0x0031, 0x0032, 0x0029, 0 };
+static const unichar_t str_2480[] = { 0x0028, 0x0031, 0x0033, 0x0029, 0 };
+static const unichar_t str_2481[] = { 0x0028, 0x0031, 0x0034, 0x0029, 0 };
+static const unichar_t str_2482[] = { 0x0028, 0x0031, 0x0035, 0x0029, 0 };
+static const unichar_t str_2483[] = { 0x0028, 0x0031, 0x0036, 0x0029, 0 };
+static const unichar_t str_2484[] = { 0x0028, 0x0031, 0x0037, 0x0029, 0 };
+static const unichar_t str_2485[] = { 0x0028, 0x0031, 0x0038, 0x0029, 0 };
+static const unichar_t str_2486[] = { 0x0028, 0x0031, 0x0039, 0x0029, 0 };
+static const unichar_t str_2487[] = { 0x0028, 0x0032, 0x0030, 0x0029, 0 };
+static const unichar_t str_2488[] = { 0x0031, 0x002e, 0 };
+static const unichar_t str_2489[] = { 0x0032, 0x002e, 0 };
+static const unichar_t str_248a[] = { 0x0033, 0x002e, 0 };
+static const unichar_t str_248b[] = { 0x0034, 0x002e, 0 };
+static const unichar_t str_248c[] = { 0x0035, 0x002e, 0 };
+static const unichar_t str_248d[] = { 0x0036, 0x002e, 0 };
+static const unichar_t str_248e[] = { 0x0037, 0x002e, 0 };
+static const unichar_t str_248f[] = { 0x0038, 0x002e, 0 };
+static const unichar_t str_2490[] = { 0x0039, 0x002e, 0 };
+static const unichar_t str_2491[] = { 0x0031, 0x0030, 0x002e, 0 };
+static const unichar_t str_2492[] = { 0x0031, 0x0031, 0x002e, 0 };
+static const unichar_t str_2493[] = { 0x0031, 0x0032, 0x002e, 0 };
+static const unichar_t str_2494[] = { 0x0031, 0x0033, 0x002e, 0 };
+static const unichar_t str_2495[] = { 0x0031, 0x0034, 0x002e, 0 };
+static const unichar_t str_2496[] = { 0x0031, 0x0035, 0x002e, 0 };
+static const unichar_t str_2497[] = { 0x0031, 0x0036, 0x002e, 0 };
+static const unichar_t str_2498[] = { 0x0031, 0x0037, 0x002e, 0 };
+static const unichar_t str_2499[] = { 0x0031, 0x0038, 0x002e, 0 };
+static const unichar_t str_249a[] = { 0x0031, 0x0039, 0x002e, 0 };
+static const unichar_t str_249b[] = { 0x0032, 0x0030, 0x002e, 0 };
+static const unichar_t str_249c[] = { 0x0028, 0x0061, 0x0029, 0 };
+static const unichar_t str_249d[] = { 0x0028, 0x0062, 0x0029, 0 };
+static const unichar_t str_249e[] = { 0x0028, 0x0063, 0x0029, 0 };
+static const unichar_t str_249f[] = { 0x0028, 0x0064, 0x0029, 0 };
+static const unichar_t str_24a0[] = { 0x0028, 0x0065, 0x0029, 0 };
+static const unichar_t str_24a1[] = { 0x0028, 0x0066, 0x0029, 0 };
+static const unichar_t str_24a2[] = { 0x0028, 0x0067, 0x0029, 0 };
+static const unichar_t str_24a3[] = { 0x0028, 0x0068, 0x0029, 0 };
+static const unichar_t str_24a4[] = { 0x0028, 0x0069, 0x0029, 0 };
+static const unichar_t str_24a5[] = { 0x0028, 0x006a, 0x0029, 0 };
+static const unichar_t str_24a6[] = { 0x0028, 0x006b, 0x0029, 0 };
+static const unichar_t str_24a7[] = { 0x0028, 0x006c, 0x0029, 0 };
+static const unichar_t str_24a8[] = { 0x0028, 0x006d, 0x0029, 0 };
+static const unichar_t str_24a9[] = { 0x0028, 0x006e, 0x0029, 0 };
+static const unichar_t str_24aa[] = { 0x0028, 0x006f, 0x0029, 0 };
+static const unichar_t str_24ab[] = { 0x0028, 0x0070, 0x0029, 0 };
+static const unichar_t str_24ac[] = { 0x0028, 0x0071, 0x0029, 0 };
+static const unichar_t str_24ad[] = { 0x0028, 0x0072, 0x0029, 0 };
+static const unichar_t str_24ae[] = { 0x0028, 0x0073, 0x0029, 0 };
+static const unichar_t str_24af[] = { 0x0028, 0x0074, 0x0029, 0 };
+static const unichar_t str_24b0[] = { 0x0028, 0x0075, 0x0029, 0 };
+static const unichar_t str_24b1[] = { 0x0028, 0x0076, 0x0029, 0 };
+static const unichar_t str_24b2[] = { 0x0028, 0x0077, 0x0029, 0 };
+static const unichar_t str_24b3[] = { 0x0028, 0x0078, 0x0029, 0 };
+static const unichar_t str_24b4[] = { 0x0028, 0x0079, 0x0029, 0 };
+static const unichar_t str_24b5[] = { 0x0028, 0x007a, 0x0029, 0 };
+static const unichar_t str_24b6[] = { 0x0041, 0x20dd, 0 };
+static const unichar_t str_24b7[] = { 0x0042, 0x20dd, 0 };
+static const unichar_t str_24b8[] = { 0x0043, 0x20dd, 0 };
+static const unichar_t str_24b9[] = { 0x0044, 0x20dd, 0 };
+static const unichar_t str_24ba[] = { 0x0045, 0x20dd, 0 };
+static const unichar_t str_24bb[] = { 0x0046, 0x20dd, 0 };
+static const unichar_t str_24bc[] = { 0x0047, 0x20dd, 0 };
+static const unichar_t str_24bd[] = { 0x0048, 0x20dd, 0 };
+static const unichar_t str_24be[] = { 0x0049, 0x20dd, 0 };
+static const unichar_t str_24bf[] = { 0x004a, 0x20dd, 0 };
+static const unichar_t str_24c0[] = { 0x004b, 0x20dd, 0 };
+static const unichar_t str_24c1[] = { 0x004c, 0x20dd, 0 };
+static const unichar_t str_24c2[] = { 0x004d, 0x20dd, 0 };
+static const unichar_t str_24c3[] = { 0x004e, 0x20dd, 0 };
+static const unichar_t str_24c4[] = { 0x004f, 0x20dd, 0 };
+static const unichar_t str_24c5[] = { 0x0050, 0x20dd, 0 };
+static const unichar_t str_24c6[] = { 0x0051, 0x20dd, 0 };
+static const unichar_t str_24c7[] = { 0x0052, 0x20dd, 0 };
+static const unichar_t str_24c8[] = { 0x0053, 0x20dd, 0 };
+static const unichar_t str_24c9[] = { 0x0054, 0x20dd, 0 };
+static const unichar_t str_24ca[] = { 0x0055, 0x20dd, 0 };
+static const unichar_t str_24cb[] = { 0x0056, 0x20dd, 0 };
+static const unichar_t str_24cc[] = { 0x0057, 0x20dd, 0 };
+static const unichar_t str_24cd[] = { 0x0058, 0x20dd, 0 };
+static const unichar_t str_24ce[] = { 0x0059, 0x20dd, 0 };
+static const unichar_t str_24cf[] = { 0x005a, 0x20dd, 0 };
+static const unichar_t str_24d0[] = { 0x0061, 0x20dd, 0 };
+static const unichar_t str_24d1[] = { 0x0062, 0x20dd, 0 };
+static const unichar_t str_24d2[] = { 0x0063, 0x20dd, 0 };
+static const unichar_t str_24d3[] = { 0x0064, 0x20dd, 0 };
+static const unichar_t str_24d4[] = { 0x0065, 0x20dd, 0 };
+static const unichar_t str_24d5[] = { 0x0066, 0x20dd, 0 };
+static const unichar_t str_24d6[] = { 0x0067, 0x20dd, 0 };
+static const unichar_t str_24d7[] = { 0x0068, 0x20dd, 0 };
+static const unichar_t str_24d8[] = { 0x0069, 0x20dd, 0 };
+static const unichar_t str_24d9[] = { 0x006a, 0x20dd, 0 };
+static const unichar_t str_24da[] = { 0x006b, 0x20dd, 0 };
+static const unichar_t str_24db[] = { 0x006c, 0x20dd, 0 };
+static const unichar_t str_24dc[] = { 0x006d, 0x20dd, 0 };
+static const unichar_t str_24dd[] = { 0x006e, 0x20dd, 0 };
+static const unichar_t str_24de[] = { 0x006f, 0x20dd, 0 };
+static const unichar_t str_24df[] = { 0x0070, 0x20dd, 0 };
+static const unichar_t str_24e0[] = { 0x0071, 0x20dd, 0 };
+static const unichar_t str_24e1[] = { 0x0072, 0x20dd, 0 };
+static const unichar_t str_24e2[] = { 0x0073, 0x20dd, 0 };
+static const unichar_t str_24e3[] = { 0x0074, 0x20dd, 0 };
+static const unichar_t str_24e4[] = { 0x0075, 0x20dd, 0 };
+static const unichar_t str_24e5[] = { 0x0076, 0x20dd, 0 };
+static const unichar_t str_24e6[] = { 0x0077, 0x20dd, 0 };
+static const unichar_t str_24e7[] = { 0x0078, 0x20dd, 0 };
+static const unichar_t str_24e8[] = { 0x0079, 0x20dd, 0 };
+static const unichar_t str_24e9[] = { 0x007a, 0x20dd, 0 };
+static const unichar_t str_24ea[] = { 0x0030, 0x20dd, 0 };
+static const unichar_t str_2500[] = { 0x2014, 0 };
+static const unichar_t str_2502[] = { 0x007c, 0 };
+static const unichar_t str_25b3[] = { 0x2206, 0 };
+static const unichar_t str_25b8[] = { 0x2023, 0 };
+static const unichar_t str_25bd[] = { 0x2207, 0 };
+static const unichar_t str_25c7[] = { 0x25ca, 0 };
+static const unichar_t str_25e6[] = { 0x00b0, 0 };
+static const unichar_t str_2662[] = { 0x25ca, 0 };
+static const unichar_t str_2731[] = { 0x002a, 0 };
+static const unichar_t str_2758[] = { 0x007c, 0 };
+static const unichar_t str_2762[] = { 0x0021, 0 };
+static const unichar_t str_2a0c[] = { 0x222b, 0x222b, 0x222b, 0x222b, 0 };
+static const unichar_t str_2a74[] = { 0x003a, 0x003a, 0x003d, 0 };
+static const unichar_t str_2a75[] = { 0x003d, 0x003d, 0 };
+static const unichar_t str_2a76[] = { 0x003d, 0x003d, 0x003d, 0 };
+static const unichar_t str_2adc[] = { 0x2add, 0x0338, 0 };
+static const unichar_t str_2c7c[] = { 0x006a, 0 };
+static const unichar_t str_2c7d[] = { 0x0056, 0 };
+static const unichar_t str_2d6f[] = { 0x2d61, 0 };
+static const unichar_t str_2e9f[] = { 0x6bcd, 0 };
+static const unichar_t str_2ef3[] = { 0x9f9f, 0 };
+static const unichar_t str_2f00[] = { 0x4e00, 0 };
+static const unichar_t str_2f01[] = { 0x4e28, 0 };
+static const unichar_t str_2f02[] = { 0x4e36, 0 };
+static const unichar_t str_2f03[] = { 0x4e3f, 0 };
+static const unichar_t str_2f04[] = { 0x4e59, 0 };
+static const unichar_t str_2f05[] = { 0x4e85, 0 };
+static const unichar_t str_2f06[] = { 0x4e8c, 0 };
+static const unichar_t str_2f07[] = { 0x4ea0, 0 };
+static const unichar_t str_2f08[] = { 0x4eba, 0 };
+static const unichar_t str_2f09[] = { 0x513f, 0 };
+static const unichar_t str_2f0a[] = { 0x5165, 0 };
+static const unichar_t str_2f0b[] = { 0x516b, 0 };
+static const unichar_t str_2f0c[] = { 0x5182, 0 };
+static const unichar_t str_2f0d[] = { 0x5196, 0 };
+static const unichar_t str_2f0e[] = { 0x51ab, 0 };
+static const unichar_t str_2f0f[] = { 0x51e0, 0 };
+static const unichar_t str_2f10[] = { 0x51f5, 0 };
+static const unichar_t str_2f11[] = { 0x5200, 0 };
+static const unichar_t str_2f12[] = { 0x529b, 0 };
+static const unichar_t str_2f13[] = { 0x52f9, 0 };
+static const unichar_t str_2f14[] = { 0x5315, 0 };
+static const unichar_t str_2f15[] = { 0x531a, 0 };
+static const unichar_t str_2f16[] = { 0x5338, 0 };
+static const unichar_t str_2f17[] = { 0x5341, 0 };
+static const unichar_t str_2f18[] = { 0x535c, 0 };
+static const unichar_t str_2f19[] = { 0x5369, 0 };
+static const unichar_t str_2f1a[] = { 0x5382, 0 };
+static const unichar_t str_2f1b[] = { 0x53b6, 0 };
+static const unichar_t str_2f1c[] = { 0x53c8, 0 };
+static const unichar_t str_2f1d[] = { 0x53e3, 0 };
+static const unichar_t str_2f1e[] = { 0x56d7, 0 };
+static const unichar_t str_2f1f[] = { 0x571f, 0 };
+static const unichar_t str_2f20[] = { 0x58eb, 0 };
+static const unichar_t str_2f21[] = { 0x5902, 0 };
+static const unichar_t str_2f22[] = { 0x590a, 0 };
+static const unichar_t str_2f23[] = { 0x5915, 0 };
+static const unichar_t str_2f24[] = { 0x5927, 0 };
+static const unichar_t str_2f25[] = { 0x5973, 0 };
+static const unichar_t str_2f26[] = { 0x5b50, 0 };
+static const unichar_t str_2f27[] = { 0x5b80, 0 };
+static const unichar_t str_2f28[] = { 0x5bf8, 0 };
+static const unichar_t str_2f29[] = { 0x5c0f, 0 };
+static const unichar_t str_2f2a[] = { 0x5c22, 0 };
+static const unichar_t str_2f2b[] = { 0x5c38, 0 };
+static const unichar_t str_2f2c[] = { 0x5c6e, 0 };
+static const unichar_t str_2f2d[] = { 0x5c71, 0 };
+static const unichar_t str_2f2e[] = { 0x5ddb, 0 };
+static const unichar_t str_2f2f[] = { 0x5de5, 0 };
+static const unichar_t str_2f30[] = { 0x5df1, 0 };
+static const unichar_t str_2f31[] = { 0x5dfe, 0 };
+static const unichar_t str_2f32[] = { 0x5e72, 0 };
+static const unichar_t str_2f33[] = { 0x5e7a, 0 };
+static const unichar_t str_2f34[] = { 0x5e7f, 0 };
+static const unichar_t str_2f35[] = { 0x5ef4, 0 };
+static const unichar_t str_2f36[] = { 0x5efe, 0 };
+static const unichar_t str_2f37[] = { 0x5f0b, 0 };
+static const unichar_t str_2f38[] = { 0x5f13, 0 };
+static const unichar_t str_2f39[] = { 0x5f50, 0 };
+static const unichar_t str_2f3a[] = { 0x5f61, 0 };
+static const unichar_t str_2f3b[] = { 0x5f73, 0 };
+static const unichar_t str_2f3c[] = { 0x5fc3, 0 };
+static const unichar_t str_2f3d[] = { 0x6208, 0 };
+static const unichar_t str_2f3e[] = { 0x6236, 0 };
+static const unichar_t str_2f3f[] = { 0x624b, 0 };
+static const unichar_t str_2f40[] = { 0x652f, 0 };
+static const unichar_t str_2f41[] = { 0x6534, 0 };
+static const unichar_t str_2f42[] = { 0x6587, 0 };
+static const unichar_t str_2f43[] = { 0x6597, 0 };
+static const unichar_t str_2f44[] = { 0x65a4, 0 };
+static const unichar_t str_2f45[] = { 0x65b9, 0 };
+static const unichar_t str_2f46[] = { 0x65e0, 0 };
+static const unichar_t str_2f47[] = { 0x65e5, 0 };
+static const unichar_t str_2f48[] = { 0x66f0, 0 };
+static const unichar_t str_2f49[] = { 0x6708, 0 };
+static const unichar_t str_2f4a[] = { 0x6728, 0 };
+static const unichar_t str_2f4b[] = { 0x6b20, 0 };
+static const unichar_t str_2f4c[] = { 0x6b62, 0 };
+static const unichar_t str_2f4d[] = { 0x6b79, 0 };
+static const unichar_t str_2f4e[] = { 0x6bb3, 0 };
+static const unichar_t str_2f4f[] = { 0x6bcb, 0 };
+static const unichar_t str_2f50[] = { 0x6bd4, 0 };
+static const unichar_t str_2f51[] = { 0x6bdb, 0 };
+static const unichar_t str_2f52[] = { 0x6c0f, 0 };
+static const unichar_t str_2f53[] = { 0x6c14, 0 };
+static const unichar_t str_2f54[] = { 0x6c34, 0 };
+static const unichar_t str_2f55[] = { 0x706b, 0 };
+static const unichar_t str_2f56[] = { 0x722a, 0 };
+static const unichar_t str_2f57[] = { 0x7236, 0 };
+static const unichar_t str_2f58[] = { 0x723b, 0 };
+static const unichar_t str_2f59[] = { 0x723f, 0 };
+static const unichar_t str_2f5a[] = { 0x7247, 0 };
+static const unichar_t str_2f5b[] = { 0x7259, 0 };
+static const unichar_t str_2f5c[] = { 0x725b, 0 };
+static const unichar_t str_2f5d[] = { 0x72ac, 0 };
+static const unichar_t str_2f5e[] = { 0x7384, 0 };
+static const unichar_t str_2f5f[] = { 0x7389, 0 };
+static const unichar_t str_2f60[] = { 0x74dc, 0 };
+static const unichar_t str_2f61[] = { 0x74e6, 0 };
+static const unichar_t str_2f62[] = { 0x7518, 0 };
+static const unichar_t str_2f63[] = { 0x751f, 0 };
+static const unichar_t str_2f64[] = { 0x7528, 0 };
+static const unichar_t str_2f65[] = { 0x7530, 0 };
+static const unichar_t str_2f66[] = { 0x758b, 0 };
+static const unichar_t str_2f67[] = { 0x7592, 0 };
+static const unichar_t str_2f68[] = { 0x7676, 0 };
+static const unichar_t str_2f69[] = { 0x767d, 0 };
+static const unichar_t str_2f6a[] = { 0x76ae, 0 };
+static const unichar_t str_2f6b[] = { 0x76bf, 0 };
+static const unichar_t str_2f6c[] = { 0x76ee, 0 };
+static const unichar_t str_2f6d[] = { 0x77db, 0 };
+static const unichar_t str_2f6e[] = { 0x77e2, 0 };
+static const unichar_t str_2f6f[] = { 0x77f3, 0 };
+static const unichar_t str_2f70[] = { 0x793a, 0 };
+static const unichar_t str_2f71[] = { 0x79b8, 0 };
+static const unichar_t str_2f72[] = { 0x79be, 0 };
+static const unichar_t str_2f73[] = { 0x7a74, 0 };
+static const unichar_t str_2f74[] = { 0x7acb, 0 };
+static const unichar_t str_2f75[] = { 0x7af9, 0 };
+static const unichar_t str_2f76[] = { 0x7c73, 0 };
+static const unichar_t str_2f77[] = { 0x7cf8, 0 };
+static const unichar_t str_2f78[] = { 0x7f36, 0 };
+static const unichar_t str_2f79[] = { 0x7f51, 0 };
+static const unichar_t str_2f7a[] = { 0x7f8a, 0 };
+static const unichar_t str_2f7b[] = { 0x7fbd, 0 };
+static const unichar_t str_2f7c[] = { 0x8001, 0 };
+static const unichar_t str_2f7d[] = { 0x800c, 0 };
+static const unichar_t str_2f7e[] = { 0x8012, 0 };
+static const unichar_t str_2f7f[] = { 0x8033, 0 };
+static const unichar_t str_2f80[] = { 0x807f, 0 };
+static const unichar_t str_2f81[] = { 0x8089, 0 };
+static const unichar_t str_2f82[] = { 0x81e3, 0 };
+static const unichar_t str_2f83[] = { 0x81ea, 0 };
+static const unichar_t str_2f84[] = { 0x81f3, 0 };
+static const unichar_t str_2f85[] = { 0x81fc, 0 };
+static const unichar_t str_2f86[] = { 0x820c, 0 };
+static const unichar_t str_2f87[] = { 0x821b, 0 };
+static const unichar_t str_2f88[] = { 0x821f, 0 };
+static const unichar_t str_2f89[] = { 0x826e, 0 };
+static const unichar_t str_2f8a[] = { 0x8272, 0 };
+static const unichar_t str_2f8b[] = { 0x8278, 0 };
+static const unichar_t str_2f8c[] = { 0x864d, 0 };
+static const unichar_t str_2f8d[] = { 0x866b, 0 };
+static const unichar_t str_2f8e[] = { 0x8840, 0 };
+static const unichar_t str_2f8f[] = { 0x884c, 0 };
+static const unichar_t str_2f90[] = { 0x8863, 0 };
+static const unichar_t str_2f91[] = { 0x897e, 0 };
+static const unichar_t str_2f92[] = { 0x898b, 0 };
+static const unichar_t str_2f93[] = { 0x89d2, 0 };
+static const unichar_t str_2f94[] = { 0x8a00, 0 };
+static const unichar_t str_2f95[] = { 0x8c37, 0 };
+static const unichar_t str_2f96[] = { 0x8c46, 0 };
+static const unichar_t str_2f97[] = { 0x8c55, 0 };
+static const unichar_t str_2f98[] = { 0x8c78, 0 };
+static const unichar_t str_2f99[] = { 0x8c9d, 0 };
+static const unichar_t str_2f9a[] = { 0x8d64, 0 };
+static const unichar_t str_2f9b[] = { 0x8d70, 0 };
+static const unichar_t str_2f9c[] = { 0x8db3, 0 };
+static const unichar_t str_2f9d[] = { 0x8eab, 0 };
+static const unichar_t str_2f9e[] = { 0x8eca, 0 };
+static const unichar_t str_2f9f[] = { 0x8f9b, 0 };
+static const unichar_t str_2fa0[] = { 0x8fb0, 0 };
+static const unichar_t str_2fa1[] = { 0x8fb5, 0 };
+static const unichar_t str_2fa2[] = { 0x9091, 0 };
+static const unichar_t str_2fa3[] = { 0x9149, 0 };
+static const unichar_t str_2fa4[] = { 0x91c6, 0 };
+static const unichar_t str_2fa5[] = { 0x91cc, 0 };
+static const unichar_t str_2fa6[] = { 0x91d1, 0 };
+static const unichar_t str_2fa7[] = { 0x9577, 0 };
+static const unichar_t str_2fa8[] = { 0x9580, 0 };
+static const unichar_t str_2fa9[] = { 0x961c, 0 };
+static const unichar_t str_2faa[] = { 0x96b6, 0 };
+static const unichar_t str_2fab[] = { 0x96b9, 0 };
+static const unichar_t str_2fac[] = { 0x96e8, 0 };
+static const unichar_t str_2fad[] = { 0x9751, 0 };
+static const unichar_t str_2fae[] = { 0x975e, 0 };
+static const unichar_t str_2faf[] = { 0x9762, 0 };
+static const unichar_t str_2fb0[] = { 0x9769, 0 };
+static const unichar_t str_2fb1[] = { 0x97cb, 0 };
+static const unichar_t str_2fb2[] = { 0x97ed, 0 };
+static const unichar_t str_2fb3[] = { 0x97f3, 0 };
+static const unichar_t str_2fb4[] = { 0x9801, 0 };
+static const unichar_t str_2fb5[] = { 0x98a8, 0 };
+static const unichar_t str_2fb6[] = { 0x98db, 0 };
+static const unichar_t str_2fb7[] = { 0x98df, 0 };
+static const unichar_t str_2fb8[] = { 0x9996, 0 };
+static const unichar_t str_2fb9[] = { 0x9999, 0 };
+static const unichar_t str_2fba[] = { 0x99ac, 0 };
+static const unichar_t str_2fbb[] = { 0x9aa8, 0 };
+static const unichar_t str_2fbc[] = { 0x9ad8, 0 };
+static const unichar_t str_2fbd[] = { 0x9adf, 0 };
+static const unichar_t str_2fbe[] = { 0x9b25, 0 };
+static const unichar_t str_2fbf[] = { 0x9b2f, 0 };
+static const unichar_t str_2fc0[] = { 0x9b32, 0 };
+static const unichar_t str_2fc1[] = { 0x9b3c, 0 };
+static const unichar_t str_2fc2[] = { 0x9b5a, 0 };
+static const unichar_t str_2fc3[] = { 0x9ce5, 0 };
+static const unichar_t str_2fc4[] = { 0x9e75, 0 };
+static const unichar_t str_2fc5[] = { 0x9e7f, 0 };
+static const unichar_t str_2fc6[] = { 0x9ea5, 0 };
+static const unichar_t str_2fc7[] = { 0x9ebb, 0 };
+static const unichar_t str_2fc8[] = { 0x9ec3, 0 };
+static const unichar_t str_2fc9[] = { 0x9ecd, 0 };
+static const unichar_t str_2fca[] = { 0x9ed1, 0 };
+static const unichar_t str_2fcb[] = { 0x9ef9, 0 };
+static const unichar_t str_2fcc[] = { 0x9efd, 0 };
+static const unichar_t str_2fcd[] = { 0x9f0e, 0 };
+static const unichar_t str_2fce[] = { 0x9f13, 0 };
+static const unichar_t str_2fcf[] = { 0x9f20, 0 };
+static const unichar_t str_2fd0[] = { 0x9f3b, 0 };
+static const unichar_t str_2fd1[] = { 0x9f4a, 0 };
+static const unichar_t str_2fd2[] = { 0x9f52, 0 };
+static const unichar_t str_2fd3[] = { 0x9f8d, 0 };
+static const unichar_t str_2fd4[] = { 0x9f9c, 0 };
+static const unichar_t str_2fd5[] = { 0x9fa0, 0 };
+static const unichar_t str_3000[] = { 0x0020, 0 };
+static const unichar_t str_3001[] = { 0x002c, 0 };
+static const unichar_t str_3008[] = { 0x003c, 0 };
+static const unichar_t str_3009[] = { 0x003e, 0 };
+static const unichar_t str_300a[] = { 0x00ab, 0 };
+static const unichar_t str_300b[] = { 0x00bb, 0 };
+static const unichar_t str_3036[] = { 0x3012, 0 };
+static const unichar_t str_3038[] = { 0x5341, 0 };
+static const unichar_t str_3039[] = { 0x5344, 0 };
+static const unichar_t str_303a[] = { 0x5345, 0 };
+static const unichar_t str_304c[] = { 0x304b, 0x3099, 0 };
+static const unichar_t str_304e[] = { 0x304d, 0x3099, 0 };
+static const unichar_t str_3050[] = { 0x304f, 0x3099, 0 };
+static const unichar_t str_3052[] = { 0x3051, 0x3099, 0 };
+static const unichar_t str_3054[] = { 0x3053, 0x3099, 0 };
+static const unichar_t str_3056[] = { 0x3055, 0x3099, 0 };
+static const unichar_t str_3058[] = { 0x3057, 0x3099, 0 };
+static const unichar_t str_305a[] = { 0x3059, 0x3099, 0 };
+static const unichar_t str_305c[] = { 0x305b, 0x3099, 0 };
+static const unichar_t str_305e[] = { 0x305d, 0x3099, 0 };
+static const unichar_t str_3060[] = { 0x305f, 0x3099, 0 };
+static const unichar_t str_3062[] = { 0x3061, 0x3099, 0 };
+static const unichar_t str_3065[] = { 0x3064, 0x3099, 0 };
+static const unichar_t str_3067[] = { 0x3066, 0x3099, 0 };
+static const unichar_t str_3069[] = { 0x3068, 0x3099, 0 };
+static const unichar_t str_3070[] = { 0x306f, 0x3099, 0 };
+static const unichar_t str_3071[] = { 0x306f, 0x309a, 0 };
+static const unichar_t str_3073[] = { 0x3072, 0x3099, 0 };
+static const unichar_t str_3074[] = { 0x3072, 0x309a, 0 };
+static const unichar_t str_3076[] = { 0x3075, 0x3099, 0 };
+static const unichar_t str_3077[] = { 0x3075, 0x309a, 0 };
+static const unichar_t str_3079[] = { 0x3078, 0x3099, 0 };
+static const unichar_t str_307a[] = { 0x3078, 0x309a, 0 };
+static const unichar_t str_307c[] = { 0x307b, 0x3099, 0 };
+static const unichar_t str_307d[] = { 0x307b, 0x309a, 0 };
+static const unichar_t str_3094[] = { 0x3046, 0x3099, 0 };
+static const unichar_t str_309b[] = { 0x0020, 0x3099, 0 };
+static const unichar_t str_309c[] = { 0x0020, 0x309a, 0 };
+static const unichar_t str_309e[] = { 0x309d, 0x3099, 0 };
+static const unichar_t str_309f[] = { 0x3088, 0x308a, 0 };
+static const unichar_t str_30ac[] = { 0x30ab, 0x3099, 0 };
+static const unichar_t str_30ae[] = { 0x30ad, 0x3099, 0 };
+static const unichar_t str_30b0[] = { 0x30af, 0x3099, 0 };
+static const unichar_t str_30b2[] = { 0x30b1, 0x3099, 0 };
+static const unichar_t str_30b4[] = { 0x30b3, 0x3099, 0 };
+static const unichar_t str_30b6[] = { 0x30b5, 0x3099, 0 };
+static const unichar_t str_30b8[] = { 0x30b7, 0x3099, 0 };
+static const unichar_t str_30ba[] = { 0x30b9, 0x3099, 0 };
+static const unichar_t str_30bc[] = { 0x30bb, 0x3099, 0 };
+static const unichar_t str_30be[] = { 0x30bd, 0x3099, 0 };
+static const unichar_t str_30c0[] = { 0x30bf, 0x3099, 0 };
+static const unichar_t str_30c2[] = { 0x30c1, 0x3099, 0 };
+static const unichar_t str_30c5[] = { 0x30c4, 0x3099, 0 };
+static const unichar_t str_30c7[] = { 0x30c6, 0x3099, 0 };
+static const unichar_t str_30c9[] = { 0x30c8, 0x3099, 0 };
+static const unichar_t str_30d0[] = { 0x30cf, 0x3099, 0 };
+static const unichar_t str_30d1[] = { 0x30cf, 0x309a, 0 };
+static const unichar_t str_30d3[] = { 0x30d2, 0x3099, 0 };
+static const unichar_t str_30d4[] = { 0x30d2, 0x309a, 0 };
+static const unichar_t str_30d6[] = { 0x30d5, 0x3099, 0 };
+static const unichar_t str_30d7[] = { 0x30d5, 0x309a, 0 };
+static const unichar_t str_30d9[] = { 0x30d8, 0x3099, 0 };
+static const unichar_t str_30da[] = { 0x30d8, 0x309a, 0 };
+static const unichar_t str_30dc[] = { 0x30db, 0x3099, 0 };
+static const unichar_t str_30dd[] = { 0x30db, 0x309a, 0 };
+static const unichar_t str_30f4[] = { 0x30a6, 0x3099, 0 };
+static const unichar_t str_30f7[] = { 0x30ef, 0x3099, 0 };
+static const unichar_t str_30f8[] = { 0x30f0, 0x3099, 0 };
+static const unichar_t str_30f9[] = { 0x30f1, 0x3099, 0 };
+static const unichar_t str_30fa[] = { 0x30f2, 0x3099, 0 };
+static const unichar_t str_30fe[] = { 0x30fd, 0x3099, 0 };
+static const unichar_t str_30ff[] = { 0x30b3, 0x30c8, 0 };
+static const unichar_t str_3131[] = { 0x1100, 0 };
+static const unichar_t str_3132[] = { 0x1101, 0 };
+static const unichar_t str_3133[] = { 0x11aa, 0 };
+static const unichar_t str_3134[] = { 0x1102, 0 };
+static const unichar_t str_3135[] = { 0x11ac, 0 };
+static const unichar_t str_3136[] = { 0x11ad, 0 };
+static const unichar_t str_3137[] = { 0x1103, 0 };
+static const unichar_t str_3138[] = { 0x1104, 0 };
+static const unichar_t str_3139[] = { 0x1105, 0 };
+static const unichar_t str_313a[] = { 0x11b0, 0 };
+static const unichar_t str_313b[] = { 0x11b1, 0 };
+static const unichar_t str_313c[] = { 0x11b2, 0 };
+static const unichar_t str_313d[] = { 0x11b3, 0 };
+static const unichar_t str_313e[] = { 0x11b4, 0 };
+static const unichar_t str_313f[] = { 0x11b5, 0 };
+static const unichar_t str_3140[] = { 0x111a, 0 };
+static const unichar_t str_3141[] = { 0x1106, 0 };
+static const unichar_t str_3142[] = { 0x1107, 0 };
+static const unichar_t str_3143[] = { 0x1108, 0 };
+static const unichar_t str_3144[] = { 0x1121, 0 };
+static const unichar_t str_3145[] = { 0x1109, 0 };
+static const unichar_t str_3146[] = { 0x110a, 0 };
+static const unichar_t str_3147[] = { 0x110b, 0 };
+static const unichar_t str_3148[] = { 0x110c, 0 };
+static const unichar_t str_3149[] = { 0x110d, 0 };
+static const unichar_t str_314a[] = { 0x110e, 0 };
+static const unichar_t str_314b[] = { 0x110f, 0 };
+static const unichar_t str_314c[] = { 0x1110, 0 };
+static const unichar_t str_314d[] = { 0x1111, 0 };
+static const unichar_t str_314e[] = { 0x1112, 0 };
+static const unichar_t str_314f[] = { 0x1161, 0 };
+static const unichar_t str_3150[] = { 0x1162, 0 };
+static const unichar_t str_3151[] = { 0x1163, 0 };
+static const unichar_t str_3152[] = { 0x1164, 0 };
+static const unichar_t str_3153[] = { 0x1165, 0 };
+static const unichar_t str_3154[] = { 0x1166, 0 };
+static const unichar_t str_3155[] = { 0x1167, 0 };
+static const unichar_t str_3156[] = { 0x1168, 0 };
+static const unichar_t str_3157[] = { 0x1169, 0 };
+static const unichar_t str_3158[] = { 0x116a, 0 };
+static const unichar_t str_3159[] = { 0x116b, 0 };
+static const unichar_t str_315a[] = { 0x116c, 0 };
+static const unichar_t str_315b[] = { 0x116d, 0 };
+static const unichar_t str_315c[] = { 0x116e, 0 };
+static const unichar_t str_315d[] = { 0x116f, 0 };
+static const unichar_t str_315e[] = { 0x1170, 0 };
+static const unichar_t str_315f[] = { 0x1171, 0 };
+static const unichar_t str_3160[] = { 0x1172, 0 };
+static const unichar_t str_3161[] = { 0x1173, 0 };
+static const unichar_t str_3162[] = { 0x1174, 0 };
+static const unichar_t str_3163[] = { 0x1175, 0 };
+static const unichar_t str_3164[] = { 0x1160, 0 };
+static const unichar_t str_3165[] = { 0x1114, 0 };
+static const unichar_t str_3166[] = { 0x1115, 0 };
+static const unichar_t str_3167[] = { 0x11c7, 0 };
+static const unichar_t str_3168[] = { 0x11c8, 0 };
+static const unichar_t str_3169[] = { 0x11cc, 0 };
+static const unichar_t str_316a[] = { 0x11ce, 0 };
+static const unichar_t str_316b[] = { 0x11d3, 0 };
+static const unichar_t str_316c[] = { 0x11d7, 0 };
+static const unichar_t str_316d[] = { 0x11d9, 0 };
+static const unichar_t str_316e[] = { 0x111c, 0 };
+static const unichar_t str_316f[] = { 0x11dd, 0 };
+static const unichar_t str_3170[] = { 0x11df, 0 };
+static const unichar_t str_3171[] = { 0x111d, 0 };
+static const unichar_t str_3172[] = { 0x111e, 0 };
+static const unichar_t str_3173[] = { 0x1120, 0 };
+static const unichar_t str_3174[] = { 0x1122, 0 };
+static const unichar_t str_3175[] = { 0x1123, 0 };
+static const unichar_t str_3176[] = { 0x1127, 0 };
+static const unichar_t str_3177[] = { 0x1129, 0 };
+static const unichar_t str_3178[] = { 0x112b, 0 };
+static const unichar_t str_3179[] = { 0x112c, 0 };
+static const unichar_t str_317a[] = { 0x112d, 0 };
+static const unichar_t str_317b[] = { 0x112e, 0 };
+static const unichar_t str_317c[] = { 0x112f, 0 };
+static const unichar_t str_317d[] = { 0x1132, 0 };
+static const unichar_t str_317e[] = { 0x1136, 0 };
+static const unichar_t str_317f[] = { 0x1140, 0 };
+static const unichar_t str_3180[] = { 0x1147, 0 };
+static const unichar_t str_3181[] = { 0x114c, 0 };
+static const unichar_t str_3182[] = { 0x11f1, 0 };
+static const unichar_t str_3183[] = { 0x11f2, 0 };
+static const unichar_t str_3184[] = { 0x1157, 0 };
+static const unichar_t str_3185[] = { 0x1158, 0 };
+static const unichar_t str_3186[] = { 0x1159, 0 };
+static const unichar_t str_3187[] = { 0x1184, 0 };
+static const unichar_t str_3188[] = { 0x1185, 0 };
+static const unichar_t str_3189[] = { 0x1188, 0 };
+static const unichar_t str_318a[] = { 0x1191, 0 };
+static const unichar_t str_318b[] = { 0x1192, 0 };
+static const unichar_t str_318c[] = { 0x1194, 0 };
+static const unichar_t str_318d[] = { 0x119e, 0 };
+static const unichar_t str_318e[] = { 0x11a1, 0 };
+static const unichar_t str_3192[] = { 0x4e00, 0 };
+static const unichar_t str_3193[] = { 0x4e8c, 0 };
+static const unichar_t str_3194[] = { 0x4e09, 0 };
+static const unichar_t str_3195[] = { 0x56db, 0 };
+static const unichar_t str_3196[] = { 0x4e0a, 0 };
+static const unichar_t str_3197[] = { 0x4e2d, 0 };
+static const unichar_t str_3198[] = { 0x4e0b, 0 };
+static const unichar_t str_3199[] = { 0x7532, 0 };
+static const unichar_t str_319a[] = { 0x4e59, 0 };
+static const unichar_t str_319b[] = { 0x4e19, 0 };
+static const unichar_t str_319c[] = { 0x4e01, 0 };
+static const unichar_t str_319d[] = { 0x5929, 0 };
+static const unichar_t str_319e[] = { 0x5730, 0 };
+static const unichar_t str_319f[] = { 0x4eba, 0 };
+static const unichar_t str_3200[] = { 0x0028, 0x1100, 0x0029, 0 };
+static const unichar_t str_3201[] = { 0x0028, 0x1102, 0x0029, 0 };
+static const unichar_t str_3202[] = { 0x0028, 0x1103, 0x0029, 0 };
+static const unichar_t str_3203[] = { 0x0028, 0x1105, 0x0029, 0 };
+static const unichar_t str_3204[] = { 0x0028, 0x1106, 0x0029, 0 };
+static const unichar_t str_3205[] = { 0x0028, 0x1107, 0x0029, 0 };
+static const unichar_t str_3206[] = { 0x0028, 0x1109, 0x0029, 0 };
+static const unichar_t str_3207[] = { 0x0028, 0x110b, 0x0029, 0 };
+static const unichar_t str_3208[] = { 0x0028, 0x110c, 0x0029, 0 };
+static const unichar_t str_3209[] = { 0x0028, 0x110e, 0x0029, 0 };
+static const unichar_t str_320a[] = { 0x0028, 0x110f, 0x0029, 0 };
+static const unichar_t str_320b[] = { 0x0028, 0x1110, 0x0029, 0 };
+static const unichar_t str_320c[] = { 0x0028, 0x1111, 0x0029, 0 };
+static const unichar_t str_320d[] = { 0x0028, 0x1112, 0x0029, 0 };
+static const unichar_t str_320e[] = { 0x0028, 0x1100, 0x1161, 0x0029, 0 };
+static const unichar_t str_320f[] = { 0x0028, 0x1102, 0x1161, 0x0029, 0 };
+static const unichar_t str_3210[] = { 0x0028, 0x1103, 0x1161, 0x0029, 0 };
+static const unichar_t str_3211[] = { 0x0028, 0x1105, 0x1161, 0x0029, 0 };
+static const unichar_t str_3212[] = { 0x0028, 0x1106, 0x1161, 0x0029, 0 };
+static const unichar_t str_3213[] = { 0x0028, 0x1107, 0x1161, 0x0029, 0 };
+static const unichar_t str_3214[] = { 0x0028, 0x1109, 0x1161, 0x0029, 0 };
+static const unichar_t str_3215[] = { 0x0028, 0x110b, 0x1161, 0x0029, 0 };
+static const unichar_t str_3216[] = { 0x0028, 0x110c, 0x1161, 0x0029, 0 };
+static const unichar_t str_3217[] = { 0x0028, 0x110e, 0x1161, 0x0029, 0 };
+static const unichar_t str_3218[] = { 0x0028, 0x110f, 0x1161, 0x0029, 0 };
+static const unichar_t str_3219[] = { 0x0028, 0x1110, 0x1161, 0x0029, 0 };
+static const unichar_t str_321a[] = { 0x0028, 0x1111, 0x1161, 0x0029, 0 };
+static const unichar_t str_321b[] = { 0x0028, 0x1112, 0x1161, 0x0029, 0 };
+static const unichar_t str_321c[] = { 0x0028, 0x110c, 0x116e, 0x0029, 0 };
+static const unichar_t str_321d[] = { 0x0028, 0x110b, 0x1169, 0x110c, 0x1165, 0x11ab, 0x0029, 0 };
+static const unichar_t str_321e[] = { 0x0028, 0x110b, 0x1169, 0x1112, 0x116e, 0x0029, 0 };
+static const unichar_t str_3220[] = { 0x0028, 0x4e00, 0x0029, 0 };
+static const unichar_t str_3221[] = { 0x0028, 0x4e8c, 0x0029, 0 };
+static const unichar_t str_3222[] = { 0x0028, 0x4e09, 0x0029, 0 };
+static const unichar_t str_3223[] = { 0x0028, 0x56db, 0x0029, 0 };
+static const unichar_t str_3224[] = { 0x0028, 0x4e94, 0x0029, 0 };
+static const unichar_t str_3225[] = { 0x0028, 0x516d, 0x0029, 0 };
+static const unichar_t str_3226[] = { 0x0028, 0x4e03, 0x0029, 0 };
+static const unichar_t str_3227[] = { 0x0028, 0x516b, 0x0029, 0 };
+static const unichar_t str_3228[] = { 0x0028, 0x4e5d, 0x0029, 0 };
+static const unichar_t str_3229[] = { 0x0028, 0x5341, 0x0029, 0 };
+static const unichar_t str_322a[] = { 0x0028, 0x6708, 0x0029, 0 };
+static const unichar_t str_322b[] = { 0x0028, 0x706b, 0x0029, 0 };
+static const unichar_t str_322c[] = { 0x0028, 0x6c34, 0x0029, 0 };
+static const unichar_t str_322d[] = { 0x0028, 0x6728, 0x0029, 0 };
+static const unichar_t str_322e[] = { 0x0028, 0x91d1, 0x0029, 0 };
+static const unichar_t str_322f[] = { 0x0028, 0x571f, 0x0029, 0 };
+static const unichar_t str_3230[] = { 0x0028, 0x65e5, 0x0029, 0 };
+static const unichar_t str_3231[] = { 0x0028, 0x682a, 0x0029, 0 };
+static const unichar_t str_3232[] = { 0x0028, 0x6709, 0x0029, 0 };
+static const unichar_t str_3233[] = { 0x0028, 0x793e, 0x0029, 0 };
+static const unichar_t str_3234[] = { 0x0028, 0x540d, 0x0029, 0 };
+static const unichar_t str_3235[] = { 0x0028, 0x7279, 0x0029, 0 };
+static const unichar_t str_3236[] = { 0x0028, 0x8ca1, 0x0029, 0 };
+static const unichar_t str_3237[] = { 0x0028, 0x795d, 0x0029, 0 };
+static const unichar_t str_3238[] = { 0x0028, 0x52b4, 0x0029, 0 };
+static const unichar_t str_3239[] = { 0x0028, 0x4ee3, 0x0029, 0 };
+static const unichar_t str_323a[] = { 0x0028, 0x547c, 0x0029, 0 };
+static const unichar_t str_323b[] = { 0x0028, 0x5b66, 0x0029, 0 };
+static const unichar_t str_323c[] = { 0x0028, 0x76e3, 0x0029, 0 };
+static const unichar_t str_323d[] = { 0x0028, 0x4f01, 0x0029, 0 };
+static const unichar_t str_323e[] = { 0x0028, 0x8cc7, 0x0029, 0 };
+static const unichar_t str_323f[] = { 0x0028, 0x5354, 0x0029, 0 };
+static const unichar_t str_3240[] = { 0x0028, 0x796d, 0x0029, 0 };
+static const unichar_t str_3241[] = { 0x0028, 0x4f11, 0x0029, 0 };
+static const unichar_t str_3242[] = { 0x0028, 0x81ea, 0x0029, 0 };
+static const unichar_t str_3243[] = { 0x0028, 0x81f3, 0x0029, 0 };
+static const unichar_t str_3250[] = { 0x0050, 0x0054, 0x0045, 0 };
+static const unichar_t str_3251[] = { 0x0032, 0x0031, 0x20dd, 0 };
+static const unichar_t str_3252[] = { 0x0032, 0x0032, 0x20dd, 0 };
+static const unichar_t str_3253[] = { 0x0032, 0x0033, 0x20dd, 0 };
+static const unichar_t str_3254[] = { 0x0032, 0x0034, 0x20dd, 0 };
+static const unichar_t str_3255[] = { 0x0032, 0x0035, 0x20dd, 0 };
+static const unichar_t str_3256[] = { 0x0032, 0x0036, 0x20dd, 0 };
+static const unichar_t str_3257[] = { 0x0032, 0x0037, 0x20dd, 0 };
+static const unichar_t str_3258[] = { 0x0032, 0x0038, 0x20dd, 0 };
+static const unichar_t str_3259[] = { 0x0032, 0x0039, 0x20dd, 0 };
+static const unichar_t str_325a[] = { 0x0033, 0x0030, 0x20dd, 0 };
+static const unichar_t str_325b[] = { 0x0033, 0x0031, 0x20dd, 0 };
+static const unichar_t str_325c[] = { 0x0033, 0x0032, 0x20dd, 0 };
+static const unichar_t str_325d[] = { 0x0033, 0x0033, 0x20dd, 0 };
+static const unichar_t str_325e[] = { 0x0033, 0x0034, 0x20dd, 0 };
+static const unichar_t str_325f[] = { 0x0033, 0x0035, 0x20dd, 0 };
+static const unichar_t str_3260[] = { 0x1100, 0x20dd, 0 };
+static const unichar_t str_3261[] = { 0x1102, 0x20dd, 0 };
+static const unichar_t str_3262[] = { 0x1103, 0x20dd, 0 };
+static const unichar_t str_3263[] = { 0x1105, 0x20dd, 0 };
+static const unichar_t str_3264[] = { 0x1106, 0x20dd, 0 };
+static const unichar_t str_3265[] = { 0x1107, 0x20dd, 0 };
+static const unichar_t str_3266[] = { 0x1109, 0x20dd, 0 };
+static const unichar_t str_3267[] = { 0x110b, 0x20dd, 0 };
+static const unichar_t str_3268[] = { 0x110c, 0x20dd, 0 };
+static const unichar_t str_3269[] = { 0x110e, 0x20dd, 0 };
+static const unichar_t str_326a[] = { 0x110f, 0x20dd, 0 };
+static const unichar_t str_326b[] = { 0x1110, 0x20dd, 0 };
+static const unichar_t str_326c[] = { 0x1111, 0x20dd, 0 };
+static const unichar_t str_326d[] = { 0x1112, 0x20dd, 0 };
+static const unichar_t str_326e[] = { 0x1100, 0x1161, 0x20dd, 0 };
+static const unichar_t str_326f[] = { 0x1102, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3270[] = { 0x1103, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3271[] = { 0x1105, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3272[] = { 0x1106, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3273[] = { 0x1107, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3274[] = { 0x1109, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3275[] = { 0x110b, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3276[] = { 0x110c, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3277[] = { 0x110e, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3278[] = { 0x110f, 0x1161, 0x20dd, 0 };
+static const unichar_t str_3279[] = { 0x1110, 0x1161, 0x20dd, 0 };
+static const unichar_t str_327a[] = { 0x1111, 0x1161, 0x20dd, 0 };
+static const unichar_t str_327b[] = { 0x1112, 0x1161, 0x20dd, 0 };
+static const unichar_t str_327c[] = { 0x110e, 0x1161, 0x11b7, 0x1100, 0x1169, 0x20dd, 0 };
+static const unichar_t str_327d[] = { 0x110c, 0x116e, 0x110b, 0x1174, 0x20dd, 0 };
+static const unichar_t str_327e[] = { 0x110b, 0x116e, 0x20dd, 0 };
+static const unichar_t str_3280[] = { 0x4e00, 0x20dd, 0 };
+static const unichar_t str_3281[] = { 0x4e8c, 0x20dd, 0 };
+static const unichar_t str_3282[] = { 0x4e09, 0x20dd, 0 };
+static const unichar_t str_3283[] = { 0x56db, 0x20dd, 0 };
+static const unichar_t str_3284[] = { 0x4e94, 0x20dd, 0 };
+static const unichar_t str_3285[] = { 0x516d, 0x20dd, 0 };
+static const unichar_t str_3286[] = { 0x4e03, 0x20dd, 0 };
+static const unichar_t str_3287[] = { 0x516b, 0x20dd, 0 };
+static const unichar_t str_3288[] = { 0x4e5d, 0x20dd, 0 };
+static const unichar_t str_3289[] = { 0x5341, 0x20dd, 0 };
+static const unichar_t str_328a[] = { 0x6708, 0x20dd, 0 };
+static const unichar_t str_328b[] = { 0x706b, 0x20dd, 0 };
+static const unichar_t str_328c[] = { 0x6c34, 0x20dd, 0 };
+static const unichar_t str_328d[] = { 0x6728, 0x20dd, 0 };
+static const unichar_t str_328e[] = { 0x91d1, 0x20dd, 0 };
+static const unichar_t str_328f[] = { 0x571f, 0x20dd, 0 };
+static const unichar_t str_3290[] = { 0x65e5, 0x20dd, 0 };
+static const unichar_t str_3291[] = { 0x682a, 0x20dd, 0 };
+static const unichar_t str_3292[] = { 0x6709, 0x20dd, 0 };
+static const unichar_t str_3293[] = { 0x793e, 0x20dd, 0 };
+static const unichar_t str_3294[] = { 0x540d, 0x20dd, 0 };
+static const unichar_t str_3295[] = { 0x7279, 0x20dd, 0 };
+static const unichar_t str_3296[] = { 0x8ca1, 0x20dd, 0 };
+static const unichar_t str_3297[] = { 0x795d, 0x20dd, 0 };
+static const unichar_t str_3298[] = { 0x52b4, 0x20dd, 0 };
+static const unichar_t str_3299[] = { 0x79d8, 0x20dd, 0 };
+static const unichar_t str_329a[] = { 0x7537, 0x20dd, 0 };
+static const unichar_t str_329b[] = { 0x5973, 0x20dd, 0 };
+static const unichar_t str_329c[] = { 0x9069, 0x20dd, 0 };
+static const unichar_t str_329d[] = { 0x512a, 0x20dd, 0 };
+static const unichar_t str_329e[] = { 0x5370, 0x20dd, 0 };
+static const unichar_t str_329f[] = { 0x6ce8, 0x20dd, 0 };
+static const unichar_t str_32a0[] = { 0x9805, 0x20dd, 0 };
+static const unichar_t str_32a1[] = { 0x4f11, 0x20dd, 0 };
+static const unichar_t str_32a2[] = { 0x5199, 0x20dd, 0 };
+static const unichar_t str_32a3[] = { 0x6b63, 0x20dd, 0 };
+static const unichar_t str_32a4[] = { 0x4e0a, 0x20dd, 0 };
+static const unichar_t str_32a5[] = { 0x4e2d, 0x20dd, 0 };
+static const unichar_t str_32a6[] = { 0x4e0b, 0x20dd, 0 };
+static const unichar_t str_32a7[] = { 0x5de6, 0x20dd, 0 };
+static const unichar_t str_32a8[] = { 0x53f3, 0x20dd, 0 };
+static const unichar_t str_32a9[] = { 0x533b, 0x20dd, 0 };
+static const unichar_t str_32aa[] = { 0x5b97, 0x20dd, 0 };
+static const unichar_t str_32ab[] = { 0x5b66, 0x20dd, 0 };
+static const unichar_t str_32ac[] = { 0x76e3, 0x20dd, 0 };
+static const unichar_t str_32ad[] = { 0x4f01, 0x20dd, 0 };
+static const unichar_t str_32ae[] = { 0x8cc7, 0x20dd, 0 };
+static const unichar_t str_32af[] = { 0x5354, 0x20dd, 0 };
+static const unichar_t str_32b0[] = { 0x591c, 0x20dd, 0 };
+static const unichar_t str_32b1[] = { 0x0033, 0x0036, 0x20dd, 0 };
+static const unichar_t str_32b2[] = { 0x0033, 0x0037, 0x20dd, 0 };
+static const unichar_t str_32b3[] = { 0x0033, 0x0038, 0x20dd, 0 };
+static const unichar_t str_32b4[] = { 0x0033, 0x0039, 0x20dd, 0 };
+static const unichar_t str_32b5[] = { 0x0034, 0x0030, 0x20dd, 0 };
+static const unichar_t str_32b6[] = { 0x0034, 0x0031, 0x20dd, 0 };
+static const unichar_t str_32b7[] = { 0x0034, 0x0032, 0x20dd, 0 };
+static const unichar_t str_32b8[] = { 0x0034, 0x0033, 0x20dd, 0 };
+static const unichar_t str_32b9[] = { 0x0034, 0x0034, 0x20dd, 0 };
+static const unichar_t str_32ba[] = { 0x0034, 0x0035, 0x20dd, 0 };
+static const unichar_t str_32bb[] = { 0x0034, 0x0036, 0x20dd, 0 };
+static const unichar_t str_32bc[] = { 0x0034, 0x0037, 0x20dd, 0 };
+static const unichar_t str_32bd[] = { 0x0034, 0x0038, 0x20dd, 0 };
+static const unichar_t str_32be[] = { 0x0034, 0x0039, 0x20dd, 0 };
+static const unichar_t str_32bf[] = { 0x0035, 0x0030, 0x20dd, 0 };
+static const unichar_t str_32c0[] = { 0x0031, 0x6708, 0 };
+static const unichar_t str_32c1[] = { 0x0032, 0x6708, 0 };
+static const unichar_t str_32c2[] = { 0x0033, 0x6708, 0 };
+static const unichar_t str_32c3[] = { 0x0034, 0x6708, 0 };
+static const unichar_t str_32c4[] = { 0x0035, 0x6708, 0 };
+static const unichar_t str_32c5[] = { 0x0036, 0x6708, 0 };
+static const unichar_t str_32c6[] = { 0x0037, 0x6708, 0 };
+static const unichar_t str_32c7[] = { 0x0038, 0x6708, 0 };
+static const unichar_t str_32c8[] = { 0x0039, 0x6708, 0 };
+static const unichar_t str_32c9[] = { 0x0031, 0x0030, 0x6708, 0 };
+static const unichar_t str_32ca[] = { 0x0031, 0x0031, 0x6708, 0 };
+static const unichar_t str_32cb[] = { 0x0031, 0x0032, 0x6708, 0 };
+static const unichar_t str_32cc[] = { 0x0048, 0x0067, 0 };
+static const unichar_t str_32cd[] = { 0x0065, 0x0072, 0x0067, 0 };
+static const unichar_t str_32ce[] = { 0x0065, 0x0056, 0 };
+static const unichar_t str_32cf[] = { 0x004c, 0x0054, 0x0044, 0 };
+static const unichar_t str_32d0[] = { 0x30a2, 0x20dd, 0 };
+static const unichar_t str_32d1[] = { 0x30a4, 0x20dd, 0 };
+static const unichar_t str_32d2[] = { 0x30a6, 0x20dd, 0 };
+static const unichar_t str_32d3[] = { 0x30a8, 0x20dd, 0 };
+static const unichar_t str_32d4[] = { 0x30aa, 0x20dd, 0 };
+static const unichar_t str_32d5[] = { 0x30ab, 0x20dd, 0 };
+static const unichar_t str_32d6[] = { 0x30ad, 0x20dd, 0 };
+static const unichar_t str_32d7[] = { 0x30af, 0x20dd, 0 };
+static const unichar_t str_32d8[] = { 0x30b1, 0x20dd, 0 };
+static const unichar_t str_32d9[] = { 0x30b3, 0x20dd, 0 };
+static const unichar_t str_32da[] = { 0x30b5, 0x20dd, 0 };
+static const unichar_t str_32db[] = { 0x30b7, 0x20dd, 0 };
+static const unichar_t str_32dc[] = { 0x30b9, 0x20dd, 0 };
+static const unichar_t str_32dd[] = { 0x30bb, 0x20dd, 0 };
+static const unichar_t str_32de[] = { 0x30bd, 0x20dd, 0 };
+static const unichar_t str_32df[] = { 0x30bf, 0x20dd, 0 };
+static const unichar_t str_32e0[] = { 0x30c1, 0x20dd, 0 };
+static const unichar_t str_32e1[] = { 0x30c4, 0x20dd, 0 };
+static const unichar_t str_32e2[] = { 0x30c6, 0x20dd, 0 };
+static const unichar_t str_32e3[] = { 0x30c8, 0x20dd, 0 };
+static const unichar_t str_32e4[] = { 0x30ca, 0x20dd, 0 };
+static const unichar_t str_32e5[] = { 0x30cb, 0x20dd, 0 };
+static const unichar_t str_32e6[] = { 0x30cc, 0x20dd, 0 };
+static const unichar_t str_32e7[] = { 0x30cd, 0x20dd, 0 };
+static const unichar_t str_32e8[] = { 0x30ce, 0x20dd, 0 };
+static const unichar_t str_32e9[] = { 0x30cf, 0x20dd, 0 };
+static const unichar_t str_32ea[] = { 0x30d2, 0x20dd, 0 };
+static const unichar_t str_32eb[] = { 0x30d5, 0x20dd, 0 };
+static const unichar_t str_32ec[] = { 0x30d8, 0x20dd, 0 };
+static const unichar_t str_32ed[] = { 0x30db, 0x20dd, 0 };
+static const unichar_t str_32ee[] = { 0x30de, 0x20dd, 0 };
+static const unichar_t str_32ef[] = { 0x30df, 0x20dd, 0 };
+static const unichar_t str_32f0[] = { 0x30e0, 0x20dd, 0 };
+static const unichar_t str_32f1[] = { 0x30e1, 0x20dd, 0 };
+static const unichar_t str_32f2[] = { 0x30e2, 0x20dd, 0 };
+static const unichar_t str_32f3[] = { 0x30e4, 0x20dd, 0 };
+static const unichar_t str_32f4[] = { 0x30e6, 0x20dd, 0 };
+static const unichar_t str_32f5[] = { 0x30e8, 0x20dd, 0 };
+static const unichar_t str_32f6[] = { 0x30e9, 0x20dd, 0 };
+static const unichar_t str_32f7[] = { 0x30ea, 0x20dd, 0 };
+static const unichar_t str_32f8[] = { 0x30eb, 0x20dd, 0 };
+static const unichar_t str_32f9[] = { 0x30ec, 0x20dd, 0 };
+static const unichar_t str_32fa[] = { 0x30ed, 0x20dd, 0 };
+static const unichar_t str_32fb[] = { 0x30ef, 0x20dd, 0 };
+static const unichar_t str_32fc[] = { 0x30f0, 0x20dd, 0 };
+static const unichar_t str_32fd[] = { 0x30f1, 0x20dd, 0 };
+static const unichar_t str_32fe[] = { 0x30f2, 0x20dd, 0 };
+static const unichar_t str_3300[] = { 0x30a2, 0x30d1, 0x30fc, 0x30c8, 0 };
+static const unichar_t str_3301[] = { 0x30a2, 0x30eb, 0x30d5, 0x30a1, 0 };
+static const unichar_t str_3302[] = { 0x30a2, 0x30f3, 0x30da, 0x30a2, 0 };
+static const unichar_t str_3303[] = { 0x30a2, 0x30fc, 0x30eb, 0 };
+static const unichar_t str_3304[] = { 0x30a4, 0x30cb, 0x30f3, 0x30b0, 0 };
+static const unichar_t str_3305[] = { 0x30a4, 0x30f3, 0x30c1, 0 };
+static const unichar_t str_3306[] = { 0x30a6, 0x30a9, 0x30f3, 0 };
+static const unichar_t str_3307[] = { 0x30a8, 0x30b9, 0x30af, 0x30fc, 0x30c9, 0 };
+static const unichar_t str_3308[] = { 0x30a8, 0x30fc, 0x30ab, 0x30fc, 0 };
+static const unichar_t str_3309[] = { 0x30aa, 0x30f3, 0x30b9, 0 };
+static const unichar_t str_330a[] = { 0x30aa, 0x30fc, 0x30e0, 0 };
+static const unichar_t str_330b[] = { 0x30ab, 0x30a4, 0x30ea, 0 };
+static const unichar_t str_330c[] = { 0x30ab, 0x30e9, 0x30c3, 0x30c8, 0 };
+static const unichar_t str_330d[] = { 0x30ab, 0x30ed, 0x30ea, 0x30fc, 0 };
+static const unichar_t str_330e[] = { 0x30ac, 0x30ed, 0x30f3, 0 };
+static const unichar_t str_330f[] = { 0x30ac, 0x30f3, 0x30de, 0 };
+static const unichar_t str_3310[] = { 0x30ae, 0x30ac, 0 };
+static const unichar_t str_3311[] = { 0x30ae, 0x30cb, 0x30fc, 0 };
+static const unichar_t str_3312[] = { 0x30ad, 0x30e5, 0x30ea, 0x30fc, 0 };
+static const unichar_t str_3313[] = { 0x30ae, 0x30eb, 0x30c0, 0x30fc, 0 };
+static const unichar_t str_3314[] = { 0x30ad, 0x30ed, 0 };
+static const unichar_t str_3315[] = { 0x30ad, 0x30ed, 0x30b0, 0x30e9, 0x30e0, 0 };
+static const unichar_t str_3316[] = { 0x30ad, 0x30ed, 0x30e1, 0x30fc, 0x30c8, 0x30eb, 0 };
+static const unichar_t str_3317[] = { 0x30ad, 0x30ed, 0x30ef, 0x30c3, 0x30c8, 0 };
+static const unichar_t str_3318[] = { 0x30b0, 0x30e9, 0x30e0, 0 };
+static const unichar_t str_3319[] = { 0x30b0, 0x30e9, 0x30e0, 0x30c8, 0x30f3, 0 };
+static const unichar_t str_331a[] = { 0x30af, 0x30eb, 0x30bc, 0x30a4, 0x30ed, 0 };
+static const unichar_t str_331b[] = { 0x30af, 0x30ed, 0x30fc, 0x30cd, 0 };
+static const unichar_t str_331c[] = { 0x30b1, 0x30fc, 0x30b9, 0 };
+static const unichar_t str_331d[] = { 0x30b3, 0x30eb, 0x30ca, 0 };
+static const unichar_t str_331e[] = { 0x30b3, 0x30fc, 0x30dd, 0 };
+static const unichar_t str_331f[] = { 0x30b5, 0x30a4, 0x30af, 0x30eb, 0 };
+static const unichar_t str_3320[] = { 0x30b5, 0x30f3, 0x30c1, 0x30fc, 0x30e0, 0 };
+static const unichar_t str_3321[] = { 0x30b7, 0x30ea, 0x30f3, 0x30b0, 0 };
+static const unichar_t str_3322[] = { 0x30bb, 0x30f3, 0x30c1, 0 };
+static const unichar_t str_3323[] = { 0x30bb, 0x30f3, 0x30c8, 0 };
+static const unichar_t str_3324[] = { 0x30c0, 0x30fc, 0x30b9, 0 };
+static const unichar_t str_3325[] = { 0x30c7, 0x30b7, 0 };
+static const unichar_t str_3326[] = { 0x30c9, 0x30eb, 0 };
+static const unichar_t str_3327[] = { 0x30c8, 0x30f3, 0 };
+static const unichar_t str_3328[] = { 0x30ca, 0x30ce, 0 };
+static const unichar_t str_3329[] = { 0x30ce, 0x30c3, 0x30c8, 0 };
+static const unichar_t str_332a[] = { 0x30cf, 0x30a4, 0x30c4, 0 };
+static const unichar_t str_332b[] = { 0x30d1, 0x30fc, 0x30bb, 0x30f3, 0x30c8, 0 };
+static const unichar_t str_332c[] = { 0x30d1, 0x30fc, 0x30c4, 0 };
+static const unichar_t str_332d[] = { 0x30d0, 0x30fc, 0x30ec, 0x30eb, 0 };
+static const unichar_t str_332e[] = { 0x30d4, 0x30a2, 0x30b9, 0x30c8, 0x30eb, 0 };
+static const unichar_t str_332f[] = { 0x30d4, 0x30af, 0x30eb, 0 };
+static const unichar_t str_3330[] = { 0x30d4, 0x30b3, 0 };
+static const unichar_t str_3331[] = { 0x30d3, 0x30eb, 0 };
+static const unichar_t str_3332[] = { 0x30d5, 0x30a1, 0x30e9, 0x30c3, 0x30c9, 0 };
+static const unichar_t str_3333[] = { 0x30d5, 0x30a3, 0x30fc, 0x30c8, 0 };
+static const unichar_t str_3334[] = { 0x30d6, 0x30c3, 0x30b7, 0x30a7, 0x30eb, 0 };
+static const unichar_t str_3335[] = { 0x30d5, 0x30e9, 0x30f3, 0 };
+static const unichar_t str_3336[] = { 0x30d8, 0x30af, 0x30bf, 0x30fc, 0x30eb, 0 };
+static const unichar_t str_3337[] = { 0x30da, 0x30bd, 0 };
+static const unichar_t str_3338[] = { 0x30da, 0x30cb, 0x30d2, 0 };
+static const unichar_t str_3339[] = { 0x30d8, 0x30eb, 0x30c4, 0 };
+static const unichar_t str_333a[] = { 0x30da, 0x30f3, 0x30b9, 0 };
+static const unichar_t str_333b[] = { 0x30da, 0x30fc, 0x30b8, 0 };
+static const unichar_t str_333c[] = { 0x30d9, 0x30fc, 0x30bf, 0 };
+static const unichar_t str_333d[] = { 0x30dd, 0x30a4, 0x30f3, 0x30c8, 0 };
+static const unichar_t str_333e[] = { 0x30dc, 0x30eb, 0x30c8, 0 };
+static const unichar_t str_333f[] = { 0x30db, 0x30f3, 0 };
+static const unichar_t str_3340[] = { 0x30dd, 0x30f3, 0x30c9, 0 };
+static const unichar_t str_3341[] = { 0x30db, 0x30fc, 0x30eb, 0 };
+static const unichar_t str_3342[] = { 0x30db, 0x30fc, 0x30f3, 0 };
+static const unichar_t str_3343[] = { 0x30de, 0x30a4, 0x30af, 0x30ed, 0 };
+static const unichar_t str_3344[] = { 0x30de, 0x30a4, 0x30eb, 0 };
+static const unichar_t str_3345[] = { 0x30de, 0x30c3, 0x30cf, 0 };
+static const unichar_t str_3346[] = { 0x30de, 0x30eb, 0x30af, 0 };
+static const unichar_t str_3347[] = { 0x30de, 0x30f3, 0x30b7, 0x30e7, 0x30f3, 0 };
+static const unichar_t str_3348[] = { 0x30df, 0x30af, 0x30ed, 0x30f3, 0 };
+static const unichar_t str_3349[] = { 0x30df, 0x30ea, 0 };
+static const unichar_t str_334a[] = { 0x30df, 0x30ea, 0x30d0, 0x30fc, 0x30eb, 0 };
+static const unichar_t str_334b[] = { 0x30e1, 0x30ac, 0 };
+static const unichar_t str_334c[] = { 0x30e1, 0x30ac, 0x30c8, 0x30f3, 0 };
+static const unichar_t str_334d[] = { 0x30e1, 0x30fc, 0x30c8, 0x30eb, 0 };
+static const unichar_t str_334e[] = { 0x30e4, 0x30fc, 0x30c9, 0 };
+static const unichar_t str_334f[] = { 0x30e4, 0x30fc, 0x30eb, 0 };
+static const unichar_t str_3350[] = { 0x30e6, 0x30a2, 0x30f3, 0 };
+static const unichar_t str_3351[] = { 0x30ea, 0x30c3, 0x30c8, 0x30eb, 0 };
+static const unichar_t str_3352[] = { 0x30ea, 0x30e9, 0 };
+static const unichar_t str_3353[] = { 0x30eb, 0x30d4, 0x30fc, 0 };
+static const unichar_t str_3354[] = { 0x30eb, 0x30fc, 0x30d6, 0x30eb, 0 };
+static const unichar_t str_3355[] = { 0x30ec, 0x30e0, 0 };
+static const unichar_t str_3356[] = { 0x30ec, 0x30f3, 0x30c8, 0x30b2, 0x30f3, 0 };
+static const unichar_t str_3357[] = { 0x30ef, 0x30c3, 0x30c8, 0 };
+static const unichar_t str_3358[] = { 0x0030, 0x70b9, 0 };
+static const unichar_t str_3359[] = { 0x0031, 0x70b9, 0 };
+static const unichar_t str_335a[] = { 0x0032, 0x70b9, 0 };
+static const unichar_t str_335b[] = { 0x0033, 0x70b9, 0 };
+static const unichar_t str_335c[] = { 0x0034, 0x70b9, 0 };
+static const unichar_t str_335d[] = { 0x0035, 0x70b9, 0 };
+static const unichar_t str_335e[] = { 0x0036, 0x70b9, 0 };
+static const unichar_t str_335f[] = { 0x0037, 0x70b9, 0 };
+static const unichar_t str_3360[] = { 0x0038, 0x70b9, 0 };
+static const unichar_t str_3361[] = { 0x0039, 0x70b9, 0 };
+static const unichar_t str_3362[] = { 0x0031, 0x0030, 0x70b9, 0 };
+static const unichar_t str_3363[] = { 0x0031, 0x0031, 0x70b9, 0 };
+static const unichar_t str_3364[] = { 0x0031, 0x0032, 0x70b9, 0 };
+static const unichar_t str_3365[] = { 0x0031, 0x0033, 0x70b9, 0 };
+static const unichar_t str_3366[] = { 0x0031, 0x0034, 0x70b9, 0 };
+static const unichar_t str_3367[] = { 0x0031, 0x0035, 0x70b9, 0 };
+static const unichar_t str_3368[] = { 0x0031, 0x0036, 0x70b9, 0 };
+static const unichar_t str_3369[] = { 0x0031, 0x0037, 0x70b9, 0 };
+static const unichar_t str_336a[] = { 0x0031, 0x0038, 0x70b9, 0 };
+static const unichar_t str_336b[] = { 0x0031, 0x0039, 0x70b9, 0 };
+static const unichar_t str_336c[] = { 0x0032, 0x0030, 0x70b9, 0 };
+static const unichar_t str_336d[] = { 0x0032, 0x0031, 0x70b9, 0 };
+static const unichar_t str_336e[] = { 0x0032, 0x0032, 0x70b9, 0 };
+static const unichar_t str_336f[] = { 0x0032, 0x0033, 0x70b9, 0 };
+static const unichar_t str_3370[] = { 0x0032, 0x0034, 0x70b9, 0 };
+static const unichar_t str_3371[] = { 0x0068, 0x0050, 0x0061, 0 };
+static const unichar_t str_3372[] = { 0x0064, 0x0061, 0 };
+static const unichar_t str_3373[] = { 0x0041, 0x0055, 0 };
+static const unichar_t str_3374[] = { 0x0062, 0x0061, 0x0072, 0 };
+static const unichar_t str_3375[] = { 0x006f, 0x0056, 0 };
+static const unichar_t str_3376[] = { 0x0070, 0x0063, 0 };
+static const unichar_t str_3377[] = { 0x0064, 0x006d, 0 };
+static const unichar_t str_3378[] = { 0x0064, 0x006d, 0x00b2, 0 };
+static const unichar_t str_3379[] = { 0x0064, 0x006d, 0x00b3, 0 };
+static const unichar_t str_337a[] = { 0x0049, 0x0055, 0 };
+static const unichar_t str_337b[] = { 0x5e73, 0x6210, 0 };
+static const unichar_t str_337c[] = { 0x662d, 0x548c, 0 };
+static const unichar_t str_337d[] = { 0x5927, 0x6b63, 0 };
+static const unichar_t str_337e[] = { 0x660e, 0x6cbb, 0 };
+static const unichar_t str_337f[] = { 0x682a, 0x5f0f, 0x4f1a, 0x793e, 0 };
+static const unichar_t str_3380[] = { 0x0070, 0x0041, 0 };
+static const unichar_t str_3381[] = { 0x006e, 0x0041, 0 };
+static const unichar_t str_3382[] = { 0x03bc, 0x0041, 0 };
+static const unichar_t str_3383[] = { 0x006d, 0x0041, 0 };
+static const unichar_t str_3384[] = { 0x006b, 0x0041, 0 };
+static const unichar_t str_3385[] = { 0x004b, 0x0042, 0 };
+static const unichar_t str_3386[] = { 0x004d, 0x0042, 0 };
+static const unichar_t str_3387[] = { 0x0047, 0x0042, 0 };
+static const unichar_t str_3388[] = { 0x0063, 0x0061, 0x006c, 0 };
+static const unichar_t str_3389[] = { 0x006b, 0x0063, 0x0061, 0x006c, 0 };
+static const unichar_t str_338a[] = { 0x0070, 0x0046, 0 };
+static const unichar_t str_338b[] = { 0x006e, 0x0046, 0 };
+static const unichar_t str_338c[] = { 0x03bc, 0x0046, 0 };
+static const unichar_t str_338d[] = { 0x03bc, 0x0067, 0 };
+static const unichar_t str_338e[] = { 0x006d, 0x0067, 0 };
+static const unichar_t str_338f[] = { 0x006b, 0x0067, 0 };
+static const unichar_t str_3390[] = { 0x0048, 0x007a, 0 };
+static const unichar_t str_3391[] = { 0x006b, 0x0048, 0x007a, 0 };
+static const unichar_t str_3392[] = { 0x004d, 0x0048, 0x007a, 0 };
+static const unichar_t str_3393[] = { 0x0047, 0x0048, 0x007a, 0 };
+static const unichar_t str_3394[] = { 0x0054, 0x0048, 0x007a, 0 };
+static const unichar_t str_3395[] = { 0x03bc, 0x2113, 0 };
+static const unichar_t str_3396[] = { 0x006d, 0x2113, 0 };
+static const unichar_t str_3397[] = { 0x0064, 0x2113, 0 };
+static const unichar_t str_3398[] = { 0x006b, 0x2113, 0 };
+static const unichar_t str_3399[] = { 0x0066, 0x006d, 0 };
+static const unichar_t str_339a[] = { 0x006e, 0x006d, 0 };
+static const unichar_t str_339b[] = { 0x03bc, 0x006d, 0 };
+static const unichar_t str_339c[] = { 0x006d, 0x006d, 0 };
+static const unichar_t str_339d[] = { 0x0063, 0x006d, 0 };
+static const unichar_t str_339e[] = { 0x006b, 0x006d, 0 };
+static const unichar_t str_339f[] = { 0x006d, 0x006d, 0x00b2, 0 };
+static const unichar_t str_33a0[] = { 0x0063, 0x006d, 0x00b2, 0 };
+static const unichar_t str_33a1[] = { 0x006d, 0x00b2, 0 };
+static const unichar_t str_33a2[] = { 0x006b, 0x006d, 0x00b2, 0 };
+static const unichar_t str_33a3[] = { 0x006d, 0x006d, 0x00b3, 0 };
+static const unichar_t str_33a4[] = { 0x0063, 0x006d, 0x00b3, 0 };
+static const unichar_t str_33a5[] = { 0x006d, 0x00b3, 0 };
+static const unichar_t str_33a6[] = { 0x006b, 0x006d, 0x00b3, 0 };
+static const unichar_t str_33a7[] = { 0x006d, 0x2215, 0x0073, 0 };
+static const unichar_t str_33a8[] = { 0x006d, 0x2215, 0x0073, 0x00b2, 0 };
+static const unichar_t str_33a9[] = { 0x0050, 0x0061, 0 };
+static const unichar_t str_33aa[] = { 0x006b, 0x0050, 0x0061, 0 };
+static const unichar_t str_33ab[] = { 0x004d, 0x0050, 0x0061, 0 };
+static const unichar_t str_33ac[] = { 0x0047, 0x0050, 0x0061, 0 };
+static const unichar_t str_33ad[] = { 0x0072, 0x0061, 0x0064, 0 };
+static const unichar_t str_33ae[] = { 0x0072, 0x0061, 0x0064, 0x2215, 0x0073, 0 };
+static const unichar_t str_33af[] = { 0x0072, 0x0061, 0x0064, 0x2215, 0x0073, 0x00b2, 0 };
+static const unichar_t str_33b0[] = { 0x0070, 0x0073, 0 };
+static const unichar_t str_33b1[] = { 0x006e, 0x0073, 0 };
+static const unichar_t str_33b2[] = { 0x03bc, 0x0073, 0 };
+static const unichar_t str_33b3[] = { 0x006d, 0x0073, 0 };
+static const unichar_t str_33b4[] = { 0x0070, 0x0056, 0 };
+static const unichar_t str_33b5[] = { 0x006e, 0x0056, 0 };
+static const unichar_t str_33b6[] = { 0x03bc, 0x0056, 0 };
+static const unichar_t str_33b7[] = { 0x006d, 0x0056, 0 };
+static const unichar_t str_33b8[] = { 0x006b, 0x0056, 0 };
+static const unichar_t str_33b9[] = { 0x004d, 0x0056, 0 };
+static const unichar_t str_33ba[] = { 0x0070, 0x0057, 0 };
+static const unichar_t str_33bb[] = { 0x006e, 0x0057, 0 };
+static const unichar_t str_33bc[] = { 0x03bc, 0x0057, 0 };
+static const unichar_t str_33bd[] = { 0x006d, 0x0057, 0 };
+static const unichar_t str_33be[] = { 0x006b, 0x0057, 0 };
+static const unichar_t str_33bf[] = { 0x004d, 0x0057, 0 };
+static const unichar_t str_33c0[] = { 0x006b, 0x03a9, 0 };
+static const unichar_t str_33c1[] = { 0x004d, 0x03a9, 0 };
+static const unichar_t str_33c2[] = { 0x0061, 0x002e, 0x006d, 0x002e, 0 };
+static const unichar_t str_33c3[] = { 0x0042, 0x0071, 0 };
+static const unichar_t str_33c4[] = { 0x0063, 0x0063, 0 };
+static const unichar_t str_33c5[] = { 0x0063, 0x0064, 0 };
+static const unichar_t str_33c6[] = { 0x0043, 0x2215, 0x006b, 0x0067, 0 };
+static const unichar_t str_33c7[] = { 0x0043, 0x006f, 0x002e, 0 };
+static const unichar_t str_33c8[] = { 0x0064, 0x0042, 0 };
+static const unichar_t str_33c9[] = { 0x0047, 0x0079, 0 };
+static const unichar_t str_33ca[] = { 0x0068, 0x0061, 0 };
+static const unichar_t str_33cb[] = { 0x0048, 0x0050, 0 };
+static const unichar_t str_33cc[] = { 0x0069, 0x006e, 0 };
+static const unichar_t str_33cd[] = { 0x004b, 0x004b, 0 };
+static const unichar_t str_33ce[] = { 0x004b, 0x004d, 0 };
+static const unichar_t str_33cf[] = { 0x006b, 0x0074, 0 };
+static const unichar_t str_33d0[] = { 0x006c, 0x006d, 0 };
+static const unichar_t str_33d1[] = { 0x006c, 0x006e, 0 };
+static const unichar_t str_33d2[] = { 0x006c, 0x006f, 0x0067, 0 };
+static const unichar_t str_33d3[] = { 0x006c, 0x0078, 0 };
+static const unichar_t str_33d4[] = { 0x006d, 0x0062, 0 };
+static const unichar_t str_33d5[] = { 0x006d, 0x0069, 0x006c, 0 };
+static const unichar_t str_33d6[] = { 0x006d, 0x006f, 0x006c, 0 };
+static const unichar_t str_33d7[] = { 0x0050, 0x0048, 0 };
+static const unichar_t str_33d8[] = { 0x0070, 0x002e, 0x006d, 0x002e, 0 };
+static const unichar_t str_33d9[] = { 0x0050, 0x0050, 0x004d, 0 };
+static const unichar_t str_33da[] = { 0x0050, 0x0052, 0 };
+static const unichar_t str_33db[] = { 0x0073, 0x0072, 0 };
+static const unichar_t str_33dc[] = { 0x0053, 0x0076, 0 };
+static const unichar_t str_33dd[] = { 0x0057, 0x0062, 0 };
+static const unichar_t str_33de[] = { 0x0056, 0x2215, 0x006d, 0 };
+static const unichar_t str_33df[] = { 0x0041, 0x2215, 0x006d, 0 };
+static const unichar_t str_33e0[] = { 0x0031, 0x65e5, 0 };
+static const unichar_t str_33e1[] = { 0x0032, 0x65e5, 0 };
+static const unichar_t str_33e2[] = { 0x0033, 0x65e5, 0 };
+static const unichar_t str_33e3[] = { 0x0034, 0x65e5, 0 };
+static const unichar_t str_33e4[] = { 0x0035, 0x65e5, 0 };
+static const unichar_t str_33e5[] = { 0x0036, 0x65e5, 0 };
+static const unichar_t str_33e6[] = { 0x0037, 0x65e5, 0 };
+static const unichar_t str_33e7[] = { 0x0038, 0x65e5, 0 };
+static const unichar_t str_33e8[] = { 0x0039, 0x65e5, 0 };
+static const unichar_t str_33e9[] = { 0x0031, 0x0030, 0x65e5, 0 };
+static const unichar_t str_33ea[] = { 0x0031, 0x0031, 0x65e5, 0 };
+static const unichar_t str_33eb[] = { 0x0031, 0x0032, 0x65e5, 0 };
+static const unichar_t str_33ec[] = { 0x0031, 0x0033, 0x65e5, 0 };
+static const unichar_t str_33ed[] = { 0x0031, 0x0034, 0x65e5, 0 };
+static const unichar_t str_33ee[] = { 0x0031, 0x0035, 0x65e5, 0 };
+static const unichar_t str_33ef[] = { 0x0031, 0x0036, 0x65e5, 0 };
+static const unichar_t str_33f0[] = { 0x0031, 0x0037, 0x65e5, 0 };
+static const unichar_t str_33f1[] = { 0x0031, 0x0038, 0x65e5, 0 };
+static const unichar_t str_33f2[] = { 0x0031, 0x0039, 0x65e5, 0 };
+static const unichar_t str_33f3[] = { 0x0032, 0x0030, 0x65e5, 0 };
+static const unichar_t str_33f4[] = { 0x0032, 0x0031, 0x65e5, 0 };
+static const unichar_t str_33f5[] = { 0x0032, 0x0032, 0x65e5, 0 };
+static const unichar_t str_33f6[] = { 0x0032, 0x0033, 0x65e5, 0 };
+static const unichar_t str_33f7[] = { 0x0032, 0x0034, 0x65e5, 0 };
+static const unichar_t str_33f8[] = { 0x0032, 0x0035, 0x65e5, 0 };
+static const unichar_t str_33f9[] = { 0x0032, 0x0036, 0x65e5, 0 };
+static const unichar_t str_33fa[] = { 0x0032, 0x0037, 0x65e5, 0 };
+static const unichar_t str_33fb[] = { 0x0032, 0x0038, 0x65e5, 0 };
+static const unichar_t str_33fc[] = { 0x0032, 0x0039, 0x65e5, 0 };
+static const unichar_t str_33fd[] = { 0x0033, 0x0030, 0x65e5, 0 };
+static const unichar_t str_33fe[] = { 0x0033, 0x0031, 0x65e5, 0 };
+static const unichar_t str_33ff[] = { 0x0067, 0x0061, 0x006c, 0 };
+static const unichar_t str_a770[] = { 0xa76f, 0 };
+static const unichar_t str_f900[] = { 0x8c48, 0 };
+static const unichar_t str_f901[] = { 0x66f4, 0 };
+static const unichar_t str_f902[] = { 0x8eca, 0 };
+static const unichar_t str_f903[] = { 0x8cc8, 0 };
+static const unichar_t str_f904[] = { 0x6ed1, 0 };
+static const unichar_t str_f905[] = { 0x4e32, 0 };
+static const unichar_t str_f906[] = { 0x53e5, 0 };
+static const unichar_t str_f907[] = { 0x9f9c, 0 };
+static const unichar_t str_f908[] = { 0x9f9c, 0 };
+static const unichar_t str_f909[] = { 0x5951, 0 };
+static const unichar_t str_f90a[] = { 0x91d1, 0 };
+static const unichar_t str_f90b[] = { 0x5587, 0 };
+static const unichar_t str_f90c[] = { 0x5948, 0 };
+static const unichar_t str_f90d[] = { 0x61f6, 0 };
+static const unichar_t str_f90e[] = { 0x7669, 0 };
+static const unichar_t str_f90f[] = { 0x7f85, 0 };
+static const unichar_t str_f910[] = { 0x863f, 0 };
+static const unichar_t str_f911[] = { 0x87ba, 0 };
+static const unichar_t str_f912[] = { 0x88f8, 0 };
+static const unichar_t str_f913[] = { 0x908f, 0 };
+static const unichar_t str_f914[] = { 0x6a02, 0 };
+static const unichar_t str_f915[] = { 0x6d1b, 0 };
+static const unichar_t str_f916[] = { 0x70d9, 0 };
+static const unichar_t str_f917[] = { 0x73de, 0 };
+static const unichar_t str_f918[] = { 0x843d, 0 };
+static const unichar_t str_f919[] = { 0x916a, 0 };
+static const unichar_t str_f91a[] = { 0x99f1, 0 };
+static const unichar_t str_f91b[] = { 0x4e82, 0 };
+static const unichar_t str_f91c[] = { 0x5375, 0 };
+static const unichar_t str_f91d[] = { 0x6b04, 0 };
+static const unichar_t str_f91e[] = { 0x721b, 0 };
+static const unichar_t str_f91f[] = { 0x862d, 0 };
+static const unichar_t str_f920[] = { 0x9e1e, 0 };
+static const unichar_t str_f921[] = { 0x5d50, 0 };
+static const unichar_t str_f922[] = { 0x6feb, 0 };
+static const unichar_t str_f923[] = { 0x85cd, 0 };
+static const unichar_t str_f924[] = { 0x8964, 0 };
+static const unichar_t str_f925[] = { 0x62c9, 0 };
+static const unichar_t str_f926[] = { 0x81d8, 0 };
+static const unichar_t str_f927[] = { 0x881f, 0 };
+static const unichar_t str_f928[] = { 0x5eca, 0 };
+static const unichar_t str_f929[] = { 0x6717, 0 };
+static const unichar_t str_f92a[] = { 0x6d6a, 0 };
+static const unichar_t str_f92b[] = { 0x72fc, 0 };
+static const unichar_t str_f92c[] = { 0x90ce, 0 };
+static const unichar_t str_f92d[] = { 0x4f86, 0 };
+static const unichar_t str_f92e[] = { 0x51b7, 0 };
+static const unichar_t str_f92f[] = { 0x52de, 0 };
+static const unichar_t str_f930[] = { 0x64c4, 0 };
+static const unichar_t str_f931[] = { 0x6ad3, 0 };
+static const unichar_t str_f932[] = { 0x7210, 0 };
+static const unichar_t str_f933[] = { 0x76e7, 0 };
+static const unichar_t str_f934[] = { 0x8001, 0 };
+static const unichar_t str_f935[] = { 0x8606, 0 };
+static const unichar_t str_f936[] = { 0x865c, 0 };
+static const unichar_t str_f937[] = { 0x8def, 0 };
+static const unichar_t str_f938[] = { 0x9732, 0 };
+static const unichar_t str_f939[] = { 0x9b6f, 0 };
+static const unichar_t str_f93a[] = { 0x9dfa, 0 };
+static const unichar_t str_f93b[] = { 0x788c, 0 };
+static const unichar_t str_f93c[] = { 0x797f, 0 };
+static const unichar_t str_f93d[] = { 0x7da0, 0 };
+static const unichar_t str_f93e[] = { 0x83c9, 0 };
+static const unichar_t str_f93f[] = { 0x9304, 0 };
+static const unichar_t str_f940[] = { 0x9e7f, 0 };
+static const unichar_t str_f941[] = { 0x8ad6, 0 };
+static const unichar_t str_f942[] = { 0x58df, 0 };
+static const unichar_t str_f943[] = { 0x5f04, 0 };
+static const unichar_t str_f944[] = { 0x7c60, 0 };
+static const unichar_t str_f945[] = { 0x807e, 0 };
+static const unichar_t str_f946[] = { 0x7262, 0 };
+static const unichar_t str_f947[] = { 0x78ca, 0 };
+static const unichar_t str_f948[] = { 0x8cc2, 0 };
+static const unichar_t str_f949[] = { 0x96f7, 0 };
+static const unichar_t str_f94a[] = { 0x58d8, 0 };
+static const unichar_t str_f94b[] = { 0x5c62, 0 };
+static const unichar_t str_f94c[] = { 0x6a13, 0 };
+static const unichar_t str_f94d[] = { 0x6dda, 0 };
+static const unichar_t str_f94e[] = { 0x6f0f, 0 };
+static const unichar_t str_f94f[] = { 0x7d2f, 0 };
+static const unichar_t str_f950[] = { 0x7e37, 0 };
+static const unichar_t str_f951[] = { 0x964b, 0 };
+static const unichar_t str_f952[] = { 0x52d2, 0 };
+static const unichar_t str_f953[] = { 0x808b, 0 };
+static const unichar_t str_f954[] = { 0x51dc, 0 };
+static const unichar_t str_f955[] = { 0x51cc, 0 };
+static const unichar_t str_f956[] = { 0x7a1c, 0 };
+static const unichar_t str_f957[] = { 0x7dbe, 0 };
+static const unichar_t str_f958[] = { 0x83f1, 0 };
+static const unichar_t str_f959[] = { 0x9675, 0 };
+static const unichar_t str_f95a[] = { 0x8b80, 0 };
+static const unichar_t str_f95b[] = { 0x62cf, 0 };
+static const unichar_t str_f95c[] = { 0x6a02, 0 };
+static const unichar_t str_f95d[] = { 0x8afe, 0 };
+static const unichar_t str_f95e[] = { 0x4e39, 0 };
+static const unichar_t str_f95f[] = { 0x5be7, 0 };
+static const unichar_t str_f960[] = { 0x6012, 0 };
+static const unichar_t str_f961[] = { 0x7387, 0 };
+static const unichar_t str_f962[] = { 0x7570, 0 };
+static const unichar_t str_f963[] = { 0x5317, 0 };
+static const unichar_t str_f964[] = { 0x78fb, 0 };
+static const unichar_t str_f965[] = { 0x4fbf, 0 };
+static const unichar_t str_f966[] = { 0x5fa9, 0 };
+static const unichar_t str_f967[] = { 0x4e0d, 0 };
+static const unichar_t str_f968[] = { 0x6ccc, 0 };
+static const unichar_t str_f969[] = { 0x6578, 0 };
+static const unichar_t str_f96a[] = { 0x7d22, 0 };
+static const unichar_t str_f96b[] = { 0x53c3, 0 };
+static const unichar_t str_f96c[] = { 0x585e, 0 };
+static const unichar_t str_f96d[] = { 0x7701, 0 };
+static const unichar_t str_f96e[] = { 0x8449, 0 };
+static const unichar_t str_f96f[] = { 0x8aaa, 0 };
+static const unichar_t str_f970[] = { 0x6bba, 0 };
+static const unichar_t str_f971[] = { 0x8fb0, 0 };
+static const unichar_t str_f972[] = { 0x6c88, 0 };
+static const unichar_t str_f973[] = { 0x62fe, 0 };
+static const unichar_t str_f974[] = { 0x82e5, 0 };
+static const unichar_t str_f975[] = { 0x63a0, 0 };
+static const unichar_t str_f976[] = { 0x7565, 0 };
+static const unichar_t str_f977[] = { 0x4eae, 0 };
+static const unichar_t str_f978[] = { 0x5169, 0 };
+static const unichar_t str_f979[] = { 0x51c9, 0 };
+static const unichar_t str_f97a[] = { 0x6881, 0 };
+static const unichar_t str_f97b[] = { 0x7ce7, 0 };
+static const unichar_t str_f97c[] = { 0x826f, 0 };
+static const unichar_t str_f97d[] = { 0x8ad2, 0 };
+static const unichar_t str_f97e[] = { 0x91cf, 0 };
+static const unichar_t str_f97f[] = { 0x52f5, 0 };
+static const unichar_t str_f980[] = { 0x5442, 0 };
+static const unichar_t str_f981[] = { 0x5973, 0 };
+static const unichar_t str_f982[] = { 0x5eec, 0 };
+static const unichar_t str_f983[] = { 0x65c5, 0 };
+static const unichar_t str_f984[] = { 0x6ffe, 0 };
+static const unichar_t str_f985[] = { 0x792a, 0 };
+static const unichar_t str_f986[] = { 0x95ad, 0 };
+static const unichar_t str_f987[] = { 0x9a6a, 0 };
+static const unichar_t str_f988[] = { 0x9e97, 0 };
+static const unichar_t str_f989[] = { 0x9ece, 0 };
+static const unichar_t str_f98a[] = { 0x529b, 0 };
+static const unichar_t str_f98b[] = { 0x66c6, 0 };
+static const unichar_t str_f98c[] = { 0x6b77, 0 };
+static const unichar_t str_f98d[] = { 0x8f62, 0 };
+static const unichar_t str_f98e[] = { 0x5e74, 0 };
+static const unichar_t str_f98f[] = { 0x6190, 0 };
+static const unichar_t str_f990[] = { 0x6200, 0 };
+static const unichar_t str_f991[] = { 0x649a, 0 };
+static const unichar_t str_f992[] = { 0x6f23, 0 };
+static const unichar_t str_f993[] = { 0x7149, 0 };
+static const unichar_t str_f994[] = { 0x7489, 0 };
+static const unichar_t str_f995[] = { 0x79ca, 0 };
+static const unichar_t str_f996[] = { 0x7df4, 0 };
+static const unichar_t str_f997[] = { 0x806f, 0 };
+static const unichar_t str_f998[] = { 0x8f26, 0 };
+static const unichar_t str_f999[] = { 0x84ee, 0 };
+static const unichar_t str_f99a[] = { 0x9023, 0 };
+static const unichar_t str_f99b[] = { 0x934a, 0 };
+static const unichar_t str_f99c[] = { 0x5217, 0 };
+static const unichar_t str_f99d[] = { 0x52a3, 0 };
+static const unichar_t str_f99e[] = { 0x54bd, 0 };
+static const unichar_t str_f99f[] = { 0x70c8, 0 };
+static const unichar_t str_f9a0[] = { 0x88c2, 0 };
+static const unichar_t str_f9a1[] = { 0x8aaa, 0 };
+static const unichar_t str_f9a2[] = { 0x5ec9, 0 };
+static const unichar_t str_f9a3[] = { 0x5ff5, 0 };
+static const unichar_t str_f9a4[] = { 0x637b, 0 };
+static const unichar_t str_f9a5[] = { 0x6bae, 0 };
+static const unichar_t str_f9a6[] = { 0x7c3e, 0 };
+static const unichar_t str_f9a7[] = { 0x7375, 0 };
+static const unichar_t str_f9a8[] = { 0x4ee4, 0 };
+static const unichar_t str_f9a9[] = { 0x56f9, 0 };
+static const unichar_t str_f9aa[] = { 0x5be7, 0 };
+static const unichar_t str_f9ab[] = { 0x5dba, 0 };
+static const unichar_t str_f9ac[] = { 0x601c, 0 };
+static const unichar_t str_f9ad[] = { 0x73b2, 0 };
+static const unichar_t str_f9ae[] = { 0x7469, 0 };
+static const unichar_t str_f9af[] = { 0x7f9a, 0 };
+static const unichar_t str_f9b0[] = { 0x8046, 0 };
+static const unichar_t str_f9b1[] = { 0x9234, 0 };
+static const unichar_t str_f9b2[] = { 0x96f6, 0 };
+static const unichar_t str_f9b3[] = { 0x9748, 0 };
+static const unichar_t str_f9b4[] = { 0x9818, 0 };
+static const unichar_t str_f9b5[] = { 0x4f8b, 0 };
+static const unichar_t str_f9b6[] = { 0x79ae, 0 };
+static const unichar_t str_f9b7[] = { 0x91b4, 0 };
+static const unichar_t str_f9b8[] = { 0x96b8, 0 };
+static const unichar_t str_f9b9[] = { 0x60e1, 0 };
+static const unichar_t str_f9ba[] = { 0x4e86, 0 };
+static const unichar_t str_f9bb[] = { 0x50da, 0 };
+static const unichar_t str_f9bc[] = { 0x5bee, 0 };
+static const unichar_t str_f9bd[] = { 0x5c3f, 0 };
+static const unichar_t str_f9be[] = { 0x6599, 0 };
+static const unichar_t str_f9bf[] = { 0x6a02, 0 };
+static const unichar_t str_f9c0[] = { 0x71ce, 0 };
+static const unichar_t str_f9c1[] = { 0x7642, 0 };
+static const unichar_t str_f9c2[] = { 0x84fc, 0 };
+static const unichar_t str_f9c3[] = { 0x907c, 0 };
+static const unichar_t str_f9c4[] = { 0x9f8d, 0 };
+static const unichar_t str_f9c5[] = { 0x6688, 0 };
+static const unichar_t str_f9c6[] = { 0x962e, 0 };
+static const unichar_t str_f9c7[] = { 0x5289, 0 };
+static const unichar_t str_f9c8[] = { 0x677b, 0 };
+static const unichar_t str_f9c9[] = { 0x67f3, 0 };
+static const unichar_t str_f9ca[] = { 0x6d41, 0 };
+static const unichar_t str_f9cb[] = { 0x6e9c, 0 };
+static const unichar_t str_f9cc[] = { 0x7409, 0 };
+static const unichar_t str_f9cd[] = { 0x7559, 0 };
+static const unichar_t str_f9ce[] = { 0x786b, 0 };
+static const unichar_t str_f9cf[] = { 0x7d10, 0 };
+static const unichar_t str_f9d0[] = { 0x985e, 0 };
+static const unichar_t str_f9d1[] = { 0x516d, 0 };
+static const unichar_t str_f9d2[] = { 0x622e, 0 };
+static const unichar_t str_f9d3[] = { 0x9678, 0 };
+static const unichar_t str_f9d4[] = { 0x502b, 0 };
+static const unichar_t str_f9d5[] = { 0x5d19, 0 };
+static const unichar_t str_f9d6[] = { 0x6dea, 0 };
+static const unichar_t str_f9d7[] = { 0x8f2a, 0 };
+static const unichar_t str_f9d8[] = { 0x5f8b, 0 };
+static const unichar_t str_f9d9[] = { 0x6144, 0 };
+static const unichar_t str_f9da[] = { 0x6817, 0 };
+static const unichar_t str_f9db[] = { 0x7387, 0 };
+static const unichar_t str_f9dc[] = { 0x9686, 0 };
+static const unichar_t str_f9dd[] = { 0x5229, 0 };
+static const unichar_t str_f9de[] = { 0x540f, 0 };
+static const unichar_t str_f9df[] = { 0x5c65, 0 };
+static const unichar_t str_f9e0[] = { 0x6613, 0 };
+static const unichar_t str_f9e1[] = { 0x674e, 0 };
+static const unichar_t str_f9e2[] = { 0x68a8, 0 };
+static const unichar_t str_f9e3[] = { 0x6ce5, 0 };
+static const unichar_t str_f9e4[] = { 0x7406, 0 };
+static const unichar_t str_f9e5[] = { 0x75e2, 0 };
+static const unichar_t str_f9e6[] = { 0x7f79, 0 };
+static const unichar_t str_f9e7[] = { 0x88cf, 0 };
+static const unichar_t str_f9e8[] = { 0x88e1, 0 };
+static const unichar_t str_f9e9[] = { 0x91cc, 0 };
+static const unichar_t str_f9ea[] = { 0x96e2, 0 };
+static const unichar_t str_f9eb[] = { 0x533f, 0 };
+static const unichar_t str_f9ec[] = { 0x6eba, 0 };
+static const unichar_t str_f9ed[] = { 0x541d, 0 };
+static const unichar_t str_f9ee[] = { 0x71d0, 0 };
+static const unichar_t str_f9ef[] = { 0x7498, 0 };
+static const unichar_t str_f9f0[] = { 0x85fa, 0 };
+static const unichar_t str_f9f1[] = { 0x96a3, 0 };
+static const unichar_t str_f9f2[] = { 0x9c57, 0 };
+static const unichar_t str_f9f3[] = { 0x9e9f, 0 };
+static const unichar_t str_f9f4[] = { 0x6797, 0 };
+static const unichar_t str_f9f5[] = { 0x6dcb, 0 };
+static const unichar_t str_f9f6[] = { 0x81e8, 0 };
+static const unichar_t str_f9f7[] = { 0x7acb, 0 };
+static const unichar_t str_f9f8[] = { 0x7b20, 0 };
+static const unichar_t str_f9f9[] = { 0x7c92, 0 };
+static const unichar_t str_f9fa[] = { 0x72c0, 0 };
+static const unichar_t str_f9fb[] = { 0x7099, 0 };
+static const unichar_t str_f9fc[] = { 0x8b58, 0 };
+static const unichar_t str_f9fd[] = { 0x4ec0, 0 };
+static const unichar_t str_f9fe[] = { 0x8336, 0 };
+static const unichar_t str_f9ff[] = { 0x523a, 0 };
+static const unichar_t str_fa00[] = { 0x5207, 0 };
+static const unichar_t str_fa01[] = { 0x5ea6, 0 };
+static const unichar_t str_fa02[] = { 0x62d3, 0 };
+static const unichar_t str_fa03[] = { 0x7cd6, 0 };
+static const unichar_t str_fa04[] = { 0x5b85, 0 };
+static const unichar_t str_fa05[] = { 0x6d1e, 0 };
+static const unichar_t str_fa06[] = { 0x66b4, 0 };
+static const unichar_t str_fa07[] = { 0x8f3b, 0 };
+static const unichar_t str_fa08[] = { 0x884c, 0 };
+static const unichar_t str_fa09[] = { 0x964d, 0 };
+static const unichar_t str_fa0a[] = { 0x898b, 0 };
+static const unichar_t str_fa0b[] = { 0x5ed3, 0 };
+static const unichar_t str_fa0c[] = { 0x5140, 0 };
+static const unichar_t str_fa0d[] = { 0x55c0, 0 };
+static const unichar_t str_fa10[] = { 0x585a, 0 };
+static const unichar_t str_fa12[] = { 0x6674, 0 };
+static const unichar_t str_fa15[] = { 0x51de, 0 };
+static const unichar_t str_fa16[] = { 0x732a, 0 };
+static const unichar_t str_fa17[] = { 0x76ca, 0 };
+static const unichar_t str_fa18[] = { 0x793c, 0 };
+static const unichar_t str_fa19[] = { 0x795e, 0 };
+static const unichar_t str_fa1a[] = { 0x7965, 0 };
+static const unichar_t str_fa1b[] = { 0x798f, 0 };
+static const unichar_t str_fa1c[] = { 0x9756, 0 };
+static const unichar_t str_fa1d[] = { 0x7cbe, 0 };
+static const unichar_t str_fa1e[] = { 0x7fbd, 0 };
+static const unichar_t str_fa20[] = { 0x8612, 0 };
+static const unichar_t str_fa22[] = { 0x8af8, 0 };
+static const unichar_t str_fa25[] = { 0x9038, 0 };
+static const unichar_t str_fa26[] = { 0x90fd, 0 };
+static const unichar_t str_fa2a[] = { 0x98ef, 0 };
+static const unichar_t str_fa2b[] = { 0x98fc, 0 };
+static const unichar_t str_fa2c[] = { 0x9928, 0 };
+static const unichar_t str_fa2d[] = { 0x9db4, 0 };
+static const unichar_t str_fa30[] = { 0x4fae, 0 };
+static const unichar_t str_fa31[] = { 0x50e7, 0 };
+static const unichar_t str_fa32[] = { 0x514d, 0 };
+static const unichar_t str_fa33[] = { 0x52c9, 0 };
+static const unichar_t str_fa34[] = { 0x52e4, 0 };
+static const unichar_t str_fa35[] = { 0x5351, 0 };
+static const unichar_t str_fa36[] = { 0x559d, 0 };
+static const unichar_t str_fa37[] = { 0x5606, 0 };
+static const unichar_t str_fa38[] = { 0x5668, 0 };
+static const unichar_t str_fa39[] = { 0x5840, 0 };
+static const unichar_t str_fa3a[] = { 0x58a8, 0 };
+static const unichar_t str_fa3b[] = { 0x5c64, 0 };
+static const unichar_t str_fa3c[] = { 0x5c6e, 0 };
+static const unichar_t str_fa3d[] = { 0x6094, 0 };
+static const unichar_t str_fa3e[] = { 0x6168, 0 };
+static const unichar_t str_fa3f[] = { 0x618e, 0 };
+static const unichar_t str_fa40[] = { 0x61f2, 0 };
+static const unichar_t str_fa41[] = { 0x654f, 0 };
+static const unichar_t str_fa42[] = { 0x65e2, 0 };
+static const unichar_t str_fa43[] = { 0x6691, 0 };
+static const unichar_t str_fa44[] = { 0x6885, 0 };
+static const unichar_t str_fa45[] = { 0x6d77, 0 };
+static const unichar_t str_fa46[] = { 0x6e1a, 0 };
+static const unichar_t str_fa47[] = { 0x6f22, 0 };
+static const unichar_t str_fa48[] = { 0x716e, 0 };
+static const unichar_t str_fa49[] = { 0x722b, 0 };
+static const unichar_t str_fa4a[] = { 0x7422, 0 };
+static const unichar_t str_fa4b[] = { 0x7891, 0 };
+static const unichar_t str_fa4c[] = { 0x793e, 0 };
+static const unichar_t str_fa4d[] = { 0x7949, 0 };
+static const unichar_t str_fa4e[] = { 0x7948, 0 };
+static const unichar_t str_fa4f[] = { 0x7950, 0 };
+static const unichar_t str_fa50[] = { 0x7956, 0 };
+static const unichar_t str_fa51[] = { 0x795d, 0 };
+static const unichar_t str_fa52[] = { 0x798d, 0 };
+static const unichar_t str_fa53[] = { 0x798e, 0 };
+static const unichar_t str_fa54[] = { 0x7a40, 0 };
+static const unichar_t str_fa55[] = { 0x7a81, 0 };
+static const unichar_t str_fa56[] = { 0x7bc0, 0 };
+static const unichar_t str_fa57[] = { 0x7df4, 0 };
+static const unichar_t str_fa58[] = { 0x7e09, 0 };
+static const unichar_t str_fa59[] = { 0x7e41, 0 };
+static const unichar_t str_fa5a[] = { 0x7f72, 0 };
+static const unichar_t str_fa5b[] = { 0x8005, 0 };
+static const unichar_t str_fa5c[] = { 0x81ed, 0 };
+static const unichar_t str_fa5d[] = { 0x8279, 0 };
+static const unichar_t str_fa5e[] = { 0x8279, 0 };
+static const unichar_t str_fa5f[] = { 0x8457, 0 };
+static const unichar_t str_fa60[] = { 0x8910, 0 };
+static const unichar_t str_fa61[] = { 0x8996, 0 };
+static const unichar_t str_fa62[] = { 0x8b01, 0 };
+static const unichar_t str_fa63[] = { 0x8b39, 0 };
+static const unichar_t str_fa64[] = { 0x8cd3, 0 };
+static const unichar_t str_fa65[] = { 0x8d08, 0 };
+static const unichar_t str_fa66[] = { 0x8fb6, 0 };
+static const unichar_t str_fa67[] = { 0x9038, 0 };
+static const unichar_t str_fa68[] = { 0x96e3, 0 };
+static const unichar_t str_fa69[] = { 0x97ff, 0 };
+static const unichar_t str_fa6a[] = { 0x983b, 0 };
+static const unichar_t str_fa70[] = { 0x4e26, 0 };
+static const unichar_t str_fa71[] = { 0x51b5, 0 };
+static const unichar_t str_fa72[] = { 0x5168, 0 };
+static const unichar_t str_fa73[] = { 0x4f80, 0 };
+static const unichar_t str_fa74[] = { 0x5145, 0 };
+static const unichar_t str_fa75[] = { 0x5180, 0 };
+static const unichar_t str_fa76[] = { 0x52c7, 0 };
+static const unichar_t str_fa77[] = { 0x52fa, 0 };
+static const unichar_t str_fa78[] = { 0x559d, 0 };
+static const unichar_t str_fa79[] = { 0x5555, 0 };
+static const unichar_t str_fa7a[] = { 0x5599, 0 };
+static const unichar_t str_fa7b[] = { 0x55e2, 0 };
+static const unichar_t str_fa7c[] = { 0x585a, 0 };
+static const unichar_t str_fa7d[] = { 0x58b3, 0 };
+static const unichar_t str_fa7e[] = { 0x5944, 0 };
+static const unichar_t str_fa7f[] = { 0x5954, 0 };
+static const unichar_t str_fa80[] = { 0x5a62, 0 };
+static const unichar_t str_fa81[] = { 0x5b28, 0 };
+static const unichar_t str_fa82[] = { 0x5ed2, 0 };
+static const unichar_t str_fa83[] = { 0x5ed9, 0 };
+static const unichar_t str_fa84[] = { 0x5f69, 0 };
+static const unichar_t str_fa85[] = { 0x5fad, 0 };
+static const unichar_t str_fa86[] = { 0x60d8, 0 };
+static const unichar_t str_fa87[] = { 0x614e, 0 };
+static const unichar_t str_fa88[] = { 0x6108, 0 };
+static const unichar_t str_fa89[] = { 0x618e, 0 };
+static const unichar_t str_fa8a[] = { 0x6160, 0 };
+static const unichar_t str_fa8b[] = { 0x61f2, 0 };
+static const unichar_t str_fa8c[] = { 0x6234, 0 };
+static const unichar_t str_fa8d[] = { 0x63c4, 0 };
+static const unichar_t str_fa8e[] = { 0x641c, 0 };
+static const unichar_t str_fa8f[] = { 0x6452, 0 };
+static const unichar_t str_fa90[] = { 0x6556, 0 };
+static const unichar_t str_fa91[] = { 0x6674, 0 };
+static const unichar_t str_fa92[] = { 0x6717, 0 };
+static const unichar_t str_fa93[] = { 0x671b, 0 };
+static const unichar_t str_fa94[] = { 0x6756, 0 };
+static const unichar_t str_fa95[] = { 0x6b79, 0 };
+static const unichar_t str_fa96[] = { 0x6bba, 0 };
+static const unichar_t str_fa97[] = { 0x6d41, 0 };
+static const unichar_t str_fa98[] = { 0x6edb, 0 };
+static const unichar_t str_fa99[] = { 0x6ecb, 0 };
+static const unichar_t str_fa9a[] = { 0x6f22, 0 };
+static const unichar_t str_fa9b[] = { 0x701e, 0 };
+static const unichar_t str_fa9c[] = { 0x716e, 0 };
+static const unichar_t str_fa9d[] = { 0x77a7, 0 };
+static const unichar_t str_fa9e[] = { 0x7235, 0 };
+static const unichar_t str_fa9f[] = { 0x72af, 0 };
+static const unichar_t str_faa0[] = { 0x732a, 0 };
+static const unichar_t str_faa1[] = { 0x7471, 0 };
+static const unichar_t str_faa2[] = { 0x7506, 0 };
+static const unichar_t str_faa3[] = { 0x753b, 0 };
+static const unichar_t str_faa4[] = { 0x761d, 0 };
+static const unichar_t str_faa5[] = { 0x761f, 0 };
+static const unichar_t str_faa6[] = { 0x76ca, 0 };
+static const unichar_t str_faa7[] = { 0x76db, 0 };
+static const unichar_t str_faa8[] = { 0x76f4, 0 };
+static const unichar_t str_faa9[] = { 0x774a, 0 };
+static const unichar_t str_faaa[] = { 0x7740, 0 };
+static const unichar_t str_faab[] = { 0x78cc, 0 };
+static const unichar_t str_faac[] = { 0x7ab1, 0 };
+static const unichar_t str_faad[] = { 0x7bc0, 0 };
+static const unichar_t str_faae[] = { 0x7c7b, 0 };
+static const unichar_t str_faaf[] = { 0x7d5b, 0 };
+static const unichar_t str_fab0[] = { 0x7df4, 0 };
+static const unichar_t str_fab1[] = { 0x7f3e, 0 };
+static const unichar_t str_fab2[] = { 0x8005, 0 };
+static const unichar_t str_fab3[] = { 0x8352, 0 };
+static const unichar_t str_fab4[] = { 0x83ef, 0 };
+static const unichar_t str_fab5[] = { 0x8779, 0 };
+static const unichar_t str_fab6[] = { 0x8941, 0 };
+static const unichar_t str_fab7[] = { 0x8986, 0 };
+static const unichar_t str_fab8[] = { 0x8996, 0 };
+static const unichar_t str_fab9[] = { 0x8abf, 0 };
+static const unichar_t str_faba[] = { 0x8af8, 0 };
+static const unichar_t str_fabb[] = { 0x8acb, 0 };
+static const unichar_t str_fabc[] = { 0x8b01, 0 };
+static const unichar_t str_fabd[] = { 0x8afe, 0 };
+static const unichar_t str_fabe[] = { 0x8aed, 0 };
+static const unichar_t str_fabf[] = { 0x8b39, 0 };
+static const unichar_t str_fac0[] = { 0x8b8a, 0 };
+static const unichar_t str_fac1[] = { 0x8d08, 0 };
+static const unichar_t str_fac2[] = { 0x8f38, 0 };
+static const unichar_t str_fac3[] = { 0x9072, 0 };
+static const unichar_t str_fac4[] = { 0x9199, 0 };
+static const unichar_t str_fac5[] = { 0x9276, 0 };
+static const unichar_t str_fac6[] = { 0x967c, 0 };
+static const unichar_t str_fac7[] = { 0x96e3, 0 };
+static const unichar_t str_fac8[] = { 0x9756, 0 };
+static const unichar_t str_fac9[] = { 0x97db, 0 };
+static const unichar_t str_faca[] = { 0x97ff, 0 };
+static const unichar_t str_facb[] = { 0x980b, 0 };
+static const unichar_t str_facc[] = { 0x983b, 0 };
+static const unichar_t str_facd[] = { 0x9b12, 0 };
+static const unichar_t str_face[] = { 0x9f9c, 0 };
+static const unichar_t str_facf[] = { 0x2284a, 0 };
+static const unichar_t str_fad0[] = { 0x22844, 0 };
+static const unichar_t str_fad1[] = { 0x233d5, 0 };
+static const unichar_t str_fad2[] = { 0x3b9d, 0 };
+static const unichar_t str_fad3[] = { 0x4018, 0 };
+static const unichar_t str_fad4[] = { 0x4039, 0 };
+static const unichar_t str_fad5[] = { 0x25249, 0 };
+static const unichar_t str_fad6[] = { 0x25cd0, 0 };
+static const unichar_t str_fad7[] = { 0x27ed3, 0 };
+static const unichar_t str_fad8[] = { 0x9f43, 0 };
+static const unichar_t str_fad9[] = { 0x9f8e, 0 };
+static const unichar_t str_fb00[] = { 0x0066, 0x0066, 0 };
+static const unichar_t str_fb01[] = { 0x0066, 0x0069, 0 };
+static const unichar_t str_fb02[] = { 0x0066, 0x006c, 0 };
+static const unichar_t str_fb03[] = { 0x0066, 0x0066, 0x0069, 0 };
+static const unichar_t str_fb04[] = { 0x0066, 0x0066, 0x006c, 0 };
+static const unichar_t str_fb05[] = { 0x017f, 0x0074, 0 };
+static const unichar_t str_fb06[] = { 0x0073, 0x0074, 0 };
+static const unichar_t str_fb13[] = { 0x0574, 0x0576, 0 };
+static const unichar_t str_fb14[] = { 0x0574, 0x0565, 0 };
+static const unichar_t str_fb15[] = { 0x0574, 0x056b, 0 };
+static const unichar_t str_fb16[] = { 0x057e, 0x0576, 0 };
+static const unichar_t str_fb17[] = { 0x0574, 0x056d, 0 };
+static const unichar_t str_fb1d[] = { 0x05d9, 0x05b4, 0 };
+static const unichar_t str_fb1f[] = { 0x05f2, 0x05b7, 0 };
+static const unichar_t str_fb20[] = { 0x05e2, 0 };
+static const unichar_t str_fb21[] = { 0x05d0, 0 };
+static const unichar_t str_fb22[] = { 0x05d3, 0 };
+static const unichar_t str_fb23[] = { 0x05d4, 0 };
+static const unichar_t str_fb24[] = { 0x05db, 0 };
+static const unichar_t str_fb25[] = { 0x05dc, 0 };
+static const unichar_t str_fb26[] = { 0x05dd, 0 };
+static const unichar_t str_fb27[] = { 0x05e8, 0 };
+static const unichar_t str_fb28[] = { 0x05ea, 0 };
+static const unichar_t str_fb29[] = { 0x002b, 0 };
+static const unichar_t str_fb2a[] = { 0x05e9, 0x05c1, 0 };
+static const unichar_t str_fb2b[] = { 0x05e9, 0x05c2, 0 };
+static const unichar_t str_fb2c[] = { 0xfb49, 0x05c1, 0 };
+static const unichar_t str_fb2d[] = { 0xfb49, 0x05c2, 0 };
+static const unichar_t str_fb2e[] = { 0x05d0, 0x05b7, 0 };
+static const unichar_t str_fb2f[] = { 0x05d0, 0x05b8, 0 };
+static const unichar_t str_fb30[] = { 0x05d0, 0x05bc, 0 };
+static const unichar_t str_fb31[] = { 0x05d1, 0x05bc, 0 };
+static const unichar_t str_fb32[] = { 0x05d2, 0x05bc, 0 };
+static const unichar_t str_fb33[] = { 0x05d3, 0x05bc, 0 };
+static const unichar_t str_fb34[] = { 0x05d4, 0x05bc, 0 };
+static const unichar_t str_fb35[] = { 0x05d5, 0x05bc, 0 };
+static const unichar_t str_fb36[] = { 0x05d6, 0x05bc, 0 };
+static const unichar_t str_fb38[] = { 0x05d8, 0x05bc, 0 };
+static const unichar_t str_fb39[] = { 0x05d9, 0x05bc, 0 };
+static const unichar_t str_fb3a[] = { 0x05da, 0x05bc, 0 };
+static const unichar_t str_fb3b[] = { 0x05db, 0x05bc, 0 };
+static const unichar_t str_fb3c[] = { 0x05dc, 0x05bc, 0 };
+static const unichar_t str_fb3e[] = { 0x05de, 0x05bc, 0 };
+static const unichar_t str_fb40[] = { 0x05e0, 0x05bc, 0 };
+static const unichar_t str_fb41[] = { 0x05e1, 0x05bc, 0 };
+static const unichar_t str_fb43[] = { 0x05e3, 0x05bc, 0 };
+static const unichar_t str_fb44[] = { 0x05e4, 0x05bc, 0 };
+static const unichar_t str_fb46[] = { 0x05e6, 0x05bc, 0 };
+static const unichar_t str_fb47[] = { 0x05e7, 0x05bc, 0 };
+static const unichar_t str_fb48[] = { 0x05e8, 0x05bc, 0 };
+static const unichar_t str_fb49[] = { 0x05e9, 0x05bc, 0 };
+static const unichar_t str_fb4a[] = { 0x05ea, 0x05bc, 0 };
+static const unichar_t str_fb4b[] = { 0x05d5, 0x05b9, 0 };
+static const unichar_t str_fb4c[] = { 0x05d1, 0x05bf, 0 };
+static const unichar_t str_fb4d[] = { 0x05db, 0x05bf, 0 };
+static const unichar_t str_fb4e[] = { 0x05e4, 0x05bf, 0 };
+static const unichar_t str_fb4f[] = { 0x05d0, 0x05dc, 0 };
+static const unichar_t str_fb50[] = { 0x0671, 0 };
+static const unichar_t str_fb51[] = { 0x0671, 0 };
+static const unichar_t str_fb52[] = { 0x067b, 0 };
+static const unichar_t str_fb53[] = { 0x067b, 0 };
+static const unichar_t str_fb54[] = { 0x067b, 0 };
+static const unichar_t str_fb55[] = { 0x067b, 0 };
+static const unichar_t str_fb56[] = { 0x067e, 0 };
+static const unichar_t str_fb57[] = { 0x067e, 0 };
+static const unichar_t str_fb58[] = { 0x067e, 0 };
+static const unichar_t str_fb59[] = { 0x067e, 0 };
+static const unichar_t str_fb5a[] = { 0x0680, 0 };
+static const unichar_t str_fb5b[] = { 0x0680, 0 };
+static const unichar_t str_fb5c[] = { 0x0680, 0 };
+static const unichar_t str_fb5d[] = { 0x0680, 0 };
+static const unichar_t str_fb5e[] = { 0x067a, 0 };
+static const unichar_t str_fb5f[] = { 0x067a, 0 };
+static const unichar_t str_fb60[] = { 0x067a, 0 };
+static const unichar_t str_fb61[] = { 0x067a, 0 };
+static const unichar_t str_fb62[] = { 0x067f, 0 };
+static const unichar_t str_fb63[] = { 0x067f, 0 };
+static const unichar_t str_fb64[] = { 0x067f, 0 };
+static const unichar_t str_fb65[] = { 0x067f, 0 };
+static const unichar_t str_fb66[] = { 0x0679, 0 };
+static const unichar_t str_fb67[] = { 0x0679, 0 };
+static const unichar_t str_fb68[] = { 0x0679, 0 };
+static const unichar_t str_fb69[] = { 0x0679, 0 };
+static const unichar_t str_fb6a[] = { 0x06a4, 0 };
+static const unichar_t str_fb6b[] = { 0x06a4, 0 };
+static const unichar_t str_fb6c[] = { 0x06a4, 0 };
+static const unichar_t str_fb6d[] = { 0x06a4, 0 };
+static const unichar_t str_fb6e[] = { 0x06a6, 0 };
+static const unichar_t str_fb6f[] = { 0x06a6, 0 };
+static const unichar_t str_fb70[] = { 0x06a6, 0 };
+static const unichar_t str_fb71[] = { 0x06a6, 0 };
+static const unichar_t str_fb72[] = { 0x0684, 0 };
+static const unichar_t str_fb73[] = { 0x0684, 0 };
+static const unichar_t str_fb74[] = { 0x0684, 0 };
+static const unichar_t str_fb75[] = { 0x0684, 0 };
+static const unichar_t str_fb76[] = { 0x0683, 0 };
+static const unichar_t str_fb77[] = { 0x0683, 0 };
+static const unichar_t str_fb78[] = { 0x0683, 0 };
+static const unichar_t str_fb79[] = { 0x0683, 0 };
+static const unichar_t str_fb7a[] = { 0x0686, 0 };
+static const unichar_t str_fb7b[] = { 0x0686, 0 };
+static const unichar_t str_fb7c[] = { 0x0686, 0 };
+static const unichar_t str_fb7d[] = { 0x0686, 0 };
+static const unichar_t str_fb7e[] = { 0x0687, 0 };
+static const unichar_t str_fb7f[] = { 0x0687, 0 };
+static const unichar_t str_fb80[] = { 0x0687, 0 };
+static const unichar_t str_fb81[] = { 0x0687, 0 };
+static const unichar_t str_fb82[] = { 0x068d, 0 };
+static const unichar_t str_fb83[] = { 0x068d, 0 };
+static const unichar_t str_fb84[] = { 0x068c, 0 };
+static const unichar_t str_fb85[] = { 0x068c, 0 };
+static const unichar_t str_fb86[] = { 0x068e, 0 };
+static const unichar_t str_fb87[] = { 0x068e, 0 };
+static const unichar_t str_fb88[] = { 0x0688, 0 };
+static const unichar_t str_fb89[] = { 0x0688, 0 };
+static const unichar_t str_fb8a[] = { 0x0698, 0 };
+static const unichar_t str_fb8b[] = { 0x0698, 0 };
+static const unichar_t str_fb8c[] = { 0x0691, 0 };
+static const unichar_t str_fb8d[] = { 0x0691, 0 };
+static const unichar_t str_fb8e[] = { 0x06a9, 0 };
+static const unichar_t str_fb8f[] = { 0x06a9, 0 };
+static const unichar_t str_fb90[] = { 0x06a9, 0 };
+static const unichar_t str_fb91[] = { 0x06a9, 0 };
+static const unichar_t str_fb92[] = { 0x06af, 0 };
+static const unichar_t str_fb93[] = { 0x06af, 0 };
+static const unichar_t str_fb94[] = { 0x06af, 0 };
+static const unichar_t str_fb95[] = { 0x06af, 0 };
+static const unichar_t str_fb96[] = { 0x06b3, 0 };
+static const unichar_t str_fb97[] = { 0x06b3, 0 };
+static const unichar_t str_fb98[] = { 0x06b3, 0 };
+static const unichar_t str_fb99[] = { 0x06b3, 0 };
+static const unichar_t str_fb9a[] = { 0x06b1, 0 };
+static const unichar_t str_fb9b[] = { 0x06b1, 0 };
+static const unichar_t str_fb9c[] = { 0x06b1, 0 };
+static const unichar_t str_fb9d[] = { 0x06b1, 0 };
+static const unichar_t str_fb9e[] = { 0x06ba, 0 };
+static const unichar_t str_fb9f[] = { 0x06ba, 0 };
+static const unichar_t str_fba0[] = { 0x06bb, 0 };
+static const unichar_t str_fba1[] = { 0x06bb, 0 };
+static const unichar_t str_fba2[] = { 0x06bb, 0 };
+static const unichar_t str_fba3[] = { 0x06bb, 0 };
+static const unichar_t str_fba4[] = { 0x06c0, 0 };
+static const unichar_t str_fba5[] = { 0x06c0, 0 };
+static const unichar_t str_fba6[] = { 0x06c1, 0 };
+static const unichar_t str_fba7[] = { 0x06c1, 0 };
+static const unichar_t str_fba8[] = { 0x06c1, 0 };
+static const unichar_t str_fba9[] = { 0x06c1, 0 };
+static const unichar_t str_fbaa[] = { 0x06be, 0 };
+static const unichar_t str_fbab[] = { 0x06be, 0 };
+static const unichar_t str_fbac[] = { 0x06be, 0 };
+static const unichar_t str_fbad[] = { 0x06be, 0 };
+static const unichar_t str_fbae[] = { 0x06d2, 0 };
+static const unichar_t str_fbaf[] = { 0x06d2, 0 };
+static const unichar_t str_fbb0[] = { 0x06d3, 0 };
+static const unichar_t str_fbb1[] = { 0x06d3, 0 };
+static const unichar_t str_fbd3[] = { 0x06ad, 0 };
+static const unichar_t str_fbd4[] = { 0x06ad, 0 };
+static const unichar_t str_fbd5[] = { 0x06ad, 0 };
+static const unichar_t str_fbd6[] = { 0x06ad, 0 };
+static const unichar_t str_fbd7[] = { 0x06c7, 0 };
+static const unichar_t str_fbd8[] = { 0x06c7, 0 };
+static const unichar_t str_fbd9[] = { 0x06c6, 0 };
+static const unichar_t str_fbda[] = { 0x06c6, 0 };
+static const unichar_t str_fbdb[] = { 0x06c8, 0 };
+static const unichar_t str_fbdc[] = { 0x06c8, 0 };
+static const unichar_t str_fbdd[] = { 0x0677, 0 };
+static const unichar_t str_fbde[] = { 0x06cb, 0 };
+static const unichar_t str_fbdf[] = { 0x06cb, 0 };
+static const unichar_t str_fbe0[] = { 0x06c5, 0 };
+static const unichar_t str_fbe1[] = { 0x06c5, 0 };
+static const unichar_t str_fbe2[] = { 0x06c9, 0 };
+static const unichar_t str_fbe3[] = { 0x06c9, 0 };
+static const unichar_t str_fbe4[] = { 0x06d0, 0 };
+static const unichar_t str_fbe5[] = { 0x06d0, 0 };
+static const unichar_t str_fbe6[] = { 0x06d0, 0 };
+static const unichar_t str_fbe7[] = { 0x06d0, 0 };
+static const unichar_t str_fbe8[] = { 0x0649, 0 };
+static const unichar_t str_fbe9[] = { 0x0649, 0 };
+static const unichar_t str_fbea[] = { 0x0626, 0x0627, 0 };
+static const unichar_t str_fbeb[] = { 0x0626, 0x0627, 0 };
+static const unichar_t str_fbec[] = { 0x0626, 0x06d5, 0 };
+static const unichar_t str_fbed[] = { 0x0626, 0x06d5, 0 };
+static const unichar_t str_fbee[] = { 0x0626, 0x0648, 0 };
+static const unichar_t str_fbef[] = { 0x0626, 0x0648, 0 };
+static const unichar_t str_fbf0[] = { 0x0626, 0x06c7, 0 };
+static const unichar_t str_fbf1[] = { 0x0626, 0x06c7, 0 };
+static const unichar_t str_fbf2[] = { 0x0626, 0x06c6, 0 };
+static const unichar_t str_fbf3[] = { 0x0626, 0x06c6, 0 };
+static const unichar_t str_fbf4[] = { 0x0626, 0x06c8, 0 };
+static const unichar_t str_fbf5[] = { 0x0626, 0x06c8, 0 };
+static const unichar_t str_fbf6[] = { 0x0626, 0x06d0, 0 };
+static const unichar_t str_fbf7[] = { 0x0626, 0x06d0, 0 };
+static const unichar_t str_fbf8[] = { 0x0626, 0x06d0, 0 };
+static const unichar_t str_fbf9[] = { 0x0626, 0x0649, 0 };
+static const unichar_t str_fbfa[] = { 0x0626, 0x0649, 0 };
+static const unichar_t str_fbfb[] = { 0x0626, 0x0649, 0 };
+static const unichar_t str_fbfc[] = { 0x06cc, 0 };
+static const unichar_t str_fbfd[] = { 0x06cc, 0 };
+static const unichar_t str_fbfe[] = { 0x06cc, 0 };
+static const unichar_t str_fbff[] = { 0x06cc, 0 };
+static const unichar_t str_fc00[] = { 0x0626, 0x062c, 0 };
+static const unichar_t str_fc01[] = { 0x0626, 0x062d, 0 };
+static const unichar_t str_fc02[] = { 0x0626, 0x0645, 0 };
+static const unichar_t str_fc03[] = { 0x0626, 0x0649, 0 };
+static const unichar_t str_fc04[] = { 0x0626, 0x064a, 0 };
+static const unichar_t str_fc05[] = { 0x0628, 0x062c, 0 };
+static const unichar_t str_fc06[] = { 0x0628, 0x062d, 0 };
+static const unichar_t str_fc07[] = { 0x0628, 0x062e, 0 };
+static const unichar_t str_fc08[] = { 0x0628, 0x0645, 0 };
+static const unichar_t str_fc09[] = { 0x0628, 0x0649, 0 };
+static const unichar_t str_fc0a[] = { 0x0628, 0x064a, 0 };
+static const unichar_t str_fc0b[] = { 0x062a, 0x062c, 0 };
+static const unichar_t str_fc0c[] = { 0x062a, 0x062d, 0 };
+static const unichar_t str_fc0d[] = { 0x062a, 0x062e, 0 };
+static const unichar_t str_fc0e[] = { 0x062a, 0x0645, 0 };
+static const unichar_t str_fc0f[] = { 0x062a, 0x0649, 0 };
+static const unichar_t str_fc10[] = { 0x062a, 0x064a, 0 };
+static const unichar_t str_fc11[] = { 0x062b, 0x062c, 0 };
+static const unichar_t str_fc12[] = { 0x062b, 0x0645, 0 };
+static const unichar_t str_fc13[] = { 0x062b, 0x0649, 0 };
+static const unichar_t str_fc14[] = { 0x062b, 0x064a, 0 };
+static const unichar_t str_fc15[] = { 0x062c, 0x062d, 0 };
+static const unichar_t str_fc16[] = { 0x062c, 0x0645, 0 };
+static const unichar_t str_fc17[] = { 0x062d, 0x062c, 0 };
+static const unichar_t str_fc18[] = { 0x062d, 0x0645, 0 };
+static const unichar_t str_fc19[] = { 0x062e, 0x062c, 0 };
+static const unichar_t str_fc1a[] = { 0x062e, 0x062d, 0 };
+static const unichar_t str_fc1b[] = { 0x062e, 0x0645, 0 };
+static const unichar_t str_fc1c[] = { 0x0633, 0x062c, 0 };
+static const unichar_t str_fc1d[] = { 0x0633, 0x062d, 0 };
+static const unichar_t str_fc1e[] = { 0x0633, 0x062e, 0 };
+static const unichar_t str_fc1f[] = { 0x0633, 0x0645, 0 };
+static const unichar_t str_fc20[] = { 0x0635, 0x062d, 0 };
+static const unichar_t str_fc21[] = { 0x0635, 0x0645, 0 };
+static const unichar_t str_fc22[] = { 0x0636, 0x062c, 0 };
+static const unichar_t str_fc23[] = { 0x0636, 0x062d, 0 };
+static const unichar_t str_fc24[] = { 0x0636, 0x062e, 0 };
+static const unichar_t str_fc25[] = { 0x0636, 0x0645, 0 };
+static const unichar_t str_fc26[] = { 0x0637, 0x062d, 0 };
+static const unichar_t str_fc27[] = { 0x0637, 0x0645, 0 };
+static const unichar_t str_fc28[] = { 0x0638, 0x0645, 0 };
+static const unichar_t str_fc29[] = { 0x0639, 0x062c, 0 };
+static const unichar_t str_fc2a[] = { 0x0639, 0x0645, 0 };
+static const unichar_t str_fc2b[] = { 0x063a, 0x062c, 0 };
+static const unichar_t str_fc2c[] = { 0x063a, 0x0645, 0 };
+static const unichar_t str_fc2d[] = { 0x0641, 0x062c, 0 };
+static const unichar_t str_fc2e[] = { 0x0641, 0x062d, 0 };
+static const unichar_t str_fc2f[] = { 0x0641, 0x062e, 0 };
+static const unichar_t str_fc30[] = { 0x0641, 0x0645, 0 };
+static const unichar_t str_fc31[] = { 0x0641, 0x0649, 0 };
+static const unichar_t str_fc32[] = { 0x0641, 0x064a, 0 };
+static const unichar_t str_fc33[] = { 0x0642, 0x062d, 0 };
+static const unichar_t str_fc34[] = { 0x0642, 0x0645, 0 };
+static const unichar_t str_fc35[] = { 0x0642, 0x0649, 0 };
+static const unichar_t str_fc36[] = { 0x0642, 0x064a, 0 };
+static const unichar_t str_fc37[] = { 0x0643, 0x0627, 0 };
+static const unichar_t str_fc38[] = { 0x0643, 0x062c, 0 };
+static const unichar_t str_fc39[] = { 0x0643, 0x062d, 0 };
+static const unichar_t str_fc3a[] = { 0x0643, 0x062e, 0 };
+static const unichar_t str_fc3b[] = { 0x0643, 0x0644, 0 };
+static const unichar_t str_fc3c[] = { 0x0643, 0x0645, 0 };
+static const unichar_t str_fc3d[] = { 0x0643, 0x0649, 0 };
+static const unichar_t str_fc3e[] = { 0x0643, 0x064a, 0 };
+static const unichar_t str_fc3f[] = { 0x0644, 0x062c, 0 };
+static const unichar_t str_fc40[] = { 0x0644, 0x062d, 0 };
+static const unichar_t str_fc41[] = { 0x0644, 0x062e, 0 };
+static const unichar_t str_fc42[] = { 0x0644, 0x0645, 0 };
+static const unichar_t str_fc43[] = { 0x0644, 0x0649, 0 };
+static const unichar_t str_fc44[] = { 0x0644, 0x064a, 0 };
+static const unichar_t str_fc45[] = { 0x0645, 0x062c, 0 };
+static const unichar_t str_fc46[] = { 0x0645, 0x062d, 0 };
+static const unichar_t str_fc47[] = { 0x0645, 0x062e, 0 };
+static const unichar_t str_fc48[] = { 0x0645, 0x0645, 0 };
+static const unichar_t str_fc49[] = { 0x0645, 0x0649, 0 };
+static const unichar_t str_fc4a[] = { 0x0645, 0x064a, 0 };
+static const unichar_t str_fc4b[] = { 0x0646, 0x062c, 0 };
+static const unichar_t str_fc4c[] = { 0x0646, 0x062d, 0 };
+static const unichar_t str_fc4d[] = { 0x0646, 0x062e, 0 };
+static const unichar_t str_fc4e[] = { 0x0646, 0x0645, 0 };
+static const unichar_t str_fc4f[] = { 0x0646, 0x0649, 0 };
+static const unichar_t str_fc50[] = { 0x0646, 0x064a, 0 };
+static const unichar_t str_fc51[] = { 0x0647, 0x062c, 0 };
+static const unichar_t str_fc52[] = { 0x0647, 0x0645, 0 };
+static const unichar_t str_fc53[] = { 0x0647, 0x0649, 0 };
+static const unichar_t str_fc54[] = { 0x0647, 0x064a, 0 };
+static const unichar_t str_fc55[] = { 0x064a, 0x062c, 0 };
+static const unichar_t str_fc56[] = { 0x064a, 0x062d, 0 };
+static const unichar_t str_fc57[] = { 0x064a, 0x062e, 0 };
+static const unichar_t str_fc58[] = { 0x064a, 0x0645, 0 };
+static const unichar_t str_fc59[] = { 0x064a, 0x0649, 0 };
+static const unichar_t str_fc5a[] = { 0x064a, 0x064a, 0 };
+static const unichar_t str_fc5b[] = { 0x0630, 0x0670, 0 };
+static const unichar_t str_fc5c[] = { 0x0631, 0x0670, 0 };
+static const unichar_t str_fc5d[] = { 0x0649, 0x0670, 0 };
+static const unichar_t str_fc5e[] = { 0x0020, 0x064c, 0x0651, 0 };
+static const unichar_t str_fc5f[] = { 0x0020, 0x064d, 0x0651, 0 };
+static const unichar_t str_fc60[] = { 0x0020, 0x064e, 0x0651, 0 };
+static const unichar_t str_fc61[] = { 0x0020, 0x064f, 0x0651, 0 };
+static const unichar_t str_fc62[] = { 0x0020, 0x0650, 0x0651, 0 };
+static const unichar_t str_fc63[] = { 0x0020, 0x0651, 0x0670, 0 };
+static const unichar_t str_fc64[] = { 0x0626, 0x0631, 0 };
+static const unichar_t str_fc65[] = { 0x0626, 0x0632, 0 };
+static const unichar_t str_fc66[] = { 0x0626, 0x0645, 0 };
+static const unichar_t str_fc67[] = { 0x0626, 0x0646, 0 };
+static const unichar_t str_fc68[] = { 0x0626, 0x0649, 0 };
+static const unichar_t str_fc69[] = { 0x0626, 0x064a, 0 };
+static const unichar_t str_fc6a[] = { 0x0628, 0x0631, 0 };
+static const unichar_t str_fc6b[] = { 0x0628, 0x0632, 0 };
+static const unichar_t str_fc6c[] = { 0x0628, 0x0645, 0 };
+static const unichar_t str_fc6d[] = { 0x0628, 0x0646, 0 };
+static const unichar_t str_fc6e[] = { 0x0628, 0x0649, 0 };
+static const unichar_t str_fc6f[] = { 0x0628, 0x064a, 0 };
+static const unichar_t str_fc70[] = { 0x062a, 0x0631, 0 };
+static const unichar_t str_fc71[] = { 0x062a, 0x0632, 0 };
+static const unichar_t str_fc72[] = { 0x062a, 0x0645, 0 };
+static const unichar_t str_fc73[] = { 0x062a, 0x0646, 0 };
+static const unichar_t str_fc74[] = { 0x062a, 0x0649, 0 };
+static const unichar_t str_fc75[] = { 0x062a, 0x064a, 0 };
+static const unichar_t str_fc76[] = { 0x062b, 0x0631, 0 };
+static const unichar_t str_fc77[] = { 0x062b, 0x0632, 0 };
+static const unichar_t str_fc78[] = { 0x062b, 0x0645, 0 };
+static const unichar_t str_fc79[] = { 0x062b, 0x0646, 0 };
+static const unichar_t str_fc7a[] = { 0x062b, 0x0649, 0 };
+static const unichar_t str_fc7b[] = { 0x062b, 0x064a, 0 };
+static const unichar_t str_fc7c[] = { 0x0641, 0x0649, 0 };
+static const unichar_t str_fc7d[] = { 0x0641, 0x064a, 0 };
+static const unichar_t str_fc7e[] = { 0x0642, 0x0649, 0 };
+static const unichar_t str_fc7f[] = { 0x0642, 0x064a, 0 };
+static const unichar_t str_fc80[] = { 0x0643, 0x0627, 0 };
+static const unichar_t str_fc81[] = { 0x0643, 0x0644, 0 };
+static const unichar_t str_fc82[] = { 0x0643, 0x0645, 0 };
+static const unichar_t str_fc83[] = { 0x0643, 0x0649, 0 };
+static const unichar_t str_fc84[] = { 0x0643, 0x064a, 0 };
+static const unichar_t str_fc85[] = { 0x0644, 0x0645, 0 };
+static const unichar_t str_fc86[] = { 0x0644, 0x0649, 0 };
+static const unichar_t str_fc87[] = { 0x0644, 0x064a, 0 };
+static const unichar_t str_fc88[] = { 0x0645, 0x0627, 0 };
+static const unichar_t str_fc89[] = { 0x0645, 0x0645, 0 };
+static const unichar_t str_fc8a[] = { 0x0646, 0x0631, 0 };
+static const unichar_t str_fc8b[] = { 0x0646, 0x0632, 0 };
+static const unichar_t str_fc8c[] = { 0x0646, 0x0645, 0 };
+static const unichar_t str_fc8d[] = { 0x0646, 0x0646, 0 };
+static const unichar_t str_fc8e[] = { 0x0646, 0x0649, 0 };
+static const unichar_t str_fc8f[] = { 0x0646, 0x064a, 0 };
+static const unichar_t str_fc90[] = { 0x0649, 0x0670, 0 };
+static const unichar_t str_fc91[] = { 0x064a, 0x0631, 0 };
+static const unichar_t str_fc92[] = { 0x064a, 0x0632, 0 };
+static const unichar_t str_fc93[] = { 0x064a, 0x0645, 0 };
+static const unichar_t str_fc94[] = { 0x064a, 0x0646, 0 };
+static const unichar_t str_fc95[] = { 0x064a, 0x0649, 0 };
+static const unichar_t str_fc96[] = { 0x064a, 0x064a, 0 };
+static const unichar_t str_fc97[] = { 0x0626, 0x062c, 0 };
+static const unichar_t str_fc98[] = { 0x0626, 0x062d, 0 };
+static const unichar_t str_fc99[] = { 0x0626, 0x062e, 0 };
+static const unichar_t str_fc9a[] = { 0x0626, 0x0645, 0 };
+static const unichar_t str_fc9b[] = { 0x0626, 0x0647, 0 };
+static const unichar_t str_fc9c[] = { 0x0628, 0x062c, 0 };
+static const unichar_t str_fc9d[] = { 0x0628, 0x062d, 0 };
+static const unichar_t str_fc9e[] = { 0x0628, 0x062e, 0 };
+static const unichar_t str_fc9f[] = { 0x0628, 0x0645, 0 };
+static const unichar_t str_fca0[] = { 0x0628, 0x0647, 0 };
+static const unichar_t str_fca1[] = { 0x062a, 0x062c, 0 };
+static const unichar_t str_fca2[] = { 0x062a, 0x062d, 0 };
+static const unichar_t str_fca3[] = { 0x062a, 0x062e, 0 };
+static const unichar_t str_fca4[] = { 0x062a, 0x0645, 0 };
+static const unichar_t str_fca5[] = { 0x062a, 0x0647, 0 };
+static const unichar_t str_fca6[] = { 0x062b, 0x0645, 0 };
+static const unichar_t str_fca7[] = { 0x062c, 0x062d, 0 };
+static const unichar_t str_fca8[] = { 0x062c, 0x0645, 0 };
+static const unichar_t str_fca9[] = { 0x062d, 0x062c, 0 };
+static const unichar_t str_fcaa[] = { 0x062d, 0x0645, 0 };
+static const unichar_t str_fcab[] = { 0x062e, 0x062c, 0 };
+static const unichar_t str_fcac[] = { 0x062e, 0x0645, 0 };
+static const unichar_t str_fcad[] = { 0x0633, 0x062c, 0 };
+static const unichar_t str_fcae[] = { 0x0633, 0x062d, 0 };
+static const unichar_t str_fcaf[] = { 0x0633, 0x062e, 0 };
+static const unichar_t str_fcb0[] = { 0x0633, 0x0645, 0 };
+static const unichar_t str_fcb1[] = { 0x0635, 0x062d, 0 };
+static const unichar_t str_fcb2[] = { 0x0635, 0x062e, 0 };
+static const unichar_t str_fcb3[] = { 0x0635, 0x0645, 0 };
+static const unichar_t str_fcb4[] = { 0x0636, 0x062c, 0 };
+static const unichar_t str_fcb5[] = { 0x0636, 0x062d, 0 };
+static const unichar_t str_fcb6[] = { 0x0636, 0x062e, 0 };
+static const unichar_t str_fcb7[] = { 0x0636, 0x0645, 0 };
+static const unichar_t str_fcb8[] = { 0x0637, 0x062d, 0 };
+static const unichar_t str_fcb9[] = { 0x0638, 0x0645, 0 };
+static const unichar_t str_fcba[] = { 0x0639, 0x062c, 0 };
+static const unichar_t str_fcbb[] = { 0x0639, 0x0645, 0 };
+static const unichar_t str_fcbc[] = { 0x063a, 0x062c, 0 };
+static const unichar_t str_fcbd[] = { 0x063a, 0x0645, 0 };
+static const unichar_t str_fcbe[] = { 0x0641, 0x062c, 0 };
+static const unichar_t str_fcbf[] = { 0x0641, 0x062d, 0 };
+static const unichar_t str_fcc0[] = { 0x0641, 0x062e, 0 };
+static const unichar_t str_fcc1[] = { 0x0641, 0x0645, 0 };
+static const unichar_t str_fcc2[] = { 0x0642, 0x062d, 0 };
+static const unichar_t str_fcc3[] = { 0x0642, 0x0645, 0 };
+static const unichar_t str_fcc4[] = { 0x0643, 0x062c, 0 };
+static const unichar_t str_fcc5[] = { 0x0643, 0x062d, 0 };
+static const unichar_t str_fcc6[] = { 0x0643, 0x062e, 0 };
+static const unichar_t str_fcc7[] = { 0x0643, 0x0644, 0 };
+static const unichar_t str_fcc8[] = { 0x0643, 0x0645, 0 };
+static const unichar_t str_fcc9[] = { 0x0644, 0x062c, 0 };
+static const unichar_t str_fcca[] = { 0x0644, 0x062d, 0 };
+static const unichar_t str_fccb[] = { 0x0644, 0x062e, 0 };
+static const unichar_t str_fccc[] = { 0x0644, 0x0645, 0 };
+static const unichar_t str_fccd[] = { 0x0644, 0x0647, 0 };
+static const unichar_t str_fcce[] = { 0x0645, 0x062c, 0 };
+static const unichar_t str_fccf[] = { 0x0645, 0x062d, 0 };
+static const unichar_t str_fcd0[] = { 0x0645, 0x062e, 0 };
+static const unichar_t str_fcd1[] = { 0x0645, 0x0645, 0 };
+static const unichar_t str_fcd2[] = { 0x0646, 0x062c, 0 };
+static const unichar_t str_fcd3[] = { 0x0646, 0x062d, 0 };
+static const unichar_t str_fcd4[] = { 0x0646, 0x062e, 0 };
+static const unichar_t str_fcd5[] = { 0x0646, 0x0645, 0 };
+static const unichar_t str_fcd6[] = { 0x0646, 0x0647, 0 };
+static const unichar_t str_fcd7[] = { 0x0647, 0x062c, 0 };
+static const unichar_t str_fcd8[] = { 0x0647, 0x0645, 0 };
+static const unichar_t str_fcd9[] = { 0x0647, 0x0670, 0 };
+static const unichar_t str_fcda[] = { 0x064a, 0x062c, 0 };
+static const unichar_t str_fcdb[] = { 0x064a, 0x062d, 0 };
+static const unichar_t str_fcdc[] = { 0x064a, 0x062e, 0 };
+static const unichar_t str_fcdd[] = { 0x064a, 0x0645, 0 };
+static const unichar_t str_fcde[] = { 0x064a, 0x0647, 0 };
+static const unichar_t str_fcdf[] = { 0x0626, 0x0645, 0 };
+static const unichar_t str_fce0[] = { 0x0626, 0x0647, 0 };
+static const unichar_t str_fce1[] = { 0x0628, 0x0645, 0 };
+static const unichar_t str_fce2[] = { 0x0628, 0x0647, 0 };
+static const unichar_t str_fce3[] = { 0x062a, 0x0645, 0 };
+static const unichar_t str_fce4[] = { 0x062a, 0x0647, 0 };
+static const unichar_t str_fce5[] = { 0x062b, 0x0645, 0 };
+static const unichar_t str_fce6[] = { 0x062b, 0x0647, 0 };
+static const unichar_t str_fce7[] = { 0x0633, 0x0645, 0 };
+static const unichar_t str_fce8[] = { 0x0633, 0x0647, 0 };
+static const unichar_t str_fce9[] = { 0x0634, 0x0645, 0 };
+static const unichar_t str_fcea[] = { 0x0634, 0x0647, 0 };
+static const unichar_t str_fceb[] = { 0x0643, 0x0644, 0 };
+static const unichar_t str_fcec[] = { 0x0643, 0x0645, 0 };
+static const unichar_t str_fced[] = { 0x0644, 0x0645, 0 };
+static const unichar_t str_fcee[] = { 0x0646, 0x0645, 0 };
+static const unichar_t str_fcef[] = { 0x0646, 0x0647, 0 };
+static const unichar_t str_fcf0[] = { 0x064a, 0x0645, 0 };
+static const unichar_t str_fcf1[] = { 0x064a, 0x0647, 0 };
+static const unichar_t str_fcf2[] = { 0x0640, 0x064e, 0x0651, 0 };
+static const unichar_t str_fcf3[] = { 0x0640, 0x064f, 0x0651, 0 };
+static const unichar_t str_fcf4[] = { 0x0640, 0x0650, 0x0651, 0 };
+static const unichar_t str_fcf5[] = { 0x0637, 0x0649, 0 };
+static const unichar_t str_fcf6[] = { 0x0637, 0x064a, 0 };
+static const unichar_t str_fcf7[] = { 0x0639, 0x0649, 0 };
+static const unichar_t str_fcf8[] = { 0x0639, 0x064a, 0 };
+static const unichar_t str_fcf9[] = { 0x063a, 0x0649, 0 };
+static const unichar_t str_fcfa[] = { 0x063a, 0x064a, 0 };
+static const unichar_t str_fcfb[] = { 0x0633, 0x0649, 0 };
+static const unichar_t str_fcfc[] = { 0x0633, 0x064a, 0 };
+static const unichar_t str_fcfd[] = { 0x0634, 0x0649, 0 };
+static const unichar_t str_fcfe[] = { 0x0634, 0x064a, 0 };
+static const unichar_t str_fcff[] = { 0x062d, 0x0649, 0 };
+static const unichar_t str_fd00[] = { 0x062d, 0x064a, 0 };
+static const unichar_t str_fd01[] = { 0x062c, 0x0649, 0 };
+static const unichar_t str_fd02[] = { 0x062c, 0x064a, 0 };
+static const unichar_t str_fd03[] = { 0x062e, 0x0649, 0 };
+static const unichar_t str_fd04[] = { 0x062e, 0x064a, 0 };
+static const unichar_t str_fd05[] = { 0x0635, 0x0649, 0 };
+static const unichar_t str_fd06[] = { 0x0635, 0x064a, 0 };
+static const unichar_t str_fd07[] = { 0x0636, 0x0649, 0 };
+static const unichar_t str_fd08[] = { 0x0636, 0x064a, 0 };
+static const unichar_t str_fd09[] = { 0x0634, 0x062c, 0 };
+static const unichar_t str_fd0a[] = { 0x0634, 0x062d, 0 };
+static const unichar_t str_fd0b[] = { 0x0634, 0x062e, 0 };
+static const unichar_t str_fd0c[] = { 0x0634, 0x0645, 0 };
+static const unichar_t str_fd0d[] = { 0x0634, 0x0631, 0 };
+static const unichar_t str_fd0e[] = { 0x0633, 0x0631, 0 };
+static const unichar_t str_fd0f[] = { 0x0635, 0x0631, 0 };
+static const unichar_t str_fd10[] = { 0x0636, 0x0631, 0 };
+static const unichar_t str_fd11[] = { 0x0637, 0x0649, 0 };
+static const unichar_t str_fd12[] = { 0x0637, 0x064a, 0 };
+static const unichar_t str_fd13[] = { 0x0639, 0x0649, 0 };
+static const unichar_t str_fd14[] = { 0x0639, 0x064a, 0 };
+static const unichar_t str_fd15[] = { 0x063a, 0x0649, 0 };
+static const unichar_t str_fd16[] = { 0x063a, 0x064a, 0 };
+static const unichar_t str_fd17[] = { 0x0633, 0x0649, 0 };
+static const unichar_t str_fd18[] = { 0x0633, 0x064a, 0 };
+static const unichar_t str_fd19[] = { 0x0634, 0x0649, 0 };
+static const unichar_t str_fd1a[] = { 0x0634, 0x064a, 0 };
+static const unichar_t str_fd1b[] = { 0x062d, 0x0649, 0 };
+static const unichar_t str_fd1c[] = { 0x062d, 0x064a, 0 };
+static const unichar_t str_fd1d[] = { 0x062c, 0x0649, 0 };
+static const unichar_t str_fd1e[] = { 0x062c, 0x064a, 0 };
+static const unichar_t str_fd1f[] = { 0x062e, 0x0649, 0 };
+static const unichar_t str_fd20[] = { 0x062e, 0x064a, 0 };
+static const unichar_t str_fd21[] = { 0x0635, 0x0649, 0 };
+static const unichar_t str_fd22[] = { 0x0635, 0x064a, 0 };
+static const unichar_t str_fd23[] = { 0x0636, 0x0649, 0 };
+static const unichar_t str_fd24[] = { 0x0636, 0x064a, 0 };
+static const unichar_t str_fd25[] = { 0x0634, 0x062c, 0 };
+static const unichar_t str_fd26[] = { 0x0634, 0x062d, 0 };
+static const unichar_t str_fd27[] = { 0x0634, 0x062e, 0 };
+static const unichar_t str_fd28[] = { 0x0634, 0x0645, 0 };
+static const unichar_t str_fd29[] = { 0x0634, 0x0631, 0 };
+static const unichar_t str_fd2a[] = { 0x0633, 0x0631, 0 };
+static const unichar_t str_fd2b[] = { 0x0635, 0x0631, 0 };
+static const unichar_t str_fd2c[] = { 0x0636, 0x0631, 0 };
+static const unichar_t str_fd2d[] = { 0x0634, 0x062c, 0 };
+static const unichar_t str_fd2e[] = { 0x0634, 0x062d, 0 };
+static const unichar_t str_fd2f[] = { 0x0634, 0x062e, 0 };
+static const unichar_t str_fd30[] = { 0x0634, 0x0645, 0 };
+static const unichar_t str_fd31[] = { 0x0633, 0x0647, 0 };
+static const unichar_t str_fd32[] = { 0x0634, 0x0647, 0 };
+static const unichar_t str_fd33[] = { 0x0637, 0x0645, 0 };
+static const unichar_t str_fd34[] = { 0x0633, 0x062c, 0 };
+static const unichar_t str_fd35[] = { 0x0633, 0x062d, 0 };
+static const unichar_t str_fd36[] = { 0x0633, 0x062e, 0 };
+static const unichar_t str_fd37[] = { 0x0634, 0x062c, 0 };
+static const unichar_t str_fd38[] = { 0x0634, 0x062d, 0 };
+static const unichar_t str_fd39[] = { 0x0634, 0x062e, 0 };
+static const unichar_t str_fd3a[] = { 0x0637, 0x0645, 0 };
+static const unichar_t str_fd3b[] = { 0x0638, 0x0645, 0 };
+static const unichar_t str_fd3c[] = { 0x0627, 0x064b, 0 };
+static const unichar_t str_fd3d[] = { 0x0627, 0x064b, 0 };
+static const unichar_t str_fd50[] = { 0x062a, 0x062c, 0x0645, 0 };
+static const unichar_t str_fd51[] = { 0x062a, 0x062d, 0x062c, 0 };
+static const unichar_t str_fd52[] = { 0x062a, 0x062d, 0x062c, 0 };
+static const unichar_t str_fd53[] = { 0x062a, 0x062d, 0x0645, 0 };
+static const unichar_t str_fd54[] = { 0x062a, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd55[] = { 0x062a, 0x0645, 0x062c, 0 };
+static const unichar_t str_fd56[] = { 0x062a, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd57[] = { 0x062a, 0x0645, 0x062e, 0 };
+static const unichar_t str_fd58[] = { 0x062c, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd59[] = { 0x062c, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd5a[] = { 0x062d, 0x0645, 0x064a, 0 };
+static const unichar_t str_fd5b[] = { 0x062d, 0x0645, 0x0649, 0 };
+static const unichar_t str_fd5c[] = { 0x0633, 0x062d, 0x062c, 0 };
+static const unichar_t str_fd5d[] = { 0x0633, 0x062c, 0x062d, 0 };
+static const unichar_t str_fd5e[] = { 0x0633, 0x062c, 0x0649, 0 };
+static const unichar_t str_fd5f[] = { 0x0633, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd60[] = { 0x0633, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd61[] = { 0x0633, 0x0645, 0x062c, 0 };
+static const unichar_t str_fd62[] = { 0x0633, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd63[] = { 0x0633, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd64[] = { 0x0635, 0x062d, 0x062d, 0 };
+static const unichar_t str_fd65[] = { 0x0635, 0x062d, 0x062d, 0 };
+static const unichar_t str_fd66[] = { 0x0635, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd67[] = { 0x0634, 0x062d, 0x0645, 0 };
+static const unichar_t str_fd68[] = { 0x0634, 0x062d, 0x0645, 0 };
+static const unichar_t str_fd69[] = { 0x0634, 0x062c, 0x064a, 0 };
+static const unichar_t str_fd6a[] = { 0x0634, 0x0645, 0x062e, 0 };
+static const unichar_t str_fd6b[] = { 0x0634, 0x0645, 0x062e, 0 };
+static const unichar_t str_fd6c[] = { 0x0634, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd6d[] = { 0x0634, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd6e[] = { 0x0636, 0x062d, 0x0649, 0 };
+static const unichar_t str_fd6f[] = { 0x0636, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd70[] = { 0x0636, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd71[] = { 0x0637, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd72[] = { 0x0637, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd73[] = { 0x0637, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd74[] = { 0x0637, 0x0645, 0x064a, 0 };
+static const unichar_t str_fd75[] = { 0x0639, 0x062c, 0x0645, 0 };
+static const unichar_t str_fd76[] = { 0x0639, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd77[] = { 0x0639, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd78[] = { 0x0639, 0x0645, 0x0649, 0 };
+static const unichar_t str_fd79[] = { 0x063a, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd7a[] = { 0x063a, 0x0645, 0x064a, 0 };
+static const unichar_t str_fd7b[] = { 0x063a, 0x0645, 0x0649, 0 };
+static const unichar_t str_fd7c[] = { 0x0641, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd7d[] = { 0x0641, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd7e[] = { 0x0642, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd7f[] = { 0x0642, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd80[] = { 0x0644, 0x062d, 0x0645, 0 };
+static const unichar_t str_fd81[] = { 0x0644, 0x062d, 0x064a, 0 };
+static const unichar_t str_fd82[] = { 0x0644, 0x062d, 0x0649, 0 };
+static const unichar_t str_fd83[] = { 0x0644, 0x062c, 0x062c, 0 };
+static const unichar_t str_fd84[] = { 0x0644, 0x062c, 0x062c, 0 };
+static const unichar_t str_fd85[] = { 0x0644, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd86[] = { 0x0644, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd87[] = { 0x0644, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd88[] = { 0x0644, 0x0645, 0x062d, 0 };
+static const unichar_t str_fd89[] = { 0x0645, 0x062d, 0x062c, 0 };
+static const unichar_t str_fd8a[] = { 0x0645, 0x062d, 0x0645, 0 };
+static const unichar_t str_fd8b[] = { 0x0645, 0x062d, 0x064a, 0 };
+static const unichar_t str_fd8c[] = { 0x0645, 0x062c, 0x062d, 0 };
+static const unichar_t str_fd8d[] = { 0x0645, 0x062c, 0x0645, 0 };
+static const unichar_t str_fd8e[] = { 0x0645, 0x062e, 0x062c, 0 };
+static const unichar_t str_fd8f[] = { 0x0645, 0x062e, 0x0645, 0 };
+static const unichar_t str_fd92[] = { 0x0645, 0x062c, 0x062e, 0 };
+static const unichar_t str_fd93[] = { 0x0647, 0x0645, 0x062c, 0 };
+static const unichar_t str_fd94[] = { 0x0647, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd95[] = { 0x0646, 0x062d, 0x0645, 0 };
+static const unichar_t str_fd96[] = { 0x0646, 0x062d, 0x0649, 0 };
+static const unichar_t str_fd97[] = { 0x0646, 0x062c, 0x0645, 0 };
+static const unichar_t str_fd98[] = { 0x0646, 0x062c, 0x0645, 0 };
+static const unichar_t str_fd99[] = { 0x0646, 0x062c, 0x0649, 0 };
+static const unichar_t str_fd9a[] = { 0x0646, 0x0645, 0x064a, 0 };
+static const unichar_t str_fd9b[] = { 0x0646, 0x0645, 0x0649, 0 };
+static const unichar_t str_fd9c[] = { 0x064a, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd9d[] = { 0x064a, 0x0645, 0x0645, 0 };
+static const unichar_t str_fd9e[] = { 0x0628, 0x062e, 0x064a, 0 };
+static const unichar_t str_fd9f[] = { 0x062a, 0x062c, 0x064a, 0 };
+static const unichar_t str_fda0[] = { 0x062a, 0x062c, 0x0649, 0 };
+static const unichar_t str_fda1[] = { 0x062a, 0x062e, 0x064a, 0 };
+static const unichar_t str_fda2[] = { 0x062a, 0x062e, 0x0649, 0 };
+static const unichar_t str_fda3[] = { 0x062a, 0x0645, 0x064a, 0 };
+static const unichar_t str_fda4[] = { 0x062a, 0x0645, 0x0649, 0 };
+static const unichar_t str_fda5[] = { 0x062c, 0x0645, 0x064a, 0 };
+static const unichar_t str_fda6[] = { 0x062c, 0x062d, 0x0649, 0 };
+static const unichar_t str_fda7[] = { 0x062c, 0x0645, 0x0649, 0 };
+static const unichar_t str_fda8[] = { 0x0633, 0x062e, 0x0649, 0 };
+static const unichar_t str_fda9[] = { 0x0635, 0x062d, 0x064a, 0 };
+static const unichar_t str_fdaa[] = { 0x0634, 0x062d, 0x064a, 0 };
+static const unichar_t str_fdab[] = { 0x0636, 0x062d, 0x064a, 0 };
+static const unichar_t str_fdac[] = { 0x0644, 0x062c, 0x064a, 0 };
+static const unichar_t str_fdad[] = { 0x0644, 0x0645, 0x064a, 0 };
+static const unichar_t str_fdae[] = { 0x064a, 0x062d, 0x064a, 0 };
+static const unichar_t str_fdaf[] = { 0x064a, 0x062c, 0x064a, 0 };
+static const unichar_t str_fdb0[] = { 0x064a, 0x0645, 0x064a, 0 };
+static const unichar_t str_fdb1[] = { 0x0645, 0x0645, 0x064a, 0 };
+static const unichar_t str_fdb2[] = { 0x0642, 0x0645, 0x064a, 0 };
+static const unichar_t str_fdb3[] = { 0x0646, 0x062d, 0x064a, 0 };
+static const unichar_t str_fdb4[] = { 0x0642, 0x0645, 0x062d, 0 };
+static const unichar_t str_fdb5[] = { 0x0644, 0x062d, 0x0645, 0 };
+static const unichar_t str_fdb6[] = { 0x0639, 0x0645, 0x064a, 0 };
+static const unichar_t str_fdb7[] = { 0x0643, 0x0645, 0x064a, 0 };
+static const unichar_t str_fdb8[] = { 0x0646, 0x062c, 0x062d, 0 };
+static const unichar_t str_fdb9[] = { 0x0645, 0x062e, 0x064a, 0 };
+static const unichar_t str_fdba[] = { 0x0644, 0x062c, 0x0645, 0 };
+static const unichar_t str_fdbb[] = { 0x0643, 0x0645, 0x0645, 0 };
+static const unichar_t str_fdbc[] = { 0x0644, 0x062c, 0x0645, 0 };
+static const unichar_t str_fdbd[] = { 0x0646, 0x062c, 0x062d, 0 };
+static const unichar_t str_fdbe[] = { 0x062c, 0x062d, 0x064a, 0 };
+static const unichar_t str_fdbf[] = { 0x062d, 0x062c, 0x064a, 0 };
+static const unichar_t str_fdc0[] = { 0x0645, 0x062c, 0x064a, 0 };
+static const unichar_t str_fdc1[] = { 0x0641, 0x0645, 0x064a, 0 };
+static const unichar_t str_fdc2[] = { 0x0628, 0x062d, 0x064a, 0 };
+static const unichar_t str_fdc3[] = { 0x0643, 0x0645, 0x0645, 0 };
+static const unichar_t str_fdc4[] = { 0x0639, 0x062c, 0x0645, 0 };
+static const unichar_t str_fdc5[] = { 0x0635, 0x0645, 0x0645, 0 };
+static const unichar_t str_fdc6[] = { 0x0633, 0x062e, 0x064a, 0 };
+static const unichar_t str_fdc7[] = { 0x0646, 0x062c, 0x064a, 0 };
+static const unichar_t str_fdf0[] = { 0x0635, 0x0644, 0x06d2, 0 };
+static const unichar_t str_fdf1[] = { 0x0642, 0x0644, 0x06d2, 0 };
+static const unichar_t str_fdf2[] = { 0x0627, 0x0644, 0x0644, 0x0647, 0 };
+static const unichar_t str_fdf3[] = { 0x0627, 0x0643, 0x0628, 0x0631, 0 };
+static const unichar_t str_fdf4[] = { 0x0645, 0x062d, 0x0645, 0x062f, 0 };
+static const unichar_t str_fdf5[] = { 0x0635, 0x0644, 0x0639, 0x0645, 0 };
+static const unichar_t str_fdf6[] = { 0x0631, 0x0633, 0x0648, 0x0644, 0 };
+static const unichar_t str_fdf7[] = { 0x0639, 0x0644, 0x064a, 0x0647, 0 };
+static const unichar_t str_fdf8[] = { 0x0648, 0x0633, 0x0644, 0x0645, 0 };
+static const unichar_t str_fdf9[] = { 0x0635, 0x0644, 0x0649, 0 };
+static const unichar_t str_fdfa[] = { 0x0635, 0x0644, 0x0649, 0x0020, 0x0627, 0x0644, 0x0644, 0x0647, 0x0020, 0x0639, 0x0644, 0x064a, 0x0647, 0x0020, 0x0648, 0x0633, 0x0644, 0x0645, 0 };
+static const unichar_t str_fdfb[] = { 0x062c, 0x0644, 0x0020, 0x062c, 0x0644, 0x0627, 0x0644, 0x0647, 0 };
+static const unichar_t str_fdfc[] = { 0x0631, 0x06cc, 0x0627, 0x0644, 0 };
+static const unichar_t str_fe10[] = { 0x002c, 0 };
+static const unichar_t str_fe11[] = { 0x3001, 0 };
+static const unichar_t str_fe12[] = { 0x3002, 0 };
+static const unichar_t str_fe13[] = { 0x003a, 0 };
+static const unichar_t str_fe14[] = { 0x003b, 0 };
+static const unichar_t str_fe15[] = { 0x0021, 0 };
+static const unichar_t str_fe16[] = { 0x003f, 0 };
+static const unichar_t str_fe17[] = { 0x3016, 0 };
+static const unichar_t str_fe18[] = { 0x3017, 0 };
+static const unichar_t str_fe19[] = { 0x2026, 0 };
+static const unichar_t str_fe30[] = { 0x2025, 0 };
+static const unichar_t str_fe31[] = { 0x2014, 0 };
+static const unichar_t str_fe32[] = { 0x2013, 0 };
+static const unichar_t str_fe33[] = { 0x005f, 0 };
+static const unichar_t str_fe34[] = { 0x005f, 0 };
+static const unichar_t str_fe35[] = { 0x0028, 0 };
+static const unichar_t str_fe36[] = { 0x0029, 0 };
+static const unichar_t str_fe37[] = { 0x007b, 0 };
+static const unichar_t str_fe38[] = { 0x007d, 0 };
+static const unichar_t str_fe39[] = { 0x3014, 0 };
+static const unichar_t str_fe3a[] = { 0x3015, 0 };
+static const unichar_t str_fe3b[] = { 0x3010, 0 };
+static const unichar_t str_fe3c[] = { 0x3011, 0 };
+static const unichar_t str_fe3d[] = { 0x300a, 0 };
+static const unichar_t str_fe3e[] = { 0x300b, 0 };
+static const unichar_t str_fe3f[] = { 0x3008, 0 };
+static const unichar_t str_fe40[] = { 0x3009, 0 };
+static const unichar_t str_fe41[] = { 0x300c, 0 };
+static const unichar_t str_fe42[] = { 0x300d, 0 };
+static const unichar_t str_fe43[] = { 0x300e, 0 };
+static const unichar_t str_fe44[] = { 0x300f, 0 };
+static const unichar_t str_fe47[] = { 0x005b, 0 };
+static const unichar_t str_fe48[] = { 0x005d, 0 };
+static const unichar_t str_fe49[] = { 0x203e, 0 };
+static const unichar_t str_fe4a[] = { 0x203e, 0 };
+static const unichar_t str_fe4b[] = { 0x203e, 0 };
+static const unichar_t str_fe4c[] = { 0x203e, 0 };
+static const unichar_t str_fe4d[] = { 0x005f, 0 };
+static const unichar_t str_fe4e[] = { 0x005f, 0 };
+static const unichar_t str_fe4f[] = { 0x005f, 0 };
+static const unichar_t str_fe50[] = { 0x002c, 0 };
+static const unichar_t str_fe51[] = { 0x3001, 0 };
+static const unichar_t str_fe52[] = { 0x002e, 0 };
+static const unichar_t str_fe54[] = { 0x003b, 0 };
+static const unichar_t str_fe55[] = { 0x003a, 0 };
+static const unichar_t str_fe56[] = { 0x003f, 0 };
+static const unichar_t str_fe57[] = { 0x0021, 0 };
+static const unichar_t str_fe58[] = { 0x2014, 0 };
+static const unichar_t str_fe59[] = { 0x0028, 0 };
+static const unichar_t str_fe5a[] = { 0x0029, 0 };
+static const unichar_t str_fe5b[] = { 0x007b, 0 };
+static const unichar_t str_fe5c[] = { 0x007d, 0 };
+static const unichar_t str_fe5d[] = { 0x3014, 0 };
+static const unichar_t str_fe5e[] = { 0x3015, 0 };
+static const unichar_t str_fe5f[] = { 0x0023, 0 };
+static const unichar_t str_fe60[] = { 0x0026, 0 };
+static const unichar_t str_fe61[] = { 0x002a, 0 };
+static const unichar_t str_fe62[] = { 0x002b, 0 };
+static const unichar_t str_fe63[] = { 0x002d, 0 };
+static const unichar_t str_fe64[] = { 0x003c, 0 };
+static const unichar_t str_fe65[] = { 0x003e, 0 };
+static const unichar_t str_fe66[] = { 0x003d, 0 };
+static const unichar_t str_fe68[] = { 0x005c, 0 };
+static const unichar_t str_fe69[] = { 0x0024, 0 };
+static const unichar_t str_fe6a[] = { 0x0025, 0 };
+static const unichar_t str_fe6b[] = { 0x0040, 0 };
+static const unichar_t str_fe70[] = { 0x0020, 0x064b, 0 };
+static const unichar_t str_fe71[] = { 0x0640, 0x064b, 0 };
+static const unichar_t str_fe72[] = { 0x0020, 0x064c, 0 };
+static const unichar_t str_fe74[] = { 0x0020, 0x064d, 0 };
+static const unichar_t str_fe76[] = { 0x0020, 0x064e, 0 };
+static const unichar_t str_fe77[] = { 0x0640, 0x064e, 0 };
+static const unichar_t str_fe78[] = { 0x0020, 0x064f, 0 };
+static const unichar_t str_fe79[] = { 0x0640, 0x064f, 0 };
+static const unichar_t str_fe7a[] = { 0x0020, 0x0650, 0 };
+static const unichar_t str_fe7b[] = { 0x0640, 0x0650, 0 };
+static const unichar_t str_fe7c[] = { 0x0020, 0x0651, 0 };
+static const unichar_t str_fe7d[] = { 0x0640, 0x0651, 0 };
+static const unichar_t str_fe7e[] = { 0x0020, 0x0652, 0 };
+static const unichar_t str_fe7f[] = { 0x0640, 0x0652, 0 };
+static const unichar_t str_fe80[] = { 0x0621, 0 };
+static const unichar_t str_fe81[] = { 0x0622, 0 };
+static const unichar_t str_fe82[] = { 0x0622, 0 };
+static const unichar_t str_fe83[] = { 0x0623, 0 };
+static const unichar_t str_fe84[] = { 0x0623, 0 };
+static const unichar_t str_fe85[] = { 0x0624, 0 };
+static const unichar_t str_fe86[] = { 0x0624, 0 };
+static const unichar_t str_fe87[] = { 0x0625, 0 };
+static const unichar_t str_fe88[] = { 0x0625, 0 };
+static const unichar_t str_fe89[] = { 0x0626, 0 };
+static const unichar_t str_fe8a[] = { 0x0626, 0 };
+static const unichar_t str_fe8b[] = { 0x0626, 0 };
+static const unichar_t str_fe8c[] = { 0x0626, 0 };
+static const unichar_t str_fe8d[] = { 0x0627, 0 };
+static const unichar_t str_fe8e[] = { 0x0627, 0 };
+static const unichar_t str_fe8f[] = { 0x0628, 0 };
+static const unichar_t str_fe90[] = { 0x0628, 0 };
+static const unichar_t str_fe91[] = { 0x0628, 0 };
+static const unichar_t str_fe92[] = { 0x0628, 0 };
+static const unichar_t str_fe93[] = { 0x0629, 0 };
+static const unichar_t str_fe94[] = { 0x0629, 0 };
+static const unichar_t str_fe95[] = { 0x062a, 0 };
+static const unichar_t str_fe96[] = { 0x062a, 0 };
+static const unichar_t str_fe97[] = { 0x062a, 0 };
+static const unichar_t str_fe98[] = { 0x062a, 0 };
+static const unichar_t str_fe99[] = { 0x062b, 0 };
+static const unichar_t str_fe9a[] = { 0x062b, 0 };
+static const unichar_t str_fe9b[] = { 0x062b, 0 };
+static const unichar_t str_fe9c[] = { 0x062b, 0 };
+static const unichar_t str_fe9d[] = { 0x062c, 0 };
+static const unichar_t str_fe9e[] = { 0x062c, 0 };
+static const unichar_t str_fe9f[] = { 0x062c, 0 };
+static const unichar_t str_fea0[] = { 0x062c, 0 };
+static const unichar_t str_fea1[] = { 0x062d, 0 };
+static const unichar_t str_fea2[] = { 0x062d, 0 };
+static const unichar_t str_fea3[] = { 0x062d, 0 };
+static const unichar_t str_fea4[] = { 0x062d, 0 };
+static const unichar_t str_fea5[] = { 0x062e, 0 };
+static const unichar_t str_fea6[] = { 0x062e, 0 };
+static const unichar_t str_fea7[] = { 0x062e, 0 };
+static const unichar_t str_fea8[] = { 0x062e, 0 };
+static const unichar_t str_fea9[] = { 0x062f, 0 };
+static const unichar_t str_feaa[] = { 0x062f, 0 };
+static const unichar_t str_feab[] = { 0x0630, 0 };
+static const unichar_t str_feac[] = { 0x0630, 0 };
+static const unichar_t str_fead[] = { 0x0631, 0 };
+static const unichar_t str_feae[] = { 0x0631, 0 };
+static const unichar_t str_feaf[] = { 0x0632, 0 };
+static const unichar_t str_feb0[] = { 0x0632, 0 };
+static const unichar_t str_feb1[] = { 0x0633, 0 };
+static const unichar_t str_feb2[] = { 0x0633, 0 };
+static const unichar_t str_feb3[] = { 0x0633, 0 };
+static const unichar_t str_feb4[] = { 0x0633, 0 };
+static const unichar_t str_feb5[] = { 0x0634, 0 };
+static const unichar_t str_feb6[] = { 0x0634, 0 };
+static const unichar_t str_feb7[] = { 0x0634, 0 };
+static const unichar_t str_feb8[] = { 0x0634, 0 };
+static const unichar_t str_feb9[] = { 0x0635, 0 };
+static const unichar_t str_feba[] = { 0x0635, 0 };
+static const unichar_t str_febb[] = { 0x0635, 0 };
+static const unichar_t str_febc[] = { 0x0635, 0 };
+static const unichar_t str_febd[] = { 0x0636, 0 };
+static const unichar_t str_febe[] = { 0x0636, 0 };
+static const unichar_t str_febf[] = { 0x0636, 0 };
+static const unichar_t str_fec0[] = { 0x0636, 0 };
+static const unichar_t str_fec1[] = { 0x0637, 0 };
+static const unichar_t str_fec2[] = { 0x0637, 0 };
+static const unichar_t str_fec3[] = { 0x0637, 0 };
+static const unichar_t str_fec4[] = { 0x0637, 0 };
+static const unichar_t str_fec5[] = { 0x0638, 0 };
+static const unichar_t str_fec6[] = { 0x0638, 0 };
+static const unichar_t str_fec7[] = { 0x0638, 0 };
+static const unichar_t str_fec8[] = { 0x0638, 0 };
+static const unichar_t str_fec9[] = { 0x0639, 0 };
+static const unichar_t str_feca[] = { 0x0639, 0 };
+static const unichar_t str_fecb[] = { 0x0639, 0 };
+static const unichar_t str_fecc[] = { 0x0639, 0 };
+static const unichar_t str_fecd[] = { 0x063a, 0 };
+static const unichar_t str_fece[] = { 0x063a, 0 };
+static const unichar_t str_fecf[] = { 0x063a, 0 };
+static const unichar_t str_fed0[] = { 0x063a, 0 };
+static const unichar_t str_fed1[] = { 0x0641, 0 };
+static const unichar_t str_fed2[] = { 0x0641, 0 };
+static const unichar_t str_fed3[] = { 0x0641, 0 };
+static const unichar_t str_fed4[] = { 0x0641, 0 };
+static const unichar_t str_fed5[] = { 0x0642, 0 };
+static const unichar_t str_fed6[] = { 0x0642, 0 };
+static const unichar_t str_fed7[] = { 0x0642, 0 };
+static const unichar_t str_fed8[] = { 0x0642, 0 };
+static const unichar_t str_fed9[] = { 0x0643, 0 };
+static const unichar_t str_feda[] = { 0x0643, 0 };
+static const unichar_t str_fedb[] = { 0x0643, 0 };
+static const unichar_t str_fedc[] = { 0x0643, 0 };
+static const unichar_t str_fedd[] = { 0x0644, 0 };
+static const unichar_t str_fede[] = { 0x0644, 0 };
+static const unichar_t str_fedf[] = { 0x0644, 0 };
+static const unichar_t str_fee0[] = { 0x0644, 0 };
+static const unichar_t str_fee1[] = { 0x0645, 0 };
+static const unichar_t str_fee2[] = { 0x0645, 0 };
+static const unichar_t str_fee3[] = { 0x0645, 0 };
+static const unichar_t str_fee4[] = { 0x0645, 0 };
+static const unichar_t str_fee5[] = { 0x0646, 0 };
+static const unichar_t str_fee6[] = { 0x0646, 0 };
+static const unichar_t str_fee7[] = { 0x0646, 0 };
+static const unichar_t str_fee8[] = { 0x0646, 0 };
+static const unichar_t str_fee9[] = { 0x0647, 0 };
+static const unichar_t str_feea[] = { 0x0647, 0 };
+static const unichar_t str_feeb[] = { 0x0647, 0 };
+static const unichar_t str_feec[] = { 0x0647, 0 };
+static const unichar_t str_feed[] = { 0x0648, 0 };
+static const unichar_t str_feee[] = { 0x0648, 0 };
+static const unichar_t str_feef[] = { 0x0649, 0 };
+static const unichar_t str_fef0[] = { 0x0649, 0 };
+static const unichar_t str_fef1[] = { 0x064a, 0 };
+static const unichar_t str_fef2[] = { 0x064a, 0 };
+static const unichar_t str_fef3[] = { 0x064a, 0 };
+static const unichar_t str_fef4[] = { 0x064a, 0 };
+static const unichar_t str_fef5[] = { 0x0644, 0x0622, 0 };
+static const unichar_t str_fef6[] = { 0x0644, 0x0622, 0 };
+static const unichar_t str_fef7[] = { 0x0644, 0x0623, 0 };
+static const unichar_t str_fef8[] = { 0x0644, 0x0623, 0 };
+static const unichar_t str_fef9[] = { 0x0644, 0x0625, 0 };
+static const unichar_t str_fefa[] = { 0x0644, 0x0625, 0 };
+static const unichar_t str_fefb[] = { 0x0644, 0x0627, 0 };
+static const unichar_t str_fefc[] = { 0x0644, 0x0627, 0 };
+static const unichar_t str_ff01[] = { 0x0021, 0 };
+static const unichar_t str_ff02[] = { 0x0022, 0 };
+static const unichar_t str_ff03[] = { 0x0023, 0 };
+static const unichar_t str_ff04[] = { 0x0024, 0 };
+static const unichar_t str_ff05[] = { 0x0025, 0 };
+static const unichar_t str_ff06[] = { 0x0026, 0 };
+static const unichar_t str_ff07[] = { 0x0027, 0 };
+static const unichar_t str_ff08[] = { 0x0028, 0 };
+static const unichar_t str_ff09[] = { 0x0029, 0 };
+static const unichar_t str_ff0a[] = { 0x002a, 0 };
+static const unichar_t str_ff0b[] = { 0x002b, 0 };
+static const unichar_t str_ff0c[] = { 0x002c, 0 };
+static const unichar_t str_ff0d[] = { 0x002d, 0 };
+static const unichar_t str_ff0e[] = { 0x002e, 0 };
+static const unichar_t str_ff0f[] = { 0x002f, 0 };
+static const unichar_t str_ff10[] = { 0x0030, 0 };
+static const unichar_t str_ff11[] = { 0x0031, 0 };
+static const unichar_t str_ff12[] = { 0x0032, 0 };
+static const unichar_t str_ff13[] = { 0x0033, 0 };
+static const unichar_t str_ff14[] = { 0x0034, 0 };
+static const unichar_t str_ff15[] = { 0x0035, 0 };
+static const unichar_t str_ff16[] = { 0x0036, 0 };
+static const unichar_t str_ff17[] = { 0x0037, 0 };
+static const unichar_t str_ff18[] = { 0x0038, 0 };
+static const unichar_t str_ff19[] = { 0x0039, 0 };
+static const unichar_t str_ff1a[] = { 0x003a, 0 };
+static const unichar_t str_ff1b[] = { 0x003b, 0 };
+static const unichar_t str_ff1c[] = { 0x003c, 0 };
+static const unichar_t str_ff1d[] = { 0x003d, 0 };
+static const unichar_t str_ff1e[] = { 0x003e, 0 };
+static const unichar_t str_ff1f[] = { 0x003f, 0 };
+static const unichar_t str_ff20[] = { 0x0040, 0 };
+static const unichar_t str_ff21[] = { 0x0041, 0 };
+static const unichar_t str_ff22[] = { 0x0042, 0 };
+static const unichar_t str_ff23[] = { 0x0043, 0 };
+static const unichar_t str_ff24[] = { 0x0044, 0 };
+static const unichar_t str_ff25[] = { 0x0045, 0 };
+static const unichar_t str_ff26[] = { 0x0046, 0 };
+static const unichar_t str_ff27[] = { 0x0047, 0 };
+static const unichar_t str_ff28[] = { 0x0048, 0 };
+static const unichar_t str_ff29[] = { 0x0049, 0 };
+static const unichar_t str_ff2a[] = { 0x004a, 0 };
+static const unichar_t str_ff2b[] = { 0x004b, 0 };
+static const unichar_t str_ff2c[] = { 0x004c, 0 };
+static const unichar_t str_ff2d[] = { 0x004d, 0 };
+static const unichar_t str_ff2e[] = { 0x004e, 0 };
+static const unichar_t str_ff2f[] = { 0x004f, 0 };
+static const unichar_t str_ff30[] = { 0x0050, 0 };
+static const unichar_t str_ff31[] = { 0x0051, 0 };
+static const unichar_t str_ff32[] = { 0x0052, 0 };
+static const unichar_t str_ff33[] = { 0x0053, 0 };
+static const unichar_t str_ff34[] = { 0x0054, 0 };
+static const unichar_t str_ff35[] = { 0x0055, 0 };
+static const unichar_t str_ff36[] = { 0x0056, 0 };
+static const unichar_t str_ff37[] = { 0x0057, 0 };
+static const unichar_t str_ff38[] = { 0x0058, 0 };
+static const unichar_t str_ff39[] = { 0x0059, 0 };
+static const unichar_t str_ff3a[] = { 0x005a, 0 };
+static const unichar_t str_ff3b[] = { 0x005b, 0 };
+static const unichar_t str_ff3c[] = { 0x005c, 0 };
+static const unichar_t str_ff3d[] = { 0x005d, 0 };
+static const unichar_t str_ff3e[] = { 0x005e, 0 };
+static const unichar_t str_ff3f[] = { 0x005f, 0 };
+static const unichar_t str_ff40[] = { 0x0060, 0 };
+static const unichar_t str_ff41[] = { 0x0061, 0 };
+static const unichar_t str_ff42[] = { 0x0062, 0 };
+static const unichar_t str_ff43[] = { 0x0063, 0 };
+static const unichar_t str_ff44[] = { 0x0064, 0 };
+static const unichar_t str_ff45[] = { 0x0065, 0 };
+static const unichar_t str_ff46[] = { 0x0066, 0 };
+static const unichar_t str_ff47[] = { 0x0067, 0 };
+static const unichar_t str_ff48[] = { 0x0068, 0 };
+static const unichar_t str_ff49[] = { 0x0069, 0 };
+static const unichar_t str_ff4a[] = { 0x006a, 0 };
+static const unichar_t str_ff4b[] = { 0x006b, 0 };
+static const unichar_t str_ff4c[] = { 0x006c, 0 };
+static const unichar_t str_ff4d[] = { 0x006d, 0 };
+static const unichar_t str_ff4e[] = { 0x006e, 0 };
+static const unichar_t str_ff4f[] = { 0x006f, 0 };
+static const unichar_t str_ff50[] = { 0x0070, 0 };
+static const unichar_t str_ff51[] = { 0x0071, 0 };
+static const unichar_t str_ff52[] = { 0x0072, 0 };
+static const unichar_t str_ff53[] = { 0x0073, 0 };
+static const unichar_t str_ff54[] = { 0x0074, 0 };
+static const unichar_t str_ff55[] = { 0x0075, 0 };
+static const unichar_t str_ff56[] = { 0x0076, 0 };
+static const unichar_t str_ff57[] = { 0x0077, 0 };
+static const unichar_t str_ff58[] = { 0x0078, 0 };
+static const unichar_t str_ff59[] = { 0x0079, 0 };
+static const unichar_t str_ff5a[] = { 0x007a, 0 };
+static const unichar_t str_ff5b[] = { 0x007b, 0 };
+static const unichar_t str_ff5c[] = { 0x007c, 0 };
+static const unichar_t str_ff5d[] = { 0x007d, 0 };
+static const unichar_t str_ff5e[] = { 0x007e, 0 };
+static const unichar_t str_ff5f[] = { 0x2985, 0 };
+static const unichar_t str_ff60[] = { 0x2986, 0 };
+static const unichar_t str_ff61[] = { 0x3002, 0 };
+static const unichar_t str_ff62[] = { 0x300c, 0 };
+static const unichar_t str_ff63[] = { 0x300d, 0 };
+static const unichar_t str_ff64[] = { 0x3001, 0 };
+static const unichar_t str_ff65[] = { 0x30fb, 0 };
+static const unichar_t str_ff66[] = { 0x30f2, 0 };
+static const unichar_t str_ff67[] = { 0x30a1, 0 };
+static const unichar_t str_ff68[] = { 0x30a3, 0 };
+static const unichar_t str_ff69[] = { 0x30a5, 0 };
+static const unichar_t str_ff6a[] = { 0x30a7, 0 };
+static const unichar_t str_ff6b[] = { 0x30a9, 0 };
+static const unichar_t str_ff6c[] = { 0x30e3, 0 };
+static const unichar_t str_ff6d[] = { 0x30e5, 0 };
+static const unichar_t str_ff6e[] = { 0x30e7, 0 };
+static const unichar_t str_ff6f[] = { 0x30c3, 0 };
+static const unichar_t str_ff70[] = { 0x30fc, 0 };
+static const unichar_t str_ff71[] = { 0x30a2, 0 };
+static const unichar_t str_ff72[] = { 0x30a4, 0 };
+static const unichar_t str_ff73[] = { 0x30a6, 0 };
+static const unichar_t str_ff74[] = { 0x30a8, 0 };
+static const unichar_t str_ff75[] = { 0x30aa, 0 };
+static const unichar_t str_ff76[] = { 0x30ab, 0 };
+static const unichar_t str_ff77[] = { 0x30ad, 0 };
+static const unichar_t str_ff78[] = { 0x30af, 0 };
+static const unichar_t str_ff79[] = { 0x30b1, 0 };
+static const unichar_t str_ff7a[] = { 0x30b3, 0 };
+static const unichar_t str_ff7b[] = { 0x30b5, 0 };
+static const unichar_t str_ff7c[] = { 0x30b7, 0 };
+static const unichar_t str_ff7d[] = { 0x30b9, 0 };
+static const unichar_t str_ff7e[] = { 0x30bb, 0 };
+static const unichar_t str_ff7f[] = { 0x30bd, 0 };
+static const unichar_t str_ff80[] = { 0x30bf, 0 };
+static const unichar_t str_ff81[] = { 0x30c1, 0 };
+static const unichar_t str_ff82[] = { 0x30c4, 0 };
+static const unichar_t str_ff83[] = { 0x30c6, 0 };
+static const unichar_t str_ff84[] = { 0x30c8, 0 };
+static const unichar_t str_ff85[] = { 0x30ca, 0 };
+static const unichar_t str_ff86[] = { 0x30cb, 0 };
+static const unichar_t str_ff87[] = { 0x30cc, 0 };
+static const unichar_t str_ff88[] = { 0x30cd, 0 };
+static const unichar_t str_ff89[] = { 0x30ce, 0 };
+static const unichar_t str_ff8a[] = { 0x30cf, 0 };
+static const unichar_t str_ff8b[] = { 0x30d2, 0 };
+static const unichar_t str_ff8c[] = { 0x30d5, 0 };
+static const unichar_t str_ff8d[] = { 0x30d8, 0 };
+static const unichar_t str_ff8e[] = { 0x30db, 0 };
+static const unichar_t str_ff8f[] = { 0x30de, 0 };
+static const unichar_t str_ff90[] = { 0x30df, 0 };
+static const unichar_t str_ff91[] = { 0x30e0, 0 };
+static const unichar_t str_ff92[] = { 0x30e1, 0 };
+static const unichar_t str_ff93[] = { 0x30e2, 0 };
+static const unichar_t str_ff94[] = { 0x30e4, 0 };
+static const unichar_t str_ff95[] = { 0x30e6, 0 };
+static const unichar_t str_ff96[] = { 0x30e8, 0 };
+static const unichar_t str_ff97[] = { 0x30e9, 0 };
+static const unichar_t str_ff98[] = { 0x30ea, 0 };
+static const unichar_t str_ff99[] = { 0x30eb, 0 };
+static const unichar_t str_ff9a[] = { 0x30ec, 0 };
+static const unichar_t str_ff9b[] = { 0x30ed, 0 };
+static const unichar_t str_ff9c[] = { 0x30ef, 0 };
+static const unichar_t str_ff9d[] = { 0x30f3, 0 };
+static const unichar_t str_ff9e[] = { 0x3099, 0 };
+static const unichar_t str_ff9f[] = { 0x309a, 0 };
+static const unichar_t str_ffa0[] = { 0x3164, 0 };
+static const unichar_t str_ffa1[] = { 0x3131, 0 };
+static const unichar_t str_ffa2[] = { 0x3132, 0 };
+static const unichar_t str_ffa3[] = { 0x3133, 0 };
+static const unichar_t str_ffa4[] = { 0x3134, 0 };
+static const unichar_t str_ffa5[] = { 0x3135, 0 };
+static const unichar_t str_ffa6[] = { 0x3136, 0 };
+static const unichar_t str_ffa7[] = { 0x3137, 0 };
+static const unichar_t str_ffa8[] = { 0x3138, 0 };
+static const unichar_t str_ffa9[] = { 0x3139, 0 };
+static const unichar_t str_ffaa[] = { 0x313a, 0 };
+static const unichar_t str_ffab[] = { 0x313b, 0 };
+static const unichar_t str_ffac[] = { 0x313c, 0 };
+static const unichar_t str_ffad[] = { 0x313d, 0 };
+static const unichar_t str_ffae[] = { 0x313e, 0 };
+static const unichar_t str_ffaf[] = { 0x313f, 0 };
+static const unichar_t str_ffb0[] = { 0x3140, 0 };
+static const unichar_t str_ffb1[] = { 0x3141, 0 };
+static const unichar_t str_ffb2[] = { 0x3142, 0 };
+static const unichar_t str_ffb3[] = { 0x3143, 0 };
+static const unichar_t str_ffb4[] = { 0x3144, 0 };
+static const unichar_t str_ffb5[] = { 0x3145, 0 };
+static const unichar_t str_ffb6[] = { 0x3146, 0 };
+static const unichar_t str_ffb7[] = { 0x3147, 0 };
+static const unichar_t str_ffb8[] = { 0x3148, 0 };
+static const unichar_t str_ffb9[] = { 0x3149, 0 };
+static const unichar_t str_ffba[] = { 0x314a, 0 };
+static const unichar_t str_ffbb[] = { 0x314b, 0 };
+static const unichar_t str_ffbc[] = { 0x314c, 0 };
+static const unichar_t str_ffbd[] = { 0x314d, 0 };
+static const unichar_t str_ffbe[] = { 0x314e, 0 };
+static const unichar_t str_ffc2[] = { 0x314f, 0 };
+static const unichar_t str_ffc3[] = { 0x3150, 0 };
+static const unichar_t str_ffc4[] = { 0x3151, 0 };
+static const unichar_t str_ffc5[] = { 0x3152, 0 };
+static const unichar_t str_ffc6[] = { 0x3153, 0 };
+static const unichar_t str_ffc7[] = { 0x3154, 0 };
+static const unichar_t str_ffca[] = { 0x3155, 0 };
+static const unichar_t str_ffcb[] = { 0x3156, 0 };
+static const unichar_t str_ffcc[] = { 0x3157, 0 };
+static const unichar_t str_ffcd[] = { 0x3158, 0 };
+static const unichar_t str_ffce[] = { 0x3159, 0 };
+static const unichar_t str_ffcf[] = { 0x315a, 0 };
+static const unichar_t str_ffd2[] = { 0x315b, 0 };
+static const unichar_t str_ffd3[] = { 0x315c, 0 };
+static const unichar_t str_ffd4[] = { 0x315d, 0 };
+static const unichar_t str_ffd5[] = { 0x315e, 0 };
+static const unichar_t str_ffd6[] = { 0x315f, 0 };
+static const unichar_t str_ffd7[] = { 0x3160, 0 };
+static const unichar_t str_ffda[] = { 0x3161, 0 };
+static const unichar_t str_ffdb[] = { 0x3162, 0 };
+static const unichar_t str_ffdc[] = { 0x3163, 0 };
+static const unichar_t str_ffe0[] = { 0x00a2, 0 };
+static const unichar_t str_ffe1[] = { 0x00a3, 0 };
+static const unichar_t str_ffe2[] = { 0x00ac, 0 };
+static const unichar_t str_ffe3[] = { 0x00af, 0 };
+static const unichar_t str_ffe4[] = { 0x00a6, 0 };
+static const unichar_t str_ffe5[] = { 0x00a5, 0 };
+static const unichar_t str_ffe6[] = { 0x20a9, 0 };
+static const unichar_t str_ffe8[] = { 0x2502, 0 };
+static const unichar_t str_ffe9[] = { 0x2190, 0 };
+static const unichar_t str_ffea[] = { 0x2191, 0 };
+static const unichar_t str_ffeb[] = { 0x2192, 0 };
+static const unichar_t str_ffec[] = { 0x2193, 0 };
+static const unichar_t str_ffed[] = { 0x25a0, 0 };
+static const unichar_t str_ffee[] = { 0x25cb, 0 };
+
+static const unichar_t *const up_allzeros[256] = { NULL };
+
+static const unichar_t * const tab_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, 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, 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, 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, 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, str_a0,
+0, 0, 0, 0, 0, 0, 0, str_a8,
+0, str_aa,
+0, 0, 0, 0, str_af,
+0, 0, str_b2,
+str_b3,
+str_b4,
+str_b5,
+0, 0, str_b8,
+str_b9,
+str_ba,
+0, str_bc,
+str_bd,
+str_be,
+0, str_c0,
+str_c1,
+str_c2,
+str_c3,
+str_c4,
+str_c5,
+0, str_c7,
+str_c8,
+str_c9,
+str_ca,
+str_cb,
+str_cc,
+str_cd,
+str_ce,
+str_cf,
+0, str_d1,
+str_d2,
+str_d3,
+str_d4,
+str_d5,
+str_d6,
+0, 0, str_d9,
+str_da,
+str_db,
+str_dc,
+str_dd,
+0, 0, str_e0,
+str_e1,
+str_e2,
+str_e3,
+str_e4,
+str_e5,
+0, str_e7,
+str_e8,
+str_e9,
+str_ea,
+str_eb,
+str_ec,
+str_ed,
+str_ee,
+str_ef,
+0, str_f1,
+str_f2,
+str_f3,
+str_f4,
+str_f5,
+str_f6,
+0, 0, str_f9,
+str_fa,
+str_fb,
+str_fc,
+str_fd,
+0, str_ff,
+0};
+
+static const unichar_t * const tab_1[] = {
+str_100,
+str_101,
+str_102,
+str_103,
+str_104,
+str_105,
+str_106,
+str_107,
+str_108,
+str_109,
+str_10a,
+str_10b,
+str_10c,
+str_10d,
+str_10e,
+str_10f,
+str_110,
+0, str_112,
+str_113,
+str_114,
+str_115,
+str_116,
+str_117,
+str_118,
+str_119,
+str_11a,
+str_11b,
+str_11c,
+str_11d,
+str_11e,
+str_11f,
+str_120,
+str_121,
+str_122,
+str_123,
+str_124,
+str_125,
+0, 0, str_128,
+str_129,
+str_12a,
+str_12b,
+str_12c,
+str_12d,
+str_12e,
+str_12f,
+str_130,
+0, str_132,
+str_133,
+str_134,
+str_135,
+str_136,
+str_137,
+str_138,
+str_139,
+str_13a,
+str_13b,
+str_13c,
+str_13d,
+str_13e,
+str_13f,
+str_140,
+0, 0, str_143,
+str_144,
+str_145,
+str_146,
+str_147,
+str_148,
+str_149,
+0, 0, str_14c,
+str_14d,
+str_14e,
+str_14f,
+str_150,
+str_151,
+str_152,
+str_153,
+str_154,
+str_155,
+str_156,
+str_157,
+str_158,
+str_159,
+str_15a,
+str_15b,
+str_15c,
+str_15d,
+str_15e,
+str_15f,
+str_160,
+str_161,
+str_162,
+str_163,
+str_164,
+str_165,
+0, 0, str_168,
+str_169,
+str_16a,
+str_16b,
+str_16c,
+str_16d,
+str_16e,
+str_16f,
+str_170,
+str_171,
+str_172,
+str_173,
+str_174,
+str_175,
+str_176,
+str_177,
+str_178,
+str_179,
+str_17a,
+str_17b,
+str_17c,
+str_17d,
+str_17e,
+str_17f,
+0, 0, str_182,
+0, 0, 0, 0, 0, 0, str_189,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_19e,
+str_19f,
+str_1a0,
+str_1a1,
+0, 0, 0, 0, 0, 0, 0, str_1a9,
+0, 0, 0, 0, 0, str_1af,
+str_1b0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_1c0,
+str_1c1,
+0, 0, str_1c4,
+str_1c5,
+str_1c6,
+str_1c7,
+str_1c8,
+str_1c9,
+str_1ca,
+str_1cb,
+str_1cc,
+str_1cd,
+str_1ce,
+str_1cf,
+str_1d0,
+str_1d1,
+str_1d2,
+str_1d3,
+str_1d4,
+str_1d5,
+str_1d6,
+str_1d7,
+str_1d8,
+str_1d9,
+str_1da,
+str_1db,
+str_1dc,
+0, str_1de,
+str_1df,
+str_1e0,
+str_1e1,
+str_1e2,
+str_1e3,
+0, 0, str_1e6,
+str_1e7,
+str_1e8,
+str_1e9,
+str_1ea,
+str_1eb,
+str_1ec,
+str_1ed,
+str_1ee,
+str_1ef,
+str_1f0,
+str_1f1,
+str_1f2,
+str_1f3,
+str_1f4,
+str_1f5,
+0, 0, str_1f8,
+str_1f9,
+str_1fa,
+str_1fb,
+str_1fc,
+str_1fd,
+str_1fe,
+str_1ff,
+0};
+
+static const unichar_t * const tab_2[] = {
+str_200,
+str_201,
+str_202,
+str_203,
+str_204,
+str_205,
+str_206,
+str_207,
+str_208,
+str_209,
+str_20a,
+str_20b,
+str_20c,
+str_20d,
+str_20e,
+str_20f,
+str_210,
+str_211,
+str_212,
+str_213,
+str_214,
+str_215,
+str_216,
+str_217,
+str_218,
+str_219,
+str_21a,
+str_21b,
+0, 0, str_21e,
+str_21f,
+0, 0, 0, 0, 0, 0, str_226,
+str_227,
+str_228,
+str_229,
+str_22a,
+str_22b,
+str_22c,
+str_22d,
+str_22e,
+str_22f,
+str_230,
+str_231,
+str_232,
+str_233,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_269,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_278,
+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, str_292,
+0, 0, 0, 0, 0, 0, str_299,
+0, 0, str_29c,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2b0,
+str_2b1,
+str_2b2,
+str_2b3,
+str_2b4,
+str_2b5,
+str_2b6,
+str_2b7,
+str_2b8,
+str_2b9,
+str_2ba,
+0, str_2bc,
+0, 0, 0, 0, 0, 0, 0, str_2c4,
+0, str_2c6,
+0, str_2c8,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2d8,
+str_2d9,
+str_2da,
+str_2db,
+str_2dc,
+str_2dd,
+0, 0, str_2e0,
+str_2e1,
+str_2e2,
+str_2e3,
+str_2e4,
+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};
+
+static const unichar_t * const tab_3[] = {
+0, str_301,
+str_302,
+str_303,
+0, 0, 0, 0, str_308,
+0, str_30a,
+str_30b,
+0, 0, str_30e,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_327,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_340,
+str_341,
+0, str_343,
+str_344,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_374,
+str_375,
+0, 0, 0, 0, str_37a,
+0, 0, 0, str_37e,
+0, 0, 0, 0, 0, str_384,
+str_385,
+str_386,
+str_387,
+str_388,
+str_389,
+str_38a,
+0, str_38c,
+0, str_38e,
+str_38f,
+str_390,
+str_391,
+str_392,
+str_393,
+0, str_395,
+str_396,
+str_397,
+0, str_399,
+str_39a,
+0, str_39c,
+str_39d,
+0, str_39f,
+0, str_3a1,
+0, 0, str_3a4,
+str_3a5,
+0, str_3a7,
+0, 0, str_3aa,
+str_3ab,
+str_3ac,
+str_3ad,
+str_3ae,
+str_3af,
+str_3b0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_3ba,
+0, 0, 0, 0, str_3bf,
+0, str_3c1,
+0, 0, 0, 0, 0, str_3c7,
+0, 0, str_3ca,
+str_3cb,
+str_3cc,
+str_3cd,
+str_3ce,
+0, str_3d0,
+str_3d1,
+str_3d2,
+str_3d3,
+str_3d4,
+str_3d5,
+str_3d6,
+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, str_3f0,
+str_3f1,
+str_3f2,
+0, str_3f4,
+str_3f5,
+0, 0, 0, str_3f9,
+0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_4[] = {
+str_400,
+str_401,
+0, str_403,
+0, str_405,
+str_406,
+str_407,
+str_408,
+0, 0, 0, str_40c,
+str_40d,
+str_40e,
+0, str_410,
+0, str_412,
+str_413,
+0, str_415,
+0, 0, 0, str_419,
+str_41a,
+0, str_41c,
+str_41d,
+str_41e,
+str_41f,
+str_420,
+str_421,
+str_422,
+0, str_424,
+str_425,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_430,
+0, 0, 0, 0, str_435,
+0, 0, 0, str_439,
+str_43a,
+0, 0, 0, str_43e,
+str_43f,
+str_440,
+str_441,
+0, str_443,
+0, str_445,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_450,
+str_451,
+0, str_453,
+0, str_455,
+str_456,
+str_457,
+str_458,
+0, 0, 0, str_45c,
+str_45d,
+str_45e,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_470,
+str_471,
+0, 0, 0, 0, str_476,
+str_477,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_4ae,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_4c0,
+str_4c1,
+str_4c2,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_4d0,
+str_4d1,
+str_4d2,
+str_4d3,
+str_4d4,
+str_4d5,
+str_4d6,
+str_4d7,
+0, 0, str_4da,
+str_4db,
+str_4dc,
+str_4dd,
+str_4de,
+str_4df,
+str_4e0,
+str_4e1,
+str_4e2,
+str_4e3,
+str_4e4,
+str_4e5,
+str_4e6,
+str_4e7,
+str_4e8,
+str_4e9,
+str_4ea,
+str_4eb,
+str_4ec,
+str_4ed,
+str_4ee,
+str_4ef,
+str_4f0,
+str_4f1,
+str_4f2,
+str_4f3,
+str_4f4,
+str_4f5,
+0, 0, str_4f8,
+str_4f9,
+0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_5[] = {
+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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_54f,
+0, 0, 0, 0, 0, str_555,
+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, str_570,
+0, 0, 0, 0, 0, 0, 0, str_578,
+0, str_57a,
+0, 0, str_57d,
+0, 0, 0, str_581,
+str_582,
+0, str_584,
+str_585,
+0, str_587,
+0, str_589,
+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, 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, 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, str_5f0,
+str_5f1,
+str_5f2,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_6[] = {
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_60c,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_621,
+str_622,
+str_623,
+str_624,
+str_625,
+str_626,
+str_627,
+str_628,
+str_629,
+str_62a,
+str_62b,
+str_62c,
+str_62d,
+str_62e,
+str_62f,
+str_630,
+str_631,
+str_632,
+str_633,
+str_634,
+str_635,
+str_636,
+str_637,
+str_638,
+str_639,
+str_63a,
+0, 0, 0, 0, 0, 0, str_641,
+str_642,
+str_643,
+str_644,
+str_645,
+str_646,
+str_647,
+str_648,
+str_649,
+str_64a,
+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, str_66a,
+0, str_66c,
+str_66d,
+0, 0, 0, str_671,
+0, 0, 0, str_675,
+str_676,
+str_677,
+str_678,
+str_679,
+str_67a,
+str_67b,
+0, 0, str_67e,
+str_67f,
+str_680,
+0, 0, str_683,
+str_684,
+0, str_686,
+str_687,
+str_688,
+0, 0, 0, str_68c,
+str_68d,
+str_68e,
+0, 0, str_691,
+0, 0, 0, 0, 0, 0, str_698,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_6a4,
+0, str_6a6,
+0, 0, str_6a9,
+0, 0, 0, str_6ad,
+0, str_6af,
+0, str_6b1,
+0, str_6b3,
+0, 0, 0, 0, 0, 0, str_6ba,
+str_6bb,
+0, 0, str_6be,
+0, str_6c0,
+str_6c1,
+str_6c2,
+0, 0, str_6c5,
+str_6c6,
+str_6c7,
+str_6c8,
+str_6c9,
+0, str_6cb,
+str_6cc,
+0, 0, 0, str_6d0,
+0, str_6d2,
+str_6d3,
+str_6d4,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_9[] = {
+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, 0, 0, 0, 0, 0, 0, 0, str_929,
+0, 0, 0, 0, 0, 0, 0, str_931,
+0, 0, str_934,
+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, 0, str_958,
+str_959,
+str_95a,
+str_95b,
+str_95c,
+str_95d,
+str_95e,
+str_95f,
+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, 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, 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, 0, 0, 0, 0, 0, str_9cb,
+str_9cc,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_9dc,
+str_9dd,
+0, str_9df,
+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};
+
+static const unichar_t * const tab_a[] = {
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_a33,
+0, 0, str_a36,
+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, str_a59,
+str_a5a,
+str_a5b,
+0, 0, str_a5e,
+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, 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, 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, 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, 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};
+
+static const unichar_t * const tab_b[] = {
+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, 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, 0, 0, 0, 0, str_b48,
+0, 0, str_b4b,
+str_b4c,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_b5c,
+str_b5d,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_b94,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_bca,
+str_bcb,
+str_bcc,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_c[] = {
+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, 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, 0, 0, 0, 0, str_c48,
+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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_cc0,
+0, 0, 0, 0, 0, 0, str_cc7,
+str_cc8,
+0, str_cca,
+str_ccb,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_d[] = {
+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, 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, 0, 0, 0, 0, 0, 0, str_d4a,
+str_d4b,
+str_d4c,
+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, 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, 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, 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, 0, 0, 0, 0, 0, str_dda,
+0, str_ddc,
+str_ddd,
+str_dde,
+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};
+
+static const unichar_t * const tab_e[] = {
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_e33,
+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, 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, 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, 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, str_eb3,
+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, 0, 0, 0, 0, 0, 0, str_edc,
+str_edd,
+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, 0};
+
+static const unichar_t * const tab_f[] = {
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_f0c,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_f43,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_f4d,
+0, 0, 0, 0, str_f52,
+0, 0, 0, 0, str_f57,
+0, 0, 0, 0, str_f5c,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_f69,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_f73,
+0, str_f75,
+str_f76,
+str_f77,
+str_f78,
+str_f79,
+0, 0, 0, 0, 0, 0, 0, str_f81,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_f93,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_f9d,
+0, 0, 0, 0, str_fa2,
+0, 0, 0, 0, str_fa7,
+0, 0, 0, 0, str_fac,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_fb9,
+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, 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, 0, 0, 0};
+
+static const unichar_t * const tab_10[] = {
+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, 0, 0, 0, 0, str_1026,
+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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_10fc,
+0, 0, 0, 0};
+
+static const unichar_t * const tab_11[] = {
+0, str_1101,
+0, 0, str_1104,
+0, 0, 0, str_1108,
+0, str_110a,
+0, 0, str_110d,
+0, 0, 0, 0, 0, str_1113,
+str_1114,
+str_1115,
+str_1116,
+str_1117,
+str_1118,
+str_1119,
+str_111a,
+str_111b,
+str_111c,
+str_111d,
+str_111e,
+str_111f,
+str_1120,
+str_1121,
+str_1122,
+str_1123,
+str_1124,
+str_1125,
+str_1126,
+str_1127,
+str_1128,
+str_1129,
+str_112a,
+str_112b,
+str_112c,
+str_112d,
+str_112e,
+str_112f,
+str_1130,
+str_1131,
+str_1132,
+str_1133,
+str_1134,
+str_1135,
+str_1136,
+str_1137,
+str_1138,
+str_1139,
+str_113a,
+str_113b,
+0, str_113d,
+0, str_113f,
+0, str_1141,
+str_1142,
+str_1143,
+str_1144,
+str_1145,
+str_1146,
+str_1147,
+str_1148,
+str_1149,
+str_114a,
+str_114b,
+0, str_114d,
+0, str_114f,
+0, str_1151,
+str_1152,
+str_1153,
+0, 0, str_1156,
+str_1157,
+str_1158,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_1162,
+0, str_1164,
+0, str_1166,
+0, str_1168,
+0, str_116a,
+str_116b,
+str_116c,
+0, 0, str_116f,
+str_1170,
+str_1171,
+0, 0, str_1174,
+0, str_1176,
+str_1177,
+str_1178,
+str_1179,
+str_117a,
+str_117b,
+str_117c,
+str_117d,
+str_117e,
+str_117f,
+str_1180,
+str_1181,
+str_1182,
+str_1183,
+str_1184,
+str_1185,
+str_1186,
+str_1187,
+str_1188,
+str_1189,
+str_118a,
+str_118b,
+str_118c,
+str_118d,
+str_118e,
+str_118f,
+str_1190,
+str_1191,
+str_1192,
+str_1193,
+str_1194,
+str_1195,
+str_1196,
+str_1197,
+str_1198,
+str_1199,
+str_119a,
+str_119b,
+str_119c,
+str_119d,
+0, str_119f,
+str_11a0,
+str_11a1,
+str_11a2,
+0, 0, 0, 0, 0, str_11a8,
+str_11a9,
+str_11aa,
+str_11ab,
+str_11ac,
+str_11ad,
+str_11ae,
+str_11af,
+str_11b0,
+str_11b1,
+str_11b2,
+str_11b3,
+str_11b4,
+str_11b5,
+str_11b6,
+str_11b7,
+str_11b8,
+str_11b9,
+str_11ba,
+str_11bb,
+str_11bc,
+str_11bd,
+str_11be,
+str_11bf,
+str_11c0,
+str_11c1,
+str_11c2,
+str_11c3,
+str_11c4,
+str_11c5,
+str_11c6,
+str_11c7,
+str_11c8,
+str_11c9,
+str_11ca,
+str_11cb,
+str_11cc,
+str_11cd,
+str_11ce,
+str_11cf,
+str_11d0,
+str_11d1,
+str_11d2,
+str_11d3,
+str_11d4,
+str_11d5,
+str_11d6,
+str_11d7,
+str_11d8,
+str_11d9,
+str_11da,
+str_11db,
+str_11dc,
+str_11dd,
+str_11de,
+str_11df,
+str_11e0,
+str_11e1,
+str_11e2,
+str_11e3,
+str_11e4,
+str_11e5,
+str_11e6,
+str_11e7,
+str_11e8,
+str_11e9,
+str_11ea,
+str_11eb,
+str_11ec,
+str_11ed,
+str_11ee,
+str_11ef,
+str_11f0,
+str_11f1,
+str_11f2,
+str_11f3,
+str_11f4,
+str_11f5,
+str_11f6,
+str_11f7,
+str_11f8,
+str_11f9,
+0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_13[] = {
+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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_13a0,
+str_13a1,
+str_13a2,
+0, 0, 0, 0, 0, 0, str_13a9,
+str_13aa,
+str_13ab,
+str_13ac,
+0, 0, 0, 0, str_13b1,
+0, str_13b3,
+0, 0, 0, str_13b7,
+0, 0, 0, str_13bb,
+0, 0, str_13be,
+0, str_13c0,
+0, str_13c2,
+str_13c3,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_13cf,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_13d9,
+str_13da,
+0, 0, 0, str_13de,
+str_13df,
+0, 0, str_13e2,
+0, 0, 0, str_13e6,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_13f4,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_1b[] = {
+0, 0, 0, 0, 0, 0, str_1b06,
+0, str_1b08,
+0, str_1b0a,
+0, str_1b0c,
+0, str_1b0e,
+0, 0, 0, str_1b12,
+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, 0, 0, 0, 0, 0, 0, str_1b3b,
+0, str_1b3d,
+0, 0, str_1b40,
+str_1b41,
+0, str_1b43,
+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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_1d[] = {
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_1d2c,
+str_1d2d,
+str_1d2e,
+0, str_1d30,
+str_1d31,
+str_1d32,
+str_1d33,
+str_1d34,
+str_1d35,
+str_1d36,
+str_1d37,
+str_1d38,
+str_1d39,
+str_1d3a,
+0, str_1d3c,
+str_1d3d,
+str_1d3e,
+str_1d3f,
+str_1d40,
+str_1d41,
+str_1d42,
+str_1d43,
+str_1d44,
+str_1d45,
+str_1d46,
+str_1d47,
+str_1d48,
+str_1d49,
+str_1d4a,
+str_1d4b,
+str_1d4c,
+str_1d4d,
+0, str_1d4f,
+str_1d50,
+str_1d51,
+str_1d52,
+str_1d53,
+str_1d54,
+str_1d55,
+str_1d56,
+str_1d57,
+str_1d58,
+str_1d59,
+str_1d5a,
+str_1d5b,
+str_1d5c,
+str_1d5d,
+str_1d5e,
+str_1d5f,
+str_1d60,
+str_1d61,
+str_1d62,
+str_1d63,
+str_1d64,
+str_1d65,
+str_1d66,
+str_1d67,
+str_1d68,
+str_1d69,
+str_1d6a,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_1d78,
+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, str_1d9b,
+str_1d9c,
+str_1d9d,
+str_1d9e,
+str_1d9f,
+str_1da0,
+str_1da1,
+str_1da2,
+str_1da3,
+str_1da4,
+str_1da5,
+str_1da6,
+str_1da7,
+str_1da8,
+str_1da9,
+str_1daa,
+str_1dab,
+str_1dac,
+str_1dad,
+str_1dae,
+str_1daf,
+str_1db0,
+str_1db1,
+str_1db2,
+str_1db3,
+str_1db4,
+str_1db5,
+str_1db6,
+str_1db7,
+str_1db8,
+str_1db9,
+str_1dba,
+str_1dbb,
+str_1dbc,
+str_1dbd,
+str_1dbe,
+str_1dbf,
+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, 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};
+
+static const unichar_t * const tab_1e[] = {
+str_1e00,
+str_1e01,
+str_1e02,
+str_1e03,
+str_1e04,
+str_1e05,
+str_1e06,
+str_1e07,
+str_1e08,
+str_1e09,
+str_1e0a,
+str_1e0b,
+str_1e0c,
+str_1e0d,
+str_1e0e,
+str_1e0f,
+str_1e10,
+str_1e11,
+str_1e12,
+str_1e13,
+str_1e14,
+str_1e15,
+str_1e16,
+str_1e17,
+str_1e18,
+str_1e19,
+str_1e1a,
+str_1e1b,
+str_1e1c,
+str_1e1d,
+str_1e1e,
+str_1e1f,
+str_1e20,
+str_1e21,
+str_1e22,
+str_1e23,
+str_1e24,
+str_1e25,
+str_1e26,
+str_1e27,
+str_1e28,
+str_1e29,
+str_1e2a,
+str_1e2b,
+str_1e2c,
+str_1e2d,
+str_1e2e,
+str_1e2f,
+str_1e30,
+str_1e31,
+str_1e32,
+str_1e33,
+str_1e34,
+str_1e35,
+str_1e36,
+str_1e37,
+str_1e38,
+str_1e39,
+str_1e3a,
+str_1e3b,
+str_1e3c,
+str_1e3d,
+str_1e3e,
+str_1e3f,
+str_1e40,
+str_1e41,
+str_1e42,
+str_1e43,
+str_1e44,
+str_1e45,
+str_1e46,
+str_1e47,
+str_1e48,
+str_1e49,
+str_1e4a,
+str_1e4b,
+str_1e4c,
+str_1e4d,
+str_1e4e,
+str_1e4f,
+str_1e50,
+str_1e51,
+str_1e52,
+str_1e53,
+str_1e54,
+str_1e55,
+str_1e56,
+str_1e57,
+str_1e58,
+str_1e59,
+str_1e5a,
+str_1e5b,
+str_1e5c,
+str_1e5d,
+str_1e5e,
+str_1e5f,
+str_1e60,
+str_1e61,
+str_1e62,
+str_1e63,
+str_1e64,
+str_1e65,
+str_1e66,
+str_1e67,
+str_1e68,
+str_1e69,
+str_1e6a,
+str_1e6b,
+str_1e6c,
+str_1e6d,
+str_1e6e,
+str_1e6f,
+str_1e70,
+str_1e71,
+str_1e72,
+str_1e73,
+str_1e74,
+str_1e75,
+str_1e76,
+str_1e77,
+str_1e78,
+str_1e79,
+str_1e7a,
+str_1e7b,
+str_1e7c,
+str_1e7d,
+str_1e7e,
+str_1e7f,
+str_1e80,
+str_1e81,
+str_1e82,
+str_1e83,
+str_1e84,
+str_1e85,
+str_1e86,
+str_1e87,
+str_1e88,
+str_1e89,
+str_1e8a,
+str_1e8b,
+str_1e8c,
+str_1e8d,
+str_1e8e,
+str_1e8f,
+str_1e90,
+str_1e91,
+str_1e92,
+str_1e93,
+str_1e94,
+str_1e95,
+str_1e96,
+str_1e97,
+str_1e98,
+str_1e99,
+str_1e9a,
+str_1e9b,
+0, 0, 0, 0, str_1ea0,
+str_1ea1,
+str_1ea2,
+str_1ea3,
+str_1ea4,
+str_1ea5,
+str_1ea6,
+str_1ea7,
+str_1ea8,
+str_1ea9,
+str_1eaa,
+str_1eab,
+str_1eac,
+str_1ead,
+str_1eae,
+str_1eaf,
+str_1eb0,
+str_1eb1,
+str_1eb2,
+str_1eb3,
+str_1eb4,
+str_1eb5,
+str_1eb6,
+str_1eb7,
+str_1eb8,
+str_1eb9,
+str_1eba,
+str_1ebb,
+str_1ebc,
+str_1ebd,
+str_1ebe,
+str_1ebf,
+str_1ec0,
+str_1ec1,
+str_1ec2,
+str_1ec3,
+str_1ec4,
+str_1ec5,
+str_1ec6,
+str_1ec7,
+str_1ec8,
+str_1ec9,
+str_1eca,
+str_1ecb,
+str_1ecc,
+str_1ecd,
+str_1ece,
+str_1ecf,
+str_1ed0,
+str_1ed1,
+str_1ed2,
+str_1ed3,
+str_1ed4,
+str_1ed5,
+str_1ed6,
+str_1ed7,
+str_1ed8,
+str_1ed9,
+str_1eda,
+str_1edb,
+str_1edc,
+str_1edd,
+str_1ede,
+str_1edf,
+str_1ee0,
+str_1ee1,
+str_1ee2,
+str_1ee3,
+str_1ee4,
+str_1ee5,
+str_1ee6,
+str_1ee7,
+str_1ee8,
+str_1ee9,
+str_1eea,
+str_1eeb,
+str_1eec,
+str_1eed,
+str_1eee,
+str_1eef,
+str_1ef0,
+str_1ef1,
+str_1ef2,
+str_1ef3,
+str_1ef4,
+str_1ef5,
+str_1ef6,
+str_1ef7,
+str_1ef8,
+str_1ef9,
+0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_1f[] = {
+str_1f00,
+str_1f01,
+str_1f02,
+str_1f03,
+str_1f04,
+str_1f05,
+str_1f06,
+str_1f07,
+str_1f08,
+str_1f09,
+str_1f0a,
+str_1f0b,
+str_1f0c,
+str_1f0d,
+str_1f0e,
+str_1f0f,
+str_1f10,
+str_1f11,
+str_1f12,
+str_1f13,
+str_1f14,
+str_1f15,
+0, 0, str_1f18,
+str_1f19,
+str_1f1a,
+str_1f1b,
+str_1f1c,
+str_1f1d,
+0, 0, str_1f20,
+str_1f21,
+str_1f22,
+str_1f23,
+str_1f24,
+str_1f25,
+str_1f26,
+str_1f27,
+str_1f28,
+str_1f29,
+str_1f2a,
+str_1f2b,
+str_1f2c,
+str_1f2d,
+str_1f2e,
+str_1f2f,
+str_1f30,
+str_1f31,
+str_1f32,
+str_1f33,
+str_1f34,
+str_1f35,
+str_1f36,
+str_1f37,
+str_1f38,
+str_1f39,
+str_1f3a,
+str_1f3b,
+str_1f3c,
+str_1f3d,
+str_1f3e,
+str_1f3f,
+str_1f40,
+str_1f41,
+str_1f42,
+str_1f43,
+str_1f44,
+str_1f45,
+0, 0, str_1f48,
+str_1f49,
+str_1f4a,
+str_1f4b,
+str_1f4c,
+str_1f4d,
+0, 0, str_1f50,
+str_1f51,
+str_1f52,
+str_1f53,
+str_1f54,
+str_1f55,
+str_1f56,
+str_1f57,
+0, str_1f59,
+0, str_1f5b,
+0, str_1f5d,
+0, str_1f5f,
+str_1f60,
+str_1f61,
+str_1f62,
+str_1f63,
+str_1f64,
+str_1f65,
+str_1f66,
+str_1f67,
+str_1f68,
+str_1f69,
+str_1f6a,
+str_1f6b,
+str_1f6c,
+str_1f6d,
+str_1f6e,
+str_1f6f,
+str_1f70,
+str_1f71,
+str_1f72,
+str_1f73,
+str_1f74,
+str_1f75,
+str_1f76,
+str_1f77,
+str_1f78,
+str_1f79,
+str_1f7a,
+str_1f7b,
+str_1f7c,
+str_1f7d,
+0, 0, str_1f80,
+str_1f81,
+str_1f82,
+str_1f83,
+str_1f84,
+str_1f85,
+str_1f86,
+str_1f87,
+str_1f88,
+str_1f89,
+str_1f8a,
+str_1f8b,
+str_1f8c,
+str_1f8d,
+str_1f8e,
+str_1f8f,
+str_1f90,
+str_1f91,
+str_1f92,
+str_1f93,
+str_1f94,
+str_1f95,
+str_1f96,
+str_1f97,
+str_1f98,
+str_1f99,
+str_1f9a,
+str_1f9b,
+str_1f9c,
+str_1f9d,
+str_1f9e,
+str_1f9f,
+str_1fa0,
+str_1fa1,
+str_1fa2,
+str_1fa3,
+str_1fa4,
+str_1fa5,
+str_1fa6,
+str_1fa7,
+str_1fa8,
+str_1fa9,
+str_1faa,
+str_1fab,
+str_1fac,
+str_1fad,
+str_1fae,
+str_1faf,
+str_1fb0,
+str_1fb1,
+str_1fb2,
+str_1fb3,
+str_1fb4,
+0, str_1fb6,
+str_1fb7,
+str_1fb8,
+str_1fb9,
+str_1fba,
+str_1fbb,
+str_1fbc,
+str_1fbd,
+str_1fbe,
+str_1fbf,
+str_1fc0,
+str_1fc1,
+str_1fc2,
+str_1fc3,
+str_1fc4,
+0, str_1fc6,
+str_1fc7,
+str_1fc8,
+str_1fc9,
+str_1fca,
+str_1fcb,
+str_1fcc,
+str_1fcd,
+str_1fce,
+str_1fcf,
+str_1fd0,
+str_1fd1,
+str_1fd2,
+str_1fd3,
+0, 0, str_1fd6,
+str_1fd7,
+str_1fd8,
+str_1fd9,
+str_1fda,
+str_1fdb,
+0, str_1fdd,
+str_1fde,
+str_1fdf,
+str_1fe0,
+str_1fe1,
+str_1fe2,
+str_1fe3,
+str_1fe4,
+str_1fe5,
+str_1fe6,
+str_1fe7,
+str_1fe8,
+str_1fe9,
+str_1fea,
+str_1feb,
+str_1fec,
+str_1fed,
+str_1fee,
+str_1fef,
+0, 0, str_1ff2,
+str_1ff3,
+str_1ff4,
+0, str_1ff6,
+str_1ff7,
+str_1ff8,
+str_1ff9,
+str_1ffa,
+str_1ffb,
+str_1ffc,
+str_1ffd,
+str_1ffe,
+0, 0};
+
+static const unichar_t * const tab_20[] = {
+str_2000,
+str_2001,
+str_2002,
+str_2003,
+str_2004,
+str_2005,
+str_2006,
+str_2007,
+str_2008,
+str_2009,
+str_200a,
+0, 0, 0, 0, 0, str_2010,
+str_2011,
+str_2012,
+str_2013,
+str_2014,
+str_2015,
+str_2016,
+str_2017,
+str_2018,
+str_2019,
+0, 0, str_201c,
+str_201d,
+0, 0, 0, 0, 0, 0, str_2024,
+str_2025,
+str_2026,
+0, 0, 0, 0, 0, 0, 0, 0, str_202f,
+0, 0, str_2032,
+str_2033,
+str_2034,
+str_2035,
+str_2036,
+str_2037,
+0, str_2039,
+str_203a,
+0, str_203c,
+0, str_203e,
+0, 0, 0, 0, 0, 0, 0, 0, str_2047,
+str_2048,
+str_2049,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2057,
+0, 0, 0, 0, 0, 0, 0, str_205f,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2070,
+str_2071,
+0, 0, str_2074,
+str_2075,
+str_2076,
+str_2077,
+str_2078,
+str_2079,
+str_207a,
+str_207b,
+str_207c,
+str_207d,
+str_207e,
+str_207f,
+str_2080,
+str_2081,
+str_2082,
+str_2083,
+str_2084,
+str_2085,
+str_2086,
+str_2087,
+str_2088,
+str_2089,
+str_208a,
+str_208b,
+str_208c,
+str_208d,
+str_208e,
+0, str_2090,
+str_2091,
+str_2092,
+str_2093,
+str_2094,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_20a8,
+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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_21[] = {
+str_2100,
+str_2101,
+str_2102,
+str_2103,
+0, str_2105,
+str_2106,
+str_2107,
+0, str_2109,
+str_210a,
+str_210b,
+str_210c,
+str_210d,
+str_210e,
+str_210f,
+str_2110,
+str_2111,
+str_2112,
+str_2113,
+0, str_2115,
+str_2116,
+0, 0, str_2119,
+str_211a,
+str_211b,
+str_211c,
+str_211d,
+0, 0, str_2120,
+str_2121,
+str_2122,
+0, str_2124,
+0, str_2126,
+0, str_2128,
+0, str_212a,
+str_212b,
+str_212c,
+str_212d,
+0, str_212f,
+str_2130,
+str_2131,
+0, str_2133,
+str_2134,
+str_2135,
+str_2136,
+str_2137,
+str_2138,
+str_2139,
+0, str_213b,
+str_213c,
+str_213d,
+str_213e,
+str_213f,
+str_2140,
+0, 0, 0, 0, str_2145,
+str_2146,
+str_2147,
+str_2148,
+str_2149,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_2153,
+str_2154,
+str_2155,
+str_2156,
+str_2157,
+str_2158,
+str_2159,
+str_215a,
+str_215b,
+str_215c,
+str_215d,
+str_215e,
+str_215f,
+str_2160,
+str_2161,
+str_2162,
+str_2163,
+str_2164,
+str_2165,
+str_2166,
+str_2167,
+str_2168,
+str_2169,
+str_216a,
+str_216b,
+str_216c,
+str_216d,
+str_216e,
+str_216f,
+str_2170,
+str_2171,
+str_2172,
+str_2173,
+str_2174,
+str_2175,
+str_2176,
+str_2177,
+str_2178,
+str_2179,
+str_217a,
+str_217b,
+str_217c,
+str_217d,
+str_217e,
+str_217f,
+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, str_219a,
+str_219b,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_21ae,
+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, str_21cd,
+str_21ce,
+str_21cf,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_22[] = {
+0, 0, 0, 0, str_2204,
+str_2205,
+str_2206,
+0, 0, str_2209,
+0, 0, str_220c,
+0, 0, str_220f,
+0, str_2211,
+str_2212,
+0, 0, str_2215,
+str_2216,
+str_2217,
+str_2218,
+str_2219,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_2223,
+str_2224,
+str_2225,
+str_2226,
+0, 0, 0, 0, 0, str_222c,
+str_222d,
+0, str_222f,
+str_2230,
+0, 0, 0, 0, 0, str_2236,
+0, 0, 0, 0, 0, str_223c,
+0, 0, 0, 0, str_2241,
+0, 0, str_2244,
+0, 0, str_2247,
+0, str_2249,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2260,
+0, str_2262,
+0, 0, 0, 0, 0, 0, 0, str_226a,
+str_226b,
+0, str_226d,
+str_226e,
+str_226f,
+str_2270,
+str_2271,
+0, 0, str_2274,
+str_2275,
+0, 0, str_2278,
+str_2279,
+0, 0, 0, 0, 0, 0, str_2280,
+str_2281,
+0, 0, str_2284,
+str_2285,
+0, 0, str_2288,
+str_2289,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2299,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_22ac,
+str_22ad,
+str_22ae,
+str_22af,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_22c4,
+str_22c5,
+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, str_22e0,
+str_22e1,
+str_22e2,
+str_22e3,
+0, 0, 0, 0, 0, 0, str_22ea,
+str_22eb,
+str_22ec,
+str_22ed,
+0, str_22ef,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_23[] = {
+0, 0, 0, str_2303,
+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, 0, 0, 0, str_2329,
+str_232a,
+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, 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, 0, 0, 0, 0, str_2373,
+str_2374,
+str_2375,
+0, 0, 0, 0, str_237a,
+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, 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, 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, 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};
+
+static const unichar_t * const tab_24[] = {
+str_2400,
+str_2401,
+str_2402,
+str_2403,
+str_2404,
+str_2405,
+str_2406,
+str_2407,
+str_2408,
+str_2409,
+str_240a,
+str_240b,
+str_240c,
+str_240d,
+str_240e,
+str_240f,
+str_2410,
+str_2411,
+str_2412,
+str_2413,
+str_2414,
+str_2415,
+str_2416,
+str_2417,
+str_2418,
+str_2419,
+str_241a,
+str_241b,
+str_241c,
+str_241d,
+str_241e,
+str_241f,
+str_2420,
+str_2421,
+str_2422,
+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, 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, str_2460,
+str_2461,
+str_2462,
+str_2463,
+str_2464,
+str_2465,
+str_2466,
+str_2467,
+str_2468,
+str_2469,
+str_246a,
+str_246b,
+str_246c,
+str_246d,
+str_246e,
+str_246f,
+str_2470,
+str_2471,
+str_2472,
+str_2473,
+str_2474,
+str_2475,
+str_2476,
+str_2477,
+str_2478,
+str_2479,
+str_247a,
+str_247b,
+str_247c,
+str_247d,
+str_247e,
+str_247f,
+str_2480,
+str_2481,
+str_2482,
+str_2483,
+str_2484,
+str_2485,
+str_2486,
+str_2487,
+str_2488,
+str_2489,
+str_248a,
+str_248b,
+str_248c,
+str_248d,
+str_248e,
+str_248f,
+str_2490,
+str_2491,
+str_2492,
+str_2493,
+str_2494,
+str_2495,
+str_2496,
+str_2497,
+str_2498,
+str_2499,
+str_249a,
+str_249b,
+str_249c,
+str_249d,
+str_249e,
+str_249f,
+str_24a0,
+str_24a1,
+str_24a2,
+str_24a3,
+str_24a4,
+str_24a5,
+str_24a6,
+str_24a7,
+str_24a8,
+str_24a9,
+str_24aa,
+str_24ab,
+str_24ac,
+str_24ad,
+str_24ae,
+str_24af,
+str_24b0,
+str_24b1,
+str_24b2,
+str_24b3,
+str_24b4,
+str_24b5,
+str_24b6,
+str_24b7,
+str_24b8,
+str_24b9,
+str_24ba,
+str_24bb,
+str_24bc,
+str_24bd,
+str_24be,
+str_24bf,
+str_24c0,
+str_24c1,
+str_24c2,
+str_24c3,
+str_24c4,
+str_24c5,
+str_24c6,
+str_24c7,
+str_24c8,
+str_24c9,
+str_24ca,
+str_24cb,
+str_24cc,
+str_24cd,
+str_24ce,
+str_24cf,
+str_24d0,
+str_24d1,
+str_24d2,
+str_24d3,
+str_24d4,
+str_24d5,
+str_24d6,
+str_24d7,
+str_24d8,
+str_24d9,
+str_24da,
+str_24db,
+str_24dc,
+str_24dd,
+str_24de,
+str_24df,
+str_24e0,
+str_24e1,
+str_24e2,
+str_24e3,
+str_24e4,
+str_24e5,
+str_24e6,
+str_24e7,
+str_24e8,
+str_24e9,
+str_24ea,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_25[] = {
+str_2500,
+0, str_2502,
+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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, str_25b3,
+0, 0, 0, 0, str_25b8,
+0, 0, 0, 0, str_25bd,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_25c7,
+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, str_25e6,
+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};
+
+static const unichar_t * const tab_26[] = {
+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, 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, 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, str_2662,
+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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_27[] = {
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2731,
+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, 0, 0, 0, 0, str_2758,
+0, 0, 0, 0, 0, 0, 0, 0, 0, str_2762,
+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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_2a[] = {
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2a0c,
+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, 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, 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, 0, str_2a74,
+str_2a75,
+str_2a76,
+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, 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, 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, str_2adc,
+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, 0, 0};
+
+static const unichar_t * const tab_2c[] = {
+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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2c7c,
+str_2c7d,
+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, 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, 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, 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};
+
+static const unichar_t * const tab_2d[] = {
+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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2d6f,
+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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_2e[] = {
+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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2e9f,
+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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_2ef3,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_2f[] = {
+str_2f00,
+str_2f01,
+str_2f02,
+str_2f03,
+str_2f04,
+str_2f05,
+str_2f06,
+str_2f07,
+str_2f08,
+str_2f09,
+str_2f0a,
+str_2f0b,
+str_2f0c,
+str_2f0d,
+str_2f0e,
+str_2f0f,
+str_2f10,
+str_2f11,
+str_2f12,
+str_2f13,
+str_2f14,
+str_2f15,
+str_2f16,
+str_2f17,
+str_2f18,
+str_2f19,
+str_2f1a,
+str_2f1b,
+str_2f1c,
+str_2f1d,
+str_2f1e,
+str_2f1f,
+str_2f20,
+str_2f21,
+str_2f22,
+str_2f23,
+str_2f24,
+str_2f25,
+str_2f26,
+str_2f27,
+str_2f28,
+str_2f29,
+str_2f2a,
+str_2f2b,
+str_2f2c,
+str_2f2d,
+str_2f2e,
+str_2f2f,
+str_2f30,
+str_2f31,
+str_2f32,
+str_2f33,
+str_2f34,
+str_2f35,
+str_2f36,
+str_2f37,
+str_2f38,
+str_2f39,
+str_2f3a,
+str_2f3b,
+str_2f3c,
+str_2f3d,
+str_2f3e,
+str_2f3f,
+str_2f40,
+str_2f41,
+str_2f42,
+str_2f43,
+str_2f44,
+str_2f45,
+str_2f46,
+str_2f47,
+str_2f48,
+str_2f49,
+str_2f4a,
+str_2f4b,
+str_2f4c,
+str_2f4d,
+str_2f4e,
+str_2f4f,
+str_2f50,
+str_2f51,
+str_2f52,
+str_2f53,
+str_2f54,
+str_2f55,
+str_2f56,
+str_2f57,
+str_2f58,
+str_2f59,
+str_2f5a,
+str_2f5b,
+str_2f5c,
+str_2f5d,
+str_2f5e,
+str_2f5f,
+str_2f60,
+str_2f61,
+str_2f62,
+str_2f63,
+str_2f64,
+str_2f65,
+str_2f66,
+str_2f67,
+str_2f68,
+str_2f69,
+str_2f6a,
+str_2f6b,
+str_2f6c,
+str_2f6d,
+str_2f6e,
+str_2f6f,
+str_2f70,
+str_2f71,
+str_2f72,
+str_2f73,
+str_2f74,
+str_2f75,
+str_2f76,
+str_2f77,
+str_2f78,
+str_2f79,
+str_2f7a,
+str_2f7b,
+str_2f7c,
+str_2f7d,
+str_2f7e,
+str_2f7f,
+str_2f80,
+str_2f81,
+str_2f82,
+str_2f83,
+str_2f84,
+str_2f85,
+str_2f86,
+str_2f87,
+str_2f88,
+str_2f89,
+str_2f8a,
+str_2f8b,
+str_2f8c,
+str_2f8d,
+str_2f8e,
+str_2f8f,
+str_2f90,
+str_2f91,
+str_2f92,
+str_2f93,
+str_2f94,
+str_2f95,
+str_2f96,
+str_2f97,
+str_2f98,
+str_2f99,
+str_2f9a,
+str_2f9b,
+str_2f9c,
+str_2f9d,
+str_2f9e,
+str_2f9f,
+str_2fa0,
+str_2fa1,
+str_2fa2,
+str_2fa3,
+str_2fa4,
+str_2fa5,
+str_2fa6,
+str_2fa7,
+str_2fa8,
+str_2fa9,
+str_2faa,
+str_2fab,
+str_2fac,
+str_2fad,
+str_2fae,
+str_2faf,
+str_2fb0,
+str_2fb1,
+str_2fb2,
+str_2fb3,
+str_2fb4,
+str_2fb5,
+str_2fb6,
+str_2fb7,
+str_2fb8,
+str_2fb9,
+str_2fba,
+str_2fbb,
+str_2fbc,
+str_2fbd,
+str_2fbe,
+str_2fbf,
+str_2fc0,
+str_2fc1,
+str_2fc2,
+str_2fc3,
+str_2fc4,
+str_2fc5,
+str_2fc6,
+str_2fc7,
+str_2fc8,
+str_2fc9,
+str_2fca,
+str_2fcb,
+str_2fcc,
+str_2fcd,
+str_2fce,
+str_2fcf,
+str_2fd0,
+str_2fd1,
+str_2fd2,
+str_2fd3,
+str_2fd4,
+str_2fd5,
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_30[] = {
+str_3000,
+str_3001,
+0, 0, 0, 0, 0, 0, str_3008,
+str_3009,
+str_300a,
+str_300b,
+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, 0, 0, 0, 0, 0, 0, 0, 0, str_3036,
+0, str_3038,
+str_3039,
+str_303a,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_304c,
+0, str_304e,
+0, str_3050,
+0, str_3052,
+0, str_3054,
+0, str_3056,
+0, str_3058,
+0, str_305a,
+0, str_305c,
+0, str_305e,
+0, str_3060,
+0, str_3062,
+0, 0, str_3065,
+0, str_3067,
+0, str_3069,
+0, 0, 0, 0, 0, 0, str_3070,
+str_3071,
+0, str_3073,
+str_3074,
+0, str_3076,
+str_3077,
+0, str_3079,
+str_307a,
+0, str_307c,
+str_307d,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_3094,
+0, 0, 0, 0, 0, 0, str_309b,
+str_309c,
+0, str_309e,
+str_309f,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_30ac,
+0, str_30ae,
+0, str_30b0,
+0, str_30b2,
+0, str_30b4,
+0, str_30b6,
+0, str_30b8,
+0, str_30ba,
+0, str_30bc,
+0, str_30be,
+0, str_30c0,
+0, str_30c2,
+0, 0, str_30c5,
+0, str_30c7,
+0, str_30c9,
+0, 0, 0, 0, 0, 0, str_30d0,
+str_30d1,
+0, str_30d3,
+str_30d4,
+0, str_30d6,
+str_30d7,
+0, str_30d9,
+str_30da,
+0, str_30dc,
+str_30dd,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_30f4,
+0, 0, str_30f7,
+str_30f8,
+str_30f9,
+str_30fa,
+0, 0, 0, str_30fe,
+str_30ff,
+0};
+
+static const unichar_t * const tab_31[] = {
+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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_3131,
+str_3132,
+str_3133,
+str_3134,
+str_3135,
+str_3136,
+str_3137,
+str_3138,
+str_3139,
+str_313a,
+str_313b,
+str_313c,
+str_313d,
+str_313e,
+str_313f,
+str_3140,
+str_3141,
+str_3142,
+str_3143,
+str_3144,
+str_3145,
+str_3146,
+str_3147,
+str_3148,
+str_3149,
+str_314a,
+str_314b,
+str_314c,
+str_314d,
+str_314e,
+str_314f,
+str_3150,
+str_3151,
+str_3152,
+str_3153,
+str_3154,
+str_3155,
+str_3156,
+str_3157,
+str_3158,
+str_3159,
+str_315a,
+str_315b,
+str_315c,
+str_315d,
+str_315e,
+str_315f,
+str_3160,
+str_3161,
+str_3162,
+str_3163,
+str_3164,
+str_3165,
+str_3166,
+str_3167,
+str_3168,
+str_3169,
+str_316a,
+str_316b,
+str_316c,
+str_316d,
+str_316e,
+str_316f,
+str_3170,
+str_3171,
+str_3172,
+str_3173,
+str_3174,
+str_3175,
+str_3176,
+str_3177,
+str_3178,
+str_3179,
+str_317a,
+str_317b,
+str_317c,
+str_317d,
+str_317e,
+str_317f,
+str_3180,
+str_3181,
+str_3182,
+str_3183,
+str_3184,
+str_3185,
+str_3186,
+str_3187,
+str_3188,
+str_3189,
+str_318a,
+str_318b,
+str_318c,
+str_318d,
+str_318e,
+0, 0, 0, str_3192,
+str_3193,
+str_3194,
+str_3195,
+str_3196,
+str_3197,
+str_3198,
+str_3199,
+str_319a,
+str_319b,
+str_319c,
+str_319d,
+str_319e,
+str_319f,
+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, 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, 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};
+
+static const unichar_t * const tab_32[] = {
+str_3200,
+str_3201,
+str_3202,
+str_3203,
+str_3204,
+str_3205,
+str_3206,
+str_3207,
+str_3208,
+str_3209,
+str_320a,
+str_320b,
+str_320c,
+str_320d,
+str_320e,
+str_320f,
+str_3210,
+str_3211,
+str_3212,
+str_3213,
+str_3214,
+str_3215,
+str_3216,
+str_3217,
+str_3218,
+str_3219,
+str_321a,
+str_321b,
+str_321c,
+str_321d,
+str_321e,
+0, str_3220,
+str_3221,
+str_3222,
+str_3223,
+str_3224,
+str_3225,
+str_3226,
+str_3227,
+str_3228,
+str_3229,
+str_322a,
+str_322b,
+str_322c,
+str_322d,
+str_322e,
+str_322f,
+str_3230,
+str_3231,
+str_3232,
+str_3233,
+str_3234,
+str_3235,
+str_3236,
+str_3237,
+str_3238,
+str_3239,
+str_323a,
+str_323b,
+str_323c,
+str_323d,
+str_323e,
+str_323f,
+str_3240,
+str_3241,
+str_3242,
+str_3243,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_3250,
+str_3251,
+str_3252,
+str_3253,
+str_3254,
+str_3255,
+str_3256,
+str_3257,
+str_3258,
+str_3259,
+str_325a,
+str_325b,
+str_325c,
+str_325d,
+str_325e,
+str_325f,
+str_3260,
+str_3261,
+str_3262,
+str_3263,
+str_3264,
+str_3265,
+str_3266,
+str_3267,
+str_3268,
+str_3269,
+str_326a,
+str_326b,
+str_326c,
+str_326d,
+str_326e,
+str_326f,
+str_3270,
+str_3271,
+str_3272,
+str_3273,
+str_3274,
+str_3275,
+str_3276,
+str_3277,
+str_3278,
+str_3279,
+str_327a,
+str_327b,
+str_327c,
+str_327d,
+str_327e,
+0, str_3280,
+str_3281,
+str_3282,
+str_3283,
+str_3284,
+str_3285,
+str_3286,
+str_3287,
+str_3288,
+str_3289,
+str_328a,
+str_328b,
+str_328c,
+str_328d,
+str_328e,
+str_328f,
+str_3290,
+str_3291,
+str_3292,
+str_3293,
+str_3294,
+str_3295,
+str_3296,
+str_3297,
+str_3298,
+str_3299,
+str_329a,
+str_329b,
+str_329c,
+str_329d,
+str_329e,
+str_329f,
+str_32a0,
+str_32a1,
+str_32a2,
+str_32a3,
+str_32a4,
+str_32a5,
+str_32a6,
+str_32a7,
+str_32a8,
+str_32a9,
+str_32aa,
+str_32ab,
+str_32ac,
+str_32ad,
+str_32ae,
+str_32af,
+str_32b0,
+str_32b1,
+str_32b2,
+str_32b3,
+str_32b4,
+str_32b5,
+str_32b6,
+str_32b7,
+str_32b8,
+str_32b9,
+str_32ba,
+str_32bb,
+str_32bc,
+str_32bd,
+str_32be,
+str_32bf,
+str_32c0,
+str_32c1,
+str_32c2,
+str_32c3,
+str_32c4,
+str_32c5,
+str_32c6,
+str_32c7,
+str_32c8,
+str_32c9,
+str_32ca,
+str_32cb,
+str_32cc,
+str_32cd,
+str_32ce,
+str_32cf,
+str_32d0,
+str_32d1,
+str_32d2,
+str_32d3,
+str_32d4,
+str_32d5,
+str_32d6,
+str_32d7,
+str_32d8,
+str_32d9,
+str_32da,
+str_32db,
+str_32dc,
+str_32dd,
+str_32de,
+str_32df,
+str_32e0,
+str_32e1,
+str_32e2,
+str_32e3,
+str_32e4,
+str_32e5,
+str_32e6,
+str_32e7,
+str_32e8,
+str_32e9,
+str_32ea,
+str_32eb,
+str_32ec,
+str_32ed,
+str_32ee,
+str_32ef,
+str_32f0,
+str_32f1,
+str_32f2,
+str_32f3,
+str_32f4,
+str_32f5,
+str_32f6,
+str_32f7,
+str_32f8,
+str_32f9,
+str_32fa,
+str_32fb,
+str_32fc,
+str_32fd,
+str_32fe,
+0, 0};
+
+static const unichar_t * const tab_33[] = {
+str_3300,
+str_3301,
+str_3302,
+str_3303,
+str_3304,
+str_3305,
+str_3306,
+str_3307,
+str_3308,
+str_3309,
+str_330a,
+str_330b,
+str_330c,
+str_330d,
+str_330e,
+str_330f,
+str_3310,
+str_3311,
+str_3312,
+str_3313,
+str_3314,
+str_3315,
+str_3316,
+str_3317,
+str_3318,
+str_3319,
+str_331a,
+str_331b,
+str_331c,
+str_331d,
+str_331e,
+str_331f,
+str_3320,
+str_3321,
+str_3322,
+str_3323,
+str_3324,
+str_3325,
+str_3326,
+str_3327,
+str_3328,
+str_3329,
+str_332a,
+str_332b,
+str_332c,
+str_332d,
+str_332e,
+str_332f,
+str_3330,
+str_3331,
+str_3332,
+str_3333,
+str_3334,
+str_3335,
+str_3336,
+str_3337,
+str_3338,
+str_3339,
+str_333a,
+str_333b,
+str_333c,
+str_333d,
+str_333e,
+str_333f,
+str_3340,
+str_3341,
+str_3342,
+str_3343,
+str_3344,
+str_3345,
+str_3346,
+str_3347,
+str_3348,
+str_3349,
+str_334a,
+str_334b,
+str_334c,
+str_334d,
+str_334e,
+str_334f,
+str_3350,
+str_3351,
+str_3352,
+str_3353,
+str_3354,
+str_3355,
+str_3356,
+str_3357,
+str_3358,
+str_3359,
+str_335a,
+str_335b,
+str_335c,
+str_335d,
+str_335e,
+str_335f,
+str_3360,
+str_3361,
+str_3362,
+str_3363,
+str_3364,
+str_3365,
+str_3366,
+str_3367,
+str_3368,
+str_3369,
+str_336a,
+str_336b,
+str_336c,
+str_336d,
+str_336e,
+str_336f,
+str_3370,
+str_3371,
+str_3372,
+str_3373,
+str_3374,
+str_3375,
+str_3376,
+str_3377,
+str_3378,
+str_3379,
+str_337a,
+str_337b,
+str_337c,
+str_337d,
+str_337e,
+str_337f,
+str_3380,
+str_3381,
+str_3382,
+str_3383,
+str_3384,
+str_3385,
+str_3386,
+str_3387,
+str_3388,
+str_3389,
+str_338a,
+str_338b,
+str_338c,
+str_338d,
+str_338e,
+str_338f,
+str_3390,
+str_3391,
+str_3392,
+str_3393,
+str_3394,
+str_3395,
+str_3396,
+str_3397,
+str_3398,
+str_3399,
+str_339a,
+str_339b,
+str_339c,
+str_339d,
+str_339e,
+str_339f,
+str_33a0,
+str_33a1,
+str_33a2,
+str_33a3,
+str_33a4,
+str_33a5,
+str_33a6,
+str_33a7,
+str_33a8,
+str_33a9,
+str_33aa,
+str_33ab,
+str_33ac,
+str_33ad,
+str_33ae,
+str_33af,
+str_33b0,
+str_33b1,
+str_33b2,
+str_33b3,
+str_33b4,
+str_33b5,
+str_33b6,
+str_33b7,
+str_33b8,
+str_33b9,
+str_33ba,
+str_33bb,
+str_33bc,
+str_33bd,
+str_33be,
+str_33bf,
+str_33c0,
+str_33c1,
+str_33c2,
+str_33c3,
+str_33c4,
+str_33c5,
+str_33c6,
+str_33c7,
+str_33c8,
+str_33c9,
+str_33ca,
+str_33cb,
+str_33cc,
+str_33cd,
+str_33ce,
+str_33cf,
+str_33d0,
+str_33d1,
+str_33d2,
+str_33d3,
+str_33d4,
+str_33d5,
+str_33d6,
+str_33d7,
+str_33d8,
+str_33d9,
+str_33da,
+str_33db,
+str_33dc,
+str_33dd,
+str_33de,
+str_33df,
+str_33e0,
+str_33e1,
+str_33e2,
+str_33e3,
+str_33e4,
+str_33e5,
+str_33e6,
+str_33e7,
+str_33e8,
+str_33e9,
+str_33ea,
+str_33eb,
+str_33ec,
+str_33ed,
+str_33ee,
+str_33ef,
+str_33f0,
+str_33f1,
+str_33f2,
+str_33f3,
+str_33f4,
+str_33f5,
+str_33f6,
+str_33f7,
+str_33f8,
+str_33f9,
+str_33fa,
+str_33fb,
+str_33fc,
+str_33fd,
+str_33fe,
+str_33ff,
+0};
+
+static const unichar_t * const tab_a7[] = {
+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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_a770,
+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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_f9[] = {
+str_f900,
+str_f901,
+str_f902,
+str_f903,
+str_f904,
+str_f905,
+str_f906,
+str_f907,
+str_f908,
+str_f909,
+str_f90a,
+str_f90b,
+str_f90c,
+str_f90d,
+str_f90e,
+str_f90f,
+str_f910,
+str_f911,
+str_f912,
+str_f913,
+str_f914,
+str_f915,
+str_f916,
+str_f917,
+str_f918,
+str_f919,
+str_f91a,
+str_f91b,
+str_f91c,
+str_f91d,
+str_f91e,
+str_f91f,
+str_f920,
+str_f921,
+str_f922,
+str_f923,
+str_f924,
+str_f925,
+str_f926,
+str_f927,
+str_f928,
+str_f929,
+str_f92a,
+str_f92b,
+str_f92c,
+str_f92d,
+str_f92e,
+str_f92f,
+str_f930,
+str_f931,
+str_f932,
+str_f933,
+str_f934,
+str_f935,
+str_f936,
+str_f937,
+str_f938,
+str_f939,
+str_f93a,
+str_f93b,
+str_f93c,
+str_f93d,
+str_f93e,
+str_f93f,
+str_f940,
+str_f941,
+str_f942,
+str_f943,
+str_f944,
+str_f945,
+str_f946,
+str_f947,
+str_f948,
+str_f949,
+str_f94a,
+str_f94b,
+str_f94c,
+str_f94d,
+str_f94e,
+str_f94f,
+str_f950,
+str_f951,
+str_f952,
+str_f953,
+str_f954,
+str_f955,
+str_f956,
+str_f957,
+str_f958,
+str_f959,
+str_f95a,
+str_f95b,
+str_f95c,
+str_f95d,
+str_f95e,
+str_f95f,
+str_f960,
+str_f961,
+str_f962,
+str_f963,
+str_f964,
+str_f965,
+str_f966,
+str_f967,
+str_f968,
+str_f969,
+str_f96a,
+str_f96b,
+str_f96c,
+str_f96d,
+str_f96e,
+str_f96f,
+str_f970,
+str_f971,
+str_f972,
+str_f973,
+str_f974,
+str_f975,
+str_f976,
+str_f977,
+str_f978,
+str_f979,
+str_f97a,
+str_f97b,
+str_f97c,
+str_f97d,
+str_f97e,
+str_f97f,
+str_f980,
+str_f981,
+str_f982,
+str_f983,
+str_f984,
+str_f985,
+str_f986,
+str_f987,
+str_f988,
+str_f989,
+str_f98a,
+str_f98b,
+str_f98c,
+str_f98d,
+str_f98e,
+str_f98f,
+str_f990,
+str_f991,
+str_f992,
+str_f993,
+str_f994,
+str_f995,
+str_f996,
+str_f997,
+str_f998,
+str_f999,
+str_f99a,
+str_f99b,
+str_f99c,
+str_f99d,
+str_f99e,
+str_f99f,
+str_f9a0,
+str_f9a1,
+str_f9a2,
+str_f9a3,
+str_f9a4,
+str_f9a5,
+str_f9a6,
+str_f9a7,
+str_f9a8,
+str_f9a9,
+str_f9aa,
+str_f9ab,
+str_f9ac,
+str_f9ad,
+str_f9ae,
+str_f9af,
+str_f9b0,
+str_f9b1,
+str_f9b2,
+str_f9b3,
+str_f9b4,
+str_f9b5,
+str_f9b6,
+str_f9b7,
+str_f9b8,
+str_f9b9,
+str_f9ba,
+str_f9bb,
+str_f9bc,
+str_f9bd,
+str_f9be,
+str_f9bf,
+str_f9c0,
+str_f9c1,
+str_f9c2,
+str_f9c3,
+str_f9c4,
+str_f9c5,
+str_f9c6,
+str_f9c7,
+str_f9c8,
+str_f9c9,
+str_f9ca,
+str_f9cb,
+str_f9cc,
+str_f9cd,
+str_f9ce,
+str_f9cf,
+str_f9d0,
+str_f9d1,
+str_f9d2,
+str_f9d3,
+str_f9d4,
+str_f9d5,
+str_f9d6,
+str_f9d7,
+str_f9d8,
+str_f9d9,
+str_f9da,
+str_f9db,
+str_f9dc,
+str_f9dd,
+str_f9de,
+str_f9df,
+str_f9e0,
+str_f9e1,
+str_f9e2,
+str_f9e3,
+str_f9e4,
+str_f9e5,
+str_f9e6,
+str_f9e7,
+str_f9e8,
+str_f9e9,
+str_f9ea,
+str_f9eb,
+str_f9ec,
+str_f9ed,
+str_f9ee,
+str_f9ef,
+str_f9f0,
+str_f9f1,
+str_f9f2,
+str_f9f3,
+str_f9f4,
+str_f9f5,
+str_f9f6,
+str_f9f7,
+str_f9f8,
+str_f9f9,
+str_f9fa,
+str_f9fb,
+str_f9fc,
+str_f9fd,
+str_f9fe,
+str_f9ff,
+0};
+
+static const unichar_t * const tab_fa[] = {
+str_fa00,
+str_fa01,
+str_fa02,
+str_fa03,
+str_fa04,
+str_fa05,
+str_fa06,
+str_fa07,
+str_fa08,
+str_fa09,
+str_fa0a,
+str_fa0b,
+str_fa0c,
+str_fa0d,
+0, 0, str_fa10,
+0, str_fa12,
+0, 0, str_fa15,
+str_fa16,
+str_fa17,
+str_fa18,
+str_fa19,
+str_fa1a,
+str_fa1b,
+str_fa1c,
+str_fa1d,
+str_fa1e,
+0, str_fa20,
+0, str_fa22,
+0, 0, str_fa25,
+str_fa26,
+0, 0, 0, str_fa2a,
+str_fa2b,
+str_fa2c,
+str_fa2d,
+0, 0, str_fa30,
+str_fa31,
+str_fa32,
+str_fa33,
+str_fa34,
+str_fa35,
+str_fa36,
+str_fa37,
+str_fa38,
+str_fa39,
+str_fa3a,
+str_fa3b,
+str_fa3c,
+str_fa3d,
+str_fa3e,
+str_fa3f,
+str_fa40,
+str_fa41,
+str_fa42,
+str_fa43,
+str_fa44,
+str_fa45,
+str_fa46,
+str_fa47,
+str_fa48,
+str_fa49,
+str_fa4a,
+str_fa4b,
+str_fa4c,
+str_fa4d,
+str_fa4e,
+str_fa4f,
+str_fa50,
+str_fa51,
+str_fa52,
+str_fa53,
+str_fa54,
+str_fa55,
+str_fa56,
+str_fa57,
+str_fa58,
+str_fa59,
+str_fa5a,
+str_fa5b,
+str_fa5c,
+str_fa5d,
+str_fa5e,
+str_fa5f,
+str_fa60,
+str_fa61,
+str_fa62,
+str_fa63,
+str_fa64,
+str_fa65,
+str_fa66,
+str_fa67,
+str_fa68,
+str_fa69,
+str_fa6a,
+0, 0, 0, 0, 0, str_fa70,
+str_fa71,
+str_fa72,
+str_fa73,
+str_fa74,
+str_fa75,
+str_fa76,
+str_fa77,
+str_fa78,
+str_fa79,
+str_fa7a,
+str_fa7b,
+str_fa7c,
+str_fa7d,
+str_fa7e,
+str_fa7f,
+str_fa80,
+str_fa81,
+str_fa82,
+str_fa83,
+str_fa84,
+str_fa85,
+str_fa86,
+str_fa87,
+str_fa88,
+str_fa89,
+str_fa8a,
+str_fa8b,
+str_fa8c,
+str_fa8d,
+str_fa8e,
+str_fa8f,
+str_fa90,
+str_fa91,
+str_fa92,
+str_fa93,
+str_fa94,
+str_fa95,
+str_fa96,
+str_fa97,
+str_fa98,
+str_fa99,
+str_fa9a,
+str_fa9b,
+str_fa9c,
+str_fa9d,
+str_fa9e,
+str_fa9f,
+str_faa0,
+str_faa1,
+str_faa2,
+str_faa3,
+str_faa4,
+str_faa5,
+str_faa6,
+str_faa7,
+str_faa8,
+str_faa9,
+str_faaa,
+str_faab,
+str_faac,
+str_faad,
+str_faae,
+str_faaf,
+str_fab0,
+str_fab1,
+str_fab2,
+str_fab3,
+str_fab4,
+str_fab5,
+str_fab6,
+str_fab7,
+str_fab8,
+str_fab9,
+str_faba,
+str_fabb,
+str_fabc,
+str_fabd,
+str_fabe,
+str_fabf,
+str_fac0,
+str_fac1,
+str_fac2,
+str_fac3,
+str_fac4,
+str_fac5,
+str_fac6,
+str_fac7,
+str_fac8,
+str_fac9,
+str_faca,
+str_facb,
+str_facc,
+str_facd,
+str_face,
+str_facf,
+str_fad0,
+str_fad1,
+str_fad2,
+str_fad3,
+str_fad4,
+str_fad5,
+str_fad6,
+str_fad7,
+str_fad8,
+str_fad9,
+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, 0, 0, 0, 0, 0};
+
+static const unichar_t * const tab_fb[] = {
+str_fb00,
+str_fb01,
+str_fb02,
+str_fb03,
+str_fb04,
+str_fb05,
+str_fb06,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_fb13,
+str_fb14,
+str_fb15,
+str_fb16,
+str_fb17,
+0, 0, 0, 0, 0, str_fb1d,
+0, str_fb1f,
+str_fb20,
+str_fb21,
+str_fb22,
+str_fb23,
+str_fb24,
+str_fb25,
+str_fb26,
+str_fb27,
+str_fb28,
+str_fb29,
+str_fb2a,
+str_fb2b,
+str_fb2c,
+str_fb2d,
+str_fb2e,
+str_fb2f,
+str_fb30,
+str_fb31,
+str_fb32,
+str_fb33,
+str_fb34,
+str_fb35,
+str_fb36,
+0, str_fb38,
+str_fb39,
+str_fb3a,
+str_fb3b,
+str_fb3c,
+0, str_fb3e,
+0, str_fb40,
+str_fb41,
+0, str_fb43,
+str_fb44,
+0, str_fb46,
+str_fb47,
+str_fb48,
+str_fb49,
+str_fb4a,
+str_fb4b,
+str_fb4c,
+str_fb4d,
+str_fb4e,
+str_fb4f,
+str_fb50,
+str_fb51,
+str_fb52,
+str_fb53,
+str_fb54,
+str_fb55,
+str_fb56,
+str_fb57,
+str_fb58,
+str_fb59,
+str_fb5a,
+str_fb5b,
+str_fb5c,
+str_fb5d,
+str_fb5e,
+str_fb5f,
+str_fb60,
+str_fb61,
+str_fb62,
+str_fb63,
+str_fb64,
+str_fb65,
+str_fb66,
+str_fb67,
+str_fb68,
+str_fb69,
+str_fb6a,
+str_fb6b,
+str_fb6c,
+str_fb6d,
+str_fb6e,
+str_fb6f,
+str_fb70,
+str_fb71,
+str_fb72,
+str_fb73,
+str_fb74,
+str_fb75,
+str_fb76,
+str_fb77,
+str_fb78,
+str_fb79,
+str_fb7a,
+str_fb7b,
+str_fb7c,
+str_fb7d,
+str_fb7e,
+str_fb7f,
+str_fb80,
+str_fb81,
+str_fb82,
+str_fb83,
+str_fb84,
+str_fb85,
+str_fb86,
+str_fb87,
+str_fb88,
+str_fb89,
+str_fb8a,
+str_fb8b,
+str_fb8c,
+str_fb8d,
+str_fb8e,
+str_fb8f,
+str_fb90,
+str_fb91,
+str_fb92,
+str_fb93,
+str_fb94,
+str_fb95,
+str_fb96,
+str_fb97,
+str_fb98,
+str_fb99,
+str_fb9a,
+str_fb9b,
+str_fb9c,
+str_fb9d,
+str_fb9e,
+str_fb9f,
+str_fba0,
+str_fba1,
+str_fba2,
+str_fba3,
+str_fba4,
+str_fba5,
+str_fba6,
+str_fba7,
+str_fba8,
+str_fba9,
+str_fbaa,
+str_fbab,
+str_fbac,
+str_fbad,
+str_fbae,
+str_fbaf,
+str_fbb0,
+str_fbb1,
+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, str_fbd3,
+str_fbd4,
+str_fbd5,
+str_fbd6,
+str_fbd7,
+str_fbd8,
+str_fbd9,
+str_fbda,
+str_fbdb,
+str_fbdc,
+str_fbdd,
+str_fbde,
+str_fbdf,
+str_fbe0,
+str_fbe1,
+str_fbe2,
+str_fbe3,
+str_fbe4,
+str_fbe5,
+str_fbe6,
+str_fbe7,
+str_fbe8,
+str_fbe9,
+str_fbea,
+str_fbeb,
+str_fbec,
+str_fbed,
+str_fbee,
+str_fbef,
+str_fbf0,
+str_fbf1,
+str_fbf2,
+str_fbf3,
+str_fbf4,
+str_fbf5,
+str_fbf6,
+str_fbf7,
+str_fbf8,
+str_fbf9,
+str_fbfa,
+str_fbfb,
+str_fbfc,
+str_fbfd,
+str_fbfe,
+str_fbff,
+0};
+
+static const unichar_t * const tab_fc[] = {
+str_fc00,
+str_fc01,
+str_fc02,
+str_fc03,
+str_fc04,
+str_fc05,
+str_fc06,
+str_fc07,
+str_fc08,
+str_fc09,
+str_fc0a,
+str_fc0b,
+str_fc0c,
+str_fc0d,
+str_fc0e,
+str_fc0f,
+str_fc10,
+str_fc11,
+str_fc12,
+str_fc13,
+str_fc14,
+str_fc15,
+str_fc16,
+str_fc17,
+str_fc18,
+str_fc19,
+str_fc1a,
+str_fc1b,
+str_fc1c,
+str_fc1d,
+str_fc1e,
+str_fc1f,
+str_fc20,
+str_fc21,
+str_fc22,
+str_fc23,
+str_fc24,
+str_fc25,
+str_fc26,
+str_fc27,
+str_fc28,
+str_fc29,
+str_fc2a,
+str_fc2b,
+str_fc2c,
+str_fc2d,
+str_fc2e,
+str_fc2f,
+str_fc30,
+str_fc31,
+str_fc32,
+str_fc33,
+str_fc34,
+str_fc35,
+str_fc36,
+str_fc37,
+str_fc38,
+str_fc39,
+str_fc3a,
+str_fc3b,
+str_fc3c,
+str_fc3d,
+str_fc3e,
+str_fc3f,
+str_fc40,
+str_fc41,
+str_fc42,
+str_fc43,
+str_fc44,
+str_fc45,
+str_fc46,
+str_fc47,
+str_fc48,
+str_fc49,
+str_fc4a,
+str_fc4b,
+str_fc4c,
+str_fc4d,
+str_fc4e,
+str_fc4f,
+str_fc50,
+str_fc51,
+str_fc52,
+str_fc53,
+str_fc54,
+str_fc55,
+str_fc56,
+str_fc57,
+str_fc58,
+str_fc59,
+str_fc5a,
+str_fc5b,
+str_fc5c,
+str_fc5d,
+str_fc5e,
+str_fc5f,
+str_fc60,
+str_fc61,
+str_fc62,
+str_fc63,
+str_fc64,
+str_fc65,
+str_fc66,
+str_fc67,
+str_fc68,
+str_fc69,
+str_fc6a,
+str_fc6b,
+str_fc6c,
+str_fc6d,
+str_fc6e,
+str_fc6f,
+str_fc70,
+str_fc71,
+str_fc72,
+str_fc73,
+str_fc74,
+str_fc75,
+str_fc76,
+str_fc77,
+str_fc78,
+str_fc79,
+str_fc7a,
+str_fc7b,
+str_fc7c,
+str_fc7d,
+str_fc7e,
+str_fc7f,
+str_fc80,
+str_fc81,
+str_fc82,
+str_fc83,
+str_fc84,
+str_fc85,
+str_fc86,
+str_fc87,
+str_fc88,
+str_fc89,
+str_fc8a,
+str_fc8b,
+str_fc8c,
+str_fc8d,
+str_fc8e,
+str_fc8f,
+str_fc90,
+str_fc91,
+str_fc92,
+str_fc93,
+str_fc94,
+str_fc95,
+str_fc96,
+str_fc97,
+str_fc98,
+str_fc99,
+str_fc9a,
+str_fc9b,
+str_fc9c,
+str_fc9d,
+str_fc9e,
+str_fc9f,
+str_fca0,
+str_fca1,
+str_fca2,
+str_fca3,
+str_fca4,
+str_fca5,
+str_fca6,
+str_fca7,
+str_fca8,
+str_fca9,
+str_fcaa,
+str_fcab,
+str_fcac,
+str_fcad,
+str_fcae,
+str_fcaf,
+str_fcb0,
+str_fcb1,
+str_fcb2,
+str_fcb3,
+str_fcb4,
+str_fcb5,
+str_fcb6,
+str_fcb7,
+str_fcb8,
+str_fcb9,
+str_fcba,
+str_fcbb,
+str_fcbc,
+str_fcbd,
+str_fcbe,
+str_fcbf,
+str_fcc0,
+str_fcc1,
+str_fcc2,
+str_fcc3,
+str_fcc4,
+str_fcc5,
+str_fcc6,
+str_fcc7,
+str_fcc8,
+str_fcc9,
+str_fcca,
+str_fccb,
+str_fccc,
+str_fccd,
+str_fcce,
+str_fccf,
+str_fcd0,
+str_fcd1,
+str_fcd2,
+str_fcd3,
+str_fcd4,
+str_fcd5,
+str_fcd6,
+str_fcd7,
+str_fcd8,
+str_fcd9,
+str_fcda,
+str_fcdb,
+str_fcdc,
+str_fcdd,
+str_fcde,
+str_fcdf,
+str_fce0,
+str_fce1,
+str_fce2,
+str_fce3,
+str_fce4,
+str_fce5,
+str_fce6,
+str_fce7,
+str_fce8,
+str_fce9,
+str_fcea,
+str_fceb,
+str_fcec,
+str_fced,
+str_fcee,
+str_fcef,
+str_fcf0,
+str_fcf1,
+str_fcf2,
+str_fcf3,
+str_fcf4,
+str_fcf5,
+str_fcf6,
+str_fcf7,
+str_fcf8,
+str_fcf9,
+str_fcfa,
+str_fcfb,
+str_fcfc,
+str_fcfd,
+str_fcfe,
+str_fcff,
+0};
+
+static const unichar_t * const tab_fd[] = {
+str_fd00,
+str_fd01,
+str_fd02,
+str_fd03,
+str_fd04,
+str_fd05,
+str_fd06,
+str_fd07,
+str_fd08,
+str_fd09,
+str_fd0a,
+str_fd0b,
+str_fd0c,
+str_fd0d,
+str_fd0e,
+str_fd0f,
+str_fd10,
+str_fd11,
+str_fd12,
+str_fd13,
+str_fd14,
+str_fd15,
+str_fd16,
+str_fd17,
+str_fd18,
+str_fd19,
+str_fd1a,
+str_fd1b,
+str_fd1c,
+str_fd1d,
+str_fd1e,
+str_fd1f,
+str_fd20,
+str_fd21,
+str_fd22,
+str_fd23,
+str_fd24,
+str_fd25,
+str_fd26,
+str_fd27,
+str_fd28,
+str_fd29,
+str_fd2a,
+str_fd2b,
+str_fd2c,
+str_fd2d,
+str_fd2e,
+str_fd2f,
+str_fd30,
+str_fd31,
+str_fd32,
+str_fd33,
+str_fd34,
+str_fd35,
+str_fd36,
+str_fd37,
+str_fd38,
+str_fd39,
+str_fd3a,
+str_fd3b,
+str_fd3c,
+str_fd3d,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_fd50,
+str_fd51,
+str_fd52,
+str_fd53,
+str_fd54,
+str_fd55,
+str_fd56,
+str_fd57,
+str_fd58,
+str_fd59,
+str_fd5a,
+str_fd5b,
+str_fd5c,
+str_fd5d,
+str_fd5e,
+str_fd5f,
+str_fd60,
+str_fd61,
+str_fd62,
+str_fd63,
+str_fd64,
+str_fd65,
+str_fd66,
+str_fd67,
+str_fd68,
+str_fd69,
+str_fd6a,
+str_fd6b,
+str_fd6c,
+str_fd6d,
+str_fd6e,
+str_fd6f,
+str_fd70,
+str_fd71,
+str_fd72,
+str_fd73,
+str_fd74,
+str_fd75,
+str_fd76,
+str_fd77,
+str_fd78,
+str_fd79,
+str_fd7a,
+str_fd7b,
+str_fd7c,
+str_fd7d,
+str_fd7e,
+str_fd7f,
+str_fd80,
+str_fd81,
+str_fd82,
+str_fd83,
+str_fd84,
+str_fd85,
+str_fd86,
+str_fd87,
+str_fd88,
+str_fd89,
+str_fd8a,
+str_fd8b,
+str_fd8c,
+str_fd8d,
+str_fd8e,
+str_fd8f,
+0, 0, str_fd92,
+str_fd93,
+str_fd94,
+str_fd95,
+str_fd96,
+str_fd97,
+str_fd98,
+str_fd99,
+str_fd9a,
+str_fd9b,
+str_fd9c,
+str_fd9d,
+str_fd9e,
+str_fd9f,
+str_fda0,
+str_fda1,
+str_fda2,
+str_fda3,
+str_fda4,
+str_fda5,
+str_fda6,
+str_fda7,
+str_fda8,
+str_fda9,
+str_fdaa,
+str_fdab,
+str_fdac,
+str_fdad,
+str_fdae,
+str_fdaf,
+str_fdb0,
+str_fdb1,
+str_fdb2,
+str_fdb3,
+str_fdb4,
+str_fdb5,
+str_fdb6,
+str_fdb7,
+str_fdb8,
+str_fdb9,
+str_fdba,
+str_fdbb,
+str_fdbc,
+str_fdbd,
+str_fdbe,
+str_fdbf,
+str_fdc0,
+str_fdc1,
+str_fdc2,
+str_fdc3,
+str_fdc4,
+str_fdc5,
+str_fdc6,
+str_fdc7,
+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, 0, 0, 0, 0, 0, 0, str_fdf0,
+str_fdf1,
+str_fdf2,
+str_fdf3,
+str_fdf4,
+str_fdf5,
+str_fdf6,
+str_fdf7,
+str_fdf8,
+str_fdf9,
+str_fdfa,
+str_fdfb,
+str_fdfc,
+0, 0, 0, 0};
+
+static const unichar_t * const tab_fe[] = {
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_fe10,
+str_fe11,
+str_fe12,
+str_fe13,
+str_fe14,
+str_fe15,
+str_fe16,
+str_fe17,
+str_fe18,
+str_fe19,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, str_fe30,
+str_fe31,
+str_fe32,
+str_fe33,
+str_fe34,
+str_fe35,
+str_fe36,
+str_fe37,
+str_fe38,
+str_fe39,
+str_fe3a,
+str_fe3b,
+str_fe3c,
+str_fe3d,
+str_fe3e,
+str_fe3f,
+str_fe40,
+str_fe41,
+str_fe42,
+str_fe43,
+str_fe44,
+0, 0, str_fe47,
+str_fe48,
+str_fe49,
+str_fe4a,
+str_fe4b,
+str_fe4c,
+str_fe4d,
+str_fe4e,
+str_fe4f,
+str_fe50,
+str_fe51,
+str_fe52,
+0, str_fe54,
+str_fe55,
+str_fe56,
+str_fe57,
+str_fe58,
+str_fe59,
+str_fe5a,
+str_fe5b,
+str_fe5c,
+str_fe5d,
+str_fe5e,
+str_fe5f,
+str_fe60,
+str_fe61,
+str_fe62,
+str_fe63,
+str_fe64,
+str_fe65,
+str_fe66,
+0, str_fe68,
+str_fe69,
+str_fe6a,
+str_fe6b,
+0, 0, 0, 0, str_fe70,
+str_fe71,
+str_fe72,
+0, str_fe74,
+0, str_fe76,
+str_fe77,
+str_fe78,
+str_fe79,
+str_fe7a,
+str_fe7b,
+str_fe7c,
+str_fe7d,
+str_fe7e,
+str_fe7f,
+str_fe80,
+str_fe81,
+str_fe82,
+str_fe83,
+str_fe84,
+str_fe85,
+str_fe86,
+str_fe87,
+str_fe88,
+str_fe89,
+str_fe8a,
+str_fe8b,
+str_fe8c,
+str_fe8d,
+str_fe8e,
+str_fe8f,
+str_fe90,
+str_fe91,
+str_fe92,
+str_fe93,
+str_fe94,
+str_fe95,
+str_fe96,
+str_fe97,
+str_fe98,
+str_fe99,
+str_fe9a,
+str_fe9b,
+str_fe9c,
+str_fe9d,
+str_fe9e,
+str_fe9f,
+str_fea0,
+str_fea1,
+str_fea2,
+str_fea3,
+str_fea4,
+str_fea5,
+str_fea6,
+str_fea7,
+str_fea8,
+str_fea9,
+str_feaa,
+str_feab,
+str_feac,
+str_fead,
+str_feae,
+str_feaf,
+str_feb0,
+str_feb1,
+str_feb2,
+str_feb3,
+str_feb4,
+str_feb5,
+str_feb6,
+str_feb7,
+str_feb8,
+str_feb9,
+str_feba,
+str_febb,
+str_febc,
+str_febd,
+str_febe,
+str_febf,
+str_fec0,
+str_fec1,
+str_fec2,
+str_fec3,
+str_fec4,
+str_fec5,
+str_fec6,
+str_fec7,
+str_fec8,
+str_fec9,
+str_feca,
+str_fecb,
+str_fecc,
+str_fecd,
+str_fece,
+str_fecf,
+str_fed0,
+str_fed1,
+str_fed2,
+str_fed3,
+str_fed4,
+str_fed5,
+str_fed6,
+str_fed7,
+str_fed8,
+str_fed9,
+str_feda,
+str_fedb,
+str_fedc,
+str_fedd,
+str_fede,
+str_fedf,
+str_fee0,
+str_fee1,
+str_fee2,
+str_fee3,
+str_fee4,
+str_fee5,
+str_fee6,
+str_fee7,
+str_fee8,
+str_fee9,
+str_feea,
+str_feeb,
+str_feec,
+str_feed,
+str_feee,
+str_feef,
+str_fef0,
+str_fef1,
+str_fef2,
+str_fef3,
+str_fef4,
+str_fef5,
+str_fef6,
+str_fef7,
+str_fef8,
+str_fef9,
+str_fefa,
+str_fefb,
+str_fefc,
+0, 0, 0, 0};
+
+static const unichar_t * const tab_ff[] = {
+0, str_ff01,
+str_ff02,
+str_ff03,
+str_ff04,
+str_ff05,
+str_ff06,
+str_ff07,
+str_ff08,
+str_ff09,
+str_ff0a,
+str_ff0b,
+str_ff0c,
+str_ff0d,
+str_ff0e,
+str_ff0f,
+str_ff10,
+str_ff11,
+str_ff12,
+str_ff13,
+str_ff14,
+str_ff15,
+str_ff16,
+str_ff17,
+str_ff18,
+str_ff19,
+str_ff1a,
+str_ff1b,
+str_ff1c,
+str_ff1d,
+str_ff1e,
+str_ff1f,
+str_ff20,
+str_ff21,
+str_ff22,
+str_ff23,
+str_ff24,
+str_ff25,
+str_ff26,
+str_ff27,
+str_ff28,
+str_ff29,
+str_ff2a,
+str_ff2b,
+str_ff2c,
+str_ff2d,
+str_ff2e,
+str_ff2f,
+str_ff30,
+str_ff31,
+str_ff32,
+str_ff33,
+str_ff34,
+str_ff35,
+str_ff36,
+str_ff37,
+str_ff38,
+str_ff39,
+str_ff3a,
+str_ff3b,
+str_ff3c,
+str_ff3d,
+str_ff3e,
+str_ff3f,
+str_ff40,
+str_ff41,
+str_ff42,
+str_ff43,
+str_ff44,
+str_ff45,
+str_ff46,
+str_ff47,
+str_ff48,
+str_ff49,
+str_ff4a,
+str_ff4b,
+str_ff4c,
+str_ff4d,
+str_ff4e,
+str_ff4f,
+str_ff50,
+str_ff51,
+str_ff52,
+str_ff53,
+str_ff54,
+str_ff55,
+str_ff56,
+str_ff57,
+str_ff58,
+str_ff59,
+str_ff5a,
+str_ff5b,
+str_ff5c,
+str_ff5d,
+str_ff5e,
+str_ff5f,
+str_ff60,
+str_ff61,
+str_ff62,
+str_ff63,
+str_ff64,
+str_ff65,
+str_ff66,
+str_ff67,
+str_ff68,
+str_ff69,
+str_ff6a,
+str_ff6b,
+str_ff6c,
+str_ff6d,
+str_ff6e,
+str_ff6f,
+str_ff70,
+str_ff71,
+str_ff72,
+str_ff73,
+str_ff74,
+str_ff75,
+str_ff76,
+str_ff77,
+str_ff78,
+str_ff79,
+str_ff7a,
+str_ff7b,
+str_ff7c,
+str_ff7d,
+str_ff7e,
+str_ff7f,
+str_ff80,
+str_ff81,
+str_ff82,
+str_ff83,
+str_ff84,
+str_ff85,
+str_ff86,
+str_ff87,
+str_ff88,
+str_ff89,
+str_ff8a,
+str_ff8b,
+str_ff8c,
+str_ff8d,
+str_ff8e,
+str_ff8f,
+str_ff90,
+str_ff91,
+str_ff92,
+str_ff93,
+str_ff94,
+str_ff95,
+str_ff96,
+str_ff97,
+str_ff98,
+str_ff99,
+str_ff9a,
+str_ff9b,
+str_ff9c,
+str_ff9d,
+str_ff9e,
+str_ff9f,
+str_ffa0,
+str_ffa1,
+str_ffa2,
+str_ffa3,
+str_ffa4,
+str_ffa5,
+str_ffa6,
+str_ffa7,
+str_ffa8,
+str_ffa9,
+str_ffaa,
+str_ffab,
+str_ffac,
+str_ffad,
+str_ffae,
+str_ffaf,
+str_ffb0,
+str_ffb1,
+str_ffb2,
+str_ffb3,
+str_ffb4,
+str_ffb5,
+str_ffb6,
+str_ffb7,
+str_ffb8,
+str_ffb9,
+str_ffba,
+str_ffbb,
+str_ffbc,
+str_ffbd,
+str_ffbe,
+0, 0, 0, str_ffc2,
+str_ffc3,
+str_ffc4,
+str_ffc5,
+str_ffc6,
+str_ffc7,
+0, 0, str_ffca,
+str_ffcb,
+str_ffcc,
+str_ffcd,
+str_ffce,
+str_ffcf,
+0, 0, str_ffd2,
+str_ffd3,
+str_ffd4,
+str_ffd5,
+str_ffd6,
+str_ffd7,
+0, 0, str_ffda,
+str_ffdb,
+str_ffdc,
+0, 0, 0, str_ffe0,
+str_ffe1,
+str_ffe2,
+str_ffe3,
+str_ffe4,
+str_ffe5,
+str_ffe6,
+0, str_ffe8,
+str_ffe9,
+str_ffea,
+str_ffeb,
+str_ffec,
+str_ffed,
+str_ffee,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+const unichar_t *const * const unicode_alternates[] = {
+tab_0,
+tab_1,
+tab_2,
+tab_3,
+tab_4,
+tab_5,
+tab_6,
+up_allzeros, up_allzeros, tab_9,
+tab_a,
+tab_b,
+tab_c,
+tab_d,
+tab_e,
+tab_f,
+tab_10,
+tab_11,
+up_allzeros, tab_13,
+up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, tab_1b,
+up_allzeros, tab_1d,
+tab_1e,
+tab_1f,
+tab_20,
+tab_21,
+tab_22,
+tab_23,
+tab_24,
+tab_25,
+tab_26,
+tab_27,
+up_allzeros, up_allzeros, tab_2a,
+up_allzeros, tab_2c,
+tab_2d,
+tab_2e,
+tab_2f,
+tab_30,
+tab_31,
+tab_32,
+tab_33,
+up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, tab_a7,
+up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, up_allzeros, tab_f9,
+tab_fa,
+tab_fb,
+tab_fc,
+tab_fd,
+tab_fe,
+tab_ff,
+0};
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/ustring.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ustring.c
index be4f2d46018..b11b8400635 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/Unicode/ustring.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/ustring.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -28,14 +28,6 @@
#include "ustring.h"
#include "utype.h"
-#ifdef LUA_FF_LIB
-extern int unic_tolower(int);
-#define Tolower unic_tolower
-#else
-#define Tolower tolower
-#endif
-
-
long uc_strcmp(const unichar_t *str1,const char *str2) {
long ch1, ch2;
for (;;) {
@@ -59,8 +51,8 @@ long uc_strmatch(const unichar_t *str1, const char *str2) {
long ch1, ch2;
for (;;) {
ch1 = *str1++; ch2 = *(unsigned char *) str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' )
return(ch1-ch2);
}
@@ -70,8 +62,8 @@ long uc_strnmatch(const unichar_t *str1, const char *str2, int len) {
long ch1, ch2;
for (;--len>=0;) {
ch1 = *str1++; ch2 = *(unsigned char *) str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' || len<=0 )
return(ch1-ch2);
}
@@ -82,8 +74,8 @@ long u_strnmatch(const unichar_t *str1, const unichar_t *str2, int len) {
long ch1, ch2;
for (;--len>=0;) {
ch1 = *str1++; ch2 = *str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' || len<=0 )
return(ch1-ch2);
}
@@ -113,8 +105,8 @@ long u_strmatch(const unichar_t *str1, const unichar_t *str2) {
long ch1, ch2;
for (;;) {
ch1 = *str1++; ch2 = *str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' )
return(ch1-ch2);
}
@@ -256,8 +248,8 @@ unichar_t *uc_strstrmatch(const unichar_t *longer, const char *substr) {
str1 = lpt; str2 = (unsigned char *) substr;
for (;;) {
ch1 = *str1++; ch2 = *str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch2=='\0' )
return((unichar_t *) lpt);
if ( ch1!=ch2 )
@@ -275,8 +267,8 @@ unichar_t *u_strstrmatch(const unichar_t *longer, const unichar_t *substr) {
str1 = lpt; str2 = substr;
for (;;) {
ch1 = *str1++; ch2 = *str2++ ;
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch2=='\0' )
return((unichar_t *) lpt);
if ( ch1!=ch2 )
@@ -447,7 +439,7 @@ return( val );
unichar_t *cu_strstartmatch(const char *key,const unichar_t *str) {
if ( key && str ) {
while( *key ) {
- if(Tolower(*key) != Tolower(*str))
+ if(tolower(*key) != tolower(*str))
return 0;
key++;
str++;
@@ -462,8 +454,8 @@ unichar_t *u_strstartmatch(const unichar_t *initial, const unichar_t *full) {
ch1 = *initial++; ch2 = *full++ ;
if ( ch1=='\0' )
return( (unichar_t *) full );
- ch1 = Tolower(ch1);
- ch2 = Tolower(ch2);
+ ch1 = tolower(ch1);
+ ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' )
return(NULL);
}
@@ -511,6 +503,7 @@ unichar_t *utf82u_strncpy(unichar_t *ubuf,const char *utf8buf,int len) {
w = (w<<6) | ((pt[1]&0xf)<<2) | ((pt[2]&0x30)>>4);
w2 = ((pt[2]&0xf)<<6) | (pt[3]&0x3f);
*upt = w*0x400 + w2 + 0x10000;
+ pt += 4;
#endif
}
++upt;
@@ -678,6 +671,18 @@ char *u2utf8_strcpy(char *utf8buf,const unichar_t *ubuf) {
return( utf8buf );
}
+char *utf8_strchr(const char *str, int search) {
+ int ch;
+ const char *old = str;
+
+ while ( (ch = utf8_ildb(&str))!=0 ) {
+ if ( ch==search )
+return( (char *) old );
+ old = str;
+ }
+return( NULL );
+}
+
char *latin1_2_utf8_strcpy(char *utf8buf,const char *lbuf) {
char *pt = utf8buf;
const unsigned char *lpt = (const unsigned char *) lbuf;
@@ -866,7 +871,7 @@ int utf8_strlen(const char *utf8_str) {
/* how many characters in the string NOT bytes */
int len = 0;
- while ( utf8_ildb(&utf8_str)!=0 )
+ while ( utf8_ildb(&utf8_str)>0 )
++len;
return( len );
}
@@ -876,7 +881,7 @@ int utf82u_strlen(const char *utf8_str) {
int ch;
int len = 0;
- while ( (ch = utf8_ildb(&utf8_str))!=0 )
+ while ( (ch = utf8_ildb(&utf8_str))>0 )
if ( ch>0x10000 )
len += 2;
else
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/utype.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/utype.c
new file mode 100644
index 00000000000..84ecdbe32c1
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/Unicode/utype.c
@@ -0,0 +1,24588 @@
+#include "utype.h"
+
+const unsigned short ____tolower[]= { 0,
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
+ 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
+ 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+ 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+ 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+ 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+ 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
+ 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
+ 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7,
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
+ 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, 0x0107,
+ 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, 0x010f,
+ 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, 0x0117,
+ 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, 0x011f,
+ 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, 0x0127,
+ 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, 0x012f,
+ 0x0069, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, 0x0137,
+ 0x0138, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140,
+ 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148,
+ 0x0148, 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f,
+ 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157,
+ 0x0159, 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f,
+ 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167,
+ 0x0169, 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f,
+ 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177,
+ 0x00ff, 0x017a, 0x017a, 0x017c, 0x017c, 0x017e, 0x017e, 0x017f,
+ 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188,
+ 0x0188, 0x0256, 0x0257, 0x018c, 0x018c, 0x018d, 0x01dd, 0x0259,
+ 0x025b, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268,
+ 0x0199, 0x0199, 0x019a, 0x019b, 0x026f, 0x0272, 0x019e, 0x0275,
+ 0x01a1, 0x01a1, 0x01a3, 0x01a3, 0x01a5, 0x01a5, 0x0280, 0x01a8,
+ 0x01a8, 0x0283, 0x01aa, 0x01ab, 0x01ad, 0x01ad, 0x0288, 0x01b0,
+ 0x01b0, 0x028a, 0x028b, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x0292,
+ 0x01b9, 0x01b9, 0x01ba, 0x01bb, 0x01bd, 0x01bd, 0x01be, 0x01bf,
+ 0x01c0, 0x01c1, 0x01c2, 0x01c3, 0x01c6, 0x01c6, 0x01c6, 0x01c9,
+ 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0,
+ 0x01d0, 0x01d2, 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8,
+ 0x01d8, 0x01da, 0x01da, 0x01dc, 0x01dc, 0x01dd, 0x01df, 0x01df,
+ 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01ef,
+ 0x01f0, 0x01f3, 0x01f3, 0x01f3, 0x01f5, 0x01f5, 0x0195, 0x01bf,
+ 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff,
+ 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207,
+ 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f,
+ 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217,
+ 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f,
+ 0x019e, 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227,
+ 0x0229, 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f,
+ 0x0231, 0x0231, 0x0233, 0x0233, 0x0234, 0x0235, 0x0236, 0x0237,
+ 0x0238, 0x0239, 0x2c65, 0x023c, 0x023c, 0x019a, 0x2c66, 0x023f,
+ 0x0240, 0x0242, 0x0242, 0x0180, 0x0289, 0x028c, 0x0247, 0x0247,
+ 0x0249, 0x0249, 0x024b, 0x024b, 0x024d, 0x024d, 0x024f, 0x024f,
+ 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257,
+ 0x0258, 0x0259, 0x025a, 0x025b, 0x025c, 0x025d, 0x025e, 0x025f,
+ 0x0260, 0x0261, 0x0262, 0x0263, 0x0264, 0x0265, 0x0266, 0x0267,
+ 0x0268, 0x0269, 0x026a, 0x026b, 0x026c, 0x026d, 0x026e, 0x026f,
+ 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277,
+ 0x0278, 0x0279, 0x027a, 0x027b, 0x027c, 0x027d, 0x027e, 0x027f,
+ 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287,
+ 0x0288, 0x0289, 0x028a, 0x028b, 0x028c, 0x028d, 0x028e, 0x028f,
+ 0x0290, 0x0291, 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297,
+ 0x0298, 0x0299, 0x029a, 0x029b, 0x029c, 0x029d, 0x029e, 0x029f,
+ 0x02a0, 0x02a1, 0x02a2, 0x02a3, 0x02a4, 0x02a5, 0x02a6, 0x02a7,
+ 0x02a8, 0x02a9, 0x02aa, 0x02ab, 0x02ac, 0x02ad, 0x02ae, 0x02af,
+ 0x02b0, 0x02b1, 0x02b2, 0x02b3, 0x02b4, 0x02b5, 0x02b6, 0x02b7,
+ 0x02b8, 0x02b9, 0x02ba, 0x02bb, 0x02bc, 0x02bd, 0x02be, 0x02bf,
+ 0x02c0, 0x02c1, 0x02c2, 0x02c3, 0x02c4, 0x02c5, 0x02c6, 0x02c7,
+ 0x02c8, 0x02c9, 0x02ca, 0x02cb, 0x02cc, 0x02cd, 0x02ce, 0x02cf,
+ 0x02d0, 0x02d1, 0x02d2, 0x02d3, 0x02d4, 0x02d5, 0x02d6, 0x02d7,
+ 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x02de, 0x02df,
+ 0x02e0, 0x02e1, 0x02e2, 0x02e3, 0x02e4, 0x02e5, 0x02e6, 0x02e7,
+ 0x02e8, 0x02e9, 0x02ea, 0x02eb, 0x02ec, 0x02ed, 0x02ee, 0x02ef,
+ 0x02f0, 0x02f1, 0x02f2, 0x02f3, 0x02f4, 0x02f5, 0x02f6, 0x02f7,
+ 0x02f8, 0x02f9, 0x02fa, 0x02fb, 0x02fc, 0x02fd, 0x02fe, 0x02ff,
+ 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307,
+ 0x0308, 0x0309, 0x030a, 0x030b, 0x030c, 0x030d, 0x030e, 0x030f,
+ 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317,
+ 0x0318, 0x0319, 0x031a, 0x031b, 0x031c, 0x031d, 0x031e, 0x031f,
+ 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327,
+ 0x0328, 0x0329, 0x032a, 0x032b, 0x032c, 0x032d, 0x032e, 0x032f,
+ 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337,
+ 0x0338, 0x0339, 0x033a, 0x033b, 0x033c, 0x033d, 0x033e, 0x033f,
+ 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x0345, 0x0346, 0x0347,
+ 0x0348, 0x0349, 0x034a, 0x034b, 0x034c, 0x034d, 0x034e, 0x034f,
+ 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357,
+ 0x0358, 0x0359, 0x035a, 0x035b, 0x035c, 0x035d, 0x035e, 0x035f,
+ 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367,
+ 0x0368, 0x0369, 0x036a, 0x036b, 0x036c, 0x036d, 0x036e, 0x036f,
+ 0x0371, 0x0371, 0x0373, 0x0373, 0x0374, 0x0375, 0x0377, 0x0377,
+ 0x0000, 0x0000, 0x037a, 0x037b, 0x037c, 0x037d, 0x037e, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x03ac, 0x0387,
+ 0x03ad, 0x03ae, 0x03af, 0x0000, 0x03cc, 0x0000, 0x03cd, 0x03ce,
+ 0x0390, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
+ 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
+ 0x03c0, 0x03c1, 0x0000, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
+ 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03ac, 0x03ad, 0x03ae, 0x03af,
+ 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
+ 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
+ 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
+ 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x03d7,
+ 0x03d0, 0x03d1, 0x03d2, 0x03d3, 0x03d4, 0x03d5, 0x03d6, 0x03d7,
+ 0x03d9, 0x03d9, 0x03db, 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df,
+ 0x03e1, 0x03e1, 0x03e3, 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9, 0x03eb, 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03ef,
+ 0x03f0, 0x03f1, 0x03f2, 0x03f3, 0x03b8, 0x03f5, 0x03f6, 0x03f8,
+ 0x03f8, 0x03f2, 0x03fb, 0x03fb, 0x03fc, 0x037b, 0x037c, 0x037d,
+ 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
+ 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
+ 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
+ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
+ 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
+ 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
+ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
+ 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
+ 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
+ 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f,
+ 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467,
+ 0x0469, 0x0469, 0x046b, 0x046b, 0x046d, 0x046d, 0x046f, 0x046f,
+ 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477,
+ 0x0479, 0x0479, 0x047b, 0x047b, 0x047d, 0x047d, 0x047f, 0x047f,
+ 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487,
+ 0x0488, 0x0489, 0x048b, 0x048b, 0x048d, 0x048d, 0x048f, 0x048f,
+ 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497,
+ 0x0499, 0x0499, 0x049b, 0x049b, 0x049d, 0x049d, 0x049f, 0x049f,
+ 0x04a1, 0x04a1, 0x04a3, 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7,
+ 0x04a9, 0x04a9, 0x04ab, 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af,
+ 0x04b1, 0x04b1, 0x04b3, 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7,
+ 0x04b9, 0x04b9, 0x04bb, 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf,
+ 0x04cf, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8,
+ 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04ce, 0x04cf,
+ 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, 0x04d5, 0x04d7, 0x04d7,
+ 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, 0x04dd, 0x04df, 0x04df,
+ 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, 0x04e5, 0x04e7, 0x04e7,
+ 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, 0x04ed, 0x04ef, 0x04ef,
+ 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, 0x04f5, 0x04f7, 0x04f7,
+ 0x04f9, 0x04f9, 0x04fb, 0x04fb, 0x04fd, 0x04fd, 0x04ff, 0x04ff,
+ 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, 0x0507,
+ 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, 0x050d, 0x050f, 0x050f,
+ 0x0511, 0x0511, 0x0513, 0x0513, 0x0515, 0x0515, 0x0517, 0x0517,
+ 0x0519, 0x0519, 0x051b, 0x051b, 0x051d, 0x051d, 0x051f, 0x051f,
+ 0x0521, 0x0521, 0x0523, 0x0523, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
+ 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
+ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
+ 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
+ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0000,
+ 0x0000, 0x0559, 0x055a, 0x055b, 0x055c, 0x055d, 0x055e, 0x055f,
+ 0x0000, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567,
+ 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f,
+ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577,
+ 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f,
+ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587,
+ 0x0000, 0x0589, 0x058a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597,
+ 0x0598, 0x0599, 0x059a, 0x059b, 0x059c, 0x059d, 0x059e, 0x059f,
+ 0x05a0, 0x05a1, 0x05a2, 0x05a3, 0x05a4, 0x05a5, 0x05a6, 0x05a7,
+ 0x05a8, 0x05a9, 0x05aa, 0x05ab, 0x05ac, 0x05ad, 0x05ae, 0x05af,
+ 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7,
+ 0x05b8, 0x05b9, 0x05ba, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf,
+ 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05c4, 0x05c5, 0x05c6, 0x05c7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
+ 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
+ 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
+ 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0600, 0x0601, 0x0602, 0x0603, 0x0000, 0x0000, 0x0606, 0x0607,
+ 0x0608, 0x0609, 0x060a, 0x060b, 0x060c, 0x060d, 0x060e, 0x060f,
+ 0x0610, 0x0611, 0x0612, 0x0613, 0x0614, 0x0615, 0x0616, 0x0617,
+ 0x0618, 0x0619, 0x061a, 0x061b, 0x0000, 0x0000, 0x061e, 0x061f,
+ 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
+ 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,
+ 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
+ 0x0638, 0x0639, 0x063a, 0x063b, 0x063c, 0x063d, 0x063e, 0x063f,
+ 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
+ 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,
+ 0x0650, 0x0651, 0x0652, 0x0653, 0x0654, 0x0655, 0x0656, 0x0657,
+ 0x0658, 0x0659, 0x065a, 0x065b, 0x065c, 0x065d, 0x065e, 0x0000,
+ 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667,
+ 0x0668, 0x0669, 0x066a, 0x066b, 0x066c, 0x066d, 0x066e, 0x066f,
+ 0x0670, 0x0671, 0x0672, 0x0673, 0x0674, 0x0675, 0x0676, 0x0677,
+ 0x0678, 0x0679, 0x067a, 0x067b, 0x067c, 0x067d, 0x067e, 0x067f,
+ 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0686, 0x0687,
+ 0x0688, 0x0689, 0x068a, 0x068b, 0x068c, 0x068d, 0x068e, 0x068f,
+ 0x0690, 0x0691, 0x0692, 0x0693, 0x0694, 0x0695, 0x0696, 0x0697,
+ 0x0698, 0x0699, 0x069a, 0x069b, 0x069c, 0x069d, 0x069e, 0x069f,
+ 0x06a0, 0x06a1, 0x06a2, 0x06a3, 0x06a4, 0x06a5, 0x06a6, 0x06a7,
+ 0x06a8, 0x06a9, 0x06aa, 0x06ab, 0x06ac, 0x06ad, 0x06ae, 0x06af,
+ 0x06b0, 0x06b1, 0x06b2, 0x06b3, 0x06b4, 0x06b5, 0x06b6, 0x06b7,
+ 0x06b8, 0x06b9, 0x06ba, 0x06bb, 0x06bc, 0x06bd, 0x06be, 0x06bf,
+ 0x06c0, 0x06c1, 0x06c2, 0x06c3, 0x06c4, 0x06c5, 0x06c6, 0x06c7,
+ 0x06c8, 0x06c9, 0x06ca, 0x06cb, 0x06cc, 0x06cd, 0x06ce, 0x06cf,
+ 0x06d0, 0x06d1, 0x06d2, 0x06d3, 0x06d4, 0x06d5, 0x06d6, 0x06d7,
+ 0x06d8, 0x06d9, 0x06da, 0x06db, 0x06dc, 0x06dd, 0x06de, 0x06df,
+ 0x06e0, 0x06e1, 0x06e2, 0x06e3, 0x06e4, 0x06e5, 0x06e6, 0x06e7,
+ 0x06e8, 0x06e9, 0x06ea, 0x06eb, 0x06ec, 0x06ed, 0x06ee, 0x06ef,
+ 0x06f0, 0x06f1, 0x06f2, 0x06f3, 0x06f4, 0x06f5, 0x06f6, 0x06f7,
+ 0x06f8, 0x06f9, 0x06fa, 0x06fb, 0x06fc, 0x06fd, 0x06fe, 0x06ff,
+ 0x0700, 0x0701, 0x0702, 0x0703, 0x0704, 0x0705, 0x0706, 0x0707,
+ 0x0708, 0x0709, 0x070a, 0x070b, 0x070c, 0x070d, 0x0000, 0x070f,
+ 0x0710, 0x0711, 0x0712, 0x0713, 0x0714, 0x0715, 0x0716, 0x0717,
+ 0x0718, 0x0719, 0x071a, 0x071b, 0x071c, 0x071d, 0x071e, 0x071f,
+ 0x0720, 0x0721, 0x0722, 0x0723, 0x0724, 0x0725, 0x0726, 0x0727,
+ 0x0728, 0x0729, 0x072a, 0x072b, 0x072c, 0x072d, 0x072e, 0x072f,
+ 0x0730, 0x0731, 0x0732, 0x0733, 0x0734, 0x0735, 0x0736, 0x0737,
+ 0x0738, 0x0739, 0x073a, 0x073b, 0x073c, 0x073d, 0x073e, 0x073f,
+ 0x0740, 0x0741, 0x0742, 0x0743, 0x0744, 0x0745, 0x0746, 0x0747,
+ 0x0748, 0x0749, 0x074a, 0x0000, 0x0000, 0x074d, 0x074e, 0x074f,
+ 0x0750, 0x0751, 0x0752, 0x0753, 0x0754, 0x0755, 0x0756, 0x0757,
+ 0x0758, 0x0759, 0x075a, 0x075b, 0x075c, 0x075d, 0x075e, 0x075f,
+ 0x0760, 0x0761, 0x0762, 0x0763, 0x0764, 0x0765, 0x0766, 0x0767,
+ 0x0768, 0x0769, 0x076a, 0x076b, 0x076c, 0x076d, 0x076e, 0x076f,
+ 0x0770, 0x0771, 0x0772, 0x0773, 0x0774, 0x0775, 0x0776, 0x0777,
+ 0x0778, 0x0779, 0x077a, 0x077b, 0x077c, 0x077d, 0x077e, 0x077f,
+ 0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0786, 0x0787,
+ 0x0788, 0x0789, 0x078a, 0x078b, 0x078c, 0x078d, 0x078e, 0x078f,
+ 0x0790, 0x0791, 0x0792, 0x0793, 0x0794, 0x0795, 0x0796, 0x0797,
+ 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d, 0x079e, 0x079f,
+ 0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a6, 0x07a7,
+ 0x07a8, 0x07a9, 0x07aa, 0x07ab, 0x07ac, 0x07ad, 0x07ae, 0x07af,
+ 0x07b0, 0x07b1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x07c0, 0x07c1, 0x07c2, 0x07c3, 0x07c4, 0x07c5, 0x07c6, 0x07c7,
+ 0x07c8, 0x07c9, 0x07ca, 0x07cb, 0x07cc, 0x07cd, 0x07ce, 0x07cf,
+ 0x07d0, 0x07d1, 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x07d6, 0x07d7,
+ 0x07d8, 0x07d9, 0x07da, 0x07db, 0x07dc, 0x07dd, 0x07de, 0x07df,
+ 0x07e0, 0x07e1, 0x07e2, 0x07e3, 0x07e4, 0x07e5, 0x07e6, 0x07e7,
+ 0x07e8, 0x07e9, 0x07ea, 0x07eb, 0x07ec, 0x07ed, 0x07ee, 0x07ef,
+ 0x07f0, 0x07f1, 0x07f2, 0x07f3, 0x07f4, 0x07f5, 0x07f6, 0x07f7,
+ 0x07f8, 0x07f9, 0x07fa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0901, 0x0902, 0x0903, 0x0904, 0x0905, 0x0906, 0x0907,
+ 0x0908, 0x0909, 0x090a, 0x090b, 0x090c, 0x090d, 0x090e, 0x090f,
+ 0x0910, 0x0911, 0x0912, 0x0913, 0x0914, 0x0915, 0x0916, 0x0917,
+ 0x0918, 0x0919, 0x091a, 0x091b, 0x091c, 0x091d, 0x091e, 0x091f,
+ 0x0920, 0x0921, 0x0922, 0x0923, 0x0924, 0x0925, 0x0926, 0x0927,
+ 0x0928, 0x0929, 0x092a, 0x092b, 0x092c, 0x092d, 0x092e, 0x092f,
+ 0x0930, 0x0931, 0x0932, 0x0933, 0x0934, 0x0935, 0x0936, 0x0937,
+ 0x0938, 0x0939, 0x0000, 0x0000, 0x093c, 0x093d, 0x093e, 0x093f,
+ 0x0940, 0x0941, 0x0942, 0x0943, 0x0944, 0x0945, 0x0946, 0x0947,
+ 0x0948, 0x0949, 0x094a, 0x094b, 0x094c, 0x094d, 0x0000, 0x0000,
+ 0x0950, 0x0951, 0x0952, 0x0953, 0x0954, 0x0000, 0x0000, 0x0000,
+ 0x0958, 0x0959, 0x095a, 0x095b, 0x095c, 0x095d, 0x095e, 0x095f,
+ 0x0960, 0x0961, 0x0962, 0x0963, 0x0964, 0x0965, 0x0966, 0x0967,
+ 0x0968, 0x0969, 0x096a, 0x096b, 0x096c, 0x096d, 0x096e, 0x096f,
+ 0x0970, 0x0971, 0x0972, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x097b, 0x097c, 0x097d, 0x097e, 0x097f,
+ 0x0000, 0x0981, 0x0982, 0x0983, 0x0000, 0x0985, 0x0986, 0x0987,
+ 0x0988, 0x0989, 0x098a, 0x098b, 0x098c, 0x0000, 0x0000, 0x098f,
+ 0x0990, 0x0000, 0x0000, 0x0993, 0x0994, 0x0995, 0x0996, 0x0997,
+ 0x0998, 0x0999, 0x099a, 0x099b, 0x099c, 0x099d, 0x099e, 0x099f,
+ 0x09a0, 0x09a1, 0x09a2, 0x09a3, 0x09a4, 0x09a5, 0x09a6, 0x09a7,
+ 0x09a8, 0x0000, 0x09aa, 0x09ab, 0x09ac, 0x09ad, 0x09ae, 0x09af,
+ 0x09b0, 0x0000, 0x09b2, 0x0000, 0x0000, 0x0000, 0x09b6, 0x09b7,
+ 0x09b8, 0x09b9, 0x0000, 0x0000, 0x09bc, 0x09bd, 0x09be, 0x09bf,
+ 0x09c0, 0x09c1, 0x09c2, 0x09c3, 0x09c4, 0x0000, 0x0000, 0x09c7,
+ 0x09c8, 0x0000, 0x0000, 0x09cb, 0x09cc, 0x09cd, 0x09ce, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x09d7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x09dc, 0x09dd, 0x0000, 0x09df,
+ 0x09e0, 0x09e1, 0x09e2, 0x09e3, 0x0000, 0x0000, 0x09e6, 0x09e7,
+ 0x09e8, 0x09e9, 0x09ea, 0x09eb, 0x09ec, 0x09ed, 0x09ee, 0x09ef,
+ 0x09f0, 0x09f1, 0x09f2, 0x09f3, 0x09f4, 0x09f5, 0x09f6, 0x09f7,
+ 0x09f8, 0x09f9, 0x09fa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0a01, 0x0a02, 0x0a03, 0x0000, 0x0a05, 0x0a06, 0x0a07,
+ 0x0a08, 0x0a09, 0x0a0a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a0f,
+ 0x0a10, 0x0000, 0x0000, 0x0a13, 0x0a14, 0x0a15, 0x0a16, 0x0a17,
+ 0x0a18, 0x0a19, 0x0a1a, 0x0a1b, 0x0a1c, 0x0a1d, 0x0a1e, 0x0a1f,
+ 0x0a20, 0x0a21, 0x0a22, 0x0a23, 0x0a24, 0x0a25, 0x0a26, 0x0a27,
+ 0x0a28, 0x0000, 0x0a2a, 0x0a2b, 0x0a2c, 0x0a2d, 0x0a2e, 0x0a2f,
+ 0x0a30, 0x0000, 0x0a32, 0x0a33, 0x0000, 0x0a35, 0x0a36, 0x0000,
+ 0x0a38, 0x0a39, 0x0000, 0x0000, 0x0a3c, 0x0000, 0x0a3e, 0x0a3f,
+ 0x0a40, 0x0a41, 0x0a42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a47,
+ 0x0a48, 0x0000, 0x0000, 0x0a4b, 0x0a4c, 0x0a4d, 0x0000, 0x0000,
+ 0x0000, 0x0a51, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0a59, 0x0a5a, 0x0a5b, 0x0a5c, 0x0000, 0x0a5e, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a66, 0x0a67,
+ 0x0a68, 0x0a69, 0x0a6a, 0x0a6b, 0x0a6c, 0x0a6d, 0x0a6e, 0x0a6f,
+ 0x0a70, 0x0a71, 0x0a72, 0x0a73, 0x0a74, 0x0a75, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0a81, 0x0a82, 0x0a83, 0x0000, 0x0a85, 0x0a86, 0x0a87,
+ 0x0a88, 0x0a89, 0x0a8a, 0x0a8b, 0x0a8c, 0x0a8d, 0x0000, 0x0a8f,
+ 0x0a90, 0x0a91, 0x0000, 0x0a93, 0x0a94, 0x0a95, 0x0a96, 0x0a97,
+ 0x0a98, 0x0a99, 0x0a9a, 0x0a9b, 0x0a9c, 0x0a9d, 0x0a9e, 0x0a9f,
+ 0x0aa0, 0x0aa1, 0x0aa2, 0x0aa3, 0x0aa4, 0x0aa5, 0x0aa6, 0x0aa7,
+ 0x0aa8, 0x0000, 0x0aaa, 0x0aab, 0x0aac, 0x0aad, 0x0aae, 0x0aaf,
+ 0x0ab0, 0x0000, 0x0ab2, 0x0ab3, 0x0000, 0x0ab5, 0x0ab6, 0x0ab7,
+ 0x0ab8, 0x0ab9, 0x0000, 0x0000, 0x0abc, 0x0abd, 0x0abe, 0x0abf,
+ 0x0ac0, 0x0ac1, 0x0ac2, 0x0ac3, 0x0ac4, 0x0ac5, 0x0000, 0x0ac7,
+ 0x0ac8, 0x0ac9, 0x0000, 0x0acb, 0x0acc, 0x0acd, 0x0000, 0x0000,
+ 0x0ad0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0ae0, 0x0ae1, 0x0ae2, 0x0ae3, 0x0000, 0x0000, 0x0ae6, 0x0ae7,
+ 0x0ae8, 0x0ae9, 0x0aea, 0x0aeb, 0x0aec, 0x0aed, 0x0aee, 0x0aef,
+ 0x0000, 0x0af1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0b01, 0x0b02, 0x0b03, 0x0000, 0x0b05, 0x0b06, 0x0b07,
+ 0x0b08, 0x0b09, 0x0b0a, 0x0b0b, 0x0b0c, 0x0000, 0x0000, 0x0b0f,
+ 0x0b10, 0x0000, 0x0000, 0x0b13, 0x0b14, 0x0b15, 0x0b16, 0x0b17,
+ 0x0b18, 0x0b19, 0x0b1a, 0x0b1b, 0x0b1c, 0x0b1d, 0x0b1e, 0x0b1f,
+ 0x0b20, 0x0b21, 0x0b22, 0x0b23, 0x0b24, 0x0b25, 0x0b26, 0x0b27,
+ 0x0b28, 0x0000, 0x0b2a, 0x0b2b, 0x0b2c, 0x0b2d, 0x0b2e, 0x0b2f,
+ 0x0b30, 0x0000, 0x0b32, 0x0b33, 0x0000, 0x0b35, 0x0b36, 0x0b37,
+ 0x0b38, 0x0b39, 0x0000, 0x0000, 0x0b3c, 0x0b3d, 0x0b3e, 0x0b3f,
+ 0x0b40, 0x0b41, 0x0b42, 0x0b43, 0x0b44, 0x0000, 0x0000, 0x0b47,
+ 0x0b48, 0x0000, 0x0000, 0x0b4b, 0x0b4c, 0x0b4d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0b56, 0x0b57,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0b5c, 0x0b5d, 0x0000, 0x0b5f,
+ 0x0b60, 0x0b61, 0x0b62, 0x0b63, 0x0000, 0x0000, 0x0b66, 0x0b67,
+ 0x0b68, 0x0b69, 0x0b6a, 0x0b6b, 0x0b6c, 0x0b6d, 0x0b6e, 0x0b6f,
+ 0x0b70, 0x0b71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0b82, 0x0b83, 0x0000, 0x0b85, 0x0b86, 0x0b87,
+ 0x0b88, 0x0b89, 0x0b8a, 0x0000, 0x0000, 0x0000, 0x0b8e, 0x0b8f,
+ 0x0b90, 0x0000, 0x0b92, 0x0b93, 0x0b94, 0x0b95, 0x0000, 0x0000,
+ 0x0000, 0x0b99, 0x0b9a, 0x0000, 0x0b9c, 0x0000, 0x0b9e, 0x0b9f,
+ 0x0000, 0x0000, 0x0000, 0x0ba3, 0x0ba4, 0x0000, 0x0000, 0x0000,
+ 0x0ba8, 0x0ba9, 0x0baa, 0x0000, 0x0000, 0x0000, 0x0bae, 0x0baf,
+ 0x0bb0, 0x0bb1, 0x0bb2, 0x0bb3, 0x0bb4, 0x0bb5, 0x0bb6, 0x0bb7,
+ 0x0bb8, 0x0bb9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0bbe, 0x0bbf,
+ 0x0bc0, 0x0bc1, 0x0bc2, 0x0000, 0x0000, 0x0000, 0x0bc6, 0x0bc7,
+ 0x0bc8, 0x0000, 0x0bca, 0x0bcb, 0x0bcc, 0x0bcd, 0x0000, 0x0000,
+ 0x0bd0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0bd7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0be6, 0x0be7,
+ 0x0be8, 0x0be9, 0x0bea, 0x0beb, 0x0bec, 0x0bed, 0x0bee, 0x0bef,
+ 0x0bf0, 0x0bf1, 0x0bf2, 0x0bf3, 0x0bf4, 0x0bf5, 0x0bf6, 0x0bf7,
+ 0x0bf8, 0x0bf9, 0x0bfa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0c01, 0x0c02, 0x0c03, 0x0000, 0x0c05, 0x0c06, 0x0c07,
+ 0x0c08, 0x0c09, 0x0c0a, 0x0c0b, 0x0c0c, 0x0000, 0x0c0e, 0x0c0f,
+ 0x0c10, 0x0000, 0x0c12, 0x0c13, 0x0c14, 0x0c15, 0x0c16, 0x0c17,
+ 0x0c18, 0x0c19, 0x0c1a, 0x0c1b, 0x0c1c, 0x0c1d, 0x0c1e, 0x0c1f,
+ 0x0c20, 0x0c21, 0x0c22, 0x0c23, 0x0c24, 0x0c25, 0x0c26, 0x0c27,
+ 0x0c28, 0x0000, 0x0c2a, 0x0c2b, 0x0c2c, 0x0c2d, 0x0c2e, 0x0c2f,
+ 0x0c30, 0x0c31, 0x0c32, 0x0c33, 0x0000, 0x0c35, 0x0c36, 0x0c37,
+ 0x0c38, 0x0c39, 0x0000, 0x0000, 0x0000, 0x0c3d, 0x0c3e, 0x0c3f,
+ 0x0c40, 0x0c41, 0x0c42, 0x0c43, 0x0c44, 0x0000, 0x0c46, 0x0c47,
+ 0x0c48, 0x0000, 0x0c4a, 0x0c4b, 0x0c4c, 0x0c4d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0c55, 0x0c56, 0x0000,
+ 0x0c58, 0x0c59, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0c60, 0x0c61, 0x0c62, 0x0c63, 0x0000, 0x0000, 0x0c66, 0x0c67,
+ 0x0c68, 0x0c69, 0x0c6a, 0x0c6b, 0x0c6c, 0x0c6d, 0x0c6e, 0x0c6f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0c78, 0x0c79, 0x0c7a, 0x0c7b, 0x0c7c, 0x0c7d, 0x0c7e, 0x0c7f,
+ 0x0000, 0x0000, 0x0c82, 0x0c83, 0x0000, 0x0c85, 0x0c86, 0x0c87,
+ 0x0c88, 0x0c89, 0x0c8a, 0x0c8b, 0x0c8c, 0x0000, 0x0c8e, 0x0c8f,
+ 0x0c90, 0x0000, 0x0c92, 0x0c93, 0x0c94, 0x0c95, 0x0c96, 0x0c97,
+ 0x0c98, 0x0c99, 0x0c9a, 0x0c9b, 0x0c9c, 0x0c9d, 0x0c9e, 0x0c9f,
+ 0x0ca0, 0x0ca1, 0x0ca2, 0x0ca3, 0x0ca4, 0x0ca5, 0x0ca6, 0x0ca7,
+ 0x0ca8, 0x0000, 0x0caa, 0x0cab, 0x0cac, 0x0cad, 0x0cae, 0x0caf,
+ 0x0cb0, 0x0cb1, 0x0cb2, 0x0cb3, 0x0000, 0x0cb5, 0x0cb6, 0x0cb7,
+ 0x0cb8, 0x0cb9, 0x0000, 0x0000, 0x0cbc, 0x0cbd, 0x0cbe, 0x0cbf,
+ 0x0cc0, 0x0cc1, 0x0cc2, 0x0cc3, 0x0cc4, 0x0000, 0x0cc6, 0x0cc7,
+ 0x0cc8, 0x0000, 0x0cca, 0x0ccb, 0x0ccc, 0x0ccd, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0cd5, 0x0cd6, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0cde, 0x0000,
+ 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0000, 0x0000, 0x0ce6, 0x0ce7,
+ 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x0cef,
+ 0x0000, 0x0cf1, 0x0cf2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0d02, 0x0d03, 0x0000, 0x0d05, 0x0d06, 0x0d07,
+ 0x0d08, 0x0d09, 0x0d0a, 0x0d0b, 0x0d0c, 0x0000, 0x0d0e, 0x0d0f,
+ 0x0d10, 0x0000, 0x0d12, 0x0d13, 0x0d14, 0x0d15, 0x0d16, 0x0d17,
+ 0x0d18, 0x0d19, 0x0d1a, 0x0d1b, 0x0d1c, 0x0d1d, 0x0d1e, 0x0d1f,
+ 0x0d20, 0x0d21, 0x0d22, 0x0d23, 0x0d24, 0x0d25, 0x0d26, 0x0d27,
+ 0x0d28, 0x0000, 0x0d2a, 0x0d2b, 0x0d2c, 0x0d2d, 0x0d2e, 0x0d2f,
+ 0x0d30, 0x0d31, 0x0d32, 0x0d33, 0x0d34, 0x0d35, 0x0d36, 0x0d37,
+ 0x0d38, 0x0d39, 0x0000, 0x0000, 0x0000, 0x0d3d, 0x0d3e, 0x0d3f,
+ 0x0d40, 0x0d41, 0x0d42, 0x0d43, 0x0d44, 0x0000, 0x0d46, 0x0d47,
+ 0x0d48, 0x0000, 0x0d4a, 0x0d4b, 0x0d4c, 0x0d4d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0d57,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0d60, 0x0d61, 0x0d62, 0x0d63, 0x0000, 0x0000, 0x0d66, 0x0d67,
+ 0x0d68, 0x0d69, 0x0d6a, 0x0d6b, 0x0d6c, 0x0d6d, 0x0d6e, 0x0d6f,
+ 0x0d70, 0x0d71, 0x0d72, 0x0d73, 0x0d74, 0x0d75, 0x0000, 0x0000,
+ 0x0000, 0x0d79, 0x0d7a, 0x0d7b, 0x0d7c, 0x0d7d, 0x0d7e, 0x0d7f,
+ 0x0000, 0x0000, 0x0d82, 0x0d83, 0x0000, 0x0d85, 0x0d86, 0x0d87,
+ 0x0d88, 0x0d89, 0x0d8a, 0x0d8b, 0x0d8c, 0x0d8d, 0x0d8e, 0x0d8f,
+ 0x0d90, 0x0d91, 0x0d92, 0x0d93, 0x0d94, 0x0d95, 0x0d96, 0x0000,
+ 0x0000, 0x0000, 0x0d9a, 0x0d9b, 0x0d9c, 0x0d9d, 0x0d9e, 0x0d9f,
+ 0x0da0, 0x0da1, 0x0da2, 0x0da3, 0x0da4, 0x0da5, 0x0da6, 0x0da7,
+ 0x0da8, 0x0da9, 0x0daa, 0x0dab, 0x0dac, 0x0dad, 0x0dae, 0x0daf,
+ 0x0db0, 0x0db1, 0x0000, 0x0db3, 0x0db4, 0x0db5, 0x0db6, 0x0db7,
+ 0x0db8, 0x0db9, 0x0dba, 0x0dbb, 0x0000, 0x0dbd, 0x0000, 0x0000,
+ 0x0dc0, 0x0dc1, 0x0dc2, 0x0dc3, 0x0dc4, 0x0dc5, 0x0dc6, 0x0000,
+ 0x0000, 0x0000, 0x0dca, 0x0000, 0x0000, 0x0000, 0x0000, 0x0dcf,
+ 0x0dd0, 0x0dd1, 0x0dd2, 0x0dd3, 0x0dd4, 0x0000, 0x0dd6, 0x0000,
+ 0x0dd8, 0x0dd9, 0x0dda, 0x0ddb, 0x0ddc, 0x0ddd, 0x0dde, 0x0ddf,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0df2, 0x0df3, 0x0df4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
+ 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
+ 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
+ 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
+ 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
+ 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
+ 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
+ 0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f,
+ 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
+ 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
+ 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
+ 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0e81, 0x0e82, 0x0000, 0x0e84, 0x0000, 0x0000, 0x0e87,
+ 0x0e88, 0x0000, 0x0e8a, 0x0000, 0x0000, 0x0e8d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0e94, 0x0e95, 0x0e96, 0x0e97,
+ 0x0000, 0x0e99, 0x0e9a, 0x0e9b, 0x0e9c, 0x0e9d, 0x0e9e, 0x0e9f,
+ 0x0000, 0x0ea1, 0x0ea2, 0x0ea3, 0x0000, 0x0ea5, 0x0000, 0x0ea7,
+ 0x0000, 0x0000, 0x0eaa, 0x0eab, 0x0000, 0x0ead, 0x0eae, 0x0eaf,
+ 0x0eb0, 0x0eb1, 0x0eb2, 0x0eb3, 0x0eb4, 0x0eb5, 0x0eb6, 0x0eb7,
+ 0x0eb8, 0x0eb9, 0x0000, 0x0ebb, 0x0ebc, 0x0ebd, 0x0000, 0x0000,
+ 0x0ec0, 0x0ec1, 0x0ec2, 0x0ec3, 0x0ec4, 0x0000, 0x0ec6, 0x0000,
+ 0x0ec8, 0x0ec9, 0x0eca, 0x0ecb, 0x0ecc, 0x0ecd, 0x0000, 0x0000,
+ 0x0ed0, 0x0ed1, 0x0ed2, 0x0ed3, 0x0ed4, 0x0ed5, 0x0ed6, 0x0ed7,
+ 0x0ed8, 0x0ed9, 0x0000, 0x0000, 0x0edc, 0x0edd, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06, 0x0f07,
+ 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e, 0x0f0f,
+ 0x0f10, 0x0f11, 0x0f12, 0x0f13, 0x0f14, 0x0f15, 0x0f16, 0x0f17,
+ 0x0f18, 0x0f19, 0x0f1a, 0x0f1b, 0x0f1c, 0x0f1d, 0x0f1e, 0x0f1f,
+ 0x0f20, 0x0f21, 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26, 0x0f27,
+ 0x0f28, 0x0f29, 0x0f2a, 0x0f2b, 0x0f2c, 0x0f2d, 0x0f2e, 0x0f2f,
+ 0x0f30, 0x0f31, 0x0f32, 0x0f33, 0x0f34, 0x0f35, 0x0f36, 0x0f37,
+ 0x0f38, 0x0f39, 0x0f3a, 0x0f3b, 0x0f3c, 0x0f3d, 0x0f3e, 0x0f3f,
+ 0x0f40, 0x0f41, 0x0f42, 0x0f43, 0x0f44, 0x0f45, 0x0f46, 0x0f47,
+ 0x0000, 0x0f49, 0x0f4a, 0x0f4b, 0x0f4c, 0x0f4d, 0x0f4e, 0x0f4f,
+ 0x0f50, 0x0f51, 0x0f52, 0x0f53, 0x0f54, 0x0f55, 0x0f56, 0x0f57,
+ 0x0f58, 0x0f59, 0x0f5a, 0x0f5b, 0x0f5c, 0x0f5d, 0x0f5e, 0x0f5f,
+ 0x0f60, 0x0f61, 0x0f62, 0x0f63, 0x0f64, 0x0f65, 0x0f66, 0x0f67,
+ 0x0f68, 0x0f69, 0x0f6a, 0x0f6b, 0x0f6c, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0f71, 0x0f72, 0x0f73, 0x0f74, 0x0f75, 0x0f76, 0x0f77,
+ 0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
+ 0x0f80, 0x0f81, 0x0f82, 0x0f83, 0x0f84, 0x0f85, 0x0f86, 0x0f87,
+ 0x0f88, 0x0f89, 0x0f8a, 0x0f8b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0f90, 0x0f91, 0x0f92, 0x0f93, 0x0f94, 0x0f95, 0x0f96, 0x0f97,
+ 0x0000, 0x0f99, 0x0f9a, 0x0f9b, 0x0f9c, 0x0f9d, 0x0f9e, 0x0f9f,
+ 0x0fa0, 0x0fa1, 0x0fa2, 0x0fa3, 0x0fa4, 0x0fa5, 0x0fa6, 0x0fa7,
+ 0x0fa8, 0x0fa9, 0x0faa, 0x0fab, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
+ 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
+ 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0000, 0x0fbe, 0x0fbf,
+ 0x0fc0, 0x0fc1, 0x0fc2, 0x0fc3, 0x0fc4, 0x0fc5, 0x0fc6, 0x0fc7,
+ 0x0fc8, 0x0fc9, 0x0fca, 0x0fcb, 0x0fcc, 0x0000, 0x0fce, 0x0fcf,
+ 0x0fd0, 0x0fd1, 0x0fd2, 0x0fd3, 0x0fd4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007,
+ 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x100e, 0x100f,
+ 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017,
+ 0x1018, 0x1019, 0x101a, 0x101b, 0x101c, 0x101d, 0x101e, 0x101f,
+ 0x1020, 0x1021, 0x1022, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027,
+ 0x1028, 0x1029, 0x102a, 0x102b, 0x102c, 0x102d, 0x102e, 0x102f,
+ 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, 0x1035, 0x1036, 0x1037,
+ 0x1038, 0x1039, 0x103a, 0x103b, 0x103c, 0x103d, 0x103e, 0x103f,
+ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047,
+ 0x1048, 0x1049, 0x104a, 0x104b, 0x104c, 0x104d, 0x104e, 0x104f,
+ 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057,
+ 0x1058, 0x1059, 0x105a, 0x105b, 0x105c, 0x105d, 0x105e, 0x105f,
+ 0x1060, 0x1061, 0x1062, 0x1063, 0x1064, 0x1065, 0x1066, 0x1067,
+ 0x1068, 0x1069, 0x106a, 0x106b, 0x106c, 0x106d, 0x106e, 0x106f,
+ 0x1070, 0x1071, 0x1072, 0x1073, 0x1074, 0x1075, 0x1076, 0x1077,
+ 0x1078, 0x1079, 0x107a, 0x107b, 0x107c, 0x107d, 0x107e, 0x107f,
+ 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086, 0x1087,
+ 0x1088, 0x1089, 0x108a, 0x108b, 0x108c, 0x108d, 0x108e, 0x108f,
+ 0x1090, 0x1091, 0x1092, 0x1093, 0x1094, 0x1095, 0x1096, 0x1097,
+ 0x1098, 0x1099, 0x0000, 0x0000, 0x0000, 0x0000, 0x109e, 0x109f,
+ 0x2d00, 0x2d01, 0x2d02, 0x2d03, 0x2d04, 0x2d05, 0x2d06, 0x2d07,
+ 0x2d08, 0x2d09, 0x2d0a, 0x2d0b, 0x2d0c, 0x2d0d, 0x2d0e, 0x2d0f,
+ 0x2d10, 0x2d11, 0x2d12, 0x2d13, 0x2d14, 0x2d15, 0x2d16, 0x2d17,
+ 0x2d18, 0x2d19, 0x2d1a, 0x2d1b, 0x2d1c, 0x2d1d, 0x2d1e, 0x2d1f,
+ 0x2d20, 0x2d21, 0x2d22, 0x2d23, 0x2d24, 0x2d25, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7,
+ 0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df,
+ 0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7,
+ 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10ef,
+ 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7,
+ 0x10f8, 0x10f9, 0x10fa, 0x10fb, 0x10fc, 0x0000, 0x0000, 0x0000,
+ 0x1100, 0x1101, 0x1102, 0x1103, 0x1104, 0x1105, 0x1106, 0x1107,
+ 0x1108, 0x1109, 0x110a, 0x110b, 0x110c, 0x110d, 0x110e, 0x110f,
+ 0x1110, 0x1111, 0x1112, 0x1113, 0x1114, 0x1115, 0x1116, 0x1117,
+ 0x1118, 0x1119, 0x111a, 0x111b, 0x111c, 0x111d, 0x111e, 0x111f,
+ 0x1120, 0x1121, 0x1122, 0x1123, 0x1124, 0x1125, 0x1126, 0x1127,
+ 0x1128, 0x1129, 0x112a, 0x112b, 0x112c, 0x112d, 0x112e, 0x112f,
+ 0x1130, 0x1131, 0x1132, 0x1133, 0x1134, 0x1135, 0x1136, 0x1137,
+ 0x1138, 0x1139, 0x113a, 0x113b, 0x113c, 0x113d, 0x113e, 0x113f,
+ 0x1140, 0x1141, 0x1142, 0x1143, 0x1144, 0x1145, 0x1146, 0x1147,
+ 0x1148, 0x1149, 0x114a, 0x114b, 0x114c, 0x114d, 0x114e, 0x114f,
+ 0x1150, 0x1151, 0x1152, 0x1153, 0x1154, 0x1155, 0x1156, 0x1157,
+ 0x1158, 0x1159, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x115f,
+ 0x1160, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167,
+ 0x1168, 0x1169, 0x116a, 0x116b, 0x116c, 0x116d, 0x116e, 0x116f,
+ 0x1170, 0x1171, 0x1172, 0x1173, 0x1174, 0x1175, 0x1176, 0x1177,
+ 0x1178, 0x1179, 0x117a, 0x117b, 0x117c, 0x117d, 0x117e, 0x117f,
+ 0x1180, 0x1181, 0x1182, 0x1183, 0x1184, 0x1185, 0x1186, 0x1187,
+ 0x1188, 0x1189, 0x118a, 0x118b, 0x118c, 0x118d, 0x118e, 0x118f,
+ 0x1190, 0x1191, 0x1192, 0x1193, 0x1194, 0x1195, 0x1196, 0x1197,
+ 0x1198, 0x1199, 0x119a, 0x119b, 0x119c, 0x119d, 0x119e, 0x119f,
+ 0x11a0, 0x11a1, 0x11a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x11a8, 0x11a9, 0x11aa, 0x11ab, 0x11ac, 0x11ad, 0x11ae, 0x11af,
+ 0x11b0, 0x11b1, 0x11b2, 0x11b3, 0x11b4, 0x11b5, 0x11b6, 0x11b7,
+ 0x11b8, 0x11b9, 0x11ba, 0x11bb, 0x11bc, 0x11bd, 0x11be, 0x11bf,
+ 0x11c0, 0x11c1, 0x11c2, 0x11c3, 0x11c4, 0x11c5, 0x11c6, 0x11c7,
+ 0x11c8, 0x11c9, 0x11ca, 0x11cb, 0x11cc, 0x11cd, 0x11ce, 0x11cf,
+ 0x11d0, 0x11d1, 0x11d2, 0x11d3, 0x11d4, 0x11d5, 0x11d6, 0x11d7,
+ 0x11d8, 0x11d9, 0x11da, 0x11db, 0x11dc, 0x11dd, 0x11de, 0x11df,
+ 0x11e0, 0x11e1, 0x11e2, 0x11e3, 0x11e4, 0x11e5, 0x11e6, 0x11e7,
+ 0x11e8, 0x11e9, 0x11ea, 0x11eb, 0x11ec, 0x11ed, 0x11ee, 0x11ef,
+ 0x11f0, 0x11f1, 0x11f2, 0x11f3, 0x11f4, 0x11f5, 0x11f6, 0x11f7,
+ 0x11f8, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1200, 0x1201, 0x1202, 0x1203, 0x1204, 0x1205, 0x1206, 0x1207,
+ 0x1208, 0x1209, 0x120a, 0x120b, 0x120c, 0x120d, 0x120e, 0x120f,
+ 0x1210, 0x1211, 0x1212, 0x1213, 0x1214, 0x1215, 0x1216, 0x1217,
+ 0x1218, 0x1219, 0x121a, 0x121b, 0x121c, 0x121d, 0x121e, 0x121f,
+ 0x1220, 0x1221, 0x1222, 0x1223, 0x1224, 0x1225, 0x1226, 0x1227,
+ 0x1228, 0x1229, 0x122a, 0x122b, 0x122c, 0x122d, 0x122e, 0x122f,
+ 0x1230, 0x1231, 0x1232, 0x1233, 0x1234, 0x1235, 0x1236, 0x1237,
+ 0x1238, 0x1239, 0x123a, 0x123b, 0x123c, 0x123d, 0x123e, 0x123f,
+ 0x1240, 0x1241, 0x1242, 0x1243, 0x1244, 0x1245, 0x1246, 0x1247,
+ 0x1248, 0x0000, 0x124a, 0x124b, 0x124c, 0x124d, 0x0000, 0x0000,
+ 0x1250, 0x1251, 0x1252, 0x1253, 0x1254, 0x1255, 0x1256, 0x0000,
+ 0x1258, 0x0000, 0x125a, 0x125b, 0x125c, 0x125d, 0x0000, 0x0000,
+ 0x1260, 0x1261, 0x1262, 0x1263, 0x1264, 0x1265, 0x1266, 0x1267,
+ 0x1268, 0x1269, 0x126a, 0x126b, 0x126c, 0x126d, 0x126e, 0x126f,
+ 0x1270, 0x1271, 0x1272, 0x1273, 0x1274, 0x1275, 0x1276, 0x1277,
+ 0x1278, 0x1279, 0x127a, 0x127b, 0x127c, 0x127d, 0x127e, 0x127f,
+ 0x1280, 0x1281, 0x1282, 0x1283, 0x1284, 0x1285, 0x1286, 0x1287,
+ 0x1288, 0x0000, 0x128a, 0x128b, 0x128c, 0x128d, 0x0000, 0x0000,
+ 0x1290, 0x1291, 0x1292, 0x1293, 0x1294, 0x1295, 0x1296, 0x1297,
+ 0x1298, 0x1299, 0x129a, 0x129b, 0x129c, 0x129d, 0x129e, 0x129f,
+ 0x12a0, 0x12a1, 0x12a2, 0x12a3, 0x12a4, 0x12a5, 0x12a6, 0x12a7,
+ 0x12a8, 0x12a9, 0x12aa, 0x12ab, 0x12ac, 0x12ad, 0x12ae, 0x12af,
+ 0x12b0, 0x0000, 0x12b2, 0x12b3, 0x12b4, 0x12b5, 0x0000, 0x0000,
+ 0x12b8, 0x12b9, 0x12ba, 0x12bb, 0x12bc, 0x12bd, 0x12be, 0x0000,
+ 0x12c0, 0x0000, 0x12c2, 0x12c3, 0x12c4, 0x12c5, 0x0000, 0x0000,
+ 0x12c8, 0x12c9, 0x12ca, 0x12cb, 0x12cc, 0x12cd, 0x12ce, 0x12cf,
+ 0x12d0, 0x12d1, 0x12d2, 0x12d3, 0x12d4, 0x12d5, 0x12d6, 0x0000,
+ 0x12d8, 0x12d9, 0x12da, 0x12db, 0x12dc, 0x12dd, 0x12de, 0x12df,
+ 0x12e0, 0x12e1, 0x12e2, 0x12e3, 0x12e4, 0x12e5, 0x12e6, 0x12e7,
+ 0x12e8, 0x12e9, 0x12ea, 0x12eb, 0x12ec, 0x12ed, 0x12ee, 0x12ef,
+ 0x12f0, 0x12f1, 0x12f2, 0x12f3, 0x12f4, 0x12f5, 0x12f6, 0x12f7,
+ 0x12f8, 0x12f9, 0x12fa, 0x12fb, 0x12fc, 0x12fd, 0x12fe, 0x12ff,
+ 0x1300, 0x1301, 0x1302, 0x1303, 0x1304, 0x1305, 0x1306, 0x1307,
+ 0x1308, 0x1309, 0x130a, 0x130b, 0x130c, 0x130d, 0x130e, 0x130f,
+ 0x1310, 0x0000, 0x1312, 0x1313, 0x1314, 0x1315, 0x0000, 0x0000,
+ 0x1318, 0x1319, 0x131a, 0x131b, 0x131c, 0x131d, 0x131e, 0x131f,
+ 0x1320, 0x1321, 0x1322, 0x1323, 0x1324, 0x1325, 0x1326, 0x1327,
+ 0x1328, 0x1329, 0x132a, 0x132b, 0x132c, 0x132d, 0x132e, 0x132f,
+ 0x1330, 0x1331, 0x1332, 0x1333, 0x1334, 0x1335, 0x1336, 0x1337,
+ 0x1338, 0x1339, 0x133a, 0x133b, 0x133c, 0x133d, 0x133e, 0x133f,
+ 0x1340, 0x1341, 0x1342, 0x1343, 0x1344, 0x1345, 0x1346, 0x1347,
+ 0x1348, 0x1349, 0x134a, 0x134b, 0x134c, 0x134d, 0x134e, 0x134f,
+ 0x1350, 0x1351, 0x1352, 0x1353, 0x1354, 0x1355, 0x1356, 0x1357,
+ 0x1358, 0x1359, 0x135a, 0x0000, 0x0000, 0x0000, 0x0000, 0x135f,
+ 0x1360, 0x1361, 0x1362, 0x1363, 0x1364, 0x1365, 0x1366, 0x1367,
+ 0x1368, 0x1369, 0x136a, 0x136b, 0x136c, 0x136d, 0x136e, 0x136f,
+ 0x1370, 0x1371, 0x1372, 0x1373, 0x1374, 0x1375, 0x1376, 0x1377,
+ 0x1378, 0x1379, 0x137a, 0x137b, 0x137c, 0x0000, 0x0000, 0x0000,
+ 0x1380, 0x1381, 0x1382, 0x1383, 0x1384, 0x1385, 0x1386, 0x1387,
+ 0x1388, 0x1389, 0x138a, 0x138b, 0x138c, 0x138d, 0x138e, 0x138f,
+ 0x1390, 0x1391, 0x1392, 0x1393, 0x1394, 0x1395, 0x1396, 0x1397,
+ 0x1398, 0x1399, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x13a0, 0x13a1, 0x13a2, 0x13a3, 0x13a4, 0x13a5, 0x13a6, 0x13a7,
+ 0x13a8, 0x13a9, 0x13aa, 0x13ab, 0x13ac, 0x13ad, 0x13ae, 0x13af,
+ 0x13b0, 0x13b1, 0x13b2, 0x13b3, 0x13b4, 0x13b5, 0x13b6, 0x13b7,
+ 0x13b8, 0x13b9, 0x13ba, 0x13bb, 0x13bc, 0x13bd, 0x13be, 0x13bf,
+ 0x13c0, 0x13c1, 0x13c2, 0x13c3, 0x13c4, 0x13c5, 0x13c6, 0x13c7,
+ 0x13c8, 0x13c9, 0x13ca, 0x13cb, 0x13cc, 0x13cd, 0x13ce, 0x13cf,
+ 0x13d0, 0x13d1, 0x13d2, 0x13d3, 0x13d4, 0x13d5, 0x13d6, 0x13d7,
+ 0x13d8, 0x13d9, 0x13da, 0x13db, 0x13dc, 0x13dd, 0x13de, 0x13df,
+ 0x13e0, 0x13e1, 0x13e2, 0x13e3, 0x13e4, 0x13e5, 0x13e6, 0x13e7,
+ 0x13e8, 0x13e9, 0x13ea, 0x13eb, 0x13ec, 0x13ed, 0x13ee, 0x13ef,
+ 0x13f0, 0x13f1, 0x13f2, 0x13f3, 0x13f4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x1401, 0x1402, 0x1403, 0x1404, 0x1405, 0x1406, 0x1407,
+ 0x1408, 0x1409, 0x140a, 0x140b, 0x140c, 0x140d, 0x140e, 0x140f,
+ 0x1410, 0x1411, 0x1412, 0x1413, 0x1414, 0x1415, 0x1416, 0x1417,
+ 0x1418, 0x1419, 0x141a, 0x141b, 0x141c, 0x141d, 0x141e, 0x141f,
+ 0x1420, 0x1421, 0x1422, 0x1423, 0x1424, 0x1425, 0x1426, 0x1427,
+ 0x1428, 0x1429, 0x142a, 0x142b, 0x142c, 0x142d, 0x142e, 0x142f,
+ 0x1430, 0x1431, 0x1432, 0x1433, 0x1434, 0x1435, 0x1436, 0x1437,
+ 0x1438, 0x1439, 0x143a, 0x143b, 0x143c, 0x143d, 0x143e, 0x143f,
+ 0x1440, 0x1441, 0x1442, 0x1443, 0x1444, 0x1445, 0x1446, 0x1447,
+ 0x1448, 0x1449, 0x144a, 0x144b, 0x144c, 0x144d, 0x144e, 0x144f,
+ 0x1450, 0x1451, 0x1452, 0x1453, 0x1454, 0x1455, 0x1456, 0x1457,
+ 0x1458, 0x1459, 0x145a, 0x145b, 0x145c, 0x145d, 0x145e, 0x145f,
+ 0x1460, 0x1461, 0x1462, 0x1463, 0x1464, 0x1465, 0x1466, 0x1467,
+ 0x1468, 0x1469, 0x146a, 0x146b, 0x146c, 0x146d, 0x146e, 0x146f,
+ 0x1470, 0x1471, 0x1472, 0x1473, 0x1474, 0x1475, 0x1476, 0x1477,
+ 0x1478, 0x1479, 0x147a, 0x147b, 0x147c, 0x147d, 0x147e, 0x147f,
+ 0x1480, 0x1481, 0x1482, 0x1483, 0x1484, 0x1485, 0x1486, 0x1487,
+ 0x1488, 0x1489, 0x148a, 0x148b, 0x148c, 0x148d, 0x148e, 0x148f,
+ 0x1490, 0x1491, 0x1492, 0x1493, 0x1494, 0x1495, 0x1496, 0x1497,
+ 0x1498, 0x1499, 0x149a, 0x149b, 0x149c, 0x149d, 0x149e, 0x149f,
+ 0x14a0, 0x14a1, 0x14a2, 0x14a3, 0x14a4, 0x14a5, 0x14a6, 0x14a7,
+ 0x14a8, 0x14a9, 0x14aa, 0x14ab, 0x14ac, 0x14ad, 0x14ae, 0x14af,
+ 0x14b0, 0x14b1, 0x14b2, 0x14b3, 0x14b4, 0x14b5, 0x14b6, 0x14b7,
+ 0x14b8, 0x14b9, 0x14ba, 0x14bb, 0x14bc, 0x14bd, 0x14be, 0x14bf,
+ 0x14c0, 0x14c1, 0x14c2, 0x14c3, 0x14c4, 0x14c5, 0x14c6, 0x14c7,
+ 0x14c8, 0x14c9, 0x14ca, 0x14cb, 0x14cc, 0x14cd, 0x14ce, 0x14cf,
+ 0x14d0, 0x14d1, 0x14d2, 0x14d3, 0x14d4, 0x14d5, 0x14d6, 0x14d7,
+ 0x14d8, 0x14d9, 0x14da, 0x14db, 0x14dc, 0x14dd, 0x14de, 0x14df,
+ 0x14e0, 0x14e1, 0x14e2, 0x14e3, 0x14e4, 0x14e5, 0x14e6, 0x14e7,
+ 0x14e8, 0x14e9, 0x14ea, 0x14eb, 0x14ec, 0x14ed, 0x14ee, 0x14ef,
+ 0x14f0, 0x14f1, 0x14f2, 0x14f3, 0x14f4, 0x14f5, 0x14f6, 0x14f7,
+ 0x14f8, 0x14f9, 0x14fa, 0x14fb, 0x14fc, 0x14fd, 0x14fe, 0x14ff,
+ 0x1500, 0x1501, 0x1502, 0x1503, 0x1504, 0x1505, 0x1506, 0x1507,
+ 0x1508, 0x1509, 0x150a, 0x150b, 0x150c, 0x150d, 0x150e, 0x150f,
+ 0x1510, 0x1511, 0x1512, 0x1513, 0x1514, 0x1515, 0x1516, 0x1517,
+ 0x1518, 0x1519, 0x151a, 0x151b, 0x151c, 0x151d, 0x151e, 0x151f,
+ 0x1520, 0x1521, 0x1522, 0x1523, 0x1524, 0x1525, 0x1526, 0x1527,
+ 0x1528, 0x1529, 0x152a, 0x152b, 0x152c, 0x152d, 0x152e, 0x152f,
+ 0x1530, 0x1531, 0x1532, 0x1533, 0x1534, 0x1535, 0x1536, 0x1537,
+ 0x1538, 0x1539, 0x153a, 0x153b, 0x153c, 0x153d, 0x153e, 0x153f,
+ 0x1540, 0x1541, 0x1542, 0x1543, 0x1544, 0x1545, 0x1546, 0x1547,
+ 0x1548, 0x1549, 0x154a, 0x154b, 0x154c, 0x154d, 0x154e, 0x154f,
+ 0x1550, 0x1551, 0x1552, 0x1553, 0x1554, 0x1555, 0x1556, 0x1557,
+ 0x1558, 0x1559, 0x155a, 0x155b, 0x155c, 0x155d, 0x155e, 0x155f,
+ 0x1560, 0x1561, 0x1562, 0x1563, 0x1564, 0x1565, 0x1566, 0x1567,
+ 0x1568, 0x1569, 0x156a, 0x156b, 0x156c, 0x156d, 0x156e, 0x156f,
+ 0x1570, 0x1571, 0x1572, 0x1573, 0x1574, 0x1575, 0x1576, 0x1577,
+ 0x1578, 0x1579, 0x157a, 0x157b, 0x157c, 0x157d, 0x157e, 0x157f,
+ 0x1580, 0x1581, 0x1582, 0x1583, 0x1584, 0x1585, 0x1586, 0x1587,
+ 0x1588, 0x1589, 0x158a, 0x158b, 0x158c, 0x158d, 0x158e, 0x158f,
+ 0x1590, 0x1591, 0x1592, 0x1593, 0x1594, 0x1595, 0x1596, 0x1597,
+ 0x1598, 0x1599, 0x159a, 0x159b, 0x159c, 0x159d, 0x159e, 0x159f,
+ 0x15a0, 0x15a1, 0x15a2, 0x15a3, 0x15a4, 0x15a5, 0x15a6, 0x15a7,
+ 0x15a8, 0x15a9, 0x15aa, 0x15ab, 0x15ac, 0x15ad, 0x15ae, 0x15af,
+ 0x15b0, 0x15b1, 0x15b2, 0x15b3, 0x15b4, 0x15b5, 0x15b6, 0x15b7,
+ 0x15b8, 0x15b9, 0x15ba, 0x15bb, 0x15bc, 0x15bd, 0x15be, 0x15bf,
+ 0x15c0, 0x15c1, 0x15c2, 0x15c3, 0x15c4, 0x15c5, 0x15c6, 0x15c7,
+ 0x15c8, 0x15c9, 0x15ca, 0x15cb, 0x15cc, 0x15cd, 0x15ce, 0x15cf,
+ 0x15d0, 0x15d1, 0x15d2, 0x15d3, 0x15d4, 0x15d5, 0x15d6, 0x15d7,
+ 0x15d8, 0x15d9, 0x15da, 0x15db, 0x15dc, 0x15dd, 0x15de, 0x15df,
+ 0x15e0, 0x15e1, 0x15e2, 0x15e3, 0x15e4, 0x15e5, 0x15e6, 0x15e7,
+ 0x15e8, 0x15e9, 0x15ea, 0x15eb, 0x15ec, 0x15ed, 0x15ee, 0x15ef,
+ 0x15f0, 0x15f1, 0x15f2, 0x15f3, 0x15f4, 0x15f5, 0x15f6, 0x15f7,
+ 0x15f8, 0x15f9, 0x15fa, 0x15fb, 0x15fc, 0x15fd, 0x15fe, 0x15ff,
+ 0x1600, 0x1601, 0x1602, 0x1603, 0x1604, 0x1605, 0x1606, 0x1607,
+ 0x1608, 0x1609, 0x160a, 0x160b, 0x160c, 0x160d, 0x160e, 0x160f,
+ 0x1610, 0x1611, 0x1612, 0x1613, 0x1614, 0x1615, 0x1616, 0x1617,
+ 0x1618, 0x1619, 0x161a, 0x161b, 0x161c, 0x161d, 0x161e, 0x161f,
+ 0x1620, 0x1621, 0x1622, 0x1623, 0x1624, 0x1625, 0x1626, 0x1627,
+ 0x1628, 0x1629, 0x162a, 0x162b, 0x162c, 0x162d, 0x162e, 0x162f,
+ 0x1630, 0x1631, 0x1632, 0x1633, 0x1634, 0x1635, 0x1636, 0x1637,
+ 0x1638, 0x1639, 0x163a, 0x163b, 0x163c, 0x163d, 0x163e, 0x163f,
+ 0x1640, 0x1641, 0x1642, 0x1643, 0x1644, 0x1645, 0x1646, 0x1647,
+ 0x1648, 0x1649, 0x164a, 0x164b, 0x164c, 0x164d, 0x164e, 0x164f,
+ 0x1650, 0x1651, 0x1652, 0x1653, 0x1654, 0x1655, 0x1656, 0x1657,
+ 0x1658, 0x1659, 0x165a, 0x165b, 0x165c, 0x165d, 0x165e, 0x165f,
+ 0x1660, 0x1661, 0x1662, 0x1663, 0x1664, 0x1665, 0x1666, 0x1667,
+ 0x1668, 0x1669, 0x166a, 0x166b, 0x166c, 0x166d, 0x166e, 0x166f,
+ 0x1670, 0x1671, 0x1672, 0x1673, 0x1674, 0x1675, 0x1676, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1680, 0x1681, 0x1682, 0x1683, 0x1684, 0x1685, 0x1686, 0x1687,
+ 0x1688, 0x1689, 0x168a, 0x168b, 0x168c, 0x168d, 0x168e, 0x168f,
+ 0x1690, 0x1691, 0x1692, 0x1693, 0x1694, 0x1695, 0x1696, 0x1697,
+ 0x1698, 0x1699, 0x169a, 0x169b, 0x169c, 0x0000, 0x0000, 0x0000,
+ 0x16a0, 0x16a1, 0x16a2, 0x16a3, 0x16a4, 0x16a5, 0x16a6, 0x16a7,
+ 0x16a8, 0x16a9, 0x16aa, 0x16ab, 0x16ac, 0x16ad, 0x16ae, 0x16af,
+ 0x16b0, 0x16b1, 0x16b2, 0x16b3, 0x16b4, 0x16b5, 0x16b6, 0x16b7,
+ 0x16b8, 0x16b9, 0x16ba, 0x16bb, 0x16bc, 0x16bd, 0x16be, 0x16bf,
+ 0x16c0, 0x16c1, 0x16c2, 0x16c3, 0x16c4, 0x16c5, 0x16c6, 0x16c7,
+ 0x16c8, 0x16c9, 0x16ca, 0x16cb, 0x16cc, 0x16cd, 0x16ce, 0x16cf,
+ 0x16d0, 0x16d1, 0x16d2, 0x16d3, 0x16d4, 0x16d5, 0x16d6, 0x16d7,
+ 0x16d8, 0x16d9, 0x16da, 0x16db, 0x16dc, 0x16dd, 0x16de, 0x16df,
+ 0x16e0, 0x16e1, 0x16e2, 0x16e3, 0x16e4, 0x16e5, 0x16e6, 0x16e7,
+ 0x16e8, 0x16e9, 0x16ea, 0x16eb, 0x16ec, 0x16ed, 0x16ee, 0x16ef,
+ 0x16f0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1700, 0x1701, 0x1702, 0x1703, 0x1704, 0x1705, 0x1706, 0x1707,
+ 0x1708, 0x1709, 0x170a, 0x170b, 0x170c, 0x0000, 0x170e, 0x170f,
+ 0x1710, 0x1711, 0x1712, 0x1713, 0x1714, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1720, 0x1721, 0x1722, 0x1723, 0x1724, 0x1725, 0x1726, 0x1727,
+ 0x1728, 0x1729, 0x172a, 0x172b, 0x172c, 0x172d, 0x172e, 0x172f,
+ 0x1730, 0x1731, 0x1732, 0x1733, 0x1734, 0x1735, 0x1736, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1740, 0x1741, 0x1742, 0x1743, 0x1744, 0x1745, 0x1746, 0x1747,
+ 0x1748, 0x1749, 0x174a, 0x174b, 0x174c, 0x174d, 0x174e, 0x174f,
+ 0x1750, 0x1751, 0x1752, 0x1753, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1760, 0x1761, 0x1762, 0x1763, 0x1764, 0x1765, 0x1766, 0x1767,
+ 0x1768, 0x1769, 0x176a, 0x176b, 0x176c, 0x0000, 0x176e, 0x176f,
+ 0x1770, 0x0000, 0x1772, 0x1773, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1780, 0x1781, 0x1782, 0x1783, 0x1784, 0x1785, 0x1786, 0x1787,
+ 0x1788, 0x1789, 0x178a, 0x178b, 0x178c, 0x178d, 0x178e, 0x178f,
+ 0x1790, 0x1791, 0x1792, 0x1793, 0x1794, 0x1795, 0x1796, 0x1797,
+ 0x1798, 0x1799, 0x179a, 0x179b, 0x179c, 0x179d, 0x179e, 0x179f,
+ 0x17a0, 0x17a1, 0x17a2, 0x17a3, 0x17a4, 0x17a5, 0x17a6, 0x17a7,
+ 0x17a8, 0x17a9, 0x17aa, 0x17ab, 0x17ac, 0x17ad, 0x17ae, 0x17af,
+ 0x17b0, 0x17b1, 0x17b2, 0x17b3, 0x17b4, 0x17b5, 0x17b6, 0x17b7,
+ 0x17b8, 0x17b9, 0x17ba, 0x17bb, 0x17bc, 0x17bd, 0x17be, 0x17bf,
+ 0x17c0, 0x17c1, 0x17c2, 0x17c3, 0x17c4, 0x17c5, 0x17c6, 0x17c7,
+ 0x17c8, 0x17c9, 0x17ca, 0x17cb, 0x17cc, 0x17cd, 0x17ce, 0x17cf,
+ 0x17d0, 0x17d1, 0x17d2, 0x17d3, 0x17d4, 0x17d5, 0x17d6, 0x17d7,
+ 0x17d8, 0x17d9, 0x17da, 0x17db, 0x17dc, 0x17dd, 0x0000, 0x0000,
+ 0x17e0, 0x17e1, 0x17e2, 0x17e3, 0x17e4, 0x17e5, 0x17e6, 0x17e7,
+ 0x17e8, 0x17e9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x17f0, 0x17f1, 0x17f2, 0x17f3, 0x17f4, 0x17f5, 0x17f6, 0x17f7,
+ 0x17f8, 0x17f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1800, 0x1801, 0x1802, 0x1803, 0x1804, 0x1805, 0x1806, 0x1807,
+ 0x1808, 0x1809, 0x180a, 0x180b, 0x180c, 0x180d, 0x180e, 0x0000,
+ 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817,
+ 0x1818, 0x1819, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827,
+ 0x1828, 0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f,
+ 0x1830, 0x1831, 0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837,
+ 0x1838, 0x1839, 0x183a, 0x183b, 0x183c, 0x183d, 0x183e, 0x183f,
+ 0x1840, 0x1841, 0x1842, 0x1843, 0x1844, 0x1845, 0x1846, 0x1847,
+ 0x1848, 0x1849, 0x184a, 0x184b, 0x184c, 0x184d, 0x184e, 0x184f,
+ 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855, 0x1856, 0x1857,
+ 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e, 0x185f,
+ 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867,
+ 0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f,
+ 0x1870, 0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1880, 0x1881, 0x1882, 0x1883, 0x1884, 0x1885, 0x1886, 0x1887,
+ 0x1888, 0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f,
+ 0x1890, 0x1891, 0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897,
+ 0x1898, 0x1899, 0x189a, 0x189b, 0x189c, 0x189d, 0x189e, 0x189f,
+ 0x18a0, 0x18a1, 0x18a2, 0x18a3, 0x18a4, 0x18a5, 0x18a6, 0x18a7,
+ 0x18a8, 0x18a9, 0x18aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1900, 0x1901, 0x1902, 0x1903, 0x1904, 0x1905, 0x1906, 0x1907,
+ 0x1908, 0x1909, 0x190a, 0x190b, 0x190c, 0x190d, 0x190e, 0x190f,
+ 0x1910, 0x1911, 0x1912, 0x1913, 0x1914, 0x1915, 0x1916, 0x1917,
+ 0x1918, 0x1919, 0x191a, 0x191b, 0x191c, 0x0000, 0x0000, 0x0000,
+ 0x1920, 0x1921, 0x1922, 0x1923, 0x1924, 0x1925, 0x1926, 0x1927,
+ 0x1928, 0x1929, 0x192a, 0x192b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1930, 0x1931, 0x1932, 0x1933, 0x1934, 0x1935, 0x1936, 0x1937,
+ 0x1938, 0x1939, 0x193a, 0x193b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1940, 0x0000, 0x0000, 0x0000, 0x1944, 0x1945, 0x1946, 0x1947,
+ 0x1948, 0x1949, 0x194a, 0x194b, 0x194c, 0x194d, 0x194e, 0x194f,
+ 0x1950, 0x1951, 0x1952, 0x1953, 0x1954, 0x1955, 0x1956, 0x1957,
+ 0x1958, 0x1959, 0x195a, 0x195b, 0x195c, 0x195d, 0x195e, 0x195f,
+ 0x1960, 0x1961, 0x1962, 0x1963, 0x1964, 0x1965, 0x1966, 0x1967,
+ 0x1968, 0x1969, 0x196a, 0x196b, 0x196c, 0x196d, 0x0000, 0x0000,
+ 0x1970, 0x1971, 0x1972, 0x1973, 0x1974, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1980, 0x1981, 0x1982, 0x1983, 0x1984, 0x1985, 0x1986, 0x1987,
+ 0x1988, 0x1989, 0x198a, 0x198b, 0x198c, 0x198d, 0x198e, 0x198f,
+ 0x1990, 0x1991, 0x1992, 0x1993, 0x1994, 0x1995, 0x1996, 0x1997,
+ 0x1998, 0x1999, 0x199a, 0x199b, 0x199c, 0x199d, 0x199e, 0x199f,
+ 0x19a0, 0x19a1, 0x19a2, 0x19a3, 0x19a4, 0x19a5, 0x19a6, 0x19a7,
+ 0x19a8, 0x19a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x19b0, 0x19b1, 0x19b2, 0x19b3, 0x19b4, 0x19b5, 0x19b6, 0x19b7,
+ 0x19b8, 0x19b9, 0x19ba, 0x19bb, 0x19bc, 0x19bd, 0x19be, 0x19bf,
+ 0x19c0, 0x19c1, 0x19c2, 0x19c3, 0x19c4, 0x19c5, 0x19c6, 0x19c7,
+ 0x19c8, 0x19c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x19d0, 0x19d1, 0x19d2, 0x19d3, 0x19d4, 0x19d5, 0x19d6, 0x19d7,
+ 0x19d8, 0x19d9, 0x0000, 0x0000, 0x0000, 0x0000, 0x19de, 0x19df,
+ 0x19e0, 0x19e1, 0x19e2, 0x19e3, 0x19e4, 0x19e5, 0x19e6, 0x19e7,
+ 0x19e8, 0x19e9, 0x19ea, 0x19eb, 0x19ec, 0x19ed, 0x19ee, 0x19ef,
+ 0x19f0, 0x19f1, 0x19f2, 0x19f3, 0x19f4, 0x19f5, 0x19f6, 0x19f7,
+ 0x19f8, 0x19f9, 0x19fa, 0x19fb, 0x19fc, 0x19fd, 0x19fe, 0x19ff,
+ 0x1a00, 0x1a01, 0x1a02, 0x1a03, 0x1a04, 0x1a05, 0x1a06, 0x1a07,
+ 0x1a08, 0x1a09, 0x1a0a, 0x1a0b, 0x1a0c, 0x1a0d, 0x1a0e, 0x1a0f,
+ 0x1a10, 0x1a11, 0x1a12, 0x1a13, 0x1a14, 0x1a15, 0x1a16, 0x1a17,
+ 0x1a18, 0x1a19, 0x1a1a, 0x1a1b, 0x0000, 0x0000, 0x1a1e, 0x1a1f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1b00, 0x1b01, 0x1b02, 0x1b03, 0x1b04, 0x1b05, 0x1b06, 0x1b07,
+ 0x1b08, 0x1b09, 0x1b0a, 0x1b0b, 0x1b0c, 0x1b0d, 0x1b0e, 0x1b0f,
+ 0x1b10, 0x1b11, 0x1b12, 0x1b13, 0x1b14, 0x1b15, 0x1b16, 0x1b17,
+ 0x1b18, 0x1b19, 0x1b1a, 0x1b1b, 0x1b1c, 0x1b1d, 0x1b1e, 0x1b1f,
+ 0x1b20, 0x1b21, 0x1b22, 0x1b23, 0x1b24, 0x1b25, 0x1b26, 0x1b27,
+ 0x1b28, 0x1b29, 0x1b2a, 0x1b2b, 0x1b2c, 0x1b2d, 0x1b2e, 0x1b2f,
+ 0x1b30, 0x1b31, 0x1b32, 0x1b33, 0x1b34, 0x1b35, 0x1b36, 0x1b37,
+ 0x1b38, 0x1b39, 0x1b3a, 0x1b3b, 0x1b3c, 0x1b3d, 0x1b3e, 0x1b3f,
+ 0x1b40, 0x1b41, 0x1b42, 0x1b43, 0x1b44, 0x1b45, 0x1b46, 0x1b47,
+ 0x1b48, 0x1b49, 0x1b4a, 0x1b4b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1b50, 0x1b51, 0x1b52, 0x1b53, 0x1b54, 0x1b55, 0x1b56, 0x1b57,
+ 0x1b58, 0x1b59, 0x1b5a, 0x1b5b, 0x1b5c, 0x1b5d, 0x1b5e, 0x1b5f,
+ 0x1b60, 0x1b61, 0x1b62, 0x1b63, 0x1b64, 0x1b65, 0x1b66, 0x1b67,
+ 0x1b68, 0x1b69, 0x1b6a, 0x1b6b, 0x1b6c, 0x1b6d, 0x1b6e, 0x1b6f,
+ 0x1b70, 0x1b71, 0x1b72, 0x1b73, 0x1b74, 0x1b75, 0x1b76, 0x1b77,
+ 0x1b78, 0x1b79, 0x1b7a, 0x1b7b, 0x1b7c, 0x0000, 0x0000, 0x0000,
+ 0x1b80, 0x1b81, 0x1b82, 0x1b83, 0x1b84, 0x1b85, 0x1b86, 0x1b87,
+ 0x1b88, 0x1b89, 0x1b8a, 0x1b8b, 0x1b8c, 0x1b8d, 0x1b8e, 0x1b8f,
+ 0x1b90, 0x1b91, 0x1b92, 0x1b93, 0x1b94, 0x1b95, 0x1b96, 0x1b97,
+ 0x1b98, 0x1b99, 0x1b9a, 0x1b9b, 0x1b9c, 0x1b9d, 0x1b9e, 0x1b9f,
+ 0x1ba0, 0x1ba1, 0x1ba2, 0x1ba3, 0x1ba4, 0x1ba5, 0x1ba6, 0x1ba7,
+ 0x1ba8, 0x1ba9, 0x1baa, 0x0000, 0x0000, 0x0000, 0x1bae, 0x1baf,
+ 0x1bb0, 0x1bb1, 0x1bb2, 0x1bb3, 0x1bb4, 0x1bb5, 0x1bb6, 0x1bb7,
+ 0x1bb8, 0x1bb9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1c00, 0x1c01, 0x1c02, 0x1c03, 0x1c04, 0x1c05, 0x1c06, 0x1c07,
+ 0x1c08, 0x1c09, 0x1c0a, 0x1c0b, 0x1c0c, 0x1c0d, 0x1c0e, 0x1c0f,
+ 0x1c10, 0x1c11, 0x1c12, 0x1c13, 0x1c14, 0x1c15, 0x1c16, 0x1c17,
+ 0x1c18, 0x1c19, 0x1c1a, 0x1c1b, 0x1c1c, 0x1c1d, 0x1c1e, 0x1c1f,
+ 0x1c20, 0x1c21, 0x1c22, 0x1c23, 0x1c24, 0x1c25, 0x1c26, 0x1c27,
+ 0x1c28, 0x1c29, 0x1c2a, 0x1c2b, 0x1c2c, 0x1c2d, 0x1c2e, 0x1c2f,
+ 0x1c30, 0x1c31, 0x1c32, 0x1c33, 0x1c34, 0x1c35, 0x1c36, 0x1c37,
+ 0x0000, 0x0000, 0x0000, 0x1c3b, 0x1c3c, 0x1c3d, 0x1c3e, 0x1c3f,
+ 0x1c40, 0x1c41, 0x1c42, 0x1c43, 0x1c44, 0x1c45, 0x1c46, 0x1c47,
+ 0x1c48, 0x1c49, 0x0000, 0x0000, 0x0000, 0x1c4d, 0x1c4e, 0x1c4f,
+ 0x1c50, 0x1c51, 0x1c52, 0x1c53, 0x1c54, 0x1c55, 0x1c56, 0x1c57,
+ 0x1c58, 0x1c59, 0x1c5a, 0x1c5b, 0x1c5c, 0x1c5d, 0x1c5e, 0x1c5f,
+ 0x1c60, 0x1c61, 0x1c62, 0x1c63, 0x1c64, 0x1c65, 0x1c66, 0x1c67,
+ 0x1c68, 0x1c69, 0x1c6a, 0x1c6b, 0x1c6c, 0x1c6d, 0x1c6e, 0x1c6f,
+ 0x1c70, 0x1c71, 0x1c72, 0x1c73, 0x1c74, 0x1c75, 0x1c76, 0x1c77,
+ 0x1c78, 0x1c79, 0x1c7a, 0x1c7b, 0x1c7c, 0x1c7d, 0x1c7e, 0x1c7f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1d00, 0x1d01, 0x1d02, 0x1d03, 0x1d04, 0x1d05, 0x1d06, 0x1d07,
+ 0x1d08, 0x1d09, 0x1d0a, 0x1d0b, 0x1d0c, 0x1d0d, 0x1d0e, 0x1d0f,
+ 0x1d10, 0x1d11, 0x1d12, 0x1d13, 0x1d14, 0x1d15, 0x1d16, 0x1d17,
+ 0x1d18, 0x1d19, 0x1d1a, 0x1d1b, 0x1d1c, 0x1d1d, 0x1d1e, 0x1d1f,
+ 0x1d20, 0x1d21, 0x1d22, 0x1d23, 0x1d24, 0x1d25, 0x1d26, 0x1d27,
+ 0x1d28, 0x1d29, 0x1d2a, 0x1d2b, 0x1d2c, 0x1d2d, 0x1d2e, 0x1d2f,
+ 0x1d30, 0x1d31, 0x1d32, 0x1d33, 0x1d34, 0x1d35, 0x1d36, 0x1d37,
+ 0x1d38, 0x1d39, 0x1d3a, 0x1d3b, 0x1d3c, 0x1d3d, 0x1d3e, 0x1d3f,
+ 0x1d40, 0x1d41, 0x1d42, 0x1d43, 0x1d44, 0x1d45, 0x1d46, 0x1d47,
+ 0x1d48, 0x1d49, 0x1d4a, 0x1d4b, 0x1d4c, 0x1d4d, 0x1d4e, 0x1d4f,
+ 0x1d50, 0x1d51, 0x1d52, 0x1d53, 0x1d54, 0x1d55, 0x1d56, 0x1d57,
+ 0x1d58, 0x1d59, 0x1d5a, 0x1d5b, 0x1d5c, 0x1d5d, 0x1d5e, 0x1d5f,
+ 0x1d60, 0x1d61, 0x1d62, 0x1d63, 0x1d64, 0x1d65, 0x1d66, 0x1d67,
+ 0x1d68, 0x1d69, 0x1d6a, 0x1d6b, 0x1d6c, 0x1d6d, 0x1d6e, 0x1d6f,
+ 0x1d70, 0x1d71, 0x1d72, 0x1d73, 0x1d74, 0x1d75, 0x1d76, 0x1d77,
+ 0x1d78, 0x1d79, 0x1d7a, 0x1d7b, 0x1d7c, 0x1d7d, 0x1d7e, 0x1d7f,
+ 0x1d80, 0x1d81, 0x1d82, 0x1d83, 0x1d84, 0x1d85, 0x1d86, 0x1d87,
+ 0x1d88, 0x1d89, 0x1d8a, 0x1d8b, 0x1d8c, 0x1d8d, 0x1d8e, 0x1d8f,
+ 0x1d90, 0x1d91, 0x1d92, 0x1d93, 0x1d94, 0x1d95, 0x1d96, 0x1d97,
+ 0x1d98, 0x1d99, 0x1d9a, 0x1d9b, 0x1d9c, 0x1d9d, 0x1d9e, 0x1d9f,
+ 0x1da0, 0x1da1, 0x1da2, 0x1da3, 0x1da4, 0x1da5, 0x1da6, 0x1da7,
+ 0x1da8, 0x1da9, 0x1daa, 0x1dab, 0x1dac, 0x1dad, 0x1dae, 0x1daf,
+ 0x1db0, 0x1db1, 0x1db2, 0x1db3, 0x1db4, 0x1db5, 0x1db6, 0x1db7,
+ 0x1db8, 0x1db9, 0x1dba, 0x1dbb, 0x1dbc, 0x1dbd, 0x1dbe, 0x1dbf,
+ 0x1dc0, 0x1dc1, 0x1dc2, 0x1dc3, 0x1dc4, 0x1dc5, 0x1dc6, 0x1dc7,
+ 0x1dc8, 0x1dc9, 0x1dca, 0x1dcb, 0x1dcc, 0x1dcd, 0x1dce, 0x1dcf,
+ 0x1dd0, 0x1dd1, 0x1dd2, 0x1dd3, 0x1dd4, 0x1dd5, 0x1dd6, 0x1dd7,
+ 0x1dd8, 0x1dd9, 0x1dda, 0x1ddb, 0x1ddc, 0x1ddd, 0x1dde, 0x1ddf,
+ 0x1de0, 0x1de1, 0x1de2, 0x1de3, 0x1de4, 0x1de5, 0x1de6, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1dfe, 0x1dff,
+ 0x1e01, 0x1e01, 0x1e03, 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f,
+ 0x1e11, 0x1e11, 0x1e13, 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17,
+ 0x1e19, 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f,
+ 0x1e21, 0x1e21, 0x1e23, 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27,
+ 0x1e29, 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f,
+ 0x1e31, 0x1e31, 0x1e33, 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37,
+ 0x1e39, 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f,
+ 0x1e41, 0x1e41, 0x1e43, 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47,
+ 0x1e49, 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f,
+ 0x1e51, 0x1e51, 0x1e53, 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57,
+ 0x1e59, 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f,
+ 0x1e61, 0x1e61, 0x1e63, 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67,
+ 0x1e69, 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f,
+ 0x1e71, 0x1e71, 0x1e73, 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77,
+ 0x1e79, 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f,
+ 0x1e81, 0x1e81, 0x1e83, 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87,
+ 0x1e89, 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f,
+ 0x1e91, 0x1e91, 0x1e93, 0x1e93, 0x1e95, 0x1e95, 0x1e96, 0x1e97,
+ 0x1e98, 0x1e99, 0x1e9a, 0x1e9b, 0x1e9c, 0x1e9d, 0x00df, 0x1e9f,
+ 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7,
+ 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf,
+ 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7,
+ 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf,
+ 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7,
+ 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf,
+ 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7,
+ 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf,
+ 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7,
+ 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef,
+ 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7,
+ 0x1ef9, 0x1ef9, 0x1efb, 0x1efb, 0x1efd, 0x1efd, 0x1eff, 0x1eff,
+ 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
+ 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
+ 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x0000, 0x0000,
+ 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x0000, 0x0000,
+ 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
+ 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
+ 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
+ 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
+ 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x0000, 0x0000,
+ 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x0000, 0x0000,
+ 0x1f50, 0x1f51, 0x1f52, 0x1f53, 0x1f54, 0x1f55, 0x1f56, 0x1f57,
+ 0x0000, 0x1f51, 0x0000, 0x1f53, 0x0000, 0x1f55, 0x0000, 0x1f57,
+ 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
+ 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
+ 0x1f70, 0x1f71, 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1f76, 0x1f77,
+ 0x1f78, 0x1f79, 0x1f7a, 0x1f7b, 0x1f7c, 0x1f7d, 0x0000, 0x0000,
+ 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
+ 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
+ 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
+ 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
+ 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
+ 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
+ 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x0000, 0x1fb6, 0x1fb7,
+ 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1fb3, 0x1fbd, 0x1fbe, 0x1fbf,
+ 0x1fc0, 0x1fc1, 0x1fc2, 0x1fc3, 0x1fc4, 0x0000, 0x1fc6, 0x1fc7,
+ 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1fc3, 0x1fcd, 0x1fce, 0x1fcf,
+ 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x0000, 0x0000, 0x1fd6, 0x1fd7,
+ 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x0000, 0x1fdd, 0x1fde, 0x1fdf,
+ 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5, 0x1fe6, 0x1fe7,
+ 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0x1fed, 0x1fee, 0x1fef,
+ 0x0000, 0x0000, 0x1ff2, 0x1ff3, 0x1ff4, 0x0000, 0x1ff6, 0x1ff7,
+ 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x1ff3, 0x1ffd, 0x1ffe, 0x0000,
+ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007,
+ 0x2008, 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x200e, 0x200f,
+ 0x2010, 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017,
+ 0x2018, 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f,
+ 0x2020, 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027,
+ 0x2028, 0x2029, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0x202f,
+ 0x2030, 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037,
+ 0x2038, 0x2039, 0x203a, 0x203b, 0x203c, 0x203d, 0x203e, 0x203f,
+ 0x2040, 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047,
+ 0x2048, 0x2049, 0x204a, 0x204b, 0x204c, 0x204d, 0x204e, 0x204f,
+ 0x2050, 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057,
+ 0x2058, 0x2059, 0x205a, 0x205b, 0x205c, 0x205d, 0x205e, 0x205f,
+ 0x2060, 0x2061, 0x2062, 0x2063, 0x2064, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f,
+ 0x2070, 0x2071, 0x0000, 0x0000, 0x2074, 0x2075, 0x2076, 0x2077,
+ 0x2078, 0x2079, 0x207a, 0x207b, 0x207c, 0x207d, 0x207e, 0x207f,
+ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087,
+ 0x2088, 0x2089, 0x208a, 0x208b, 0x208c, 0x208d, 0x208e, 0x0000,
+ 0x2090, 0x2091, 0x2092, 0x2093, 0x2094, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x20a0, 0x20a1, 0x20a2, 0x20a3, 0x20a4, 0x20a5, 0x20a6, 0x20a7,
+ 0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac, 0x20ad, 0x20ae, 0x20af,
+ 0x20b0, 0x20b1, 0x20b2, 0x20b3, 0x20b4, 0x20b5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x20d0, 0x20d1, 0x20d2, 0x20d3, 0x20d4, 0x20d5, 0x20d6, 0x20d7,
+ 0x20d8, 0x20d9, 0x20da, 0x20db, 0x20dc, 0x20dd, 0x20de, 0x20df,
+ 0x20e0, 0x20e1, 0x20e2, 0x20e3, 0x20e4, 0x20e5, 0x20e6, 0x20e7,
+ 0x20e8, 0x20e9, 0x20ea, 0x20eb, 0x20ec, 0x20ed, 0x20ee, 0x20ef,
+ 0x20f0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107,
+ 0x2108, 0x2109, 0x210a, 0x210b, 0x210c, 0x210d, 0x210e, 0x210f,
+ 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117,
+ 0x2118, 0x2119, 0x211a, 0x211b, 0x211c, 0x211d, 0x211e, 0x211f,
+ 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x03c9, 0x2127,
+ 0x2128, 0x2129, 0x006b, 0x00e5, 0x212c, 0x212d, 0x212e, 0x212f,
+ 0x2130, 0x2131, 0x214e, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137,
+ 0x2138, 0x2139, 0x213a, 0x213b, 0x213c, 0x213d, 0x213e, 0x213f,
+ 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147,
+ 0x2148, 0x2149, 0x214a, 0x214b, 0x214c, 0x214d, 0x214e, 0x214f,
+ 0x0000, 0x0000, 0x0000, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157,
+ 0x2158, 0x2159, 0x215a, 0x215b, 0x215c, 0x215d, 0x215e, 0x215f,
+ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
+ 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
+ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177,
+ 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f,
+ 0x2180, 0x2181, 0x2182, 0x2184, 0x2184, 0x2185, 0x2186, 0x2187,
+ 0x2188, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197,
+ 0x2198, 0x2199, 0x219a, 0x219b, 0x219c, 0x219d, 0x219e, 0x219f,
+ 0x21a0, 0x21a1, 0x21a2, 0x21a3, 0x21a4, 0x21a5, 0x21a6, 0x21a7,
+ 0x21a8, 0x21a9, 0x21aa, 0x21ab, 0x21ac, 0x21ad, 0x21ae, 0x21af,
+ 0x21b0, 0x21b1, 0x21b2, 0x21b3, 0x21b4, 0x21b5, 0x21b6, 0x21b7,
+ 0x21b8, 0x21b9, 0x21ba, 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf,
+ 0x21c0, 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7,
+ 0x21c8, 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf,
+ 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x21d5, 0x21d6, 0x21d7,
+ 0x21d8, 0x21d9, 0x21da, 0x21db, 0x21dc, 0x21dd, 0x21de, 0x21df,
+ 0x21e0, 0x21e1, 0x21e2, 0x21e3, 0x21e4, 0x21e5, 0x21e6, 0x21e7,
+ 0x21e8, 0x21e9, 0x21ea, 0x21eb, 0x21ec, 0x21ed, 0x21ee, 0x21ef,
+ 0x21f0, 0x21f1, 0x21f2, 0x21f3, 0x21f4, 0x21f5, 0x21f6, 0x21f7,
+ 0x21f8, 0x21f9, 0x21fa, 0x21fb, 0x21fc, 0x21fd, 0x21fe, 0x21ff,
+ 0x2200, 0x2201, 0x2202, 0x2203, 0x2204, 0x2205, 0x2206, 0x2207,
+ 0x2208, 0x2209, 0x220a, 0x220b, 0x220c, 0x220d, 0x220e, 0x220f,
+ 0x2210, 0x2211, 0x2212, 0x2213, 0x2214, 0x2215, 0x2216, 0x2217,
+ 0x2218, 0x2219, 0x221a, 0x221b, 0x221c, 0x221d, 0x221e, 0x221f,
+ 0x2220, 0x2221, 0x2222, 0x2223, 0x2224, 0x2225, 0x2226, 0x2227,
+ 0x2228, 0x2229, 0x222a, 0x222b, 0x222c, 0x222d, 0x222e, 0x222f,
+ 0x2230, 0x2231, 0x2232, 0x2233, 0x2234, 0x2235, 0x2236, 0x2237,
+ 0x2238, 0x2239, 0x223a, 0x223b, 0x223c, 0x223d, 0x223e, 0x223f,
+ 0x2240, 0x2241, 0x2242, 0x2243, 0x2244, 0x2245, 0x2246, 0x2247,
+ 0x2248, 0x2249, 0x224a, 0x224b, 0x224c, 0x224d, 0x224e, 0x224f,
+ 0x2250, 0x2251, 0x2252, 0x2253, 0x2254, 0x2255, 0x2256, 0x2257,
+ 0x2258, 0x2259, 0x225a, 0x225b, 0x225c, 0x225d, 0x225e, 0x225f,
+ 0x2260, 0x2261, 0x2262, 0x2263, 0x2264, 0x2265, 0x2266, 0x2267,
+ 0x2268, 0x2269, 0x226a, 0x226b, 0x226c, 0x226d, 0x226e, 0x226f,
+ 0x2270, 0x2271, 0x2272, 0x2273, 0x2274, 0x2275, 0x2276, 0x2277,
+ 0x2278, 0x2279, 0x227a, 0x227b, 0x227c, 0x227d, 0x227e, 0x227f,
+ 0x2280, 0x2281, 0x2282, 0x2283, 0x2284, 0x2285, 0x2286, 0x2287,
+ 0x2288, 0x2289, 0x228a, 0x228b, 0x228c, 0x228d, 0x228e, 0x228f,
+ 0x2290, 0x2291, 0x2292, 0x2293, 0x2294, 0x2295, 0x2296, 0x2297,
+ 0x2298, 0x2299, 0x229a, 0x229b, 0x229c, 0x229d, 0x229e, 0x229f,
+ 0x22a0, 0x22a1, 0x22a2, 0x22a3, 0x22a4, 0x22a5, 0x22a6, 0x22a7,
+ 0x22a8, 0x22a9, 0x22aa, 0x22ab, 0x22ac, 0x22ad, 0x22ae, 0x22af,
+ 0x22b0, 0x22b1, 0x22b2, 0x22b3, 0x22b4, 0x22b5, 0x22b6, 0x22b7,
+ 0x22b8, 0x22b9, 0x22ba, 0x22bb, 0x22bc, 0x22bd, 0x22be, 0x22bf,
+ 0x22c0, 0x22c1, 0x22c2, 0x22c3, 0x22c4, 0x22c5, 0x22c6, 0x22c7,
+ 0x22c8, 0x22c9, 0x22ca, 0x22cb, 0x22cc, 0x22cd, 0x22ce, 0x22cf,
+ 0x22d0, 0x22d1, 0x22d2, 0x22d3, 0x22d4, 0x22d5, 0x22d6, 0x22d7,
+ 0x22d8, 0x22d9, 0x22da, 0x22db, 0x22dc, 0x22dd, 0x22de, 0x22df,
+ 0x22e0, 0x22e1, 0x22e2, 0x22e3, 0x22e4, 0x22e5, 0x22e6, 0x22e7,
+ 0x22e8, 0x22e9, 0x22ea, 0x22eb, 0x22ec, 0x22ed, 0x22ee, 0x22ef,
+ 0x22f0, 0x22f1, 0x22f2, 0x22f3, 0x22f4, 0x22f5, 0x22f6, 0x22f7,
+ 0x22f8, 0x22f9, 0x22fa, 0x22fb, 0x22fc, 0x22fd, 0x22fe, 0x22ff,
+ 0x2300, 0x2301, 0x2302, 0x2303, 0x2304, 0x2305, 0x2306, 0x2307,
+ 0x2308, 0x2309, 0x230a, 0x230b, 0x230c, 0x230d, 0x230e, 0x230f,
+ 0x2310, 0x2311, 0x2312, 0x2313, 0x2314, 0x2315, 0x2316, 0x2317,
+ 0x2318, 0x2319, 0x231a, 0x231b, 0x231c, 0x231d, 0x231e, 0x231f,
+ 0x2320, 0x2321, 0x2322, 0x2323, 0x2324, 0x2325, 0x2326, 0x2327,
+ 0x2328, 0x2329, 0x232a, 0x232b, 0x232c, 0x232d, 0x232e, 0x232f,
+ 0x2330, 0x2331, 0x2332, 0x2333, 0x2334, 0x2335, 0x2336, 0x2337,
+ 0x2338, 0x2339, 0x233a, 0x233b, 0x233c, 0x233d, 0x233e, 0x233f,
+ 0x2340, 0x2341, 0x2342, 0x2343, 0x2344, 0x2345, 0x2346, 0x2347,
+ 0x2348, 0x2349, 0x234a, 0x234b, 0x234c, 0x234d, 0x234e, 0x234f,
+ 0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357,
+ 0x2358, 0x2359, 0x235a, 0x235b, 0x235c, 0x235d, 0x235e, 0x235f,
+ 0x2360, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367,
+ 0x2368, 0x2369, 0x236a, 0x236b, 0x236c, 0x236d, 0x236e, 0x236f,
+ 0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377,
+ 0x2378, 0x2379, 0x237a, 0x237b, 0x237c, 0x237d, 0x237e, 0x237f,
+ 0x2380, 0x2381, 0x2382, 0x2383, 0x2384, 0x2385, 0x2386, 0x2387,
+ 0x2388, 0x2389, 0x238a, 0x238b, 0x238c, 0x238d, 0x238e, 0x238f,
+ 0x2390, 0x2391, 0x2392, 0x2393, 0x2394, 0x2395, 0x2396, 0x2397,
+ 0x2398, 0x2399, 0x239a, 0x239b, 0x239c, 0x239d, 0x239e, 0x239f,
+ 0x23a0, 0x23a1, 0x23a2, 0x23a3, 0x23a4, 0x23a5, 0x23a6, 0x23a7,
+ 0x23a8, 0x23a9, 0x23aa, 0x23ab, 0x23ac, 0x23ad, 0x23ae, 0x23af,
+ 0x23b0, 0x23b1, 0x23b2, 0x23b3, 0x23b4, 0x23b5, 0x23b6, 0x23b7,
+ 0x23b8, 0x23b9, 0x23ba, 0x23bb, 0x23bc, 0x23bd, 0x23be, 0x23bf,
+ 0x23c0, 0x23c1, 0x23c2, 0x23c3, 0x23c4, 0x23c5, 0x23c6, 0x23c7,
+ 0x23c8, 0x23c9, 0x23ca, 0x23cb, 0x23cc, 0x23cd, 0x23ce, 0x23cf,
+ 0x23d0, 0x23d1, 0x23d2, 0x23d3, 0x23d4, 0x23d5, 0x23d6, 0x23d7,
+ 0x23d8, 0x23d9, 0x23da, 0x23db, 0x23dc, 0x23dd, 0x23de, 0x23df,
+ 0x23e0, 0x23e1, 0x23e2, 0x23e3, 0x23e4, 0x23e5, 0x23e6, 0x23e7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407,
+ 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f,
+ 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417,
+ 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f,
+ 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447,
+ 0x2448, 0x2449, 0x244a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
+ 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f,
+ 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477,
+ 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f,
+ 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487,
+ 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f,
+ 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497,
+ 0x2498, 0x2499, 0x249a, 0x249b, 0x249c, 0x249d, 0x249e, 0x249f,
+ 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7,
+ 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af,
+ 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x24d0, 0x24d1,
+ 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9,
+ 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1,
+ 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9,
+ 0x24d0, 0x24d1, 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7,
+ 0x24d8, 0x24d9, 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df,
+ 0x24e0, 0x24e1, 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7,
+ 0x24e8, 0x24e9, 0x24ea, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef,
+ 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0x24f5, 0x24f6, 0x24f7,
+ 0x24f8, 0x24f9, 0x24fa, 0x24fb, 0x24fc, 0x24fd, 0x24fe, 0x24ff,
+ 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506, 0x2507,
+ 0x2508, 0x2509, 0x250a, 0x250b, 0x250c, 0x250d, 0x250e, 0x250f,
+ 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516, 0x2517,
+ 0x2518, 0x2519, 0x251a, 0x251b, 0x251c, 0x251d, 0x251e, 0x251f,
+ 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526, 0x2527,
+ 0x2528, 0x2529, 0x252a, 0x252b, 0x252c, 0x252d, 0x252e, 0x252f,
+ 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537,
+ 0x2538, 0x2539, 0x253a, 0x253b, 0x253c, 0x253d, 0x253e, 0x253f,
+ 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
+ 0x2548, 0x2549, 0x254a, 0x254b, 0x254c, 0x254d, 0x254e, 0x254f,
+ 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557,
+ 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f,
+ 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567,
+ 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x256d, 0x256e, 0x256f,
+ 0x2570, 0x2571, 0x2572, 0x2573, 0x2574, 0x2575, 0x2576, 0x2577,
+ 0x2578, 0x2579, 0x257a, 0x257b, 0x257c, 0x257d, 0x257e, 0x257f,
+ 0x2580, 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587,
+ 0x2588, 0x2589, 0x258a, 0x258b, 0x258c, 0x258d, 0x258e, 0x258f,
+ 0x2590, 0x2591, 0x2592, 0x2593, 0x2594, 0x2595, 0x2596, 0x2597,
+ 0x2598, 0x2599, 0x259a, 0x259b, 0x259c, 0x259d, 0x259e, 0x259f,
+ 0x25a0, 0x25a1, 0x25a2, 0x25a3, 0x25a4, 0x25a5, 0x25a6, 0x25a7,
+ 0x25a8, 0x25a9, 0x25aa, 0x25ab, 0x25ac, 0x25ad, 0x25ae, 0x25af,
+ 0x25b0, 0x25b1, 0x25b2, 0x25b3, 0x25b4, 0x25b5, 0x25b6, 0x25b7,
+ 0x25b8, 0x25b9, 0x25ba, 0x25bb, 0x25bc, 0x25bd, 0x25be, 0x25bf,
+ 0x25c0, 0x25c1, 0x25c2, 0x25c3, 0x25c4, 0x25c5, 0x25c6, 0x25c7,
+ 0x25c8, 0x25c9, 0x25ca, 0x25cb, 0x25cc, 0x25cd, 0x25ce, 0x25cf,
+ 0x25d0, 0x25d1, 0x25d2, 0x25d3, 0x25d4, 0x25d5, 0x25d6, 0x25d7,
+ 0x25d8, 0x25d9, 0x25da, 0x25db, 0x25dc, 0x25dd, 0x25de, 0x25df,
+ 0x25e0, 0x25e1, 0x25e2, 0x25e3, 0x25e4, 0x25e5, 0x25e6, 0x25e7,
+ 0x25e8, 0x25e9, 0x25ea, 0x25eb, 0x25ec, 0x25ed, 0x25ee, 0x25ef,
+ 0x25f0, 0x25f1, 0x25f2, 0x25f3, 0x25f4, 0x25f5, 0x25f6, 0x25f7,
+ 0x25f8, 0x25f9, 0x25fa, 0x25fb, 0x25fc, 0x25fd, 0x25fe, 0x25ff,
+ 0x2600, 0x2601, 0x2602, 0x2603, 0x2604, 0x2605, 0x2606, 0x2607,
+ 0x2608, 0x2609, 0x260a, 0x260b, 0x260c, 0x260d, 0x260e, 0x260f,
+ 0x2610, 0x2611, 0x2612, 0x2613, 0x2614, 0x2615, 0x2616, 0x2617,
+ 0x2618, 0x2619, 0x261a, 0x261b, 0x261c, 0x261d, 0x261e, 0x261f,
+ 0x2620, 0x2621, 0x2622, 0x2623, 0x2624, 0x2625, 0x2626, 0x2627,
+ 0x2628, 0x2629, 0x262a, 0x262b, 0x262c, 0x262d, 0x262e, 0x262f,
+ 0x2630, 0x2631, 0x2632, 0x2633, 0x2634, 0x2635, 0x2636, 0x2637,
+ 0x2638, 0x2639, 0x263a, 0x263b, 0x263c, 0x263d, 0x263e, 0x263f,
+ 0x2640, 0x2641, 0x2642, 0x2643, 0x2644, 0x2645, 0x2646, 0x2647,
+ 0x2648, 0x2649, 0x264a, 0x264b, 0x264c, 0x264d, 0x264e, 0x264f,
+ 0x2650, 0x2651, 0x2652, 0x2653, 0x2654, 0x2655, 0x2656, 0x2657,
+ 0x2658, 0x2659, 0x265a, 0x265b, 0x265c, 0x265d, 0x265e, 0x265f,
+ 0x2660, 0x2661, 0x2662, 0x2663, 0x2664, 0x2665, 0x2666, 0x2667,
+ 0x2668, 0x2669, 0x266a, 0x266b, 0x266c, 0x266d, 0x266e, 0x266f,
+ 0x2670, 0x2671, 0x2672, 0x2673, 0x2674, 0x2675, 0x2676, 0x2677,
+ 0x2678, 0x2679, 0x267a, 0x267b, 0x267c, 0x267d, 0x267e, 0x267f,
+ 0x2680, 0x2681, 0x2682, 0x2683, 0x2684, 0x2685, 0x2686, 0x2687,
+ 0x2688, 0x2689, 0x268a, 0x268b, 0x268c, 0x268d, 0x268e, 0x268f,
+ 0x2690, 0x2691, 0x2692, 0x2693, 0x2694, 0x2695, 0x2696, 0x2697,
+ 0x2698, 0x2699, 0x269a, 0x269b, 0x269c, 0x269d, 0x0000, 0x0000,
+ 0x26a0, 0x26a1, 0x26a2, 0x26a3, 0x26a4, 0x26a5, 0x26a6, 0x26a7,
+ 0x26a8, 0x26a9, 0x26aa, 0x26ab, 0x26ac, 0x26ad, 0x26ae, 0x26af,
+ 0x26b0, 0x26b1, 0x26b2, 0x26b3, 0x26b4, 0x26b5, 0x26b6, 0x26b7,
+ 0x26b8, 0x26b9, 0x26ba, 0x26bb, 0x26bc, 0x0000, 0x0000, 0x0000,
+ 0x26c0, 0x26c1, 0x26c2, 0x26c3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2701, 0x2702, 0x2703, 0x2704, 0x0000, 0x2706, 0x2707,
+ 0x2708, 0x2709, 0x0000, 0x0000, 0x270c, 0x270d, 0x270e, 0x270f,
+ 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717,
+ 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f,
+ 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727,
+ 0x0000, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f,
+ 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737,
+ 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f,
+ 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747,
+ 0x2748, 0x2749, 0x274a, 0x274b, 0x0000, 0x274d, 0x0000, 0x274f,
+ 0x2750, 0x2751, 0x2752, 0x0000, 0x0000, 0x0000, 0x2756, 0x0000,
+ 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x0000,
+ 0x0000, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767,
+ 0x2768, 0x2769, 0x276a, 0x276b, 0x276c, 0x276d, 0x276e, 0x276f,
+ 0x2770, 0x2771, 0x2772, 0x2773, 0x2774, 0x2775, 0x2776, 0x2777,
+ 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0x277f,
+ 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787,
+ 0x2788, 0x2789, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f,
+ 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x0000, 0x0000, 0x0000,
+ 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f,
+ 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7,
+ 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af,
+ 0x0000, 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7,
+ 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, 0x0000,
+ 0x27c0, 0x27c1, 0x27c2, 0x27c3, 0x27c4, 0x27c5, 0x27c6, 0x27c7,
+ 0x27c8, 0x27c9, 0x27ca, 0x0000, 0x27cc, 0x0000, 0x0000, 0x0000,
+ 0x27d0, 0x27d1, 0x27d2, 0x27d3, 0x27d4, 0x27d5, 0x27d6, 0x27d7,
+ 0x27d8, 0x27d9, 0x27da, 0x27db, 0x27dc, 0x27dd, 0x27de, 0x27df,
+ 0x27e0, 0x27e1, 0x27e2, 0x27e3, 0x27e4, 0x27e5, 0x27e6, 0x27e7,
+ 0x27e8, 0x27e9, 0x27ea, 0x27eb, 0x27ec, 0x27ed, 0x27ee, 0x27ef,
+ 0x27f0, 0x27f1, 0x27f2, 0x27f3, 0x27f4, 0x27f5, 0x27f6, 0x27f7,
+ 0x27f8, 0x27f9, 0x27fa, 0x27fb, 0x27fc, 0x27fd, 0x27fe, 0x27ff,
+ 0x2800, 0x2801, 0x2802, 0x2803, 0x2804, 0x2805, 0x2806, 0x2807,
+ 0x2808, 0x2809, 0x280a, 0x280b, 0x280c, 0x280d, 0x280e, 0x280f,
+ 0x2810, 0x2811, 0x2812, 0x2813, 0x2814, 0x2815, 0x2816, 0x2817,
+ 0x2818, 0x2819, 0x281a, 0x281b, 0x281c, 0x281d, 0x281e, 0x281f,
+ 0x2820, 0x2821, 0x2822, 0x2823, 0x2824, 0x2825, 0x2826, 0x2827,
+ 0x2828, 0x2829, 0x282a, 0x282b, 0x282c, 0x282d, 0x282e, 0x282f,
+ 0x2830, 0x2831, 0x2832, 0x2833, 0x2834, 0x2835, 0x2836, 0x2837,
+ 0x2838, 0x2839, 0x283a, 0x283b, 0x283c, 0x283d, 0x283e, 0x283f,
+ 0x2840, 0x2841, 0x2842, 0x2843, 0x2844, 0x2845, 0x2846, 0x2847,
+ 0x2848, 0x2849, 0x284a, 0x284b, 0x284c, 0x284d, 0x284e, 0x284f,
+ 0x2850, 0x2851, 0x2852, 0x2853, 0x2854, 0x2855, 0x2856, 0x2857,
+ 0x2858, 0x2859, 0x285a, 0x285b, 0x285c, 0x285d, 0x285e, 0x285f,
+ 0x2860, 0x2861, 0x2862, 0x2863, 0x2864, 0x2865, 0x2866, 0x2867,
+ 0x2868, 0x2869, 0x286a, 0x286b, 0x286c, 0x286d, 0x286e, 0x286f,
+ 0x2870, 0x2871, 0x2872, 0x2873, 0x2874, 0x2875, 0x2876, 0x2877,
+ 0x2878, 0x2879, 0x287a, 0x287b, 0x287c, 0x287d, 0x287e, 0x287f,
+ 0x2880, 0x2881, 0x2882, 0x2883, 0x2884, 0x2885, 0x2886, 0x2887,
+ 0x2888, 0x2889, 0x288a, 0x288b, 0x288c, 0x288d, 0x288e, 0x288f,
+ 0x2890, 0x2891, 0x2892, 0x2893, 0x2894, 0x2895, 0x2896, 0x2897,
+ 0x2898, 0x2899, 0x289a, 0x289b, 0x289c, 0x289d, 0x289e, 0x289f,
+ 0x28a0, 0x28a1, 0x28a2, 0x28a3, 0x28a4, 0x28a5, 0x28a6, 0x28a7,
+ 0x28a8, 0x28a9, 0x28aa, 0x28ab, 0x28ac, 0x28ad, 0x28ae, 0x28af,
+ 0x28b0, 0x28b1, 0x28b2, 0x28b3, 0x28b4, 0x28b5, 0x28b6, 0x28b7,
+ 0x28b8, 0x28b9, 0x28ba, 0x28bb, 0x28bc, 0x28bd, 0x28be, 0x28bf,
+ 0x28c0, 0x28c1, 0x28c2, 0x28c3, 0x28c4, 0x28c5, 0x28c6, 0x28c7,
+ 0x28c8, 0x28c9, 0x28ca, 0x28cb, 0x28cc, 0x28cd, 0x28ce, 0x28cf,
+ 0x28d0, 0x28d1, 0x28d2, 0x28d3, 0x28d4, 0x28d5, 0x28d6, 0x28d7,
+ 0x28d8, 0x28d9, 0x28da, 0x28db, 0x28dc, 0x28dd, 0x28de, 0x28df,
+ 0x28e0, 0x28e1, 0x28e2, 0x28e3, 0x28e4, 0x28e5, 0x28e6, 0x28e7,
+ 0x28e8, 0x28e9, 0x28ea, 0x28eb, 0x28ec, 0x28ed, 0x28ee, 0x28ef,
+ 0x28f0, 0x28f1, 0x28f2, 0x28f3, 0x28f4, 0x28f5, 0x28f6, 0x28f7,
+ 0x28f8, 0x28f9, 0x28fa, 0x28fb, 0x28fc, 0x28fd, 0x28fe, 0x28ff,
+ 0x2900, 0x2901, 0x2902, 0x2903, 0x2904, 0x2905, 0x2906, 0x2907,
+ 0x2908, 0x2909, 0x290a, 0x290b, 0x290c, 0x290d, 0x290e, 0x290f,
+ 0x2910, 0x2911, 0x2912, 0x2913, 0x2914, 0x2915, 0x2916, 0x2917,
+ 0x2918, 0x2919, 0x291a, 0x291b, 0x291c, 0x291d, 0x291e, 0x291f,
+ 0x2920, 0x2921, 0x2922, 0x2923, 0x2924, 0x2925, 0x2926, 0x2927,
+ 0x2928, 0x2929, 0x292a, 0x292b, 0x292c, 0x292d, 0x292e, 0x292f,
+ 0x2930, 0x2931, 0x2932, 0x2933, 0x2934, 0x2935, 0x2936, 0x2937,
+ 0x2938, 0x2939, 0x293a, 0x293b, 0x293c, 0x293d, 0x293e, 0x293f,
+ 0x2940, 0x2941, 0x2942, 0x2943, 0x2944, 0x2945, 0x2946, 0x2947,
+ 0x2948, 0x2949, 0x294a, 0x294b, 0x294c, 0x294d, 0x294e, 0x294f,
+ 0x2950, 0x2951, 0x2952, 0x2953, 0x2954, 0x2955, 0x2956, 0x2957,
+ 0x2958, 0x2959, 0x295a, 0x295b, 0x295c, 0x295d, 0x295e, 0x295f,
+ 0x2960, 0x2961, 0x2962, 0x2963, 0x2964, 0x2965, 0x2966, 0x2967,
+ 0x2968, 0x2969, 0x296a, 0x296b, 0x296c, 0x296d, 0x296e, 0x296f,
+ 0x2970, 0x2971, 0x2972, 0x2973, 0x2974, 0x2975, 0x2976, 0x2977,
+ 0x2978, 0x2979, 0x297a, 0x297b, 0x297c, 0x297d, 0x297e, 0x297f,
+ 0x2980, 0x2981, 0x2982, 0x2983, 0x2984, 0x2985, 0x2986, 0x2987,
+ 0x2988, 0x2989, 0x298a, 0x298b, 0x298c, 0x298d, 0x298e, 0x298f,
+ 0x2990, 0x2991, 0x2992, 0x2993, 0x2994, 0x2995, 0x2996, 0x2997,
+ 0x2998, 0x2999, 0x299a, 0x299b, 0x299c, 0x299d, 0x299e, 0x299f,
+ 0x29a0, 0x29a1, 0x29a2, 0x29a3, 0x29a4, 0x29a5, 0x29a6, 0x29a7,
+ 0x29a8, 0x29a9, 0x29aa, 0x29ab, 0x29ac, 0x29ad, 0x29ae, 0x29af,
+ 0x29b0, 0x29b1, 0x29b2, 0x29b3, 0x29b4, 0x29b5, 0x29b6, 0x29b7,
+ 0x29b8, 0x29b9, 0x29ba, 0x29bb, 0x29bc, 0x29bd, 0x29be, 0x29bf,
+ 0x29c0, 0x29c1, 0x29c2, 0x29c3, 0x29c4, 0x29c5, 0x29c6, 0x29c7,
+ 0x29c8, 0x29c9, 0x29ca, 0x29cb, 0x29cc, 0x29cd, 0x29ce, 0x29cf,
+ 0x29d0, 0x29d1, 0x29d2, 0x29d3, 0x29d4, 0x29d5, 0x29d6, 0x29d7,
+ 0x29d8, 0x29d9, 0x29da, 0x29db, 0x29dc, 0x29dd, 0x29de, 0x29df,
+ 0x29e0, 0x29e1, 0x29e2, 0x29e3, 0x29e4, 0x29e5, 0x29e6, 0x29e7,
+ 0x29e8, 0x29e9, 0x29ea, 0x29eb, 0x29ec, 0x29ed, 0x29ee, 0x29ef,
+ 0x29f0, 0x29f1, 0x29f2, 0x29f3, 0x29f4, 0x29f5, 0x29f6, 0x29f7,
+ 0x29f8, 0x29f9, 0x29fa, 0x29fb, 0x29fc, 0x29fd, 0x29fe, 0x29ff,
+ 0x2a00, 0x2a01, 0x2a02, 0x2a03, 0x2a04, 0x2a05, 0x2a06, 0x2a07,
+ 0x2a08, 0x2a09, 0x2a0a, 0x2a0b, 0x2a0c, 0x2a0d, 0x2a0e, 0x2a0f,
+ 0x2a10, 0x2a11, 0x2a12, 0x2a13, 0x2a14, 0x2a15, 0x2a16, 0x2a17,
+ 0x2a18, 0x2a19, 0x2a1a, 0x2a1b, 0x2a1c, 0x2a1d, 0x2a1e, 0x2a1f,
+ 0x2a20, 0x2a21, 0x2a22, 0x2a23, 0x2a24, 0x2a25, 0x2a26, 0x2a27,
+ 0x2a28, 0x2a29, 0x2a2a, 0x2a2b, 0x2a2c, 0x2a2d, 0x2a2e, 0x2a2f,
+ 0x2a30, 0x2a31, 0x2a32, 0x2a33, 0x2a34, 0x2a35, 0x2a36, 0x2a37,
+ 0x2a38, 0x2a39, 0x2a3a, 0x2a3b, 0x2a3c, 0x2a3d, 0x2a3e, 0x2a3f,
+ 0x2a40, 0x2a41, 0x2a42, 0x2a43, 0x2a44, 0x2a45, 0x2a46, 0x2a47,
+ 0x2a48, 0x2a49, 0x2a4a, 0x2a4b, 0x2a4c, 0x2a4d, 0x2a4e, 0x2a4f,
+ 0x2a50, 0x2a51, 0x2a52, 0x2a53, 0x2a54, 0x2a55, 0x2a56, 0x2a57,
+ 0x2a58, 0x2a59, 0x2a5a, 0x2a5b, 0x2a5c, 0x2a5d, 0x2a5e, 0x2a5f,
+ 0x2a60, 0x2a61, 0x2a62, 0x2a63, 0x2a64, 0x2a65, 0x2a66, 0x2a67,
+ 0x2a68, 0x2a69, 0x2a6a, 0x2a6b, 0x2a6c, 0x2a6d, 0x2a6e, 0x2a6f,
+ 0x2a70, 0x2a71, 0x2a72, 0x2a73, 0x2a74, 0x2a75, 0x2a76, 0x2a77,
+ 0x2a78, 0x2a79, 0x2a7a, 0x2a7b, 0x2a7c, 0x2a7d, 0x2a7e, 0x2a7f,
+ 0x2a80, 0x2a81, 0x2a82, 0x2a83, 0x2a84, 0x2a85, 0x2a86, 0x2a87,
+ 0x2a88, 0x2a89, 0x2a8a, 0x2a8b, 0x2a8c, 0x2a8d, 0x2a8e, 0x2a8f,
+ 0x2a90, 0x2a91, 0x2a92, 0x2a93, 0x2a94, 0x2a95, 0x2a96, 0x2a97,
+ 0x2a98, 0x2a99, 0x2a9a, 0x2a9b, 0x2a9c, 0x2a9d, 0x2a9e, 0x2a9f,
+ 0x2aa0, 0x2aa1, 0x2aa2, 0x2aa3, 0x2aa4, 0x2aa5, 0x2aa6, 0x2aa7,
+ 0x2aa8, 0x2aa9, 0x2aaa, 0x2aab, 0x2aac, 0x2aad, 0x2aae, 0x2aaf,
+ 0x2ab0, 0x2ab1, 0x2ab2, 0x2ab3, 0x2ab4, 0x2ab5, 0x2ab6, 0x2ab7,
+ 0x2ab8, 0x2ab9, 0x2aba, 0x2abb, 0x2abc, 0x2abd, 0x2abe, 0x2abf,
+ 0x2ac0, 0x2ac1, 0x2ac2, 0x2ac3, 0x2ac4, 0x2ac5, 0x2ac6, 0x2ac7,
+ 0x2ac8, 0x2ac9, 0x2aca, 0x2acb, 0x2acc, 0x2acd, 0x2ace, 0x2acf,
+ 0x2ad0, 0x2ad1, 0x2ad2, 0x2ad3, 0x2ad4, 0x2ad5, 0x2ad6, 0x2ad7,
+ 0x2ad8, 0x2ad9, 0x2ada, 0x2adb, 0x2adc, 0x2add, 0x2ade, 0x2adf,
+ 0x2ae0, 0x2ae1, 0x2ae2, 0x2ae3, 0x2ae4, 0x2ae5, 0x2ae6, 0x2ae7,
+ 0x2ae8, 0x2ae9, 0x2aea, 0x2aeb, 0x2aec, 0x2aed, 0x2aee, 0x2aef,
+ 0x2af0, 0x2af1, 0x2af2, 0x2af3, 0x2af4, 0x2af5, 0x2af6, 0x2af7,
+ 0x2af8, 0x2af9, 0x2afa, 0x2afb, 0x2afc, 0x2afd, 0x2afe, 0x2aff,
+ 0x2b00, 0x2b01, 0x2b02, 0x2b03, 0x2b04, 0x2b05, 0x2b06, 0x2b07,
+ 0x2b08, 0x2b09, 0x2b0a, 0x2b0b, 0x2b0c, 0x2b0d, 0x2b0e, 0x2b0f,
+ 0x2b10, 0x2b11, 0x2b12, 0x2b13, 0x2b14, 0x2b15, 0x2b16, 0x2b17,
+ 0x2b18, 0x2b19, 0x2b1a, 0x2b1b, 0x2b1c, 0x2b1d, 0x2b1e, 0x2b1f,
+ 0x2b20, 0x2b21, 0x2b22, 0x2b23, 0x2b24, 0x2b25, 0x2b26, 0x2b27,
+ 0x2b28, 0x2b29, 0x2b2a, 0x2b2b, 0x2b2c, 0x2b2d, 0x2b2e, 0x2b2f,
+ 0x2b30, 0x2b31, 0x2b32, 0x2b33, 0x2b34, 0x2b35, 0x2b36, 0x2b37,
+ 0x2b38, 0x2b39, 0x2b3a, 0x2b3b, 0x2b3c, 0x2b3d, 0x2b3e, 0x2b3f,
+ 0x2b40, 0x2b41, 0x2b42, 0x2b43, 0x2b44, 0x2b45, 0x2b46, 0x2b47,
+ 0x2b48, 0x2b49, 0x2b4a, 0x2b4b, 0x2b4c, 0x0000, 0x0000, 0x0000,
+ 0x2b50, 0x2b51, 0x2b52, 0x2b53, 0x2b54, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2c30, 0x2c31, 0x2c32, 0x2c33, 0x2c34, 0x2c35, 0x2c36, 0x2c37,
+ 0x2c38, 0x2c39, 0x2c3a, 0x2c3b, 0x2c3c, 0x2c3d, 0x2c3e, 0x2c3f,
+ 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47,
+ 0x2c48, 0x2c49, 0x2c4a, 0x2c4b, 0x2c4c, 0x2c4d, 0x2c4e, 0x2c4f,
+ 0x2c50, 0x2c51, 0x2c52, 0x2c53, 0x2c54, 0x2c55, 0x2c56, 0x2c57,
+ 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x0000,
+ 0x2c30, 0x2c31, 0x2c32, 0x2c33, 0x2c34, 0x2c35, 0x2c36, 0x2c37,
+ 0x2c38, 0x2c39, 0x2c3a, 0x2c3b, 0x2c3c, 0x2c3d, 0x2c3e, 0x2c3f,
+ 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47,
+ 0x2c48, 0x2c49, 0x2c4a, 0x2c4b, 0x2c4c, 0x2c4d, 0x2c4e, 0x2c4f,
+ 0x2c50, 0x2c51, 0x2c52, 0x2c53, 0x2c54, 0x2c55, 0x2c56, 0x2c57,
+ 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x0000,
+ 0x2c61, 0x2c61, 0x026b, 0x1d7d, 0x027d, 0x2c65, 0x2c66, 0x2c68,
+ 0x2c68, 0x2c6a, 0x2c6a, 0x2c6c, 0x2c6c, 0x0251, 0x0271, 0x0250,
+ 0x0000, 0x2c71, 0x2c73, 0x2c73, 0x2c74, 0x2c76, 0x2c76, 0x2c77,
+ 0x2c78, 0x2c79, 0x2c7a, 0x2c7b, 0x2c7c, 0x2c7d, 0x0000, 0x0000,
+ 0x2c81, 0x2c81, 0x2c83, 0x2c83, 0x2c85, 0x2c85, 0x2c87, 0x2c87,
+ 0x2c89, 0x2c89, 0x2c8b, 0x2c8b, 0x2c8d, 0x2c8d, 0x2c8f, 0x2c8f,
+ 0x2c91, 0x2c91, 0x2c93, 0x2c93, 0x2c95, 0x2c95, 0x2c97, 0x2c97,
+ 0x2c99, 0x2c99, 0x2c9b, 0x2c9b, 0x2c9d, 0x2c9d, 0x2c9f, 0x2c9f,
+ 0x2ca1, 0x2ca1, 0x2ca3, 0x2ca3, 0x2ca5, 0x2ca5, 0x2ca7, 0x2ca7,
+ 0x2ca9, 0x2ca9, 0x2cab, 0x2cab, 0x2cad, 0x2cad, 0x2caf, 0x2caf,
+ 0x2cb1, 0x2cb1, 0x2cb3, 0x2cb3, 0x2cb5, 0x2cb5, 0x2cb7, 0x2cb7,
+ 0x2cb9, 0x2cb9, 0x2cbb, 0x2cbb, 0x2cbd, 0x2cbd, 0x2cbf, 0x2cbf,
+ 0x2cc1, 0x2cc1, 0x2cc3, 0x2cc3, 0x2cc5, 0x2cc5, 0x2cc7, 0x2cc7,
+ 0x2cc9, 0x2cc9, 0x2ccb, 0x2ccb, 0x2ccd, 0x2ccd, 0x2ccf, 0x2ccf,
+ 0x2cd1, 0x2cd1, 0x2cd3, 0x2cd3, 0x2cd5, 0x2cd5, 0x2cd7, 0x2cd7,
+ 0x2cd9, 0x2cd9, 0x2cdb, 0x2cdb, 0x2cdd, 0x2cdd, 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1, 0x2ce3, 0x2ce3, 0x2ce4, 0x2ce5, 0x2ce6, 0x2ce7,
+ 0x2ce8, 0x2ce9, 0x2cea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2cf9, 0x2cfa, 0x2cfb, 0x2cfc, 0x2cfd, 0x2cfe, 0x2cff,
+ 0x2d00, 0x2d01, 0x2d02, 0x2d03, 0x2d04, 0x2d05, 0x2d06, 0x2d07,
+ 0x2d08, 0x2d09, 0x2d0a, 0x2d0b, 0x2d0c, 0x2d0d, 0x2d0e, 0x2d0f,
+ 0x2d10, 0x2d11, 0x2d12, 0x2d13, 0x2d14, 0x2d15, 0x2d16, 0x2d17,
+ 0x2d18, 0x2d19, 0x2d1a, 0x2d1b, 0x2d1c, 0x2d1d, 0x2d1e, 0x2d1f,
+ 0x2d20, 0x2d21, 0x2d22, 0x2d23, 0x2d24, 0x2d25, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2d30, 0x2d31, 0x2d32, 0x2d33, 0x2d34, 0x2d35, 0x2d36, 0x2d37,
+ 0x2d38, 0x2d39, 0x2d3a, 0x2d3b, 0x2d3c, 0x2d3d, 0x2d3e, 0x2d3f,
+ 0x2d40, 0x2d41, 0x2d42, 0x2d43, 0x2d44, 0x2d45, 0x2d46, 0x2d47,
+ 0x2d48, 0x2d49, 0x2d4a, 0x2d4b, 0x2d4c, 0x2d4d, 0x2d4e, 0x2d4f,
+ 0x2d50, 0x2d51, 0x2d52, 0x2d53, 0x2d54, 0x2d55, 0x2d56, 0x2d57,
+ 0x2d58, 0x2d59, 0x2d5a, 0x2d5b, 0x2d5c, 0x2d5d, 0x2d5e, 0x2d5f,
+ 0x2d60, 0x2d61, 0x2d62, 0x2d63, 0x2d64, 0x2d65, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2d6f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2d80, 0x2d81, 0x2d82, 0x2d83, 0x2d84, 0x2d85, 0x2d86, 0x2d87,
+ 0x2d88, 0x2d89, 0x2d8a, 0x2d8b, 0x2d8c, 0x2d8d, 0x2d8e, 0x2d8f,
+ 0x2d90, 0x2d91, 0x2d92, 0x2d93, 0x2d94, 0x2d95, 0x2d96, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2da0, 0x2da1, 0x2da2, 0x2da3, 0x2da4, 0x2da5, 0x2da6, 0x0000,
+ 0x2da8, 0x2da9, 0x2daa, 0x2dab, 0x2dac, 0x2dad, 0x2dae, 0x0000,
+ 0x2db0, 0x2db1, 0x2db2, 0x2db3, 0x2db4, 0x2db5, 0x2db6, 0x0000,
+ 0x2db8, 0x2db9, 0x2dba, 0x2dbb, 0x2dbc, 0x2dbd, 0x2dbe, 0x0000,
+ 0x2dc0, 0x2dc1, 0x2dc2, 0x2dc3, 0x2dc4, 0x2dc5, 0x2dc6, 0x0000,
+ 0x2dc8, 0x2dc9, 0x2dca, 0x2dcb, 0x2dcc, 0x2dcd, 0x2dce, 0x0000,
+ 0x2dd0, 0x2dd1, 0x2dd2, 0x2dd3, 0x2dd4, 0x2dd5, 0x2dd6, 0x0000,
+ 0x2dd8, 0x2dd9, 0x2dda, 0x2ddb, 0x2ddc, 0x2ddd, 0x2dde, 0x0000,
+ 0x2de0, 0x2de1, 0x2de2, 0x2de3, 0x2de4, 0x2de5, 0x2de6, 0x2de7,
+ 0x2de8, 0x2de9, 0x2dea, 0x2deb, 0x2dec, 0x2ded, 0x2dee, 0x2def,
+ 0x2df0, 0x2df1, 0x2df2, 0x2df3, 0x2df4, 0x2df5, 0x2df6, 0x2df7,
+ 0x2df8, 0x2df9, 0x2dfa, 0x2dfb, 0x2dfc, 0x2dfd, 0x2dfe, 0x2dff,
+ 0x2e00, 0x2e01, 0x2e02, 0x2e03, 0x2e04, 0x2e05, 0x2e06, 0x2e07,
+ 0x2e08, 0x2e09, 0x2e0a, 0x2e0b, 0x2e0c, 0x2e0d, 0x2e0e, 0x2e0f,
+ 0x2e10, 0x2e11, 0x2e12, 0x2e13, 0x2e14, 0x2e15, 0x2e16, 0x2e17,
+ 0x2e18, 0x2e19, 0x2e1a, 0x2e1b, 0x2e1c, 0x2e1d, 0x2e1e, 0x2e1f,
+ 0x2e20, 0x2e21, 0x2e22, 0x2e23, 0x2e24, 0x2e25, 0x2e26, 0x2e27,
+ 0x2e28, 0x2e29, 0x2e2a, 0x2e2b, 0x2e2c, 0x2e2d, 0x2e2e, 0x2e2f,
+ 0x2e30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2e80, 0x2e81, 0x2e82, 0x2e83, 0x2e84, 0x2e85, 0x2e86, 0x2e87,
+ 0x2e88, 0x2e89, 0x2e8a, 0x2e8b, 0x2e8c, 0x2e8d, 0x2e8e, 0x2e8f,
+ 0x2e90, 0x2e91, 0x2e92, 0x2e93, 0x2e94, 0x2e95, 0x2e96, 0x2e97,
+ 0x2e98, 0x2e99, 0x0000, 0x2e9b, 0x2e9c, 0x2e9d, 0x2e9e, 0x2e9f,
+ 0x2ea0, 0x2ea1, 0x2ea2, 0x2ea3, 0x2ea4, 0x2ea5, 0x2ea6, 0x2ea7,
+ 0x2ea8, 0x2ea9, 0x2eaa, 0x2eab, 0x2eac, 0x2ead, 0x2eae, 0x2eaf,
+ 0x2eb0, 0x2eb1, 0x2eb2, 0x2eb3, 0x2eb4, 0x2eb5, 0x2eb6, 0x2eb7,
+ 0x2eb8, 0x2eb9, 0x2eba, 0x2ebb, 0x2ebc, 0x2ebd, 0x2ebe, 0x2ebf,
+ 0x2ec0, 0x2ec1, 0x2ec2, 0x2ec3, 0x2ec4, 0x2ec5, 0x2ec6, 0x2ec7,
+ 0x2ec8, 0x2ec9, 0x2eca, 0x2ecb, 0x2ecc, 0x2ecd, 0x2ece, 0x2ecf,
+ 0x2ed0, 0x2ed1, 0x2ed2, 0x2ed3, 0x2ed4, 0x2ed5, 0x2ed6, 0x2ed7,
+ 0x2ed8, 0x2ed9, 0x2eda, 0x2edb, 0x2edc, 0x2edd, 0x2ede, 0x2edf,
+ 0x2ee0, 0x2ee1, 0x2ee2, 0x2ee3, 0x2ee4, 0x2ee5, 0x2ee6, 0x2ee7,
+ 0x2ee8, 0x2ee9, 0x2eea, 0x2eeb, 0x2eec, 0x2eed, 0x2eee, 0x2eef,
+ 0x2ef0, 0x2ef1, 0x2ef2, 0x2ef3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2f00, 0x2f01, 0x2f02, 0x2f03, 0x2f04, 0x2f05, 0x2f06, 0x2f07,
+ 0x2f08, 0x2f09, 0x2f0a, 0x2f0b, 0x2f0c, 0x2f0d, 0x2f0e, 0x2f0f,
+ 0x2f10, 0x2f11, 0x2f12, 0x2f13, 0x2f14, 0x2f15, 0x2f16, 0x2f17,
+ 0x2f18, 0x2f19, 0x2f1a, 0x2f1b, 0x2f1c, 0x2f1d, 0x2f1e, 0x2f1f,
+ 0x2f20, 0x2f21, 0x2f22, 0x2f23, 0x2f24, 0x2f25, 0x2f26, 0x2f27,
+ 0x2f28, 0x2f29, 0x2f2a, 0x2f2b, 0x2f2c, 0x2f2d, 0x2f2e, 0x2f2f,
+ 0x2f30, 0x2f31, 0x2f32, 0x2f33, 0x2f34, 0x2f35, 0x2f36, 0x2f37,
+ 0x2f38, 0x2f39, 0x2f3a, 0x2f3b, 0x2f3c, 0x2f3d, 0x2f3e, 0x2f3f,
+ 0x2f40, 0x2f41, 0x2f42, 0x2f43, 0x2f44, 0x2f45, 0x2f46, 0x2f47,
+ 0x2f48, 0x2f49, 0x2f4a, 0x2f4b, 0x2f4c, 0x2f4d, 0x2f4e, 0x2f4f,
+ 0x2f50, 0x2f51, 0x2f52, 0x2f53, 0x2f54, 0x2f55, 0x2f56, 0x2f57,
+ 0x2f58, 0x2f59, 0x2f5a, 0x2f5b, 0x2f5c, 0x2f5d, 0x2f5e, 0x2f5f,
+ 0x2f60, 0x2f61, 0x2f62, 0x2f63, 0x2f64, 0x2f65, 0x2f66, 0x2f67,
+ 0x2f68, 0x2f69, 0x2f6a, 0x2f6b, 0x2f6c, 0x2f6d, 0x2f6e, 0x2f6f,
+ 0x2f70, 0x2f71, 0x2f72, 0x2f73, 0x2f74, 0x2f75, 0x2f76, 0x2f77,
+ 0x2f78, 0x2f79, 0x2f7a, 0x2f7b, 0x2f7c, 0x2f7d, 0x2f7e, 0x2f7f,
+ 0x2f80, 0x2f81, 0x2f82, 0x2f83, 0x2f84, 0x2f85, 0x2f86, 0x2f87,
+ 0x2f88, 0x2f89, 0x2f8a, 0x2f8b, 0x2f8c, 0x2f8d, 0x2f8e, 0x2f8f,
+ 0x2f90, 0x2f91, 0x2f92, 0x2f93, 0x2f94, 0x2f95, 0x2f96, 0x2f97,
+ 0x2f98, 0x2f99, 0x2f9a, 0x2f9b, 0x2f9c, 0x2f9d, 0x2f9e, 0x2f9f,
+ 0x2fa0, 0x2fa1, 0x2fa2, 0x2fa3, 0x2fa4, 0x2fa5, 0x2fa6, 0x2fa7,
+ 0x2fa8, 0x2fa9, 0x2faa, 0x2fab, 0x2fac, 0x2fad, 0x2fae, 0x2faf,
+ 0x2fb0, 0x2fb1, 0x2fb2, 0x2fb3, 0x2fb4, 0x2fb5, 0x2fb6, 0x2fb7,
+ 0x2fb8, 0x2fb9, 0x2fba, 0x2fbb, 0x2fbc, 0x2fbd, 0x2fbe, 0x2fbf,
+ 0x2fc0, 0x2fc1, 0x2fc2, 0x2fc3, 0x2fc4, 0x2fc5, 0x2fc6, 0x2fc7,
+ 0x2fc8, 0x2fc9, 0x2fca, 0x2fcb, 0x2fcc, 0x2fcd, 0x2fce, 0x2fcf,
+ 0x2fd0, 0x2fd1, 0x2fd2, 0x2fd3, 0x2fd4, 0x2fd5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2ff0, 0x2ff1, 0x2ff2, 0x2ff3, 0x2ff4, 0x2ff5, 0x2ff6, 0x2ff7,
+ 0x2ff8, 0x2ff9, 0x2ffa, 0x2ffb, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3000, 0x3001, 0x3002, 0x3003, 0x3004, 0x3005, 0x3006, 0x3007,
+ 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f,
+ 0x3010, 0x3011, 0x3012, 0x3013, 0x3014, 0x3015, 0x3016, 0x3017,
+ 0x3018, 0x3019, 0x301a, 0x301b, 0x301c, 0x301d, 0x301e, 0x301f,
+ 0x3020, 0x3021, 0x3022, 0x3023, 0x3024, 0x3025, 0x3026, 0x3027,
+ 0x3028, 0x3029, 0x302a, 0x302b, 0x302c, 0x302d, 0x302e, 0x302f,
+ 0x3030, 0x3031, 0x3032, 0x3033, 0x3034, 0x3035, 0x3036, 0x3037,
+ 0x3038, 0x3039, 0x303a, 0x303b, 0x303c, 0x303d, 0x303e, 0x303f,
+ 0x0000, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047,
+ 0x3048, 0x3049, 0x304a, 0x304b, 0x304c, 0x304d, 0x304e, 0x304f,
+ 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057,
+ 0x3058, 0x3059, 0x305a, 0x305b, 0x305c, 0x305d, 0x305e, 0x305f,
+ 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067,
+ 0x3068, 0x3069, 0x306a, 0x306b, 0x306c, 0x306d, 0x306e, 0x306f,
+ 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077,
+ 0x3078, 0x3079, 0x307a, 0x307b, 0x307c, 0x307d, 0x307e, 0x307f,
+ 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087,
+ 0x3088, 0x3089, 0x308a, 0x308b, 0x308c, 0x308d, 0x308e, 0x308f,
+ 0x3090, 0x3091, 0x3092, 0x3093, 0x3094, 0x3095, 0x3096, 0x0000,
+ 0x0000, 0x3099, 0x309a, 0x309b, 0x309c, 0x309d, 0x309e, 0x309f,
+ 0x30a0, 0x30a1, 0x30a2, 0x30a3, 0x30a4, 0x30a5, 0x30a6, 0x30a7,
+ 0x30a8, 0x30a9, 0x30aa, 0x30ab, 0x30ac, 0x30ad, 0x30ae, 0x30af,
+ 0x30b0, 0x30b1, 0x30b2, 0x30b3, 0x30b4, 0x30b5, 0x30b6, 0x30b7,
+ 0x30b8, 0x30b9, 0x30ba, 0x30bb, 0x30bc, 0x30bd, 0x30be, 0x30bf,
+ 0x30c0, 0x30c1, 0x30c2, 0x30c3, 0x30c4, 0x30c5, 0x30c6, 0x30c7,
+ 0x30c8, 0x30c9, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf,
+ 0x30d0, 0x30d1, 0x30d2, 0x30d3, 0x30d4, 0x30d5, 0x30d6, 0x30d7,
+ 0x30d8, 0x30d9, 0x30da, 0x30db, 0x30dc, 0x30dd, 0x30de, 0x30df,
+ 0x30e0, 0x30e1, 0x30e2, 0x30e3, 0x30e4, 0x30e5, 0x30e6, 0x30e7,
+ 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ee, 0x30ef,
+ 0x30f0, 0x30f1, 0x30f2, 0x30f3, 0x30f4, 0x30f5, 0x30f6, 0x30f7,
+ 0x30f8, 0x30f9, 0x30fa, 0x30fb, 0x30fc, 0x30fd, 0x30fe, 0x30ff,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3105, 0x3106, 0x3107,
+ 0x3108, 0x3109, 0x310a, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f,
+ 0x3110, 0x3111, 0x3112, 0x3113, 0x3114, 0x3115, 0x3116, 0x3117,
+ 0x3118, 0x3119, 0x311a, 0x311b, 0x311c, 0x311d, 0x311e, 0x311f,
+ 0x3120, 0x3121, 0x3122, 0x3123, 0x3124, 0x3125, 0x3126, 0x3127,
+ 0x3128, 0x3129, 0x312a, 0x312b, 0x312c, 0x312d, 0x0000, 0x0000,
+ 0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137,
+ 0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f,
+ 0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147,
+ 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f,
+ 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157,
+ 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f,
+ 0x3160, 0x3161, 0x3162, 0x3163, 0x3164, 0x3165, 0x3166, 0x3167,
+ 0x3168, 0x3169, 0x316a, 0x316b, 0x316c, 0x316d, 0x316e, 0x316f,
+ 0x3170, 0x3171, 0x3172, 0x3173, 0x3174, 0x3175, 0x3176, 0x3177,
+ 0x3178, 0x3179, 0x317a, 0x317b, 0x317c, 0x317d, 0x317e, 0x317f,
+ 0x3180, 0x3181, 0x3182, 0x3183, 0x3184, 0x3185, 0x3186, 0x3187,
+ 0x3188, 0x3189, 0x318a, 0x318b, 0x318c, 0x318d, 0x318e, 0x0000,
+ 0x3190, 0x3191, 0x3192, 0x3193, 0x3194, 0x3195, 0x3196, 0x3197,
+ 0x3198, 0x3199, 0x319a, 0x319b, 0x319c, 0x319d, 0x319e, 0x319f,
+ 0x31a0, 0x31a1, 0x31a2, 0x31a3, 0x31a4, 0x31a5, 0x31a6, 0x31a7,
+ 0x31a8, 0x31a9, 0x31aa, 0x31ab, 0x31ac, 0x31ad, 0x31ae, 0x31af,
+ 0x31b0, 0x31b1, 0x31b2, 0x31b3, 0x31b4, 0x31b5, 0x31b6, 0x31b7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x31c0, 0x31c1, 0x31c2, 0x31c3, 0x31c4, 0x31c5, 0x31c6, 0x31c7,
+ 0x31c8, 0x31c9, 0x31ca, 0x31cb, 0x31cc, 0x31cd, 0x31ce, 0x31cf,
+ 0x31d0, 0x31d1, 0x31d2, 0x31d3, 0x31d4, 0x31d5, 0x31d6, 0x31d7,
+ 0x31d8, 0x31d9, 0x31da, 0x31db, 0x31dc, 0x31dd, 0x31de, 0x31df,
+ 0x31e0, 0x31e1, 0x31e2, 0x31e3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x31f0, 0x31f1, 0x31f2, 0x31f3, 0x31f4, 0x31f5, 0x31f6, 0x31f7,
+ 0x31f8, 0x31f9, 0x31fa, 0x31fb, 0x31fc, 0x31fd, 0x31fe, 0x31ff,
+ 0x3200, 0x3201, 0x3202, 0x3203, 0x3204, 0x3205, 0x3206, 0x3207,
+ 0x3208, 0x3209, 0x320a, 0x320b, 0x320c, 0x320d, 0x320e, 0x320f,
+ 0x3210, 0x3211, 0x3212, 0x3213, 0x3214, 0x3215, 0x3216, 0x3217,
+ 0x3218, 0x3219, 0x321a, 0x321b, 0x321c, 0x321d, 0x321e, 0x0000,
+ 0x3220, 0x3221, 0x3222, 0x3223, 0x3224, 0x3225, 0x3226, 0x3227,
+ 0x3228, 0x3229, 0x322a, 0x322b, 0x322c, 0x322d, 0x322e, 0x322f,
+ 0x3230, 0x3231, 0x3232, 0x3233, 0x3234, 0x3235, 0x3236, 0x3237,
+ 0x3238, 0x3239, 0x323a, 0x323b, 0x323c, 0x323d, 0x323e, 0x323f,
+ 0x3240, 0x3241, 0x3242, 0x3243, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3250, 0x3251, 0x3252, 0x3253, 0x3254, 0x3255, 0x3256, 0x3257,
+ 0x3258, 0x3259, 0x325a, 0x325b, 0x325c, 0x325d, 0x325e, 0x325f,
+ 0x3260, 0x3261, 0x3262, 0x3263, 0x3264, 0x3265, 0x3266, 0x3267,
+ 0x3268, 0x3269, 0x326a, 0x326b, 0x326c, 0x326d, 0x326e, 0x326f,
+ 0x3270, 0x3271, 0x3272, 0x3273, 0x3274, 0x3275, 0x3276, 0x3277,
+ 0x3278, 0x3279, 0x327a, 0x327b, 0x327c, 0x327d, 0x327e, 0x327f,
+ 0x3280, 0x3281, 0x3282, 0x3283, 0x3284, 0x3285, 0x3286, 0x3287,
+ 0x3288, 0x3289, 0x328a, 0x328b, 0x328c, 0x328d, 0x328e, 0x328f,
+ 0x3290, 0x3291, 0x3292, 0x3293, 0x3294, 0x3295, 0x3296, 0x3297,
+ 0x3298, 0x3299, 0x329a, 0x329b, 0x329c, 0x329d, 0x329e, 0x329f,
+ 0x32a0, 0x32a1, 0x32a2, 0x32a3, 0x32a4, 0x32a5, 0x32a6, 0x32a7,
+ 0x32a8, 0x32a9, 0x32aa, 0x32ab, 0x32ac, 0x32ad, 0x32ae, 0x32af,
+ 0x32b0, 0x32b1, 0x32b2, 0x32b3, 0x32b4, 0x32b5, 0x32b6, 0x32b7,
+ 0x32b8, 0x32b9, 0x32ba, 0x32bb, 0x32bc, 0x32bd, 0x32be, 0x32bf,
+ 0x32c0, 0x32c1, 0x32c2, 0x32c3, 0x32c4, 0x32c5, 0x32c6, 0x32c7,
+ 0x32c8, 0x32c9, 0x32ca, 0x32cb, 0x32cc, 0x32cd, 0x32ce, 0x32cf,
+ 0x32d0, 0x32d1, 0x32d2, 0x32d3, 0x32d4, 0x32d5, 0x32d6, 0x32d7,
+ 0x32d8, 0x32d9, 0x32da, 0x32db, 0x32dc, 0x32dd, 0x32de, 0x32df,
+ 0x32e0, 0x32e1, 0x32e2, 0x32e3, 0x32e4, 0x32e5, 0x32e6, 0x32e7,
+ 0x32e8, 0x32e9, 0x32ea, 0x32eb, 0x32ec, 0x32ed, 0x32ee, 0x32ef,
+ 0x32f0, 0x32f1, 0x32f2, 0x32f3, 0x32f4, 0x32f5, 0x32f6, 0x32f7,
+ 0x32f8, 0x32f9, 0x32fa, 0x32fb, 0x32fc, 0x32fd, 0x32fe, 0x0000,
+ 0x3300, 0x3301, 0x3302, 0x3303, 0x3304, 0x3305, 0x3306, 0x3307,
+ 0x3308, 0x3309, 0x330a, 0x330b, 0x330c, 0x330d, 0x330e, 0x330f,
+ 0x3310, 0x3311, 0x3312, 0x3313, 0x3314, 0x3315, 0x3316, 0x3317,
+ 0x3318, 0x3319, 0x331a, 0x331b, 0x331c, 0x331d, 0x331e, 0x331f,
+ 0x3320, 0x3321, 0x3322, 0x3323, 0x3324, 0x3325, 0x3326, 0x3327,
+ 0x3328, 0x3329, 0x332a, 0x332b, 0x332c, 0x332d, 0x332e, 0x332f,
+ 0x3330, 0x3331, 0x3332, 0x3333, 0x3334, 0x3335, 0x3336, 0x3337,
+ 0x3338, 0x3339, 0x333a, 0x333b, 0x333c, 0x333d, 0x333e, 0x333f,
+ 0x3340, 0x3341, 0x3342, 0x3343, 0x3344, 0x3345, 0x3346, 0x3347,
+ 0x3348, 0x3349, 0x334a, 0x334b, 0x334c, 0x334d, 0x334e, 0x334f,
+ 0x3350, 0x3351, 0x3352, 0x3353, 0x3354, 0x3355, 0x3356, 0x3357,
+ 0x3358, 0x3359, 0x335a, 0x335b, 0x335c, 0x335d, 0x335e, 0x335f,
+ 0x3360, 0x3361, 0x3362, 0x3363, 0x3364, 0x3365, 0x3366, 0x3367,
+ 0x3368, 0x3369, 0x336a, 0x336b, 0x336c, 0x336d, 0x336e, 0x336f,
+ 0x3370, 0x3371, 0x3372, 0x3373, 0x3374, 0x3375, 0x3376, 0x3377,
+ 0x3378, 0x3379, 0x337a, 0x337b, 0x337c, 0x337d, 0x337e, 0x337f,
+ 0x3380, 0x3381, 0x3382, 0x3383, 0x3384, 0x3385, 0x3386, 0x3387,
+ 0x3388, 0x3389, 0x338a, 0x338b, 0x338c, 0x338d, 0x338e, 0x338f,
+ 0x3390, 0x3391, 0x3392, 0x3393, 0x3394, 0x3395, 0x3396, 0x3397,
+ 0x3398, 0x3399, 0x339a, 0x339b, 0x339c, 0x339d, 0x339e, 0x339f,
+ 0x33a0, 0x33a1, 0x33a2, 0x33a3, 0x33a4, 0x33a5, 0x33a6, 0x33a7,
+ 0x33a8, 0x33a9, 0x33aa, 0x33ab, 0x33ac, 0x33ad, 0x33ae, 0x33af,
+ 0x33b0, 0x33b1, 0x33b2, 0x33b3, 0x33b4, 0x33b5, 0x33b6, 0x33b7,
+ 0x33b8, 0x33b9, 0x33ba, 0x33bb, 0x33bc, 0x33bd, 0x33be, 0x33bf,
+ 0x33c0, 0x33c1, 0x33c2, 0x33c3, 0x33c4, 0x33c5, 0x33c6, 0x33c7,
+ 0x33c8, 0x33c9, 0x33ca, 0x33cb, 0x33cc, 0x33cd, 0x33ce, 0x33cf,
+ 0x33d0, 0x33d1, 0x33d2, 0x33d3, 0x33d4, 0x33d5, 0x33d6, 0x33d7,
+ 0x33d8, 0x33d9, 0x33da, 0x33db, 0x33dc, 0x33dd, 0x33de, 0x33df,
+ 0x33e0, 0x33e1, 0x33e2, 0x33e3, 0x33e4, 0x33e5, 0x33e6, 0x33e7,
+ 0x33e8, 0x33e9, 0x33ea, 0x33eb, 0x33ec, 0x33ed, 0x33ee, 0x33ef,
+ 0x33f0, 0x33f1, 0x33f2, 0x33f3, 0x33f4, 0x33f5, 0x33f6, 0x33f7,
+ 0x33f8, 0x33f9, 0x33fa, 0x33fb, 0x33fc, 0x33fd, 0x33fe, 0x33ff,
+ 0x3400, 0x3401, 0x3402, 0x3403, 0x3404, 0x3405, 0x3406, 0x3407,
+ 0x3408, 0x3409, 0x340a, 0x340b, 0x340c, 0x340d, 0x340e, 0x340f,
+ 0x3410, 0x3411, 0x3412, 0x3413, 0x3414, 0x3415, 0x3416, 0x3417,
+ 0x3418, 0x3419, 0x341a, 0x341b, 0x341c, 0x341d, 0x341e, 0x341f,
+ 0x3420, 0x3421, 0x3422, 0x3423, 0x3424, 0x3425, 0x3426, 0x3427,
+ 0x3428, 0x3429, 0x342a, 0x342b, 0x342c, 0x342d, 0x342e, 0x342f,
+ 0x3430, 0x3431, 0x3432, 0x3433, 0x3434, 0x3435, 0x3436, 0x3437,
+ 0x3438, 0x3439, 0x343a, 0x343b, 0x343c, 0x343d, 0x343e, 0x343f,
+ 0x3440, 0x3441, 0x3442, 0x3443, 0x3444, 0x3445, 0x3446, 0x3447,
+ 0x3448, 0x3449, 0x344a, 0x344b, 0x344c, 0x344d, 0x344e, 0x344f,
+ 0x3450, 0x3451, 0x3452, 0x3453, 0x3454, 0x3455, 0x3456, 0x3457,
+ 0x3458, 0x3459, 0x345a, 0x345b, 0x345c, 0x345d, 0x345e, 0x345f,
+ 0x3460, 0x3461, 0x3462, 0x3463, 0x3464, 0x3465, 0x3466, 0x3467,
+ 0x3468, 0x3469, 0x346a, 0x346b, 0x346c, 0x346d, 0x346e, 0x346f,
+ 0x3470, 0x3471, 0x3472, 0x3473, 0x3474, 0x3475, 0x3476, 0x3477,
+ 0x3478, 0x3479, 0x347a, 0x347b, 0x347c, 0x347d, 0x347e, 0x347f,
+ 0x3480, 0x3481, 0x3482, 0x3483, 0x3484, 0x3485, 0x3486, 0x3487,
+ 0x3488, 0x3489, 0x348a, 0x348b, 0x348c, 0x348d, 0x348e, 0x348f,
+ 0x3490, 0x3491, 0x3492, 0x3493, 0x3494, 0x3495, 0x3496, 0x3497,
+ 0x3498, 0x3499, 0x349a, 0x349b, 0x349c, 0x349d, 0x349e, 0x349f,
+ 0x34a0, 0x34a1, 0x34a2, 0x34a3, 0x34a4, 0x34a5, 0x34a6, 0x34a7,
+ 0x34a8, 0x34a9, 0x34aa, 0x34ab, 0x34ac, 0x34ad, 0x34ae, 0x34af,
+ 0x34b0, 0x34b1, 0x34b2, 0x34b3, 0x34b4, 0x34b5, 0x34b6, 0x34b7,
+ 0x34b8, 0x34b9, 0x34ba, 0x34bb, 0x34bc, 0x34bd, 0x34be, 0x34bf,
+ 0x34c0, 0x34c1, 0x34c2, 0x34c3, 0x34c4, 0x34c5, 0x34c6, 0x34c7,
+ 0x34c8, 0x34c9, 0x34ca, 0x34cb, 0x34cc, 0x34cd, 0x34ce, 0x34cf,
+ 0x34d0, 0x34d1, 0x34d2, 0x34d3, 0x34d4, 0x34d5, 0x34d6, 0x34d7,
+ 0x34d8, 0x34d9, 0x34da, 0x34db, 0x34dc, 0x34dd, 0x34de, 0x34df,
+ 0x34e0, 0x34e1, 0x34e2, 0x34e3, 0x34e4, 0x34e5, 0x34e6, 0x34e7,
+ 0x34e8, 0x34e9, 0x34ea, 0x34eb, 0x34ec, 0x34ed, 0x34ee, 0x34ef,
+ 0x34f0, 0x34f1, 0x34f2, 0x34f3, 0x34f4, 0x34f5, 0x34f6, 0x34f7,
+ 0x34f8, 0x34f9, 0x34fa, 0x34fb, 0x34fc, 0x34fd, 0x34fe, 0x34ff,
+ 0x3500, 0x3501, 0x3502, 0x3503, 0x3504, 0x3505, 0x3506, 0x3507,
+ 0x3508, 0x3509, 0x350a, 0x350b, 0x350c, 0x350d, 0x350e, 0x350f,
+ 0x3510, 0x3511, 0x3512, 0x3513, 0x3514, 0x3515, 0x3516, 0x3517,
+ 0x3518, 0x3519, 0x351a, 0x351b, 0x351c, 0x351d, 0x351e, 0x351f,
+ 0x3520, 0x3521, 0x3522, 0x3523, 0x3524, 0x3525, 0x3526, 0x3527,
+ 0x3528, 0x3529, 0x352a, 0x352b, 0x352c, 0x352d, 0x352e, 0x352f,
+ 0x3530, 0x3531, 0x3532, 0x3533, 0x3534, 0x3535, 0x3536, 0x3537,
+ 0x3538, 0x3539, 0x353a, 0x353b, 0x353c, 0x353d, 0x353e, 0x353f,
+ 0x3540, 0x3541, 0x3542, 0x3543, 0x3544, 0x3545, 0x3546, 0x3547,
+ 0x3548, 0x3549, 0x354a, 0x354b, 0x354c, 0x354d, 0x354e, 0x354f,
+ 0x3550, 0x3551, 0x3552, 0x3553, 0x3554, 0x3555, 0x3556, 0x3557,
+ 0x3558, 0x3559, 0x355a, 0x355b, 0x355c, 0x355d, 0x355e, 0x355f,
+ 0x3560, 0x3561, 0x3562, 0x3563, 0x3564, 0x3565, 0x3566, 0x3567,
+ 0x3568, 0x3569, 0x356a, 0x356b, 0x356c, 0x356d, 0x356e, 0x356f,
+ 0x3570, 0x3571, 0x3572, 0x3573, 0x3574, 0x3575, 0x3576, 0x3577,
+ 0x3578, 0x3579, 0x357a, 0x357b, 0x357c, 0x357d, 0x357e, 0x357f,
+ 0x3580, 0x3581, 0x3582, 0x3583, 0x3584, 0x3585, 0x3586, 0x3587,
+ 0x3588, 0x3589, 0x358a, 0x358b, 0x358c, 0x358d, 0x358e, 0x358f,
+ 0x3590, 0x3591, 0x3592, 0x3593, 0x3594, 0x3595, 0x3596, 0x3597,
+ 0x3598, 0x3599, 0x359a, 0x359b, 0x359c, 0x359d, 0x359e, 0x359f,
+ 0x35a0, 0x35a1, 0x35a2, 0x35a3, 0x35a4, 0x35a5, 0x35a6, 0x35a7,
+ 0x35a8, 0x35a9, 0x35aa, 0x35ab, 0x35ac, 0x35ad, 0x35ae, 0x35af,
+ 0x35b0, 0x35b1, 0x35b2, 0x35b3, 0x35b4, 0x35b5, 0x35b6, 0x35b7,
+ 0x35b8, 0x35b9, 0x35ba, 0x35bb, 0x35bc, 0x35bd, 0x35be, 0x35bf,
+ 0x35c0, 0x35c1, 0x35c2, 0x35c3, 0x35c4, 0x35c5, 0x35c6, 0x35c7,
+ 0x35c8, 0x35c9, 0x35ca, 0x35cb, 0x35cc, 0x35cd, 0x35ce, 0x35cf,
+ 0x35d0, 0x35d1, 0x35d2, 0x35d3, 0x35d4, 0x35d5, 0x35d6, 0x35d7,
+ 0x35d8, 0x35d9, 0x35da, 0x35db, 0x35dc, 0x35dd, 0x35de, 0x35df,
+ 0x35e0, 0x35e1, 0x35e2, 0x35e3, 0x35e4, 0x35e5, 0x35e6, 0x35e7,
+ 0x35e8, 0x35e9, 0x35ea, 0x35eb, 0x35ec, 0x35ed, 0x35ee, 0x35ef,
+ 0x35f0, 0x35f1, 0x35f2, 0x35f3, 0x35f4, 0x35f5, 0x35f6, 0x35f7,
+ 0x35f8, 0x35f9, 0x35fa, 0x35fb, 0x35fc, 0x35fd, 0x35fe, 0x35ff,
+ 0x3600, 0x3601, 0x3602, 0x3603, 0x3604, 0x3605, 0x3606, 0x3607,
+ 0x3608, 0x3609, 0x360a, 0x360b, 0x360c, 0x360d, 0x360e, 0x360f,
+ 0x3610, 0x3611, 0x3612, 0x3613, 0x3614, 0x3615, 0x3616, 0x3617,
+ 0x3618, 0x3619, 0x361a, 0x361b, 0x361c, 0x361d, 0x361e, 0x361f,
+ 0x3620, 0x3621, 0x3622, 0x3623, 0x3624, 0x3625, 0x3626, 0x3627,
+ 0x3628, 0x3629, 0x362a, 0x362b, 0x362c, 0x362d, 0x362e, 0x362f,
+ 0x3630, 0x3631, 0x3632, 0x3633, 0x3634, 0x3635, 0x3636, 0x3637,
+ 0x3638, 0x3639, 0x363a, 0x363b, 0x363c, 0x363d, 0x363e, 0x363f,
+ 0x3640, 0x3641, 0x3642, 0x3643, 0x3644, 0x3645, 0x3646, 0x3647,
+ 0x3648, 0x3649, 0x364a, 0x364b, 0x364c, 0x364d, 0x364e, 0x364f,
+ 0x3650, 0x3651, 0x3652, 0x3653, 0x3654, 0x3655, 0x3656, 0x3657,
+ 0x3658, 0x3659, 0x365a, 0x365b, 0x365c, 0x365d, 0x365e, 0x365f,
+ 0x3660, 0x3661, 0x3662, 0x3663, 0x3664, 0x3665, 0x3666, 0x3667,
+ 0x3668, 0x3669, 0x366a, 0x366b, 0x366c, 0x366d, 0x366e, 0x366f,
+ 0x3670, 0x3671, 0x3672, 0x3673, 0x3674, 0x3675, 0x3676, 0x3677,
+ 0x3678, 0x3679, 0x367a, 0x367b, 0x367c, 0x367d, 0x367e, 0x367f,
+ 0x3680, 0x3681, 0x3682, 0x3683, 0x3684, 0x3685, 0x3686, 0x3687,
+ 0x3688, 0x3689, 0x368a, 0x368b, 0x368c, 0x368d, 0x368e, 0x368f,
+ 0x3690, 0x3691, 0x3692, 0x3693, 0x3694, 0x3695, 0x3696, 0x3697,
+ 0x3698, 0x3699, 0x369a, 0x369b, 0x369c, 0x369d, 0x369e, 0x369f,
+ 0x36a0, 0x36a1, 0x36a2, 0x36a3, 0x36a4, 0x36a5, 0x36a6, 0x36a7,
+ 0x36a8, 0x36a9, 0x36aa, 0x36ab, 0x36ac, 0x36ad, 0x36ae, 0x36af,
+ 0x36b0, 0x36b1, 0x36b2, 0x36b3, 0x36b4, 0x36b5, 0x36b6, 0x36b7,
+ 0x36b8, 0x36b9, 0x36ba, 0x36bb, 0x36bc, 0x36bd, 0x36be, 0x36bf,
+ 0x36c0, 0x36c1, 0x36c2, 0x36c3, 0x36c4, 0x36c5, 0x36c6, 0x36c7,
+ 0x36c8, 0x36c9, 0x36ca, 0x36cb, 0x36cc, 0x36cd, 0x36ce, 0x36cf,
+ 0x36d0, 0x36d1, 0x36d2, 0x36d3, 0x36d4, 0x36d5, 0x36d6, 0x36d7,
+ 0x36d8, 0x36d9, 0x36da, 0x36db, 0x36dc, 0x36dd, 0x36de, 0x36df,
+ 0x36e0, 0x36e1, 0x36e2, 0x36e3, 0x36e4, 0x36e5, 0x36e6, 0x36e7,
+ 0x36e8, 0x36e9, 0x36ea, 0x36eb, 0x36ec, 0x36ed, 0x36ee, 0x36ef,
+ 0x36f0, 0x36f1, 0x36f2, 0x36f3, 0x36f4, 0x36f5, 0x36f6, 0x36f7,
+ 0x36f8, 0x36f9, 0x36fa, 0x36fb, 0x36fc, 0x36fd, 0x36fe, 0x36ff,
+ 0x3700, 0x3701, 0x3702, 0x3703, 0x3704, 0x3705, 0x3706, 0x3707,
+ 0x3708, 0x3709, 0x370a, 0x370b, 0x370c, 0x370d, 0x370e, 0x370f,
+ 0x3710, 0x3711, 0x3712, 0x3713, 0x3714, 0x3715, 0x3716, 0x3717,
+ 0x3718, 0x3719, 0x371a, 0x371b, 0x371c, 0x371d, 0x371e, 0x371f,
+ 0x3720, 0x3721, 0x3722, 0x3723, 0x3724, 0x3725, 0x3726, 0x3727,
+ 0x3728, 0x3729, 0x372a, 0x372b, 0x372c, 0x372d, 0x372e, 0x372f,
+ 0x3730, 0x3731, 0x3732, 0x3733, 0x3734, 0x3735, 0x3736, 0x3737,
+ 0x3738, 0x3739, 0x373a, 0x373b, 0x373c, 0x373d, 0x373e, 0x373f,
+ 0x3740, 0x3741, 0x3742, 0x3743, 0x3744, 0x3745, 0x3746, 0x3747,
+ 0x3748, 0x3749, 0x374a, 0x374b, 0x374c, 0x374d, 0x374e, 0x374f,
+ 0x3750, 0x3751, 0x3752, 0x3753, 0x3754, 0x3755, 0x3756, 0x3757,
+ 0x3758, 0x3759, 0x375a, 0x375b, 0x375c, 0x375d, 0x375e, 0x375f,
+ 0x3760, 0x3761, 0x3762, 0x3763, 0x3764, 0x3765, 0x3766, 0x3767,
+ 0x3768, 0x3769, 0x376a, 0x376b, 0x376c, 0x376d, 0x376e, 0x376f,
+ 0x3770, 0x3771, 0x3772, 0x3773, 0x3774, 0x3775, 0x3776, 0x3777,
+ 0x3778, 0x3779, 0x377a, 0x377b, 0x377c, 0x377d, 0x377e, 0x377f,
+ 0x3780, 0x3781, 0x3782, 0x3783, 0x3784, 0x3785, 0x3786, 0x3787,
+ 0x3788, 0x3789, 0x378a, 0x378b, 0x378c, 0x378d, 0x378e, 0x378f,
+ 0x3790, 0x3791, 0x3792, 0x3793, 0x3794, 0x3795, 0x3796, 0x3797,
+ 0x3798, 0x3799, 0x379a, 0x379b, 0x379c, 0x379d, 0x379e, 0x379f,
+ 0x37a0, 0x37a1, 0x37a2, 0x37a3, 0x37a4, 0x37a5, 0x37a6, 0x37a7,
+ 0x37a8, 0x37a9, 0x37aa, 0x37ab, 0x37ac, 0x37ad, 0x37ae, 0x37af,
+ 0x37b0, 0x37b1, 0x37b2, 0x37b3, 0x37b4, 0x37b5, 0x37b6, 0x37b7,
+ 0x37b8, 0x37b9, 0x37ba, 0x37bb, 0x37bc, 0x37bd, 0x37be, 0x37bf,
+ 0x37c0, 0x37c1, 0x37c2, 0x37c3, 0x37c4, 0x37c5, 0x37c6, 0x37c7,
+ 0x37c8, 0x37c9, 0x37ca, 0x37cb, 0x37cc, 0x37cd, 0x37ce, 0x37cf,
+ 0x37d0, 0x37d1, 0x37d2, 0x37d3, 0x37d4, 0x37d5, 0x37d6, 0x37d7,
+ 0x37d8, 0x37d9, 0x37da, 0x37db, 0x37dc, 0x37dd, 0x37de, 0x37df,
+ 0x37e0, 0x37e1, 0x37e2, 0x37e3, 0x37e4, 0x37e5, 0x37e6, 0x37e7,
+ 0x37e8, 0x37e9, 0x37ea, 0x37eb, 0x37ec, 0x37ed, 0x37ee, 0x37ef,
+ 0x37f0, 0x37f1, 0x37f2, 0x37f3, 0x37f4, 0x37f5, 0x37f6, 0x37f7,
+ 0x37f8, 0x37f9, 0x37fa, 0x37fb, 0x37fc, 0x37fd, 0x37fe, 0x37ff,
+ 0x3800, 0x3801, 0x3802, 0x3803, 0x3804, 0x3805, 0x3806, 0x3807,
+ 0x3808, 0x3809, 0x380a, 0x380b, 0x380c, 0x380d, 0x380e, 0x380f,
+ 0x3810, 0x3811, 0x3812, 0x3813, 0x3814, 0x3815, 0x3816, 0x3817,
+ 0x3818, 0x3819, 0x381a, 0x381b, 0x381c, 0x381d, 0x381e, 0x381f,
+ 0x3820, 0x3821, 0x3822, 0x3823, 0x3824, 0x3825, 0x3826, 0x3827,
+ 0x3828, 0x3829, 0x382a, 0x382b, 0x382c, 0x382d, 0x382e, 0x382f,
+ 0x3830, 0x3831, 0x3832, 0x3833, 0x3834, 0x3835, 0x3836, 0x3837,
+ 0x3838, 0x3839, 0x383a, 0x383b, 0x383c, 0x383d, 0x383e, 0x383f,
+ 0x3840, 0x3841, 0x3842, 0x3843, 0x3844, 0x3845, 0x3846, 0x3847,
+ 0x3848, 0x3849, 0x384a, 0x384b, 0x384c, 0x384d, 0x384e, 0x384f,
+ 0x3850, 0x3851, 0x3852, 0x3853, 0x3854, 0x3855, 0x3856, 0x3857,
+ 0x3858, 0x3859, 0x385a, 0x385b, 0x385c, 0x385d, 0x385e, 0x385f,
+ 0x3860, 0x3861, 0x3862, 0x3863, 0x3864, 0x3865, 0x3866, 0x3867,
+ 0x3868, 0x3869, 0x386a, 0x386b, 0x386c, 0x386d, 0x386e, 0x386f,
+ 0x3870, 0x3871, 0x3872, 0x3873, 0x3874, 0x3875, 0x3876, 0x3877,
+ 0x3878, 0x3879, 0x387a, 0x387b, 0x387c, 0x387d, 0x387e, 0x387f,
+ 0x3880, 0x3881, 0x3882, 0x3883, 0x3884, 0x3885, 0x3886, 0x3887,
+ 0x3888, 0x3889, 0x388a, 0x388b, 0x388c, 0x388d, 0x388e, 0x388f,
+ 0x3890, 0x3891, 0x3892, 0x3893, 0x3894, 0x3895, 0x3896, 0x3897,
+ 0x3898, 0x3899, 0x389a, 0x389b, 0x389c, 0x389d, 0x389e, 0x389f,
+ 0x38a0, 0x38a1, 0x38a2, 0x38a3, 0x38a4, 0x38a5, 0x38a6, 0x38a7,
+ 0x38a8, 0x38a9, 0x38aa, 0x38ab, 0x38ac, 0x38ad, 0x38ae, 0x38af,
+ 0x38b0, 0x38b1, 0x38b2, 0x38b3, 0x38b4, 0x38b5, 0x38b6, 0x38b7,
+ 0x38b8, 0x38b9, 0x38ba, 0x38bb, 0x38bc, 0x38bd, 0x38be, 0x38bf,
+ 0x38c0, 0x38c1, 0x38c2, 0x38c3, 0x38c4, 0x38c5, 0x38c6, 0x38c7,
+ 0x38c8, 0x38c9, 0x38ca, 0x38cb, 0x38cc, 0x38cd, 0x38ce, 0x38cf,
+ 0x38d0, 0x38d1, 0x38d2, 0x38d3, 0x38d4, 0x38d5, 0x38d6, 0x38d7,
+ 0x38d8, 0x38d9, 0x38da, 0x38db, 0x38dc, 0x38dd, 0x38de, 0x38df,
+ 0x38e0, 0x38e1, 0x38e2, 0x38e3, 0x38e4, 0x38e5, 0x38e6, 0x38e7,
+ 0x38e8, 0x38e9, 0x38ea, 0x38eb, 0x38ec, 0x38ed, 0x38ee, 0x38ef,
+ 0x38f0, 0x38f1, 0x38f2, 0x38f3, 0x38f4, 0x38f5, 0x38f6, 0x38f7,
+ 0x38f8, 0x38f9, 0x38fa, 0x38fb, 0x38fc, 0x38fd, 0x38fe, 0x38ff,
+ 0x3900, 0x3901, 0x3902, 0x3903, 0x3904, 0x3905, 0x3906, 0x3907,
+ 0x3908, 0x3909, 0x390a, 0x390b, 0x390c, 0x390d, 0x390e, 0x390f,
+ 0x3910, 0x3911, 0x3912, 0x3913, 0x3914, 0x3915, 0x3916, 0x3917,
+ 0x3918, 0x3919, 0x391a, 0x391b, 0x391c, 0x391d, 0x391e, 0x391f,
+ 0x3920, 0x3921, 0x3922, 0x3923, 0x3924, 0x3925, 0x3926, 0x3927,
+ 0x3928, 0x3929, 0x392a, 0x392b, 0x392c, 0x392d, 0x392e, 0x392f,
+ 0x3930, 0x3931, 0x3932, 0x3933, 0x3934, 0x3935, 0x3936, 0x3937,
+ 0x3938, 0x3939, 0x393a, 0x393b, 0x393c, 0x393d, 0x393e, 0x393f,
+ 0x3940, 0x3941, 0x3942, 0x3943, 0x3944, 0x3945, 0x3946, 0x3947,
+ 0x3948, 0x3949, 0x394a, 0x394b, 0x394c, 0x394d, 0x394e, 0x394f,
+ 0x3950, 0x3951, 0x3952, 0x3953, 0x3954, 0x3955, 0x3956, 0x3957,
+ 0x3958, 0x3959, 0x395a, 0x395b, 0x395c, 0x395d, 0x395e, 0x395f,
+ 0x3960, 0x3961, 0x3962, 0x3963, 0x3964, 0x3965, 0x3966, 0x3967,
+ 0x3968, 0x3969, 0x396a, 0x396b, 0x396c, 0x396d, 0x396e, 0x396f,
+ 0x3970, 0x3971, 0x3972, 0x3973, 0x3974, 0x3975, 0x3976, 0x3977,
+ 0x3978, 0x3979, 0x397a, 0x397b, 0x397c, 0x397d, 0x397e, 0x397f,
+ 0x3980, 0x3981, 0x3982, 0x3983, 0x3984, 0x3985, 0x3986, 0x3987,
+ 0x3988, 0x3989, 0x398a, 0x398b, 0x398c, 0x398d, 0x398e, 0x398f,
+ 0x3990, 0x3991, 0x3992, 0x3993, 0x3994, 0x3995, 0x3996, 0x3997,
+ 0x3998, 0x3999, 0x399a, 0x399b, 0x399c, 0x399d, 0x399e, 0x399f,
+ 0x39a0, 0x39a1, 0x39a2, 0x39a3, 0x39a4, 0x39a5, 0x39a6, 0x39a7,
+ 0x39a8, 0x39a9, 0x39aa, 0x39ab, 0x39ac, 0x39ad, 0x39ae, 0x39af,
+ 0x39b0, 0x39b1, 0x39b2, 0x39b3, 0x39b4, 0x39b5, 0x39b6, 0x39b7,
+ 0x39b8, 0x39b9, 0x39ba, 0x39bb, 0x39bc, 0x39bd, 0x39be, 0x39bf,
+ 0x39c0, 0x39c1, 0x39c2, 0x39c3, 0x39c4, 0x39c5, 0x39c6, 0x39c7,
+ 0x39c8, 0x39c9, 0x39ca, 0x39cb, 0x39cc, 0x39cd, 0x39ce, 0x39cf,
+ 0x39d0, 0x39d1, 0x39d2, 0x39d3, 0x39d4, 0x39d5, 0x39d6, 0x39d7,
+ 0x39d8, 0x39d9, 0x39da, 0x39db, 0x39dc, 0x39dd, 0x39de, 0x39df,
+ 0x39e0, 0x39e1, 0x39e2, 0x39e3, 0x39e4, 0x39e5, 0x39e6, 0x39e7,
+ 0x39e8, 0x39e9, 0x39ea, 0x39eb, 0x39ec, 0x39ed, 0x39ee, 0x39ef,
+ 0x39f0, 0x39f1, 0x39f2, 0x39f3, 0x39f4, 0x39f5, 0x39f6, 0x39f7,
+ 0x39f8, 0x39f9, 0x39fa, 0x39fb, 0x39fc, 0x39fd, 0x39fe, 0x39ff,
+ 0x3a00, 0x3a01, 0x3a02, 0x3a03, 0x3a04, 0x3a05, 0x3a06, 0x3a07,
+ 0x3a08, 0x3a09, 0x3a0a, 0x3a0b, 0x3a0c, 0x3a0d, 0x3a0e, 0x3a0f,
+ 0x3a10, 0x3a11, 0x3a12, 0x3a13, 0x3a14, 0x3a15, 0x3a16, 0x3a17,
+ 0x3a18, 0x3a19, 0x3a1a, 0x3a1b, 0x3a1c, 0x3a1d, 0x3a1e, 0x3a1f,
+ 0x3a20, 0x3a21, 0x3a22, 0x3a23, 0x3a24, 0x3a25, 0x3a26, 0x3a27,
+ 0x3a28, 0x3a29, 0x3a2a, 0x3a2b, 0x3a2c, 0x3a2d, 0x3a2e, 0x3a2f,
+ 0x3a30, 0x3a31, 0x3a32, 0x3a33, 0x3a34, 0x3a35, 0x3a36, 0x3a37,
+ 0x3a38, 0x3a39, 0x3a3a, 0x3a3b, 0x3a3c, 0x3a3d, 0x3a3e, 0x3a3f,
+ 0x3a40, 0x3a41, 0x3a42, 0x3a43, 0x3a44, 0x3a45, 0x3a46, 0x3a47,
+ 0x3a48, 0x3a49, 0x3a4a, 0x3a4b, 0x3a4c, 0x3a4d, 0x3a4e, 0x3a4f,
+ 0x3a50, 0x3a51, 0x3a52, 0x3a53, 0x3a54, 0x3a55, 0x3a56, 0x3a57,
+ 0x3a58, 0x3a59, 0x3a5a, 0x3a5b, 0x3a5c, 0x3a5d, 0x3a5e, 0x3a5f,
+ 0x3a60, 0x3a61, 0x3a62, 0x3a63, 0x3a64, 0x3a65, 0x3a66, 0x3a67,
+ 0x3a68, 0x3a69, 0x3a6a, 0x3a6b, 0x3a6c, 0x3a6d, 0x3a6e, 0x3a6f,
+ 0x3a70, 0x3a71, 0x3a72, 0x3a73, 0x3a74, 0x3a75, 0x3a76, 0x3a77,
+ 0x3a78, 0x3a79, 0x3a7a, 0x3a7b, 0x3a7c, 0x3a7d, 0x3a7e, 0x3a7f,
+ 0x3a80, 0x3a81, 0x3a82, 0x3a83, 0x3a84, 0x3a85, 0x3a86, 0x3a87,
+ 0x3a88, 0x3a89, 0x3a8a, 0x3a8b, 0x3a8c, 0x3a8d, 0x3a8e, 0x3a8f,
+ 0x3a90, 0x3a91, 0x3a92, 0x3a93, 0x3a94, 0x3a95, 0x3a96, 0x3a97,
+ 0x3a98, 0x3a99, 0x3a9a, 0x3a9b, 0x3a9c, 0x3a9d, 0x3a9e, 0x3a9f,
+ 0x3aa0, 0x3aa1, 0x3aa2, 0x3aa3, 0x3aa4, 0x3aa5, 0x3aa6, 0x3aa7,
+ 0x3aa8, 0x3aa9, 0x3aaa, 0x3aab, 0x3aac, 0x3aad, 0x3aae, 0x3aaf,
+ 0x3ab0, 0x3ab1, 0x3ab2, 0x3ab3, 0x3ab4, 0x3ab5, 0x3ab6, 0x3ab7,
+ 0x3ab8, 0x3ab9, 0x3aba, 0x3abb, 0x3abc, 0x3abd, 0x3abe, 0x3abf,
+ 0x3ac0, 0x3ac1, 0x3ac2, 0x3ac3, 0x3ac4, 0x3ac5, 0x3ac6, 0x3ac7,
+ 0x3ac8, 0x3ac9, 0x3aca, 0x3acb, 0x3acc, 0x3acd, 0x3ace, 0x3acf,
+ 0x3ad0, 0x3ad1, 0x3ad2, 0x3ad3, 0x3ad4, 0x3ad5, 0x3ad6, 0x3ad7,
+ 0x3ad8, 0x3ad9, 0x3ada, 0x3adb, 0x3adc, 0x3add, 0x3ade, 0x3adf,
+ 0x3ae0, 0x3ae1, 0x3ae2, 0x3ae3, 0x3ae4, 0x3ae5, 0x3ae6, 0x3ae7,
+ 0x3ae8, 0x3ae9, 0x3aea, 0x3aeb, 0x3aec, 0x3aed, 0x3aee, 0x3aef,
+ 0x3af0, 0x3af1, 0x3af2, 0x3af3, 0x3af4, 0x3af5, 0x3af6, 0x3af7,
+ 0x3af8, 0x3af9, 0x3afa, 0x3afb, 0x3afc, 0x3afd, 0x3afe, 0x3aff,
+ 0x3b00, 0x3b01, 0x3b02, 0x3b03, 0x3b04, 0x3b05, 0x3b06, 0x3b07,
+ 0x3b08, 0x3b09, 0x3b0a, 0x3b0b, 0x3b0c, 0x3b0d, 0x3b0e, 0x3b0f,
+ 0x3b10, 0x3b11, 0x3b12, 0x3b13, 0x3b14, 0x3b15, 0x3b16, 0x3b17,
+ 0x3b18, 0x3b19, 0x3b1a, 0x3b1b, 0x3b1c, 0x3b1d, 0x3b1e, 0x3b1f,
+ 0x3b20, 0x3b21, 0x3b22, 0x3b23, 0x3b24, 0x3b25, 0x3b26, 0x3b27,
+ 0x3b28, 0x3b29, 0x3b2a, 0x3b2b, 0x3b2c, 0x3b2d, 0x3b2e, 0x3b2f,
+ 0x3b30, 0x3b31, 0x3b32, 0x3b33, 0x3b34, 0x3b35, 0x3b36, 0x3b37,
+ 0x3b38, 0x3b39, 0x3b3a, 0x3b3b, 0x3b3c, 0x3b3d, 0x3b3e, 0x3b3f,
+ 0x3b40, 0x3b41, 0x3b42, 0x3b43, 0x3b44, 0x3b45, 0x3b46, 0x3b47,
+ 0x3b48, 0x3b49, 0x3b4a, 0x3b4b, 0x3b4c, 0x3b4d, 0x3b4e, 0x3b4f,
+ 0x3b50, 0x3b51, 0x3b52, 0x3b53, 0x3b54, 0x3b55, 0x3b56, 0x3b57,
+ 0x3b58, 0x3b59, 0x3b5a, 0x3b5b, 0x3b5c, 0x3b5d, 0x3b5e, 0x3b5f,
+ 0x3b60, 0x3b61, 0x3b62, 0x3b63, 0x3b64, 0x3b65, 0x3b66, 0x3b67,
+ 0x3b68, 0x3b69, 0x3b6a, 0x3b6b, 0x3b6c, 0x3b6d, 0x3b6e, 0x3b6f,
+ 0x3b70, 0x3b71, 0x3b72, 0x3b73, 0x3b74, 0x3b75, 0x3b76, 0x3b77,
+ 0x3b78, 0x3b79, 0x3b7a, 0x3b7b, 0x3b7c, 0x3b7d, 0x3b7e, 0x3b7f,
+ 0x3b80, 0x3b81, 0x3b82, 0x3b83, 0x3b84, 0x3b85, 0x3b86, 0x3b87,
+ 0x3b88, 0x3b89, 0x3b8a, 0x3b8b, 0x3b8c, 0x3b8d, 0x3b8e, 0x3b8f,
+ 0x3b90, 0x3b91, 0x3b92, 0x3b93, 0x3b94, 0x3b95, 0x3b96, 0x3b97,
+ 0x3b98, 0x3b99, 0x3b9a, 0x3b9b, 0x3b9c, 0x3b9d, 0x3b9e, 0x3b9f,
+ 0x3ba0, 0x3ba1, 0x3ba2, 0x3ba3, 0x3ba4, 0x3ba5, 0x3ba6, 0x3ba7,
+ 0x3ba8, 0x3ba9, 0x3baa, 0x3bab, 0x3bac, 0x3bad, 0x3bae, 0x3baf,
+ 0x3bb0, 0x3bb1, 0x3bb2, 0x3bb3, 0x3bb4, 0x3bb5, 0x3bb6, 0x3bb7,
+ 0x3bb8, 0x3bb9, 0x3bba, 0x3bbb, 0x3bbc, 0x3bbd, 0x3bbe, 0x3bbf,
+ 0x3bc0, 0x3bc1, 0x3bc2, 0x3bc3, 0x3bc4, 0x3bc5, 0x3bc6, 0x3bc7,
+ 0x3bc8, 0x3bc9, 0x3bca, 0x3bcb, 0x3bcc, 0x3bcd, 0x3bce, 0x3bcf,
+ 0x3bd0, 0x3bd1, 0x3bd2, 0x3bd3, 0x3bd4, 0x3bd5, 0x3bd6, 0x3bd7,
+ 0x3bd8, 0x3bd9, 0x3bda, 0x3bdb, 0x3bdc, 0x3bdd, 0x3bde, 0x3bdf,
+ 0x3be0, 0x3be1, 0x3be2, 0x3be3, 0x3be4, 0x3be5, 0x3be6, 0x3be7,
+ 0x3be8, 0x3be9, 0x3bea, 0x3beb, 0x3bec, 0x3bed, 0x3bee, 0x3bef,
+ 0x3bf0, 0x3bf1, 0x3bf2, 0x3bf3, 0x3bf4, 0x3bf5, 0x3bf6, 0x3bf7,
+ 0x3bf8, 0x3bf9, 0x3bfa, 0x3bfb, 0x3bfc, 0x3bfd, 0x3bfe, 0x3bff,
+ 0x3c00, 0x3c01, 0x3c02, 0x3c03, 0x3c04, 0x3c05, 0x3c06, 0x3c07,
+ 0x3c08, 0x3c09, 0x3c0a, 0x3c0b, 0x3c0c, 0x3c0d, 0x3c0e, 0x3c0f,
+ 0x3c10, 0x3c11, 0x3c12, 0x3c13, 0x3c14, 0x3c15, 0x3c16, 0x3c17,
+ 0x3c18, 0x3c19, 0x3c1a, 0x3c1b, 0x3c1c, 0x3c1d, 0x3c1e, 0x3c1f,
+ 0x3c20, 0x3c21, 0x3c22, 0x3c23, 0x3c24, 0x3c25, 0x3c26, 0x3c27,
+ 0x3c28, 0x3c29, 0x3c2a, 0x3c2b, 0x3c2c, 0x3c2d, 0x3c2e, 0x3c2f,
+ 0x3c30, 0x3c31, 0x3c32, 0x3c33, 0x3c34, 0x3c35, 0x3c36, 0x3c37,
+ 0x3c38, 0x3c39, 0x3c3a, 0x3c3b, 0x3c3c, 0x3c3d, 0x3c3e, 0x3c3f,
+ 0x3c40, 0x3c41, 0x3c42, 0x3c43, 0x3c44, 0x3c45, 0x3c46, 0x3c47,
+ 0x3c48, 0x3c49, 0x3c4a, 0x3c4b, 0x3c4c, 0x3c4d, 0x3c4e, 0x3c4f,
+ 0x3c50, 0x3c51, 0x3c52, 0x3c53, 0x3c54, 0x3c55, 0x3c56, 0x3c57,
+ 0x3c58, 0x3c59, 0x3c5a, 0x3c5b, 0x3c5c, 0x3c5d, 0x3c5e, 0x3c5f,
+ 0x3c60, 0x3c61, 0x3c62, 0x3c63, 0x3c64, 0x3c65, 0x3c66, 0x3c67,
+ 0x3c68, 0x3c69, 0x3c6a, 0x3c6b, 0x3c6c, 0x3c6d, 0x3c6e, 0x3c6f,
+ 0x3c70, 0x3c71, 0x3c72, 0x3c73, 0x3c74, 0x3c75, 0x3c76, 0x3c77,
+ 0x3c78, 0x3c79, 0x3c7a, 0x3c7b, 0x3c7c, 0x3c7d, 0x3c7e, 0x3c7f,
+ 0x3c80, 0x3c81, 0x3c82, 0x3c83, 0x3c84, 0x3c85, 0x3c86, 0x3c87,
+ 0x3c88, 0x3c89, 0x3c8a, 0x3c8b, 0x3c8c, 0x3c8d, 0x3c8e, 0x3c8f,
+ 0x3c90, 0x3c91, 0x3c92, 0x3c93, 0x3c94, 0x3c95, 0x3c96, 0x3c97,
+ 0x3c98, 0x3c99, 0x3c9a, 0x3c9b, 0x3c9c, 0x3c9d, 0x3c9e, 0x3c9f,
+ 0x3ca0, 0x3ca1, 0x3ca2, 0x3ca3, 0x3ca4, 0x3ca5, 0x3ca6, 0x3ca7,
+ 0x3ca8, 0x3ca9, 0x3caa, 0x3cab, 0x3cac, 0x3cad, 0x3cae, 0x3caf,
+ 0x3cb0, 0x3cb1, 0x3cb2, 0x3cb3, 0x3cb4, 0x3cb5, 0x3cb6, 0x3cb7,
+ 0x3cb8, 0x3cb9, 0x3cba, 0x3cbb, 0x3cbc, 0x3cbd, 0x3cbe, 0x3cbf,
+ 0x3cc0, 0x3cc1, 0x3cc2, 0x3cc3, 0x3cc4, 0x3cc5, 0x3cc6, 0x3cc7,
+ 0x3cc8, 0x3cc9, 0x3cca, 0x3ccb, 0x3ccc, 0x3ccd, 0x3cce, 0x3ccf,
+ 0x3cd0, 0x3cd1, 0x3cd2, 0x3cd3, 0x3cd4, 0x3cd5, 0x3cd6, 0x3cd7,
+ 0x3cd8, 0x3cd9, 0x3cda, 0x3cdb, 0x3cdc, 0x3cdd, 0x3cde, 0x3cdf,
+ 0x3ce0, 0x3ce1, 0x3ce2, 0x3ce3, 0x3ce4, 0x3ce5, 0x3ce6, 0x3ce7,
+ 0x3ce8, 0x3ce9, 0x3cea, 0x3ceb, 0x3cec, 0x3ced, 0x3cee, 0x3cef,
+ 0x3cf0, 0x3cf1, 0x3cf2, 0x3cf3, 0x3cf4, 0x3cf5, 0x3cf6, 0x3cf7,
+ 0x3cf8, 0x3cf9, 0x3cfa, 0x3cfb, 0x3cfc, 0x3cfd, 0x3cfe, 0x3cff,
+ 0x3d00, 0x3d01, 0x3d02, 0x3d03, 0x3d04, 0x3d05, 0x3d06, 0x3d07,
+ 0x3d08, 0x3d09, 0x3d0a, 0x3d0b, 0x3d0c, 0x3d0d, 0x3d0e, 0x3d0f,
+ 0x3d10, 0x3d11, 0x3d12, 0x3d13, 0x3d14, 0x3d15, 0x3d16, 0x3d17,
+ 0x3d18, 0x3d19, 0x3d1a, 0x3d1b, 0x3d1c, 0x3d1d, 0x3d1e, 0x3d1f,
+ 0x3d20, 0x3d21, 0x3d22, 0x3d23, 0x3d24, 0x3d25, 0x3d26, 0x3d27,
+ 0x3d28, 0x3d29, 0x3d2a, 0x3d2b, 0x3d2c, 0x3d2d, 0x3d2e, 0x3d2f,
+ 0x3d30, 0x3d31, 0x3d32, 0x3d33, 0x3d34, 0x3d35, 0x3d36, 0x3d37,
+ 0x3d38, 0x3d39, 0x3d3a, 0x3d3b, 0x3d3c, 0x3d3d, 0x3d3e, 0x3d3f,
+ 0x3d40, 0x3d41, 0x3d42, 0x3d43, 0x3d44, 0x3d45, 0x3d46, 0x3d47,
+ 0x3d48, 0x3d49, 0x3d4a, 0x3d4b, 0x3d4c, 0x3d4d, 0x3d4e, 0x3d4f,
+ 0x3d50, 0x3d51, 0x3d52, 0x3d53, 0x3d54, 0x3d55, 0x3d56, 0x3d57,
+ 0x3d58, 0x3d59, 0x3d5a, 0x3d5b, 0x3d5c, 0x3d5d, 0x3d5e, 0x3d5f,
+ 0x3d60, 0x3d61, 0x3d62, 0x3d63, 0x3d64, 0x3d65, 0x3d66, 0x3d67,
+ 0x3d68, 0x3d69, 0x3d6a, 0x3d6b, 0x3d6c, 0x3d6d, 0x3d6e, 0x3d6f,
+ 0x3d70, 0x3d71, 0x3d72, 0x3d73, 0x3d74, 0x3d75, 0x3d76, 0x3d77,
+ 0x3d78, 0x3d79, 0x3d7a, 0x3d7b, 0x3d7c, 0x3d7d, 0x3d7e, 0x3d7f,
+ 0x3d80, 0x3d81, 0x3d82, 0x3d83, 0x3d84, 0x3d85, 0x3d86, 0x3d87,
+ 0x3d88, 0x3d89, 0x3d8a, 0x3d8b, 0x3d8c, 0x3d8d, 0x3d8e, 0x3d8f,
+ 0x3d90, 0x3d91, 0x3d92, 0x3d93, 0x3d94, 0x3d95, 0x3d96, 0x3d97,
+ 0x3d98, 0x3d99, 0x3d9a, 0x3d9b, 0x3d9c, 0x3d9d, 0x3d9e, 0x3d9f,
+ 0x3da0, 0x3da1, 0x3da2, 0x3da3, 0x3da4, 0x3da5, 0x3da6, 0x3da7,
+ 0x3da8, 0x3da9, 0x3daa, 0x3dab, 0x3dac, 0x3dad, 0x3dae, 0x3daf,
+ 0x3db0, 0x3db1, 0x3db2, 0x3db3, 0x3db4, 0x3db5, 0x3db6, 0x3db7,
+ 0x3db8, 0x3db9, 0x3dba, 0x3dbb, 0x3dbc, 0x3dbd, 0x3dbe, 0x3dbf,
+ 0x3dc0, 0x3dc1, 0x3dc2, 0x3dc3, 0x3dc4, 0x3dc5, 0x3dc6, 0x3dc7,
+ 0x3dc8, 0x3dc9, 0x3dca, 0x3dcb, 0x3dcc, 0x3dcd, 0x3dce, 0x3dcf,
+ 0x3dd0, 0x3dd1, 0x3dd2, 0x3dd3, 0x3dd4, 0x3dd5, 0x3dd6, 0x3dd7,
+ 0x3dd8, 0x3dd9, 0x3dda, 0x3ddb, 0x3ddc, 0x3ddd, 0x3dde, 0x3ddf,
+ 0x3de0, 0x3de1, 0x3de2, 0x3de3, 0x3de4, 0x3de5, 0x3de6, 0x3de7,
+ 0x3de8, 0x3de9, 0x3dea, 0x3deb, 0x3dec, 0x3ded, 0x3dee, 0x3def,
+ 0x3df0, 0x3df1, 0x3df2, 0x3df3, 0x3df4, 0x3df5, 0x3df6, 0x3df7,
+ 0x3df8, 0x3df9, 0x3dfa, 0x3dfb, 0x3dfc, 0x3dfd, 0x3dfe, 0x3dff,
+ 0x3e00, 0x3e01, 0x3e02, 0x3e03, 0x3e04, 0x3e05, 0x3e06, 0x3e07,
+ 0x3e08, 0x3e09, 0x3e0a, 0x3e0b, 0x3e0c, 0x3e0d, 0x3e0e, 0x3e0f,
+ 0x3e10, 0x3e11, 0x3e12, 0x3e13, 0x3e14, 0x3e15, 0x3e16, 0x3e17,
+ 0x3e18, 0x3e19, 0x3e1a, 0x3e1b, 0x3e1c, 0x3e1d, 0x3e1e, 0x3e1f,
+ 0x3e20, 0x3e21, 0x3e22, 0x3e23, 0x3e24, 0x3e25, 0x3e26, 0x3e27,
+ 0x3e28, 0x3e29, 0x3e2a, 0x3e2b, 0x3e2c, 0x3e2d, 0x3e2e, 0x3e2f,
+ 0x3e30, 0x3e31, 0x3e32, 0x3e33, 0x3e34, 0x3e35, 0x3e36, 0x3e37,
+ 0x3e38, 0x3e39, 0x3e3a, 0x3e3b, 0x3e3c, 0x3e3d, 0x3e3e, 0x3e3f,
+ 0x3e40, 0x3e41, 0x3e42, 0x3e43, 0x3e44, 0x3e45, 0x3e46, 0x3e47,
+ 0x3e48, 0x3e49, 0x3e4a, 0x3e4b, 0x3e4c, 0x3e4d, 0x3e4e, 0x3e4f,
+ 0x3e50, 0x3e51, 0x3e52, 0x3e53, 0x3e54, 0x3e55, 0x3e56, 0x3e57,
+ 0x3e58, 0x3e59, 0x3e5a, 0x3e5b, 0x3e5c, 0x3e5d, 0x3e5e, 0x3e5f,
+ 0x3e60, 0x3e61, 0x3e62, 0x3e63, 0x3e64, 0x3e65, 0x3e66, 0x3e67,
+ 0x3e68, 0x3e69, 0x3e6a, 0x3e6b, 0x3e6c, 0x3e6d, 0x3e6e, 0x3e6f,
+ 0x3e70, 0x3e71, 0x3e72, 0x3e73, 0x3e74, 0x3e75, 0x3e76, 0x3e77,
+ 0x3e78, 0x3e79, 0x3e7a, 0x3e7b, 0x3e7c, 0x3e7d, 0x3e7e, 0x3e7f,
+ 0x3e80, 0x3e81, 0x3e82, 0x3e83, 0x3e84, 0x3e85, 0x3e86, 0x3e87,
+ 0x3e88, 0x3e89, 0x3e8a, 0x3e8b, 0x3e8c, 0x3e8d, 0x3e8e, 0x3e8f,
+ 0x3e90, 0x3e91, 0x3e92, 0x3e93, 0x3e94, 0x3e95, 0x3e96, 0x3e97,
+ 0x3e98, 0x3e99, 0x3e9a, 0x3e9b, 0x3e9c, 0x3e9d, 0x3e9e, 0x3e9f,
+ 0x3ea0, 0x3ea1, 0x3ea2, 0x3ea3, 0x3ea4, 0x3ea5, 0x3ea6, 0x3ea7,
+ 0x3ea8, 0x3ea9, 0x3eaa, 0x3eab, 0x3eac, 0x3ead, 0x3eae, 0x3eaf,
+ 0x3eb0, 0x3eb1, 0x3eb2, 0x3eb3, 0x3eb4, 0x3eb5, 0x3eb6, 0x3eb7,
+ 0x3eb8, 0x3eb9, 0x3eba, 0x3ebb, 0x3ebc, 0x3ebd, 0x3ebe, 0x3ebf,
+ 0x3ec0, 0x3ec1, 0x3ec2, 0x3ec3, 0x3ec4, 0x3ec5, 0x3ec6, 0x3ec7,
+ 0x3ec8, 0x3ec9, 0x3eca, 0x3ecb, 0x3ecc, 0x3ecd, 0x3ece, 0x3ecf,
+ 0x3ed0, 0x3ed1, 0x3ed2, 0x3ed3, 0x3ed4, 0x3ed5, 0x3ed6, 0x3ed7,
+ 0x3ed8, 0x3ed9, 0x3eda, 0x3edb, 0x3edc, 0x3edd, 0x3ede, 0x3edf,
+ 0x3ee0, 0x3ee1, 0x3ee2, 0x3ee3, 0x3ee4, 0x3ee5, 0x3ee6, 0x3ee7,
+ 0x3ee8, 0x3ee9, 0x3eea, 0x3eeb, 0x3eec, 0x3eed, 0x3eee, 0x3eef,
+ 0x3ef0, 0x3ef1, 0x3ef2, 0x3ef3, 0x3ef4, 0x3ef5, 0x3ef6, 0x3ef7,
+ 0x3ef8, 0x3ef9, 0x3efa, 0x3efb, 0x3efc, 0x3efd, 0x3efe, 0x3eff,
+ 0x3f00, 0x3f01, 0x3f02, 0x3f03, 0x3f04, 0x3f05, 0x3f06, 0x3f07,
+ 0x3f08, 0x3f09, 0x3f0a, 0x3f0b, 0x3f0c, 0x3f0d, 0x3f0e, 0x3f0f,
+ 0x3f10, 0x3f11, 0x3f12, 0x3f13, 0x3f14, 0x3f15, 0x3f16, 0x3f17,
+ 0x3f18, 0x3f19, 0x3f1a, 0x3f1b, 0x3f1c, 0x3f1d, 0x3f1e, 0x3f1f,
+ 0x3f20, 0x3f21, 0x3f22, 0x3f23, 0x3f24, 0x3f25, 0x3f26, 0x3f27,
+ 0x3f28, 0x3f29, 0x3f2a, 0x3f2b, 0x3f2c, 0x3f2d, 0x3f2e, 0x3f2f,
+ 0x3f30, 0x3f31, 0x3f32, 0x3f33, 0x3f34, 0x3f35, 0x3f36, 0x3f37,
+ 0x3f38, 0x3f39, 0x3f3a, 0x3f3b, 0x3f3c, 0x3f3d, 0x3f3e, 0x3f3f,
+ 0x3f40, 0x3f41, 0x3f42, 0x3f43, 0x3f44, 0x3f45, 0x3f46, 0x3f47,
+ 0x3f48, 0x3f49, 0x3f4a, 0x3f4b, 0x3f4c, 0x3f4d, 0x3f4e, 0x3f4f,
+ 0x3f50, 0x3f51, 0x3f52, 0x3f53, 0x3f54, 0x3f55, 0x3f56, 0x3f57,
+ 0x3f58, 0x3f59, 0x3f5a, 0x3f5b, 0x3f5c, 0x3f5d, 0x3f5e, 0x3f5f,
+ 0x3f60, 0x3f61, 0x3f62, 0x3f63, 0x3f64, 0x3f65, 0x3f66, 0x3f67,
+ 0x3f68, 0x3f69, 0x3f6a, 0x3f6b, 0x3f6c, 0x3f6d, 0x3f6e, 0x3f6f,
+ 0x3f70, 0x3f71, 0x3f72, 0x3f73, 0x3f74, 0x3f75, 0x3f76, 0x3f77,
+ 0x3f78, 0x3f79, 0x3f7a, 0x3f7b, 0x3f7c, 0x3f7d, 0x3f7e, 0x3f7f,
+ 0x3f80, 0x3f81, 0x3f82, 0x3f83, 0x3f84, 0x3f85, 0x3f86, 0x3f87,
+ 0x3f88, 0x3f89, 0x3f8a, 0x3f8b, 0x3f8c, 0x3f8d, 0x3f8e, 0x3f8f,
+ 0x3f90, 0x3f91, 0x3f92, 0x3f93, 0x3f94, 0x3f95, 0x3f96, 0x3f97,
+ 0x3f98, 0x3f99, 0x3f9a, 0x3f9b, 0x3f9c, 0x3f9d, 0x3f9e, 0x3f9f,
+ 0x3fa0, 0x3fa1, 0x3fa2, 0x3fa3, 0x3fa4, 0x3fa5, 0x3fa6, 0x3fa7,
+ 0x3fa8, 0x3fa9, 0x3faa, 0x3fab, 0x3fac, 0x3fad, 0x3fae, 0x3faf,
+ 0x3fb0, 0x3fb1, 0x3fb2, 0x3fb3, 0x3fb4, 0x3fb5, 0x3fb6, 0x3fb7,
+ 0x3fb8, 0x3fb9, 0x3fba, 0x3fbb, 0x3fbc, 0x3fbd, 0x3fbe, 0x3fbf,
+ 0x3fc0, 0x3fc1, 0x3fc2, 0x3fc3, 0x3fc4, 0x3fc5, 0x3fc6, 0x3fc7,
+ 0x3fc8, 0x3fc9, 0x3fca, 0x3fcb, 0x3fcc, 0x3fcd, 0x3fce, 0x3fcf,
+ 0x3fd0, 0x3fd1, 0x3fd2, 0x3fd3, 0x3fd4, 0x3fd5, 0x3fd6, 0x3fd7,
+ 0x3fd8, 0x3fd9, 0x3fda, 0x3fdb, 0x3fdc, 0x3fdd, 0x3fde, 0x3fdf,
+ 0x3fe0, 0x3fe1, 0x3fe2, 0x3fe3, 0x3fe4, 0x3fe5, 0x3fe6, 0x3fe7,
+ 0x3fe8, 0x3fe9, 0x3fea, 0x3feb, 0x3fec, 0x3fed, 0x3fee, 0x3fef,
+ 0x3ff0, 0x3ff1, 0x3ff2, 0x3ff3, 0x3ff4, 0x3ff5, 0x3ff6, 0x3ff7,
+ 0x3ff8, 0x3ff9, 0x3ffa, 0x3ffb, 0x3ffc, 0x3ffd, 0x3ffe, 0x3fff,
+ 0x4000, 0x4001, 0x4002, 0x4003, 0x4004, 0x4005, 0x4006, 0x4007,
+ 0x4008, 0x4009, 0x400a, 0x400b, 0x400c, 0x400d, 0x400e, 0x400f,
+ 0x4010, 0x4011, 0x4012, 0x4013, 0x4014, 0x4015, 0x4016, 0x4017,
+ 0x4018, 0x4019, 0x401a, 0x401b, 0x401c, 0x401d, 0x401e, 0x401f,
+ 0x4020, 0x4021, 0x4022, 0x4023, 0x4024, 0x4025, 0x4026, 0x4027,
+ 0x4028, 0x4029, 0x402a, 0x402b, 0x402c, 0x402d, 0x402e, 0x402f,
+ 0x4030, 0x4031, 0x4032, 0x4033, 0x4034, 0x4035, 0x4036, 0x4037,
+ 0x4038, 0x4039, 0x403a, 0x403b, 0x403c, 0x403d, 0x403e, 0x403f,
+ 0x4040, 0x4041, 0x4042, 0x4043, 0x4044, 0x4045, 0x4046, 0x4047,
+ 0x4048, 0x4049, 0x404a, 0x404b, 0x404c, 0x404d, 0x404e, 0x404f,
+ 0x4050, 0x4051, 0x4052, 0x4053, 0x4054, 0x4055, 0x4056, 0x4057,
+ 0x4058, 0x4059, 0x405a, 0x405b, 0x405c, 0x405d, 0x405e, 0x405f,
+ 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067,
+ 0x4068, 0x4069, 0x406a, 0x406b, 0x406c, 0x406d, 0x406e, 0x406f,
+ 0x4070, 0x4071, 0x4072, 0x4073, 0x4074, 0x4075, 0x4076, 0x4077,
+ 0x4078, 0x4079, 0x407a, 0x407b, 0x407c, 0x407d, 0x407e, 0x407f,
+ 0x4080, 0x4081, 0x4082, 0x4083, 0x4084, 0x4085, 0x4086, 0x4087,
+ 0x4088, 0x4089, 0x408a, 0x408b, 0x408c, 0x408d, 0x408e, 0x408f,
+ 0x4090, 0x4091, 0x4092, 0x4093, 0x4094, 0x4095, 0x4096, 0x4097,
+ 0x4098, 0x4099, 0x409a, 0x409b, 0x409c, 0x409d, 0x409e, 0x409f,
+ 0x40a0, 0x40a1, 0x40a2, 0x40a3, 0x40a4, 0x40a5, 0x40a6, 0x40a7,
+ 0x40a8, 0x40a9, 0x40aa, 0x40ab, 0x40ac, 0x40ad, 0x40ae, 0x40af,
+ 0x40b0, 0x40b1, 0x40b2, 0x40b3, 0x40b4, 0x40b5, 0x40b6, 0x40b7,
+ 0x40b8, 0x40b9, 0x40ba, 0x40bb, 0x40bc, 0x40bd, 0x40be, 0x40bf,
+ 0x40c0, 0x40c1, 0x40c2, 0x40c3, 0x40c4, 0x40c5, 0x40c6, 0x40c7,
+ 0x40c8, 0x40c9, 0x40ca, 0x40cb, 0x40cc, 0x40cd, 0x40ce, 0x40cf,
+ 0x40d0, 0x40d1, 0x40d2, 0x40d3, 0x40d4, 0x40d5, 0x40d6, 0x40d7,
+ 0x40d8, 0x40d9, 0x40da, 0x40db, 0x40dc, 0x40dd, 0x40de, 0x40df,
+ 0x40e0, 0x40e1, 0x40e2, 0x40e3, 0x40e4, 0x40e5, 0x40e6, 0x40e7,
+ 0x40e8, 0x40e9, 0x40ea, 0x40eb, 0x40ec, 0x40ed, 0x40ee, 0x40ef,
+ 0x40f0, 0x40f1, 0x40f2, 0x40f3, 0x40f4, 0x40f5, 0x40f6, 0x40f7,
+ 0x40f8, 0x40f9, 0x40fa, 0x40fb, 0x40fc, 0x40fd, 0x40fe, 0x40ff,
+ 0x4100, 0x4101, 0x4102, 0x4103, 0x4104, 0x4105, 0x4106, 0x4107,
+ 0x4108, 0x4109, 0x410a, 0x410b, 0x410c, 0x410d, 0x410e, 0x410f,
+ 0x4110, 0x4111, 0x4112, 0x4113, 0x4114, 0x4115, 0x4116, 0x4117,
+ 0x4118, 0x4119, 0x411a, 0x411b, 0x411c, 0x411d, 0x411e, 0x411f,
+ 0x4120, 0x4121, 0x4122, 0x4123, 0x4124, 0x4125, 0x4126, 0x4127,
+ 0x4128, 0x4129, 0x412a, 0x412b, 0x412c, 0x412d, 0x412e, 0x412f,
+ 0x4130, 0x4131, 0x4132, 0x4133, 0x4134, 0x4135, 0x4136, 0x4137,
+ 0x4138, 0x4139, 0x413a, 0x413b, 0x413c, 0x413d, 0x413e, 0x413f,
+ 0x4140, 0x4141, 0x4142, 0x4143, 0x4144, 0x4145, 0x4146, 0x4147,
+ 0x4148, 0x4149, 0x414a, 0x414b, 0x414c, 0x414d, 0x414e, 0x414f,
+ 0x4150, 0x4151, 0x4152, 0x4153, 0x4154, 0x4155, 0x4156, 0x4157,
+ 0x4158, 0x4159, 0x415a, 0x415b, 0x415c, 0x415d, 0x415e, 0x415f,
+ 0x4160, 0x4161, 0x4162, 0x4163, 0x4164, 0x4165, 0x4166, 0x4167,
+ 0x4168, 0x4169, 0x416a, 0x416b, 0x416c, 0x416d, 0x416e, 0x416f,
+ 0x4170, 0x4171, 0x4172, 0x4173, 0x4174, 0x4175, 0x4176, 0x4177,
+ 0x4178, 0x4179, 0x417a, 0x417b, 0x417c, 0x417d, 0x417e, 0x417f,
+ 0x4180, 0x4181, 0x4182, 0x4183, 0x4184, 0x4185, 0x4186, 0x4187,
+ 0x4188, 0x4189, 0x418a, 0x418b, 0x418c, 0x418d, 0x418e, 0x418f,
+ 0x4190, 0x4191, 0x4192, 0x4193, 0x4194, 0x4195, 0x4196, 0x4197,
+ 0x4198, 0x4199, 0x419a, 0x419b, 0x419c, 0x419d, 0x419e, 0x419f,
+ 0x41a0, 0x41a1, 0x41a2, 0x41a3, 0x41a4, 0x41a5, 0x41a6, 0x41a7,
+ 0x41a8, 0x41a9, 0x41aa, 0x41ab, 0x41ac, 0x41ad, 0x41ae, 0x41af,
+ 0x41b0, 0x41b1, 0x41b2, 0x41b3, 0x41b4, 0x41b5, 0x41b6, 0x41b7,
+ 0x41b8, 0x41b9, 0x41ba, 0x41bb, 0x41bc, 0x41bd, 0x41be, 0x41bf,
+ 0x41c0, 0x41c1, 0x41c2, 0x41c3, 0x41c4, 0x41c5, 0x41c6, 0x41c7,
+ 0x41c8, 0x41c9, 0x41ca, 0x41cb, 0x41cc, 0x41cd, 0x41ce, 0x41cf,
+ 0x41d0, 0x41d1, 0x41d2, 0x41d3, 0x41d4, 0x41d5, 0x41d6, 0x41d7,
+ 0x41d8, 0x41d9, 0x41da, 0x41db, 0x41dc, 0x41dd, 0x41de, 0x41df,
+ 0x41e0, 0x41e1, 0x41e2, 0x41e3, 0x41e4, 0x41e5, 0x41e6, 0x41e7,
+ 0x41e8, 0x41e9, 0x41ea, 0x41eb, 0x41ec, 0x41ed, 0x41ee, 0x41ef,
+ 0x41f0, 0x41f1, 0x41f2, 0x41f3, 0x41f4, 0x41f5, 0x41f6, 0x41f7,
+ 0x41f8, 0x41f9, 0x41fa, 0x41fb, 0x41fc, 0x41fd, 0x41fe, 0x41ff,
+ 0x4200, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205, 0x4206, 0x4207,
+ 0x4208, 0x4209, 0x420a, 0x420b, 0x420c, 0x420d, 0x420e, 0x420f,
+ 0x4210, 0x4211, 0x4212, 0x4213, 0x4214, 0x4215, 0x4216, 0x4217,
+ 0x4218, 0x4219, 0x421a, 0x421b, 0x421c, 0x421d, 0x421e, 0x421f,
+ 0x4220, 0x4221, 0x4222, 0x4223, 0x4224, 0x4225, 0x4226, 0x4227,
+ 0x4228, 0x4229, 0x422a, 0x422b, 0x422c, 0x422d, 0x422e, 0x422f,
+ 0x4230, 0x4231, 0x4232, 0x4233, 0x4234, 0x4235, 0x4236, 0x4237,
+ 0x4238, 0x4239, 0x423a, 0x423b, 0x423c, 0x423d, 0x423e, 0x423f,
+ 0x4240, 0x4241, 0x4242, 0x4243, 0x4244, 0x4245, 0x4246, 0x4247,
+ 0x4248, 0x4249, 0x424a, 0x424b, 0x424c, 0x424d, 0x424e, 0x424f,
+ 0x4250, 0x4251, 0x4252, 0x4253, 0x4254, 0x4255, 0x4256, 0x4257,
+ 0x4258, 0x4259, 0x425a, 0x425b, 0x425c, 0x425d, 0x425e, 0x425f,
+ 0x4260, 0x4261, 0x4262, 0x4263, 0x4264, 0x4265, 0x4266, 0x4267,
+ 0x4268, 0x4269, 0x426a, 0x426b, 0x426c, 0x426d, 0x426e, 0x426f,
+ 0x4270, 0x4271, 0x4272, 0x4273, 0x4274, 0x4275, 0x4276, 0x4277,
+ 0x4278, 0x4279, 0x427a, 0x427b, 0x427c, 0x427d, 0x427e, 0x427f,
+ 0x4280, 0x4281, 0x4282, 0x4283, 0x4284, 0x4285, 0x4286, 0x4287,
+ 0x4288, 0x4289, 0x428a, 0x428b, 0x428c, 0x428d, 0x428e, 0x428f,
+ 0x4290, 0x4291, 0x4292, 0x4293, 0x4294, 0x4295, 0x4296, 0x4297,
+ 0x4298, 0x4299, 0x429a, 0x429b, 0x429c, 0x429d, 0x429e, 0x429f,
+ 0x42a0, 0x42a1, 0x42a2, 0x42a3, 0x42a4, 0x42a5, 0x42a6, 0x42a7,
+ 0x42a8, 0x42a9, 0x42aa, 0x42ab, 0x42ac, 0x42ad, 0x42ae, 0x42af,
+ 0x42b0, 0x42b1, 0x42b2, 0x42b3, 0x42b4, 0x42b5, 0x42b6, 0x42b7,
+ 0x42b8, 0x42b9, 0x42ba, 0x42bb, 0x42bc, 0x42bd, 0x42be, 0x42bf,
+ 0x42c0, 0x42c1, 0x42c2, 0x42c3, 0x42c4, 0x42c5, 0x42c6, 0x42c7,
+ 0x42c8, 0x42c9, 0x42ca, 0x42cb, 0x42cc, 0x42cd, 0x42ce, 0x42cf,
+ 0x42d0, 0x42d1, 0x42d2, 0x42d3, 0x42d4, 0x42d5, 0x42d6, 0x42d7,
+ 0x42d8, 0x42d9, 0x42da, 0x42db, 0x42dc, 0x42dd, 0x42de, 0x42df,
+ 0x42e0, 0x42e1, 0x42e2, 0x42e3, 0x42e4, 0x42e5, 0x42e6, 0x42e7,
+ 0x42e8, 0x42e9, 0x42ea, 0x42eb, 0x42ec, 0x42ed, 0x42ee, 0x42ef,
+ 0x42f0, 0x42f1, 0x42f2, 0x42f3, 0x42f4, 0x42f5, 0x42f6, 0x42f7,
+ 0x42f8, 0x42f9, 0x42fa, 0x42fb, 0x42fc, 0x42fd, 0x42fe, 0x42ff,
+ 0x4300, 0x4301, 0x4302, 0x4303, 0x4304, 0x4305, 0x4306, 0x4307,
+ 0x4308, 0x4309, 0x430a, 0x430b, 0x430c, 0x430d, 0x430e, 0x430f,
+ 0x4310, 0x4311, 0x4312, 0x4313, 0x4314, 0x4315, 0x4316, 0x4317,
+ 0x4318, 0x4319, 0x431a, 0x431b, 0x431c, 0x431d, 0x431e, 0x431f,
+ 0x4320, 0x4321, 0x4322, 0x4323, 0x4324, 0x4325, 0x4326, 0x4327,
+ 0x4328, 0x4329, 0x432a, 0x432b, 0x432c, 0x432d, 0x432e, 0x432f,
+ 0x4330, 0x4331, 0x4332, 0x4333, 0x4334, 0x4335, 0x4336, 0x4337,
+ 0x4338, 0x4339, 0x433a, 0x433b, 0x433c, 0x433d, 0x433e, 0x433f,
+ 0x4340, 0x4341, 0x4342, 0x4343, 0x4344, 0x4345, 0x4346, 0x4347,
+ 0x4348, 0x4349, 0x434a, 0x434b, 0x434c, 0x434d, 0x434e, 0x434f,
+ 0x4350, 0x4351, 0x4352, 0x4353, 0x4354, 0x4355, 0x4356, 0x4357,
+ 0x4358, 0x4359, 0x435a, 0x435b, 0x435c, 0x435d, 0x435e, 0x435f,
+ 0x4360, 0x4361, 0x4362, 0x4363, 0x4364, 0x4365, 0x4366, 0x4367,
+ 0x4368, 0x4369, 0x436a, 0x436b, 0x436c, 0x436d, 0x436e, 0x436f,
+ 0x4370, 0x4371, 0x4372, 0x4373, 0x4374, 0x4375, 0x4376, 0x4377,
+ 0x4378, 0x4379, 0x437a, 0x437b, 0x437c, 0x437d, 0x437e, 0x437f,
+ 0x4380, 0x4381, 0x4382, 0x4383, 0x4384, 0x4385, 0x4386, 0x4387,
+ 0x4388, 0x4389, 0x438a, 0x438b, 0x438c, 0x438d, 0x438e, 0x438f,
+ 0x4390, 0x4391, 0x4392, 0x4393, 0x4394, 0x4395, 0x4396, 0x4397,
+ 0x4398, 0x4399, 0x439a, 0x439b, 0x439c, 0x439d, 0x439e, 0x439f,
+ 0x43a0, 0x43a1, 0x43a2, 0x43a3, 0x43a4, 0x43a5, 0x43a6, 0x43a7,
+ 0x43a8, 0x43a9, 0x43aa, 0x43ab, 0x43ac, 0x43ad, 0x43ae, 0x43af,
+ 0x43b0, 0x43b1, 0x43b2, 0x43b3, 0x43b4, 0x43b5, 0x43b6, 0x43b7,
+ 0x43b8, 0x43b9, 0x43ba, 0x43bb, 0x43bc, 0x43bd, 0x43be, 0x43bf,
+ 0x43c0, 0x43c1, 0x43c2, 0x43c3, 0x43c4, 0x43c5, 0x43c6, 0x43c7,
+ 0x43c8, 0x43c9, 0x43ca, 0x43cb, 0x43cc, 0x43cd, 0x43ce, 0x43cf,
+ 0x43d0, 0x43d1, 0x43d2, 0x43d3, 0x43d4, 0x43d5, 0x43d6, 0x43d7,
+ 0x43d8, 0x43d9, 0x43da, 0x43db, 0x43dc, 0x43dd, 0x43de, 0x43df,
+ 0x43e0, 0x43e1, 0x43e2, 0x43e3, 0x43e4, 0x43e5, 0x43e6, 0x43e7,
+ 0x43e8, 0x43e9, 0x43ea, 0x43eb, 0x43ec, 0x43ed, 0x43ee, 0x43ef,
+ 0x43f0, 0x43f1, 0x43f2, 0x43f3, 0x43f4, 0x43f5, 0x43f6, 0x43f7,
+ 0x43f8, 0x43f9, 0x43fa, 0x43fb, 0x43fc, 0x43fd, 0x43fe, 0x43ff,
+ 0x4400, 0x4401, 0x4402, 0x4403, 0x4404, 0x4405, 0x4406, 0x4407,
+ 0x4408, 0x4409, 0x440a, 0x440b, 0x440c, 0x440d, 0x440e, 0x440f,
+ 0x4410, 0x4411, 0x4412, 0x4413, 0x4414, 0x4415, 0x4416, 0x4417,
+ 0x4418, 0x4419, 0x441a, 0x441b, 0x441c, 0x441d, 0x441e, 0x441f,
+ 0x4420, 0x4421, 0x4422, 0x4423, 0x4424, 0x4425, 0x4426, 0x4427,
+ 0x4428, 0x4429, 0x442a, 0x442b, 0x442c, 0x442d, 0x442e, 0x442f,
+ 0x4430, 0x4431, 0x4432, 0x4433, 0x4434, 0x4435, 0x4436, 0x4437,
+ 0x4438, 0x4439, 0x443a, 0x443b, 0x443c, 0x443d, 0x443e, 0x443f,
+ 0x4440, 0x4441, 0x4442, 0x4443, 0x4444, 0x4445, 0x4446, 0x4447,
+ 0x4448, 0x4449, 0x444a, 0x444b, 0x444c, 0x444d, 0x444e, 0x444f,
+ 0x4450, 0x4451, 0x4452, 0x4453, 0x4454, 0x4455, 0x4456, 0x4457,
+ 0x4458, 0x4459, 0x445a, 0x445b, 0x445c, 0x445d, 0x445e, 0x445f,
+ 0x4460, 0x4461, 0x4462, 0x4463, 0x4464, 0x4465, 0x4466, 0x4467,
+ 0x4468, 0x4469, 0x446a, 0x446b, 0x446c, 0x446d, 0x446e, 0x446f,
+ 0x4470, 0x4471, 0x4472, 0x4473, 0x4474, 0x4475, 0x4476, 0x4477,
+ 0x4478, 0x4479, 0x447a, 0x447b, 0x447c, 0x447d, 0x447e, 0x447f,
+ 0x4480, 0x4481, 0x4482, 0x4483, 0x4484, 0x4485, 0x4486, 0x4487,
+ 0x4488, 0x4489, 0x448a, 0x448b, 0x448c, 0x448d, 0x448e, 0x448f,
+ 0x4490, 0x4491, 0x4492, 0x4493, 0x4494, 0x4495, 0x4496, 0x4497,
+ 0x4498, 0x4499, 0x449a, 0x449b, 0x449c, 0x449d, 0x449e, 0x449f,
+ 0x44a0, 0x44a1, 0x44a2, 0x44a3, 0x44a4, 0x44a5, 0x44a6, 0x44a7,
+ 0x44a8, 0x44a9, 0x44aa, 0x44ab, 0x44ac, 0x44ad, 0x44ae, 0x44af,
+ 0x44b0, 0x44b1, 0x44b2, 0x44b3, 0x44b4, 0x44b5, 0x44b6, 0x44b7,
+ 0x44b8, 0x44b9, 0x44ba, 0x44bb, 0x44bc, 0x44bd, 0x44be, 0x44bf,
+ 0x44c0, 0x44c1, 0x44c2, 0x44c3, 0x44c4, 0x44c5, 0x44c6, 0x44c7,
+ 0x44c8, 0x44c9, 0x44ca, 0x44cb, 0x44cc, 0x44cd, 0x44ce, 0x44cf,
+ 0x44d0, 0x44d1, 0x44d2, 0x44d3, 0x44d4, 0x44d5, 0x44d6, 0x44d7,
+ 0x44d8, 0x44d9, 0x44da, 0x44db, 0x44dc, 0x44dd, 0x44de, 0x44df,
+ 0x44e0, 0x44e1, 0x44e2, 0x44e3, 0x44e4, 0x44e5, 0x44e6, 0x44e7,
+ 0x44e8, 0x44e9, 0x44ea, 0x44eb, 0x44ec, 0x44ed, 0x44ee, 0x44ef,
+ 0x44f0, 0x44f1, 0x44f2, 0x44f3, 0x44f4, 0x44f5, 0x44f6, 0x44f7,
+ 0x44f8, 0x44f9, 0x44fa, 0x44fb, 0x44fc, 0x44fd, 0x44fe, 0x44ff,
+ 0x4500, 0x4501, 0x4502, 0x4503, 0x4504, 0x4505, 0x4506, 0x4507,
+ 0x4508, 0x4509, 0x450a, 0x450b, 0x450c, 0x450d, 0x450e, 0x450f,
+ 0x4510, 0x4511, 0x4512, 0x4513, 0x4514, 0x4515, 0x4516, 0x4517,
+ 0x4518, 0x4519, 0x451a, 0x451b, 0x451c, 0x451d, 0x451e, 0x451f,
+ 0x4520, 0x4521, 0x4522, 0x4523, 0x4524, 0x4525, 0x4526, 0x4527,
+ 0x4528, 0x4529, 0x452a, 0x452b, 0x452c, 0x452d, 0x452e, 0x452f,
+ 0x4530, 0x4531, 0x4532, 0x4533, 0x4534, 0x4535, 0x4536, 0x4537,
+ 0x4538, 0x4539, 0x453a, 0x453b, 0x453c, 0x453d, 0x453e, 0x453f,
+ 0x4540, 0x4541, 0x4542, 0x4543, 0x4544, 0x4545, 0x4546, 0x4547,
+ 0x4548, 0x4549, 0x454a, 0x454b, 0x454c, 0x454d, 0x454e, 0x454f,
+ 0x4550, 0x4551, 0x4552, 0x4553, 0x4554, 0x4555, 0x4556, 0x4557,
+ 0x4558, 0x4559, 0x455a, 0x455b, 0x455c, 0x455d, 0x455e, 0x455f,
+ 0x4560, 0x4561, 0x4562, 0x4563, 0x4564, 0x4565, 0x4566, 0x4567,
+ 0x4568, 0x4569, 0x456a, 0x456b, 0x456c, 0x456d, 0x456e, 0x456f,
+ 0x4570, 0x4571, 0x4572, 0x4573, 0x4574, 0x4575, 0x4576, 0x4577,
+ 0x4578, 0x4579, 0x457a, 0x457b, 0x457c, 0x457d, 0x457e, 0x457f,
+ 0x4580, 0x4581, 0x4582, 0x4583, 0x4584, 0x4585, 0x4586, 0x4587,
+ 0x4588, 0x4589, 0x458a, 0x458b, 0x458c, 0x458d, 0x458e, 0x458f,
+ 0x4590, 0x4591, 0x4592, 0x4593, 0x4594, 0x4595, 0x4596, 0x4597,
+ 0x4598, 0x4599, 0x459a, 0x459b, 0x459c, 0x459d, 0x459e, 0x459f,
+ 0x45a0, 0x45a1, 0x45a2, 0x45a3, 0x45a4, 0x45a5, 0x45a6, 0x45a7,
+ 0x45a8, 0x45a9, 0x45aa, 0x45ab, 0x45ac, 0x45ad, 0x45ae, 0x45af,
+ 0x45b0, 0x45b1, 0x45b2, 0x45b3, 0x45b4, 0x45b5, 0x45b6, 0x45b7,
+ 0x45b8, 0x45b9, 0x45ba, 0x45bb, 0x45bc, 0x45bd, 0x45be, 0x45bf,
+ 0x45c0, 0x45c1, 0x45c2, 0x45c3, 0x45c4, 0x45c5, 0x45c6, 0x45c7,
+ 0x45c8, 0x45c9, 0x45ca, 0x45cb, 0x45cc, 0x45cd, 0x45ce, 0x45cf,
+ 0x45d0, 0x45d1, 0x45d2, 0x45d3, 0x45d4, 0x45d5, 0x45d6, 0x45d7,
+ 0x45d8, 0x45d9, 0x45da, 0x45db, 0x45dc, 0x45dd, 0x45de, 0x45df,
+ 0x45e0, 0x45e1, 0x45e2, 0x45e3, 0x45e4, 0x45e5, 0x45e6, 0x45e7,
+ 0x45e8, 0x45e9, 0x45ea, 0x45eb, 0x45ec, 0x45ed, 0x45ee, 0x45ef,
+ 0x45f0, 0x45f1, 0x45f2, 0x45f3, 0x45f4, 0x45f5, 0x45f6, 0x45f7,
+ 0x45f8, 0x45f9, 0x45fa, 0x45fb, 0x45fc, 0x45fd, 0x45fe, 0x45ff,
+ 0x4600, 0x4601, 0x4602, 0x4603, 0x4604, 0x4605, 0x4606, 0x4607,
+ 0x4608, 0x4609, 0x460a, 0x460b, 0x460c, 0x460d, 0x460e, 0x460f,
+ 0x4610, 0x4611, 0x4612, 0x4613, 0x4614, 0x4615, 0x4616, 0x4617,
+ 0x4618, 0x4619, 0x461a, 0x461b, 0x461c, 0x461d, 0x461e, 0x461f,
+ 0x4620, 0x4621, 0x4622, 0x4623, 0x4624, 0x4625, 0x4626, 0x4627,
+ 0x4628, 0x4629, 0x462a, 0x462b, 0x462c, 0x462d, 0x462e, 0x462f,
+ 0x4630, 0x4631, 0x4632, 0x4633, 0x4634, 0x4635, 0x4636, 0x4637,
+ 0x4638, 0x4639, 0x463a, 0x463b, 0x463c, 0x463d, 0x463e, 0x463f,
+ 0x4640, 0x4641, 0x4642, 0x4643, 0x4644, 0x4645, 0x4646, 0x4647,
+ 0x4648, 0x4649, 0x464a, 0x464b, 0x464c, 0x464d, 0x464e, 0x464f,
+ 0x4650, 0x4651, 0x4652, 0x4653, 0x4654, 0x4655, 0x4656, 0x4657,
+ 0x4658, 0x4659, 0x465a, 0x465b, 0x465c, 0x465d, 0x465e, 0x465f,
+ 0x4660, 0x4661, 0x4662, 0x4663, 0x4664, 0x4665, 0x4666, 0x4667,
+ 0x4668, 0x4669, 0x466a, 0x466b, 0x466c, 0x466d, 0x466e, 0x466f,
+ 0x4670, 0x4671, 0x4672, 0x4673, 0x4674, 0x4675, 0x4676, 0x4677,
+ 0x4678, 0x4679, 0x467a, 0x467b, 0x467c, 0x467d, 0x467e, 0x467f,
+ 0x4680, 0x4681, 0x4682, 0x4683, 0x4684, 0x4685, 0x4686, 0x4687,
+ 0x4688, 0x4689, 0x468a, 0x468b, 0x468c, 0x468d, 0x468e, 0x468f,
+ 0x4690, 0x4691, 0x4692, 0x4693, 0x4694, 0x4695, 0x4696, 0x4697,
+ 0x4698, 0x4699, 0x469a, 0x469b, 0x469c, 0x469d, 0x469e, 0x469f,
+ 0x46a0, 0x46a1, 0x46a2, 0x46a3, 0x46a4, 0x46a5, 0x46a6, 0x46a7,
+ 0x46a8, 0x46a9, 0x46aa, 0x46ab, 0x46ac, 0x46ad, 0x46ae, 0x46af,
+ 0x46b0, 0x46b1, 0x46b2, 0x46b3, 0x46b4, 0x46b5, 0x46b6, 0x46b7,
+ 0x46b8, 0x46b9, 0x46ba, 0x46bb, 0x46bc, 0x46bd, 0x46be, 0x46bf,
+ 0x46c0, 0x46c1, 0x46c2, 0x46c3, 0x46c4, 0x46c5, 0x46c6, 0x46c7,
+ 0x46c8, 0x46c9, 0x46ca, 0x46cb, 0x46cc, 0x46cd, 0x46ce, 0x46cf,
+ 0x46d0, 0x46d1, 0x46d2, 0x46d3, 0x46d4, 0x46d5, 0x46d6, 0x46d7,
+ 0x46d8, 0x46d9, 0x46da, 0x46db, 0x46dc, 0x46dd, 0x46de, 0x46df,
+ 0x46e0, 0x46e1, 0x46e2, 0x46e3, 0x46e4, 0x46e5, 0x46e6, 0x46e7,
+ 0x46e8, 0x46e9, 0x46ea, 0x46eb, 0x46ec, 0x46ed, 0x46ee, 0x46ef,
+ 0x46f0, 0x46f1, 0x46f2, 0x46f3, 0x46f4, 0x46f5, 0x46f6, 0x46f7,
+ 0x46f8, 0x46f9, 0x46fa, 0x46fb, 0x46fc, 0x46fd, 0x46fe, 0x46ff,
+ 0x4700, 0x4701, 0x4702, 0x4703, 0x4704, 0x4705, 0x4706, 0x4707,
+ 0x4708, 0x4709, 0x470a, 0x470b, 0x470c, 0x470d, 0x470e, 0x470f,
+ 0x4710, 0x4711, 0x4712, 0x4713, 0x4714, 0x4715, 0x4716, 0x4717,
+ 0x4718, 0x4719, 0x471a, 0x471b, 0x471c, 0x471d, 0x471e, 0x471f,
+ 0x4720, 0x4721, 0x4722, 0x4723, 0x4724, 0x4725, 0x4726, 0x4727,
+ 0x4728, 0x4729, 0x472a, 0x472b, 0x472c, 0x472d, 0x472e, 0x472f,
+ 0x4730, 0x4731, 0x4732, 0x4733, 0x4734, 0x4735, 0x4736, 0x4737,
+ 0x4738, 0x4739, 0x473a, 0x473b, 0x473c, 0x473d, 0x473e, 0x473f,
+ 0x4740, 0x4741, 0x4742, 0x4743, 0x4744, 0x4745, 0x4746, 0x4747,
+ 0x4748, 0x4749, 0x474a, 0x474b, 0x474c, 0x474d, 0x474e, 0x474f,
+ 0x4750, 0x4751, 0x4752, 0x4753, 0x4754, 0x4755, 0x4756, 0x4757,
+ 0x4758, 0x4759, 0x475a, 0x475b, 0x475c, 0x475d, 0x475e, 0x475f,
+ 0x4760, 0x4761, 0x4762, 0x4763, 0x4764, 0x4765, 0x4766, 0x4767,
+ 0x4768, 0x4769, 0x476a, 0x476b, 0x476c, 0x476d, 0x476e, 0x476f,
+ 0x4770, 0x4771, 0x4772, 0x4773, 0x4774, 0x4775, 0x4776, 0x4777,
+ 0x4778, 0x4779, 0x477a, 0x477b, 0x477c, 0x477d, 0x477e, 0x477f,
+ 0x4780, 0x4781, 0x4782, 0x4783, 0x4784, 0x4785, 0x4786, 0x4787,
+ 0x4788, 0x4789, 0x478a, 0x478b, 0x478c, 0x478d, 0x478e, 0x478f,
+ 0x4790, 0x4791, 0x4792, 0x4793, 0x4794, 0x4795, 0x4796, 0x4797,
+ 0x4798, 0x4799, 0x479a, 0x479b, 0x479c, 0x479d, 0x479e, 0x479f,
+ 0x47a0, 0x47a1, 0x47a2, 0x47a3, 0x47a4, 0x47a5, 0x47a6, 0x47a7,
+ 0x47a8, 0x47a9, 0x47aa, 0x47ab, 0x47ac, 0x47ad, 0x47ae, 0x47af,
+ 0x47b0, 0x47b1, 0x47b2, 0x47b3, 0x47b4, 0x47b5, 0x47b6, 0x47b7,
+ 0x47b8, 0x47b9, 0x47ba, 0x47bb, 0x47bc, 0x47bd, 0x47be, 0x47bf,
+ 0x47c0, 0x47c1, 0x47c2, 0x47c3, 0x47c4, 0x47c5, 0x47c6, 0x47c7,
+ 0x47c8, 0x47c9, 0x47ca, 0x47cb, 0x47cc, 0x47cd, 0x47ce, 0x47cf,
+ 0x47d0, 0x47d1, 0x47d2, 0x47d3, 0x47d4, 0x47d5, 0x47d6, 0x47d7,
+ 0x47d8, 0x47d9, 0x47da, 0x47db, 0x47dc, 0x47dd, 0x47de, 0x47df,
+ 0x47e0, 0x47e1, 0x47e2, 0x47e3, 0x47e4, 0x47e5, 0x47e6, 0x47e7,
+ 0x47e8, 0x47e9, 0x47ea, 0x47eb, 0x47ec, 0x47ed, 0x47ee, 0x47ef,
+ 0x47f0, 0x47f1, 0x47f2, 0x47f3, 0x47f4, 0x47f5, 0x47f6, 0x47f7,
+ 0x47f8, 0x47f9, 0x47fa, 0x47fb, 0x47fc, 0x47fd, 0x47fe, 0x47ff,
+ 0x4800, 0x4801, 0x4802, 0x4803, 0x4804, 0x4805, 0x4806, 0x4807,
+ 0x4808, 0x4809, 0x480a, 0x480b, 0x480c, 0x480d, 0x480e, 0x480f,
+ 0x4810, 0x4811, 0x4812, 0x4813, 0x4814, 0x4815, 0x4816, 0x4817,
+ 0x4818, 0x4819, 0x481a, 0x481b, 0x481c, 0x481d, 0x481e, 0x481f,
+ 0x4820, 0x4821, 0x4822, 0x4823, 0x4824, 0x4825, 0x4826, 0x4827,
+ 0x4828, 0x4829, 0x482a, 0x482b, 0x482c, 0x482d, 0x482e, 0x482f,
+ 0x4830, 0x4831, 0x4832, 0x4833, 0x4834, 0x4835, 0x4836, 0x4837,
+ 0x4838, 0x4839, 0x483a, 0x483b, 0x483c, 0x483d, 0x483e, 0x483f,
+ 0x4840, 0x4841, 0x4842, 0x4843, 0x4844, 0x4845, 0x4846, 0x4847,
+ 0x4848, 0x4849, 0x484a, 0x484b, 0x484c, 0x484d, 0x484e, 0x484f,
+ 0x4850, 0x4851, 0x4852, 0x4853, 0x4854, 0x4855, 0x4856, 0x4857,
+ 0x4858, 0x4859, 0x485a, 0x485b, 0x485c, 0x485d, 0x485e, 0x485f,
+ 0x4860, 0x4861, 0x4862, 0x4863, 0x4864, 0x4865, 0x4866, 0x4867,
+ 0x4868, 0x4869, 0x486a, 0x486b, 0x486c, 0x486d, 0x486e, 0x486f,
+ 0x4870, 0x4871, 0x4872, 0x4873, 0x4874, 0x4875, 0x4876, 0x4877,
+ 0x4878, 0x4879, 0x487a, 0x487b, 0x487c, 0x487d, 0x487e, 0x487f,
+ 0x4880, 0x4881, 0x4882, 0x4883, 0x4884, 0x4885, 0x4886, 0x4887,
+ 0x4888, 0x4889, 0x488a, 0x488b, 0x488c, 0x488d, 0x488e, 0x488f,
+ 0x4890, 0x4891, 0x4892, 0x4893, 0x4894, 0x4895, 0x4896, 0x4897,
+ 0x4898, 0x4899, 0x489a, 0x489b, 0x489c, 0x489d, 0x489e, 0x489f,
+ 0x48a0, 0x48a1, 0x48a2, 0x48a3, 0x48a4, 0x48a5, 0x48a6, 0x48a7,
+ 0x48a8, 0x48a9, 0x48aa, 0x48ab, 0x48ac, 0x48ad, 0x48ae, 0x48af,
+ 0x48b0, 0x48b1, 0x48b2, 0x48b3, 0x48b4, 0x48b5, 0x48b6, 0x48b7,
+ 0x48b8, 0x48b9, 0x48ba, 0x48bb, 0x48bc, 0x48bd, 0x48be, 0x48bf,
+ 0x48c0, 0x48c1, 0x48c2, 0x48c3, 0x48c4, 0x48c5, 0x48c6, 0x48c7,
+ 0x48c8, 0x48c9, 0x48ca, 0x48cb, 0x48cc, 0x48cd, 0x48ce, 0x48cf,
+ 0x48d0, 0x48d1, 0x48d2, 0x48d3, 0x48d4, 0x48d5, 0x48d6, 0x48d7,
+ 0x48d8, 0x48d9, 0x48da, 0x48db, 0x48dc, 0x48dd, 0x48de, 0x48df,
+ 0x48e0, 0x48e1, 0x48e2, 0x48e3, 0x48e4, 0x48e5, 0x48e6, 0x48e7,
+ 0x48e8, 0x48e9, 0x48ea, 0x48eb, 0x48ec, 0x48ed, 0x48ee, 0x48ef,
+ 0x48f0, 0x48f1, 0x48f2, 0x48f3, 0x48f4, 0x48f5, 0x48f6, 0x48f7,
+ 0x48f8, 0x48f9, 0x48fa, 0x48fb, 0x48fc, 0x48fd, 0x48fe, 0x48ff,
+ 0x4900, 0x4901, 0x4902, 0x4903, 0x4904, 0x4905, 0x4906, 0x4907,
+ 0x4908, 0x4909, 0x490a, 0x490b, 0x490c, 0x490d, 0x490e, 0x490f,
+ 0x4910, 0x4911, 0x4912, 0x4913, 0x4914, 0x4915, 0x4916, 0x4917,
+ 0x4918, 0x4919, 0x491a, 0x491b, 0x491c, 0x491d, 0x491e, 0x491f,
+ 0x4920, 0x4921, 0x4922, 0x4923, 0x4924, 0x4925, 0x4926, 0x4927,
+ 0x4928, 0x4929, 0x492a, 0x492b, 0x492c, 0x492d, 0x492e, 0x492f,
+ 0x4930, 0x4931, 0x4932, 0x4933, 0x4934, 0x4935, 0x4936, 0x4937,
+ 0x4938, 0x4939, 0x493a, 0x493b, 0x493c, 0x493d, 0x493e, 0x493f,
+ 0x4940, 0x4941, 0x4942, 0x4943, 0x4944, 0x4945, 0x4946, 0x4947,
+ 0x4948, 0x4949, 0x494a, 0x494b, 0x494c, 0x494d, 0x494e, 0x494f,
+ 0x4950, 0x4951, 0x4952, 0x4953, 0x4954, 0x4955, 0x4956, 0x4957,
+ 0x4958, 0x4959, 0x495a, 0x495b, 0x495c, 0x495d, 0x495e, 0x495f,
+ 0x4960, 0x4961, 0x4962, 0x4963, 0x4964, 0x4965, 0x4966, 0x4967,
+ 0x4968, 0x4969, 0x496a, 0x496b, 0x496c, 0x496d, 0x496e, 0x496f,
+ 0x4970, 0x4971, 0x4972, 0x4973, 0x4974, 0x4975, 0x4976, 0x4977,
+ 0x4978, 0x4979, 0x497a, 0x497b, 0x497c, 0x497d, 0x497e, 0x497f,
+ 0x4980, 0x4981, 0x4982, 0x4983, 0x4984, 0x4985, 0x4986, 0x4987,
+ 0x4988, 0x4989, 0x498a, 0x498b, 0x498c, 0x498d, 0x498e, 0x498f,
+ 0x4990, 0x4991, 0x4992, 0x4993, 0x4994, 0x4995, 0x4996, 0x4997,
+ 0x4998, 0x4999, 0x499a, 0x499b, 0x499c, 0x499d, 0x499e, 0x499f,
+ 0x49a0, 0x49a1, 0x49a2, 0x49a3, 0x49a4, 0x49a5, 0x49a6, 0x49a7,
+ 0x49a8, 0x49a9, 0x49aa, 0x49ab, 0x49ac, 0x49ad, 0x49ae, 0x49af,
+ 0x49b0, 0x49b1, 0x49b2, 0x49b3, 0x49b4, 0x49b5, 0x49b6, 0x49b7,
+ 0x49b8, 0x49b9, 0x49ba, 0x49bb, 0x49bc, 0x49bd, 0x49be, 0x49bf,
+ 0x49c0, 0x49c1, 0x49c2, 0x49c3, 0x49c4, 0x49c5, 0x49c6, 0x49c7,
+ 0x49c8, 0x49c9, 0x49ca, 0x49cb, 0x49cc, 0x49cd, 0x49ce, 0x49cf,
+ 0x49d0, 0x49d1, 0x49d2, 0x49d3, 0x49d4, 0x49d5, 0x49d6, 0x49d7,
+ 0x49d8, 0x49d9, 0x49da, 0x49db, 0x49dc, 0x49dd, 0x49de, 0x49df,
+ 0x49e0, 0x49e1, 0x49e2, 0x49e3, 0x49e4, 0x49e5, 0x49e6, 0x49e7,
+ 0x49e8, 0x49e9, 0x49ea, 0x49eb, 0x49ec, 0x49ed, 0x49ee, 0x49ef,
+ 0x49f0, 0x49f1, 0x49f2, 0x49f3, 0x49f4, 0x49f5, 0x49f6, 0x49f7,
+ 0x49f8, 0x49f9, 0x49fa, 0x49fb, 0x49fc, 0x49fd, 0x49fe, 0x49ff,
+ 0x4a00, 0x4a01, 0x4a02, 0x4a03, 0x4a04, 0x4a05, 0x4a06, 0x4a07,
+ 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a0e, 0x4a0f,
+ 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17,
+ 0x4a18, 0x4a19, 0x4a1a, 0x4a1b, 0x4a1c, 0x4a1d, 0x4a1e, 0x4a1f,
+ 0x4a20, 0x4a21, 0x4a22, 0x4a23, 0x4a24, 0x4a25, 0x4a26, 0x4a27,
+ 0x4a28, 0x4a29, 0x4a2a, 0x4a2b, 0x4a2c, 0x4a2d, 0x4a2e, 0x4a2f,
+ 0x4a30, 0x4a31, 0x4a32, 0x4a33, 0x4a34, 0x4a35, 0x4a36, 0x4a37,
+ 0x4a38, 0x4a39, 0x4a3a, 0x4a3b, 0x4a3c, 0x4a3d, 0x4a3e, 0x4a3f,
+ 0x4a40, 0x4a41, 0x4a42, 0x4a43, 0x4a44, 0x4a45, 0x4a46, 0x4a47,
+ 0x4a48, 0x4a49, 0x4a4a, 0x4a4b, 0x4a4c, 0x4a4d, 0x4a4e, 0x4a4f,
+ 0x4a50, 0x4a51, 0x4a52, 0x4a53, 0x4a54, 0x4a55, 0x4a56, 0x4a57,
+ 0x4a58, 0x4a59, 0x4a5a, 0x4a5b, 0x4a5c, 0x4a5d, 0x4a5e, 0x4a5f,
+ 0x4a60, 0x4a61, 0x4a62, 0x4a63, 0x4a64, 0x4a65, 0x4a66, 0x4a67,
+ 0x4a68, 0x4a69, 0x4a6a, 0x4a6b, 0x4a6c, 0x4a6d, 0x4a6e, 0x4a6f,
+ 0x4a70, 0x4a71, 0x4a72, 0x4a73, 0x4a74, 0x4a75, 0x4a76, 0x4a77,
+ 0x4a78, 0x4a79, 0x4a7a, 0x4a7b, 0x4a7c, 0x4a7d, 0x4a7e, 0x4a7f,
+ 0x4a80, 0x4a81, 0x4a82, 0x4a83, 0x4a84, 0x4a85, 0x4a86, 0x4a87,
+ 0x4a88, 0x4a89, 0x4a8a, 0x4a8b, 0x4a8c, 0x4a8d, 0x4a8e, 0x4a8f,
+ 0x4a90, 0x4a91, 0x4a92, 0x4a93, 0x4a94, 0x4a95, 0x4a96, 0x4a97,
+ 0x4a98, 0x4a99, 0x4a9a, 0x4a9b, 0x4a9c, 0x4a9d, 0x4a9e, 0x4a9f,
+ 0x4aa0, 0x4aa1, 0x4aa2, 0x4aa3, 0x4aa4, 0x4aa5, 0x4aa6, 0x4aa7,
+ 0x4aa8, 0x4aa9, 0x4aaa, 0x4aab, 0x4aac, 0x4aad, 0x4aae, 0x4aaf,
+ 0x4ab0, 0x4ab1, 0x4ab2, 0x4ab3, 0x4ab4, 0x4ab5, 0x4ab6, 0x4ab7,
+ 0x4ab8, 0x4ab9, 0x4aba, 0x4abb, 0x4abc, 0x4abd, 0x4abe, 0x4abf,
+ 0x4ac0, 0x4ac1, 0x4ac2, 0x4ac3, 0x4ac4, 0x4ac5, 0x4ac6, 0x4ac7,
+ 0x4ac8, 0x4ac9, 0x4aca, 0x4acb, 0x4acc, 0x4acd, 0x4ace, 0x4acf,
+ 0x4ad0, 0x4ad1, 0x4ad2, 0x4ad3, 0x4ad4, 0x4ad5, 0x4ad6, 0x4ad7,
+ 0x4ad8, 0x4ad9, 0x4ada, 0x4adb, 0x4adc, 0x4add, 0x4ade, 0x4adf,
+ 0x4ae0, 0x4ae1, 0x4ae2, 0x4ae3, 0x4ae4, 0x4ae5, 0x4ae6, 0x4ae7,
+ 0x4ae8, 0x4ae9, 0x4aea, 0x4aeb, 0x4aec, 0x4aed, 0x4aee, 0x4aef,
+ 0x4af0, 0x4af1, 0x4af2, 0x4af3, 0x4af4, 0x4af5, 0x4af6, 0x4af7,
+ 0x4af8, 0x4af9, 0x4afa, 0x4afb, 0x4afc, 0x4afd, 0x4afe, 0x4aff,
+ 0x4b00, 0x4b01, 0x4b02, 0x4b03, 0x4b04, 0x4b05, 0x4b06, 0x4b07,
+ 0x4b08, 0x4b09, 0x4b0a, 0x4b0b, 0x4b0c, 0x4b0d, 0x4b0e, 0x4b0f,
+ 0x4b10, 0x4b11, 0x4b12, 0x4b13, 0x4b14, 0x4b15, 0x4b16, 0x4b17,
+ 0x4b18, 0x4b19, 0x4b1a, 0x4b1b, 0x4b1c, 0x4b1d, 0x4b1e, 0x4b1f,
+ 0x4b20, 0x4b21, 0x4b22, 0x4b23, 0x4b24, 0x4b25, 0x4b26, 0x4b27,
+ 0x4b28, 0x4b29, 0x4b2a, 0x4b2b, 0x4b2c, 0x4b2d, 0x4b2e, 0x4b2f,
+ 0x4b30, 0x4b31, 0x4b32, 0x4b33, 0x4b34, 0x4b35, 0x4b36, 0x4b37,
+ 0x4b38, 0x4b39, 0x4b3a, 0x4b3b, 0x4b3c, 0x4b3d, 0x4b3e, 0x4b3f,
+ 0x4b40, 0x4b41, 0x4b42, 0x4b43, 0x4b44, 0x4b45, 0x4b46, 0x4b47,
+ 0x4b48, 0x4b49, 0x4b4a, 0x4b4b, 0x4b4c, 0x4b4d, 0x4b4e, 0x4b4f,
+ 0x4b50, 0x4b51, 0x4b52, 0x4b53, 0x4b54, 0x4b55, 0x4b56, 0x4b57,
+ 0x4b58, 0x4b59, 0x4b5a, 0x4b5b, 0x4b5c, 0x4b5d, 0x4b5e, 0x4b5f,
+ 0x4b60, 0x4b61, 0x4b62, 0x4b63, 0x4b64, 0x4b65, 0x4b66, 0x4b67,
+ 0x4b68, 0x4b69, 0x4b6a, 0x4b6b, 0x4b6c, 0x4b6d, 0x4b6e, 0x4b6f,
+ 0x4b70, 0x4b71, 0x4b72, 0x4b73, 0x4b74, 0x4b75, 0x4b76, 0x4b77,
+ 0x4b78, 0x4b79, 0x4b7a, 0x4b7b, 0x4b7c, 0x4b7d, 0x4b7e, 0x4b7f,
+ 0x4b80, 0x4b81, 0x4b82, 0x4b83, 0x4b84, 0x4b85, 0x4b86, 0x4b87,
+ 0x4b88, 0x4b89, 0x4b8a, 0x4b8b, 0x4b8c, 0x4b8d, 0x4b8e, 0x4b8f,
+ 0x4b90, 0x4b91, 0x4b92, 0x4b93, 0x4b94, 0x4b95, 0x4b96, 0x4b97,
+ 0x4b98, 0x4b99, 0x4b9a, 0x4b9b, 0x4b9c, 0x4b9d, 0x4b9e, 0x4b9f,
+ 0x4ba0, 0x4ba1, 0x4ba2, 0x4ba3, 0x4ba4, 0x4ba5, 0x4ba6, 0x4ba7,
+ 0x4ba8, 0x4ba9, 0x4baa, 0x4bab, 0x4bac, 0x4bad, 0x4bae, 0x4baf,
+ 0x4bb0, 0x4bb1, 0x4bb2, 0x4bb3, 0x4bb4, 0x4bb5, 0x4bb6, 0x4bb7,
+ 0x4bb8, 0x4bb9, 0x4bba, 0x4bbb, 0x4bbc, 0x4bbd, 0x4bbe, 0x4bbf,
+ 0x4bc0, 0x4bc1, 0x4bc2, 0x4bc3, 0x4bc4, 0x4bc5, 0x4bc6, 0x4bc7,
+ 0x4bc8, 0x4bc9, 0x4bca, 0x4bcb, 0x4bcc, 0x4bcd, 0x4bce, 0x4bcf,
+ 0x4bd0, 0x4bd1, 0x4bd2, 0x4bd3, 0x4bd4, 0x4bd5, 0x4bd6, 0x4bd7,
+ 0x4bd8, 0x4bd9, 0x4bda, 0x4bdb, 0x4bdc, 0x4bdd, 0x4bde, 0x4bdf,
+ 0x4be0, 0x4be1, 0x4be2, 0x4be3, 0x4be4, 0x4be5, 0x4be6, 0x4be7,
+ 0x4be8, 0x4be9, 0x4bea, 0x4beb, 0x4bec, 0x4bed, 0x4bee, 0x4bef,
+ 0x4bf0, 0x4bf1, 0x4bf2, 0x4bf3, 0x4bf4, 0x4bf5, 0x4bf6, 0x4bf7,
+ 0x4bf8, 0x4bf9, 0x4bfa, 0x4bfb, 0x4bfc, 0x4bfd, 0x4bfe, 0x4bff,
+ 0x4c00, 0x4c01, 0x4c02, 0x4c03, 0x4c04, 0x4c05, 0x4c06, 0x4c07,
+ 0x4c08, 0x4c09, 0x4c0a, 0x4c0b, 0x4c0c, 0x4c0d, 0x4c0e, 0x4c0f,
+ 0x4c10, 0x4c11, 0x4c12, 0x4c13, 0x4c14, 0x4c15, 0x4c16, 0x4c17,
+ 0x4c18, 0x4c19, 0x4c1a, 0x4c1b, 0x4c1c, 0x4c1d, 0x4c1e, 0x4c1f,
+ 0x4c20, 0x4c21, 0x4c22, 0x4c23, 0x4c24, 0x4c25, 0x4c26, 0x4c27,
+ 0x4c28, 0x4c29, 0x4c2a, 0x4c2b, 0x4c2c, 0x4c2d, 0x4c2e, 0x4c2f,
+ 0x4c30, 0x4c31, 0x4c32, 0x4c33, 0x4c34, 0x4c35, 0x4c36, 0x4c37,
+ 0x4c38, 0x4c39, 0x4c3a, 0x4c3b, 0x4c3c, 0x4c3d, 0x4c3e, 0x4c3f,
+ 0x4c40, 0x4c41, 0x4c42, 0x4c43, 0x4c44, 0x4c45, 0x4c46, 0x4c47,
+ 0x4c48, 0x4c49, 0x4c4a, 0x4c4b, 0x4c4c, 0x4c4d, 0x4c4e, 0x4c4f,
+ 0x4c50, 0x4c51, 0x4c52, 0x4c53, 0x4c54, 0x4c55, 0x4c56, 0x4c57,
+ 0x4c58, 0x4c59, 0x4c5a, 0x4c5b, 0x4c5c, 0x4c5d, 0x4c5e, 0x4c5f,
+ 0x4c60, 0x4c61, 0x4c62, 0x4c63, 0x4c64, 0x4c65, 0x4c66, 0x4c67,
+ 0x4c68, 0x4c69, 0x4c6a, 0x4c6b, 0x4c6c, 0x4c6d, 0x4c6e, 0x4c6f,
+ 0x4c70, 0x4c71, 0x4c72, 0x4c73, 0x4c74, 0x4c75, 0x4c76, 0x4c77,
+ 0x4c78, 0x4c79, 0x4c7a, 0x4c7b, 0x4c7c, 0x4c7d, 0x4c7e, 0x4c7f,
+ 0x4c80, 0x4c81, 0x4c82, 0x4c83, 0x4c84, 0x4c85, 0x4c86, 0x4c87,
+ 0x4c88, 0x4c89, 0x4c8a, 0x4c8b, 0x4c8c, 0x4c8d, 0x4c8e, 0x4c8f,
+ 0x4c90, 0x4c91, 0x4c92, 0x4c93, 0x4c94, 0x4c95, 0x4c96, 0x4c97,
+ 0x4c98, 0x4c99, 0x4c9a, 0x4c9b, 0x4c9c, 0x4c9d, 0x4c9e, 0x4c9f,
+ 0x4ca0, 0x4ca1, 0x4ca2, 0x4ca3, 0x4ca4, 0x4ca5, 0x4ca6, 0x4ca7,
+ 0x4ca8, 0x4ca9, 0x4caa, 0x4cab, 0x4cac, 0x4cad, 0x4cae, 0x4caf,
+ 0x4cb0, 0x4cb1, 0x4cb2, 0x4cb3, 0x4cb4, 0x4cb5, 0x4cb6, 0x4cb7,
+ 0x4cb8, 0x4cb9, 0x4cba, 0x4cbb, 0x4cbc, 0x4cbd, 0x4cbe, 0x4cbf,
+ 0x4cc0, 0x4cc1, 0x4cc2, 0x4cc3, 0x4cc4, 0x4cc5, 0x4cc6, 0x4cc7,
+ 0x4cc8, 0x4cc9, 0x4cca, 0x4ccb, 0x4ccc, 0x4ccd, 0x4cce, 0x4ccf,
+ 0x4cd0, 0x4cd1, 0x4cd2, 0x4cd3, 0x4cd4, 0x4cd5, 0x4cd6, 0x4cd7,
+ 0x4cd8, 0x4cd9, 0x4cda, 0x4cdb, 0x4cdc, 0x4cdd, 0x4cde, 0x4cdf,
+ 0x4ce0, 0x4ce1, 0x4ce2, 0x4ce3, 0x4ce4, 0x4ce5, 0x4ce6, 0x4ce7,
+ 0x4ce8, 0x4ce9, 0x4cea, 0x4ceb, 0x4cec, 0x4ced, 0x4cee, 0x4cef,
+ 0x4cf0, 0x4cf1, 0x4cf2, 0x4cf3, 0x4cf4, 0x4cf5, 0x4cf6, 0x4cf7,
+ 0x4cf8, 0x4cf9, 0x4cfa, 0x4cfb, 0x4cfc, 0x4cfd, 0x4cfe, 0x4cff,
+ 0x4d00, 0x4d01, 0x4d02, 0x4d03, 0x4d04, 0x4d05, 0x4d06, 0x4d07,
+ 0x4d08, 0x4d09, 0x4d0a, 0x4d0b, 0x4d0c, 0x4d0d, 0x4d0e, 0x4d0f,
+ 0x4d10, 0x4d11, 0x4d12, 0x4d13, 0x4d14, 0x4d15, 0x4d16, 0x4d17,
+ 0x4d18, 0x4d19, 0x4d1a, 0x4d1b, 0x4d1c, 0x4d1d, 0x4d1e, 0x4d1f,
+ 0x4d20, 0x4d21, 0x4d22, 0x4d23, 0x4d24, 0x4d25, 0x4d26, 0x4d27,
+ 0x4d28, 0x4d29, 0x4d2a, 0x4d2b, 0x4d2c, 0x4d2d, 0x4d2e, 0x4d2f,
+ 0x4d30, 0x4d31, 0x4d32, 0x4d33, 0x4d34, 0x4d35, 0x4d36, 0x4d37,
+ 0x4d38, 0x4d39, 0x4d3a, 0x4d3b, 0x4d3c, 0x4d3d, 0x4d3e, 0x4d3f,
+ 0x4d40, 0x4d41, 0x4d42, 0x4d43, 0x4d44, 0x4d45, 0x4d46, 0x4d47,
+ 0x4d48, 0x4d49, 0x4d4a, 0x4d4b, 0x4d4c, 0x4d4d, 0x4d4e, 0x4d4f,
+ 0x4d50, 0x4d51, 0x4d52, 0x4d53, 0x4d54, 0x4d55, 0x4d56, 0x4d57,
+ 0x4d58, 0x4d59, 0x4d5a, 0x4d5b, 0x4d5c, 0x4d5d, 0x4d5e, 0x4d5f,
+ 0x4d60, 0x4d61, 0x4d62, 0x4d63, 0x4d64, 0x4d65, 0x4d66, 0x4d67,
+ 0x4d68, 0x4d69, 0x4d6a, 0x4d6b, 0x4d6c, 0x4d6d, 0x4d6e, 0x4d6f,
+ 0x4d70, 0x4d71, 0x4d72, 0x4d73, 0x4d74, 0x4d75, 0x4d76, 0x4d77,
+ 0x4d78, 0x4d79, 0x4d7a, 0x4d7b, 0x4d7c, 0x4d7d, 0x4d7e, 0x4d7f,
+ 0x4d80, 0x4d81, 0x4d82, 0x4d83, 0x4d84, 0x4d85, 0x4d86, 0x4d87,
+ 0x4d88, 0x4d89, 0x4d8a, 0x4d8b, 0x4d8c, 0x4d8d, 0x4d8e, 0x4d8f,
+ 0x4d90, 0x4d91, 0x4d92, 0x4d93, 0x4d94, 0x4d95, 0x4d96, 0x4d97,
+ 0x4d98, 0x4d99, 0x4d9a, 0x4d9b, 0x4d9c, 0x4d9d, 0x4d9e, 0x4d9f,
+ 0x4da0, 0x4da1, 0x4da2, 0x4da3, 0x4da4, 0x4da5, 0x4da6, 0x4da7,
+ 0x4da8, 0x4da9, 0x4daa, 0x4dab, 0x4dac, 0x4dad, 0x4dae, 0x4daf,
+ 0x4db0, 0x4db1, 0x4db2, 0x4db3, 0x4db4, 0x4db5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x4dc0, 0x4dc1, 0x4dc2, 0x4dc3, 0x4dc4, 0x4dc5, 0x4dc6, 0x4dc7,
+ 0x4dc8, 0x4dc9, 0x4dca, 0x4dcb, 0x4dcc, 0x4dcd, 0x4dce, 0x4dcf,
+ 0x4dd0, 0x4dd1, 0x4dd2, 0x4dd3, 0x4dd4, 0x4dd5, 0x4dd6, 0x4dd7,
+ 0x4dd8, 0x4dd9, 0x4dda, 0x4ddb, 0x4ddc, 0x4ddd, 0x4dde, 0x4ddf,
+ 0x4de0, 0x4de1, 0x4de2, 0x4de3, 0x4de4, 0x4de5, 0x4de6, 0x4de7,
+ 0x4de8, 0x4de9, 0x4dea, 0x4deb, 0x4dec, 0x4ded, 0x4dee, 0x4def,
+ 0x4df0, 0x4df1, 0x4df2, 0x4df3, 0x4df4, 0x4df5, 0x4df6, 0x4df7,
+ 0x4df8, 0x4df9, 0x4dfa, 0x4dfb, 0x4dfc, 0x4dfd, 0x4dfe, 0x4dff,
+ 0x4e00, 0x4e01, 0x4e02, 0x4e03, 0x4e04, 0x4e05, 0x4e06, 0x4e07,
+ 0x4e08, 0x4e09, 0x4e0a, 0x4e0b, 0x4e0c, 0x4e0d, 0x4e0e, 0x4e0f,
+ 0x4e10, 0x4e11, 0x4e12, 0x4e13, 0x4e14, 0x4e15, 0x4e16, 0x4e17,
+ 0x4e18, 0x4e19, 0x4e1a, 0x4e1b, 0x4e1c, 0x4e1d, 0x4e1e, 0x4e1f,
+ 0x4e20, 0x4e21, 0x4e22, 0x4e23, 0x4e24, 0x4e25, 0x4e26, 0x4e27,
+ 0x4e28, 0x4e29, 0x4e2a, 0x4e2b, 0x4e2c, 0x4e2d, 0x4e2e, 0x4e2f,
+ 0x4e30, 0x4e31, 0x4e32, 0x4e33, 0x4e34, 0x4e35, 0x4e36, 0x4e37,
+ 0x4e38, 0x4e39, 0x4e3a, 0x4e3b, 0x4e3c, 0x4e3d, 0x4e3e, 0x4e3f,
+ 0x4e40, 0x4e41, 0x4e42, 0x4e43, 0x4e44, 0x4e45, 0x4e46, 0x4e47,
+ 0x4e48, 0x4e49, 0x4e4a, 0x4e4b, 0x4e4c, 0x4e4d, 0x4e4e, 0x4e4f,
+ 0x4e50, 0x4e51, 0x4e52, 0x4e53, 0x4e54, 0x4e55, 0x4e56, 0x4e57,
+ 0x4e58, 0x4e59, 0x4e5a, 0x4e5b, 0x4e5c, 0x4e5d, 0x4e5e, 0x4e5f,
+ 0x4e60, 0x4e61, 0x4e62, 0x4e63, 0x4e64, 0x4e65, 0x4e66, 0x4e67,
+ 0x4e68, 0x4e69, 0x4e6a, 0x4e6b, 0x4e6c, 0x4e6d, 0x4e6e, 0x4e6f,
+ 0x4e70, 0x4e71, 0x4e72, 0x4e73, 0x4e74, 0x4e75, 0x4e76, 0x4e77,
+ 0x4e78, 0x4e79, 0x4e7a, 0x4e7b, 0x4e7c, 0x4e7d, 0x4e7e, 0x4e7f,
+ 0x4e80, 0x4e81, 0x4e82, 0x4e83, 0x4e84, 0x4e85, 0x4e86, 0x4e87,
+ 0x4e88, 0x4e89, 0x4e8a, 0x4e8b, 0x4e8c, 0x4e8d, 0x4e8e, 0x4e8f,
+ 0x4e90, 0x4e91, 0x4e92, 0x4e93, 0x4e94, 0x4e95, 0x4e96, 0x4e97,
+ 0x4e98, 0x4e99, 0x4e9a, 0x4e9b, 0x4e9c, 0x4e9d, 0x4e9e, 0x4e9f,
+ 0x4ea0, 0x4ea1, 0x4ea2, 0x4ea3, 0x4ea4, 0x4ea5, 0x4ea6, 0x4ea7,
+ 0x4ea8, 0x4ea9, 0x4eaa, 0x4eab, 0x4eac, 0x4ead, 0x4eae, 0x4eaf,
+ 0x4eb0, 0x4eb1, 0x4eb2, 0x4eb3, 0x4eb4, 0x4eb5, 0x4eb6, 0x4eb7,
+ 0x4eb8, 0x4eb9, 0x4eba, 0x4ebb, 0x4ebc, 0x4ebd, 0x4ebe, 0x4ebf,
+ 0x4ec0, 0x4ec1, 0x4ec2, 0x4ec3, 0x4ec4, 0x4ec5, 0x4ec6, 0x4ec7,
+ 0x4ec8, 0x4ec9, 0x4eca, 0x4ecb, 0x4ecc, 0x4ecd, 0x4ece, 0x4ecf,
+ 0x4ed0, 0x4ed1, 0x4ed2, 0x4ed3, 0x4ed4, 0x4ed5, 0x4ed6, 0x4ed7,
+ 0x4ed8, 0x4ed9, 0x4eda, 0x4edb, 0x4edc, 0x4edd, 0x4ede, 0x4edf,
+ 0x4ee0, 0x4ee1, 0x4ee2, 0x4ee3, 0x4ee4, 0x4ee5, 0x4ee6, 0x4ee7,
+ 0x4ee8, 0x4ee9, 0x4eea, 0x4eeb, 0x4eec, 0x4eed, 0x4eee, 0x4eef,
+ 0x4ef0, 0x4ef1, 0x4ef2, 0x4ef3, 0x4ef4, 0x4ef5, 0x4ef6, 0x4ef7,
+ 0x4ef8, 0x4ef9, 0x4efa, 0x4efb, 0x4efc, 0x4efd, 0x4efe, 0x4eff,
+ 0x4f00, 0x4f01, 0x4f02, 0x4f03, 0x4f04, 0x4f05, 0x4f06, 0x4f07,
+ 0x4f08, 0x4f09, 0x4f0a, 0x4f0b, 0x4f0c, 0x4f0d, 0x4f0e, 0x4f0f,
+ 0x4f10, 0x4f11, 0x4f12, 0x4f13, 0x4f14, 0x4f15, 0x4f16, 0x4f17,
+ 0x4f18, 0x4f19, 0x4f1a, 0x4f1b, 0x4f1c, 0x4f1d, 0x4f1e, 0x4f1f,
+ 0x4f20, 0x4f21, 0x4f22, 0x4f23, 0x4f24, 0x4f25, 0x4f26, 0x4f27,
+ 0x4f28, 0x4f29, 0x4f2a, 0x4f2b, 0x4f2c, 0x4f2d, 0x4f2e, 0x4f2f,
+ 0x4f30, 0x4f31, 0x4f32, 0x4f33, 0x4f34, 0x4f35, 0x4f36, 0x4f37,
+ 0x4f38, 0x4f39, 0x4f3a, 0x4f3b, 0x4f3c, 0x4f3d, 0x4f3e, 0x4f3f,
+ 0x4f40, 0x4f41, 0x4f42, 0x4f43, 0x4f44, 0x4f45, 0x4f46, 0x4f47,
+ 0x4f48, 0x4f49, 0x4f4a, 0x4f4b, 0x4f4c, 0x4f4d, 0x4f4e, 0x4f4f,
+ 0x4f50, 0x4f51, 0x4f52, 0x4f53, 0x4f54, 0x4f55, 0x4f56, 0x4f57,
+ 0x4f58, 0x4f59, 0x4f5a, 0x4f5b, 0x4f5c, 0x4f5d, 0x4f5e, 0x4f5f,
+ 0x4f60, 0x4f61, 0x4f62, 0x4f63, 0x4f64, 0x4f65, 0x4f66, 0x4f67,
+ 0x4f68, 0x4f69, 0x4f6a, 0x4f6b, 0x4f6c, 0x4f6d, 0x4f6e, 0x4f6f,
+ 0x4f70, 0x4f71, 0x4f72, 0x4f73, 0x4f74, 0x4f75, 0x4f76, 0x4f77,
+ 0x4f78, 0x4f79, 0x4f7a, 0x4f7b, 0x4f7c, 0x4f7d, 0x4f7e, 0x4f7f,
+ 0x4f80, 0x4f81, 0x4f82, 0x4f83, 0x4f84, 0x4f85, 0x4f86, 0x4f87,
+ 0x4f88, 0x4f89, 0x4f8a, 0x4f8b, 0x4f8c, 0x4f8d, 0x4f8e, 0x4f8f,
+ 0x4f90, 0x4f91, 0x4f92, 0x4f93, 0x4f94, 0x4f95, 0x4f96, 0x4f97,
+ 0x4f98, 0x4f99, 0x4f9a, 0x4f9b, 0x4f9c, 0x4f9d, 0x4f9e, 0x4f9f,
+ 0x4fa0, 0x4fa1, 0x4fa2, 0x4fa3, 0x4fa4, 0x4fa5, 0x4fa6, 0x4fa7,
+ 0x4fa8, 0x4fa9, 0x4faa, 0x4fab, 0x4fac, 0x4fad, 0x4fae, 0x4faf,
+ 0x4fb0, 0x4fb1, 0x4fb2, 0x4fb3, 0x4fb4, 0x4fb5, 0x4fb6, 0x4fb7,
+ 0x4fb8, 0x4fb9, 0x4fba, 0x4fbb, 0x4fbc, 0x4fbd, 0x4fbe, 0x4fbf,
+ 0x4fc0, 0x4fc1, 0x4fc2, 0x4fc3, 0x4fc4, 0x4fc5, 0x4fc6, 0x4fc7,
+ 0x4fc8, 0x4fc9, 0x4fca, 0x4fcb, 0x4fcc, 0x4fcd, 0x4fce, 0x4fcf,
+ 0x4fd0, 0x4fd1, 0x4fd2, 0x4fd3, 0x4fd4, 0x4fd5, 0x4fd6, 0x4fd7,
+ 0x4fd8, 0x4fd9, 0x4fda, 0x4fdb, 0x4fdc, 0x4fdd, 0x4fde, 0x4fdf,
+ 0x4fe0, 0x4fe1, 0x4fe2, 0x4fe3, 0x4fe4, 0x4fe5, 0x4fe6, 0x4fe7,
+ 0x4fe8, 0x4fe9, 0x4fea, 0x4feb, 0x4fec, 0x4fed, 0x4fee, 0x4fef,
+ 0x4ff0, 0x4ff1, 0x4ff2, 0x4ff3, 0x4ff4, 0x4ff5, 0x4ff6, 0x4ff7,
+ 0x4ff8, 0x4ff9, 0x4ffa, 0x4ffb, 0x4ffc, 0x4ffd, 0x4ffe, 0x4fff,
+ 0x5000, 0x5001, 0x5002, 0x5003, 0x5004, 0x5005, 0x5006, 0x5007,
+ 0x5008, 0x5009, 0x500a, 0x500b, 0x500c, 0x500d, 0x500e, 0x500f,
+ 0x5010, 0x5011, 0x5012, 0x5013, 0x5014, 0x5015, 0x5016, 0x5017,
+ 0x5018, 0x5019, 0x501a, 0x501b, 0x501c, 0x501d, 0x501e, 0x501f,
+ 0x5020, 0x5021, 0x5022, 0x5023, 0x5024, 0x5025, 0x5026, 0x5027,
+ 0x5028, 0x5029, 0x502a, 0x502b, 0x502c, 0x502d, 0x502e, 0x502f,
+ 0x5030, 0x5031, 0x5032, 0x5033, 0x5034, 0x5035, 0x5036, 0x5037,
+ 0x5038, 0x5039, 0x503a, 0x503b, 0x503c, 0x503d, 0x503e, 0x503f,
+ 0x5040, 0x5041, 0x5042, 0x5043, 0x5044, 0x5045, 0x5046, 0x5047,
+ 0x5048, 0x5049, 0x504a, 0x504b, 0x504c, 0x504d, 0x504e, 0x504f,
+ 0x5050, 0x5051, 0x5052, 0x5053, 0x5054, 0x5055, 0x5056, 0x5057,
+ 0x5058, 0x5059, 0x505a, 0x505b, 0x505c, 0x505d, 0x505e, 0x505f,
+ 0x5060, 0x5061, 0x5062, 0x5063, 0x5064, 0x5065, 0x5066, 0x5067,
+ 0x5068, 0x5069, 0x506a, 0x506b, 0x506c, 0x506d, 0x506e, 0x506f,
+ 0x5070, 0x5071, 0x5072, 0x5073, 0x5074, 0x5075, 0x5076, 0x5077,
+ 0x5078, 0x5079, 0x507a, 0x507b, 0x507c, 0x507d, 0x507e, 0x507f,
+ 0x5080, 0x5081, 0x5082, 0x5083, 0x5084, 0x5085, 0x5086, 0x5087,
+ 0x5088, 0x5089, 0x508a, 0x508b, 0x508c, 0x508d, 0x508e, 0x508f,
+ 0x5090, 0x5091, 0x5092, 0x5093, 0x5094, 0x5095, 0x5096, 0x5097,
+ 0x5098, 0x5099, 0x509a, 0x509b, 0x509c, 0x509d, 0x509e, 0x509f,
+ 0x50a0, 0x50a1, 0x50a2, 0x50a3, 0x50a4, 0x50a5, 0x50a6, 0x50a7,
+ 0x50a8, 0x50a9, 0x50aa, 0x50ab, 0x50ac, 0x50ad, 0x50ae, 0x50af,
+ 0x50b0, 0x50b1, 0x50b2, 0x50b3, 0x50b4, 0x50b5, 0x50b6, 0x50b7,
+ 0x50b8, 0x50b9, 0x50ba, 0x50bb, 0x50bc, 0x50bd, 0x50be, 0x50bf,
+ 0x50c0, 0x50c1, 0x50c2, 0x50c3, 0x50c4, 0x50c5, 0x50c6, 0x50c7,
+ 0x50c8, 0x50c9, 0x50ca, 0x50cb, 0x50cc, 0x50cd, 0x50ce, 0x50cf,
+ 0x50d0, 0x50d1, 0x50d2, 0x50d3, 0x50d4, 0x50d5, 0x50d6, 0x50d7,
+ 0x50d8, 0x50d9, 0x50da, 0x50db, 0x50dc, 0x50dd, 0x50de, 0x50df,
+ 0x50e0, 0x50e1, 0x50e2, 0x50e3, 0x50e4, 0x50e5, 0x50e6, 0x50e7,
+ 0x50e8, 0x50e9, 0x50ea, 0x50eb, 0x50ec, 0x50ed, 0x50ee, 0x50ef,
+ 0x50f0, 0x50f1, 0x50f2, 0x50f3, 0x50f4, 0x50f5, 0x50f6, 0x50f7,
+ 0x50f8, 0x50f9, 0x50fa, 0x50fb, 0x50fc, 0x50fd, 0x50fe, 0x50ff,
+ 0x5100, 0x5101, 0x5102, 0x5103, 0x5104, 0x5105, 0x5106, 0x5107,
+ 0x5108, 0x5109, 0x510a, 0x510b, 0x510c, 0x510d, 0x510e, 0x510f,
+ 0x5110, 0x5111, 0x5112, 0x5113, 0x5114, 0x5115, 0x5116, 0x5117,
+ 0x5118, 0x5119, 0x511a, 0x511b, 0x511c, 0x511d, 0x511e, 0x511f,
+ 0x5120, 0x5121, 0x5122, 0x5123, 0x5124, 0x5125, 0x5126, 0x5127,
+ 0x5128, 0x5129, 0x512a, 0x512b, 0x512c, 0x512d, 0x512e, 0x512f,
+ 0x5130, 0x5131, 0x5132, 0x5133, 0x5134, 0x5135, 0x5136, 0x5137,
+ 0x5138, 0x5139, 0x513a, 0x513b, 0x513c, 0x513d, 0x513e, 0x513f,
+ 0x5140, 0x5141, 0x5142, 0x5143, 0x5144, 0x5145, 0x5146, 0x5147,
+ 0x5148, 0x5149, 0x514a, 0x514b, 0x514c, 0x514d, 0x514e, 0x514f,
+ 0x5150, 0x5151, 0x5152, 0x5153, 0x5154, 0x5155, 0x5156, 0x5157,
+ 0x5158, 0x5159, 0x515a, 0x515b, 0x515c, 0x515d, 0x515e, 0x515f,
+ 0x5160, 0x5161, 0x5162, 0x5163, 0x5164, 0x5165, 0x5166, 0x5167,
+ 0x5168, 0x5169, 0x516a, 0x516b, 0x516c, 0x516d, 0x516e, 0x516f,
+ 0x5170, 0x5171, 0x5172, 0x5173, 0x5174, 0x5175, 0x5176, 0x5177,
+ 0x5178, 0x5179, 0x517a, 0x517b, 0x517c, 0x517d, 0x517e, 0x517f,
+ 0x5180, 0x5181, 0x5182, 0x5183, 0x5184, 0x5185, 0x5186, 0x5187,
+ 0x5188, 0x5189, 0x518a, 0x518b, 0x518c, 0x518d, 0x518e, 0x518f,
+ 0x5190, 0x5191, 0x5192, 0x5193, 0x5194, 0x5195, 0x5196, 0x5197,
+ 0x5198, 0x5199, 0x519a, 0x519b, 0x519c, 0x519d, 0x519e, 0x519f,
+ 0x51a0, 0x51a1, 0x51a2, 0x51a3, 0x51a4, 0x51a5, 0x51a6, 0x51a7,
+ 0x51a8, 0x51a9, 0x51aa, 0x51ab, 0x51ac, 0x51ad, 0x51ae, 0x51af,
+ 0x51b0, 0x51b1, 0x51b2, 0x51b3, 0x51b4, 0x51b5, 0x51b6, 0x51b7,
+ 0x51b8, 0x51b9, 0x51ba, 0x51bb, 0x51bc, 0x51bd, 0x51be, 0x51bf,
+ 0x51c0, 0x51c1, 0x51c2, 0x51c3, 0x51c4, 0x51c5, 0x51c6, 0x51c7,
+ 0x51c8, 0x51c9, 0x51ca, 0x51cb, 0x51cc, 0x51cd, 0x51ce, 0x51cf,
+ 0x51d0, 0x51d1, 0x51d2, 0x51d3, 0x51d4, 0x51d5, 0x51d6, 0x51d7,
+ 0x51d8, 0x51d9, 0x51da, 0x51db, 0x51dc, 0x51dd, 0x51de, 0x51df,
+ 0x51e0, 0x51e1, 0x51e2, 0x51e3, 0x51e4, 0x51e5, 0x51e6, 0x51e7,
+ 0x51e8, 0x51e9, 0x51ea, 0x51eb, 0x51ec, 0x51ed, 0x51ee, 0x51ef,
+ 0x51f0, 0x51f1, 0x51f2, 0x51f3, 0x51f4, 0x51f5, 0x51f6, 0x51f7,
+ 0x51f8, 0x51f9, 0x51fa, 0x51fb, 0x51fc, 0x51fd, 0x51fe, 0x51ff,
+ 0x5200, 0x5201, 0x5202, 0x5203, 0x5204, 0x5205, 0x5206, 0x5207,
+ 0x5208, 0x5209, 0x520a, 0x520b, 0x520c, 0x520d, 0x520e, 0x520f,
+ 0x5210, 0x5211, 0x5212, 0x5213, 0x5214, 0x5215, 0x5216, 0x5217,
+ 0x5218, 0x5219, 0x521a, 0x521b, 0x521c, 0x521d, 0x521e, 0x521f,
+ 0x5220, 0x5221, 0x5222, 0x5223, 0x5224, 0x5225, 0x5226, 0x5227,
+ 0x5228, 0x5229, 0x522a, 0x522b, 0x522c, 0x522d, 0x522e, 0x522f,
+ 0x5230, 0x5231, 0x5232, 0x5233, 0x5234, 0x5235, 0x5236, 0x5237,
+ 0x5238, 0x5239, 0x523a, 0x523b, 0x523c, 0x523d, 0x523e, 0x523f,
+ 0x5240, 0x5241, 0x5242, 0x5243, 0x5244, 0x5245, 0x5246, 0x5247,
+ 0x5248, 0x5249, 0x524a, 0x524b, 0x524c, 0x524d, 0x524e, 0x524f,
+ 0x5250, 0x5251, 0x5252, 0x5253, 0x5254, 0x5255, 0x5256, 0x5257,
+ 0x5258, 0x5259, 0x525a, 0x525b, 0x525c, 0x525d, 0x525e, 0x525f,
+ 0x5260, 0x5261, 0x5262, 0x5263, 0x5264, 0x5265, 0x5266, 0x5267,
+ 0x5268, 0x5269, 0x526a, 0x526b, 0x526c, 0x526d, 0x526e, 0x526f,
+ 0x5270, 0x5271, 0x5272, 0x5273, 0x5274, 0x5275, 0x5276, 0x5277,
+ 0x5278, 0x5279, 0x527a, 0x527b, 0x527c, 0x527d, 0x527e, 0x527f,
+ 0x5280, 0x5281, 0x5282, 0x5283, 0x5284, 0x5285, 0x5286, 0x5287,
+ 0x5288, 0x5289, 0x528a, 0x528b, 0x528c, 0x528d, 0x528e, 0x528f,
+ 0x5290, 0x5291, 0x5292, 0x5293, 0x5294, 0x5295, 0x5296, 0x5297,
+ 0x5298, 0x5299, 0x529a, 0x529b, 0x529c, 0x529d, 0x529e, 0x529f,
+ 0x52a0, 0x52a1, 0x52a2, 0x52a3, 0x52a4, 0x52a5, 0x52a6, 0x52a7,
+ 0x52a8, 0x52a9, 0x52aa, 0x52ab, 0x52ac, 0x52ad, 0x52ae, 0x52af,
+ 0x52b0, 0x52b1, 0x52b2, 0x52b3, 0x52b4, 0x52b5, 0x52b6, 0x52b7,
+ 0x52b8, 0x52b9, 0x52ba, 0x52bb, 0x52bc, 0x52bd, 0x52be, 0x52bf,
+ 0x52c0, 0x52c1, 0x52c2, 0x52c3, 0x52c4, 0x52c5, 0x52c6, 0x52c7,
+ 0x52c8, 0x52c9, 0x52ca, 0x52cb, 0x52cc, 0x52cd, 0x52ce, 0x52cf,
+ 0x52d0, 0x52d1, 0x52d2, 0x52d3, 0x52d4, 0x52d5, 0x52d6, 0x52d7,
+ 0x52d8, 0x52d9, 0x52da, 0x52db, 0x52dc, 0x52dd, 0x52de, 0x52df,
+ 0x52e0, 0x52e1, 0x52e2, 0x52e3, 0x52e4, 0x52e5, 0x52e6, 0x52e7,
+ 0x52e8, 0x52e9, 0x52ea, 0x52eb, 0x52ec, 0x52ed, 0x52ee, 0x52ef,
+ 0x52f0, 0x52f1, 0x52f2, 0x52f3, 0x52f4, 0x52f5, 0x52f6, 0x52f7,
+ 0x52f8, 0x52f9, 0x52fa, 0x52fb, 0x52fc, 0x52fd, 0x52fe, 0x52ff,
+ 0x5300, 0x5301, 0x5302, 0x5303, 0x5304, 0x5305, 0x5306, 0x5307,
+ 0x5308, 0x5309, 0x530a, 0x530b, 0x530c, 0x530d, 0x530e, 0x530f,
+ 0x5310, 0x5311, 0x5312, 0x5313, 0x5314, 0x5315, 0x5316, 0x5317,
+ 0x5318, 0x5319, 0x531a, 0x531b, 0x531c, 0x531d, 0x531e, 0x531f,
+ 0x5320, 0x5321, 0x5322, 0x5323, 0x5324, 0x5325, 0x5326, 0x5327,
+ 0x5328, 0x5329, 0x532a, 0x532b, 0x532c, 0x532d, 0x532e, 0x532f,
+ 0x5330, 0x5331, 0x5332, 0x5333, 0x5334, 0x5335, 0x5336, 0x5337,
+ 0x5338, 0x5339, 0x533a, 0x533b, 0x533c, 0x533d, 0x533e, 0x533f,
+ 0x5340, 0x5341, 0x5342, 0x5343, 0x5344, 0x5345, 0x5346, 0x5347,
+ 0x5348, 0x5349, 0x534a, 0x534b, 0x534c, 0x534d, 0x534e, 0x534f,
+ 0x5350, 0x5351, 0x5352, 0x5353, 0x5354, 0x5355, 0x5356, 0x5357,
+ 0x5358, 0x5359, 0x535a, 0x535b, 0x535c, 0x535d, 0x535e, 0x535f,
+ 0x5360, 0x5361, 0x5362, 0x5363, 0x5364, 0x5365, 0x5366, 0x5367,
+ 0x5368, 0x5369, 0x536a, 0x536b, 0x536c, 0x536d, 0x536e, 0x536f,
+ 0x5370, 0x5371, 0x5372, 0x5373, 0x5374, 0x5375, 0x5376, 0x5377,
+ 0x5378, 0x5379, 0x537a, 0x537b, 0x537c, 0x537d, 0x537e, 0x537f,
+ 0x5380, 0x5381, 0x5382, 0x5383, 0x5384, 0x5385, 0x5386, 0x5387,
+ 0x5388, 0x5389, 0x538a, 0x538b, 0x538c, 0x538d, 0x538e, 0x538f,
+ 0x5390, 0x5391, 0x5392, 0x5393, 0x5394, 0x5395, 0x5396, 0x5397,
+ 0x5398, 0x5399, 0x539a, 0x539b, 0x539c, 0x539d, 0x539e, 0x539f,
+ 0x53a0, 0x53a1, 0x53a2, 0x53a3, 0x53a4, 0x53a5, 0x53a6, 0x53a7,
+ 0x53a8, 0x53a9, 0x53aa, 0x53ab, 0x53ac, 0x53ad, 0x53ae, 0x53af,
+ 0x53b0, 0x53b1, 0x53b2, 0x53b3, 0x53b4, 0x53b5, 0x53b6, 0x53b7,
+ 0x53b8, 0x53b9, 0x53ba, 0x53bb, 0x53bc, 0x53bd, 0x53be, 0x53bf,
+ 0x53c0, 0x53c1, 0x53c2, 0x53c3, 0x53c4, 0x53c5, 0x53c6, 0x53c7,
+ 0x53c8, 0x53c9, 0x53ca, 0x53cb, 0x53cc, 0x53cd, 0x53ce, 0x53cf,
+ 0x53d0, 0x53d1, 0x53d2, 0x53d3, 0x53d4, 0x53d5, 0x53d6, 0x53d7,
+ 0x53d8, 0x53d9, 0x53da, 0x53db, 0x53dc, 0x53dd, 0x53de, 0x53df,
+ 0x53e0, 0x53e1, 0x53e2, 0x53e3, 0x53e4, 0x53e5, 0x53e6, 0x53e7,
+ 0x53e8, 0x53e9, 0x53ea, 0x53eb, 0x53ec, 0x53ed, 0x53ee, 0x53ef,
+ 0x53f0, 0x53f1, 0x53f2, 0x53f3, 0x53f4, 0x53f5, 0x53f6, 0x53f7,
+ 0x53f8, 0x53f9, 0x53fa, 0x53fb, 0x53fc, 0x53fd, 0x53fe, 0x53ff,
+ 0x5400, 0x5401, 0x5402, 0x5403, 0x5404, 0x5405, 0x5406, 0x5407,
+ 0x5408, 0x5409, 0x540a, 0x540b, 0x540c, 0x540d, 0x540e, 0x540f,
+ 0x5410, 0x5411, 0x5412, 0x5413, 0x5414, 0x5415, 0x5416, 0x5417,
+ 0x5418, 0x5419, 0x541a, 0x541b, 0x541c, 0x541d, 0x541e, 0x541f,
+ 0x5420, 0x5421, 0x5422, 0x5423, 0x5424, 0x5425, 0x5426, 0x5427,
+ 0x5428, 0x5429, 0x542a, 0x542b, 0x542c, 0x542d, 0x542e, 0x542f,
+ 0x5430, 0x5431, 0x5432, 0x5433, 0x5434, 0x5435, 0x5436, 0x5437,
+ 0x5438, 0x5439, 0x543a, 0x543b, 0x543c, 0x543d, 0x543e, 0x543f,
+ 0x5440, 0x5441, 0x5442, 0x5443, 0x5444, 0x5445, 0x5446, 0x5447,
+ 0x5448, 0x5449, 0x544a, 0x544b, 0x544c, 0x544d, 0x544e, 0x544f,
+ 0x5450, 0x5451, 0x5452, 0x5453, 0x5454, 0x5455, 0x5456, 0x5457,
+ 0x5458, 0x5459, 0x545a, 0x545b, 0x545c, 0x545d, 0x545e, 0x545f,
+ 0x5460, 0x5461, 0x5462, 0x5463, 0x5464, 0x5465, 0x5466, 0x5467,
+ 0x5468, 0x5469, 0x546a, 0x546b, 0x546c, 0x546d, 0x546e, 0x546f,
+ 0x5470, 0x5471, 0x5472, 0x5473, 0x5474, 0x5475, 0x5476, 0x5477,
+ 0x5478, 0x5479, 0x547a, 0x547b, 0x547c, 0x547d, 0x547e, 0x547f,
+ 0x5480, 0x5481, 0x5482, 0x5483, 0x5484, 0x5485, 0x5486, 0x5487,
+ 0x5488, 0x5489, 0x548a, 0x548b, 0x548c, 0x548d, 0x548e, 0x548f,
+ 0x5490, 0x5491, 0x5492, 0x5493, 0x5494, 0x5495, 0x5496, 0x5497,
+ 0x5498, 0x5499, 0x549a, 0x549b, 0x549c, 0x549d, 0x549e, 0x549f,
+ 0x54a0, 0x54a1, 0x54a2, 0x54a3, 0x54a4, 0x54a5, 0x54a6, 0x54a7,
+ 0x54a8, 0x54a9, 0x54aa, 0x54ab, 0x54ac, 0x54ad, 0x54ae, 0x54af,
+ 0x54b0, 0x54b1, 0x54b2, 0x54b3, 0x54b4, 0x54b5, 0x54b6, 0x54b7,
+ 0x54b8, 0x54b9, 0x54ba, 0x54bb, 0x54bc, 0x54bd, 0x54be, 0x54bf,
+ 0x54c0, 0x54c1, 0x54c2, 0x54c3, 0x54c4, 0x54c5, 0x54c6, 0x54c7,
+ 0x54c8, 0x54c9, 0x54ca, 0x54cb, 0x54cc, 0x54cd, 0x54ce, 0x54cf,
+ 0x54d0, 0x54d1, 0x54d2, 0x54d3, 0x54d4, 0x54d5, 0x54d6, 0x54d7,
+ 0x54d8, 0x54d9, 0x54da, 0x54db, 0x54dc, 0x54dd, 0x54de, 0x54df,
+ 0x54e0, 0x54e1, 0x54e2, 0x54e3, 0x54e4, 0x54e5, 0x54e6, 0x54e7,
+ 0x54e8, 0x54e9, 0x54ea, 0x54eb, 0x54ec, 0x54ed, 0x54ee, 0x54ef,
+ 0x54f0, 0x54f1, 0x54f2, 0x54f3, 0x54f4, 0x54f5, 0x54f6, 0x54f7,
+ 0x54f8, 0x54f9, 0x54fa, 0x54fb, 0x54fc, 0x54fd, 0x54fe, 0x54ff,
+ 0x5500, 0x5501, 0x5502, 0x5503, 0x5504, 0x5505, 0x5506, 0x5507,
+ 0x5508, 0x5509, 0x550a, 0x550b, 0x550c, 0x550d, 0x550e, 0x550f,
+ 0x5510, 0x5511, 0x5512, 0x5513, 0x5514, 0x5515, 0x5516, 0x5517,
+ 0x5518, 0x5519, 0x551a, 0x551b, 0x551c, 0x551d, 0x551e, 0x551f,
+ 0x5520, 0x5521, 0x5522, 0x5523, 0x5524, 0x5525, 0x5526, 0x5527,
+ 0x5528, 0x5529, 0x552a, 0x552b, 0x552c, 0x552d, 0x552e, 0x552f,
+ 0x5530, 0x5531, 0x5532, 0x5533, 0x5534, 0x5535, 0x5536, 0x5537,
+ 0x5538, 0x5539, 0x553a, 0x553b, 0x553c, 0x553d, 0x553e, 0x553f,
+ 0x5540, 0x5541, 0x5542, 0x5543, 0x5544, 0x5545, 0x5546, 0x5547,
+ 0x5548, 0x5549, 0x554a, 0x554b, 0x554c, 0x554d, 0x554e, 0x554f,
+ 0x5550, 0x5551, 0x5552, 0x5553, 0x5554, 0x5555, 0x5556, 0x5557,
+ 0x5558, 0x5559, 0x555a, 0x555b, 0x555c, 0x555d, 0x555e, 0x555f,
+ 0x5560, 0x5561, 0x5562, 0x5563, 0x5564, 0x5565, 0x5566, 0x5567,
+ 0x5568, 0x5569, 0x556a, 0x556b, 0x556c, 0x556d, 0x556e, 0x556f,
+ 0x5570, 0x5571, 0x5572, 0x5573, 0x5574, 0x5575, 0x5576, 0x5577,
+ 0x5578, 0x5579, 0x557a, 0x557b, 0x557c, 0x557d, 0x557e, 0x557f,
+ 0x5580, 0x5581, 0x5582, 0x5583, 0x5584, 0x5585, 0x5586, 0x5587,
+ 0x5588, 0x5589, 0x558a, 0x558b, 0x558c, 0x558d, 0x558e, 0x558f,
+ 0x5590, 0x5591, 0x5592, 0x5593, 0x5594, 0x5595, 0x5596, 0x5597,
+ 0x5598, 0x5599, 0x559a, 0x559b, 0x559c, 0x559d, 0x559e, 0x559f,
+ 0x55a0, 0x55a1, 0x55a2, 0x55a3, 0x55a4, 0x55a5, 0x55a6, 0x55a7,
+ 0x55a8, 0x55a9, 0x55aa, 0x55ab, 0x55ac, 0x55ad, 0x55ae, 0x55af,
+ 0x55b0, 0x55b1, 0x55b2, 0x55b3, 0x55b4, 0x55b5, 0x55b6, 0x55b7,
+ 0x55b8, 0x55b9, 0x55ba, 0x55bb, 0x55bc, 0x55bd, 0x55be, 0x55bf,
+ 0x55c0, 0x55c1, 0x55c2, 0x55c3, 0x55c4, 0x55c5, 0x55c6, 0x55c7,
+ 0x55c8, 0x55c9, 0x55ca, 0x55cb, 0x55cc, 0x55cd, 0x55ce, 0x55cf,
+ 0x55d0, 0x55d1, 0x55d2, 0x55d3, 0x55d4, 0x55d5, 0x55d6, 0x55d7,
+ 0x55d8, 0x55d9, 0x55da, 0x55db, 0x55dc, 0x55dd, 0x55de, 0x55df,
+ 0x55e0, 0x55e1, 0x55e2, 0x55e3, 0x55e4, 0x55e5, 0x55e6, 0x55e7,
+ 0x55e8, 0x55e9, 0x55ea, 0x55eb, 0x55ec, 0x55ed, 0x55ee, 0x55ef,
+ 0x55f0, 0x55f1, 0x55f2, 0x55f3, 0x55f4, 0x55f5, 0x55f6, 0x55f7,
+ 0x55f8, 0x55f9, 0x55fa, 0x55fb, 0x55fc, 0x55fd, 0x55fe, 0x55ff,
+ 0x5600, 0x5601, 0x5602, 0x5603, 0x5604, 0x5605, 0x5606, 0x5607,
+ 0x5608, 0x5609, 0x560a, 0x560b, 0x560c, 0x560d, 0x560e, 0x560f,
+ 0x5610, 0x5611, 0x5612, 0x5613, 0x5614, 0x5615, 0x5616, 0x5617,
+ 0x5618, 0x5619, 0x561a, 0x561b, 0x561c, 0x561d, 0x561e, 0x561f,
+ 0x5620, 0x5621, 0x5622, 0x5623, 0x5624, 0x5625, 0x5626, 0x5627,
+ 0x5628, 0x5629, 0x562a, 0x562b, 0x562c, 0x562d, 0x562e, 0x562f,
+ 0x5630, 0x5631, 0x5632, 0x5633, 0x5634, 0x5635, 0x5636, 0x5637,
+ 0x5638, 0x5639, 0x563a, 0x563b, 0x563c, 0x563d, 0x563e, 0x563f,
+ 0x5640, 0x5641, 0x5642, 0x5643, 0x5644, 0x5645, 0x5646, 0x5647,
+ 0x5648, 0x5649, 0x564a, 0x564b, 0x564c, 0x564d, 0x564e, 0x564f,
+ 0x5650, 0x5651, 0x5652, 0x5653, 0x5654, 0x5655, 0x5656, 0x5657,
+ 0x5658, 0x5659, 0x565a, 0x565b, 0x565c, 0x565d, 0x565e, 0x565f,
+ 0x5660, 0x5661, 0x5662, 0x5663, 0x5664, 0x5665, 0x5666, 0x5667,
+ 0x5668, 0x5669, 0x566a, 0x566b, 0x566c, 0x566d, 0x566e, 0x566f,
+ 0x5670, 0x5671, 0x5672, 0x5673, 0x5674, 0x5675, 0x5676, 0x5677,
+ 0x5678, 0x5679, 0x567a, 0x567b, 0x567c, 0x567d, 0x567e, 0x567f,
+ 0x5680, 0x5681, 0x5682, 0x5683, 0x5684, 0x5685, 0x5686, 0x5687,
+ 0x5688, 0x5689, 0x568a, 0x568b, 0x568c, 0x568d, 0x568e, 0x568f,
+ 0x5690, 0x5691, 0x5692, 0x5693, 0x5694, 0x5695, 0x5696, 0x5697,
+ 0x5698, 0x5699, 0x569a, 0x569b, 0x569c, 0x569d, 0x569e, 0x569f,
+ 0x56a0, 0x56a1, 0x56a2, 0x56a3, 0x56a4, 0x56a5, 0x56a6, 0x56a7,
+ 0x56a8, 0x56a9, 0x56aa, 0x56ab, 0x56ac, 0x56ad, 0x56ae, 0x56af,
+ 0x56b0, 0x56b1, 0x56b2, 0x56b3, 0x56b4, 0x56b5, 0x56b6, 0x56b7,
+ 0x56b8, 0x56b9, 0x56ba, 0x56bb, 0x56bc, 0x56bd, 0x56be, 0x56bf,
+ 0x56c0, 0x56c1, 0x56c2, 0x56c3, 0x56c4, 0x56c5, 0x56c6, 0x56c7,
+ 0x56c8, 0x56c9, 0x56ca, 0x56cb, 0x56cc, 0x56cd, 0x56ce, 0x56cf,
+ 0x56d0, 0x56d1, 0x56d2, 0x56d3, 0x56d4, 0x56d5, 0x56d6, 0x56d7,
+ 0x56d8, 0x56d9, 0x56da, 0x56db, 0x56dc, 0x56dd, 0x56de, 0x56df,
+ 0x56e0, 0x56e1, 0x56e2, 0x56e3, 0x56e4, 0x56e5, 0x56e6, 0x56e7,
+ 0x56e8, 0x56e9, 0x56ea, 0x56eb, 0x56ec, 0x56ed, 0x56ee, 0x56ef,
+ 0x56f0, 0x56f1, 0x56f2, 0x56f3, 0x56f4, 0x56f5, 0x56f6, 0x56f7,
+ 0x56f8, 0x56f9, 0x56fa, 0x56fb, 0x56fc, 0x56fd, 0x56fe, 0x56ff,
+ 0x5700, 0x5701, 0x5702, 0x5703, 0x5704, 0x5705, 0x5706, 0x5707,
+ 0x5708, 0x5709, 0x570a, 0x570b, 0x570c, 0x570d, 0x570e, 0x570f,
+ 0x5710, 0x5711, 0x5712, 0x5713, 0x5714, 0x5715, 0x5716, 0x5717,
+ 0x5718, 0x5719, 0x571a, 0x571b, 0x571c, 0x571d, 0x571e, 0x571f,
+ 0x5720, 0x5721, 0x5722, 0x5723, 0x5724, 0x5725, 0x5726, 0x5727,
+ 0x5728, 0x5729, 0x572a, 0x572b, 0x572c, 0x572d, 0x572e, 0x572f,
+ 0x5730, 0x5731, 0x5732, 0x5733, 0x5734, 0x5735, 0x5736, 0x5737,
+ 0x5738, 0x5739, 0x573a, 0x573b, 0x573c, 0x573d, 0x573e, 0x573f,
+ 0x5740, 0x5741, 0x5742, 0x5743, 0x5744, 0x5745, 0x5746, 0x5747,
+ 0x5748, 0x5749, 0x574a, 0x574b, 0x574c, 0x574d, 0x574e, 0x574f,
+ 0x5750, 0x5751, 0x5752, 0x5753, 0x5754, 0x5755, 0x5756, 0x5757,
+ 0x5758, 0x5759, 0x575a, 0x575b, 0x575c, 0x575d, 0x575e, 0x575f,
+ 0x5760, 0x5761, 0x5762, 0x5763, 0x5764, 0x5765, 0x5766, 0x5767,
+ 0x5768, 0x5769, 0x576a, 0x576b, 0x576c, 0x576d, 0x576e, 0x576f,
+ 0x5770, 0x5771, 0x5772, 0x5773, 0x5774, 0x5775, 0x5776, 0x5777,
+ 0x5778, 0x5779, 0x577a, 0x577b, 0x577c, 0x577d, 0x577e, 0x577f,
+ 0x5780, 0x5781, 0x5782, 0x5783, 0x5784, 0x5785, 0x5786, 0x5787,
+ 0x5788, 0x5789, 0x578a, 0x578b, 0x578c, 0x578d, 0x578e, 0x578f,
+ 0x5790, 0x5791, 0x5792, 0x5793, 0x5794, 0x5795, 0x5796, 0x5797,
+ 0x5798, 0x5799, 0x579a, 0x579b, 0x579c, 0x579d, 0x579e, 0x579f,
+ 0x57a0, 0x57a1, 0x57a2, 0x57a3, 0x57a4, 0x57a5, 0x57a6, 0x57a7,
+ 0x57a8, 0x57a9, 0x57aa, 0x57ab, 0x57ac, 0x57ad, 0x57ae, 0x57af,
+ 0x57b0, 0x57b1, 0x57b2, 0x57b3, 0x57b4, 0x57b5, 0x57b6, 0x57b7,
+ 0x57b8, 0x57b9, 0x57ba, 0x57bb, 0x57bc, 0x57bd, 0x57be, 0x57bf,
+ 0x57c0, 0x57c1, 0x57c2, 0x57c3, 0x57c4, 0x57c5, 0x57c6, 0x57c7,
+ 0x57c8, 0x57c9, 0x57ca, 0x57cb, 0x57cc, 0x57cd, 0x57ce, 0x57cf,
+ 0x57d0, 0x57d1, 0x57d2, 0x57d3, 0x57d4, 0x57d5, 0x57d6, 0x57d7,
+ 0x57d8, 0x57d9, 0x57da, 0x57db, 0x57dc, 0x57dd, 0x57de, 0x57df,
+ 0x57e0, 0x57e1, 0x57e2, 0x57e3, 0x57e4, 0x57e5, 0x57e6, 0x57e7,
+ 0x57e8, 0x57e9, 0x57ea, 0x57eb, 0x57ec, 0x57ed, 0x57ee, 0x57ef,
+ 0x57f0, 0x57f1, 0x57f2, 0x57f3, 0x57f4, 0x57f5, 0x57f6, 0x57f7,
+ 0x57f8, 0x57f9, 0x57fa, 0x57fb, 0x57fc, 0x57fd, 0x57fe, 0x57ff,
+ 0x5800, 0x5801, 0x5802, 0x5803, 0x5804, 0x5805, 0x5806, 0x5807,
+ 0x5808, 0x5809, 0x580a, 0x580b, 0x580c, 0x580d, 0x580e, 0x580f,
+ 0x5810, 0x5811, 0x5812, 0x5813, 0x5814, 0x5815, 0x5816, 0x5817,
+ 0x5818, 0x5819, 0x581a, 0x581b, 0x581c, 0x581d, 0x581e, 0x581f,
+ 0x5820, 0x5821, 0x5822, 0x5823, 0x5824, 0x5825, 0x5826, 0x5827,
+ 0x5828, 0x5829, 0x582a, 0x582b, 0x582c, 0x582d, 0x582e, 0x582f,
+ 0x5830, 0x5831, 0x5832, 0x5833, 0x5834, 0x5835, 0x5836, 0x5837,
+ 0x5838, 0x5839, 0x583a, 0x583b, 0x583c, 0x583d, 0x583e, 0x583f,
+ 0x5840, 0x5841, 0x5842, 0x5843, 0x5844, 0x5845, 0x5846, 0x5847,
+ 0x5848, 0x5849, 0x584a, 0x584b, 0x584c, 0x584d, 0x584e, 0x584f,
+ 0x5850, 0x5851, 0x5852, 0x5853, 0x5854, 0x5855, 0x5856, 0x5857,
+ 0x5858, 0x5859, 0x585a, 0x585b, 0x585c, 0x585d, 0x585e, 0x585f,
+ 0x5860, 0x5861, 0x5862, 0x5863, 0x5864, 0x5865, 0x5866, 0x5867,
+ 0x5868, 0x5869, 0x586a, 0x586b, 0x586c, 0x586d, 0x586e, 0x586f,
+ 0x5870, 0x5871, 0x5872, 0x5873, 0x5874, 0x5875, 0x5876, 0x5877,
+ 0x5878, 0x5879, 0x587a, 0x587b, 0x587c, 0x587d, 0x587e, 0x587f,
+ 0x5880, 0x5881, 0x5882, 0x5883, 0x5884, 0x5885, 0x5886, 0x5887,
+ 0x5888, 0x5889, 0x588a, 0x588b, 0x588c, 0x588d, 0x588e, 0x588f,
+ 0x5890, 0x5891, 0x5892, 0x5893, 0x5894, 0x5895, 0x5896, 0x5897,
+ 0x5898, 0x5899, 0x589a, 0x589b, 0x589c, 0x589d, 0x589e, 0x589f,
+ 0x58a0, 0x58a1, 0x58a2, 0x58a3, 0x58a4, 0x58a5, 0x58a6, 0x58a7,
+ 0x58a8, 0x58a9, 0x58aa, 0x58ab, 0x58ac, 0x58ad, 0x58ae, 0x58af,
+ 0x58b0, 0x58b1, 0x58b2, 0x58b3, 0x58b4, 0x58b5, 0x58b6, 0x58b7,
+ 0x58b8, 0x58b9, 0x58ba, 0x58bb, 0x58bc, 0x58bd, 0x58be, 0x58bf,
+ 0x58c0, 0x58c1, 0x58c2, 0x58c3, 0x58c4, 0x58c5, 0x58c6, 0x58c7,
+ 0x58c8, 0x58c9, 0x58ca, 0x58cb, 0x58cc, 0x58cd, 0x58ce, 0x58cf,
+ 0x58d0, 0x58d1, 0x58d2, 0x58d3, 0x58d4, 0x58d5, 0x58d6, 0x58d7,
+ 0x58d8, 0x58d9, 0x58da, 0x58db, 0x58dc, 0x58dd, 0x58de, 0x58df,
+ 0x58e0, 0x58e1, 0x58e2, 0x58e3, 0x58e4, 0x58e5, 0x58e6, 0x58e7,
+ 0x58e8, 0x58e9, 0x58ea, 0x58eb, 0x58ec, 0x58ed, 0x58ee, 0x58ef,
+ 0x58f0, 0x58f1, 0x58f2, 0x58f3, 0x58f4, 0x58f5, 0x58f6, 0x58f7,
+ 0x58f8, 0x58f9, 0x58fa, 0x58fb, 0x58fc, 0x58fd, 0x58fe, 0x58ff,
+ 0x5900, 0x5901, 0x5902, 0x5903, 0x5904, 0x5905, 0x5906, 0x5907,
+ 0x5908, 0x5909, 0x590a, 0x590b, 0x590c, 0x590d, 0x590e, 0x590f,
+ 0x5910, 0x5911, 0x5912, 0x5913, 0x5914, 0x5915, 0x5916, 0x5917,
+ 0x5918, 0x5919, 0x591a, 0x591b, 0x591c, 0x591d, 0x591e, 0x591f,
+ 0x5920, 0x5921, 0x5922, 0x5923, 0x5924, 0x5925, 0x5926, 0x5927,
+ 0x5928, 0x5929, 0x592a, 0x592b, 0x592c, 0x592d, 0x592e, 0x592f,
+ 0x5930, 0x5931, 0x5932, 0x5933, 0x5934, 0x5935, 0x5936, 0x5937,
+ 0x5938, 0x5939, 0x593a, 0x593b, 0x593c, 0x593d, 0x593e, 0x593f,
+ 0x5940, 0x5941, 0x5942, 0x5943, 0x5944, 0x5945, 0x5946, 0x5947,
+ 0x5948, 0x5949, 0x594a, 0x594b, 0x594c, 0x594d, 0x594e, 0x594f,
+ 0x5950, 0x5951, 0x5952, 0x5953, 0x5954, 0x5955, 0x5956, 0x5957,
+ 0x5958, 0x5959, 0x595a, 0x595b, 0x595c, 0x595d, 0x595e, 0x595f,
+ 0x5960, 0x5961, 0x5962, 0x5963, 0x5964, 0x5965, 0x5966, 0x5967,
+ 0x5968, 0x5969, 0x596a, 0x596b, 0x596c, 0x596d, 0x596e, 0x596f,
+ 0x5970, 0x5971, 0x5972, 0x5973, 0x5974, 0x5975, 0x5976, 0x5977,
+ 0x5978, 0x5979, 0x597a, 0x597b, 0x597c, 0x597d, 0x597e, 0x597f,
+ 0x5980, 0x5981, 0x5982, 0x5983, 0x5984, 0x5985, 0x5986, 0x5987,
+ 0x5988, 0x5989, 0x598a, 0x598b, 0x598c, 0x598d, 0x598e, 0x598f,
+ 0x5990, 0x5991, 0x5992, 0x5993, 0x5994, 0x5995, 0x5996, 0x5997,
+ 0x5998, 0x5999, 0x599a, 0x599b, 0x599c, 0x599d, 0x599e, 0x599f,
+ 0x59a0, 0x59a1, 0x59a2, 0x59a3, 0x59a4, 0x59a5, 0x59a6, 0x59a7,
+ 0x59a8, 0x59a9, 0x59aa, 0x59ab, 0x59ac, 0x59ad, 0x59ae, 0x59af,
+ 0x59b0, 0x59b1, 0x59b2, 0x59b3, 0x59b4, 0x59b5, 0x59b6, 0x59b7,
+ 0x59b8, 0x59b9, 0x59ba, 0x59bb, 0x59bc, 0x59bd, 0x59be, 0x59bf,
+ 0x59c0, 0x59c1, 0x59c2, 0x59c3, 0x59c4, 0x59c5, 0x59c6, 0x59c7,
+ 0x59c8, 0x59c9, 0x59ca, 0x59cb, 0x59cc, 0x59cd, 0x59ce, 0x59cf,
+ 0x59d0, 0x59d1, 0x59d2, 0x59d3, 0x59d4, 0x59d5, 0x59d6, 0x59d7,
+ 0x59d8, 0x59d9, 0x59da, 0x59db, 0x59dc, 0x59dd, 0x59de, 0x59df,
+ 0x59e0, 0x59e1, 0x59e2, 0x59e3, 0x59e4, 0x59e5, 0x59e6, 0x59e7,
+ 0x59e8, 0x59e9, 0x59ea, 0x59eb, 0x59ec, 0x59ed, 0x59ee, 0x59ef,
+ 0x59f0, 0x59f1, 0x59f2, 0x59f3, 0x59f4, 0x59f5, 0x59f6, 0x59f7,
+ 0x59f8, 0x59f9, 0x59fa, 0x59fb, 0x59fc, 0x59fd, 0x59fe, 0x59ff,
+ 0x5a00, 0x5a01, 0x5a02, 0x5a03, 0x5a04, 0x5a05, 0x5a06, 0x5a07,
+ 0x5a08, 0x5a09, 0x5a0a, 0x5a0b, 0x5a0c, 0x5a0d, 0x5a0e, 0x5a0f,
+ 0x5a10, 0x5a11, 0x5a12, 0x5a13, 0x5a14, 0x5a15, 0x5a16, 0x5a17,
+ 0x5a18, 0x5a19, 0x5a1a, 0x5a1b, 0x5a1c, 0x5a1d, 0x5a1e, 0x5a1f,
+ 0x5a20, 0x5a21, 0x5a22, 0x5a23, 0x5a24, 0x5a25, 0x5a26, 0x5a27,
+ 0x5a28, 0x5a29, 0x5a2a, 0x5a2b, 0x5a2c, 0x5a2d, 0x5a2e, 0x5a2f,
+ 0x5a30, 0x5a31, 0x5a32, 0x5a33, 0x5a34, 0x5a35, 0x5a36, 0x5a37,
+ 0x5a38, 0x5a39, 0x5a3a, 0x5a3b, 0x5a3c, 0x5a3d, 0x5a3e, 0x5a3f,
+ 0x5a40, 0x5a41, 0x5a42, 0x5a43, 0x5a44, 0x5a45, 0x5a46, 0x5a47,
+ 0x5a48, 0x5a49, 0x5a4a, 0x5a4b, 0x5a4c, 0x5a4d, 0x5a4e, 0x5a4f,
+ 0x5a50, 0x5a51, 0x5a52, 0x5a53, 0x5a54, 0x5a55, 0x5a56, 0x5a57,
+ 0x5a58, 0x5a59, 0x5a5a, 0x5a5b, 0x5a5c, 0x5a5d, 0x5a5e, 0x5a5f,
+ 0x5a60, 0x5a61, 0x5a62, 0x5a63, 0x5a64, 0x5a65, 0x5a66, 0x5a67,
+ 0x5a68, 0x5a69, 0x5a6a, 0x5a6b, 0x5a6c, 0x5a6d, 0x5a6e, 0x5a6f,
+ 0x5a70, 0x5a71, 0x5a72, 0x5a73, 0x5a74, 0x5a75, 0x5a76, 0x5a77,
+ 0x5a78, 0x5a79, 0x5a7a, 0x5a7b, 0x5a7c, 0x5a7d, 0x5a7e, 0x5a7f,
+ 0x5a80, 0x5a81, 0x5a82, 0x5a83, 0x5a84, 0x5a85, 0x5a86, 0x5a87,
+ 0x5a88, 0x5a89, 0x5a8a, 0x5a8b, 0x5a8c, 0x5a8d, 0x5a8e, 0x5a8f,
+ 0x5a90, 0x5a91, 0x5a92, 0x5a93, 0x5a94, 0x5a95, 0x5a96, 0x5a97,
+ 0x5a98, 0x5a99, 0x5a9a, 0x5a9b, 0x5a9c, 0x5a9d, 0x5a9e, 0x5a9f,
+ 0x5aa0, 0x5aa1, 0x5aa2, 0x5aa3, 0x5aa4, 0x5aa5, 0x5aa6, 0x5aa7,
+ 0x5aa8, 0x5aa9, 0x5aaa, 0x5aab, 0x5aac, 0x5aad, 0x5aae, 0x5aaf,
+ 0x5ab0, 0x5ab1, 0x5ab2, 0x5ab3, 0x5ab4, 0x5ab5, 0x5ab6, 0x5ab7,
+ 0x5ab8, 0x5ab9, 0x5aba, 0x5abb, 0x5abc, 0x5abd, 0x5abe, 0x5abf,
+ 0x5ac0, 0x5ac1, 0x5ac2, 0x5ac3, 0x5ac4, 0x5ac5, 0x5ac6, 0x5ac7,
+ 0x5ac8, 0x5ac9, 0x5aca, 0x5acb, 0x5acc, 0x5acd, 0x5ace, 0x5acf,
+ 0x5ad0, 0x5ad1, 0x5ad2, 0x5ad3, 0x5ad4, 0x5ad5, 0x5ad6, 0x5ad7,
+ 0x5ad8, 0x5ad9, 0x5ada, 0x5adb, 0x5adc, 0x5add, 0x5ade, 0x5adf,
+ 0x5ae0, 0x5ae1, 0x5ae2, 0x5ae3, 0x5ae4, 0x5ae5, 0x5ae6, 0x5ae7,
+ 0x5ae8, 0x5ae9, 0x5aea, 0x5aeb, 0x5aec, 0x5aed, 0x5aee, 0x5aef,
+ 0x5af0, 0x5af1, 0x5af2, 0x5af3, 0x5af4, 0x5af5, 0x5af6, 0x5af7,
+ 0x5af8, 0x5af9, 0x5afa, 0x5afb, 0x5afc, 0x5afd, 0x5afe, 0x5aff,
+ 0x5b00, 0x5b01, 0x5b02, 0x5b03, 0x5b04, 0x5b05, 0x5b06, 0x5b07,
+ 0x5b08, 0x5b09, 0x5b0a, 0x5b0b, 0x5b0c, 0x5b0d, 0x5b0e, 0x5b0f,
+ 0x5b10, 0x5b11, 0x5b12, 0x5b13, 0x5b14, 0x5b15, 0x5b16, 0x5b17,
+ 0x5b18, 0x5b19, 0x5b1a, 0x5b1b, 0x5b1c, 0x5b1d, 0x5b1e, 0x5b1f,
+ 0x5b20, 0x5b21, 0x5b22, 0x5b23, 0x5b24, 0x5b25, 0x5b26, 0x5b27,
+ 0x5b28, 0x5b29, 0x5b2a, 0x5b2b, 0x5b2c, 0x5b2d, 0x5b2e, 0x5b2f,
+ 0x5b30, 0x5b31, 0x5b32, 0x5b33, 0x5b34, 0x5b35, 0x5b36, 0x5b37,
+ 0x5b38, 0x5b39, 0x5b3a, 0x5b3b, 0x5b3c, 0x5b3d, 0x5b3e, 0x5b3f,
+ 0x5b40, 0x5b41, 0x5b42, 0x5b43, 0x5b44, 0x5b45, 0x5b46, 0x5b47,
+ 0x5b48, 0x5b49, 0x5b4a, 0x5b4b, 0x5b4c, 0x5b4d, 0x5b4e, 0x5b4f,
+ 0x5b50, 0x5b51, 0x5b52, 0x5b53, 0x5b54, 0x5b55, 0x5b56, 0x5b57,
+ 0x5b58, 0x5b59, 0x5b5a, 0x5b5b, 0x5b5c, 0x5b5d, 0x5b5e, 0x5b5f,
+ 0x5b60, 0x5b61, 0x5b62, 0x5b63, 0x5b64, 0x5b65, 0x5b66, 0x5b67,
+ 0x5b68, 0x5b69, 0x5b6a, 0x5b6b, 0x5b6c, 0x5b6d, 0x5b6e, 0x5b6f,
+ 0x5b70, 0x5b71, 0x5b72, 0x5b73, 0x5b74, 0x5b75, 0x5b76, 0x5b77,
+ 0x5b78, 0x5b79, 0x5b7a, 0x5b7b, 0x5b7c, 0x5b7d, 0x5b7e, 0x5b7f,
+ 0x5b80, 0x5b81, 0x5b82, 0x5b83, 0x5b84, 0x5b85, 0x5b86, 0x5b87,
+ 0x5b88, 0x5b89, 0x5b8a, 0x5b8b, 0x5b8c, 0x5b8d, 0x5b8e, 0x5b8f,
+ 0x5b90, 0x5b91, 0x5b92, 0x5b93, 0x5b94, 0x5b95, 0x5b96, 0x5b97,
+ 0x5b98, 0x5b99, 0x5b9a, 0x5b9b, 0x5b9c, 0x5b9d, 0x5b9e, 0x5b9f,
+ 0x5ba0, 0x5ba1, 0x5ba2, 0x5ba3, 0x5ba4, 0x5ba5, 0x5ba6, 0x5ba7,
+ 0x5ba8, 0x5ba9, 0x5baa, 0x5bab, 0x5bac, 0x5bad, 0x5bae, 0x5baf,
+ 0x5bb0, 0x5bb1, 0x5bb2, 0x5bb3, 0x5bb4, 0x5bb5, 0x5bb6, 0x5bb7,
+ 0x5bb8, 0x5bb9, 0x5bba, 0x5bbb, 0x5bbc, 0x5bbd, 0x5bbe, 0x5bbf,
+ 0x5bc0, 0x5bc1, 0x5bc2, 0x5bc3, 0x5bc4, 0x5bc5, 0x5bc6, 0x5bc7,
+ 0x5bc8, 0x5bc9, 0x5bca, 0x5bcb, 0x5bcc, 0x5bcd, 0x5bce, 0x5bcf,
+ 0x5bd0, 0x5bd1, 0x5bd2, 0x5bd3, 0x5bd4, 0x5bd5, 0x5bd6, 0x5bd7,
+ 0x5bd8, 0x5bd9, 0x5bda, 0x5bdb, 0x5bdc, 0x5bdd, 0x5bde, 0x5bdf,
+ 0x5be0, 0x5be1, 0x5be2, 0x5be3, 0x5be4, 0x5be5, 0x5be6, 0x5be7,
+ 0x5be8, 0x5be9, 0x5bea, 0x5beb, 0x5bec, 0x5bed, 0x5bee, 0x5bef,
+ 0x5bf0, 0x5bf1, 0x5bf2, 0x5bf3, 0x5bf4, 0x5bf5, 0x5bf6, 0x5bf7,
+ 0x5bf8, 0x5bf9, 0x5bfa, 0x5bfb, 0x5bfc, 0x5bfd, 0x5bfe, 0x5bff,
+ 0x5c00, 0x5c01, 0x5c02, 0x5c03, 0x5c04, 0x5c05, 0x5c06, 0x5c07,
+ 0x5c08, 0x5c09, 0x5c0a, 0x5c0b, 0x5c0c, 0x5c0d, 0x5c0e, 0x5c0f,
+ 0x5c10, 0x5c11, 0x5c12, 0x5c13, 0x5c14, 0x5c15, 0x5c16, 0x5c17,
+ 0x5c18, 0x5c19, 0x5c1a, 0x5c1b, 0x5c1c, 0x5c1d, 0x5c1e, 0x5c1f,
+ 0x5c20, 0x5c21, 0x5c22, 0x5c23, 0x5c24, 0x5c25, 0x5c26, 0x5c27,
+ 0x5c28, 0x5c29, 0x5c2a, 0x5c2b, 0x5c2c, 0x5c2d, 0x5c2e, 0x5c2f,
+ 0x5c30, 0x5c31, 0x5c32, 0x5c33, 0x5c34, 0x5c35, 0x5c36, 0x5c37,
+ 0x5c38, 0x5c39, 0x5c3a, 0x5c3b, 0x5c3c, 0x5c3d, 0x5c3e, 0x5c3f,
+ 0x5c40, 0x5c41, 0x5c42, 0x5c43, 0x5c44, 0x5c45, 0x5c46, 0x5c47,
+ 0x5c48, 0x5c49, 0x5c4a, 0x5c4b, 0x5c4c, 0x5c4d, 0x5c4e, 0x5c4f,
+ 0x5c50, 0x5c51, 0x5c52, 0x5c53, 0x5c54, 0x5c55, 0x5c56, 0x5c57,
+ 0x5c58, 0x5c59, 0x5c5a, 0x5c5b, 0x5c5c, 0x5c5d, 0x5c5e, 0x5c5f,
+ 0x5c60, 0x5c61, 0x5c62, 0x5c63, 0x5c64, 0x5c65, 0x5c66, 0x5c67,
+ 0x5c68, 0x5c69, 0x5c6a, 0x5c6b, 0x5c6c, 0x5c6d, 0x5c6e, 0x5c6f,
+ 0x5c70, 0x5c71, 0x5c72, 0x5c73, 0x5c74, 0x5c75, 0x5c76, 0x5c77,
+ 0x5c78, 0x5c79, 0x5c7a, 0x5c7b, 0x5c7c, 0x5c7d, 0x5c7e, 0x5c7f,
+ 0x5c80, 0x5c81, 0x5c82, 0x5c83, 0x5c84, 0x5c85, 0x5c86, 0x5c87,
+ 0x5c88, 0x5c89, 0x5c8a, 0x5c8b, 0x5c8c, 0x5c8d, 0x5c8e, 0x5c8f,
+ 0x5c90, 0x5c91, 0x5c92, 0x5c93, 0x5c94, 0x5c95, 0x5c96, 0x5c97,
+ 0x5c98, 0x5c99, 0x5c9a, 0x5c9b, 0x5c9c, 0x5c9d, 0x5c9e, 0x5c9f,
+ 0x5ca0, 0x5ca1, 0x5ca2, 0x5ca3, 0x5ca4, 0x5ca5, 0x5ca6, 0x5ca7,
+ 0x5ca8, 0x5ca9, 0x5caa, 0x5cab, 0x5cac, 0x5cad, 0x5cae, 0x5caf,
+ 0x5cb0, 0x5cb1, 0x5cb2, 0x5cb3, 0x5cb4, 0x5cb5, 0x5cb6, 0x5cb7,
+ 0x5cb8, 0x5cb9, 0x5cba, 0x5cbb, 0x5cbc, 0x5cbd, 0x5cbe, 0x5cbf,
+ 0x5cc0, 0x5cc1, 0x5cc2, 0x5cc3, 0x5cc4, 0x5cc5, 0x5cc6, 0x5cc7,
+ 0x5cc8, 0x5cc9, 0x5cca, 0x5ccb, 0x5ccc, 0x5ccd, 0x5cce, 0x5ccf,
+ 0x5cd0, 0x5cd1, 0x5cd2, 0x5cd3, 0x5cd4, 0x5cd5, 0x5cd6, 0x5cd7,
+ 0x5cd8, 0x5cd9, 0x5cda, 0x5cdb, 0x5cdc, 0x5cdd, 0x5cde, 0x5cdf,
+ 0x5ce0, 0x5ce1, 0x5ce2, 0x5ce3, 0x5ce4, 0x5ce5, 0x5ce6, 0x5ce7,
+ 0x5ce8, 0x5ce9, 0x5cea, 0x5ceb, 0x5cec, 0x5ced, 0x5cee, 0x5cef,
+ 0x5cf0, 0x5cf1, 0x5cf2, 0x5cf3, 0x5cf4, 0x5cf5, 0x5cf6, 0x5cf7,
+ 0x5cf8, 0x5cf9, 0x5cfa, 0x5cfb, 0x5cfc, 0x5cfd, 0x5cfe, 0x5cff,
+ 0x5d00, 0x5d01, 0x5d02, 0x5d03, 0x5d04, 0x5d05, 0x5d06, 0x5d07,
+ 0x5d08, 0x5d09, 0x5d0a, 0x5d0b, 0x5d0c, 0x5d0d, 0x5d0e, 0x5d0f,
+ 0x5d10, 0x5d11, 0x5d12, 0x5d13, 0x5d14, 0x5d15, 0x5d16, 0x5d17,
+ 0x5d18, 0x5d19, 0x5d1a, 0x5d1b, 0x5d1c, 0x5d1d, 0x5d1e, 0x5d1f,
+ 0x5d20, 0x5d21, 0x5d22, 0x5d23, 0x5d24, 0x5d25, 0x5d26, 0x5d27,
+ 0x5d28, 0x5d29, 0x5d2a, 0x5d2b, 0x5d2c, 0x5d2d, 0x5d2e, 0x5d2f,
+ 0x5d30, 0x5d31, 0x5d32, 0x5d33, 0x5d34, 0x5d35, 0x5d36, 0x5d37,
+ 0x5d38, 0x5d39, 0x5d3a, 0x5d3b, 0x5d3c, 0x5d3d, 0x5d3e, 0x5d3f,
+ 0x5d40, 0x5d41, 0x5d42, 0x5d43, 0x5d44, 0x5d45, 0x5d46, 0x5d47,
+ 0x5d48, 0x5d49, 0x5d4a, 0x5d4b, 0x5d4c, 0x5d4d, 0x5d4e, 0x5d4f,
+ 0x5d50, 0x5d51, 0x5d52, 0x5d53, 0x5d54, 0x5d55, 0x5d56, 0x5d57,
+ 0x5d58, 0x5d59, 0x5d5a, 0x5d5b, 0x5d5c, 0x5d5d, 0x5d5e, 0x5d5f,
+ 0x5d60, 0x5d61, 0x5d62, 0x5d63, 0x5d64, 0x5d65, 0x5d66, 0x5d67,
+ 0x5d68, 0x5d69, 0x5d6a, 0x5d6b, 0x5d6c, 0x5d6d, 0x5d6e, 0x5d6f,
+ 0x5d70, 0x5d71, 0x5d72, 0x5d73, 0x5d74, 0x5d75, 0x5d76, 0x5d77,
+ 0x5d78, 0x5d79, 0x5d7a, 0x5d7b, 0x5d7c, 0x5d7d, 0x5d7e, 0x5d7f,
+ 0x5d80, 0x5d81, 0x5d82, 0x5d83, 0x5d84, 0x5d85, 0x5d86, 0x5d87,
+ 0x5d88, 0x5d89, 0x5d8a, 0x5d8b, 0x5d8c, 0x5d8d, 0x5d8e, 0x5d8f,
+ 0x5d90, 0x5d91, 0x5d92, 0x5d93, 0x5d94, 0x5d95, 0x5d96, 0x5d97,
+ 0x5d98, 0x5d99, 0x5d9a, 0x5d9b, 0x5d9c, 0x5d9d, 0x5d9e, 0x5d9f,
+ 0x5da0, 0x5da1, 0x5da2, 0x5da3, 0x5da4, 0x5da5, 0x5da6, 0x5da7,
+ 0x5da8, 0x5da9, 0x5daa, 0x5dab, 0x5dac, 0x5dad, 0x5dae, 0x5daf,
+ 0x5db0, 0x5db1, 0x5db2, 0x5db3, 0x5db4, 0x5db5, 0x5db6, 0x5db7,
+ 0x5db8, 0x5db9, 0x5dba, 0x5dbb, 0x5dbc, 0x5dbd, 0x5dbe, 0x5dbf,
+ 0x5dc0, 0x5dc1, 0x5dc2, 0x5dc3, 0x5dc4, 0x5dc5, 0x5dc6, 0x5dc7,
+ 0x5dc8, 0x5dc9, 0x5dca, 0x5dcb, 0x5dcc, 0x5dcd, 0x5dce, 0x5dcf,
+ 0x5dd0, 0x5dd1, 0x5dd2, 0x5dd3, 0x5dd4, 0x5dd5, 0x5dd6, 0x5dd7,
+ 0x5dd8, 0x5dd9, 0x5dda, 0x5ddb, 0x5ddc, 0x5ddd, 0x5dde, 0x5ddf,
+ 0x5de0, 0x5de1, 0x5de2, 0x5de3, 0x5de4, 0x5de5, 0x5de6, 0x5de7,
+ 0x5de8, 0x5de9, 0x5dea, 0x5deb, 0x5dec, 0x5ded, 0x5dee, 0x5def,
+ 0x5df0, 0x5df1, 0x5df2, 0x5df3, 0x5df4, 0x5df5, 0x5df6, 0x5df7,
+ 0x5df8, 0x5df9, 0x5dfa, 0x5dfb, 0x5dfc, 0x5dfd, 0x5dfe, 0x5dff,
+ 0x5e00, 0x5e01, 0x5e02, 0x5e03, 0x5e04, 0x5e05, 0x5e06, 0x5e07,
+ 0x5e08, 0x5e09, 0x5e0a, 0x5e0b, 0x5e0c, 0x5e0d, 0x5e0e, 0x5e0f,
+ 0x5e10, 0x5e11, 0x5e12, 0x5e13, 0x5e14, 0x5e15, 0x5e16, 0x5e17,
+ 0x5e18, 0x5e19, 0x5e1a, 0x5e1b, 0x5e1c, 0x5e1d, 0x5e1e, 0x5e1f,
+ 0x5e20, 0x5e21, 0x5e22, 0x5e23, 0x5e24, 0x5e25, 0x5e26, 0x5e27,
+ 0x5e28, 0x5e29, 0x5e2a, 0x5e2b, 0x5e2c, 0x5e2d, 0x5e2e, 0x5e2f,
+ 0x5e30, 0x5e31, 0x5e32, 0x5e33, 0x5e34, 0x5e35, 0x5e36, 0x5e37,
+ 0x5e38, 0x5e39, 0x5e3a, 0x5e3b, 0x5e3c, 0x5e3d, 0x5e3e, 0x5e3f,
+ 0x5e40, 0x5e41, 0x5e42, 0x5e43, 0x5e44, 0x5e45, 0x5e46, 0x5e47,
+ 0x5e48, 0x5e49, 0x5e4a, 0x5e4b, 0x5e4c, 0x5e4d, 0x5e4e, 0x5e4f,
+ 0x5e50, 0x5e51, 0x5e52, 0x5e53, 0x5e54, 0x5e55, 0x5e56, 0x5e57,
+ 0x5e58, 0x5e59, 0x5e5a, 0x5e5b, 0x5e5c, 0x5e5d, 0x5e5e, 0x5e5f,
+ 0x5e60, 0x5e61, 0x5e62, 0x5e63, 0x5e64, 0x5e65, 0x5e66, 0x5e67,
+ 0x5e68, 0x5e69, 0x5e6a, 0x5e6b, 0x5e6c, 0x5e6d, 0x5e6e, 0x5e6f,
+ 0x5e70, 0x5e71, 0x5e72, 0x5e73, 0x5e74, 0x5e75, 0x5e76, 0x5e77,
+ 0x5e78, 0x5e79, 0x5e7a, 0x5e7b, 0x5e7c, 0x5e7d, 0x5e7e, 0x5e7f,
+ 0x5e80, 0x5e81, 0x5e82, 0x5e83, 0x5e84, 0x5e85, 0x5e86, 0x5e87,
+ 0x5e88, 0x5e89, 0x5e8a, 0x5e8b, 0x5e8c, 0x5e8d, 0x5e8e, 0x5e8f,
+ 0x5e90, 0x5e91, 0x5e92, 0x5e93, 0x5e94, 0x5e95, 0x5e96, 0x5e97,
+ 0x5e98, 0x5e99, 0x5e9a, 0x5e9b, 0x5e9c, 0x5e9d, 0x5e9e, 0x5e9f,
+ 0x5ea0, 0x5ea1, 0x5ea2, 0x5ea3, 0x5ea4, 0x5ea5, 0x5ea6, 0x5ea7,
+ 0x5ea8, 0x5ea9, 0x5eaa, 0x5eab, 0x5eac, 0x5ead, 0x5eae, 0x5eaf,
+ 0x5eb0, 0x5eb1, 0x5eb2, 0x5eb3, 0x5eb4, 0x5eb5, 0x5eb6, 0x5eb7,
+ 0x5eb8, 0x5eb9, 0x5eba, 0x5ebb, 0x5ebc, 0x5ebd, 0x5ebe, 0x5ebf,
+ 0x5ec0, 0x5ec1, 0x5ec2, 0x5ec3, 0x5ec4, 0x5ec5, 0x5ec6, 0x5ec7,
+ 0x5ec8, 0x5ec9, 0x5eca, 0x5ecb, 0x5ecc, 0x5ecd, 0x5ece, 0x5ecf,
+ 0x5ed0, 0x5ed1, 0x5ed2, 0x5ed3, 0x5ed4, 0x5ed5, 0x5ed6, 0x5ed7,
+ 0x5ed8, 0x5ed9, 0x5eda, 0x5edb, 0x5edc, 0x5edd, 0x5ede, 0x5edf,
+ 0x5ee0, 0x5ee1, 0x5ee2, 0x5ee3, 0x5ee4, 0x5ee5, 0x5ee6, 0x5ee7,
+ 0x5ee8, 0x5ee9, 0x5eea, 0x5eeb, 0x5eec, 0x5eed, 0x5eee, 0x5eef,
+ 0x5ef0, 0x5ef1, 0x5ef2, 0x5ef3, 0x5ef4, 0x5ef5, 0x5ef6, 0x5ef7,
+ 0x5ef8, 0x5ef9, 0x5efa, 0x5efb, 0x5efc, 0x5efd, 0x5efe, 0x5eff,
+ 0x5f00, 0x5f01, 0x5f02, 0x5f03, 0x5f04, 0x5f05, 0x5f06, 0x5f07,
+ 0x5f08, 0x5f09, 0x5f0a, 0x5f0b, 0x5f0c, 0x5f0d, 0x5f0e, 0x5f0f,
+ 0x5f10, 0x5f11, 0x5f12, 0x5f13, 0x5f14, 0x5f15, 0x5f16, 0x5f17,
+ 0x5f18, 0x5f19, 0x5f1a, 0x5f1b, 0x5f1c, 0x5f1d, 0x5f1e, 0x5f1f,
+ 0x5f20, 0x5f21, 0x5f22, 0x5f23, 0x5f24, 0x5f25, 0x5f26, 0x5f27,
+ 0x5f28, 0x5f29, 0x5f2a, 0x5f2b, 0x5f2c, 0x5f2d, 0x5f2e, 0x5f2f,
+ 0x5f30, 0x5f31, 0x5f32, 0x5f33, 0x5f34, 0x5f35, 0x5f36, 0x5f37,
+ 0x5f38, 0x5f39, 0x5f3a, 0x5f3b, 0x5f3c, 0x5f3d, 0x5f3e, 0x5f3f,
+ 0x5f40, 0x5f41, 0x5f42, 0x5f43, 0x5f44, 0x5f45, 0x5f46, 0x5f47,
+ 0x5f48, 0x5f49, 0x5f4a, 0x5f4b, 0x5f4c, 0x5f4d, 0x5f4e, 0x5f4f,
+ 0x5f50, 0x5f51, 0x5f52, 0x5f53, 0x5f54, 0x5f55, 0x5f56, 0x5f57,
+ 0x5f58, 0x5f59, 0x5f5a, 0x5f5b, 0x5f5c, 0x5f5d, 0x5f5e, 0x5f5f,
+ 0x5f60, 0x5f61, 0x5f62, 0x5f63, 0x5f64, 0x5f65, 0x5f66, 0x5f67,
+ 0x5f68, 0x5f69, 0x5f6a, 0x5f6b, 0x5f6c, 0x5f6d, 0x5f6e, 0x5f6f,
+ 0x5f70, 0x5f71, 0x5f72, 0x5f73, 0x5f74, 0x5f75, 0x5f76, 0x5f77,
+ 0x5f78, 0x5f79, 0x5f7a, 0x5f7b, 0x5f7c, 0x5f7d, 0x5f7e, 0x5f7f,
+ 0x5f80, 0x5f81, 0x5f82, 0x5f83, 0x5f84, 0x5f85, 0x5f86, 0x5f87,
+ 0x5f88, 0x5f89, 0x5f8a, 0x5f8b, 0x5f8c, 0x5f8d, 0x5f8e, 0x5f8f,
+ 0x5f90, 0x5f91, 0x5f92, 0x5f93, 0x5f94, 0x5f95, 0x5f96, 0x5f97,
+ 0x5f98, 0x5f99, 0x5f9a, 0x5f9b, 0x5f9c, 0x5f9d, 0x5f9e, 0x5f9f,
+ 0x5fa0, 0x5fa1, 0x5fa2, 0x5fa3, 0x5fa4, 0x5fa5, 0x5fa6, 0x5fa7,
+ 0x5fa8, 0x5fa9, 0x5faa, 0x5fab, 0x5fac, 0x5fad, 0x5fae, 0x5faf,
+ 0x5fb0, 0x5fb1, 0x5fb2, 0x5fb3, 0x5fb4, 0x5fb5, 0x5fb6, 0x5fb7,
+ 0x5fb8, 0x5fb9, 0x5fba, 0x5fbb, 0x5fbc, 0x5fbd, 0x5fbe, 0x5fbf,
+ 0x5fc0, 0x5fc1, 0x5fc2, 0x5fc3, 0x5fc4, 0x5fc5, 0x5fc6, 0x5fc7,
+ 0x5fc8, 0x5fc9, 0x5fca, 0x5fcb, 0x5fcc, 0x5fcd, 0x5fce, 0x5fcf,
+ 0x5fd0, 0x5fd1, 0x5fd2, 0x5fd3, 0x5fd4, 0x5fd5, 0x5fd6, 0x5fd7,
+ 0x5fd8, 0x5fd9, 0x5fda, 0x5fdb, 0x5fdc, 0x5fdd, 0x5fde, 0x5fdf,
+ 0x5fe0, 0x5fe1, 0x5fe2, 0x5fe3, 0x5fe4, 0x5fe5, 0x5fe6, 0x5fe7,
+ 0x5fe8, 0x5fe9, 0x5fea, 0x5feb, 0x5fec, 0x5fed, 0x5fee, 0x5fef,
+ 0x5ff0, 0x5ff1, 0x5ff2, 0x5ff3, 0x5ff4, 0x5ff5, 0x5ff6, 0x5ff7,
+ 0x5ff8, 0x5ff9, 0x5ffa, 0x5ffb, 0x5ffc, 0x5ffd, 0x5ffe, 0x5fff,
+ 0x6000, 0x6001, 0x6002, 0x6003, 0x6004, 0x6005, 0x6006, 0x6007,
+ 0x6008, 0x6009, 0x600a, 0x600b, 0x600c, 0x600d, 0x600e, 0x600f,
+ 0x6010, 0x6011, 0x6012, 0x6013, 0x6014, 0x6015, 0x6016, 0x6017,
+ 0x6018, 0x6019, 0x601a, 0x601b, 0x601c, 0x601d, 0x601e, 0x601f,
+ 0x6020, 0x6021, 0x6022, 0x6023, 0x6024, 0x6025, 0x6026, 0x6027,
+ 0x6028, 0x6029, 0x602a, 0x602b, 0x602c, 0x602d, 0x602e, 0x602f,
+ 0x6030, 0x6031, 0x6032, 0x6033, 0x6034, 0x6035, 0x6036, 0x6037,
+ 0x6038, 0x6039, 0x603a, 0x603b, 0x603c, 0x603d, 0x603e, 0x603f,
+ 0x6040, 0x6041, 0x6042, 0x6043, 0x6044, 0x6045, 0x6046, 0x6047,
+ 0x6048, 0x6049, 0x604a, 0x604b, 0x604c, 0x604d, 0x604e, 0x604f,
+ 0x6050, 0x6051, 0x6052, 0x6053, 0x6054, 0x6055, 0x6056, 0x6057,
+ 0x6058, 0x6059, 0x605a, 0x605b, 0x605c, 0x605d, 0x605e, 0x605f,
+ 0x6060, 0x6061, 0x6062, 0x6063, 0x6064, 0x6065, 0x6066, 0x6067,
+ 0x6068, 0x6069, 0x606a, 0x606b, 0x606c, 0x606d, 0x606e, 0x606f,
+ 0x6070, 0x6071, 0x6072, 0x6073, 0x6074, 0x6075, 0x6076, 0x6077,
+ 0x6078, 0x6079, 0x607a, 0x607b, 0x607c, 0x607d, 0x607e, 0x607f,
+ 0x6080, 0x6081, 0x6082, 0x6083, 0x6084, 0x6085, 0x6086, 0x6087,
+ 0x6088, 0x6089, 0x608a, 0x608b, 0x608c, 0x608d, 0x608e, 0x608f,
+ 0x6090, 0x6091, 0x6092, 0x6093, 0x6094, 0x6095, 0x6096, 0x6097,
+ 0x6098, 0x6099, 0x609a, 0x609b, 0x609c, 0x609d, 0x609e, 0x609f,
+ 0x60a0, 0x60a1, 0x60a2, 0x60a3, 0x60a4, 0x60a5, 0x60a6, 0x60a7,
+ 0x60a8, 0x60a9, 0x60aa, 0x60ab, 0x60ac, 0x60ad, 0x60ae, 0x60af,
+ 0x60b0, 0x60b1, 0x60b2, 0x60b3, 0x60b4, 0x60b5, 0x60b6, 0x60b7,
+ 0x60b8, 0x60b9, 0x60ba, 0x60bb, 0x60bc, 0x60bd, 0x60be, 0x60bf,
+ 0x60c0, 0x60c1, 0x60c2, 0x60c3, 0x60c4, 0x60c5, 0x60c6, 0x60c7,
+ 0x60c8, 0x60c9, 0x60ca, 0x60cb, 0x60cc, 0x60cd, 0x60ce, 0x60cf,
+ 0x60d0, 0x60d1, 0x60d2, 0x60d3, 0x60d4, 0x60d5, 0x60d6, 0x60d7,
+ 0x60d8, 0x60d9, 0x60da, 0x60db, 0x60dc, 0x60dd, 0x60de, 0x60df,
+ 0x60e0, 0x60e1, 0x60e2, 0x60e3, 0x60e4, 0x60e5, 0x60e6, 0x60e7,
+ 0x60e8, 0x60e9, 0x60ea, 0x60eb, 0x60ec, 0x60ed, 0x60ee, 0x60ef,
+ 0x60f0, 0x60f1, 0x60f2, 0x60f3, 0x60f4, 0x60f5, 0x60f6, 0x60f7,
+ 0x60f8, 0x60f9, 0x60fa, 0x60fb, 0x60fc, 0x60fd, 0x60fe, 0x60ff,
+ 0x6100, 0x6101, 0x6102, 0x6103, 0x6104, 0x6105, 0x6106, 0x6107,
+ 0x6108, 0x6109, 0x610a, 0x610b, 0x610c, 0x610d, 0x610e, 0x610f,
+ 0x6110, 0x6111, 0x6112, 0x6113, 0x6114, 0x6115, 0x6116, 0x6117,
+ 0x6118, 0x6119, 0x611a, 0x611b, 0x611c, 0x611d, 0x611e, 0x611f,
+ 0x6120, 0x6121, 0x6122, 0x6123, 0x6124, 0x6125, 0x6126, 0x6127,
+ 0x6128, 0x6129, 0x612a, 0x612b, 0x612c, 0x612d, 0x612e, 0x612f,
+ 0x6130, 0x6131, 0x6132, 0x6133, 0x6134, 0x6135, 0x6136, 0x6137,
+ 0x6138, 0x6139, 0x613a, 0x613b, 0x613c, 0x613d, 0x613e, 0x613f,
+ 0x6140, 0x6141, 0x6142, 0x6143, 0x6144, 0x6145, 0x6146, 0x6147,
+ 0x6148, 0x6149, 0x614a, 0x614b, 0x614c, 0x614d, 0x614e, 0x614f,
+ 0x6150, 0x6151, 0x6152, 0x6153, 0x6154, 0x6155, 0x6156, 0x6157,
+ 0x6158, 0x6159, 0x615a, 0x615b, 0x615c, 0x615d, 0x615e, 0x615f,
+ 0x6160, 0x6161, 0x6162, 0x6163, 0x6164, 0x6165, 0x6166, 0x6167,
+ 0x6168, 0x6169, 0x616a, 0x616b, 0x616c, 0x616d, 0x616e, 0x616f,
+ 0x6170, 0x6171, 0x6172, 0x6173, 0x6174, 0x6175, 0x6176, 0x6177,
+ 0x6178, 0x6179, 0x617a, 0x617b, 0x617c, 0x617d, 0x617e, 0x617f,
+ 0x6180, 0x6181, 0x6182, 0x6183, 0x6184, 0x6185, 0x6186, 0x6187,
+ 0x6188, 0x6189, 0x618a, 0x618b, 0x618c, 0x618d, 0x618e, 0x618f,
+ 0x6190, 0x6191, 0x6192, 0x6193, 0x6194, 0x6195, 0x6196, 0x6197,
+ 0x6198, 0x6199, 0x619a, 0x619b, 0x619c, 0x619d, 0x619e, 0x619f,
+ 0x61a0, 0x61a1, 0x61a2, 0x61a3, 0x61a4, 0x61a5, 0x61a6, 0x61a7,
+ 0x61a8, 0x61a9, 0x61aa, 0x61ab, 0x61ac, 0x61ad, 0x61ae, 0x61af,
+ 0x61b0, 0x61b1, 0x61b2, 0x61b3, 0x61b4, 0x61b5, 0x61b6, 0x61b7,
+ 0x61b8, 0x61b9, 0x61ba, 0x61bb, 0x61bc, 0x61bd, 0x61be, 0x61bf,
+ 0x61c0, 0x61c1, 0x61c2, 0x61c3, 0x61c4, 0x61c5, 0x61c6, 0x61c7,
+ 0x61c8, 0x61c9, 0x61ca, 0x61cb, 0x61cc, 0x61cd, 0x61ce, 0x61cf,
+ 0x61d0, 0x61d1, 0x61d2, 0x61d3, 0x61d4, 0x61d5, 0x61d6, 0x61d7,
+ 0x61d8, 0x61d9, 0x61da, 0x61db, 0x61dc, 0x61dd, 0x61de, 0x61df,
+ 0x61e0, 0x61e1, 0x61e2, 0x61e3, 0x61e4, 0x61e5, 0x61e6, 0x61e7,
+ 0x61e8, 0x61e9, 0x61ea, 0x61eb, 0x61ec, 0x61ed, 0x61ee, 0x61ef,
+ 0x61f0, 0x61f1, 0x61f2, 0x61f3, 0x61f4, 0x61f5, 0x61f6, 0x61f7,
+ 0x61f8, 0x61f9, 0x61fa, 0x61fb, 0x61fc, 0x61fd, 0x61fe, 0x61ff,
+ 0x6200, 0x6201, 0x6202, 0x6203, 0x6204, 0x6205, 0x6206, 0x6207,
+ 0x6208, 0x6209, 0x620a, 0x620b, 0x620c, 0x620d, 0x620e, 0x620f,
+ 0x6210, 0x6211, 0x6212, 0x6213, 0x6214, 0x6215, 0x6216, 0x6217,
+ 0x6218, 0x6219, 0x621a, 0x621b, 0x621c, 0x621d, 0x621e, 0x621f,
+ 0x6220, 0x6221, 0x6222, 0x6223, 0x6224, 0x6225, 0x6226, 0x6227,
+ 0x6228, 0x6229, 0x622a, 0x622b, 0x622c, 0x622d, 0x622e, 0x622f,
+ 0x6230, 0x6231, 0x6232, 0x6233, 0x6234, 0x6235, 0x6236, 0x6237,
+ 0x6238, 0x6239, 0x623a, 0x623b, 0x623c, 0x623d, 0x623e, 0x623f,
+ 0x6240, 0x6241, 0x6242, 0x6243, 0x6244, 0x6245, 0x6246, 0x6247,
+ 0x6248, 0x6249, 0x624a, 0x624b, 0x624c, 0x624d, 0x624e, 0x624f,
+ 0x6250, 0x6251, 0x6252, 0x6253, 0x6254, 0x6255, 0x6256, 0x6257,
+ 0x6258, 0x6259, 0x625a, 0x625b, 0x625c, 0x625d, 0x625e, 0x625f,
+ 0x6260, 0x6261, 0x6262, 0x6263, 0x6264, 0x6265, 0x6266, 0x6267,
+ 0x6268, 0x6269, 0x626a, 0x626b, 0x626c, 0x626d, 0x626e, 0x626f,
+ 0x6270, 0x6271, 0x6272, 0x6273, 0x6274, 0x6275, 0x6276, 0x6277,
+ 0x6278, 0x6279, 0x627a, 0x627b, 0x627c, 0x627d, 0x627e, 0x627f,
+ 0x6280, 0x6281, 0x6282, 0x6283, 0x6284, 0x6285, 0x6286, 0x6287,
+ 0x6288, 0x6289, 0x628a, 0x628b, 0x628c, 0x628d, 0x628e, 0x628f,
+ 0x6290, 0x6291, 0x6292, 0x6293, 0x6294, 0x6295, 0x6296, 0x6297,
+ 0x6298, 0x6299, 0x629a, 0x629b, 0x629c, 0x629d, 0x629e, 0x629f,
+ 0x62a0, 0x62a1, 0x62a2, 0x62a3, 0x62a4, 0x62a5, 0x62a6, 0x62a7,
+ 0x62a8, 0x62a9, 0x62aa, 0x62ab, 0x62ac, 0x62ad, 0x62ae, 0x62af,
+ 0x62b0, 0x62b1, 0x62b2, 0x62b3, 0x62b4, 0x62b5, 0x62b6, 0x62b7,
+ 0x62b8, 0x62b9, 0x62ba, 0x62bb, 0x62bc, 0x62bd, 0x62be, 0x62bf,
+ 0x62c0, 0x62c1, 0x62c2, 0x62c3, 0x62c4, 0x62c5, 0x62c6, 0x62c7,
+ 0x62c8, 0x62c9, 0x62ca, 0x62cb, 0x62cc, 0x62cd, 0x62ce, 0x62cf,
+ 0x62d0, 0x62d1, 0x62d2, 0x62d3, 0x62d4, 0x62d5, 0x62d6, 0x62d7,
+ 0x62d8, 0x62d9, 0x62da, 0x62db, 0x62dc, 0x62dd, 0x62de, 0x62df,
+ 0x62e0, 0x62e1, 0x62e2, 0x62e3, 0x62e4, 0x62e5, 0x62e6, 0x62e7,
+ 0x62e8, 0x62e9, 0x62ea, 0x62eb, 0x62ec, 0x62ed, 0x62ee, 0x62ef,
+ 0x62f0, 0x62f1, 0x62f2, 0x62f3, 0x62f4, 0x62f5, 0x62f6, 0x62f7,
+ 0x62f8, 0x62f9, 0x62fa, 0x62fb, 0x62fc, 0x62fd, 0x62fe, 0x62ff,
+ 0x6300, 0x6301, 0x6302, 0x6303, 0x6304, 0x6305, 0x6306, 0x6307,
+ 0x6308, 0x6309, 0x630a, 0x630b, 0x630c, 0x630d, 0x630e, 0x630f,
+ 0x6310, 0x6311, 0x6312, 0x6313, 0x6314, 0x6315, 0x6316, 0x6317,
+ 0x6318, 0x6319, 0x631a, 0x631b, 0x631c, 0x631d, 0x631e, 0x631f,
+ 0x6320, 0x6321, 0x6322, 0x6323, 0x6324, 0x6325, 0x6326, 0x6327,
+ 0x6328, 0x6329, 0x632a, 0x632b, 0x632c, 0x632d, 0x632e, 0x632f,
+ 0x6330, 0x6331, 0x6332, 0x6333, 0x6334, 0x6335, 0x6336, 0x6337,
+ 0x6338, 0x6339, 0x633a, 0x633b, 0x633c, 0x633d, 0x633e, 0x633f,
+ 0x6340, 0x6341, 0x6342, 0x6343, 0x6344, 0x6345, 0x6346, 0x6347,
+ 0x6348, 0x6349, 0x634a, 0x634b, 0x634c, 0x634d, 0x634e, 0x634f,
+ 0x6350, 0x6351, 0x6352, 0x6353, 0x6354, 0x6355, 0x6356, 0x6357,
+ 0x6358, 0x6359, 0x635a, 0x635b, 0x635c, 0x635d, 0x635e, 0x635f,
+ 0x6360, 0x6361, 0x6362, 0x6363, 0x6364, 0x6365, 0x6366, 0x6367,
+ 0x6368, 0x6369, 0x636a, 0x636b, 0x636c, 0x636d, 0x636e, 0x636f,
+ 0x6370, 0x6371, 0x6372, 0x6373, 0x6374, 0x6375, 0x6376, 0x6377,
+ 0x6378, 0x6379, 0x637a, 0x637b, 0x637c, 0x637d, 0x637e, 0x637f,
+ 0x6380, 0x6381, 0x6382, 0x6383, 0x6384, 0x6385, 0x6386, 0x6387,
+ 0x6388, 0x6389, 0x638a, 0x638b, 0x638c, 0x638d, 0x638e, 0x638f,
+ 0x6390, 0x6391, 0x6392, 0x6393, 0x6394, 0x6395, 0x6396, 0x6397,
+ 0x6398, 0x6399, 0x639a, 0x639b, 0x639c, 0x639d, 0x639e, 0x639f,
+ 0x63a0, 0x63a1, 0x63a2, 0x63a3, 0x63a4, 0x63a5, 0x63a6, 0x63a7,
+ 0x63a8, 0x63a9, 0x63aa, 0x63ab, 0x63ac, 0x63ad, 0x63ae, 0x63af,
+ 0x63b0, 0x63b1, 0x63b2, 0x63b3, 0x63b4, 0x63b5, 0x63b6, 0x63b7,
+ 0x63b8, 0x63b9, 0x63ba, 0x63bb, 0x63bc, 0x63bd, 0x63be, 0x63bf,
+ 0x63c0, 0x63c1, 0x63c2, 0x63c3, 0x63c4, 0x63c5, 0x63c6, 0x63c7,
+ 0x63c8, 0x63c9, 0x63ca, 0x63cb, 0x63cc, 0x63cd, 0x63ce, 0x63cf,
+ 0x63d0, 0x63d1, 0x63d2, 0x63d3, 0x63d4, 0x63d5, 0x63d6, 0x63d7,
+ 0x63d8, 0x63d9, 0x63da, 0x63db, 0x63dc, 0x63dd, 0x63de, 0x63df,
+ 0x63e0, 0x63e1, 0x63e2, 0x63e3, 0x63e4, 0x63e5, 0x63e6, 0x63e7,
+ 0x63e8, 0x63e9, 0x63ea, 0x63eb, 0x63ec, 0x63ed, 0x63ee, 0x63ef,
+ 0x63f0, 0x63f1, 0x63f2, 0x63f3, 0x63f4, 0x63f5, 0x63f6, 0x63f7,
+ 0x63f8, 0x63f9, 0x63fa, 0x63fb, 0x63fc, 0x63fd, 0x63fe, 0x63ff,
+ 0x6400, 0x6401, 0x6402, 0x6403, 0x6404, 0x6405, 0x6406, 0x6407,
+ 0x6408, 0x6409, 0x640a, 0x640b, 0x640c, 0x640d, 0x640e, 0x640f,
+ 0x6410, 0x6411, 0x6412, 0x6413, 0x6414, 0x6415, 0x6416, 0x6417,
+ 0x6418, 0x6419, 0x641a, 0x641b, 0x641c, 0x641d, 0x641e, 0x641f,
+ 0x6420, 0x6421, 0x6422, 0x6423, 0x6424, 0x6425, 0x6426, 0x6427,
+ 0x6428, 0x6429, 0x642a, 0x642b, 0x642c, 0x642d, 0x642e, 0x642f,
+ 0x6430, 0x6431, 0x6432, 0x6433, 0x6434, 0x6435, 0x6436, 0x6437,
+ 0x6438, 0x6439, 0x643a, 0x643b, 0x643c, 0x643d, 0x643e, 0x643f,
+ 0x6440, 0x6441, 0x6442, 0x6443, 0x6444, 0x6445, 0x6446, 0x6447,
+ 0x6448, 0x6449, 0x644a, 0x644b, 0x644c, 0x644d, 0x644e, 0x644f,
+ 0x6450, 0x6451, 0x6452, 0x6453, 0x6454, 0x6455, 0x6456, 0x6457,
+ 0x6458, 0x6459, 0x645a, 0x645b, 0x645c, 0x645d, 0x645e, 0x645f,
+ 0x6460, 0x6461, 0x6462, 0x6463, 0x6464, 0x6465, 0x6466, 0x6467,
+ 0x6468, 0x6469, 0x646a, 0x646b, 0x646c, 0x646d, 0x646e, 0x646f,
+ 0x6470, 0x6471, 0x6472, 0x6473, 0x6474, 0x6475, 0x6476, 0x6477,
+ 0x6478, 0x6479, 0x647a, 0x647b, 0x647c, 0x647d, 0x647e, 0x647f,
+ 0x6480, 0x6481, 0x6482, 0x6483, 0x6484, 0x6485, 0x6486, 0x6487,
+ 0x6488, 0x6489, 0x648a, 0x648b, 0x648c, 0x648d, 0x648e, 0x648f,
+ 0x6490, 0x6491, 0x6492, 0x6493, 0x6494, 0x6495, 0x6496, 0x6497,
+ 0x6498, 0x6499, 0x649a, 0x649b, 0x649c, 0x649d, 0x649e, 0x649f,
+ 0x64a0, 0x64a1, 0x64a2, 0x64a3, 0x64a4, 0x64a5, 0x64a6, 0x64a7,
+ 0x64a8, 0x64a9, 0x64aa, 0x64ab, 0x64ac, 0x64ad, 0x64ae, 0x64af,
+ 0x64b0, 0x64b1, 0x64b2, 0x64b3, 0x64b4, 0x64b5, 0x64b6, 0x64b7,
+ 0x64b8, 0x64b9, 0x64ba, 0x64bb, 0x64bc, 0x64bd, 0x64be, 0x64bf,
+ 0x64c0, 0x64c1, 0x64c2, 0x64c3, 0x64c4, 0x64c5, 0x64c6, 0x64c7,
+ 0x64c8, 0x64c9, 0x64ca, 0x64cb, 0x64cc, 0x64cd, 0x64ce, 0x64cf,
+ 0x64d0, 0x64d1, 0x64d2, 0x64d3, 0x64d4, 0x64d5, 0x64d6, 0x64d7,
+ 0x64d8, 0x64d9, 0x64da, 0x64db, 0x64dc, 0x64dd, 0x64de, 0x64df,
+ 0x64e0, 0x64e1, 0x64e2, 0x64e3, 0x64e4, 0x64e5, 0x64e6, 0x64e7,
+ 0x64e8, 0x64e9, 0x64ea, 0x64eb, 0x64ec, 0x64ed, 0x64ee, 0x64ef,
+ 0x64f0, 0x64f1, 0x64f2, 0x64f3, 0x64f4, 0x64f5, 0x64f6, 0x64f7,
+ 0x64f8, 0x64f9, 0x64fa, 0x64fb, 0x64fc, 0x64fd, 0x64fe, 0x64ff,
+ 0x6500, 0x6501, 0x6502, 0x6503, 0x6504, 0x6505, 0x6506, 0x6507,
+ 0x6508, 0x6509, 0x650a, 0x650b, 0x650c, 0x650d, 0x650e, 0x650f,
+ 0x6510, 0x6511, 0x6512, 0x6513, 0x6514, 0x6515, 0x6516, 0x6517,
+ 0x6518, 0x6519, 0x651a, 0x651b, 0x651c, 0x651d, 0x651e, 0x651f,
+ 0x6520, 0x6521, 0x6522, 0x6523, 0x6524, 0x6525, 0x6526, 0x6527,
+ 0x6528, 0x6529, 0x652a, 0x652b, 0x652c, 0x652d, 0x652e, 0x652f,
+ 0x6530, 0x6531, 0x6532, 0x6533, 0x6534, 0x6535, 0x6536, 0x6537,
+ 0x6538, 0x6539, 0x653a, 0x653b, 0x653c, 0x653d, 0x653e, 0x653f,
+ 0x6540, 0x6541, 0x6542, 0x6543, 0x6544, 0x6545, 0x6546, 0x6547,
+ 0x6548, 0x6549, 0x654a, 0x654b, 0x654c, 0x654d, 0x654e, 0x654f,
+ 0x6550, 0x6551, 0x6552, 0x6553, 0x6554, 0x6555, 0x6556, 0x6557,
+ 0x6558, 0x6559, 0x655a, 0x655b, 0x655c, 0x655d, 0x655e, 0x655f,
+ 0x6560, 0x6561, 0x6562, 0x6563, 0x6564, 0x6565, 0x6566, 0x6567,
+ 0x6568, 0x6569, 0x656a, 0x656b, 0x656c, 0x656d, 0x656e, 0x656f,
+ 0x6570, 0x6571, 0x6572, 0x6573, 0x6574, 0x6575, 0x6576, 0x6577,
+ 0x6578, 0x6579, 0x657a, 0x657b, 0x657c, 0x657d, 0x657e, 0x657f,
+ 0x6580, 0x6581, 0x6582, 0x6583, 0x6584, 0x6585, 0x6586, 0x6587,
+ 0x6588, 0x6589, 0x658a, 0x658b, 0x658c, 0x658d, 0x658e, 0x658f,
+ 0x6590, 0x6591, 0x6592, 0x6593, 0x6594, 0x6595, 0x6596, 0x6597,
+ 0x6598, 0x6599, 0x659a, 0x659b, 0x659c, 0x659d, 0x659e, 0x659f,
+ 0x65a0, 0x65a1, 0x65a2, 0x65a3, 0x65a4, 0x65a5, 0x65a6, 0x65a7,
+ 0x65a8, 0x65a9, 0x65aa, 0x65ab, 0x65ac, 0x65ad, 0x65ae, 0x65af,
+ 0x65b0, 0x65b1, 0x65b2, 0x65b3, 0x65b4, 0x65b5, 0x65b6, 0x65b7,
+ 0x65b8, 0x65b9, 0x65ba, 0x65bb, 0x65bc, 0x65bd, 0x65be, 0x65bf,
+ 0x65c0, 0x65c1, 0x65c2, 0x65c3, 0x65c4, 0x65c5, 0x65c6, 0x65c7,
+ 0x65c8, 0x65c9, 0x65ca, 0x65cb, 0x65cc, 0x65cd, 0x65ce, 0x65cf,
+ 0x65d0, 0x65d1, 0x65d2, 0x65d3, 0x65d4, 0x65d5, 0x65d6, 0x65d7,
+ 0x65d8, 0x65d9, 0x65da, 0x65db, 0x65dc, 0x65dd, 0x65de, 0x65df,
+ 0x65e0, 0x65e1, 0x65e2, 0x65e3, 0x65e4, 0x65e5, 0x65e6, 0x65e7,
+ 0x65e8, 0x65e9, 0x65ea, 0x65eb, 0x65ec, 0x65ed, 0x65ee, 0x65ef,
+ 0x65f0, 0x65f1, 0x65f2, 0x65f3, 0x65f4, 0x65f5, 0x65f6, 0x65f7,
+ 0x65f8, 0x65f9, 0x65fa, 0x65fb, 0x65fc, 0x65fd, 0x65fe, 0x65ff,
+ 0x6600, 0x6601, 0x6602, 0x6603, 0x6604, 0x6605, 0x6606, 0x6607,
+ 0x6608, 0x6609, 0x660a, 0x660b, 0x660c, 0x660d, 0x660e, 0x660f,
+ 0x6610, 0x6611, 0x6612, 0x6613, 0x6614, 0x6615, 0x6616, 0x6617,
+ 0x6618, 0x6619, 0x661a, 0x661b, 0x661c, 0x661d, 0x661e, 0x661f,
+ 0x6620, 0x6621, 0x6622, 0x6623, 0x6624, 0x6625, 0x6626, 0x6627,
+ 0x6628, 0x6629, 0x662a, 0x662b, 0x662c, 0x662d, 0x662e, 0x662f,
+ 0x6630, 0x6631, 0x6632, 0x6633, 0x6634, 0x6635, 0x6636, 0x6637,
+ 0x6638, 0x6639, 0x663a, 0x663b, 0x663c, 0x663d, 0x663e, 0x663f,
+ 0x6640, 0x6641, 0x6642, 0x6643, 0x6644, 0x6645, 0x6646, 0x6647,
+ 0x6648, 0x6649, 0x664a, 0x664b, 0x664c, 0x664d, 0x664e, 0x664f,
+ 0x6650, 0x6651, 0x6652, 0x6653, 0x6654, 0x6655, 0x6656, 0x6657,
+ 0x6658, 0x6659, 0x665a, 0x665b, 0x665c, 0x665d, 0x665e, 0x665f,
+ 0x6660, 0x6661, 0x6662, 0x6663, 0x6664, 0x6665, 0x6666, 0x6667,
+ 0x6668, 0x6669, 0x666a, 0x666b, 0x666c, 0x666d, 0x666e, 0x666f,
+ 0x6670, 0x6671, 0x6672, 0x6673, 0x6674, 0x6675, 0x6676, 0x6677,
+ 0x6678, 0x6679, 0x667a, 0x667b, 0x667c, 0x667d, 0x667e, 0x667f,
+ 0x6680, 0x6681, 0x6682, 0x6683, 0x6684, 0x6685, 0x6686, 0x6687,
+ 0x6688, 0x6689, 0x668a, 0x668b, 0x668c, 0x668d, 0x668e, 0x668f,
+ 0x6690, 0x6691, 0x6692, 0x6693, 0x6694, 0x6695, 0x6696, 0x6697,
+ 0x6698, 0x6699, 0x669a, 0x669b, 0x669c, 0x669d, 0x669e, 0x669f,
+ 0x66a0, 0x66a1, 0x66a2, 0x66a3, 0x66a4, 0x66a5, 0x66a6, 0x66a7,
+ 0x66a8, 0x66a9, 0x66aa, 0x66ab, 0x66ac, 0x66ad, 0x66ae, 0x66af,
+ 0x66b0, 0x66b1, 0x66b2, 0x66b3, 0x66b4, 0x66b5, 0x66b6, 0x66b7,
+ 0x66b8, 0x66b9, 0x66ba, 0x66bb, 0x66bc, 0x66bd, 0x66be, 0x66bf,
+ 0x66c0, 0x66c1, 0x66c2, 0x66c3, 0x66c4, 0x66c5, 0x66c6, 0x66c7,
+ 0x66c8, 0x66c9, 0x66ca, 0x66cb, 0x66cc, 0x66cd, 0x66ce, 0x66cf,
+ 0x66d0, 0x66d1, 0x66d2, 0x66d3, 0x66d4, 0x66d5, 0x66d6, 0x66d7,
+ 0x66d8, 0x66d9, 0x66da, 0x66db, 0x66dc, 0x66dd, 0x66de, 0x66df,
+ 0x66e0, 0x66e1, 0x66e2, 0x66e3, 0x66e4, 0x66e5, 0x66e6, 0x66e7,
+ 0x66e8, 0x66e9, 0x66ea, 0x66eb, 0x66ec, 0x66ed, 0x66ee, 0x66ef,
+ 0x66f0, 0x66f1, 0x66f2, 0x66f3, 0x66f4, 0x66f5, 0x66f6, 0x66f7,
+ 0x66f8, 0x66f9, 0x66fa, 0x66fb, 0x66fc, 0x66fd, 0x66fe, 0x66ff,
+ 0x6700, 0x6701, 0x6702, 0x6703, 0x6704, 0x6705, 0x6706, 0x6707,
+ 0x6708, 0x6709, 0x670a, 0x670b, 0x670c, 0x670d, 0x670e, 0x670f,
+ 0x6710, 0x6711, 0x6712, 0x6713, 0x6714, 0x6715, 0x6716, 0x6717,
+ 0x6718, 0x6719, 0x671a, 0x671b, 0x671c, 0x671d, 0x671e, 0x671f,
+ 0x6720, 0x6721, 0x6722, 0x6723, 0x6724, 0x6725, 0x6726, 0x6727,
+ 0x6728, 0x6729, 0x672a, 0x672b, 0x672c, 0x672d, 0x672e, 0x672f,
+ 0x6730, 0x6731, 0x6732, 0x6733, 0x6734, 0x6735, 0x6736, 0x6737,
+ 0x6738, 0x6739, 0x673a, 0x673b, 0x673c, 0x673d, 0x673e, 0x673f,
+ 0x6740, 0x6741, 0x6742, 0x6743, 0x6744, 0x6745, 0x6746, 0x6747,
+ 0x6748, 0x6749, 0x674a, 0x674b, 0x674c, 0x674d, 0x674e, 0x674f,
+ 0x6750, 0x6751, 0x6752, 0x6753, 0x6754, 0x6755, 0x6756, 0x6757,
+ 0x6758, 0x6759, 0x675a, 0x675b, 0x675c, 0x675d, 0x675e, 0x675f,
+ 0x6760, 0x6761, 0x6762, 0x6763, 0x6764, 0x6765, 0x6766, 0x6767,
+ 0x6768, 0x6769, 0x676a, 0x676b, 0x676c, 0x676d, 0x676e, 0x676f,
+ 0x6770, 0x6771, 0x6772, 0x6773, 0x6774, 0x6775, 0x6776, 0x6777,
+ 0x6778, 0x6779, 0x677a, 0x677b, 0x677c, 0x677d, 0x677e, 0x677f,
+ 0x6780, 0x6781, 0x6782, 0x6783, 0x6784, 0x6785, 0x6786, 0x6787,
+ 0x6788, 0x6789, 0x678a, 0x678b, 0x678c, 0x678d, 0x678e, 0x678f,
+ 0x6790, 0x6791, 0x6792, 0x6793, 0x6794, 0x6795, 0x6796, 0x6797,
+ 0x6798, 0x6799, 0x679a, 0x679b, 0x679c, 0x679d, 0x679e, 0x679f,
+ 0x67a0, 0x67a1, 0x67a2, 0x67a3, 0x67a4, 0x67a5, 0x67a6, 0x67a7,
+ 0x67a8, 0x67a9, 0x67aa, 0x67ab, 0x67ac, 0x67ad, 0x67ae, 0x67af,
+ 0x67b0, 0x67b1, 0x67b2, 0x67b3, 0x67b4, 0x67b5, 0x67b6, 0x67b7,
+ 0x67b8, 0x67b9, 0x67ba, 0x67bb, 0x67bc, 0x67bd, 0x67be, 0x67bf,
+ 0x67c0, 0x67c1, 0x67c2, 0x67c3, 0x67c4, 0x67c5, 0x67c6, 0x67c7,
+ 0x67c8, 0x67c9, 0x67ca, 0x67cb, 0x67cc, 0x67cd, 0x67ce, 0x67cf,
+ 0x67d0, 0x67d1, 0x67d2, 0x67d3, 0x67d4, 0x67d5, 0x67d6, 0x67d7,
+ 0x67d8, 0x67d9, 0x67da, 0x67db, 0x67dc, 0x67dd, 0x67de, 0x67df,
+ 0x67e0, 0x67e1, 0x67e2, 0x67e3, 0x67e4, 0x67e5, 0x67e6, 0x67e7,
+ 0x67e8, 0x67e9, 0x67ea, 0x67eb, 0x67ec, 0x67ed, 0x67ee, 0x67ef,
+ 0x67f0, 0x67f1, 0x67f2, 0x67f3, 0x67f4, 0x67f5, 0x67f6, 0x67f7,
+ 0x67f8, 0x67f9, 0x67fa, 0x67fb, 0x67fc, 0x67fd, 0x67fe, 0x67ff,
+ 0x6800, 0x6801, 0x6802, 0x6803, 0x6804, 0x6805, 0x6806, 0x6807,
+ 0x6808, 0x6809, 0x680a, 0x680b, 0x680c, 0x680d, 0x680e, 0x680f,
+ 0x6810, 0x6811, 0x6812, 0x6813, 0x6814, 0x6815, 0x6816, 0x6817,
+ 0x6818, 0x6819, 0x681a, 0x681b, 0x681c, 0x681d, 0x681e, 0x681f,
+ 0x6820, 0x6821, 0x6822, 0x6823, 0x6824, 0x6825, 0x6826, 0x6827,
+ 0x6828, 0x6829, 0x682a, 0x682b, 0x682c, 0x682d, 0x682e, 0x682f,
+ 0x6830, 0x6831, 0x6832, 0x6833, 0x6834, 0x6835, 0x6836, 0x6837,
+ 0x6838, 0x6839, 0x683a, 0x683b, 0x683c, 0x683d, 0x683e, 0x683f,
+ 0x6840, 0x6841, 0x6842, 0x6843, 0x6844, 0x6845, 0x6846, 0x6847,
+ 0x6848, 0x6849, 0x684a, 0x684b, 0x684c, 0x684d, 0x684e, 0x684f,
+ 0x6850, 0x6851, 0x6852, 0x6853, 0x6854, 0x6855, 0x6856, 0x6857,
+ 0x6858, 0x6859, 0x685a, 0x685b, 0x685c, 0x685d, 0x685e, 0x685f,
+ 0x6860, 0x6861, 0x6862, 0x6863, 0x6864, 0x6865, 0x6866, 0x6867,
+ 0x6868, 0x6869, 0x686a, 0x686b, 0x686c, 0x686d, 0x686e, 0x686f,
+ 0x6870, 0x6871, 0x6872, 0x6873, 0x6874, 0x6875, 0x6876, 0x6877,
+ 0x6878, 0x6879, 0x687a, 0x687b, 0x687c, 0x687d, 0x687e, 0x687f,
+ 0x6880, 0x6881, 0x6882, 0x6883, 0x6884, 0x6885, 0x6886, 0x6887,
+ 0x6888, 0x6889, 0x688a, 0x688b, 0x688c, 0x688d, 0x688e, 0x688f,
+ 0x6890, 0x6891, 0x6892, 0x6893, 0x6894, 0x6895, 0x6896, 0x6897,
+ 0x6898, 0x6899, 0x689a, 0x689b, 0x689c, 0x689d, 0x689e, 0x689f,
+ 0x68a0, 0x68a1, 0x68a2, 0x68a3, 0x68a4, 0x68a5, 0x68a6, 0x68a7,
+ 0x68a8, 0x68a9, 0x68aa, 0x68ab, 0x68ac, 0x68ad, 0x68ae, 0x68af,
+ 0x68b0, 0x68b1, 0x68b2, 0x68b3, 0x68b4, 0x68b5, 0x68b6, 0x68b7,
+ 0x68b8, 0x68b9, 0x68ba, 0x68bb, 0x68bc, 0x68bd, 0x68be, 0x68bf,
+ 0x68c0, 0x68c1, 0x68c2, 0x68c3, 0x68c4, 0x68c5, 0x68c6, 0x68c7,
+ 0x68c8, 0x68c9, 0x68ca, 0x68cb, 0x68cc, 0x68cd, 0x68ce, 0x68cf,
+ 0x68d0, 0x68d1, 0x68d2, 0x68d3, 0x68d4, 0x68d5, 0x68d6, 0x68d7,
+ 0x68d8, 0x68d9, 0x68da, 0x68db, 0x68dc, 0x68dd, 0x68de, 0x68df,
+ 0x68e0, 0x68e1, 0x68e2, 0x68e3, 0x68e4, 0x68e5, 0x68e6, 0x68e7,
+ 0x68e8, 0x68e9, 0x68ea, 0x68eb, 0x68ec, 0x68ed, 0x68ee, 0x68ef,
+ 0x68f0, 0x68f1, 0x68f2, 0x68f3, 0x68f4, 0x68f5, 0x68f6, 0x68f7,
+ 0x68f8, 0x68f9, 0x68fa, 0x68fb, 0x68fc, 0x68fd, 0x68fe, 0x68ff,
+ 0x6900, 0x6901, 0x6902, 0x6903, 0x6904, 0x6905, 0x6906, 0x6907,
+ 0x6908, 0x6909, 0x690a, 0x690b, 0x690c, 0x690d, 0x690e, 0x690f,
+ 0x6910, 0x6911, 0x6912, 0x6913, 0x6914, 0x6915, 0x6916, 0x6917,
+ 0x6918, 0x6919, 0x691a, 0x691b, 0x691c, 0x691d, 0x691e, 0x691f,
+ 0x6920, 0x6921, 0x6922, 0x6923, 0x6924, 0x6925, 0x6926, 0x6927,
+ 0x6928, 0x6929, 0x692a, 0x692b, 0x692c, 0x692d, 0x692e, 0x692f,
+ 0x6930, 0x6931, 0x6932, 0x6933, 0x6934, 0x6935, 0x6936, 0x6937,
+ 0x6938, 0x6939, 0x693a, 0x693b, 0x693c, 0x693d, 0x693e, 0x693f,
+ 0x6940, 0x6941, 0x6942, 0x6943, 0x6944, 0x6945, 0x6946, 0x6947,
+ 0x6948, 0x6949, 0x694a, 0x694b, 0x694c, 0x694d, 0x694e, 0x694f,
+ 0x6950, 0x6951, 0x6952, 0x6953, 0x6954, 0x6955, 0x6956, 0x6957,
+ 0x6958, 0x6959, 0x695a, 0x695b, 0x695c, 0x695d, 0x695e, 0x695f,
+ 0x6960, 0x6961, 0x6962, 0x6963, 0x6964, 0x6965, 0x6966, 0x6967,
+ 0x6968, 0x6969, 0x696a, 0x696b, 0x696c, 0x696d, 0x696e, 0x696f,
+ 0x6970, 0x6971, 0x6972, 0x6973, 0x6974, 0x6975, 0x6976, 0x6977,
+ 0x6978, 0x6979, 0x697a, 0x697b, 0x697c, 0x697d, 0x697e, 0x697f,
+ 0x6980, 0x6981, 0x6982, 0x6983, 0x6984, 0x6985, 0x6986, 0x6987,
+ 0x6988, 0x6989, 0x698a, 0x698b, 0x698c, 0x698d, 0x698e, 0x698f,
+ 0x6990, 0x6991, 0x6992, 0x6993, 0x6994, 0x6995, 0x6996, 0x6997,
+ 0x6998, 0x6999, 0x699a, 0x699b, 0x699c, 0x699d, 0x699e, 0x699f,
+ 0x69a0, 0x69a1, 0x69a2, 0x69a3, 0x69a4, 0x69a5, 0x69a6, 0x69a7,
+ 0x69a8, 0x69a9, 0x69aa, 0x69ab, 0x69ac, 0x69ad, 0x69ae, 0x69af,
+ 0x69b0, 0x69b1, 0x69b2, 0x69b3, 0x69b4, 0x69b5, 0x69b6, 0x69b7,
+ 0x69b8, 0x69b9, 0x69ba, 0x69bb, 0x69bc, 0x69bd, 0x69be, 0x69bf,
+ 0x69c0, 0x69c1, 0x69c2, 0x69c3, 0x69c4, 0x69c5, 0x69c6, 0x69c7,
+ 0x69c8, 0x69c9, 0x69ca, 0x69cb, 0x69cc, 0x69cd, 0x69ce, 0x69cf,
+ 0x69d0, 0x69d1, 0x69d2, 0x69d3, 0x69d4, 0x69d5, 0x69d6, 0x69d7,
+ 0x69d8, 0x69d9, 0x69da, 0x69db, 0x69dc, 0x69dd, 0x69de, 0x69df,
+ 0x69e0, 0x69e1, 0x69e2, 0x69e3, 0x69e4, 0x69e5, 0x69e6, 0x69e7,
+ 0x69e8, 0x69e9, 0x69ea, 0x69eb, 0x69ec, 0x69ed, 0x69ee, 0x69ef,
+ 0x69f0, 0x69f1, 0x69f2, 0x69f3, 0x69f4, 0x69f5, 0x69f6, 0x69f7,
+ 0x69f8, 0x69f9, 0x69fa, 0x69fb, 0x69fc, 0x69fd, 0x69fe, 0x69ff,
+ 0x6a00, 0x6a01, 0x6a02, 0x6a03, 0x6a04, 0x6a05, 0x6a06, 0x6a07,
+ 0x6a08, 0x6a09, 0x6a0a, 0x6a0b, 0x6a0c, 0x6a0d, 0x6a0e, 0x6a0f,
+ 0x6a10, 0x6a11, 0x6a12, 0x6a13, 0x6a14, 0x6a15, 0x6a16, 0x6a17,
+ 0x6a18, 0x6a19, 0x6a1a, 0x6a1b, 0x6a1c, 0x6a1d, 0x6a1e, 0x6a1f,
+ 0x6a20, 0x6a21, 0x6a22, 0x6a23, 0x6a24, 0x6a25, 0x6a26, 0x6a27,
+ 0x6a28, 0x6a29, 0x6a2a, 0x6a2b, 0x6a2c, 0x6a2d, 0x6a2e, 0x6a2f,
+ 0x6a30, 0x6a31, 0x6a32, 0x6a33, 0x6a34, 0x6a35, 0x6a36, 0x6a37,
+ 0x6a38, 0x6a39, 0x6a3a, 0x6a3b, 0x6a3c, 0x6a3d, 0x6a3e, 0x6a3f,
+ 0x6a40, 0x6a41, 0x6a42, 0x6a43, 0x6a44, 0x6a45, 0x6a46, 0x6a47,
+ 0x6a48, 0x6a49, 0x6a4a, 0x6a4b, 0x6a4c, 0x6a4d, 0x6a4e, 0x6a4f,
+ 0x6a50, 0x6a51, 0x6a52, 0x6a53, 0x6a54, 0x6a55, 0x6a56, 0x6a57,
+ 0x6a58, 0x6a59, 0x6a5a, 0x6a5b, 0x6a5c, 0x6a5d, 0x6a5e, 0x6a5f,
+ 0x6a60, 0x6a61, 0x6a62, 0x6a63, 0x6a64, 0x6a65, 0x6a66, 0x6a67,
+ 0x6a68, 0x6a69, 0x6a6a, 0x6a6b, 0x6a6c, 0x6a6d, 0x6a6e, 0x6a6f,
+ 0x6a70, 0x6a71, 0x6a72, 0x6a73, 0x6a74, 0x6a75, 0x6a76, 0x6a77,
+ 0x6a78, 0x6a79, 0x6a7a, 0x6a7b, 0x6a7c, 0x6a7d, 0x6a7e, 0x6a7f,
+ 0x6a80, 0x6a81, 0x6a82, 0x6a83, 0x6a84, 0x6a85, 0x6a86, 0x6a87,
+ 0x6a88, 0x6a89, 0x6a8a, 0x6a8b, 0x6a8c, 0x6a8d, 0x6a8e, 0x6a8f,
+ 0x6a90, 0x6a91, 0x6a92, 0x6a93, 0x6a94, 0x6a95, 0x6a96, 0x6a97,
+ 0x6a98, 0x6a99, 0x6a9a, 0x6a9b, 0x6a9c, 0x6a9d, 0x6a9e, 0x6a9f,
+ 0x6aa0, 0x6aa1, 0x6aa2, 0x6aa3, 0x6aa4, 0x6aa5, 0x6aa6, 0x6aa7,
+ 0x6aa8, 0x6aa9, 0x6aaa, 0x6aab, 0x6aac, 0x6aad, 0x6aae, 0x6aaf,
+ 0x6ab0, 0x6ab1, 0x6ab2, 0x6ab3, 0x6ab4, 0x6ab5, 0x6ab6, 0x6ab7,
+ 0x6ab8, 0x6ab9, 0x6aba, 0x6abb, 0x6abc, 0x6abd, 0x6abe, 0x6abf,
+ 0x6ac0, 0x6ac1, 0x6ac2, 0x6ac3, 0x6ac4, 0x6ac5, 0x6ac6, 0x6ac7,
+ 0x6ac8, 0x6ac9, 0x6aca, 0x6acb, 0x6acc, 0x6acd, 0x6ace, 0x6acf,
+ 0x6ad0, 0x6ad1, 0x6ad2, 0x6ad3, 0x6ad4, 0x6ad5, 0x6ad6, 0x6ad7,
+ 0x6ad8, 0x6ad9, 0x6ada, 0x6adb, 0x6adc, 0x6add, 0x6ade, 0x6adf,
+ 0x6ae0, 0x6ae1, 0x6ae2, 0x6ae3, 0x6ae4, 0x6ae5, 0x6ae6, 0x6ae7,
+ 0x6ae8, 0x6ae9, 0x6aea, 0x6aeb, 0x6aec, 0x6aed, 0x6aee, 0x6aef,
+ 0x6af0, 0x6af1, 0x6af2, 0x6af3, 0x6af4, 0x6af5, 0x6af6, 0x6af7,
+ 0x6af8, 0x6af9, 0x6afa, 0x6afb, 0x6afc, 0x6afd, 0x6afe, 0x6aff,
+ 0x6b00, 0x6b01, 0x6b02, 0x6b03, 0x6b04, 0x6b05, 0x6b06, 0x6b07,
+ 0x6b08, 0x6b09, 0x6b0a, 0x6b0b, 0x6b0c, 0x6b0d, 0x6b0e, 0x6b0f,
+ 0x6b10, 0x6b11, 0x6b12, 0x6b13, 0x6b14, 0x6b15, 0x6b16, 0x6b17,
+ 0x6b18, 0x6b19, 0x6b1a, 0x6b1b, 0x6b1c, 0x6b1d, 0x6b1e, 0x6b1f,
+ 0x6b20, 0x6b21, 0x6b22, 0x6b23, 0x6b24, 0x6b25, 0x6b26, 0x6b27,
+ 0x6b28, 0x6b29, 0x6b2a, 0x6b2b, 0x6b2c, 0x6b2d, 0x6b2e, 0x6b2f,
+ 0x6b30, 0x6b31, 0x6b32, 0x6b33, 0x6b34, 0x6b35, 0x6b36, 0x6b37,
+ 0x6b38, 0x6b39, 0x6b3a, 0x6b3b, 0x6b3c, 0x6b3d, 0x6b3e, 0x6b3f,
+ 0x6b40, 0x6b41, 0x6b42, 0x6b43, 0x6b44, 0x6b45, 0x6b46, 0x6b47,
+ 0x6b48, 0x6b49, 0x6b4a, 0x6b4b, 0x6b4c, 0x6b4d, 0x6b4e, 0x6b4f,
+ 0x6b50, 0x6b51, 0x6b52, 0x6b53, 0x6b54, 0x6b55, 0x6b56, 0x6b57,
+ 0x6b58, 0x6b59, 0x6b5a, 0x6b5b, 0x6b5c, 0x6b5d, 0x6b5e, 0x6b5f,
+ 0x6b60, 0x6b61, 0x6b62, 0x6b63, 0x6b64, 0x6b65, 0x6b66, 0x6b67,
+ 0x6b68, 0x6b69, 0x6b6a, 0x6b6b, 0x6b6c, 0x6b6d, 0x6b6e, 0x6b6f,
+ 0x6b70, 0x6b71, 0x6b72, 0x6b73, 0x6b74, 0x6b75, 0x6b76, 0x6b77,
+ 0x6b78, 0x6b79, 0x6b7a, 0x6b7b, 0x6b7c, 0x6b7d, 0x6b7e, 0x6b7f,
+ 0x6b80, 0x6b81, 0x6b82, 0x6b83, 0x6b84, 0x6b85, 0x6b86, 0x6b87,
+ 0x6b88, 0x6b89, 0x6b8a, 0x6b8b, 0x6b8c, 0x6b8d, 0x6b8e, 0x6b8f,
+ 0x6b90, 0x6b91, 0x6b92, 0x6b93, 0x6b94, 0x6b95, 0x6b96, 0x6b97,
+ 0x6b98, 0x6b99, 0x6b9a, 0x6b9b, 0x6b9c, 0x6b9d, 0x6b9e, 0x6b9f,
+ 0x6ba0, 0x6ba1, 0x6ba2, 0x6ba3, 0x6ba4, 0x6ba5, 0x6ba6, 0x6ba7,
+ 0x6ba8, 0x6ba9, 0x6baa, 0x6bab, 0x6bac, 0x6bad, 0x6bae, 0x6baf,
+ 0x6bb0, 0x6bb1, 0x6bb2, 0x6bb3, 0x6bb4, 0x6bb5, 0x6bb6, 0x6bb7,
+ 0x6bb8, 0x6bb9, 0x6bba, 0x6bbb, 0x6bbc, 0x6bbd, 0x6bbe, 0x6bbf,
+ 0x6bc0, 0x6bc1, 0x6bc2, 0x6bc3, 0x6bc4, 0x6bc5, 0x6bc6, 0x6bc7,
+ 0x6bc8, 0x6bc9, 0x6bca, 0x6bcb, 0x6bcc, 0x6bcd, 0x6bce, 0x6bcf,
+ 0x6bd0, 0x6bd1, 0x6bd2, 0x6bd3, 0x6bd4, 0x6bd5, 0x6bd6, 0x6bd7,
+ 0x6bd8, 0x6bd9, 0x6bda, 0x6bdb, 0x6bdc, 0x6bdd, 0x6bde, 0x6bdf,
+ 0x6be0, 0x6be1, 0x6be2, 0x6be3, 0x6be4, 0x6be5, 0x6be6, 0x6be7,
+ 0x6be8, 0x6be9, 0x6bea, 0x6beb, 0x6bec, 0x6bed, 0x6bee, 0x6bef,
+ 0x6bf0, 0x6bf1, 0x6bf2, 0x6bf3, 0x6bf4, 0x6bf5, 0x6bf6, 0x6bf7,
+ 0x6bf8, 0x6bf9, 0x6bfa, 0x6bfb, 0x6bfc, 0x6bfd, 0x6bfe, 0x6bff,
+ 0x6c00, 0x6c01, 0x6c02, 0x6c03, 0x6c04, 0x6c05, 0x6c06, 0x6c07,
+ 0x6c08, 0x6c09, 0x6c0a, 0x6c0b, 0x6c0c, 0x6c0d, 0x6c0e, 0x6c0f,
+ 0x6c10, 0x6c11, 0x6c12, 0x6c13, 0x6c14, 0x6c15, 0x6c16, 0x6c17,
+ 0x6c18, 0x6c19, 0x6c1a, 0x6c1b, 0x6c1c, 0x6c1d, 0x6c1e, 0x6c1f,
+ 0x6c20, 0x6c21, 0x6c22, 0x6c23, 0x6c24, 0x6c25, 0x6c26, 0x6c27,
+ 0x6c28, 0x6c29, 0x6c2a, 0x6c2b, 0x6c2c, 0x6c2d, 0x6c2e, 0x6c2f,
+ 0x6c30, 0x6c31, 0x6c32, 0x6c33, 0x6c34, 0x6c35, 0x6c36, 0x6c37,
+ 0x6c38, 0x6c39, 0x6c3a, 0x6c3b, 0x6c3c, 0x6c3d, 0x6c3e, 0x6c3f,
+ 0x6c40, 0x6c41, 0x6c42, 0x6c43, 0x6c44, 0x6c45, 0x6c46, 0x6c47,
+ 0x6c48, 0x6c49, 0x6c4a, 0x6c4b, 0x6c4c, 0x6c4d, 0x6c4e, 0x6c4f,
+ 0x6c50, 0x6c51, 0x6c52, 0x6c53, 0x6c54, 0x6c55, 0x6c56, 0x6c57,
+ 0x6c58, 0x6c59, 0x6c5a, 0x6c5b, 0x6c5c, 0x6c5d, 0x6c5e, 0x6c5f,
+ 0x6c60, 0x6c61, 0x6c62, 0x6c63, 0x6c64, 0x6c65, 0x6c66, 0x6c67,
+ 0x6c68, 0x6c69, 0x6c6a, 0x6c6b, 0x6c6c, 0x6c6d, 0x6c6e, 0x6c6f,
+ 0x6c70, 0x6c71, 0x6c72, 0x6c73, 0x6c74, 0x6c75, 0x6c76, 0x6c77,
+ 0x6c78, 0x6c79, 0x6c7a, 0x6c7b, 0x6c7c, 0x6c7d, 0x6c7e, 0x6c7f,
+ 0x6c80, 0x6c81, 0x6c82, 0x6c83, 0x6c84, 0x6c85, 0x6c86, 0x6c87,
+ 0x6c88, 0x6c89, 0x6c8a, 0x6c8b, 0x6c8c, 0x6c8d, 0x6c8e, 0x6c8f,
+ 0x6c90, 0x6c91, 0x6c92, 0x6c93, 0x6c94, 0x6c95, 0x6c96, 0x6c97,
+ 0x6c98, 0x6c99, 0x6c9a, 0x6c9b, 0x6c9c, 0x6c9d, 0x6c9e, 0x6c9f,
+ 0x6ca0, 0x6ca1, 0x6ca2, 0x6ca3, 0x6ca4, 0x6ca5, 0x6ca6, 0x6ca7,
+ 0x6ca8, 0x6ca9, 0x6caa, 0x6cab, 0x6cac, 0x6cad, 0x6cae, 0x6caf,
+ 0x6cb0, 0x6cb1, 0x6cb2, 0x6cb3, 0x6cb4, 0x6cb5, 0x6cb6, 0x6cb7,
+ 0x6cb8, 0x6cb9, 0x6cba, 0x6cbb, 0x6cbc, 0x6cbd, 0x6cbe, 0x6cbf,
+ 0x6cc0, 0x6cc1, 0x6cc2, 0x6cc3, 0x6cc4, 0x6cc5, 0x6cc6, 0x6cc7,
+ 0x6cc8, 0x6cc9, 0x6cca, 0x6ccb, 0x6ccc, 0x6ccd, 0x6cce, 0x6ccf,
+ 0x6cd0, 0x6cd1, 0x6cd2, 0x6cd3, 0x6cd4, 0x6cd5, 0x6cd6, 0x6cd7,
+ 0x6cd8, 0x6cd9, 0x6cda, 0x6cdb, 0x6cdc, 0x6cdd, 0x6cde, 0x6cdf,
+ 0x6ce0, 0x6ce1, 0x6ce2, 0x6ce3, 0x6ce4, 0x6ce5, 0x6ce6, 0x6ce7,
+ 0x6ce8, 0x6ce9, 0x6cea, 0x6ceb, 0x6cec, 0x6ced, 0x6cee, 0x6cef,
+ 0x6cf0, 0x6cf1, 0x6cf2, 0x6cf3, 0x6cf4, 0x6cf5, 0x6cf6, 0x6cf7,
+ 0x6cf8, 0x6cf9, 0x6cfa, 0x6cfb, 0x6cfc, 0x6cfd, 0x6cfe, 0x6cff,
+ 0x6d00, 0x6d01, 0x6d02, 0x6d03, 0x6d04, 0x6d05, 0x6d06, 0x6d07,
+ 0x6d08, 0x6d09, 0x6d0a, 0x6d0b, 0x6d0c, 0x6d0d, 0x6d0e, 0x6d0f,
+ 0x6d10, 0x6d11, 0x6d12, 0x6d13, 0x6d14, 0x6d15, 0x6d16, 0x6d17,
+ 0x6d18, 0x6d19, 0x6d1a, 0x6d1b, 0x6d1c, 0x6d1d, 0x6d1e, 0x6d1f,
+ 0x6d20, 0x6d21, 0x6d22, 0x6d23, 0x6d24, 0x6d25, 0x6d26, 0x6d27,
+ 0x6d28, 0x6d29, 0x6d2a, 0x6d2b, 0x6d2c, 0x6d2d, 0x6d2e, 0x6d2f,
+ 0x6d30, 0x6d31, 0x6d32, 0x6d33, 0x6d34, 0x6d35, 0x6d36, 0x6d37,
+ 0x6d38, 0x6d39, 0x6d3a, 0x6d3b, 0x6d3c, 0x6d3d, 0x6d3e, 0x6d3f,
+ 0x6d40, 0x6d41, 0x6d42, 0x6d43, 0x6d44, 0x6d45, 0x6d46, 0x6d47,
+ 0x6d48, 0x6d49, 0x6d4a, 0x6d4b, 0x6d4c, 0x6d4d, 0x6d4e, 0x6d4f,
+ 0x6d50, 0x6d51, 0x6d52, 0x6d53, 0x6d54, 0x6d55, 0x6d56, 0x6d57,
+ 0x6d58, 0x6d59, 0x6d5a, 0x6d5b, 0x6d5c, 0x6d5d, 0x6d5e, 0x6d5f,
+ 0x6d60, 0x6d61, 0x6d62, 0x6d63, 0x6d64, 0x6d65, 0x6d66, 0x6d67,
+ 0x6d68, 0x6d69, 0x6d6a, 0x6d6b, 0x6d6c, 0x6d6d, 0x6d6e, 0x6d6f,
+ 0x6d70, 0x6d71, 0x6d72, 0x6d73, 0x6d74, 0x6d75, 0x6d76, 0x6d77,
+ 0x6d78, 0x6d79, 0x6d7a, 0x6d7b, 0x6d7c, 0x6d7d, 0x6d7e, 0x6d7f,
+ 0x6d80, 0x6d81, 0x6d82, 0x6d83, 0x6d84, 0x6d85, 0x6d86, 0x6d87,
+ 0x6d88, 0x6d89, 0x6d8a, 0x6d8b, 0x6d8c, 0x6d8d, 0x6d8e, 0x6d8f,
+ 0x6d90, 0x6d91, 0x6d92, 0x6d93, 0x6d94, 0x6d95, 0x6d96, 0x6d97,
+ 0x6d98, 0x6d99, 0x6d9a, 0x6d9b, 0x6d9c, 0x6d9d, 0x6d9e, 0x6d9f,
+ 0x6da0, 0x6da1, 0x6da2, 0x6da3, 0x6da4, 0x6da5, 0x6da6, 0x6da7,
+ 0x6da8, 0x6da9, 0x6daa, 0x6dab, 0x6dac, 0x6dad, 0x6dae, 0x6daf,
+ 0x6db0, 0x6db1, 0x6db2, 0x6db3, 0x6db4, 0x6db5, 0x6db6, 0x6db7,
+ 0x6db8, 0x6db9, 0x6dba, 0x6dbb, 0x6dbc, 0x6dbd, 0x6dbe, 0x6dbf,
+ 0x6dc0, 0x6dc1, 0x6dc2, 0x6dc3, 0x6dc4, 0x6dc5, 0x6dc6, 0x6dc7,
+ 0x6dc8, 0x6dc9, 0x6dca, 0x6dcb, 0x6dcc, 0x6dcd, 0x6dce, 0x6dcf,
+ 0x6dd0, 0x6dd1, 0x6dd2, 0x6dd3, 0x6dd4, 0x6dd5, 0x6dd6, 0x6dd7,
+ 0x6dd8, 0x6dd9, 0x6dda, 0x6ddb, 0x6ddc, 0x6ddd, 0x6dde, 0x6ddf,
+ 0x6de0, 0x6de1, 0x6de2, 0x6de3, 0x6de4, 0x6de5, 0x6de6, 0x6de7,
+ 0x6de8, 0x6de9, 0x6dea, 0x6deb, 0x6dec, 0x6ded, 0x6dee, 0x6def,
+ 0x6df0, 0x6df1, 0x6df2, 0x6df3, 0x6df4, 0x6df5, 0x6df6, 0x6df7,
+ 0x6df8, 0x6df9, 0x6dfa, 0x6dfb, 0x6dfc, 0x6dfd, 0x6dfe, 0x6dff,
+ 0x6e00, 0x6e01, 0x6e02, 0x6e03, 0x6e04, 0x6e05, 0x6e06, 0x6e07,
+ 0x6e08, 0x6e09, 0x6e0a, 0x6e0b, 0x6e0c, 0x6e0d, 0x6e0e, 0x6e0f,
+ 0x6e10, 0x6e11, 0x6e12, 0x6e13, 0x6e14, 0x6e15, 0x6e16, 0x6e17,
+ 0x6e18, 0x6e19, 0x6e1a, 0x6e1b, 0x6e1c, 0x6e1d, 0x6e1e, 0x6e1f,
+ 0x6e20, 0x6e21, 0x6e22, 0x6e23, 0x6e24, 0x6e25, 0x6e26, 0x6e27,
+ 0x6e28, 0x6e29, 0x6e2a, 0x6e2b, 0x6e2c, 0x6e2d, 0x6e2e, 0x6e2f,
+ 0x6e30, 0x6e31, 0x6e32, 0x6e33, 0x6e34, 0x6e35, 0x6e36, 0x6e37,
+ 0x6e38, 0x6e39, 0x6e3a, 0x6e3b, 0x6e3c, 0x6e3d, 0x6e3e, 0x6e3f,
+ 0x6e40, 0x6e41, 0x6e42, 0x6e43, 0x6e44, 0x6e45, 0x6e46, 0x6e47,
+ 0x6e48, 0x6e49, 0x6e4a, 0x6e4b, 0x6e4c, 0x6e4d, 0x6e4e, 0x6e4f,
+ 0x6e50, 0x6e51, 0x6e52, 0x6e53, 0x6e54, 0x6e55, 0x6e56, 0x6e57,
+ 0x6e58, 0x6e59, 0x6e5a, 0x6e5b, 0x6e5c, 0x6e5d, 0x6e5e, 0x6e5f,
+ 0x6e60, 0x6e61, 0x6e62, 0x6e63, 0x6e64, 0x6e65, 0x6e66, 0x6e67,
+ 0x6e68, 0x6e69, 0x6e6a, 0x6e6b, 0x6e6c, 0x6e6d, 0x6e6e, 0x6e6f,
+ 0x6e70, 0x6e71, 0x6e72, 0x6e73, 0x6e74, 0x6e75, 0x6e76, 0x6e77,
+ 0x6e78, 0x6e79, 0x6e7a, 0x6e7b, 0x6e7c, 0x6e7d, 0x6e7e, 0x6e7f,
+ 0x6e80, 0x6e81, 0x6e82, 0x6e83, 0x6e84, 0x6e85, 0x6e86, 0x6e87,
+ 0x6e88, 0x6e89, 0x6e8a, 0x6e8b, 0x6e8c, 0x6e8d, 0x6e8e, 0x6e8f,
+ 0x6e90, 0x6e91, 0x6e92, 0x6e93, 0x6e94, 0x6e95, 0x6e96, 0x6e97,
+ 0x6e98, 0x6e99, 0x6e9a, 0x6e9b, 0x6e9c, 0x6e9d, 0x6e9e, 0x6e9f,
+ 0x6ea0, 0x6ea1, 0x6ea2, 0x6ea3, 0x6ea4, 0x6ea5, 0x6ea6, 0x6ea7,
+ 0x6ea8, 0x6ea9, 0x6eaa, 0x6eab, 0x6eac, 0x6ead, 0x6eae, 0x6eaf,
+ 0x6eb0, 0x6eb1, 0x6eb2, 0x6eb3, 0x6eb4, 0x6eb5, 0x6eb6, 0x6eb7,
+ 0x6eb8, 0x6eb9, 0x6eba, 0x6ebb, 0x6ebc, 0x6ebd, 0x6ebe, 0x6ebf,
+ 0x6ec0, 0x6ec1, 0x6ec2, 0x6ec3, 0x6ec4, 0x6ec5, 0x6ec6, 0x6ec7,
+ 0x6ec8, 0x6ec9, 0x6eca, 0x6ecb, 0x6ecc, 0x6ecd, 0x6ece, 0x6ecf,
+ 0x6ed0, 0x6ed1, 0x6ed2, 0x6ed3, 0x6ed4, 0x6ed5, 0x6ed6, 0x6ed7,
+ 0x6ed8, 0x6ed9, 0x6eda, 0x6edb, 0x6edc, 0x6edd, 0x6ede, 0x6edf,
+ 0x6ee0, 0x6ee1, 0x6ee2, 0x6ee3, 0x6ee4, 0x6ee5, 0x6ee6, 0x6ee7,
+ 0x6ee8, 0x6ee9, 0x6eea, 0x6eeb, 0x6eec, 0x6eed, 0x6eee, 0x6eef,
+ 0x6ef0, 0x6ef1, 0x6ef2, 0x6ef3, 0x6ef4, 0x6ef5, 0x6ef6, 0x6ef7,
+ 0x6ef8, 0x6ef9, 0x6efa, 0x6efb, 0x6efc, 0x6efd, 0x6efe, 0x6eff,
+ 0x6f00, 0x6f01, 0x6f02, 0x6f03, 0x6f04, 0x6f05, 0x6f06, 0x6f07,
+ 0x6f08, 0x6f09, 0x6f0a, 0x6f0b, 0x6f0c, 0x6f0d, 0x6f0e, 0x6f0f,
+ 0x6f10, 0x6f11, 0x6f12, 0x6f13, 0x6f14, 0x6f15, 0x6f16, 0x6f17,
+ 0x6f18, 0x6f19, 0x6f1a, 0x6f1b, 0x6f1c, 0x6f1d, 0x6f1e, 0x6f1f,
+ 0x6f20, 0x6f21, 0x6f22, 0x6f23, 0x6f24, 0x6f25, 0x6f26, 0x6f27,
+ 0x6f28, 0x6f29, 0x6f2a, 0x6f2b, 0x6f2c, 0x6f2d, 0x6f2e, 0x6f2f,
+ 0x6f30, 0x6f31, 0x6f32, 0x6f33, 0x6f34, 0x6f35, 0x6f36, 0x6f37,
+ 0x6f38, 0x6f39, 0x6f3a, 0x6f3b, 0x6f3c, 0x6f3d, 0x6f3e, 0x6f3f,
+ 0x6f40, 0x6f41, 0x6f42, 0x6f43, 0x6f44, 0x6f45, 0x6f46, 0x6f47,
+ 0x6f48, 0x6f49, 0x6f4a, 0x6f4b, 0x6f4c, 0x6f4d, 0x6f4e, 0x6f4f,
+ 0x6f50, 0x6f51, 0x6f52, 0x6f53, 0x6f54, 0x6f55, 0x6f56, 0x6f57,
+ 0x6f58, 0x6f59, 0x6f5a, 0x6f5b, 0x6f5c, 0x6f5d, 0x6f5e, 0x6f5f,
+ 0x6f60, 0x6f61, 0x6f62, 0x6f63, 0x6f64, 0x6f65, 0x6f66, 0x6f67,
+ 0x6f68, 0x6f69, 0x6f6a, 0x6f6b, 0x6f6c, 0x6f6d, 0x6f6e, 0x6f6f,
+ 0x6f70, 0x6f71, 0x6f72, 0x6f73, 0x6f74, 0x6f75, 0x6f76, 0x6f77,
+ 0x6f78, 0x6f79, 0x6f7a, 0x6f7b, 0x6f7c, 0x6f7d, 0x6f7e, 0x6f7f,
+ 0x6f80, 0x6f81, 0x6f82, 0x6f83, 0x6f84, 0x6f85, 0x6f86, 0x6f87,
+ 0x6f88, 0x6f89, 0x6f8a, 0x6f8b, 0x6f8c, 0x6f8d, 0x6f8e, 0x6f8f,
+ 0x6f90, 0x6f91, 0x6f92, 0x6f93, 0x6f94, 0x6f95, 0x6f96, 0x6f97,
+ 0x6f98, 0x6f99, 0x6f9a, 0x6f9b, 0x6f9c, 0x6f9d, 0x6f9e, 0x6f9f,
+ 0x6fa0, 0x6fa1, 0x6fa2, 0x6fa3, 0x6fa4, 0x6fa5, 0x6fa6, 0x6fa7,
+ 0x6fa8, 0x6fa9, 0x6faa, 0x6fab, 0x6fac, 0x6fad, 0x6fae, 0x6faf,
+ 0x6fb0, 0x6fb1, 0x6fb2, 0x6fb3, 0x6fb4, 0x6fb5, 0x6fb6, 0x6fb7,
+ 0x6fb8, 0x6fb9, 0x6fba, 0x6fbb, 0x6fbc, 0x6fbd, 0x6fbe, 0x6fbf,
+ 0x6fc0, 0x6fc1, 0x6fc2, 0x6fc3, 0x6fc4, 0x6fc5, 0x6fc6, 0x6fc7,
+ 0x6fc8, 0x6fc9, 0x6fca, 0x6fcb, 0x6fcc, 0x6fcd, 0x6fce, 0x6fcf,
+ 0x6fd0, 0x6fd1, 0x6fd2, 0x6fd3, 0x6fd4, 0x6fd5, 0x6fd6, 0x6fd7,
+ 0x6fd8, 0x6fd9, 0x6fda, 0x6fdb, 0x6fdc, 0x6fdd, 0x6fde, 0x6fdf,
+ 0x6fe0, 0x6fe1, 0x6fe2, 0x6fe3, 0x6fe4, 0x6fe5, 0x6fe6, 0x6fe7,
+ 0x6fe8, 0x6fe9, 0x6fea, 0x6feb, 0x6fec, 0x6fed, 0x6fee, 0x6fef,
+ 0x6ff0, 0x6ff1, 0x6ff2, 0x6ff3, 0x6ff4, 0x6ff5, 0x6ff6, 0x6ff7,
+ 0x6ff8, 0x6ff9, 0x6ffa, 0x6ffb, 0x6ffc, 0x6ffd, 0x6ffe, 0x6fff,
+ 0x7000, 0x7001, 0x7002, 0x7003, 0x7004, 0x7005, 0x7006, 0x7007,
+ 0x7008, 0x7009, 0x700a, 0x700b, 0x700c, 0x700d, 0x700e, 0x700f,
+ 0x7010, 0x7011, 0x7012, 0x7013, 0x7014, 0x7015, 0x7016, 0x7017,
+ 0x7018, 0x7019, 0x701a, 0x701b, 0x701c, 0x701d, 0x701e, 0x701f,
+ 0x7020, 0x7021, 0x7022, 0x7023, 0x7024, 0x7025, 0x7026, 0x7027,
+ 0x7028, 0x7029, 0x702a, 0x702b, 0x702c, 0x702d, 0x702e, 0x702f,
+ 0x7030, 0x7031, 0x7032, 0x7033, 0x7034, 0x7035, 0x7036, 0x7037,
+ 0x7038, 0x7039, 0x703a, 0x703b, 0x703c, 0x703d, 0x703e, 0x703f,
+ 0x7040, 0x7041, 0x7042, 0x7043, 0x7044, 0x7045, 0x7046, 0x7047,
+ 0x7048, 0x7049, 0x704a, 0x704b, 0x704c, 0x704d, 0x704e, 0x704f,
+ 0x7050, 0x7051, 0x7052, 0x7053, 0x7054, 0x7055, 0x7056, 0x7057,
+ 0x7058, 0x7059, 0x705a, 0x705b, 0x705c, 0x705d, 0x705e, 0x705f,
+ 0x7060, 0x7061, 0x7062, 0x7063, 0x7064, 0x7065, 0x7066, 0x7067,
+ 0x7068, 0x7069, 0x706a, 0x706b, 0x706c, 0x706d, 0x706e, 0x706f,
+ 0x7070, 0x7071, 0x7072, 0x7073, 0x7074, 0x7075, 0x7076, 0x7077,
+ 0x7078, 0x7079, 0x707a, 0x707b, 0x707c, 0x707d, 0x707e, 0x707f,
+ 0x7080, 0x7081, 0x7082, 0x7083, 0x7084, 0x7085, 0x7086, 0x7087,
+ 0x7088, 0x7089, 0x708a, 0x708b, 0x708c, 0x708d, 0x708e, 0x708f,
+ 0x7090, 0x7091, 0x7092, 0x7093, 0x7094, 0x7095, 0x7096, 0x7097,
+ 0x7098, 0x7099, 0x709a, 0x709b, 0x709c, 0x709d, 0x709e, 0x709f,
+ 0x70a0, 0x70a1, 0x70a2, 0x70a3, 0x70a4, 0x70a5, 0x70a6, 0x70a7,
+ 0x70a8, 0x70a9, 0x70aa, 0x70ab, 0x70ac, 0x70ad, 0x70ae, 0x70af,
+ 0x70b0, 0x70b1, 0x70b2, 0x70b3, 0x70b4, 0x70b5, 0x70b6, 0x70b7,
+ 0x70b8, 0x70b9, 0x70ba, 0x70bb, 0x70bc, 0x70bd, 0x70be, 0x70bf,
+ 0x70c0, 0x70c1, 0x70c2, 0x70c3, 0x70c4, 0x70c5, 0x70c6, 0x70c7,
+ 0x70c8, 0x70c9, 0x70ca, 0x70cb, 0x70cc, 0x70cd, 0x70ce, 0x70cf,
+ 0x70d0, 0x70d1, 0x70d2, 0x70d3, 0x70d4, 0x70d5, 0x70d6, 0x70d7,
+ 0x70d8, 0x70d9, 0x70da, 0x70db, 0x70dc, 0x70dd, 0x70de, 0x70df,
+ 0x70e0, 0x70e1, 0x70e2, 0x70e3, 0x70e4, 0x70e5, 0x70e6, 0x70e7,
+ 0x70e8, 0x70e9, 0x70ea, 0x70eb, 0x70ec, 0x70ed, 0x70ee, 0x70ef,
+ 0x70f0, 0x70f1, 0x70f2, 0x70f3, 0x70f4, 0x70f5, 0x70f6, 0x70f7,
+ 0x70f8, 0x70f9, 0x70fa, 0x70fb, 0x70fc, 0x70fd, 0x70fe, 0x70ff,
+ 0x7100, 0x7101, 0x7102, 0x7103, 0x7104, 0x7105, 0x7106, 0x7107,
+ 0x7108, 0x7109, 0x710a, 0x710b, 0x710c, 0x710d, 0x710e, 0x710f,
+ 0x7110, 0x7111, 0x7112, 0x7113, 0x7114, 0x7115, 0x7116, 0x7117,
+ 0x7118, 0x7119, 0x711a, 0x711b, 0x711c, 0x711d, 0x711e, 0x711f,
+ 0x7120, 0x7121, 0x7122, 0x7123, 0x7124, 0x7125, 0x7126, 0x7127,
+ 0x7128, 0x7129, 0x712a, 0x712b, 0x712c, 0x712d, 0x712e, 0x712f,
+ 0x7130, 0x7131, 0x7132, 0x7133, 0x7134, 0x7135, 0x7136, 0x7137,
+ 0x7138, 0x7139, 0x713a, 0x713b, 0x713c, 0x713d, 0x713e, 0x713f,
+ 0x7140, 0x7141, 0x7142, 0x7143, 0x7144, 0x7145, 0x7146, 0x7147,
+ 0x7148, 0x7149, 0x714a, 0x714b, 0x714c, 0x714d, 0x714e, 0x714f,
+ 0x7150, 0x7151, 0x7152, 0x7153, 0x7154, 0x7155, 0x7156, 0x7157,
+ 0x7158, 0x7159, 0x715a, 0x715b, 0x715c, 0x715d, 0x715e, 0x715f,
+ 0x7160, 0x7161, 0x7162, 0x7163, 0x7164, 0x7165, 0x7166, 0x7167,
+ 0x7168, 0x7169, 0x716a, 0x716b, 0x716c, 0x716d, 0x716e, 0x716f,
+ 0x7170, 0x7171, 0x7172, 0x7173, 0x7174, 0x7175, 0x7176, 0x7177,
+ 0x7178, 0x7179, 0x717a, 0x717b, 0x717c, 0x717d, 0x717e, 0x717f,
+ 0x7180, 0x7181, 0x7182, 0x7183, 0x7184, 0x7185, 0x7186, 0x7187,
+ 0x7188, 0x7189, 0x718a, 0x718b, 0x718c, 0x718d, 0x718e, 0x718f,
+ 0x7190, 0x7191, 0x7192, 0x7193, 0x7194, 0x7195, 0x7196, 0x7197,
+ 0x7198, 0x7199, 0x719a, 0x719b, 0x719c, 0x719d, 0x719e, 0x719f,
+ 0x71a0, 0x71a1, 0x71a2, 0x71a3, 0x71a4, 0x71a5, 0x71a6, 0x71a7,
+ 0x71a8, 0x71a9, 0x71aa, 0x71ab, 0x71ac, 0x71ad, 0x71ae, 0x71af,
+ 0x71b0, 0x71b1, 0x71b2, 0x71b3, 0x71b4, 0x71b5, 0x71b6, 0x71b7,
+ 0x71b8, 0x71b9, 0x71ba, 0x71bb, 0x71bc, 0x71bd, 0x71be, 0x71bf,
+ 0x71c0, 0x71c1, 0x71c2, 0x71c3, 0x71c4, 0x71c5, 0x71c6, 0x71c7,
+ 0x71c8, 0x71c9, 0x71ca, 0x71cb, 0x71cc, 0x71cd, 0x71ce, 0x71cf,
+ 0x71d0, 0x71d1, 0x71d2, 0x71d3, 0x71d4, 0x71d5, 0x71d6, 0x71d7,
+ 0x71d8, 0x71d9, 0x71da, 0x71db, 0x71dc, 0x71dd, 0x71de, 0x71df,
+ 0x71e0, 0x71e1, 0x71e2, 0x71e3, 0x71e4, 0x71e5, 0x71e6, 0x71e7,
+ 0x71e8, 0x71e9, 0x71ea, 0x71eb, 0x71ec, 0x71ed, 0x71ee, 0x71ef,
+ 0x71f0, 0x71f1, 0x71f2, 0x71f3, 0x71f4, 0x71f5, 0x71f6, 0x71f7,
+ 0x71f8, 0x71f9, 0x71fa, 0x71fb, 0x71fc, 0x71fd, 0x71fe, 0x71ff,
+ 0x7200, 0x7201, 0x7202, 0x7203, 0x7204, 0x7205, 0x7206, 0x7207,
+ 0x7208, 0x7209, 0x720a, 0x720b, 0x720c, 0x720d, 0x720e, 0x720f,
+ 0x7210, 0x7211, 0x7212, 0x7213, 0x7214, 0x7215, 0x7216, 0x7217,
+ 0x7218, 0x7219, 0x721a, 0x721b, 0x721c, 0x721d, 0x721e, 0x721f,
+ 0x7220, 0x7221, 0x7222, 0x7223, 0x7224, 0x7225, 0x7226, 0x7227,
+ 0x7228, 0x7229, 0x722a, 0x722b, 0x722c, 0x722d, 0x722e, 0x722f,
+ 0x7230, 0x7231, 0x7232, 0x7233, 0x7234, 0x7235, 0x7236, 0x7237,
+ 0x7238, 0x7239, 0x723a, 0x723b, 0x723c, 0x723d, 0x723e, 0x723f,
+ 0x7240, 0x7241, 0x7242, 0x7243, 0x7244, 0x7245, 0x7246, 0x7247,
+ 0x7248, 0x7249, 0x724a, 0x724b, 0x724c, 0x724d, 0x724e, 0x724f,
+ 0x7250, 0x7251, 0x7252, 0x7253, 0x7254, 0x7255, 0x7256, 0x7257,
+ 0x7258, 0x7259, 0x725a, 0x725b, 0x725c, 0x725d, 0x725e, 0x725f,
+ 0x7260, 0x7261, 0x7262, 0x7263, 0x7264, 0x7265, 0x7266, 0x7267,
+ 0x7268, 0x7269, 0x726a, 0x726b, 0x726c, 0x726d, 0x726e, 0x726f,
+ 0x7270, 0x7271, 0x7272, 0x7273, 0x7274, 0x7275, 0x7276, 0x7277,
+ 0x7278, 0x7279, 0x727a, 0x727b, 0x727c, 0x727d, 0x727e, 0x727f,
+ 0x7280, 0x7281, 0x7282, 0x7283, 0x7284, 0x7285, 0x7286, 0x7287,
+ 0x7288, 0x7289, 0x728a, 0x728b, 0x728c, 0x728d, 0x728e, 0x728f,
+ 0x7290, 0x7291, 0x7292, 0x7293, 0x7294, 0x7295, 0x7296, 0x7297,
+ 0x7298, 0x7299, 0x729a, 0x729b, 0x729c, 0x729d, 0x729e, 0x729f,
+ 0x72a0, 0x72a1, 0x72a2, 0x72a3, 0x72a4, 0x72a5, 0x72a6, 0x72a7,
+ 0x72a8, 0x72a9, 0x72aa, 0x72ab, 0x72ac, 0x72ad, 0x72ae, 0x72af,
+ 0x72b0, 0x72b1, 0x72b2, 0x72b3, 0x72b4, 0x72b5, 0x72b6, 0x72b7,
+ 0x72b8, 0x72b9, 0x72ba, 0x72bb, 0x72bc, 0x72bd, 0x72be, 0x72bf,
+ 0x72c0, 0x72c1, 0x72c2, 0x72c3, 0x72c4, 0x72c5, 0x72c6, 0x72c7,
+ 0x72c8, 0x72c9, 0x72ca, 0x72cb, 0x72cc, 0x72cd, 0x72ce, 0x72cf,
+ 0x72d0, 0x72d1, 0x72d2, 0x72d3, 0x72d4, 0x72d5, 0x72d6, 0x72d7,
+ 0x72d8, 0x72d9, 0x72da, 0x72db, 0x72dc, 0x72dd, 0x72de, 0x72df,
+ 0x72e0, 0x72e1, 0x72e2, 0x72e3, 0x72e4, 0x72e5, 0x72e6, 0x72e7,
+ 0x72e8, 0x72e9, 0x72ea, 0x72eb, 0x72ec, 0x72ed, 0x72ee, 0x72ef,
+ 0x72f0, 0x72f1, 0x72f2, 0x72f3, 0x72f4, 0x72f5, 0x72f6, 0x72f7,
+ 0x72f8, 0x72f9, 0x72fa, 0x72fb, 0x72fc, 0x72fd, 0x72fe, 0x72ff,
+ 0x7300, 0x7301, 0x7302, 0x7303, 0x7304, 0x7305, 0x7306, 0x7307,
+ 0x7308, 0x7309, 0x730a, 0x730b, 0x730c, 0x730d, 0x730e, 0x730f,
+ 0x7310, 0x7311, 0x7312, 0x7313, 0x7314, 0x7315, 0x7316, 0x7317,
+ 0x7318, 0x7319, 0x731a, 0x731b, 0x731c, 0x731d, 0x731e, 0x731f,
+ 0x7320, 0x7321, 0x7322, 0x7323, 0x7324, 0x7325, 0x7326, 0x7327,
+ 0x7328, 0x7329, 0x732a, 0x732b, 0x732c, 0x732d, 0x732e, 0x732f,
+ 0x7330, 0x7331, 0x7332, 0x7333, 0x7334, 0x7335, 0x7336, 0x7337,
+ 0x7338, 0x7339, 0x733a, 0x733b, 0x733c, 0x733d, 0x733e, 0x733f,
+ 0x7340, 0x7341, 0x7342, 0x7343, 0x7344, 0x7345, 0x7346, 0x7347,
+ 0x7348, 0x7349, 0x734a, 0x734b, 0x734c, 0x734d, 0x734e, 0x734f,
+ 0x7350, 0x7351, 0x7352, 0x7353, 0x7354, 0x7355, 0x7356, 0x7357,
+ 0x7358, 0x7359, 0x735a, 0x735b, 0x735c, 0x735d, 0x735e, 0x735f,
+ 0x7360, 0x7361, 0x7362, 0x7363, 0x7364, 0x7365, 0x7366, 0x7367,
+ 0x7368, 0x7369, 0x736a, 0x736b, 0x736c, 0x736d, 0x736e, 0x736f,
+ 0x7370, 0x7371, 0x7372, 0x7373, 0x7374, 0x7375, 0x7376, 0x7377,
+ 0x7378, 0x7379, 0x737a, 0x737b, 0x737c, 0x737d, 0x737e, 0x737f,
+ 0x7380, 0x7381, 0x7382, 0x7383, 0x7384, 0x7385, 0x7386, 0x7387,
+ 0x7388, 0x7389, 0x738a, 0x738b, 0x738c, 0x738d, 0x738e, 0x738f,
+ 0x7390, 0x7391, 0x7392, 0x7393, 0x7394, 0x7395, 0x7396, 0x7397,
+ 0x7398, 0x7399, 0x739a, 0x739b, 0x739c, 0x739d, 0x739e, 0x739f,
+ 0x73a0, 0x73a1, 0x73a2, 0x73a3, 0x73a4, 0x73a5, 0x73a6, 0x73a7,
+ 0x73a8, 0x73a9, 0x73aa, 0x73ab, 0x73ac, 0x73ad, 0x73ae, 0x73af,
+ 0x73b0, 0x73b1, 0x73b2, 0x73b3, 0x73b4, 0x73b5, 0x73b6, 0x73b7,
+ 0x73b8, 0x73b9, 0x73ba, 0x73bb, 0x73bc, 0x73bd, 0x73be, 0x73bf,
+ 0x73c0, 0x73c1, 0x73c2, 0x73c3, 0x73c4, 0x73c5, 0x73c6, 0x73c7,
+ 0x73c8, 0x73c9, 0x73ca, 0x73cb, 0x73cc, 0x73cd, 0x73ce, 0x73cf,
+ 0x73d0, 0x73d1, 0x73d2, 0x73d3, 0x73d4, 0x73d5, 0x73d6, 0x73d7,
+ 0x73d8, 0x73d9, 0x73da, 0x73db, 0x73dc, 0x73dd, 0x73de, 0x73df,
+ 0x73e0, 0x73e1, 0x73e2, 0x73e3, 0x73e4, 0x73e5, 0x73e6, 0x73e7,
+ 0x73e8, 0x73e9, 0x73ea, 0x73eb, 0x73ec, 0x73ed, 0x73ee, 0x73ef,
+ 0x73f0, 0x73f1, 0x73f2, 0x73f3, 0x73f4, 0x73f5, 0x73f6, 0x73f7,
+ 0x73f8, 0x73f9, 0x73fa, 0x73fb, 0x73fc, 0x73fd, 0x73fe, 0x73ff,
+ 0x7400, 0x7401, 0x7402, 0x7403, 0x7404, 0x7405, 0x7406, 0x7407,
+ 0x7408, 0x7409, 0x740a, 0x740b, 0x740c, 0x740d, 0x740e, 0x740f,
+ 0x7410, 0x7411, 0x7412, 0x7413, 0x7414, 0x7415, 0x7416, 0x7417,
+ 0x7418, 0x7419, 0x741a, 0x741b, 0x741c, 0x741d, 0x741e, 0x741f,
+ 0x7420, 0x7421, 0x7422, 0x7423, 0x7424, 0x7425, 0x7426, 0x7427,
+ 0x7428, 0x7429, 0x742a, 0x742b, 0x742c, 0x742d, 0x742e, 0x742f,
+ 0x7430, 0x7431, 0x7432, 0x7433, 0x7434, 0x7435, 0x7436, 0x7437,
+ 0x7438, 0x7439, 0x743a, 0x743b, 0x743c, 0x743d, 0x743e, 0x743f,
+ 0x7440, 0x7441, 0x7442, 0x7443, 0x7444, 0x7445, 0x7446, 0x7447,
+ 0x7448, 0x7449, 0x744a, 0x744b, 0x744c, 0x744d, 0x744e, 0x744f,
+ 0x7450, 0x7451, 0x7452, 0x7453, 0x7454, 0x7455, 0x7456, 0x7457,
+ 0x7458, 0x7459, 0x745a, 0x745b, 0x745c, 0x745d, 0x745e, 0x745f,
+ 0x7460, 0x7461, 0x7462, 0x7463, 0x7464, 0x7465, 0x7466, 0x7467,
+ 0x7468, 0x7469, 0x746a, 0x746b, 0x746c, 0x746d, 0x746e, 0x746f,
+ 0x7470, 0x7471, 0x7472, 0x7473, 0x7474, 0x7475, 0x7476, 0x7477,
+ 0x7478, 0x7479, 0x747a, 0x747b, 0x747c, 0x747d, 0x747e, 0x747f,
+ 0x7480, 0x7481, 0x7482, 0x7483, 0x7484, 0x7485, 0x7486, 0x7487,
+ 0x7488, 0x7489, 0x748a, 0x748b, 0x748c, 0x748d, 0x748e, 0x748f,
+ 0x7490, 0x7491, 0x7492, 0x7493, 0x7494, 0x7495, 0x7496, 0x7497,
+ 0x7498, 0x7499, 0x749a, 0x749b, 0x749c, 0x749d, 0x749e, 0x749f,
+ 0x74a0, 0x74a1, 0x74a2, 0x74a3, 0x74a4, 0x74a5, 0x74a6, 0x74a7,
+ 0x74a8, 0x74a9, 0x74aa, 0x74ab, 0x74ac, 0x74ad, 0x74ae, 0x74af,
+ 0x74b0, 0x74b1, 0x74b2, 0x74b3, 0x74b4, 0x74b5, 0x74b6, 0x74b7,
+ 0x74b8, 0x74b9, 0x74ba, 0x74bb, 0x74bc, 0x74bd, 0x74be, 0x74bf,
+ 0x74c0, 0x74c1, 0x74c2, 0x74c3, 0x74c4, 0x74c5, 0x74c6, 0x74c7,
+ 0x74c8, 0x74c9, 0x74ca, 0x74cb, 0x74cc, 0x74cd, 0x74ce, 0x74cf,
+ 0x74d0, 0x74d1, 0x74d2, 0x74d3, 0x74d4, 0x74d5, 0x74d6, 0x74d7,
+ 0x74d8, 0x74d9, 0x74da, 0x74db, 0x74dc, 0x74dd, 0x74de, 0x74df,
+ 0x74e0, 0x74e1, 0x74e2, 0x74e3, 0x74e4, 0x74e5, 0x74e6, 0x74e7,
+ 0x74e8, 0x74e9, 0x74ea, 0x74eb, 0x74ec, 0x74ed, 0x74ee, 0x74ef,
+ 0x74f0, 0x74f1, 0x74f2, 0x74f3, 0x74f4, 0x74f5, 0x74f6, 0x74f7,
+ 0x74f8, 0x74f9, 0x74fa, 0x74fb, 0x74fc, 0x74fd, 0x74fe, 0x74ff,
+ 0x7500, 0x7501, 0x7502, 0x7503, 0x7504, 0x7505, 0x7506, 0x7507,
+ 0x7508, 0x7509, 0x750a, 0x750b, 0x750c, 0x750d, 0x750e, 0x750f,
+ 0x7510, 0x7511, 0x7512, 0x7513, 0x7514, 0x7515, 0x7516, 0x7517,
+ 0x7518, 0x7519, 0x751a, 0x751b, 0x751c, 0x751d, 0x751e, 0x751f,
+ 0x7520, 0x7521, 0x7522, 0x7523, 0x7524, 0x7525, 0x7526, 0x7527,
+ 0x7528, 0x7529, 0x752a, 0x752b, 0x752c, 0x752d, 0x752e, 0x752f,
+ 0x7530, 0x7531, 0x7532, 0x7533, 0x7534, 0x7535, 0x7536, 0x7537,
+ 0x7538, 0x7539, 0x753a, 0x753b, 0x753c, 0x753d, 0x753e, 0x753f,
+ 0x7540, 0x7541, 0x7542, 0x7543, 0x7544, 0x7545, 0x7546, 0x7547,
+ 0x7548, 0x7549, 0x754a, 0x754b, 0x754c, 0x754d, 0x754e, 0x754f,
+ 0x7550, 0x7551, 0x7552, 0x7553, 0x7554, 0x7555, 0x7556, 0x7557,
+ 0x7558, 0x7559, 0x755a, 0x755b, 0x755c, 0x755d, 0x755e, 0x755f,
+ 0x7560, 0x7561, 0x7562, 0x7563, 0x7564, 0x7565, 0x7566, 0x7567,
+ 0x7568, 0x7569, 0x756a, 0x756b, 0x756c, 0x756d, 0x756e, 0x756f,
+ 0x7570, 0x7571, 0x7572, 0x7573, 0x7574, 0x7575, 0x7576, 0x7577,
+ 0x7578, 0x7579, 0x757a, 0x757b, 0x757c, 0x757d, 0x757e, 0x757f,
+ 0x7580, 0x7581, 0x7582, 0x7583, 0x7584, 0x7585, 0x7586, 0x7587,
+ 0x7588, 0x7589, 0x758a, 0x758b, 0x758c, 0x758d, 0x758e, 0x758f,
+ 0x7590, 0x7591, 0x7592, 0x7593, 0x7594, 0x7595, 0x7596, 0x7597,
+ 0x7598, 0x7599, 0x759a, 0x759b, 0x759c, 0x759d, 0x759e, 0x759f,
+ 0x75a0, 0x75a1, 0x75a2, 0x75a3, 0x75a4, 0x75a5, 0x75a6, 0x75a7,
+ 0x75a8, 0x75a9, 0x75aa, 0x75ab, 0x75ac, 0x75ad, 0x75ae, 0x75af,
+ 0x75b0, 0x75b1, 0x75b2, 0x75b3, 0x75b4, 0x75b5, 0x75b6, 0x75b7,
+ 0x75b8, 0x75b9, 0x75ba, 0x75bb, 0x75bc, 0x75bd, 0x75be, 0x75bf,
+ 0x75c0, 0x75c1, 0x75c2, 0x75c3, 0x75c4, 0x75c5, 0x75c6, 0x75c7,
+ 0x75c8, 0x75c9, 0x75ca, 0x75cb, 0x75cc, 0x75cd, 0x75ce, 0x75cf,
+ 0x75d0, 0x75d1, 0x75d2, 0x75d3, 0x75d4, 0x75d5, 0x75d6, 0x75d7,
+ 0x75d8, 0x75d9, 0x75da, 0x75db, 0x75dc, 0x75dd, 0x75de, 0x75df,
+ 0x75e0, 0x75e1, 0x75e2, 0x75e3, 0x75e4, 0x75e5, 0x75e6, 0x75e7,
+ 0x75e8, 0x75e9, 0x75ea, 0x75eb, 0x75ec, 0x75ed, 0x75ee, 0x75ef,
+ 0x75f0, 0x75f1, 0x75f2, 0x75f3, 0x75f4, 0x75f5, 0x75f6, 0x75f7,
+ 0x75f8, 0x75f9, 0x75fa, 0x75fb, 0x75fc, 0x75fd, 0x75fe, 0x75ff,
+ 0x7600, 0x7601, 0x7602, 0x7603, 0x7604, 0x7605, 0x7606, 0x7607,
+ 0x7608, 0x7609, 0x760a, 0x760b, 0x760c, 0x760d, 0x760e, 0x760f,
+ 0x7610, 0x7611, 0x7612, 0x7613, 0x7614, 0x7615, 0x7616, 0x7617,
+ 0x7618, 0x7619, 0x761a, 0x761b, 0x761c, 0x761d, 0x761e, 0x761f,
+ 0x7620, 0x7621, 0x7622, 0x7623, 0x7624, 0x7625, 0x7626, 0x7627,
+ 0x7628, 0x7629, 0x762a, 0x762b, 0x762c, 0x762d, 0x762e, 0x762f,
+ 0x7630, 0x7631, 0x7632, 0x7633, 0x7634, 0x7635, 0x7636, 0x7637,
+ 0x7638, 0x7639, 0x763a, 0x763b, 0x763c, 0x763d, 0x763e, 0x763f,
+ 0x7640, 0x7641, 0x7642, 0x7643, 0x7644, 0x7645, 0x7646, 0x7647,
+ 0x7648, 0x7649, 0x764a, 0x764b, 0x764c, 0x764d, 0x764e, 0x764f,
+ 0x7650, 0x7651, 0x7652, 0x7653, 0x7654, 0x7655, 0x7656, 0x7657,
+ 0x7658, 0x7659, 0x765a, 0x765b, 0x765c, 0x765d, 0x765e, 0x765f,
+ 0x7660, 0x7661, 0x7662, 0x7663, 0x7664, 0x7665, 0x7666, 0x7667,
+ 0x7668, 0x7669, 0x766a, 0x766b, 0x766c, 0x766d, 0x766e, 0x766f,
+ 0x7670, 0x7671, 0x7672, 0x7673, 0x7674, 0x7675, 0x7676, 0x7677,
+ 0x7678, 0x7679, 0x767a, 0x767b, 0x767c, 0x767d, 0x767e, 0x767f,
+ 0x7680, 0x7681, 0x7682, 0x7683, 0x7684, 0x7685, 0x7686, 0x7687,
+ 0x7688, 0x7689, 0x768a, 0x768b, 0x768c, 0x768d, 0x768e, 0x768f,
+ 0x7690, 0x7691, 0x7692, 0x7693, 0x7694, 0x7695, 0x7696, 0x7697,
+ 0x7698, 0x7699, 0x769a, 0x769b, 0x769c, 0x769d, 0x769e, 0x769f,
+ 0x76a0, 0x76a1, 0x76a2, 0x76a3, 0x76a4, 0x76a5, 0x76a6, 0x76a7,
+ 0x76a8, 0x76a9, 0x76aa, 0x76ab, 0x76ac, 0x76ad, 0x76ae, 0x76af,
+ 0x76b0, 0x76b1, 0x76b2, 0x76b3, 0x76b4, 0x76b5, 0x76b6, 0x76b7,
+ 0x76b8, 0x76b9, 0x76ba, 0x76bb, 0x76bc, 0x76bd, 0x76be, 0x76bf,
+ 0x76c0, 0x76c1, 0x76c2, 0x76c3, 0x76c4, 0x76c5, 0x76c6, 0x76c7,
+ 0x76c8, 0x76c9, 0x76ca, 0x76cb, 0x76cc, 0x76cd, 0x76ce, 0x76cf,
+ 0x76d0, 0x76d1, 0x76d2, 0x76d3, 0x76d4, 0x76d5, 0x76d6, 0x76d7,
+ 0x76d8, 0x76d9, 0x76da, 0x76db, 0x76dc, 0x76dd, 0x76de, 0x76df,
+ 0x76e0, 0x76e1, 0x76e2, 0x76e3, 0x76e4, 0x76e5, 0x76e6, 0x76e7,
+ 0x76e8, 0x76e9, 0x76ea, 0x76eb, 0x76ec, 0x76ed, 0x76ee, 0x76ef,
+ 0x76f0, 0x76f1, 0x76f2, 0x76f3, 0x76f4, 0x76f5, 0x76f6, 0x76f7,
+ 0x76f8, 0x76f9, 0x76fa, 0x76fb, 0x76fc, 0x76fd, 0x76fe, 0x76ff,
+ 0x7700, 0x7701, 0x7702, 0x7703, 0x7704, 0x7705, 0x7706, 0x7707,
+ 0x7708, 0x7709, 0x770a, 0x770b, 0x770c, 0x770d, 0x770e, 0x770f,
+ 0x7710, 0x7711, 0x7712, 0x7713, 0x7714, 0x7715, 0x7716, 0x7717,
+ 0x7718, 0x7719, 0x771a, 0x771b, 0x771c, 0x771d, 0x771e, 0x771f,
+ 0x7720, 0x7721, 0x7722, 0x7723, 0x7724, 0x7725, 0x7726, 0x7727,
+ 0x7728, 0x7729, 0x772a, 0x772b, 0x772c, 0x772d, 0x772e, 0x772f,
+ 0x7730, 0x7731, 0x7732, 0x7733, 0x7734, 0x7735, 0x7736, 0x7737,
+ 0x7738, 0x7739, 0x773a, 0x773b, 0x773c, 0x773d, 0x773e, 0x773f,
+ 0x7740, 0x7741, 0x7742, 0x7743, 0x7744, 0x7745, 0x7746, 0x7747,
+ 0x7748, 0x7749, 0x774a, 0x774b, 0x774c, 0x774d, 0x774e, 0x774f,
+ 0x7750, 0x7751, 0x7752, 0x7753, 0x7754, 0x7755, 0x7756, 0x7757,
+ 0x7758, 0x7759, 0x775a, 0x775b, 0x775c, 0x775d, 0x775e, 0x775f,
+ 0x7760, 0x7761, 0x7762, 0x7763, 0x7764, 0x7765, 0x7766, 0x7767,
+ 0x7768, 0x7769, 0x776a, 0x776b, 0x776c, 0x776d, 0x776e, 0x776f,
+ 0x7770, 0x7771, 0x7772, 0x7773, 0x7774, 0x7775, 0x7776, 0x7777,
+ 0x7778, 0x7779, 0x777a, 0x777b, 0x777c, 0x777d, 0x777e, 0x777f,
+ 0x7780, 0x7781, 0x7782, 0x7783, 0x7784, 0x7785, 0x7786, 0x7787,
+ 0x7788, 0x7789, 0x778a, 0x778b, 0x778c, 0x778d, 0x778e, 0x778f,
+ 0x7790, 0x7791, 0x7792, 0x7793, 0x7794, 0x7795, 0x7796, 0x7797,
+ 0x7798, 0x7799, 0x779a, 0x779b, 0x779c, 0x779d, 0x779e, 0x779f,
+ 0x77a0, 0x77a1, 0x77a2, 0x77a3, 0x77a4, 0x77a5, 0x77a6, 0x77a7,
+ 0x77a8, 0x77a9, 0x77aa, 0x77ab, 0x77ac, 0x77ad, 0x77ae, 0x77af,
+ 0x77b0, 0x77b1, 0x77b2, 0x77b3, 0x77b4, 0x77b5, 0x77b6, 0x77b7,
+ 0x77b8, 0x77b9, 0x77ba, 0x77bb, 0x77bc, 0x77bd, 0x77be, 0x77bf,
+ 0x77c0, 0x77c1, 0x77c2, 0x77c3, 0x77c4, 0x77c5, 0x77c6, 0x77c7,
+ 0x77c8, 0x77c9, 0x77ca, 0x77cb, 0x77cc, 0x77cd, 0x77ce, 0x77cf,
+ 0x77d0, 0x77d1, 0x77d2, 0x77d3, 0x77d4, 0x77d5, 0x77d6, 0x77d7,
+ 0x77d8, 0x77d9, 0x77da, 0x77db, 0x77dc, 0x77dd, 0x77de, 0x77df,
+ 0x77e0, 0x77e1, 0x77e2, 0x77e3, 0x77e4, 0x77e5, 0x77e6, 0x77e7,
+ 0x77e8, 0x77e9, 0x77ea, 0x77eb, 0x77ec, 0x77ed, 0x77ee, 0x77ef,
+ 0x77f0, 0x77f1, 0x77f2, 0x77f3, 0x77f4, 0x77f5, 0x77f6, 0x77f7,
+ 0x77f8, 0x77f9, 0x77fa, 0x77fb, 0x77fc, 0x77fd, 0x77fe, 0x77ff,
+ 0x7800, 0x7801, 0x7802, 0x7803, 0x7804, 0x7805, 0x7806, 0x7807,
+ 0x7808, 0x7809, 0x780a, 0x780b, 0x780c, 0x780d, 0x780e, 0x780f,
+ 0x7810, 0x7811, 0x7812, 0x7813, 0x7814, 0x7815, 0x7816, 0x7817,
+ 0x7818, 0x7819, 0x781a, 0x781b, 0x781c, 0x781d, 0x781e, 0x781f,
+ 0x7820, 0x7821, 0x7822, 0x7823, 0x7824, 0x7825, 0x7826, 0x7827,
+ 0x7828, 0x7829, 0x782a, 0x782b, 0x782c, 0x782d, 0x782e, 0x782f,
+ 0x7830, 0x7831, 0x7832, 0x7833, 0x7834, 0x7835, 0x7836, 0x7837,
+ 0x7838, 0x7839, 0x783a, 0x783b, 0x783c, 0x783d, 0x783e, 0x783f,
+ 0x7840, 0x7841, 0x7842, 0x7843, 0x7844, 0x7845, 0x7846, 0x7847,
+ 0x7848, 0x7849, 0x784a, 0x784b, 0x784c, 0x784d, 0x784e, 0x784f,
+ 0x7850, 0x7851, 0x7852, 0x7853, 0x7854, 0x7855, 0x7856, 0x7857,
+ 0x7858, 0x7859, 0x785a, 0x785b, 0x785c, 0x785d, 0x785e, 0x785f,
+ 0x7860, 0x7861, 0x7862, 0x7863, 0x7864, 0x7865, 0x7866, 0x7867,
+ 0x7868, 0x7869, 0x786a, 0x786b, 0x786c, 0x786d, 0x786e, 0x786f,
+ 0x7870, 0x7871, 0x7872, 0x7873, 0x7874, 0x7875, 0x7876, 0x7877,
+ 0x7878, 0x7879, 0x787a, 0x787b, 0x787c, 0x787d, 0x787e, 0x787f,
+ 0x7880, 0x7881, 0x7882, 0x7883, 0x7884, 0x7885, 0x7886, 0x7887,
+ 0x7888, 0x7889, 0x788a, 0x788b, 0x788c, 0x788d, 0x788e, 0x788f,
+ 0x7890, 0x7891, 0x7892, 0x7893, 0x7894, 0x7895, 0x7896, 0x7897,
+ 0x7898, 0x7899, 0x789a, 0x789b, 0x789c, 0x789d, 0x789e, 0x789f,
+ 0x78a0, 0x78a1, 0x78a2, 0x78a3, 0x78a4, 0x78a5, 0x78a6, 0x78a7,
+ 0x78a8, 0x78a9, 0x78aa, 0x78ab, 0x78ac, 0x78ad, 0x78ae, 0x78af,
+ 0x78b0, 0x78b1, 0x78b2, 0x78b3, 0x78b4, 0x78b5, 0x78b6, 0x78b7,
+ 0x78b8, 0x78b9, 0x78ba, 0x78bb, 0x78bc, 0x78bd, 0x78be, 0x78bf,
+ 0x78c0, 0x78c1, 0x78c2, 0x78c3, 0x78c4, 0x78c5, 0x78c6, 0x78c7,
+ 0x78c8, 0x78c9, 0x78ca, 0x78cb, 0x78cc, 0x78cd, 0x78ce, 0x78cf,
+ 0x78d0, 0x78d1, 0x78d2, 0x78d3, 0x78d4, 0x78d5, 0x78d6, 0x78d7,
+ 0x78d8, 0x78d9, 0x78da, 0x78db, 0x78dc, 0x78dd, 0x78de, 0x78df,
+ 0x78e0, 0x78e1, 0x78e2, 0x78e3, 0x78e4, 0x78e5, 0x78e6, 0x78e7,
+ 0x78e8, 0x78e9, 0x78ea, 0x78eb, 0x78ec, 0x78ed, 0x78ee, 0x78ef,
+ 0x78f0, 0x78f1, 0x78f2, 0x78f3, 0x78f4, 0x78f5, 0x78f6, 0x78f7,
+ 0x78f8, 0x78f9, 0x78fa, 0x78fb, 0x78fc, 0x78fd, 0x78fe, 0x78ff,
+ 0x7900, 0x7901, 0x7902, 0x7903, 0x7904, 0x7905, 0x7906, 0x7907,
+ 0x7908, 0x7909, 0x790a, 0x790b, 0x790c, 0x790d, 0x790e, 0x790f,
+ 0x7910, 0x7911, 0x7912, 0x7913, 0x7914, 0x7915, 0x7916, 0x7917,
+ 0x7918, 0x7919, 0x791a, 0x791b, 0x791c, 0x791d, 0x791e, 0x791f,
+ 0x7920, 0x7921, 0x7922, 0x7923, 0x7924, 0x7925, 0x7926, 0x7927,
+ 0x7928, 0x7929, 0x792a, 0x792b, 0x792c, 0x792d, 0x792e, 0x792f,
+ 0x7930, 0x7931, 0x7932, 0x7933, 0x7934, 0x7935, 0x7936, 0x7937,
+ 0x7938, 0x7939, 0x793a, 0x793b, 0x793c, 0x793d, 0x793e, 0x793f,
+ 0x7940, 0x7941, 0x7942, 0x7943, 0x7944, 0x7945, 0x7946, 0x7947,
+ 0x7948, 0x7949, 0x794a, 0x794b, 0x794c, 0x794d, 0x794e, 0x794f,
+ 0x7950, 0x7951, 0x7952, 0x7953, 0x7954, 0x7955, 0x7956, 0x7957,
+ 0x7958, 0x7959, 0x795a, 0x795b, 0x795c, 0x795d, 0x795e, 0x795f,
+ 0x7960, 0x7961, 0x7962, 0x7963, 0x7964, 0x7965, 0x7966, 0x7967,
+ 0x7968, 0x7969, 0x796a, 0x796b, 0x796c, 0x796d, 0x796e, 0x796f,
+ 0x7970, 0x7971, 0x7972, 0x7973, 0x7974, 0x7975, 0x7976, 0x7977,
+ 0x7978, 0x7979, 0x797a, 0x797b, 0x797c, 0x797d, 0x797e, 0x797f,
+ 0x7980, 0x7981, 0x7982, 0x7983, 0x7984, 0x7985, 0x7986, 0x7987,
+ 0x7988, 0x7989, 0x798a, 0x798b, 0x798c, 0x798d, 0x798e, 0x798f,
+ 0x7990, 0x7991, 0x7992, 0x7993, 0x7994, 0x7995, 0x7996, 0x7997,
+ 0x7998, 0x7999, 0x799a, 0x799b, 0x799c, 0x799d, 0x799e, 0x799f,
+ 0x79a0, 0x79a1, 0x79a2, 0x79a3, 0x79a4, 0x79a5, 0x79a6, 0x79a7,
+ 0x79a8, 0x79a9, 0x79aa, 0x79ab, 0x79ac, 0x79ad, 0x79ae, 0x79af,
+ 0x79b0, 0x79b1, 0x79b2, 0x79b3, 0x79b4, 0x79b5, 0x79b6, 0x79b7,
+ 0x79b8, 0x79b9, 0x79ba, 0x79bb, 0x79bc, 0x79bd, 0x79be, 0x79bf,
+ 0x79c0, 0x79c1, 0x79c2, 0x79c3, 0x79c4, 0x79c5, 0x79c6, 0x79c7,
+ 0x79c8, 0x79c9, 0x79ca, 0x79cb, 0x79cc, 0x79cd, 0x79ce, 0x79cf,
+ 0x79d0, 0x79d1, 0x79d2, 0x79d3, 0x79d4, 0x79d5, 0x79d6, 0x79d7,
+ 0x79d8, 0x79d9, 0x79da, 0x79db, 0x79dc, 0x79dd, 0x79de, 0x79df,
+ 0x79e0, 0x79e1, 0x79e2, 0x79e3, 0x79e4, 0x79e5, 0x79e6, 0x79e7,
+ 0x79e8, 0x79e9, 0x79ea, 0x79eb, 0x79ec, 0x79ed, 0x79ee, 0x79ef,
+ 0x79f0, 0x79f1, 0x79f2, 0x79f3, 0x79f4, 0x79f5, 0x79f6, 0x79f7,
+ 0x79f8, 0x79f9, 0x79fa, 0x79fb, 0x79fc, 0x79fd, 0x79fe, 0x79ff,
+ 0x7a00, 0x7a01, 0x7a02, 0x7a03, 0x7a04, 0x7a05, 0x7a06, 0x7a07,
+ 0x7a08, 0x7a09, 0x7a0a, 0x7a0b, 0x7a0c, 0x7a0d, 0x7a0e, 0x7a0f,
+ 0x7a10, 0x7a11, 0x7a12, 0x7a13, 0x7a14, 0x7a15, 0x7a16, 0x7a17,
+ 0x7a18, 0x7a19, 0x7a1a, 0x7a1b, 0x7a1c, 0x7a1d, 0x7a1e, 0x7a1f,
+ 0x7a20, 0x7a21, 0x7a22, 0x7a23, 0x7a24, 0x7a25, 0x7a26, 0x7a27,
+ 0x7a28, 0x7a29, 0x7a2a, 0x7a2b, 0x7a2c, 0x7a2d, 0x7a2e, 0x7a2f,
+ 0x7a30, 0x7a31, 0x7a32, 0x7a33, 0x7a34, 0x7a35, 0x7a36, 0x7a37,
+ 0x7a38, 0x7a39, 0x7a3a, 0x7a3b, 0x7a3c, 0x7a3d, 0x7a3e, 0x7a3f,
+ 0x7a40, 0x7a41, 0x7a42, 0x7a43, 0x7a44, 0x7a45, 0x7a46, 0x7a47,
+ 0x7a48, 0x7a49, 0x7a4a, 0x7a4b, 0x7a4c, 0x7a4d, 0x7a4e, 0x7a4f,
+ 0x7a50, 0x7a51, 0x7a52, 0x7a53, 0x7a54, 0x7a55, 0x7a56, 0x7a57,
+ 0x7a58, 0x7a59, 0x7a5a, 0x7a5b, 0x7a5c, 0x7a5d, 0x7a5e, 0x7a5f,
+ 0x7a60, 0x7a61, 0x7a62, 0x7a63, 0x7a64, 0x7a65, 0x7a66, 0x7a67,
+ 0x7a68, 0x7a69, 0x7a6a, 0x7a6b, 0x7a6c, 0x7a6d, 0x7a6e, 0x7a6f,
+ 0x7a70, 0x7a71, 0x7a72, 0x7a73, 0x7a74, 0x7a75, 0x7a76, 0x7a77,
+ 0x7a78, 0x7a79, 0x7a7a, 0x7a7b, 0x7a7c, 0x7a7d, 0x7a7e, 0x7a7f,
+ 0x7a80, 0x7a81, 0x7a82, 0x7a83, 0x7a84, 0x7a85, 0x7a86, 0x7a87,
+ 0x7a88, 0x7a89, 0x7a8a, 0x7a8b, 0x7a8c, 0x7a8d, 0x7a8e, 0x7a8f,
+ 0x7a90, 0x7a91, 0x7a92, 0x7a93, 0x7a94, 0x7a95, 0x7a96, 0x7a97,
+ 0x7a98, 0x7a99, 0x7a9a, 0x7a9b, 0x7a9c, 0x7a9d, 0x7a9e, 0x7a9f,
+ 0x7aa0, 0x7aa1, 0x7aa2, 0x7aa3, 0x7aa4, 0x7aa5, 0x7aa6, 0x7aa7,
+ 0x7aa8, 0x7aa9, 0x7aaa, 0x7aab, 0x7aac, 0x7aad, 0x7aae, 0x7aaf,
+ 0x7ab0, 0x7ab1, 0x7ab2, 0x7ab3, 0x7ab4, 0x7ab5, 0x7ab6, 0x7ab7,
+ 0x7ab8, 0x7ab9, 0x7aba, 0x7abb, 0x7abc, 0x7abd, 0x7abe, 0x7abf,
+ 0x7ac0, 0x7ac1, 0x7ac2, 0x7ac3, 0x7ac4, 0x7ac5, 0x7ac6, 0x7ac7,
+ 0x7ac8, 0x7ac9, 0x7aca, 0x7acb, 0x7acc, 0x7acd, 0x7ace, 0x7acf,
+ 0x7ad0, 0x7ad1, 0x7ad2, 0x7ad3, 0x7ad4, 0x7ad5, 0x7ad6, 0x7ad7,
+ 0x7ad8, 0x7ad9, 0x7ada, 0x7adb, 0x7adc, 0x7add, 0x7ade, 0x7adf,
+ 0x7ae0, 0x7ae1, 0x7ae2, 0x7ae3, 0x7ae4, 0x7ae5, 0x7ae6, 0x7ae7,
+ 0x7ae8, 0x7ae9, 0x7aea, 0x7aeb, 0x7aec, 0x7aed, 0x7aee, 0x7aef,
+ 0x7af0, 0x7af1, 0x7af2, 0x7af3, 0x7af4, 0x7af5, 0x7af6, 0x7af7,
+ 0x7af8, 0x7af9, 0x7afa, 0x7afb, 0x7afc, 0x7afd, 0x7afe, 0x7aff,
+ 0x7b00, 0x7b01, 0x7b02, 0x7b03, 0x7b04, 0x7b05, 0x7b06, 0x7b07,
+ 0x7b08, 0x7b09, 0x7b0a, 0x7b0b, 0x7b0c, 0x7b0d, 0x7b0e, 0x7b0f,
+ 0x7b10, 0x7b11, 0x7b12, 0x7b13, 0x7b14, 0x7b15, 0x7b16, 0x7b17,
+ 0x7b18, 0x7b19, 0x7b1a, 0x7b1b, 0x7b1c, 0x7b1d, 0x7b1e, 0x7b1f,
+ 0x7b20, 0x7b21, 0x7b22, 0x7b23, 0x7b24, 0x7b25, 0x7b26, 0x7b27,
+ 0x7b28, 0x7b29, 0x7b2a, 0x7b2b, 0x7b2c, 0x7b2d, 0x7b2e, 0x7b2f,
+ 0x7b30, 0x7b31, 0x7b32, 0x7b33, 0x7b34, 0x7b35, 0x7b36, 0x7b37,
+ 0x7b38, 0x7b39, 0x7b3a, 0x7b3b, 0x7b3c, 0x7b3d, 0x7b3e, 0x7b3f,
+ 0x7b40, 0x7b41, 0x7b42, 0x7b43, 0x7b44, 0x7b45, 0x7b46, 0x7b47,
+ 0x7b48, 0x7b49, 0x7b4a, 0x7b4b, 0x7b4c, 0x7b4d, 0x7b4e, 0x7b4f,
+ 0x7b50, 0x7b51, 0x7b52, 0x7b53, 0x7b54, 0x7b55, 0x7b56, 0x7b57,
+ 0x7b58, 0x7b59, 0x7b5a, 0x7b5b, 0x7b5c, 0x7b5d, 0x7b5e, 0x7b5f,
+ 0x7b60, 0x7b61, 0x7b62, 0x7b63, 0x7b64, 0x7b65, 0x7b66, 0x7b67,
+ 0x7b68, 0x7b69, 0x7b6a, 0x7b6b, 0x7b6c, 0x7b6d, 0x7b6e, 0x7b6f,
+ 0x7b70, 0x7b71, 0x7b72, 0x7b73, 0x7b74, 0x7b75, 0x7b76, 0x7b77,
+ 0x7b78, 0x7b79, 0x7b7a, 0x7b7b, 0x7b7c, 0x7b7d, 0x7b7e, 0x7b7f,
+ 0x7b80, 0x7b81, 0x7b82, 0x7b83, 0x7b84, 0x7b85, 0x7b86, 0x7b87,
+ 0x7b88, 0x7b89, 0x7b8a, 0x7b8b, 0x7b8c, 0x7b8d, 0x7b8e, 0x7b8f,
+ 0x7b90, 0x7b91, 0x7b92, 0x7b93, 0x7b94, 0x7b95, 0x7b96, 0x7b97,
+ 0x7b98, 0x7b99, 0x7b9a, 0x7b9b, 0x7b9c, 0x7b9d, 0x7b9e, 0x7b9f,
+ 0x7ba0, 0x7ba1, 0x7ba2, 0x7ba3, 0x7ba4, 0x7ba5, 0x7ba6, 0x7ba7,
+ 0x7ba8, 0x7ba9, 0x7baa, 0x7bab, 0x7bac, 0x7bad, 0x7bae, 0x7baf,
+ 0x7bb0, 0x7bb1, 0x7bb2, 0x7bb3, 0x7bb4, 0x7bb5, 0x7bb6, 0x7bb7,
+ 0x7bb8, 0x7bb9, 0x7bba, 0x7bbb, 0x7bbc, 0x7bbd, 0x7bbe, 0x7bbf,
+ 0x7bc0, 0x7bc1, 0x7bc2, 0x7bc3, 0x7bc4, 0x7bc5, 0x7bc6, 0x7bc7,
+ 0x7bc8, 0x7bc9, 0x7bca, 0x7bcb, 0x7bcc, 0x7bcd, 0x7bce, 0x7bcf,
+ 0x7bd0, 0x7bd1, 0x7bd2, 0x7bd3, 0x7bd4, 0x7bd5, 0x7bd6, 0x7bd7,
+ 0x7bd8, 0x7bd9, 0x7bda, 0x7bdb, 0x7bdc, 0x7bdd, 0x7bde, 0x7bdf,
+ 0x7be0, 0x7be1, 0x7be2, 0x7be3, 0x7be4, 0x7be5, 0x7be6, 0x7be7,
+ 0x7be8, 0x7be9, 0x7bea, 0x7beb, 0x7bec, 0x7bed, 0x7bee, 0x7bef,
+ 0x7bf0, 0x7bf1, 0x7bf2, 0x7bf3, 0x7bf4, 0x7bf5, 0x7bf6, 0x7bf7,
+ 0x7bf8, 0x7bf9, 0x7bfa, 0x7bfb, 0x7bfc, 0x7bfd, 0x7bfe, 0x7bff,
+ 0x7c00, 0x7c01, 0x7c02, 0x7c03, 0x7c04, 0x7c05, 0x7c06, 0x7c07,
+ 0x7c08, 0x7c09, 0x7c0a, 0x7c0b, 0x7c0c, 0x7c0d, 0x7c0e, 0x7c0f,
+ 0x7c10, 0x7c11, 0x7c12, 0x7c13, 0x7c14, 0x7c15, 0x7c16, 0x7c17,
+ 0x7c18, 0x7c19, 0x7c1a, 0x7c1b, 0x7c1c, 0x7c1d, 0x7c1e, 0x7c1f,
+ 0x7c20, 0x7c21, 0x7c22, 0x7c23, 0x7c24, 0x7c25, 0x7c26, 0x7c27,
+ 0x7c28, 0x7c29, 0x7c2a, 0x7c2b, 0x7c2c, 0x7c2d, 0x7c2e, 0x7c2f,
+ 0x7c30, 0x7c31, 0x7c32, 0x7c33, 0x7c34, 0x7c35, 0x7c36, 0x7c37,
+ 0x7c38, 0x7c39, 0x7c3a, 0x7c3b, 0x7c3c, 0x7c3d, 0x7c3e, 0x7c3f,
+ 0x7c40, 0x7c41, 0x7c42, 0x7c43, 0x7c44, 0x7c45, 0x7c46, 0x7c47,
+ 0x7c48, 0x7c49, 0x7c4a, 0x7c4b, 0x7c4c, 0x7c4d, 0x7c4e, 0x7c4f,
+ 0x7c50, 0x7c51, 0x7c52, 0x7c53, 0x7c54, 0x7c55, 0x7c56, 0x7c57,
+ 0x7c58, 0x7c59, 0x7c5a, 0x7c5b, 0x7c5c, 0x7c5d, 0x7c5e, 0x7c5f,
+ 0x7c60, 0x7c61, 0x7c62, 0x7c63, 0x7c64, 0x7c65, 0x7c66, 0x7c67,
+ 0x7c68, 0x7c69, 0x7c6a, 0x7c6b, 0x7c6c, 0x7c6d, 0x7c6e, 0x7c6f,
+ 0x7c70, 0x7c71, 0x7c72, 0x7c73, 0x7c74, 0x7c75, 0x7c76, 0x7c77,
+ 0x7c78, 0x7c79, 0x7c7a, 0x7c7b, 0x7c7c, 0x7c7d, 0x7c7e, 0x7c7f,
+ 0x7c80, 0x7c81, 0x7c82, 0x7c83, 0x7c84, 0x7c85, 0x7c86, 0x7c87,
+ 0x7c88, 0x7c89, 0x7c8a, 0x7c8b, 0x7c8c, 0x7c8d, 0x7c8e, 0x7c8f,
+ 0x7c90, 0x7c91, 0x7c92, 0x7c93, 0x7c94, 0x7c95, 0x7c96, 0x7c97,
+ 0x7c98, 0x7c99, 0x7c9a, 0x7c9b, 0x7c9c, 0x7c9d, 0x7c9e, 0x7c9f,
+ 0x7ca0, 0x7ca1, 0x7ca2, 0x7ca3, 0x7ca4, 0x7ca5, 0x7ca6, 0x7ca7,
+ 0x7ca8, 0x7ca9, 0x7caa, 0x7cab, 0x7cac, 0x7cad, 0x7cae, 0x7caf,
+ 0x7cb0, 0x7cb1, 0x7cb2, 0x7cb3, 0x7cb4, 0x7cb5, 0x7cb6, 0x7cb7,
+ 0x7cb8, 0x7cb9, 0x7cba, 0x7cbb, 0x7cbc, 0x7cbd, 0x7cbe, 0x7cbf,
+ 0x7cc0, 0x7cc1, 0x7cc2, 0x7cc3, 0x7cc4, 0x7cc5, 0x7cc6, 0x7cc7,
+ 0x7cc8, 0x7cc9, 0x7cca, 0x7ccb, 0x7ccc, 0x7ccd, 0x7cce, 0x7ccf,
+ 0x7cd0, 0x7cd1, 0x7cd2, 0x7cd3, 0x7cd4, 0x7cd5, 0x7cd6, 0x7cd7,
+ 0x7cd8, 0x7cd9, 0x7cda, 0x7cdb, 0x7cdc, 0x7cdd, 0x7cde, 0x7cdf,
+ 0x7ce0, 0x7ce1, 0x7ce2, 0x7ce3, 0x7ce4, 0x7ce5, 0x7ce6, 0x7ce7,
+ 0x7ce8, 0x7ce9, 0x7cea, 0x7ceb, 0x7cec, 0x7ced, 0x7cee, 0x7cef,
+ 0x7cf0, 0x7cf1, 0x7cf2, 0x7cf3, 0x7cf4, 0x7cf5, 0x7cf6, 0x7cf7,
+ 0x7cf8, 0x7cf9, 0x7cfa, 0x7cfb, 0x7cfc, 0x7cfd, 0x7cfe, 0x7cff,
+ 0x7d00, 0x7d01, 0x7d02, 0x7d03, 0x7d04, 0x7d05, 0x7d06, 0x7d07,
+ 0x7d08, 0x7d09, 0x7d0a, 0x7d0b, 0x7d0c, 0x7d0d, 0x7d0e, 0x7d0f,
+ 0x7d10, 0x7d11, 0x7d12, 0x7d13, 0x7d14, 0x7d15, 0x7d16, 0x7d17,
+ 0x7d18, 0x7d19, 0x7d1a, 0x7d1b, 0x7d1c, 0x7d1d, 0x7d1e, 0x7d1f,
+ 0x7d20, 0x7d21, 0x7d22, 0x7d23, 0x7d24, 0x7d25, 0x7d26, 0x7d27,
+ 0x7d28, 0x7d29, 0x7d2a, 0x7d2b, 0x7d2c, 0x7d2d, 0x7d2e, 0x7d2f,
+ 0x7d30, 0x7d31, 0x7d32, 0x7d33, 0x7d34, 0x7d35, 0x7d36, 0x7d37,
+ 0x7d38, 0x7d39, 0x7d3a, 0x7d3b, 0x7d3c, 0x7d3d, 0x7d3e, 0x7d3f,
+ 0x7d40, 0x7d41, 0x7d42, 0x7d43, 0x7d44, 0x7d45, 0x7d46, 0x7d47,
+ 0x7d48, 0x7d49, 0x7d4a, 0x7d4b, 0x7d4c, 0x7d4d, 0x7d4e, 0x7d4f,
+ 0x7d50, 0x7d51, 0x7d52, 0x7d53, 0x7d54, 0x7d55, 0x7d56, 0x7d57,
+ 0x7d58, 0x7d59, 0x7d5a, 0x7d5b, 0x7d5c, 0x7d5d, 0x7d5e, 0x7d5f,
+ 0x7d60, 0x7d61, 0x7d62, 0x7d63, 0x7d64, 0x7d65, 0x7d66, 0x7d67,
+ 0x7d68, 0x7d69, 0x7d6a, 0x7d6b, 0x7d6c, 0x7d6d, 0x7d6e, 0x7d6f,
+ 0x7d70, 0x7d71, 0x7d72, 0x7d73, 0x7d74, 0x7d75, 0x7d76, 0x7d77,
+ 0x7d78, 0x7d79, 0x7d7a, 0x7d7b, 0x7d7c, 0x7d7d, 0x7d7e, 0x7d7f,
+ 0x7d80, 0x7d81, 0x7d82, 0x7d83, 0x7d84, 0x7d85, 0x7d86, 0x7d87,
+ 0x7d88, 0x7d89, 0x7d8a, 0x7d8b, 0x7d8c, 0x7d8d, 0x7d8e, 0x7d8f,
+ 0x7d90, 0x7d91, 0x7d92, 0x7d93, 0x7d94, 0x7d95, 0x7d96, 0x7d97,
+ 0x7d98, 0x7d99, 0x7d9a, 0x7d9b, 0x7d9c, 0x7d9d, 0x7d9e, 0x7d9f,
+ 0x7da0, 0x7da1, 0x7da2, 0x7da3, 0x7da4, 0x7da5, 0x7da6, 0x7da7,
+ 0x7da8, 0x7da9, 0x7daa, 0x7dab, 0x7dac, 0x7dad, 0x7dae, 0x7daf,
+ 0x7db0, 0x7db1, 0x7db2, 0x7db3, 0x7db4, 0x7db5, 0x7db6, 0x7db7,
+ 0x7db8, 0x7db9, 0x7dba, 0x7dbb, 0x7dbc, 0x7dbd, 0x7dbe, 0x7dbf,
+ 0x7dc0, 0x7dc1, 0x7dc2, 0x7dc3, 0x7dc4, 0x7dc5, 0x7dc6, 0x7dc7,
+ 0x7dc8, 0x7dc9, 0x7dca, 0x7dcb, 0x7dcc, 0x7dcd, 0x7dce, 0x7dcf,
+ 0x7dd0, 0x7dd1, 0x7dd2, 0x7dd3, 0x7dd4, 0x7dd5, 0x7dd6, 0x7dd7,
+ 0x7dd8, 0x7dd9, 0x7dda, 0x7ddb, 0x7ddc, 0x7ddd, 0x7dde, 0x7ddf,
+ 0x7de0, 0x7de1, 0x7de2, 0x7de3, 0x7de4, 0x7de5, 0x7de6, 0x7de7,
+ 0x7de8, 0x7de9, 0x7dea, 0x7deb, 0x7dec, 0x7ded, 0x7dee, 0x7def,
+ 0x7df0, 0x7df1, 0x7df2, 0x7df3, 0x7df4, 0x7df5, 0x7df6, 0x7df7,
+ 0x7df8, 0x7df9, 0x7dfa, 0x7dfb, 0x7dfc, 0x7dfd, 0x7dfe, 0x7dff,
+ 0x7e00, 0x7e01, 0x7e02, 0x7e03, 0x7e04, 0x7e05, 0x7e06, 0x7e07,
+ 0x7e08, 0x7e09, 0x7e0a, 0x7e0b, 0x7e0c, 0x7e0d, 0x7e0e, 0x7e0f,
+ 0x7e10, 0x7e11, 0x7e12, 0x7e13, 0x7e14, 0x7e15, 0x7e16, 0x7e17,
+ 0x7e18, 0x7e19, 0x7e1a, 0x7e1b, 0x7e1c, 0x7e1d, 0x7e1e, 0x7e1f,
+ 0x7e20, 0x7e21, 0x7e22, 0x7e23, 0x7e24, 0x7e25, 0x7e26, 0x7e27,
+ 0x7e28, 0x7e29, 0x7e2a, 0x7e2b, 0x7e2c, 0x7e2d, 0x7e2e, 0x7e2f,
+ 0x7e30, 0x7e31, 0x7e32, 0x7e33, 0x7e34, 0x7e35, 0x7e36, 0x7e37,
+ 0x7e38, 0x7e39, 0x7e3a, 0x7e3b, 0x7e3c, 0x7e3d, 0x7e3e, 0x7e3f,
+ 0x7e40, 0x7e41, 0x7e42, 0x7e43, 0x7e44, 0x7e45, 0x7e46, 0x7e47,
+ 0x7e48, 0x7e49, 0x7e4a, 0x7e4b, 0x7e4c, 0x7e4d, 0x7e4e, 0x7e4f,
+ 0x7e50, 0x7e51, 0x7e52, 0x7e53, 0x7e54, 0x7e55, 0x7e56, 0x7e57,
+ 0x7e58, 0x7e59, 0x7e5a, 0x7e5b, 0x7e5c, 0x7e5d, 0x7e5e, 0x7e5f,
+ 0x7e60, 0x7e61, 0x7e62, 0x7e63, 0x7e64, 0x7e65, 0x7e66, 0x7e67,
+ 0x7e68, 0x7e69, 0x7e6a, 0x7e6b, 0x7e6c, 0x7e6d, 0x7e6e, 0x7e6f,
+ 0x7e70, 0x7e71, 0x7e72, 0x7e73, 0x7e74, 0x7e75, 0x7e76, 0x7e77,
+ 0x7e78, 0x7e79, 0x7e7a, 0x7e7b, 0x7e7c, 0x7e7d, 0x7e7e, 0x7e7f,
+ 0x7e80, 0x7e81, 0x7e82, 0x7e83, 0x7e84, 0x7e85, 0x7e86, 0x7e87,
+ 0x7e88, 0x7e89, 0x7e8a, 0x7e8b, 0x7e8c, 0x7e8d, 0x7e8e, 0x7e8f,
+ 0x7e90, 0x7e91, 0x7e92, 0x7e93, 0x7e94, 0x7e95, 0x7e96, 0x7e97,
+ 0x7e98, 0x7e99, 0x7e9a, 0x7e9b, 0x7e9c, 0x7e9d, 0x7e9e, 0x7e9f,
+ 0x7ea0, 0x7ea1, 0x7ea2, 0x7ea3, 0x7ea4, 0x7ea5, 0x7ea6, 0x7ea7,
+ 0x7ea8, 0x7ea9, 0x7eaa, 0x7eab, 0x7eac, 0x7ead, 0x7eae, 0x7eaf,
+ 0x7eb0, 0x7eb1, 0x7eb2, 0x7eb3, 0x7eb4, 0x7eb5, 0x7eb6, 0x7eb7,
+ 0x7eb8, 0x7eb9, 0x7eba, 0x7ebb, 0x7ebc, 0x7ebd, 0x7ebe, 0x7ebf,
+ 0x7ec0, 0x7ec1, 0x7ec2, 0x7ec3, 0x7ec4, 0x7ec5, 0x7ec6, 0x7ec7,
+ 0x7ec8, 0x7ec9, 0x7eca, 0x7ecb, 0x7ecc, 0x7ecd, 0x7ece, 0x7ecf,
+ 0x7ed0, 0x7ed1, 0x7ed2, 0x7ed3, 0x7ed4, 0x7ed5, 0x7ed6, 0x7ed7,
+ 0x7ed8, 0x7ed9, 0x7eda, 0x7edb, 0x7edc, 0x7edd, 0x7ede, 0x7edf,
+ 0x7ee0, 0x7ee1, 0x7ee2, 0x7ee3, 0x7ee4, 0x7ee5, 0x7ee6, 0x7ee7,
+ 0x7ee8, 0x7ee9, 0x7eea, 0x7eeb, 0x7eec, 0x7eed, 0x7eee, 0x7eef,
+ 0x7ef0, 0x7ef1, 0x7ef2, 0x7ef3, 0x7ef4, 0x7ef5, 0x7ef6, 0x7ef7,
+ 0x7ef8, 0x7ef9, 0x7efa, 0x7efb, 0x7efc, 0x7efd, 0x7efe, 0x7eff,
+ 0x7f00, 0x7f01, 0x7f02, 0x7f03, 0x7f04, 0x7f05, 0x7f06, 0x7f07,
+ 0x7f08, 0x7f09, 0x7f0a, 0x7f0b, 0x7f0c, 0x7f0d, 0x7f0e, 0x7f0f,
+ 0x7f10, 0x7f11, 0x7f12, 0x7f13, 0x7f14, 0x7f15, 0x7f16, 0x7f17,
+ 0x7f18, 0x7f19, 0x7f1a, 0x7f1b, 0x7f1c, 0x7f1d, 0x7f1e, 0x7f1f,
+ 0x7f20, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27,
+ 0x7f28, 0x7f29, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2e, 0x7f2f,
+ 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f34, 0x7f35, 0x7f36, 0x7f37,
+ 0x7f38, 0x7f39, 0x7f3a, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f,
+ 0x7f40, 0x7f41, 0x7f42, 0x7f43, 0x7f44, 0x7f45, 0x7f46, 0x7f47,
+ 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f,
+ 0x7f50, 0x7f51, 0x7f52, 0x7f53, 0x7f54, 0x7f55, 0x7f56, 0x7f57,
+ 0x7f58, 0x7f59, 0x7f5a, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f5f,
+ 0x7f60, 0x7f61, 0x7f62, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67,
+ 0x7f68, 0x7f69, 0x7f6a, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6e, 0x7f6f,
+ 0x7f70, 0x7f71, 0x7f72, 0x7f73, 0x7f74, 0x7f75, 0x7f76, 0x7f77,
+ 0x7f78, 0x7f79, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7e, 0x7f7f,
+ 0x7f80, 0x7f81, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87,
+ 0x7f88, 0x7f89, 0x7f8a, 0x7f8b, 0x7f8c, 0x7f8d, 0x7f8e, 0x7f8f,
+ 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f94, 0x7f95, 0x7f96, 0x7f97,
+ 0x7f98, 0x7f99, 0x7f9a, 0x7f9b, 0x7f9c, 0x7f9d, 0x7f9e, 0x7f9f,
+ 0x7fa0, 0x7fa1, 0x7fa2, 0x7fa3, 0x7fa4, 0x7fa5, 0x7fa6, 0x7fa7,
+ 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7faf,
+ 0x7fb0, 0x7fb1, 0x7fb2, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7,
+ 0x7fb8, 0x7fb9, 0x7fba, 0x7fbb, 0x7fbc, 0x7fbd, 0x7fbe, 0x7fbf,
+ 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7,
+ 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf,
+ 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7,
+ 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf,
+ 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7,
+ 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef,
+ 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7,
+ 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
+ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+ 0x8008, 0x8009, 0x800a, 0x800b, 0x800c, 0x800d, 0x800e, 0x800f,
+ 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017,
+ 0x8018, 0x8019, 0x801a, 0x801b, 0x801c, 0x801d, 0x801e, 0x801f,
+ 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027,
+ 0x8028, 0x8029, 0x802a, 0x802b, 0x802c, 0x802d, 0x802e, 0x802f,
+ 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037,
+ 0x8038, 0x8039, 0x803a, 0x803b, 0x803c, 0x803d, 0x803e, 0x803f,
+ 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047,
+ 0x8048, 0x8049, 0x804a, 0x804b, 0x804c, 0x804d, 0x804e, 0x804f,
+ 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, 0x8057,
+ 0x8058, 0x8059, 0x805a, 0x805b, 0x805c, 0x805d, 0x805e, 0x805f,
+ 0x8060, 0x8061, 0x8062, 0x8063, 0x8064, 0x8065, 0x8066, 0x8067,
+ 0x8068, 0x8069, 0x806a, 0x806b, 0x806c, 0x806d, 0x806e, 0x806f,
+ 0x8070, 0x8071, 0x8072, 0x8073, 0x8074, 0x8075, 0x8076, 0x8077,
+ 0x8078, 0x8079, 0x807a, 0x807b, 0x807c, 0x807d, 0x807e, 0x807f,
+ 0x8080, 0x8081, 0x8082, 0x8083, 0x8084, 0x8085, 0x8086, 0x8087,
+ 0x8088, 0x8089, 0x808a, 0x808b, 0x808c, 0x808d, 0x808e, 0x808f,
+ 0x8090, 0x8091, 0x8092, 0x8093, 0x8094, 0x8095, 0x8096, 0x8097,
+ 0x8098, 0x8099, 0x809a, 0x809b, 0x809c, 0x809d, 0x809e, 0x809f,
+ 0x80a0, 0x80a1, 0x80a2, 0x80a3, 0x80a4, 0x80a5, 0x80a6, 0x80a7,
+ 0x80a8, 0x80a9, 0x80aa, 0x80ab, 0x80ac, 0x80ad, 0x80ae, 0x80af,
+ 0x80b0, 0x80b1, 0x80b2, 0x80b3, 0x80b4, 0x80b5, 0x80b6, 0x80b7,
+ 0x80b8, 0x80b9, 0x80ba, 0x80bb, 0x80bc, 0x80bd, 0x80be, 0x80bf,
+ 0x80c0, 0x80c1, 0x80c2, 0x80c3, 0x80c4, 0x80c5, 0x80c6, 0x80c7,
+ 0x80c8, 0x80c9, 0x80ca, 0x80cb, 0x80cc, 0x80cd, 0x80ce, 0x80cf,
+ 0x80d0, 0x80d1, 0x80d2, 0x80d3, 0x80d4, 0x80d5, 0x80d6, 0x80d7,
+ 0x80d8, 0x80d9, 0x80da, 0x80db, 0x80dc, 0x80dd, 0x80de, 0x80df,
+ 0x80e0, 0x80e1, 0x80e2, 0x80e3, 0x80e4, 0x80e5, 0x80e6, 0x80e7,
+ 0x80e8, 0x80e9, 0x80ea, 0x80eb, 0x80ec, 0x80ed, 0x80ee, 0x80ef,
+ 0x80f0, 0x80f1, 0x80f2, 0x80f3, 0x80f4, 0x80f5, 0x80f6, 0x80f7,
+ 0x80f8, 0x80f9, 0x80fa, 0x80fb, 0x80fc, 0x80fd, 0x80fe, 0x80ff,
+ 0x8100, 0x8101, 0x8102, 0x8103, 0x8104, 0x8105, 0x8106, 0x8107,
+ 0x8108, 0x8109, 0x810a, 0x810b, 0x810c, 0x810d, 0x810e, 0x810f,
+ 0x8110, 0x8111, 0x8112, 0x8113, 0x8114, 0x8115, 0x8116, 0x8117,
+ 0x8118, 0x8119, 0x811a, 0x811b, 0x811c, 0x811d, 0x811e, 0x811f,
+ 0x8120, 0x8121, 0x8122, 0x8123, 0x8124, 0x8125, 0x8126, 0x8127,
+ 0x8128, 0x8129, 0x812a, 0x812b, 0x812c, 0x812d, 0x812e, 0x812f,
+ 0x8130, 0x8131, 0x8132, 0x8133, 0x8134, 0x8135, 0x8136, 0x8137,
+ 0x8138, 0x8139, 0x813a, 0x813b, 0x813c, 0x813d, 0x813e, 0x813f,
+ 0x8140, 0x8141, 0x8142, 0x8143, 0x8144, 0x8145, 0x8146, 0x8147,
+ 0x8148, 0x8149, 0x814a, 0x814b, 0x814c, 0x814d, 0x814e, 0x814f,
+ 0x8150, 0x8151, 0x8152, 0x8153, 0x8154, 0x8155, 0x8156, 0x8157,
+ 0x8158, 0x8159, 0x815a, 0x815b, 0x815c, 0x815d, 0x815e, 0x815f,
+ 0x8160, 0x8161, 0x8162, 0x8163, 0x8164, 0x8165, 0x8166, 0x8167,
+ 0x8168, 0x8169, 0x816a, 0x816b, 0x816c, 0x816d, 0x816e, 0x816f,
+ 0x8170, 0x8171, 0x8172, 0x8173, 0x8174, 0x8175, 0x8176, 0x8177,
+ 0x8178, 0x8179, 0x817a, 0x817b, 0x817c, 0x817d, 0x817e, 0x817f,
+ 0x8180, 0x8181, 0x8182, 0x8183, 0x8184, 0x8185, 0x8186, 0x8187,
+ 0x8188, 0x8189, 0x818a, 0x818b, 0x818c, 0x818d, 0x818e, 0x818f,
+ 0x8190, 0x8191, 0x8192, 0x8193, 0x8194, 0x8195, 0x8196, 0x8197,
+ 0x8198, 0x8199, 0x819a, 0x819b, 0x819c, 0x819d, 0x819e, 0x819f,
+ 0x81a0, 0x81a1, 0x81a2, 0x81a3, 0x81a4, 0x81a5, 0x81a6, 0x81a7,
+ 0x81a8, 0x81a9, 0x81aa, 0x81ab, 0x81ac, 0x81ad, 0x81ae, 0x81af,
+ 0x81b0, 0x81b1, 0x81b2, 0x81b3, 0x81b4, 0x81b5, 0x81b6, 0x81b7,
+ 0x81b8, 0x81b9, 0x81ba, 0x81bb, 0x81bc, 0x81bd, 0x81be, 0x81bf,
+ 0x81c0, 0x81c1, 0x81c2, 0x81c3, 0x81c4, 0x81c5, 0x81c6, 0x81c7,
+ 0x81c8, 0x81c9, 0x81ca, 0x81cb, 0x81cc, 0x81cd, 0x81ce, 0x81cf,
+ 0x81d0, 0x81d1, 0x81d2, 0x81d3, 0x81d4, 0x81d5, 0x81d6, 0x81d7,
+ 0x81d8, 0x81d9, 0x81da, 0x81db, 0x81dc, 0x81dd, 0x81de, 0x81df,
+ 0x81e0, 0x81e1, 0x81e2, 0x81e3, 0x81e4, 0x81e5, 0x81e6, 0x81e7,
+ 0x81e8, 0x81e9, 0x81ea, 0x81eb, 0x81ec, 0x81ed, 0x81ee, 0x81ef,
+ 0x81f0, 0x81f1, 0x81f2, 0x81f3, 0x81f4, 0x81f5, 0x81f6, 0x81f7,
+ 0x81f8, 0x81f9, 0x81fa, 0x81fb, 0x81fc, 0x81fd, 0x81fe, 0x81ff,
+ 0x8200, 0x8201, 0x8202, 0x8203, 0x8204, 0x8205, 0x8206, 0x8207,
+ 0x8208, 0x8209, 0x820a, 0x820b, 0x820c, 0x820d, 0x820e, 0x820f,
+ 0x8210, 0x8211, 0x8212, 0x8213, 0x8214, 0x8215, 0x8216, 0x8217,
+ 0x8218, 0x8219, 0x821a, 0x821b, 0x821c, 0x821d, 0x821e, 0x821f,
+ 0x8220, 0x8221, 0x8222, 0x8223, 0x8224, 0x8225, 0x8226, 0x8227,
+ 0x8228, 0x8229, 0x822a, 0x822b, 0x822c, 0x822d, 0x822e, 0x822f,
+ 0x8230, 0x8231, 0x8232, 0x8233, 0x8234, 0x8235, 0x8236, 0x8237,
+ 0x8238, 0x8239, 0x823a, 0x823b, 0x823c, 0x823d, 0x823e, 0x823f,
+ 0x8240, 0x8241, 0x8242, 0x8243, 0x8244, 0x8245, 0x8246, 0x8247,
+ 0x8248, 0x8249, 0x824a, 0x824b, 0x824c, 0x824d, 0x824e, 0x824f,
+ 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, 0x8256, 0x8257,
+ 0x8258, 0x8259, 0x825a, 0x825b, 0x825c, 0x825d, 0x825e, 0x825f,
+ 0x8260, 0x8261, 0x8262, 0x8263, 0x8264, 0x8265, 0x8266, 0x8267,
+ 0x8268, 0x8269, 0x826a, 0x826b, 0x826c, 0x826d, 0x826e, 0x826f,
+ 0x8270, 0x8271, 0x8272, 0x8273, 0x8274, 0x8275, 0x8276, 0x8277,
+ 0x8278, 0x8279, 0x827a, 0x827b, 0x827c, 0x827d, 0x827e, 0x827f,
+ 0x8280, 0x8281, 0x8282, 0x8283, 0x8284, 0x8285, 0x8286, 0x8287,
+ 0x8288, 0x8289, 0x828a, 0x828b, 0x828c, 0x828d, 0x828e, 0x828f,
+ 0x8290, 0x8291, 0x8292, 0x8293, 0x8294, 0x8295, 0x8296, 0x8297,
+ 0x8298, 0x8299, 0x829a, 0x829b, 0x829c, 0x829d, 0x829e, 0x829f,
+ 0x82a0, 0x82a1, 0x82a2, 0x82a3, 0x82a4, 0x82a5, 0x82a6, 0x82a7,
+ 0x82a8, 0x82a9, 0x82aa, 0x82ab, 0x82ac, 0x82ad, 0x82ae, 0x82af,
+ 0x82b0, 0x82b1, 0x82b2, 0x82b3, 0x82b4, 0x82b5, 0x82b6, 0x82b7,
+ 0x82b8, 0x82b9, 0x82ba, 0x82bb, 0x82bc, 0x82bd, 0x82be, 0x82bf,
+ 0x82c0, 0x82c1, 0x82c2, 0x82c3, 0x82c4, 0x82c5, 0x82c6, 0x82c7,
+ 0x82c8, 0x82c9, 0x82ca, 0x82cb, 0x82cc, 0x82cd, 0x82ce, 0x82cf,
+ 0x82d0, 0x82d1, 0x82d2, 0x82d3, 0x82d4, 0x82d5, 0x82d6, 0x82d7,
+ 0x82d8, 0x82d9, 0x82da, 0x82db, 0x82dc, 0x82dd, 0x82de, 0x82df,
+ 0x82e0, 0x82e1, 0x82e2, 0x82e3, 0x82e4, 0x82e5, 0x82e6, 0x82e7,
+ 0x82e8, 0x82e9, 0x82ea, 0x82eb, 0x82ec, 0x82ed, 0x82ee, 0x82ef,
+ 0x82f0, 0x82f1, 0x82f2, 0x82f3, 0x82f4, 0x82f5, 0x82f6, 0x82f7,
+ 0x82f8, 0x82f9, 0x82fa, 0x82fb, 0x82fc, 0x82fd, 0x82fe, 0x82ff,
+ 0x8300, 0x8301, 0x8302, 0x8303, 0x8304, 0x8305, 0x8306, 0x8307,
+ 0x8308, 0x8309, 0x830a, 0x830b, 0x830c, 0x830d, 0x830e, 0x830f,
+ 0x8310, 0x8311, 0x8312, 0x8313, 0x8314, 0x8315, 0x8316, 0x8317,
+ 0x8318, 0x8319, 0x831a, 0x831b, 0x831c, 0x831d, 0x831e, 0x831f,
+ 0x8320, 0x8321, 0x8322, 0x8323, 0x8324, 0x8325, 0x8326, 0x8327,
+ 0x8328, 0x8329, 0x832a, 0x832b, 0x832c, 0x832d, 0x832e, 0x832f,
+ 0x8330, 0x8331, 0x8332, 0x8333, 0x8334, 0x8335, 0x8336, 0x8337,
+ 0x8338, 0x8339, 0x833a, 0x833b, 0x833c, 0x833d, 0x833e, 0x833f,
+ 0x8340, 0x8341, 0x8342, 0x8343, 0x8344, 0x8345, 0x8346, 0x8347,
+ 0x8348, 0x8349, 0x834a, 0x834b, 0x834c, 0x834d, 0x834e, 0x834f,
+ 0x8350, 0x8351, 0x8352, 0x8353, 0x8354, 0x8355, 0x8356, 0x8357,
+ 0x8358, 0x8359, 0x835a, 0x835b, 0x835c, 0x835d, 0x835e, 0x835f,
+ 0x8360, 0x8361, 0x8362, 0x8363, 0x8364, 0x8365, 0x8366, 0x8367,
+ 0x8368, 0x8369, 0x836a, 0x836b, 0x836c, 0x836d, 0x836e, 0x836f,
+ 0x8370, 0x8371, 0x8372, 0x8373, 0x8374, 0x8375, 0x8376, 0x8377,
+ 0x8378, 0x8379, 0x837a, 0x837b, 0x837c, 0x837d, 0x837e, 0x837f,
+ 0x8380, 0x8381, 0x8382, 0x8383, 0x8384, 0x8385, 0x8386, 0x8387,
+ 0x8388, 0x8389, 0x838a, 0x838b, 0x838c, 0x838d, 0x838e, 0x838f,
+ 0x8390, 0x8391, 0x8392, 0x8393, 0x8394, 0x8395, 0x8396, 0x8397,
+ 0x8398, 0x8399, 0x839a, 0x839b, 0x839c, 0x839d, 0x839e, 0x839f,
+ 0x83a0, 0x83a1, 0x83a2, 0x83a3, 0x83a4, 0x83a5, 0x83a6, 0x83a7,
+ 0x83a8, 0x83a9, 0x83aa, 0x83ab, 0x83ac, 0x83ad, 0x83ae, 0x83af,
+ 0x83b0, 0x83b1, 0x83b2, 0x83b3, 0x83b4, 0x83b5, 0x83b6, 0x83b7,
+ 0x83b8, 0x83b9, 0x83ba, 0x83bb, 0x83bc, 0x83bd, 0x83be, 0x83bf,
+ 0x83c0, 0x83c1, 0x83c2, 0x83c3, 0x83c4, 0x83c5, 0x83c6, 0x83c7,
+ 0x83c8, 0x83c9, 0x83ca, 0x83cb, 0x83cc, 0x83cd, 0x83ce, 0x83cf,
+ 0x83d0, 0x83d1, 0x83d2, 0x83d3, 0x83d4, 0x83d5, 0x83d6, 0x83d7,
+ 0x83d8, 0x83d9, 0x83da, 0x83db, 0x83dc, 0x83dd, 0x83de, 0x83df,
+ 0x83e0, 0x83e1, 0x83e2, 0x83e3, 0x83e4, 0x83e5, 0x83e6, 0x83e7,
+ 0x83e8, 0x83e9, 0x83ea, 0x83eb, 0x83ec, 0x83ed, 0x83ee, 0x83ef,
+ 0x83f0, 0x83f1, 0x83f2, 0x83f3, 0x83f4, 0x83f5, 0x83f6, 0x83f7,
+ 0x83f8, 0x83f9, 0x83fa, 0x83fb, 0x83fc, 0x83fd, 0x83fe, 0x83ff,
+ 0x8400, 0x8401, 0x8402, 0x8403, 0x8404, 0x8405, 0x8406, 0x8407,
+ 0x8408, 0x8409, 0x840a, 0x840b, 0x840c, 0x840d, 0x840e, 0x840f,
+ 0x8410, 0x8411, 0x8412, 0x8413, 0x8414, 0x8415, 0x8416, 0x8417,
+ 0x8418, 0x8419, 0x841a, 0x841b, 0x841c, 0x841d, 0x841e, 0x841f,
+ 0x8420, 0x8421, 0x8422, 0x8423, 0x8424, 0x8425, 0x8426, 0x8427,
+ 0x8428, 0x8429, 0x842a, 0x842b, 0x842c, 0x842d, 0x842e, 0x842f,
+ 0x8430, 0x8431, 0x8432, 0x8433, 0x8434, 0x8435, 0x8436, 0x8437,
+ 0x8438, 0x8439, 0x843a, 0x843b, 0x843c, 0x843d, 0x843e, 0x843f,
+ 0x8440, 0x8441, 0x8442, 0x8443, 0x8444, 0x8445, 0x8446, 0x8447,
+ 0x8448, 0x8449, 0x844a, 0x844b, 0x844c, 0x844d, 0x844e, 0x844f,
+ 0x8450, 0x8451, 0x8452, 0x8453, 0x8454, 0x8455, 0x8456, 0x8457,
+ 0x8458, 0x8459, 0x845a, 0x845b, 0x845c, 0x845d, 0x845e, 0x845f,
+ 0x8460, 0x8461, 0x8462, 0x8463, 0x8464, 0x8465, 0x8466, 0x8467,
+ 0x8468, 0x8469, 0x846a, 0x846b, 0x846c, 0x846d, 0x846e, 0x846f,
+ 0x8470, 0x8471, 0x8472, 0x8473, 0x8474, 0x8475, 0x8476, 0x8477,
+ 0x8478, 0x8479, 0x847a, 0x847b, 0x847c, 0x847d, 0x847e, 0x847f,
+ 0x8480, 0x8481, 0x8482, 0x8483, 0x8484, 0x8485, 0x8486, 0x8487,
+ 0x8488, 0x8489, 0x848a, 0x848b, 0x848c, 0x848d, 0x848e, 0x848f,
+ 0x8490, 0x8491, 0x8492, 0x8493, 0x8494, 0x8495, 0x8496, 0x8497,
+ 0x8498, 0x8499, 0x849a, 0x849b, 0x849c, 0x849d, 0x849e, 0x849f,
+ 0x84a0, 0x84a1, 0x84a2, 0x84a3, 0x84a4, 0x84a5, 0x84a6, 0x84a7,
+ 0x84a8, 0x84a9, 0x84aa, 0x84ab, 0x84ac, 0x84ad, 0x84ae, 0x84af,
+ 0x84b0, 0x84b1, 0x84b2, 0x84b3, 0x84b4, 0x84b5, 0x84b6, 0x84b7,
+ 0x84b8, 0x84b9, 0x84ba, 0x84bb, 0x84bc, 0x84bd, 0x84be, 0x84bf,
+ 0x84c0, 0x84c1, 0x84c2, 0x84c3, 0x84c4, 0x84c5, 0x84c6, 0x84c7,
+ 0x84c8, 0x84c9, 0x84ca, 0x84cb, 0x84cc, 0x84cd, 0x84ce, 0x84cf,
+ 0x84d0, 0x84d1, 0x84d2, 0x84d3, 0x84d4, 0x84d5, 0x84d6, 0x84d7,
+ 0x84d8, 0x84d9, 0x84da, 0x84db, 0x84dc, 0x84dd, 0x84de, 0x84df,
+ 0x84e0, 0x84e1, 0x84e2, 0x84e3, 0x84e4, 0x84e5, 0x84e6, 0x84e7,
+ 0x84e8, 0x84e9, 0x84ea, 0x84eb, 0x84ec, 0x84ed, 0x84ee, 0x84ef,
+ 0x84f0, 0x84f1, 0x84f2, 0x84f3, 0x84f4, 0x84f5, 0x84f6, 0x84f7,
+ 0x84f8, 0x84f9, 0x84fa, 0x84fb, 0x84fc, 0x84fd, 0x84fe, 0x84ff,
+ 0x8500, 0x8501, 0x8502, 0x8503, 0x8504, 0x8505, 0x8506, 0x8507,
+ 0x8508, 0x8509, 0x850a, 0x850b, 0x850c, 0x850d, 0x850e, 0x850f,
+ 0x8510, 0x8511, 0x8512, 0x8513, 0x8514, 0x8515, 0x8516, 0x8517,
+ 0x8518, 0x8519, 0x851a, 0x851b, 0x851c, 0x851d, 0x851e, 0x851f,
+ 0x8520, 0x8521, 0x8522, 0x8523, 0x8524, 0x8525, 0x8526, 0x8527,
+ 0x8528, 0x8529, 0x852a, 0x852b, 0x852c, 0x852d, 0x852e, 0x852f,
+ 0x8530, 0x8531, 0x8532, 0x8533, 0x8534, 0x8535, 0x8536, 0x8537,
+ 0x8538, 0x8539, 0x853a, 0x853b, 0x853c, 0x853d, 0x853e, 0x853f,
+ 0x8540, 0x8541, 0x8542, 0x8543, 0x8544, 0x8545, 0x8546, 0x8547,
+ 0x8548, 0x8549, 0x854a, 0x854b, 0x854c, 0x854d, 0x854e, 0x854f,
+ 0x8550, 0x8551, 0x8552, 0x8553, 0x8554, 0x8555, 0x8556, 0x8557,
+ 0x8558, 0x8559, 0x855a, 0x855b, 0x855c, 0x855d, 0x855e, 0x855f,
+ 0x8560, 0x8561, 0x8562, 0x8563, 0x8564, 0x8565, 0x8566, 0x8567,
+ 0x8568, 0x8569, 0x856a, 0x856b, 0x856c, 0x856d, 0x856e, 0x856f,
+ 0x8570, 0x8571, 0x8572, 0x8573, 0x8574, 0x8575, 0x8576, 0x8577,
+ 0x8578, 0x8579, 0x857a, 0x857b, 0x857c, 0x857d, 0x857e, 0x857f,
+ 0x8580, 0x8581, 0x8582, 0x8583, 0x8584, 0x8585, 0x8586, 0x8587,
+ 0x8588, 0x8589, 0x858a, 0x858b, 0x858c, 0x858d, 0x858e, 0x858f,
+ 0x8590, 0x8591, 0x8592, 0x8593, 0x8594, 0x8595, 0x8596, 0x8597,
+ 0x8598, 0x8599, 0x859a, 0x859b, 0x859c, 0x859d, 0x859e, 0x859f,
+ 0x85a0, 0x85a1, 0x85a2, 0x85a3, 0x85a4, 0x85a5, 0x85a6, 0x85a7,
+ 0x85a8, 0x85a9, 0x85aa, 0x85ab, 0x85ac, 0x85ad, 0x85ae, 0x85af,
+ 0x85b0, 0x85b1, 0x85b2, 0x85b3, 0x85b4, 0x85b5, 0x85b6, 0x85b7,
+ 0x85b8, 0x85b9, 0x85ba, 0x85bb, 0x85bc, 0x85bd, 0x85be, 0x85bf,
+ 0x85c0, 0x85c1, 0x85c2, 0x85c3, 0x85c4, 0x85c5, 0x85c6, 0x85c7,
+ 0x85c8, 0x85c9, 0x85ca, 0x85cb, 0x85cc, 0x85cd, 0x85ce, 0x85cf,
+ 0x85d0, 0x85d1, 0x85d2, 0x85d3, 0x85d4, 0x85d5, 0x85d6, 0x85d7,
+ 0x85d8, 0x85d9, 0x85da, 0x85db, 0x85dc, 0x85dd, 0x85de, 0x85df,
+ 0x85e0, 0x85e1, 0x85e2, 0x85e3, 0x85e4, 0x85e5, 0x85e6, 0x85e7,
+ 0x85e8, 0x85e9, 0x85ea, 0x85eb, 0x85ec, 0x85ed, 0x85ee, 0x85ef,
+ 0x85f0, 0x85f1, 0x85f2, 0x85f3, 0x85f4, 0x85f5, 0x85f6, 0x85f7,
+ 0x85f8, 0x85f9, 0x85fa, 0x85fb, 0x85fc, 0x85fd, 0x85fe, 0x85ff,
+ 0x8600, 0x8601, 0x8602, 0x8603, 0x8604, 0x8605, 0x8606, 0x8607,
+ 0x8608, 0x8609, 0x860a, 0x860b, 0x860c, 0x860d, 0x860e, 0x860f,
+ 0x8610, 0x8611, 0x8612, 0x8613, 0x8614, 0x8615, 0x8616, 0x8617,
+ 0x8618, 0x8619, 0x861a, 0x861b, 0x861c, 0x861d, 0x861e, 0x861f,
+ 0x8620, 0x8621, 0x8622, 0x8623, 0x8624, 0x8625, 0x8626, 0x8627,
+ 0x8628, 0x8629, 0x862a, 0x862b, 0x862c, 0x862d, 0x862e, 0x862f,
+ 0x8630, 0x8631, 0x8632, 0x8633, 0x8634, 0x8635, 0x8636, 0x8637,
+ 0x8638, 0x8639, 0x863a, 0x863b, 0x863c, 0x863d, 0x863e, 0x863f,
+ 0x8640, 0x8641, 0x8642, 0x8643, 0x8644, 0x8645, 0x8646, 0x8647,
+ 0x8648, 0x8649, 0x864a, 0x864b, 0x864c, 0x864d, 0x864e, 0x864f,
+ 0x8650, 0x8651, 0x8652, 0x8653, 0x8654, 0x8655, 0x8656, 0x8657,
+ 0x8658, 0x8659, 0x865a, 0x865b, 0x865c, 0x865d, 0x865e, 0x865f,
+ 0x8660, 0x8661, 0x8662, 0x8663, 0x8664, 0x8665, 0x8666, 0x8667,
+ 0x8668, 0x8669, 0x866a, 0x866b, 0x866c, 0x866d, 0x866e, 0x866f,
+ 0x8670, 0x8671, 0x8672, 0x8673, 0x8674, 0x8675, 0x8676, 0x8677,
+ 0x8678, 0x8679, 0x867a, 0x867b, 0x867c, 0x867d, 0x867e, 0x867f,
+ 0x8680, 0x8681, 0x8682, 0x8683, 0x8684, 0x8685, 0x8686, 0x8687,
+ 0x8688, 0x8689, 0x868a, 0x868b, 0x868c, 0x868d, 0x868e, 0x868f,
+ 0x8690, 0x8691, 0x8692, 0x8693, 0x8694, 0x8695, 0x8696, 0x8697,
+ 0x8698, 0x8699, 0x869a, 0x869b, 0x869c, 0x869d, 0x869e, 0x869f,
+ 0x86a0, 0x86a1, 0x86a2, 0x86a3, 0x86a4, 0x86a5, 0x86a6, 0x86a7,
+ 0x86a8, 0x86a9, 0x86aa, 0x86ab, 0x86ac, 0x86ad, 0x86ae, 0x86af,
+ 0x86b0, 0x86b1, 0x86b2, 0x86b3, 0x86b4, 0x86b5, 0x86b6, 0x86b7,
+ 0x86b8, 0x86b9, 0x86ba, 0x86bb, 0x86bc, 0x86bd, 0x86be, 0x86bf,
+ 0x86c0, 0x86c1, 0x86c2, 0x86c3, 0x86c4, 0x86c5, 0x86c6, 0x86c7,
+ 0x86c8, 0x86c9, 0x86ca, 0x86cb, 0x86cc, 0x86cd, 0x86ce, 0x86cf,
+ 0x86d0, 0x86d1, 0x86d2, 0x86d3, 0x86d4, 0x86d5, 0x86d6, 0x86d7,
+ 0x86d8, 0x86d9, 0x86da, 0x86db, 0x86dc, 0x86dd, 0x86de, 0x86df,
+ 0x86e0, 0x86e1, 0x86e2, 0x86e3, 0x86e4, 0x86e5, 0x86e6, 0x86e7,
+ 0x86e8, 0x86e9, 0x86ea, 0x86eb, 0x86ec, 0x86ed, 0x86ee, 0x86ef,
+ 0x86f0, 0x86f1, 0x86f2, 0x86f3, 0x86f4, 0x86f5, 0x86f6, 0x86f7,
+ 0x86f8, 0x86f9, 0x86fa, 0x86fb, 0x86fc, 0x86fd, 0x86fe, 0x86ff,
+ 0x8700, 0x8701, 0x8702, 0x8703, 0x8704, 0x8705, 0x8706, 0x8707,
+ 0x8708, 0x8709, 0x870a, 0x870b, 0x870c, 0x870d, 0x870e, 0x870f,
+ 0x8710, 0x8711, 0x8712, 0x8713, 0x8714, 0x8715, 0x8716, 0x8717,
+ 0x8718, 0x8719, 0x871a, 0x871b, 0x871c, 0x871d, 0x871e, 0x871f,
+ 0x8720, 0x8721, 0x8722, 0x8723, 0x8724, 0x8725, 0x8726, 0x8727,
+ 0x8728, 0x8729, 0x872a, 0x872b, 0x872c, 0x872d, 0x872e, 0x872f,
+ 0x8730, 0x8731, 0x8732, 0x8733, 0x8734, 0x8735, 0x8736, 0x8737,
+ 0x8738, 0x8739, 0x873a, 0x873b, 0x873c, 0x873d, 0x873e, 0x873f,
+ 0x8740, 0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, 0x8747,
+ 0x8748, 0x8749, 0x874a, 0x874b, 0x874c, 0x874d, 0x874e, 0x874f,
+ 0x8750, 0x8751, 0x8752, 0x8753, 0x8754, 0x8755, 0x8756, 0x8757,
+ 0x8758, 0x8759, 0x875a, 0x875b, 0x875c, 0x875d, 0x875e, 0x875f,
+ 0x8760, 0x8761, 0x8762, 0x8763, 0x8764, 0x8765, 0x8766, 0x8767,
+ 0x8768, 0x8769, 0x876a, 0x876b, 0x876c, 0x876d, 0x876e, 0x876f,
+ 0x8770, 0x8771, 0x8772, 0x8773, 0x8774, 0x8775, 0x8776, 0x8777,
+ 0x8778, 0x8779, 0x877a, 0x877b, 0x877c, 0x877d, 0x877e, 0x877f,
+ 0x8780, 0x8781, 0x8782, 0x8783, 0x8784, 0x8785, 0x8786, 0x8787,
+ 0x8788, 0x8789, 0x878a, 0x878b, 0x878c, 0x878d, 0x878e, 0x878f,
+ 0x8790, 0x8791, 0x8792, 0x8793, 0x8794, 0x8795, 0x8796, 0x8797,
+ 0x8798, 0x8799, 0x879a, 0x879b, 0x879c, 0x879d, 0x879e, 0x879f,
+ 0x87a0, 0x87a1, 0x87a2, 0x87a3, 0x87a4, 0x87a5, 0x87a6, 0x87a7,
+ 0x87a8, 0x87a9, 0x87aa, 0x87ab, 0x87ac, 0x87ad, 0x87ae, 0x87af,
+ 0x87b0, 0x87b1, 0x87b2, 0x87b3, 0x87b4, 0x87b5, 0x87b6, 0x87b7,
+ 0x87b8, 0x87b9, 0x87ba, 0x87bb, 0x87bc, 0x87bd, 0x87be, 0x87bf,
+ 0x87c0, 0x87c1, 0x87c2, 0x87c3, 0x87c4, 0x87c5, 0x87c6, 0x87c7,
+ 0x87c8, 0x87c9, 0x87ca, 0x87cb, 0x87cc, 0x87cd, 0x87ce, 0x87cf,
+ 0x87d0, 0x87d1, 0x87d2, 0x87d3, 0x87d4, 0x87d5, 0x87d6, 0x87d7,
+ 0x87d8, 0x87d9, 0x87da, 0x87db, 0x87dc, 0x87dd, 0x87de, 0x87df,
+ 0x87e0, 0x87e1, 0x87e2, 0x87e3, 0x87e4, 0x87e5, 0x87e6, 0x87e7,
+ 0x87e8, 0x87e9, 0x87ea, 0x87eb, 0x87ec, 0x87ed, 0x87ee, 0x87ef,
+ 0x87f0, 0x87f1, 0x87f2, 0x87f3, 0x87f4, 0x87f5, 0x87f6, 0x87f7,
+ 0x87f8, 0x87f9, 0x87fa, 0x87fb, 0x87fc, 0x87fd, 0x87fe, 0x87ff,
+ 0x8800, 0x8801, 0x8802, 0x8803, 0x8804, 0x8805, 0x8806, 0x8807,
+ 0x8808, 0x8809, 0x880a, 0x880b, 0x880c, 0x880d, 0x880e, 0x880f,
+ 0x8810, 0x8811, 0x8812, 0x8813, 0x8814, 0x8815, 0x8816, 0x8817,
+ 0x8818, 0x8819, 0x881a, 0x881b, 0x881c, 0x881d, 0x881e, 0x881f,
+ 0x8820, 0x8821, 0x8822, 0x8823, 0x8824, 0x8825, 0x8826, 0x8827,
+ 0x8828, 0x8829, 0x882a, 0x882b, 0x882c, 0x882d, 0x882e, 0x882f,
+ 0x8830, 0x8831, 0x8832, 0x8833, 0x8834, 0x8835, 0x8836, 0x8837,
+ 0x8838, 0x8839, 0x883a, 0x883b, 0x883c, 0x883d, 0x883e, 0x883f,
+ 0x8840, 0x8841, 0x8842, 0x8843, 0x8844, 0x8845, 0x8846, 0x8847,
+ 0x8848, 0x8849, 0x884a, 0x884b, 0x884c, 0x884d, 0x884e, 0x884f,
+ 0x8850, 0x8851, 0x8852, 0x8853, 0x8854, 0x8855, 0x8856, 0x8857,
+ 0x8858, 0x8859, 0x885a, 0x885b, 0x885c, 0x885d, 0x885e, 0x885f,
+ 0x8860, 0x8861, 0x8862, 0x8863, 0x8864, 0x8865, 0x8866, 0x8867,
+ 0x8868, 0x8869, 0x886a, 0x886b, 0x886c, 0x886d, 0x886e, 0x886f,
+ 0x8870, 0x8871, 0x8872, 0x8873, 0x8874, 0x8875, 0x8876, 0x8877,
+ 0x8878, 0x8879, 0x887a, 0x887b, 0x887c, 0x887d, 0x887e, 0x887f,
+ 0x8880, 0x8881, 0x8882, 0x8883, 0x8884, 0x8885, 0x8886, 0x8887,
+ 0x8888, 0x8889, 0x888a, 0x888b, 0x888c, 0x888d, 0x888e, 0x888f,
+ 0x8890, 0x8891, 0x8892, 0x8893, 0x8894, 0x8895, 0x8896, 0x8897,
+ 0x8898, 0x8899, 0x889a, 0x889b, 0x889c, 0x889d, 0x889e, 0x889f,
+ 0x88a0, 0x88a1, 0x88a2, 0x88a3, 0x88a4, 0x88a5, 0x88a6, 0x88a7,
+ 0x88a8, 0x88a9, 0x88aa, 0x88ab, 0x88ac, 0x88ad, 0x88ae, 0x88af,
+ 0x88b0, 0x88b1, 0x88b2, 0x88b3, 0x88b4, 0x88b5, 0x88b6, 0x88b7,
+ 0x88b8, 0x88b9, 0x88ba, 0x88bb, 0x88bc, 0x88bd, 0x88be, 0x88bf,
+ 0x88c0, 0x88c1, 0x88c2, 0x88c3, 0x88c4, 0x88c5, 0x88c6, 0x88c7,
+ 0x88c8, 0x88c9, 0x88ca, 0x88cb, 0x88cc, 0x88cd, 0x88ce, 0x88cf,
+ 0x88d0, 0x88d1, 0x88d2, 0x88d3, 0x88d4, 0x88d5, 0x88d6, 0x88d7,
+ 0x88d8, 0x88d9, 0x88da, 0x88db, 0x88dc, 0x88dd, 0x88de, 0x88df,
+ 0x88e0, 0x88e1, 0x88e2, 0x88e3, 0x88e4, 0x88e5, 0x88e6, 0x88e7,
+ 0x88e8, 0x88e9, 0x88ea, 0x88eb, 0x88ec, 0x88ed, 0x88ee, 0x88ef,
+ 0x88f0, 0x88f1, 0x88f2, 0x88f3, 0x88f4, 0x88f5, 0x88f6, 0x88f7,
+ 0x88f8, 0x88f9, 0x88fa, 0x88fb, 0x88fc, 0x88fd, 0x88fe, 0x88ff,
+ 0x8900, 0x8901, 0x8902, 0x8903, 0x8904, 0x8905, 0x8906, 0x8907,
+ 0x8908, 0x8909, 0x890a, 0x890b, 0x890c, 0x890d, 0x890e, 0x890f,
+ 0x8910, 0x8911, 0x8912, 0x8913, 0x8914, 0x8915, 0x8916, 0x8917,
+ 0x8918, 0x8919, 0x891a, 0x891b, 0x891c, 0x891d, 0x891e, 0x891f,
+ 0x8920, 0x8921, 0x8922, 0x8923, 0x8924, 0x8925, 0x8926, 0x8927,
+ 0x8928, 0x8929, 0x892a, 0x892b, 0x892c, 0x892d, 0x892e, 0x892f,
+ 0x8930, 0x8931, 0x8932, 0x8933, 0x8934, 0x8935, 0x8936, 0x8937,
+ 0x8938, 0x8939, 0x893a, 0x893b, 0x893c, 0x893d, 0x893e, 0x893f,
+ 0x8940, 0x8941, 0x8942, 0x8943, 0x8944, 0x8945, 0x8946, 0x8947,
+ 0x8948, 0x8949, 0x894a, 0x894b, 0x894c, 0x894d, 0x894e, 0x894f,
+ 0x8950, 0x8951, 0x8952, 0x8953, 0x8954, 0x8955, 0x8956, 0x8957,
+ 0x8958, 0x8959, 0x895a, 0x895b, 0x895c, 0x895d, 0x895e, 0x895f,
+ 0x8960, 0x8961, 0x8962, 0x8963, 0x8964, 0x8965, 0x8966, 0x8967,
+ 0x8968, 0x8969, 0x896a, 0x896b, 0x896c, 0x896d, 0x896e, 0x896f,
+ 0x8970, 0x8971, 0x8972, 0x8973, 0x8974, 0x8975, 0x8976, 0x8977,
+ 0x8978, 0x8979, 0x897a, 0x897b, 0x897c, 0x897d, 0x897e, 0x897f,
+ 0x8980, 0x8981, 0x8982, 0x8983, 0x8984, 0x8985, 0x8986, 0x8987,
+ 0x8988, 0x8989, 0x898a, 0x898b, 0x898c, 0x898d, 0x898e, 0x898f,
+ 0x8990, 0x8991, 0x8992, 0x8993, 0x8994, 0x8995, 0x8996, 0x8997,
+ 0x8998, 0x8999, 0x899a, 0x899b, 0x899c, 0x899d, 0x899e, 0x899f,
+ 0x89a0, 0x89a1, 0x89a2, 0x89a3, 0x89a4, 0x89a5, 0x89a6, 0x89a7,
+ 0x89a8, 0x89a9, 0x89aa, 0x89ab, 0x89ac, 0x89ad, 0x89ae, 0x89af,
+ 0x89b0, 0x89b1, 0x89b2, 0x89b3, 0x89b4, 0x89b5, 0x89b6, 0x89b7,
+ 0x89b8, 0x89b9, 0x89ba, 0x89bb, 0x89bc, 0x89bd, 0x89be, 0x89bf,
+ 0x89c0, 0x89c1, 0x89c2, 0x89c3, 0x89c4, 0x89c5, 0x89c6, 0x89c7,
+ 0x89c8, 0x89c9, 0x89ca, 0x89cb, 0x89cc, 0x89cd, 0x89ce, 0x89cf,
+ 0x89d0, 0x89d1, 0x89d2, 0x89d3, 0x89d4, 0x89d5, 0x89d6, 0x89d7,
+ 0x89d8, 0x89d9, 0x89da, 0x89db, 0x89dc, 0x89dd, 0x89de, 0x89df,
+ 0x89e0, 0x89e1, 0x89e2, 0x89e3, 0x89e4, 0x89e5, 0x89e6, 0x89e7,
+ 0x89e8, 0x89e9, 0x89ea, 0x89eb, 0x89ec, 0x89ed, 0x89ee, 0x89ef,
+ 0x89f0, 0x89f1, 0x89f2, 0x89f3, 0x89f4, 0x89f5, 0x89f6, 0x89f7,
+ 0x89f8, 0x89f9, 0x89fa, 0x89fb, 0x89fc, 0x89fd, 0x89fe, 0x89ff,
+ 0x8a00, 0x8a01, 0x8a02, 0x8a03, 0x8a04, 0x8a05, 0x8a06, 0x8a07,
+ 0x8a08, 0x8a09, 0x8a0a, 0x8a0b, 0x8a0c, 0x8a0d, 0x8a0e, 0x8a0f,
+ 0x8a10, 0x8a11, 0x8a12, 0x8a13, 0x8a14, 0x8a15, 0x8a16, 0x8a17,
+ 0x8a18, 0x8a19, 0x8a1a, 0x8a1b, 0x8a1c, 0x8a1d, 0x8a1e, 0x8a1f,
+ 0x8a20, 0x8a21, 0x8a22, 0x8a23, 0x8a24, 0x8a25, 0x8a26, 0x8a27,
+ 0x8a28, 0x8a29, 0x8a2a, 0x8a2b, 0x8a2c, 0x8a2d, 0x8a2e, 0x8a2f,
+ 0x8a30, 0x8a31, 0x8a32, 0x8a33, 0x8a34, 0x8a35, 0x8a36, 0x8a37,
+ 0x8a38, 0x8a39, 0x8a3a, 0x8a3b, 0x8a3c, 0x8a3d, 0x8a3e, 0x8a3f,
+ 0x8a40, 0x8a41, 0x8a42, 0x8a43, 0x8a44, 0x8a45, 0x8a46, 0x8a47,
+ 0x8a48, 0x8a49, 0x8a4a, 0x8a4b, 0x8a4c, 0x8a4d, 0x8a4e, 0x8a4f,
+ 0x8a50, 0x8a51, 0x8a52, 0x8a53, 0x8a54, 0x8a55, 0x8a56, 0x8a57,
+ 0x8a58, 0x8a59, 0x8a5a, 0x8a5b, 0x8a5c, 0x8a5d, 0x8a5e, 0x8a5f,
+ 0x8a60, 0x8a61, 0x8a62, 0x8a63, 0x8a64, 0x8a65, 0x8a66, 0x8a67,
+ 0x8a68, 0x8a69, 0x8a6a, 0x8a6b, 0x8a6c, 0x8a6d, 0x8a6e, 0x8a6f,
+ 0x8a70, 0x8a71, 0x8a72, 0x8a73, 0x8a74, 0x8a75, 0x8a76, 0x8a77,
+ 0x8a78, 0x8a79, 0x8a7a, 0x8a7b, 0x8a7c, 0x8a7d, 0x8a7e, 0x8a7f,
+ 0x8a80, 0x8a81, 0x8a82, 0x8a83, 0x8a84, 0x8a85, 0x8a86, 0x8a87,
+ 0x8a88, 0x8a89, 0x8a8a, 0x8a8b, 0x8a8c, 0x8a8d, 0x8a8e, 0x8a8f,
+ 0x8a90, 0x8a91, 0x8a92, 0x8a93, 0x8a94, 0x8a95, 0x8a96, 0x8a97,
+ 0x8a98, 0x8a99, 0x8a9a, 0x8a9b, 0x8a9c, 0x8a9d, 0x8a9e, 0x8a9f,
+ 0x8aa0, 0x8aa1, 0x8aa2, 0x8aa3, 0x8aa4, 0x8aa5, 0x8aa6, 0x8aa7,
+ 0x8aa8, 0x8aa9, 0x8aaa, 0x8aab, 0x8aac, 0x8aad, 0x8aae, 0x8aaf,
+ 0x8ab0, 0x8ab1, 0x8ab2, 0x8ab3, 0x8ab4, 0x8ab5, 0x8ab6, 0x8ab7,
+ 0x8ab8, 0x8ab9, 0x8aba, 0x8abb, 0x8abc, 0x8abd, 0x8abe, 0x8abf,
+ 0x8ac0, 0x8ac1, 0x8ac2, 0x8ac3, 0x8ac4, 0x8ac5, 0x8ac6, 0x8ac7,
+ 0x8ac8, 0x8ac9, 0x8aca, 0x8acb, 0x8acc, 0x8acd, 0x8ace, 0x8acf,
+ 0x8ad0, 0x8ad1, 0x8ad2, 0x8ad3, 0x8ad4, 0x8ad5, 0x8ad6, 0x8ad7,
+ 0x8ad8, 0x8ad9, 0x8ada, 0x8adb, 0x8adc, 0x8add, 0x8ade, 0x8adf,
+ 0x8ae0, 0x8ae1, 0x8ae2, 0x8ae3, 0x8ae4, 0x8ae5, 0x8ae6, 0x8ae7,
+ 0x8ae8, 0x8ae9, 0x8aea, 0x8aeb, 0x8aec, 0x8aed, 0x8aee, 0x8aef,
+ 0x8af0, 0x8af1, 0x8af2, 0x8af3, 0x8af4, 0x8af5, 0x8af6, 0x8af7,
+ 0x8af8, 0x8af9, 0x8afa, 0x8afb, 0x8afc, 0x8afd, 0x8afe, 0x8aff,
+ 0x8b00, 0x8b01, 0x8b02, 0x8b03, 0x8b04, 0x8b05, 0x8b06, 0x8b07,
+ 0x8b08, 0x8b09, 0x8b0a, 0x8b0b, 0x8b0c, 0x8b0d, 0x8b0e, 0x8b0f,
+ 0x8b10, 0x8b11, 0x8b12, 0x8b13, 0x8b14, 0x8b15, 0x8b16, 0x8b17,
+ 0x8b18, 0x8b19, 0x8b1a, 0x8b1b, 0x8b1c, 0x8b1d, 0x8b1e, 0x8b1f,
+ 0x8b20, 0x8b21, 0x8b22, 0x8b23, 0x8b24, 0x8b25, 0x8b26, 0x8b27,
+ 0x8b28, 0x8b29, 0x8b2a, 0x8b2b, 0x8b2c, 0x8b2d, 0x8b2e, 0x8b2f,
+ 0x8b30, 0x8b31, 0x8b32, 0x8b33, 0x8b34, 0x8b35, 0x8b36, 0x8b37,
+ 0x8b38, 0x8b39, 0x8b3a, 0x8b3b, 0x8b3c, 0x8b3d, 0x8b3e, 0x8b3f,
+ 0x8b40, 0x8b41, 0x8b42, 0x8b43, 0x8b44, 0x8b45, 0x8b46, 0x8b47,
+ 0x8b48, 0x8b49, 0x8b4a, 0x8b4b, 0x8b4c, 0x8b4d, 0x8b4e, 0x8b4f,
+ 0x8b50, 0x8b51, 0x8b52, 0x8b53, 0x8b54, 0x8b55, 0x8b56, 0x8b57,
+ 0x8b58, 0x8b59, 0x8b5a, 0x8b5b, 0x8b5c, 0x8b5d, 0x8b5e, 0x8b5f,
+ 0x8b60, 0x8b61, 0x8b62, 0x8b63, 0x8b64, 0x8b65, 0x8b66, 0x8b67,
+ 0x8b68, 0x8b69, 0x8b6a, 0x8b6b, 0x8b6c, 0x8b6d, 0x8b6e, 0x8b6f,
+ 0x8b70, 0x8b71, 0x8b72, 0x8b73, 0x8b74, 0x8b75, 0x8b76, 0x8b77,
+ 0x8b78, 0x8b79, 0x8b7a, 0x8b7b, 0x8b7c, 0x8b7d, 0x8b7e, 0x8b7f,
+ 0x8b80, 0x8b81, 0x8b82, 0x8b83, 0x8b84, 0x8b85, 0x8b86, 0x8b87,
+ 0x8b88, 0x8b89, 0x8b8a, 0x8b8b, 0x8b8c, 0x8b8d, 0x8b8e, 0x8b8f,
+ 0x8b90, 0x8b91, 0x8b92, 0x8b93, 0x8b94, 0x8b95, 0x8b96, 0x8b97,
+ 0x8b98, 0x8b99, 0x8b9a, 0x8b9b, 0x8b9c, 0x8b9d, 0x8b9e, 0x8b9f,
+ 0x8ba0, 0x8ba1, 0x8ba2, 0x8ba3, 0x8ba4, 0x8ba5, 0x8ba6, 0x8ba7,
+ 0x8ba8, 0x8ba9, 0x8baa, 0x8bab, 0x8bac, 0x8bad, 0x8bae, 0x8baf,
+ 0x8bb0, 0x8bb1, 0x8bb2, 0x8bb3, 0x8bb4, 0x8bb5, 0x8bb6, 0x8bb7,
+ 0x8bb8, 0x8bb9, 0x8bba, 0x8bbb, 0x8bbc, 0x8bbd, 0x8bbe, 0x8bbf,
+ 0x8bc0, 0x8bc1, 0x8bc2, 0x8bc3, 0x8bc4, 0x8bc5, 0x8bc6, 0x8bc7,
+ 0x8bc8, 0x8bc9, 0x8bca, 0x8bcb, 0x8bcc, 0x8bcd, 0x8bce, 0x8bcf,
+ 0x8bd0, 0x8bd1, 0x8bd2, 0x8bd3, 0x8bd4, 0x8bd5, 0x8bd6, 0x8bd7,
+ 0x8bd8, 0x8bd9, 0x8bda, 0x8bdb, 0x8bdc, 0x8bdd, 0x8bde, 0x8bdf,
+ 0x8be0, 0x8be1, 0x8be2, 0x8be3, 0x8be4, 0x8be5, 0x8be6, 0x8be7,
+ 0x8be8, 0x8be9, 0x8bea, 0x8beb, 0x8bec, 0x8bed, 0x8bee, 0x8bef,
+ 0x8bf0, 0x8bf1, 0x8bf2, 0x8bf3, 0x8bf4, 0x8bf5, 0x8bf6, 0x8bf7,
+ 0x8bf8, 0x8bf9, 0x8bfa, 0x8bfb, 0x8bfc, 0x8bfd, 0x8bfe, 0x8bff,
+ 0x8c00, 0x8c01, 0x8c02, 0x8c03, 0x8c04, 0x8c05, 0x8c06, 0x8c07,
+ 0x8c08, 0x8c09, 0x8c0a, 0x8c0b, 0x8c0c, 0x8c0d, 0x8c0e, 0x8c0f,
+ 0x8c10, 0x8c11, 0x8c12, 0x8c13, 0x8c14, 0x8c15, 0x8c16, 0x8c17,
+ 0x8c18, 0x8c19, 0x8c1a, 0x8c1b, 0x8c1c, 0x8c1d, 0x8c1e, 0x8c1f,
+ 0x8c20, 0x8c21, 0x8c22, 0x8c23, 0x8c24, 0x8c25, 0x8c26, 0x8c27,
+ 0x8c28, 0x8c29, 0x8c2a, 0x8c2b, 0x8c2c, 0x8c2d, 0x8c2e, 0x8c2f,
+ 0x8c30, 0x8c31, 0x8c32, 0x8c33, 0x8c34, 0x8c35, 0x8c36, 0x8c37,
+ 0x8c38, 0x8c39, 0x8c3a, 0x8c3b, 0x8c3c, 0x8c3d, 0x8c3e, 0x8c3f,
+ 0x8c40, 0x8c41, 0x8c42, 0x8c43, 0x8c44, 0x8c45, 0x8c46, 0x8c47,
+ 0x8c48, 0x8c49, 0x8c4a, 0x8c4b, 0x8c4c, 0x8c4d, 0x8c4e, 0x8c4f,
+ 0x8c50, 0x8c51, 0x8c52, 0x8c53, 0x8c54, 0x8c55, 0x8c56, 0x8c57,
+ 0x8c58, 0x8c59, 0x8c5a, 0x8c5b, 0x8c5c, 0x8c5d, 0x8c5e, 0x8c5f,
+ 0x8c60, 0x8c61, 0x8c62, 0x8c63, 0x8c64, 0x8c65, 0x8c66, 0x8c67,
+ 0x8c68, 0x8c69, 0x8c6a, 0x8c6b, 0x8c6c, 0x8c6d, 0x8c6e, 0x8c6f,
+ 0x8c70, 0x8c71, 0x8c72, 0x8c73, 0x8c74, 0x8c75, 0x8c76, 0x8c77,
+ 0x8c78, 0x8c79, 0x8c7a, 0x8c7b, 0x8c7c, 0x8c7d, 0x8c7e, 0x8c7f,
+ 0x8c80, 0x8c81, 0x8c82, 0x8c83, 0x8c84, 0x8c85, 0x8c86, 0x8c87,
+ 0x8c88, 0x8c89, 0x8c8a, 0x8c8b, 0x8c8c, 0x8c8d, 0x8c8e, 0x8c8f,
+ 0x8c90, 0x8c91, 0x8c92, 0x8c93, 0x8c94, 0x8c95, 0x8c96, 0x8c97,
+ 0x8c98, 0x8c99, 0x8c9a, 0x8c9b, 0x8c9c, 0x8c9d, 0x8c9e, 0x8c9f,
+ 0x8ca0, 0x8ca1, 0x8ca2, 0x8ca3, 0x8ca4, 0x8ca5, 0x8ca6, 0x8ca7,
+ 0x8ca8, 0x8ca9, 0x8caa, 0x8cab, 0x8cac, 0x8cad, 0x8cae, 0x8caf,
+ 0x8cb0, 0x8cb1, 0x8cb2, 0x8cb3, 0x8cb4, 0x8cb5, 0x8cb6, 0x8cb7,
+ 0x8cb8, 0x8cb9, 0x8cba, 0x8cbb, 0x8cbc, 0x8cbd, 0x8cbe, 0x8cbf,
+ 0x8cc0, 0x8cc1, 0x8cc2, 0x8cc3, 0x8cc4, 0x8cc5, 0x8cc6, 0x8cc7,
+ 0x8cc8, 0x8cc9, 0x8cca, 0x8ccb, 0x8ccc, 0x8ccd, 0x8cce, 0x8ccf,
+ 0x8cd0, 0x8cd1, 0x8cd2, 0x8cd3, 0x8cd4, 0x8cd5, 0x8cd6, 0x8cd7,
+ 0x8cd8, 0x8cd9, 0x8cda, 0x8cdb, 0x8cdc, 0x8cdd, 0x8cde, 0x8cdf,
+ 0x8ce0, 0x8ce1, 0x8ce2, 0x8ce3, 0x8ce4, 0x8ce5, 0x8ce6, 0x8ce7,
+ 0x8ce8, 0x8ce9, 0x8cea, 0x8ceb, 0x8cec, 0x8ced, 0x8cee, 0x8cef,
+ 0x8cf0, 0x8cf1, 0x8cf2, 0x8cf3, 0x8cf4, 0x8cf5, 0x8cf6, 0x8cf7,
+ 0x8cf8, 0x8cf9, 0x8cfa, 0x8cfb, 0x8cfc, 0x8cfd, 0x8cfe, 0x8cff,
+ 0x8d00, 0x8d01, 0x8d02, 0x8d03, 0x8d04, 0x8d05, 0x8d06, 0x8d07,
+ 0x8d08, 0x8d09, 0x8d0a, 0x8d0b, 0x8d0c, 0x8d0d, 0x8d0e, 0x8d0f,
+ 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, 0x8d16, 0x8d17,
+ 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d1d, 0x8d1e, 0x8d1f,
+ 0x8d20, 0x8d21, 0x8d22, 0x8d23, 0x8d24, 0x8d25, 0x8d26, 0x8d27,
+ 0x8d28, 0x8d29, 0x8d2a, 0x8d2b, 0x8d2c, 0x8d2d, 0x8d2e, 0x8d2f,
+ 0x8d30, 0x8d31, 0x8d32, 0x8d33, 0x8d34, 0x8d35, 0x8d36, 0x8d37,
+ 0x8d38, 0x8d39, 0x8d3a, 0x8d3b, 0x8d3c, 0x8d3d, 0x8d3e, 0x8d3f,
+ 0x8d40, 0x8d41, 0x8d42, 0x8d43, 0x8d44, 0x8d45, 0x8d46, 0x8d47,
+ 0x8d48, 0x8d49, 0x8d4a, 0x8d4b, 0x8d4c, 0x8d4d, 0x8d4e, 0x8d4f,
+ 0x8d50, 0x8d51, 0x8d52, 0x8d53, 0x8d54, 0x8d55, 0x8d56, 0x8d57,
+ 0x8d58, 0x8d59, 0x8d5a, 0x8d5b, 0x8d5c, 0x8d5d, 0x8d5e, 0x8d5f,
+ 0x8d60, 0x8d61, 0x8d62, 0x8d63, 0x8d64, 0x8d65, 0x8d66, 0x8d67,
+ 0x8d68, 0x8d69, 0x8d6a, 0x8d6b, 0x8d6c, 0x8d6d, 0x8d6e, 0x8d6f,
+ 0x8d70, 0x8d71, 0x8d72, 0x8d73, 0x8d74, 0x8d75, 0x8d76, 0x8d77,
+ 0x8d78, 0x8d79, 0x8d7a, 0x8d7b, 0x8d7c, 0x8d7d, 0x8d7e, 0x8d7f,
+ 0x8d80, 0x8d81, 0x8d82, 0x8d83, 0x8d84, 0x8d85, 0x8d86, 0x8d87,
+ 0x8d88, 0x8d89, 0x8d8a, 0x8d8b, 0x8d8c, 0x8d8d, 0x8d8e, 0x8d8f,
+ 0x8d90, 0x8d91, 0x8d92, 0x8d93, 0x8d94, 0x8d95, 0x8d96, 0x8d97,
+ 0x8d98, 0x8d99, 0x8d9a, 0x8d9b, 0x8d9c, 0x8d9d, 0x8d9e, 0x8d9f,
+ 0x8da0, 0x8da1, 0x8da2, 0x8da3, 0x8da4, 0x8da5, 0x8da6, 0x8da7,
+ 0x8da8, 0x8da9, 0x8daa, 0x8dab, 0x8dac, 0x8dad, 0x8dae, 0x8daf,
+ 0x8db0, 0x8db1, 0x8db2, 0x8db3, 0x8db4, 0x8db5, 0x8db6, 0x8db7,
+ 0x8db8, 0x8db9, 0x8dba, 0x8dbb, 0x8dbc, 0x8dbd, 0x8dbe, 0x8dbf,
+ 0x8dc0, 0x8dc1, 0x8dc2, 0x8dc3, 0x8dc4, 0x8dc5, 0x8dc6, 0x8dc7,
+ 0x8dc8, 0x8dc9, 0x8dca, 0x8dcb, 0x8dcc, 0x8dcd, 0x8dce, 0x8dcf,
+ 0x8dd0, 0x8dd1, 0x8dd2, 0x8dd3, 0x8dd4, 0x8dd5, 0x8dd6, 0x8dd7,
+ 0x8dd8, 0x8dd9, 0x8dda, 0x8ddb, 0x8ddc, 0x8ddd, 0x8dde, 0x8ddf,
+ 0x8de0, 0x8de1, 0x8de2, 0x8de3, 0x8de4, 0x8de5, 0x8de6, 0x8de7,
+ 0x8de8, 0x8de9, 0x8dea, 0x8deb, 0x8dec, 0x8ded, 0x8dee, 0x8def,
+ 0x8df0, 0x8df1, 0x8df2, 0x8df3, 0x8df4, 0x8df5, 0x8df6, 0x8df7,
+ 0x8df8, 0x8df9, 0x8dfa, 0x8dfb, 0x8dfc, 0x8dfd, 0x8dfe, 0x8dff,
+ 0x8e00, 0x8e01, 0x8e02, 0x8e03, 0x8e04, 0x8e05, 0x8e06, 0x8e07,
+ 0x8e08, 0x8e09, 0x8e0a, 0x8e0b, 0x8e0c, 0x8e0d, 0x8e0e, 0x8e0f,
+ 0x8e10, 0x8e11, 0x8e12, 0x8e13, 0x8e14, 0x8e15, 0x8e16, 0x8e17,
+ 0x8e18, 0x8e19, 0x8e1a, 0x8e1b, 0x8e1c, 0x8e1d, 0x8e1e, 0x8e1f,
+ 0x8e20, 0x8e21, 0x8e22, 0x8e23, 0x8e24, 0x8e25, 0x8e26, 0x8e27,
+ 0x8e28, 0x8e29, 0x8e2a, 0x8e2b, 0x8e2c, 0x8e2d, 0x8e2e, 0x8e2f,
+ 0x8e30, 0x8e31, 0x8e32, 0x8e33, 0x8e34, 0x8e35, 0x8e36, 0x8e37,
+ 0x8e38, 0x8e39, 0x8e3a, 0x8e3b, 0x8e3c, 0x8e3d, 0x8e3e, 0x8e3f,
+ 0x8e40, 0x8e41, 0x8e42, 0x8e43, 0x8e44, 0x8e45, 0x8e46, 0x8e47,
+ 0x8e48, 0x8e49, 0x8e4a, 0x8e4b, 0x8e4c, 0x8e4d, 0x8e4e, 0x8e4f,
+ 0x8e50, 0x8e51, 0x8e52, 0x8e53, 0x8e54, 0x8e55, 0x8e56, 0x8e57,
+ 0x8e58, 0x8e59, 0x8e5a, 0x8e5b, 0x8e5c, 0x8e5d, 0x8e5e, 0x8e5f,
+ 0x8e60, 0x8e61, 0x8e62, 0x8e63, 0x8e64, 0x8e65, 0x8e66, 0x8e67,
+ 0x8e68, 0x8e69, 0x8e6a, 0x8e6b, 0x8e6c, 0x8e6d, 0x8e6e, 0x8e6f,
+ 0x8e70, 0x8e71, 0x8e72, 0x8e73, 0x8e74, 0x8e75, 0x8e76, 0x8e77,
+ 0x8e78, 0x8e79, 0x8e7a, 0x8e7b, 0x8e7c, 0x8e7d, 0x8e7e, 0x8e7f,
+ 0x8e80, 0x8e81, 0x8e82, 0x8e83, 0x8e84, 0x8e85, 0x8e86, 0x8e87,
+ 0x8e88, 0x8e89, 0x8e8a, 0x8e8b, 0x8e8c, 0x8e8d, 0x8e8e, 0x8e8f,
+ 0x8e90, 0x8e91, 0x8e92, 0x8e93, 0x8e94, 0x8e95, 0x8e96, 0x8e97,
+ 0x8e98, 0x8e99, 0x8e9a, 0x8e9b, 0x8e9c, 0x8e9d, 0x8e9e, 0x8e9f,
+ 0x8ea0, 0x8ea1, 0x8ea2, 0x8ea3, 0x8ea4, 0x8ea5, 0x8ea6, 0x8ea7,
+ 0x8ea8, 0x8ea9, 0x8eaa, 0x8eab, 0x8eac, 0x8ead, 0x8eae, 0x8eaf,
+ 0x8eb0, 0x8eb1, 0x8eb2, 0x8eb3, 0x8eb4, 0x8eb5, 0x8eb6, 0x8eb7,
+ 0x8eb8, 0x8eb9, 0x8eba, 0x8ebb, 0x8ebc, 0x8ebd, 0x8ebe, 0x8ebf,
+ 0x8ec0, 0x8ec1, 0x8ec2, 0x8ec3, 0x8ec4, 0x8ec5, 0x8ec6, 0x8ec7,
+ 0x8ec8, 0x8ec9, 0x8eca, 0x8ecb, 0x8ecc, 0x8ecd, 0x8ece, 0x8ecf,
+ 0x8ed0, 0x8ed1, 0x8ed2, 0x8ed3, 0x8ed4, 0x8ed5, 0x8ed6, 0x8ed7,
+ 0x8ed8, 0x8ed9, 0x8eda, 0x8edb, 0x8edc, 0x8edd, 0x8ede, 0x8edf,
+ 0x8ee0, 0x8ee1, 0x8ee2, 0x8ee3, 0x8ee4, 0x8ee5, 0x8ee6, 0x8ee7,
+ 0x8ee8, 0x8ee9, 0x8eea, 0x8eeb, 0x8eec, 0x8eed, 0x8eee, 0x8eef,
+ 0x8ef0, 0x8ef1, 0x8ef2, 0x8ef3, 0x8ef4, 0x8ef5, 0x8ef6, 0x8ef7,
+ 0x8ef8, 0x8ef9, 0x8efa, 0x8efb, 0x8efc, 0x8efd, 0x8efe, 0x8eff,
+ 0x8f00, 0x8f01, 0x8f02, 0x8f03, 0x8f04, 0x8f05, 0x8f06, 0x8f07,
+ 0x8f08, 0x8f09, 0x8f0a, 0x8f0b, 0x8f0c, 0x8f0d, 0x8f0e, 0x8f0f,
+ 0x8f10, 0x8f11, 0x8f12, 0x8f13, 0x8f14, 0x8f15, 0x8f16, 0x8f17,
+ 0x8f18, 0x8f19, 0x8f1a, 0x8f1b, 0x8f1c, 0x8f1d, 0x8f1e, 0x8f1f,
+ 0x8f20, 0x8f21, 0x8f22, 0x8f23, 0x8f24, 0x8f25, 0x8f26, 0x8f27,
+ 0x8f28, 0x8f29, 0x8f2a, 0x8f2b, 0x8f2c, 0x8f2d, 0x8f2e, 0x8f2f,
+ 0x8f30, 0x8f31, 0x8f32, 0x8f33, 0x8f34, 0x8f35, 0x8f36, 0x8f37,
+ 0x8f38, 0x8f39, 0x8f3a, 0x8f3b, 0x8f3c, 0x8f3d, 0x8f3e, 0x8f3f,
+ 0x8f40, 0x8f41, 0x8f42, 0x8f43, 0x8f44, 0x8f45, 0x8f46, 0x8f47,
+ 0x8f48, 0x8f49, 0x8f4a, 0x8f4b, 0x8f4c, 0x8f4d, 0x8f4e, 0x8f4f,
+ 0x8f50, 0x8f51, 0x8f52, 0x8f53, 0x8f54, 0x8f55, 0x8f56, 0x8f57,
+ 0x8f58, 0x8f59, 0x8f5a, 0x8f5b, 0x8f5c, 0x8f5d, 0x8f5e, 0x8f5f,
+ 0x8f60, 0x8f61, 0x8f62, 0x8f63, 0x8f64, 0x8f65, 0x8f66, 0x8f67,
+ 0x8f68, 0x8f69, 0x8f6a, 0x8f6b, 0x8f6c, 0x8f6d, 0x8f6e, 0x8f6f,
+ 0x8f70, 0x8f71, 0x8f72, 0x8f73, 0x8f74, 0x8f75, 0x8f76, 0x8f77,
+ 0x8f78, 0x8f79, 0x8f7a, 0x8f7b, 0x8f7c, 0x8f7d, 0x8f7e, 0x8f7f,
+ 0x8f80, 0x8f81, 0x8f82, 0x8f83, 0x8f84, 0x8f85, 0x8f86, 0x8f87,
+ 0x8f88, 0x8f89, 0x8f8a, 0x8f8b, 0x8f8c, 0x8f8d, 0x8f8e, 0x8f8f,
+ 0x8f90, 0x8f91, 0x8f92, 0x8f93, 0x8f94, 0x8f95, 0x8f96, 0x8f97,
+ 0x8f98, 0x8f99, 0x8f9a, 0x8f9b, 0x8f9c, 0x8f9d, 0x8f9e, 0x8f9f,
+ 0x8fa0, 0x8fa1, 0x8fa2, 0x8fa3, 0x8fa4, 0x8fa5, 0x8fa6, 0x8fa7,
+ 0x8fa8, 0x8fa9, 0x8faa, 0x8fab, 0x8fac, 0x8fad, 0x8fae, 0x8faf,
+ 0x8fb0, 0x8fb1, 0x8fb2, 0x8fb3, 0x8fb4, 0x8fb5, 0x8fb6, 0x8fb7,
+ 0x8fb8, 0x8fb9, 0x8fba, 0x8fbb, 0x8fbc, 0x8fbd, 0x8fbe, 0x8fbf,
+ 0x8fc0, 0x8fc1, 0x8fc2, 0x8fc3, 0x8fc4, 0x8fc5, 0x8fc6, 0x8fc7,
+ 0x8fc8, 0x8fc9, 0x8fca, 0x8fcb, 0x8fcc, 0x8fcd, 0x8fce, 0x8fcf,
+ 0x8fd0, 0x8fd1, 0x8fd2, 0x8fd3, 0x8fd4, 0x8fd5, 0x8fd6, 0x8fd7,
+ 0x8fd8, 0x8fd9, 0x8fda, 0x8fdb, 0x8fdc, 0x8fdd, 0x8fde, 0x8fdf,
+ 0x8fe0, 0x8fe1, 0x8fe2, 0x8fe3, 0x8fe4, 0x8fe5, 0x8fe6, 0x8fe7,
+ 0x8fe8, 0x8fe9, 0x8fea, 0x8feb, 0x8fec, 0x8fed, 0x8fee, 0x8fef,
+ 0x8ff0, 0x8ff1, 0x8ff2, 0x8ff3, 0x8ff4, 0x8ff5, 0x8ff6, 0x8ff7,
+ 0x8ff8, 0x8ff9, 0x8ffa, 0x8ffb, 0x8ffc, 0x8ffd, 0x8ffe, 0x8fff,
+ 0x9000, 0x9001, 0x9002, 0x9003, 0x9004, 0x9005, 0x9006, 0x9007,
+ 0x9008, 0x9009, 0x900a, 0x900b, 0x900c, 0x900d, 0x900e, 0x900f,
+ 0x9010, 0x9011, 0x9012, 0x9013, 0x9014, 0x9015, 0x9016, 0x9017,
+ 0x9018, 0x9019, 0x901a, 0x901b, 0x901c, 0x901d, 0x901e, 0x901f,
+ 0x9020, 0x9021, 0x9022, 0x9023, 0x9024, 0x9025, 0x9026, 0x9027,
+ 0x9028, 0x9029, 0x902a, 0x902b, 0x902c, 0x902d, 0x902e, 0x902f,
+ 0x9030, 0x9031, 0x9032, 0x9033, 0x9034, 0x9035, 0x9036, 0x9037,
+ 0x9038, 0x9039, 0x903a, 0x903b, 0x903c, 0x903d, 0x903e, 0x903f,
+ 0x9040, 0x9041, 0x9042, 0x9043, 0x9044, 0x9045, 0x9046, 0x9047,
+ 0x9048, 0x9049, 0x904a, 0x904b, 0x904c, 0x904d, 0x904e, 0x904f,
+ 0x9050, 0x9051, 0x9052, 0x9053, 0x9054, 0x9055, 0x9056, 0x9057,
+ 0x9058, 0x9059, 0x905a, 0x905b, 0x905c, 0x905d, 0x905e, 0x905f,
+ 0x9060, 0x9061, 0x9062, 0x9063, 0x9064, 0x9065, 0x9066, 0x9067,
+ 0x9068, 0x9069, 0x906a, 0x906b, 0x906c, 0x906d, 0x906e, 0x906f,
+ 0x9070, 0x9071, 0x9072, 0x9073, 0x9074, 0x9075, 0x9076, 0x9077,
+ 0x9078, 0x9079, 0x907a, 0x907b, 0x907c, 0x907d, 0x907e, 0x907f,
+ 0x9080, 0x9081, 0x9082, 0x9083, 0x9084, 0x9085, 0x9086, 0x9087,
+ 0x9088, 0x9089, 0x908a, 0x908b, 0x908c, 0x908d, 0x908e, 0x908f,
+ 0x9090, 0x9091, 0x9092, 0x9093, 0x9094, 0x9095, 0x9096, 0x9097,
+ 0x9098, 0x9099, 0x909a, 0x909b, 0x909c, 0x909d, 0x909e, 0x909f,
+ 0x90a0, 0x90a1, 0x90a2, 0x90a3, 0x90a4, 0x90a5, 0x90a6, 0x90a7,
+ 0x90a8, 0x90a9, 0x90aa, 0x90ab, 0x90ac, 0x90ad, 0x90ae, 0x90af,
+ 0x90b0, 0x90b1, 0x90b2, 0x90b3, 0x90b4, 0x90b5, 0x90b6, 0x90b7,
+ 0x90b8, 0x90b9, 0x90ba, 0x90bb, 0x90bc, 0x90bd, 0x90be, 0x90bf,
+ 0x90c0, 0x90c1, 0x90c2, 0x90c3, 0x90c4, 0x90c5, 0x90c6, 0x90c7,
+ 0x90c8, 0x90c9, 0x90ca, 0x90cb, 0x90cc, 0x90cd, 0x90ce, 0x90cf,
+ 0x90d0, 0x90d1, 0x90d2, 0x90d3, 0x90d4, 0x90d5, 0x90d6, 0x90d7,
+ 0x90d8, 0x90d9, 0x90da, 0x90db, 0x90dc, 0x90dd, 0x90de, 0x90df,
+ 0x90e0, 0x90e1, 0x90e2, 0x90e3, 0x90e4, 0x90e5, 0x90e6, 0x90e7,
+ 0x90e8, 0x90e9, 0x90ea, 0x90eb, 0x90ec, 0x90ed, 0x90ee, 0x90ef,
+ 0x90f0, 0x90f1, 0x90f2, 0x90f3, 0x90f4, 0x90f5, 0x90f6, 0x90f7,
+ 0x90f8, 0x90f9, 0x90fa, 0x90fb, 0x90fc, 0x90fd, 0x90fe, 0x90ff,
+ 0x9100, 0x9101, 0x9102, 0x9103, 0x9104, 0x9105, 0x9106, 0x9107,
+ 0x9108, 0x9109, 0x910a, 0x910b, 0x910c, 0x910d, 0x910e, 0x910f,
+ 0x9110, 0x9111, 0x9112, 0x9113, 0x9114, 0x9115, 0x9116, 0x9117,
+ 0x9118, 0x9119, 0x911a, 0x911b, 0x911c, 0x911d, 0x911e, 0x911f,
+ 0x9120, 0x9121, 0x9122, 0x9123, 0x9124, 0x9125, 0x9126, 0x9127,
+ 0x9128, 0x9129, 0x912a, 0x912b, 0x912c, 0x912d, 0x912e, 0x912f,
+ 0x9130, 0x9131, 0x9132, 0x9133, 0x9134, 0x9135, 0x9136, 0x9137,
+ 0x9138, 0x9139, 0x913a, 0x913b, 0x913c, 0x913d, 0x913e, 0x913f,
+ 0x9140, 0x9141, 0x9142, 0x9143, 0x9144, 0x9145, 0x9146, 0x9147,
+ 0x9148, 0x9149, 0x914a, 0x914b, 0x914c, 0x914d, 0x914e, 0x914f,
+ 0x9150, 0x9151, 0x9152, 0x9153, 0x9154, 0x9155, 0x9156, 0x9157,
+ 0x9158, 0x9159, 0x915a, 0x915b, 0x915c, 0x915d, 0x915e, 0x915f,
+ 0x9160, 0x9161, 0x9162, 0x9163, 0x9164, 0x9165, 0x9166, 0x9167,
+ 0x9168, 0x9169, 0x916a, 0x916b, 0x916c, 0x916d, 0x916e, 0x916f,
+ 0x9170, 0x9171, 0x9172, 0x9173, 0x9174, 0x9175, 0x9176, 0x9177,
+ 0x9178, 0x9179, 0x917a, 0x917b, 0x917c, 0x917d, 0x917e, 0x917f,
+ 0x9180, 0x9181, 0x9182, 0x9183, 0x9184, 0x9185, 0x9186, 0x9187,
+ 0x9188, 0x9189, 0x918a, 0x918b, 0x918c, 0x918d, 0x918e, 0x918f,
+ 0x9190, 0x9191, 0x9192, 0x9193, 0x9194, 0x9195, 0x9196, 0x9197,
+ 0x9198, 0x9199, 0x919a, 0x919b, 0x919c, 0x919d, 0x919e, 0x919f,
+ 0x91a0, 0x91a1, 0x91a2, 0x91a3, 0x91a4, 0x91a5, 0x91a6, 0x91a7,
+ 0x91a8, 0x91a9, 0x91aa, 0x91ab, 0x91ac, 0x91ad, 0x91ae, 0x91af,
+ 0x91b0, 0x91b1, 0x91b2, 0x91b3, 0x91b4, 0x91b5, 0x91b6, 0x91b7,
+ 0x91b8, 0x91b9, 0x91ba, 0x91bb, 0x91bc, 0x91bd, 0x91be, 0x91bf,
+ 0x91c0, 0x91c1, 0x91c2, 0x91c3, 0x91c4, 0x91c5, 0x91c6, 0x91c7,
+ 0x91c8, 0x91c9, 0x91ca, 0x91cb, 0x91cc, 0x91cd, 0x91ce, 0x91cf,
+ 0x91d0, 0x91d1, 0x91d2, 0x91d3, 0x91d4, 0x91d5, 0x91d6, 0x91d7,
+ 0x91d8, 0x91d9, 0x91da, 0x91db, 0x91dc, 0x91dd, 0x91de, 0x91df,
+ 0x91e0, 0x91e1, 0x91e2, 0x91e3, 0x91e4, 0x91e5, 0x91e6, 0x91e7,
+ 0x91e8, 0x91e9, 0x91ea, 0x91eb, 0x91ec, 0x91ed, 0x91ee, 0x91ef,
+ 0x91f0, 0x91f1, 0x91f2, 0x91f3, 0x91f4, 0x91f5, 0x91f6, 0x91f7,
+ 0x91f8, 0x91f9, 0x91fa, 0x91fb, 0x91fc, 0x91fd, 0x91fe, 0x91ff,
+ 0x9200, 0x9201, 0x9202, 0x9203, 0x9204, 0x9205, 0x9206, 0x9207,
+ 0x9208, 0x9209, 0x920a, 0x920b, 0x920c, 0x920d, 0x920e, 0x920f,
+ 0x9210, 0x9211, 0x9212, 0x9213, 0x9214, 0x9215, 0x9216, 0x9217,
+ 0x9218, 0x9219, 0x921a, 0x921b, 0x921c, 0x921d, 0x921e, 0x921f,
+ 0x9220, 0x9221, 0x9222, 0x9223, 0x9224, 0x9225, 0x9226, 0x9227,
+ 0x9228, 0x9229, 0x922a, 0x922b, 0x922c, 0x922d, 0x922e, 0x922f,
+ 0x9230, 0x9231, 0x9232, 0x9233, 0x9234, 0x9235, 0x9236, 0x9237,
+ 0x9238, 0x9239, 0x923a, 0x923b, 0x923c, 0x923d, 0x923e, 0x923f,
+ 0x9240, 0x9241, 0x9242, 0x9243, 0x9244, 0x9245, 0x9246, 0x9247,
+ 0x9248, 0x9249, 0x924a, 0x924b, 0x924c, 0x924d, 0x924e, 0x924f,
+ 0x9250, 0x9251, 0x9252, 0x9253, 0x9254, 0x9255, 0x9256, 0x9257,
+ 0x9258, 0x9259, 0x925a, 0x925b, 0x925c, 0x925d, 0x925e, 0x925f,
+ 0x9260, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, 0x9266, 0x9267,
+ 0x9268, 0x9269, 0x926a, 0x926b, 0x926c, 0x926d, 0x926e, 0x926f,
+ 0x9270, 0x9271, 0x9272, 0x9273, 0x9274, 0x9275, 0x9276, 0x9277,
+ 0x9278, 0x9279, 0x927a, 0x927b, 0x927c, 0x927d, 0x927e, 0x927f,
+ 0x9280, 0x9281, 0x9282, 0x9283, 0x9284, 0x9285, 0x9286, 0x9287,
+ 0x9288, 0x9289, 0x928a, 0x928b, 0x928c, 0x928d, 0x928e, 0x928f,
+ 0x9290, 0x9291, 0x9292, 0x9293, 0x9294, 0x9295, 0x9296, 0x9297,
+ 0x9298, 0x9299, 0x929a, 0x929b, 0x929c, 0x929d, 0x929e, 0x929f,
+ 0x92a0, 0x92a1, 0x92a2, 0x92a3, 0x92a4, 0x92a5, 0x92a6, 0x92a7,
+ 0x92a8, 0x92a9, 0x92aa, 0x92ab, 0x92ac, 0x92ad, 0x92ae, 0x92af,
+ 0x92b0, 0x92b1, 0x92b2, 0x92b3, 0x92b4, 0x92b5, 0x92b6, 0x92b7,
+ 0x92b8, 0x92b9, 0x92ba, 0x92bb, 0x92bc, 0x92bd, 0x92be, 0x92bf,
+ 0x92c0, 0x92c1, 0x92c2, 0x92c3, 0x92c4, 0x92c5, 0x92c6, 0x92c7,
+ 0x92c8, 0x92c9, 0x92ca, 0x92cb, 0x92cc, 0x92cd, 0x92ce, 0x92cf,
+ 0x92d0, 0x92d1, 0x92d2, 0x92d3, 0x92d4, 0x92d5, 0x92d6, 0x92d7,
+ 0x92d8, 0x92d9, 0x92da, 0x92db, 0x92dc, 0x92dd, 0x92de, 0x92df,
+ 0x92e0, 0x92e1, 0x92e2, 0x92e3, 0x92e4, 0x92e5, 0x92e6, 0x92e7,
+ 0x92e8, 0x92e9, 0x92ea, 0x92eb, 0x92ec, 0x92ed, 0x92ee, 0x92ef,
+ 0x92f0, 0x92f1, 0x92f2, 0x92f3, 0x92f4, 0x92f5, 0x92f6, 0x92f7,
+ 0x92f8, 0x92f9, 0x92fa, 0x92fb, 0x92fc, 0x92fd, 0x92fe, 0x92ff,
+ 0x9300, 0x9301, 0x9302, 0x9303, 0x9304, 0x9305, 0x9306, 0x9307,
+ 0x9308, 0x9309, 0x930a, 0x930b, 0x930c, 0x930d, 0x930e, 0x930f,
+ 0x9310, 0x9311, 0x9312, 0x9313, 0x9314, 0x9315, 0x9316, 0x9317,
+ 0x9318, 0x9319, 0x931a, 0x931b, 0x931c, 0x931d, 0x931e, 0x931f,
+ 0x9320, 0x9321, 0x9322, 0x9323, 0x9324, 0x9325, 0x9326, 0x9327,
+ 0x9328, 0x9329, 0x932a, 0x932b, 0x932c, 0x932d, 0x932e, 0x932f,
+ 0x9330, 0x9331, 0x9332, 0x9333, 0x9334, 0x9335, 0x9336, 0x9337,
+ 0x9338, 0x9339, 0x933a, 0x933b, 0x933c, 0x933d, 0x933e, 0x933f,
+ 0x9340, 0x9341, 0x9342, 0x9343, 0x9344, 0x9345, 0x9346, 0x9347,
+ 0x9348, 0x9349, 0x934a, 0x934b, 0x934c, 0x934d, 0x934e, 0x934f,
+ 0x9350, 0x9351, 0x9352, 0x9353, 0x9354, 0x9355, 0x9356, 0x9357,
+ 0x9358, 0x9359, 0x935a, 0x935b, 0x935c, 0x935d, 0x935e, 0x935f,
+ 0x9360, 0x9361, 0x9362, 0x9363, 0x9364, 0x9365, 0x9366, 0x9367,
+ 0x9368, 0x9369, 0x936a, 0x936b, 0x936c, 0x936d, 0x936e, 0x936f,
+ 0x9370, 0x9371, 0x9372, 0x9373, 0x9374, 0x9375, 0x9376, 0x9377,
+ 0x9378, 0x9379, 0x937a, 0x937b, 0x937c, 0x937d, 0x937e, 0x937f,
+ 0x9380, 0x9381, 0x9382, 0x9383, 0x9384, 0x9385, 0x9386, 0x9387,
+ 0x9388, 0x9389, 0x938a, 0x938b, 0x938c, 0x938d, 0x938e, 0x938f,
+ 0x9390, 0x9391, 0x9392, 0x9393, 0x9394, 0x9395, 0x9396, 0x9397,
+ 0x9398, 0x9399, 0x939a, 0x939b, 0x939c, 0x939d, 0x939e, 0x939f,
+ 0x93a0, 0x93a1, 0x93a2, 0x93a3, 0x93a4, 0x93a5, 0x93a6, 0x93a7,
+ 0x93a8, 0x93a9, 0x93aa, 0x93ab, 0x93ac, 0x93ad, 0x93ae, 0x93af,
+ 0x93b0, 0x93b1, 0x93b2, 0x93b3, 0x93b4, 0x93b5, 0x93b6, 0x93b7,
+ 0x93b8, 0x93b9, 0x93ba, 0x93bb, 0x93bc, 0x93bd, 0x93be, 0x93bf,
+ 0x93c0, 0x93c1, 0x93c2, 0x93c3, 0x93c4, 0x93c5, 0x93c6, 0x93c7,
+ 0x93c8, 0x93c9, 0x93ca, 0x93cb, 0x93cc, 0x93cd, 0x93ce, 0x93cf,
+ 0x93d0, 0x93d1, 0x93d2, 0x93d3, 0x93d4, 0x93d5, 0x93d6, 0x93d7,
+ 0x93d8, 0x93d9, 0x93da, 0x93db, 0x93dc, 0x93dd, 0x93de, 0x93df,
+ 0x93e0, 0x93e1, 0x93e2, 0x93e3, 0x93e4, 0x93e5, 0x93e6, 0x93e7,
+ 0x93e8, 0x93e9, 0x93ea, 0x93eb, 0x93ec, 0x93ed, 0x93ee, 0x93ef,
+ 0x93f0, 0x93f1, 0x93f2, 0x93f3, 0x93f4, 0x93f5, 0x93f6, 0x93f7,
+ 0x93f8, 0x93f9, 0x93fa, 0x93fb, 0x93fc, 0x93fd, 0x93fe, 0x93ff,
+ 0x9400, 0x9401, 0x9402, 0x9403, 0x9404, 0x9405, 0x9406, 0x9407,
+ 0x9408, 0x9409, 0x940a, 0x940b, 0x940c, 0x940d, 0x940e, 0x940f,
+ 0x9410, 0x9411, 0x9412, 0x9413, 0x9414, 0x9415, 0x9416, 0x9417,
+ 0x9418, 0x9419, 0x941a, 0x941b, 0x941c, 0x941d, 0x941e, 0x941f,
+ 0x9420, 0x9421, 0x9422, 0x9423, 0x9424, 0x9425, 0x9426, 0x9427,
+ 0x9428, 0x9429, 0x942a, 0x942b, 0x942c, 0x942d, 0x942e, 0x942f,
+ 0x9430, 0x9431, 0x9432, 0x9433, 0x9434, 0x9435, 0x9436, 0x9437,
+ 0x9438, 0x9439, 0x943a, 0x943b, 0x943c, 0x943d, 0x943e, 0x943f,
+ 0x9440, 0x9441, 0x9442, 0x9443, 0x9444, 0x9445, 0x9446, 0x9447,
+ 0x9448, 0x9449, 0x944a, 0x944b, 0x944c, 0x944d, 0x944e, 0x944f,
+ 0x9450, 0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457,
+ 0x9458, 0x9459, 0x945a, 0x945b, 0x945c, 0x945d, 0x945e, 0x945f,
+ 0x9460, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467,
+ 0x9468, 0x9469, 0x946a, 0x946b, 0x946c, 0x946d, 0x946e, 0x946f,
+ 0x9470, 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, 0x9476, 0x9477,
+ 0x9478, 0x9479, 0x947a, 0x947b, 0x947c, 0x947d, 0x947e, 0x947f,
+ 0x9480, 0x9481, 0x9482, 0x9483, 0x9484, 0x9485, 0x9486, 0x9487,
+ 0x9488, 0x9489, 0x948a, 0x948b, 0x948c, 0x948d, 0x948e, 0x948f,
+ 0x9490, 0x9491, 0x9492, 0x9493, 0x9494, 0x9495, 0x9496, 0x9497,
+ 0x9498, 0x9499, 0x949a, 0x949b, 0x949c, 0x949d, 0x949e, 0x949f,
+ 0x94a0, 0x94a1, 0x94a2, 0x94a3, 0x94a4, 0x94a5, 0x94a6, 0x94a7,
+ 0x94a8, 0x94a9, 0x94aa, 0x94ab, 0x94ac, 0x94ad, 0x94ae, 0x94af,
+ 0x94b0, 0x94b1, 0x94b2, 0x94b3, 0x94b4, 0x94b5, 0x94b6, 0x94b7,
+ 0x94b8, 0x94b9, 0x94ba, 0x94bb, 0x94bc, 0x94bd, 0x94be, 0x94bf,
+ 0x94c0, 0x94c1, 0x94c2, 0x94c3, 0x94c4, 0x94c5, 0x94c6, 0x94c7,
+ 0x94c8, 0x94c9, 0x94ca, 0x94cb, 0x94cc, 0x94cd, 0x94ce, 0x94cf,
+ 0x94d0, 0x94d1, 0x94d2, 0x94d3, 0x94d4, 0x94d5, 0x94d6, 0x94d7,
+ 0x94d8, 0x94d9, 0x94da, 0x94db, 0x94dc, 0x94dd, 0x94de, 0x94df,
+ 0x94e0, 0x94e1, 0x94e2, 0x94e3, 0x94e4, 0x94e5, 0x94e6, 0x94e7,
+ 0x94e8, 0x94e9, 0x94ea, 0x94eb, 0x94ec, 0x94ed, 0x94ee, 0x94ef,
+ 0x94f0, 0x94f1, 0x94f2, 0x94f3, 0x94f4, 0x94f5, 0x94f6, 0x94f7,
+ 0x94f8, 0x94f9, 0x94fa, 0x94fb, 0x94fc, 0x94fd, 0x94fe, 0x94ff,
+ 0x9500, 0x9501, 0x9502, 0x9503, 0x9504, 0x9505, 0x9506, 0x9507,
+ 0x9508, 0x9509, 0x950a, 0x950b, 0x950c, 0x950d, 0x950e, 0x950f,
+ 0x9510, 0x9511, 0x9512, 0x9513, 0x9514, 0x9515, 0x9516, 0x9517,
+ 0x9518, 0x9519, 0x951a, 0x951b, 0x951c, 0x951d, 0x951e, 0x951f,
+ 0x9520, 0x9521, 0x9522, 0x9523, 0x9524, 0x9525, 0x9526, 0x9527,
+ 0x9528, 0x9529, 0x952a, 0x952b, 0x952c, 0x952d, 0x952e, 0x952f,
+ 0x9530, 0x9531, 0x9532, 0x9533, 0x9534, 0x9535, 0x9536, 0x9537,
+ 0x9538, 0x9539, 0x953a, 0x953b, 0x953c, 0x953d, 0x953e, 0x953f,
+ 0x9540, 0x9541, 0x9542, 0x9543, 0x9544, 0x9545, 0x9546, 0x9547,
+ 0x9548, 0x9549, 0x954a, 0x954b, 0x954c, 0x954d, 0x954e, 0x954f,
+ 0x9550, 0x9551, 0x9552, 0x9553, 0x9554, 0x9555, 0x9556, 0x9557,
+ 0x9558, 0x9559, 0x955a, 0x955b, 0x955c, 0x955d, 0x955e, 0x955f,
+ 0x9560, 0x9561, 0x9562, 0x9563, 0x9564, 0x9565, 0x9566, 0x9567,
+ 0x9568, 0x9569, 0x956a, 0x956b, 0x956c, 0x956d, 0x956e, 0x956f,
+ 0x9570, 0x9571, 0x9572, 0x9573, 0x9574, 0x9575, 0x9576, 0x9577,
+ 0x9578, 0x9579, 0x957a, 0x957b, 0x957c, 0x957d, 0x957e, 0x957f,
+ 0x9580, 0x9581, 0x9582, 0x9583, 0x9584, 0x9585, 0x9586, 0x9587,
+ 0x9588, 0x9589, 0x958a, 0x958b, 0x958c, 0x958d, 0x958e, 0x958f,
+ 0x9590, 0x9591, 0x9592, 0x9593, 0x9594, 0x9595, 0x9596, 0x9597,
+ 0x9598, 0x9599, 0x959a, 0x959b, 0x959c, 0x959d, 0x959e, 0x959f,
+ 0x95a0, 0x95a1, 0x95a2, 0x95a3, 0x95a4, 0x95a5, 0x95a6, 0x95a7,
+ 0x95a8, 0x95a9, 0x95aa, 0x95ab, 0x95ac, 0x95ad, 0x95ae, 0x95af,
+ 0x95b0, 0x95b1, 0x95b2, 0x95b3, 0x95b4, 0x95b5, 0x95b6, 0x95b7,
+ 0x95b8, 0x95b9, 0x95ba, 0x95bb, 0x95bc, 0x95bd, 0x95be, 0x95bf,
+ 0x95c0, 0x95c1, 0x95c2, 0x95c3, 0x95c4, 0x95c5, 0x95c6, 0x95c7,
+ 0x95c8, 0x95c9, 0x95ca, 0x95cb, 0x95cc, 0x95cd, 0x95ce, 0x95cf,
+ 0x95d0, 0x95d1, 0x95d2, 0x95d3, 0x95d4, 0x95d5, 0x95d6, 0x95d7,
+ 0x95d8, 0x95d9, 0x95da, 0x95db, 0x95dc, 0x95dd, 0x95de, 0x95df,
+ 0x95e0, 0x95e1, 0x95e2, 0x95e3, 0x95e4, 0x95e5, 0x95e6, 0x95e7,
+ 0x95e8, 0x95e9, 0x95ea, 0x95eb, 0x95ec, 0x95ed, 0x95ee, 0x95ef,
+ 0x95f0, 0x95f1, 0x95f2, 0x95f3, 0x95f4, 0x95f5, 0x95f6, 0x95f7,
+ 0x95f8, 0x95f9, 0x95fa, 0x95fb, 0x95fc, 0x95fd, 0x95fe, 0x95ff,
+ 0x9600, 0x9601, 0x9602, 0x9603, 0x9604, 0x9605, 0x9606, 0x9607,
+ 0x9608, 0x9609, 0x960a, 0x960b, 0x960c, 0x960d, 0x960e, 0x960f,
+ 0x9610, 0x9611, 0x9612, 0x9613, 0x9614, 0x9615, 0x9616, 0x9617,
+ 0x9618, 0x9619, 0x961a, 0x961b, 0x961c, 0x961d, 0x961e, 0x961f,
+ 0x9620, 0x9621, 0x9622, 0x9623, 0x9624, 0x9625, 0x9626, 0x9627,
+ 0x9628, 0x9629, 0x962a, 0x962b, 0x962c, 0x962d, 0x962e, 0x962f,
+ 0x9630, 0x9631, 0x9632, 0x9633, 0x9634, 0x9635, 0x9636, 0x9637,
+ 0x9638, 0x9639, 0x963a, 0x963b, 0x963c, 0x963d, 0x963e, 0x963f,
+ 0x9640, 0x9641, 0x9642, 0x9643, 0x9644, 0x9645, 0x9646, 0x9647,
+ 0x9648, 0x9649, 0x964a, 0x964b, 0x964c, 0x964d, 0x964e, 0x964f,
+ 0x9650, 0x9651, 0x9652, 0x9653, 0x9654, 0x9655, 0x9656, 0x9657,
+ 0x9658, 0x9659, 0x965a, 0x965b, 0x965c, 0x965d, 0x965e, 0x965f,
+ 0x9660, 0x9661, 0x9662, 0x9663, 0x9664, 0x9665, 0x9666, 0x9667,
+ 0x9668, 0x9669, 0x966a, 0x966b, 0x966c, 0x966d, 0x966e, 0x966f,
+ 0x9670, 0x9671, 0x9672, 0x9673, 0x9674, 0x9675, 0x9676, 0x9677,
+ 0x9678, 0x9679, 0x967a, 0x967b, 0x967c, 0x967d, 0x967e, 0x967f,
+ 0x9680, 0x9681, 0x9682, 0x9683, 0x9684, 0x9685, 0x9686, 0x9687,
+ 0x9688, 0x9689, 0x968a, 0x968b, 0x968c, 0x968d, 0x968e, 0x968f,
+ 0x9690, 0x9691, 0x9692, 0x9693, 0x9694, 0x9695, 0x9696, 0x9697,
+ 0x9698, 0x9699, 0x969a, 0x969b, 0x969c, 0x969d, 0x969e, 0x969f,
+ 0x96a0, 0x96a1, 0x96a2, 0x96a3, 0x96a4, 0x96a5, 0x96a6, 0x96a7,
+ 0x96a8, 0x96a9, 0x96aa, 0x96ab, 0x96ac, 0x96ad, 0x96ae, 0x96af,
+ 0x96b0, 0x96b1, 0x96b2, 0x96b3, 0x96b4, 0x96b5, 0x96b6, 0x96b7,
+ 0x96b8, 0x96b9, 0x96ba, 0x96bb, 0x96bc, 0x96bd, 0x96be, 0x96bf,
+ 0x96c0, 0x96c1, 0x96c2, 0x96c3, 0x96c4, 0x96c5, 0x96c6, 0x96c7,
+ 0x96c8, 0x96c9, 0x96ca, 0x96cb, 0x96cc, 0x96cd, 0x96ce, 0x96cf,
+ 0x96d0, 0x96d1, 0x96d2, 0x96d3, 0x96d4, 0x96d5, 0x96d6, 0x96d7,
+ 0x96d8, 0x96d9, 0x96da, 0x96db, 0x96dc, 0x96dd, 0x96de, 0x96df,
+ 0x96e0, 0x96e1, 0x96e2, 0x96e3, 0x96e4, 0x96e5, 0x96e6, 0x96e7,
+ 0x96e8, 0x96e9, 0x96ea, 0x96eb, 0x96ec, 0x96ed, 0x96ee, 0x96ef,
+ 0x96f0, 0x96f1, 0x96f2, 0x96f3, 0x96f4, 0x96f5, 0x96f6, 0x96f7,
+ 0x96f8, 0x96f9, 0x96fa, 0x96fb, 0x96fc, 0x96fd, 0x96fe, 0x96ff,
+ 0x9700, 0x9701, 0x9702, 0x9703, 0x9704, 0x9705, 0x9706, 0x9707,
+ 0x9708, 0x9709, 0x970a, 0x970b, 0x970c, 0x970d, 0x970e, 0x970f,
+ 0x9710, 0x9711, 0x9712, 0x9713, 0x9714, 0x9715, 0x9716, 0x9717,
+ 0x9718, 0x9719, 0x971a, 0x971b, 0x971c, 0x971d, 0x971e, 0x971f,
+ 0x9720, 0x9721, 0x9722, 0x9723, 0x9724, 0x9725, 0x9726, 0x9727,
+ 0x9728, 0x9729, 0x972a, 0x972b, 0x972c, 0x972d, 0x972e, 0x972f,
+ 0x9730, 0x9731, 0x9732, 0x9733, 0x9734, 0x9735, 0x9736, 0x9737,
+ 0x9738, 0x9739, 0x973a, 0x973b, 0x973c, 0x973d, 0x973e, 0x973f,
+ 0x9740, 0x9741, 0x9742, 0x9743, 0x9744, 0x9745, 0x9746, 0x9747,
+ 0x9748, 0x9749, 0x974a, 0x974b, 0x974c, 0x974d, 0x974e, 0x974f,
+ 0x9750, 0x9751, 0x9752, 0x9753, 0x9754, 0x9755, 0x9756, 0x9757,
+ 0x9758, 0x9759, 0x975a, 0x975b, 0x975c, 0x975d, 0x975e, 0x975f,
+ 0x9760, 0x9761, 0x9762, 0x9763, 0x9764, 0x9765, 0x9766, 0x9767,
+ 0x9768, 0x9769, 0x976a, 0x976b, 0x976c, 0x976d, 0x976e, 0x976f,
+ 0x9770, 0x9771, 0x9772, 0x9773, 0x9774, 0x9775, 0x9776, 0x9777,
+ 0x9778, 0x9779, 0x977a, 0x977b, 0x977c, 0x977d, 0x977e, 0x977f,
+ 0x9780, 0x9781, 0x9782, 0x9783, 0x9784, 0x9785, 0x9786, 0x9787,
+ 0x9788, 0x9789, 0x978a, 0x978b, 0x978c, 0x978d, 0x978e, 0x978f,
+ 0x9790, 0x9791, 0x9792, 0x9793, 0x9794, 0x9795, 0x9796, 0x9797,
+ 0x9798, 0x9799, 0x979a, 0x979b, 0x979c, 0x979d, 0x979e, 0x979f,
+ 0x97a0, 0x97a1, 0x97a2, 0x97a3, 0x97a4, 0x97a5, 0x97a6, 0x97a7,
+ 0x97a8, 0x97a9, 0x97aa, 0x97ab, 0x97ac, 0x97ad, 0x97ae, 0x97af,
+ 0x97b0, 0x97b1, 0x97b2, 0x97b3, 0x97b4, 0x97b5, 0x97b6, 0x97b7,
+ 0x97b8, 0x97b9, 0x97ba, 0x97bb, 0x97bc, 0x97bd, 0x97be, 0x97bf,
+ 0x97c0, 0x97c1, 0x97c2, 0x97c3, 0x97c4, 0x97c5, 0x97c6, 0x97c7,
+ 0x97c8, 0x97c9, 0x97ca, 0x97cb, 0x97cc, 0x97cd, 0x97ce, 0x97cf,
+ 0x97d0, 0x97d1, 0x97d2, 0x97d3, 0x97d4, 0x97d5, 0x97d6, 0x97d7,
+ 0x97d8, 0x97d9, 0x97da, 0x97db, 0x97dc, 0x97dd, 0x97de, 0x97df,
+ 0x97e0, 0x97e1, 0x97e2, 0x97e3, 0x97e4, 0x97e5, 0x97e6, 0x97e7,
+ 0x97e8, 0x97e9, 0x97ea, 0x97eb, 0x97ec, 0x97ed, 0x97ee, 0x97ef,
+ 0x97f0, 0x97f1, 0x97f2, 0x97f3, 0x97f4, 0x97f5, 0x97f6, 0x97f7,
+ 0x97f8, 0x97f9, 0x97fa, 0x97fb, 0x97fc, 0x97fd, 0x97fe, 0x97ff,
+ 0x9800, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9806, 0x9807,
+ 0x9808, 0x9809, 0x980a, 0x980b, 0x980c, 0x980d, 0x980e, 0x980f,
+ 0x9810, 0x9811, 0x9812, 0x9813, 0x9814, 0x9815, 0x9816, 0x9817,
+ 0x9818, 0x9819, 0x981a, 0x981b, 0x981c, 0x981d, 0x981e, 0x981f,
+ 0x9820, 0x9821, 0x9822, 0x9823, 0x9824, 0x9825, 0x9826, 0x9827,
+ 0x9828, 0x9829, 0x982a, 0x982b, 0x982c, 0x982d, 0x982e, 0x982f,
+ 0x9830, 0x9831, 0x9832, 0x9833, 0x9834, 0x9835, 0x9836, 0x9837,
+ 0x9838, 0x9839, 0x983a, 0x983b, 0x983c, 0x983d, 0x983e, 0x983f,
+ 0x9840, 0x9841, 0x9842, 0x9843, 0x9844, 0x9845, 0x9846, 0x9847,
+ 0x9848, 0x9849, 0x984a, 0x984b, 0x984c, 0x984d, 0x984e, 0x984f,
+ 0x9850, 0x9851, 0x9852, 0x9853, 0x9854, 0x9855, 0x9856, 0x9857,
+ 0x9858, 0x9859, 0x985a, 0x985b, 0x985c, 0x985d, 0x985e, 0x985f,
+ 0x9860, 0x9861, 0x9862, 0x9863, 0x9864, 0x9865, 0x9866, 0x9867,
+ 0x9868, 0x9869, 0x986a, 0x986b, 0x986c, 0x986d, 0x986e, 0x986f,
+ 0x9870, 0x9871, 0x9872, 0x9873, 0x9874, 0x9875, 0x9876, 0x9877,
+ 0x9878, 0x9879, 0x987a, 0x987b, 0x987c, 0x987d, 0x987e, 0x987f,
+ 0x9880, 0x9881, 0x9882, 0x9883, 0x9884, 0x9885, 0x9886, 0x9887,
+ 0x9888, 0x9889, 0x988a, 0x988b, 0x988c, 0x988d, 0x988e, 0x988f,
+ 0x9890, 0x9891, 0x9892, 0x9893, 0x9894, 0x9895, 0x9896, 0x9897,
+ 0x9898, 0x9899, 0x989a, 0x989b, 0x989c, 0x989d, 0x989e, 0x989f,
+ 0x98a0, 0x98a1, 0x98a2, 0x98a3, 0x98a4, 0x98a5, 0x98a6, 0x98a7,
+ 0x98a8, 0x98a9, 0x98aa, 0x98ab, 0x98ac, 0x98ad, 0x98ae, 0x98af,
+ 0x98b0, 0x98b1, 0x98b2, 0x98b3, 0x98b4, 0x98b5, 0x98b6, 0x98b7,
+ 0x98b8, 0x98b9, 0x98ba, 0x98bb, 0x98bc, 0x98bd, 0x98be, 0x98bf,
+ 0x98c0, 0x98c1, 0x98c2, 0x98c3, 0x98c4, 0x98c5, 0x98c6, 0x98c7,
+ 0x98c8, 0x98c9, 0x98ca, 0x98cb, 0x98cc, 0x98cd, 0x98ce, 0x98cf,
+ 0x98d0, 0x98d1, 0x98d2, 0x98d3, 0x98d4, 0x98d5, 0x98d6, 0x98d7,
+ 0x98d8, 0x98d9, 0x98da, 0x98db, 0x98dc, 0x98dd, 0x98de, 0x98df,
+ 0x98e0, 0x98e1, 0x98e2, 0x98e3, 0x98e4, 0x98e5, 0x98e6, 0x98e7,
+ 0x98e8, 0x98e9, 0x98ea, 0x98eb, 0x98ec, 0x98ed, 0x98ee, 0x98ef,
+ 0x98f0, 0x98f1, 0x98f2, 0x98f3, 0x98f4, 0x98f5, 0x98f6, 0x98f7,
+ 0x98f8, 0x98f9, 0x98fa, 0x98fb, 0x98fc, 0x98fd, 0x98fe, 0x98ff,
+ 0x9900, 0x9901, 0x9902, 0x9903, 0x9904, 0x9905, 0x9906, 0x9907,
+ 0x9908, 0x9909, 0x990a, 0x990b, 0x990c, 0x990d, 0x990e, 0x990f,
+ 0x9910, 0x9911, 0x9912, 0x9913, 0x9914, 0x9915, 0x9916, 0x9917,
+ 0x9918, 0x9919, 0x991a, 0x991b, 0x991c, 0x991d, 0x991e, 0x991f,
+ 0x9920, 0x9921, 0x9922, 0x9923, 0x9924, 0x9925, 0x9926, 0x9927,
+ 0x9928, 0x9929, 0x992a, 0x992b, 0x992c, 0x992d, 0x992e, 0x992f,
+ 0x9930, 0x9931, 0x9932, 0x9933, 0x9934, 0x9935, 0x9936, 0x9937,
+ 0x9938, 0x9939, 0x993a, 0x993b, 0x993c, 0x993d, 0x993e, 0x993f,
+ 0x9940, 0x9941, 0x9942, 0x9943, 0x9944, 0x9945, 0x9946, 0x9947,
+ 0x9948, 0x9949, 0x994a, 0x994b, 0x994c, 0x994d, 0x994e, 0x994f,
+ 0x9950, 0x9951, 0x9952, 0x9953, 0x9954, 0x9955, 0x9956, 0x9957,
+ 0x9958, 0x9959, 0x995a, 0x995b, 0x995c, 0x995d, 0x995e, 0x995f,
+ 0x9960, 0x9961, 0x9962, 0x9963, 0x9964, 0x9965, 0x9966, 0x9967,
+ 0x9968, 0x9969, 0x996a, 0x996b, 0x996c, 0x996d, 0x996e, 0x996f,
+ 0x9970, 0x9971, 0x9972, 0x9973, 0x9974, 0x9975, 0x9976, 0x9977,
+ 0x9978, 0x9979, 0x997a, 0x997b, 0x997c, 0x997d, 0x997e, 0x997f,
+ 0x9980, 0x9981, 0x9982, 0x9983, 0x9984, 0x9985, 0x9986, 0x9987,
+ 0x9988, 0x9989, 0x998a, 0x998b, 0x998c, 0x998d, 0x998e, 0x998f,
+ 0x9990, 0x9991, 0x9992, 0x9993, 0x9994, 0x9995, 0x9996, 0x9997,
+ 0x9998, 0x9999, 0x999a, 0x999b, 0x999c, 0x999d, 0x999e, 0x999f,
+ 0x99a0, 0x99a1, 0x99a2, 0x99a3, 0x99a4, 0x99a5, 0x99a6, 0x99a7,
+ 0x99a8, 0x99a9, 0x99aa, 0x99ab, 0x99ac, 0x99ad, 0x99ae, 0x99af,
+ 0x99b0, 0x99b1, 0x99b2, 0x99b3, 0x99b4, 0x99b5, 0x99b6, 0x99b7,
+ 0x99b8, 0x99b9, 0x99ba, 0x99bb, 0x99bc, 0x99bd, 0x99be, 0x99bf,
+ 0x99c0, 0x99c1, 0x99c2, 0x99c3, 0x99c4, 0x99c5, 0x99c6, 0x99c7,
+ 0x99c8, 0x99c9, 0x99ca, 0x99cb, 0x99cc, 0x99cd, 0x99ce, 0x99cf,
+ 0x99d0, 0x99d1, 0x99d2, 0x99d3, 0x99d4, 0x99d5, 0x99d6, 0x99d7,
+ 0x99d8, 0x99d9, 0x99da, 0x99db, 0x99dc, 0x99dd, 0x99de, 0x99df,
+ 0x99e0, 0x99e1, 0x99e2, 0x99e3, 0x99e4, 0x99e5, 0x99e6, 0x99e7,
+ 0x99e8, 0x99e9, 0x99ea, 0x99eb, 0x99ec, 0x99ed, 0x99ee, 0x99ef,
+ 0x99f0, 0x99f1, 0x99f2, 0x99f3, 0x99f4, 0x99f5, 0x99f6, 0x99f7,
+ 0x99f8, 0x99f9, 0x99fa, 0x99fb, 0x99fc, 0x99fd, 0x99fe, 0x99ff,
+ 0x9a00, 0x9a01, 0x9a02, 0x9a03, 0x9a04, 0x9a05, 0x9a06, 0x9a07,
+ 0x9a08, 0x9a09, 0x9a0a, 0x9a0b, 0x9a0c, 0x9a0d, 0x9a0e, 0x9a0f,
+ 0x9a10, 0x9a11, 0x9a12, 0x9a13, 0x9a14, 0x9a15, 0x9a16, 0x9a17,
+ 0x9a18, 0x9a19, 0x9a1a, 0x9a1b, 0x9a1c, 0x9a1d, 0x9a1e, 0x9a1f,
+ 0x9a20, 0x9a21, 0x9a22, 0x9a23, 0x9a24, 0x9a25, 0x9a26, 0x9a27,
+ 0x9a28, 0x9a29, 0x9a2a, 0x9a2b, 0x9a2c, 0x9a2d, 0x9a2e, 0x9a2f,
+ 0x9a30, 0x9a31, 0x9a32, 0x9a33, 0x9a34, 0x9a35, 0x9a36, 0x9a37,
+ 0x9a38, 0x9a39, 0x9a3a, 0x9a3b, 0x9a3c, 0x9a3d, 0x9a3e, 0x9a3f,
+ 0x9a40, 0x9a41, 0x9a42, 0x9a43, 0x9a44, 0x9a45, 0x9a46, 0x9a47,
+ 0x9a48, 0x9a49, 0x9a4a, 0x9a4b, 0x9a4c, 0x9a4d, 0x9a4e, 0x9a4f,
+ 0x9a50, 0x9a51, 0x9a52, 0x9a53, 0x9a54, 0x9a55, 0x9a56, 0x9a57,
+ 0x9a58, 0x9a59, 0x9a5a, 0x9a5b, 0x9a5c, 0x9a5d, 0x9a5e, 0x9a5f,
+ 0x9a60, 0x9a61, 0x9a62, 0x9a63, 0x9a64, 0x9a65, 0x9a66, 0x9a67,
+ 0x9a68, 0x9a69, 0x9a6a, 0x9a6b, 0x9a6c, 0x9a6d, 0x9a6e, 0x9a6f,
+ 0x9a70, 0x9a71, 0x9a72, 0x9a73, 0x9a74, 0x9a75, 0x9a76, 0x9a77,
+ 0x9a78, 0x9a79, 0x9a7a, 0x9a7b, 0x9a7c, 0x9a7d, 0x9a7e, 0x9a7f,
+ 0x9a80, 0x9a81, 0x9a82, 0x9a83, 0x9a84, 0x9a85, 0x9a86, 0x9a87,
+ 0x9a88, 0x9a89, 0x9a8a, 0x9a8b, 0x9a8c, 0x9a8d, 0x9a8e, 0x9a8f,
+ 0x9a90, 0x9a91, 0x9a92, 0x9a93, 0x9a94, 0x9a95, 0x9a96, 0x9a97,
+ 0x9a98, 0x9a99, 0x9a9a, 0x9a9b, 0x9a9c, 0x9a9d, 0x9a9e, 0x9a9f,
+ 0x9aa0, 0x9aa1, 0x9aa2, 0x9aa3, 0x9aa4, 0x9aa5, 0x9aa6, 0x9aa7,
+ 0x9aa8, 0x9aa9, 0x9aaa, 0x9aab, 0x9aac, 0x9aad, 0x9aae, 0x9aaf,
+ 0x9ab0, 0x9ab1, 0x9ab2, 0x9ab3, 0x9ab4, 0x9ab5, 0x9ab6, 0x9ab7,
+ 0x9ab8, 0x9ab9, 0x9aba, 0x9abb, 0x9abc, 0x9abd, 0x9abe, 0x9abf,
+ 0x9ac0, 0x9ac1, 0x9ac2, 0x9ac3, 0x9ac4, 0x9ac5, 0x9ac6, 0x9ac7,
+ 0x9ac8, 0x9ac9, 0x9aca, 0x9acb, 0x9acc, 0x9acd, 0x9ace, 0x9acf,
+ 0x9ad0, 0x9ad1, 0x9ad2, 0x9ad3, 0x9ad4, 0x9ad5, 0x9ad6, 0x9ad7,
+ 0x9ad8, 0x9ad9, 0x9ada, 0x9adb, 0x9adc, 0x9add, 0x9ade, 0x9adf,
+ 0x9ae0, 0x9ae1, 0x9ae2, 0x9ae3, 0x9ae4, 0x9ae5, 0x9ae6, 0x9ae7,
+ 0x9ae8, 0x9ae9, 0x9aea, 0x9aeb, 0x9aec, 0x9aed, 0x9aee, 0x9aef,
+ 0x9af0, 0x9af1, 0x9af2, 0x9af3, 0x9af4, 0x9af5, 0x9af6, 0x9af7,
+ 0x9af8, 0x9af9, 0x9afa, 0x9afb, 0x9afc, 0x9afd, 0x9afe, 0x9aff,
+ 0x9b00, 0x9b01, 0x9b02, 0x9b03, 0x9b04, 0x9b05, 0x9b06, 0x9b07,
+ 0x9b08, 0x9b09, 0x9b0a, 0x9b0b, 0x9b0c, 0x9b0d, 0x9b0e, 0x9b0f,
+ 0x9b10, 0x9b11, 0x9b12, 0x9b13, 0x9b14, 0x9b15, 0x9b16, 0x9b17,
+ 0x9b18, 0x9b19, 0x9b1a, 0x9b1b, 0x9b1c, 0x9b1d, 0x9b1e, 0x9b1f,
+ 0x9b20, 0x9b21, 0x9b22, 0x9b23, 0x9b24, 0x9b25, 0x9b26, 0x9b27,
+ 0x9b28, 0x9b29, 0x9b2a, 0x9b2b, 0x9b2c, 0x9b2d, 0x9b2e, 0x9b2f,
+ 0x9b30, 0x9b31, 0x9b32, 0x9b33, 0x9b34, 0x9b35, 0x9b36, 0x9b37,
+ 0x9b38, 0x9b39, 0x9b3a, 0x9b3b, 0x9b3c, 0x9b3d, 0x9b3e, 0x9b3f,
+ 0x9b40, 0x9b41, 0x9b42, 0x9b43, 0x9b44, 0x9b45, 0x9b46, 0x9b47,
+ 0x9b48, 0x9b49, 0x9b4a, 0x9b4b, 0x9b4c, 0x9b4d, 0x9b4e, 0x9b4f,
+ 0x9b50, 0x9b51, 0x9b52, 0x9b53, 0x9b54, 0x9b55, 0x9b56, 0x9b57,
+ 0x9b58, 0x9b59, 0x9b5a, 0x9b5b, 0x9b5c, 0x9b5d, 0x9b5e, 0x9b5f,
+ 0x9b60, 0x9b61, 0x9b62, 0x9b63, 0x9b64, 0x9b65, 0x9b66, 0x9b67,
+ 0x9b68, 0x9b69, 0x9b6a, 0x9b6b, 0x9b6c, 0x9b6d, 0x9b6e, 0x9b6f,
+ 0x9b70, 0x9b71, 0x9b72, 0x9b73, 0x9b74, 0x9b75, 0x9b76, 0x9b77,
+ 0x9b78, 0x9b79, 0x9b7a, 0x9b7b, 0x9b7c, 0x9b7d, 0x9b7e, 0x9b7f,
+ 0x9b80, 0x9b81, 0x9b82, 0x9b83, 0x9b84, 0x9b85, 0x9b86, 0x9b87,
+ 0x9b88, 0x9b89, 0x9b8a, 0x9b8b, 0x9b8c, 0x9b8d, 0x9b8e, 0x9b8f,
+ 0x9b90, 0x9b91, 0x9b92, 0x9b93, 0x9b94, 0x9b95, 0x9b96, 0x9b97,
+ 0x9b98, 0x9b99, 0x9b9a, 0x9b9b, 0x9b9c, 0x9b9d, 0x9b9e, 0x9b9f,
+ 0x9ba0, 0x9ba1, 0x9ba2, 0x9ba3, 0x9ba4, 0x9ba5, 0x9ba6, 0x9ba7,
+ 0x9ba8, 0x9ba9, 0x9baa, 0x9bab, 0x9bac, 0x9bad, 0x9bae, 0x9baf,
+ 0x9bb0, 0x9bb1, 0x9bb2, 0x9bb3, 0x9bb4, 0x9bb5, 0x9bb6, 0x9bb7,
+ 0x9bb8, 0x9bb9, 0x9bba, 0x9bbb, 0x9bbc, 0x9bbd, 0x9bbe, 0x9bbf,
+ 0x9bc0, 0x9bc1, 0x9bc2, 0x9bc3, 0x9bc4, 0x9bc5, 0x9bc6, 0x9bc7,
+ 0x9bc8, 0x9bc9, 0x9bca, 0x9bcb, 0x9bcc, 0x9bcd, 0x9bce, 0x9bcf,
+ 0x9bd0, 0x9bd1, 0x9bd2, 0x9bd3, 0x9bd4, 0x9bd5, 0x9bd6, 0x9bd7,
+ 0x9bd8, 0x9bd9, 0x9bda, 0x9bdb, 0x9bdc, 0x9bdd, 0x9bde, 0x9bdf,
+ 0x9be0, 0x9be1, 0x9be2, 0x9be3, 0x9be4, 0x9be5, 0x9be6, 0x9be7,
+ 0x9be8, 0x9be9, 0x9bea, 0x9beb, 0x9bec, 0x9bed, 0x9bee, 0x9bef,
+ 0x9bf0, 0x9bf1, 0x9bf2, 0x9bf3, 0x9bf4, 0x9bf5, 0x9bf6, 0x9bf7,
+ 0x9bf8, 0x9bf9, 0x9bfa, 0x9bfb, 0x9bfc, 0x9bfd, 0x9bfe, 0x9bff,
+ 0x9c00, 0x9c01, 0x9c02, 0x9c03, 0x9c04, 0x9c05, 0x9c06, 0x9c07,
+ 0x9c08, 0x9c09, 0x9c0a, 0x9c0b, 0x9c0c, 0x9c0d, 0x9c0e, 0x9c0f,
+ 0x9c10, 0x9c11, 0x9c12, 0x9c13, 0x9c14, 0x9c15, 0x9c16, 0x9c17,
+ 0x9c18, 0x9c19, 0x9c1a, 0x9c1b, 0x9c1c, 0x9c1d, 0x9c1e, 0x9c1f,
+ 0x9c20, 0x9c21, 0x9c22, 0x9c23, 0x9c24, 0x9c25, 0x9c26, 0x9c27,
+ 0x9c28, 0x9c29, 0x9c2a, 0x9c2b, 0x9c2c, 0x9c2d, 0x9c2e, 0x9c2f,
+ 0x9c30, 0x9c31, 0x9c32, 0x9c33, 0x9c34, 0x9c35, 0x9c36, 0x9c37,
+ 0x9c38, 0x9c39, 0x9c3a, 0x9c3b, 0x9c3c, 0x9c3d, 0x9c3e, 0x9c3f,
+ 0x9c40, 0x9c41, 0x9c42, 0x9c43, 0x9c44, 0x9c45, 0x9c46, 0x9c47,
+ 0x9c48, 0x9c49, 0x9c4a, 0x9c4b, 0x9c4c, 0x9c4d, 0x9c4e, 0x9c4f,
+ 0x9c50, 0x9c51, 0x9c52, 0x9c53, 0x9c54, 0x9c55, 0x9c56, 0x9c57,
+ 0x9c58, 0x9c59, 0x9c5a, 0x9c5b, 0x9c5c, 0x9c5d, 0x9c5e, 0x9c5f,
+ 0x9c60, 0x9c61, 0x9c62, 0x9c63, 0x9c64, 0x9c65, 0x9c66, 0x9c67,
+ 0x9c68, 0x9c69, 0x9c6a, 0x9c6b, 0x9c6c, 0x9c6d, 0x9c6e, 0x9c6f,
+ 0x9c70, 0x9c71, 0x9c72, 0x9c73, 0x9c74, 0x9c75, 0x9c76, 0x9c77,
+ 0x9c78, 0x9c79, 0x9c7a, 0x9c7b, 0x9c7c, 0x9c7d, 0x9c7e, 0x9c7f,
+ 0x9c80, 0x9c81, 0x9c82, 0x9c83, 0x9c84, 0x9c85, 0x9c86, 0x9c87,
+ 0x9c88, 0x9c89, 0x9c8a, 0x9c8b, 0x9c8c, 0x9c8d, 0x9c8e, 0x9c8f,
+ 0x9c90, 0x9c91, 0x9c92, 0x9c93, 0x9c94, 0x9c95, 0x9c96, 0x9c97,
+ 0x9c98, 0x9c99, 0x9c9a, 0x9c9b, 0x9c9c, 0x9c9d, 0x9c9e, 0x9c9f,
+ 0x9ca0, 0x9ca1, 0x9ca2, 0x9ca3, 0x9ca4, 0x9ca5, 0x9ca6, 0x9ca7,
+ 0x9ca8, 0x9ca9, 0x9caa, 0x9cab, 0x9cac, 0x9cad, 0x9cae, 0x9caf,
+ 0x9cb0, 0x9cb1, 0x9cb2, 0x9cb3, 0x9cb4, 0x9cb5, 0x9cb6, 0x9cb7,
+ 0x9cb8, 0x9cb9, 0x9cba, 0x9cbb, 0x9cbc, 0x9cbd, 0x9cbe, 0x9cbf,
+ 0x9cc0, 0x9cc1, 0x9cc2, 0x9cc3, 0x9cc4, 0x9cc5, 0x9cc6, 0x9cc7,
+ 0x9cc8, 0x9cc9, 0x9cca, 0x9ccb, 0x9ccc, 0x9ccd, 0x9cce, 0x9ccf,
+ 0x9cd0, 0x9cd1, 0x9cd2, 0x9cd3, 0x9cd4, 0x9cd5, 0x9cd6, 0x9cd7,
+ 0x9cd8, 0x9cd9, 0x9cda, 0x9cdb, 0x9cdc, 0x9cdd, 0x9cde, 0x9cdf,
+ 0x9ce0, 0x9ce1, 0x9ce2, 0x9ce3, 0x9ce4, 0x9ce5, 0x9ce6, 0x9ce7,
+ 0x9ce8, 0x9ce9, 0x9cea, 0x9ceb, 0x9cec, 0x9ced, 0x9cee, 0x9cef,
+ 0x9cf0, 0x9cf1, 0x9cf2, 0x9cf3, 0x9cf4, 0x9cf5, 0x9cf6, 0x9cf7,
+ 0x9cf8, 0x9cf9, 0x9cfa, 0x9cfb, 0x9cfc, 0x9cfd, 0x9cfe, 0x9cff,
+ 0x9d00, 0x9d01, 0x9d02, 0x9d03, 0x9d04, 0x9d05, 0x9d06, 0x9d07,
+ 0x9d08, 0x9d09, 0x9d0a, 0x9d0b, 0x9d0c, 0x9d0d, 0x9d0e, 0x9d0f,
+ 0x9d10, 0x9d11, 0x9d12, 0x9d13, 0x9d14, 0x9d15, 0x9d16, 0x9d17,
+ 0x9d18, 0x9d19, 0x9d1a, 0x9d1b, 0x9d1c, 0x9d1d, 0x9d1e, 0x9d1f,
+ 0x9d20, 0x9d21, 0x9d22, 0x9d23, 0x9d24, 0x9d25, 0x9d26, 0x9d27,
+ 0x9d28, 0x9d29, 0x9d2a, 0x9d2b, 0x9d2c, 0x9d2d, 0x9d2e, 0x9d2f,
+ 0x9d30, 0x9d31, 0x9d32, 0x9d33, 0x9d34, 0x9d35, 0x9d36, 0x9d37,
+ 0x9d38, 0x9d39, 0x9d3a, 0x9d3b, 0x9d3c, 0x9d3d, 0x9d3e, 0x9d3f,
+ 0x9d40, 0x9d41, 0x9d42, 0x9d43, 0x9d44, 0x9d45, 0x9d46, 0x9d47,
+ 0x9d48, 0x9d49, 0x9d4a, 0x9d4b, 0x9d4c, 0x9d4d, 0x9d4e, 0x9d4f,
+ 0x9d50, 0x9d51, 0x9d52, 0x9d53, 0x9d54, 0x9d55, 0x9d56, 0x9d57,
+ 0x9d58, 0x9d59, 0x9d5a, 0x9d5b, 0x9d5c, 0x9d5d, 0x9d5e, 0x9d5f,
+ 0x9d60, 0x9d61, 0x9d62, 0x9d63, 0x9d64, 0x9d65, 0x9d66, 0x9d67,
+ 0x9d68, 0x9d69, 0x9d6a, 0x9d6b, 0x9d6c, 0x9d6d, 0x9d6e, 0x9d6f,
+ 0x9d70, 0x9d71, 0x9d72, 0x9d73, 0x9d74, 0x9d75, 0x9d76, 0x9d77,
+ 0x9d78, 0x9d79, 0x9d7a, 0x9d7b, 0x9d7c, 0x9d7d, 0x9d7e, 0x9d7f,
+ 0x9d80, 0x9d81, 0x9d82, 0x9d83, 0x9d84, 0x9d85, 0x9d86, 0x9d87,
+ 0x9d88, 0x9d89, 0x9d8a, 0x9d8b, 0x9d8c, 0x9d8d, 0x9d8e, 0x9d8f,
+ 0x9d90, 0x9d91, 0x9d92, 0x9d93, 0x9d94, 0x9d95, 0x9d96, 0x9d97,
+ 0x9d98, 0x9d99, 0x9d9a, 0x9d9b, 0x9d9c, 0x9d9d, 0x9d9e, 0x9d9f,
+ 0x9da0, 0x9da1, 0x9da2, 0x9da3, 0x9da4, 0x9da5, 0x9da6, 0x9da7,
+ 0x9da8, 0x9da9, 0x9daa, 0x9dab, 0x9dac, 0x9dad, 0x9dae, 0x9daf,
+ 0x9db0, 0x9db1, 0x9db2, 0x9db3, 0x9db4, 0x9db5, 0x9db6, 0x9db7,
+ 0x9db8, 0x9db9, 0x9dba, 0x9dbb, 0x9dbc, 0x9dbd, 0x9dbe, 0x9dbf,
+ 0x9dc0, 0x9dc1, 0x9dc2, 0x9dc3, 0x9dc4, 0x9dc5, 0x9dc6, 0x9dc7,
+ 0x9dc8, 0x9dc9, 0x9dca, 0x9dcb, 0x9dcc, 0x9dcd, 0x9dce, 0x9dcf,
+ 0x9dd0, 0x9dd1, 0x9dd2, 0x9dd3, 0x9dd4, 0x9dd5, 0x9dd6, 0x9dd7,
+ 0x9dd8, 0x9dd9, 0x9dda, 0x9ddb, 0x9ddc, 0x9ddd, 0x9dde, 0x9ddf,
+ 0x9de0, 0x9de1, 0x9de2, 0x9de3, 0x9de4, 0x9de5, 0x9de6, 0x9de7,
+ 0x9de8, 0x9de9, 0x9dea, 0x9deb, 0x9dec, 0x9ded, 0x9dee, 0x9def,
+ 0x9df0, 0x9df1, 0x9df2, 0x9df3, 0x9df4, 0x9df5, 0x9df6, 0x9df7,
+ 0x9df8, 0x9df9, 0x9dfa, 0x9dfb, 0x9dfc, 0x9dfd, 0x9dfe, 0x9dff,
+ 0x9e00, 0x9e01, 0x9e02, 0x9e03, 0x9e04, 0x9e05, 0x9e06, 0x9e07,
+ 0x9e08, 0x9e09, 0x9e0a, 0x9e0b, 0x9e0c, 0x9e0d, 0x9e0e, 0x9e0f,
+ 0x9e10, 0x9e11, 0x9e12, 0x9e13, 0x9e14, 0x9e15, 0x9e16, 0x9e17,
+ 0x9e18, 0x9e19, 0x9e1a, 0x9e1b, 0x9e1c, 0x9e1d, 0x9e1e, 0x9e1f,
+ 0x9e20, 0x9e21, 0x9e22, 0x9e23, 0x9e24, 0x9e25, 0x9e26, 0x9e27,
+ 0x9e28, 0x9e29, 0x9e2a, 0x9e2b, 0x9e2c, 0x9e2d, 0x9e2e, 0x9e2f,
+ 0x9e30, 0x9e31, 0x9e32, 0x9e33, 0x9e34, 0x9e35, 0x9e36, 0x9e37,
+ 0x9e38, 0x9e39, 0x9e3a, 0x9e3b, 0x9e3c, 0x9e3d, 0x9e3e, 0x9e3f,
+ 0x9e40, 0x9e41, 0x9e42, 0x9e43, 0x9e44, 0x9e45, 0x9e46, 0x9e47,
+ 0x9e48, 0x9e49, 0x9e4a, 0x9e4b, 0x9e4c, 0x9e4d, 0x9e4e, 0x9e4f,
+ 0x9e50, 0x9e51, 0x9e52, 0x9e53, 0x9e54, 0x9e55, 0x9e56, 0x9e57,
+ 0x9e58, 0x9e59, 0x9e5a, 0x9e5b, 0x9e5c, 0x9e5d, 0x9e5e, 0x9e5f,
+ 0x9e60, 0x9e61, 0x9e62, 0x9e63, 0x9e64, 0x9e65, 0x9e66, 0x9e67,
+ 0x9e68, 0x9e69, 0x9e6a, 0x9e6b, 0x9e6c, 0x9e6d, 0x9e6e, 0x9e6f,
+ 0x9e70, 0x9e71, 0x9e72, 0x9e73, 0x9e74, 0x9e75, 0x9e76, 0x9e77,
+ 0x9e78, 0x9e79, 0x9e7a, 0x9e7b, 0x9e7c, 0x9e7d, 0x9e7e, 0x9e7f,
+ 0x9e80, 0x9e81, 0x9e82, 0x9e83, 0x9e84, 0x9e85, 0x9e86, 0x9e87,
+ 0x9e88, 0x9e89, 0x9e8a, 0x9e8b, 0x9e8c, 0x9e8d, 0x9e8e, 0x9e8f,
+ 0x9e90, 0x9e91, 0x9e92, 0x9e93, 0x9e94, 0x9e95, 0x9e96, 0x9e97,
+ 0x9e98, 0x9e99, 0x9e9a, 0x9e9b, 0x9e9c, 0x9e9d, 0x9e9e, 0x9e9f,
+ 0x9ea0, 0x9ea1, 0x9ea2, 0x9ea3, 0x9ea4, 0x9ea5, 0x9ea6, 0x9ea7,
+ 0x9ea8, 0x9ea9, 0x9eaa, 0x9eab, 0x9eac, 0x9ead, 0x9eae, 0x9eaf,
+ 0x9eb0, 0x9eb1, 0x9eb2, 0x9eb3, 0x9eb4, 0x9eb5, 0x9eb6, 0x9eb7,
+ 0x9eb8, 0x9eb9, 0x9eba, 0x9ebb, 0x9ebc, 0x9ebd, 0x9ebe, 0x9ebf,
+ 0x9ec0, 0x9ec1, 0x9ec2, 0x9ec3, 0x9ec4, 0x9ec5, 0x9ec6, 0x9ec7,
+ 0x9ec8, 0x9ec9, 0x9eca, 0x9ecb, 0x9ecc, 0x9ecd, 0x9ece, 0x9ecf,
+ 0x9ed0, 0x9ed1, 0x9ed2, 0x9ed3, 0x9ed4, 0x9ed5, 0x9ed6, 0x9ed7,
+ 0x9ed8, 0x9ed9, 0x9eda, 0x9edb, 0x9edc, 0x9edd, 0x9ede, 0x9edf,
+ 0x9ee0, 0x9ee1, 0x9ee2, 0x9ee3, 0x9ee4, 0x9ee5, 0x9ee6, 0x9ee7,
+ 0x9ee8, 0x9ee9, 0x9eea, 0x9eeb, 0x9eec, 0x9eed, 0x9eee, 0x9eef,
+ 0x9ef0, 0x9ef1, 0x9ef2, 0x9ef3, 0x9ef4, 0x9ef5, 0x9ef6, 0x9ef7,
+ 0x9ef8, 0x9ef9, 0x9efa, 0x9efb, 0x9efc, 0x9efd, 0x9efe, 0x9eff,
+ 0x9f00, 0x9f01, 0x9f02, 0x9f03, 0x9f04, 0x9f05, 0x9f06, 0x9f07,
+ 0x9f08, 0x9f09, 0x9f0a, 0x9f0b, 0x9f0c, 0x9f0d, 0x9f0e, 0x9f0f,
+ 0x9f10, 0x9f11, 0x9f12, 0x9f13, 0x9f14, 0x9f15, 0x9f16, 0x9f17,
+ 0x9f18, 0x9f19, 0x9f1a, 0x9f1b, 0x9f1c, 0x9f1d, 0x9f1e, 0x9f1f,
+ 0x9f20, 0x9f21, 0x9f22, 0x9f23, 0x9f24, 0x9f25, 0x9f26, 0x9f27,
+ 0x9f28, 0x9f29, 0x9f2a, 0x9f2b, 0x9f2c, 0x9f2d, 0x9f2e, 0x9f2f,
+ 0x9f30, 0x9f31, 0x9f32, 0x9f33, 0x9f34, 0x9f35, 0x9f36, 0x9f37,
+ 0x9f38, 0x9f39, 0x9f3a, 0x9f3b, 0x9f3c, 0x9f3d, 0x9f3e, 0x9f3f,
+ 0x9f40, 0x9f41, 0x9f42, 0x9f43, 0x9f44, 0x9f45, 0x9f46, 0x9f47,
+ 0x9f48, 0x9f49, 0x9f4a, 0x9f4b, 0x9f4c, 0x9f4d, 0x9f4e, 0x9f4f,
+ 0x9f50, 0x9f51, 0x9f52, 0x9f53, 0x9f54, 0x9f55, 0x9f56, 0x9f57,
+ 0x9f58, 0x9f59, 0x9f5a, 0x9f5b, 0x9f5c, 0x9f5d, 0x9f5e, 0x9f5f,
+ 0x9f60, 0x9f61, 0x9f62, 0x9f63, 0x9f64, 0x9f65, 0x9f66, 0x9f67,
+ 0x9f68, 0x9f69, 0x9f6a, 0x9f6b, 0x9f6c, 0x9f6d, 0x9f6e, 0x9f6f,
+ 0x9f70, 0x9f71, 0x9f72, 0x9f73, 0x9f74, 0x9f75, 0x9f76, 0x9f77,
+ 0x9f78, 0x9f79, 0x9f7a, 0x9f7b, 0x9f7c, 0x9f7d, 0x9f7e, 0x9f7f,
+ 0x9f80, 0x9f81, 0x9f82, 0x9f83, 0x9f84, 0x9f85, 0x9f86, 0x9f87,
+ 0x9f88, 0x9f89, 0x9f8a, 0x9f8b, 0x9f8c, 0x9f8d, 0x9f8e, 0x9f8f,
+ 0x9f90, 0x9f91, 0x9f92, 0x9f93, 0x9f94, 0x9f95, 0x9f96, 0x9f97,
+ 0x9f98, 0x9f99, 0x9f9a, 0x9f9b, 0x9f9c, 0x9f9d, 0x9f9e, 0x9f9f,
+ 0x9fa0, 0x9fa1, 0x9fa2, 0x9fa3, 0x9fa4, 0x9fa5, 0x9fa6, 0x9fa7,
+ 0x9fa8, 0x9fa9, 0x9faa, 0x9fab, 0x9fac, 0x9fad, 0x9fae, 0x9faf,
+ 0x9fb0, 0x9fb1, 0x9fb2, 0x9fb3, 0x9fb4, 0x9fb5, 0x9fb6, 0x9fb7,
+ 0x9fb8, 0x9fb9, 0x9fba, 0x9fbb, 0x9fbc, 0x9fbd, 0x9fbe, 0x9fbf,
+ 0x9fc0, 0x9fc1, 0x9fc2, 0x9fc3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa000, 0xa001, 0xa002, 0xa003, 0xa004, 0xa005, 0xa006, 0xa007,
+ 0xa008, 0xa009, 0xa00a, 0xa00b, 0xa00c, 0xa00d, 0xa00e, 0xa00f,
+ 0xa010, 0xa011, 0xa012, 0xa013, 0xa014, 0xa015, 0xa016, 0xa017,
+ 0xa018, 0xa019, 0xa01a, 0xa01b, 0xa01c, 0xa01d, 0xa01e, 0xa01f,
+ 0xa020, 0xa021, 0xa022, 0xa023, 0xa024, 0xa025, 0xa026, 0xa027,
+ 0xa028, 0xa029, 0xa02a, 0xa02b, 0xa02c, 0xa02d, 0xa02e, 0xa02f,
+ 0xa030, 0xa031, 0xa032, 0xa033, 0xa034, 0xa035, 0xa036, 0xa037,
+ 0xa038, 0xa039, 0xa03a, 0xa03b, 0xa03c, 0xa03d, 0xa03e, 0xa03f,
+ 0xa040, 0xa041, 0xa042, 0xa043, 0xa044, 0xa045, 0xa046, 0xa047,
+ 0xa048, 0xa049, 0xa04a, 0xa04b, 0xa04c, 0xa04d, 0xa04e, 0xa04f,
+ 0xa050, 0xa051, 0xa052, 0xa053, 0xa054, 0xa055, 0xa056, 0xa057,
+ 0xa058, 0xa059, 0xa05a, 0xa05b, 0xa05c, 0xa05d, 0xa05e, 0xa05f,
+ 0xa060, 0xa061, 0xa062, 0xa063, 0xa064, 0xa065, 0xa066, 0xa067,
+ 0xa068, 0xa069, 0xa06a, 0xa06b, 0xa06c, 0xa06d, 0xa06e, 0xa06f,
+ 0xa070, 0xa071, 0xa072, 0xa073, 0xa074, 0xa075, 0xa076, 0xa077,
+ 0xa078, 0xa079, 0xa07a, 0xa07b, 0xa07c, 0xa07d, 0xa07e, 0xa07f,
+ 0xa080, 0xa081, 0xa082, 0xa083, 0xa084, 0xa085, 0xa086, 0xa087,
+ 0xa088, 0xa089, 0xa08a, 0xa08b, 0xa08c, 0xa08d, 0xa08e, 0xa08f,
+ 0xa090, 0xa091, 0xa092, 0xa093, 0xa094, 0xa095, 0xa096, 0xa097,
+ 0xa098, 0xa099, 0xa09a, 0xa09b, 0xa09c, 0xa09d, 0xa09e, 0xa09f,
+ 0xa0a0, 0xa0a1, 0xa0a2, 0xa0a3, 0xa0a4, 0xa0a5, 0xa0a6, 0xa0a7,
+ 0xa0a8, 0xa0a9, 0xa0aa, 0xa0ab, 0xa0ac, 0xa0ad, 0xa0ae, 0xa0af,
+ 0xa0b0, 0xa0b1, 0xa0b2, 0xa0b3, 0xa0b4, 0xa0b5, 0xa0b6, 0xa0b7,
+ 0xa0b8, 0xa0b9, 0xa0ba, 0xa0bb, 0xa0bc, 0xa0bd, 0xa0be, 0xa0bf,
+ 0xa0c0, 0xa0c1, 0xa0c2, 0xa0c3, 0xa0c4, 0xa0c5, 0xa0c6, 0xa0c7,
+ 0xa0c8, 0xa0c9, 0xa0ca, 0xa0cb, 0xa0cc, 0xa0cd, 0xa0ce, 0xa0cf,
+ 0xa0d0, 0xa0d1, 0xa0d2, 0xa0d3, 0xa0d4, 0xa0d5, 0xa0d6, 0xa0d7,
+ 0xa0d8, 0xa0d9, 0xa0da, 0xa0db, 0xa0dc, 0xa0dd, 0xa0de, 0xa0df,
+ 0xa0e0, 0xa0e1, 0xa0e2, 0xa0e3, 0xa0e4, 0xa0e5, 0xa0e6, 0xa0e7,
+ 0xa0e8, 0xa0e9, 0xa0ea, 0xa0eb, 0xa0ec, 0xa0ed, 0xa0ee, 0xa0ef,
+ 0xa0f0, 0xa0f1, 0xa0f2, 0xa0f3, 0xa0f4, 0xa0f5, 0xa0f6, 0xa0f7,
+ 0xa0f8, 0xa0f9, 0xa0fa, 0xa0fb, 0xa0fc, 0xa0fd, 0xa0fe, 0xa0ff,
+ 0xa100, 0xa101, 0xa102, 0xa103, 0xa104, 0xa105, 0xa106, 0xa107,
+ 0xa108, 0xa109, 0xa10a, 0xa10b, 0xa10c, 0xa10d, 0xa10e, 0xa10f,
+ 0xa110, 0xa111, 0xa112, 0xa113, 0xa114, 0xa115, 0xa116, 0xa117,
+ 0xa118, 0xa119, 0xa11a, 0xa11b, 0xa11c, 0xa11d, 0xa11e, 0xa11f,
+ 0xa120, 0xa121, 0xa122, 0xa123, 0xa124, 0xa125, 0xa126, 0xa127,
+ 0xa128, 0xa129, 0xa12a, 0xa12b, 0xa12c, 0xa12d, 0xa12e, 0xa12f,
+ 0xa130, 0xa131, 0xa132, 0xa133, 0xa134, 0xa135, 0xa136, 0xa137,
+ 0xa138, 0xa139, 0xa13a, 0xa13b, 0xa13c, 0xa13d, 0xa13e, 0xa13f,
+ 0xa140, 0xa141, 0xa142, 0xa143, 0xa144, 0xa145, 0xa146, 0xa147,
+ 0xa148, 0xa149, 0xa14a, 0xa14b, 0xa14c, 0xa14d, 0xa14e, 0xa14f,
+ 0xa150, 0xa151, 0xa152, 0xa153, 0xa154, 0xa155, 0xa156, 0xa157,
+ 0xa158, 0xa159, 0xa15a, 0xa15b, 0xa15c, 0xa15d, 0xa15e, 0xa15f,
+ 0xa160, 0xa161, 0xa162, 0xa163, 0xa164, 0xa165, 0xa166, 0xa167,
+ 0xa168, 0xa169, 0xa16a, 0xa16b, 0xa16c, 0xa16d, 0xa16e, 0xa16f,
+ 0xa170, 0xa171, 0xa172, 0xa173, 0xa174, 0xa175, 0xa176, 0xa177,
+ 0xa178, 0xa179, 0xa17a, 0xa17b, 0xa17c, 0xa17d, 0xa17e, 0xa17f,
+ 0xa180, 0xa181, 0xa182, 0xa183, 0xa184, 0xa185, 0xa186, 0xa187,
+ 0xa188, 0xa189, 0xa18a, 0xa18b, 0xa18c, 0xa18d, 0xa18e, 0xa18f,
+ 0xa190, 0xa191, 0xa192, 0xa193, 0xa194, 0xa195, 0xa196, 0xa197,
+ 0xa198, 0xa199, 0xa19a, 0xa19b, 0xa19c, 0xa19d, 0xa19e, 0xa19f,
+ 0xa1a0, 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a4, 0xa1a5, 0xa1a6, 0xa1a7,
+ 0xa1a8, 0xa1a9, 0xa1aa, 0xa1ab, 0xa1ac, 0xa1ad, 0xa1ae, 0xa1af,
+ 0xa1b0, 0xa1b1, 0xa1b2, 0xa1b3, 0xa1b4, 0xa1b5, 0xa1b6, 0xa1b7,
+ 0xa1b8, 0xa1b9, 0xa1ba, 0xa1bb, 0xa1bc, 0xa1bd, 0xa1be, 0xa1bf,
+ 0xa1c0, 0xa1c1, 0xa1c2, 0xa1c3, 0xa1c4, 0xa1c5, 0xa1c6, 0xa1c7,
+ 0xa1c8, 0xa1c9, 0xa1ca, 0xa1cb, 0xa1cc, 0xa1cd, 0xa1ce, 0xa1cf,
+ 0xa1d0, 0xa1d1, 0xa1d2, 0xa1d3, 0xa1d4, 0xa1d5, 0xa1d6, 0xa1d7,
+ 0xa1d8, 0xa1d9, 0xa1da, 0xa1db, 0xa1dc, 0xa1dd, 0xa1de, 0xa1df,
+ 0xa1e0, 0xa1e1, 0xa1e2, 0xa1e3, 0xa1e4, 0xa1e5, 0xa1e6, 0xa1e7,
+ 0xa1e8, 0xa1e9, 0xa1ea, 0xa1eb, 0xa1ec, 0xa1ed, 0xa1ee, 0xa1ef,
+ 0xa1f0, 0xa1f1, 0xa1f2, 0xa1f3, 0xa1f4, 0xa1f5, 0xa1f6, 0xa1f7,
+ 0xa1f8, 0xa1f9, 0xa1fa, 0xa1fb, 0xa1fc, 0xa1fd, 0xa1fe, 0xa1ff,
+ 0xa200, 0xa201, 0xa202, 0xa203, 0xa204, 0xa205, 0xa206, 0xa207,
+ 0xa208, 0xa209, 0xa20a, 0xa20b, 0xa20c, 0xa20d, 0xa20e, 0xa20f,
+ 0xa210, 0xa211, 0xa212, 0xa213, 0xa214, 0xa215, 0xa216, 0xa217,
+ 0xa218, 0xa219, 0xa21a, 0xa21b, 0xa21c, 0xa21d, 0xa21e, 0xa21f,
+ 0xa220, 0xa221, 0xa222, 0xa223, 0xa224, 0xa225, 0xa226, 0xa227,
+ 0xa228, 0xa229, 0xa22a, 0xa22b, 0xa22c, 0xa22d, 0xa22e, 0xa22f,
+ 0xa230, 0xa231, 0xa232, 0xa233, 0xa234, 0xa235, 0xa236, 0xa237,
+ 0xa238, 0xa239, 0xa23a, 0xa23b, 0xa23c, 0xa23d, 0xa23e, 0xa23f,
+ 0xa240, 0xa241, 0xa242, 0xa243, 0xa244, 0xa245, 0xa246, 0xa247,
+ 0xa248, 0xa249, 0xa24a, 0xa24b, 0xa24c, 0xa24d, 0xa24e, 0xa24f,
+ 0xa250, 0xa251, 0xa252, 0xa253, 0xa254, 0xa255, 0xa256, 0xa257,
+ 0xa258, 0xa259, 0xa25a, 0xa25b, 0xa25c, 0xa25d, 0xa25e, 0xa25f,
+ 0xa260, 0xa261, 0xa262, 0xa263, 0xa264, 0xa265, 0xa266, 0xa267,
+ 0xa268, 0xa269, 0xa26a, 0xa26b, 0xa26c, 0xa26d, 0xa26e, 0xa26f,
+ 0xa270, 0xa271, 0xa272, 0xa273, 0xa274, 0xa275, 0xa276, 0xa277,
+ 0xa278, 0xa279, 0xa27a, 0xa27b, 0xa27c, 0xa27d, 0xa27e, 0xa27f,
+ 0xa280, 0xa281, 0xa282, 0xa283, 0xa284, 0xa285, 0xa286, 0xa287,
+ 0xa288, 0xa289, 0xa28a, 0xa28b, 0xa28c, 0xa28d, 0xa28e, 0xa28f,
+ 0xa290, 0xa291, 0xa292, 0xa293, 0xa294, 0xa295, 0xa296, 0xa297,
+ 0xa298, 0xa299, 0xa29a, 0xa29b, 0xa29c, 0xa29d, 0xa29e, 0xa29f,
+ 0xa2a0, 0xa2a1, 0xa2a2, 0xa2a3, 0xa2a4, 0xa2a5, 0xa2a6, 0xa2a7,
+ 0xa2a8, 0xa2a9, 0xa2aa, 0xa2ab, 0xa2ac, 0xa2ad, 0xa2ae, 0xa2af,
+ 0xa2b0, 0xa2b1, 0xa2b2, 0xa2b3, 0xa2b4, 0xa2b5, 0xa2b6, 0xa2b7,
+ 0xa2b8, 0xa2b9, 0xa2ba, 0xa2bb, 0xa2bc, 0xa2bd, 0xa2be, 0xa2bf,
+ 0xa2c0, 0xa2c1, 0xa2c2, 0xa2c3, 0xa2c4, 0xa2c5, 0xa2c6, 0xa2c7,
+ 0xa2c8, 0xa2c9, 0xa2ca, 0xa2cb, 0xa2cc, 0xa2cd, 0xa2ce, 0xa2cf,
+ 0xa2d0, 0xa2d1, 0xa2d2, 0xa2d3, 0xa2d4, 0xa2d5, 0xa2d6, 0xa2d7,
+ 0xa2d8, 0xa2d9, 0xa2da, 0xa2db, 0xa2dc, 0xa2dd, 0xa2de, 0xa2df,
+ 0xa2e0, 0xa2e1, 0xa2e2, 0xa2e3, 0xa2e4, 0xa2e5, 0xa2e6, 0xa2e7,
+ 0xa2e8, 0xa2e9, 0xa2ea, 0xa2eb, 0xa2ec, 0xa2ed, 0xa2ee, 0xa2ef,
+ 0xa2f0, 0xa2f1, 0xa2f2, 0xa2f3, 0xa2f4, 0xa2f5, 0xa2f6, 0xa2f7,
+ 0xa2f8, 0xa2f9, 0xa2fa, 0xa2fb, 0xa2fc, 0xa2fd, 0xa2fe, 0xa2ff,
+ 0xa300, 0xa301, 0xa302, 0xa303, 0xa304, 0xa305, 0xa306, 0xa307,
+ 0xa308, 0xa309, 0xa30a, 0xa30b, 0xa30c, 0xa30d, 0xa30e, 0xa30f,
+ 0xa310, 0xa311, 0xa312, 0xa313, 0xa314, 0xa315, 0xa316, 0xa317,
+ 0xa318, 0xa319, 0xa31a, 0xa31b, 0xa31c, 0xa31d, 0xa31e, 0xa31f,
+ 0xa320, 0xa321, 0xa322, 0xa323, 0xa324, 0xa325, 0xa326, 0xa327,
+ 0xa328, 0xa329, 0xa32a, 0xa32b, 0xa32c, 0xa32d, 0xa32e, 0xa32f,
+ 0xa330, 0xa331, 0xa332, 0xa333, 0xa334, 0xa335, 0xa336, 0xa337,
+ 0xa338, 0xa339, 0xa33a, 0xa33b, 0xa33c, 0xa33d, 0xa33e, 0xa33f,
+ 0xa340, 0xa341, 0xa342, 0xa343, 0xa344, 0xa345, 0xa346, 0xa347,
+ 0xa348, 0xa349, 0xa34a, 0xa34b, 0xa34c, 0xa34d, 0xa34e, 0xa34f,
+ 0xa350, 0xa351, 0xa352, 0xa353, 0xa354, 0xa355, 0xa356, 0xa357,
+ 0xa358, 0xa359, 0xa35a, 0xa35b, 0xa35c, 0xa35d, 0xa35e, 0xa35f,
+ 0xa360, 0xa361, 0xa362, 0xa363, 0xa364, 0xa365, 0xa366, 0xa367,
+ 0xa368, 0xa369, 0xa36a, 0xa36b, 0xa36c, 0xa36d, 0xa36e, 0xa36f,
+ 0xa370, 0xa371, 0xa372, 0xa373, 0xa374, 0xa375, 0xa376, 0xa377,
+ 0xa378, 0xa379, 0xa37a, 0xa37b, 0xa37c, 0xa37d, 0xa37e, 0xa37f,
+ 0xa380, 0xa381, 0xa382, 0xa383, 0xa384, 0xa385, 0xa386, 0xa387,
+ 0xa388, 0xa389, 0xa38a, 0xa38b, 0xa38c, 0xa38d, 0xa38e, 0xa38f,
+ 0xa390, 0xa391, 0xa392, 0xa393, 0xa394, 0xa395, 0xa396, 0xa397,
+ 0xa398, 0xa399, 0xa39a, 0xa39b, 0xa39c, 0xa39d, 0xa39e, 0xa39f,
+ 0xa3a0, 0xa3a1, 0xa3a2, 0xa3a3, 0xa3a4, 0xa3a5, 0xa3a6, 0xa3a7,
+ 0xa3a8, 0xa3a9, 0xa3aa, 0xa3ab, 0xa3ac, 0xa3ad, 0xa3ae, 0xa3af,
+ 0xa3b0, 0xa3b1, 0xa3b2, 0xa3b3, 0xa3b4, 0xa3b5, 0xa3b6, 0xa3b7,
+ 0xa3b8, 0xa3b9, 0xa3ba, 0xa3bb, 0xa3bc, 0xa3bd, 0xa3be, 0xa3bf,
+ 0xa3c0, 0xa3c1, 0xa3c2, 0xa3c3, 0xa3c4, 0xa3c5, 0xa3c6, 0xa3c7,
+ 0xa3c8, 0xa3c9, 0xa3ca, 0xa3cb, 0xa3cc, 0xa3cd, 0xa3ce, 0xa3cf,
+ 0xa3d0, 0xa3d1, 0xa3d2, 0xa3d3, 0xa3d4, 0xa3d5, 0xa3d6, 0xa3d7,
+ 0xa3d8, 0xa3d9, 0xa3da, 0xa3db, 0xa3dc, 0xa3dd, 0xa3de, 0xa3df,
+ 0xa3e0, 0xa3e1, 0xa3e2, 0xa3e3, 0xa3e4, 0xa3e5, 0xa3e6, 0xa3e7,
+ 0xa3e8, 0xa3e9, 0xa3ea, 0xa3eb, 0xa3ec, 0xa3ed, 0xa3ee, 0xa3ef,
+ 0xa3f0, 0xa3f1, 0xa3f2, 0xa3f3, 0xa3f4, 0xa3f5, 0xa3f6, 0xa3f7,
+ 0xa3f8, 0xa3f9, 0xa3fa, 0xa3fb, 0xa3fc, 0xa3fd, 0xa3fe, 0xa3ff,
+ 0xa400, 0xa401, 0xa402, 0xa403, 0xa404, 0xa405, 0xa406, 0xa407,
+ 0xa408, 0xa409, 0xa40a, 0xa40b, 0xa40c, 0xa40d, 0xa40e, 0xa40f,
+ 0xa410, 0xa411, 0xa412, 0xa413, 0xa414, 0xa415, 0xa416, 0xa417,
+ 0xa418, 0xa419, 0xa41a, 0xa41b, 0xa41c, 0xa41d, 0xa41e, 0xa41f,
+ 0xa420, 0xa421, 0xa422, 0xa423, 0xa424, 0xa425, 0xa426, 0xa427,
+ 0xa428, 0xa429, 0xa42a, 0xa42b, 0xa42c, 0xa42d, 0xa42e, 0xa42f,
+ 0xa430, 0xa431, 0xa432, 0xa433, 0xa434, 0xa435, 0xa436, 0xa437,
+ 0xa438, 0xa439, 0xa43a, 0xa43b, 0xa43c, 0xa43d, 0xa43e, 0xa43f,
+ 0xa440, 0xa441, 0xa442, 0xa443, 0xa444, 0xa445, 0xa446, 0xa447,
+ 0xa448, 0xa449, 0xa44a, 0xa44b, 0xa44c, 0xa44d, 0xa44e, 0xa44f,
+ 0xa450, 0xa451, 0xa452, 0xa453, 0xa454, 0xa455, 0xa456, 0xa457,
+ 0xa458, 0xa459, 0xa45a, 0xa45b, 0xa45c, 0xa45d, 0xa45e, 0xa45f,
+ 0xa460, 0xa461, 0xa462, 0xa463, 0xa464, 0xa465, 0xa466, 0xa467,
+ 0xa468, 0xa469, 0xa46a, 0xa46b, 0xa46c, 0xa46d, 0xa46e, 0xa46f,
+ 0xa470, 0xa471, 0xa472, 0xa473, 0xa474, 0xa475, 0xa476, 0xa477,
+ 0xa478, 0xa479, 0xa47a, 0xa47b, 0xa47c, 0xa47d, 0xa47e, 0xa47f,
+ 0xa480, 0xa481, 0xa482, 0xa483, 0xa484, 0xa485, 0xa486, 0xa487,
+ 0xa488, 0xa489, 0xa48a, 0xa48b, 0xa48c, 0x0000, 0x0000, 0x0000,
+ 0xa490, 0xa491, 0xa492, 0xa493, 0xa494, 0xa495, 0xa496, 0xa497,
+ 0xa498, 0xa499, 0xa49a, 0xa49b, 0xa49c, 0xa49d, 0xa49e, 0xa49f,
+ 0xa4a0, 0xa4a1, 0xa4a2, 0xa4a3, 0xa4a4, 0xa4a5, 0xa4a6, 0xa4a7,
+ 0xa4a8, 0xa4a9, 0xa4aa, 0xa4ab, 0xa4ac, 0xa4ad, 0xa4ae, 0xa4af,
+ 0xa4b0, 0xa4b1, 0xa4b2, 0xa4b3, 0xa4b4, 0xa4b5, 0xa4b6, 0xa4b7,
+ 0xa4b8, 0xa4b9, 0xa4ba, 0xa4bb, 0xa4bc, 0xa4bd, 0xa4be, 0xa4bf,
+ 0xa4c0, 0xa4c1, 0xa4c2, 0xa4c3, 0xa4c4, 0xa4c5, 0xa4c6, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa500, 0xa501, 0xa502, 0xa503, 0xa504, 0xa505, 0xa506, 0xa507,
+ 0xa508, 0xa509, 0xa50a, 0xa50b, 0xa50c, 0xa50d, 0xa50e, 0xa50f,
+ 0xa510, 0xa511, 0xa512, 0xa513, 0xa514, 0xa515, 0xa516, 0xa517,
+ 0xa518, 0xa519, 0xa51a, 0xa51b, 0xa51c, 0xa51d, 0xa51e, 0xa51f,
+ 0xa520, 0xa521, 0xa522, 0xa523, 0xa524, 0xa525, 0xa526, 0xa527,
+ 0xa528, 0xa529, 0xa52a, 0xa52b, 0xa52c, 0xa52d, 0xa52e, 0xa52f,
+ 0xa530, 0xa531, 0xa532, 0xa533, 0xa534, 0xa535, 0xa536, 0xa537,
+ 0xa538, 0xa539, 0xa53a, 0xa53b, 0xa53c, 0xa53d, 0xa53e, 0xa53f,
+ 0xa540, 0xa541, 0xa542, 0xa543, 0xa544, 0xa545, 0xa546, 0xa547,
+ 0xa548, 0xa549, 0xa54a, 0xa54b, 0xa54c, 0xa54d, 0xa54e, 0xa54f,
+ 0xa550, 0xa551, 0xa552, 0xa553, 0xa554, 0xa555, 0xa556, 0xa557,
+ 0xa558, 0xa559, 0xa55a, 0xa55b, 0xa55c, 0xa55d, 0xa55e, 0xa55f,
+ 0xa560, 0xa561, 0xa562, 0xa563, 0xa564, 0xa565, 0xa566, 0xa567,
+ 0xa568, 0xa569, 0xa56a, 0xa56b, 0xa56c, 0xa56d, 0xa56e, 0xa56f,
+ 0xa570, 0xa571, 0xa572, 0xa573, 0xa574, 0xa575, 0xa576, 0xa577,
+ 0xa578, 0xa579, 0xa57a, 0xa57b, 0xa57c, 0xa57d, 0xa57e, 0xa57f,
+ 0xa580, 0xa581, 0xa582, 0xa583, 0xa584, 0xa585, 0xa586, 0xa587,
+ 0xa588, 0xa589, 0xa58a, 0xa58b, 0xa58c, 0xa58d, 0xa58e, 0xa58f,
+ 0xa590, 0xa591, 0xa592, 0xa593, 0xa594, 0xa595, 0xa596, 0xa597,
+ 0xa598, 0xa599, 0xa59a, 0xa59b, 0xa59c, 0xa59d, 0xa59e, 0xa59f,
+ 0xa5a0, 0xa5a1, 0xa5a2, 0xa5a3, 0xa5a4, 0xa5a5, 0xa5a6, 0xa5a7,
+ 0xa5a8, 0xa5a9, 0xa5aa, 0xa5ab, 0xa5ac, 0xa5ad, 0xa5ae, 0xa5af,
+ 0xa5b0, 0xa5b1, 0xa5b2, 0xa5b3, 0xa5b4, 0xa5b5, 0xa5b6, 0xa5b7,
+ 0xa5b8, 0xa5b9, 0xa5ba, 0xa5bb, 0xa5bc, 0xa5bd, 0xa5be, 0xa5bf,
+ 0xa5c0, 0xa5c1, 0xa5c2, 0xa5c3, 0xa5c4, 0xa5c5, 0xa5c6, 0xa5c7,
+ 0xa5c8, 0xa5c9, 0xa5ca, 0xa5cb, 0xa5cc, 0xa5cd, 0xa5ce, 0xa5cf,
+ 0xa5d0, 0xa5d1, 0xa5d2, 0xa5d3, 0xa5d4, 0xa5d5, 0xa5d6, 0xa5d7,
+ 0xa5d8, 0xa5d9, 0xa5da, 0xa5db, 0xa5dc, 0xa5dd, 0xa5de, 0xa5df,
+ 0xa5e0, 0xa5e1, 0xa5e2, 0xa5e3, 0xa5e4, 0xa5e5, 0xa5e6, 0xa5e7,
+ 0xa5e8, 0xa5e9, 0xa5ea, 0xa5eb, 0xa5ec, 0xa5ed, 0xa5ee, 0xa5ef,
+ 0xa5f0, 0xa5f1, 0xa5f2, 0xa5f3, 0xa5f4, 0xa5f5, 0xa5f6, 0xa5f7,
+ 0xa5f8, 0xa5f9, 0xa5fa, 0xa5fb, 0xa5fc, 0xa5fd, 0xa5fe, 0xa5ff,
+ 0xa600, 0xa601, 0xa602, 0xa603, 0xa604, 0xa605, 0xa606, 0xa607,
+ 0xa608, 0xa609, 0xa60a, 0xa60b, 0xa60c, 0xa60d, 0xa60e, 0xa60f,
+ 0xa610, 0xa611, 0xa612, 0xa613, 0xa614, 0xa615, 0xa616, 0xa617,
+ 0xa618, 0xa619, 0xa61a, 0xa61b, 0xa61c, 0xa61d, 0xa61e, 0xa61f,
+ 0xa620, 0xa621, 0xa622, 0xa623, 0xa624, 0xa625, 0xa626, 0xa627,
+ 0xa628, 0xa629, 0xa62a, 0xa62b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa641, 0xa641, 0xa643, 0xa643, 0xa645, 0xa645, 0xa647, 0xa647,
+ 0xa649, 0xa649, 0xa64b, 0xa64b, 0xa64d, 0xa64d, 0xa64f, 0xa64f,
+ 0xa651, 0xa651, 0xa653, 0xa653, 0xa655, 0xa655, 0xa657, 0xa657,
+ 0xa659, 0xa659, 0xa65b, 0xa65b, 0xa65d, 0xa65d, 0xa65f, 0xa65f,
+ 0x0000, 0x0000, 0xa663, 0xa663, 0xa665, 0xa665, 0xa667, 0xa667,
+ 0xa669, 0xa669, 0xa66b, 0xa66b, 0xa66d, 0xa66d, 0xa66e, 0xa66f,
+ 0xa670, 0xa671, 0xa672, 0xa673, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0xa67c, 0xa67d, 0xa67e, 0xa67f,
+ 0xa681, 0xa681, 0xa683, 0xa683, 0xa685, 0xa685, 0xa687, 0xa687,
+ 0xa689, 0xa689, 0xa68b, 0xa68b, 0xa68d, 0xa68d, 0xa68f, 0xa68f,
+ 0xa691, 0xa691, 0xa693, 0xa693, 0xa695, 0xa695, 0xa697, 0xa697,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa700, 0xa701, 0xa702, 0xa703, 0xa704, 0xa705, 0xa706, 0xa707,
+ 0xa708, 0xa709, 0xa70a, 0xa70b, 0xa70c, 0xa70d, 0xa70e, 0xa70f,
+ 0xa710, 0xa711, 0xa712, 0xa713, 0xa714, 0xa715, 0xa716, 0xa717,
+ 0xa718, 0xa719, 0xa71a, 0xa71b, 0xa71c, 0xa71d, 0xa71e, 0xa71f,
+ 0xa720, 0xa721, 0xa723, 0xa723, 0xa725, 0xa725, 0xa727, 0xa727,
+ 0xa729, 0xa729, 0xa72b, 0xa72b, 0xa72d, 0xa72d, 0xa72f, 0xa72f,
+ 0xa730, 0xa731, 0xa733, 0xa733, 0xa735, 0xa735, 0xa737, 0xa737,
+ 0xa739, 0xa739, 0xa73b, 0xa73b, 0xa73d, 0xa73d, 0xa73f, 0xa73f,
+ 0xa741, 0xa741, 0xa743, 0xa743, 0xa745, 0xa745, 0xa747, 0xa747,
+ 0xa749, 0xa749, 0xa74b, 0xa74b, 0xa74d, 0xa74d, 0xa74f, 0xa74f,
+ 0xa751, 0xa751, 0xa753, 0xa753, 0xa755, 0xa755, 0xa757, 0xa757,
+ 0xa759, 0xa759, 0xa75b, 0xa75b, 0xa75d, 0xa75d, 0xa75f, 0xa75f,
+ 0xa761, 0xa761, 0xa763, 0xa763, 0xa765, 0xa765, 0xa767, 0xa767,
+ 0xa769, 0xa769, 0xa76b, 0xa76b, 0xa76d, 0xa76d, 0xa76f, 0xa76f,
+ 0xa770, 0xa771, 0xa772, 0xa773, 0xa774, 0xa775, 0xa776, 0xa777,
+ 0xa778, 0xa77a, 0xa77a, 0xa77c, 0xa77c, 0x1d79, 0xa77f, 0xa77f,
+ 0xa781, 0xa781, 0xa783, 0xa783, 0xa785, 0xa785, 0xa787, 0xa787,
+ 0xa788, 0xa789, 0xa78a, 0xa78c, 0xa78c, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0xa7fb, 0xa7fc, 0xa7fd, 0xa7fe, 0xa7ff,
+ 0xa800, 0xa801, 0xa802, 0xa803, 0xa804, 0xa805, 0xa806, 0xa807,
+ 0xa808, 0xa809, 0xa80a, 0xa80b, 0xa80c, 0xa80d, 0xa80e, 0xa80f,
+ 0xa810, 0xa811, 0xa812, 0xa813, 0xa814, 0xa815, 0xa816, 0xa817,
+ 0xa818, 0xa819, 0xa81a, 0xa81b, 0xa81c, 0xa81d, 0xa81e, 0xa81f,
+ 0xa820, 0xa821, 0xa822, 0xa823, 0xa824, 0xa825, 0xa826, 0xa827,
+ 0xa828, 0xa829, 0xa82a, 0xa82b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa840, 0xa841, 0xa842, 0xa843, 0xa844, 0xa845, 0xa846, 0xa847,
+ 0xa848, 0xa849, 0xa84a, 0xa84b, 0xa84c, 0xa84d, 0xa84e, 0xa84f,
+ 0xa850, 0xa851, 0xa852, 0xa853, 0xa854, 0xa855, 0xa856, 0xa857,
+ 0xa858, 0xa859, 0xa85a, 0xa85b, 0xa85c, 0xa85d, 0xa85e, 0xa85f,
+ 0xa860, 0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866, 0xa867,
+ 0xa868, 0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f,
+ 0xa870, 0xa871, 0xa872, 0xa873, 0xa874, 0xa875, 0xa876, 0xa877,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa880, 0xa881, 0xa882, 0xa883, 0xa884, 0xa885, 0xa886, 0xa887,
+ 0xa888, 0xa889, 0xa88a, 0xa88b, 0xa88c, 0xa88d, 0xa88e, 0xa88f,
+ 0xa890, 0xa891, 0xa892, 0xa893, 0xa894, 0xa895, 0xa896, 0xa897,
+ 0xa898, 0xa899, 0xa89a, 0xa89b, 0xa89c, 0xa89d, 0xa89e, 0xa89f,
+ 0xa8a0, 0xa8a1, 0xa8a2, 0xa8a3, 0xa8a4, 0xa8a5, 0xa8a6, 0xa8a7,
+ 0xa8a8, 0xa8a9, 0xa8aa, 0xa8ab, 0xa8ac, 0xa8ad, 0xa8ae, 0xa8af,
+ 0xa8b0, 0xa8b1, 0xa8b2, 0xa8b3, 0xa8b4, 0xa8b5, 0xa8b6, 0xa8b7,
+ 0xa8b8, 0xa8b9, 0xa8ba, 0xa8bb, 0xa8bc, 0xa8bd, 0xa8be, 0xa8bf,
+ 0xa8c0, 0xa8c1, 0xa8c2, 0xa8c3, 0xa8c4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa8ce, 0xa8cf,
+ 0xa8d0, 0xa8d1, 0xa8d2, 0xa8d3, 0xa8d4, 0xa8d5, 0xa8d6, 0xa8d7,
+ 0xa8d8, 0xa8d9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa900, 0xa901, 0xa902, 0xa903, 0xa904, 0xa905, 0xa906, 0xa907,
+ 0xa908, 0xa909, 0xa90a, 0xa90b, 0xa90c, 0xa90d, 0xa90e, 0xa90f,
+ 0xa910, 0xa911, 0xa912, 0xa913, 0xa914, 0xa915, 0xa916, 0xa917,
+ 0xa918, 0xa919, 0xa91a, 0xa91b, 0xa91c, 0xa91d, 0xa91e, 0xa91f,
+ 0xa920, 0xa921, 0xa922, 0xa923, 0xa924, 0xa925, 0xa926, 0xa927,
+ 0xa928, 0xa929, 0xa92a, 0xa92b, 0xa92c, 0xa92d, 0xa92e, 0xa92f,
+ 0xa930, 0xa931, 0xa932, 0xa933, 0xa934, 0xa935, 0xa936, 0xa937,
+ 0xa938, 0xa939, 0xa93a, 0xa93b, 0xa93c, 0xa93d, 0xa93e, 0xa93f,
+ 0xa940, 0xa941, 0xa942, 0xa943, 0xa944, 0xa945, 0xa946, 0xa947,
+ 0xa948, 0xa949, 0xa94a, 0xa94b, 0xa94c, 0xa94d, 0xa94e, 0xa94f,
+ 0xa950, 0xa951, 0xa952, 0xa953, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa95f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xaa00, 0xaa01, 0xaa02, 0xaa03, 0xaa04, 0xaa05, 0xaa06, 0xaa07,
+ 0xaa08, 0xaa09, 0xaa0a, 0xaa0b, 0xaa0c, 0xaa0d, 0xaa0e, 0xaa0f,
+ 0xaa10, 0xaa11, 0xaa12, 0xaa13, 0xaa14, 0xaa15, 0xaa16, 0xaa17,
+ 0xaa18, 0xaa19, 0xaa1a, 0xaa1b, 0xaa1c, 0xaa1d, 0xaa1e, 0xaa1f,
+ 0xaa20, 0xaa21, 0xaa22, 0xaa23, 0xaa24, 0xaa25, 0xaa26, 0xaa27,
+ 0xaa28, 0xaa29, 0xaa2a, 0xaa2b, 0xaa2c, 0xaa2d, 0xaa2e, 0xaa2f,
+ 0xaa30, 0xaa31, 0xaa32, 0xaa33, 0xaa34, 0xaa35, 0xaa36, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xaa40, 0xaa41, 0xaa42, 0xaa43, 0xaa44, 0xaa45, 0xaa46, 0xaa47,
+ 0xaa48, 0xaa49, 0xaa4a, 0xaa4b, 0xaa4c, 0xaa4d, 0x0000, 0x0000,
+ 0xaa50, 0xaa51, 0xaa52, 0xaa53, 0xaa54, 0xaa55, 0xaa56, 0xaa57,
+ 0xaa58, 0xaa59, 0x0000, 0x0000, 0xaa5c, 0xaa5d, 0xaa5e, 0xaa5f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xac00, 0xac01, 0xac02, 0xac03, 0xac04, 0xac05, 0xac06, 0xac07,
+ 0xac08, 0xac09, 0xac0a, 0xac0b, 0xac0c, 0xac0d, 0xac0e, 0xac0f,
+ 0xac10, 0xac11, 0xac12, 0xac13, 0xac14, 0xac15, 0xac16, 0xac17,
+ 0xac18, 0xac19, 0xac1a, 0xac1b, 0xac1c, 0xac1d, 0xac1e, 0xac1f,
+ 0xac20, 0xac21, 0xac22, 0xac23, 0xac24, 0xac25, 0xac26, 0xac27,
+ 0xac28, 0xac29, 0xac2a, 0xac2b, 0xac2c, 0xac2d, 0xac2e, 0xac2f,
+ 0xac30, 0xac31, 0xac32, 0xac33, 0xac34, 0xac35, 0xac36, 0xac37,
+ 0xac38, 0xac39, 0xac3a, 0xac3b, 0xac3c, 0xac3d, 0xac3e, 0xac3f,
+ 0xac40, 0xac41, 0xac42, 0xac43, 0xac44, 0xac45, 0xac46, 0xac47,
+ 0xac48, 0xac49, 0xac4a, 0xac4b, 0xac4c, 0xac4d, 0xac4e, 0xac4f,
+ 0xac50, 0xac51, 0xac52, 0xac53, 0xac54, 0xac55, 0xac56, 0xac57,
+ 0xac58, 0xac59, 0xac5a, 0xac5b, 0xac5c, 0xac5d, 0xac5e, 0xac5f,
+ 0xac60, 0xac61, 0xac62, 0xac63, 0xac64, 0xac65, 0xac66, 0xac67,
+ 0xac68, 0xac69, 0xac6a, 0xac6b, 0xac6c, 0xac6d, 0xac6e, 0xac6f,
+ 0xac70, 0xac71, 0xac72, 0xac73, 0xac74, 0xac75, 0xac76, 0xac77,
+ 0xac78, 0xac79, 0xac7a, 0xac7b, 0xac7c, 0xac7d, 0xac7e, 0xac7f,
+ 0xac80, 0xac81, 0xac82, 0xac83, 0xac84, 0xac85, 0xac86, 0xac87,
+ 0xac88, 0xac89, 0xac8a, 0xac8b, 0xac8c, 0xac8d, 0xac8e, 0xac8f,
+ 0xac90, 0xac91, 0xac92, 0xac93, 0xac94, 0xac95, 0xac96, 0xac97,
+ 0xac98, 0xac99, 0xac9a, 0xac9b, 0xac9c, 0xac9d, 0xac9e, 0xac9f,
+ 0xaca0, 0xaca1, 0xaca2, 0xaca3, 0xaca4, 0xaca5, 0xaca6, 0xaca7,
+ 0xaca8, 0xaca9, 0xacaa, 0xacab, 0xacac, 0xacad, 0xacae, 0xacaf,
+ 0xacb0, 0xacb1, 0xacb2, 0xacb3, 0xacb4, 0xacb5, 0xacb6, 0xacb7,
+ 0xacb8, 0xacb9, 0xacba, 0xacbb, 0xacbc, 0xacbd, 0xacbe, 0xacbf,
+ 0xacc0, 0xacc1, 0xacc2, 0xacc3, 0xacc4, 0xacc5, 0xacc6, 0xacc7,
+ 0xacc8, 0xacc9, 0xacca, 0xaccb, 0xaccc, 0xaccd, 0xacce, 0xaccf,
+ 0xacd0, 0xacd1, 0xacd2, 0xacd3, 0xacd4, 0xacd5, 0xacd6, 0xacd7,
+ 0xacd8, 0xacd9, 0xacda, 0xacdb, 0xacdc, 0xacdd, 0xacde, 0xacdf,
+ 0xace0, 0xace1, 0xace2, 0xace3, 0xace4, 0xace5, 0xace6, 0xace7,
+ 0xace8, 0xace9, 0xacea, 0xaceb, 0xacec, 0xaced, 0xacee, 0xacef,
+ 0xacf0, 0xacf1, 0xacf2, 0xacf3, 0xacf4, 0xacf5, 0xacf6, 0xacf7,
+ 0xacf8, 0xacf9, 0xacfa, 0xacfb, 0xacfc, 0xacfd, 0xacfe, 0xacff,
+ 0xad00, 0xad01, 0xad02, 0xad03, 0xad04, 0xad05, 0xad06, 0xad07,
+ 0xad08, 0xad09, 0xad0a, 0xad0b, 0xad0c, 0xad0d, 0xad0e, 0xad0f,
+ 0xad10, 0xad11, 0xad12, 0xad13, 0xad14, 0xad15, 0xad16, 0xad17,
+ 0xad18, 0xad19, 0xad1a, 0xad1b, 0xad1c, 0xad1d, 0xad1e, 0xad1f,
+ 0xad20, 0xad21, 0xad22, 0xad23, 0xad24, 0xad25, 0xad26, 0xad27,
+ 0xad28, 0xad29, 0xad2a, 0xad2b, 0xad2c, 0xad2d, 0xad2e, 0xad2f,
+ 0xad30, 0xad31, 0xad32, 0xad33, 0xad34, 0xad35, 0xad36, 0xad37,
+ 0xad38, 0xad39, 0xad3a, 0xad3b, 0xad3c, 0xad3d, 0xad3e, 0xad3f,
+ 0xad40, 0xad41, 0xad42, 0xad43, 0xad44, 0xad45, 0xad46, 0xad47,
+ 0xad48, 0xad49, 0xad4a, 0xad4b, 0xad4c, 0xad4d, 0xad4e, 0xad4f,
+ 0xad50, 0xad51, 0xad52, 0xad53, 0xad54, 0xad55, 0xad56, 0xad57,
+ 0xad58, 0xad59, 0xad5a, 0xad5b, 0xad5c, 0xad5d, 0xad5e, 0xad5f,
+ 0xad60, 0xad61, 0xad62, 0xad63, 0xad64, 0xad65, 0xad66, 0xad67,
+ 0xad68, 0xad69, 0xad6a, 0xad6b, 0xad6c, 0xad6d, 0xad6e, 0xad6f,
+ 0xad70, 0xad71, 0xad72, 0xad73, 0xad74, 0xad75, 0xad76, 0xad77,
+ 0xad78, 0xad79, 0xad7a, 0xad7b, 0xad7c, 0xad7d, 0xad7e, 0xad7f,
+ 0xad80, 0xad81, 0xad82, 0xad83, 0xad84, 0xad85, 0xad86, 0xad87,
+ 0xad88, 0xad89, 0xad8a, 0xad8b, 0xad8c, 0xad8d, 0xad8e, 0xad8f,
+ 0xad90, 0xad91, 0xad92, 0xad93, 0xad94, 0xad95, 0xad96, 0xad97,
+ 0xad98, 0xad99, 0xad9a, 0xad9b, 0xad9c, 0xad9d, 0xad9e, 0xad9f,
+ 0xada0, 0xada1, 0xada2, 0xada3, 0xada4, 0xada5, 0xada6, 0xada7,
+ 0xada8, 0xada9, 0xadaa, 0xadab, 0xadac, 0xadad, 0xadae, 0xadaf,
+ 0xadb0, 0xadb1, 0xadb2, 0xadb3, 0xadb4, 0xadb5, 0xadb6, 0xadb7,
+ 0xadb8, 0xadb9, 0xadba, 0xadbb, 0xadbc, 0xadbd, 0xadbe, 0xadbf,
+ 0xadc0, 0xadc1, 0xadc2, 0xadc3, 0xadc4, 0xadc5, 0xadc6, 0xadc7,
+ 0xadc8, 0xadc9, 0xadca, 0xadcb, 0xadcc, 0xadcd, 0xadce, 0xadcf,
+ 0xadd0, 0xadd1, 0xadd2, 0xadd3, 0xadd4, 0xadd5, 0xadd6, 0xadd7,
+ 0xadd8, 0xadd9, 0xadda, 0xaddb, 0xaddc, 0xaddd, 0xadde, 0xaddf,
+ 0xade0, 0xade1, 0xade2, 0xade3, 0xade4, 0xade5, 0xade6, 0xade7,
+ 0xade8, 0xade9, 0xadea, 0xadeb, 0xadec, 0xaded, 0xadee, 0xadef,
+ 0xadf0, 0xadf1, 0xadf2, 0xadf3, 0xadf4, 0xadf5, 0xadf6, 0xadf7,
+ 0xadf8, 0xadf9, 0xadfa, 0xadfb, 0xadfc, 0xadfd, 0xadfe, 0xadff,
+ 0xae00, 0xae01, 0xae02, 0xae03, 0xae04, 0xae05, 0xae06, 0xae07,
+ 0xae08, 0xae09, 0xae0a, 0xae0b, 0xae0c, 0xae0d, 0xae0e, 0xae0f,
+ 0xae10, 0xae11, 0xae12, 0xae13, 0xae14, 0xae15, 0xae16, 0xae17,
+ 0xae18, 0xae19, 0xae1a, 0xae1b, 0xae1c, 0xae1d, 0xae1e, 0xae1f,
+ 0xae20, 0xae21, 0xae22, 0xae23, 0xae24, 0xae25, 0xae26, 0xae27,
+ 0xae28, 0xae29, 0xae2a, 0xae2b, 0xae2c, 0xae2d, 0xae2e, 0xae2f,
+ 0xae30, 0xae31, 0xae32, 0xae33, 0xae34, 0xae35, 0xae36, 0xae37,
+ 0xae38, 0xae39, 0xae3a, 0xae3b, 0xae3c, 0xae3d, 0xae3e, 0xae3f,
+ 0xae40, 0xae41, 0xae42, 0xae43, 0xae44, 0xae45, 0xae46, 0xae47,
+ 0xae48, 0xae49, 0xae4a, 0xae4b, 0xae4c, 0xae4d, 0xae4e, 0xae4f,
+ 0xae50, 0xae51, 0xae52, 0xae53, 0xae54, 0xae55, 0xae56, 0xae57,
+ 0xae58, 0xae59, 0xae5a, 0xae5b, 0xae5c, 0xae5d, 0xae5e, 0xae5f,
+ 0xae60, 0xae61, 0xae62, 0xae63, 0xae64, 0xae65, 0xae66, 0xae67,
+ 0xae68, 0xae69, 0xae6a, 0xae6b, 0xae6c, 0xae6d, 0xae6e, 0xae6f,
+ 0xae70, 0xae71, 0xae72, 0xae73, 0xae74, 0xae75, 0xae76, 0xae77,
+ 0xae78, 0xae79, 0xae7a, 0xae7b, 0xae7c, 0xae7d, 0xae7e, 0xae7f,
+ 0xae80, 0xae81, 0xae82, 0xae83, 0xae84, 0xae85, 0xae86, 0xae87,
+ 0xae88, 0xae89, 0xae8a, 0xae8b, 0xae8c, 0xae8d, 0xae8e, 0xae8f,
+ 0xae90, 0xae91, 0xae92, 0xae93, 0xae94, 0xae95, 0xae96, 0xae97,
+ 0xae98, 0xae99, 0xae9a, 0xae9b, 0xae9c, 0xae9d, 0xae9e, 0xae9f,
+ 0xaea0, 0xaea1, 0xaea2, 0xaea3, 0xaea4, 0xaea5, 0xaea6, 0xaea7,
+ 0xaea8, 0xaea9, 0xaeaa, 0xaeab, 0xaeac, 0xaead, 0xaeae, 0xaeaf,
+ 0xaeb0, 0xaeb1, 0xaeb2, 0xaeb3, 0xaeb4, 0xaeb5, 0xaeb6, 0xaeb7,
+ 0xaeb8, 0xaeb9, 0xaeba, 0xaebb, 0xaebc, 0xaebd, 0xaebe, 0xaebf,
+ 0xaec0, 0xaec1, 0xaec2, 0xaec3, 0xaec4, 0xaec5, 0xaec6, 0xaec7,
+ 0xaec8, 0xaec9, 0xaeca, 0xaecb, 0xaecc, 0xaecd, 0xaece, 0xaecf,
+ 0xaed0, 0xaed1, 0xaed2, 0xaed3, 0xaed4, 0xaed5, 0xaed6, 0xaed7,
+ 0xaed8, 0xaed9, 0xaeda, 0xaedb, 0xaedc, 0xaedd, 0xaede, 0xaedf,
+ 0xaee0, 0xaee1, 0xaee2, 0xaee3, 0xaee4, 0xaee5, 0xaee6, 0xaee7,
+ 0xaee8, 0xaee9, 0xaeea, 0xaeeb, 0xaeec, 0xaeed, 0xaeee, 0xaeef,
+ 0xaef0, 0xaef1, 0xaef2, 0xaef3, 0xaef4, 0xaef5, 0xaef6, 0xaef7,
+ 0xaef8, 0xaef9, 0xaefa, 0xaefb, 0xaefc, 0xaefd, 0xaefe, 0xaeff,
+ 0xaf00, 0xaf01, 0xaf02, 0xaf03, 0xaf04, 0xaf05, 0xaf06, 0xaf07,
+ 0xaf08, 0xaf09, 0xaf0a, 0xaf0b, 0xaf0c, 0xaf0d, 0xaf0e, 0xaf0f,
+ 0xaf10, 0xaf11, 0xaf12, 0xaf13, 0xaf14, 0xaf15, 0xaf16, 0xaf17,
+ 0xaf18, 0xaf19, 0xaf1a, 0xaf1b, 0xaf1c, 0xaf1d, 0xaf1e, 0xaf1f,
+ 0xaf20, 0xaf21, 0xaf22, 0xaf23, 0xaf24, 0xaf25, 0xaf26, 0xaf27,
+ 0xaf28, 0xaf29, 0xaf2a, 0xaf2b, 0xaf2c, 0xaf2d, 0xaf2e, 0xaf2f,
+ 0xaf30, 0xaf31, 0xaf32, 0xaf33, 0xaf34, 0xaf35, 0xaf36, 0xaf37,
+ 0xaf38, 0xaf39, 0xaf3a, 0xaf3b, 0xaf3c, 0xaf3d, 0xaf3e, 0xaf3f,
+ 0xaf40, 0xaf41, 0xaf42, 0xaf43, 0xaf44, 0xaf45, 0xaf46, 0xaf47,
+ 0xaf48, 0xaf49, 0xaf4a, 0xaf4b, 0xaf4c, 0xaf4d, 0xaf4e, 0xaf4f,
+ 0xaf50, 0xaf51, 0xaf52, 0xaf53, 0xaf54, 0xaf55, 0xaf56, 0xaf57,
+ 0xaf58, 0xaf59, 0xaf5a, 0xaf5b, 0xaf5c, 0xaf5d, 0xaf5e, 0xaf5f,
+ 0xaf60, 0xaf61, 0xaf62, 0xaf63, 0xaf64, 0xaf65, 0xaf66, 0xaf67,
+ 0xaf68, 0xaf69, 0xaf6a, 0xaf6b, 0xaf6c, 0xaf6d, 0xaf6e, 0xaf6f,
+ 0xaf70, 0xaf71, 0xaf72, 0xaf73, 0xaf74, 0xaf75, 0xaf76, 0xaf77,
+ 0xaf78, 0xaf79, 0xaf7a, 0xaf7b, 0xaf7c, 0xaf7d, 0xaf7e, 0xaf7f,
+ 0xaf80, 0xaf81, 0xaf82, 0xaf83, 0xaf84, 0xaf85, 0xaf86, 0xaf87,
+ 0xaf88, 0xaf89, 0xaf8a, 0xaf8b, 0xaf8c, 0xaf8d, 0xaf8e, 0xaf8f,
+ 0xaf90, 0xaf91, 0xaf92, 0xaf93, 0xaf94, 0xaf95, 0xaf96, 0xaf97,
+ 0xaf98, 0xaf99, 0xaf9a, 0xaf9b, 0xaf9c, 0xaf9d, 0xaf9e, 0xaf9f,
+ 0xafa0, 0xafa1, 0xafa2, 0xafa3, 0xafa4, 0xafa5, 0xafa6, 0xafa7,
+ 0xafa8, 0xafa9, 0xafaa, 0xafab, 0xafac, 0xafad, 0xafae, 0xafaf,
+ 0xafb0, 0xafb1, 0xafb2, 0xafb3, 0xafb4, 0xafb5, 0xafb6, 0xafb7,
+ 0xafb8, 0xafb9, 0xafba, 0xafbb, 0xafbc, 0xafbd, 0xafbe, 0xafbf,
+ 0xafc0, 0xafc1, 0xafc2, 0xafc3, 0xafc4, 0xafc5, 0xafc6, 0xafc7,
+ 0xafc8, 0xafc9, 0xafca, 0xafcb, 0xafcc, 0xafcd, 0xafce, 0xafcf,
+ 0xafd0, 0xafd1, 0xafd2, 0xafd3, 0xafd4, 0xafd5, 0xafd6, 0xafd7,
+ 0xafd8, 0xafd9, 0xafda, 0xafdb, 0xafdc, 0xafdd, 0xafde, 0xafdf,
+ 0xafe0, 0xafe1, 0xafe2, 0xafe3, 0xafe4, 0xafe5, 0xafe6, 0xafe7,
+ 0xafe8, 0xafe9, 0xafea, 0xafeb, 0xafec, 0xafed, 0xafee, 0xafef,
+ 0xaff0, 0xaff1, 0xaff2, 0xaff3, 0xaff4, 0xaff5, 0xaff6, 0xaff7,
+ 0xaff8, 0xaff9, 0xaffa, 0xaffb, 0xaffc, 0xaffd, 0xaffe, 0xafff,
+ 0xb000, 0xb001, 0xb002, 0xb003, 0xb004, 0xb005, 0xb006, 0xb007,
+ 0xb008, 0xb009, 0xb00a, 0xb00b, 0xb00c, 0xb00d, 0xb00e, 0xb00f,
+ 0xb010, 0xb011, 0xb012, 0xb013, 0xb014, 0xb015, 0xb016, 0xb017,
+ 0xb018, 0xb019, 0xb01a, 0xb01b, 0xb01c, 0xb01d, 0xb01e, 0xb01f,
+ 0xb020, 0xb021, 0xb022, 0xb023, 0xb024, 0xb025, 0xb026, 0xb027,
+ 0xb028, 0xb029, 0xb02a, 0xb02b, 0xb02c, 0xb02d, 0xb02e, 0xb02f,
+ 0xb030, 0xb031, 0xb032, 0xb033, 0xb034, 0xb035, 0xb036, 0xb037,
+ 0xb038, 0xb039, 0xb03a, 0xb03b, 0xb03c, 0xb03d, 0xb03e, 0xb03f,
+ 0xb040, 0xb041, 0xb042, 0xb043, 0xb044, 0xb045, 0xb046, 0xb047,
+ 0xb048, 0xb049, 0xb04a, 0xb04b, 0xb04c, 0xb04d, 0xb04e, 0xb04f,
+ 0xb050, 0xb051, 0xb052, 0xb053, 0xb054, 0xb055, 0xb056, 0xb057,
+ 0xb058, 0xb059, 0xb05a, 0xb05b, 0xb05c, 0xb05d, 0xb05e, 0xb05f,
+ 0xb060, 0xb061, 0xb062, 0xb063, 0xb064, 0xb065, 0xb066, 0xb067,
+ 0xb068, 0xb069, 0xb06a, 0xb06b, 0xb06c, 0xb06d, 0xb06e, 0xb06f,
+ 0xb070, 0xb071, 0xb072, 0xb073, 0xb074, 0xb075, 0xb076, 0xb077,
+ 0xb078, 0xb079, 0xb07a, 0xb07b, 0xb07c, 0xb07d, 0xb07e, 0xb07f,
+ 0xb080, 0xb081, 0xb082, 0xb083, 0xb084, 0xb085, 0xb086, 0xb087,
+ 0xb088, 0xb089, 0xb08a, 0xb08b, 0xb08c, 0xb08d, 0xb08e, 0xb08f,
+ 0xb090, 0xb091, 0xb092, 0xb093, 0xb094, 0xb095, 0xb096, 0xb097,
+ 0xb098, 0xb099, 0xb09a, 0xb09b, 0xb09c, 0xb09d, 0xb09e, 0xb09f,
+ 0xb0a0, 0xb0a1, 0xb0a2, 0xb0a3, 0xb0a4, 0xb0a5, 0xb0a6, 0xb0a7,
+ 0xb0a8, 0xb0a9, 0xb0aa, 0xb0ab, 0xb0ac, 0xb0ad, 0xb0ae, 0xb0af,
+ 0xb0b0, 0xb0b1, 0xb0b2, 0xb0b3, 0xb0b4, 0xb0b5, 0xb0b6, 0xb0b7,
+ 0xb0b8, 0xb0b9, 0xb0ba, 0xb0bb, 0xb0bc, 0xb0bd, 0xb0be, 0xb0bf,
+ 0xb0c0, 0xb0c1, 0xb0c2, 0xb0c3, 0xb0c4, 0xb0c5, 0xb0c6, 0xb0c7,
+ 0xb0c8, 0xb0c9, 0xb0ca, 0xb0cb, 0xb0cc, 0xb0cd, 0xb0ce, 0xb0cf,
+ 0xb0d0, 0xb0d1, 0xb0d2, 0xb0d3, 0xb0d4, 0xb0d5, 0xb0d6, 0xb0d7,
+ 0xb0d8, 0xb0d9, 0xb0da, 0xb0db, 0xb0dc, 0xb0dd, 0xb0de, 0xb0df,
+ 0xb0e0, 0xb0e1, 0xb0e2, 0xb0e3, 0xb0e4, 0xb0e5, 0xb0e6, 0xb0e7,
+ 0xb0e8, 0xb0e9, 0xb0ea, 0xb0eb, 0xb0ec, 0xb0ed, 0xb0ee, 0xb0ef,
+ 0xb0f0, 0xb0f1, 0xb0f2, 0xb0f3, 0xb0f4, 0xb0f5, 0xb0f6, 0xb0f7,
+ 0xb0f8, 0xb0f9, 0xb0fa, 0xb0fb, 0xb0fc, 0xb0fd, 0xb0fe, 0xb0ff,
+ 0xb100, 0xb101, 0xb102, 0xb103, 0xb104, 0xb105, 0xb106, 0xb107,
+ 0xb108, 0xb109, 0xb10a, 0xb10b, 0xb10c, 0xb10d, 0xb10e, 0xb10f,
+ 0xb110, 0xb111, 0xb112, 0xb113, 0xb114, 0xb115, 0xb116, 0xb117,
+ 0xb118, 0xb119, 0xb11a, 0xb11b, 0xb11c, 0xb11d, 0xb11e, 0xb11f,
+ 0xb120, 0xb121, 0xb122, 0xb123, 0xb124, 0xb125, 0xb126, 0xb127,
+ 0xb128, 0xb129, 0xb12a, 0xb12b, 0xb12c, 0xb12d, 0xb12e, 0xb12f,
+ 0xb130, 0xb131, 0xb132, 0xb133, 0xb134, 0xb135, 0xb136, 0xb137,
+ 0xb138, 0xb139, 0xb13a, 0xb13b, 0xb13c, 0xb13d, 0xb13e, 0xb13f,
+ 0xb140, 0xb141, 0xb142, 0xb143, 0xb144, 0xb145, 0xb146, 0xb147,
+ 0xb148, 0xb149, 0xb14a, 0xb14b, 0xb14c, 0xb14d, 0xb14e, 0xb14f,
+ 0xb150, 0xb151, 0xb152, 0xb153, 0xb154, 0xb155, 0xb156, 0xb157,
+ 0xb158, 0xb159, 0xb15a, 0xb15b, 0xb15c, 0xb15d, 0xb15e, 0xb15f,
+ 0xb160, 0xb161, 0xb162, 0xb163, 0xb164, 0xb165, 0xb166, 0xb167,
+ 0xb168, 0xb169, 0xb16a, 0xb16b, 0xb16c, 0xb16d, 0xb16e, 0xb16f,
+ 0xb170, 0xb171, 0xb172, 0xb173, 0xb174, 0xb175, 0xb176, 0xb177,
+ 0xb178, 0xb179, 0xb17a, 0xb17b, 0xb17c, 0xb17d, 0xb17e, 0xb17f,
+ 0xb180, 0xb181, 0xb182, 0xb183, 0xb184, 0xb185, 0xb186, 0xb187,
+ 0xb188, 0xb189, 0xb18a, 0xb18b, 0xb18c, 0xb18d, 0xb18e, 0xb18f,
+ 0xb190, 0xb191, 0xb192, 0xb193, 0xb194, 0xb195, 0xb196, 0xb197,
+ 0xb198, 0xb199, 0xb19a, 0xb19b, 0xb19c, 0xb19d, 0xb19e, 0xb19f,
+ 0xb1a0, 0xb1a1, 0xb1a2, 0xb1a3, 0xb1a4, 0xb1a5, 0xb1a6, 0xb1a7,
+ 0xb1a8, 0xb1a9, 0xb1aa, 0xb1ab, 0xb1ac, 0xb1ad, 0xb1ae, 0xb1af,
+ 0xb1b0, 0xb1b1, 0xb1b2, 0xb1b3, 0xb1b4, 0xb1b5, 0xb1b6, 0xb1b7,
+ 0xb1b8, 0xb1b9, 0xb1ba, 0xb1bb, 0xb1bc, 0xb1bd, 0xb1be, 0xb1bf,
+ 0xb1c0, 0xb1c1, 0xb1c2, 0xb1c3, 0xb1c4, 0xb1c5, 0xb1c6, 0xb1c7,
+ 0xb1c8, 0xb1c9, 0xb1ca, 0xb1cb, 0xb1cc, 0xb1cd, 0xb1ce, 0xb1cf,
+ 0xb1d0, 0xb1d1, 0xb1d2, 0xb1d3, 0xb1d4, 0xb1d5, 0xb1d6, 0xb1d7,
+ 0xb1d8, 0xb1d9, 0xb1da, 0xb1db, 0xb1dc, 0xb1dd, 0xb1de, 0xb1df,
+ 0xb1e0, 0xb1e1, 0xb1e2, 0xb1e3, 0xb1e4, 0xb1e5, 0xb1e6, 0xb1e7,
+ 0xb1e8, 0xb1e9, 0xb1ea, 0xb1eb, 0xb1ec, 0xb1ed, 0xb1ee, 0xb1ef,
+ 0xb1f0, 0xb1f1, 0xb1f2, 0xb1f3, 0xb1f4, 0xb1f5, 0xb1f6, 0xb1f7,
+ 0xb1f8, 0xb1f9, 0xb1fa, 0xb1fb, 0xb1fc, 0xb1fd, 0xb1fe, 0xb1ff,
+ 0xb200, 0xb201, 0xb202, 0xb203, 0xb204, 0xb205, 0xb206, 0xb207,
+ 0xb208, 0xb209, 0xb20a, 0xb20b, 0xb20c, 0xb20d, 0xb20e, 0xb20f,
+ 0xb210, 0xb211, 0xb212, 0xb213, 0xb214, 0xb215, 0xb216, 0xb217,
+ 0xb218, 0xb219, 0xb21a, 0xb21b, 0xb21c, 0xb21d, 0xb21e, 0xb21f,
+ 0xb220, 0xb221, 0xb222, 0xb223, 0xb224, 0xb225, 0xb226, 0xb227,
+ 0xb228, 0xb229, 0xb22a, 0xb22b, 0xb22c, 0xb22d, 0xb22e, 0xb22f,
+ 0xb230, 0xb231, 0xb232, 0xb233, 0xb234, 0xb235, 0xb236, 0xb237,
+ 0xb238, 0xb239, 0xb23a, 0xb23b, 0xb23c, 0xb23d, 0xb23e, 0xb23f,
+ 0xb240, 0xb241, 0xb242, 0xb243, 0xb244, 0xb245, 0xb246, 0xb247,
+ 0xb248, 0xb249, 0xb24a, 0xb24b, 0xb24c, 0xb24d, 0xb24e, 0xb24f,
+ 0xb250, 0xb251, 0xb252, 0xb253, 0xb254, 0xb255, 0xb256, 0xb257,
+ 0xb258, 0xb259, 0xb25a, 0xb25b, 0xb25c, 0xb25d, 0xb25e, 0xb25f,
+ 0xb260, 0xb261, 0xb262, 0xb263, 0xb264, 0xb265, 0xb266, 0xb267,
+ 0xb268, 0xb269, 0xb26a, 0xb26b, 0xb26c, 0xb26d, 0xb26e, 0xb26f,
+ 0xb270, 0xb271, 0xb272, 0xb273, 0xb274, 0xb275, 0xb276, 0xb277,
+ 0xb278, 0xb279, 0xb27a, 0xb27b, 0xb27c, 0xb27d, 0xb27e, 0xb27f,
+ 0xb280, 0xb281, 0xb282, 0xb283, 0xb284, 0xb285, 0xb286, 0xb287,
+ 0xb288, 0xb289, 0xb28a, 0xb28b, 0xb28c, 0xb28d, 0xb28e, 0xb28f,
+ 0xb290, 0xb291, 0xb292, 0xb293, 0xb294, 0xb295, 0xb296, 0xb297,
+ 0xb298, 0xb299, 0xb29a, 0xb29b, 0xb29c, 0xb29d, 0xb29e, 0xb29f,
+ 0xb2a0, 0xb2a1, 0xb2a2, 0xb2a3, 0xb2a4, 0xb2a5, 0xb2a6, 0xb2a7,
+ 0xb2a8, 0xb2a9, 0xb2aa, 0xb2ab, 0xb2ac, 0xb2ad, 0xb2ae, 0xb2af,
+ 0xb2b0, 0xb2b1, 0xb2b2, 0xb2b3, 0xb2b4, 0xb2b5, 0xb2b6, 0xb2b7,
+ 0xb2b8, 0xb2b9, 0xb2ba, 0xb2bb, 0xb2bc, 0xb2bd, 0xb2be, 0xb2bf,
+ 0xb2c0, 0xb2c1, 0xb2c2, 0xb2c3, 0xb2c4, 0xb2c5, 0xb2c6, 0xb2c7,
+ 0xb2c8, 0xb2c9, 0xb2ca, 0xb2cb, 0xb2cc, 0xb2cd, 0xb2ce, 0xb2cf,
+ 0xb2d0, 0xb2d1, 0xb2d2, 0xb2d3, 0xb2d4, 0xb2d5, 0xb2d6, 0xb2d7,
+ 0xb2d8, 0xb2d9, 0xb2da, 0xb2db, 0xb2dc, 0xb2dd, 0xb2de, 0xb2df,
+ 0xb2e0, 0xb2e1, 0xb2e2, 0xb2e3, 0xb2e4, 0xb2e5, 0xb2e6, 0xb2e7,
+ 0xb2e8, 0xb2e9, 0xb2ea, 0xb2eb, 0xb2ec, 0xb2ed, 0xb2ee, 0xb2ef,
+ 0xb2f0, 0xb2f1, 0xb2f2, 0xb2f3, 0xb2f4, 0xb2f5, 0xb2f6, 0xb2f7,
+ 0xb2f8, 0xb2f9, 0xb2fa, 0xb2fb, 0xb2fc, 0xb2fd, 0xb2fe, 0xb2ff,
+ 0xb300, 0xb301, 0xb302, 0xb303, 0xb304, 0xb305, 0xb306, 0xb307,
+ 0xb308, 0xb309, 0xb30a, 0xb30b, 0xb30c, 0xb30d, 0xb30e, 0xb30f,
+ 0xb310, 0xb311, 0xb312, 0xb313, 0xb314, 0xb315, 0xb316, 0xb317,
+ 0xb318, 0xb319, 0xb31a, 0xb31b, 0xb31c, 0xb31d, 0xb31e, 0xb31f,
+ 0xb320, 0xb321, 0xb322, 0xb323, 0xb324, 0xb325, 0xb326, 0xb327,
+ 0xb328, 0xb329, 0xb32a, 0xb32b, 0xb32c, 0xb32d, 0xb32e, 0xb32f,
+ 0xb330, 0xb331, 0xb332, 0xb333, 0xb334, 0xb335, 0xb336, 0xb337,
+ 0xb338, 0xb339, 0xb33a, 0xb33b, 0xb33c, 0xb33d, 0xb33e, 0xb33f,
+ 0xb340, 0xb341, 0xb342, 0xb343, 0xb344, 0xb345, 0xb346, 0xb347,
+ 0xb348, 0xb349, 0xb34a, 0xb34b, 0xb34c, 0xb34d, 0xb34e, 0xb34f,
+ 0xb350, 0xb351, 0xb352, 0xb353, 0xb354, 0xb355, 0xb356, 0xb357,
+ 0xb358, 0xb359, 0xb35a, 0xb35b, 0xb35c, 0xb35d, 0xb35e, 0xb35f,
+ 0xb360, 0xb361, 0xb362, 0xb363, 0xb364, 0xb365, 0xb366, 0xb367,
+ 0xb368, 0xb369, 0xb36a, 0xb36b, 0xb36c, 0xb36d, 0xb36e, 0xb36f,
+ 0xb370, 0xb371, 0xb372, 0xb373, 0xb374, 0xb375, 0xb376, 0xb377,
+ 0xb378, 0xb379, 0xb37a, 0xb37b, 0xb37c, 0xb37d, 0xb37e, 0xb37f,
+ 0xb380, 0xb381, 0xb382, 0xb383, 0xb384, 0xb385, 0xb386, 0xb387,
+ 0xb388, 0xb389, 0xb38a, 0xb38b, 0xb38c, 0xb38d, 0xb38e, 0xb38f,
+ 0xb390, 0xb391, 0xb392, 0xb393, 0xb394, 0xb395, 0xb396, 0xb397,
+ 0xb398, 0xb399, 0xb39a, 0xb39b, 0xb39c, 0xb39d, 0xb39e, 0xb39f,
+ 0xb3a0, 0xb3a1, 0xb3a2, 0xb3a3, 0xb3a4, 0xb3a5, 0xb3a6, 0xb3a7,
+ 0xb3a8, 0xb3a9, 0xb3aa, 0xb3ab, 0xb3ac, 0xb3ad, 0xb3ae, 0xb3af,
+ 0xb3b0, 0xb3b1, 0xb3b2, 0xb3b3, 0xb3b4, 0xb3b5, 0xb3b6, 0xb3b7,
+ 0xb3b8, 0xb3b9, 0xb3ba, 0xb3bb, 0xb3bc, 0xb3bd, 0xb3be, 0xb3bf,
+ 0xb3c0, 0xb3c1, 0xb3c2, 0xb3c3, 0xb3c4, 0xb3c5, 0xb3c6, 0xb3c7,
+ 0xb3c8, 0xb3c9, 0xb3ca, 0xb3cb, 0xb3cc, 0xb3cd, 0xb3ce, 0xb3cf,
+ 0xb3d0, 0xb3d1, 0xb3d2, 0xb3d3, 0xb3d4, 0xb3d5, 0xb3d6, 0xb3d7,
+ 0xb3d8, 0xb3d9, 0xb3da, 0xb3db, 0xb3dc, 0xb3dd, 0xb3de, 0xb3df,
+ 0xb3e0, 0xb3e1, 0xb3e2, 0xb3e3, 0xb3e4, 0xb3e5, 0xb3e6, 0xb3e7,
+ 0xb3e8, 0xb3e9, 0xb3ea, 0xb3eb, 0xb3ec, 0xb3ed, 0xb3ee, 0xb3ef,
+ 0xb3f0, 0xb3f1, 0xb3f2, 0xb3f3, 0xb3f4, 0xb3f5, 0xb3f6, 0xb3f7,
+ 0xb3f8, 0xb3f9, 0xb3fa, 0xb3fb, 0xb3fc, 0xb3fd, 0xb3fe, 0xb3ff,
+ 0xb400, 0xb401, 0xb402, 0xb403, 0xb404, 0xb405, 0xb406, 0xb407,
+ 0xb408, 0xb409, 0xb40a, 0xb40b, 0xb40c, 0xb40d, 0xb40e, 0xb40f,
+ 0xb410, 0xb411, 0xb412, 0xb413, 0xb414, 0xb415, 0xb416, 0xb417,
+ 0xb418, 0xb419, 0xb41a, 0xb41b, 0xb41c, 0xb41d, 0xb41e, 0xb41f,
+ 0xb420, 0xb421, 0xb422, 0xb423, 0xb424, 0xb425, 0xb426, 0xb427,
+ 0xb428, 0xb429, 0xb42a, 0xb42b, 0xb42c, 0xb42d, 0xb42e, 0xb42f,
+ 0xb430, 0xb431, 0xb432, 0xb433, 0xb434, 0xb435, 0xb436, 0xb437,
+ 0xb438, 0xb439, 0xb43a, 0xb43b, 0xb43c, 0xb43d, 0xb43e, 0xb43f,
+ 0xb440, 0xb441, 0xb442, 0xb443, 0xb444, 0xb445, 0xb446, 0xb447,
+ 0xb448, 0xb449, 0xb44a, 0xb44b, 0xb44c, 0xb44d, 0xb44e, 0xb44f,
+ 0xb450, 0xb451, 0xb452, 0xb453, 0xb454, 0xb455, 0xb456, 0xb457,
+ 0xb458, 0xb459, 0xb45a, 0xb45b, 0xb45c, 0xb45d, 0xb45e, 0xb45f,
+ 0xb460, 0xb461, 0xb462, 0xb463, 0xb464, 0xb465, 0xb466, 0xb467,
+ 0xb468, 0xb469, 0xb46a, 0xb46b, 0xb46c, 0xb46d, 0xb46e, 0xb46f,
+ 0xb470, 0xb471, 0xb472, 0xb473, 0xb474, 0xb475, 0xb476, 0xb477,
+ 0xb478, 0xb479, 0xb47a, 0xb47b, 0xb47c, 0xb47d, 0xb47e, 0xb47f,
+ 0xb480, 0xb481, 0xb482, 0xb483, 0xb484, 0xb485, 0xb486, 0xb487,
+ 0xb488, 0xb489, 0xb48a, 0xb48b, 0xb48c, 0xb48d, 0xb48e, 0xb48f,
+ 0xb490, 0xb491, 0xb492, 0xb493, 0xb494, 0xb495, 0xb496, 0xb497,
+ 0xb498, 0xb499, 0xb49a, 0xb49b, 0xb49c, 0xb49d, 0xb49e, 0xb49f,
+ 0xb4a0, 0xb4a1, 0xb4a2, 0xb4a3, 0xb4a4, 0xb4a5, 0xb4a6, 0xb4a7,
+ 0xb4a8, 0xb4a9, 0xb4aa, 0xb4ab, 0xb4ac, 0xb4ad, 0xb4ae, 0xb4af,
+ 0xb4b0, 0xb4b1, 0xb4b2, 0xb4b3, 0xb4b4, 0xb4b5, 0xb4b6, 0xb4b7,
+ 0xb4b8, 0xb4b9, 0xb4ba, 0xb4bb, 0xb4bc, 0xb4bd, 0xb4be, 0xb4bf,
+ 0xb4c0, 0xb4c1, 0xb4c2, 0xb4c3, 0xb4c4, 0xb4c5, 0xb4c6, 0xb4c7,
+ 0xb4c8, 0xb4c9, 0xb4ca, 0xb4cb, 0xb4cc, 0xb4cd, 0xb4ce, 0xb4cf,
+ 0xb4d0, 0xb4d1, 0xb4d2, 0xb4d3, 0xb4d4, 0xb4d5, 0xb4d6, 0xb4d7,
+ 0xb4d8, 0xb4d9, 0xb4da, 0xb4db, 0xb4dc, 0xb4dd, 0xb4de, 0xb4df,
+ 0xb4e0, 0xb4e1, 0xb4e2, 0xb4e3, 0xb4e4, 0xb4e5, 0xb4e6, 0xb4e7,
+ 0xb4e8, 0xb4e9, 0xb4ea, 0xb4eb, 0xb4ec, 0xb4ed, 0xb4ee, 0xb4ef,
+ 0xb4f0, 0xb4f1, 0xb4f2, 0xb4f3, 0xb4f4, 0xb4f5, 0xb4f6, 0xb4f7,
+ 0xb4f8, 0xb4f9, 0xb4fa, 0xb4fb, 0xb4fc, 0xb4fd, 0xb4fe, 0xb4ff,
+ 0xb500, 0xb501, 0xb502, 0xb503, 0xb504, 0xb505, 0xb506, 0xb507,
+ 0xb508, 0xb509, 0xb50a, 0xb50b, 0xb50c, 0xb50d, 0xb50e, 0xb50f,
+ 0xb510, 0xb511, 0xb512, 0xb513, 0xb514, 0xb515, 0xb516, 0xb517,
+ 0xb518, 0xb519, 0xb51a, 0xb51b, 0xb51c, 0xb51d, 0xb51e, 0xb51f,
+ 0xb520, 0xb521, 0xb522, 0xb523, 0xb524, 0xb525, 0xb526, 0xb527,
+ 0xb528, 0xb529, 0xb52a, 0xb52b, 0xb52c, 0xb52d, 0xb52e, 0xb52f,
+ 0xb530, 0xb531, 0xb532, 0xb533, 0xb534, 0xb535, 0xb536, 0xb537,
+ 0xb538, 0xb539, 0xb53a, 0xb53b, 0xb53c, 0xb53d, 0xb53e, 0xb53f,
+ 0xb540, 0xb541, 0xb542, 0xb543, 0xb544, 0xb545, 0xb546, 0xb547,
+ 0xb548, 0xb549, 0xb54a, 0xb54b, 0xb54c, 0xb54d, 0xb54e, 0xb54f,
+ 0xb550, 0xb551, 0xb552, 0xb553, 0xb554, 0xb555, 0xb556, 0xb557,
+ 0xb558, 0xb559, 0xb55a, 0xb55b, 0xb55c, 0xb55d, 0xb55e, 0xb55f,
+ 0xb560, 0xb561, 0xb562, 0xb563, 0xb564, 0xb565, 0xb566, 0xb567,
+ 0xb568, 0xb569, 0xb56a, 0xb56b, 0xb56c, 0xb56d, 0xb56e, 0xb56f,
+ 0xb570, 0xb571, 0xb572, 0xb573, 0xb574, 0xb575, 0xb576, 0xb577,
+ 0xb578, 0xb579, 0xb57a, 0xb57b, 0xb57c, 0xb57d, 0xb57e, 0xb57f,
+ 0xb580, 0xb581, 0xb582, 0xb583, 0xb584, 0xb585, 0xb586, 0xb587,
+ 0xb588, 0xb589, 0xb58a, 0xb58b, 0xb58c, 0xb58d, 0xb58e, 0xb58f,
+ 0xb590, 0xb591, 0xb592, 0xb593, 0xb594, 0xb595, 0xb596, 0xb597,
+ 0xb598, 0xb599, 0xb59a, 0xb59b, 0xb59c, 0xb59d, 0xb59e, 0xb59f,
+ 0xb5a0, 0xb5a1, 0xb5a2, 0xb5a3, 0xb5a4, 0xb5a5, 0xb5a6, 0xb5a7,
+ 0xb5a8, 0xb5a9, 0xb5aa, 0xb5ab, 0xb5ac, 0xb5ad, 0xb5ae, 0xb5af,
+ 0xb5b0, 0xb5b1, 0xb5b2, 0xb5b3, 0xb5b4, 0xb5b5, 0xb5b6, 0xb5b7,
+ 0xb5b8, 0xb5b9, 0xb5ba, 0xb5bb, 0xb5bc, 0xb5bd, 0xb5be, 0xb5bf,
+ 0xb5c0, 0xb5c1, 0xb5c2, 0xb5c3, 0xb5c4, 0xb5c5, 0xb5c6, 0xb5c7,
+ 0xb5c8, 0xb5c9, 0xb5ca, 0xb5cb, 0xb5cc, 0xb5cd, 0xb5ce, 0xb5cf,
+ 0xb5d0, 0xb5d1, 0xb5d2, 0xb5d3, 0xb5d4, 0xb5d5, 0xb5d6, 0xb5d7,
+ 0xb5d8, 0xb5d9, 0xb5da, 0xb5db, 0xb5dc, 0xb5dd, 0xb5de, 0xb5df,
+ 0xb5e0, 0xb5e1, 0xb5e2, 0xb5e3, 0xb5e4, 0xb5e5, 0xb5e6, 0xb5e7,
+ 0xb5e8, 0xb5e9, 0xb5ea, 0xb5eb, 0xb5ec, 0xb5ed, 0xb5ee, 0xb5ef,
+ 0xb5f0, 0xb5f1, 0xb5f2, 0xb5f3, 0xb5f4, 0xb5f5, 0xb5f6, 0xb5f7,
+ 0xb5f8, 0xb5f9, 0xb5fa, 0xb5fb, 0xb5fc, 0xb5fd, 0xb5fe, 0xb5ff,
+ 0xb600, 0xb601, 0xb602, 0xb603, 0xb604, 0xb605, 0xb606, 0xb607,
+ 0xb608, 0xb609, 0xb60a, 0xb60b, 0xb60c, 0xb60d, 0xb60e, 0xb60f,
+ 0xb610, 0xb611, 0xb612, 0xb613, 0xb614, 0xb615, 0xb616, 0xb617,
+ 0xb618, 0xb619, 0xb61a, 0xb61b, 0xb61c, 0xb61d, 0xb61e, 0xb61f,
+ 0xb620, 0xb621, 0xb622, 0xb623, 0xb624, 0xb625, 0xb626, 0xb627,
+ 0xb628, 0xb629, 0xb62a, 0xb62b, 0xb62c, 0xb62d, 0xb62e, 0xb62f,
+ 0xb630, 0xb631, 0xb632, 0xb633, 0xb634, 0xb635, 0xb636, 0xb637,
+ 0xb638, 0xb639, 0xb63a, 0xb63b, 0xb63c, 0xb63d, 0xb63e, 0xb63f,
+ 0xb640, 0xb641, 0xb642, 0xb643, 0xb644, 0xb645, 0xb646, 0xb647,
+ 0xb648, 0xb649, 0xb64a, 0xb64b, 0xb64c, 0xb64d, 0xb64e, 0xb64f,
+ 0xb650, 0xb651, 0xb652, 0xb653, 0xb654, 0xb655, 0xb656, 0xb657,
+ 0xb658, 0xb659, 0xb65a, 0xb65b, 0xb65c, 0xb65d, 0xb65e, 0xb65f,
+ 0xb660, 0xb661, 0xb662, 0xb663, 0xb664, 0xb665, 0xb666, 0xb667,
+ 0xb668, 0xb669, 0xb66a, 0xb66b, 0xb66c, 0xb66d, 0xb66e, 0xb66f,
+ 0xb670, 0xb671, 0xb672, 0xb673, 0xb674, 0xb675, 0xb676, 0xb677,
+ 0xb678, 0xb679, 0xb67a, 0xb67b, 0xb67c, 0xb67d, 0xb67e, 0xb67f,
+ 0xb680, 0xb681, 0xb682, 0xb683, 0xb684, 0xb685, 0xb686, 0xb687,
+ 0xb688, 0xb689, 0xb68a, 0xb68b, 0xb68c, 0xb68d, 0xb68e, 0xb68f,
+ 0xb690, 0xb691, 0xb692, 0xb693, 0xb694, 0xb695, 0xb696, 0xb697,
+ 0xb698, 0xb699, 0xb69a, 0xb69b, 0xb69c, 0xb69d, 0xb69e, 0xb69f,
+ 0xb6a0, 0xb6a1, 0xb6a2, 0xb6a3, 0xb6a4, 0xb6a5, 0xb6a6, 0xb6a7,
+ 0xb6a8, 0xb6a9, 0xb6aa, 0xb6ab, 0xb6ac, 0xb6ad, 0xb6ae, 0xb6af,
+ 0xb6b0, 0xb6b1, 0xb6b2, 0xb6b3, 0xb6b4, 0xb6b5, 0xb6b6, 0xb6b7,
+ 0xb6b8, 0xb6b9, 0xb6ba, 0xb6bb, 0xb6bc, 0xb6bd, 0xb6be, 0xb6bf,
+ 0xb6c0, 0xb6c1, 0xb6c2, 0xb6c3, 0xb6c4, 0xb6c5, 0xb6c6, 0xb6c7,
+ 0xb6c8, 0xb6c9, 0xb6ca, 0xb6cb, 0xb6cc, 0xb6cd, 0xb6ce, 0xb6cf,
+ 0xb6d0, 0xb6d1, 0xb6d2, 0xb6d3, 0xb6d4, 0xb6d5, 0xb6d6, 0xb6d7,
+ 0xb6d8, 0xb6d9, 0xb6da, 0xb6db, 0xb6dc, 0xb6dd, 0xb6de, 0xb6df,
+ 0xb6e0, 0xb6e1, 0xb6e2, 0xb6e3, 0xb6e4, 0xb6e5, 0xb6e6, 0xb6e7,
+ 0xb6e8, 0xb6e9, 0xb6ea, 0xb6eb, 0xb6ec, 0xb6ed, 0xb6ee, 0xb6ef,
+ 0xb6f0, 0xb6f1, 0xb6f2, 0xb6f3, 0xb6f4, 0xb6f5, 0xb6f6, 0xb6f7,
+ 0xb6f8, 0xb6f9, 0xb6fa, 0xb6fb, 0xb6fc, 0xb6fd, 0xb6fe, 0xb6ff,
+ 0xb700, 0xb701, 0xb702, 0xb703, 0xb704, 0xb705, 0xb706, 0xb707,
+ 0xb708, 0xb709, 0xb70a, 0xb70b, 0xb70c, 0xb70d, 0xb70e, 0xb70f,
+ 0xb710, 0xb711, 0xb712, 0xb713, 0xb714, 0xb715, 0xb716, 0xb717,
+ 0xb718, 0xb719, 0xb71a, 0xb71b, 0xb71c, 0xb71d, 0xb71e, 0xb71f,
+ 0xb720, 0xb721, 0xb722, 0xb723, 0xb724, 0xb725, 0xb726, 0xb727,
+ 0xb728, 0xb729, 0xb72a, 0xb72b, 0xb72c, 0xb72d, 0xb72e, 0xb72f,
+ 0xb730, 0xb731, 0xb732, 0xb733, 0xb734, 0xb735, 0xb736, 0xb737,
+ 0xb738, 0xb739, 0xb73a, 0xb73b, 0xb73c, 0xb73d, 0xb73e, 0xb73f,
+ 0xb740, 0xb741, 0xb742, 0xb743, 0xb744, 0xb745, 0xb746, 0xb747,
+ 0xb748, 0xb749, 0xb74a, 0xb74b, 0xb74c, 0xb74d, 0xb74e, 0xb74f,
+ 0xb750, 0xb751, 0xb752, 0xb753, 0xb754, 0xb755, 0xb756, 0xb757,
+ 0xb758, 0xb759, 0xb75a, 0xb75b, 0xb75c, 0xb75d, 0xb75e, 0xb75f,
+ 0xb760, 0xb761, 0xb762, 0xb763, 0xb764, 0xb765, 0xb766, 0xb767,
+ 0xb768, 0xb769, 0xb76a, 0xb76b, 0xb76c, 0xb76d, 0xb76e, 0xb76f,
+ 0xb770, 0xb771, 0xb772, 0xb773, 0xb774, 0xb775, 0xb776, 0xb777,
+ 0xb778, 0xb779, 0xb77a, 0xb77b, 0xb77c, 0xb77d, 0xb77e, 0xb77f,
+ 0xb780, 0xb781, 0xb782, 0xb783, 0xb784, 0xb785, 0xb786, 0xb787,
+ 0xb788, 0xb789, 0xb78a, 0xb78b, 0xb78c, 0xb78d, 0xb78e, 0xb78f,
+ 0xb790, 0xb791, 0xb792, 0xb793, 0xb794, 0xb795, 0xb796, 0xb797,
+ 0xb798, 0xb799, 0xb79a, 0xb79b, 0xb79c, 0xb79d, 0xb79e, 0xb79f,
+ 0xb7a0, 0xb7a1, 0xb7a2, 0xb7a3, 0xb7a4, 0xb7a5, 0xb7a6, 0xb7a7,
+ 0xb7a8, 0xb7a9, 0xb7aa, 0xb7ab, 0xb7ac, 0xb7ad, 0xb7ae, 0xb7af,
+ 0xb7b0, 0xb7b1, 0xb7b2, 0xb7b3, 0xb7b4, 0xb7b5, 0xb7b6, 0xb7b7,
+ 0xb7b8, 0xb7b9, 0xb7ba, 0xb7bb, 0xb7bc, 0xb7bd, 0xb7be, 0xb7bf,
+ 0xb7c0, 0xb7c1, 0xb7c2, 0xb7c3, 0xb7c4, 0xb7c5, 0xb7c6, 0xb7c7,
+ 0xb7c8, 0xb7c9, 0xb7ca, 0xb7cb, 0xb7cc, 0xb7cd, 0xb7ce, 0xb7cf,
+ 0xb7d0, 0xb7d1, 0xb7d2, 0xb7d3, 0xb7d4, 0xb7d5, 0xb7d6, 0xb7d7,
+ 0xb7d8, 0xb7d9, 0xb7da, 0xb7db, 0xb7dc, 0xb7dd, 0xb7de, 0xb7df,
+ 0xb7e0, 0xb7e1, 0xb7e2, 0xb7e3, 0xb7e4, 0xb7e5, 0xb7e6, 0xb7e7,
+ 0xb7e8, 0xb7e9, 0xb7ea, 0xb7eb, 0xb7ec, 0xb7ed, 0xb7ee, 0xb7ef,
+ 0xb7f0, 0xb7f1, 0xb7f2, 0xb7f3, 0xb7f4, 0xb7f5, 0xb7f6, 0xb7f7,
+ 0xb7f8, 0xb7f9, 0xb7fa, 0xb7fb, 0xb7fc, 0xb7fd, 0xb7fe, 0xb7ff,
+ 0xb800, 0xb801, 0xb802, 0xb803, 0xb804, 0xb805, 0xb806, 0xb807,
+ 0xb808, 0xb809, 0xb80a, 0xb80b, 0xb80c, 0xb80d, 0xb80e, 0xb80f,
+ 0xb810, 0xb811, 0xb812, 0xb813, 0xb814, 0xb815, 0xb816, 0xb817,
+ 0xb818, 0xb819, 0xb81a, 0xb81b, 0xb81c, 0xb81d, 0xb81e, 0xb81f,
+ 0xb820, 0xb821, 0xb822, 0xb823, 0xb824, 0xb825, 0xb826, 0xb827,
+ 0xb828, 0xb829, 0xb82a, 0xb82b, 0xb82c, 0xb82d, 0xb82e, 0xb82f,
+ 0xb830, 0xb831, 0xb832, 0xb833, 0xb834, 0xb835, 0xb836, 0xb837,
+ 0xb838, 0xb839, 0xb83a, 0xb83b, 0xb83c, 0xb83d, 0xb83e, 0xb83f,
+ 0xb840, 0xb841, 0xb842, 0xb843, 0xb844, 0xb845, 0xb846, 0xb847,
+ 0xb848, 0xb849, 0xb84a, 0xb84b, 0xb84c, 0xb84d, 0xb84e, 0xb84f,
+ 0xb850, 0xb851, 0xb852, 0xb853, 0xb854, 0xb855, 0xb856, 0xb857,
+ 0xb858, 0xb859, 0xb85a, 0xb85b, 0xb85c, 0xb85d, 0xb85e, 0xb85f,
+ 0xb860, 0xb861, 0xb862, 0xb863, 0xb864, 0xb865, 0xb866, 0xb867,
+ 0xb868, 0xb869, 0xb86a, 0xb86b, 0xb86c, 0xb86d, 0xb86e, 0xb86f,
+ 0xb870, 0xb871, 0xb872, 0xb873, 0xb874, 0xb875, 0xb876, 0xb877,
+ 0xb878, 0xb879, 0xb87a, 0xb87b, 0xb87c, 0xb87d, 0xb87e, 0xb87f,
+ 0xb880, 0xb881, 0xb882, 0xb883, 0xb884, 0xb885, 0xb886, 0xb887,
+ 0xb888, 0xb889, 0xb88a, 0xb88b, 0xb88c, 0xb88d, 0xb88e, 0xb88f,
+ 0xb890, 0xb891, 0xb892, 0xb893, 0xb894, 0xb895, 0xb896, 0xb897,
+ 0xb898, 0xb899, 0xb89a, 0xb89b, 0xb89c, 0xb89d, 0xb89e, 0xb89f,
+ 0xb8a0, 0xb8a1, 0xb8a2, 0xb8a3, 0xb8a4, 0xb8a5, 0xb8a6, 0xb8a7,
+ 0xb8a8, 0xb8a9, 0xb8aa, 0xb8ab, 0xb8ac, 0xb8ad, 0xb8ae, 0xb8af,
+ 0xb8b0, 0xb8b1, 0xb8b2, 0xb8b3, 0xb8b4, 0xb8b5, 0xb8b6, 0xb8b7,
+ 0xb8b8, 0xb8b9, 0xb8ba, 0xb8bb, 0xb8bc, 0xb8bd, 0xb8be, 0xb8bf,
+ 0xb8c0, 0xb8c1, 0xb8c2, 0xb8c3, 0xb8c4, 0xb8c5, 0xb8c6, 0xb8c7,
+ 0xb8c8, 0xb8c9, 0xb8ca, 0xb8cb, 0xb8cc, 0xb8cd, 0xb8ce, 0xb8cf,
+ 0xb8d0, 0xb8d1, 0xb8d2, 0xb8d3, 0xb8d4, 0xb8d5, 0xb8d6, 0xb8d7,
+ 0xb8d8, 0xb8d9, 0xb8da, 0xb8db, 0xb8dc, 0xb8dd, 0xb8de, 0xb8df,
+ 0xb8e0, 0xb8e1, 0xb8e2, 0xb8e3, 0xb8e4, 0xb8e5, 0xb8e6, 0xb8e7,
+ 0xb8e8, 0xb8e9, 0xb8ea, 0xb8eb, 0xb8ec, 0xb8ed, 0xb8ee, 0xb8ef,
+ 0xb8f0, 0xb8f1, 0xb8f2, 0xb8f3, 0xb8f4, 0xb8f5, 0xb8f6, 0xb8f7,
+ 0xb8f8, 0xb8f9, 0xb8fa, 0xb8fb, 0xb8fc, 0xb8fd, 0xb8fe, 0xb8ff,
+ 0xb900, 0xb901, 0xb902, 0xb903, 0xb904, 0xb905, 0xb906, 0xb907,
+ 0xb908, 0xb909, 0xb90a, 0xb90b, 0xb90c, 0xb90d, 0xb90e, 0xb90f,
+ 0xb910, 0xb911, 0xb912, 0xb913, 0xb914, 0xb915, 0xb916, 0xb917,
+ 0xb918, 0xb919, 0xb91a, 0xb91b, 0xb91c, 0xb91d, 0xb91e, 0xb91f,
+ 0xb920, 0xb921, 0xb922, 0xb923, 0xb924, 0xb925, 0xb926, 0xb927,
+ 0xb928, 0xb929, 0xb92a, 0xb92b, 0xb92c, 0xb92d, 0xb92e, 0xb92f,
+ 0xb930, 0xb931, 0xb932, 0xb933, 0xb934, 0xb935, 0xb936, 0xb937,
+ 0xb938, 0xb939, 0xb93a, 0xb93b, 0xb93c, 0xb93d, 0xb93e, 0xb93f,
+ 0xb940, 0xb941, 0xb942, 0xb943, 0xb944, 0xb945, 0xb946, 0xb947,
+ 0xb948, 0xb949, 0xb94a, 0xb94b, 0xb94c, 0xb94d, 0xb94e, 0xb94f,
+ 0xb950, 0xb951, 0xb952, 0xb953, 0xb954, 0xb955, 0xb956, 0xb957,
+ 0xb958, 0xb959, 0xb95a, 0xb95b, 0xb95c, 0xb95d, 0xb95e, 0xb95f,
+ 0xb960, 0xb961, 0xb962, 0xb963, 0xb964, 0xb965, 0xb966, 0xb967,
+ 0xb968, 0xb969, 0xb96a, 0xb96b, 0xb96c, 0xb96d, 0xb96e, 0xb96f,
+ 0xb970, 0xb971, 0xb972, 0xb973, 0xb974, 0xb975, 0xb976, 0xb977,
+ 0xb978, 0xb979, 0xb97a, 0xb97b, 0xb97c, 0xb97d, 0xb97e, 0xb97f,
+ 0xb980, 0xb981, 0xb982, 0xb983, 0xb984, 0xb985, 0xb986, 0xb987,
+ 0xb988, 0xb989, 0xb98a, 0xb98b, 0xb98c, 0xb98d, 0xb98e, 0xb98f,
+ 0xb990, 0xb991, 0xb992, 0xb993, 0xb994, 0xb995, 0xb996, 0xb997,
+ 0xb998, 0xb999, 0xb99a, 0xb99b, 0xb99c, 0xb99d, 0xb99e, 0xb99f,
+ 0xb9a0, 0xb9a1, 0xb9a2, 0xb9a3, 0xb9a4, 0xb9a5, 0xb9a6, 0xb9a7,
+ 0xb9a8, 0xb9a9, 0xb9aa, 0xb9ab, 0xb9ac, 0xb9ad, 0xb9ae, 0xb9af,
+ 0xb9b0, 0xb9b1, 0xb9b2, 0xb9b3, 0xb9b4, 0xb9b5, 0xb9b6, 0xb9b7,
+ 0xb9b8, 0xb9b9, 0xb9ba, 0xb9bb, 0xb9bc, 0xb9bd, 0xb9be, 0xb9bf,
+ 0xb9c0, 0xb9c1, 0xb9c2, 0xb9c3, 0xb9c4, 0xb9c5, 0xb9c6, 0xb9c7,
+ 0xb9c8, 0xb9c9, 0xb9ca, 0xb9cb, 0xb9cc, 0xb9cd, 0xb9ce, 0xb9cf,
+ 0xb9d0, 0xb9d1, 0xb9d2, 0xb9d3, 0xb9d4, 0xb9d5, 0xb9d6, 0xb9d7,
+ 0xb9d8, 0xb9d9, 0xb9da, 0xb9db, 0xb9dc, 0xb9dd, 0xb9de, 0xb9df,
+ 0xb9e0, 0xb9e1, 0xb9e2, 0xb9e3, 0xb9e4, 0xb9e5, 0xb9e6, 0xb9e7,
+ 0xb9e8, 0xb9e9, 0xb9ea, 0xb9eb, 0xb9ec, 0xb9ed, 0xb9ee, 0xb9ef,
+ 0xb9f0, 0xb9f1, 0xb9f2, 0xb9f3, 0xb9f4, 0xb9f5, 0xb9f6, 0xb9f7,
+ 0xb9f8, 0xb9f9, 0xb9fa, 0xb9fb, 0xb9fc, 0xb9fd, 0xb9fe, 0xb9ff,
+ 0xba00, 0xba01, 0xba02, 0xba03, 0xba04, 0xba05, 0xba06, 0xba07,
+ 0xba08, 0xba09, 0xba0a, 0xba0b, 0xba0c, 0xba0d, 0xba0e, 0xba0f,
+ 0xba10, 0xba11, 0xba12, 0xba13, 0xba14, 0xba15, 0xba16, 0xba17,
+ 0xba18, 0xba19, 0xba1a, 0xba1b, 0xba1c, 0xba1d, 0xba1e, 0xba1f,
+ 0xba20, 0xba21, 0xba22, 0xba23, 0xba24, 0xba25, 0xba26, 0xba27,
+ 0xba28, 0xba29, 0xba2a, 0xba2b, 0xba2c, 0xba2d, 0xba2e, 0xba2f,
+ 0xba30, 0xba31, 0xba32, 0xba33, 0xba34, 0xba35, 0xba36, 0xba37,
+ 0xba38, 0xba39, 0xba3a, 0xba3b, 0xba3c, 0xba3d, 0xba3e, 0xba3f,
+ 0xba40, 0xba41, 0xba42, 0xba43, 0xba44, 0xba45, 0xba46, 0xba47,
+ 0xba48, 0xba49, 0xba4a, 0xba4b, 0xba4c, 0xba4d, 0xba4e, 0xba4f,
+ 0xba50, 0xba51, 0xba52, 0xba53, 0xba54, 0xba55, 0xba56, 0xba57,
+ 0xba58, 0xba59, 0xba5a, 0xba5b, 0xba5c, 0xba5d, 0xba5e, 0xba5f,
+ 0xba60, 0xba61, 0xba62, 0xba63, 0xba64, 0xba65, 0xba66, 0xba67,
+ 0xba68, 0xba69, 0xba6a, 0xba6b, 0xba6c, 0xba6d, 0xba6e, 0xba6f,
+ 0xba70, 0xba71, 0xba72, 0xba73, 0xba74, 0xba75, 0xba76, 0xba77,
+ 0xba78, 0xba79, 0xba7a, 0xba7b, 0xba7c, 0xba7d, 0xba7e, 0xba7f,
+ 0xba80, 0xba81, 0xba82, 0xba83, 0xba84, 0xba85, 0xba86, 0xba87,
+ 0xba88, 0xba89, 0xba8a, 0xba8b, 0xba8c, 0xba8d, 0xba8e, 0xba8f,
+ 0xba90, 0xba91, 0xba92, 0xba93, 0xba94, 0xba95, 0xba96, 0xba97,
+ 0xba98, 0xba99, 0xba9a, 0xba9b, 0xba9c, 0xba9d, 0xba9e, 0xba9f,
+ 0xbaa0, 0xbaa1, 0xbaa2, 0xbaa3, 0xbaa4, 0xbaa5, 0xbaa6, 0xbaa7,
+ 0xbaa8, 0xbaa9, 0xbaaa, 0xbaab, 0xbaac, 0xbaad, 0xbaae, 0xbaaf,
+ 0xbab0, 0xbab1, 0xbab2, 0xbab3, 0xbab4, 0xbab5, 0xbab6, 0xbab7,
+ 0xbab8, 0xbab9, 0xbaba, 0xbabb, 0xbabc, 0xbabd, 0xbabe, 0xbabf,
+ 0xbac0, 0xbac1, 0xbac2, 0xbac3, 0xbac4, 0xbac5, 0xbac6, 0xbac7,
+ 0xbac8, 0xbac9, 0xbaca, 0xbacb, 0xbacc, 0xbacd, 0xbace, 0xbacf,
+ 0xbad0, 0xbad1, 0xbad2, 0xbad3, 0xbad4, 0xbad5, 0xbad6, 0xbad7,
+ 0xbad8, 0xbad9, 0xbada, 0xbadb, 0xbadc, 0xbadd, 0xbade, 0xbadf,
+ 0xbae0, 0xbae1, 0xbae2, 0xbae3, 0xbae4, 0xbae5, 0xbae6, 0xbae7,
+ 0xbae8, 0xbae9, 0xbaea, 0xbaeb, 0xbaec, 0xbaed, 0xbaee, 0xbaef,
+ 0xbaf0, 0xbaf1, 0xbaf2, 0xbaf3, 0xbaf4, 0xbaf5, 0xbaf6, 0xbaf7,
+ 0xbaf8, 0xbaf9, 0xbafa, 0xbafb, 0xbafc, 0xbafd, 0xbafe, 0xbaff,
+ 0xbb00, 0xbb01, 0xbb02, 0xbb03, 0xbb04, 0xbb05, 0xbb06, 0xbb07,
+ 0xbb08, 0xbb09, 0xbb0a, 0xbb0b, 0xbb0c, 0xbb0d, 0xbb0e, 0xbb0f,
+ 0xbb10, 0xbb11, 0xbb12, 0xbb13, 0xbb14, 0xbb15, 0xbb16, 0xbb17,
+ 0xbb18, 0xbb19, 0xbb1a, 0xbb1b, 0xbb1c, 0xbb1d, 0xbb1e, 0xbb1f,
+ 0xbb20, 0xbb21, 0xbb22, 0xbb23, 0xbb24, 0xbb25, 0xbb26, 0xbb27,
+ 0xbb28, 0xbb29, 0xbb2a, 0xbb2b, 0xbb2c, 0xbb2d, 0xbb2e, 0xbb2f,
+ 0xbb30, 0xbb31, 0xbb32, 0xbb33, 0xbb34, 0xbb35, 0xbb36, 0xbb37,
+ 0xbb38, 0xbb39, 0xbb3a, 0xbb3b, 0xbb3c, 0xbb3d, 0xbb3e, 0xbb3f,
+ 0xbb40, 0xbb41, 0xbb42, 0xbb43, 0xbb44, 0xbb45, 0xbb46, 0xbb47,
+ 0xbb48, 0xbb49, 0xbb4a, 0xbb4b, 0xbb4c, 0xbb4d, 0xbb4e, 0xbb4f,
+ 0xbb50, 0xbb51, 0xbb52, 0xbb53, 0xbb54, 0xbb55, 0xbb56, 0xbb57,
+ 0xbb58, 0xbb59, 0xbb5a, 0xbb5b, 0xbb5c, 0xbb5d, 0xbb5e, 0xbb5f,
+ 0xbb60, 0xbb61, 0xbb62, 0xbb63, 0xbb64, 0xbb65, 0xbb66, 0xbb67,
+ 0xbb68, 0xbb69, 0xbb6a, 0xbb6b, 0xbb6c, 0xbb6d, 0xbb6e, 0xbb6f,
+ 0xbb70, 0xbb71, 0xbb72, 0xbb73, 0xbb74, 0xbb75, 0xbb76, 0xbb77,
+ 0xbb78, 0xbb79, 0xbb7a, 0xbb7b, 0xbb7c, 0xbb7d, 0xbb7e, 0xbb7f,
+ 0xbb80, 0xbb81, 0xbb82, 0xbb83, 0xbb84, 0xbb85, 0xbb86, 0xbb87,
+ 0xbb88, 0xbb89, 0xbb8a, 0xbb8b, 0xbb8c, 0xbb8d, 0xbb8e, 0xbb8f,
+ 0xbb90, 0xbb91, 0xbb92, 0xbb93, 0xbb94, 0xbb95, 0xbb96, 0xbb97,
+ 0xbb98, 0xbb99, 0xbb9a, 0xbb9b, 0xbb9c, 0xbb9d, 0xbb9e, 0xbb9f,
+ 0xbba0, 0xbba1, 0xbba2, 0xbba3, 0xbba4, 0xbba5, 0xbba6, 0xbba7,
+ 0xbba8, 0xbba9, 0xbbaa, 0xbbab, 0xbbac, 0xbbad, 0xbbae, 0xbbaf,
+ 0xbbb0, 0xbbb1, 0xbbb2, 0xbbb3, 0xbbb4, 0xbbb5, 0xbbb6, 0xbbb7,
+ 0xbbb8, 0xbbb9, 0xbbba, 0xbbbb, 0xbbbc, 0xbbbd, 0xbbbe, 0xbbbf,
+ 0xbbc0, 0xbbc1, 0xbbc2, 0xbbc3, 0xbbc4, 0xbbc5, 0xbbc6, 0xbbc7,
+ 0xbbc8, 0xbbc9, 0xbbca, 0xbbcb, 0xbbcc, 0xbbcd, 0xbbce, 0xbbcf,
+ 0xbbd0, 0xbbd1, 0xbbd2, 0xbbd3, 0xbbd4, 0xbbd5, 0xbbd6, 0xbbd7,
+ 0xbbd8, 0xbbd9, 0xbbda, 0xbbdb, 0xbbdc, 0xbbdd, 0xbbde, 0xbbdf,
+ 0xbbe0, 0xbbe1, 0xbbe2, 0xbbe3, 0xbbe4, 0xbbe5, 0xbbe6, 0xbbe7,
+ 0xbbe8, 0xbbe9, 0xbbea, 0xbbeb, 0xbbec, 0xbbed, 0xbbee, 0xbbef,
+ 0xbbf0, 0xbbf1, 0xbbf2, 0xbbf3, 0xbbf4, 0xbbf5, 0xbbf6, 0xbbf7,
+ 0xbbf8, 0xbbf9, 0xbbfa, 0xbbfb, 0xbbfc, 0xbbfd, 0xbbfe, 0xbbff,
+ 0xbc00, 0xbc01, 0xbc02, 0xbc03, 0xbc04, 0xbc05, 0xbc06, 0xbc07,
+ 0xbc08, 0xbc09, 0xbc0a, 0xbc0b, 0xbc0c, 0xbc0d, 0xbc0e, 0xbc0f,
+ 0xbc10, 0xbc11, 0xbc12, 0xbc13, 0xbc14, 0xbc15, 0xbc16, 0xbc17,
+ 0xbc18, 0xbc19, 0xbc1a, 0xbc1b, 0xbc1c, 0xbc1d, 0xbc1e, 0xbc1f,
+ 0xbc20, 0xbc21, 0xbc22, 0xbc23, 0xbc24, 0xbc25, 0xbc26, 0xbc27,
+ 0xbc28, 0xbc29, 0xbc2a, 0xbc2b, 0xbc2c, 0xbc2d, 0xbc2e, 0xbc2f,
+ 0xbc30, 0xbc31, 0xbc32, 0xbc33, 0xbc34, 0xbc35, 0xbc36, 0xbc37,
+ 0xbc38, 0xbc39, 0xbc3a, 0xbc3b, 0xbc3c, 0xbc3d, 0xbc3e, 0xbc3f,
+ 0xbc40, 0xbc41, 0xbc42, 0xbc43, 0xbc44, 0xbc45, 0xbc46, 0xbc47,
+ 0xbc48, 0xbc49, 0xbc4a, 0xbc4b, 0xbc4c, 0xbc4d, 0xbc4e, 0xbc4f,
+ 0xbc50, 0xbc51, 0xbc52, 0xbc53, 0xbc54, 0xbc55, 0xbc56, 0xbc57,
+ 0xbc58, 0xbc59, 0xbc5a, 0xbc5b, 0xbc5c, 0xbc5d, 0xbc5e, 0xbc5f,
+ 0xbc60, 0xbc61, 0xbc62, 0xbc63, 0xbc64, 0xbc65, 0xbc66, 0xbc67,
+ 0xbc68, 0xbc69, 0xbc6a, 0xbc6b, 0xbc6c, 0xbc6d, 0xbc6e, 0xbc6f,
+ 0xbc70, 0xbc71, 0xbc72, 0xbc73, 0xbc74, 0xbc75, 0xbc76, 0xbc77,
+ 0xbc78, 0xbc79, 0xbc7a, 0xbc7b, 0xbc7c, 0xbc7d, 0xbc7e, 0xbc7f,
+ 0xbc80, 0xbc81, 0xbc82, 0xbc83, 0xbc84, 0xbc85, 0xbc86, 0xbc87,
+ 0xbc88, 0xbc89, 0xbc8a, 0xbc8b, 0xbc8c, 0xbc8d, 0xbc8e, 0xbc8f,
+ 0xbc90, 0xbc91, 0xbc92, 0xbc93, 0xbc94, 0xbc95, 0xbc96, 0xbc97,
+ 0xbc98, 0xbc99, 0xbc9a, 0xbc9b, 0xbc9c, 0xbc9d, 0xbc9e, 0xbc9f,
+ 0xbca0, 0xbca1, 0xbca2, 0xbca3, 0xbca4, 0xbca5, 0xbca6, 0xbca7,
+ 0xbca8, 0xbca9, 0xbcaa, 0xbcab, 0xbcac, 0xbcad, 0xbcae, 0xbcaf,
+ 0xbcb0, 0xbcb1, 0xbcb2, 0xbcb3, 0xbcb4, 0xbcb5, 0xbcb6, 0xbcb7,
+ 0xbcb8, 0xbcb9, 0xbcba, 0xbcbb, 0xbcbc, 0xbcbd, 0xbcbe, 0xbcbf,
+ 0xbcc0, 0xbcc1, 0xbcc2, 0xbcc3, 0xbcc4, 0xbcc5, 0xbcc6, 0xbcc7,
+ 0xbcc8, 0xbcc9, 0xbcca, 0xbccb, 0xbccc, 0xbccd, 0xbcce, 0xbccf,
+ 0xbcd0, 0xbcd1, 0xbcd2, 0xbcd3, 0xbcd4, 0xbcd5, 0xbcd6, 0xbcd7,
+ 0xbcd8, 0xbcd9, 0xbcda, 0xbcdb, 0xbcdc, 0xbcdd, 0xbcde, 0xbcdf,
+ 0xbce0, 0xbce1, 0xbce2, 0xbce3, 0xbce4, 0xbce5, 0xbce6, 0xbce7,
+ 0xbce8, 0xbce9, 0xbcea, 0xbceb, 0xbcec, 0xbced, 0xbcee, 0xbcef,
+ 0xbcf0, 0xbcf1, 0xbcf2, 0xbcf3, 0xbcf4, 0xbcf5, 0xbcf6, 0xbcf7,
+ 0xbcf8, 0xbcf9, 0xbcfa, 0xbcfb, 0xbcfc, 0xbcfd, 0xbcfe, 0xbcff,
+ 0xbd00, 0xbd01, 0xbd02, 0xbd03, 0xbd04, 0xbd05, 0xbd06, 0xbd07,
+ 0xbd08, 0xbd09, 0xbd0a, 0xbd0b, 0xbd0c, 0xbd0d, 0xbd0e, 0xbd0f,
+ 0xbd10, 0xbd11, 0xbd12, 0xbd13, 0xbd14, 0xbd15, 0xbd16, 0xbd17,
+ 0xbd18, 0xbd19, 0xbd1a, 0xbd1b, 0xbd1c, 0xbd1d, 0xbd1e, 0xbd1f,
+ 0xbd20, 0xbd21, 0xbd22, 0xbd23, 0xbd24, 0xbd25, 0xbd26, 0xbd27,
+ 0xbd28, 0xbd29, 0xbd2a, 0xbd2b, 0xbd2c, 0xbd2d, 0xbd2e, 0xbd2f,
+ 0xbd30, 0xbd31, 0xbd32, 0xbd33, 0xbd34, 0xbd35, 0xbd36, 0xbd37,
+ 0xbd38, 0xbd39, 0xbd3a, 0xbd3b, 0xbd3c, 0xbd3d, 0xbd3e, 0xbd3f,
+ 0xbd40, 0xbd41, 0xbd42, 0xbd43, 0xbd44, 0xbd45, 0xbd46, 0xbd47,
+ 0xbd48, 0xbd49, 0xbd4a, 0xbd4b, 0xbd4c, 0xbd4d, 0xbd4e, 0xbd4f,
+ 0xbd50, 0xbd51, 0xbd52, 0xbd53, 0xbd54, 0xbd55, 0xbd56, 0xbd57,
+ 0xbd58, 0xbd59, 0xbd5a, 0xbd5b, 0xbd5c, 0xbd5d, 0xbd5e, 0xbd5f,
+ 0xbd60, 0xbd61, 0xbd62, 0xbd63, 0xbd64, 0xbd65, 0xbd66, 0xbd67,
+ 0xbd68, 0xbd69, 0xbd6a, 0xbd6b, 0xbd6c, 0xbd6d, 0xbd6e, 0xbd6f,
+ 0xbd70, 0xbd71, 0xbd72, 0xbd73, 0xbd74, 0xbd75, 0xbd76, 0xbd77,
+ 0xbd78, 0xbd79, 0xbd7a, 0xbd7b, 0xbd7c, 0xbd7d, 0xbd7e, 0xbd7f,
+ 0xbd80, 0xbd81, 0xbd82, 0xbd83, 0xbd84, 0xbd85, 0xbd86, 0xbd87,
+ 0xbd88, 0xbd89, 0xbd8a, 0xbd8b, 0xbd8c, 0xbd8d, 0xbd8e, 0xbd8f,
+ 0xbd90, 0xbd91, 0xbd92, 0xbd93, 0xbd94, 0xbd95, 0xbd96, 0xbd97,
+ 0xbd98, 0xbd99, 0xbd9a, 0xbd9b, 0xbd9c, 0xbd9d, 0xbd9e, 0xbd9f,
+ 0xbda0, 0xbda1, 0xbda2, 0xbda3, 0xbda4, 0xbda5, 0xbda6, 0xbda7,
+ 0xbda8, 0xbda9, 0xbdaa, 0xbdab, 0xbdac, 0xbdad, 0xbdae, 0xbdaf,
+ 0xbdb0, 0xbdb1, 0xbdb2, 0xbdb3, 0xbdb4, 0xbdb5, 0xbdb6, 0xbdb7,
+ 0xbdb8, 0xbdb9, 0xbdba, 0xbdbb, 0xbdbc, 0xbdbd, 0xbdbe, 0xbdbf,
+ 0xbdc0, 0xbdc1, 0xbdc2, 0xbdc3, 0xbdc4, 0xbdc5, 0xbdc6, 0xbdc7,
+ 0xbdc8, 0xbdc9, 0xbdca, 0xbdcb, 0xbdcc, 0xbdcd, 0xbdce, 0xbdcf,
+ 0xbdd0, 0xbdd1, 0xbdd2, 0xbdd3, 0xbdd4, 0xbdd5, 0xbdd6, 0xbdd7,
+ 0xbdd8, 0xbdd9, 0xbdda, 0xbddb, 0xbddc, 0xbddd, 0xbdde, 0xbddf,
+ 0xbde0, 0xbde1, 0xbde2, 0xbde3, 0xbde4, 0xbde5, 0xbde6, 0xbde7,
+ 0xbde8, 0xbde9, 0xbdea, 0xbdeb, 0xbdec, 0xbded, 0xbdee, 0xbdef,
+ 0xbdf0, 0xbdf1, 0xbdf2, 0xbdf3, 0xbdf4, 0xbdf5, 0xbdf6, 0xbdf7,
+ 0xbdf8, 0xbdf9, 0xbdfa, 0xbdfb, 0xbdfc, 0xbdfd, 0xbdfe, 0xbdff,
+ 0xbe00, 0xbe01, 0xbe02, 0xbe03, 0xbe04, 0xbe05, 0xbe06, 0xbe07,
+ 0xbe08, 0xbe09, 0xbe0a, 0xbe0b, 0xbe0c, 0xbe0d, 0xbe0e, 0xbe0f,
+ 0xbe10, 0xbe11, 0xbe12, 0xbe13, 0xbe14, 0xbe15, 0xbe16, 0xbe17,
+ 0xbe18, 0xbe19, 0xbe1a, 0xbe1b, 0xbe1c, 0xbe1d, 0xbe1e, 0xbe1f,
+ 0xbe20, 0xbe21, 0xbe22, 0xbe23, 0xbe24, 0xbe25, 0xbe26, 0xbe27,
+ 0xbe28, 0xbe29, 0xbe2a, 0xbe2b, 0xbe2c, 0xbe2d, 0xbe2e, 0xbe2f,
+ 0xbe30, 0xbe31, 0xbe32, 0xbe33, 0xbe34, 0xbe35, 0xbe36, 0xbe37,
+ 0xbe38, 0xbe39, 0xbe3a, 0xbe3b, 0xbe3c, 0xbe3d, 0xbe3e, 0xbe3f,
+ 0xbe40, 0xbe41, 0xbe42, 0xbe43, 0xbe44, 0xbe45, 0xbe46, 0xbe47,
+ 0xbe48, 0xbe49, 0xbe4a, 0xbe4b, 0xbe4c, 0xbe4d, 0xbe4e, 0xbe4f,
+ 0xbe50, 0xbe51, 0xbe52, 0xbe53, 0xbe54, 0xbe55, 0xbe56, 0xbe57,
+ 0xbe58, 0xbe59, 0xbe5a, 0xbe5b, 0xbe5c, 0xbe5d, 0xbe5e, 0xbe5f,
+ 0xbe60, 0xbe61, 0xbe62, 0xbe63, 0xbe64, 0xbe65, 0xbe66, 0xbe67,
+ 0xbe68, 0xbe69, 0xbe6a, 0xbe6b, 0xbe6c, 0xbe6d, 0xbe6e, 0xbe6f,
+ 0xbe70, 0xbe71, 0xbe72, 0xbe73, 0xbe74, 0xbe75, 0xbe76, 0xbe77,
+ 0xbe78, 0xbe79, 0xbe7a, 0xbe7b, 0xbe7c, 0xbe7d, 0xbe7e, 0xbe7f,
+ 0xbe80, 0xbe81, 0xbe82, 0xbe83, 0xbe84, 0xbe85, 0xbe86, 0xbe87,
+ 0xbe88, 0xbe89, 0xbe8a, 0xbe8b, 0xbe8c, 0xbe8d, 0xbe8e, 0xbe8f,
+ 0xbe90, 0xbe91, 0xbe92, 0xbe93, 0xbe94, 0xbe95, 0xbe96, 0xbe97,
+ 0xbe98, 0xbe99, 0xbe9a, 0xbe9b, 0xbe9c, 0xbe9d, 0xbe9e, 0xbe9f,
+ 0xbea0, 0xbea1, 0xbea2, 0xbea3, 0xbea4, 0xbea5, 0xbea6, 0xbea7,
+ 0xbea8, 0xbea9, 0xbeaa, 0xbeab, 0xbeac, 0xbead, 0xbeae, 0xbeaf,
+ 0xbeb0, 0xbeb1, 0xbeb2, 0xbeb3, 0xbeb4, 0xbeb5, 0xbeb6, 0xbeb7,
+ 0xbeb8, 0xbeb9, 0xbeba, 0xbebb, 0xbebc, 0xbebd, 0xbebe, 0xbebf,
+ 0xbec0, 0xbec1, 0xbec2, 0xbec3, 0xbec4, 0xbec5, 0xbec6, 0xbec7,
+ 0xbec8, 0xbec9, 0xbeca, 0xbecb, 0xbecc, 0xbecd, 0xbece, 0xbecf,
+ 0xbed0, 0xbed1, 0xbed2, 0xbed3, 0xbed4, 0xbed5, 0xbed6, 0xbed7,
+ 0xbed8, 0xbed9, 0xbeda, 0xbedb, 0xbedc, 0xbedd, 0xbede, 0xbedf,
+ 0xbee0, 0xbee1, 0xbee2, 0xbee3, 0xbee4, 0xbee5, 0xbee6, 0xbee7,
+ 0xbee8, 0xbee9, 0xbeea, 0xbeeb, 0xbeec, 0xbeed, 0xbeee, 0xbeef,
+ 0xbef0, 0xbef1, 0xbef2, 0xbef3, 0xbef4, 0xbef5, 0xbef6, 0xbef7,
+ 0xbef8, 0xbef9, 0xbefa, 0xbefb, 0xbefc, 0xbefd, 0xbefe, 0xbeff,
+ 0xbf00, 0xbf01, 0xbf02, 0xbf03, 0xbf04, 0xbf05, 0xbf06, 0xbf07,
+ 0xbf08, 0xbf09, 0xbf0a, 0xbf0b, 0xbf0c, 0xbf0d, 0xbf0e, 0xbf0f,
+ 0xbf10, 0xbf11, 0xbf12, 0xbf13, 0xbf14, 0xbf15, 0xbf16, 0xbf17,
+ 0xbf18, 0xbf19, 0xbf1a, 0xbf1b, 0xbf1c, 0xbf1d, 0xbf1e, 0xbf1f,
+ 0xbf20, 0xbf21, 0xbf22, 0xbf23, 0xbf24, 0xbf25, 0xbf26, 0xbf27,
+ 0xbf28, 0xbf29, 0xbf2a, 0xbf2b, 0xbf2c, 0xbf2d, 0xbf2e, 0xbf2f,
+ 0xbf30, 0xbf31, 0xbf32, 0xbf33, 0xbf34, 0xbf35, 0xbf36, 0xbf37,
+ 0xbf38, 0xbf39, 0xbf3a, 0xbf3b, 0xbf3c, 0xbf3d, 0xbf3e, 0xbf3f,
+ 0xbf40, 0xbf41, 0xbf42, 0xbf43, 0xbf44, 0xbf45, 0xbf46, 0xbf47,
+ 0xbf48, 0xbf49, 0xbf4a, 0xbf4b, 0xbf4c, 0xbf4d, 0xbf4e, 0xbf4f,
+ 0xbf50, 0xbf51, 0xbf52, 0xbf53, 0xbf54, 0xbf55, 0xbf56, 0xbf57,
+ 0xbf58, 0xbf59, 0xbf5a, 0xbf5b, 0xbf5c, 0xbf5d, 0xbf5e, 0xbf5f,
+ 0xbf60, 0xbf61, 0xbf62, 0xbf63, 0xbf64, 0xbf65, 0xbf66, 0xbf67,
+ 0xbf68, 0xbf69, 0xbf6a, 0xbf6b, 0xbf6c, 0xbf6d, 0xbf6e, 0xbf6f,
+ 0xbf70, 0xbf71, 0xbf72, 0xbf73, 0xbf74, 0xbf75, 0xbf76, 0xbf77,
+ 0xbf78, 0xbf79, 0xbf7a, 0xbf7b, 0xbf7c, 0xbf7d, 0xbf7e, 0xbf7f,
+ 0xbf80, 0xbf81, 0xbf82, 0xbf83, 0xbf84, 0xbf85, 0xbf86, 0xbf87,
+ 0xbf88, 0xbf89, 0xbf8a, 0xbf8b, 0xbf8c, 0xbf8d, 0xbf8e, 0xbf8f,
+ 0xbf90, 0xbf91, 0xbf92, 0xbf93, 0xbf94, 0xbf95, 0xbf96, 0xbf97,
+ 0xbf98, 0xbf99, 0xbf9a, 0xbf9b, 0xbf9c, 0xbf9d, 0xbf9e, 0xbf9f,
+ 0xbfa0, 0xbfa1, 0xbfa2, 0xbfa3, 0xbfa4, 0xbfa5, 0xbfa6, 0xbfa7,
+ 0xbfa8, 0xbfa9, 0xbfaa, 0xbfab, 0xbfac, 0xbfad, 0xbfae, 0xbfaf,
+ 0xbfb0, 0xbfb1, 0xbfb2, 0xbfb3, 0xbfb4, 0xbfb5, 0xbfb6, 0xbfb7,
+ 0xbfb8, 0xbfb9, 0xbfba, 0xbfbb, 0xbfbc, 0xbfbd, 0xbfbe, 0xbfbf,
+ 0xbfc0, 0xbfc1, 0xbfc2, 0xbfc3, 0xbfc4, 0xbfc5, 0xbfc6, 0xbfc7,
+ 0xbfc8, 0xbfc9, 0xbfca, 0xbfcb, 0xbfcc, 0xbfcd, 0xbfce, 0xbfcf,
+ 0xbfd0, 0xbfd1, 0xbfd2, 0xbfd3, 0xbfd4, 0xbfd5, 0xbfd6, 0xbfd7,
+ 0xbfd8, 0xbfd9, 0xbfda, 0xbfdb, 0xbfdc, 0xbfdd, 0xbfde, 0xbfdf,
+ 0xbfe0, 0xbfe1, 0xbfe2, 0xbfe3, 0xbfe4, 0xbfe5, 0xbfe6, 0xbfe7,
+ 0xbfe8, 0xbfe9, 0xbfea, 0xbfeb, 0xbfec, 0xbfed, 0xbfee, 0xbfef,
+ 0xbff0, 0xbff1, 0xbff2, 0xbff3, 0xbff4, 0xbff5, 0xbff6, 0xbff7,
+ 0xbff8, 0xbff9, 0xbffa, 0xbffb, 0xbffc, 0xbffd, 0xbffe, 0xbfff,
+ 0xc000, 0xc001, 0xc002, 0xc003, 0xc004, 0xc005, 0xc006, 0xc007,
+ 0xc008, 0xc009, 0xc00a, 0xc00b, 0xc00c, 0xc00d, 0xc00e, 0xc00f,
+ 0xc010, 0xc011, 0xc012, 0xc013, 0xc014, 0xc015, 0xc016, 0xc017,
+ 0xc018, 0xc019, 0xc01a, 0xc01b, 0xc01c, 0xc01d, 0xc01e, 0xc01f,
+ 0xc020, 0xc021, 0xc022, 0xc023, 0xc024, 0xc025, 0xc026, 0xc027,
+ 0xc028, 0xc029, 0xc02a, 0xc02b, 0xc02c, 0xc02d, 0xc02e, 0xc02f,
+ 0xc030, 0xc031, 0xc032, 0xc033, 0xc034, 0xc035, 0xc036, 0xc037,
+ 0xc038, 0xc039, 0xc03a, 0xc03b, 0xc03c, 0xc03d, 0xc03e, 0xc03f,
+ 0xc040, 0xc041, 0xc042, 0xc043, 0xc044, 0xc045, 0xc046, 0xc047,
+ 0xc048, 0xc049, 0xc04a, 0xc04b, 0xc04c, 0xc04d, 0xc04e, 0xc04f,
+ 0xc050, 0xc051, 0xc052, 0xc053, 0xc054, 0xc055, 0xc056, 0xc057,
+ 0xc058, 0xc059, 0xc05a, 0xc05b, 0xc05c, 0xc05d, 0xc05e, 0xc05f,
+ 0xc060, 0xc061, 0xc062, 0xc063, 0xc064, 0xc065, 0xc066, 0xc067,
+ 0xc068, 0xc069, 0xc06a, 0xc06b, 0xc06c, 0xc06d, 0xc06e, 0xc06f,
+ 0xc070, 0xc071, 0xc072, 0xc073, 0xc074, 0xc075, 0xc076, 0xc077,
+ 0xc078, 0xc079, 0xc07a, 0xc07b, 0xc07c, 0xc07d, 0xc07e, 0xc07f,
+ 0xc080, 0xc081, 0xc082, 0xc083, 0xc084, 0xc085, 0xc086, 0xc087,
+ 0xc088, 0xc089, 0xc08a, 0xc08b, 0xc08c, 0xc08d, 0xc08e, 0xc08f,
+ 0xc090, 0xc091, 0xc092, 0xc093, 0xc094, 0xc095, 0xc096, 0xc097,
+ 0xc098, 0xc099, 0xc09a, 0xc09b, 0xc09c, 0xc09d, 0xc09e, 0xc09f,
+ 0xc0a0, 0xc0a1, 0xc0a2, 0xc0a3, 0xc0a4, 0xc0a5, 0xc0a6, 0xc0a7,
+ 0xc0a8, 0xc0a9, 0xc0aa, 0xc0ab, 0xc0ac, 0xc0ad, 0xc0ae, 0xc0af,
+ 0xc0b0, 0xc0b1, 0xc0b2, 0xc0b3, 0xc0b4, 0xc0b5, 0xc0b6, 0xc0b7,
+ 0xc0b8, 0xc0b9, 0xc0ba, 0xc0bb, 0xc0bc, 0xc0bd, 0xc0be, 0xc0bf,
+ 0xc0c0, 0xc0c1, 0xc0c2, 0xc0c3, 0xc0c4, 0xc0c5, 0xc0c6, 0xc0c7,
+ 0xc0c8, 0xc0c9, 0xc0ca, 0xc0cb, 0xc0cc, 0xc0cd, 0xc0ce, 0xc0cf,
+ 0xc0d0, 0xc0d1, 0xc0d2, 0xc0d3, 0xc0d4, 0xc0d5, 0xc0d6, 0xc0d7,
+ 0xc0d8, 0xc0d9, 0xc0da, 0xc0db, 0xc0dc, 0xc0dd, 0xc0de, 0xc0df,
+ 0xc0e0, 0xc0e1, 0xc0e2, 0xc0e3, 0xc0e4, 0xc0e5, 0xc0e6, 0xc0e7,
+ 0xc0e8, 0xc0e9, 0xc0ea, 0xc0eb, 0xc0ec, 0xc0ed, 0xc0ee, 0xc0ef,
+ 0xc0f0, 0xc0f1, 0xc0f2, 0xc0f3, 0xc0f4, 0xc0f5, 0xc0f6, 0xc0f7,
+ 0xc0f8, 0xc0f9, 0xc0fa, 0xc0fb, 0xc0fc, 0xc0fd, 0xc0fe, 0xc0ff,
+ 0xc100, 0xc101, 0xc102, 0xc103, 0xc104, 0xc105, 0xc106, 0xc107,
+ 0xc108, 0xc109, 0xc10a, 0xc10b, 0xc10c, 0xc10d, 0xc10e, 0xc10f,
+ 0xc110, 0xc111, 0xc112, 0xc113, 0xc114, 0xc115, 0xc116, 0xc117,
+ 0xc118, 0xc119, 0xc11a, 0xc11b, 0xc11c, 0xc11d, 0xc11e, 0xc11f,
+ 0xc120, 0xc121, 0xc122, 0xc123, 0xc124, 0xc125, 0xc126, 0xc127,
+ 0xc128, 0xc129, 0xc12a, 0xc12b, 0xc12c, 0xc12d, 0xc12e, 0xc12f,
+ 0xc130, 0xc131, 0xc132, 0xc133, 0xc134, 0xc135, 0xc136, 0xc137,
+ 0xc138, 0xc139, 0xc13a, 0xc13b, 0xc13c, 0xc13d, 0xc13e, 0xc13f,
+ 0xc140, 0xc141, 0xc142, 0xc143, 0xc144, 0xc145, 0xc146, 0xc147,
+ 0xc148, 0xc149, 0xc14a, 0xc14b, 0xc14c, 0xc14d, 0xc14e, 0xc14f,
+ 0xc150, 0xc151, 0xc152, 0xc153, 0xc154, 0xc155, 0xc156, 0xc157,
+ 0xc158, 0xc159, 0xc15a, 0xc15b, 0xc15c, 0xc15d, 0xc15e, 0xc15f,
+ 0xc160, 0xc161, 0xc162, 0xc163, 0xc164, 0xc165, 0xc166, 0xc167,
+ 0xc168, 0xc169, 0xc16a, 0xc16b, 0xc16c, 0xc16d, 0xc16e, 0xc16f,
+ 0xc170, 0xc171, 0xc172, 0xc173, 0xc174, 0xc175, 0xc176, 0xc177,
+ 0xc178, 0xc179, 0xc17a, 0xc17b, 0xc17c, 0xc17d, 0xc17e, 0xc17f,
+ 0xc180, 0xc181, 0xc182, 0xc183, 0xc184, 0xc185, 0xc186, 0xc187,
+ 0xc188, 0xc189, 0xc18a, 0xc18b, 0xc18c, 0xc18d, 0xc18e, 0xc18f,
+ 0xc190, 0xc191, 0xc192, 0xc193, 0xc194, 0xc195, 0xc196, 0xc197,
+ 0xc198, 0xc199, 0xc19a, 0xc19b, 0xc19c, 0xc19d, 0xc19e, 0xc19f,
+ 0xc1a0, 0xc1a1, 0xc1a2, 0xc1a3, 0xc1a4, 0xc1a5, 0xc1a6, 0xc1a7,
+ 0xc1a8, 0xc1a9, 0xc1aa, 0xc1ab, 0xc1ac, 0xc1ad, 0xc1ae, 0xc1af,
+ 0xc1b0, 0xc1b1, 0xc1b2, 0xc1b3, 0xc1b4, 0xc1b5, 0xc1b6, 0xc1b7,
+ 0xc1b8, 0xc1b9, 0xc1ba, 0xc1bb, 0xc1bc, 0xc1bd, 0xc1be, 0xc1bf,
+ 0xc1c0, 0xc1c1, 0xc1c2, 0xc1c3, 0xc1c4, 0xc1c5, 0xc1c6, 0xc1c7,
+ 0xc1c8, 0xc1c9, 0xc1ca, 0xc1cb, 0xc1cc, 0xc1cd, 0xc1ce, 0xc1cf,
+ 0xc1d0, 0xc1d1, 0xc1d2, 0xc1d3, 0xc1d4, 0xc1d5, 0xc1d6, 0xc1d7,
+ 0xc1d8, 0xc1d9, 0xc1da, 0xc1db, 0xc1dc, 0xc1dd, 0xc1de, 0xc1df,
+ 0xc1e0, 0xc1e1, 0xc1e2, 0xc1e3, 0xc1e4, 0xc1e5, 0xc1e6, 0xc1e7,
+ 0xc1e8, 0xc1e9, 0xc1ea, 0xc1eb, 0xc1ec, 0xc1ed, 0xc1ee, 0xc1ef,
+ 0xc1f0, 0xc1f1, 0xc1f2, 0xc1f3, 0xc1f4, 0xc1f5, 0xc1f6, 0xc1f7,
+ 0xc1f8, 0xc1f9, 0xc1fa, 0xc1fb, 0xc1fc, 0xc1fd, 0xc1fe, 0xc1ff,
+ 0xc200, 0xc201, 0xc202, 0xc203, 0xc204, 0xc205, 0xc206, 0xc207,
+ 0xc208, 0xc209, 0xc20a, 0xc20b, 0xc20c, 0xc20d, 0xc20e, 0xc20f,
+ 0xc210, 0xc211, 0xc212, 0xc213, 0xc214, 0xc215, 0xc216, 0xc217,
+ 0xc218, 0xc219, 0xc21a, 0xc21b, 0xc21c, 0xc21d, 0xc21e, 0xc21f,
+ 0xc220, 0xc221, 0xc222, 0xc223, 0xc224, 0xc225, 0xc226, 0xc227,
+ 0xc228, 0xc229, 0xc22a, 0xc22b, 0xc22c, 0xc22d, 0xc22e, 0xc22f,
+ 0xc230, 0xc231, 0xc232, 0xc233, 0xc234, 0xc235, 0xc236, 0xc237,
+ 0xc238, 0xc239, 0xc23a, 0xc23b, 0xc23c, 0xc23d, 0xc23e, 0xc23f,
+ 0xc240, 0xc241, 0xc242, 0xc243, 0xc244, 0xc245, 0xc246, 0xc247,
+ 0xc248, 0xc249, 0xc24a, 0xc24b, 0xc24c, 0xc24d, 0xc24e, 0xc24f,
+ 0xc250, 0xc251, 0xc252, 0xc253, 0xc254, 0xc255, 0xc256, 0xc257,
+ 0xc258, 0xc259, 0xc25a, 0xc25b, 0xc25c, 0xc25d, 0xc25e, 0xc25f,
+ 0xc260, 0xc261, 0xc262, 0xc263, 0xc264, 0xc265, 0xc266, 0xc267,
+ 0xc268, 0xc269, 0xc26a, 0xc26b, 0xc26c, 0xc26d, 0xc26e, 0xc26f,
+ 0xc270, 0xc271, 0xc272, 0xc273, 0xc274, 0xc275, 0xc276, 0xc277,
+ 0xc278, 0xc279, 0xc27a, 0xc27b, 0xc27c, 0xc27d, 0xc27e, 0xc27f,
+ 0xc280, 0xc281, 0xc282, 0xc283, 0xc284, 0xc285, 0xc286, 0xc287,
+ 0xc288, 0xc289, 0xc28a, 0xc28b, 0xc28c, 0xc28d, 0xc28e, 0xc28f,
+ 0xc290, 0xc291, 0xc292, 0xc293, 0xc294, 0xc295, 0xc296, 0xc297,
+ 0xc298, 0xc299, 0xc29a, 0xc29b, 0xc29c, 0xc29d, 0xc29e, 0xc29f,
+ 0xc2a0, 0xc2a1, 0xc2a2, 0xc2a3, 0xc2a4, 0xc2a5, 0xc2a6, 0xc2a7,
+ 0xc2a8, 0xc2a9, 0xc2aa, 0xc2ab, 0xc2ac, 0xc2ad, 0xc2ae, 0xc2af,
+ 0xc2b0, 0xc2b1, 0xc2b2, 0xc2b3, 0xc2b4, 0xc2b5, 0xc2b6, 0xc2b7,
+ 0xc2b8, 0xc2b9, 0xc2ba, 0xc2bb, 0xc2bc, 0xc2bd, 0xc2be, 0xc2bf,
+ 0xc2c0, 0xc2c1, 0xc2c2, 0xc2c3, 0xc2c4, 0xc2c5, 0xc2c6, 0xc2c7,
+ 0xc2c8, 0xc2c9, 0xc2ca, 0xc2cb, 0xc2cc, 0xc2cd, 0xc2ce, 0xc2cf,
+ 0xc2d0, 0xc2d1, 0xc2d2, 0xc2d3, 0xc2d4, 0xc2d5, 0xc2d6, 0xc2d7,
+ 0xc2d8, 0xc2d9, 0xc2da, 0xc2db, 0xc2dc, 0xc2dd, 0xc2de, 0xc2df,
+ 0xc2e0, 0xc2e1, 0xc2e2, 0xc2e3, 0xc2e4, 0xc2e5, 0xc2e6, 0xc2e7,
+ 0xc2e8, 0xc2e9, 0xc2ea, 0xc2eb, 0xc2ec, 0xc2ed, 0xc2ee, 0xc2ef,
+ 0xc2f0, 0xc2f1, 0xc2f2, 0xc2f3, 0xc2f4, 0xc2f5, 0xc2f6, 0xc2f7,
+ 0xc2f8, 0xc2f9, 0xc2fa, 0xc2fb, 0xc2fc, 0xc2fd, 0xc2fe, 0xc2ff,
+ 0xc300, 0xc301, 0xc302, 0xc303, 0xc304, 0xc305, 0xc306, 0xc307,
+ 0xc308, 0xc309, 0xc30a, 0xc30b, 0xc30c, 0xc30d, 0xc30e, 0xc30f,
+ 0xc310, 0xc311, 0xc312, 0xc313, 0xc314, 0xc315, 0xc316, 0xc317,
+ 0xc318, 0xc319, 0xc31a, 0xc31b, 0xc31c, 0xc31d, 0xc31e, 0xc31f,
+ 0xc320, 0xc321, 0xc322, 0xc323, 0xc324, 0xc325, 0xc326, 0xc327,
+ 0xc328, 0xc329, 0xc32a, 0xc32b, 0xc32c, 0xc32d, 0xc32e, 0xc32f,
+ 0xc330, 0xc331, 0xc332, 0xc333, 0xc334, 0xc335, 0xc336, 0xc337,
+ 0xc338, 0xc339, 0xc33a, 0xc33b, 0xc33c, 0xc33d, 0xc33e, 0xc33f,
+ 0xc340, 0xc341, 0xc342, 0xc343, 0xc344, 0xc345, 0xc346, 0xc347,
+ 0xc348, 0xc349, 0xc34a, 0xc34b, 0xc34c, 0xc34d, 0xc34e, 0xc34f,
+ 0xc350, 0xc351, 0xc352, 0xc353, 0xc354, 0xc355, 0xc356, 0xc357,
+ 0xc358, 0xc359, 0xc35a, 0xc35b, 0xc35c, 0xc35d, 0xc35e, 0xc35f,
+ 0xc360, 0xc361, 0xc362, 0xc363, 0xc364, 0xc365, 0xc366, 0xc367,
+ 0xc368, 0xc369, 0xc36a, 0xc36b, 0xc36c, 0xc36d, 0xc36e, 0xc36f,
+ 0xc370, 0xc371, 0xc372, 0xc373, 0xc374, 0xc375, 0xc376, 0xc377,
+ 0xc378, 0xc379, 0xc37a, 0xc37b, 0xc37c, 0xc37d, 0xc37e, 0xc37f,
+ 0xc380, 0xc381, 0xc382, 0xc383, 0xc384, 0xc385, 0xc386, 0xc387,
+ 0xc388, 0xc389, 0xc38a, 0xc38b, 0xc38c, 0xc38d, 0xc38e, 0xc38f,
+ 0xc390, 0xc391, 0xc392, 0xc393, 0xc394, 0xc395, 0xc396, 0xc397,
+ 0xc398, 0xc399, 0xc39a, 0xc39b, 0xc39c, 0xc39d, 0xc39e, 0xc39f,
+ 0xc3a0, 0xc3a1, 0xc3a2, 0xc3a3, 0xc3a4, 0xc3a5, 0xc3a6, 0xc3a7,
+ 0xc3a8, 0xc3a9, 0xc3aa, 0xc3ab, 0xc3ac, 0xc3ad, 0xc3ae, 0xc3af,
+ 0xc3b0, 0xc3b1, 0xc3b2, 0xc3b3, 0xc3b4, 0xc3b5, 0xc3b6, 0xc3b7,
+ 0xc3b8, 0xc3b9, 0xc3ba, 0xc3bb, 0xc3bc, 0xc3bd, 0xc3be, 0xc3bf,
+ 0xc3c0, 0xc3c1, 0xc3c2, 0xc3c3, 0xc3c4, 0xc3c5, 0xc3c6, 0xc3c7,
+ 0xc3c8, 0xc3c9, 0xc3ca, 0xc3cb, 0xc3cc, 0xc3cd, 0xc3ce, 0xc3cf,
+ 0xc3d0, 0xc3d1, 0xc3d2, 0xc3d3, 0xc3d4, 0xc3d5, 0xc3d6, 0xc3d7,
+ 0xc3d8, 0xc3d9, 0xc3da, 0xc3db, 0xc3dc, 0xc3dd, 0xc3de, 0xc3df,
+ 0xc3e0, 0xc3e1, 0xc3e2, 0xc3e3, 0xc3e4, 0xc3e5, 0xc3e6, 0xc3e7,
+ 0xc3e8, 0xc3e9, 0xc3ea, 0xc3eb, 0xc3ec, 0xc3ed, 0xc3ee, 0xc3ef,
+ 0xc3f0, 0xc3f1, 0xc3f2, 0xc3f3, 0xc3f4, 0xc3f5, 0xc3f6, 0xc3f7,
+ 0xc3f8, 0xc3f9, 0xc3fa, 0xc3fb, 0xc3fc, 0xc3fd, 0xc3fe, 0xc3ff,
+ 0xc400, 0xc401, 0xc402, 0xc403, 0xc404, 0xc405, 0xc406, 0xc407,
+ 0xc408, 0xc409, 0xc40a, 0xc40b, 0xc40c, 0xc40d, 0xc40e, 0xc40f,
+ 0xc410, 0xc411, 0xc412, 0xc413, 0xc414, 0xc415, 0xc416, 0xc417,
+ 0xc418, 0xc419, 0xc41a, 0xc41b, 0xc41c, 0xc41d, 0xc41e, 0xc41f,
+ 0xc420, 0xc421, 0xc422, 0xc423, 0xc424, 0xc425, 0xc426, 0xc427,
+ 0xc428, 0xc429, 0xc42a, 0xc42b, 0xc42c, 0xc42d, 0xc42e, 0xc42f,
+ 0xc430, 0xc431, 0xc432, 0xc433, 0xc434, 0xc435, 0xc436, 0xc437,
+ 0xc438, 0xc439, 0xc43a, 0xc43b, 0xc43c, 0xc43d, 0xc43e, 0xc43f,
+ 0xc440, 0xc441, 0xc442, 0xc443, 0xc444, 0xc445, 0xc446, 0xc447,
+ 0xc448, 0xc449, 0xc44a, 0xc44b, 0xc44c, 0xc44d, 0xc44e, 0xc44f,
+ 0xc450, 0xc451, 0xc452, 0xc453, 0xc454, 0xc455, 0xc456, 0xc457,
+ 0xc458, 0xc459, 0xc45a, 0xc45b, 0xc45c, 0xc45d, 0xc45e, 0xc45f,
+ 0xc460, 0xc461, 0xc462, 0xc463, 0xc464, 0xc465, 0xc466, 0xc467,
+ 0xc468, 0xc469, 0xc46a, 0xc46b, 0xc46c, 0xc46d, 0xc46e, 0xc46f,
+ 0xc470, 0xc471, 0xc472, 0xc473, 0xc474, 0xc475, 0xc476, 0xc477,
+ 0xc478, 0xc479, 0xc47a, 0xc47b, 0xc47c, 0xc47d, 0xc47e, 0xc47f,
+ 0xc480, 0xc481, 0xc482, 0xc483, 0xc484, 0xc485, 0xc486, 0xc487,
+ 0xc488, 0xc489, 0xc48a, 0xc48b, 0xc48c, 0xc48d, 0xc48e, 0xc48f,
+ 0xc490, 0xc491, 0xc492, 0xc493, 0xc494, 0xc495, 0xc496, 0xc497,
+ 0xc498, 0xc499, 0xc49a, 0xc49b, 0xc49c, 0xc49d, 0xc49e, 0xc49f,
+ 0xc4a0, 0xc4a1, 0xc4a2, 0xc4a3, 0xc4a4, 0xc4a5, 0xc4a6, 0xc4a7,
+ 0xc4a8, 0xc4a9, 0xc4aa, 0xc4ab, 0xc4ac, 0xc4ad, 0xc4ae, 0xc4af,
+ 0xc4b0, 0xc4b1, 0xc4b2, 0xc4b3, 0xc4b4, 0xc4b5, 0xc4b6, 0xc4b7,
+ 0xc4b8, 0xc4b9, 0xc4ba, 0xc4bb, 0xc4bc, 0xc4bd, 0xc4be, 0xc4bf,
+ 0xc4c0, 0xc4c1, 0xc4c2, 0xc4c3, 0xc4c4, 0xc4c5, 0xc4c6, 0xc4c7,
+ 0xc4c8, 0xc4c9, 0xc4ca, 0xc4cb, 0xc4cc, 0xc4cd, 0xc4ce, 0xc4cf,
+ 0xc4d0, 0xc4d1, 0xc4d2, 0xc4d3, 0xc4d4, 0xc4d5, 0xc4d6, 0xc4d7,
+ 0xc4d8, 0xc4d9, 0xc4da, 0xc4db, 0xc4dc, 0xc4dd, 0xc4de, 0xc4df,
+ 0xc4e0, 0xc4e1, 0xc4e2, 0xc4e3, 0xc4e4, 0xc4e5, 0xc4e6, 0xc4e7,
+ 0xc4e8, 0xc4e9, 0xc4ea, 0xc4eb, 0xc4ec, 0xc4ed, 0xc4ee, 0xc4ef,
+ 0xc4f0, 0xc4f1, 0xc4f2, 0xc4f3, 0xc4f4, 0xc4f5, 0xc4f6, 0xc4f7,
+ 0xc4f8, 0xc4f9, 0xc4fa, 0xc4fb, 0xc4fc, 0xc4fd, 0xc4fe, 0xc4ff,
+ 0xc500, 0xc501, 0xc502, 0xc503, 0xc504, 0xc505, 0xc506, 0xc507,
+ 0xc508, 0xc509, 0xc50a, 0xc50b, 0xc50c, 0xc50d, 0xc50e, 0xc50f,
+ 0xc510, 0xc511, 0xc512, 0xc513, 0xc514, 0xc515, 0xc516, 0xc517,
+ 0xc518, 0xc519, 0xc51a, 0xc51b, 0xc51c, 0xc51d, 0xc51e, 0xc51f,
+ 0xc520, 0xc521, 0xc522, 0xc523, 0xc524, 0xc525, 0xc526, 0xc527,
+ 0xc528, 0xc529, 0xc52a, 0xc52b, 0xc52c, 0xc52d, 0xc52e, 0xc52f,
+ 0xc530, 0xc531, 0xc532, 0xc533, 0xc534, 0xc535, 0xc536, 0xc537,
+ 0xc538, 0xc539, 0xc53a, 0xc53b, 0xc53c, 0xc53d, 0xc53e, 0xc53f,
+ 0xc540, 0xc541, 0xc542, 0xc543, 0xc544, 0xc545, 0xc546, 0xc547,
+ 0xc548, 0xc549, 0xc54a, 0xc54b, 0xc54c, 0xc54d, 0xc54e, 0xc54f,
+ 0xc550, 0xc551, 0xc552, 0xc553, 0xc554, 0xc555, 0xc556, 0xc557,
+ 0xc558, 0xc559, 0xc55a, 0xc55b, 0xc55c, 0xc55d, 0xc55e, 0xc55f,
+ 0xc560, 0xc561, 0xc562, 0xc563, 0xc564, 0xc565, 0xc566, 0xc567,
+ 0xc568, 0xc569, 0xc56a, 0xc56b, 0xc56c, 0xc56d, 0xc56e, 0xc56f,
+ 0xc570, 0xc571, 0xc572, 0xc573, 0xc574, 0xc575, 0xc576, 0xc577,
+ 0xc578, 0xc579, 0xc57a, 0xc57b, 0xc57c, 0xc57d, 0xc57e, 0xc57f,
+ 0xc580, 0xc581, 0xc582, 0xc583, 0xc584, 0xc585, 0xc586, 0xc587,
+ 0xc588, 0xc589, 0xc58a, 0xc58b, 0xc58c, 0xc58d, 0xc58e, 0xc58f,
+ 0xc590, 0xc591, 0xc592, 0xc593, 0xc594, 0xc595, 0xc596, 0xc597,
+ 0xc598, 0xc599, 0xc59a, 0xc59b, 0xc59c, 0xc59d, 0xc59e, 0xc59f,
+ 0xc5a0, 0xc5a1, 0xc5a2, 0xc5a3, 0xc5a4, 0xc5a5, 0xc5a6, 0xc5a7,
+ 0xc5a8, 0xc5a9, 0xc5aa, 0xc5ab, 0xc5ac, 0xc5ad, 0xc5ae, 0xc5af,
+ 0xc5b0, 0xc5b1, 0xc5b2, 0xc5b3, 0xc5b4, 0xc5b5, 0xc5b6, 0xc5b7,
+ 0xc5b8, 0xc5b9, 0xc5ba, 0xc5bb, 0xc5bc, 0xc5bd, 0xc5be, 0xc5bf,
+ 0xc5c0, 0xc5c1, 0xc5c2, 0xc5c3, 0xc5c4, 0xc5c5, 0xc5c6, 0xc5c7,
+ 0xc5c8, 0xc5c9, 0xc5ca, 0xc5cb, 0xc5cc, 0xc5cd, 0xc5ce, 0xc5cf,
+ 0xc5d0, 0xc5d1, 0xc5d2, 0xc5d3, 0xc5d4, 0xc5d5, 0xc5d6, 0xc5d7,
+ 0xc5d8, 0xc5d9, 0xc5da, 0xc5db, 0xc5dc, 0xc5dd, 0xc5de, 0xc5df,
+ 0xc5e0, 0xc5e1, 0xc5e2, 0xc5e3, 0xc5e4, 0xc5e5, 0xc5e6, 0xc5e7,
+ 0xc5e8, 0xc5e9, 0xc5ea, 0xc5eb, 0xc5ec, 0xc5ed, 0xc5ee, 0xc5ef,
+ 0xc5f0, 0xc5f1, 0xc5f2, 0xc5f3, 0xc5f4, 0xc5f5, 0xc5f6, 0xc5f7,
+ 0xc5f8, 0xc5f9, 0xc5fa, 0xc5fb, 0xc5fc, 0xc5fd, 0xc5fe, 0xc5ff,
+ 0xc600, 0xc601, 0xc602, 0xc603, 0xc604, 0xc605, 0xc606, 0xc607,
+ 0xc608, 0xc609, 0xc60a, 0xc60b, 0xc60c, 0xc60d, 0xc60e, 0xc60f,
+ 0xc610, 0xc611, 0xc612, 0xc613, 0xc614, 0xc615, 0xc616, 0xc617,
+ 0xc618, 0xc619, 0xc61a, 0xc61b, 0xc61c, 0xc61d, 0xc61e, 0xc61f,
+ 0xc620, 0xc621, 0xc622, 0xc623, 0xc624, 0xc625, 0xc626, 0xc627,
+ 0xc628, 0xc629, 0xc62a, 0xc62b, 0xc62c, 0xc62d, 0xc62e, 0xc62f,
+ 0xc630, 0xc631, 0xc632, 0xc633, 0xc634, 0xc635, 0xc636, 0xc637,
+ 0xc638, 0xc639, 0xc63a, 0xc63b, 0xc63c, 0xc63d, 0xc63e, 0xc63f,
+ 0xc640, 0xc641, 0xc642, 0xc643, 0xc644, 0xc645, 0xc646, 0xc647,
+ 0xc648, 0xc649, 0xc64a, 0xc64b, 0xc64c, 0xc64d, 0xc64e, 0xc64f,
+ 0xc650, 0xc651, 0xc652, 0xc653, 0xc654, 0xc655, 0xc656, 0xc657,
+ 0xc658, 0xc659, 0xc65a, 0xc65b, 0xc65c, 0xc65d, 0xc65e, 0xc65f,
+ 0xc660, 0xc661, 0xc662, 0xc663, 0xc664, 0xc665, 0xc666, 0xc667,
+ 0xc668, 0xc669, 0xc66a, 0xc66b, 0xc66c, 0xc66d, 0xc66e, 0xc66f,
+ 0xc670, 0xc671, 0xc672, 0xc673, 0xc674, 0xc675, 0xc676, 0xc677,
+ 0xc678, 0xc679, 0xc67a, 0xc67b, 0xc67c, 0xc67d, 0xc67e, 0xc67f,
+ 0xc680, 0xc681, 0xc682, 0xc683, 0xc684, 0xc685, 0xc686, 0xc687,
+ 0xc688, 0xc689, 0xc68a, 0xc68b, 0xc68c, 0xc68d, 0xc68e, 0xc68f,
+ 0xc690, 0xc691, 0xc692, 0xc693, 0xc694, 0xc695, 0xc696, 0xc697,
+ 0xc698, 0xc699, 0xc69a, 0xc69b, 0xc69c, 0xc69d, 0xc69e, 0xc69f,
+ 0xc6a0, 0xc6a1, 0xc6a2, 0xc6a3, 0xc6a4, 0xc6a5, 0xc6a6, 0xc6a7,
+ 0xc6a8, 0xc6a9, 0xc6aa, 0xc6ab, 0xc6ac, 0xc6ad, 0xc6ae, 0xc6af,
+ 0xc6b0, 0xc6b1, 0xc6b2, 0xc6b3, 0xc6b4, 0xc6b5, 0xc6b6, 0xc6b7,
+ 0xc6b8, 0xc6b9, 0xc6ba, 0xc6bb, 0xc6bc, 0xc6bd, 0xc6be, 0xc6bf,
+ 0xc6c0, 0xc6c1, 0xc6c2, 0xc6c3, 0xc6c4, 0xc6c5, 0xc6c6, 0xc6c7,
+ 0xc6c8, 0xc6c9, 0xc6ca, 0xc6cb, 0xc6cc, 0xc6cd, 0xc6ce, 0xc6cf,
+ 0xc6d0, 0xc6d1, 0xc6d2, 0xc6d3, 0xc6d4, 0xc6d5, 0xc6d6, 0xc6d7,
+ 0xc6d8, 0xc6d9, 0xc6da, 0xc6db, 0xc6dc, 0xc6dd, 0xc6de, 0xc6df,
+ 0xc6e0, 0xc6e1, 0xc6e2, 0xc6e3, 0xc6e4, 0xc6e5, 0xc6e6, 0xc6e7,
+ 0xc6e8, 0xc6e9, 0xc6ea, 0xc6eb, 0xc6ec, 0xc6ed, 0xc6ee, 0xc6ef,
+ 0xc6f0, 0xc6f1, 0xc6f2, 0xc6f3, 0xc6f4, 0xc6f5, 0xc6f6, 0xc6f7,
+ 0xc6f8, 0xc6f9, 0xc6fa, 0xc6fb, 0xc6fc, 0xc6fd, 0xc6fe, 0xc6ff,
+ 0xc700, 0xc701, 0xc702, 0xc703, 0xc704, 0xc705, 0xc706, 0xc707,
+ 0xc708, 0xc709, 0xc70a, 0xc70b, 0xc70c, 0xc70d, 0xc70e, 0xc70f,
+ 0xc710, 0xc711, 0xc712, 0xc713, 0xc714, 0xc715, 0xc716, 0xc717,
+ 0xc718, 0xc719, 0xc71a, 0xc71b, 0xc71c, 0xc71d, 0xc71e, 0xc71f,
+ 0xc720, 0xc721, 0xc722, 0xc723, 0xc724, 0xc725, 0xc726, 0xc727,
+ 0xc728, 0xc729, 0xc72a, 0xc72b, 0xc72c, 0xc72d, 0xc72e, 0xc72f,
+ 0xc730, 0xc731, 0xc732, 0xc733, 0xc734, 0xc735, 0xc736, 0xc737,
+ 0xc738, 0xc739, 0xc73a, 0xc73b, 0xc73c, 0xc73d, 0xc73e, 0xc73f,
+ 0xc740, 0xc741, 0xc742, 0xc743, 0xc744, 0xc745, 0xc746, 0xc747,
+ 0xc748, 0xc749, 0xc74a, 0xc74b, 0xc74c, 0xc74d, 0xc74e, 0xc74f,
+ 0xc750, 0xc751, 0xc752, 0xc753, 0xc754, 0xc755, 0xc756, 0xc757,
+ 0xc758, 0xc759, 0xc75a, 0xc75b, 0xc75c, 0xc75d, 0xc75e, 0xc75f,
+ 0xc760, 0xc761, 0xc762, 0xc763, 0xc764, 0xc765, 0xc766, 0xc767,
+ 0xc768, 0xc769, 0xc76a, 0xc76b, 0xc76c, 0xc76d, 0xc76e, 0xc76f,
+ 0xc770, 0xc771, 0xc772, 0xc773, 0xc774, 0xc775, 0xc776, 0xc777,
+ 0xc778, 0xc779, 0xc77a, 0xc77b, 0xc77c, 0xc77d, 0xc77e, 0xc77f,
+ 0xc780, 0xc781, 0xc782, 0xc783, 0xc784, 0xc785, 0xc786, 0xc787,
+ 0xc788, 0xc789, 0xc78a, 0xc78b, 0xc78c, 0xc78d, 0xc78e, 0xc78f,
+ 0xc790, 0xc791, 0xc792, 0xc793, 0xc794, 0xc795, 0xc796, 0xc797,
+ 0xc798, 0xc799, 0xc79a, 0xc79b, 0xc79c, 0xc79d, 0xc79e, 0xc79f,
+ 0xc7a0, 0xc7a1, 0xc7a2, 0xc7a3, 0xc7a4, 0xc7a5, 0xc7a6, 0xc7a7,
+ 0xc7a8, 0xc7a9, 0xc7aa, 0xc7ab, 0xc7ac, 0xc7ad, 0xc7ae, 0xc7af,
+ 0xc7b0, 0xc7b1, 0xc7b2, 0xc7b3, 0xc7b4, 0xc7b5, 0xc7b6, 0xc7b7,
+ 0xc7b8, 0xc7b9, 0xc7ba, 0xc7bb, 0xc7bc, 0xc7bd, 0xc7be, 0xc7bf,
+ 0xc7c0, 0xc7c1, 0xc7c2, 0xc7c3, 0xc7c4, 0xc7c5, 0xc7c6, 0xc7c7,
+ 0xc7c8, 0xc7c9, 0xc7ca, 0xc7cb, 0xc7cc, 0xc7cd, 0xc7ce, 0xc7cf,
+ 0xc7d0, 0xc7d1, 0xc7d2, 0xc7d3, 0xc7d4, 0xc7d5, 0xc7d6, 0xc7d7,
+ 0xc7d8, 0xc7d9, 0xc7da, 0xc7db, 0xc7dc, 0xc7dd, 0xc7de, 0xc7df,
+ 0xc7e0, 0xc7e1, 0xc7e2, 0xc7e3, 0xc7e4, 0xc7e5, 0xc7e6, 0xc7e7,
+ 0xc7e8, 0xc7e9, 0xc7ea, 0xc7eb, 0xc7ec, 0xc7ed, 0xc7ee, 0xc7ef,
+ 0xc7f0, 0xc7f1, 0xc7f2, 0xc7f3, 0xc7f4, 0xc7f5, 0xc7f6, 0xc7f7,
+ 0xc7f8, 0xc7f9, 0xc7fa, 0xc7fb, 0xc7fc, 0xc7fd, 0xc7fe, 0xc7ff,
+ 0xc800, 0xc801, 0xc802, 0xc803, 0xc804, 0xc805, 0xc806, 0xc807,
+ 0xc808, 0xc809, 0xc80a, 0xc80b, 0xc80c, 0xc80d, 0xc80e, 0xc80f,
+ 0xc810, 0xc811, 0xc812, 0xc813, 0xc814, 0xc815, 0xc816, 0xc817,
+ 0xc818, 0xc819, 0xc81a, 0xc81b, 0xc81c, 0xc81d, 0xc81e, 0xc81f,
+ 0xc820, 0xc821, 0xc822, 0xc823, 0xc824, 0xc825, 0xc826, 0xc827,
+ 0xc828, 0xc829, 0xc82a, 0xc82b, 0xc82c, 0xc82d, 0xc82e, 0xc82f,
+ 0xc830, 0xc831, 0xc832, 0xc833, 0xc834, 0xc835, 0xc836, 0xc837,
+ 0xc838, 0xc839, 0xc83a, 0xc83b, 0xc83c, 0xc83d, 0xc83e, 0xc83f,
+ 0xc840, 0xc841, 0xc842, 0xc843, 0xc844, 0xc845, 0xc846, 0xc847,
+ 0xc848, 0xc849, 0xc84a, 0xc84b, 0xc84c, 0xc84d, 0xc84e, 0xc84f,
+ 0xc850, 0xc851, 0xc852, 0xc853, 0xc854, 0xc855, 0xc856, 0xc857,
+ 0xc858, 0xc859, 0xc85a, 0xc85b, 0xc85c, 0xc85d, 0xc85e, 0xc85f,
+ 0xc860, 0xc861, 0xc862, 0xc863, 0xc864, 0xc865, 0xc866, 0xc867,
+ 0xc868, 0xc869, 0xc86a, 0xc86b, 0xc86c, 0xc86d, 0xc86e, 0xc86f,
+ 0xc870, 0xc871, 0xc872, 0xc873, 0xc874, 0xc875, 0xc876, 0xc877,
+ 0xc878, 0xc879, 0xc87a, 0xc87b, 0xc87c, 0xc87d, 0xc87e, 0xc87f,
+ 0xc880, 0xc881, 0xc882, 0xc883, 0xc884, 0xc885, 0xc886, 0xc887,
+ 0xc888, 0xc889, 0xc88a, 0xc88b, 0xc88c, 0xc88d, 0xc88e, 0xc88f,
+ 0xc890, 0xc891, 0xc892, 0xc893, 0xc894, 0xc895, 0xc896, 0xc897,
+ 0xc898, 0xc899, 0xc89a, 0xc89b, 0xc89c, 0xc89d, 0xc89e, 0xc89f,
+ 0xc8a0, 0xc8a1, 0xc8a2, 0xc8a3, 0xc8a4, 0xc8a5, 0xc8a6, 0xc8a7,
+ 0xc8a8, 0xc8a9, 0xc8aa, 0xc8ab, 0xc8ac, 0xc8ad, 0xc8ae, 0xc8af,
+ 0xc8b0, 0xc8b1, 0xc8b2, 0xc8b3, 0xc8b4, 0xc8b5, 0xc8b6, 0xc8b7,
+ 0xc8b8, 0xc8b9, 0xc8ba, 0xc8bb, 0xc8bc, 0xc8bd, 0xc8be, 0xc8bf,
+ 0xc8c0, 0xc8c1, 0xc8c2, 0xc8c3, 0xc8c4, 0xc8c5, 0xc8c6, 0xc8c7,
+ 0xc8c8, 0xc8c9, 0xc8ca, 0xc8cb, 0xc8cc, 0xc8cd, 0xc8ce, 0xc8cf,
+ 0xc8d0, 0xc8d1, 0xc8d2, 0xc8d3, 0xc8d4, 0xc8d5, 0xc8d6, 0xc8d7,
+ 0xc8d8, 0xc8d9, 0xc8da, 0xc8db, 0xc8dc, 0xc8dd, 0xc8de, 0xc8df,
+ 0xc8e0, 0xc8e1, 0xc8e2, 0xc8e3, 0xc8e4, 0xc8e5, 0xc8e6, 0xc8e7,
+ 0xc8e8, 0xc8e9, 0xc8ea, 0xc8eb, 0xc8ec, 0xc8ed, 0xc8ee, 0xc8ef,
+ 0xc8f0, 0xc8f1, 0xc8f2, 0xc8f3, 0xc8f4, 0xc8f5, 0xc8f6, 0xc8f7,
+ 0xc8f8, 0xc8f9, 0xc8fa, 0xc8fb, 0xc8fc, 0xc8fd, 0xc8fe, 0xc8ff,
+ 0xc900, 0xc901, 0xc902, 0xc903, 0xc904, 0xc905, 0xc906, 0xc907,
+ 0xc908, 0xc909, 0xc90a, 0xc90b, 0xc90c, 0xc90d, 0xc90e, 0xc90f,
+ 0xc910, 0xc911, 0xc912, 0xc913, 0xc914, 0xc915, 0xc916, 0xc917,
+ 0xc918, 0xc919, 0xc91a, 0xc91b, 0xc91c, 0xc91d, 0xc91e, 0xc91f,
+ 0xc920, 0xc921, 0xc922, 0xc923, 0xc924, 0xc925, 0xc926, 0xc927,
+ 0xc928, 0xc929, 0xc92a, 0xc92b, 0xc92c, 0xc92d, 0xc92e, 0xc92f,
+ 0xc930, 0xc931, 0xc932, 0xc933, 0xc934, 0xc935, 0xc936, 0xc937,
+ 0xc938, 0xc939, 0xc93a, 0xc93b, 0xc93c, 0xc93d, 0xc93e, 0xc93f,
+ 0xc940, 0xc941, 0xc942, 0xc943, 0xc944, 0xc945, 0xc946, 0xc947,
+ 0xc948, 0xc949, 0xc94a, 0xc94b, 0xc94c, 0xc94d, 0xc94e, 0xc94f,
+ 0xc950, 0xc951, 0xc952, 0xc953, 0xc954, 0xc955, 0xc956, 0xc957,
+ 0xc958, 0xc959, 0xc95a, 0xc95b, 0xc95c, 0xc95d, 0xc95e, 0xc95f,
+ 0xc960, 0xc961, 0xc962, 0xc963, 0xc964, 0xc965, 0xc966, 0xc967,
+ 0xc968, 0xc969, 0xc96a, 0xc96b, 0xc96c, 0xc96d, 0xc96e, 0xc96f,
+ 0xc970, 0xc971, 0xc972, 0xc973, 0xc974, 0xc975, 0xc976, 0xc977,
+ 0xc978, 0xc979, 0xc97a, 0xc97b, 0xc97c, 0xc97d, 0xc97e, 0xc97f,
+ 0xc980, 0xc981, 0xc982, 0xc983, 0xc984, 0xc985, 0xc986, 0xc987,
+ 0xc988, 0xc989, 0xc98a, 0xc98b, 0xc98c, 0xc98d, 0xc98e, 0xc98f,
+ 0xc990, 0xc991, 0xc992, 0xc993, 0xc994, 0xc995, 0xc996, 0xc997,
+ 0xc998, 0xc999, 0xc99a, 0xc99b, 0xc99c, 0xc99d, 0xc99e, 0xc99f,
+ 0xc9a0, 0xc9a1, 0xc9a2, 0xc9a3, 0xc9a4, 0xc9a5, 0xc9a6, 0xc9a7,
+ 0xc9a8, 0xc9a9, 0xc9aa, 0xc9ab, 0xc9ac, 0xc9ad, 0xc9ae, 0xc9af,
+ 0xc9b0, 0xc9b1, 0xc9b2, 0xc9b3, 0xc9b4, 0xc9b5, 0xc9b6, 0xc9b7,
+ 0xc9b8, 0xc9b9, 0xc9ba, 0xc9bb, 0xc9bc, 0xc9bd, 0xc9be, 0xc9bf,
+ 0xc9c0, 0xc9c1, 0xc9c2, 0xc9c3, 0xc9c4, 0xc9c5, 0xc9c6, 0xc9c7,
+ 0xc9c8, 0xc9c9, 0xc9ca, 0xc9cb, 0xc9cc, 0xc9cd, 0xc9ce, 0xc9cf,
+ 0xc9d0, 0xc9d1, 0xc9d2, 0xc9d3, 0xc9d4, 0xc9d5, 0xc9d6, 0xc9d7,
+ 0xc9d8, 0xc9d9, 0xc9da, 0xc9db, 0xc9dc, 0xc9dd, 0xc9de, 0xc9df,
+ 0xc9e0, 0xc9e1, 0xc9e2, 0xc9e3, 0xc9e4, 0xc9e5, 0xc9e6, 0xc9e7,
+ 0xc9e8, 0xc9e9, 0xc9ea, 0xc9eb, 0xc9ec, 0xc9ed, 0xc9ee, 0xc9ef,
+ 0xc9f0, 0xc9f1, 0xc9f2, 0xc9f3, 0xc9f4, 0xc9f5, 0xc9f6, 0xc9f7,
+ 0xc9f8, 0xc9f9, 0xc9fa, 0xc9fb, 0xc9fc, 0xc9fd, 0xc9fe, 0xc9ff,
+ 0xca00, 0xca01, 0xca02, 0xca03, 0xca04, 0xca05, 0xca06, 0xca07,
+ 0xca08, 0xca09, 0xca0a, 0xca0b, 0xca0c, 0xca0d, 0xca0e, 0xca0f,
+ 0xca10, 0xca11, 0xca12, 0xca13, 0xca14, 0xca15, 0xca16, 0xca17,
+ 0xca18, 0xca19, 0xca1a, 0xca1b, 0xca1c, 0xca1d, 0xca1e, 0xca1f,
+ 0xca20, 0xca21, 0xca22, 0xca23, 0xca24, 0xca25, 0xca26, 0xca27,
+ 0xca28, 0xca29, 0xca2a, 0xca2b, 0xca2c, 0xca2d, 0xca2e, 0xca2f,
+ 0xca30, 0xca31, 0xca32, 0xca33, 0xca34, 0xca35, 0xca36, 0xca37,
+ 0xca38, 0xca39, 0xca3a, 0xca3b, 0xca3c, 0xca3d, 0xca3e, 0xca3f,
+ 0xca40, 0xca41, 0xca42, 0xca43, 0xca44, 0xca45, 0xca46, 0xca47,
+ 0xca48, 0xca49, 0xca4a, 0xca4b, 0xca4c, 0xca4d, 0xca4e, 0xca4f,
+ 0xca50, 0xca51, 0xca52, 0xca53, 0xca54, 0xca55, 0xca56, 0xca57,
+ 0xca58, 0xca59, 0xca5a, 0xca5b, 0xca5c, 0xca5d, 0xca5e, 0xca5f,
+ 0xca60, 0xca61, 0xca62, 0xca63, 0xca64, 0xca65, 0xca66, 0xca67,
+ 0xca68, 0xca69, 0xca6a, 0xca6b, 0xca6c, 0xca6d, 0xca6e, 0xca6f,
+ 0xca70, 0xca71, 0xca72, 0xca73, 0xca74, 0xca75, 0xca76, 0xca77,
+ 0xca78, 0xca79, 0xca7a, 0xca7b, 0xca7c, 0xca7d, 0xca7e, 0xca7f,
+ 0xca80, 0xca81, 0xca82, 0xca83, 0xca84, 0xca85, 0xca86, 0xca87,
+ 0xca88, 0xca89, 0xca8a, 0xca8b, 0xca8c, 0xca8d, 0xca8e, 0xca8f,
+ 0xca90, 0xca91, 0xca92, 0xca93, 0xca94, 0xca95, 0xca96, 0xca97,
+ 0xca98, 0xca99, 0xca9a, 0xca9b, 0xca9c, 0xca9d, 0xca9e, 0xca9f,
+ 0xcaa0, 0xcaa1, 0xcaa2, 0xcaa3, 0xcaa4, 0xcaa5, 0xcaa6, 0xcaa7,
+ 0xcaa8, 0xcaa9, 0xcaaa, 0xcaab, 0xcaac, 0xcaad, 0xcaae, 0xcaaf,
+ 0xcab0, 0xcab1, 0xcab2, 0xcab3, 0xcab4, 0xcab5, 0xcab6, 0xcab7,
+ 0xcab8, 0xcab9, 0xcaba, 0xcabb, 0xcabc, 0xcabd, 0xcabe, 0xcabf,
+ 0xcac0, 0xcac1, 0xcac2, 0xcac3, 0xcac4, 0xcac5, 0xcac6, 0xcac7,
+ 0xcac8, 0xcac9, 0xcaca, 0xcacb, 0xcacc, 0xcacd, 0xcace, 0xcacf,
+ 0xcad0, 0xcad1, 0xcad2, 0xcad3, 0xcad4, 0xcad5, 0xcad6, 0xcad7,
+ 0xcad8, 0xcad9, 0xcada, 0xcadb, 0xcadc, 0xcadd, 0xcade, 0xcadf,
+ 0xcae0, 0xcae1, 0xcae2, 0xcae3, 0xcae4, 0xcae5, 0xcae6, 0xcae7,
+ 0xcae8, 0xcae9, 0xcaea, 0xcaeb, 0xcaec, 0xcaed, 0xcaee, 0xcaef,
+ 0xcaf0, 0xcaf1, 0xcaf2, 0xcaf3, 0xcaf4, 0xcaf5, 0xcaf6, 0xcaf7,
+ 0xcaf8, 0xcaf9, 0xcafa, 0xcafb, 0xcafc, 0xcafd, 0xcafe, 0xcaff,
+ 0xcb00, 0xcb01, 0xcb02, 0xcb03, 0xcb04, 0xcb05, 0xcb06, 0xcb07,
+ 0xcb08, 0xcb09, 0xcb0a, 0xcb0b, 0xcb0c, 0xcb0d, 0xcb0e, 0xcb0f,
+ 0xcb10, 0xcb11, 0xcb12, 0xcb13, 0xcb14, 0xcb15, 0xcb16, 0xcb17,
+ 0xcb18, 0xcb19, 0xcb1a, 0xcb1b, 0xcb1c, 0xcb1d, 0xcb1e, 0xcb1f,
+ 0xcb20, 0xcb21, 0xcb22, 0xcb23, 0xcb24, 0xcb25, 0xcb26, 0xcb27,
+ 0xcb28, 0xcb29, 0xcb2a, 0xcb2b, 0xcb2c, 0xcb2d, 0xcb2e, 0xcb2f,
+ 0xcb30, 0xcb31, 0xcb32, 0xcb33, 0xcb34, 0xcb35, 0xcb36, 0xcb37,
+ 0xcb38, 0xcb39, 0xcb3a, 0xcb3b, 0xcb3c, 0xcb3d, 0xcb3e, 0xcb3f,
+ 0xcb40, 0xcb41, 0xcb42, 0xcb43, 0xcb44, 0xcb45, 0xcb46, 0xcb47,
+ 0xcb48, 0xcb49, 0xcb4a, 0xcb4b, 0xcb4c, 0xcb4d, 0xcb4e, 0xcb4f,
+ 0xcb50, 0xcb51, 0xcb52, 0xcb53, 0xcb54, 0xcb55, 0xcb56, 0xcb57,
+ 0xcb58, 0xcb59, 0xcb5a, 0xcb5b, 0xcb5c, 0xcb5d, 0xcb5e, 0xcb5f,
+ 0xcb60, 0xcb61, 0xcb62, 0xcb63, 0xcb64, 0xcb65, 0xcb66, 0xcb67,
+ 0xcb68, 0xcb69, 0xcb6a, 0xcb6b, 0xcb6c, 0xcb6d, 0xcb6e, 0xcb6f,
+ 0xcb70, 0xcb71, 0xcb72, 0xcb73, 0xcb74, 0xcb75, 0xcb76, 0xcb77,
+ 0xcb78, 0xcb79, 0xcb7a, 0xcb7b, 0xcb7c, 0xcb7d, 0xcb7e, 0xcb7f,
+ 0xcb80, 0xcb81, 0xcb82, 0xcb83, 0xcb84, 0xcb85, 0xcb86, 0xcb87,
+ 0xcb88, 0xcb89, 0xcb8a, 0xcb8b, 0xcb8c, 0xcb8d, 0xcb8e, 0xcb8f,
+ 0xcb90, 0xcb91, 0xcb92, 0xcb93, 0xcb94, 0xcb95, 0xcb96, 0xcb97,
+ 0xcb98, 0xcb99, 0xcb9a, 0xcb9b, 0xcb9c, 0xcb9d, 0xcb9e, 0xcb9f,
+ 0xcba0, 0xcba1, 0xcba2, 0xcba3, 0xcba4, 0xcba5, 0xcba6, 0xcba7,
+ 0xcba8, 0xcba9, 0xcbaa, 0xcbab, 0xcbac, 0xcbad, 0xcbae, 0xcbaf,
+ 0xcbb0, 0xcbb1, 0xcbb2, 0xcbb3, 0xcbb4, 0xcbb5, 0xcbb6, 0xcbb7,
+ 0xcbb8, 0xcbb9, 0xcbba, 0xcbbb, 0xcbbc, 0xcbbd, 0xcbbe, 0xcbbf,
+ 0xcbc0, 0xcbc1, 0xcbc2, 0xcbc3, 0xcbc4, 0xcbc5, 0xcbc6, 0xcbc7,
+ 0xcbc8, 0xcbc9, 0xcbca, 0xcbcb, 0xcbcc, 0xcbcd, 0xcbce, 0xcbcf,
+ 0xcbd0, 0xcbd1, 0xcbd2, 0xcbd3, 0xcbd4, 0xcbd5, 0xcbd6, 0xcbd7,
+ 0xcbd8, 0xcbd9, 0xcbda, 0xcbdb, 0xcbdc, 0xcbdd, 0xcbde, 0xcbdf,
+ 0xcbe0, 0xcbe1, 0xcbe2, 0xcbe3, 0xcbe4, 0xcbe5, 0xcbe6, 0xcbe7,
+ 0xcbe8, 0xcbe9, 0xcbea, 0xcbeb, 0xcbec, 0xcbed, 0xcbee, 0xcbef,
+ 0xcbf0, 0xcbf1, 0xcbf2, 0xcbf3, 0xcbf4, 0xcbf5, 0xcbf6, 0xcbf7,
+ 0xcbf8, 0xcbf9, 0xcbfa, 0xcbfb, 0xcbfc, 0xcbfd, 0xcbfe, 0xcbff,
+ 0xcc00, 0xcc01, 0xcc02, 0xcc03, 0xcc04, 0xcc05, 0xcc06, 0xcc07,
+ 0xcc08, 0xcc09, 0xcc0a, 0xcc0b, 0xcc0c, 0xcc0d, 0xcc0e, 0xcc0f,
+ 0xcc10, 0xcc11, 0xcc12, 0xcc13, 0xcc14, 0xcc15, 0xcc16, 0xcc17,
+ 0xcc18, 0xcc19, 0xcc1a, 0xcc1b, 0xcc1c, 0xcc1d, 0xcc1e, 0xcc1f,
+ 0xcc20, 0xcc21, 0xcc22, 0xcc23, 0xcc24, 0xcc25, 0xcc26, 0xcc27,
+ 0xcc28, 0xcc29, 0xcc2a, 0xcc2b, 0xcc2c, 0xcc2d, 0xcc2e, 0xcc2f,
+ 0xcc30, 0xcc31, 0xcc32, 0xcc33, 0xcc34, 0xcc35, 0xcc36, 0xcc37,
+ 0xcc38, 0xcc39, 0xcc3a, 0xcc3b, 0xcc3c, 0xcc3d, 0xcc3e, 0xcc3f,
+ 0xcc40, 0xcc41, 0xcc42, 0xcc43, 0xcc44, 0xcc45, 0xcc46, 0xcc47,
+ 0xcc48, 0xcc49, 0xcc4a, 0xcc4b, 0xcc4c, 0xcc4d, 0xcc4e, 0xcc4f,
+ 0xcc50, 0xcc51, 0xcc52, 0xcc53, 0xcc54, 0xcc55, 0xcc56, 0xcc57,
+ 0xcc58, 0xcc59, 0xcc5a, 0xcc5b, 0xcc5c, 0xcc5d, 0xcc5e, 0xcc5f,
+ 0xcc60, 0xcc61, 0xcc62, 0xcc63, 0xcc64, 0xcc65, 0xcc66, 0xcc67,
+ 0xcc68, 0xcc69, 0xcc6a, 0xcc6b, 0xcc6c, 0xcc6d, 0xcc6e, 0xcc6f,
+ 0xcc70, 0xcc71, 0xcc72, 0xcc73, 0xcc74, 0xcc75, 0xcc76, 0xcc77,
+ 0xcc78, 0xcc79, 0xcc7a, 0xcc7b, 0xcc7c, 0xcc7d, 0xcc7e, 0xcc7f,
+ 0xcc80, 0xcc81, 0xcc82, 0xcc83, 0xcc84, 0xcc85, 0xcc86, 0xcc87,
+ 0xcc88, 0xcc89, 0xcc8a, 0xcc8b, 0xcc8c, 0xcc8d, 0xcc8e, 0xcc8f,
+ 0xcc90, 0xcc91, 0xcc92, 0xcc93, 0xcc94, 0xcc95, 0xcc96, 0xcc97,
+ 0xcc98, 0xcc99, 0xcc9a, 0xcc9b, 0xcc9c, 0xcc9d, 0xcc9e, 0xcc9f,
+ 0xcca0, 0xcca1, 0xcca2, 0xcca3, 0xcca4, 0xcca5, 0xcca6, 0xcca7,
+ 0xcca8, 0xcca9, 0xccaa, 0xccab, 0xccac, 0xccad, 0xccae, 0xccaf,
+ 0xccb0, 0xccb1, 0xccb2, 0xccb3, 0xccb4, 0xccb5, 0xccb6, 0xccb7,
+ 0xccb8, 0xccb9, 0xccba, 0xccbb, 0xccbc, 0xccbd, 0xccbe, 0xccbf,
+ 0xccc0, 0xccc1, 0xccc2, 0xccc3, 0xccc4, 0xccc5, 0xccc6, 0xccc7,
+ 0xccc8, 0xccc9, 0xccca, 0xcccb, 0xcccc, 0xcccd, 0xccce, 0xcccf,
+ 0xccd0, 0xccd1, 0xccd2, 0xccd3, 0xccd4, 0xccd5, 0xccd6, 0xccd7,
+ 0xccd8, 0xccd9, 0xccda, 0xccdb, 0xccdc, 0xccdd, 0xccde, 0xccdf,
+ 0xcce0, 0xcce1, 0xcce2, 0xcce3, 0xcce4, 0xcce5, 0xcce6, 0xcce7,
+ 0xcce8, 0xcce9, 0xccea, 0xcceb, 0xccec, 0xcced, 0xccee, 0xccef,
+ 0xccf0, 0xccf1, 0xccf2, 0xccf3, 0xccf4, 0xccf5, 0xccf6, 0xccf7,
+ 0xccf8, 0xccf9, 0xccfa, 0xccfb, 0xccfc, 0xccfd, 0xccfe, 0xccff,
+ 0xcd00, 0xcd01, 0xcd02, 0xcd03, 0xcd04, 0xcd05, 0xcd06, 0xcd07,
+ 0xcd08, 0xcd09, 0xcd0a, 0xcd0b, 0xcd0c, 0xcd0d, 0xcd0e, 0xcd0f,
+ 0xcd10, 0xcd11, 0xcd12, 0xcd13, 0xcd14, 0xcd15, 0xcd16, 0xcd17,
+ 0xcd18, 0xcd19, 0xcd1a, 0xcd1b, 0xcd1c, 0xcd1d, 0xcd1e, 0xcd1f,
+ 0xcd20, 0xcd21, 0xcd22, 0xcd23, 0xcd24, 0xcd25, 0xcd26, 0xcd27,
+ 0xcd28, 0xcd29, 0xcd2a, 0xcd2b, 0xcd2c, 0xcd2d, 0xcd2e, 0xcd2f,
+ 0xcd30, 0xcd31, 0xcd32, 0xcd33, 0xcd34, 0xcd35, 0xcd36, 0xcd37,
+ 0xcd38, 0xcd39, 0xcd3a, 0xcd3b, 0xcd3c, 0xcd3d, 0xcd3e, 0xcd3f,
+ 0xcd40, 0xcd41, 0xcd42, 0xcd43, 0xcd44, 0xcd45, 0xcd46, 0xcd47,
+ 0xcd48, 0xcd49, 0xcd4a, 0xcd4b, 0xcd4c, 0xcd4d, 0xcd4e, 0xcd4f,
+ 0xcd50, 0xcd51, 0xcd52, 0xcd53, 0xcd54, 0xcd55, 0xcd56, 0xcd57,
+ 0xcd58, 0xcd59, 0xcd5a, 0xcd5b, 0xcd5c, 0xcd5d, 0xcd5e, 0xcd5f,
+ 0xcd60, 0xcd61, 0xcd62, 0xcd63, 0xcd64, 0xcd65, 0xcd66, 0xcd67,
+ 0xcd68, 0xcd69, 0xcd6a, 0xcd6b, 0xcd6c, 0xcd6d, 0xcd6e, 0xcd6f,
+ 0xcd70, 0xcd71, 0xcd72, 0xcd73, 0xcd74, 0xcd75, 0xcd76, 0xcd77,
+ 0xcd78, 0xcd79, 0xcd7a, 0xcd7b, 0xcd7c, 0xcd7d, 0xcd7e, 0xcd7f,
+ 0xcd80, 0xcd81, 0xcd82, 0xcd83, 0xcd84, 0xcd85, 0xcd86, 0xcd87,
+ 0xcd88, 0xcd89, 0xcd8a, 0xcd8b, 0xcd8c, 0xcd8d, 0xcd8e, 0xcd8f,
+ 0xcd90, 0xcd91, 0xcd92, 0xcd93, 0xcd94, 0xcd95, 0xcd96, 0xcd97,
+ 0xcd98, 0xcd99, 0xcd9a, 0xcd9b, 0xcd9c, 0xcd9d, 0xcd9e, 0xcd9f,
+ 0xcda0, 0xcda1, 0xcda2, 0xcda3, 0xcda4, 0xcda5, 0xcda6, 0xcda7,
+ 0xcda8, 0xcda9, 0xcdaa, 0xcdab, 0xcdac, 0xcdad, 0xcdae, 0xcdaf,
+ 0xcdb0, 0xcdb1, 0xcdb2, 0xcdb3, 0xcdb4, 0xcdb5, 0xcdb6, 0xcdb7,
+ 0xcdb8, 0xcdb9, 0xcdba, 0xcdbb, 0xcdbc, 0xcdbd, 0xcdbe, 0xcdbf,
+ 0xcdc0, 0xcdc1, 0xcdc2, 0xcdc3, 0xcdc4, 0xcdc5, 0xcdc6, 0xcdc7,
+ 0xcdc8, 0xcdc9, 0xcdca, 0xcdcb, 0xcdcc, 0xcdcd, 0xcdce, 0xcdcf,
+ 0xcdd0, 0xcdd1, 0xcdd2, 0xcdd3, 0xcdd4, 0xcdd5, 0xcdd6, 0xcdd7,
+ 0xcdd8, 0xcdd9, 0xcdda, 0xcddb, 0xcddc, 0xcddd, 0xcdde, 0xcddf,
+ 0xcde0, 0xcde1, 0xcde2, 0xcde3, 0xcde4, 0xcde5, 0xcde6, 0xcde7,
+ 0xcde8, 0xcde9, 0xcdea, 0xcdeb, 0xcdec, 0xcded, 0xcdee, 0xcdef,
+ 0xcdf0, 0xcdf1, 0xcdf2, 0xcdf3, 0xcdf4, 0xcdf5, 0xcdf6, 0xcdf7,
+ 0xcdf8, 0xcdf9, 0xcdfa, 0xcdfb, 0xcdfc, 0xcdfd, 0xcdfe, 0xcdff,
+ 0xce00, 0xce01, 0xce02, 0xce03, 0xce04, 0xce05, 0xce06, 0xce07,
+ 0xce08, 0xce09, 0xce0a, 0xce0b, 0xce0c, 0xce0d, 0xce0e, 0xce0f,
+ 0xce10, 0xce11, 0xce12, 0xce13, 0xce14, 0xce15, 0xce16, 0xce17,
+ 0xce18, 0xce19, 0xce1a, 0xce1b, 0xce1c, 0xce1d, 0xce1e, 0xce1f,
+ 0xce20, 0xce21, 0xce22, 0xce23, 0xce24, 0xce25, 0xce26, 0xce27,
+ 0xce28, 0xce29, 0xce2a, 0xce2b, 0xce2c, 0xce2d, 0xce2e, 0xce2f,
+ 0xce30, 0xce31, 0xce32, 0xce33, 0xce34, 0xce35, 0xce36, 0xce37,
+ 0xce38, 0xce39, 0xce3a, 0xce3b, 0xce3c, 0xce3d, 0xce3e, 0xce3f,
+ 0xce40, 0xce41, 0xce42, 0xce43, 0xce44, 0xce45, 0xce46, 0xce47,
+ 0xce48, 0xce49, 0xce4a, 0xce4b, 0xce4c, 0xce4d, 0xce4e, 0xce4f,
+ 0xce50, 0xce51, 0xce52, 0xce53, 0xce54, 0xce55, 0xce56, 0xce57,
+ 0xce58, 0xce59, 0xce5a, 0xce5b, 0xce5c, 0xce5d, 0xce5e, 0xce5f,
+ 0xce60, 0xce61, 0xce62, 0xce63, 0xce64, 0xce65, 0xce66, 0xce67,
+ 0xce68, 0xce69, 0xce6a, 0xce6b, 0xce6c, 0xce6d, 0xce6e, 0xce6f,
+ 0xce70, 0xce71, 0xce72, 0xce73, 0xce74, 0xce75, 0xce76, 0xce77,
+ 0xce78, 0xce79, 0xce7a, 0xce7b, 0xce7c, 0xce7d, 0xce7e, 0xce7f,
+ 0xce80, 0xce81, 0xce82, 0xce83, 0xce84, 0xce85, 0xce86, 0xce87,
+ 0xce88, 0xce89, 0xce8a, 0xce8b, 0xce8c, 0xce8d, 0xce8e, 0xce8f,
+ 0xce90, 0xce91, 0xce92, 0xce93, 0xce94, 0xce95, 0xce96, 0xce97,
+ 0xce98, 0xce99, 0xce9a, 0xce9b, 0xce9c, 0xce9d, 0xce9e, 0xce9f,
+ 0xcea0, 0xcea1, 0xcea2, 0xcea3, 0xcea4, 0xcea5, 0xcea6, 0xcea7,
+ 0xcea8, 0xcea9, 0xceaa, 0xceab, 0xceac, 0xcead, 0xceae, 0xceaf,
+ 0xceb0, 0xceb1, 0xceb2, 0xceb3, 0xceb4, 0xceb5, 0xceb6, 0xceb7,
+ 0xceb8, 0xceb9, 0xceba, 0xcebb, 0xcebc, 0xcebd, 0xcebe, 0xcebf,
+ 0xcec0, 0xcec1, 0xcec2, 0xcec3, 0xcec4, 0xcec5, 0xcec6, 0xcec7,
+ 0xcec8, 0xcec9, 0xceca, 0xcecb, 0xcecc, 0xcecd, 0xcece, 0xcecf,
+ 0xced0, 0xced1, 0xced2, 0xced3, 0xced4, 0xced5, 0xced6, 0xced7,
+ 0xced8, 0xced9, 0xceda, 0xcedb, 0xcedc, 0xcedd, 0xcede, 0xcedf,
+ 0xcee0, 0xcee1, 0xcee2, 0xcee3, 0xcee4, 0xcee5, 0xcee6, 0xcee7,
+ 0xcee8, 0xcee9, 0xceea, 0xceeb, 0xceec, 0xceed, 0xceee, 0xceef,
+ 0xcef0, 0xcef1, 0xcef2, 0xcef3, 0xcef4, 0xcef5, 0xcef6, 0xcef7,
+ 0xcef8, 0xcef9, 0xcefa, 0xcefb, 0xcefc, 0xcefd, 0xcefe, 0xceff,
+ 0xcf00, 0xcf01, 0xcf02, 0xcf03, 0xcf04, 0xcf05, 0xcf06, 0xcf07,
+ 0xcf08, 0xcf09, 0xcf0a, 0xcf0b, 0xcf0c, 0xcf0d, 0xcf0e, 0xcf0f,
+ 0xcf10, 0xcf11, 0xcf12, 0xcf13, 0xcf14, 0xcf15, 0xcf16, 0xcf17,
+ 0xcf18, 0xcf19, 0xcf1a, 0xcf1b, 0xcf1c, 0xcf1d, 0xcf1e, 0xcf1f,
+ 0xcf20, 0xcf21, 0xcf22, 0xcf23, 0xcf24, 0xcf25, 0xcf26, 0xcf27,
+ 0xcf28, 0xcf29, 0xcf2a, 0xcf2b, 0xcf2c, 0xcf2d, 0xcf2e, 0xcf2f,
+ 0xcf30, 0xcf31, 0xcf32, 0xcf33, 0xcf34, 0xcf35, 0xcf36, 0xcf37,
+ 0xcf38, 0xcf39, 0xcf3a, 0xcf3b, 0xcf3c, 0xcf3d, 0xcf3e, 0xcf3f,
+ 0xcf40, 0xcf41, 0xcf42, 0xcf43, 0xcf44, 0xcf45, 0xcf46, 0xcf47,
+ 0xcf48, 0xcf49, 0xcf4a, 0xcf4b, 0xcf4c, 0xcf4d, 0xcf4e, 0xcf4f,
+ 0xcf50, 0xcf51, 0xcf52, 0xcf53, 0xcf54, 0xcf55, 0xcf56, 0xcf57,
+ 0xcf58, 0xcf59, 0xcf5a, 0xcf5b, 0xcf5c, 0xcf5d, 0xcf5e, 0xcf5f,
+ 0xcf60, 0xcf61, 0xcf62, 0xcf63, 0xcf64, 0xcf65, 0xcf66, 0xcf67,
+ 0xcf68, 0xcf69, 0xcf6a, 0xcf6b, 0xcf6c, 0xcf6d, 0xcf6e, 0xcf6f,
+ 0xcf70, 0xcf71, 0xcf72, 0xcf73, 0xcf74, 0xcf75, 0xcf76, 0xcf77,
+ 0xcf78, 0xcf79, 0xcf7a, 0xcf7b, 0xcf7c, 0xcf7d, 0xcf7e, 0xcf7f,
+ 0xcf80, 0xcf81, 0xcf82, 0xcf83, 0xcf84, 0xcf85, 0xcf86, 0xcf87,
+ 0xcf88, 0xcf89, 0xcf8a, 0xcf8b, 0xcf8c, 0xcf8d, 0xcf8e, 0xcf8f,
+ 0xcf90, 0xcf91, 0xcf92, 0xcf93, 0xcf94, 0xcf95, 0xcf96, 0xcf97,
+ 0xcf98, 0xcf99, 0xcf9a, 0xcf9b, 0xcf9c, 0xcf9d, 0xcf9e, 0xcf9f,
+ 0xcfa0, 0xcfa1, 0xcfa2, 0xcfa3, 0xcfa4, 0xcfa5, 0xcfa6, 0xcfa7,
+ 0xcfa8, 0xcfa9, 0xcfaa, 0xcfab, 0xcfac, 0xcfad, 0xcfae, 0xcfaf,
+ 0xcfb0, 0xcfb1, 0xcfb2, 0xcfb3, 0xcfb4, 0xcfb5, 0xcfb6, 0xcfb7,
+ 0xcfb8, 0xcfb9, 0xcfba, 0xcfbb, 0xcfbc, 0xcfbd, 0xcfbe, 0xcfbf,
+ 0xcfc0, 0xcfc1, 0xcfc2, 0xcfc3, 0xcfc4, 0xcfc5, 0xcfc6, 0xcfc7,
+ 0xcfc8, 0xcfc9, 0xcfca, 0xcfcb, 0xcfcc, 0xcfcd, 0xcfce, 0xcfcf,
+ 0xcfd0, 0xcfd1, 0xcfd2, 0xcfd3, 0xcfd4, 0xcfd5, 0xcfd6, 0xcfd7,
+ 0xcfd8, 0xcfd9, 0xcfda, 0xcfdb, 0xcfdc, 0xcfdd, 0xcfde, 0xcfdf,
+ 0xcfe0, 0xcfe1, 0xcfe2, 0xcfe3, 0xcfe4, 0xcfe5, 0xcfe6, 0xcfe7,
+ 0xcfe8, 0xcfe9, 0xcfea, 0xcfeb, 0xcfec, 0xcfed, 0xcfee, 0xcfef,
+ 0xcff0, 0xcff1, 0xcff2, 0xcff3, 0xcff4, 0xcff5, 0xcff6, 0xcff7,
+ 0xcff8, 0xcff9, 0xcffa, 0xcffb, 0xcffc, 0xcffd, 0xcffe, 0xcfff,
+ 0xd000, 0xd001, 0xd002, 0xd003, 0xd004, 0xd005, 0xd006, 0xd007,
+ 0xd008, 0xd009, 0xd00a, 0xd00b, 0xd00c, 0xd00d, 0xd00e, 0xd00f,
+ 0xd010, 0xd011, 0xd012, 0xd013, 0xd014, 0xd015, 0xd016, 0xd017,
+ 0xd018, 0xd019, 0xd01a, 0xd01b, 0xd01c, 0xd01d, 0xd01e, 0xd01f,
+ 0xd020, 0xd021, 0xd022, 0xd023, 0xd024, 0xd025, 0xd026, 0xd027,
+ 0xd028, 0xd029, 0xd02a, 0xd02b, 0xd02c, 0xd02d, 0xd02e, 0xd02f,
+ 0xd030, 0xd031, 0xd032, 0xd033, 0xd034, 0xd035, 0xd036, 0xd037,
+ 0xd038, 0xd039, 0xd03a, 0xd03b, 0xd03c, 0xd03d, 0xd03e, 0xd03f,
+ 0xd040, 0xd041, 0xd042, 0xd043, 0xd044, 0xd045, 0xd046, 0xd047,
+ 0xd048, 0xd049, 0xd04a, 0xd04b, 0xd04c, 0xd04d, 0xd04e, 0xd04f,
+ 0xd050, 0xd051, 0xd052, 0xd053, 0xd054, 0xd055, 0xd056, 0xd057,
+ 0xd058, 0xd059, 0xd05a, 0xd05b, 0xd05c, 0xd05d, 0xd05e, 0xd05f,
+ 0xd060, 0xd061, 0xd062, 0xd063, 0xd064, 0xd065, 0xd066, 0xd067,
+ 0xd068, 0xd069, 0xd06a, 0xd06b, 0xd06c, 0xd06d, 0xd06e, 0xd06f,
+ 0xd070, 0xd071, 0xd072, 0xd073, 0xd074, 0xd075, 0xd076, 0xd077,
+ 0xd078, 0xd079, 0xd07a, 0xd07b, 0xd07c, 0xd07d, 0xd07e, 0xd07f,
+ 0xd080, 0xd081, 0xd082, 0xd083, 0xd084, 0xd085, 0xd086, 0xd087,
+ 0xd088, 0xd089, 0xd08a, 0xd08b, 0xd08c, 0xd08d, 0xd08e, 0xd08f,
+ 0xd090, 0xd091, 0xd092, 0xd093, 0xd094, 0xd095, 0xd096, 0xd097,
+ 0xd098, 0xd099, 0xd09a, 0xd09b, 0xd09c, 0xd09d, 0xd09e, 0xd09f,
+ 0xd0a0, 0xd0a1, 0xd0a2, 0xd0a3, 0xd0a4, 0xd0a5, 0xd0a6, 0xd0a7,
+ 0xd0a8, 0xd0a9, 0xd0aa, 0xd0ab, 0xd0ac, 0xd0ad, 0xd0ae, 0xd0af,
+ 0xd0b0, 0xd0b1, 0xd0b2, 0xd0b3, 0xd0b4, 0xd0b5, 0xd0b6, 0xd0b7,
+ 0xd0b8, 0xd0b9, 0xd0ba, 0xd0bb, 0xd0bc, 0xd0bd, 0xd0be, 0xd0bf,
+ 0xd0c0, 0xd0c1, 0xd0c2, 0xd0c3, 0xd0c4, 0xd0c5, 0xd0c6, 0xd0c7,
+ 0xd0c8, 0xd0c9, 0xd0ca, 0xd0cb, 0xd0cc, 0xd0cd, 0xd0ce, 0xd0cf,
+ 0xd0d0, 0xd0d1, 0xd0d2, 0xd0d3, 0xd0d4, 0xd0d5, 0xd0d6, 0xd0d7,
+ 0xd0d8, 0xd0d9, 0xd0da, 0xd0db, 0xd0dc, 0xd0dd, 0xd0de, 0xd0df,
+ 0xd0e0, 0xd0e1, 0xd0e2, 0xd0e3, 0xd0e4, 0xd0e5, 0xd0e6, 0xd0e7,
+ 0xd0e8, 0xd0e9, 0xd0ea, 0xd0eb, 0xd0ec, 0xd0ed, 0xd0ee, 0xd0ef,
+ 0xd0f0, 0xd0f1, 0xd0f2, 0xd0f3, 0xd0f4, 0xd0f5, 0xd0f6, 0xd0f7,
+ 0xd0f8, 0xd0f9, 0xd0fa, 0xd0fb, 0xd0fc, 0xd0fd, 0xd0fe, 0xd0ff,
+ 0xd100, 0xd101, 0xd102, 0xd103, 0xd104, 0xd105, 0xd106, 0xd107,
+ 0xd108, 0xd109, 0xd10a, 0xd10b, 0xd10c, 0xd10d, 0xd10e, 0xd10f,
+ 0xd110, 0xd111, 0xd112, 0xd113, 0xd114, 0xd115, 0xd116, 0xd117,
+ 0xd118, 0xd119, 0xd11a, 0xd11b, 0xd11c, 0xd11d, 0xd11e, 0xd11f,
+ 0xd120, 0xd121, 0xd122, 0xd123, 0xd124, 0xd125, 0xd126, 0xd127,
+ 0xd128, 0xd129, 0xd12a, 0xd12b, 0xd12c, 0xd12d, 0xd12e, 0xd12f,
+ 0xd130, 0xd131, 0xd132, 0xd133, 0xd134, 0xd135, 0xd136, 0xd137,
+ 0xd138, 0xd139, 0xd13a, 0xd13b, 0xd13c, 0xd13d, 0xd13e, 0xd13f,
+ 0xd140, 0xd141, 0xd142, 0xd143, 0xd144, 0xd145, 0xd146, 0xd147,
+ 0xd148, 0xd149, 0xd14a, 0xd14b, 0xd14c, 0xd14d, 0xd14e, 0xd14f,
+ 0xd150, 0xd151, 0xd152, 0xd153, 0xd154, 0xd155, 0xd156, 0xd157,
+ 0xd158, 0xd159, 0xd15a, 0xd15b, 0xd15c, 0xd15d, 0xd15e, 0xd15f,
+ 0xd160, 0xd161, 0xd162, 0xd163, 0xd164, 0xd165, 0xd166, 0xd167,
+ 0xd168, 0xd169, 0xd16a, 0xd16b, 0xd16c, 0xd16d, 0xd16e, 0xd16f,
+ 0xd170, 0xd171, 0xd172, 0xd173, 0xd174, 0xd175, 0xd176, 0xd177,
+ 0xd178, 0xd179, 0xd17a, 0xd17b, 0xd17c, 0xd17d, 0xd17e, 0xd17f,
+ 0xd180, 0xd181, 0xd182, 0xd183, 0xd184, 0xd185, 0xd186, 0xd187,
+ 0xd188, 0xd189, 0xd18a, 0xd18b, 0xd18c, 0xd18d, 0xd18e, 0xd18f,
+ 0xd190, 0xd191, 0xd192, 0xd193, 0xd194, 0xd195, 0xd196, 0xd197,
+ 0xd198, 0xd199, 0xd19a, 0xd19b, 0xd19c, 0xd19d, 0xd19e, 0xd19f,
+ 0xd1a0, 0xd1a1, 0xd1a2, 0xd1a3, 0xd1a4, 0xd1a5, 0xd1a6, 0xd1a7,
+ 0xd1a8, 0xd1a9, 0xd1aa, 0xd1ab, 0xd1ac, 0xd1ad, 0xd1ae, 0xd1af,
+ 0xd1b0, 0xd1b1, 0xd1b2, 0xd1b3, 0xd1b4, 0xd1b5, 0xd1b6, 0xd1b7,
+ 0xd1b8, 0xd1b9, 0xd1ba, 0xd1bb, 0xd1bc, 0xd1bd, 0xd1be, 0xd1bf,
+ 0xd1c0, 0xd1c1, 0xd1c2, 0xd1c3, 0xd1c4, 0xd1c5, 0xd1c6, 0xd1c7,
+ 0xd1c8, 0xd1c9, 0xd1ca, 0xd1cb, 0xd1cc, 0xd1cd, 0xd1ce, 0xd1cf,
+ 0xd1d0, 0xd1d1, 0xd1d2, 0xd1d3, 0xd1d4, 0xd1d5, 0xd1d6, 0xd1d7,
+ 0xd1d8, 0xd1d9, 0xd1da, 0xd1db, 0xd1dc, 0xd1dd, 0xd1de, 0xd1df,
+ 0xd1e0, 0xd1e1, 0xd1e2, 0xd1e3, 0xd1e4, 0xd1e5, 0xd1e6, 0xd1e7,
+ 0xd1e8, 0xd1e9, 0xd1ea, 0xd1eb, 0xd1ec, 0xd1ed, 0xd1ee, 0xd1ef,
+ 0xd1f0, 0xd1f1, 0xd1f2, 0xd1f3, 0xd1f4, 0xd1f5, 0xd1f6, 0xd1f7,
+ 0xd1f8, 0xd1f9, 0xd1fa, 0xd1fb, 0xd1fc, 0xd1fd, 0xd1fe, 0xd1ff,
+ 0xd200, 0xd201, 0xd202, 0xd203, 0xd204, 0xd205, 0xd206, 0xd207,
+ 0xd208, 0xd209, 0xd20a, 0xd20b, 0xd20c, 0xd20d, 0xd20e, 0xd20f,
+ 0xd210, 0xd211, 0xd212, 0xd213, 0xd214, 0xd215, 0xd216, 0xd217,
+ 0xd218, 0xd219, 0xd21a, 0xd21b, 0xd21c, 0xd21d, 0xd21e, 0xd21f,
+ 0xd220, 0xd221, 0xd222, 0xd223, 0xd224, 0xd225, 0xd226, 0xd227,
+ 0xd228, 0xd229, 0xd22a, 0xd22b, 0xd22c, 0xd22d, 0xd22e, 0xd22f,
+ 0xd230, 0xd231, 0xd232, 0xd233, 0xd234, 0xd235, 0xd236, 0xd237,
+ 0xd238, 0xd239, 0xd23a, 0xd23b, 0xd23c, 0xd23d, 0xd23e, 0xd23f,
+ 0xd240, 0xd241, 0xd242, 0xd243, 0xd244, 0xd245, 0xd246, 0xd247,
+ 0xd248, 0xd249, 0xd24a, 0xd24b, 0xd24c, 0xd24d, 0xd24e, 0xd24f,
+ 0xd250, 0xd251, 0xd252, 0xd253, 0xd254, 0xd255, 0xd256, 0xd257,
+ 0xd258, 0xd259, 0xd25a, 0xd25b, 0xd25c, 0xd25d, 0xd25e, 0xd25f,
+ 0xd260, 0xd261, 0xd262, 0xd263, 0xd264, 0xd265, 0xd266, 0xd267,
+ 0xd268, 0xd269, 0xd26a, 0xd26b, 0xd26c, 0xd26d, 0xd26e, 0xd26f,
+ 0xd270, 0xd271, 0xd272, 0xd273, 0xd274, 0xd275, 0xd276, 0xd277,
+ 0xd278, 0xd279, 0xd27a, 0xd27b, 0xd27c, 0xd27d, 0xd27e, 0xd27f,
+ 0xd280, 0xd281, 0xd282, 0xd283, 0xd284, 0xd285, 0xd286, 0xd287,
+ 0xd288, 0xd289, 0xd28a, 0xd28b, 0xd28c, 0xd28d, 0xd28e, 0xd28f,
+ 0xd290, 0xd291, 0xd292, 0xd293, 0xd294, 0xd295, 0xd296, 0xd297,
+ 0xd298, 0xd299, 0xd29a, 0xd29b, 0xd29c, 0xd29d, 0xd29e, 0xd29f,
+ 0xd2a0, 0xd2a1, 0xd2a2, 0xd2a3, 0xd2a4, 0xd2a5, 0xd2a6, 0xd2a7,
+ 0xd2a8, 0xd2a9, 0xd2aa, 0xd2ab, 0xd2ac, 0xd2ad, 0xd2ae, 0xd2af,
+ 0xd2b0, 0xd2b1, 0xd2b2, 0xd2b3, 0xd2b4, 0xd2b5, 0xd2b6, 0xd2b7,
+ 0xd2b8, 0xd2b9, 0xd2ba, 0xd2bb, 0xd2bc, 0xd2bd, 0xd2be, 0xd2bf,
+ 0xd2c0, 0xd2c1, 0xd2c2, 0xd2c3, 0xd2c4, 0xd2c5, 0xd2c6, 0xd2c7,
+ 0xd2c8, 0xd2c9, 0xd2ca, 0xd2cb, 0xd2cc, 0xd2cd, 0xd2ce, 0xd2cf,
+ 0xd2d0, 0xd2d1, 0xd2d2, 0xd2d3, 0xd2d4, 0xd2d5, 0xd2d6, 0xd2d7,
+ 0xd2d8, 0xd2d9, 0xd2da, 0xd2db, 0xd2dc, 0xd2dd, 0xd2de, 0xd2df,
+ 0xd2e0, 0xd2e1, 0xd2e2, 0xd2e3, 0xd2e4, 0xd2e5, 0xd2e6, 0xd2e7,
+ 0xd2e8, 0xd2e9, 0xd2ea, 0xd2eb, 0xd2ec, 0xd2ed, 0xd2ee, 0xd2ef,
+ 0xd2f0, 0xd2f1, 0xd2f2, 0xd2f3, 0xd2f4, 0xd2f5, 0xd2f6, 0xd2f7,
+ 0xd2f8, 0xd2f9, 0xd2fa, 0xd2fb, 0xd2fc, 0xd2fd, 0xd2fe, 0xd2ff,
+ 0xd300, 0xd301, 0xd302, 0xd303, 0xd304, 0xd305, 0xd306, 0xd307,
+ 0xd308, 0xd309, 0xd30a, 0xd30b, 0xd30c, 0xd30d, 0xd30e, 0xd30f,
+ 0xd310, 0xd311, 0xd312, 0xd313, 0xd314, 0xd315, 0xd316, 0xd317,
+ 0xd318, 0xd319, 0xd31a, 0xd31b, 0xd31c, 0xd31d, 0xd31e, 0xd31f,
+ 0xd320, 0xd321, 0xd322, 0xd323, 0xd324, 0xd325, 0xd326, 0xd327,
+ 0xd328, 0xd329, 0xd32a, 0xd32b, 0xd32c, 0xd32d, 0xd32e, 0xd32f,
+ 0xd330, 0xd331, 0xd332, 0xd333, 0xd334, 0xd335, 0xd336, 0xd337,
+ 0xd338, 0xd339, 0xd33a, 0xd33b, 0xd33c, 0xd33d, 0xd33e, 0xd33f,
+ 0xd340, 0xd341, 0xd342, 0xd343, 0xd344, 0xd345, 0xd346, 0xd347,
+ 0xd348, 0xd349, 0xd34a, 0xd34b, 0xd34c, 0xd34d, 0xd34e, 0xd34f,
+ 0xd350, 0xd351, 0xd352, 0xd353, 0xd354, 0xd355, 0xd356, 0xd357,
+ 0xd358, 0xd359, 0xd35a, 0xd35b, 0xd35c, 0xd35d, 0xd35e, 0xd35f,
+ 0xd360, 0xd361, 0xd362, 0xd363, 0xd364, 0xd365, 0xd366, 0xd367,
+ 0xd368, 0xd369, 0xd36a, 0xd36b, 0xd36c, 0xd36d, 0xd36e, 0xd36f,
+ 0xd370, 0xd371, 0xd372, 0xd373, 0xd374, 0xd375, 0xd376, 0xd377,
+ 0xd378, 0xd379, 0xd37a, 0xd37b, 0xd37c, 0xd37d, 0xd37e, 0xd37f,
+ 0xd380, 0xd381, 0xd382, 0xd383, 0xd384, 0xd385, 0xd386, 0xd387,
+ 0xd388, 0xd389, 0xd38a, 0xd38b, 0xd38c, 0xd38d, 0xd38e, 0xd38f,
+ 0xd390, 0xd391, 0xd392, 0xd393, 0xd394, 0xd395, 0xd396, 0xd397,
+ 0xd398, 0xd399, 0xd39a, 0xd39b, 0xd39c, 0xd39d, 0xd39e, 0xd39f,
+ 0xd3a0, 0xd3a1, 0xd3a2, 0xd3a3, 0xd3a4, 0xd3a5, 0xd3a6, 0xd3a7,
+ 0xd3a8, 0xd3a9, 0xd3aa, 0xd3ab, 0xd3ac, 0xd3ad, 0xd3ae, 0xd3af,
+ 0xd3b0, 0xd3b1, 0xd3b2, 0xd3b3, 0xd3b4, 0xd3b5, 0xd3b6, 0xd3b7,
+ 0xd3b8, 0xd3b9, 0xd3ba, 0xd3bb, 0xd3bc, 0xd3bd, 0xd3be, 0xd3bf,
+ 0xd3c0, 0xd3c1, 0xd3c2, 0xd3c3, 0xd3c4, 0xd3c5, 0xd3c6, 0xd3c7,
+ 0xd3c8, 0xd3c9, 0xd3ca, 0xd3cb, 0xd3cc, 0xd3cd, 0xd3ce, 0xd3cf,
+ 0xd3d0, 0xd3d1, 0xd3d2, 0xd3d3, 0xd3d4, 0xd3d5, 0xd3d6, 0xd3d7,
+ 0xd3d8, 0xd3d9, 0xd3da, 0xd3db, 0xd3dc, 0xd3dd, 0xd3de, 0xd3df,
+ 0xd3e0, 0xd3e1, 0xd3e2, 0xd3e3, 0xd3e4, 0xd3e5, 0xd3e6, 0xd3e7,
+ 0xd3e8, 0xd3e9, 0xd3ea, 0xd3eb, 0xd3ec, 0xd3ed, 0xd3ee, 0xd3ef,
+ 0xd3f0, 0xd3f1, 0xd3f2, 0xd3f3, 0xd3f4, 0xd3f5, 0xd3f6, 0xd3f7,
+ 0xd3f8, 0xd3f9, 0xd3fa, 0xd3fb, 0xd3fc, 0xd3fd, 0xd3fe, 0xd3ff,
+ 0xd400, 0xd401, 0xd402, 0xd403, 0xd404, 0xd405, 0xd406, 0xd407,
+ 0xd408, 0xd409, 0xd40a, 0xd40b, 0xd40c, 0xd40d, 0xd40e, 0xd40f,
+ 0xd410, 0xd411, 0xd412, 0xd413, 0xd414, 0xd415, 0xd416, 0xd417,
+ 0xd418, 0xd419, 0xd41a, 0xd41b, 0xd41c, 0xd41d, 0xd41e, 0xd41f,
+ 0xd420, 0xd421, 0xd422, 0xd423, 0xd424, 0xd425, 0xd426, 0xd427,
+ 0xd428, 0xd429, 0xd42a, 0xd42b, 0xd42c, 0xd42d, 0xd42e, 0xd42f,
+ 0xd430, 0xd431, 0xd432, 0xd433, 0xd434, 0xd435, 0xd436, 0xd437,
+ 0xd438, 0xd439, 0xd43a, 0xd43b, 0xd43c, 0xd43d, 0xd43e, 0xd43f,
+ 0xd440, 0xd441, 0xd442, 0xd443, 0xd444, 0xd445, 0xd446, 0xd447,
+ 0xd448, 0xd449, 0xd44a, 0xd44b, 0xd44c, 0xd44d, 0xd44e, 0xd44f,
+ 0xd450, 0xd451, 0xd452, 0xd453, 0xd454, 0xd455, 0xd456, 0xd457,
+ 0xd458, 0xd459, 0xd45a, 0xd45b, 0xd45c, 0xd45d, 0xd45e, 0xd45f,
+ 0xd460, 0xd461, 0xd462, 0xd463, 0xd464, 0xd465, 0xd466, 0xd467,
+ 0xd468, 0xd469, 0xd46a, 0xd46b, 0xd46c, 0xd46d, 0xd46e, 0xd46f,
+ 0xd470, 0xd471, 0xd472, 0xd473, 0xd474, 0xd475, 0xd476, 0xd477,
+ 0xd478, 0xd479, 0xd47a, 0xd47b, 0xd47c, 0xd47d, 0xd47e, 0xd47f,
+ 0xd480, 0xd481, 0xd482, 0xd483, 0xd484, 0xd485, 0xd486, 0xd487,
+ 0xd488, 0xd489, 0xd48a, 0xd48b, 0xd48c, 0xd48d, 0xd48e, 0xd48f,
+ 0xd490, 0xd491, 0xd492, 0xd493, 0xd494, 0xd495, 0xd496, 0xd497,
+ 0xd498, 0xd499, 0xd49a, 0xd49b, 0xd49c, 0xd49d, 0xd49e, 0xd49f,
+ 0xd4a0, 0xd4a1, 0xd4a2, 0xd4a3, 0xd4a4, 0xd4a5, 0xd4a6, 0xd4a7,
+ 0xd4a8, 0xd4a9, 0xd4aa, 0xd4ab, 0xd4ac, 0xd4ad, 0xd4ae, 0xd4af,
+ 0xd4b0, 0xd4b1, 0xd4b2, 0xd4b3, 0xd4b4, 0xd4b5, 0xd4b6, 0xd4b7,
+ 0xd4b8, 0xd4b9, 0xd4ba, 0xd4bb, 0xd4bc, 0xd4bd, 0xd4be, 0xd4bf,
+ 0xd4c0, 0xd4c1, 0xd4c2, 0xd4c3, 0xd4c4, 0xd4c5, 0xd4c6, 0xd4c7,
+ 0xd4c8, 0xd4c9, 0xd4ca, 0xd4cb, 0xd4cc, 0xd4cd, 0xd4ce, 0xd4cf,
+ 0xd4d0, 0xd4d1, 0xd4d2, 0xd4d3, 0xd4d4, 0xd4d5, 0xd4d6, 0xd4d7,
+ 0xd4d8, 0xd4d9, 0xd4da, 0xd4db, 0xd4dc, 0xd4dd, 0xd4de, 0xd4df,
+ 0xd4e0, 0xd4e1, 0xd4e2, 0xd4e3, 0xd4e4, 0xd4e5, 0xd4e6, 0xd4e7,
+ 0xd4e8, 0xd4e9, 0xd4ea, 0xd4eb, 0xd4ec, 0xd4ed, 0xd4ee, 0xd4ef,
+ 0xd4f0, 0xd4f1, 0xd4f2, 0xd4f3, 0xd4f4, 0xd4f5, 0xd4f6, 0xd4f7,
+ 0xd4f8, 0xd4f9, 0xd4fa, 0xd4fb, 0xd4fc, 0xd4fd, 0xd4fe, 0xd4ff,
+ 0xd500, 0xd501, 0xd502, 0xd503, 0xd504, 0xd505, 0xd506, 0xd507,
+ 0xd508, 0xd509, 0xd50a, 0xd50b, 0xd50c, 0xd50d, 0xd50e, 0xd50f,
+ 0xd510, 0xd511, 0xd512, 0xd513, 0xd514, 0xd515, 0xd516, 0xd517,
+ 0xd518, 0xd519, 0xd51a, 0xd51b, 0xd51c, 0xd51d, 0xd51e, 0xd51f,
+ 0xd520, 0xd521, 0xd522, 0xd523, 0xd524, 0xd525, 0xd526, 0xd527,
+ 0xd528, 0xd529, 0xd52a, 0xd52b, 0xd52c, 0xd52d, 0xd52e, 0xd52f,
+ 0xd530, 0xd531, 0xd532, 0xd533, 0xd534, 0xd535, 0xd536, 0xd537,
+ 0xd538, 0xd539, 0xd53a, 0xd53b, 0xd53c, 0xd53d, 0xd53e, 0xd53f,
+ 0xd540, 0xd541, 0xd542, 0xd543, 0xd544, 0xd545, 0xd546, 0xd547,
+ 0xd548, 0xd549, 0xd54a, 0xd54b, 0xd54c, 0xd54d, 0xd54e, 0xd54f,
+ 0xd550, 0xd551, 0xd552, 0xd553, 0xd554, 0xd555, 0xd556, 0xd557,
+ 0xd558, 0xd559, 0xd55a, 0xd55b, 0xd55c, 0xd55d, 0xd55e, 0xd55f,
+ 0xd560, 0xd561, 0xd562, 0xd563, 0xd564, 0xd565, 0xd566, 0xd567,
+ 0xd568, 0xd569, 0xd56a, 0xd56b, 0xd56c, 0xd56d, 0xd56e, 0xd56f,
+ 0xd570, 0xd571, 0xd572, 0xd573, 0xd574, 0xd575, 0xd576, 0xd577,
+ 0xd578, 0xd579, 0xd57a, 0xd57b, 0xd57c, 0xd57d, 0xd57e, 0xd57f,
+ 0xd580, 0xd581, 0xd582, 0xd583, 0xd584, 0xd585, 0xd586, 0xd587,
+ 0xd588, 0xd589, 0xd58a, 0xd58b, 0xd58c, 0xd58d, 0xd58e, 0xd58f,
+ 0xd590, 0xd591, 0xd592, 0xd593, 0xd594, 0xd595, 0xd596, 0xd597,
+ 0xd598, 0xd599, 0xd59a, 0xd59b, 0xd59c, 0xd59d, 0xd59e, 0xd59f,
+ 0xd5a0, 0xd5a1, 0xd5a2, 0xd5a3, 0xd5a4, 0xd5a5, 0xd5a6, 0xd5a7,
+ 0xd5a8, 0xd5a9, 0xd5aa, 0xd5ab, 0xd5ac, 0xd5ad, 0xd5ae, 0xd5af,
+ 0xd5b0, 0xd5b1, 0xd5b2, 0xd5b3, 0xd5b4, 0xd5b5, 0xd5b6, 0xd5b7,
+ 0xd5b8, 0xd5b9, 0xd5ba, 0xd5bb, 0xd5bc, 0xd5bd, 0xd5be, 0xd5bf,
+ 0xd5c0, 0xd5c1, 0xd5c2, 0xd5c3, 0xd5c4, 0xd5c5, 0xd5c6, 0xd5c7,
+ 0xd5c8, 0xd5c9, 0xd5ca, 0xd5cb, 0xd5cc, 0xd5cd, 0xd5ce, 0xd5cf,
+ 0xd5d0, 0xd5d1, 0xd5d2, 0xd5d3, 0xd5d4, 0xd5d5, 0xd5d6, 0xd5d7,
+ 0xd5d8, 0xd5d9, 0xd5da, 0xd5db, 0xd5dc, 0xd5dd, 0xd5de, 0xd5df,
+ 0xd5e0, 0xd5e1, 0xd5e2, 0xd5e3, 0xd5e4, 0xd5e5, 0xd5e6, 0xd5e7,
+ 0xd5e8, 0xd5e9, 0xd5ea, 0xd5eb, 0xd5ec, 0xd5ed, 0xd5ee, 0xd5ef,
+ 0xd5f0, 0xd5f1, 0xd5f2, 0xd5f3, 0xd5f4, 0xd5f5, 0xd5f6, 0xd5f7,
+ 0xd5f8, 0xd5f9, 0xd5fa, 0xd5fb, 0xd5fc, 0xd5fd, 0xd5fe, 0xd5ff,
+ 0xd600, 0xd601, 0xd602, 0xd603, 0xd604, 0xd605, 0xd606, 0xd607,
+ 0xd608, 0xd609, 0xd60a, 0xd60b, 0xd60c, 0xd60d, 0xd60e, 0xd60f,
+ 0xd610, 0xd611, 0xd612, 0xd613, 0xd614, 0xd615, 0xd616, 0xd617,
+ 0xd618, 0xd619, 0xd61a, 0xd61b, 0xd61c, 0xd61d, 0xd61e, 0xd61f,
+ 0xd620, 0xd621, 0xd622, 0xd623, 0xd624, 0xd625, 0xd626, 0xd627,
+ 0xd628, 0xd629, 0xd62a, 0xd62b, 0xd62c, 0xd62d, 0xd62e, 0xd62f,
+ 0xd630, 0xd631, 0xd632, 0xd633, 0xd634, 0xd635, 0xd636, 0xd637,
+ 0xd638, 0xd639, 0xd63a, 0xd63b, 0xd63c, 0xd63d, 0xd63e, 0xd63f,
+ 0xd640, 0xd641, 0xd642, 0xd643, 0xd644, 0xd645, 0xd646, 0xd647,
+ 0xd648, 0xd649, 0xd64a, 0xd64b, 0xd64c, 0xd64d, 0xd64e, 0xd64f,
+ 0xd650, 0xd651, 0xd652, 0xd653, 0xd654, 0xd655, 0xd656, 0xd657,
+ 0xd658, 0xd659, 0xd65a, 0xd65b, 0xd65c, 0xd65d, 0xd65e, 0xd65f,
+ 0xd660, 0xd661, 0xd662, 0xd663, 0xd664, 0xd665, 0xd666, 0xd667,
+ 0xd668, 0xd669, 0xd66a, 0xd66b, 0xd66c, 0xd66d, 0xd66e, 0xd66f,
+ 0xd670, 0xd671, 0xd672, 0xd673, 0xd674, 0xd675, 0xd676, 0xd677,
+ 0xd678, 0xd679, 0xd67a, 0xd67b, 0xd67c, 0xd67d, 0xd67e, 0xd67f,
+ 0xd680, 0xd681, 0xd682, 0xd683, 0xd684, 0xd685, 0xd686, 0xd687,
+ 0xd688, 0xd689, 0xd68a, 0xd68b, 0xd68c, 0xd68d, 0xd68e, 0xd68f,
+ 0xd690, 0xd691, 0xd692, 0xd693, 0xd694, 0xd695, 0xd696, 0xd697,
+ 0xd698, 0xd699, 0xd69a, 0xd69b, 0xd69c, 0xd69d, 0xd69e, 0xd69f,
+ 0xd6a0, 0xd6a1, 0xd6a2, 0xd6a3, 0xd6a4, 0xd6a5, 0xd6a6, 0xd6a7,
+ 0xd6a8, 0xd6a9, 0xd6aa, 0xd6ab, 0xd6ac, 0xd6ad, 0xd6ae, 0xd6af,
+ 0xd6b0, 0xd6b1, 0xd6b2, 0xd6b3, 0xd6b4, 0xd6b5, 0xd6b6, 0xd6b7,
+ 0xd6b8, 0xd6b9, 0xd6ba, 0xd6bb, 0xd6bc, 0xd6bd, 0xd6be, 0xd6bf,
+ 0xd6c0, 0xd6c1, 0xd6c2, 0xd6c3, 0xd6c4, 0xd6c5, 0xd6c6, 0xd6c7,
+ 0xd6c8, 0xd6c9, 0xd6ca, 0xd6cb, 0xd6cc, 0xd6cd, 0xd6ce, 0xd6cf,
+ 0xd6d0, 0xd6d1, 0xd6d2, 0xd6d3, 0xd6d4, 0xd6d5, 0xd6d6, 0xd6d7,
+ 0xd6d8, 0xd6d9, 0xd6da, 0xd6db, 0xd6dc, 0xd6dd, 0xd6de, 0xd6df,
+ 0xd6e0, 0xd6e1, 0xd6e2, 0xd6e3, 0xd6e4, 0xd6e5, 0xd6e6, 0xd6e7,
+ 0xd6e8, 0xd6e9, 0xd6ea, 0xd6eb, 0xd6ec, 0xd6ed, 0xd6ee, 0xd6ef,
+ 0xd6f0, 0xd6f1, 0xd6f2, 0xd6f3, 0xd6f4, 0xd6f5, 0xd6f6, 0xd6f7,
+ 0xd6f8, 0xd6f9, 0xd6fa, 0xd6fb, 0xd6fc, 0xd6fd, 0xd6fe, 0xd6ff,
+ 0xd700, 0xd701, 0xd702, 0xd703, 0xd704, 0xd705, 0xd706, 0xd707,
+ 0xd708, 0xd709, 0xd70a, 0xd70b, 0xd70c, 0xd70d, 0xd70e, 0xd70f,
+ 0xd710, 0xd711, 0xd712, 0xd713, 0xd714, 0xd715, 0xd716, 0xd717,
+ 0xd718, 0xd719, 0xd71a, 0xd71b, 0xd71c, 0xd71d, 0xd71e, 0xd71f,
+ 0xd720, 0xd721, 0xd722, 0xd723, 0xd724, 0xd725, 0xd726, 0xd727,
+ 0xd728, 0xd729, 0xd72a, 0xd72b, 0xd72c, 0xd72d, 0xd72e, 0xd72f,
+ 0xd730, 0xd731, 0xd732, 0xd733, 0xd734, 0xd735, 0xd736, 0xd737,
+ 0xd738, 0xd739, 0xd73a, 0xd73b, 0xd73c, 0xd73d, 0xd73e, 0xd73f,
+ 0xd740, 0xd741, 0xd742, 0xd743, 0xd744, 0xd745, 0xd746, 0xd747,
+ 0xd748, 0xd749, 0xd74a, 0xd74b, 0xd74c, 0xd74d, 0xd74e, 0xd74f,
+ 0xd750, 0xd751, 0xd752, 0xd753, 0xd754, 0xd755, 0xd756, 0xd757,
+ 0xd758, 0xd759, 0xd75a, 0xd75b, 0xd75c, 0xd75d, 0xd75e, 0xd75f,
+ 0xd760, 0xd761, 0xd762, 0xd763, 0xd764, 0xd765, 0xd766, 0xd767,
+ 0xd768, 0xd769, 0xd76a, 0xd76b, 0xd76c, 0xd76d, 0xd76e, 0xd76f,
+ 0xd770, 0xd771, 0xd772, 0xd773, 0xd774, 0xd775, 0xd776, 0xd777,
+ 0xd778, 0xd779, 0xd77a, 0xd77b, 0xd77c, 0xd77d, 0xd77e, 0xd77f,
+ 0xd780, 0xd781, 0xd782, 0xd783, 0xd784, 0xd785, 0xd786, 0xd787,
+ 0xd788, 0xd789, 0xd78a, 0xd78b, 0xd78c, 0xd78d, 0xd78e, 0xd78f,
+ 0xd790, 0xd791, 0xd792, 0xd793, 0xd794, 0xd795, 0xd796, 0xd797,
+ 0xd798, 0xd799, 0xd79a, 0xd79b, 0xd79c, 0xd79d, 0xd79e, 0xd79f,
+ 0xd7a0, 0xd7a1, 0xd7a2, 0xd7a3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xd800, 0xd801, 0xd802, 0xd803, 0xd804, 0xd805, 0xd806, 0xd807,
+ 0xd808, 0xd809, 0xd80a, 0xd80b, 0xd80c, 0xd80d, 0xd80e, 0xd80f,
+ 0xd810, 0xd811, 0xd812, 0xd813, 0xd814, 0xd815, 0xd816, 0xd817,
+ 0xd818, 0xd819, 0xd81a, 0xd81b, 0xd81c, 0xd81d, 0xd81e, 0xd81f,
+ 0xd820, 0xd821, 0xd822, 0xd823, 0xd824, 0xd825, 0xd826, 0xd827,
+ 0xd828, 0xd829, 0xd82a, 0xd82b, 0xd82c, 0xd82d, 0xd82e, 0xd82f,
+ 0xd830, 0xd831, 0xd832, 0xd833, 0xd834, 0xd835, 0xd836, 0xd837,
+ 0xd838, 0xd839, 0xd83a, 0xd83b, 0xd83c, 0xd83d, 0xd83e, 0xd83f,
+ 0xd840, 0xd841, 0xd842, 0xd843, 0xd844, 0xd845, 0xd846, 0xd847,
+ 0xd848, 0xd849, 0xd84a, 0xd84b, 0xd84c, 0xd84d, 0xd84e, 0xd84f,
+ 0xd850, 0xd851, 0xd852, 0xd853, 0xd854, 0xd855, 0xd856, 0xd857,
+ 0xd858, 0xd859, 0xd85a, 0xd85b, 0xd85c, 0xd85d, 0xd85e, 0xd85f,
+ 0xd860, 0xd861, 0xd862, 0xd863, 0xd864, 0xd865, 0xd866, 0xd867,
+ 0xd868, 0xd869, 0xd86a, 0xd86b, 0xd86c, 0xd86d, 0xd86e, 0xd86f,
+ 0xd870, 0xd871, 0xd872, 0xd873, 0xd874, 0xd875, 0xd876, 0xd877,
+ 0xd878, 0xd879, 0xd87a, 0xd87b, 0xd87c, 0xd87d, 0xd87e, 0xd87f,
+ 0xd880, 0xd881, 0xd882, 0xd883, 0xd884, 0xd885, 0xd886, 0xd887,
+ 0xd888, 0xd889, 0xd88a, 0xd88b, 0xd88c, 0xd88d, 0xd88e, 0xd88f,
+ 0xd890, 0xd891, 0xd892, 0xd893, 0xd894, 0xd895, 0xd896, 0xd897,
+ 0xd898, 0xd899, 0xd89a, 0xd89b, 0xd89c, 0xd89d, 0xd89e, 0xd89f,
+ 0xd8a0, 0xd8a1, 0xd8a2, 0xd8a3, 0xd8a4, 0xd8a5, 0xd8a6, 0xd8a7,
+ 0xd8a8, 0xd8a9, 0xd8aa, 0xd8ab, 0xd8ac, 0xd8ad, 0xd8ae, 0xd8af,
+ 0xd8b0, 0xd8b1, 0xd8b2, 0xd8b3, 0xd8b4, 0xd8b5, 0xd8b6, 0xd8b7,
+ 0xd8b8, 0xd8b9, 0xd8ba, 0xd8bb, 0xd8bc, 0xd8bd, 0xd8be, 0xd8bf,
+ 0xd8c0, 0xd8c1, 0xd8c2, 0xd8c3, 0xd8c4, 0xd8c5, 0xd8c6, 0xd8c7,
+ 0xd8c8, 0xd8c9, 0xd8ca, 0xd8cb, 0xd8cc, 0xd8cd, 0xd8ce, 0xd8cf,
+ 0xd8d0, 0xd8d1, 0xd8d2, 0xd8d3, 0xd8d4, 0xd8d5, 0xd8d6, 0xd8d7,
+ 0xd8d8, 0xd8d9, 0xd8da, 0xd8db, 0xd8dc, 0xd8dd, 0xd8de, 0xd8df,
+ 0xd8e0, 0xd8e1, 0xd8e2, 0xd8e3, 0xd8e4, 0xd8e5, 0xd8e6, 0xd8e7,
+ 0xd8e8, 0xd8e9, 0xd8ea, 0xd8eb, 0xd8ec, 0xd8ed, 0xd8ee, 0xd8ef,
+ 0xd8f0, 0xd8f1, 0xd8f2, 0xd8f3, 0xd8f4, 0xd8f5, 0xd8f6, 0xd8f7,
+ 0xd8f8, 0xd8f9, 0xd8fa, 0xd8fb, 0xd8fc, 0xd8fd, 0xd8fe, 0xd8ff,
+ 0xd900, 0xd901, 0xd902, 0xd903, 0xd904, 0xd905, 0xd906, 0xd907,
+ 0xd908, 0xd909, 0xd90a, 0xd90b, 0xd90c, 0xd90d, 0xd90e, 0xd90f,
+ 0xd910, 0xd911, 0xd912, 0xd913, 0xd914, 0xd915, 0xd916, 0xd917,
+ 0xd918, 0xd919, 0xd91a, 0xd91b, 0xd91c, 0xd91d, 0xd91e, 0xd91f,
+ 0xd920, 0xd921, 0xd922, 0xd923, 0xd924, 0xd925, 0xd926, 0xd927,
+ 0xd928, 0xd929, 0xd92a, 0xd92b, 0xd92c, 0xd92d, 0xd92e, 0xd92f,
+ 0xd930, 0xd931, 0xd932, 0xd933, 0xd934, 0xd935, 0xd936, 0xd937,
+ 0xd938, 0xd939, 0xd93a, 0xd93b, 0xd93c, 0xd93d, 0xd93e, 0xd93f,
+ 0xd940, 0xd941, 0xd942, 0xd943, 0xd944, 0xd945, 0xd946, 0xd947,
+ 0xd948, 0xd949, 0xd94a, 0xd94b, 0xd94c, 0xd94d, 0xd94e, 0xd94f,
+ 0xd950, 0xd951, 0xd952, 0xd953, 0xd954, 0xd955, 0xd956, 0xd957,
+ 0xd958, 0xd959, 0xd95a, 0xd95b, 0xd95c, 0xd95d, 0xd95e, 0xd95f,
+ 0xd960, 0xd961, 0xd962, 0xd963, 0xd964, 0xd965, 0xd966, 0xd967,
+ 0xd968, 0xd969, 0xd96a, 0xd96b, 0xd96c, 0xd96d, 0xd96e, 0xd96f,
+ 0xd970, 0xd971, 0xd972, 0xd973, 0xd974, 0xd975, 0xd976, 0xd977,
+ 0xd978, 0xd979, 0xd97a, 0xd97b, 0xd97c, 0xd97d, 0xd97e, 0xd97f,
+ 0xd980, 0xd981, 0xd982, 0xd983, 0xd984, 0xd985, 0xd986, 0xd987,
+ 0xd988, 0xd989, 0xd98a, 0xd98b, 0xd98c, 0xd98d, 0xd98e, 0xd98f,
+ 0xd990, 0xd991, 0xd992, 0xd993, 0xd994, 0xd995, 0xd996, 0xd997,
+ 0xd998, 0xd999, 0xd99a, 0xd99b, 0xd99c, 0xd99d, 0xd99e, 0xd99f,
+ 0xd9a0, 0xd9a1, 0xd9a2, 0xd9a3, 0xd9a4, 0xd9a5, 0xd9a6, 0xd9a7,
+ 0xd9a8, 0xd9a9, 0xd9aa, 0xd9ab, 0xd9ac, 0xd9ad, 0xd9ae, 0xd9af,
+ 0xd9b0, 0xd9b1, 0xd9b2, 0xd9b3, 0xd9b4, 0xd9b5, 0xd9b6, 0xd9b7,
+ 0xd9b8, 0xd9b9, 0xd9ba, 0xd9bb, 0xd9bc, 0xd9bd, 0xd9be, 0xd9bf,
+ 0xd9c0, 0xd9c1, 0xd9c2, 0xd9c3, 0xd9c4, 0xd9c5, 0xd9c6, 0xd9c7,
+ 0xd9c8, 0xd9c9, 0xd9ca, 0xd9cb, 0xd9cc, 0xd9cd, 0xd9ce, 0xd9cf,
+ 0xd9d0, 0xd9d1, 0xd9d2, 0xd9d3, 0xd9d4, 0xd9d5, 0xd9d6, 0xd9d7,
+ 0xd9d8, 0xd9d9, 0xd9da, 0xd9db, 0xd9dc, 0xd9dd, 0xd9de, 0xd9df,
+ 0xd9e0, 0xd9e1, 0xd9e2, 0xd9e3, 0xd9e4, 0xd9e5, 0xd9e6, 0xd9e7,
+ 0xd9e8, 0xd9e9, 0xd9ea, 0xd9eb, 0xd9ec, 0xd9ed, 0xd9ee, 0xd9ef,
+ 0xd9f0, 0xd9f1, 0xd9f2, 0xd9f3, 0xd9f4, 0xd9f5, 0xd9f6, 0xd9f7,
+ 0xd9f8, 0xd9f9, 0xd9fa, 0xd9fb, 0xd9fc, 0xd9fd, 0xd9fe, 0xd9ff,
+ 0xda00, 0xda01, 0xda02, 0xda03, 0xda04, 0xda05, 0xda06, 0xda07,
+ 0xda08, 0xda09, 0xda0a, 0xda0b, 0xda0c, 0xda0d, 0xda0e, 0xda0f,
+ 0xda10, 0xda11, 0xda12, 0xda13, 0xda14, 0xda15, 0xda16, 0xda17,
+ 0xda18, 0xda19, 0xda1a, 0xda1b, 0xda1c, 0xda1d, 0xda1e, 0xda1f,
+ 0xda20, 0xda21, 0xda22, 0xda23, 0xda24, 0xda25, 0xda26, 0xda27,
+ 0xda28, 0xda29, 0xda2a, 0xda2b, 0xda2c, 0xda2d, 0xda2e, 0xda2f,
+ 0xda30, 0xda31, 0xda32, 0xda33, 0xda34, 0xda35, 0xda36, 0xda37,
+ 0xda38, 0xda39, 0xda3a, 0xda3b, 0xda3c, 0xda3d, 0xda3e, 0xda3f,
+ 0xda40, 0xda41, 0xda42, 0xda43, 0xda44, 0xda45, 0xda46, 0xda47,
+ 0xda48, 0xda49, 0xda4a, 0xda4b, 0xda4c, 0xda4d, 0xda4e, 0xda4f,
+ 0xda50, 0xda51, 0xda52, 0xda53, 0xda54, 0xda55, 0xda56, 0xda57,
+ 0xda58, 0xda59, 0xda5a, 0xda5b, 0xda5c, 0xda5d, 0xda5e, 0xda5f,
+ 0xda60, 0xda61, 0xda62, 0xda63, 0xda64, 0xda65, 0xda66, 0xda67,
+ 0xda68, 0xda69, 0xda6a, 0xda6b, 0xda6c, 0xda6d, 0xda6e, 0xda6f,
+ 0xda70, 0xda71, 0xda72, 0xda73, 0xda74, 0xda75, 0xda76, 0xda77,
+ 0xda78, 0xda79, 0xda7a, 0xda7b, 0xda7c, 0xda7d, 0xda7e, 0xda7f,
+ 0xda80, 0xda81, 0xda82, 0xda83, 0xda84, 0xda85, 0xda86, 0xda87,
+ 0xda88, 0xda89, 0xda8a, 0xda8b, 0xda8c, 0xda8d, 0xda8e, 0xda8f,
+ 0xda90, 0xda91, 0xda92, 0xda93, 0xda94, 0xda95, 0xda96, 0xda97,
+ 0xda98, 0xda99, 0xda9a, 0xda9b, 0xda9c, 0xda9d, 0xda9e, 0xda9f,
+ 0xdaa0, 0xdaa1, 0xdaa2, 0xdaa3, 0xdaa4, 0xdaa5, 0xdaa6, 0xdaa7,
+ 0xdaa8, 0xdaa9, 0xdaaa, 0xdaab, 0xdaac, 0xdaad, 0xdaae, 0xdaaf,
+ 0xdab0, 0xdab1, 0xdab2, 0xdab3, 0xdab4, 0xdab5, 0xdab6, 0xdab7,
+ 0xdab8, 0xdab9, 0xdaba, 0xdabb, 0xdabc, 0xdabd, 0xdabe, 0xdabf,
+ 0xdac0, 0xdac1, 0xdac2, 0xdac3, 0xdac4, 0xdac5, 0xdac6, 0xdac7,
+ 0xdac8, 0xdac9, 0xdaca, 0xdacb, 0xdacc, 0xdacd, 0xdace, 0xdacf,
+ 0xdad0, 0xdad1, 0xdad2, 0xdad3, 0xdad4, 0xdad5, 0xdad6, 0xdad7,
+ 0xdad8, 0xdad9, 0xdada, 0xdadb, 0xdadc, 0xdadd, 0xdade, 0xdadf,
+ 0xdae0, 0xdae1, 0xdae2, 0xdae3, 0xdae4, 0xdae5, 0xdae6, 0xdae7,
+ 0xdae8, 0xdae9, 0xdaea, 0xdaeb, 0xdaec, 0xdaed, 0xdaee, 0xdaef,
+ 0xdaf0, 0xdaf1, 0xdaf2, 0xdaf3, 0xdaf4, 0xdaf5, 0xdaf6, 0xdaf7,
+ 0xdaf8, 0xdaf9, 0xdafa, 0xdafb, 0xdafc, 0xdafd, 0xdafe, 0xdaff,
+ 0xdb00, 0xdb01, 0xdb02, 0xdb03, 0xdb04, 0xdb05, 0xdb06, 0xdb07,
+ 0xdb08, 0xdb09, 0xdb0a, 0xdb0b, 0xdb0c, 0xdb0d, 0xdb0e, 0xdb0f,
+ 0xdb10, 0xdb11, 0xdb12, 0xdb13, 0xdb14, 0xdb15, 0xdb16, 0xdb17,
+ 0xdb18, 0xdb19, 0xdb1a, 0xdb1b, 0xdb1c, 0xdb1d, 0xdb1e, 0xdb1f,
+ 0xdb20, 0xdb21, 0xdb22, 0xdb23, 0xdb24, 0xdb25, 0xdb26, 0xdb27,
+ 0xdb28, 0xdb29, 0xdb2a, 0xdb2b, 0xdb2c, 0xdb2d, 0xdb2e, 0xdb2f,
+ 0xdb30, 0xdb31, 0xdb32, 0xdb33, 0xdb34, 0xdb35, 0xdb36, 0xdb37,
+ 0xdb38, 0xdb39, 0xdb3a, 0xdb3b, 0xdb3c, 0xdb3d, 0xdb3e, 0xdb3f,
+ 0xdb40, 0xdb41, 0xdb42, 0xdb43, 0xdb44, 0xdb45, 0xdb46, 0xdb47,
+ 0xdb48, 0xdb49, 0xdb4a, 0xdb4b, 0xdb4c, 0xdb4d, 0xdb4e, 0xdb4f,
+ 0xdb50, 0xdb51, 0xdb52, 0xdb53, 0xdb54, 0xdb55, 0xdb56, 0xdb57,
+ 0xdb58, 0xdb59, 0xdb5a, 0xdb5b, 0xdb5c, 0xdb5d, 0xdb5e, 0xdb5f,
+ 0xdb60, 0xdb61, 0xdb62, 0xdb63, 0xdb64, 0xdb65, 0xdb66, 0xdb67,
+ 0xdb68, 0xdb69, 0xdb6a, 0xdb6b, 0xdb6c, 0xdb6d, 0xdb6e, 0xdb6f,
+ 0xdb70, 0xdb71, 0xdb72, 0xdb73, 0xdb74, 0xdb75, 0xdb76, 0xdb77,
+ 0xdb78, 0xdb79, 0xdb7a, 0xdb7b, 0xdb7c, 0xdb7d, 0xdb7e, 0xdb7f,
+ 0xdb80, 0xdb81, 0xdb82, 0xdb83, 0xdb84, 0xdb85, 0xdb86, 0xdb87,
+ 0xdb88, 0xdb89, 0xdb8a, 0xdb8b, 0xdb8c, 0xdb8d, 0xdb8e, 0xdb8f,
+ 0xdb90, 0xdb91, 0xdb92, 0xdb93, 0xdb94, 0xdb95, 0xdb96, 0xdb97,
+ 0xdb98, 0xdb99, 0xdb9a, 0xdb9b, 0xdb9c, 0xdb9d, 0xdb9e, 0xdb9f,
+ 0xdba0, 0xdba1, 0xdba2, 0xdba3, 0xdba4, 0xdba5, 0xdba6, 0xdba7,
+ 0xdba8, 0xdba9, 0xdbaa, 0xdbab, 0xdbac, 0xdbad, 0xdbae, 0xdbaf,
+ 0xdbb0, 0xdbb1, 0xdbb2, 0xdbb3, 0xdbb4, 0xdbb5, 0xdbb6, 0xdbb7,
+ 0xdbb8, 0xdbb9, 0xdbba, 0xdbbb, 0xdbbc, 0xdbbd, 0xdbbe, 0xdbbf,
+ 0xdbc0, 0xdbc1, 0xdbc2, 0xdbc3, 0xdbc4, 0xdbc5, 0xdbc6, 0xdbc7,
+ 0xdbc8, 0xdbc9, 0xdbca, 0xdbcb, 0xdbcc, 0xdbcd, 0xdbce, 0xdbcf,
+ 0xdbd0, 0xdbd1, 0xdbd2, 0xdbd3, 0xdbd4, 0xdbd5, 0xdbd6, 0xdbd7,
+ 0xdbd8, 0xdbd9, 0xdbda, 0xdbdb, 0xdbdc, 0xdbdd, 0xdbde, 0xdbdf,
+ 0xdbe0, 0xdbe1, 0xdbe2, 0xdbe3, 0xdbe4, 0xdbe5, 0xdbe6, 0xdbe7,
+ 0xdbe8, 0xdbe9, 0xdbea, 0xdbeb, 0xdbec, 0xdbed, 0xdbee, 0xdbef,
+ 0xdbf0, 0xdbf1, 0xdbf2, 0xdbf3, 0xdbf4, 0xdbf5, 0xdbf6, 0xdbf7,
+ 0xdbf8, 0xdbf9, 0xdbfa, 0xdbfb, 0xdbfc, 0xdbfd, 0xdbfe, 0xdbff,
+ 0xdc00, 0xdc01, 0xdc02, 0xdc03, 0xdc04, 0xdc05, 0xdc06, 0xdc07,
+ 0xdc08, 0xdc09, 0xdc0a, 0xdc0b, 0xdc0c, 0xdc0d, 0xdc0e, 0xdc0f,
+ 0xdc10, 0xdc11, 0xdc12, 0xdc13, 0xdc14, 0xdc15, 0xdc16, 0xdc17,
+ 0xdc18, 0xdc19, 0xdc1a, 0xdc1b, 0xdc1c, 0xdc1d, 0xdc1e, 0xdc1f,
+ 0xdc20, 0xdc21, 0xdc22, 0xdc23, 0xdc24, 0xdc25, 0xdc26, 0xdc27,
+ 0xdc28, 0xdc29, 0xdc2a, 0xdc2b, 0xdc2c, 0xdc2d, 0xdc2e, 0xdc2f,
+ 0xdc30, 0xdc31, 0xdc32, 0xdc33, 0xdc34, 0xdc35, 0xdc36, 0xdc37,
+ 0xdc38, 0xdc39, 0xdc3a, 0xdc3b, 0xdc3c, 0xdc3d, 0xdc3e, 0xdc3f,
+ 0xdc40, 0xdc41, 0xdc42, 0xdc43, 0xdc44, 0xdc45, 0xdc46, 0xdc47,
+ 0xdc48, 0xdc49, 0xdc4a, 0xdc4b, 0xdc4c, 0xdc4d, 0xdc4e, 0xdc4f,
+ 0xdc50, 0xdc51, 0xdc52, 0xdc53, 0xdc54, 0xdc55, 0xdc56, 0xdc57,
+ 0xdc58, 0xdc59, 0xdc5a, 0xdc5b, 0xdc5c, 0xdc5d, 0xdc5e, 0xdc5f,
+ 0xdc60, 0xdc61, 0xdc62, 0xdc63, 0xdc64, 0xdc65, 0xdc66, 0xdc67,
+ 0xdc68, 0xdc69, 0xdc6a, 0xdc6b, 0xdc6c, 0xdc6d, 0xdc6e, 0xdc6f,
+ 0xdc70, 0xdc71, 0xdc72, 0xdc73, 0xdc74, 0xdc75, 0xdc76, 0xdc77,
+ 0xdc78, 0xdc79, 0xdc7a, 0xdc7b, 0xdc7c, 0xdc7d, 0xdc7e, 0xdc7f,
+ 0xdc80, 0xdc81, 0xdc82, 0xdc83, 0xdc84, 0xdc85, 0xdc86, 0xdc87,
+ 0xdc88, 0xdc89, 0xdc8a, 0xdc8b, 0xdc8c, 0xdc8d, 0xdc8e, 0xdc8f,
+ 0xdc90, 0xdc91, 0xdc92, 0xdc93, 0xdc94, 0xdc95, 0xdc96, 0xdc97,
+ 0xdc98, 0xdc99, 0xdc9a, 0xdc9b, 0xdc9c, 0xdc9d, 0xdc9e, 0xdc9f,
+ 0xdca0, 0xdca1, 0xdca2, 0xdca3, 0xdca4, 0xdca5, 0xdca6, 0xdca7,
+ 0xdca8, 0xdca9, 0xdcaa, 0xdcab, 0xdcac, 0xdcad, 0xdcae, 0xdcaf,
+ 0xdcb0, 0xdcb1, 0xdcb2, 0xdcb3, 0xdcb4, 0xdcb5, 0xdcb6, 0xdcb7,
+ 0xdcb8, 0xdcb9, 0xdcba, 0xdcbb, 0xdcbc, 0xdcbd, 0xdcbe, 0xdcbf,
+ 0xdcc0, 0xdcc1, 0xdcc2, 0xdcc3, 0xdcc4, 0xdcc5, 0xdcc6, 0xdcc7,
+ 0xdcc8, 0xdcc9, 0xdcca, 0xdccb, 0xdccc, 0xdccd, 0xdcce, 0xdccf,
+ 0xdcd0, 0xdcd1, 0xdcd2, 0xdcd3, 0xdcd4, 0xdcd5, 0xdcd6, 0xdcd7,
+ 0xdcd8, 0xdcd9, 0xdcda, 0xdcdb, 0xdcdc, 0xdcdd, 0xdcde, 0xdcdf,
+ 0xdce0, 0xdce1, 0xdce2, 0xdce3, 0xdce4, 0xdce5, 0xdce6, 0xdce7,
+ 0xdce8, 0xdce9, 0xdcea, 0xdceb, 0xdcec, 0xdced, 0xdcee, 0xdcef,
+ 0xdcf0, 0xdcf1, 0xdcf2, 0xdcf3, 0xdcf4, 0xdcf5, 0xdcf6, 0xdcf7,
+ 0xdcf8, 0xdcf9, 0xdcfa, 0xdcfb, 0xdcfc, 0xdcfd, 0xdcfe, 0xdcff,
+ 0xdd00, 0xdd01, 0xdd02, 0xdd03, 0xdd04, 0xdd05, 0xdd06, 0xdd07,
+ 0xdd08, 0xdd09, 0xdd0a, 0xdd0b, 0xdd0c, 0xdd0d, 0xdd0e, 0xdd0f,
+ 0xdd10, 0xdd11, 0xdd12, 0xdd13, 0xdd14, 0xdd15, 0xdd16, 0xdd17,
+ 0xdd18, 0xdd19, 0xdd1a, 0xdd1b, 0xdd1c, 0xdd1d, 0xdd1e, 0xdd1f,
+ 0xdd20, 0xdd21, 0xdd22, 0xdd23, 0xdd24, 0xdd25, 0xdd26, 0xdd27,
+ 0xdd28, 0xdd29, 0xdd2a, 0xdd2b, 0xdd2c, 0xdd2d, 0xdd2e, 0xdd2f,
+ 0xdd30, 0xdd31, 0xdd32, 0xdd33, 0xdd34, 0xdd35, 0xdd36, 0xdd37,
+ 0xdd38, 0xdd39, 0xdd3a, 0xdd3b, 0xdd3c, 0xdd3d, 0xdd3e, 0xdd3f,
+ 0xdd40, 0xdd41, 0xdd42, 0xdd43, 0xdd44, 0xdd45, 0xdd46, 0xdd47,
+ 0xdd48, 0xdd49, 0xdd4a, 0xdd4b, 0xdd4c, 0xdd4d, 0xdd4e, 0xdd4f,
+ 0xdd50, 0xdd51, 0xdd52, 0xdd53, 0xdd54, 0xdd55, 0xdd56, 0xdd57,
+ 0xdd58, 0xdd59, 0xdd5a, 0xdd5b, 0xdd5c, 0xdd5d, 0xdd5e, 0xdd5f,
+ 0xdd60, 0xdd61, 0xdd62, 0xdd63, 0xdd64, 0xdd65, 0xdd66, 0xdd67,
+ 0xdd68, 0xdd69, 0xdd6a, 0xdd6b, 0xdd6c, 0xdd6d, 0xdd6e, 0xdd6f,
+ 0xdd70, 0xdd71, 0xdd72, 0xdd73, 0xdd74, 0xdd75, 0xdd76, 0xdd77,
+ 0xdd78, 0xdd79, 0xdd7a, 0xdd7b, 0xdd7c, 0xdd7d, 0xdd7e, 0xdd7f,
+ 0xdd80, 0xdd81, 0xdd82, 0xdd83, 0xdd84, 0xdd85, 0xdd86, 0xdd87,
+ 0xdd88, 0xdd89, 0xdd8a, 0xdd8b, 0xdd8c, 0xdd8d, 0xdd8e, 0xdd8f,
+ 0xdd90, 0xdd91, 0xdd92, 0xdd93, 0xdd94, 0xdd95, 0xdd96, 0xdd97,
+ 0xdd98, 0xdd99, 0xdd9a, 0xdd9b, 0xdd9c, 0xdd9d, 0xdd9e, 0xdd9f,
+ 0xdda0, 0xdda1, 0xdda2, 0xdda3, 0xdda4, 0xdda5, 0xdda6, 0xdda7,
+ 0xdda8, 0xdda9, 0xddaa, 0xddab, 0xddac, 0xddad, 0xddae, 0xddaf,
+ 0xddb0, 0xddb1, 0xddb2, 0xddb3, 0xddb4, 0xddb5, 0xddb6, 0xddb7,
+ 0xddb8, 0xddb9, 0xddba, 0xddbb, 0xddbc, 0xddbd, 0xddbe, 0xddbf,
+ 0xddc0, 0xddc1, 0xddc2, 0xddc3, 0xddc4, 0xddc5, 0xddc6, 0xddc7,
+ 0xddc8, 0xddc9, 0xddca, 0xddcb, 0xddcc, 0xddcd, 0xddce, 0xddcf,
+ 0xddd0, 0xddd1, 0xddd2, 0xddd3, 0xddd4, 0xddd5, 0xddd6, 0xddd7,
+ 0xddd8, 0xddd9, 0xddda, 0xdddb, 0xdddc, 0xdddd, 0xddde, 0xdddf,
+ 0xdde0, 0xdde1, 0xdde2, 0xdde3, 0xdde4, 0xdde5, 0xdde6, 0xdde7,
+ 0xdde8, 0xdde9, 0xddea, 0xddeb, 0xddec, 0xdded, 0xddee, 0xddef,
+ 0xddf0, 0xddf1, 0xddf2, 0xddf3, 0xddf4, 0xddf5, 0xddf6, 0xddf7,
+ 0xddf8, 0xddf9, 0xddfa, 0xddfb, 0xddfc, 0xddfd, 0xddfe, 0xddff,
+ 0xde00, 0xde01, 0xde02, 0xde03, 0xde04, 0xde05, 0xde06, 0xde07,
+ 0xde08, 0xde09, 0xde0a, 0xde0b, 0xde0c, 0xde0d, 0xde0e, 0xde0f,
+ 0xde10, 0xde11, 0xde12, 0xde13, 0xde14, 0xde15, 0xde16, 0xde17,
+ 0xde18, 0xde19, 0xde1a, 0xde1b, 0xde1c, 0xde1d, 0xde1e, 0xde1f,
+ 0xde20, 0xde21, 0xde22, 0xde23, 0xde24, 0xde25, 0xde26, 0xde27,
+ 0xde28, 0xde29, 0xde2a, 0xde2b, 0xde2c, 0xde2d, 0xde2e, 0xde2f,
+ 0xde30, 0xde31, 0xde32, 0xde33, 0xde34, 0xde35, 0xde36, 0xde37,
+ 0xde38, 0xde39, 0xde3a, 0xde3b, 0xde3c, 0xde3d, 0xde3e, 0xde3f,
+ 0xde40, 0xde41, 0xde42, 0xde43, 0xde44, 0xde45, 0xde46, 0xde47,
+ 0xde48, 0xde49, 0xde4a, 0xde4b, 0xde4c, 0xde4d, 0xde4e, 0xde4f,
+ 0xde50, 0xde51, 0xde52, 0xde53, 0xde54, 0xde55, 0xde56, 0xde57,
+ 0xde58, 0xde59, 0xde5a, 0xde5b, 0xde5c, 0xde5d, 0xde5e, 0xde5f,
+ 0xde60, 0xde61, 0xde62, 0xde63, 0xde64, 0xde65, 0xde66, 0xde67,
+ 0xde68, 0xde69, 0xde6a, 0xde6b, 0xde6c, 0xde6d, 0xde6e, 0xde6f,
+ 0xde70, 0xde71, 0xde72, 0xde73, 0xde74, 0xde75, 0xde76, 0xde77,
+ 0xde78, 0xde79, 0xde7a, 0xde7b, 0xde7c, 0xde7d, 0xde7e, 0xde7f,
+ 0xde80, 0xde81, 0xde82, 0xde83, 0xde84, 0xde85, 0xde86, 0xde87,
+ 0xde88, 0xde89, 0xde8a, 0xde8b, 0xde8c, 0xde8d, 0xde8e, 0xde8f,
+ 0xde90, 0xde91, 0xde92, 0xde93, 0xde94, 0xde95, 0xde96, 0xde97,
+ 0xde98, 0xde99, 0xde9a, 0xde9b, 0xde9c, 0xde9d, 0xde9e, 0xde9f,
+ 0xdea0, 0xdea1, 0xdea2, 0xdea3, 0xdea4, 0xdea5, 0xdea6, 0xdea7,
+ 0xdea8, 0xdea9, 0xdeaa, 0xdeab, 0xdeac, 0xdead, 0xdeae, 0xdeaf,
+ 0xdeb0, 0xdeb1, 0xdeb2, 0xdeb3, 0xdeb4, 0xdeb5, 0xdeb6, 0xdeb7,
+ 0xdeb8, 0xdeb9, 0xdeba, 0xdebb, 0xdebc, 0xdebd, 0xdebe, 0xdebf,
+ 0xdec0, 0xdec1, 0xdec2, 0xdec3, 0xdec4, 0xdec5, 0xdec6, 0xdec7,
+ 0xdec8, 0xdec9, 0xdeca, 0xdecb, 0xdecc, 0xdecd, 0xdece, 0xdecf,
+ 0xded0, 0xded1, 0xded2, 0xded3, 0xded4, 0xded5, 0xded6, 0xded7,
+ 0xded8, 0xded9, 0xdeda, 0xdedb, 0xdedc, 0xdedd, 0xdede, 0xdedf,
+ 0xdee0, 0xdee1, 0xdee2, 0xdee3, 0xdee4, 0xdee5, 0xdee6, 0xdee7,
+ 0xdee8, 0xdee9, 0xdeea, 0xdeeb, 0xdeec, 0xdeed, 0xdeee, 0xdeef,
+ 0xdef0, 0xdef1, 0xdef2, 0xdef3, 0xdef4, 0xdef5, 0xdef6, 0xdef7,
+ 0xdef8, 0xdef9, 0xdefa, 0xdefb, 0xdefc, 0xdefd, 0xdefe, 0xdeff,
+ 0xdf00, 0xdf01, 0xdf02, 0xdf03, 0xdf04, 0xdf05, 0xdf06, 0xdf07,
+ 0xdf08, 0xdf09, 0xdf0a, 0xdf0b, 0xdf0c, 0xdf0d, 0xdf0e, 0xdf0f,
+ 0xdf10, 0xdf11, 0xdf12, 0xdf13, 0xdf14, 0xdf15, 0xdf16, 0xdf17,
+ 0xdf18, 0xdf19, 0xdf1a, 0xdf1b, 0xdf1c, 0xdf1d, 0xdf1e, 0xdf1f,
+ 0xdf20, 0xdf21, 0xdf22, 0xdf23, 0xdf24, 0xdf25, 0xdf26, 0xdf27,
+ 0xdf28, 0xdf29, 0xdf2a, 0xdf2b, 0xdf2c, 0xdf2d, 0xdf2e, 0xdf2f,
+ 0xdf30, 0xdf31, 0xdf32, 0xdf33, 0xdf34, 0xdf35, 0xdf36, 0xdf37,
+ 0xdf38, 0xdf39, 0xdf3a, 0xdf3b, 0xdf3c, 0xdf3d, 0xdf3e, 0xdf3f,
+ 0xdf40, 0xdf41, 0xdf42, 0xdf43, 0xdf44, 0xdf45, 0xdf46, 0xdf47,
+ 0xdf48, 0xdf49, 0xdf4a, 0xdf4b, 0xdf4c, 0xdf4d, 0xdf4e, 0xdf4f,
+ 0xdf50, 0xdf51, 0xdf52, 0xdf53, 0xdf54, 0xdf55, 0xdf56, 0xdf57,
+ 0xdf58, 0xdf59, 0xdf5a, 0xdf5b, 0xdf5c, 0xdf5d, 0xdf5e, 0xdf5f,
+ 0xdf60, 0xdf61, 0xdf62, 0xdf63, 0xdf64, 0xdf65, 0xdf66, 0xdf67,
+ 0xdf68, 0xdf69, 0xdf6a, 0xdf6b, 0xdf6c, 0xdf6d, 0xdf6e, 0xdf6f,
+ 0xdf70, 0xdf71, 0xdf72, 0xdf73, 0xdf74, 0xdf75, 0xdf76, 0xdf77,
+ 0xdf78, 0xdf79, 0xdf7a, 0xdf7b, 0xdf7c, 0xdf7d, 0xdf7e, 0xdf7f,
+ 0xdf80, 0xdf81, 0xdf82, 0xdf83, 0xdf84, 0xdf85, 0xdf86, 0xdf87,
+ 0xdf88, 0xdf89, 0xdf8a, 0xdf8b, 0xdf8c, 0xdf8d, 0xdf8e, 0xdf8f,
+ 0xdf90, 0xdf91, 0xdf92, 0xdf93, 0xdf94, 0xdf95, 0xdf96, 0xdf97,
+ 0xdf98, 0xdf99, 0xdf9a, 0xdf9b, 0xdf9c, 0xdf9d, 0xdf9e, 0xdf9f,
+ 0xdfa0, 0xdfa1, 0xdfa2, 0xdfa3, 0xdfa4, 0xdfa5, 0xdfa6, 0xdfa7,
+ 0xdfa8, 0xdfa9, 0xdfaa, 0xdfab, 0xdfac, 0xdfad, 0xdfae, 0xdfaf,
+ 0xdfb0, 0xdfb1, 0xdfb2, 0xdfb3, 0xdfb4, 0xdfb5, 0xdfb6, 0xdfb7,
+ 0xdfb8, 0xdfb9, 0xdfba, 0xdfbb, 0xdfbc, 0xdfbd, 0xdfbe, 0xdfbf,
+ 0xdfc0, 0xdfc1, 0xdfc2, 0xdfc3, 0xdfc4, 0xdfc5, 0xdfc6, 0xdfc7,
+ 0xdfc8, 0xdfc9, 0xdfca, 0xdfcb, 0xdfcc, 0xdfcd, 0xdfce, 0xdfcf,
+ 0xdfd0, 0xdfd1, 0xdfd2, 0xdfd3, 0xdfd4, 0xdfd5, 0xdfd6, 0xdfd7,
+ 0xdfd8, 0xdfd9, 0xdfda, 0xdfdb, 0xdfdc, 0xdfdd, 0xdfde, 0xdfdf,
+ 0xdfe0, 0xdfe1, 0xdfe2, 0xdfe3, 0xdfe4, 0xdfe5, 0xdfe6, 0xdfe7,
+ 0xdfe8, 0xdfe9, 0xdfea, 0xdfeb, 0xdfec, 0xdfed, 0xdfee, 0xdfef,
+ 0xdff0, 0xdff1, 0xdff2, 0xdff3, 0xdff4, 0xdff5, 0xdff6, 0xdff7,
+ 0xdff8, 0xdff9, 0xdffa, 0xdffb, 0xdffc, 0xdffd, 0xdffe, 0xdfff,
+ 0xe000, 0xe001, 0xe002, 0xe003, 0xe004, 0xe005, 0xe006, 0xe007,
+ 0xe008, 0xe009, 0xe00a, 0xe00b, 0xe00c, 0xe00d, 0xe00e, 0xe00f,
+ 0xe010, 0xe011, 0xe012, 0xe013, 0xe014, 0xe015, 0xe016, 0xe017,
+ 0xe018, 0xe019, 0xe01a, 0xe01b, 0xe01c, 0xe01d, 0xe01e, 0xe01f,
+ 0xe020, 0xe021, 0xe022, 0xe023, 0xe024, 0xe025, 0xe026, 0xe027,
+ 0xe028, 0xe029, 0xe02a, 0xe02b, 0xe02c, 0xe02d, 0xe02e, 0xe02f,
+ 0xe030, 0xe031, 0xe032, 0xe033, 0xe034, 0xe035, 0xe036, 0xe037,
+ 0xe038, 0xe039, 0xe03a, 0xe03b, 0xe03c, 0xe03d, 0xe03e, 0xe03f,
+ 0xe040, 0xe041, 0xe042, 0xe043, 0xe044, 0xe045, 0xe046, 0xe047,
+ 0xe048, 0xe049, 0xe04a, 0xe04b, 0xe04c, 0xe04d, 0xe04e, 0xe04f,
+ 0xe050, 0xe051, 0xe052, 0xe053, 0xe054, 0xe055, 0xe056, 0xe057,
+ 0xe058, 0xe059, 0xe05a, 0xe05b, 0xe05c, 0xe05d, 0xe05e, 0xe05f,
+ 0xe060, 0xe061, 0xe062, 0xe063, 0xe064, 0xe065, 0xe066, 0xe067,
+ 0xe068, 0xe069, 0xe06a, 0xe06b, 0xe06c, 0xe06d, 0xe06e, 0xe06f,
+ 0xe070, 0xe071, 0xe072, 0xe073, 0xe074, 0xe075, 0xe076, 0xe077,
+ 0xe078, 0xe079, 0xe07a, 0xe07b, 0xe07c, 0xe07d, 0xe07e, 0xe07f,
+ 0xe080, 0xe081, 0xe082, 0xe083, 0xe084, 0xe085, 0xe086, 0xe087,
+ 0xe088, 0xe089, 0xe08a, 0xe08b, 0xe08c, 0xe08d, 0xe08e, 0xe08f,
+ 0xe090, 0xe091, 0xe092, 0xe093, 0xe094, 0xe095, 0xe096, 0xe097,
+ 0xe098, 0xe099, 0xe09a, 0xe09b, 0xe09c, 0xe09d, 0xe09e, 0xe09f,
+ 0xe0a0, 0xe0a1, 0xe0a2, 0xe0a3, 0xe0a4, 0xe0a5, 0xe0a6, 0xe0a7,
+ 0xe0a8, 0xe0a9, 0xe0aa, 0xe0ab, 0xe0ac, 0xe0ad, 0xe0ae, 0xe0af,
+ 0xe0b0, 0xe0b1, 0xe0b2, 0xe0b3, 0xe0b4, 0xe0b5, 0xe0b6, 0xe0b7,
+ 0xe0b8, 0xe0b9, 0xe0ba, 0xe0bb, 0xe0bc, 0xe0bd, 0xe0be, 0xe0bf,
+ 0xe0c0, 0xe0c1, 0xe0c2, 0xe0c3, 0xe0c4, 0xe0c5, 0xe0c6, 0xe0c7,
+ 0xe0c8, 0xe0c9, 0xe0ca, 0xe0cb, 0xe0cc, 0xe0cd, 0xe0ce, 0xe0cf,
+ 0xe0d0, 0xe0d1, 0xe0d2, 0xe0d3, 0xe0d4, 0xe0d5, 0xe0d6, 0xe0d7,
+ 0xe0d8, 0xe0d9, 0xe0da, 0xe0db, 0xe0dc, 0xe0dd, 0xe0de, 0xe0df,
+ 0xe0e0, 0xe0e1, 0xe0e2, 0xe0e3, 0xe0e4, 0xe0e5, 0xe0e6, 0xe0e7,
+ 0xe0e8, 0xe0e9, 0xe0ea, 0xe0eb, 0xe0ec, 0xe0ed, 0xe0ee, 0xe0ef,
+ 0xe0f0, 0xe0f1, 0xe0f2, 0xe0f3, 0xe0f4, 0xe0f5, 0xe0f6, 0xe0f7,
+ 0xe0f8, 0xe0f9, 0xe0fa, 0xe0fb, 0xe0fc, 0xe0fd, 0xe0fe, 0xe0ff,
+ 0xe100, 0xe101, 0xe102, 0xe103, 0xe104, 0xe105, 0xe106, 0xe107,
+ 0xe108, 0xe109, 0xe10a, 0xe10b, 0xe10c, 0xe10d, 0xe10e, 0xe10f,
+ 0xe110, 0xe111, 0xe112, 0xe113, 0xe114, 0xe115, 0xe116, 0xe117,
+ 0xe118, 0xe119, 0xe11a, 0xe11b, 0xe11c, 0xe11d, 0xe11e, 0xe11f,
+ 0xe120, 0xe121, 0xe122, 0xe123, 0xe124, 0xe125, 0xe126, 0xe127,
+ 0xe128, 0xe129, 0xe12a, 0xe12b, 0xe12c, 0xe12d, 0xe12e, 0xe12f,
+ 0xe130, 0xe131, 0xe132, 0xe133, 0xe134, 0xe135, 0xe136, 0xe137,
+ 0xe138, 0xe139, 0xe13a, 0xe13b, 0xe13c, 0xe13d, 0xe13e, 0xe13f,
+ 0xe140, 0xe141, 0xe142, 0xe143, 0xe144, 0xe145, 0xe146, 0xe147,
+ 0xe148, 0xe149, 0xe14a, 0xe14b, 0xe14c, 0xe14d, 0xe14e, 0xe14f,
+ 0xe150, 0xe151, 0xe152, 0xe153, 0xe154, 0xe155, 0xe156, 0xe157,
+ 0xe158, 0xe159, 0xe15a, 0xe15b, 0xe15c, 0xe15d, 0xe15e, 0xe15f,
+ 0xe160, 0xe161, 0xe162, 0xe163, 0xe164, 0xe165, 0xe166, 0xe167,
+ 0xe168, 0xe169, 0xe16a, 0xe16b, 0xe16c, 0xe16d, 0xe16e, 0xe16f,
+ 0xe170, 0xe171, 0xe172, 0xe173, 0xe174, 0xe175, 0xe176, 0xe177,
+ 0xe178, 0xe179, 0xe17a, 0xe17b, 0xe17c, 0xe17d, 0xe17e, 0xe17f,
+ 0xe180, 0xe181, 0xe182, 0xe183, 0xe184, 0xe185, 0xe186, 0xe187,
+ 0xe188, 0xe189, 0xe18a, 0xe18b, 0xe18c, 0xe18d, 0xe18e, 0xe18f,
+ 0xe190, 0xe191, 0xe192, 0xe193, 0xe194, 0xe195, 0xe196, 0xe197,
+ 0xe198, 0xe199, 0xe19a, 0xe19b, 0xe19c, 0xe19d, 0xe19e, 0xe19f,
+ 0xe1a0, 0xe1a1, 0xe1a2, 0xe1a3, 0xe1a4, 0xe1a5, 0xe1a6, 0xe1a7,
+ 0xe1a8, 0xe1a9, 0xe1aa, 0xe1ab, 0xe1ac, 0xe1ad, 0xe1ae, 0xe1af,
+ 0xe1b0, 0xe1b1, 0xe1b2, 0xe1b3, 0xe1b4, 0xe1b5, 0xe1b6, 0xe1b7,
+ 0xe1b8, 0xe1b9, 0xe1ba, 0xe1bb, 0xe1bc, 0xe1bd, 0xe1be, 0xe1bf,
+ 0xe1c0, 0xe1c1, 0xe1c2, 0xe1c3, 0xe1c4, 0xe1c5, 0xe1c6, 0xe1c7,
+ 0xe1c8, 0xe1c9, 0xe1ca, 0xe1cb, 0xe1cc, 0xe1cd, 0xe1ce, 0xe1cf,
+ 0xe1d0, 0xe1d1, 0xe1d2, 0xe1d3, 0xe1d4, 0xe1d5, 0xe1d6, 0xe1d7,
+ 0xe1d8, 0xe1d9, 0xe1da, 0xe1db, 0xe1dc, 0xe1dd, 0xe1de, 0xe1df,
+ 0xe1e0, 0xe1e1, 0xe1e2, 0xe1e3, 0xe1e4, 0xe1e5, 0xe1e6, 0xe1e7,
+ 0xe1e8, 0xe1e9, 0xe1ea, 0xe1eb, 0xe1ec, 0xe1ed, 0xe1ee, 0xe1ef,
+ 0xe1f0, 0xe1f1, 0xe1f2, 0xe1f3, 0xe1f4, 0xe1f5, 0xe1f6, 0xe1f7,
+ 0xe1f8, 0xe1f9, 0xe1fa, 0xe1fb, 0xe1fc, 0xe1fd, 0xe1fe, 0xe1ff,
+ 0xe200, 0xe201, 0xe202, 0xe203, 0xe204, 0xe205, 0xe206, 0xe207,
+ 0xe208, 0xe209, 0xe20a, 0xe20b, 0xe20c, 0xe20d, 0xe20e, 0xe20f,
+ 0xe210, 0xe211, 0xe212, 0xe213, 0xe214, 0xe215, 0xe216, 0xe217,
+ 0xe218, 0xe219, 0xe21a, 0xe21b, 0xe21c, 0xe21d, 0xe21e, 0xe21f,
+ 0xe220, 0xe221, 0xe222, 0xe223, 0xe224, 0xe225, 0xe226, 0xe227,
+ 0xe228, 0xe229, 0xe22a, 0xe22b, 0xe22c, 0xe22d, 0xe22e, 0xe22f,
+ 0xe230, 0xe231, 0xe232, 0xe233, 0xe234, 0xe235, 0xe236, 0xe237,
+ 0xe238, 0xe239, 0xe23a, 0xe23b, 0xe23c, 0xe23d, 0xe23e, 0xe23f,
+ 0xe240, 0xe241, 0xe242, 0xe243, 0xe244, 0xe245, 0xe246, 0xe247,
+ 0xe248, 0xe249, 0xe24a, 0xe24b, 0xe24c, 0xe24d, 0xe24e, 0xe24f,
+ 0xe250, 0xe251, 0xe252, 0xe253, 0xe254, 0xe255, 0xe256, 0xe257,
+ 0xe258, 0xe259, 0xe25a, 0xe25b, 0xe25c, 0xe25d, 0xe25e, 0xe25f,
+ 0xe260, 0xe261, 0xe262, 0xe263, 0xe264, 0xe265, 0xe266, 0xe267,
+ 0xe268, 0xe269, 0xe26a, 0xe26b, 0xe26c, 0xe26d, 0xe26e, 0xe26f,
+ 0xe270, 0xe271, 0xe272, 0xe273, 0xe274, 0xe275, 0xe276, 0xe277,
+ 0xe278, 0xe279, 0xe27a, 0xe27b, 0xe27c, 0xe27d, 0xe27e, 0xe27f,
+ 0xe280, 0xe281, 0xe282, 0xe283, 0xe284, 0xe285, 0xe286, 0xe287,
+ 0xe288, 0xe289, 0xe28a, 0xe28b, 0xe28c, 0xe28d, 0xe28e, 0xe28f,
+ 0xe290, 0xe291, 0xe292, 0xe293, 0xe294, 0xe295, 0xe296, 0xe297,
+ 0xe298, 0xe299, 0xe29a, 0xe29b, 0xe29c, 0xe29d, 0xe29e, 0xe29f,
+ 0xe2a0, 0xe2a1, 0xe2a2, 0xe2a3, 0xe2a4, 0xe2a5, 0xe2a6, 0xe2a7,
+ 0xe2a8, 0xe2a9, 0xe2aa, 0xe2ab, 0xe2ac, 0xe2ad, 0xe2ae, 0xe2af,
+ 0xe2b0, 0xe2b1, 0xe2b2, 0xe2b3, 0xe2b4, 0xe2b5, 0xe2b6, 0xe2b7,
+ 0xe2b8, 0xe2b9, 0xe2ba, 0xe2bb, 0xe2bc, 0xe2bd, 0xe2be, 0xe2bf,
+ 0xe2c0, 0xe2c1, 0xe2c2, 0xe2c3, 0xe2c4, 0xe2c5, 0xe2c6, 0xe2c7,
+ 0xe2c8, 0xe2c9, 0xe2ca, 0xe2cb, 0xe2cc, 0xe2cd, 0xe2ce, 0xe2cf,
+ 0xe2d0, 0xe2d1, 0xe2d2, 0xe2d3, 0xe2d4, 0xe2d5, 0xe2d6, 0xe2d7,
+ 0xe2d8, 0xe2d9, 0xe2da, 0xe2db, 0xe2dc, 0xe2dd, 0xe2de, 0xe2df,
+ 0xe2e0, 0xe2e1, 0xe2e2, 0xe2e3, 0xe2e4, 0xe2e5, 0xe2e6, 0xe2e7,
+ 0xe2e8, 0xe2e9, 0xe2ea, 0xe2eb, 0xe2ec, 0xe2ed, 0xe2ee, 0xe2ef,
+ 0xe2f0, 0xe2f1, 0xe2f2, 0xe2f3, 0xe2f4, 0xe2f5, 0xe2f6, 0xe2f7,
+ 0xe2f8, 0xe2f9, 0xe2fa, 0xe2fb, 0xe2fc, 0xe2fd, 0xe2fe, 0xe2ff,
+ 0xe300, 0xe301, 0xe302, 0xe303, 0xe304, 0xe305, 0xe306, 0xe307,
+ 0xe308, 0xe309, 0xe30a, 0xe30b, 0xe30c, 0xe30d, 0xe30e, 0xe30f,
+ 0xe310, 0xe311, 0xe312, 0xe313, 0xe314, 0xe315, 0xe316, 0xe317,
+ 0xe318, 0xe319, 0xe31a, 0xe31b, 0xe31c, 0xe31d, 0xe31e, 0xe31f,
+ 0xe320, 0xe321, 0xe322, 0xe323, 0xe324, 0xe325, 0xe326, 0xe327,
+ 0xe328, 0xe329, 0xe32a, 0xe32b, 0xe32c, 0xe32d, 0xe32e, 0xe32f,
+ 0xe330, 0xe331, 0xe332, 0xe333, 0xe334, 0xe335, 0xe336, 0xe337,
+ 0xe338, 0xe339, 0xe33a, 0xe33b, 0xe33c, 0xe33d, 0xe33e, 0xe33f,
+ 0xe340, 0xe341, 0xe342, 0xe343, 0xe344, 0xe345, 0xe346, 0xe347,
+ 0xe348, 0xe349, 0xe34a, 0xe34b, 0xe34c, 0xe34d, 0xe34e, 0xe34f,
+ 0xe350, 0xe351, 0xe352, 0xe353, 0xe354, 0xe355, 0xe356, 0xe357,
+ 0xe358, 0xe359, 0xe35a, 0xe35b, 0xe35c, 0xe35d, 0xe35e, 0xe35f,
+ 0xe360, 0xe361, 0xe362, 0xe363, 0xe364, 0xe365, 0xe366, 0xe367,
+ 0xe368, 0xe369, 0xe36a, 0xe36b, 0xe36c, 0xe36d, 0xe36e, 0xe36f,
+ 0xe370, 0xe371, 0xe372, 0xe373, 0xe374, 0xe375, 0xe376, 0xe377,
+ 0xe378, 0xe379, 0xe37a, 0xe37b, 0xe37c, 0xe37d, 0xe37e, 0xe37f,
+ 0xe380, 0xe381, 0xe382, 0xe383, 0xe384, 0xe385, 0xe386, 0xe387,
+ 0xe388, 0xe389, 0xe38a, 0xe38b, 0xe38c, 0xe38d, 0xe38e, 0xe38f,
+ 0xe390, 0xe391, 0xe392, 0xe393, 0xe394, 0xe395, 0xe396, 0xe397,
+ 0xe398, 0xe399, 0xe39a, 0xe39b, 0xe39c, 0xe39d, 0xe39e, 0xe39f,
+ 0xe3a0, 0xe3a1, 0xe3a2, 0xe3a3, 0xe3a4, 0xe3a5, 0xe3a6, 0xe3a7,
+ 0xe3a8, 0xe3a9, 0xe3aa, 0xe3ab, 0xe3ac, 0xe3ad, 0xe3ae, 0xe3af,
+ 0xe3b0, 0xe3b1, 0xe3b2, 0xe3b3, 0xe3b4, 0xe3b5, 0xe3b6, 0xe3b7,
+ 0xe3b8, 0xe3b9, 0xe3ba, 0xe3bb, 0xe3bc, 0xe3bd, 0xe3be, 0xe3bf,
+ 0xe3c0, 0xe3c1, 0xe3c2, 0xe3c3, 0xe3c4, 0xe3c5, 0xe3c6, 0xe3c7,
+ 0xe3c8, 0xe3c9, 0xe3ca, 0xe3cb, 0xe3cc, 0xe3cd, 0xe3ce, 0xe3cf,
+ 0xe3d0, 0xe3d1, 0xe3d2, 0xe3d3, 0xe3d4, 0xe3d5, 0xe3d6, 0xe3d7,
+ 0xe3d8, 0xe3d9, 0xe3da, 0xe3db, 0xe3dc, 0xe3dd, 0xe3de, 0xe3df,
+ 0xe3e0, 0xe3e1, 0xe3e2, 0xe3e3, 0xe3e4, 0xe3e5, 0xe3e6, 0xe3e7,
+ 0xe3e8, 0xe3e9, 0xe3ea, 0xe3eb, 0xe3ec, 0xe3ed, 0xe3ee, 0xe3ef,
+ 0xe3f0, 0xe3f1, 0xe3f2, 0xe3f3, 0xe3f4, 0xe3f5, 0xe3f6, 0xe3f7,
+ 0xe3f8, 0xe3f9, 0xe3fa, 0xe3fb, 0xe3fc, 0xe3fd, 0xe3fe, 0xe3ff,
+ 0xe400, 0xe401, 0xe402, 0xe403, 0xe404, 0xe405, 0xe406, 0xe407,
+ 0xe408, 0xe409, 0xe40a, 0xe40b, 0xe40c, 0xe40d, 0xe40e, 0xe40f,
+ 0xe410, 0xe411, 0xe412, 0xe413, 0xe414, 0xe415, 0xe416, 0xe417,
+ 0xe418, 0xe419, 0xe41a, 0xe41b, 0xe41c, 0xe41d, 0xe41e, 0xe41f,
+ 0xe420, 0xe421, 0xe422, 0xe423, 0xe424, 0xe425, 0xe426, 0xe427,
+ 0xe428, 0xe429, 0xe42a, 0xe42b, 0xe42c, 0xe42d, 0xe42e, 0xe42f,
+ 0xe430, 0xe431, 0xe432, 0xe433, 0xe434, 0xe435, 0xe436, 0xe437,
+ 0xe438, 0xe439, 0xe43a, 0xe43b, 0xe43c, 0xe43d, 0xe43e, 0xe43f,
+ 0xe440, 0xe441, 0xe442, 0xe443, 0xe444, 0xe445, 0xe446, 0xe447,
+ 0xe448, 0xe449, 0xe44a, 0xe44b, 0xe44c, 0xe44d, 0xe44e, 0xe44f,
+ 0xe450, 0xe451, 0xe452, 0xe453, 0xe454, 0xe455, 0xe456, 0xe457,
+ 0xe458, 0xe459, 0xe45a, 0xe45b, 0xe45c, 0xe45d, 0xe45e, 0xe45f,
+ 0xe460, 0xe461, 0xe462, 0xe463, 0xe464, 0xe465, 0xe466, 0xe467,
+ 0xe468, 0xe469, 0xe46a, 0xe46b, 0xe46c, 0xe46d, 0xe46e, 0xe46f,
+ 0xe470, 0xe471, 0xe472, 0xe473, 0xe474, 0xe475, 0xe476, 0xe477,
+ 0xe478, 0xe479, 0xe47a, 0xe47b, 0xe47c, 0xe47d, 0xe47e, 0xe47f,
+ 0xe480, 0xe481, 0xe482, 0xe483, 0xe484, 0xe485, 0xe486, 0xe487,
+ 0xe488, 0xe489, 0xe48a, 0xe48b, 0xe48c, 0xe48d, 0xe48e, 0xe48f,
+ 0xe490, 0xe491, 0xe492, 0xe493, 0xe494, 0xe495, 0xe496, 0xe497,
+ 0xe498, 0xe499, 0xe49a, 0xe49b, 0xe49c, 0xe49d, 0xe49e, 0xe49f,
+ 0xe4a0, 0xe4a1, 0xe4a2, 0xe4a3, 0xe4a4, 0xe4a5, 0xe4a6, 0xe4a7,
+ 0xe4a8, 0xe4a9, 0xe4aa, 0xe4ab, 0xe4ac, 0xe4ad, 0xe4ae, 0xe4af,
+ 0xe4b0, 0xe4b1, 0xe4b2, 0xe4b3, 0xe4b4, 0xe4b5, 0xe4b6, 0xe4b7,
+ 0xe4b8, 0xe4b9, 0xe4ba, 0xe4bb, 0xe4bc, 0xe4bd, 0xe4be, 0xe4bf,
+ 0xe4c0, 0xe4c1, 0xe4c2, 0xe4c3, 0xe4c4, 0xe4c5, 0xe4c6, 0xe4c7,
+ 0xe4c8, 0xe4c9, 0xe4ca, 0xe4cb, 0xe4cc, 0xe4cd, 0xe4ce, 0xe4cf,
+ 0xe4d0, 0xe4d1, 0xe4d2, 0xe4d3, 0xe4d4, 0xe4d5, 0xe4d6, 0xe4d7,
+ 0xe4d8, 0xe4d9, 0xe4da, 0xe4db, 0xe4dc, 0xe4dd, 0xe4de, 0xe4df,
+ 0xe4e0, 0xe4e1, 0xe4e2, 0xe4e3, 0xe4e4, 0xe4e5, 0xe4e6, 0xe4e7,
+ 0xe4e8, 0xe4e9, 0xe4ea, 0xe4eb, 0xe4ec, 0xe4ed, 0xe4ee, 0xe4ef,
+ 0xe4f0, 0xe4f1, 0xe4f2, 0xe4f3, 0xe4f4, 0xe4f5, 0xe4f6, 0xe4f7,
+ 0xe4f8, 0xe4f9, 0xe4fa, 0xe4fb, 0xe4fc, 0xe4fd, 0xe4fe, 0xe4ff,
+ 0xe500, 0xe501, 0xe502, 0xe503, 0xe504, 0xe505, 0xe506, 0xe507,
+ 0xe508, 0xe509, 0xe50a, 0xe50b, 0xe50c, 0xe50d, 0xe50e, 0xe50f,
+ 0xe510, 0xe511, 0xe512, 0xe513, 0xe514, 0xe515, 0xe516, 0xe517,
+ 0xe518, 0xe519, 0xe51a, 0xe51b, 0xe51c, 0xe51d, 0xe51e, 0xe51f,
+ 0xe520, 0xe521, 0xe522, 0xe523, 0xe524, 0xe525, 0xe526, 0xe527,
+ 0xe528, 0xe529, 0xe52a, 0xe52b, 0xe52c, 0xe52d, 0xe52e, 0xe52f,
+ 0xe530, 0xe531, 0xe532, 0xe533, 0xe534, 0xe535, 0xe536, 0xe537,
+ 0xe538, 0xe539, 0xe53a, 0xe53b, 0xe53c, 0xe53d, 0xe53e, 0xe53f,
+ 0xe540, 0xe541, 0xe542, 0xe543, 0xe544, 0xe545, 0xe546, 0xe547,
+ 0xe548, 0xe549, 0xe54a, 0xe54b, 0xe54c, 0xe54d, 0xe54e, 0xe54f,
+ 0xe550, 0xe551, 0xe552, 0xe553, 0xe554, 0xe555, 0xe556, 0xe557,
+ 0xe558, 0xe559, 0xe55a, 0xe55b, 0xe55c, 0xe55d, 0xe55e, 0xe55f,
+ 0xe560, 0xe561, 0xe562, 0xe563, 0xe564, 0xe565, 0xe566, 0xe567,
+ 0xe568, 0xe569, 0xe56a, 0xe56b, 0xe56c, 0xe56d, 0xe56e, 0xe56f,
+ 0xe570, 0xe571, 0xe572, 0xe573, 0xe574, 0xe575, 0xe576, 0xe577,
+ 0xe578, 0xe579, 0xe57a, 0xe57b, 0xe57c, 0xe57d, 0xe57e, 0xe57f,
+ 0xe580, 0xe581, 0xe582, 0xe583, 0xe584, 0xe585, 0xe586, 0xe587,
+ 0xe588, 0xe589, 0xe58a, 0xe58b, 0xe58c, 0xe58d, 0xe58e, 0xe58f,
+ 0xe590, 0xe591, 0xe592, 0xe593, 0xe594, 0xe595, 0xe596, 0xe597,
+ 0xe598, 0xe599, 0xe59a, 0xe59b, 0xe59c, 0xe59d, 0xe59e, 0xe59f,
+ 0xe5a0, 0xe5a1, 0xe5a2, 0xe5a3, 0xe5a4, 0xe5a5, 0xe5a6, 0xe5a7,
+ 0xe5a8, 0xe5a9, 0xe5aa, 0xe5ab, 0xe5ac, 0xe5ad, 0xe5ae, 0xe5af,
+ 0xe5b0, 0xe5b1, 0xe5b2, 0xe5b3, 0xe5b4, 0xe5b5, 0xe5b6, 0xe5b7,
+ 0xe5b8, 0xe5b9, 0xe5ba, 0xe5bb, 0xe5bc, 0xe5bd, 0xe5be, 0xe5bf,
+ 0xe5c0, 0xe5c1, 0xe5c2, 0xe5c3, 0xe5c4, 0xe5c5, 0xe5c6, 0xe5c7,
+ 0xe5c8, 0xe5c9, 0xe5ca, 0xe5cb, 0xe5cc, 0xe5cd, 0xe5ce, 0xe5cf,
+ 0xe5d0, 0xe5d1, 0xe5d2, 0xe5d3, 0xe5d4, 0xe5d5, 0xe5d6, 0xe5d7,
+ 0xe5d8, 0xe5d9, 0xe5da, 0xe5db, 0xe5dc, 0xe5dd, 0xe5de, 0xe5df,
+ 0xe5e0, 0xe5e1, 0xe5e2, 0xe5e3, 0xe5e4, 0xe5e5, 0xe5e6, 0xe5e7,
+ 0xe5e8, 0xe5e9, 0xe5ea, 0xe5eb, 0xe5ec, 0xe5ed, 0xe5ee, 0xe5ef,
+ 0xe5f0, 0xe5f1, 0xe5f2, 0xe5f3, 0xe5f4, 0xe5f5, 0xe5f6, 0xe5f7,
+ 0xe5f8, 0xe5f9, 0xe5fa, 0xe5fb, 0xe5fc, 0xe5fd, 0xe5fe, 0xe5ff,
+ 0xe600, 0xe601, 0xe602, 0xe603, 0xe604, 0xe605, 0xe606, 0xe607,
+ 0xe608, 0xe609, 0xe60a, 0xe60b, 0xe60c, 0xe60d, 0xe60e, 0xe60f,
+ 0xe610, 0xe611, 0xe612, 0xe613, 0xe614, 0xe615, 0xe616, 0xe617,
+ 0xe618, 0xe619, 0xe61a, 0xe61b, 0xe61c, 0xe61d, 0xe61e, 0xe61f,
+ 0xe620, 0xe621, 0xe622, 0xe623, 0xe624, 0xe625, 0xe626, 0xe627,
+ 0xe628, 0xe629, 0xe62a, 0xe62b, 0xe62c, 0xe62d, 0xe62e, 0xe62f,
+ 0xe630, 0xe631, 0xe632, 0xe633, 0xe634, 0xe635, 0xe636, 0xe637,
+ 0xe638, 0xe639, 0xe63a, 0xe63b, 0xe63c, 0xe63d, 0xe63e, 0xe63f,
+ 0xe640, 0xe641, 0xe642, 0xe643, 0xe644, 0xe645, 0xe646, 0xe647,
+ 0xe648, 0xe649, 0xe64a, 0xe64b, 0xe64c, 0xe64d, 0xe64e, 0xe64f,
+ 0xe650, 0xe651, 0xe652, 0xe653, 0xe654, 0xe655, 0xe656, 0xe657,
+ 0xe658, 0xe659, 0xe65a, 0xe65b, 0xe65c, 0xe65d, 0xe65e, 0xe65f,
+ 0xe660, 0xe661, 0xe662, 0xe663, 0xe664, 0xe665, 0xe666, 0xe667,
+ 0xe668, 0xe669, 0xe66a, 0xe66b, 0xe66c, 0xe66d, 0xe66e, 0xe66f,
+ 0xe670, 0xe671, 0xe672, 0xe673, 0xe674, 0xe675, 0xe676, 0xe677,
+ 0xe678, 0xe679, 0xe67a, 0xe67b, 0xe67c, 0xe67d, 0xe67e, 0xe67f,
+ 0xe680, 0xe681, 0xe682, 0xe683, 0xe684, 0xe685, 0xe686, 0xe687,
+ 0xe688, 0xe689, 0xe68a, 0xe68b, 0xe68c, 0xe68d, 0xe68e, 0xe68f,
+ 0xe690, 0xe691, 0xe692, 0xe693, 0xe694, 0xe695, 0xe696, 0xe697,
+ 0xe698, 0xe699, 0xe69a, 0xe69b, 0xe69c, 0xe69d, 0xe69e, 0xe69f,
+ 0xe6a0, 0xe6a1, 0xe6a2, 0xe6a3, 0xe6a4, 0xe6a5, 0xe6a6, 0xe6a7,
+ 0xe6a8, 0xe6a9, 0xe6aa, 0xe6ab, 0xe6ac, 0xe6ad, 0xe6ae, 0xe6af,
+ 0xe6b0, 0xe6b1, 0xe6b2, 0xe6b3, 0xe6b4, 0xe6b5, 0xe6b6, 0xe6b7,
+ 0xe6b8, 0xe6b9, 0xe6ba, 0xe6bb, 0xe6bc, 0xe6bd, 0xe6be, 0xe6bf,
+ 0xe6c0, 0xe6c1, 0xe6c2, 0xe6c3, 0xe6c4, 0xe6c5, 0xe6c6, 0xe6c7,
+ 0xe6c8, 0xe6c9, 0xe6ca, 0xe6cb, 0xe6cc, 0xe6cd, 0xe6ce, 0xe6cf,
+ 0xe6d0, 0xe6d1, 0xe6d2, 0xe6d3, 0xe6d4, 0xe6d5, 0xe6d6, 0xe6d7,
+ 0xe6d8, 0xe6d9, 0xe6da, 0xe6db, 0xe6dc, 0xe6dd, 0xe6de, 0xe6df,
+ 0xe6e0, 0xe6e1, 0xe6e2, 0xe6e3, 0xe6e4, 0xe6e5, 0xe6e6, 0xe6e7,
+ 0xe6e8, 0xe6e9, 0xe6ea, 0xe6eb, 0xe6ec, 0xe6ed, 0xe6ee, 0xe6ef,
+ 0xe6f0, 0xe6f1, 0xe6f2, 0xe6f3, 0xe6f4, 0xe6f5, 0xe6f6, 0xe6f7,
+ 0xe6f8, 0xe6f9, 0xe6fa, 0xe6fb, 0xe6fc, 0xe6fd, 0xe6fe, 0xe6ff,
+ 0xe700, 0xe701, 0xe702, 0xe703, 0xe704, 0xe705, 0xe706, 0xe707,
+ 0xe708, 0xe709, 0xe70a, 0xe70b, 0xe70c, 0xe70d, 0xe70e, 0xe70f,
+ 0xe710, 0xe711, 0xe712, 0xe713, 0xe714, 0xe715, 0xe716, 0xe717,
+ 0xe718, 0xe719, 0xe71a, 0xe71b, 0xe71c, 0xe71d, 0xe71e, 0xe71f,
+ 0xe720, 0xe721, 0xe722, 0xe723, 0xe724, 0xe725, 0xe726, 0xe727,
+ 0xe728, 0xe729, 0xe72a, 0xe72b, 0xe72c, 0xe72d, 0xe72e, 0xe72f,
+ 0xe730, 0xe731, 0xe732, 0xe733, 0xe734, 0xe735, 0xe736, 0xe737,
+ 0xe738, 0xe739, 0xe73a, 0xe73b, 0xe73c, 0xe73d, 0xe73e, 0xe73f,
+ 0xe740, 0xe741, 0xe742, 0xe743, 0xe744, 0xe745, 0xe746, 0xe747,
+ 0xe748, 0xe749, 0xe74a, 0xe74b, 0xe74c, 0xe74d, 0xe74e, 0xe74f,
+ 0xe750, 0xe751, 0xe752, 0xe753, 0xe754, 0xe755, 0xe756, 0xe757,
+ 0xe758, 0xe759, 0xe75a, 0xe75b, 0xe75c, 0xe75d, 0xe75e, 0xe75f,
+ 0xe760, 0xe761, 0xe762, 0xe763, 0xe764, 0xe765, 0xe766, 0xe767,
+ 0xe768, 0xe769, 0xe76a, 0xe76b, 0xe76c, 0xe76d, 0xe76e, 0xe76f,
+ 0xe770, 0xe771, 0xe772, 0xe773, 0xe774, 0xe775, 0xe776, 0xe777,
+ 0xe778, 0xe779, 0xe77a, 0xe77b, 0xe77c, 0xe77d, 0xe77e, 0xe77f,
+ 0xe780, 0xe781, 0xe782, 0xe783, 0xe784, 0xe785, 0xe786, 0xe787,
+ 0xe788, 0xe789, 0xe78a, 0xe78b, 0xe78c, 0xe78d, 0xe78e, 0xe78f,
+ 0xe790, 0xe791, 0xe792, 0xe793, 0xe794, 0xe795, 0xe796, 0xe797,
+ 0xe798, 0xe799, 0xe79a, 0xe79b, 0xe79c, 0xe79d, 0xe79e, 0xe79f,
+ 0xe7a0, 0xe7a1, 0xe7a2, 0xe7a3, 0xe7a4, 0xe7a5, 0xe7a6, 0xe7a7,
+ 0xe7a8, 0xe7a9, 0xe7aa, 0xe7ab, 0xe7ac, 0xe7ad, 0xe7ae, 0xe7af,
+ 0xe7b0, 0xe7b1, 0xe7b2, 0xe7b3, 0xe7b4, 0xe7b5, 0xe7b6, 0xe7b7,
+ 0xe7b8, 0xe7b9, 0xe7ba, 0xe7bb, 0xe7bc, 0xe7bd, 0xe7be, 0xe7bf,
+ 0xe7c0, 0xe7c1, 0xe7c2, 0xe7c3, 0xe7c4, 0xe7c5, 0xe7c6, 0xe7c7,
+ 0xe7c8, 0xe7c9, 0xe7ca, 0xe7cb, 0xe7cc, 0xe7cd, 0xe7ce, 0xe7cf,
+ 0xe7d0, 0xe7d1, 0xe7d2, 0xe7d3, 0xe7d4, 0xe7d5, 0xe7d6, 0xe7d7,
+ 0xe7d8, 0xe7d9, 0xe7da, 0xe7db, 0xe7dc, 0xe7dd, 0xe7de, 0xe7df,
+ 0xe7e0, 0xe7e1, 0xe7e2, 0xe7e3, 0xe7e4, 0xe7e5, 0xe7e6, 0xe7e7,
+ 0xe7e8, 0xe7e9, 0xe7ea, 0xe7eb, 0xe7ec, 0xe7ed, 0xe7ee, 0xe7ef,
+ 0xe7f0, 0xe7f1, 0xe7f2, 0xe7f3, 0xe7f4, 0xe7f5, 0xe7f6, 0xe7f7,
+ 0xe7f8, 0xe7f9, 0xe7fa, 0xe7fb, 0xe7fc, 0xe7fd, 0xe7fe, 0xe7ff,
+ 0xe800, 0xe801, 0xe802, 0xe803, 0xe804, 0xe805, 0xe806, 0xe807,
+ 0xe808, 0xe809, 0xe80a, 0xe80b, 0xe80c, 0xe80d, 0xe80e, 0xe80f,
+ 0xe810, 0xe811, 0xe812, 0xe813, 0xe814, 0xe815, 0xe816, 0xe817,
+ 0xe818, 0xe819, 0xe81a, 0xe81b, 0xe81c, 0xe81d, 0xe81e, 0xe81f,
+ 0xe820, 0xe821, 0xe822, 0xe823, 0xe824, 0xe825, 0xe826, 0xe827,
+ 0xe828, 0xe829, 0xe82a, 0xe82b, 0xe82c, 0xe82d, 0xe82e, 0xe82f,
+ 0xe830, 0xe831, 0xe832, 0xe833, 0xe834, 0xe835, 0xe836, 0xe837,
+ 0xe838, 0xe839, 0xe83a, 0xe83b, 0xe83c, 0xe83d, 0xe83e, 0xe83f,
+ 0xe840, 0xe841, 0xe842, 0xe843, 0xe844, 0xe845, 0xe846, 0xe847,
+ 0xe848, 0xe849, 0xe84a, 0xe84b, 0xe84c, 0xe84d, 0xe84e, 0xe84f,
+ 0xe850, 0xe851, 0xe852, 0xe853, 0xe854, 0xe855, 0xe856, 0xe857,
+ 0xe858, 0xe859, 0xe85a, 0xe85b, 0xe85c, 0xe85d, 0xe85e, 0xe85f,
+ 0xe860, 0xe861, 0xe862, 0xe863, 0xe864, 0xe865, 0xe866, 0xe867,
+ 0xe868, 0xe869, 0xe86a, 0xe86b, 0xe86c, 0xe86d, 0xe86e, 0xe86f,
+ 0xe870, 0xe871, 0xe872, 0xe873, 0xe874, 0xe875, 0xe876, 0xe877,
+ 0xe878, 0xe879, 0xe87a, 0xe87b, 0xe87c, 0xe87d, 0xe87e, 0xe87f,
+ 0xe880, 0xe881, 0xe882, 0xe883, 0xe884, 0xe885, 0xe886, 0xe887,
+ 0xe888, 0xe889, 0xe88a, 0xe88b, 0xe88c, 0xe88d, 0xe88e, 0xe88f,
+ 0xe890, 0xe891, 0xe892, 0xe893, 0xe894, 0xe895, 0xe896, 0xe897,
+ 0xe898, 0xe899, 0xe89a, 0xe89b, 0xe89c, 0xe89d, 0xe89e, 0xe89f,
+ 0xe8a0, 0xe8a1, 0xe8a2, 0xe8a3, 0xe8a4, 0xe8a5, 0xe8a6, 0xe8a7,
+ 0xe8a8, 0xe8a9, 0xe8aa, 0xe8ab, 0xe8ac, 0xe8ad, 0xe8ae, 0xe8af,
+ 0xe8b0, 0xe8b1, 0xe8b2, 0xe8b3, 0xe8b4, 0xe8b5, 0xe8b6, 0xe8b7,
+ 0xe8b8, 0xe8b9, 0xe8ba, 0xe8bb, 0xe8bc, 0xe8bd, 0xe8be, 0xe8bf,
+ 0xe8c0, 0xe8c1, 0xe8c2, 0xe8c3, 0xe8c4, 0xe8c5, 0xe8c6, 0xe8c7,
+ 0xe8c8, 0xe8c9, 0xe8ca, 0xe8cb, 0xe8cc, 0xe8cd, 0xe8ce, 0xe8cf,
+ 0xe8d0, 0xe8d1, 0xe8d2, 0xe8d3, 0xe8d4, 0xe8d5, 0xe8d6, 0xe8d7,
+ 0xe8d8, 0xe8d9, 0xe8da, 0xe8db, 0xe8dc, 0xe8dd, 0xe8de, 0xe8df,
+ 0xe8e0, 0xe8e1, 0xe8e2, 0xe8e3, 0xe8e4, 0xe8e5, 0xe8e6, 0xe8e7,
+ 0xe8e8, 0xe8e9, 0xe8ea, 0xe8eb, 0xe8ec, 0xe8ed, 0xe8ee, 0xe8ef,
+ 0xe8f0, 0xe8f1, 0xe8f2, 0xe8f3, 0xe8f4, 0xe8f5, 0xe8f6, 0xe8f7,
+ 0xe8f8, 0xe8f9, 0xe8fa, 0xe8fb, 0xe8fc, 0xe8fd, 0xe8fe, 0xe8ff,
+ 0xe900, 0xe901, 0xe902, 0xe903, 0xe904, 0xe905, 0xe906, 0xe907,
+ 0xe908, 0xe909, 0xe90a, 0xe90b, 0xe90c, 0xe90d, 0xe90e, 0xe90f,
+ 0xe910, 0xe911, 0xe912, 0xe913, 0xe914, 0xe915, 0xe916, 0xe917,
+ 0xe918, 0xe919, 0xe91a, 0xe91b, 0xe91c, 0xe91d, 0xe91e, 0xe91f,
+ 0xe920, 0xe921, 0xe922, 0xe923, 0xe924, 0xe925, 0xe926, 0xe927,
+ 0xe928, 0xe929, 0xe92a, 0xe92b, 0xe92c, 0xe92d, 0xe92e, 0xe92f,
+ 0xe930, 0xe931, 0xe932, 0xe933, 0xe934, 0xe935, 0xe936, 0xe937,
+ 0xe938, 0xe939, 0xe93a, 0xe93b, 0xe93c, 0xe93d, 0xe93e, 0xe93f,
+ 0xe940, 0xe941, 0xe942, 0xe943, 0xe944, 0xe945, 0xe946, 0xe947,
+ 0xe948, 0xe949, 0xe94a, 0xe94b, 0xe94c, 0xe94d, 0xe94e, 0xe94f,
+ 0xe950, 0xe951, 0xe952, 0xe953, 0xe954, 0xe955, 0xe956, 0xe957,
+ 0xe958, 0xe959, 0xe95a, 0xe95b, 0xe95c, 0xe95d, 0xe95e, 0xe95f,
+ 0xe960, 0xe961, 0xe962, 0xe963, 0xe964, 0xe965, 0xe966, 0xe967,
+ 0xe968, 0xe969, 0xe96a, 0xe96b, 0xe96c, 0xe96d, 0xe96e, 0xe96f,
+ 0xe970, 0xe971, 0xe972, 0xe973, 0xe974, 0xe975, 0xe976, 0xe977,
+ 0xe978, 0xe979, 0xe97a, 0xe97b, 0xe97c, 0xe97d, 0xe97e, 0xe97f,
+ 0xe980, 0xe981, 0xe982, 0xe983, 0xe984, 0xe985, 0xe986, 0xe987,
+ 0xe988, 0xe989, 0xe98a, 0xe98b, 0xe98c, 0xe98d, 0xe98e, 0xe98f,
+ 0xe990, 0xe991, 0xe992, 0xe993, 0xe994, 0xe995, 0xe996, 0xe997,
+ 0xe998, 0xe999, 0xe99a, 0xe99b, 0xe99c, 0xe99d, 0xe99e, 0xe99f,
+ 0xe9a0, 0xe9a1, 0xe9a2, 0xe9a3, 0xe9a4, 0xe9a5, 0xe9a6, 0xe9a7,
+ 0xe9a8, 0xe9a9, 0xe9aa, 0xe9ab, 0xe9ac, 0xe9ad, 0xe9ae, 0xe9af,
+ 0xe9b0, 0xe9b1, 0xe9b2, 0xe9b3, 0xe9b4, 0xe9b5, 0xe9b6, 0xe9b7,
+ 0xe9b8, 0xe9b9, 0xe9ba, 0xe9bb, 0xe9bc, 0xe9bd, 0xe9be, 0xe9bf,
+ 0xe9c0, 0xe9c1, 0xe9c2, 0xe9c3, 0xe9c4, 0xe9c5, 0xe9c6, 0xe9c7,
+ 0xe9c8, 0xe9c9, 0xe9ca, 0xe9cb, 0xe9cc, 0xe9cd, 0xe9ce, 0xe9cf,
+ 0xe9d0, 0xe9d1, 0xe9d2, 0xe9d3, 0xe9d4, 0xe9d5, 0xe9d6, 0xe9d7,
+ 0xe9d8, 0xe9d9, 0xe9da, 0xe9db, 0xe9dc, 0xe9dd, 0xe9de, 0xe9df,
+ 0xe9e0, 0xe9e1, 0xe9e2, 0xe9e3, 0xe9e4, 0xe9e5, 0xe9e6, 0xe9e7,
+ 0xe9e8, 0xe9e9, 0xe9ea, 0xe9eb, 0xe9ec, 0xe9ed, 0xe9ee, 0xe9ef,
+ 0xe9f0, 0xe9f1, 0xe9f2, 0xe9f3, 0xe9f4, 0xe9f5, 0xe9f6, 0xe9f7,
+ 0xe9f8, 0xe9f9, 0xe9fa, 0xe9fb, 0xe9fc, 0xe9fd, 0xe9fe, 0xe9ff,
+ 0xea00, 0xea01, 0xea02, 0xea03, 0xea04, 0xea05, 0xea06, 0xea07,
+ 0xea08, 0xea09, 0xea0a, 0xea0b, 0xea0c, 0xea0d, 0xea0e, 0xea0f,
+ 0xea10, 0xea11, 0xea12, 0xea13, 0xea14, 0xea15, 0xea16, 0xea17,
+ 0xea18, 0xea19, 0xea1a, 0xea1b, 0xea1c, 0xea1d, 0xea1e, 0xea1f,
+ 0xea20, 0xea21, 0xea22, 0xea23, 0xea24, 0xea25, 0xea26, 0xea27,
+ 0xea28, 0xea29, 0xea2a, 0xea2b, 0xea2c, 0xea2d, 0xea2e, 0xea2f,
+ 0xea30, 0xea31, 0xea32, 0xea33, 0xea34, 0xea35, 0xea36, 0xea37,
+ 0xea38, 0xea39, 0xea3a, 0xea3b, 0xea3c, 0xea3d, 0xea3e, 0xea3f,
+ 0xea40, 0xea41, 0xea42, 0xea43, 0xea44, 0xea45, 0xea46, 0xea47,
+ 0xea48, 0xea49, 0xea4a, 0xea4b, 0xea4c, 0xea4d, 0xea4e, 0xea4f,
+ 0xea50, 0xea51, 0xea52, 0xea53, 0xea54, 0xea55, 0xea56, 0xea57,
+ 0xea58, 0xea59, 0xea5a, 0xea5b, 0xea5c, 0xea5d, 0xea5e, 0xea5f,
+ 0xea60, 0xea61, 0xea62, 0xea63, 0xea64, 0xea65, 0xea66, 0xea67,
+ 0xea68, 0xea69, 0xea6a, 0xea6b, 0xea6c, 0xea6d, 0xea6e, 0xea6f,
+ 0xea70, 0xea71, 0xea72, 0xea73, 0xea74, 0xea75, 0xea76, 0xea77,
+ 0xea78, 0xea79, 0xea7a, 0xea7b, 0xea7c, 0xea7d, 0xea7e, 0xea7f,
+ 0xea80, 0xea81, 0xea82, 0xea83, 0xea84, 0xea85, 0xea86, 0xea87,
+ 0xea88, 0xea89, 0xea8a, 0xea8b, 0xea8c, 0xea8d, 0xea8e, 0xea8f,
+ 0xea90, 0xea91, 0xea92, 0xea93, 0xea94, 0xea95, 0xea96, 0xea97,
+ 0xea98, 0xea99, 0xea9a, 0xea9b, 0xea9c, 0xea9d, 0xea9e, 0xea9f,
+ 0xeaa0, 0xeaa1, 0xeaa2, 0xeaa3, 0xeaa4, 0xeaa5, 0xeaa6, 0xeaa7,
+ 0xeaa8, 0xeaa9, 0xeaaa, 0xeaab, 0xeaac, 0xeaad, 0xeaae, 0xeaaf,
+ 0xeab0, 0xeab1, 0xeab2, 0xeab3, 0xeab4, 0xeab5, 0xeab6, 0xeab7,
+ 0xeab8, 0xeab9, 0xeaba, 0xeabb, 0xeabc, 0xeabd, 0xeabe, 0xeabf,
+ 0xeac0, 0xeac1, 0xeac2, 0xeac3, 0xeac4, 0xeac5, 0xeac6, 0xeac7,
+ 0xeac8, 0xeac9, 0xeaca, 0xeacb, 0xeacc, 0xeacd, 0xeace, 0xeacf,
+ 0xead0, 0xead1, 0xead2, 0xead3, 0xead4, 0xead5, 0xead6, 0xead7,
+ 0xead8, 0xead9, 0xeada, 0xeadb, 0xeadc, 0xeadd, 0xeade, 0xeadf,
+ 0xeae0, 0xeae1, 0xeae2, 0xeae3, 0xeae4, 0xeae5, 0xeae6, 0xeae7,
+ 0xeae8, 0xeae9, 0xeaea, 0xeaeb, 0xeaec, 0xeaed, 0xeaee, 0xeaef,
+ 0xeaf0, 0xeaf1, 0xeaf2, 0xeaf3, 0xeaf4, 0xeaf5, 0xeaf6, 0xeaf7,
+ 0xeaf8, 0xeaf9, 0xeafa, 0xeafb, 0xeafc, 0xeafd, 0xeafe, 0xeaff,
+ 0xeb00, 0xeb01, 0xeb02, 0xeb03, 0xeb04, 0xeb05, 0xeb06, 0xeb07,
+ 0xeb08, 0xeb09, 0xeb0a, 0xeb0b, 0xeb0c, 0xeb0d, 0xeb0e, 0xeb0f,
+ 0xeb10, 0xeb11, 0xeb12, 0xeb13, 0xeb14, 0xeb15, 0xeb16, 0xeb17,
+ 0xeb18, 0xeb19, 0xeb1a, 0xeb1b, 0xeb1c, 0xeb1d, 0xeb1e, 0xeb1f,
+ 0xeb20, 0xeb21, 0xeb22, 0xeb23, 0xeb24, 0xeb25, 0xeb26, 0xeb27,
+ 0xeb28, 0xeb29, 0xeb2a, 0xeb2b, 0xeb2c, 0xeb2d, 0xeb2e, 0xeb2f,
+ 0xeb30, 0xeb31, 0xeb32, 0xeb33, 0xeb34, 0xeb35, 0xeb36, 0xeb37,
+ 0xeb38, 0xeb39, 0xeb3a, 0xeb3b, 0xeb3c, 0xeb3d, 0xeb3e, 0xeb3f,
+ 0xeb40, 0xeb41, 0xeb42, 0xeb43, 0xeb44, 0xeb45, 0xeb46, 0xeb47,
+ 0xeb48, 0xeb49, 0xeb4a, 0xeb4b, 0xeb4c, 0xeb4d, 0xeb4e, 0xeb4f,
+ 0xeb50, 0xeb51, 0xeb52, 0xeb53, 0xeb54, 0xeb55, 0xeb56, 0xeb57,
+ 0xeb58, 0xeb59, 0xeb5a, 0xeb5b, 0xeb5c, 0xeb5d, 0xeb5e, 0xeb5f,
+ 0xeb60, 0xeb61, 0xeb62, 0xeb63, 0xeb64, 0xeb65, 0xeb66, 0xeb67,
+ 0xeb68, 0xeb69, 0xeb6a, 0xeb6b, 0xeb6c, 0xeb6d, 0xeb6e, 0xeb6f,
+ 0xeb70, 0xeb71, 0xeb72, 0xeb73, 0xeb74, 0xeb75, 0xeb76, 0xeb77,
+ 0xeb78, 0xeb79, 0xeb7a, 0xeb7b, 0xeb7c, 0xeb7d, 0xeb7e, 0xeb7f,
+ 0xeb80, 0xeb81, 0xeb82, 0xeb83, 0xeb84, 0xeb85, 0xeb86, 0xeb87,
+ 0xeb88, 0xeb89, 0xeb8a, 0xeb8b, 0xeb8c, 0xeb8d, 0xeb8e, 0xeb8f,
+ 0xeb90, 0xeb91, 0xeb92, 0xeb93, 0xeb94, 0xeb95, 0xeb96, 0xeb97,
+ 0xeb98, 0xeb99, 0xeb9a, 0xeb9b, 0xeb9c, 0xeb9d, 0xeb9e, 0xeb9f,
+ 0xeba0, 0xeba1, 0xeba2, 0xeba3, 0xeba4, 0xeba5, 0xeba6, 0xeba7,
+ 0xeba8, 0xeba9, 0xebaa, 0xebab, 0xebac, 0xebad, 0xebae, 0xebaf,
+ 0xebb0, 0xebb1, 0xebb2, 0xebb3, 0xebb4, 0xebb5, 0xebb6, 0xebb7,
+ 0xebb8, 0xebb9, 0xebba, 0xebbb, 0xebbc, 0xebbd, 0xebbe, 0xebbf,
+ 0xebc0, 0xebc1, 0xebc2, 0xebc3, 0xebc4, 0xebc5, 0xebc6, 0xebc7,
+ 0xebc8, 0xebc9, 0xebca, 0xebcb, 0xebcc, 0xebcd, 0xebce, 0xebcf,
+ 0xebd0, 0xebd1, 0xebd2, 0xebd3, 0xebd4, 0xebd5, 0xebd6, 0xebd7,
+ 0xebd8, 0xebd9, 0xebda, 0xebdb, 0xebdc, 0xebdd, 0xebde, 0xebdf,
+ 0xebe0, 0xebe1, 0xebe2, 0xebe3, 0xebe4, 0xebe5, 0xebe6, 0xebe7,
+ 0xebe8, 0xebe9, 0xebea, 0xebeb, 0xebec, 0xebed, 0xebee, 0xebef,
+ 0xebf0, 0xebf1, 0xebf2, 0xebf3, 0xebf4, 0xebf5, 0xebf6, 0xebf7,
+ 0xebf8, 0xebf9, 0xebfa, 0xebfb, 0xebfc, 0xebfd, 0xebfe, 0xebff,
+ 0xec00, 0xec01, 0xec02, 0xec03, 0xec04, 0xec05, 0xec06, 0xec07,
+ 0xec08, 0xec09, 0xec0a, 0xec0b, 0xec0c, 0xec0d, 0xec0e, 0xec0f,
+ 0xec10, 0xec11, 0xec12, 0xec13, 0xec14, 0xec15, 0xec16, 0xec17,
+ 0xec18, 0xec19, 0xec1a, 0xec1b, 0xec1c, 0xec1d, 0xec1e, 0xec1f,
+ 0xec20, 0xec21, 0xec22, 0xec23, 0xec24, 0xec25, 0xec26, 0xec27,
+ 0xec28, 0xec29, 0xec2a, 0xec2b, 0xec2c, 0xec2d, 0xec2e, 0xec2f,
+ 0xec30, 0xec31, 0xec32, 0xec33, 0xec34, 0xec35, 0xec36, 0xec37,
+ 0xec38, 0xec39, 0xec3a, 0xec3b, 0xec3c, 0xec3d, 0xec3e, 0xec3f,
+ 0xec40, 0xec41, 0xec42, 0xec43, 0xec44, 0xec45, 0xec46, 0xec47,
+ 0xec48, 0xec49, 0xec4a, 0xec4b, 0xec4c, 0xec4d, 0xec4e, 0xec4f,
+ 0xec50, 0xec51, 0xec52, 0xec53, 0xec54, 0xec55, 0xec56, 0xec57,
+ 0xec58, 0xec59, 0xec5a, 0xec5b, 0xec5c, 0xec5d, 0xec5e, 0xec5f,
+ 0xec60, 0xec61, 0xec62, 0xec63, 0xec64, 0xec65, 0xec66, 0xec67,
+ 0xec68, 0xec69, 0xec6a, 0xec6b, 0xec6c, 0xec6d, 0xec6e, 0xec6f,
+ 0xec70, 0xec71, 0xec72, 0xec73, 0xec74, 0xec75, 0xec76, 0xec77,
+ 0xec78, 0xec79, 0xec7a, 0xec7b, 0xec7c, 0xec7d, 0xec7e, 0xec7f,
+ 0xec80, 0xec81, 0xec82, 0xec83, 0xec84, 0xec85, 0xec86, 0xec87,
+ 0xec88, 0xec89, 0xec8a, 0xec8b, 0xec8c, 0xec8d, 0xec8e, 0xec8f,
+ 0xec90, 0xec91, 0xec92, 0xec93, 0xec94, 0xec95, 0xec96, 0xec97,
+ 0xec98, 0xec99, 0xec9a, 0xec9b, 0xec9c, 0xec9d, 0xec9e, 0xec9f,
+ 0xeca0, 0xeca1, 0xeca2, 0xeca3, 0xeca4, 0xeca5, 0xeca6, 0xeca7,
+ 0xeca8, 0xeca9, 0xecaa, 0xecab, 0xecac, 0xecad, 0xecae, 0xecaf,
+ 0xecb0, 0xecb1, 0xecb2, 0xecb3, 0xecb4, 0xecb5, 0xecb6, 0xecb7,
+ 0xecb8, 0xecb9, 0xecba, 0xecbb, 0xecbc, 0xecbd, 0xecbe, 0xecbf,
+ 0xecc0, 0xecc1, 0xecc2, 0xecc3, 0xecc4, 0xecc5, 0xecc6, 0xecc7,
+ 0xecc8, 0xecc9, 0xecca, 0xeccb, 0xeccc, 0xeccd, 0xecce, 0xeccf,
+ 0xecd0, 0xecd1, 0xecd2, 0xecd3, 0xecd4, 0xecd5, 0xecd6, 0xecd7,
+ 0xecd8, 0xecd9, 0xecda, 0xecdb, 0xecdc, 0xecdd, 0xecde, 0xecdf,
+ 0xece0, 0xece1, 0xece2, 0xece3, 0xece4, 0xece5, 0xece6, 0xece7,
+ 0xece8, 0xece9, 0xecea, 0xeceb, 0xecec, 0xeced, 0xecee, 0xecef,
+ 0xecf0, 0xecf1, 0xecf2, 0xecf3, 0xecf4, 0xecf5, 0xecf6, 0xecf7,
+ 0xecf8, 0xecf9, 0xecfa, 0xecfb, 0xecfc, 0xecfd, 0xecfe, 0xecff,
+ 0xed00, 0xed01, 0xed02, 0xed03, 0xed04, 0xed05, 0xed06, 0xed07,
+ 0xed08, 0xed09, 0xed0a, 0xed0b, 0xed0c, 0xed0d, 0xed0e, 0xed0f,
+ 0xed10, 0xed11, 0xed12, 0xed13, 0xed14, 0xed15, 0xed16, 0xed17,
+ 0xed18, 0xed19, 0xed1a, 0xed1b, 0xed1c, 0xed1d, 0xed1e, 0xed1f,
+ 0xed20, 0xed21, 0xed22, 0xed23, 0xed24, 0xed25, 0xed26, 0xed27,
+ 0xed28, 0xed29, 0xed2a, 0xed2b, 0xed2c, 0xed2d, 0xed2e, 0xed2f,
+ 0xed30, 0xed31, 0xed32, 0xed33, 0xed34, 0xed35, 0xed36, 0xed37,
+ 0xed38, 0xed39, 0xed3a, 0xed3b, 0xed3c, 0xed3d, 0xed3e, 0xed3f,
+ 0xed40, 0xed41, 0xed42, 0xed43, 0xed44, 0xed45, 0xed46, 0xed47,
+ 0xed48, 0xed49, 0xed4a, 0xed4b, 0xed4c, 0xed4d, 0xed4e, 0xed4f,
+ 0xed50, 0xed51, 0xed52, 0xed53, 0xed54, 0xed55, 0xed56, 0xed57,
+ 0xed58, 0xed59, 0xed5a, 0xed5b, 0xed5c, 0xed5d, 0xed5e, 0xed5f,
+ 0xed60, 0xed61, 0xed62, 0xed63, 0xed64, 0xed65, 0xed66, 0xed67,
+ 0xed68, 0xed69, 0xed6a, 0xed6b, 0xed6c, 0xed6d, 0xed6e, 0xed6f,
+ 0xed70, 0xed71, 0xed72, 0xed73, 0xed74, 0xed75, 0xed76, 0xed77,
+ 0xed78, 0xed79, 0xed7a, 0xed7b, 0xed7c, 0xed7d, 0xed7e, 0xed7f,
+ 0xed80, 0xed81, 0xed82, 0xed83, 0xed84, 0xed85, 0xed86, 0xed87,
+ 0xed88, 0xed89, 0xed8a, 0xed8b, 0xed8c, 0xed8d, 0xed8e, 0xed8f,
+ 0xed90, 0xed91, 0xed92, 0xed93, 0xed94, 0xed95, 0xed96, 0xed97,
+ 0xed98, 0xed99, 0xed9a, 0xed9b, 0xed9c, 0xed9d, 0xed9e, 0xed9f,
+ 0xeda0, 0xeda1, 0xeda2, 0xeda3, 0xeda4, 0xeda5, 0xeda6, 0xeda7,
+ 0xeda8, 0xeda9, 0xedaa, 0xedab, 0xedac, 0xedad, 0xedae, 0xedaf,
+ 0xedb0, 0xedb1, 0xedb2, 0xedb3, 0xedb4, 0xedb5, 0xedb6, 0xedb7,
+ 0xedb8, 0xedb9, 0xedba, 0xedbb, 0xedbc, 0xedbd, 0xedbe, 0xedbf,
+ 0xedc0, 0xedc1, 0xedc2, 0xedc3, 0xedc4, 0xedc5, 0xedc6, 0xedc7,
+ 0xedc8, 0xedc9, 0xedca, 0xedcb, 0xedcc, 0xedcd, 0xedce, 0xedcf,
+ 0xedd0, 0xedd1, 0xedd2, 0xedd3, 0xedd4, 0xedd5, 0xedd6, 0xedd7,
+ 0xedd8, 0xedd9, 0xedda, 0xeddb, 0xeddc, 0xeddd, 0xedde, 0xeddf,
+ 0xede0, 0xede1, 0xede2, 0xede3, 0xede4, 0xede5, 0xede6, 0xede7,
+ 0xede8, 0xede9, 0xedea, 0xedeb, 0xedec, 0xeded, 0xedee, 0xedef,
+ 0xedf0, 0xedf1, 0xedf2, 0xedf3, 0xedf4, 0xedf5, 0xedf6, 0xedf7,
+ 0xedf8, 0xedf9, 0xedfa, 0xedfb, 0xedfc, 0xedfd, 0xedfe, 0xedff,
+ 0xee00, 0xee01, 0xee02, 0xee03, 0xee04, 0xee05, 0xee06, 0xee07,
+ 0xee08, 0xee09, 0xee0a, 0xee0b, 0xee0c, 0xee0d, 0xee0e, 0xee0f,
+ 0xee10, 0xee11, 0xee12, 0xee13, 0xee14, 0xee15, 0xee16, 0xee17,
+ 0xee18, 0xee19, 0xee1a, 0xee1b, 0xee1c, 0xee1d, 0xee1e, 0xee1f,
+ 0xee20, 0xee21, 0xee22, 0xee23, 0xee24, 0xee25, 0xee26, 0xee27,
+ 0xee28, 0xee29, 0xee2a, 0xee2b, 0xee2c, 0xee2d, 0xee2e, 0xee2f,
+ 0xee30, 0xee31, 0xee32, 0xee33, 0xee34, 0xee35, 0xee36, 0xee37,
+ 0xee38, 0xee39, 0xee3a, 0xee3b, 0xee3c, 0xee3d, 0xee3e, 0xee3f,
+ 0xee40, 0xee41, 0xee42, 0xee43, 0xee44, 0xee45, 0xee46, 0xee47,
+ 0xee48, 0xee49, 0xee4a, 0xee4b, 0xee4c, 0xee4d, 0xee4e, 0xee4f,
+ 0xee50, 0xee51, 0xee52, 0xee53, 0xee54, 0xee55, 0xee56, 0xee57,
+ 0xee58, 0xee59, 0xee5a, 0xee5b, 0xee5c, 0xee5d, 0xee5e, 0xee5f,
+ 0xee60, 0xee61, 0xee62, 0xee63, 0xee64, 0xee65, 0xee66, 0xee67,
+ 0xee68, 0xee69, 0xee6a, 0xee6b, 0xee6c, 0xee6d, 0xee6e, 0xee6f,
+ 0xee70, 0xee71, 0xee72, 0xee73, 0xee74, 0xee75, 0xee76, 0xee77,
+ 0xee78, 0xee79, 0xee7a, 0xee7b, 0xee7c, 0xee7d, 0xee7e, 0xee7f,
+ 0xee80, 0xee81, 0xee82, 0xee83, 0xee84, 0xee85, 0xee86, 0xee87,
+ 0xee88, 0xee89, 0xee8a, 0xee8b, 0xee8c, 0xee8d, 0xee8e, 0xee8f,
+ 0xee90, 0xee91, 0xee92, 0xee93, 0xee94, 0xee95, 0xee96, 0xee97,
+ 0xee98, 0xee99, 0xee9a, 0xee9b, 0xee9c, 0xee9d, 0xee9e, 0xee9f,
+ 0xeea0, 0xeea1, 0xeea2, 0xeea3, 0xeea4, 0xeea5, 0xeea6, 0xeea7,
+ 0xeea8, 0xeea9, 0xeeaa, 0xeeab, 0xeeac, 0xeead, 0xeeae, 0xeeaf,
+ 0xeeb0, 0xeeb1, 0xeeb2, 0xeeb3, 0xeeb4, 0xeeb5, 0xeeb6, 0xeeb7,
+ 0xeeb8, 0xeeb9, 0xeeba, 0xeebb, 0xeebc, 0xeebd, 0xeebe, 0xeebf,
+ 0xeec0, 0xeec1, 0xeec2, 0xeec3, 0xeec4, 0xeec5, 0xeec6, 0xeec7,
+ 0xeec8, 0xeec9, 0xeeca, 0xeecb, 0xeecc, 0xeecd, 0xeece, 0xeecf,
+ 0xeed0, 0xeed1, 0xeed2, 0xeed3, 0xeed4, 0xeed5, 0xeed6, 0xeed7,
+ 0xeed8, 0xeed9, 0xeeda, 0xeedb, 0xeedc, 0xeedd, 0xeede, 0xeedf,
+ 0xeee0, 0xeee1, 0xeee2, 0xeee3, 0xeee4, 0xeee5, 0xeee6, 0xeee7,
+ 0xeee8, 0xeee9, 0xeeea, 0xeeeb, 0xeeec, 0xeeed, 0xeeee, 0xeeef,
+ 0xeef0, 0xeef1, 0xeef2, 0xeef3, 0xeef4, 0xeef5, 0xeef6, 0xeef7,
+ 0xeef8, 0xeef9, 0xeefa, 0xeefb, 0xeefc, 0xeefd, 0xeefe, 0xeeff,
+ 0xef00, 0xef01, 0xef02, 0xef03, 0xef04, 0xef05, 0xef06, 0xef07,
+ 0xef08, 0xef09, 0xef0a, 0xef0b, 0xef0c, 0xef0d, 0xef0e, 0xef0f,
+ 0xef10, 0xef11, 0xef12, 0xef13, 0xef14, 0xef15, 0xef16, 0xef17,
+ 0xef18, 0xef19, 0xef1a, 0xef1b, 0xef1c, 0xef1d, 0xef1e, 0xef1f,
+ 0xef20, 0xef21, 0xef22, 0xef23, 0xef24, 0xef25, 0xef26, 0xef27,
+ 0xef28, 0xef29, 0xef2a, 0xef2b, 0xef2c, 0xef2d, 0xef2e, 0xef2f,
+ 0xef30, 0xef31, 0xef32, 0xef33, 0xef34, 0xef35, 0xef36, 0xef37,
+ 0xef38, 0xef39, 0xef3a, 0xef3b, 0xef3c, 0xef3d, 0xef3e, 0xef3f,
+ 0xef40, 0xef41, 0xef42, 0xef43, 0xef44, 0xef45, 0xef46, 0xef47,
+ 0xef48, 0xef49, 0xef4a, 0xef4b, 0xef4c, 0xef4d, 0xef4e, 0xef4f,
+ 0xef50, 0xef51, 0xef52, 0xef53, 0xef54, 0xef55, 0xef56, 0xef57,
+ 0xef58, 0xef59, 0xef5a, 0xef5b, 0xef5c, 0xef5d, 0xef5e, 0xef5f,
+ 0xef60, 0xef61, 0xef62, 0xef63, 0xef64, 0xef65, 0xef66, 0xef67,
+ 0xef68, 0xef69, 0xef6a, 0xef6b, 0xef6c, 0xef6d, 0xef6e, 0xef6f,
+ 0xef70, 0xef71, 0xef72, 0xef73, 0xef74, 0xef75, 0xef76, 0xef77,
+ 0xef78, 0xef79, 0xef7a, 0xef7b, 0xef7c, 0xef7d, 0xef7e, 0xef7f,
+ 0xef80, 0xef81, 0xef82, 0xef83, 0xef84, 0xef85, 0xef86, 0xef87,
+ 0xef88, 0xef89, 0xef8a, 0xef8b, 0xef8c, 0xef8d, 0xef8e, 0xef8f,
+ 0xef90, 0xef91, 0xef92, 0xef93, 0xef94, 0xef95, 0xef96, 0xef97,
+ 0xef98, 0xef99, 0xef9a, 0xef9b, 0xef9c, 0xef9d, 0xef9e, 0xef9f,
+ 0xefa0, 0xefa1, 0xefa2, 0xefa3, 0xefa4, 0xefa5, 0xefa6, 0xefa7,
+ 0xefa8, 0xefa9, 0xefaa, 0xefab, 0xefac, 0xefad, 0xefae, 0xefaf,
+ 0xefb0, 0xefb1, 0xefb2, 0xefb3, 0xefb4, 0xefb5, 0xefb6, 0xefb7,
+ 0xefb8, 0xefb9, 0xefba, 0xefbb, 0xefbc, 0xefbd, 0xefbe, 0xefbf,
+ 0xefc0, 0xefc1, 0xefc2, 0xefc3, 0xefc4, 0xefc5, 0xefc6, 0xefc7,
+ 0xefc8, 0xefc9, 0xefca, 0xefcb, 0xefcc, 0xefcd, 0xefce, 0xefcf,
+ 0xefd0, 0xefd1, 0xefd2, 0xefd3, 0xefd4, 0xefd5, 0xefd6, 0xefd7,
+ 0xefd8, 0xefd9, 0xefda, 0xefdb, 0xefdc, 0xefdd, 0xefde, 0xefdf,
+ 0xefe0, 0xefe1, 0xefe2, 0xefe3, 0xefe4, 0xefe5, 0xefe6, 0xefe7,
+ 0xefe8, 0xefe9, 0xefea, 0xefeb, 0xefec, 0xefed, 0xefee, 0xefef,
+ 0xeff0, 0xeff1, 0xeff2, 0xeff3, 0xeff4, 0xeff5, 0xeff6, 0xeff7,
+ 0xeff8, 0xeff9, 0xeffa, 0xeffb, 0xeffc, 0xeffd, 0xeffe, 0xefff,
+ 0xf000, 0xf001, 0xf002, 0xf003, 0xf004, 0xf005, 0xf006, 0xf007,
+ 0xf008, 0xf009, 0xf00a, 0xf00b, 0xf00c, 0xf00d, 0xf00e, 0xf00f,
+ 0xf010, 0xf011, 0xf012, 0xf013, 0xf014, 0xf015, 0xf016, 0xf017,
+ 0xf018, 0xf019, 0xf01a, 0xf01b, 0xf01c, 0xf01d, 0xf01e, 0xf01f,
+ 0xf020, 0xf021, 0xf022, 0xf023, 0xf024, 0xf025, 0xf026, 0xf027,
+ 0xf028, 0xf029, 0xf02a, 0xf02b, 0xf02c, 0xf02d, 0xf02e, 0xf02f,
+ 0xf030, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037,
+ 0xf038, 0xf039, 0xf03a, 0xf03b, 0xf03c, 0xf03d, 0xf03e, 0xf03f,
+ 0xf040, 0xf041, 0xf042, 0xf043, 0xf044, 0xf045, 0xf046, 0xf047,
+ 0xf048, 0xf049, 0xf04a, 0xf04b, 0xf04c, 0xf04d, 0xf04e, 0xf04f,
+ 0xf050, 0xf051, 0xf052, 0xf053, 0xf054, 0xf055, 0xf056, 0xf057,
+ 0xf058, 0xf059, 0xf05a, 0xf05b, 0xf05c, 0xf05d, 0xf05e, 0xf05f,
+ 0xf060, 0xf061, 0xf062, 0xf063, 0xf064, 0xf065, 0xf066, 0xf067,
+ 0xf068, 0xf069, 0xf06a, 0xf06b, 0xf06c, 0xf06d, 0xf06e, 0xf06f,
+ 0xf070, 0xf071, 0xf072, 0xf073, 0xf074, 0xf075, 0xf076, 0xf077,
+ 0xf078, 0xf079, 0xf07a, 0xf07b, 0xf07c, 0xf07d, 0xf07e, 0xf07f,
+ 0xf080, 0xf081, 0xf082, 0xf083, 0xf084, 0xf085, 0xf086, 0xf087,
+ 0xf088, 0xf089, 0xf08a, 0xf08b, 0xf08c, 0xf08d, 0xf08e, 0xf08f,
+ 0xf090, 0xf091, 0xf092, 0xf093, 0xf094, 0xf095, 0xf096, 0xf097,
+ 0xf098, 0xf099, 0xf09a, 0xf09b, 0xf09c, 0xf09d, 0xf09e, 0xf09f,
+ 0xf0a0, 0xf0a1, 0xf0a2, 0xf0a3, 0xf0a4, 0xf0a5, 0xf0a6, 0xf0a7,
+ 0xf0a8, 0xf0a9, 0xf0aa, 0xf0ab, 0xf0ac, 0xf0ad, 0xf0ae, 0xf0af,
+ 0xf0b0, 0xf0b1, 0xf0b2, 0xf0b3, 0xf0b4, 0xf0b5, 0xf0b6, 0xf0b7,
+ 0xf0b8, 0xf0b9, 0xf0ba, 0xf0bb, 0xf0bc, 0xf0bd, 0xf0be, 0xf0bf,
+ 0xf0c0, 0xf0c1, 0xf0c2, 0xf0c3, 0xf0c4, 0xf0c5, 0xf0c6, 0xf0c7,
+ 0xf0c8, 0xf0c9, 0xf0ca, 0xf0cb, 0xf0cc, 0xf0cd, 0xf0ce, 0xf0cf,
+ 0xf0d0, 0xf0d1, 0xf0d2, 0xf0d3, 0xf0d4, 0xf0d5, 0xf0d6, 0xf0d7,
+ 0xf0d8, 0xf0d9, 0xf0da, 0xf0db, 0xf0dc, 0xf0dd, 0xf0de, 0xf0df,
+ 0xf0e0, 0xf0e1, 0xf0e2, 0xf0e3, 0xf0e4, 0xf0e5, 0xf0e6, 0xf0e7,
+ 0xf0e8, 0xf0e9, 0xf0ea, 0xf0eb, 0xf0ec, 0xf0ed, 0xf0ee, 0xf0ef,
+ 0xf0f0, 0xf0f1, 0xf0f2, 0xf0f3, 0xf0f4, 0xf0f5, 0xf0f6, 0xf0f7,
+ 0xf0f8, 0xf0f9, 0xf0fa, 0xf0fb, 0xf0fc, 0xf0fd, 0xf0fe, 0xf0ff,
+ 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 0xf107,
+ 0xf108, 0xf109, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf10e, 0xf10f,
+ 0xf110, 0xf111, 0xf112, 0xf113, 0xf114, 0xf115, 0xf116, 0xf117,
+ 0xf118, 0xf119, 0xf11a, 0xf11b, 0xf11c, 0xf11d, 0xf11e, 0xf11f,
+ 0xf120, 0xf121, 0xf122, 0xf123, 0xf124, 0xf125, 0xf126, 0xf127,
+ 0xf128, 0xf129, 0xf12a, 0xf12b, 0xf12c, 0xf12d, 0xf12e, 0xf12f,
+ 0xf130, 0xf131, 0xf132, 0xf133, 0xf134, 0xf135, 0xf136, 0xf137,
+ 0xf138, 0xf139, 0xf13a, 0xf13b, 0xf13c, 0xf13d, 0xf13e, 0xf13f,
+ 0xf140, 0xf141, 0xf142, 0xf143, 0xf144, 0xf145, 0xf146, 0xf147,
+ 0xf148, 0xf149, 0xf14a, 0xf14b, 0xf14c, 0xf14d, 0xf14e, 0xf14f,
+ 0xf150, 0xf151, 0xf152, 0xf153, 0xf154, 0xf155, 0xf156, 0xf157,
+ 0xf158, 0xf159, 0xf15a, 0xf15b, 0xf15c, 0xf15d, 0xf15e, 0xf15f,
+ 0xf160, 0xf161, 0xf162, 0xf163, 0xf164, 0xf165, 0xf166, 0xf167,
+ 0xf168, 0xf169, 0xf16a, 0xf16b, 0xf16c, 0xf16d, 0xf16e, 0xf16f,
+ 0xf170, 0xf171, 0xf172, 0xf173, 0xf174, 0xf175, 0xf176, 0xf177,
+ 0xf178, 0xf179, 0xf17a, 0xf17b, 0xf17c, 0xf17d, 0xf17e, 0xf17f,
+ 0xf180, 0xf181, 0xf182, 0xf183, 0xf184, 0xf185, 0xf186, 0xf187,
+ 0xf188, 0xf189, 0xf18a, 0xf18b, 0xf18c, 0xf18d, 0xf18e, 0xf18f,
+ 0xf190, 0xf191, 0xf192, 0xf193, 0xf194, 0xf195, 0xf196, 0xf197,
+ 0xf198, 0xf199, 0xf19a, 0xf19b, 0xf19c, 0xf19d, 0xf19e, 0xf19f,
+ 0xf1a0, 0xf1a1, 0xf1a2, 0xf1a3, 0xf1a4, 0xf1a5, 0xf1a6, 0xf1a7,
+ 0xf1a8, 0xf1a9, 0xf1aa, 0xf1ab, 0xf1ac, 0xf1ad, 0xf1ae, 0xf1af,
+ 0xf1b0, 0xf1b1, 0xf1b2, 0xf1b3, 0xf1b4, 0xf1b5, 0xf1b6, 0xf1b7,
+ 0xf1b8, 0xf1b9, 0xf1ba, 0xf1bb, 0xf1bc, 0xf1bd, 0xf1be, 0xf1bf,
+ 0xf1c0, 0xf1c1, 0xf1c2, 0xf1c3, 0xf1c4, 0xf1c5, 0xf1c6, 0xf1c7,
+ 0xf1c8, 0xf1c9, 0xf1ca, 0xf1cb, 0xf1cc, 0xf1cd, 0xf1ce, 0xf1cf,
+ 0xf1d0, 0xf1d1, 0xf1d2, 0xf1d3, 0xf1d4, 0xf1d5, 0xf1d6, 0xf1d7,
+ 0xf1d8, 0xf1d9, 0xf1da, 0xf1db, 0xf1dc, 0xf1dd, 0xf1de, 0xf1df,
+ 0xf1e0, 0xf1e1, 0xf1e2, 0xf1e3, 0xf1e4, 0xf1e5, 0xf1e6, 0xf1e7,
+ 0xf1e8, 0xf1e9, 0xf1ea, 0xf1eb, 0xf1ec, 0xf1ed, 0xf1ee, 0xf1ef,
+ 0xf1f0, 0xf1f1, 0xf1f2, 0xf1f3, 0xf1f4, 0xf1f5, 0xf1f6, 0xf1f7,
+ 0xf1f8, 0xf1f9, 0xf1fa, 0xf1fb, 0xf1fc, 0xf1fd, 0xf1fe, 0xf1ff,
+ 0xf200, 0xf201, 0xf202, 0xf203, 0xf204, 0xf205, 0xf206, 0xf207,
+ 0xf208, 0xf209, 0xf20a, 0xf20b, 0xf20c, 0xf20d, 0xf20e, 0xf20f,
+ 0xf210, 0xf211, 0xf212, 0xf213, 0xf214, 0xf215, 0xf216, 0xf217,
+ 0xf218, 0xf219, 0xf21a, 0xf21b, 0xf21c, 0xf21d, 0xf21e, 0xf21f,
+ 0xf220, 0xf221, 0xf222, 0xf223, 0xf224, 0xf225, 0xf226, 0xf227,
+ 0xf228, 0xf229, 0xf22a, 0xf22b, 0xf22c, 0xf22d, 0xf22e, 0xf22f,
+ 0xf230, 0xf231, 0xf232, 0xf233, 0xf234, 0xf235, 0xf236, 0xf237,
+ 0xf238, 0xf239, 0xf23a, 0xf23b, 0xf23c, 0xf23d, 0xf23e, 0xf23f,
+ 0xf240, 0xf241, 0xf242, 0xf243, 0xf244, 0xf245, 0xf246, 0xf247,
+ 0xf248, 0xf249, 0xf24a, 0xf24b, 0xf24c, 0xf24d, 0xf24e, 0xf24f,
+ 0xf250, 0xf251, 0xf252, 0xf253, 0xf254, 0xf255, 0xf256, 0xf257,
+ 0xf258, 0xf259, 0xf25a, 0xf25b, 0xf25c, 0xf25d, 0xf25e, 0xf25f,
+ 0xf260, 0xf261, 0xf262, 0xf263, 0xf264, 0xf265, 0xf266, 0xf267,
+ 0xf268, 0xf269, 0xf26a, 0xf26b, 0xf26c, 0xf26d, 0xf26e, 0xf26f,
+ 0xf270, 0xf271, 0xf272, 0xf273, 0xf274, 0xf275, 0xf276, 0xf277,
+ 0xf278, 0xf279, 0xf27a, 0xf27b, 0xf27c, 0xf27d, 0xf27e, 0xf27f,
+ 0xf280, 0xf281, 0xf282, 0xf283, 0xf284, 0xf285, 0xf286, 0xf287,
+ 0xf288, 0xf289, 0xf28a, 0xf28b, 0xf28c, 0xf28d, 0xf28e, 0xf28f,
+ 0xf290, 0xf291, 0xf292, 0xf293, 0xf294, 0xf295, 0xf296, 0xf297,
+ 0xf298, 0xf299, 0xf29a, 0xf29b, 0xf29c, 0xf29d, 0xf29e, 0xf29f,
+ 0xf2a0, 0xf2a1, 0xf2a2, 0xf2a3, 0xf2a4, 0xf2a5, 0xf2a6, 0xf2a7,
+ 0xf2a8, 0xf2a9, 0xf2aa, 0xf2ab, 0xf2ac, 0xf2ad, 0xf2ae, 0xf2af,
+ 0xf2b0, 0xf2b1, 0xf2b2, 0xf2b3, 0xf2b4, 0xf2b5, 0xf2b6, 0xf2b7,
+ 0xf2b8, 0xf2b9, 0xf2ba, 0xf2bb, 0xf2bc, 0xf2bd, 0xf2be, 0xf2bf,
+ 0xf2c0, 0xf2c1, 0xf2c2, 0xf2c3, 0xf2c4, 0xf2c5, 0xf2c6, 0xf2c7,
+ 0xf2c8, 0xf2c9, 0xf2ca, 0xf2cb, 0xf2cc, 0xf2cd, 0xf2ce, 0xf2cf,
+ 0xf2d0, 0xf2d1, 0xf2d2, 0xf2d3, 0xf2d4, 0xf2d5, 0xf2d6, 0xf2d7,
+ 0xf2d8, 0xf2d9, 0xf2da, 0xf2db, 0xf2dc, 0xf2dd, 0xf2de, 0xf2df,
+ 0xf2e0, 0xf2e1, 0xf2e2, 0xf2e3, 0xf2e4, 0xf2e5, 0xf2e6, 0xf2e7,
+ 0xf2e8, 0xf2e9, 0xf2ea, 0xf2eb, 0xf2ec, 0xf2ed, 0xf2ee, 0xf2ef,
+ 0xf2f0, 0xf2f1, 0xf2f2, 0xf2f3, 0xf2f4, 0xf2f5, 0xf2f6, 0xf2f7,
+ 0xf2f8, 0xf2f9, 0xf2fa, 0xf2fb, 0xf2fc, 0xf2fd, 0xf2fe, 0xf2ff,
+ 0xf300, 0xf301, 0xf302, 0xf303, 0xf304, 0xf305, 0xf306, 0xf307,
+ 0xf308, 0xf309, 0xf30a, 0xf30b, 0xf30c, 0xf30d, 0xf30e, 0xf30f,
+ 0xf310, 0xf311, 0xf312, 0xf313, 0xf314, 0xf315, 0xf316, 0xf317,
+ 0xf318, 0xf319, 0xf31a, 0xf31b, 0xf31c, 0xf31d, 0xf31e, 0xf31f,
+ 0xf320, 0xf321, 0xf322, 0xf323, 0xf324, 0xf325, 0xf326, 0xf327,
+ 0xf328, 0xf329, 0xf32a, 0xf32b, 0xf32c, 0xf32d, 0xf32e, 0xf32f,
+ 0xf330, 0xf331, 0xf332, 0xf333, 0xf334, 0xf335, 0xf336, 0xf337,
+ 0xf338, 0xf339, 0xf33a, 0xf33b, 0xf33c, 0xf33d, 0xf33e, 0xf33f,
+ 0xf340, 0xf341, 0xf342, 0xf343, 0xf344, 0xf345, 0xf346, 0xf347,
+ 0xf348, 0xf349, 0xf34a, 0xf34b, 0xf34c, 0xf34d, 0xf34e, 0xf34f,
+ 0xf350, 0xf351, 0xf352, 0xf353, 0xf354, 0xf355, 0xf356, 0xf357,
+ 0xf358, 0xf359, 0xf35a, 0xf35b, 0xf35c, 0xf35d, 0xf35e, 0xf35f,
+ 0xf360, 0xf361, 0xf362, 0xf363, 0xf364, 0xf365, 0xf366, 0xf367,
+ 0xf368, 0xf369, 0xf36a, 0xf36b, 0xf36c, 0xf36d, 0xf36e, 0xf36f,
+ 0xf370, 0xf371, 0xf372, 0xf373, 0xf374, 0xf375, 0xf376, 0xf377,
+ 0xf378, 0xf379, 0xf37a, 0xf37b, 0xf37c, 0xf37d, 0xf37e, 0xf37f,
+ 0xf380, 0xf381, 0xf382, 0xf383, 0xf384, 0xf385, 0xf386, 0xf387,
+ 0xf388, 0xf389, 0xf38a, 0xf38b, 0xf38c, 0xf38d, 0xf38e, 0xf38f,
+ 0xf390, 0xf391, 0xf392, 0xf393, 0xf394, 0xf395, 0xf396, 0xf397,
+ 0xf398, 0xf399, 0xf39a, 0xf39b, 0xf39c, 0xf39d, 0xf39e, 0xf39f,
+ 0xf3a0, 0xf3a1, 0xf3a2, 0xf3a3, 0xf3a4, 0xf3a5, 0xf3a6, 0xf3a7,
+ 0xf3a8, 0xf3a9, 0xf3aa, 0xf3ab, 0xf3ac, 0xf3ad, 0xf3ae, 0xf3af,
+ 0xf3b0, 0xf3b1, 0xf3b2, 0xf3b3, 0xf3b4, 0xf3b5, 0xf3b6, 0xf3b7,
+ 0xf3b8, 0xf3b9, 0xf3ba, 0xf3bb, 0xf3bc, 0xf3bd, 0xf3be, 0xf3bf,
+ 0xf3c0, 0xf3c1, 0xf3c2, 0xf3c3, 0xf3c4, 0xf3c5, 0xf3c6, 0xf3c7,
+ 0xf3c8, 0xf3c9, 0xf3ca, 0xf3cb, 0xf3cc, 0xf3cd, 0xf3ce, 0xf3cf,
+ 0xf3d0, 0xf3d1, 0xf3d2, 0xf3d3, 0xf3d4, 0xf3d5, 0xf3d6, 0xf3d7,
+ 0xf3d8, 0xf3d9, 0xf3da, 0xf3db, 0xf3dc, 0xf3dd, 0xf3de, 0xf3df,
+ 0xf3e0, 0xf3e1, 0xf3e2, 0xf3e3, 0xf3e4, 0xf3e5, 0xf3e6, 0xf3e7,
+ 0xf3e8, 0xf3e9, 0xf3ea, 0xf3eb, 0xf3ec, 0xf3ed, 0xf3ee, 0xf3ef,
+ 0xf3f0, 0xf3f1, 0xf3f2, 0xf3f3, 0xf3f4, 0xf3f5, 0xf3f6, 0xf3f7,
+ 0xf3f8, 0xf3f9, 0xf3fa, 0xf3fb, 0xf3fc, 0xf3fd, 0xf3fe, 0xf3ff,
+ 0xf400, 0xf401, 0xf402, 0xf403, 0xf404, 0xf405, 0xf406, 0xf407,
+ 0xf408, 0xf409, 0xf40a, 0xf40b, 0xf40c, 0xf40d, 0xf40e, 0xf40f,
+ 0xf410, 0xf411, 0xf412, 0xf413, 0xf414, 0xf415, 0xf416, 0xf417,
+ 0xf418, 0xf419, 0xf41a, 0xf41b, 0xf41c, 0xf41d, 0xf41e, 0xf41f,
+ 0xf420, 0xf421, 0xf422, 0xf423, 0xf424, 0xf425, 0xf426, 0xf427,
+ 0xf428, 0xf429, 0xf42a, 0xf42b, 0xf42c, 0xf42d, 0xf42e, 0xf42f,
+ 0xf430, 0xf431, 0xf432, 0xf433, 0xf434, 0xf435, 0xf436, 0xf437,
+ 0xf438, 0xf439, 0xf43a, 0xf43b, 0xf43c, 0xf43d, 0xf43e, 0xf43f,
+ 0xf440, 0xf441, 0xf442, 0xf443, 0xf444, 0xf445, 0xf446, 0xf447,
+ 0xf448, 0xf449, 0xf44a, 0xf44b, 0xf44c, 0xf44d, 0xf44e, 0xf44f,
+ 0xf450, 0xf451, 0xf452, 0xf453, 0xf454, 0xf455, 0xf456, 0xf457,
+ 0xf458, 0xf459, 0xf45a, 0xf45b, 0xf45c, 0xf45d, 0xf45e, 0xf45f,
+ 0xf460, 0xf461, 0xf462, 0xf463, 0xf464, 0xf465, 0xf466, 0xf467,
+ 0xf468, 0xf469, 0xf46a, 0xf46b, 0xf46c, 0xf46d, 0xf46e, 0xf46f,
+ 0xf470, 0xf471, 0xf472, 0xf473, 0xf474, 0xf475, 0xf476, 0xf477,
+ 0xf478, 0xf479, 0xf47a, 0xf47b, 0xf47c, 0xf47d, 0xf47e, 0xf47f,
+ 0xf480, 0xf481, 0xf482, 0xf483, 0xf484, 0xf485, 0xf486, 0xf487,
+ 0xf488, 0xf489, 0xf48a, 0xf48b, 0xf48c, 0xf48d, 0xf48e, 0xf48f,
+ 0xf490, 0xf491, 0xf492, 0xf493, 0xf494, 0xf495, 0xf496, 0xf497,
+ 0xf498, 0xf499, 0xf49a, 0xf49b, 0xf49c, 0xf49d, 0xf49e, 0xf49f,
+ 0xf4a0, 0xf4a1, 0xf4a2, 0xf4a3, 0xf4a4, 0xf4a5, 0xf4a6, 0xf4a7,
+ 0xf4a8, 0xf4a9, 0xf4aa, 0xf4ab, 0xf4ac, 0xf4ad, 0xf4ae, 0xf4af,
+ 0xf4b0, 0xf4b1, 0xf4b2, 0xf4b3, 0xf4b4, 0xf4b5, 0xf4b6, 0xf4b7,
+ 0xf4b8, 0xf4b9, 0xf4ba, 0xf4bb, 0xf4bc, 0xf4bd, 0xf4be, 0xf4bf,
+ 0xf4c0, 0xf4c1, 0xf4c2, 0xf4c3, 0xf4c4, 0xf4c5, 0xf4c6, 0xf4c7,
+ 0xf4c8, 0xf4c9, 0xf4ca, 0xf4cb, 0xf4cc, 0xf4cd, 0xf4ce, 0xf4cf,
+ 0xf4d0, 0xf4d1, 0xf4d2, 0xf4d3, 0xf4d4, 0xf4d5, 0xf4d6, 0xf4d7,
+ 0xf4d8, 0xf4d9, 0xf4da, 0xf4db, 0xf4dc, 0xf4dd, 0xf4de, 0xf4df,
+ 0xf4e0, 0xf4e1, 0xf4e2, 0xf4e3, 0xf4e4, 0xf4e5, 0xf4e6, 0xf4e7,
+ 0xf4e8, 0xf4e9, 0xf4ea, 0xf4eb, 0xf4ec, 0xf4ed, 0xf4ee, 0xf4ef,
+ 0xf4f0, 0xf4f1, 0xf4f2, 0xf4f3, 0xf4f4, 0xf4f5, 0xf4f6, 0xf4f7,
+ 0xf4f8, 0xf4f9, 0xf4fa, 0xf4fb, 0xf4fc, 0xf4fd, 0xf4fe, 0xf4ff,
+ 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, 0xf505, 0xf506, 0xf507,
+ 0xf508, 0xf509, 0xf50a, 0xf50b, 0xf50c, 0xf50d, 0xf50e, 0xf50f,
+ 0xf510, 0xf511, 0xf512, 0xf513, 0xf514, 0xf515, 0xf516, 0xf517,
+ 0xf518, 0xf519, 0xf51a, 0xf51b, 0xf51c, 0xf51d, 0xf51e, 0xf51f,
+ 0xf520, 0xf521, 0xf522, 0xf523, 0xf524, 0xf525, 0xf526, 0xf527,
+ 0xf528, 0xf529, 0xf52a, 0xf52b, 0xf52c, 0xf52d, 0xf52e, 0xf52f,
+ 0xf530, 0xf531, 0xf532, 0xf533, 0xf534, 0xf535, 0xf536, 0xf537,
+ 0xf538, 0xf539, 0xf53a, 0xf53b, 0xf53c, 0xf53d, 0xf53e, 0xf53f,
+ 0xf540, 0xf541, 0xf542, 0xf543, 0xf544, 0xf545, 0xf546, 0xf547,
+ 0xf548, 0xf549, 0xf54a, 0xf54b, 0xf54c, 0xf54d, 0xf54e, 0xf54f,
+ 0xf550, 0xf551, 0xf552, 0xf553, 0xf554, 0xf555, 0xf556, 0xf557,
+ 0xf558, 0xf559, 0xf55a, 0xf55b, 0xf55c, 0xf55d, 0xf55e, 0xf55f,
+ 0xf560, 0xf561, 0xf562, 0xf563, 0xf564, 0xf565, 0xf566, 0xf567,
+ 0xf568, 0xf569, 0xf56a, 0xf56b, 0xf56c, 0xf56d, 0xf56e, 0xf56f,
+ 0xf570, 0xf571, 0xf572, 0xf573, 0xf574, 0xf575, 0xf576, 0xf577,
+ 0xf578, 0xf579, 0xf57a, 0xf57b, 0xf57c, 0xf57d, 0xf57e, 0xf57f,
+ 0xf580, 0xf581, 0xf582, 0xf583, 0xf584, 0xf585, 0xf586, 0xf587,
+ 0xf588, 0xf589, 0xf58a, 0xf58b, 0xf58c, 0xf58d, 0xf58e, 0xf58f,
+ 0xf590, 0xf591, 0xf592, 0xf593, 0xf594, 0xf595, 0xf596, 0xf597,
+ 0xf598, 0xf599, 0xf59a, 0xf59b, 0xf59c, 0xf59d, 0xf59e, 0xf59f,
+ 0xf5a0, 0xf5a1, 0xf5a2, 0xf5a3, 0xf5a4, 0xf5a5, 0xf5a6, 0xf5a7,
+ 0xf5a8, 0xf5a9, 0xf5aa, 0xf5ab, 0xf5ac, 0xf5ad, 0xf5ae, 0xf5af,
+ 0xf5b0, 0xf5b1, 0xf5b2, 0xf5b3, 0xf5b4, 0xf5b5, 0xf5b6, 0xf5b7,
+ 0xf5b8, 0xf5b9, 0xf5ba, 0xf5bb, 0xf5bc, 0xf5bd, 0xf5be, 0xf5bf,
+ 0xf5c0, 0xf5c1, 0xf5c2, 0xf5c3, 0xf5c4, 0xf5c5, 0xf5c6, 0xf5c7,
+ 0xf5c8, 0xf5c9, 0xf5ca, 0xf5cb, 0xf5cc, 0xf5cd, 0xf5ce, 0xf5cf,
+ 0xf5d0, 0xf5d1, 0xf5d2, 0xf5d3, 0xf5d4, 0xf5d5, 0xf5d6, 0xf5d7,
+ 0xf5d8, 0xf5d9, 0xf5da, 0xf5db, 0xf5dc, 0xf5dd, 0xf5de, 0xf5df,
+ 0xf5e0, 0xf5e1, 0xf5e2, 0xf5e3, 0xf5e4, 0xf5e5, 0xf5e6, 0xf5e7,
+ 0xf5e8, 0xf5e9, 0xf5ea, 0xf5eb, 0xf5ec, 0xf5ed, 0xf5ee, 0xf5ef,
+ 0xf5f0, 0xf5f1, 0xf5f2, 0xf5f3, 0xf5f4, 0xf5f5, 0xf5f6, 0xf5f7,
+ 0xf5f8, 0xf5f9, 0xf5fa, 0xf5fb, 0xf5fc, 0xf5fd, 0xf5fe, 0xf5ff,
+ 0xf600, 0xf601, 0xf602, 0xf603, 0xf604, 0xf605, 0xf606, 0xf607,
+ 0xf608, 0xf609, 0xf60a, 0xf60b, 0xf60c, 0xf60d, 0xf60e, 0xf60f,
+ 0xf610, 0xf611, 0xf612, 0xf613, 0xf614, 0xf615, 0xf616, 0xf617,
+ 0xf618, 0xf619, 0xf61a, 0xf61b, 0xf61c, 0xf61d, 0xf61e, 0xf61f,
+ 0xf620, 0xf621, 0xf622, 0xf623, 0xf624, 0xf625, 0xf626, 0xf627,
+ 0xf628, 0xf629, 0xf62a, 0xf62b, 0xf62c, 0xf62d, 0xf62e, 0xf62f,
+ 0xf630, 0xf631, 0xf632, 0xf633, 0xf634, 0xf635, 0xf636, 0xf637,
+ 0xf638, 0xf639, 0xf63a, 0xf63b, 0xf63c, 0xf63d, 0xf63e, 0xf63f,
+ 0xf640, 0xf641, 0xf642, 0xf643, 0xf644, 0xf645, 0xf646, 0xf647,
+ 0xf648, 0xf649, 0xf64a, 0xf64b, 0xf64c, 0xf64d, 0xf64e, 0xf64f,
+ 0xf650, 0xf651, 0xf652, 0xf653, 0xf654, 0xf655, 0xf656, 0xf657,
+ 0xf658, 0xf659, 0xf65a, 0xf65b, 0xf65c, 0xf65d, 0xf65e, 0xf65f,
+ 0xf660, 0xf661, 0xf662, 0xf663, 0xf664, 0xf665, 0xf666, 0xf667,
+ 0xf668, 0xf669, 0xf66a, 0xf66b, 0xf66c, 0xf66d, 0xf66e, 0xf66f,
+ 0xf670, 0xf671, 0xf672, 0xf673, 0xf674, 0xf675, 0xf676, 0xf677,
+ 0xf678, 0xf679, 0xf67a, 0xf67b, 0xf67c, 0xf67d, 0xf67e, 0xf67f,
+ 0xf680, 0xf681, 0xf682, 0xf683, 0xf684, 0xf685, 0xf686, 0xf687,
+ 0xf688, 0xf689, 0xf68a, 0xf68b, 0xf68c, 0xf68d, 0xf68e, 0xf68f,
+ 0xf690, 0xf691, 0xf692, 0xf693, 0xf694, 0xf695, 0xf696, 0xf697,
+ 0xf698, 0xf699, 0xf69a, 0xf69b, 0xf69c, 0xf69d, 0xf69e, 0xf69f,
+ 0xf6a0, 0xf6a1, 0xf6a2, 0xf6a3, 0xf6a4, 0xf6a5, 0xf6a6, 0xf6a7,
+ 0xf6a8, 0xf6a9, 0xf6aa, 0xf6ab, 0xf6ac, 0xf6ad, 0xf6ae, 0xf6af,
+ 0xf6b0, 0xf6b1, 0xf6b2, 0xf6b3, 0xf6b4, 0xf6b5, 0xf6b6, 0xf6b7,
+ 0xf6b8, 0xf6b9, 0xf6ba, 0xf6bb, 0xf6bc, 0xf6bd, 0xf6be, 0xf6bf,
+ 0xf6c0, 0xf6c1, 0xf6c2, 0xf6c3, 0xf6c4, 0xf6c5, 0xf6c6, 0xf6c7,
+ 0xf6c8, 0xf6c9, 0xf6ca, 0xf6cb, 0xf6cc, 0xf6cd, 0xf6ce, 0xf6cf,
+ 0xf6d0, 0xf6d1, 0xf6d2, 0xf6d3, 0xf6d4, 0xf6d5, 0xf6d6, 0xf6d7,
+ 0xf6d8, 0xf6d9, 0xf6da, 0xf6db, 0xf6dc, 0xf6dd, 0xf6de, 0xf6df,
+ 0xf6e0, 0xf6e1, 0xf6e2, 0xf6e3, 0xf6e4, 0xf6e5, 0xf6e6, 0xf6e7,
+ 0xf6e8, 0xf6e9, 0xf6ea, 0xf6eb, 0xf6ec, 0xf6ed, 0xf6ee, 0xf6ef,
+ 0xf6f0, 0xf6f1, 0xf6f2, 0xf6f3, 0xf6f4, 0xf6f5, 0xf6f6, 0xf6f7,
+ 0xf6f8, 0xf6f9, 0xf6fa, 0xf6fb, 0xf6fc, 0xf6fd, 0xf6fe, 0xf6ff,
+ 0xf700, 0xf701, 0xf702, 0xf703, 0xf704, 0xf705, 0xf706, 0xf707,
+ 0xf708, 0xf709, 0xf70a, 0xf70b, 0xf70c, 0xf70d, 0xf70e, 0xf70f,
+ 0xf710, 0xf711, 0xf712, 0xf713, 0xf714, 0xf715, 0xf716, 0xf717,
+ 0xf718, 0xf719, 0xf71a, 0xf71b, 0xf71c, 0xf71d, 0xf71e, 0xf71f,
+ 0xf720, 0xf721, 0xf722, 0xf723, 0xf724, 0xf725, 0xf726, 0xf727,
+ 0xf728, 0xf729, 0xf72a, 0xf72b, 0xf72c, 0xf72d, 0xf72e, 0xf72f,
+ 0xf730, 0xf731, 0xf732, 0xf733, 0xf734, 0xf735, 0xf736, 0xf737,
+ 0xf738, 0xf739, 0xf73a, 0xf73b, 0xf73c, 0xf73d, 0xf73e, 0xf73f,
+ 0xf740, 0xf741, 0xf742, 0xf743, 0xf744, 0xf745, 0xf746, 0xf747,
+ 0xf748, 0xf749, 0xf74a, 0xf74b, 0xf74c, 0xf74d, 0xf74e, 0xf74f,
+ 0xf750, 0xf751, 0xf752, 0xf753, 0xf754, 0xf755, 0xf756, 0xf757,
+ 0xf758, 0xf759, 0xf75a, 0xf75b, 0xf75c, 0xf75d, 0xf75e, 0xf75f,
+ 0xf760, 0xf761, 0xf762, 0xf763, 0xf764, 0xf765, 0xf766, 0xf767,
+ 0xf768, 0xf769, 0xf76a, 0xf76b, 0xf76c, 0xf76d, 0xf76e, 0xf76f,
+ 0xf770, 0xf771, 0xf772, 0xf773, 0xf774, 0xf775, 0xf776, 0xf777,
+ 0xf778, 0xf779, 0xf77a, 0xf77b, 0xf77c, 0xf77d, 0xf77e, 0xf77f,
+ 0xf780, 0xf781, 0xf782, 0xf783, 0xf784, 0xf785, 0xf786, 0xf787,
+ 0xf788, 0xf789, 0xf78a, 0xf78b, 0xf78c, 0xf78d, 0xf78e, 0xf78f,
+ 0xf790, 0xf791, 0xf792, 0xf793, 0xf794, 0xf795, 0xf796, 0xf797,
+ 0xf798, 0xf799, 0xf79a, 0xf79b, 0xf79c, 0xf79d, 0xf79e, 0xf79f,
+ 0xf7a0, 0xf7a1, 0xf7a2, 0xf7a3, 0xf7a4, 0xf7a5, 0xf7a6, 0xf7a7,
+ 0xf7a8, 0xf7a9, 0xf7aa, 0xf7ab, 0xf7ac, 0xf7ad, 0xf7ae, 0xf7af,
+ 0xf7b0, 0xf7b1, 0xf7b2, 0xf7b3, 0xf7b4, 0xf7b5, 0xf7b6, 0xf7b7,
+ 0xf7b8, 0xf7b9, 0xf7ba, 0xf7bb, 0xf7bc, 0xf7bd, 0xf7be, 0xf7bf,
+ 0xf7c0, 0xf7c1, 0xf7c2, 0xf7c3, 0xf7c4, 0xf7c5, 0xf7c6, 0xf7c7,
+ 0xf7c8, 0xf7c9, 0xf7ca, 0xf7cb, 0xf7cc, 0xf7cd, 0xf7ce, 0xf7cf,
+ 0xf7d0, 0xf7d1, 0xf7d2, 0xf7d3, 0xf7d4, 0xf7d5, 0xf7d6, 0xf7d7,
+ 0xf7d8, 0xf7d9, 0xf7da, 0xf7db, 0xf7dc, 0xf7dd, 0xf7de, 0xf7df,
+ 0xf7e0, 0xf7e1, 0xf7e2, 0xf7e3, 0xf7e4, 0xf7e5, 0xf7e6, 0xf7e7,
+ 0xf7e8, 0xf7e9, 0xf7ea, 0xf7eb, 0xf7ec, 0xf7ed, 0xf7ee, 0xf7ef,
+ 0xf7f0, 0xf7f1, 0xf7f2, 0xf7f3, 0xf7f4, 0xf7f5, 0xf7f6, 0xf7f7,
+ 0xf7f8, 0xf7f9, 0xf7fa, 0xf7fb, 0xf7fc, 0xf7fd, 0xf7fe, 0xf7ff,
+ 0xf800, 0xf801, 0xf802, 0xf803, 0xf804, 0xf805, 0xf806, 0xf807,
+ 0xf808, 0xf809, 0xf80a, 0xf80b, 0xf80c, 0xf80d, 0xf80e, 0xf80f,
+ 0xf810, 0xf811, 0xf812, 0xf813, 0xf814, 0xf815, 0xf816, 0xf817,
+ 0xf818, 0xf819, 0xf81a, 0xf81b, 0xf81c, 0xf81d, 0xf81e, 0xf81f,
+ 0xf820, 0xf821, 0xf822, 0xf823, 0xf824, 0xf825, 0xf826, 0xf827,
+ 0xf828, 0xf829, 0xf82a, 0xf82b, 0xf82c, 0xf82d, 0xf82e, 0xf82f,
+ 0xf830, 0xf831, 0xf832, 0xf833, 0xf834, 0xf835, 0xf836, 0xf837,
+ 0xf838, 0xf839, 0xf83a, 0xf83b, 0xf83c, 0xf83d, 0xf83e, 0xf83f,
+ 0xf840, 0xf841, 0xf842, 0xf843, 0xf844, 0xf845, 0xf846, 0xf847,
+ 0xf848, 0xf849, 0xf84a, 0xf84b, 0xf84c, 0xf84d, 0xf84e, 0xf84f,
+ 0xf850, 0xf851, 0xf852, 0xf853, 0xf854, 0xf855, 0xf856, 0xf857,
+ 0xf858, 0xf859, 0xf85a, 0xf85b, 0xf85c, 0xf85d, 0xf85e, 0xf85f,
+ 0xf860, 0xf861, 0xf862, 0xf863, 0xf864, 0xf865, 0xf866, 0xf867,
+ 0xf868, 0xf869, 0xf86a, 0xf86b, 0xf86c, 0xf86d, 0xf86e, 0xf86f,
+ 0xf870, 0xf871, 0xf872, 0xf873, 0xf874, 0xf875, 0xf876, 0xf877,
+ 0xf878, 0xf879, 0xf87a, 0xf87b, 0xf87c, 0xf87d, 0xf87e, 0xf87f,
+ 0xf880, 0xf881, 0xf882, 0xf883, 0xf884, 0xf885, 0xf886, 0xf887,
+ 0xf888, 0xf889, 0xf88a, 0xf88b, 0xf88c, 0xf88d, 0xf88e, 0xf88f,
+ 0xf890, 0xf891, 0xf892, 0xf893, 0xf894, 0xf895, 0xf896, 0xf897,
+ 0xf898, 0xf899, 0xf89a, 0xf89b, 0xf89c, 0xf89d, 0xf89e, 0xf89f,
+ 0xf8a0, 0xf8a1, 0xf8a2, 0xf8a3, 0xf8a4, 0xf8a5, 0xf8a6, 0xf8a7,
+ 0xf8a8, 0xf8a9, 0xf8aa, 0xf8ab, 0xf8ac, 0xf8ad, 0xf8ae, 0xf8af,
+ 0xf8b0, 0xf8b1, 0xf8b2, 0xf8b3, 0xf8b4, 0xf8b5, 0xf8b6, 0xf8b7,
+ 0xf8b8, 0xf8b9, 0xf8ba, 0xf8bb, 0xf8bc, 0xf8bd, 0xf8be, 0xf8bf,
+ 0xf8c0, 0xf8c1, 0xf8c2, 0xf8c3, 0xf8c4, 0xf8c5, 0xf8c6, 0xf8c7,
+ 0xf8c8, 0xf8c9, 0xf8ca, 0xf8cb, 0xf8cc, 0xf8cd, 0xf8ce, 0xf8cf,
+ 0xf8d0, 0xf8d1, 0xf8d2, 0xf8d3, 0xf8d4, 0xf8d5, 0xf8d6, 0xf8d7,
+ 0xf8d8, 0xf8d9, 0xf8da, 0xf8db, 0xf8dc, 0xf8dd, 0xf8de, 0xf8df,
+ 0xf8e0, 0xf8e1, 0xf8e2, 0xf8e3, 0xf8e4, 0xf8e5, 0xf8e6, 0xf8e7,
+ 0xf8e8, 0xf8e9, 0xf8ea, 0xf8eb, 0xf8ec, 0xf8ed, 0xf8ee, 0xf8ef,
+ 0xf8f0, 0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4, 0xf8f5, 0xf8f6, 0xf8f7,
+ 0xf8f8, 0xf8f9, 0xf8fa, 0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0xf8ff,
+ 0xf900, 0xf901, 0xf902, 0xf903, 0xf904, 0xf905, 0xf906, 0xf907,
+ 0xf908, 0xf909, 0xf90a, 0xf90b, 0xf90c, 0xf90d, 0xf90e, 0xf90f,
+ 0xf910, 0xf911, 0xf912, 0xf913, 0xf914, 0xf915, 0xf916, 0xf917,
+ 0xf918, 0xf919, 0xf91a, 0xf91b, 0xf91c, 0xf91d, 0xf91e, 0xf91f,
+ 0xf920, 0xf921, 0xf922, 0xf923, 0xf924, 0xf925, 0xf926, 0xf927,
+ 0xf928, 0xf929, 0xf92a, 0xf92b, 0xf92c, 0xf92d, 0xf92e, 0xf92f,
+ 0xf930, 0xf931, 0xf932, 0xf933, 0xf934, 0xf935, 0xf936, 0xf937,
+ 0xf938, 0xf939, 0xf93a, 0xf93b, 0xf93c, 0xf93d, 0xf93e, 0xf93f,
+ 0xf940, 0xf941, 0xf942, 0xf943, 0xf944, 0xf945, 0xf946, 0xf947,
+ 0xf948, 0xf949, 0xf94a, 0xf94b, 0xf94c, 0xf94d, 0xf94e, 0xf94f,
+ 0xf950, 0xf951, 0xf952, 0xf953, 0xf954, 0xf955, 0xf956, 0xf957,
+ 0xf958, 0xf959, 0xf95a, 0xf95b, 0xf95c, 0xf95d, 0xf95e, 0xf95f,
+ 0xf960, 0xf961, 0xf962, 0xf963, 0xf964, 0xf965, 0xf966, 0xf967,
+ 0xf968, 0xf969, 0xf96a, 0xf96b, 0xf96c, 0xf96d, 0xf96e, 0xf96f,
+ 0xf970, 0xf971, 0xf972, 0xf973, 0xf974, 0xf975, 0xf976, 0xf977,
+ 0xf978, 0xf979, 0xf97a, 0xf97b, 0xf97c, 0xf97d, 0xf97e, 0xf97f,
+ 0xf980, 0xf981, 0xf982, 0xf983, 0xf984, 0xf985, 0xf986, 0xf987,
+ 0xf988, 0xf989, 0xf98a, 0xf98b, 0xf98c, 0xf98d, 0xf98e, 0xf98f,
+ 0xf990, 0xf991, 0xf992, 0xf993, 0xf994, 0xf995, 0xf996, 0xf997,
+ 0xf998, 0xf999, 0xf99a, 0xf99b, 0xf99c, 0xf99d, 0xf99e, 0xf99f,
+ 0xf9a0, 0xf9a1, 0xf9a2, 0xf9a3, 0xf9a4, 0xf9a5, 0xf9a6, 0xf9a7,
+ 0xf9a8, 0xf9a9, 0xf9aa, 0xf9ab, 0xf9ac, 0xf9ad, 0xf9ae, 0xf9af,
+ 0xf9b0, 0xf9b1, 0xf9b2, 0xf9b3, 0xf9b4, 0xf9b5, 0xf9b6, 0xf9b7,
+ 0xf9b8, 0xf9b9, 0xf9ba, 0xf9bb, 0xf9bc, 0xf9bd, 0xf9be, 0xf9bf,
+ 0xf9c0, 0xf9c1, 0xf9c2, 0xf9c3, 0xf9c4, 0xf9c5, 0xf9c6, 0xf9c7,
+ 0xf9c8, 0xf9c9, 0xf9ca, 0xf9cb, 0xf9cc, 0xf9cd, 0xf9ce, 0xf9cf,
+ 0xf9d0, 0xf9d1, 0xf9d2, 0xf9d3, 0xf9d4, 0xf9d5, 0xf9d6, 0xf9d7,
+ 0xf9d8, 0xf9d9, 0xf9da, 0xf9db, 0xf9dc, 0xf9dd, 0xf9de, 0xf9df,
+ 0xf9e0, 0xf9e1, 0xf9e2, 0xf9e3, 0xf9e4, 0xf9e5, 0xf9e6, 0xf9e7,
+ 0xf9e8, 0xf9e9, 0xf9ea, 0xf9eb, 0xf9ec, 0xf9ed, 0xf9ee, 0xf9ef,
+ 0xf9f0, 0xf9f1, 0xf9f2, 0xf9f3, 0xf9f4, 0xf9f5, 0xf9f6, 0xf9f7,
+ 0xf9f8, 0xf9f9, 0xf9fa, 0xf9fb, 0xf9fc, 0xf9fd, 0xf9fe, 0xf9ff,
+ 0xfa00, 0xfa01, 0xfa02, 0xfa03, 0xfa04, 0xfa05, 0xfa06, 0xfa07,
+ 0xfa08, 0xfa09, 0xfa0a, 0xfa0b, 0xfa0c, 0xfa0d, 0xfa0e, 0xfa0f,
+ 0xfa10, 0xfa11, 0xfa12, 0xfa13, 0xfa14, 0xfa15, 0xfa16, 0xfa17,
+ 0xfa18, 0xfa19, 0xfa1a, 0xfa1b, 0xfa1c, 0xfa1d, 0xfa1e, 0xfa1f,
+ 0xfa20, 0xfa21, 0xfa22, 0xfa23, 0xfa24, 0xfa25, 0xfa26, 0xfa27,
+ 0xfa28, 0xfa29, 0xfa2a, 0xfa2b, 0xfa2c, 0xfa2d, 0x0000, 0x0000,
+ 0xfa30, 0xfa31, 0xfa32, 0xfa33, 0xfa34, 0xfa35, 0xfa36, 0xfa37,
+ 0xfa38, 0xfa39, 0xfa3a, 0xfa3b, 0xfa3c, 0xfa3d, 0xfa3e, 0xfa3f,
+ 0xfa40, 0xfa41, 0xfa42, 0xfa43, 0xfa44, 0xfa45, 0xfa46, 0xfa47,
+ 0xfa48, 0xfa49, 0xfa4a, 0xfa4b, 0xfa4c, 0xfa4d, 0xfa4e, 0xfa4f,
+ 0xfa50, 0xfa51, 0xfa52, 0xfa53, 0xfa54, 0xfa55, 0xfa56, 0xfa57,
+ 0xfa58, 0xfa59, 0xfa5a, 0xfa5b, 0xfa5c, 0xfa5d, 0xfa5e, 0xfa5f,
+ 0xfa60, 0xfa61, 0xfa62, 0xfa63, 0xfa64, 0xfa65, 0xfa66, 0xfa67,
+ 0xfa68, 0xfa69, 0xfa6a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfa70, 0xfa71, 0xfa72, 0xfa73, 0xfa74, 0xfa75, 0xfa76, 0xfa77,
+ 0xfa78, 0xfa79, 0xfa7a, 0xfa7b, 0xfa7c, 0xfa7d, 0xfa7e, 0xfa7f,
+ 0xfa80, 0xfa81, 0xfa82, 0xfa83, 0xfa84, 0xfa85, 0xfa86, 0xfa87,
+ 0xfa88, 0xfa89, 0xfa8a, 0xfa8b, 0xfa8c, 0xfa8d, 0xfa8e, 0xfa8f,
+ 0xfa90, 0xfa91, 0xfa92, 0xfa93, 0xfa94, 0xfa95, 0xfa96, 0xfa97,
+ 0xfa98, 0xfa99, 0xfa9a, 0xfa9b, 0xfa9c, 0xfa9d, 0xfa9e, 0xfa9f,
+ 0xfaa0, 0xfaa1, 0xfaa2, 0xfaa3, 0xfaa4, 0xfaa5, 0xfaa6, 0xfaa7,
+ 0xfaa8, 0xfaa9, 0xfaaa, 0xfaab, 0xfaac, 0xfaad, 0xfaae, 0xfaaf,
+ 0xfab0, 0xfab1, 0xfab2, 0xfab3, 0xfab4, 0xfab5, 0xfab6, 0xfab7,
+ 0xfab8, 0xfab9, 0xfaba, 0xfabb, 0xfabc, 0xfabd, 0xfabe, 0xfabf,
+ 0xfac0, 0xfac1, 0xfac2, 0xfac3, 0xfac4, 0xfac5, 0xfac6, 0xfac7,
+ 0xfac8, 0xfac9, 0xfaca, 0xfacb, 0xfacc, 0xfacd, 0xface, 0xfacf,
+ 0xfad0, 0xfad1, 0xfad2, 0xfad3, 0xfad4, 0xfad5, 0xfad6, 0xfad7,
+ 0xfad8, 0xfad9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfb00, 0xfb01, 0xfb02, 0xfb03, 0xfb04, 0xfb05, 0xfb06, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0xfb13, 0xfb14, 0xfb15, 0xfb16, 0xfb17,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfb1d, 0xfb1e, 0xfb1f,
+ 0xfb20, 0xfb21, 0xfb22, 0xfb23, 0xfb24, 0xfb25, 0xfb26, 0xfb27,
+ 0xfb28, 0xfb29, 0xfb2a, 0xfb2b, 0xfb2c, 0xfb2d, 0xfb2e, 0xfb2f,
+ 0xfb30, 0xfb31, 0xfb32, 0xfb33, 0xfb34, 0xfb35, 0xfb36, 0x0000,
+ 0xfb38, 0xfb39, 0xfb3a, 0xfb3b, 0xfb3c, 0x0000, 0xfb3e, 0x0000,
+ 0xfb40, 0xfb41, 0x0000, 0xfb43, 0xfb44, 0x0000, 0xfb46, 0xfb47,
+ 0xfb48, 0xfb49, 0xfb4a, 0xfb4b, 0xfb4c, 0xfb4d, 0xfb4e, 0xfb4f,
+ 0xfb50, 0xfb51, 0xfb52, 0xfb53, 0xfb54, 0xfb55, 0xfb56, 0xfb57,
+ 0xfb58, 0xfb59, 0xfb5a, 0xfb5b, 0xfb5c, 0xfb5d, 0xfb5e, 0xfb5f,
+ 0xfb60, 0xfb61, 0xfb62, 0xfb63, 0xfb64, 0xfb65, 0xfb66, 0xfb67,
+ 0xfb68, 0xfb69, 0xfb6a, 0xfb6b, 0xfb6c, 0xfb6d, 0xfb6e, 0xfb6f,
+ 0xfb70, 0xfb71, 0xfb72, 0xfb73, 0xfb74, 0xfb75, 0xfb76, 0xfb77,
+ 0xfb78, 0xfb79, 0xfb7a, 0xfb7b, 0xfb7c, 0xfb7d, 0xfb7e, 0xfb7f,
+ 0xfb80, 0xfb81, 0xfb82, 0xfb83, 0xfb84, 0xfb85, 0xfb86, 0xfb87,
+ 0xfb88, 0xfb89, 0xfb8a, 0xfb8b, 0xfb8c, 0xfb8d, 0xfb8e, 0xfb8f,
+ 0xfb90, 0xfb91, 0xfb92, 0xfb93, 0xfb94, 0xfb95, 0xfb96, 0xfb97,
+ 0xfb98, 0xfb99, 0xfb9a, 0xfb9b, 0xfb9c, 0xfb9d, 0xfb9e, 0xfb9f,
+ 0xfba0, 0xfba1, 0xfba2, 0xfba3, 0xfba4, 0xfba5, 0xfba6, 0xfba7,
+ 0xfba8, 0xfba9, 0xfbaa, 0xfbab, 0xfbac, 0xfbad, 0xfbae, 0xfbaf,
+ 0xfbb0, 0xfbb1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0xfbd3, 0xfbd4, 0xfbd5, 0xfbd6, 0xfbd7,
+ 0xfbd8, 0xfbd9, 0xfbda, 0xfbdb, 0xfbdc, 0xfbdd, 0xfbde, 0xfbdf,
+ 0xfbe0, 0xfbe1, 0xfbe2, 0xfbe3, 0xfbe4, 0xfbe5, 0xfbe6, 0xfbe7,
+ 0xfbe8, 0xfbe9, 0xfbea, 0xfbeb, 0xfbec, 0xfbed, 0xfbee, 0xfbef,
+ 0xfbf0, 0xfbf1, 0xfbf2, 0xfbf3, 0xfbf4, 0xfbf5, 0xfbf6, 0xfbf7,
+ 0xfbf8, 0xfbf9, 0xfbfa, 0xfbfb, 0xfbfc, 0xfbfd, 0xfbfe, 0xfbff,
+ 0xfc00, 0xfc01, 0xfc02, 0xfc03, 0xfc04, 0xfc05, 0xfc06, 0xfc07,
+ 0xfc08, 0xfc09, 0xfc0a, 0xfc0b, 0xfc0c, 0xfc0d, 0xfc0e, 0xfc0f,
+ 0xfc10, 0xfc11, 0xfc12, 0xfc13, 0xfc14, 0xfc15, 0xfc16, 0xfc17,
+ 0xfc18, 0xfc19, 0xfc1a, 0xfc1b, 0xfc1c, 0xfc1d, 0xfc1e, 0xfc1f,
+ 0xfc20, 0xfc21, 0xfc22, 0xfc23, 0xfc24, 0xfc25, 0xfc26, 0xfc27,
+ 0xfc28, 0xfc29, 0xfc2a, 0xfc2b, 0xfc2c, 0xfc2d, 0xfc2e, 0xfc2f,
+ 0xfc30, 0xfc31, 0xfc32, 0xfc33, 0xfc34, 0xfc35, 0xfc36, 0xfc37,
+ 0xfc38, 0xfc39, 0xfc3a, 0xfc3b, 0xfc3c, 0xfc3d, 0xfc3e, 0xfc3f,
+ 0xfc40, 0xfc41, 0xfc42, 0xfc43, 0xfc44, 0xfc45, 0xfc46, 0xfc47,
+ 0xfc48, 0xfc49, 0xfc4a, 0xfc4b, 0xfc4c, 0xfc4d, 0xfc4e, 0xfc4f,
+ 0xfc50, 0xfc51, 0xfc52, 0xfc53, 0xfc54, 0xfc55, 0xfc56, 0xfc57,
+ 0xfc58, 0xfc59, 0xfc5a, 0xfc5b, 0xfc5c, 0xfc5d, 0xfc5e, 0xfc5f,
+ 0xfc60, 0xfc61, 0xfc62, 0xfc63, 0xfc64, 0xfc65, 0xfc66, 0xfc67,
+ 0xfc68, 0xfc69, 0xfc6a, 0xfc6b, 0xfc6c, 0xfc6d, 0xfc6e, 0xfc6f,
+ 0xfc70, 0xfc71, 0xfc72, 0xfc73, 0xfc74, 0xfc75, 0xfc76, 0xfc77,
+ 0xfc78, 0xfc79, 0xfc7a, 0xfc7b, 0xfc7c, 0xfc7d, 0xfc7e, 0xfc7f,
+ 0xfc80, 0xfc81, 0xfc82, 0xfc83, 0xfc84, 0xfc85, 0xfc86, 0xfc87,
+ 0xfc88, 0xfc89, 0xfc8a, 0xfc8b, 0xfc8c, 0xfc8d, 0xfc8e, 0xfc8f,
+ 0xfc90, 0xfc91, 0xfc92, 0xfc93, 0xfc94, 0xfc95, 0xfc96, 0xfc97,
+ 0xfc98, 0xfc99, 0xfc9a, 0xfc9b, 0xfc9c, 0xfc9d, 0xfc9e, 0xfc9f,
+ 0xfca0, 0xfca1, 0xfca2, 0xfca3, 0xfca4, 0xfca5, 0xfca6, 0xfca7,
+ 0xfca8, 0xfca9, 0xfcaa, 0xfcab, 0xfcac, 0xfcad, 0xfcae, 0xfcaf,
+ 0xfcb0, 0xfcb1, 0xfcb2, 0xfcb3, 0xfcb4, 0xfcb5, 0xfcb6, 0xfcb7,
+ 0xfcb8, 0xfcb9, 0xfcba, 0xfcbb, 0xfcbc, 0xfcbd, 0xfcbe, 0xfcbf,
+ 0xfcc0, 0xfcc1, 0xfcc2, 0xfcc3, 0xfcc4, 0xfcc5, 0xfcc6, 0xfcc7,
+ 0xfcc8, 0xfcc9, 0xfcca, 0xfccb, 0xfccc, 0xfccd, 0xfcce, 0xfccf,
+ 0xfcd0, 0xfcd1, 0xfcd2, 0xfcd3, 0xfcd4, 0xfcd5, 0xfcd6, 0xfcd7,
+ 0xfcd8, 0xfcd9, 0xfcda, 0xfcdb, 0xfcdc, 0xfcdd, 0xfcde, 0xfcdf,
+ 0xfce0, 0xfce1, 0xfce2, 0xfce3, 0xfce4, 0xfce5, 0xfce6, 0xfce7,
+ 0xfce8, 0xfce9, 0xfcea, 0xfceb, 0xfcec, 0xfced, 0xfcee, 0xfcef,
+ 0xfcf0, 0xfcf1, 0xfcf2, 0xfcf3, 0xfcf4, 0xfcf5, 0xfcf6, 0xfcf7,
+ 0xfcf8, 0xfcf9, 0xfcfa, 0xfcfb, 0xfcfc, 0xfcfd, 0xfcfe, 0xfcff,
+ 0xfd00, 0xfd01, 0xfd02, 0xfd03, 0xfd04, 0xfd05, 0xfd06, 0xfd07,
+ 0xfd08, 0xfd09, 0xfd0a, 0xfd0b, 0xfd0c, 0xfd0d, 0xfd0e, 0xfd0f,
+ 0xfd10, 0xfd11, 0xfd12, 0xfd13, 0xfd14, 0xfd15, 0xfd16, 0xfd17,
+ 0xfd18, 0xfd19, 0xfd1a, 0xfd1b, 0xfd1c, 0xfd1d, 0xfd1e, 0xfd1f,
+ 0xfd20, 0xfd21, 0xfd22, 0xfd23, 0xfd24, 0xfd25, 0xfd26, 0xfd27,
+ 0xfd28, 0xfd29, 0xfd2a, 0xfd2b, 0xfd2c, 0xfd2d, 0xfd2e, 0xfd2f,
+ 0xfd30, 0xfd31, 0xfd32, 0xfd33, 0xfd34, 0xfd35, 0xfd36, 0xfd37,
+ 0xfd38, 0xfd39, 0xfd3a, 0xfd3b, 0xfd3c, 0xfd3d, 0xfd3e, 0xfd3f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfd50, 0xfd51, 0xfd52, 0xfd53, 0xfd54, 0xfd55, 0xfd56, 0xfd57,
+ 0xfd58, 0xfd59, 0xfd5a, 0xfd5b, 0xfd5c, 0xfd5d, 0xfd5e, 0xfd5f,
+ 0xfd60, 0xfd61, 0xfd62, 0xfd63, 0xfd64, 0xfd65, 0xfd66, 0xfd67,
+ 0xfd68, 0xfd69, 0xfd6a, 0xfd6b, 0xfd6c, 0xfd6d, 0xfd6e, 0xfd6f,
+ 0xfd70, 0xfd71, 0xfd72, 0xfd73, 0xfd74, 0xfd75, 0xfd76, 0xfd77,
+ 0xfd78, 0xfd79, 0xfd7a, 0xfd7b, 0xfd7c, 0xfd7d, 0xfd7e, 0xfd7f,
+ 0xfd80, 0xfd81, 0xfd82, 0xfd83, 0xfd84, 0xfd85, 0xfd86, 0xfd87,
+ 0xfd88, 0xfd89, 0xfd8a, 0xfd8b, 0xfd8c, 0xfd8d, 0xfd8e, 0xfd8f,
+ 0x0000, 0x0000, 0xfd92, 0xfd93, 0xfd94, 0xfd95, 0xfd96, 0xfd97,
+ 0xfd98, 0xfd99, 0xfd9a, 0xfd9b, 0xfd9c, 0xfd9d, 0xfd9e, 0xfd9f,
+ 0xfda0, 0xfda1, 0xfda2, 0xfda3, 0xfda4, 0xfda5, 0xfda6, 0xfda7,
+ 0xfda8, 0xfda9, 0xfdaa, 0xfdab, 0xfdac, 0xfdad, 0xfdae, 0xfdaf,
+ 0xfdb0, 0xfdb1, 0xfdb2, 0xfdb3, 0xfdb4, 0xfdb5, 0xfdb6, 0xfdb7,
+ 0xfdb8, 0xfdb9, 0xfdba, 0xfdbb, 0xfdbc, 0xfdbd, 0xfdbe, 0xfdbf,
+ 0xfdc0, 0xfdc1, 0xfdc2, 0xfdc3, 0xfdc4, 0xfdc5, 0xfdc6, 0xfdc7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfdf0, 0xfdf1, 0xfdf2, 0xfdf3, 0xfdf4, 0xfdf5, 0xfdf6, 0xfdf7,
+ 0xfdf8, 0xfdf9, 0xfdfa, 0xfdfb, 0xfdfc, 0xfdfd, 0x0000, 0x0000,
+ 0xfe00, 0xfe01, 0xfe02, 0xfe03, 0xfe04, 0xfe05, 0xfe06, 0xfe07,
+ 0xfe08, 0xfe09, 0xfe0a, 0xfe0b, 0xfe0c, 0xfe0d, 0xfe0e, 0xfe0f,
+ 0xfe10, 0xfe11, 0xfe12, 0xfe13, 0xfe14, 0xfe15, 0xfe16, 0xfe17,
+ 0xfe18, 0xfe19, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfe20, 0xfe21, 0xfe22, 0xfe23, 0xfe24, 0xfe25, 0xfe26, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfe30, 0xfe31, 0xfe32, 0xfe33, 0xfe34, 0xfe35, 0xfe36, 0xfe37,
+ 0xfe38, 0xfe39, 0xfe3a, 0xfe3b, 0xfe3c, 0xfe3d, 0xfe3e, 0xfe3f,
+ 0xfe40, 0xfe41, 0xfe42, 0xfe43, 0xfe44, 0xfe45, 0xfe46, 0xfe47,
+ 0xfe48, 0xfe49, 0xfe4a, 0xfe4b, 0xfe4c, 0xfe4d, 0xfe4e, 0xfe4f,
+ 0xfe50, 0xfe51, 0xfe52, 0x0000, 0xfe54, 0xfe55, 0xfe56, 0xfe57,
+ 0xfe58, 0xfe59, 0xfe5a, 0xfe5b, 0xfe5c, 0xfe5d, 0xfe5e, 0xfe5f,
+ 0xfe60, 0xfe61, 0xfe62, 0xfe63, 0xfe64, 0xfe65, 0xfe66, 0x0000,
+ 0xfe68, 0xfe69, 0xfe6a, 0xfe6b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfe70, 0xfe71, 0xfe72, 0xfe73, 0xfe74, 0x0000, 0xfe76, 0xfe77,
+ 0xfe78, 0xfe79, 0xfe7a, 0xfe7b, 0xfe7c, 0xfe7d, 0xfe7e, 0xfe7f,
+ 0xfe80, 0xfe81, 0xfe82, 0xfe83, 0xfe84, 0xfe85, 0xfe86, 0xfe87,
+ 0xfe88, 0xfe89, 0xfe8a, 0xfe8b, 0xfe8c, 0xfe8d, 0xfe8e, 0xfe8f,
+ 0xfe90, 0xfe91, 0xfe92, 0xfe93, 0xfe94, 0xfe95, 0xfe96, 0xfe97,
+ 0xfe98, 0xfe99, 0xfe9a, 0xfe9b, 0xfe9c, 0xfe9d, 0xfe9e, 0xfe9f,
+ 0xfea0, 0xfea1, 0xfea2, 0xfea3, 0xfea4, 0xfea5, 0xfea6, 0xfea7,
+ 0xfea8, 0xfea9, 0xfeaa, 0xfeab, 0xfeac, 0xfead, 0xfeae, 0xfeaf,
+ 0xfeb0, 0xfeb1, 0xfeb2, 0xfeb3, 0xfeb4, 0xfeb5, 0xfeb6, 0xfeb7,
+ 0xfeb8, 0xfeb9, 0xfeba, 0xfebb, 0xfebc, 0xfebd, 0xfebe, 0xfebf,
+ 0xfec0, 0xfec1, 0xfec2, 0xfec3, 0xfec4, 0xfec5, 0xfec6, 0xfec7,
+ 0xfec8, 0xfec9, 0xfeca, 0xfecb, 0xfecc, 0xfecd, 0xfece, 0xfecf,
+ 0xfed0, 0xfed1, 0xfed2, 0xfed3, 0xfed4, 0xfed5, 0xfed6, 0xfed7,
+ 0xfed8, 0xfed9, 0xfeda, 0xfedb, 0xfedc, 0xfedd, 0xfede, 0xfedf,
+ 0xfee0, 0xfee1, 0xfee2, 0xfee3, 0xfee4, 0xfee5, 0xfee6, 0xfee7,
+ 0xfee8, 0xfee9, 0xfeea, 0xfeeb, 0xfeec, 0xfeed, 0xfeee, 0xfeef,
+ 0xfef0, 0xfef1, 0xfef2, 0xfef3, 0xfef4, 0xfef5, 0xfef6, 0xfef7,
+ 0xfef8, 0xfef9, 0xfefa, 0xfefb, 0xfefc, 0x0000, 0x0000, 0xfeff,
+ 0x0000, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07,
+ 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f,
+ 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17,
+ 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f,
+ 0xff20, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47,
+ 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
+ 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57,
+ 0xff58, 0xff59, 0xff5a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f,
+ 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47,
+ 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
+ 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57,
+ 0xff58, 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xff5e, 0xff5f,
+ 0xff60, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67,
+ 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
+ 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77,
+ 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f,
+ 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87,
+ 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f,
+ 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97,
+ 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f,
+ 0xffa0, 0xffa1, 0xffa2, 0xffa3, 0xffa4, 0xffa5, 0xffa6, 0xffa7,
+ 0xffa8, 0xffa9, 0xffaa, 0xffab, 0xffac, 0xffad, 0xffae, 0xffaf,
+ 0xffb0, 0xffb1, 0xffb2, 0xffb3, 0xffb4, 0xffb5, 0xffb6, 0xffb7,
+ 0xffb8, 0xffb9, 0xffba, 0xffbb, 0xffbc, 0xffbd, 0xffbe, 0x0000,
+ 0x0000, 0x0000, 0xffc2, 0xffc3, 0xffc4, 0xffc5, 0xffc6, 0xffc7,
+ 0x0000, 0x0000, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf,
+ 0x0000, 0x0000, 0xffd2, 0xffd3, 0xffd4, 0xffd5, 0xffd6, 0xffd7,
+ 0x0000, 0x0000, 0xffda, 0xffdb, 0xffdc, 0x0000, 0x0000, 0x0000,
+ 0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe4, 0xffe5, 0xffe6, 0x0000,
+ 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec, 0xffed, 0xffee, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd, 0x0000, 0x0000
+};
+
+#if 0
+const unsigned short ____toupper[] = { 0,
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
+ 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
+ 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
+ 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
+ 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
+ 0x0060, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
+ 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
+ 0x0058, 0x0059, 0x005a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+ 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+ 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+ 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
+ 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x039c, 0x00b6, 0x00b7,
+ 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+ 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+ 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+ 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
+ 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
+ 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+ 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+ 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00f7,
+ 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x0178,
+ 0x0100, 0x0100, 0x0102, 0x0102, 0x0104, 0x0104, 0x0106, 0x0106,
+ 0x0108, 0x0108, 0x010a, 0x010a, 0x010c, 0x010c, 0x010e, 0x010e,
+ 0x0110, 0x0110, 0x0112, 0x0112, 0x0114, 0x0114, 0x0116, 0x0116,
+ 0x0118, 0x0118, 0x011a, 0x011a, 0x011c, 0x011c, 0x011e, 0x011e,
+ 0x0120, 0x0120, 0x0122, 0x0122, 0x0124, 0x0124, 0x0126, 0x0126,
+ 0x0128, 0x0128, 0x012a, 0x012a, 0x012c, 0x012c, 0x012e, 0x012e,
+ 0x0130, 0x0049, 0x0132, 0x0132, 0x0134, 0x0134, 0x0136, 0x0136,
+ 0x0138, 0x0139, 0x0139, 0x013b, 0x013b, 0x013d, 0x013d, 0x013f,
+ 0x013f, 0x0141, 0x0141, 0x0143, 0x0143, 0x0145, 0x0145, 0x0147,
+ 0x0147, 0x0149, 0x014a, 0x014a, 0x014c, 0x014c, 0x014e, 0x014e,
+ 0x0150, 0x0150, 0x0152, 0x0152, 0x0154, 0x0154, 0x0156, 0x0156,
+ 0x0158, 0x0158, 0x015a, 0x015a, 0x015c, 0x015c, 0x015e, 0x015e,
+ 0x0160, 0x0160, 0x0162, 0x0162, 0x0164, 0x0164, 0x0166, 0x0166,
+ 0x0168, 0x0168, 0x016a, 0x016a, 0x016c, 0x016c, 0x016e, 0x016e,
+ 0x0170, 0x0170, 0x0172, 0x0172, 0x0174, 0x0174, 0x0176, 0x0176,
+ 0x0178, 0x0179, 0x0179, 0x017b, 0x017b, 0x017d, 0x017d, 0x0053,
+ 0x0243, 0x0181, 0x0182, 0x0182, 0x0184, 0x0184, 0x0186, 0x0187,
+ 0x0187, 0x0189, 0x018a, 0x018b, 0x018b, 0x018d, 0x018e, 0x018f,
+ 0x0190, 0x0191, 0x0191, 0x0193, 0x0194, 0x01f6, 0x0196, 0x0197,
+ 0x0198, 0x0198, 0x023d, 0x019b, 0x019c, 0x019d, 0x0220, 0x019f,
+ 0x01a0, 0x01a0, 0x01a2, 0x01a2, 0x01a4, 0x01a4, 0x01a6, 0x01a7,
+ 0x01a7, 0x01a9, 0x01aa, 0x01ab, 0x01ac, 0x01ac, 0x01ae, 0x01af,
+ 0x01af, 0x01b1, 0x01b2, 0x01b3, 0x01b3, 0x01b5, 0x01b5, 0x01b7,
+ 0x01b8, 0x01b8, 0x01ba, 0x01bb, 0x01bc, 0x01bc, 0x01be, 0x01f7,
+ 0x01c0, 0x01c1, 0x01c2, 0x01c3, 0x01c4, 0x01c4, 0x01c4, 0x01c7,
+ 0x01c7, 0x01c7, 0x01ca, 0x01ca, 0x01ca, 0x01cd, 0x01cd, 0x01cf,
+ 0x01cf, 0x01d1, 0x01d1, 0x01d3, 0x01d3, 0x01d5, 0x01d5, 0x01d7,
+ 0x01d7, 0x01d9, 0x01d9, 0x01db, 0x01db, 0x018e, 0x01de, 0x01de,
+ 0x01e0, 0x01e0, 0x01e2, 0x01e2, 0x01e4, 0x01e4, 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8, 0x01ea, 0x01ea, 0x01ec, 0x01ec, 0x01ee, 0x01ee,
+ 0x01f0, 0x01f1, 0x01f1, 0x01f1, 0x01f4, 0x01f4, 0x01f6, 0x01f7,
+ 0x01f8, 0x01f8, 0x01fa, 0x01fa, 0x01fc, 0x01fc, 0x01fe, 0x01fe,
+ 0x0200, 0x0200, 0x0202, 0x0202, 0x0204, 0x0204, 0x0206, 0x0206,
+ 0x0208, 0x0208, 0x020a, 0x020a, 0x020c, 0x020c, 0x020e, 0x020e,
+ 0x0210, 0x0210, 0x0212, 0x0212, 0x0214, 0x0214, 0x0216, 0x0216,
+ 0x0218, 0x0218, 0x021a, 0x021a, 0x021c, 0x021c, 0x021e, 0x021e,
+ 0x0220, 0x0221, 0x0222, 0x0222, 0x0224, 0x0224, 0x0226, 0x0226,
+ 0x0228, 0x0228, 0x022a, 0x022a, 0x022c, 0x022c, 0x022e, 0x022e,
+ 0x0230, 0x0230, 0x0232, 0x0232, 0x0234, 0x0235, 0x0236, 0x0237,
+ 0x0238, 0x0239, 0x023a, 0x023b, 0x023b, 0x023d, 0x023e, 0x023f,
+ 0x0240, 0x0241, 0x0241, 0x0243, 0x0244, 0x0245, 0x0246, 0x0246,
+ 0x0248, 0x0248, 0x024a, 0x024a, 0x024c, 0x024c, 0x024e, 0x024e,
+ 0x2c6f, 0x2c6d, 0x0252, 0x0181, 0x0186, 0x0255, 0x0189, 0x018a,
+ 0x0258, 0x018f, 0x025a, 0x0190, 0x025c, 0x025d, 0x025e, 0x025f,
+ 0x0193, 0x0261, 0x0262, 0x0194, 0x0264, 0x0265, 0x0266, 0x0267,
+ 0x0197, 0x0196, 0x026a, 0x2c62, 0x026c, 0x026d, 0x026e, 0x019c,
+ 0x0270, 0x2c6e, 0x019d, 0x0273, 0x0274, 0x019f, 0x0276, 0x0277,
+ 0x0278, 0x0279, 0x027a, 0x027b, 0x027c, 0x2c64, 0x027e, 0x027f,
+ 0x01a6, 0x0281, 0x0282, 0x01a9, 0x0284, 0x0285, 0x0286, 0x0287,
+ 0x01ae, 0x0244, 0x01b1, 0x01b2, 0x0245, 0x028d, 0x028e, 0x028f,
+ 0x0290, 0x0291, 0x01b7, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297,
+ 0x0298, 0x0299, 0x029a, 0x029b, 0x029c, 0x029d, 0x029e, 0x029f,
+ 0x02a0, 0x02a1, 0x02a2, 0x02a3, 0x02a4, 0x02a5, 0x02a6, 0x02a7,
+ 0x02a8, 0x02a9, 0x02aa, 0x02ab, 0x02ac, 0x02ad, 0x02ae, 0x02af,
+ 0x02b0, 0x02b1, 0x02b2, 0x02b3, 0x02b4, 0x02b5, 0x02b6, 0x02b7,
+ 0x02b8, 0x02b9, 0x02ba, 0x02bb, 0x02bc, 0x02bd, 0x02be, 0x02bf,
+ 0x02c0, 0x02c1, 0x02c2, 0x02c3, 0x02c4, 0x02c5, 0x02c6, 0x02c7,
+ 0x02c8, 0x02c9, 0x02ca, 0x02cb, 0x02cc, 0x02cd, 0x02ce, 0x02cf,
+ 0x02d0, 0x02d1, 0x02d2, 0x02d3, 0x02d4, 0x02d5, 0x02d6, 0x02d7,
+ 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x02de, 0x02df,
+ 0x02e0, 0x02e1, 0x02e2, 0x02e3, 0x02e4, 0x02e5, 0x02e6, 0x02e7,
+ 0x02e8, 0x02e9, 0x02ea, 0x02eb, 0x02ec, 0x02ed, 0x02ee, 0x02ef,
+ 0x02f0, 0x02f1, 0x02f2, 0x02f3, 0x02f4, 0x02f5, 0x02f6, 0x02f7,
+ 0x02f8, 0x02f9, 0x02fa, 0x02fb, 0x02fc, 0x02fd, 0x02fe, 0x02ff,
+ 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307,
+ 0x0308, 0x0309, 0x030a, 0x030b, 0x030c, 0x030d, 0x030e, 0x030f,
+ 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317,
+ 0x0318, 0x0319, 0x031a, 0x031b, 0x031c, 0x031d, 0x031e, 0x031f,
+ 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327,
+ 0x0328, 0x0329, 0x032a, 0x032b, 0x032c, 0x032d, 0x032e, 0x032f,
+ 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337,
+ 0x0338, 0x0339, 0x033a, 0x033b, 0x033c, 0x033d, 0x033e, 0x033f,
+ 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x0399, 0x0346, 0x0347,
+ 0x0348, 0x0349, 0x034a, 0x034b, 0x034c, 0x034d, 0x034e, 0x034f,
+ 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357,
+ 0x0358, 0x0359, 0x035a, 0x035b, 0x035c, 0x035d, 0x035e, 0x035f,
+ 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367,
+ 0x0368, 0x0369, 0x036a, 0x036b, 0x036c, 0x036d, 0x036e, 0x036f,
+ 0x0370, 0x0370, 0x0372, 0x0372, 0x0374, 0x0375, 0x0376, 0x0376,
+ 0x0000, 0x0000, 0x037a, 0x03fd, 0x03fe, 0x03ff, 0x037e, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x0386, 0x0387,
+ 0x0388, 0x0389, 0x038a, 0x0000, 0x038c, 0x0000, 0x038e, 0x038f,
+ 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
+ 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
+ 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
+ 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x0386, 0x0388, 0x0389, 0x038a,
+ 0x03b0, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
+ 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
+ 0x03a0, 0x03a1, 0x03a3, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
+ 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x038c, 0x038e, 0x038f, 0x03cf,
+ 0x0392, 0x0398, 0x03d2, 0x03d3, 0x03d4, 0x03a6, 0x03a0, 0x03cf,
+ 0x03d8, 0x03d8, 0x03da, 0x03da, 0x03dc, 0x03dc, 0x03de, 0x03de,
+ 0x03e0, 0x03e0, 0x03e2, 0x03e2, 0x03e4, 0x03e4, 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8, 0x03ea, 0x03ea, 0x03ec, 0x03ec, 0x03ee, 0x03ee,
+ 0x039a, 0x03a1, 0x03f9, 0x03f3, 0x03f4, 0x0395, 0x03f6, 0x03f7,
+ 0x03f7, 0x03f9, 0x03fa, 0x03fa, 0x03fc, 0x03fd, 0x03fe, 0x03ff,
+ 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
+ 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x040d, 0x040e, 0x040f,
+ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
+ 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
+ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
+ 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
+ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
+ 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
+ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
+ 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
+ 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
+ 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x040d, 0x040e, 0x040f,
+ 0x0460, 0x0460, 0x0462, 0x0462, 0x0464, 0x0464, 0x0466, 0x0466,
+ 0x0468, 0x0468, 0x046a, 0x046a, 0x046c, 0x046c, 0x046e, 0x046e,
+ 0x0470, 0x0470, 0x0472, 0x0472, 0x0474, 0x0474, 0x0476, 0x0476,
+ 0x0478, 0x0478, 0x047a, 0x047a, 0x047c, 0x047c, 0x047e, 0x047e,
+ 0x0480, 0x0480, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487,
+ 0x0488, 0x0489, 0x048a, 0x048a, 0x048c, 0x048c, 0x048e, 0x048e,
+ 0x0490, 0x0490, 0x0492, 0x0492, 0x0494, 0x0494, 0x0496, 0x0496,
+ 0x0498, 0x0498, 0x049a, 0x049a, 0x049c, 0x049c, 0x049e, 0x049e,
+ 0x04a0, 0x04a0, 0x04a2, 0x04a2, 0x04a4, 0x04a4, 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8, 0x04aa, 0x04aa, 0x04ac, 0x04ac, 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0, 0x04b2, 0x04b2, 0x04b4, 0x04b4, 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8, 0x04ba, 0x04ba, 0x04bc, 0x04bc, 0x04be, 0x04be,
+ 0x04c0, 0x04c1, 0x04c1, 0x04c3, 0x04c3, 0x04c5, 0x04c5, 0x04c7,
+ 0x04c7, 0x04c9, 0x04c9, 0x04cb, 0x04cb, 0x04cd, 0x04cd, 0x04c0,
+ 0x04d0, 0x04d0, 0x04d2, 0x04d2, 0x04d4, 0x04d4, 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8, 0x04da, 0x04da, 0x04dc, 0x04dc, 0x04de, 0x04de,
+ 0x04e0, 0x04e0, 0x04e2, 0x04e2, 0x04e4, 0x04e4, 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8, 0x04ea, 0x04ea, 0x04ec, 0x04ec, 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0, 0x04f2, 0x04f2, 0x04f4, 0x04f4, 0x04f6, 0x04f6,
+ 0x04f8, 0x04f8, 0x04fa, 0x04fa, 0x04fc, 0x04fc, 0x04fe, 0x04fe,
+ 0x0500, 0x0500, 0x0502, 0x0502, 0x0504, 0x0504, 0x0506, 0x0506,
+ 0x0508, 0x0508, 0x050a, 0x050a, 0x050c, 0x050c, 0x050e, 0x050e,
+ 0x0510, 0x0510, 0x0512, 0x0512, 0x0514, 0x0514, 0x0516, 0x0516,
+ 0x0518, 0x0518, 0x051a, 0x051a, 0x051c, 0x051c, 0x051e, 0x051e,
+ 0x0520, 0x0520, 0x0522, 0x0522, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0531, 0x0532, 0x0533, 0x0534, 0x0535, 0x0536, 0x0537,
+ 0x0538, 0x0539, 0x053a, 0x053b, 0x053c, 0x053d, 0x053e, 0x053f,
+ 0x0540, 0x0541, 0x0542, 0x0543, 0x0544, 0x0545, 0x0546, 0x0547,
+ 0x0548, 0x0549, 0x054a, 0x054b, 0x054c, 0x054d, 0x054e, 0x054f,
+ 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0555, 0x0556, 0x0000,
+ 0x0000, 0x0559, 0x055a, 0x055b, 0x055c, 0x055d, 0x055e, 0x055f,
+ 0x0000, 0x0531, 0x0532, 0x0533, 0x0534, 0x0535, 0x0536, 0x0537,
+ 0x0538, 0x0539, 0x053a, 0x053b, 0x053c, 0x053d, 0x053e, 0x053f,
+ 0x0540, 0x0541, 0x0542, 0x0543, 0x0544, 0x0545, 0x0546, 0x0547,
+ 0x0548, 0x0549, 0x054a, 0x054b, 0x054c, 0x054d, 0x054e, 0x054f,
+ 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0555, 0x0556, 0x0587,
+ 0x0000, 0x0589, 0x058a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597,
+ 0x0598, 0x0599, 0x059a, 0x059b, 0x059c, 0x059d, 0x059e, 0x059f,
+ 0x05a0, 0x05a1, 0x05a2, 0x05a3, 0x05a4, 0x05a5, 0x05a6, 0x05a7,
+ 0x05a8, 0x05a9, 0x05aa, 0x05ab, 0x05ac, 0x05ad, 0x05ae, 0x05af,
+ 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7,
+ 0x05b8, 0x05b9, 0x05ba, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf,
+ 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05c4, 0x05c5, 0x05c6, 0x05c7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
+ 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
+ 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
+ 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0600, 0x0601, 0x0602, 0x0603, 0x0000, 0x0000, 0x0606, 0x0607,
+ 0x0608, 0x0609, 0x060a, 0x060b, 0x060c, 0x060d, 0x060e, 0x060f,
+ 0x0610, 0x0611, 0x0612, 0x0613, 0x0614, 0x0615, 0x0616, 0x0617,
+ 0x0618, 0x0619, 0x061a, 0x061b, 0x0000, 0x0000, 0x061e, 0x061f,
+ 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
+ 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,
+ 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
+ 0x0638, 0x0639, 0x063a, 0x063b, 0x063c, 0x063d, 0x063e, 0x063f,
+ 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
+ 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,
+ 0x0650, 0x0651, 0x0652, 0x0653, 0x0654, 0x0655, 0x0656, 0x0657,
+ 0x0658, 0x0659, 0x065a, 0x065b, 0x065c, 0x065d, 0x065e, 0x0000,
+ 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667,
+ 0x0668, 0x0669, 0x066a, 0x066b, 0x066c, 0x066d, 0x066e, 0x066f,
+ 0x0670, 0x0671, 0x0672, 0x0673, 0x0674, 0x0675, 0x0676, 0x0677,
+ 0x0678, 0x0679, 0x067a, 0x067b, 0x067c, 0x067d, 0x067e, 0x067f,
+ 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0686, 0x0687,
+ 0x0688, 0x0689, 0x068a, 0x068b, 0x068c, 0x068d, 0x068e, 0x068f,
+ 0x0690, 0x0691, 0x0692, 0x0693, 0x0694, 0x0695, 0x0696, 0x0697,
+ 0x0698, 0x0699, 0x069a, 0x069b, 0x069c, 0x069d, 0x069e, 0x069f,
+ 0x06a0, 0x06a1, 0x06a2, 0x06a3, 0x06a4, 0x06a5, 0x06a6, 0x06a7,
+ 0x06a8, 0x06a9, 0x06aa, 0x06ab, 0x06ac, 0x06ad, 0x06ae, 0x06af,
+ 0x06b0, 0x06b1, 0x06b2, 0x06b3, 0x06b4, 0x06b5, 0x06b6, 0x06b7,
+ 0x06b8, 0x06b9, 0x06ba, 0x06bb, 0x06bc, 0x06bd, 0x06be, 0x06bf,
+ 0x06c0, 0x06c1, 0x06c2, 0x06c3, 0x06c4, 0x06c5, 0x06c6, 0x06c7,
+ 0x06c8, 0x06c9, 0x06ca, 0x06cb, 0x06cc, 0x06cd, 0x06ce, 0x06cf,
+ 0x06d0, 0x06d1, 0x06d2, 0x06d3, 0x06d4, 0x06d5, 0x06d6, 0x06d7,
+ 0x06d8, 0x06d9, 0x06da, 0x06db, 0x06dc, 0x06dd, 0x06de, 0x06df,
+ 0x06e0, 0x06e1, 0x06e2, 0x06e3, 0x06e4, 0x06e5, 0x06e6, 0x06e7,
+ 0x06e8, 0x06e9, 0x06ea, 0x06eb, 0x06ec, 0x06ed, 0x06ee, 0x06ef,
+ 0x06f0, 0x06f1, 0x06f2, 0x06f3, 0x06f4, 0x06f5, 0x06f6, 0x06f7,
+ 0x06f8, 0x06f9, 0x06fa, 0x06fb, 0x06fc, 0x06fd, 0x06fe, 0x06ff,
+ 0x0700, 0x0701, 0x0702, 0x0703, 0x0704, 0x0705, 0x0706, 0x0707,
+ 0x0708, 0x0709, 0x070a, 0x070b, 0x070c, 0x070d, 0x0000, 0x070f,
+ 0x0710, 0x0711, 0x0712, 0x0713, 0x0714, 0x0715, 0x0716, 0x0717,
+ 0x0718, 0x0719, 0x071a, 0x071b, 0x071c, 0x071d, 0x071e, 0x071f,
+ 0x0720, 0x0721, 0x0722, 0x0723, 0x0724, 0x0725, 0x0726, 0x0727,
+ 0x0728, 0x0729, 0x072a, 0x072b, 0x072c, 0x072d, 0x072e, 0x072f,
+ 0x0730, 0x0731, 0x0732, 0x0733, 0x0734, 0x0735, 0x0736, 0x0737,
+ 0x0738, 0x0739, 0x073a, 0x073b, 0x073c, 0x073d, 0x073e, 0x073f,
+ 0x0740, 0x0741, 0x0742, 0x0743, 0x0744, 0x0745, 0x0746, 0x0747,
+ 0x0748, 0x0749, 0x074a, 0x0000, 0x0000, 0x074d, 0x074e, 0x074f,
+ 0x0750, 0x0751, 0x0752, 0x0753, 0x0754, 0x0755, 0x0756, 0x0757,
+ 0x0758, 0x0759, 0x075a, 0x075b, 0x075c, 0x075d, 0x075e, 0x075f,
+ 0x0760, 0x0761, 0x0762, 0x0763, 0x0764, 0x0765, 0x0766, 0x0767,
+ 0x0768, 0x0769, 0x076a, 0x076b, 0x076c, 0x076d, 0x076e, 0x076f,
+ 0x0770, 0x0771, 0x0772, 0x0773, 0x0774, 0x0775, 0x0776, 0x0777,
+ 0x0778, 0x0779, 0x077a, 0x077b, 0x077c, 0x077d, 0x077e, 0x077f,
+ 0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0786, 0x0787,
+ 0x0788, 0x0789, 0x078a, 0x078b, 0x078c, 0x078d, 0x078e, 0x078f,
+ 0x0790, 0x0791, 0x0792, 0x0793, 0x0794, 0x0795, 0x0796, 0x0797,
+ 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d, 0x079e, 0x079f,
+ 0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a6, 0x07a7,
+ 0x07a8, 0x07a9, 0x07aa, 0x07ab, 0x07ac, 0x07ad, 0x07ae, 0x07af,
+ 0x07b0, 0x07b1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x07c0, 0x07c1, 0x07c2, 0x07c3, 0x07c4, 0x07c5, 0x07c6, 0x07c7,
+ 0x07c8, 0x07c9, 0x07ca, 0x07cb, 0x07cc, 0x07cd, 0x07ce, 0x07cf,
+ 0x07d0, 0x07d1, 0x07d2, 0x07d3, 0x07d4, 0x07d5, 0x07d6, 0x07d7,
+ 0x07d8, 0x07d9, 0x07da, 0x07db, 0x07dc, 0x07dd, 0x07de, 0x07df,
+ 0x07e0, 0x07e1, 0x07e2, 0x07e3, 0x07e4, 0x07e5, 0x07e6, 0x07e7,
+ 0x07e8, 0x07e9, 0x07ea, 0x07eb, 0x07ec, 0x07ed, 0x07ee, 0x07ef,
+ 0x07f0, 0x07f1, 0x07f2, 0x07f3, 0x07f4, 0x07f5, 0x07f6, 0x07f7,
+ 0x07f8, 0x07f9, 0x07fa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0901, 0x0902, 0x0903, 0x0904, 0x0905, 0x0906, 0x0907,
+ 0x0908, 0x0909, 0x090a, 0x090b, 0x090c, 0x090d, 0x090e, 0x090f,
+ 0x0910, 0x0911, 0x0912, 0x0913, 0x0914, 0x0915, 0x0916, 0x0917,
+ 0x0918, 0x0919, 0x091a, 0x091b, 0x091c, 0x091d, 0x091e, 0x091f,
+ 0x0920, 0x0921, 0x0922, 0x0923, 0x0924, 0x0925, 0x0926, 0x0927,
+ 0x0928, 0x0929, 0x092a, 0x092b, 0x092c, 0x092d, 0x092e, 0x092f,
+ 0x0930, 0x0931, 0x0932, 0x0933, 0x0934, 0x0935, 0x0936, 0x0937,
+ 0x0938, 0x0939, 0x0000, 0x0000, 0x093c, 0x093d, 0x093e, 0x093f,
+ 0x0940, 0x0941, 0x0942, 0x0943, 0x0944, 0x0945, 0x0946, 0x0947,
+ 0x0948, 0x0949, 0x094a, 0x094b, 0x094c, 0x094d, 0x0000, 0x0000,
+ 0x0950, 0x0951, 0x0952, 0x0953, 0x0954, 0x0000, 0x0000, 0x0000,
+ 0x0958, 0x0959, 0x095a, 0x095b, 0x095c, 0x095d, 0x095e, 0x095f,
+ 0x0960, 0x0961, 0x0962, 0x0963, 0x0964, 0x0965, 0x0966, 0x0967,
+ 0x0968, 0x0969, 0x096a, 0x096b, 0x096c, 0x096d, 0x096e, 0x096f,
+ 0x0970, 0x0971, 0x0972, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x097b, 0x097c, 0x097d, 0x097e, 0x097f,
+ 0x0000, 0x0981, 0x0982, 0x0983, 0x0000, 0x0985, 0x0986, 0x0987,
+ 0x0988, 0x0989, 0x098a, 0x098b, 0x098c, 0x0000, 0x0000, 0x098f,
+ 0x0990, 0x0000, 0x0000, 0x0993, 0x0994, 0x0995, 0x0996, 0x0997,
+ 0x0998, 0x0999, 0x099a, 0x099b, 0x099c, 0x099d, 0x099e, 0x099f,
+ 0x09a0, 0x09a1, 0x09a2, 0x09a3, 0x09a4, 0x09a5, 0x09a6, 0x09a7,
+ 0x09a8, 0x0000, 0x09aa, 0x09ab, 0x09ac, 0x09ad, 0x09ae, 0x09af,
+ 0x09b0, 0x0000, 0x09b2, 0x0000, 0x0000, 0x0000, 0x09b6, 0x09b7,
+ 0x09b8, 0x09b9, 0x0000, 0x0000, 0x09bc, 0x09bd, 0x09be, 0x09bf,
+ 0x09c0, 0x09c1, 0x09c2, 0x09c3, 0x09c4, 0x0000, 0x0000, 0x09c7,
+ 0x09c8, 0x0000, 0x0000, 0x09cb, 0x09cc, 0x09cd, 0x09ce, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x09d7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x09dc, 0x09dd, 0x0000, 0x09df,
+ 0x09e0, 0x09e1, 0x09e2, 0x09e3, 0x0000, 0x0000, 0x09e6, 0x09e7,
+ 0x09e8, 0x09e9, 0x09ea, 0x09eb, 0x09ec, 0x09ed, 0x09ee, 0x09ef,
+ 0x09f0, 0x09f1, 0x09f2, 0x09f3, 0x09f4, 0x09f5, 0x09f6, 0x09f7,
+ 0x09f8, 0x09f9, 0x09fa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0a01, 0x0a02, 0x0a03, 0x0000, 0x0a05, 0x0a06, 0x0a07,
+ 0x0a08, 0x0a09, 0x0a0a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a0f,
+ 0x0a10, 0x0000, 0x0000, 0x0a13, 0x0a14, 0x0a15, 0x0a16, 0x0a17,
+ 0x0a18, 0x0a19, 0x0a1a, 0x0a1b, 0x0a1c, 0x0a1d, 0x0a1e, 0x0a1f,
+ 0x0a20, 0x0a21, 0x0a22, 0x0a23, 0x0a24, 0x0a25, 0x0a26, 0x0a27,
+ 0x0a28, 0x0000, 0x0a2a, 0x0a2b, 0x0a2c, 0x0a2d, 0x0a2e, 0x0a2f,
+ 0x0a30, 0x0000, 0x0a32, 0x0a33, 0x0000, 0x0a35, 0x0a36, 0x0000,
+ 0x0a38, 0x0a39, 0x0000, 0x0000, 0x0a3c, 0x0000, 0x0a3e, 0x0a3f,
+ 0x0a40, 0x0a41, 0x0a42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a47,
+ 0x0a48, 0x0000, 0x0000, 0x0a4b, 0x0a4c, 0x0a4d, 0x0000, 0x0000,
+ 0x0000, 0x0a51, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0a59, 0x0a5a, 0x0a5b, 0x0a5c, 0x0000, 0x0a5e, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0a66, 0x0a67,
+ 0x0a68, 0x0a69, 0x0a6a, 0x0a6b, 0x0a6c, 0x0a6d, 0x0a6e, 0x0a6f,
+ 0x0a70, 0x0a71, 0x0a72, 0x0a73, 0x0a74, 0x0a75, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0a81, 0x0a82, 0x0a83, 0x0000, 0x0a85, 0x0a86, 0x0a87,
+ 0x0a88, 0x0a89, 0x0a8a, 0x0a8b, 0x0a8c, 0x0a8d, 0x0000, 0x0a8f,
+ 0x0a90, 0x0a91, 0x0000, 0x0a93, 0x0a94, 0x0a95, 0x0a96, 0x0a97,
+ 0x0a98, 0x0a99, 0x0a9a, 0x0a9b, 0x0a9c, 0x0a9d, 0x0a9e, 0x0a9f,
+ 0x0aa0, 0x0aa1, 0x0aa2, 0x0aa3, 0x0aa4, 0x0aa5, 0x0aa6, 0x0aa7,
+ 0x0aa8, 0x0000, 0x0aaa, 0x0aab, 0x0aac, 0x0aad, 0x0aae, 0x0aaf,
+ 0x0ab0, 0x0000, 0x0ab2, 0x0ab3, 0x0000, 0x0ab5, 0x0ab6, 0x0ab7,
+ 0x0ab8, 0x0ab9, 0x0000, 0x0000, 0x0abc, 0x0abd, 0x0abe, 0x0abf,
+ 0x0ac0, 0x0ac1, 0x0ac2, 0x0ac3, 0x0ac4, 0x0ac5, 0x0000, 0x0ac7,
+ 0x0ac8, 0x0ac9, 0x0000, 0x0acb, 0x0acc, 0x0acd, 0x0000, 0x0000,
+ 0x0ad0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0ae0, 0x0ae1, 0x0ae2, 0x0ae3, 0x0000, 0x0000, 0x0ae6, 0x0ae7,
+ 0x0ae8, 0x0ae9, 0x0aea, 0x0aeb, 0x0aec, 0x0aed, 0x0aee, 0x0aef,
+ 0x0000, 0x0af1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0b01, 0x0b02, 0x0b03, 0x0000, 0x0b05, 0x0b06, 0x0b07,
+ 0x0b08, 0x0b09, 0x0b0a, 0x0b0b, 0x0b0c, 0x0000, 0x0000, 0x0b0f,
+ 0x0b10, 0x0000, 0x0000, 0x0b13, 0x0b14, 0x0b15, 0x0b16, 0x0b17,
+ 0x0b18, 0x0b19, 0x0b1a, 0x0b1b, 0x0b1c, 0x0b1d, 0x0b1e, 0x0b1f,
+ 0x0b20, 0x0b21, 0x0b22, 0x0b23, 0x0b24, 0x0b25, 0x0b26, 0x0b27,
+ 0x0b28, 0x0000, 0x0b2a, 0x0b2b, 0x0b2c, 0x0b2d, 0x0b2e, 0x0b2f,
+ 0x0b30, 0x0000, 0x0b32, 0x0b33, 0x0000, 0x0b35, 0x0b36, 0x0b37,
+ 0x0b38, 0x0b39, 0x0000, 0x0000, 0x0b3c, 0x0b3d, 0x0b3e, 0x0b3f,
+ 0x0b40, 0x0b41, 0x0b42, 0x0b43, 0x0b44, 0x0000, 0x0000, 0x0b47,
+ 0x0b48, 0x0000, 0x0000, 0x0b4b, 0x0b4c, 0x0b4d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0b56, 0x0b57,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0b5c, 0x0b5d, 0x0000, 0x0b5f,
+ 0x0b60, 0x0b61, 0x0b62, 0x0b63, 0x0000, 0x0000, 0x0b66, 0x0b67,
+ 0x0b68, 0x0b69, 0x0b6a, 0x0b6b, 0x0b6c, 0x0b6d, 0x0b6e, 0x0b6f,
+ 0x0b70, 0x0b71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0b82, 0x0b83, 0x0000, 0x0b85, 0x0b86, 0x0b87,
+ 0x0b88, 0x0b89, 0x0b8a, 0x0000, 0x0000, 0x0000, 0x0b8e, 0x0b8f,
+ 0x0b90, 0x0000, 0x0b92, 0x0b93, 0x0b94, 0x0b95, 0x0000, 0x0000,
+ 0x0000, 0x0b99, 0x0b9a, 0x0000, 0x0b9c, 0x0000, 0x0b9e, 0x0b9f,
+ 0x0000, 0x0000, 0x0000, 0x0ba3, 0x0ba4, 0x0000, 0x0000, 0x0000,
+ 0x0ba8, 0x0ba9, 0x0baa, 0x0000, 0x0000, 0x0000, 0x0bae, 0x0baf,
+ 0x0bb0, 0x0bb1, 0x0bb2, 0x0bb3, 0x0bb4, 0x0bb5, 0x0bb6, 0x0bb7,
+ 0x0bb8, 0x0bb9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0bbe, 0x0bbf,
+ 0x0bc0, 0x0bc1, 0x0bc2, 0x0000, 0x0000, 0x0000, 0x0bc6, 0x0bc7,
+ 0x0bc8, 0x0000, 0x0bca, 0x0bcb, 0x0bcc, 0x0bcd, 0x0000, 0x0000,
+ 0x0bd0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0bd7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0be6, 0x0be7,
+ 0x0be8, 0x0be9, 0x0bea, 0x0beb, 0x0bec, 0x0bed, 0x0bee, 0x0bef,
+ 0x0bf0, 0x0bf1, 0x0bf2, 0x0bf3, 0x0bf4, 0x0bf5, 0x0bf6, 0x0bf7,
+ 0x0bf8, 0x0bf9, 0x0bfa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0c01, 0x0c02, 0x0c03, 0x0000, 0x0c05, 0x0c06, 0x0c07,
+ 0x0c08, 0x0c09, 0x0c0a, 0x0c0b, 0x0c0c, 0x0000, 0x0c0e, 0x0c0f,
+ 0x0c10, 0x0000, 0x0c12, 0x0c13, 0x0c14, 0x0c15, 0x0c16, 0x0c17,
+ 0x0c18, 0x0c19, 0x0c1a, 0x0c1b, 0x0c1c, 0x0c1d, 0x0c1e, 0x0c1f,
+ 0x0c20, 0x0c21, 0x0c22, 0x0c23, 0x0c24, 0x0c25, 0x0c26, 0x0c27,
+ 0x0c28, 0x0000, 0x0c2a, 0x0c2b, 0x0c2c, 0x0c2d, 0x0c2e, 0x0c2f,
+ 0x0c30, 0x0c31, 0x0c32, 0x0c33, 0x0000, 0x0c35, 0x0c36, 0x0c37,
+ 0x0c38, 0x0c39, 0x0000, 0x0000, 0x0000, 0x0c3d, 0x0c3e, 0x0c3f,
+ 0x0c40, 0x0c41, 0x0c42, 0x0c43, 0x0c44, 0x0000, 0x0c46, 0x0c47,
+ 0x0c48, 0x0000, 0x0c4a, 0x0c4b, 0x0c4c, 0x0c4d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0c55, 0x0c56, 0x0000,
+ 0x0c58, 0x0c59, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0c60, 0x0c61, 0x0c62, 0x0c63, 0x0000, 0x0000, 0x0c66, 0x0c67,
+ 0x0c68, 0x0c69, 0x0c6a, 0x0c6b, 0x0c6c, 0x0c6d, 0x0c6e, 0x0c6f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0c78, 0x0c79, 0x0c7a, 0x0c7b, 0x0c7c, 0x0c7d, 0x0c7e, 0x0c7f,
+ 0x0000, 0x0000, 0x0c82, 0x0c83, 0x0000, 0x0c85, 0x0c86, 0x0c87,
+ 0x0c88, 0x0c89, 0x0c8a, 0x0c8b, 0x0c8c, 0x0000, 0x0c8e, 0x0c8f,
+ 0x0c90, 0x0000, 0x0c92, 0x0c93, 0x0c94, 0x0c95, 0x0c96, 0x0c97,
+ 0x0c98, 0x0c99, 0x0c9a, 0x0c9b, 0x0c9c, 0x0c9d, 0x0c9e, 0x0c9f,
+ 0x0ca0, 0x0ca1, 0x0ca2, 0x0ca3, 0x0ca4, 0x0ca5, 0x0ca6, 0x0ca7,
+ 0x0ca8, 0x0000, 0x0caa, 0x0cab, 0x0cac, 0x0cad, 0x0cae, 0x0caf,
+ 0x0cb0, 0x0cb1, 0x0cb2, 0x0cb3, 0x0000, 0x0cb5, 0x0cb6, 0x0cb7,
+ 0x0cb8, 0x0cb9, 0x0000, 0x0000, 0x0cbc, 0x0cbd, 0x0cbe, 0x0cbf,
+ 0x0cc0, 0x0cc1, 0x0cc2, 0x0cc3, 0x0cc4, 0x0000, 0x0cc6, 0x0cc7,
+ 0x0cc8, 0x0000, 0x0cca, 0x0ccb, 0x0ccc, 0x0ccd, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0cd5, 0x0cd6, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0cde, 0x0000,
+ 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0000, 0x0000, 0x0ce6, 0x0ce7,
+ 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x0cef,
+ 0x0000, 0x0cf1, 0x0cf2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0d02, 0x0d03, 0x0000, 0x0d05, 0x0d06, 0x0d07,
+ 0x0d08, 0x0d09, 0x0d0a, 0x0d0b, 0x0d0c, 0x0000, 0x0d0e, 0x0d0f,
+ 0x0d10, 0x0000, 0x0d12, 0x0d13, 0x0d14, 0x0d15, 0x0d16, 0x0d17,
+ 0x0d18, 0x0d19, 0x0d1a, 0x0d1b, 0x0d1c, 0x0d1d, 0x0d1e, 0x0d1f,
+ 0x0d20, 0x0d21, 0x0d22, 0x0d23, 0x0d24, 0x0d25, 0x0d26, 0x0d27,
+ 0x0d28, 0x0000, 0x0d2a, 0x0d2b, 0x0d2c, 0x0d2d, 0x0d2e, 0x0d2f,
+ 0x0d30, 0x0d31, 0x0d32, 0x0d33, 0x0d34, 0x0d35, 0x0d36, 0x0d37,
+ 0x0d38, 0x0d39, 0x0000, 0x0000, 0x0000, 0x0d3d, 0x0d3e, 0x0d3f,
+ 0x0d40, 0x0d41, 0x0d42, 0x0d43, 0x0d44, 0x0000, 0x0d46, 0x0d47,
+ 0x0d48, 0x0000, 0x0d4a, 0x0d4b, 0x0d4c, 0x0d4d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0d57,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0d60, 0x0d61, 0x0d62, 0x0d63, 0x0000, 0x0000, 0x0d66, 0x0d67,
+ 0x0d68, 0x0d69, 0x0d6a, 0x0d6b, 0x0d6c, 0x0d6d, 0x0d6e, 0x0d6f,
+ 0x0d70, 0x0d71, 0x0d72, 0x0d73, 0x0d74, 0x0d75, 0x0000, 0x0000,
+ 0x0000, 0x0d79, 0x0d7a, 0x0d7b, 0x0d7c, 0x0d7d, 0x0d7e, 0x0d7f,
+ 0x0000, 0x0000, 0x0d82, 0x0d83, 0x0000, 0x0d85, 0x0d86, 0x0d87,
+ 0x0d88, 0x0d89, 0x0d8a, 0x0d8b, 0x0d8c, 0x0d8d, 0x0d8e, 0x0d8f,
+ 0x0d90, 0x0d91, 0x0d92, 0x0d93, 0x0d94, 0x0d95, 0x0d96, 0x0000,
+ 0x0000, 0x0000, 0x0d9a, 0x0d9b, 0x0d9c, 0x0d9d, 0x0d9e, 0x0d9f,
+ 0x0da0, 0x0da1, 0x0da2, 0x0da3, 0x0da4, 0x0da5, 0x0da6, 0x0da7,
+ 0x0da8, 0x0da9, 0x0daa, 0x0dab, 0x0dac, 0x0dad, 0x0dae, 0x0daf,
+ 0x0db0, 0x0db1, 0x0000, 0x0db3, 0x0db4, 0x0db5, 0x0db6, 0x0db7,
+ 0x0db8, 0x0db9, 0x0dba, 0x0dbb, 0x0000, 0x0dbd, 0x0000, 0x0000,
+ 0x0dc0, 0x0dc1, 0x0dc2, 0x0dc3, 0x0dc4, 0x0dc5, 0x0dc6, 0x0000,
+ 0x0000, 0x0000, 0x0dca, 0x0000, 0x0000, 0x0000, 0x0000, 0x0dcf,
+ 0x0dd0, 0x0dd1, 0x0dd2, 0x0dd3, 0x0dd4, 0x0000, 0x0dd6, 0x0000,
+ 0x0dd8, 0x0dd9, 0x0dda, 0x0ddb, 0x0ddc, 0x0ddd, 0x0dde, 0x0ddf,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0df2, 0x0df3, 0x0df4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
+ 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
+ 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
+ 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
+ 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
+ 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
+ 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
+ 0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f,
+ 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
+ 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
+ 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
+ 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0e81, 0x0e82, 0x0000, 0x0e84, 0x0000, 0x0000, 0x0e87,
+ 0x0e88, 0x0000, 0x0e8a, 0x0000, 0x0000, 0x0e8d, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0e94, 0x0e95, 0x0e96, 0x0e97,
+ 0x0000, 0x0e99, 0x0e9a, 0x0e9b, 0x0e9c, 0x0e9d, 0x0e9e, 0x0e9f,
+ 0x0000, 0x0ea1, 0x0ea2, 0x0ea3, 0x0000, 0x0ea5, 0x0000, 0x0ea7,
+ 0x0000, 0x0000, 0x0eaa, 0x0eab, 0x0000, 0x0ead, 0x0eae, 0x0eaf,
+ 0x0eb0, 0x0eb1, 0x0eb2, 0x0eb3, 0x0eb4, 0x0eb5, 0x0eb6, 0x0eb7,
+ 0x0eb8, 0x0eb9, 0x0000, 0x0ebb, 0x0ebc, 0x0ebd, 0x0000, 0x0000,
+ 0x0ec0, 0x0ec1, 0x0ec2, 0x0ec3, 0x0ec4, 0x0000, 0x0ec6, 0x0000,
+ 0x0ec8, 0x0ec9, 0x0eca, 0x0ecb, 0x0ecc, 0x0ecd, 0x0000, 0x0000,
+ 0x0ed0, 0x0ed1, 0x0ed2, 0x0ed3, 0x0ed4, 0x0ed5, 0x0ed6, 0x0ed7,
+ 0x0ed8, 0x0ed9, 0x0000, 0x0000, 0x0edc, 0x0edd, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06, 0x0f07,
+ 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e, 0x0f0f,
+ 0x0f10, 0x0f11, 0x0f12, 0x0f13, 0x0f14, 0x0f15, 0x0f16, 0x0f17,
+ 0x0f18, 0x0f19, 0x0f1a, 0x0f1b, 0x0f1c, 0x0f1d, 0x0f1e, 0x0f1f,
+ 0x0f20, 0x0f21, 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26, 0x0f27,
+ 0x0f28, 0x0f29, 0x0f2a, 0x0f2b, 0x0f2c, 0x0f2d, 0x0f2e, 0x0f2f,
+ 0x0f30, 0x0f31, 0x0f32, 0x0f33, 0x0f34, 0x0f35, 0x0f36, 0x0f37,
+ 0x0f38, 0x0f39, 0x0f3a, 0x0f3b, 0x0f3c, 0x0f3d, 0x0f3e, 0x0f3f,
+ 0x0f40, 0x0f41, 0x0f42, 0x0f43, 0x0f44, 0x0f45, 0x0f46, 0x0f47,
+ 0x0000, 0x0f49, 0x0f4a, 0x0f4b, 0x0f4c, 0x0f4d, 0x0f4e, 0x0f4f,
+ 0x0f50, 0x0f51, 0x0f52, 0x0f53, 0x0f54, 0x0f55, 0x0f56, 0x0f57,
+ 0x0f58, 0x0f59, 0x0f5a, 0x0f5b, 0x0f5c, 0x0f5d, 0x0f5e, 0x0f5f,
+ 0x0f60, 0x0f61, 0x0f62, 0x0f63, 0x0f64, 0x0f65, 0x0f66, 0x0f67,
+ 0x0f68, 0x0f69, 0x0f6a, 0x0f6b, 0x0f6c, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0f71, 0x0f72, 0x0f73, 0x0f74, 0x0f75, 0x0f76, 0x0f77,
+ 0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
+ 0x0f80, 0x0f81, 0x0f82, 0x0f83, 0x0f84, 0x0f85, 0x0f86, 0x0f87,
+ 0x0f88, 0x0f89, 0x0f8a, 0x0f8b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0f90, 0x0f91, 0x0f92, 0x0f93, 0x0f94, 0x0f95, 0x0f96, 0x0f97,
+ 0x0000, 0x0f99, 0x0f9a, 0x0f9b, 0x0f9c, 0x0f9d, 0x0f9e, 0x0f9f,
+ 0x0fa0, 0x0fa1, 0x0fa2, 0x0fa3, 0x0fa4, 0x0fa5, 0x0fa6, 0x0fa7,
+ 0x0fa8, 0x0fa9, 0x0faa, 0x0fab, 0x0fac, 0x0fad, 0x0fae, 0x0faf,
+ 0x0fb0, 0x0fb1, 0x0fb2, 0x0fb3, 0x0fb4, 0x0fb5, 0x0fb6, 0x0fb7,
+ 0x0fb8, 0x0fb9, 0x0fba, 0x0fbb, 0x0fbc, 0x0000, 0x0fbe, 0x0fbf,
+ 0x0fc0, 0x0fc1, 0x0fc2, 0x0fc3, 0x0fc4, 0x0fc5, 0x0fc6, 0x0fc7,
+ 0x0fc8, 0x0fc9, 0x0fca, 0x0fcb, 0x0fcc, 0x0000, 0x0fce, 0x0fcf,
+ 0x0fd0, 0x0fd1, 0x0fd2, 0x0fd3, 0x0fd4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007,
+ 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x100e, 0x100f,
+ 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017,
+ 0x1018, 0x1019, 0x101a, 0x101b, 0x101c, 0x101d, 0x101e, 0x101f,
+ 0x1020, 0x1021, 0x1022, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027,
+ 0x1028, 0x1029, 0x102a, 0x102b, 0x102c, 0x102d, 0x102e, 0x102f,
+ 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, 0x1035, 0x1036, 0x1037,
+ 0x1038, 0x1039, 0x103a, 0x103b, 0x103c, 0x103d, 0x103e, 0x103f,
+ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047,
+ 0x1048, 0x1049, 0x104a, 0x104b, 0x104c, 0x104d, 0x104e, 0x104f,
+ 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057,
+ 0x1058, 0x1059, 0x105a, 0x105b, 0x105c, 0x105d, 0x105e, 0x105f,
+ 0x1060, 0x1061, 0x1062, 0x1063, 0x1064, 0x1065, 0x1066, 0x1067,
+ 0x1068, 0x1069, 0x106a, 0x106b, 0x106c, 0x106d, 0x106e, 0x106f,
+ 0x1070, 0x1071, 0x1072, 0x1073, 0x1074, 0x1075, 0x1076, 0x1077,
+ 0x1078, 0x1079, 0x107a, 0x107b, 0x107c, 0x107d, 0x107e, 0x107f,
+ 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086, 0x1087,
+ 0x1088, 0x1089, 0x108a, 0x108b, 0x108c, 0x108d, 0x108e, 0x108f,
+ 0x1090, 0x1091, 0x1092, 0x1093, 0x1094, 0x1095, 0x1096, 0x1097,
+ 0x1098, 0x1099, 0x0000, 0x0000, 0x0000, 0x0000, 0x109e, 0x109f,
+ 0x10a0, 0x10a1, 0x10a2, 0x10a3, 0x10a4, 0x10a5, 0x10a6, 0x10a7,
+ 0x10a8, 0x10a9, 0x10aa, 0x10ab, 0x10ac, 0x10ad, 0x10ae, 0x10af,
+ 0x10b0, 0x10b1, 0x10b2, 0x10b3, 0x10b4, 0x10b5, 0x10b6, 0x10b7,
+ 0x10b8, 0x10b9, 0x10ba, 0x10bb, 0x10bc, 0x10bd, 0x10be, 0x10bf,
+ 0x10c0, 0x10c1, 0x10c2, 0x10c3, 0x10c4, 0x10c5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7,
+ 0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df,
+ 0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7,
+ 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10ef,
+ 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7,
+ 0x10f8, 0x10f9, 0x10fa, 0x10fb, 0x10fc, 0x0000, 0x0000, 0x0000,
+ 0x1100, 0x1101, 0x1102, 0x1103, 0x1104, 0x1105, 0x1106, 0x1107,
+ 0x1108, 0x1109, 0x110a, 0x110b, 0x110c, 0x110d, 0x110e, 0x110f,
+ 0x1110, 0x1111, 0x1112, 0x1113, 0x1114, 0x1115, 0x1116, 0x1117,
+ 0x1118, 0x1119, 0x111a, 0x111b, 0x111c, 0x111d, 0x111e, 0x111f,
+ 0x1120, 0x1121, 0x1122, 0x1123, 0x1124, 0x1125, 0x1126, 0x1127,
+ 0x1128, 0x1129, 0x112a, 0x112b, 0x112c, 0x112d, 0x112e, 0x112f,
+ 0x1130, 0x1131, 0x1132, 0x1133, 0x1134, 0x1135, 0x1136, 0x1137,
+ 0x1138, 0x1139, 0x113a, 0x113b, 0x113c, 0x113d, 0x113e, 0x113f,
+ 0x1140, 0x1141, 0x1142, 0x1143, 0x1144, 0x1145, 0x1146, 0x1147,
+ 0x1148, 0x1149, 0x114a, 0x114b, 0x114c, 0x114d, 0x114e, 0x114f,
+ 0x1150, 0x1151, 0x1152, 0x1153, 0x1154, 0x1155, 0x1156, 0x1157,
+ 0x1158, 0x1159, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x115f,
+ 0x1160, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167,
+ 0x1168, 0x1169, 0x116a, 0x116b, 0x116c, 0x116d, 0x116e, 0x116f,
+ 0x1170, 0x1171, 0x1172, 0x1173, 0x1174, 0x1175, 0x1176, 0x1177,
+ 0x1178, 0x1179, 0x117a, 0x117b, 0x117c, 0x117d, 0x117e, 0x117f,
+ 0x1180, 0x1181, 0x1182, 0x1183, 0x1184, 0x1185, 0x1186, 0x1187,
+ 0x1188, 0x1189, 0x118a, 0x118b, 0x118c, 0x118d, 0x118e, 0x118f,
+ 0x1190, 0x1191, 0x1192, 0x1193, 0x1194, 0x1195, 0x1196, 0x1197,
+ 0x1198, 0x1199, 0x119a, 0x119b, 0x119c, 0x119d, 0x119e, 0x119f,
+ 0x11a0, 0x11a1, 0x11a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x11a8, 0x11a9, 0x11aa, 0x11ab, 0x11ac, 0x11ad, 0x11ae, 0x11af,
+ 0x11b0, 0x11b1, 0x11b2, 0x11b3, 0x11b4, 0x11b5, 0x11b6, 0x11b7,
+ 0x11b8, 0x11b9, 0x11ba, 0x11bb, 0x11bc, 0x11bd, 0x11be, 0x11bf,
+ 0x11c0, 0x11c1, 0x11c2, 0x11c3, 0x11c4, 0x11c5, 0x11c6, 0x11c7,
+ 0x11c8, 0x11c9, 0x11ca, 0x11cb, 0x11cc, 0x11cd, 0x11ce, 0x11cf,
+ 0x11d0, 0x11d1, 0x11d2, 0x11d3, 0x11d4, 0x11d5, 0x11d6, 0x11d7,
+ 0x11d8, 0x11d9, 0x11da, 0x11db, 0x11dc, 0x11dd, 0x11de, 0x11df,
+ 0x11e0, 0x11e1, 0x11e2, 0x11e3, 0x11e4, 0x11e5, 0x11e6, 0x11e7,
+ 0x11e8, 0x11e9, 0x11ea, 0x11eb, 0x11ec, 0x11ed, 0x11ee, 0x11ef,
+ 0x11f0, 0x11f1, 0x11f2, 0x11f3, 0x11f4, 0x11f5, 0x11f6, 0x11f7,
+ 0x11f8, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1200, 0x1201, 0x1202, 0x1203, 0x1204, 0x1205, 0x1206, 0x1207,
+ 0x1208, 0x1209, 0x120a, 0x120b, 0x120c, 0x120d, 0x120e, 0x120f,
+ 0x1210, 0x1211, 0x1212, 0x1213, 0x1214, 0x1215, 0x1216, 0x1217,
+ 0x1218, 0x1219, 0x121a, 0x121b, 0x121c, 0x121d, 0x121e, 0x121f,
+ 0x1220, 0x1221, 0x1222, 0x1223, 0x1224, 0x1225, 0x1226, 0x1227,
+ 0x1228, 0x1229, 0x122a, 0x122b, 0x122c, 0x122d, 0x122e, 0x122f,
+ 0x1230, 0x1231, 0x1232, 0x1233, 0x1234, 0x1235, 0x1236, 0x1237,
+ 0x1238, 0x1239, 0x123a, 0x123b, 0x123c, 0x123d, 0x123e, 0x123f,
+ 0x1240, 0x1241, 0x1242, 0x1243, 0x1244, 0x1245, 0x1246, 0x1247,
+ 0x1248, 0x0000, 0x124a, 0x124b, 0x124c, 0x124d, 0x0000, 0x0000,
+ 0x1250, 0x1251, 0x1252, 0x1253, 0x1254, 0x1255, 0x1256, 0x0000,
+ 0x1258, 0x0000, 0x125a, 0x125b, 0x125c, 0x125d, 0x0000, 0x0000,
+ 0x1260, 0x1261, 0x1262, 0x1263, 0x1264, 0x1265, 0x1266, 0x1267,
+ 0x1268, 0x1269, 0x126a, 0x126b, 0x126c, 0x126d, 0x126e, 0x126f,
+ 0x1270, 0x1271, 0x1272, 0x1273, 0x1274, 0x1275, 0x1276, 0x1277,
+ 0x1278, 0x1279, 0x127a, 0x127b, 0x127c, 0x127d, 0x127e, 0x127f,
+ 0x1280, 0x1281, 0x1282, 0x1283, 0x1284, 0x1285, 0x1286, 0x1287,
+ 0x1288, 0x0000, 0x128a, 0x128b, 0x128c, 0x128d, 0x0000, 0x0000,
+ 0x1290, 0x1291, 0x1292, 0x1293, 0x1294, 0x1295, 0x1296, 0x1297,
+ 0x1298, 0x1299, 0x129a, 0x129b, 0x129c, 0x129d, 0x129e, 0x129f,
+ 0x12a0, 0x12a1, 0x12a2, 0x12a3, 0x12a4, 0x12a5, 0x12a6, 0x12a7,
+ 0x12a8, 0x12a9, 0x12aa, 0x12ab, 0x12ac, 0x12ad, 0x12ae, 0x12af,
+ 0x12b0, 0x0000, 0x12b2, 0x12b3, 0x12b4, 0x12b5, 0x0000, 0x0000,
+ 0x12b8, 0x12b9, 0x12ba, 0x12bb, 0x12bc, 0x12bd, 0x12be, 0x0000,
+ 0x12c0, 0x0000, 0x12c2, 0x12c3, 0x12c4, 0x12c5, 0x0000, 0x0000,
+ 0x12c8, 0x12c9, 0x12ca, 0x12cb, 0x12cc, 0x12cd, 0x12ce, 0x12cf,
+ 0x12d0, 0x12d1, 0x12d2, 0x12d3, 0x12d4, 0x12d5, 0x12d6, 0x0000,
+ 0x12d8, 0x12d9, 0x12da, 0x12db, 0x12dc, 0x12dd, 0x12de, 0x12df,
+ 0x12e0, 0x12e1, 0x12e2, 0x12e3, 0x12e4, 0x12e5, 0x12e6, 0x12e7,
+ 0x12e8, 0x12e9, 0x12ea, 0x12eb, 0x12ec, 0x12ed, 0x12ee, 0x12ef,
+ 0x12f0, 0x12f1, 0x12f2, 0x12f3, 0x12f4, 0x12f5, 0x12f6, 0x12f7,
+ 0x12f8, 0x12f9, 0x12fa, 0x12fb, 0x12fc, 0x12fd, 0x12fe, 0x12ff,
+ 0x1300, 0x1301, 0x1302, 0x1303, 0x1304, 0x1305, 0x1306, 0x1307,
+ 0x1308, 0x1309, 0x130a, 0x130b, 0x130c, 0x130d, 0x130e, 0x130f,
+ 0x1310, 0x0000, 0x1312, 0x1313, 0x1314, 0x1315, 0x0000, 0x0000,
+ 0x1318, 0x1319, 0x131a, 0x131b, 0x131c, 0x131d, 0x131e, 0x131f,
+ 0x1320, 0x1321, 0x1322, 0x1323, 0x1324, 0x1325, 0x1326, 0x1327,
+ 0x1328, 0x1329, 0x132a, 0x132b, 0x132c, 0x132d, 0x132e, 0x132f,
+ 0x1330, 0x1331, 0x1332, 0x1333, 0x1334, 0x1335, 0x1336, 0x1337,
+ 0x1338, 0x1339, 0x133a, 0x133b, 0x133c, 0x133d, 0x133e, 0x133f,
+ 0x1340, 0x1341, 0x1342, 0x1343, 0x1344, 0x1345, 0x1346, 0x1347,
+ 0x1348, 0x1349, 0x134a, 0x134b, 0x134c, 0x134d, 0x134e, 0x134f,
+ 0x1350, 0x1351, 0x1352, 0x1353, 0x1354, 0x1355, 0x1356, 0x1357,
+ 0x1358, 0x1359, 0x135a, 0x0000, 0x0000, 0x0000, 0x0000, 0x135f,
+ 0x1360, 0x1361, 0x1362, 0x1363, 0x1364, 0x1365, 0x1366, 0x1367,
+ 0x1368, 0x1369, 0x136a, 0x136b, 0x136c, 0x136d, 0x136e, 0x136f,
+ 0x1370, 0x1371, 0x1372, 0x1373, 0x1374, 0x1375, 0x1376, 0x1377,
+ 0x1378, 0x1379, 0x137a, 0x137b, 0x137c, 0x0000, 0x0000, 0x0000,
+ 0x1380, 0x1381, 0x1382, 0x1383, 0x1384, 0x1385, 0x1386, 0x1387,
+ 0x1388, 0x1389, 0x138a, 0x138b, 0x138c, 0x138d, 0x138e, 0x138f,
+ 0x1390, 0x1391, 0x1392, 0x1393, 0x1394, 0x1395, 0x1396, 0x1397,
+ 0x1398, 0x1399, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x13a0, 0x13a1, 0x13a2, 0x13a3, 0x13a4, 0x13a5, 0x13a6, 0x13a7,
+ 0x13a8, 0x13a9, 0x13aa, 0x13ab, 0x13ac, 0x13ad, 0x13ae, 0x13af,
+ 0x13b0, 0x13b1, 0x13b2, 0x13b3, 0x13b4, 0x13b5, 0x13b6, 0x13b7,
+ 0x13b8, 0x13b9, 0x13ba, 0x13bb, 0x13bc, 0x13bd, 0x13be, 0x13bf,
+ 0x13c0, 0x13c1, 0x13c2, 0x13c3, 0x13c4, 0x13c5, 0x13c6, 0x13c7,
+ 0x13c8, 0x13c9, 0x13ca, 0x13cb, 0x13cc, 0x13cd, 0x13ce, 0x13cf,
+ 0x13d0, 0x13d1, 0x13d2, 0x13d3, 0x13d4, 0x13d5, 0x13d6, 0x13d7,
+ 0x13d8, 0x13d9, 0x13da, 0x13db, 0x13dc, 0x13dd, 0x13de, 0x13df,
+ 0x13e0, 0x13e1, 0x13e2, 0x13e3, 0x13e4, 0x13e5, 0x13e6, 0x13e7,
+ 0x13e8, 0x13e9, 0x13ea, 0x13eb, 0x13ec, 0x13ed, 0x13ee, 0x13ef,
+ 0x13f0, 0x13f1, 0x13f2, 0x13f3, 0x13f4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x1401, 0x1402, 0x1403, 0x1404, 0x1405, 0x1406, 0x1407,
+ 0x1408, 0x1409, 0x140a, 0x140b, 0x140c, 0x140d, 0x140e, 0x140f,
+ 0x1410, 0x1411, 0x1412, 0x1413, 0x1414, 0x1415, 0x1416, 0x1417,
+ 0x1418, 0x1419, 0x141a, 0x141b, 0x141c, 0x141d, 0x141e, 0x141f,
+ 0x1420, 0x1421, 0x1422, 0x1423, 0x1424, 0x1425, 0x1426, 0x1427,
+ 0x1428, 0x1429, 0x142a, 0x142b, 0x142c, 0x142d, 0x142e, 0x142f,
+ 0x1430, 0x1431, 0x1432, 0x1433, 0x1434, 0x1435, 0x1436, 0x1437,
+ 0x1438, 0x1439, 0x143a, 0x143b, 0x143c, 0x143d, 0x143e, 0x143f,
+ 0x1440, 0x1441, 0x1442, 0x1443, 0x1444, 0x1445, 0x1446, 0x1447,
+ 0x1448, 0x1449, 0x144a, 0x144b, 0x144c, 0x144d, 0x144e, 0x144f,
+ 0x1450, 0x1451, 0x1452, 0x1453, 0x1454, 0x1455, 0x1456, 0x1457,
+ 0x1458, 0x1459, 0x145a, 0x145b, 0x145c, 0x145d, 0x145e, 0x145f,
+ 0x1460, 0x1461, 0x1462, 0x1463, 0x1464, 0x1465, 0x1466, 0x1467,
+ 0x1468, 0x1469, 0x146a, 0x146b, 0x146c, 0x146d, 0x146e, 0x146f,
+ 0x1470, 0x1471, 0x1472, 0x1473, 0x1474, 0x1475, 0x1476, 0x1477,
+ 0x1478, 0x1479, 0x147a, 0x147b, 0x147c, 0x147d, 0x147e, 0x147f,
+ 0x1480, 0x1481, 0x1482, 0x1483, 0x1484, 0x1485, 0x1486, 0x1487,
+ 0x1488, 0x1489, 0x148a, 0x148b, 0x148c, 0x148d, 0x148e, 0x148f,
+ 0x1490, 0x1491, 0x1492, 0x1493, 0x1494, 0x1495, 0x1496, 0x1497,
+ 0x1498, 0x1499, 0x149a, 0x149b, 0x149c, 0x149d, 0x149e, 0x149f,
+ 0x14a0, 0x14a1, 0x14a2, 0x14a3, 0x14a4, 0x14a5, 0x14a6, 0x14a7,
+ 0x14a8, 0x14a9, 0x14aa, 0x14ab, 0x14ac, 0x14ad, 0x14ae, 0x14af,
+ 0x14b0, 0x14b1, 0x14b2, 0x14b3, 0x14b4, 0x14b5, 0x14b6, 0x14b7,
+ 0x14b8, 0x14b9, 0x14ba, 0x14bb, 0x14bc, 0x14bd, 0x14be, 0x14bf,
+ 0x14c0, 0x14c1, 0x14c2, 0x14c3, 0x14c4, 0x14c5, 0x14c6, 0x14c7,
+ 0x14c8, 0x14c9, 0x14ca, 0x14cb, 0x14cc, 0x14cd, 0x14ce, 0x14cf,
+ 0x14d0, 0x14d1, 0x14d2, 0x14d3, 0x14d4, 0x14d5, 0x14d6, 0x14d7,
+ 0x14d8, 0x14d9, 0x14da, 0x14db, 0x14dc, 0x14dd, 0x14de, 0x14df,
+ 0x14e0, 0x14e1, 0x14e2, 0x14e3, 0x14e4, 0x14e5, 0x14e6, 0x14e7,
+ 0x14e8, 0x14e9, 0x14ea, 0x14eb, 0x14ec, 0x14ed, 0x14ee, 0x14ef,
+ 0x14f0, 0x14f1, 0x14f2, 0x14f3, 0x14f4, 0x14f5, 0x14f6, 0x14f7,
+ 0x14f8, 0x14f9, 0x14fa, 0x14fb, 0x14fc, 0x14fd, 0x14fe, 0x14ff,
+ 0x1500, 0x1501, 0x1502, 0x1503, 0x1504, 0x1505, 0x1506, 0x1507,
+ 0x1508, 0x1509, 0x150a, 0x150b, 0x150c, 0x150d, 0x150e, 0x150f,
+ 0x1510, 0x1511, 0x1512, 0x1513, 0x1514, 0x1515, 0x1516, 0x1517,
+ 0x1518, 0x1519, 0x151a, 0x151b, 0x151c, 0x151d, 0x151e, 0x151f,
+ 0x1520, 0x1521, 0x1522, 0x1523, 0x1524, 0x1525, 0x1526, 0x1527,
+ 0x1528, 0x1529, 0x152a, 0x152b, 0x152c, 0x152d, 0x152e, 0x152f,
+ 0x1530, 0x1531, 0x1532, 0x1533, 0x1534, 0x1535, 0x1536, 0x1537,
+ 0x1538, 0x1539, 0x153a, 0x153b, 0x153c, 0x153d, 0x153e, 0x153f,
+ 0x1540, 0x1541, 0x1542, 0x1543, 0x1544, 0x1545, 0x1546, 0x1547,
+ 0x1548, 0x1549, 0x154a, 0x154b, 0x154c, 0x154d, 0x154e, 0x154f,
+ 0x1550, 0x1551, 0x1552, 0x1553, 0x1554, 0x1555, 0x1556, 0x1557,
+ 0x1558, 0x1559, 0x155a, 0x155b, 0x155c, 0x155d, 0x155e, 0x155f,
+ 0x1560, 0x1561, 0x1562, 0x1563, 0x1564, 0x1565, 0x1566, 0x1567,
+ 0x1568, 0x1569, 0x156a, 0x156b, 0x156c, 0x156d, 0x156e, 0x156f,
+ 0x1570, 0x1571, 0x1572, 0x1573, 0x1574, 0x1575, 0x1576, 0x1577,
+ 0x1578, 0x1579, 0x157a, 0x157b, 0x157c, 0x157d, 0x157e, 0x157f,
+ 0x1580, 0x1581, 0x1582, 0x1583, 0x1584, 0x1585, 0x1586, 0x1587,
+ 0x1588, 0x1589, 0x158a, 0x158b, 0x158c, 0x158d, 0x158e, 0x158f,
+ 0x1590, 0x1591, 0x1592, 0x1593, 0x1594, 0x1595, 0x1596, 0x1597,
+ 0x1598, 0x1599, 0x159a, 0x159b, 0x159c, 0x159d, 0x159e, 0x159f,
+ 0x15a0, 0x15a1, 0x15a2, 0x15a3, 0x15a4, 0x15a5, 0x15a6, 0x15a7,
+ 0x15a8, 0x15a9, 0x15aa, 0x15ab, 0x15ac, 0x15ad, 0x15ae, 0x15af,
+ 0x15b0, 0x15b1, 0x15b2, 0x15b3, 0x15b4, 0x15b5, 0x15b6, 0x15b7,
+ 0x15b8, 0x15b9, 0x15ba, 0x15bb, 0x15bc, 0x15bd, 0x15be, 0x15bf,
+ 0x15c0, 0x15c1, 0x15c2, 0x15c3, 0x15c4, 0x15c5, 0x15c6, 0x15c7,
+ 0x15c8, 0x15c9, 0x15ca, 0x15cb, 0x15cc, 0x15cd, 0x15ce, 0x15cf,
+ 0x15d0, 0x15d1, 0x15d2, 0x15d3, 0x15d4, 0x15d5, 0x15d6, 0x15d7,
+ 0x15d8, 0x15d9, 0x15da, 0x15db, 0x15dc, 0x15dd, 0x15de, 0x15df,
+ 0x15e0, 0x15e1, 0x15e2, 0x15e3, 0x15e4, 0x15e5, 0x15e6, 0x15e7,
+ 0x15e8, 0x15e9, 0x15ea, 0x15eb, 0x15ec, 0x15ed, 0x15ee, 0x15ef,
+ 0x15f0, 0x15f1, 0x15f2, 0x15f3, 0x15f4, 0x15f5, 0x15f6, 0x15f7,
+ 0x15f8, 0x15f9, 0x15fa, 0x15fb, 0x15fc, 0x15fd, 0x15fe, 0x15ff,
+ 0x1600, 0x1601, 0x1602, 0x1603, 0x1604, 0x1605, 0x1606, 0x1607,
+ 0x1608, 0x1609, 0x160a, 0x160b, 0x160c, 0x160d, 0x160e, 0x160f,
+ 0x1610, 0x1611, 0x1612, 0x1613, 0x1614, 0x1615, 0x1616, 0x1617,
+ 0x1618, 0x1619, 0x161a, 0x161b, 0x161c, 0x161d, 0x161e, 0x161f,
+ 0x1620, 0x1621, 0x1622, 0x1623, 0x1624, 0x1625, 0x1626, 0x1627,
+ 0x1628, 0x1629, 0x162a, 0x162b, 0x162c, 0x162d, 0x162e, 0x162f,
+ 0x1630, 0x1631, 0x1632, 0x1633, 0x1634, 0x1635, 0x1636, 0x1637,
+ 0x1638, 0x1639, 0x163a, 0x163b, 0x163c, 0x163d, 0x163e, 0x163f,
+ 0x1640, 0x1641, 0x1642, 0x1643, 0x1644, 0x1645, 0x1646, 0x1647,
+ 0x1648, 0x1649, 0x164a, 0x164b, 0x164c, 0x164d, 0x164e, 0x164f,
+ 0x1650, 0x1651, 0x1652, 0x1653, 0x1654, 0x1655, 0x1656, 0x1657,
+ 0x1658, 0x1659, 0x165a, 0x165b, 0x165c, 0x165d, 0x165e, 0x165f,
+ 0x1660, 0x1661, 0x1662, 0x1663, 0x1664, 0x1665, 0x1666, 0x1667,
+ 0x1668, 0x1669, 0x166a, 0x166b, 0x166c, 0x166d, 0x166e, 0x166f,
+ 0x1670, 0x1671, 0x1672, 0x1673, 0x1674, 0x1675, 0x1676, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1680, 0x1681, 0x1682, 0x1683, 0x1684, 0x1685, 0x1686, 0x1687,
+ 0x1688, 0x1689, 0x168a, 0x168b, 0x168c, 0x168d, 0x168e, 0x168f,
+ 0x1690, 0x1691, 0x1692, 0x1693, 0x1694, 0x1695, 0x1696, 0x1697,
+ 0x1698, 0x1699, 0x169a, 0x169b, 0x169c, 0x0000, 0x0000, 0x0000,
+ 0x16a0, 0x16a1, 0x16a2, 0x16a3, 0x16a4, 0x16a5, 0x16a6, 0x16a7,
+ 0x16a8, 0x16a9, 0x16aa, 0x16ab, 0x16ac, 0x16ad, 0x16ae, 0x16af,
+ 0x16b0, 0x16b1, 0x16b2, 0x16b3, 0x16b4, 0x16b5, 0x16b6, 0x16b7,
+ 0x16b8, 0x16b9, 0x16ba, 0x16bb, 0x16bc, 0x16bd, 0x16be, 0x16bf,
+ 0x16c0, 0x16c1, 0x16c2, 0x16c3, 0x16c4, 0x16c5, 0x16c6, 0x16c7,
+ 0x16c8, 0x16c9, 0x16ca, 0x16cb, 0x16cc, 0x16cd, 0x16ce, 0x16cf,
+ 0x16d0, 0x16d1, 0x16d2, 0x16d3, 0x16d4, 0x16d5, 0x16d6, 0x16d7,
+ 0x16d8, 0x16d9, 0x16da, 0x16db, 0x16dc, 0x16dd, 0x16de, 0x16df,
+ 0x16e0, 0x16e1, 0x16e2, 0x16e3, 0x16e4, 0x16e5, 0x16e6, 0x16e7,
+ 0x16e8, 0x16e9, 0x16ea, 0x16eb, 0x16ec, 0x16ed, 0x16ee, 0x16ef,
+ 0x16f0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1700, 0x1701, 0x1702, 0x1703, 0x1704, 0x1705, 0x1706, 0x1707,
+ 0x1708, 0x1709, 0x170a, 0x170b, 0x170c, 0x0000, 0x170e, 0x170f,
+ 0x1710, 0x1711, 0x1712, 0x1713, 0x1714, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1720, 0x1721, 0x1722, 0x1723, 0x1724, 0x1725, 0x1726, 0x1727,
+ 0x1728, 0x1729, 0x172a, 0x172b, 0x172c, 0x172d, 0x172e, 0x172f,
+ 0x1730, 0x1731, 0x1732, 0x1733, 0x1734, 0x1735, 0x1736, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1740, 0x1741, 0x1742, 0x1743, 0x1744, 0x1745, 0x1746, 0x1747,
+ 0x1748, 0x1749, 0x174a, 0x174b, 0x174c, 0x174d, 0x174e, 0x174f,
+ 0x1750, 0x1751, 0x1752, 0x1753, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1760, 0x1761, 0x1762, 0x1763, 0x1764, 0x1765, 0x1766, 0x1767,
+ 0x1768, 0x1769, 0x176a, 0x176b, 0x176c, 0x0000, 0x176e, 0x176f,
+ 0x1770, 0x0000, 0x1772, 0x1773, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1780, 0x1781, 0x1782, 0x1783, 0x1784, 0x1785, 0x1786, 0x1787,
+ 0x1788, 0x1789, 0x178a, 0x178b, 0x178c, 0x178d, 0x178e, 0x178f,
+ 0x1790, 0x1791, 0x1792, 0x1793, 0x1794, 0x1795, 0x1796, 0x1797,
+ 0x1798, 0x1799, 0x179a, 0x179b, 0x179c, 0x179d, 0x179e, 0x179f,
+ 0x17a0, 0x17a1, 0x17a2, 0x17a3, 0x17a4, 0x17a5, 0x17a6, 0x17a7,
+ 0x17a8, 0x17a9, 0x17aa, 0x17ab, 0x17ac, 0x17ad, 0x17ae, 0x17af,
+ 0x17b0, 0x17b1, 0x17b2, 0x17b3, 0x17b4, 0x17b5, 0x17b6, 0x17b7,
+ 0x17b8, 0x17b9, 0x17ba, 0x17bb, 0x17bc, 0x17bd, 0x17be, 0x17bf,
+ 0x17c0, 0x17c1, 0x17c2, 0x17c3, 0x17c4, 0x17c5, 0x17c6, 0x17c7,
+ 0x17c8, 0x17c9, 0x17ca, 0x17cb, 0x17cc, 0x17cd, 0x17ce, 0x17cf,
+ 0x17d0, 0x17d1, 0x17d2, 0x17d3, 0x17d4, 0x17d5, 0x17d6, 0x17d7,
+ 0x17d8, 0x17d9, 0x17da, 0x17db, 0x17dc, 0x17dd, 0x0000, 0x0000,
+ 0x17e0, 0x17e1, 0x17e2, 0x17e3, 0x17e4, 0x17e5, 0x17e6, 0x17e7,
+ 0x17e8, 0x17e9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x17f0, 0x17f1, 0x17f2, 0x17f3, 0x17f4, 0x17f5, 0x17f6, 0x17f7,
+ 0x17f8, 0x17f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1800, 0x1801, 0x1802, 0x1803, 0x1804, 0x1805, 0x1806, 0x1807,
+ 0x1808, 0x1809, 0x180a, 0x180b, 0x180c, 0x180d, 0x180e, 0x0000,
+ 0x1810, 0x1811, 0x1812, 0x1813, 0x1814, 0x1815, 0x1816, 0x1817,
+ 0x1818, 0x1819, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827,
+ 0x1828, 0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f,
+ 0x1830, 0x1831, 0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837,
+ 0x1838, 0x1839, 0x183a, 0x183b, 0x183c, 0x183d, 0x183e, 0x183f,
+ 0x1840, 0x1841, 0x1842, 0x1843, 0x1844, 0x1845, 0x1846, 0x1847,
+ 0x1848, 0x1849, 0x184a, 0x184b, 0x184c, 0x184d, 0x184e, 0x184f,
+ 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855, 0x1856, 0x1857,
+ 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e, 0x185f,
+ 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867,
+ 0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f,
+ 0x1870, 0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1880, 0x1881, 0x1882, 0x1883, 0x1884, 0x1885, 0x1886, 0x1887,
+ 0x1888, 0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f,
+ 0x1890, 0x1891, 0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897,
+ 0x1898, 0x1899, 0x189a, 0x189b, 0x189c, 0x189d, 0x189e, 0x189f,
+ 0x18a0, 0x18a1, 0x18a2, 0x18a3, 0x18a4, 0x18a5, 0x18a6, 0x18a7,
+ 0x18a8, 0x18a9, 0x18aa, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1900, 0x1901, 0x1902, 0x1903, 0x1904, 0x1905, 0x1906, 0x1907,
+ 0x1908, 0x1909, 0x190a, 0x190b, 0x190c, 0x190d, 0x190e, 0x190f,
+ 0x1910, 0x1911, 0x1912, 0x1913, 0x1914, 0x1915, 0x1916, 0x1917,
+ 0x1918, 0x1919, 0x191a, 0x191b, 0x191c, 0x0000, 0x0000, 0x0000,
+ 0x1920, 0x1921, 0x1922, 0x1923, 0x1924, 0x1925, 0x1926, 0x1927,
+ 0x1928, 0x1929, 0x192a, 0x192b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1930, 0x1931, 0x1932, 0x1933, 0x1934, 0x1935, 0x1936, 0x1937,
+ 0x1938, 0x1939, 0x193a, 0x193b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1940, 0x0000, 0x0000, 0x0000, 0x1944, 0x1945, 0x1946, 0x1947,
+ 0x1948, 0x1949, 0x194a, 0x194b, 0x194c, 0x194d, 0x194e, 0x194f,
+ 0x1950, 0x1951, 0x1952, 0x1953, 0x1954, 0x1955, 0x1956, 0x1957,
+ 0x1958, 0x1959, 0x195a, 0x195b, 0x195c, 0x195d, 0x195e, 0x195f,
+ 0x1960, 0x1961, 0x1962, 0x1963, 0x1964, 0x1965, 0x1966, 0x1967,
+ 0x1968, 0x1969, 0x196a, 0x196b, 0x196c, 0x196d, 0x0000, 0x0000,
+ 0x1970, 0x1971, 0x1972, 0x1973, 0x1974, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1980, 0x1981, 0x1982, 0x1983, 0x1984, 0x1985, 0x1986, 0x1987,
+ 0x1988, 0x1989, 0x198a, 0x198b, 0x198c, 0x198d, 0x198e, 0x198f,
+ 0x1990, 0x1991, 0x1992, 0x1993, 0x1994, 0x1995, 0x1996, 0x1997,
+ 0x1998, 0x1999, 0x199a, 0x199b, 0x199c, 0x199d, 0x199e, 0x199f,
+ 0x19a0, 0x19a1, 0x19a2, 0x19a3, 0x19a4, 0x19a5, 0x19a6, 0x19a7,
+ 0x19a8, 0x19a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x19b0, 0x19b1, 0x19b2, 0x19b3, 0x19b4, 0x19b5, 0x19b6, 0x19b7,
+ 0x19b8, 0x19b9, 0x19ba, 0x19bb, 0x19bc, 0x19bd, 0x19be, 0x19bf,
+ 0x19c0, 0x19c1, 0x19c2, 0x19c3, 0x19c4, 0x19c5, 0x19c6, 0x19c7,
+ 0x19c8, 0x19c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x19d0, 0x19d1, 0x19d2, 0x19d3, 0x19d4, 0x19d5, 0x19d6, 0x19d7,
+ 0x19d8, 0x19d9, 0x0000, 0x0000, 0x0000, 0x0000, 0x19de, 0x19df,
+ 0x19e0, 0x19e1, 0x19e2, 0x19e3, 0x19e4, 0x19e5, 0x19e6, 0x19e7,
+ 0x19e8, 0x19e9, 0x19ea, 0x19eb, 0x19ec, 0x19ed, 0x19ee, 0x19ef,
+ 0x19f0, 0x19f1, 0x19f2, 0x19f3, 0x19f4, 0x19f5, 0x19f6, 0x19f7,
+ 0x19f8, 0x19f9, 0x19fa, 0x19fb, 0x19fc, 0x19fd, 0x19fe, 0x19ff,
+ 0x1a00, 0x1a01, 0x1a02, 0x1a03, 0x1a04, 0x1a05, 0x1a06, 0x1a07,
+ 0x1a08, 0x1a09, 0x1a0a, 0x1a0b, 0x1a0c, 0x1a0d, 0x1a0e, 0x1a0f,
+ 0x1a10, 0x1a11, 0x1a12, 0x1a13, 0x1a14, 0x1a15, 0x1a16, 0x1a17,
+ 0x1a18, 0x1a19, 0x1a1a, 0x1a1b, 0x0000, 0x0000, 0x1a1e, 0x1a1f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1b00, 0x1b01, 0x1b02, 0x1b03, 0x1b04, 0x1b05, 0x1b06, 0x1b07,
+ 0x1b08, 0x1b09, 0x1b0a, 0x1b0b, 0x1b0c, 0x1b0d, 0x1b0e, 0x1b0f,
+ 0x1b10, 0x1b11, 0x1b12, 0x1b13, 0x1b14, 0x1b15, 0x1b16, 0x1b17,
+ 0x1b18, 0x1b19, 0x1b1a, 0x1b1b, 0x1b1c, 0x1b1d, 0x1b1e, 0x1b1f,
+ 0x1b20, 0x1b21, 0x1b22, 0x1b23, 0x1b24, 0x1b25, 0x1b26, 0x1b27,
+ 0x1b28, 0x1b29, 0x1b2a, 0x1b2b, 0x1b2c, 0x1b2d, 0x1b2e, 0x1b2f,
+ 0x1b30, 0x1b31, 0x1b32, 0x1b33, 0x1b34, 0x1b35, 0x1b36, 0x1b37,
+ 0x1b38, 0x1b39, 0x1b3a, 0x1b3b, 0x1b3c, 0x1b3d, 0x1b3e, 0x1b3f,
+ 0x1b40, 0x1b41, 0x1b42, 0x1b43, 0x1b44, 0x1b45, 0x1b46, 0x1b47,
+ 0x1b48, 0x1b49, 0x1b4a, 0x1b4b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1b50, 0x1b51, 0x1b52, 0x1b53, 0x1b54, 0x1b55, 0x1b56, 0x1b57,
+ 0x1b58, 0x1b59, 0x1b5a, 0x1b5b, 0x1b5c, 0x1b5d, 0x1b5e, 0x1b5f,
+ 0x1b60, 0x1b61, 0x1b62, 0x1b63, 0x1b64, 0x1b65, 0x1b66, 0x1b67,
+ 0x1b68, 0x1b69, 0x1b6a, 0x1b6b, 0x1b6c, 0x1b6d, 0x1b6e, 0x1b6f,
+ 0x1b70, 0x1b71, 0x1b72, 0x1b73, 0x1b74, 0x1b75, 0x1b76, 0x1b77,
+ 0x1b78, 0x1b79, 0x1b7a, 0x1b7b, 0x1b7c, 0x0000, 0x0000, 0x0000,
+ 0x1b80, 0x1b81, 0x1b82, 0x1b83, 0x1b84, 0x1b85, 0x1b86, 0x1b87,
+ 0x1b88, 0x1b89, 0x1b8a, 0x1b8b, 0x1b8c, 0x1b8d, 0x1b8e, 0x1b8f,
+ 0x1b90, 0x1b91, 0x1b92, 0x1b93, 0x1b94, 0x1b95, 0x1b96, 0x1b97,
+ 0x1b98, 0x1b99, 0x1b9a, 0x1b9b, 0x1b9c, 0x1b9d, 0x1b9e, 0x1b9f,
+ 0x1ba0, 0x1ba1, 0x1ba2, 0x1ba3, 0x1ba4, 0x1ba5, 0x1ba6, 0x1ba7,
+ 0x1ba8, 0x1ba9, 0x1baa, 0x0000, 0x0000, 0x0000, 0x1bae, 0x1baf,
+ 0x1bb0, 0x1bb1, 0x1bb2, 0x1bb3, 0x1bb4, 0x1bb5, 0x1bb6, 0x1bb7,
+ 0x1bb8, 0x1bb9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1c00, 0x1c01, 0x1c02, 0x1c03, 0x1c04, 0x1c05, 0x1c06, 0x1c07,
+ 0x1c08, 0x1c09, 0x1c0a, 0x1c0b, 0x1c0c, 0x1c0d, 0x1c0e, 0x1c0f,
+ 0x1c10, 0x1c11, 0x1c12, 0x1c13, 0x1c14, 0x1c15, 0x1c16, 0x1c17,
+ 0x1c18, 0x1c19, 0x1c1a, 0x1c1b, 0x1c1c, 0x1c1d, 0x1c1e, 0x1c1f,
+ 0x1c20, 0x1c21, 0x1c22, 0x1c23, 0x1c24, 0x1c25, 0x1c26, 0x1c27,
+ 0x1c28, 0x1c29, 0x1c2a, 0x1c2b, 0x1c2c, 0x1c2d, 0x1c2e, 0x1c2f,
+ 0x1c30, 0x1c31, 0x1c32, 0x1c33, 0x1c34, 0x1c35, 0x1c36, 0x1c37,
+ 0x0000, 0x0000, 0x0000, 0x1c3b, 0x1c3c, 0x1c3d, 0x1c3e, 0x1c3f,
+ 0x1c40, 0x1c41, 0x1c42, 0x1c43, 0x1c44, 0x1c45, 0x1c46, 0x1c47,
+ 0x1c48, 0x1c49, 0x0000, 0x0000, 0x0000, 0x1c4d, 0x1c4e, 0x1c4f,
+ 0x1c50, 0x1c51, 0x1c52, 0x1c53, 0x1c54, 0x1c55, 0x1c56, 0x1c57,
+ 0x1c58, 0x1c59, 0x1c5a, 0x1c5b, 0x1c5c, 0x1c5d, 0x1c5e, 0x1c5f,
+ 0x1c60, 0x1c61, 0x1c62, 0x1c63, 0x1c64, 0x1c65, 0x1c66, 0x1c67,
+ 0x1c68, 0x1c69, 0x1c6a, 0x1c6b, 0x1c6c, 0x1c6d, 0x1c6e, 0x1c6f,
+ 0x1c70, 0x1c71, 0x1c72, 0x1c73, 0x1c74, 0x1c75, 0x1c76, 0x1c77,
+ 0x1c78, 0x1c79, 0x1c7a, 0x1c7b, 0x1c7c, 0x1c7d, 0x1c7e, 0x1c7f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x1d00, 0x1d01, 0x1d02, 0x1d03, 0x1d04, 0x1d05, 0x1d06, 0x1d07,
+ 0x1d08, 0x1d09, 0x1d0a, 0x1d0b, 0x1d0c, 0x1d0d, 0x1d0e, 0x1d0f,
+ 0x1d10, 0x1d11, 0x1d12, 0x1d13, 0x1d14, 0x1d15, 0x1d16, 0x1d17,
+ 0x1d18, 0x1d19, 0x1d1a, 0x1d1b, 0x1d1c, 0x1d1d, 0x1d1e, 0x1d1f,
+ 0x1d20, 0x1d21, 0x1d22, 0x1d23, 0x1d24, 0x1d25, 0x1d26, 0x1d27,
+ 0x1d28, 0x1d29, 0x1d2a, 0x1d2b, 0x1d2c, 0x1d2d, 0x1d2e, 0x1d2f,
+ 0x1d30, 0x1d31, 0x1d32, 0x1d33, 0x1d34, 0x1d35, 0x1d36, 0x1d37,
+ 0x1d38, 0x1d39, 0x1d3a, 0x1d3b, 0x1d3c, 0x1d3d, 0x1d3e, 0x1d3f,
+ 0x1d40, 0x1d41, 0x1d42, 0x1d43, 0x1d44, 0x1d45, 0x1d46, 0x1d47,
+ 0x1d48, 0x1d49, 0x1d4a, 0x1d4b, 0x1d4c, 0x1d4d, 0x1d4e, 0x1d4f,
+ 0x1d50, 0x1d51, 0x1d52, 0x1d53, 0x1d54, 0x1d55, 0x1d56, 0x1d57,
+ 0x1d58, 0x1d59, 0x1d5a, 0x1d5b, 0x1d5c, 0x1d5d, 0x1d5e, 0x1d5f,
+ 0x1d60, 0x1d61, 0x1d62, 0x1d63, 0x1d64, 0x1d65, 0x1d66, 0x1d67,
+ 0x1d68, 0x1d69, 0x1d6a, 0x1d6b, 0x1d6c, 0x1d6d, 0x1d6e, 0x1d6f,
+ 0x1d70, 0x1d71, 0x1d72, 0x1d73, 0x1d74, 0x1d75, 0x1d76, 0x1d77,
+ 0x1d78, 0xa77d, 0x1d7a, 0x1d7b, 0x1d7c, 0x2c63, 0x1d7e, 0x1d7f,
+ 0x1d80, 0x1d81, 0x1d82, 0x1d83, 0x1d84, 0x1d85, 0x1d86, 0x1d87,
+ 0x1d88, 0x1d89, 0x1d8a, 0x1d8b, 0x1d8c, 0x1d8d, 0x1d8e, 0x1d8f,
+ 0x1d90, 0x1d91, 0x1d92, 0x1d93, 0x1d94, 0x1d95, 0x1d96, 0x1d97,
+ 0x1d98, 0x1d99, 0x1d9a, 0x1d9b, 0x1d9c, 0x1d9d, 0x1d9e, 0x1d9f,
+ 0x1da0, 0x1da1, 0x1da2, 0x1da3, 0x1da4, 0x1da5, 0x1da6, 0x1da7,
+ 0x1da8, 0x1da9, 0x1daa, 0x1dab, 0x1dac, 0x1dad, 0x1dae, 0x1daf,
+ 0x1db0, 0x1db1, 0x1db2, 0x1db3, 0x1db4, 0x1db5, 0x1db6, 0x1db7,
+ 0x1db8, 0x1db9, 0x1dba, 0x1dbb, 0x1dbc, 0x1dbd, 0x1dbe, 0x1dbf,
+ 0x1dc0, 0x1dc1, 0x1dc2, 0x1dc3, 0x1dc4, 0x1dc5, 0x1dc6, 0x1dc7,
+ 0x1dc8, 0x1dc9, 0x1dca, 0x1dcb, 0x1dcc, 0x1dcd, 0x1dce, 0x1dcf,
+ 0x1dd0, 0x1dd1, 0x1dd2, 0x1dd3, 0x1dd4, 0x1dd5, 0x1dd6, 0x1dd7,
+ 0x1dd8, 0x1dd9, 0x1dda, 0x1ddb, 0x1ddc, 0x1ddd, 0x1dde, 0x1ddf,
+ 0x1de0, 0x1de1, 0x1de2, 0x1de3, 0x1de4, 0x1de5, 0x1de6, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1dfe, 0x1dff,
+ 0x1e00, 0x1e00, 0x1e02, 0x1e02, 0x1e04, 0x1e04, 0x1e06, 0x1e06,
+ 0x1e08, 0x1e08, 0x1e0a, 0x1e0a, 0x1e0c, 0x1e0c, 0x1e0e, 0x1e0e,
+ 0x1e10, 0x1e10, 0x1e12, 0x1e12, 0x1e14, 0x1e14, 0x1e16, 0x1e16,
+ 0x1e18, 0x1e18, 0x1e1a, 0x1e1a, 0x1e1c, 0x1e1c, 0x1e1e, 0x1e1e,
+ 0x1e20, 0x1e20, 0x1e22, 0x1e22, 0x1e24, 0x1e24, 0x1e26, 0x1e26,
+ 0x1e28, 0x1e28, 0x1e2a, 0x1e2a, 0x1e2c, 0x1e2c, 0x1e2e, 0x1e2e,
+ 0x1e30, 0x1e30, 0x1e32, 0x1e32, 0x1e34, 0x1e34, 0x1e36, 0x1e36,
+ 0x1e38, 0x1e38, 0x1e3a, 0x1e3a, 0x1e3c, 0x1e3c, 0x1e3e, 0x1e3e,
+ 0x1e40, 0x1e40, 0x1e42, 0x1e42, 0x1e44, 0x1e44, 0x1e46, 0x1e46,
+ 0x1e48, 0x1e48, 0x1e4a, 0x1e4a, 0x1e4c, 0x1e4c, 0x1e4e, 0x1e4e,
+ 0x1e50, 0x1e50, 0x1e52, 0x1e52, 0x1e54, 0x1e54, 0x1e56, 0x1e56,
+ 0x1e58, 0x1e58, 0x1e5a, 0x1e5a, 0x1e5c, 0x1e5c, 0x1e5e, 0x1e5e,
+ 0x1e60, 0x1e60, 0x1e62, 0x1e62, 0x1e64, 0x1e64, 0x1e66, 0x1e66,
+ 0x1e68, 0x1e68, 0x1e6a, 0x1e6a, 0x1e6c, 0x1e6c, 0x1e6e, 0x1e6e,
+ 0x1e70, 0x1e70, 0x1e72, 0x1e72, 0x1e74, 0x1e74, 0x1e76, 0x1e76,
+ 0x1e78, 0x1e78, 0x1e7a, 0x1e7a, 0x1e7c, 0x1e7c, 0x1e7e, 0x1e7e,
+ 0x1e80, 0x1e80, 0x1e82, 0x1e82, 0x1e84, 0x1e84, 0x1e86, 0x1e86,
+ 0x1e88, 0x1e88, 0x1e8a, 0x1e8a, 0x1e8c, 0x1e8c, 0x1e8e, 0x1e8e,
+ 0x1e90, 0x1e90, 0x1e92, 0x1e92, 0x1e94, 0x1e94, 0x1e96, 0x1e97,
+ 0x1e98, 0x1e99, 0x1e9a, 0x1e60, 0x1e9c, 0x1e9d, 0x1e9e, 0x1e9f,
+ 0x1ea0, 0x1ea0, 0x1ea2, 0x1ea2, 0x1ea4, 0x1ea4, 0x1ea6, 0x1ea6,
+ 0x1ea8, 0x1ea8, 0x1eaa, 0x1eaa, 0x1eac, 0x1eac, 0x1eae, 0x1eae,
+ 0x1eb0, 0x1eb0, 0x1eb2, 0x1eb2, 0x1eb4, 0x1eb4, 0x1eb6, 0x1eb6,
+ 0x1eb8, 0x1eb8, 0x1eba, 0x1eba, 0x1ebc, 0x1ebc, 0x1ebe, 0x1ebe,
+ 0x1ec0, 0x1ec0, 0x1ec2, 0x1ec2, 0x1ec4, 0x1ec4, 0x1ec6, 0x1ec6,
+ 0x1ec8, 0x1ec8, 0x1eca, 0x1eca, 0x1ecc, 0x1ecc, 0x1ece, 0x1ece,
+ 0x1ed0, 0x1ed0, 0x1ed2, 0x1ed2, 0x1ed4, 0x1ed4, 0x1ed6, 0x1ed6,
+ 0x1ed8, 0x1ed8, 0x1eda, 0x1eda, 0x1edc, 0x1edc, 0x1ede, 0x1ede,
+ 0x1ee0, 0x1ee0, 0x1ee2, 0x1ee2, 0x1ee4, 0x1ee4, 0x1ee6, 0x1ee6,
+ 0x1ee8, 0x1ee8, 0x1eea, 0x1eea, 0x1eec, 0x1eec, 0x1eee, 0x1eee,
+ 0x1ef0, 0x1ef0, 0x1ef2, 0x1ef2, 0x1ef4, 0x1ef4, 0x1ef6, 0x1ef6,
+ 0x1ef8, 0x1ef8, 0x1efa, 0x1efa, 0x1efc, 0x1efc, 0x1efe, 0x1efe,
+ 0x1f08, 0x1f09, 0x1f0a, 0x1f0b, 0x1f0c, 0x1f0d, 0x1f0e, 0x1f0f,
+ 0x1f08, 0x1f09, 0x1f0a, 0x1f0b, 0x1f0c, 0x1f0d, 0x1f0e, 0x1f0f,
+ 0x1f18, 0x1f19, 0x1f1a, 0x1f1b, 0x1f1c, 0x1f1d, 0x0000, 0x0000,
+ 0x1f18, 0x1f19, 0x1f1a, 0x1f1b, 0x1f1c, 0x1f1d, 0x0000, 0x0000,
+ 0x1f28, 0x1f29, 0x1f2a, 0x1f2b, 0x1f2c, 0x1f2d, 0x1f2e, 0x1f2f,
+ 0x1f28, 0x1f29, 0x1f2a, 0x1f2b, 0x1f2c, 0x1f2d, 0x1f2e, 0x1f2f,
+ 0x1f38, 0x1f39, 0x1f3a, 0x1f3b, 0x1f3c, 0x1f3d, 0x1f3e, 0x1f3f,
+ 0x1f38, 0x1f39, 0x1f3a, 0x1f3b, 0x1f3c, 0x1f3d, 0x1f3e, 0x1f3f,
+ 0x1f48, 0x1f49, 0x1f4a, 0x1f4b, 0x1f4c, 0x1f4d, 0x0000, 0x0000,
+ 0x1f48, 0x1f49, 0x1f4a, 0x1f4b, 0x1f4c, 0x1f4d, 0x0000, 0x0000,
+ 0x1f50, 0x1f59, 0x1f52, 0x1f5b, 0x1f54, 0x1f5d, 0x1f56, 0x1f5f,
+ 0x0000, 0x1f59, 0x0000, 0x1f5b, 0x0000, 0x1f5d, 0x0000, 0x1f5f,
+ 0x1f68, 0x1f69, 0x1f6a, 0x1f6b, 0x1f6c, 0x1f6d, 0x1f6e, 0x1f6f,
+ 0x1f68, 0x1f69, 0x1f6a, 0x1f6b, 0x1f6c, 0x1f6d, 0x1f6e, 0x1f6f,
+ 0x1fba, 0x1fbb, 0x1fc8, 0x1fc9, 0x1fca, 0x1fcb, 0x1fda, 0x1fdb,
+ 0x1ff8, 0x1ff9, 0x1fea, 0x1feb, 0x1ffa, 0x1ffb, 0x0000, 0x0000,
+ 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f,
+ 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f,
+ 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f,
+ 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f,
+ 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf,
+ 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf,
+ 0x1fb8, 0x1fb9, 0x1fb2, 0x1fbc, 0x1fb4, 0x0000, 0x1fb6, 0x1fb7,
+ 0x1fb8, 0x1fb9, 0x1fba, 0x1fbb, 0x1fbc, 0x1fbd, 0x0399, 0x1fbf,
+ 0x1fc0, 0x1fc1, 0x1fc2, 0x1fcc, 0x1fc4, 0x0000, 0x1fc6, 0x1fc7,
+ 0x1fc8, 0x1fc9, 0x1fca, 0x1fcb, 0x1fcc, 0x1fcd, 0x1fce, 0x1fcf,
+ 0x1fd8, 0x1fd9, 0x1fd2, 0x1fd3, 0x0000, 0x0000, 0x1fd6, 0x1fd7,
+ 0x1fd8, 0x1fd9, 0x1fda, 0x1fdb, 0x0000, 0x1fdd, 0x1fde, 0x1fdf,
+ 0x1fe8, 0x1fe9, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fec, 0x1fe6, 0x1fe7,
+ 0x1fe8, 0x1fe9, 0x1fea, 0x1feb, 0x1fec, 0x1fed, 0x1fee, 0x1fef,
+ 0x0000, 0x0000, 0x1ff2, 0x1ffc, 0x1ff4, 0x0000, 0x1ff6, 0x1ff7,
+ 0x1ff8, 0x1ff9, 0x1ffa, 0x1ffb, 0x1ffc, 0x1ffd, 0x1ffe, 0x0000,
+ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007,
+ 0x2008, 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x200e, 0x200f,
+ 0x2010, 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017,
+ 0x2018, 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f,
+ 0x2020, 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027,
+ 0x2028, 0x2029, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0x202f,
+ 0x2030, 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037,
+ 0x2038, 0x2039, 0x203a, 0x203b, 0x203c, 0x203d, 0x203e, 0x203f,
+ 0x2040, 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047,
+ 0x2048, 0x2049, 0x204a, 0x204b, 0x204c, 0x204d, 0x204e, 0x204f,
+ 0x2050, 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057,
+ 0x2058, 0x2059, 0x205a, 0x205b, 0x205c, 0x205d, 0x205e, 0x205f,
+ 0x2060, 0x2061, 0x2062, 0x2063, 0x2064, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f,
+ 0x2070, 0x2071, 0x0000, 0x0000, 0x2074, 0x2075, 0x2076, 0x2077,
+ 0x2078, 0x2079, 0x207a, 0x207b, 0x207c, 0x207d, 0x207e, 0x207f,
+ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087,
+ 0x2088, 0x2089, 0x208a, 0x208b, 0x208c, 0x208d, 0x208e, 0x0000,
+ 0x2090, 0x2091, 0x2092, 0x2093, 0x2094, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x20a0, 0x20a1, 0x20a2, 0x20a3, 0x20a4, 0x20a5, 0x20a6, 0x20a7,
+ 0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac, 0x20ad, 0x20ae, 0x20af,
+ 0x20b0, 0x20b1, 0x20b2, 0x20b3, 0x20b4, 0x20b5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x20d0, 0x20d1, 0x20d2, 0x20d3, 0x20d4, 0x20d5, 0x20d6, 0x20d7,
+ 0x20d8, 0x20d9, 0x20da, 0x20db, 0x20dc, 0x20dd, 0x20de, 0x20df,
+ 0x20e0, 0x20e1, 0x20e2, 0x20e3, 0x20e4, 0x20e5, 0x20e6, 0x20e7,
+ 0x20e8, 0x20e9, 0x20ea, 0x20eb, 0x20ec, 0x20ed, 0x20ee, 0x20ef,
+ 0x20f0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107,
+ 0x2108, 0x2109, 0x210a, 0x210b, 0x210c, 0x210d, 0x210e, 0x210f,
+ 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117,
+ 0x2118, 0x2119, 0x211a, 0x211b, 0x211c, 0x211d, 0x211e, 0x211f,
+ 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x2126, 0x2127,
+ 0x2128, 0x2129, 0x212a, 0x212b, 0x212c, 0x212d, 0x212e, 0x212f,
+ 0x2130, 0x2131, 0x2132, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137,
+ 0x2138, 0x2139, 0x213a, 0x213b, 0x213c, 0x213d, 0x213e, 0x213f,
+ 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147,
+ 0x2148, 0x2149, 0x214a, 0x214b, 0x214c, 0x214d, 0x2132, 0x214f,
+ 0x0000, 0x0000, 0x0000, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157,
+ 0x2158, 0x2159, 0x215a, 0x215b, 0x215c, 0x215d, 0x215e, 0x215f,
+ 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167,
+ 0x2168, 0x2169, 0x216a, 0x216b, 0x216c, 0x216d, 0x216e, 0x216f,
+ 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167,
+ 0x2168, 0x2169, 0x216a, 0x216b, 0x216c, 0x216d, 0x216e, 0x216f,
+ 0x2180, 0x2181, 0x2182, 0x2183, 0x2183, 0x2185, 0x2186, 0x2187,
+ 0x2188, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197,
+ 0x2198, 0x2199, 0x219a, 0x219b, 0x219c, 0x219d, 0x219e, 0x219f,
+ 0x21a0, 0x21a1, 0x21a2, 0x21a3, 0x21a4, 0x21a5, 0x21a6, 0x21a7,
+ 0x21a8, 0x21a9, 0x21aa, 0x21ab, 0x21ac, 0x21ad, 0x21ae, 0x21af,
+ 0x21b0, 0x21b1, 0x21b2, 0x21b3, 0x21b4, 0x21b5, 0x21b6, 0x21b7,
+ 0x21b8, 0x21b9, 0x21ba, 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf,
+ 0x21c0, 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7,
+ 0x21c8, 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf,
+ 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x21d5, 0x21d6, 0x21d7,
+ 0x21d8, 0x21d9, 0x21da, 0x21db, 0x21dc, 0x21dd, 0x21de, 0x21df,
+ 0x21e0, 0x21e1, 0x21e2, 0x21e3, 0x21e4, 0x21e5, 0x21e6, 0x21e7,
+ 0x21e8, 0x21e9, 0x21ea, 0x21eb, 0x21ec, 0x21ed, 0x21ee, 0x21ef,
+ 0x21f0, 0x21f1, 0x21f2, 0x21f3, 0x21f4, 0x21f5, 0x21f6, 0x21f7,
+ 0x21f8, 0x21f9, 0x21fa, 0x21fb, 0x21fc, 0x21fd, 0x21fe, 0x21ff,
+ 0x2200, 0x2201, 0x2202, 0x2203, 0x2204, 0x2205, 0x2206, 0x2207,
+ 0x2208, 0x2209, 0x220a, 0x220b, 0x220c, 0x220d, 0x220e, 0x220f,
+ 0x2210, 0x2211, 0x2212, 0x2213, 0x2214, 0x2215, 0x2216, 0x2217,
+ 0x2218, 0x2219, 0x221a, 0x221b, 0x221c, 0x221d, 0x221e, 0x221f,
+ 0x2220, 0x2221, 0x2222, 0x2223, 0x2224, 0x2225, 0x2226, 0x2227,
+ 0x2228, 0x2229, 0x222a, 0x222b, 0x222c, 0x222d, 0x222e, 0x222f,
+ 0x2230, 0x2231, 0x2232, 0x2233, 0x2234, 0x2235, 0x2236, 0x2237,
+ 0x2238, 0x2239, 0x223a, 0x223b, 0x223c, 0x223d, 0x223e, 0x223f,
+ 0x2240, 0x2241, 0x2242, 0x2243, 0x2244, 0x2245, 0x2246, 0x2247,
+ 0x2248, 0x2249, 0x224a, 0x224b, 0x224c, 0x224d, 0x224e, 0x224f,
+ 0x2250, 0x2251, 0x2252, 0x2253, 0x2254, 0x2255, 0x2256, 0x2257,
+ 0x2258, 0x2259, 0x225a, 0x225b, 0x225c, 0x225d, 0x225e, 0x225f,
+ 0x2260, 0x2261, 0x2262, 0x2263, 0x2264, 0x2265, 0x2266, 0x2267,
+ 0x2268, 0x2269, 0x226a, 0x226b, 0x226c, 0x226d, 0x226e, 0x226f,
+ 0x2270, 0x2271, 0x2272, 0x2273, 0x2274, 0x2275, 0x2276, 0x2277,
+ 0x2278, 0x2279, 0x227a, 0x227b, 0x227c, 0x227d, 0x227e, 0x227f,
+ 0x2280, 0x2281, 0x2282, 0x2283, 0x2284, 0x2285, 0x2286, 0x2287,
+ 0x2288, 0x2289, 0x228a, 0x228b, 0x228c, 0x228d, 0x228e, 0x228f,
+ 0x2290, 0x2291, 0x2292, 0x2293, 0x2294, 0x2295, 0x2296, 0x2297,
+ 0x2298, 0x2299, 0x229a, 0x229b, 0x229c, 0x229d, 0x229e, 0x229f,
+ 0x22a0, 0x22a1, 0x22a2, 0x22a3, 0x22a4, 0x22a5, 0x22a6, 0x22a7,
+ 0x22a8, 0x22a9, 0x22aa, 0x22ab, 0x22ac, 0x22ad, 0x22ae, 0x22af,
+ 0x22b0, 0x22b1, 0x22b2, 0x22b3, 0x22b4, 0x22b5, 0x22b6, 0x22b7,
+ 0x22b8, 0x22b9, 0x22ba, 0x22bb, 0x22bc, 0x22bd, 0x22be, 0x22bf,
+ 0x22c0, 0x22c1, 0x22c2, 0x22c3, 0x22c4, 0x22c5, 0x22c6, 0x22c7,
+ 0x22c8, 0x22c9, 0x22ca, 0x22cb, 0x22cc, 0x22cd, 0x22ce, 0x22cf,
+ 0x22d0, 0x22d1, 0x22d2, 0x22d3, 0x22d4, 0x22d5, 0x22d6, 0x22d7,
+ 0x22d8, 0x22d9, 0x22da, 0x22db, 0x22dc, 0x22dd, 0x22de, 0x22df,
+ 0x22e0, 0x22e1, 0x22e2, 0x22e3, 0x22e4, 0x22e5, 0x22e6, 0x22e7,
+ 0x22e8, 0x22e9, 0x22ea, 0x22eb, 0x22ec, 0x22ed, 0x22ee, 0x22ef,
+ 0x22f0, 0x22f1, 0x22f2, 0x22f3, 0x22f4, 0x22f5, 0x22f6, 0x22f7,
+ 0x22f8, 0x22f9, 0x22fa, 0x22fb, 0x22fc, 0x22fd, 0x22fe, 0x22ff,
+ 0x2300, 0x2301, 0x2302, 0x2303, 0x2304, 0x2305, 0x2306, 0x2307,
+ 0x2308, 0x2309, 0x230a, 0x230b, 0x230c, 0x230d, 0x230e, 0x230f,
+ 0x2310, 0x2311, 0x2312, 0x2313, 0x2314, 0x2315, 0x2316, 0x2317,
+ 0x2318, 0x2319, 0x231a, 0x231b, 0x231c, 0x231d, 0x231e, 0x231f,
+ 0x2320, 0x2321, 0x2322, 0x2323, 0x2324, 0x2325, 0x2326, 0x2327,
+ 0x2328, 0x2329, 0x232a, 0x232b, 0x232c, 0x232d, 0x232e, 0x232f,
+ 0x2330, 0x2331, 0x2332, 0x2333, 0x2334, 0x2335, 0x2336, 0x2337,
+ 0x2338, 0x2339, 0x233a, 0x233b, 0x233c, 0x233d, 0x233e, 0x233f,
+ 0x2340, 0x2341, 0x2342, 0x2343, 0x2344, 0x2345, 0x2346, 0x2347,
+ 0x2348, 0x2349, 0x234a, 0x234b, 0x234c, 0x234d, 0x234e, 0x234f,
+ 0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357,
+ 0x2358, 0x2359, 0x235a, 0x235b, 0x235c, 0x235d, 0x235e, 0x235f,
+ 0x2360, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367,
+ 0x2368, 0x2369, 0x236a, 0x236b, 0x236c, 0x236d, 0x236e, 0x236f,
+ 0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377,
+ 0x2378, 0x2379, 0x237a, 0x237b, 0x237c, 0x237d, 0x237e, 0x237f,
+ 0x2380, 0x2381, 0x2382, 0x2383, 0x2384, 0x2385, 0x2386, 0x2387,
+ 0x2388, 0x2389, 0x238a, 0x238b, 0x238c, 0x238d, 0x238e, 0x238f,
+ 0x2390, 0x2391, 0x2392, 0x2393, 0x2394, 0x2395, 0x2396, 0x2397,
+ 0x2398, 0x2399, 0x239a, 0x239b, 0x239c, 0x239d, 0x239e, 0x239f,
+ 0x23a0, 0x23a1, 0x23a2, 0x23a3, 0x23a4, 0x23a5, 0x23a6, 0x23a7,
+ 0x23a8, 0x23a9, 0x23aa, 0x23ab, 0x23ac, 0x23ad, 0x23ae, 0x23af,
+ 0x23b0, 0x23b1, 0x23b2, 0x23b3, 0x23b4, 0x23b5, 0x23b6, 0x23b7,
+ 0x23b8, 0x23b9, 0x23ba, 0x23bb, 0x23bc, 0x23bd, 0x23be, 0x23bf,
+ 0x23c0, 0x23c1, 0x23c2, 0x23c3, 0x23c4, 0x23c5, 0x23c6, 0x23c7,
+ 0x23c8, 0x23c9, 0x23ca, 0x23cb, 0x23cc, 0x23cd, 0x23ce, 0x23cf,
+ 0x23d0, 0x23d1, 0x23d2, 0x23d3, 0x23d4, 0x23d5, 0x23d6, 0x23d7,
+ 0x23d8, 0x23d9, 0x23da, 0x23db, 0x23dc, 0x23dd, 0x23de, 0x23df,
+ 0x23e0, 0x23e1, 0x23e2, 0x23e3, 0x23e4, 0x23e5, 0x23e6, 0x23e7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407,
+ 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f,
+ 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417,
+ 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f,
+ 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447,
+ 0x2448, 0x2449, 0x244a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467,
+ 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f,
+ 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477,
+ 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f,
+ 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487,
+ 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f,
+ 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497,
+ 0x2498, 0x2499, 0x249a, 0x249b, 0x249c, 0x249d, 0x249e, 0x249f,
+ 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7,
+ 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af,
+ 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x24b6, 0x24b7,
+ 0x24b8, 0x24b9, 0x24ba, 0x24bb, 0x24bc, 0x24bd, 0x24be, 0x24bf,
+ 0x24c0, 0x24c1, 0x24c2, 0x24c3, 0x24c4, 0x24c5, 0x24c6, 0x24c7,
+ 0x24c8, 0x24c9, 0x24ca, 0x24cb, 0x24cc, 0x24cd, 0x24ce, 0x24cf,
+ 0x24b6, 0x24b7, 0x24b8, 0x24b9, 0x24ba, 0x24bb, 0x24bc, 0x24bd,
+ 0x24be, 0x24bf, 0x24c0, 0x24c1, 0x24c2, 0x24c3, 0x24c4, 0x24c5,
+ 0x24c6, 0x24c7, 0x24c8, 0x24c9, 0x24ca, 0x24cb, 0x24cc, 0x24cd,
+ 0x24ce, 0x24cf, 0x24ea, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef,
+ 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0x24f5, 0x24f6, 0x24f7,
+ 0x24f8, 0x24f9, 0x24fa, 0x24fb, 0x24fc, 0x24fd, 0x24fe, 0x24ff,
+ 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506, 0x2507,
+ 0x2508, 0x2509, 0x250a, 0x250b, 0x250c, 0x250d, 0x250e, 0x250f,
+ 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516, 0x2517,
+ 0x2518, 0x2519, 0x251a, 0x251b, 0x251c, 0x251d, 0x251e, 0x251f,
+ 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526, 0x2527,
+ 0x2528, 0x2529, 0x252a, 0x252b, 0x252c, 0x252d, 0x252e, 0x252f,
+ 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537,
+ 0x2538, 0x2539, 0x253a, 0x253b, 0x253c, 0x253d, 0x253e, 0x253f,
+ 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
+ 0x2548, 0x2549, 0x254a, 0x254b, 0x254c, 0x254d, 0x254e, 0x254f,
+ 0x2550, 0x2551, 0x2552, 0x2553, 0x2554, 0x2555, 0x2556, 0x2557,
+ 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, 0x255f,
+ 0x2560, 0x2561, 0x2562, 0x2563, 0x2564, 0x2565, 0x2566, 0x2567,
+ 0x2568, 0x2569, 0x256a, 0x256b, 0x256c, 0x256d, 0x256e, 0x256f,
+ 0x2570, 0x2571, 0x2572, 0x2573, 0x2574, 0x2575, 0x2576, 0x2577,
+ 0x2578, 0x2579, 0x257a, 0x257b, 0x257c, 0x257d, 0x257e, 0x257f,
+ 0x2580, 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587,
+ 0x2588, 0x2589, 0x258a, 0x258b, 0x258c, 0x258d, 0x258e, 0x258f,
+ 0x2590, 0x2591, 0x2592, 0x2593, 0x2594, 0x2595, 0x2596, 0x2597,
+ 0x2598, 0x2599, 0x259a, 0x259b, 0x259c, 0x259d, 0x259e, 0x259f,
+ 0x25a0, 0x25a1, 0x25a2, 0x25a3, 0x25a4, 0x25a5, 0x25a6, 0x25a7,
+ 0x25a8, 0x25a9, 0x25aa, 0x25ab, 0x25ac, 0x25ad, 0x25ae, 0x25af,
+ 0x25b0, 0x25b1, 0x25b2, 0x25b3, 0x25b4, 0x25b5, 0x25b6, 0x25b7,
+ 0x25b8, 0x25b9, 0x25ba, 0x25bb, 0x25bc, 0x25bd, 0x25be, 0x25bf,
+ 0x25c0, 0x25c1, 0x25c2, 0x25c3, 0x25c4, 0x25c5, 0x25c6, 0x25c7,
+ 0x25c8, 0x25c9, 0x25ca, 0x25cb, 0x25cc, 0x25cd, 0x25ce, 0x25cf,
+ 0x25d0, 0x25d1, 0x25d2, 0x25d3, 0x25d4, 0x25d5, 0x25d6, 0x25d7,
+ 0x25d8, 0x25d9, 0x25da, 0x25db, 0x25dc, 0x25dd, 0x25de, 0x25df,
+ 0x25e0, 0x25e1, 0x25e2, 0x25e3, 0x25e4, 0x25e5, 0x25e6, 0x25e7,
+ 0x25e8, 0x25e9, 0x25ea, 0x25eb, 0x25ec, 0x25ed, 0x25ee, 0x25ef,
+ 0x25f0, 0x25f1, 0x25f2, 0x25f3, 0x25f4, 0x25f5, 0x25f6, 0x25f7,
+ 0x25f8, 0x25f9, 0x25fa, 0x25fb, 0x25fc, 0x25fd, 0x25fe, 0x25ff,
+ 0x2600, 0x2601, 0x2602, 0x2603, 0x2604, 0x2605, 0x2606, 0x2607,
+ 0x2608, 0x2609, 0x260a, 0x260b, 0x260c, 0x260d, 0x260e, 0x260f,
+ 0x2610, 0x2611, 0x2612, 0x2613, 0x2614, 0x2615, 0x2616, 0x2617,
+ 0x2618, 0x2619, 0x261a, 0x261b, 0x261c, 0x261d, 0x261e, 0x261f,
+ 0x2620, 0x2621, 0x2622, 0x2623, 0x2624, 0x2625, 0x2626, 0x2627,
+ 0x2628, 0x2629, 0x262a, 0x262b, 0x262c, 0x262d, 0x262e, 0x262f,
+ 0x2630, 0x2631, 0x2632, 0x2633, 0x2634, 0x2635, 0x2636, 0x2637,
+ 0x2638, 0x2639, 0x263a, 0x263b, 0x263c, 0x263d, 0x263e, 0x263f,
+ 0x2640, 0x2641, 0x2642, 0x2643, 0x2644, 0x2645, 0x2646, 0x2647,
+ 0x2648, 0x2649, 0x264a, 0x264b, 0x264c, 0x264d, 0x264e, 0x264f,
+ 0x2650, 0x2651, 0x2652, 0x2653, 0x2654, 0x2655, 0x2656, 0x2657,
+ 0x2658, 0x2659, 0x265a, 0x265b, 0x265c, 0x265d, 0x265e, 0x265f,
+ 0x2660, 0x2661, 0x2662, 0x2663, 0x2664, 0x2665, 0x2666, 0x2667,
+ 0x2668, 0x2669, 0x266a, 0x266b, 0x266c, 0x266d, 0x266e, 0x266f,
+ 0x2670, 0x2671, 0x2672, 0x2673, 0x2674, 0x2675, 0x2676, 0x2677,
+ 0x2678, 0x2679, 0x267a, 0x267b, 0x267c, 0x267d, 0x267e, 0x267f,
+ 0x2680, 0x2681, 0x2682, 0x2683, 0x2684, 0x2685, 0x2686, 0x2687,
+ 0x2688, 0x2689, 0x268a, 0x268b, 0x268c, 0x268d, 0x268e, 0x268f,
+ 0x2690, 0x2691, 0x2692, 0x2693, 0x2694, 0x2695, 0x2696, 0x2697,
+ 0x2698, 0x2699, 0x269a, 0x269b, 0x269c, 0x269d, 0x0000, 0x0000,
+ 0x26a0, 0x26a1, 0x26a2, 0x26a3, 0x26a4, 0x26a5, 0x26a6, 0x26a7,
+ 0x26a8, 0x26a9, 0x26aa, 0x26ab, 0x26ac, 0x26ad, 0x26ae, 0x26af,
+ 0x26b0, 0x26b1, 0x26b2, 0x26b3, 0x26b4, 0x26b5, 0x26b6, 0x26b7,
+ 0x26b8, 0x26b9, 0x26ba, 0x26bb, 0x26bc, 0x0000, 0x0000, 0x0000,
+ 0x26c0, 0x26c1, 0x26c2, 0x26c3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2701, 0x2702, 0x2703, 0x2704, 0x0000, 0x2706, 0x2707,
+ 0x2708, 0x2709, 0x0000, 0x0000, 0x270c, 0x270d, 0x270e, 0x270f,
+ 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717,
+ 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f,
+ 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727,
+ 0x0000, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f,
+ 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737,
+ 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f,
+ 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747,
+ 0x2748, 0x2749, 0x274a, 0x274b, 0x0000, 0x274d, 0x0000, 0x274f,
+ 0x2750, 0x2751, 0x2752, 0x0000, 0x0000, 0x0000, 0x2756, 0x0000,
+ 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x0000,
+ 0x0000, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767,
+ 0x2768, 0x2769, 0x276a, 0x276b, 0x276c, 0x276d, 0x276e, 0x276f,
+ 0x2770, 0x2771, 0x2772, 0x2773, 0x2774, 0x2775, 0x2776, 0x2777,
+ 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0x277f,
+ 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787,
+ 0x2788, 0x2789, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f,
+ 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x0000, 0x0000, 0x0000,
+ 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f,
+ 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7,
+ 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af,
+ 0x0000, 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7,
+ 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, 0x0000,
+ 0x27c0, 0x27c1, 0x27c2, 0x27c3, 0x27c4, 0x27c5, 0x27c6, 0x27c7,
+ 0x27c8, 0x27c9, 0x27ca, 0x0000, 0x27cc, 0x0000, 0x0000, 0x0000,
+ 0x27d0, 0x27d1, 0x27d2, 0x27d3, 0x27d4, 0x27d5, 0x27d6, 0x27d7,
+ 0x27d8, 0x27d9, 0x27da, 0x27db, 0x27dc, 0x27dd, 0x27de, 0x27df,
+ 0x27e0, 0x27e1, 0x27e2, 0x27e3, 0x27e4, 0x27e5, 0x27e6, 0x27e7,
+ 0x27e8, 0x27e9, 0x27ea, 0x27eb, 0x27ec, 0x27ed, 0x27ee, 0x27ef,
+ 0x27f0, 0x27f1, 0x27f2, 0x27f3, 0x27f4, 0x27f5, 0x27f6, 0x27f7,
+ 0x27f8, 0x27f9, 0x27fa, 0x27fb, 0x27fc, 0x27fd, 0x27fe, 0x27ff,
+ 0x2800, 0x2801, 0x2802, 0x2803, 0x2804, 0x2805, 0x2806, 0x2807,
+ 0x2808, 0x2809, 0x280a, 0x280b, 0x280c, 0x280d, 0x280e, 0x280f,
+ 0x2810, 0x2811, 0x2812, 0x2813, 0x2814, 0x2815, 0x2816, 0x2817,
+ 0x2818, 0x2819, 0x281a, 0x281b, 0x281c, 0x281d, 0x281e, 0x281f,
+ 0x2820, 0x2821, 0x2822, 0x2823, 0x2824, 0x2825, 0x2826, 0x2827,
+ 0x2828, 0x2829, 0x282a, 0x282b, 0x282c, 0x282d, 0x282e, 0x282f,
+ 0x2830, 0x2831, 0x2832, 0x2833, 0x2834, 0x2835, 0x2836, 0x2837,
+ 0x2838, 0x2839, 0x283a, 0x283b, 0x283c, 0x283d, 0x283e, 0x283f,
+ 0x2840, 0x2841, 0x2842, 0x2843, 0x2844, 0x2845, 0x2846, 0x2847,
+ 0x2848, 0x2849, 0x284a, 0x284b, 0x284c, 0x284d, 0x284e, 0x284f,
+ 0x2850, 0x2851, 0x2852, 0x2853, 0x2854, 0x2855, 0x2856, 0x2857,
+ 0x2858, 0x2859, 0x285a, 0x285b, 0x285c, 0x285d, 0x285e, 0x285f,
+ 0x2860, 0x2861, 0x2862, 0x2863, 0x2864, 0x2865, 0x2866, 0x2867,
+ 0x2868, 0x2869, 0x286a, 0x286b, 0x286c, 0x286d, 0x286e, 0x286f,
+ 0x2870, 0x2871, 0x2872, 0x2873, 0x2874, 0x2875, 0x2876, 0x2877,
+ 0x2878, 0x2879, 0x287a, 0x287b, 0x287c, 0x287d, 0x287e, 0x287f,
+ 0x2880, 0x2881, 0x2882, 0x2883, 0x2884, 0x2885, 0x2886, 0x2887,
+ 0x2888, 0x2889, 0x288a, 0x288b, 0x288c, 0x288d, 0x288e, 0x288f,
+ 0x2890, 0x2891, 0x2892, 0x2893, 0x2894, 0x2895, 0x2896, 0x2897,
+ 0x2898, 0x2899, 0x289a, 0x289b, 0x289c, 0x289d, 0x289e, 0x289f,
+ 0x28a0, 0x28a1, 0x28a2, 0x28a3, 0x28a4, 0x28a5, 0x28a6, 0x28a7,
+ 0x28a8, 0x28a9, 0x28aa, 0x28ab, 0x28ac, 0x28ad, 0x28ae, 0x28af,
+ 0x28b0, 0x28b1, 0x28b2, 0x28b3, 0x28b4, 0x28b5, 0x28b6, 0x28b7,
+ 0x28b8, 0x28b9, 0x28ba, 0x28bb, 0x28bc, 0x28bd, 0x28be, 0x28bf,
+ 0x28c0, 0x28c1, 0x28c2, 0x28c3, 0x28c4, 0x28c5, 0x28c6, 0x28c7,
+ 0x28c8, 0x28c9, 0x28ca, 0x28cb, 0x28cc, 0x28cd, 0x28ce, 0x28cf,
+ 0x28d0, 0x28d1, 0x28d2, 0x28d3, 0x28d4, 0x28d5, 0x28d6, 0x28d7,
+ 0x28d8, 0x28d9, 0x28da, 0x28db, 0x28dc, 0x28dd, 0x28de, 0x28df,
+ 0x28e0, 0x28e1, 0x28e2, 0x28e3, 0x28e4, 0x28e5, 0x28e6, 0x28e7,
+ 0x28e8, 0x28e9, 0x28ea, 0x28eb, 0x28ec, 0x28ed, 0x28ee, 0x28ef,
+ 0x28f0, 0x28f1, 0x28f2, 0x28f3, 0x28f4, 0x28f5, 0x28f6, 0x28f7,
+ 0x28f8, 0x28f9, 0x28fa, 0x28fb, 0x28fc, 0x28fd, 0x28fe, 0x28ff,
+ 0x2900, 0x2901, 0x2902, 0x2903, 0x2904, 0x2905, 0x2906, 0x2907,
+ 0x2908, 0x2909, 0x290a, 0x290b, 0x290c, 0x290d, 0x290e, 0x290f,
+ 0x2910, 0x2911, 0x2912, 0x2913, 0x2914, 0x2915, 0x2916, 0x2917,
+ 0x2918, 0x2919, 0x291a, 0x291b, 0x291c, 0x291d, 0x291e, 0x291f,
+ 0x2920, 0x2921, 0x2922, 0x2923, 0x2924, 0x2925, 0x2926, 0x2927,
+ 0x2928, 0x2929, 0x292a, 0x292b, 0x292c, 0x292d, 0x292e, 0x292f,
+ 0x2930, 0x2931, 0x2932, 0x2933, 0x2934, 0x2935, 0x2936, 0x2937,
+ 0x2938, 0x2939, 0x293a, 0x293b, 0x293c, 0x293d, 0x293e, 0x293f,
+ 0x2940, 0x2941, 0x2942, 0x2943, 0x2944, 0x2945, 0x2946, 0x2947,
+ 0x2948, 0x2949, 0x294a, 0x294b, 0x294c, 0x294d, 0x294e, 0x294f,
+ 0x2950, 0x2951, 0x2952, 0x2953, 0x2954, 0x2955, 0x2956, 0x2957,
+ 0x2958, 0x2959, 0x295a, 0x295b, 0x295c, 0x295d, 0x295e, 0x295f,
+ 0x2960, 0x2961, 0x2962, 0x2963, 0x2964, 0x2965, 0x2966, 0x2967,
+ 0x2968, 0x2969, 0x296a, 0x296b, 0x296c, 0x296d, 0x296e, 0x296f,
+ 0x2970, 0x2971, 0x2972, 0x2973, 0x2974, 0x2975, 0x2976, 0x2977,
+ 0x2978, 0x2979, 0x297a, 0x297b, 0x297c, 0x297d, 0x297e, 0x297f,
+ 0x2980, 0x2981, 0x2982, 0x2983, 0x2984, 0x2985, 0x2986, 0x2987,
+ 0x2988, 0x2989, 0x298a, 0x298b, 0x298c, 0x298d, 0x298e, 0x298f,
+ 0x2990, 0x2991, 0x2992, 0x2993, 0x2994, 0x2995, 0x2996, 0x2997,
+ 0x2998, 0x2999, 0x299a, 0x299b, 0x299c, 0x299d, 0x299e, 0x299f,
+ 0x29a0, 0x29a1, 0x29a2, 0x29a3, 0x29a4, 0x29a5, 0x29a6, 0x29a7,
+ 0x29a8, 0x29a9, 0x29aa, 0x29ab, 0x29ac, 0x29ad, 0x29ae, 0x29af,
+ 0x29b0, 0x29b1, 0x29b2, 0x29b3, 0x29b4, 0x29b5, 0x29b6, 0x29b7,
+ 0x29b8, 0x29b9, 0x29ba, 0x29bb, 0x29bc, 0x29bd, 0x29be, 0x29bf,
+ 0x29c0, 0x29c1, 0x29c2, 0x29c3, 0x29c4, 0x29c5, 0x29c6, 0x29c7,
+ 0x29c8, 0x29c9, 0x29ca, 0x29cb, 0x29cc, 0x29cd, 0x29ce, 0x29cf,
+ 0x29d0, 0x29d1, 0x29d2, 0x29d3, 0x29d4, 0x29d5, 0x29d6, 0x29d7,
+ 0x29d8, 0x29d9, 0x29da, 0x29db, 0x29dc, 0x29dd, 0x29de, 0x29df,
+ 0x29e0, 0x29e1, 0x29e2, 0x29e3, 0x29e4, 0x29e5, 0x29e6, 0x29e7,
+ 0x29e8, 0x29e9, 0x29ea, 0x29eb, 0x29ec, 0x29ed, 0x29ee, 0x29ef,
+ 0x29f0, 0x29f1, 0x29f2, 0x29f3, 0x29f4, 0x29f5, 0x29f6, 0x29f7,
+ 0x29f8, 0x29f9, 0x29fa, 0x29fb, 0x29fc, 0x29fd, 0x29fe, 0x29ff,
+ 0x2a00, 0x2a01, 0x2a02, 0x2a03, 0x2a04, 0x2a05, 0x2a06, 0x2a07,
+ 0x2a08, 0x2a09, 0x2a0a, 0x2a0b, 0x2a0c, 0x2a0d, 0x2a0e, 0x2a0f,
+ 0x2a10, 0x2a11, 0x2a12, 0x2a13, 0x2a14, 0x2a15, 0x2a16, 0x2a17,
+ 0x2a18, 0x2a19, 0x2a1a, 0x2a1b, 0x2a1c, 0x2a1d, 0x2a1e, 0x2a1f,
+ 0x2a20, 0x2a21, 0x2a22, 0x2a23, 0x2a24, 0x2a25, 0x2a26, 0x2a27,
+ 0x2a28, 0x2a29, 0x2a2a, 0x2a2b, 0x2a2c, 0x2a2d, 0x2a2e, 0x2a2f,
+ 0x2a30, 0x2a31, 0x2a32, 0x2a33, 0x2a34, 0x2a35, 0x2a36, 0x2a37,
+ 0x2a38, 0x2a39, 0x2a3a, 0x2a3b, 0x2a3c, 0x2a3d, 0x2a3e, 0x2a3f,
+ 0x2a40, 0x2a41, 0x2a42, 0x2a43, 0x2a44, 0x2a45, 0x2a46, 0x2a47,
+ 0x2a48, 0x2a49, 0x2a4a, 0x2a4b, 0x2a4c, 0x2a4d, 0x2a4e, 0x2a4f,
+ 0x2a50, 0x2a51, 0x2a52, 0x2a53, 0x2a54, 0x2a55, 0x2a56, 0x2a57,
+ 0x2a58, 0x2a59, 0x2a5a, 0x2a5b, 0x2a5c, 0x2a5d, 0x2a5e, 0x2a5f,
+ 0x2a60, 0x2a61, 0x2a62, 0x2a63, 0x2a64, 0x2a65, 0x2a66, 0x2a67,
+ 0x2a68, 0x2a69, 0x2a6a, 0x2a6b, 0x2a6c, 0x2a6d, 0x2a6e, 0x2a6f,
+ 0x2a70, 0x2a71, 0x2a72, 0x2a73, 0x2a74, 0x2a75, 0x2a76, 0x2a77,
+ 0x2a78, 0x2a79, 0x2a7a, 0x2a7b, 0x2a7c, 0x2a7d, 0x2a7e, 0x2a7f,
+ 0x2a80, 0x2a81, 0x2a82, 0x2a83, 0x2a84, 0x2a85, 0x2a86, 0x2a87,
+ 0x2a88, 0x2a89, 0x2a8a, 0x2a8b, 0x2a8c, 0x2a8d, 0x2a8e, 0x2a8f,
+ 0x2a90, 0x2a91, 0x2a92, 0x2a93, 0x2a94, 0x2a95, 0x2a96, 0x2a97,
+ 0x2a98, 0x2a99, 0x2a9a, 0x2a9b, 0x2a9c, 0x2a9d, 0x2a9e, 0x2a9f,
+ 0x2aa0, 0x2aa1, 0x2aa2, 0x2aa3, 0x2aa4, 0x2aa5, 0x2aa6, 0x2aa7,
+ 0x2aa8, 0x2aa9, 0x2aaa, 0x2aab, 0x2aac, 0x2aad, 0x2aae, 0x2aaf,
+ 0x2ab0, 0x2ab1, 0x2ab2, 0x2ab3, 0x2ab4, 0x2ab5, 0x2ab6, 0x2ab7,
+ 0x2ab8, 0x2ab9, 0x2aba, 0x2abb, 0x2abc, 0x2abd, 0x2abe, 0x2abf,
+ 0x2ac0, 0x2ac1, 0x2ac2, 0x2ac3, 0x2ac4, 0x2ac5, 0x2ac6, 0x2ac7,
+ 0x2ac8, 0x2ac9, 0x2aca, 0x2acb, 0x2acc, 0x2acd, 0x2ace, 0x2acf,
+ 0x2ad0, 0x2ad1, 0x2ad2, 0x2ad3, 0x2ad4, 0x2ad5, 0x2ad6, 0x2ad7,
+ 0x2ad8, 0x2ad9, 0x2ada, 0x2adb, 0x2adc, 0x2add, 0x2ade, 0x2adf,
+ 0x2ae0, 0x2ae1, 0x2ae2, 0x2ae3, 0x2ae4, 0x2ae5, 0x2ae6, 0x2ae7,
+ 0x2ae8, 0x2ae9, 0x2aea, 0x2aeb, 0x2aec, 0x2aed, 0x2aee, 0x2aef,
+ 0x2af0, 0x2af1, 0x2af2, 0x2af3, 0x2af4, 0x2af5, 0x2af6, 0x2af7,
+ 0x2af8, 0x2af9, 0x2afa, 0x2afb, 0x2afc, 0x2afd, 0x2afe, 0x2aff,
+ 0x2b00, 0x2b01, 0x2b02, 0x2b03, 0x2b04, 0x2b05, 0x2b06, 0x2b07,
+ 0x2b08, 0x2b09, 0x2b0a, 0x2b0b, 0x2b0c, 0x2b0d, 0x2b0e, 0x2b0f,
+ 0x2b10, 0x2b11, 0x2b12, 0x2b13, 0x2b14, 0x2b15, 0x2b16, 0x2b17,
+ 0x2b18, 0x2b19, 0x2b1a, 0x2b1b, 0x2b1c, 0x2b1d, 0x2b1e, 0x2b1f,
+ 0x2b20, 0x2b21, 0x2b22, 0x2b23, 0x2b24, 0x2b25, 0x2b26, 0x2b27,
+ 0x2b28, 0x2b29, 0x2b2a, 0x2b2b, 0x2b2c, 0x2b2d, 0x2b2e, 0x2b2f,
+ 0x2b30, 0x2b31, 0x2b32, 0x2b33, 0x2b34, 0x2b35, 0x2b36, 0x2b37,
+ 0x2b38, 0x2b39, 0x2b3a, 0x2b3b, 0x2b3c, 0x2b3d, 0x2b3e, 0x2b3f,
+ 0x2b40, 0x2b41, 0x2b42, 0x2b43, 0x2b44, 0x2b45, 0x2b46, 0x2b47,
+ 0x2b48, 0x2b49, 0x2b4a, 0x2b4b, 0x2b4c, 0x0000, 0x0000, 0x0000,
+ 0x2b50, 0x2b51, 0x2b52, 0x2b53, 0x2b54, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2c00, 0x2c01, 0x2c02, 0x2c03, 0x2c04, 0x2c05, 0x2c06, 0x2c07,
+ 0x2c08, 0x2c09, 0x2c0a, 0x2c0b, 0x2c0c, 0x2c0d, 0x2c0e, 0x2c0f,
+ 0x2c10, 0x2c11, 0x2c12, 0x2c13, 0x2c14, 0x2c15, 0x2c16, 0x2c17,
+ 0x2c18, 0x2c19, 0x2c1a, 0x2c1b, 0x2c1c, 0x2c1d, 0x2c1e, 0x2c1f,
+ 0x2c20, 0x2c21, 0x2c22, 0x2c23, 0x2c24, 0x2c25, 0x2c26, 0x2c27,
+ 0x2c28, 0x2c29, 0x2c2a, 0x2c2b, 0x2c2c, 0x2c2d, 0x2c2e, 0x0000,
+ 0x2c00, 0x2c01, 0x2c02, 0x2c03, 0x2c04, 0x2c05, 0x2c06, 0x2c07,
+ 0x2c08, 0x2c09, 0x2c0a, 0x2c0b, 0x2c0c, 0x2c0d, 0x2c0e, 0x2c0f,
+ 0x2c10, 0x2c11, 0x2c12, 0x2c13, 0x2c14, 0x2c15, 0x2c16, 0x2c17,
+ 0x2c18, 0x2c19, 0x2c1a, 0x2c1b, 0x2c1c, 0x2c1d, 0x2c1e, 0x2c1f,
+ 0x2c20, 0x2c21, 0x2c22, 0x2c23, 0x2c24, 0x2c25, 0x2c26, 0x2c27,
+ 0x2c28, 0x2c29, 0x2c2a, 0x2c2b, 0x2c2c, 0x2c2d, 0x2c2e, 0x0000,
+ 0x2c60, 0x2c60, 0x2c62, 0x2c63, 0x2c64, 0x023a, 0x023e, 0x2c67,
+ 0x2c67, 0x2c69, 0x2c69, 0x2c6b, 0x2c6b, 0x2c6d, 0x2c6e, 0x2c6f,
+ 0x0000, 0x2c71, 0x2c72, 0x2c72, 0x2c74, 0x2c75, 0x2c75, 0x2c77,
+ 0x2c78, 0x2c79, 0x2c7a, 0x2c7b, 0x2c7c, 0x2c7d, 0x0000, 0x0000,
+ 0x2c80, 0x2c80, 0x2c82, 0x2c82, 0x2c84, 0x2c84, 0x2c86, 0x2c86,
+ 0x2c88, 0x2c88, 0x2c8a, 0x2c8a, 0x2c8c, 0x2c8c, 0x2c8e, 0x2c8e,
+ 0x2c90, 0x2c90, 0x2c92, 0x2c92, 0x2c94, 0x2c94, 0x2c96, 0x2c96,
+ 0x2c98, 0x2c98, 0x2c9a, 0x2c9a, 0x2c9c, 0x2c9c, 0x2c9e, 0x2c9e,
+ 0x2ca0, 0x2ca0, 0x2ca2, 0x2ca2, 0x2ca4, 0x2ca4, 0x2ca6, 0x2ca6,
+ 0x2ca8, 0x2ca8, 0x2caa, 0x2caa, 0x2cac, 0x2cac, 0x2cae, 0x2cae,
+ 0x2cb0, 0x2cb0, 0x2cb2, 0x2cb2, 0x2cb4, 0x2cb4, 0x2cb6, 0x2cb6,
+ 0x2cb8, 0x2cb8, 0x2cba, 0x2cba, 0x2cbc, 0x2cbc, 0x2cbe, 0x2cbe,
+ 0x2cc0, 0x2cc0, 0x2cc2, 0x2cc2, 0x2cc4, 0x2cc4, 0x2cc6, 0x2cc6,
+ 0x2cc8, 0x2cc8, 0x2cca, 0x2cca, 0x2ccc, 0x2ccc, 0x2cce, 0x2cce,
+ 0x2cd0, 0x2cd0, 0x2cd2, 0x2cd2, 0x2cd4, 0x2cd4, 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8, 0x2cda, 0x2cda, 0x2cdc, 0x2cdc, 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0, 0x2ce2, 0x2ce2, 0x2ce4, 0x2ce5, 0x2ce6, 0x2ce7,
+ 0x2ce8, 0x2ce9, 0x2cea, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2cf9, 0x2cfa, 0x2cfb, 0x2cfc, 0x2cfd, 0x2cfe, 0x2cff,
+ 0x10a0, 0x10a1, 0x10a2, 0x10a3, 0x10a4, 0x10a5, 0x10a6, 0x10a7,
+ 0x10a8, 0x10a9, 0x10aa, 0x10ab, 0x10ac, 0x10ad, 0x10ae, 0x10af,
+ 0x10b0, 0x10b1, 0x10b2, 0x10b3, 0x10b4, 0x10b5, 0x10b6, 0x10b7,
+ 0x10b8, 0x10b9, 0x10ba, 0x10bb, 0x10bc, 0x10bd, 0x10be, 0x10bf,
+ 0x10c0, 0x10c1, 0x10c2, 0x10c3, 0x10c4, 0x10c5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2d30, 0x2d31, 0x2d32, 0x2d33, 0x2d34, 0x2d35, 0x2d36, 0x2d37,
+ 0x2d38, 0x2d39, 0x2d3a, 0x2d3b, 0x2d3c, 0x2d3d, 0x2d3e, 0x2d3f,
+ 0x2d40, 0x2d41, 0x2d42, 0x2d43, 0x2d44, 0x2d45, 0x2d46, 0x2d47,
+ 0x2d48, 0x2d49, 0x2d4a, 0x2d4b, 0x2d4c, 0x2d4d, 0x2d4e, 0x2d4f,
+ 0x2d50, 0x2d51, 0x2d52, 0x2d53, 0x2d54, 0x2d55, 0x2d56, 0x2d57,
+ 0x2d58, 0x2d59, 0x2d5a, 0x2d5b, 0x2d5c, 0x2d5d, 0x2d5e, 0x2d5f,
+ 0x2d60, 0x2d61, 0x2d62, 0x2d63, 0x2d64, 0x2d65, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2d6f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2d80, 0x2d81, 0x2d82, 0x2d83, 0x2d84, 0x2d85, 0x2d86, 0x2d87,
+ 0x2d88, 0x2d89, 0x2d8a, 0x2d8b, 0x2d8c, 0x2d8d, 0x2d8e, 0x2d8f,
+ 0x2d90, 0x2d91, 0x2d92, 0x2d93, 0x2d94, 0x2d95, 0x2d96, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2da0, 0x2da1, 0x2da2, 0x2da3, 0x2da4, 0x2da5, 0x2da6, 0x0000,
+ 0x2da8, 0x2da9, 0x2daa, 0x2dab, 0x2dac, 0x2dad, 0x2dae, 0x0000,
+ 0x2db0, 0x2db1, 0x2db2, 0x2db3, 0x2db4, 0x2db5, 0x2db6, 0x0000,
+ 0x2db8, 0x2db9, 0x2dba, 0x2dbb, 0x2dbc, 0x2dbd, 0x2dbe, 0x0000,
+ 0x2dc0, 0x2dc1, 0x2dc2, 0x2dc3, 0x2dc4, 0x2dc5, 0x2dc6, 0x0000,
+ 0x2dc8, 0x2dc9, 0x2dca, 0x2dcb, 0x2dcc, 0x2dcd, 0x2dce, 0x0000,
+ 0x2dd0, 0x2dd1, 0x2dd2, 0x2dd3, 0x2dd4, 0x2dd5, 0x2dd6, 0x0000,
+ 0x2dd8, 0x2dd9, 0x2dda, 0x2ddb, 0x2ddc, 0x2ddd, 0x2dde, 0x0000,
+ 0x2de0, 0x2de1, 0x2de2, 0x2de3, 0x2de4, 0x2de5, 0x2de6, 0x2de7,
+ 0x2de8, 0x2de9, 0x2dea, 0x2deb, 0x2dec, 0x2ded, 0x2dee, 0x2def,
+ 0x2df0, 0x2df1, 0x2df2, 0x2df3, 0x2df4, 0x2df5, 0x2df6, 0x2df7,
+ 0x2df8, 0x2df9, 0x2dfa, 0x2dfb, 0x2dfc, 0x2dfd, 0x2dfe, 0x2dff,
+ 0x2e00, 0x2e01, 0x2e02, 0x2e03, 0x2e04, 0x2e05, 0x2e06, 0x2e07,
+ 0x2e08, 0x2e09, 0x2e0a, 0x2e0b, 0x2e0c, 0x2e0d, 0x2e0e, 0x2e0f,
+ 0x2e10, 0x2e11, 0x2e12, 0x2e13, 0x2e14, 0x2e15, 0x2e16, 0x2e17,
+ 0x2e18, 0x2e19, 0x2e1a, 0x2e1b, 0x2e1c, 0x2e1d, 0x2e1e, 0x2e1f,
+ 0x2e20, 0x2e21, 0x2e22, 0x2e23, 0x2e24, 0x2e25, 0x2e26, 0x2e27,
+ 0x2e28, 0x2e29, 0x2e2a, 0x2e2b, 0x2e2c, 0x2e2d, 0x2e2e, 0x2e2f,
+ 0x2e30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2e80, 0x2e81, 0x2e82, 0x2e83, 0x2e84, 0x2e85, 0x2e86, 0x2e87,
+ 0x2e88, 0x2e89, 0x2e8a, 0x2e8b, 0x2e8c, 0x2e8d, 0x2e8e, 0x2e8f,
+ 0x2e90, 0x2e91, 0x2e92, 0x2e93, 0x2e94, 0x2e95, 0x2e96, 0x2e97,
+ 0x2e98, 0x2e99, 0x0000, 0x2e9b, 0x2e9c, 0x2e9d, 0x2e9e, 0x2e9f,
+ 0x2ea0, 0x2ea1, 0x2ea2, 0x2ea3, 0x2ea4, 0x2ea5, 0x2ea6, 0x2ea7,
+ 0x2ea8, 0x2ea9, 0x2eaa, 0x2eab, 0x2eac, 0x2ead, 0x2eae, 0x2eaf,
+ 0x2eb0, 0x2eb1, 0x2eb2, 0x2eb3, 0x2eb4, 0x2eb5, 0x2eb6, 0x2eb7,
+ 0x2eb8, 0x2eb9, 0x2eba, 0x2ebb, 0x2ebc, 0x2ebd, 0x2ebe, 0x2ebf,
+ 0x2ec0, 0x2ec1, 0x2ec2, 0x2ec3, 0x2ec4, 0x2ec5, 0x2ec6, 0x2ec7,
+ 0x2ec8, 0x2ec9, 0x2eca, 0x2ecb, 0x2ecc, 0x2ecd, 0x2ece, 0x2ecf,
+ 0x2ed0, 0x2ed1, 0x2ed2, 0x2ed3, 0x2ed4, 0x2ed5, 0x2ed6, 0x2ed7,
+ 0x2ed8, 0x2ed9, 0x2eda, 0x2edb, 0x2edc, 0x2edd, 0x2ede, 0x2edf,
+ 0x2ee0, 0x2ee1, 0x2ee2, 0x2ee3, 0x2ee4, 0x2ee5, 0x2ee6, 0x2ee7,
+ 0x2ee8, 0x2ee9, 0x2eea, 0x2eeb, 0x2eec, 0x2eed, 0x2eee, 0x2eef,
+ 0x2ef0, 0x2ef1, 0x2ef2, 0x2ef3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2f00, 0x2f01, 0x2f02, 0x2f03, 0x2f04, 0x2f05, 0x2f06, 0x2f07,
+ 0x2f08, 0x2f09, 0x2f0a, 0x2f0b, 0x2f0c, 0x2f0d, 0x2f0e, 0x2f0f,
+ 0x2f10, 0x2f11, 0x2f12, 0x2f13, 0x2f14, 0x2f15, 0x2f16, 0x2f17,
+ 0x2f18, 0x2f19, 0x2f1a, 0x2f1b, 0x2f1c, 0x2f1d, 0x2f1e, 0x2f1f,
+ 0x2f20, 0x2f21, 0x2f22, 0x2f23, 0x2f24, 0x2f25, 0x2f26, 0x2f27,
+ 0x2f28, 0x2f29, 0x2f2a, 0x2f2b, 0x2f2c, 0x2f2d, 0x2f2e, 0x2f2f,
+ 0x2f30, 0x2f31, 0x2f32, 0x2f33, 0x2f34, 0x2f35, 0x2f36, 0x2f37,
+ 0x2f38, 0x2f39, 0x2f3a, 0x2f3b, 0x2f3c, 0x2f3d, 0x2f3e, 0x2f3f,
+ 0x2f40, 0x2f41, 0x2f42, 0x2f43, 0x2f44, 0x2f45, 0x2f46, 0x2f47,
+ 0x2f48, 0x2f49, 0x2f4a, 0x2f4b, 0x2f4c, 0x2f4d, 0x2f4e, 0x2f4f,
+ 0x2f50, 0x2f51, 0x2f52, 0x2f53, 0x2f54, 0x2f55, 0x2f56, 0x2f57,
+ 0x2f58, 0x2f59, 0x2f5a, 0x2f5b, 0x2f5c, 0x2f5d, 0x2f5e, 0x2f5f,
+ 0x2f60, 0x2f61, 0x2f62, 0x2f63, 0x2f64, 0x2f65, 0x2f66, 0x2f67,
+ 0x2f68, 0x2f69, 0x2f6a, 0x2f6b, 0x2f6c, 0x2f6d, 0x2f6e, 0x2f6f,
+ 0x2f70, 0x2f71, 0x2f72, 0x2f73, 0x2f74, 0x2f75, 0x2f76, 0x2f77,
+ 0x2f78, 0x2f79, 0x2f7a, 0x2f7b, 0x2f7c, 0x2f7d, 0x2f7e, 0x2f7f,
+ 0x2f80, 0x2f81, 0x2f82, 0x2f83, 0x2f84, 0x2f85, 0x2f86, 0x2f87,
+ 0x2f88, 0x2f89, 0x2f8a, 0x2f8b, 0x2f8c, 0x2f8d, 0x2f8e, 0x2f8f,
+ 0x2f90, 0x2f91, 0x2f92, 0x2f93, 0x2f94, 0x2f95, 0x2f96, 0x2f97,
+ 0x2f98, 0x2f99, 0x2f9a, 0x2f9b, 0x2f9c, 0x2f9d, 0x2f9e, 0x2f9f,
+ 0x2fa0, 0x2fa1, 0x2fa2, 0x2fa3, 0x2fa4, 0x2fa5, 0x2fa6, 0x2fa7,
+ 0x2fa8, 0x2fa9, 0x2faa, 0x2fab, 0x2fac, 0x2fad, 0x2fae, 0x2faf,
+ 0x2fb0, 0x2fb1, 0x2fb2, 0x2fb3, 0x2fb4, 0x2fb5, 0x2fb6, 0x2fb7,
+ 0x2fb8, 0x2fb9, 0x2fba, 0x2fbb, 0x2fbc, 0x2fbd, 0x2fbe, 0x2fbf,
+ 0x2fc0, 0x2fc1, 0x2fc2, 0x2fc3, 0x2fc4, 0x2fc5, 0x2fc6, 0x2fc7,
+ 0x2fc8, 0x2fc9, 0x2fca, 0x2fcb, 0x2fcc, 0x2fcd, 0x2fce, 0x2fcf,
+ 0x2fd0, 0x2fd1, 0x2fd2, 0x2fd3, 0x2fd4, 0x2fd5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2ff0, 0x2ff1, 0x2ff2, 0x2ff3, 0x2ff4, 0x2ff5, 0x2ff6, 0x2ff7,
+ 0x2ff8, 0x2ff9, 0x2ffa, 0x2ffb, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3000, 0x3001, 0x3002, 0x3003, 0x3004, 0x3005, 0x3006, 0x3007,
+ 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f,
+ 0x3010, 0x3011, 0x3012, 0x3013, 0x3014, 0x3015, 0x3016, 0x3017,
+ 0x3018, 0x3019, 0x301a, 0x301b, 0x301c, 0x301d, 0x301e, 0x301f,
+ 0x3020, 0x3021, 0x3022, 0x3023, 0x3024, 0x3025, 0x3026, 0x3027,
+ 0x3028, 0x3029, 0x302a, 0x302b, 0x302c, 0x302d, 0x302e, 0x302f,
+ 0x3030, 0x3031, 0x3032, 0x3033, 0x3034, 0x3035, 0x3036, 0x3037,
+ 0x3038, 0x3039, 0x303a, 0x303b, 0x303c, 0x303d, 0x303e, 0x303f,
+ 0x0000, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047,
+ 0x3048, 0x3049, 0x304a, 0x304b, 0x304c, 0x304d, 0x304e, 0x304f,
+ 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057,
+ 0x3058, 0x3059, 0x305a, 0x305b, 0x305c, 0x305d, 0x305e, 0x305f,
+ 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067,
+ 0x3068, 0x3069, 0x306a, 0x306b, 0x306c, 0x306d, 0x306e, 0x306f,
+ 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077,
+ 0x3078, 0x3079, 0x307a, 0x307b, 0x307c, 0x307d, 0x307e, 0x307f,
+ 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087,
+ 0x3088, 0x3089, 0x308a, 0x308b, 0x308c, 0x308d, 0x308e, 0x308f,
+ 0x3090, 0x3091, 0x3092, 0x3093, 0x3094, 0x3095, 0x3096, 0x0000,
+ 0x0000, 0x3099, 0x309a, 0x309b, 0x309c, 0x309d, 0x309e, 0x309f,
+ 0x30a0, 0x30a1, 0x30a2, 0x30a3, 0x30a4, 0x30a5, 0x30a6, 0x30a7,
+ 0x30a8, 0x30a9, 0x30aa, 0x30ab, 0x30ac, 0x30ad, 0x30ae, 0x30af,
+ 0x30b0, 0x30b1, 0x30b2, 0x30b3, 0x30b4, 0x30b5, 0x30b6, 0x30b7,
+ 0x30b8, 0x30b9, 0x30ba, 0x30bb, 0x30bc, 0x30bd, 0x30be, 0x30bf,
+ 0x30c0, 0x30c1, 0x30c2, 0x30c3, 0x30c4, 0x30c5, 0x30c6, 0x30c7,
+ 0x30c8, 0x30c9, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf,
+ 0x30d0, 0x30d1, 0x30d2, 0x30d3, 0x30d4, 0x30d5, 0x30d6, 0x30d7,
+ 0x30d8, 0x30d9, 0x30da, 0x30db, 0x30dc, 0x30dd, 0x30de, 0x30df,
+ 0x30e0, 0x30e1, 0x30e2, 0x30e3, 0x30e4, 0x30e5, 0x30e6, 0x30e7,
+ 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ee, 0x30ef,
+ 0x30f0, 0x30f1, 0x30f2, 0x30f3, 0x30f4, 0x30f5, 0x30f6, 0x30f7,
+ 0x30f8, 0x30f9, 0x30fa, 0x30fb, 0x30fc, 0x30fd, 0x30fe, 0x30ff,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3105, 0x3106, 0x3107,
+ 0x3108, 0x3109, 0x310a, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f,
+ 0x3110, 0x3111, 0x3112, 0x3113, 0x3114, 0x3115, 0x3116, 0x3117,
+ 0x3118, 0x3119, 0x311a, 0x311b, 0x311c, 0x311d, 0x311e, 0x311f,
+ 0x3120, 0x3121, 0x3122, 0x3123, 0x3124, 0x3125, 0x3126, 0x3127,
+ 0x3128, 0x3129, 0x312a, 0x312b, 0x312c, 0x312d, 0x0000, 0x0000,
+ 0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137,
+ 0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f,
+ 0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147,
+ 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f,
+ 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157,
+ 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f,
+ 0x3160, 0x3161, 0x3162, 0x3163, 0x3164, 0x3165, 0x3166, 0x3167,
+ 0x3168, 0x3169, 0x316a, 0x316b, 0x316c, 0x316d, 0x316e, 0x316f,
+ 0x3170, 0x3171, 0x3172, 0x3173, 0x3174, 0x3175, 0x3176, 0x3177,
+ 0x3178, 0x3179, 0x317a, 0x317b, 0x317c, 0x317d, 0x317e, 0x317f,
+ 0x3180, 0x3181, 0x3182, 0x3183, 0x3184, 0x3185, 0x3186, 0x3187,
+ 0x3188, 0x3189, 0x318a, 0x318b, 0x318c, 0x318d, 0x318e, 0x0000,
+ 0x3190, 0x3191, 0x3192, 0x3193, 0x3194, 0x3195, 0x3196, 0x3197,
+ 0x3198, 0x3199, 0x319a, 0x319b, 0x319c, 0x319d, 0x319e, 0x319f,
+ 0x31a0, 0x31a1, 0x31a2, 0x31a3, 0x31a4, 0x31a5, 0x31a6, 0x31a7,
+ 0x31a8, 0x31a9, 0x31aa, 0x31ab, 0x31ac, 0x31ad, 0x31ae, 0x31af,
+ 0x31b0, 0x31b1, 0x31b2, 0x31b3, 0x31b4, 0x31b5, 0x31b6, 0x31b7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x31c0, 0x31c1, 0x31c2, 0x31c3, 0x31c4, 0x31c5, 0x31c6, 0x31c7,
+ 0x31c8, 0x31c9, 0x31ca, 0x31cb, 0x31cc, 0x31cd, 0x31ce, 0x31cf,
+ 0x31d0, 0x31d1, 0x31d2, 0x31d3, 0x31d4, 0x31d5, 0x31d6, 0x31d7,
+ 0x31d8, 0x31d9, 0x31da, 0x31db, 0x31dc, 0x31dd, 0x31de, 0x31df,
+ 0x31e0, 0x31e1, 0x31e2, 0x31e3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x31f0, 0x31f1, 0x31f2, 0x31f3, 0x31f4, 0x31f5, 0x31f6, 0x31f7,
+ 0x31f8, 0x31f9, 0x31fa, 0x31fb, 0x31fc, 0x31fd, 0x31fe, 0x31ff,
+ 0x3200, 0x3201, 0x3202, 0x3203, 0x3204, 0x3205, 0x3206, 0x3207,
+ 0x3208, 0x3209, 0x320a, 0x320b, 0x320c, 0x320d, 0x320e, 0x320f,
+ 0x3210, 0x3211, 0x3212, 0x3213, 0x3214, 0x3215, 0x3216, 0x3217,
+ 0x3218, 0x3219, 0x321a, 0x321b, 0x321c, 0x321d, 0x321e, 0x0000,
+ 0x3220, 0x3221, 0x3222, 0x3223, 0x3224, 0x3225, 0x3226, 0x3227,
+ 0x3228, 0x3229, 0x322a, 0x322b, 0x322c, 0x322d, 0x322e, 0x322f,
+ 0x3230, 0x3231, 0x3232, 0x3233, 0x3234, 0x3235, 0x3236, 0x3237,
+ 0x3238, 0x3239, 0x323a, 0x323b, 0x323c, 0x323d, 0x323e, 0x323f,
+ 0x3240, 0x3241, 0x3242, 0x3243, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3250, 0x3251, 0x3252, 0x3253, 0x3254, 0x3255, 0x3256, 0x3257,
+ 0x3258, 0x3259, 0x325a, 0x325b, 0x325c, 0x325d, 0x325e, 0x325f,
+ 0x3260, 0x3261, 0x3262, 0x3263, 0x3264, 0x3265, 0x3266, 0x3267,
+ 0x3268, 0x3269, 0x326a, 0x326b, 0x326c, 0x326d, 0x326e, 0x326f,
+ 0x3270, 0x3271, 0x3272, 0x3273, 0x3274, 0x3275, 0x3276, 0x3277,
+ 0x3278, 0x3279, 0x327a, 0x327b, 0x327c, 0x327d, 0x327e, 0x327f,
+ 0x3280, 0x3281, 0x3282, 0x3283, 0x3284, 0x3285, 0x3286, 0x3287,
+ 0x3288, 0x3289, 0x328a, 0x328b, 0x328c, 0x328d, 0x328e, 0x328f,
+ 0x3290, 0x3291, 0x3292, 0x3293, 0x3294, 0x3295, 0x3296, 0x3297,
+ 0x3298, 0x3299, 0x329a, 0x329b, 0x329c, 0x329d, 0x329e, 0x329f,
+ 0x32a0, 0x32a1, 0x32a2, 0x32a3, 0x32a4, 0x32a5, 0x32a6, 0x32a7,
+ 0x32a8, 0x32a9, 0x32aa, 0x32ab, 0x32ac, 0x32ad, 0x32ae, 0x32af,
+ 0x32b0, 0x32b1, 0x32b2, 0x32b3, 0x32b4, 0x32b5, 0x32b6, 0x32b7,
+ 0x32b8, 0x32b9, 0x32ba, 0x32bb, 0x32bc, 0x32bd, 0x32be, 0x32bf,
+ 0x32c0, 0x32c1, 0x32c2, 0x32c3, 0x32c4, 0x32c5, 0x32c6, 0x32c7,
+ 0x32c8, 0x32c9, 0x32ca, 0x32cb, 0x32cc, 0x32cd, 0x32ce, 0x32cf,
+ 0x32d0, 0x32d1, 0x32d2, 0x32d3, 0x32d4, 0x32d5, 0x32d6, 0x32d7,
+ 0x32d8, 0x32d9, 0x32da, 0x32db, 0x32dc, 0x32dd, 0x32de, 0x32df,
+ 0x32e0, 0x32e1, 0x32e2, 0x32e3, 0x32e4, 0x32e5, 0x32e6, 0x32e7,
+ 0x32e8, 0x32e9, 0x32ea, 0x32eb, 0x32ec, 0x32ed, 0x32ee, 0x32ef,
+ 0x32f0, 0x32f1, 0x32f2, 0x32f3, 0x32f4, 0x32f5, 0x32f6, 0x32f7,
+ 0x32f8, 0x32f9, 0x32fa, 0x32fb, 0x32fc, 0x32fd, 0x32fe, 0x0000,
+ 0x3300, 0x3301, 0x3302, 0x3303, 0x3304, 0x3305, 0x3306, 0x3307,
+ 0x3308, 0x3309, 0x330a, 0x330b, 0x330c, 0x330d, 0x330e, 0x330f,
+ 0x3310, 0x3311, 0x3312, 0x3313, 0x3314, 0x3315, 0x3316, 0x3317,
+ 0x3318, 0x3319, 0x331a, 0x331b, 0x331c, 0x331d, 0x331e, 0x331f,
+ 0x3320, 0x3321, 0x3322, 0x3323, 0x3324, 0x3325, 0x3326, 0x3327,
+ 0x3328, 0x3329, 0x332a, 0x332b, 0x332c, 0x332d, 0x332e, 0x332f,
+ 0x3330, 0x3331, 0x3332, 0x3333, 0x3334, 0x3335, 0x3336, 0x3337,
+ 0x3338, 0x3339, 0x333a, 0x333b, 0x333c, 0x333d, 0x333e, 0x333f,
+ 0x3340, 0x3341, 0x3342, 0x3343, 0x3344, 0x3345, 0x3346, 0x3347,
+ 0x3348, 0x3349, 0x334a, 0x334b, 0x334c, 0x334d, 0x334e, 0x334f,
+ 0x3350, 0x3351, 0x3352, 0x3353, 0x3354, 0x3355, 0x3356, 0x3357,
+ 0x3358, 0x3359, 0x335a, 0x335b, 0x335c, 0x335d, 0x335e, 0x335f,
+ 0x3360, 0x3361, 0x3362, 0x3363, 0x3364, 0x3365, 0x3366, 0x3367,
+ 0x3368, 0x3369, 0x336a, 0x336b, 0x336c, 0x336d, 0x336e, 0x336f,
+ 0x3370, 0x3371, 0x3372, 0x3373, 0x3374, 0x3375, 0x3376, 0x3377,
+ 0x3378, 0x3379, 0x337a, 0x337b, 0x337c, 0x337d, 0x337e, 0x337f,
+ 0x3380, 0x3381, 0x3382, 0x3383, 0x3384, 0x3385, 0x3386, 0x3387,
+ 0x3388, 0x3389, 0x338a, 0x338b, 0x338c, 0x338d, 0x338e, 0x338f,
+ 0x3390, 0x3391, 0x3392, 0x3393, 0x3394, 0x3395, 0x3396, 0x3397,
+ 0x3398, 0x3399, 0x339a, 0x339b, 0x339c, 0x339d, 0x339e, 0x339f,
+ 0x33a0, 0x33a1, 0x33a2, 0x33a3, 0x33a4, 0x33a5, 0x33a6, 0x33a7,
+ 0x33a8, 0x33a9, 0x33aa, 0x33ab, 0x33ac, 0x33ad, 0x33ae, 0x33af,
+ 0x33b0, 0x33b1, 0x33b2, 0x33b3, 0x33b4, 0x33b5, 0x33b6, 0x33b7,
+ 0x33b8, 0x33b9, 0x33ba, 0x33bb, 0x33bc, 0x33bd, 0x33be, 0x33bf,
+ 0x33c0, 0x33c1, 0x33c2, 0x33c3, 0x33c4, 0x33c5, 0x33c6, 0x33c7,
+ 0x33c8, 0x33c9, 0x33ca, 0x33cb, 0x33cc, 0x33cd, 0x33ce, 0x33cf,
+ 0x33d0, 0x33d1, 0x33d2, 0x33d3, 0x33d4, 0x33d5, 0x33d6, 0x33d7,
+ 0x33d8, 0x33d9, 0x33da, 0x33db, 0x33dc, 0x33dd, 0x33de, 0x33df,
+ 0x33e0, 0x33e1, 0x33e2, 0x33e3, 0x33e4, 0x33e5, 0x33e6, 0x33e7,
+ 0x33e8, 0x33e9, 0x33ea, 0x33eb, 0x33ec, 0x33ed, 0x33ee, 0x33ef,
+ 0x33f0, 0x33f1, 0x33f2, 0x33f3, 0x33f4, 0x33f5, 0x33f6, 0x33f7,
+ 0x33f8, 0x33f9, 0x33fa, 0x33fb, 0x33fc, 0x33fd, 0x33fe, 0x33ff,
+ 0x3400, 0x3401, 0x3402, 0x3403, 0x3404, 0x3405, 0x3406, 0x3407,
+ 0x3408, 0x3409, 0x340a, 0x340b, 0x340c, 0x340d, 0x340e, 0x340f,
+ 0x3410, 0x3411, 0x3412, 0x3413, 0x3414, 0x3415, 0x3416, 0x3417,
+ 0x3418, 0x3419, 0x341a, 0x341b, 0x341c, 0x341d, 0x341e, 0x341f,
+ 0x3420, 0x3421, 0x3422, 0x3423, 0x3424, 0x3425, 0x3426, 0x3427,
+ 0x3428, 0x3429, 0x342a, 0x342b, 0x342c, 0x342d, 0x342e, 0x342f,
+ 0x3430, 0x3431, 0x3432, 0x3433, 0x3434, 0x3435, 0x3436, 0x3437,
+ 0x3438, 0x3439, 0x343a, 0x343b, 0x343c, 0x343d, 0x343e, 0x343f,
+ 0x3440, 0x3441, 0x3442, 0x3443, 0x3444, 0x3445, 0x3446, 0x3447,
+ 0x3448, 0x3449, 0x344a, 0x344b, 0x344c, 0x344d, 0x344e, 0x344f,
+ 0x3450, 0x3451, 0x3452, 0x3453, 0x3454, 0x3455, 0x3456, 0x3457,
+ 0x3458, 0x3459, 0x345a, 0x345b, 0x345c, 0x345d, 0x345e, 0x345f,
+ 0x3460, 0x3461, 0x3462, 0x3463, 0x3464, 0x3465, 0x3466, 0x3467,
+ 0x3468, 0x3469, 0x346a, 0x346b, 0x346c, 0x346d, 0x346e, 0x346f,
+ 0x3470, 0x3471, 0x3472, 0x3473, 0x3474, 0x3475, 0x3476, 0x3477,
+ 0x3478, 0x3479, 0x347a, 0x347b, 0x347c, 0x347d, 0x347e, 0x347f,
+ 0x3480, 0x3481, 0x3482, 0x3483, 0x3484, 0x3485, 0x3486, 0x3487,
+ 0x3488, 0x3489, 0x348a, 0x348b, 0x348c, 0x348d, 0x348e, 0x348f,
+ 0x3490, 0x3491, 0x3492, 0x3493, 0x3494, 0x3495, 0x3496, 0x3497,
+ 0x3498, 0x3499, 0x349a, 0x349b, 0x349c, 0x349d, 0x349e, 0x349f,
+ 0x34a0, 0x34a1, 0x34a2, 0x34a3, 0x34a4, 0x34a5, 0x34a6, 0x34a7,
+ 0x34a8, 0x34a9, 0x34aa, 0x34ab, 0x34ac, 0x34ad, 0x34ae, 0x34af,
+ 0x34b0, 0x34b1, 0x34b2, 0x34b3, 0x34b4, 0x34b5, 0x34b6, 0x34b7,
+ 0x34b8, 0x34b9, 0x34ba, 0x34bb, 0x34bc, 0x34bd, 0x34be, 0x34bf,
+ 0x34c0, 0x34c1, 0x34c2, 0x34c3, 0x34c4, 0x34c5, 0x34c6, 0x34c7,
+ 0x34c8, 0x34c9, 0x34ca, 0x34cb, 0x34cc, 0x34cd, 0x34ce, 0x34cf,
+ 0x34d0, 0x34d1, 0x34d2, 0x34d3, 0x34d4, 0x34d5, 0x34d6, 0x34d7,
+ 0x34d8, 0x34d9, 0x34da, 0x34db, 0x34dc, 0x34dd, 0x34de, 0x34df,
+ 0x34e0, 0x34e1, 0x34e2, 0x34e3, 0x34e4, 0x34e5, 0x34e6, 0x34e7,
+ 0x34e8, 0x34e9, 0x34ea, 0x34eb, 0x34ec, 0x34ed, 0x34ee, 0x34ef,
+ 0x34f0, 0x34f1, 0x34f2, 0x34f3, 0x34f4, 0x34f5, 0x34f6, 0x34f7,
+ 0x34f8, 0x34f9, 0x34fa, 0x34fb, 0x34fc, 0x34fd, 0x34fe, 0x34ff,
+ 0x3500, 0x3501, 0x3502, 0x3503, 0x3504, 0x3505, 0x3506, 0x3507,
+ 0x3508, 0x3509, 0x350a, 0x350b, 0x350c, 0x350d, 0x350e, 0x350f,
+ 0x3510, 0x3511, 0x3512, 0x3513, 0x3514, 0x3515, 0x3516, 0x3517,
+ 0x3518, 0x3519, 0x351a, 0x351b, 0x351c, 0x351d, 0x351e, 0x351f,
+ 0x3520, 0x3521, 0x3522, 0x3523, 0x3524, 0x3525, 0x3526, 0x3527,
+ 0x3528, 0x3529, 0x352a, 0x352b, 0x352c, 0x352d, 0x352e, 0x352f,
+ 0x3530, 0x3531, 0x3532, 0x3533, 0x3534, 0x3535, 0x3536, 0x3537,
+ 0x3538, 0x3539, 0x353a, 0x353b, 0x353c, 0x353d, 0x353e, 0x353f,
+ 0x3540, 0x3541, 0x3542, 0x3543, 0x3544, 0x3545, 0x3546, 0x3547,
+ 0x3548, 0x3549, 0x354a, 0x354b, 0x354c, 0x354d, 0x354e, 0x354f,
+ 0x3550, 0x3551, 0x3552, 0x3553, 0x3554, 0x3555, 0x3556, 0x3557,
+ 0x3558, 0x3559, 0x355a, 0x355b, 0x355c, 0x355d, 0x355e, 0x355f,
+ 0x3560, 0x3561, 0x3562, 0x3563, 0x3564, 0x3565, 0x3566, 0x3567,
+ 0x3568, 0x3569, 0x356a, 0x356b, 0x356c, 0x356d, 0x356e, 0x356f,
+ 0x3570, 0x3571, 0x3572, 0x3573, 0x3574, 0x3575, 0x3576, 0x3577,
+ 0x3578, 0x3579, 0x357a, 0x357b, 0x357c, 0x357d, 0x357e, 0x357f,
+ 0x3580, 0x3581, 0x3582, 0x3583, 0x3584, 0x3585, 0x3586, 0x3587,
+ 0x3588, 0x3589, 0x358a, 0x358b, 0x358c, 0x358d, 0x358e, 0x358f,
+ 0x3590, 0x3591, 0x3592, 0x3593, 0x3594, 0x3595, 0x3596, 0x3597,
+ 0x3598, 0x3599, 0x359a, 0x359b, 0x359c, 0x359d, 0x359e, 0x359f,
+ 0x35a0, 0x35a1, 0x35a2, 0x35a3, 0x35a4, 0x35a5, 0x35a6, 0x35a7,
+ 0x35a8, 0x35a9, 0x35aa, 0x35ab, 0x35ac, 0x35ad, 0x35ae, 0x35af,
+ 0x35b0, 0x35b1, 0x35b2, 0x35b3, 0x35b4, 0x35b5, 0x35b6, 0x35b7,
+ 0x35b8, 0x35b9, 0x35ba, 0x35bb, 0x35bc, 0x35bd, 0x35be, 0x35bf,
+ 0x35c0, 0x35c1, 0x35c2, 0x35c3, 0x35c4, 0x35c5, 0x35c6, 0x35c7,
+ 0x35c8, 0x35c9, 0x35ca, 0x35cb, 0x35cc, 0x35cd, 0x35ce, 0x35cf,
+ 0x35d0, 0x35d1, 0x35d2, 0x35d3, 0x35d4, 0x35d5, 0x35d6, 0x35d7,
+ 0x35d8, 0x35d9, 0x35da, 0x35db, 0x35dc, 0x35dd, 0x35de, 0x35df,
+ 0x35e0, 0x35e1, 0x35e2, 0x35e3, 0x35e4, 0x35e5, 0x35e6, 0x35e7,
+ 0x35e8, 0x35e9, 0x35ea, 0x35eb, 0x35ec, 0x35ed, 0x35ee, 0x35ef,
+ 0x35f0, 0x35f1, 0x35f2, 0x35f3, 0x35f4, 0x35f5, 0x35f6, 0x35f7,
+ 0x35f8, 0x35f9, 0x35fa, 0x35fb, 0x35fc, 0x35fd, 0x35fe, 0x35ff,
+ 0x3600, 0x3601, 0x3602, 0x3603, 0x3604, 0x3605, 0x3606, 0x3607,
+ 0x3608, 0x3609, 0x360a, 0x360b, 0x360c, 0x360d, 0x360e, 0x360f,
+ 0x3610, 0x3611, 0x3612, 0x3613, 0x3614, 0x3615, 0x3616, 0x3617,
+ 0x3618, 0x3619, 0x361a, 0x361b, 0x361c, 0x361d, 0x361e, 0x361f,
+ 0x3620, 0x3621, 0x3622, 0x3623, 0x3624, 0x3625, 0x3626, 0x3627,
+ 0x3628, 0x3629, 0x362a, 0x362b, 0x362c, 0x362d, 0x362e, 0x362f,
+ 0x3630, 0x3631, 0x3632, 0x3633, 0x3634, 0x3635, 0x3636, 0x3637,
+ 0x3638, 0x3639, 0x363a, 0x363b, 0x363c, 0x363d, 0x363e, 0x363f,
+ 0x3640, 0x3641, 0x3642, 0x3643, 0x3644, 0x3645, 0x3646, 0x3647,
+ 0x3648, 0x3649, 0x364a, 0x364b, 0x364c, 0x364d, 0x364e, 0x364f,
+ 0x3650, 0x3651, 0x3652, 0x3653, 0x3654, 0x3655, 0x3656, 0x3657,
+ 0x3658, 0x3659, 0x365a, 0x365b, 0x365c, 0x365d, 0x365e, 0x365f,
+ 0x3660, 0x3661, 0x3662, 0x3663, 0x3664, 0x3665, 0x3666, 0x3667,
+ 0x3668, 0x3669, 0x366a, 0x366b, 0x366c, 0x366d, 0x366e, 0x366f,
+ 0x3670, 0x3671, 0x3672, 0x3673, 0x3674, 0x3675, 0x3676, 0x3677,
+ 0x3678, 0x3679, 0x367a, 0x367b, 0x367c, 0x367d, 0x367e, 0x367f,
+ 0x3680, 0x3681, 0x3682, 0x3683, 0x3684, 0x3685, 0x3686, 0x3687,
+ 0x3688, 0x3689, 0x368a, 0x368b, 0x368c, 0x368d, 0x368e, 0x368f,
+ 0x3690, 0x3691, 0x3692, 0x3693, 0x3694, 0x3695, 0x3696, 0x3697,
+ 0x3698, 0x3699, 0x369a, 0x369b, 0x369c, 0x369d, 0x369e, 0x369f,
+ 0x36a0, 0x36a1, 0x36a2, 0x36a3, 0x36a4, 0x36a5, 0x36a6, 0x36a7,
+ 0x36a8, 0x36a9, 0x36aa, 0x36ab, 0x36ac, 0x36ad, 0x36ae, 0x36af,
+ 0x36b0, 0x36b1, 0x36b2, 0x36b3, 0x36b4, 0x36b5, 0x36b6, 0x36b7,
+ 0x36b8, 0x36b9, 0x36ba, 0x36bb, 0x36bc, 0x36bd, 0x36be, 0x36bf,
+ 0x36c0, 0x36c1, 0x36c2, 0x36c3, 0x36c4, 0x36c5, 0x36c6, 0x36c7,
+ 0x36c8, 0x36c9, 0x36ca, 0x36cb, 0x36cc, 0x36cd, 0x36ce, 0x36cf,
+ 0x36d0, 0x36d1, 0x36d2, 0x36d3, 0x36d4, 0x36d5, 0x36d6, 0x36d7,
+ 0x36d8, 0x36d9, 0x36da, 0x36db, 0x36dc, 0x36dd, 0x36de, 0x36df,
+ 0x36e0, 0x36e1, 0x36e2, 0x36e3, 0x36e4, 0x36e5, 0x36e6, 0x36e7,
+ 0x36e8, 0x36e9, 0x36ea, 0x36eb, 0x36ec, 0x36ed, 0x36ee, 0x36ef,
+ 0x36f0, 0x36f1, 0x36f2, 0x36f3, 0x36f4, 0x36f5, 0x36f6, 0x36f7,
+ 0x36f8, 0x36f9, 0x36fa, 0x36fb, 0x36fc, 0x36fd, 0x36fe, 0x36ff,
+ 0x3700, 0x3701, 0x3702, 0x3703, 0x3704, 0x3705, 0x3706, 0x3707,
+ 0x3708, 0x3709, 0x370a, 0x370b, 0x370c, 0x370d, 0x370e, 0x370f,
+ 0x3710, 0x3711, 0x3712, 0x3713, 0x3714, 0x3715, 0x3716, 0x3717,
+ 0x3718, 0x3719, 0x371a, 0x371b, 0x371c, 0x371d, 0x371e, 0x371f,
+ 0x3720, 0x3721, 0x3722, 0x3723, 0x3724, 0x3725, 0x3726, 0x3727,
+ 0x3728, 0x3729, 0x372a, 0x372b, 0x372c, 0x372d, 0x372e, 0x372f,
+ 0x3730, 0x3731, 0x3732, 0x3733, 0x3734, 0x3735, 0x3736, 0x3737,
+ 0x3738, 0x3739, 0x373a, 0x373b, 0x373c, 0x373d, 0x373e, 0x373f,
+ 0x3740, 0x3741, 0x3742, 0x3743, 0x3744, 0x3745, 0x3746, 0x3747,
+ 0x3748, 0x3749, 0x374a, 0x374b, 0x374c, 0x374d, 0x374e, 0x374f,
+ 0x3750, 0x3751, 0x3752, 0x3753, 0x3754, 0x3755, 0x3756, 0x3757,
+ 0x3758, 0x3759, 0x375a, 0x375b, 0x375c, 0x375d, 0x375e, 0x375f,
+ 0x3760, 0x3761, 0x3762, 0x3763, 0x3764, 0x3765, 0x3766, 0x3767,
+ 0x3768, 0x3769, 0x376a, 0x376b, 0x376c, 0x376d, 0x376e, 0x376f,
+ 0x3770, 0x3771, 0x3772, 0x3773, 0x3774, 0x3775, 0x3776, 0x3777,
+ 0x3778, 0x3779, 0x377a, 0x377b, 0x377c, 0x377d, 0x377e, 0x377f,
+ 0x3780, 0x3781, 0x3782, 0x3783, 0x3784, 0x3785, 0x3786, 0x3787,
+ 0x3788, 0x3789, 0x378a, 0x378b, 0x378c, 0x378d, 0x378e, 0x378f,
+ 0x3790, 0x3791, 0x3792, 0x3793, 0x3794, 0x3795, 0x3796, 0x3797,
+ 0x3798, 0x3799, 0x379a, 0x379b, 0x379c, 0x379d, 0x379e, 0x379f,
+ 0x37a0, 0x37a1, 0x37a2, 0x37a3, 0x37a4, 0x37a5, 0x37a6, 0x37a7,
+ 0x37a8, 0x37a9, 0x37aa, 0x37ab, 0x37ac, 0x37ad, 0x37ae, 0x37af,
+ 0x37b0, 0x37b1, 0x37b2, 0x37b3, 0x37b4, 0x37b5, 0x37b6, 0x37b7,
+ 0x37b8, 0x37b9, 0x37ba, 0x37bb, 0x37bc, 0x37bd, 0x37be, 0x37bf,
+ 0x37c0, 0x37c1, 0x37c2, 0x37c3, 0x37c4, 0x37c5, 0x37c6, 0x37c7,
+ 0x37c8, 0x37c9, 0x37ca, 0x37cb, 0x37cc, 0x37cd, 0x37ce, 0x37cf,
+ 0x37d0, 0x37d1, 0x37d2, 0x37d3, 0x37d4, 0x37d5, 0x37d6, 0x37d7,
+ 0x37d8, 0x37d9, 0x37da, 0x37db, 0x37dc, 0x37dd, 0x37de, 0x37df,
+ 0x37e0, 0x37e1, 0x37e2, 0x37e3, 0x37e4, 0x37e5, 0x37e6, 0x37e7,
+ 0x37e8, 0x37e9, 0x37ea, 0x37eb, 0x37ec, 0x37ed, 0x37ee, 0x37ef,
+ 0x37f0, 0x37f1, 0x37f2, 0x37f3, 0x37f4, 0x37f5, 0x37f6, 0x37f7,
+ 0x37f8, 0x37f9, 0x37fa, 0x37fb, 0x37fc, 0x37fd, 0x37fe, 0x37ff,
+ 0x3800, 0x3801, 0x3802, 0x3803, 0x3804, 0x3805, 0x3806, 0x3807,
+ 0x3808, 0x3809, 0x380a, 0x380b, 0x380c, 0x380d, 0x380e, 0x380f,
+ 0x3810, 0x3811, 0x3812, 0x3813, 0x3814, 0x3815, 0x3816, 0x3817,
+ 0x3818, 0x3819, 0x381a, 0x381b, 0x381c, 0x381d, 0x381e, 0x381f,
+ 0x3820, 0x3821, 0x3822, 0x3823, 0x3824, 0x3825, 0x3826, 0x3827,
+ 0x3828, 0x3829, 0x382a, 0x382b, 0x382c, 0x382d, 0x382e, 0x382f,
+ 0x3830, 0x3831, 0x3832, 0x3833, 0x3834, 0x3835, 0x3836, 0x3837,
+ 0x3838, 0x3839, 0x383a, 0x383b, 0x383c, 0x383d, 0x383e, 0x383f,
+ 0x3840, 0x3841, 0x3842, 0x3843, 0x3844, 0x3845, 0x3846, 0x3847,
+ 0x3848, 0x3849, 0x384a, 0x384b, 0x384c, 0x384d, 0x384e, 0x384f,
+ 0x3850, 0x3851, 0x3852, 0x3853, 0x3854, 0x3855, 0x3856, 0x3857,
+ 0x3858, 0x3859, 0x385a, 0x385b, 0x385c, 0x385d, 0x385e, 0x385f,
+ 0x3860, 0x3861, 0x3862, 0x3863, 0x3864, 0x3865, 0x3866, 0x3867,
+ 0x3868, 0x3869, 0x386a, 0x386b, 0x386c, 0x386d, 0x386e, 0x386f,
+ 0x3870, 0x3871, 0x3872, 0x3873, 0x3874, 0x3875, 0x3876, 0x3877,
+ 0x3878, 0x3879, 0x387a, 0x387b, 0x387c, 0x387d, 0x387e, 0x387f,
+ 0x3880, 0x3881, 0x3882, 0x3883, 0x3884, 0x3885, 0x3886, 0x3887,
+ 0x3888, 0x3889, 0x388a, 0x388b, 0x388c, 0x388d, 0x388e, 0x388f,
+ 0x3890, 0x3891, 0x3892, 0x3893, 0x3894, 0x3895, 0x3896, 0x3897,
+ 0x3898, 0x3899, 0x389a, 0x389b, 0x389c, 0x389d, 0x389e, 0x389f,
+ 0x38a0, 0x38a1, 0x38a2, 0x38a3, 0x38a4, 0x38a5, 0x38a6, 0x38a7,
+ 0x38a8, 0x38a9, 0x38aa, 0x38ab, 0x38ac, 0x38ad, 0x38ae, 0x38af,
+ 0x38b0, 0x38b1, 0x38b2, 0x38b3, 0x38b4, 0x38b5, 0x38b6, 0x38b7,
+ 0x38b8, 0x38b9, 0x38ba, 0x38bb, 0x38bc, 0x38bd, 0x38be, 0x38bf,
+ 0x38c0, 0x38c1, 0x38c2, 0x38c3, 0x38c4, 0x38c5, 0x38c6, 0x38c7,
+ 0x38c8, 0x38c9, 0x38ca, 0x38cb, 0x38cc, 0x38cd, 0x38ce, 0x38cf,
+ 0x38d0, 0x38d1, 0x38d2, 0x38d3, 0x38d4, 0x38d5, 0x38d6, 0x38d7,
+ 0x38d8, 0x38d9, 0x38da, 0x38db, 0x38dc, 0x38dd, 0x38de, 0x38df,
+ 0x38e0, 0x38e1, 0x38e2, 0x38e3, 0x38e4, 0x38e5, 0x38e6, 0x38e7,
+ 0x38e8, 0x38e9, 0x38ea, 0x38eb, 0x38ec, 0x38ed, 0x38ee, 0x38ef,
+ 0x38f0, 0x38f1, 0x38f2, 0x38f3, 0x38f4, 0x38f5, 0x38f6, 0x38f7,
+ 0x38f8, 0x38f9, 0x38fa, 0x38fb, 0x38fc, 0x38fd, 0x38fe, 0x38ff,
+ 0x3900, 0x3901, 0x3902, 0x3903, 0x3904, 0x3905, 0x3906, 0x3907,
+ 0x3908, 0x3909, 0x390a, 0x390b, 0x390c, 0x390d, 0x390e, 0x390f,
+ 0x3910, 0x3911, 0x3912, 0x3913, 0x3914, 0x3915, 0x3916, 0x3917,
+ 0x3918, 0x3919, 0x391a, 0x391b, 0x391c, 0x391d, 0x391e, 0x391f,
+ 0x3920, 0x3921, 0x3922, 0x3923, 0x3924, 0x3925, 0x3926, 0x3927,
+ 0x3928, 0x3929, 0x392a, 0x392b, 0x392c, 0x392d, 0x392e, 0x392f,
+ 0x3930, 0x3931, 0x3932, 0x3933, 0x3934, 0x3935, 0x3936, 0x3937,
+ 0x3938, 0x3939, 0x393a, 0x393b, 0x393c, 0x393d, 0x393e, 0x393f,
+ 0x3940, 0x3941, 0x3942, 0x3943, 0x3944, 0x3945, 0x3946, 0x3947,
+ 0x3948, 0x3949, 0x394a, 0x394b, 0x394c, 0x394d, 0x394e, 0x394f,
+ 0x3950, 0x3951, 0x3952, 0x3953, 0x3954, 0x3955, 0x3956, 0x3957,
+ 0x3958, 0x3959, 0x395a, 0x395b, 0x395c, 0x395d, 0x395e, 0x395f,
+ 0x3960, 0x3961, 0x3962, 0x3963, 0x3964, 0x3965, 0x3966, 0x3967,
+ 0x3968, 0x3969, 0x396a, 0x396b, 0x396c, 0x396d, 0x396e, 0x396f,
+ 0x3970, 0x3971, 0x3972, 0x3973, 0x3974, 0x3975, 0x3976, 0x3977,
+ 0x3978, 0x3979, 0x397a, 0x397b, 0x397c, 0x397d, 0x397e, 0x397f,
+ 0x3980, 0x3981, 0x3982, 0x3983, 0x3984, 0x3985, 0x3986, 0x3987,
+ 0x3988, 0x3989, 0x398a, 0x398b, 0x398c, 0x398d, 0x398e, 0x398f,
+ 0x3990, 0x3991, 0x3992, 0x3993, 0x3994, 0x3995, 0x3996, 0x3997,
+ 0x3998, 0x3999, 0x399a, 0x399b, 0x399c, 0x399d, 0x399e, 0x399f,
+ 0x39a0, 0x39a1, 0x39a2, 0x39a3, 0x39a4, 0x39a5, 0x39a6, 0x39a7,
+ 0x39a8, 0x39a9, 0x39aa, 0x39ab, 0x39ac, 0x39ad, 0x39ae, 0x39af,
+ 0x39b0, 0x39b1, 0x39b2, 0x39b3, 0x39b4, 0x39b5, 0x39b6, 0x39b7,
+ 0x39b8, 0x39b9, 0x39ba, 0x39bb, 0x39bc, 0x39bd, 0x39be, 0x39bf,
+ 0x39c0, 0x39c1, 0x39c2, 0x39c3, 0x39c4, 0x39c5, 0x39c6, 0x39c7,
+ 0x39c8, 0x39c9, 0x39ca, 0x39cb, 0x39cc, 0x39cd, 0x39ce, 0x39cf,
+ 0x39d0, 0x39d1, 0x39d2, 0x39d3, 0x39d4, 0x39d5, 0x39d6, 0x39d7,
+ 0x39d8, 0x39d9, 0x39da, 0x39db, 0x39dc, 0x39dd, 0x39de, 0x39df,
+ 0x39e0, 0x39e1, 0x39e2, 0x39e3, 0x39e4, 0x39e5, 0x39e6, 0x39e7,
+ 0x39e8, 0x39e9, 0x39ea, 0x39eb, 0x39ec, 0x39ed, 0x39ee, 0x39ef,
+ 0x39f0, 0x39f1, 0x39f2, 0x39f3, 0x39f4, 0x39f5, 0x39f6, 0x39f7,
+ 0x39f8, 0x39f9, 0x39fa, 0x39fb, 0x39fc, 0x39fd, 0x39fe, 0x39ff,
+ 0x3a00, 0x3a01, 0x3a02, 0x3a03, 0x3a04, 0x3a05, 0x3a06, 0x3a07,
+ 0x3a08, 0x3a09, 0x3a0a, 0x3a0b, 0x3a0c, 0x3a0d, 0x3a0e, 0x3a0f,
+ 0x3a10, 0x3a11, 0x3a12, 0x3a13, 0x3a14, 0x3a15, 0x3a16, 0x3a17,
+ 0x3a18, 0x3a19, 0x3a1a, 0x3a1b, 0x3a1c, 0x3a1d, 0x3a1e, 0x3a1f,
+ 0x3a20, 0x3a21, 0x3a22, 0x3a23, 0x3a24, 0x3a25, 0x3a26, 0x3a27,
+ 0x3a28, 0x3a29, 0x3a2a, 0x3a2b, 0x3a2c, 0x3a2d, 0x3a2e, 0x3a2f,
+ 0x3a30, 0x3a31, 0x3a32, 0x3a33, 0x3a34, 0x3a35, 0x3a36, 0x3a37,
+ 0x3a38, 0x3a39, 0x3a3a, 0x3a3b, 0x3a3c, 0x3a3d, 0x3a3e, 0x3a3f,
+ 0x3a40, 0x3a41, 0x3a42, 0x3a43, 0x3a44, 0x3a45, 0x3a46, 0x3a47,
+ 0x3a48, 0x3a49, 0x3a4a, 0x3a4b, 0x3a4c, 0x3a4d, 0x3a4e, 0x3a4f,
+ 0x3a50, 0x3a51, 0x3a52, 0x3a53, 0x3a54, 0x3a55, 0x3a56, 0x3a57,
+ 0x3a58, 0x3a59, 0x3a5a, 0x3a5b, 0x3a5c, 0x3a5d, 0x3a5e, 0x3a5f,
+ 0x3a60, 0x3a61, 0x3a62, 0x3a63, 0x3a64, 0x3a65, 0x3a66, 0x3a67,
+ 0x3a68, 0x3a69, 0x3a6a, 0x3a6b, 0x3a6c, 0x3a6d, 0x3a6e, 0x3a6f,
+ 0x3a70, 0x3a71, 0x3a72, 0x3a73, 0x3a74, 0x3a75, 0x3a76, 0x3a77,
+ 0x3a78, 0x3a79, 0x3a7a, 0x3a7b, 0x3a7c, 0x3a7d, 0x3a7e, 0x3a7f,
+ 0x3a80, 0x3a81, 0x3a82, 0x3a83, 0x3a84, 0x3a85, 0x3a86, 0x3a87,
+ 0x3a88, 0x3a89, 0x3a8a, 0x3a8b, 0x3a8c, 0x3a8d, 0x3a8e, 0x3a8f,
+ 0x3a90, 0x3a91, 0x3a92, 0x3a93, 0x3a94, 0x3a95, 0x3a96, 0x3a97,
+ 0x3a98, 0x3a99, 0x3a9a, 0x3a9b, 0x3a9c, 0x3a9d, 0x3a9e, 0x3a9f,
+ 0x3aa0, 0x3aa1, 0x3aa2, 0x3aa3, 0x3aa4, 0x3aa5, 0x3aa6, 0x3aa7,
+ 0x3aa8, 0x3aa9, 0x3aaa, 0x3aab, 0x3aac, 0x3aad, 0x3aae, 0x3aaf,
+ 0x3ab0, 0x3ab1, 0x3ab2, 0x3ab3, 0x3ab4, 0x3ab5, 0x3ab6, 0x3ab7,
+ 0x3ab8, 0x3ab9, 0x3aba, 0x3abb, 0x3abc, 0x3abd, 0x3abe, 0x3abf,
+ 0x3ac0, 0x3ac1, 0x3ac2, 0x3ac3, 0x3ac4, 0x3ac5, 0x3ac6, 0x3ac7,
+ 0x3ac8, 0x3ac9, 0x3aca, 0x3acb, 0x3acc, 0x3acd, 0x3ace, 0x3acf,
+ 0x3ad0, 0x3ad1, 0x3ad2, 0x3ad3, 0x3ad4, 0x3ad5, 0x3ad6, 0x3ad7,
+ 0x3ad8, 0x3ad9, 0x3ada, 0x3adb, 0x3adc, 0x3add, 0x3ade, 0x3adf,
+ 0x3ae0, 0x3ae1, 0x3ae2, 0x3ae3, 0x3ae4, 0x3ae5, 0x3ae6, 0x3ae7,
+ 0x3ae8, 0x3ae9, 0x3aea, 0x3aeb, 0x3aec, 0x3aed, 0x3aee, 0x3aef,
+ 0x3af0, 0x3af1, 0x3af2, 0x3af3, 0x3af4, 0x3af5, 0x3af6, 0x3af7,
+ 0x3af8, 0x3af9, 0x3afa, 0x3afb, 0x3afc, 0x3afd, 0x3afe, 0x3aff,
+ 0x3b00, 0x3b01, 0x3b02, 0x3b03, 0x3b04, 0x3b05, 0x3b06, 0x3b07,
+ 0x3b08, 0x3b09, 0x3b0a, 0x3b0b, 0x3b0c, 0x3b0d, 0x3b0e, 0x3b0f,
+ 0x3b10, 0x3b11, 0x3b12, 0x3b13, 0x3b14, 0x3b15, 0x3b16, 0x3b17,
+ 0x3b18, 0x3b19, 0x3b1a, 0x3b1b, 0x3b1c, 0x3b1d, 0x3b1e, 0x3b1f,
+ 0x3b20, 0x3b21, 0x3b22, 0x3b23, 0x3b24, 0x3b25, 0x3b26, 0x3b27,
+ 0x3b28, 0x3b29, 0x3b2a, 0x3b2b, 0x3b2c, 0x3b2d, 0x3b2e, 0x3b2f,
+ 0x3b30, 0x3b31, 0x3b32, 0x3b33, 0x3b34, 0x3b35, 0x3b36, 0x3b37,
+ 0x3b38, 0x3b39, 0x3b3a, 0x3b3b, 0x3b3c, 0x3b3d, 0x3b3e, 0x3b3f,
+ 0x3b40, 0x3b41, 0x3b42, 0x3b43, 0x3b44, 0x3b45, 0x3b46, 0x3b47,
+ 0x3b48, 0x3b49, 0x3b4a, 0x3b4b, 0x3b4c, 0x3b4d, 0x3b4e, 0x3b4f,
+ 0x3b50, 0x3b51, 0x3b52, 0x3b53, 0x3b54, 0x3b55, 0x3b56, 0x3b57,
+ 0x3b58, 0x3b59, 0x3b5a, 0x3b5b, 0x3b5c, 0x3b5d, 0x3b5e, 0x3b5f,
+ 0x3b60, 0x3b61, 0x3b62, 0x3b63, 0x3b64, 0x3b65, 0x3b66, 0x3b67,
+ 0x3b68, 0x3b69, 0x3b6a, 0x3b6b, 0x3b6c, 0x3b6d, 0x3b6e, 0x3b6f,
+ 0x3b70, 0x3b71, 0x3b72, 0x3b73, 0x3b74, 0x3b75, 0x3b76, 0x3b77,
+ 0x3b78, 0x3b79, 0x3b7a, 0x3b7b, 0x3b7c, 0x3b7d, 0x3b7e, 0x3b7f,
+ 0x3b80, 0x3b81, 0x3b82, 0x3b83, 0x3b84, 0x3b85, 0x3b86, 0x3b87,
+ 0x3b88, 0x3b89, 0x3b8a, 0x3b8b, 0x3b8c, 0x3b8d, 0x3b8e, 0x3b8f,
+ 0x3b90, 0x3b91, 0x3b92, 0x3b93, 0x3b94, 0x3b95, 0x3b96, 0x3b97,
+ 0x3b98, 0x3b99, 0x3b9a, 0x3b9b, 0x3b9c, 0x3b9d, 0x3b9e, 0x3b9f,
+ 0x3ba0, 0x3ba1, 0x3ba2, 0x3ba3, 0x3ba4, 0x3ba5, 0x3ba6, 0x3ba7,
+ 0x3ba8, 0x3ba9, 0x3baa, 0x3bab, 0x3bac, 0x3bad, 0x3bae, 0x3baf,
+ 0x3bb0, 0x3bb1, 0x3bb2, 0x3bb3, 0x3bb4, 0x3bb5, 0x3bb6, 0x3bb7,
+ 0x3bb8, 0x3bb9, 0x3bba, 0x3bbb, 0x3bbc, 0x3bbd, 0x3bbe, 0x3bbf,
+ 0x3bc0, 0x3bc1, 0x3bc2, 0x3bc3, 0x3bc4, 0x3bc5, 0x3bc6, 0x3bc7,
+ 0x3bc8, 0x3bc9, 0x3bca, 0x3bcb, 0x3bcc, 0x3bcd, 0x3bce, 0x3bcf,
+ 0x3bd0, 0x3bd1, 0x3bd2, 0x3bd3, 0x3bd4, 0x3bd5, 0x3bd6, 0x3bd7,
+ 0x3bd8, 0x3bd9, 0x3bda, 0x3bdb, 0x3bdc, 0x3bdd, 0x3bde, 0x3bdf,
+ 0x3be0, 0x3be1, 0x3be2, 0x3be3, 0x3be4, 0x3be5, 0x3be6, 0x3be7,
+ 0x3be8, 0x3be9, 0x3bea, 0x3beb, 0x3bec, 0x3bed, 0x3bee, 0x3bef,
+ 0x3bf0, 0x3bf1, 0x3bf2, 0x3bf3, 0x3bf4, 0x3bf5, 0x3bf6, 0x3bf7,
+ 0x3bf8, 0x3bf9, 0x3bfa, 0x3bfb, 0x3bfc, 0x3bfd, 0x3bfe, 0x3bff,
+ 0x3c00, 0x3c01, 0x3c02, 0x3c03, 0x3c04, 0x3c05, 0x3c06, 0x3c07,
+ 0x3c08, 0x3c09, 0x3c0a, 0x3c0b, 0x3c0c, 0x3c0d, 0x3c0e, 0x3c0f,
+ 0x3c10, 0x3c11, 0x3c12, 0x3c13, 0x3c14, 0x3c15, 0x3c16, 0x3c17,
+ 0x3c18, 0x3c19, 0x3c1a, 0x3c1b, 0x3c1c, 0x3c1d, 0x3c1e, 0x3c1f,
+ 0x3c20, 0x3c21, 0x3c22, 0x3c23, 0x3c24, 0x3c25, 0x3c26, 0x3c27,
+ 0x3c28, 0x3c29, 0x3c2a, 0x3c2b, 0x3c2c, 0x3c2d, 0x3c2e, 0x3c2f,
+ 0x3c30, 0x3c31, 0x3c32, 0x3c33, 0x3c34, 0x3c35, 0x3c36, 0x3c37,
+ 0x3c38, 0x3c39, 0x3c3a, 0x3c3b, 0x3c3c, 0x3c3d, 0x3c3e, 0x3c3f,
+ 0x3c40, 0x3c41, 0x3c42, 0x3c43, 0x3c44, 0x3c45, 0x3c46, 0x3c47,
+ 0x3c48, 0x3c49, 0x3c4a, 0x3c4b, 0x3c4c, 0x3c4d, 0x3c4e, 0x3c4f,
+ 0x3c50, 0x3c51, 0x3c52, 0x3c53, 0x3c54, 0x3c55, 0x3c56, 0x3c57,
+ 0x3c58, 0x3c59, 0x3c5a, 0x3c5b, 0x3c5c, 0x3c5d, 0x3c5e, 0x3c5f,
+ 0x3c60, 0x3c61, 0x3c62, 0x3c63, 0x3c64, 0x3c65, 0x3c66, 0x3c67,
+ 0x3c68, 0x3c69, 0x3c6a, 0x3c6b, 0x3c6c, 0x3c6d, 0x3c6e, 0x3c6f,
+ 0x3c70, 0x3c71, 0x3c72, 0x3c73, 0x3c74, 0x3c75, 0x3c76, 0x3c77,
+ 0x3c78, 0x3c79, 0x3c7a, 0x3c7b, 0x3c7c, 0x3c7d, 0x3c7e, 0x3c7f,
+ 0x3c80, 0x3c81, 0x3c82, 0x3c83, 0x3c84, 0x3c85, 0x3c86, 0x3c87,
+ 0x3c88, 0x3c89, 0x3c8a, 0x3c8b, 0x3c8c, 0x3c8d, 0x3c8e, 0x3c8f,
+ 0x3c90, 0x3c91, 0x3c92, 0x3c93, 0x3c94, 0x3c95, 0x3c96, 0x3c97,
+ 0x3c98, 0x3c99, 0x3c9a, 0x3c9b, 0x3c9c, 0x3c9d, 0x3c9e, 0x3c9f,
+ 0x3ca0, 0x3ca1, 0x3ca2, 0x3ca3, 0x3ca4, 0x3ca5, 0x3ca6, 0x3ca7,
+ 0x3ca8, 0x3ca9, 0x3caa, 0x3cab, 0x3cac, 0x3cad, 0x3cae, 0x3caf,
+ 0x3cb0, 0x3cb1, 0x3cb2, 0x3cb3, 0x3cb4, 0x3cb5, 0x3cb6, 0x3cb7,
+ 0x3cb8, 0x3cb9, 0x3cba, 0x3cbb, 0x3cbc, 0x3cbd, 0x3cbe, 0x3cbf,
+ 0x3cc0, 0x3cc1, 0x3cc2, 0x3cc3, 0x3cc4, 0x3cc5, 0x3cc6, 0x3cc7,
+ 0x3cc8, 0x3cc9, 0x3cca, 0x3ccb, 0x3ccc, 0x3ccd, 0x3cce, 0x3ccf,
+ 0x3cd0, 0x3cd1, 0x3cd2, 0x3cd3, 0x3cd4, 0x3cd5, 0x3cd6, 0x3cd7,
+ 0x3cd8, 0x3cd9, 0x3cda, 0x3cdb, 0x3cdc, 0x3cdd, 0x3cde, 0x3cdf,
+ 0x3ce0, 0x3ce1, 0x3ce2, 0x3ce3, 0x3ce4, 0x3ce5, 0x3ce6, 0x3ce7,
+ 0x3ce8, 0x3ce9, 0x3cea, 0x3ceb, 0x3cec, 0x3ced, 0x3cee, 0x3cef,
+ 0x3cf0, 0x3cf1, 0x3cf2, 0x3cf3, 0x3cf4, 0x3cf5, 0x3cf6, 0x3cf7,
+ 0x3cf8, 0x3cf9, 0x3cfa, 0x3cfb, 0x3cfc, 0x3cfd, 0x3cfe, 0x3cff,
+ 0x3d00, 0x3d01, 0x3d02, 0x3d03, 0x3d04, 0x3d05, 0x3d06, 0x3d07,
+ 0x3d08, 0x3d09, 0x3d0a, 0x3d0b, 0x3d0c, 0x3d0d, 0x3d0e, 0x3d0f,
+ 0x3d10, 0x3d11, 0x3d12, 0x3d13, 0x3d14, 0x3d15, 0x3d16, 0x3d17,
+ 0x3d18, 0x3d19, 0x3d1a, 0x3d1b, 0x3d1c, 0x3d1d, 0x3d1e, 0x3d1f,
+ 0x3d20, 0x3d21, 0x3d22, 0x3d23, 0x3d24, 0x3d25, 0x3d26, 0x3d27,
+ 0x3d28, 0x3d29, 0x3d2a, 0x3d2b, 0x3d2c, 0x3d2d, 0x3d2e, 0x3d2f,
+ 0x3d30, 0x3d31, 0x3d32, 0x3d33, 0x3d34, 0x3d35, 0x3d36, 0x3d37,
+ 0x3d38, 0x3d39, 0x3d3a, 0x3d3b, 0x3d3c, 0x3d3d, 0x3d3e, 0x3d3f,
+ 0x3d40, 0x3d41, 0x3d42, 0x3d43, 0x3d44, 0x3d45, 0x3d46, 0x3d47,
+ 0x3d48, 0x3d49, 0x3d4a, 0x3d4b, 0x3d4c, 0x3d4d, 0x3d4e, 0x3d4f,
+ 0x3d50, 0x3d51, 0x3d52, 0x3d53, 0x3d54, 0x3d55, 0x3d56, 0x3d57,
+ 0x3d58, 0x3d59, 0x3d5a, 0x3d5b, 0x3d5c, 0x3d5d, 0x3d5e, 0x3d5f,
+ 0x3d60, 0x3d61, 0x3d62, 0x3d63, 0x3d64, 0x3d65, 0x3d66, 0x3d67,
+ 0x3d68, 0x3d69, 0x3d6a, 0x3d6b, 0x3d6c, 0x3d6d, 0x3d6e, 0x3d6f,
+ 0x3d70, 0x3d71, 0x3d72, 0x3d73, 0x3d74, 0x3d75, 0x3d76, 0x3d77,
+ 0x3d78, 0x3d79, 0x3d7a, 0x3d7b, 0x3d7c, 0x3d7d, 0x3d7e, 0x3d7f,
+ 0x3d80, 0x3d81, 0x3d82, 0x3d83, 0x3d84, 0x3d85, 0x3d86, 0x3d87,
+ 0x3d88, 0x3d89, 0x3d8a, 0x3d8b, 0x3d8c, 0x3d8d, 0x3d8e, 0x3d8f,
+ 0x3d90, 0x3d91, 0x3d92, 0x3d93, 0x3d94, 0x3d95, 0x3d96, 0x3d97,
+ 0x3d98, 0x3d99, 0x3d9a, 0x3d9b, 0x3d9c, 0x3d9d, 0x3d9e, 0x3d9f,
+ 0x3da0, 0x3da1, 0x3da2, 0x3da3, 0x3da4, 0x3da5, 0x3da6, 0x3da7,
+ 0x3da8, 0x3da9, 0x3daa, 0x3dab, 0x3dac, 0x3dad, 0x3dae, 0x3daf,
+ 0x3db0, 0x3db1, 0x3db2, 0x3db3, 0x3db4, 0x3db5, 0x3db6, 0x3db7,
+ 0x3db8, 0x3db9, 0x3dba, 0x3dbb, 0x3dbc, 0x3dbd, 0x3dbe, 0x3dbf,
+ 0x3dc0, 0x3dc1, 0x3dc2, 0x3dc3, 0x3dc4, 0x3dc5, 0x3dc6, 0x3dc7,
+ 0x3dc8, 0x3dc9, 0x3dca, 0x3dcb, 0x3dcc, 0x3dcd, 0x3dce, 0x3dcf,
+ 0x3dd0, 0x3dd1, 0x3dd2, 0x3dd3, 0x3dd4, 0x3dd5, 0x3dd6, 0x3dd7,
+ 0x3dd8, 0x3dd9, 0x3dda, 0x3ddb, 0x3ddc, 0x3ddd, 0x3dde, 0x3ddf,
+ 0x3de0, 0x3de1, 0x3de2, 0x3de3, 0x3de4, 0x3de5, 0x3de6, 0x3de7,
+ 0x3de8, 0x3de9, 0x3dea, 0x3deb, 0x3dec, 0x3ded, 0x3dee, 0x3def,
+ 0x3df0, 0x3df1, 0x3df2, 0x3df3, 0x3df4, 0x3df5, 0x3df6, 0x3df7,
+ 0x3df8, 0x3df9, 0x3dfa, 0x3dfb, 0x3dfc, 0x3dfd, 0x3dfe, 0x3dff,
+ 0x3e00, 0x3e01, 0x3e02, 0x3e03, 0x3e04, 0x3e05, 0x3e06, 0x3e07,
+ 0x3e08, 0x3e09, 0x3e0a, 0x3e0b, 0x3e0c, 0x3e0d, 0x3e0e, 0x3e0f,
+ 0x3e10, 0x3e11, 0x3e12, 0x3e13, 0x3e14, 0x3e15, 0x3e16, 0x3e17,
+ 0x3e18, 0x3e19, 0x3e1a, 0x3e1b, 0x3e1c, 0x3e1d, 0x3e1e, 0x3e1f,
+ 0x3e20, 0x3e21, 0x3e22, 0x3e23, 0x3e24, 0x3e25, 0x3e26, 0x3e27,
+ 0x3e28, 0x3e29, 0x3e2a, 0x3e2b, 0x3e2c, 0x3e2d, 0x3e2e, 0x3e2f,
+ 0x3e30, 0x3e31, 0x3e32, 0x3e33, 0x3e34, 0x3e35, 0x3e36, 0x3e37,
+ 0x3e38, 0x3e39, 0x3e3a, 0x3e3b, 0x3e3c, 0x3e3d, 0x3e3e, 0x3e3f,
+ 0x3e40, 0x3e41, 0x3e42, 0x3e43, 0x3e44, 0x3e45, 0x3e46, 0x3e47,
+ 0x3e48, 0x3e49, 0x3e4a, 0x3e4b, 0x3e4c, 0x3e4d, 0x3e4e, 0x3e4f,
+ 0x3e50, 0x3e51, 0x3e52, 0x3e53, 0x3e54, 0x3e55, 0x3e56, 0x3e57,
+ 0x3e58, 0x3e59, 0x3e5a, 0x3e5b, 0x3e5c, 0x3e5d, 0x3e5e, 0x3e5f,
+ 0x3e60, 0x3e61, 0x3e62, 0x3e63, 0x3e64, 0x3e65, 0x3e66, 0x3e67,
+ 0x3e68, 0x3e69, 0x3e6a, 0x3e6b, 0x3e6c, 0x3e6d, 0x3e6e, 0x3e6f,
+ 0x3e70, 0x3e71, 0x3e72, 0x3e73, 0x3e74, 0x3e75, 0x3e76, 0x3e77,
+ 0x3e78, 0x3e79, 0x3e7a, 0x3e7b, 0x3e7c, 0x3e7d, 0x3e7e, 0x3e7f,
+ 0x3e80, 0x3e81, 0x3e82, 0x3e83, 0x3e84, 0x3e85, 0x3e86, 0x3e87,
+ 0x3e88, 0x3e89, 0x3e8a, 0x3e8b, 0x3e8c, 0x3e8d, 0x3e8e, 0x3e8f,
+ 0x3e90, 0x3e91, 0x3e92, 0x3e93, 0x3e94, 0x3e95, 0x3e96, 0x3e97,
+ 0x3e98, 0x3e99, 0x3e9a, 0x3e9b, 0x3e9c, 0x3e9d, 0x3e9e, 0x3e9f,
+ 0x3ea0, 0x3ea1, 0x3ea2, 0x3ea3, 0x3ea4, 0x3ea5, 0x3ea6, 0x3ea7,
+ 0x3ea8, 0x3ea9, 0x3eaa, 0x3eab, 0x3eac, 0x3ead, 0x3eae, 0x3eaf,
+ 0x3eb0, 0x3eb1, 0x3eb2, 0x3eb3, 0x3eb4, 0x3eb5, 0x3eb6, 0x3eb7,
+ 0x3eb8, 0x3eb9, 0x3eba, 0x3ebb, 0x3ebc, 0x3ebd, 0x3ebe, 0x3ebf,
+ 0x3ec0, 0x3ec1, 0x3ec2, 0x3ec3, 0x3ec4, 0x3ec5, 0x3ec6, 0x3ec7,
+ 0x3ec8, 0x3ec9, 0x3eca, 0x3ecb, 0x3ecc, 0x3ecd, 0x3ece, 0x3ecf,
+ 0x3ed0, 0x3ed1, 0x3ed2, 0x3ed3, 0x3ed4, 0x3ed5, 0x3ed6, 0x3ed7,
+ 0x3ed8, 0x3ed9, 0x3eda, 0x3edb, 0x3edc, 0x3edd, 0x3ede, 0x3edf,
+ 0x3ee0, 0x3ee1, 0x3ee2, 0x3ee3, 0x3ee4, 0x3ee5, 0x3ee6, 0x3ee7,
+ 0x3ee8, 0x3ee9, 0x3eea, 0x3eeb, 0x3eec, 0x3eed, 0x3eee, 0x3eef,
+ 0x3ef0, 0x3ef1, 0x3ef2, 0x3ef3, 0x3ef4, 0x3ef5, 0x3ef6, 0x3ef7,
+ 0x3ef8, 0x3ef9, 0x3efa, 0x3efb, 0x3efc, 0x3efd, 0x3efe, 0x3eff,
+ 0x3f00, 0x3f01, 0x3f02, 0x3f03, 0x3f04, 0x3f05, 0x3f06, 0x3f07,
+ 0x3f08, 0x3f09, 0x3f0a, 0x3f0b, 0x3f0c, 0x3f0d, 0x3f0e, 0x3f0f,
+ 0x3f10, 0x3f11, 0x3f12, 0x3f13, 0x3f14, 0x3f15, 0x3f16, 0x3f17,
+ 0x3f18, 0x3f19, 0x3f1a, 0x3f1b, 0x3f1c, 0x3f1d, 0x3f1e, 0x3f1f,
+ 0x3f20, 0x3f21, 0x3f22, 0x3f23, 0x3f24, 0x3f25, 0x3f26, 0x3f27,
+ 0x3f28, 0x3f29, 0x3f2a, 0x3f2b, 0x3f2c, 0x3f2d, 0x3f2e, 0x3f2f,
+ 0x3f30, 0x3f31, 0x3f32, 0x3f33, 0x3f34, 0x3f35, 0x3f36, 0x3f37,
+ 0x3f38, 0x3f39, 0x3f3a, 0x3f3b, 0x3f3c, 0x3f3d, 0x3f3e, 0x3f3f,
+ 0x3f40, 0x3f41, 0x3f42, 0x3f43, 0x3f44, 0x3f45, 0x3f46, 0x3f47,
+ 0x3f48, 0x3f49, 0x3f4a, 0x3f4b, 0x3f4c, 0x3f4d, 0x3f4e, 0x3f4f,
+ 0x3f50, 0x3f51, 0x3f52, 0x3f53, 0x3f54, 0x3f55, 0x3f56, 0x3f57,
+ 0x3f58, 0x3f59, 0x3f5a, 0x3f5b, 0x3f5c, 0x3f5d, 0x3f5e, 0x3f5f,
+ 0x3f60, 0x3f61, 0x3f62, 0x3f63, 0x3f64, 0x3f65, 0x3f66, 0x3f67,
+ 0x3f68, 0x3f69, 0x3f6a, 0x3f6b, 0x3f6c, 0x3f6d, 0x3f6e, 0x3f6f,
+ 0x3f70, 0x3f71, 0x3f72, 0x3f73, 0x3f74, 0x3f75, 0x3f76, 0x3f77,
+ 0x3f78, 0x3f79, 0x3f7a, 0x3f7b, 0x3f7c, 0x3f7d, 0x3f7e, 0x3f7f,
+ 0x3f80, 0x3f81, 0x3f82, 0x3f83, 0x3f84, 0x3f85, 0x3f86, 0x3f87,
+ 0x3f88, 0x3f89, 0x3f8a, 0x3f8b, 0x3f8c, 0x3f8d, 0x3f8e, 0x3f8f,
+ 0x3f90, 0x3f91, 0x3f92, 0x3f93, 0x3f94, 0x3f95, 0x3f96, 0x3f97,
+ 0x3f98, 0x3f99, 0x3f9a, 0x3f9b, 0x3f9c, 0x3f9d, 0x3f9e, 0x3f9f,
+ 0x3fa0, 0x3fa1, 0x3fa2, 0x3fa3, 0x3fa4, 0x3fa5, 0x3fa6, 0x3fa7,
+ 0x3fa8, 0x3fa9, 0x3faa, 0x3fab, 0x3fac, 0x3fad, 0x3fae, 0x3faf,
+ 0x3fb0, 0x3fb1, 0x3fb2, 0x3fb3, 0x3fb4, 0x3fb5, 0x3fb6, 0x3fb7,
+ 0x3fb8, 0x3fb9, 0x3fba, 0x3fbb, 0x3fbc, 0x3fbd, 0x3fbe, 0x3fbf,
+ 0x3fc0, 0x3fc1, 0x3fc2, 0x3fc3, 0x3fc4, 0x3fc5, 0x3fc6, 0x3fc7,
+ 0x3fc8, 0x3fc9, 0x3fca, 0x3fcb, 0x3fcc, 0x3fcd, 0x3fce, 0x3fcf,
+ 0x3fd0, 0x3fd1, 0x3fd2, 0x3fd3, 0x3fd4, 0x3fd5, 0x3fd6, 0x3fd7,
+ 0x3fd8, 0x3fd9, 0x3fda, 0x3fdb, 0x3fdc, 0x3fdd, 0x3fde, 0x3fdf,
+ 0x3fe0, 0x3fe1, 0x3fe2, 0x3fe3, 0x3fe4, 0x3fe5, 0x3fe6, 0x3fe7,
+ 0x3fe8, 0x3fe9, 0x3fea, 0x3feb, 0x3fec, 0x3fed, 0x3fee, 0x3fef,
+ 0x3ff0, 0x3ff1, 0x3ff2, 0x3ff3, 0x3ff4, 0x3ff5, 0x3ff6, 0x3ff7,
+ 0x3ff8, 0x3ff9, 0x3ffa, 0x3ffb, 0x3ffc, 0x3ffd, 0x3ffe, 0x3fff,
+ 0x4000, 0x4001, 0x4002, 0x4003, 0x4004, 0x4005, 0x4006, 0x4007,
+ 0x4008, 0x4009, 0x400a, 0x400b, 0x400c, 0x400d, 0x400e, 0x400f,
+ 0x4010, 0x4011, 0x4012, 0x4013, 0x4014, 0x4015, 0x4016, 0x4017,
+ 0x4018, 0x4019, 0x401a, 0x401b, 0x401c, 0x401d, 0x401e, 0x401f,
+ 0x4020, 0x4021, 0x4022, 0x4023, 0x4024, 0x4025, 0x4026, 0x4027,
+ 0x4028, 0x4029, 0x402a, 0x402b, 0x402c, 0x402d, 0x402e, 0x402f,
+ 0x4030, 0x4031, 0x4032, 0x4033, 0x4034, 0x4035, 0x4036, 0x4037,
+ 0x4038, 0x4039, 0x403a, 0x403b, 0x403c, 0x403d, 0x403e, 0x403f,
+ 0x4040, 0x4041, 0x4042, 0x4043, 0x4044, 0x4045, 0x4046, 0x4047,
+ 0x4048, 0x4049, 0x404a, 0x404b, 0x404c, 0x404d, 0x404e, 0x404f,
+ 0x4050, 0x4051, 0x4052, 0x4053, 0x4054, 0x4055, 0x4056, 0x4057,
+ 0x4058, 0x4059, 0x405a, 0x405b, 0x405c, 0x405d, 0x405e, 0x405f,
+ 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067,
+ 0x4068, 0x4069, 0x406a, 0x406b, 0x406c, 0x406d, 0x406e, 0x406f,
+ 0x4070, 0x4071, 0x4072, 0x4073, 0x4074, 0x4075, 0x4076, 0x4077,
+ 0x4078, 0x4079, 0x407a, 0x407b, 0x407c, 0x407d, 0x407e, 0x407f,
+ 0x4080, 0x4081, 0x4082, 0x4083, 0x4084, 0x4085, 0x4086, 0x4087,
+ 0x4088, 0x4089, 0x408a, 0x408b, 0x408c, 0x408d, 0x408e, 0x408f,
+ 0x4090, 0x4091, 0x4092, 0x4093, 0x4094, 0x4095, 0x4096, 0x4097,
+ 0x4098, 0x4099, 0x409a, 0x409b, 0x409c, 0x409d, 0x409e, 0x409f,
+ 0x40a0, 0x40a1, 0x40a2, 0x40a3, 0x40a4, 0x40a5, 0x40a6, 0x40a7,
+ 0x40a8, 0x40a9, 0x40aa, 0x40ab, 0x40ac, 0x40ad, 0x40ae, 0x40af,
+ 0x40b0, 0x40b1, 0x40b2, 0x40b3, 0x40b4, 0x40b5, 0x40b6, 0x40b7,
+ 0x40b8, 0x40b9, 0x40ba, 0x40bb, 0x40bc, 0x40bd, 0x40be, 0x40bf,
+ 0x40c0, 0x40c1, 0x40c2, 0x40c3, 0x40c4, 0x40c5, 0x40c6, 0x40c7,
+ 0x40c8, 0x40c9, 0x40ca, 0x40cb, 0x40cc, 0x40cd, 0x40ce, 0x40cf,
+ 0x40d0, 0x40d1, 0x40d2, 0x40d3, 0x40d4, 0x40d5, 0x40d6, 0x40d7,
+ 0x40d8, 0x40d9, 0x40da, 0x40db, 0x40dc, 0x40dd, 0x40de, 0x40df,
+ 0x40e0, 0x40e1, 0x40e2, 0x40e3, 0x40e4, 0x40e5, 0x40e6, 0x40e7,
+ 0x40e8, 0x40e9, 0x40ea, 0x40eb, 0x40ec, 0x40ed, 0x40ee, 0x40ef,
+ 0x40f0, 0x40f1, 0x40f2, 0x40f3, 0x40f4, 0x40f5, 0x40f6, 0x40f7,
+ 0x40f8, 0x40f9, 0x40fa, 0x40fb, 0x40fc, 0x40fd, 0x40fe, 0x40ff,
+ 0x4100, 0x4101, 0x4102, 0x4103, 0x4104, 0x4105, 0x4106, 0x4107,
+ 0x4108, 0x4109, 0x410a, 0x410b, 0x410c, 0x410d, 0x410e, 0x410f,
+ 0x4110, 0x4111, 0x4112, 0x4113, 0x4114, 0x4115, 0x4116, 0x4117,
+ 0x4118, 0x4119, 0x411a, 0x411b, 0x411c, 0x411d, 0x411e, 0x411f,
+ 0x4120, 0x4121, 0x4122, 0x4123, 0x4124, 0x4125, 0x4126, 0x4127,
+ 0x4128, 0x4129, 0x412a, 0x412b, 0x412c, 0x412d, 0x412e, 0x412f,
+ 0x4130, 0x4131, 0x4132, 0x4133, 0x4134, 0x4135, 0x4136, 0x4137,
+ 0x4138, 0x4139, 0x413a, 0x413b, 0x413c, 0x413d, 0x413e, 0x413f,
+ 0x4140, 0x4141, 0x4142, 0x4143, 0x4144, 0x4145, 0x4146, 0x4147,
+ 0x4148, 0x4149, 0x414a, 0x414b, 0x414c, 0x414d, 0x414e, 0x414f,
+ 0x4150, 0x4151, 0x4152, 0x4153, 0x4154, 0x4155, 0x4156, 0x4157,
+ 0x4158, 0x4159, 0x415a, 0x415b, 0x415c, 0x415d, 0x415e, 0x415f,
+ 0x4160, 0x4161, 0x4162, 0x4163, 0x4164, 0x4165, 0x4166, 0x4167,
+ 0x4168, 0x4169, 0x416a, 0x416b, 0x416c, 0x416d, 0x416e, 0x416f,
+ 0x4170, 0x4171, 0x4172, 0x4173, 0x4174, 0x4175, 0x4176, 0x4177,
+ 0x4178, 0x4179, 0x417a, 0x417b, 0x417c, 0x417d, 0x417e, 0x417f,
+ 0x4180, 0x4181, 0x4182, 0x4183, 0x4184, 0x4185, 0x4186, 0x4187,
+ 0x4188, 0x4189, 0x418a, 0x418b, 0x418c, 0x418d, 0x418e, 0x418f,
+ 0x4190, 0x4191, 0x4192, 0x4193, 0x4194, 0x4195, 0x4196, 0x4197,
+ 0x4198, 0x4199, 0x419a, 0x419b, 0x419c, 0x419d, 0x419e, 0x419f,
+ 0x41a0, 0x41a1, 0x41a2, 0x41a3, 0x41a4, 0x41a5, 0x41a6, 0x41a7,
+ 0x41a8, 0x41a9, 0x41aa, 0x41ab, 0x41ac, 0x41ad, 0x41ae, 0x41af,
+ 0x41b0, 0x41b1, 0x41b2, 0x41b3, 0x41b4, 0x41b5, 0x41b6, 0x41b7,
+ 0x41b8, 0x41b9, 0x41ba, 0x41bb, 0x41bc, 0x41bd, 0x41be, 0x41bf,
+ 0x41c0, 0x41c1, 0x41c2, 0x41c3, 0x41c4, 0x41c5, 0x41c6, 0x41c7,
+ 0x41c8, 0x41c9, 0x41ca, 0x41cb, 0x41cc, 0x41cd, 0x41ce, 0x41cf,
+ 0x41d0, 0x41d1, 0x41d2, 0x41d3, 0x41d4, 0x41d5, 0x41d6, 0x41d7,
+ 0x41d8, 0x41d9, 0x41da, 0x41db, 0x41dc, 0x41dd, 0x41de, 0x41df,
+ 0x41e0, 0x41e1, 0x41e2, 0x41e3, 0x41e4, 0x41e5, 0x41e6, 0x41e7,
+ 0x41e8, 0x41e9, 0x41ea, 0x41eb, 0x41ec, 0x41ed, 0x41ee, 0x41ef,
+ 0x41f0, 0x41f1, 0x41f2, 0x41f3, 0x41f4, 0x41f5, 0x41f6, 0x41f7,
+ 0x41f8, 0x41f9, 0x41fa, 0x41fb, 0x41fc, 0x41fd, 0x41fe, 0x41ff,
+ 0x4200, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205, 0x4206, 0x4207,
+ 0x4208, 0x4209, 0x420a, 0x420b, 0x420c, 0x420d, 0x420e, 0x420f,
+ 0x4210, 0x4211, 0x4212, 0x4213, 0x4214, 0x4215, 0x4216, 0x4217,
+ 0x4218, 0x4219, 0x421a, 0x421b, 0x421c, 0x421d, 0x421e, 0x421f,
+ 0x4220, 0x4221, 0x4222, 0x4223, 0x4224, 0x4225, 0x4226, 0x4227,
+ 0x4228, 0x4229, 0x422a, 0x422b, 0x422c, 0x422d, 0x422e, 0x422f,
+ 0x4230, 0x4231, 0x4232, 0x4233, 0x4234, 0x4235, 0x4236, 0x4237,
+ 0x4238, 0x4239, 0x423a, 0x423b, 0x423c, 0x423d, 0x423e, 0x423f,
+ 0x4240, 0x4241, 0x4242, 0x4243, 0x4244, 0x4245, 0x4246, 0x4247,
+ 0x4248, 0x4249, 0x424a, 0x424b, 0x424c, 0x424d, 0x424e, 0x424f,
+ 0x4250, 0x4251, 0x4252, 0x4253, 0x4254, 0x4255, 0x4256, 0x4257,
+ 0x4258, 0x4259, 0x425a, 0x425b, 0x425c, 0x425d, 0x425e, 0x425f,
+ 0x4260, 0x4261, 0x4262, 0x4263, 0x4264, 0x4265, 0x4266, 0x4267,
+ 0x4268, 0x4269, 0x426a, 0x426b, 0x426c, 0x426d, 0x426e, 0x426f,
+ 0x4270, 0x4271, 0x4272, 0x4273, 0x4274, 0x4275, 0x4276, 0x4277,
+ 0x4278, 0x4279, 0x427a, 0x427b, 0x427c, 0x427d, 0x427e, 0x427f,
+ 0x4280, 0x4281, 0x4282, 0x4283, 0x4284, 0x4285, 0x4286, 0x4287,
+ 0x4288, 0x4289, 0x428a, 0x428b, 0x428c, 0x428d, 0x428e, 0x428f,
+ 0x4290, 0x4291, 0x4292, 0x4293, 0x4294, 0x4295, 0x4296, 0x4297,
+ 0x4298, 0x4299, 0x429a, 0x429b, 0x429c, 0x429d, 0x429e, 0x429f,
+ 0x42a0, 0x42a1, 0x42a2, 0x42a3, 0x42a4, 0x42a5, 0x42a6, 0x42a7,
+ 0x42a8, 0x42a9, 0x42aa, 0x42ab, 0x42ac, 0x42ad, 0x42ae, 0x42af,
+ 0x42b0, 0x42b1, 0x42b2, 0x42b3, 0x42b4, 0x42b5, 0x42b6, 0x42b7,
+ 0x42b8, 0x42b9, 0x42ba, 0x42bb, 0x42bc, 0x42bd, 0x42be, 0x42bf,
+ 0x42c0, 0x42c1, 0x42c2, 0x42c3, 0x42c4, 0x42c5, 0x42c6, 0x42c7,
+ 0x42c8, 0x42c9, 0x42ca, 0x42cb, 0x42cc, 0x42cd, 0x42ce, 0x42cf,
+ 0x42d0, 0x42d1, 0x42d2, 0x42d3, 0x42d4, 0x42d5, 0x42d6, 0x42d7,
+ 0x42d8, 0x42d9, 0x42da, 0x42db, 0x42dc, 0x42dd, 0x42de, 0x42df,
+ 0x42e0, 0x42e1, 0x42e2, 0x42e3, 0x42e4, 0x42e5, 0x42e6, 0x42e7,
+ 0x42e8, 0x42e9, 0x42ea, 0x42eb, 0x42ec, 0x42ed, 0x42ee, 0x42ef,
+ 0x42f0, 0x42f1, 0x42f2, 0x42f3, 0x42f4, 0x42f5, 0x42f6, 0x42f7,
+ 0x42f8, 0x42f9, 0x42fa, 0x42fb, 0x42fc, 0x42fd, 0x42fe, 0x42ff,
+ 0x4300, 0x4301, 0x4302, 0x4303, 0x4304, 0x4305, 0x4306, 0x4307,
+ 0x4308, 0x4309, 0x430a, 0x430b, 0x430c, 0x430d, 0x430e, 0x430f,
+ 0x4310, 0x4311, 0x4312, 0x4313, 0x4314, 0x4315, 0x4316, 0x4317,
+ 0x4318, 0x4319, 0x431a, 0x431b, 0x431c, 0x431d, 0x431e, 0x431f,
+ 0x4320, 0x4321, 0x4322, 0x4323, 0x4324, 0x4325, 0x4326, 0x4327,
+ 0x4328, 0x4329, 0x432a, 0x432b, 0x432c, 0x432d, 0x432e, 0x432f,
+ 0x4330, 0x4331, 0x4332, 0x4333, 0x4334, 0x4335, 0x4336, 0x4337,
+ 0x4338, 0x4339, 0x433a, 0x433b, 0x433c, 0x433d, 0x433e, 0x433f,
+ 0x4340, 0x4341, 0x4342, 0x4343, 0x4344, 0x4345, 0x4346, 0x4347,
+ 0x4348, 0x4349, 0x434a, 0x434b, 0x434c, 0x434d, 0x434e, 0x434f,
+ 0x4350, 0x4351, 0x4352, 0x4353, 0x4354, 0x4355, 0x4356, 0x4357,
+ 0x4358, 0x4359, 0x435a, 0x435b, 0x435c, 0x435d, 0x435e, 0x435f,
+ 0x4360, 0x4361, 0x4362, 0x4363, 0x4364, 0x4365, 0x4366, 0x4367,
+ 0x4368, 0x4369, 0x436a, 0x436b, 0x436c, 0x436d, 0x436e, 0x436f,
+ 0x4370, 0x4371, 0x4372, 0x4373, 0x4374, 0x4375, 0x4376, 0x4377,
+ 0x4378, 0x4379, 0x437a, 0x437b, 0x437c, 0x437d, 0x437e, 0x437f,
+ 0x4380, 0x4381, 0x4382, 0x4383, 0x4384, 0x4385, 0x4386, 0x4387,
+ 0x4388, 0x4389, 0x438a, 0x438b, 0x438c, 0x438d, 0x438e, 0x438f,
+ 0x4390, 0x4391, 0x4392, 0x4393, 0x4394, 0x4395, 0x4396, 0x4397,
+ 0x4398, 0x4399, 0x439a, 0x439b, 0x439c, 0x439d, 0x439e, 0x439f,
+ 0x43a0, 0x43a1, 0x43a2, 0x43a3, 0x43a4, 0x43a5, 0x43a6, 0x43a7,
+ 0x43a8, 0x43a9, 0x43aa, 0x43ab, 0x43ac, 0x43ad, 0x43ae, 0x43af,
+ 0x43b0, 0x43b1, 0x43b2, 0x43b3, 0x43b4, 0x43b5, 0x43b6, 0x43b7,
+ 0x43b8, 0x43b9, 0x43ba, 0x43bb, 0x43bc, 0x43bd, 0x43be, 0x43bf,
+ 0x43c0, 0x43c1, 0x43c2, 0x43c3, 0x43c4, 0x43c5, 0x43c6, 0x43c7,
+ 0x43c8, 0x43c9, 0x43ca, 0x43cb, 0x43cc, 0x43cd, 0x43ce, 0x43cf,
+ 0x43d0, 0x43d1, 0x43d2, 0x43d3, 0x43d4, 0x43d5, 0x43d6, 0x43d7,
+ 0x43d8, 0x43d9, 0x43da, 0x43db, 0x43dc, 0x43dd, 0x43de, 0x43df,
+ 0x43e0, 0x43e1, 0x43e2, 0x43e3, 0x43e4, 0x43e5, 0x43e6, 0x43e7,
+ 0x43e8, 0x43e9, 0x43ea, 0x43eb, 0x43ec, 0x43ed, 0x43ee, 0x43ef,
+ 0x43f0, 0x43f1, 0x43f2, 0x43f3, 0x43f4, 0x43f5, 0x43f6, 0x43f7,
+ 0x43f8, 0x43f9, 0x43fa, 0x43fb, 0x43fc, 0x43fd, 0x43fe, 0x43ff,
+ 0x4400, 0x4401, 0x4402, 0x4403, 0x4404, 0x4405, 0x4406, 0x4407,
+ 0x4408, 0x4409, 0x440a, 0x440b, 0x440c, 0x440d, 0x440e, 0x440f,
+ 0x4410, 0x4411, 0x4412, 0x4413, 0x4414, 0x4415, 0x4416, 0x4417,
+ 0x4418, 0x4419, 0x441a, 0x441b, 0x441c, 0x441d, 0x441e, 0x441f,
+ 0x4420, 0x4421, 0x4422, 0x4423, 0x4424, 0x4425, 0x4426, 0x4427,
+ 0x4428, 0x4429, 0x442a, 0x442b, 0x442c, 0x442d, 0x442e, 0x442f,
+ 0x4430, 0x4431, 0x4432, 0x4433, 0x4434, 0x4435, 0x4436, 0x4437,
+ 0x4438, 0x4439, 0x443a, 0x443b, 0x443c, 0x443d, 0x443e, 0x443f,
+ 0x4440, 0x4441, 0x4442, 0x4443, 0x4444, 0x4445, 0x4446, 0x4447,
+ 0x4448, 0x4449, 0x444a, 0x444b, 0x444c, 0x444d, 0x444e, 0x444f,
+ 0x4450, 0x4451, 0x4452, 0x4453, 0x4454, 0x4455, 0x4456, 0x4457,
+ 0x4458, 0x4459, 0x445a, 0x445b, 0x445c, 0x445d, 0x445e, 0x445f,
+ 0x4460, 0x4461, 0x4462, 0x4463, 0x4464, 0x4465, 0x4466, 0x4467,
+ 0x4468, 0x4469, 0x446a, 0x446b, 0x446c, 0x446d, 0x446e, 0x446f,
+ 0x4470, 0x4471, 0x4472, 0x4473, 0x4474, 0x4475, 0x4476, 0x4477,
+ 0x4478, 0x4479, 0x447a, 0x447b, 0x447c, 0x447d, 0x447e, 0x447f,
+ 0x4480, 0x4481, 0x4482, 0x4483, 0x4484, 0x4485, 0x4486, 0x4487,
+ 0x4488, 0x4489, 0x448a, 0x448b, 0x448c, 0x448d, 0x448e, 0x448f,
+ 0x4490, 0x4491, 0x4492, 0x4493, 0x4494, 0x4495, 0x4496, 0x4497,
+ 0x4498, 0x4499, 0x449a, 0x449b, 0x449c, 0x449d, 0x449e, 0x449f,
+ 0x44a0, 0x44a1, 0x44a2, 0x44a3, 0x44a4, 0x44a5, 0x44a6, 0x44a7,
+ 0x44a8, 0x44a9, 0x44aa, 0x44ab, 0x44ac, 0x44ad, 0x44ae, 0x44af,
+ 0x44b0, 0x44b1, 0x44b2, 0x44b3, 0x44b4, 0x44b5, 0x44b6, 0x44b7,
+ 0x44b8, 0x44b9, 0x44ba, 0x44bb, 0x44bc, 0x44bd, 0x44be, 0x44bf,
+ 0x44c0, 0x44c1, 0x44c2, 0x44c3, 0x44c4, 0x44c5, 0x44c6, 0x44c7,
+ 0x44c8, 0x44c9, 0x44ca, 0x44cb, 0x44cc, 0x44cd, 0x44ce, 0x44cf,
+ 0x44d0, 0x44d1, 0x44d2, 0x44d3, 0x44d4, 0x44d5, 0x44d6, 0x44d7,
+ 0x44d8, 0x44d9, 0x44da, 0x44db, 0x44dc, 0x44dd, 0x44de, 0x44df,
+ 0x44e0, 0x44e1, 0x44e2, 0x44e3, 0x44e4, 0x44e5, 0x44e6, 0x44e7,
+ 0x44e8, 0x44e9, 0x44ea, 0x44eb, 0x44ec, 0x44ed, 0x44ee, 0x44ef,
+ 0x44f0, 0x44f1, 0x44f2, 0x44f3, 0x44f4, 0x44f5, 0x44f6, 0x44f7,
+ 0x44f8, 0x44f9, 0x44fa, 0x44fb, 0x44fc, 0x44fd, 0x44fe, 0x44ff,
+ 0x4500, 0x4501, 0x4502, 0x4503, 0x4504, 0x4505, 0x4506, 0x4507,
+ 0x4508, 0x4509, 0x450a, 0x450b, 0x450c, 0x450d, 0x450e, 0x450f,
+ 0x4510, 0x4511, 0x4512, 0x4513, 0x4514, 0x4515, 0x4516, 0x4517,
+ 0x4518, 0x4519, 0x451a, 0x451b, 0x451c, 0x451d, 0x451e, 0x451f,
+ 0x4520, 0x4521, 0x4522, 0x4523, 0x4524, 0x4525, 0x4526, 0x4527,
+ 0x4528, 0x4529, 0x452a, 0x452b, 0x452c, 0x452d, 0x452e, 0x452f,
+ 0x4530, 0x4531, 0x4532, 0x4533, 0x4534, 0x4535, 0x4536, 0x4537,
+ 0x4538, 0x4539, 0x453a, 0x453b, 0x453c, 0x453d, 0x453e, 0x453f,
+ 0x4540, 0x4541, 0x4542, 0x4543, 0x4544, 0x4545, 0x4546, 0x4547,
+ 0x4548, 0x4549, 0x454a, 0x454b, 0x454c, 0x454d, 0x454e, 0x454f,
+ 0x4550, 0x4551, 0x4552, 0x4553, 0x4554, 0x4555, 0x4556, 0x4557,
+ 0x4558, 0x4559, 0x455a, 0x455b, 0x455c, 0x455d, 0x455e, 0x455f,
+ 0x4560, 0x4561, 0x4562, 0x4563, 0x4564, 0x4565, 0x4566, 0x4567,
+ 0x4568, 0x4569, 0x456a, 0x456b, 0x456c, 0x456d, 0x456e, 0x456f,
+ 0x4570, 0x4571, 0x4572, 0x4573, 0x4574, 0x4575, 0x4576, 0x4577,
+ 0x4578, 0x4579, 0x457a, 0x457b, 0x457c, 0x457d, 0x457e, 0x457f,
+ 0x4580, 0x4581, 0x4582, 0x4583, 0x4584, 0x4585, 0x4586, 0x4587,
+ 0x4588, 0x4589, 0x458a, 0x458b, 0x458c, 0x458d, 0x458e, 0x458f,
+ 0x4590, 0x4591, 0x4592, 0x4593, 0x4594, 0x4595, 0x4596, 0x4597,
+ 0x4598, 0x4599, 0x459a, 0x459b, 0x459c, 0x459d, 0x459e, 0x459f,
+ 0x45a0, 0x45a1, 0x45a2, 0x45a3, 0x45a4, 0x45a5, 0x45a6, 0x45a7,
+ 0x45a8, 0x45a9, 0x45aa, 0x45ab, 0x45ac, 0x45ad, 0x45ae, 0x45af,
+ 0x45b0, 0x45b1, 0x45b2, 0x45b3, 0x45b4, 0x45b5, 0x45b6, 0x45b7,
+ 0x45b8, 0x45b9, 0x45ba, 0x45bb, 0x45bc, 0x45bd, 0x45be, 0x45bf,
+ 0x45c0, 0x45c1, 0x45c2, 0x45c3, 0x45c4, 0x45c5, 0x45c6, 0x45c7,
+ 0x45c8, 0x45c9, 0x45ca, 0x45cb, 0x45cc, 0x45cd, 0x45ce, 0x45cf,
+ 0x45d0, 0x45d1, 0x45d2, 0x45d3, 0x45d4, 0x45d5, 0x45d6, 0x45d7,
+ 0x45d8, 0x45d9, 0x45da, 0x45db, 0x45dc, 0x45dd, 0x45de, 0x45df,
+ 0x45e0, 0x45e1, 0x45e2, 0x45e3, 0x45e4, 0x45e5, 0x45e6, 0x45e7,
+ 0x45e8, 0x45e9, 0x45ea, 0x45eb, 0x45ec, 0x45ed, 0x45ee, 0x45ef,
+ 0x45f0, 0x45f1, 0x45f2, 0x45f3, 0x45f4, 0x45f5, 0x45f6, 0x45f7,
+ 0x45f8, 0x45f9, 0x45fa, 0x45fb, 0x45fc, 0x45fd, 0x45fe, 0x45ff,
+ 0x4600, 0x4601, 0x4602, 0x4603, 0x4604, 0x4605, 0x4606, 0x4607,
+ 0x4608, 0x4609, 0x460a, 0x460b, 0x460c, 0x460d, 0x460e, 0x460f,
+ 0x4610, 0x4611, 0x4612, 0x4613, 0x4614, 0x4615, 0x4616, 0x4617,
+ 0x4618, 0x4619, 0x461a, 0x461b, 0x461c, 0x461d, 0x461e, 0x461f,
+ 0x4620, 0x4621, 0x4622, 0x4623, 0x4624, 0x4625, 0x4626, 0x4627,
+ 0x4628, 0x4629, 0x462a, 0x462b, 0x462c, 0x462d, 0x462e, 0x462f,
+ 0x4630, 0x4631, 0x4632, 0x4633, 0x4634, 0x4635, 0x4636, 0x4637,
+ 0x4638, 0x4639, 0x463a, 0x463b, 0x463c, 0x463d, 0x463e, 0x463f,
+ 0x4640, 0x4641, 0x4642, 0x4643, 0x4644, 0x4645, 0x4646, 0x4647,
+ 0x4648, 0x4649, 0x464a, 0x464b, 0x464c, 0x464d, 0x464e, 0x464f,
+ 0x4650, 0x4651, 0x4652, 0x4653, 0x4654, 0x4655, 0x4656, 0x4657,
+ 0x4658, 0x4659, 0x465a, 0x465b, 0x465c, 0x465d, 0x465e, 0x465f,
+ 0x4660, 0x4661, 0x4662, 0x4663, 0x4664, 0x4665, 0x4666, 0x4667,
+ 0x4668, 0x4669, 0x466a, 0x466b, 0x466c, 0x466d, 0x466e, 0x466f,
+ 0x4670, 0x4671, 0x4672, 0x4673, 0x4674, 0x4675, 0x4676, 0x4677,
+ 0x4678, 0x4679, 0x467a, 0x467b, 0x467c, 0x467d, 0x467e, 0x467f,
+ 0x4680, 0x4681, 0x4682, 0x4683, 0x4684, 0x4685, 0x4686, 0x4687,
+ 0x4688, 0x4689, 0x468a, 0x468b, 0x468c, 0x468d, 0x468e, 0x468f,
+ 0x4690, 0x4691, 0x4692, 0x4693, 0x4694, 0x4695, 0x4696, 0x4697,
+ 0x4698, 0x4699, 0x469a, 0x469b, 0x469c, 0x469d, 0x469e, 0x469f,
+ 0x46a0, 0x46a1, 0x46a2, 0x46a3, 0x46a4, 0x46a5, 0x46a6, 0x46a7,
+ 0x46a8, 0x46a9, 0x46aa, 0x46ab, 0x46ac, 0x46ad, 0x46ae, 0x46af,
+ 0x46b0, 0x46b1, 0x46b2, 0x46b3, 0x46b4, 0x46b5, 0x46b6, 0x46b7,
+ 0x46b8, 0x46b9, 0x46ba, 0x46bb, 0x46bc, 0x46bd, 0x46be, 0x46bf,
+ 0x46c0, 0x46c1, 0x46c2, 0x46c3, 0x46c4, 0x46c5, 0x46c6, 0x46c7,
+ 0x46c8, 0x46c9, 0x46ca, 0x46cb, 0x46cc, 0x46cd, 0x46ce, 0x46cf,
+ 0x46d0, 0x46d1, 0x46d2, 0x46d3, 0x46d4, 0x46d5, 0x46d6, 0x46d7,
+ 0x46d8, 0x46d9, 0x46da, 0x46db, 0x46dc, 0x46dd, 0x46de, 0x46df,
+ 0x46e0, 0x46e1, 0x46e2, 0x46e3, 0x46e4, 0x46e5, 0x46e6, 0x46e7,
+ 0x46e8, 0x46e9, 0x46ea, 0x46eb, 0x46ec, 0x46ed, 0x46ee, 0x46ef,
+ 0x46f0, 0x46f1, 0x46f2, 0x46f3, 0x46f4, 0x46f5, 0x46f6, 0x46f7,
+ 0x46f8, 0x46f9, 0x46fa, 0x46fb, 0x46fc, 0x46fd, 0x46fe, 0x46ff,
+ 0x4700, 0x4701, 0x4702, 0x4703, 0x4704, 0x4705, 0x4706, 0x4707,
+ 0x4708, 0x4709, 0x470a, 0x470b, 0x470c, 0x470d, 0x470e, 0x470f,
+ 0x4710, 0x4711, 0x4712, 0x4713, 0x4714, 0x4715, 0x4716, 0x4717,
+ 0x4718, 0x4719, 0x471a, 0x471b, 0x471c, 0x471d, 0x471e, 0x471f,
+ 0x4720, 0x4721, 0x4722, 0x4723, 0x4724, 0x4725, 0x4726, 0x4727,
+ 0x4728, 0x4729, 0x472a, 0x472b, 0x472c, 0x472d, 0x472e, 0x472f,
+ 0x4730, 0x4731, 0x4732, 0x4733, 0x4734, 0x4735, 0x4736, 0x4737,
+ 0x4738, 0x4739, 0x473a, 0x473b, 0x473c, 0x473d, 0x473e, 0x473f,
+ 0x4740, 0x4741, 0x4742, 0x4743, 0x4744, 0x4745, 0x4746, 0x4747,
+ 0x4748, 0x4749, 0x474a, 0x474b, 0x474c, 0x474d, 0x474e, 0x474f,
+ 0x4750, 0x4751, 0x4752, 0x4753, 0x4754, 0x4755, 0x4756, 0x4757,
+ 0x4758, 0x4759, 0x475a, 0x475b, 0x475c, 0x475d, 0x475e, 0x475f,
+ 0x4760, 0x4761, 0x4762, 0x4763, 0x4764, 0x4765, 0x4766, 0x4767,
+ 0x4768, 0x4769, 0x476a, 0x476b, 0x476c, 0x476d, 0x476e, 0x476f,
+ 0x4770, 0x4771, 0x4772, 0x4773, 0x4774, 0x4775, 0x4776, 0x4777,
+ 0x4778, 0x4779, 0x477a, 0x477b, 0x477c, 0x477d, 0x477e, 0x477f,
+ 0x4780, 0x4781, 0x4782, 0x4783, 0x4784, 0x4785, 0x4786, 0x4787,
+ 0x4788, 0x4789, 0x478a, 0x478b, 0x478c, 0x478d, 0x478e, 0x478f,
+ 0x4790, 0x4791, 0x4792, 0x4793, 0x4794, 0x4795, 0x4796, 0x4797,
+ 0x4798, 0x4799, 0x479a, 0x479b, 0x479c, 0x479d, 0x479e, 0x479f,
+ 0x47a0, 0x47a1, 0x47a2, 0x47a3, 0x47a4, 0x47a5, 0x47a6, 0x47a7,
+ 0x47a8, 0x47a9, 0x47aa, 0x47ab, 0x47ac, 0x47ad, 0x47ae, 0x47af,
+ 0x47b0, 0x47b1, 0x47b2, 0x47b3, 0x47b4, 0x47b5, 0x47b6, 0x47b7,
+ 0x47b8, 0x47b9, 0x47ba, 0x47bb, 0x47bc, 0x47bd, 0x47be, 0x47bf,
+ 0x47c0, 0x47c1, 0x47c2, 0x47c3, 0x47c4, 0x47c5, 0x47c6, 0x47c7,
+ 0x47c8, 0x47c9, 0x47ca, 0x47cb, 0x47cc, 0x47cd, 0x47ce, 0x47cf,
+ 0x47d0, 0x47d1, 0x47d2, 0x47d3, 0x47d4, 0x47d5, 0x47d6, 0x47d7,
+ 0x47d8, 0x47d9, 0x47da, 0x47db, 0x47dc, 0x47dd, 0x47de, 0x47df,
+ 0x47e0, 0x47e1, 0x47e2, 0x47e3, 0x47e4, 0x47e5, 0x47e6, 0x47e7,
+ 0x47e8, 0x47e9, 0x47ea, 0x47eb, 0x47ec, 0x47ed, 0x47ee, 0x47ef,
+ 0x47f0, 0x47f1, 0x47f2, 0x47f3, 0x47f4, 0x47f5, 0x47f6, 0x47f7,
+ 0x47f8, 0x47f9, 0x47fa, 0x47fb, 0x47fc, 0x47fd, 0x47fe, 0x47ff,
+ 0x4800, 0x4801, 0x4802, 0x4803, 0x4804, 0x4805, 0x4806, 0x4807,
+ 0x4808, 0x4809, 0x480a, 0x480b, 0x480c, 0x480d, 0x480e, 0x480f,
+ 0x4810, 0x4811, 0x4812, 0x4813, 0x4814, 0x4815, 0x4816, 0x4817,
+ 0x4818, 0x4819, 0x481a, 0x481b, 0x481c, 0x481d, 0x481e, 0x481f,
+ 0x4820, 0x4821, 0x4822, 0x4823, 0x4824, 0x4825, 0x4826, 0x4827,
+ 0x4828, 0x4829, 0x482a, 0x482b, 0x482c, 0x482d, 0x482e, 0x482f,
+ 0x4830, 0x4831, 0x4832, 0x4833, 0x4834, 0x4835, 0x4836, 0x4837,
+ 0x4838, 0x4839, 0x483a, 0x483b, 0x483c, 0x483d, 0x483e, 0x483f,
+ 0x4840, 0x4841, 0x4842, 0x4843, 0x4844, 0x4845, 0x4846, 0x4847,
+ 0x4848, 0x4849, 0x484a, 0x484b, 0x484c, 0x484d, 0x484e, 0x484f,
+ 0x4850, 0x4851, 0x4852, 0x4853, 0x4854, 0x4855, 0x4856, 0x4857,
+ 0x4858, 0x4859, 0x485a, 0x485b, 0x485c, 0x485d, 0x485e, 0x485f,
+ 0x4860, 0x4861, 0x4862, 0x4863, 0x4864, 0x4865, 0x4866, 0x4867,
+ 0x4868, 0x4869, 0x486a, 0x486b, 0x486c, 0x486d, 0x486e, 0x486f,
+ 0x4870, 0x4871, 0x4872, 0x4873, 0x4874, 0x4875, 0x4876, 0x4877,
+ 0x4878, 0x4879, 0x487a, 0x487b, 0x487c, 0x487d, 0x487e, 0x487f,
+ 0x4880, 0x4881, 0x4882, 0x4883, 0x4884, 0x4885, 0x4886, 0x4887,
+ 0x4888, 0x4889, 0x488a, 0x488b, 0x488c, 0x488d, 0x488e, 0x488f,
+ 0x4890, 0x4891, 0x4892, 0x4893, 0x4894, 0x4895, 0x4896, 0x4897,
+ 0x4898, 0x4899, 0x489a, 0x489b, 0x489c, 0x489d, 0x489e, 0x489f,
+ 0x48a0, 0x48a1, 0x48a2, 0x48a3, 0x48a4, 0x48a5, 0x48a6, 0x48a7,
+ 0x48a8, 0x48a9, 0x48aa, 0x48ab, 0x48ac, 0x48ad, 0x48ae, 0x48af,
+ 0x48b0, 0x48b1, 0x48b2, 0x48b3, 0x48b4, 0x48b5, 0x48b6, 0x48b7,
+ 0x48b8, 0x48b9, 0x48ba, 0x48bb, 0x48bc, 0x48bd, 0x48be, 0x48bf,
+ 0x48c0, 0x48c1, 0x48c2, 0x48c3, 0x48c4, 0x48c5, 0x48c6, 0x48c7,
+ 0x48c8, 0x48c9, 0x48ca, 0x48cb, 0x48cc, 0x48cd, 0x48ce, 0x48cf,
+ 0x48d0, 0x48d1, 0x48d2, 0x48d3, 0x48d4, 0x48d5, 0x48d6, 0x48d7,
+ 0x48d8, 0x48d9, 0x48da, 0x48db, 0x48dc, 0x48dd, 0x48de, 0x48df,
+ 0x48e0, 0x48e1, 0x48e2, 0x48e3, 0x48e4, 0x48e5, 0x48e6, 0x48e7,
+ 0x48e8, 0x48e9, 0x48ea, 0x48eb, 0x48ec, 0x48ed, 0x48ee, 0x48ef,
+ 0x48f0, 0x48f1, 0x48f2, 0x48f3, 0x48f4, 0x48f5, 0x48f6, 0x48f7,
+ 0x48f8, 0x48f9, 0x48fa, 0x48fb, 0x48fc, 0x48fd, 0x48fe, 0x48ff,
+ 0x4900, 0x4901, 0x4902, 0x4903, 0x4904, 0x4905, 0x4906, 0x4907,
+ 0x4908, 0x4909, 0x490a, 0x490b, 0x490c, 0x490d, 0x490e, 0x490f,
+ 0x4910, 0x4911, 0x4912, 0x4913, 0x4914, 0x4915, 0x4916, 0x4917,
+ 0x4918, 0x4919, 0x491a, 0x491b, 0x491c, 0x491d, 0x491e, 0x491f,
+ 0x4920, 0x4921, 0x4922, 0x4923, 0x4924, 0x4925, 0x4926, 0x4927,
+ 0x4928, 0x4929, 0x492a, 0x492b, 0x492c, 0x492d, 0x492e, 0x492f,
+ 0x4930, 0x4931, 0x4932, 0x4933, 0x4934, 0x4935, 0x4936, 0x4937,
+ 0x4938, 0x4939, 0x493a, 0x493b, 0x493c, 0x493d, 0x493e, 0x493f,
+ 0x4940, 0x4941, 0x4942, 0x4943, 0x4944, 0x4945, 0x4946, 0x4947,
+ 0x4948, 0x4949, 0x494a, 0x494b, 0x494c, 0x494d, 0x494e, 0x494f,
+ 0x4950, 0x4951, 0x4952, 0x4953, 0x4954, 0x4955, 0x4956, 0x4957,
+ 0x4958, 0x4959, 0x495a, 0x495b, 0x495c, 0x495d, 0x495e, 0x495f,
+ 0x4960, 0x4961, 0x4962, 0x4963, 0x4964, 0x4965, 0x4966, 0x4967,
+ 0x4968, 0x4969, 0x496a, 0x496b, 0x496c, 0x496d, 0x496e, 0x496f,
+ 0x4970, 0x4971, 0x4972, 0x4973, 0x4974, 0x4975, 0x4976, 0x4977,
+ 0x4978, 0x4979, 0x497a, 0x497b, 0x497c, 0x497d, 0x497e, 0x497f,
+ 0x4980, 0x4981, 0x4982, 0x4983, 0x4984, 0x4985, 0x4986, 0x4987,
+ 0x4988, 0x4989, 0x498a, 0x498b, 0x498c, 0x498d, 0x498e, 0x498f,
+ 0x4990, 0x4991, 0x4992, 0x4993, 0x4994, 0x4995, 0x4996, 0x4997,
+ 0x4998, 0x4999, 0x499a, 0x499b, 0x499c, 0x499d, 0x499e, 0x499f,
+ 0x49a0, 0x49a1, 0x49a2, 0x49a3, 0x49a4, 0x49a5, 0x49a6, 0x49a7,
+ 0x49a8, 0x49a9, 0x49aa, 0x49ab, 0x49ac, 0x49ad, 0x49ae, 0x49af,
+ 0x49b0, 0x49b1, 0x49b2, 0x49b3, 0x49b4, 0x49b5, 0x49b6, 0x49b7,
+ 0x49b8, 0x49b9, 0x49ba, 0x49bb, 0x49bc, 0x49bd, 0x49be, 0x49bf,
+ 0x49c0, 0x49c1, 0x49c2, 0x49c3, 0x49c4, 0x49c5, 0x49c6, 0x49c7,
+ 0x49c8, 0x49c9, 0x49ca, 0x49cb, 0x49cc, 0x49cd, 0x49ce, 0x49cf,
+ 0x49d0, 0x49d1, 0x49d2, 0x49d3, 0x49d4, 0x49d5, 0x49d6, 0x49d7,
+ 0x49d8, 0x49d9, 0x49da, 0x49db, 0x49dc, 0x49dd, 0x49de, 0x49df,
+ 0x49e0, 0x49e1, 0x49e2, 0x49e3, 0x49e4, 0x49e5, 0x49e6, 0x49e7,
+ 0x49e8, 0x49e9, 0x49ea, 0x49eb, 0x49ec, 0x49ed, 0x49ee, 0x49ef,
+ 0x49f0, 0x49f1, 0x49f2, 0x49f3, 0x49f4, 0x49f5, 0x49f6, 0x49f7,
+ 0x49f8, 0x49f9, 0x49fa, 0x49fb, 0x49fc, 0x49fd, 0x49fe, 0x49ff,
+ 0x4a00, 0x4a01, 0x4a02, 0x4a03, 0x4a04, 0x4a05, 0x4a06, 0x4a07,
+ 0x4a08, 0x4a09, 0x4a0a, 0x4a0b, 0x4a0c, 0x4a0d, 0x4a0e, 0x4a0f,
+ 0x4a10, 0x4a11, 0x4a12, 0x4a13, 0x4a14, 0x4a15, 0x4a16, 0x4a17,
+ 0x4a18, 0x4a19, 0x4a1a, 0x4a1b, 0x4a1c, 0x4a1d, 0x4a1e, 0x4a1f,
+ 0x4a20, 0x4a21, 0x4a22, 0x4a23, 0x4a24, 0x4a25, 0x4a26, 0x4a27,
+ 0x4a28, 0x4a29, 0x4a2a, 0x4a2b, 0x4a2c, 0x4a2d, 0x4a2e, 0x4a2f,
+ 0x4a30, 0x4a31, 0x4a32, 0x4a33, 0x4a34, 0x4a35, 0x4a36, 0x4a37,
+ 0x4a38, 0x4a39, 0x4a3a, 0x4a3b, 0x4a3c, 0x4a3d, 0x4a3e, 0x4a3f,
+ 0x4a40, 0x4a41, 0x4a42, 0x4a43, 0x4a44, 0x4a45, 0x4a46, 0x4a47,
+ 0x4a48, 0x4a49, 0x4a4a, 0x4a4b, 0x4a4c, 0x4a4d, 0x4a4e, 0x4a4f,
+ 0x4a50, 0x4a51, 0x4a52, 0x4a53, 0x4a54, 0x4a55, 0x4a56, 0x4a57,
+ 0x4a58, 0x4a59, 0x4a5a, 0x4a5b, 0x4a5c, 0x4a5d, 0x4a5e, 0x4a5f,
+ 0x4a60, 0x4a61, 0x4a62, 0x4a63, 0x4a64, 0x4a65, 0x4a66, 0x4a67,
+ 0x4a68, 0x4a69, 0x4a6a, 0x4a6b, 0x4a6c, 0x4a6d, 0x4a6e, 0x4a6f,
+ 0x4a70, 0x4a71, 0x4a72, 0x4a73, 0x4a74, 0x4a75, 0x4a76, 0x4a77,
+ 0x4a78, 0x4a79, 0x4a7a, 0x4a7b, 0x4a7c, 0x4a7d, 0x4a7e, 0x4a7f,
+ 0x4a80, 0x4a81, 0x4a82, 0x4a83, 0x4a84, 0x4a85, 0x4a86, 0x4a87,
+ 0x4a88, 0x4a89, 0x4a8a, 0x4a8b, 0x4a8c, 0x4a8d, 0x4a8e, 0x4a8f,
+ 0x4a90, 0x4a91, 0x4a92, 0x4a93, 0x4a94, 0x4a95, 0x4a96, 0x4a97,
+ 0x4a98, 0x4a99, 0x4a9a, 0x4a9b, 0x4a9c, 0x4a9d, 0x4a9e, 0x4a9f,
+ 0x4aa0, 0x4aa1, 0x4aa2, 0x4aa3, 0x4aa4, 0x4aa5, 0x4aa6, 0x4aa7,
+ 0x4aa8, 0x4aa9, 0x4aaa, 0x4aab, 0x4aac, 0x4aad, 0x4aae, 0x4aaf,
+ 0x4ab0, 0x4ab1, 0x4ab2, 0x4ab3, 0x4ab4, 0x4ab5, 0x4ab6, 0x4ab7,
+ 0x4ab8, 0x4ab9, 0x4aba, 0x4abb, 0x4abc, 0x4abd, 0x4abe, 0x4abf,
+ 0x4ac0, 0x4ac1, 0x4ac2, 0x4ac3, 0x4ac4, 0x4ac5, 0x4ac6, 0x4ac7,
+ 0x4ac8, 0x4ac9, 0x4aca, 0x4acb, 0x4acc, 0x4acd, 0x4ace, 0x4acf,
+ 0x4ad0, 0x4ad1, 0x4ad2, 0x4ad3, 0x4ad4, 0x4ad5, 0x4ad6, 0x4ad7,
+ 0x4ad8, 0x4ad9, 0x4ada, 0x4adb, 0x4adc, 0x4add, 0x4ade, 0x4adf,
+ 0x4ae0, 0x4ae1, 0x4ae2, 0x4ae3, 0x4ae4, 0x4ae5, 0x4ae6, 0x4ae7,
+ 0x4ae8, 0x4ae9, 0x4aea, 0x4aeb, 0x4aec, 0x4aed, 0x4aee, 0x4aef,
+ 0x4af0, 0x4af1, 0x4af2, 0x4af3, 0x4af4, 0x4af5, 0x4af6, 0x4af7,
+ 0x4af8, 0x4af9, 0x4afa, 0x4afb, 0x4afc, 0x4afd, 0x4afe, 0x4aff,
+ 0x4b00, 0x4b01, 0x4b02, 0x4b03, 0x4b04, 0x4b05, 0x4b06, 0x4b07,
+ 0x4b08, 0x4b09, 0x4b0a, 0x4b0b, 0x4b0c, 0x4b0d, 0x4b0e, 0x4b0f,
+ 0x4b10, 0x4b11, 0x4b12, 0x4b13, 0x4b14, 0x4b15, 0x4b16, 0x4b17,
+ 0x4b18, 0x4b19, 0x4b1a, 0x4b1b, 0x4b1c, 0x4b1d, 0x4b1e, 0x4b1f,
+ 0x4b20, 0x4b21, 0x4b22, 0x4b23, 0x4b24, 0x4b25, 0x4b26, 0x4b27,
+ 0x4b28, 0x4b29, 0x4b2a, 0x4b2b, 0x4b2c, 0x4b2d, 0x4b2e, 0x4b2f,
+ 0x4b30, 0x4b31, 0x4b32, 0x4b33, 0x4b34, 0x4b35, 0x4b36, 0x4b37,
+ 0x4b38, 0x4b39, 0x4b3a, 0x4b3b, 0x4b3c, 0x4b3d, 0x4b3e, 0x4b3f,
+ 0x4b40, 0x4b41, 0x4b42, 0x4b43, 0x4b44, 0x4b45, 0x4b46, 0x4b47,
+ 0x4b48, 0x4b49, 0x4b4a, 0x4b4b, 0x4b4c, 0x4b4d, 0x4b4e, 0x4b4f,
+ 0x4b50, 0x4b51, 0x4b52, 0x4b53, 0x4b54, 0x4b55, 0x4b56, 0x4b57,
+ 0x4b58, 0x4b59, 0x4b5a, 0x4b5b, 0x4b5c, 0x4b5d, 0x4b5e, 0x4b5f,
+ 0x4b60, 0x4b61, 0x4b62, 0x4b63, 0x4b64, 0x4b65, 0x4b66, 0x4b67,
+ 0x4b68, 0x4b69, 0x4b6a, 0x4b6b, 0x4b6c, 0x4b6d, 0x4b6e, 0x4b6f,
+ 0x4b70, 0x4b71, 0x4b72, 0x4b73, 0x4b74, 0x4b75, 0x4b76, 0x4b77,
+ 0x4b78, 0x4b79, 0x4b7a, 0x4b7b, 0x4b7c, 0x4b7d, 0x4b7e, 0x4b7f,
+ 0x4b80, 0x4b81, 0x4b82, 0x4b83, 0x4b84, 0x4b85, 0x4b86, 0x4b87,
+ 0x4b88, 0x4b89, 0x4b8a, 0x4b8b, 0x4b8c, 0x4b8d, 0x4b8e, 0x4b8f,
+ 0x4b90, 0x4b91, 0x4b92, 0x4b93, 0x4b94, 0x4b95, 0x4b96, 0x4b97,
+ 0x4b98, 0x4b99, 0x4b9a, 0x4b9b, 0x4b9c, 0x4b9d, 0x4b9e, 0x4b9f,
+ 0x4ba0, 0x4ba1, 0x4ba2, 0x4ba3, 0x4ba4, 0x4ba5, 0x4ba6, 0x4ba7,
+ 0x4ba8, 0x4ba9, 0x4baa, 0x4bab, 0x4bac, 0x4bad, 0x4bae, 0x4baf,
+ 0x4bb0, 0x4bb1, 0x4bb2, 0x4bb3, 0x4bb4, 0x4bb5, 0x4bb6, 0x4bb7,
+ 0x4bb8, 0x4bb9, 0x4bba, 0x4bbb, 0x4bbc, 0x4bbd, 0x4bbe, 0x4bbf,
+ 0x4bc0, 0x4bc1, 0x4bc2, 0x4bc3, 0x4bc4, 0x4bc5, 0x4bc6, 0x4bc7,
+ 0x4bc8, 0x4bc9, 0x4bca, 0x4bcb, 0x4bcc, 0x4bcd, 0x4bce, 0x4bcf,
+ 0x4bd0, 0x4bd1, 0x4bd2, 0x4bd3, 0x4bd4, 0x4bd5, 0x4bd6, 0x4bd7,
+ 0x4bd8, 0x4bd9, 0x4bda, 0x4bdb, 0x4bdc, 0x4bdd, 0x4bde, 0x4bdf,
+ 0x4be0, 0x4be1, 0x4be2, 0x4be3, 0x4be4, 0x4be5, 0x4be6, 0x4be7,
+ 0x4be8, 0x4be9, 0x4bea, 0x4beb, 0x4bec, 0x4bed, 0x4bee, 0x4bef,
+ 0x4bf0, 0x4bf1, 0x4bf2, 0x4bf3, 0x4bf4, 0x4bf5, 0x4bf6, 0x4bf7,
+ 0x4bf8, 0x4bf9, 0x4bfa, 0x4bfb, 0x4bfc, 0x4bfd, 0x4bfe, 0x4bff,
+ 0x4c00, 0x4c01, 0x4c02, 0x4c03, 0x4c04, 0x4c05, 0x4c06, 0x4c07,
+ 0x4c08, 0x4c09, 0x4c0a, 0x4c0b, 0x4c0c, 0x4c0d, 0x4c0e, 0x4c0f,
+ 0x4c10, 0x4c11, 0x4c12, 0x4c13, 0x4c14, 0x4c15, 0x4c16, 0x4c17,
+ 0x4c18, 0x4c19, 0x4c1a, 0x4c1b, 0x4c1c, 0x4c1d, 0x4c1e, 0x4c1f,
+ 0x4c20, 0x4c21, 0x4c22, 0x4c23, 0x4c24, 0x4c25, 0x4c26, 0x4c27,
+ 0x4c28, 0x4c29, 0x4c2a, 0x4c2b, 0x4c2c, 0x4c2d, 0x4c2e, 0x4c2f,
+ 0x4c30, 0x4c31, 0x4c32, 0x4c33, 0x4c34, 0x4c35, 0x4c36, 0x4c37,
+ 0x4c38, 0x4c39, 0x4c3a, 0x4c3b, 0x4c3c, 0x4c3d, 0x4c3e, 0x4c3f,
+ 0x4c40, 0x4c41, 0x4c42, 0x4c43, 0x4c44, 0x4c45, 0x4c46, 0x4c47,
+ 0x4c48, 0x4c49, 0x4c4a, 0x4c4b, 0x4c4c, 0x4c4d, 0x4c4e, 0x4c4f,
+ 0x4c50, 0x4c51, 0x4c52, 0x4c53, 0x4c54, 0x4c55, 0x4c56, 0x4c57,
+ 0x4c58, 0x4c59, 0x4c5a, 0x4c5b, 0x4c5c, 0x4c5d, 0x4c5e, 0x4c5f,
+ 0x4c60, 0x4c61, 0x4c62, 0x4c63, 0x4c64, 0x4c65, 0x4c66, 0x4c67,
+ 0x4c68, 0x4c69, 0x4c6a, 0x4c6b, 0x4c6c, 0x4c6d, 0x4c6e, 0x4c6f,
+ 0x4c70, 0x4c71, 0x4c72, 0x4c73, 0x4c74, 0x4c75, 0x4c76, 0x4c77,
+ 0x4c78, 0x4c79, 0x4c7a, 0x4c7b, 0x4c7c, 0x4c7d, 0x4c7e, 0x4c7f,
+ 0x4c80, 0x4c81, 0x4c82, 0x4c83, 0x4c84, 0x4c85, 0x4c86, 0x4c87,
+ 0x4c88, 0x4c89, 0x4c8a, 0x4c8b, 0x4c8c, 0x4c8d, 0x4c8e, 0x4c8f,
+ 0x4c90, 0x4c91, 0x4c92, 0x4c93, 0x4c94, 0x4c95, 0x4c96, 0x4c97,
+ 0x4c98, 0x4c99, 0x4c9a, 0x4c9b, 0x4c9c, 0x4c9d, 0x4c9e, 0x4c9f,
+ 0x4ca0, 0x4ca1, 0x4ca2, 0x4ca3, 0x4ca4, 0x4ca5, 0x4ca6, 0x4ca7,
+ 0x4ca8, 0x4ca9, 0x4caa, 0x4cab, 0x4cac, 0x4cad, 0x4cae, 0x4caf,
+ 0x4cb0, 0x4cb1, 0x4cb2, 0x4cb3, 0x4cb4, 0x4cb5, 0x4cb6, 0x4cb7,
+ 0x4cb8, 0x4cb9, 0x4cba, 0x4cbb, 0x4cbc, 0x4cbd, 0x4cbe, 0x4cbf,
+ 0x4cc0, 0x4cc1, 0x4cc2, 0x4cc3, 0x4cc4, 0x4cc5, 0x4cc6, 0x4cc7,
+ 0x4cc8, 0x4cc9, 0x4cca, 0x4ccb, 0x4ccc, 0x4ccd, 0x4cce, 0x4ccf,
+ 0x4cd0, 0x4cd1, 0x4cd2, 0x4cd3, 0x4cd4, 0x4cd5, 0x4cd6, 0x4cd7,
+ 0x4cd8, 0x4cd9, 0x4cda, 0x4cdb, 0x4cdc, 0x4cdd, 0x4cde, 0x4cdf,
+ 0x4ce0, 0x4ce1, 0x4ce2, 0x4ce3, 0x4ce4, 0x4ce5, 0x4ce6, 0x4ce7,
+ 0x4ce8, 0x4ce9, 0x4cea, 0x4ceb, 0x4cec, 0x4ced, 0x4cee, 0x4cef,
+ 0x4cf0, 0x4cf1, 0x4cf2, 0x4cf3, 0x4cf4, 0x4cf5, 0x4cf6, 0x4cf7,
+ 0x4cf8, 0x4cf9, 0x4cfa, 0x4cfb, 0x4cfc, 0x4cfd, 0x4cfe, 0x4cff,
+ 0x4d00, 0x4d01, 0x4d02, 0x4d03, 0x4d04, 0x4d05, 0x4d06, 0x4d07,
+ 0x4d08, 0x4d09, 0x4d0a, 0x4d0b, 0x4d0c, 0x4d0d, 0x4d0e, 0x4d0f,
+ 0x4d10, 0x4d11, 0x4d12, 0x4d13, 0x4d14, 0x4d15, 0x4d16, 0x4d17,
+ 0x4d18, 0x4d19, 0x4d1a, 0x4d1b, 0x4d1c, 0x4d1d, 0x4d1e, 0x4d1f,
+ 0x4d20, 0x4d21, 0x4d22, 0x4d23, 0x4d24, 0x4d25, 0x4d26, 0x4d27,
+ 0x4d28, 0x4d29, 0x4d2a, 0x4d2b, 0x4d2c, 0x4d2d, 0x4d2e, 0x4d2f,
+ 0x4d30, 0x4d31, 0x4d32, 0x4d33, 0x4d34, 0x4d35, 0x4d36, 0x4d37,
+ 0x4d38, 0x4d39, 0x4d3a, 0x4d3b, 0x4d3c, 0x4d3d, 0x4d3e, 0x4d3f,
+ 0x4d40, 0x4d41, 0x4d42, 0x4d43, 0x4d44, 0x4d45, 0x4d46, 0x4d47,
+ 0x4d48, 0x4d49, 0x4d4a, 0x4d4b, 0x4d4c, 0x4d4d, 0x4d4e, 0x4d4f,
+ 0x4d50, 0x4d51, 0x4d52, 0x4d53, 0x4d54, 0x4d55, 0x4d56, 0x4d57,
+ 0x4d58, 0x4d59, 0x4d5a, 0x4d5b, 0x4d5c, 0x4d5d, 0x4d5e, 0x4d5f,
+ 0x4d60, 0x4d61, 0x4d62, 0x4d63, 0x4d64, 0x4d65, 0x4d66, 0x4d67,
+ 0x4d68, 0x4d69, 0x4d6a, 0x4d6b, 0x4d6c, 0x4d6d, 0x4d6e, 0x4d6f,
+ 0x4d70, 0x4d71, 0x4d72, 0x4d73, 0x4d74, 0x4d75, 0x4d76, 0x4d77,
+ 0x4d78, 0x4d79, 0x4d7a, 0x4d7b, 0x4d7c, 0x4d7d, 0x4d7e, 0x4d7f,
+ 0x4d80, 0x4d81, 0x4d82, 0x4d83, 0x4d84, 0x4d85, 0x4d86, 0x4d87,
+ 0x4d88, 0x4d89, 0x4d8a, 0x4d8b, 0x4d8c, 0x4d8d, 0x4d8e, 0x4d8f,
+ 0x4d90, 0x4d91, 0x4d92, 0x4d93, 0x4d94, 0x4d95, 0x4d96, 0x4d97,
+ 0x4d98, 0x4d99, 0x4d9a, 0x4d9b, 0x4d9c, 0x4d9d, 0x4d9e, 0x4d9f,
+ 0x4da0, 0x4da1, 0x4da2, 0x4da3, 0x4da4, 0x4da5, 0x4da6, 0x4da7,
+ 0x4da8, 0x4da9, 0x4daa, 0x4dab, 0x4dac, 0x4dad, 0x4dae, 0x4daf,
+ 0x4db0, 0x4db1, 0x4db2, 0x4db3, 0x4db4, 0x4db5, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x4dc0, 0x4dc1, 0x4dc2, 0x4dc3, 0x4dc4, 0x4dc5, 0x4dc6, 0x4dc7,
+ 0x4dc8, 0x4dc9, 0x4dca, 0x4dcb, 0x4dcc, 0x4dcd, 0x4dce, 0x4dcf,
+ 0x4dd0, 0x4dd1, 0x4dd2, 0x4dd3, 0x4dd4, 0x4dd5, 0x4dd6, 0x4dd7,
+ 0x4dd8, 0x4dd9, 0x4dda, 0x4ddb, 0x4ddc, 0x4ddd, 0x4dde, 0x4ddf,
+ 0x4de0, 0x4de1, 0x4de2, 0x4de3, 0x4de4, 0x4de5, 0x4de6, 0x4de7,
+ 0x4de8, 0x4de9, 0x4dea, 0x4deb, 0x4dec, 0x4ded, 0x4dee, 0x4def,
+ 0x4df0, 0x4df1, 0x4df2, 0x4df3, 0x4df4, 0x4df5, 0x4df6, 0x4df7,
+ 0x4df8, 0x4df9, 0x4dfa, 0x4dfb, 0x4dfc, 0x4dfd, 0x4dfe, 0x4dff,
+ 0x4e00, 0x4e01, 0x4e02, 0x4e03, 0x4e04, 0x4e05, 0x4e06, 0x4e07,
+ 0x4e08, 0x4e09, 0x4e0a, 0x4e0b, 0x4e0c, 0x4e0d, 0x4e0e, 0x4e0f,
+ 0x4e10, 0x4e11, 0x4e12, 0x4e13, 0x4e14, 0x4e15, 0x4e16, 0x4e17,
+ 0x4e18, 0x4e19, 0x4e1a, 0x4e1b, 0x4e1c, 0x4e1d, 0x4e1e, 0x4e1f,
+ 0x4e20, 0x4e21, 0x4e22, 0x4e23, 0x4e24, 0x4e25, 0x4e26, 0x4e27,
+ 0x4e28, 0x4e29, 0x4e2a, 0x4e2b, 0x4e2c, 0x4e2d, 0x4e2e, 0x4e2f,
+ 0x4e30, 0x4e31, 0x4e32, 0x4e33, 0x4e34, 0x4e35, 0x4e36, 0x4e37,
+ 0x4e38, 0x4e39, 0x4e3a, 0x4e3b, 0x4e3c, 0x4e3d, 0x4e3e, 0x4e3f,
+ 0x4e40, 0x4e41, 0x4e42, 0x4e43, 0x4e44, 0x4e45, 0x4e46, 0x4e47,
+ 0x4e48, 0x4e49, 0x4e4a, 0x4e4b, 0x4e4c, 0x4e4d, 0x4e4e, 0x4e4f,
+ 0x4e50, 0x4e51, 0x4e52, 0x4e53, 0x4e54, 0x4e55, 0x4e56, 0x4e57,
+ 0x4e58, 0x4e59, 0x4e5a, 0x4e5b, 0x4e5c, 0x4e5d, 0x4e5e, 0x4e5f,
+ 0x4e60, 0x4e61, 0x4e62, 0x4e63, 0x4e64, 0x4e65, 0x4e66, 0x4e67,
+ 0x4e68, 0x4e69, 0x4e6a, 0x4e6b, 0x4e6c, 0x4e6d, 0x4e6e, 0x4e6f,
+ 0x4e70, 0x4e71, 0x4e72, 0x4e73, 0x4e74, 0x4e75, 0x4e76, 0x4e77,
+ 0x4e78, 0x4e79, 0x4e7a, 0x4e7b, 0x4e7c, 0x4e7d, 0x4e7e, 0x4e7f,
+ 0x4e80, 0x4e81, 0x4e82, 0x4e83, 0x4e84, 0x4e85, 0x4e86, 0x4e87,
+ 0x4e88, 0x4e89, 0x4e8a, 0x4e8b, 0x4e8c, 0x4e8d, 0x4e8e, 0x4e8f,
+ 0x4e90, 0x4e91, 0x4e92, 0x4e93, 0x4e94, 0x4e95, 0x4e96, 0x4e97,
+ 0x4e98, 0x4e99, 0x4e9a, 0x4e9b, 0x4e9c, 0x4e9d, 0x4e9e, 0x4e9f,
+ 0x4ea0, 0x4ea1, 0x4ea2, 0x4ea3, 0x4ea4, 0x4ea5, 0x4ea6, 0x4ea7,
+ 0x4ea8, 0x4ea9, 0x4eaa, 0x4eab, 0x4eac, 0x4ead, 0x4eae, 0x4eaf,
+ 0x4eb0, 0x4eb1, 0x4eb2, 0x4eb3, 0x4eb4, 0x4eb5, 0x4eb6, 0x4eb7,
+ 0x4eb8, 0x4eb9, 0x4eba, 0x4ebb, 0x4ebc, 0x4ebd, 0x4ebe, 0x4ebf,
+ 0x4ec0, 0x4ec1, 0x4ec2, 0x4ec3, 0x4ec4, 0x4ec5, 0x4ec6, 0x4ec7,
+ 0x4ec8, 0x4ec9, 0x4eca, 0x4ecb, 0x4ecc, 0x4ecd, 0x4ece, 0x4ecf,
+ 0x4ed0, 0x4ed1, 0x4ed2, 0x4ed3, 0x4ed4, 0x4ed5, 0x4ed6, 0x4ed7,
+ 0x4ed8, 0x4ed9, 0x4eda, 0x4edb, 0x4edc, 0x4edd, 0x4ede, 0x4edf,
+ 0x4ee0, 0x4ee1, 0x4ee2, 0x4ee3, 0x4ee4, 0x4ee5, 0x4ee6, 0x4ee7,
+ 0x4ee8, 0x4ee9, 0x4eea, 0x4eeb, 0x4eec, 0x4eed, 0x4eee, 0x4eef,
+ 0x4ef0, 0x4ef1, 0x4ef2, 0x4ef3, 0x4ef4, 0x4ef5, 0x4ef6, 0x4ef7,
+ 0x4ef8, 0x4ef9, 0x4efa, 0x4efb, 0x4efc, 0x4efd, 0x4efe, 0x4eff,
+ 0x4f00, 0x4f01, 0x4f02, 0x4f03, 0x4f04, 0x4f05, 0x4f06, 0x4f07,
+ 0x4f08, 0x4f09, 0x4f0a, 0x4f0b, 0x4f0c, 0x4f0d, 0x4f0e, 0x4f0f,
+ 0x4f10, 0x4f11, 0x4f12, 0x4f13, 0x4f14, 0x4f15, 0x4f16, 0x4f17,
+ 0x4f18, 0x4f19, 0x4f1a, 0x4f1b, 0x4f1c, 0x4f1d, 0x4f1e, 0x4f1f,
+ 0x4f20, 0x4f21, 0x4f22, 0x4f23, 0x4f24, 0x4f25, 0x4f26, 0x4f27,
+ 0x4f28, 0x4f29, 0x4f2a, 0x4f2b, 0x4f2c, 0x4f2d, 0x4f2e, 0x4f2f,
+ 0x4f30, 0x4f31, 0x4f32, 0x4f33, 0x4f34, 0x4f35, 0x4f36, 0x4f37,
+ 0x4f38, 0x4f39, 0x4f3a, 0x4f3b, 0x4f3c, 0x4f3d, 0x4f3e, 0x4f3f,
+ 0x4f40, 0x4f41, 0x4f42, 0x4f43, 0x4f44, 0x4f45, 0x4f46, 0x4f47,
+ 0x4f48, 0x4f49, 0x4f4a, 0x4f4b, 0x4f4c, 0x4f4d, 0x4f4e, 0x4f4f,
+ 0x4f50, 0x4f51, 0x4f52, 0x4f53, 0x4f54, 0x4f55, 0x4f56, 0x4f57,
+ 0x4f58, 0x4f59, 0x4f5a, 0x4f5b, 0x4f5c, 0x4f5d, 0x4f5e, 0x4f5f,
+ 0x4f60, 0x4f61, 0x4f62, 0x4f63, 0x4f64, 0x4f65, 0x4f66, 0x4f67,
+ 0x4f68, 0x4f69, 0x4f6a, 0x4f6b, 0x4f6c, 0x4f6d, 0x4f6e, 0x4f6f,
+ 0x4f70, 0x4f71, 0x4f72, 0x4f73, 0x4f74, 0x4f75, 0x4f76, 0x4f77,
+ 0x4f78, 0x4f79, 0x4f7a, 0x4f7b, 0x4f7c, 0x4f7d, 0x4f7e, 0x4f7f,
+ 0x4f80, 0x4f81, 0x4f82, 0x4f83, 0x4f84, 0x4f85, 0x4f86, 0x4f87,
+ 0x4f88, 0x4f89, 0x4f8a, 0x4f8b, 0x4f8c, 0x4f8d, 0x4f8e, 0x4f8f,
+ 0x4f90, 0x4f91, 0x4f92, 0x4f93, 0x4f94, 0x4f95, 0x4f96, 0x4f97,
+ 0x4f98, 0x4f99, 0x4f9a, 0x4f9b, 0x4f9c, 0x4f9d, 0x4f9e, 0x4f9f,
+ 0x4fa0, 0x4fa1, 0x4fa2, 0x4fa3, 0x4fa4, 0x4fa5, 0x4fa6, 0x4fa7,
+ 0x4fa8, 0x4fa9, 0x4faa, 0x4fab, 0x4fac, 0x4fad, 0x4fae, 0x4faf,
+ 0x4fb0, 0x4fb1, 0x4fb2, 0x4fb3, 0x4fb4, 0x4fb5, 0x4fb6, 0x4fb7,
+ 0x4fb8, 0x4fb9, 0x4fba, 0x4fbb, 0x4fbc, 0x4fbd, 0x4fbe, 0x4fbf,
+ 0x4fc0, 0x4fc1, 0x4fc2, 0x4fc3, 0x4fc4, 0x4fc5, 0x4fc6, 0x4fc7,
+ 0x4fc8, 0x4fc9, 0x4fca, 0x4fcb, 0x4fcc, 0x4fcd, 0x4fce, 0x4fcf,
+ 0x4fd0, 0x4fd1, 0x4fd2, 0x4fd3, 0x4fd4, 0x4fd5, 0x4fd6, 0x4fd7,
+ 0x4fd8, 0x4fd9, 0x4fda, 0x4fdb, 0x4fdc, 0x4fdd, 0x4fde, 0x4fdf,
+ 0x4fe0, 0x4fe1, 0x4fe2, 0x4fe3, 0x4fe4, 0x4fe5, 0x4fe6, 0x4fe7,
+ 0x4fe8, 0x4fe9, 0x4fea, 0x4feb, 0x4fec, 0x4fed, 0x4fee, 0x4fef,
+ 0x4ff0, 0x4ff1, 0x4ff2, 0x4ff3, 0x4ff4, 0x4ff5, 0x4ff6, 0x4ff7,
+ 0x4ff8, 0x4ff9, 0x4ffa, 0x4ffb, 0x4ffc, 0x4ffd, 0x4ffe, 0x4fff,
+ 0x5000, 0x5001, 0x5002, 0x5003, 0x5004, 0x5005, 0x5006, 0x5007,
+ 0x5008, 0x5009, 0x500a, 0x500b, 0x500c, 0x500d, 0x500e, 0x500f,
+ 0x5010, 0x5011, 0x5012, 0x5013, 0x5014, 0x5015, 0x5016, 0x5017,
+ 0x5018, 0x5019, 0x501a, 0x501b, 0x501c, 0x501d, 0x501e, 0x501f,
+ 0x5020, 0x5021, 0x5022, 0x5023, 0x5024, 0x5025, 0x5026, 0x5027,
+ 0x5028, 0x5029, 0x502a, 0x502b, 0x502c, 0x502d, 0x502e, 0x502f,
+ 0x5030, 0x5031, 0x5032, 0x5033, 0x5034, 0x5035, 0x5036, 0x5037,
+ 0x5038, 0x5039, 0x503a, 0x503b, 0x503c, 0x503d, 0x503e, 0x503f,
+ 0x5040, 0x5041, 0x5042, 0x5043, 0x5044, 0x5045, 0x5046, 0x5047,
+ 0x5048, 0x5049, 0x504a, 0x504b, 0x504c, 0x504d, 0x504e, 0x504f,
+ 0x5050, 0x5051, 0x5052, 0x5053, 0x5054, 0x5055, 0x5056, 0x5057,
+ 0x5058, 0x5059, 0x505a, 0x505b, 0x505c, 0x505d, 0x505e, 0x505f,
+ 0x5060, 0x5061, 0x5062, 0x5063, 0x5064, 0x5065, 0x5066, 0x5067,
+ 0x5068, 0x5069, 0x506a, 0x506b, 0x506c, 0x506d, 0x506e, 0x506f,
+ 0x5070, 0x5071, 0x5072, 0x5073, 0x5074, 0x5075, 0x5076, 0x5077,
+ 0x5078, 0x5079, 0x507a, 0x507b, 0x507c, 0x507d, 0x507e, 0x507f,
+ 0x5080, 0x5081, 0x5082, 0x5083, 0x5084, 0x5085, 0x5086, 0x5087,
+ 0x5088, 0x5089, 0x508a, 0x508b, 0x508c, 0x508d, 0x508e, 0x508f,
+ 0x5090, 0x5091, 0x5092, 0x5093, 0x5094, 0x5095, 0x5096, 0x5097,
+ 0x5098, 0x5099, 0x509a, 0x509b, 0x509c, 0x509d, 0x509e, 0x509f,
+ 0x50a0, 0x50a1, 0x50a2, 0x50a3, 0x50a4, 0x50a5, 0x50a6, 0x50a7,
+ 0x50a8, 0x50a9, 0x50aa, 0x50ab, 0x50ac, 0x50ad, 0x50ae, 0x50af,
+ 0x50b0, 0x50b1, 0x50b2, 0x50b3, 0x50b4, 0x50b5, 0x50b6, 0x50b7,
+ 0x50b8, 0x50b9, 0x50ba, 0x50bb, 0x50bc, 0x50bd, 0x50be, 0x50bf,
+ 0x50c0, 0x50c1, 0x50c2, 0x50c3, 0x50c4, 0x50c5, 0x50c6, 0x50c7,
+ 0x50c8, 0x50c9, 0x50ca, 0x50cb, 0x50cc, 0x50cd, 0x50ce, 0x50cf,
+ 0x50d0, 0x50d1, 0x50d2, 0x50d3, 0x50d4, 0x50d5, 0x50d6, 0x50d7,
+ 0x50d8, 0x50d9, 0x50da, 0x50db, 0x50dc, 0x50dd, 0x50de, 0x50df,
+ 0x50e0, 0x50e1, 0x50e2, 0x50e3, 0x50e4, 0x50e5, 0x50e6, 0x50e7,
+ 0x50e8, 0x50e9, 0x50ea, 0x50eb, 0x50ec, 0x50ed, 0x50ee, 0x50ef,
+ 0x50f0, 0x50f1, 0x50f2, 0x50f3, 0x50f4, 0x50f5, 0x50f6, 0x50f7,
+ 0x50f8, 0x50f9, 0x50fa, 0x50fb, 0x50fc, 0x50fd, 0x50fe, 0x50ff,
+ 0x5100, 0x5101, 0x5102, 0x5103, 0x5104, 0x5105, 0x5106, 0x5107,
+ 0x5108, 0x5109, 0x510a, 0x510b, 0x510c, 0x510d, 0x510e, 0x510f,
+ 0x5110, 0x5111, 0x5112, 0x5113, 0x5114, 0x5115, 0x5116, 0x5117,
+ 0x5118, 0x5119, 0x511a, 0x511b, 0x511c, 0x511d, 0x511e, 0x511f,
+ 0x5120, 0x5121, 0x5122, 0x5123, 0x5124, 0x5125, 0x5126, 0x5127,
+ 0x5128, 0x5129, 0x512a, 0x512b, 0x512c, 0x512d, 0x512e, 0x512f,
+ 0x5130, 0x5131, 0x5132, 0x5133, 0x5134, 0x5135, 0x5136, 0x5137,
+ 0x5138, 0x5139, 0x513a, 0x513b, 0x513c, 0x513d, 0x513e, 0x513f,
+ 0x5140, 0x5141, 0x5142, 0x5143, 0x5144, 0x5145, 0x5146, 0x5147,
+ 0x5148, 0x5149, 0x514a, 0x514b, 0x514c, 0x514d, 0x514e, 0x514f,
+ 0x5150, 0x5151, 0x5152, 0x5153, 0x5154, 0x5155, 0x5156, 0x5157,
+ 0x5158, 0x5159, 0x515a, 0x515b, 0x515c, 0x515d, 0x515e, 0x515f,
+ 0x5160, 0x5161, 0x5162, 0x5163, 0x5164, 0x5165, 0x5166, 0x5167,
+ 0x5168, 0x5169, 0x516a, 0x516b, 0x516c, 0x516d, 0x516e, 0x516f,
+ 0x5170, 0x5171, 0x5172, 0x5173, 0x5174, 0x5175, 0x5176, 0x5177,
+ 0x5178, 0x5179, 0x517a, 0x517b, 0x517c, 0x517d, 0x517e, 0x517f,
+ 0x5180, 0x5181, 0x5182, 0x5183, 0x5184, 0x5185, 0x5186, 0x5187,
+ 0x5188, 0x5189, 0x518a, 0x518b, 0x518c, 0x518d, 0x518e, 0x518f,
+ 0x5190, 0x5191, 0x5192, 0x5193, 0x5194, 0x5195, 0x5196, 0x5197,
+ 0x5198, 0x5199, 0x519a, 0x519b, 0x519c, 0x519d, 0x519e, 0x519f,
+ 0x51a0, 0x51a1, 0x51a2, 0x51a3, 0x51a4, 0x51a5, 0x51a6, 0x51a7,
+ 0x51a8, 0x51a9, 0x51aa, 0x51ab, 0x51ac, 0x51ad, 0x51ae, 0x51af,
+ 0x51b0, 0x51b1, 0x51b2, 0x51b3, 0x51b4, 0x51b5, 0x51b6, 0x51b7,
+ 0x51b8, 0x51b9, 0x51ba, 0x51bb, 0x51bc, 0x51bd, 0x51be, 0x51bf,
+ 0x51c0, 0x51c1, 0x51c2, 0x51c3, 0x51c4, 0x51c5, 0x51c6, 0x51c7,
+ 0x51c8, 0x51c9, 0x51ca, 0x51cb, 0x51cc, 0x51cd, 0x51ce, 0x51cf,
+ 0x51d0, 0x51d1, 0x51d2, 0x51d3, 0x51d4, 0x51d5, 0x51d6, 0x51d7,
+ 0x51d8, 0x51d9, 0x51da, 0x51db, 0x51dc, 0x51dd, 0x51de, 0x51df,
+ 0x51e0, 0x51e1, 0x51e2, 0x51e3, 0x51e4, 0x51e5, 0x51e6, 0x51e7,
+ 0x51e8, 0x51e9, 0x51ea, 0x51eb, 0x51ec, 0x51ed, 0x51ee, 0x51ef,
+ 0x51f0, 0x51f1, 0x51f2, 0x51f3, 0x51f4, 0x51f5, 0x51f6, 0x51f7,
+ 0x51f8, 0x51f9, 0x51fa, 0x51fb, 0x51fc, 0x51fd, 0x51fe, 0x51ff,
+ 0x5200, 0x5201, 0x5202, 0x5203, 0x5204, 0x5205, 0x5206, 0x5207,
+ 0x5208, 0x5209, 0x520a, 0x520b, 0x520c, 0x520d, 0x520e, 0x520f,
+ 0x5210, 0x5211, 0x5212, 0x5213, 0x5214, 0x5215, 0x5216, 0x5217,
+ 0x5218, 0x5219, 0x521a, 0x521b, 0x521c, 0x521d, 0x521e, 0x521f,
+ 0x5220, 0x5221, 0x5222, 0x5223, 0x5224, 0x5225, 0x5226, 0x5227,
+ 0x5228, 0x5229, 0x522a, 0x522b, 0x522c, 0x522d, 0x522e, 0x522f,
+ 0x5230, 0x5231, 0x5232, 0x5233, 0x5234, 0x5235, 0x5236, 0x5237,
+ 0x5238, 0x5239, 0x523a, 0x523b, 0x523c, 0x523d, 0x523e, 0x523f,
+ 0x5240, 0x5241, 0x5242, 0x5243, 0x5244, 0x5245, 0x5246, 0x5247,
+ 0x5248, 0x5249, 0x524a, 0x524b, 0x524c, 0x524d, 0x524e, 0x524f,
+ 0x5250, 0x5251, 0x5252, 0x5253, 0x5254, 0x5255, 0x5256, 0x5257,
+ 0x5258, 0x5259, 0x525a, 0x525b, 0x525c, 0x525d, 0x525e, 0x525f,
+ 0x5260, 0x5261, 0x5262, 0x5263, 0x5264, 0x5265, 0x5266, 0x5267,
+ 0x5268, 0x5269, 0x526a, 0x526b, 0x526c, 0x526d, 0x526e, 0x526f,
+ 0x5270, 0x5271, 0x5272, 0x5273, 0x5274, 0x5275, 0x5276, 0x5277,
+ 0x5278, 0x5279, 0x527a, 0x527b, 0x527c, 0x527d, 0x527e, 0x527f,
+ 0x5280, 0x5281, 0x5282, 0x5283, 0x5284, 0x5285, 0x5286, 0x5287,
+ 0x5288, 0x5289, 0x528a, 0x528b, 0x528c, 0x528d, 0x528e, 0x528f,
+ 0x5290, 0x5291, 0x5292, 0x5293, 0x5294, 0x5295, 0x5296, 0x5297,
+ 0x5298, 0x5299, 0x529a, 0x529b, 0x529c, 0x529d, 0x529e, 0x529f,
+ 0x52a0, 0x52a1, 0x52a2, 0x52a3, 0x52a4, 0x52a5, 0x52a6, 0x52a7,
+ 0x52a8, 0x52a9, 0x52aa, 0x52ab, 0x52ac, 0x52ad, 0x52ae, 0x52af,
+ 0x52b0, 0x52b1, 0x52b2, 0x52b3, 0x52b4, 0x52b5, 0x52b6, 0x52b7,
+ 0x52b8, 0x52b9, 0x52ba, 0x52bb, 0x52bc, 0x52bd, 0x52be, 0x52bf,
+ 0x52c0, 0x52c1, 0x52c2, 0x52c3, 0x52c4, 0x52c5, 0x52c6, 0x52c7,
+ 0x52c8, 0x52c9, 0x52ca, 0x52cb, 0x52cc, 0x52cd, 0x52ce, 0x52cf,
+ 0x52d0, 0x52d1, 0x52d2, 0x52d3, 0x52d4, 0x52d5, 0x52d6, 0x52d7,
+ 0x52d8, 0x52d9, 0x52da, 0x52db, 0x52dc, 0x52dd, 0x52de, 0x52df,
+ 0x52e0, 0x52e1, 0x52e2, 0x52e3, 0x52e4, 0x52e5, 0x52e6, 0x52e7,
+ 0x52e8, 0x52e9, 0x52ea, 0x52eb, 0x52ec, 0x52ed, 0x52ee, 0x52ef,
+ 0x52f0, 0x52f1, 0x52f2, 0x52f3, 0x52f4, 0x52f5, 0x52f6, 0x52f7,
+ 0x52f8, 0x52f9, 0x52fa, 0x52fb, 0x52fc, 0x52fd, 0x52fe, 0x52ff,
+ 0x5300, 0x5301, 0x5302, 0x5303, 0x5304, 0x5305, 0x5306, 0x5307,
+ 0x5308, 0x5309, 0x530a, 0x530b, 0x530c, 0x530d, 0x530e, 0x530f,
+ 0x5310, 0x5311, 0x5312, 0x5313, 0x5314, 0x5315, 0x5316, 0x5317,
+ 0x5318, 0x5319, 0x531a, 0x531b, 0x531c, 0x531d, 0x531e, 0x531f,
+ 0x5320, 0x5321, 0x5322, 0x5323, 0x5324, 0x5325, 0x5326, 0x5327,
+ 0x5328, 0x5329, 0x532a, 0x532b, 0x532c, 0x532d, 0x532e, 0x532f,
+ 0x5330, 0x5331, 0x5332, 0x5333, 0x5334, 0x5335, 0x5336, 0x5337,
+ 0x5338, 0x5339, 0x533a, 0x533b, 0x533c, 0x533d, 0x533e, 0x533f,
+ 0x5340, 0x5341, 0x5342, 0x5343, 0x5344, 0x5345, 0x5346, 0x5347,
+ 0x5348, 0x5349, 0x534a, 0x534b, 0x534c, 0x534d, 0x534e, 0x534f,
+ 0x5350, 0x5351, 0x5352, 0x5353, 0x5354, 0x5355, 0x5356, 0x5357,
+ 0x5358, 0x5359, 0x535a, 0x535b, 0x535c, 0x535d, 0x535e, 0x535f,
+ 0x5360, 0x5361, 0x5362, 0x5363, 0x5364, 0x5365, 0x5366, 0x5367,
+ 0x5368, 0x5369, 0x536a, 0x536b, 0x536c, 0x536d, 0x536e, 0x536f,
+ 0x5370, 0x5371, 0x5372, 0x5373, 0x5374, 0x5375, 0x5376, 0x5377,
+ 0x5378, 0x5379, 0x537a, 0x537b, 0x537c, 0x537d, 0x537e, 0x537f,
+ 0x5380, 0x5381, 0x5382, 0x5383, 0x5384, 0x5385, 0x5386, 0x5387,
+ 0x5388, 0x5389, 0x538a, 0x538b, 0x538c, 0x538d, 0x538e, 0x538f,
+ 0x5390, 0x5391, 0x5392, 0x5393, 0x5394, 0x5395, 0x5396, 0x5397,
+ 0x5398, 0x5399, 0x539a, 0x539b, 0x539c, 0x539d, 0x539e, 0x539f,
+ 0x53a0, 0x53a1, 0x53a2, 0x53a3, 0x53a4, 0x53a5, 0x53a6, 0x53a7,
+ 0x53a8, 0x53a9, 0x53aa, 0x53ab, 0x53ac, 0x53ad, 0x53ae, 0x53af,
+ 0x53b0, 0x53b1, 0x53b2, 0x53b3, 0x53b4, 0x53b5, 0x53b6, 0x53b7,
+ 0x53b8, 0x53b9, 0x53ba, 0x53bb, 0x53bc, 0x53bd, 0x53be, 0x53bf,
+ 0x53c0, 0x53c1, 0x53c2, 0x53c3, 0x53c4, 0x53c5, 0x53c6, 0x53c7,
+ 0x53c8, 0x53c9, 0x53ca, 0x53cb, 0x53cc, 0x53cd, 0x53ce, 0x53cf,
+ 0x53d0, 0x53d1, 0x53d2, 0x53d3, 0x53d4, 0x53d5, 0x53d6, 0x53d7,
+ 0x53d8, 0x53d9, 0x53da, 0x53db, 0x53dc, 0x53dd, 0x53de, 0x53df,
+ 0x53e0, 0x53e1, 0x53e2, 0x53e3, 0x53e4, 0x53e5, 0x53e6, 0x53e7,
+ 0x53e8, 0x53e9, 0x53ea, 0x53eb, 0x53ec, 0x53ed, 0x53ee, 0x53ef,
+ 0x53f0, 0x53f1, 0x53f2, 0x53f3, 0x53f4, 0x53f5, 0x53f6, 0x53f7,
+ 0x53f8, 0x53f9, 0x53fa, 0x53fb, 0x53fc, 0x53fd, 0x53fe, 0x53ff,
+ 0x5400, 0x5401, 0x5402, 0x5403, 0x5404, 0x5405, 0x5406, 0x5407,
+ 0x5408, 0x5409, 0x540a, 0x540b, 0x540c, 0x540d, 0x540e, 0x540f,
+ 0x5410, 0x5411, 0x5412, 0x5413, 0x5414, 0x5415, 0x5416, 0x5417,
+ 0x5418, 0x5419, 0x541a, 0x541b, 0x541c, 0x541d, 0x541e, 0x541f,
+ 0x5420, 0x5421, 0x5422, 0x5423, 0x5424, 0x5425, 0x5426, 0x5427,
+ 0x5428, 0x5429, 0x542a, 0x542b, 0x542c, 0x542d, 0x542e, 0x542f,
+ 0x5430, 0x5431, 0x5432, 0x5433, 0x5434, 0x5435, 0x5436, 0x5437,
+ 0x5438, 0x5439, 0x543a, 0x543b, 0x543c, 0x543d, 0x543e, 0x543f,
+ 0x5440, 0x5441, 0x5442, 0x5443, 0x5444, 0x5445, 0x5446, 0x5447,
+ 0x5448, 0x5449, 0x544a, 0x544b, 0x544c, 0x544d, 0x544e, 0x544f,
+ 0x5450, 0x5451, 0x5452, 0x5453, 0x5454, 0x5455, 0x5456, 0x5457,
+ 0x5458, 0x5459, 0x545a, 0x545b, 0x545c, 0x545d, 0x545e, 0x545f,
+ 0x5460, 0x5461, 0x5462, 0x5463, 0x5464, 0x5465, 0x5466, 0x5467,
+ 0x5468, 0x5469, 0x546a, 0x546b, 0x546c, 0x546d, 0x546e, 0x546f,
+ 0x5470, 0x5471, 0x5472, 0x5473, 0x5474, 0x5475, 0x5476, 0x5477,
+ 0x5478, 0x5479, 0x547a, 0x547b, 0x547c, 0x547d, 0x547e, 0x547f,
+ 0x5480, 0x5481, 0x5482, 0x5483, 0x5484, 0x5485, 0x5486, 0x5487,
+ 0x5488, 0x5489, 0x548a, 0x548b, 0x548c, 0x548d, 0x548e, 0x548f,
+ 0x5490, 0x5491, 0x5492, 0x5493, 0x5494, 0x5495, 0x5496, 0x5497,
+ 0x5498, 0x5499, 0x549a, 0x549b, 0x549c, 0x549d, 0x549e, 0x549f,
+ 0x54a0, 0x54a1, 0x54a2, 0x54a3, 0x54a4, 0x54a5, 0x54a6, 0x54a7,
+ 0x54a8, 0x54a9, 0x54aa, 0x54ab, 0x54ac, 0x54ad, 0x54ae, 0x54af,
+ 0x54b0, 0x54b1, 0x54b2, 0x54b3, 0x54b4, 0x54b5, 0x54b6, 0x54b7,
+ 0x54b8, 0x54b9, 0x54ba, 0x54bb, 0x54bc, 0x54bd, 0x54be, 0x54bf,
+ 0x54c0, 0x54c1, 0x54c2, 0x54c3, 0x54c4, 0x54c5, 0x54c6, 0x54c7,
+ 0x54c8, 0x54c9, 0x54ca, 0x54cb, 0x54cc, 0x54cd, 0x54ce, 0x54cf,
+ 0x54d0, 0x54d1, 0x54d2, 0x54d3, 0x54d4, 0x54d5, 0x54d6, 0x54d7,
+ 0x54d8, 0x54d9, 0x54da, 0x54db, 0x54dc, 0x54dd, 0x54de, 0x54df,
+ 0x54e0, 0x54e1, 0x54e2, 0x54e3, 0x54e4, 0x54e5, 0x54e6, 0x54e7,
+ 0x54e8, 0x54e9, 0x54ea, 0x54eb, 0x54ec, 0x54ed, 0x54ee, 0x54ef,
+ 0x54f0, 0x54f1, 0x54f2, 0x54f3, 0x54f4, 0x54f5, 0x54f6, 0x54f7,
+ 0x54f8, 0x54f9, 0x54fa, 0x54fb, 0x54fc, 0x54fd, 0x54fe, 0x54ff,
+ 0x5500, 0x5501, 0x5502, 0x5503, 0x5504, 0x5505, 0x5506, 0x5507,
+ 0x5508, 0x5509, 0x550a, 0x550b, 0x550c, 0x550d, 0x550e, 0x550f,
+ 0x5510, 0x5511, 0x5512, 0x5513, 0x5514, 0x5515, 0x5516, 0x5517,
+ 0x5518, 0x5519, 0x551a, 0x551b, 0x551c, 0x551d, 0x551e, 0x551f,
+ 0x5520, 0x5521, 0x5522, 0x5523, 0x5524, 0x5525, 0x5526, 0x5527,
+ 0x5528, 0x5529, 0x552a, 0x552b, 0x552c, 0x552d, 0x552e, 0x552f,
+ 0x5530, 0x5531, 0x5532, 0x5533, 0x5534, 0x5535, 0x5536, 0x5537,
+ 0x5538, 0x5539, 0x553a, 0x553b, 0x553c, 0x553d, 0x553e, 0x553f,
+ 0x5540, 0x5541, 0x5542, 0x5543, 0x5544, 0x5545, 0x5546, 0x5547,
+ 0x5548, 0x5549, 0x554a, 0x554b, 0x554c, 0x554d, 0x554e, 0x554f,
+ 0x5550, 0x5551, 0x5552, 0x5553, 0x5554, 0x5555, 0x5556, 0x5557,
+ 0x5558, 0x5559, 0x555a, 0x555b, 0x555c, 0x555d, 0x555e, 0x555f,
+ 0x5560, 0x5561, 0x5562, 0x5563, 0x5564, 0x5565, 0x5566, 0x5567,
+ 0x5568, 0x5569, 0x556a, 0x556b, 0x556c, 0x556d, 0x556e, 0x556f,
+ 0x5570, 0x5571, 0x5572, 0x5573, 0x5574, 0x5575, 0x5576, 0x5577,
+ 0x5578, 0x5579, 0x557a, 0x557b, 0x557c, 0x557d, 0x557e, 0x557f,
+ 0x5580, 0x5581, 0x5582, 0x5583, 0x5584, 0x5585, 0x5586, 0x5587,
+ 0x5588, 0x5589, 0x558a, 0x558b, 0x558c, 0x558d, 0x558e, 0x558f,
+ 0x5590, 0x5591, 0x5592, 0x5593, 0x5594, 0x5595, 0x5596, 0x5597,
+ 0x5598, 0x5599, 0x559a, 0x559b, 0x559c, 0x559d, 0x559e, 0x559f,
+ 0x55a0, 0x55a1, 0x55a2, 0x55a3, 0x55a4, 0x55a5, 0x55a6, 0x55a7,
+ 0x55a8, 0x55a9, 0x55aa, 0x55ab, 0x55ac, 0x55ad, 0x55ae, 0x55af,
+ 0x55b0, 0x55b1, 0x55b2, 0x55b3, 0x55b4, 0x55b5, 0x55b6, 0x55b7,
+ 0x55b8, 0x55b9, 0x55ba, 0x55bb, 0x55bc, 0x55bd, 0x55be, 0x55bf,
+ 0x55c0, 0x55c1, 0x55c2, 0x55c3, 0x55c4, 0x55c5, 0x55c6, 0x55c7,
+ 0x55c8, 0x55c9, 0x55ca, 0x55cb, 0x55cc, 0x55cd, 0x55ce, 0x55cf,
+ 0x55d0, 0x55d1, 0x55d2, 0x55d3, 0x55d4, 0x55d5, 0x55d6, 0x55d7,
+ 0x55d8, 0x55d9, 0x55da, 0x55db, 0x55dc, 0x55dd, 0x55de, 0x55df,
+ 0x55e0, 0x55e1, 0x55e2, 0x55e3, 0x55e4, 0x55e5, 0x55e6, 0x55e7,
+ 0x55e8, 0x55e9, 0x55ea, 0x55eb, 0x55ec, 0x55ed, 0x55ee, 0x55ef,
+ 0x55f0, 0x55f1, 0x55f2, 0x55f3, 0x55f4, 0x55f5, 0x55f6, 0x55f7,
+ 0x55f8, 0x55f9, 0x55fa, 0x55fb, 0x55fc, 0x55fd, 0x55fe, 0x55ff,
+ 0x5600, 0x5601, 0x5602, 0x5603, 0x5604, 0x5605, 0x5606, 0x5607,
+ 0x5608, 0x5609, 0x560a, 0x560b, 0x560c, 0x560d, 0x560e, 0x560f,
+ 0x5610, 0x5611, 0x5612, 0x5613, 0x5614, 0x5615, 0x5616, 0x5617,
+ 0x5618, 0x5619, 0x561a, 0x561b, 0x561c, 0x561d, 0x561e, 0x561f,
+ 0x5620, 0x5621, 0x5622, 0x5623, 0x5624, 0x5625, 0x5626, 0x5627,
+ 0x5628, 0x5629, 0x562a, 0x562b, 0x562c, 0x562d, 0x562e, 0x562f,
+ 0x5630, 0x5631, 0x5632, 0x5633, 0x5634, 0x5635, 0x5636, 0x5637,
+ 0x5638, 0x5639, 0x563a, 0x563b, 0x563c, 0x563d, 0x563e, 0x563f,
+ 0x5640, 0x5641, 0x5642, 0x5643, 0x5644, 0x5645, 0x5646, 0x5647,
+ 0x5648, 0x5649, 0x564a, 0x564b, 0x564c, 0x564d, 0x564e, 0x564f,
+ 0x5650, 0x5651, 0x5652, 0x5653, 0x5654, 0x5655, 0x5656, 0x5657,
+ 0x5658, 0x5659, 0x565a, 0x565b, 0x565c, 0x565d, 0x565e, 0x565f,
+ 0x5660, 0x5661, 0x5662, 0x5663, 0x5664, 0x5665, 0x5666, 0x5667,
+ 0x5668, 0x5669, 0x566a, 0x566b, 0x566c, 0x566d, 0x566e, 0x566f,
+ 0x5670, 0x5671, 0x5672, 0x5673, 0x5674, 0x5675, 0x5676, 0x5677,
+ 0x5678, 0x5679, 0x567a, 0x567b, 0x567c, 0x567d, 0x567e, 0x567f,
+ 0x5680, 0x5681, 0x5682, 0x5683, 0x5684, 0x5685, 0x5686, 0x5687,
+ 0x5688, 0x5689, 0x568a, 0x568b, 0x568c, 0x568d, 0x568e, 0x568f,
+ 0x5690, 0x5691, 0x5692, 0x5693, 0x5694, 0x5695, 0x5696, 0x5697,
+ 0x5698, 0x5699, 0x569a, 0x569b, 0x569c, 0x569d, 0x569e, 0x569f,
+ 0x56a0, 0x56a1, 0x56a2, 0x56a3, 0x56a4, 0x56a5, 0x56a6, 0x56a7,
+ 0x56a8, 0x56a9, 0x56aa, 0x56ab, 0x56ac, 0x56ad, 0x56ae, 0x56af,
+ 0x56b0, 0x56b1, 0x56b2, 0x56b3, 0x56b4, 0x56b5, 0x56b6, 0x56b7,
+ 0x56b8, 0x56b9, 0x56ba, 0x56bb, 0x56bc, 0x56bd, 0x56be, 0x56bf,
+ 0x56c0, 0x56c1, 0x56c2, 0x56c3, 0x56c4, 0x56c5, 0x56c6, 0x56c7,
+ 0x56c8, 0x56c9, 0x56ca, 0x56cb, 0x56cc, 0x56cd, 0x56ce, 0x56cf,
+ 0x56d0, 0x56d1, 0x56d2, 0x56d3, 0x56d4, 0x56d5, 0x56d6, 0x56d7,
+ 0x56d8, 0x56d9, 0x56da, 0x56db, 0x56dc, 0x56dd, 0x56de, 0x56df,
+ 0x56e0, 0x56e1, 0x56e2, 0x56e3, 0x56e4, 0x56e5, 0x56e6, 0x56e7,
+ 0x56e8, 0x56e9, 0x56ea, 0x56eb, 0x56ec, 0x56ed, 0x56ee, 0x56ef,
+ 0x56f0, 0x56f1, 0x56f2, 0x56f3, 0x56f4, 0x56f5, 0x56f6, 0x56f7,
+ 0x56f8, 0x56f9, 0x56fa, 0x56fb, 0x56fc, 0x56fd, 0x56fe, 0x56ff,
+ 0x5700, 0x5701, 0x5702, 0x5703, 0x5704, 0x5705, 0x5706, 0x5707,
+ 0x5708, 0x5709, 0x570a, 0x570b, 0x570c, 0x570d, 0x570e, 0x570f,
+ 0x5710, 0x5711, 0x5712, 0x5713, 0x5714, 0x5715, 0x5716, 0x5717,
+ 0x5718, 0x5719, 0x571a, 0x571b, 0x571c, 0x571d, 0x571e, 0x571f,
+ 0x5720, 0x5721, 0x5722, 0x5723, 0x5724, 0x5725, 0x5726, 0x5727,
+ 0x5728, 0x5729, 0x572a, 0x572b, 0x572c, 0x572d, 0x572e, 0x572f,
+ 0x5730, 0x5731, 0x5732, 0x5733, 0x5734, 0x5735, 0x5736, 0x5737,
+ 0x5738, 0x5739, 0x573a, 0x573b, 0x573c, 0x573d, 0x573e, 0x573f,
+ 0x5740, 0x5741, 0x5742, 0x5743, 0x5744, 0x5745, 0x5746, 0x5747,
+ 0x5748, 0x5749, 0x574a, 0x574b, 0x574c, 0x574d, 0x574e, 0x574f,
+ 0x5750, 0x5751, 0x5752, 0x5753, 0x5754, 0x5755, 0x5756, 0x5757,
+ 0x5758, 0x5759, 0x575a, 0x575b, 0x575c, 0x575d, 0x575e, 0x575f,
+ 0x5760, 0x5761, 0x5762, 0x5763, 0x5764, 0x5765, 0x5766, 0x5767,
+ 0x5768, 0x5769, 0x576a, 0x576b, 0x576c, 0x576d, 0x576e, 0x576f,
+ 0x5770, 0x5771, 0x5772, 0x5773, 0x5774, 0x5775, 0x5776, 0x5777,
+ 0x5778, 0x5779, 0x577a, 0x577b, 0x577c, 0x577d, 0x577e, 0x577f,
+ 0x5780, 0x5781, 0x5782, 0x5783, 0x5784, 0x5785, 0x5786, 0x5787,
+ 0x5788, 0x5789, 0x578a, 0x578b, 0x578c, 0x578d, 0x578e, 0x578f,
+ 0x5790, 0x5791, 0x5792, 0x5793, 0x5794, 0x5795, 0x5796, 0x5797,
+ 0x5798, 0x5799, 0x579a, 0x579b, 0x579c, 0x579d, 0x579e, 0x579f,
+ 0x57a0, 0x57a1, 0x57a2, 0x57a3, 0x57a4, 0x57a5, 0x57a6, 0x57a7,
+ 0x57a8, 0x57a9, 0x57aa, 0x57ab, 0x57ac, 0x57ad, 0x57ae, 0x57af,
+ 0x57b0, 0x57b1, 0x57b2, 0x57b3, 0x57b4, 0x57b5, 0x57b6, 0x57b7,
+ 0x57b8, 0x57b9, 0x57ba, 0x57bb, 0x57bc, 0x57bd, 0x57be, 0x57bf,
+ 0x57c0, 0x57c1, 0x57c2, 0x57c3, 0x57c4, 0x57c5, 0x57c6, 0x57c7,
+ 0x57c8, 0x57c9, 0x57ca, 0x57cb, 0x57cc, 0x57cd, 0x57ce, 0x57cf,
+ 0x57d0, 0x57d1, 0x57d2, 0x57d3, 0x57d4, 0x57d5, 0x57d6, 0x57d7,
+ 0x57d8, 0x57d9, 0x57da, 0x57db, 0x57dc, 0x57dd, 0x57de, 0x57df,
+ 0x57e0, 0x57e1, 0x57e2, 0x57e3, 0x57e4, 0x57e5, 0x57e6, 0x57e7,
+ 0x57e8, 0x57e9, 0x57ea, 0x57eb, 0x57ec, 0x57ed, 0x57ee, 0x57ef,
+ 0x57f0, 0x57f1, 0x57f2, 0x57f3, 0x57f4, 0x57f5, 0x57f6, 0x57f7,
+ 0x57f8, 0x57f9, 0x57fa, 0x57fb, 0x57fc, 0x57fd, 0x57fe, 0x57ff,
+ 0x5800, 0x5801, 0x5802, 0x5803, 0x5804, 0x5805, 0x5806, 0x5807,
+ 0x5808, 0x5809, 0x580a, 0x580b, 0x580c, 0x580d, 0x580e, 0x580f,
+ 0x5810, 0x5811, 0x5812, 0x5813, 0x5814, 0x5815, 0x5816, 0x5817,
+ 0x5818, 0x5819, 0x581a, 0x581b, 0x581c, 0x581d, 0x581e, 0x581f,
+ 0x5820, 0x5821, 0x5822, 0x5823, 0x5824, 0x5825, 0x5826, 0x5827,
+ 0x5828, 0x5829, 0x582a, 0x582b, 0x582c, 0x582d, 0x582e, 0x582f,
+ 0x5830, 0x5831, 0x5832, 0x5833, 0x5834, 0x5835, 0x5836, 0x5837,
+ 0x5838, 0x5839, 0x583a, 0x583b, 0x583c, 0x583d, 0x583e, 0x583f,
+ 0x5840, 0x5841, 0x5842, 0x5843, 0x5844, 0x5845, 0x5846, 0x5847,
+ 0x5848, 0x5849, 0x584a, 0x584b, 0x584c, 0x584d, 0x584e, 0x584f,
+ 0x5850, 0x5851, 0x5852, 0x5853, 0x5854, 0x5855, 0x5856, 0x5857,
+ 0x5858, 0x5859, 0x585a, 0x585b, 0x585c, 0x585d, 0x585e, 0x585f,
+ 0x5860, 0x5861, 0x5862, 0x5863, 0x5864, 0x5865, 0x5866, 0x5867,
+ 0x5868, 0x5869, 0x586a, 0x586b, 0x586c, 0x586d, 0x586e, 0x586f,
+ 0x5870, 0x5871, 0x5872, 0x5873, 0x5874, 0x5875, 0x5876, 0x5877,
+ 0x5878, 0x5879, 0x587a, 0x587b, 0x587c, 0x587d, 0x587e, 0x587f,
+ 0x5880, 0x5881, 0x5882, 0x5883, 0x5884, 0x5885, 0x5886, 0x5887,
+ 0x5888, 0x5889, 0x588a, 0x588b, 0x588c, 0x588d, 0x588e, 0x588f,
+ 0x5890, 0x5891, 0x5892, 0x5893, 0x5894, 0x5895, 0x5896, 0x5897,
+ 0x5898, 0x5899, 0x589a, 0x589b, 0x589c, 0x589d, 0x589e, 0x589f,
+ 0x58a0, 0x58a1, 0x58a2, 0x58a3, 0x58a4, 0x58a5, 0x58a6, 0x58a7,
+ 0x58a8, 0x58a9, 0x58aa, 0x58ab, 0x58ac, 0x58ad, 0x58ae, 0x58af,
+ 0x58b0, 0x58b1, 0x58b2, 0x58b3, 0x58b4, 0x58b5, 0x58b6, 0x58b7,
+ 0x58b8, 0x58b9, 0x58ba, 0x58bb, 0x58bc, 0x58bd, 0x58be, 0x58bf,
+ 0x58c0, 0x58c1, 0x58c2, 0x58c3, 0x58c4, 0x58c5, 0x58c6, 0x58c7,
+ 0x58c8, 0x58c9, 0x58ca, 0x58cb, 0x58cc, 0x58cd, 0x58ce, 0x58cf,
+ 0x58d0, 0x58d1, 0x58d2, 0x58d3, 0x58d4, 0x58d5, 0x58d6, 0x58d7,
+ 0x58d8, 0x58d9, 0x58da, 0x58db, 0x58dc, 0x58dd, 0x58de, 0x58df,
+ 0x58e0, 0x58e1, 0x58e2, 0x58e3, 0x58e4, 0x58e5, 0x58e6, 0x58e7,
+ 0x58e8, 0x58e9, 0x58ea, 0x58eb, 0x58ec, 0x58ed, 0x58ee, 0x58ef,
+ 0x58f0, 0x58f1, 0x58f2, 0x58f3, 0x58f4, 0x58f5, 0x58f6, 0x58f7,
+ 0x58f8, 0x58f9, 0x58fa, 0x58fb, 0x58fc, 0x58fd, 0x58fe, 0x58ff,
+ 0x5900, 0x5901, 0x5902, 0x5903, 0x5904, 0x5905, 0x5906, 0x5907,
+ 0x5908, 0x5909, 0x590a, 0x590b, 0x590c, 0x590d, 0x590e, 0x590f,
+ 0x5910, 0x5911, 0x5912, 0x5913, 0x5914, 0x5915, 0x5916, 0x5917,
+ 0x5918, 0x5919, 0x591a, 0x591b, 0x591c, 0x591d, 0x591e, 0x591f,
+ 0x5920, 0x5921, 0x5922, 0x5923, 0x5924, 0x5925, 0x5926, 0x5927,
+ 0x5928, 0x5929, 0x592a, 0x592b, 0x592c, 0x592d, 0x592e, 0x592f,
+ 0x5930, 0x5931, 0x5932, 0x5933, 0x5934, 0x5935, 0x5936, 0x5937,
+ 0x5938, 0x5939, 0x593a, 0x593b, 0x593c, 0x593d, 0x593e, 0x593f,
+ 0x5940, 0x5941, 0x5942, 0x5943, 0x5944, 0x5945, 0x5946, 0x5947,
+ 0x5948, 0x5949, 0x594a, 0x594b, 0x594c, 0x594d, 0x594e, 0x594f,
+ 0x5950, 0x5951, 0x5952, 0x5953, 0x5954, 0x5955, 0x5956, 0x5957,
+ 0x5958, 0x5959, 0x595a, 0x595b, 0x595c, 0x595d, 0x595e, 0x595f,
+ 0x5960, 0x5961, 0x5962, 0x5963, 0x5964, 0x5965, 0x5966, 0x5967,
+ 0x5968, 0x5969, 0x596a, 0x596b, 0x596c, 0x596d, 0x596e, 0x596f,
+ 0x5970, 0x5971, 0x5972, 0x5973, 0x5974, 0x5975, 0x5976, 0x5977,
+ 0x5978, 0x5979, 0x597a, 0x597b, 0x597c, 0x597d, 0x597e, 0x597f,
+ 0x5980, 0x5981, 0x5982, 0x5983, 0x5984, 0x5985, 0x5986, 0x5987,
+ 0x5988, 0x5989, 0x598a, 0x598b, 0x598c, 0x598d, 0x598e, 0x598f,
+ 0x5990, 0x5991, 0x5992, 0x5993, 0x5994, 0x5995, 0x5996, 0x5997,
+ 0x5998, 0x5999, 0x599a, 0x599b, 0x599c, 0x599d, 0x599e, 0x599f,
+ 0x59a0, 0x59a1, 0x59a2, 0x59a3, 0x59a4, 0x59a5, 0x59a6, 0x59a7,
+ 0x59a8, 0x59a9, 0x59aa, 0x59ab, 0x59ac, 0x59ad, 0x59ae, 0x59af,
+ 0x59b0, 0x59b1, 0x59b2, 0x59b3, 0x59b4, 0x59b5, 0x59b6, 0x59b7,
+ 0x59b8, 0x59b9, 0x59ba, 0x59bb, 0x59bc, 0x59bd, 0x59be, 0x59bf,
+ 0x59c0, 0x59c1, 0x59c2, 0x59c3, 0x59c4, 0x59c5, 0x59c6, 0x59c7,
+ 0x59c8, 0x59c9, 0x59ca, 0x59cb, 0x59cc, 0x59cd, 0x59ce, 0x59cf,
+ 0x59d0, 0x59d1, 0x59d2, 0x59d3, 0x59d4, 0x59d5, 0x59d6, 0x59d7,
+ 0x59d8, 0x59d9, 0x59da, 0x59db, 0x59dc, 0x59dd, 0x59de, 0x59df,
+ 0x59e0, 0x59e1, 0x59e2, 0x59e3, 0x59e4, 0x59e5, 0x59e6, 0x59e7,
+ 0x59e8, 0x59e9, 0x59ea, 0x59eb, 0x59ec, 0x59ed, 0x59ee, 0x59ef,
+ 0x59f0, 0x59f1, 0x59f2, 0x59f3, 0x59f4, 0x59f5, 0x59f6, 0x59f7,
+ 0x59f8, 0x59f9, 0x59fa, 0x59fb, 0x59fc, 0x59fd, 0x59fe, 0x59ff,
+ 0x5a00, 0x5a01, 0x5a02, 0x5a03, 0x5a04, 0x5a05, 0x5a06, 0x5a07,
+ 0x5a08, 0x5a09, 0x5a0a, 0x5a0b, 0x5a0c, 0x5a0d, 0x5a0e, 0x5a0f,
+ 0x5a10, 0x5a11, 0x5a12, 0x5a13, 0x5a14, 0x5a15, 0x5a16, 0x5a17,
+ 0x5a18, 0x5a19, 0x5a1a, 0x5a1b, 0x5a1c, 0x5a1d, 0x5a1e, 0x5a1f,
+ 0x5a20, 0x5a21, 0x5a22, 0x5a23, 0x5a24, 0x5a25, 0x5a26, 0x5a27,
+ 0x5a28, 0x5a29, 0x5a2a, 0x5a2b, 0x5a2c, 0x5a2d, 0x5a2e, 0x5a2f,
+ 0x5a30, 0x5a31, 0x5a32, 0x5a33, 0x5a34, 0x5a35, 0x5a36, 0x5a37,
+ 0x5a38, 0x5a39, 0x5a3a, 0x5a3b, 0x5a3c, 0x5a3d, 0x5a3e, 0x5a3f,
+ 0x5a40, 0x5a41, 0x5a42, 0x5a43, 0x5a44, 0x5a45, 0x5a46, 0x5a47,
+ 0x5a48, 0x5a49, 0x5a4a, 0x5a4b, 0x5a4c, 0x5a4d, 0x5a4e, 0x5a4f,
+ 0x5a50, 0x5a51, 0x5a52, 0x5a53, 0x5a54, 0x5a55, 0x5a56, 0x5a57,
+ 0x5a58, 0x5a59, 0x5a5a, 0x5a5b, 0x5a5c, 0x5a5d, 0x5a5e, 0x5a5f,
+ 0x5a60, 0x5a61, 0x5a62, 0x5a63, 0x5a64, 0x5a65, 0x5a66, 0x5a67,
+ 0x5a68, 0x5a69, 0x5a6a, 0x5a6b, 0x5a6c, 0x5a6d, 0x5a6e, 0x5a6f,
+ 0x5a70, 0x5a71, 0x5a72, 0x5a73, 0x5a74, 0x5a75, 0x5a76, 0x5a77,
+ 0x5a78, 0x5a79, 0x5a7a, 0x5a7b, 0x5a7c, 0x5a7d, 0x5a7e, 0x5a7f,
+ 0x5a80, 0x5a81, 0x5a82, 0x5a83, 0x5a84, 0x5a85, 0x5a86, 0x5a87,
+ 0x5a88, 0x5a89, 0x5a8a, 0x5a8b, 0x5a8c, 0x5a8d, 0x5a8e, 0x5a8f,
+ 0x5a90, 0x5a91, 0x5a92, 0x5a93, 0x5a94, 0x5a95, 0x5a96, 0x5a97,
+ 0x5a98, 0x5a99, 0x5a9a, 0x5a9b, 0x5a9c, 0x5a9d, 0x5a9e, 0x5a9f,
+ 0x5aa0, 0x5aa1, 0x5aa2, 0x5aa3, 0x5aa4, 0x5aa5, 0x5aa6, 0x5aa7,
+ 0x5aa8, 0x5aa9, 0x5aaa, 0x5aab, 0x5aac, 0x5aad, 0x5aae, 0x5aaf,
+ 0x5ab0, 0x5ab1, 0x5ab2, 0x5ab3, 0x5ab4, 0x5ab5, 0x5ab6, 0x5ab7,
+ 0x5ab8, 0x5ab9, 0x5aba, 0x5abb, 0x5abc, 0x5abd, 0x5abe, 0x5abf,
+ 0x5ac0, 0x5ac1, 0x5ac2, 0x5ac3, 0x5ac4, 0x5ac5, 0x5ac6, 0x5ac7,
+ 0x5ac8, 0x5ac9, 0x5aca, 0x5acb, 0x5acc, 0x5acd, 0x5ace, 0x5acf,
+ 0x5ad0, 0x5ad1, 0x5ad2, 0x5ad3, 0x5ad4, 0x5ad5, 0x5ad6, 0x5ad7,
+ 0x5ad8, 0x5ad9, 0x5ada, 0x5adb, 0x5adc, 0x5add, 0x5ade, 0x5adf,
+ 0x5ae0, 0x5ae1, 0x5ae2, 0x5ae3, 0x5ae4, 0x5ae5, 0x5ae6, 0x5ae7,
+ 0x5ae8, 0x5ae9, 0x5aea, 0x5aeb, 0x5aec, 0x5aed, 0x5aee, 0x5aef,
+ 0x5af0, 0x5af1, 0x5af2, 0x5af3, 0x5af4, 0x5af5, 0x5af6, 0x5af7,
+ 0x5af8, 0x5af9, 0x5afa, 0x5afb, 0x5afc, 0x5afd, 0x5afe, 0x5aff,
+ 0x5b00, 0x5b01, 0x5b02, 0x5b03, 0x5b04, 0x5b05, 0x5b06, 0x5b07,
+ 0x5b08, 0x5b09, 0x5b0a, 0x5b0b, 0x5b0c, 0x5b0d, 0x5b0e, 0x5b0f,
+ 0x5b10, 0x5b11, 0x5b12, 0x5b13, 0x5b14, 0x5b15, 0x5b16, 0x5b17,
+ 0x5b18, 0x5b19, 0x5b1a, 0x5b1b, 0x5b1c, 0x5b1d, 0x5b1e, 0x5b1f,
+ 0x5b20, 0x5b21, 0x5b22, 0x5b23, 0x5b24, 0x5b25, 0x5b26, 0x5b27,
+ 0x5b28, 0x5b29, 0x5b2a, 0x5b2b, 0x5b2c, 0x5b2d, 0x5b2e, 0x5b2f,
+ 0x5b30, 0x5b31, 0x5b32, 0x5b33, 0x5b34, 0x5b35, 0x5b36, 0x5b37,
+ 0x5b38, 0x5b39, 0x5b3a, 0x5b3b, 0x5b3c, 0x5b3d, 0x5b3e, 0x5b3f,
+ 0x5b40, 0x5b41, 0x5b42, 0x5b43, 0x5b44, 0x5b45, 0x5b46, 0x5b47,
+ 0x5b48, 0x5b49, 0x5b4a, 0x5b4b, 0x5b4c, 0x5b4d, 0x5b4e, 0x5b4f,
+ 0x5b50, 0x5b51, 0x5b52, 0x5b53, 0x5b54, 0x5b55, 0x5b56, 0x5b57,
+ 0x5b58, 0x5b59, 0x5b5a, 0x5b5b, 0x5b5c, 0x5b5d, 0x5b5e, 0x5b5f,
+ 0x5b60, 0x5b61, 0x5b62, 0x5b63, 0x5b64, 0x5b65, 0x5b66, 0x5b67,
+ 0x5b68, 0x5b69, 0x5b6a, 0x5b6b, 0x5b6c, 0x5b6d, 0x5b6e, 0x5b6f,
+ 0x5b70, 0x5b71, 0x5b72, 0x5b73, 0x5b74, 0x5b75, 0x5b76, 0x5b77,
+ 0x5b78, 0x5b79, 0x5b7a, 0x5b7b, 0x5b7c, 0x5b7d, 0x5b7e, 0x5b7f,
+ 0x5b80, 0x5b81, 0x5b82, 0x5b83, 0x5b84, 0x5b85, 0x5b86, 0x5b87,
+ 0x5b88, 0x5b89, 0x5b8a, 0x5b8b, 0x5b8c, 0x5b8d, 0x5b8e, 0x5b8f,
+ 0x5b90, 0x5b91, 0x5b92, 0x5b93, 0x5b94, 0x5b95, 0x5b96, 0x5b97,
+ 0x5b98, 0x5b99, 0x5b9a, 0x5b9b, 0x5b9c, 0x5b9d, 0x5b9e, 0x5b9f,
+ 0x5ba0, 0x5ba1, 0x5ba2, 0x5ba3, 0x5ba4, 0x5ba5, 0x5ba6, 0x5ba7,
+ 0x5ba8, 0x5ba9, 0x5baa, 0x5bab, 0x5bac, 0x5bad, 0x5bae, 0x5baf,
+ 0x5bb0, 0x5bb1, 0x5bb2, 0x5bb3, 0x5bb4, 0x5bb5, 0x5bb6, 0x5bb7,
+ 0x5bb8, 0x5bb9, 0x5bba, 0x5bbb, 0x5bbc, 0x5bbd, 0x5bbe, 0x5bbf,
+ 0x5bc0, 0x5bc1, 0x5bc2, 0x5bc3, 0x5bc4, 0x5bc5, 0x5bc6, 0x5bc7,
+ 0x5bc8, 0x5bc9, 0x5bca, 0x5bcb, 0x5bcc, 0x5bcd, 0x5bce, 0x5bcf,
+ 0x5bd0, 0x5bd1, 0x5bd2, 0x5bd3, 0x5bd4, 0x5bd5, 0x5bd6, 0x5bd7,
+ 0x5bd8, 0x5bd9, 0x5bda, 0x5bdb, 0x5bdc, 0x5bdd, 0x5bde, 0x5bdf,
+ 0x5be0, 0x5be1, 0x5be2, 0x5be3, 0x5be4, 0x5be5, 0x5be6, 0x5be7,
+ 0x5be8, 0x5be9, 0x5bea, 0x5beb, 0x5bec, 0x5bed, 0x5bee, 0x5bef,
+ 0x5bf0, 0x5bf1, 0x5bf2, 0x5bf3, 0x5bf4, 0x5bf5, 0x5bf6, 0x5bf7,
+ 0x5bf8, 0x5bf9, 0x5bfa, 0x5bfb, 0x5bfc, 0x5bfd, 0x5bfe, 0x5bff,
+ 0x5c00, 0x5c01, 0x5c02, 0x5c03, 0x5c04, 0x5c05, 0x5c06, 0x5c07,
+ 0x5c08, 0x5c09, 0x5c0a, 0x5c0b, 0x5c0c, 0x5c0d, 0x5c0e, 0x5c0f,
+ 0x5c10, 0x5c11, 0x5c12, 0x5c13, 0x5c14, 0x5c15, 0x5c16, 0x5c17,
+ 0x5c18, 0x5c19, 0x5c1a, 0x5c1b, 0x5c1c, 0x5c1d, 0x5c1e, 0x5c1f,
+ 0x5c20, 0x5c21, 0x5c22, 0x5c23, 0x5c24, 0x5c25, 0x5c26, 0x5c27,
+ 0x5c28, 0x5c29, 0x5c2a, 0x5c2b, 0x5c2c, 0x5c2d, 0x5c2e, 0x5c2f,
+ 0x5c30, 0x5c31, 0x5c32, 0x5c33, 0x5c34, 0x5c35, 0x5c36, 0x5c37,
+ 0x5c38, 0x5c39, 0x5c3a, 0x5c3b, 0x5c3c, 0x5c3d, 0x5c3e, 0x5c3f,
+ 0x5c40, 0x5c41, 0x5c42, 0x5c43, 0x5c44, 0x5c45, 0x5c46, 0x5c47,
+ 0x5c48, 0x5c49, 0x5c4a, 0x5c4b, 0x5c4c, 0x5c4d, 0x5c4e, 0x5c4f,
+ 0x5c50, 0x5c51, 0x5c52, 0x5c53, 0x5c54, 0x5c55, 0x5c56, 0x5c57,
+ 0x5c58, 0x5c59, 0x5c5a, 0x5c5b, 0x5c5c, 0x5c5d, 0x5c5e, 0x5c5f,
+ 0x5c60, 0x5c61, 0x5c62, 0x5c63, 0x5c64, 0x5c65, 0x5c66, 0x5c67,
+ 0x5c68, 0x5c69, 0x5c6a, 0x5c6b, 0x5c6c, 0x5c6d, 0x5c6e, 0x5c6f,
+ 0x5c70, 0x5c71, 0x5c72, 0x5c73, 0x5c74, 0x5c75, 0x5c76, 0x5c77,
+ 0x5c78, 0x5c79, 0x5c7a, 0x5c7b, 0x5c7c, 0x5c7d, 0x5c7e, 0x5c7f,
+ 0x5c80, 0x5c81, 0x5c82, 0x5c83, 0x5c84, 0x5c85, 0x5c86, 0x5c87,
+ 0x5c88, 0x5c89, 0x5c8a, 0x5c8b, 0x5c8c, 0x5c8d, 0x5c8e, 0x5c8f,
+ 0x5c90, 0x5c91, 0x5c92, 0x5c93, 0x5c94, 0x5c95, 0x5c96, 0x5c97,
+ 0x5c98, 0x5c99, 0x5c9a, 0x5c9b, 0x5c9c, 0x5c9d, 0x5c9e, 0x5c9f,
+ 0x5ca0, 0x5ca1, 0x5ca2, 0x5ca3, 0x5ca4, 0x5ca5, 0x5ca6, 0x5ca7,
+ 0x5ca8, 0x5ca9, 0x5caa, 0x5cab, 0x5cac, 0x5cad, 0x5cae, 0x5caf,
+ 0x5cb0, 0x5cb1, 0x5cb2, 0x5cb3, 0x5cb4, 0x5cb5, 0x5cb6, 0x5cb7,
+ 0x5cb8, 0x5cb9, 0x5cba, 0x5cbb, 0x5cbc, 0x5cbd, 0x5cbe, 0x5cbf,
+ 0x5cc0, 0x5cc1, 0x5cc2, 0x5cc3, 0x5cc4, 0x5cc5, 0x5cc6, 0x5cc7,
+ 0x5cc8, 0x5cc9, 0x5cca, 0x5ccb, 0x5ccc, 0x5ccd, 0x5cce, 0x5ccf,
+ 0x5cd0, 0x5cd1, 0x5cd2, 0x5cd3, 0x5cd4, 0x5cd5, 0x5cd6, 0x5cd7,
+ 0x5cd8, 0x5cd9, 0x5cda, 0x5cdb, 0x5cdc, 0x5cdd, 0x5cde, 0x5cdf,
+ 0x5ce0, 0x5ce1, 0x5ce2, 0x5ce3, 0x5ce4, 0x5ce5, 0x5ce6, 0x5ce7,
+ 0x5ce8, 0x5ce9, 0x5cea, 0x5ceb, 0x5cec, 0x5ced, 0x5cee, 0x5cef,
+ 0x5cf0, 0x5cf1, 0x5cf2, 0x5cf3, 0x5cf4, 0x5cf5, 0x5cf6, 0x5cf7,
+ 0x5cf8, 0x5cf9, 0x5cfa, 0x5cfb, 0x5cfc, 0x5cfd, 0x5cfe, 0x5cff,
+ 0x5d00, 0x5d01, 0x5d02, 0x5d03, 0x5d04, 0x5d05, 0x5d06, 0x5d07,
+ 0x5d08, 0x5d09, 0x5d0a, 0x5d0b, 0x5d0c, 0x5d0d, 0x5d0e, 0x5d0f,
+ 0x5d10, 0x5d11, 0x5d12, 0x5d13, 0x5d14, 0x5d15, 0x5d16, 0x5d17,
+ 0x5d18, 0x5d19, 0x5d1a, 0x5d1b, 0x5d1c, 0x5d1d, 0x5d1e, 0x5d1f,
+ 0x5d20, 0x5d21, 0x5d22, 0x5d23, 0x5d24, 0x5d25, 0x5d26, 0x5d27,
+ 0x5d28, 0x5d29, 0x5d2a, 0x5d2b, 0x5d2c, 0x5d2d, 0x5d2e, 0x5d2f,
+ 0x5d30, 0x5d31, 0x5d32, 0x5d33, 0x5d34, 0x5d35, 0x5d36, 0x5d37,
+ 0x5d38, 0x5d39, 0x5d3a, 0x5d3b, 0x5d3c, 0x5d3d, 0x5d3e, 0x5d3f,
+ 0x5d40, 0x5d41, 0x5d42, 0x5d43, 0x5d44, 0x5d45, 0x5d46, 0x5d47,
+ 0x5d48, 0x5d49, 0x5d4a, 0x5d4b, 0x5d4c, 0x5d4d, 0x5d4e, 0x5d4f,
+ 0x5d50, 0x5d51, 0x5d52, 0x5d53, 0x5d54, 0x5d55, 0x5d56, 0x5d57,
+ 0x5d58, 0x5d59, 0x5d5a, 0x5d5b, 0x5d5c, 0x5d5d, 0x5d5e, 0x5d5f,
+ 0x5d60, 0x5d61, 0x5d62, 0x5d63, 0x5d64, 0x5d65, 0x5d66, 0x5d67,
+ 0x5d68, 0x5d69, 0x5d6a, 0x5d6b, 0x5d6c, 0x5d6d, 0x5d6e, 0x5d6f,
+ 0x5d70, 0x5d71, 0x5d72, 0x5d73, 0x5d74, 0x5d75, 0x5d76, 0x5d77,
+ 0x5d78, 0x5d79, 0x5d7a, 0x5d7b, 0x5d7c, 0x5d7d, 0x5d7e, 0x5d7f,
+ 0x5d80, 0x5d81, 0x5d82, 0x5d83, 0x5d84, 0x5d85, 0x5d86, 0x5d87,
+ 0x5d88, 0x5d89, 0x5d8a, 0x5d8b, 0x5d8c, 0x5d8d, 0x5d8e, 0x5d8f,
+ 0x5d90, 0x5d91, 0x5d92, 0x5d93, 0x5d94, 0x5d95, 0x5d96, 0x5d97,
+ 0x5d98, 0x5d99, 0x5d9a, 0x5d9b, 0x5d9c, 0x5d9d, 0x5d9e, 0x5d9f,
+ 0x5da0, 0x5da1, 0x5da2, 0x5da3, 0x5da4, 0x5da5, 0x5da6, 0x5da7,
+ 0x5da8, 0x5da9, 0x5daa, 0x5dab, 0x5dac, 0x5dad, 0x5dae, 0x5daf,
+ 0x5db0, 0x5db1, 0x5db2, 0x5db3, 0x5db4, 0x5db5, 0x5db6, 0x5db7,
+ 0x5db8, 0x5db9, 0x5dba, 0x5dbb, 0x5dbc, 0x5dbd, 0x5dbe, 0x5dbf,
+ 0x5dc0, 0x5dc1, 0x5dc2, 0x5dc3, 0x5dc4, 0x5dc5, 0x5dc6, 0x5dc7,
+ 0x5dc8, 0x5dc9, 0x5dca, 0x5dcb, 0x5dcc, 0x5dcd, 0x5dce, 0x5dcf,
+ 0x5dd0, 0x5dd1, 0x5dd2, 0x5dd3, 0x5dd4, 0x5dd5, 0x5dd6, 0x5dd7,
+ 0x5dd8, 0x5dd9, 0x5dda, 0x5ddb, 0x5ddc, 0x5ddd, 0x5dde, 0x5ddf,
+ 0x5de0, 0x5de1, 0x5de2, 0x5de3, 0x5de4, 0x5de5, 0x5de6, 0x5de7,
+ 0x5de8, 0x5de9, 0x5dea, 0x5deb, 0x5dec, 0x5ded, 0x5dee, 0x5def,
+ 0x5df0, 0x5df1, 0x5df2, 0x5df3, 0x5df4, 0x5df5, 0x5df6, 0x5df7,
+ 0x5df8, 0x5df9, 0x5dfa, 0x5dfb, 0x5dfc, 0x5dfd, 0x5dfe, 0x5dff,
+ 0x5e00, 0x5e01, 0x5e02, 0x5e03, 0x5e04, 0x5e05, 0x5e06, 0x5e07,
+ 0x5e08, 0x5e09, 0x5e0a, 0x5e0b, 0x5e0c, 0x5e0d, 0x5e0e, 0x5e0f,
+ 0x5e10, 0x5e11, 0x5e12, 0x5e13, 0x5e14, 0x5e15, 0x5e16, 0x5e17,
+ 0x5e18, 0x5e19, 0x5e1a, 0x5e1b, 0x5e1c, 0x5e1d, 0x5e1e, 0x5e1f,
+ 0x5e20, 0x5e21, 0x5e22, 0x5e23, 0x5e24, 0x5e25, 0x5e26, 0x5e27,
+ 0x5e28, 0x5e29, 0x5e2a, 0x5e2b, 0x5e2c, 0x5e2d, 0x5e2e, 0x5e2f,
+ 0x5e30, 0x5e31, 0x5e32, 0x5e33, 0x5e34, 0x5e35, 0x5e36, 0x5e37,
+ 0x5e38, 0x5e39, 0x5e3a, 0x5e3b, 0x5e3c, 0x5e3d, 0x5e3e, 0x5e3f,
+ 0x5e40, 0x5e41, 0x5e42, 0x5e43, 0x5e44, 0x5e45, 0x5e46, 0x5e47,
+ 0x5e48, 0x5e49, 0x5e4a, 0x5e4b, 0x5e4c, 0x5e4d, 0x5e4e, 0x5e4f,
+ 0x5e50, 0x5e51, 0x5e52, 0x5e53, 0x5e54, 0x5e55, 0x5e56, 0x5e57,
+ 0x5e58, 0x5e59, 0x5e5a, 0x5e5b, 0x5e5c, 0x5e5d, 0x5e5e, 0x5e5f,
+ 0x5e60, 0x5e61, 0x5e62, 0x5e63, 0x5e64, 0x5e65, 0x5e66, 0x5e67,
+ 0x5e68, 0x5e69, 0x5e6a, 0x5e6b, 0x5e6c, 0x5e6d, 0x5e6e, 0x5e6f,
+ 0x5e70, 0x5e71, 0x5e72, 0x5e73, 0x5e74, 0x5e75, 0x5e76, 0x5e77,
+ 0x5e78, 0x5e79, 0x5e7a, 0x5e7b, 0x5e7c, 0x5e7d, 0x5e7e, 0x5e7f,
+ 0x5e80, 0x5e81, 0x5e82, 0x5e83, 0x5e84, 0x5e85, 0x5e86, 0x5e87,
+ 0x5e88, 0x5e89, 0x5e8a, 0x5e8b, 0x5e8c, 0x5e8d, 0x5e8e, 0x5e8f,
+ 0x5e90, 0x5e91, 0x5e92, 0x5e93, 0x5e94, 0x5e95, 0x5e96, 0x5e97,
+ 0x5e98, 0x5e99, 0x5e9a, 0x5e9b, 0x5e9c, 0x5e9d, 0x5e9e, 0x5e9f,
+ 0x5ea0, 0x5ea1, 0x5ea2, 0x5ea3, 0x5ea4, 0x5ea5, 0x5ea6, 0x5ea7,
+ 0x5ea8, 0x5ea9, 0x5eaa, 0x5eab, 0x5eac, 0x5ead, 0x5eae, 0x5eaf,
+ 0x5eb0, 0x5eb1, 0x5eb2, 0x5eb3, 0x5eb4, 0x5eb5, 0x5eb6, 0x5eb7,
+ 0x5eb8, 0x5eb9, 0x5eba, 0x5ebb, 0x5ebc, 0x5ebd, 0x5ebe, 0x5ebf,
+ 0x5ec0, 0x5ec1, 0x5ec2, 0x5ec3, 0x5ec4, 0x5ec5, 0x5ec6, 0x5ec7,
+ 0x5ec8, 0x5ec9, 0x5eca, 0x5ecb, 0x5ecc, 0x5ecd, 0x5ece, 0x5ecf,
+ 0x5ed0, 0x5ed1, 0x5ed2, 0x5ed3, 0x5ed4, 0x5ed5, 0x5ed6, 0x5ed7,
+ 0x5ed8, 0x5ed9, 0x5eda, 0x5edb, 0x5edc, 0x5edd, 0x5ede, 0x5edf,
+ 0x5ee0, 0x5ee1, 0x5ee2, 0x5ee3, 0x5ee4, 0x5ee5, 0x5ee6, 0x5ee7,
+ 0x5ee8, 0x5ee9, 0x5eea, 0x5eeb, 0x5eec, 0x5eed, 0x5eee, 0x5eef,
+ 0x5ef0, 0x5ef1, 0x5ef2, 0x5ef3, 0x5ef4, 0x5ef5, 0x5ef6, 0x5ef7,
+ 0x5ef8, 0x5ef9, 0x5efa, 0x5efb, 0x5efc, 0x5efd, 0x5efe, 0x5eff,
+ 0x5f00, 0x5f01, 0x5f02, 0x5f03, 0x5f04, 0x5f05, 0x5f06, 0x5f07,
+ 0x5f08, 0x5f09, 0x5f0a, 0x5f0b, 0x5f0c, 0x5f0d, 0x5f0e, 0x5f0f,
+ 0x5f10, 0x5f11, 0x5f12, 0x5f13, 0x5f14, 0x5f15, 0x5f16, 0x5f17,
+ 0x5f18, 0x5f19, 0x5f1a, 0x5f1b, 0x5f1c, 0x5f1d, 0x5f1e, 0x5f1f,
+ 0x5f20, 0x5f21, 0x5f22, 0x5f23, 0x5f24, 0x5f25, 0x5f26, 0x5f27,
+ 0x5f28, 0x5f29, 0x5f2a, 0x5f2b, 0x5f2c, 0x5f2d, 0x5f2e, 0x5f2f,
+ 0x5f30, 0x5f31, 0x5f32, 0x5f33, 0x5f34, 0x5f35, 0x5f36, 0x5f37,
+ 0x5f38, 0x5f39, 0x5f3a, 0x5f3b, 0x5f3c, 0x5f3d, 0x5f3e, 0x5f3f,
+ 0x5f40, 0x5f41, 0x5f42, 0x5f43, 0x5f44, 0x5f45, 0x5f46, 0x5f47,
+ 0x5f48, 0x5f49, 0x5f4a, 0x5f4b, 0x5f4c, 0x5f4d, 0x5f4e, 0x5f4f,
+ 0x5f50, 0x5f51, 0x5f52, 0x5f53, 0x5f54, 0x5f55, 0x5f56, 0x5f57,
+ 0x5f58, 0x5f59, 0x5f5a, 0x5f5b, 0x5f5c, 0x5f5d, 0x5f5e, 0x5f5f,
+ 0x5f60, 0x5f61, 0x5f62, 0x5f63, 0x5f64, 0x5f65, 0x5f66, 0x5f67,
+ 0x5f68, 0x5f69, 0x5f6a, 0x5f6b, 0x5f6c, 0x5f6d, 0x5f6e, 0x5f6f,
+ 0x5f70, 0x5f71, 0x5f72, 0x5f73, 0x5f74, 0x5f75, 0x5f76, 0x5f77,
+ 0x5f78, 0x5f79, 0x5f7a, 0x5f7b, 0x5f7c, 0x5f7d, 0x5f7e, 0x5f7f,
+ 0x5f80, 0x5f81, 0x5f82, 0x5f83, 0x5f84, 0x5f85, 0x5f86, 0x5f87,
+ 0x5f88, 0x5f89, 0x5f8a, 0x5f8b, 0x5f8c, 0x5f8d, 0x5f8e, 0x5f8f,
+ 0x5f90, 0x5f91, 0x5f92, 0x5f93, 0x5f94, 0x5f95, 0x5f96, 0x5f97,
+ 0x5f98, 0x5f99, 0x5f9a, 0x5f9b, 0x5f9c, 0x5f9d, 0x5f9e, 0x5f9f,
+ 0x5fa0, 0x5fa1, 0x5fa2, 0x5fa3, 0x5fa4, 0x5fa5, 0x5fa6, 0x5fa7,
+ 0x5fa8, 0x5fa9, 0x5faa, 0x5fab, 0x5fac, 0x5fad, 0x5fae, 0x5faf,
+ 0x5fb0, 0x5fb1, 0x5fb2, 0x5fb3, 0x5fb4, 0x5fb5, 0x5fb6, 0x5fb7,
+ 0x5fb8, 0x5fb9, 0x5fba, 0x5fbb, 0x5fbc, 0x5fbd, 0x5fbe, 0x5fbf,
+ 0x5fc0, 0x5fc1, 0x5fc2, 0x5fc3, 0x5fc4, 0x5fc5, 0x5fc6, 0x5fc7,
+ 0x5fc8, 0x5fc9, 0x5fca, 0x5fcb, 0x5fcc, 0x5fcd, 0x5fce, 0x5fcf,
+ 0x5fd0, 0x5fd1, 0x5fd2, 0x5fd3, 0x5fd4, 0x5fd5, 0x5fd6, 0x5fd7,
+ 0x5fd8, 0x5fd9, 0x5fda, 0x5fdb, 0x5fdc, 0x5fdd, 0x5fde, 0x5fdf,
+ 0x5fe0, 0x5fe1, 0x5fe2, 0x5fe3, 0x5fe4, 0x5fe5, 0x5fe6, 0x5fe7,
+ 0x5fe8, 0x5fe9, 0x5fea, 0x5feb, 0x5fec, 0x5fed, 0x5fee, 0x5fef,
+ 0x5ff0, 0x5ff1, 0x5ff2, 0x5ff3, 0x5ff4, 0x5ff5, 0x5ff6, 0x5ff7,
+ 0x5ff8, 0x5ff9, 0x5ffa, 0x5ffb, 0x5ffc, 0x5ffd, 0x5ffe, 0x5fff,
+ 0x6000, 0x6001, 0x6002, 0x6003, 0x6004, 0x6005, 0x6006, 0x6007,
+ 0x6008, 0x6009, 0x600a, 0x600b, 0x600c, 0x600d, 0x600e, 0x600f,
+ 0x6010, 0x6011, 0x6012, 0x6013, 0x6014, 0x6015, 0x6016, 0x6017,
+ 0x6018, 0x6019, 0x601a, 0x601b, 0x601c, 0x601d, 0x601e, 0x601f,
+ 0x6020, 0x6021, 0x6022, 0x6023, 0x6024, 0x6025, 0x6026, 0x6027,
+ 0x6028, 0x6029, 0x602a, 0x602b, 0x602c, 0x602d, 0x602e, 0x602f,
+ 0x6030, 0x6031, 0x6032, 0x6033, 0x6034, 0x6035, 0x6036, 0x6037,
+ 0x6038, 0x6039, 0x603a, 0x603b, 0x603c, 0x603d, 0x603e, 0x603f,
+ 0x6040, 0x6041, 0x6042, 0x6043, 0x6044, 0x6045, 0x6046, 0x6047,
+ 0x6048, 0x6049, 0x604a, 0x604b, 0x604c, 0x604d, 0x604e, 0x604f,
+ 0x6050, 0x6051, 0x6052, 0x6053, 0x6054, 0x6055, 0x6056, 0x6057,
+ 0x6058, 0x6059, 0x605a, 0x605b, 0x605c, 0x605d, 0x605e, 0x605f,
+ 0x6060, 0x6061, 0x6062, 0x6063, 0x6064, 0x6065, 0x6066, 0x6067,
+ 0x6068, 0x6069, 0x606a, 0x606b, 0x606c, 0x606d, 0x606e, 0x606f,
+ 0x6070, 0x6071, 0x6072, 0x6073, 0x6074, 0x6075, 0x6076, 0x6077,
+ 0x6078, 0x6079, 0x607a, 0x607b, 0x607c, 0x607d, 0x607e, 0x607f,
+ 0x6080, 0x6081, 0x6082, 0x6083, 0x6084, 0x6085, 0x6086, 0x6087,
+ 0x6088, 0x6089, 0x608a, 0x608b, 0x608c, 0x608d, 0x608e, 0x608f,
+ 0x6090, 0x6091, 0x6092, 0x6093, 0x6094, 0x6095, 0x6096, 0x6097,
+ 0x6098, 0x6099, 0x609a, 0x609b, 0x609c, 0x609d, 0x609e, 0x609f,
+ 0x60a0, 0x60a1, 0x60a2, 0x60a3, 0x60a4, 0x60a5, 0x60a6, 0x60a7,
+ 0x60a8, 0x60a9, 0x60aa, 0x60ab, 0x60ac, 0x60ad, 0x60ae, 0x60af,
+ 0x60b0, 0x60b1, 0x60b2, 0x60b3, 0x60b4, 0x60b5, 0x60b6, 0x60b7,
+ 0x60b8, 0x60b9, 0x60ba, 0x60bb, 0x60bc, 0x60bd, 0x60be, 0x60bf,
+ 0x60c0, 0x60c1, 0x60c2, 0x60c3, 0x60c4, 0x60c5, 0x60c6, 0x60c7,
+ 0x60c8, 0x60c9, 0x60ca, 0x60cb, 0x60cc, 0x60cd, 0x60ce, 0x60cf,
+ 0x60d0, 0x60d1, 0x60d2, 0x60d3, 0x60d4, 0x60d5, 0x60d6, 0x60d7,
+ 0x60d8, 0x60d9, 0x60da, 0x60db, 0x60dc, 0x60dd, 0x60de, 0x60df,
+ 0x60e0, 0x60e1, 0x60e2, 0x60e3, 0x60e4, 0x60e5, 0x60e6, 0x60e7,
+ 0x60e8, 0x60e9, 0x60ea, 0x60eb, 0x60ec, 0x60ed, 0x60ee, 0x60ef,
+ 0x60f0, 0x60f1, 0x60f2, 0x60f3, 0x60f4, 0x60f5, 0x60f6, 0x60f7,
+ 0x60f8, 0x60f9, 0x60fa, 0x60fb, 0x60fc, 0x60fd, 0x60fe, 0x60ff,
+ 0x6100, 0x6101, 0x6102, 0x6103, 0x6104, 0x6105, 0x6106, 0x6107,
+ 0x6108, 0x6109, 0x610a, 0x610b, 0x610c, 0x610d, 0x610e, 0x610f,
+ 0x6110, 0x6111, 0x6112, 0x6113, 0x6114, 0x6115, 0x6116, 0x6117,
+ 0x6118, 0x6119, 0x611a, 0x611b, 0x611c, 0x611d, 0x611e, 0x611f,
+ 0x6120, 0x6121, 0x6122, 0x6123, 0x6124, 0x6125, 0x6126, 0x6127,
+ 0x6128, 0x6129, 0x612a, 0x612b, 0x612c, 0x612d, 0x612e, 0x612f,
+ 0x6130, 0x6131, 0x6132, 0x6133, 0x6134, 0x6135, 0x6136, 0x6137,
+ 0x6138, 0x6139, 0x613a, 0x613b, 0x613c, 0x613d, 0x613e, 0x613f,
+ 0x6140, 0x6141, 0x6142, 0x6143, 0x6144, 0x6145, 0x6146, 0x6147,
+ 0x6148, 0x6149, 0x614a, 0x614b, 0x614c, 0x614d, 0x614e, 0x614f,
+ 0x6150, 0x6151, 0x6152, 0x6153, 0x6154, 0x6155, 0x6156, 0x6157,
+ 0x6158, 0x6159, 0x615a, 0x615b, 0x615c, 0x615d, 0x615e, 0x615f,
+ 0x6160, 0x6161, 0x6162, 0x6163, 0x6164, 0x6165, 0x6166, 0x6167,
+ 0x6168, 0x6169, 0x616a, 0x616b, 0x616c, 0x616d, 0x616e, 0x616f,
+ 0x6170, 0x6171, 0x6172, 0x6173, 0x6174, 0x6175, 0x6176, 0x6177,
+ 0x6178, 0x6179, 0x617a, 0x617b, 0x617c, 0x617d, 0x617e, 0x617f,
+ 0x6180, 0x6181, 0x6182, 0x6183, 0x6184, 0x6185, 0x6186, 0x6187,
+ 0x6188, 0x6189, 0x618a, 0x618b, 0x618c, 0x618d, 0x618e, 0x618f,
+ 0x6190, 0x6191, 0x6192, 0x6193, 0x6194, 0x6195, 0x6196, 0x6197,
+ 0x6198, 0x6199, 0x619a, 0x619b, 0x619c, 0x619d, 0x619e, 0x619f,
+ 0x61a0, 0x61a1, 0x61a2, 0x61a3, 0x61a4, 0x61a5, 0x61a6, 0x61a7,
+ 0x61a8, 0x61a9, 0x61aa, 0x61ab, 0x61ac, 0x61ad, 0x61ae, 0x61af,
+ 0x61b0, 0x61b1, 0x61b2, 0x61b3, 0x61b4, 0x61b5, 0x61b6, 0x61b7,
+ 0x61b8, 0x61b9, 0x61ba, 0x61bb, 0x61bc, 0x61bd, 0x61be, 0x61bf,
+ 0x61c0, 0x61c1, 0x61c2, 0x61c3, 0x61c4, 0x61c5, 0x61c6, 0x61c7,
+ 0x61c8, 0x61c9, 0x61ca, 0x61cb, 0x61cc, 0x61cd, 0x61ce, 0x61cf,
+ 0x61d0, 0x61d1, 0x61d2, 0x61d3, 0x61d4, 0x61d5, 0x61d6, 0x61d7,
+ 0x61d8, 0x61d9, 0x61da, 0x61db, 0x61dc, 0x61dd, 0x61de, 0x61df,
+ 0x61e0, 0x61e1, 0x61e2, 0x61e3, 0x61e4, 0x61e5, 0x61e6, 0x61e7,
+ 0x61e8, 0x61e9, 0x61ea, 0x61eb, 0x61ec, 0x61ed, 0x61ee, 0x61ef,
+ 0x61f0, 0x61f1, 0x61f2, 0x61f3, 0x61f4, 0x61f5, 0x61f6, 0x61f7,
+ 0x61f8, 0x61f9, 0x61fa, 0x61fb, 0x61fc, 0x61fd, 0x61fe, 0x61ff,
+ 0x6200, 0x6201, 0x6202, 0x6203, 0x6204, 0x6205, 0x6206, 0x6207,
+ 0x6208, 0x6209, 0x620a, 0x620b, 0x620c, 0x620d, 0x620e, 0x620f,
+ 0x6210, 0x6211, 0x6212, 0x6213, 0x6214, 0x6215, 0x6216, 0x6217,
+ 0x6218, 0x6219, 0x621a, 0x621b, 0x621c, 0x621d, 0x621e, 0x621f,
+ 0x6220, 0x6221, 0x6222, 0x6223, 0x6224, 0x6225, 0x6226, 0x6227,
+ 0x6228, 0x6229, 0x622a, 0x622b, 0x622c, 0x622d, 0x622e, 0x622f,
+ 0x6230, 0x6231, 0x6232, 0x6233, 0x6234, 0x6235, 0x6236, 0x6237,
+ 0x6238, 0x6239, 0x623a, 0x623b, 0x623c, 0x623d, 0x623e, 0x623f,
+ 0x6240, 0x6241, 0x6242, 0x6243, 0x6244, 0x6245, 0x6246, 0x6247,
+ 0x6248, 0x6249, 0x624a, 0x624b, 0x624c, 0x624d, 0x624e, 0x624f,
+ 0x6250, 0x6251, 0x6252, 0x6253, 0x6254, 0x6255, 0x6256, 0x6257,
+ 0x6258, 0x6259, 0x625a, 0x625b, 0x625c, 0x625d, 0x625e, 0x625f,
+ 0x6260, 0x6261, 0x6262, 0x6263, 0x6264, 0x6265, 0x6266, 0x6267,
+ 0x6268, 0x6269, 0x626a, 0x626b, 0x626c, 0x626d, 0x626e, 0x626f,
+ 0x6270, 0x6271, 0x6272, 0x6273, 0x6274, 0x6275, 0x6276, 0x6277,
+ 0x6278, 0x6279, 0x627a, 0x627b, 0x627c, 0x627d, 0x627e, 0x627f,
+ 0x6280, 0x6281, 0x6282, 0x6283, 0x6284, 0x6285, 0x6286, 0x6287,
+ 0x6288, 0x6289, 0x628a, 0x628b, 0x628c, 0x628d, 0x628e, 0x628f,
+ 0x6290, 0x6291, 0x6292, 0x6293, 0x6294, 0x6295, 0x6296, 0x6297,
+ 0x6298, 0x6299, 0x629a, 0x629b, 0x629c, 0x629d, 0x629e, 0x629f,
+ 0x62a0, 0x62a1, 0x62a2, 0x62a3, 0x62a4, 0x62a5, 0x62a6, 0x62a7,
+ 0x62a8, 0x62a9, 0x62aa, 0x62ab, 0x62ac, 0x62ad, 0x62ae, 0x62af,
+ 0x62b0, 0x62b1, 0x62b2, 0x62b3, 0x62b4, 0x62b5, 0x62b6, 0x62b7,
+ 0x62b8, 0x62b9, 0x62ba, 0x62bb, 0x62bc, 0x62bd, 0x62be, 0x62bf,
+ 0x62c0, 0x62c1, 0x62c2, 0x62c3, 0x62c4, 0x62c5, 0x62c6, 0x62c7,
+ 0x62c8, 0x62c9, 0x62ca, 0x62cb, 0x62cc, 0x62cd, 0x62ce, 0x62cf,
+ 0x62d0, 0x62d1, 0x62d2, 0x62d3, 0x62d4, 0x62d5, 0x62d6, 0x62d7,
+ 0x62d8, 0x62d9, 0x62da, 0x62db, 0x62dc, 0x62dd, 0x62de, 0x62df,
+ 0x62e0, 0x62e1, 0x62e2, 0x62e3, 0x62e4, 0x62e5, 0x62e6, 0x62e7,
+ 0x62e8, 0x62e9, 0x62ea, 0x62eb, 0x62ec, 0x62ed, 0x62ee, 0x62ef,
+ 0x62f0, 0x62f1, 0x62f2, 0x62f3, 0x62f4, 0x62f5, 0x62f6, 0x62f7,
+ 0x62f8, 0x62f9, 0x62fa, 0x62fb, 0x62fc, 0x62fd, 0x62fe, 0x62ff,
+ 0x6300, 0x6301, 0x6302, 0x6303, 0x6304, 0x6305, 0x6306, 0x6307,
+ 0x6308, 0x6309, 0x630a, 0x630b, 0x630c, 0x630d, 0x630e, 0x630f,
+ 0x6310, 0x6311, 0x6312, 0x6313, 0x6314, 0x6315, 0x6316, 0x6317,
+ 0x6318, 0x6319, 0x631a, 0x631b, 0x631c, 0x631d, 0x631e, 0x631f,
+ 0x6320, 0x6321, 0x6322, 0x6323, 0x6324, 0x6325, 0x6326, 0x6327,
+ 0x6328, 0x6329, 0x632a, 0x632b, 0x632c, 0x632d, 0x632e, 0x632f,
+ 0x6330, 0x6331, 0x6332, 0x6333, 0x6334, 0x6335, 0x6336, 0x6337,
+ 0x6338, 0x6339, 0x633a, 0x633b, 0x633c, 0x633d, 0x633e, 0x633f,
+ 0x6340, 0x6341, 0x6342, 0x6343, 0x6344, 0x6345, 0x6346, 0x6347,
+ 0x6348, 0x6349, 0x634a, 0x634b, 0x634c, 0x634d, 0x634e, 0x634f,
+ 0x6350, 0x6351, 0x6352, 0x6353, 0x6354, 0x6355, 0x6356, 0x6357,
+ 0x6358, 0x6359, 0x635a, 0x635b, 0x635c, 0x635d, 0x635e, 0x635f,
+ 0x6360, 0x6361, 0x6362, 0x6363, 0x6364, 0x6365, 0x6366, 0x6367,
+ 0x6368, 0x6369, 0x636a, 0x636b, 0x636c, 0x636d, 0x636e, 0x636f,
+ 0x6370, 0x6371, 0x6372, 0x6373, 0x6374, 0x6375, 0x6376, 0x6377,
+ 0x6378, 0x6379, 0x637a, 0x637b, 0x637c, 0x637d, 0x637e, 0x637f,
+ 0x6380, 0x6381, 0x6382, 0x6383, 0x6384, 0x6385, 0x6386, 0x6387,
+ 0x6388, 0x6389, 0x638a, 0x638b, 0x638c, 0x638d, 0x638e, 0x638f,
+ 0x6390, 0x6391, 0x6392, 0x6393, 0x6394, 0x6395, 0x6396, 0x6397,
+ 0x6398, 0x6399, 0x639a, 0x639b, 0x639c, 0x639d, 0x639e, 0x639f,
+ 0x63a0, 0x63a1, 0x63a2, 0x63a3, 0x63a4, 0x63a5, 0x63a6, 0x63a7,
+ 0x63a8, 0x63a9, 0x63aa, 0x63ab, 0x63ac, 0x63ad, 0x63ae, 0x63af,
+ 0x63b0, 0x63b1, 0x63b2, 0x63b3, 0x63b4, 0x63b5, 0x63b6, 0x63b7,
+ 0x63b8, 0x63b9, 0x63ba, 0x63bb, 0x63bc, 0x63bd, 0x63be, 0x63bf,
+ 0x63c0, 0x63c1, 0x63c2, 0x63c3, 0x63c4, 0x63c5, 0x63c6, 0x63c7,
+ 0x63c8, 0x63c9, 0x63ca, 0x63cb, 0x63cc, 0x63cd, 0x63ce, 0x63cf,
+ 0x63d0, 0x63d1, 0x63d2, 0x63d3, 0x63d4, 0x63d5, 0x63d6, 0x63d7,
+ 0x63d8, 0x63d9, 0x63da, 0x63db, 0x63dc, 0x63dd, 0x63de, 0x63df,
+ 0x63e0, 0x63e1, 0x63e2, 0x63e3, 0x63e4, 0x63e5, 0x63e6, 0x63e7,
+ 0x63e8, 0x63e9, 0x63ea, 0x63eb, 0x63ec, 0x63ed, 0x63ee, 0x63ef,
+ 0x63f0, 0x63f1, 0x63f2, 0x63f3, 0x63f4, 0x63f5, 0x63f6, 0x63f7,
+ 0x63f8, 0x63f9, 0x63fa, 0x63fb, 0x63fc, 0x63fd, 0x63fe, 0x63ff,
+ 0x6400, 0x6401, 0x6402, 0x6403, 0x6404, 0x6405, 0x6406, 0x6407,
+ 0x6408, 0x6409, 0x640a, 0x640b, 0x640c, 0x640d, 0x640e, 0x640f,
+ 0x6410, 0x6411, 0x6412, 0x6413, 0x6414, 0x6415, 0x6416, 0x6417,
+ 0x6418, 0x6419, 0x641a, 0x641b, 0x641c, 0x641d, 0x641e, 0x641f,
+ 0x6420, 0x6421, 0x6422, 0x6423, 0x6424, 0x6425, 0x6426, 0x6427,
+ 0x6428, 0x6429, 0x642a, 0x642b, 0x642c, 0x642d, 0x642e, 0x642f,
+ 0x6430, 0x6431, 0x6432, 0x6433, 0x6434, 0x6435, 0x6436, 0x6437,
+ 0x6438, 0x6439, 0x643a, 0x643b, 0x643c, 0x643d, 0x643e, 0x643f,
+ 0x6440, 0x6441, 0x6442, 0x6443, 0x6444, 0x6445, 0x6446, 0x6447,
+ 0x6448, 0x6449, 0x644a, 0x644b, 0x644c, 0x644d, 0x644e, 0x644f,
+ 0x6450, 0x6451, 0x6452, 0x6453, 0x6454, 0x6455, 0x6456, 0x6457,
+ 0x6458, 0x6459, 0x645a, 0x645b, 0x645c, 0x645d, 0x645e, 0x645f,
+ 0x6460, 0x6461, 0x6462, 0x6463, 0x6464, 0x6465, 0x6466, 0x6467,
+ 0x6468, 0x6469, 0x646a, 0x646b, 0x646c, 0x646d, 0x646e, 0x646f,
+ 0x6470, 0x6471, 0x6472, 0x6473, 0x6474, 0x6475, 0x6476, 0x6477,
+ 0x6478, 0x6479, 0x647a, 0x647b, 0x647c, 0x647d, 0x647e, 0x647f,
+ 0x6480, 0x6481, 0x6482, 0x6483, 0x6484, 0x6485, 0x6486, 0x6487,
+ 0x6488, 0x6489, 0x648a, 0x648b, 0x648c, 0x648d, 0x648e, 0x648f,
+ 0x6490, 0x6491, 0x6492, 0x6493, 0x6494, 0x6495, 0x6496, 0x6497,
+ 0x6498, 0x6499, 0x649a, 0x649b, 0x649c, 0x649d, 0x649e, 0x649f,
+ 0x64a0, 0x64a1, 0x64a2, 0x64a3, 0x64a4, 0x64a5, 0x64a6, 0x64a7,
+ 0x64a8, 0x64a9, 0x64aa, 0x64ab, 0x64ac, 0x64ad, 0x64ae, 0x64af,
+ 0x64b0, 0x64b1, 0x64b2, 0x64b3, 0x64b4, 0x64b5, 0x64b6, 0x64b7,
+ 0x64b8, 0x64b9, 0x64ba, 0x64bb, 0x64bc, 0x64bd, 0x64be, 0x64bf,
+ 0x64c0, 0x64c1, 0x64c2, 0x64c3, 0x64c4, 0x64c5, 0x64c6, 0x64c7,
+ 0x64c8, 0x64c9, 0x64ca, 0x64cb, 0x64cc, 0x64cd, 0x64ce, 0x64cf,
+ 0x64d0, 0x64d1, 0x64d2, 0x64d3, 0x64d4, 0x64d5, 0x64d6, 0x64d7,
+ 0x64d8, 0x64d9, 0x64da, 0x64db, 0x64dc, 0x64dd, 0x64de, 0x64df,
+ 0x64e0, 0x64e1, 0x64e2, 0x64e3, 0x64e4, 0x64e5, 0x64e6, 0x64e7,
+ 0x64e8, 0x64e9, 0x64ea, 0x64eb, 0x64ec, 0x64ed, 0x64ee, 0x64ef,
+ 0x64f0, 0x64f1, 0x64f2, 0x64f3, 0x64f4, 0x64f5, 0x64f6, 0x64f7,
+ 0x64f8, 0x64f9, 0x64fa, 0x64fb, 0x64fc, 0x64fd, 0x64fe, 0x64ff,
+ 0x6500, 0x6501, 0x6502, 0x6503, 0x6504, 0x6505, 0x6506, 0x6507,
+ 0x6508, 0x6509, 0x650a, 0x650b, 0x650c, 0x650d, 0x650e, 0x650f,
+ 0x6510, 0x6511, 0x6512, 0x6513, 0x6514, 0x6515, 0x6516, 0x6517,
+ 0x6518, 0x6519, 0x651a, 0x651b, 0x651c, 0x651d, 0x651e, 0x651f,
+ 0x6520, 0x6521, 0x6522, 0x6523, 0x6524, 0x6525, 0x6526, 0x6527,
+ 0x6528, 0x6529, 0x652a, 0x652b, 0x652c, 0x652d, 0x652e, 0x652f,
+ 0x6530, 0x6531, 0x6532, 0x6533, 0x6534, 0x6535, 0x6536, 0x6537,
+ 0x6538, 0x6539, 0x653a, 0x653b, 0x653c, 0x653d, 0x653e, 0x653f,
+ 0x6540, 0x6541, 0x6542, 0x6543, 0x6544, 0x6545, 0x6546, 0x6547,
+ 0x6548, 0x6549, 0x654a, 0x654b, 0x654c, 0x654d, 0x654e, 0x654f,
+ 0x6550, 0x6551, 0x6552, 0x6553, 0x6554, 0x6555, 0x6556, 0x6557,
+ 0x6558, 0x6559, 0x655a, 0x655b, 0x655c, 0x655d, 0x655e, 0x655f,
+ 0x6560, 0x6561, 0x6562, 0x6563, 0x6564, 0x6565, 0x6566, 0x6567,
+ 0x6568, 0x6569, 0x656a, 0x656b, 0x656c, 0x656d, 0x656e, 0x656f,
+ 0x6570, 0x6571, 0x6572, 0x6573, 0x6574, 0x6575, 0x6576, 0x6577,
+ 0x6578, 0x6579, 0x657a, 0x657b, 0x657c, 0x657d, 0x657e, 0x657f,
+ 0x6580, 0x6581, 0x6582, 0x6583, 0x6584, 0x6585, 0x6586, 0x6587,
+ 0x6588, 0x6589, 0x658a, 0x658b, 0x658c, 0x658d, 0x658e, 0x658f,
+ 0x6590, 0x6591, 0x6592, 0x6593, 0x6594, 0x6595, 0x6596, 0x6597,
+ 0x6598, 0x6599, 0x659a, 0x659b, 0x659c, 0x659d, 0x659e, 0x659f,
+ 0x65a0, 0x65a1, 0x65a2, 0x65a3, 0x65a4, 0x65a5, 0x65a6, 0x65a7,
+ 0x65a8, 0x65a9, 0x65aa, 0x65ab, 0x65ac, 0x65ad, 0x65ae, 0x65af,
+ 0x65b0, 0x65b1, 0x65b2, 0x65b3, 0x65b4, 0x65b5, 0x65b6, 0x65b7,
+ 0x65b8, 0x65b9, 0x65ba, 0x65bb, 0x65bc, 0x65bd, 0x65be, 0x65bf,
+ 0x65c0, 0x65c1, 0x65c2, 0x65c3, 0x65c4, 0x65c5, 0x65c6, 0x65c7,
+ 0x65c8, 0x65c9, 0x65ca, 0x65cb, 0x65cc, 0x65cd, 0x65ce, 0x65cf,
+ 0x65d0, 0x65d1, 0x65d2, 0x65d3, 0x65d4, 0x65d5, 0x65d6, 0x65d7,
+ 0x65d8, 0x65d9, 0x65da, 0x65db, 0x65dc, 0x65dd, 0x65de, 0x65df,
+ 0x65e0, 0x65e1, 0x65e2, 0x65e3, 0x65e4, 0x65e5, 0x65e6, 0x65e7,
+ 0x65e8, 0x65e9, 0x65ea, 0x65eb, 0x65ec, 0x65ed, 0x65ee, 0x65ef,
+ 0x65f0, 0x65f1, 0x65f2, 0x65f3, 0x65f4, 0x65f5, 0x65f6, 0x65f7,
+ 0x65f8, 0x65f9, 0x65fa, 0x65fb, 0x65fc, 0x65fd, 0x65fe, 0x65ff,
+ 0x6600, 0x6601, 0x6602, 0x6603, 0x6604, 0x6605, 0x6606, 0x6607,
+ 0x6608, 0x6609, 0x660a, 0x660b, 0x660c, 0x660d, 0x660e, 0x660f,
+ 0x6610, 0x6611, 0x6612, 0x6613, 0x6614, 0x6615, 0x6616, 0x6617,
+ 0x6618, 0x6619, 0x661a, 0x661b, 0x661c, 0x661d, 0x661e, 0x661f,
+ 0x6620, 0x6621, 0x6622, 0x6623, 0x6624, 0x6625, 0x6626, 0x6627,
+ 0x6628, 0x6629, 0x662a, 0x662b, 0x662c, 0x662d, 0x662e, 0x662f,
+ 0x6630, 0x6631, 0x6632, 0x6633, 0x6634, 0x6635, 0x6636, 0x6637,
+ 0x6638, 0x6639, 0x663a, 0x663b, 0x663c, 0x663d, 0x663e, 0x663f,
+ 0x6640, 0x6641, 0x6642, 0x6643, 0x6644, 0x6645, 0x6646, 0x6647,
+ 0x6648, 0x6649, 0x664a, 0x664b, 0x664c, 0x664d, 0x664e, 0x664f,
+ 0x6650, 0x6651, 0x6652, 0x6653, 0x6654, 0x6655, 0x6656, 0x6657,
+ 0x6658, 0x6659, 0x665a, 0x665b, 0x665c, 0x665d, 0x665e, 0x665f,
+ 0x6660, 0x6661, 0x6662, 0x6663, 0x6664, 0x6665, 0x6666, 0x6667,
+ 0x6668, 0x6669, 0x666a, 0x666b, 0x666c, 0x666d, 0x666e, 0x666f,
+ 0x6670, 0x6671, 0x6672, 0x6673, 0x6674, 0x6675, 0x6676, 0x6677,
+ 0x6678, 0x6679, 0x667a, 0x667b, 0x667c, 0x667d, 0x667e, 0x667f,
+ 0x6680, 0x6681, 0x6682, 0x6683, 0x6684, 0x6685, 0x6686, 0x6687,
+ 0x6688, 0x6689, 0x668a, 0x668b, 0x668c, 0x668d, 0x668e, 0x668f,
+ 0x6690, 0x6691, 0x6692, 0x6693, 0x6694, 0x6695, 0x6696, 0x6697,
+ 0x6698, 0x6699, 0x669a, 0x669b, 0x669c, 0x669d, 0x669e, 0x669f,
+ 0x66a0, 0x66a1, 0x66a2, 0x66a3, 0x66a4, 0x66a5, 0x66a6, 0x66a7,
+ 0x66a8, 0x66a9, 0x66aa, 0x66ab, 0x66ac, 0x66ad, 0x66ae, 0x66af,
+ 0x66b0, 0x66b1, 0x66b2, 0x66b3, 0x66b4, 0x66b5, 0x66b6, 0x66b7,
+ 0x66b8, 0x66b9, 0x66ba, 0x66bb, 0x66bc, 0x66bd, 0x66be, 0x66bf,
+ 0x66c0, 0x66c1, 0x66c2, 0x66c3, 0x66c4, 0x66c5, 0x66c6, 0x66c7,
+ 0x66c8, 0x66c9, 0x66ca, 0x66cb, 0x66cc, 0x66cd, 0x66ce, 0x66cf,
+ 0x66d0, 0x66d1, 0x66d2, 0x66d3, 0x66d4, 0x66d5, 0x66d6, 0x66d7,
+ 0x66d8, 0x66d9, 0x66da, 0x66db, 0x66dc, 0x66dd, 0x66de, 0x66df,
+ 0x66e0, 0x66e1, 0x66e2, 0x66e3, 0x66e4, 0x66e5, 0x66e6, 0x66e7,
+ 0x66e8, 0x66e9, 0x66ea, 0x66eb, 0x66ec, 0x66ed, 0x66ee, 0x66ef,
+ 0x66f0, 0x66f1, 0x66f2, 0x66f3, 0x66f4, 0x66f5, 0x66f6, 0x66f7,
+ 0x66f8, 0x66f9, 0x66fa, 0x66fb, 0x66fc, 0x66fd, 0x66fe, 0x66ff,
+ 0x6700, 0x6701, 0x6702, 0x6703, 0x6704, 0x6705, 0x6706, 0x6707,
+ 0x6708, 0x6709, 0x670a, 0x670b, 0x670c, 0x670d, 0x670e, 0x670f,
+ 0x6710, 0x6711, 0x6712, 0x6713, 0x6714, 0x6715, 0x6716, 0x6717,
+ 0x6718, 0x6719, 0x671a, 0x671b, 0x671c, 0x671d, 0x671e, 0x671f,
+ 0x6720, 0x6721, 0x6722, 0x6723, 0x6724, 0x6725, 0x6726, 0x6727,
+ 0x6728, 0x6729, 0x672a, 0x672b, 0x672c, 0x672d, 0x672e, 0x672f,
+ 0x6730, 0x6731, 0x6732, 0x6733, 0x6734, 0x6735, 0x6736, 0x6737,
+ 0x6738, 0x6739, 0x673a, 0x673b, 0x673c, 0x673d, 0x673e, 0x673f,
+ 0x6740, 0x6741, 0x6742, 0x6743, 0x6744, 0x6745, 0x6746, 0x6747,
+ 0x6748, 0x6749, 0x674a, 0x674b, 0x674c, 0x674d, 0x674e, 0x674f,
+ 0x6750, 0x6751, 0x6752, 0x6753, 0x6754, 0x6755, 0x6756, 0x6757,
+ 0x6758, 0x6759, 0x675a, 0x675b, 0x675c, 0x675d, 0x675e, 0x675f,
+ 0x6760, 0x6761, 0x6762, 0x6763, 0x6764, 0x6765, 0x6766, 0x6767,
+ 0x6768, 0x6769, 0x676a, 0x676b, 0x676c, 0x676d, 0x676e, 0x676f,
+ 0x6770, 0x6771, 0x6772, 0x6773, 0x6774, 0x6775, 0x6776, 0x6777,
+ 0x6778, 0x6779, 0x677a, 0x677b, 0x677c, 0x677d, 0x677e, 0x677f,
+ 0x6780, 0x6781, 0x6782, 0x6783, 0x6784, 0x6785, 0x6786, 0x6787,
+ 0x6788, 0x6789, 0x678a, 0x678b, 0x678c, 0x678d, 0x678e, 0x678f,
+ 0x6790, 0x6791, 0x6792, 0x6793, 0x6794, 0x6795, 0x6796, 0x6797,
+ 0x6798, 0x6799, 0x679a, 0x679b, 0x679c, 0x679d, 0x679e, 0x679f,
+ 0x67a0, 0x67a1, 0x67a2, 0x67a3, 0x67a4, 0x67a5, 0x67a6, 0x67a7,
+ 0x67a8, 0x67a9, 0x67aa, 0x67ab, 0x67ac, 0x67ad, 0x67ae, 0x67af,
+ 0x67b0, 0x67b1, 0x67b2, 0x67b3, 0x67b4, 0x67b5, 0x67b6, 0x67b7,
+ 0x67b8, 0x67b9, 0x67ba, 0x67bb, 0x67bc, 0x67bd, 0x67be, 0x67bf,
+ 0x67c0, 0x67c1, 0x67c2, 0x67c3, 0x67c4, 0x67c5, 0x67c6, 0x67c7,
+ 0x67c8, 0x67c9, 0x67ca, 0x67cb, 0x67cc, 0x67cd, 0x67ce, 0x67cf,
+ 0x67d0, 0x67d1, 0x67d2, 0x67d3, 0x67d4, 0x67d5, 0x67d6, 0x67d7,
+ 0x67d8, 0x67d9, 0x67da, 0x67db, 0x67dc, 0x67dd, 0x67de, 0x67df,
+ 0x67e0, 0x67e1, 0x67e2, 0x67e3, 0x67e4, 0x67e5, 0x67e6, 0x67e7,
+ 0x67e8, 0x67e9, 0x67ea, 0x67eb, 0x67ec, 0x67ed, 0x67ee, 0x67ef,
+ 0x67f0, 0x67f1, 0x67f2, 0x67f3, 0x67f4, 0x67f5, 0x67f6, 0x67f7,
+ 0x67f8, 0x67f9, 0x67fa, 0x67fb, 0x67fc, 0x67fd, 0x67fe, 0x67ff,
+ 0x6800, 0x6801, 0x6802, 0x6803, 0x6804, 0x6805, 0x6806, 0x6807,
+ 0x6808, 0x6809, 0x680a, 0x680b, 0x680c, 0x680d, 0x680e, 0x680f,
+ 0x6810, 0x6811, 0x6812, 0x6813, 0x6814, 0x6815, 0x6816, 0x6817,
+ 0x6818, 0x6819, 0x681a, 0x681b, 0x681c, 0x681d, 0x681e, 0x681f,
+ 0x6820, 0x6821, 0x6822, 0x6823, 0x6824, 0x6825, 0x6826, 0x6827,
+ 0x6828, 0x6829, 0x682a, 0x682b, 0x682c, 0x682d, 0x682e, 0x682f,
+ 0x6830, 0x6831, 0x6832, 0x6833, 0x6834, 0x6835, 0x6836, 0x6837,
+ 0x6838, 0x6839, 0x683a, 0x683b, 0x683c, 0x683d, 0x683e, 0x683f,
+ 0x6840, 0x6841, 0x6842, 0x6843, 0x6844, 0x6845, 0x6846, 0x6847,
+ 0x6848, 0x6849, 0x684a, 0x684b, 0x684c, 0x684d, 0x684e, 0x684f,
+ 0x6850, 0x6851, 0x6852, 0x6853, 0x6854, 0x6855, 0x6856, 0x6857,
+ 0x6858, 0x6859, 0x685a, 0x685b, 0x685c, 0x685d, 0x685e, 0x685f,
+ 0x6860, 0x6861, 0x6862, 0x6863, 0x6864, 0x6865, 0x6866, 0x6867,
+ 0x6868, 0x6869, 0x686a, 0x686b, 0x686c, 0x686d, 0x686e, 0x686f,
+ 0x6870, 0x6871, 0x6872, 0x6873, 0x6874, 0x6875, 0x6876, 0x6877,
+ 0x6878, 0x6879, 0x687a, 0x687b, 0x687c, 0x687d, 0x687e, 0x687f,
+ 0x6880, 0x6881, 0x6882, 0x6883, 0x6884, 0x6885, 0x6886, 0x6887,
+ 0x6888, 0x6889, 0x688a, 0x688b, 0x688c, 0x688d, 0x688e, 0x688f,
+ 0x6890, 0x6891, 0x6892, 0x6893, 0x6894, 0x6895, 0x6896, 0x6897,
+ 0x6898, 0x6899, 0x689a, 0x689b, 0x689c, 0x689d, 0x689e, 0x689f,
+ 0x68a0, 0x68a1, 0x68a2, 0x68a3, 0x68a4, 0x68a5, 0x68a6, 0x68a7,
+ 0x68a8, 0x68a9, 0x68aa, 0x68ab, 0x68ac, 0x68ad, 0x68ae, 0x68af,
+ 0x68b0, 0x68b1, 0x68b2, 0x68b3, 0x68b4, 0x68b5, 0x68b6, 0x68b7,
+ 0x68b8, 0x68b9, 0x68ba, 0x68bb, 0x68bc, 0x68bd, 0x68be, 0x68bf,
+ 0x68c0, 0x68c1, 0x68c2, 0x68c3, 0x68c4, 0x68c5, 0x68c6, 0x68c7,
+ 0x68c8, 0x68c9, 0x68ca, 0x68cb, 0x68cc, 0x68cd, 0x68ce, 0x68cf,
+ 0x68d0, 0x68d1, 0x68d2, 0x68d3, 0x68d4, 0x68d5, 0x68d6, 0x68d7,
+ 0x68d8, 0x68d9, 0x68da, 0x68db, 0x68dc, 0x68dd, 0x68de, 0x68df,
+ 0x68e0, 0x68e1, 0x68e2, 0x68e3, 0x68e4, 0x68e5, 0x68e6, 0x68e7,
+ 0x68e8, 0x68e9, 0x68ea, 0x68eb, 0x68ec, 0x68ed, 0x68ee, 0x68ef,
+ 0x68f0, 0x68f1, 0x68f2, 0x68f3, 0x68f4, 0x68f5, 0x68f6, 0x68f7,
+ 0x68f8, 0x68f9, 0x68fa, 0x68fb, 0x68fc, 0x68fd, 0x68fe, 0x68ff,
+ 0x6900, 0x6901, 0x6902, 0x6903, 0x6904, 0x6905, 0x6906, 0x6907,
+ 0x6908, 0x6909, 0x690a, 0x690b, 0x690c, 0x690d, 0x690e, 0x690f,
+ 0x6910, 0x6911, 0x6912, 0x6913, 0x6914, 0x6915, 0x6916, 0x6917,
+ 0x6918, 0x6919, 0x691a, 0x691b, 0x691c, 0x691d, 0x691e, 0x691f,
+ 0x6920, 0x6921, 0x6922, 0x6923, 0x6924, 0x6925, 0x6926, 0x6927,
+ 0x6928, 0x6929, 0x692a, 0x692b, 0x692c, 0x692d, 0x692e, 0x692f,
+ 0x6930, 0x6931, 0x6932, 0x6933, 0x6934, 0x6935, 0x6936, 0x6937,
+ 0x6938, 0x6939, 0x693a, 0x693b, 0x693c, 0x693d, 0x693e, 0x693f,
+ 0x6940, 0x6941, 0x6942, 0x6943, 0x6944, 0x6945, 0x6946, 0x6947,
+ 0x6948, 0x6949, 0x694a, 0x694b, 0x694c, 0x694d, 0x694e, 0x694f,
+ 0x6950, 0x6951, 0x6952, 0x6953, 0x6954, 0x6955, 0x6956, 0x6957,
+ 0x6958, 0x6959, 0x695a, 0x695b, 0x695c, 0x695d, 0x695e, 0x695f,
+ 0x6960, 0x6961, 0x6962, 0x6963, 0x6964, 0x6965, 0x6966, 0x6967,
+ 0x6968, 0x6969, 0x696a, 0x696b, 0x696c, 0x696d, 0x696e, 0x696f,
+ 0x6970, 0x6971, 0x6972, 0x6973, 0x6974, 0x6975, 0x6976, 0x6977,
+ 0x6978, 0x6979, 0x697a, 0x697b, 0x697c, 0x697d, 0x697e, 0x697f,
+ 0x6980, 0x6981, 0x6982, 0x6983, 0x6984, 0x6985, 0x6986, 0x6987,
+ 0x6988, 0x6989, 0x698a, 0x698b, 0x698c, 0x698d, 0x698e, 0x698f,
+ 0x6990, 0x6991, 0x6992, 0x6993, 0x6994, 0x6995, 0x6996, 0x6997,
+ 0x6998, 0x6999, 0x699a, 0x699b, 0x699c, 0x699d, 0x699e, 0x699f,
+ 0x69a0, 0x69a1, 0x69a2, 0x69a3, 0x69a4, 0x69a5, 0x69a6, 0x69a7,
+ 0x69a8, 0x69a9, 0x69aa, 0x69ab, 0x69ac, 0x69ad, 0x69ae, 0x69af,
+ 0x69b0, 0x69b1, 0x69b2, 0x69b3, 0x69b4, 0x69b5, 0x69b6, 0x69b7,
+ 0x69b8, 0x69b9, 0x69ba, 0x69bb, 0x69bc, 0x69bd, 0x69be, 0x69bf,
+ 0x69c0, 0x69c1, 0x69c2, 0x69c3, 0x69c4, 0x69c5, 0x69c6, 0x69c7,
+ 0x69c8, 0x69c9, 0x69ca, 0x69cb, 0x69cc, 0x69cd, 0x69ce, 0x69cf,
+ 0x69d0, 0x69d1, 0x69d2, 0x69d3, 0x69d4, 0x69d5, 0x69d6, 0x69d7,
+ 0x69d8, 0x69d9, 0x69da, 0x69db, 0x69dc, 0x69dd, 0x69de, 0x69df,
+ 0x69e0, 0x69e1, 0x69e2, 0x69e3, 0x69e4, 0x69e5, 0x69e6, 0x69e7,
+ 0x69e8, 0x69e9, 0x69ea, 0x69eb, 0x69ec, 0x69ed, 0x69ee, 0x69ef,
+ 0x69f0, 0x69f1, 0x69f2, 0x69f3, 0x69f4, 0x69f5, 0x69f6, 0x69f7,
+ 0x69f8, 0x69f9, 0x69fa, 0x69fb, 0x69fc, 0x69fd, 0x69fe, 0x69ff,
+ 0x6a00, 0x6a01, 0x6a02, 0x6a03, 0x6a04, 0x6a05, 0x6a06, 0x6a07,
+ 0x6a08, 0x6a09, 0x6a0a, 0x6a0b, 0x6a0c, 0x6a0d, 0x6a0e, 0x6a0f,
+ 0x6a10, 0x6a11, 0x6a12, 0x6a13, 0x6a14, 0x6a15, 0x6a16, 0x6a17,
+ 0x6a18, 0x6a19, 0x6a1a, 0x6a1b, 0x6a1c, 0x6a1d, 0x6a1e, 0x6a1f,
+ 0x6a20, 0x6a21, 0x6a22, 0x6a23, 0x6a24, 0x6a25, 0x6a26, 0x6a27,
+ 0x6a28, 0x6a29, 0x6a2a, 0x6a2b, 0x6a2c, 0x6a2d, 0x6a2e, 0x6a2f,
+ 0x6a30, 0x6a31, 0x6a32, 0x6a33, 0x6a34, 0x6a35, 0x6a36, 0x6a37,
+ 0x6a38, 0x6a39, 0x6a3a, 0x6a3b, 0x6a3c, 0x6a3d, 0x6a3e, 0x6a3f,
+ 0x6a40, 0x6a41, 0x6a42, 0x6a43, 0x6a44, 0x6a45, 0x6a46, 0x6a47,
+ 0x6a48, 0x6a49, 0x6a4a, 0x6a4b, 0x6a4c, 0x6a4d, 0x6a4e, 0x6a4f,
+ 0x6a50, 0x6a51, 0x6a52, 0x6a53, 0x6a54, 0x6a55, 0x6a56, 0x6a57,
+ 0x6a58, 0x6a59, 0x6a5a, 0x6a5b, 0x6a5c, 0x6a5d, 0x6a5e, 0x6a5f,
+ 0x6a60, 0x6a61, 0x6a62, 0x6a63, 0x6a64, 0x6a65, 0x6a66, 0x6a67,
+ 0x6a68, 0x6a69, 0x6a6a, 0x6a6b, 0x6a6c, 0x6a6d, 0x6a6e, 0x6a6f,
+ 0x6a70, 0x6a71, 0x6a72, 0x6a73, 0x6a74, 0x6a75, 0x6a76, 0x6a77,
+ 0x6a78, 0x6a79, 0x6a7a, 0x6a7b, 0x6a7c, 0x6a7d, 0x6a7e, 0x6a7f,
+ 0x6a80, 0x6a81, 0x6a82, 0x6a83, 0x6a84, 0x6a85, 0x6a86, 0x6a87,
+ 0x6a88, 0x6a89, 0x6a8a, 0x6a8b, 0x6a8c, 0x6a8d, 0x6a8e, 0x6a8f,
+ 0x6a90, 0x6a91, 0x6a92, 0x6a93, 0x6a94, 0x6a95, 0x6a96, 0x6a97,
+ 0x6a98, 0x6a99, 0x6a9a, 0x6a9b, 0x6a9c, 0x6a9d, 0x6a9e, 0x6a9f,
+ 0x6aa0, 0x6aa1, 0x6aa2, 0x6aa3, 0x6aa4, 0x6aa5, 0x6aa6, 0x6aa7,
+ 0x6aa8, 0x6aa9, 0x6aaa, 0x6aab, 0x6aac, 0x6aad, 0x6aae, 0x6aaf,
+ 0x6ab0, 0x6ab1, 0x6ab2, 0x6ab3, 0x6ab4, 0x6ab5, 0x6ab6, 0x6ab7,
+ 0x6ab8, 0x6ab9, 0x6aba, 0x6abb, 0x6abc, 0x6abd, 0x6abe, 0x6abf,
+ 0x6ac0, 0x6ac1, 0x6ac2, 0x6ac3, 0x6ac4, 0x6ac5, 0x6ac6, 0x6ac7,
+ 0x6ac8, 0x6ac9, 0x6aca, 0x6acb, 0x6acc, 0x6acd, 0x6ace, 0x6acf,
+ 0x6ad0, 0x6ad1, 0x6ad2, 0x6ad3, 0x6ad4, 0x6ad5, 0x6ad6, 0x6ad7,
+ 0x6ad8, 0x6ad9, 0x6ada, 0x6adb, 0x6adc, 0x6add, 0x6ade, 0x6adf,
+ 0x6ae0, 0x6ae1, 0x6ae2, 0x6ae3, 0x6ae4, 0x6ae5, 0x6ae6, 0x6ae7,
+ 0x6ae8, 0x6ae9, 0x6aea, 0x6aeb, 0x6aec, 0x6aed, 0x6aee, 0x6aef,
+ 0x6af0, 0x6af1, 0x6af2, 0x6af3, 0x6af4, 0x6af5, 0x6af6, 0x6af7,
+ 0x6af8, 0x6af9, 0x6afa, 0x6afb, 0x6afc, 0x6afd, 0x6afe, 0x6aff,
+ 0x6b00, 0x6b01, 0x6b02, 0x6b03, 0x6b04, 0x6b05, 0x6b06, 0x6b07,
+ 0x6b08, 0x6b09, 0x6b0a, 0x6b0b, 0x6b0c, 0x6b0d, 0x6b0e, 0x6b0f,
+ 0x6b10, 0x6b11, 0x6b12, 0x6b13, 0x6b14, 0x6b15, 0x6b16, 0x6b17,
+ 0x6b18, 0x6b19, 0x6b1a, 0x6b1b, 0x6b1c, 0x6b1d, 0x6b1e, 0x6b1f,
+ 0x6b20, 0x6b21, 0x6b22, 0x6b23, 0x6b24, 0x6b25, 0x6b26, 0x6b27,
+ 0x6b28, 0x6b29, 0x6b2a, 0x6b2b, 0x6b2c, 0x6b2d, 0x6b2e, 0x6b2f,
+ 0x6b30, 0x6b31, 0x6b32, 0x6b33, 0x6b34, 0x6b35, 0x6b36, 0x6b37,
+ 0x6b38, 0x6b39, 0x6b3a, 0x6b3b, 0x6b3c, 0x6b3d, 0x6b3e, 0x6b3f,
+ 0x6b40, 0x6b41, 0x6b42, 0x6b43, 0x6b44, 0x6b45, 0x6b46, 0x6b47,
+ 0x6b48, 0x6b49, 0x6b4a, 0x6b4b, 0x6b4c, 0x6b4d, 0x6b4e, 0x6b4f,
+ 0x6b50, 0x6b51, 0x6b52, 0x6b53, 0x6b54, 0x6b55, 0x6b56, 0x6b57,
+ 0x6b58, 0x6b59, 0x6b5a, 0x6b5b, 0x6b5c, 0x6b5d, 0x6b5e, 0x6b5f,
+ 0x6b60, 0x6b61, 0x6b62, 0x6b63, 0x6b64, 0x6b65, 0x6b66, 0x6b67,
+ 0x6b68, 0x6b69, 0x6b6a, 0x6b6b, 0x6b6c, 0x6b6d, 0x6b6e, 0x6b6f,
+ 0x6b70, 0x6b71, 0x6b72, 0x6b73, 0x6b74, 0x6b75, 0x6b76, 0x6b77,
+ 0x6b78, 0x6b79, 0x6b7a, 0x6b7b, 0x6b7c, 0x6b7d, 0x6b7e, 0x6b7f,
+ 0x6b80, 0x6b81, 0x6b82, 0x6b83, 0x6b84, 0x6b85, 0x6b86, 0x6b87,
+ 0x6b88, 0x6b89, 0x6b8a, 0x6b8b, 0x6b8c, 0x6b8d, 0x6b8e, 0x6b8f,
+ 0x6b90, 0x6b91, 0x6b92, 0x6b93, 0x6b94, 0x6b95, 0x6b96, 0x6b97,
+ 0x6b98, 0x6b99, 0x6b9a, 0x6b9b, 0x6b9c, 0x6b9d, 0x6b9e, 0x6b9f,
+ 0x6ba0, 0x6ba1, 0x6ba2, 0x6ba3, 0x6ba4, 0x6ba5, 0x6ba6, 0x6ba7,
+ 0x6ba8, 0x6ba9, 0x6baa, 0x6bab, 0x6bac, 0x6bad, 0x6bae, 0x6baf,
+ 0x6bb0, 0x6bb1, 0x6bb2, 0x6bb3, 0x6bb4, 0x6bb5, 0x6bb6, 0x6bb7,
+ 0x6bb8, 0x6bb9, 0x6bba, 0x6bbb, 0x6bbc, 0x6bbd, 0x6bbe, 0x6bbf,
+ 0x6bc0, 0x6bc1, 0x6bc2, 0x6bc3, 0x6bc4, 0x6bc5, 0x6bc6, 0x6bc7,
+ 0x6bc8, 0x6bc9, 0x6bca, 0x6bcb, 0x6bcc, 0x6bcd, 0x6bce, 0x6bcf,
+ 0x6bd0, 0x6bd1, 0x6bd2, 0x6bd3, 0x6bd4, 0x6bd5, 0x6bd6, 0x6bd7,
+ 0x6bd8, 0x6bd9, 0x6bda, 0x6bdb, 0x6bdc, 0x6bdd, 0x6bde, 0x6bdf,
+ 0x6be0, 0x6be1, 0x6be2, 0x6be3, 0x6be4, 0x6be5, 0x6be6, 0x6be7,
+ 0x6be8, 0x6be9, 0x6bea, 0x6beb, 0x6bec, 0x6bed, 0x6bee, 0x6bef,
+ 0x6bf0, 0x6bf1, 0x6bf2, 0x6bf3, 0x6bf4, 0x6bf5, 0x6bf6, 0x6bf7,
+ 0x6bf8, 0x6bf9, 0x6bfa, 0x6bfb, 0x6bfc, 0x6bfd, 0x6bfe, 0x6bff,
+ 0x6c00, 0x6c01, 0x6c02, 0x6c03, 0x6c04, 0x6c05, 0x6c06, 0x6c07,
+ 0x6c08, 0x6c09, 0x6c0a, 0x6c0b, 0x6c0c, 0x6c0d, 0x6c0e, 0x6c0f,
+ 0x6c10, 0x6c11, 0x6c12, 0x6c13, 0x6c14, 0x6c15, 0x6c16, 0x6c17,
+ 0x6c18, 0x6c19, 0x6c1a, 0x6c1b, 0x6c1c, 0x6c1d, 0x6c1e, 0x6c1f,
+ 0x6c20, 0x6c21, 0x6c22, 0x6c23, 0x6c24, 0x6c25, 0x6c26, 0x6c27,
+ 0x6c28, 0x6c29, 0x6c2a, 0x6c2b, 0x6c2c, 0x6c2d, 0x6c2e, 0x6c2f,
+ 0x6c30, 0x6c31, 0x6c32, 0x6c33, 0x6c34, 0x6c35, 0x6c36, 0x6c37,
+ 0x6c38, 0x6c39, 0x6c3a, 0x6c3b, 0x6c3c, 0x6c3d, 0x6c3e, 0x6c3f,
+ 0x6c40, 0x6c41, 0x6c42, 0x6c43, 0x6c44, 0x6c45, 0x6c46, 0x6c47,
+ 0x6c48, 0x6c49, 0x6c4a, 0x6c4b, 0x6c4c, 0x6c4d, 0x6c4e, 0x6c4f,
+ 0x6c50, 0x6c51, 0x6c52, 0x6c53, 0x6c54, 0x6c55, 0x6c56, 0x6c57,
+ 0x6c58, 0x6c59, 0x6c5a, 0x6c5b, 0x6c5c, 0x6c5d, 0x6c5e, 0x6c5f,
+ 0x6c60, 0x6c61, 0x6c62, 0x6c63, 0x6c64, 0x6c65, 0x6c66, 0x6c67,
+ 0x6c68, 0x6c69, 0x6c6a, 0x6c6b, 0x6c6c, 0x6c6d, 0x6c6e, 0x6c6f,
+ 0x6c70, 0x6c71, 0x6c72, 0x6c73, 0x6c74, 0x6c75, 0x6c76, 0x6c77,
+ 0x6c78, 0x6c79, 0x6c7a, 0x6c7b, 0x6c7c, 0x6c7d, 0x6c7e, 0x6c7f,
+ 0x6c80, 0x6c81, 0x6c82, 0x6c83, 0x6c84, 0x6c85, 0x6c86, 0x6c87,
+ 0x6c88, 0x6c89, 0x6c8a, 0x6c8b, 0x6c8c, 0x6c8d, 0x6c8e, 0x6c8f,
+ 0x6c90, 0x6c91, 0x6c92, 0x6c93, 0x6c94, 0x6c95, 0x6c96, 0x6c97,
+ 0x6c98, 0x6c99, 0x6c9a, 0x6c9b, 0x6c9c, 0x6c9d, 0x6c9e, 0x6c9f,
+ 0x6ca0, 0x6ca1, 0x6ca2, 0x6ca3, 0x6ca4, 0x6ca5, 0x6ca6, 0x6ca7,
+ 0x6ca8, 0x6ca9, 0x6caa, 0x6cab, 0x6cac, 0x6cad, 0x6cae, 0x6caf,
+ 0x6cb0, 0x6cb1, 0x6cb2, 0x6cb3, 0x6cb4, 0x6cb5, 0x6cb6, 0x6cb7,
+ 0x6cb8, 0x6cb9, 0x6cba, 0x6cbb, 0x6cbc, 0x6cbd, 0x6cbe, 0x6cbf,
+ 0x6cc0, 0x6cc1, 0x6cc2, 0x6cc3, 0x6cc4, 0x6cc5, 0x6cc6, 0x6cc7,
+ 0x6cc8, 0x6cc9, 0x6cca, 0x6ccb, 0x6ccc, 0x6ccd, 0x6cce, 0x6ccf,
+ 0x6cd0, 0x6cd1, 0x6cd2, 0x6cd3, 0x6cd4, 0x6cd5, 0x6cd6, 0x6cd7,
+ 0x6cd8, 0x6cd9, 0x6cda, 0x6cdb, 0x6cdc, 0x6cdd, 0x6cde, 0x6cdf,
+ 0x6ce0, 0x6ce1, 0x6ce2, 0x6ce3, 0x6ce4, 0x6ce5, 0x6ce6, 0x6ce7,
+ 0x6ce8, 0x6ce9, 0x6cea, 0x6ceb, 0x6cec, 0x6ced, 0x6cee, 0x6cef,
+ 0x6cf0, 0x6cf1, 0x6cf2, 0x6cf3, 0x6cf4, 0x6cf5, 0x6cf6, 0x6cf7,
+ 0x6cf8, 0x6cf9, 0x6cfa, 0x6cfb, 0x6cfc, 0x6cfd, 0x6cfe, 0x6cff,
+ 0x6d00, 0x6d01, 0x6d02, 0x6d03, 0x6d04, 0x6d05, 0x6d06, 0x6d07,
+ 0x6d08, 0x6d09, 0x6d0a, 0x6d0b, 0x6d0c, 0x6d0d, 0x6d0e, 0x6d0f,
+ 0x6d10, 0x6d11, 0x6d12, 0x6d13, 0x6d14, 0x6d15, 0x6d16, 0x6d17,
+ 0x6d18, 0x6d19, 0x6d1a, 0x6d1b, 0x6d1c, 0x6d1d, 0x6d1e, 0x6d1f,
+ 0x6d20, 0x6d21, 0x6d22, 0x6d23, 0x6d24, 0x6d25, 0x6d26, 0x6d27,
+ 0x6d28, 0x6d29, 0x6d2a, 0x6d2b, 0x6d2c, 0x6d2d, 0x6d2e, 0x6d2f,
+ 0x6d30, 0x6d31, 0x6d32, 0x6d33, 0x6d34, 0x6d35, 0x6d36, 0x6d37,
+ 0x6d38, 0x6d39, 0x6d3a, 0x6d3b, 0x6d3c, 0x6d3d, 0x6d3e, 0x6d3f,
+ 0x6d40, 0x6d41, 0x6d42, 0x6d43, 0x6d44, 0x6d45, 0x6d46, 0x6d47,
+ 0x6d48, 0x6d49, 0x6d4a, 0x6d4b, 0x6d4c, 0x6d4d, 0x6d4e, 0x6d4f,
+ 0x6d50, 0x6d51, 0x6d52, 0x6d53, 0x6d54, 0x6d55, 0x6d56, 0x6d57,
+ 0x6d58, 0x6d59, 0x6d5a, 0x6d5b, 0x6d5c, 0x6d5d, 0x6d5e, 0x6d5f,
+ 0x6d60, 0x6d61, 0x6d62, 0x6d63, 0x6d64, 0x6d65, 0x6d66, 0x6d67,
+ 0x6d68, 0x6d69, 0x6d6a, 0x6d6b, 0x6d6c, 0x6d6d, 0x6d6e, 0x6d6f,
+ 0x6d70, 0x6d71, 0x6d72, 0x6d73, 0x6d74, 0x6d75, 0x6d76, 0x6d77,
+ 0x6d78, 0x6d79, 0x6d7a, 0x6d7b, 0x6d7c, 0x6d7d, 0x6d7e, 0x6d7f,
+ 0x6d80, 0x6d81, 0x6d82, 0x6d83, 0x6d84, 0x6d85, 0x6d86, 0x6d87,
+ 0x6d88, 0x6d89, 0x6d8a, 0x6d8b, 0x6d8c, 0x6d8d, 0x6d8e, 0x6d8f,
+ 0x6d90, 0x6d91, 0x6d92, 0x6d93, 0x6d94, 0x6d95, 0x6d96, 0x6d97,
+ 0x6d98, 0x6d99, 0x6d9a, 0x6d9b, 0x6d9c, 0x6d9d, 0x6d9e, 0x6d9f,
+ 0x6da0, 0x6da1, 0x6da2, 0x6da3, 0x6da4, 0x6da5, 0x6da6, 0x6da7,
+ 0x6da8, 0x6da9, 0x6daa, 0x6dab, 0x6dac, 0x6dad, 0x6dae, 0x6daf,
+ 0x6db0, 0x6db1, 0x6db2, 0x6db3, 0x6db4, 0x6db5, 0x6db6, 0x6db7,
+ 0x6db8, 0x6db9, 0x6dba, 0x6dbb, 0x6dbc, 0x6dbd, 0x6dbe, 0x6dbf,
+ 0x6dc0, 0x6dc1, 0x6dc2, 0x6dc3, 0x6dc4, 0x6dc5, 0x6dc6, 0x6dc7,
+ 0x6dc8, 0x6dc9, 0x6dca, 0x6dcb, 0x6dcc, 0x6dcd, 0x6dce, 0x6dcf,
+ 0x6dd0, 0x6dd1, 0x6dd2, 0x6dd3, 0x6dd4, 0x6dd5, 0x6dd6, 0x6dd7,
+ 0x6dd8, 0x6dd9, 0x6dda, 0x6ddb, 0x6ddc, 0x6ddd, 0x6dde, 0x6ddf,
+ 0x6de0, 0x6de1, 0x6de2, 0x6de3, 0x6de4, 0x6de5, 0x6de6, 0x6de7,
+ 0x6de8, 0x6de9, 0x6dea, 0x6deb, 0x6dec, 0x6ded, 0x6dee, 0x6def,
+ 0x6df0, 0x6df1, 0x6df2, 0x6df3, 0x6df4, 0x6df5, 0x6df6, 0x6df7,
+ 0x6df8, 0x6df9, 0x6dfa, 0x6dfb, 0x6dfc, 0x6dfd, 0x6dfe, 0x6dff,
+ 0x6e00, 0x6e01, 0x6e02, 0x6e03, 0x6e04, 0x6e05, 0x6e06, 0x6e07,
+ 0x6e08, 0x6e09, 0x6e0a, 0x6e0b, 0x6e0c, 0x6e0d, 0x6e0e, 0x6e0f,
+ 0x6e10, 0x6e11, 0x6e12, 0x6e13, 0x6e14, 0x6e15, 0x6e16, 0x6e17,
+ 0x6e18, 0x6e19, 0x6e1a, 0x6e1b, 0x6e1c, 0x6e1d, 0x6e1e, 0x6e1f,
+ 0x6e20, 0x6e21, 0x6e22, 0x6e23, 0x6e24, 0x6e25, 0x6e26, 0x6e27,
+ 0x6e28, 0x6e29, 0x6e2a, 0x6e2b, 0x6e2c, 0x6e2d, 0x6e2e, 0x6e2f,
+ 0x6e30, 0x6e31, 0x6e32, 0x6e33, 0x6e34, 0x6e35, 0x6e36, 0x6e37,
+ 0x6e38, 0x6e39, 0x6e3a, 0x6e3b, 0x6e3c, 0x6e3d, 0x6e3e, 0x6e3f,
+ 0x6e40, 0x6e41, 0x6e42, 0x6e43, 0x6e44, 0x6e45, 0x6e46, 0x6e47,
+ 0x6e48, 0x6e49, 0x6e4a, 0x6e4b, 0x6e4c, 0x6e4d, 0x6e4e, 0x6e4f,
+ 0x6e50, 0x6e51, 0x6e52, 0x6e53, 0x6e54, 0x6e55, 0x6e56, 0x6e57,
+ 0x6e58, 0x6e59, 0x6e5a, 0x6e5b, 0x6e5c, 0x6e5d, 0x6e5e, 0x6e5f,
+ 0x6e60, 0x6e61, 0x6e62, 0x6e63, 0x6e64, 0x6e65, 0x6e66, 0x6e67,
+ 0x6e68, 0x6e69, 0x6e6a, 0x6e6b, 0x6e6c, 0x6e6d, 0x6e6e, 0x6e6f,
+ 0x6e70, 0x6e71, 0x6e72, 0x6e73, 0x6e74, 0x6e75, 0x6e76, 0x6e77,
+ 0x6e78, 0x6e79, 0x6e7a, 0x6e7b, 0x6e7c, 0x6e7d, 0x6e7e, 0x6e7f,
+ 0x6e80, 0x6e81, 0x6e82, 0x6e83, 0x6e84, 0x6e85, 0x6e86, 0x6e87,
+ 0x6e88, 0x6e89, 0x6e8a, 0x6e8b, 0x6e8c, 0x6e8d, 0x6e8e, 0x6e8f,
+ 0x6e90, 0x6e91, 0x6e92, 0x6e93, 0x6e94, 0x6e95, 0x6e96, 0x6e97,
+ 0x6e98, 0x6e99, 0x6e9a, 0x6e9b, 0x6e9c, 0x6e9d, 0x6e9e, 0x6e9f,
+ 0x6ea0, 0x6ea1, 0x6ea2, 0x6ea3, 0x6ea4, 0x6ea5, 0x6ea6, 0x6ea7,
+ 0x6ea8, 0x6ea9, 0x6eaa, 0x6eab, 0x6eac, 0x6ead, 0x6eae, 0x6eaf,
+ 0x6eb0, 0x6eb1, 0x6eb2, 0x6eb3, 0x6eb4, 0x6eb5, 0x6eb6, 0x6eb7,
+ 0x6eb8, 0x6eb9, 0x6eba, 0x6ebb, 0x6ebc, 0x6ebd, 0x6ebe, 0x6ebf,
+ 0x6ec0, 0x6ec1, 0x6ec2, 0x6ec3, 0x6ec4, 0x6ec5, 0x6ec6, 0x6ec7,
+ 0x6ec8, 0x6ec9, 0x6eca, 0x6ecb, 0x6ecc, 0x6ecd, 0x6ece, 0x6ecf,
+ 0x6ed0, 0x6ed1, 0x6ed2, 0x6ed3, 0x6ed4, 0x6ed5, 0x6ed6, 0x6ed7,
+ 0x6ed8, 0x6ed9, 0x6eda, 0x6edb, 0x6edc, 0x6edd, 0x6ede, 0x6edf,
+ 0x6ee0, 0x6ee1, 0x6ee2, 0x6ee3, 0x6ee4, 0x6ee5, 0x6ee6, 0x6ee7,
+ 0x6ee8, 0x6ee9, 0x6eea, 0x6eeb, 0x6eec, 0x6eed, 0x6eee, 0x6eef,
+ 0x6ef0, 0x6ef1, 0x6ef2, 0x6ef3, 0x6ef4, 0x6ef5, 0x6ef6, 0x6ef7,
+ 0x6ef8, 0x6ef9, 0x6efa, 0x6efb, 0x6efc, 0x6efd, 0x6efe, 0x6eff,
+ 0x6f00, 0x6f01, 0x6f02, 0x6f03, 0x6f04, 0x6f05, 0x6f06, 0x6f07,
+ 0x6f08, 0x6f09, 0x6f0a, 0x6f0b, 0x6f0c, 0x6f0d, 0x6f0e, 0x6f0f,
+ 0x6f10, 0x6f11, 0x6f12, 0x6f13, 0x6f14, 0x6f15, 0x6f16, 0x6f17,
+ 0x6f18, 0x6f19, 0x6f1a, 0x6f1b, 0x6f1c, 0x6f1d, 0x6f1e, 0x6f1f,
+ 0x6f20, 0x6f21, 0x6f22, 0x6f23, 0x6f24, 0x6f25, 0x6f26, 0x6f27,
+ 0x6f28, 0x6f29, 0x6f2a, 0x6f2b, 0x6f2c, 0x6f2d, 0x6f2e, 0x6f2f,
+ 0x6f30, 0x6f31, 0x6f32, 0x6f33, 0x6f34, 0x6f35, 0x6f36, 0x6f37,
+ 0x6f38, 0x6f39, 0x6f3a, 0x6f3b, 0x6f3c, 0x6f3d, 0x6f3e, 0x6f3f,
+ 0x6f40, 0x6f41, 0x6f42, 0x6f43, 0x6f44, 0x6f45, 0x6f46, 0x6f47,
+ 0x6f48, 0x6f49, 0x6f4a, 0x6f4b, 0x6f4c, 0x6f4d, 0x6f4e, 0x6f4f,
+ 0x6f50, 0x6f51, 0x6f52, 0x6f53, 0x6f54, 0x6f55, 0x6f56, 0x6f57,
+ 0x6f58, 0x6f59, 0x6f5a, 0x6f5b, 0x6f5c, 0x6f5d, 0x6f5e, 0x6f5f,
+ 0x6f60, 0x6f61, 0x6f62, 0x6f63, 0x6f64, 0x6f65, 0x6f66, 0x6f67,
+ 0x6f68, 0x6f69, 0x6f6a, 0x6f6b, 0x6f6c, 0x6f6d, 0x6f6e, 0x6f6f,
+ 0x6f70, 0x6f71, 0x6f72, 0x6f73, 0x6f74, 0x6f75, 0x6f76, 0x6f77,
+ 0x6f78, 0x6f79, 0x6f7a, 0x6f7b, 0x6f7c, 0x6f7d, 0x6f7e, 0x6f7f,
+ 0x6f80, 0x6f81, 0x6f82, 0x6f83, 0x6f84, 0x6f85, 0x6f86, 0x6f87,
+ 0x6f88, 0x6f89, 0x6f8a, 0x6f8b, 0x6f8c, 0x6f8d, 0x6f8e, 0x6f8f,
+ 0x6f90, 0x6f91, 0x6f92, 0x6f93, 0x6f94, 0x6f95, 0x6f96, 0x6f97,
+ 0x6f98, 0x6f99, 0x6f9a, 0x6f9b, 0x6f9c, 0x6f9d, 0x6f9e, 0x6f9f,
+ 0x6fa0, 0x6fa1, 0x6fa2, 0x6fa3, 0x6fa4, 0x6fa5, 0x6fa6, 0x6fa7,
+ 0x6fa8, 0x6fa9, 0x6faa, 0x6fab, 0x6fac, 0x6fad, 0x6fae, 0x6faf,
+ 0x6fb0, 0x6fb1, 0x6fb2, 0x6fb3, 0x6fb4, 0x6fb5, 0x6fb6, 0x6fb7,
+ 0x6fb8, 0x6fb9, 0x6fba, 0x6fbb, 0x6fbc, 0x6fbd, 0x6fbe, 0x6fbf,
+ 0x6fc0, 0x6fc1, 0x6fc2, 0x6fc3, 0x6fc4, 0x6fc5, 0x6fc6, 0x6fc7,
+ 0x6fc8, 0x6fc9, 0x6fca, 0x6fcb, 0x6fcc, 0x6fcd, 0x6fce, 0x6fcf,
+ 0x6fd0, 0x6fd1, 0x6fd2, 0x6fd3, 0x6fd4, 0x6fd5, 0x6fd6, 0x6fd7,
+ 0x6fd8, 0x6fd9, 0x6fda, 0x6fdb, 0x6fdc, 0x6fdd, 0x6fde, 0x6fdf,
+ 0x6fe0, 0x6fe1, 0x6fe2, 0x6fe3, 0x6fe4, 0x6fe5, 0x6fe6, 0x6fe7,
+ 0x6fe8, 0x6fe9, 0x6fea, 0x6feb, 0x6fec, 0x6fed, 0x6fee, 0x6fef,
+ 0x6ff0, 0x6ff1, 0x6ff2, 0x6ff3, 0x6ff4, 0x6ff5, 0x6ff6, 0x6ff7,
+ 0x6ff8, 0x6ff9, 0x6ffa, 0x6ffb, 0x6ffc, 0x6ffd, 0x6ffe, 0x6fff,
+ 0x7000, 0x7001, 0x7002, 0x7003, 0x7004, 0x7005, 0x7006, 0x7007,
+ 0x7008, 0x7009, 0x700a, 0x700b, 0x700c, 0x700d, 0x700e, 0x700f,
+ 0x7010, 0x7011, 0x7012, 0x7013, 0x7014, 0x7015, 0x7016, 0x7017,
+ 0x7018, 0x7019, 0x701a, 0x701b, 0x701c, 0x701d, 0x701e, 0x701f,
+ 0x7020, 0x7021, 0x7022, 0x7023, 0x7024, 0x7025, 0x7026, 0x7027,
+ 0x7028, 0x7029, 0x702a, 0x702b, 0x702c, 0x702d, 0x702e, 0x702f,
+ 0x7030, 0x7031, 0x7032, 0x7033, 0x7034, 0x7035, 0x7036, 0x7037,
+ 0x7038, 0x7039, 0x703a, 0x703b, 0x703c, 0x703d, 0x703e, 0x703f,
+ 0x7040, 0x7041, 0x7042, 0x7043, 0x7044, 0x7045, 0x7046, 0x7047,
+ 0x7048, 0x7049, 0x704a, 0x704b, 0x704c, 0x704d, 0x704e, 0x704f,
+ 0x7050, 0x7051, 0x7052, 0x7053, 0x7054, 0x7055, 0x7056, 0x7057,
+ 0x7058, 0x7059, 0x705a, 0x705b, 0x705c, 0x705d, 0x705e, 0x705f,
+ 0x7060, 0x7061, 0x7062, 0x7063, 0x7064, 0x7065, 0x7066, 0x7067,
+ 0x7068, 0x7069, 0x706a, 0x706b, 0x706c, 0x706d, 0x706e, 0x706f,
+ 0x7070, 0x7071, 0x7072, 0x7073, 0x7074, 0x7075, 0x7076, 0x7077,
+ 0x7078, 0x7079, 0x707a, 0x707b, 0x707c, 0x707d, 0x707e, 0x707f,
+ 0x7080, 0x7081, 0x7082, 0x7083, 0x7084, 0x7085, 0x7086, 0x7087,
+ 0x7088, 0x7089, 0x708a, 0x708b, 0x708c, 0x708d, 0x708e, 0x708f,
+ 0x7090, 0x7091, 0x7092, 0x7093, 0x7094, 0x7095, 0x7096, 0x7097,
+ 0x7098, 0x7099, 0x709a, 0x709b, 0x709c, 0x709d, 0x709e, 0x709f,
+ 0x70a0, 0x70a1, 0x70a2, 0x70a3, 0x70a4, 0x70a5, 0x70a6, 0x70a7,
+ 0x70a8, 0x70a9, 0x70aa, 0x70ab, 0x70ac, 0x70ad, 0x70ae, 0x70af,
+ 0x70b0, 0x70b1, 0x70b2, 0x70b3, 0x70b4, 0x70b5, 0x70b6, 0x70b7,
+ 0x70b8, 0x70b9, 0x70ba, 0x70bb, 0x70bc, 0x70bd, 0x70be, 0x70bf,
+ 0x70c0, 0x70c1, 0x70c2, 0x70c3, 0x70c4, 0x70c5, 0x70c6, 0x70c7,
+ 0x70c8, 0x70c9, 0x70ca, 0x70cb, 0x70cc, 0x70cd, 0x70ce, 0x70cf,
+ 0x70d0, 0x70d1, 0x70d2, 0x70d3, 0x70d4, 0x70d5, 0x70d6, 0x70d7,
+ 0x70d8, 0x70d9, 0x70da, 0x70db, 0x70dc, 0x70dd, 0x70de, 0x70df,
+ 0x70e0, 0x70e1, 0x70e2, 0x70e3, 0x70e4, 0x70e5, 0x70e6, 0x70e7,
+ 0x70e8, 0x70e9, 0x70ea, 0x70eb, 0x70ec, 0x70ed, 0x70ee, 0x70ef,
+ 0x70f0, 0x70f1, 0x70f2, 0x70f3, 0x70f4, 0x70f5, 0x70f6, 0x70f7,
+ 0x70f8, 0x70f9, 0x70fa, 0x70fb, 0x70fc, 0x70fd, 0x70fe, 0x70ff,
+ 0x7100, 0x7101, 0x7102, 0x7103, 0x7104, 0x7105, 0x7106, 0x7107,
+ 0x7108, 0x7109, 0x710a, 0x710b, 0x710c, 0x710d, 0x710e, 0x710f,
+ 0x7110, 0x7111, 0x7112, 0x7113, 0x7114, 0x7115, 0x7116, 0x7117,
+ 0x7118, 0x7119, 0x711a, 0x711b, 0x711c, 0x711d, 0x711e, 0x711f,
+ 0x7120, 0x7121, 0x7122, 0x7123, 0x7124, 0x7125, 0x7126, 0x7127,
+ 0x7128, 0x7129, 0x712a, 0x712b, 0x712c, 0x712d, 0x712e, 0x712f,
+ 0x7130, 0x7131, 0x7132, 0x7133, 0x7134, 0x7135, 0x7136, 0x7137,
+ 0x7138, 0x7139, 0x713a, 0x713b, 0x713c, 0x713d, 0x713e, 0x713f,
+ 0x7140, 0x7141, 0x7142, 0x7143, 0x7144, 0x7145, 0x7146, 0x7147,
+ 0x7148, 0x7149, 0x714a, 0x714b, 0x714c, 0x714d, 0x714e, 0x714f,
+ 0x7150, 0x7151, 0x7152, 0x7153, 0x7154, 0x7155, 0x7156, 0x7157,
+ 0x7158, 0x7159, 0x715a, 0x715b, 0x715c, 0x715d, 0x715e, 0x715f,
+ 0x7160, 0x7161, 0x7162, 0x7163, 0x7164, 0x7165, 0x7166, 0x7167,
+ 0x7168, 0x7169, 0x716a, 0x716b, 0x716c, 0x716d, 0x716e, 0x716f,
+ 0x7170, 0x7171, 0x7172, 0x7173, 0x7174, 0x7175, 0x7176, 0x7177,
+ 0x7178, 0x7179, 0x717a, 0x717b, 0x717c, 0x717d, 0x717e, 0x717f,
+ 0x7180, 0x7181, 0x7182, 0x7183, 0x7184, 0x7185, 0x7186, 0x7187,
+ 0x7188, 0x7189, 0x718a, 0x718b, 0x718c, 0x718d, 0x718e, 0x718f,
+ 0x7190, 0x7191, 0x7192, 0x7193, 0x7194, 0x7195, 0x7196, 0x7197,
+ 0x7198, 0x7199, 0x719a, 0x719b, 0x719c, 0x719d, 0x719e, 0x719f,
+ 0x71a0, 0x71a1, 0x71a2, 0x71a3, 0x71a4, 0x71a5, 0x71a6, 0x71a7,
+ 0x71a8, 0x71a9, 0x71aa, 0x71ab, 0x71ac, 0x71ad, 0x71ae, 0x71af,
+ 0x71b0, 0x71b1, 0x71b2, 0x71b3, 0x71b4, 0x71b5, 0x71b6, 0x71b7,
+ 0x71b8, 0x71b9, 0x71ba, 0x71bb, 0x71bc, 0x71bd, 0x71be, 0x71bf,
+ 0x71c0, 0x71c1, 0x71c2, 0x71c3, 0x71c4, 0x71c5, 0x71c6, 0x71c7,
+ 0x71c8, 0x71c9, 0x71ca, 0x71cb, 0x71cc, 0x71cd, 0x71ce, 0x71cf,
+ 0x71d0, 0x71d1, 0x71d2, 0x71d3, 0x71d4, 0x71d5, 0x71d6, 0x71d7,
+ 0x71d8, 0x71d9, 0x71da, 0x71db, 0x71dc, 0x71dd, 0x71de, 0x71df,
+ 0x71e0, 0x71e1, 0x71e2, 0x71e3, 0x71e4, 0x71e5, 0x71e6, 0x71e7,
+ 0x71e8, 0x71e9, 0x71ea, 0x71eb, 0x71ec, 0x71ed, 0x71ee, 0x71ef,
+ 0x71f0, 0x71f1, 0x71f2, 0x71f3, 0x71f4, 0x71f5, 0x71f6, 0x71f7,
+ 0x71f8, 0x71f9, 0x71fa, 0x71fb, 0x71fc, 0x71fd, 0x71fe, 0x71ff,
+ 0x7200, 0x7201, 0x7202, 0x7203, 0x7204, 0x7205, 0x7206, 0x7207,
+ 0x7208, 0x7209, 0x720a, 0x720b, 0x720c, 0x720d, 0x720e, 0x720f,
+ 0x7210, 0x7211, 0x7212, 0x7213, 0x7214, 0x7215, 0x7216, 0x7217,
+ 0x7218, 0x7219, 0x721a, 0x721b, 0x721c, 0x721d, 0x721e, 0x721f,
+ 0x7220, 0x7221, 0x7222, 0x7223, 0x7224, 0x7225, 0x7226, 0x7227,
+ 0x7228, 0x7229, 0x722a, 0x722b, 0x722c, 0x722d, 0x722e, 0x722f,
+ 0x7230, 0x7231, 0x7232, 0x7233, 0x7234, 0x7235, 0x7236, 0x7237,
+ 0x7238, 0x7239, 0x723a, 0x723b, 0x723c, 0x723d, 0x723e, 0x723f,
+ 0x7240, 0x7241, 0x7242, 0x7243, 0x7244, 0x7245, 0x7246, 0x7247,
+ 0x7248, 0x7249, 0x724a, 0x724b, 0x724c, 0x724d, 0x724e, 0x724f,
+ 0x7250, 0x7251, 0x7252, 0x7253, 0x7254, 0x7255, 0x7256, 0x7257,
+ 0x7258, 0x7259, 0x725a, 0x725b, 0x725c, 0x725d, 0x725e, 0x725f,
+ 0x7260, 0x7261, 0x7262, 0x7263, 0x7264, 0x7265, 0x7266, 0x7267,
+ 0x7268, 0x7269, 0x726a, 0x726b, 0x726c, 0x726d, 0x726e, 0x726f,
+ 0x7270, 0x7271, 0x7272, 0x7273, 0x7274, 0x7275, 0x7276, 0x7277,
+ 0x7278, 0x7279, 0x727a, 0x727b, 0x727c, 0x727d, 0x727e, 0x727f,
+ 0x7280, 0x7281, 0x7282, 0x7283, 0x7284, 0x7285, 0x7286, 0x7287,
+ 0x7288, 0x7289, 0x728a, 0x728b, 0x728c, 0x728d, 0x728e, 0x728f,
+ 0x7290, 0x7291, 0x7292, 0x7293, 0x7294, 0x7295, 0x7296, 0x7297,
+ 0x7298, 0x7299, 0x729a, 0x729b, 0x729c, 0x729d, 0x729e, 0x729f,
+ 0x72a0, 0x72a1, 0x72a2, 0x72a3, 0x72a4, 0x72a5, 0x72a6, 0x72a7,
+ 0x72a8, 0x72a9, 0x72aa, 0x72ab, 0x72ac, 0x72ad, 0x72ae, 0x72af,
+ 0x72b0, 0x72b1, 0x72b2, 0x72b3, 0x72b4, 0x72b5, 0x72b6, 0x72b7,
+ 0x72b8, 0x72b9, 0x72ba, 0x72bb, 0x72bc, 0x72bd, 0x72be, 0x72bf,
+ 0x72c0, 0x72c1, 0x72c2, 0x72c3, 0x72c4, 0x72c5, 0x72c6, 0x72c7,
+ 0x72c8, 0x72c9, 0x72ca, 0x72cb, 0x72cc, 0x72cd, 0x72ce, 0x72cf,
+ 0x72d0, 0x72d1, 0x72d2, 0x72d3, 0x72d4, 0x72d5, 0x72d6, 0x72d7,
+ 0x72d8, 0x72d9, 0x72da, 0x72db, 0x72dc, 0x72dd, 0x72de, 0x72df,
+ 0x72e0, 0x72e1, 0x72e2, 0x72e3, 0x72e4, 0x72e5, 0x72e6, 0x72e7,
+ 0x72e8, 0x72e9, 0x72ea, 0x72eb, 0x72ec, 0x72ed, 0x72ee, 0x72ef,
+ 0x72f0, 0x72f1, 0x72f2, 0x72f3, 0x72f4, 0x72f5, 0x72f6, 0x72f7,
+ 0x72f8, 0x72f9, 0x72fa, 0x72fb, 0x72fc, 0x72fd, 0x72fe, 0x72ff,
+ 0x7300, 0x7301, 0x7302, 0x7303, 0x7304, 0x7305, 0x7306, 0x7307,
+ 0x7308, 0x7309, 0x730a, 0x730b, 0x730c, 0x730d, 0x730e, 0x730f,
+ 0x7310, 0x7311, 0x7312, 0x7313, 0x7314, 0x7315, 0x7316, 0x7317,
+ 0x7318, 0x7319, 0x731a, 0x731b, 0x731c, 0x731d, 0x731e, 0x731f,
+ 0x7320, 0x7321, 0x7322, 0x7323, 0x7324, 0x7325, 0x7326, 0x7327,
+ 0x7328, 0x7329, 0x732a, 0x732b, 0x732c, 0x732d, 0x732e, 0x732f,
+ 0x7330, 0x7331, 0x7332, 0x7333, 0x7334, 0x7335, 0x7336, 0x7337,
+ 0x7338, 0x7339, 0x733a, 0x733b, 0x733c, 0x733d, 0x733e, 0x733f,
+ 0x7340, 0x7341, 0x7342, 0x7343, 0x7344, 0x7345, 0x7346, 0x7347,
+ 0x7348, 0x7349, 0x734a, 0x734b, 0x734c, 0x734d, 0x734e, 0x734f,
+ 0x7350, 0x7351, 0x7352, 0x7353, 0x7354, 0x7355, 0x7356, 0x7357,
+ 0x7358, 0x7359, 0x735a, 0x735b, 0x735c, 0x735d, 0x735e, 0x735f,
+ 0x7360, 0x7361, 0x7362, 0x7363, 0x7364, 0x7365, 0x7366, 0x7367,
+ 0x7368, 0x7369, 0x736a, 0x736b, 0x736c, 0x736d, 0x736e, 0x736f,
+ 0x7370, 0x7371, 0x7372, 0x7373, 0x7374, 0x7375, 0x7376, 0x7377,
+ 0x7378, 0x7379, 0x737a, 0x737b, 0x737c, 0x737d, 0x737e, 0x737f,
+ 0x7380, 0x7381, 0x7382, 0x7383, 0x7384, 0x7385, 0x7386, 0x7387,
+ 0x7388, 0x7389, 0x738a, 0x738b, 0x738c, 0x738d, 0x738e, 0x738f,
+ 0x7390, 0x7391, 0x7392, 0x7393, 0x7394, 0x7395, 0x7396, 0x7397,
+ 0x7398, 0x7399, 0x739a, 0x739b, 0x739c, 0x739d, 0x739e, 0x739f,
+ 0x73a0, 0x73a1, 0x73a2, 0x73a3, 0x73a4, 0x73a5, 0x73a6, 0x73a7,
+ 0x73a8, 0x73a9, 0x73aa, 0x73ab, 0x73ac, 0x73ad, 0x73ae, 0x73af,
+ 0x73b0, 0x73b1, 0x73b2, 0x73b3, 0x73b4, 0x73b5, 0x73b6, 0x73b7,
+ 0x73b8, 0x73b9, 0x73ba, 0x73bb, 0x73bc, 0x73bd, 0x73be, 0x73bf,
+ 0x73c0, 0x73c1, 0x73c2, 0x73c3, 0x73c4, 0x73c5, 0x73c6, 0x73c7,
+ 0x73c8, 0x73c9, 0x73ca, 0x73cb, 0x73cc, 0x73cd, 0x73ce, 0x73cf,
+ 0x73d0, 0x73d1, 0x73d2, 0x73d3, 0x73d4, 0x73d5, 0x73d6, 0x73d7,
+ 0x73d8, 0x73d9, 0x73da, 0x73db, 0x73dc, 0x73dd, 0x73de, 0x73df,
+ 0x73e0, 0x73e1, 0x73e2, 0x73e3, 0x73e4, 0x73e5, 0x73e6, 0x73e7,
+ 0x73e8, 0x73e9, 0x73ea, 0x73eb, 0x73ec, 0x73ed, 0x73ee, 0x73ef,
+ 0x73f0, 0x73f1, 0x73f2, 0x73f3, 0x73f4, 0x73f5, 0x73f6, 0x73f7,
+ 0x73f8, 0x73f9, 0x73fa, 0x73fb, 0x73fc, 0x73fd, 0x73fe, 0x73ff,
+ 0x7400, 0x7401, 0x7402, 0x7403, 0x7404, 0x7405, 0x7406, 0x7407,
+ 0x7408, 0x7409, 0x740a, 0x740b, 0x740c, 0x740d, 0x740e, 0x740f,
+ 0x7410, 0x7411, 0x7412, 0x7413, 0x7414, 0x7415, 0x7416, 0x7417,
+ 0x7418, 0x7419, 0x741a, 0x741b, 0x741c, 0x741d, 0x741e, 0x741f,
+ 0x7420, 0x7421, 0x7422, 0x7423, 0x7424, 0x7425, 0x7426, 0x7427,
+ 0x7428, 0x7429, 0x742a, 0x742b, 0x742c, 0x742d, 0x742e, 0x742f,
+ 0x7430, 0x7431, 0x7432, 0x7433, 0x7434, 0x7435, 0x7436, 0x7437,
+ 0x7438, 0x7439, 0x743a, 0x743b, 0x743c, 0x743d, 0x743e, 0x743f,
+ 0x7440, 0x7441, 0x7442, 0x7443, 0x7444, 0x7445, 0x7446, 0x7447,
+ 0x7448, 0x7449, 0x744a, 0x744b, 0x744c, 0x744d, 0x744e, 0x744f,
+ 0x7450, 0x7451, 0x7452, 0x7453, 0x7454, 0x7455, 0x7456, 0x7457,
+ 0x7458, 0x7459, 0x745a, 0x745b, 0x745c, 0x745d, 0x745e, 0x745f,
+ 0x7460, 0x7461, 0x7462, 0x7463, 0x7464, 0x7465, 0x7466, 0x7467,
+ 0x7468, 0x7469, 0x746a, 0x746b, 0x746c, 0x746d, 0x746e, 0x746f,
+ 0x7470, 0x7471, 0x7472, 0x7473, 0x7474, 0x7475, 0x7476, 0x7477,
+ 0x7478, 0x7479, 0x747a, 0x747b, 0x747c, 0x747d, 0x747e, 0x747f,
+ 0x7480, 0x7481, 0x7482, 0x7483, 0x7484, 0x7485, 0x7486, 0x7487,
+ 0x7488, 0x7489, 0x748a, 0x748b, 0x748c, 0x748d, 0x748e, 0x748f,
+ 0x7490, 0x7491, 0x7492, 0x7493, 0x7494, 0x7495, 0x7496, 0x7497,
+ 0x7498, 0x7499, 0x749a, 0x749b, 0x749c, 0x749d, 0x749e, 0x749f,
+ 0x74a0, 0x74a1, 0x74a2, 0x74a3, 0x74a4, 0x74a5, 0x74a6, 0x74a7,
+ 0x74a8, 0x74a9, 0x74aa, 0x74ab, 0x74ac, 0x74ad, 0x74ae, 0x74af,
+ 0x74b0, 0x74b1, 0x74b2, 0x74b3, 0x74b4, 0x74b5, 0x74b6, 0x74b7,
+ 0x74b8, 0x74b9, 0x74ba, 0x74bb, 0x74bc, 0x74bd, 0x74be, 0x74bf,
+ 0x74c0, 0x74c1, 0x74c2, 0x74c3, 0x74c4, 0x74c5, 0x74c6, 0x74c7,
+ 0x74c8, 0x74c9, 0x74ca, 0x74cb, 0x74cc, 0x74cd, 0x74ce, 0x74cf,
+ 0x74d0, 0x74d1, 0x74d2, 0x74d3, 0x74d4, 0x74d5, 0x74d6, 0x74d7,
+ 0x74d8, 0x74d9, 0x74da, 0x74db, 0x74dc, 0x74dd, 0x74de, 0x74df,
+ 0x74e0, 0x74e1, 0x74e2, 0x74e3, 0x74e4, 0x74e5, 0x74e6, 0x74e7,
+ 0x74e8, 0x74e9, 0x74ea, 0x74eb, 0x74ec, 0x74ed, 0x74ee, 0x74ef,
+ 0x74f0, 0x74f1, 0x74f2, 0x74f3, 0x74f4, 0x74f5, 0x74f6, 0x74f7,
+ 0x74f8, 0x74f9, 0x74fa, 0x74fb, 0x74fc, 0x74fd, 0x74fe, 0x74ff,
+ 0x7500, 0x7501, 0x7502, 0x7503, 0x7504, 0x7505, 0x7506, 0x7507,
+ 0x7508, 0x7509, 0x750a, 0x750b, 0x750c, 0x750d, 0x750e, 0x750f,
+ 0x7510, 0x7511, 0x7512, 0x7513, 0x7514, 0x7515, 0x7516, 0x7517,
+ 0x7518, 0x7519, 0x751a, 0x751b, 0x751c, 0x751d, 0x751e, 0x751f,
+ 0x7520, 0x7521, 0x7522, 0x7523, 0x7524, 0x7525, 0x7526, 0x7527,
+ 0x7528, 0x7529, 0x752a, 0x752b, 0x752c, 0x752d, 0x752e, 0x752f,
+ 0x7530, 0x7531, 0x7532, 0x7533, 0x7534, 0x7535, 0x7536, 0x7537,
+ 0x7538, 0x7539, 0x753a, 0x753b, 0x753c, 0x753d, 0x753e, 0x753f,
+ 0x7540, 0x7541, 0x7542, 0x7543, 0x7544, 0x7545, 0x7546, 0x7547,
+ 0x7548, 0x7549, 0x754a, 0x754b, 0x754c, 0x754d, 0x754e, 0x754f,
+ 0x7550, 0x7551, 0x7552, 0x7553, 0x7554, 0x7555, 0x7556, 0x7557,
+ 0x7558, 0x7559, 0x755a, 0x755b, 0x755c, 0x755d, 0x755e, 0x755f,
+ 0x7560, 0x7561, 0x7562, 0x7563, 0x7564, 0x7565, 0x7566, 0x7567,
+ 0x7568, 0x7569, 0x756a, 0x756b, 0x756c, 0x756d, 0x756e, 0x756f,
+ 0x7570, 0x7571, 0x7572, 0x7573, 0x7574, 0x7575, 0x7576, 0x7577,
+ 0x7578, 0x7579, 0x757a, 0x757b, 0x757c, 0x757d, 0x757e, 0x757f,
+ 0x7580, 0x7581, 0x7582, 0x7583, 0x7584, 0x7585, 0x7586, 0x7587,
+ 0x7588, 0x7589, 0x758a, 0x758b, 0x758c, 0x758d, 0x758e, 0x758f,
+ 0x7590, 0x7591, 0x7592, 0x7593, 0x7594, 0x7595, 0x7596, 0x7597,
+ 0x7598, 0x7599, 0x759a, 0x759b, 0x759c, 0x759d, 0x759e, 0x759f,
+ 0x75a0, 0x75a1, 0x75a2, 0x75a3, 0x75a4, 0x75a5, 0x75a6, 0x75a7,
+ 0x75a8, 0x75a9, 0x75aa, 0x75ab, 0x75ac, 0x75ad, 0x75ae, 0x75af,
+ 0x75b0, 0x75b1, 0x75b2, 0x75b3, 0x75b4, 0x75b5, 0x75b6, 0x75b7,
+ 0x75b8, 0x75b9, 0x75ba, 0x75bb, 0x75bc, 0x75bd, 0x75be, 0x75bf,
+ 0x75c0, 0x75c1, 0x75c2, 0x75c3, 0x75c4, 0x75c5, 0x75c6, 0x75c7,
+ 0x75c8, 0x75c9, 0x75ca, 0x75cb, 0x75cc, 0x75cd, 0x75ce, 0x75cf,
+ 0x75d0, 0x75d1, 0x75d2, 0x75d3, 0x75d4, 0x75d5, 0x75d6, 0x75d7,
+ 0x75d8, 0x75d9, 0x75da, 0x75db, 0x75dc, 0x75dd, 0x75de, 0x75df,
+ 0x75e0, 0x75e1, 0x75e2, 0x75e3, 0x75e4, 0x75e5, 0x75e6, 0x75e7,
+ 0x75e8, 0x75e9, 0x75ea, 0x75eb, 0x75ec, 0x75ed, 0x75ee, 0x75ef,
+ 0x75f0, 0x75f1, 0x75f2, 0x75f3, 0x75f4, 0x75f5, 0x75f6, 0x75f7,
+ 0x75f8, 0x75f9, 0x75fa, 0x75fb, 0x75fc, 0x75fd, 0x75fe, 0x75ff,
+ 0x7600, 0x7601, 0x7602, 0x7603, 0x7604, 0x7605, 0x7606, 0x7607,
+ 0x7608, 0x7609, 0x760a, 0x760b, 0x760c, 0x760d, 0x760e, 0x760f,
+ 0x7610, 0x7611, 0x7612, 0x7613, 0x7614, 0x7615, 0x7616, 0x7617,
+ 0x7618, 0x7619, 0x761a, 0x761b, 0x761c, 0x761d, 0x761e, 0x761f,
+ 0x7620, 0x7621, 0x7622, 0x7623, 0x7624, 0x7625, 0x7626, 0x7627,
+ 0x7628, 0x7629, 0x762a, 0x762b, 0x762c, 0x762d, 0x762e, 0x762f,
+ 0x7630, 0x7631, 0x7632, 0x7633, 0x7634, 0x7635, 0x7636, 0x7637,
+ 0x7638, 0x7639, 0x763a, 0x763b, 0x763c, 0x763d, 0x763e, 0x763f,
+ 0x7640, 0x7641, 0x7642, 0x7643, 0x7644, 0x7645, 0x7646, 0x7647,
+ 0x7648, 0x7649, 0x764a, 0x764b, 0x764c, 0x764d, 0x764e, 0x764f,
+ 0x7650, 0x7651, 0x7652, 0x7653, 0x7654, 0x7655, 0x7656, 0x7657,
+ 0x7658, 0x7659, 0x765a, 0x765b, 0x765c, 0x765d, 0x765e, 0x765f,
+ 0x7660, 0x7661, 0x7662, 0x7663, 0x7664, 0x7665, 0x7666, 0x7667,
+ 0x7668, 0x7669, 0x766a, 0x766b, 0x766c, 0x766d, 0x766e, 0x766f,
+ 0x7670, 0x7671, 0x7672, 0x7673, 0x7674, 0x7675, 0x7676, 0x7677,
+ 0x7678, 0x7679, 0x767a, 0x767b, 0x767c, 0x767d, 0x767e, 0x767f,
+ 0x7680, 0x7681, 0x7682, 0x7683, 0x7684, 0x7685, 0x7686, 0x7687,
+ 0x7688, 0x7689, 0x768a, 0x768b, 0x768c, 0x768d, 0x768e, 0x768f,
+ 0x7690, 0x7691, 0x7692, 0x7693, 0x7694, 0x7695, 0x7696, 0x7697,
+ 0x7698, 0x7699, 0x769a, 0x769b, 0x769c, 0x769d, 0x769e, 0x769f,
+ 0x76a0, 0x76a1, 0x76a2, 0x76a3, 0x76a4, 0x76a5, 0x76a6, 0x76a7,
+ 0x76a8, 0x76a9, 0x76aa, 0x76ab, 0x76ac, 0x76ad, 0x76ae, 0x76af,
+ 0x76b0, 0x76b1, 0x76b2, 0x76b3, 0x76b4, 0x76b5, 0x76b6, 0x76b7,
+ 0x76b8, 0x76b9, 0x76ba, 0x76bb, 0x76bc, 0x76bd, 0x76be, 0x76bf,
+ 0x76c0, 0x76c1, 0x76c2, 0x76c3, 0x76c4, 0x76c5, 0x76c6, 0x76c7,
+ 0x76c8, 0x76c9, 0x76ca, 0x76cb, 0x76cc, 0x76cd, 0x76ce, 0x76cf,
+ 0x76d0, 0x76d1, 0x76d2, 0x76d3, 0x76d4, 0x76d5, 0x76d6, 0x76d7,
+ 0x76d8, 0x76d9, 0x76da, 0x76db, 0x76dc, 0x76dd, 0x76de, 0x76df,
+ 0x76e0, 0x76e1, 0x76e2, 0x76e3, 0x76e4, 0x76e5, 0x76e6, 0x76e7,
+ 0x76e8, 0x76e9, 0x76ea, 0x76eb, 0x76ec, 0x76ed, 0x76ee, 0x76ef,
+ 0x76f0, 0x76f1, 0x76f2, 0x76f3, 0x76f4, 0x76f5, 0x76f6, 0x76f7,
+ 0x76f8, 0x76f9, 0x76fa, 0x76fb, 0x76fc, 0x76fd, 0x76fe, 0x76ff,
+ 0x7700, 0x7701, 0x7702, 0x7703, 0x7704, 0x7705, 0x7706, 0x7707,
+ 0x7708, 0x7709, 0x770a, 0x770b, 0x770c, 0x770d, 0x770e, 0x770f,
+ 0x7710, 0x7711, 0x7712, 0x7713, 0x7714, 0x7715, 0x7716, 0x7717,
+ 0x7718, 0x7719, 0x771a, 0x771b, 0x771c, 0x771d, 0x771e, 0x771f,
+ 0x7720, 0x7721, 0x7722, 0x7723, 0x7724, 0x7725, 0x7726, 0x7727,
+ 0x7728, 0x7729, 0x772a, 0x772b, 0x772c, 0x772d, 0x772e, 0x772f,
+ 0x7730, 0x7731, 0x7732, 0x7733, 0x7734, 0x7735, 0x7736, 0x7737,
+ 0x7738, 0x7739, 0x773a, 0x773b, 0x773c, 0x773d, 0x773e, 0x773f,
+ 0x7740, 0x7741, 0x7742, 0x7743, 0x7744, 0x7745, 0x7746, 0x7747,
+ 0x7748, 0x7749, 0x774a, 0x774b, 0x774c, 0x774d, 0x774e, 0x774f,
+ 0x7750, 0x7751, 0x7752, 0x7753, 0x7754, 0x7755, 0x7756, 0x7757,
+ 0x7758, 0x7759, 0x775a, 0x775b, 0x775c, 0x775d, 0x775e, 0x775f,
+ 0x7760, 0x7761, 0x7762, 0x7763, 0x7764, 0x7765, 0x7766, 0x7767,
+ 0x7768, 0x7769, 0x776a, 0x776b, 0x776c, 0x776d, 0x776e, 0x776f,
+ 0x7770, 0x7771, 0x7772, 0x7773, 0x7774, 0x7775, 0x7776, 0x7777,
+ 0x7778, 0x7779, 0x777a, 0x777b, 0x777c, 0x777d, 0x777e, 0x777f,
+ 0x7780, 0x7781, 0x7782, 0x7783, 0x7784, 0x7785, 0x7786, 0x7787,
+ 0x7788, 0x7789, 0x778a, 0x778b, 0x778c, 0x778d, 0x778e, 0x778f,
+ 0x7790, 0x7791, 0x7792, 0x7793, 0x7794, 0x7795, 0x7796, 0x7797,
+ 0x7798, 0x7799, 0x779a, 0x779b, 0x779c, 0x779d, 0x779e, 0x779f,
+ 0x77a0, 0x77a1, 0x77a2, 0x77a3, 0x77a4, 0x77a5, 0x77a6, 0x77a7,
+ 0x77a8, 0x77a9, 0x77aa, 0x77ab, 0x77ac, 0x77ad, 0x77ae, 0x77af,
+ 0x77b0, 0x77b1, 0x77b2, 0x77b3, 0x77b4, 0x77b5, 0x77b6, 0x77b7,
+ 0x77b8, 0x77b9, 0x77ba, 0x77bb, 0x77bc, 0x77bd, 0x77be, 0x77bf,
+ 0x77c0, 0x77c1, 0x77c2, 0x77c3, 0x77c4, 0x77c5, 0x77c6, 0x77c7,
+ 0x77c8, 0x77c9, 0x77ca, 0x77cb, 0x77cc, 0x77cd, 0x77ce, 0x77cf,
+ 0x77d0, 0x77d1, 0x77d2, 0x77d3, 0x77d4, 0x77d5, 0x77d6, 0x77d7,
+ 0x77d8, 0x77d9, 0x77da, 0x77db, 0x77dc, 0x77dd, 0x77de, 0x77df,
+ 0x77e0, 0x77e1, 0x77e2, 0x77e3, 0x77e4, 0x77e5, 0x77e6, 0x77e7,
+ 0x77e8, 0x77e9, 0x77ea, 0x77eb, 0x77ec, 0x77ed, 0x77ee, 0x77ef,
+ 0x77f0, 0x77f1, 0x77f2, 0x77f3, 0x77f4, 0x77f5, 0x77f6, 0x77f7,
+ 0x77f8, 0x77f9, 0x77fa, 0x77fb, 0x77fc, 0x77fd, 0x77fe, 0x77ff,
+ 0x7800, 0x7801, 0x7802, 0x7803, 0x7804, 0x7805, 0x7806, 0x7807,
+ 0x7808, 0x7809, 0x780a, 0x780b, 0x780c, 0x780d, 0x780e, 0x780f,
+ 0x7810, 0x7811, 0x7812, 0x7813, 0x7814, 0x7815, 0x7816, 0x7817,
+ 0x7818, 0x7819, 0x781a, 0x781b, 0x781c, 0x781d, 0x781e, 0x781f,
+ 0x7820, 0x7821, 0x7822, 0x7823, 0x7824, 0x7825, 0x7826, 0x7827,
+ 0x7828, 0x7829, 0x782a, 0x782b, 0x782c, 0x782d, 0x782e, 0x782f,
+ 0x7830, 0x7831, 0x7832, 0x7833, 0x7834, 0x7835, 0x7836, 0x7837,
+ 0x7838, 0x7839, 0x783a, 0x783b, 0x783c, 0x783d, 0x783e, 0x783f,
+ 0x7840, 0x7841, 0x7842, 0x7843, 0x7844, 0x7845, 0x7846, 0x7847,
+ 0x7848, 0x7849, 0x784a, 0x784b, 0x784c, 0x784d, 0x784e, 0x784f,
+ 0x7850, 0x7851, 0x7852, 0x7853, 0x7854, 0x7855, 0x7856, 0x7857,
+ 0x7858, 0x7859, 0x785a, 0x785b, 0x785c, 0x785d, 0x785e, 0x785f,
+ 0x7860, 0x7861, 0x7862, 0x7863, 0x7864, 0x7865, 0x7866, 0x7867,
+ 0x7868, 0x7869, 0x786a, 0x786b, 0x786c, 0x786d, 0x786e, 0x786f,
+ 0x7870, 0x7871, 0x7872, 0x7873, 0x7874, 0x7875, 0x7876, 0x7877,
+ 0x7878, 0x7879, 0x787a, 0x787b, 0x787c, 0x787d, 0x787e, 0x787f,
+ 0x7880, 0x7881, 0x7882, 0x7883, 0x7884, 0x7885, 0x7886, 0x7887,
+ 0x7888, 0x7889, 0x788a, 0x788b, 0x788c, 0x788d, 0x788e, 0x788f,
+ 0x7890, 0x7891, 0x7892, 0x7893, 0x7894, 0x7895, 0x7896, 0x7897,
+ 0x7898, 0x7899, 0x789a, 0x789b, 0x789c, 0x789d, 0x789e, 0x789f,
+ 0x78a0, 0x78a1, 0x78a2, 0x78a3, 0x78a4, 0x78a5, 0x78a6, 0x78a7,
+ 0x78a8, 0x78a9, 0x78aa, 0x78ab, 0x78ac, 0x78ad, 0x78ae, 0x78af,
+ 0x78b0, 0x78b1, 0x78b2, 0x78b3, 0x78b4, 0x78b5, 0x78b6, 0x78b7,
+ 0x78b8, 0x78b9, 0x78ba, 0x78bb, 0x78bc, 0x78bd, 0x78be, 0x78bf,
+ 0x78c0, 0x78c1, 0x78c2, 0x78c3, 0x78c4, 0x78c5, 0x78c6, 0x78c7,
+ 0x78c8, 0x78c9, 0x78ca, 0x78cb, 0x78cc, 0x78cd, 0x78ce, 0x78cf,
+ 0x78d0, 0x78d1, 0x78d2, 0x78d3, 0x78d4, 0x78d5, 0x78d6, 0x78d7,
+ 0x78d8, 0x78d9, 0x78da, 0x78db, 0x78dc, 0x78dd, 0x78de, 0x78df,
+ 0x78e0, 0x78e1, 0x78e2, 0x78e3, 0x78e4, 0x78e5, 0x78e6, 0x78e7,
+ 0x78e8, 0x78e9, 0x78ea, 0x78eb, 0x78ec, 0x78ed, 0x78ee, 0x78ef,
+ 0x78f0, 0x78f1, 0x78f2, 0x78f3, 0x78f4, 0x78f5, 0x78f6, 0x78f7,
+ 0x78f8, 0x78f9, 0x78fa, 0x78fb, 0x78fc, 0x78fd, 0x78fe, 0x78ff,
+ 0x7900, 0x7901, 0x7902, 0x7903, 0x7904, 0x7905, 0x7906, 0x7907,
+ 0x7908, 0x7909, 0x790a, 0x790b, 0x790c, 0x790d, 0x790e, 0x790f,
+ 0x7910, 0x7911, 0x7912, 0x7913, 0x7914, 0x7915, 0x7916, 0x7917,
+ 0x7918, 0x7919, 0x791a, 0x791b, 0x791c, 0x791d, 0x791e, 0x791f,
+ 0x7920, 0x7921, 0x7922, 0x7923, 0x7924, 0x7925, 0x7926, 0x7927,
+ 0x7928, 0x7929, 0x792a, 0x792b, 0x792c, 0x792d, 0x792e, 0x792f,
+ 0x7930, 0x7931, 0x7932, 0x7933, 0x7934, 0x7935, 0x7936, 0x7937,
+ 0x7938, 0x7939, 0x793a, 0x793b, 0x793c, 0x793d, 0x793e, 0x793f,
+ 0x7940, 0x7941, 0x7942, 0x7943, 0x7944, 0x7945, 0x7946, 0x7947,
+ 0x7948, 0x7949, 0x794a, 0x794b, 0x794c, 0x794d, 0x794e, 0x794f,
+ 0x7950, 0x7951, 0x7952, 0x7953, 0x7954, 0x7955, 0x7956, 0x7957,
+ 0x7958, 0x7959, 0x795a, 0x795b, 0x795c, 0x795d, 0x795e, 0x795f,
+ 0x7960, 0x7961, 0x7962, 0x7963, 0x7964, 0x7965, 0x7966, 0x7967,
+ 0x7968, 0x7969, 0x796a, 0x796b, 0x796c, 0x796d, 0x796e, 0x796f,
+ 0x7970, 0x7971, 0x7972, 0x7973, 0x7974, 0x7975, 0x7976, 0x7977,
+ 0x7978, 0x7979, 0x797a, 0x797b, 0x797c, 0x797d, 0x797e, 0x797f,
+ 0x7980, 0x7981, 0x7982, 0x7983, 0x7984, 0x7985, 0x7986, 0x7987,
+ 0x7988, 0x7989, 0x798a, 0x798b, 0x798c, 0x798d, 0x798e, 0x798f,
+ 0x7990, 0x7991, 0x7992, 0x7993, 0x7994, 0x7995, 0x7996, 0x7997,
+ 0x7998, 0x7999, 0x799a, 0x799b, 0x799c, 0x799d, 0x799e, 0x799f,
+ 0x79a0, 0x79a1, 0x79a2, 0x79a3, 0x79a4, 0x79a5, 0x79a6, 0x79a7,
+ 0x79a8, 0x79a9, 0x79aa, 0x79ab, 0x79ac, 0x79ad, 0x79ae, 0x79af,
+ 0x79b0, 0x79b1, 0x79b2, 0x79b3, 0x79b4, 0x79b5, 0x79b6, 0x79b7,
+ 0x79b8, 0x79b9, 0x79ba, 0x79bb, 0x79bc, 0x79bd, 0x79be, 0x79bf,
+ 0x79c0, 0x79c1, 0x79c2, 0x79c3, 0x79c4, 0x79c5, 0x79c6, 0x79c7,
+ 0x79c8, 0x79c9, 0x79ca, 0x79cb, 0x79cc, 0x79cd, 0x79ce, 0x79cf,
+ 0x79d0, 0x79d1, 0x79d2, 0x79d3, 0x79d4, 0x79d5, 0x79d6, 0x79d7,
+ 0x79d8, 0x79d9, 0x79da, 0x79db, 0x79dc, 0x79dd, 0x79de, 0x79df,
+ 0x79e0, 0x79e1, 0x79e2, 0x79e3, 0x79e4, 0x79e5, 0x79e6, 0x79e7,
+ 0x79e8, 0x79e9, 0x79ea, 0x79eb, 0x79ec, 0x79ed, 0x79ee, 0x79ef,
+ 0x79f0, 0x79f1, 0x79f2, 0x79f3, 0x79f4, 0x79f5, 0x79f6, 0x79f7,
+ 0x79f8, 0x79f9, 0x79fa, 0x79fb, 0x79fc, 0x79fd, 0x79fe, 0x79ff,
+ 0x7a00, 0x7a01, 0x7a02, 0x7a03, 0x7a04, 0x7a05, 0x7a06, 0x7a07,
+ 0x7a08, 0x7a09, 0x7a0a, 0x7a0b, 0x7a0c, 0x7a0d, 0x7a0e, 0x7a0f,
+ 0x7a10, 0x7a11, 0x7a12, 0x7a13, 0x7a14, 0x7a15, 0x7a16, 0x7a17,
+ 0x7a18, 0x7a19, 0x7a1a, 0x7a1b, 0x7a1c, 0x7a1d, 0x7a1e, 0x7a1f,
+ 0x7a20, 0x7a21, 0x7a22, 0x7a23, 0x7a24, 0x7a25, 0x7a26, 0x7a27,
+ 0x7a28, 0x7a29, 0x7a2a, 0x7a2b, 0x7a2c, 0x7a2d, 0x7a2e, 0x7a2f,
+ 0x7a30, 0x7a31, 0x7a32, 0x7a33, 0x7a34, 0x7a35, 0x7a36, 0x7a37,
+ 0x7a38, 0x7a39, 0x7a3a, 0x7a3b, 0x7a3c, 0x7a3d, 0x7a3e, 0x7a3f,
+ 0x7a40, 0x7a41, 0x7a42, 0x7a43, 0x7a44, 0x7a45, 0x7a46, 0x7a47,
+ 0x7a48, 0x7a49, 0x7a4a, 0x7a4b, 0x7a4c, 0x7a4d, 0x7a4e, 0x7a4f,
+ 0x7a50, 0x7a51, 0x7a52, 0x7a53, 0x7a54, 0x7a55, 0x7a56, 0x7a57,
+ 0x7a58, 0x7a59, 0x7a5a, 0x7a5b, 0x7a5c, 0x7a5d, 0x7a5e, 0x7a5f,
+ 0x7a60, 0x7a61, 0x7a62, 0x7a63, 0x7a64, 0x7a65, 0x7a66, 0x7a67,
+ 0x7a68, 0x7a69, 0x7a6a, 0x7a6b, 0x7a6c, 0x7a6d, 0x7a6e, 0x7a6f,
+ 0x7a70, 0x7a71, 0x7a72, 0x7a73, 0x7a74, 0x7a75, 0x7a76, 0x7a77,
+ 0x7a78, 0x7a79, 0x7a7a, 0x7a7b, 0x7a7c, 0x7a7d, 0x7a7e, 0x7a7f,
+ 0x7a80, 0x7a81, 0x7a82, 0x7a83, 0x7a84, 0x7a85, 0x7a86, 0x7a87,
+ 0x7a88, 0x7a89, 0x7a8a, 0x7a8b, 0x7a8c, 0x7a8d, 0x7a8e, 0x7a8f,
+ 0x7a90, 0x7a91, 0x7a92, 0x7a93, 0x7a94, 0x7a95, 0x7a96, 0x7a97,
+ 0x7a98, 0x7a99, 0x7a9a, 0x7a9b, 0x7a9c, 0x7a9d, 0x7a9e, 0x7a9f,
+ 0x7aa0, 0x7aa1, 0x7aa2, 0x7aa3, 0x7aa4, 0x7aa5, 0x7aa6, 0x7aa7,
+ 0x7aa8, 0x7aa9, 0x7aaa, 0x7aab, 0x7aac, 0x7aad, 0x7aae, 0x7aaf,
+ 0x7ab0, 0x7ab1, 0x7ab2, 0x7ab3, 0x7ab4, 0x7ab5, 0x7ab6, 0x7ab7,
+ 0x7ab8, 0x7ab9, 0x7aba, 0x7abb, 0x7abc, 0x7abd, 0x7abe, 0x7abf,
+ 0x7ac0, 0x7ac1, 0x7ac2, 0x7ac3, 0x7ac4, 0x7ac5, 0x7ac6, 0x7ac7,
+ 0x7ac8, 0x7ac9, 0x7aca, 0x7acb, 0x7acc, 0x7acd, 0x7ace, 0x7acf,
+ 0x7ad0, 0x7ad1, 0x7ad2, 0x7ad3, 0x7ad4, 0x7ad5, 0x7ad6, 0x7ad7,
+ 0x7ad8, 0x7ad9, 0x7ada, 0x7adb, 0x7adc, 0x7add, 0x7ade, 0x7adf,
+ 0x7ae0, 0x7ae1, 0x7ae2, 0x7ae3, 0x7ae4, 0x7ae5, 0x7ae6, 0x7ae7,
+ 0x7ae8, 0x7ae9, 0x7aea, 0x7aeb, 0x7aec, 0x7aed, 0x7aee, 0x7aef,
+ 0x7af0, 0x7af1, 0x7af2, 0x7af3, 0x7af4, 0x7af5, 0x7af6, 0x7af7,
+ 0x7af8, 0x7af9, 0x7afa, 0x7afb, 0x7afc, 0x7afd, 0x7afe, 0x7aff,
+ 0x7b00, 0x7b01, 0x7b02, 0x7b03, 0x7b04, 0x7b05, 0x7b06, 0x7b07,
+ 0x7b08, 0x7b09, 0x7b0a, 0x7b0b, 0x7b0c, 0x7b0d, 0x7b0e, 0x7b0f,
+ 0x7b10, 0x7b11, 0x7b12, 0x7b13, 0x7b14, 0x7b15, 0x7b16, 0x7b17,
+ 0x7b18, 0x7b19, 0x7b1a, 0x7b1b, 0x7b1c, 0x7b1d, 0x7b1e, 0x7b1f,
+ 0x7b20, 0x7b21, 0x7b22, 0x7b23, 0x7b24, 0x7b25, 0x7b26, 0x7b27,
+ 0x7b28, 0x7b29, 0x7b2a, 0x7b2b, 0x7b2c, 0x7b2d, 0x7b2e, 0x7b2f,
+ 0x7b30, 0x7b31, 0x7b32, 0x7b33, 0x7b34, 0x7b35, 0x7b36, 0x7b37,
+ 0x7b38, 0x7b39, 0x7b3a, 0x7b3b, 0x7b3c, 0x7b3d, 0x7b3e, 0x7b3f,
+ 0x7b40, 0x7b41, 0x7b42, 0x7b43, 0x7b44, 0x7b45, 0x7b46, 0x7b47,
+ 0x7b48, 0x7b49, 0x7b4a, 0x7b4b, 0x7b4c, 0x7b4d, 0x7b4e, 0x7b4f,
+ 0x7b50, 0x7b51, 0x7b52, 0x7b53, 0x7b54, 0x7b55, 0x7b56, 0x7b57,
+ 0x7b58, 0x7b59, 0x7b5a, 0x7b5b, 0x7b5c, 0x7b5d, 0x7b5e, 0x7b5f,
+ 0x7b60, 0x7b61, 0x7b62, 0x7b63, 0x7b64, 0x7b65, 0x7b66, 0x7b67,
+ 0x7b68, 0x7b69, 0x7b6a, 0x7b6b, 0x7b6c, 0x7b6d, 0x7b6e, 0x7b6f,
+ 0x7b70, 0x7b71, 0x7b72, 0x7b73, 0x7b74, 0x7b75, 0x7b76, 0x7b77,
+ 0x7b78, 0x7b79, 0x7b7a, 0x7b7b, 0x7b7c, 0x7b7d, 0x7b7e, 0x7b7f,
+ 0x7b80, 0x7b81, 0x7b82, 0x7b83, 0x7b84, 0x7b85, 0x7b86, 0x7b87,
+ 0x7b88, 0x7b89, 0x7b8a, 0x7b8b, 0x7b8c, 0x7b8d, 0x7b8e, 0x7b8f,
+ 0x7b90, 0x7b91, 0x7b92, 0x7b93, 0x7b94, 0x7b95, 0x7b96, 0x7b97,
+ 0x7b98, 0x7b99, 0x7b9a, 0x7b9b, 0x7b9c, 0x7b9d, 0x7b9e, 0x7b9f,
+ 0x7ba0, 0x7ba1, 0x7ba2, 0x7ba3, 0x7ba4, 0x7ba5, 0x7ba6, 0x7ba7,
+ 0x7ba8, 0x7ba9, 0x7baa, 0x7bab, 0x7bac, 0x7bad, 0x7bae, 0x7baf,
+ 0x7bb0, 0x7bb1, 0x7bb2, 0x7bb3, 0x7bb4, 0x7bb5, 0x7bb6, 0x7bb7,
+ 0x7bb8, 0x7bb9, 0x7bba, 0x7bbb, 0x7bbc, 0x7bbd, 0x7bbe, 0x7bbf,
+ 0x7bc0, 0x7bc1, 0x7bc2, 0x7bc3, 0x7bc4, 0x7bc5, 0x7bc6, 0x7bc7,
+ 0x7bc8, 0x7bc9, 0x7bca, 0x7bcb, 0x7bcc, 0x7bcd, 0x7bce, 0x7bcf,
+ 0x7bd0, 0x7bd1, 0x7bd2, 0x7bd3, 0x7bd4, 0x7bd5, 0x7bd6, 0x7bd7,
+ 0x7bd8, 0x7bd9, 0x7bda, 0x7bdb, 0x7bdc, 0x7bdd, 0x7bde, 0x7bdf,
+ 0x7be0, 0x7be1, 0x7be2, 0x7be3, 0x7be4, 0x7be5, 0x7be6, 0x7be7,
+ 0x7be8, 0x7be9, 0x7bea, 0x7beb, 0x7bec, 0x7bed, 0x7bee, 0x7bef,
+ 0x7bf0, 0x7bf1, 0x7bf2, 0x7bf3, 0x7bf4, 0x7bf5, 0x7bf6, 0x7bf7,
+ 0x7bf8, 0x7bf9, 0x7bfa, 0x7bfb, 0x7bfc, 0x7bfd, 0x7bfe, 0x7bff,
+ 0x7c00, 0x7c01, 0x7c02, 0x7c03, 0x7c04, 0x7c05, 0x7c06, 0x7c07,
+ 0x7c08, 0x7c09, 0x7c0a, 0x7c0b, 0x7c0c, 0x7c0d, 0x7c0e, 0x7c0f,
+ 0x7c10, 0x7c11, 0x7c12, 0x7c13, 0x7c14, 0x7c15, 0x7c16, 0x7c17,
+ 0x7c18, 0x7c19, 0x7c1a, 0x7c1b, 0x7c1c, 0x7c1d, 0x7c1e, 0x7c1f,
+ 0x7c20, 0x7c21, 0x7c22, 0x7c23, 0x7c24, 0x7c25, 0x7c26, 0x7c27,
+ 0x7c28, 0x7c29, 0x7c2a, 0x7c2b, 0x7c2c, 0x7c2d, 0x7c2e, 0x7c2f,
+ 0x7c30, 0x7c31, 0x7c32, 0x7c33, 0x7c34, 0x7c35, 0x7c36, 0x7c37,
+ 0x7c38, 0x7c39, 0x7c3a, 0x7c3b, 0x7c3c, 0x7c3d, 0x7c3e, 0x7c3f,
+ 0x7c40, 0x7c41, 0x7c42, 0x7c43, 0x7c44, 0x7c45, 0x7c46, 0x7c47,
+ 0x7c48, 0x7c49, 0x7c4a, 0x7c4b, 0x7c4c, 0x7c4d, 0x7c4e, 0x7c4f,
+ 0x7c50, 0x7c51, 0x7c52, 0x7c53, 0x7c54, 0x7c55, 0x7c56, 0x7c57,
+ 0x7c58, 0x7c59, 0x7c5a, 0x7c5b, 0x7c5c, 0x7c5d, 0x7c5e, 0x7c5f,
+ 0x7c60, 0x7c61, 0x7c62, 0x7c63, 0x7c64, 0x7c65, 0x7c66, 0x7c67,
+ 0x7c68, 0x7c69, 0x7c6a, 0x7c6b, 0x7c6c, 0x7c6d, 0x7c6e, 0x7c6f,
+ 0x7c70, 0x7c71, 0x7c72, 0x7c73, 0x7c74, 0x7c75, 0x7c76, 0x7c77,
+ 0x7c78, 0x7c79, 0x7c7a, 0x7c7b, 0x7c7c, 0x7c7d, 0x7c7e, 0x7c7f,
+ 0x7c80, 0x7c81, 0x7c82, 0x7c83, 0x7c84, 0x7c85, 0x7c86, 0x7c87,
+ 0x7c88, 0x7c89, 0x7c8a, 0x7c8b, 0x7c8c, 0x7c8d, 0x7c8e, 0x7c8f,
+ 0x7c90, 0x7c91, 0x7c92, 0x7c93, 0x7c94, 0x7c95, 0x7c96, 0x7c97,
+ 0x7c98, 0x7c99, 0x7c9a, 0x7c9b, 0x7c9c, 0x7c9d, 0x7c9e, 0x7c9f,
+ 0x7ca0, 0x7ca1, 0x7ca2, 0x7ca3, 0x7ca4, 0x7ca5, 0x7ca6, 0x7ca7,
+ 0x7ca8, 0x7ca9, 0x7caa, 0x7cab, 0x7cac, 0x7cad, 0x7cae, 0x7caf,
+ 0x7cb0, 0x7cb1, 0x7cb2, 0x7cb3, 0x7cb4, 0x7cb5, 0x7cb6, 0x7cb7,
+ 0x7cb8, 0x7cb9, 0x7cba, 0x7cbb, 0x7cbc, 0x7cbd, 0x7cbe, 0x7cbf,
+ 0x7cc0, 0x7cc1, 0x7cc2, 0x7cc3, 0x7cc4, 0x7cc5, 0x7cc6, 0x7cc7,
+ 0x7cc8, 0x7cc9, 0x7cca, 0x7ccb, 0x7ccc, 0x7ccd, 0x7cce, 0x7ccf,
+ 0x7cd0, 0x7cd1, 0x7cd2, 0x7cd3, 0x7cd4, 0x7cd5, 0x7cd6, 0x7cd7,
+ 0x7cd8, 0x7cd9, 0x7cda, 0x7cdb, 0x7cdc, 0x7cdd, 0x7cde, 0x7cdf,
+ 0x7ce0, 0x7ce1, 0x7ce2, 0x7ce3, 0x7ce4, 0x7ce5, 0x7ce6, 0x7ce7,
+ 0x7ce8, 0x7ce9, 0x7cea, 0x7ceb, 0x7cec, 0x7ced, 0x7cee, 0x7cef,
+ 0x7cf0, 0x7cf1, 0x7cf2, 0x7cf3, 0x7cf4, 0x7cf5, 0x7cf6, 0x7cf7,
+ 0x7cf8, 0x7cf9, 0x7cfa, 0x7cfb, 0x7cfc, 0x7cfd, 0x7cfe, 0x7cff,
+ 0x7d00, 0x7d01, 0x7d02, 0x7d03, 0x7d04, 0x7d05, 0x7d06, 0x7d07,
+ 0x7d08, 0x7d09, 0x7d0a, 0x7d0b, 0x7d0c, 0x7d0d, 0x7d0e, 0x7d0f,
+ 0x7d10, 0x7d11, 0x7d12, 0x7d13, 0x7d14, 0x7d15, 0x7d16, 0x7d17,
+ 0x7d18, 0x7d19, 0x7d1a, 0x7d1b, 0x7d1c, 0x7d1d, 0x7d1e, 0x7d1f,
+ 0x7d20, 0x7d21, 0x7d22, 0x7d23, 0x7d24, 0x7d25, 0x7d26, 0x7d27,
+ 0x7d28, 0x7d29, 0x7d2a, 0x7d2b, 0x7d2c, 0x7d2d, 0x7d2e, 0x7d2f,
+ 0x7d30, 0x7d31, 0x7d32, 0x7d33, 0x7d34, 0x7d35, 0x7d36, 0x7d37,
+ 0x7d38, 0x7d39, 0x7d3a, 0x7d3b, 0x7d3c, 0x7d3d, 0x7d3e, 0x7d3f,
+ 0x7d40, 0x7d41, 0x7d42, 0x7d43, 0x7d44, 0x7d45, 0x7d46, 0x7d47,
+ 0x7d48, 0x7d49, 0x7d4a, 0x7d4b, 0x7d4c, 0x7d4d, 0x7d4e, 0x7d4f,
+ 0x7d50, 0x7d51, 0x7d52, 0x7d53, 0x7d54, 0x7d55, 0x7d56, 0x7d57,
+ 0x7d58, 0x7d59, 0x7d5a, 0x7d5b, 0x7d5c, 0x7d5d, 0x7d5e, 0x7d5f,
+ 0x7d60, 0x7d61, 0x7d62, 0x7d63, 0x7d64, 0x7d65, 0x7d66, 0x7d67,
+ 0x7d68, 0x7d69, 0x7d6a, 0x7d6b, 0x7d6c, 0x7d6d, 0x7d6e, 0x7d6f,
+ 0x7d70, 0x7d71, 0x7d72, 0x7d73, 0x7d74, 0x7d75, 0x7d76, 0x7d77,
+ 0x7d78, 0x7d79, 0x7d7a, 0x7d7b, 0x7d7c, 0x7d7d, 0x7d7e, 0x7d7f,
+ 0x7d80, 0x7d81, 0x7d82, 0x7d83, 0x7d84, 0x7d85, 0x7d86, 0x7d87,
+ 0x7d88, 0x7d89, 0x7d8a, 0x7d8b, 0x7d8c, 0x7d8d, 0x7d8e, 0x7d8f,
+ 0x7d90, 0x7d91, 0x7d92, 0x7d93, 0x7d94, 0x7d95, 0x7d96, 0x7d97,
+ 0x7d98, 0x7d99, 0x7d9a, 0x7d9b, 0x7d9c, 0x7d9d, 0x7d9e, 0x7d9f,
+ 0x7da0, 0x7da1, 0x7da2, 0x7da3, 0x7da4, 0x7da5, 0x7da6, 0x7da7,
+ 0x7da8, 0x7da9, 0x7daa, 0x7dab, 0x7dac, 0x7dad, 0x7dae, 0x7daf,
+ 0x7db0, 0x7db1, 0x7db2, 0x7db3, 0x7db4, 0x7db5, 0x7db6, 0x7db7,
+ 0x7db8, 0x7db9, 0x7dba, 0x7dbb, 0x7dbc, 0x7dbd, 0x7dbe, 0x7dbf,
+ 0x7dc0, 0x7dc1, 0x7dc2, 0x7dc3, 0x7dc4, 0x7dc5, 0x7dc6, 0x7dc7,
+ 0x7dc8, 0x7dc9, 0x7dca, 0x7dcb, 0x7dcc, 0x7dcd, 0x7dce, 0x7dcf,
+ 0x7dd0, 0x7dd1, 0x7dd2, 0x7dd3, 0x7dd4, 0x7dd5, 0x7dd6, 0x7dd7,
+ 0x7dd8, 0x7dd9, 0x7dda, 0x7ddb, 0x7ddc, 0x7ddd, 0x7dde, 0x7ddf,
+ 0x7de0, 0x7de1, 0x7de2, 0x7de3, 0x7de4, 0x7de5, 0x7de6, 0x7de7,
+ 0x7de8, 0x7de9, 0x7dea, 0x7deb, 0x7dec, 0x7ded, 0x7dee, 0x7def,
+ 0x7df0, 0x7df1, 0x7df2, 0x7df3, 0x7df4, 0x7df5, 0x7df6, 0x7df7,
+ 0x7df8, 0x7df9, 0x7dfa, 0x7dfb, 0x7dfc, 0x7dfd, 0x7dfe, 0x7dff,
+ 0x7e00, 0x7e01, 0x7e02, 0x7e03, 0x7e04, 0x7e05, 0x7e06, 0x7e07,
+ 0x7e08, 0x7e09, 0x7e0a, 0x7e0b, 0x7e0c, 0x7e0d, 0x7e0e, 0x7e0f,
+ 0x7e10, 0x7e11, 0x7e12, 0x7e13, 0x7e14, 0x7e15, 0x7e16, 0x7e17,
+ 0x7e18, 0x7e19, 0x7e1a, 0x7e1b, 0x7e1c, 0x7e1d, 0x7e1e, 0x7e1f,
+ 0x7e20, 0x7e21, 0x7e22, 0x7e23, 0x7e24, 0x7e25, 0x7e26, 0x7e27,
+ 0x7e28, 0x7e29, 0x7e2a, 0x7e2b, 0x7e2c, 0x7e2d, 0x7e2e, 0x7e2f,
+ 0x7e30, 0x7e31, 0x7e32, 0x7e33, 0x7e34, 0x7e35, 0x7e36, 0x7e37,
+ 0x7e38, 0x7e39, 0x7e3a, 0x7e3b, 0x7e3c, 0x7e3d, 0x7e3e, 0x7e3f,
+ 0x7e40, 0x7e41, 0x7e42, 0x7e43, 0x7e44, 0x7e45, 0x7e46, 0x7e47,
+ 0x7e48, 0x7e49, 0x7e4a, 0x7e4b, 0x7e4c, 0x7e4d, 0x7e4e, 0x7e4f,
+ 0x7e50, 0x7e51, 0x7e52, 0x7e53, 0x7e54, 0x7e55, 0x7e56, 0x7e57,
+ 0x7e58, 0x7e59, 0x7e5a, 0x7e5b, 0x7e5c, 0x7e5d, 0x7e5e, 0x7e5f,
+ 0x7e60, 0x7e61, 0x7e62, 0x7e63, 0x7e64, 0x7e65, 0x7e66, 0x7e67,
+ 0x7e68, 0x7e69, 0x7e6a, 0x7e6b, 0x7e6c, 0x7e6d, 0x7e6e, 0x7e6f,
+ 0x7e70, 0x7e71, 0x7e72, 0x7e73, 0x7e74, 0x7e75, 0x7e76, 0x7e77,
+ 0x7e78, 0x7e79, 0x7e7a, 0x7e7b, 0x7e7c, 0x7e7d, 0x7e7e, 0x7e7f,
+ 0x7e80, 0x7e81, 0x7e82, 0x7e83, 0x7e84, 0x7e85, 0x7e86, 0x7e87,
+ 0x7e88, 0x7e89, 0x7e8a, 0x7e8b, 0x7e8c, 0x7e8d, 0x7e8e, 0x7e8f,
+ 0x7e90, 0x7e91, 0x7e92, 0x7e93, 0x7e94, 0x7e95, 0x7e96, 0x7e97,
+ 0x7e98, 0x7e99, 0x7e9a, 0x7e9b, 0x7e9c, 0x7e9d, 0x7e9e, 0x7e9f,
+ 0x7ea0, 0x7ea1, 0x7ea2, 0x7ea3, 0x7ea4, 0x7ea5, 0x7ea6, 0x7ea7,
+ 0x7ea8, 0x7ea9, 0x7eaa, 0x7eab, 0x7eac, 0x7ead, 0x7eae, 0x7eaf,
+ 0x7eb0, 0x7eb1, 0x7eb2, 0x7eb3, 0x7eb4, 0x7eb5, 0x7eb6, 0x7eb7,
+ 0x7eb8, 0x7eb9, 0x7eba, 0x7ebb, 0x7ebc, 0x7ebd, 0x7ebe, 0x7ebf,
+ 0x7ec0, 0x7ec1, 0x7ec2, 0x7ec3, 0x7ec4, 0x7ec5, 0x7ec6, 0x7ec7,
+ 0x7ec8, 0x7ec9, 0x7eca, 0x7ecb, 0x7ecc, 0x7ecd, 0x7ece, 0x7ecf,
+ 0x7ed0, 0x7ed1, 0x7ed2, 0x7ed3, 0x7ed4, 0x7ed5, 0x7ed6, 0x7ed7,
+ 0x7ed8, 0x7ed9, 0x7eda, 0x7edb, 0x7edc, 0x7edd, 0x7ede, 0x7edf,
+ 0x7ee0, 0x7ee1, 0x7ee2, 0x7ee3, 0x7ee4, 0x7ee5, 0x7ee6, 0x7ee7,
+ 0x7ee8, 0x7ee9, 0x7eea, 0x7eeb, 0x7eec, 0x7eed, 0x7eee, 0x7eef,
+ 0x7ef0, 0x7ef1, 0x7ef2, 0x7ef3, 0x7ef4, 0x7ef5, 0x7ef6, 0x7ef7,
+ 0x7ef8, 0x7ef9, 0x7efa, 0x7efb, 0x7efc, 0x7efd, 0x7efe, 0x7eff,
+ 0x7f00, 0x7f01, 0x7f02, 0x7f03, 0x7f04, 0x7f05, 0x7f06, 0x7f07,
+ 0x7f08, 0x7f09, 0x7f0a, 0x7f0b, 0x7f0c, 0x7f0d, 0x7f0e, 0x7f0f,
+ 0x7f10, 0x7f11, 0x7f12, 0x7f13, 0x7f14, 0x7f15, 0x7f16, 0x7f17,
+ 0x7f18, 0x7f19, 0x7f1a, 0x7f1b, 0x7f1c, 0x7f1d, 0x7f1e, 0x7f1f,
+ 0x7f20, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27,
+ 0x7f28, 0x7f29, 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2e, 0x7f2f,
+ 0x7f30, 0x7f31, 0x7f32, 0x7f33, 0x7f34, 0x7f35, 0x7f36, 0x7f37,
+ 0x7f38, 0x7f39, 0x7f3a, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, 0x7f3f,
+ 0x7f40, 0x7f41, 0x7f42, 0x7f43, 0x7f44, 0x7f45, 0x7f46, 0x7f47,
+ 0x7f48, 0x7f49, 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f,
+ 0x7f50, 0x7f51, 0x7f52, 0x7f53, 0x7f54, 0x7f55, 0x7f56, 0x7f57,
+ 0x7f58, 0x7f59, 0x7f5a, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f5f,
+ 0x7f60, 0x7f61, 0x7f62, 0x7f63, 0x7f64, 0x7f65, 0x7f66, 0x7f67,
+ 0x7f68, 0x7f69, 0x7f6a, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6e, 0x7f6f,
+ 0x7f70, 0x7f71, 0x7f72, 0x7f73, 0x7f74, 0x7f75, 0x7f76, 0x7f77,
+ 0x7f78, 0x7f79, 0x7f7a, 0x7f7b, 0x7f7c, 0x7f7d, 0x7f7e, 0x7f7f,
+ 0x7f80, 0x7f81, 0x7f82, 0x7f83, 0x7f84, 0x7f85, 0x7f86, 0x7f87,
+ 0x7f88, 0x7f89, 0x7f8a, 0x7f8b, 0x7f8c, 0x7f8d, 0x7f8e, 0x7f8f,
+ 0x7f90, 0x7f91, 0x7f92, 0x7f93, 0x7f94, 0x7f95, 0x7f96, 0x7f97,
+ 0x7f98, 0x7f99, 0x7f9a, 0x7f9b, 0x7f9c, 0x7f9d, 0x7f9e, 0x7f9f,
+ 0x7fa0, 0x7fa1, 0x7fa2, 0x7fa3, 0x7fa4, 0x7fa5, 0x7fa6, 0x7fa7,
+ 0x7fa8, 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7faf,
+ 0x7fb0, 0x7fb1, 0x7fb2, 0x7fb3, 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7,
+ 0x7fb8, 0x7fb9, 0x7fba, 0x7fbb, 0x7fbc, 0x7fbd, 0x7fbe, 0x7fbf,
+ 0x7fc0, 0x7fc1, 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc5, 0x7fc6, 0x7fc7,
+ 0x7fc8, 0x7fc9, 0x7fca, 0x7fcb, 0x7fcc, 0x7fcd, 0x7fce, 0x7fcf,
+ 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd4, 0x7fd5, 0x7fd6, 0x7fd7,
+ 0x7fd8, 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fdf,
+ 0x7fe0, 0x7fe1, 0x7fe2, 0x7fe3, 0x7fe4, 0x7fe5, 0x7fe6, 0x7fe7,
+ 0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef,
+ 0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7,
+ 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
+ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+ 0x8008, 0x8009, 0x800a, 0x800b, 0x800c, 0x800d, 0x800e, 0x800f,
+ 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017,
+ 0x8018, 0x8019, 0x801a, 0x801b, 0x801c, 0x801d, 0x801e, 0x801f,
+ 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027,
+ 0x8028, 0x8029, 0x802a, 0x802b, 0x802c, 0x802d, 0x802e, 0x802f,
+ 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037,
+ 0x8038, 0x8039, 0x803a, 0x803b, 0x803c, 0x803d, 0x803e, 0x803f,
+ 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047,
+ 0x8048, 0x8049, 0x804a, 0x804b, 0x804c, 0x804d, 0x804e, 0x804f,
+ 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, 0x8057,
+ 0x8058, 0x8059, 0x805a, 0x805b, 0x805c, 0x805d, 0x805e, 0x805f,
+ 0x8060, 0x8061, 0x8062, 0x8063, 0x8064, 0x8065, 0x8066, 0x8067,
+ 0x8068, 0x8069, 0x806a, 0x806b, 0x806c, 0x806d, 0x806e, 0x806f,
+ 0x8070, 0x8071, 0x8072, 0x8073, 0x8074, 0x8075, 0x8076, 0x8077,
+ 0x8078, 0x8079, 0x807a, 0x807b, 0x807c, 0x807d, 0x807e, 0x807f,
+ 0x8080, 0x8081, 0x8082, 0x8083, 0x8084, 0x8085, 0x8086, 0x8087,
+ 0x8088, 0x8089, 0x808a, 0x808b, 0x808c, 0x808d, 0x808e, 0x808f,
+ 0x8090, 0x8091, 0x8092, 0x8093, 0x8094, 0x8095, 0x8096, 0x8097,
+ 0x8098, 0x8099, 0x809a, 0x809b, 0x809c, 0x809d, 0x809e, 0x809f,
+ 0x80a0, 0x80a1, 0x80a2, 0x80a3, 0x80a4, 0x80a5, 0x80a6, 0x80a7,
+ 0x80a8, 0x80a9, 0x80aa, 0x80ab, 0x80ac, 0x80ad, 0x80ae, 0x80af,
+ 0x80b0, 0x80b1, 0x80b2, 0x80b3, 0x80b4, 0x80b5, 0x80b6, 0x80b7,
+ 0x80b8, 0x80b9, 0x80ba, 0x80bb, 0x80bc, 0x80bd, 0x80be, 0x80bf,
+ 0x80c0, 0x80c1, 0x80c2, 0x80c3, 0x80c4, 0x80c5, 0x80c6, 0x80c7,
+ 0x80c8, 0x80c9, 0x80ca, 0x80cb, 0x80cc, 0x80cd, 0x80ce, 0x80cf,
+ 0x80d0, 0x80d1, 0x80d2, 0x80d3, 0x80d4, 0x80d5, 0x80d6, 0x80d7,
+ 0x80d8, 0x80d9, 0x80da, 0x80db, 0x80dc, 0x80dd, 0x80de, 0x80df,
+ 0x80e0, 0x80e1, 0x80e2, 0x80e3, 0x80e4, 0x80e5, 0x80e6, 0x80e7,
+ 0x80e8, 0x80e9, 0x80ea, 0x80eb, 0x80ec, 0x80ed, 0x80ee, 0x80ef,
+ 0x80f0, 0x80f1, 0x80f2, 0x80f3, 0x80f4, 0x80f5, 0x80f6, 0x80f7,
+ 0x80f8, 0x80f9, 0x80fa, 0x80fb, 0x80fc, 0x80fd, 0x80fe, 0x80ff,
+ 0x8100, 0x8101, 0x8102, 0x8103, 0x8104, 0x8105, 0x8106, 0x8107,
+ 0x8108, 0x8109, 0x810a, 0x810b, 0x810c, 0x810d, 0x810e, 0x810f,
+ 0x8110, 0x8111, 0x8112, 0x8113, 0x8114, 0x8115, 0x8116, 0x8117,
+ 0x8118, 0x8119, 0x811a, 0x811b, 0x811c, 0x811d, 0x811e, 0x811f,
+ 0x8120, 0x8121, 0x8122, 0x8123, 0x8124, 0x8125, 0x8126, 0x8127,
+ 0x8128, 0x8129, 0x812a, 0x812b, 0x812c, 0x812d, 0x812e, 0x812f,
+ 0x8130, 0x8131, 0x8132, 0x8133, 0x8134, 0x8135, 0x8136, 0x8137,
+ 0x8138, 0x8139, 0x813a, 0x813b, 0x813c, 0x813d, 0x813e, 0x813f,
+ 0x8140, 0x8141, 0x8142, 0x8143, 0x8144, 0x8145, 0x8146, 0x8147,
+ 0x8148, 0x8149, 0x814a, 0x814b, 0x814c, 0x814d, 0x814e, 0x814f,
+ 0x8150, 0x8151, 0x8152, 0x8153, 0x8154, 0x8155, 0x8156, 0x8157,
+ 0x8158, 0x8159, 0x815a, 0x815b, 0x815c, 0x815d, 0x815e, 0x815f,
+ 0x8160, 0x8161, 0x8162, 0x8163, 0x8164, 0x8165, 0x8166, 0x8167,
+ 0x8168, 0x8169, 0x816a, 0x816b, 0x816c, 0x816d, 0x816e, 0x816f,
+ 0x8170, 0x8171, 0x8172, 0x8173, 0x8174, 0x8175, 0x8176, 0x8177,
+ 0x8178, 0x8179, 0x817a, 0x817b, 0x817c, 0x817d, 0x817e, 0x817f,
+ 0x8180, 0x8181, 0x8182, 0x8183, 0x8184, 0x8185, 0x8186, 0x8187,
+ 0x8188, 0x8189, 0x818a, 0x818b, 0x818c, 0x818d, 0x818e, 0x818f,
+ 0x8190, 0x8191, 0x8192, 0x8193, 0x8194, 0x8195, 0x8196, 0x8197,
+ 0x8198, 0x8199, 0x819a, 0x819b, 0x819c, 0x819d, 0x819e, 0x819f,
+ 0x81a0, 0x81a1, 0x81a2, 0x81a3, 0x81a4, 0x81a5, 0x81a6, 0x81a7,
+ 0x81a8, 0x81a9, 0x81aa, 0x81ab, 0x81ac, 0x81ad, 0x81ae, 0x81af,
+ 0x81b0, 0x81b1, 0x81b2, 0x81b3, 0x81b4, 0x81b5, 0x81b6, 0x81b7,
+ 0x81b8, 0x81b9, 0x81ba, 0x81bb, 0x81bc, 0x81bd, 0x81be, 0x81bf,
+ 0x81c0, 0x81c1, 0x81c2, 0x81c3, 0x81c4, 0x81c5, 0x81c6, 0x81c7,
+ 0x81c8, 0x81c9, 0x81ca, 0x81cb, 0x81cc, 0x81cd, 0x81ce, 0x81cf,
+ 0x81d0, 0x81d1, 0x81d2, 0x81d3, 0x81d4, 0x81d5, 0x81d6, 0x81d7,
+ 0x81d8, 0x81d9, 0x81da, 0x81db, 0x81dc, 0x81dd, 0x81de, 0x81df,
+ 0x81e0, 0x81e1, 0x81e2, 0x81e3, 0x81e4, 0x81e5, 0x81e6, 0x81e7,
+ 0x81e8, 0x81e9, 0x81ea, 0x81eb, 0x81ec, 0x81ed, 0x81ee, 0x81ef,
+ 0x81f0, 0x81f1, 0x81f2, 0x81f3, 0x81f4, 0x81f5, 0x81f6, 0x81f7,
+ 0x81f8, 0x81f9, 0x81fa, 0x81fb, 0x81fc, 0x81fd, 0x81fe, 0x81ff,
+ 0x8200, 0x8201, 0x8202, 0x8203, 0x8204, 0x8205, 0x8206, 0x8207,
+ 0x8208, 0x8209, 0x820a, 0x820b, 0x820c, 0x820d, 0x820e, 0x820f,
+ 0x8210, 0x8211, 0x8212, 0x8213, 0x8214, 0x8215, 0x8216, 0x8217,
+ 0x8218, 0x8219, 0x821a, 0x821b, 0x821c, 0x821d, 0x821e, 0x821f,
+ 0x8220, 0x8221, 0x8222, 0x8223, 0x8224, 0x8225, 0x8226, 0x8227,
+ 0x8228, 0x8229, 0x822a, 0x822b, 0x822c, 0x822d, 0x822e, 0x822f,
+ 0x8230, 0x8231, 0x8232, 0x8233, 0x8234, 0x8235, 0x8236, 0x8237,
+ 0x8238, 0x8239, 0x823a, 0x823b, 0x823c, 0x823d, 0x823e, 0x823f,
+ 0x8240, 0x8241, 0x8242, 0x8243, 0x8244, 0x8245, 0x8246, 0x8247,
+ 0x8248, 0x8249, 0x824a, 0x824b, 0x824c, 0x824d, 0x824e, 0x824f,
+ 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, 0x8256, 0x8257,
+ 0x8258, 0x8259, 0x825a, 0x825b, 0x825c, 0x825d, 0x825e, 0x825f,
+ 0x8260, 0x8261, 0x8262, 0x8263, 0x8264, 0x8265, 0x8266, 0x8267,
+ 0x8268, 0x8269, 0x826a, 0x826b, 0x826c, 0x826d, 0x826e, 0x826f,
+ 0x8270, 0x8271, 0x8272, 0x8273, 0x8274, 0x8275, 0x8276, 0x8277,
+ 0x8278, 0x8279, 0x827a, 0x827b, 0x827c, 0x827d, 0x827e, 0x827f,
+ 0x8280, 0x8281, 0x8282, 0x8283, 0x8284, 0x8285, 0x8286, 0x8287,
+ 0x8288, 0x8289, 0x828a, 0x828b, 0x828c, 0x828d, 0x828e, 0x828f,
+ 0x8290, 0x8291, 0x8292, 0x8293, 0x8294, 0x8295, 0x8296, 0x8297,
+ 0x8298, 0x8299, 0x829a, 0x829b, 0x829c, 0x829d, 0x829e, 0x829f,
+ 0x82a0, 0x82a1, 0x82a2, 0x82a3, 0x82a4, 0x82a5, 0x82a6, 0x82a7,
+ 0x82a8, 0x82a9, 0x82aa, 0x82ab, 0x82ac, 0x82ad, 0x82ae, 0x82af,
+ 0x82b0, 0x82b1, 0x82b2, 0x82b3, 0x82b4, 0x82b5, 0x82b6, 0x82b7,
+ 0x82b8, 0x82b9, 0x82ba, 0x82bb, 0x82bc, 0x82bd, 0x82be, 0x82bf,
+ 0x82c0, 0x82c1, 0x82c2, 0x82c3, 0x82c4, 0x82c5, 0x82c6, 0x82c7,
+ 0x82c8, 0x82c9, 0x82ca, 0x82cb, 0x82cc, 0x82cd, 0x82ce, 0x82cf,
+ 0x82d0, 0x82d1, 0x82d2, 0x82d3, 0x82d4, 0x82d5, 0x82d6, 0x82d7,
+ 0x82d8, 0x82d9, 0x82da, 0x82db, 0x82dc, 0x82dd, 0x82de, 0x82df,
+ 0x82e0, 0x82e1, 0x82e2, 0x82e3, 0x82e4, 0x82e5, 0x82e6, 0x82e7,
+ 0x82e8, 0x82e9, 0x82ea, 0x82eb, 0x82ec, 0x82ed, 0x82ee, 0x82ef,
+ 0x82f0, 0x82f1, 0x82f2, 0x82f3, 0x82f4, 0x82f5, 0x82f6, 0x82f7,
+ 0x82f8, 0x82f9, 0x82fa, 0x82fb, 0x82fc, 0x82fd, 0x82fe, 0x82ff,
+ 0x8300, 0x8301, 0x8302, 0x8303, 0x8304, 0x8305, 0x8306, 0x8307,
+ 0x8308, 0x8309, 0x830a, 0x830b, 0x830c, 0x830d, 0x830e, 0x830f,
+ 0x8310, 0x8311, 0x8312, 0x8313, 0x8314, 0x8315, 0x8316, 0x8317,
+ 0x8318, 0x8319, 0x831a, 0x831b, 0x831c, 0x831d, 0x831e, 0x831f,
+ 0x8320, 0x8321, 0x8322, 0x8323, 0x8324, 0x8325, 0x8326, 0x8327,
+ 0x8328, 0x8329, 0x832a, 0x832b, 0x832c, 0x832d, 0x832e, 0x832f,
+ 0x8330, 0x8331, 0x8332, 0x8333, 0x8334, 0x8335, 0x8336, 0x8337,
+ 0x8338, 0x8339, 0x833a, 0x833b, 0x833c, 0x833d, 0x833e, 0x833f,
+ 0x8340, 0x8341, 0x8342, 0x8343, 0x8344, 0x8345, 0x8346, 0x8347,
+ 0x8348, 0x8349, 0x834a, 0x834b, 0x834c, 0x834d, 0x834e, 0x834f,
+ 0x8350, 0x8351, 0x8352, 0x8353, 0x8354, 0x8355, 0x8356, 0x8357,
+ 0x8358, 0x8359, 0x835a, 0x835b, 0x835c, 0x835d, 0x835e, 0x835f,
+ 0x8360, 0x8361, 0x8362, 0x8363, 0x8364, 0x8365, 0x8366, 0x8367,
+ 0x8368, 0x8369, 0x836a, 0x836b, 0x836c, 0x836d, 0x836e, 0x836f,
+ 0x8370, 0x8371, 0x8372, 0x8373, 0x8374, 0x8375, 0x8376, 0x8377,
+ 0x8378, 0x8379, 0x837a, 0x837b, 0x837c, 0x837d, 0x837e, 0x837f,
+ 0x8380, 0x8381, 0x8382, 0x8383, 0x8384, 0x8385, 0x8386, 0x8387,
+ 0x8388, 0x8389, 0x838a, 0x838b, 0x838c, 0x838d, 0x838e, 0x838f,
+ 0x8390, 0x8391, 0x8392, 0x8393, 0x8394, 0x8395, 0x8396, 0x8397,
+ 0x8398, 0x8399, 0x839a, 0x839b, 0x839c, 0x839d, 0x839e, 0x839f,
+ 0x83a0, 0x83a1, 0x83a2, 0x83a3, 0x83a4, 0x83a5, 0x83a6, 0x83a7,
+ 0x83a8, 0x83a9, 0x83aa, 0x83ab, 0x83ac, 0x83ad, 0x83ae, 0x83af,
+ 0x83b0, 0x83b1, 0x83b2, 0x83b3, 0x83b4, 0x83b5, 0x83b6, 0x83b7,
+ 0x83b8, 0x83b9, 0x83ba, 0x83bb, 0x83bc, 0x83bd, 0x83be, 0x83bf,
+ 0x83c0, 0x83c1, 0x83c2, 0x83c3, 0x83c4, 0x83c5, 0x83c6, 0x83c7,
+ 0x83c8, 0x83c9, 0x83ca, 0x83cb, 0x83cc, 0x83cd, 0x83ce, 0x83cf,
+ 0x83d0, 0x83d1, 0x83d2, 0x83d3, 0x83d4, 0x83d5, 0x83d6, 0x83d7,
+ 0x83d8, 0x83d9, 0x83da, 0x83db, 0x83dc, 0x83dd, 0x83de, 0x83df,
+ 0x83e0, 0x83e1, 0x83e2, 0x83e3, 0x83e4, 0x83e5, 0x83e6, 0x83e7,
+ 0x83e8, 0x83e9, 0x83ea, 0x83eb, 0x83ec, 0x83ed, 0x83ee, 0x83ef,
+ 0x83f0, 0x83f1, 0x83f2, 0x83f3, 0x83f4, 0x83f5, 0x83f6, 0x83f7,
+ 0x83f8, 0x83f9, 0x83fa, 0x83fb, 0x83fc, 0x83fd, 0x83fe, 0x83ff,
+ 0x8400, 0x8401, 0x8402, 0x8403, 0x8404, 0x8405, 0x8406, 0x8407,
+ 0x8408, 0x8409, 0x840a, 0x840b, 0x840c, 0x840d, 0x840e, 0x840f,
+ 0x8410, 0x8411, 0x8412, 0x8413, 0x8414, 0x8415, 0x8416, 0x8417,
+ 0x8418, 0x8419, 0x841a, 0x841b, 0x841c, 0x841d, 0x841e, 0x841f,
+ 0x8420, 0x8421, 0x8422, 0x8423, 0x8424, 0x8425, 0x8426, 0x8427,
+ 0x8428, 0x8429, 0x842a, 0x842b, 0x842c, 0x842d, 0x842e, 0x842f,
+ 0x8430, 0x8431, 0x8432, 0x8433, 0x8434, 0x8435, 0x8436, 0x8437,
+ 0x8438, 0x8439, 0x843a, 0x843b, 0x843c, 0x843d, 0x843e, 0x843f,
+ 0x8440, 0x8441, 0x8442, 0x8443, 0x8444, 0x8445, 0x8446, 0x8447,
+ 0x8448, 0x8449, 0x844a, 0x844b, 0x844c, 0x844d, 0x844e, 0x844f,
+ 0x8450, 0x8451, 0x8452, 0x8453, 0x8454, 0x8455, 0x8456, 0x8457,
+ 0x8458, 0x8459, 0x845a, 0x845b, 0x845c, 0x845d, 0x845e, 0x845f,
+ 0x8460, 0x8461, 0x8462, 0x8463, 0x8464, 0x8465, 0x8466, 0x8467,
+ 0x8468, 0x8469, 0x846a, 0x846b, 0x846c, 0x846d, 0x846e, 0x846f,
+ 0x8470, 0x8471, 0x8472, 0x8473, 0x8474, 0x8475, 0x8476, 0x8477,
+ 0x8478, 0x8479, 0x847a, 0x847b, 0x847c, 0x847d, 0x847e, 0x847f,
+ 0x8480, 0x8481, 0x8482, 0x8483, 0x8484, 0x8485, 0x8486, 0x8487,
+ 0x8488, 0x8489, 0x848a, 0x848b, 0x848c, 0x848d, 0x848e, 0x848f,
+ 0x8490, 0x8491, 0x8492, 0x8493, 0x8494, 0x8495, 0x8496, 0x8497,
+ 0x8498, 0x8499, 0x849a, 0x849b, 0x849c, 0x849d, 0x849e, 0x849f,
+ 0x84a0, 0x84a1, 0x84a2, 0x84a3, 0x84a4, 0x84a5, 0x84a6, 0x84a7,
+ 0x84a8, 0x84a9, 0x84aa, 0x84ab, 0x84ac, 0x84ad, 0x84ae, 0x84af,
+ 0x84b0, 0x84b1, 0x84b2, 0x84b3, 0x84b4, 0x84b5, 0x84b6, 0x84b7,
+ 0x84b8, 0x84b9, 0x84ba, 0x84bb, 0x84bc, 0x84bd, 0x84be, 0x84bf,
+ 0x84c0, 0x84c1, 0x84c2, 0x84c3, 0x84c4, 0x84c5, 0x84c6, 0x84c7,
+ 0x84c8, 0x84c9, 0x84ca, 0x84cb, 0x84cc, 0x84cd, 0x84ce, 0x84cf,
+ 0x84d0, 0x84d1, 0x84d2, 0x84d3, 0x84d4, 0x84d5, 0x84d6, 0x84d7,
+ 0x84d8, 0x84d9, 0x84da, 0x84db, 0x84dc, 0x84dd, 0x84de, 0x84df,
+ 0x84e0, 0x84e1, 0x84e2, 0x84e3, 0x84e4, 0x84e5, 0x84e6, 0x84e7,
+ 0x84e8, 0x84e9, 0x84ea, 0x84eb, 0x84ec, 0x84ed, 0x84ee, 0x84ef,
+ 0x84f0, 0x84f1, 0x84f2, 0x84f3, 0x84f4, 0x84f5, 0x84f6, 0x84f7,
+ 0x84f8, 0x84f9, 0x84fa, 0x84fb, 0x84fc, 0x84fd, 0x84fe, 0x84ff,
+ 0x8500, 0x8501, 0x8502, 0x8503, 0x8504, 0x8505, 0x8506, 0x8507,
+ 0x8508, 0x8509, 0x850a, 0x850b, 0x850c, 0x850d, 0x850e, 0x850f,
+ 0x8510, 0x8511, 0x8512, 0x8513, 0x8514, 0x8515, 0x8516, 0x8517,
+ 0x8518, 0x8519, 0x851a, 0x851b, 0x851c, 0x851d, 0x851e, 0x851f,
+ 0x8520, 0x8521, 0x8522, 0x8523, 0x8524, 0x8525, 0x8526, 0x8527,
+ 0x8528, 0x8529, 0x852a, 0x852b, 0x852c, 0x852d, 0x852e, 0x852f,
+ 0x8530, 0x8531, 0x8532, 0x8533, 0x8534, 0x8535, 0x8536, 0x8537,
+ 0x8538, 0x8539, 0x853a, 0x853b, 0x853c, 0x853d, 0x853e, 0x853f,
+ 0x8540, 0x8541, 0x8542, 0x8543, 0x8544, 0x8545, 0x8546, 0x8547,
+ 0x8548, 0x8549, 0x854a, 0x854b, 0x854c, 0x854d, 0x854e, 0x854f,
+ 0x8550, 0x8551, 0x8552, 0x8553, 0x8554, 0x8555, 0x8556, 0x8557,
+ 0x8558, 0x8559, 0x855a, 0x855b, 0x855c, 0x855d, 0x855e, 0x855f,
+ 0x8560, 0x8561, 0x8562, 0x8563, 0x8564, 0x8565, 0x8566, 0x8567,
+ 0x8568, 0x8569, 0x856a, 0x856b, 0x856c, 0x856d, 0x856e, 0x856f,
+ 0x8570, 0x8571, 0x8572, 0x8573, 0x8574, 0x8575, 0x8576, 0x8577,
+ 0x8578, 0x8579, 0x857a, 0x857b, 0x857c, 0x857d, 0x857e, 0x857f,
+ 0x8580, 0x8581, 0x8582, 0x8583, 0x8584, 0x8585, 0x8586, 0x8587,
+ 0x8588, 0x8589, 0x858a, 0x858b, 0x858c, 0x858d, 0x858e, 0x858f,
+ 0x8590, 0x8591, 0x8592, 0x8593, 0x8594, 0x8595, 0x8596, 0x8597,
+ 0x8598, 0x8599, 0x859a, 0x859b, 0x859c, 0x859d, 0x859e, 0x859f,
+ 0x85a0, 0x85a1, 0x85a2, 0x85a3, 0x85a4, 0x85a5, 0x85a6, 0x85a7,
+ 0x85a8, 0x85a9, 0x85aa, 0x85ab, 0x85ac, 0x85ad, 0x85ae, 0x85af,
+ 0x85b0, 0x85b1, 0x85b2, 0x85b3, 0x85b4, 0x85b5, 0x85b6, 0x85b7,
+ 0x85b8, 0x85b9, 0x85ba, 0x85bb, 0x85bc, 0x85bd, 0x85be, 0x85bf,
+ 0x85c0, 0x85c1, 0x85c2, 0x85c3, 0x85c4, 0x85c5, 0x85c6, 0x85c7,
+ 0x85c8, 0x85c9, 0x85ca, 0x85cb, 0x85cc, 0x85cd, 0x85ce, 0x85cf,
+ 0x85d0, 0x85d1, 0x85d2, 0x85d3, 0x85d4, 0x85d5, 0x85d6, 0x85d7,
+ 0x85d8, 0x85d9, 0x85da, 0x85db, 0x85dc, 0x85dd, 0x85de, 0x85df,
+ 0x85e0, 0x85e1, 0x85e2, 0x85e3, 0x85e4, 0x85e5, 0x85e6, 0x85e7,
+ 0x85e8, 0x85e9, 0x85ea, 0x85eb, 0x85ec, 0x85ed, 0x85ee, 0x85ef,
+ 0x85f0, 0x85f1, 0x85f2, 0x85f3, 0x85f4, 0x85f5, 0x85f6, 0x85f7,
+ 0x85f8, 0x85f9, 0x85fa, 0x85fb, 0x85fc, 0x85fd, 0x85fe, 0x85ff,
+ 0x8600, 0x8601, 0x8602, 0x8603, 0x8604, 0x8605, 0x8606, 0x8607,
+ 0x8608, 0x8609, 0x860a, 0x860b, 0x860c, 0x860d, 0x860e, 0x860f,
+ 0x8610, 0x8611, 0x8612, 0x8613, 0x8614, 0x8615, 0x8616, 0x8617,
+ 0x8618, 0x8619, 0x861a, 0x861b, 0x861c, 0x861d, 0x861e, 0x861f,
+ 0x8620, 0x8621, 0x8622, 0x8623, 0x8624, 0x8625, 0x8626, 0x8627,
+ 0x8628, 0x8629, 0x862a, 0x862b, 0x862c, 0x862d, 0x862e, 0x862f,
+ 0x8630, 0x8631, 0x8632, 0x8633, 0x8634, 0x8635, 0x8636, 0x8637,
+ 0x8638, 0x8639, 0x863a, 0x863b, 0x863c, 0x863d, 0x863e, 0x863f,
+ 0x8640, 0x8641, 0x8642, 0x8643, 0x8644, 0x8645, 0x8646, 0x8647,
+ 0x8648, 0x8649, 0x864a, 0x864b, 0x864c, 0x864d, 0x864e, 0x864f,
+ 0x8650, 0x8651, 0x8652, 0x8653, 0x8654, 0x8655, 0x8656, 0x8657,
+ 0x8658, 0x8659, 0x865a, 0x865b, 0x865c, 0x865d, 0x865e, 0x865f,
+ 0x8660, 0x8661, 0x8662, 0x8663, 0x8664, 0x8665, 0x8666, 0x8667,
+ 0x8668, 0x8669, 0x866a, 0x866b, 0x866c, 0x866d, 0x866e, 0x866f,
+ 0x8670, 0x8671, 0x8672, 0x8673, 0x8674, 0x8675, 0x8676, 0x8677,
+ 0x8678, 0x8679, 0x867a, 0x867b, 0x867c, 0x867d, 0x867e, 0x867f,
+ 0x8680, 0x8681, 0x8682, 0x8683, 0x8684, 0x8685, 0x8686, 0x8687,
+ 0x8688, 0x8689, 0x868a, 0x868b, 0x868c, 0x868d, 0x868e, 0x868f,
+ 0x8690, 0x8691, 0x8692, 0x8693, 0x8694, 0x8695, 0x8696, 0x8697,
+ 0x8698, 0x8699, 0x869a, 0x869b, 0x869c, 0x869d, 0x869e, 0x869f,
+ 0x86a0, 0x86a1, 0x86a2, 0x86a3, 0x86a4, 0x86a5, 0x86a6, 0x86a7,
+ 0x86a8, 0x86a9, 0x86aa, 0x86ab, 0x86ac, 0x86ad, 0x86ae, 0x86af,
+ 0x86b0, 0x86b1, 0x86b2, 0x86b3, 0x86b4, 0x86b5, 0x86b6, 0x86b7,
+ 0x86b8, 0x86b9, 0x86ba, 0x86bb, 0x86bc, 0x86bd, 0x86be, 0x86bf,
+ 0x86c0, 0x86c1, 0x86c2, 0x86c3, 0x86c4, 0x86c5, 0x86c6, 0x86c7,
+ 0x86c8, 0x86c9, 0x86ca, 0x86cb, 0x86cc, 0x86cd, 0x86ce, 0x86cf,
+ 0x86d0, 0x86d1, 0x86d2, 0x86d3, 0x86d4, 0x86d5, 0x86d6, 0x86d7,
+ 0x86d8, 0x86d9, 0x86da, 0x86db, 0x86dc, 0x86dd, 0x86de, 0x86df,
+ 0x86e0, 0x86e1, 0x86e2, 0x86e3, 0x86e4, 0x86e5, 0x86e6, 0x86e7,
+ 0x86e8, 0x86e9, 0x86ea, 0x86eb, 0x86ec, 0x86ed, 0x86ee, 0x86ef,
+ 0x86f0, 0x86f1, 0x86f2, 0x86f3, 0x86f4, 0x86f5, 0x86f6, 0x86f7,
+ 0x86f8, 0x86f9, 0x86fa, 0x86fb, 0x86fc, 0x86fd, 0x86fe, 0x86ff,
+ 0x8700, 0x8701, 0x8702, 0x8703, 0x8704, 0x8705, 0x8706, 0x8707,
+ 0x8708, 0x8709, 0x870a, 0x870b, 0x870c, 0x870d, 0x870e, 0x870f,
+ 0x8710, 0x8711, 0x8712, 0x8713, 0x8714, 0x8715, 0x8716, 0x8717,
+ 0x8718, 0x8719, 0x871a, 0x871b, 0x871c, 0x871d, 0x871e, 0x871f,
+ 0x8720, 0x8721, 0x8722, 0x8723, 0x8724, 0x8725, 0x8726, 0x8727,
+ 0x8728, 0x8729, 0x872a, 0x872b, 0x872c, 0x872d, 0x872e, 0x872f,
+ 0x8730, 0x8731, 0x8732, 0x8733, 0x8734, 0x8735, 0x8736, 0x8737,
+ 0x8738, 0x8739, 0x873a, 0x873b, 0x873c, 0x873d, 0x873e, 0x873f,
+ 0x8740, 0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, 0x8747,
+ 0x8748, 0x8749, 0x874a, 0x874b, 0x874c, 0x874d, 0x874e, 0x874f,
+ 0x8750, 0x8751, 0x8752, 0x8753, 0x8754, 0x8755, 0x8756, 0x8757,
+ 0x8758, 0x8759, 0x875a, 0x875b, 0x875c, 0x875d, 0x875e, 0x875f,
+ 0x8760, 0x8761, 0x8762, 0x8763, 0x8764, 0x8765, 0x8766, 0x8767,
+ 0x8768, 0x8769, 0x876a, 0x876b, 0x876c, 0x876d, 0x876e, 0x876f,
+ 0x8770, 0x8771, 0x8772, 0x8773, 0x8774, 0x8775, 0x8776, 0x8777,
+ 0x8778, 0x8779, 0x877a, 0x877b, 0x877c, 0x877d, 0x877e, 0x877f,
+ 0x8780, 0x8781, 0x8782, 0x8783, 0x8784, 0x8785, 0x8786, 0x8787,
+ 0x8788, 0x8789, 0x878a, 0x878b, 0x878c, 0x878d, 0x878e, 0x878f,
+ 0x8790, 0x8791, 0x8792, 0x8793, 0x8794, 0x8795, 0x8796, 0x8797,
+ 0x8798, 0x8799, 0x879a, 0x879b, 0x879c, 0x879d, 0x879e, 0x879f,
+ 0x87a0, 0x87a1, 0x87a2, 0x87a3, 0x87a4, 0x87a5, 0x87a6, 0x87a7,
+ 0x87a8, 0x87a9, 0x87aa, 0x87ab, 0x87ac, 0x87ad, 0x87ae, 0x87af,
+ 0x87b0, 0x87b1, 0x87b2, 0x87b3, 0x87b4, 0x87b5, 0x87b6, 0x87b7,
+ 0x87b8, 0x87b9, 0x87ba, 0x87bb, 0x87bc, 0x87bd, 0x87be, 0x87bf,
+ 0x87c0, 0x87c1, 0x87c2, 0x87c3, 0x87c4, 0x87c5, 0x87c6, 0x87c7,
+ 0x87c8, 0x87c9, 0x87ca, 0x87cb, 0x87cc, 0x87cd, 0x87ce, 0x87cf,
+ 0x87d0, 0x87d1, 0x87d2, 0x87d3, 0x87d4, 0x87d5, 0x87d6, 0x87d7,
+ 0x87d8, 0x87d9, 0x87da, 0x87db, 0x87dc, 0x87dd, 0x87de, 0x87df,
+ 0x87e0, 0x87e1, 0x87e2, 0x87e3, 0x87e4, 0x87e5, 0x87e6, 0x87e7,
+ 0x87e8, 0x87e9, 0x87ea, 0x87eb, 0x87ec, 0x87ed, 0x87ee, 0x87ef,
+ 0x87f0, 0x87f1, 0x87f2, 0x87f3, 0x87f4, 0x87f5, 0x87f6, 0x87f7,
+ 0x87f8, 0x87f9, 0x87fa, 0x87fb, 0x87fc, 0x87fd, 0x87fe, 0x87ff,
+ 0x8800, 0x8801, 0x8802, 0x8803, 0x8804, 0x8805, 0x8806, 0x8807,
+ 0x8808, 0x8809, 0x880a, 0x880b, 0x880c, 0x880d, 0x880e, 0x880f,
+ 0x8810, 0x8811, 0x8812, 0x8813, 0x8814, 0x8815, 0x8816, 0x8817,
+ 0x8818, 0x8819, 0x881a, 0x881b, 0x881c, 0x881d, 0x881e, 0x881f,
+ 0x8820, 0x8821, 0x8822, 0x8823, 0x8824, 0x8825, 0x8826, 0x8827,
+ 0x8828, 0x8829, 0x882a, 0x882b, 0x882c, 0x882d, 0x882e, 0x882f,
+ 0x8830, 0x8831, 0x8832, 0x8833, 0x8834, 0x8835, 0x8836, 0x8837,
+ 0x8838, 0x8839, 0x883a, 0x883b, 0x883c, 0x883d, 0x883e, 0x883f,
+ 0x8840, 0x8841, 0x8842, 0x8843, 0x8844, 0x8845, 0x8846, 0x8847,
+ 0x8848, 0x8849, 0x884a, 0x884b, 0x884c, 0x884d, 0x884e, 0x884f,
+ 0x8850, 0x8851, 0x8852, 0x8853, 0x8854, 0x8855, 0x8856, 0x8857,
+ 0x8858, 0x8859, 0x885a, 0x885b, 0x885c, 0x885d, 0x885e, 0x885f,
+ 0x8860, 0x8861, 0x8862, 0x8863, 0x8864, 0x8865, 0x8866, 0x8867,
+ 0x8868, 0x8869, 0x886a, 0x886b, 0x886c, 0x886d, 0x886e, 0x886f,
+ 0x8870, 0x8871, 0x8872, 0x8873, 0x8874, 0x8875, 0x8876, 0x8877,
+ 0x8878, 0x8879, 0x887a, 0x887b, 0x887c, 0x887d, 0x887e, 0x887f,
+ 0x8880, 0x8881, 0x8882, 0x8883, 0x8884, 0x8885, 0x8886, 0x8887,
+ 0x8888, 0x8889, 0x888a, 0x888b, 0x888c, 0x888d, 0x888e, 0x888f,
+ 0x8890, 0x8891, 0x8892, 0x8893, 0x8894, 0x8895, 0x8896, 0x8897,
+ 0x8898, 0x8899, 0x889a, 0x889b, 0x889c, 0x889d, 0x889e, 0x889f,
+ 0x88a0, 0x88a1, 0x88a2, 0x88a3, 0x88a4, 0x88a5, 0x88a6, 0x88a7,
+ 0x88a8, 0x88a9, 0x88aa, 0x88ab, 0x88ac, 0x88ad, 0x88ae, 0x88af,
+ 0x88b0, 0x88b1, 0x88b2, 0x88b3, 0x88b4, 0x88b5, 0x88b6, 0x88b7,
+ 0x88b8, 0x88b9, 0x88ba, 0x88bb, 0x88bc, 0x88bd, 0x88be, 0x88bf,
+ 0x88c0, 0x88c1, 0x88c2, 0x88c3, 0x88c4, 0x88c5, 0x88c6, 0x88c7,
+ 0x88c8, 0x88c9, 0x88ca, 0x88cb, 0x88cc, 0x88cd, 0x88ce, 0x88cf,
+ 0x88d0, 0x88d1, 0x88d2, 0x88d3, 0x88d4, 0x88d5, 0x88d6, 0x88d7,
+ 0x88d8, 0x88d9, 0x88da, 0x88db, 0x88dc, 0x88dd, 0x88de, 0x88df,
+ 0x88e0, 0x88e1, 0x88e2, 0x88e3, 0x88e4, 0x88e5, 0x88e6, 0x88e7,
+ 0x88e8, 0x88e9, 0x88ea, 0x88eb, 0x88ec, 0x88ed, 0x88ee, 0x88ef,
+ 0x88f0, 0x88f1, 0x88f2, 0x88f3, 0x88f4, 0x88f5, 0x88f6, 0x88f7,
+ 0x88f8, 0x88f9, 0x88fa, 0x88fb, 0x88fc, 0x88fd, 0x88fe, 0x88ff,
+ 0x8900, 0x8901, 0x8902, 0x8903, 0x8904, 0x8905, 0x8906, 0x8907,
+ 0x8908, 0x8909, 0x890a, 0x890b, 0x890c, 0x890d, 0x890e, 0x890f,
+ 0x8910, 0x8911, 0x8912, 0x8913, 0x8914, 0x8915, 0x8916, 0x8917,
+ 0x8918, 0x8919, 0x891a, 0x891b, 0x891c, 0x891d, 0x891e, 0x891f,
+ 0x8920, 0x8921, 0x8922, 0x8923, 0x8924, 0x8925, 0x8926, 0x8927,
+ 0x8928, 0x8929, 0x892a, 0x892b, 0x892c, 0x892d, 0x892e, 0x892f,
+ 0x8930, 0x8931, 0x8932, 0x8933, 0x8934, 0x8935, 0x8936, 0x8937,
+ 0x8938, 0x8939, 0x893a, 0x893b, 0x893c, 0x893d, 0x893e, 0x893f,
+ 0x8940, 0x8941, 0x8942, 0x8943, 0x8944, 0x8945, 0x8946, 0x8947,
+ 0x8948, 0x8949, 0x894a, 0x894b, 0x894c, 0x894d, 0x894e, 0x894f,
+ 0x8950, 0x8951, 0x8952, 0x8953, 0x8954, 0x8955, 0x8956, 0x8957,
+ 0x8958, 0x8959, 0x895a, 0x895b, 0x895c, 0x895d, 0x895e, 0x895f,
+ 0x8960, 0x8961, 0x8962, 0x8963, 0x8964, 0x8965, 0x8966, 0x8967,
+ 0x8968, 0x8969, 0x896a, 0x896b, 0x896c, 0x896d, 0x896e, 0x896f,
+ 0x8970, 0x8971, 0x8972, 0x8973, 0x8974, 0x8975, 0x8976, 0x8977,
+ 0x8978, 0x8979, 0x897a, 0x897b, 0x897c, 0x897d, 0x897e, 0x897f,
+ 0x8980, 0x8981, 0x8982, 0x8983, 0x8984, 0x8985, 0x8986, 0x8987,
+ 0x8988, 0x8989, 0x898a, 0x898b, 0x898c, 0x898d, 0x898e, 0x898f,
+ 0x8990, 0x8991, 0x8992, 0x8993, 0x8994, 0x8995, 0x8996, 0x8997,
+ 0x8998, 0x8999, 0x899a, 0x899b, 0x899c, 0x899d, 0x899e, 0x899f,
+ 0x89a0, 0x89a1, 0x89a2, 0x89a3, 0x89a4, 0x89a5, 0x89a6, 0x89a7,
+ 0x89a8, 0x89a9, 0x89aa, 0x89ab, 0x89ac, 0x89ad, 0x89ae, 0x89af,
+ 0x89b0, 0x89b1, 0x89b2, 0x89b3, 0x89b4, 0x89b5, 0x89b6, 0x89b7,
+ 0x89b8, 0x89b9, 0x89ba, 0x89bb, 0x89bc, 0x89bd, 0x89be, 0x89bf,
+ 0x89c0, 0x89c1, 0x89c2, 0x89c3, 0x89c4, 0x89c5, 0x89c6, 0x89c7,
+ 0x89c8, 0x89c9, 0x89ca, 0x89cb, 0x89cc, 0x89cd, 0x89ce, 0x89cf,
+ 0x89d0, 0x89d1, 0x89d2, 0x89d3, 0x89d4, 0x89d5, 0x89d6, 0x89d7,
+ 0x89d8, 0x89d9, 0x89da, 0x89db, 0x89dc, 0x89dd, 0x89de, 0x89df,
+ 0x89e0, 0x89e1, 0x89e2, 0x89e3, 0x89e4, 0x89e5, 0x89e6, 0x89e7,
+ 0x89e8, 0x89e9, 0x89ea, 0x89eb, 0x89ec, 0x89ed, 0x89ee, 0x89ef,
+ 0x89f0, 0x89f1, 0x89f2, 0x89f3, 0x89f4, 0x89f5, 0x89f6, 0x89f7,
+ 0x89f8, 0x89f9, 0x89fa, 0x89fb, 0x89fc, 0x89fd, 0x89fe, 0x89ff,
+ 0x8a00, 0x8a01, 0x8a02, 0x8a03, 0x8a04, 0x8a05, 0x8a06, 0x8a07,
+ 0x8a08, 0x8a09, 0x8a0a, 0x8a0b, 0x8a0c, 0x8a0d, 0x8a0e, 0x8a0f,
+ 0x8a10, 0x8a11, 0x8a12, 0x8a13, 0x8a14, 0x8a15, 0x8a16, 0x8a17,
+ 0x8a18, 0x8a19, 0x8a1a, 0x8a1b, 0x8a1c, 0x8a1d, 0x8a1e, 0x8a1f,
+ 0x8a20, 0x8a21, 0x8a22, 0x8a23, 0x8a24, 0x8a25, 0x8a26, 0x8a27,
+ 0x8a28, 0x8a29, 0x8a2a, 0x8a2b, 0x8a2c, 0x8a2d, 0x8a2e, 0x8a2f,
+ 0x8a30, 0x8a31, 0x8a32, 0x8a33, 0x8a34, 0x8a35, 0x8a36, 0x8a37,
+ 0x8a38, 0x8a39, 0x8a3a, 0x8a3b, 0x8a3c, 0x8a3d, 0x8a3e, 0x8a3f,
+ 0x8a40, 0x8a41, 0x8a42, 0x8a43, 0x8a44, 0x8a45, 0x8a46, 0x8a47,
+ 0x8a48, 0x8a49, 0x8a4a, 0x8a4b, 0x8a4c, 0x8a4d, 0x8a4e, 0x8a4f,
+ 0x8a50, 0x8a51, 0x8a52, 0x8a53, 0x8a54, 0x8a55, 0x8a56, 0x8a57,
+ 0x8a58, 0x8a59, 0x8a5a, 0x8a5b, 0x8a5c, 0x8a5d, 0x8a5e, 0x8a5f,
+ 0x8a60, 0x8a61, 0x8a62, 0x8a63, 0x8a64, 0x8a65, 0x8a66, 0x8a67,
+ 0x8a68, 0x8a69, 0x8a6a, 0x8a6b, 0x8a6c, 0x8a6d, 0x8a6e, 0x8a6f,
+ 0x8a70, 0x8a71, 0x8a72, 0x8a73, 0x8a74, 0x8a75, 0x8a76, 0x8a77,
+ 0x8a78, 0x8a79, 0x8a7a, 0x8a7b, 0x8a7c, 0x8a7d, 0x8a7e, 0x8a7f,
+ 0x8a80, 0x8a81, 0x8a82, 0x8a83, 0x8a84, 0x8a85, 0x8a86, 0x8a87,
+ 0x8a88, 0x8a89, 0x8a8a, 0x8a8b, 0x8a8c, 0x8a8d, 0x8a8e, 0x8a8f,
+ 0x8a90, 0x8a91, 0x8a92, 0x8a93, 0x8a94, 0x8a95, 0x8a96, 0x8a97,
+ 0x8a98, 0x8a99, 0x8a9a, 0x8a9b, 0x8a9c, 0x8a9d, 0x8a9e, 0x8a9f,
+ 0x8aa0, 0x8aa1, 0x8aa2, 0x8aa3, 0x8aa4, 0x8aa5, 0x8aa6, 0x8aa7,
+ 0x8aa8, 0x8aa9, 0x8aaa, 0x8aab, 0x8aac, 0x8aad, 0x8aae, 0x8aaf,
+ 0x8ab0, 0x8ab1, 0x8ab2, 0x8ab3, 0x8ab4, 0x8ab5, 0x8ab6, 0x8ab7,
+ 0x8ab8, 0x8ab9, 0x8aba, 0x8abb, 0x8abc, 0x8abd, 0x8abe, 0x8abf,
+ 0x8ac0, 0x8ac1, 0x8ac2, 0x8ac3, 0x8ac4, 0x8ac5, 0x8ac6, 0x8ac7,
+ 0x8ac8, 0x8ac9, 0x8aca, 0x8acb, 0x8acc, 0x8acd, 0x8ace, 0x8acf,
+ 0x8ad0, 0x8ad1, 0x8ad2, 0x8ad3, 0x8ad4, 0x8ad5, 0x8ad6, 0x8ad7,
+ 0x8ad8, 0x8ad9, 0x8ada, 0x8adb, 0x8adc, 0x8add, 0x8ade, 0x8adf,
+ 0x8ae0, 0x8ae1, 0x8ae2, 0x8ae3, 0x8ae4, 0x8ae5, 0x8ae6, 0x8ae7,
+ 0x8ae8, 0x8ae9, 0x8aea, 0x8aeb, 0x8aec, 0x8aed, 0x8aee, 0x8aef,
+ 0x8af0, 0x8af1, 0x8af2, 0x8af3, 0x8af4, 0x8af5, 0x8af6, 0x8af7,
+ 0x8af8, 0x8af9, 0x8afa, 0x8afb, 0x8afc, 0x8afd, 0x8afe, 0x8aff,
+ 0x8b00, 0x8b01, 0x8b02, 0x8b03, 0x8b04, 0x8b05, 0x8b06, 0x8b07,
+ 0x8b08, 0x8b09, 0x8b0a, 0x8b0b, 0x8b0c, 0x8b0d, 0x8b0e, 0x8b0f,
+ 0x8b10, 0x8b11, 0x8b12, 0x8b13, 0x8b14, 0x8b15, 0x8b16, 0x8b17,
+ 0x8b18, 0x8b19, 0x8b1a, 0x8b1b, 0x8b1c, 0x8b1d, 0x8b1e, 0x8b1f,
+ 0x8b20, 0x8b21, 0x8b22, 0x8b23, 0x8b24, 0x8b25, 0x8b26, 0x8b27,
+ 0x8b28, 0x8b29, 0x8b2a, 0x8b2b, 0x8b2c, 0x8b2d, 0x8b2e, 0x8b2f,
+ 0x8b30, 0x8b31, 0x8b32, 0x8b33, 0x8b34, 0x8b35, 0x8b36, 0x8b37,
+ 0x8b38, 0x8b39, 0x8b3a, 0x8b3b, 0x8b3c, 0x8b3d, 0x8b3e, 0x8b3f,
+ 0x8b40, 0x8b41, 0x8b42, 0x8b43, 0x8b44, 0x8b45, 0x8b46, 0x8b47,
+ 0x8b48, 0x8b49, 0x8b4a, 0x8b4b, 0x8b4c, 0x8b4d, 0x8b4e, 0x8b4f,
+ 0x8b50, 0x8b51, 0x8b52, 0x8b53, 0x8b54, 0x8b55, 0x8b56, 0x8b57,
+ 0x8b58, 0x8b59, 0x8b5a, 0x8b5b, 0x8b5c, 0x8b5d, 0x8b5e, 0x8b5f,
+ 0x8b60, 0x8b61, 0x8b62, 0x8b63, 0x8b64, 0x8b65, 0x8b66, 0x8b67,
+ 0x8b68, 0x8b69, 0x8b6a, 0x8b6b, 0x8b6c, 0x8b6d, 0x8b6e, 0x8b6f,
+ 0x8b70, 0x8b71, 0x8b72, 0x8b73, 0x8b74, 0x8b75, 0x8b76, 0x8b77,
+ 0x8b78, 0x8b79, 0x8b7a, 0x8b7b, 0x8b7c, 0x8b7d, 0x8b7e, 0x8b7f,
+ 0x8b80, 0x8b81, 0x8b82, 0x8b83, 0x8b84, 0x8b85, 0x8b86, 0x8b87,
+ 0x8b88, 0x8b89, 0x8b8a, 0x8b8b, 0x8b8c, 0x8b8d, 0x8b8e, 0x8b8f,
+ 0x8b90, 0x8b91, 0x8b92, 0x8b93, 0x8b94, 0x8b95, 0x8b96, 0x8b97,
+ 0x8b98, 0x8b99, 0x8b9a, 0x8b9b, 0x8b9c, 0x8b9d, 0x8b9e, 0x8b9f,
+ 0x8ba0, 0x8ba1, 0x8ba2, 0x8ba3, 0x8ba4, 0x8ba5, 0x8ba6, 0x8ba7,
+ 0x8ba8, 0x8ba9, 0x8baa, 0x8bab, 0x8bac, 0x8bad, 0x8bae, 0x8baf,
+ 0x8bb0, 0x8bb1, 0x8bb2, 0x8bb3, 0x8bb4, 0x8bb5, 0x8bb6, 0x8bb7,
+ 0x8bb8, 0x8bb9, 0x8bba, 0x8bbb, 0x8bbc, 0x8bbd, 0x8bbe, 0x8bbf,
+ 0x8bc0, 0x8bc1, 0x8bc2, 0x8bc3, 0x8bc4, 0x8bc5, 0x8bc6, 0x8bc7,
+ 0x8bc8, 0x8bc9, 0x8bca, 0x8bcb, 0x8bcc, 0x8bcd, 0x8bce, 0x8bcf,
+ 0x8bd0, 0x8bd1, 0x8bd2, 0x8bd3, 0x8bd4, 0x8bd5, 0x8bd6, 0x8bd7,
+ 0x8bd8, 0x8bd9, 0x8bda, 0x8bdb, 0x8bdc, 0x8bdd, 0x8bde, 0x8bdf,
+ 0x8be0, 0x8be1, 0x8be2, 0x8be3, 0x8be4, 0x8be5, 0x8be6, 0x8be7,
+ 0x8be8, 0x8be9, 0x8bea, 0x8beb, 0x8bec, 0x8bed, 0x8bee, 0x8bef,
+ 0x8bf0, 0x8bf1, 0x8bf2, 0x8bf3, 0x8bf4, 0x8bf5, 0x8bf6, 0x8bf7,
+ 0x8bf8, 0x8bf9, 0x8bfa, 0x8bfb, 0x8bfc, 0x8bfd, 0x8bfe, 0x8bff,
+ 0x8c00, 0x8c01, 0x8c02, 0x8c03, 0x8c04, 0x8c05, 0x8c06, 0x8c07,
+ 0x8c08, 0x8c09, 0x8c0a, 0x8c0b, 0x8c0c, 0x8c0d, 0x8c0e, 0x8c0f,
+ 0x8c10, 0x8c11, 0x8c12, 0x8c13, 0x8c14, 0x8c15, 0x8c16, 0x8c17,
+ 0x8c18, 0x8c19, 0x8c1a, 0x8c1b, 0x8c1c, 0x8c1d, 0x8c1e, 0x8c1f,
+ 0x8c20, 0x8c21, 0x8c22, 0x8c23, 0x8c24, 0x8c25, 0x8c26, 0x8c27,
+ 0x8c28, 0x8c29, 0x8c2a, 0x8c2b, 0x8c2c, 0x8c2d, 0x8c2e, 0x8c2f,
+ 0x8c30, 0x8c31, 0x8c32, 0x8c33, 0x8c34, 0x8c35, 0x8c36, 0x8c37,
+ 0x8c38, 0x8c39, 0x8c3a, 0x8c3b, 0x8c3c, 0x8c3d, 0x8c3e, 0x8c3f,
+ 0x8c40, 0x8c41, 0x8c42, 0x8c43, 0x8c44, 0x8c45, 0x8c46, 0x8c47,
+ 0x8c48, 0x8c49, 0x8c4a, 0x8c4b, 0x8c4c, 0x8c4d, 0x8c4e, 0x8c4f,
+ 0x8c50, 0x8c51, 0x8c52, 0x8c53, 0x8c54, 0x8c55, 0x8c56, 0x8c57,
+ 0x8c58, 0x8c59, 0x8c5a, 0x8c5b, 0x8c5c, 0x8c5d, 0x8c5e, 0x8c5f,
+ 0x8c60, 0x8c61, 0x8c62, 0x8c63, 0x8c64, 0x8c65, 0x8c66, 0x8c67,
+ 0x8c68, 0x8c69, 0x8c6a, 0x8c6b, 0x8c6c, 0x8c6d, 0x8c6e, 0x8c6f,
+ 0x8c70, 0x8c71, 0x8c72, 0x8c73, 0x8c74, 0x8c75, 0x8c76, 0x8c77,
+ 0x8c78, 0x8c79, 0x8c7a, 0x8c7b, 0x8c7c, 0x8c7d, 0x8c7e, 0x8c7f,
+ 0x8c80, 0x8c81, 0x8c82, 0x8c83, 0x8c84, 0x8c85, 0x8c86, 0x8c87,
+ 0x8c88, 0x8c89, 0x8c8a, 0x8c8b, 0x8c8c, 0x8c8d, 0x8c8e, 0x8c8f,
+ 0x8c90, 0x8c91, 0x8c92, 0x8c93, 0x8c94, 0x8c95, 0x8c96, 0x8c97,
+ 0x8c98, 0x8c99, 0x8c9a, 0x8c9b, 0x8c9c, 0x8c9d, 0x8c9e, 0x8c9f,
+ 0x8ca0, 0x8ca1, 0x8ca2, 0x8ca3, 0x8ca4, 0x8ca5, 0x8ca6, 0x8ca7,
+ 0x8ca8, 0x8ca9, 0x8caa, 0x8cab, 0x8cac, 0x8cad, 0x8cae, 0x8caf,
+ 0x8cb0, 0x8cb1, 0x8cb2, 0x8cb3, 0x8cb4, 0x8cb5, 0x8cb6, 0x8cb7,
+ 0x8cb8, 0x8cb9, 0x8cba, 0x8cbb, 0x8cbc, 0x8cbd, 0x8cbe, 0x8cbf,
+ 0x8cc0, 0x8cc1, 0x8cc2, 0x8cc3, 0x8cc4, 0x8cc5, 0x8cc6, 0x8cc7,
+ 0x8cc8, 0x8cc9, 0x8cca, 0x8ccb, 0x8ccc, 0x8ccd, 0x8cce, 0x8ccf,
+ 0x8cd0, 0x8cd1, 0x8cd2, 0x8cd3, 0x8cd4, 0x8cd5, 0x8cd6, 0x8cd7,
+ 0x8cd8, 0x8cd9, 0x8cda, 0x8cdb, 0x8cdc, 0x8cdd, 0x8cde, 0x8cdf,
+ 0x8ce0, 0x8ce1, 0x8ce2, 0x8ce3, 0x8ce4, 0x8ce5, 0x8ce6, 0x8ce7,
+ 0x8ce8, 0x8ce9, 0x8cea, 0x8ceb, 0x8cec, 0x8ced, 0x8cee, 0x8cef,
+ 0x8cf0, 0x8cf1, 0x8cf2, 0x8cf3, 0x8cf4, 0x8cf5, 0x8cf6, 0x8cf7,
+ 0x8cf8, 0x8cf9, 0x8cfa, 0x8cfb, 0x8cfc, 0x8cfd, 0x8cfe, 0x8cff,
+ 0x8d00, 0x8d01, 0x8d02, 0x8d03, 0x8d04, 0x8d05, 0x8d06, 0x8d07,
+ 0x8d08, 0x8d09, 0x8d0a, 0x8d0b, 0x8d0c, 0x8d0d, 0x8d0e, 0x8d0f,
+ 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, 0x8d16, 0x8d17,
+ 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d1d, 0x8d1e, 0x8d1f,
+ 0x8d20, 0x8d21, 0x8d22, 0x8d23, 0x8d24, 0x8d25, 0x8d26, 0x8d27,
+ 0x8d28, 0x8d29, 0x8d2a, 0x8d2b, 0x8d2c, 0x8d2d, 0x8d2e, 0x8d2f,
+ 0x8d30, 0x8d31, 0x8d32, 0x8d33, 0x8d34, 0x8d35, 0x8d36, 0x8d37,
+ 0x8d38, 0x8d39, 0x8d3a, 0x8d3b, 0x8d3c, 0x8d3d, 0x8d3e, 0x8d3f,
+ 0x8d40, 0x8d41, 0x8d42, 0x8d43, 0x8d44, 0x8d45, 0x8d46, 0x8d47,
+ 0x8d48, 0x8d49, 0x8d4a, 0x8d4b, 0x8d4c, 0x8d4d, 0x8d4e, 0x8d4f,
+ 0x8d50, 0x8d51, 0x8d52, 0x8d53, 0x8d54, 0x8d55, 0x8d56, 0x8d57,
+ 0x8d58, 0x8d59, 0x8d5a, 0x8d5b, 0x8d5c, 0x8d5d, 0x8d5e, 0x8d5f,
+ 0x8d60, 0x8d61, 0x8d62, 0x8d63, 0x8d64, 0x8d65, 0x8d66, 0x8d67,
+ 0x8d68, 0x8d69, 0x8d6a, 0x8d6b, 0x8d6c, 0x8d6d, 0x8d6e, 0x8d6f,
+ 0x8d70, 0x8d71, 0x8d72, 0x8d73, 0x8d74, 0x8d75, 0x8d76, 0x8d77,
+ 0x8d78, 0x8d79, 0x8d7a, 0x8d7b, 0x8d7c, 0x8d7d, 0x8d7e, 0x8d7f,
+ 0x8d80, 0x8d81, 0x8d82, 0x8d83, 0x8d84, 0x8d85, 0x8d86, 0x8d87,
+ 0x8d88, 0x8d89, 0x8d8a, 0x8d8b, 0x8d8c, 0x8d8d, 0x8d8e, 0x8d8f,
+ 0x8d90, 0x8d91, 0x8d92, 0x8d93, 0x8d94, 0x8d95, 0x8d96, 0x8d97,
+ 0x8d98, 0x8d99, 0x8d9a, 0x8d9b, 0x8d9c, 0x8d9d, 0x8d9e, 0x8d9f,
+ 0x8da0, 0x8da1, 0x8da2, 0x8da3, 0x8da4, 0x8da5, 0x8da6, 0x8da7,
+ 0x8da8, 0x8da9, 0x8daa, 0x8dab, 0x8dac, 0x8dad, 0x8dae, 0x8daf,
+ 0x8db0, 0x8db1, 0x8db2, 0x8db3, 0x8db4, 0x8db5, 0x8db6, 0x8db7,
+ 0x8db8, 0x8db9, 0x8dba, 0x8dbb, 0x8dbc, 0x8dbd, 0x8dbe, 0x8dbf,
+ 0x8dc0, 0x8dc1, 0x8dc2, 0x8dc3, 0x8dc4, 0x8dc5, 0x8dc6, 0x8dc7,
+ 0x8dc8, 0x8dc9, 0x8dca, 0x8dcb, 0x8dcc, 0x8dcd, 0x8dce, 0x8dcf,
+ 0x8dd0, 0x8dd1, 0x8dd2, 0x8dd3, 0x8dd4, 0x8dd5, 0x8dd6, 0x8dd7,
+ 0x8dd8, 0x8dd9, 0x8dda, 0x8ddb, 0x8ddc, 0x8ddd, 0x8dde, 0x8ddf,
+ 0x8de0, 0x8de1, 0x8de2, 0x8de3, 0x8de4, 0x8de5, 0x8de6, 0x8de7,
+ 0x8de8, 0x8de9, 0x8dea, 0x8deb, 0x8dec, 0x8ded, 0x8dee, 0x8def,
+ 0x8df0, 0x8df1, 0x8df2, 0x8df3, 0x8df4, 0x8df5, 0x8df6, 0x8df7,
+ 0x8df8, 0x8df9, 0x8dfa, 0x8dfb, 0x8dfc, 0x8dfd, 0x8dfe, 0x8dff,
+ 0x8e00, 0x8e01, 0x8e02, 0x8e03, 0x8e04, 0x8e05, 0x8e06, 0x8e07,
+ 0x8e08, 0x8e09, 0x8e0a, 0x8e0b, 0x8e0c, 0x8e0d, 0x8e0e, 0x8e0f,
+ 0x8e10, 0x8e11, 0x8e12, 0x8e13, 0x8e14, 0x8e15, 0x8e16, 0x8e17,
+ 0x8e18, 0x8e19, 0x8e1a, 0x8e1b, 0x8e1c, 0x8e1d, 0x8e1e, 0x8e1f,
+ 0x8e20, 0x8e21, 0x8e22, 0x8e23, 0x8e24, 0x8e25, 0x8e26, 0x8e27,
+ 0x8e28, 0x8e29, 0x8e2a, 0x8e2b, 0x8e2c, 0x8e2d, 0x8e2e, 0x8e2f,
+ 0x8e30, 0x8e31, 0x8e32, 0x8e33, 0x8e34, 0x8e35, 0x8e36, 0x8e37,
+ 0x8e38, 0x8e39, 0x8e3a, 0x8e3b, 0x8e3c, 0x8e3d, 0x8e3e, 0x8e3f,
+ 0x8e40, 0x8e41, 0x8e42, 0x8e43, 0x8e44, 0x8e45, 0x8e46, 0x8e47,
+ 0x8e48, 0x8e49, 0x8e4a, 0x8e4b, 0x8e4c, 0x8e4d, 0x8e4e, 0x8e4f,
+ 0x8e50, 0x8e51, 0x8e52, 0x8e53, 0x8e54, 0x8e55, 0x8e56, 0x8e57,
+ 0x8e58, 0x8e59, 0x8e5a, 0x8e5b, 0x8e5c, 0x8e5d, 0x8e5e, 0x8e5f,
+ 0x8e60, 0x8e61, 0x8e62, 0x8e63, 0x8e64, 0x8e65, 0x8e66, 0x8e67,
+ 0x8e68, 0x8e69, 0x8e6a, 0x8e6b, 0x8e6c, 0x8e6d, 0x8e6e, 0x8e6f,
+ 0x8e70, 0x8e71, 0x8e72, 0x8e73, 0x8e74, 0x8e75, 0x8e76, 0x8e77,
+ 0x8e78, 0x8e79, 0x8e7a, 0x8e7b, 0x8e7c, 0x8e7d, 0x8e7e, 0x8e7f,
+ 0x8e80, 0x8e81, 0x8e82, 0x8e83, 0x8e84, 0x8e85, 0x8e86, 0x8e87,
+ 0x8e88, 0x8e89, 0x8e8a, 0x8e8b, 0x8e8c, 0x8e8d, 0x8e8e, 0x8e8f,
+ 0x8e90, 0x8e91, 0x8e92, 0x8e93, 0x8e94, 0x8e95, 0x8e96, 0x8e97,
+ 0x8e98, 0x8e99, 0x8e9a, 0x8e9b, 0x8e9c, 0x8e9d, 0x8e9e, 0x8e9f,
+ 0x8ea0, 0x8ea1, 0x8ea2, 0x8ea3, 0x8ea4, 0x8ea5, 0x8ea6, 0x8ea7,
+ 0x8ea8, 0x8ea9, 0x8eaa, 0x8eab, 0x8eac, 0x8ead, 0x8eae, 0x8eaf,
+ 0x8eb0, 0x8eb1, 0x8eb2, 0x8eb3, 0x8eb4, 0x8eb5, 0x8eb6, 0x8eb7,
+ 0x8eb8, 0x8eb9, 0x8eba, 0x8ebb, 0x8ebc, 0x8ebd, 0x8ebe, 0x8ebf,
+ 0x8ec0, 0x8ec1, 0x8ec2, 0x8ec3, 0x8ec4, 0x8ec5, 0x8ec6, 0x8ec7,
+ 0x8ec8, 0x8ec9, 0x8eca, 0x8ecb, 0x8ecc, 0x8ecd, 0x8ece, 0x8ecf,
+ 0x8ed0, 0x8ed1, 0x8ed2, 0x8ed3, 0x8ed4, 0x8ed5, 0x8ed6, 0x8ed7,
+ 0x8ed8, 0x8ed9, 0x8eda, 0x8edb, 0x8edc, 0x8edd, 0x8ede, 0x8edf,
+ 0x8ee0, 0x8ee1, 0x8ee2, 0x8ee3, 0x8ee4, 0x8ee5, 0x8ee6, 0x8ee7,
+ 0x8ee8, 0x8ee9, 0x8eea, 0x8eeb, 0x8eec, 0x8eed, 0x8eee, 0x8eef,
+ 0x8ef0, 0x8ef1, 0x8ef2, 0x8ef3, 0x8ef4, 0x8ef5, 0x8ef6, 0x8ef7,
+ 0x8ef8, 0x8ef9, 0x8efa, 0x8efb, 0x8efc, 0x8efd, 0x8efe, 0x8eff,
+ 0x8f00, 0x8f01, 0x8f02, 0x8f03, 0x8f04, 0x8f05, 0x8f06, 0x8f07,
+ 0x8f08, 0x8f09, 0x8f0a, 0x8f0b, 0x8f0c, 0x8f0d, 0x8f0e, 0x8f0f,
+ 0x8f10, 0x8f11, 0x8f12, 0x8f13, 0x8f14, 0x8f15, 0x8f16, 0x8f17,
+ 0x8f18, 0x8f19, 0x8f1a, 0x8f1b, 0x8f1c, 0x8f1d, 0x8f1e, 0x8f1f,
+ 0x8f20, 0x8f21, 0x8f22, 0x8f23, 0x8f24, 0x8f25, 0x8f26, 0x8f27,
+ 0x8f28, 0x8f29, 0x8f2a, 0x8f2b, 0x8f2c, 0x8f2d, 0x8f2e, 0x8f2f,
+ 0x8f30, 0x8f31, 0x8f32, 0x8f33, 0x8f34, 0x8f35, 0x8f36, 0x8f37,
+ 0x8f38, 0x8f39, 0x8f3a, 0x8f3b, 0x8f3c, 0x8f3d, 0x8f3e, 0x8f3f,
+ 0x8f40, 0x8f41, 0x8f42, 0x8f43, 0x8f44, 0x8f45, 0x8f46, 0x8f47,
+ 0x8f48, 0x8f49, 0x8f4a, 0x8f4b, 0x8f4c, 0x8f4d, 0x8f4e, 0x8f4f,
+ 0x8f50, 0x8f51, 0x8f52, 0x8f53, 0x8f54, 0x8f55, 0x8f56, 0x8f57,
+ 0x8f58, 0x8f59, 0x8f5a, 0x8f5b, 0x8f5c, 0x8f5d, 0x8f5e, 0x8f5f,
+ 0x8f60, 0x8f61, 0x8f62, 0x8f63, 0x8f64, 0x8f65, 0x8f66, 0x8f67,
+ 0x8f68, 0x8f69, 0x8f6a, 0x8f6b, 0x8f6c, 0x8f6d, 0x8f6e, 0x8f6f,
+ 0x8f70, 0x8f71, 0x8f72, 0x8f73, 0x8f74, 0x8f75, 0x8f76, 0x8f77,
+ 0x8f78, 0x8f79, 0x8f7a, 0x8f7b, 0x8f7c, 0x8f7d, 0x8f7e, 0x8f7f,
+ 0x8f80, 0x8f81, 0x8f82, 0x8f83, 0x8f84, 0x8f85, 0x8f86, 0x8f87,
+ 0x8f88, 0x8f89, 0x8f8a, 0x8f8b, 0x8f8c, 0x8f8d, 0x8f8e, 0x8f8f,
+ 0x8f90, 0x8f91, 0x8f92, 0x8f93, 0x8f94, 0x8f95, 0x8f96, 0x8f97,
+ 0x8f98, 0x8f99, 0x8f9a, 0x8f9b, 0x8f9c, 0x8f9d, 0x8f9e, 0x8f9f,
+ 0x8fa0, 0x8fa1, 0x8fa2, 0x8fa3, 0x8fa4, 0x8fa5, 0x8fa6, 0x8fa7,
+ 0x8fa8, 0x8fa9, 0x8faa, 0x8fab, 0x8fac, 0x8fad, 0x8fae, 0x8faf,
+ 0x8fb0, 0x8fb1, 0x8fb2, 0x8fb3, 0x8fb4, 0x8fb5, 0x8fb6, 0x8fb7,
+ 0x8fb8, 0x8fb9, 0x8fba, 0x8fbb, 0x8fbc, 0x8fbd, 0x8fbe, 0x8fbf,
+ 0x8fc0, 0x8fc1, 0x8fc2, 0x8fc3, 0x8fc4, 0x8fc5, 0x8fc6, 0x8fc7,
+ 0x8fc8, 0x8fc9, 0x8fca, 0x8fcb, 0x8fcc, 0x8fcd, 0x8fce, 0x8fcf,
+ 0x8fd0, 0x8fd1, 0x8fd2, 0x8fd3, 0x8fd4, 0x8fd5, 0x8fd6, 0x8fd7,
+ 0x8fd8, 0x8fd9, 0x8fda, 0x8fdb, 0x8fdc, 0x8fdd, 0x8fde, 0x8fdf,
+ 0x8fe0, 0x8fe1, 0x8fe2, 0x8fe3, 0x8fe4, 0x8fe5, 0x8fe6, 0x8fe7,
+ 0x8fe8, 0x8fe9, 0x8fea, 0x8feb, 0x8fec, 0x8fed, 0x8fee, 0x8fef,
+ 0x8ff0, 0x8ff1, 0x8ff2, 0x8ff3, 0x8ff4, 0x8ff5, 0x8ff6, 0x8ff7,
+ 0x8ff8, 0x8ff9, 0x8ffa, 0x8ffb, 0x8ffc, 0x8ffd, 0x8ffe, 0x8fff,
+ 0x9000, 0x9001, 0x9002, 0x9003, 0x9004, 0x9005, 0x9006, 0x9007,
+ 0x9008, 0x9009, 0x900a, 0x900b, 0x900c, 0x900d, 0x900e, 0x900f,
+ 0x9010, 0x9011, 0x9012, 0x9013, 0x9014, 0x9015, 0x9016, 0x9017,
+ 0x9018, 0x9019, 0x901a, 0x901b, 0x901c, 0x901d, 0x901e, 0x901f,
+ 0x9020, 0x9021, 0x9022, 0x9023, 0x9024, 0x9025, 0x9026, 0x9027,
+ 0x9028, 0x9029, 0x902a, 0x902b, 0x902c, 0x902d, 0x902e, 0x902f,
+ 0x9030, 0x9031, 0x9032, 0x9033, 0x9034, 0x9035, 0x9036, 0x9037,
+ 0x9038, 0x9039, 0x903a, 0x903b, 0x903c, 0x903d, 0x903e, 0x903f,
+ 0x9040, 0x9041, 0x9042, 0x9043, 0x9044, 0x9045, 0x9046, 0x9047,
+ 0x9048, 0x9049, 0x904a, 0x904b, 0x904c, 0x904d, 0x904e, 0x904f,
+ 0x9050, 0x9051, 0x9052, 0x9053, 0x9054, 0x9055, 0x9056, 0x9057,
+ 0x9058, 0x9059, 0x905a, 0x905b, 0x905c, 0x905d, 0x905e, 0x905f,
+ 0x9060, 0x9061, 0x9062, 0x9063, 0x9064, 0x9065, 0x9066, 0x9067,
+ 0x9068, 0x9069, 0x906a, 0x906b, 0x906c, 0x906d, 0x906e, 0x906f,
+ 0x9070, 0x9071, 0x9072, 0x9073, 0x9074, 0x9075, 0x9076, 0x9077,
+ 0x9078, 0x9079, 0x907a, 0x907b, 0x907c, 0x907d, 0x907e, 0x907f,
+ 0x9080, 0x9081, 0x9082, 0x9083, 0x9084, 0x9085, 0x9086, 0x9087,
+ 0x9088, 0x9089, 0x908a, 0x908b, 0x908c, 0x908d, 0x908e, 0x908f,
+ 0x9090, 0x9091, 0x9092, 0x9093, 0x9094, 0x9095, 0x9096, 0x9097,
+ 0x9098, 0x9099, 0x909a, 0x909b, 0x909c, 0x909d, 0x909e, 0x909f,
+ 0x90a0, 0x90a1, 0x90a2, 0x90a3, 0x90a4, 0x90a5, 0x90a6, 0x90a7,
+ 0x90a8, 0x90a9, 0x90aa, 0x90ab, 0x90ac, 0x90ad, 0x90ae, 0x90af,
+ 0x90b0, 0x90b1, 0x90b2, 0x90b3, 0x90b4, 0x90b5, 0x90b6, 0x90b7,
+ 0x90b8, 0x90b9, 0x90ba, 0x90bb, 0x90bc, 0x90bd, 0x90be, 0x90bf,
+ 0x90c0, 0x90c1, 0x90c2, 0x90c3, 0x90c4, 0x90c5, 0x90c6, 0x90c7,
+ 0x90c8, 0x90c9, 0x90ca, 0x90cb, 0x90cc, 0x90cd, 0x90ce, 0x90cf,
+ 0x90d0, 0x90d1, 0x90d2, 0x90d3, 0x90d4, 0x90d5, 0x90d6, 0x90d7,
+ 0x90d8, 0x90d9, 0x90da, 0x90db, 0x90dc, 0x90dd, 0x90de, 0x90df,
+ 0x90e0, 0x90e1, 0x90e2, 0x90e3, 0x90e4, 0x90e5, 0x90e6, 0x90e7,
+ 0x90e8, 0x90e9, 0x90ea, 0x90eb, 0x90ec, 0x90ed, 0x90ee, 0x90ef,
+ 0x90f0, 0x90f1, 0x90f2, 0x90f3, 0x90f4, 0x90f5, 0x90f6, 0x90f7,
+ 0x90f8, 0x90f9, 0x90fa, 0x90fb, 0x90fc, 0x90fd, 0x90fe, 0x90ff,
+ 0x9100, 0x9101, 0x9102, 0x9103, 0x9104, 0x9105, 0x9106, 0x9107,
+ 0x9108, 0x9109, 0x910a, 0x910b, 0x910c, 0x910d, 0x910e, 0x910f,
+ 0x9110, 0x9111, 0x9112, 0x9113, 0x9114, 0x9115, 0x9116, 0x9117,
+ 0x9118, 0x9119, 0x911a, 0x911b, 0x911c, 0x911d, 0x911e, 0x911f,
+ 0x9120, 0x9121, 0x9122, 0x9123, 0x9124, 0x9125, 0x9126, 0x9127,
+ 0x9128, 0x9129, 0x912a, 0x912b, 0x912c, 0x912d, 0x912e, 0x912f,
+ 0x9130, 0x9131, 0x9132, 0x9133, 0x9134, 0x9135, 0x9136, 0x9137,
+ 0x9138, 0x9139, 0x913a, 0x913b, 0x913c, 0x913d, 0x913e, 0x913f,
+ 0x9140, 0x9141, 0x9142, 0x9143, 0x9144, 0x9145, 0x9146, 0x9147,
+ 0x9148, 0x9149, 0x914a, 0x914b, 0x914c, 0x914d, 0x914e, 0x914f,
+ 0x9150, 0x9151, 0x9152, 0x9153, 0x9154, 0x9155, 0x9156, 0x9157,
+ 0x9158, 0x9159, 0x915a, 0x915b, 0x915c, 0x915d, 0x915e, 0x915f,
+ 0x9160, 0x9161, 0x9162, 0x9163, 0x9164, 0x9165, 0x9166, 0x9167,
+ 0x9168, 0x9169, 0x916a, 0x916b, 0x916c, 0x916d, 0x916e, 0x916f,
+ 0x9170, 0x9171, 0x9172, 0x9173, 0x9174, 0x9175, 0x9176, 0x9177,
+ 0x9178, 0x9179, 0x917a, 0x917b, 0x917c, 0x917d, 0x917e, 0x917f,
+ 0x9180, 0x9181, 0x9182, 0x9183, 0x9184, 0x9185, 0x9186, 0x9187,
+ 0x9188, 0x9189, 0x918a, 0x918b, 0x918c, 0x918d, 0x918e, 0x918f,
+ 0x9190, 0x9191, 0x9192, 0x9193, 0x9194, 0x9195, 0x9196, 0x9197,
+ 0x9198, 0x9199, 0x919a, 0x919b, 0x919c, 0x919d, 0x919e, 0x919f,
+ 0x91a0, 0x91a1, 0x91a2, 0x91a3, 0x91a4, 0x91a5, 0x91a6, 0x91a7,
+ 0x91a8, 0x91a9, 0x91aa, 0x91ab, 0x91ac, 0x91ad, 0x91ae, 0x91af,
+ 0x91b0, 0x91b1, 0x91b2, 0x91b3, 0x91b4, 0x91b5, 0x91b6, 0x91b7,
+ 0x91b8, 0x91b9, 0x91ba, 0x91bb, 0x91bc, 0x91bd, 0x91be, 0x91bf,
+ 0x91c0, 0x91c1, 0x91c2, 0x91c3, 0x91c4, 0x91c5, 0x91c6, 0x91c7,
+ 0x91c8, 0x91c9, 0x91ca, 0x91cb, 0x91cc, 0x91cd, 0x91ce, 0x91cf,
+ 0x91d0, 0x91d1, 0x91d2, 0x91d3, 0x91d4, 0x91d5, 0x91d6, 0x91d7,
+ 0x91d8, 0x91d9, 0x91da, 0x91db, 0x91dc, 0x91dd, 0x91de, 0x91df,
+ 0x91e0, 0x91e1, 0x91e2, 0x91e3, 0x91e4, 0x91e5, 0x91e6, 0x91e7,
+ 0x91e8, 0x91e9, 0x91ea, 0x91eb, 0x91ec, 0x91ed, 0x91ee, 0x91ef,
+ 0x91f0, 0x91f1, 0x91f2, 0x91f3, 0x91f4, 0x91f5, 0x91f6, 0x91f7,
+ 0x91f8, 0x91f9, 0x91fa, 0x91fb, 0x91fc, 0x91fd, 0x91fe, 0x91ff,
+ 0x9200, 0x9201, 0x9202, 0x9203, 0x9204, 0x9205, 0x9206, 0x9207,
+ 0x9208, 0x9209, 0x920a, 0x920b, 0x920c, 0x920d, 0x920e, 0x920f,
+ 0x9210, 0x9211, 0x9212, 0x9213, 0x9214, 0x9215, 0x9216, 0x9217,
+ 0x9218, 0x9219, 0x921a, 0x921b, 0x921c, 0x921d, 0x921e, 0x921f,
+ 0x9220, 0x9221, 0x9222, 0x9223, 0x9224, 0x9225, 0x9226, 0x9227,
+ 0x9228, 0x9229, 0x922a, 0x922b, 0x922c, 0x922d, 0x922e, 0x922f,
+ 0x9230, 0x9231, 0x9232, 0x9233, 0x9234, 0x9235, 0x9236, 0x9237,
+ 0x9238, 0x9239, 0x923a, 0x923b, 0x923c, 0x923d, 0x923e, 0x923f,
+ 0x9240, 0x9241, 0x9242, 0x9243, 0x9244, 0x9245, 0x9246, 0x9247,
+ 0x9248, 0x9249, 0x924a, 0x924b, 0x924c, 0x924d, 0x924e, 0x924f,
+ 0x9250, 0x9251, 0x9252, 0x9253, 0x9254, 0x9255, 0x9256, 0x9257,
+ 0x9258, 0x9259, 0x925a, 0x925b, 0x925c, 0x925d, 0x925e, 0x925f,
+ 0x9260, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, 0x9266, 0x9267,
+ 0x9268, 0x9269, 0x926a, 0x926b, 0x926c, 0x926d, 0x926e, 0x926f,
+ 0x9270, 0x9271, 0x9272, 0x9273, 0x9274, 0x9275, 0x9276, 0x9277,
+ 0x9278, 0x9279, 0x927a, 0x927b, 0x927c, 0x927d, 0x927e, 0x927f,
+ 0x9280, 0x9281, 0x9282, 0x9283, 0x9284, 0x9285, 0x9286, 0x9287,
+ 0x9288, 0x9289, 0x928a, 0x928b, 0x928c, 0x928d, 0x928e, 0x928f,
+ 0x9290, 0x9291, 0x9292, 0x9293, 0x9294, 0x9295, 0x9296, 0x9297,
+ 0x9298, 0x9299, 0x929a, 0x929b, 0x929c, 0x929d, 0x929e, 0x929f,
+ 0x92a0, 0x92a1, 0x92a2, 0x92a3, 0x92a4, 0x92a5, 0x92a6, 0x92a7,
+ 0x92a8, 0x92a9, 0x92aa, 0x92ab, 0x92ac, 0x92ad, 0x92ae, 0x92af,
+ 0x92b0, 0x92b1, 0x92b2, 0x92b3, 0x92b4, 0x92b5, 0x92b6, 0x92b7,
+ 0x92b8, 0x92b9, 0x92ba, 0x92bb, 0x92bc, 0x92bd, 0x92be, 0x92bf,
+ 0x92c0, 0x92c1, 0x92c2, 0x92c3, 0x92c4, 0x92c5, 0x92c6, 0x92c7,
+ 0x92c8, 0x92c9, 0x92ca, 0x92cb, 0x92cc, 0x92cd, 0x92ce, 0x92cf,
+ 0x92d0, 0x92d1, 0x92d2, 0x92d3, 0x92d4, 0x92d5, 0x92d6, 0x92d7,
+ 0x92d8, 0x92d9, 0x92da, 0x92db, 0x92dc, 0x92dd, 0x92de, 0x92df,
+ 0x92e0, 0x92e1, 0x92e2, 0x92e3, 0x92e4, 0x92e5, 0x92e6, 0x92e7,
+ 0x92e8, 0x92e9, 0x92ea, 0x92eb, 0x92ec, 0x92ed, 0x92ee, 0x92ef,
+ 0x92f0, 0x92f1, 0x92f2, 0x92f3, 0x92f4, 0x92f5, 0x92f6, 0x92f7,
+ 0x92f8, 0x92f9, 0x92fa, 0x92fb, 0x92fc, 0x92fd, 0x92fe, 0x92ff,
+ 0x9300, 0x9301, 0x9302, 0x9303, 0x9304, 0x9305, 0x9306, 0x9307,
+ 0x9308, 0x9309, 0x930a, 0x930b, 0x930c, 0x930d, 0x930e, 0x930f,
+ 0x9310, 0x9311, 0x9312, 0x9313, 0x9314, 0x9315, 0x9316, 0x9317,
+ 0x9318, 0x9319, 0x931a, 0x931b, 0x931c, 0x931d, 0x931e, 0x931f,
+ 0x9320, 0x9321, 0x9322, 0x9323, 0x9324, 0x9325, 0x9326, 0x9327,
+ 0x9328, 0x9329, 0x932a, 0x932b, 0x932c, 0x932d, 0x932e, 0x932f,
+ 0x9330, 0x9331, 0x9332, 0x9333, 0x9334, 0x9335, 0x9336, 0x9337,
+ 0x9338, 0x9339, 0x933a, 0x933b, 0x933c, 0x933d, 0x933e, 0x933f,
+ 0x9340, 0x9341, 0x9342, 0x9343, 0x9344, 0x9345, 0x9346, 0x9347,
+ 0x9348, 0x9349, 0x934a, 0x934b, 0x934c, 0x934d, 0x934e, 0x934f,
+ 0x9350, 0x9351, 0x9352, 0x9353, 0x9354, 0x9355, 0x9356, 0x9357,
+ 0x9358, 0x9359, 0x935a, 0x935b, 0x935c, 0x935d, 0x935e, 0x935f,
+ 0x9360, 0x9361, 0x9362, 0x9363, 0x9364, 0x9365, 0x9366, 0x9367,
+ 0x9368, 0x9369, 0x936a, 0x936b, 0x936c, 0x936d, 0x936e, 0x936f,
+ 0x9370, 0x9371, 0x9372, 0x9373, 0x9374, 0x9375, 0x9376, 0x9377,
+ 0x9378, 0x9379, 0x937a, 0x937b, 0x937c, 0x937d, 0x937e, 0x937f,
+ 0x9380, 0x9381, 0x9382, 0x9383, 0x9384, 0x9385, 0x9386, 0x9387,
+ 0x9388, 0x9389, 0x938a, 0x938b, 0x938c, 0x938d, 0x938e, 0x938f,
+ 0x9390, 0x9391, 0x9392, 0x9393, 0x9394, 0x9395, 0x9396, 0x9397,
+ 0x9398, 0x9399, 0x939a, 0x939b, 0x939c, 0x939d, 0x939e, 0x939f,
+ 0x93a0, 0x93a1, 0x93a2, 0x93a3, 0x93a4, 0x93a5, 0x93a6, 0x93a7,
+ 0x93a8, 0x93a9, 0x93aa, 0x93ab, 0x93ac, 0x93ad, 0x93ae, 0x93af,
+ 0x93b0, 0x93b1, 0x93b2, 0x93b3, 0x93b4, 0x93b5, 0x93b6, 0x93b7,
+ 0x93b8, 0x93b9, 0x93ba, 0x93bb, 0x93bc, 0x93bd, 0x93be, 0x93bf,
+ 0x93c0, 0x93c1, 0x93c2, 0x93c3, 0x93c4, 0x93c5, 0x93c6, 0x93c7,
+ 0x93c8, 0x93c9, 0x93ca, 0x93cb, 0x93cc, 0x93cd, 0x93ce, 0x93cf,
+ 0x93d0, 0x93d1, 0x93d2, 0x93d3, 0x93d4, 0x93d5, 0x93d6, 0x93d7,
+ 0x93d8, 0x93d9, 0x93da, 0x93db, 0x93dc, 0x93dd, 0x93de, 0x93df,
+ 0x93e0, 0x93e1, 0x93e2, 0x93e3, 0x93e4, 0x93e5, 0x93e6, 0x93e7,
+ 0x93e8, 0x93e9, 0x93ea, 0x93eb, 0x93ec, 0x93ed, 0x93ee, 0x93ef,
+ 0x93f0, 0x93f1, 0x93f2, 0x93f3, 0x93f4, 0x93f5, 0x93f6, 0x93f7,
+ 0x93f8, 0x93f9, 0x93fa, 0x93fb, 0x93fc, 0x93fd, 0x93fe, 0x93ff,
+ 0x9400, 0x9401, 0x9402, 0x9403, 0x9404, 0x9405, 0x9406, 0x9407,
+ 0x9408, 0x9409, 0x940a, 0x940b, 0x940c, 0x940d, 0x940e, 0x940f,
+ 0x9410, 0x9411, 0x9412, 0x9413, 0x9414, 0x9415, 0x9416, 0x9417,
+ 0x9418, 0x9419, 0x941a, 0x941b, 0x941c, 0x941d, 0x941e, 0x941f,
+ 0x9420, 0x9421, 0x9422, 0x9423, 0x9424, 0x9425, 0x9426, 0x9427,
+ 0x9428, 0x9429, 0x942a, 0x942b, 0x942c, 0x942d, 0x942e, 0x942f,
+ 0x9430, 0x9431, 0x9432, 0x9433, 0x9434, 0x9435, 0x9436, 0x9437,
+ 0x9438, 0x9439, 0x943a, 0x943b, 0x943c, 0x943d, 0x943e, 0x943f,
+ 0x9440, 0x9441, 0x9442, 0x9443, 0x9444, 0x9445, 0x9446, 0x9447,
+ 0x9448, 0x9449, 0x944a, 0x944b, 0x944c, 0x944d, 0x944e, 0x944f,
+ 0x9450, 0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457,
+ 0x9458, 0x9459, 0x945a, 0x945b, 0x945c, 0x945d, 0x945e, 0x945f,
+ 0x9460, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467,
+ 0x9468, 0x9469, 0x946a, 0x946b, 0x946c, 0x946d, 0x946e, 0x946f,
+ 0x9470, 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, 0x9476, 0x9477,
+ 0x9478, 0x9479, 0x947a, 0x947b, 0x947c, 0x947d, 0x947e, 0x947f,
+ 0x9480, 0x9481, 0x9482, 0x9483, 0x9484, 0x9485, 0x9486, 0x9487,
+ 0x9488, 0x9489, 0x948a, 0x948b, 0x948c, 0x948d, 0x948e, 0x948f,
+ 0x9490, 0x9491, 0x9492, 0x9493, 0x9494, 0x9495, 0x9496, 0x9497,
+ 0x9498, 0x9499, 0x949a, 0x949b, 0x949c, 0x949d, 0x949e, 0x949f,
+ 0x94a0, 0x94a1, 0x94a2, 0x94a3, 0x94a4, 0x94a5, 0x94a6, 0x94a7,
+ 0x94a8, 0x94a9, 0x94aa, 0x94ab, 0x94ac, 0x94ad, 0x94ae, 0x94af,
+ 0x94b0, 0x94b1, 0x94b2, 0x94b3, 0x94b4, 0x94b5, 0x94b6, 0x94b7,
+ 0x94b8, 0x94b9, 0x94ba, 0x94bb, 0x94bc, 0x94bd, 0x94be, 0x94bf,
+ 0x94c0, 0x94c1, 0x94c2, 0x94c3, 0x94c4, 0x94c5, 0x94c6, 0x94c7,
+ 0x94c8, 0x94c9, 0x94ca, 0x94cb, 0x94cc, 0x94cd, 0x94ce, 0x94cf,
+ 0x94d0, 0x94d1, 0x94d2, 0x94d3, 0x94d4, 0x94d5, 0x94d6, 0x94d7,
+ 0x94d8, 0x94d9, 0x94da, 0x94db, 0x94dc, 0x94dd, 0x94de, 0x94df,
+ 0x94e0, 0x94e1, 0x94e2, 0x94e3, 0x94e4, 0x94e5, 0x94e6, 0x94e7,
+ 0x94e8, 0x94e9, 0x94ea, 0x94eb, 0x94ec, 0x94ed, 0x94ee, 0x94ef,
+ 0x94f0, 0x94f1, 0x94f2, 0x94f3, 0x94f4, 0x94f5, 0x94f6, 0x94f7,
+ 0x94f8, 0x94f9, 0x94fa, 0x94fb, 0x94fc, 0x94fd, 0x94fe, 0x94ff,
+ 0x9500, 0x9501, 0x9502, 0x9503, 0x9504, 0x9505, 0x9506, 0x9507,
+ 0x9508, 0x9509, 0x950a, 0x950b, 0x950c, 0x950d, 0x950e, 0x950f,
+ 0x9510, 0x9511, 0x9512, 0x9513, 0x9514, 0x9515, 0x9516, 0x9517,
+ 0x9518, 0x9519, 0x951a, 0x951b, 0x951c, 0x951d, 0x951e, 0x951f,
+ 0x9520, 0x9521, 0x9522, 0x9523, 0x9524, 0x9525, 0x9526, 0x9527,
+ 0x9528, 0x9529, 0x952a, 0x952b, 0x952c, 0x952d, 0x952e, 0x952f,
+ 0x9530, 0x9531, 0x9532, 0x9533, 0x9534, 0x9535, 0x9536, 0x9537,
+ 0x9538, 0x9539, 0x953a, 0x953b, 0x953c, 0x953d, 0x953e, 0x953f,
+ 0x9540, 0x9541, 0x9542, 0x9543, 0x9544, 0x9545, 0x9546, 0x9547,
+ 0x9548, 0x9549, 0x954a, 0x954b, 0x954c, 0x954d, 0x954e, 0x954f,
+ 0x9550, 0x9551, 0x9552, 0x9553, 0x9554, 0x9555, 0x9556, 0x9557,
+ 0x9558, 0x9559, 0x955a, 0x955b, 0x955c, 0x955d, 0x955e, 0x955f,
+ 0x9560, 0x9561, 0x9562, 0x9563, 0x9564, 0x9565, 0x9566, 0x9567,
+ 0x9568, 0x9569, 0x956a, 0x956b, 0x956c, 0x956d, 0x956e, 0x956f,
+ 0x9570, 0x9571, 0x9572, 0x9573, 0x9574, 0x9575, 0x9576, 0x9577,
+ 0x9578, 0x9579, 0x957a, 0x957b, 0x957c, 0x957d, 0x957e, 0x957f,
+ 0x9580, 0x9581, 0x9582, 0x9583, 0x9584, 0x9585, 0x9586, 0x9587,
+ 0x9588, 0x9589, 0x958a, 0x958b, 0x958c, 0x958d, 0x958e, 0x958f,
+ 0x9590, 0x9591, 0x9592, 0x9593, 0x9594, 0x9595, 0x9596, 0x9597,
+ 0x9598, 0x9599, 0x959a, 0x959b, 0x959c, 0x959d, 0x959e, 0x959f,
+ 0x95a0, 0x95a1, 0x95a2, 0x95a3, 0x95a4, 0x95a5, 0x95a6, 0x95a7,
+ 0x95a8, 0x95a9, 0x95aa, 0x95ab, 0x95ac, 0x95ad, 0x95ae, 0x95af,
+ 0x95b0, 0x95b1, 0x95b2, 0x95b3, 0x95b4, 0x95b5, 0x95b6, 0x95b7,
+ 0x95b8, 0x95b9, 0x95ba, 0x95bb, 0x95bc, 0x95bd, 0x95be, 0x95bf,
+ 0x95c0, 0x95c1, 0x95c2, 0x95c3, 0x95c4, 0x95c5, 0x95c6, 0x95c7,
+ 0x95c8, 0x95c9, 0x95ca, 0x95cb, 0x95cc, 0x95cd, 0x95ce, 0x95cf,
+ 0x95d0, 0x95d1, 0x95d2, 0x95d3, 0x95d4, 0x95d5, 0x95d6, 0x95d7,
+ 0x95d8, 0x95d9, 0x95da, 0x95db, 0x95dc, 0x95dd, 0x95de, 0x95df,
+ 0x95e0, 0x95e1, 0x95e2, 0x95e3, 0x95e4, 0x95e5, 0x95e6, 0x95e7,
+ 0x95e8, 0x95e9, 0x95ea, 0x95eb, 0x95ec, 0x95ed, 0x95ee, 0x95ef,
+ 0x95f0, 0x95f1, 0x95f2, 0x95f3, 0x95f4, 0x95f5, 0x95f6, 0x95f7,
+ 0x95f8, 0x95f9, 0x95fa, 0x95fb, 0x95fc, 0x95fd, 0x95fe, 0x95ff,
+ 0x9600, 0x9601, 0x9602, 0x9603, 0x9604, 0x9605, 0x9606, 0x9607,
+ 0x9608, 0x9609, 0x960a, 0x960b, 0x960c, 0x960d, 0x960e, 0x960f,
+ 0x9610, 0x9611, 0x9612, 0x9613, 0x9614, 0x9615, 0x9616, 0x9617,
+ 0x9618, 0x9619, 0x961a, 0x961b, 0x961c, 0x961d, 0x961e, 0x961f,
+ 0x9620, 0x9621, 0x9622, 0x9623, 0x9624, 0x9625, 0x9626, 0x9627,
+ 0x9628, 0x9629, 0x962a, 0x962b, 0x962c, 0x962d, 0x962e, 0x962f,
+ 0x9630, 0x9631, 0x9632, 0x9633, 0x9634, 0x9635, 0x9636, 0x9637,
+ 0x9638, 0x9639, 0x963a, 0x963b, 0x963c, 0x963d, 0x963e, 0x963f,
+ 0x9640, 0x9641, 0x9642, 0x9643, 0x9644, 0x9645, 0x9646, 0x9647,
+ 0x9648, 0x9649, 0x964a, 0x964b, 0x964c, 0x964d, 0x964e, 0x964f,
+ 0x9650, 0x9651, 0x9652, 0x9653, 0x9654, 0x9655, 0x9656, 0x9657,
+ 0x9658, 0x9659, 0x965a, 0x965b, 0x965c, 0x965d, 0x965e, 0x965f,
+ 0x9660, 0x9661, 0x9662, 0x9663, 0x9664, 0x9665, 0x9666, 0x9667,
+ 0x9668, 0x9669, 0x966a, 0x966b, 0x966c, 0x966d, 0x966e, 0x966f,
+ 0x9670, 0x9671, 0x9672, 0x9673, 0x9674, 0x9675, 0x9676, 0x9677,
+ 0x9678, 0x9679, 0x967a, 0x967b, 0x967c, 0x967d, 0x967e, 0x967f,
+ 0x9680, 0x9681, 0x9682, 0x9683, 0x9684, 0x9685, 0x9686, 0x9687,
+ 0x9688, 0x9689, 0x968a, 0x968b, 0x968c, 0x968d, 0x968e, 0x968f,
+ 0x9690, 0x9691, 0x9692, 0x9693, 0x9694, 0x9695, 0x9696, 0x9697,
+ 0x9698, 0x9699, 0x969a, 0x969b, 0x969c, 0x969d, 0x969e, 0x969f,
+ 0x96a0, 0x96a1, 0x96a2, 0x96a3, 0x96a4, 0x96a5, 0x96a6, 0x96a7,
+ 0x96a8, 0x96a9, 0x96aa, 0x96ab, 0x96ac, 0x96ad, 0x96ae, 0x96af,
+ 0x96b0, 0x96b1, 0x96b2, 0x96b3, 0x96b4, 0x96b5, 0x96b6, 0x96b7,
+ 0x96b8, 0x96b9, 0x96ba, 0x96bb, 0x96bc, 0x96bd, 0x96be, 0x96bf,
+ 0x96c0, 0x96c1, 0x96c2, 0x96c3, 0x96c4, 0x96c5, 0x96c6, 0x96c7,
+ 0x96c8, 0x96c9, 0x96ca, 0x96cb, 0x96cc, 0x96cd, 0x96ce, 0x96cf,
+ 0x96d0, 0x96d1, 0x96d2, 0x96d3, 0x96d4, 0x96d5, 0x96d6, 0x96d7,
+ 0x96d8, 0x96d9, 0x96da, 0x96db, 0x96dc, 0x96dd, 0x96de, 0x96df,
+ 0x96e0, 0x96e1, 0x96e2, 0x96e3, 0x96e4, 0x96e5, 0x96e6, 0x96e7,
+ 0x96e8, 0x96e9, 0x96ea, 0x96eb, 0x96ec, 0x96ed, 0x96ee, 0x96ef,
+ 0x96f0, 0x96f1, 0x96f2, 0x96f3, 0x96f4, 0x96f5, 0x96f6, 0x96f7,
+ 0x96f8, 0x96f9, 0x96fa, 0x96fb, 0x96fc, 0x96fd, 0x96fe, 0x96ff,
+ 0x9700, 0x9701, 0x9702, 0x9703, 0x9704, 0x9705, 0x9706, 0x9707,
+ 0x9708, 0x9709, 0x970a, 0x970b, 0x970c, 0x970d, 0x970e, 0x970f,
+ 0x9710, 0x9711, 0x9712, 0x9713, 0x9714, 0x9715, 0x9716, 0x9717,
+ 0x9718, 0x9719, 0x971a, 0x971b, 0x971c, 0x971d, 0x971e, 0x971f,
+ 0x9720, 0x9721, 0x9722, 0x9723, 0x9724, 0x9725, 0x9726, 0x9727,
+ 0x9728, 0x9729, 0x972a, 0x972b, 0x972c, 0x972d, 0x972e, 0x972f,
+ 0x9730, 0x9731, 0x9732, 0x9733, 0x9734, 0x9735, 0x9736, 0x9737,
+ 0x9738, 0x9739, 0x973a, 0x973b, 0x973c, 0x973d, 0x973e, 0x973f,
+ 0x9740, 0x9741, 0x9742, 0x9743, 0x9744, 0x9745, 0x9746, 0x9747,
+ 0x9748, 0x9749, 0x974a, 0x974b, 0x974c, 0x974d, 0x974e, 0x974f,
+ 0x9750, 0x9751, 0x9752, 0x9753, 0x9754, 0x9755, 0x9756, 0x9757,
+ 0x9758, 0x9759, 0x975a, 0x975b, 0x975c, 0x975d, 0x975e, 0x975f,
+ 0x9760, 0x9761, 0x9762, 0x9763, 0x9764, 0x9765, 0x9766, 0x9767,
+ 0x9768, 0x9769, 0x976a, 0x976b, 0x976c, 0x976d, 0x976e, 0x976f,
+ 0x9770, 0x9771, 0x9772, 0x9773, 0x9774, 0x9775, 0x9776, 0x9777,
+ 0x9778, 0x9779, 0x977a, 0x977b, 0x977c, 0x977d, 0x977e, 0x977f,
+ 0x9780, 0x9781, 0x9782, 0x9783, 0x9784, 0x9785, 0x9786, 0x9787,
+ 0x9788, 0x9789, 0x978a, 0x978b, 0x978c, 0x978d, 0x978e, 0x978f,
+ 0x9790, 0x9791, 0x9792, 0x9793, 0x9794, 0x9795, 0x9796, 0x9797,
+ 0x9798, 0x9799, 0x979a, 0x979b, 0x979c, 0x979d, 0x979e, 0x979f,
+ 0x97a0, 0x97a1, 0x97a2, 0x97a3, 0x97a4, 0x97a5, 0x97a6, 0x97a7,
+ 0x97a8, 0x97a9, 0x97aa, 0x97ab, 0x97ac, 0x97ad, 0x97ae, 0x97af,
+ 0x97b0, 0x97b1, 0x97b2, 0x97b3, 0x97b4, 0x97b5, 0x97b6, 0x97b7,
+ 0x97b8, 0x97b9, 0x97ba, 0x97bb, 0x97bc, 0x97bd, 0x97be, 0x97bf,
+ 0x97c0, 0x97c1, 0x97c2, 0x97c3, 0x97c4, 0x97c5, 0x97c6, 0x97c7,
+ 0x97c8, 0x97c9, 0x97ca, 0x97cb, 0x97cc, 0x97cd, 0x97ce, 0x97cf,
+ 0x97d0, 0x97d1, 0x97d2, 0x97d3, 0x97d4, 0x97d5, 0x97d6, 0x97d7,
+ 0x97d8, 0x97d9, 0x97da, 0x97db, 0x97dc, 0x97dd, 0x97de, 0x97df,
+ 0x97e0, 0x97e1, 0x97e2, 0x97e3, 0x97e4, 0x97e5, 0x97e6, 0x97e7,
+ 0x97e8, 0x97e9, 0x97ea, 0x97eb, 0x97ec, 0x97ed, 0x97ee, 0x97ef,
+ 0x97f0, 0x97f1, 0x97f2, 0x97f3, 0x97f4, 0x97f5, 0x97f6, 0x97f7,
+ 0x97f8, 0x97f9, 0x97fa, 0x97fb, 0x97fc, 0x97fd, 0x97fe, 0x97ff,
+ 0x9800, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9806, 0x9807,
+ 0x9808, 0x9809, 0x980a, 0x980b, 0x980c, 0x980d, 0x980e, 0x980f,
+ 0x9810, 0x9811, 0x9812, 0x9813, 0x9814, 0x9815, 0x9816, 0x9817,
+ 0x9818, 0x9819, 0x981a, 0x981b, 0x981c, 0x981d, 0x981e, 0x981f,
+ 0x9820, 0x9821, 0x9822, 0x9823, 0x9824, 0x9825, 0x9826, 0x9827,
+ 0x9828, 0x9829, 0x982a, 0x982b, 0x982c, 0x982d, 0x982e, 0x982f,
+ 0x9830, 0x9831, 0x9832, 0x9833, 0x9834, 0x9835, 0x9836, 0x9837,
+ 0x9838, 0x9839, 0x983a, 0x983b, 0x983c, 0x983d, 0x983e, 0x983f,
+ 0x9840, 0x9841, 0x9842, 0x9843, 0x9844, 0x9845, 0x9846, 0x9847,
+ 0x9848, 0x9849, 0x984a, 0x984b, 0x984c, 0x984d, 0x984e, 0x984f,
+ 0x9850, 0x9851, 0x9852, 0x9853, 0x9854, 0x9855, 0x9856, 0x9857,
+ 0x9858, 0x9859, 0x985a, 0x985b, 0x985c, 0x985d, 0x985e, 0x985f,
+ 0x9860, 0x9861, 0x9862, 0x9863, 0x9864, 0x9865, 0x9866, 0x9867,
+ 0x9868, 0x9869, 0x986a, 0x986b, 0x986c, 0x986d, 0x986e, 0x986f,
+ 0x9870, 0x9871, 0x9872, 0x9873, 0x9874, 0x9875, 0x9876, 0x9877,
+ 0x9878, 0x9879, 0x987a, 0x987b, 0x987c, 0x987d, 0x987e, 0x987f,
+ 0x9880, 0x9881, 0x9882, 0x9883, 0x9884, 0x9885, 0x9886, 0x9887,
+ 0x9888, 0x9889, 0x988a, 0x988b, 0x988c, 0x988d, 0x988e, 0x988f,
+ 0x9890, 0x9891, 0x9892, 0x9893, 0x9894, 0x9895, 0x9896, 0x9897,
+ 0x9898, 0x9899, 0x989a, 0x989b, 0x989c, 0x989d, 0x989e, 0x989f,
+ 0x98a0, 0x98a1, 0x98a2, 0x98a3, 0x98a4, 0x98a5, 0x98a6, 0x98a7,
+ 0x98a8, 0x98a9, 0x98aa, 0x98ab, 0x98ac, 0x98ad, 0x98ae, 0x98af,
+ 0x98b0, 0x98b1, 0x98b2, 0x98b3, 0x98b4, 0x98b5, 0x98b6, 0x98b7,
+ 0x98b8, 0x98b9, 0x98ba, 0x98bb, 0x98bc, 0x98bd, 0x98be, 0x98bf,
+ 0x98c0, 0x98c1, 0x98c2, 0x98c3, 0x98c4, 0x98c5, 0x98c6, 0x98c7,
+ 0x98c8, 0x98c9, 0x98ca, 0x98cb, 0x98cc, 0x98cd, 0x98ce, 0x98cf,
+ 0x98d0, 0x98d1, 0x98d2, 0x98d3, 0x98d4, 0x98d5, 0x98d6, 0x98d7,
+ 0x98d8, 0x98d9, 0x98da, 0x98db, 0x98dc, 0x98dd, 0x98de, 0x98df,
+ 0x98e0, 0x98e1, 0x98e2, 0x98e3, 0x98e4, 0x98e5, 0x98e6, 0x98e7,
+ 0x98e8, 0x98e9, 0x98ea, 0x98eb, 0x98ec, 0x98ed, 0x98ee, 0x98ef,
+ 0x98f0, 0x98f1, 0x98f2, 0x98f3, 0x98f4, 0x98f5, 0x98f6, 0x98f7,
+ 0x98f8, 0x98f9, 0x98fa, 0x98fb, 0x98fc, 0x98fd, 0x98fe, 0x98ff,
+ 0x9900, 0x9901, 0x9902, 0x9903, 0x9904, 0x9905, 0x9906, 0x9907,
+ 0x9908, 0x9909, 0x990a, 0x990b, 0x990c, 0x990d, 0x990e, 0x990f,
+ 0x9910, 0x9911, 0x9912, 0x9913, 0x9914, 0x9915, 0x9916, 0x9917,
+ 0x9918, 0x9919, 0x991a, 0x991b, 0x991c, 0x991d, 0x991e, 0x991f,
+ 0x9920, 0x9921, 0x9922, 0x9923, 0x9924, 0x9925, 0x9926, 0x9927,
+ 0x9928, 0x9929, 0x992a, 0x992b, 0x992c, 0x992d, 0x992e, 0x992f,
+ 0x9930, 0x9931, 0x9932, 0x9933, 0x9934, 0x9935, 0x9936, 0x9937,
+ 0x9938, 0x9939, 0x993a, 0x993b, 0x993c, 0x993d, 0x993e, 0x993f,
+ 0x9940, 0x9941, 0x9942, 0x9943, 0x9944, 0x9945, 0x9946, 0x9947,
+ 0x9948, 0x9949, 0x994a, 0x994b, 0x994c, 0x994d, 0x994e, 0x994f,
+ 0x9950, 0x9951, 0x9952, 0x9953, 0x9954, 0x9955, 0x9956, 0x9957,
+ 0x9958, 0x9959, 0x995a, 0x995b, 0x995c, 0x995d, 0x995e, 0x995f,
+ 0x9960, 0x9961, 0x9962, 0x9963, 0x9964, 0x9965, 0x9966, 0x9967,
+ 0x9968, 0x9969, 0x996a, 0x996b, 0x996c, 0x996d, 0x996e, 0x996f,
+ 0x9970, 0x9971, 0x9972, 0x9973, 0x9974, 0x9975, 0x9976, 0x9977,
+ 0x9978, 0x9979, 0x997a, 0x997b, 0x997c, 0x997d, 0x997e, 0x997f,
+ 0x9980, 0x9981, 0x9982, 0x9983, 0x9984, 0x9985, 0x9986, 0x9987,
+ 0x9988, 0x9989, 0x998a, 0x998b, 0x998c, 0x998d, 0x998e, 0x998f,
+ 0x9990, 0x9991, 0x9992, 0x9993, 0x9994, 0x9995, 0x9996, 0x9997,
+ 0x9998, 0x9999, 0x999a, 0x999b, 0x999c, 0x999d, 0x999e, 0x999f,
+ 0x99a0, 0x99a1, 0x99a2, 0x99a3, 0x99a4, 0x99a5, 0x99a6, 0x99a7,
+ 0x99a8, 0x99a9, 0x99aa, 0x99ab, 0x99ac, 0x99ad, 0x99ae, 0x99af,
+ 0x99b0, 0x99b1, 0x99b2, 0x99b3, 0x99b4, 0x99b5, 0x99b6, 0x99b7,
+ 0x99b8, 0x99b9, 0x99ba, 0x99bb, 0x99bc, 0x99bd, 0x99be, 0x99bf,
+ 0x99c0, 0x99c1, 0x99c2, 0x99c3, 0x99c4, 0x99c5, 0x99c6, 0x99c7,
+ 0x99c8, 0x99c9, 0x99ca, 0x99cb, 0x99cc, 0x99cd, 0x99ce, 0x99cf,
+ 0x99d0, 0x99d1, 0x99d2, 0x99d3, 0x99d4, 0x99d5, 0x99d6, 0x99d7,
+ 0x99d8, 0x99d9, 0x99da, 0x99db, 0x99dc, 0x99dd, 0x99de, 0x99df,
+ 0x99e0, 0x99e1, 0x99e2, 0x99e3, 0x99e4, 0x99e5, 0x99e6, 0x99e7,
+ 0x99e8, 0x99e9, 0x99ea, 0x99eb, 0x99ec, 0x99ed, 0x99ee, 0x99ef,
+ 0x99f0, 0x99f1, 0x99f2, 0x99f3, 0x99f4, 0x99f5, 0x99f6, 0x99f7,
+ 0x99f8, 0x99f9, 0x99fa, 0x99fb, 0x99fc, 0x99fd, 0x99fe, 0x99ff,
+ 0x9a00, 0x9a01, 0x9a02, 0x9a03, 0x9a04, 0x9a05, 0x9a06, 0x9a07,
+ 0x9a08, 0x9a09, 0x9a0a, 0x9a0b, 0x9a0c, 0x9a0d, 0x9a0e, 0x9a0f,
+ 0x9a10, 0x9a11, 0x9a12, 0x9a13, 0x9a14, 0x9a15, 0x9a16, 0x9a17,
+ 0x9a18, 0x9a19, 0x9a1a, 0x9a1b, 0x9a1c, 0x9a1d, 0x9a1e, 0x9a1f,
+ 0x9a20, 0x9a21, 0x9a22, 0x9a23, 0x9a24, 0x9a25, 0x9a26, 0x9a27,
+ 0x9a28, 0x9a29, 0x9a2a, 0x9a2b, 0x9a2c, 0x9a2d, 0x9a2e, 0x9a2f,
+ 0x9a30, 0x9a31, 0x9a32, 0x9a33, 0x9a34, 0x9a35, 0x9a36, 0x9a37,
+ 0x9a38, 0x9a39, 0x9a3a, 0x9a3b, 0x9a3c, 0x9a3d, 0x9a3e, 0x9a3f,
+ 0x9a40, 0x9a41, 0x9a42, 0x9a43, 0x9a44, 0x9a45, 0x9a46, 0x9a47,
+ 0x9a48, 0x9a49, 0x9a4a, 0x9a4b, 0x9a4c, 0x9a4d, 0x9a4e, 0x9a4f,
+ 0x9a50, 0x9a51, 0x9a52, 0x9a53, 0x9a54, 0x9a55, 0x9a56, 0x9a57,
+ 0x9a58, 0x9a59, 0x9a5a, 0x9a5b, 0x9a5c, 0x9a5d, 0x9a5e, 0x9a5f,
+ 0x9a60, 0x9a61, 0x9a62, 0x9a63, 0x9a64, 0x9a65, 0x9a66, 0x9a67,
+ 0x9a68, 0x9a69, 0x9a6a, 0x9a6b, 0x9a6c, 0x9a6d, 0x9a6e, 0x9a6f,
+ 0x9a70, 0x9a71, 0x9a72, 0x9a73, 0x9a74, 0x9a75, 0x9a76, 0x9a77,
+ 0x9a78, 0x9a79, 0x9a7a, 0x9a7b, 0x9a7c, 0x9a7d, 0x9a7e, 0x9a7f,
+ 0x9a80, 0x9a81, 0x9a82, 0x9a83, 0x9a84, 0x9a85, 0x9a86, 0x9a87,
+ 0x9a88, 0x9a89, 0x9a8a, 0x9a8b, 0x9a8c, 0x9a8d, 0x9a8e, 0x9a8f,
+ 0x9a90, 0x9a91, 0x9a92, 0x9a93, 0x9a94, 0x9a95, 0x9a96, 0x9a97,
+ 0x9a98, 0x9a99, 0x9a9a, 0x9a9b, 0x9a9c, 0x9a9d, 0x9a9e, 0x9a9f,
+ 0x9aa0, 0x9aa1, 0x9aa2, 0x9aa3, 0x9aa4, 0x9aa5, 0x9aa6, 0x9aa7,
+ 0x9aa8, 0x9aa9, 0x9aaa, 0x9aab, 0x9aac, 0x9aad, 0x9aae, 0x9aaf,
+ 0x9ab0, 0x9ab1, 0x9ab2, 0x9ab3, 0x9ab4, 0x9ab5, 0x9ab6, 0x9ab7,
+ 0x9ab8, 0x9ab9, 0x9aba, 0x9abb, 0x9abc, 0x9abd, 0x9abe, 0x9abf,
+ 0x9ac0, 0x9ac1, 0x9ac2, 0x9ac3, 0x9ac4, 0x9ac5, 0x9ac6, 0x9ac7,
+ 0x9ac8, 0x9ac9, 0x9aca, 0x9acb, 0x9acc, 0x9acd, 0x9ace, 0x9acf,
+ 0x9ad0, 0x9ad1, 0x9ad2, 0x9ad3, 0x9ad4, 0x9ad5, 0x9ad6, 0x9ad7,
+ 0x9ad8, 0x9ad9, 0x9ada, 0x9adb, 0x9adc, 0x9add, 0x9ade, 0x9adf,
+ 0x9ae0, 0x9ae1, 0x9ae2, 0x9ae3, 0x9ae4, 0x9ae5, 0x9ae6, 0x9ae7,
+ 0x9ae8, 0x9ae9, 0x9aea, 0x9aeb, 0x9aec, 0x9aed, 0x9aee, 0x9aef,
+ 0x9af0, 0x9af1, 0x9af2, 0x9af3, 0x9af4, 0x9af5, 0x9af6, 0x9af7,
+ 0x9af8, 0x9af9, 0x9afa, 0x9afb, 0x9afc, 0x9afd, 0x9afe, 0x9aff,
+ 0x9b00, 0x9b01, 0x9b02, 0x9b03, 0x9b04, 0x9b05, 0x9b06, 0x9b07,
+ 0x9b08, 0x9b09, 0x9b0a, 0x9b0b, 0x9b0c, 0x9b0d, 0x9b0e, 0x9b0f,
+ 0x9b10, 0x9b11, 0x9b12, 0x9b13, 0x9b14, 0x9b15, 0x9b16, 0x9b17,
+ 0x9b18, 0x9b19, 0x9b1a, 0x9b1b, 0x9b1c, 0x9b1d, 0x9b1e, 0x9b1f,
+ 0x9b20, 0x9b21, 0x9b22, 0x9b23, 0x9b24, 0x9b25, 0x9b26, 0x9b27,
+ 0x9b28, 0x9b29, 0x9b2a, 0x9b2b, 0x9b2c, 0x9b2d, 0x9b2e, 0x9b2f,
+ 0x9b30, 0x9b31, 0x9b32, 0x9b33, 0x9b34, 0x9b35, 0x9b36, 0x9b37,
+ 0x9b38, 0x9b39, 0x9b3a, 0x9b3b, 0x9b3c, 0x9b3d, 0x9b3e, 0x9b3f,
+ 0x9b40, 0x9b41, 0x9b42, 0x9b43, 0x9b44, 0x9b45, 0x9b46, 0x9b47,
+ 0x9b48, 0x9b49, 0x9b4a, 0x9b4b, 0x9b4c, 0x9b4d, 0x9b4e, 0x9b4f,
+ 0x9b50, 0x9b51, 0x9b52, 0x9b53, 0x9b54, 0x9b55, 0x9b56, 0x9b57,
+ 0x9b58, 0x9b59, 0x9b5a, 0x9b5b, 0x9b5c, 0x9b5d, 0x9b5e, 0x9b5f,
+ 0x9b60, 0x9b61, 0x9b62, 0x9b63, 0x9b64, 0x9b65, 0x9b66, 0x9b67,
+ 0x9b68, 0x9b69, 0x9b6a, 0x9b6b, 0x9b6c, 0x9b6d, 0x9b6e, 0x9b6f,
+ 0x9b70, 0x9b71, 0x9b72, 0x9b73, 0x9b74, 0x9b75, 0x9b76, 0x9b77,
+ 0x9b78, 0x9b79, 0x9b7a, 0x9b7b, 0x9b7c, 0x9b7d, 0x9b7e, 0x9b7f,
+ 0x9b80, 0x9b81, 0x9b82, 0x9b83, 0x9b84, 0x9b85, 0x9b86, 0x9b87,
+ 0x9b88, 0x9b89, 0x9b8a, 0x9b8b, 0x9b8c, 0x9b8d, 0x9b8e, 0x9b8f,
+ 0x9b90, 0x9b91, 0x9b92, 0x9b93, 0x9b94, 0x9b95, 0x9b96, 0x9b97,
+ 0x9b98, 0x9b99, 0x9b9a, 0x9b9b, 0x9b9c, 0x9b9d, 0x9b9e, 0x9b9f,
+ 0x9ba0, 0x9ba1, 0x9ba2, 0x9ba3, 0x9ba4, 0x9ba5, 0x9ba6, 0x9ba7,
+ 0x9ba8, 0x9ba9, 0x9baa, 0x9bab, 0x9bac, 0x9bad, 0x9bae, 0x9baf,
+ 0x9bb0, 0x9bb1, 0x9bb2, 0x9bb3, 0x9bb4, 0x9bb5, 0x9bb6, 0x9bb7,
+ 0x9bb8, 0x9bb9, 0x9bba, 0x9bbb, 0x9bbc, 0x9bbd, 0x9bbe, 0x9bbf,
+ 0x9bc0, 0x9bc1, 0x9bc2, 0x9bc3, 0x9bc4, 0x9bc5, 0x9bc6, 0x9bc7,
+ 0x9bc8, 0x9bc9, 0x9bca, 0x9bcb, 0x9bcc, 0x9bcd, 0x9bce, 0x9bcf,
+ 0x9bd0, 0x9bd1, 0x9bd2, 0x9bd3, 0x9bd4, 0x9bd5, 0x9bd6, 0x9bd7,
+ 0x9bd8, 0x9bd9, 0x9bda, 0x9bdb, 0x9bdc, 0x9bdd, 0x9bde, 0x9bdf,
+ 0x9be0, 0x9be1, 0x9be2, 0x9be3, 0x9be4, 0x9be5, 0x9be6, 0x9be7,
+ 0x9be8, 0x9be9, 0x9bea, 0x9beb, 0x9bec, 0x9bed, 0x9bee, 0x9bef,
+ 0x9bf0, 0x9bf1, 0x9bf2, 0x9bf3, 0x9bf4, 0x9bf5, 0x9bf6, 0x9bf7,
+ 0x9bf8, 0x9bf9, 0x9bfa, 0x9bfb, 0x9bfc, 0x9bfd, 0x9bfe, 0x9bff,
+ 0x9c00, 0x9c01, 0x9c02, 0x9c03, 0x9c04, 0x9c05, 0x9c06, 0x9c07,
+ 0x9c08, 0x9c09, 0x9c0a, 0x9c0b, 0x9c0c, 0x9c0d, 0x9c0e, 0x9c0f,
+ 0x9c10, 0x9c11, 0x9c12, 0x9c13, 0x9c14, 0x9c15, 0x9c16, 0x9c17,
+ 0x9c18, 0x9c19, 0x9c1a, 0x9c1b, 0x9c1c, 0x9c1d, 0x9c1e, 0x9c1f,
+ 0x9c20, 0x9c21, 0x9c22, 0x9c23, 0x9c24, 0x9c25, 0x9c26, 0x9c27,
+ 0x9c28, 0x9c29, 0x9c2a, 0x9c2b, 0x9c2c, 0x9c2d, 0x9c2e, 0x9c2f,
+ 0x9c30, 0x9c31, 0x9c32, 0x9c33, 0x9c34, 0x9c35, 0x9c36, 0x9c37,
+ 0x9c38, 0x9c39, 0x9c3a, 0x9c3b, 0x9c3c, 0x9c3d, 0x9c3e, 0x9c3f,
+ 0x9c40, 0x9c41, 0x9c42, 0x9c43, 0x9c44, 0x9c45, 0x9c46, 0x9c47,
+ 0x9c48, 0x9c49, 0x9c4a, 0x9c4b, 0x9c4c, 0x9c4d, 0x9c4e, 0x9c4f,
+ 0x9c50, 0x9c51, 0x9c52, 0x9c53, 0x9c54, 0x9c55, 0x9c56, 0x9c57,
+ 0x9c58, 0x9c59, 0x9c5a, 0x9c5b, 0x9c5c, 0x9c5d, 0x9c5e, 0x9c5f,
+ 0x9c60, 0x9c61, 0x9c62, 0x9c63, 0x9c64, 0x9c65, 0x9c66, 0x9c67,
+ 0x9c68, 0x9c69, 0x9c6a, 0x9c6b, 0x9c6c, 0x9c6d, 0x9c6e, 0x9c6f,
+ 0x9c70, 0x9c71, 0x9c72, 0x9c73, 0x9c74, 0x9c75, 0x9c76, 0x9c77,
+ 0x9c78, 0x9c79, 0x9c7a, 0x9c7b, 0x9c7c, 0x9c7d, 0x9c7e, 0x9c7f,
+ 0x9c80, 0x9c81, 0x9c82, 0x9c83, 0x9c84, 0x9c85, 0x9c86, 0x9c87,
+ 0x9c88, 0x9c89, 0x9c8a, 0x9c8b, 0x9c8c, 0x9c8d, 0x9c8e, 0x9c8f,
+ 0x9c90, 0x9c91, 0x9c92, 0x9c93, 0x9c94, 0x9c95, 0x9c96, 0x9c97,
+ 0x9c98, 0x9c99, 0x9c9a, 0x9c9b, 0x9c9c, 0x9c9d, 0x9c9e, 0x9c9f,
+ 0x9ca0, 0x9ca1, 0x9ca2, 0x9ca3, 0x9ca4, 0x9ca5, 0x9ca6, 0x9ca7,
+ 0x9ca8, 0x9ca9, 0x9caa, 0x9cab, 0x9cac, 0x9cad, 0x9cae, 0x9caf,
+ 0x9cb0, 0x9cb1, 0x9cb2, 0x9cb3, 0x9cb4, 0x9cb5, 0x9cb6, 0x9cb7,
+ 0x9cb8, 0x9cb9, 0x9cba, 0x9cbb, 0x9cbc, 0x9cbd, 0x9cbe, 0x9cbf,
+ 0x9cc0, 0x9cc1, 0x9cc2, 0x9cc3, 0x9cc4, 0x9cc5, 0x9cc6, 0x9cc7,
+ 0x9cc8, 0x9cc9, 0x9cca, 0x9ccb, 0x9ccc, 0x9ccd, 0x9cce, 0x9ccf,
+ 0x9cd0, 0x9cd1, 0x9cd2, 0x9cd3, 0x9cd4, 0x9cd5, 0x9cd6, 0x9cd7,
+ 0x9cd8, 0x9cd9, 0x9cda, 0x9cdb, 0x9cdc, 0x9cdd, 0x9cde, 0x9cdf,
+ 0x9ce0, 0x9ce1, 0x9ce2, 0x9ce3, 0x9ce4, 0x9ce5, 0x9ce6, 0x9ce7,
+ 0x9ce8, 0x9ce9, 0x9cea, 0x9ceb, 0x9cec, 0x9ced, 0x9cee, 0x9cef,
+ 0x9cf0, 0x9cf1, 0x9cf2, 0x9cf3, 0x9cf4, 0x9cf5, 0x9cf6, 0x9cf7,
+ 0x9cf8, 0x9cf9, 0x9cfa, 0x9cfb, 0x9cfc, 0x9cfd, 0x9cfe, 0x9cff,
+ 0x9d00, 0x9d01, 0x9d02, 0x9d03, 0x9d04, 0x9d05, 0x9d06, 0x9d07,
+ 0x9d08, 0x9d09, 0x9d0a, 0x9d0b, 0x9d0c, 0x9d0d, 0x9d0e, 0x9d0f,
+ 0x9d10, 0x9d11, 0x9d12, 0x9d13, 0x9d14, 0x9d15, 0x9d16, 0x9d17,
+ 0x9d18, 0x9d19, 0x9d1a, 0x9d1b, 0x9d1c, 0x9d1d, 0x9d1e, 0x9d1f,
+ 0x9d20, 0x9d21, 0x9d22, 0x9d23, 0x9d24, 0x9d25, 0x9d26, 0x9d27,
+ 0x9d28, 0x9d29, 0x9d2a, 0x9d2b, 0x9d2c, 0x9d2d, 0x9d2e, 0x9d2f,
+ 0x9d30, 0x9d31, 0x9d32, 0x9d33, 0x9d34, 0x9d35, 0x9d36, 0x9d37,
+ 0x9d38, 0x9d39, 0x9d3a, 0x9d3b, 0x9d3c, 0x9d3d, 0x9d3e, 0x9d3f,
+ 0x9d40, 0x9d41, 0x9d42, 0x9d43, 0x9d44, 0x9d45, 0x9d46, 0x9d47,
+ 0x9d48, 0x9d49, 0x9d4a, 0x9d4b, 0x9d4c, 0x9d4d, 0x9d4e, 0x9d4f,
+ 0x9d50, 0x9d51, 0x9d52, 0x9d53, 0x9d54, 0x9d55, 0x9d56, 0x9d57,
+ 0x9d58, 0x9d59, 0x9d5a, 0x9d5b, 0x9d5c, 0x9d5d, 0x9d5e, 0x9d5f,
+ 0x9d60, 0x9d61, 0x9d62, 0x9d63, 0x9d64, 0x9d65, 0x9d66, 0x9d67,
+ 0x9d68, 0x9d69, 0x9d6a, 0x9d6b, 0x9d6c, 0x9d6d, 0x9d6e, 0x9d6f,
+ 0x9d70, 0x9d71, 0x9d72, 0x9d73, 0x9d74, 0x9d75, 0x9d76, 0x9d77,
+ 0x9d78, 0x9d79, 0x9d7a, 0x9d7b, 0x9d7c, 0x9d7d, 0x9d7e, 0x9d7f,
+ 0x9d80, 0x9d81, 0x9d82, 0x9d83, 0x9d84, 0x9d85, 0x9d86, 0x9d87,
+ 0x9d88, 0x9d89, 0x9d8a, 0x9d8b, 0x9d8c, 0x9d8d, 0x9d8e, 0x9d8f,
+ 0x9d90, 0x9d91, 0x9d92, 0x9d93, 0x9d94, 0x9d95, 0x9d96, 0x9d97,
+ 0x9d98, 0x9d99, 0x9d9a, 0x9d9b, 0x9d9c, 0x9d9d, 0x9d9e, 0x9d9f,
+ 0x9da0, 0x9da1, 0x9da2, 0x9da3, 0x9da4, 0x9da5, 0x9da6, 0x9da7,
+ 0x9da8, 0x9da9, 0x9daa, 0x9dab, 0x9dac, 0x9dad, 0x9dae, 0x9daf,
+ 0x9db0, 0x9db1, 0x9db2, 0x9db3, 0x9db4, 0x9db5, 0x9db6, 0x9db7,
+ 0x9db8, 0x9db9, 0x9dba, 0x9dbb, 0x9dbc, 0x9dbd, 0x9dbe, 0x9dbf,
+ 0x9dc0, 0x9dc1, 0x9dc2, 0x9dc3, 0x9dc4, 0x9dc5, 0x9dc6, 0x9dc7,
+ 0x9dc8, 0x9dc9, 0x9dca, 0x9dcb, 0x9dcc, 0x9dcd, 0x9dce, 0x9dcf,
+ 0x9dd0, 0x9dd1, 0x9dd2, 0x9dd3, 0x9dd4, 0x9dd5, 0x9dd6, 0x9dd7,
+ 0x9dd8, 0x9dd9, 0x9dda, 0x9ddb, 0x9ddc, 0x9ddd, 0x9dde, 0x9ddf,
+ 0x9de0, 0x9de1, 0x9de2, 0x9de3, 0x9de4, 0x9de5, 0x9de6, 0x9de7,
+ 0x9de8, 0x9de9, 0x9dea, 0x9deb, 0x9dec, 0x9ded, 0x9dee, 0x9def,
+ 0x9df0, 0x9df1, 0x9df2, 0x9df3, 0x9df4, 0x9df5, 0x9df6, 0x9df7,
+ 0x9df8, 0x9df9, 0x9dfa, 0x9dfb, 0x9dfc, 0x9dfd, 0x9dfe, 0x9dff,
+ 0x9e00, 0x9e01, 0x9e02, 0x9e03, 0x9e04, 0x9e05, 0x9e06, 0x9e07,
+ 0x9e08, 0x9e09, 0x9e0a, 0x9e0b, 0x9e0c, 0x9e0d, 0x9e0e, 0x9e0f,
+ 0x9e10, 0x9e11, 0x9e12, 0x9e13, 0x9e14, 0x9e15, 0x9e16, 0x9e17,
+ 0x9e18, 0x9e19, 0x9e1a, 0x9e1b, 0x9e1c, 0x9e1d, 0x9e1e, 0x9e1f,
+ 0x9e20, 0x9e21, 0x9e22, 0x9e23, 0x9e24, 0x9e25, 0x9e26, 0x9e27,
+ 0x9e28, 0x9e29, 0x9e2a, 0x9e2b, 0x9e2c, 0x9e2d, 0x9e2e, 0x9e2f,
+ 0x9e30, 0x9e31, 0x9e32, 0x9e33, 0x9e34, 0x9e35, 0x9e36, 0x9e37,
+ 0x9e38, 0x9e39, 0x9e3a, 0x9e3b, 0x9e3c, 0x9e3d, 0x9e3e, 0x9e3f,
+ 0x9e40, 0x9e41, 0x9e42, 0x9e43, 0x9e44, 0x9e45, 0x9e46, 0x9e47,
+ 0x9e48, 0x9e49, 0x9e4a, 0x9e4b, 0x9e4c, 0x9e4d, 0x9e4e, 0x9e4f,
+ 0x9e50, 0x9e51, 0x9e52, 0x9e53, 0x9e54, 0x9e55, 0x9e56, 0x9e57,
+ 0x9e58, 0x9e59, 0x9e5a, 0x9e5b, 0x9e5c, 0x9e5d, 0x9e5e, 0x9e5f,
+ 0x9e60, 0x9e61, 0x9e62, 0x9e63, 0x9e64, 0x9e65, 0x9e66, 0x9e67,
+ 0x9e68, 0x9e69, 0x9e6a, 0x9e6b, 0x9e6c, 0x9e6d, 0x9e6e, 0x9e6f,
+ 0x9e70, 0x9e71, 0x9e72, 0x9e73, 0x9e74, 0x9e75, 0x9e76, 0x9e77,
+ 0x9e78, 0x9e79, 0x9e7a, 0x9e7b, 0x9e7c, 0x9e7d, 0x9e7e, 0x9e7f,
+ 0x9e80, 0x9e81, 0x9e82, 0x9e83, 0x9e84, 0x9e85, 0x9e86, 0x9e87,
+ 0x9e88, 0x9e89, 0x9e8a, 0x9e8b, 0x9e8c, 0x9e8d, 0x9e8e, 0x9e8f,
+ 0x9e90, 0x9e91, 0x9e92, 0x9e93, 0x9e94, 0x9e95, 0x9e96, 0x9e97,
+ 0x9e98, 0x9e99, 0x9e9a, 0x9e9b, 0x9e9c, 0x9e9d, 0x9e9e, 0x9e9f,
+ 0x9ea0, 0x9ea1, 0x9ea2, 0x9ea3, 0x9ea4, 0x9ea5, 0x9ea6, 0x9ea7,
+ 0x9ea8, 0x9ea9, 0x9eaa, 0x9eab, 0x9eac, 0x9ead, 0x9eae, 0x9eaf,
+ 0x9eb0, 0x9eb1, 0x9eb2, 0x9eb3, 0x9eb4, 0x9eb5, 0x9eb6, 0x9eb7,
+ 0x9eb8, 0x9eb9, 0x9eba, 0x9ebb, 0x9ebc, 0x9ebd, 0x9ebe, 0x9ebf,
+ 0x9ec0, 0x9ec1, 0x9ec2, 0x9ec3, 0x9ec4, 0x9ec5, 0x9ec6, 0x9ec7,
+ 0x9ec8, 0x9ec9, 0x9eca, 0x9ecb, 0x9ecc, 0x9ecd, 0x9ece, 0x9ecf,
+ 0x9ed0, 0x9ed1, 0x9ed2, 0x9ed3, 0x9ed4, 0x9ed5, 0x9ed6, 0x9ed7,
+ 0x9ed8, 0x9ed9, 0x9eda, 0x9edb, 0x9edc, 0x9edd, 0x9ede, 0x9edf,
+ 0x9ee0, 0x9ee1, 0x9ee2, 0x9ee3, 0x9ee4, 0x9ee5, 0x9ee6, 0x9ee7,
+ 0x9ee8, 0x9ee9, 0x9eea, 0x9eeb, 0x9eec, 0x9eed, 0x9eee, 0x9eef,
+ 0x9ef0, 0x9ef1, 0x9ef2, 0x9ef3, 0x9ef4, 0x9ef5, 0x9ef6, 0x9ef7,
+ 0x9ef8, 0x9ef9, 0x9efa, 0x9efb, 0x9efc, 0x9efd, 0x9efe, 0x9eff,
+ 0x9f00, 0x9f01, 0x9f02, 0x9f03, 0x9f04, 0x9f05, 0x9f06, 0x9f07,
+ 0x9f08, 0x9f09, 0x9f0a, 0x9f0b, 0x9f0c, 0x9f0d, 0x9f0e, 0x9f0f,
+ 0x9f10, 0x9f11, 0x9f12, 0x9f13, 0x9f14, 0x9f15, 0x9f16, 0x9f17,
+ 0x9f18, 0x9f19, 0x9f1a, 0x9f1b, 0x9f1c, 0x9f1d, 0x9f1e, 0x9f1f,
+ 0x9f20, 0x9f21, 0x9f22, 0x9f23, 0x9f24, 0x9f25, 0x9f26, 0x9f27,
+ 0x9f28, 0x9f29, 0x9f2a, 0x9f2b, 0x9f2c, 0x9f2d, 0x9f2e, 0x9f2f,
+ 0x9f30, 0x9f31, 0x9f32, 0x9f33, 0x9f34, 0x9f35, 0x9f36, 0x9f37,
+ 0x9f38, 0x9f39, 0x9f3a, 0x9f3b, 0x9f3c, 0x9f3d, 0x9f3e, 0x9f3f,
+ 0x9f40, 0x9f41, 0x9f42, 0x9f43, 0x9f44, 0x9f45, 0x9f46, 0x9f47,
+ 0x9f48, 0x9f49, 0x9f4a, 0x9f4b, 0x9f4c, 0x9f4d, 0x9f4e, 0x9f4f,
+ 0x9f50, 0x9f51, 0x9f52, 0x9f53, 0x9f54, 0x9f55, 0x9f56, 0x9f57,
+ 0x9f58, 0x9f59, 0x9f5a, 0x9f5b, 0x9f5c, 0x9f5d, 0x9f5e, 0x9f5f,
+ 0x9f60, 0x9f61, 0x9f62, 0x9f63, 0x9f64, 0x9f65, 0x9f66, 0x9f67,
+ 0x9f68, 0x9f69, 0x9f6a, 0x9f6b, 0x9f6c, 0x9f6d, 0x9f6e, 0x9f6f,
+ 0x9f70, 0x9f71, 0x9f72, 0x9f73, 0x9f74, 0x9f75, 0x9f76, 0x9f77,
+ 0x9f78, 0x9f79, 0x9f7a, 0x9f7b, 0x9f7c, 0x9f7d, 0x9f7e, 0x9f7f,
+ 0x9f80, 0x9f81, 0x9f82, 0x9f83, 0x9f84, 0x9f85, 0x9f86, 0x9f87,
+ 0x9f88, 0x9f89, 0x9f8a, 0x9f8b, 0x9f8c, 0x9f8d, 0x9f8e, 0x9f8f,
+ 0x9f90, 0x9f91, 0x9f92, 0x9f93, 0x9f94, 0x9f95, 0x9f96, 0x9f97,
+ 0x9f98, 0x9f99, 0x9f9a, 0x9f9b, 0x9f9c, 0x9f9d, 0x9f9e, 0x9f9f,
+ 0x9fa0, 0x9fa1, 0x9fa2, 0x9fa3, 0x9fa4, 0x9fa5, 0x9fa6, 0x9fa7,
+ 0x9fa8, 0x9fa9, 0x9faa, 0x9fab, 0x9fac, 0x9fad, 0x9fae, 0x9faf,
+ 0x9fb0, 0x9fb1, 0x9fb2, 0x9fb3, 0x9fb4, 0x9fb5, 0x9fb6, 0x9fb7,
+ 0x9fb8, 0x9fb9, 0x9fba, 0x9fbb, 0x9fbc, 0x9fbd, 0x9fbe, 0x9fbf,
+ 0x9fc0, 0x9fc1, 0x9fc2, 0x9fc3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa000, 0xa001, 0xa002, 0xa003, 0xa004, 0xa005, 0xa006, 0xa007,
+ 0xa008, 0xa009, 0xa00a, 0xa00b, 0xa00c, 0xa00d, 0xa00e, 0xa00f,
+ 0xa010, 0xa011, 0xa012, 0xa013, 0xa014, 0xa015, 0xa016, 0xa017,
+ 0xa018, 0xa019, 0xa01a, 0xa01b, 0xa01c, 0xa01d, 0xa01e, 0xa01f,
+ 0xa020, 0xa021, 0xa022, 0xa023, 0xa024, 0xa025, 0xa026, 0xa027,
+ 0xa028, 0xa029, 0xa02a, 0xa02b, 0xa02c, 0xa02d, 0xa02e, 0xa02f,
+ 0xa030, 0xa031, 0xa032, 0xa033, 0xa034, 0xa035, 0xa036, 0xa037,
+ 0xa038, 0xa039, 0xa03a, 0xa03b, 0xa03c, 0xa03d, 0xa03e, 0xa03f,
+ 0xa040, 0xa041, 0xa042, 0xa043, 0xa044, 0xa045, 0xa046, 0xa047,
+ 0xa048, 0xa049, 0xa04a, 0xa04b, 0xa04c, 0xa04d, 0xa04e, 0xa04f,
+ 0xa050, 0xa051, 0xa052, 0xa053, 0xa054, 0xa055, 0xa056, 0xa057,
+ 0xa058, 0xa059, 0xa05a, 0xa05b, 0xa05c, 0xa05d, 0xa05e, 0xa05f,
+ 0xa060, 0xa061, 0xa062, 0xa063, 0xa064, 0xa065, 0xa066, 0xa067,
+ 0xa068, 0xa069, 0xa06a, 0xa06b, 0xa06c, 0xa06d, 0xa06e, 0xa06f,
+ 0xa070, 0xa071, 0xa072, 0xa073, 0xa074, 0xa075, 0xa076, 0xa077,
+ 0xa078, 0xa079, 0xa07a, 0xa07b, 0xa07c, 0xa07d, 0xa07e, 0xa07f,
+ 0xa080, 0xa081, 0xa082, 0xa083, 0xa084, 0xa085, 0xa086, 0xa087,
+ 0xa088, 0xa089, 0xa08a, 0xa08b, 0xa08c, 0xa08d, 0xa08e, 0xa08f,
+ 0xa090, 0xa091, 0xa092, 0xa093, 0xa094, 0xa095, 0xa096, 0xa097,
+ 0xa098, 0xa099, 0xa09a, 0xa09b, 0xa09c, 0xa09d, 0xa09e, 0xa09f,
+ 0xa0a0, 0xa0a1, 0xa0a2, 0xa0a3, 0xa0a4, 0xa0a5, 0xa0a6, 0xa0a7,
+ 0xa0a8, 0xa0a9, 0xa0aa, 0xa0ab, 0xa0ac, 0xa0ad, 0xa0ae, 0xa0af,
+ 0xa0b0, 0xa0b1, 0xa0b2, 0xa0b3, 0xa0b4, 0xa0b5, 0xa0b6, 0xa0b7,
+ 0xa0b8, 0xa0b9, 0xa0ba, 0xa0bb, 0xa0bc, 0xa0bd, 0xa0be, 0xa0bf,
+ 0xa0c0, 0xa0c1, 0xa0c2, 0xa0c3, 0xa0c4, 0xa0c5, 0xa0c6, 0xa0c7,
+ 0xa0c8, 0xa0c9, 0xa0ca, 0xa0cb, 0xa0cc, 0xa0cd, 0xa0ce, 0xa0cf,
+ 0xa0d0, 0xa0d1, 0xa0d2, 0xa0d3, 0xa0d4, 0xa0d5, 0xa0d6, 0xa0d7,
+ 0xa0d8, 0xa0d9, 0xa0da, 0xa0db, 0xa0dc, 0xa0dd, 0xa0de, 0xa0df,
+ 0xa0e0, 0xa0e1, 0xa0e2, 0xa0e3, 0xa0e4, 0xa0e5, 0xa0e6, 0xa0e7,
+ 0xa0e8, 0xa0e9, 0xa0ea, 0xa0eb, 0xa0ec, 0xa0ed, 0xa0ee, 0xa0ef,
+ 0xa0f0, 0xa0f1, 0xa0f2, 0xa0f3, 0xa0f4, 0xa0f5, 0xa0f6, 0xa0f7,
+ 0xa0f8, 0xa0f9, 0xa0fa, 0xa0fb, 0xa0fc, 0xa0fd, 0xa0fe, 0xa0ff,
+ 0xa100, 0xa101, 0xa102, 0xa103, 0xa104, 0xa105, 0xa106, 0xa107,
+ 0xa108, 0xa109, 0xa10a, 0xa10b, 0xa10c, 0xa10d, 0xa10e, 0xa10f,
+ 0xa110, 0xa111, 0xa112, 0xa113, 0xa114, 0xa115, 0xa116, 0xa117,
+ 0xa118, 0xa119, 0xa11a, 0xa11b, 0xa11c, 0xa11d, 0xa11e, 0xa11f,
+ 0xa120, 0xa121, 0xa122, 0xa123, 0xa124, 0xa125, 0xa126, 0xa127,
+ 0xa128, 0xa129, 0xa12a, 0xa12b, 0xa12c, 0xa12d, 0xa12e, 0xa12f,
+ 0xa130, 0xa131, 0xa132, 0xa133, 0xa134, 0xa135, 0xa136, 0xa137,
+ 0xa138, 0xa139, 0xa13a, 0xa13b, 0xa13c, 0xa13d, 0xa13e, 0xa13f,
+ 0xa140, 0xa141, 0xa142, 0xa143, 0xa144, 0xa145, 0xa146, 0xa147,
+ 0xa148, 0xa149, 0xa14a, 0xa14b, 0xa14c, 0xa14d, 0xa14e, 0xa14f,
+ 0xa150, 0xa151, 0xa152, 0xa153, 0xa154, 0xa155, 0xa156, 0xa157,
+ 0xa158, 0xa159, 0xa15a, 0xa15b, 0xa15c, 0xa15d, 0xa15e, 0xa15f,
+ 0xa160, 0xa161, 0xa162, 0xa163, 0xa164, 0xa165, 0xa166, 0xa167,
+ 0xa168, 0xa169, 0xa16a, 0xa16b, 0xa16c, 0xa16d, 0xa16e, 0xa16f,
+ 0xa170, 0xa171, 0xa172, 0xa173, 0xa174, 0xa175, 0xa176, 0xa177,
+ 0xa178, 0xa179, 0xa17a, 0xa17b, 0xa17c, 0xa17d, 0xa17e, 0xa17f,
+ 0xa180, 0xa181, 0xa182, 0xa183, 0xa184, 0xa185, 0xa186, 0xa187,
+ 0xa188, 0xa189, 0xa18a, 0xa18b, 0xa18c, 0xa18d, 0xa18e, 0xa18f,
+ 0xa190, 0xa191, 0xa192, 0xa193, 0xa194, 0xa195, 0xa196, 0xa197,
+ 0xa198, 0xa199, 0xa19a, 0xa19b, 0xa19c, 0xa19d, 0xa19e, 0xa19f,
+ 0xa1a0, 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a4, 0xa1a5, 0xa1a6, 0xa1a7,
+ 0xa1a8, 0xa1a9, 0xa1aa, 0xa1ab, 0xa1ac, 0xa1ad, 0xa1ae, 0xa1af,
+ 0xa1b0, 0xa1b1, 0xa1b2, 0xa1b3, 0xa1b4, 0xa1b5, 0xa1b6, 0xa1b7,
+ 0xa1b8, 0xa1b9, 0xa1ba, 0xa1bb, 0xa1bc, 0xa1bd, 0xa1be, 0xa1bf,
+ 0xa1c0, 0xa1c1, 0xa1c2, 0xa1c3, 0xa1c4, 0xa1c5, 0xa1c6, 0xa1c7,
+ 0xa1c8, 0xa1c9, 0xa1ca, 0xa1cb, 0xa1cc, 0xa1cd, 0xa1ce, 0xa1cf,
+ 0xa1d0, 0xa1d1, 0xa1d2, 0xa1d3, 0xa1d4, 0xa1d5, 0xa1d6, 0xa1d7,
+ 0xa1d8, 0xa1d9, 0xa1da, 0xa1db, 0xa1dc, 0xa1dd, 0xa1de, 0xa1df,
+ 0xa1e0, 0xa1e1, 0xa1e2, 0xa1e3, 0xa1e4, 0xa1e5, 0xa1e6, 0xa1e7,
+ 0xa1e8, 0xa1e9, 0xa1ea, 0xa1eb, 0xa1ec, 0xa1ed, 0xa1ee, 0xa1ef,
+ 0xa1f0, 0xa1f1, 0xa1f2, 0xa1f3, 0xa1f4, 0xa1f5, 0xa1f6, 0xa1f7,
+ 0xa1f8, 0xa1f9, 0xa1fa, 0xa1fb, 0xa1fc, 0xa1fd, 0xa1fe, 0xa1ff,
+ 0xa200, 0xa201, 0xa202, 0xa203, 0xa204, 0xa205, 0xa206, 0xa207,
+ 0xa208, 0xa209, 0xa20a, 0xa20b, 0xa20c, 0xa20d, 0xa20e, 0xa20f,
+ 0xa210, 0xa211, 0xa212, 0xa213, 0xa214, 0xa215, 0xa216, 0xa217,
+ 0xa218, 0xa219, 0xa21a, 0xa21b, 0xa21c, 0xa21d, 0xa21e, 0xa21f,
+ 0xa220, 0xa221, 0xa222, 0xa223, 0xa224, 0xa225, 0xa226, 0xa227,
+ 0xa228, 0xa229, 0xa22a, 0xa22b, 0xa22c, 0xa22d, 0xa22e, 0xa22f,
+ 0xa230, 0xa231, 0xa232, 0xa233, 0xa234, 0xa235, 0xa236, 0xa237,
+ 0xa238, 0xa239, 0xa23a, 0xa23b, 0xa23c, 0xa23d, 0xa23e, 0xa23f,
+ 0xa240, 0xa241, 0xa242, 0xa243, 0xa244, 0xa245, 0xa246, 0xa247,
+ 0xa248, 0xa249, 0xa24a, 0xa24b, 0xa24c, 0xa24d, 0xa24e, 0xa24f,
+ 0xa250, 0xa251, 0xa252, 0xa253, 0xa254, 0xa255, 0xa256, 0xa257,
+ 0xa258, 0xa259, 0xa25a, 0xa25b, 0xa25c, 0xa25d, 0xa25e, 0xa25f,
+ 0xa260, 0xa261, 0xa262, 0xa263, 0xa264, 0xa265, 0xa266, 0xa267,
+ 0xa268, 0xa269, 0xa26a, 0xa26b, 0xa26c, 0xa26d, 0xa26e, 0xa26f,
+ 0xa270, 0xa271, 0xa272, 0xa273, 0xa274, 0xa275, 0xa276, 0xa277,
+ 0xa278, 0xa279, 0xa27a, 0xa27b, 0xa27c, 0xa27d, 0xa27e, 0xa27f,
+ 0xa280, 0xa281, 0xa282, 0xa283, 0xa284, 0xa285, 0xa286, 0xa287,
+ 0xa288, 0xa289, 0xa28a, 0xa28b, 0xa28c, 0xa28d, 0xa28e, 0xa28f,
+ 0xa290, 0xa291, 0xa292, 0xa293, 0xa294, 0xa295, 0xa296, 0xa297,
+ 0xa298, 0xa299, 0xa29a, 0xa29b, 0xa29c, 0xa29d, 0xa29e, 0xa29f,
+ 0xa2a0, 0xa2a1, 0xa2a2, 0xa2a3, 0xa2a4, 0xa2a5, 0xa2a6, 0xa2a7,
+ 0xa2a8, 0xa2a9, 0xa2aa, 0xa2ab, 0xa2ac, 0xa2ad, 0xa2ae, 0xa2af,
+ 0xa2b0, 0xa2b1, 0xa2b2, 0xa2b3, 0xa2b4, 0xa2b5, 0xa2b6, 0xa2b7,
+ 0xa2b8, 0xa2b9, 0xa2ba, 0xa2bb, 0xa2bc, 0xa2bd, 0xa2be, 0xa2bf,
+ 0xa2c0, 0xa2c1, 0xa2c2, 0xa2c3, 0xa2c4, 0xa2c5, 0xa2c6, 0xa2c7,
+ 0xa2c8, 0xa2c9, 0xa2ca, 0xa2cb, 0xa2cc, 0xa2cd, 0xa2ce, 0xa2cf,
+ 0xa2d0, 0xa2d1, 0xa2d2, 0xa2d3, 0xa2d4, 0xa2d5, 0xa2d6, 0xa2d7,
+ 0xa2d8, 0xa2d9, 0xa2da, 0xa2db, 0xa2dc, 0xa2dd, 0xa2de, 0xa2df,
+ 0xa2e0, 0xa2e1, 0xa2e2, 0xa2e3, 0xa2e4, 0xa2e5, 0xa2e6, 0xa2e7,
+ 0xa2e8, 0xa2e9, 0xa2ea, 0xa2eb, 0xa2ec, 0xa2ed, 0xa2ee, 0xa2ef,
+ 0xa2f0, 0xa2f1, 0xa2f2, 0xa2f3, 0xa2f4, 0xa2f5, 0xa2f6, 0xa2f7,
+ 0xa2f8, 0xa2f9, 0xa2fa, 0xa2fb, 0xa2fc, 0xa2fd, 0xa2fe, 0xa2ff,
+ 0xa300, 0xa301, 0xa302, 0xa303, 0xa304, 0xa305, 0xa306, 0xa307,
+ 0xa308, 0xa309, 0xa30a, 0xa30b, 0xa30c, 0xa30d, 0xa30e, 0xa30f,
+ 0xa310, 0xa311, 0xa312, 0xa313, 0xa314, 0xa315, 0xa316, 0xa317,
+ 0xa318, 0xa319, 0xa31a, 0xa31b, 0xa31c, 0xa31d, 0xa31e, 0xa31f,
+ 0xa320, 0xa321, 0xa322, 0xa323, 0xa324, 0xa325, 0xa326, 0xa327,
+ 0xa328, 0xa329, 0xa32a, 0xa32b, 0xa32c, 0xa32d, 0xa32e, 0xa32f,
+ 0xa330, 0xa331, 0xa332, 0xa333, 0xa334, 0xa335, 0xa336, 0xa337,
+ 0xa338, 0xa339, 0xa33a, 0xa33b, 0xa33c, 0xa33d, 0xa33e, 0xa33f,
+ 0xa340, 0xa341, 0xa342, 0xa343, 0xa344, 0xa345, 0xa346, 0xa347,
+ 0xa348, 0xa349, 0xa34a, 0xa34b, 0xa34c, 0xa34d, 0xa34e, 0xa34f,
+ 0xa350, 0xa351, 0xa352, 0xa353, 0xa354, 0xa355, 0xa356, 0xa357,
+ 0xa358, 0xa359, 0xa35a, 0xa35b, 0xa35c, 0xa35d, 0xa35e, 0xa35f,
+ 0xa360, 0xa361, 0xa362, 0xa363, 0xa364, 0xa365, 0xa366, 0xa367,
+ 0xa368, 0xa369, 0xa36a, 0xa36b, 0xa36c, 0xa36d, 0xa36e, 0xa36f,
+ 0xa370, 0xa371, 0xa372, 0xa373, 0xa374, 0xa375, 0xa376, 0xa377,
+ 0xa378, 0xa379, 0xa37a, 0xa37b, 0xa37c, 0xa37d, 0xa37e, 0xa37f,
+ 0xa380, 0xa381, 0xa382, 0xa383, 0xa384, 0xa385, 0xa386, 0xa387,
+ 0xa388, 0xa389, 0xa38a, 0xa38b, 0xa38c, 0xa38d, 0xa38e, 0xa38f,
+ 0xa390, 0xa391, 0xa392, 0xa393, 0xa394, 0xa395, 0xa396, 0xa397,
+ 0xa398, 0xa399, 0xa39a, 0xa39b, 0xa39c, 0xa39d, 0xa39e, 0xa39f,
+ 0xa3a0, 0xa3a1, 0xa3a2, 0xa3a3, 0xa3a4, 0xa3a5, 0xa3a6, 0xa3a7,
+ 0xa3a8, 0xa3a9, 0xa3aa, 0xa3ab, 0xa3ac, 0xa3ad, 0xa3ae, 0xa3af,
+ 0xa3b0, 0xa3b1, 0xa3b2, 0xa3b3, 0xa3b4, 0xa3b5, 0xa3b6, 0xa3b7,
+ 0xa3b8, 0xa3b9, 0xa3ba, 0xa3bb, 0xa3bc, 0xa3bd, 0xa3be, 0xa3bf,
+ 0xa3c0, 0xa3c1, 0xa3c2, 0xa3c3, 0xa3c4, 0xa3c5, 0xa3c6, 0xa3c7,
+ 0xa3c8, 0xa3c9, 0xa3ca, 0xa3cb, 0xa3cc, 0xa3cd, 0xa3ce, 0xa3cf,
+ 0xa3d0, 0xa3d1, 0xa3d2, 0xa3d3, 0xa3d4, 0xa3d5, 0xa3d6, 0xa3d7,
+ 0xa3d8, 0xa3d9, 0xa3da, 0xa3db, 0xa3dc, 0xa3dd, 0xa3de, 0xa3df,
+ 0xa3e0, 0xa3e1, 0xa3e2, 0xa3e3, 0xa3e4, 0xa3e5, 0xa3e6, 0xa3e7,
+ 0xa3e8, 0xa3e9, 0xa3ea, 0xa3eb, 0xa3ec, 0xa3ed, 0xa3ee, 0xa3ef,
+ 0xa3f0, 0xa3f1, 0xa3f2, 0xa3f3, 0xa3f4, 0xa3f5, 0xa3f6, 0xa3f7,
+ 0xa3f8, 0xa3f9, 0xa3fa, 0xa3fb, 0xa3fc, 0xa3fd, 0xa3fe, 0xa3ff,
+ 0xa400, 0xa401, 0xa402, 0xa403, 0xa404, 0xa405, 0xa406, 0xa407,
+ 0xa408, 0xa409, 0xa40a, 0xa40b, 0xa40c, 0xa40d, 0xa40e, 0xa40f,
+ 0xa410, 0xa411, 0xa412, 0xa413, 0xa414, 0xa415, 0xa416, 0xa417,
+ 0xa418, 0xa419, 0xa41a, 0xa41b, 0xa41c, 0xa41d, 0xa41e, 0xa41f,
+ 0xa420, 0xa421, 0xa422, 0xa423, 0xa424, 0xa425, 0xa426, 0xa427,
+ 0xa428, 0xa429, 0xa42a, 0xa42b, 0xa42c, 0xa42d, 0xa42e, 0xa42f,
+ 0xa430, 0xa431, 0xa432, 0xa433, 0xa434, 0xa435, 0xa436, 0xa437,
+ 0xa438, 0xa439, 0xa43a, 0xa43b, 0xa43c, 0xa43d, 0xa43e, 0xa43f,
+ 0xa440, 0xa441, 0xa442, 0xa443, 0xa444, 0xa445, 0xa446, 0xa447,
+ 0xa448, 0xa449, 0xa44a, 0xa44b, 0xa44c, 0xa44d, 0xa44e, 0xa44f,
+ 0xa450, 0xa451, 0xa452, 0xa453, 0xa454, 0xa455, 0xa456, 0xa457,
+ 0xa458, 0xa459, 0xa45a, 0xa45b, 0xa45c, 0xa45d, 0xa45e, 0xa45f,
+ 0xa460, 0xa461, 0xa462, 0xa463, 0xa464, 0xa465, 0xa466, 0xa467,
+ 0xa468, 0xa469, 0xa46a, 0xa46b, 0xa46c, 0xa46d, 0xa46e, 0xa46f,
+ 0xa470, 0xa471, 0xa472, 0xa473, 0xa474, 0xa475, 0xa476, 0xa477,
+ 0xa478, 0xa479, 0xa47a, 0xa47b, 0xa47c, 0xa47d, 0xa47e, 0xa47f,
+ 0xa480, 0xa481, 0xa482, 0xa483, 0xa484, 0xa485, 0xa486, 0xa487,
+ 0xa488, 0xa489, 0xa48a, 0xa48b, 0xa48c, 0x0000, 0x0000, 0x0000,
+ 0xa490, 0xa491, 0xa492, 0xa493, 0xa494, 0xa495, 0xa496, 0xa497,
+ 0xa498, 0xa499, 0xa49a, 0xa49b, 0xa49c, 0xa49d, 0xa49e, 0xa49f,
+ 0xa4a0, 0xa4a1, 0xa4a2, 0xa4a3, 0xa4a4, 0xa4a5, 0xa4a6, 0xa4a7,
+ 0xa4a8, 0xa4a9, 0xa4aa, 0xa4ab, 0xa4ac, 0xa4ad, 0xa4ae, 0xa4af,
+ 0xa4b0, 0xa4b1, 0xa4b2, 0xa4b3, 0xa4b4, 0xa4b5, 0xa4b6, 0xa4b7,
+ 0xa4b8, 0xa4b9, 0xa4ba, 0xa4bb, 0xa4bc, 0xa4bd, 0xa4be, 0xa4bf,
+ 0xa4c0, 0xa4c1, 0xa4c2, 0xa4c3, 0xa4c4, 0xa4c5, 0xa4c6, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa500, 0xa501, 0xa502, 0xa503, 0xa504, 0xa505, 0xa506, 0xa507,
+ 0xa508, 0xa509, 0xa50a, 0xa50b, 0xa50c, 0xa50d, 0xa50e, 0xa50f,
+ 0xa510, 0xa511, 0xa512, 0xa513, 0xa514, 0xa515, 0xa516, 0xa517,
+ 0xa518, 0xa519, 0xa51a, 0xa51b, 0xa51c, 0xa51d, 0xa51e, 0xa51f,
+ 0xa520, 0xa521, 0xa522, 0xa523, 0xa524, 0xa525, 0xa526, 0xa527,
+ 0xa528, 0xa529, 0xa52a, 0xa52b, 0xa52c, 0xa52d, 0xa52e, 0xa52f,
+ 0xa530, 0xa531, 0xa532, 0xa533, 0xa534, 0xa535, 0xa536, 0xa537,
+ 0xa538, 0xa539, 0xa53a, 0xa53b, 0xa53c, 0xa53d, 0xa53e, 0xa53f,
+ 0xa540, 0xa541, 0xa542, 0xa543, 0xa544, 0xa545, 0xa546, 0xa547,
+ 0xa548, 0xa549, 0xa54a, 0xa54b, 0xa54c, 0xa54d, 0xa54e, 0xa54f,
+ 0xa550, 0xa551, 0xa552, 0xa553, 0xa554, 0xa555, 0xa556, 0xa557,
+ 0xa558, 0xa559, 0xa55a, 0xa55b, 0xa55c, 0xa55d, 0xa55e, 0xa55f,
+ 0xa560, 0xa561, 0xa562, 0xa563, 0xa564, 0xa565, 0xa566, 0xa567,
+ 0xa568, 0xa569, 0xa56a, 0xa56b, 0xa56c, 0xa56d, 0xa56e, 0xa56f,
+ 0xa570, 0xa571, 0xa572, 0xa573, 0xa574, 0xa575, 0xa576, 0xa577,
+ 0xa578, 0xa579, 0xa57a, 0xa57b, 0xa57c, 0xa57d, 0xa57e, 0xa57f,
+ 0xa580, 0xa581, 0xa582, 0xa583, 0xa584, 0xa585, 0xa586, 0xa587,
+ 0xa588, 0xa589, 0xa58a, 0xa58b, 0xa58c, 0xa58d, 0xa58e, 0xa58f,
+ 0xa590, 0xa591, 0xa592, 0xa593, 0xa594, 0xa595, 0xa596, 0xa597,
+ 0xa598, 0xa599, 0xa59a, 0xa59b, 0xa59c, 0xa59d, 0xa59e, 0xa59f,
+ 0xa5a0, 0xa5a1, 0xa5a2, 0xa5a3, 0xa5a4, 0xa5a5, 0xa5a6, 0xa5a7,
+ 0xa5a8, 0xa5a9, 0xa5aa, 0xa5ab, 0xa5ac, 0xa5ad, 0xa5ae, 0xa5af,
+ 0xa5b0, 0xa5b1, 0xa5b2, 0xa5b3, 0xa5b4, 0xa5b5, 0xa5b6, 0xa5b7,
+ 0xa5b8, 0xa5b9, 0xa5ba, 0xa5bb, 0xa5bc, 0xa5bd, 0xa5be, 0xa5bf,
+ 0xa5c0, 0xa5c1, 0xa5c2, 0xa5c3, 0xa5c4, 0xa5c5, 0xa5c6, 0xa5c7,
+ 0xa5c8, 0xa5c9, 0xa5ca, 0xa5cb, 0xa5cc, 0xa5cd, 0xa5ce, 0xa5cf,
+ 0xa5d0, 0xa5d1, 0xa5d2, 0xa5d3, 0xa5d4, 0xa5d5, 0xa5d6, 0xa5d7,
+ 0xa5d8, 0xa5d9, 0xa5da, 0xa5db, 0xa5dc, 0xa5dd, 0xa5de, 0xa5df,
+ 0xa5e0, 0xa5e1, 0xa5e2, 0xa5e3, 0xa5e4, 0xa5e5, 0xa5e6, 0xa5e7,
+ 0xa5e8, 0xa5e9, 0xa5ea, 0xa5eb, 0xa5ec, 0xa5ed, 0xa5ee, 0xa5ef,
+ 0xa5f0, 0xa5f1, 0xa5f2, 0xa5f3, 0xa5f4, 0xa5f5, 0xa5f6, 0xa5f7,
+ 0xa5f8, 0xa5f9, 0xa5fa, 0xa5fb, 0xa5fc, 0xa5fd, 0xa5fe, 0xa5ff,
+ 0xa600, 0xa601, 0xa602, 0xa603, 0xa604, 0xa605, 0xa606, 0xa607,
+ 0xa608, 0xa609, 0xa60a, 0xa60b, 0xa60c, 0xa60d, 0xa60e, 0xa60f,
+ 0xa610, 0xa611, 0xa612, 0xa613, 0xa614, 0xa615, 0xa616, 0xa617,
+ 0xa618, 0xa619, 0xa61a, 0xa61b, 0xa61c, 0xa61d, 0xa61e, 0xa61f,
+ 0xa620, 0xa621, 0xa622, 0xa623, 0xa624, 0xa625, 0xa626, 0xa627,
+ 0xa628, 0xa629, 0xa62a, 0xa62b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa640, 0xa640, 0xa642, 0xa642, 0xa644, 0xa644, 0xa646, 0xa646,
+ 0xa648, 0xa648, 0xa64a, 0xa64a, 0xa64c, 0xa64c, 0xa64e, 0xa64e,
+ 0xa650, 0xa650, 0xa652, 0xa652, 0xa654, 0xa654, 0xa656, 0xa656,
+ 0xa658, 0xa658, 0xa65a, 0xa65a, 0xa65c, 0xa65c, 0xa65e, 0xa65e,
+ 0x0000, 0x0000, 0xa662, 0xa662, 0xa664, 0xa664, 0xa666, 0xa666,
+ 0xa668, 0xa668, 0xa66a, 0xa66a, 0xa66c, 0xa66c, 0xa66e, 0xa66f,
+ 0xa670, 0xa671, 0xa672, 0xa673, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0xa67c, 0xa67d, 0xa67e, 0xa67f,
+ 0xa680, 0xa680, 0xa682, 0xa682, 0xa684, 0xa684, 0xa686, 0xa686,
+ 0xa688, 0xa688, 0xa68a, 0xa68a, 0xa68c, 0xa68c, 0xa68e, 0xa68e,
+ 0xa690, 0xa690, 0xa692, 0xa692, 0xa694, 0xa694, 0xa696, 0xa696,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa700, 0xa701, 0xa702, 0xa703, 0xa704, 0xa705, 0xa706, 0xa707,
+ 0xa708, 0xa709, 0xa70a, 0xa70b, 0xa70c, 0xa70d, 0xa70e, 0xa70f,
+ 0xa710, 0xa711, 0xa712, 0xa713, 0xa714, 0xa715, 0xa716, 0xa717,
+ 0xa718, 0xa719, 0xa71a, 0xa71b, 0xa71c, 0xa71d, 0xa71e, 0xa71f,
+ 0xa720, 0xa721, 0xa722, 0xa722, 0xa724, 0xa724, 0xa726, 0xa726,
+ 0xa728, 0xa728, 0xa72a, 0xa72a, 0xa72c, 0xa72c, 0xa72e, 0xa72e,
+ 0xa730, 0xa731, 0xa732, 0xa732, 0xa734, 0xa734, 0xa736, 0xa736,
+ 0xa738, 0xa738, 0xa73a, 0xa73a, 0xa73c, 0xa73c, 0xa73e, 0xa73e,
+ 0xa740, 0xa740, 0xa742, 0xa742, 0xa744, 0xa744, 0xa746, 0xa746,
+ 0xa748, 0xa748, 0xa74a, 0xa74a, 0xa74c, 0xa74c, 0xa74e, 0xa74e,
+ 0xa750, 0xa750, 0xa752, 0xa752, 0xa754, 0xa754, 0xa756, 0xa756,
+ 0xa758, 0xa758, 0xa75a, 0xa75a, 0xa75c, 0xa75c, 0xa75e, 0xa75e,
+ 0xa760, 0xa760, 0xa762, 0xa762, 0xa764, 0xa764, 0xa766, 0xa766,
+ 0xa768, 0xa768, 0xa76a, 0xa76a, 0xa76c, 0xa76c, 0xa76e, 0xa76e,
+ 0xa770, 0xa771, 0xa772, 0xa773, 0xa774, 0xa775, 0xa776, 0xa777,
+ 0xa778, 0xa779, 0xa779, 0xa77b, 0xa77b, 0xa77d, 0xa77e, 0xa77e,
+ 0xa780, 0xa780, 0xa782, 0xa782, 0xa784, 0xa784, 0xa786, 0xa786,
+ 0xa788, 0xa789, 0xa78a, 0xa78b, 0xa78b, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0xa7fb, 0xa7fc, 0xa7fd, 0xa7fe, 0xa7ff,
+ 0xa800, 0xa801, 0xa802, 0xa803, 0xa804, 0xa805, 0xa806, 0xa807,
+ 0xa808, 0xa809, 0xa80a, 0xa80b, 0xa80c, 0xa80d, 0xa80e, 0xa80f,
+ 0xa810, 0xa811, 0xa812, 0xa813, 0xa814, 0xa815, 0xa816, 0xa817,
+ 0xa818, 0xa819, 0xa81a, 0xa81b, 0xa81c, 0xa81d, 0xa81e, 0xa81f,
+ 0xa820, 0xa821, 0xa822, 0xa823, 0xa824, 0xa825, 0xa826, 0xa827,
+ 0xa828, 0xa829, 0xa82a, 0xa82b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa840, 0xa841, 0xa842, 0xa843, 0xa844, 0xa845, 0xa846, 0xa847,
+ 0xa848, 0xa849, 0xa84a, 0xa84b, 0xa84c, 0xa84d, 0xa84e, 0xa84f,
+ 0xa850, 0xa851, 0xa852, 0xa853, 0xa854, 0xa855, 0xa856, 0xa857,
+ 0xa858, 0xa859, 0xa85a, 0xa85b, 0xa85c, 0xa85d, 0xa85e, 0xa85f,
+ 0xa860, 0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866, 0xa867,
+ 0xa868, 0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f,
+ 0xa870, 0xa871, 0xa872, 0xa873, 0xa874, 0xa875, 0xa876, 0xa877,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa880, 0xa881, 0xa882, 0xa883, 0xa884, 0xa885, 0xa886, 0xa887,
+ 0xa888, 0xa889, 0xa88a, 0xa88b, 0xa88c, 0xa88d, 0xa88e, 0xa88f,
+ 0xa890, 0xa891, 0xa892, 0xa893, 0xa894, 0xa895, 0xa896, 0xa897,
+ 0xa898, 0xa899, 0xa89a, 0xa89b, 0xa89c, 0xa89d, 0xa89e, 0xa89f,
+ 0xa8a0, 0xa8a1, 0xa8a2, 0xa8a3, 0xa8a4, 0xa8a5, 0xa8a6, 0xa8a7,
+ 0xa8a8, 0xa8a9, 0xa8aa, 0xa8ab, 0xa8ac, 0xa8ad, 0xa8ae, 0xa8af,
+ 0xa8b0, 0xa8b1, 0xa8b2, 0xa8b3, 0xa8b4, 0xa8b5, 0xa8b6, 0xa8b7,
+ 0xa8b8, 0xa8b9, 0xa8ba, 0xa8bb, 0xa8bc, 0xa8bd, 0xa8be, 0xa8bf,
+ 0xa8c0, 0xa8c1, 0xa8c2, 0xa8c3, 0xa8c4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa8ce, 0xa8cf,
+ 0xa8d0, 0xa8d1, 0xa8d2, 0xa8d3, 0xa8d4, 0xa8d5, 0xa8d6, 0xa8d7,
+ 0xa8d8, 0xa8d9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xa900, 0xa901, 0xa902, 0xa903, 0xa904, 0xa905, 0xa906, 0xa907,
+ 0xa908, 0xa909, 0xa90a, 0xa90b, 0xa90c, 0xa90d, 0xa90e, 0xa90f,
+ 0xa910, 0xa911, 0xa912, 0xa913, 0xa914, 0xa915, 0xa916, 0xa917,
+ 0xa918, 0xa919, 0xa91a, 0xa91b, 0xa91c, 0xa91d, 0xa91e, 0xa91f,
+ 0xa920, 0xa921, 0xa922, 0xa923, 0xa924, 0xa925, 0xa926, 0xa927,
+ 0xa928, 0xa929, 0xa92a, 0xa92b, 0xa92c, 0xa92d, 0xa92e, 0xa92f,
+ 0xa930, 0xa931, 0xa932, 0xa933, 0xa934, 0xa935, 0xa936, 0xa937,
+ 0xa938, 0xa939, 0xa93a, 0xa93b, 0xa93c, 0xa93d, 0xa93e, 0xa93f,
+ 0xa940, 0xa941, 0xa942, 0xa943, 0xa944, 0xa945, 0xa946, 0xa947,
+ 0xa948, 0xa949, 0xa94a, 0xa94b, 0xa94c, 0xa94d, 0xa94e, 0xa94f,
+ 0xa950, 0xa951, 0xa952, 0xa953, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa95f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xaa00, 0xaa01, 0xaa02, 0xaa03, 0xaa04, 0xaa05, 0xaa06, 0xaa07,
+ 0xaa08, 0xaa09, 0xaa0a, 0xaa0b, 0xaa0c, 0xaa0d, 0xaa0e, 0xaa0f,
+ 0xaa10, 0xaa11, 0xaa12, 0xaa13, 0xaa14, 0xaa15, 0xaa16, 0xaa17,
+ 0xaa18, 0xaa19, 0xaa1a, 0xaa1b, 0xaa1c, 0xaa1d, 0xaa1e, 0xaa1f,
+ 0xaa20, 0xaa21, 0xaa22, 0xaa23, 0xaa24, 0xaa25, 0xaa26, 0xaa27,
+ 0xaa28, 0xaa29, 0xaa2a, 0xaa2b, 0xaa2c, 0xaa2d, 0xaa2e, 0xaa2f,
+ 0xaa30, 0xaa31, 0xaa32, 0xaa33, 0xaa34, 0xaa35, 0xaa36, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xaa40, 0xaa41, 0xaa42, 0xaa43, 0xaa44, 0xaa45, 0xaa46, 0xaa47,
+ 0xaa48, 0xaa49, 0xaa4a, 0xaa4b, 0xaa4c, 0xaa4d, 0x0000, 0x0000,
+ 0xaa50, 0xaa51, 0xaa52, 0xaa53, 0xaa54, 0xaa55, 0xaa56, 0xaa57,
+ 0xaa58, 0xaa59, 0x0000, 0x0000, 0xaa5c, 0xaa5d, 0xaa5e, 0xaa5f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xac00, 0xac01, 0xac02, 0xac03, 0xac04, 0xac05, 0xac06, 0xac07,
+ 0xac08, 0xac09, 0xac0a, 0xac0b, 0xac0c, 0xac0d, 0xac0e, 0xac0f,
+ 0xac10, 0xac11, 0xac12, 0xac13, 0xac14, 0xac15, 0xac16, 0xac17,
+ 0xac18, 0xac19, 0xac1a, 0xac1b, 0xac1c, 0xac1d, 0xac1e, 0xac1f,
+ 0xac20, 0xac21, 0xac22, 0xac23, 0xac24, 0xac25, 0xac26, 0xac27,
+ 0xac28, 0xac29, 0xac2a, 0xac2b, 0xac2c, 0xac2d, 0xac2e, 0xac2f,
+ 0xac30, 0xac31, 0xac32, 0xac33, 0xac34, 0xac35, 0xac36, 0xac37,
+ 0xac38, 0xac39, 0xac3a, 0xac3b, 0xac3c, 0xac3d, 0xac3e, 0xac3f,
+ 0xac40, 0xac41, 0xac42, 0xac43, 0xac44, 0xac45, 0xac46, 0xac47,
+ 0xac48, 0xac49, 0xac4a, 0xac4b, 0xac4c, 0xac4d, 0xac4e, 0xac4f,
+ 0xac50, 0xac51, 0xac52, 0xac53, 0xac54, 0xac55, 0xac56, 0xac57,
+ 0xac58, 0xac59, 0xac5a, 0xac5b, 0xac5c, 0xac5d, 0xac5e, 0xac5f,
+ 0xac60, 0xac61, 0xac62, 0xac63, 0xac64, 0xac65, 0xac66, 0xac67,
+ 0xac68, 0xac69, 0xac6a, 0xac6b, 0xac6c, 0xac6d, 0xac6e, 0xac6f,
+ 0xac70, 0xac71, 0xac72, 0xac73, 0xac74, 0xac75, 0xac76, 0xac77,
+ 0xac78, 0xac79, 0xac7a, 0xac7b, 0xac7c, 0xac7d, 0xac7e, 0xac7f,
+ 0xac80, 0xac81, 0xac82, 0xac83, 0xac84, 0xac85, 0xac86, 0xac87,
+ 0xac88, 0xac89, 0xac8a, 0xac8b, 0xac8c, 0xac8d, 0xac8e, 0xac8f,
+ 0xac90, 0xac91, 0xac92, 0xac93, 0xac94, 0xac95, 0xac96, 0xac97,
+ 0xac98, 0xac99, 0xac9a, 0xac9b, 0xac9c, 0xac9d, 0xac9e, 0xac9f,
+ 0xaca0, 0xaca1, 0xaca2, 0xaca3, 0xaca4, 0xaca5, 0xaca6, 0xaca7,
+ 0xaca8, 0xaca9, 0xacaa, 0xacab, 0xacac, 0xacad, 0xacae, 0xacaf,
+ 0xacb0, 0xacb1, 0xacb2, 0xacb3, 0xacb4, 0xacb5, 0xacb6, 0xacb7,
+ 0xacb8, 0xacb9, 0xacba, 0xacbb, 0xacbc, 0xacbd, 0xacbe, 0xacbf,
+ 0xacc0, 0xacc1, 0xacc2, 0xacc3, 0xacc4, 0xacc5, 0xacc6, 0xacc7,
+ 0xacc8, 0xacc9, 0xacca, 0xaccb, 0xaccc, 0xaccd, 0xacce, 0xaccf,
+ 0xacd0, 0xacd1, 0xacd2, 0xacd3, 0xacd4, 0xacd5, 0xacd6, 0xacd7,
+ 0xacd8, 0xacd9, 0xacda, 0xacdb, 0xacdc, 0xacdd, 0xacde, 0xacdf,
+ 0xace0, 0xace1, 0xace2, 0xace3, 0xace4, 0xace5, 0xace6, 0xace7,
+ 0xace8, 0xace9, 0xacea, 0xaceb, 0xacec, 0xaced, 0xacee, 0xacef,
+ 0xacf0, 0xacf1, 0xacf2, 0xacf3, 0xacf4, 0xacf5, 0xacf6, 0xacf7,
+ 0xacf8, 0xacf9, 0xacfa, 0xacfb, 0xacfc, 0xacfd, 0xacfe, 0xacff,
+ 0xad00, 0xad01, 0xad02, 0xad03, 0xad04, 0xad05, 0xad06, 0xad07,
+ 0xad08, 0xad09, 0xad0a, 0xad0b, 0xad0c, 0xad0d, 0xad0e, 0xad0f,
+ 0xad10, 0xad11, 0xad12, 0xad13, 0xad14, 0xad15, 0xad16, 0xad17,
+ 0xad18, 0xad19, 0xad1a, 0xad1b, 0xad1c, 0xad1d, 0xad1e, 0xad1f,
+ 0xad20, 0xad21, 0xad22, 0xad23, 0xad24, 0xad25, 0xad26, 0xad27,
+ 0xad28, 0xad29, 0xad2a, 0xad2b, 0xad2c, 0xad2d, 0xad2e, 0xad2f,
+ 0xad30, 0xad31, 0xad32, 0xad33, 0xad34, 0xad35, 0xad36, 0xad37,
+ 0xad38, 0xad39, 0xad3a, 0xad3b, 0xad3c, 0xad3d, 0xad3e, 0xad3f,
+ 0xad40, 0xad41, 0xad42, 0xad43, 0xad44, 0xad45, 0xad46, 0xad47,
+ 0xad48, 0xad49, 0xad4a, 0xad4b, 0xad4c, 0xad4d, 0xad4e, 0xad4f,
+ 0xad50, 0xad51, 0xad52, 0xad53, 0xad54, 0xad55, 0xad56, 0xad57,
+ 0xad58, 0xad59, 0xad5a, 0xad5b, 0xad5c, 0xad5d, 0xad5e, 0xad5f,
+ 0xad60, 0xad61, 0xad62, 0xad63, 0xad64, 0xad65, 0xad66, 0xad67,
+ 0xad68, 0xad69, 0xad6a, 0xad6b, 0xad6c, 0xad6d, 0xad6e, 0xad6f,
+ 0xad70, 0xad71, 0xad72, 0xad73, 0xad74, 0xad75, 0xad76, 0xad77,
+ 0xad78, 0xad79, 0xad7a, 0xad7b, 0xad7c, 0xad7d, 0xad7e, 0xad7f,
+ 0xad80, 0xad81, 0xad82, 0xad83, 0xad84, 0xad85, 0xad86, 0xad87,
+ 0xad88, 0xad89, 0xad8a, 0xad8b, 0xad8c, 0xad8d, 0xad8e, 0xad8f,
+ 0xad90, 0xad91, 0xad92, 0xad93, 0xad94, 0xad95, 0xad96, 0xad97,
+ 0xad98, 0xad99, 0xad9a, 0xad9b, 0xad9c, 0xad9d, 0xad9e, 0xad9f,
+ 0xada0, 0xada1, 0xada2, 0xada3, 0xada4, 0xada5, 0xada6, 0xada7,
+ 0xada8, 0xada9, 0xadaa, 0xadab, 0xadac, 0xadad, 0xadae, 0xadaf,
+ 0xadb0, 0xadb1, 0xadb2, 0xadb3, 0xadb4, 0xadb5, 0xadb6, 0xadb7,
+ 0xadb8, 0xadb9, 0xadba, 0xadbb, 0xadbc, 0xadbd, 0xadbe, 0xadbf,
+ 0xadc0, 0xadc1, 0xadc2, 0xadc3, 0xadc4, 0xadc5, 0xadc6, 0xadc7,
+ 0xadc8, 0xadc9, 0xadca, 0xadcb, 0xadcc, 0xadcd, 0xadce, 0xadcf,
+ 0xadd0, 0xadd1, 0xadd2, 0xadd3, 0xadd4, 0xadd5, 0xadd6, 0xadd7,
+ 0xadd8, 0xadd9, 0xadda, 0xaddb, 0xaddc, 0xaddd, 0xadde, 0xaddf,
+ 0xade0, 0xade1, 0xade2, 0xade3, 0xade4, 0xade5, 0xade6, 0xade7,
+ 0xade8, 0xade9, 0xadea, 0xadeb, 0xadec, 0xaded, 0xadee, 0xadef,
+ 0xadf0, 0xadf1, 0xadf2, 0xadf3, 0xadf4, 0xadf5, 0xadf6, 0xadf7,
+ 0xadf8, 0xadf9, 0xadfa, 0xadfb, 0xadfc, 0xadfd, 0xadfe, 0xadff,
+ 0xae00, 0xae01, 0xae02, 0xae03, 0xae04, 0xae05, 0xae06, 0xae07,
+ 0xae08, 0xae09, 0xae0a, 0xae0b, 0xae0c, 0xae0d, 0xae0e, 0xae0f,
+ 0xae10, 0xae11, 0xae12, 0xae13, 0xae14, 0xae15, 0xae16, 0xae17,
+ 0xae18, 0xae19, 0xae1a, 0xae1b, 0xae1c, 0xae1d, 0xae1e, 0xae1f,
+ 0xae20, 0xae21, 0xae22, 0xae23, 0xae24, 0xae25, 0xae26, 0xae27,
+ 0xae28, 0xae29, 0xae2a, 0xae2b, 0xae2c, 0xae2d, 0xae2e, 0xae2f,
+ 0xae30, 0xae31, 0xae32, 0xae33, 0xae34, 0xae35, 0xae36, 0xae37,
+ 0xae38, 0xae39, 0xae3a, 0xae3b, 0xae3c, 0xae3d, 0xae3e, 0xae3f,
+ 0xae40, 0xae41, 0xae42, 0xae43, 0xae44, 0xae45, 0xae46, 0xae47,
+ 0xae48, 0xae49, 0xae4a, 0xae4b, 0xae4c, 0xae4d, 0xae4e, 0xae4f,
+ 0xae50, 0xae51, 0xae52, 0xae53, 0xae54, 0xae55, 0xae56, 0xae57,
+ 0xae58, 0xae59, 0xae5a, 0xae5b, 0xae5c, 0xae5d, 0xae5e, 0xae5f,
+ 0xae60, 0xae61, 0xae62, 0xae63, 0xae64, 0xae65, 0xae66, 0xae67,
+ 0xae68, 0xae69, 0xae6a, 0xae6b, 0xae6c, 0xae6d, 0xae6e, 0xae6f,
+ 0xae70, 0xae71, 0xae72, 0xae73, 0xae74, 0xae75, 0xae76, 0xae77,
+ 0xae78, 0xae79, 0xae7a, 0xae7b, 0xae7c, 0xae7d, 0xae7e, 0xae7f,
+ 0xae80, 0xae81, 0xae82, 0xae83, 0xae84, 0xae85, 0xae86, 0xae87,
+ 0xae88, 0xae89, 0xae8a, 0xae8b, 0xae8c, 0xae8d, 0xae8e, 0xae8f,
+ 0xae90, 0xae91, 0xae92, 0xae93, 0xae94, 0xae95, 0xae96, 0xae97,
+ 0xae98, 0xae99, 0xae9a, 0xae9b, 0xae9c, 0xae9d, 0xae9e, 0xae9f,
+ 0xaea0, 0xaea1, 0xaea2, 0xaea3, 0xaea4, 0xaea5, 0xaea6, 0xaea7,
+ 0xaea8, 0xaea9, 0xaeaa, 0xaeab, 0xaeac, 0xaead, 0xaeae, 0xaeaf,
+ 0xaeb0, 0xaeb1, 0xaeb2, 0xaeb3, 0xaeb4, 0xaeb5, 0xaeb6, 0xaeb7,
+ 0xaeb8, 0xaeb9, 0xaeba, 0xaebb, 0xaebc, 0xaebd, 0xaebe, 0xaebf,
+ 0xaec0, 0xaec1, 0xaec2, 0xaec3, 0xaec4, 0xaec5, 0xaec6, 0xaec7,
+ 0xaec8, 0xaec9, 0xaeca, 0xaecb, 0xaecc, 0xaecd, 0xaece, 0xaecf,
+ 0xaed0, 0xaed1, 0xaed2, 0xaed3, 0xaed4, 0xaed5, 0xaed6, 0xaed7,
+ 0xaed8, 0xaed9, 0xaeda, 0xaedb, 0xaedc, 0xaedd, 0xaede, 0xaedf,
+ 0xaee0, 0xaee1, 0xaee2, 0xaee3, 0xaee4, 0xaee5, 0xaee6, 0xaee7,
+ 0xaee8, 0xaee9, 0xaeea, 0xaeeb, 0xaeec, 0xaeed, 0xaeee, 0xaeef,
+ 0xaef0, 0xaef1, 0xaef2, 0xaef3, 0xaef4, 0xaef5, 0xaef6, 0xaef7,
+ 0xaef8, 0xaef9, 0xaefa, 0xaefb, 0xaefc, 0xaefd, 0xaefe, 0xaeff,
+ 0xaf00, 0xaf01, 0xaf02, 0xaf03, 0xaf04, 0xaf05, 0xaf06, 0xaf07,
+ 0xaf08, 0xaf09, 0xaf0a, 0xaf0b, 0xaf0c, 0xaf0d, 0xaf0e, 0xaf0f,
+ 0xaf10, 0xaf11, 0xaf12, 0xaf13, 0xaf14, 0xaf15, 0xaf16, 0xaf17,
+ 0xaf18, 0xaf19, 0xaf1a, 0xaf1b, 0xaf1c, 0xaf1d, 0xaf1e, 0xaf1f,
+ 0xaf20, 0xaf21, 0xaf22, 0xaf23, 0xaf24, 0xaf25, 0xaf26, 0xaf27,
+ 0xaf28, 0xaf29, 0xaf2a, 0xaf2b, 0xaf2c, 0xaf2d, 0xaf2e, 0xaf2f,
+ 0xaf30, 0xaf31, 0xaf32, 0xaf33, 0xaf34, 0xaf35, 0xaf36, 0xaf37,
+ 0xaf38, 0xaf39, 0xaf3a, 0xaf3b, 0xaf3c, 0xaf3d, 0xaf3e, 0xaf3f,
+ 0xaf40, 0xaf41, 0xaf42, 0xaf43, 0xaf44, 0xaf45, 0xaf46, 0xaf47,
+ 0xaf48, 0xaf49, 0xaf4a, 0xaf4b, 0xaf4c, 0xaf4d, 0xaf4e, 0xaf4f,
+ 0xaf50, 0xaf51, 0xaf52, 0xaf53, 0xaf54, 0xaf55, 0xaf56, 0xaf57,
+ 0xaf58, 0xaf59, 0xaf5a, 0xaf5b, 0xaf5c, 0xaf5d, 0xaf5e, 0xaf5f,
+ 0xaf60, 0xaf61, 0xaf62, 0xaf63, 0xaf64, 0xaf65, 0xaf66, 0xaf67,
+ 0xaf68, 0xaf69, 0xaf6a, 0xaf6b, 0xaf6c, 0xaf6d, 0xaf6e, 0xaf6f,
+ 0xaf70, 0xaf71, 0xaf72, 0xaf73, 0xaf74, 0xaf75, 0xaf76, 0xaf77,
+ 0xaf78, 0xaf79, 0xaf7a, 0xaf7b, 0xaf7c, 0xaf7d, 0xaf7e, 0xaf7f,
+ 0xaf80, 0xaf81, 0xaf82, 0xaf83, 0xaf84, 0xaf85, 0xaf86, 0xaf87,
+ 0xaf88, 0xaf89, 0xaf8a, 0xaf8b, 0xaf8c, 0xaf8d, 0xaf8e, 0xaf8f,
+ 0xaf90, 0xaf91, 0xaf92, 0xaf93, 0xaf94, 0xaf95, 0xaf96, 0xaf97,
+ 0xaf98, 0xaf99, 0xaf9a, 0xaf9b, 0xaf9c, 0xaf9d, 0xaf9e, 0xaf9f,
+ 0xafa0, 0xafa1, 0xafa2, 0xafa3, 0xafa4, 0xafa5, 0xafa6, 0xafa7,
+ 0xafa8, 0xafa9, 0xafaa, 0xafab, 0xafac, 0xafad, 0xafae, 0xafaf,
+ 0xafb0, 0xafb1, 0xafb2, 0xafb3, 0xafb4, 0xafb5, 0xafb6, 0xafb7,
+ 0xafb8, 0xafb9, 0xafba, 0xafbb, 0xafbc, 0xafbd, 0xafbe, 0xafbf,
+ 0xafc0, 0xafc1, 0xafc2, 0xafc3, 0xafc4, 0xafc5, 0xafc6, 0xafc7,
+ 0xafc8, 0xafc9, 0xafca, 0xafcb, 0xafcc, 0xafcd, 0xafce, 0xafcf,
+ 0xafd0, 0xafd1, 0xafd2, 0xafd3, 0xafd4, 0xafd5, 0xafd6, 0xafd7,
+ 0xafd8, 0xafd9, 0xafda, 0xafdb, 0xafdc, 0xafdd, 0xafde, 0xafdf,
+ 0xafe0, 0xafe1, 0xafe2, 0xafe3, 0xafe4, 0xafe5, 0xafe6, 0xafe7,
+ 0xafe8, 0xafe9, 0xafea, 0xafeb, 0xafec, 0xafed, 0xafee, 0xafef,
+ 0xaff0, 0xaff1, 0xaff2, 0xaff3, 0xaff4, 0xaff5, 0xaff6, 0xaff7,
+ 0xaff8, 0xaff9, 0xaffa, 0xaffb, 0xaffc, 0xaffd, 0xaffe, 0xafff,
+ 0xb000, 0xb001, 0xb002, 0xb003, 0xb004, 0xb005, 0xb006, 0xb007,
+ 0xb008, 0xb009, 0xb00a, 0xb00b, 0xb00c, 0xb00d, 0xb00e, 0xb00f,
+ 0xb010, 0xb011, 0xb012, 0xb013, 0xb014, 0xb015, 0xb016, 0xb017,
+ 0xb018, 0xb019, 0xb01a, 0xb01b, 0xb01c, 0xb01d, 0xb01e, 0xb01f,
+ 0xb020, 0xb021, 0xb022, 0xb023, 0xb024, 0xb025, 0xb026, 0xb027,
+ 0xb028, 0xb029, 0xb02a, 0xb02b, 0xb02c, 0xb02d, 0xb02e, 0xb02f,
+ 0xb030, 0xb031, 0xb032, 0xb033, 0xb034, 0xb035, 0xb036, 0xb037,
+ 0xb038, 0xb039, 0xb03a, 0xb03b, 0xb03c, 0xb03d, 0xb03e, 0xb03f,
+ 0xb040, 0xb041, 0xb042, 0xb043, 0xb044, 0xb045, 0xb046, 0xb047,
+ 0xb048, 0xb049, 0xb04a, 0xb04b, 0xb04c, 0xb04d, 0xb04e, 0xb04f,
+ 0xb050, 0xb051, 0xb052, 0xb053, 0xb054, 0xb055, 0xb056, 0xb057,
+ 0xb058, 0xb059, 0xb05a, 0xb05b, 0xb05c, 0xb05d, 0xb05e, 0xb05f,
+ 0xb060, 0xb061, 0xb062, 0xb063, 0xb064, 0xb065, 0xb066, 0xb067,
+ 0xb068, 0xb069, 0xb06a, 0xb06b, 0xb06c, 0xb06d, 0xb06e, 0xb06f,
+ 0xb070, 0xb071, 0xb072, 0xb073, 0xb074, 0xb075, 0xb076, 0xb077,
+ 0xb078, 0xb079, 0xb07a, 0xb07b, 0xb07c, 0xb07d, 0xb07e, 0xb07f,
+ 0xb080, 0xb081, 0xb082, 0xb083, 0xb084, 0xb085, 0xb086, 0xb087,
+ 0xb088, 0xb089, 0xb08a, 0xb08b, 0xb08c, 0xb08d, 0xb08e, 0xb08f,
+ 0xb090, 0xb091, 0xb092, 0xb093, 0xb094, 0xb095, 0xb096, 0xb097,
+ 0xb098, 0xb099, 0xb09a, 0xb09b, 0xb09c, 0xb09d, 0xb09e, 0xb09f,
+ 0xb0a0, 0xb0a1, 0xb0a2, 0xb0a3, 0xb0a4, 0xb0a5, 0xb0a6, 0xb0a7,
+ 0xb0a8, 0xb0a9, 0xb0aa, 0xb0ab, 0xb0ac, 0xb0ad, 0xb0ae, 0xb0af,
+ 0xb0b0, 0xb0b1, 0xb0b2, 0xb0b3, 0xb0b4, 0xb0b5, 0xb0b6, 0xb0b7,
+ 0xb0b8, 0xb0b9, 0xb0ba, 0xb0bb, 0xb0bc, 0xb0bd, 0xb0be, 0xb0bf,
+ 0xb0c0, 0xb0c1, 0xb0c2, 0xb0c3, 0xb0c4, 0xb0c5, 0xb0c6, 0xb0c7,
+ 0xb0c8, 0xb0c9, 0xb0ca, 0xb0cb, 0xb0cc, 0xb0cd, 0xb0ce, 0xb0cf,
+ 0xb0d0, 0xb0d1, 0xb0d2, 0xb0d3, 0xb0d4, 0xb0d5, 0xb0d6, 0xb0d7,
+ 0xb0d8, 0xb0d9, 0xb0da, 0xb0db, 0xb0dc, 0xb0dd, 0xb0de, 0xb0df,
+ 0xb0e0, 0xb0e1, 0xb0e2, 0xb0e3, 0xb0e4, 0xb0e5, 0xb0e6, 0xb0e7,
+ 0xb0e8, 0xb0e9, 0xb0ea, 0xb0eb, 0xb0ec, 0xb0ed, 0xb0ee, 0xb0ef,
+ 0xb0f0, 0xb0f1, 0xb0f2, 0xb0f3, 0xb0f4, 0xb0f5, 0xb0f6, 0xb0f7,
+ 0xb0f8, 0xb0f9, 0xb0fa, 0xb0fb, 0xb0fc, 0xb0fd, 0xb0fe, 0xb0ff,
+ 0xb100, 0xb101, 0xb102, 0xb103, 0xb104, 0xb105, 0xb106, 0xb107,
+ 0xb108, 0xb109, 0xb10a, 0xb10b, 0xb10c, 0xb10d, 0xb10e, 0xb10f,
+ 0xb110, 0xb111, 0xb112, 0xb113, 0xb114, 0xb115, 0xb116, 0xb117,
+ 0xb118, 0xb119, 0xb11a, 0xb11b, 0xb11c, 0xb11d, 0xb11e, 0xb11f,
+ 0xb120, 0xb121, 0xb122, 0xb123, 0xb124, 0xb125, 0xb126, 0xb127,
+ 0xb128, 0xb129, 0xb12a, 0xb12b, 0xb12c, 0xb12d, 0xb12e, 0xb12f,
+ 0xb130, 0xb131, 0xb132, 0xb133, 0xb134, 0xb135, 0xb136, 0xb137,
+ 0xb138, 0xb139, 0xb13a, 0xb13b, 0xb13c, 0xb13d, 0xb13e, 0xb13f,
+ 0xb140, 0xb141, 0xb142, 0xb143, 0xb144, 0xb145, 0xb146, 0xb147,
+ 0xb148, 0xb149, 0xb14a, 0xb14b, 0xb14c, 0xb14d, 0xb14e, 0xb14f,
+ 0xb150, 0xb151, 0xb152, 0xb153, 0xb154, 0xb155, 0xb156, 0xb157,
+ 0xb158, 0xb159, 0xb15a, 0xb15b, 0xb15c, 0xb15d, 0xb15e, 0xb15f,
+ 0xb160, 0xb161, 0xb162, 0xb163, 0xb164, 0xb165, 0xb166, 0xb167,
+ 0xb168, 0xb169, 0xb16a, 0xb16b, 0xb16c, 0xb16d, 0xb16e, 0xb16f,
+ 0xb170, 0xb171, 0xb172, 0xb173, 0xb174, 0xb175, 0xb176, 0xb177,
+ 0xb178, 0xb179, 0xb17a, 0xb17b, 0xb17c, 0xb17d, 0xb17e, 0xb17f,
+ 0xb180, 0xb181, 0xb182, 0xb183, 0xb184, 0xb185, 0xb186, 0xb187,
+ 0xb188, 0xb189, 0xb18a, 0xb18b, 0xb18c, 0xb18d, 0xb18e, 0xb18f,
+ 0xb190, 0xb191, 0xb192, 0xb193, 0xb194, 0xb195, 0xb196, 0xb197,
+ 0xb198, 0xb199, 0xb19a, 0xb19b, 0xb19c, 0xb19d, 0xb19e, 0xb19f,
+ 0xb1a0, 0xb1a1, 0xb1a2, 0xb1a3, 0xb1a4, 0xb1a5, 0xb1a6, 0xb1a7,
+ 0xb1a8, 0xb1a9, 0xb1aa, 0xb1ab, 0xb1ac, 0xb1ad, 0xb1ae, 0xb1af,
+ 0xb1b0, 0xb1b1, 0xb1b2, 0xb1b3, 0xb1b4, 0xb1b5, 0xb1b6, 0xb1b7,
+ 0xb1b8, 0xb1b9, 0xb1ba, 0xb1bb, 0xb1bc, 0xb1bd, 0xb1be, 0xb1bf,
+ 0xb1c0, 0xb1c1, 0xb1c2, 0xb1c3, 0xb1c4, 0xb1c5, 0xb1c6, 0xb1c7,
+ 0xb1c8, 0xb1c9, 0xb1ca, 0xb1cb, 0xb1cc, 0xb1cd, 0xb1ce, 0xb1cf,
+ 0xb1d0, 0xb1d1, 0xb1d2, 0xb1d3, 0xb1d4, 0xb1d5, 0xb1d6, 0xb1d7,
+ 0xb1d8, 0xb1d9, 0xb1da, 0xb1db, 0xb1dc, 0xb1dd, 0xb1de, 0xb1df,
+ 0xb1e0, 0xb1e1, 0xb1e2, 0xb1e3, 0xb1e4, 0xb1e5, 0xb1e6, 0xb1e7,
+ 0xb1e8, 0xb1e9, 0xb1ea, 0xb1eb, 0xb1ec, 0xb1ed, 0xb1ee, 0xb1ef,
+ 0xb1f0, 0xb1f1, 0xb1f2, 0xb1f3, 0xb1f4, 0xb1f5, 0xb1f6, 0xb1f7,
+ 0xb1f8, 0xb1f9, 0xb1fa, 0xb1fb, 0xb1fc, 0xb1fd, 0xb1fe, 0xb1ff,
+ 0xb200, 0xb201, 0xb202, 0xb203, 0xb204, 0xb205, 0xb206, 0xb207,
+ 0xb208, 0xb209, 0xb20a, 0xb20b, 0xb20c, 0xb20d, 0xb20e, 0xb20f,
+ 0xb210, 0xb211, 0xb212, 0xb213, 0xb214, 0xb215, 0xb216, 0xb217,
+ 0xb218, 0xb219, 0xb21a, 0xb21b, 0xb21c, 0xb21d, 0xb21e, 0xb21f,
+ 0xb220, 0xb221, 0xb222, 0xb223, 0xb224, 0xb225, 0xb226, 0xb227,
+ 0xb228, 0xb229, 0xb22a, 0xb22b, 0xb22c, 0xb22d, 0xb22e, 0xb22f,
+ 0xb230, 0xb231, 0xb232, 0xb233, 0xb234, 0xb235, 0xb236, 0xb237,
+ 0xb238, 0xb239, 0xb23a, 0xb23b, 0xb23c, 0xb23d, 0xb23e, 0xb23f,
+ 0xb240, 0xb241, 0xb242, 0xb243, 0xb244, 0xb245, 0xb246, 0xb247,
+ 0xb248, 0xb249, 0xb24a, 0xb24b, 0xb24c, 0xb24d, 0xb24e, 0xb24f,
+ 0xb250, 0xb251, 0xb252, 0xb253, 0xb254, 0xb255, 0xb256, 0xb257,
+ 0xb258, 0xb259, 0xb25a, 0xb25b, 0xb25c, 0xb25d, 0xb25e, 0xb25f,
+ 0xb260, 0xb261, 0xb262, 0xb263, 0xb264, 0xb265, 0xb266, 0xb267,
+ 0xb268, 0xb269, 0xb26a, 0xb26b, 0xb26c, 0xb26d, 0xb26e, 0xb26f,
+ 0xb270, 0xb271, 0xb272, 0xb273, 0xb274, 0xb275, 0xb276, 0xb277,
+ 0xb278, 0xb279, 0xb27a, 0xb27b, 0xb27c, 0xb27d, 0xb27e, 0xb27f,
+ 0xb280, 0xb281, 0xb282, 0xb283, 0xb284, 0xb285, 0xb286, 0xb287,
+ 0xb288, 0xb289, 0xb28a, 0xb28b, 0xb28c, 0xb28d, 0xb28e, 0xb28f,
+ 0xb290, 0xb291, 0xb292, 0xb293, 0xb294, 0xb295, 0xb296, 0xb297,
+ 0xb298, 0xb299, 0xb29a, 0xb29b, 0xb29c, 0xb29d, 0xb29e, 0xb29f,
+ 0xb2a0, 0xb2a1, 0xb2a2, 0xb2a3, 0xb2a4, 0xb2a5, 0xb2a6, 0xb2a7,
+ 0xb2a8, 0xb2a9, 0xb2aa, 0xb2ab, 0xb2ac, 0xb2ad, 0xb2ae, 0xb2af,
+ 0xb2b0, 0xb2b1, 0xb2b2, 0xb2b3, 0xb2b4, 0xb2b5, 0xb2b6, 0xb2b7,
+ 0xb2b8, 0xb2b9, 0xb2ba, 0xb2bb, 0xb2bc, 0xb2bd, 0xb2be, 0xb2bf,
+ 0xb2c0, 0xb2c1, 0xb2c2, 0xb2c3, 0xb2c4, 0xb2c5, 0xb2c6, 0xb2c7,
+ 0xb2c8, 0xb2c9, 0xb2ca, 0xb2cb, 0xb2cc, 0xb2cd, 0xb2ce, 0xb2cf,
+ 0xb2d0, 0xb2d1, 0xb2d2, 0xb2d3, 0xb2d4, 0xb2d5, 0xb2d6, 0xb2d7,
+ 0xb2d8, 0xb2d9, 0xb2da, 0xb2db, 0xb2dc, 0xb2dd, 0xb2de, 0xb2df,
+ 0xb2e0, 0xb2e1, 0xb2e2, 0xb2e3, 0xb2e4, 0xb2e5, 0xb2e6, 0xb2e7,
+ 0xb2e8, 0xb2e9, 0xb2ea, 0xb2eb, 0xb2ec, 0xb2ed, 0xb2ee, 0xb2ef,
+ 0xb2f0, 0xb2f1, 0xb2f2, 0xb2f3, 0xb2f4, 0xb2f5, 0xb2f6, 0xb2f7,
+ 0xb2f8, 0xb2f9, 0xb2fa, 0xb2fb, 0xb2fc, 0xb2fd, 0xb2fe, 0xb2ff,
+ 0xb300, 0xb301, 0xb302, 0xb303, 0xb304, 0xb305, 0xb306, 0xb307,
+ 0xb308, 0xb309, 0xb30a, 0xb30b, 0xb30c, 0xb30d, 0xb30e, 0xb30f,
+ 0xb310, 0xb311, 0xb312, 0xb313, 0xb314, 0xb315, 0xb316, 0xb317,
+ 0xb318, 0xb319, 0xb31a, 0xb31b, 0xb31c, 0xb31d, 0xb31e, 0xb31f,
+ 0xb320, 0xb321, 0xb322, 0xb323, 0xb324, 0xb325, 0xb326, 0xb327,
+ 0xb328, 0xb329, 0xb32a, 0xb32b, 0xb32c, 0xb32d, 0xb32e, 0xb32f,
+ 0xb330, 0xb331, 0xb332, 0xb333, 0xb334, 0xb335, 0xb336, 0xb337,
+ 0xb338, 0xb339, 0xb33a, 0xb33b, 0xb33c, 0xb33d, 0xb33e, 0xb33f,
+ 0xb340, 0xb341, 0xb342, 0xb343, 0xb344, 0xb345, 0xb346, 0xb347,
+ 0xb348, 0xb349, 0xb34a, 0xb34b, 0xb34c, 0xb34d, 0xb34e, 0xb34f,
+ 0xb350, 0xb351, 0xb352, 0xb353, 0xb354, 0xb355, 0xb356, 0xb357,
+ 0xb358, 0xb359, 0xb35a, 0xb35b, 0xb35c, 0xb35d, 0xb35e, 0xb35f,
+ 0xb360, 0xb361, 0xb362, 0xb363, 0xb364, 0xb365, 0xb366, 0xb367,
+ 0xb368, 0xb369, 0xb36a, 0xb36b, 0xb36c, 0xb36d, 0xb36e, 0xb36f,
+ 0xb370, 0xb371, 0xb372, 0xb373, 0xb374, 0xb375, 0xb376, 0xb377,
+ 0xb378, 0xb379, 0xb37a, 0xb37b, 0xb37c, 0xb37d, 0xb37e, 0xb37f,
+ 0xb380, 0xb381, 0xb382, 0xb383, 0xb384, 0xb385, 0xb386, 0xb387,
+ 0xb388, 0xb389, 0xb38a, 0xb38b, 0xb38c, 0xb38d, 0xb38e, 0xb38f,
+ 0xb390, 0xb391, 0xb392, 0xb393, 0xb394, 0xb395, 0xb396, 0xb397,
+ 0xb398, 0xb399, 0xb39a, 0xb39b, 0xb39c, 0xb39d, 0xb39e, 0xb39f,
+ 0xb3a0, 0xb3a1, 0xb3a2, 0xb3a3, 0xb3a4, 0xb3a5, 0xb3a6, 0xb3a7,
+ 0xb3a8, 0xb3a9, 0xb3aa, 0xb3ab, 0xb3ac, 0xb3ad, 0xb3ae, 0xb3af,
+ 0xb3b0, 0xb3b1, 0xb3b2, 0xb3b3, 0xb3b4, 0xb3b5, 0xb3b6, 0xb3b7,
+ 0xb3b8, 0xb3b9, 0xb3ba, 0xb3bb, 0xb3bc, 0xb3bd, 0xb3be, 0xb3bf,
+ 0xb3c0, 0xb3c1, 0xb3c2, 0xb3c3, 0xb3c4, 0xb3c5, 0xb3c6, 0xb3c7,
+ 0xb3c8, 0xb3c9, 0xb3ca, 0xb3cb, 0xb3cc, 0xb3cd, 0xb3ce, 0xb3cf,
+ 0xb3d0, 0xb3d1, 0xb3d2, 0xb3d3, 0xb3d4, 0xb3d5, 0xb3d6, 0xb3d7,
+ 0xb3d8, 0xb3d9, 0xb3da, 0xb3db, 0xb3dc, 0xb3dd, 0xb3de, 0xb3df,
+ 0xb3e0, 0xb3e1, 0xb3e2, 0xb3e3, 0xb3e4, 0xb3e5, 0xb3e6, 0xb3e7,
+ 0xb3e8, 0xb3e9, 0xb3ea, 0xb3eb, 0xb3ec, 0xb3ed, 0xb3ee, 0xb3ef,
+ 0xb3f0, 0xb3f1, 0xb3f2, 0xb3f3, 0xb3f4, 0xb3f5, 0xb3f6, 0xb3f7,
+ 0xb3f8, 0xb3f9, 0xb3fa, 0xb3fb, 0xb3fc, 0xb3fd, 0xb3fe, 0xb3ff,
+ 0xb400, 0xb401, 0xb402, 0xb403, 0xb404, 0xb405, 0xb406, 0xb407,
+ 0xb408, 0xb409, 0xb40a, 0xb40b, 0xb40c, 0xb40d, 0xb40e, 0xb40f,
+ 0xb410, 0xb411, 0xb412, 0xb413, 0xb414, 0xb415, 0xb416, 0xb417,
+ 0xb418, 0xb419, 0xb41a, 0xb41b, 0xb41c, 0xb41d, 0xb41e, 0xb41f,
+ 0xb420, 0xb421, 0xb422, 0xb423, 0xb424, 0xb425, 0xb426, 0xb427,
+ 0xb428, 0xb429, 0xb42a, 0xb42b, 0xb42c, 0xb42d, 0xb42e, 0xb42f,
+ 0xb430, 0xb431, 0xb432, 0xb433, 0xb434, 0xb435, 0xb436, 0xb437,
+ 0xb438, 0xb439, 0xb43a, 0xb43b, 0xb43c, 0xb43d, 0xb43e, 0xb43f,
+ 0xb440, 0xb441, 0xb442, 0xb443, 0xb444, 0xb445, 0xb446, 0xb447,
+ 0xb448, 0xb449, 0xb44a, 0xb44b, 0xb44c, 0xb44d, 0xb44e, 0xb44f,
+ 0xb450, 0xb451, 0xb452, 0xb453, 0xb454, 0xb455, 0xb456, 0xb457,
+ 0xb458, 0xb459, 0xb45a, 0xb45b, 0xb45c, 0xb45d, 0xb45e, 0xb45f,
+ 0xb460, 0xb461, 0xb462, 0xb463, 0xb464, 0xb465, 0xb466, 0xb467,
+ 0xb468, 0xb469, 0xb46a, 0xb46b, 0xb46c, 0xb46d, 0xb46e, 0xb46f,
+ 0xb470, 0xb471, 0xb472, 0xb473, 0xb474, 0xb475, 0xb476, 0xb477,
+ 0xb478, 0xb479, 0xb47a, 0xb47b, 0xb47c, 0xb47d, 0xb47e, 0xb47f,
+ 0xb480, 0xb481, 0xb482, 0xb483, 0xb484, 0xb485, 0xb486, 0xb487,
+ 0xb488, 0xb489, 0xb48a, 0xb48b, 0xb48c, 0xb48d, 0xb48e, 0xb48f,
+ 0xb490, 0xb491, 0xb492, 0xb493, 0xb494, 0xb495, 0xb496, 0xb497,
+ 0xb498, 0xb499, 0xb49a, 0xb49b, 0xb49c, 0xb49d, 0xb49e, 0xb49f,
+ 0xb4a0, 0xb4a1, 0xb4a2, 0xb4a3, 0xb4a4, 0xb4a5, 0xb4a6, 0xb4a7,
+ 0xb4a8, 0xb4a9, 0xb4aa, 0xb4ab, 0xb4ac, 0xb4ad, 0xb4ae, 0xb4af,
+ 0xb4b0, 0xb4b1, 0xb4b2, 0xb4b3, 0xb4b4, 0xb4b5, 0xb4b6, 0xb4b7,
+ 0xb4b8, 0xb4b9, 0xb4ba, 0xb4bb, 0xb4bc, 0xb4bd, 0xb4be, 0xb4bf,
+ 0xb4c0, 0xb4c1, 0xb4c2, 0xb4c3, 0xb4c4, 0xb4c5, 0xb4c6, 0xb4c7,
+ 0xb4c8, 0xb4c9, 0xb4ca, 0xb4cb, 0xb4cc, 0xb4cd, 0xb4ce, 0xb4cf,
+ 0xb4d0, 0xb4d1, 0xb4d2, 0xb4d3, 0xb4d4, 0xb4d5, 0xb4d6, 0xb4d7,
+ 0xb4d8, 0xb4d9, 0xb4da, 0xb4db, 0xb4dc, 0xb4dd, 0xb4de, 0xb4df,
+ 0xb4e0, 0xb4e1, 0xb4e2, 0xb4e3, 0xb4e4, 0xb4e5, 0xb4e6, 0xb4e7,
+ 0xb4e8, 0xb4e9, 0xb4ea, 0xb4eb, 0xb4ec, 0xb4ed, 0xb4ee, 0xb4ef,
+ 0xb4f0, 0xb4f1, 0xb4f2, 0xb4f3, 0xb4f4, 0xb4f5, 0xb4f6, 0xb4f7,
+ 0xb4f8, 0xb4f9, 0xb4fa, 0xb4fb, 0xb4fc, 0xb4fd, 0xb4fe, 0xb4ff,
+ 0xb500, 0xb501, 0xb502, 0xb503, 0xb504, 0xb505, 0xb506, 0xb507,
+ 0xb508, 0xb509, 0xb50a, 0xb50b, 0xb50c, 0xb50d, 0xb50e, 0xb50f,
+ 0xb510, 0xb511, 0xb512, 0xb513, 0xb514, 0xb515, 0xb516, 0xb517,
+ 0xb518, 0xb519, 0xb51a, 0xb51b, 0xb51c, 0xb51d, 0xb51e, 0xb51f,
+ 0xb520, 0xb521, 0xb522, 0xb523, 0xb524, 0xb525, 0xb526, 0xb527,
+ 0xb528, 0xb529, 0xb52a, 0xb52b, 0xb52c, 0xb52d, 0xb52e, 0xb52f,
+ 0xb530, 0xb531, 0xb532, 0xb533, 0xb534, 0xb535, 0xb536, 0xb537,
+ 0xb538, 0xb539, 0xb53a, 0xb53b, 0xb53c, 0xb53d, 0xb53e, 0xb53f,
+ 0xb540, 0xb541, 0xb542, 0xb543, 0xb544, 0xb545, 0xb546, 0xb547,
+ 0xb548, 0xb549, 0xb54a, 0xb54b, 0xb54c, 0xb54d, 0xb54e, 0xb54f,
+ 0xb550, 0xb551, 0xb552, 0xb553, 0xb554, 0xb555, 0xb556, 0xb557,
+ 0xb558, 0xb559, 0xb55a, 0xb55b, 0xb55c, 0xb55d, 0xb55e, 0xb55f,
+ 0xb560, 0xb561, 0xb562, 0xb563, 0xb564, 0xb565, 0xb566, 0xb567,
+ 0xb568, 0xb569, 0xb56a, 0xb56b, 0xb56c, 0xb56d, 0xb56e, 0xb56f,
+ 0xb570, 0xb571, 0xb572, 0xb573, 0xb574, 0xb575, 0xb576, 0xb577,
+ 0xb578, 0xb579, 0xb57a, 0xb57b, 0xb57c, 0xb57d, 0xb57e, 0xb57f,
+ 0xb580, 0xb581, 0xb582, 0xb583, 0xb584, 0xb585, 0xb586, 0xb587,
+ 0xb588, 0xb589, 0xb58a, 0xb58b, 0xb58c, 0xb58d, 0xb58e, 0xb58f,
+ 0xb590, 0xb591, 0xb592, 0xb593, 0xb594, 0xb595, 0xb596, 0xb597,
+ 0xb598, 0xb599, 0xb59a, 0xb59b, 0xb59c, 0xb59d, 0xb59e, 0xb59f,
+ 0xb5a0, 0xb5a1, 0xb5a2, 0xb5a3, 0xb5a4, 0xb5a5, 0xb5a6, 0xb5a7,
+ 0xb5a8, 0xb5a9, 0xb5aa, 0xb5ab, 0xb5ac, 0xb5ad, 0xb5ae, 0xb5af,
+ 0xb5b0, 0xb5b1, 0xb5b2, 0xb5b3, 0xb5b4, 0xb5b5, 0xb5b6, 0xb5b7,
+ 0xb5b8, 0xb5b9, 0xb5ba, 0xb5bb, 0xb5bc, 0xb5bd, 0xb5be, 0xb5bf,
+ 0xb5c0, 0xb5c1, 0xb5c2, 0xb5c3, 0xb5c4, 0xb5c5, 0xb5c6, 0xb5c7,
+ 0xb5c8, 0xb5c9, 0xb5ca, 0xb5cb, 0xb5cc, 0xb5cd, 0xb5ce, 0xb5cf,
+ 0xb5d0, 0xb5d1, 0xb5d2, 0xb5d3, 0xb5d4, 0xb5d5, 0xb5d6, 0xb5d7,
+ 0xb5d8, 0xb5d9, 0xb5da, 0xb5db, 0xb5dc, 0xb5dd, 0xb5de, 0xb5df,
+ 0xb5e0, 0xb5e1, 0xb5e2, 0xb5e3, 0xb5e4, 0xb5e5, 0xb5e6, 0xb5e7,
+ 0xb5e8, 0xb5e9, 0xb5ea, 0xb5eb, 0xb5ec, 0xb5ed, 0xb5ee, 0xb5ef,
+ 0xb5f0, 0xb5f1, 0xb5f2, 0xb5f3, 0xb5f4, 0xb5f5, 0xb5f6, 0xb5f7,
+ 0xb5f8, 0xb5f9, 0xb5fa, 0xb5fb, 0xb5fc, 0xb5fd, 0xb5fe, 0xb5ff,
+ 0xb600, 0xb601, 0xb602, 0xb603, 0xb604, 0xb605, 0xb606, 0xb607,
+ 0xb608, 0xb609, 0xb60a, 0xb60b, 0xb60c, 0xb60d, 0xb60e, 0xb60f,
+ 0xb610, 0xb611, 0xb612, 0xb613, 0xb614, 0xb615, 0xb616, 0xb617,
+ 0xb618, 0xb619, 0xb61a, 0xb61b, 0xb61c, 0xb61d, 0xb61e, 0xb61f,
+ 0xb620, 0xb621, 0xb622, 0xb623, 0xb624, 0xb625, 0xb626, 0xb627,
+ 0xb628, 0xb629, 0xb62a, 0xb62b, 0xb62c, 0xb62d, 0xb62e, 0xb62f,
+ 0xb630, 0xb631, 0xb632, 0xb633, 0xb634, 0xb635, 0xb636, 0xb637,
+ 0xb638, 0xb639, 0xb63a, 0xb63b, 0xb63c, 0xb63d, 0xb63e, 0xb63f,
+ 0xb640, 0xb641, 0xb642, 0xb643, 0xb644, 0xb645, 0xb646, 0xb647,
+ 0xb648, 0xb649, 0xb64a, 0xb64b, 0xb64c, 0xb64d, 0xb64e, 0xb64f,
+ 0xb650, 0xb651, 0xb652, 0xb653, 0xb654, 0xb655, 0xb656, 0xb657,
+ 0xb658, 0xb659, 0xb65a, 0xb65b, 0xb65c, 0xb65d, 0xb65e, 0xb65f,
+ 0xb660, 0xb661, 0xb662, 0xb663, 0xb664, 0xb665, 0xb666, 0xb667,
+ 0xb668, 0xb669, 0xb66a, 0xb66b, 0xb66c, 0xb66d, 0xb66e, 0xb66f,
+ 0xb670, 0xb671, 0xb672, 0xb673, 0xb674, 0xb675, 0xb676, 0xb677,
+ 0xb678, 0xb679, 0xb67a, 0xb67b, 0xb67c, 0xb67d, 0xb67e, 0xb67f,
+ 0xb680, 0xb681, 0xb682, 0xb683, 0xb684, 0xb685, 0xb686, 0xb687,
+ 0xb688, 0xb689, 0xb68a, 0xb68b, 0xb68c, 0xb68d, 0xb68e, 0xb68f,
+ 0xb690, 0xb691, 0xb692, 0xb693, 0xb694, 0xb695, 0xb696, 0xb697,
+ 0xb698, 0xb699, 0xb69a, 0xb69b, 0xb69c, 0xb69d, 0xb69e, 0xb69f,
+ 0xb6a0, 0xb6a1, 0xb6a2, 0xb6a3, 0xb6a4, 0xb6a5, 0xb6a6, 0xb6a7,
+ 0xb6a8, 0xb6a9, 0xb6aa, 0xb6ab, 0xb6ac, 0xb6ad, 0xb6ae, 0xb6af,
+ 0xb6b0, 0xb6b1, 0xb6b2, 0xb6b3, 0xb6b4, 0xb6b5, 0xb6b6, 0xb6b7,
+ 0xb6b8, 0xb6b9, 0xb6ba, 0xb6bb, 0xb6bc, 0xb6bd, 0xb6be, 0xb6bf,
+ 0xb6c0, 0xb6c1, 0xb6c2, 0xb6c3, 0xb6c4, 0xb6c5, 0xb6c6, 0xb6c7,
+ 0xb6c8, 0xb6c9, 0xb6ca, 0xb6cb, 0xb6cc, 0xb6cd, 0xb6ce, 0xb6cf,
+ 0xb6d0, 0xb6d1, 0xb6d2, 0xb6d3, 0xb6d4, 0xb6d5, 0xb6d6, 0xb6d7,
+ 0xb6d8, 0xb6d9, 0xb6da, 0xb6db, 0xb6dc, 0xb6dd, 0xb6de, 0xb6df,
+ 0xb6e0, 0xb6e1, 0xb6e2, 0xb6e3, 0xb6e4, 0xb6e5, 0xb6e6, 0xb6e7,
+ 0xb6e8, 0xb6e9, 0xb6ea, 0xb6eb, 0xb6ec, 0xb6ed, 0xb6ee, 0xb6ef,
+ 0xb6f0, 0xb6f1, 0xb6f2, 0xb6f3, 0xb6f4, 0xb6f5, 0xb6f6, 0xb6f7,
+ 0xb6f8, 0xb6f9, 0xb6fa, 0xb6fb, 0xb6fc, 0xb6fd, 0xb6fe, 0xb6ff,
+ 0xb700, 0xb701, 0xb702, 0xb703, 0xb704, 0xb705, 0xb706, 0xb707,
+ 0xb708, 0xb709, 0xb70a, 0xb70b, 0xb70c, 0xb70d, 0xb70e, 0xb70f,
+ 0xb710, 0xb711, 0xb712, 0xb713, 0xb714, 0xb715, 0xb716, 0xb717,
+ 0xb718, 0xb719, 0xb71a, 0xb71b, 0xb71c, 0xb71d, 0xb71e, 0xb71f,
+ 0xb720, 0xb721, 0xb722, 0xb723, 0xb724, 0xb725, 0xb726, 0xb727,
+ 0xb728, 0xb729, 0xb72a, 0xb72b, 0xb72c, 0xb72d, 0xb72e, 0xb72f,
+ 0xb730, 0xb731, 0xb732, 0xb733, 0xb734, 0xb735, 0xb736, 0xb737,
+ 0xb738, 0xb739, 0xb73a, 0xb73b, 0xb73c, 0xb73d, 0xb73e, 0xb73f,
+ 0xb740, 0xb741, 0xb742, 0xb743, 0xb744, 0xb745, 0xb746, 0xb747,
+ 0xb748, 0xb749, 0xb74a, 0xb74b, 0xb74c, 0xb74d, 0xb74e, 0xb74f,
+ 0xb750, 0xb751, 0xb752, 0xb753, 0xb754, 0xb755, 0xb756, 0xb757,
+ 0xb758, 0xb759, 0xb75a, 0xb75b, 0xb75c, 0xb75d, 0xb75e, 0xb75f,
+ 0xb760, 0xb761, 0xb762, 0xb763, 0xb764, 0xb765, 0xb766, 0xb767,
+ 0xb768, 0xb769, 0xb76a, 0xb76b, 0xb76c, 0xb76d, 0xb76e, 0xb76f,
+ 0xb770, 0xb771, 0xb772, 0xb773, 0xb774, 0xb775, 0xb776, 0xb777,
+ 0xb778, 0xb779, 0xb77a, 0xb77b, 0xb77c, 0xb77d, 0xb77e, 0xb77f,
+ 0xb780, 0xb781, 0xb782, 0xb783, 0xb784, 0xb785, 0xb786, 0xb787,
+ 0xb788, 0xb789, 0xb78a, 0xb78b, 0xb78c, 0xb78d, 0xb78e, 0xb78f,
+ 0xb790, 0xb791, 0xb792, 0xb793, 0xb794, 0xb795, 0xb796, 0xb797,
+ 0xb798, 0xb799, 0xb79a, 0xb79b, 0xb79c, 0xb79d, 0xb79e, 0xb79f,
+ 0xb7a0, 0xb7a1, 0xb7a2, 0xb7a3, 0xb7a4, 0xb7a5, 0xb7a6, 0xb7a7,
+ 0xb7a8, 0xb7a9, 0xb7aa, 0xb7ab, 0xb7ac, 0xb7ad, 0xb7ae, 0xb7af,
+ 0xb7b0, 0xb7b1, 0xb7b2, 0xb7b3, 0xb7b4, 0xb7b5, 0xb7b6, 0xb7b7,
+ 0xb7b8, 0xb7b9, 0xb7ba, 0xb7bb, 0xb7bc, 0xb7bd, 0xb7be, 0xb7bf,
+ 0xb7c0, 0xb7c1, 0xb7c2, 0xb7c3, 0xb7c4, 0xb7c5, 0xb7c6, 0xb7c7,
+ 0xb7c8, 0xb7c9, 0xb7ca, 0xb7cb, 0xb7cc, 0xb7cd, 0xb7ce, 0xb7cf,
+ 0xb7d0, 0xb7d1, 0xb7d2, 0xb7d3, 0xb7d4, 0xb7d5, 0xb7d6, 0xb7d7,
+ 0xb7d8, 0xb7d9, 0xb7da, 0xb7db, 0xb7dc, 0xb7dd, 0xb7de, 0xb7df,
+ 0xb7e0, 0xb7e1, 0xb7e2, 0xb7e3, 0xb7e4, 0xb7e5, 0xb7e6, 0xb7e7,
+ 0xb7e8, 0xb7e9, 0xb7ea, 0xb7eb, 0xb7ec, 0xb7ed, 0xb7ee, 0xb7ef,
+ 0xb7f0, 0xb7f1, 0xb7f2, 0xb7f3, 0xb7f4, 0xb7f5, 0xb7f6, 0xb7f7,
+ 0xb7f8, 0xb7f9, 0xb7fa, 0xb7fb, 0xb7fc, 0xb7fd, 0xb7fe, 0xb7ff,
+ 0xb800, 0xb801, 0xb802, 0xb803, 0xb804, 0xb805, 0xb806, 0xb807,
+ 0xb808, 0xb809, 0xb80a, 0xb80b, 0xb80c, 0xb80d, 0xb80e, 0xb80f,
+ 0xb810, 0xb811, 0xb812, 0xb813, 0xb814, 0xb815, 0xb816, 0xb817,
+ 0xb818, 0xb819, 0xb81a, 0xb81b, 0xb81c, 0xb81d, 0xb81e, 0xb81f,
+ 0xb820, 0xb821, 0xb822, 0xb823, 0xb824, 0xb825, 0xb826, 0xb827,
+ 0xb828, 0xb829, 0xb82a, 0xb82b, 0xb82c, 0xb82d, 0xb82e, 0xb82f,
+ 0xb830, 0xb831, 0xb832, 0xb833, 0xb834, 0xb835, 0xb836, 0xb837,
+ 0xb838, 0xb839, 0xb83a, 0xb83b, 0xb83c, 0xb83d, 0xb83e, 0xb83f,
+ 0xb840, 0xb841, 0xb842, 0xb843, 0xb844, 0xb845, 0xb846, 0xb847,
+ 0xb848, 0xb849, 0xb84a, 0xb84b, 0xb84c, 0xb84d, 0xb84e, 0xb84f,
+ 0xb850, 0xb851, 0xb852, 0xb853, 0xb854, 0xb855, 0xb856, 0xb857,
+ 0xb858, 0xb859, 0xb85a, 0xb85b, 0xb85c, 0xb85d, 0xb85e, 0xb85f,
+ 0xb860, 0xb861, 0xb862, 0xb863, 0xb864, 0xb865, 0xb866, 0xb867,
+ 0xb868, 0xb869, 0xb86a, 0xb86b, 0xb86c, 0xb86d, 0xb86e, 0xb86f,
+ 0xb870, 0xb871, 0xb872, 0xb873, 0xb874, 0xb875, 0xb876, 0xb877,
+ 0xb878, 0xb879, 0xb87a, 0xb87b, 0xb87c, 0xb87d, 0xb87e, 0xb87f,
+ 0xb880, 0xb881, 0xb882, 0xb883, 0xb884, 0xb885, 0xb886, 0xb887,
+ 0xb888, 0xb889, 0xb88a, 0xb88b, 0xb88c, 0xb88d, 0xb88e, 0xb88f,
+ 0xb890, 0xb891, 0xb892, 0xb893, 0xb894, 0xb895, 0xb896, 0xb897,
+ 0xb898, 0xb899, 0xb89a, 0xb89b, 0xb89c, 0xb89d, 0xb89e, 0xb89f,
+ 0xb8a0, 0xb8a1, 0xb8a2, 0xb8a3, 0xb8a4, 0xb8a5, 0xb8a6, 0xb8a7,
+ 0xb8a8, 0xb8a9, 0xb8aa, 0xb8ab, 0xb8ac, 0xb8ad, 0xb8ae, 0xb8af,
+ 0xb8b0, 0xb8b1, 0xb8b2, 0xb8b3, 0xb8b4, 0xb8b5, 0xb8b6, 0xb8b7,
+ 0xb8b8, 0xb8b9, 0xb8ba, 0xb8bb, 0xb8bc, 0xb8bd, 0xb8be, 0xb8bf,
+ 0xb8c0, 0xb8c1, 0xb8c2, 0xb8c3, 0xb8c4, 0xb8c5, 0xb8c6, 0xb8c7,
+ 0xb8c8, 0xb8c9, 0xb8ca, 0xb8cb, 0xb8cc, 0xb8cd, 0xb8ce, 0xb8cf,
+ 0xb8d0, 0xb8d1, 0xb8d2, 0xb8d3, 0xb8d4, 0xb8d5, 0xb8d6, 0xb8d7,
+ 0xb8d8, 0xb8d9, 0xb8da, 0xb8db, 0xb8dc, 0xb8dd, 0xb8de, 0xb8df,
+ 0xb8e0, 0xb8e1, 0xb8e2, 0xb8e3, 0xb8e4, 0xb8e5, 0xb8e6, 0xb8e7,
+ 0xb8e8, 0xb8e9, 0xb8ea, 0xb8eb, 0xb8ec, 0xb8ed, 0xb8ee, 0xb8ef,
+ 0xb8f0, 0xb8f1, 0xb8f2, 0xb8f3, 0xb8f4, 0xb8f5, 0xb8f6, 0xb8f7,
+ 0xb8f8, 0xb8f9, 0xb8fa, 0xb8fb, 0xb8fc, 0xb8fd, 0xb8fe, 0xb8ff,
+ 0xb900, 0xb901, 0xb902, 0xb903, 0xb904, 0xb905, 0xb906, 0xb907,
+ 0xb908, 0xb909, 0xb90a, 0xb90b, 0xb90c, 0xb90d, 0xb90e, 0xb90f,
+ 0xb910, 0xb911, 0xb912, 0xb913, 0xb914, 0xb915, 0xb916, 0xb917,
+ 0xb918, 0xb919, 0xb91a, 0xb91b, 0xb91c, 0xb91d, 0xb91e, 0xb91f,
+ 0xb920, 0xb921, 0xb922, 0xb923, 0xb924, 0xb925, 0xb926, 0xb927,
+ 0xb928, 0xb929, 0xb92a, 0xb92b, 0xb92c, 0xb92d, 0xb92e, 0xb92f,
+ 0xb930, 0xb931, 0xb932, 0xb933, 0xb934, 0xb935, 0xb936, 0xb937,
+ 0xb938, 0xb939, 0xb93a, 0xb93b, 0xb93c, 0xb93d, 0xb93e, 0xb93f,
+ 0xb940, 0xb941, 0xb942, 0xb943, 0xb944, 0xb945, 0xb946, 0xb947,
+ 0xb948, 0xb949, 0xb94a, 0xb94b, 0xb94c, 0xb94d, 0xb94e, 0xb94f,
+ 0xb950, 0xb951, 0xb952, 0xb953, 0xb954, 0xb955, 0xb956, 0xb957,
+ 0xb958, 0xb959, 0xb95a, 0xb95b, 0xb95c, 0xb95d, 0xb95e, 0xb95f,
+ 0xb960, 0xb961, 0xb962, 0xb963, 0xb964, 0xb965, 0xb966, 0xb967,
+ 0xb968, 0xb969, 0xb96a, 0xb96b, 0xb96c, 0xb96d, 0xb96e, 0xb96f,
+ 0xb970, 0xb971, 0xb972, 0xb973, 0xb974, 0xb975, 0xb976, 0xb977,
+ 0xb978, 0xb979, 0xb97a, 0xb97b, 0xb97c, 0xb97d, 0xb97e, 0xb97f,
+ 0xb980, 0xb981, 0xb982, 0xb983, 0xb984, 0xb985, 0xb986, 0xb987,
+ 0xb988, 0xb989, 0xb98a, 0xb98b, 0xb98c, 0xb98d, 0xb98e, 0xb98f,
+ 0xb990, 0xb991, 0xb992, 0xb993, 0xb994, 0xb995, 0xb996, 0xb997,
+ 0xb998, 0xb999, 0xb99a, 0xb99b, 0xb99c, 0xb99d, 0xb99e, 0xb99f,
+ 0xb9a0, 0xb9a1, 0xb9a2, 0xb9a3, 0xb9a4, 0xb9a5, 0xb9a6, 0xb9a7,
+ 0xb9a8, 0xb9a9, 0xb9aa, 0xb9ab, 0xb9ac, 0xb9ad, 0xb9ae, 0xb9af,
+ 0xb9b0, 0xb9b1, 0xb9b2, 0xb9b3, 0xb9b4, 0xb9b5, 0xb9b6, 0xb9b7,
+ 0xb9b8, 0xb9b9, 0xb9ba, 0xb9bb, 0xb9bc, 0xb9bd, 0xb9be, 0xb9bf,
+ 0xb9c0, 0xb9c1, 0xb9c2, 0xb9c3, 0xb9c4, 0xb9c5, 0xb9c6, 0xb9c7,
+ 0xb9c8, 0xb9c9, 0xb9ca, 0xb9cb, 0xb9cc, 0xb9cd, 0xb9ce, 0xb9cf,
+ 0xb9d0, 0xb9d1, 0xb9d2, 0xb9d3, 0xb9d4, 0xb9d5, 0xb9d6, 0xb9d7,
+ 0xb9d8, 0xb9d9, 0xb9da, 0xb9db, 0xb9dc, 0xb9dd, 0xb9de, 0xb9df,
+ 0xb9e0, 0xb9e1, 0xb9e2, 0xb9e3, 0xb9e4, 0xb9e5, 0xb9e6, 0xb9e7,
+ 0xb9e8, 0xb9e9, 0xb9ea, 0xb9eb, 0xb9ec, 0xb9ed, 0xb9ee, 0xb9ef,
+ 0xb9f0, 0xb9f1, 0xb9f2, 0xb9f3, 0xb9f4, 0xb9f5, 0xb9f6, 0xb9f7,
+ 0xb9f8, 0xb9f9, 0xb9fa, 0xb9fb, 0xb9fc, 0xb9fd, 0xb9fe, 0xb9ff,
+ 0xba00, 0xba01, 0xba02, 0xba03, 0xba04, 0xba05, 0xba06, 0xba07,
+ 0xba08, 0xba09, 0xba0a, 0xba0b, 0xba0c, 0xba0d, 0xba0e, 0xba0f,
+ 0xba10, 0xba11, 0xba12, 0xba13, 0xba14, 0xba15, 0xba16, 0xba17,
+ 0xba18, 0xba19, 0xba1a, 0xba1b, 0xba1c, 0xba1d, 0xba1e, 0xba1f,
+ 0xba20, 0xba21, 0xba22, 0xba23, 0xba24, 0xba25, 0xba26, 0xba27,
+ 0xba28, 0xba29, 0xba2a, 0xba2b, 0xba2c, 0xba2d, 0xba2e, 0xba2f,
+ 0xba30, 0xba31, 0xba32, 0xba33, 0xba34, 0xba35, 0xba36, 0xba37,
+ 0xba38, 0xba39, 0xba3a, 0xba3b, 0xba3c, 0xba3d, 0xba3e, 0xba3f,
+ 0xba40, 0xba41, 0xba42, 0xba43, 0xba44, 0xba45, 0xba46, 0xba47,
+ 0xba48, 0xba49, 0xba4a, 0xba4b, 0xba4c, 0xba4d, 0xba4e, 0xba4f,
+ 0xba50, 0xba51, 0xba52, 0xba53, 0xba54, 0xba55, 0xba56, 0xba57,
+ 0xba58, 0xba59, 0xba5a, 0xba5b, 0xba5c, 0xba5d, 0xba5e, 0xba5f,
+ 0xba60, 0xba61, 0xba62, 0xba63, 0xba64, 0xba65, 0xba66, 0xba67,
+ 0xba68, 0xba69, 0xba6a, 0xba6b, 0xba6c, 0xba6d, 0xba6e, 0xba6f,
+ 0xba70, 0xba71, 0xba72, 0xba73, 0xba74, 0xba75, 0xba76, 0xba77,
+ 0xba78, 0xba79, 0xba7a, 0xba7b, 0xba7c, 0xba7d, 0xba7e, 0xba7f,
+ 0xba80, 0xba81, 0xba82, 0xba83, 0xba84, 0xba85, 0xba86, 0xba87,
+ 0xba88, 0xba89, 0xba8a, 0xba8b, 0xba8c, 0xba8d, 0xba8e, 0xba8f,
+ 0xba90, 0xba91, 0xba92, 0xba93, 0xba94, 0xba95, 0xba96, 0xba97,
+ 0xba98, 0xba99, 0xba9a, 0xba9b, 0xba9c, 0xba9d, 0xba9e, 0xba9f,
+ 0xbaa0, 0xbaa1, 0xbaa2, 0xbaa3, 0xbaa4, 0xbaa5, 0xbaa6, 0xbaa7,
+ 0xbaa8, 0xbaa9, 0xbaaa, 0xbaab, 0xbaac, 0xbaad, 0xbaae, 0xbaaf,
+ 0xbab0, 0xbab1, 0xbab2, 0xbab3, 0xbab4, 0xbab5, 0xbab6, 0xbab7,
+ 0xbab8, 0xbab9, 0xbaba, 0xbabb, 0xbabc, 0xbabd, 0xbabe, 0xbabf,
+ 0xbac0, 0xbac1, 0xbac2, 0xbac3, 0xbac4, 0xbac5, 0xbac6, 0xbac7,
+ 0xbac8, 0xbac9, 0xbaca, 0xbacb, 0xbacc, 0xbacd, 0xbace, 0xbacf,
+ 0xbad0, 0xbad1, 0xbad2, 0xbad3, 0xbad4, 0xbad5, 0xbad6, 0xbad7,
+ 0xbad8, 0xbad9, 0xbada, 0xbadb, 0xbadc, 0xbadd, 0xbade, 0xbadf,
+ 0xbae0, 0xbae1, 0xbae2, 0xbae3, 0xbae4, 0xbae5, 0xbae6, 0xbae7,
+ 0xbae8, 0xbae9, 0xbaea, 0xbaeb, 0xbaec, 0xbaed, 0xbaee, 0xbaef,
+ 0xbaf0, 0xbaf1, 0xbaf2, 0xbaf3, 0xbaf4, 0xbaf5, 0xbaf6, 0xbaf7,
+ 0xbaf8, 0xbaf9, 0xbafa, 0xbafb, 0xbafc, 0xbafd, 0xbafe, 0xbaff,
+ 0xbb00, 0xbb01, 0xbb02, 0xbb03, 0xbb04, 0xbb05, 0xbb06, 0xbb07,
+ 0xbb08, 0xbb09, 0xbb0a, 0xbb0b, 0xbb0c, 0xbb0d, 0xbb0e, 0xbb0f,
+ 0xbb10, 0xbb11, 0xbb12, 0xbb13, 0xbb14, 0xbb15, 0xbb16, 0xbb17,
+ 0xbb18, 0xbb19, 0xbb1a, 0xbb1b, 0xbb1c, 0xbb1d, 0xbb1e, 0xbb1f,
+ 0xbb20, 0xbb21, 0xbb22, 0xbb23, 0xbb24, 0xbb25, 0xbb26, 0xbb27,
+ 0xbb28, 0xbb29, 0xbb2a, 0xbb2b, 0xbb2c, 0xbb2d, 0xbb2e, 0xbb2f,
+ 0xbb30, 0xbb31, 0xbb32, 0xbb33, 0xbb34, 0xbb35, 0xbb36, 0xbb37,
+ 0xbb38, 0xbb39, 0xbb3a, 0xbb3b, 0xbb3c, 0xbb3d, 0xbb3e, 0xbb3f,
+ 0xbb40, 0xbb41, 0xbb42, 0xbb43, 0xbb44, 0xbb45, 0xbb46, 0xbb47,
+ 0xbb48, 0xbb49, 0xbb4a, 0xbb4b, 0xbb4c, 0xbb4d, 0xbb4e, 0xbb4f,
+ 0xbb50, 0xbb51, 0xbb52, 0xbb53, 0xbb54, 0xbb55, 0xbb56, 0xbb57,
+ 0xbb58, 0xbb59, 0xbb5a, 0xbb5b, 0xbb5c, 0xbb5d, 0xbb5e, 0xbb5f,
+ 0xbb60, 0xbb61, 0xbb62, 0xbb63, 0xbb64, 0xbb65, 0xbb66, 0xbb67,
+ 0xbb68, 0xbb69, 0xbb6a, 0xbb6b, 0xbb6c, 0xbb6d, 0xbb6e, 0xbb6f,
+ 0xbb70, 0xbb71, 0xbb72, 0xbb73, 0xbb74, 0xbb75, 0xbb76, 0xbb77,
+ 0xbb78, 0xbb79, 0xbb7a, 0xbb7b, 0xbb7c, 0xbb7d, 0xbb7e, 0xbb7f,
+ 0xbb80, 0xbb81, 0xbb82, 0xbb83, 0xbb84, 0xbb85, 0xbb86, 0xbb87,
+ 0xbb88, 0xbb89, 0xbb8a, 0xbb8b, 0xbb8c, 0xbb8d, 0xbb8e, 0xbb8f,
+ 0xbb90, 0xbb91, 0xbb92, 0xbb93, 0xbb94, 0xbb95, 0xbb96, 0xbb97,
+ 0xbb98, 0xbb99, 0xbb9a, 0xbb9b, 0xbb9c, 0xbb9d, 0xbb9e, 0xbb9f,
+ 0xbba0, 0xbba1, 0xbba2, 0xbba3, 0xbba4, 0xbba5, 0xbba6, 0xbba7,
+ 0xbba8, 0xbba9, 0xbbaa, 0xbbab, 0xbbac, 0xbbad, 0xbbae, 0xbbaf,
+ 0xbbb0, 0xbbb1, 0xbbb2, 0xbbb3, 0xbbb4, 0xbbb5, 0xbbb6, 0xbbb7,
+ 0xbbb8, 0xbbb9, 0xbbba, 0xbbbb, 0xbbbc, 0xbbbd, 0xbbbe, 0xbbbf,
+ 0xbbc0, 0xbbc1, 0xbbc2, 0xbbc3, 0xbbc4, 0xbbc5, 0xbbc6, 0xbbc7,
+ 0xbbc8, 0xbbc9, 0xbbca, 0xbbcb, 0xbbcc, 0xbbcd, 0xbbce, 0xbbcf,
+ 0xbbd0, 0xbbd1, 0xbbd2, 0xbbd3, 0xbbd4, 0xbbd5, 0xbbd6, 0xbbd7,
+ 0xbbd8, 0xbbd9, 0xbbda, 0xbbdb, 0xbbdc, 0xbbdd, 0xbbde, 0xbbdf,
+ 0xbbe0, 0xbbe1, 0xbbe2, 0xbbe3, 0xbbe4, 0xbbe5, 0xbbe6, 0xbbe7,
+ 0xbbe8, 0xbbe9, 0xbbea, 0xbbeb, 0xbbec, 0xbbed, 0xbbee, 0xbbef,
+ 0xbbf0, 0xbbf1, 0xbbf2, 0xbbf3, 0xbbf4, 0xbbf5, 0xbbf6, 0xbbf7,
+ 0xbbf8, 0xbbf9, 0xbbfa, 0xbbfb, 0xbbfc, 0xbbfd, 0xbbfe, 0xbbff,
+ 0xbc00, 0xbc01, 0xbc02, 0xbc03, 0xbc04, 0xbc05, 0xbc06, 0xbc07,
+ 0xbc08, 0xbc09, 0xbc0a, 0xbc0b, 0xbc0c, 0xbc0d, 0xbc0e, 0xbc0f,
+ 0xbc10, 0xbc11, 0xbc12, 0xbc13, 0xbc14, 0xbc15, 0xbc16, 0xbc17,
+ 0xbc18, 0xbc19, 0xbc1a, 0xbc1b, 0xbc1c, 0xbc1d, 0xbc1e, 0xbc1f,
+ 0xbc20, 0xbc21, 0xbc22, 0xbc23, 0xbc24, 0xbc25, 0xbc26, 0xbc27,
+ 0xbc28, 0xbc29, 0xbc2a, 0xbc2b, 0xbc2c, 0xbc2d, 0xbc2e, 0xbc2f,
+ 0xbc30, 0xbc31, 0xbc32, 0xbc33, 0xbc34, 0xbc35, 0xbc36, 0xbc37,
+ 0xbc38, 0xbc39, 0xbc3a, 0xbc3b, 0xbc3c, 0xbc3d, 0xbc3e, 0xbc3f,
+ 0xbc40, 0xbc41, 0xbc42, 0xbc43, 0xbc44, 0xbc45, 0xbc46, 0xbc47,
+ 0xbc48, 0xbc49, 0xbc4a, 0xbc4b, 0xbc4c, 0xbc4d, 0xbc4e, 0xbc4f,
+ 0xbc50, 0xbc51, 0xbc52, 0xbc53, 0xbc54, 0xbc55, 0xbc56, 0xbc57,
+ 0xbc58, 0xbc59, 0xbc5a, 0xbc5b, 0xbc5c, 0xbc5d, 0xbc5e, 0xbc5f,
+ 0xbc60, 0xbc61, 0xbc62, 0xbc63, 0xbc64, 0xbc65, 0xbc66, 0xbc67,
+ 0xbc68, 0xbc69, 0xbc6a, 0xbc6b, 0xbc6c, 0xbc6d, 0xbc6e, 0xbc6f,
+ 0xbc70, 0xbc71, 0xbc72, 0xbc73, 0xbc74, 0xbc75, 0xbc76, 0xbc77,
+ 0xbc78, 0xbc79, 0xbc7a, 0xbc7b, 0xbc7c, 0xbc7d, 0xbc7e, 0xbc7f,
+ 0xbc80, 0xbc81, 0xbc82, 0xbc83, 0xbc84, 0xbc85, 0xbc86, 0xbc87,
+ 0xbc88, 0xbc89, 0xbc8a, 0xbc8b, 0xbc8c, 0xbc8d, 0xbc8e, 0xbc8f,
+ 0xbc90, 0xbc91, 0xbc92, 0xbc93, 0xbc94, 0xbc95, 0xbc96, 0xbc97,
+ 0xbc98, 0xbc99, 0xbc9a, 0xbc9b, 0xbc9c, 0xbc9d, 0xbc9e, 0xbc9f,
+ 0xbca0, 0xbca1, 0xbca2, 0xbca3, 0xbca4, 0xbca5, 0xbca6, 0xbca7,
+ 0xbca8, 0xbca9, 0xbcaa, 0xbcab, 0xbcac, 0xbcad, 0xbcae, 0xbcaf,
+ 0xbcb0, 0xbcb1, 0xbcb2, 0xbcb3, 0xbcb4, 0xbcb5, 0xbcb6, 0xbcb7,
+ 0xbcb8, 0xbcb9, 0xbcba, 0xbcbb, 0xbcbc, 0xbcbd, 0xbcbe, 0xbcbf,
+ 0xbcc0, 0xbcc1, 0xbcc2, 0xbcc3, 0xbcc4, 0xbcc5, 0xbcc6, 0xbcc7,
+ 0xbcc8, 0xbcc9, 0xbcca, 0xbccb, 0xbccc, 0xbccd, 0xbcce, 0xbccf,
+ 0xbcd0, 0xbcd1, 0xbcd2, 0xbcd3, 0xbcd4, 0xbcd5, 0xbcd6, 0xbcd7,
+ 0xbcd8, 0xbcd9, 0xbcda, 0xbcdb, 0xbcdc, 0xbcdd, 0xbcde, 0xbcdf,
+ 0xbce0, 0xbce1, 0xbce2, 0xbce3, 0xbce4, 0xbce5, 0xbce6, 0xbce7,
+ 0xbce8, 0xbce9, 0xbcea, 0xbceb, 0xbcec, 0xbced, 0xbcee, 0xbcef,
+ 0xbcf0, 0xbcf1, 0xbcf2, 0xbcf3, 0xbcf4, 0xbcf5, 0xbcf6, 0xbcf7,
+ 0xbcf8, 0xbcf9, 0xbcfa, 0xbcfb, 0xbcfc, 0xbcfd, 0xbcfe, 0xbcff,
+ 0xbd00, 0xbd01, 0xbd02, 0xbd03, 0xbd04, 0xbd05, 0xbd06, 0xbd07,
+ 0xbd08, 0xbd09, 0xbd0a, 0xbd0b, 0xbd0c, 0xbd0d, 0xbd0e, 0xbd0f,
+ 0xbd10, 0xbd11, 0xbd12, 0xbd13, 0xbd14, 0xbd15, 0xbd16, 0xbd17,
+ 0xbd18, 0xbd19, 0xbd1a, 0xbd1b, 0xbd1c, 0xbd1d, 0xbd1e, 0xbd1f,
+ 0xbd20, 0xbd21, 0xbd22, 0xbd23, 0xbd24, 0xbd25, 0xbd26, 0xbd27,
+ 0xbd28, 0xbd29, 0xbd2a, 0xbd2b, 0xbd2c, 0xbd2d, 0xbd2e, 0xbd2f,
+ 0xbd30, 0xbd31, 0xbd32, 0xbd33, 0xbd34, 0xbd35, 0xbd36, 0xbd37,
+ 0xbd38, 0xbd39, 0xbd3a, 0xbd3b, 0xbd3c, 0xbd3d, 0xbd3e, 0xbd3f,
+ 0xbd40, 0xbd41, 0xbd42, 0xbd43, 0xbd44, 0xbd45, 0xbd46, 0xbd47,
+ 0xbd48, 0xbd49, 0xbd4a, 0xbd4b, 0xbd4c, 0xbd4d, 0xbd4e, 0xbd4f,
+ 0xbd50, 0xbd51, 0xbd52, 0xbd53, 0xbd54, 0xbd55, 0xbd56, 0xbd57,
+ 0xbd58, 0xbd59, 0xbd5a, 0xbd5b, 0xbd5c, 0xbd5d, 0xbd5e, 0xbd5f,
+ 0xbd60, 0xbd61, 0xbd62, 0xbd63, 0xbd64, 0xbd65, 0xbd66, 0xbd67,
+ 0xbd68, 0xbd69, 0xbd6a, 0xbd6b, 0xbd6c, 0xbd6d, 0xbd6e, 0xbd6f,
+ 0xbd70, 0xbd71, 0xbd72, 0xbd73, 0xbd74, 0xbd75, 0xbd76, 0xbd77,
+ 0xbd78, 0xbd79, 0xbd7a, 0xbd7b, 0xbd7c, 0xbd7d, 0xbd7e, 0xbd7f,
+ 0xbd80, 0xbd81, 0xbd82, 0xbd83, 0xbd84, 0xbd85, 0xbd86, 0xbd87,
+ 0xbd88, 0xbd89, 0xbd8a, 0xbd8b, 0xbd8c, 0xbd8d, 0xbd8e, 0xbd8f,
+ 0xbd90, 0xbd91, 0xbd92, 0xbd93, 0xbd94, 0xbd95, 0xbd96, 0xbd97,
+ 0xbd98, 0xbd99, 0xbd9a, 0xbd9b, 0xbd9c, 0xbd9d, 0xbd9e, 0xbd9f,
+ 0xbda0, 0xbda1, 0xbda2, 0xbda3, 0xbda4, 0xbda5, 0xbda6, 0xbda7,
+ 0xbda8, 0xbda9, 0xbdaa, 0xbdab, 0xbdac, 0xbdad, 0xbdae, 0xbdaf,
+ 0xbdb0, 0xbdb1, 0xbdb2, 0xbdb3, 0xbdb4, 0xbdb5, 0xbdb6, 0xbdb7,
+ 0xbdb8, 0xbdb9, 0xbdba, 0xbdbb, 0xbdbc, 0xbdbd, 0xbdbe, 0xbdbf,
+ 0xbdc0, 0xbdc1, 0xbdc2, 0xbdc3, 0xbdc4, 0xbdc5, 0xbdc6, 0xbdc7,
+ 0xbdc8, 0xbdc9, 0xbdca, 0xbdcb, 0xbdcc, 0xbdcd, 0xbdce, 0xbdcf,
+ 0xbdd0, 0xbdd1, 0xbdd2, 0xbdd3, 0xbdd4, 0xbdd5, 0xbdd6, 0xbdd7,
+ 0xbdd8, 0xbdd9, 0xbdda, 0xbddb, 0xbddc, 0xbddd, 0xbdde, 0xbddf,
+ 0xbde0, 0xbde1, 0xbde2, 0xbde3, 0xbde4, 0xbde5, 0xbde6, 0xbde7,
+ 0xbde8, 0xbde9, 0xbdea, 0xbdeb, 0xbdec, 0xbded, 0xbdee, 0xbdef,
+ 0xbdf0, 0xbdf1, 0xbdf2, 0xbdf3, 0xbdf4, 0xbdf5, 0xbdf6, 0xbdf7,
+ 0xbdf8, 0xbdf9, 0xbdfa, 0xbdfb, 0xbdfc, 0xbdfd, 0xbdfe, 0xbdff,
+ 0xbe00, 0xbe01, 0xbe02, 0xbe03, 0xbe04, 0xbe05, 0xbe06, 0xbe07,
+ 0xbe08, 0xbe09, 0xbe0a, 0xbe0b, 0xbe0c, 0xbe0d, 0xbe0e, 0xbe0f,
+ 0xbe10, 0xbe11, 0xbe12, 0xbe13, 0xbe14, 0xbe15, 0xbe16, 0xbe17,
+ 0xbe18, 0xbe19, 0xbe1a, 0xbe1b, 0xbe1c, 0xbe1d, 0xbe1e, 0xbe1f,
+ 0xbe20, 0xbe21, 0xbe22, 0xbe23, 0xbe24, 0xbe25, 0xbe26, 0xbe27,
+ 0xbe28, 0xbe29, 0xbe2a, 0xbe2b, 0xbe2c, 0xbe2d, 0xbe2e, 0xbe2f,
+ 0xbe30, 0xbe31, 0xbe32, 0xbe33, 0xbe34, 0xbe35, 0xbe36, 0xbe37,
+ 0xbe38, 0xbe39, 0xbe3a, 0xbe3b, 0xbe3c, 0xbe3d, 0xbe3e, 0xbe3f,
+ 0xbe40, 0xbe41, 0xbe42, 0xbe43, 0xbe44, 0xbe45, 0xbe46, 0xbe47,
+ 0xbe48, 0xbe49, 0xbe4a, 0xbe4b, 0xbe4c, 0xbe4d, 0xbe4e, 0xbe4f,
+ 0xbe50, 0xbe51, 0xbe52, 0xbe53, 0xbe54, 0xbe55, 0xbe56, 0xbe57,
+ 0xbe58, 0xbe59, 0xbe5a, 0xbe5b, 0xbe5c, 0xbe5d, 0xbe5e, 0xbe5f,
+ 0xbe60, 0xbe61, 0xbe62, 0xbe63, 0xbe64, 0xbe65, 0xbe66, 0xbe67,
+ 0xbe68, 0xbe69, 0xbe6a, 0xbe6b, 0xbe6c, 0xbe6d, 0xbe6e, 0xbe6f,
+ 0xbe70, 0xbe71, 0xbe72, 0xbe73, 0xbe74, 0xbe75, 0xbe76, 0xbe77,
+ 0xbe78, 0xbe79, 0xbe7a, 0xbe7b, 0xbe7c, 0xbe7d, 0xbe7e, 0xbe7f,
+ 0xbe80, 0xbe81, 0xbe82, 0xbe83, 0xbe84, 0xbe85, 0xbe86, 0xbe87,
+ 0xbe88, 0xbe89, 0xbe8a, 0xbe8b, 0xbe8c, 0xbe8d, 0xbe8e, 0xbe8f,
+ 0xbe90, 0xbe91, 0xbe92, 0xbe93, 0xbe94, 0xbe95, 0xbe96, 0xbe97,
+ 0xbe98, 0xbe99, 0xbe9a, 0xbe9b, 0xbe9c, 0xbe9d, 0xbe9e, 0xbe9f,
+ 0xbea0, 0xbea1, 0xbea2, 0xbea3, 0xbea4, 0xbea5, 0xbea6, 0xbea7,
+ 0xbea8, 0xbea9, 0xbeaa, 0xbeab, 0xbeac, 0xbead, 0xbeae, 0xbeaf,
+ 0xbeb0, 0xbeb1, 0xbeb2, 0xbeb3, 0xbeb4, 0xbeb5, 0xbeb6, 0xbeb7,
+ 0xbeb8, 0xbeb9, 0xbeba, 0xbebb, 0xbebc, 0xbebd, 0xbebe, 0xbebf,
+ 0xbec0, 0xbec1, 0xbec2, 0xbec3, 0xbec4, 0xbec5, 0xbec6, 0xbec7,
+ 0xbec8, 0xbec9, 0xbeca, 0xbecb, 0xbecc, 0xbecd, 0xbece, 0xbecf,
+ 0xbed0, 0xbed1, 0xbed2, 0xbed3, 0xbed4, 0xbed5, 0xbed6, 0xbed7,
+ 0xbed8, 0xbed9, 0xbeda, 0xbedb, 0xbedc, 0xbedd, 0xbede, 0xbedf,
+ 0xbee0, 0xbee1, 0xbee2, 0xbee3, 0xbee4, 0xbee5, 0xbee6, 0xbee7,
+ 0xbee8, 0xbee9, 0xbeea, 0xbeeb, 0xbeec, 0xbeed, 0xbeee, 0xbeef,
+ 0xbef0, 0xbef1, 0xbef2, 0xbef3, 0xbef4, 0xbef5, 0xbef6, 0xbef7,
+ 0xbef8, 0xbef9, 0xbefa, 0xbefb, 0xbefc, 0xbefd, 0xbefe, 0xbeff,
+ 0xbf00, 0xbf01, 0xbf02, 0xbf03, 0xbf04, 0xbf05, 0xbf06, 0xbf07,
+ 0xbf08, 0xbf09, 0xbf0a, 0xbf0b, 0xbf0c, 0xbf0d, 0xbf0e, 0xbf0f,
+ 0xbf10, 0xbf11, 0xbf12, 0xbf13, 0xbf14, 0xbf15, 0xbf16, 0xbf17,
+ 0xbf18, 0xbf19, 0xbf1a, 0xbf1b, 0xbf1c, 0xbf1d, 0xbf1e, 0xbf1f,
+ 0xbf20, 0xbf21, 0xbf22, 0xbf23, 0xbf24, 0xbf25, 0xbf26, 0xbf27,
+ 0xbf28, 0xbf29, 0xbf2a, 0xbf2b, 0xbf2c, 0xbf2d, 0xbf2e, 0xbf2f,
+ 0xbf30, 0xbf31, 0xbf32, 0xbf33, 0xbf34, 0xbf35, 0xbf36, 0xbf37,
+ 0xbf38, 0xbf39, 0xbf3a, 0xbf3b, 0xbf3c, 0xbf3d, 0xbf3e, 0xbf3f,
+ 0xbf40, 0xbf41, 0xbf42, 0xbf43, 0xbf44, 0xbf45, 0xbf46, 0xbf47,
+ 0xbf48, 0xbf49, 0xbf4a, 0xbf4b, 0xbf4c, 0xbf4d, 0xbf4e, 0xbf4f,
+ 0xbf50, 0xbf51, 0xbf52, 0xbf53, 0xbf54, 0xbf55, 0xbf56, 0xbf57,
+ 0xbf58, 0xbf59, 0xbf5a, 0xbf5b, 0xbf5c, 0xbf5d, 0xbf5e, 0xbf5f,
+ 0xbf60, 0xbf61, 0xbf62, 0xbf63, 0xbf64, 0xbf65, 0xbf66, 0xbf67,
+ 0xbf68, 0xbf69, 0xbf6a, 0xbf6b, 0xbf6c, 0xbf6d, 0xbf6e, 0xbf6f,
+ 0xbf70, 0xbf71, 0xbf72, 0xbf73, 0xbf74, 0xbf75, 0xbf76, 0xbf77,
+ 0xbf78, 0xbf79, 0xbf7a, 0xbf7b, 0xbf7c, 0xbf7d, 0xbf7e, 0xbf7f,
+ 0xbf80, 0xbf81, 0xbf82, 0xbf83, 0xbf84, 0xbf85, 0xbf86, 0xbf87,
+ 0xbf88, 0xbf89, 0xbf8a, 0xbf8b, 0xbf8c, 0xbf8d, 0xbf8e, 0xbf8f,
+ 0xbf90, 0xbf91, 0xbf92, 0xbf93, 0xbf94, 0xbf95, 0xbf96, 0xbf97,
+ 0xbf98, 0xbf99, 0xbf9a, 0xbf9b, 0xbf9c, 0xbf9d, 0xbf9e, 0xbf9f,
+ 0xbfa0, 0xbfa1, 0xbfa2, 0xbfa3, 0xbfa4, 0xbfa5, 0xbfa6, 0xbfa7,
+ 0xbfa8, 0xbfa9, 0xbfaa, 0xbfab, 0xbfac, 0xbfad, 0xbfae, 0xbfaf,
+ 0xbfb0, 0xbfb1, 0xbfb2, 0xbfb3, 0xbfb4, 0xbfb5, 0xbfb6, 0xbfb7,
+ 0xbfb8, 0xbfb9, 0xbfba, 0xbfbb, 0xbfbc, 0xbfbd, 0xbfbe, 0xbfbf,
+ 0xbfc0, 0xbfc1, 0xbfc2, 0xbfc3, 0xbfc4, 0xbfc5, 0xbfc6, 0xbfc7,
+ 0xbfc8, 0xbfc9, 0xbfca, 0xbfcb, 0xbfcc, 0xbfcd, 0xbfce, 0xbfcf,
+ 0xbfd0, 0xbfd1, 0xbfd2, 0xbfd3, 0xbfd4, 0xbfd5, 0xbfd6, 0xbfd7,
+ 0xbfd8, 0xbfd9, 0xbfda, 0xbfdb, 0xbfdc, 0xbfdd, 0xbfde, 0xbfdf,
+ 0xbfe0, 0xbfe1, 0xbfe2, 0xbfe3, 0xbfe4, 0xbfe5, 0xbfe6, 0xbfe7,
+ 0xbfe8, 0xbfe9, 0xbfea, 0xbfeb, 0xbfec, 0xbfed, 0xbfee, 0xbfef,
+ 0xbff0, 0xbff1, 0xbff2, 0xbff3, 0xbff4, 0xbff5, 0xbff6, 0xbff7,
+ 0xbff8, 0xbff9, 0xbffa, 0xbffb, 0xbffc, 0xbffd, 0xbffe, 0xbfff,
+ 0xc000, 0xc001, 0xc002, 0xc003, 0xc004, 0xc005, 0xc006, 0xc007,
+ 0xc008, 0xc009, 0xc00a, 0xc00b, 0xc00c, 0xc00d, 0xc00e, 0xc00f,
+ 0xc010, 0xc011, 0xc012, 0xc013, 0xc014, 0xc015, 0xc016, 0xc017,
+ 0xc018, 0xc019, 0xc01a, 0xc01b, 0xc01c, 0xc01d, 0xc01e, 0xc01f,
+ 0xc020, 0xc021, 0xc022, 0xc023, 0xc024, 0xc025, 0xc026, 0xc027,
+ 0xc028, 0xc029, 0xc02a, 0xc02b, 0xc02c, 0xc02d, 0xc02e, 0xc02f,
+ 0xc030, 0xc031, 0xc032, 0xc033, 0xc034, 0xc035, 0xc036, 0xc037,
+ 0xc038, 0xc039, 0xc03a, 0xc03b, 0xc03c, 0xc03d, 0xc03e, 0xc03f,
+ 0xc040, 0xc041, 0xc042, 0xc043, 0xc044, 0xc045, 0xc046, 0xc047,
+ 0xc048, 0xc049, 0xc04a, 0xc04b, 0xc04c, 0xc04d, 0xc04e, 0xc04f,
+ 0xc050, 0xc051, 0xc052, 0xc053, 0xc054, 0xc055, 0xc056, 0xc057,
+ 0xc058, 0xc059, 0xc05a, 0xc05b, 0xc05c, 0xc05d, 0xc05e, 0xc05f,
+ 0xc060, 0xc061, 0xc062, 0xc063, 0xc064, 0xc065, 0xc066, 0xc067,
+ 0xc068, 0xc069, 0xc06a, 0xc06b, 0xc06c, 0xc06d, 0xc06e, 0xc06f,
+ 0xc070, 0xc071, 0xc072, 0xc073, 0xc074, 0xc075, 0xc076, 0xc077,
+ 0xc078, 0xc079, 0xc07a, 0xc07b, 0xc07c, 0xc07d, 0xc07e, 0xc07f,
+ 0xc080, 0xc081, 0xc082, 0xc083, 0xc084, 0xc085, 0xc086, 0xc087,
+ 0xc088, 0xc089, 0xc08a, 0xc08b, 0xc08c, 0xc08d, 0xc08e, 0xc08f,
+ 0xc090, 0xc091, 0xc092, 0xc093, 0xc094, 0xc095, 0xc096, 0xc097,
+ 0xc098, 0xc099, 0xc09a, 0xc09b, 0xc09c, 0xc09d, 0xc09e, 0xc09f,
+ 0xc0a0, 0xc0a1, 0xc0a2, 0xc0a3, 0xc0a4, 0xc0a5, 0xc0a6, 0xc0a7,
+ 0xc0a8, 0xc0a9, 0xc0aa, 0xc0ab, 0xc0ac, 0xc0ad, 0xc0ae, 0xc0af,
+ 0xc0b0, 0xc0b1, 0xc0b2, 0xc0b3, 0xc0b4, 0xc0b5, 0xc0b6, 0xc0b7,
+ 0xc0b8, 0xc0b9, 0xc0ba, 0xc0bb, 0xc0bc, 0xc0bd, 0xc0be, 0xc0bf,
+ 0xc0c0, 0xc0c1, 0xc0c2, 0xc0c3, 0xc0c4, 0xc0c5, 0xc0c6, 0xc0c7,
+ 0xc0c8, 0xc0c9, 0xc0ca, 0xc0cb, 0xc0cc, 0xc0cd, 0xc0ce, 0xc0cf,
+ 0xc0d0, 0xc0d1, 0xc0d2, 0xc0d3, 0xc0d4, 0xc0d5, 0xc0d6, 0xc0d7,
+ 0xc0d8, 0xc0d9, 0xc0da, 0xc0db, 0xc0dc, 0xc0dd, 0xc0de, 0xc0df,
+ 0xc0e0, 0xc0e1, 0xc0e2, 0xc0e3, 0xc0e4, 0xc0e5, 0xc0e6, 0xc0e7,
+ 0xc0e8, 0xc0e9, 0xc0ea, 0xc0eb, 0xc0ec, 0xc0ed, 0xc0ee, 0xc0ef,
+ 0xc0f0, 0xc0f1, 0xc0f2, 0xc0f3, 0xc0f4, 0xc0f5, 0xc0f6, 0xc0f7,
+ 0xc0f8, 0xc0f9, 0xc0fa, 0xc0fb, 0xc0fc, 0xc0fd, 0xc0fe, 0xc0ff,
+ 0xc100, 0xc101, 0xc102, 0xc103, 0xc104, 0xc105, 0xc106, 0xc107,
+ 0xc108, 0xc109, 0xc10a, 0xc10b, 0xc10c, 0xc10d, 0xc10e, 0xc10f,
+ 0xc110, 0xc111, 0xc112, 0xc113, 0xc114, 0xc115, 0xc116, 0xc117,
+ 0xc118, 0xc119, 0xc11a, 0xc11b, 0xc11c, 0xc11d, 0xc11e, 0xc11f,
+ 0xc120, 0xc121, 0xc122, 0xc123, 0xc124, 0xc125, 0xc126, 0xc127,
+ 0xc128, 0xc129, 0xc12a, 0xc12b, 0xc12c, 0xc12d, 0xc12e, 0xc12f,
+ 0xc130, 0xc131, 0xc132, 0xc133, 0xc134, 0xc135, 0xc136, 0xc137,
+ 0xc138, 0xc139, 0xc13a, 0xc13b, 0xc13c, 0xc13d, 0xc13e, 0xc13f,
+ 0xc140, 0xc141, 0xc142, 0xc143, 0xc144, 0xc145, 0xc146, 0xc147,
+ 0xc148, 0xc149, 0xc14a, 0xc14b, 0xc14c, 0xc14d, 0xc14e, 0xc14f,
+ 0xc150, 0xc151, 0xc152, 0xc153, 0xc154, 0xc155, 0xc156, 0xc157,
+ 0xc158, 0xc159, 0xc15a, 0xc15b, 0xc15c, 0xc15d, 0xc15e, 0xc15f,
+ 0xc160, 0xc161, 0xc162, 0xc163, 0xc164, 0xc165, 0xc166, 0xc167,
+ 0xc168, 0xc169, 0xc16a, 0xc16b, 0xc16c, 0xc16d, 0xc16e, 0xc16f,
+ 0xc170, 0xc171, 0xc172, 0xc173, 0xc174, 0xc175, 0xc176, 0xc177,
+ 0xc178, 0xc179, 0xc17a, 0xc17b, 0xc17c, 0xc17d, 0xc17e, 0xc17f,
+ 0xc180, 0xc181, 0xc182, 0xc183, 0xc184, 0xc185, 0xc186, 0xc187,
+ 0xc188, 0xc189, 0xc18a, 0xc18b, 0xc18c, 0xc18d, 0xc18e, 0xc18f,
+ 0xc190, 0xc191, 0xc192, 0xc193, 0xc194, 0xc195, 0xc196, 0xc197,
+ 0xc198, 0xc199, 0xc19a, 0xc19b, 0xc19c, 0xc19d, 0xc19e, 0xc19f,
+ 0xc1a0, 0xc1a1, 0xc1a2, 0xc1a3, 0xc1a4, 0xc1a5, 0xc1a6, 0xc1a7,
+ 0xc1a8, 0xc1a9, 0xc1aa, 0xc1ab, 0xc1ac, 0xc1ad, 0xc1ae, 0xc1af,
+ 0xc1b0, 0xc1b1, 0xc1b2, 0xc1b3, 0xc1b4, 0xc1b5, 0xc1b6, 0xc1b7,
+ 0xc1b8, 0xc1b9, 0xc1ba, 0xc1bb, 0xc1bc, 0xc1bd, 0xc1be, 0xc1bf,
+ 0xc1c0, 0xc1c1, 0xc1c2, 0xc1c3, 0xc1c4, 0xc1c5, 0xc1c6, 0xc1c7,
+ 0xc1c8, 0xc1c9, 0xc1ca, 0xc1cb, 0xc1cc, 0xc1cd, 0xc1ce, 0xc1cf,
+ 0xc1d0, 0xc1d1, 0xc1d2, 0xc1d3, 0xc1d4, 0xc1d5, 0xc1d6, 0xc1d7,
+ 0xc1d8, 0xc1d9, 0xc1da, 0xc1db, 0xc1dc, 0xc1dd, 0xc1de, 0xc1df,
+ 0xc1e0, 0xc1e1, 0xc1e2, 0xc1e3, 0xc1e4, 0xc1e5, 0xc1e6, 0xc1e7,
+ 0xc1e8, 0xc1e9, 0xc1ea, 0xc1eb, 0xc1ec, 0xc1ed, 0xc1ee, 0xc1ef,
+ 0xc1f0, 0xc1f1, 0xc1f2, 0xc1f3, 0xc1f4, 0xc1f5, 0xc1f6, 0xc1f7,
+ 0xc1f8, 0xc1f9, 0xc1fa, 0xc1fb, 0xc1fc, 0xc1fd, 0xc1fe, 0xc1ff,
+ 0xc200, 0xc201, 0xc202, 0xc203, 0xc204, 0xc205, 0xc206, 0xc207,
+ 0xc208, 0xc209, 0xc20a, 0xc20b, 0xc20c, 0xc20d, 0xc20e, 0xc20f,
+ 0xc210, 0xc211, 0xc212, 0xc213, 0xc214, 0xc215, 0xc216, 0xc217,
+ 0xc218, 0xc219, 0xc21a, 0xc21b, 0xc21c, 0xc21d, 0xc21e, 0xc21f,
+ 0xc220, 0xc221, 0xc222, 0xc223, 0xc224, 0xc225, 0xc226, 0xc227,
+ 0xc228, 0xc229, 0xc22a, 0xc22b, 0xc22c, 0xc22d, 0xc22e, 0xc22f,
+ 0xc230, 0xc231, 0xc232, 0xc233, 0xc234, 0xc235, 0xc236, 0xc237,
+ 0xc238, 0xc239, 0xc23a, 0xc23b, 0xc23c, 0xc23d, 0xc23e, 0xc23f,
+ 0xc240, 0xc241, 0xc242, 0xc243, 0xc244, 0xc245, 0xc246, 0xc247,
+ 0xc248, 0xc249, 0xc24a, 0xc24b, 0xc24c, 0xc24d, 0xc24e, 0xc24f,
+ 0xc250, 0xc251, 0xc252, 0xc253, 0xc254, 0xc255, 0xc256, 0xc257,
+ 0xc258, 0xc259, 0xc25a, 0xc25b, 0xc25c, 0xc25d, 0xc25e, 0xc25f,
+ 0xc260, 0xc261, 0xc262, 0xc263, 0xc264, 0xc265, 0xc266, 0xc267,
+ 0xc268, 0xc269, 0xc26a, 0xc26b, 0xc26c, 0xc26d, 0xc26e, 0xc26f,
+ 0xc270, 0xc271, 0xc272, 0xc273, 0xc274, 0xc275, 0xc276, 0xc277,
+ 0xc278, 0xc279, 0xc27a, 0xc27b, 0xc27c, 0xc27d, 0xc27e, 0xc27f,
+ 0xc280, 0xc281, 0xc282, 0xc283, 0xc284, 0xc285, 0xc286, 0xc287,
+ 0xc288, 0xc289, 0xc28a, 0xc28b, 0xc28c, 0xc28d, 0xc28e, 0xc28f,
+ 0xc290, 0xc291, 0xc292, 0xc293, 0xc294, 0xc295, 0xc296, 0xc297,
+ 0xc298, 0xc299, 0xc29a, 0xc29b, 0xc29c, 0xc29d, 0xc29e, 0xc29f,
+ 0xc2a0, 0xc2a1, 0xc2a2, 0xc2a3, 0xc2a4, 0xc2a5, 0xc2a6, 0xc2a7,
+ 0xc2a8, 0xc2a9, 0xc2aa, 0xc2ab, 0xc2ac, 0xc2ad, 0xc2ae, 0xc2af,
+ 0xc2b0, 0xc2b1, 0xc2b2, 0xc2b3, 0xc2b4, 0xc2b5, 0xc2b6, 0xc2b7,
+ 0xc2b8, 0xc2b9, 0xc2ba, 0xc2bb, 0xc2bc, 0xc2bd, 0xc2be, 0xc2bf,
+ 0xc2c0, 0xc2c1, 0xc2c2, 0xc2c3, 0xc2c4, 0xc2c5, 0xc2c6, 0xc2c7,
+ 0xc2c8, 0xc2c9, 0xc2ca, 0xc2cb, 0xc2cc, 0xc2cd, 0xc2ce, 0xc2cf,
+ 0xc2d0, 0xc2d1, 0xc2d2, 0xc2d3, 0xc2d4, 0xc2d5, 0xc2d6, 0xc2d7,
+ 0xc2d8, 0xc2d9, 0xc2da, 0xc2db, 0xc2dc, 0xc2dd, 0xc2de, 0xc2df,
+ 0xc2e0, 0xc2e1, 0xc2e2, 0xc2e3, 0xc2e4, 0xc2e5, 0xc2e6, 0xc2e7,
+ 0xc2e8, 0xc2e9, 0xc2ea, 0xc2eb, 0xc2ec, 0xc2ed, 0xc2ee, 0xc2ef,
+ 0xc2f0, 0xc2f1, 0xc2f2, 0xc2f3, 0xc2f4, 0xc2f5, 0xc2f6, 0xc2f7,
+ 0xc2f8, 0xc2f9, 0xc2fa, 0xc2fb, 0xc2fc, 0xc2fd, 0xc2fe, 0xc2ff,
+ 0xc300, 0xc301, 0xc302, 0xc303, 0xc304, 0xc305, 0xc306, 0xc307,
+ 0xc308, 0xc309, 0xc30a, 0xc30b, 0xc30c, 0xc30d, 0xc30e, 0xc30f,
+ 0xc310, 0xc311, 0xc312, 0xc313, 0xc314, 0xc315, 0xc316, 0xc317,
+ 0xc318, 0xc319, 0xc31a, 0xc31b, 0xc31c, 0xc31d, 0xc31e, 0xc31f,
+ 0xc320, 0xc321, 0xc322, 0xc323, 0xc324, 0xc325, 0xc326, 0xc327,
+ 0xc328, 0xc329, 0xc32a, 0xc32b, 0xc32c, 0xc32d, 0xc32e, 0xc32f,
+ 0xc330, 0xc331, 0xc332, 0xc333, 0xc334, 0xc335, 0xc336, 0xc337,
+ 0xc338, 0xc339, 0xc33a, 0xc33b, 0xc33c, 0xc33d, 0xc33e, 0xc33f,
+ 0xc340, 0xc341, 0xc342, 0xc343, 0xc344, 0xc345, 0xc346, 0xc347,
+ 0xc348, 0xc349, 0xc34a, 0xc34b, 0xc34c, 0xc34d, 0xc34e, 0xc34f,
+ 0xc350, 0xc351, 0xc352, 0xc353, 0xc354, 0xc355, 0xc356, 0xc357,
+ 0xc358, 0xc359, 0xc35a, 0xc35b, 0xc35c, 0xc35d, 0xc35e, 0xc35f,
+ 0xc360, 0xc361, 0xc362, 0xc363, 0xc364, 0xc365, 0xc366, 0xc367,
+ 0xc368, 0xc369, 0xc36a, 0xc36b, 0xc36c, 0xc36d, 0xc36e, 0xc36f,
+ 0xc370, 0xc371, 0xc372, 0xc373, 0xc374, 0xc375, 0xc376, 0xc377,
+ 0xc378, 0xc379, 0xc37a, 0xc37b, 0xc37c, 0xc37d, 0xc37e, 0xc37f,
+ 0xc380, 0xc381, 0xc382, 0xc383, 0xc384, 0xc385, 0xc386, 0xc387,
+ 0xc388, 0xc389, 0xc38a, 0xc38b, 0xc38c, 0xc38d, 0xc38e, 0xc38f,
+ 0xc390, 0xc391, 0xc392, 0xc393, 0xc394, 0xc395, 0xc396, 0xc397,
+ 0xc398, 0xc399, 0xc39a, 0xc39b, 0xc39c, 0xc39d, 0xc39e, 0xc39f,
+ 0xc3a0, 0xc3a1, 0xc3a2, 0xc3a3, 0xc3a4, 0xc3a5, 0xc3a6, 0xc3a7,
+ 0xc3a8, 0xc3a9, 0xc3aa, 0xc3ab, 0xc3ac, 0xc3ad, 0xc3ae, 0xc3af,
+ 0xc3b0, 0xc3b1, 0xc3b2, 0xc3b3, 0xc3b4, 0xc3b5, 0xc3b6, 0xc3b7,
+ 0xc3b8, 0xc3b9, 0xc3ba, 0xc3bb, 0xc3bc, 0xc3bd, 0xc3be, 0xc3bf,
+ 0xc3c0, 0xc3c1, 0xc3c2, 0xc3c3, 0xc3c4, 0xc3c5, 0xc3c6, 0xc3c7,
+ 0xc3c8, 0xc3c9, 0xc3ca, 0xc3cb, 0xc3cc, 0xc3cd, 0xc3ce, 0xc3cf,
+ 0xc3d0, 0xc3d1, 0xc3d2, 0xc3d3, 0xc3d4, 0xc3d5, 0xc3d6, 0xc3d7,
+ 0xc3d8, 0xc3d9, 0xc3da, 0xc3db, 0xc3dc, 0xc3dd, 0xc3de, 0xc3df,
+ 0xc3e0, 0xc3e1, 0xc3e2, 0xc3e3, 0xc3e4, 0xc3e5, 0xc3e6, 0xc3e7,
+ 0xc3e8, 0xc3e9, 0xc3ea, 0xc3eb, 0xc3ec, 0xc3ed, 0xc3ee, 0xc3ef,
+ 0xc3f0, 0xc3f1, 0xc3f2, 0xc3f3, 0xc3f4, 0xc3f5, 0xc3f6, 0xc3f7,
+ 0xc3f8, 0xc3f9, 0xc3fa, 0xc3fb, 0xc3fc, 0xc3fd, 0xc3fe, 0xc3ff,
+ 0xc400, 0xc401, 0xc402, 0xc403, 0xc404, 0xc405, 0xc406, 0xc407,
+ 0xc408, 0xc409, 0xc40a, 0xc40b, 0xc40c, 0xc40d, 0xc40e, 0xc40f,
+ 0xc410, 0xc411, 0xc412, 0xc413, 0xc414, 0xc415, 0xc416, 0xc417,
+ 0xc418, 0xc419, 0xc41a, 0xc41b, 0xc41c, 0xc41d, 0xc41e, 0xc41f,
+ 0xc420, 0xc421, 0xc422, 0xc423, 0xc424, 0xc425, 0xc426, 0xc427,
+ 0xc428, 0xc429, 0xc42a, 0xc42b, 0xc42c, 0xc42d, 0xc42e, 0xc42f,
+ 0xc430, 0xc431, 0xc432, 0xc433, 0xc434, 0xc435, 0xc436, 0xc437,
+ 0xc438, 0xc439, 0xc43a, 0xc43b, 0xc43c, 0xc43d, 0xc43e, 0xc43f,
+ 0xc440, 0xc441, 0xc442, 0xc443, 0xc444, 0xc445, 0xc446, 0xc447,
+ 0xc448, 0xc449, 0xc44a, 0xc44b, 0xc44c, 0xc44d, 0xc44e, 0xc44f,
+ 0xc450, 0xc451, 0xc452, 0xc453, 0xc454, 0xc455, 0xc456, 0xc457,
+ 0xc458, 0xc459, 0xc45a, 0xc45b, 0xc45c, 0xc45d, 0xc45e, 0xc45f,
+ 0xc460, 0xc461, 0xc462, 0xc463, 0xc464, 0xc465, 0xc466, 0xc467,
+ 0xc468, 0xc469, 0xc46a, 0xc46b, 0xc46c, 0xc46d, 0xc46e, 0xc46f,
+ 0xc470, 0xc471, 0xc472, 0xc473, 0xc474, 0xc475, 0xc476, 0xc477,
+ 0xc478, 0xc479, 0xc47a, 0xc47b, 0xc47c, 0xc47d, 0xc47e, 0xc47f,
+ 0xc480, 0xc481, 0xc482, 0xc483, 0xc484, 0xc485, 0xc486, 0xc487,
+ 0xc488, 0xc489, 0xc48a, 0xc48b, 0xc48c, 0xc48d, 0xc48e, 0xc48f,
+ 0xc490, 0xc491, 0xc492, 0xc493, 0xc494, 0xc495, 0xc496, 0xc497,
+ 0xc498, 0xc499, 0xc49a, 0xc49b, 0xc49c, 0xc49d, 0xc49e, 0xc49f,
+ 0xc4a0, 0xc4a1, 0xc4a2, 0xc4a3, 0xc4a4, 0xc4a5, 0xc4a6, 0xc4a7,
+ 0xc4a8, 0xc4a9, 0xc4aa, 0xc4ab, 0xc4ac, 0xc4ad, 0xc4ae, 0xc4af,
+ 0xc4b0, 0xc4b1, 0xc4b2, 0xc4b3, 0xc4b4, 0xc4b5, 0xc4b6, 0xc4b7,
+ 0xc4b8, 0xc4b9, 0xc4ba, 0xc4bb, 0xc4bc, 0xc4bd, 0xc4be, 0xc4bf,
+ 0xc4c0, 0xc4c1, 0xc4c2, 0xc4c3, 0xc4c4, 0xc4c5, 0xc4c6, 0xc4c7,
+ 0xc4c8, 0xc4c9, 0xc4ca, 0xc4cb, 0xc4cc, 0xc4cd, 0xc4ce, 0xc4cf,
+ 0xc4d0, 0xc4d1, 0xc4d2, 0xc4d3, 0xc4d4, 0xc4d5, 0xc4d6, 0xc4d7,
+ 0xc4d8, 0xc4d9, 0xc4da, 0xc4db, 0xc4dc, 0xc4dd, 0xc4de, 0xc4df,
+ 0xc4e0, 0xc4e1, 0xc4e2, 0xc4e3, 0xc4e4, 0xc4e5, 0xc4e6, 0xc4e7,
+ 0xc4e8, 0xc4e9, 0xc4ea, 0xc4eb, 0xc4ec, 0xc4ed, 0xc4ee, 0xc4ef,
+ 0xc4f0, 0xc4f1, 0xc4f2, 0xc4f3, 0xc4f4, 0xc4f5, 0xc4f6, 0xc4f7,
+ 0xc4f8, 0xc4f9, 0xc4fa, 0xc4fb, 0xc4fc, 0xc4fd, 0xc4fe, 0xc4ff,
+ 0xc500, 0xc501, 0xc502, 0xc503, 0xc504, 0xc505, 0xc506, 0xc507,
+ 0xc508, 0xc509, 0xc50a, 0xc50b, 0xc50c, 0xc50d, 0xc50e, 0xc50f,
+ 0xc510, 0xc511, 0xc512, 0xc513, 0xc514, 0xc515, 0xc516, 0xc517,
+ 0xc518, 0xc519, 0xc51a, 0xc51b, 0xc51c, 0xc51d, 0xc51e, 0xc51f,
+ 0xc520, 0xc521, 0xc522, 0xc523, 0xc524, 0xc525, 0xc526, 0xc527,
+ 0xc528, 0xc529, 0xc52a, 0xc52b, 0xc52c, 0xc52d, 0xc52e, 0xc52f,
+ 0xc530, 0xc531, 0xc532, 0xc533, 0xc534, 0xc535, 0xc536, 0xc537,
+ 0xc538, 0xc539, 0xc53a, 0xc53b, 0xc53c, 0xc53d, 0xc53e, 0xc53f,
+ 0xc540, 0xc541, 0xc542, 0xc543, 0xc544, 0xc545, 0xc546, 0xc547,
+ 0xc548, 0xc549, 0xc54a, 0xc54b, 0xc54c, 0xc54d, 0xc54e, 0xc54f,
+ 0xc550, 0xc551, 0xc552, 0xc553, 0xc554, 0xc555, 0xc556, 0xc557,
+ 0xc558, 0xc559, 0xc55a, 0xc55b, 0xc55c, 0xc55d, 0xc55e, 0xc55f,
+ 0xc560, 0xc561, 0xc562, 0xc563, 0xc564, 0xc565, 0xc566, 0xc567,
+ 0xc568, 0xc569, 0xc56a, 0xc56b, 0xc56c, 0xc56d, 0xc56e, 0xc56f,
+ 0xc570, 0xc571, 0xc572, 0xc573, 0xc574, 0xc575, 0xc576, 0xc577,
+ 0xc578, 0xc579, 0xc57a, 0xc57b, 0xc57c, 0xc57d, 0xc57e, 0xc57f,
+ 0xc580, 0xc581, 0xc582, 0xc583, 0xc584, 0xc585, 0xc586, 0xc587,
+ 0xc588, 0xc589, 0xc58a, 0xc58b, 0xc58c, 0xc58d, 0xc58e, 0xc58f,
+ 0xc590, 0xc591, 0xc592, 0xc593, 0xc594, 0xc595, 0xc596, 0xc597,
+ 0xc598, 0xc599, 0xc59a, 0xc59b, 0xc59c, 0xc59d, 0xc59e, 0xc59f,
+ 0xc5a0, 0xc5a1, 0xc5a2, 0xc5a3, 0xc5a4, 0xc5a5, 0xc5a6, 0xc5a7,
+ 0xc5a8, 0xc5a9, 0xc5aa, 0xc5ab, 0xc5ac, 0xc5ad, 0xc5ae, 0xc5af,
+ 0xc5b0, 0xc5b1, 0xc5b2, 0xc5b3, 0xc5b4, 0xc5b5, 0xc5b6, 0xc5b7,
+ 0xc5b8, 0xc5b9, 0xc5ba, 0xc5bb, 0xc5bc, 0xc5bd, 0xc5be, 0xc5bf,
+ 0xc5c0, 0xc5c1, 0xc5c2, 0xc5c3, 0xc5c4, 0xc5c5, 0xc5c6, 0xc5c7,
+ 0xc5c8, 0xc5c9, 0xc5ca, 0xc5cb, 0xc5cc, 0xc5cd, 0xc5ce, 0xc5cf,
+ 0xc5d0, 0xc5d1, 0xc5d2, 0xc5d3, 0xc5d4, 0xc5d5, 0xc5d6, 0xc5d7,
+ 0xc5d8, 0xc5d9, 0xc5da, 0xc5db, 0xc5dc, 0xc5dd, 0xc5de, 0xc5df,
+ 0xc5e0, 0xc5e1, 0xc5e2, 0xc5e3, 0xc5e4, 0xc5e5, 0xc5e6, 0xc5e7,
+ 0xc5e8, 0xc5e9, 0xc5ea, 0xc5eb, 0xc5ec, 0xc5ed, 0xc5ee, 0xc5ef,
+ 0xc5f0, 0xc5f1, 0xc5f2, 0xc5f3, 0xc5f4, 0xc5f5, 0xc5f6, 0xc5f7,
+ 0xc5f8, 0xc5f9, 0xc5fa, 0xc5fb, 0xc5fc, 0xc5fd, 0xc5fe, 0xc5ff,
+ 0xc600, 0xc601, 0xc602, 0xc603, 0xc604, 0xc605, 0xc606, 0xc607,
+ 0xc608, 0xc609, 0xc60a, 0xc60b, 0xc60c, 0xc60d, 0xc60e, 0xc60f,
+ 0xc610, 0xc611, 0xc612, 0xc613, 0xc614, 0xc615, 0xc616, 0xc617,
+ 0xc618, 0xc619, 0xc61a, 0xc61b, 0xc61c, 0xc61d, 0xc61e, 0xc61f,
+ 0xc620, 0xc621, 0xc622, 0xc623, 0xc624, 0xc625, 0xc626, 0xc627,
+ 0xc628, 0xc629, 0xc62a, 0xc62b, 0xc62c, 0xc62d, 0xc62e, 0xc62f,
+ 0xc630, 0xc631, 0xc632, 0xc633, 0xc634, 0xc635, 0xc636, 0xc637,
+ 0xc638, 0xc639, 0xc63a, 0xc63b, 0xc63c, 0xc63d, 0xc63e, 0xc63f,
+ 0xc640, 0xc641, 0xc642, 0xc643, 0xc644, 0xc645, 0xc646, 0xc647,
+ 0xc648, 0xc649, 0xc64a, 0xc64b, 0xc64c, 0xc64d, 0xc64e, 0xc64f,
+ 0xc650, 0xc651, 0xc652, 0xc653, 0xc654, 0xc655, 0xc656, 0xc657,
+ 0xc658, 0xc659, 0xc65a, 0xc65b, 0xc65c, 0xc65d, 0xc65e, 0xc65f,
+ 0xc660, 0xc661, 0xc662, 0xc663, 0xc664, 0xc665, 0xc666, 0xc667,
+ 0xc668, 0xc669, 0xc66a, 0xc66b, 0xc66c, 0xc66d, 0xc66e, 0xc66f,
+ 0xc670, 0xc671, 0xc672, 0xc673, 0xc674, 0xc675, 0xc676, 0xc677,
+ 0xc678, 0xc679, 0xc67a, 0xc67b, 0xc67c, 0xc67d, 0xc67e, 0xc67f,
+ 0xc680, 0xc681, 0xc682, 0xc683, 0xc684, 0xc685, 0xc686, 0xc687,
+ 0xc688, 0xc689, 0xc68a, 0xc68b, 0xc68c, 0xc68d, 0xc68e, 0xc68f,
+ 0xc690, 0xc691, 0xc692, 0xc693, 0xc694, 0xc695, 0xc696, 0xc697,
+ 0xc698, 0xc699, 0xc69a, 0xc69b, 0xc69c, 0xc69d, 0xc69e, 0xc69f,
+ 0xc6a0, 0xc6a1, 0xc6a2, 0xc6a3, 0xc6a4, 0xc6a5, 0xc6a6, 0xc6a7,
+ 0xc6a8, 0xc6a9, 0xc6aa, 0xc6ab, 0xc6ac, 0xc6ad, 0xc6ae, 0xc6af,
+ 0xc6b0, 0xc6b1, 0xc6b2, 0xc6b3, 0xc6b4, 0xc6b5, 0xc6b6, 0xc6b7,
+ 0xc6b8, 0xc6b9, 0xc6ba, 0xc6bb, 0xc6bc, 0xc6bd, 0xc6be, 0xc6bf,
+ 0xc6c0, 0xc6c1, 0xc6c2, 0xc6c3, 0xc6c4, 0xc6c5, 0xc6c6, 0xc6c7,
+ 0xc6c8, 0xc6c9, 0xc6ca, 0xc6cb, 0xc6cc, 0xc6cd, 0xc6ce, 0xc6cf,
+ 0xc6d0, 0xc6d1, 0xc6d2, 0xc6d3, 0xc6d4, 0xc6d5, 0xc6d6, 0xc6d7,
+ 0xc6d8, 0xc6d9, 0xc6da, 0xc6db, 0xc6dc, 0xc6dd, 0xc6de, 0xc6df,
+ 0xc6e0, 0xc6e1, 0xc6e2, 0xc6e3, 0xc6e4, 0xc6e5, 0xc6e6, 0xc6e7,
+ 0xc6e8, 0xc6e9, 0xc6ea, 0xc6eb, 0xc6ec, 0xc6ed, 0xc6ee, 0xc6ef,
+ 0xc6f0, 0xc6f1, 0xc6f2, 0xc6f3, 0xc6f4, 0xc6f5, 0xc6f6, 0xc6f7,
+ 0xc6f8, 0xc6f9, 0xc6fa, 0xc6fb, 0xc6fc, 0xc6fd, 0xc6fe, 0xc6ff,
+ 0xc700, 0xc701, 0xc702, 0xc703, 0xc704, 0xc705, 0xc706, 0xc707,
+ 0xc708, 0xc709, 0xc70a, 0xc70b, 0xc70c, 0xc70d, 0xc70e, 0xc70f,
+ 0xc710, 0xc711, 0xc712, 0xc713, 0xc714, 0xc715, 0xc716, 0xc717,
+ 0xc718, 0xc719, 0xc71a, 0xc71b, 0xc71c, 0xc71d, 0xc71e, 0xc71f,
+ 0xc720, 0xc721, 0xc722, 0xc723, 0xc724, 0xc725, 0xc726, 0xc727,
+ 0xc728, 0xc729, 0xc72a, 0xc72b, 0xc72c, 0xc72d, 0xc72e, 0xc72f,
+ 0xc730, 0xc731, 0xc732, 0xc733, 0xc734, 0xc735, 0xc736, 0xc737,
+ 0xc738, 0xc739, 0xc73a, 0xc73b, 0xc73c, 0xc73d, 0xc73e, 0xc73f,
+ 0xc740, 0xc741, 0xc742, 0xc743, 0xc744, 0xc745, 0xc746, 0xc747,
+ 0xc748, 0xc749, 0xc74a, 0xc74b, 0xc74c, 0xc74d, 0xc74e, 0xc74f,
+ 0xc750, 0xc751, 0xc752, 0xc753, 0xc754, 0xc755, 0xc756, 0xc757,
+ 0xc758, 0xc759, 0xc75a, 0xc75b, 0xc75c, 0xc75d, 0xc75e, 0xc75f,
+ 0xc760, 0xc761, 0xc762, 0xc763, 0xc764, 0xc765, 0xc766, 0xc767,
+ 0xc768, 0xc769, 0xc76a, 0xc76b, 0xc76c, 0xc76d, 0xc76e, 0xc76f,
+ 0xc770, 0xc771, 0xc772, 0xc773, 0xc774, 0xc775, 0xc776, 0xc777,
+ 0xc778, 0xc779, 0xc77a, 0xc77b, 0xc77c, 0xc77d, 0xc77e, 0xc77f,
+ 0xc780, 0xc781, 0xc782, 0xc783, 0xc784, 0xc785, 0xc786, 0xc787,
+ 0xc788, 0xc789, 0xc78a, 0xc78b, 0xc78c, 0xc78d, 0xc78e, 0xc78f,
+ 0xc790, 0xc791, 0xc792, 0xc793, 0xc794, 0xc795, 0xc796, 0xc797,
+ 0xc798, 0xc799, 0xc79a, 0xc79b, 0xc79c, 0xc79d, 0xc79e, 0xc79f,
+ 0xc7a0, 0xc7a1, 0xc7a2, 0xc7a3, 0xc7a4, 0xc7a5, 0xc7a6, 0xc7a7,
+ 0xc7a8, 0xc7a9, 0xc7aa, 0xc7ab, 0xc7ac, 0xc7ad, 0xc7ae, 0xc7af,
+ 0xc7b0, 0xc7b1, 0xc7b2, 0xc7b3, 0xc7b4, 0xc7b5, 0xc7b6, 0xc7b7,
+ 0xc7b8, 0xc7b9, 0xc7ba, 0xc7bb, 0xc7bc, 0xc7bd, 0xc7be, 0xc7bf,
+ 0xc7c0, 0xc7c1, 0xc7c2, 0xc7c3, 0xc7c4, 0xc7c5, 0xc7c6, 0xc7c7,
+ 0xc7c8, 0xc7c9, 0xc7ca, 0xc7cb, 0xc7cc, 0xc7cd, 0xc7ce, 0xc7cf,
+ 0xc7d0, 0xc7d1, 0xc7d2, 0xc7d3, 0xc7d4, 0xc7d5, 0xc7d6, 0xc7d7,
+ 0xc7d8, 0xc7d9, 0xc7da, 0xc7db, 0xc7dc, 0xc7dd, 0xc7de, 0xc7df,
+ 0xc7e0, 0xc7e1, 0xc7e2, 0xc7e3, 0xc7e4, 0xc7e5, 0xc7e6, 0xc7e7,
+ 0xc7e8, 0xc7e9, 0xc7ea, 0xc7eb, 0xc7ec, 0xc7ed, 0xc7ee, 0xc7ef,
+ 0xc7f0, 0xc7f1, 0xc7f2, 0xc7f3, 0xc7f4, 0xc7f5, 0xc7f6, 0xc7f7,
+ 0xc7f8, 0xc7f9, 0xc7fa, 0xc7fb, 0xc7fc, 0xc7fd, 0xc7fe, 0xc7ff,
+ 0xc800, 0xc801, 0xc802, 0xc803, 0xc804, 0xc805, 0xc806, 0xc807,
+ 0xc808, 0xc809, 0xc80a, 0xc80b, 0xc80c, 0xc80d, 0xc80e, 0xc80f,
+ 0xc810, 0xc811, 0xc812, 0xc813, 0xc814, 0xc815, 0xc816, 0xc817,
+ 0xc818, 0xc819, 0xc81a, 0xc81b, 0xc81c, 0xc81d, 0xc81e, 0xc81f,
+ 0xc820, 0xc821, 0xc822, 0xc823, 0xc824, 0xc825, 0xc826, 0xc827,
+ 0xc828, 0xc829, 0xc82a, 0xc82b, 0xc82c, 0xc82d, 0xc82e, 0xc82f,
+ 0xc830, 0xc831, 0xc832, 0xc833, 0xc834, 0xc835, 0xc836, 0xc837,
+ 0xc838, 0xc839, 0xc83a, 0xc83b, 0xc83c, 0xc83d, 0xc83e, 0xc83f,
+ 0xc840, 0xc841, 0xc842, 0xc843, 0xc844, 0xc845, 0xc846, 0xc847,
+ 0xc848, 0xc849, 0xc84a, 0xc84b, 0xc84c, 0xc84d, 0xc84e, 0xc84f,
+ 0xc850, 0xc851, 0xc852, 0xc853, 0xc854, 0xc855, 0xc856, 0xc857,
+ 0xc858, 0xc859, 0xc85a, 0xc85b, 0xc85c, 0xc85d, 0xc85e, 0xc85f,
+ 0xc860, 0xc861, 0xc862, 0xc863, 0xc864, 0xc865, 0xc866, 0xc867,
+ 0xc868, 0xc869, 0xc86a, 0xc86b, 0xc86c, 0xc86d, 0xc86e, 0xc86f,
+ 0xc870, 0xc871, 0xc872, 0xc873, 0xc874, 0xc875, 0xc876, 0xc877,
+ 0xc878, 0xc879, 0xc87a, 0xc87b, 0xc87c, 0xc87d, 0xc87e, 0xc87f,
+ 0xc880, 0xc881, 0xc882, 0xc883, 0xc884, 0xc885, 0xc886, 0xc887,
+ 0xc888, 0xc889, 0xc88a, 0xc88b, 0xc88c, 0xc88d, 0xc88e, 0xc88f,
+ 0xc890, 0xc891, 0xc892, 0xc893, 0xc894, 0xc895, 0xc896, 0xc897,
+ 0xc898, 0xc899, 0xc89a, 0xc89b, 0xc89c, 0xc89d, 0xc89e, 0xc89f,
+ 0xc8a0, 0xc8a1, 0xc8a2, 0xc8a3, 0xc8a4, 0xc8a5, 0xc8a6, 0xc8a7,
+ 0xc8a8, 0xc8a9, 0xc8aa, 0xc8ab, 0xc8ac, 0xc8ad, 0xc8ae, 0xc8af,
+ 0xc8b0, 0xc8b1, 0xc8b2, 0xc8b3, 0xc8b4, 0xc8b5, 0xc8b6, 0xc8b7,
+ 0xc8b8, 0xc8b9, 0xc8ba, 0xc8bb, 0xc8bc, 0xc8bd, 0xc8be, 0xc8bf,
+ 0xc8c0, 0xc8c1, 0xc8c2, 0xc8c3, 0xc8c4, 0xc8c5, 0xc8c6, 0xc8c7,
+ 0xc8c8, 0xc8c9, 0xc8ca, 0xc8cb, 0xc8cc, 0xc8cd, 0xc8ce, 0xc8cf,
+ 0xc8d0, 0xc8d1, 0xc8d2, 0xc8d3, 0xc8d4, 0xc8d5, 0xc8d6, 0xc8d7,
+ 0xc8d8, 0xc8d9, 0xc8da, 0xc8db, 0xc8dc, 0xc8dd, 0xc8de, 0xc8df,
+ 0xc8e0, 0xc8e1, 0xc8e2, 0xc8e3, 0xc8e4, 0xc8e5, 0xc8e6, 0xc8e7,
+ 0xc8e8, 0xc8e9, 0xc8ea, 0xc8eb, 0xc8ec, 0xc8ed, 0xc8ee, 0xc8ef,
+ 0xc8f0, 0xc8f1, 0xc8f2, 0xc8f3, 0xc8f4, 0xc8f5, 0xc8f6, 0xc8f7,
+ 0xc8f8, 0xc8f9, 0xc8fa, 0xc8fb, 0xc8fc, 0xc8fd, 0xc8fe, 0xc8ff,
+ 0xc900, 0xc901, 0xc902, 0xc903, 0xc904, 0xc905, 0xc906, 0xc907,
+ 0xc908, 0xc909, 0xc90a, 0xc90b, 0xc90c, 0xc90d, 0xc90e, 0xc90f,
+ 0xc910, 0xc911, 0xc912, 0xc913, 0xc914, 0xc915, 0xc916, 0xc917,
+ 0xc918, 0xc919, 0xc91a, 0xc91b, 0xc91c, 0xc91d, 0xc91e, 0xc91f,
+ 0xc920, 0xc921, 0xc922, 0xc923, 0xc924, 0xc925, 0xc926, 0xc927,
+ 0xc928, 0xc929, 0xc92a, 0xc92b, 0xc92c, 0xc92d, 0xc92e, 0xc92f,
+ 0xc930, 0xc931, 0xc932, 0xc933, 0xc934, 0xc935, 0xc936, 0xc937,
+ 0xc938, 0xc939, 0xc93a, 0xc93b, 0xc93c, 0xc93d, 0xc93e, 0xc93f,
+ 0xc940, 0xc941, 0xc942, 0xc943, 0xc944, 0xc945, 0xc946, 0xc947,
+ 0xc948, 0xc949, 0xc94a, 0xc94b, 0xc94c, 0xc94d, 0xc94e, 0xc94f,
+ 0xc950, 0xc951, 0xc952, 0xc953, 0xc954, 0xc955, 0xc956, 0xc957,
+ 0xc958, 0xc959, 0xc95a, 0xc95b, 0xc95c, 0xc95d, 0xc95e, 0xc95f,
+ 0xc960, 0xc961, 0xc962, 0xc963, 0xc964, 0xc965, 0xc966, 0xc967,
+ 0xc968, 0xc969, 0xc96a, 0xc96b, 0xc96c, 0xc96d, 0xc96e, 0xc96f,
+ 0xc970, 0xc971, 0xc972, 0xc973, 0xc974, 0xc975, 0xc976, 0xc977,
+ 0xc978, 0xc979, 0xc97a, 0xc97b, 0xc97c, 0xc97d, 0xc97e, 0xc97f,
+ 0xc980, 0xc981, 0xc982, 0xc983, 0xc984, 0xc985, 0xc986, 0xc987,
+ 0xc988, 0xc989, 0xc98a, 0xc98b, 0xc98c, 0xc98d, 0xc98e, 0xc98f,
+ 0xc990, 0xc991, 0xc992, 0xc993, 0xc994, 0xc995, 0xc996, 0xc997,
+ 0xc998, 0xc999, 0xc99a, 0xc99b, 0xc99c, 0xc99d, 0xc99e, 0xc99f,
+ 0xc9a0, 0xc9a1, 0xc9a2, 0xc9a3, 0xc9a4, 0xc9a5, 0xc9a6, 0xc9a7,
+ 0xc9a8, 0xc9a9, 0xc9aa, 0xc9ab, 0xc9ac, 0xc9ad, 0xc9ae, 0xc9af,
+ 0xc9b0, 0xc9b1, 0xc9b2, 0xc9b3, 0xc9b4, 0xc9b5, 0xc9b6, 0xc9b7,
+ 0xc9b8, 0xc9b9, 0xc9ba, 0xc9bb, 0xc9bc, 0xc9bd, 0xc9be, 0xc9bf,
+ 0xc9c0, 0xc9c1, 0xc9c2, 0xc9c3, 0xc9c4, 0xc9c5, 0xc9c6, 0xc9c7,
+ 0xc9c8, 0xc9c9, 0xc9ca, 0xc9cb, 0xc9cc, 0xc9cd, 0xc9ce, 0xc9cf,
+ 0xc9d0, 0xc9d1, 0xc9d2, 0xc9d3, 0xc9d4, 0xc9d5, 0xc9d6, 0xc9d7,
+ 0xc9d8, 0xc9d9, 0xc9da, 0xc9db, 0xc9dc, 0xc9dd, 0xc9de, 0xc9df,
+ 0xc9e0, 0xc9e1, 0xc9e2, 0xc9e3, 0xc9e4, 0xc9e5, 0xc9e6, 0xc9e7,
+ 0xc9e8, 0xc9e9, 0xc9ea, 0xc9eb, 0xc9ec, 0xc9ed, 0xc9ee, 0xc9ef,
+ 0xc9f0, 0xc9f1, 0xc9f2, 0xc9f3, 0xc9f4, 0xc9f5, 0xc9f6, 0xc9f7,
+ 0xc9f8, 0xc9f9, 0xc9fa, 0xc9fb, 0xc9fc, 0xc9fd, 0xc9fe, 0xc9ff,
+ 0xca00, 0xca01, 0xca02, 0xca03, 0xca04, 0xca05, 0xca06, 0xca07,
+ 0xca08, 0xca09, 0xca0a, 0xca0b, 0xca0c, 0xca0d, 0xca0e, 0xca0f,
+ 0xca10, 0xca11, 0xca12, 0xca13, 0xca14, 0xca15, 0xca16, 0xca17,
+ 0xca18, 0xca19, 0xca1a, 0xca1b, 0xca1c, 0xca1d, 0xca1e, 0xca1f,
+ 0xca20, 0xca21, 0xca22, 0xca23, 0xca24, 0xca25, 0xca26, 0xca27,
+ 0xca28, 0xca29, 0xca2a, 0xca2b, 0xca2c, 0xca2d, 0xca2e, 0xca2f,
+ 0xca30, 0xca31, 0xca32, 0xca33, 0xca34, 0xca35, 0xca36, 0xca37,
+ 0xca38, 0xca39, 0xca3a, 0xca3b, 0xca3c, 0xca3d, 0xca3e, 0xca3f,
+ 0xca40, 0xca41, 0xca42, 0xca43, 0xca44, 0xca45, 0xca46, 0xca47,
+ 0xca48, 0xca49, 0xca4a, 0xca4b, 0xca4c, 0xca4d, 0xca4e, 0xca4f,
+ 0xca50, 0xca51, 0xca52, 0xca53, 0xca54, 0xca55, 0xca56, 0xca57,
+ 0xca58, 0xca59, 0xca5a, 0xca5b, 0xca5c, 0xca5d, 0xca5e, 0xca5f,
+ 0xca60, 0xca61, 0xca62, 0xca63, 0xca64, 0xca65, 0xca66, 0xca67,
+ 0xca68, 0xca69, 0xca6a, 0xca6b, 0xca6c, 0xca6d, 0xca6e, 0xca6f,
+ 0xca70, 0xca71, 0xca72, 0xca73, 0xca74, 0xca75, 0xca76, 0xca77,
+ 0xca78, 0xca79, 0xca7a, 0xca7b, 0xca7c, 0xca7d, 0xca7e, 0xca7f,
+ 0xca80, 0xca81, 0xca82, 0xca83, 0xca84, 0xca85, 0xca86, 0xca87,
+ 0xca88, 0xca89, 0xca8a, 0xca8b, 0xca8c, 0xca8d, 0xca8e, 0xca8f,
+ 0xca90, 0xca91, 0xca92, 0xca93, 0xca94, 0xca95, 0xca96, 0xca97,
+ 0xca98, 0xca99, 0xca9a, 0xca9b, 0xca9c, 0xca9d, 0xca9e, 0xca9f,
+ 0xcaa0, 0xcaa1, 0xcaa2, 0xcaa3, 0xcaa4, 0xcaa5, 0xcaa6, 0xcaa7,
+ 0xcaa8, 0xcaa9, 0xcaaa, 0xcaab, 0xcaac, 0xcaad, 0xcaae, 0xcaaf,
+ 0xcab0, 0xcab1, 0xcab2, 0xcab3, 0xcab4, 0xcab5, 0xcab6, 0xcab7,
+ 0xcab8, 0xcab9, 0xcaba, 0xcabb, 0xcabc, 0xcabd, 0xcabe, 0xcabf,
+ 0xcac0, 0xcac1, 0xcac2, 0xcac3, 0xcac4, 0xcac5, 0xcac6, 0xcac7,
+ 0xcac8, 0xcac9, 0xcaca, 0xcacb, 0xcacc, 0xcacd, 0xcace, 0xcacf,
+ 0xcad0, 0xcad1, 0xcad2, 0xcad3, 0xcad4, 0xcad5, 0xcad6, 0xcad7,
+ 0xcad8, 0xcad9, 0xcada, 0xcadb, 0xcadc, 0xcadd, 0xcade, 0xcadf,
+ 0xcae0, 0xcae1, 0xcae2, 0xcae3, 0xcae4, 0xcae5, 0xcae6, 0xcae7,
+ 0xcae8, 0xcae9, 0xcaea, 0xcaeb, 0xcaec, 0xcaed, 0xcaee, 0xcaef,
+ 0xcaf0, 0xcaf1, 0xcaf2, 0xcaf3, 0xcaf4, 0xcaf5, 0xcaf6, 0xcaf7,
+ 0xcaf8, 0xcaf9, 0xcafa, 0xcafb, 0xcafc, 0xcafd, 0xcafe, 0xcaff,
+ 0xcb00, 0xcb01, 0xcb02, 0xcb03, 0xcb04, 0xcb05, 0xcb06, 0xcb07,
+ 0xcb08, 0xcb09, 0xcb0a, 0xcb0b, 0xcb0c, 0xcb0d, 0xcb0e, 0xcb0f,
+ 0xcb10, 0xcb11, 0xcb12, 0xcb13, 0xcb14, 0xcb15, 0xcb16, 0xcb17,
+ 0xcb18, 0xcb19, 0xcb1a, 0xcb1b, 0xcb1c, 0xcb1d, 0xcb1e, 0xcb1f,
+ 0xcb20, 0xcb21, 0xcb22, 0xcb23, 0xcb24, 0xcb25, 0xcb26, 0xcb27,
+ 0xcb28, 0xcb29, 0xcb2a, 0xcb2b, 0xcb2c, 0xcb2d, 0xcb2e, 0xcb2f,
+ 0xcb30, 0xcb31, 0xcb32, 0xcb33, 0xcb34, 0xcb35, 0xcb36, 0xcb37,
+ 0xcb38, 0xcb39, 0xcb3a, 0xcb3b, 0xcb3c, 0xcb3d, 0xcb3e, 0xcb3f,
+ 0xcb40, 0xcb41, 0xcb42, 0xcb43, 0xcb44, 0xcb45, 0xcb46, 0xcb47,
+ 0xcb48, 0xcb49, 0xcb4a, 0xcb4b, 0xcb4c, 0xcb4d, 0xcb4e, 0xcb4f,
+ 0xcb50, 0xcb51, 0xcb52, 0xcb53, 0xcb54, 0xcb55, 0xcb56, 0xcb57,
+ 0xcb58, 0xcb59, 0xcb5a, 0xcb5b, 0xcb5c, 0xcb5d, 0xcb5e, 0xcb5f,
+ 0xcb60, 0xcb61, 0xcb62, 0xcb63, 0xcb64, 0xcb65, 0xcb66, 0xcb67,
+ 0xcb68, 0xcb69, 0xcb6a, 0xcb6b, 0xcb6c, 0xcb6d, 0xcb6e, 0xcb6f,
+ 0xcb70, 0xcb71, 0xcb72, 0xcb73, 0xcb74, 0xcb75, 0xcb76, 0xcb77,
+ 0xcb78, 0xcb79, 0xcb7a, 0xcb7b, 0xcb7c, 0xcb7d, 0xcb7e, 0xcb7f,
+ 0xcb80, 0xcb81, 0xcb82, 0xcb83, 0xcb84, 0xcb85, 0xcb86, 0xcb87,
+ 0xcb88, 0xcb89, 0xcb8a, 0xcb8b, 0xcb8c, 0xcb8d, 0xcb8e, 0xcb8f,
+ 0xcb90, 0xcb91, 0xcb92, 0xcb93, 0xcb94, 0xcb95, 0xcb96, 0xcb97,
+ 0xcb98, 0xcb99, 0xcb9a, 0xcb9b, 0xcb9c, 0xcb9d, 0xcb9e, 0xcb9f,
+ 0xcba0, 0xcba1, 0xcba2, 0xcba3, 0xcba4, 0xcba5, 0xcba6, 0xcba7,
+ 0xcba8, 0xcba9, 0xcbaa, 0xcbab, 0xcbac, 0xcbad, 0xcbae, 0xcbaf,
+ 0xcbb0, 0xcbb1, 0xcbb2, 0xcbb3, 0xcbb4, 0xcbb5, 0xcbb6, 0xcbb7,
+ 0xcbb8, 0xcbb9, 0xcbba, 0xcbbb, 0xcbbc, 0xcbbd, 0xcbbe, 0xcbbf,
+ 0xcbc0, 0xcbc1, 0xcbc2, 0xcbc3, 0xcbc4, 0xcbc5, 0xcbc6, 0xcbc7,
+ 0xcbc8, 0xcbc9, 0xcbca, 0xcbcb, 0xcbcc, 0xcbcd, 0xcbce, 0xcbcf,
+ 0xcbd0, 0xcbd1, 0xcbd2, 0xcbd3, 0xcbd4, 0xcbd5, 0xcbd6, 0xcbd7,
+ 0xcbd8, 0xcbd9, 0xcbda, 0xcbdb, 0xcbdc, 0xcbdd, 0xcbde, 0xcbdf,
+ 0xcbe0, 0xcbe1, 0xcbe2, 0xcbe3, 0xcbe4, 0xcbe5, 0xcbe6, 0xcbe7,
+ 0xcbe8, 0xcbe9, 0xcbea, 0xcbeb, 0xcbec, 0xcbed, 0xcbee, 0xcbef,
+ 0xcbf0, 0xcbf1, 0xcbf2, 0xcbf3, 0xcbf4, 0xcbf5, 0xcbf6, 0xcbf7,
+ 0xcbf8, 0xcbf9, 0xcbfa, 0xcbfb, 0xcbfc, 0xcbfd, 0xcbfe, 0xcbff,
+ 0xcc00, 0xcc01, 0xcc02, 0xcc03, 0xcc04, 0xcc05, 0xcc06, 0xcc07,
+ 0xcc08, 0xcc09, 0xcc0a, 0xcc0b, 0xcc0c, 0xcc0d, 0xcc0e, 0xcc0f,
+ 0xcc10, 0xcc11, 0xcc12, 0xcc13, 0xcc14, 0xcc15, 0xcc16, 0xcc17,
+ 0xcc18, 0xcc19, 0xcc1a, 0xcc1b, 0xcc1c, 0xcc1d, 0xcc1e, 0xcc1f,
+ 0xcc20, 0xcc21, 0xcc22, 0xcc23, 0xcc24, 0xcc25, 0xcc26, 0xcc27,
+ 0xcc28, 0xcc29, 0xcc2a, 0xcc2b, 0xcc2c, 0xcc2d, 0xcc2e, 0xcc2f,
+ 0xcc30, 0xcc31, 0xcc32, 0xcc33, 0xcc34, 0xcc35, 0xcc36, 0xcc37,
+ 0xcc38, 0xcc39, 0xcc3a, 0xcc3b, 0xcc3c, 0xcc3d, 0xcc3e, 0xcc3f,
+ 0xcc40, 0xcc41, 0xcc42, 0xcc43, 0xcc44, 0xcc45, 0xcc46, 0xcc47,
+ 0xcc48, 0xcc49, 0xcc4a, 0xcc4b, 0xcc4c, 0xcc4d, 0xcc4e, 0xcc4f,
+ 0xcc50, 0xcc51, 0xcc52, 0xcc53, 0xcc54, 0xcc55, 0xcc56, 0xcc57,
+ 0xcc58, 0xcc59, 0xcc5a, 0xcc5b, 0xcc5c, 0xcc5d, 0xcc5e, 0xcc5f,
+ 0xcc60, 0xcc61, 0xcc62, 0xcc63, 0xcc64, 0xcc65, 0xcc66, 0xcc67,
+ 0xcc68, 0xcc69, 0xcc6a, 0xcc6b, 0xcc6c, 0xcc6d, 0xcc6e, 0xcc6f,
+ 0xcc70, 0xcc71, 0xcc72, 0xcc73, 0xcc74, 0xcc75, 0xcc76, 0xcc77,
+ 0xcc78, 0xcc79, 0xcc7a, 0xcc7b, 0xcc7c, 0xcc7d, 0xcc7e, 0xcc7f,
+ 0xcc80, 0xcc81, 0xcc82, 0xcc83, 0xcc84, 0xcc85, 0xcc86, 0xcc87,
+ 0xcc88, 0xcc89, 0xcc8a, 0xcc8b, 0xcc8c, 0xcc8d, 0xcc8e, 0xcc8f,
+ 0xcc90, 0xcc91, 0xcc92, 0xcc93, 0xcc94, 0xcc95, 0xcc96, 0xcc97,
+ 0xcc98, 0xcc99, 0xcc9a, 0xcc9b, 0xcc9c, 0xcc9d, 0xcc9e, 0xcc9f,
+ 0xcca0, 0xcca1, 0xcca2, 0xcca3, 0xcca4, 0xcca5, 0xcca6, 0xcca7,
+ 0xcca8, 0xcca9, 0xccaa, 0xccab, 0xccac, 0xccad, 0xccae, 0xccaf,
+ 0xccb0, 0xccb1, 0xccb2, 0xccb3, 0xccb4, 0xccb5, 0xccb6, 0xccb7,
+ 0xccb8, 0xccb9, 0xccba, 0xccbb, 0xccbc, 0xccbd, 0xccbe, 0xccbf,
+ 0xccc0, 0xccc1, 0xccc2, 0xccc3, 0xccc4, 0xccc5, 0xccc6, 0xccc7,
+ 0xccc8, 0xccc9, 0xccca, 0xcccb, 0xcccc, 0xcccd, 0xccce, 0xcccf,
+ 0xccd0, 0xccd1, 0xccd2, 0xccd3, 0xccd4, 0xccd5, 0xccd6, 0xccd7,
+ 0xccd8, 0xccd9, 0xccda, 0xccdb, 0xccdc, 0xccdd, 0xccde, 0xccdf,
+ 0xcce0, 0xcce1, 0xcce2, 0xcce3, 0xcce4, 0xcce5, 0xcce6, 0xcce7,
+ 0xcce8, 0xcce9, 0xccea, 0xcceb, 0xccec, 0xcced, 0xccee, 0xccef,
+ 0xccf0, 0xccf1, 0xccf2, 0xccf3, 0xccf4, 0xccf5, 0xccf6, 0xccf7,
+ 0xccf8, 0xccf9, 0xccfa, 0xccfb, 0xccfc, 0xccfd, 0xccfe, 0xccff,
+ 0xcd00, 0xcd01, 0xcd02, 0xcd03, 0xcd04, 0xcd05, 0xcd06, 0xcd07,
+ 0xcd08, 0xcd09, 0xcd0a, 0xcd0b, 0xcd0c, 0xcd0d, 0xcd0e, 0xcd0f,
+ 0xcd10, 0xcd11, 0xcd12, 0xcd13, 0xcd14, 0xcd15, 0xcd16, 0xcd17,
+ 0xcd18, 0xcd19, 0xcd1a, 0xcd1b, 0xcd1c, 0xcd1d, 0xcd1e, 0xcd1f,
+ 0xcd20, 0xcd21, 0xcd22, 0xcd23, 0xcd24, 0xcd25, 0xcd26, 0xcd27,
+ 0xcd28, 0xcd29, 0xcd2a, 0xcd2b, 0xcd2c, 0xcd2d, 0xcd2e, 0xcd2f,
+ 0xcd30, 0xcd31, 0xcd32, 0xcd33, 0xcd34, 0xcd35, 0xcd36, 0xcd37,
+ 0xcd38, 0xcd39, 0xcd3a, 0xcd3b, 0xcd3c, 0xcd3d, 0xcd3e, 0xcd3f,
+ 0xcd40, 0xcd41, 0xcd42, 0xcd43, 0xcd44, 0xcd45, 0xcd46, 0xcd47,
+ 0xcd48, 0xcd49, 0xcd4a, 0xcd4b, 0xcd4c, 0xcd4d, 0xcd4e, 0xcd4f,
+ 0xcd50, 0xcd51, 0xcd52, 0xcd53, 0xcd54, 0xcd55, 0xcd56, 0xcd57,
+ 0xcd58, 0xcd59, 0xcd5a, 0xcd5b, 0xcd5c, 0xcd5d, 0xcd5e, 0xcd5f,
+ 0xcd60, 0xcd61, 0xcd62, 0xcd63, 0xcd64, 0xcd65, 0xcd66, 0xcd67,
+ 0xcd68, 0xcd69, 0xcd6a, 0xcd6b, 0xcd6c, 0xcd6d, 0xcd6e, 0xcd6f,
+ 0xcd70, 0xcd71, 0xcd72, 0xcd73, 0xcd74, 0xcd75, 0xcd76, 0xcd77,
+ 0xcd78, 0xcd79, 0xcd7a, 0xcd7b, 0xcd7c, 0xcd7d, 0xcd7e, 0xcd7f,
+ 0xcd80, 0xcd81, 0xcd82, 0xcd83, 0xcd84, 0xcd85, 0xcd86, 0xcd87,
+ 0xcd88, 0xcd89, 0xcd8a, 0xcd8b, 0xcd8c, 0xcd8d, 0xcd8e, 0xcd8f,
+ 0xcd90, 0xcd91, 0xcd92, 0xcd93, 0xcd94, 0xcd95, 0xcd96, 0xcd97,
+ 0xcd98, 0xcd99, 0xcd9a, 0xcd9b, 0xcd9c, 0xcd9d, 0xcd9e, 0xcd9f,
+ 0xcda0, 0xcda1, 0xcda2, 0xcda3, 0xcda4, 0xcda5, 0xcda6, 0xcda7,
+ 0xcda8, 0xcda9, 0xcdaa, 0xcdab, 0xcdac, 0xcdad, 0xcdae, 0xcdaf,
+ 0xcdb0, 0xcdb1, 0xcdb2, 0xcdb3, 0xcdb4, 0xcdb5, 0xcdb6, 0xcdb7,
+ 0xcdb8, 0xcdb9, 0xcdba, 0xcdbb, 0xcdbc, 0xcdbd, 0xcdbe, 0xcdbf,
+ 0xcdc0, 0xcdc1, 0xcdc2, 0xcdc3, 0xcdc4, 0xcdc5, 0xcdc6, 0xcdc7,
+ 0xcdc8, 0xcdc9, 0xcdca, 0xcdcb, 0xcdcc, 0xcdcd, 0xcdce, 0xcdcf,
+ 0xcdd0, 0xcdd1, 0xcdd2, 0xcdd3, 0xcdd4, 0xcdd5, 0xcdd6, 0xcdd7,
+ 0xcdd8, 0xcdd9, 0xcdda, 0xcddb, 0xcddc, 0xcddd, 0xcdde, 0xcddf,
+ 0xcde0, 0xcde1, 0xcde2, 0xcde3, 0xcde4, 0xcde5, 0xcde6, 0xcde7,
+ 0xcde8, 0xcde9, 0xcdea, 0xcdeb, 0xcdec, 0xcded, 0xcdee, 0xcdef,
+ 0xcdf0, 0xcdf1, 0xcdf2, 0xcdf3, 0xcdf4, 0xcdf5, 0xcdf6, 0xcdf7,
+ 0xcdf8, 0xcdf9, 0xcdfa, 0xcdfb, 0xcdfc, 0xcdfd, 0xcdfe, 0xcdff,
+ 0xce00, 0xce01, 0xce02, 0xce03, 0xce04, 0xce05, 0xce06, 0xce07,
+ 0xce08, 0xce09, 0xce0a, 0xce0b, 0xce0c, 0xce0d, 0xce0e, 0xce0f,
+ 0xce10, 0xce11, 0xce12, 0xce13, 0xce14, 0xce15, 0xce16, 0xce17,
+ 0xce18, 0xce19, 0xce1a, 0xce1b, 0xce1c, 0xce1d, 0xce1e, 0xce1f,
+ 0xce20, 0xce21, 0xce22, 0xce23, 0xce24, 0xce25, 0xce26, 0xce27,
+ 0xce28, 0xce29, 0xce2a, 0xce2b, 0xce2c, 0xce2d, 0xce2e, 0xce2f,
+ 0xce30, 0xce31, 0xce32, 0xce33, 0xce34, 0xce35, 0xce36, 0xce37,
+ 0xce38, 0xce39, 0xce3a, 0xce3b, 0xce3c, 0xce3d, 0xce3e, 0xce3f,
+ 0xce40, 0xce41, 0xce42, 0xce43, 0xce44, 0xce45, 0xce46, 0xce47,
+ 0xce48, 0xce49, 0xce4a, 0xce4b, 0xce4c, 0xce4d, 0xce4e, 0xce4f,
+ 0xce50, 0xce51, 0xce52, 0xce53, 0xce54, 0xce55, 0xce56, 0xce57,
+ 0xce58, 0xce59, 0xce5a, 0xce5b, 0xce5c, 0xce5d, 0xce5e, 0xce5f,
+ 0xce60, 0xce61, 0xce62, 0xce63, 0xce64, 0xce65, 0xce66, 0xce67,
+ 0xce68, 0xce69, 0xce6a, 0xce6b, 0xce6c, 0xce6d, 0xce6e, 0xce6f,
+ 0xce70, 0xce71, 0xce72, 0xce73, 0xce74, 0xce75, 0xce76, 0xce77,
+ 0xce78, 0xce79, 0xce7a, 0xce7b, 0xce7c, 0xce7d, 0xce7e, 0xce7f,
+ 0xce80, 0xce81, 0xce82, 0xce83, 0xce84, 0xce85, 0xce86, 0xce87,
+ 0xce88, 0xce89, 0xce8a, 0xce8b, 0xce8c, 0xce8d, 0xce8e, 0xce8f,
+ 0xce90, 0xce91, 0xce92, 0xce93, 0xce94, 0xce95, 0xce96, 0xce97,
+ 0xce98, 0xce99, 0xce9a, 0xce9b, 0xce9c, 0xce9d, 0xce9e, 0xce9f,
+ 0xcea0, 0xcea1, 0xcea2, 0xcea3, 0xcea4, 0xcea5, 0xcea6, 0xcea7,
+ 0xcea8, 0xcea9, 0xceaa, 0xceab, 0xceac, 0xcead, 0xceae, 0xceaf,
+ 0xceb0, 0xceb1, 0xceb2, 0xceb3, 0xceb4, 0xceb5, 0xceb6, 0xceb7,
+ 0xceb8, 0xceb9, 0xceba, 0xcebb, 0xcebc, 0xcebd, 0xcebe, 0xcebf,
+ 0xcec0, 0xcec1, 0xcec2, 0xcec3, 0xcec4, 0xcec5, 0xcec6, 0xcec7,
+ 0xcec8, 0xcec9, 0xceca, 0xcecb, 0xcecc, 0xcecd, 0xcece, 0xcecf,
+ 0xced0, 0xced1, 0xced2, 0xced3, 0xced4, 0xced5, 0xced6, 0xced7,
+ 0xced8, 0xced9, 0xceda, 0xcedb, 0xcedc, 0xcedd, 0xcede, 0xcedf,
+ 0xcee0, 0xcee1, 0xcee2, 0xcee3, 0xcee4, 0xcee5, 0xcee6, 0xcee7,
+ 0xcee8, 0xcee9, 0xceea, 0xceeb, 0xceec, 0xceed, 0xceee, 0xceef,
+ 0xcef0, 0xcef1, 0xcef2, 0xcef3, 0xcef4, 0xcef5, 0xcef6, 0xcef7,
+ 0xcef8, 0xcef9, 0xcefa, 0xcefb, 0xcefc, 0xcefd, 0xcefe, 0xceff,
+ 0xcf00, 0xcf01, 0xcf02, 0xcf03, 0xcf04, 0xcf05, 0xcf06, 0xcf07,
+ 0xcf08, 0xcf09, 0xcf0a, 0xcf0b, 0xcf0c, 0xcf0d, 0xcf0e, 0xcf0f,
+ 0xcf10, 0xcf11, 0xcf12, 0xcf13, 0xcf14, 0xcf15, 0xcf16, 0xcf17,
+ 0xcf18, 0xcf19, 0xcf1a, 0xcf1b, 0xcf1c, 0xcf1d, 0xcf1e, 0xcf1f,
+ 0xcf20, 0xcf21, 0xcf22, 0xcf23, 0xcf24, 0xcf25, 0xcf26, 0xcf27,
+ 0xcf28, 0xcf29, 0xcf2a, 0xcf2b, 0xcf2c, 0xcf2d, 0xcf2e, 0xcf2f,
+ 0xcf30, 0xcf31, 0xcf32, 0xcf33, 0xcf34, 0xcf35, 0xcf36, 0xcf37,
+ 0xcf38, 0xcf39, 0xcf3a, 0xcf3b, 0xcf3c, 0xcf3d, 0xcf3e, 0xcf3f,
+ 0xcf40, 0xcf41, 0xcf42, 0xcf43, 0xcf44, 0xcf45, 0xcf46, 0xcf47,
+ 0xcf48, 0xcf49, 0xcf4a, 0xcf4b, 0xcf4c, 0xcf4d, 0xcf4e, 0xcf4f,
+ 0xcf50, 0xcf51, 0xcf52, 0xcf53, 0xcf54, 0xcf55, 0xcf56, 0xcf57,
+ 0xcf58, 0xcf59, 0xcf5a, 0xcf5b, 0xcf5c, 0xcf5d, 0xcf5e, 0xcf5f,
+ 0xcf60, 0xcf61, 0xcf62, 0xcf63, 0xcf64, 0xcf65, 0xcf66, 0xcf67,
+ 0xcf68, 0xcf69, 0xcf6a, 0xcf6b, 0xcf6c, 0xcf6d, 0xcf6e, 0xcf6f,
+ 0xcf70, 0xcf71, 0xcf72, 0xcf73, 0xcf74, 0xcf75, 0xcf76, 0xcf77,
+ 0xcf78, 0xcf79, 0xcf7a, 0xcf7b, 0xcf7c, 0xcf7d, 0xcf7e, 0xcf7f,
+ 0xcf80, 0xcf81, 0xcf82, 0xcf83, 0xcf84, 0xcf85, 0xcf86, 0xcf87,
+ 0xcf88, 0xcf89, 0xcf8a, 0xcf8b, 0xcf8c, 0xcf8d, 0xcf8e, 0xcf8f,
+ 0xcf90, 0xcf91, 0xcf92, 0xcf93, 0xcf94, 0xcf95, 0xcf96, 0xcf97,
+ 0xcf98, 0xcf99, 0xcf9a, 0xcf9b, 0xcf9c, 0xcf9d, 0xcf9e, 0xcf9f,
+ 0xcfa0, 0xcfa1, 0xcfa2, 0xcfa3, 0xcfa4, 0xcfa5, 0xcfa6, 0xcfa7,
+ 0xcfa8, 0xcfa9, 0xcfaa, 0xcfab, 0xcfac, 0xcfad, 0xcfae, 0xcfaf,
+ 0xcfb0, 0xcfb1, 0xcfb2, 0xcfb3, 0xcfb4, 0xcfb5, 0xcfb6, 0xcfb7,
+ 0xcfb8, 0xcfb9, 0xcfba, 0xcfbb, 0xcfbc, 0xcfbd, 0xcfbe, 0xcfbf,
+ 0xcfc0, 0xcfc1, 0xcfc2, 0xcfc3, 0xcfc4, 0xcfc5, 0xcfc6, 0xcfc7,
+ 0xcfc8, 0xcfc9, 0xcfca, 0xcfcb, 0xcfcc, 0xcfcd, 0xcfce, 0xcfcf,
+ 0xcfd0, 0xcfd1, 0xcfd2, 0xcfd3, 0xcfd4, 0xcfd5, 0xcfd6, 0xcfd7,
+ 0xcfd8, 0xcfd9, 0xcfda, 0xcfdb, 0xcfdc, 0xcfdd, 0xcfde, 0xcfdf,
+ 0xcfe0, 0xcfe1, 0xcfe2, 0xcfe3, 0xcfe4, 0xcfe5, 0xcfe6, 0xcfe7,
+ 0xcfe8, 0xcfe9, 0xcfea, 0xcfeb, 0xcfec, 0xcfed, 0xcfee, 0xcfef,
+ 0xcff0, 0xcff1, 0xcff2, 0xcff3, 0xcff4, 0xcff5, 0xcff6, 0xcff7,
+ 0xcff8, 0xcff9, 0xcffa, 0xcffb, 0xcffc, 0xcffd, 0xcffe, 0xcfff,
+ 0xd000, 0xd001, 0xd002, 0xd003, 0xd004, 0xd005, 0xd006, 0xd007,
+ 0xd008, 0xd009, 0xd00a, 0xd00b, 0xd00c, 0xd00d, 0xd00e, 0xd00f,
+ 0xd010, 0xd011, 0xd012, 0xd013, 0xd014, 0xd015, 0xd016, 0xd017,
+ 0xd018, 0xd019, 0xd01a, 0xd01b, 0xd01c, 0xd01d, 0xd01e, 0xd01f,
+ 0xd020, 0xd021, 0xd022, 0xd023, 0xd024, 0xd025, 0xd026, 0xd027,
+ 0xd028, 0xd029, 0xd02a, 0xd02b, 0xd02c, 0xd02d, 0xd02e, 0xd02f,
+ 0xd030, 0xd031, 0xd032, 0xd033, 0xd034, 0xd035, 0xd036, 0xd037,
+ 0xd038, 0xd039, 0xd03a, 0xd03b, 0xd03c, 0xd03d, 0xd03e, 0xd03f,
+ 0xd040, 0xd041, 0xd042, 0xd043, 0xd044, 0xd045, 0xd046, 0xd047,
+ 0xd048, 0xd049, 0xd04a, 0xd04b, 0xd04c, 0xd04d, 0xd04e, 0xd04f,
+ 0xd050, 0xd051, 0xd052, 0xd053, 0xd054, 0xd055, 0xd056, 0xd057,
+ 0xd058, 0xd059, 0xd05a, 0xd05b, 0xd05c, 0xd05d, 0xd05e, 0xd05f,
+ 0xd060, 0xd061, 0xd062, 0xd063, 0xd064, 0xd065, 0xd066, 0xd067,
+ 0xd068, 0xd069, 0xd06a, 0xd06b, 0xd06c, 0xd06d, 0xd06e, 0xd06f,
+ 0xd070, 0xd071, 0xd072, 0xd073, 0xd074, 0xd075, 0xd076, 0xd077,
+ 0xd078, 0xd079, 0xd07a, 0xd07b, 0xd07c, 0xd07d, 0xd07e, 0xd07f,
+ 0xd080, 0xd081, 0xd082, 0xd083, 0xd084, 0xd085, 0xd086, 0xd087,
+ 0xd088, 0xd089, 0xd08a, 0xd08b, 0xd08c, 0xd08d, 0xd08e, 0xd08f,
+ 0xd090, 0xd091, 0xd092, 0xd093, 0xd094, 0xd095, 0xd096, 0xd097,
+ 0xd098, 0xd099, 0xd09a, 0xd09b, 0xd09c, 0xd09d, 0xd09e, 0xd09f,
+ 0xd0a0, 0xd0a1, 0xd0a2, 0xd0a3, 0xd0a4, 0xd0a5, 0xd0a6, 0xd0a7,
+ 0xd0a8, 0xd0a9, 0xd0aa, 0xd0ab, 0xd0ac, 0xd0ad, 0xd0ae, 0xd0af,
+ 0xd0b0, 0xd0b1, 0xd0b2, 0xd0b3, 0xd0b4, 0xd0b5, 0xd0b6, 0xd0b7,
+ 0xd0b8, 0xd0b9, 0xd0ba, 0xd0bb, 0xd0bc, 0xd0bd, 0xd0be, 0xd0bf,
+ 0xd0c0, 0xd0c1, 0xd0c2, 0xd0c3, 0xd0c4, 0xd0c5, 0xd0c6, 0xd0c7,
+ 0xd0c8, 0xd0c9, 0xd0ca, 0xd0cb, 0xd0cc, 0xd0cd, 0xd0ce, 0xd0cf,
+ 0xd0d0, 0xd0d1, 0xd0d2, 0xd0d3, 0xd0d4, 0xd0d5, 0xd0d6, 0xd0d7,
+ 0xd0d8, 0xd0d9, 0xd0da, 0xd0db, 0xd0dc, 0xd0dd, 0xd0de, 0xd0df,
+ 0xd0e0, 0xd0e1, 0xd0e2, 0xd0e3, 0xd0e4, 0xd0e5, 0xd0e6, 0xd0e7,
+ 0xd0e8, 0xd0e9, 0xd0ea, 0xd0eb, 0xd0ec, 0xd0ed, 0xd0ee, 0xd0ef,
+ 0xd0f0, 0xd0f1, 0xd0f2, 0xd0f3, 0xd0f4, 0xd0f5, 0xd0f6, 0xd0f7,
+ 0xd0f8, 0xd0f9, 0xd0fa, 0xd0fb, 0xd0fc, 0xd0fd, 0xd0fe, 0xd0ff,
+ 0xd100, 0xd101, 0xd102, 0xd103, 0xd104, 0xd105, 0xd106, 0xd107,
+ 0xd108, 0xd109, 0xd10a, 0xd10b, 0xd10c, 0xd10d, 0xd10e, 0xd10f,
+ 0xd110, 0xd111, 0xd112, 0xd113, 0xd114, 0xd115, 0xd116, 0xd117,
+ 0xd118, 0xd119, 0xd11a, 0xd11b, 0xd11c, 0xd11d, 0xd11e, 0xd11f,
+ 0xd120, 0xd121, 0xd122, 0xd123, 0xd124, 0xd125, 0xd126, 0xd127,
+ 0xd128, 0xd129, 0xd12a, 0xd12b, 0xd12c, 0xd12d, 0xd12e, 0xd12f,
+ 0xd130, 0xd131, 0xd132, 0xd133, 0xd134, 0xd135, 0xd136, 0xd137,
+ 0xd138, 0xd139, 0xd13a, 0xd13b, 0xd13c, 0xd13d, 0xd13e, 0xd13f,
+ 0xd140, 0xd141, 0xd142, 0xd143, 0xd144, 0xd145, 0xd146, 0xd147,
+ 0xd148, 0xd149, 0xd14a, 0xd14b, 0xd14c, 0xd14d, 0xd14e, 0xd14f,
+ 0xd150, 0xd151, 0xd152, 0xd153, 0xd154, 0xd155, 0xd156, 0xd157,
+ 0xd158, 0xd159, 0xd15a, 0xd15b, 0xd15c, 0xd15d, 0xd15e, 0xd15f,
+ 0xd160, 0xd161, 0xd162, 0xd163, 0xd164, 0xd165, 0xd166, 0xd167,
+ 0xd168, 0xd169, 0xd16a, 0xd16b, 0xd16c, 0xd16d, 0xd16e, 0xd16f,
+ 0xd170, 0xd171, 0xd172, 0xd173, 0xd174, 0xd175, 0xd176, 0xd177,
+ 0xd178, 0xd179, 0xd17a, 0xd17b, 0xd17c, 0xd17d, 0xd17e, 0xd17f,
+ 0xd180, 0xd181, 0xd182, 0xd183, 0xd184, 0xd185, 0xd186, 0xd187,
+ 0xd188, 0xd189, 0xd18a, 0xd18b, 0xd18c, 0xd18d, 0xd18e, 0xd18f,
+ 0xd190, 0xd191, 0xd192, 0xd193, 0xd194, 0xd195, 0xd196, 0xd197,
+ 0xd198, 0xd199, 0xd19a, 0xd19b, 0xd19c, 0xd19d, 0xd19e, 0xd19f,
+ 0xd1a0, 0xd1a1, 0xd1a2, 0xd1a3, 0xd1a4, 0xd1a5, 0xd1a6, 0xd1a7,
+ 0xd1a8, 0xd1a9, 0xd1aa, 0xd1ab, 0xd1ac, 0xd1ad, 0xd1ae, 0xd1af,
+ 0xd1b0, 0xd1b1, 0xd1b2, 0xd1b3, 0xd1b4, 0xd1b5, 0xd1b6, 0xd1b7,
+ 0xd1b8, 0xd1b9, 0xd1ba, 0xd1bb, 0xd1bc, 0xd1bd, 0xd1be, 0xd1bf,
+ 0xd1c0, 0xd1c1, 0xd1c2, 0xd1c3, 0xd1c4, 0xd1c5, 0xd1c6, 0xd1c7,
+ 0xd1c8, 0xd1c9, 0xd1ca, 0xd1cb, 0xd1cc, 0xd1cd, 0xd1ce, 0xd1cf,
+ 0xd1d0, 0xd1d1, 0xd1d2, 0xd1d3, 0xd1d4, 0xd1d5, 0xd1d6, 0xd1d7,
+ 0xd1d8, 0xd1d9, 0xd1da, 0xd1db, 0xd1dc, 0xd1dd, 0xd1de, 0xd1df,
+ 0xd1e0, 0xd1e1, 0xd1e2, 0xd1e3, 0xd1e4, 0xd1e5, 0xd1e6, 0xd1e7,
+ 0xd1e8, 0xd1e9, 0xd1ea, 0xd1eb, 0xd1ec, 0xd1ed, 0xd1ee, 0xd1ef,
+ 0xd1f0, 0xd1f1, 0xd1f2, 0xd1f3, 0xd1f4, 0xd1f5, 0xd1f6, 0xd1f7,
+ 0xd1f8, 0xd1f9, 0xd1fa, 0xd1fb, 0xd1fc, 0xd1fd, 0xd1fe, 0xd1ff,
+ 0xd200, 0xd201, 0xd202, 0xd203, 0xd204, 0xd205, 0xd206, 0xd207,
+ 0xd208, 0xd209, 0xd20a, 0xd20b, 0xd20c, 0xd20d, 0xd20e, 0xd20f,
+ 0xd210, 0xd211, 0xd212, 0xd213, 0xd214, 0xd215, 0xd216, 0xd217,
+ 0xd218, 0xd219, 0xd21a, 0xd21b, 0xd21c, 0xd21d, 0xd21e, 0xd21f,
+ 0xd220, 0xd221, 0xd222, 0xd223, 0xd224, 0xd225, 0xd226, 0xd227,
+ 0xd228, 0xd229, 0xd22a, 0xd22b, 0xd22c, 0xd22d, 0xd22e, 0xd22f,
+ 0xd230, 0xd231, 0xd232, 0xd233, 0xd234, 0xd235, 0xd236, 0xd237,
+ 0xd238, 0xd239, 0xd23a, 0xd23b, 0xd23c, 0xd23d, 0xd23e, 0xd23f,
+ 0xd240, 0xd241, 0xd242, 0xd243, 0xd244, 0xd245, 0xd246, 0xd247,
+ 0xd248, 0xd249, 0xd24a, 0xd24b, 0xd24c, 0xd24d, 0xd24e, 0xd24f,
+ 0xd250, 0xd251, 0xd252, 0xd253, 0xd254, 0xd255, 0xd256, 0xd257,
+ 0xd258, 0xd259, 0xd25a, 0xd25b, 0xd25c, 0xd25d, 0xd25e, 0xd25f,
+ 0xd260, 0xd261, 0xd262, 0xd263, 0xd264, 0xd265, 0xd266, 0xd267,
+ 0xd268, 0xd269, 0xd26a, 0xd26b, 0xd26c, 0xd26d, 0xd26e, 0xd26f,
+ 0xd270, 0xd271, 0xd272, 0xd273, 0xd274, 0xd275, 0xd276, 0xd277,
+ 0xd278, 0xd279, 0xd27a, 0xd27b, 0xd27c, 0xd27d, 0xd27e, 0xd27f,
+ 0xd280, 0xd281, 0xd282, 0xd283, 0xd284, 0xd285, 0xd286, 0xd287,
+ 0xd288, 0xd289, 0xd28a, 0xd28b, 0xd28c, 0xd28d, 0xd28e, 0xd28f,
+ 0xd290, 0xd291, 0xd292, 0xd293, 0xd294, 0xd295, 0xd296, 0xd297,
+ 0xd298, 0xd299, 0xd29a, 0xd29b, 0xd29c, 0xd29d, 0xd29e, 0xd29f,
+ 0xd2a0, 0xd2a1, 0xd2a2, 0xd2a3, 0xd2a4, 0xd2a5, 0xd2a6, 0xd2a7,
+ 0xd2a8, 0xd2a9, 0xd2aa, 0xd2ab, 0xd2ac, 0xd2ad, 0xd2ae, 0xd2af,
+ 0xd2b0, 0xd2b1, 0xd2b2, 0xd2b3, 0xd2b4, 0xd2b5, 0xd2b6, 0xd2b7,
+ 0xd2b8, 0xd2b9, 0xd2ba, 0xd2bb, 0xd2bc, 0xd2bd, 0xd2be, 0xd2bf,
+ 0xd2c0, 0xd2c1, 0xd2c2, 0xd2c3, 0xd2c4, 0xd2c5, 0xd2c6, 0xd2c7,
+ 0xd2c8, 0xd2c9, 0xd2ca, 0xd2cb, 0xd2cc, 0xd2cd, 0xd2ce, 0xd2cf,
+ 0xd2d0, 0xd2d1, 0xd2d2, 0xd2d3, 0xd2d4, 0xd2d5, 0xd2d6, 0xd2d7,
+ 0xd2d8, 0xd2d9, 0xd2da, 0xd2db, 0xd2dc, 0xd2dd, 0xd2de, 0xd2df,
+ 0xd2e0, 0xd2e1, 0xd2e2, 0xd2e3, 0xd2e4, 0xd2e5, 0xd2e6, 0xd2e7,
+ 0xd2e8, 0xd2e9, 0xd2ea, 0xd2eb, 0xd2ec, 0xd2ed, 0xd2ee, 0xd2ef,
+ 0xd2f0, 0xd2f1, 0xd2f2, 0xd2f3, 0xd2f4, 0xd2f5, 0xd2f6, 0xd2f7,
+ 0xd2f8, 0xd2f9, 0xd2fa, 0xd2fb, 0xd2fc, 0xd2fd, 0xd2fe, 0xd2ff,
+ 0xd300, 0xd301, 0xd302, 0xd303, 0xd304, 0xd305, 0xd306, 0xd307,
+ 0xd308, 0xd309, 0xd30a, 0xd30b, 0xd30c, 0xd30d, 0xd30e, 0xd30f,
+ 0xd310, 0xd311, 0xd312, 0xd313, 0xd314, 0xd315, 0xd316, 0xd317,
+ 0xd318, 0xd319, 0xd31a, 0xd31b, 0xd31c, 0xd31d, 0xd31e, 0xd31f,
+ 0xd320, 0xd321, 0xd322, 0xd323, 0xd324, 0xd325, 0xd326, 0xd327,
+ 0xd328, 0xd329, 0xd32a, 0xd32b, 0xd32c, 0xd32d, 0xd32e, 0xd32f,
+ 0xd330, 0xd331, 0xd332, 0xd333, 0xd334, 0xd335, 0xd336, 0xd337,
+ 0xd338, 0xd339, 0xd33a, 0xd33b, 0xd33c, 0xd33d, 0xd33e, 0xd33f,
+ 0xd340, 0xd341, 0xd342, 0xd343, 0xd344, 0xd345, 0xd346, 0xd347,
+ 0xd348, 0xd349, 0xd34a, 0xd34b, 0xd34c, 0xd34d, 0xd34e, 0xd34f,
+ 0xd350, 0xd351, 0xd352, 0xd353, 0xd354, 0xd355, 0xd356, 0xd357,
+ 0xd358, 0xd359, 0xd35a, 0xd35b, 0xd35c, 0xd35d, 0xd35e, 0xd35f,
+ 0xd360, 0xd361, 0xd362, 0xd363, 0xd364, 0xd365, 0xd366, 0xd367,
+ 0xd368, 0xd369, 0xd36a, 0xd36b, 0xd36c, 0xd36d, 0xd36e, 0xd36f,
+ 0xd370, 0xd371, 0xd372, 0xd373, 0xd374, 0xd375, 0xd376, 0xd377,
+ 0xd378, 0xd379, 0xd37a, 0xd37b, 0xd37c, 0xd37d, 0xd37e, 0xd37f,
+ 0xd380, 0xd381, 0xd382, 0xd383, 0xd384, 0xd385, 0xd386, 0xd387,
+ 0xd388, 0xd389, 0xd38a, 0xd38b, 0xd38c, 0xd38d, 0xd38e, 0xd38f,
+ 0xd390, 0xd391, 0xd392, 0xd393, 0xd394, 0xd395, 0xd396, 0xd397,
+ 0xd398, 0xd399, 0xd39a, 0xd39b, 0xd39c, 0xd39d, 0xd39e, 0xd39f,
+ 0xd3a0, 0xd3a1, 0xd3a2, 0xd3a3, 0xd3a4, 0xd3a5, 0xd3a6, 0xd3a7,
+ 0xd3a8, 0xd3a9, 0xd3aa, 0xd3ab, 0xd3ac, 0xd3ad, 0xd3ae, 0xd3af,
+ 0xd3b0, 0xd3b1, 0xd3b2, 0xd3b3, 0xd3b4, 0xd3b5, 0xd3b6, 0xd3b7,
+ 0xd3b8, 0xd3b9, 0xd3ba, 0xd3bb, 0xd3bc, 0xd3bd, 0xd3be, 0xd3bf,
+ 0xd3c0, 0xd3c1, 0xd3c2, 0xd3c3, 0xd3c4, 0xd3c5, 0xd3c6, 0xd3c7,
+ 0xd3c8, 0xd3c9, 0xd3ca, 0xd3cb, 0xd3cc, 0xd3cd, 0xd3ce, 0xd3cf,
+ 0xd3d0, 0xd3d1, 0xd3d2, 0xd3d3, 0xd3d4, 0xd3d5, 0xd3d6, 0xd3d7,
+ 0xd3d8, 0xd3d9, 0xd3da, 0xd3db, 0xd3dc, 0xd3dd, 0xd3de, 0xd3df,
+ 0xd3e0, 0xd3e1, 0xd3e2, 0xd3e3, 0xd3e4, 0xd3e5, 0xd3e6, 0xd3e7,
+ 0xd3e8, 0xd3e9, 0xd3ea, 0xd3eb, 0xd3ec, 0xd3ed, 0xd3ee, 0xd3ef,
+ 0xd3f0, 0xd3f1, 0xd3f2, 0xd3f3, 0xd3f4, 0xd3f5, 0xd3f6, 0xd3f7,
+ 0xd3f8, 0xd3f9, 0xd3fa, 0xd3fb, 0xd3fc, 0xd3fd, 0xd3fe, 0xd3ff,
+ 0xd400, 0xd401, 0xd402, 0xd403, 0xd404, 0xd405, 0xd406, 0xd407,
+ 0xd408, 0xd409, 0xd40a, 0xd40b, 0xd40c, 0xd40d, 0xd40e, 0xd40f,
+ 0xd410, 0xd411, 0xd412, 0xd413, 0xd414, 0xd415, 0xd416, 0xd417,
+ 0xd418, 0xd419, 0xd41a, 0xd41b, 0xd41c, 0xd41d, 0xd41e, 0xd41f,
+ 0xd420, 0xd421, 0xd422, 0xd423, 0xd424, 0xd425, 0xd426, 0xd427,
+ 0xd428, 0xd429, 0xd42a, 0xd42b, 0xd42c, 0xd42d, 0xd42e, 0xd42f,
+ 0xd430, 0xd431, 0xd432, 0xd433, 0xd434, 0xd435, 0xd436, 0xd437,
+ 0xd438, 0xd439, 0xd43a, 0xd43b, 0xd43c, 0xd43d, 0xd43e, 0xd43f,
+ 0xd440, 0xd441, 0xd442, 0xd443, 0xd444, 0xd445, 0xd446, 0xd447,
+ 0xd448, 0xd449, 0xd44a, 0xd44b, 0xd44c, 0xd44d, 0xd44e, 0xd44f,
+ 0xd450, 0xd451, 0xd452, 0xd453, 0xd454, 0xd455, 0xd456, 0xd457,
+ 0xd458, 0xd459, 0xd45a, 0xd45b, 0xd45c, 0xd45d, 0xd45e, 0xd45f,
+ 0xd460, 0xd461, 0xd462, 0xd463, 0xd464, 0xd465, 0xd466, 0xd467,
+ 0xd468, 0xd469, 0xd46a, 0xd46b, 0xd46c, 0xd46d, 0xd46e, 0xd46f,
+ 0xd470, 0xd471, 0xd472, 0xd473, 0xd474, 0xd475, 0xd476, 0xd477,
+ 0xd478, 0xd479, 0xd47a, 0xd47b, 0xd47c, 0xd47d, 0xd47e, 0xd47f,
+ 0xd480, 0xd481, 0xd482, 0xd483, 0xd484, 0xd485, 0xd486, 0xd487,
+ 0xd488, 0xd489, 0xd48a, 0xd48b, 0xd48c, 0xd48d, 0xd48e, 0xd48f,
+ 0xd490, 0xd491, 0xd492, 0xd493, 0xd494, 0xd495, 0xd496, 0xd497,
+ 0xd498, 0xd499, 0xd49a, 0xd49b, 0xd49c, 0xd49d, 0xd49e, 0xd49f,
+ 0xd4a0, 0xd4a1, 0xd4a2, 0xd4a3, 0xd4a4, 0xd4a5, 0xd4a6, 0xd4a7,
+ 0xd4a8, 0xd4a9, 0xd4aa, 0xd4ab, 0xd4ac, 0xd4ad, 0xd4ae, 0xd4af,
+ 0xd4b0, 0xd4b1, 0xd4b2, 0xd4b3, 0xd4b4, 0xd4b5, 0xd4b6, 0xd4b7,
+ 0xd4b8, 0xd4b9, 0xd4ba, 0xd4bb, 0xd4bc, 0xd4bd, 0xd4be, 0xd4bf,
+ 0xd4c0, 0xd4c1, 0xd4c2, 0xd4c3, 0xd4c4, 0xd4c5, 0xd4c6, 0xd4c7,
+ 0xd4c8, 0xd4c9, 0xd4ca, 0xd4cb, 0xd4cc, 0xd4cd, 0xd4ce, 0xd4cf,
+ 0xd4d0, 0xd4d1, 0xd4d2, 0xd4d3, 0xd4d4, 0xd4d5, 0xd4d6, 0xd4d7,
+ 0xd4d8, 0xd4d9, 0xd4da, 0xd4db, 0xd4dc, 0xd4dd, 0xd4de, 0xd4df,
+ 0xd4e0, 0xd4e1, 0xd4e2, 0xd4e3, 0xd4e4, 0xd4e5, 0xd4e6, 0xd4e7,
+ 0xd4e8, 0xd4e9, 0xd4ea, 0xd4eb, 0xd4ec, 0xd4ed, 0xd4ee, 0xd4ef,
+ 0xd4f0, 0xd4f1, 0xd4f2, 0xd4f3, 0xd4f4, 0xd4f5, 0xd4f6, 0xd4f7,
+ 0xd4f8, 0xd4f9, 0xd4fa, 0xd4fb, 0xd4fc, 0xd4fd, 0xd4fe, 0xd4ff,
+ 0xd500, 0xd501, 0xd502, 0xd503, 0xd504, 0xd505, 0xd506, 0xd507,
+ 0xd508, 0xd509, 0xd50a, 0xd50b, 0xd50c, 0xd50d, 0xd50e, 0xd50f,
+ 0xd510, 0xd511, 0xd512, 0xd513, 0xd514, 0xd515, 0xd516, 0xd517,
+ 0xd518, 0xd519, 0xd51a, 0xd51b, 0xd51c, 0xd51d, 0xd51e, 0xd51f,
+ 0xd520, 0xd521, 0xd522, 0xd523, 0xd524, 0xd525, 0xd526, 0xd527,
+ 0xd528, 0xd529, 0xd52a, 0xd52b, 0xd52c, 0xd52d, 0xd52e, 0xd52f,
+ 0xd530, 0xd531, 0xd532, 0xd533, 0xd534, 0xd535, 0xd536, 0xd537,
+ 0xd538, 0xd539, 0xd53a, 0xd53b, 0xd53c, 0xd53d, 0xd53e, 0xd53f,
+ 0xd540, 0xd541, 0xd542, 0xd543, 0xd544, 0xd545, 0xd546, 0xd547,
+ 0xd548, 0xd549, 0xd54a, 0xd54b, 0xd54c, 0xd54d, 0xd54e, 0xd54f,
+ 0xd550, 0xd551, 0xd552, 0xd553, 0xd554, 0xd555, 0xd556, 0xd557,
+ 0xd558, 0xd559, 0xd55a, 0xd55b, 0xd55c, 0xd55d, 0xd55e, 0xd55f,
+ 0xd560, 0xd561, 0xd562, 0xd563, 0xd564, 0xd565, 0xd566, 0xd567,
+ 0xd568, 0xd569, 0xd56a, 0xd56b, 0xd56c, 0xd56d, 0xd56e, 0xd56f,
+ 0xd570, 0xd571, 0xd572, 0xd573, 0xd574, 0xd575, 0xd576, 0xd577,
+ 0xd578, 0xd579, 0xd57a, 0xd57b, 0xd57c, 0xd57d, 0xd57e, 0xd57f,
+ 0xd580, 0xd581, 0xd582, 0xd583, 0xd584, 0xd585, 0xd586, 0xd587,
+ 0xd588, 0xd589, 0xd58a, 0xd58b, 0xd58c, 0xd58d, 0xd58e, 0xd58f,
+ 0xd590, 0xd591, 0xd592, 0xd593, 0xd594, 0xd595, 0xd596, 0xd597,
+ 0xd598, 0xd599, 0xd59a, 0xd59b, 0xd59c, 0xd59d, 0xd59e, 0xd59f,
+ 0xd5a0, 0xd5a1, 0xd5a2, 0xd5a3, 0xd5a4, 0xd5a5, 0xd5a6, 0xd5a7,
+ 0xd5a8, 0xd5a9, 0xd5aa, 0xd5ab, 0xd5ac, 0xd5ad, 0xd5ae, 0xd5af,
+ 0xd5b0, 0xd5b1, 0xd5b2, 0xd5b3, 0xd5b4, 0xd5b5, 0xd5b6, 0xd5b7,
+ 0xd5b8, 0xd5b9, 0xd5ba, 0xd5bb, 0xd5bc, 0xd5bd, 0xd5be, 0xd5bf,
+ 0xd5c0, 0xd5c1, 0xd5c2, 0xd5c3, 0xd5c4, 0xd5c5, 0xd5c6, 0xd5c7,
+ 0xd5c8, 0xd5c9, 0xd5ca, 0xd5cb, 0xd5cc, 0xd5cd, 0xd5ce, 0xd5cf,
+ 0xd5d0, 0xd5d1, 0xd5d2, 0xd5d3, 0xd5d4, 0xd5d5, 0xd5d6, 0xd5d7,
+ 0xd5d8, 0xd5d9, 0xd5da, 0xd5db, 0xd5dc, 0xd5dd, 0xd5de, 0xd5df,
+ 0xd5e0, 0xd5e1, 0xd5e2, 0xd5e3, 0xd5e4, 0xd5e5, 0xd5e6, 0xd5e7,
+ 0xd5e8, 0xd5e9, 0xd5ea, 0xd5eb, 0xd5ec, 0xd5ed, 0xd5ee, 0xd5ef,
+ 0xd5f0, 0xd5f1, 0xd5f2, 0xd5f3, 0xd5f4, 0xd5f5, 0xd5f6, 0xd5f7,
+ 0xd5f8, 0xd5f9, 0xd5fa, 0xd5fb, 0xd5fc, 0xd5fd, 0xd5fe, 0xd5ff,
+ 0xd600, 0xd601, 0xd602, 0xd603, 0xd604, 0xd605, 0xd606, 0xd607,
+ 0xd608, 0xd609, 0xd60a, 0xd60b, 0xd60c, 0xd60d, 0xd60e, 0xd60f,
+ 0xd610, 0xd611, 0xd612, 0xd613, 0xd614, 0xd615, 0xd616, 0xd617,
+ 0xd618, 0xd619, 0xd61a, 0xd61b, 0xd61c, 0xd61d, 0xd61e, 0xd61f,
+ 0xd620, 0xd621, 0xd622, 0xd623, 0xd624, 0xd625, 0xd626, 0xd627,
+ 0xd628, 0xd629, 0xd62a, 0xd62b, 0xd62c, 0xd62d, 0xd62e, 0xd62f,
+ 0xd630, 0xd631, 0xd632, 0xd633, 0xd634, 0xd635, 0xd636, 0xd637,
+ 0xd638, 0xd639, 0xd63a, 0xd63b, 0xd63c, 0xd63d, 0xd63e, 0xd63f,
+ 0xd640, 0xd641, 0xd642, 0xd643, 0xd644, 0xd645, 0xd646, 0xd647,
+ 0xd648, 0xd649, 0xd64a, 0xd64b, 0xd64c, 0xd64d, 0xd64e, 0xd64f,
+ 0xd650, 0xd651, 0xd652, 0xd653, 0xd654, 0xd655, 0xd656, 0xd657,
+ 0xd658, 0xd659, 0xd65a, 0xd65b, 0xd65c, 0xd65d, 0xd65e, 0xd65f,
+ 0xd660, 0xd661, 0xd662, 0xd663, 0xd664, 0xd665, 0xd666, 0xd667,
+ 0xd668, 0xd669, 0xd66a, 0xd66b, 0xd66c, 0xd66d, 0xd66e, 0xd66f,
+ 0xd670, 0xd671, 0xd672, 0xd673, 0xd674, 0xd675, 0xd676, 0xd677,
+ 0xd678, 0xd679, 0xd67a, 0xd67b, 0xd67c, 0xd67d, 0xd67e, 0xd67f,
+ 0xd680, 0xd681, 0xd682, 0xd683, 0xd684, 0xd685, 0xd686, 0xd687,
+ 0xd688, 0xd689, 0xd68a, 0xd68b, 0xd68c, 0xd68d, 0xd68e, 0xd68f,
+ 0xd690, 0xd691, 0xd692, 0xd693, 0xd694, 0xd695, 0xd696, 0xd697,
+ 0xd698, 0xd699, 0xd69a, 0xd69b, 0xd69c, 0xd69d, 0xd69e, 0xd69f,
+ 0xd6a0, 0xd6a1, 0xd6a2, 0xd6a3, 0xd6a4, 0xd6a5, 0xd6a6, 0xd6a7,
+ 0xd6a8, 0xd6a9, 0xd6aa, 0xd6ab, 0xd6ac, 0xd6ad, 0xd6ae, 0xd6af,
+ 0xd6b0, 0xd6b1, 0xd6b2, 0xd6b3, 0xd6b4, 0xd6b5, 0xd6b6, 0xd6b7,
+ 0xd6b8, 0xd6b9, 0xd6ba, 0xd6bb, 0xd6bc, 0xd6bd, 0xd6be, 0xd6bf,
+ 0xd6c0, 0xd6c1, 0xd6c2, 0xd6c3, 0xd6c4, 0xd6c5, 0xd6c6, 0xd6c7,
+ 0xd6c8, 0xd6c9, 0xd6ca, 0xd6cb, 0xd6cc, 0xd6cd, 0xd6ce, 0xd6cf,
+ 0xd6d0, 0xd6d1, 0xd6d2, 0xd6d3, 0xd6d4, 0xd6d5, 0xd6d6, 0xd6d7,
+ 0xd6d8, 0xd6d9, 0xd6da, 0xd6db, 0xd6dc, 0xd6dd, 0xd6de, 0xd6df,
+ 0xd6e0, 0xd6e1, 0xd6e2, 0xd6e3, 0xd6e4, 0xd6e5, 0xd6e6, 0xd6e7,
+ 0xd6e8, 0xd6e9, 0xd6ea, 0xd6eb, 0xd6ec, 0xd6ed, 0xd6ee, 0xd6ef,
+ 0xd6f0, 0xd6f1, 0xd6f2, 0xd6f3, 0xd6f4, 0xd6f5, 0xd6f6, 0xd6f7,
+ 0xd6f8, 0xd6f9, 0xd6fa, 0xd6fb, 0xd6fc, 0xd6fd, 0xd6fe, 0xd6ff,
+ 0xd700, 0xd701, 0xd702, 0xd703, 0xd704, 0xd705, 0xd706, 0xd707,
+ 0xd708, 0xd709, 0xd70a, 0xd70b, 0xd70c, 0xd70d, 0xd70e, 0xd70f,
+ 0xd710, 0xd711, 0xd712, 0xd713, 0xd714, 0xd715, 0xd716, 0xd717,
+ 0xd718, 0xd719, 0xd71a, 0xd71b, 0xd71c, 0xd71d, 0xd71e, 0xd71f,
+ 0xd720, 0xd721, 0xd722, 0xd723, 0xd724, 0xd725, 0xd726, 0xd727,
+ 0xd728, 0xd729, 0xd72a, 0xd72b, 0xd72c, 0xd72d, 0xd72e, 0xd72f,
+ 0xd730, 0xd731, 0xd732, 0xd733, 0xd734, 0xd735, 0xd736, 0xd737,
+ 0xd738, 0xd739, 0xd73a, 0xd73b, 0xd73c, 0xd73d, 0xd73e, 0xd73f,
+ 0xd740, 0xd741, 0xd742, 0xd743, 0xd744, 0xd745, 0xd746, 0xd747,
+ 0xd748, 0xd749, 0xd74a, 0xd74b, 0xd74c, 0xd74d, 0xd74e, 0xd74f,
+ 0xd750, 0xd751, 0xd752, 0xd753, 0xd754, 0xd755, 0xd756, 0xd757,
+ 0xd758, 0xd759, 0xd75a, 0xd75b, 0xd75c, 0xd75d, 0xd75e, 0xd75f,
+ 0xd760, 0xd761, 0xd762, 0xd763, 0xd764, 0xd765, 0xd766, 0xd767,
+ 0xd768, 0xd769, 0xd76a, 0xd76b, 0xd76c, 0xd76d, 0xd76e, 0xd76f,
+ 0xd770, 0xd771, 0xd772, 0xd773, 0xd774, 0xd775, 0xd776, 0xd777,
+ 0xd778, 0xd779, 0xd77a, 0xd77b, 0xd77c, 0xd77d, 0xd77e, 0xd77f,
+ 0xd780, 0xd781, 0xd782, 0xd783, 0xd784, 0xd785, 0xd786, 0xd787,
+ 0xd788, 0xd789, 0xd78a, 0xd78b, 0xd78c, 0xd78d, 0xd78e, 0xd78f,
+ 0xd790, 0xd791, 0xd792, 0xd793, 0xd794, 0xd795, 0xd796, 0xd797,
+ 0xd798, 0xd799, 0xd79a, 0xd79b, 0xd79c, 0xd79d, 0xd79e, 0xd79f,
+ 0xd7a0, 0xd7a1, 0xd7a2, 0xd7a3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xd800, 0xd801, 0xd802, 0xd803, 0xd804, 0xd805, 0xd806, 0xd807,
+ 0xd808, 0xd809, 0xd80a, 0xd80b, 0xd80c, 0xd80d, 0xd80e, 0xd80f,
+ 0xd810, 0xd811, 0xd812, 0xd813, 0xd814, 0xd815, 0xd816, 0xd817,
+ 0xd818, 0xd819, 0xd81a, 0xd81b, 0xd81c, 0xd81d, 0xd81e, 0xd81f,
+ 0xd820, 0xd821, 0xd822, 0xd823, 0xd824, 0xd825, 0xd826, 0xd827,
+ 0xd828, 0xd829, 0xd82a, 0xd82b, 0xd82c, 0xd82d, 0xd82e, 0xd82f,
+ 0xd830, 0xd831, 0xd832, 0xd833, 0xd834, 0xd835, 0xd836, 0xd837,
+ 0xd838, 0xd839, 0xd83a, 0xd83b, 0xd83c, 0xd83d, 0xd83e, 0xd83f,
+ 0xd840, 0xd841, 0xd842, 0xd843, 0xd844, 0xd845, 0xd846, 0xd847,
+ 0xd848, 0xd849, 0xd84a, 0xd84b, 0xd84c, 0xd84d, 0xd84e, 0xd84f,
+ 0xd850, 0xd851, 0xd852, 0xd853, 0xd854, 0xd855, 0xd856, 0xd857,
+ 0xd858, 0xd859, 0xd85a, 0xd85b, 0xd85c, 0xd85d, 0xd85e, 0xd85f,
+ 0xd860, 0xd861, 0xd862, 0xd863, 0xd864, 0xd865, 0xd866, 0xd867,
+ 0xd868, 0xd869, 0xd86a, 0xd86b, 0xd86c, 0xd86d, 0xd86e, 0xd86f,
+ 0xd870, 0xd871, 0xd872, 0xd873, 0xd874, 0xd875, 0xd876, 0xd877,
+ 0xd878, 0xd879, 0xd87a, 0xd87b, 0xd87c, 0xd87d, 0xd87e, 0xd87f,
+ 0xd880, 0xd881, 0xd882, 0xd883, 0xd884, 0xd885, 0xd886, 0xd887,
+ 0xd888, 0xd889, 0xd88a, 0xd88b, 0xd88c, 0xd88d, 0xd88e, 0xd88f,
+ 0xd890, 0xd891, 0xd892, 0xd893, 0xd894, 0xd895, 0xd896, 0xd897,
+ 0xd898, 0xd899, 0xd89a, 0xd89b, 0xd89c, 0xd89d, 0xd89e, 0xd89f,
+ 0xd8a0, 0xd8a1, 0xd8a2, 0xd8a3, 0xd8a4, 0xd8a5, 0xd8a6, 0xd8a7,
+ 0xd8a8, 0xd8a9, 0xd8aa, 0xd8ab, 0xd8ac, 0xd8ad, 0xd8ae, 0xd8af,
+ 0xd8b0, 0xd8b1, 0xd8b2, 0xd8b3, 0xd8b4, 0xd8b5, 0xd8b6, 0xd8b7,
+ 0xd8b8, 0xd8b9, 0xd8ba, 0xd8bb, 0xd8bc, 0xd8bd, 0xd8be, 0xd8bf,
+ 0xd8c0, 0xd8c1, 0xd8c2, 0xd8c3, 0xd8c4, 0xd8c5, 0xd8c6, 0xd8c7,
+ 0xd8c8, 0xd8c9, 0xd8ca, 0xd8cb, 0xd8cc, 0xd8cd, 0xd8ce, 0xd8cf,
+ 0xd8d0, 0xd8d1, 0xd8d2, 0xd8d3, 0xd8d4, 0xd8d5, 0xd8d6, 0xd8d7,
+ 0xd8d8, 0xd8d9, 0xd8da, 0xd8db, 0xd8dc, 0xd8dd, 0xd8de, 0xd8df,
+ 0xd8e0, 0xd8e1, 0xd8e2, 0xd8e3, 0xd8e4, 0xd8e5, 0xd8e6, 0xd8e7,
+ 0xd8e8, 0xd8e9, 0xd8ea, 0xd8eb, 0xd8ec, 0xd8ed, 0xd8ee, 0xd8ef,
+ 0xd8f0, 0xd8f1, 0xd8f2, 0xd8f3, 0xd8f4, 0xd8f5, 0xd8f6, 0xd8f7,
+ 0xd8f8, 0xd8f9, 0xd8fa, 0xd8fb, 0xd8fc, 0xd8fd, 0xd8fe, 0xd8ff,
+ 0xd900, 0xd901, 0xd902, 0xd903, 0xd904, 0xd905, 0xd906, 0xd907,
+ 0xd908, 0xd909, 0xd90a, 0xd90b, 0xd90c, 0xd90d, 0xd90e, 0xd90f,
+ 0xd910, 0xd911, 0xd912, 0xd913, 0xd914, 0xd915, 0xd916, 0xd917,
+ 0xd918, 0xd919, 0xd91a, 0xd91b, 0xd91c, 0xd91d, 0xd91e, 0xd91f,
+ 0xd920, 0xd921, 0xd922, 0xd923, 0xd924, 0xd925, 0xd926, 0xd927,
+ 0xd928, 0xd929, 0xd92a, 0xd92b, 0xd92c, 0xd92d, 0xd92e, 0xd92f,
+ 0xd930, 0xd931, 0xd932, 0xd933, 0xd934, 0xd935, 0xd936, 0xd937,
+ 0xd938, 0xd939, 0xd93a, 0xd93b, 0xd93c, 0xd93d, 0xd93e, 0xd93f,
+ 0xd940, 0xd941, 0xd942, 0xd943, 0xd944, 0xd945, 0xd946, 0xd947,
+ 0xd948, 0xd949, 0xd94a, 0xd94b, 0xd94c, 0xd94d, 0xd94e, 0xd94f,
+ 0xd950, 0xd951, 0xd952, 0xd953, 0xd954, 0xd955, 0xd956, 0xd957,
+ 0xd958, 0xd959, 0xd95a, 0xd95b, 0xd95c, 0xd95d, 0xd95e, 0xd95f,
+ 0xd960, 0xd961, 0xd962, 0xd963, 0xd964, 0xd965, 0xd966, 0xd967,
+ 0xd968, 0xd969, 0xd96a, 0xd96b, 0xd96c, 0xd96d, 0xd96e, 0xd96f,
+ 0xd970, 0xd971, 0xd972, 0xd973, 0xd974, 0xd975, 0xd976, 0xd977,
+ 0xd978, 0xd979, 0xd97a, 0xd97b, 0xd97c, 0xd97d, 0xd97e, 0xd97f,
+ 0xd980, 0xd981, 0xd982, 0xd983, 0xd984, 0xd985, 0xd986, 0xd987,
+ 0xd988, 0xd989, 0xd98a, 0xd98b, 0xd98c, 0xd98d, 0xd98e, 0xd98f,
+ 0xd990, 0xd991, 0xd992, 0xd993, 0xd994, 0xd995, 0xd996, 0xd997,
+ 0xd998, 0xd999, 0xd99a, 0xd99b, 0xd99c, 0xd99d, 0xd99e, 0xd99f,
+ 0xd9a0, 0xd9a1, 0xd9a2, 0xd9a3, 0xd9a4, 0xd9a5, 0xd9a6, 0xd9a7,
+ 0xd9a8, 0xd9a9, 0xd9aa, 0xd9ab, 0xd9ac, 0xd9ad, 0xd9ae, 0xd9af,
+ 0xd9b0, 0xd9b1, 0xd9b2, 0xd9b3, 0xd9b4, 0xd9b5, 0xd9b6, 0xd9b7,
+ 0xd9b8, 0xd9b9, 0xd9ba, 0xd9bb, 0xd9bc, 0xd9bd, 0xd9be, 0xd9bf,
+ 0xd9c0, 0xd9c1, 0xd9c2, 0xd9c3, 0xd9c4, 0xd9c5, 0xd9c6, 0xd9c7,
+ 0xd9c8, 0xd9c9, 0xd9ca, 0xd9cb, 0xd9cc, 0xd9cd, 0xd9ce, 0xd9cf,
+ 0xd9d0, 0xd9d1, 0xd9d2, 0xd9d3, 0xd9d4, 0xd9d5, 0xd9d6, 0xd9d7,
+ 0xd9d8, 0xd9d9, 0xd9da, 0xd9db, 0xd9dc, 0xd9dd, 0xd9de, 0xd9df,
+ 0xd9e0, 0xd9e1, 0xd9e2, 0xd9e3, 0xd9e4, 0xd9e5, 0xd9e6, 0xd9e7,
+ 0xd9e8, 0xd9e9, 0xd9ea, 0xd9eb, 0xd9ec, 0xd9ed, 0xd9ee, 0xd9ef,
+ 0xd9f0, 0xd9f1, 0xd9f2, 0xd9f3, 0xd9f4, 0xd9f5, 0xd9f6, 0xd9f7,
+ 0xd9f8, 0xd9f9, 0xd9fa, 0xd9fb, 0xd9fc, 0xd9fd, 0xd9fe, 0xd9ff,
+ 0xda00, 0xda01, 0xda02, 0xda03, 0xda04, 0xda05, 0xda06, 0xda07,
+ 0xda08, 0xda09, 0xda0a, 0xda0b, 0xda0c, 0xda0d, 0xda0e, 0xda0f,
+ 0xda10, 0xda11, 0xda12, 0xda13, 0xda14, 0xda15, 0xda16, 0xda17,
+ 0xda18, 0xda19, 0xda1a, 0xda1b, 0xda1c, 0xda1d, 0xda1e, 0xda1f,
+ 0xda20, 0xda21, 0xda22, 0xda23, 0xda24, 0xda25, 0xda26, 0xda27,
+ 0xda28, 0xda29, 0xda2a, 0xda2b, 0xda2c, 0xda2d, 0xda2e, 0xda2f,
+ 0xda30, 0xda31, 0xda32, 0xda33, 0xda34, 0xda35, 0xda36, 0xda37,
+ 0xda38, 0xda39, 0xda3a, 0xda3b, 0xda3c, 0xda3d, 0xda3e, 0xda3f,
+ 0xda40, 0xda41, 0xda42, 0xda43, 0xda44, 0xda45, 0xda46, 0xda47,
+ 0xda48, 0xda49, 0xda4a, 0xda4b, 0xda4c, 0xda4d, 0xda4e, 0xda4f,
+ 0xda50, 0xda51, 0xda52, 0xda53, 0xda54, 0xda55, 0xda56, 0xda57,
+ 0xda58, 0xda59, 0xda5a, 0xda5b, 0xda5c, 0xda5d, 0xda5e, 0xda5f,
+ 0xda60, 0xda61, 0xda62, 0xda63, 0xda64, 0xda65, 0xda66, 0xda67,
+ 0xda68, 0xda69, 0xda6a, 0xda6b, 0xda6c, 0xda6d, 0xda6e, 0xda6f,
+ 0xda70, 0xda71, 0xda72, 0xda73, 0xda74, 0xda75, 0xda76, 0xda77,
+ 0xda78, 0xda79, 0xda7a, 0xda7b, 0xda7c, 0xda7d, 0xda7e, 0xda7f,
+ 0xda80, 0xda81, 0xda82, 0xda83, 0xda84, 0xda85, 0xda86, 0xda87,
+ 0xda88, 0xda89, 0xda8a, 0xda8b, 0xda8c, 0xda8d, 0xda8e, 0xda8f,
+ 0xda90, 0xda91, 0xda92, 0xda93, 0xda94, 0xda95, 0xda96, 0xda97,
+ 0xda98, 0xda99, 0xda9a, 0xda9b, 0xda9c, 0xda9d, 0xda9e, 0xda9f,
+ 0xdaa0, 0xdaa1, 0xdaa2, 0xdaa3, 0xdaa4, 0xdaa5, 0xdaa6, 0xdaa7,
+ 0xdaa8, 0xdaa9, 0xdaaa, 0xdaab, 0xdaac, 0xdaad, 0xdaae, 0xdaaf,
+ 0xdab0, 0xdab1, 0xdab2, 0xdab3, 0xdab4, 0xdab5, 0xdab6, 0xdab7,
+ 0xdab8, 0xdab9, 0xdaba, 0xdabb, 0xdabc, 0xdabd, 0xdabe, 0xdabf,
+ 0xdac0, 0xdac1, 0xdac2, 0xdac3, 0xdac4, 0xdac5, 0xdac6, 0xdac7,
+ 0xdac8, 0xdac9, 0xdaca, 0xdacb, 0xdacc, 0xdacd, 0xdace, 0xdacf,
+ 0xdad0, 0xdad1, 0xdad2, 0xdad3, 0xdad4, 0xdad5, 0xdad6, 0xdad7,
+ 0xdad8, 0xdad9, 0xdada, 0xdadb, 0xdadc, 0xdadd, 0xdade, 0xdadf,
+ 0xdae0, 0xdae1, 0xdae2, 0xdae3, 0xdae4, 0xdae5, 0xdae6, 0xdae7,
+ 0xdae8, 0xdae9, 0xdaea, 0xdaeb, 0xdaec, 0xdaed, 0xdaee, 0xdaef,
+ 0xdaf0, 0xdaf1, 0xdaf2, 0xdaf3, 0xdaf4, 0xdaf5, 0xdaf6, 0xdaf7,
+ 0xdaf8, 0xdaf9, 0xdafa, 0xdafb, 0xdafc, 0xdafd, 0xdafe, 0xdaff,
+ 0xdb00, 0xdb01, 0xdb02, 0xdb03, 0xdb04, 0xdb05, 0xdb06, 0xdb07,
+ 0xdb08, 0xdb09, 0xdb0a, 0xdb0b, 0xdb0c, 0xdb0d, 0xdb0e, 0xdb0f,
+ 0xdb10, 0xdb11, 0xdb12, 0xdb13, 0xdb14, 0xdb15, 0xdb16, 0xdb17,
+ 0xdb18, 0xdb19, 0xdb1a, 0xdb1b, 0xdb1c, 0xdb1d, 0xdb1e, 0xdb1f,
+ 0xdb20, 0xdb21, 0xdb22, 0xdb23, 0xdb24, 0xdb25, 0xdb26, 0xdb27,
+ 0xdb28, 0xdb29, 0xdb2a, 0xdb2b, 0xdb2c, 0xdb2d, 0xdb2e, 0xdb2f,
+ 0xdb30, 0xdb31, 0xdb32, 0xdb33, 0xdb34, 0xdb35, 0xdb36, 0xdb37,
+ 0xdb38, 0xdb39, 0xdb3a, 0xdb3b, 0xdb3c, 0xdb3d, 0xdb3e, 0xdb3f,
+ 0xdb40, 0xdb41, 0xdb42, 0xdb43, 0xdb44, 0xdb45, 0xdb46, 0xdb47,
+ 0xdb48, 0xdb49, 0xdb4a, 0xdb4b, 0xdb4c, 0xdb4d, 0xdb4e, 0xdb4f,
+ 0xdb50, 0xdb51, 0xdb52, 0xdb53, 0xdb54, 0xdb55, 0xdb56, 0xdb57,
+ 0xdb58, 0xdb59, 0xdb5a, 0xdb5b, 0xdb5c, 0xdb5d, 0xdb5e, 0xdb5f,
+ 0xdb60, 0xdb61, 0xdb62, 0xdb63, 0xdb64, 0xdb65, 0xdb66, 0xdb67,
+ 0xdb68, 0xdb69, 0xdb6a, 0xdb6b, 0xdb6c, 0xdb6d, 0xdb6e, 0xdb6f,
+ 0xdb70, 0xdb71, 0xdb72, 0xdb73, 0xdb74, 0xdb75, 0xdb76, 0xdb77,
+ 0xdb78, 0xdb79, 0xdb7a, 0xdb7b, 0xdb7c, 0xdb7d, 0xdb7e, 0xdb7f,
+ 0xdb80, 0xdb81, 0xdb82, 0xdb83, 0xdb84, 0xdb85, 0xdb86, 0xdb87,
+ 0xdb88, 0xdb89, 0xdb8a, 0xdb8b, 0xdb8c, 0xdb8d, 0xdb8e, 0xdb8f,
+ 0xdb90, 0xdb91, 0xdb92, 0xdb93, 0xdb94, 0xdb95, 0xdb96, 0xdb97,
+ 0xdb98, 0xdb99, 0xdb9a, 0xdb9b, 0xdb9c, 0xdb9d, 0xdb9e, 0xdb9f,
+ 0xdba0, 0xdba1, 0xdba2, 0xdba3, 0xdba4, 0xdba5, 0xdba6, 0xdba7,
+ 0xdba8, 0xdba9, 0xdbaa, 0xdbab, 0xdbac, 0xdbad, 0xdbae, 0xdbaf,
+ 0xdbb0, 0xdbb1, 0xdbb2, 0xdbb3, 0xdbb4, 0xdbb5, 0xdbb6, 0xdbb7,
+ 0xdbb8, 0xdbb9, 0xdbba, 0xdbbb, 0xdbbc, 0xdbbd, 0xdbbe, 0xdbbf,
+ 0xdbc0, 0xdbc1, 0xdbc2, 0xdbc3, 0xdbc4, 0xdbc5, 0xdbc6, 0xdbc7,
+ 0xdbc8, 0xdbc9, 0xdbca, 0xdbcb, 0xdbcc, 0xdbcd, 0xdbce, 0xdbcf,
+ 0xdbd0, 0xdbd1, 0xdbd2, 0xdbd3, 0xdbd4, 0xdbd5, 0xdbd6, 0xdbd7,
+ 0xdbd8, 0xdbd9, 0xdbda, 0xdbdb, 0xdbdc, 0xdbdd, 0xdbde, 0xdbdf,
+ 0xdbe0, 0xdbe1, 0xdbe2, 0xdbe3, 0xdbe4, 0xdbe5, 0xdbe6, 0xdbe7,
+ 0xdbe8, 0xdbe9, 0xdbea, 0xdbeb, 0xdbec, 0xdbed, 0xdbee, 0xdbef,
+ 0xdbf0, 0xdbf1, 0xdbf2, 0xdbf3, 0xdbf4, 0xdbf5, 0xdbf6, 0xdbf7,
+ 0xdbf8, 0xdbf9, 0xdbfa, 0xdbfb, 0xdbfc, 0xdbfd, 0xdbfe, 0xdbff,
+ 0xdc00, 0xdc01, 0xdc02, 0xdc03, 0xdc04, 0xdc05, 0xdc06, 0xdc07,
+ 0xdc08, 0xdc09, 0xdc0a, 0xdc0b, 0xdc0c, 0xdc0d, 0xdc0e, 0xdc0f,
+ 0xdc10, 0xdc11, 0xdc12, 0xdc13, 0xdc14, 0xdc15, 0xdc16, 0xdc17,
+ 0xdc18, 0xdc19, 0xdc1a, 0xdc1b, 0xdc1c, 0xdc1d, 0xdc1e, 0xdc1f,
+ 0xdc20, 0xdc21, 0xdc22, 0xdc23, 0xdc24, 0xdc25, 0xdc26, 0xdc27,
+ 0xdc28, 0xdc29, 0xdc2a, 0xdc2b, 0xdc2c, 0xdc2d, 0xdc2e, 0xdc2f,
+ 0xdc30, 0xdc31, 0xdc32, 0xdc33, 0xdc34, 0xdc35, 0xdc36, 0xdc37,
+ 0xdc38, 0xdc39, 0xdc3a, 0xdc3b, 0xdc3c, 0xdc3d, 0xdc3e, 0xdc3f,
+ 0xdc40, 0xdc41, 0xdc42, 0xdc43, 0xdc44, 0xdc45, 0xdc46, 0xdc47,
+ 0xdc48, 0xdc49, 0xdc4a, 0xdc4b, 0xdc4c, 0xdc4d, 0xdc4e, 0xdc4f,
+ 0xdc50, 0xdc51, 0xdc52, 0xdc53, 0xdc54, 0xdc55, 0xdc56, 0xdc57,
+ 0xdc58, 0xdc59, 0xdc5a, 0xdc5b, 0xdc5c, 0xdc5d, 0xdc5e, 0xdc5f,
+ 0xdc60, 0xdc61, 0xdc62, 0xdc63, 0xdc64, 0xdc65, 0xdc66, 0xdc67,
+ 0xdc68, 0xdc69, 0xdc6a, 0xdc6b, 0xdc6c, 0xdc6d, 0xdc6e, 0xdc6f,
+ 0xdc70, 0xdc71, 0xdc72, 0xdc73, 0xdc74, 0xdc75, 0xdc76, 0xdc77,
+ 0xdc78, 0xdc79, 0xdc7a, 0xdc7b, 0xdc7c, 0xdc7d, 0xdc7e, 0xdc7f,
+ 0xdc80, 0xdc81, 0xdc82, 0xdc83, 0xdc84, 0xdc85, 0xdc86, 0xdc87,
+ 0xdc88, 0xdc89, 0xdc8a, 0xdc8b, 0xdc8c, 0xdc8d, 0xdc8e, 0xdc8f,
+ 0xdc90, 0xdc91, 0xdc92, 0xdc93, 0xdc94, 0xdc95, 0xdc96, 0xdc97,
+ 0xdc98, 0xdc99, 0xdc9a, 0xdc9b, 0xdc9c, 0xdc9d, 0xdc9e, 0xdc9f,
+ 0xdca0, 0xdca1, 0xdca2, 0xdca3, 0xdca4, 0xdca5, 0xdca6, 0xdca7,
+ 0xdca8, 0xdca9, 0xdcaa, 0xdcab, 0xdcac, 0xdcad, 0xdcae, 0xdcaf,
+ 0xdcb0, 0xdcb1, 0xdcb2, 0xdcb3, 0xdcb4, 0xdcb5, 0xdcb6, 0xdcb7,
+ 0xdcb8, 0xdcb9, 0xdcba, 0xdcbb, 0xdcbc, 0xdcbd, 0xdcbe, 0xdcbf,
+ 0xdcc0, 0xdcc1, 0xdcc2, 0xdcc3, 0xdcc4, 0xdcc5, 0xdcc6, 0xdcc7,
+ 0xdcc8, 0xdcc9, 0xdcca, 0xdccb, 0xdccc, 0xdccd, 0xdcce, 0xdccf,
+ 0xdcd0, 0xdcd1, 0xdcd2, 0xdcd3, 0xdcd4, 0xdcd5, 0xdcd6, 0xdcd7,
+ 0xdcd8, 0xdcd9, 0xdcda, 0xdcdb, 0xdcdc, 0xdcdd, 0xdcde, 0xdcdf,
+ 0xdce0, 0xdce1, 0xdce2, 0xdce3, 0xdce4, 0xdce5, 0xdce6, 0xdce7,
+ 0xdce8, 0xdce9, 0xdcea, 0xdceb, 0xdcec, 0xdced, 0xdcee, 0xdcef,
+ 0xdcf0, 0xdcf1, 0xdcf2, 0xdcf3, 0xdcf4, 0xdcf5, 0xdcf6, 0xdcf7,
+ 0xdcf8, 0xdcf9, 0xdcfa, 0xdcfb, 0xdcfc, 0xdcfd, 0xdcfe, 0xdcff,
+ 0xdd00, 0xdd01, 0xdd02, 0xdd03, 0xdd04, 0xdd05, 0xdd06, 0xdd07,
+ 0xdd08, 0xdd09, 0xdd0a, 0xdd0b, 0xdd0c, 0xdd0d, 0xdd0e, 0xdd0f,
+ 0xdd10, 0xdd11, 0xdd12, 0xdd13, 0xdd14, 0xdd15, 0xdd16, 0xdd17,
+ 0xdd18, 0xdd19, 0xdd1a, 0xdd1b, 0xdd1c, 0xdd1d, 0xdd1e, 0xdd1f,
+ 0xdd20, 0xdd21, 0xdd22, 0xdd23, 0xdd24, 0xdd25, 0xdd26, 0xdd27,
+ 0xdd28, 0xdd29, 0xdd2a, 0xdd2b, 0xdd2c, 0xdd2d, 0xdd2e, 0xdd2f,
+ 0xdd30, 0xdd31, 0xdd32, 0xdd33, 0xdd34, 0xdd35, 0xdd36, 0xdd37,
+ 0xdd38, 0xdd39, 0xdd3a, 0xdd3b, 0xdd3c, 0xdd3d, 0xdd3e, 0xdd3f,
+ 0xdd40, 0xdd41, 0xdd42, 0xdd43, 0xdd44, 0xdd45, 0xdd46, 0xdd47,
+ 0xdd48, 0xdd49, 0xdd4a, 0xdd4b, 0xdd4c, 0xdd4d, 0xdd4e, 0xdd4f,
+ 0xdd50, 0xdd51, 0xdd52, 0xdd53, 0xdd54, 0xdd55, 0xdd56, 0xdd57,
+ 0xdd58, 0xdd59, 0xdd5a, 0xdd5b, 0xdd5c, 0xdd5d, 0xdd5e, 0xdd5f,
+ 0xdd60, 0xdd61, 0xdd62, 0xdd63, 0xdd64, 0xdd65, 0xdd66, 0xdd67,
+ 0xdd68, 0xdd69, 0xdd6a, 0xdd6b, 0xdd6c, 0xdd6d, 0xdd6e, 0xdd6f,
+ 0xdd70, 0xdd71, 0xdd72, 0xdd73, 0xdd74, 0xdd75, 0xdd76, 0xdd77,
+ 0xdd78, 0xdd79, 0xdd7a, 0xdd7b, 0xdd7c, 0xdd7d, 0xdd7e, 0xdd7f,
+ 0xdd80, 0xdd81, 0xdd82, 0xdd83, 0xdd84, 0xdd85, 0xdd86, 0xdd87,
+ 0xdd88, 0xdd89, 0xdd8a, 0xdd8b, 0xdd8c, 0xdd8d, 0xdd8e, 0xdd8f,
+ 0xdd90, 0xdd91, 0xdd92, 0xdd93, 0xdd94, 0xdd95, 0xdd96, 0xdd97,
+ 0xdd98, 0xdd99, 0xdd9a, 0xdd9b, 0xdd9c, 0xdd9d, 0xdd9e, 0xdd9f,
+ 0xdda0, 0xdda1, 0xdda2, 0xdda3, 0xdda4, 0xdda5, 0xdda6, 0xdda7,
+ 0xdda8, 0xdda9, 0xddaa, 0xddab, 0xddac, 0xddad, 0xddae, 0xddaf,
+ 0xddb0, 0xddb1, 0xddb2, 0xddb3, 0xddb4, 0xddb5, 0xddb6, 0xddb7,
+ 0xddb8, 0xddb9, 0xddba, 0xddbb, 0xddbc, 0xddbd, 0xddbe, 0xddbf,
+ 0xddc0, 0xddc1, 0xddc2, 0xddc3, 0xddc4, 0xddc5, 0xddc6, 0xddc7,
+ 0xddc8, 0xddc9, 0xddca, 0xddcb, 0xddcc, 0xddcd, 0xddce, 0xddcf,
+ 0xddd0, 0xddd1, 0xddd2, 0xddd3, 0xddd4, 0xddd5, 0xddd6, 0xddd7,
+ 0xddd8, 0xddd9, 0xddda, 0xdddb, 0xdddc, 0xdddd, 0xddde, 0xdddf,
+ 0xdde0, 0xdde1, 0xdde2, 0xdde3, 0xdde4, 0xdde5, 0xdde6, 0xdde7,
+ 0xdde8, 0xdde9, 0xddea, 0xddeb, 0xddec, 0xdded, 0xddee, 0xddef,
+ 0xddf0, 0xddf1, 0xddf2, 0xddf3, 0xddf4, 0xddf5, 0xddf6, 0xddf7,
+ 0xddf8, 0xddf9, 0xddfa, 0xddfb, 0xddfc, 0xddfd, 0xddfe, 0xddff,
+ 0xde00, 0xde01, 0xde02, 0xde03, 0xde04, 0xde05, 0xde06, 0xde07,
+ 0xde08, 0xde09, 0xde0a, 0xde0b, 0xde0c, 0xde0d, 0xde0e, 0xde0f,
+ 0xde10, 0xde11, 0xde12, 0xde13, 0xde14, 0xde15, 0xde16, 0xde17,
+ 0xde18, 0xde19, 0xde1a, 0xde1b, 0xde1c, 0xde1d, 0xde1e, 0xde1f,
+ 0xde20, 0xde21, 0xde22, 0xde23, 0xde24, 0xde25, 0xde26, 0xde27,
+ 0xde28, 0xde29, 0xde2a, 0xde2b, 0xde2c, 0xde2d, 0xde2e, 0xde2f,
+ 0xde30, 0xde31, 0xde32, 0xde33, 0xde34, 0xde35, 0xde36, 0xde37,
+ 0xde38, 0xde39, 0xde3a, 0xde3b, 0xde3c, 0xde3d, 0xde3e, 0xde3f,
+ 0xde40, 0xde41, 0xde42, 0xde43, 0xde44, 0xde45, 0xde46, 0xde47,
+ 0xde48, 0xde49, 0xde4a, 0xde4b, 0xde4c, 0xde4d, 0xde4e, 0xde4f,
+ 0xde50, 0xde51, 0xde52, 0xde53, 0xde54, 0xde55, 0xde56, 0xde57,
+ 0xde58, 0xde59, 0xde5a, 0xde5b, 0xde5c, 0xde5d, 0xde5e, 0xde5f,
+ 0xde60, 0xde61, 0xde62, 0xde63, 0xde64, 0xde65, 0xde66, 0xde67,
+ 0xde68, 0xde69, 0xde6a, 0xde6b, 0xde6c, 0xde6d, 0xde6e, 0xde6f,
+ 0xde70, 0xde71, 0xde72, 0xde73, 0xde74, 0xde75, 0xde76, 0xde77,
+ 0xde78, 0xde79, 0xde7a, 0xde7b, 0xde7c, 0xde7d, 0xde7e, 0xde7f,
+ 0xde80, 0xde81, 0xde82, 0xde83, 0xde84, 0xde85, 0xde86, 0xde87,
+ 0xde88, 0xde89, 0xde8a, 0xde8b, 0xde8c, 0xde8d, 0xde8e, 0xde8f,
+ 0xde90, 0xde91, 0xde92, 0xde93, 0xde94, 0xde95, 0xde96, 0xde97,
+ 0xde98, 0xde99, 0xde9a, 0xde9b, 0xde9c, 0xde9d, 0xde9e, 0xde9f,
+ 0xdea0, 0xdea1, 0xdea2, 0xdea3, 0xdea4, 0xdea5, 0xdea6, 0xdea7,
+ 0xdea8, 0xdea9, 0xdeaa, 0xdeab, 0xdeac, 0xdead, 0xdeae, 0xdeaf,
+ 0xdeb0, 0xdeb1, 0xdeb2, 0xdeb3, 0xdeb4, 0xdeb5, 0xdeb6, 0xdeb7,
+ 0xdeb8, 0xdeb9, 0xdeba, 0xdebb, 0xdebc, 0xdebd, 0xdebe, 0xdebf,
+ 0xdec0, 0xdec1, 0xdec2, 0xdec3, 0xdec4, 0xdec5, 0xdec6, 0xdec7,
+ 0xdec8, 0xdec9, 0xdeca, 0xdecb, 0xdecc, 0xdecd, 0xdece, 0xdecf,
+ 0xded0, 0xded1, 0xded2, 0xded3, 0xded4, 0xded5, 0xded6, 0xded7,
+ 0xded8, 0xded9, 0xdeda, 0xdedb, 0xdedc, 0xdedd, 0xdede, 0xdedf,
+ 0xdee0, 0xdee1, 0xdee2, 0xdee3, 0xdee4, 0xdee5, 0xdee6, 0xdee7,
+ 0xdee8, 0xdee9, 0xdeea, 0xdeeb, 0xdeec, 0xdeed, 0xdeee, 0xdeef,
+ 0xdef0, 0xdef1, 0xdef2, 0xdef3, 0xdef4, 0xdef5, 0xdef6, 0xdef7,
+ 0xdef8, 0xdef9, 0xdefa, 0xdefb, 0xdefc, 0xdefd, 0xdefe, 0xdeff,
+ 0xdf00, 0xdf01, 0xdf02, 0xdf03, 0xdf04, 0xdf05, 0xdf06, 0xdf07,
+ 0xdf08, 0xdf09, 0xdf0a, 0xdf0b, 0xdf0c, 0xdf0d, 0xdf0e, 0xdf0f,
+ 0xdf10, 0xdf11, 0xdf12, 0xdf13, 0xdf14, 0xdf15, 0xdf16, 0xdf17,
+ 0xdf18, 0xdf19, 0xdf1a, 0xdf1b, 0xdf1c, 0xdf1d, 0xdf1e, 0xdf1f,
+ 0xdf20, 0xdf21, 0xdf22, 0xdf23, 0xdf24, 0xdf25, 0xdf26, 0xdf27,
+ 0xdf28, 0xdf29, 0xdf2a, 0xdf2b, 0xdf2c, 0xdf2d, 0xdf2e, 0xdf2f,
+ 0xdf30, 0xdf31, 0xdf32, 0xdf33, 0xdf34, 0xdf35, 0xdf36, 0xdf37,
+ 0xdf38, 0xdf39, 0xdf3a, 0xdf3b, 0xdf3c, 0xdf3d, 0xdf3e, 0xdf3f,
+ 0xdf40, 0xdf41, 0xdf42, 0xdf43, 0xdf44, 0xdf45, 0xdf46, 0xdf47,
+ 0xdf48, 0xdf49, 0xdf4a, 0xdf4b, 0xdf4c, 0xdf4d, 0xdf4e, 0xdf4f,
+ 0xdf50, 0xdf51, 0xdf52, 0xdf53, 0xdf54, 0xdf55, 0xdf56, 0xdf57,
+ 0xdf58, 0xdf59, 0xdf5a, 0xdf5b, 0xdf5c, 0xdf5d, 0xdf5e, 0xdf5f,
+ 0xdf60, 0xdf61, 0xdf62, 0xdf63, 0xdf64, 0xdf65, 0xdf66, 0xdf67,
+ 0xdf68, 0xdf69, 0xdf6a, 0xdf6b, 0xdf6c, 0xdf6d, 0xdf6e, 0xdf6f,
+ 0xdf70, 0xdf71, 0xdf72, 0xdf73, 0xdf74, 0xdf75, 0xdf76, 0xdf77,
+ 0xdf78, 0xdf79, 0xdf7a, 0xdf7b, 0xdf7c, 0xdf7d, 0xdf7e, 0xdf7f,
+ 0xdf80, 0xdf81, 0xdf82, 0xdf83, 0xdf84, 0xdf85, 0xdf86, 0xdf87,
+ 0xdf88, 0xdf89, 0xdf8a, 0xdf8b, 0xdf8c, 0xdf8d, 0xdf8e, 0xdf8f,
+ 0xdf90, 0xdf91, 0xdf92, 0xdf93, 0xdf94, 0xdf95, 0xdf96, 0xdf97,
+ 0xdf98, 0xdf99, 0xdf9a, 0xdf9b, 0xdf9c, 0xdf9d, 0xdf9e, 0xdf9f,
+ 0xdfa0, 0xdfa1, 0xdfa2, 0xdfa3, 0xdfa4, 0xdfa5, 0xdfa6, 0xdfa7,
+ 0xdfa8, 0xdfa9, 0xdfaa, 0xdfab, 0xdfac, 0xdfad, 0xdfae, 0xdfaf,
+ 0xdfb0, 0xdfb1, 0xdfb2, 0xdfb3, 0xdfb4, 0xdfb5, 0xdfb6, 0xdfb7,
+ 0xdfb8, 0xdfb9, 0xdfba, 0xdfbb, 0xdfbc, 0xdfbd, 0xdfbe, 0xdfbf,
+ 0xdfc0, 0xdfc1, 0xdfc2, 0xdfc3, 0xdfc4, 0xdfc5, 0xdfc6, 0xdfc7,
+ 0xdfc8, 0xdfc9, 0xdfca, 0xdfcb, 0xdfcc, 0xdfcd, 0xdfce, 0xdfcf,
+ 0xdfd0, 0xdfd1, 0xdfd2, 0xdfd3, 0xdfd4, 0xdfd5, 0xdfd6, 0xdfd7,
+ 0xdfd8, 0xdfd9, 0xdfda, 0xdfdb, 0xdfdc, 0xdfdd, 0xdfde, 0xdfdf,
+ 0xdfe0, 0xdfe1, 0xdfe2, 0xdfe3, 0xdfe4, 0xdfe5, 0xdfe6, 0xdfe7,
+ 0xdfe8, 0xdfe9, 0xdfea, 0xdfeb, 0xdfec, 0xdfed, 0xdfee, 0xdfef,
+ 0xdff0, 0xdff1, 0xdff2, 0xdff3, 0xdff4, 0xdff5, 0xdff6, 0xdff7,
+ 0xdff8, 0xdff9, 0xdffa, 0xdffb, 0xdffc, 0xdffd, 0xdffe, 0xdfff,
+ 0xe000, 0xe001, 0xe002, 0xe003, 0xe004, 0xe005, 0xe006, 0xe007,
+ 0xe008, 0xe009, 0xe00a, 0xe00b, 0xe00c, 0xe00d, 0xe00e, 0xe00f,
+ 0xe010, 0xe011, 0xe012, 0xe013, 0xe014, 0xe015, 0xe016, 0xe017,
+ 0xe018, 0xe019, 0xe01a, 0xe01b, 0xe01c, 0xe01d, 0xe01e, 0xe01f,
+ 0xe020, 0xe021, 0xe022, 0xe023, 0xe024, 0xe025, 0xe026, 0xe027,
+ 0xe028, 0xe029, 0xe02a, 0xe02b, 0xe02c, 0xe02d, 0xe02e, 0xe02f,
+ 0xe030, 0xe031, 0xe032, 0xe033, 0xe034, 0xe035, 0xe036, 0xe037,
+ 0xe038, 0xe039, 0xe03a, 0xe03b, 0xe03c, 0xe03d, 0xe03e, 0xe03f,
+ 0xe040, 0xe041, 0xe042, 0xe043, 0xe044, 0xe045, 0xe046, 0xe047,
+ 0xe048, 0xe049, 0xe04a, 0xe04b, 0xe04c, 0xe04d, 0xe04e, 0xe04f,
+ 0xe050, 0xe051, 0xe052, 0xe053, 0xe054, 0xe055, 0xe056, 0xe057,
+ 0xe058, 0xe059, 0xe05a, 0xe05b, 0xe05c, 0xe05d, 0xe05e, 0xe05f,
+ 0xe060, 0xe061, 0xe062, 0xe063, 0xe064, 0xe065, 0xe066, 0xe067,
+ 0xe068, 0xe069, 0xe06a, 0xe06b, 0xe06c, 0xe06d, 0xe06e, 0xe06f,
+ 0xe070, 0xe071, 0xe072, 0xe073, 0xe074, 0xe075, 0xe076, 0xe077,
+ 0xe078, 0xe079, 0xe07a, 0xe07b, 0xe07c, 0xe07d, 0xe07e, 0xe07f,
+ 0xe080, 0xe081, 0xe082, 0xe083, 0xe084, 0xe085, 0xe086, 0xe087,
+ 0xe088, 0xe089, 0xe08a, 0xe08b, 0xe08c, 0xe08d, 0xe08e, 0xe08f,
+ 0xe090, 0xe091, 0xe092, 0xe093, 0xe094, 0xe095, 0xe096, 0xe097,
+ 0xe098, 0xe099, 0xe09a, 0xe09b, 0xe09c, 0xe09d, 0xe09e, 0xe09f,
+ 0xe0a0, 0xe0a1, 0xe0a2, 0xe0a3, 0xe0a4, 0xe0a5, 0xe0a6, 0xe0a7,
+ 0xe0a8, 0xe0a9, 0xe0aa, 0xe0ab, 0xe0ac, 0xe0ad, 0xe0ae, 0xe0af,
+ 0xe0b0, 0xe0b1, 0xe0b2, 0xe0b3, 0xe0b4, 0xe0b5, 0xe0b6, 0xe0b7,
+ 0xe0b8, 0xe0b9, 0xe0ba, 0xe0bb, 0xe0bc, 0xe0bd, 0xe0be, 0xe0bf,
+ 0xe0c0, 0xe0c1, 0xe0c2, 0xe0c3, 0xe0c4, 0xe0c5, 0xe0c6, 0xe0c7,
+ 0xe0c8, 0xe0c9, 0xe0ca, 0xe0cb, 0xe0cc, 0xe0cd, 0xe0ce, 0xe0cf,
+ 0xe0d0, 0xe0d1, 0xe0d2, 0xe0d3, 0xe0d4, 0xe0d5, 0xe0d6, 0xe0d7,
+ 0xe0d8, 0xe0d9, 0xe0da, 0xe0db, 0xe0dc, 0xe0dd, 0xe0de, 0xe0df,
+ 0xe0e0, 0xe0e1, 0xe0e2, 0xe0e3, 0xe0e4, 0xe0e5, 0xe0e6, 0xe0e7,
+ 0xe0e8, 0xe0e9, 0xe0ea, 0xe0eb, 0xe0ec, 0xe0ed, 0xe0ee, 0xe0ef,
+ 0xe0f0, 0xe0f1, 0xe0f2, 0xe0f3, 0xe0f4, 0xe0f5, 0xe0f6, 0xe0f7,
+ 0xe0f8, 0xe0f9, 0xe0fa, 0xe0fb, 0xe0fc, 0xe0fd, 0xe0fe, 0xe0ff,
+ 0xe100, 0xe101, 0xe102, 0xe103, 0xe104, 0xe105, 0xe106, 0xe107,
+ 0xe108, 0xe109, 0xe10a, 0xe10b, 0xe10c, 0xe10d, 0xe10e, 0xe10f,
+ 0xe110, 0xe111, 0xe112, 0xe113, 0xe114, 0xe115, 0xe116, 0xe117,
+ 0xe118, 0xe119, 0xe11a, 0xe11b, 0xe11c, 0xe11d, 0xe11e, 0xe11f,
+ 0xe120, 0xe121, 0xe122, 0xe123, 0xe124, 0xe125, 0xe126, 0xe127,
+ 0xe128, 0xe129, 0xe12a, 0xe12b, 0xe12c, 0xe12d, 0xe12e, 0xe12f,
+ 0xe130, 0xe131, 0xe132, 0xe133, 0xe134, 0xe135, 0xe136, 0xe137,
+ 0xe138, 0xe139, 0xe13a, 0xe13b, 0xe13c, 0xe13d, 0xe13e, 0xe13f,
+ 0xe140, 0xe141, 0xe142, 0xe143, 0xe144, 0xe145, 0xe146, 0xe147,
+ 0xe148, 0xe149, 0xe14a, 0xe14b, 0xe14c, 0xe14d, 0xe14e, 0xe14f,
+ 0xe150, 0xe151, 0xe152, 0xe153, 0xe154, 0xe155, 0xe156, 0xe157,
+ 0xe158, 0xe159, 0xe15a, 0xe15b, 0xe15c, 0xe15d, 0xe15e, 0xe15f,
+ 0xe160, 0xe161, 0xe162, 0xe163, 0xe164, 0xe165, 0xe166, 0xe167,
+ 0xe168, 0xe169, 0xe16a, 0xe16b, 0xe16c, 0xe16d, 0xe16e, 0xe16f,
+ 0xe170, 0xe171, 0xe172, 0xe173, 0xe174, 0xe175, 0xe176, 0xe177,
+ 0xe178, 0xe179, 0xe17a, 0xe17b, 0xe17c, 0xe17d, 0xe17e, 0xe17f,
+ 0xe180, 0xe181, 0xe182, 0xe183, 0xe184, 0xe185, 0xe186, 0xe187,
+ 0xe188, 0xe189, 0xe18a, 0xe18b, 0xe18c, 0xe18d, 0xe18e, 0xe18f,
+ 0xe190, 0xe191, 0xe192, 0xe193, 0xe194, 0xe195, 0xe196, 0xe197,
+ 0xe198, 0xe199, 0xe19a, 0xe19b, 0xe19c, 0xe19d, 0xe19e, 0xe19f,
+ 0xe1a0, 0xe1a1, 0xe1a2, 0xe1a3, 0xe1a4, 0xe1a5, 0xe1a6, 0xe1a7,
+ 0xe1a8, 0xe1a9, 0xe1aa, 0xe1ab, 0xe1ac, 0xe1ad, 0xe1ae, 0xe1af,
+ 0xe1b0, 0xe1b1, 0xe1b2, 0xe1b3, 0xe1b4, 0xe1b5, 0xe1b6, 0xe1b7,
+ 0xe1b8, 0xe1b9, 0xe1ba, 0xe1bb, 0xe1bc, 0xe1bd, 0xe1be, 0xe1bf,
+ 0xe1c0, 0xe1c1, 0xe1c2, 0xe1c3, 0xe1c4, 0xe1c5, 0xe1c6, 0xe1c7,
+ 0xe1c8, 0xe1c9, 0xe1ca, 0xe1cb, 0xe1cc, 0xe1cd, 0xe1ce, 0xe1cf,
+ 0xe1d0, 0xe1d1, 0xe1d2, 0xe1d3, 0xe1d4, 0xe1d5, 0xe1d6, 0xe1d7,
+ 0xe1d8, 0xe1d9, 0xe1da, 0xe1db, 0xe1dc, 0xe1dd, 0xe1de, 0xe1df,
+ 0xe1e0, 0xe1e1, 0xe1e2, 0xe1e3, 0xe1e4, 0xe1e5, 0xe1e6, 0xe1e7,
+ 0xe1e8, 0xe1e9, 0xe1ea, 0xe1eb, 0xe1ec, 0xe1ed, 0xe1ee, 0xe1ef,
+ 0xe1f0, 0xe1f1, 0xe1f2, 0xe1f3, 0xe1f4, 0xe1f5, 0xe1f6, 0xe1f7,
+ 0xe1f8, 0xe1f9, 0xe1fa, 0xe1fb, 0xe1fc, 0xe1fd, 0xe1fe, 0xe1ff,
+ 0xe200, 0xe201, 0xe202, 0xe203, 0xe204, 0xe205, 0xe206, 0xe207,
+ 0xe208, 0xe209, 0xe20a, 0xe20b, 0xe20c, 0xe20d, 0xe20e, 0xe20f,
+ 0xe210, 0xe211, 0xe212, 0xe213, 0xe214, 0xe215, 0xe216, 0xe217,
+ 0xe218, 0xe219, 0xe21a, 0xe21b, 0xe21c, 0xe21d, 0xe21e, 0xe21f,
+ 0xe220, 0xe221, 0xe222, 0xe223, 0xe224, 0xe225, 0xe226, 0xe227,
+ 0xe228, 0xe229, 0xe22a, 0xe22b, 0xe22c, 0xe22d, 0xe22e, 0xe22f,
+ 0xe230, 0xe231, 0xe232, 0xe233, 0xe234, 0xe235, 0xe236, 0xe237,
+ 0xe238, 0xe239, 0xe23a, 0xe23b, 0xe23c, 0xe23d, 0xe23e, 0xe23f,
+ 0xe240, 0xe241, 0xe242, 0xe243, 0xe244, 0xe245, 0xe246, 0xe247,
+ 0xe248, 0xe249, 0xe24a, 0xe24b, 0xe24c, 0xe24d, 0xe24e, 0xe24f,
+ 0xe250, 0xe251, 0xe252, 0xe253, 0xe254, 0xe255, 0xe256, 0xe257,
+ 0xe258, 0xe259, 0xe25a, 0xe25b, 0xe25c, 0xe25d, 0xe25e, 0xe25f,
+ 0xe260, 0xe261, 0xe262, 0xe263, 0xe264, 0xe265, 0xe266, 0xe267,
+ 0xe268, 0xe269, 0xe26a, 0xe26b, 0xe26c, 0xe26d, 0xe26e, 0xe26f,
+ 0xe270, 0xe271, 0xe272, 0xe273, 0xe274, 0xe275, 0xe276, 0xe277,
+ 0xe278, 0xe279, 0xe27a, 0xe27b, 0xe27c, 0xe27d, 0xe27e, 0xe27f,
+ 0xe280, 0xe281, 0xe282, 0xe283, 0xe284, 0xe285, 0xe286, 0xe287,
+ 0xe288, 0xe289, 0xe28a, 0xe28b, 0xe28c, 0xe28d, 0xe28e, 0xe28f,
+ 0xe290, 0xe291, 0xe292, 0xe293, 0xe294, 0xe295, 0xe296, 0xe297,
+ 0xe298, 0xe299, 0xe29a, 0xe29b, 0xe29c, 0xe29d, 0xe29e, 0xe29f,
+ 0xe2a0, 0xe2a1, 0xe2a2, 0xe2a3, 0xe2a4, 0xe2a5, 0xe2a6, 0xe2a7,
+ 0xe2a8, 0xe2a9, 0xe2aa, 0xe2ab, 0xe2ac, 0xe2ad, 0xe2ae, 0xe2af,
+ 0xe2b0, 0xe2b1, 0xe2b2, 0xe2b3, 0xe2b4, 0xe2b5, 0xe2b6, 0xe2b7,
+ 0xe2b8, 0xe2b9, 0xe2ba, 0xe2bb, 0xe2bc, 0xe2bd, 0xe2be, 0xe2bf,
+ 0xe2c0, 0xe2c1, 0xe2c2, 0xe2c3, 0xe2c4, 0xe2c5, 0xe2c6, 0xe2c7,
+ 0xe2c8, 0xe2c9, 0xe2ca, 0xe2cb, 0xe2cc, 0xe2cd, 0xe2ce, 0xe2cf,
+ 0xe2d0, 0xe2d1, 0xe2d2, 0xe2d3, 0xe2d4, 0xe2d5, 0xe2d6, 0xe2d7,
+ 0xe2d8, 0xe2d9, 0xe2da, 0xe2db, 0xe2dc, 0xe2dd, 0xe2de, 0xe2df,
+ 0xe2e0, 0xe2e1, 0xe2e2, 0xe2e3, 0xe2e4, 0xe2e5, 0xe2e6, 0xe2e7,
+ 0xe2e8, 0xe2e9, 0xe2ea, 0xe2eb, 0xe2ec, 0xe2ed, 0xe2ee, 0xe2ef,
+ 0xe2f0, 0xe2f1, 0xe2f2, 0xe2f3, 0xe2f4, 0xe2f5, 0xe2f6, 0xe2f7,
+ 0xe2f8, 0xe2f9, 0xe2fa, 0xe2fb, 0xe2fc, 0xe2fd, 0xe2fe, 0xe2ff,
+ 0xe300, 0xe301, 0xe302, 0xe303, 0xe304, 0xe305, 0xe306, 0xe307,
+ 0xe308, 0xe309, 0xe30a, 0xe30b, 0xe30c, 0xe30d, 0xe30e, 0xe30f,
+ 0xe310, 0xe311, 0xe312, 0xe313, 0xe314, 0xe315, 0xe316, 0xe317,
+ 0xe318, 0xe319, 0xe31a, 0xe31b, 0xe31c, 0xe31d, 0xe31e, 0xe31f,
+ 0xe320, 0xe321, 0xe322, 0xe323, 0xe324, 0xe325, 0xe326, 0xe327,
+ 0xe328, 0xe329, 0xe32a, 0xe32b, 0xe32c, 0xe32d, 0xe32e, 0xe32f,
+ 0xe330, 0xe331, 0xe332, 0xe333, 0xe334, 0xe335, 0xe336, 0xe337,
+ 0xe338, 0xe339, 0xe33a, 0xe33b, 0xe33c, 0xe33d, 0xe33e, 0xe33f,
+ 0xe340, 0xe341, 0xe342, 0xe343, 0xe344, 0xe345, 0xe346, 0xe347,
+ 0xe348, 0xe349, 0xe34a, 0xe34b, 0xe34c, 0xe34d, 0xe34e, 0xe34f,
+ 0xe350, 0xe351, 0xe352, 0xe353, 0xe354, 0xe355, 0xe356, 0xe357,
+ 0xe358, 0xe359, 0xe35a, 0xe35b, 0xe35c, 0xe35d, 0xe35e, 0xe35f,
+ 0xe360, 0xe361, 0xe362, 0xe363, 0xe364, 0xe365, 0xe366, 0xe367,
+ 0xe368, 0xe369, 0xe36a, 0xe36b, 0xe36c, 0xe36d, 0xe36e, 0xe36f,
+ 0xe370, 0xe371, 0xe372, 0xe373, 0xe374, 0xe375, 0xe376, 0xe377,
+ 0xe378, 0xe379, 0xe37a, 0xe37b, 0xe37c, 0xe37d, 0xe37e, 0xe37f,
+ 0xe380, 0xe381, 0xe382, 0xe383, 0xe384, 0xe385, 0xe386, 0xe387,
+ 0xe388, 0xe389, 0xe38a, 0xe38b, 0xe38c, 0xe38d, 0xe38e, 0xe38f,
+ 0xe390, 0xe391, 0xe392, 0xe393, 0xe394, 0xe395, 0xe396, 0xe397,
+ 0xe398, 0xe399, 0xe39a, 0xe39b, 0xe39c, 0xe39d, 0xe39e, 0xe39f,
+ 0xe3a0, 0xe3a1, 0xe3a2, 0xe3a3, 0xe3a4, 0xe3a5, 0xe3a6, 0xe3a7,
+ 0xe3a8, 0xe3a9, 0xe3aa, 0xe3ab, 0xe3ac, 0xe3ad, 0xe3ae, 0xe3af,
+ 0xe3b0, 0xe3b1, 0xe3b2, 0xe3b3, 0xe3b4, 0xe3b5, 0xe3b6, 0xe3b7,
+ 0xe3b8, 0xe3b9, 0xe3ba, 0xe3bb, 0xe3bc, 0xe3bd, 0xe3be, 0xe3bf,
+ 0xe3c0, 0xe3c1, 0xe3c2, 0xe3c3, 0xe3c4, 0xe3c5, 0xe3c6, 0xe3c7,
+ 0xe3c8, 0xe3c9, 0xe3ca, 0xe3cb, 0xe3cc, 0xe3cd, 0xe3ce, 0xe3cf,
+ 0xe3d0, 0xe3d1, 0xe3d2, 0xe3d3, 0xe3d4, 0xe3d5, 0xe3d6, 0xe3d7,
+ 0xe3d8, 0xe3d9, 0xe3da, 0xe3db, 0xe3dc, 0xe3dd, 0xe3de, 0xe3df,
+ 0xe3e0, 0xe3e1, 0xe3e2, 0xe3e3, 0xe3e4, 0xe3e5, 0xe3e6, 0xe3e7,
+ 0xe3e8, 0xe3e9, 0xe3ea, 0xe3eb, 0xe3ec, 0xe3ed, 0xe3ee, 0xe3ef,
+ 0xe3f0, 0xe3f1, 0xe3f2, 0xe3f3, 0xe3f4, 0xe3f5, 0xe3f6, 0xe3f7,
+ 0xe3f8, 0xe3f9, 0xe3fa, 0xe3fb, 0xe3fc, 0xe3fd, 0xe3fe, 0xe3ff,
+ 0xe400, 0xe401, 0xe402, 0xe403, 0xe404, 0xe405, 0xe406, 0xe407,
+ 0xe408, 0xe409, 0xe40a, 0xe40b, 0xe40c, 0xe40d, 0xe40e, 0xe40f,
+ 0xe410, 0xe411, 0xe412, 0xe413, 0xe414, 0xe415, 0xe416, 0xe417,
+ 0xe418, 0xe419, 0xe41a, 0xe41b, 0xe41c, 0xe41d, 0xe41e, 0xe41f,
+ 0xe420, 0xe421, 0xe422, 0xe423, 0xe424, 0xe425, 0xe426, 0xe427,
+ 0xe428, 0xe429, 0xe42a, 0xe42b, 0xe42c, 0xe42d, 0xe42e, 0xe42f,
+ 0xe430, 0xe431, 0xe432, 0xe433, 0xe434, 0xe435, 0xe436, 0xe437,
+ 0xe438, 0xe439, 0xe43a, 0xe43b, 0xe43c, 0xe43d, 0xe43e, 0xe43f,
+ 0xe440, 0xe441, 0xe442, 0xe443, 0xe444, 0xe445, 0xe446, 0xe447,
+ 0xe448, 0xe449, 0xe44a, 0xe44b, 0xe44c, 0xe44d, 0xe44e, 0xe44f,
+ 0xe450, 0xe451, 0xe452, 0xe453, 0xe454, 0xe455, 0xe456, 0xe457,
+ 0xe458, 0xe459, 0xe45a, 0xe45b, 0xe45c, 0xe45d, 0xe45e, 0xe45f,
+ 0xe460, 0xe461, 0xe462, 0xe463, 0xe464, 0xe465, 0xe466, 0xe467,
+ 0xe468, 0xe469, 0xe46a, 0xe46b, 0xe46c, 0xe46d, 0xe46e, 0xe46f,
+ 0xe470, 0xe471, 0xe472, 0xe473, 0xe474, 0xe475, 0xe476, 0xe477,
+ 0xe478, 0xe479, 0xe47a, 0xe47b, 0xe47c, 0xe47d, 0xe47e, 0xe47f,
+ 0xe480, 0xe481, 0xe482, 0xe483, 0xe484, 0xe485, 0xe486, 0xe487,
+ 0xe488, 0xe489, 0xe48a, 0xe48b, 0xe48c, 0xe48d, 0xe48e, 0xe48f,
+ 0xe490, 0xe491, 0xe492, 0xe493, 0xe494, 0xe495, 0xe496, 0xe497,
+ 0xe498, 0xe499, 0xe49a, 0xe49b, 0xe49c, 0xe49d, 0xe49e, 0xe49f,
+ 0xe4a0, 0xe4a1, 0xe4a2, 0xe4a3, 0xe4a4, 0xe4a5, 0xe4a6, 0xe4a7,
+ 0xe4a8, 0xe4a9, 0xe4aa, 0xe4ab, 0xe4ac, 0xe4ad, 0xe4ae, 0xe4af,
+ 0xe4b0, 0xe4b1, 0xe4b2, 0xe4b3, 0xe4b4, 0xe4b5, 0xe4b6, 0xe4b7,
+ 0xe4b8, 0xe4b9, 0xe4ba, 0xe4bb, 0xe4bc, 0xe4bd, 0xe4be, 0xe4bf,
+ 0xe4c0, 0xe4c1, 0xe4c2, 0xe4c3, 0xe4c4, 0xe4c5, 0xe4c6, 0xe4c7,
+ 0xe4c8, 0xe4c9, 0xe4ca, 0xe4cb, 0xe4cc, 0xe4cd, 0xe4ce, 0xe4cf,
+ 0xe4d0, 0xe4d1, 0xe4d2, 0xe4d3, 0xe4d4, 0xe4d5, 0xe4d6, 0xe4d7,
+ 0xe4d8, 0xe4d9, 0xe4da, 0xe4db, 0xe4dc, 0xe4dd, 0xe4de, 0xe4df,
+ 0xe4e0, 0xe4e1, 0xe4e2, 0xe4e3, 0xe4e4, 0xe4e5, 0xe4e6, 0xe4e7,
+ 0xe4e8, 0xe4e9, 0xe4ea, 0xe4eb, 0xe4ec, 0xe4ed, 0xe4ee, 0xe4ef,
+ 0xe4f0, 0xe4f1, 0xe4f2, 0xe4f3, 0xe4f4, 0xe4f5, 0xe4f6, 0xe4f7,
+ 0xe4f8, 0xe4f9, 0xe4fa, 0xe4fb, 0xe4fc, 0xe4fd, 0xe4fe, 0xe4ff,
+ 0xe500, 0xe501, 0xe502, 0xe503, 0xe504, 0xe505, 0xe506, 0xe507,
+ 0xe508, 0xe509, 0xe50a, 0xe50b, 0xe50c, 0xe50d, 0xe50e, 0xe50f,
+ 0xe510, 0xe511, 0xe512, 0xe513, 0xe514, 0xe515, 0xe516, 0xe517,
+ 0xe518, 0xe519, 0xe51a, 0xe51b, 0xe51c, 0xe51d, 0xe51e, 0xe51f,
+ 0xe520, 0xe521, 0xe522, 0xe523, 0xe524, 0xe525, 0xe526, 0xe527,
+ 0xe528, 0xe529, 0xe52a, 0xe52b, 0xe52c, 0xe52d, 0xe52e, 0xe52f,
+ 0xe530, 0xe531, 0xe532, 0xe533, 0xe534, 0xe535, 0xe536, 0xe537,
+ 0xe538, 0xe539, 0xe53a, 0xe53b, 0xe53c, 0xe53d, 0xe53e, 0xe53f,
+ 0xe540, 0xe541, 0xe542, 0xe543, 0xe544, 0xe545, 0xe546, 0xe547,
+ 0xe548, 0xe549, 0xe54a, 0xe54b, 0xe54c, 0xe54d, 0xe54e, 0xe54f,
+ 0xe550, 0xe551, 0xe552, 0xe553, 0xe554, 0xe555, 0xe556, 0xe557,
+ 0xe558, 0xe559, 0xe55a, 0xe55b, 0xe55c, 0xe55d, 0xe55e, 0xe55f,
+ 0xe560, 0xe561, 0xe562, 0xe563, 0xe564, 0xe565, 0xe566, 0xe567,
+ 0xe568, 0xe569, 0xe56a, 0xe56b, 0xe56c, 0xe56d, 0xe56e, 0xe56f,
+ 0xe570, 0xe571, 0xe572, 0xe573, 0xe574, 0xe575, 0xe576, 0xe577,
+ 0xe578, 0xe579, 0xe57a, 0xe57b, 0xe57c, 0xe57d, 0xe57e, 0xe57f,
+ 0xe580, 0xe581, 0xe582, 0xe583, 0xe584, 0xe585, 0xe586, 0xe587,
+ 0xe588, 0xe589, 0xe58a, 0xe58b, 0xe58c, 0xe58d, 0xe58e, 0xe58f,
+ 0xe590, 0xe591, 0xe592, 0xe593, 0xe594, 0xe595, 0xe596, 0xe597,
+ 0xe598, 0xe599, 0xe59a, 0xe59b, 0xe59c, 0xe59d, 0xe59e, 0xe59f,
+ 0xe5a0, 0xe5a1, 0xe5a2, 0xe5a3, 0xe5a4, 0xe5a5, 0xe5a6, 0xe5a7,
+ 0xe5a8, 0xe5a9, 0xe5aa, 0xe5ab, 0xe5ac, 0xe5ad, 0xe5ae, 0xe5af,
+ 0xe5b0, 0xe5b1, 0xe5b2, 0xe5b3, 0xe5b4, 0xe5b5, 0xe5b6, 0xe5b7,
+ 0xe5b8, 0xe5b9, 0xe5ba, 0xe5bb, 0xe5bc, 0xe5bd, 0xe5be, 0xe5bf,
+ 0xe5c0, 0xe5c1, 0xe5c2, 0xe5c3, 0xe5c4, 0xe5c5, 0xe5c6, 0xe5c7,
+ 0xe5c8, 0xe5c9, 0xe5ca, 0xe5cb, 0xe5cc, 0xe5cd, 0xe5ce, 0xe5cf,
+ 0xe5d0, 0xe5d1, 0xe5d2, 0xe5d3, 0xe5d4, 0xe5d5, 0xe5d6, 0xe5d7,
+ 0xe5d8, 0xe5d9, 0xe5da, 0xe5db, 0xe5dc, 0xe5dd, 0xe5de, 0xe5df,
+ 0xe5e0, 0xe5e1, 0xe5e2, 0xe5e3, 0xe5e4, 0xe5e5, 0xe5e6, 0xe5e7,
+ 0xe5e8, 0xe5e9, 0xe5ea, 0xe5eb, 0xe5ec, 0xe5ed, 0xe5ee, 0xe5ef,
+ 0xe5f0, 0xe5f1, 0xe5f2, 0xe5f3, 0xe5f4, 0xe5f5, 0xe5f6, 0xe5f7,
+ 0xe5f8, 0xe5f9, 0xe5fa, 0xe5fb, 0xe5fc, 0xe5fd, 0xe5fe, 0xe5ff,
+ 0xe600, 0xe601, 0xe602, 0xe603, 0xe604, 0xe605, 0xe606, 0xe607,
+ 0xe608, 0xe609, 0xe60a, 0xe60b, 0xe60c, 0xe60d, 0xe60e, 0xe60f,
+ 0xe610, 0xe611, 0xe612, 0xe613, 0xe614, 0xe615, 0xe616, 0xe617,
+ 0xe618, 0xe619, 0xe61a, 0xe61b, 0xe61c, 0xe61d, 0xe61e, 0xe61f,
+ 0xe620, 0xe621, 0xe622, 0xe623, 0xe624, 0xe625, 0xe626, 0xe627,
+ 0xe628, 0xe629, 0xe62a, 0xe62b, 0xe62c, 0xe62d, 0xe62e, 0xe62f,
+ 0xe630, 0xe631, 0xe632, 0xe633, 0xe634, 0xe635, 0xe636, 0xe637,
+ 0xe638, 0xe639, 0xe63a, 0xe63b, 0xe63c, 0xe63d, 0xe63e, 0xe63f,
+ 0xe640, 0xe641, 0xe642, 0xe643, 0xe644, 0xe645, 0xe646, 0xe647,
+ 0xe648, 0xe649, 0xe64a, 0xe64b, 0xe64c, 0xe64d, 0xe64e, 0xe64f,
+ 0xe650, 0xe651, 0xe652, 0xe653, 0xe654, 0xe655, 0xe656, 0xe657,
+ 0xe658, 0xe659, 0xe65a, 0xe65b, 0xe65c, 0xe65d, 0xe65e, 0xe65f,
+ 0xe660, 0xe661, 0xe662, 0xe663, 0xe664, 0xe665, 0xe666, 0xe667,
+ 0xe668, 0xe669, 0xe66a, 0xe66b, 0xe66c, 0xe66d, 0xe66e, 0xe66f,
+ 0xe670, 0xe671, 0xe672, 0xe673, 0xe674, 0xe675, 0xe676, 0xe677,
+ 0xe678, 0xe679, 0xe67a, 0xe67b, 0xe67c, 0xe67d, 0xe67e, 0xe67f,
+ 0xe680, 0xe681, 0xe682, 0xe683, 0xe684, 0xe685, 0xe686, 0xe687,
+ 0xe688, 0xe689, 0xe68a, 0xe68b, 0xe68c, 0xe68d, 0xe68e, 0xe68f,
+ 0xe690, 0xe691, 0xe692, 0xe693, 0xe694, 0xe695, 0xe696, 0xe697,
+ 0xe698, 0xe699, 0xe69a, 0xe69b, 0xe69c, 0xe69d, 0xe69e, 0xe69f,
+ 0xe6a0, 0xe6a1, 0xe6a2, 0xe6a3, 0xe6a4, 0xe6a5, 0xe6a6, 0xe6a7,
+ 0xe6a8, 0xe6a9, 0xe6aa, 0xe6ab, 0xe6ac, 0xe6ad, 0xe6ae, 0xe6af,
+ 0xe6b0, 0xe6b1, 0xe6b2, 0xe6b3, 0xe6b4, 0xe6b5, 0xe6b6, 0xe6b7,
+ 0xe6b8, 0xe6b9, 0xe6ba, 0xe6bb, 0xe6bc, 0xe6bd, 0xe6be, 0xe6bf,
+ 0xe6c0, 0xe6c1, 0xe6c2, 0xe6c3, 0xe6c4, 0xe6c5, 0xe6c6, 0xe6c7,
+ 0xe6c8, 0xe6c9, 0xe6ca, 0xe6cb, 0xe6cc, 0xe6cd, 0xe6ce, 0xe6cf,
+ 0xe6d0, 0xe6d1, 0xe6d2, 0xe6d3, 0xe6d4, 0xe6d5, 0xe6d6, 0xe6d7,
+ 0xe6d8, 0xe6d9, 0xe6da, 0xe6db, 0xe6dc, 0xe6dd, 0xe6de, 0xe6df,
+ 0xe6e0, 0xe6e1, 0xe6e2, 0xe6e3, 0xe6e4, 0xe6e5, 0xe6e6, 0xe6e7,
+ 0xe6e8, 0xe6e9, 0xe6ea, 0xe6eb, 0xe6ec, 0xe6ed, 0xe6ee, 0xe6ef,
+ 0xe6f0, 0xe6f1, 0xe6f2, 0xe6f3, 0xe6f4, 0xe6f5, 0xe6f6, 0xe6f7,
+ 0xe6f8, 0xe6f9, 0xe6fa, 0xe6fb, 0xe6fc, 0xe6fd, 0xe6fe, 0xe6ff,
+ 0xe700, 0xe701, 0xe702, 0xe703, 0xe704, 0xe705, 0xe706, 0xe707,
+ 0xe708, 0xe709, 0xe70a, 0xe70b, 0xe70c, 0xe70d, 0xe70e, 0xe70f,
+ 0xe710, 0xe711, 0xe712, 0xe713, 0xe714, 0xe715, 0xe716, 0xe717,
+ 0xe718, 0xe719, 0xe71a, 0xe71b, 0xe71c, 0xe71d, 0xe71e, 0xe71f,
+ 0xe720, 0xe721, 0xe722, 0xe723, 0xe724, 0xe725, 0xe726, 0xe727,
+ 0xe728, 0xe729, 0xe72a, 0xe72b, 0xe72c, 0xe72d, 0xe72e, 0xe72f,
+ 0xe730, 0xe731, 0xe732, 0xe733, 0xe734, 0xe735, 0xe736, 0xe737,
+ 0xe738, 0xe739, 0xe73a, 0xe73b, 0xe73c, 0xe73d, 0xe73e, 0xe73f,
+ 0xe740, 0xe741, 0xe742, 0xe743, 0xe744, 0xe745, 0xe746, 0xe747,
+ 0xe748, 0xe749, 0xe74a, 0xe74b, 0xe74c, 0xe74d, 0xe74e, 0xe74f,
+ 0xe750, 0xe751, 0xe752, 0xe753, 0xe754, 0xe755, 0xe756, 0xe757,
+ 0xe758, 0xe759, 0xe75a, 0xe75b, 0xe75c, 0xe75d, 0xe75e, 0xe75f,
+ 0xe760, 0xe761, 0xe762, 0xe763, 0xe764, 0xe765, 0xe766, 0xe767,
+ 0xe768, 0xe769, 0xe76a, 0xe76b, 0xe76c, 0xe76d, 0xe76e, 0xe76f,
+ 0xe770, 0xe771, 0xe772, 0xe773, 0xe774, 0xe775, 0xe776, 0xe777,
+ 0xe778, 0xe779, 0xe77a, 0xe77b, 0xe77c, 0xe77d, 0xe77e, 0xe77f,
+ 0xe780, 0xe781, 0xe782, 0xe783, 0xe784, 0xe785, 0xe786, 0xe787,
+ 0xe788, 0xe789, 0xe78a, 0xe78b, 0xe78c, 0xe78d, 0xe78e, 0xe78f,
+ 0xe790, 0xe791, 0xe792, 0xe793, 0xe794, 0xe795, 0xe796, 0xe797,
+ 0xe798, 0xe799, 0xe79a, 0xe79b, 0xe79c, 0xe79d, 0xe79e, 0xe79f,
+ 0xe7a0, 0xe7a1, 0xe7a2, 0xe7a3, 0xe7a4, 0xe7a5, 0xe7a6, 0xe7a7,
+ 0xe7a8, 0xe7a9, 0xe7aa, 0xe7ab, 0xe7ac, 0xe7ad, 0xe7ae, 0xe7af,
+ 0xe7b0, 0xe7b1, 0xe7b2, 0xe7b3, 0xe7b4, 0xe7b5, 0xe7b6, 0xe7b7,
+ 0xe7b8, 0xe7b9, 0xe7ba, 0xe7bb, 0xe7bc, 0xe7bd, 0xe7be, 0xe7bf,
+ 0xe7c0, 0xe7c1, 0xe7c2, 0xe7c3, 0xe7c4, 0xe7c5, 0xe7c6, 0xe7c7,
+ 0xe7c8, 0xe7c9, 0xe7ca, 0xe7cb, 0xe7cc, 0xe7cd, 0xe7ce, 0xe7cf,
+ 0xe7d0, 0xe7d1, 0xe7d2, 0xe7d3, 0xe7d4, 0xe7d5, 0xe7d6, 0xe7d7,
+ 0xe7d8, 0xe7d9, 0xe7da, 0xe7db, 0xe7dc, 0xe7dd, 0xe7de, 0xe7df,
+ 0xe7e0, 0xe7e1, 0xe7e2, 0xe7e3, 0xe7e4, 0xe7e5, 0xe7e6, 0xe7e7,
+ 0xe7e8, 0xe7e9, 0xe7ea, 0xe7eb, 0xe7ec, 0xe7ed, 0xe7ee, 0xe7ef,
+ 0xe7f0, 0xe7f1, 0xe7f2, 0xe7f3, 0xe7f4, 0xe7f5, 0xe7f6, 0xe7f7,
+ 0xe7f8, 0xe7f9, 0xe7fa, 0xe7fb, 0xe7fc, 0xe7fd, 0xe7fe, 0xe7ff,
+ 0xe800, 0xe801, 0xe802, 0xe803, 0xe804, 0xe805, 0xe806, 0xe807,
+ 0xe808, 0xe809, 0xe80a, 0xe80b, 0xe80c, 0xe80d, 0xe80e, 0xe80f,
+ 0xe810, 0xe811, 0xe812, 0xe813, 0xe814, 0xe815, 0xe816, 0xe817,
+ 0xe818, 0xe819, 0xe81a, 0xe81b, 0xe81c, 0xe81d, 0xe81e, 0xe81f,
+ 0xe820, 0xe821, 0xe822, 0xe823, 0xe824, 0xe825, 0xe826, 0xe827,
+ 0xe828, 0xe829, 0xe82a, 0xe82b, 0xe82c, 0xe82d, 0xe82e, 0xe82f,
+ 0xe830, 0xe831, 0xe832, 0xe833, 0xe834, 0xe835, 0xe836, 0xe837,
+ 0xe838, 0xe839, 0xe83a, 0xe83b, 0xe83c, 0xe83d, 0xe83e, 0xe83f,
+ 0xe840, 0xe841, 0xe842, 0xe843, 0xe844, 0xe845, 0xe846, 0xe847,
+ 0xe848, 0xe849, 0xe84a, 0xe84b, 0xe84c, 0xe84d, 0xe84e, 0xe84f,
+ 0xe850, 0xe851, 0xe852, 0xe853, 0xe854, 0xe855, 0xe856, 0xe857,
+ 0xe858, 0xe859, 0xe85a, 0xe85b, 0xe85c, 0xe85d, 0xe85e, 0xe85f,
+ 0xe860, 0xe861, 0xe862, 0xe863, 0xe864, 0xe865, 0xe866, 0xe867,
+ 0xe868, 0xe869, 0xe86a, 0xe86b, 0xe86c, 0xe86d, 0xe86e, 0xe86f,
+ 0xe870, 0xe871, 0xe872, 0xe873, 0xe874, 0xe875, 0xe876, 0xe877,
+ 0xe878, 0xe879, 0xe87a, 0xe87b, 0xe87c, 0xe87d, 0xe87e, 0xe87f,
+ 0xe880, 0xe881, 0xe882, 0xe883, 0xe884, 0xe885, 0xe886, 0xe887,
+ 0xe888, 0xe889, 0xe88a, 0xe88b, 0xe88c, 0xe88d, 0xe88e, 0xe88f,
+ 0xe890, 0xe891, 0xe892, 0xe893, 0xe894, 0xe895, 0xe896, 0xe897,
+ 0xe898, 0xe899, 0xe89a, 0xe89b, 0xe89c, 0xe89d, 0xe89e, 0xe89f,
+ 0xe8a0, 0xe8a1, 0xe8a2, 0xe8a3, 0xe8a4, 0xe8a5, 0xe8a6, 0xe8a7,
+ 0xe8a8, 0xe8a9, 0xe8aa, 0xe8ab, 0xe8ac, 0xe8ad, 0xe8ae, 0xe8af,
+ 0xe8b0, 0xe8b1, 0xe8b2, 0xe8b3, 0xe8b4, 0xe8b5, 0xe8b6, 0xe8b7,
+ 0xe8b8, 0xe8b9, 0xe8ba, 0xe8bb, 0xe8bc, 0xe8bd, 0xe8be, 0xe8bf,
+ 0xe8c0, 0xe8c1, 0xe8c2, 0xe8c3, 0xe8c4, 0xe8c5, 0xe8c6, 0xe8c7,
+ 0xe8c8, 0xe8c9, 0xe8ca, 0xe8cb, 0xe8cc, 0xe8cd, 0xe8ce, 0xe8cf,
+ 0xe8d0, 0xe8d1, 0xe8d2, 0xe8d3, 0xe8d4, 0xe8d5, 0xe8d6, 0xe8d7,
+ 0xe8d8, 0xe8d9, 0xe8da, 0xe8db, 0xe8dc, 0xe8dd, 0xe8de, 0xe8df,
+ 0xe8e0, 0xe8e1, 0xe8e2, 0xe8e3, 0xe8e4, 0xe8e5, 0xe8e6, 0xe8e7,
+ 0xe8e8, 0xe8e9, 0xe8ea, 0xe8eb, 0xe8ec, 0xe8ed, 0xe8ee, 0xe8ef,
+ 0xe8f0, 0xe8f1, 0xe8f2, 0xe8f3, 0xe8f4, 0xe8f5, 0xe8f6, 0xe8f7,
+ 0xe8f8, 0xe8f9, 0xe8fa, 0xe8fb, 0xe8fc, 0xe8fd, 0xe8fe, 0xe8ff,
+ 0xe900, 0xe901, 0xe902, 0xe903, 0xe904, 0xe905, 0xe906, 0xe907,
+ 0xe908, 0xe909, 0xe90a, 0xe90b, 0xe90c, 0xe90d, 0xe90e, 0xe90f,
+ 0xe910, 0xe911, 0xe912, 0xe913, 0xe914, 0xe915, 0xe916, 0xe917,
+ 0xe918, 0xe919, 0xe91a, 0xe91b, 0xe91c, 0xe91d, 0xe91e, 0xe91f,
+ 0xe920, 0xe921, 0xe922, 0xe923, 0xe924, 0xe925, 0xe926, 0xe927,
+ 0xe928, 0xe929, 0xe92a, 0xe92b, 0xe92c, 0xe92d, 0xe92e, 0xe92f,
+ 0xe930, 0xe931, 0xe932, 0xe933, 0xe934, 0xe935, 0xe936, 0xe937,
+ 0xe938, 0xe939, 0xe93a, 0xe93b, 0xe93c, 0xe93d, 0xe93e, 0xe93f,
+ 0xe940, 0xe941, 0xe942, 0xe943, 0xe944, 0xe945, 0xe946, 0xe947,
+ 0xe948, 0xe949, 0xe94a, 0xe94b, 0xe94c, 0xe94d, 0xe94e, 0xe94f,
+ 0xe950, 0xe951, 0xe952, 0xe953, 0xe954, 0xe955, 0xe956, 0xe957,
+ 0xe958, 0xe959, 0xe95a, 0xe95b, 0xe95c, 0xe95d, 0xe95e, 0xe95f,
+ 0xe960, 0xe961, 0xe962, 0xe963, 0xe964, 0xe965, 0xe966, 0xe967,
+ 0xe968, 0xe969, 0xe96a, 0xe96b, 0xe96c, 0xe96d, 0xe96e, 0xe96f,
+ 0xe970, 0xe971, 0xe972, 0xe973, 0xe974, 0xe975, 0xe976, 0xe977,
+ 0xe978, 0xe979, 0xe97a, 0xe97b, 0xe97c, 0xe97d, 0xe97e, 0xe97f,
+ 0xe980, 0xe981, 0xe982, 0xe983, 0xe984, 0xe985, 0xe986, 0xe987,
+ 0xe988, 0xe989, 0xe98a, 0xe98b, 0xe98c, 0xe98d, 0xe98e, 0xe98f,
+ 0xe990, 0xe991, 0xe992, 0xe993, 0xe994, 0xe995, 0xe996, 0xe997,
+ 0xe998, 0xe999, 0xe99a, 0xe99b, 0xe99c, 0xe99d, 0xe99e, 0xe99f,
+ 0xe9a0, 0xe9a1, 0xe9a2, 0xe9a3, 0xe9a4, 0xe9a5, 0xe9a6, 0xe9a7,
+ 0xe9a8, 0xe9a9, 0xe9aa, 0xe9ab, 0xe9ac, 0xe9ad, 0xe9ae, 0xe9af,
+ 0xe9b0, 0xe9b1, 0xe9b2, 0xe9b3, 0xe9b4, 0xe9b5, 0xe9b6, 0xe9b7,
+ 0xe9b8, 0xe9b9, 0xe9ba, 0xe9bb, 0xe9bc, 0xe9bd, 0xe9be, 0xe9bf,
+ 0xe9c0, 0xe9c1, 0xe9c2, 0xe9c3, 0xe9c4, 0xe9c5, 0xe9c6, 0xe9c7,
+ 0xe9c8, 0xe9c9, 0xe9ca, 0xe9cb, 0xe9cc, 0xe9cd, 0xe9ce, 0xe9cf,
+ 0xe9d0, 0xe9d1, 0xe9d2, 0xe9d3, 0xe9d4, 0xe9d5, 0xe9d6, 0xe9d7,
+ 0xe9d8, 0xe9d9, 0xe9da, 0xe9db, 0xe9dc, 0xe9dd, 0xe9de, 0xe9df,
+ 0xe9e0, 0xe9e1, 0xe9e2, 0xe9e3, 0xe9e4, 0xe9e5, 0xe9e6, 0xe9e7,
+ 0xe9e8, 0xe9e9, 0xe9ea, 0xe9eb, 0xe9ec, 0xe9ed, 0xe9ee, 0xe9ef,
+ 0xe9f0, 0xe9f1, 0xe9f2, 0xe9f3, 0xe9f4, 0xe9f5, 0xe9f6, 0xe9f7,
+ 0xe9f8, 0xe9f9, 0xe9fa, 0xe9fb, 0xe9fc, 0xe9fd, 0xe9fe, 0xe9ff,
+ 0xea00, 0xea01, 0xea02, 0xea03, 0xea04, 0xea05, 0xea06, 0xea07,
+ 0xea08, 0xea09, 0xea0a, 0xea0b, 0xea0c, 0xea0d, 0xea0e, 0xea0f,
+ 0xea10, 0xea11, 0xea12, 0xea13, 0xea14, 0xea15, 0xea16, 0xea17,
+ 0xea18, 0xea19, 0xea1a, 0xea1b, 0xea1c, 0xea1d, 0xea1e, 0xea1f,
+ 0xea20, 0xea21, 0xea22, 0xea23, 0xea24, 0xea25, 0xea26, 0xea27,
+ 0xea28, 0xea29, 0xea2a, 0xea2b, 0xea2c, 0xea2d, 0xea2e, 0xea2f,
+ 0xea30, 0xea31, 0xea32, 0xea33, 0xea34, 0xea35, 0xea36, 0xea37,
+ 0xea38, 0xea39, 0xea3a, 0xea3b, 0xea3c, 0xea3d, 0xea3e, 0xea3f,
+ 0xea40, 0xea41, 0xea42, 0xea43, 0xea44, 0xea45, 0xea46, 0xea47,
+ 0xea48, 0xea49, 0xea4a, 0xea4b, 0xea4c, 0xea4d, 0xea4e, 0xea4f,
+ 0xea50, 0xea51, 0xea52, 0xea53, 0xea54, 0xea55, 0xea56, 0xea57,
+ 0xea58, 0xea59, 0xea5a, 0xea5b, 0xea5c, 0xea5d, 0xea5e, 0xea5f,
+ 0xea60, 0xea61, 0xea62, 0xea63, 0xea64, 0xea65, 0xea66, 0xea67,
+ 0xea68, 0xea69, 0xea6a, 0xea6b, 0xea6c, 0xea6d, 0xea6e, 0xea6f,
+ 0xea70, 0xea71, 0xea72, 0xea73, 0xea74, 0xea75, 0xea76, 0xea77,
+ 0xea78, 0xea79, 0xea7a, 0xea7b, 0xea7c, 0xea7d, 0xea7e, 0xea7f,
+ 0xea80, 0xea81, 0xea82, 0xea83, 0xea84, 0xea85, 0xea86, 0xea87,
+ 0xea88, 0xea89, 0xea8a, 0xea8b, 0xea8c, 0xea8d, 0xea8e, 0xea8f,
+ 0xea90, 0xea91, 0xea92, 0xea93, 0xea94, 0xea95, 0xea96, 0xea97,
+ 0xea98, 0xea99, 0xea9a, 0xea9b, 0xea9c, 0xea9d, 0xea9e, 0xea9f,
+ 0xeaa0, 0xeaa1, 0xeaa2, 0xeaa3, 0xeaa4, 0xeaa5, 0xeaa6, 0xeaa7,
+ 0xeaa8, 0xeaa9, 0xeaaa, 0xeaab, 0xeaac, 0xeaad, 0xeaae, 0xeaaf,
+ 0xeab0, 0xeab1, 0xeab2, 0xeab3, 0xeab4, 0xeab5, 0xeab6, 0xeab7,
+ 0xeab8, 0xeab9, 0xeaba, 0xeabb, 0xeabc, 0xeabd, 0xeabe, 0xeabf,
+ 0xeac0, 0xeac1, 0xeac2, 0xeac3, 0xeac4, 0xeac5, 0xeac6, 0xeac7,
+ 0xeac8, 0xeac9, 0xeaca, 0xeacb, 0xeacc, 0xeacd, 0xeace, 0xeacf,
+ 0xead0, 0xead1, 0xead2, 0xead3, 0xead4, 0xead5, 0xead6, 0xead7,
+ 0xead8, 0xead9, 0xeada, 0xeadb, 0xeadc, 0xeadd, 0xeade, 0xeadf,
+ 0xeae0, 0xeae1, 0xeae2, 0xeae3, 0xeae4, 0xeae5, 0xeae6, 0xeae7,
+ 0xeae8, 0xeae9, 0xeaea, 0xeaeb, 0xeaec, 0xeaed, 0xeaee, 0xeaef,
+ 0xeaf0, 0xeaf1, 0xeaf2, 0xeaf3, 0xeaf4, 0xeaf5, 0xeaf6, 0xeaf7,
+ 0xeaf8, 0xeaf9, 0xeafa, 0xeafb, 0xeafc, 0xeafd, 0xeafe, 0xeaff,
+ 0xeb00, 0xeb01, 0xeb02, 0xeb03, 0xeb04, 0xeb05, 0xeb06, 0xeb07,
+ 0xeb08, 0xeb09, 0xeb0a, 0xeb0b, 0xeb0c, 0xeb0d, 0xeb0e, 0xeb0f,
+ 0xeb10, 0xeb11, 0xeb12, 0xeb13, 0xeb14, 0xeb15, 0xeb16, 0xeb17,
+ 0xeb18, 0xeb19, 0xeb1a, 0xeb1b, 0xeb1c, 0xeb1d, 0xeb1e, 0xeb1f,
+ 0xeb20, 0xeb21, 0xeb22, 0xeb23, 0xeb24, 0xeb25, 0xeb26, 0xeb27,
+ 0xeb28, 0xeb29, 0xeb2a, 0xeb2b, 0xeb2c, 0xeb2d, 0xeb2e, 0xeb2f,
+ 0xeb30, 0xeb31, 0xeb32, 0xeb33, 0xeb34, 0xeb35, 0xeb36, 0xeb37,
+ 0xeb38, 0xeb39, 0xeb3a, 0xeb3b, 0xeb3c, 0xeb3d, 0xeb3e, 0xeb3f,
+ 0xeb40, 0xeb41, 0xeb42, 0xeb43, 0xeb44, 0xeb45, 0xeb46, 0xeb47,
+ 0xeb48, 0xeb49, 0xeb4a, 0xeb4b, 0xeb4c, 0xeb4d, 0xeb4e, 0xeb4f,
+ 0xeb50, 0xeb51, 0xeb52, 0xeb53, 0xeb54, 0xeb55, 0xeb56, 0xeb57,
+ 0xeb58, 0xeb59, 0xeb5a, 0xeb5b, 0xeb5c, 0xeb5d, 0xeb5e, 0xeb5f,
+ 0xeb60, 0xeb61, 0xeb62, 0xeb63, 0xeb64, 0xeb65, 0xeb66, 0xeb67,
+ 0xeb68, 0xeb69, 0xeb6a, 0xeb6b, 0xeb6c, 0xeb6d, 0xeb6e, 0xeb6f,
+ 0xeb70, 0xeb71, 0xeb72, 0xeb73, 0xeb74, 0xeb75, 0xeb76, 0xeb77,
+ 0xeb78, 0xeb79, 0xeb7a, 0xeb7b, 0xeb7c, 0xeb7d, 0xeb7e, 0xeb7f,
+ 0xeb80, 0xeb81, 0xeb82, 0xeb83, 0xeb84, 0xeb85, 0xeb86, 0xeb87,
+ 0xeb88, 0xeb89, 0xeb8a, 0xeb8b, 0xeb8c, 0xeb8d, 0xeb8e, 0xeb8f,
+ 0xeb90, 0xeb91, 0xeb92, 0xeb93, 0xeb94, 0xeb95, 0xeb96, 0xeb97,
+ 0xeb98, 0xeb99, 0xeb9a, 0xeb9b, 0xeb9c, 0xeb9d, 0xeb9e, 0xeb9f,
+ 0xeba0, 0xeba1, 0xeba2, 0xeba3, 0xeba4, 0xeba5, 0xeba6, 0xeba7,
+ 0xeba8, 0xeba9, 0xebaa, 0xebab, 0xebac, 0xebad, 0xebae, 0xebaf,
+ 0xebb0, 0xebb1, 0xebb2, 0xebb3, 0xebb4, 0xebb5, 0xebb6, 0xebb7,
+ 0xebb8, 0xebb9, 0xebba, 0xebbb, 0xebbc, 0xebbd, 0xebbe, 0xebbf,
+ 0xebc0, 0xebc1, 0xebc2, 0xebc3, 0xebc4, 0xebc5, 0xebc6, 0xebc7,
+ 0xebc8, 0xebc9, 0xebca, 0xebcb, 0xebcc, 0xebcd, 0xebce, 0xebcf,
+ 0xebd0, 0xebd1, 0xebd2, 0xebd3, 0xebd4, 0xebd5, 0xebd6, 0xebd7,
+ 0xebd8, 0xebd9, 0xebda, 0xebdb, 0xebdc, 0xebdd, 0xebde, 0xebdf,
+ 0xebe0, 0xebe1, 0xebe2, 0xebe3, 0xebe4, 0xebe5, 0xebe6, 0xebe7,
+ 0xebe8, 0xebe9, 0xebea, 0xebeb, 0xebec, 0xebed, 0xebee, 0xebef,
+ 0xebf0, 0xebf1, 0xebf2, 0xebf3, 0xebf4, 0xebf5, 0xebf6, 0xebf7,
+ 0xebf8, 0xebf9, 0xebfa, 0xebfb, 0xebfc, 0xebfd, 0xebfe, 0xebff,
+ 0xec00, 0xec01, 0xec02, 0xec03, 0xec04, 0xec05, 0xec06, 0xec07,
+ 0xec08, 0xec09, 0xec0a, 0xec0b, 0xec0c, 0xec0d, 0xec0e, 0xec0f,
+ 0xec10, 0xec11, 0xec12, 0xec13, 0xec14, 0xec15, 0xec16, 0xec17,
+ 0xec18, 0xec19, 0xec1a, 0xec1b, 0xec1c, 0xec1d, 0xec1e, 0xec1f,
+ 0xec20, 0xec21, 0xec22, 0xec23, 0xec24, 0xec25, 0xec26, 0xec27,
+ 0xec28, 0xec29, 0xec2a, 0xec2b, 0xec2c, 0xec2d, 0xec2e, 0xec2f,
+ 0xec30, 0xec31, 0xec32, 0xec33, 0xec34, 0xec35, 0xec36, 0xec37,
+ 0xec38, 0xec39, 0xec3a, 0xec3b, 0xec3c, 0xec3d, 0xec3e, 0xec3f,
+ 0xec40, 0xec41, 0xec42, 0xec43, 0xec44, 0xec45, 0xec46, 0xec47,
+ 0xec48, 0xec49, 0xec4a, 0xec4b, 0xec4c, 0xec4d, 0xec4e, 0xec4f,
+ 0xec50, 0xec51, 0xec52, 0xec53, 0xec54, 0xec55, 0xec56, 0xec57,
+ 0xec58, 0xec59, 0xec5a, 0xec5b, 0xec5c, 0xec5d, 0xec5e, 0xec5f,
+ 0xec60, 0xec61, 0xec62, 0xec63, 0xec64, 0xec65, 0xec66, 0xec67,
+ 0xec68, 0xec69, 0xec6a, 0xec6b, 0xec6c, 0xec6d, 0xec6e, 0xec6f,
+ 0xec70, 0xec71, 0xec72, 0xec73, 0xec74, 0xec75, 0xec76, 0xec77,
+ 0xec78, 0xec79, 0xec7a, 0xec7b, 0xec7c, 0xec7d, 0xec7e, 0xec7f,
+ 0xec80, 0xec81, 0xec82, 0xec83, 0xec84, 0xec85, 0xec86, 0xec87,
+ 0xec88, 0xec89, 0xec8a, 0xec8b, 0xec8c, 0xec8d, 0xec8e, 0xec8f,
+ 0xec90, 0xec91, 0xec92, 0xec93, 0xec94, 0xec95, 0xec96, 0xec97,
+ 0xec98, 0xec99, 0xec9a, 0xec9b, 0xec9c, 0xec9d, 0xec9e, 0xec9f,
+ 0xeca0, 0xeca1, 0xeca2, 0xeca3, 0xeca4, 0xeca5, 0xeca6, 0xeca7,
+ 0xeca8, 0xeca9, 0xecaa, 0xecab, 0xecac, 0xecad, 0xecae, 0xecaf,
+ 0xecb0, 0xecb1, 0xecb2, 0xecb3, 0xecb4, 0xecb5, 0xecb6, 0xecb7,
+ 0xecb8, 0xecb9, 0xecba, 0xecbb, 0xecbc, 0xecbd, 0xecbe, 0xecbf,
+ 0xecc0, 0xecc1, 0xecc2, 0xecc3, 0xecc4, 0xecc5, 0xecc6, 0xecc7,
+ 0xecc8, 0xecc9, 0xecca, 0xeccb, 0xeccc, 0xeccd, 0xecce, 0xeccf,
+ 0xecd0, 0xecd1, 0xecd2, 0xecd3, 0xecd4, 0xecd5, 0xecd6, 0xecd7,
+ 0xecd8, 0xecd9, 0xecda, 0xecdb, 0xecdc, 0xecdd, 0xecde, 0xecdf,
+ 0xece0, 0xece1, 0xece2, 0xece3, 0xece4, 0xece5, 0xece6, 0xece7,
+ 0xece8, 0xece9, 0xecea, 0xeceb, 0xecec, 0xeced, 0xecee, 0xecef,
+ 0xecf0, 0xecf1, 0xecf2, 0xecf3, 0xecf4, 0xecf5, 0xecf6, 0xecf7,
+ 0xecf8, 0xecf9, 0xecfa, 0xecfb, 0xecfc, 0xecfd, 0xecfe, 0xecff,
+ 0xed00, 0xed01, 0xed02, 0xed03, 0xed04, 0xed05, 0xed06, 0xed07,
+ 0xed08, 0xed09, 0xed0a, 0xed0b, 0xed0c, 0xed0d, 0xed0e, 0xed0f,
+ 0xed10, 0xed11, 0xed12, 0xed13, 0xed14, 0xed15, 0xed16, 0xed17,
+ 0xed18, 0xed19, 0xed1a, 0xed1b, 0xed1c, 0xed1d, 0xed1e, 0xed1f,
+ 0xed20, 0xed21, 0xed22, 0xed23, 0xed24, 0xed25, 0xed26, 0xed27,
+ 0xed28, 0xed29, 0xed2a, 0xed2b, 0xed2c, 0xed2d, 0xed2e, 0xed2f,
+ 0xed30, 0xed31, 0xed32, 0xed33, 0xed34, 0xed35, 0xed36, 0xed37,
+ 0xed38, 0xed39, 0xed3a, 0xed3b, 0xed3c, 0xed3d, 0xed3e, 0xed3f,
+ 0xed40, 0xed41, 0xed42, 0xed43, 0xed44, 0xed45, 0xed46, 0xed47,
+ 0xed48, 0xed49, 0xed4a, 0xed4b, 0xed4c, 0xed4d, 0xed4e, 0xed4f,
+ 0xed50, 0xed51, 0xed52, 0xed53, 0xed54, 0xed55, 0xed56, 0xed57,
+ 0xed58, 0xed59, 0xed5a, 0xed5b, 0xed5c, 0xed5d, 0xed5e, 0xed5f,
+ 0xed60, 0xed61, 0xed62, 0xed63, 0xed64, 0xed65, 0xed66, 0xed67,
+ 0xed68, 0xed69, 0xed6a, 0xed6b, 0xed6c, 0xed6d, 0xed6e, 0xed6f,
+ 0xed70, 0xed71, 0xed72, 0xed73, 0xed74, 0xed75, 0xed76, 0xed77,
+ 0xed78, 0xed79, 0xed7a, 0xed7b, 0xed7c, 0xed7d, 0xed7e, 0xed7f,
+ 0xed80, 0xed81, 0xed82, 0xed83, 0xed84, 0xed85, 0xed86, 0xed87,
+ 0xed88, 0xed89, 0xed8a, 0xed8b, 0xed8c, 0xed8d, 0xed8e, 0xed8f,
+ 0xed90, 0xed91, 0xed92, 0xed93, 0xed94, 0xed95, 0xed96, 0xed97,
+ 0xed98, 0xed99, 0xed9a, 0xed9b, 0xed9c, 0xed9d, 0xed9e, 0xed9f,
+ 0xeda0, 0xeda1, 0xeda2, 0xeda3, 0xeda4, 0xeda5, 0xeda6, 0xeda7,
+ 0xeda8, 0xeda9, 0xedaa, 0xedab, 0xedac, 0xedad, 0xedae, 0xedaf,
+ 0xedb0, 0xedb1, 0xedb2, 0xedb3, 0xedb4, 0xedb5, 0xedb6, 0xedb7,
+ 0xedb8, 0xedb9, 0xedba, 0xedbb, 0xedbc, 0xedbd, 0xedbe, 0xedbf,
+ 0xedc0, 0xedc1, 0xedc2, 0xedc3, 0xedc4, 0xedc5, 0xedc6, 0xedc7,
+ 0xedc8, 0xedc9, 0xedca, 0xedcb, 0xedcc, 0xedcd, 0xedce, 0xedcf,
+ 0xedd0, 0xedd1, 0xedd2, 0xedd3, 0xedd4, 0xedd5, 0xedd6, 0xedd7,
+ 0xedd8, 0xedd9, 0xedda, 0xeddb, 0xeddc, 0xeddd, 0xedde, 0xeddf,
+ 0xede0, 0xede1, 0xede2, 0xede3, 0xede4, 0xede5, 0xede6, 0xede7,
+ 0xede8, 0xede9, 0xedea, 0xedeb, 0xedec, 0xeded, 0xedee, 0xedef,
+ 0xedf0, 0xedf1, 0xedf2, 0xedf3, 0xedf4, 0xedf5, 0xedf6, 0xedf7,
+ 0xedf8, 0xedf9, 0xedfa, 0xedfb, 0xedfc, 0xedfd, 0xedfe, 0xedff,
+ 0xee00, 0xee01, 0xee02, 0xee03, 0xee04, 0xee05, 0xee06, 0xee07,
+ 0xee08, 0xee09, 0xee0a, 0xee0b, 0xee0c, 0xee0d, 0xee0e, 0xee0f,
+ 0xee10, 0xee11, 0xee12, 0xee13, 0xee14, 0xee15, 0xee16, 0xee17,
+ 0xee18, 0xee19, 0xee1a, 0xee1b, 0xee1c, 0xee1d, 0xee1e, 0xee1f,
+ 0xee20, 0xee21, 0xee22, 0xee23, 0xee24, 0xee25, 0xee26, 0xee27,
+ 0xee28, 0xee29, 0xee2a, 0xee2b, 0xee2c, 0xee2d, 0xee2e, 0xee2f,
+ 0xee30, 0xee31, 0xee32, 0xee33, 0xee34, 0xee35, 0xee36, 0xee37,
+ 0xee38, 0xee39, 0xee3a, 0xee3b, 0xee3c, 0xee3d, 0xee3e, 0xee3f,
+ 0xee40, 0xee41, 0xee42, 0xee43, 0xee44, 0xee45, 0xee46, 0xee47,
+ 0xee48, 0xee49, 0xee4a, 0xee4b, 0xee4c, 0xee4d, 0xee4e, 0xee4f,
+ 0xee50, 0xee51, 0xee52, 0xee53, 0xee54, 0xee55, 0xee56, 0xee57,
+ 0xee58, 0xee59, 0xee5a, 0xee5b, 0xee5c, 0xee5d, 0xee5e, 0xee5f,
+ 0xee60, 0xee61, 0xee62, 0xee63, 0xee64, 0xee65, 0xee66, 0xee67,
+ 0xee68, 0xee69, 0xee6a, 0xee6b, 0xee6c, 0xee6d, 0xee6e, 0xee6f,
+ 0xee70, 0xee71, 0xee72, 0xee73, 0xee74, 0xee75, 0xee76, 0xee77,
+ 0xee78, 0xee79, 0xee7a, 0xee7b, 0xee7c, 0xee7d, 0xee7e, 0xee7f,
+ 0xee80, 0xee81, 0xee82, 0xee83, 0xee84, 0xee85, 0xee86, 0xee87,
+ 0xee88, 0xee89, 0xee8a, 0xee8b, 0xee8c, 0xee8d, 0xee8e, 0xee8f,
+ 0xee90, 0xee91, 0xee92, 0xee93, 0xee94, 0xee95, 0xee96, 0xee97,
+ 0xee98, 0xee99, 0xee9a, 0xee9b, 0xee9c, 0xee9d, 0xee9e, 0xee9f,
+ 0xeea0, 0xeea1, 0xeea2, 0xeea3, 0xeea4, 0xeea5, 0xeea6, 0xeea7,
+ 0xeea8, 0xeea9, 0xeeaa, 0xeeab, 0xeeac, 0xeead, 0xeeae, 0xeeaf,
+ 0xeeb0, 0xeeb1, 0xeeb2, 0xeeb3, 0xeeb4, 0xeeb5, 0xeeb6, 0xeeb7,
+ 0xeeb8, 0xeeb9, 0xeeba, 0xeebb, 0xeebc, 0xeebd, 0xeebe, 0xeebf,
+ 0xeec0, 0xeec1, 0xeec2, 0xeec3, 0xeec4, 0xeec5, 0xeec6, 0xeec7,
+ 0xeec8, 0xeec9, 0xeeca, 0xeecb, 0xeecc, 0xeecd, 0xeece, 0xeecf,
+ 0xeed0, 0xeed1, 0xeed2, 0xeed3, 0xeed4, 0xeed5, 0xeed6, 0xeed7,
+ 0xeed8, 0xeed9, 0xeeda, 0xeedb, 0xeedc, 0xeedd, 0xeede, 0xeedf,
+ 0xeee0, 0xeee1, 0xeee2, 0xeee3, 0xeee4, 0xeee5, 0xeee6, 0xeee7,
+ 0xeee8, 0xeee9, 0xeeea, 0xeeeb, 0xeeec, 0xeeed, 0xeeee, 0xeeef,
+ 0xeef0, 0xeef1, 0xeef2, 0xeef3, 0xeef4, 0xeef5, 0xeef6, 0xeef7,
+ 0xeef8, 0xeef9, 0xeefa, 0xeefb, 0xeefc, 0xeefd, 0xeefe, 0xeeff,
+ 0xef00, 0xef01, 0xef02, 0xef03, 0xef04, 0xef05, 0xef06, 0xef07,
+ 0xef08, 0xef09, 0xef0a, 0xef0b, 0xef0c, 0xef0d, 0xef0e, 0xef0f,
+ 0xef10, 0xef11, 0xef12, 0xef13, 0xef14, 0xef15, 0xef16, 0xef17,
+ 0xef18, 0xef19, 0xef1a, 0xef1b, 0xef1c, 0xef1d, 0xef1e, 0xef1f,
+ 0xef20, 0xef21, 0xef22, 0xef23, 0xef24, 0xef25, 0xef26, 0xef27,
+ 0xef28, 0xef29, 0xef2a, 0xef2b, 0xef2c, 0xef2d, 0xef2e, 0xef2f,
+ 0xef30, 0xef31, 0xef32, 0xef33, 0xef34, 0xef35, 0xef36, 0xef37,
+ 0xef38, 0xef39, 0xef3a, 0xef3b, 0xef3c, 0xef3d, 0xef3e, 0xef3f,
+ 0xef40, 0xef41, 0xef42, 0xef43, 0xef44, 0xef45, 0xef46, 0xef47,
+ 0xef48, 0xef49, 0xef4a, 0xef4b, 0xef4c, 0xef4d, 0xef4e, 0xef4f,
+ 0xef50, 0xef51, 0xef52, 0xef53, 0xef54, 0xef55, 0xef56, 0xef57,
+ 0xef58, 0xef59, 0xef5a, 0xef5b, 0xef5c, 0xef5d, 0xef5e, 0xef5f,
+ 0xef60, 0xef61, 0xef62, 0xef63, 0xef64, 0xef65, 0xef66, 0xef67,
+ 0xef68, 0xef69, 0xef6a, 0xef6b, 0xef6c, 0xef6d, 0xef6e, 0xef6f,
+ 0xef70, 0xef71, 0xef72, 0xef73, 0xef74, 0xef75, 0xef76, 0xef77,
+ 0xef78, 0xef79, 0xef7a, 0xef7b, 0xef7c, 0xef7d, 0xef7e, 0xef7f,
+ 0xef80, 0xef81, 0xef82, 0xef83, 0xef84, 0xef85, 0xef86, 0xef87,
+ 0xef88, 0xef89, 0xef8a, 0xef8b, 0xef8c, 0xef8d, 0xef8e, 0xef8f,
+ 0xef90, 0xef91, 0xef92, 0xef93, 0xef94, 0xef95, 0xef96, 0xef97,
+ 0xef98, 0xef99, 0xef9a, 0xef9b, 0xef9c, 0xef9d, 0xef9e, 0xef9f,
+ 0xefa0, 0xefa1, 0xefa2, 0xefa3, 0xefa4, 0xefa5, 0xefa6, 0xefa7,
+ 0xefa8, 0xefa9, 0xefaa, 0xefab, 0xefac, 0xefad, 0xefae, 0xefaf,
+ 0xefb0, 0xefb1, 0xefb2, 0xefb3, 0xefb4, 0xefb5, 0xefb6, 0xefb7,
+ 0xefb8, 0xefb9, 0xefba, 0xefbb, 0xefbc, 0xefbd, 0xefbe, 0xefbf,
+ 0xefc0, 0xefc1, 0xefc2, 0xefc3, 0xefc4, 0xefc5, 0xefc6, 0xefc7,
+ 0xefc8, 0xefc9, 0xefca, 0xefcb, 0xefcc, 0xefcd, 0xefce, 0xefcf,
+ 0xefd0, 0xefd1, 0xefd2, 0xefd3, 0xefd4, 0xefd5, 0xefd6, 0xefd7,
+ 0xefd8, 0xefd9, 0xefda, 0xefdb, 0xefdc, 0xefdd, 0xefde, 0xefdf,
+ 0xefe0, 0xefe1, 0xefe2, 0xefe3, 0xefe4, 0xefe5, 0xefe6, 0xefe7,
+ 0xefe8, 0xefe9, 0xefea, 0xefeb, 0xefec, 0xefed, 0xefee, 0xefef,
+ 0xeff0, 0xeff1, 0xeff2, 0xeff3, 0xeff4, 0xeff5, 0xeff6, 0xeff7,
+ 0xeff8, 0xeff9, 0xeffa, 0xeffb, 0xeffc, 0xeffd, 0xeffe, 0xefff,
+ 0xf000, 0xf001, 0xf002, 0xf003, 0xf004, 0xf005, 0xf006, 0xf007,
+ 0xf008, 0xf009, 0xf00a, 0xf00b, 0xf00c, 0xf00d, 0xf00e, 0xf00f,
+ 0xf010, 0xf011, 0xf012, 0xf013, 0xf014, 0xf015, 0xf016, 0xf017,
+ 0xf018, 0xf019, 0xf01a, 0xf01b, 0xf01c, 0xf01d, 0xf01e, 0xf01f,
+ 0xf020, 0xf021, 0xf022, 0xf023, 0xf024, 0xf025, 0xf026, 0xf027,
+ 0xf028, 0xf029, 0xf02a, 0xf02b, 0xf02c, 0xf02d, 0xf02e, 0xf02f,
+ 0xf030, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037,
+ 0xf038, 0xf039, 0xf03a, 0xf03b, 0xf03c, 0xf03d, 0xf03e, 0xf03f,
+ 0xf040, 0xf041, 0xf042, 0xf043, 0xf044, 0xf045, 0xf046, 0xf047,
+ 0xf048, 0xf049, 0xf04a, 0xf04b, 0xf04c, 0xf04d, 0xf04e, 0xf04f,
+ 0xf050, 0xf051, 0xf052, 0xf053, 0xf054, 0xf055, 0xf056, 0xf057,
+ 0xf058, 0xf059, 0xf05a, 0xf05b, 0xf05c, 0xf05d, 0xf05e, 0xf05f,
+ 0xf060, 0xf061, 0xf062, 0xf063, 0xf064, 0xf065, 0xf066, 0xf067,
+ 0xf068, 0xf069, 0xf06a, 0xf06b, 0xf06c, 0xf06d, 0xf06e, 0xf06f,
+ 0xf070, 0xf071, 0xf072, 0xf073, 0xf074, 0xf075, 0xf076, 0xf077,
+ 0xf078, 0xf079, 0xf07a, 0xf07b, 0xf07c, 0xf07d, 0xf07e, 0xf07f,
+ 0xf080, 0xf081, 0xf082, 0xf083, 0xf084, 0xf085, 0xf086, 0xf087,
+ 0xf088, 0xf089, 0xf08a, 0xf08b, 0xf08c, 0xf08d, 0xf08e, 0xf08f,
+ 0xf090, 0xf091, 0xf092, 0xf093, 0xf094, 0xf095, 0xf096, 0xf097,
+ 0xf098, 0xf099, 0xf09a, 0xf09b, 0xf09c, 0xf09d, 0xf09e, 0xf09f,
+ 0xf0a0, 0xf0a1, 0xf0a2, 0xf0a3, 0xf0a4, 0xf0a5, 0xf0a6, 0xf0a7,
+ 0xf0a8, 0xf0a9, 0xf0aa, 0xf0ab, 0xf0ac, 0xf0ad, 0xf0ae, 0xf0af,
+ 0xf0b0, 0xf0b1, 0xf0b2, 0xf0b3, 0xf0b4, 0xf0b5, 0xf0b6, 0xf0b7,
+ 0xf0b8, 0xf0b9, 0xf0ba, 0xf0bb, 0xf0bc, 0xf0bd, 0xf0be, 0xf0bf,
+ 0xf0c0, 0xf0c1, 0xf0c2, 0xf0c3, 0xf0c4, 0xf0c5, 0xf0c6, 0xf0c7,
+ 0xf0c8, 0xf0c9, 0xf0ca, 0xf0cb, 0xf0cc, 0xf0cd, 0xf0ce, 0xf0cf,
+ 0xf0d0, 0xf0d1, 0xf0d2, 0xf0d3, 0xf0d4, 0xf0d5, 0xf0d6, 0xf0d7,
+ 0xf0d8, 0xf0d9, 0xf0da, 0xf0db, 0xf0dc, 0xf0dd, 0xf0de, 0xf0df,
+ 0xf0e0, 0xf0e1, 0xf0e2, 0xf0e3, 0xf0e4, 0xf0e5, 0xf0e6, 0xf0e7,
+ 0xf0e8, 0xf0e9, 0xf0ea, 0xf0eb, 0xf0ec, 0xf0ed, 0xf0ee, 0xf0ef,
+ 0xf0f0, 0xf0f1, 0xf0f2, 0xf0f3, 0xf0f4, 0xf0f5, 0xf0f6, 0xf0f7,
+ 0xf0f8, 0xf0f9, 0xf0fa, 0xf0fb, 0xf0fc, 0xf0fd, 0xf0fe, 0xf0ff,
+ 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 0xf107,
+ 0xf108, 0xf109, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf10e, 0xf10f,
+ 0xf110, 0xf111, 0xf112, 0xf113, 0xf114, 0xf115, 0xf116, 0xf117,
+ 0xf118, 0xf119, 0xf11a, 0xf11b, 0xf11c, 0xf11d, 0xf11e, 0xf11f,
+ 0xf120, 0xf121, 0xf122, 0xf123, 0xf124, 0xf125, 0xf126, 0xf127,
+ 0xf128, 0xf129, 0xf12a, 0xf12b, 0xf12c, 0xf12d, 0xf12e, 0xf12f,
+ 0xf130, 0xf131, 0xf132, 0xf133, 0xf134, 0xf135, 0xf136, 0xf137,
+ 0xf138, 0xf139, 0xf13a, 0xf13b, 0xf13c, 0xf13d, 0xf13e, 0xf13f,
+ 0xf140, 0xf141, 0xf142, 0xf143, 0xf144, 0xf145, 0xf146, 0xf147,
+ 0xf148, 0xf149, 0xf14a, 0xf14b, 0xf14c, 0xf14d, 0xf14e, 0xf14f,
+ 0xf150, 0xf151, 0xf152, 0xf153, 0xf154, 0xf155, 0xf156, 0xf157,
+ 0xf158, 0xf159, 0xf15a, 0xf15b, 0xf15c, 0xf15d, 0xf15e, 0xf15f,
+ 0xf160, 0xf161, 0xf162, 0xf163, 0xf164, 0xf165, 0xf166, 0xf167,
+ 0xf168, 0xf169, 0xf16a, 0xf16b, 0xf16c, 0xf16d, 0xf16e, 0xf16f,
+ 0xf170, 0xf171, 0xf172, 0xf173, 0xf174, 0xf175, 0xf176, 0xf177,
+ 0xf178, 0xf179, 0xf17a, 0xf17b, 0xf17c, 0xf17d, 0xf17e, 0xf17f,
+ 0xf180, 0xf181, 0xf182, 0xf183, 0xf184, 0xf185, 0xf186, 0xf187,
+ 0xf188, 0xf189, 0xf18a, 0xf18b, 0xf18c, 0xf18d, 0xf18e, 0xf18f,
+ 0xf190, 0xf191, 0xf192, 0xf193, 0xf194, 0xf195, 0xf196, 0xf197,
+ 0xf198, 0xf199, 0xf19a, 0xf19b, 0xf19c, 0xf19d, 0xf19e, 0xf19f,
+ 0xf1a0, 0xf1a1, 0xf1a2, 0xf1a3, 0xf1a4, 0xf1a5, 0xf1a6, 0xf1a7,
+ 0xf1a8, 0xf1a9, 0xf1aa, 0xf1ab, 0xf1ac, 0xf1ad, 0xf1ae, 0xf1af,
+ 0xf1b0, 0xf1b1, 0xf1b2, 0xf1b3, 0xf1b4, 0xf1b5, 0xf1b6, 0xf1b7,
+ 0xf1b8, 0xf1b9, 0xf1ba, 0xf1bb, 0xf1bc, 0xf1bd, 0xf1be, 0xf1bf,
+ 0xf1c0, 0xf1c1, 0xf1c2, 0xf1c3, 0xf1c4, 0xf1c5, 0xf1c6, 0xf1c7,
+ 0xf1c8, 0xf1c9, 0xf1ca, 0xf1cb, 0xf1cc, 0xf1cd, 0xf1ce, 0xf1cf,
+ 0xf1d0, 0xf1d1, 0xf1d2, 0xf1d3, 0xf1d4, 0xf1d5, 0xf1d6, 0xf1d7,
+ 0xf1d8, 0xf1d9, 0xf1da, 0xf1db, 0xf1dc, 0xf1dd, 0xf1de, 0xf1df,
+ 0xf1e0, 0xf1e1, 0xf1e2, 0xf1e3, 0xf1e4, 0xf1e5, 0xf1e6, 0xf1e7,
+ 0xf1e8, 0xf1e9, 0xf1ea, 0xf1eb, 0xf1ec, 0xf1ed, 0xf1ee, 0xf1ef,
+ 0xf1f0, 0xf1f1, 0xf1f2, 0xf1f3, 0xf1f4, 0xf1f5, 0xf1f6, 0xf1f7,
+ 0xf1f8, 0xf1f9, 0xf1fa, 0xf1fb, 0xf1fc, 0xf1fd, 0xf1fe, 0xf1ff,
+ 0xf200, 0xf201, 0xf202, 0xf203, 0xf204, 0xf205, 0xf206, 0xf207,
+ 0xf208, 0xf209, 0xf20a, 0xf20b, 0xf20c, 0xf20d, 0xf20e, 0xf20f,
+ 0xf210, 0xf211, 0xf212, 0xf213, 0xf214, 0xf215, 0xf216, 0xf217,
+ 0xf218, 0xf219, 0xf21a, 0xf21b, 0xf21c, 0xf21d, 0xf21e, 0xf21f,
+ 0xf220, 0xf221, 0xf222, 0xf223, 0xf224, 0xf225, 0xf226, 0xf227,
+ 0xf228, 0xf229, 0xf22a, 0xf22b, 0xf22c, 0xf22d, 0xf22e, 0xf22f,
+ 0xf230, 0xf231, 0xf232, 0xf233, 0xf234, 0xf235, 0xf236, 0xf237,
+ 0xf238, 0xf239, 0xf23a, 0xf23b, 0xf23c, 0xf23d, 0xf23e, 0xf23f,
+ 0xf240, 0xf241, 0xf242, 0xf243, 0xf244, 0xf245, 0xf246, 0xf247,
+ 0xf248, 0xf249, 0xf24a, 0xf24b, 0xf24c, 0xf24d, 0xf24e, 0xf24f,
+ 0xf250, 0xf251, 0xf252, 0xf253, 0xf254, 0xf255, 0xf256, 0xf257,
+ 0xf258, 0xf259, 0xf25a, 0xf25b, 0xf25c, 0xf25d, 0xf25e, 0xf25f,
+ 0xf260, 0xf261, 0xf262, 0xf263, 0xf264, 0xf265, 0xf266, 0xf267,
+ 0xf268, 0xf269, 0xf26a, 0xf26b, 0xf26c, 0xf26d, 0xf26e, 0xf26f,
+ 0xf270, 0xf271, 0xf272, 0xf273, 0xf274, 0xf275, 0xf276, 0xf277,
+ 0xf278, 0xf279, 0xf27a, 0xf27b, 0xf27c, 0xf27d, 0xf27e, 0xf27f,
+ 0xf280, 0xf281, 0xf282, 0xf283, 0xf284, 0xf285, 0xf286, 0xf287,
+ 0xf288, 0xf289, 0xf28a, 0xf28b, 0xf28c, 0xf28d, 0xf28e, 0xf28f,
+ 0xf290, 0xf291, 0xf292, 0xf293, 0xf294, 0xf295, 0xf296, 0xf297,
+ 0xf298, 0xf299, 0xf29a, 0xf29b, 0xf29c, 0xf29d, 0xf29e, 0xf29f,
+ 0xf2a0, 0xf2a1, 0xf2a2, 0xf2a3, 0xf2a4, 0xf2a5, 0xf2a6, 0xf2a7,
+ 0xf2a8, 0xf2a9, 0xf2aa, 0xf2ab, 0xf2ac, 0xf2ad, 0xf2ae, 0xf2af,
+ 0xf2b0, 0xf2b1, 0xf2b2, 0xf2b3, 0xf2b4, 0xf2b5, 0xf2b6, 0xf2b7,
+ 0xf2b8, 0xf2b9, 0xf2ba, 0xf2bb, 0xf2bc, 0xf2bd, 0xf2be, 0xf2bf,
+ 0xf2c0, 0xf2c1, 0xf2c2, 0xf2c3, 0xf2c4, 0xf2c5, 0xf2c6, 0xf2c7,
+ 0xf2c8, 0xf2c9, 0xf2ca, 0xf2cb, 0xf2cc, 0xf2cd, 0xf2ce, 0xf2cf,
+ 0xf2d0, 0xf2d1, 0xf2d2, 0xf2d3, 0xf2d4, 0xf2d5, 0xf2d6, 0xf2d7,
+ 0xf2d8, 0xf2d9, 0xf2da, 0xf2db, 0xf2dc, 0xf2dd, 0xf2de, 0xf2df,
+ 0xf2e0, 0xf2e1, 0xf2e2, 0xf2e3, 0xf2e4, 0xf2e5, 0xf2e6, 0xf2e7,
+ 0xf2e8, 0xf2e9, 0xf2ea, 0xf2eb, 0xf2ec, 0xf2ed, 0xf2ee, 0xf2ef,
+ 0xf2f0, 0xf2f1, 0xf2f2, 0xf2f3, 0xf2f4, 0xf2f5, 0xf2f6, 0xf2f7,
+ 0xf2f8, 0xf2f9, 0xf2fa, 0xf2fb, 0xf2fc, 0xf2fd, 0xf2fe, 0xf2ff,
+ 0xf300, 0xf301, 0xf302, 0xf303, 0xf304, 0xf305, 0xf306, 0xf307,
+ 0xf308, 0xf309, 0xf30a, 0xf30b, 0xf30c, 0xf30d, 0xf30e, 0xf30f,
+ 0xf310, 0xf311, 0xf312, 0xf313, 0xf314, 0xf315, 0xf316, 0xf317,
+ 0xf318, 0xf319, 0xf31a, 0xf31b, 0xf31c, 0xf31d, 0xf31e, 0xf31f,
+ 0xf320, 0xf321, 0xf322, 0xf323, 0xf324, 0xf325, 0xf326, 0xf327,
+ 0xf328, 0xf329, 0xf32a, 0xf32b, 0xf32c, 0xf32d, 0xf32e, 0xf32f,
+ 0xf330, 0xf331, 0xf332, 0xf333, 0xf334, 0xf335, 0xf336, 0xf337,
+ 0xf338, 0xf339, 0xf33a, 0xf33b, 0xf33c, 0xf33d, 0xf33e, 0xf33f,
+ 0xf340, 0xf341, 0xf342, 0xf343, 0xf344, 0xf345, 0xf346, 0xf347,
+ 0xf348, 0xf349, 0xf34a, 0xf34b, 0xf34c, 0xf34d, 0xf34e, 0xf34f,
+ 0xf350, 0xf351, 0xf352, 0xf353, 0xf354, 0xf355, 0xf356, 0xf357,
+ 0xf358, 0xf359, 0xf35a, 0xf35b, 0xf35c, 0xf35d, 0xf35e, 0xf35f,
+ 0xf360, 0xf361, 0xf362, 0xf363, 0xf364, 0xf365, 0xf366, 0xf367,
+ 0xf368, 0xf369, 0xf36a, 0xf36b, 0xf36c, 0xf36d, 0xf36e, 0xf36f,
+ 0xf370, 0xf371, 0xf372, 0xf373, 0xf374, 0xf375, 0xf376, 0xf377,
+ 0xf378, 0xf379, 0xf37a, 0xf37b, 0xf37c, 0xf37d, 0xf37e, 0xf37f,
+ 0xf380, 0xf381, 0xf382, 0xf383, 0xf384, 0xf385, 0xf386, 0xf387,
+ 0xf388, 0xf389, 0xf38a, 0xf38b, 0xf38c, 0xf38d, 0xf38e, 0xf38f,
+ 0xf390, 0xf391, 0xf392, 0xf393, 0xf394, 0xf395, 0xf396, 0xf397,
+ 0xf398, 0xf399, 0xf39a, 0xf39b, 0xf39c, 0xf39d, 0xf39e, 0xf39f,
+ 0xf3a0, 0xf3a1, 0xf3a2, 0xf3a3, 0xf3a4, 0xf3a5, 0xf3a6, 0xf3a7,
+ 0xf3a8, 0xf3a9, 0xf3aa, 0xf3ab, 0xf3ac, 0xf3ad, 0xf3ae, 0xf3af,
+ 0xf3b0, 0xf3b1, 0xf3b2, 0xf3b3, 0xf3b4, 0xf3b5, 0xf3b6, 0xf3b7,
+ 0xf3b8, 0xf3b9, 0xf3ba, 0xf3bb, 0xf3bc, 0xf3bd, 0xf3be, 0xf3bf,
+ 0xf3c0, 0xf3c1, 0xf3c2, 0xf3c3, 0xf3c4, 0xf3c5, 0xf3c6, 0xf3c7,
+ 0xf3c8, 0xf3c9, 0xf3ca, 0xf3cb, 0xf3cc, 0xf3cd, 0xf3ce, 0xf3cf,
+ 0xf3d0, 0xf3d1, 0xf3d2, 0xf3d3, 0xf3d4, 0xf3d5, 0xf3d6, 0xf3d7,
+ 0xf3d8, 0xf3d9, 0xf3da, 0xf3db, 0xf3dc, 0xf3dd, 0xf3de, 0xf3df,
+ 0xf3e0, 0xf3e1, 0xf3e2, 0xf3e3, 0xf3e4, 0xf3e5, 0xf3e6, 0xf3e7,
+ 0xf3e8, 0xf3e9, 0xf3ea, 0xf3eb, 0xf3ec, 0xf3ed, 0xf3ee, 0xf3ef,
+ 0xf3f0, 0xf3f1, 0xf3f2, 0xf3f3, 0xf3f4, 0xf3f5, 0xf3f6, 0xf3f7,
+ 0xf3f8, 0xf3f9, 0xf3fa, 0xf3fb, 0xf3fc, 0xf3fd, 0xf3fe, 0xf3ff,
+ 0xf400, 0xf401, 0xf402, 0xf403, 0xf404, 0xf405, 0xf406, 0xf407,
+ 0xf408, 0xf409, 0xf40a, 0xf40b, 0xf40c, 0xf40d, 0xf40e, 0xf40f,
+ 0xf410, 0xf411, 0xf412, 0xf413, 0xf414, 0xf415, 0xf416, 0xf417,
+ 0xf418, 0xf419, 0xf41a, 0xf41b, 0xf41c, 0xf41d, 0xf41e, 0xf41f,
+ 0xf420, 0xf421, 0xf422, 0xf423, 0xf424, 0xf425, 0xf426, 0xf427,
+ 0xf428, 0xf429, 0xf42a, 0xf42b, 0xf42c, 0xf42d, 0xf42e, 0xf42f,
+ 0xf430, 0xf431, 0xf432, 0xf433, 0xf434, 0xf435, 0xf436, 0xf437,
+ 0xf438, 0xf439, 0xf43a, 0xf43b, 0xf43c, 0xf43d, 0xf43e, 0xf43f,
+ 0xf440, 0xf441, 0xf442, 0xf443, 0xf444, 0xf445, 0xf446, 0xf447,
+ 0xf448, 0xf449, 0xf44a, 0xf44b, 0xf44c, 0xf44d, 0xf44e, 0xf44f,
+ 0xf450, 0xf451, 0xf452, 0xf453, 0xf454, 0xf455, 0xf456, 0xf457,
+ 0xf458, 0xf459, 0xf45a, 0xf45b, 0xf45c, 0xf45d, 0xf45e, 0xf45f,
+ 0xf460, 0xf461, 0xf462, 0xf463, 0xf464, 0xf465, 0xf466, 0xf467,
+ 0xf468, 0xf469, 0xf46a, 0xf46b, 0xf46c, 0xf46d, 0xf46e, 0xf46f,
+ 0xf470, 0xf471, 0xf472, 0xf473, 0xf474, 0xf475, 0xf476, 0xf477,
+ 0xf478, 0xf479, 0xf47a, 0xf47b, 0xf47c, 0xf47d, 0xf47e, 0xf47f,
+ 0xf480, 0xf481, 0xf482, 0xf483, 0xf484, 0xf485, 0xf486, 0xf487,
+ 0xf488, 0xf489, 0xf48a, 0xf48b, 0xf48c, 0xf48d, 0xf48e, 0xf48f,
+ 0xf490, 0xf491, 0xf492, 0xf493, 0xf494, 0xf495, 0xf496, 0xf497,
+ 0xf498, 0xf499, 0xf49a, 0xf49b, 0xf49c, 0xf49d, 0xf49e, 0xf49f,
+ 0xf4a0, 0xf4a1, 0xf4a2, 0xf4a3, 0xf4a4, 0xf4a5, 0xf4a6, 0xf4a7,
+ 0xf4a8, 0xf4a9, 0xf4aa, 0xf4ab, 0xf4ac, 0xf4ad, 0xf4ae, 0xf4af,
+ 0xf4b0, 0xf4b1, 0xf4b2, 0xf4b3, 0xf4b4, 0xf4b5, 0xf4b6, 0xf4b7,
+ 0xf4b8, 0xf4b9, 0xf4ba, 0xf4bb, 0xf4bc, 0xf4bd, 0xf4be, 0xf4bf,
+ 0xf4c0, 0xf4c1, 0xf4c2, 0xf4c3, 0xf4c4, 0xf4c5, 0xf4c6, 0xf4c7,
+ 0xf4c8, 0xf4c9, 0xf4ca, 0xf4cb, 0xf4cc, 0xf4cd, 0xf4ce, 0xf4cf,
+ 0xf4d0, 0xf4d1, 0xf4d2, 0xf4d3, 0xf4d4, 0xf4d5, 0xf4d6, 0xf4d7,
+ 0xf4d8, 0xf4d9, 0xf4da, 0xf4db, 0xf4dc, 0xf4dd, 0xf4de, 0xf4df,
+ 0xf4e0, 0xf4e1, 0xf4e2, 0xf4e3, 0xf4e4, 0xf4e5, 0xf4e6, 0xf4e7,
+ 0xf4e8, 0xf4e9, 0xf4ea, 0xf4eb, 0xf4ec, 0xf4ed, 0xf4ee, 0xf4ef,
+ 0xf4f0, 0xf4f1, 0xf4f2, 0xf4f3, 0xf4f4, 0xf4f5, 0xf4f6, 0xf4f7,
+ 0xf4f8, 0xf4f9, 0xf4fa, 0xf4fb, 0xf4fc, 0xf4fd, 0xf4fe, 0xf4ff,
+ 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, 0xf505, 0xf506, 0xf507,
+ 0xf508, 0xf509, 0xf50a, 0xf50b, 0xf50c, 0xf50d, 0xf50e, 0xf50f,
+ 0xf510, 0xf511, 0xf512, 0xf513, 0xf514, 0xf515, 0xf516, 0xf517,
+ 0xf518, 0xf519, 0xf51a, 0xf51b, 0xf51c, 0xf51d, 0xf51e, 0xf51f,
+ 0xf520, 0xf521, 0xf522, 0xf523, 0xf524, 0xf525, 0xf526, 0xf527,
+ 0xf528, 0xf529, 0xf52a, 0xf52b, 0xf52c, 0xf52d, 0xf52e, 0xf52f,
+ 0xf530, 0xf531, 0xf532, 0xf533, 0xf534, 0xf535, 0xf536, 0xf537,
+ 0xf538, 0xf539, 0xf53a, 0xf53b, 0xf53c, 0xf53d, 0xf53e, 0xf53f,
+ 0xf540, 0xf541, 0xf542, 0xf543, 0xf544, 0xf545, 0xf546, 0xf547,
+ 0xf548, 0xf549, 0xf54a, 0xf54b, 0xf54c, 0xf54d, 0xf54e, 0xf54f,
+ 0xf550, 0xf551, 0xf552, 0xf553, 0xf554, 0xf555, 0xf556, 0xf557,
+ 0xf558, 0xf559, 0xf55a, 0xf55b, 0xf55c, 0xf55d, 0xf55e, 0xf55f,
+ 0xf560, 0xf561, 0xf562, 0xf563, 0xf564, 0xf565, 0xf566, 0xf567,
+ 0xf568, 0xf569, 0xf56a, 0xf56b, 0xf56c, 0xf56d, 0xf56e, 0xf56f,
+ 0xf570, 0xf571, 0xf572, 0xf573, 0xf574, 0xf575, 0xf576, 0xf577,
+ 0xf578, 0xf579, 0xf57a, 0xf57b, 0xf57c, 0xf57d, 0xf57e, 0xf57f,
+ 0xf580, 0xf581, 0xf582, 0xf583, 0xf584, 0xf585, 0xf586, 0xf587,
+ 0xf588, 0xf589, 0xf58a, 0xf58b, 0xf58c, 0xf58d, 0xf58e, 0xf58f,
+ 0xf590, 0xf591, 0xf592, 0xf593, 0xf594, 0xf595, 0xf596, 0xf597,
+ 0xf598, 0xf599, 0xf59a, 0xf59b, 0xf59c, 0xf59d, 0xf59e, 0xf59f,
+ 0xf5a0, 0xf5a1, 0xf5a2, 0xf5a3, 0xf5a4, 0xf5a5, 0xf5a6, 0xf5a7,
+ 0xf5a8, 0xf5a9, 0xf5aa, 0xf5ab, 0xf5ac, 0xf5ad, 0xf5ae, 0xf5af,
+ 0xf5b0, 0xf5b1, 0xf5b2, 0xf5b3, 0xf5b4, 0xf5b5, 0xf5b6, 0xf5b7,
+ 0xf5b8, 0xf5b9, 0xf5ba, 0xf5bb, 0xf5bc, 0xf5bd, 0xf5be, 0xf5bf,
+ 0xf5c0, 0xf5c1, 0xf5c2, 0xf5c3, 0xf5c4, 0xf5c5, 0xf5c6, 0xf5c7,
+ 0xf5c8, 0xf5c9, 0xf5ca, 0xf5cb, 0xf5cc, 0xf5cd, 0xf5ce, 0xf5cf,
+ 0xf5d0, 0xf5d1, 0xf5d2, 0xf5d3, 0xf5d4, 0xf5d5, 0xf5d6, 0xf5d7,
+ 0xf5d8, 0xf5d9, 0xf5da, 0xf5db, 0xf5dc, 0xf5dd, 0xf5de, 0xf5df,
+ 0xf5e0, 0xf5e1, 0xf5e2, 0xf5e3, 0xf5e4, 0xf5e5, 0xf5e6, 0xf5e7,
+ 0xf5e8, 0xf5e9, 0xf5ea, 0xf5eb, 0xf5ec, 0xf5ed, 0xf5ee, 0xf5ef,
+ 0xf5f0, 0xf5f1, 0xf5f2, 0xf5f3, 0xf5f4, 0xf5f5, 0xf5f6, 0xf5f7,
+ 0xf5f8, 0xf5f9, 0xf5fa, 0xf5fb, 0xf5fc, 0xf5fd, 0xf5fe, 0xf5ff,
+ 0xf600, 0xf601, 0xf602, 0xf603, 0xf604, 0xf605, 0xf606, 0xf607,
+ 0xf608, 0xf609, 0xf60a, 0xf60b, 0xf60c, 0xf60d, 0xf60e, 0xf60f,
+ 0xf610, 0xf611, 0xf612, 0xf613, 0xf614, 0xf615, 0xf616, 0xf617,
+ 0xf618, 0xf619, 0xf61a, 0xf61b, 0xf61c, 0xf61d, 0xf61e, 0xf61f,
+ 0xf620, 0xf621, 0xf622, 0xf623, 0xf624, 0xf625, 0xf626, 0xf627,
+ 0xf628, 0xf629, 0xf62a, 0xf62b, 0xf62c, 0xf62d, 0xf62e, 0xf62f,
+ 0xf630, 0xf631, 0xf632, 0xf633, 0xf634, 0xf635, 0xf636, 0xf637,
+ 0xf638, 0xf639, 0xf63a, 0xf63b, 0xf63c, 0xf63d, 0xf63e, 0xf63f,
+ 0xf640, 0xf641, 0xf642, 0xf643, 0xf644, 0xf645, 0xf646, 0xf647,
+ 0xf648, 0xf649, 0xf64a, 0xf64b, 0xf64c, 0xf64d, 0xf64e, 0xf64f,
+ 0xf650, 0xf651, 0xf652, 0xf653, 0xf654, 0xf655, 0xf656, 0xf657,
+ 0xf658, 0xf659, 0xf65a, 0xf65b, 0xf65c, 0xf65d, 0xf65e, 0xf65f,
+ 0xf660, 0xf661, 0xf662, 0xf663, 0xf664, 0xf665, 0xf666, 0xf667,
+ 0xf668, 0xf669, 0xf66a, 0xf66b, 0xf66c, 0xf66d, 0xf66e, 0xf66f,
+ 0xf670, 0xf671, 0xf672, 0xf673, 0xf674, 0xf675, 0xf676, 0xf677,
+ 0xf678, 0xf679, 0xf67a, 0xf67b, 0xf67c, 0xf67d, 0xf67e, 0xf67f,
+ 0xf680, 0xf681, 0xf682, 0xf683, 0xf684, 0xf685, 0xf686, 0xf687,
+ 0xf688, 0xf689, 0xf68a, 0xf68b, 0xf68c, 0xf68d, 0xf68e, 0xf68f,
+ 0xf690, 0xf691, 0xf692, 0xf693, 0xf694, 0xf695, 0xf696, 0xf697,
+ 0xf698, 0xf699, 0xf69a, 0xf69b, 0xf69c, 0xf69d, 0xf69e, 0xf69f,
+ 0xf6a0, 0xf6a1, 0xf6a2, 0xf6a3, 0xf6a4, 0xf6a5, 0xf6a6, 0xf6a7,
+ 0xf6a8, 0xf6a9, 0xf6aa, 0xf6ab, 0xf6ac, 0xf6ad, 0xf6ae, 0xf6af,
+ 0xf6b0, 0xf6b1, 0xf6b2, 0xf6b3, 0xf6b4, 0xf6b5, 0xf6b6, 0xf6b7,
+ 0xf6b8, 0xf6b9, 0xf6ba, 0xf6bb, 0xf6bc, 0xf6bd, 0xf6be, 0xf6bf,
+ 0xf6c0, 0xf6c1, 0xf6c2, 0xf6c3, 0xf6c4, 0xf6c5, 0xf6c6, 0xf6c7,
+ 0xf6c8, 0xf6c9, 0xf6ca, 0xf6cb, 0xf6cc, 0xf6cd, 0xf6ce, 0xf6cf,
+ 0xf6d0, 0xf6d1, 0xf6d2, 0xf6d3, 0xf6d4, 0xf6d5, 0xf6d6, 0xf6d7,
+ 0xf6d8, 0xf6d9, 0xf6da, 0xf6db, 0xf6dc, 0xf6dd, 0xf6de, 0xf6df,
+ 0xf6e0, 0xf6e1, 0xf6e2, 0xf6e3, 0xf6e4, 0xf6e5, 0xf6e6, 0xf6e7,
+ 0xf6e8, 0xf6e9, 0xf6ea, 0xf6eb, 0xf6ec, 0xf6ed, 0xf6ee, 0xf6ef,
+ 0xf6f0, 0xf6f1, 0xf6f2, 0xf6f3, 0xf6f4, 0xf6f5, 0xf6f6, 0xf6f7,
+ 0xf6f8, 0xf6f9, 0xf6fa, 0xf6fb, 0xf6fc, 0xf6fd, 0xf6fe, 0xf6ff,
+ 0xf700, 0xf701, 0xf702, 0xf703, 0xf704, 0xf705, 0xf706, 0xf707,
+ 0xf708, 0xf709, 0xf70a, 0xf70b, 0xf70c, 0xf70d, 0xf70e, 0xf70f,
+ 0xf710, 0xf711, 0xf712, 0xf713, 0xf714, 0xf715, 0xf716, 0xf717,
+ 0xf718, 0xf719, 0xf71a, 0xf71b, 0xf71c, 0xf71d, 0xf71e, 0xf71f,
+ 0xf720, 0xf721, 0xf722, 0xf723, 0xf724, 0xf725, 0xf726, 0xf727,
+ 0xf728, 0xf729, 0xf72a, 0xf72b, 0xf72c, 0xf72d, 0xf72e, 0xf72f,
+ 0xf730, 0xf731, 0xf732, 0xf733, 0xf734, 0xf735, 0xf736, 0xf737,
+ 0xf738, 0xf739, 0xf73a, 0xf73b, 0xf73c, 0xf73d, 0xf73e, 0xf73f,
+ 0xf740, 0xf741, 0xf742, 0xf743, 0xf744, 0xf745, 0xf746, 0xf747,
+ 0xf748, 0xf749, 0xf74a, 0xf74b, 0xf74c, 0xf74d, 0xf74e, 0xf74f,
+ 0xf750, 0xf751, 0xf752, 0xf753, 0xf754, 0xf755, 0xf756, 0xf757,
+ 0xf758, 0xf759, 0xf75a, 0xf75b, 0xf75c, 0xf75d, 0xf75e, 0xf75f,
+ 0xf760, 0xf761, 0xf762, 0xf763, 0xf764, 0xf765, 0xf766, 0xf767,
+ 0xf768, 0xf769, 0xf76a, 0xf76b, 0xf76c, 0xf76d, 0xf76e, 0xf76f,
+ 0xf770, 0xf771, 0xf772, 0xf773, 0xf774, 0xf775, 0xf776, 0xf777,
+ 0xf778, 0xf779, 0xf77a, 0xf77b, 0xf77c, 0xf77d, 0xf77e, 0xf77f,
+ 0xf780, 0xf781, 0xf782, 0xf783, 0xf784, 0xf785, 0xf786, 0xf787,
+ 0xf788, 0xf789, 0xf78a, 0xf78b, 0xf78c, 0xf78d, 0xf78e, 0xf78f,
+ 0xf790, 0xf791, 0xf792, 0xf793, 0xf794, 0xf795, 0xf796, 0xf797,
+ 0xf798, 0xf799, 0xf79a, 0xf79b, 0xf79c, 0xf79d, 0xf79e, 0xf79f,
+ 0xf7a0, 0xf7a1, 0xf7a2, 0xf7a3, 0xf7a4, 0xf7a5, 0xf7a6, 0xf7a7,
+ 0xf7a8, 0xf7a9, 0xf7aa, 0xf7ab, 0xf7ac, 0xf7ad, 0xf7ae, 0xf7af,
+ 0xf7b0, 0xf7b1, 0xf7b2, 0xf7b3, 0xf7b4, 0xf7b5, 0xf7b6, 0xf7b7,
+ 0xf7b8, 0xf7b9, 0xf7ba, 0xf7bb, 0xf7bc, 0xf7bd, 0xf7be, 0xf7bf,
+ 0xf7c0, 0xf7c1, 0xf7c2, 0xf7c3, 0xf7c4, 0xf7c5, 0xf7c6, 0xf7c7,
+ 0xf7c8, 0xf7c9, 0xf7ca, 0xf7cb, 0xf7cc, 0xf7cd, 0xf7ce, 0xf7cf,
+ 0xf7d0, 0xf7d1, 0xf7d2, 0xf7d3, 0xf7d4, 0xf7d5, 0xf7d6, 0xf7d7,
+ 0xf7d8, 0xf7d9, 0xf7da, 0xf7db, 0xf7dc, 0xf7dd, 0xf7de, 0xf7df,
+ 0xf7e0, 0xf7e1, 0xf7e2, 0xf7e3, 0xf7e4, 0xf7e5, 0xf7e6, 0xf7e7,
+ 0xf7e8, 0xf7e9, 0xf7ea, 0xf7eb, 0xf7ec, 0xf7ed, 0xf7ee, 0xf7ef,
+ 0xf7f0, 0xf7f1, 0xf7f2, 0xf7f3, 0xf7f4, 0xf7f5, 0xf7f6, 0xf7f7,
+ 0xf7f8, 0xf7f9, 0xf7fa, 0xf7fb, 0xf7fc, 0xf7fd, 0xf7fe, 0xf7ff,
+ 0xf800, 0xf801, 0xf802, 0xf803, 0xf804, 0xf805, 0xf806, 0xf807,
+ 0xf808, 0xf809, 0xf80a, 0xf80b, 0xf80c, 0xf80d, 0xf80e, 0xf80f,
+ 0xf810, 0xf811, 0xf812, 0xf813, 0xf814, 0xf815, 0xf816, 0xf817,
+ 0xf818, 0xf819, 0xf81a, 0xf81b, 0xf81c, 0xf81d, 0xf81e, 0xf81f,
+ 0xf820, 0xf821, 0xf822, 0xf823, 0xf824, 0xf825, 0xf826, 0xf827,
+ 0xf828, 0xf829, 0xf82a, 0xf82b, 0xf82c, 0xf82d, 0xf82e, 0xf82f,
+ 0xf830, 0xf831, 0xf832, 0xf833, 0xf834, 0xf835, 0xf836, 0xf837,
+ 0xf838, 0xf839, 0xf83a, 0xf83b, 0xf83c, 0xf83d, 0xf83e, 0xf83f,
+ 0xf840, 0xf841, 0xf842, 0xf843, 0xf844, 0xf845, 0xf846, 0xf847,
+ 0xf848, 0xf849, 0xf84a, 0xf84b, 0xf84c, 0xf84d, 0xf84e, 0xf84f,
+ 0xf850, 0xf851, 0xf852, 0xf853, 0xf854, 0xf855, 0xf856, 0xf857,
+ 0xf858, 0xf859, 0xf85a, 0xf85b, 0xf85c, 0xf85d, 0xf85e, 0xf85f,
+ 0xf860, 0xf861, 0xf862, 0xf863, 0xf864, 0xf865, 0xf866, 0xf867,
+ 0xf868, 0xf869, 0xf86a, 0xf86b, 0xf86c, 0xf86d, 0xf86e, 0xf86f,
+ 0xf870, 0xf871, 0xf872, 0xf873, 0xf874, 0xf875, 0xf876, 0xf877,
+ 0xf878, 0xf879, 0xf87a, 0xf87b, 0xf87c, 0xf87d, 0xf87e, 0xf87f,
+ 0xf880, 0xf881, 0xf882, 0xf883, 0xf884, 0xf885, 0xf886, 0xf887,
+ 0xf888, 0xf889, 0xf88a, 0xf88b, 0xf88c, 0xf88d, 0xf88e, 0xf88f,
+ 0xf890, 0xf891, 0xf892, 0xf893, 0xf894, 0xf895, 0xf896, 0xf897,
+ 0xf898, 0xf899, 0xf89a, 0xf89b, 0xf89c, 0xf89d, 0xf89e, 0xf89f,
+ 0xf8a0, 0xf8a1, 0xf8a2, 0xf8a3, 0xf8a4, 0xf8a5, 0xf8a6, 0xf8a7,
+ 0xf8a8, 0xf8a9, 0xf8aa, 0xf8ab, 0xf8ac, 0xf8ad, 0xf8ae, 0xf8af,
+ 0xf8b0, 0xf8b1, 0xf8b2, 0xf8b3, 0xf8b4, 0xf8b5, 0xf8b6, 0xf8b7,
+ 0xf8b8, 0xf8b9, 0xf8ba, 0xf8bb, 0xf8bc, 0xf8bd, 0xf8be, 0xf8bf,
+ 0xf8c0, 0xf8c1, 0xf8c2, 0xf8c3, 0xf8c4, 0xf8c5, 0xf8c6, 0xf8c7,
+ 0xf8c8, 0xf8c9, 0xf8ca, 0xf8cb, 0xf8cc, 0xf8cd, 0xf8ce, 0xf8cf,
+ 0xf8d0, 0xf8d1, 0xf8d2, 0xf8d3, 0xf8d4, 0xf8d5, 0xf8d6, 0xf8d7,
+ 0xf8d8, 0xf8d9, 0xf8da, 0xf8db, 0xf8dc, 0xf8dd, 0xf8de, 0xf8df,
+ 0xf8e0, 0xf8e1, 0xf8e2, 0xf8e3, 0xf8e4, 0xf8e5, 0xf8e6, 0xf8e7,
+ 0xf8e8, 0xf8e9, 0xf8ea, 0xf8eb, 0xf8ec, 0xf8ed, 0xf8ee, 0xf8ef,
+ 0xf8f0, 0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4, 0xf8f5, 0xf8f6, 0xf8f7,
+ 0xf8f8, 0xf8f9, 0xf8fa, 0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0xf8ff,
+ 0xf900, 0xf901, 0xf902, 0xf903, 0xf904, 0xf905, 0xf906, 0xf907,
+ 0xf908, 0xf909, 0xf90a, 0xf90b, 0xf90c, 0xf90d, 0xf90e, 0xf90f,
+ 0xf910, 0xf911, 0xf912, 0xf913, 0xf914, 0xf915, 0xf916, 0xf917,
+ 0xf918, 0xf919, 0xf91a, 0xf91b, 0xf91c, 0xf91d, 0xf91e, 0xf91f,
+ 0xf920, 0xf921, 0xf922, 0xf923, 0xf924, 0xf925, 0xf926, 0xf927,
+ 0xf928, 0xf929, 0xf92a, 0xf92b, 0xf92c, 0xf92d, 0xf92e, 0xf92f,
+ 0xf930, 0xf931, 0xf932, 0xf933, 0xf934, 0xf935, 0xf936, 0xf937,
+ 0xf938, 0xf939, 0xf93a, 0xf93b, 0xf93c, 0xf93d, 0xf93e, 0xf93f,
+ 0xf940, 0xf941, 0xf942, 0xf943, 0xf944, 0xf945, 0xf946, 0xf947,
+ 0xf948, 0xf949, 0xf94a, 0xf94b, 0xf94c, 0xf94d, 0xf94e, 0xf94f,
+ 0xf950, 0xf951, 0xf952, 0xf953, 0xf954, 0xf955, 0xf956, 0xf957,
+ 0xf958, 0xf959, 0xf95a, 0xf95b, 0xf95c, 0xf95d, 0xf95e, 0xf95f,
+ 0xf960, 0xf961, 0xf962, 0xf963, 0xf964, 0xf965, 0xf966, 0xf967,
+ 0xf968, 0xf969, 0xf96a, 0xf96b, 0xf96c, 0xf96d, 0xf96e, 0xf96f,
+ 0xf970, 0xf971, 0xf972, 0xf973, 0xf974, 0xf975, 0xf976, 0xf977,
+ 0xf978, 0xf979, 0xf97a, 0xf97b, 0xf97c, 0xf97d, 0xf97e, 0xf97f,
+ 0xf980, 0xf981, 0xf982, 0xf983, 0xf984, 0xf985, 0xf986, 0xf987,
+ 0xf988, 0xf989, 0xf98a, 0xf98b, 0xf98c, 0xf98d, 0xf98e, 0xf98f,
+ 0xf990, 0xf991, 0xf992, 0xf993, 0xf994, 0xf995, 0xf996, 0xf997,
+ 0xf998, 0xf999, 0xf99a, 0xf99b, 0xf99c, 0xf99d, 0xf99e, 0xf99f,
+ 0xf9a0, 0xf9a1, 0xf9a2, 0xf9a3, 0xf9a4, 0xf9a5, 0xf9a6, 0xf9a7,
+ 0xf9a8, 0xf9a9, 0xf9aa, 0xf9ab, 0xf9ac, 0xf9ad, 0xf9ae, 0xf9af,
+ 0xf9b0, 0xf9b1, 0xf9b2, 0xf9b3, 0xf9b4, 0xf9b5, 0xf9b6, 0xf9b7,
+ 0xf9b8, 0xf9b9, 0xf9ba, 0xf9bb, 0xf9bc, 0xf9bd, 0xf9be, 0xf9bf,
+ 0xf9c0, 0xf9c1, 0xf9c2, 0xf9c3, 0xf9c4, 0xf9c5, 0xf9c6, 0xf9c7,
+ 0xf9c8, 0xf9c9, 0xf9ca, 0xf9cb, 0xf9cc, 0xf9cd, 0xf9ce, 0xf9cf,
+ 0xf9d0, 0xf9d1, 0xf9d2, 0xf9d3, 0xf9d4, 0xf9d5, 0xf9d6, 0xf9d7,
+ 0xf9d8, 0xf9d9, 0xf9da, 0xf9db, 0xf9dc, 0xf9dd, 0xf9de, 0xf9df,
+ 0xf9e0, 0xf9e1, 0xf9e2, 0xf9e3, 0xf9e4, 0xf9e5, 0xf9e6, 0xf9e7,
+ 0xf9e8, 0xf9e9, 0xf9ea, 0xf9eb, 0xf9ec, 0xf9ed, 0xf9ee, 0xf9ef,
+ 0xf9f0, 0xf9f1, 0xf9f2, 0xf9f3, 0xf9f4, 0xf9f5, 0xf9f6, 0xf9f7,
+ 0xf9f8, 0xf9f9, 0xf9fa, 0xf9fb, 0xf9fc, 0xf9fd, 0xf9fe, 0xf9ff,
+ 0xfa00, 0xfa01, 0xfa02, 0xfa03, 0xfa04, 0xfa05, 0xfa06, 0xfa07,
+ 0xfa08, 0xfa09, 0xfa0a, 0xfa0b, 0xfa0c, 0xfa0d, 0xfa0e, 0xfa0f,
+ 0xfa10, 0xfa11, 0xfa12, 0xfa13, 0xfa14, 0xfa15, 0xfa16, 0xfa17,
+ 0xfa18, 0xfa19, 0xfa1a, 0xfa1b, 0xfa1c, 0xfa1d, 0xfa1e, 0xfa1f,
+ 0xfa20, 0xfa21, 0xfa22, 0xfa23, 0xfa24, 0xfa25, 0xfa26, 0xfa27,
+ 0xfa28, 0xfa29, 0xfa2a, 0xfa2b, 0xfa2c, 0xfa2d, 0x0000, 0x0000,
+ 0xfa30, 0xfa31, 0xfa32, 0xfa33, 0xfa34, 0xfa35, 0xfa36, 0xfa37,
+ 0xfa38, 0xfa39, 0xfa3a, 0xfa3b, 0xfa3c, 0xfa3d, 0xfa3e, 0xfa3f,
+ 0xfa40, 0xfa41, 0xfa42, 0xfa43, 0xfa44, 0xfa45, 0xfa46, 0xfa47,
+ 0xfa48, 0xfa49, 0xfa4a, 0xfa4b, 0xfa4c, 0xfa4d, 0xfa4e, 0xfa4f,
+ 0xfa50, 0xfa51, 0xfa52, 0xfa53, 0xfa54, 0xfa55, 0xfa56, 0xfa57,
+ 0xfa58, 0xfa59, 0xfa5a, 0xfa5b, 0xfa5c, 0xfa5d, 0xfa5e, 0xfa5f,
+ 0xfa60, 0xfa61, 0xfa62, 0xfa63, 0xfa64, 0xfa65, 0xfa66, 0xfa67,
+ 0xfa68, 0xfa69, 0xfa6a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfa70, 0xfa71, 0xfa72, 0xfa73, 0xfa74, 0xfa75, 0xfa76, 0xfa77,
+ 0xfa78, 0xfa79, 0xfa7a, 0xfa7b, 0xfa7c, 0xfa7d, 0xfa7e, 0xfa7f,
+ 0xfa80, 0xfa81, 0xfa82, 0xfa83, 0xfa84, 0xfa85, 0xfa86, 0xfa87,
+ 0xfa88, 0xfa89, 0xfa8a, 0xfa8b, 0xfa8c, 0xfa8d, 0xfa8e, 0xfa8f,
+ 0xfa90, 0xfa91, 0xfa92, 0xfa93, 0xfa94, 0xfa95, 0xfa96, 0xfa97,
+ 0xfa98, 0xfa99, 0xfa9a, 0xfa9b, 0xfa9c, 0xfa9d, 0xfa9e, 0xfa9f,
+ 0xfaa0, 0xfaa1, 0xfaa2, 0xfaa3, 0xfaa4, 0xfaa5, 0xfaa6, 0xfaa7,
+ 0xfaa8, 0xfaa9, 0xfaaa, 0xfaab, 0xfaac, 0xfaad, 0xfaae, 0xfaaf,
+ 0xfab0, 0xfab1, 0xfab2, 0xfab3, 0xfab4, 0xfab5, 0xfab6, 0xfab7,
+ 0xfab8, 0xfab9, 0xfaba, 0xfabb, 0xfabc, 0xfabd, 0xfabe, 0xfabf,
+ 0xfac0, 0xfac1, 0xfac2, 0xfac3, 0xfac4, 0xfac5, 0xfac6, 0xfac7,
+ 0xfac8, 0xfac9, 0xfaca, 0xfacb, 0xfacc, 0xfacd, 0xface, 0xfacf,
+ 0xfad0, 0xfad1, 0xfad2, 0xfad3, 0xfad4, 0xfad5, 0xfad6, 0xfad7,
+ 0xfad8, 0xfad9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfb00, 0xfb01, 0xfb02, 0xfb03, 0xfb04, 0xfb05, 0xfb06, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0xfb13, 0xfb14, 0xfb15, 0xfb16, 0xfb17,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfb1d, 0xfb1e, 0xfb1f,
+ 0xfb20, 0xfb21, 0xfb22, 0xfb23, 0xfb24, 0xfb25, 0xfb26, 0xfb27,
+ 0xfb28, 0xfb29, 0xfb2a, 0xfb2b, 0xfb2c, 0xfb2d, 0xfb2e, 0xfb2f,
+ 0xfb30, 0xfb31, 0xfb32, 0xfb33, 0xfb34, 0xfb35, 0xfb36, 0x0000,
+ 0xfb38, 0xfb39, 0xfb3a, 0xfb3b, 0xfb3c, 0x0000, 0xfb3e, 0x0000,
+ 0xfb40, 0xfb41, 0x0000, 0xfb43, 0xfb44, 0x0000, 0xfb46, 0xfb47,
+ 0xfb48, 0xfb49, 0xfb4a, 0xfb4b, 0xfb4c, 0xfb4d, 0xfb4e, 0xfb4f,
+ 0xfb50, 0xfb51, 0xfb52, 0xfb53, 0xfb54, 0xfb55, 0xfb56, 0xfb57,
+ 0xfb58, 0xfb59, 0xfb5a, 0xfb5b, 0xfb5c, 0xfb5d, 0xfb5e, 0xfb5f,
+ 0xfb60, 0xfb61, 0xfb62, 0xfb63, 0xfb64, 0xfb65, 0xfb66, 0xfb67,
+ 0xfb68, 0xfb69, 0xfb6a, 0xfb6b, 0xfb6c, 0xfb6d, 0xfb6e, 0xfb6f,
+ 0xfb70, 0xfb71, 0xfb72, 0xfb73, 0xfb74, 0xfb75, 0xfb76, 0xfb77,
+ 0xfb78, 0xfb79, 0xfb7a, 0xfb7b, 0xfb7c, 0xfb7d, 0xfb7e, 0xfb7f,
+ 0xfb80, 0xfb81, 0xfb82, 0xfb83, 0xfb84, 0xfb85, 0xfb86, 0xfb87,
+ 0xfb88, 0xfb89, 0xfb8a, 0xfb8b, 0xfb8c, 0xfb8d, 0xfb8e, 0xfb8f,
+ 0xfb90, 0xfb91, 0xfb92, 0xfb93, 0xfb94, 0xfb95, 0xfb96, 0xfb97,
+ 0xfb98, 0xfb99, 0xfb9a, 0xfb9b, 0xfb9c, 0xfb9d, 0xfb9e, 0xfb9f,
+ 0xfba0, 0xfba1, 0xfba2, 0xfba3, 0xfba4, 0xfba5, 0xfba6, 0xfba7,
+ 0xfba8, 0xfba9, 0xfbaa, 0xfbab, 0xfbac, 0xfbad, 0xfbae, 0xfbaf,
+ 0xfbb0, 0xfbb1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0xfbd3, 0xfbd4, 0xfbd5, 0xfbd6, 0xfbd7,
+ 0xfbd8, 0xfbd9, 0xfbda, 0xfbdb, 0xfbdc, 0xfbdd, 0xfbde, 0xfbdf,
+ 0xfbe0, 0xfbe1, 0xfbe2, 0xfbe3, 0xfbe4, 0xfbe5, 0xfbe6, 0xfbe7,
+ 0xfbe8, 0xfbe9, 0xfbea, 0xfbeb, 0xfbec, 0xfbed, 0xfbee, 0xfbef,
+ 0xfbf0, 0xfbf1, 0xfbf2, 0xfbf3, 0xfbf4, 0xfbf5, 0xfbf6, 0xfbf7,
+ 0xfbf8, 0xfbf9, 0xfbfa, 0xfbfb, 0xfbfc, 0xfbfd, 0xfbfe, 0xfbff,
+ 0xfc00, 0xfc01, 0xfc02, 0xfc03, 0xfc04, 0xfc05, 0xfc06, 0xfc07,
+ 0xfc08, 0xfc09, 0xfc0a, 0xfc0b, 0xfc0c, 0xfc0d, 0xfc0e, 0xfc0f,
+ 0xfc10, 0xfc11, 0xfc12, 0xfc13, 0xfc14, 0xfc15, 0xfc16, 0xfc17,
+ 0xfc18, 0xfc19, 0xfc1a, 0xfc1b, 0xfc1c, 0xfc1d, 0xfc1e, 0xfc1f,
+ 0xfc20, 0xfc21, 0xfc22, 0xfc23, 0xfc24, 0xfc25, 0xfc26, 0xfc27,
+ 0xfc28, 0xfc29, 0xfc2a, 0xfc2b, 0xfc2c, 0xfc2d, 0xfc2e, 0xfc2f,
+ 0xfc30, 0xfc31, 0xfc32, 0xfc33, 0xfc34, 0xfc35, 0xfc36, 0xfc37,
+ 0xfc38, 0xfc39, 0xfc3a, 0xfc3b, 0xfc3c, 0xfc3d, 0xfc3e, 0xfc3f,
+ 0xfc40, 0xfc41, 0xfc42, 0xfc43, 0xfc44, 0xfc45, 0xfc46, 0xfc47,
+ 0xfc48, 0xfc49, 0xfc4a, 0xfc4b, 0xfc4c, 0xfc4d, 0xfc4e, 0xfc4f,
+ 0xfc50, 0xfc51, 0xfc52, 0xfc53, 0xfc54, 0xfc55, 0xfc56, 0xfc57,
+ 0xfc58, 0xfc59, 0xfc5a, 0xfc5b, 0xfc5c, 0xfc5d, 0xfc5e, 0xfc5f,
+ 0xfc60, 0xfc61, 0xfc62, 0xfc63, 0xfc64, 0xfc65, 0xfc66, 0xfc67,
+ 0xfc68, 0xfc69, 0xfc6a, 0xfc6b, 0xfc6c, 0xfc6d, 0xfc6e, 0xfc6f,
+ 0xfc70, 0xfc71, 0xfc72, 0xfc73, 0xfc74, 0xfc75, 0xfc76, 0xfc77,
+ 0xfc78, 0xfc79, 0xfc7a, 0xfc7b, 0xfc7c, 0xfc7d, 0xfc7e, 0xfc7f,
+ 0xfc80, 0xfc81, 0xfc82, 0xfc83, 0xfc84, 0xfc85, 0xfc86, 0xfc87,
+ 0xfc88, 0xfc89, 0xfc8a, 0xfc8b, 0xfc8c, 0xfc8d, 0xfc8e, 0xfc8f,
+ 0xfc90, 0xfc91, 0xfc92, 0xfc93, 0xfc94, 0xfc95, 0xfc96, 0xfc97,
+ 0xfc98, 0xfc99, 0xfc9a, 0xfc9b, 0xfc9c, 0xfc9d, 0xfc9e, 0xfc9f,
+ 0xfca0, 0xfca1, 0xfca2, 0xfca3, 0xfca4, 0xfca5, 0xfca6, 0xfca7,
+ 0xfca8, 0xfca9, 0xfcaa, 0xfcab, 0xfcac, 0xfcad, 0xfcae, 0xfcaf,
+ 0xfcb0, 0xfcb1, 0xfcb2, 0xfcb3, 0xfcb4, 0xfcb5, 0xfcb6, 0xfcb7,
+ 0xfcb8, 0xfcb9, 0xfcba, 0xfcbb, 0xfcbc, 0xfcbd, 0xfcbe, 0xfcbf,
+ 0xfcc0, 0xfcc1, 0xfcc2, 0xfcc3, 0xfcc4, 0xfcc5, 0xfcc6, 0xfcc7,
+ 0xfcc8, 0xfcc9, 0xfcca, 0xfccb, 0xfccc, 0xfccd, 0xfcce, 0xfccf,
+ 0xfcd0, 0xfcd1, 0xfcd2, 0xfcd3, 0xfcd4, 0xfcd5, 0xfcd6, 0xfcd7,
+ 0xfcd8, 0xfcd9, 0xfcda, 0xfcdb, 0xfcdc, 0xfcdd, 0xfcde, 0xfcdf,
+ 0xfce0, 0xfce1, 0xfce2, 0xfce3, 0xfce4, 0xfce5, 0xfce6, 0xfce7,
+ 0xfce8, 0xfce9, 0xfcea, 0xfceb, 0xfcec, 0xfced, 0xfcee, 0xfcef,
+ 0xfcf0, 0xfcf1, 0xfcf2, 0xfcf3, 0xfcf4, 0xfcf5, 0xfcf6, 0xfcf7,
+ 0xfcf8, 0xfcf9, 0xfcfa, 0xfcfb, 0xfcfc, 0xfcfd, 0xfcfe, 0xfcff,
+ 0xfd00, 0xfd01, 0xfd02, 0xfd03, 0xfd04, 0xfd05, 0xfd06, 0xfd07,
+ 0xfd08, 0xfd09, 0xfd0a, 0xfd0b, 0xfd0c, 0xfd0d, 0xfd0e, 0xfd0f,
+ 0xfd10, 0xfd11, 0xfd12, 0xfd13, 0xfd14, 0xfd15, 0xfd16, 0xfd17,
+ 0xfd18, 0xfd19, 0xfd1a, 0xfd1b, 0xfd1c, 0xfd1d, 0xfd1e, 0xfd1f,
+ 0xfd20, 0xfd21, 0xfd22, 0xfd23, 0xfd24, 0xfd25, 0xfd26, 0xfd27,
+ 0xfd28, 0xfd29, 0xfd2a, 0xfd2b, 0xfd2c, 0xfd2d, 0xfd2e, 0xfd2f,
+ 0xfd30, 0xfd31, 0xfd32, 0xfd33, 0xfd34, 0xfd35, 0xfd36, 0xfd37,
+ 0xfd38, 0xfd39, 0xfd3a, 0xfd3b, 0xfd3c, 0xfd3d, 0xfd3e, 0xfd3f,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfd50, 0xfd51, 0xfd52, 0xfd53, 0xfd54, 0xfd55, 0xfd56, 0xfd57,
+ 0xfd58, 0xfd59, 0xfd5a, 0xfd5b, 0xfd5c, 0xfd5d, 0xfd5e, 0xfd5f,
+ 0xfd60, 0xfd61, 0xfd62, 0xfd63, 0xfd64, 0xfd65, 0xfd66, 0xfd67,
+ 0xfd68, 0xfd69, 0xfd6a, 0xfd6b, 0xfd6c, 0xfd6d, 0xfd6e, 0xfd6f,
+ 0xfd70, 0xfd71, 0xfd72, 0xfd73, 0xfd74, 0xfd75, 0xfd76, 0xfd77,
+ 0xfd78, 0xfd79, 0xfd7a, 0xfd7b, 0xfd7c, 0xfd7d, 0xfd7e, 0xfd7f,
+ 0xfd80, 0xfd81, 0xfd82, 0xfd83, 0xfd84, 0xfd85, 0xfd86, 0xfd87,
+ 0xfd88, 0xfd89, 0xfd8a, 0xfd8b, 0xfd8c, 0xfd8d, 0xfd8e, 0xfd8f,
+ 0x0000, 0x0000, 0xfd92, 0xfd93, 0xfd94, 0xfd95, 0xfd96, 0xfd97,
+ 0xfd98, 0xfd99, 0xfd9a, 0xfd9b, 0xfd9c, 0xfd9d, 0xfd9e, 0xfd9f,
+ 0xfda0, 0xfda1, 0xfda2, 0xfda3, 0xfda4, 0xfda5, 0xfda6, 0xfda7,
+ 0xfda8, 0xfda9, 0xfdaa, 0xfdab, 0xfdac, 0xfdad, 0xfdae, 0xfdaf,
+ 0xfdb0, 0xfdb1, 0xfdb2, 0xfdb3, 0xfdb4, 0xfdb5, 0xfdb6, 0xfdb7,
+ 0xfdb8, 0xfdb9, 0xfdba, 0xfdbb, 0xfdbc, 0xfdbd, 0xfdbe, 0xfdbf,
+ 0xfdc0, 0xfdc1, 0xfdc2, 0xfdc3, 0xfdc4, 0xfdc5, 0xfdc6, 0xfdc7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfdf0, 0xfdf1, 0xfdf2, 0xfdf3, 0xfdf4, 0xfdf5, 0xfdf6, 0xfdf7,
+ 0xfdf8, 0xfdf9, 0xfdfa, 0xfdfb, 0xfdfc, 0xfdfd, 0x0000, 0x0000,
+ 0xfe00, 0xfe01, 0xfe02, 0xfe03, 0xfe04, 0xfe05, 0xfe06, 0xfe07,
+ 0xfe08, 0xfe09, 0xfe0a, 0xfe0b, 0xfe0c, 0xfe0d, 0xfe0e, 0xfe0f,
+ 0xfe10, 0xfe11, 0xfe12, 0xfe13, 0xfe14, 0xfe15, 0xfe16, 0xfe17,
+ 0xfe18, 0xfe19, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfe20, 0xfe21, 0xfe22, 0xfe23, 0xfe24, 0xfe25, 0xfe26, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfe30, 0xfe31, 0xfe32, 0xfe33, 0xfe34, 0xfe35, 0xfe36, 0xfe37,
+ 0xfe38, 0xfe39, 0xfe3a, 0xfe3b, 0xfe3c, 0xfe3d, 0xfe3e, 0xfe3f,
+ 0xfe40, 0xfe41, 0xfe42, 0xfe43, 0xfe44, 0xfe45, 0xfe46, 0xfe47,
+ 0xfe48, 0xfe49, 0xfe4a, 0xfe4b, 0xfe4c, 0xfe4d, 0xfe4e, 0xfe4f,
+ 0xfe50, 0xfe51, 0xfe52, 0x0000, 0xfe54, 0xfe55, 0xfe56, 0xfe57,
+ 0xfe58, 0xfe59, 0xfe5a, 0xfe5b, 0xfe5c, 0xfe5d, 0xfe5e, 0xfe5f,
+ 0xfe60, 0xfe61, 0xfe62, 0xfe63, 0xfe64, 0xfe65, 0xfe66, 0x0000,
+ 0xfe68, 0xfe69, 0xfe6a, 0xfe6b, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0xfe70, 0xfe71, 0xfe72, 0xfe73, 0xfe74, 0x0000, 0xfe76, 0xfe77,
+ 0xfe78, 0xfe79, 0xfe7a, 0xfe7b, 0xfe7c, 0xfe7d, 0xfe7e, 0xfe7f,
+ 0xfe80, 0xfe81, 0xfe82, 0xfe83, 0xfe84, 0xfe85, 0xfe86, 0xfe87,
+ 0xfe88, 0xfe89, 0xfe8a, 0xfe8b, 0xfe8c, 0xfe8d, 0xfe8e, 0xfe8f,
+ 0xfe90, 0xfe91, 0xfe92, 0xfe93, 0xfe94, 0xfe95, 0xfe96, 0xfe97,
+ 0xfe98, 0xfe99, 0xfe9a, 0xfe9b, 0xfe9c, 0xfe9d, 0xfe9e, 0xfe9f,
+ 0xfea0, 0xfea1, 0xfea2, 0xfea3, 0xfea4, 0xfea5, 0xfea6, 0xfea7,
+ 0xfea8, 0xfea9, 0xfeaa, 0xfeab, 0xfeac, 0xfead, 0xfeae, 0xfeaf,
+ 0xfeb0, 0xfeb1, 0xfeb2, 0xfeb3, 0xfeb4, 0xfeb5, 0xfeb6, 0xfeb7,
+ 0xfeb8, 0xfeb9, 0xfeba, 0xfebb, 0xfebc, 0xfebd, 0xfebe, 0xfebf,
+ 0xfec0, 0xfec1, 0xfec2, 0xfec3, 0xfec4, 0xfec5, 0xfec6, 0xfec7,
+ 0xfec8, 0xfec9, 0xfeca, 0xfecb, 0xfecc, 0xfecd, 0xfece, 0xfecf,
+ 0xfed0, 0xfed1, 0xfed2, 0xfed3, 0xfed4, 0xfed5, 0xfed6, 0xfed7,
+ 0xfed8, 0xfed9, 0xfeda, 0xfedb, 0xfedc, 0xfedd, 0xfede, 0xfedf,
+ 0xfee0, 0xfee1, 0xfee2, 0xfee3, 0xfee4, 0xfee5, 0xfee6, 0xfee7,
+ 0xfee8, 0xfee9, 0xfeea, 0xfeeb, 0xfeec, 0xfeed, 0xfeee, 0xfeef,
+ 0xfef0, 0xfef1, 0xfef2, 0xfef3, 0xfef4, 0xfef5, 0xfef6, 0xfef7,
+ 0xfef8, 0xfef9, 0xfefa, 0xfefb, 0xfefc, 0x0000, 0x0000, 0xfeff,
+ 0x0000, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07,
+ 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f,
+ 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17,
+ 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f,
+ 0xff20, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
+ 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f,
+ 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37,
+ 0xff38, 0xff39, 0xff3a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f,
+ 0xff40, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
+ 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f,
+ 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37,
+ 0xff38, 0xff39, 0xff3a, 0xff5b, 0xff5c, 0xff5d, 0xff5e, 0xff5f,
+ 0xff60, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67,
+ 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
+ 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77,
+ 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f,
+ 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87,
+ 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f,
+ 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97,
+ 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f,
+ 0xffa0, 0xffa1, 0xffa2, 0xffa3, 0xffa4, 0xffa5, 0xffa6, 0xffa7,
+ 0xffa8, 0xffa9, 0xffaa, 0xffab, 0xffac, 0xffad, 0xffae, 0xffaf,
+ 0xffb0, 0xffb1, 0xffb2, 0xffb3, 0xffb4, 0xffb5, 0xffb6, 0xffb7,
+ 0xffb8, 0xffb9, 0xffba, 0xffbb, 0xffbc, 0xffbd, 0xffbe, 0x0000,
+ 0x0000, 0x0000, 0xffc2, 0xffc3, 0xffc4, 0xffc5, 0xffc6, 0xffc7,
+ 0x0000, 0x0000, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf,
+ 0x0000, 0x0000, 0xffd2, 0xffd3, 0xffd4, 0xffd5, 0xffd6, 0xffd7,
+ 0x0000, 0x0000, 0xffda, 0xffdb, 0xffdc, 0x0000, 0x0000, 0x0000,
+ 0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe4, 0xffe5, 0xffe6, 0x0000,
+ 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec, 0xffed, 0xffee, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd, 0x0000, 0x0000
+};
+#endif
+
+const unsigned int ____utype[] = { 0,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00020010, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00020010, 0x00000020, 0x00000000, 0x00004000, 0x00004000, 0x00004000, 0x00000000, 0x00000000,
+ 0x00080000, 0x00040000, 0x00000000, 0x00001000, 0x00002020, 0x00021000, 0x00002020, 0x00102000,
+ 0x00000448, 0x00000448, 0x00000448, 0x00000448, 0x00000448, 0x00000448, 0x00000448, 0x00000448,
+ 0x00000448, 0x00000448, 0x00002020, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000020,
+ 0x00000000, 0x00200142, 0x00200142, 0x00200142, 0x00200142, 0x00200142, 0x00200142, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00080000, 0x00000000, 0x00040000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00200141, 0x00200141, 0x00200141, 0x00200141, 0x00200141, 0x00200141, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00080000, 0x00020000, 0x00040000, 0x00000000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00000010, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x180c2010, 0x00080000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00000000, 0x00000000,
+ 0x10000000, 0x00000000, 0x10200101, 0x00000000, 0x00000000, 0x00020000, 0x00000000, 0x10000000,
+ 0x00004000, 0x00004000, 0x10000400, 0x10000400, 0x10010000, 0x10200101, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000400, 0x10200101, 0x00000000, 0x10000000, 0x10000000, 0x10000000, 0x00080000,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00200102, 0x10200102,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102,
+ 0x00200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00000000,
+ 0x00200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00200102, 0x00200101,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00200101, 0x10200101,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x00200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00000000,
+ 0x00200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00200101, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x00200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200102, 0x00200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102,
+ 0x10200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102,
+ 0x10200101, 0x10200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200102, 0x00200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200101,
+ 0x00200101, 0x00200102, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200102,
+ 0x00200101, 0x00200102, 0x00200102, 0x00200102, 0x00200101, 0x00200101, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200101, 0x00200102, 0x00200102, 0x00200101, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200101, 0x00200101, 0x00200101, 0x00200102, 0x00200102, 0x00200101, 0x00200102,
+ 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200102,
+ 0x00200101, 0x00200102, 0x00200101, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x10200102,
+ 0x10200101, 0x00200102, 0x00200102, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102,
+ 0x00200102, 0x00200101, 0x00200101, 0x00200100, 0x00200102, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x10200102, 0x10200104, 0x10200101, 0x10200102,
+ 0x10200104, 0x10200101, 0x10200102, 0x10200104, 0x10200101, 0x10200102, 0x10200101, 0x10200102,
+ 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102,
+ 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200101, 0x10200102, 0x10200104, 0x10200101, 0x10200102, 0x10200101, 0x00200102, 0x00200102,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200102, 0x00200102, 0x00200101, 0x00200102, 0x00200102, 0x00200101,
+ 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200100, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x00000000, 0x00000000, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000100, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x00000000, 0x00010000,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x10088000, 0x10088000, 0x00088000, 0x10088000, 0x10088000, 0x00288000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x000c8000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x000c0000, 0x000c8000, 0x000c8000, 0x000c8000,
+ 0x000c8000, 0x000c8000, 0x000c8000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x10000000, 0x00000000, 0x00200102, 0x00200101,
+ 0x00000000, 0x00000000, 0x10000100, 0x00200101, 0x00200101, 0x00200101, 0x10000020, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10200102, 0x10000020,
+ 0x10200102, 0x10200102, 0x10200102, 0x00000000, 0x10200102, 0x00000000, 0x10200102, 0x10200102,
+ 0x10200101, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00000000, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x10200102, 0x10200102, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00200102,
+ 0x10200101, 0x10200101, 0x10200102, 0x10200102, 0x10200102, 0x10200101, 0x10200101, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x10200101, 0x10200101, 0x10200101, 0x00200101, 0x10200102, 0x10200101, 0x00000000, 0x00200102,
+ 0x00200101, 0x10200102, 0x00200102, 0x00200101, 0x00200101, 0x00200102, 0x00200102, 0x00200102,
+ 0x10200102, 0x10200102, 0x00200102, 0x10200102, 0x00200102, 0x00200102, 0x00200102, 0x10200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x10200102, 0x10200102, 0x10200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x10200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x10200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x10200101, 0x10200101, 0x00200101, 0x10200101, 0x00200101, 0x00200101, 0x00200101, 0x10200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x10200101, 0x10200101, 0x10200101, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00000100, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00080000, 0x00080000, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102,
+ 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x10200102, 0x10200101,
+ 0x00200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x00200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x00200102, 0x00200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x00200102, 0x00200101,
+ 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00000000,
+ 0x00000000, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000000, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x10200101,
+ 0x00000000, 0x00000120, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00020200, 0x00280000,
+ 0x00000200, 0x00280000, 0x00280000, 0x00000220, 0x00280000, 0x00280000, 0x00000200, 0x00280000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200200, 0x00200200, 0x00200200, 0x00000200, 0x00000200, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000800, 0x00000800, 0x00000800, 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000200, 0x00004000, 0x00004000, 0x00000200, 0x00002020, 0x00000200, 0x00000000, 0x00000000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00000220, 0x00000000, 0x00000000, 0x00000200, 0x00000220,
+ 0x00000000, 0x00200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00000200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00080000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00000000,
+ 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808, 0x00000808,
+ 0x00000808, 0x00000808, 0x00004000, 0x00000800, 0x00000800, 0x00000200, 0x00200200, 0x00200200,
+ 0x00280000, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x10200200, 0x10200200, 0x10200200,
+ 0x10200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x10200200, 0x00200200, 0x10200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x10200200, 0x00000220, 0x00200200, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00000800, 0x00080000, 0x00080000,
+ 0x00080000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00000200, 0x00000200, 0x00280000,
+ 0x00280000, 0x00000000, 0x00080000, 0x00080000, 0x00080000, 0x00280000, 0x00200200, 0x00200200,
+ 0x00000408, 0x00000408, 0x00000408, 0x00000408, 0x00000408, 0x00000408, 0x00000408, 0x00000408,
+ 0x00000408, 0x00000408, 0x00200200, 0x00200200, 0x00200200, 0x00000200, 0x00000200, 0x00200200,
+ 0x00000220, 0x00000220, 0x00000220, 0x00000220, 0x00000220, 0x00000220, 0x00000220, 0x00000220,
+ 0x00000220, 0x00000220, 0x00000220, 0x00000200, 0x00000220, 0x00000200, 0x00000000, 0x00000000,
+ 0x00200200, 0x00280000, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00000000, 0x00000000, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00200200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000208, 0x00000208, 0x00000208, 0x00000208, 0x00000208, 0x00000208, 0x00000208, 0x00000208,
+ 0x00000208, 0x00000208, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200, 0x00200200,
+ 0x00200200, 0x00200200, 0x00200200, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00000200, 0x00000200, 0x00000000, 0x00000000,
+ 0x00000020, 0x00000020, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00280000, 0x00280000, 0x00280100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00080000, 0x00200100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00080000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00020120, 0x00020120, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000100, 0x00000100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000000, 0x00280000, 0x00280100, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00200100,
+ 0x00200100, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00080000, 0x00200100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00280100,
+ 0x00280100, 0x00000000, 0x00000000, 0x10280100, 0x10280100, 0x00080000, 0x00200100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10200100, 0x10200100, 0x00000000, 0x10200100,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00200100, 0x00200100, 0x00004000, 0x00004000, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00280000, 0x00280000, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00200100,
+ 0x00200100, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x10200100, 0x00000000, 0x00200100, 0x10200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00080000, 0x00000000, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280000,
+ 0x00280000, 0x00000000, 0x00000000, 0x00280000, 0x00280000, 0x00080000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00280000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x10200100, 0x10200100, 0x10200100, 0x00200100, 0x00000000, 0x10200100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00280000, 0x00280000, 0x00200100, 0x00200100, 0x00200100, 0x00280000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00280000, 0x00280000, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00080000, 0x00200100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00000000, 0x00280000,
+ 0x00280000, 0x00280100, 0x00000000, 0x00280100, 0x00280100, 0x00080000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00280000, 0x00280100, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00200100,
+ 0x00200100, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00080000, 0x00200100, 0x00280100, 0x00280000,
+ 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00280100,
+ 0x10280100, 0x00000000, 0x00000000, 0x10280100, 0x10280100, 0x00080000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280000, 0x00280100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10200100, 0x10200100, 0x00000000, 0x00200100,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00280000, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x10200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00000000, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00000000, 0x00200100, 0x00200100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280100, 0x00280100,
+ 0x00280000, 0x00280100, 0x00280100, 0x00000000, 0x00000000, 0x00000000, 0x00280100, 0x00280100,
+ 0x00280100, 0x00000000, 0x10280100, 0x10280100, 0x10280100, 0x00080000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00280100, 0x00280100, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00000000, 0x00280000, 0x00280000,
+ 0x10280000, 0x00000000, 0x00280000, 0x00280000, 0x00280000, 0x00080000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280000, 0x00280000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
+ 0x00000000, 0x00000000, 0x00280100, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00080000, 0x00200100, 0x00280100, 0x00280100,
+ 0x10280100, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00000000, 0x00280100, 0x10280100,
+ 0x10280100, 0x00000000, 0x10280100, 0x10280100, 0x00280000, 0x00080000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280100, 0x00280100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00280100, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00000000, 0x00280100, 0x00280100,
+ 0x00280100, 0x00000000, 0x10280100, 0x10280100, 0x10280100, 0x00080000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000000, 0x00000000, 0x00280100, 0x00280100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280100,
+ 0x00280100, 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00000000, 0x00280000, 0x00000000,
+ 0x00280100, 0x00280100, 0x10280100, 0x00280100, 0x10280100, 0x10280100, 0x10280100, 0x00280100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00280100, 0x00280100, 0x00000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200000, 0x00200100, 0x10200100, 0x00200000, 0x00200000, 0x00200000, 0x00200000,
+ 0x00200000, 0x00200000, 0x00200000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00004000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00200000, 0x00000000, 0x00000100,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00020120, 0x00020120, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00000000, 0x00000000, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00000000, 0x00000000, 0x00200100, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00000000, 0x00200100,
+ 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200000, 0x00200100, 0x10200100, 0x00200000, 0x00200000, 0x00200000, 0x00200000,
+ 0x00200000, 0x00200000, 0x00000000, 0x00200000, 0x00200000, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00200000, 0x00000000, 0x00000000,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x10200100, 0x10200100, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00010100, 0x00010100, 0x00010100, 0x00010100, 0x00000100, 0x00010100, 0x00010100,
+ 0x000c0120, 0x00010100, 0x00010100, 0x00020100, 0x100c0100, 0x00000120, 0x00000120, 0x00000120,
+ 0x00000120, 0x00000120, 0x000c0120, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00080000, 0x00080000, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00020100, 0x00080000, 0x00000100, 0x00080000,
+ 0x00000100, 0x00080000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080100, 0x00080100,
+ 0x00200100, 0x00200100, 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x10200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x10200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00280000, 0x00280000, 0x10280000, 0x00280000, 0x10280000, 0x10280000, 0x10280000,
+ 0x10280000, 0x10280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00220100,
+ 0x00280000, 0x10280000, 0x00080000, 0x00080000, 0x00080000, 0x00020100, 0x00080000, 0x00080000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00280000, 0x00280000, 0x00280000, 0x10280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00000000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x10280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x10280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x10280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x10280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x10280000, 0x00280000, 0x00280000, 0x00280000, 0x00000000, 0x00020100, 0x00020100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00080000, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00000100, 0x00000100,
+ 0x00010100, 0x00010100, 0x00020100, 0x00010100, 0x00000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x10200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200000, 0x00200000, 0x00200000,
+ 0x00200000, 0x00200100, 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00000000,
+ 0x00200100, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200000, 0x00200000, 0x00200100,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00020120, 0x00020120, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200000, 0x00200000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200000, 0x00200000,
+ 0x00200000, 0x00200100, 0x00200100, 0x00000100, 0x00000100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200000, 0x00200100, 0x00200100, 0x00200000, 0x00200000, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00200100, 0x00000100,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000100,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00000100, 0x10000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00280000,
+ 0x00000100, 0x00020120, 0x00000120, 0x00000120, 0x00000120, 0x00000120, 0x00000120, 0x00000120,
+ 0x00000120, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000120, 0x00000120, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00020010, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00080000, 0x00040000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00020120, 0x00020120, 0x00020120, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00080000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00080000, 0x00020100, 0x00020100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00000000, 0x00280000, 0x00280000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000100, 0x00000100, 0x00200100, 0x00200000,
+ 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00200000, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200000, 0x00200100,
+ 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020120, 0x00020120, 0x00040120, 0x00000100,
+ 0x00020100, 0x00000100, 0x00020120, 0x00004000, 0x00200100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000020, 0x00000020, 0x00020020, 0x00020020, 0x00010000, 0x00000000,
+ 0x00000020, 0x00000020, 0x00000000, 0x00080000, 0x00080000, 0x00080000, 0x000c0010, 0x00000000,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00000100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00280000, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00280000,
+ 0x00280000, 0x00280100, 0x00280100, 0x00280100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00280100, 0x00280100, 0x00280000, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00080000, 0x00080000, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0x00000020, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00280000,
+ 0x00280000, 0x00280100, 0x00280100, 0x00280100, 0x00000000, 0x00000000, 0x00000100, 0x00000100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280100, 0x00200100, 0x10200100, 0x00200100,
+ 0x10200100, 0x00200100, 0x10200100, 0x00200100, 0x10200100, 0x00200100, 0x10200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x10200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00080000, 0x00280100, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x10280100, 0x00280000, 0x10280100, 0x00280100, 0x00280100,
+ 0x10280100, 0x10280100, 0x00280000, 0x10280100, 0x00080100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00020120, 0x00020120, 0x00020100, 0x00020120, 0x00020120, 0x00020120,
+ 0x00020100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00280000, 0x00280000, 0x00280100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280100, 0x00280100,
+ 0x00280000, 0x00280000, 0x00080100, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00280100, 0x00280100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280100, 0x00280100, 0x00080000, 0x00080000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00020120, 0x00020120, 0x00020120, 0x00020120, 0x00020120,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00020120, 0x00020120,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x10000100, 0x10000100, 0x10000100, 0x00000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x00000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x00000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200101, 0x10200101, 0x10200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x10000100, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00088000, 0x00088000,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00200101, 0x00200101, 0x00200102, 0x00200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101, 0x10200102, 0x10200101,
+ 0x10200102, 0x10200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00000000, 0x00000000,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00000000, 0x00000000,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00000000, 0x00000000,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00000000, 0x00000000,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x00000000, 0x10200102, 0x00000000, 0x10200102, 0x00000000, 0x10200102, 0x00000000, 0x10200102,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00000000, 0x00000000,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104, 0x10200104,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00000000, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200104, 0x10000000, 0x10200101, 0x10000000,
+ 0x10000000, 0x10000000, 0x10200101, 0x10200101, 0x10200101, 0x00000000, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200104, 0x10000000, 0x10000000, 0x10000000,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00000000, 0x00000000, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10000000, 0x10000000, 0x10000000,
+ 0x00000000, 0x00000000, 0x10200101, 0x10200101, 0x10200101, 0x00000000, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200104, 0x10010000, 0x10000000, 0x00000000,
+ 0x10020010, 0x10020010, 0x10020010, 0x10020010, 0x10020010, 0x10020010, 0x10020010, 0x100c0010,
+ 0x10020010, 0x10020010, 0x10020010, 0x00020080, 0x00080080, 0x00080080, 0x00080110, 0x00080210,
+ 0x00020000, 0x180c0000, 0x00020000, 0x00020000, 0x00030000, 0x00000000, 0x00000000, 0x10000000,
+ 0x00000000, 0x00000000, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00080000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000, 0x00020000,
+ 0x00000010, 0x00000010, 0x00088180, 0x00080200, 0x00080000, 0x00080100, 0x00080200, 0x180c2010,
+ 0x00004000, 0x00004000, 0x00004000, 0x10004000, 0x10004000, 0x00000000, 0x10000000, 0x10000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10040020, 0x00040020, 0x10000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00002000, 0x00080000, 0x00040000, 0x10040020,
+ 0x10040020, 0x10040020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0x10000000,
+ 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00000000, 0x00020000, 0x00020000, 0x10020010,
+ 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x10000400, 0x10200101, 0x00000000, 0x00000000, 0x10000400, 0x10000400, 0x10000400, 0x10000400,
+ 0x10000400, 0x10000400, 0x10001000, 0x10001000, 0x10000000, 0x10080000, 0x10040000, 0x10200101,
+ 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400,
+ 0x10000400, 0x10000400, 0x10001000, 0x10001000, 0x10000000, 0x10080000, 0x10040000, 0x00000000,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000,
+ 0x10004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000,
+ 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00088000, 0x00080000, 0x00080000, 0x00080000, 0x00088000, 0x00088000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000,
+ 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x10200102, 0x10000000, 0x00000000, 0x10000000, 0x10000000, 0x10200102,
+ 0x00000000, 0x10000000, 0x10200101, 0x10200102, 0x10200102, 0x10200102, 0x10200101, 0x10200101,
+ 0x10200102, 0x10200102, 0x10200102, 0x10200101, 0x00000000, 0x10200102, 0x10000000, 0x00000000,
+ 0x00000000, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x00000000, 0x10200102, 0x00000000, 0x10200102, 0x00000000,
+ 0x10200102, 0x00000000, 0x10200102, 0x10200102, 0x10200102, 0x10200102, 0x00004000, 0x10200101,
+ 0x10200102, 0x10200102, 0x00200102, 0x10200102, 0x10200101, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200101, 0x00000000, 0x10000000, 0x10200101, 0x10200101, 0x10200102, 0x10200102,
+ 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10200102, 0x10200101, 0x10200101,
+ 0x10200101, 0x10200101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00200101, 0x00000100,
+ 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00200102, 0x00200101, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00001000, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000, 0x10000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x00000000, 0x10000000,
+ 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x10000000,
+ 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000000, 0x10000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x10080000, 0x10040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
+ 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400,
+ 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000400,
+ 0x10000400, 0x10000400, 0x10000400, 0x10000400, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100,
+ 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10000100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000,
+ 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00080000, 0x00040000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00080000, 0x00040000,
+ 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000,
+ 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000,
+ 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000,
+ 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00080000, 0x00040000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x10000000, 0x10000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102,
+ 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00200102, 0x00000000,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00000000,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200102, 0x00200102, 0x00200101, 0x00200101, 0x00200102,
+ 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200102, 0x00200102,
+ 0x00000000, 0x00200101, 0x00200102, 0x00200101, 0x00200101, 0x00200102, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x10200101, 0x10000100, 0x00000000, 0x00000000,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200101, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00020000, 0x00020000, 0x00020000, 0x00000000, 0x00000000, 0x00020000,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020000, 0x00020000,
+ 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00000000, 0x00020000,
+ 0x00080000, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000,
+ 0x00080000, 0x00040000, 0x00020000, 0x00020000, 0x00020000, 0x00020000, 0x00000020, 0x00000000,
+ 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00000000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x10030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x10030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10030010, 0x00040020, 0x00040020, 0x00030000, 0x00030000, 0x00040100, 0x00630100, 0x00430100,
+ 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00080000, 0x00040000,
+ 0x00080000, 0x00040000, 0x00030000, 0x00030000, 0x00080000, 0x00040000, 0x00080000, 0x00040000,
+ 0x00080000, 0x00040000, 0x00080000, 0x00040000, 0x00040000, 0x00080000, 0x00040000, 0x00040000,
+ 0x00030000, 0x00430100, 0x00430100, 0x00430100, 0x00430100, 0x00430100, 0x00430100, 0x00430100,
+ 0x00430100, 0x00430100, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00030000, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x00030100, 0x10030000, 0x00030000,
+ 0x10430100, 0x10430100, 0x10430100, 0x00040100, 0x00240100, 0x00030000, 0x00030000, 0x00030000,
+ 0x00000000, 0x00240100, 0x00230100, 0x00240100, 0x00230100, 0x00240100, 0x00230100, 0x00240100,
+ 0x00230100, 0x00240100, 0x00230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100,
+ 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100,
+ 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100,
+ 0x10230100, 0x00230100, 0x10230100, 0x00240100, 0x00230100, 0x10230100, 0x00230100, 0x10230100,
+ 0x00230100, 0x10230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x10230100, 0x10230100, 0x00230100, 0x10230100, 0x10230100, 0x00230100, 0x10230100, 0x10230100,
+ 0x00230100, 0x10230100, 0x10230100, 0x00230100, 0x10230100, 0x10230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00240100, 0x00230100, 0x00240100, 0x00230100, 0x00240100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00240100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x10230100, 0x00240100, 0x00240100, 0x00000000,
+ 0x00000000, 0x00088000, 0x00088000, 0x10040000, 0x10040000, 0x00040100, 0x10040100, 0x10230100,
+ 0x00040000, 0x00240100, 0x00230100, 0x00240100, 0x00230100, 0x00240100, 0x00230100, 0x00240100,
+ 0x00230100, 0x00240100, 0x00230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100,
+ 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100,
+ 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100, 0x10230100, 0x00230100,
+ 0x10230100, 0x00230100, 0x10230100, 0x00240100, 0x00230100, 0x10230100, 0x00230100, 0x10230100,
+ 0x00230100, 0x10230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x10230100, 0x10230100, 0x00230100, 0x10230100, 0x10230100, 0x00230100, 0x10230100, 0x10230100,
+ 0x00230100, 0x10230100, 0x10230100, 0x00230100, 0x10230100, 0x10230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00240100, 0x00230100, 0x00240100, 0x00230100, 0x00240100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00240100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x10230100, 0x00240100, 0x00240100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x00040000, 0x00040100, 0x00040100, 0x10040100, 0x10230100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00000000, 0x00000000,
+ 0x00000000, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100,
+ 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x10230100, 0x00000000,
+ 0x00030100, 0x00030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100,
+ 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100, 0x00240100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030000, 0x10030000, 0x00000000,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030000, 0x10030000, 0x10030000, 0x00030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x00000000,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030000, 0x10030000,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100,
+ 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030100, 0x10030000,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x00630100, 0x00630100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00040100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100,
+ 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00230100, 0x00000000, 0x00000000, 0x00000000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000,
+ 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00030000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000100, 0x00020020, 0x00000020, 0x00020020,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00000000, 0x00000000, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200100, 0x00088000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00088000, 0x00088000, 0x00000000, 0x00000000,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200101, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x10000100, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101, 0x00200101,
+ 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200102, 0x00200101,
+ 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101, 0x00200102, 0x00200101,
+ 0x00000000, 0x00000100, 0x00000100, 0x00200102, 0x00200101, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00080000, 0x00200100, 0x00200100, 0x00200100, 0x00080000, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00080000, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00280100, 0x00280100, 0x00280000, 0x00280000, 0x00280100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00010000, 0x00010000, 0x00000020, 0x00000020,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00280100, 0x00280100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00280100, 0x00280100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00280100,
+ 0x00280100, 0x00280100, 0x00280100, 0x00280100, 0x00080000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020120, 0x00020120,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00080000, 0x00080000, 0x00080000, 0x00020100, 0x00020120,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000,
+ 0x00280000, 0x00280000, 0x00280100, 0x00080100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280000, 0x00280100,
+ 0x00280100, 0x00280000, 0x00280000, 0x00280100, 0x00280100, 0x00280000, 0x00280000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00280000, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00280000, 0x00280100, 0x00000000, 0x00000000,
+ 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108, 0x00000108,
+ 0x00000108, 0x00000108, 0x00000000, 0x00000000, 0x00000100, 0x00020120, 0x00020120, 0x00020120,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00200100,
+ 0x00200100, 0x00200100, 0x00200100, 0x00200100, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100, 0x00000100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x00630100, 0x00630100,
+ 0x10630100, 0x00630100, 0x10630100, 0x00630100, 0x00630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x00630100,
+ 0x10630100, 0x00630100, 0x10630100, 0x00630100, 0x00630100, 0x10630100, 0x10630100, 0x00630100,
+ 0x00630100, 0x00630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x00000000, 0x00000000,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100, 0x10630100,
+ 0x10630100, 0x10630100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x10200101, 0x10200101, 0x10200101, 0x10200101, 0x10200101,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10200200, 0x00280000, 0x10200200,
+ 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200,
+ 0x10200200, 0x10001000, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200,
+ 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x00000000,
+ 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x00000000, 0x10200200, 0x00000000,
+ 0x10200200, 0x10200200, 0x00000000, 0x10200200, 0x10200200, 0x00000000, 0x10200200, 0x10200200,
+ 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200, 0x10200200,
+ 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200,
+ 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200,
+ 0x14200200, 0x12200200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200,
+ 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x14200200, 0x12200200,
+ 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200,
+ 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200,
+ 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200,
+ 0x10a00200, 0x14200200, 0x12200200, 0x10a00200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x11200200,
+ 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200,
+ 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200,
+ 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x11200200, 0x11200200, 0x11200200, 0x11200200,
+ 0x11200200, 0x11200200, 0x11200200, 0x11200200, 0x12200200, 0x14200200, 0x00080000, 0x00040000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10a00200, 0x12200200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x12200200, 0x10a00200, 0x12200200, 0x12200200, 0x10a00200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x10a00200, 0x10a00200, 0x12200200, 0x10a00200, 0x12200200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x10a00200, 0x12200200, 0x12200200, 0x10a00200, 0x12200200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x10a00200, 0x12200200, 0x10a00200, 0x10a00200, 0x12200200, 0x12200200, 0x12200200, 0x10a00200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x10a00200, 0x12200200, 0x12200200, 0x10a00200, 0x12200200,
+ 0x10a00200, 0x10a00200, 0x10a00200, 0x12200200, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200,
+ 0x00000000, 0x00000000, 0x10a00200, 0x10a00200, 0x10a00200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x10a00200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x10a00200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x10a00200, 0x12200200, 0x10a00200, 0x12200200, 0x12200200, 0x12200200, 0x12200200, 0x12200200,
+ 0x12200200, 0x12200200, 0x12200200, 0x10a00200, 0x10a00200, 0x10a00200, 0x12200200, 0x12200200,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14200200,
+ 0x14200200, 0x14200200, 0x14200200, 0x14200200, 0x14000200, 0x00000000, 0x00000000, 0x00000000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000, 0x00080000,
+ 0x10000000, 0x10040000, 0x10040000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10080000,
+ 0x10040000, 0x10000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00088000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10080000, 0x10040000, 0x10080000,
+ 0x10040000, 0x10080000, 0x10040000, 0x10080000, 0x10040000, 0x10080000, 0x10040000, 0x10080000,
+ 0x10040000, 0x10080000, 0x10040000, 0x10080000, 0x10040000, 0x00030000, 0x00030000, 0x10080000,
+ 0x10040000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000, 0x10030000,
+ 0x10042020, 0x10030020, 0x10042020, 0x00000000, 0x10040020, 0x10042020, 0x10000020, 0x10000020,
+ 0x10030000, 0x10080000, 0x10040000, 0x10080000, 0x10040000, 0x10080000, 0x10040000, 0x10034000,
+ 0x10030000, 0x10030000, 0x10031000, 0x10031000, 0x10030000, 0x10030000, 0x10030000, 0x00000000,
+ 0x10030000, 0x10004000, 0x10004000, 0x10030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x14200200, 0x11200200, 0x14200200, 0x00200200, 0x14200200, 0x00000000, 0x14200200, 0x11200200,
+ 0x14200200, 0x11200200, 0x14200200, 0x11200200, 0x14200200, 0x11200200, 0x14200200, 0x11200200,
+ 0x14200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200,
+ 0x12200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x14200200,
+ 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x14200200,
+ 0x12200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x10a00200,
+ 0x11200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x14200200,
+ 0x12200200, 0x14200200, 0x12200200, 0x10a00200, 0x11200200, 0x14200200, 0x12200200, 0x14200200,
+ 0x12200200, 0x14200200, 0x12200200, 0x14200200, 0x12200200, 0x00000000, 0x00000000, 0x08000080,
+ 0x00000000, 0x10000020, 0x10030000, 0x10034000, 0x10004000, 0x10004000, 0x10030000, 0x10030000,
+ 0x10080000, 0x10040000, 0x10030000, 0x10031000, 0x10042020, 0x10031000, 0x10042020, 0x10032000,
+ 0x10030448, 0x10030448, 0x10030448, 0x10030448, 0x10030448, 0x10030448, 0x10030448, 0x10030448,
+ 0x10030448, 0x10030448, 0x10042020, 0x10040020, 0x10030000, 0x10030000, 0x10030000, 0x10000020,
+ 0x10030000, 0x10230142, 0x10230142, 0x10230142, 0x10230142, 0x10230142, 0x10230142, 0x10230102,
+ 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102,
+ 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102, 0x10230102,
+ 0x10230102, 0x10230102, 0x10230102, 0x10080000, 0x10030000, 0x10040000, 0x10030000, 0x10030000,
+ 0x10030000, 0x10230141, 0x10230141, 0x10230141, 0x10230141, 0x10230141, 0x10230141, 0x10230101,
+ 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101,
+ 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101, 0x10230101,
+ 0x10230101, 0x10230101, 0x10230101, 0x10080000, 0x10030000, 0x10040000, 0x10030000, 0x10080000,
+ 0x10040000, 0x10040020, 0x10080000, 0x10040000, 0x10040020, 0x10040000, 0x10200100, 0x10240100,
+ 0x10240100, 0x10240100, 0x10240100, 0x10240100, 0x10240100, 0x10240100, 0x10240100, 0x10240100,
+ 0x10040100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10040100, 0x10040100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x00000000,
+ 0x00000000, 0x00000000, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x00000000, 0x00000000, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x00000000, 0x00000000, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100, 0x10200100,
+ 0x00000000, 0x00000000, 0x10200100, 0x10200100, 0x10200100, 0x00000000, 0x00000000, 0x00000000,
+ 0x10004000, 0x10004000, 0x10030000, 0x10030000, 0x10030000, 0x10004000, 0x10004000, 0x00000000,
+ 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00080000, 0x00080000, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
+};
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/VERSION b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/VERSION
new file mode 100644
index 00000000000..6e18f9908cf
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/VERSION
@@ -0,0 +1 @@
+20081117
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure-options b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure-options
new file mode 100644
index 00000000000..594a842e66f
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure-options
@@ -0,0 +1 @@
+--enable-static --disable-shared --disable-freetype --without-freetype-src --without-cairo --without-python --without-pango --without-iconv --without-native-script --without-x
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure.in
new file mode 100644
index 00000000000..acbf44f2112
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/configure.in
@@ -0,0 +1,704 @@
+dnl Process this file with autoconf to produce a configure script.
+
+orig_args="$*"
+
+AC_INIT(fontforge/pfaedit.h)
+AC_CONFIG_HEADERS([inc/config.h])
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_DISABLE_STATIC
+AC_ENABLE_SHARED
+AC_CANONICAL_HOST
+AC_SUBST(HOST)
+AC_SUBST(MACAPP)
+HOST="$host"
+
+AC_C_CONST
+AC_PATH_XTRA
+AC_SUBST(X_11LIB)
+AC_SUBST(GDRAW_LIB)
+AC_SUBST(exeOBJECTS)
+AC_SUBST(LINK_WITH_GDRAW)
+X_11LIB=-lX11
+GDRAW_LIB=libgdraw
+exeOBJECTS=fontforge_UIOBJECTS
+LINK_WITH_GDRAW=../libgdraw.la
+if test "$no_x" = "yes"; then
+ X_11LIB=
+ GDRAW_LIB=
+ exeOBJECTS=fontforge_SCRIPTOBJ
+ LINK_WITH_GDRAW=
+ MACAPP=
+
+else
+ dnl AC_CHECK_HEADER("X11/extensions/XInput.h", : ,AC_DEFINE(_NO_XINPUT),)
+ dnl AC_CHECK_HEADER("X11/extensions/XI.h", : ,AC_DEFINE(_NO_XINPUT),)
+ dnl /usr/share/doc/XFree86-doc-4.2.0/Xi/lib.PS
+
+ AC_CHECK_LIB(Xi, XOpenDevice, X_11LIB="-lXi -lX11" ,AC_DEFINE(_NO_XINPUT), $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 )
+ AC_CHECK_LIB(xkbui, XkbQueryExtension, X_11LIB="$X_11LIB -lxkbui" ,AC_DEFINE(_NO_XKB), $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 -lm )
+fi
+
+gww_define_caps_for_alt="dontknow"
+gww_nodynamic="no"
+gww_needsstatic="no"
+gww_ismac="no"
+gww_iscygwin="no"
+gww_needsstaticimages="no"
+gww_rpath=""
+AC_ARG_WITH(static-imagelibs,
+ [ --with-static-imagelibs Control whether to try using static image libaries],
+ [
+ if test "$withval" \!= "no" ; then
+ gww_needsstaticimages="yes"
+ fi
+ dnl Mac doesn't ship with image libraries, so my builds should include
+ dnl static versions, else users won't have them.
+
+ ])
+
+oldLDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -L/usr/local/lib"
+
+case "$host" in
+*-apple-darwin*)
+ gww_ismac="yes"
+ AC_DEFINE(_CursorsMustBe16x16)
+ AC_DEFINE(_Keyboard,1)
+ AC_DEFINE(__Mac,1)
+ MACAPP=FontForge.app/Contents/Info.plist
+ gww_define_caps_for_alt="1"
+
+dnl fink puts stuff under /sw
+dnl macports puts stuff under /opt/local
+
+ if test "$CPPFLAGS" \!= "" >/dev/null ; then
+ TrustUser="yes"
+ elif test -d /sw/include >/dev/null ; then
+ CPPFLAGS="$CPPFLAGS -I/sw/include"
+ elif test -d /opt/local/include >/dev/null ; then
+ CPPFLAGS="$CPPFLAGS -I/opt/local/include"
+ fi
+ if test "$oldLDFLAGS" \!= "" >/dev/null ; then
+ TrustUser="yes"
+ elif test -d /sw/lib >/dev/null ; then
+ LDFLAGS="$LDFLAGS -L/sw/lib"
+ gww_rpath="-rpath /sw/lib"
+ elif test -d /opt/local/lib >/dev/null ; then
+ LDFLAGS="$LDFLAGS -L/opt/local/lib"
+ gww_rpath="-rpath /opt/local/lib"
+ fi
+ LIBS="-Wl,/System/Library/Frameworks/Carbon.framework/Carbon $LIBS"
+ LIBS="-Wl,/System/Library/Frameworks/CoreServices.framework/CoreServices $LIBS"
+ dnl I would like to be able to just leave the framework as a filename. But
+ dnl if I do that, libtool eats it and gcc doesn't get it and ld doesn't get
+ dnl it and we get undefined symbols.
+
+ ;;
+powerpc-*-*linux*)
+ AC_DEFINE(_Keyboard,3)
+ ;;
+*sparc*)
+ AC_DEFINE(_Keyboard,2)
+ ;;
+*-pc-cygwin*)
+
+ AC_DEFINE(_BrokenBitmapImages)
+ AC_DEFINE(_ModKeysAutoRepeat)
+ AC_DEFINE(__CygWin,1)
+ gww_iscygwin="yes"
+
+dnl Although present on my cygwin system the Xi library does not load
+dnl and crashes gdb if we attempt to use it.
+
+ AC_DEFINE(_NO_XINPUT)
+
+dnl on cygwin the file we dlopen is not the expected filename. We must
+dnl search for a libtool .la file (libpng.la for example) to tell us
+dnl what name we should dlopen. Sadly cygwin doesn't always provide
+dnl these => we must link statically, or load at start up.
+
+dnl so provide a simplistic function to check for the .la file
+dnl AC_CHECK_LIB_LA(lib-name, action-if-found, action-if-missing)
+
+AC_DEFUN([AC_CHECK_LIB_LA],
+ [
+ AC_CHECK_FILE(/lib/lib$1.la,[$2],[
+ AC_CHECK_FILE(/usr/lib/lib$1.la,[$2],[
+ AC_CHECK_FILE(/usr/local/lib/lib$1.la,[$2],[
+ AC_CHECK_FILE(/usr/X11R6/lib/lib$1.la,[$2],[$3])])])])
+ ])
+
+ ;;
+esac
+
+AC_C_BIGENDIAN()
+
+AC_PROG_LIBTOOL
+
+AC_ARG_WITH(capslock-for-alt,
+ [ --with-capslock-for-alt Control whether to use capslock rather than alt/meta to alter behavior of tools in outline/bitmap windows],
+ [
+ if test "$withval" \!= "2" ; then
+ gww_define_caps_for_alt="2"
+ elif test "$withval" \!= "no" ; then
+ gww_define_caps_for_alt="1"
+ else
+ gww_define_caps_for_alt="0"
+ fi
+ ])
+if test "$gww_define_caps_for_alt" \!= "dontknow" ; then
+ AC_DEFINE_UNQUOTED(FONTFORGE_CONFIG_CAPSLOCK_FOR_ALT,$gww_define_caps_for_alt)
+fi
+
+AC_ARG_ENABLE(debug-raw-points,
+ [ --enable-debug-raw-points Add a raw mode to the points window of the debugger],
+ [
+ if test "$enableval" \!= "no" ; then
+ AC_DEFINE(FONTFORGE_CONFIG_SHOW_RAW_POINTS)
+ fi
+
+ ])
+
+dnl One user seems to have messed up iconv on his system and can't get it
+dnl to work.
+
+gww_uselessiconv="no"
+AC_ARG_WITH(iconv,
+ [ --without-iconv Don't use the system's iconv(3) routines, use fontforge's instead],
+ [
+ if test "$withval" = "no" ; then
+ gww_uselessiconv="yes"
+ fi
+ ])
+
+AC_SUBST(FF_EXTRA_FILES)
+
+AC_SEARCH_LIBS(dlopen, dl) dnl some systems have this in libc (Darwin uses dyld)
+AC_SEARCH_LIBS(inet_aton, resolv) dnl some systems have this in libc
+if test "$gww_uselessiconv" = "no" ; then
+ AC_SEARCH_LIBS(libiconv, iconv) dnl linux has iconv in libc, mac,solaris have libiconv in libiconv, and a define to map iconv() to libiconv(), so we can't do the obvious check
+fi
+
+python="yes"
+python_prog="python"
+AC_ARG_WITH(python,
+ [ --without-python Don't include a python interpreter],
+ [
+ if test "$withval" = "no" >/dev/null 2>&1 ; then
+ python="no"
+ elif test "$withval" != "yes" >/dev/null 2>&1 ; then
+ python_prog="$withval"
+ fi
+ ], : )
+if test "$python" = "yes" ; then
+ # python thinks it knows where to find its headers and library.
+ # unfortunately on all my build systems that idea is incorrect.
+ # So we allow the user to specify the location manually. We
+ # ask python where it thinks things are, and we check some standard
+ # places.
+ py_headers=""
+ py_lib=""
+ AC_ARG_WITH(python-headers,
+ [ --with-python-headers Specify the directory containing the python headers],
+ [
+ if test "$withval" != "no" >/dev/null 2>&1 ; then
+ py_headers="$withval"
+ if test "$py_headers" != "" -a \! -e "$py_headers" ; then
+ py_headers=""
+ fi
+ fi
+ ], : )
+ AC_ARG_WITH(python-lib,
+ [ --with-python-lib Specify the python shared libary],
+ [
+ if test "$withval" != "no" -a "$withval" != "yes" -a "$withval" != "" >/dev/null 2>&1 ; then
+ py_lib="$withval"
+ fi
+ ], : )
+ echo -n "Checking for python..."
+ if $python_prog -c "import distutils.sysconfig ; print '%s' % distutils.sysconfig.get_config_var('VERSION')" ; then
+ PyVersion=`$python_prog -c "import distutils.sysconfig ; print '%s' % distutils.sysconfig.get_config_var('VERSION')"`
+ PySubVersion=`echo $PyVersion |sed -e 's/2.//'`
+ PyName="python$PyVersion"
+ if test "$PySubVersion" = "" ; then
+ python="no"
+ elif test "$PySubVersion" -le 2 ; then
+ python="no"
+ echo $ECHO_N "(need at least python 2.3) $ECHO_C" >&6
+ else
+ PyInc=`$python_prog -c "import distutils.sysconfig ; print '%s' % distutils.sysconfig.get_config_var('INCLUDEPY')"`
+ if test "$py_headers" != "" -a -e "$py_headers" ; then
+ CPPFLAGS="$CPPFLAGS -I$py_headers"
+ elif test "$PyInc" != "" -a -e "$PyInc" ; then
+ CPPFLAGS="$CPPFLAGS -I$PyInc"
+ elif test -d /usr/include/$PyName ; then
+ CPPFLAGS="$CPPFLAGS -I/usr/include/$PyName"
+ elif test -d /usr/include/python ; then
+ CPPFLAGS="$CPPFLAGS -I/usr/include/python"
+ else
+ python="no"
+ fi
+ PyLib=`$python_prog -c "import distutils.sysconfig ; print '%s/%s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'))"`
+ if test "$py_lib" != "" ; then
+ LIBS="$LIBS $py_lib"
+ elif test "$PyLib" != "" -a -e "$PyLib" ; then
+ LIBS="$LIBS $PyLib"
+ else
+ AC_SEARCH_LIBS(Py_Main, $PyName python, : , python="no")
+ fi
+ fi
+ else
+ python="no"
+ fi
+ echo $python
+fi
+
+gww_dopy=no
+gww_fflib=yes
+AC_ARG_ENABLE(libff,
+ AC_HELP_STRING(--enable-libff, disable/enable building shared fontforge library),
+[
+ case $enableval in
+ no)
+ gww_fflib=no
+ ;;
+ esac
+])
+if test "$python" = "no" ; then
+ AC_DEFINE(_NO_PYTHON)
+fi
+AC_DEFINE_UNQUOTED(PYTHON_LIB_NAME,"python$PyVersion")
+
+AC_ARG_ENABLE(pyextension,
+ AC_HELP_STRING(--enable-pyextension, disable/enable installing libfontforge as a python extension plugin),
+[
+ case $enableval in
+ yes)
+ if test "$gww_fflib" != "yes" -o "$python" = "no" ; then
+ echo FAILED --enable-pyextension requires that python be available and
+ echo " " that libfontforge be built "(--enable-libff)"
+ else
+ gww_dopy=yes
+ fi
+ ;;
+ esac
+])
+
+AC_SUBST(FINAL_TARGET)
+AC_SUBST(O_EXTENSION)
+if test "$gww_fflib" = "no" ; then
+ FINAL_TARGET=fontforge
+ O_EXTENSION=o
+else
+ FINAL_TARGET=../libfontforge.la
+ O_EXTENSION=lo
+fi
+
+ffscript="yes"
+AC_ARG_WITH(native-script,
+ [ --without-native-script Don't include a legacy fontforge scripting interpreter],
+ [
+ if test "$withval" = "no" >/dev/null 2>&1 ; then
+ ffscript="no"
+ fi
+ ], : )
+if test "$ffscript" = "no" ; then
+ AC_DEFINE(_NO_FFSCRIPT)
+fi
+
+AC_CHECK_FUNC(tzset,:,AC_DEFINE(_NO_TZSET))
+
+dnl Some old versions of lib(un)gif don't work for us, they've got the
+dnl Function argument in the wrong place. So check the header files.
+dnl check for both libgif and libungif, I think they use the same args.
+
+AC_CHECK_LIB(gif, DGifOpenFileName, [
+echo -n checking for ExtensionBlock.Function in gif_lib.h...
+AC_TRY_COMPILE([#include <gif_lib.h>], [ ExtensionBlock foo; foo.Function=3; ], echo " " yes , [echo " " no
+ ac_cv_lib_ungif_DGifOpenFileName=no
+ AC_DEFINE(_NO_LIBUNGIF)])
+] , [
+ AC_CHECK_LIB(ungif, DGifOpenFileName, [
+ echo -n checking for ExtensionBlock.Function in gif_lib.h...
+ AC_TRY_COMPILE([#include <gif_lib.h>], [ ExtensionBlock foo; foo.Function=3; ], echo " " yes , [echo " " no
+ ac_cv_lib_ungif_DGifOpenFileName=no
+ AC_DEFINE(_NO_LIBUNGIF)])
+ ] , AC_DEFINE(_NO_LIBUNGIF))])
+
+dnl some people have installed libraries without include files.
+dnl bloody useless thing to do, but check for both (don't need to check for
+dnl zlib.h because we never use it directly, only used inside libpng)
+
+AC_CHECK_LIB(z, deflateEnd, : ,AC_DEFINE(_NO_LIBPNG), -lm)
+AC_CHECK_LIB(png, png_create_read_struct, : ,[
+ AC_CHECK_LIB(png12, png_create_read_struct, AC_DEFINE(_LIBPNG12), AC_DEFINE(_NO_LIBPNG), -lz -lm)], -lz -lm)
+AC_CHECK_HEADER(png.h, : , AC_DEFINE(_NO_LIBPNG))
+AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, : ,AC_DEFINE(_NO_LIBJPEG))
+AC_CHECK_HEADER(jpeglib.h, : , AC_DEFINE(_NO_LIBJPEG))
+AC_CHECK_LIB(tiff, TIFFOpen, : , AC_DEFINE(_NO_LIBTIFF), -lm )
+AC_CHECK_HEADER(tiffio.h, : , AC_DEFINE(_NO_LIBTIFF))
+AC_CHECK_LIB(spiro, TaggedSpiroCPsToBezier, : ,AC_DEFINE(_NO_LIBSPIRO))
+AC_CHECK_HEADER(spiroentrypoints.h, : , AC_DEFINE(_NO_LIBSPIRO))
+case "$host" in
+*-pc-cygwin*)
+ AC_CHECK_LIB(xml2, xmlParseFile, : , AC_DEFINE(_NO_LIBXML), [-liconv -lz])
+ ;;
+*)
+ AC_CHECK_LIB(xml2, xmlParseFile, : , AC_DEFINE(_NO_LIBXML))
+ ;;
+esac
+
+if test "$gww_uselessiconv" = "no" ; then
+ AC_CHECK_HEADERS([iconv.h])
+fi
+AC_CHECK_HEADERS([langinfo.h])
+
+dnl linux has isnan in math.h, solaris puts it in ieeeefp.h
+
+AC_CHECK_HEADERS([ieeefp.h])
+
+dnl linux has integer types in stdint.h, solaris, vms in inttypes.h
+
+AC_CHECK_HEADERS([stdint.h])
+
+dnl Do we have libcairo
+
+AC_DEFINE(_NO_LIBCAIRO)
+
+dnl Do we have libpango
+
+AC_DEFINE(_NO_LIBPANGO)
+
+dnl many systems have freetype on /usr/X11R6/lib which isn't in the standard search path
+
+AC_DEFINE(_NO_FREETYPE)
+
+dnl older libc's don't have snprintf
+
+AC_CHECK_FUNC(snprintf, : , AC_DEFINE(_NO_SNPRINTF))
+
+AC_C_LONG_DOUBLE
+echo -n checking for long long ...
+AC_TRY_COMPILE(,[long long foo=0x400000000000;],[ AC_DEFINE(_HAS_LONGLONG)
+ echo " " yes] , echo " " no )
+
+dnl mac's don't have gettext, people have to use fink to install it
+dnl used to check for gettext here, but we require a version with b_t_c
+dnl and not all libintls have that. So check for it instead.
+dnl sometimes it lives in libc so we can't dlopen it
+
+gww_has_gettext="yes"
+AC_LINK_IFELSE([AC_LANG_CALL([],[bind_textdomain_codeset])], AC_DEFINE(_STATIC_LIBINTL) , [
+ AC_CHECK_LIB(intl, bind_textdomain_codeset,: ,gww_has_gettext="no" )])
+if test $gww_has_gettext = yes >/dev/null ; then
+ AC_CHECK_HEADERS([libintl.h], : , gww_has_gettext="no")
+fi
+
+gww_regular_link="no"
+AC_ARG_WITH(regular-link,
+ [ --with-regular-link Don't try to dlopen libraries],
+ [
+ if test "$withval" != "no" >/dev/null 2>&1 ; then
+ gww_regular_link="yes"
+ AC_DEFINE(NODYNAMIC)
+ gww_rpath=""
+ fi
+ ], : )
+
+dnl If we can't/don't want to use dynamic libraries then we must link with
+dnl the static libraries we've found
+
+AC_SUBST(STATIC_LIBS)
+STATIC_LIBS=
+if test "$gww_nodynamic" = "yes" -o "$gww_regular_link" = "yes"; then
+ if test "$gww_needsstatic" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -static"
+ fi
+ if test "$ac_cv_lib_ungif_DGifOpenFileName" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lungif"
+ fi
+ if test "$ac_cv_lib_gif_DGifOpenFileName" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lgif"
+ fi
+ if test "$ac_cv_lib_png_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng -lz"
+ fi
+ if test "$ac_cv_lib_png12_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng12 -lz"
+ fi
+ if test "$ac_cv_lib_tiff_TIFFOpen" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -ltiff"
+ fi
+ if test "$ac_cv_lib_jpeg_jpeg_CreateDecompress" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -ljpeg"
+ fi
+ if test "$ac_cv_lib_xml2_xmlParseFile" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lxml2"
+ fi
+ if test "$ac_cv_lib_intl_bind_textdomain_codeset" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lintl"
+ fi
+ if test "$ac_cv_lib_spiro_TaggedSpiroCPsToBezier" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lspiro"
+ fi
+ AC_CHECK_LIB(uninameslist, UnicodeNameAnnot, [
+ STATIC_LIBS="$STATIC_LIBS -luninameslist"
+ AC_DEFINE(_STATIC_LIBUNINAMESLIST) ] , AC_DEFINE(_NO_LIBUNINAMESLIST))
+fi
+
+if test "$gww_needsstaticimages" = "yes" -a "$gww_regular_link" = "no"; then
+ if test "$gww_needsstatic" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -static"
+ fi
+ if test "$ac_cv_lib_gif_DGifOpenFileName" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lgif"
+ AC_DEFINE(_STATIC_LIBUNGIF)
+ fi
+ if test "$ac_cv_lib_ungif_DGifOpenFileName" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lungif"
+ AC_DEFINE(_STATIC_LIBUNGIF)
+ fi
+ if test "$ac_cv_lib_png_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng -lz"
+ AC_DEFINE(_STATIC_LIBPNG)
+ fi
+ if test "$ac_cv_lib_png12_png_create_read_struct" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lpng12 -lz"
+ AC_DEFINE(_STATIC_LIBPNG)
+ fi
+ if test "$ac_cv_lib_tiff_TIFFOpen" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -ltiff"
+ AC_DEFINE(_STATIC_LIBTIFF)
+ fi
+ if test "$ac_cv_lib_jpeg_jpeg_CreateDecompress" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -ljpeg"
+ AC_DEFINE(_STATIC_LIBJPEG)
+ fi
+ if test "$ac_cv_lib_spiro_TaggedSpiroCPsToBezier" = "yes"; then
+ STATIC_LIBS="$STATIC_LIBS -lspiro"
+ AC_DEFINE(_STATIC_LIBSPIRO)
+ fi
+fi
+if test "$gww_nodynamic" != "yes" -a "$gww_regular_link" != "yes" -a \
+ "$gww_needsstaticimages" != "yes" ; then
+case "$host" in
+*-pc-cygwin*)
+ if test "$ac_cv_lib_ungif_DGifOpenFileName" = "yes"; then
+ AC_CHECK_LIB_LA(ungif, :, [ STATIC_LIBS="$STATIC_LIBS -lungif" ; AC_DEFINE(_STATIC_LIBUNGIF)])
+ fi
+ if test "$ac_cv_lib_png_png_create_read_struct" = "yes"; then
+ AC_CHECK_LIB_LA(png, :, [ STATIC_LIBS="$STATIC_LIBS -lpng -lz" ; AC_DEFINE(_STATIC_LIBPNG)])
+ fi
+ if test "$ac_cv_lib_png12_png_create_read_struct" = "yes"; then
+ AC_CHECK_LIB_LA(png12, :, [ STATIC_LIBS="$STATIC_LIBS -lpng12 -lz" ; AC_DEFINE(_STATIC_LIBPNG12)])
+ fi
+ if test "$ac_cv_lib_tiff_TIFFOpen" = "yes"; then
+ AC_CHECK_LIB_LA(tiff, :, [ STATIC_LIBS="$STATIC_LIBS -ltiff" ; AC_DEFINE(_STATIC_LIBTIFF)])
+ fi
+ if test "$ac_cv_lib_spiro_TaggedSpiroCPsToBezier" = "yes"; then
+ AC_CHECK_LIB_LA(spiro, :, [ STATIC_LIBS="$STATIC_LIBS -lspiro" ; AC_DEFINE(_STATIC_LIBSPIRO)])
+ fi
+ if test "$ac_cv_lib_jpeg_jpeg_CreateDecompress" = "yes"; then
+ AC_CHECK_LIB_LA(jpeg, :, [ STATIC_LIBS="$STATIC_LIBS -ljpeg" ; AC_DEFINE(_STATIC_LIBJPEG)])
+ fi
+ if test "$ac_cv_lib_xml2_xmlParseFile" = "yes"; then
+ AC_CHECK_LIB_LA(xml2, :, [ STATIC_LIBS="$STATIC_LIBS -lxml2" ; AC_DEFINE(_STATIC_LIBXML2)])
+ fi
+ ;;
+esac
+fi
+
+AC_ARG_ENABLE(type3,
+ [ --enable-type3 Control whether we build with support for type3/svg fonts containing multilayered drawing with strokes, fills, images, etc.],
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_TYPE3)
+ fi
+ ], : )
+AC_ARG_ENABLE(multilayer,
+ [ --enable-multilayer Control whether we build with support for type3/svg fonts containing multilayered drawing with strokes, fills, images, etc. (deprecated. Use --enable-type3 instead)],
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_TYPE3)
+ fi
+ ], : )
+
+AC_ARG_ENABLE(devicetables,
+ AS_HELP_STRING([--enable-devicetables], [Control whether we build with support for device tables which allow fine control of kerning (etc.) at small point sizes]),
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_DEVICETABLES)
+ fi
+ ], AC_DEFINE(FONTFORGE_CONFIG_DEVICETABLES) )
+
+AC_ARG_ENABLE(double,
+ AS_HELP_STRING([--enable-double], [Control whether fontforge uses doubles internally (normally it uses floats)]),
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_USE_DOUBLE)
+ fi
+ ], : )
+AC_ARG_ENABLE(longdouble,
+ AS_HELP_STRING([--enable-longdouble], [Control whether fontforge uses long doubles internally (normally it uses floats)]),
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_USE_LONGDOUBLE)
+ fi
+ ], : )
+AC_ARG_ENABLE(pasteafter,
+ AS_HELP_STRING([--enable-pasteafter], [Control whether fontforge has a paste after command (Useful for making words?)]),
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_PASTEAFTER)
+ fi
+ ], : )
+AC_ARG_ENABLE(gb12345,
+ AS_HELP_STRING([--enable-gb12345], [Control whether fontforge understands the gb12345 encoding]),
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_GB12345)
+ fi
+ ], : )
+AC_ARG_ENABLE(tilepath,
+ AS_HELP_STRING([--enable-tilepath], [Control whether fontforge has a tile path command (a variant of expand stroke)]),
+ [
+ if test "$enableval" != "no" >/dev/null 2>&1 ; then
+ AC_DEFINE(FONTFORGE_CONFIG_TILEPATH)
+ fi
+ ], : )
+
+test -d libs || mkdir libs
+
+AC_SUBST(WFLAGS)
+if test "$GCC" = yes; then
+ WFLAGS="-Wmissing-prototypes -Wunused -Wimplicit -Wreturn-type -Wparentheses -Wformat -Wchar-subscripts"
+else
+ WFLAGS=""
+fi
+
+dnl LIBS="$LIBS $gww_rpath"
+dnl The above causes problems when creating shared libraries. The rpath option
+dnl is overloaded. When creating an executable it means directories to search
+dnl for shared libraries (at load time). When creating a shared library it means
+dnl the ultimate location of the library. There doesn't seem to be a way of
+dnl saying where to look for other libraries linked into this one. Which is
+dnl a pity.
+
+
+AC_SUBST(VERSION)
+VERSION=`cat $ac_confdir/VERSION`
+
+if test "x$prefix" != xNONE; then
+ real_prefix="$prefix"
+else
+ real_prefix="$ac_default_prefix"
+fi
+
+PY=
+if test "$gww_dopy" = "yes" >/dev/null 2>&1 ; then
+ AC_SUBST(PYINCLUDE)
+ AC_SUBST(PYDEFINES)
+ AC_SUBST(PYLIBS)
+ PYINCLUDE=
+ PYDEFINES="('PREFIX','\"$real_prefix\"')"
+ if test "$gww_ismac" = "yes" >/dev/null 2>&1 ; then
+ PYDEFINES="$PYDEFINES, ('__Mac','1')"
+ elif test "$gww_iscygwin" = "yes" >/dev/null 2>&1 ; then
+ PYDEFINES="$PYDEFINES, ('__CygWin','1')"
+ fi
+ if test "$ac_cv_lib_dl_dlopen" = "yes" >/dev/null 2>&1 ; then
+ PYLIBS="'dl'"
+ else
+ PYLIBS=""
+ fi
+ PY=pyhook/setup.py
+fi
+
+GTFF=
+if test -e gtkui/Makefile.in -a \( -e /usr/include/gtk-2.0/gtk/gtk.h -o -e /sw/include/gtk-2.0/gtk/gtk.h \) ; then
+ GTFF=gtkui/Makefile
+fi
+
+
+cp $ac_confdir/Makefile.dynamic.in $ac_confdir/Makefile.in
+cp $ac_confdir/Unicode/Makefile.dynamic.in $ac_confdir/Unicode/Makefile.in
+cp $ac_confdir/gutils/Makefile.dynamic.in $ac_confdir/gutils/Makefile.in
+cp $ac_confdir/gdraw/Makefile.dynamic.in $ac_confdir/gdraw/Makefile.in
+cp $ac_confdir/fontforge/Makefile.dynamic.in $ac_confdir/fontforge/Makefile.in
+UMAP=
+if test -e umap >/dev/null 2>&1 ; then
+ cp $ac_confdir/umap/Makefile.dynamic.in $ac_confdir/umap/Makefile.in
+ UMAP=umap/Makefile
+fi
+AC_OUTPUT( Makefile Unicode/Makefile gutils/Makefile gdraw/Makefile fontforge/Makefile plugins/Makefile systemspecific fontforge.pc $PY $GTFF $MACKEYS $UMAP )
+
+echo Configuration defines: $DEFS
+echo CFLAGS: $CFLAGS
+if test "$STATIC_LIBS" != ""; then
+ echo Non DlOpenable or Static Libraries: $STATIC_LIBS
+fi
+
+if ! echo $PATH | tr : \\n | grep -x $real_prefix/bin >/dev/null ; then
+ echo " *******************************************************************"
+ echo " * You do not have $real_prefix/bin in your PATH environment variable *"
+ echo " *******************************************************************"
+ echo
+fi
+
+if test "$no_x" = "yes"; then
+ echo " *******************************************************************"
+ echo " * This version of fontforge will only run scripts. No X libraries *"
+ echo " * (or X include files or some such) were found so there is NO user*"
+ echo " * interface!!!!! If you want a UI try installing X11 on your *"
+ echo " * system. *"
+ echo " * Caveat: You will probably need to install two packages, the *"
+ echo " * base X11 package and the developer SDK package *"
+ echo " *******************************************************************"
+ case "$host" in
+ *-apple-darwin*)
+ echo ""
+ echo "X11 is optional software on the mac, it does not install automatically"
+ echo " but X11User it is on CD 3 of the OS/X install disks, and X11SDK is on"
+ echo " the Xcode CD. You must install both packages for fontforge to build"
+ echo " with a user interface"
+ ;;
+ esac
+ echo
+fi
+if test "$gww_has_gettext" = "no"; then
+ echo " *******************************************************************"
+ echo " * Your system does not have the gettext package installed. This *"
+ echo " * means that fontforge cannot localize its user interface and all *"
+ echo " * messages will be in English. You might want to install libintl. *"
+ if test "$gww_ismac" = "yes"; then
+ echo " * Unfortunately Mac OS/X does not ship with gettext. You can find *"
+ echo " * it as part of the standard fink download at: *"
+ echo " * http://fink.sourceforge.net/ *"
+ echo " * of from macports: *"
+ echo " * http://www.macports.org/ *"
+ fi
+ echo " *******************************************************************"
+fi
+if test "$gww_has_pkg_config" = "no"; then
+ echo "*** Your system does not have pkg-config installed, so I can't figure out"
+ echo "*** if you have pango on your machine. If you do, set --with-pango-headers"
+ echo "*** and --with-pango-lib to specify the options needed to build with pango"
+ if test "$gww_ismac" = "yes"; then
+ echo " *** Unfortunately Mac OS/X does not ship with pango. You can find"
+ echo " *** it as part of the standard fink download at:"
+ echo " *** http://fink.sourceforge.net/"
+ echo " *** of from macports:"
+ echo " *** http://www.macports.org/"
+ fi
+elif test "$gww_haspango" = "no"; then
+ if test "$gww_ismac" = "yes"; then
+ echo " *** Unfortunately Mac OS/X does not ship with pango. You can find"
+ echo " *** it as part of the standard fink download at:"
+ echo " *** http://fink.sourceforge.net/"
+ echo " *** of from macports:"
+ echo " *** http://www.macports.org/"
+ fi
+fi
+
+dnl EOF
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/Makefile.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/Makefile.in
new file mode 100644
index 00000000000..03eb261b484
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/Makefile.in
@@ -0,0 +1,71 @@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+sharedir = @prefix@/share/fontforge
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+VPATH = @srcdir@
+bindir = @bindir@
+libdir = @libdir@
+plugindir = $(sharedir)/plugins
+
+LIBTOOL = @LIBTOOL@
+CC = @CC@
+O = @O_EXTENSION@
+
+STATIC_LIBS = @STATIC_LIBS@
+
+FF_VERSION=1
+FF_REVISION=0
+FF_AGE=0
+
+fontforge_LIBOBJECTS = autohint.$O \
+ clipnoui.$O cvundoes.$O dumppfa.$O \
+ encoding.$O \
+ featurefile.$O fontviewbase.$O fvcomposit.$O fvfonts.$O \
+ lookups.$O macbinary.$O \
+ macenc.$O mathconstants.$O mm.$O namelist.$O noprefs.$O nouiutil.$O \
+ parsepfa.$O \
+ parsettfatt.$O parsettf.$O parsettfvar.$O \
+ psread.$O pua.$O python.$O \
+ sfd1.$O splinechar.$O splinefill.$O \
+ splinefont.$O splineorder2.$O splineoverlap.$O splinerefigure.$O \
+ splinesave.$O splinesaveafm.$O splinestroke.$O splineutil2.$O splineutil.$O \
+ start.$O stemdb.$O tottfaat.$O tottfgpos.$O tottf.$O \
+ ttfspecial.$O
+
+_CFLAGS = -I$(top_builddir)/inc -I$(top_srcdir)/inc -I$(srcdir) -I. @WFLAGS@ $(XCFLAGS)\
+ @DEFS@ '-DSHAREDIR="$(sharedir)"' -DLIBDIR='"$(libdir)"' \
+ @CPPFLAGS@ '-DPREFIX="@prefix@"'
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(_CFLAGS)
+
+LDFLAGS = @LDFLAGS@
+LIBLIBS = -rpath $(libdir) ../libgutils.la ../libgunicode.la @LIBS@ $(STATIC_LIBS) -lm
+
+../libfontforge.la: $(fontforge_LIBOBJECTS) libstamp.pre
+ sed -e '1,$$ s/REPLACE_ME_WITH_MAJOR_VERSION/$(FF_VERSION)/' -e '1,$$ s/REPLACE_ME_WITH_MINOR_VERSION/$(FF_REVISION)/' < $(srcdir)/libstamp.pre > libstamp.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c libstamp.c
+ $(LIBTOOL) --mode=link $(CC) -no-undefined $(CFLAGS) @LDFLAGS@ \
+ -o ../libfontforge.la $(fontforge_LIBOBJECTS) libstamp.lo \
+ -rpath $(libdir) -version-info $(FF_VERSION):$(FF_REVISION):$(FF_AGE)
+
+%.o: %.c
+
+%.o: %.c $(srcdir)/splinefont.h $(srcdir)/views.h $(srcdir)/stemdb.h $(srcdir)/ttf.h $(srcdir)/unicoderange.h $(srcdir)/psfont.h $(srcdir)/edgelist.h $(srcdir)/edgelist2.h $(srcdir)/uiinterface.h $(srcdir)/fontforgevw.h
+ $(CC) $(CFLAGS) -c $<
+
+%.lo: %.c
+
+%.lo: %.c $(srcdir)/splinefont.h $(srcdir)/views.h $(srcdir)/stemdb.h $(srcdir)/ttf.h $(srcdir)/unicoderange.h $(srcdir)/psfont.h $(srcdir)/edgelist.h $(srcdir)/edgelist2.h $(srcdir)/uiinterface.h $(srcdir)/fontforgevw.h
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<
+
+clean:
+ -rm -f ../libfontforge.la libstamp.c
+ -rm -f *.o
+ -rm -f *.lo
+ -rm -rf .libs
+
+distclean cleaner: clean
+ -rm -f Makefile
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/PfEd.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/PfEd.h
new file mode 100644
index 00000000000..d7d5d8fa670
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/PfEd.h
@@ -0,0 +1,218 @@
+/* Copyright (C) 2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _PFED_H
+# define _PFED_H
+/* The PfEd table (from PfaEdit, former name of FontForge) is designed to */
+/* store information useful for editing the font. This includes stuff like */
+/* guidelines, background layers, spiro layers, comments, lookup names, etc*/
+/* The idea is that much useful information can be retrieved even after the */
+/* font has been generated into its final form: ttf/otf */
+/* It is something of a catch all table composed of many subtables, each of */
+/* which preserves one particular item. I expect more subtables will be */
+/* added as I, or others, think of more things worth preserving. */
+
+
+# ifndef CHR
+# define CHR(ch1,ch2,ch3,ch4) (((ch1)<<24)|((ch2)<<16)|((ch3)<<8)|(ch4))
+# endif
+
+/* 'PfEd' table format is as follows... */
+/* uint32 version number 0x00010000 */
+/* uint32 subtable count */
+/* struct { uint32 tab, offset } tag/offset for first subtable */
+/* struct { uint32 tab, offset } tag/offset for second subtable */
+/* ... */
+
+/* 'PfEd' 'fcmt' font comment subtable format */
+/* short version number 0/1 */
+/* short string length */
+/* version 0=>String in latin1 (should be ASCII), version 1=>utf8*/
+
+ /* 'PfEd' 'cmnt' glyph comment subtable format */
+ /* THIS VERSION IS DEPRECATED IN FAVOR OF VERSION 1 DESCRIBED BELOW */
+ /* short version number 0 */
+ /* short count-of-ranges */
+ /* struct { short start-glyph, end-glyph, short offset } */
+ /* ... */
+ /* foreach glyph >=start-glyph, <=end-glyph(+1) */
+ /* uint32 offset to glyph comment string (in UCS2)*/
+ /* ... */
+ /* And one last offset pointing beyong the end of the last string to enable length calculations */
+ /* String table in UCS2 (NUL terminated). All offsets from start*/
+ /* of subtable */
+
+/* 'PfEd' 'cmnt' glyph comment subtable format */
+/* New version of 'cmnt' which uses utf8 rather than UCS2 */
+/* short version number 1 */
+/* short count-of-ranges */
+/* struct { short start-glyph, end-glyph, short offset } */
+/* ... */
+/* foreach glyph >=start-glyph, <=end-glyph(+1) */
+/* uint32 offset to glyph comment string (in utf8)*/
+/* ... */
+/* And one last offset pointing beyong the end of the last string to enable length calculations */
+/* String table in utf8 (NUL terminated). All offsets from start*/
+/* of subtable */
+
+/* 'PfEd' 'cvt ' cvt comment subtable format */
+/* short version number 0 */
+/* short size of cvt comment array (might be less that cvt) */
+/* ushort offset[size] to utf8 strings describing cvt entries */
+/* (strings are NUL terminated) */
+/* String table in utf8 (NUL terminated). All offsets from start*/
+/* of subtable */
+
+/* 'PfEd' 'colr' glyph colour subtable */
+/* short version number 0 */
+/* short count-of-ranges */
+/* struct { short start-glyph, end-glyph, uint32 colour (rgb) } */
+
+/* 'PfEd' 'GPOS' GPOS lookup/subtable/anchor names */
+/* short version number 0 */
+/* short count-of-lookups */
+/* struct { short offset name, offset subtables; } */
+/* A subtable: */
+/* short count-of-subtables */
+/* struct { short offset name, offset anchors; } */
+/* An anchor */
+/* short count-of-anchors */
+/* struct { short offset name; } */
+/* string data (utf8, nul terminated) */
+/* (all offsets from start of subtable) */
+
+/* 'PfEd' 'GSUB' GSUB lookup/subtable names */
+/* Same as GPOS (anchors will always be NULL) */
+
+/* The next two tables 'guid' and 'layr' will make use of the */
+/* following data type. The glyph_layer. */
+/* short contour-count */
+/* short image-count (always 0 for now) */
+/* struct { ushort offset; ushort name-off}[contour-count] */
+/* struct { ??? }[image-count] */
+/* Each contour consists of one byte of command and a random */
+/* amount of data dependant on the command. */
+/* See below for a description of the command verbs */
+/* string data in utf8 */
+/* (offsets relative to start of glyph_layer structure ) */
+
+/* 'PfEd' 'guid' Horizontal/Vertical guideline data */
+/* short version number 0 */
+/* short # vertical guidelines */
+/* short # horizontal guidelines */
+/* short mbz */
+/* offset guide spline data -- specifies all guides as splines */
+/* May be NULL */
+/* struct[# vert guidelines] { short x; short offset name} */
+/* struct[# h guidelines] { short y; short offset name} */
+/* a glyph_layer (includes all guides, even those listed above) */
+/* (all offsets, except those in the glyph_layer, relative to start of subtable) */
+
+/* 'PfEd' 'layr' layer data */
+/* short version number 0 */
+/* short layer-count */
+/* struct { short typeflags; short offset-name; uint32 offset-to-layer-data; } */
+/* the layer type is 2=>quadratic, 3=>PostScript, 1=>spiro */
+/* 0x102=>quadratic fore, 0x103=>PS fore */
+/* A layer: */
+/* short count-of-ranges */
+/* struct { short start-glyph, end-glyph, uint32 offset } */
+/* ... */
+/* foreach glyph >=start-glyph, <=end-glyph */
+/* uint32 offset to per-glyph outline data */
+/* many glyph_layers */
+/* (all offsets, except those in the glyph_layers, relative to start of subtable) */
+
+ /* Main table tag */
+# define PfEd_TAG CHR('P','f','E','d')
+
+ /* Subtable tags */
+# define fcmt_TAG CHR('f','c','m','t') /* Font Comment */
+# define flog_TAG CHR('f','l','o','g') /* Font Log */
+# define cmnt_TAG CHR('c','m','n','t') /* Glyph Comments */
+# define cvtc_TAG CHR('c','v','t','c') /* Comments for each cvt entry */
+# define colr_TAG CHR('c','o','l','r') /* Glyph color flags */
+# ifndef GPOS_TAG
+# define GPOS_TAG CHR('G','P','O','S') /* Names for GPOS lookups */
+# define GSUB_TAG CHR('G','S','U','B') /* Names for GSUB lookups */
+# endif
+# define guid_TAG CHR('g','u','i','d') /* Guideline data */
+# define layr_TAG CHR('l','a','y','r') /* Any layers which aren't part of the font */
+ /* Backgrounds, spiros, etc. */
+
+
+/* The layer commands used to draw quadratic and cubic layers have two */
+/* componants: A verb, which says what to do, and a modifier which says */
+/* how the data are stored. So a command looks like (verb)|(modifier) */
+/* A moveto command with byte data looks like (V_MoveTo|V_B) */
+/* The two commands to end a contour (V_Close and V_End) take no data */
+/* and use no modifier */
+
+/* layr subtable contour construction verb modifiers specifying data types */
+# define V_B 0 /* data are signed bytes */
+# define V_S 1 /* data are signed shorts */
+# define V_F 2 /* data are fixed longs, divide by 256.0 */
+
+/* layr subtable contour construction verbs */
+# define V_MoveTo 0 /* Start contour, absolute data (2 coords) */
+# define V_LineTo 4 /* Straight line, relative data (2 coords) */
+# define V_HLineTo 8 /* Horizontal line, relative (1 coord, x-off) */
+# define V_VLineTo 12 /* Vertical line, relative (1 coord, y-off) */
+
+# define V_QCurveTo 16 /* Quadratic spline, rel, rel (4 coords, cp, p) */
+# define V_QImplicit 20 /* Quadratic spline, rel (2 coords, cp) */
+ /* May only occur after a V_QCurveTo or V_QImplicit (may not start contour) */
+ /* Must be followed by a V_QCurveTo or V_QImplicit (this may end contour) */
+ /* The on-curve point is implicit by averaging the given cp with the cp in the next verb */
+# define V_QHImplicit 24 /* Quadratic spline, rel (1 coord, cp.x) */
+# define V_QVImplicit 28 /* Quadratic spline, rel (1 coord, cp.y) */
+
+# define V_CurveTo 32 /* Cubic spline, rel, rel (6 coords, cp1, cp2, p) */
+# define V_VHCurveTo 36 /* Cubic spline, rel, rel (4 coords, cp1.y cp2.* p.x) */
+ /* cp1.x == current.y, p.y == cp2.y */
+# define V_HVCurveTo 40 /* Cubic spline, rel, rel (4 coords, cp1.x cp2.* p.y) */
+
+# define V_Close 44 /* Close path (optionally adding a line) no data */
+# define V_End 45 /* End path (leave open) no data */
+
+#define COM_MOD(com) ((com)&3)
+#define COM_VERB(com) ((com)&~3)
+
+/* the layer commands used to draw spiro layers are the standard spiro verbs */
+/* these will always take fixed long data (V_L) as described above */
+# ifndef SPIRO_OPEN_CONTOUR
+# define SPIRO_OPEN_CONTOUR '{'
+# define SPIRO_CORNER 'v'
+# define SPIRO_G4 'o'
+# define SPIRO_G2 'c'
+# define SPIRO_LEFT '['
+# define SPIRO_RIGHT ']'
+# define SPIRO_END 'z'
+# endif
+# define SPIRO_CLOSE_CONTOUR '}'
+
+#endif /* _PFED_H */
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/autohint.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c
index a954c42481f..a55a3d3d637 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/autohint.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/autohint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -34,23 +34,6 @@
#include <chardata.h>
#include "edgelist.h"
-#ifdef LUA_FF_LIB
-/* no need for iconv here, since PS is 8-bit legacy */
-#define Isspace(a) ((a)==' '|| ((a) >= '\t' && (a) <= '\r'))
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#define Isalpha(a) (((a)>='a' && (a)<='z') || ((a)>='A' && (a)<='Z'))
-#define Isupper(a) ((a)>='A' && (a)<='Z')
-#define Isalnum(a) (Isalpha(a)||Isdigit(a))
-#define Ishexdigit(a) (((a)>='0' && (a)<='9')||((a)>='a' && (a)<='f')||((a)>='A' && (a)<='F'))
-#else
-#define Isspace isspace
-#define Isdigit isdigit
-#define Isalpha isalpha
-#define Isupper isupper
-#define Isalnum isalnum
-#define Ishexdigit ishexdigit
-#endif
-
/* to create a type 1 font we must come up with the following entries for the
private dictionary:
BlueValues -- an array of 2n entries where Blue[2i]<Blue[2i+1] max n=7, Blue[i]>0
@@ -65,7 +48,6 @@ This file has routines to figure out at least some of these
Also other routines to guess at good per-character hints
*/
-#ifndef LUA_FF_LIB
static void AddBlue(real val, real array[5], int force) {
val = rint(val);
if ( !force && (val<array[0]-array[1] || val >array[0]+array[1] ))
@@ -97,8 +79,7 @@ static void MergeZones(real zone1[5], real zone2[5]) {
/* the same set of letter shapes and have all evolved together and have */
/* various common features (ascenders, descenders, lower case, etc.). Other */
/* scripts don't fit */
-
-void FindBlues( SplineFont *sf, real blues[14], real otherblues[10]) {
+void FindBlues( SplineFont *sf, int layer, real blues[14], real otherblues[10]) {
real caph[5], xh[5], ascenth[5], digith[5], descenth[5], base[5];
real otherdigits[5];
int i, j, k;
@@ -111,10 +92,10 @@ void FindBlues( SplineFont *sf, real blues[14], real otherblues[10]) {
descenth[0] = descenth[1] = descenth[2] = base[0] = base[1] = base[2] = 0;
otherdigits[0] = otherdigits[1] = otherdigits[2] = 0;
for ( i=0; i<sf->glyphcnt; ++i ) {
- if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->layers[ly_fore].splines!=NULL ) {
+ if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->layers[layer].splines!=NULL ) {
int enc = sf->glyphs[i]->unicodeenc;
const unichar_t *upt;
- if ( enc<0x10000 && isalnum(enc) &&
+ if ( enc<0x10000 && isalnum(enc) &&
((enc>=32 && enc<128 ) || enc == 0xfe || enc==0xf0 || enc==0xdf ||
enc==0x131 ||
(enc>=0x391 && enc<=0x3f3 ) ||
@@ -227,14 +208,8 @@ void FindBlues( SplineFont *sf, real blues[14], real otherblues[10]) {
}
}
}
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-#if defined(FONTFORGE_CONFIG_GDRAW)
- if ( !gwwv_progress_next())
-#elif defined(FONTFORGE_CONFIG_GTK)
- if ( !gwwv_progress_next())
-#endif
+ if ( !ff_progress_next())
break;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
}
if ( otherdigits[2]>0 && digith[2]>0 ) {
if ( otherdigits[0]/otherdigits[2] >= .95*digith[0]/digith[2] ) {
@@ -412,216 +387,6 @@ void FindBlues( SplineFont *sf, real blues[14], real otherblues[10]) {
}
}
-static int PVAddBlues(BlueData *bd,int bcnt,char *pt) {
- char *end;
- real val1, val2;
- int i,j;
-
- if ( pt==NULL )
-return( bcnt );
-
- while ( Isspace(*pt) || *pt=='[' ) ++pt;
- while ( *pt!=']' && *pt!='\0' ) {
- val1 = strtod(pt,&end);
- if ( *end=='\0' || end==pt )
- break;
- for ( pt=end; Isspace(*pt) ; ++pt );
- val2 = strtod(pt,&end);
- if ( end==pt )
- break;
- if ( bcnt==0 || val1>bd->blues[bcnt-1][0] )
- i = bcnt;
- else {
- for ( i=0; i<bcnt && val1>bd->blues[i][0]; ++i );
- for ( j=bcnt; j>i; --j ) {
- bd->blues[j][0] = bd->blues[j-1][0];
- bd->blues[j][1] = bd->blues[j-1][1];
- }
- }
- bd->blues[i][0] = val1;
- bd->blues[i][1] = val2;
- ++bcnt;
- if ( bcnt>=sizeof(bd->blues)/sizeof(bd->blues[0]))
- break;
- for ( pt=end; Isspace(*pt) ; ++pt );
- }
-return( bcnt );
-}
-
-/* Quick and dirty (and sometimes wrong) approach to figure out the common */
-/* alignment zones in latin (greek, cyrillic) alphabets */
-
-void QuickBlues(SplineFont *_sf, BlueData *bd) {
- real xheight = -1e10, caph = -1e10, ascent = -1e10, descent = 1e10, max, min;
- real xheighttop = -1e10, caphtop = -1e10;
- real numh = -1e10, numhtop = -1e10;
- real base = -1e10, basebelow = 1e10;
- SplineFont *sf;
- SplinePoint *sp;
- SplineSet *spl;
- int i,j, bcnt;
- SplineChar *t;
- char *pt;
-
- /* Get the alignment zones we care most about */
-
- /* be careful of cid fonts */
- if ( _sf->cidmaster!=NULL )
- _sf = _sf->cidmaster;
-
- j=0;
- do {
- sf = ( _sf->subfontcnt==0 )? _sf : _sf->subfonts[j];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- int enc = sf->glyphs[i]->unicodeenc;
- if ( enc=='I' || enc=='O' || enc=='x' || enc=='o' || enc=='p' || enc=='l' ||
-/* Jean-Christophe Dubacq points out that x-height should be calculated from */
-/* various characters and not just x and o. Italic "x"s often have strange */
-/* shapes */
- enc=='A' || enc==0x391 || enc==0x410 ||
- enc=='V' ||
- enc=='u' || enc=='v' || enc=='w' || enc=='y' || enc=='z' ||
- enc=='7' || enc=='8' || /* numbers with ascenders */
- enc==0x399 || enc==0x39f || enc==0x3ba || enc==0x3bf || enc==0x3c1 || enc==0x3be || enc==0x3c7 ||
- enc==0x41f || enc==0x41e || enc==0x43e || enc==0x43f || enc==0x440 || enc==0x452 || enc==0x445 ) {
- t = sf->glyphs[i];
- while ( t->layers[ly_fore].splines==NULL && t->layers[ly_fore].refs!=NULL )
- t = t->layers[ly_fore].refs->sc;
- max = -1e10; min = 1e10;
- if ( t->layers[ly_fore].splines!=NULL ) {
- for ( spl=t->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
- for ( sp=spl->first; ; ) {
- if ( sp->me.y > max ) max = sp->me.y;
- if ( sp->me.y < min ) min = sp->me.y;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
- if ( enc>0x400 ) {
- /* Only use ascent and descent here if we don't have anything better */
- if ( enc==0x41f ) { caph = max; base = min; }
- else if ( enc==0x41e ) { if ( max>caphtop ) caphtop = max; basebelow = min; }
- else if ( enc==0x410 ) { if ( max>caphtop ) caphtop = max; }
- else if ( enc==0x43f && xheight<0 ) xheight = max;
- else if ( enc==0x445 && xheight<0 ) xheight = max;
- else if ( enc==0x43e ) xheighttop = max;
- else if ( enc==0x452 && ascent<0 ) ascent = max;
- else if ( enc==0x440 && descent>0 ) descent = min;
- } else if ( enc>0x300 ) {
- if ( enc==0x399 ) { caph = max; base = min; }
- else if ( enc==0x391 ) { if ( max>caphtop ) caphtop = max; }
- else if ( enc==0x39f ) { if ( max>caphtop ) caphtop = max; basebelow = min; }
- else if ( enc==0x3ba && xheight<0 ) xheight = max;
- else if ( enc==0x3c7 && xheight<0 ) xheight = max;
- else if ( enc==0x3bf ) xheighttop = max;
- else if ( enc==0x3be && ascent<0 ) ascent = max;
- else if ( enc==0x3c1 && descent>0 ) descent = min;
- } else {
- if ( enc=='I' ) { caph = max; base = min; }
- else if ( enc=='O' ) { if ( max>caphtop ) caphtop = max; if ( basebelow<min ) basebelow = min; }
- else if ( enc=='V' ) { if ( basebelow<min ) basebelow = min; }
- else if ( enc=='A' ) { if ( max>caphtop ) caphtop = max; }
- else if ( enc=='7' ) numh = max;
- else if ( enc=='0' ) numhtop = max;
- else if ( enc=='x' || enc=='o' || enc=='u' || enc=='v' ||
- enc =='w' || enc=='y' || enc=='z' ) {
- if ( xheighttop==-1e10 ) xheighttop = max;
- if ( xheight==-1e10 ) xheight = max;
- if ( max > xheighttop ) xheighttop = max;
- else if ( max<xheight && max>20 ) xheight = max;
- if ( enc=='y' && descent==1e10 ) descent = min;
- } else if ( enc=='l' ) ascent = max;
- else descent = min;
- }
- }
- }
- }
- ++j;
- } while ( j<_sf->subfontcnt );
-
- if ( basebelow==1e10 ) basebelow=-1e10;
-
- if ( caphtop<caph ) caphtop = caph; else if ( caph==-1e10 ) caph=caphtop;
- if ( basebelow>base ) basebelow = base; else if ( base==-1e10 ) base=basebelow;
- if ( base==-1e10 ) { base=basebelow = 0; }
- if ( xheighttop<xheight ) xheighttop = xheight; else if ( xheight==-1e10 ) xheight=xheighttop;
- bd->xheight = xheight; bd->xheighttop = xheighttop;
- bd->caph = caph; bd->caphtop = caphtop;
- bd->numh = numh; bd->numhtop = numhtop;
- bd->ascent = ascent; bd->descent = descent;
- bd->base = base; bd->basebelow = basebelow;
-
- bcnt = 0;
- if ( (pt=PSDictHasEntry(sf->private,"BlueValues"))!=NULL )
- bcnt = PVAddBlues(bd,bcnt,pt);
- if ( (pt=PSDictHasEntry(sf->private,"OtherBlues"))!=NULL )
- bcnt = PVAddBlues(bd,bcnt,pt);
- if ( bcnt==0 ) {
- if ( basebelow==-1e10 ) basebelow = base;
- if ( base==-1e10 ) base = basebelow;
- if ( xheight==-1e10 ) xheight = xheighttop;
- if ( xheighttop==-1e10 ) xheighttop = xheight;
- if ( caph==-1e10 ) caph = caphtop;
- if ( caphtop==-1e10 ) caphtop = caph;
- if ( numh==-1e10 ) numh = numhtop;
- if ( numhtop==-1e10 ) numhtop = numh;
- if ( numh!=-1e10 && (numhtop>caph-2 && numh<caphtop+2)) {
- if ( numh<caph ) caph=numh;
- if ( numhtop>caphtop ) caphtop = numhtop;
- numh = numhtop = -1e10;
- }
- if ( ascent!=-1e10 && (ascent>caph-2 && ascent<caphtop+2)) {
- if ( ascent<caph ) caph=ascent;
- if ( ascent>caphtop ) caphtop = ascent;
- ascent = -1e10;
- }
- if ( ascent!=-1e10 && (ascent>numh-2 && ascent<numhtop+2)) {
- if ( ascent<numh ) numh=ascent;
- if ( ascent>numhtop ) numhtop = ascent;
- ascent = -1e10;
- if ( numhtop>caph-2 && numh<caphtop+2 ) {
- if ( numh<caph ) caph=numh;
- if ( numhtop>caphtop ) caphtop = numhtop;
- numh = numhtop = -1e10;
- }
- }
-
- if ( descent!=1e10 ) {
- bd->blues[0][0] = bd->blues[0][1] = descent;
- ++bcnt;
- }
- if ( basebelow!=-1e10 ) {
- bd->blues[bcnt][0] = basebelow;
- bd->blues[bcnt][1] = base;
- ++bcnt;
- }
- if ( xheight!=-1e10 ) {
- bd->blues[bcnt][0] = xheight;
- bd->blues[bcnt][1] = xheighttop;
- ++bcnt;
- }
- if ( numh!=-1e10 ) {
- bd->blues[bcnt][0] = numh;
- bd->blues[bcnt][1] = numhtop;
- ++bcnt;
- }
- if ( caph!=-1e10 ) {
- bd->blues[bcnt][0] = caph;
- bd->blues[bcnt][1] = caphtop;
- ++bcnt;
- }
- if ( ascent!=-1e10 ) {
- bd->blues[bcnt][0] = bd->blues[bcnt][1] = ascent;
- ++bcnt;
- }
- }
- bd->bluecnt = bcnt;
-}
-#endif /* LUA_FF_LIB*/
-
void ElFreeEI(EIList *el) {
EI *e, *next;
@@ -755,13 +520,13 @@ void ELFindEdges(SplineChar *sc, EIList *el) {
SplineSet *spl;
el->sc = sc;
- if ( sc->layers[ly_fore].splines==NULL )
+ if ( sc->layers[el->layer].splines==NULL )
return;
- el->coordmin[0] = el->coordmax[0] = sc->layers[ly_fore].splines->first->me.x;
- el->coordmin[1] = el->coordmax[1] = sc->layers[ly_fore].splines->first->me.y;
+ el->coordmin[0] = el->coordmax[0] = sc->layers[el->layer].splines->first->me.x;
+ el->coordmin[1] = el->coordmax[1] = sc->layers[el->layer].splines->first->me.y;
- for ( spl = sc->layers[ly_fore].splines; spl!=NULL; spl = spl->next ) if ( spl->first->prev!=NULL && spl->first->prev->from!=spl->first ) {
+ for ( spl = sc->layers[el->layer].splines; spl!=NULL; spl = spl->next ) if ( spl->first->prev!=NULL && spl->first->prev->from!=spl->first ) {
first = NULL;
for ( spline = spl->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
EIAddSpline(spline,el);
@@ -1073,47 +838,7 @@ EI *EIActiveEdgesRefigure(EIList *el, EI *active,real i,int major, int *_change)
return( active );
}
-/* Should I consider e and n to be a continuation of the same spline? */
-/* If we are at an intersection (and it's the same intersection on both) */
-/* and they go in vaguely the same direction then we should */
-/* Ah, but also if they are at different intersections and are connected */
-/* by a series of horizontal/vertical lines (whichever are invisible to major)*/
-/* then we still should. */
-int EISameLine(EI *e, EI *n, real i, int major) {
- EI *t;
-
- if ( n!=NULL && /*n->up==e->up &&*/
- (ceil(e->coordmin[major])==i || floor(e->coordmin[major])==i || floor(e->coordmax[major])==i || ceil(e->coordmax[major])==i) &&
- (ceil(n->coordmin[major])==i || floor(n->coordmin[major])==i || floor(n->coordmax[major])==i || ceil(n->coordmax[major])==i) ) {
- if (
- (n==e->splinenext && n->tmin==e->tmax &&
- n->tcur<n->tmin+.2 && e->tcur>e->tmax-.2 ) ||
- (n->splinenext==e && n->tmax==e->tmin &&
- n->tcur>n->tmax-.2 && e->tcur<e->tmin+.2 ) )
-return( true );
- /* can be seperated by a horizontal/vertical line in the other direction */
- if ( n->tmax==1 && e->tmin==0 && n->tcur>.8 && e->tcur<.2) {
- t = n;
- while ( (t = t->splinenext)!=e ) {
- if ( t==NULL || t==n ||
- (major && !t->hor) || ( !major && !t->vert ))
-return( false );
- }
-return( n->up==e->up );
- } else if ( n->tmin==0 && e->tmax==1 && n->tcur<.2 && e->tcur>.8) {
- t = e;
- while ( (t = t->splinenext)!=n ) {
- if ( t==NULL || t==e ||
- (major && !t->hor) || ( !major && !t->vert ))
-return( false );
- }
-return( n->up==e->up );
- }
- }
-return( false );
-}
-#if 1
int EISkipExtremum(EI *e, real i, int major) {
EI *n = e->aenext, *t;
@@ -1128,7 +853,7 @@ return( false );
(n->splinenext==e && n->tmax==e->tmin &&
n->tcur>n->tmax-.2 && e->tcur<e->tmin+.2 ) )
return( n->up!=e->up );
- /* can be seperated by a horizontal/vertical line in the other direction */
+ /* can be separated by a horizontal/vertical line in the other direction */
if ( n->tmax==1 && e->tmin==0 && n->tcur>.8 && e->tcur<.2) {
t = n;
while ( (t = t->splinenext)!=e ) {
@@ -1149,82 +874,7 @@ return( n->up!=e->up );
}
return( false );
}
-#else
-int EISkipExtremum(EI *e, real pos, int major) {
- Spline1D *s;
- real slopem, slopeo;
-
- s = &e->spline->splines[major];
- slopem = (3*s->a*e->tcur+2*s->b)*e->tcur+s->c;
- s = &e->spline->splines[!major];
- slopeo = (3*s->a*e->tcur+2*s->b)*e->tcur+s->c;
- if ( !RealNear(slopeo,0)) {
- slopem/=slopeo;
- if ( slopem>-.15 && slopem<.15 )
-return( true );
- }
-return( false );
-}
-#endif
-
-#ifndef LUA_FF_LIB
-EI *EIActiveEdgesFindStem(EI *apt, real i, int major) {
- int cnt=apt->up?1:-1;
- EI *e, *p;
-
- p = NULL;
- /* If we're at an intersection point and the next spline continues */
- /* in about the same direction then this doesn't count as two lines */
- /* but as one */
- if ( EISameLine(apt,apt->aenext,i,major))
- apt = apt->aenext;
-
- e=apt->aenext;
- if ( e==NULL )
-return( NULL );
- for ( ; e!=NULL && cnt!=0; e=e->aenext ) {
- p = e;
- if ( EISkipExtremum(e,i,major)) {
- e = e->aenext;
- if ( e==NULL )
- break;
- continue;
- }
- if ( EISameLine(e,e->aenext,i,major))
- e = e->aenext;
- cnt += (e->up?1:-1);
- }
-return( p );
-}
-
-static StemInfo *StemRemoveFlexCandidates(StemInfo *stems) {
- StemInfo *s, *t, *sn;
- const real BlueShift = 7;
- /* Suppose we have something that is a flex candidate */
- /* We might get two hints from it... one from the two end points */
- /* and one from the internal point */
-
- if ( stems==NULL )
-return( NULL );
-
- for ( s=stems; (sn = s->next)!=NULL; s = sn ) {
- if ( s->start+BlueShift > sn->start && s->width>0 && sn->width>0 &&
- s->start+s->width-BlueShift < sn->start+sn->width &&
- s->start+s->width+BlueShift > sn->start+sn->width &&
- s->where->next!=NULL && sn->where->next==NULL ) {
- t = sn->next;
- sn->next = NULL;
- StemInfoFree(sn);
- s->next = t;
- sn = t;
- if ( t==NULL )
- break;
- }
- }
-return( stems );
-}
-#endif
real HIlen( StemInfo *stems) {
HintInstance *hi;
@@ -1256,45 +906,6 @@ real HIoverlap( HintInstance *mhi, HintInstance *thi) {
return( len );
}
-int StemInfoAnyOverlaps(StemInfo *stems) {
- while ( stems!=NULL ) {
- if ( stems->hasconflicts )
-return( true );
- stems = stems->next;
- }
-return( false );
-}
-
-
-#ifndef LUA_FF_LIB
-static int StemWouldConflict(StemInfo *stems,double base, double width) {
- int found;
-
- if ( width<0 ) {
- base += width;
- width = -width;
- }
- while ( stems!=NULL && stems->start<base && stems->start+stems->width<base )
- stems = stems->next;
-
- found = false;
- while ( stems!=NULL && ((stems->width>0 && stems->start<base+width) ||
- (stems->width<0 && stems->start+stems->width<base+width )) ) {
- if (( stems->start==base && stems->width==width ) ||
- (stems->start+stems->width==base && stems->width==-width ))
-return( false ); /* If it has already been added, then too late to worry about conflicts */
- if ( stems->width>0 ) {
- if ( stems->start+stems->width>=base && stems->start<=base+width )
- found = true;
- } else {
- if ( stems->start>=base && stems->start+stems->width<=base+width )
- found = true;
- }
- stems = stems->next;
- }
-return( found );
-}
-#endif
int StemListAnyConflicts(StemInfo *stems) {
StemInfo *s;
@@ -1315,228 +926,7 @@ int StemListAnyConflicts(StemInfo *stems) {
return( any );
}
-HintInstance *HICopyTrans(HintInstance *hi, real mul, real offset) {
- HintInstance *first=NULL, *last = NULL, *cur, *p;
-
- while ( hi!=NULL ) {
- cur = chunkalloc(sizeof(HintInstance));
- if ( mul>0 ) {
- cur->begin = hi->begin*mul+offset;
- cur->end = hi->end*mul+offset;
- if ( first==NULL )
- first = cur;
- else
- last->next = cur;
- last = cur;
- } else {
- cur->begin = hi->end*mul+offset;
- cur->end = hi->begin*mul+offset;
- if ( first==NULL || cur->begin<first->begin ) {
- cur->next = first;
- first = cur;
- } else {
- for ( p=first, last=p->next; last!=NULL && cur->begin>last->begin; last=last->next );
- p->next = cur;
- cur->next = last;
- }
- }
- hi = hi->next;
- }
-return( first );
-}
-
-#ifndef LUA_FF_LIB
-
-static int inhints(StemInfo *stems,real base, real width) {
-
- while ( stems!=NULL ) {
- if ( stems->start==base || stems->start+stems->width==base+width ||
- stems->start+stems->width==base || stems->start==base+width )
-return( true );
- stems = stems->next;
- }
-return( false );
-}
-
-static StemInfo *GhostAdd(StemInfo *ghosts, StemInfo *stems, real base,
- real width, real xstart, real xend ) {
- StemInfo *s, *prev, *test;
- HintInstance *hi;
-
- if ( base!=rint(base))
-return( ghosts );
-
- if ( xstart>xend ) {
- real temp = xstart;
- xstart = xend;
- xend = temp;
- }
- if ( width==20 ) base -= 20;
-
- if ( inhints(stems,base,width))
-return(ghosts); /* already recorded */
- if ( StemWouldConflict(stems,base,width))
-return(ghosts); /* Let's not add a conflicting ghost hint */
- if ( StemWouldConflict(ghosts,base,width))
-return(ghosts);
-
- for ( s=ghosts; s!=NULL; s=s->next )
- if ( s->start==base && s->width==width )
- break;
- if ( s==NULL ) {
- s = chunkalloc(sizeof(StemInfo));
- s->start = base;
- s->width = width;
- s->ghost = true;
- if ( ghosts==NULL || base<ghosts->start ) {
- s->next = ghosts;
- ghosts = s;
- } else {
- for ( prev=ghosts, test=ghosts->next; test!=NULL && base<test->start;
- prev = test, test = test->next);
- prev->next = s;
- s->next = test;
- }
- }
- hi = chunkalloc(sizeof(HintInstance));
- hi->begin = xstart;
- hi->end = xend;
- s->where = HIMerge(s->where,hi);
-return( ghosts );
-}
-
-static StemInfo *CheckForGhostHints(StemInfo *stems,SplineChar *sc, BlueData *bd) {
- /* PostScript doesn't allow a hint to stretch from one alignment zone to */
- /* another. (Alignment zones are the things in bluevalues). */
- /* Oops, I got this wrong. PS doesn't allow a hint to start in a bottom */
- /* zone and stretch to a top zone. Everything in OtherBlues is a bottom */
- /* zone. The baseline entry in BlueValues is also a bottom zone. Every- */
- /* thing else in BlueValues is a top-zone. */
- /* This means */
- /* that we can't define a horizontal stem hint which stretches from */
- /* the baseline to the top of a capital I, or the x-height of lower i */
- /* If we find any such hints we must remove them, and replace them with */
- /* ghost hints. The bottom hint has height -21, and the top -20 */
- BlueData _bd;
- SplineFont *sf = sc->parent;
- StemInfo *prev, *s, *n, *snext, *ghosts = NULL;
- SplineSet *spl, *spl_next;
- Spline *spline, *first;
- SplinePoint *sp, *sp2;
- real base, width/*, toobig = (sc->parent->ascent+sc->parent->descent)/2*/;
- int i,startfound, widthfound;
- DBounds b;
-
- /* Get the alignment zones */
- if ( bd==NULL ) {
- QuickBlues(sf,&_bd);
- bd = &_bd;
- }
-
- /* look for any stems stretching from one zone to another and remove them */
- /* (I used to turn them into ghost hints here, but that didn't work (for */
- /* example on "E" where we don't need any ghosts from the big stem because*/
- /* the narrow stems provide the hints that PS needs */
- /* However, there are counter-examples. in Garamond-Pro the "T" character */
- /* has a horizontal stem at the top which stretches between two adjacent */
- /* bluezones. Removing it is wrong. Um... Thanks Adobe */
- /* I misunderstood. Both of these were top-zones */
- for ( prev=NULL, s=stems; s!=NULL; s=snext ) {
- snext = s->next;
- startfound = widthfound = -1;
- for ( i=0; i<bd->bluecnt; ++i ) {
- if ( s->start>=bd->blues[i][0]-1 && s->start<=bd->blues[i][1]+1 )
- startfound = i;
- else if ( s->start+s->width>=bd->blues[i][0]-1 && s->start+s->width<=bd->blues[i][1]+1 )
- widthfound = i;
- }
- if ( startfound!=-1 && widthfound!=-1 &&
- ( s->start>0 || s->start+s->width<=0 ))
- startfound = widthfound = -1;
- if ( startfound!=-1 && widthfound!=-1 ) {
- if ( prev==NULL )
- stems = snext;
- else
- prev->next = snext;
- s->next = NULL;
- StemInfoFree(s);
- } else
- prev = s;
- }
-
- /* Now look and see if we can find any edges which lie in */
- /* these zones. Edges which are not currently in hints */
- /* Use the current contour to determine top or bottom */
- for ( spl = sc->layers[ly_fore].splines; spl!=NULL; spl = spl->next ) if ( spl->first->prev!=NULL ) {
- first = NULL;
- spl_next = spl->next; spl->next = NULL;
- SplineSetQuickBounds(spl,&b);
- spl->next = spl_next;
- for ( spline = spl->first->next; spline!=NULL && spline!=first; spline = spline->to->next ) {
- base = spline->from->me.y;
- if ( spline->knownlinear && base == spline->to->me.y ) {
- for ( i=0; i<bd->bluecnt; ++i ) {
- if ( base>=bd->blues[i][0]-1 && base<=bd->blues[i][1]+1 )
- break;
- }
- if ( i!=bd->bluecnt ) {
- if ( spline->from->me.y+21 > b.maxy )
- width = 20;
- else if ( spline->from->me.y-20 < b.miny )
- width = 21;
- else {
- for ( sp2= spline->from->prev->from; sp2!=spline->from && sp2->me.y==spline->from->me.y; sp2=sp2->prev->from );
- width = (sp2->me.y > spline->from->me.y)?21:20;
- }
- ghosts = GhostAdd(ghosts,stems, base,width,spline->from->me.x,spline->to->me.x);
- }
- }
- if ( first==NULL ) first = spline;
- }
- /* And check for the horizontal top of a curved surface */
- for ( sp = spl->first; ; ) {
- base = sp->me.y;
- if ( !sp->nonextcp && !sp->noprevcp && sp->nextcp.y==base &&
- sp->prevcp.y==base ) {
- for ( i=0; i<bd->bluecnt; ++i ) {
- if ( base>=bd->blues[i][0]-1 && base<=bd->blues[i][1]+1 )
- break;
- }
- if ( i!=bd->bluecnt ) {
- if ( sp->me.y+21 > b.maxy )
- width = 20;
- else if ( sp->me.y-20 < b.miny )
- width = 21;
- else {
- for ( sp2= sp->prev->from; sp2!=sp && sp2->me.y==spline->from->me.y; sp2=sp2->prev->from );
- width = (sp2->me.y > sp->me.y)?21:20;
- }
- ghosts = GhostAdd(ghosts,stems, base,width,(sp->me.x+sp->prevcp.x)/2,(sp->me.x+sp->nextcp.x)/2);
- }
- }
- sp = sp->next->to;
- if ( sp == spl->first )
- break;
- }
- }
-
- /* Finally add any ghosts we've got back into the stem list */
- for ( s=ghosts; s!=NULL; s=snext ) {
- snext = s->next;
- for ( prev=NULL, n=stems; n!=NULL && s->start>n->start; prev=n, n=n->next );
- if ( prev==NULL ) {
- s->next = stems;
- stems = s;
- } else {
- prev->next = s;
- s->next = n;
- }
- }
-return( stems );
-}
-#endif
-
-static HintInstance *SCGuessHintPoints(SplineChar *sc, StemInfo *stem,int major, int off) {
+static HintInstance *SCGuessHintPoints(SplineChar *sc, int layer, StemInfo *stem,int major, int off) {
SplinePoint *starts[20], *ends[20];
int spt=0, ept=0;
SplinePointList *spl;
@@ -1545,7 +935,7 @@ static HintInstance *SCGuessHintPoints(SplineChar *sc, StemInfo *stem,int major,
real coord;
HintInstance *head, *test, *cur, *prev;
- for ( spl=sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
+ for ( spl=sc->layers[layer].splines; spl!=NULL; spl=spl->next ) {
for ( sp=spl->first; ; sp = np ) {
coord = (major?sp->me.x:sp->me.y);
sm = coord>=stem->start-off && coord<=stem->start+off;
@@ -1574,7 +964,7 @@ static HintInstance *SCGuessHintPoints(SplineChar *sc, StemInfo *stem,int major,
break;
}
}
- if ( val!=0x80000000 ) {
+ if ( (unsigned)val!=0x80000000 ) {
for ( prev=NULL, test=head; test!=NULL && val>test->begin; prev=test, test=test->next );
if ( test==NULL || val!=test->begin ) {
cur = chunkalloc(sizeof(HintInstance));
@@ -1588,20 +978,19 @@ static HintInstance *SCGuessHintPoints(SplineChar *sc, StemInfo *stem,int major,
return( head );
}
-static void SCGuessHintInstances(SplineChar *sc, StemInfo *stem,int major) {
+static void SCGuessHintInstancesLight(SplineChar *sc, int layer, StemInfo *stem,int major) {
SplinePointList *spl;
SplinePoint *sp, *np;
int sm, wm, off;
real ob, oe;
HintInstance *s=NULL, *w=NULL, *cur, *p, *t, *n, *w2;
- ob = 0; oe = 0;
/* We've got a hint (from somewhere, old data, reading in a font, user specified etc.) */
/* but we don't have HintInstance info. So see if we can find those data */
/* Will get confused by stems with holes in them (for example if you make */
/* a hint from one side of an H to the other, it will get the whole thing */
/* not just the cross stem) */
- for ( spl=sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
+ for ( spl=sc->layers[layer].splines; spl!=NULL; spl=spl->next ) {
for ( sp=spl->first; ; sp = np ) {
sm = (major?sp->me.x:sp->me.y)==stem->start;
wm = (major?sp->me.x:sp->me.y)==stem->start+stem->width;
@@ -1740,226 +1129,31 @@ static void SCGuessHintInstances(SplineChar *sc, StemInfo *stem,int major) {
/* Surprisingly many fonts have hints which don't accurately match the */
/* points. Perhaps BlueFuzz (default 1) applies here too */
for ( off=0; off<1 && s==NULL; ++off )
- s = SCGuessHintPoints(sc,stem,major,off);
+ s = SCGuessHintPoints(sc,layer, stem,major,off);
stem->where = s;
}
-static StemInfo *StemInfoAdd(StemInfo *list, StemInfo *new) {
- StemInfo *prev, *test;
-
- for ( prev=NULL, test=list; test!=NULL && new->start>test->start; prev=test, test=test->next );
- if ( test!=NULL && test->start==new->start && test->width==new->width ) {
- /* Replace the old with the new */
- /* can't just free the new, because the Guess routines depend on it */
- /* being around */
- new->next = test->next;
- StemInfoFree(test);
- } else
- new->next = test;
- if ( prev==NULL )
- list = new;
- else
- prev->next = new;
-return( list );
-}
-
-void SCGuessHHintInstancesAndAdd(SplineChar *sc, StemInfo *stem, real guess1, real guess2) {
- SCGuessHintInstances(sc, stem, 0);
- sc->hstem = StemInfoAdd(sc->hstem,stem);
- if ( stem->where==NULL && guess1!=0x80000000 ) {
- if ( guess1>guess2 ) { real temp = guess1; guess1 = guess2; guess2 = temp; }
- stem->where = chunkalloc(sizeof(HintInstance));
- stem->where->begin = guess1;
- stem->where->end = guess2;
- }
- sc->hconflicts = StemListAnyConflicts(sc->hstem);
- if ( stem->hasconflicts ) {
- /*StemInfoReduceOverlap(sc->hstem,stem);*/ /* User asked for it, assume s/he knows what s/he's doing */
- if ( stem->where==NULL )
- IError("Couldn't figure out where this hint is active");
- }
-}
-
-void SCGuessVHintInstancesAndAdd(SplineChar *sc, StemInfo *stem, real guess1, real guess2) {
- SCGuessHintInstances(sc, stem, 1);
- sc->vstem = StemInfoAdd(sc->vstem,stem);
- if ( stem->where==NULL && guess1!=0x80000000 ) {
- if ( guess1>guess2 ) { real temp = guess1; guess1 = guess2; guess2 = temp; }
- stem->where = chunkalloc(sizeof(HintInstance));
- stem->where->begin = guess1;
- stem->where->end = guess2;
- }
- sc->vconflicts = StemListAnyConflicts(sc->vstem);
- if ( stem->hasconflicts ) {
- /*StemInfoReduceOverlap(sc->vstem,stem);*/ /* User asked for it, assume s/he knows what s/he's doing */
- if ( stem->where==NULL )
- IError("Couldn't figure out where this hint is active");
- }
-}
-
-void SCGuessHHintInstancesList(SplineChar *sc) {
+void SCGuessHHintInstancesList(SplineChar *sc,int layer) {
StemInfo *h;
- int any = false;
-
- for ( h= sc->hstem; h!=NULL; h=h->next )
+ for ( h= sc->hstem; h!=NULL; h=h->next ) {
if ( h->where==NULL ) {
- SCGuessHintInstances(sc,h,0);
- any |= h->where!=NULL;
+ SCGuessHintInstancesLight( sc,layer,h,false );
}
-/*
- if ( any )
- for ( h= sc->hstem; h!=NULL; h=h->next )
- StemInfoReduceOverlap(h->next,h);
-*/
+ }
}
-void SCGuessVHintInstancesList(SplineChar *sc) {
+void SCGuessVHintInstancesList(SplineChar *sc,int layer) {
StemInfo *h;
- int any = false;
-
- for ( h= sc->vstem; h!=NULL; h=h->next )
+ for ( h= sc->vstem; h!=NULL; h=h->next ) {
if ( h->where==NULL ) {
- SCGuessHintInstances(sc,h,1);
- any |= h->where!=NULL;
+ SCGuessHintInstancesLight( sc,layer,h,true );
}
-/*
- if ( any )
- for ( h= sc->vstem; h!=NULL; h=h->next )
- StemInfoReduceOverlap(h->next,h);
-*/
-}
-
-#ifndef LUA_FF_LIB
-static StemInfo *RefHintsMerge(StemInfo *into, StemInfo *rh, real mul, real offset,
- real omul, real oofset) {
- StemInfo *prev, *h, *n;
- real start, width;
-
- for ( ; rh!=NULL; rh=rh->next ) {
- start = rh->start*mul + offset;
- width = rh->width *mul;
- if ( width<0 ) {
- start += width; width = -width;
- }
- for ( h=into, prev=NULL; h!=NULL && (start>h->start || (start==h->start && width>h->width)); prev=h, h=h->next );
- if ( h==NULL || start!=h->start || width!=h->width ) {
- n = chunkalloc(sizeof(StemInfo));
- n->start = start; n->width = width;
- n->next = h;
- if ( prev==NULL )
- into = n;
- else
- prev->next = n;
- n->where = HICopyTrans(rh->where,omul,oofset);
- } else
- h->where = HIMerge(h->where,HICopyTrans(rh->where,omul,oofset));
}
-return( into );
}
-static DStemInfo *RefDHintsMerge(DStemInfo *into, DStemInfo *rh, real xmul, real xoffset,
- real ymul, real yoffset) {
- DStemInfo *new;
- BasePoint temp;
- DStemInfo *prev, *n;
-
- for ( ; rh!=NULL; rh=rh->next ) {
- new = chunkalloc(sizeof(DStemInfo));
- *new = *rh;
- new->leftedgetop.x = xmul*new->leftedgetop.x + xoffset;
- new->rightedgetop.x = xmul*new->rightedgetop.x + xoffset;
- new->leftedgebottom.x = xmul*new->leftedgebottom.x + xoffset;
- new->rightedgebottom.x = xmul*new->rightedgebottom.x + xoffset;
- new->leftedgetop.y = ymul*new->leftedgetop.y + yoffset;
- new->rightedgetop.y = ymul*new->rightedgetop.y + yoffset;
- new->leftedgebottom.y = ymul*new->leftedgebottom.y + yoffset;
- new->rightedgebottom.y = ymul*new->rightedgebottom.y + yoffset;
- if ( xmul<0 ) {
- temp = new->leftedgetop;
- new->leftedgetop = new->rightedgetop;
- new->rightedgetop = temp;
- temp = new->leftedgebottom;
- new->leftedgebottom = new->rightedgebottom;
- new->rightedgebottom = temp;
- }
- if ( ymul<0 ) {
- temp = new->leftedgetop;
- new->leftedgetop = new->leftedgebottom;
- new->leftedgebottom = temp;
- temp = new->rightedgetop;
- new->rightedgetop = new->rightedgebottom;
- new->rightedgebottom = temp;
- }
- if ( into==NULL || new->leftedgetop.x<into->leftedgetop.x ) {
- new->next = into;
- into = new;
- } else {
- for ( prev=into, n=prev->next; n!=NULL && new->leftedgetop.x>n->leftedgetop.x;
- prev = n, n = n->next );
- new->next = n;
- prev->next = new;
- }
- }
-return( into );
-}
-static void AutoHintRefs(SplineChar *sc,BlueData *bd, int picky) {
- RefChar *ref;
-
- /* Add hints for base characters before accent hints => if there are any */
- /* conflicts, the base characters win */
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( ref->transform[1]==0 && ref->transform[2]==0 ) {
- if ( picky ) {
- if ( !ref->sc->manualhints && ref->sc->changedsincelasthinted &&
- (ref->sc->layers[ly_fore].refs!=NULL &&
- ref->sc->layers[ly_fore].splines==NULL))
- AutoHintRefs(ref->sc,bd,true);
- } else if ( !ref->sc->manualhints && ref->sc->changedsincelasthinted )
- SplineCharAutoHint(ref->sc,bd);
- if ( ref->sc->unicodeenc!=-1 && ref->sc->unicodeenc<0x10000 &&
- isalnum(ref->sc->unicodeenc) ) {
- sc->hstem = RefHintsMerge(sc->hstem,ref->sc->hstem,ref->transform[3], ref->transform[5], ref->transform[0], ref->transform[4]);
- sc->vstem = RefHintsMerge(sc->vstem,ref->sc->vstem,ref->transform[0], ref->transform[4], ref->transform[3], ref->transform[5]);
- sc->dstem = RefDHintsMerge(sc->dstem,ref->sc->dstem,ref->transform[0], ref->transform[4], ref->transform[3], ref->transform[5]);
- }
- }
- }
-
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( ref->transform[1]==0 && ref->transform[2]==0 &&
- (ref->sc->unicodeenc==-1 || ref->sc->unicodeenc>=0x10000 ||
- !isalnum(ref->sc->unicodeenc)) ) {
- sc->hstem = RefHintsMerge(sc->hstem,ref->sc->hstem,ref->transform[3], ref->transform[5], ref->transform[0], ref->transform[4]);
- sc->vstem = RefHintsMerge(sc->vstem,ref->sc->vstem,ref->transform[0], ref->transform[4], ref->transform[3], ref->transform[5]);
- sc->dstem = RefDHintsMerge(sc->dstem,ref->sc->dstem,ref->transform[0], ref->transform[4], ref->transform[3], ref->transform[5]);
- }
- }
-
- sc->vconflicts = StemListAnyConflicts(sc->vstem);
- sc->hconflicts = StemListAnyConflicts(sc->hstem);
-
- SCOutOfDateBackground(sc);
- SCHintsChanged(sc);
-}
-#endif
-
-void SCClearHints(SplineChar *sc) {
- SCClearHintMasks(sc,true);
- StemInfosFree(sc->hstem);
- StemInfosFree(sc->vstem);
- sc->hstem = sc->vstem = NULL;
- sc->hconflicts = sc->vconflicts = false;
- DStemInfosFree(sc->dstem);
- sc->dstem = NULL;
- MinimumDistancesFree(sc->md);
- sc->md = NULL;
- SCClearRounds(sc);
- SCOutOfDateBackground(sc);
-}
-
-static void _SCClearHintMasks(SplineChar *sc,int counterstoo) {
+static void _SCClearHintMasks(SplineChar *sc,int layer, int counterstoo) {
SplineSet *spl;
SplinePoint *sp;
RefChar *ref;
@@ -1969,7 +1163,7 @@ static void _SCClearHintMasks(SplineChar *sc,int counterstoo) {
sc->countermasks = NULL; sc->countermask_cnt = 0;
}
- for ( spl = sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
+ for ( spl = sc->layers[layer].splines; spl!=NULL; spl=spl->next ) {
for ( sp = spl->first ; ; ) {
chunkfree(sp->hintmask,sizeof(HintMask));
sp->hintmask = NULL;
@@ -1981,7 +1175,7 @@ static void _SCClearHintMasks(SplineChar *sc,int counterstoo) {
}
}
- for ( ref = sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
+ for ( ref = sc->layers[layer].refs; ref!=NULL; ref=ref->next ) {
for ( spl = ref->layers[0].splines; spl!=NULL; spl=spl->next ) {
for ( sp = spl->first ; ; ) {
chunkfree(sp->hintmask,sizeof(HintMask));
@@ -1996,85 +1190,26 @@ static void _SCClearHintMasks(SplineChar *sc,int counterstoo) {
}
}
-static void ModifyHintMaskAdd(HintMask *hm,int index) {
- int i;
-
- if ( hm==NULL )
-return;
-
- for ( i=94; i>=index ; --i ) {
- if ( (*hm)[i>>3]&(0x80>>(i&7)) )
- (*hm)[(i+1)>>3] |= (0x80>>((i+1)&7));
- else
- (*hm)[(i+1)>>3] &= ~(0x80>>((i+1)&7));
- }
- (*hm)[index>>3] &= ~(0x80>>(index&7));
-}
-
-void SCModifyHintMasksAdd(SplineChar *sc,StemInfo *new) {
- SplineSet *spl;
- SplinePoint *sp;
- RefChar *ref;
- int index;
- StemInfo *h;
- int i;
- /* We've added a new stem. Figure out where it goes and modify the */
- /* hintmasks accordingly */
-
- for ( index=0, h=sc->hstem; h!=NULL && h!=new; ++index, h=h->next );
- if ( h==NULL )
- for ( h=sc->vstem; h!=NULL && h!=new; ++index, h=h->next );
- if ( h==NULL )
-return;
-
- for ( i=0; i<sc->countermask_cnt; ++i )
- ModifyHintMaskAdd(&sc->countermasks[i],index);
-
- for ( spl = sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
- for ( sp = spl->first ; ; ) {
- ModifyHintMaskAdd(sp->hintmask,index);
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
-
- for ( ref = sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- for ( spl = ref->layers[0].splines; spl!=NULL; spl=spl->next ) {
- for ( sp = spl->first ; ; ) {
- ModifyHintMaskAdd(sp->hintmask,index);
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
- }
-}
static void SCFigureSimpleCounterMasks(SplineChar *sc) {
SplineChar *scs[MmMax];
-#ifndef LUA_FF_LIB
- int hadh3, hadv3, i;
+ int hadh3, hadv3, i, vbase;
HintMask mask;
-#endif
+ StemInfo *h;
if ( sc->countermask_cnt!=0 )
return;
scs[0] = sc;
-#ifndef LUA_FF_LIB
hadh3 = CvtPsStem3(NULL,scs,1,true,false);
hadv3 = CvtPsStem3(NULL,scs,1,false,false);
if ( hadh3 || hadv3 ) {
memset(mask,0,sizeof(mask));
if ( hadh3 ) mask[0] = 0x80|0x40|0x20;
if ( hadv3 ) {
+ for ( h=sc->hstem, vbase=0; h!=NULL; h=h->next, ++vbase );
for ( i=0; i<3 ; ++i ) {
- int j = i+sc->vstem->hintnumber;
+ int j = i+vbase;
mask[j>>3] |= (0x80>>(j&7));
}
}
@@ -2083,149 +1218,21 @@ return;
memcpy(sc->countermasks[0],mask,sizeof(HintMask));
return;
}
-#endif
-}
-
-/* find all the other stems (after main) which seem to form a counter group */
-/* with main. That is their stems have a considerable overlap (in the other */
-/* coordinate) with main */
-static int stemmatches(StemInfo *main) {
- StemInfo *last=main, *test;
- real mlen, olen;
- int cnt;
-
- cnt = 1; /* for the main stem */
- main->tobeused = true;
- mlen = HIlen(main);
- for ( test=main->next; test!=NULL; test=test->next )
- test->tobeused = false;
- for ( test=main->next; test!=NULL; test=test->next ) {
- if ( test->used || last->start+last->width>test->start || test->hintnumber==-1 )
- continue;
- olen = HIoverlap(main->where,test->where);
- if ( olen>mlen/3 && olen>HIlen(test)/3 ) {
- test->tobeused = true;
- ++cnt;
- }
- }
-return( cnt );
-}
-
-static int FigureCounters(StemInfo *stems,HintMask mask ) {
- StemInfo *h, *first;
-
- while ( stems!=NULL ) {
- for ( first=stems; first!=NULL && first->used; first = first->next );
- if ( first==NULL )
- break;
- if ( first->where==NULL || first->hintnumber==-1 || stemmatches(first)<=2 ) {
- first->used = true;
- stems = first->next;
- continue;
- }
- for ( h = first; h!=NULL; h = h->next ) {
- if ( h->tobeused ) {
- mask[h->hintnumber>>3] |= (0x80>>(h->hintnumber&7));
- h->used = true;
- }
- }
-return( true );
- }
-return( false );
-}
-
-/* Only used for metafont routine */
-void SCFigureVerticalCounterMasks(SplineChar *sc) {
- HintMask masks[30];
- StemInfo *h;
- int mc=0, i;
-
- /* I'm not supporting counter hints for mm fonts */
-
- if ( sc==NULL )
-return;
-
- free(sc->countermasks);
- sc->countermask_cnt = 0;
- sc->countermasks = NULL;
-
- for ( h=sc->vstem; h!=NULL ; h=h->next )
- h->used = false;
-
- mc = 0;
-
- while ( mc<sizeof(masks)/sizeof(masks[0]) ) {
- memset(masks[mc],'\0',sizeof(HintMask));
- if ( !FigureCounters(sc->vstem,masks[mc]))
- break;
- ++mc;
- }
- if ( mc!=0 ) {
- sc->countermask_cnt = mc;
- sc->countermasks = galloc(mc*sizeof(HintMask));
- for ( i=0; i<mc ; ++i )
- memcpy(sc->countermasks[i],masks[i],sizeof(HintMask));
- }
}
-void SCFigureCounterMasks(SplineChar *sc) {
- HintMask masks[30];
- uint32 script;
- StemInfo *h;
- int mc=0, i;
-
- /* I'm not supporting counter hints for mm fonts */
-
- if ( sc==NULL )
-return;
-
- free(sc->countermasks);
- sc->countermask_cnt = 0;
- sc->countermasks = NULL;
-
- /* Check for h/vstem3 case */
- /* Which is allowed even for non-CJK letters */
- script = SCScriptFromUnicode(sc);
- if ( script==CHR('l','a','t','n') || script==CHR('c','y','r','l') ||
- script==CHR('g','r','e','k') ) {
- SCFigureSimpleCounterMasks(sc);
-return;
- }
-
- for ( h=sc->hstem; h!=NULL ; h=h->next )
- h->used = false;
- for ( h=sc->vstem; h!=NULL ; h=h->next )
- h->used = false;
-
- mc = 0;
-
- while ( mc<sizeof(masks)/sizeof(masks[0]) ) {
- memset(masks[mc],'\0',sizeof(HintMask));
- if ( !FigureCounters(sc->hstem,masks[mc]) && !FigureCounters(sc->vstem,masks[mc]))
- break;
- ++mc;
- }
- if ( mc!=0 ) {
- sc->countermask_cnt = mc;
- sc->countermasks = galloc(mc*sizeof(HintMask));
- for ( i=0; i<mc ; ++i )
- memcpy(sc->countermasks[i],masks[i],sizeof(HintMask));
- }
-}
-
-void SCClearHintMasks(SplineChar *sc,int counterstoo) {
+void SCClearHintMasks(SplineChar *sc,int layer,int counterstoo) {
MMSet *mm = sc->parent->mm;
int i;
if ( mm==NULL )
- _SCClearHintMasks(sc,counterstoo);
+ _SCClearHintMasks(sc,layer,counterstoo);
else {
for ( i=0; i<mm->instance_count; ++i ) {
if ( sc->orig_pos<mm->instances[i]->glyphcnt )
- _SCClearHintMasks(mm->instances[i]->glyphs[sc->orig_pos],counterstoo);
+ _SCClearHintMasks(mm->instances[i]->glyphs[sc->orig_pos],layer,counterstoo);
}
if ( sc->orig_pos<mm->normal->glyphcnt )
- _SCClearHintMasks(mm->normal->glyphs[sc->orig_pos],counterstoo);
+ _SCClearHintMasks(mm->normal->glyphs[sc->orig_pos],layer,counterstoo);
}
}
@@ -2666,7 +1673,7 @@ static void SplResolveSplitHints(SplineChar *scs[MmMax], SplineSet *spl[MmMax],
}
}
-static void ResolveSplitHints(SplineChar *scs[16],int instance_count) {
+static void ResolveSplitHints(SplineChar *scs[16],int layer,int instance_count) {
/* It is possible for a single hint in one mm instance to split into two */
/* in a different MM set. For example, we have two stems which happen */
/* to line up in one instance but which do not in another instance. */
@@ -2682,7 +1689,7 @@ static void ResolveSplitHints(SplineChar *scs[16],int instance_count) {
hcnt = NumberHints(scs[i]);
UntickHints(scs[i]);
if ( hcnt>hmax ) hmax = hcnt;
- spl[i] = scs[i]->layers[ly_fore].splines;
+ spl[i] = scs[i]->layers[layer].splines;
}
if ( hmax==0 )
return;
@@ -2690,7 +1697,7 @@ return;
SplResolveSplitHints(scs,spl,instance_count,&hs,&vs);
anymore = false;
for ( i=0; i<instance_count; ++i ) {
- ref[i] = scs[i]->layers[ly_fore].refs;
+ ref[i] = scs[i]->layers[layer].refs;
if ( ref[i]!=NULL ) anymore = true;
}
while ( anymore ) {
@@ -2777,7 +1784,7 @@ static int SplFigureHintMasks(SplineChar *scs[MmMax], SplineSet *spl[MmMax],
return( inited );
}
-void SCFigureHintMasks(SplineChar *sc) {
+void SCFigureHintMasks(SplineChar *sc,int layer) {
SplineChar *scs[MmMax];
SplinePointList *spl[MmMax];
RefChar *ref[MmMax];
@@ -2788,7 +1795,7 @@ void SCFigureHintMasks(SplineChar *sc) {
if ( mm==NULL ) {
scs[0] = sc;
instance_count = 1;
- SCClearHintMasks(sc,false);
+ SCClearHintMasks(sc,layer,false);
} else {
if ( mm->apple )
return;
@@ -2796,9 +1803,9 @@ return;
for ( i=0; i<instance_count; ++i )
if ( sc->orig_pos < mm->instances[i]->glyphcnt ) {
scs[i] = mm->instances[i]->glyphs[sc->orig_pos];
- SCClearHintMasks(scs[i],false);
+ SCClearHintMasks(scs[i],layer,false);
}
- ResolveSplitHints(scs,instance_count);
+ ResolveSplitHints(scs,layer,instance_count);
}
conflicts = false;
for ( i=0; i<instance_count; ++i ) {
@@ -2812,8 +1819,8 @@ return; /* In an MM font we may still need to resolve things like different
}
for ( i=0; i<instance_count; ++i ) {
- spl[i] = scs[i]->layers[ly_fore].splines;
- ref[i] = scs[i]->layers[ly_fore].refs;
+ spl[i] = scs[i]->layers[layer].splines;
+ ref[i] = scs[i]->layers[layer].refs;
}
inited = SplFigureHintMasks(scs,spl,instance_count,mask,false);
forever {
@@ -2835,328 +1842,8 @@ return; /* In an MM font we may still need to resolve things like different
if ( instance_count==1 )
SCFigureSimpleCounterMasks(sc);
}
-#ifndef LUA_FF_LIB
-
-static HintInstance *StemAddHIFromActive(struct stemdata *stem,int major) {
- int i;
- HintInstance *head = NULL, *cur, *t;
- double mino, maxo;
- double dir = ((real *) &stem->unit.x)[major]<0 ? -1 : 1;
-
- for ( i=0; i<stem->activecnt; ++i ) {
- mino = dir*stem->active[i].start + ((real *) &stem->left.x)[major];
- maxo = dir*stem->active[i].end + ((real *) &stem->left.x)[major];
- cur = chunkalloc(sizeof(HintInstance));
- if ( dir>0 ) {
- cur->begin = mino;
- cur->end = maxo;
- if ( head==NULL )
- head = cur;
- else
- t->next = cur;
- t = cur;
- } else {
- cur->begin = maxo;
- cur->end = mino;
- cur->next = head;
- head = cur;
- }
- }
-return( head );
-}
-
-static void GDReassignPoint(struct glyphdata *gd,struct stemdata *stem,struct pointdata **_pd) {
- struct pointdata *pd = *_pd;
- BasePoint *dir;
- int i,j;
- struct stemdata *potential;
- int chunk, is_r;
-
- if ( pd==NULL )
-return;
- if ( pd->nextstem==stem )
- dir = &pd->nextunit;
- else if ( pd->prevstem==stem )
- dir = &pd->prevunit;
- else {
- *_pd = NULL;
-return;
- }
-
- potential = NULL; chunk = is_r = -1;
- for ( i=0; i<gd->stemcnt; ++i ) {
- struct stemdata *stem = &gd->stems[i];
- if ( !stem->toobig && UnitsParallel(dir,&stem->unit)) {
- for ( j=0; j<stem->chunk_cnt; ++j ) {
- if ( stem->chunks[j].lpotential==pd ) {
- if ( potential==stem )
- /* Do Nothing */;
- else if ( potential!=NULL )
-return;
- else {
- potential = stem; chunk = j; is_r = false;
- }
- } else if ( stem->chunks[j].rpotential==pd ) {
- if ( potential==stem )
- /* Do Nothing */;
- else if ( potential!=NULL )
-return;
- else {
- potential = stem; chunk = j; is_r = true;
- }
- }
- }
- }
- }
-
- if ( potential!=NULL ) {
- if ( is_r && potential->chunks[chunk].r==NULL ) {
- potential->chunks[chunk].r = pd;
- *_pd = NULL;
- } else if ( !is_r && potential->chunks[chunk].l==NULL ) {
- potential->chunks[chunk].l = pd;
- *_pd = NULL;
- }
- }
-}
-
-
-static void GDPreprocess(struct glyphdata *gd) {
- int i,j;
-
- /* Remove points from unusable stem and see if we can use 'em elsewhere */
- for ( i=0; i<gd->stemcnt; ++i ) {
- struct stemdata *stem = &gd->stems[i];
- if ( stem->toobig ) {
- for ( j=0; j<stem->chunk_cnt; ++j ) {
- GDReassignPoint(gd,stem,&stem->chunks[j].l);
- GDReassignPoint(gd,stem,&stem->chunks[j].r);
- }
- }
- }
-
- for ( i=0; i<gd->pcnt; ++i ) {
- struct pointdata *pd = &gd->points[i];
- if ( pd->colinear ) {
- if ( pd->nextstem==NULL )
- pd->nextstem = pd->prevstem;
- else if ( pd->prevstem==NULL )
- pd->prevstem = pd->nextstem;
- }
- if ( pd->colinear && pd->nextstem!=NULL && pd->nextstem!=pd->prevstem ) {
- double width1, width2;
- if ( pd->nextunit.x==0 ) {
- if ( (width1 = pd->nextstem->left.x-pd->nextstem->right.x )<0 )
- width1 = -width1;
- if ( (width2 = pd->prevstem->left.x-pd->prevstem->right.x )<0 )
- width2 = -width2;
- } else {
- if ( (width1 = pd->nextstem->left.y-pd->nextstem->right.y )<0 )
- width1 = -width1;
- if ( (width2 = pd->prevstem->left.y-pd->prevstem->right.y )<0 )
- width2 = -width2;
- }
- if ( width1>width2 && pd->nextstem->chunk_cnt<=1 ) {
- if ( pd->nextstem->chunk_cnt==1 )
- pd->nextstem->chunks[0].l = pd->nextstem->chunks[0].r = NULL;
- } else if ( width1<width2 && pd->prevstem->chunk_cnt<=1 ) {
- if ( pd->prevstem->chunk_cnt==1 )
- pd->prevstem->chunks[0].l = pd->prevstem->chunks[0].r = NULL;
- }
- }
- }
-}
-
-static StemInfo *GDFindStems(struct glyphdata *gd, int major) {
- int i;
- StemInfo *head = NULL, *cur, *p, *t;
- struct stemdata *stem;
- int other = !major;
-
- for ( i=0; i<gd->stemcnt; ++i ) {
- stem = &gd->stems[i];
- if ( stem->toobig )
- continue;
- if ((( stem->unit.y>.99 || stem->unit.y<-.99) && major==1 ) ||
- (( stem->unit.x>.99 || stem->unit.x<-.99) && major==0 )) {
- double l = (&stem->left.x)[other], r = (&stem->right.x)[other];
- int j, hasl=false, hasr=false;
- for ( j=0; j<stem->chunk_cnt; ++j ) {
- if ( stem->chunks[j].l!=NULL ) hasl = true;
- if ( stem->chunks[j].r!=NULL ) hasr = true;
- }
- if ( !hasl || !hasr )
- continue;
- cur = chunkalloc(sizeof(StemInfo));
- if ( l<r ) {
- cur->start = l;
- cur->width = r - l;
- cur->haspointleft = hasl;
- cur->haspointright = hasr;
- } else {
- cur->start = r;
- cur->width = l - r;
- cur->haspointleft = hasr;
- cur->haspointright = hasl;
- }
- for ( p=NULL, t=head; t!=NULL ; p=t, t=t->next ) {
- if ( cur->start<=t->start )
- break;
- }
- cur->next = t;
- if ( p==NULL )
- head = cur;
- else
- p->next = cur;
- cur->where = StemAddHIFromActive(stem,major);
- }
- }
- head = StemRemoveFlexCandidates(head);
-return( head );
-}
-
-void _SplineCharAutoHint( SplineChar *sc, BlueData *bd, struct glyphdata *gd2 ) {
- struct glyphdata *gd;
-
- SCPreserveHints(sc);
- StemInfosFree(sc->vstem); sc->vstem=NULL;
- StemInfosFree(sc->hstem); sc->hstem=NULL;
- DStemInfosFree(sc->dstem); sc->dstem=NULL;
- MinimumDistancesFree(sc->md); sc->md=NULL;
-
- free(sc->countermasks);
- sc->countermasks = NULL; sc->countermask_cnt = 0;
- /* We'll free the hintmasks when we call SCFigureHintMasks */
-
- sc->changedsincelasthinted = false;
- sc->manualhints = false;
-
- if ( (gd=gd2)==NULL )
- gd = GlyphDataBuild(sc,true);
- if ( gd!=NULL ) {
- GDPreprocess(gd);
- sc->vstem = GDFindStems(gd,1);
- sc->hstem = GDFindStems(gd,0);
- if ( gd2==NULL ) GlyphDataFree(gd);
- sc->hstem = CheckForGhostHints(sc->hstem,sc,bd);
- }
-
- AutoHintRefs(sc,bd,false);
-}
-void SplineCharAutoHint( SplineChar *sc, BlueData *bd ) {
- MMSet *mm = sc->parent->mm;
- int i;
-
- if ( mm==NULL )
- _SplineCharAutoHint(sc,bd,NULL);
- else {
- for ( i=0; i<mm->instance_count; ++i )
- if ( sc->orig_pos < mm->instances[i]->glyphcnt )
- _SplineCharAutoHint(mm->instances[i]->glyphs[sc->orig_pos],NULL,NULL);
- if ( sc->orig_pos < mm->normal->glyphcnt )
- _SplineCharAutoHint(mm->normal->glyphs[sc->orig_pos],NULL,NULL);
- }
- SCFigureHintMasks(sc);
- SCUpdateAll(sc);
-}
-
-void SFSCAutoHint( SplineChar *sc, BlueData *bd ) {
- RefChar *ref;
-
- if ( sc->ticked )
-return;
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
- if ( !ref->sc->ticked )
- SFSCAutoHint(ref->sc,bd);
- }
- sc->ticked = true;
- SplineCharAutoHint(sc,bd);
-}
-
-int SFNeedsAutoHint( SplineFont *_sf) {
- int i,k;
- SplineFont *sf;
- k=0;
- do {
- sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( sf->glyphs[i]->changedsincelasthinted &&
- !sf->glyphs[i]->manualhints )
-return( true );
- }
- ++k;
- } while ( k<_sf->subfontcnt );
-return( false );
-}
-
-void SplineFontAutoHint( SplineFont *_sf) {
- int i,k;
- SplineFont *sf;
- BlueData *bd = NULL, _bd;
- SplineChar *sc;
-
- if ( _sf->mm==NULL ) {
- QuickBlues(_sf,&_bd);
- bd = &_bd;
- }
-
- /* Tick the ones we don't want to AH, untick the ones that need AH */
- k=0;
- do {
- sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc = sf->glyphs[i])!=NULL )
- sc->ticked = ( !sc->changedsincelasthinted || sc->manualhints );
- ++k;
- } while ( k<_sf->subfontcnt );
-
- k=0;
- do {
- sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- if ( sf->glyphs[i]->changedsincelasthinted &&
- !sf->glyphs[i]->manualhints )
- SFSCAutoHint(sf->glyphs[i],bd);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next()) {
- k = _sf->subfontcnt+1;
- break;
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
- ++k;
- } while ( k<_sf->subfontcnt );
-}
-
-void SplineFontAutoHintRefs( SplineFont *_sf) {
- int i,k;
- SplineFont *sf;
- BlueData *bd = NULL, _bd;
- SplineChar *sc;
-
- if ( _sf->mm==NULL ) {
- QuickBlues(_sf,&_bd);
- bd = &_bd;
- }
-
- k=0;
- do {
- sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc = sf->glyphs[i])!=NULL ) {
- if ( sc->changedsincelasthinted &&
- !sc->manualhints &&
- (sc->layers[ly_fore].refs!=NULL && sc->layers[ly_fore].splines==NULL)) {
- SCPreserveHints(sc);
- StemInfosFree(sc->vstem); sc->vstem=NULL;
- StemInfosFree(sc->hstem); sc->hstem=NULL;
- AutoHintRefs(sc,bd,true);
- }
- }
- ++k;
- } while ( k<_sf->subfontcnt );
-}
-#endif
static void FigureStems( SplineFont *sf, real snaps[12], real cnts[12],
int which ) {
@@ -3295,7 +1982,7 @@ return( true );
return( false );
}
-static int _SplineCharIsFlexible(SplineChar *sc, int blueshift) {
+static int _SplineCharIsFlexible(SplineChar *sc, int layer, int blueshift) {
/* Need two splines
outer endpoints have same x (or y) values
inner point must be less than 20 horizontal (v) units from the outer points
@@ -3317,7 +2004,7 @@ static int _SplineCharIsFlexible(SplineChar *sc, int blueshift) {
if ( sc==NULL )
return(false);
- for ( spl = sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
+ for ( spl = sc->layers[layer].splines; spl!=NULL; spl=spl->next ) {
if ( spl->first->prev==NULL ) {
/* Mark everything on the open path as inflexible */
sp=spl->first;
@@ -3380,95 +2067,23 @@ return(false);
sp = np;
} while ( sp!=spl->first );
}
- sc->anyflexes = max>0;
+ sc->layers[layer].anyflexes = max>0;
if ( max==0 )
- for ( r = sc->layers[ly_fore].refs; r!=NULL ; r=r->next )
- if ( r->sc->anyflexes ) {
- sc->anyflexes = true;
+ for ( r = sc->layers[layer].refs; r!=NULL ; r=r->next )
+ if ( r->sc->layers[layer].anyflexes ) {
+ sc->layers[layer].anyflexes = true;
break;
}
return( max );
}
-static int MatchFlexes(MMSet *mm,int opos) {
- int any=false, i;
- SplineSet *spl[16];
- SplinePoint *sp[16];
- int mismatchx, mismatchy;
- for ( i=0; i<mm->instance_count; ++i )
- if ( opos<mm->instances[i]->glyphcnt && mm->instances[i]->glyphs[opos]!=NULL )
- spl[i] = mm->instances[i]->glyphs[opos]->layers[ly_fore].splines;
- else
- spl[i] = NULL;
- while ( spl[0]!=NULL ) {
- for ( i=0; i<mm->instance_count; ++i )
- if ( spl[i]!=NULL )
- sp[i] = spl[i]->first;
- else
- sp[i] = NULL;
- while ( sp[0]!=NULL ) {
- mismatchx = mismatchy = false;
- for ( i=1 ; i<mm->instance_count; ++i ) {
- if ( sp[i]==NULL )
- mismatchx = mismatchy = true;
- else {
- if ( sp[i]->flexx != sp[0]->flexx )
- mismatchx = true;
- if ( sp[i]->flexy != sp[0]->flexy )
- mismatchy = true;
- }
- }
- if ( mismatchx || mismatchy ) {
- for ( i=0 ; i<mm->instance_count; ++i ) if ( sp[i]!=NULL ) {
- if ( mismatchx ) sp[i]->flexx = false;
- if ( mismatchy ) sp[i]->flexy = false;
- }
- }
- if ( sp[0]->flexx || sp[0]->flexy )
- any = true;
- for ( i=0 ; i<mm->instance_count; ++i ) if ( sp[i]!=NULL ) {
- if ( sp[i]->next==NULL ) sp[i] = NULL;
- else sp[i] = sp[i]->next->to;
- }
- if ( sp[0] == spl[0]->first )
- break;
- }
- for ( i=0; i<mm->instance_count; ++i )
- if ( spl[i]!=NULL )
- spl[i] = spl[i]->next;
- }
-return( any );
-}
-
-int SplineCharIsFlexible(SplineChar *sc) {
- char *pt;
- int blueshift;
- int i;
- MMSet *mm;
-
- pt = PSDictHasEntry(sc->parent->private,"BlueShift");
- blueshift = 7; /* use default value here */
- if ( pt!=NULL ) {
- blueshift = strtol(pt,NULL,10);
- if ( blueshift>21 ) blueshift = 21;
- } else if ( PSDictHasEntry(sc->parent->private,"BlueValues")!=NULL )
- blueshift = 7;
- if ( sc->parent->mm==NULL )
-return( _SplineCharIsFlexible(sc,blueshift));
-
- mm = sc->parent->mm;
- for ( i = 0; i<mm->instance_count; ++i )
- if ( sc->orig_pos<mm->instances[i]->glyphcnt && mm->instances[i]->glyphs[sc->orig_pos]!=NULL )
- _SplineCharIsFlexible(mm->instances[i]->glyphs[sc->orig_pos],blueshift);
-return( MatchFlexes(mm,sc->orig_pos));
-}
-static void SCUnflex(SplineChar *sc) {
+static void SCUnflex(SplineChar *sc, int layer) {
SplineSet *spl;
SplinePoint *sp;
- for ( spl = sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next ) {
+ for ( spl = sc->layers[layer].splines; spl!=NULL; spl=spl->next ) {
/* Mark everything on the path as inflexible */
sp=spl->first;
while ( 1 ) {
@@ -3480,18 +2095,18 @@ static void SCUnflex(SplineChar *sc) {
break;
}
}
- sc->anyflexes = false;
+ sc->layers[layer].anyflexes = false;
}
-static void FlexDependents(SplineChar *sc) {
+static void FlexDependents(SplineChar *sc,int layer) {
struct splinecharlist *scl;
- sc->anyflexes = true;
+ sc->layers[layer].anyflexes = true;
for ( scl = sc->dependents; scl!=NULL; scl=scl->next )
- FlexDependents(scl->sc);
+ FlexDependents(scl->sc,layer);
}
-int SplineFontIsFlexible(SplineFont *sf,int flags) {
+int SplineFontIsFlexible(SplineFont *sf,int layer, int flags) {
int i;
int max=0, val;
char *pt;
@@ -3503,7 +2118,7 @@ int SplineFontIsFlexible(SplineFont *sf,int flags) {
if ( flags&(ps_flag_nohints|ps_flag_noflex)) {
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- SCUnflex(sf->glyphs[i]);
+ SCUnflex(sf->glyphs[i],layer);
return( 0 );
}
@@ -3517,10 +2132,10 @@ return( 0 );
for ( i=0; i<sf->glyphcnt; ++i )
if ( sf->glyphs[i]!=NULL ) if ( sf->glyphs[i]!=NULL ) {
- val = _SplineCharIsFlexible(sf->glyphs[i],blueshift);
+ val = _SplineCharIsFlexible(sf->glyphs[i],layer,blueshift);
if ( val>max ) max = val;
- if ( sf->glyphs[i]->anyflexes )
- FlexDependents(sf->glyphs[i]);
+ if ( sf->glyphs[i]->layers[layer].anyflexes )
+ FlexDependents(sf->glyphs[i],layer);
}
return( max );
}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/baseviews.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/baseviews.h
new file mode 100644
index 00000000000..530542634b0
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/baseviews.h
@@ -0,0 +1,541 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _BASEVIEWS_H
+#define _BASEVIEWS_H
+
+/* cross-compiler woes */
+#if defined (small)
+#undef small
+#endif
+
+#include "splinefont.h"
+
+enum widthtype { wt_width, wt_lbearing, wt_rbearing, wt_vwidth };
+
+enum fvtrans_flags { fvt_dobackground=1, fvt_round_to_int=2,
+ fvt_dontsetwidth=4, fvt_dontmovewidth=8, fvt_scalekernclasses=0x10,
+ fvt_scalepstpos=0x20, fvt_dogrid=0x40, fvt_partialreftrans=0x80 };
+
+typedef struct drect {
+ real x, y;
+ real width, height;
+} DRect;
+
+/* Note: These are ordered as they are displayed in the tools palette */
+enum cvtools { cvt_pointer, cvt_magnify,
+ cvt_freehand, cvt_hand,
+ cvt_curve, cvt_hvcurve,
+ cvt_corner, cvt_tangent,
+ cvt_pen, cvt_spiro,
+ cvt_knife, cvt_ruler,
+ cvt_scale, cvt_flip,
+ cvt_rotate, cvt_skew,
+ cvt_3d_rotate, cvt_perspective,
+ cvt_rect, cvt_poly,
+ cvt_elipse, cvt_star,
+ cvt_minify, cvt_max=cvt_minify,
+ cvt_none = -1,
+ cvt_spirog4=cvt_curve, cvt_spirog2=cvt_hvcurve,
+ cvt_spirocorner=cvt_corner, cvt_spiroleft=cvt_tangent,
+ cvt_spiroright=cvt_pen};
+
+enum bvtools { bvt_pointer, bvt_magnify,
+ bvt_pencil, bvt_line,
+ bvt_shift, bvt_hand,
+ bvt_minify, bvt_eyedropper, bvt_max=bvt_eyedropper,
+ bvt_setwidth, bvt_setvwidth,
+ bvt_rect, bvt_filledrect,
+ bvt_elipse, bvt_filledelipse,
+ bvt_max2 = bvt_filledelipse,
+ bvt_none = -1,
+ bvt_fliph=0, bvt_flipv, bvt_rotate90cw, bvt_rotate90ccw, bvt_rotate180, bvt_skew, bvt_transmove };
+enum drawmode { dm_grid, dm_back, dm_fore, dm_max };
+
+typedef struct bvtfunc {
+ enum bvtools func;
+ int x,y; /* used by skew and move */
+} BVTFunc;
+
+struct freetype_raster {
+ int16 rows, cols;
+ int16 as, lb;
+ int16 bytes_per_row;
+ int16 num_greys;
+ uint8 *bitmap;
+};
+
+struct cvcontainer {
+ struct cvcontainer_funcs *funcs;
+};
+
+enum nav_type { nt_prevdef, nt_prev, nt_goto, nt_next, nt_nextdef };
+struct cvcontainer_funcs {
+ enum cv_container_type { cvc_searcher, cvc_mathkern, cvc_tilepath,
+ cvc_gradient, cvc_multiplepattern } type;
+ void (*activateMe)(struct cvcontainer *cvc,struct charviewbase *cv);
+ void (*charEvent)(struct cvcontainer *cvc,void *event);
+ int (*canNavigate)(struct cvcontainer *cvc,enum nav_type type);
+ void (*doNavigate)(struct cvcontainer *cvc,enum nav_type type);
+ int (*canOpen)(struct cvcontainer *cvc);
+ void (*doClose)(struct cvcontainer *cvc);
+ SplineFont *(*sf_of_container)(struct cvcontainer *cvc);
+};
+
+typedef struct charviewbase {
+ struct charviewbase *next;
+ struct fontviewbase *fv;
+ SplineChar *sc;
+ Layer *layerheads[dm_max];
+ uint8 drawmode;
+ uint16 ft_gridfitwidth;
+ SplineSet *gridfit;
+ struct cvcontainer *container; /* The sv (or whatever) within which this view is embedded (if it is embedded) */
+} CharViewBase;
+
+typedef struct fontviewbase {
+ struct fontviewbase *next; /* Next on list of open fontviews */
+ struct fontviewbase *nextsame; /* Next fv looking at this font */
+ EncMap *map; /* Current encoding info */
+ EncMap *normal; /* If this is not NULL then we have a compacted encoding in map, and this is the original */
+ SplineFont *sf; /* Current font */
+ SplineFont *cidmaster; /* If CID keyed, contains master font */
+ int active_layer;
+ BDFFont *active_bitmap; /* Set if the fontview displays a bitmap strike */
+ uint8 *selected; /* Current selection */
+#ifndef _NO_FFSCRIPT
+ struct dictionary *fontvars; /* Scripting */
+#endif
+#ifndef _NO_PYTHON
+ void *python_fv_object;
+#endif
+} FontViewBase;
+
+enum origins { or_zero, or_center, or_lastpress, or_value, or_undefined };
+struct pov_data {
+ enum origins xorigin, yorigin;
+ double x, y, z;
+ double direction; /* Direction of gaze projected into xy plane */
+ double tilt; /* Angle which drawing plane is tilted with respect to projection plane */
+ double d; /* Distance to projection plane */
+ double sintilt; /* Used internally */
+};
+
+typedef struct {
+ SplineFont *sf;
+ char *pathspec; /* In utf8, not necessarily local encoding */
+ char *username, *password;
+ char *name;
+ char *description;
+ char *tags;
+ char *artists;
+ int notsafeforwork;
+ int oflicense;
+ char *previewimage; /* NULL => No image */
+ uint8 upload_license;
+ uint8 upload_fontlog;
+ char *upload_id; /* Way to manipulate upload on OFLib */
+} OFLibData;
+
+struct lcg_zones {
+ /* info for unhinted processing */
+ /* everything abvoe this should be moved down (default xheight/2) */
+ int top_zone;
+ /* everything below this should be moved up (default xheight/2) */
+ /* anything in between should be stationary */
+ int bottom_zone;
+
+ /* info for hinted processing */
+ /* everything above & at this should be moved down */
+ /* also anything on the other side of a hint from this should be moved down */
+ int top_bound;
+ /* everything below & at this should be moved down */
+ /* also anything on the other side of a hint from this should be moved down */
+ int bottom_bound;
+
+ enum counter_type { ct_squish, ct_retain, ct_auto } counter_type;
+
+ SplineSet *(*embolden_hook)(SplineSet *,struct lcg_zones *,SplineChar *,int layer);
+ int wants_hints;
+ double serif_height, serif_fuzz;
+
+ double stroke_width; /* negative number to lighten, positive to embolden */
+ int removeoverlap;
+
+ BlueData bd;
+ double stdvw;
+};
+/* This order is the same order as the radio buttons in the embolden dlg */
+enum embolden_type { embolden_lcg, embolden_cjk, embolden_auto, embolden_custom, embolden_error };
+
+struct counterinfo {
+ double c_factor, c_add; /* For counters */
+ double sb_factor, sb_add; /* For side bearings */
+ int correct_italic;
+
+ BlueData bd;
+ double stdvw;
+
+ SplineChar *sc;
+ int layer;
+ DBounds bb; /* Value before change */
+ double top_y, bottom_y, boundry;
+ int has_two_zones;
+#define TOP_Z 0
+#define BOT_Z 1
+ int cnts[2];
+ int maxes[2];
+ struct ci_zones {
+ double start, width;
+ double moveto, newwidth; /* Only change width for diagonal stems*/
+ } *zones[2];
+};
+
+enum fvformats { fv_bdf, fv_ttf, fv_pk, fv_pcf, fv_mac, fv_win, fv_palm,
+ fv_image, fv_imgtemplate,
+ fv_eps, fv_epstemplate,
+ fv_pdf, fv_pdftemplate,
+ fv_plate, fv_platetemplate,
+ fv_svg, fv_svgtemplate,
+ fv_glif, fv_gliftemplate,
+ fv_fig,
+ fv_pythonbase = 0x100 };
+
+extern enum undotype CopyUndoType(void);
+extern int CopyContainsSomething(void);
+extern int CopyContainsBitmap(void);
+extern const Undoes *CopyBufferGet(void);
+extern RefChar *CopyContainsRef(SplineFont *);
+extern char **CopyGetPosSubData(enum possub_type *type,SplineFont **copied_from,
+ int pst_depth);
+extern void CopyReference(SplineChar *sc);
+extern void SCCopyLookupData(SplineChar *sc);
+extern void PasteRemoveSFAnchors(SplineFont *);
+extern void PasteAnchorClassMerge(SplineFont *sf,AnchorClass *into,AnchorClass *from);
+extern void PasteRemoveAnchorClass(SplineFont *sf,AnchorClass *dying);
+extern void ClipboardClear(void);
+extern SplineSet *ClipBoardToSplineSet(void);
+extern void BCCopySelected(BDFChar *bc,int pixelsize,int depth);
+extern void PasteToBC(BDFChar *bc,int pixelsize,int depth);
+extern void FVCopyWidth(FontViewBase *fv,enum undotype ut);
+extern void FVCopyAnchors(FontViewBase *fv);
+enum fvcopy_type { ct_fullcopy, ct_reference, ct_lookups, ct_unlinkrefs };
+extern void FVCopy(FontViewBase *fv, enum fvcopy_type copytype);
+extern void PasteIntoFV(FontViewBase *fv, int pasteinto, real trans[6]);
+extern void FVCopyFgtoBg(FontViewBase *fv);
+extern void FVSameGlyphAs(FontViewBase *fv);
+extern void FVClearBackground(FontViewBase *fv);
+extern void FVClear(FontViewBase *fv);
+extern void FVUnlinkRef(FontViewBase *fv);
+extern void FVUndo(FontViewBase *fv);
+extern void FVRedo(FontViewBase *fv);
+extern void FVJoin(FontViewBase *fv);
+extern void FVBuildDuplicate(FontViewBase *fv);
+extern void FVTrans(FontViewBase *fv,SplineChar *sc,real transform[6],uint8 *sel,
+ enum fvtrans_flags);
+extern void FVTransFunc(void *_fv,real transform[6],int otype, BVTFunc *bvts,
+ enum fvtrans_flags );
+extern void FVReencode(FontViewBase *fv,Encoding *enc);
+extern void FVOverlap(FontViewBase *fv,enum overlap_type ot);
+extern void FVAddExtrema(FontViewBase *fv);
+extern void FVCorrectDir(FontViewBase *fv);
+extern void FVRound2Int(FontViewBase *fv,real factor);
+extern void FVCanonicalStart(FontViewBase *fv);
+extern void FVCanonicalContours(FontViewBase *fv);
+extern void FVCluster(FontViewBase *fv);
+extern void CIDSetEncMap(FontViewBase *fv, SplineFont *new );
+extern void FVInsertInCID(FontViewBase *fv,SplineFont *sf);
+
+extern void FVAutoHint(FontViewBase *fv);
+extern void FVAutoHintSubs(FontViewBase *fv);
+extern void FVAutoCounter(FontViewBase *fv);
+extern void FVDontAutoHint(FontViewBase *fv);
+extern void FVAutoInstr(FontViewBase *fv);
+extern void FVClearInstrs(FontViewBase *fv);
+extern void FVClearHints(FontViewBase *fv);
+extern void SCAutoTrace(SplineChar *sc,int layer, int ask);
+extern char *FindAutoTraceName(void);
+extern void *GetAutoTraceArgs(void);
+extern void SetAutoTraceArgs(void *a);
+extern char *FindMFName(void);
+extern char *ProgramExists(char *prog,char *buffer);
+extern void MfArgsInit(void);
+extern void FVAutoTrace(FontViewBase *fv,int ask);
+extern void FVAddEncodingSlot(FontViewBase *fv,int gid);
+extern int FVImportMult(FontViewBase *fv, char *filename,int toback,int bf);
+extern int FVImportBDF(FontViewBase *fv, char *filename,int ispk, int toback);
+extern void MergeFont(FontViewBase *fv,SplineFont *other,int preserveCrossFontKerning);
+extern int FVImportImages(FontViewBase *fv,char *path,int isimage,int toback,int flags);
+extern int FVImportImageTemplate(FontViewBase *fv,char *path,int isimage,int toback,int flags);
+extern void ScriptPrint(FontViewBase *fv,int type,int32 *pointsizes,char *samplefile,
+ unichar_t *sample, char *outputfile);
+extern int FVBParseSelectByPST(FontViewBase *fv,struct lookup_subtable *sub,
+ int search_type);
+extern int SFScaleToEm(SplineFont *sf, int ascent, int descent);
+extern void TransHints(StemInfo *stem,real mul1, real off1, real mul2, real off2, int round_to_int );
+extern void TransDStemHints(DStemInfo *ds,real xmul, real xoff, real ymul, real yoff, int round_to_int );
+extern void VrTrans(struct vr *vr,real transform[6]);
+extern int SFNLTrans(FontViewBase *fv,char *x_expr,char *y_expr);
+extern void FVPointOfView(FontViewBase *fv,struct pov_data *);
+extern void FVStrokeItScript(void *fv, StrokeInfo *si);
+extern void FVOutline(struct fontviewbase *fv, real width);
+extern void FVInline(struct fontviewbase *fv, real width, real inset);
+extern void FVShadow(struct fontviewbase *fv,real angle, real outline_width,
+ real shadow_length,int wireframe);
+extern void CI_Init(struct counterinfo *ci,SplineFont *sf);
+extern void FVEmbolden(struct fontviewbase *fv,enum embolden_type type,struct lcg_zones *zones);
+extern void FVCondenseExtend(struct fontviewbase *fv,struct counterinfo *ci);
+extern void ScriptSCCondenseExtend(SplineChar *sc,struct counterinfo *ci);
+
+struct smallcaps {
+ double lc_stem_width, uc_stem_width;
+ double stem_factor, v_stem_factor;
+ double xheight, scheight, capheight;
+ double vscale, hscale;
+ char *extension_for_letters, *extension_for_symbols;
+ int dosymbols;
+ SplineFont *sf;
+ int layer;
+ double italic_angle, tan_ia;
+};
+
+extern void SmallCapsFindConstants(struct smallcaps *small, SplineFont *sf,
+ int layer );
+
+enum glyphchange_type { gc_generic, gc_smallcaps, gc_subsuper, gc_max };
+
+struct genericchange {
+ enum glyphchange_type gc;
+ uint32 feature_tag;
+ char *glyph_extension;
+ char *extension_for_letters, *extension_for_symbols;
+ double stem_height_scale, stem_width_scale;
+ double stem_height_add , stem_width_add ;
+ double serif_height_scale, serif_width_scale;
+ double seirf_height_add , serif_width_add ;
+ double hcounter_scale, hcounter_add;
+ double lsb_scale, lsb_add;
+ double rsb_scale, rsb_add;
+ uint8 center_in_hor_advance;
+ uint8 use_vert_mapping;
+ uint8 do_smallcap_symbols;
+ uint8 petite; /* generate petite caps rather than smallcaps */
+ double vcounter_scale, vcounter_add; /* If not using mapping */
+ double v_scale; /* If using mapping */
+ struct fixed_maps {
+ int cnt;
+ struct position_maps {
+ double current , desired;
+ double cur_width, des_width;
+ int overlap_index;
+ } *maps;
+ } m;
+ struct fixed_maps g; /* Adjusted for each glyph */
+ double vertical_offset;
+ unsigned int dstem_control, serif_control;
+ struct smallcaps *small;
+/* Filled in by called routine */
+ SplineFont *sf;
+ int layer;
+ double italic_angle, tan_ia;
+};
+
+extern void FVAddSmallCaps(FontViewBase *fv,struct genericchange *genchange);
+extern void FVGenericChange(FontViewBase *fv,struct genericchange *genchange);
+extern void CVGenericChange(CharViewBase *cv,struct genericchange *genchange);
+
+struct xheightinfo {
+ double xheight_current, xheight_desired;
+ double serif_height;
+};
+
+extern void InitXHeightInfo(SplineFont *sf, int layer, struct xheightinfo *xi);
+extern void ChangeXHeight(FontViewBase *fv,CharViewBase *cv, struct xheightinfo *xi);
+extern SplineSet *SSControlStems(SplineSet *ss,
+ double stemwidthscale, double stemheightscale,
+ double hscale, double vscale, double xheight);
+extern void MakeItalic(FontViewBase *fv,CharViewBase *cv,ItalicInfo *ii);
+extern int FVReplaceAll( FontViewBase *fv, SplineSet *find, SplineSet *rpl, double fudge, int flags );
+extern void FVBReplaceOutlineWithReference( FontViewBase *fv, double fudge );
+extern void FVCorrectReferences(FontViewBase *fv);
+extern void _FVSimplify(FontViewBase *fv,struct simplifyinfo *smpl);
+extern void UnlinkThisReference(FontViewBase *fv,SplineChar *sc,int layer);
+extern FontViewBase *ViewPostscriptFont(char *filename,int openflags);
+extern void FVBuildAccent(FontViewBase *fv,int onlyaccents);
+extern void FVRemoveKerns(FontViewBase *fv);
+extern void FVRemoveVKerns(FontViewBase *fv);
+extern void FVVKernFromHKern(FontViewBase *fv);
+extern void FVAddUnencoded(FontViewBase *fv, int cnt);
+extern void FVRemoveUnused(FontViewBase *fv);
+extern void FVCompact(FontViewBase *fv);
+extern void FVDetachGlyphs(FontViewBase *fv);
+extern void FVDetachAndRemoveGlyphs(FontViewBase *fv);
+extern int AutoWidthScript(FontViewBase *fv,int spacing);
+extern int AutoKernScript(FontViewBase *fv,int spacing, int threshold,
+ struct lookup_subtable *sub, char *kernfile);
+
+#ifndef _NO_FFSCRIPT
+extern void DictionaryFree(struct dictionary *dica);
+#endif
+
+extern void BCTrans(BDFFont *bdf,BDFChar *bc,BVTFunc *bvts,FontViewBase *fv );
+extern void BCSetPoint(BDFChar *bc, int x, int y, int color);
+extern void BCTransFunc(BDFChar *bc,enum bvtools type,int xoff,int yoff);
+extern void skewselect(BVTFunc *bvtf,real t);
+extern void BCExpandBitmapToEmBox(BDFChar *bc, int xmin, int ymin, int xmax, int ymax);
+
+extern BDFFloat *BDFFloatCreate(BDFChar *bc,int xmin,int xmax,int ymin,int ymax, int clear);
+extern BDFFloat *BDFFloatCopy(BDFFloat *sel);
+extern BDFFloat *BDFFloatConvert(BDFFloat *sel,int newdepth, int olddepth);
+extern void BDFFloatFree(BDFFloat *sel);
+
+extern int CVLayer(CharViewBase *cv);
+extern Undoes *CVPreserveStateHints(CharViewBase *cv);
+extern Undoes *CVPreserveState(CharViewBase *cv);
+extern Undoes *CVPreserveWidth(CharViewBase *cv,int width);
+extern Undoes *CVPreserveVWidth(CharViewBase *cv,int vwidth);
+extern void CVDoRedo(CharViewBase *cv);
+extern void CVDoUndo(CharViewBase *cv);
+extern void CVRemoveTopUndo(CharViewBase *cv);
+extern void CopySelected(CharViewBase *cv,int doanchors);
+extern void CVCopyGridFit(CharViewBase *cv);
+extern void CopyWidth(CharViewBase *cv,enum undotype);
+extern void PasteToCV(CharViewBase *cv);
+extern void CVYPerspective(CharViewBase *cv,double x_vanish, double y_vanish);
+extern void ScriptSCEmbolden(SplineChar *sc,int layer,enum embolden_type type,struct lcg_zones *zones);
+extern void CVEmbolden(CharViewBase *cv,enum embolden_type type,struct lcg_zones *zones);
+extern void SCCondenseExtend(struct counterinfo *ci,SplineChar *sc, int layer,
+ int do_undoes);
+extern void SCClearSelPt(SplineChar *sc);
+extern void SC_MoreLayers(SplineChar *,Layer *old);
+extern void SCLayersChange(SplineChar *sc);
+extern void SFLayerChange(SplineFont *sf);
+extern void SCTile(SplineChar *sc,int layer);
+extern void _CVMenuMakeLine(CharViewBase *cv,int do_arc,int ellipse_to_back);
+ /* Ellipse to back is a debugging flag and adds the generated ellipse to */
+ /* the background layer so we can look at it. I thought it might actually*/
+ /* be useful, so I left it in. Activated with the Alt key in the menu */
+
+extern void MVCopyChar(FontViewBase *fv, BDFFont *bdf, SplineChar *sc, enum fvcopy_type fullcopy);
+extern void PasteIntoMV(FontViewBase *fv, BDFFont *bdf,SplineChar *sc, int doclear);
+
+extern void ExecuteScriptFile(FontViewBase *fv, SplineChar *sc, char *filename);
+
+extern int HasLicense(SplineFont *,FILE *);
+extern int OFLibUploadFont(OFLibData *);
+
+enum search_flags { sv_reverse = 0x1, sv_flips = 0x2, sv_rotate = 0x4,
+ sv_scale = 0x8, sv_endpoints=0x10 };
+typedef struct searchdata {
+ SplineChar sc_srch, sc_rpl;
+ SplineSet *path, *revpath, *replacepath, *revreplace;
+ int pointcnt, rpointcnt;
+ real fudge;
+ real fudge_percent; /* a value of .05 here represents 5% (we don't store the integer) */
+ unsigned int tryreverse: 1;
+ unsigned int tryflips: 1;
+ unsigned int tryrotate: 1;
+ unsigned int tryscale: 1;
+ unsigned int endpoints: 1; /* Don't match endpoints, use them for direction only */
+ unsigned int onlyselected: 1;
+ unsigned int subpatternsearch: 1;
+ unsigned int doreplace: 1;
+ unsigned int replaceall: 1;
+ unsigned int findall: 1;
+ unsigned int searchback: 1;
+ unsigned int wrap: 1;
+ unsigned int wasreversed: 1;
+ unsigned int replacewithref: 1;
+ unsigned int already_complained: 1; /* User has already been alerted to the fact that we've converted splines to refs and lost the instructions */
+ SplineSet *matched_spl;
+ SplinePoint *matched_sp, *last_sp;
+ real matched_rot, matched_scale;
+ real matched_x, matched_y;
+ double matched_co, matched_si; /* Precomputed sin, cos */
+ enum flipset { flip_none = 0, flip_x, flip_y, flip_xy } matched_flip;
+#ifdef _HAS_LONGLONG
+ unsigned long long matched_refs; /* Bit map of which refs in the char were matched */
+ unsigned long long matched_ss; /* Bit map of which splines in the char were matched */
+ /* In multi-path mode */
+ unsigned long long matched_ss_start;/* Bit map of which splines we tried to start matches with */
+#else
+ unsigned long matched_refs;
+ unsigned long matched_ss;
+ unsigned long matched_ss_start;
+#endif
+ FontViewBase *fv;
+ SplineChar *curchar;
+ int last_gid;
+} SearchData;
+
+extern struct searchdata *SDFromContour( FontViewBase *fv, SplineSet *find, double fudge, int flags );
+extern SplineChar *SDFindNext(struct searchdata *sv);
+
+extern struct python_import_export {
+ struct _object *import; /* None becomes NULL */
+ struct _object *export; /* None becomes NULL */
+ struct _object *data; /* None stays None */
+ char *name;
+ char *extension;
+ char *all_extensions;
+} *py_ie;
+extern void PyFF_SCExport(SplineChar *sc,int ie_index,char *filename,
+ int layer);
+extern void PyFF_SCImport(SplineChar *sc,int ie_index,char *filename,
+ int layer, int clear);
+extern void PyFF_InitFontHook(FontViewBase *fv);
+
+extern void LookupInit(void);
+extern int UserFeaturesDiffer(void);
+extern uint32 *StdFeaturesOfScript(uint32 script);
+
+enum byte_types { bt_instr, bt_cnt, bt_byte, bt_wordhi, bt_wordlo, bt_impliedreturn };
+struct instrdata {
+ uint8 *instrs;
+ int instr_cnt, max;
+ uint8 *bts;
+ unsigned int changed: 1;
+ unsigned int in_composit: 1;
+ SplineFont *sf;
+ SplineChar *sc;
+ uint32 tag;
+ struct instrdlg *id;
+ struct instrdata *next;
+};
+
+extern uint8 *_IVParse(SplineFont *sf, char *text, int *len,
+ void (*IVError)(void *,char *, int), void *iv);
+extern char *_IVUnParseInstrs(uint8 *instrs,int instr_cnt);
+
+extern int BitmapControl(FontViewBase *fv,int32 *sizes,int isavail,int rasterize);
+extern void FVSetWidthScript(FontViewBase *fv,enum widthtype wtype,int val,int incr);
+extern void FVMetricsCenter(FontViewBase *fv,int docenter);
+extern void FVRevert(FontViewBase *fv);
+extern void FVRevertBackup(FontViewBase *fv);
+extern void FVRevertGlyph(FontViewBase *fv);
+extern int MMReblend(FontViewBase *fv, MMSet *mm);
+extern FontViewBase *MMCreateBlendedFont(MMSet *mm,FontViewBase *fv,real blends[MmMax],int tonew );
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/clipnoui.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/clipnoui.c
new file mode 100644
index 00000000000..a6b38f970b8
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/clipnoui.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2007,2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "pfaedit.h"
+#include "uiinterface.h"
+
+static void NClipboard_Grab(void) {
+}
+
+static void NClipboard_AddDataType(const char *type, void *data, int cnt, int size,
+ void *(*gendata)(void *,int32 *len), void (*freedata)(void *)) {
+ (void)type;
+ (void)cnt;
+ (void)size;
+ (void)gendata;
+ if ( freedata!=NULL && data !=NULL )
+ (freedata)(data);
+}
+
+/* Asks for the clip and waits for the response. */
+static void *NClipboard_Request(const char *mimetype,int *len) {
+ *len = 0;
+ (void)mimetype;
+return( NULL );
+}
+
+static int NClipboard_HasType(const char *mimetype) {
+ (void)mimetype;
+return( 0 );
+}
+
+static struct clip_interface noui_clip_interface = {
+ NClipboard_Grab,
+ NClipboard_AddDataType,
+ NClipboard_HasType,
+ NClipboard_Request
+};
+
+struct clip_interface *clip_interface = &noui_clip_interface;
+
+void FF_SetClipInterface(struct clip_interface *clipi) {
+ clip_interface = clipi;
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/configure-pfaedit.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/configure-pfaedit.h
index decf52b16f9..208341dd8a7 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/configure-pfaedit.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/configure-pfaedit.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007 by George Williams */
+/* Copyright (C) 2002-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -27,28 +27,8 @@
#ifndef _CONFIG_FONTFORGE_H_
#define _CONFIG_FONTFORGE_H_
-#include "ff-config.h"
-
-/* !!!!!!!!!!!!!!!!! Experimental. Don't try to use it yet !!!!!!!!!!!!!!!!! */
-/* FontForge can be configured with a windowing UI based on my widgets (gdraw)*/
-/* the gtk widget set, or finally with no windowing UI. */
-/* It is probably best to used gtk if it is available */
-/* */
-/* #define FONTFORGE_CONFIG_GTK */
-/* #define FONTFORGE_CONFIG_GDRAW */
-/* #define FONTFORGE_CONFIG_NO_WINDOWING_UI */
-/* */
-/* Can be set from configure --with-gtk, --with-gdraw, --with-noui */
-#ifdef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# undef FONTFORGE_CONFIG_GDRAW
-# undef FONTFORGE_CONFIG_GTK
-#elif defined(FONTFORGE_CONFIG_GTK)
-# undef FONTFORGE_CONFIG_GDRAW
-#elif !defined(FONTFORGE_CONFIG_GDRAW)
-/* If nothing defined, default to traditional setting. At least for now */
-# define FONTFORGE_CONFIG_GDRAW
-#endif
+#include "ff-config.h"
/* Making FontForge handle more of the capabilities of type3 & svg fonts is not*/
/* something most people will want. It wastes space too. So I thought I'd */
@@ -97,13 +77,16 @@
/* The paste after command pastes the contents of the clipboard into the */
/* current glyph, translates that by the advance width of the current glyph */
/* and increments the advance width by the advance width of the clipboard */
+/* */
+/* Can be set from configure --enable-pasteafter */
+
/* Someone asked for encoding GB12345. Neither libiconv nor iconv supports it.*/
/* */
/* #define FONTFORGE_CONFIG_GB12345 */
/* */
-/* Can be set from configure --with-gb12345 */
+/* Can be set from configure --enable-gb12345 */
/* I doubt anyone but me will be interested in the tile path command, so I */
@@ -112,11 +95,13 @@
/* */
/* #define FONTFORGE_CONFIG_TILEPATH */
/* */
-/* The tile path command uses the contents of the clipboard as a tile which is*/
-/* applied to any selected paths, replacing them. It could be used to make a */
-/* font whose stems were filled with celtic knotwork, for example */
+/* The tile path command lets you specify a tile which will then be laid out */
+/* along a path. It could be used to make a font whose stems were filled with*/
+/* celtic knotwork, or bamboo segments, for example. */
/* It's sort of an extension to the Expand Stroke command, only it strokes */
/* with a pattern */
+/* */
+/* Can be set from configure --enable-tilepath */
/* There used to be a property _XFREE86_GLYPH_RANGES (in bdf/pcf) fonts which */
@@ -136,13 +121,6 @@
/* */
-/* Yoshiki Hayashi wants a copy background to foreground command in the */
-/* outline view. Setting this flag will enable his patch */
-/* */
-/* #define FONTFORGE_CONFIG_COPY_BG_TO_FG */
-/* */
-
-
/* Harald Harders would like to be able to generate a PFM file without */
/* creating a font along with it. I don't see the need for this, but he pro- */
/* vided a patch. Setting this flag will enable his patch */
@@ -174,9 +152,9 @@
/* In addition to placing snippets of charstrings into subrs, I tried adding */
/* whole glyphs (when that was possible). To my surprise, it made things */
-/* in one of my test cases, and barely registered an improvement in another */
-/* So I think we're better off without it. But I don't understand why things */
-/* are worse so I'm leaving the code in to play with */
+/* worse in one of my test cases, and barely registered an improvement in */
+/* another. So I think we're better off without it. But I don't understand */
+/* why things are worse so I'm leaving the code in to play with */
/* */
/* #define FONTFORGE_CONFIG_PS_REFS_GET_SUBRS */
/* */
@@ -247,10 +225,6 @@
/* If there are no freetype header files then define _NO_FREETYPE */
/* If the freetype library has the bytecode debugger then define FREETYPE_HAS_DEBUGGER */
/* If there is no mmap system call then define _NO_MMAP */
-#ifdef FONTFORGE_CONFIG_NO_WINDOWING_UI
-# undef FREETYPE_HAS_DEBUGGER
-/* Debugger is meaningless if we have no UI (and doesn't compile) */
-#endif
/* If there is no ungif library (or if it is out of date) define _NO_LIBUNGIF */
/* If there is no png (or z) library define _NO_LIBPNG */
@@ -289,4 +263,30 @@
/* "x' = x, y' = y+sin(x)" would not produce anything useful when applied to */
/* a long line segment like [0,100]...[100,100], but if that were broken up */
/* into sub-segments each pi long the results would be much better */
+
+
+/******* Don't need this any longer as copy layer 2 layer is always available */
+/* Yoshiki Hayashi wants a copy background to foreground command in the */
+/* outline view. Setting this flag will enable his patch */
+/* */
+/* #define FONTFORGE_CONFIG_COPY_BG_TO_FG */
+/* */
+
+
+/* ************************************************************************** */
+/* **************************** Numeric Settings **************************** */
+/* ************************************************************************** */
+
+
+/* The number of files displayed in the "File->Recent" menu */
+#define RECENT_MAX 10
+
+/* The number of tabs allowed in the outline glyph view of former glyphs */
+#define FORMER_MAX 10
+
+/* The maximum number of layers allowed in a normal font (this includes the */
+/* default foreground and background layers) -- this does not limit type3 */
+/* fonts */
+#define BACK_LAYER_MAX 256
+
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/cvundoes.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/cvundoes.c
new file mode 100644
index 00000000000..a19bcb9a4c0
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/cvundoes.c
@@ -0,0 +1,134 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#define _DEFINE_SEARCHVIEW_
+#include "fontforgevw.h"
+#include <math.h>
+#include <ustring.h>
+#include <utype.h>
+
+extern char *coord_sep;
+
+int onlycopydisplayed = 0;
+int copymetadata = 0;
+int copyttfinstr = 0;
+
+/* ********************************* Undoes ********************************* */
+
+int maxundoes = 0; /* -1 is infinite */
+
+static void UHintListFree(void *hints) {
+ StemInfo *h, *t, *p;
+
+ if ( hints==NULL )
+return;
+ if ( ((StemInfo *) hints)->hinttype==ht_d )
+ DStemInfosFree(hints);
+ else {
+ h = t = hints;
+ p = NULL;
+ while ( t!=NULL && t->hinttype!=ht_d ) {
+ p = t;
+ t = t->next;
+ }
+ p->next = NULL;
+ StemInfosFree(h);
+ DStemInfosFree((DStemInfo *) t);
+ }
+}
+
+void UndoesFree(Undoes *undo) {
+ Undoes *unext;
+
+ while ( undo!=NULL ) {
+ unext = undo->next;
+ switch ( undo->undotype ) {
+ case ut_noop:
+ case ut_width: case ut_vwidth: case ut_lbearing: case ut_rbearing:
+ /* Nothing else to free */;
+ break;
+ case ut_state: case ut_tstate: case ut_statehint: case ut_statename:
+ case ut_hints: case ut_anchors: case ut_statelookup:
+ SplinePointListsFree(undo->u.state.splines);
+ RefCharsFree(undo->u.state.refs);
+ UHintListFree(undo->u.state.hints);
+ free(undo->u.state.instrs);
+ ImageListsFree(undo->u.state.images);
+ if ( undo->undotype==ut_statename ) {
+ free( undo->u.state.charname );
+ free( undo->u.state.comment );
+ PSTFree( undo->u.state.possub );
+ }
+ AnchorPointsFree(undo->u.state.anchor);
+ break;
+ case ut_bitmap:
+ free(undo->u.bmpstate.bitmap);
+ break;
+ case ut_multiple: case ut_layers:
+ UndoesFree( undo->u.multiple.mult );
+ break;
+ case ut_composit:
+ UndoesFree(undo->u.composit.state);
+ UndoesFree(undo->u.composit.bitmaps);
+ break;
+ default:
+ IError( "Unknown undo type in UndoesFree: %d", undo->undotype );
+ break;
+ }
+ chunkfree(undo,sizeof(Undoes));
+ undo = unext;
+ }
+}
+
+int getAdobeEnc(char *name) {
+ extern char *AdobeStandardEncoding[256];
+ int i;
+
+ for ( i=0; i<256; ++i )
+ if ( strcmp(name,AdobeStandardEncoding[i])==0 )
+ break;
+ if ( i==256 ) i = -1;
+return( i );
+}
+
+int SCWasEmpty(SplineChar *sc, int skip_this_layer) {
+ int i;
+
+ for ( i=ly_fore; i<sc->layer_cnt; ++i ) if ( i!=skip_this_layer && !sc->layers[i].background ) {
+ if ( sc->layers[i].refs!=NULL )
+return( false );
+ else if ( sc->layers[i].splines!=NULL ) {
+ SplineSet *ss;
+ for ( ss = sc->layers[i].splines; ss!=NULL; ss=ss->next ) {
+ if ( ss->first->prev!=NULL )
+return( false ); /* Closed contour */
+ }
+ }
+ }
+return( true );
+}
+
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c
new file mode 100644
index 00000000000..9a0e32a7240
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/dumppfa.c
@@ -0,0 +1,221 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ustring.h>
+#include <utype.h>
+#include <unistd.h>
+#include <locale.h>
+#ifndef _WIN32
+# include <pwd.h>
+#endif
+#include <stdarg.h>
+#include <time.h>
+#include "psfont.h"
+#include "splinefont.h"
+#ifdef FONTFORGE_CONFIG_TYPE3
+ #include <gdraw.h> /* For image defn */
+#endif
+
+#ifdef __CygWin
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+#endif
+
+extern int autohint_before_generate;
+char *xuid=NULL;
+
+typedef void (*DumpChar)(int ch,void *data);
+struct fileencryptdata {
+ DumpChar olddump;
+ void *olddata;
+ unsigned short r;
+ int hexline;
+};
+#define c1 52845
+#define c2 22719
+
+struct psdict *PSDictCopy(struct psdict *dict) {
+ struct psdict *ret;
+ int i;
+
+ if ( dict==NULL )
+return( NULL );
+
+ ret = gcalloc(1,sizeof(struct psdict));
+ ret->cnt = dict->cnt; ret->next = dict->next;
+ ret->keys = gcalloc(ret->cnt,sizeof(char *));
+ ret->values = gcalloc(ret->cnt,sizeof(char *));
+ for ( i=0; i<dict->next; ++i ) {
+ ret->keys[i] = copy(dict->keys[i]);
+ ret->values[i] = copy(dict->values[i]);
+ }
+
+return( ret );
+}
+
+int PSDictFindEntry(struct psdict *dict, char *key) {
+ int i;
+
+ if ( dict==NULL )
+return( -1 );
+
+ for ( i=0; i<dict->next; ++i )
+ if ( strcmp(dict->keys[i],key)==0 )
+return( i );
+
+return( -1 );
+}
+
+char *PSDictHasEntry(struct psdict *dict, char *key) {
+ int i;
+
+ if ( dict==NULL )
+return( NULL );
+
+ for ( i=0; i<dict->next; ++i )
+ if ( strcmp(dict->keys[i],key)==0 )
+return( dict->values[i] );
+
+return( NULL );
+}
+
+int PSDictRemoveEntry(struct psdict *dict, char *key) {
+ int i;
+
+ if ( dict==NULL )
+return( false );
+
+ for ( i=0; i<dict->next; ++i )
+ if ( strcmp(dict->keys[i],key)==0 )
+ break;
+ if ( i==dict->next )
+return( false );
+ free( dict->keys[i]);
+ free( dict->values[i] );
+ --dict->next;
+ while ( i<dict->next ) {
+ dict->keys[i] = dict->keys[i+1];
+ dict->values[i] = dict->values[i+1];
+ ++i;
+ }
+
+return( true );
+}
+
+int PSDictChangeEntry(struct psdict *dict, char *key, char *newval) {
+ int i;
+
+ if ( dict==NULL )
+return( -1 );
+
+ for ( i=0; i<dict->next; ++i )
+ if ( strcmp(dict->keys[i],key)==0 )
+ break;
+ if ( i==dict->next ) {
+ if ( dict->next>=dict->cnt ) {
+ dict->cnt += 10;
+ dict->keys = grealloc(dict->keys,dict->cnt*sizeof(char *));
+ dict->values = grealloc(dict->values,dict->cnt*sizeof(char *));
+ }
+ dict->keys[dict->next] = copy(key);
+ dict->values[dict->next] = NULL;
+ ++dict->next;
+ }
+ free(dict->values[i]);
+ dict->values[i] = copy(newval);
+return( i );
+}
+
+
+static double FindMaxDiffOfBlues(char *pt, double max_diff) {
+ char *end;
+ double p1, p2;
+
+ while ( *pt==' ' || *pt=='[' ) ++pt;
+ forever {
+ p1 = strtod(pt,&end);
+ if ( end==pt )
+ break;
+ pt = end;
+ p2 = strtod(pt,&end);
+ if ( end==pt )
+ break;
+ if ( p2-p1 >max_diff ) max_diff = p2-p1;
+ pt = end;
+ }
+return( max_diff );
+}
+
+double BlueScaleFigureForced(struct psdict *private,real bluevalues[], real otherblues[]) {
+ double max_diff=0;
+ char *pt;
+ int i;
+
+ pt = PSDictHasEntry(private,"BlueValues");
+ if ( pt!=NULL ) {
+ max_diff = FindMaxDiffOfBlues(pt,max_diff);
+ } else if ( bluevalues!=NULL ) {
+ for ( i=0; i<14 && (bluevalues[i]!=0 || bluevalues[i+1])!=0; i+=2 ) {
+ if ( bluevalues[i+1] - bluevalues[i]>=max_diff )
+ max_diff = bluevalues[i+1] - bluevalues[i];
+ }
+ }
+ pt = PSDictHasEntry(private,"FamilyBlues");
+ if ( pt!=NULL )
+ max_diff = FindMaxDiffOfBlues(pt,max_diff);
+
+ pt = PSDictHasEntry(private,"OtherBlues");
+ if ( pt!=NULL )
+ max_diff = FindMaxDiffOfBlues(pt,max_diff);
+ else if ( otherblues!=NULL ) {
+ for ( i=0; i<10 && (otherblues[i]!=0 || otherblues[i+1]!=0); i+=2 ) {
+ if ( otherblues[i+1] - otherblues[i]>=max_diff )
+ max_diff = otherblues[i+1] - otherblues[i];
+ }
+ }
+ pt = PSDictHasEntry(private,"FamilyOtherBlues");
+ if ( pt!=NULL )
+ max_diff = FindMaxDiffOfBlues(pt,max_diff);
+ if ( max_diff<=0 )
+return( -1 );
+ if ( 1/max_diff > .039625 )
+return( -1 );
+
+return( .99/max_diff );
+}
+
+double BlueScaleFigure(struct psdict *private,real bluevalues[], real otherblues[]) {
+ if ( PSDictHasEntry(private,"BlueScale")!=NULL )
+return( -1 );
+ return BlueScaleFigureForced(private, bluevalues, otherblues);
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/edgelist.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/edgelist.h
index 8a606c4c8c3..ded484f40ff 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/edgelist.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/edgelist.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -67,18 +67,20 @@ typedef struct edgelist {
uint8 *bitmap;
Edge *last, *splinesetfirst;
SplineChar *sc;
+ int layer;
char *interesting;
int major, other;
- unsigned int genmajoredges: 1; /* generate a list of edges parrallel to the major axis */
+ unsigned int genmajoredges: 1; /* generate a list of edges parallel to the major axis */
Edge *majors; /* ordered so that lowest edge is first */
Edge *majorhold; /* to hold major edges as we pass them and they become useless */
Hints *hhints, *vhints;
int is_overlap;
+ DBounds bbox; /* Not always set. {m,o}{min,max} a provide scaled bbox, this is in glyph units */
} EdgeList;
extern void FreeEdges(EdgeList *es);
extern double TOfNextMajor(Edge *e, EdgeList *es, double sought_y );
-extern void FindEdgesSplineSet(SplinePointList *spl, EdgeList *es);
+extern void FindEdgesSplineSet(SplinePointList *spl, EdgeList *es, int ignore_clip);
extern Edge *ActiveEdgesInsertNew(EdgeList *es, Edge *active,int i);
extern Edge *ActiveEdgesRefigure(EdgeList *es, Edge *active,real i);
extern Edge *ActiveEdgesFindStem(Edge *apt, Edge **prev, real i);
@@ -126,6 +128,7 @@ typedef struct eilist {
EI **ordered;
char *ends; /* flag to say an edge ends on this line */
SplineChar *sc;
+ int layer;
int major;
EI *splinelast, *splinefirst;
EI **bottoms, **tops; /* Used only be FindNeeded in RemoveOverlap */
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/edgelist2.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/edgelist2.h
index c2cccac0c3b..d84925bbde7 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/edgelist2.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/edgelist2.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2007 by George Williams */
+/* Copyright (C) 2004-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -46,9 +46,4 @@ typedef struct monotonic {
double when_set; /* Debugging */
} Monotonic;
-extern void FreeMonotonics(Monotonic *m);
-extern Monotonic *SSsToMContours(SplineSet *spl, enum overlap_type ot);
- /* overlap_type controls whether we look at selected splinesets or all splinesets */
-extern int MonotonicFindAt(Monotonic *ms,int which, extended test, Monotonic **space );
-
#endif /* _EDGELIST2_H */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.c
new file mode 100644
index 00000000000..6fccf29e8ae
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.c
@@ -0,0 +1,1152 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "fontforgevw.h"
+#include <ustring.h>
+#include <utype.h>
+#include <math.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <gfile.h>
+#include "plugins.h"
+#include "encoding.h"
+
+Encoding *default_encoding = NULL;
+
+static int32 tex_base_encoding[] = {
+ 0x0000, 0x02d9, 0xfb01, 0xfb02, 0x2044, 0x02dd, 0x0141, 0x0142,
+ 0x02db, 0x02da, 0x000a, 0x02d8, 0x2212, 0x000d, 0x017d, 0x017e,
+ 0x02c7, 0x0131, 0xf6be, 0xfb00, 0xfb03, 0xfb04, 0x2260, 0x221e,
+ 0x2264, 0x2265, 0x2202, 0x2211, 0x220f, 0x03c0, 0x0060, 0x0027,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2019,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
+ 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
+ 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
+ 0x2018, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
+ 0x20ac, 0x222b, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
+ 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x2126, 0x221a, 0x2248,
+ 0x0090, 0x0091, 0x0092, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
+ 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x2206, 0x25ca, 0x0178,
+ 0x0000, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
+ 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x002d, 0x00ae, 0x00af,
+ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
+ 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+ 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+ 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+ 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
+ 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
+};
+
+static int32 unicode_from_MacSymbol[] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
+ 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
+ 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
+ 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220d,
+ 0x0028, 0x0029, 0x2217, 0x002b, 0x002c, 0x2212, 0x002e, 0x002f,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+ 0x2245, 0x0391, 0x0392, 0x03a7, 0x0394, 0x0395, 0x03a6, 0x0393,
+ 0x0397, 0x0399, 0x03d1, 0x039a, 0x039b, 0x039c, 0x039d, 0x039f,
+ 0x03a0, 0x0398, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03c2, 0x03a9,
+ 0x039e, 0x03a8, 0x0396, 0x005b, 0x2234, 0x005d, 0x22a5, 0x005f,
+ 0xf8e5, 0x03b1, 0x03b2, 0x03c7, 0x03b4, 0x03b5, 0x03c6, 0x03b3,
+ 0x03b7, 0x03b9, 0x03d5, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf,
+ 0x03c0, 0x03b8, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03d6, 0x03c9,
+ 0x03be, 0x03c8, 0x03b6, 0x007b, 0x007c, 0x007d, 0x223c, 0x007f,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+ 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+ 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+ 0x0000, 0x03d2, 0x2032, 0x2264, 0x2044, 0x221e, 0x0192, 0x2663,
+ 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193,
+ 0x00b0, 0x00b1, 0x2033, 0x2265, 0x00d7, 0x221d, 0x2202, 0x2022,
+ 0x00f7, 0x2260, 0x2261, 0x2248, 0x2026, 0xf8e6, 0xf8e7, 0x21b5,
+ 0x2135, 0x2111, 0x211c, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229,
+ 0x222a, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209,
+ 0x2220, 0x2207, 0x00ae, 0x00a9, 0x2122, 0x220f, 0x221a, 0x22c5,
+ 0x00ac, 0x2227, 0x2228, 0x21d4, 0x21d0, 0x21d1, 0x21d2, 0x21d3,
+ 0x22c4, 0x2329, 0xf8e8, 0xf8e9, 0xf8ea, 0x2211, 0xf8eb, 0xf8ec,
+ 0xf8ed, 0xf8ee, 0xf8ef, 0xf8f0, 0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4,
+ 0xf8ff, 0x232a, 0x222b, 0x2320, 0xf8f5, 0x2321, 0xf8f6, 0xf8f7,
+ 0xf8f8, 0xf8f9, 0xf8fa, 0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0x02c7
+};
+
+/* I don't think iconv provides encodings for zapfdingbats nor jis201 */
+/* Perhaps I should list them here for compatability, but I think I'll just */
+/* leave them out. I doubt they get used. */
+static Encoding texbase = { "TeX-Base-Encoding", 256, tex_base_encoding, NULL, NULL, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0 }, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0 };
+ Encoding custom = { "Custom", 0, NULL, NULL, &texbase, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, { 0, 0 }, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0 };
+static Encoding original = { "Original", 0, NULL, NULL, &custom, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, { 0, 0 }, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0 };
+static Encoding unicodebmp = { "UnicodeBmp", 65536, NULL, NULL, &original, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0 }, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0 };
+static Encoding unicodefull = { "UnicodeFull", 17*65536, NULL, NULL, &unicodebmp, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, { 0, 0 }, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0 };
+static Encoding adobestd = { "AdobeStandard", 256, unicode_from_adobestd, AdobeStandardEncoding, &unicodefull,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0 }, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0 };
+static Encoding symbol = { "Symbol", 256, unicode_from_MacSymbol, NULL, &adobestd,1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0, 0 }, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0 };
+
+Encoding *enclist = &symbol;
+
+const char *FindUnicharName(void) {
+ /* Iconv and libiconv use different names for UCS2. Just great. Perhaps */
+ /* different versions of each use still different names? */
+ /* Even worse, both accept UCS-2, but under iconv it means native byte */
+ /* ordering and under libiconv it means big-endian */
+ iconv_t test;
+ static char *goodname = NULL;
+#ifdef UNICHAR_16
+ static char *names[] = { "UCS-2-INTERNAL", "UCS-2", "UCS2", "ISO-10646/UCS2", "UNICODE", NULL };
+ static char *namesle[] = { "UCS-2LE", "UNICODELITTLE", NULL };
+ static char *namesbe[] = { "UCS-2BE", "UNICODEBIG", NULL };
+#else
+ static char *names[] = { "UCS-4-INTERNAL", "UCS-4", "UCS4", "ISO-10646-UCS-4", "UTF-32", NULL };
+ static char *namesle[] = { "UCS-4LE", "UTF-32LE", NULL };
+ static char *namesbe[] = { "UCS-4BE", "UTF-32BE", NULL };
+#endif
+ char **testnames;
+ int i;
+ union {
+ short s;
+ char c[2];
+ } u;
+
+ if ( goodname!=NULL )
+return( goodname );
+
+ u.c[0] = 0x1; u.c[1] = 0x2;
+ if ( u.s==0x201 ) { /* Little endian */
+ testnames = namesle;
+ } else {
+ testnames = namesbe;
+ }
+ for ( i=0; testnames[i]!=NULL; ++i ) {
+ test = iconv_open(testnames[i],"ISO-8859-1");
+ if ( test!=(iconv_t) -1 && test!=NULL ) {
+ iconv_close(test);
+ goodname = testnames[i];
+ break;
+ }
+ }
+
+ if ( goodname==NULL ) {
+ for ( i=0; names[i]!=NULL; ++i ) {
+ test = iconv_open(names[i],"ISO-8859-1");
+ if ( test!=(iconv_t) -1 && test!=NULL ) {
+ iconv_close(test);
+ goodname = names[i];
+ break;
+ }
+ }
+ }
+
+ if ( goodname==NULL ) {
+#ifdef UNICHAR_16
+ IError( "I can't figure out your version of iconv(). I need a name for the UCS-2 encoding and I can't find one. Reconfigure --without-iconv. Bye.");
+#else
+ IError( "I can't figure out your version of iconv(). I need a name for the UCS-4 encoding and I can't find one. Reconfigure --without-iconv. Bye.");
+#endif
+ exit( 1 );
+ }
+
+ test = iconv_open(goodname,"Mac");
+ if ( test==(iconv_t) -1 || test==NULL ) {
+ IError( "Your version of iconv does not support the \"Mac Roman\" encoding.\nIf this causes problems, reconfigure --without-iconv." );
+ } else
+ iconv_close(test);
+
+ /* I really should check for ISO-2022-JP, KR, CN, and all the other encodings */
+ /* I might find in a ttf 'name' table. But those tables take too long to build */
+return( goodname );
+}
+
+static int TryEscape( Encoding *enc,char *escape_sequence ) {
+ char from[20], ucs[20];
+ size_t fromlen, tolen;
+ ICONV_CONST char *fpt;
+ char *upt;
+ int i, j, low;
+ int esc_len = strlen(escape_sequence);
+
+ strcpy(from,escape_sequence);
+
+ enc->has_2byte = false;
+ low = -1;
+ for ( i=0; i<256; ++i ) if ( i!=escape_sequence[0] ) {
+ for ( j=0; j<256; ++j ) {
+ from[esc_len] = i; from[esc_len+1] = j; from[esc_len+2] = 0;
+ fromlen = esc_len+2;
+ fpt = from;
+ upt = ucs;
+ tolen = sizeof(ucs);
+ if ( iconv( enc->tounicode , &fpt, &fromlen, &upt, &tolen )!= (size_t) (-1) &&
+ upt-ucs==sizeof(unichar_t) /* Exactly one character */ ) {
+ if ( low==-1 ) {
+ enc->low_page = low = i;
+ enc->has_2byte = true;
+ }
+ enc->high_page = i;
+ break;
+ }
+ }
+ }
+ if ( enc->low_page==enc->high_page )
+ enc->has_2byte = false;
+ if ( enc->has_2byte ) {
+ strcpy(enc->iso_2022_escape, escape_sequence);
+ enc->iso_2022_escape_len = esc_len;
+ }
+return( enc->has_2byte );
+}
+
+Encoding *_FindOrMakeEncoding(const char *name,int make_it) {
+ Encoding *enc;
+ char buffer[20];
+ const char *iconv_name;
+ Encoding temp;
+ uint8 good[256];
+ int i, j, any, all;
+ char from[8], ucs[20];
+ size_t fromlen, tolen;
+ ICONV_CONST char *fpt;
+ char *upt;
+ /* iconv is not case sensitive */
+
+ if ( strncasecmp(name,"iso8859_",8)==0 || strncasecmp(name,"koi8_",5)==0 ) {
+ /* Fixup for old naming conventions */
+ strncpy(buffer,name,sizeof(buffer));
+ *strchr(buffer,'_') = '-';
+ name = buffer;
+ } else if ( strcasecmp(name,"iso-8859")==0 ) {
+ /* Fixup for old naming conventions */
+ strncpy(buffer,name,3);
+ strncpy(buffer+3,name+4,sizeof(buffer)-3);
+ name = buffer;
+ } else if ( strcasecmp(name,"isolatin1")==0 ) {
+ name = "iso8859-1";
+ } else if ( strcasecmp(name,"isocyrillic")==0 ) {
+ name = "iso8859-5";
+ } else if ( strcasecmp(name,"isoarabic")==0 ) {
+ name = "iso8859-6";
+ } else if ( strcasecmp(name,"isogreek")==0 ) {
+ name = "iso8859-7";
+ } else if ( strcasecmp(name,"isohebrew")==0 ) {
+ name = "iso8859-8";
+ } else if ( strcasecmp(name,"isothai")==0 ) {
+ name = "tis-620"; /* TIS doesn't define non-breaking space in 0xA0 */
+ } else if ( strcasecmp(name,"latin0")==0 || strcasecmp(name,"latin9")==0 ) {
+ name = "iso8859-15"; /* "latin-9" is supported (libiconv bug?) */
+ } else if ( strcasecmp(name,"koi8r")==0 ) {
+ name = "koi8-r";
+ } else if ( strncasecmp(name,"jis201",6)==0 || strncasecmp(name,"jisx0201",8)==0 ) {
+ name = "jis_x0201";
+ } else if ( strcasecmp(name,"AdobeStandardEncoding")==0 || strcasecmp(name,"Adobe")==0 )
+ name = "AdobeStandard";
+ for ( enc=enclist; enc!=NULL; enc=enc->next )
+ if ( strmatch(name,enc->enc_name)==0 ||
+ (enc->iconv_name!=NULL && strmatch(name,enc->iconv_name)==0))
+return( enc );
+ if ( strmatch(name,"unicode")==0 || strmatch(name,"iso10646")==0 || strmatch(name,"iso10646-1")==0 )
+return( &unicodebmp );
+ if ( strmatch(name,"unicode4")==0 || strmatch(name,"ucs4")==0 )
+return( &unicodefull );
+
+ iconv_name = name;
+ /* Mac seems to work ok */
+ if ( strcasecmp(name,"win")==0 || strcasecmp(name,"ansi")==0 )
+ iconv_name = "MS-ANSI"; /* "WINDOWS-1252";*/
+ else if ( strncasecmp(name,"jis208",6)==0 || strncasecmp(name,"jisx0208",8)==0 )
+ iconv_name = "ISO-2022-JP";
+ else if ( strncasecmp(name,"jis212",6)==0 || strncasecmp(name,"jisx0212",8)==0 )
+ iconv_name = "ISO-2022-JP-2";
+ else if ( strncasecmp(name,"ksc5601",7)==0 )
+ iconv_name = "ISO-2022-KR";
+ else if ( strcasecmp(name,"gb2312pk")==0 || strcasecmp(name,"gb2312packed")==0 )
+ iconv_name = "EUC-CN";
+ else if ( strncasecmp(name,"gb2312",6)==0 )
+ iconv_name = "ISO-2022-CN";
+ else if ( strcasecmp(name,"wansung")==0 )
+ iconv_name = "EUC-KR";
+ else if ( strcasecmp(name,"EUC-CN")==0 ) {
+ iconv_name = name;
+ name = "gb2312pk";
+ } else if ( strcasecmp(name,"EUC-KR")==0 ) {
+ iconv_name = name;
+ name = "wansung";
+ }
+
+/* Escape sequences: */
+/* ISO-2022-CN: \e $ ) A ^N */
+/* ISO-2022-KR: \e $ ) C ^N */
+/* ISO-2022-JP: \e $ B */
+/* ISO-2022-JP-2: \e $ ( D */
+/* ISO-2022-JP-3: \e $ ( O */ /* Capital "O", not zero */
+/* ISO-2022-CN-EXT: \e $ ) E ^N */ /* Not sure about this, also uses CN escape */
+
+ memset(&temp,0,sizeof(temp));
+ temp.builtin = true;
+ temp.tounicode = iconv_open(FindUnicharName(),iconv_name);
+ if ( temp.tounicode==(iconv_t) -1 || temp.tounicode==NULL )
+return( NULL ); /* Iconv doesn't recognize this name */
+ temp.fromunicode = iconv_open(iconv_name,FindUnicharName());
+ if ( temp.fromunicode==(iconv_t) -1 || temp.fromunicode==NULL ) {
+ /* This should never happen, but if it does... */
+ iconv_close(temp.tounicode);
+return( NULL );
+ }
+
+ memset(good,0,sizeof(good));
+ any = false; all = true;
+ for ( i=1; i<256; ++i ) {
+ from[0] = i; from[1] = 0;
+ fromlen = 1;
+ fpt = from;
+ upt = ucs;
+ tolen = sizeof(ucs);
+ if ( iconv( temp.tounicode , &fpt, &fromlen, &upt, &tolen )!= (size_t) (-1)) {
+ good[i] = true;
+ any = true;
+ } else
+ all = false;
+ }
+ if ( any )
+ temp.has_1byte = true;
+ if ( all )
+ temp.only_1byte = true;
+
+ if ( !all ) {
+ if ( strstr(iconv_name,"2022")==NULL ) {
+ for ( i=temp.has_1byte; i<256; ++i ) if ( !good[i] ) {
+ for ( j=0; j<256; ++j ) {
+ from[0] = i; from[1] = j; from[2] = 0;
+ fromlen = 2;
+ fpt = from;
+ upt = ucs;
+ tolen = sizeof(ucs);
+ if ( iconv( temp.tounicode , &fpt, &fromlen, &upt, &tolen )!= (size_t) (-1) &&
+ upt-ucs==sizeof(unichar_t) /* Exactly one character */ ) {
+ if ( temp.low_page==-1 )
+ temp.low_page = i;
+ temp.high_page = i;
+ temp.has_2byte = true;
+ break;
+ }
+ }
+ }
+ if ( temp.low_page==temp.high_page ) {
+ temp.has_2byte = false;
+ temp.low_page = temp.high_page = -1;
+ }
+ }
+ if ( !temp.has_2byte && !good[033]/* escape */ ) {
+ if ( strstr(iconv_name,"2022")!=NULL &&
+ strstr(iconv_name,"JP3")!=NULL &&
+ TryEscape( &temp,"\33$(O" )) {
+ ;
+ }
+ else if ( strstr(iconv_name,"2022")!=NULL &&
+ strstr(iconv_name,"JP2")!=NULL &&
+ TryEscape( &temp,"\33$(D" )) {
+ ;
+ }
+ else if ( strstr(iconv_name,"2022")!=NULL &&
+ strstr(iconv_name,"JP")!=NULL &&
+ TryEscape( &temp,"\33$B" )) {
+ ;
+ }
+ else if ( strstr(iconv_name,"2022")!=NULL &&
+ strstr(iconv_name,"KR")!=NULL &&
+ TryEscape( &temp,"\33$)C\16" )) {
+ ;
+ }
+ else if ( strstr(iconv_name,"2022")!=NULL &&
+ strstr(iconv_name,"CN")!=NULL &&
+ TryEscape( &temp,"\33$)A\16" )) {
+ ;
+ }
+ }
+ }
+ if ( !temp.has_1byte && !temp.has_2byte )
+return( NULL );
+ if ( !make_it )
+return( NULL );
+
+ enc = chunkalloc(sizeof(Encoding));
+ *enc = temp;
+ enc->enc_name = copy(name);
+ if ( iconv_name!=name )
+ enc->iconv_name = copy(iconv_name);
+ enc->next = enclist;
+ enc->builtin = true;
+ enclist = enc;
+ if ( enc->has_2byte )
+ enc->char_cnt = (enc->high_page<<8) + 256;
+ else {
+ enc->char_cnt = 256;
+ enc->only_1byte = true;
+ }
+ if ( strstrmatch(iconv_name,"JP")!=NULL ||
+ strstrmatch(iconv_name,"sjis")!=NULL ||
+ strstrmatch(iconv_name,"cp932")!=NULL )
+ enc->is_japanese = true;
+ else if ( strstrmatch(iconv_name,"KR")!=NULL )
+ enc->is_korean = true;
+ else if ( strstrmatch(iconv_name,"CN")!=NULL )
+ enc->is_simplechinese = true;
+ else if ( strstrmatch(iconv_name,"BIG")!=NULL && strstrmatch(iconv_name,"5")!=NULL )
+ enc->is_tradchinese = true;
+
+ if ( strstrmatch(name,"ISO8859")!=NULL &&
+ strtol(name+strlen(name)-2,NULL,10)>=16 )
+ /* Not in our menu, don't hide */;
+ else if ( iconv_name!=name || strmatch(name,"mac")==0 || strstrmatch(name,"ISO8859")!=NULL ||
+ strmatch(name,"koi8-r")==0 || strmatch(name,"sjis")==0 ||
+ strmatch(name,"big5")==0 || strmatch(name,"big5hkscs")==0 )
+ enc->hidden = true;
+
+return( enc );
+}
+
+Encoding *FindOrMakeEncoding(const char *name) {
+return( _FindOrMakeEncoding(name,true));
+}
+
+
+/* ************************************************************************** */
+/* ****************************** CID Encodings ***************************** */
+/* ************************************************************************** */
+struct cidmap *cidmaps = NULL;
+
+int CID2NameUni(struct cidmap *map,int cid, char *buffer, int len) {
+ int enc = -1;
+ const char *temp;
+
+#if defined( _NO_SNPRINTF ) || defined( __VMS )
+ if ( map==NULL )
+ sprintf(buffer,"cid-%d", cid);
+ else if ( cid<map->namemax && map->name[cid]!=NULL )
+ strncpy(buffer,map->name[cid],len);
+ else if ( cid==0 || (cid<map->namemax && map->unicode[cid]!=0 )) {
+ if ( map->unicode==NULL || map->namemax==0 )
+ enc = 0;
+ else
+ enc = map->unicode[cid];
+ temp = StdGlyphName(buffer,enc,ui_none,(NameList *) -1);
+ if ( temp!=buffer )
+ strcpy(buffer,temp);
+ } else
+ sprintf(buffer,"%s.%d", map->ordering, cid);
+#else
+ if ( map==NULL )
+ snprintf(buffer,len,"cid-%d", cid);
+ else if ( cid<map->namemax && map->name[cid]!=NULL )
+ strncpy(buffer,map->name[cid],len);
+ else if ( cid==0 )
+ strcpy(buffer,".notdef");
+ else if ( cid<map->namemax && map->unicode[cid]!=0 ) {
+ if ( map->unicode==NULL || map->namemax==0 )
+ enc = 0;
+ else
+ enc = map->unicode[cid];
+ temp = StdGlyphName(buffer,enc,ui_none,(NameList *) -1);
+ if ( temp!=buffer )
+ strcpy(buffer,temp);
+ } else
+ snprintf(buffer,len,"%s.%d", map->ordering, cid);
+#endif
+return( enc );
+}
+
+int NameUni2CID(struct cidmap *map,int uni, const char *name) {
+ int i;
+
+ if ( map==NULL )
+return( -1 );
+ if ( uni!=-1 ) {
+ for ( i=0; i<map->namemax; ++i )
+ if ( map->unicode[i]==(unsigned)uni )
+return( i );
+ } else {
+ for ( i=0; i<map->namemax; ++i )
+ if ( map->name[i]!=NULL && strcmp(map->name[i],name)==0 )
+return( i );
+ }
+return( -1 );
+}
+
+int MaxCID(struct cidmap *map) {
+return( map->cidmax );
+}
+
+static char *SearchDirForCidMap(char *dir,char *registry,char *ordering,
+ int supplement,char **maybefile) {
+ char maybe[FILENAME_MAX+1];
+ struct dirent *ent;
+ DIR *d;
+ int len, rlen = strlen(registry), olen=strlen(ordering);
+ char *pt, *end, *ret;
+ int test, best = -1;
+
+ if ( dir==NULL )
+return( NULL );
+
+ if ( *maybefile!=NULL ) {
+ char *pt = strrchr(*maybefile,'.');
+ while ( pt>*maybefile && isdigit(pt[-1]))
+ --pt;
+ best = strtol(pt,NULL,10);
+ }
+
+ d = opendir(dir);
+ if ( d==NULL )
+return( NULL );
+ while ( (ent = readdir(d))!=NULL ) {
+ if ( (len = strlen(ent->d_name))<8 )
+ continue;
+ if ( strcmp(ent->d_name+len-7,".cidmap")!=0 )
+ continue;
+ if ( strncmp(ent->d_name,registry,rlen)!=0 || ent->d_name[rlen]!='-' )
+ continue;
+ pt = ent->d_name+rlen+1;
+ if ( strncmp(pt,ordering,olen)!=0 || pt[olen]!='-' )
+ continue;
+ pt += olen+1;
+ if ( !isdigit(*pt))
+ continue;
+ test = strtol(pt,&end,10);
+ if ( *end!='.' )
+ continue;
+ if ( test>=supplement ) {
+ ret = galloc(strlen(dir)+1+len+1);
+ strcpy(ret,dir);
+ strcat(ret,"/");
+ strcat(ret,ent->d_name);
+ closedir(d);
+return( ret );
+ } else if ( test>best ) {
+ best = test;
+ strcpy(maybe,ent->d_name);
+ }
+ }
+ closedir(d);
+ if ( best>-1 ) {
+ ret = galloc(strlen(dir)+1+strlen(maybe)+1);
+ strcpy(ret,dir);
+ strcat(ret,"/");
+ strcat(ret,maybe);
+ *maybefile = ret;
+ }
+return( NULL );
+}
+
+static struct cidmap *MakeDummyMap(char *registry,char *ordering,int supplement) {
+ struct cidmap *ret = galloc(sizeof(struct cidmap));
+
+ ret->registry = copy(registry);
+ ret->ordering = copy(ordering);
+ ret->supplement = ret->maxsupple = supplement;
+ ret->cidmax = ret->namemax = 0;
+ ret->unicode = NULL; ret->name = NULL;
+ ret->next = cidmaps;
+ cidmaps = ret;
+return( ret );
+}
+
+struct cidmap *LoadMapFromFile(char *file,char *registry,char *ordering,
+ int supplement) {
+ struct cidmap *ret = galloc(sizeof(struct cidmap));
+ char *pt = strrchr(file,'.');
+ FILE *f;
+ int cid1, cid2, uni, cnt, i;
+ char name[100];
+
+ while ( pt>file && isdigit(pt[-1]))
+ --pt;
+ ret->supplement = ret->maxsupple = strtol(pt,NULL,10);
+ if ( supplement>ret->maxsupple )
+ ret->maxsupple = supplement;
+ ret->registry = copy(registry);
+ ret->ordering = copy(ordering);
+ ret->next = cidmaps;
+ cidmaps = ret;
+
+ f = fopen( file,"r" );
+ if ( f==NULL ) {
+ ff_post_error(_("Missing cidmap file"),_("Couldn't open cidmap file: %s"), file );
+ ret->cidmax = ret->namemax = 0;
+ ret->unicode = NULL; ret->name = NULL;
+ } else if ( fscanf( f, "%d %d", &ret->cidmax, &ret->namemax )!=2 ) {
+ ff_post_error(_("Bad cidmap file"),_("%s is not a cidmap file, please download\nhttp://fontforge.sourceforge.net/cidmaps.tgz"), file );
+ fprintf( stderr, _("%s is not a cidmap file, please download\nhttp://fontforge.sourceforge.net/cidmaps.tgz"), file );
+ ret->cidmax = ret->namemax = 0;
+ ret->unicode = NULL; ret->name = NULL;
+ } else {
+ ret->unicode = gcalloc(ret->namemax+1,sizeof(uint32));
+ ret->name = gcalloc(ret->namemax+1,sizeof(char *));
+ while ( 1 ) {
+ cnt=fscanf( f, "%d..%d %x", &cid1, &cid2, (unsigned *) &uni );
+ if ( cnt<=0 )
+ break;
+ if ( cid1>ret->namemax )
+ continue;
+ if ( cnt==3 ) {
+ if ( cid2>ret->namemax ) cid2 = ret->namemax;
+ for ( i=cid1; i<=cid2; ++i )
+ ret->unicode[i] = uni++;
+ } else if ( cnt==1 ) {
+ if ( fscanf(f,"%x", (unsigned *) &uni )==1 )
+ ret->unicode[cid1] = uni;
+ else if ( fscanf(f," /%s", name )==1 )
+ ret->name[cid1] = copy(name);
+ }
+ }
+ fclose(f);
+ }
+ free(file);
+return( ret );
+}
+
+struct cidmap *FindCidMap(char *registry,char *ordering,int supplement,SplineFont *sf) {
+ struct cidmap *map, *maybe=NULL;
+ char *file, *maybefile=NULL;
+ int maybe_sup = -1;
+ char *buts[3], *buts2[3];
+ char buf[100];
+ int ret;
+
+ if ( sf!=NULL && sf->cidmaster ) sf = sf->cidmaster;
+ if ( sf!=NULL && sf->loading_cid_map )
+return( NULL );
+
+ for ( map = cidmaps; map!=NULL; map = map->next ) {
+ if ( strcmp(map->registry,registry)==0 && strcmp(map->ordering,ordering)==0 ) {
+ if ( supplement<=map->supplement )
+return( map );
+ else if ( maybe==NULL || maybe->supplement<map->supplement )
+ maybe = map;
+ }
+ }
+ if ( maybe!=NULL && supplement<=maybe->maxsupple )
+return( maybe ); /* User has said it's ok to use maybe at this supplement level */
+
+ file = SearchDirForCidMap(".",registry,ordering,supplement,&maybefile);
+ if ( file==NULL )
+ file = SearchDirForCidMap(getFontForgeShareDir(),registry,ordering,supplement,&maybefile);
+
+ if ( file==NULL && (maybe!=NULL || maybefile!=NULL)) {
+ if ( maybefile!=NULL ) {
+ char *pt = strrchr(maybefile,'.');
+ while ( pt>maybefile && isdigit(pt[-1]))
+ --pt;
+ maybe_sup = strtol(pt,NULL,10);
+ if ( maybe!=NULL && maybe->supplement >= maybe_sup ) {
+ free(maybefile); maybefile = NULL;
+ maybe_sup = maybe->supplement;
+ } else
+ maybe = NULL;
+ }
+ if ( maybe!=NULL )
+ maybe_sup = maybe->supplement;
+ if ( sf!=NULL ) sf->loading_cid_map = true;
+ buts[0] = _("_Use It"); buts[1] = _("_Search"); buts[2] = NULL;
+ ret = ff_ask(_("Use CID Map"),(const char **) buts,0,1,_("This font is based on the charset %1$.20s-%2$.20s-%3$d, but the best I've been able to find is %1$.20s-%2$.20s-%4$d.\nShall I use that or let you search?"),
+ registry,ordering,supplement,maybe_sup);
+ if ( sf!=NULL ) sf->loading_cid_map = false;
+ if ( ret==0 ) {
+ if ( maybe!=NULL ) {
+ maybe->maxsupple = supplement;
+return( maybe );
+ } else {
+ file = maybefile;
+ maybefile = NULL;
+ }
+ }
+ }
+
+ if ( file==NULL ) {
+ char *uret;
+#if defined( _NO_SNPRINTF ) || defined( __VMS )
+ sprintf(buf,"%s-%s-*.cidmap", registry, ordering );
+#else
+ snprintf(buf,sizeof(buf),"%s-%s-*.cidmap", registry, ordering );
+#endif
+ if ( maybe==NULL && maybefile==NULL ) {
+ buf[0] = '\0';
+ }
+ uret = NULL;
+ if ( uret==NULL ) {
+ buts2[0] = "_Use It"; buts2[1] = "_Search"; buts2[2] = NULL;
+ if ( maybe==NULL && maybefile==NULL )
+ /* No luck */;
+ else if ( maybe!=NULL ) {
+ maybe->maxsupple = supplement;
+return( maybe );
+ } else {
+ file = maybefile;
+ maybefile = NULL;
+ }
+ } else {
+ file = utf82def_copy(uret);
+ free(uret);
+ }
+ }
+
+ free(maybefile);
+ if ( file!=NULL )
+return( LoadMapFromFile(file,registry,ordering,supplement));
+
+return( MakeDummyMap(registry,ordering,supplement));
+}
+
+/* ************************** Reencoding routines ************************** */
+
+
+EncMap *EncMapFromEncoding(SplineFont *sf,Encoding *enc) {
+ int i,j, extras, found, base, unmax;
+ int *encoded, *unencoded;
+ EncMap *map;
+ struct altuni *altuni;
+ SplineChar *sc;
+
+ if ( enc==NULL )
+return( NULL );
+
+ base = enc->char_cnt;
+ if ( enc->is_original )
+ base = 0;
+ else if ( enc->char_cnt<=256 )
+ base = 256;
+ else if ( enc->char_cnt<=0x10000 )
+ base = 0x10000;
+ encoded = galloc(base*sizeof(int));
+ memset(encoded,-1,base*sizeof(int));
+ unencoded = galloc(sf->glyphcnt*sizeof(int));
+ unmax = sf->glyphcnt;
+
+ for ( i=extras=0; i<sf->glyphcnt; ++i ) if ( (sc=sf->glyphs[i])!=NULL ) {
+ found = false;
+ if ( enc->psnames!=NULL ) {
+ for ( j=enc->char_cnt-1; j>=0; --j ) {
+ if ( enc->psnames[j]!=NULL &&
+ strcmp(enc->psnames[j],sc->name)==0 ) {
+ found = true;
+ encoded[j] = i;
+ }
+ }
+ }
+ if ( !found ) {
+ if ( sc->unicodeenc!=-1 &&
+ sc->unicodeenc<unicode4_size &&
+ (j = EncFromUni(sc->unicodeenc,enc))!= -1 )
+ encoded[j] = i;
+ else {
+ /* I don't think extras can surpass unmax now, but it doesn't */
+ /* hurt to leave the code (it's from when we encoded duplicates see below) */
+ if ( extras>=unmax ) unencoded = grealloc(unencoded,(unmax+=300)*sizeof(int));
+ unencoded[extras++] = i;
+ }
+ for ( altuni=sc->altuni; altuni!=NULL; altuni=altuni->next ) {
+ if ( altuni->unienc!=-1 &&
+ altuni->unienc<unicode4_size &&
+ altuni->vs==-1 &&
+ altuni->fid==0 &&
+ (j = EncFromUni(altuni->unienc,enc))!= -1 )
+ encoded[j] = i;
+ /* I used to have code here to add these unencoded duplicates */
+ /* but I don't really see any reason to do so. The main unicode */
+ /* will occur, and any encoded duplicates so the glyph won't */
+ /* vanish */
+ }
+ }
+ }
+
+ /* Some glyphs have both a pua encoding and an encoding in a non-bmp */
+ /* plane. Big5HK does and the AMS glyphs do */
+ if ( enc->is_unicodefull && (sf->uni_interp == ui_trad_chinese ||
+ sf->uni_interp == ui_ams )) {
+ extern const int cns14pua[], amspua[];
+ const int *pua = sf->uni_interp == ui_ams? amspua : cns14pua;
+ for ( i=0xe000; i<0xf8ff; ++i ) {
+ if ( pua[i-0xe000]!=0 )
+ encoded[pua[i-0xe000]] = encoded[i];
+ }
+ }
+
+ if ( enc->psnames != NULL ) {
+ /* Names are more important than unicode code points for some encodings */
+ /* AdobeStandard for instance which won't work if you have a glyph */
+ /* named "f_i" (must be "fi") even though the code point is correct */
+ /* The code above would match f_i where AS requires fi, so force the */
+ /* names to be correct. */
+ for ( j=0; j<enc->char_cnt; ++j ) {
+ if ( encoded[j]!=-1 && enc->psnames[j]!=NULL &&
+ strcmp(sf->glyphs[encoded[j]]->name,enc->psnames[j])!=0 ) {
+ free(sf->glyphs[encoded[j]]->name);
+ sf->glyphs[encoded[j]]->name = copy(enc->psnames[j]);
+ }
+ }
+ }
+
+ map = chunkalloc(sizeof(EncMap));
+ map->enccount = map->encmax = base + extras;
+ map->map = galloc(map->enccount*sizeof(int));
+ memcpy(map->map,encoded,base*sizeof(int));
+ memcpy(map->map+base,unencoded,extras*sizeof(int));
+ map->backmax = sf->glyphcnt;
+ map->backmap = galloc(sf->glyphcnt*sizeof(int));
+ memset(map->backmap,-1,sf->glyphcnt*sizeof(int)); /* Just in case there are some unencoded glyphs (duplicates perhaps) */
+ for ( i = map->enccount-1; i>=0; --i ) if ( map->map[i]!=-1 )
+ map->backmap[map->map[i]] = i;
+ map->enc = enc;
+
+ free(encoded);
+ free(unencoded);
+
+return( map );
+}
+
+EncMap *CompactEncMap(EncMap *map, SplineFont *sf) {
+ int i, inuse, gid;
+ int32 *newmap;
+
+ for ( i=inuse=0; i<map->enccount ; ++i )
+ if ( (gid = map->map[i])!=-1 && SCWorthOutputting(sf->glyphs[gid]))
+ ++inuse;
+ newmap = galloc(inuse*sizeof(int32));
+ for ( i=inuse=0; i<map->enccount ; ++i )
+ if ( (gid = map->map[i])!=-1 && SCWorthOutputting(sf->glyphs[gid]))
+ newmap[inuse++] = gid;
+ free(map->map);
+ map->map = newmap;
+ map->enccount = inuse;
+ map->encmax = inuse;
+ map->enc = &custom;
+ memset(map->backmap,-1,sf->glyphcnt*sizeof(int));
+ for ( i=inuse-1; i>=0; --i )
+ if ( (gid=map->map[i])!=-1 )
+ map->backmap[gid] = i;
+return( map );
+}
+
+
+static int MapAddEncodingSlot(EncMap *map,int gid) {
+ int enc;
+
+ if ( map->enccount>=map->encmax )
+ map->map = grealloc(map->map,(map->encmax+=10)*sizeof(int));
+ enc = map->enccount++;
+ map->map[enc] = gid;
+ map->backmap[gid] = enc;
+return( enc );
+}
+
+void FVAddEncodingSlot(FontViewBase *fv,int gid) {
+ EncMap *map = fv->map;
+ int enc;
+
+ enc = MapAddEncodingSlot(map,gid);
+
+ fv->selected = grealloc(fv->selected,map->enccount);
+ fv->selected[enc] = 0;
+ FVAdjustScrollBarRows(fv,enc);
+}
+
+static int MapAddEnc(SplineFont *sf,SplineChar *sc,EncMap *basemap, EncMap *map,int baseenc, int gid, FontViewBase *fv) {
+ int any = false, enc;
+
+ if ( gid>=map->backmax ) {
+ map->backmap = grealloc(map->backmap,(map->backmax+=10)*sizeof(int));
+ memset(map->backmap+map->backmax-10,-1,10*sizeof(int));
+ }
+ if ( map->enc->psnames!=NULL ) {
+ /* Check for multiple encodings */
+ for ( enc = map->enc->char_cnt-1; enc>=0; --enc ) {
+ if ( map->enc->psnames[enc]!=NULL && strcmp(sc->name,map->enc->psnames[enc])==0 ) {
+ if ( !any ) {
+ map->backmap[gid] = enc;
+ any = true;
+ }
+ map->map[enc] = gid;
+ }
+ }
+ } else {
+ enc = SFFindSlot(sf,map,sc->unicodeenc,sc->name);
+ if ( enc!=-1 ) {
+ map->map[enc] = gid;
+ map->backmap[gid] = enc;
+ any = true;
+ }
+ }
+ if ( basemap!=NULL && map->enc==basemap->enc && baseenc!=-1 ) {
+ if ( baseenc>=map->enccount ) {
+ if ( map==fv->map )
+ FVAddEncodingSlot(fv,gid);
+ else
+ MapAddEncodingSlot(map,gid);
+ } else {
+ map->map[baseenc] = gid;
+ if ( map->backmap[gid]==-1 )
+ map->backmap[gid] = baseenc;
+ }
+ any = true;
+ }
+return( any );
+}
+
+void SFAddGlyphAndEncode(SplineFont *sf,SplineChar *sc,EncMap *basemap, int baseenc) {
+ int gid, mapfound = false;
+ FontViewBase *fv;
+ BDFFont *bdf;
+
+ if ( sf->cidmaster==NULL ) {
+ if ( sf->glyphcnt+1>=sf->glyphmax )
+ sf->glyphs = grealloc(sf->glyphs,(sf->glyphmax+=10)*sizeof(SplineChar *));
+ gid = sf->glyphcnt++;
+ for ( bdf = sf->bitmaps; bdf!=NULL; bdf=bdf->next ) {
+ if ( sf->glyphcnt+1>=bdf->glyphmax )
+ bdf->glyphs = grealloc(bdf->glyphs,(bdf->glyphmax=sf->glyphmax)*sizeof(BDFChar *));
+ if ( sf->glyphcnt>bdf->glyphcnt ) {
+ memset(bdf->glyphs+bdf->glyphcnt,0,(sf->glyphcnt-bdf->glyphcnt)*sizeof(BDFChar *));
+ bdf->glyphcnt = sf->glyphcnt;
+ }
+ }
+ for ( fv=sf->fv; fv!=NULL; fv = fv->nextsame ) {
+ EncMap *map = fv->map;
+ if ( gid>=map->backmax )
+ map->backmap = grealloc(map->backmap,(map->backmax=gid+10)*sizeof(int));
+ map->backmap[gid] = -1;
+ }
+ } else {
+ gid = baseenc;
+ if ( baseenc+1>=sf->glyphmax )
+ sf->glyphs = grealloc(sf->glyphs,(sf->glyphmax = baseenc+10)*sizeof(SplineChar *));
+ if ( baseenc>=sf->glyphcnt ) {
+ memset(sf->glyphs+sf->glyphcnt,0,(baseenc+1-sf->glyphcnt)*sizeof(SplineChar *));
+ sf->glyphcnt = baseenc+1;
+ for ( bdf = sf->cidmaster->bitmaps; bdf!=NULL; bdf=bdf->next ) {
+ if ( baseenc+1>=bdf->glyphmax )
+ bdf->glyphs = grealloc(bdf->glyphs,(bdf->glyphmax=baseenc+10)*sizeof(BDFChar *));
+ if ( baseenc+1>bdf->glyphcnt ) {
+ memset(bdf->glyphs+bdf->glyphcnt,0,(baseenc+1-bdf->glyphcnt)*sizeof(BDFChar *));
+ bdf->glyphcnt = baseenc+1;
+ }
+ }
+ for ( fv=sf->fv; fv!=NULL; fv = fv->nextsame ) if ( fv->sf==sf ) {
+ EncMap *map = fv->map;
+ if ( gid>=map->backmax )
+ map->backmap = grealloc(map->backmap,(map->backmax=gid+10)*sizeof(int));
+ map->backmap[gid] = -1;
+ }
+ }
+ }
+ sf->glyphs[gid] = NULL;
+ for ( fv=sf->fv; fv!=NULL; fv = fv->nextsame ) {
+ EncMap *map = fv->map;
+
+ FVBiggerGlyphCache(fv,gid);
+
+ if ( !MapAddEnc(sf,sc,basemap,map,baseenc,gid,fv) )
+ FVAddEncodingSlot(fv,gid);
+ if ( map==basemap ) mapfound = true;
+ if ( fv->normal!=NULL ) {
+ if ( !MapAddEnc(sf,sc,basemap,fv->normal,baseenc,gid,fv))
+ MapAddEncodingSlot(fv->normal,gid);
+ }
+ }
+ if ( !mapfound && basemap!=NULL )
+ MapAddEnc(sf,sc,basemap,basemap,baseenc,gid,fv);
+ sf->glyphs[gid] = sc;
+ sc->orig_pos = gid;
+ sc->parent = sf;
+ SFHashGlyph(sf,sc);
+}
+
+
+int32 UniFromEnc(int enc, Encoding *encname) {
+ char from[20];
+ unichar_t to[20];
+ ICONV_CONST char *fpt;
+ char *tpt;
+ size_t fromlen, tolen;
+
+ if ( encname->is_custom || encname->is_original )
+return( -1 );
+ if ( enc>=encname->char_cnt )
+return( -1 );
+ if ( encname->is_unicodebmp || encname->is_unicodefull )
+return( enc );
+ if ( encname->unicode!=NULL )
+return( encname->unicode[enc] );
+ else if ( encname->tounicode ) {
+ /* To my surprise, on RH9, doing a reset on conversion of CP1258->UCS2 */
+ /* causes subsequent calls to return garbage */
+ if ( encname->iso_2022_escape_len ) {
+ tolen = sizeof(to); fromlen = 0;
+ iconv(encname->tounicode,NULL,&fromlen,NULL,&tolen); /* Reset state */
+ }
+ fpt = from; tpt = (char *) to; tolen = sizeof(to);
+ if ( encname->has_1byte && enc<256 ) {
+ *(char *) fpt = enc;
+ fromlen = 1;
+ } else if ( encname->has_2byte ) {
+ if ( encname->iso_2022_escape_len )
+ strncpy(from,encname->iso_2022_escape,encname->iso_2022_escape_len );
+ fromlen = encname->iso_2022_escape_len;
+ from[fromlen++] = enc>>8;
+ from[fromlen++] = enc&0xff;
+ }
+ if ( iconv(encname->tounicode,&fpt,&fromlen,&tpt,&tolen)==(size_t) -1 )
+return( -1 );
+ if ( tpt-(char *) to == 0 ) {
+ /* This strange call appears to be what we need to make CP1258->UCS2 */
+ /* work. It's supposed to reset the state and give us the shift */
+ /* out. As there is no state, and no shift out I have no idea why*/
+ /* this works, but it does. */
+ if ( iconv(encname->tounicode,NULL,&fromlen,&tpt,&tolen)==(size_t) -1 )
+return( -1 );
+ }
+ if ( tpt-(char *) to == sizeof(unichar_t) )
+return( to[0] );
+#ifdef UNICHAR_16
+ else if ( tpt-(char *) to == 4 && to[0]>=0xd800 && to[0]<0xdc00 && to[1]>=0xdc00 )
+return( ((to[0]-0xd800)<<10) + (to[1]-0xdc00) + 0x10000 );
+#endif
+ } else if ( encname->tounicode_func!=NULL ) {
+return( (encname->tounicode_func)(enc) );
+ }
+return( -1 );
+}
+
+int32 EncFromUni(int32 uni, Encoding *enc) {
+ unichar_t from[20];
+ unsigned char to[20];
+ ICONV_CONST char *fpt;
+ char *tpt;
+ size_t fromlen, tolen;
+ int i;
+
+ if ( enc->is_custom || enc->is_original || enc->is_compact || uni==-1 )
+return( -1 );
+ if ( enc->is_unicodebmp || enc->is_unicodefull )
+return( uni<enc->char_cnt ? uni : -1 );
+
+ if ( enc->unicode!=NULL ) {
+ for ( i=0; i<enc->char_cnt; ++i ) {
+ if ( enc->unicode[i]==uni )
+return( i );
+ }
+return( -1 );
+ } else if ( enc->fromunicode!=NULL ) {
+ /* I don't see how there can be any state to reset in this direction */
+ /* So I don't reset it */
+#ifdef UNICHAR_16
+ if ( uni<0x10000 ) {
+ from[0] = uni;
+ fromlen = sizeof(unichar_t);
+ } else {
+ uni -= 0x10000;
+ from[0] = 0xd800 + (uni>>10);
+ from[1] = 0xdc00 + (uni&0x3ff);
+ fromlen = 2*sizeof(unichar_t);
+ }
+#else
+ from[0] = uni;
+ fromlen = sizeof(unichar_t);
+#endif
+ fpt = (char *) from; tpt = (char *) to; tolen = sizeof(to);
+ iconv(enc->fromunicode,NULL,NULL,NULL,NULL); /* reset shift in/out, etc. */
+ if ( iconv(enc->fromunicode,&fpt,&fromlen,&tpt,&tolen)==(size_t) -1 )
+return( -1 );
+ if ( tpt-(char *) to == 1 )
+return( to[0] );
+ if ( enc->iso_2022_escape_len!=0 ) {
+ if ( tpt-(char *) to == enc->iso_2022_escape_len+2 &&
+ strncmp((char *) to,enc->iso_2022_escape,enc->iso_2022_escape_len)==0 )
+return( (to[enc->iso_2022_escape_len]<<8) | to[enc->iso_2022_escape_len+1] );
+ } else {
+ if ( tpt-(char *) to == sizeof(unichar_t) )
+return( (to[0]<<8) | to[1] );
+ }
+ } else if ( enc->fromunicode_func!=NULL ) {
+return( (enc->fromunicode_func)(uni) );
+ }
+return( -1 );
+}
+
+int32 EncFromName(const char *name,enum uni_interp interp,Encoding *encname) {
+ int i;
+ if ( encname->psnames!=NULL ) {
+ for ( i=0; i<encname->char_cnt; ++i )
+ if ( encname->psnames[i]!=NULL && strcmp(name,encname->psnames[i])==0 )
+return( i );
+ }
+ i = UniFromName(name,interp,encname);
+ if ( i==-1 && strlen(name)==4 ) {
+ /* MS says use this kind of name, Adobe says use the one above */
+ char *end;
+ i = strtol(name,&end,16);
+ if ( i<0 || i>0xffff || *end!='\0' )
+return( -1 );
+ }
+return( EncFromUni(i,encname));
+}
+
+void SFExpandGlyphCount(SplineFont *sf, int newcnt) {
+ int old = sf->glyphcnt;
+ FontViewBase *fv;
+
+ if ( old>=newcnt )
+return;
+ if ( sf->glyphmax<newcnt ) {
+ sf->glyphs = grealloc(sf->glyphs,newcnt*sizeof(SplineChar *));
+ sf->glyphmax = newcnt;
+ }
+ memset(sf->glyphs+sf->glyphcnt,0,(newcnt-sf->glyphcnt)*sizeof(SplineChar *));
+ sf->glyphcnt = newcnt;
+
+ for ( fv=sf->fv; fv!=NULL; fv=fv->nextsame ) {
+ if ( fv->sf==sf ) { /* Beware of cid keyed fonts which might look at a different subfont */
+ if ( fv->normal!=NULL )
+ continue; /* If compacted then we haven't added any glyphs so haven't changed anything */
+ /* Don't display any of these guys, so not mapped. */
+ /* No change to selection, or to map->map, but change to backmap */
+ if ( newcnt>fv->map->backmax )
+ fv->map->backmap = grealloc(fv->map->backmap,(fv->map->backmax = newcnt+5)*sizeof(int32));
+ memset(fv->map->backmap+old,-1,(newcnt-old)*sizeof(int32));
+ }
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.h
new file mode 100644
index 00000000000..c272c6d2ff7
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/encoding.h
@@ -0,0 +1,18 @@
+#ifndef _ENCODING_H
+#define _ENCODING_H
+
+struct cidmap {
+ char *registry, *ordering;
+ int supplement, maxsupple;
+ int cidmax; /* Max cid found in the charset */
+ int namemax; /* Max cid with useful info */
+ uint32 *unicode;
+ char **name;
+ struct cidmap *next;
+};
+
+extern struct cidmap *cidmaps;
+
+extern void DeleteEncoding(Encoding *me);
+extern void RemoveMultiples(Encoding *item);
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/featurefile.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/featurefile.c
index b90b9b6a625..bf89c45f6ca 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/featurefile.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/featurefile.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -24,1443 +24,22 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "pfaeditui.h"
+#include "fontforgevw.h"
#include "ttf.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
+#ifdef __need_size_t
+/* This is a bug on the mac, someone defines this and leaves it defined */
+/* that means when I load stddef.h it only defines size_t and doesn't */
+/* do offset_of, which is what I need */
+# undef __need_size_t
+#endif
#include <stddef.h>
#include <string.h>
#include <utype.h>
#include <ustring.h>
-#include <stddef.h> /* for offsetof() */
-
-#ifdef LUA_FF_LIB
-extern void gwwv_post_error(char *a, ...);
-extern void gwwv_post_notice (char *a, ...) ;
-
-#define Isspace(a) ((a)==' '|| ((a) >= '\t' && (a) <= '\r'))
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#define Isalpha(a) (((a)>='A' && (a)<='Z')||((a)>='a' && (a)<='z'))
-#define Ishexdigit(a) (((a)>='0' && (a)<='9')||((a)>='A' && (a)<='F')||((a)>='a' && (a)<='f'))
-#define Isalnum(a) (((a)>='0' && (a)<='9')||((a)>='A' && (a)<='Z')||((a)>='a' && (a)<='z'))
-#endif
-
-/* Adobe's opentype feature file */
-
-/* ************************************************************************** */
-/* ******************************* Output feat ****************************** */
-/* ************************************************************************** */
-
-/* Do GPOS and GSUB features have to share the same feature statement? */
-
-static void dump_glyphname(FILE *out, SplineChar *sc) {
- if ( sc->parent->cidmaster!=NULL )
- fprintf( out, "\\%d", sc->orig_pos /* That's the CID */ );
- else
- fprintf( out, "\\%s", sc->name );
-}
-
-static void dump_glyphbyname(FILE *out, SplineFont *sf, char *name) {
- SplineChar *sc = SFGetChar(sf,-1,name);
-
- if ( sc==NULL )
- LogError( "No glyph named %s.", name );
- if ( sc->parent->cidmaster==NULL || sc==NULL )
- fprintf( out, "\\%s", name );
- else
- fprintf( out, "\\%s", sc->name );
-}
-
-static void dump_glyphnamelist(FILE *out, SplineFont *sf, char *names) {
- char *pt, *start;
- int ch;
- SplineChar *sc2;
- int len=0;
- char cidbuf[20], *nm;
-
- if ( sf->subfontcnt==0 ) {
- for ( pt=names; ; ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- for ( start=pt; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- if ( pt-start+len+1 >72 ) {
- fprintf( out, "\n\t" );
- len = 8;
- }
- fprintf( out, "%s ", start );
- len += strlen(start)+1;
- *pt = ch;
- }
- } else {
- for ( pt=names; ; ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- for ( start=pt; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- sc2 = SFGetChar(sf,-1,start);
- if ( sc2==NULL ) {
- LogError( "No CID named %s", start);
- nm = start;
- } else {
- sprintf( cidbuf, "\\%d", sc2->orig_pos );
- nm = cidbuf;
- }
- if ( strlen(nm)+len+1 >72 ) {
- fprintf( out, "\n\t" );
- len = 8;
- }
- fprintf( out, "%s ", nm );
- len += strlen(nm)+1;
- *pt = ch;
- }
- }
-}
-
-static char *lookupname(OTLookup *otl) {
- char *pt1, *pt2;
- static char space[32];
-
- if ( otl->tempname != NULL )
-return( otl->tempname );
-
- for ( pt1=otl->lookup_name,pt2=space; *pt1 && pt2<space+31; ++pt1 ) {
- if ( !(*pt1&0x80) && (Isalpha(*pt1) || *pt1=='_' || *pt1=='.' ||
- (pt1!=otl->lookup_name && Isdigit(*pt1))))
- *pt2++ = *pt1;
- }
- *pt2 = '\0';
-return( space );
-}
-
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
-static void dumpdevice(FILE *out,DeviceTable *devtab) {
- int i, any = false;
-
- fprintf( out, "<device " );
- if ( devtab!=NULL && devtab->corrections!=NULL ) {
- for ( i=devtab->first_pixel_size; i<=devtab->last_pixel_size; ++i ) if ( devtab->corrections[i-devtab->first_pixel_size]!=0 ) {
- if ( any )
- putc(',',out);
- else
- any = true;
- fprintf( out, "%d %d", i, devtab->corrections[i-devtab->first_pixel_size]);
- }
- }
- if ( any )
- fprintf( out, ">" );
- else
- fprintf( out, "NULL>" );
-}
-#endif
-
-static void dump_valuerecord(FILE *out, struct vr *vr) {
- fprintf( out, "<%d %d %d %d", vr->xoff, vr->yoff, vr->h_adv_off, vr->v_adv_off );
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( vr->adjust!=NULL ) {
- putc( ' ', out);
- dumpdevice(out,&vr->adjust->xadjust);
- putc( ' ', out);
- dumpdevice(out,&vr->adjust->yadjust);
- putc( ' ', out);
- dumpdevice(out,&vr->adjust->xadv);
- putc( ' ', out);
- dumpdevice(out,&vr->adjust->yadv);
- }
-#endif
- putc('>',out);
-}
-
-static void dump_anchorpoint(FILE *out,AnchorPoint *ap) {
-
- if ( ap==NULL ) {
- fprintf( out, "<anchor NULL>" );
-return;
- }
-
- fprintf( out, "<anchor %g %g", rint(ap->me.x), rint(ap->me.y) );
- if ( ap->has_ttf_pt )
- fprintf( out, " %d", ap->ttf_pt_index );
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- else if ( ap->xadjust.corrections!=NULL || ap->yadjust.corrections!=NULL ) {
- putc(' ',out);
- dumpdevice(out,&ap->xadjust);
- putc(' ',out);
- dumpdevice(out,&ap->yadjust);
- }
-#endif
- putc('>',out);
-}
-
-static void dump_kernclass(FILE *out,SplineFont *sf,struct lookup_subtable *sub) {
- int i,j;
- KernClass *kc = sub->kc;
-
- for ( i=0; i<kc->first_cnt; ++i ) if ( kc->firsts[i]!=NULL ) {
- fprintf( out, " @kc%d_first_%d = [", sub->subtable_offset, i );
- dump_glyphnamelist(out,sf,kc->firsts[i] );
- fprintf( out, "];\n" );
- }
- for ( i=0; i<kc->second_cnt; ++i ) if ( kc->seconds[i]!=NULL ) {
- fprintf( out, " @kc%d_second_%d = [", sub->subtable_offset, i );
- dump_glyphnamelist(out,sf,kc->seconds[i] );
- fprintf( out, "];\n" );
- }
- for ( i=0; i<kc->first_cnt; ++i ) if ( kc->firsts[i]!=NULL ) {
- for ( j=0; j<kc->second_cnt; ++j ) if ( kc->seconds[j]!=NULL ) {
- if ( kc->offsets[i*kc->second_cnt+j]!=0 )
- fprintf( out, " pos @kc%d_first_%d @kc%d_second_%d %d;\n",
- sub->subtable_offset, i,
- sub->subtable_offset, j,
- kc->offsets[i*kc->second_cnt+j]);
- }
- }
-}
-
-static char *nameend_from_class(char *glyphclass) {
- char *pt = glyphclass;
-
- while ( *pt==' ' ) ++pt;
- while ( *pt!=' ' && *pt!='\0' ) ++pt;
-return( pt );
-}
-
-static OTLookup *lookup_in_rule(struct fpst_rule *r,int seq,int *index, int *pos) {
- int i;
- OTLookup *otl;
- /* Suppose there are two lookups which affect the same sequence pos? */
- /* That's legal in otf, but I don't think it can be specified in the */
- /* feature file. It doesn't seem likely to be used so I ignore it */
-
- for ( i=0; i<r->lookup_cnt && seq<r->lookups[i].seq; ++i );
- if ( i>=r->lookup_cnt )
-return( NULL );
- *index = i;
- *pos = seq-r->lookups[i].seq;
- otl = r->lookups[i].lookup;
- if ( seq==r->lookups[i].seq )
-return( otl );
- if ( otl->lookup_type == gsub_ligature )
-return( otl );
- else if ( otl->lookup_type == gpos_pair && *pos==1 )
-return( otl );
-
-return( NULL );
-}
-
-static PST *pst_from_single_lookup(SplineFont *sf, OTLookup *otl, char *name ) {
- SplineChar *sc = SFGetChar(sf,-1,name);
- PST *pst;
-
- if ( sc==NULL )
-return( NULL );
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable!=NULL && pst->subtable->lookup == otl )
-return( pst );
- }
-return( NULL );
-}
-
-static PST *pst_from_pos_pair_lookup(SplineFont *sf, OTLookup *otl, char *name1, char *name2, PST *space ) {
- SplineChar *sc = SFGetChar(sf,-1,name1), *sc2;
- PST *pst;
- int isv;
- KernPair *kp;
-
- if ( sc==NULL )
-return( NULL );
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable!=NULL && pst->subtable->lookup == otl &&
- strcmp(pst->u.pair.paired,name2)==0 )
-return( pst );
- }
-
- sc2 = SFGetChar(sf,-1,name2);
- if ( sc2==NULL )
-return( NULL );
- /* Ok. not saved as a pst. If a kp then build a pst of it */
- for ( isv=0; isv<2; ++isv ) {
- for ( kp= isv ? sc->vkerns : sc->kerns; kp!=NULL; kp=kp->next ) {
- if ( kp->subtable->lookup==otl && kp->sc == sc2 ) {
- memset(space->u.pair.vr,0,2*sizeof(struct vr));
- /* !!! Bug. Lose device tables here */
- if ( isv )
- space->u.pair.vr[0].v_adv_off = kp->off;
- else if ( otl->lookup_flags&pst_r2l )
- space->u.pair.vr[1].h_adv_off = kp->off;
- else
- space->u.pair.vr[0].h_adv_off = kp->off;
-return( space );
- }
- }
- }
-return( NULL );
-}
-
-static PST *pst_from_ligature(SplineFont *sf, OTLookup *otl, char *components ) {
- PST *pst;
- SplineFont *_sf;
- int k,gid;
- SplineChar *sc;
-
- k=0;
- do {
- _sf = sf->subfontcnt==0 ? sf : sf->subfonts[k];
- for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc = _sf->glyphs[gid])!=NULL ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable!=NULL && pst->subtable->lookup == otl &&
- strcmp(pst->u.lig.components,components)==0 ) {
- pst->u.lig.lig = sc;
-return( pst );
- }
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
-return( NULL );
-}
-
-static PST *pst_any_from_otl(SplineFont *sf, OTLookup *otl ) {
- PST *pst;
- SplineFont *_sf;
- int k,gid;
- SplineChar *sc;
-
- k=0;
- do {
- _sf = sf->subfontcnt==0 ? sf : sf->subfonts[k];
- for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc = _sf->glyphs[gid])!=NULL ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable!=NULL && pst->subtable->lookup == otl ) {
- if ( otl->lookup_type == gsub_ligature )
- pst->u.lig.lig = sc;
-return( pst );
- }
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
-return( NULL );
-}
-
-static AnchorPoint *apfind_entry_exit(SplineFont *sf,OTLookup *otl, char *name,
- AnchorPoint **_exit) {
- AnchorPoint *entry = NULL, *exit = NULL;
- AnchorPoint *ap;
- SplineChar *sc = SFGetChar(sf,-1,name);
-
- if ( sc==NULL )
-return( NULL );
- for ( ap = sc->anchor ; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor->subtable->lookup == otl ) {
- if ( ap->type == at_centry )
- entry = ap;
- else if ( ap->type == at_cexit )
- exit = ap;
- }
- }
- *_exit = exit;
-return( entry );
-}
-
-static void dump_contextpstglyphs(FILE *out,SplineFont *sf,
- struct lookup_subtable *sub, struct fpst_rule *r, int in_ignore) {
- int i, j, pos, index;
- OTLookup *otl;
- struct vr pairvr[2];
- PST *pst, space;
- char *start, *pt, *last_start, *last_end;
- int ch, ch2;
-
- space.u.pair.vr = pairvr;
-
- if ( r->u.glyph.back!=NULL ) {
- dump_glyphnamelist(out,sf,r->u.glyph.back );
- putc(' ',out);
- }
- last_start = last_end = NULL;
- for ( pt=r->u.glyph.names; ; ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- for ( start=pt; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- otl = lookup_in_rule(r,i,&index, &pos);
- if ( otl!=NULL ) {
- if ( otl->lookup_type == gpos_cursive )
- fprintf( out, "cursive " );
- else if ( otl->lookup_type == gpos_mark2mark )
- fprintf( out, "mark " );
- }
- dump_glyphbyname(out,sf,start);
- if ( in_ignore )
- putc('\'',out);
- else if ( otl!=NULL ) {
- putc( index&1 ? '"' : '\'', out );
- if ( otl->lookup_type==gpos_single ) {
- pst = pst_from_single_lookup(sf, otl, start);
- if ( pst!=NULL )
- dump_valuerecord(out,&pst->u.pos);
- } else if ( otl->lookup_type==gpos_pair ) {
- if ( pos==1 ) {
- ch2 = *last_end; *last_end = '\0';
- pst = pst_from_pos_pair_lookup(sf,otl,last_start,start,&space);
- *last_end = ch2;
- } else {
- char *next_start, *next_end;
- next_start = pt;
- while ( *next_start==' ' ) ++next_start;
- if ( *next_start!='\0' ) {
- for ( next_end=next_start; *next_end!=' ' && *next_end!='\0'; ++next_end );
- ch2 = *next_end; *next_end = '\0';
- pst = pst_from_pos_pair_lookup(sf,otl,start,next_start,&space);
- *next_end = ch2;
- } else
- pst = NULL;
- }
- if ( pst!=NULL )
- dump_valuerecord(out,&pst->u.pair.vr[pos]);
- } else if ( otl->lookup_type==gpos_cursive ) {
- AnchorPoint *entry, *exit;
- entry = apfind_entry_exit(sf,otl,start,&exit);
- dump_anchorpoint(out,entry);
- putc(' ',out);
- dump_anchorpoint(out,exit);
- putc(' ',out);
- } else if ( otl->lookup_type>gpos_start && otl->ticked )
- fprintf(out, "<lookup %s> ", lookupname(otl) );
- }
- last_start = start; last_end = pt;
- *pt = ch;
- putc(' ',out);
- }
- if ( r->u.glyph.fore!=NULL ) {
- dump_glyphnamelist(out,sf,r->u.glyph.fore );
- putc(' ',out);
- }
- if ( r->lookup_cnt!=0 && sub->lookup->lookup_type<gpos_start ) {
- fprintf( out, " by " );
- for ( i=0; i<r->lookup_cnt; ++i ) {
- otl = r->lookups[i].lookup;
- for ( pt=r->u.glyph.names, j=0; ; ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' || j>=r->lookups[i].seq )
- break;
- while ( *pt!=' ' && *pt!='\0' ) ++pt;
- }
- if ( otl->lookup_type == gsub_single ) {
- pst = pst_from_single_lookup(sf,otl,pt);
- if ( pst!=NULL )
- dump_glyphbyname(out,sf,pst->u.subs.variant );
- } else if ( otl->lookup_type==gsub_ligature ) {
- pst = pst_from_ligature(sf,otl,pt);
- if ( pst!=NULL )
- dump_glyphname(out,pst->u.lig.lig);
- putc( ' ',out );
- } else if ( otl->lookup_type<gpos_start && otl->ticked )
- fprintf(out, "<lookup %s> ", lookupname(otl) );
- }
- }
-}
-
-static void dump_contextpstcoverage(FILE *out,SplineFont *sf,
- struct lookup_subtable *sub, struct fpst_rule *r, int in_ignore) {
- int i, pos, index;
- OTLookup *otl;
- PST *pst, space;
- char *start, *pt, *last_end;
- int ch, ch2;
-
- for ( i=0; i<r->u.coverage.bcnt; ++i ) {
- putc('[',out);
- dump_glyphnamelist(out,sf,r->u.coverage.bcovers[i] );
- fprintf( out, "] ");
- }
- for ( i=0; i<r->u.coverage.ncnt; ++i ) {
- putc('[',out);
- dump_glyphnamelist(out,sf,r->u.coverage.ncovers[i] );
- putc(']',out);
- if ( in_ignore )
- putc('\'',out);
- else {
- otl = lookup_in_rule(r,i,&index, &pos);
- if ( otl!=NULL ) {
- putc( index&1 ? '"' : '\'', out );
- /* Ok, I don't see any way to specify a class of value records */
- /* so just assume all vr will be the same for the class */
- pt = nameend_from_class(r->u.coverage.ncovers[i]);
- ch = *pt; *pt = '\0';
- if ( otl->ticked && otl->lookup_type>=gpos_start )
- fprintf(out, "<lookup %s> ", lookupname(otl) );
- else if ( otl->lookup_type==gpos_single ) {
- pst = pst_from_single_lookup(sf,otl,r->u.coverage.ncovers[i]);
- if ( pst!=NULL )
- dump_valuerecord(out,&pst->u.pos);
- } else if ( otl->lookup_type==gpos_pair ) {
- if ( pos==1 ) {
- last_end = nameend_from_class(r->u.coverage.ncovers[i-1]);
- ch2 = *last_end; *last_end = '\0';
- pst = pst_from_pos_pair_lookup(sf,otl,r->u.coverage.ncovers[i-1],r->u.coverage.ncovers[i],&space);
- *last_end = ch2;
- } else if ( i+1<r->u.coverage.ncnt ) {
- char *next_end;
- next_end = nameend_from_class(r->u.coverage.ncovers[i+1]);
- ch2 = *next_end; *next_end = '\0';
- pst = pst_from_pos_pair_lookup(sf,otl,r->u.coverage.ncovers[i],r->u.coverage.ncovers[i+1],&space);
- *next_end = ch2;
- } else
- pst = NULL;
- if ( pst!=NULL )
- dump_valuerecord(out,&pst->u.pair.vr[pos]);
- }
- *pt = ch;
- }
- }
- putc(' ',out);
- }
- for ( i=0; i<r->u.coverage.fcnt; ++i ) {
- putc('[',out);
- dump_glyphnamelist(out,sf,r->u.coverage.fcovers[i] );
- fprintf( out, "] ");
- }
- if ( r->lookup_cnt!=0 && sub->lookup->lookup_type<gpos_start ) {
- fprintf( out, " by " );
- for ( i=0; i<r->lookup_cnt; ++i ) {
- int len;
- otl = r->lookups[i].lookup;
- if ( otl->ticked )
- fprintf(out, "<lookup %s> ", lookupname(otl) );
- else if ( otl->lookup_type==gsub_single ) {
- len = 40;
- putc('[',out);
- for ( pt=r->u.coverage.ncovers[r->lookups[i].seq]; ; ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- for ( start=pt; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- pst = pst_from_single_lookup(sf,otl,start);
- if ( len+(pst==NULL?4:strlen(pst->u.subs.variant))>80 ) {
- fprintf(out,"\n\t" );
- len = 8;
- }
- if ( pst!=NULL ) {
- dump_glyphbyname(out,sf,pst->u.subs.variant);
- len += strlen(pst->u.subs.variant);
- } else {
- fprintf( out, "NULL" );
- len += 4;
- }
- *pt = ch;
- putc(' ',out);
- ++len;
- }
- putc(']',out);
- } else if ( otl->lookup_type==gsub_ligature ) {
- /* If we get here assume there is only one ligature */
- /* or there is only one combination of input glyphs (all coverage tables contain one glyph) */
- if ( sub->fpst->effectively_by_glyphs ) {
- /* Build up THE combination of input glyphs */
- int len, n;
- char *start;
- for ( n=len=0; n<r->u.coverage.ncnt; ++n )
- len += strlen(r->u.coverage.ncovers[n])+1;
- start = galloc(len+1);
- for ( n=len=0; n<r->u.coverage.ncnt; ++n ) {
- strcpy(start+len,r->u.coverage.ncovers[n]);
- len += strlen(r->u.coverage.ncovers[n]);
- if ( start[len-1]!=' ' )
- start[len++] = ' ';
- }
- if ( len!=0 )
- start[len-1] = '\0';
- pst = pst_from_ligature(sf,otl,start);
- free( start );
- } else
- pst = pst_any_from_otl(sf,otl);
- if ( pst!=NULL )
- dump_glyphname(out,pst->u.lig.lig);
- }
- }
- }
- putc(';',out); putc('\n',out);
-}
-
-static void dump_contextpstclass(FILE *out,SplineFont *sf,
- struct lookup_subtable *sub, struct fpst_rule *r, int in_ignore) {
- FPST *fpst = sub->fpst;
- int i, pos, index;
- OTLookup *otl;
- PST *pst, space;
- char *start, *pt, *last_start, *last_end;
- int ch, ch2;
-
- for ( i=0; i<r->u.class.bcnt; ++i )
- fprintf( out, "@cc%d_back_%d ", sub->subtable_offset, r->u.class.bclasses[i] );
- for ( i=0; i<r->u.class.ncnt; ++i ) {
- fprintf( out, "@cc%d_match_%d", sub->subtable_offset, r->u.class.nclasses[i] );
- if ( in_ignore )
- putc( '\'',out );
- else {
- otl = lookup_in_rule(r,i,&index, &pos);
- if ( otl!=NULL ) {
- putc( index&1 ? '"' : '\'', out );
- /* Ok, I don't see any way to specify a class of value records */
- /* so just assume all vr will be the same for the class */
- start = fpst->nclass[r->u.class.nclasses[i]];
- pt = nameend_from_class(start);
- ch = *pt; *pt = '\0';
- if ( otl->ticked && otl->lookup_type>=gpos_start )
- fprintf(out, "<lookup %s> ", lookupname(otl) );
- else if ( otl->lookup_type==gpos_single ) {
- pst = pst_from_single_lookup(sf,otl,start);
- if ( pst!=NULL )
- dump_valuerecord(out,&pst->u.pos);
- } else if ( otl->lookup_type==gpos_pair ) {
- if ( pos==1 ) {
- last_start = fpst->nclass[r->u.class.nclasses[i-1]];
- last_end = nameend_from_class(last_start);
- ch2 = *last_end; *last_end = '\0';
- pst = pst_from_pos_pair_lookup(sf,otl,last_start,start,&space);
- *last_end = ch2;
- } else if ( i+1<r->u.coverage.ncnt ) {
- char *next_start, *next_end;
- next_start = fpst->nclass[r->u.class.nclasses[i+1]];
- next_end = nameend_from_class(next_start);
- ch2 = *next_end; *next_end = '\0';
- pst = pst_from_pos_pair_lookup(sf,otl,start,next_start,&space);
- *next_end = ch2;
- } else
- pst = NULL;
- if ( pst!=NULL )
- dump_valuerecord(out,&pst->u.pair.vr[pos]);
- }
- *pt = ch;
- }
- }
- putc(' ',out);
- }
- for ( i=0; i<r->u.class.fcnt; ++i )
- fprintf( out, "@cc%d_ahead_%d ", sub->subtable_offset, r->u.class.fclasses[i] );
- if ( r->lookup_cnt!=0 && sub->lookup->lookup_type<gpos_start ) {
- fprintf( out, " by " );
- for ( i=0; i<r->lookup_cnt; ++i ) {
- otl = r->lookups[i].lookup;
- if ( otl->ticked )
- fprintf(out, "<lookup %s> ", lookupname(otl) );
- else if ( otl->lookup_type==gsub_single ) {
- putc('[',out);
- for ( pt=fpst->nclass[r->u.class.nclasses[r->lookups[i].seq]]; ; ) {
- while ( *pt==' ' ) ++pt;
- if ( *pt=='\0' )
- break;
- for ( start=pt; *pt!=' ' && *pt!='\0'; ++pt );
- ch = *pt; *pt = '\0';
- pst = pst_from_single_lookup(sf,otl,start);
- if ( pst!=NULL )
- dump_glyphbyname(out,sf,pst->u.subs.variant);
- else
- fprintf( out, "NULL" );
- *pt = ch;
- putc(' ',out);
- }
- putc(']',out);
- } else if ( otl->lookup_type==gsub_ligature ) {
- /* I don't think it is possible to do this correctly */
- /* adobe doesn't say how to order glyphs for [f longs]' [i l]' */
- /* so just assume there is only one ligature */
- pst = pst_any_from_otl(sf,otl);
- if ( pst!=NULL )
- dump_glyphname(out,pst->u.lig.lig);
- }
- putc( ' ',out );
- }
- }
-}
-
-static void dump_contextpst(FILE *out,SplineFont *sf,struct lookup_subtable *sub) {
- FPST *fpst = sub->fpst;
- int i,j,k;
-
- if ( fpst->format==pst_reversecoverage ) {
- IError( "I can find no documentation on how to describe reverse context chaining lookups. Lookup %s will be skipped.",
- sub->lookup->lookup_name );
-return;
- }
- if ( fpst->format==pst_class ) {
- if ( fpst->nclass!=NULL ) {
- for ( i=0; i<fpst->nccnt; ++i ) if ( fpst->nclass[i]!=NULL ) {
- fprintf( out, " @cc%d_match_%d = [", sub->subtable_offset, i );
- dump_glyphnamelist(out,sf,fpst->nclass[i] );
- fprintf( out, "];\n" );
- }
- }
- if ( fpst->bclass!=NULL ) {
- for ( i=0; i<fpst->bccnt; ++i ) if ( fpst->bclass[i]!=NULL ) {
- fprintf( out, " @cc%d_back_%d = [", sub->subtable_offset, i );
- dump_glyphnamelist(out,sf,fpst->bclass[i] );
- fprintf( out, "];\n" );
- }
- }
- if ( fpst->fclass!=NULL ) {
- for ( i=0; i<fpst->fccnt; ++i ) if ( fpst->fclass[i]!=NULL ) {
- fprintf( out, " @cc%d_ahead_%d = [", sub->subtable_offset, i );
- dump_glyphnamelist(out,sf,fpst->fclass[i] );
- fprintf( out, "];\n" );
- }
- }
- }
- for ( j=0; j<fpst->rule_cnt; ++j ) {
- struct fpst_rule *r = &fpst->rules[j];
- for ( i=0; i<r->lookup_cnt; ++i ) for ( k=i+1; k<r->lookup_cnt; ++k ) {
- if ( r->lookups[i].seq > r->lookups[k].seq ) {
- int s = r->lookups[i].seq;
- OTLookup *otl = r->lookups[i].lookup;
- r->lookups[i].seq = r->lookups[k].seq;
- r->lookups[k].seq = s;
- r->lookups[i].lookup = r->lookups[k].lookup;
- r->lookups[k].lookup = otl;
- }
- }
- fprintf( out, r->lookup_cnt==0 ? " ignore sub " : " sub " );
- if ( fpst->format==pst_class ) {
- dump_contextpstclass(out,sf,sub,r,true);
- } else if ( fpst->format==pst_glyphs ) {
- dump_contextpstglyphs(out,sf,sub,r,true);
- } else {
- dump_contextpstcoverage(out,sf,sub,r,true);
- }
- }
-}
-
-static void dump_anchors(FILE *out,SplineFont *sf,struct lookup_subtable *sub) {
- int i, j, k, l;
- SplineFont *_sf;
- SplineChar *sc;
- AnchorClass *ac;
- AnchorPoint *ap, *ap_entry, *ap_exit;
-
- for ( ac = sf->anchor; ac!=NULL; ac=ac->next ) if ( ac->subtable==sub ) {
- if ( sub->lookup->lookup_type==gpos_cursive ) {
- k=0;
- do {
- _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
- for ( i=0; i<_sf->glyphcnt; ++i ) if ( (sc=_sf->glyphs[i])!=NULL ) {
- ap_entry = ap_exit = NULL;
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) if ( ap->anchor==ac ) {
- if ( ap->type == at_centry )
- ap_entry = ap;
- else if ( ap->type == at_cexit )
- ap_exit = ap;
- }
- if ( ap_entry!=NULL || ap_exit!=NULL ) {
- fprintf( out, " pos cursive " );
- dump_glyphname(out,sc);
- putc(' ',out);
- dump_anchorpoint(out,ap_entry);
- putc(' ',out);
- dump_anchorpoint(out,ap_exit);
- putc(';',out);
- putc('\n',out);
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- } else {
- struct amarks { SplineChar *sc; AnchorPoint *ap; } *marks = NULL;
- int cnt, max;
- cnt = max = 0;
- k=0;
- do {
- _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
- for ( i=0; i<_sf->glyphcnt; ++i ) if ( (sc=_sf->glyphs[i])!=NULL ) {
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor==ac && ap->type==at_mark ) {
- if ( cnt>=max )
- marks = grealloc(marks,(max+=20)*sizeof(struct amarks));
- marks[cnt].sc = sc;
- marks[cnt].ap = ap;
- fprintf( out, " mark ");
- dump_glyphname(out,sc);
- putc(' ',out);
- dump_anchorpoint(out,ap);
- fprintf( out, ";\n");
- ++cnt;
- break;
- }
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- if ( cnt==0 )
- continue; /* No marks? Nothing to be done */
- if ( sub->lookup->lookup_type!=gpos_mark2ligature ) {
- do {
- _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
- for ( i=0; i<_sf->glyphcnt; ++i ) if ( (sc=_sf->glyphs[i])!=NULL ) {
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor==ac && ap->type!=at_mark ) {
- fprintf( out, " pos ");
- if ( sub->lookup->lookup_type == gpos_mark2mark )
- fprintf( out, "mark " );
- dump_glyphname(out,sc);
- putc(' ',out);
- dump_anchorpoint(out,ap);
- fprintf( out, " mark [" );
- for ( j=0; j<cnt; ++j ) {
- dump_glyphname(out,marks[j].sc);
- putc(' ',out);
- }
- fprintf(out,"];\n" );
- }
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- } else {
- struct amarks *lig=NULL;
- int lcnt, lmax=0, ligmax;
- do {
- _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
- for ( i=0; i<_sf->glyphcnt; ++i ) if ( (sc=_sf->glyphs[i])!=NULL ) {
- lcnt = 0; ligmax=1;
- for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
- if ( ap->anchor==ac && ap->type!=at_mark ) {
- if ( lcnt>=lmax )
- lig = grealloc(lig,(lmax+=20)*sizeof(struct amarks));
- lig[lcnt].sc = sc;
- lig[lcnt].ap = ap;
- if ( ap->lig_index>ligmax )
- ligmax = ap->lig_index;
- ++lcnt;
- }
- }
- if ( lcnt>0 ) {
- fprintf( out, " pos " );
- dump_glyphname(out,sc);
- for ( j=0; j<=ligmax; ++j ) {
- putc(' ',out );
- for ( l=0; l<lcnt; ++l ) {
- if ( lig[l].ap->lig_index==ligmax ) {
- dump_anchorpoint(out,lig[l].ap);
- break;
- }
- }
- if ( l==lcnt )
- dump_anchorpoint(out,NULL);
- }
- fprintf( out, " mark [" );
- for ( j=0; j<cnt; ++j ) {
- dump_glyphname(out,marks[j].sc);
- putc(' ',out);
- }
- fprintf(out,"];\n" );
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- free(lig);
- }
- free(marks);
- }
- }
-}
-
-static void number_subtables(SplineFont *sf) {
- OTLookup *otl;
- struct lookup_subtable *sub;
- int isgpos, cnt;
-
- cnt = 0;
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl = otl->next ) {
- for ( sub = otl->subtables; sub!=NULL; sub=sub->next )
- sub->subtable_offset = cnt++;
- }
- }
-}
-
-static int fea_bad_contextual_nestedlookup(SplineFont *sf,FPST *fpst, OTLookup *nested) {
- int gid, k;
- SplineFont *_sf;
- SplineChar *sc;
- PST *pst, *found;
- /* non-cursive anchors can't currently be expressed in contextuals */
- /* Nor can other contextuals */
- /* Nor can alternate/multiple substitutions */
- /* If we are class based or coverage table based (and interesting classes */
- /* contain more than one glyph name) then we can't express single_pos, */
- /* kerning, ligatures, cursive anchors (unless everything in the lookup */
- /* results in the same transformation) */
-
- switch ( nested->lookup_type ) {
- case gsub_single:
-return( false ); /* This is the one thing that can always be expressed */
- case gsub_multiple:
- case gsub_alternate:
- case gsub_context:
- case gsub_contextchain:
- case gsub_reversecchain:
- case gpos_mark2base:
- case gpos_mark2ligature:
- case gpos_mark2mark:
- case gpos_contextchain:
- case gpos_context:
-return( true ); /* These can never be expressed */
- case gpos_cursive:
- case gpos_pair:
-return( fpst->format!=pst_glyphs /* && !fpst->effectively_by_glyphs*/ );
- case gsub_ligature:
- case gpos_single:
- if ( fpst->format==pst_glyphs || fpst->effectively_by_glyphs )
-return( false );
- /* One can conceive of a fraction lookup */
- /* [one one.proportion] [slash fraction] [two two.lining] => onehalf */
- /* where all inputs go to one output. That can be expressed */
- /* One can also conceive of a positioning lookup (subscript->superscript) */
- /* where all value records are the same */
- found = NULL;
- k=0;
- do {
- _sf = sf->subfontcnt==0 ? sf : sf->subfonts[k];
- for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc = _sf->glyphs[gid])!=NULL ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->subtable!=NULL && pst->subtable->lookup==nested ) {
- if ( found==NULL ) {
- found = pst;
- break;
- } else if ( nested->lookup_type==gsub_ligature )
-return( true ); /* Different glyphs */
- else if ( found->u.pos.xoff!=pst->u.pos.xoff ||
- found->u.pos.yoff!=pst->u.pos.yoff ||
- found->u.pos.h_adv_off!=pst->u.pos.h_adv_off ||
- found->u.pos.v_adv_off!=pst->u.pos.v_adv_off )
-return( true );
- else
- break;
- }
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- if ( found==NULL )
-return( true );
-return( false );
- default:
-return( true );
- }
-}
-
-static void dump_lookup(FILE *out, SplineFont *sf, OTLookup *otl);
-
-static void dump_needednestedlookups(FILE *out, SplineFont *sf, OTLookup *otl) {
- struct lookup_subtable *sub;
- int r, s, n;
- /* So we cheat, and extend the fea format to allow us to specify a lookup */
- /* in contextuals */
-
- for ( sub = otl->subtables; sub!=NULL; sub=sub->next ) {
- FPST *fpst = sub->fpst;
- fpst->effectively_by_glyphs = false;
- if ( fpst->format==pst_coverage ) {
- fpst->effectively_by_glyphs = true;
- for ( r=0; r<fpst->rule_cnt; ++r ) {
- for ( n=0; n<fpst->rules[r].u.coverage.ncnt; ++n ) {
- if ( strchr(fpst->rules[r].u.coverage.ncovers[n],' ')!=NULL )
- fpst->effectively_by_glyphs = false;
- break;
- }
- }
- }
- for ( r=0; r<fpst->rule_cnt; ++r ) {
- for ( s=0; s<fpst->rules[r].lookup_cnt; ++s ) {
- OTLookup *nested = fpst->rules[r].lookups[s].lookup;
- if ( nested!=NULL && nested->features==NULL && !nested->ticked &&
- fea_bad_contextual_nestedlookup(sf,fpst,nested))
- dump_lookup(out,sf,nested);
- }
- }
- }
-}
-
-static void dump_lookup(FILE *out, SplineFont *sf, OTLookup *otl) {
- struct lookup_subtable *sub;
- static char *flagnames[] = { "RightToLeft", "IgnoreBaseGlyphs", "IgnoreLigatures", "IgnoreMarks", NULL };
- int i, k, first;
- SplineFont *_sf;
- SplineChar *sc;
- PST *pst;
- int isv;
- KernPair *kp;
-
- if ( otl->lookup_type == morx_indic || otl->lookup_type==morx_context ||
- otl->lookup_type==morx_insert || otl->lookup_type==kern_statemachine )
-return; /* No support for apple "lookups" */
-
- otl->ticked = true;
-
- if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ||
- otl->lookup_type==gpos_context || otl->lookup_type==gpos_contextchain )
- dump_needednestedlookups(out,sf,otl);
-
- if ( sf->cidmaster ) sf = sf->cidmaster;
- number_subtables(sf);
-
- fprintf( out, "\nlookup %s {\n", lookupname(otl) );
- if ( otl->lookup_flags==0 || otl->lookup_flags>15 )
- fprintf( out, " lookupflag %d;\n", otl->lookup_flags );
- else {
- fprintf( out, " lookupflag" );
- first = true;
- for ( i=0; i<4; ++i ) if ( otl->lookup_flags&(1<<i)) {
- if ( !first )
- putc(',',out);
- else
- first = false;
- fprintf( out, " %s", flagnames[i] );
- }
- putc(';',out);
- putc('\n',out);
- }
- for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
- if ( sub!=otl->subtables )
- fprintf( out, " subtable;\n" );
- if ( sub->kc!=NULL )
- dump_kernclass(out,sf,sub);
- else if ( sub->fpst!=NULL )
- dump_contextpst(out,sf,sub);
- else if ( sub->anchor_classes )
- dump_anchors(out,sf,sub);
- else {
- k=0;
- do {
- _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
- for ( i=0; i<_sf->glyphcnt; ++i ) if ( (sc=_sf->glyphs[i])!=NULL ) {
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) if ( pst->subtable==sub ) {
- switch ( otl->lookup_type ) {
- case gsub_single:
- case gsub_multiple:
- fprintf( out, " sub " );
- dump_glyphname(out,sc);
- fprintf( out, " by " );
- dump_glyphnamelist(out,sf,pst->u.subs.variant );
- fprintf( out,";\n" );
- break;
- case gsub_alternate:
- fprintf( out, " sub " );
- dump_glyphname(out,sc);
- fprintf( out, " from [" );
- dump_glyphnamelist(out,sf,pst->u.alt.components );
- fprintf( out,"];\n" );
- break;
- case gsub_ligature:
- fprintf( out, " sub " );
- dump_glyphnamelist(out,sf,pst->u.lig.components );
- fprintf( out, " by " );
- dump_glyphname(out,sc);
- fprintf( out,";\n" );
- break;
- case gpos_single:
- fprintf( out, " pos " );
- dump_glyphname(out,sc);
- putc(' ',out);
- dump_valuerecord(out,&pst->u.pos);
- fprintf( out,";\n" );
- break;
- case gpos_pair:
- fprintf( out, " pos " );
- dump_glyphname(out,sc);
- putc(' ',out);
- dump_valuerecord(out,&pst->u.pair.vr[0]);
- putc(' ',out);
- dump_glyphnamelist(out,sf,pst->u.pair.paired );
- putc(' ',out);
- dump_valuerecord(out,&pst->u.pair.vr[0]);
- fprintf( out,";\n" );
- break;
- default:
- /* Eh? How'd we get here? An anchor class with */
- /* no anchors perhaps? */
- break;
- }
- }
- for ( isv=0; isv<2; ++isv ) {
- for ( kp=isv ? sc->vkerns : sc->kerns; kp!=NULL; kp=kp->next ) if ( kp->subtable==sub ) {
- fprintf( out, " pos " );
- dump_glyphname(out,sc);
- putc(' ',out);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( kp->adjust!=NULL ) {
- /* If we have a device table then we must use the long */
- /* format */
- if ( isv ) {
- fprintf( out," < 0 0 0 %d <device NULL> <device NULL> <device NULL> ",
- kp->off );
- dumpdevice(out,kp->adjust);
- fprintf( out, " > " );
- dump_glyphname(out,kp->sc);
- fprintf( out, " < 0 0 0 0 >;\n" );
- } else if ( otl->lookup_flags&pst_r2l ) {
- fprintf( out, " < 0 0 0 0 > " );
- dump_glyphname(out,kp->sc);
- fprintf( out," < 0 0 %d 0 <device NULL> <device NULL> ",
- kp->off );
- dumpdevice(out,kp->adjust);
- fprintf( out, " <device NULL>>;\n" );
- } else {
- fprintf( out," < 0 0 %d 0 <device NULL> <device NULL> ",
- kp->off );
- dumpdevice(out,kp->adjust);
- fprintf( out, " <device NULL>> " );
- dump_glyphname(out,kp->sc);
- fprintf( out, " < 0 0 0 0 >;\n" );
- }
- } else
-#endif
- if ( otl->lookup_flags&pst_r2l ) {
- fprintf( out, " < 0 0 0 0 > " );
- dump_glyphname(out,kp->sc);
- fprintf( out," < 0 0 %d 0 >;\n", kp->off );
- } else {
- dump_glyphname(out,kp->sc);
- putc(' ',out);
- fprintf( out, "%d;\n", kp->off );
- }
- }
- } /* End isv/kp loops */
- }
- ++k;
- } while ( k<sf->subfontcnt );
- }
- } /* End subtables */
- fprintf( out, "} %s;\n", lookupname(otl) );
-}
-
-#ifndef LUA_FF_LIB
-static void untick_lookups(SplineFont *sf) {
- OTLookup *otl;
- int isgpos;
-
- for ( isgpos=0; isgpos<2; ++isgpos )
- for ( otl= isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next )
- otl->ticked = false;
-}
-#endif
-
-void FeatDumpOneLookup(FILE *out,SplineFont *sf, OTLookup *otl) {
-#ifndef LUA_FF_LIB
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
- int l;
-
- untick_lookups(sf);
-
- dump_lookup(out,sf,otl);
-
- for ( fl = otl->features; fl!=NULL; fl=fl->next ) {
- fprintf( out, "\nfeature %s%c%c%c%c {\n",
- fl->featuretag==CHR('m','a','r','k') ? "\\" : "",
- fl->featuretag>>24, fl->featuretag>16, fl->featuretag>>8, fl->featuretag );
- for ( sl = fl->scripts; sl!=NULL; sl=sl->next ) {
- fprintf( out, " script %c%c%c%c;\n",
- sl->script>>24, sl->script>16, sl->script>>8, sl->script );
- for ( l=0; l<sl->lang_cnt; ++l ) {
- uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
- fprintf( out, " language %c%c%c%c %s;\n",
- lang>>24, lang>16, lang>>8, lang,
- lang!=DEFAULT_LANG ? "exclude_dflt" : "" );
- fprintf( out, " lookup %s;\n", lookupname(otl));
- }
- }
- fprintf( out, "\n} %s%c%c%c%c;\n",
- fl->featuretag==CHR('m','a','r','k') ? "\\" : "",
- fl->featuretag>>24, fl->featuretag>16, fl->featuretag>>8, fl->featuretag );
- }
-#endif
-}
-
-#ifndef LUA_FF_LIB
-static void dump_gdef(FILE *out,SplineFont *sf) {
- PST *pst;
- int i,gid,j,k,l, lcnt, needsclass;
- SplineChar *sc;
- SplineFont *_sf;
- struct lglyphs { SplineChar *sc; PST *pst; } *glyphs;
- static char *clsnames[] = { "@GDEF_Simple", "@GDEF_Ligature", "@GDEF_Mark", "@GDEF_Component" };
- _sf = NULL;
- glyphs = NULL;
- for ( l=0; l<2; ++l ) {
- lcnt = 0;
- needsclass = false;
- k=0;
- do {
- _sf = sf->subfontcnt==0 ? sf : _sf;
- for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc=_sf->glyphs[gid])!=NULL ) {
- if ( sc->glyph_class!=0 || gdefclass(sc)!=1 )
- needsclass = true;
- for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
- if ( pst->type == pst_lcaret ) {
- for ( j=pst->u.lcaret.cnt-1; j>=0; --j )
- if ( pst->u.lcaret.carets[j]!=0 )
- break;
- if ( j!=-1 )
- break;
- }
- }
- if ( pst!=NULL ) {
- if ( glyphs!=NULL ) { glyphs[lcnt].sc = sc; glyphs[lcnt].pst = pst; }
- ++lcnt;
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- if ( lcnt==0 )
- break;
- if ( glyphs!=NULL )
- break;
- glyphs = galloc((lcnt+1)*sizeof(struct lglyphs));
- glyphs[lcnt].sc = NULL;
- }
-
- if ( !needsclass && lcnt==0 /* && sf->mark_class_cnt==0*/ )
-return; /* No anchor positioning, no ligature carets */
-
- if ( needsclass ) {
- int len;
- putc('\n',out);
- /* Class definitions must go outside the table itself. Stupid */
- for ( i=0; i<4; ++i ) {
- fprintf( out, "%s = [", clsnames[i] );
- len = strlen(clsnames[i])+8;
- k=0;
- do {
- _sf = sf->subfontcnt==0 ? sf : _sf;
- for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc=_sf->glyphs[gid])!=NULL ) {
- if ( sc->glyph_class==i+1 || (sc->glyph_class==0 && gdefclass(sc)==i+1 )) {
- if ( len+strlen(sc->name)+1 >80 ) {
- putc('\n',out); putc('\t',out);
- len = 8;
- }
- dump_glyphname(out,sc);
- putc(' ',out);
- len += strlen(sc->name)+1;
- }
- }
- ++k;
- } while ( k<sf->subfontcnt );
- fprintf( out, "];\n");
- }
- }
- fprintf( out, "\ntable GDEF {\n" );
- if ( needsclass ) {
- fprintf( out, " GlyphClassDef %s %s %s %s;\n\n",
- clsnames[0], clsnames[1], clsnames[2], clsnames[3]);
- }
-
- for ( i=0; i<lcnt; ++i ) {
- PST *pst = glyphs[i].pst;
- fprintf( out, " LigatureCaret " );
- dump_glyphname(out,glyphs[i].sc);
- for ( k=0; k<pst->u.lcaret.cnt; ++k ) {
- fprintf( out, " <caret %d>", pst->u.lcaret.carets[k]);
- }
- fprintf( out, ";\n" );
- }
- free( glyphs );
-
- /* no way to specify mark classes */
-
- fprintf( out, "} GDEF;\n\n" );
-}
-
-static void dump_gsubgpos(FILE *out, SplineFont *sf) {
- int isgpos;
- int i,l,s, subl;
- OTLookup *otl;
- FeatureScriptLangList *fl;
- struct scriptlanglist *sl;
-
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- uint32 *feats = SFFeaturesInScriptLang(sf,isgpos,0xffffffff,0xffffffff);
- if ( feats[0]!=0 ) {
- uint32 *scripts = SFScriptsInLookups(sf,isgpos);
- fprintf( out, "\n# %s \n\n", isgpos ? "GPOS" : "GSUB" );
- for ( otl= isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next )
- if ( otl->features!=NULL ) /* Nested lookups will be output with the lookups which invoke them */
- dump_lookup( out, sf, otl );
- for ( i=0; feats[i]!=0; ++i ) {
- fprintf( out, "\nfeature %s%c%c%c%c {\n",
- feats[i]==CHR('m','a','r','k') ? "\\" : "",
- feats[i]>>24, feats[i]>>16, feats[i]>>8, feats[i] );
- if ( feats[i]==CHR('s','i','z','e') ) {
- struct otfname *nm;
- fprintf( out, " parameters %.1f", sf->design_size/10.0 );
- if ( sf->fontstyle_id!=0 ) {
- fprintf( out, " %d %.1f %.1f;\n",
- sf->fontstyle_id,
- sf->design_range_bottom/10.0, sf->design_range_top/10.0 );
- for ( nm = sf->fontstyle_name; nm!=NULL; nm=nm->next ) {
- char *pt;
- fprintf( out, " sizemenuname 3 1 0x%x \"", nm->lang );
- for ( pt = nm->name; ; ) {
- int ch = utf8_ildb((const char **) &pt);
- if ( ch=='\0' )
- break;
- if ( ch>=' ' && ch<=0x7f && ch!='"' && ch!='\\' )
- putc(ch,out);
- else
- fprintf( out, "\\%04x", ch );
- }
- fprintf( out, "\";\n" );
- }
- } else
- fprintf( out, " 0 0 0;\n" );
- } else for ( s=0; scripts[s]!=0; ++s ) {
- uint32 *langs = SFLangsInScript(sf,isgpos,scripts[s]);
- int firsts = true;
- for ( l=0; langs[l]!=0; ++l ) {
- int first = true;
- for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
- for ( fl=otl->features; fl!=NULL; fl=fl->next ) if ( fl->featuretag==feats[i] ) {
- for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) if ( sl->script==scripts[s] ) {
- for ( subl=0; subl<sl->lang_cnt; ++subl ) {
- uint32 lang = subl<MAX_LANG ? sl->langs[subl] : sl->morelangs[subl-MAX_LANG];
- if ( lang==langs[l] )
- goto found;
- }
- }
- }
- found:
- if ( fl!=NULL ) {
- if ( firsts ) {
- fprintf( out, "\n script %c%c%c%c;\n",
- scripts[s]>>24, scripts[s]>>16, scripts[s]>>8, scripts[s] );
- firsts = false;
- }
- if ( first ) {
- fprintf( out, " language %c%c%c%c %s;\n",
- langs[l]>>24, langs[l]>>16, langs[l]>>8, langs[l],
- langs[l]!=DEFAULT_LANG ? "exclude_dflt" : "" );
- first = false;
- }
- fprintf( out, " lookup %s;\n", lookupname(otl));
- }
- }
- }
- free(langs);
- }
- fprintf( out, "} %s%c%c%c%c;\n",
- feats[i]==CHR('m','a','r','k') ? "\\" : "",
- feats[i]>>24, feats[i]>>16, feats[i]>>8, feats[i] );
- }
- free(scripts);
- }
- free(feats);
- }
-}
-
-/* Sadly the lookup names I generate are often not distinguishable in the */
-/* first 31 characters. So provide a fall back mechanism if we get a name */
-/* collision */
-static void preparenames(SplineFont *sf) {
- int isgpos, cnt, try, i;
- OTLookup *otl;
- char **names, *name;
- char namebuf[32], featbuf[8], scriptbuf[8], *feat, *script;
- struct scriptlanglist *sl;
-
- cnt = 0;
- for ( isgpos=0; isgpos<2; ++isgpos )
- for ( otl=isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next )
- ++cnt;
- if ( cnt==0 )
-return;
- names = galloc(cnt*sizeof(char *));
- featbuf[4] = scriptbuf[4] = 0;
- cnt = 0;
- for ( isgpos=0; isgpos<2; ++isgpos ) {
- for ( otl=isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
- name = lookupname(otl);
- for ( try=0; ; ++try ) {
- for ( i=0; i<cnt; ++i )
- if ( strcmp(name,names[i])==0 )
- break;
- if ( i==cnt ) {
- /* It's a unique name, use it */
- otl->tempname = names[cnt++] = copy(name);
- break;
- }
-
- feat = ""; script = "";
- if ( otl->features!=NULL ) {
- featbuf[0] = otl->features->featuretag>>24;
- featbuf[1] = otl->features->featuretag>>16;
- featbuf[2] = otl->features->featuretag>>8;
- featbuf[3] = otl->features->featuretag&0xff;
- feat = featbuf;
- for ( sl=otl->features->scripts; sl!=NULL; sl=sl->next ) {
- if ( sl->script!=DEFAULT_SCRIPT ) {
- scriptbuf[0] = sl->script>>24;
- scriptbuf[1] = sl->script>>16;
- scriptbuf[2] = sl->script>>8;
- scriptbuf[3] = sl->script&0xff;
- script = scriptbuf;
- break;
- }
- }
- }
- sprintf( namebuf, "%s_%s_%s%s_%d", isgpos ? "pos" : "sub",
- otl->lookup_type== gsub_single ? "single" :
- otl->lookup_type== gsub_multiple ? "mult" :
- otl->lookup_type== gsub_alternate ? "alt" :
- otl->lookup_type== gsub_ligature ? "ligature" :
- otl->lookup_type== gsub_context ? "context" :
- otl->lookup_type== gsub_contextchain ? "chain" :
- otl->lookup_type== gsub_reversecchain ? "reversecc" :
- otl->lookup_type== gpos_single ? "single" :
- otl->lookup_type== gpos_pair ? "pair" :
- otl->lookup_type== gpos_cursive ? "cursive" :
- otl->lookup_type== gpos_mark2base ? "mark2base" :
- otl->lookup_type== gpos_mark2ligature ? "mark2liga" :
- otl->lookup_type== gpos_mark2mark ? "mark2mark" :
- otl->lookup_type== gpos_context ? "context" :
- otl->lookup_type== gpos_contextchain ? "chain" :
- "unknown",
- feat, script, try++ );
- name = namebuf;
- }
- }
- }
- free(names);
-}
-
-static void cleanupnames(SplineFont *sf) {
- int isgpos;
- OTLookup *otl;
-
- for ( isgpos=0; isgpos<2; ++isgpos )
- for ( otl=isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
- free( otl->tempname );
- otl->tempname = NULL;
- }
-}
-#endif
-
-void FeatDumpFontLookups(FILE *out,SplineFont *sf) {
-#ifndef LUA_FF_LIB
- if ( sf->cidmaster!=NULL ) sf=sf->cidmaster;
-
- untick_lookups(sf);
- preparenames(sf);
- dump_gsubgpos(out,sf);
- dump_gdef(out,sf);
- cleanupnames(sf);
-#endif
-}
/* ************************************************************************** */
@@ -1528,17 +107,6 @@ static int strcmpD(const void *_str1, const void *_str2) {
return( strcmp(str1,str2));
}
-/* Ok, somes strings overlap so can't use normal strcpy */
-static char *mystrcpy(char *str1, const char *str2) {
- int ch;
- char *dest = str1;
-
- while ( (ch = *str2++)!='\0' )
- *str1++ = ch;
- *str1 = '\0';
-return( dest );
-}
-
/* Order glyph classes just so we can do a simple string compare to check for */
/* class match. So the order doesn't really matter, just so it is consistent */
static char *fea_canonicalClassOrder(char *class) {
@@ -1586,70 +154,96 @@ static int fea_classesIntersect(char *class1, char *class2) {
int ch1, ch2;
for ( pt1=class1 ; ; ) {
- while ( *pt1==' ' ) ++pt1;
- if ( *pt1=='\0' )
-return( 0 );
- for ( start1 = pt1; *pt1!=' ' && *pt1!='\0'; ++pt1 );
- ch1 = *pt1; *pt1 = '\0';
- for ( pt2=class2 ; ; ) {
- while ( *pt2==' ' ) ++pt2;
- if ( *pt2=='\0' )
- break;
- for ( start2 = pt2; *pt2!=' ' && *pt2!='\0'; ++pt2 );
- ch2 = *pt2; *pt2 = '\0';
- if ( strcmp(start1,start2)==0 ) {
- *pt2 = ch2; *pt1 = ch1;
-return( 1 );
- }
- *pt2 = ch2;
- }
- *pt1 = ch1;
+ while ( *pt1==' ' ) ++pt1;
+ if ( *pt1=='\0' )
+ return( 0 );
+ for ( start1 = pt1; *pt1!=' ' && *pt1!='\0'; ++pt1 );
+ ch1 = *pt1; *pt1 = '\0';
+ for ( pt2=class2 ; ; ) {
+ while ( *pt2==' ' ) ++pt2;
+ if ( *pt2=='\0' )
+ break;
+ for ( start2 = pt2; *pt2!=' ' && *pt2!='\0'; ++pt2 );
+ ch2 = *pt2; *pt2 = '\0';
+ if ( strcmp(start1,start2)==0 ) {
+ *pt2 = ch2; *pt1 = ch1;
+ return( 1 );
+ }
+ *pt2 = ch2;
+ }
+ *pt1 = ch1;
}
}
+
+#define SKIP_SPACES(s, i) \
+ do { \
+ while ((s)[i] == ' ') \
+ i++; \
+ } \
+ while (0)
+
+#define FIND_SPACE(s, i) \
+ do { \
+ while ((s)[i] != ' ' && (s)[i] != '\0') \
+ i++; \
+ } \
+ while (0)
+
+
static char *fea_classesSplit(char *class1, char *class2) {
- char *pt1, *start1, *pt2, *start2;
- int ch1, ch2;
+ char *intersection;
int len = strlen(class1), len2 = strlen(class2);
- char *intersection, *ipt;
+ int ix;
+ int i, j, i_end, j_end;
+ int length;
+ int match_found;
if ( len2>len ) len = len2;
- intersection = ipt = galloc(len2+1);
-
- for ( pt1=class1 ; ; ) {
- while ( *pt1==' ' ) ++pt1;
- if ( *pt1=='\0' )
- break;
- for ( start1 = pt1; *pt1!=' ' && *pt1!='\0'; ++pt1 );
- ch1 = *pt1; *pt1 = '\0';
- for ( pt2=class2 ; ; ) {
- while ( *pt2==' ' ) ++pt2;
- if ( *pt2=='\0' )
- break;
- for ( start2 = pt2; *pt2!=' ' && *pt2!='\0'; ++pt2 );
- ch2 = *pt2; *pt2 = '\0';
- if ( strcmp(start1,start2)==0 ) {
- /* Here's a glyph name in both classes. Remove it from each */
- /* and add to the new intersection class */
- strcpy(ipt,start1);
- ipt += strlen(ipt);
- *ipt++ = ' ';
- *pt2 = ch2; *pt1 = ch1;
- while ( *pt2==' ' ) ++pt2;
- while ( *pt1==' ' ) ++pt1;
- mystrcpy(start1,pt1); ch1 = *pt1;
- mystrcpy(start2,pt2);
- break;
- }
- *pt2 = ch2;
- }
- *pt1 = ch1;
- }
- if ( ipt!=intersection )
- ipt[-1] = '\0';
- else
- *intersection = '\0'; /* Should never happen (we only call this if there is one) */
-return( intersection );
+ intersection = galloc(len+1);
+ ix = 0;
+
+ i = 0;
+ SKIP_SPACES(class1, i);
+ while (class1[i] != '\0') {
+ i_end = i;
+ FIND_SPACE(class1, i_end);
+
+ length = i_end - i;
+
+ match_found = 0;
+ j = 0;
+ SKIP_SPACES(class2, j);
+ while (!match_found && class2[j] != '\0') {
+ j_end = j;
+ FIND_SPACE(class2, j_end);
+
+ if (length == j_end - j && strncmp(class1 + i, class2 + j, length) == 0) {
+ match_found = 1;
+
+ if (ix != 0) {
+ intersection[ix] = ' ';
+ ix++;
+ }
+ memcpy(intersection + ix, class1 + i, length * sizeof (char));
+ ix += length;
+
+ SKIP_SPACES(class1, i_end);
+ memmove(class1 + i, class1 + i_end, (strlen(class1 + i_end) + 1) * sizeof (char));
+ SKIP_SPACES(class2, j_end);
+ memmove(class2 + j, class2 + j_end, (strlen(class2 + j_end) + 1) * sizeof (char));
+ } else {
+ j = j_end;
+ SKIP_SPACES(class2, j);
+ }
+ }
+ if (!match_found) {
+ i = i_end;
+ SKIP_SPACES(class1, i);
+ }
+ }
+ intersection[ix] = '\0';
+ return( intersection );
}
#define MAXT 40
@@ -1737,7 +331,7 @@ static struct keywords {
{ "pos", tk_position },
{ "enum", tk_enumerate },
{ "anon", tk_anonymous },
- {NULL}
+ { NULL, 0 }
};
static struct tablekeywords hhead_keys[] = {
@@ -1745,14 +339,14 @@ static struct tablekeywords hhead_keys[] = {
{ "Ascender", sizeof(short), 1, offsetof(struct pfminfo,hhead_ascent)+offsetof(SplineFont,pfminfo) },
{ "Descender", sizeof(short), 1, offsetof(struct pfminfo,hhead_descent)+offsetof(SplineFont,pfminfo) },
{ "LineGap", sizeof(short), 1, offsetof(struct pfminfo,linegap)+offsetof(SplineFont,pfminfo) },
- {NULL}
+ { NULL, 0, 0, 0 }
};
static struct tablekeywords vhead_keys[] = {
{ "VertTypoAscender", sizeof(short), 1, -1 },
{ "VertTypoDescender", sizeof(short), 1, -1 },
{ "VertTypoLineGap", sizeof(short), 1, offsetof(struct pfminfo,vlinegap)+offsetof(SplineFont,pfminfo) },
- {NULL}
+ { NULL, 0, 0, 0 }
};
static struct tablekeywords os2_keys[] = {
@@ -1770,7 +364,7 @@ static struct tablekeywords os2_keys[] = {
{ "WeightClass", sizeof(short), 1, offsetof(struct pfminfo,weight)+offsetof(SplineFont,pfminfo) },
{ "WidthClass", sizeof(short), 1, offsetof(struct pfminfo,width)+offsetof(SplineFont,pfminfo) },
{ "Vendor", sizeof(short), 1, offsetof(struct pfminfo,os2_vendor)+offsetof(SplineFont,pfminfo) },
- {NULL}
+ { NULL, 0, 0, 0 }
};
@@ -1790,7 +384,7 @@ return;
in = tok->inlist[tok->inc_depth];
ch = getc(in);
- while ( Isspace(ch))
+ while ( isspace(ch))
ch = getc(in);
pt = namebuf;
while ( ch!=EOF && ch!=')' && pt<namebuf+sizeof(namebuf)-1 ) {
@@ -1803,7 +397,7 @@ return;
LogError(_("Include filename too long on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
}
- while ( pt>=namebuf+1 && Isspace(pt[-1]) )
+ while ( pt>=namebuf+1 && isspace(pt[-1]) )
--pt;
*pt = '\0';
if ( ch!=')' ) {
@@ -1848,11 +442,12 @@ return;
tok->filename[tok->inc_depth] = filename;
tok->inlist[tok->inc_depth] = in;
tok->line[tok->inc_depth] = 1;
+ fea_ParseTok(tok);
}
static void fea_ParseTok(struct parseState *tok) {
FILE *in = tok->inlist[tok->inc_depth];
- int ch, peekch;
+ int ch, peekch = 0;
char *pt, *start;
if ( tok->backedup ) {
@@ -1860,10 +455,9 @@ static void fea_ParseTok(struct parseState *tok) {
return;
}
- peekch = 0;
skip_whitespace:
ch = getc(in);
- while ( Isspace(ch) || ch=='#' ) {
+ while ( isspace(ch) || ch=='#' ) {
if ( ch=='#' )
while ( (ch=getc(in))!=EOF && ch!='\n' && ch!='\r' );
if ( ch=='\n' || ch=='\r' ) {
@@ -1891,12 +485,12 @@ return;
}
start = pt = tok->tokbuf;
- if ( ch=='\\' ) {
+ if ( ch=='\\' || ch=='-' ) {
peekch=getc(in);
ungetc(peekch,in);
}
- if ( Isdigit(ch) || ch=='-' || ch=='+' || (ch=='\\' && Isdigit(peekch)) ) {
+ if ( isdigit(ch) || ch=='+' || ((ch=='-' || ch=='\\') && isdigit(peekch)) ) {
tok->type = tk_int;
if ( ch=='-' || ch=='+' ) {
if ( ch=='-' ) {
@@ -1908,13 +502,13 @@ return;
ch = getc(in);
tok->type = tk_cid;
}
- while ( (Isdigit( ch ) ||
+ while ( (isdigit( ch ) ||
(tok->base==0 && (ch=='x' || ch=='X' || (ch>='a' && ch<='f') || (ch>='A' && ch<='F'))))
&& pt<tok->tokbuf+15 ) {
*pt++ = ch;
ch = getc(in);
}
- if ( Isdigit(ch)) {
+ if ( isdigit(ch)) {
LogError(_("Number too long on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
} else if ( pt==start ) {
@@ -1925,7 +519,7 @@ return;
*pt = '\0';
tok->value = strtol(tok->tokbuf,NULL,tok->base);
return;
- } else if ( ch=='@' || ch=='_' || ch=='\\' || Isalnum(ch)) { /* Names can't start with dot */
+ } else if ( ch=='@' || ch=='_' || ch=='\\' || isalnum(ch)) { /* Names can't start with dot */
int check_keywords = true;
tok->type = tk_name;
if ( ch=='@' ) {
@@ -1938,13 +532,13 @@ return;
ch = getc(in);
check_keywords = false;
}
- while (( Isalnum(ch) || ch=='_' || ch=='.' ) && pt<start+31 ) {
+ while (( isalnum(ch) || ch=='_' || ch=='.' ) && pt<start+31 ) {
*pt++ = ch;
ch = getc(in);
}
*pt = '\0';
ungetc(ch,in);
- if ( Isalnum(ch) || ch=='_' || ch=='.' ) {
+ if ( isalnum(ch) || ch=='_' || ch=='.' ) {
LogError(_("Name too long on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
} else if ( pt==start ) {
@@ -2039,7 +633,7 @@ static int fea_ParseDeciPoints(struct parseState *tok) {
ch = getc(in);
if ( ch=='.' ) {
*pt++ = ch;
- while ( (ch = getc(in))!=EOF && Isdigit(ch)) {
+ while ( (ch = getc(in))!=EOF && isdigit(ch)) {
if ( pt<tok->tokbuf+sizeof(tok->tokbuf)-1 )
*pt++ = ch;
}
@@ -2222,10 +816,7 @@ return( copy( sc->name ));
static SplineChar *fea_glyphname_get(struct parseState *tok,char *name) {
SplineFont *sf = tok->sf;
SplineChar *sc = SFGetChar(sf,-1,name);
- int gid;
-#ifndef LUA_FF_LIB
- int enc;
-#endif
+ int enc, gid;
if ( sf->subfontcnt!=0 ) {
LogError(_("Reference to a glyph name in a CID-keyed font on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
@@ -2233,9 +824,8 @@ static SplineChar *fea_glyphname_get(struct parseState *tok,char *name) {
return(sc);
}
- if ( sc!=NULL )
+ if ( sc!=NULL || strcmp(name,"NULL")==0 )
return( sc );
-#ifndef LUA_FF_LIB
enc = SFFindSlot(sf,sf->fv->map,-1,name);
if ( enc!=-1 ) {
sc = SFMakeChar(sf,sf->fv->map,enc);
@@ -2246,7 +836,6 @@ return( sc );
}
return( sc );
}
-#endif
for ( gid=sf->glyphcnt-1; gid>=0; --gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
if ( strcmp(sc->name,name)==0 )
@@ -2256,7 +845,7 @@ return( sc );
/* Don't encode it (not in current encoding), just add it, so we needn't */
/* mess with maps or selections */
SFExpandGlyphCount(sf,sf->glyphcnt+1);
- sc = SplineCharCreate();
+ sc = SFSplineCharCreate(sf);
sc->name = copy(name);
sc->unicodeenc = UniFromName(name,ui_none,&custom);
sc->parent = sf;
@@ -2285,16 +874,15 @@ static char *fea_ParseGlyphClass(struct parseState *tok) {
} else if ( tok->type!=tk_char || tok->tokbuf[0]!='[' ) {
LogError(_("Expected '[' in glyph class definition on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
-return(NULL);
+return( NULL );
} else {
- char *contents;
+ char *contents = NULL;
int cnt=0, max=0;
- int last_val, range_type, range_len;
+ int last_val = 0, range_type, range_len = 0;
char last_glyph[MAXT+1];
- char *pt1, *start1, *pt2, *start2;
+ char *pt1, *start1, *pt2, *start2 = NULL;
int v1, v2;
- start2 = NULL; range_len = 0; last_val =0 ; contents = NULL;
forever {
fea_ParseTok(tok);
if ( tok->type==tk_char && tok->tokbuf[0]==']' )
@@ -2336,10 +924,10 @@ return(NULL);
break;
}
start1 = pt1; start2 = pt2;
- if ( !Isdigit(*pt1) || !Isdigit(*pt2))
+ if ( !isdigit(*pt1) || !isdigit(*pt2))
range_type = 1;
else {
- for ( range_len=0; range_len<3 && Isdigit(*pt1) && Isdigit(*pt2);
+ for ( range_len=0; range_len<3 && isdigit(*pt1) && isdigit(*pt2);
++range_len, ++pt1, ++pt2 );
range_type = 2;
--pt1; --pt2;
@@ -2355,7 +943,7 @@ return(NULL);
v1 = *start1; v2 = *start2;
for ( ++v1; v1<=v2; ++v1 ) {
*start1 = v1;
- contents = fea_glyphname_validate(tok,tok->tokbuf);
+ contents = fea_glyphname_validate(tok,start1);
if ( v1==v2 )
break;
if ( contents!=NULL )
@@ -2366,10 +954,10 @@ return(NULL);
v2 = strtol(start2,NULL,10);
for ( ++v1; v1<=v2; ++v1 ) {
if ( range_len==2 )
- sprintf( last_glyph, "%.*s%02d%s", start2-tok->tokbuf,
+ sprintf( last_glyph, "%.*s%02d%s", (int) (start2-tok->tokbuf),
tok->tokbuf, v1, start2+2 );
else
- sprintf( last_glyph, "%.*s%03d%s", start2-tok->tokbuf,
+ sprintf( last_glyph, "%.*s%03d%s", (int) (start2-tok->tokbuf),
tok->tokbuf, v1, start2+3 );
contents = fea_glyphname_validate(tok,last_glyph);
if ( v1==v2 )
@@ -2385,10 +973,12 @@ return(NULL);
break;
}
last_val=-1; last_glyph[0] = '\0';
+ } else if ( tok->type == tk_NULL ) {
+ contents = copy("NULL");
} else {
LogError(_("Expected glyph name, cid, or class in glyph class definition on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
-return(NULL);
+ break;
}
if ( contents!=NULL )
cnt = fea_AddGlyphs(&glyphs,&max,cnt,contents);
@@ -2399,6 +989,13 @@ return(NULL);
return( glyphs );
}
+static char *fea_ParseGlyphClassGuarded(struct parseState *tok) {
+ char *ret = fea_ParseGlyphClass(tok);
+ if ( ret==NULL )
+ ret = copy("");
+return( ret );
+}
+
static void fea_ParseLookupFlags(struct parseState *tok) {
int val = 0;
struct feat_item *item;
@@ -2515,7 +1112,7 @@ return;
if ( inside_feat ) {
struct feat_item *item = chunkalloc(sizeof(struct feat_item));
item->type = ft_langsys;
- item->u2.sl = SLCopy(tok->def_langsyses);
+ item->u2.sl = SListCopy(tok->def_langsyses);
item->next = tok->sofar;
tok->sofar = item;
}
@@ -2668,7 +1265,7 @@ return( true );
if ( SFFindLookup(tok->sf,name)!=NULL ) {
if ( !tok->lookup_in_sf_warned ) {
- gwwv_post_notice(_("Refers to Font"),_("Reference to a lookup which is not in the feature file but which is in the font, %.50s"), name );
+ ff_post_notice(_("Refers to Font"),_("Reference to a lookup which is not in the feature file but which is in the font, %.50s"), name );
tok->lookup_in_sf_warned = true;
}
return( true );
@@ -2781,7 +1378,7 @@ static struct markedglyphs *fea_ParseMarkedGlyphs(struct parseState *tok,
cur->is_cursive = is_cursive;
cur->is_mark = is_mark;
cur->is_name = false;
- cur->name_or_class = fea_ParseGlyphClass(tok);
+ cur->name_or_class = fea_ParseGlyphClassGuarded(tok);
} else if ( allow_marks && tok->type==tk_char &&
(tok->tokbuf[0]=='\'' || tok->tokbuf[0]=='"') && last!=NULL ) {
if ( last_mark!=tok->tokbuf[0] || (prev!=NULL && prev->mark_count==0)) {
@@ -3011,6 +1608,11 @@ static struct feat_item *fea_process_sub_single(struct parseState *tok,
temp = fea_glyphname_get(tok,rpl->name_or_class);
if ( temp!=NULL ) {
start = glyphs->name_or_class;
+ if ( start==NULL ) {
+ LogError(_("Internal state messed up on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
+ ++tok->err_count;
+return( sofar );
+ }
forever {
while ( *start==' ' ) ++start;
if ( *start=='\0' )
@@ -3099,8 +1701,8 @@ static FPST *fea_markedglyphs_to_fpst(struct parseState *tok,struct markedglyphs
int i;
FPST *fpst;
struct fpst_rule *r;
- struct feat_item *item, *head;
- head = NULL;
+ struct feat_item *item, *head = NULL;
+
for ( g=glyphs; g!=NULL && g->mark_count==0; g=g->next ) {
++bcnt;
if ( !g->is_name ) all_single = false;
@@ -3156,8 +1758,9 @@ static FPST *fea_markedglyphs_to_fpst(struct parseState *tok,struct markedglyphs
item->u2.fpst = fpst;
if ( is_pos ) {
- for ( g=glyphs; g!=NULL && g->mark_count!=0; g=g->next );
+ for ( g=glyphs; g!=NULL && g->mark_count==0; g=g->next );
for ( i=0; g!=NULL; ++i ) {
+ head = NULL;
if ( g->lookupname!=NULL ) {
head = chunkalloc(sizeof(struct feat_item));
head->type = ft_lookup_ref;
@@ -3170,14 +1773,14 @@ static FPST *fea_markedglyphs_to_fpst(struct parseState *tok,struct markedglyphs
( g->next->next==NULL || g->next->next->mark_count!=g->mark_count)) {
head = fea_process_pos_pair(tok,g,NULL,false);
} else {
- LogError(_("Unparseable contetual sequence on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
+ LogError(_("Unparseable contextual sequence on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
}
r->lookups[i].lookup = (OTLookup *) head;
cnt = g->mark_count;
while ( g!=NULL && g->mark_count == cnt ) /* skip everything involved here */
g=g->next;
- for ( ; g!=NULL && g->mark_count!=0; g=g->next ); /* skip any uninvolved glyphs */
+ for ( ; g!=NULL && g->mark_count==0; g=g->next ); /* skip any uninvolved glyphs */
}
}
@@ -3242,7 +1845,7 @@ static void fea_ParseSubstitute(struct parseState *tok) {
/* Alternate subs */
char *alts;
fea_ParseTok(tok);
- alts = fea_ParseGlyphClass(tok);
+ alts = fea_ParseGlyphClassGuarded(tok);
sc = fea_glyphname_get(tok,glyphs->name_or_class);
if ( sc!=NULL ) {
item = chunkalloc(sizeof(struct feat_item));
@@ -3323,7 +1926,7 @@ static void fea_ParseSubstitute(struct parseState *tok) {
} else if ( g->next!=NULL && g->mark_count==g->next->mark_count ) {
head = fea_process_sub_ligature(tok,g,rpl,NULL);
} else {
- LogError(_("Unparseable contetual sequence on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
+ LogError(_("Unparseable contextual sequence on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
}
r->lookups[i].lookup = (OTLookup *) head;
@@ -3390,7 +1993,7 @@ return;
ch = *pt; *pt = '\0';
sc = fea_glyphname_get(tok,start);
*pt = ch;
- while ( Isspace(*pt)) ++pt;
+ while ( isspace(*pt)) ++pt;
if ( sc==NULL ) {
tok->sofar = item->next; /* Oops, remove it */
chunkfree(item,sizeof(*item));
@@ -3483,7 +2086,8 @@ static void fea_ParsePosition(struct parseState *tok, int enumer) {
if ( tok->type==tk_name )
mark_class = copy(tok->tokbuf);
else
- mark_class = fea_canonicalClassOrder(fea_ParseGlyphClass(tok));
+ mark_class = fea_canonicalClassOrder(fea_ParseGlyphClassGuarded(tok));
+ fea_ParseTok(tok);
if ( glyphs->is_mark && glyphs->ap_cnt>1 ) {
LogError(_("Mark to base anchor statements may only have one anchor on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
@@ -3723,6 +2327,8 @@ return;
else {
struct feat_item *f;
for ( f = tok->sofar->next; f!=NULL; f=f->next ) {
+ if ( f->type==ft_lookup_start || f->type==ft_subtable )
+ break;
if ( f->type!=ft_ap || f->mark_class==NULL )
continue;
if ( strcmp(tok->sofar->mark_class,f->mark_class)==0 )
@@ -3843,7 +2449,7 @@ static struct nameid *fea_ParseNameId(struct parseState *tok,int strid) {
value = 0;
for ( i=0; i<dmax; ++i ) {
ch = getc(in);
- if ( !Ishexdigit(ch)) {
+ if ( !ishexdigit(ch)) {
ungetc(ch,in);
break;
}
@@ -3955,7 +2561,7 @@ return;
item->type = ft_feat_start;
item->u1.tag = feat_tag;
if ( tok->def_langsyses!=NULL )
- item->u2.sl = SLCopy(tok->def_langsyses);
+ item->u2.sl = SListCopy(tok->def_langsyses);
else {
item->u2.sl = chunkalloc(sizeof(struct scriptlanglist));
item->u2.sl->script = DEFAULT_SCRIPT;
@@ -4174,7 +2780,7 @@ static void fea_ParseTableKeywords(struct parseState *tok, struct tablekeywords
FILE *in = tok->inlist[tok->inc_depth];
int ch = getc(in);
if ( ch=='.' )
- for ( ch=getc(in); Isdigit(ch); ch=getc(in));
+ for ( ch=getc(in); isdigit(ch); ch=getc(in));
ungetc(ch,in);
}
if ( index!=-1 && keys[index].cnt!=1 ) {
@@ -4259,7 +2865,7 @@ static void fea_ParseGDEFTable(struct parseState *tok) {
else if ( tok->type==tk_cid )
item->u1.class = fea_cid_validate(tok,tok->value);
else if ( tok->type == tk_class || (tok->type==tk_char && tok->tokbuf[0]=='['))
- item->u1.class = fea_ParseGlyphClass(tok);
+ item->u1.class = fea_ParseGlyphClassGuarded(tok);
else {
LogError(_("Expected name or class on line %d of %s"), tok->line[tok->inc_depth], tok->filename[tok->inc_depth] );
++tok->err_count;
@@ -4294,7 +2900,7 @@ static void fea_ParseGDEFTable(struct parseState *tok) {
tok->sofar = item;
for ( i=0; i<4; ++i ) {
fea_ParseTok(tok);
- item->u1.gdef_classes[i] = fea_ParseGlyphClass(tok);
+ item->u1.gdef_classes[i] = fea_ParseGlyphClassGuarded(tok);
}
fea_ParseTok(tok);
} else {
@@ -4549,6 +3155,7 @@ static void fea_ApplyLookupListPST(struct parseState *tok,
struct feat_item *lookup_data,OTLookup *otl) {
struct lookup_subtable *sub = NULL, *last=NULL;
struct feat_item *l;
+ (void)tok;
/* Simple pst's are easy. We just attach them to their proper glyphs */
/* and then clear the feat_item pst slot (so we don't free them later) */
/* There might be a subtable break */
@@ -4615,6 +3222,8 @@ static void fea_ApplyLookupListContextual(struct parseState *tok,
last->next = sub;
last = sub;
sub->fpst = l->u2.fpst;
+ l->u2.fpst->next = tok->sf->possub;
+ tok->sf->possub = l->u2.fpst;
l->u2.fpst = NULL;
sub->fpst->subtable = sub;
for ( i=0; i<sub->fpst->rule_cnt; ++i ) {
@@ -4705,7 +3314,8 @@ static void fea_ApplyLookupListMark2(struct parseState *tok,
classes = galloc(mcnt*sizeof(char *));
acs = galloc(mcnt*sizeof(AnchorClass *));
ac_cnt = 0;
- while ( lookup_data != NULL ) {
+ while ( lookup_data != NULL && lookup_data->type!=ft_lookup_end ) {
+ struct feat_item *orig = lookup_data;
sub = NULL;
/* Skip any subtable marks */
while ( lookup_data!=NULL &&
@@ -4767,7 +3377,8 @@ static void fea_ApplyLookupListMark2(struct parseState *tok,
/* Now go back and assign the marks to the correct anchor classes */
for ( l=mark_start; l!=NULL &&
- ((l->type==ft_ap && l->u2.ap->type==at_mark) ||
+ /* The base aps will have been set to NULL above */
+ ((l->type==ft_ap && l->u2.ap!=NULL && l->u2.ap->type==at_mark) ||
l->type==ft_lookup_start ||
l->type==ft_lookupflags ) ;
l = l->lookup_next ) {
@@ -4788,9 +3399,21 @@ static void fea_ApplyLookupListMark2(struct parseState *tok,
}
}
}
+ if ( lookup_data==orig )
+ break;
}
}
+
+static int is_blank(const char *s) {
+ int i;
+
+ i = 0;
+ while (s[i] != '\0' && s[i] == ' ')
+ i++;
+ return( s[i] == '\0');
+}
+
struct class_set {
char **classes;
int cnt, max;
@@ -4819,12 +3442,28 @@ static void fea_canonicalClassSet(struct class_set *set) {
set->cnt -= off;
}
}
- for ( i=1; i<set->cnt; ++i ) {
- if ( fea_classesIntersect(set->classes[i-1],set->classes[i]) ) {
- if ( set->cnt>=set->max )
- set->classes = grealloc(set->classes,(set->max+=20)*sizeof(char *));
- set->classes[set->cnt++] = fea_classesSplit(set->classes[i-1],set->classes[i]);
- }
+
+ for ( i=0; i < set->cnt - 1; ++i ) {
+ for ( j=i+1; j < set->cnt; ++j ) {
+ if ( fea_classesIntersect(set->classes[i],set->classes[j]) ) {
+ if ( set->cnt>=set->max )
+ set->classes = grealloc(set->classes,(set->max+=20)*sizeof(char *));
+ set->classes[set->cnt++] = fea_classesSplit(set->classes[i],set->classes[j]);
+ }
+ }
+ }
+
+ /* Remove empty classes */
+ i = 0;
+ while (i < set->cnt) {
+ if (is_blank(set->classes[i])) {
+ free(set->classes[i]);
+ for ( k=i+1 ; k < set->cnt; ++k )
+ set->classes[k-1] = set->classes[k];
+ set->cnt -= 1;
+ } else {
+ i++;
+ }
}
}
@@ -4859,7 +3498,7 @@ static void fea_fillKernClass(KernClass *kc,struct feat_item *l) {
pst = l->u2.pst;
for ( i=1; i<kc->first_cnt; ++i ) {
if ( fea_classesIntersect(kc->firsts[i],l->u1.class) ) {
- for ( j=1; j<kc->first_cnt; ++j ) {
+ for ( j=1; j<kc->second_cnt; ++j ) {
if ( fea_classesIntersect(kc->seconds[j],pst->u.pair.paired) ) {
/* FontForge only supports kerning classes in one direction at a time, not full value records */
if ( pst->u.pair.vr[0].h_adv_off != 0 ) {
@@ -4894,6 +3533,26 @@ static void fea_fillKernClass(KernClass *kc,struct feat_item *l) {
}
}
+static void SFKernClassRemoveFree(SplineFont *sf,KernClass *kc) {
+ KernClass *prev;
+
+ if ( sf->kerns==kc )
+ sf->kerns = kc->next;
+ else if ( sf->vkerns==kc )
+ sf->vkerns = kc->next;
+ else {
+ prev = NULL;
+ if ( sf->kerns!=NULL )
+ for ( prev=sf->kerns; prev!=NULL && prev->next!=kc; prev=prev->next );
+ if ( prev==NULL && sf->vkerns!=NULL )
+ for ( prev=sf->vkerns; prev!=NULL && prev->next!=kc; prev=prev->next );
+ if ( prev!=NULL )
+ prev->next = kc->next;
+ }
+ kc->next = NULL;
+ KernClassListFree(kc);
+}
+
static void fea_ApplyLookupListPair(struct parseState *tok,
struct feat_item *lookup_data,int kmax,OTLookup *otl) {
/* kcnt is the number of left/right glyph-name-lists we must sort into classes */
@@ -4999,6 +3658,8 @@ static void fea_ApplyLookupListPair(struct parseState *tok,
lastsub->next = sub;
lastsub = sub;
+ if ( sub->kc!=NULL )
+ SFKernClassRemoveFree(tok->sf,sub->kc);
sub->kc = kc = chunkalloc(sizeof(KernClass));
kc->first_cnt = lefts.cnt+1; kc->second_cnt = rights.cnt+1;
kc->firsts = galloc(kc->first_cnt*sizeof(char *));
@@ -5054,7 +3715,11 @@ static OTLookup *fea_ApplyLookupList(struct parseState *tok,
if ( otl->lookup_name!=NULL &&
strcmp(otl->lookup_name,lookup_data->u1.lookup_name)==0)
return( otl );
-return( SFFindLookup(tok->sf,lookup_data->u1.lookup_name));
+ otl = SFFindLookup(tok->sf,lookup_data->u1.lookup_name);
+ if ( otl==NULL )
+ LogError( _("No lookup named %s"),lookup_data->u1.lookup_name );
+ /* Can't give a line number, this is second pass */
+return( otl );
}
otl = chunkalloc(sizeof(OTLookup));
@@ -5124,13 +3789,16 @@ static void fea_AttachFeatureToLookup(OTLookup *otl,uint32 feat_tag,
struct scriptlanglist *sl) {
FeatureScriptLangList *fl;
+ if ( otl==NULL )
+return;
+
for ( fl = otl->features; fl!=NULL && fl->featuretag!=feat_tag; fl=fl->next );
if ( fl==NULL ) {
fl = chunkalloc(sizeof(FeatureScriptLangList));
fl->next = otl->features;
otl->features = fl;
fl->featuretag = feat_tag;
- fl->scripts = SLCopy(sl);
+ fl->scripts = SListCopy(sl);
} else
SLMerge(fl,sl);
}
@@ -5435,14 +4103,18 @@ return( p );
static void fea_NameLookups(struct parseState *tok) {
SplineFont *sf = tok->sf;
- OTLookup *gpos_last, *gsub_last, *otl, *otlnext;
+ OTLookup *gpos_last=NULL, *gsub_last=NULL, *otl, *otlnext;
int gp_cnt=0, gs_cnt=0, acnt;
AnchorClass *ac, *acnext, *an;
- for ( gpos_last = sf->gpos_lookups; gpos_last!=NULL; gpos_last=gpos_last->next )
- gpos_last->lookup_index = gp_cnt++;
- for ( gsub_last = sf->gsub_lookups; gsub_last!=NULL; gsub_last=gsub_last->next )
- gsub_last->lookup_index = gs_cnt++;
+ for ( otl = sf->gpos_lookups; otl!=NULL; otl=otl->next ) {
+ otl->lookup_index = gp_cnt++;
+ gpos_last = otl;
+ }
+ for ( otl = sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
+ otl->lookup_index = gs_cnt++;
+ gsub_last = otl;
+ }
for ( otl = tok->created; otl!=NULL; otl=otlnext ) {
otlnext = otl->next;
@@ -5492,11 +4164,8 @@ static void fea_NameLookups(struct parseState *tok) {
}
sf->changed = true;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- FVSetTitle(sf->fv);
- if ( sf->fv->v!=NULL )
- GDrawRequestExpose(sf->fv->v,NULL,false);
-#endif
+ FVSetTitles(sf);
+ FVRefreshAll(sf);
}
void SFApplyFeatureFile(SplineFont *sf,FILE *file,char *filename) {
@@ -5517,7 +4186,7 @@ void SFApplyFeatureFile(SplineFont *sf,FILE *file,char *filename) {
fea_ApplyFile(&tok, tok.sofar);
fea_NameLookups(&tok);
} else
- gwwv_post_error("Not applied","There were errors when parsing the feature file and the features have not been applied");
+ ff_post_error("Not applied","There were errors when parsing the feature file and the features have not been applied");
fea_featitemFree(tok.sofar);
ScriptLangListFree(tok.def_langsyses);
for ( gc = tok.classes; gc!=NULL; gc=gcnext ) {
@@ -5531,7 +4200,7 @@ void SFApplyFeatureFilename(SplineFont *sf,char *filename) {
FILE *in = fopen(filename,"r");
if ( in==NULL ) {
- gwwv_post_error(_("Cannot open file"),_("Cannot open feature file %.120s"), filename );
+ ff_post_error(_("Cannot open file"),_("Cannot open feature file %.120s"), filename );
return;
}
SFApplyFeatureFile(sf,in,filename);
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/groups.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontforgevw.h
index 95acdfb094a..2d3fa3207b8 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/groups.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontforgevw.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2007 by George Williams */
+/* Copyright (C) 2007,2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -24,26 +24,11 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _GROUPS_H
-#define _GROUPS_H
+#ifndef _FONTFORGEVW_H_
+#define _FONTFORGEVW_H_
-typedef struct group {
- char *name; /* The name of this group (utf8) */
- struct group *parent; /* parent of this group (NULL for group root) */
- int kid_cnt; /* Number of sub-groups */
- struct group **kids; /* The sub-groups */
- char *glyphs; /* Or, if a terminal node, a list of glyph names/Unicodes */
- unsigned int unique: 1; /* If set => set in all kids & a glyph name may only appear once in all terminal groups */
-/* Used by the dialog */
- unsigned int open: 1;
- unsigned int selected : 1;
- int lpos;
-} Group;
+#include "pfaedit.h"
+#include "gimage.h"
+#include "baseviews.h"
-extern Group *group_root;
-
-void SaveGroupList(void);
-void LoadGroupList(void);
-void DefineGroups(FontView *fv);
-void DisplayGroups(FontView *fv);
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
new file mode 100644
index 00000000000..7f2a34f1f05
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
@@ -0,0 +1,286 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include "baseviews.h"
+#include "psfont.h"
+#include <gfile.h>
+#include <gio.h>
+#include <ustring.h>
+#include <utype.h>
+#include <chardata.h>
+#include <gresource.h>
+#include <math.h>
+#include <unistd.h>
+
+static FontViewBase *fv_list=NULL;
+
+extern int onlycopydisplayed;
+float joinsnap=0;
+
+
+/* FV Interface */
+
+static FontViewBase *_FontViewBaseCreate(SplineFont *sf) {
+ FontViewBase *fv = gcalloc(1,sizeof(FontViewBase));
+ int i;
+
+ fv->nextsame = sf->fv;
+ fv->active_layer = ly_fore;
+ sf->fv = fv;
+ if ( sf->mm!=NULL ) {
+ sf->mm->normal->fv = fv;
+ for ( i = 0; i<sf->mm->instance_count; ++i )
+ sf->mm->instances[i]->fv = fv;
+ }
+ if ( sf->subfontcnt==0 ) {
+ fv->sf = sf;
+ if ( fv->nextsame!=NULL ) {
+ fv->map = EncMapCopy(fv->nextsame->map);
+ fv->normal = fv->nextsame->normal==NULL ? NULL : EncMapCopy(fv->nextsame->normal);
+ } else if ( sf->compacted ) {
+ fv->normal = sf->map;
+ fv->map = CompactEncMap(EncMapCopy(sf->map),sf);
+ } else {
+ fv->map = sf->map;
+ fv->normal = NULL;
+ }
+ } else {
+ fv->cidmaster = sf;
+ for ( i=0; i<sf->subfontcnt; ++i )
+ sf->subfonts[i]->fv = fv;
+ for ( i=0; i<sf->subfontcnt; ++i ) /* Search for a subfont that contains more than ".notdef" (most significant in .gai fonts) */
+ if ( sf->subfonts[i]->glyphcnt>1 ) {
+ fv->sf = sf->subfonts[i];
+ break;
+ }
+ if ( fv->sf==NULL )
+ fv->sf = sf->subfonts[0];
+ sf = fv->sf;
+ if ( fv->nextsame==NULL ) EncMapFree(sf->map);
+ fv->map = EncMap1to1(sf->glyphcnt);
+ }
+ fv->selected = gcalloc(fv->map->enccount,sizeof(char));
+
+#ifndef _NO_PYTHON
+ PyFF_InitFontHook(fv);
+#endif
+return( fv );
+}
+
+static FontViewBase *FontViewBase_Create(SplineFont *sf,int hide) {
+ FontViewBase *fv = _FontViewBaseCreate(sf);
+ (void)hide;
+return( fv );
+}
+
+static FontViewBase *FontViewBase_Append(FontViewBase *fv) {
+ /* Normally fontviews get added to the fv list when their windows are */
+ /* created. but we don't create any windows here, so... */
+ FontViewBase *test;
+
+ if ( fv_list==NULL ) fv_list = fv;
+ else {
+ for ( test = fv_list; test->next!=NULL; test=test->next );
+ test->next = fv;
+ }
+return( fv );
+}
+
+static void FontViewBase_Free(FontViewBase *fv) {
+ int i;
+ FontViewBase *prev;
+
+ if ( fv->nextsame==NULL && fv->sf->fv==fv ) {
+ EncMapFree(fv->map);
+ SplineFontFree(fv->cidmaster?fv->cidmaster:fv->sf);
+ } else {
+ EncMapFree(fv->map);
+ if ( fv->sf->fv==fv ) {
+ if ( fv->cidmaster==NULL )
+ fv->sf->fv = fv->nextsame;
+ else {
+ fv->cidmaster->fv = fv->nextsame;
+ for ( i=0; i<fv->cidmaster->subfontcnt; ++i )
+ fv->cidmaster->subfonts[i]->fv = fv->nextsame;
+ }
+ } else {
+ for ( prev = fv->sf->fv; prev->nextsame!=fv; prev=prev->nextsame );
+ prev->nextsame = fv->nextsame;
+ }
+ }
+#ifndef _NO_FFSCRIPT
+ DictionaryFree(fv->fontvars);
+ free(fv->fontvars);
+#endif
+ free(fv->selected);
+#ifndef _NO_PYTHON
+ PyFF_FreeFV(fv);
+#endif
+ free(fv);
+}
+
+static int FontViewBaseWinInfo(FontViewBase *fv, int *cc, int *rc) {
+ (void)fv;
+ *cc = 16; *rc = 4;
+return( -1 );
+}
+
+static void FontViewBaseSetTitle(FontViewBase *foo) { (void)foo; }
+static void FontViewBaseSetTitles(SplineFont *foo) { (void)foo; }
+static void FontViewBaseRefreshAll(SplineFont *foo) { (void)foo; }
+static void FontViewBaseReformatOne(FontViewBase *foo) { (void)foo; }
+static void FontViewBaseReformatAll(SplineFont *foo) { (void)foo; }
+static void FontViewBaseLayerChanged(FontViewBase *foo) {(void)foo; }
+static void FV_ToggleCharChanged(SplineChar *foo) {(void)foo; }
+static FontViewBase *FVAny(void) { return fv_list; }
+static int FontIsActive(SplineFont *sf) {
+ FontViewBase *fv;
+
+ for ( fv=fv_list; fv!=NULL; fv=fv->next )
+ if ( fv->sf == sf )
+return( true );
+
+return( false );
+}
+
+static SplineFont *FontOfFilename(const char *filename) {
+ char buffer[1025];
+ FontViewBase *fv;
+
+ GFileGetAbsoluteName((char *) filename,buffer,sizeof(buffer));
+ for ( fv=fv_list; fv!=NULL ; fv=fv->next ) {
+ if ( fv->sf->filename!=NULL && strcmp(fv->sf->filename,buffer)==0 )
+return( fv->sf );
+ else if ( fv->sf->origname!=NULL && strcmp(fv->sf->origname,buffer)==0 )
+return( fv->sf );
+ }
+return( NULL );
+}
+
+static void FVExtraEncSlots(FontViewBase *fv, int encmax) {
+ (void)fv;
+ (void)encmax;
+}
+
+static void FontViewBase_Close(FontViewBase *fv) {
+ if ( fv_list==fv )
+ fv_list = fv->next;
+ else {
+ FontViewBase *n;
+ for ( n=fv_list; n->next!=fv; n=n->next );
+ n->next = fv->next;
+ }
+ FontViewFree(fv);
+}
+
+static void FVB_ChangeDisplayBitmap(FontViewBase *fv, BDFFont *bdf) {
+ fv->active_bitmap = bdf;
+}
+
+static void FVB_ShowFilled(FontViewBase *fv) {
+ fv->active_bitmap = NULL;
+}
+
+static void FVB_ReattachCVs(SplineFont *old, SplineFont *new) {
+ (void)old;
+ (void)new;
+}
+
+static void FVB_DeselectAll(FontViewBase *fv) {
+ memset(fv->selected,0,fv->map->encmax);
+}
+
+static void FVB_DisplayChar(FontViewBase *fv,int gid) {
+ (void)fv;
+ (void)gid;
+}
+
+static int SFB_CloseAllInstrs(SplineFont *sf) {
+ (void)sf;
+return( true );
+}
+
+struct fv_interface noui_fv = {
+ FontViewBase_Create,
+ _FontViewBaseCreate,
+ FontViewBase_Close,
+ FontViewBase_Free,
+ FontViewBaseSetTitle,
+ FontViewBaseSetTitles,
+ FontViewBaseRefreshAll,
+ FontViewBaseReformatOne,
+ FontViewBaseReformatAll,
+ FontViewBaseLayerChanged,
+ FV_ToggleCharChanged,
+ FontViewBaseWinInfo,
+ FontIsActive,
+ FVAny,
+ FontViewBase_Append,
+ FontOfFilename,
+ FVExtraEncSlots,
+ FVExtraEncSlots,
+ FVB_ChangeDisplayBitmap,
+ FVB_ShowFilled,
+ FVB_ReattachCVs,
+ FVB_DeselectAll,
+ FVB_DisplayChar,
+ FVB_DisplayChar,
+ FVB_DisplayChar,
+ SFB_CloseAllInstrs
+};
+
+struct fv_interface *fv_interface = &noui_fv;
+
+
+/******************************************************************************/
+static int NoGlyphs(struct metricsview *mv) {
+ (void)mv;
+return( 0 );
+}
+
+static SplineChar *Nothing(struct metricsview *mv, int i) {
+ (void)mv;
+ (void)i;
+return( NULL );
+}
+
+static void NoReKern(struct splinefont *sf) {
+ (void)sf;
+}
+
+static void NoCloseAll(struct splinefont *sf) {
+ (void)sf;
+}
+
+struct mv_interface noui_mv = {
+ NoGlyphs,
+ Nothing,
+ NoReKern,
+ NoCloseAll
+};
+
+struct mv_interface *mv_interface = &noui_mv;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvcomposit.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvcomposit.c
new file mode 100644
index 00000000000..53f6ee81aa7
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvcomposit.c
@@ -0,0 +1,160 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h"
+#include <chardata.h>
+#include <math.h>
+#include <utype.h>
+#include <ustring.h>
+
+int accent_offset = 6;
+int GraveAcuteCenterBottom = 1;
+int PreferSpacingAccents = true;
+int CharCenterHighest = 1;
+
+#define BottomAccent 0x300
+#define TopAccent 0x345
+
+/* for accents between 0x300 and 345 these are some synonyms */
+/* type1 wants accented chars built with accents in the 0x2c? range */
+/* except for grave and acute which live in iso8859-1 range */
+/* this table is ordered on a best try basis */
+static const unichar_t accents[][4] = {
+ { 0x2cb, 0x300, 0x60 }, /* grave */
+ { 0x2ca, 0x301, 0xb4 }, /* acute */
+ { 0x2c6, 0x302, 0x5e }, /* circumflex */
+ { 0x2dc, 0x303, 0x7e }, /* tilde */
+ { 0x2c9, 0x304, 0xaf }, /* macron */
+ { 0x305, 0xaf }, /* overline, (macron is suggested as a syn, but it's not quite right) */
+ { 0x2d8, 0x306 }, /* breve */
+ { 0x2d9, 0x307, '.' }, /* dot above */
+ { 0xa8, 0x308 }, /* diaeresis */
+ { 0x2c0 }, /* hook above */
+ { 0x2da, 0xb0 }, /* ring above */
+ { 0x2dd }, /* real acute */
+ { 0x2c7 }, /* caron */
+ { 0x2c8, 0x384, 0x30d, '\'' }, /* vertical line, tonos */
+ { 0x30e, '"' }, /* real vertical line */
+ { 0 }, /* real grave */
+ { 0 }, /* cand... */ /* 310 */
+ { 0 }, /* inverted breve */
+ { 0x2bb }, /* turned comma */
+ { 0x2bc, 0x313, ',' }, /* comma above */
+ { 0x2bd }, /* reversed comma */
+ { 0x2bc, 0x315, ',' }, /* comma above right */
+ { 0x316, 0x60, 0x2cb }, /* grave below */
+ { 0x317, 0xb4, 0x2ca }, /* acute below */
+ { 0 }, /* left tack */
+ { 0 }, /* right tack */
+ { 0 }, /* left angle */
+ { 0 }, /* horn, sometimes comma but only if nothing better */
+ { 0 }, /* half ring */
+ { 0x2d4 }, /* up tack */
+ { 0x2d5 }, /* down tack */
+ { 0x2d6, 0x31f, '+' }, /* plus below */
+ { 0x2d7, 0x320, '-' }, /* minus below */ /* 320 */
+ { 0x2b2 }, /* hook */
+ { 0 }, /* back hook */
+ { 0x323, 0x2d9, '.' }, /* dot below */
+ { 0x324, 0xa8 }, /* diaeresis below */
+ { 0x325, 0x2da, 0xb0 }, /* ring below */
+ { 0x326, 0x2bc, ',' }, /* comma below */
+ { 0xb8 }, /* cedilla */
+ { 0x2db }, /* ogonek */ /* 0x328 */
+ { 0x329, 0x2c8, 0x384, '\'' }, /* vertical line below */
+ { 0 }, /* bridge below */
+ { 0 }, /* real arch below */
+ { 0x32c, 0x2c7 }, /* caron below */
+ { 0x32d, 0x2c6, 0x52 }, /* circumflex below */
+ { 0x32e, 0x2d8 }, /* breve below */
+ { 0 }, /* inverted breve below */
+ { 0x330, 0x2dc, 0x7e }, /* tilde below */ /* 0x330 */
+ { 0x331, 0xaf, 0x2c9 }, /* macron below */
+ { 0x332, '_' }, /* low line */
+ { 0 }, /* real low line */
+ { 0x334, 0x2dc, 0x7e }, /* tilde overstrike */
+ { 0x335, '-' }, /* line overstrike */
+ { 0x336, '_' }, /* long line overstrike */
+ { 0x337, '/' }, /* short solidus overstrike */
+ { 0x338, '/' }, /* long solidus overstrike */ /* 0x338 */
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0x340, 0x60, 0x2cb }, /* tone mark, left of circumflex */ /* 0x340 */
+ { 0x341, 0xb4, 0x2ca }, /* tone mark, right of circumflex */
+ { 0x342, 0x2dc, 0x7e }, /* perispomeni (tilde) */
+ { 0x343, 0x2bc, ',' }, /* koronis */
+ { 0 }, /* dialytika tonos (two accents) */
+ { 0x37a }, /* ypogegrammeni */
+ { 0xffff }
+};
+
+int CanonicalCombiner(int uni) {
+ /* Translate spacing accents to combiners */
+ int j,k;
+
+ /* The above table will use these occasionally, but we don't want to */
+ /* translate them. They aren't accents */
+ if ( uni==',' || uni=='\'' || uni=='"' || uni=='~' || uni=='^' || uni=='-' ||
+ uni=='+' || uni=='.' )
+return( uni );
+
+ for ( j=0; accents[j][0]!=0xffff; ++j ) {
+ for ( k=0; k<4 && accents[j][k]!=0; ++k ) {
+ if ( uni==(int)accents[j][k] ) {
+ uni = 0x300+j;
+ break;
+ }
+ }
+ if ( uni>=0x300 && uni<0x370 )
+ break;
+ }
+return( uni );
+}
+
+
+
+int isaccent(int uni) {
+
+ if ( uni<0x10000 && iscombining(uni) )
+return( true );
+ if ( uni>=0x2b0 && uni<0x2ff )
+return( true );
+ if ( uni=='.' || uni==',' || uni==0x60 || uni==0x5e || uni==0x7e ||
+ uni==0xa8 || uni==0xaf || uni==0xb8 || uni==0x384 || uni==0x385 ||
+ (uni>=0x1fbd && uni<=0x1fc1) ||
+ (uni>=0x1fcd && uni<=0x1fcf) ||
+ (uni>=0x1fed && uni<=0x1fef) ||
+ (uni>=0x1ffd && uni<=0x1fff) )
+return( true );
+
+return( false );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvfonts.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvfonts.c
new file mode 100644
index 00000000000..db709cea56e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fvfonts.c
@@ -0,0 +1,572 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h"
+#include "ustring.h"
+#include "utype.h"
+#include "gfile.h"
+#include "chardata.h"
+
+RefChar *RefCharsCopy(RefChar *ref) {
+ RefChar *rhead=NULL, *last=NULL, *cur;
+
+ while ( ref!=NULL ) {
+ cur = RefCharCreate();
+#ifdef FONTFORGE_CONFIG_TYPE3
+ { struct reflayer *layers = cur->layers; int layer;
+ layers = grealloc(layers,ref->layer_cnt*sizeof(struct reflayer));
+ memcpy(layers,ref->layers,ref->layer_cnt*sizeof(struct reflayer));
+ *cur = *ref;
+ cur->layers = layers;
+ for ( layer=0; layer<cur->layer_cnt; ++layer ) {
+ cur->layers[layer].splines = NULL;
+ cur->layers[layer].images = NULL;
+ }
+ }
+#else
+ {struct reflayer *rl = cur->layers;
+ *cur = *ref;
+ cur->layers = rl;
+ }
+#endif
+ if ( cur->sc!=NULL )
+ cur->orig_pos = cur->sc->orig_pos;
+ cur->next = NULL;
+ if ( rhead==NULL )
+ rhead = cur;
+ else
+ last->next = cur;
+ last = cur;
+ ref = ref->next;
+ }
+return( rhead );
+}
+
+static OTLookup *MCConvertLookup(struct sfmergecontext *mc,OTLookup *otl) {
+ int l;
+ OTLookup *newotl;
+
+ if ( mc==NULL || mc->sf_from==mc->sf_to )
+return( otl ); /* No translation needed */
+
+ for ( l=0; l<mc->lcnt; ++l ) {
+ if ( mc->lks[l].from == otl )
+ break;
+ }
+ if ( l==mc->lcnt )
+return( NULL );
+ if ( mc->lks[l].to!=NULL )
+return( mc->lks[l].to );
+
+ mc->lks[l].to = newotl = chunkalloc(sizeof(struct lookup_subtable));
+ newotl->lookup_name = strconcat(mc->prefix,otl->lookup_name);
+ newotl->lookup_type = otl->lookup_type;
+ newotl->lookup_flags = otl->lookup_flags;
+ newotl->features = FeatureListCopy(otl->features);
+ newotl->store_in_afm = otl->store_in_afm;
+return( newotl );
+}
+
+struct lookup_subtable *MCConvertSubtable(struct sfmergecontext *mc,struct lookup_subtable *sub) {
+ int s;
+ struct lookup_subtable *newsub;
+
+ if ( mc==NULL || mc->sf_from==mc->sf_to )
+return( sub ); /* No translation needed */
+ if ( mc->prefix==NULL ) {
+ int lcnt, scnt;
+ OTLookup *otl;
+ struct lookup_subtable *subs;
+ int isgpos, doit;
+ char *temp;
+
+ /* Not initialized */
+ if ( mc->sf_from->cidmaster ) mc->sf_from = mc->sf_from->cidmaster;
+ else if ( mc->sf_from->mm!=NULL ) mc->sf_from = mc->sf_from->mm->normal;
+ if ( mc->sf_to->cidmaster ) mc->sf_to = mc->sf_to->cidmaster;
+ else if ( mc->sf_to->mm!=NULL ) mc->sf_to = mc->sf_to->mm->normal;
+ if ( mc->sf_from == mc->sf_to )
+return( sub );
+ mc->prefix = strconcat(mc->sf_from->fontname,"-");
+ for ( doit = 0; doit<2; ++doit ) {
+ lcnt = scnt = 0;
+ for ( isgpos=0; isgpos<2; ++isgpos ) {
+ for ( otl = isgpos ? mc->sf_from->gpos_lookups : mc->sf_from->gsub_lookups; otl!=NULL; otl=otl->next ) {
+ if ( doit ) {
+ mc->lks[lcnt].from = otl;
+ temp = strconcat(mc->prefix,otl->lookup_name);
+ mc->lks[lcnt].to = SFFindLookup(mc->sf_to,temp);
+ free(temp);
+ mc->lks[lcnt].old = mc->lks[lcnt].to!=NULL;
+ }
+ ++lcnt;
+ for ( subs=otl->subtables; subs!=NULL; subs=subs->next ) {
+ if ( doit ) {
+ mc->subs[scnt].from = subs;
+ temp = strconcat(mc->prefix,subs->subtable_name);
+ mc->subs[scnt].to = SFFindLookupSubtable(mc->sf_to,temp);
+ free(temp);
+ mc->subs[scnt].old = mc->subs[scnt].to!=NULL;
+ }
+ ++scnt;
+ }
+ }
+ }
+ if ( !doit ) {
+ mc->lcnt = lcnt; mc->scnt = scnt;
+ mc->lks = gcalloc(lcnt,sizeof(struct lookup_cvt));
+ mc->subs = gcalloc(scnt,sizeof(struct sub_cvt));
+ }
+ }
+ }
+
+ for ( s=0; s<mc->scnt; ++s ) {
+ if ( mc->subs[s].from == sub )
+ break;
+ }
+ if ( s==mc->scnt )
+return( NULL );
+ if ( mc->subs[s].to!=NULL )
+return( mc->subs[s].to );
+
+ mc->subs[s].to = newsub = chunkalloc(sizeof(struct lookup_subtable));
+ newsub->subtable_name = strconcat(mc->prefix,sub->subtable_name);
+ newsub->lookup = MCConvertLookup(mc,sub->lookup);
+ newsub->anchor_classes = sub->anchor_classes;
+ newsub->per_glyph_pst_or_kern = sub->per_glyph_pst_or_kern;
+return( newsub );
+}
+
+PST *PSTCopy(PST *base,SplineChar *sc,struct sfmergecontext *mc) {
+ PST *head=NULL, *last=NULL, *cur;
+
+ for ( ; base!=NULL; base = base->next ) {
+ cur = chunkalloc(sizeof(PST));
+ *cur = *base;
+ cur->subtable = MCConvertSubtable(mc,base->subtable);
+ if ( cur->type==pst_ligature ) {
+ cur->u.lig.components = copy(cur->u.lig.components);
+ cur->u.lig.lig = sc;
+ } else if ( cur->type==pst_pair ) {
+ cur->u.pair.paired = copy(cur->u.pair.paired);
+ cur->u.pair.vr = chunkalloc(sizeof( struct vr [2]));
+ memcpy(cur->u.pair.vr,base->u.pair.vr,sizeof(struct vr [2]));
+ } else if ( cur->type==pst_lcaret ) {
+ cur->u.lcaret.carets = galloc(cur->u.lcaret.cnt*sizeof(uint16));
+ memcpy(cur->u.lcaret.carets,base->u.lcaret.carets,cur->u.lcaret.cnt*sizeof(uint16));
+ } else if ( cur->type==pst_substitution || cur->type==pst_multiple || cur->type==pst_alternate )
+ cur->u.subs.variant = copy(cur->u.subs.variant);
+ if ( head==NULL )
+ head = cur;
+ else
+ last->next = cur;
+ last = cur;
+ }
+return( head );
+}
+
+static AnchorPoint *AnchorPointsDuplicate(AnchorPoint *base,SplineChar *sc) {
+ AnchorPoint *head=NULL, *last=NULL, *cur;
+ AnchorClass *ac;
+
+ for ( ; base!=NULL; base = base->next ) {
+ cur = chunkalloc(sizeof(AnchorPoint));
+ *cur = *base;
+ cur->next = NULL;
+ for ( ac=sc->parent->anchor; ac!=NULL; ac=ac->next )
+ if ( strcmp(ac->name,base->anchor->name)==0 )
+ break;
+ cur->anchor = ac;
+ if ( ac==NULL ) {
+ LogError( "No matching AnchorClass for %s", base->anchor->name);
+ chunkfree(cur,sizeof(AnchorPoint));
+ } else {
+ if ( head==NULL )
+ head = cur;
+ else
+ last->next = cur;
+ last = cur;
+ }
+ }
+return( head );
+}
+
+static struct altuni *AltUniCopy(struct altuni *altuni,SplineFont *noconflicts) {
+ struct altuni *head=NULL, *last=NULL, *cur;
+
+ while ( altuni!=NULL ) {
+ if ( noconflicts==NULL || SFGetChar(noconflicts,altuni->unienc,NULL)==NULL ) {
+ cur = chunkalloc(sizeof(struct altuni));
+ cur->unienc = altuni->unienc;
+ cur->vs = altuni->vs;
+ cur->fid = altuni->fid;
+ if ( head==NULL )
+ head = cur;
+ else
+ last->next = cur;
+ last = cur;
+ }
+ altuni = altuni->next;
+ }
+return( head );
+}
+
+SplineChar *SplineCharCopy(SplineChar *sc,SplineFont *into,struct sfmergecontext *mc) {
+ SplineChar *nsc;
+ Layer *layers;
+ int layer;
+ if (into==NULL) {
+ nsc = SplineCharCreate(2);
+ } else {
+ nsc = SFSplineCharCreate(into);
+ }
+ layers = nsc->layers;
+ *nsc = *sc; /* We copy the layers just below */
+ if (into==NULL || sc->layer_cnt!=into->layer_cnt )
+ layers = grealloc(layers,sc->layer_cnt*sizeof(Layer));
+ memcpy(layers,sc->layers,sc->layer_cnt*sizeof(Layer));
+ nsc->layers = layers;
+ for ( layer = ly_back; layer<sc->layer_cnt; ++layer ) {
+ layers[layer].splines = SplinePointListCopy(layers[layer].splines);
+ layers[layer].refs = RefCharsCopy(layers[layer].refs);
+ layers[layer].images = ImageListCopy(layers[layer].images);
+ layers[layer].undoes = NULL;
+ layers[layer].redoes = NULL;
+ }
+ nsc->parent = into;
+ nsc->orig_pos = -2;
+ nsc->name = copy(sc->name);
+ nsc->hstem = StemInfoCopy(nsc->hstem);
+ nsc->vstem = StemInfoCopy(nsc->vstem);
+ nsc->anchor = AnchorPointsDuplicate(nsc->anchor,nsc);
+ nsc->views = NULL;
+ nsc->changed = true;
+ nsc->dependents = NULL; /* Fix up later when we know more */
+ nsc->layers[ly_fore].undoes = nsc->layers[ly_back].undoes = NULL;
+ nsc->layers[ly_fore].redoes = nsc->layers[ly_back].redoes = NULL;
+ if ( nsc->ttf_instrs_len!=0 ) {
+ nsc->ttf_instrs = galloc(nsc->ttf_instrs_len);
+ memcpy(nsc->ttf_instrs,sc->ttf_instrs,nsc->ttf_instrs_len);
+ }
+ nsc->kerns = NULL;
+ nsc->possub = PSTCopy(nsc->possub,nsc,mc);
+ nsc->altuni = AltUniCopy(nsc->altuni,into);
+return(nsc);
+}
+
+static int _SFFindExistingSlot(SplineFont *sf, int unienc, const char *name );
+
+
+#define GN_HSIZE 257
+
+struct glyphnamebucket {
+ SplineChar *sc;
+ struct glyphnamebucket *next;
+};
+
+struct glyphnamehash {
+ struct glyphnamebucket *table[GN_HSIZE];
+};
+
+#ifndef __GNUC__
+# define __inline__
+#endif
+
+static __inline__ int hashname(const char *pt) {
+ int val = 0;
+
+ while ( *pt ) {
+ val = (val<<3)|((val>>29)&0x7);
+ val ^= (unsigned char)(*pt-'!');
+ pt++;
+ }
+ val ^= (val>>16);
+ val &= 0xffff;
+ val %= GN_HSIZE;
+return( val );
+}
+
+static void _GlyphHashFree(SplineFont *sf) {
+ struct glyphnamebucket *test, *next;
+ int i;
+
+ if ( sf->glyphnames==NULL )
+return;
+ for ( i=0; i<GN_HSIZE; ++i ) {
+ for ( test = sf->glyphnames->table[i]; test!=NULL; test = next ) {
+ next = test->next;
+ chunkfree(test,sizeof(struct glyphnamebucket));
+ }
+ }
+ free(sf->glyphnames);
+ sf->glyphnames = NULL;
+}
+
+void GlyphHashFree(SplineFont *sf) {
+ _GlyphHashFree(sf);
+ if ( sf->cidmaster )
+ _GlyphHashFree(sf->cidmaster);
+}
+
+static void GlyphHashCreate(SplineFont *sf) {
+ int i, k, hash;
+ SplineFont *_sf;
+ struct glyphnamehash *gnh;
+ struct glyphnamebucket *new;
+
+ if ( sf->glyphnames!=NULL )
+return;
+ sf->glyphnames = gnh = gcalloc(1,sizeof(*gnh));
+ k = 0;
+ do {
+ _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
+ /* I walk backwards because there are some ttf files where multiple */
+ /* glyphs get the same name. In the cases I've seen only one of these */
+ /* has an encoding. That's the one we want. It will be earlier in the */
+ /* font than the others. If we build the list backwards then it will */
+ /* be the top name in the bucket, and will be the one we return */
+ for ( i=_sf->glyphcnt-1; i>=0; --i ) if ( _sf->glyphs[i]!=NULL ) {
+ new = chunkalloc(sizeof(struct glyphnamebucket));
+ new->sc = _sf->glyphs[i];
+ hash = hashname(new->sc->name);
+ new->next = gnh->table[hash];
+ gnh->table[hash] = new;
+ }
+ ++k;
+ } while ( k<sf->subfontcnt );
+}
+
+void SFHashGlyph(SplineFont *sf,SplineChar *sc) {
+ /* sc just got added to the font. Put it in the lookup */
+ int hash;
+ struct glyphnamebucket *new;
+
+ if ( sf->glyphnames==NULL )
+return; /* No hash table, nothing to update */
+
+ new = chunkalloc(sizeof(struct glyphnamebucket));
+ new->sc = sc;
+ hash = hashname(sc->name);
+ new->next = sf->glyphnames->table[hash];
+ sf->glyphnames->table[hash] = new;
+}
+
+SplineChar *SFHashName(SplineFont *sf,const char *name) {
+ struct glyphnamebucket *test;
+
+ if ( sf->glyphnames==NULL )
+ GlyphHashCreate(sf);
+
+ for ( test=sf->glyphnames->table[hashname(name)]; test!=NULL; test = test->next )
+ if ( strcmp(test->sc->name,name)==0 )
+return( test->sc );
+
+return( NULL );
+}
+
+/* Find the position in the glyph list where this code point/name is found. */
+/* Returns -1 else on error */
+int SFFindGID(SplineFont *sf, int unienc, const char *name ) {
+ struct altuni *altuni;
+ int gid;
+ SplineChar *sc;
+
+ if ( unienc!=-1 ) {
+ for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( sf->glyphs[gid]!=NULL ) {
+ if ( sf->glyphs[gid]->unicodeenc == unienc )
+return( gid );
+ for ( altuni = sf->glyphs[gid]->altuni; altuni!=NULL; altuni=altuni->next ) {
+ if ( altuni->unienc == unienc && altuni->vs==-1 && altuni->fid==0 )
+return( gid );
+ }
+ }
+ }
+ if ( name!=NULL ) {
+ sc = SFHashName(sf,name);
+ if ( sc!=NULL )
+return( sc->orig_pos );
+ }
+
+return ( -1 );
+}
+
+/* Find the position in the current encoding where this code point/name should*/
+/* be found. (or for unencoded glyphs where it is found). Returns -1 else */
+int SFFindSlot(SplineFont *sf, EncMap *map, int unienc, const char *name ) {
+ int index=-1, pos;
+ struct cidmap *cidmap;
+
+ if ( sf->cidmaster!=NULL && !map->enc->is_compact &&
+ (cidmap = FindCidMap(sf->cidmaster->cidregistry,
+ sf->cidmaster->ordering,
+ sf->cidmaster->supplement,
+ sf->cidmaster))!=NULL )
+ index = NameUni2CID(cidmap,unienc,name);
+ if ( index!=-1 )
+ /* All done */;
+ else if ( (map->enc->is_custom || map->enc->is_compact ||
+ map->enc->is_original) && unienc!=-1 ) {
+ if ( unienc<map->enccount && map->map[unienc]!=-1 &&
+ sf->glyphs[map->map[unienc]]!=NULL &&
+ sf->glyphs[map->map[unienc]]->unicodeenc==unienc )
+ index = unienc;
+ else for ( index = map->enccount-1; index>=0; --index ) {
+ if ( (pos = map->map[index])!=-1 && sf->glyphs[pos]!=NULL &&
+ sf->glyphs[pos]->unicodeenc==unienc )
+ break;
+ }
+ } else if ( unienc!=-1 &&
+ ((unienc<0x10000 && map->enc->is_unicodebmp) ||
+ (unienc<0x110000 && map->enc->is_unicodefull))) {
+ index = unienc;
+ } else if ( unienc!=-1 ) {
+ index = EncFromUni(unienc,map->enc);
+ if ( index<0 || index>=map->enccount ) {
+ for ( index=map->enc->char_cnt; index<map->enccount; ++index )
+ if ( (pos = map->map[index])!=-1 && sf->glyphs[pos]!=NULL &&
+ sf->glyphs[pos]->unicodeenc==unienc )
+ break;
+ if ( index>=map->enccount )
+ index = -1;
+ }
+ }
+ if ( index==-1 && name!=NULL ) {
+ SplineChar *sc = SFHashName(sf,name);
+ if ( sc!=NULL ) index = map->backmap[sc->orig_pos];
+ if ( index==-1 ) {
+ unienc = UniFromName(name,sf->uni_interp,map->enc);
+ if ( unienc!=-1 )
+return( SFFindSlot(sf,map,unienc,NULL));
+ if ( map->enc->psnames!=NULL ) {
+ for ( index = map->enc->char_cnt-1; index>=0; --index )
+ if ( map->enc->psnames[index]!=NULL &&
+ strcmp(map->enc->psnames[index],name)==0 )
+return( index );
+ }
+ }
+ }
+
+return( index );
+}
+
+int SFCIDFindCID(SplineFont *sf, int unienc, const char *name ) {
+ int j,ret;
+ struct cidmap *cidmap;
+
+ if ( sf->cidmaster!=NULL || sf->subfontcnt!=0 ) {
+ if ( sf->cidmaster!=NULL )
+ sf=sf->cidmaster;
+ cidmap = FindCidMap(sf->cidregistry,sf->ordering,sf->supplement,sf);
+ ret = NameUni2CID(cidmap,unienc,name);
+ if ( ret!=-1 )
+return( ret );
+ }
+
+ if ( sf->subfonts==NULL && sf->cidmaster==NULL )
+return( SFFindGID(sf,unienc,name));
+
+ if ( sf->cidmaster!=NULL )
+ sf=sf->cidmaster;
+ for ( j=0; j<sf->subfontcnt; ++j )
+ if (( ret = SFFindGID(sf,unienc,name))!=-1 )
+return( ret );
+
+return( -1 );
+}
+
+int SFHasCID(SplineFont *sf,int cid) {
+ int i;
+ /* What subfont (if any) contains this cid? */
+ if ( sf->cidmaster!=NULL )
+ sf=sf->cidmaster;
+ for ( i=0; i<sf->subfontcnt; ++i )
+ if ( cid<sf->subfonts[i]->glyphcnt &&
+ SCWorthOutputting(sf->subfonts[i]->glyphs[cid]) )
+return( i );
+ for ( i=0; i<sf->subfontcnt; ++i )
+ if ( cid<sf->subfonts[i]->glyphcnt && sf->subfonts[i]->glyphs[cid]!=NULL )
+return( i );
+
+return( -1 );
+}
+
+SplineChar *SFGetChar(SplineFont *sf, int unienc, const char *name ) {
+ int ind;
+ int j;
+
+ ind = SFCIDFindCID(sf,unienc,name);
+ if ( ind==-1 )
+return( NULL );
+
+ if ( sf->subfonts==NULL && sf->cidmaster==NULL )
+return( sf->glyphs[ind]);
+
+ if ( sf->cidmaster!=NULL )
+ sf=sf->cidmaster;
+
+ j = SFHasCID(sf,ind);
+ if ( j==-1 )
+return( NULL );
+
+return( sf->subfonts[j]->glyphs[ind] );
+}
+
+static int _SFFindExistingSlot(SplineFont *sf, int unienc, const char *name ) {
+ int gid = -1;
+ struct altuni *altuni;
+
+ if ( unienc!=-1 ) {
+ for ( gid=sf->glyphcnt-1; gid>=0; --gid ) if ( sf->glyphs[gid]!=NULL ) {
+ if ( sf->glyphs[gid]->unicodeenc==unienc )
+ break;
+ for ( altuni=sf->glyphs[gid]->altuni ; altuni!=NULL &&
+ (altuni->unienc!=unienc || altuni->vs!=-1 || altuni->fid!=0);
+ altuni=altuni->next );
+ if ( altuni!=NULL )
+ break;
+ }
+ }
+ if ( gid==-1 && name!=NULL ) {
+ SplineChar *sc = SFHashName(sf,name);
+ if ( sc==NULL )
+return( -1 );
+ gid = sc->orig_pos;
+ if ( gid<0 || gid>=sf->glyphcnt ) {
+ IError("Invalid glyph location when searching for %s", name );
+return( -1 );
+ }
+ }
+return( gid );
+}
+
+int SFFindExistingSlot(SplineFont *sf, int unienc, const char *name ) {
+ int gid = _SFFindExistingSlot(sf,unienc,name);
+
+ if ( gid==-1 || !SCWorthOutputting(sf->glyphs[gid]) )
+return( -1 );
+
+return( gid );
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libffstamp.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libffstamp.h
new file mode 100644
index 00000000000..b6b19bde1f0
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libffstamp.h
@@ -0,0 +1,3 @@
+#define LibFF_ModTime 1226720169L /* Seconds since 1970 (standard unix time) */
+#define LibFF_ModTime_Str "03:36 GMT 15-Nov-2008"
+#define LibFF_VersionDate 20081115 /* Year, month, day */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libstamp.pre b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libstamp.pre
new file mode 100644
index 00000000000..4670c8b403d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/libstamp.pre
@@ -0,0 +1,103 @@
+#include "pfaedit.h"
+#include "baseviews.h"
+#include "libffstamp.h"
+#include "uiinterface.h"
+
+struct library_version_configuration library_version_configuration = {
+ REPLACE_ME_WITH_MAJOR_VERSION,
+ REPLACE_ME_WITH_MINOR_VERSION,
+ LibFF_ModTime,
+ LibFF_ModTime_Str,
+ LibFF_VersionDate,
+ sizeof(struct library_version_configuration),
+ sizeof(struct splinefont),
+ sizeof(struct splinechar),
+ sizeof(struct fontviewbase),
+ sizeof(struct charviewbase),
+ sizeof(struct cvcontainer),
+
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ 1,
+#else
+ 0,
+#endif
+
+#ifdef FONTFORGE_CONFIG_TYPE3
+ 1,
+#else
+ 0,
+#endif
+
+#ifdef _NO_PYTHON
+ 0,
+#else
+ 1,
+#endif
+ 0xff /* Not currently defined */
+};
+
+/* Returns 0 on success, -1 for a fatal error, 1 for a dangerous condition */
+int check_library_version(Library_Version_Configuration *exe_lib_version, int fatal, int quiet) {
+ if ( exe_lib_version->major > library_version_configuration.major ||
+ ( exe_lib_version->major == library_version_configuration.major &&
+ exe_lib_version->minor > library_version_configuration.minor ) ||
+ exe_lib_version->sizeof_me != library_version_configuration.sizeof_me ||
+ exe_lib_version->sizeof_splinefont != library_version_configuration.sizeof_splinefont ||
+ exe_lib_version->sizeof_splinechar != library_version_configuration.sizeof_splinechar ||
+ exe_lib_version->sizeof_fvbase != library_version_configuration.sizeof_fvbase ||
+ exe_lib_version->sizeof_cvbase != library_version_configuration.sizeof_cvbase ||
+ exe_lib_version->sizeof_cvcontainer != library_version_configuration.sizeof_cvcontainer ||
+ exe_lib_version->config_had_devicetables != library_version_configuration.config_had_devicetables ||
+ exe_lib_version->config_had_multilayer != library_version_configuration.config_had_multilayer ||
+ exe_lib_version->config_had_python != library_version_configuration.config_had_python ||
+ exe_lib_version->mba1 != 0xff ) {
+ if ( !quiet ) {
+ IError("This executable will not work with this version of libfontforge\nSee the console log for more details." );
+ if ( exe_lib_version->major > library_version_configuration.major ||
+ ( exe_lib_version->major == library_version_configuration.major &&
+ exe_lib_version->minor > library_version_configuration.minor ))
+ fprintf( stderr, "Library version number is too small for executable.\n" );
+ if ( exe_lib_version->sizeof_me != library_version_configuration.sizeof_me )
+ fprintf( stderr, "Configuration info in the executable has a different size than that\n expected by the library and is not to be trusted.\n" );
+ if ( exe_lib_version->sizeof_splinefont != library_version_configuration.sizeof_splinefont )
+ fprintf( stderr, "The internal data structure, SplineFont, has a different expected size\n in library and executable. So they will not work together.\n" );
+ if ( exe_lib_version->sizeof_splinechar != library_version_configuration.sizeof_splinechar )
+ fprintf( stderr, "The internal data structure, SplineChar, has a different expected size\n in library and executable. So they will not work together.\n" );
+ if ( exe_lib_version->sizeof_fvbase != library_version_configuration.sizeof_fvbase )
+ fprintf( stderr, "The internal data structure, FontViewBase, has a different expected size\n in library and executable. So they will not work together.\n" );
+ if ( exe_lib_version->sizeof_cvbase != library_version_configuration.sizeof_cvbase )
+ fprintf( stderr, "The internal data structure, CharViewBase, has a different expected size\n in library and executable. So they will not work together.\n" );
+ if ( exe_lib_version->sizeof_cvcontainer != library_version_configuration.sizeof_cvcontainer )
+ fprintf( stderr, "The internal data structure, CVContainer, has a different expected size\n in library and executable. So they will not work together.\n" );
+ if ( exe_lib_version->config_had_devicetables != library_version_configuration.config_had_devicetables ) {
+ if ( !exe_lib_version->config_had_devicetables )
+ fprintf( stderr, "The library is configured to support device tables, but the executable is\n not. This may explain why data structures are of different sizes.\n" );
+ else
+ fprintf( stderr, "The executable is configured to support device tables, but the library is\n not. This may explain why data structures are of different sizes.\n" );
+ }
+ if ( exe_lib_version->config_had_multilayer != library_version_configuration.config_had_multilayer ) {
+ if ( !exe_lib_version->config_had_multilayer )
+ fprintf( stderr, "The library is configured to support type3 font editing, but the executable is\n not. This may explain why data structures are of different sizes.\n" );
+ else
+ fprintf( stderr, "The executable is configured to support type3 font editing, but the library is\n not. This may explain why data structures are of different sizes.\n" );
+ }
+ if ( exe_lib_version->config_had_python != library_version_configuration.config_had_python ) {
+ if ( !exe_lib_version->config_had_python )
+ fprintf( stderr, "The library is configured to support python scripts, but the executable is\n not. This may explain why data structures are of different sizes.\n" );
+ else
+ fprintf( stderr, "The executable is configured to support python scripts, but the library is\n not. This may explain why data structures are of different sizes.\n" );
+ }
+ if ( exe_lib_version->mba1 != 0xff )
+ fprintf( stderr, "The executable specifies a configuration value the library does not expect.\n" );
+ }
+ if ( fatal )
+exit( 1 );
+ else
+return( -1 );
+ } else if ( exe_lib_version->library_source_modtime > library_version_configuration.library_source_modtime ) {
+ if ( !quiet )
+ ff_post_notice(_("Library may be too old"),_("The library is older than the executable expects.\n This might be ok.\nOr it may crash on you.\nYou have been warned." ));
+return( 1 );
+ } else
+return( 0 );
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
new file mode 100644
index 00000000000..df31efd5c16
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.c
@@ -0,0 +1,4468 @@
+/* Copyright (C) 2007,2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h"
+#include <chardata.h>
+#include <utype.h>
+#include <ustring.h>
+#include <math.h>
+#include <locale.h>
+#include <stdlib.h>
+#include "ttf.h"
+#include "lookups.h"
+
+struct opentype_feature_friendlynames friendlies[] = {
+#if 0 /* They get stuffed into the 'MATH' table now */
+/* I added these first three features to allow round-trip conversion of tfm files */
+ { CHR('I','T','L','C'), "ITLC", N_("Italic Correction"), gpos_single_mask },
+ { CHR('T','C','H','L'), "TCHL", N_("TeX Glyphlist"), gsub_alternate_mask },
+ { CHR('T','E','X','L'), "TEXL", N_("TeX Extension List"), gsub_multiple_mask },
+#endif
+/* Normal OpenType features follow */
+ { CHR('a','a','l','t'), "aalt", N_("Access All Alternates"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('a','b','v','f'), "abvf", N_("Above Base Forms"), gsub_single_mask },
+ { CHR('a','b','v','m'), "abvm", N_("Above Base Mark"), gpos_mark2base_mask|gpos_mark2ligature_mask },
+ { CHR('a','b','v','s'), "abvs", N_("Above Base Substitutions"), gsub_ligature_mask },
+ { CHR('a','f','r','c'), "afrc", N_("Vertical Fractions"), gsub_ligature_mask },
+ { CHR('a','k','h','n'), "akhn", N_("Akhand"), gsub_ligature_mask },
+ { CHR('a','l','i','g'), "alig", N_("Ancient Ligatures"), gsub_ligature_mask },
+ { CHR('b','l','w','f'), "blwf", N_("Below Base Forms"), gsub_ligature_mask },
+ { CHR('b','l','w','m'), "blwm", N_("Below Base Mark"), gpos_mark2base_mask|gpos_mark2ligature_mask },
+ { CHR('b','l','w','s'), "blws", N_("Below Base Substitutions"), gsub_ligature_mask },
+ { CHR('c','2','p','c'), "c2pc", N_("Capitals to Petite Capitals"), gsub_single_mask },
+ { CHR('c','2','s','c'), "c2sc", N_("Capitals to Small Capitals"), gsub_single_mask },
+ { CHR('c','a','l','t'), "calt", N_("Contextual Alternates"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('c','a','s','e'), "case", N_("Case-Sensitive Forms"), gsub_single_mask|gpos_single_mask },
+ { CHR('c','c','m','p'), "ccmp", N_("Glyph Composition/Decomposition"), gsub_multiple_mask|gsub_ligature_mask },
+ { CHR('c','l','i','g'), "clig", N_("Contextual Ligatures"), gsub_reversecchain_mask },
+ { CHR('c','p','c','t'), "cpct", N_("Centered CJK Punctuation"), gpos_single_mask },
+ { CHR('c','p','s','p'), "cpsp", N_("Capital Spacing"), gpos_single_mask },
+ { CHR('c','s','w','h'), "cswh", N_("Contextual Swash"), gsub_reversecchain_mask },
+ { CHR('c','u','r','s'), "curs", N_("Cursive Attachment"), gpos_cursive_mask },
+ { CHR('c','v','0','0'), "cv00", N_("Character Variants 00"), gsub_single_mask },
+ { CHR('c','v','0','1'), "cv01", N_("Character Variants 01"), gsub_single_mask },
+ { CHR('c','v','0','2'), "cv02", N_("Character Variants 02"), gsub_single_mask },
+ { CHR('c','v','0','3'), "cv03", N_("Character Variants 03"), gsub_single_mask },
+ { CHR('c','v','0','4'), "cv04", N_("Character Variants 04"), gsub_single_mask },
+ { CHR('c','v','0','5'), "cv05", N_("Character Variants 05"), gsub_single_mask },
+ { CHR('c','v','0','6'), "cv06", N_("Character Variants 06"), gsub_single_mask },
+ { CHR('c','v','0','7'), "cv07", N_("Character Variants 07"), gsub_single_mask },
+ { CHR('c','v','0','8'), "cv08", N_("Character Variants 08"), gsub_single_mask },
+ { CHR('c','v','0','9'), "cv09", N_("Character Variants 09"), gsub_single_mask },
+ { CHR('c','v','1','0'), "cv10", N_("Character Variants 10"), gsub_single_mask },
+ { CHR('c','v','9','9'), "cv99", N_("Character Variants 99"), gsub_single_mask },
+ { CHR('d','c','a','p'), "dcap", N_("Drop Caps"), gsub_single_mask },
+ { CHR('d','i','s','t'), "dist", N_("Distance"), gpos_pair_mask },
+ { CHR('d','l','i','g'), "dlig", N_("Discretionary Ligatures"), gsub_ligature_mask },
+ { CHR('d','n','o','m'), "dnom", N_("Denominators"), gsub_single_mask },
+ { CHR('d','p','n','g'), "dpng", N_("Dipthongs (Obsolete)"), gsub_ligature_mask },
+ { CHR('e','x','p','t'), "expt", N_("Expert Forms"), gsub_single_mask },
+ { CHR('f','a','l','t'), "falt", N_("Final Glyph On Line"), gsub_alternate_mask },
+ { CHR('f','i','n','2'), "fin2", N_("Terminal Forms #2"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('f','i','n','3'), "fin3", N_("Terminal Forms #3"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('f','i','n','a'), "fina", N_("Terminal Forms"), gsub_single_mask },
+ { CHR('f','l','a','c'), "flac", N_("Flattened Accents over Capitals"), gsub_single_mask|gsub_ligature_mask },
+ { CHR('f','r','a','c'), "frac", N_("Diagonal Fractions"), gsub_single_mask|gsub_ligature_mask },
+ { CHR('f','w','i','d'), "fwid", N_("Full Widths"), gsub_single_mask|gpos_single_mask },
+ { CHR('h','a','l','f'), "half", N_("Half Forms"), gsub_ligature_mask },
+ { CHR('h','a','l','n'), "haln", N_("Halant Forms"), gsub_ligature_mask },
+ { CHR('h','a','l','t'), "halt", N_("Alternative Half Widths"), gpos_single_mask },
+ { CHR('h','i','s','t'), "hist", N_("Historical Forms"), gsub_single_mask },
+ { CHR('h','k','n','a'), "hkna", N_("Horizontal Kana Alternatives"), gsub_single_mask },
+ { CHR('h','l','i','g'), "hlig", N_("Historic Ligatures"), gsub_ligature_mask },
+ { CHR('h','n','g','l'), "hngl", N_("Hanja to Hangul"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('h','o','j','o'), "hojo", N_("Hojo (JIS X 0212-1990) Kanji Forms"), gsub_single_mask },
+ { CHR('h','w','i','d'), "hwid", N_("Half Widths"), gsub_single_mask|gpos_single_mask },
+ { CHR('i','n','i','t'), "init", N_("Initial Forms"), gsub_single_mask },
+ { CHR('i','s','o','l'), "isol", N_("Isolated Forms"), gsub_single_mask },
+ { CHR('i','t','a','l'), "ital", N_("Italics"), gsub_single_mask },
+ { CHR('j','a','l','t'), "jalt", N_("Justification Alternatives"), gsub_alternate_mask },
+ { CHR('j','a','j','p'), "jajp", N_("Japanese Forms (Obsolete"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('j','p','7','8'), "jp78", N_("JIS78 Forms"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('j','p','8','3'), "jp83", N_("JIS83 Forms"), gsub_single_mask },
+ { CHR('j','p','9','0'), "jp90", N_("JIS90 Forms"), gsub_single_mask },
+ { CHR('k','e','r','n'), "kern", N_("Horizontal Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask|kern_statemachine_mask },
+ { CHR('l','f','b','d'), "lfbd", N_("Left Bounds"), gpos_single_mask },
+ { CHR('l','i','g','a'), "liga", N_("Standard Ligatures"), gsub_ligature_mask },
+ { CHR('l','j','m','o'), "ljmo", N_("Leading Jamo Forms"), gsub_ligature_mask },
+ { CHR('l','n','u','m'), "lnum", N_("Lining Figures"), gsub_single_mask },
+ { CHR('l','o','c','l'), "locl", N_("Localized Forms"), gsub_single_mask },
+ { CHR('m','a','r','k'), "mark", N_("Mark Positioning"), gpos_mark2base_mask|gpos_mark2ligature_mask },
+ { CHR('m','e','d','2'), "med2", N_("Medial Forms 2"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('m','e','d','i'), "medi", N_("Medial Forms"), gsub_single_mask },
+ { CHR('m','g','r','k'), "mgrk", N_("Mathematical Greek"), gsub_single_mask },
+ { CHR('m','k','m','k'), "mkmk", N_("Mark to Mark"), gpos_mark2mark_mask },
+ { CHR('m','s','e','t'), "mset", N_("Mark Positioning via Substitution"), gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('n','a','l','t'), "nalt", N_("Alternate Annotation Forms"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('n','u','k','t'), "nukt", N_("Nukta Forms"), gsub_ligature_mask },
+ { CHR('n','u','m','r'), "numr", N_("Numerators"), gsub_single_mask },
+ { CHR('o','n','u','m'), "onum", N_("Oldstyle Figures"), gsub_single_mask },
+ { CHR('o','p','b','d'), "opbd", N_("Optical Bounds"), gpos_single_mask },
+ { CHR('o','r','d','n'), "ordn", N_("Ordinals"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('o','r','n','m'), "ornm", N_("Ornaments"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('p','a','l','t'), "palt", N_("Proportional Alternate Metrics"), gpos_single_mask },
+ { CHR('p','c','a','p'), "pcap", N_("Lowercase to Petite Capitals"), gsub_single_mask },
+ { CHR('p','k','n','a'), "pkna", N_("Proportional Kana"), gpos_single_mask },
+ { CHR('p','n','u','m'), "pnum", N_("Proportional Numbers"), gsub_single_mask },
+ { CHR('p','r','e','f'), "pref", N_("Pre Base Forms"), gsub_ligature_mask },
+ { CHR('p','r','e','s'), "pres", N_("Pre Base Substitutions"), gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|morx_context_mask },
+ { CHR('p','s','t','f'), "pstf", N_("Post Base Forms"), gsub_ligature_mask },
+ { CHR('p','s','t','s'), "psts", N_("Post Base Substitutions"), gsub_ligature_mask },
+ { CHR('p','w','i','d'), "pwid", N_("Proportional Width"), gsub_single_mask },
+ { CHR('q','w','i','d'), "qwid", N_("Quarter Widths"), gsub_single_mask|gpos_single_mask },
+ { CHR('r','a','n','d'), "rand", N_("Randomize"), gsub_alternate_mask },
+ { CHR('r','k','r','f'), "rkrf", N_("Rakar Forms"), gsub_ligature_mask },
+ { CHR('r','l','i','g'), "rlig", N_("Required Ligatures"), gsub_ligature_mask },
+ { CHR('r','p','h','f'), "rphf", N_("Reph Form"), gsub_ligature_mask },
+ { CHR('r','t','b','d'), "rtbd", N_("Right Bounds"), gpos_single_mask },
+ { CHR('r','t','l','a'), "rtla", N_("Right to Left Alternates"), gsub_single_mask },
+ { CHR('r','u','b','y'), "ruby", N_("Ruby Notational Forms"), gsub_single_mask },
+ { CHR('s','a','l','t'), "salt", N_("Stylistic Alternatives"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('s','i','n','f'), "sinf", N_("Scientific Inferiors"), gsub_single_mask },
+ { CHR('s','m','c','p'), "smcp", N_("Lowercase to Small Capitals"), gsub_single_mask },
+ { CHR('s','m','p','l'), "smpl", N_("Simplified Forms"), gsub_single_mask },
+ { CHR('s','s','0','1'), "ss01", N_("Style Set 1"), gsub_single_mask },
+ { CHR('s','s','0','2'), "ss02", N_("Style Set 2"), gsub_single_mask },
+ { CHR('s','s','0','3'), "ss03", N_("Style Set 3"), gsub_single_mask },
+ { CHR('s','s','0','4'), "ss04", N_("Style Set 4"), gsub_single_mask },
+ { CHR('s','s','0','5'), "ss05", N_("Style Set 5"), gsub_single_mask },
+ { CHR('s','s','0','6'), "ss06", N_("Style Set 6"), gsub_single_mask },
+ { CHR('s','s','0','7'), "ss07", N_("Style Set 7"), gsub_single_mask },
+ { CHR('s','s','0','8'), "ss08", N_("Style Set 8"), gsub_single_mask },
+ { CHR('s','s','0','9'), "ss09", N_("Style Set 9"), gsub_single_mask },
+ { CHR('s','s','1','0'), "ss10", N_("Style Set 10"), gsub_single_mask },
+ { CHR('s','s','1','1'), "ss11", N_("Style Set 11"), gsub_single_mask },
+ { CHR('s','s','1','2'), "ss12", N_("Style Set 12"), gsub_single_mask },
+ { CHR('s','s','1','3'), "ss13", N_("Style Set 13"), gsub_single_mask },
+ { CHR('s','s','1','4'), "ss14", N_("Style Set 14"), gsub_single_mask },
+ { CHR('s','s','1','5'), "ss15", N_("Style Set 15"), gsub_single_mask },
+ { CHR('s','s','1','6'), "ss16", N_("Style Set 16"), gsub_single_mask },
+ { CHR('s','s','1','7'), "ss17", N_("Style Set 17"), gsub_single_mask },
+ { CHR('s','s','1','8'), "ss18", N_("Style Set 18"), gsub_single_mask },
+ { CHR('s','s','1','9'), "ss19", N_("Style Set 19"), gsub_single_mask },
+ { CHR('s','s','2','0'), "ss20", N_("Style Set 20"), gsub_single_mask },
+ { CHR('s','s','t','y'), "ssty", N_("Script Style"), gsub_single_mask },
+ { CHR('s','u','b','s'), "subs", N_("Subscript"), gsub_single_mask },
+ { CHR('s','u','p','s'), "sups", N_("Superscript"), gsub_single_mask },
+ { CHR('s','w','s','h'), "swsh", N_("Swash"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('t','i','t','l'), "titl", N_("Titling"), gsub_single_mask },
+ { CHR('t','j','m','o'), "tjmo", N_("Trailing Jamo Forms"), gsub_ligature_mask },
+ { CHR('t','n','a','m'), "tnam", N_("Traditional Name Forms"), gsub_single_mask },
+ { CHR('t','n','u','m'), "tnum", N_("Tabular Numbers"), gsub_single_mask },
+ { CHR('t','r','a','d'), "trad", N_("Traditional Forms"), gsub_single_mask|gsub_alternate_mask },
+ { CHR('t','w','i','d'), "twid", N_("Third Widths"), gsub_single_mask|gpos_single_mask },
+ { CHR('u','n','i','c'), "unic", N_("Unicase"), gsub_single_mask },
+ { CHR('v','a','l','t'), "valt", N_("Alternate Vertical Metrics"), gpos_single_mask },
+ { CHR('v','a','t','u'), "vatu", N_("Vattu Variants"), gsub_ligature_mask },
+ { CHR('v','e','r','t'), "vert", N_("Vertical Alternates (obs)"), gsub_single_mask },
+ { CHR('v','h','a','l'), "vhal", N_("Alternate Vertical Half Metrics"), gpos_single_mask },
+ { CHR('v','j','m','o'), "vjmo", N_("Vowel Jamo Forms"), gsub_ligature_mask },
+ { CHR('v','k','n','a'), "vkna", N_("Vertical Kana Alternates"), gsub_single_mask },
+ { CHR('v','k','r','n'), "vkrn", N_("Vertical Kerning"), gpos_pair_mask|gpos_context_mask|gpos_contextchain_mask|kern_statemachine_mask },
+ { CHR('v','p','a','l'), "vpal", N_("Proportional Alternate Vertical Metrics"), gpos_single_mask },
+ { CHR('v','r','t','2'), "vrt2", N_("Vertical Rotation & Alternates"), gsub_single_mask },
+ { CHR('z','e','r','o'), "zero", N_("Slashed Zero"), gsub_single_mask },
+/* This is my hack for setting the "Required feature" field of a script */
+ { CHR(' ','R','Q','D'), " RQD", N_("Required feature"), gsub_single_mask|gsub_multiple_mask|gsub_alternate_mask|gsub_ligature_mask|gsub_context_mask|gsub_contextchain_mask|gsub_reversecchain_mask|morx_context_mask|gpos_single_mask|gpos_pair_mask|gpos_cursive_mask|gpos_mark2base_mask|gpos_mark2ligature_mask|gpos_mark2mark_mask|gpos_context_mask|gpos_contextchain_mask },
+ { 0, NULL, 0, 0 }
+};
+
+static int uint32_cmp(const void *_ui1, const void *_ui2) {
+ if ( *(uint32 *) _ui1 > *(uint32 *)_ui2 )
+return( 1 );
+ if ( *(uint32 *) _ui1 < *(uint32 *)_ui2 )
+return( -1 );
+
+return( 0 );
+}
+
+static int lang_cmp(const void *_ui1, const void *_ui2) {
+ /* The default language is magic, and should come first in the list even */
+ /* if that is not true alphabetical order */
+ if ( *(uint32 *) _ui1 == DEFAULT_LANG )
+return( -1 );
+ if ( *(uint32 *) _ui2 == DEFAULT_LANG )
+return( 1 );
+
+ if ( *(uint32 *) _ui1 > *(uint32 *)_ui2 )
+return( 1 );
+ if ( *(uint32 *) _ui1 < *(uint32 *)_ui2 )
+return( -1 );
+
+return( 0 );
+}
+
+FeatureScriptLangList *FindFeatureTagInFeatureScriptList(uint32 tag, FeatureScriptLangList *fl) {
+
+ while ( fl!=NULL ) {
+ if ( fl->featuretag==tag )
+return( fl );
+ fl = fl->next;
+ }
+return( NULL );
+}
+
+int FeatureTagInFeatureScriptList(uint32 tag, FeatureScriptLangList *fl) {
+
+ while ( fl!=NULL ) {
+ if ( fl->featuretag==tag )
+return( true );
+ fl = fl->next;
+ }
+return( false );
+}
+
+int ScriptInFeatureScriptList(uint32 script, FeatureScriptLangList *fl) {
+ struct scriptlanglist *sl;
+
+ if ( fl==NULL ) /* No features bound to lookup? (nested?) don't restrict by script */
+return( true );
+
+ while ( fl!=NULL ) {
+ for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
+ if ( sl->script == script )
+return( true );
+ }
+ fl = fl->next;
+ }
+return( false );
+}
+
+int FeatureScriptTagInFeatureScriptList(uint32 feature, uint32 script, FeatureScriptLangList *fl) {
+ struct scriptlanglist *sl;
+
+ while ( fl!=NULL ) {
+ if ( fl->featuretag == feature ) {
+ for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
+ if ( sl->script == script )
+return( true );
+ }
+ }
+ fl = fl->next;
+ }
+return( false );
+}
+
+int DefaultLangTagInOneScriptList(struct scriptlanglist *sl) {
+ int l;
+
+ for ( l=0; l<sl->lang_cnt; ++l ) {
+ uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
+ if ( lang==DEFAULT_LANG )
+return( true );
+ }
+return( false );
+}
+
+struct scriptlanglist *DefaultLangTagInScriptList(struct scriptlanglist *sl, int DFLT_ok) {
+
+ while ( sl!=NULL ) {
+ if ( DFLT_ok || sl->script!=DEFAULT_SCRIPT ) {
+ if ( DefaultLangTagInOneScriptList(sl))
+return( sl );
+ }
+ sl = sl->next;
+ }
+return( NULL );
+}
+
+uint32 *SFScriptsInLookups(SplineFont *sf,int gpos) {
+ /* Presumes that either SFFindUnusedLookups or SFFindClearUnusedLookupBits */
+ /* has been called first */
+ /* Since MS will sometimes ignore a script if it isn't found in both */
+ /* GPOS and GSUB we want to return the same script list no matter */
+ /* what the setting of gpos ... so we totally ignore that argument */
+ /* and always look at both sets of lookups */
+
+/* Sergey Malkin from MicroSoft tells me:
+ Each shaping engine in Uniscribe can decide on its requirements for
+ layout tables - some of them require both GSUB and GPOS, in some cases
+ any table present is enough, or it can work without any table.
+
+ Sometimes, purpose of the check is to determine if font is supporting
+ particular script - if required tables are not there font is just
+ rejected by this shaping engine. Sometimes, shaping engine can not just
+ reject the font because there are fonts using older shaping technologies
+ we still have to support, so it uses some logic when to fallback to
+ legacy layout code.
+
+ In your case this is Hebrew, where both tables are required to use
+ OpenType processing. Arabic requires both tables too, Latin requires
+ GSUB to execute GPOS. But in general, if you have both tables you should
+ be safe with any script to get fully featured OpenType shaping.
+
+In other words, if we have a Hebrew font with just GPOS features they won't work,
+and MS will not use the font at all. We must add a GSUB table. In the unlikely
+event that we had a hebrew font with only GSUB it would not work either.
+
+So if we want our lookups to have a chance of executing under Uniscribe we
+better make sure that both tables have the same script set.
+
+(Sergey says we could optimize a little: A Latin GSUB table will run without
+a GPOS, but he says the GPOS won't work without a GSUB.)
+*/
+ int cnt=0, tot=0, i;
+ uint32 *scripts = NULL;
+ OTLookup *test;
+ FeatureScriptLangList *fl;
+ struct scriptlanglist *sl;
+
+ /* So here always give scripts for both (see comment above) no */
+ /* matter what they asked for */
+ for ( gpos=0; gpos<2; ++gpos ) {
+ for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
+ if ( test->unused )
+ continue;
+ for ( fl=test->features; fl!=NULL; fl=fl->next ) {
+ if ( fl->ismac )
+ continue;
+ for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
+ for ( i=0; i<cnt; ++i ) {
+ if ( sl->script==scripts[i] )
+ break;
+ }
+ if ( i==cnt ) {
+ if ( cnt>=tot )
+ scripts = grealloc(scripts,(tot+=10)*sizeof(uint32));
+ scripts[cnt++] = sl->script;
+ }
+ }
+ }
+ }
+ }
+
+ if ( cnt==0 )
+return( NULL );
+
+ /* We want our scripts in alphabetic order */
+ qsort(scripts,cnt,sizeof(uint32),uint32_cmp);
+ /* add a 0 entry to mark the end of the list */
+ if ( cnt>=tot )
+ scripts = grealloc(scripts,(tot+1)*sizeof(uint32));
+ scripts[cnt] = 0;
+return( scripts );
+}
+
+uint32 *SFLangsInScript(SplineFont *sf,int gpos,uint32 script) {
+ /* However, the language lists (I think) are distinct */
+ /* But giving a value of -1 for gpos will give us the set of languages in */
+ /* both tables (for this script) */
+ int cnt=0, tot=0, i, g, l;
+ uint32 *langs = NULL;
+ OTLookup *test;
+ FeatureScriptLangList *fl;
+ struct scriptlanglist *sl;
+
+ for ( g=0; g<2; ++g ) {
+ if (( gpos==0 && g==1 ) || ( gpos==1 && g==0 ))
+ continue;
+ for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
+ if ( test->unused )
+ continue;
+ for ( fl=test->features; fl!=NULL; fl=fl->next ) {
+ for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
+ if ( sl->script==script ) {
+ for ( l=0; l<sl->lang_cnt; ++l ) {
+ unsigned lang;
+ if ( l<MAX_LANG )
+ lang = sl->langs[l];
+ else
+ lang = sl->morelangs[l-MAX_LANG];
+ for ( i=0; i<cnt; ++i ) {
+ if ( lang==langs[i] )
+ break;
+ }
+ if ( i==cnt ) {
+ if ( cnt>=tot )
+ langs = grealloc(langs,(tot+=10)*sizeof(uint32));
+ langs[cnt++] = lang;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if ( cnt==0 ) {
+ /* We add dummy script entries. Because Uniscribe will refuse to */
+ /* process some scripts if they don't have an entry in both GPOS */
+ /* an GSUB. So if a script appears in either table, force it to */
+ /* appear in both. That means we can get scripts with no lookups */
+ /* and hence no languages. It seems that Uniscribe doesn't like */
+ /* that either. So give each such script a dummy default language */
+ /* entry. This is what VOLT does */
+ langs = gcalloc(2,sizeof(uint32));
+ langs[0] = DEFAULT_LANG;
+return( langs );
+ }
+
+ /* We want our languages in alphabetic order */
+ qsort(langs,cnt,sizeof(uint32),lang_cmp);
+ /* add a 0 entry to mark the end of the list */
+ if ( cnt>=tot )
+ langs = grealloc(langs,(tot+1)*sizeof(uint32));
+ langs[cnt] = 0;
+return( langs );
+}
+
+uint32 *SFFeaturesInScriptLang(SplineFont *sf,int gpos,uint32 script,uint32 lang) {
+ int cnt=0, tot=0, i, l, isg;
+ uint32 *features = NULL;
+ OTLookup *test;
+ FeatureScriptLangList *fl;
+ struct scriptlanglist *sl;
+ /* gpos==0 => GSUB, gpos==1 => GPOS, gpos==-1 => both, gpos==-2 => Both & morx & kern */
+
+ if ( sf->cidmaster ) sf=sf->cidmaster;
+ for ( isg = 0; isg<2; ++isg ) {
+ if ( gpos>=0 && isg!=gpos )
+ continue;
+ for ( test = isg ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
+ if ( test->unused )
+ continue;
+ for ( fl=test->features; fl!=NULL; fl=fl->next ) {
+ if ( fl->ismac && gpos!=-2 )
+ continue;
+ if ( script==0xffffffff ) {
+ for ( i=0; i<cnt; ++i ) {
+ if ( fl->featuretag==features[i] )
+ break;
+ }
+ if ( i==cnt ) {
+ if ( cnt>=tot )
+ features = grealloc(features,(tot+=10)*sizeof(uint32));
+ features[cnt++] = fl->featuretag;
+ }
+ } else for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
+ if ( sl->script==script ) {
+ int matched = false;
+ if ( fl->ismac && gpos==-2 )
+ matched = true;
+ else for ( l=0; l<sl->lang_cnt; ++l ) {
+ unsigned testlang;
+ if ( l<MAX_LANG )
+ testlang = sl->langs[l];
+ else
+ testlang = sl->morelangs[l-MAX_LANG];
+ if ( testlang==lang ) {
+ matched = true;
+ break;
+ }
+ }
+ if ( matched ) {
+ for ( i=0; i<cnt; ++i ) {
+ if ( fl->featuretag==features[i] )
+ break;
+ }
+ if ( i==cnt ) {
+ if ( cnt>=tot )
+ features = grealloc(features,(tot+=10)*sizeof(uint32));
+ features[cnt++] = fl->featuretag;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if ( sf->design_size!=0 && gpos ) {
+ /* The 'size' feature is like no other. It has no lookups and so */
+ /* we will never find it in the normal course of events. If the */
+ /* user has specified a design size, then every script/lang combo */
+ /* gets a 'size' feature which contains no lookups but feature */
+ /* params */
+ if ( cnt>=tot )
+ features = grealloc(features,(tot+=2)*sizeof(uint32));
+ features[cnt++] = CHR('s','i','z','e');
+ }
+
+ if ( cnt==0 )
+return( gcalloc(1,sizeof(uint32)) );
+
+ /* We don't care if our features are in alphabetical order here */
+ /* all that matters is whether the complete list of features is */
+ /* ordering here would be irrelevant */
+ /* qsort(features,cnt,sizeof(uint32),uint32_cmp); */
+
+ /* add a 0 entry to mark the end of the list */
+ if ( cnt>=tot )
+ features = grealloc(features,(tot+1)*sizeof(uint32));
+ features[cnt] = 0;
+return( features );
+}
+
+OTLookup **SFLookupsInScriptLangFeature(SplineFont *sf,int gpos,uint32 script,uint32 lang, uint32 feature) {
+ int cnt=0, tot=0, l;
+ OTLookup **lookups = NULL;
+ OTLookup *test;
+ FeatureScriptLangList *fl;
+ struct scriptlanglist *sl;
+
+ for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
+ if ( test->unused )
+ continue;
+ for ( fl=test->features; fl!=NULL; fl=fl->next ) {
+ if ( fl->featuretag==feature ) {
+ for ( sl=fl->scripts ; sl!=NULL; sl=sl->next ) {
+ if ( sl->script==script ) {
+ for ( l=0; l<sl->lang_cnt; ++l ) {
+ unsigned testlang;
+ if ( l<MAX_LANG )
+ testlang = sl->langs[l];
+ else
+ testlang = sl->morelangs[l-MAX_LANG];
+ if ( testlang==lang ) {
+ if ( cnt>=tot )
+ lookups = grealloc(lookups,(tot+=10)*sizeof(OTLookup *));
+ lookups[cnt++] = test;
+ goto found;
+ }
+ }
+ }
+ }
+ }
+ }
+ found:;
+ }
+
+ if ( cnt==0 )
+return( NULL );
+
+ /* lookup order is irrelevant here. might as well leave it in invocation order */
+ /* add a 0 entry to mark the end of the list */
+ if ( cnt>=tot )
+ lookups = grealloc(lookups,(tot+1)*sizeof(OTLookup *));
+ lookups[cnt] = 0;
+return( lookups );
+}
+
+static int LigaturesFirstComponentGID(SplineFont *sf,char *components) {
+ int gid, ch;
+ char *pt;
+
+ for ( pt = components; *pt!='\0' && *pt!=' '; ++pt );
+ ch = *pt; *pt = '\0';
+ gid = SFFindExistingSlot(sf,-1,components);
+ *pt = ch;
+return( gid );
+}
+
+static int PSTValid(SplineFont *sf,PST *pst) {
+ char *start, *pt, ch;
+ int ret;
+ (void)sf;
+ switch ( pst->type ) {
+ case pst_position:
+return( true );
+ case pst_pair:
+return( SCWorthOutputting(SFGetChar(sf,-1,pst->u.pair.paired)) );
+ case pst_substitution: case pst_alternate: case pst_multiple:
+ case pst_ligature:
+ for ( start = pst->u.mult.components; *start ; ) {
+ for ( pt=start; *pt && *pt!=' '; ++pt );
+ ch = *pt; *pt = '\0';
+ ret = SCWorthOutputting(SFGetChar(sf,-1,start));
+ *pt = ch;
+ if ( !ret )
+return( false );
+ if ( ch==0 )
+ start = pt;
+ else
+ start = pt+1;
+ }
+ }
+return( true );
+}
+
+SplineChar **SFGlyphsWithPSTinSubtable(SplineFont *sf,struct lookup_subtable *subtable) {
+ uint8 *used = gcalloc(sf->glyphcnt,sizeof(uint8));
+ SplineChar **glyphs, *sc;
+ int i, k, gid, cnt;
+ KernPair *kp;
+ PST *pst;
+ int ispair = subtable->lookup->lookup_type == gpos_pair;
+ int isliga = subtable->lookup->lookup_type == gsub_ligature;
+ sc = NULL;
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) {
+ if ( ispair ) {
+ for ( k=0; k<2; ++k ) {
+ for ( kp= k ? sc->kerns : sc->vkerns; kp!=NULL ; kp=kp->next ) {
+ if ( !SCWorthOutputting(kp->sc))
+ continue;
+ if ( kp->subtable == subtable ) {
+ used[i] = true;
+ goto continue_;
+ }
+ }
+ }
+ }
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable == subtable && PSTValid(sf,pst)) {
+ if ( !isliga ) {
+ used[i] = true;
+ goto continue_;
+ } else {
+ gid = LigaturesFirstComponentGID(sf,pst->u.lig.components);
+ pst->u.lig.lig = sc;
+ if ( gid!=-1 )
+ used[gid] = true;
+ /* can't continue here. ffi might be "f+f+i" and "ff+i" */
+ /* and we need to mark both "f" and "ff" as used */
+ }
+ }
+ }
+ continue_: ;
+ }
+
+ for ( i=cnt=0 ; i<sf->glyphcnt; ++i )
+ if ( used[i] )
+ ++cnt;
+
+ if ( cnt==0 ) {
+ free(used);
+return( NULL );
+ }
+ glyphs = galloc((cnt+1)*sizeof(SplineChar *));
+ for ( i=cnt=0 ; i<sf->glyphcnt; ++i ) {
+ if ( used[i] )
+ glyphs[cnt++] = sf->glyphs[i];
+ }
+ glyphs[cnt] = NULL;
+ free(used);
+return( glyphs );
+}
+
+SplineChar **SFGlyphsWithLigatureinLookup(SplineFont *sf,struct lookup_subtable *subtable) {
+ uint8 *used = gcalloc(sf->glyphcnt,sizeof(uint8));
+ SplineChar **glyphs, *sc;
+ int i, cnt;
+ PST *pst;
+ sc=NULL;
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sc = sf->glyphs[i]) ) {
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable == subtable ) {
+ used[i] = true;
+ goto continue_;
+ }
+ }
+ continue_: ;
+ }
+
+ for ( i=cnt=0 ; i<sf->glyphcnt; ++i )
+ if ( used[i] )
+ ++cnt;
+
+ if ( cnt==0 ) {
+ free(used);
+return( NULL );
+ }
+
+ glyphs = galloc((cnt+1)*sizeof(SplineChar *));
+ for ( i=cnt=0 ; i<sf->glyphcnt; ++i ) {
+ if ( used[i] )
+ glyphs[cnt++] = sf->glyphs[i];
+ }
+ glyphs[cnt] = NULL;
+ free(used);
+return( glyphs );
+}
+
+void SFFindUnusedLookups(SplineFont *sf) {
+ OTLookup *test;
+ struct lookup_subtable *sub;
+ int gpos;
+ AnchorClass *ac;
+ AnchorPoint *ap;
+ SplineChar *sc;
+ KernPair *kp;
+ PST *pst;
+ int k,gid,isv;
+ SplineFont *_sf = sf;
+ sc=NULL;
+ if ( _sf->cidmaster ) _sf = _sf->cidmaster;
+
+ /* Some things are obvious. If a subtable consists of a kernclass or some */
+ /* such, then obviously it is used. But more distributed info takes more */
+ /* work. So mark anything easy as used, and anything difficult as unused */
+ /* We'll work on the difficult things later */
+ for ( gpos=0; gpos<2; ++gpos ) {
+ for ( test = gpos ? _sf->gpos_lookups : _sf->gsub_lookups; test!=NULL; test = test->next ) {
+ for ( sub = test->subtables; sub!=NULL; sub=sub->next ) {
+ if ( sub->kc!=NULL || sub->fpst!=NULL || sub->sm!=NULL ) {
+ sub->unused = false;
+ continue;
+ }
+ sub->unused = true;
+ /* We'll turn the following bit back on if there turns out */
+ /* to be an anchor class attached to it -- that is subtly */
+ /* different than being unused -- unused will be set if all */
+ /* acs are unused, this bit will be on if there are unused */
+ /* classes that still refer to us. */
+ sub->anchor_classes = false;
+ }
+ }
+ }
+
+ /* To be useful an anchor class must have both at least one base and one mark */
+ /* (for cursive anchors that means at least one entry and at least one exit) */
+ /* Start by assuming the worst */
+ for ( ac = _sf->anchor; ac!=NULL; ac=ac->next )
+ ac->has_mark = ac->has_base = false;
+
+ /* Ok, for each glyph, look at all lookups (or anchor classes) it affects */
+ /* and mark the appropriate parts of them as used */
+ k = 0;
+ do {
+ sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
+ for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( SCWorthOutputting(sc = sf->glyphs[gid]) ) {
+ for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
+ switch ( ap->type ) {
+ case at_mark: case at_centry:
+ ap->anchor->has_mark = true;
+ break;
+ case at_basechar: case at_baselig: case at_basemark:
+ case at_cexit:
+ ap->anchor->has_base = true;
+ break;
+ }
+ }
+ for ( isv=0; isv<2; ++isv ) {
+ for ( kp= isv ? sc->kerns : sc->vkerns ; kp!=NULL; kp=kp->next ) {
+ if ( SCWorthOutputting(kp->sc))
+ kp->subtable->unused = false;
+ }
+ }
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable==NULL )
+ continue;
+ if ( !PSTValid(sf,pst))
+ continue;
+ pst->subtable->unused = false;
+ }
+ }
+ ++k;
+ } while ( k<_sf->subfontcnt );
+
+ /* Finally for any anchor class that has both a mark and a base then it is */
+ /* used, and its lookup is also used */
+ /* Also, even if unused, as long as the anchor class exists we must keep */
+ /* the subtable around */
+ for ( ac = _sf->anchor; ac!=NULL; ac=ac->next ) {
+ ac->subtable->anchor_classes = true;
+ if ( ac->has_mark && ac->has_base )
+ ac->subtable->unused = false;
+ }
+
+ /* Now for each lookup, a lookup is unused if ALL subtables are unused */
+ for ( gpos=0; gpos<2; ++gpos ) {
+ for ( test = gpos ? _sf->gpos_lookups : _sf->gsub_lookups; test!=NULL; test = test->next ) {
+ test->unused = test->empty = true;
+ for ( sub=test->subtables; sub!=NULL; sub=sub->next ) {
+ if ( !sub->unused )
+ test->unused = false;
+ if ( !sub->unused && !sub->anchor_classes ) {
+ test->empty = false;
+ break;
+ }
+ }
+ }
+ }
+}
+
+void SFFindClearUnusedLookupBits(SplineFont *sf) {
+ OTLookup *test;
+ int gpos;
+
+ for ( gpos=0; gpos<2; ++gpos ) {
+ for ( test = gpos ? sf->gpos_lookups : sf->gsub_lookups; test!=NULL; test = test->next ) {
+ test->unused = false;
+ test->empty = false;
+ test->def_lang_checked = false;
+ }
+ }
+}
+
+static void SFRemoveAnchorPointsOfAC(SplineFont *sf,AnchorClass *ac) {
+ int gid;
+ SplineChar *sc;
+ AnchorPoint *ap, *prev, *next;
+
+ for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc = sf->glyphs[gid])!=NULL ) {
+ for ( prev=NULL, ap=sc->anchor; ap!=NULL; ap=next ) {
+ next = ap->next;
+ if ( ap->anchor!=ac )
+ prev = ap;
+ else {
+ if ( prev==NULL )
+ sc->anchor = next;
+ else
+ prev->next = next;
+ ap->next = NULL;
+ AnchorPointsFree(ap);
+ }
+ }
+ }
+}
+
+static void RemoveNestedReferences(SplineFont *sf,int isgpos,OTLookup *dying) {
+ OTLookup *otl;
+ struct lookup_subtable *sub;
+ int i,j,k;
+ (void)dying;
+ for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl = otl->next ) {
+ if ( otl->lookup_type==morx_context ) {
+ for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
+ ASM *sm = sub->sm;
+ if ( sm->type==asm_context ) {
+ for ( i=0; i<sm->state_cnt*sm->class_cnt; ++i ) {
+ struct asm_state *state = &sm->state[i];
+ if ( state->u.context.mark_lookup == otl )
+ state->u.context.mark_lookup = NULL;
+ if ( state->u.context.cur_lookup == otl )
+ state->u.context.cur_lookup = NULL;
+ }
+ }
+ }
+ /* Reverse chaining tables do not reference lookups. The match pattern*/
+ /* is a (exactly one) coverage table, and each glyph in that table */
+ /* as an inline replacement. There is no lookup to do the replacement*/
+ /* (so we ignore it here) */
+ } else if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ||
+ otl->lookup_type==gpos_context || otl->lookup_type==gpos_contextchain ) {
+ for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
+ FPST *fpst = sub->fpst;
+ for ( i=0; i<fpst->rule_cnt; ++i ) {
+ for ( j=0; j<fpst->rules[i].lookup_cnt; ++j ) {
+ if ( fpst->rules[i].lookups[j].lookup == otl ) {
+ for ( k=j+1; k<fpst->rules[i].lookup_cnt; ++k )
+ fpst->rules[i].lookups[k-1] = fpst->rules[i].lookups[k];
+ --fpst->rules[i].lookup_cnt;
+ --j;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void SFRemoveUnusedLookupSubTables(SplineFont *sf,
+ int remove_incomplete_anchorclasses,
+ int remove_unused_lookups) {
+ int gpos;
+ struct lookup_subtable *sub, *subnext, *prev;
+ AnchorClass *ac, *acprev, *acnext;
+ OTLookup *otl, *otlprev, *otlnext;
+ otlprev=NULL;
+ /* Presumes someone has called SFFindUnusedLookups first */
+
+ if ( remove_incomplete_anchorclasses ) {
+ for ( acprev=NULL, ac=sf->anchor; ac!=NULL; ac=acnext ) {
+ acnext = ac->next;
+ if ( ac->has_mark && ac->has_base )
+ acprev = ac;
+ else {
+ SFRemoveAnchorPointsOfAC(sf,ac);
+ ac->next = NULL;
+ AnchorClassesFree(ac);
+ if ( acprev==NULL )
+ sf->anchor = acnext;
+ else
+ acprev = acnext;
+ }
+ }
+ }
+
+ for ( gpos=0; gpos<2; ++gpos ) {
+ for ( otl = gpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL; otl = otlnext ) {
+ otlnext = otl->next;
+ if ( remove_unused_lookups && (otl->empty ||
+ (otl->unused && remove_incomplete_anchorclasses)) ) {
+ if ( otlprev!=NULL )
+ otlprev->next = otlnext;
+ else if ( gpos )
+ sf->gpos_lookups = otlnext;
+ else
+ sf->gsub_lookups = otlnext;
+ RemoveNestedReferences(sf,gpos,otl);
+ OTLookupFree(otl);
+ } else {
+ for ( prev=NULL, sub=otl->subtables; sub!=NULL; sub=subnext ) {
+ subnext = sub->next;
+ if ( sub->unused &&
+ (!sub->anchor_classes ||
+ remove_incomplete_anchorclasses )) {
+ if ( prev==NULL )
+ otl->subtables = subnext;
+ else
+ prev->next = subnext;
+ free(sub->subtable_name);
+ chunkfree(sub,sizeof(*sub));
+ } else
+ prev = sub;
+ }
+ }
+ }
+ }
+}
+
+void SFRemoveLookupSubTable(SplineFont *sf,struct lookup_subtable *sub) {
+ OTLookup *otl = sub->lookup;
+ struct lookup_subtable *subprev, *subtest;
+
+ if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
+
+ if ( sub->sm!=NULL ) {
+ ASM *prev = NULL, *test;
+ for ( test=sf->sm; test!=NULL && test!=sub->sm; prev=test, test=test->next );
+ if ( prev==NULL )
+ sf->sm = sub->sm->next;
+ else
+ prev->next = sub->sm->next;
+ sub->sm->next = NULL;
+ ASMFree(sub->sm);
+ sub->sm = NULL;
+ } else if ( sub->fpst!=NULL ) {
+ FPST *prev = NULL, *test;
+ for ( test=sf->possub; test!=NULL && test!=sub->fpst; prev=test, test=test->next );
+ if ( prev==NULL )
+ sf->possub = sub->fpst->next;
+ else
+ prev->next = sub->fpst->next;
+ sub->fpst->next = NULL;
+ FPSTFree(sub->fpst);
+ sub->fpst = NULL;
+ } else if ( sub->kc!=NULL ) {
+ KernClass *prev = NULL, *test;
+ for ( test=sf->kerns; test!=NULL && test!=sub->kc; prev=test, test=test->next );
+ if ( test!=NULL ) {
+ if ( prev==NULL )
+ sf->kerns = sub->kc->next;
+ else
+ prev->next = sub->kc->next;
+ } else {
+ for ( prev=NULL,test=sf->vkerns; test!=NULL && test!=sub->kc; prev=test, test=test->next );
+ if ( prev==NULL )
+ sf->vkerns = sub->kc->next;
+ else
+ prev->next = sub->kc->next;
+ }
+ sub->kc->next = NULL;
+ KernClassListFree(sub->kc);
+ sub->kc = NULL;
+ } else if ( otl->lookup_type==gpos_cursive || otl->lookup_type==gpos_mark2base ||
+ otl->lookup_type==gpos_mark2ligature || otl->lookup_type==gpos_mark2mark ) {
+ AnchorClass *ac, *acnext;
+ for ( ac=sf->anchor; ac!=NULL; ac=acnext ) {
+ acnext = ac->next;
+ if ( ac->subtable==sub )
+ SFRemoveAnchorClass(sf,ac);
+ }
+ } else {
+ int i,k,v;
+ SplineChar *sc;
+ SplineFont *_sf;
+ PST *pst, *prev, *next;
+ KernPair *kp, *kpprev, *kpnext;
+ k=0; i=0;
+ do {
+ _sf = sf->subfontcnt==0 ? sf : sf->subfonts[i];
+ for ( i=0; i<_sf->glyphcnt; ++i ) if ( (sc=_sf->glyphs[i])!=NULL ) {
+ for ( pst=sc->possub, prev=NULL ; pst!=NULL; pst=next ) {
+ next = pst->next;
+ if ( pst->subtable==sub ) {
+ if ( prev==NULL )
+ sc->possub = next;
+ else
+ prev->next = next;
+ pst->next = NULL;
+ PSTFree(pst);
+ } else
+ prev = pst;
+ }
+ for ( v=0; v<2; ++v ) {
+ for ( kp=v ? sc->vkerns : sc->kerns, kpprev=NULL ; kp!=NULL; kp=kpnext ) {
+ kpnext = kp->next;
+ if ( kp->subtable==sub ) {
+ if ( kpprev!=NULL )
+ kpprev->next = kpnext;
+ else if ( v )
+ sc->vkerns = kpnext;
+ else
+ sc->kerns = kpnext;
+ kp->next = NULL;
+ KernPairsFree(kp);
+ } else
+ kpprev = kp;
+ }
+ }
+ }
+ ++k;
+ } while ( k<sf->subfontcnt );
+ }
+
+ subprev = NULL;
+ for ( subtest = otl->subtables; subtest!=NULL && subtest!=sub; subprev = subtest, subtest=subtest->next );
+ if ( subprev==NULL )
+ otl->subtables = sub->next;
+ else
+ subprev->next = sub->next;
+ free(sub->subtable_name);
+ free(sub->suffix);
+ chunkfree(sub,sizeof(struct lookup_subtable));
+}
+
+void SFRemoveLookup(SplineFont *sf,OTLookup *otl) {
+ OTLookup *test, *prev;
+ int isgpos;
+ struct lookup_subtable *sub, *subnext;
+
+ if ( sf->cidmaster ) sf = sf->cidmaster;
+
+ for ( sub = otl->subtables; sub!=NULL; sub=subnext ) {
+ subnext = sub->next;
+ SFRemoveLookupSubTable(sf,sub);
+ }
+
+ for ( prev=NULL, test=sf->gpos_lookups; test!=NULL && test!=otl; prev=test, test=test->next );
+ if ( test==NULL ) {
+ isgpos = false;
+ for ( prev=NULL, test=sf->gsub_lookups; test!=NULL && test!=otl; prev=test, test=test->next );
+ } else
+ isgpos = true;
+ if ( prev!=NULL )
+ prev->next = otl->next;
+ else if ( isgpos )
+ sf->gpos_lookups = otl->next;
+ else
+ sf->gsub_lookups = otl->next;
+
+ RemoveNestedReferences(sf,isgpos,otl);
+
+ otl->next = NULL;
+ OTLookupFree(otl);
+}
+
+struct lookup_subtable *SFFindLookupSubtable(SplineFont *sf,char *name) {
+ int isgpos;
+ OTLookup *otl;
+ struct lookup_subtable *sub;
+
+ if ( sf->cidmaster ) sf = sf->cidmaster;
+
+ if ( name==NULL )
+return( NULL );
+
+ for ( isgpos=0; isgpos<2; ++isgpos ) {
+ for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups ; otl!=NULL; otl=otl->next ) {
+ for ( sub = otl->subtables; sub!=NULL; sub=sub->next ) {
+ if ( strcmp(name,sub->subtable_name)==0 )
+return( sub );
+ }
+ }
+ }
+return( NULL );
+}
+
+struct lookup_subtable *SFFindLookupSubtableAndFreeName(SplineFont *sf,char *name) {
+ struct lookup_subtable *sub = SFFindLookupSubtable(sf,name);
+ free(name);
+return( sub );
+}
+
+OTLookup *SFFindLookup(SplineFont *sf,char *name) {
+ int isgpos;
+ OTLookup *otl;
+
+ if ( sf->cidmaster ) sf = sf->cidmaster;
+
+ if ( name==NULL )
+return( NULL );
+
+ for ( isgpos=0; isgpos<2; ++isgpos ) {
+ for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups ; otl!=NULL; otl=otl->next ) {
+ if ( strcmp(name,otl->lookup_name)==0 )
+return( otl );
+ }
+ }
+return( NULL );
+}
+
+void FListAppendScriptLang(FeatureScriptLangList *fl,uint32 script_tag,uint32 lang_tag) {
+ struct scriptlanglist *sl;
+ int l;
+
+ for ( sl = fl->scripts; sl!=NULL && sl->script!=script_tag; sl=sl->next );
+ if ( sl==NULL ) {
+ sl = chunkalloc(sizeof(struct scriptlanglist));
+ sl->script = script_tag;
+ sl->next = fl->scripts;
+ fl->scripts = sl;
+ }
+ for ( l=0; l<MAX_LANG && l<sl->lang_cnt && sl->langs[l]!=lang_tag; ++l );
+ if ( l>=MAX_LANG && l<sl->lang_cnt ) {
+ while ( l<sl->lang_cnt && sl->morelangs[l-MAX_LANG]!=lang_tag )
+ ++l;
+ }
+ if ( l>=sl->lang_cnt ) {
+ if ( l<MAX_LANG )
+ sl->langs[l] = lang_tag;
+ else {
+ if ( l%MAX_LANG == 0 )
+ sl->morelangs = grealloc(sl->morelangs,l*sizeof(uint32));
+ /* We've just allocated MAX_LANG-1 more than we need */
+ /* so we don't do quite some many allocations */
+ sl->morelangs[l-MAX_LANG] = lang_tag;
+ }
+ ++sl->lang_cnt;
+ }
+}
+
+void FListsAppendScriptLang(FeatureScriptLangList *fl,uint32 script_tag,uint32 lang_tag) {
+ while ( fl!=NULL ) {
+ FListAppendScriptLang(fl,script_tag,lang_tag);
+ fl=fl->next;
+ }
+}
+
+char *SuffixFromTags(FeatureScriptLangList *fl) {
+ static struct { uint32 tag; char *suffix; } tags2suffix[] = {
+ { CHR('v','r','t','2'), "vert" }, /* Will check for vrt2 later */
+ { CHR('o','n','u','m'), "oldstyle" },
+ { CHR('s','u','p','s'), "superior" },
+ { CHR('s','u','b','s'), "inferior" },
+ { CHR('s','w','s','h'), "swash" },
+ { CHR('f','w','i','d'), "full" },
+ { CHR('h','w','i','d'), "hw" },
+ { 0 , NULL }
+ };
+ int i;
+
+ while ( fl!=NULL ) {
+ for ( i=0; tags2suffix[i].tag!=0; ++i )
+ if ( tags2suffix[i].tag==fl->featuretag )
+return( copy( tags2suffix[i].suffix ));
+ fl = fl->next;
+ }
+return( NULL );
+}
+#ifdef LUA_FF_LIB
+/* ma = State Machine, un = Unknown */
+char *lookup_type_names[2][10] =
+ { { "us", "ss", "ms", "as", "ls", "cs", "ks", "es", "rk" },
+ { "up", "sp", "pp", "ca", "mb", "ml", "mm", "cp", "kp","ep" }};
+#else
+char *lookup_type_names[2][10] =
+ { { N_("Undefined substitution"), N_("Single Substitution"), N_("Multiple Substitution"),
+ N_("Alternate Substitution"), N_("Ligature Substitution"), N_("Contextual Substitution"),
+ N_("Contextual Chaining Substitution"), N_("Extension"),
+ N_("Reverse Contextual Chaining Substitution") },
+ { N_("Undefined positioning"), N_("Single Positioning"), N_("Pairwise Positioning (kerning)"),
+ N_("Cursive attachment"), N_("Mark to base attachment"),
+ N_("Mark to Ligature attachment"), N_("Mark to Mark attachment"),
+ N_("Contextual Positioning"), N_("Contextual Chaining Positioning"),
+ N_("Extension") }};
+#endif
+
+/* This is a non-ui based copy of a similar list in lookupui.c */
+static struct {
+ char *text;
+ uint32 tag;
+} localscripts[] = {
+/* GT: See the long comment at "Property|New" */
+/* GT: The msgstr should contain a translation of "Arabic", ignore "Script|" */
+ { N_("Script|Arabic"), CHR('a','r','a','b') },
+ { N_("Script|Aramaic"), CHR('a','r','a','m') },
+ { N_("Script|Armenian"), CHR('a','r','m','n') },
+ { N_("Script|Avestan"), CHR('a','v','e','s') },
+ { N_("Script|Balinese"), CHR('b','a','l','i') },
+ { N_("Script|Batak"), CHR('b','a','t','k') },
+ { N_("Script|Bengali"), CHR('b','e','n','g') },
+ { N_("Script|Bengali2"), CHR('b','n','g','2') },
+ { N_("Bliss Symbolics"), CHR('b','l','i','s') },
+ { N_("Bopomofo"), CHR('b','o','p','o') },
+ { NU_("BrÄhmÄ«"), CHR('b','r','a','h') },
+ { N_("Braille"), CHR('b','r','a','i') },
+ { N_("Script|Buginese"), CHR('b','u','g','i') },
+ { N_("Script|Buhid"), CHR('b','u','h','d') },
+ { N_("Byzantine Music"), CHR('b','y','z','m') },
+ { N_("Canadian Syllabics"), CHR('c','a','n','s') },
+ { N_("Carian"), CHR('c','a','r','i') },
+ { N_("Cherokee"), CHR('c','h','a','m') },
+ { N_("Script|Cham"), CHR('c','h','a','m') },
+ { N_("Script|Cherokee"), CHR('c','h','e','r') },
+ { N_("Cirth"), CHR('c','i','r','t') },
+ { N_("CJK Ideographic"), CHR('h','a','n','i') },
+ { N_("Script|Coptic"), CHR('c','o','p','t') },
+ { N_("Cypro-Minoan"), CHR('c','p','r','t') },
+ { N_("Cypriot syllabary"), CHR('c','p','m','n') },
+ { N_("Cyrillic"), CHR('c','y','r','l') },
+ { N_("Script|Default"), CHR('D','F','L','T') },
+ { N_("Deseret (Mormon)"), CHR('d','s','r','t') },
+ { N_("Devanagari"), CHR('d','e','v','a') },
+ { N_("Devanagari2"), CHR('d','e','v','2') },
+/* { N_("Egyptian demotic"), CHR('e','g','y','d') }, */
+/* { N_("Egyptian hieratic"), CHR('e','g','y','h') }, */
+/* GT: Someone asked if FontForge actually was prepared generate hieroglyph output */
+/* GT: because of this string. No. But OpenType and Unicode have placeholders for */
+/* GT: dealing with these scripts against the day someone wants to use them. So */
+/* GT: FontForge must be prepared to deal with those placeholders if nothing else. */
+/* { N_("Egyptian hieroglyphs"), CHR('e','g','y','p') }, */
+ { N_("Script|Ethiopic"), CHR('e','t','h','i') },
+ { N_("Script|Georgian"), CHR('g','e','o','r') },
+ { N_("Glagolitic"), CHR('g','l','a','g') },
+ { N_("Gothic"), CHR('g','o','t','h') },
+ { N_("Script|Greek"), CHR('g','r','e','k') },
+ { N_("Script|Gujarati"), CHR('g','u','j','r') },
+ { N_("Script|Gujarati2"), CHR('g','j','r','2') },
+ { N_("Gurmukhi"), CHR('g','u','r','u') },
+ { N_("Gurmukhi2"), CHR('g','u','r','2') },
+ { N_("Hangul Jamo"), CHR('j','a','m','o') },
+ { N_("Hangul"), CHR('h','a','n','g') },
+ { NU_("Script|Hanunóo"), CHR('h','a','n','o') },
+ { N_("Script|Hebrew"), CHR('h','e','b','r') },
+/* { N_("Pahawh Hmong"), CHR('h','m','n','g') },*/
+/* { N_("Indus (Harappan)"), CHR('i','n','d','s') },*/
+ { N_("Script|Javanese"), CHR('j','a','v','a') },
+ { N_("Kayah Li"), CHR('k','a','l','i') },
+ { N_("Hiragana & Katakana"), CHR('k','a','n','a') },
+ { NU_("Kharoṣṭhī"), CHR('k','h','a','r') },
+ { N_("Script|Kannada"), CHR('k','n','d','a') },
+ { N_("Script|Kannada2"), CHR('k','n','d','2') },
+ { N_("Script|Khmer"), CHR('k','h','m','r') },
+ { N_("Script|Kharosthi"), CHR('k','h','a','r') },
+ { N_("Script|Lao") , CHR('l','a','o',' ') },
+ { N_("Script|Latin"), CHR('l','a','t','n') },
+ { NU_("Lepcha (Róng)"), CHR('l','e','p','c') },
+ { N_("Script|Limbu"), CHR('l','i','m','b') }, /* Not in ISO 15924 !!!!!, just guessing */
+ { N_("Linear A"), CHR('l','i','n','a') },
+ { N_("Linear B"), CHR('l','i','n','b') },
+ { N_("Lycian"), CHR('l','y','c','i') },
+ { N_("Lydian"), CHR('l','y','d','i') },
+ { N_("Script|Mandaean"), CHR('m','a','n','d') },
+/* { N_("Mayan hieroglyphs"), CHR('m','a','y','a') },*/
+ { NU_("Script|MalayÄlam"), CHR('m','l','y','m') },
+ { NU_("Script|MalayÄlam2"), CHR('m','l','y','2') },
+ { NU_("Mathematical Alphanumeric Symbols"), CHR('m','a','t','h') },
+ { N_("Script|Mongolian"), CHR('m','o','n','g') },
+ { N_("Musical"), CHR('m','u','s','i') },
+ { N_("Script|Myanmar"), CHR('m','y','m','r') },
+ { N_("New Tai Lue"), CHR('t','a','l','u') },
+ { N_("N'Ko"), CHR('n','k','o',' ') },
+ { N_("Ogham"), CHR('o','g','a','m') },
+ { N_("Ol Chiki"), CHR('o','l','c','k') },
+ { N_("Old Italic (Etruscan, Oscan, etc.)"), CHR('i','t','a','l') },
+ { N_("Script|Old Permic"), CHR('p','e','r','m') },
+ { N_("Old Persian cuneiform"), CHR('x','p','e','o') },
+ { N_("Script|Oriya"), CHR('o','r','y','a') },
+ { N_("Script|Oriya2"), CHR('o','r','y','2') },
+ { N_("Osmanya"), CHR('o','s','m','a') },
+ { N_("Script|Pahlavi"), CHR('p','a','l','v') },
+ { N_("Script|Phags-pa"), CHR('p','h','a','g') },
+ { N_("Script|Phoenician"), CHR('p','h','n','x') },
+ { N_("Phaistos"), CHR('p','h','s','t') },
+ { N_("Pollard Phonetic"), CHR('p','l','r','d') },
+ { N_("Rejang"), CHR('r','j','n','g') },
+ { N_("Rongorongo"), CHR('r','o','r','o') },
+ { N_("Runic"), CHR('r','u','n','r') },
+ { N_("Saurashtra"), CHR('s','a','u','r') },
+ { N_("Shavian"), CHR('s','h','a','w') },
+ { N_("Script|Sinhala"), CHR('s','i','n','h') },
+ { N_("Script|Sumero-Akkadian Cuneiform"), CHR('x','s','u','x') },
+ { N_("Script|Sundanese"), CHR('s','u','n','d') },
+ { N_("Script|Syloti Nagri"), CHR('s','y','l','o') },
+ { N_("Script|Syriac"), CHR('s','y','r','c') },
+ { N_("Script|Tagalog"), CHR('t','g','l','g') },
+ { N_("Script|Tagbanwa"), CHR('t','a','g','b') },
+ { N_("Tai Le"), CHR('t','a','l','e') }, /* Not in ISO 15924 !!!!!, just guessing */
+ { N_("Tai Lu"), CHR('t','a','l','a') }, /* Not in ISO 15924 !!!!!, just guessing */
+ { N_("Script|Tamil"), CHR('t','a','m','l') },
+ { N_("Script|Tamil2"), CHR('t','m','l','2') },
+ { N_("Script|Telugu"), CHR('t','e','l','u') },
+ { N_("Script|Telugu2"), CHR('t','e','l','2') },
+ { N_("Tengwar"), CHR('t','e','n','g') },
+ { N_("Thaana"), CHR('t','h','a','a') },
+ { N_("Script|Thai"), CHR('t','h','a','i') },
+ { N_("Script|Tibetan"), CHR('t','i','b','t') },
+ { N_("Tifinagh (Berber)"), CHR('t','f','n','g') },
+ { N_("Script|Ugaritic"), CHR('u','g','r','t') }, /* Not in ISO 15924 !!!!!, just guessing */
+ { N_("Script|Vai"), CHR('v','a','i',' ') },
+/* { N_("Visible Speech"), CHR('v','i','s','p') },*/
+ { N_("Cuneiform, Ugaritic"), CHR('x','u','g','a') },
+ { N_("Script|Yi") , CHR('y','i',' ',' ') },
+/* { N_("Private Use Script 1"), CHR('q','a','a','a') },*/
+/* { N_("Private Use Script 2"), CHR('q','a','a','b') },*/
+/* { N_("Undetermined Script"), CHR('z','y','y','y') },*/
+/* { N_("Uncoded Script"), CHR('z','z','z','z') },*/
+ { NULL, 0 }
+};
+
+void LookupInit(void) {
+ static int done = false;
+ int i, j;
+
+ if ( done )
+return;
+ done = true;
+ for ( j=0; j<2; ++j ) {
+ for ( i=0; i<10; ++i )
+ if ( lookup_type_names[j][i]!=NULL )
+ lookup_type_names[j][i] = S_((char *) lookup_type_names[j][i]);
+ }
+ for ( i=0; localscripts[i].text!=NULL; ++i )
+ localscripts[i].text = S_(localscripts[i].text);
+ for ( i=0; friendlies[i].friendlyname!=NULL; ++i )
+ friendlies[i].friendlyname = S_(friendlies[i].friendlyname);
+}
+
+char *TagFullName(SplineFont *sf,uint32 tag, int ismac, int onlyifknown) {
+ char ubuf[200], *end = ubuf+sizeof(ubuf), *setname;
+ int k;
+
+ if ( ismac==-1 )
+ /* Guess */
+ ismac = (tag>>24)<' ' || (tag>>24)>0x7e;
+
+ if ( ismac ) {
+ sprintf( ubuf, "<%d,%d> ", (int) (tag>>16),(int) (tag&0xffff) );
+ if ( (setname = PickNameFromMacName(FindMacSettingName(sf,tag>>16,tag&0xffff)))!=NULL ) {
+ strcat( ubuf, setname );
+ free( setname );
+ }
+ } else {
+ unsigned stag = tag;
+ if ( tag==CHR('n','u','t','f') ) /* early name that was standardize later as... */
+ stag = CHR('a','f','r','c'); /* Stood for nut fractions. "nut" meaning "fits in an en" in old typography-speak => vertical fractions rather than diagonal ones */
+ if ( tag==REQUIRED_FEATURE ) {
+ strcpy(ubuf,_("Required Feature"));
+ } else {
+ LookupInit();
+ for ( k=0; friendlies[k].tag!=0; ++k ) {
+ if ( friendlies[k].tag == stag )
+ break;
+ }
+ ubuf[0] = '\'';
+ ubuf[1] = tag>>24;
+ ubuf[2] = (tag>>16)&0xff;
+ ubuf[3] = (tag>>8)&0xff;
+ ubuf[4] = tag&0xff;
+ ubuf[5] = '\'';
+ ubuf[6] = ' ';
+ if ( friendlies[k].tag!=0 )
+ strncpy(ubuf+7, (char *) friendlies[k].friendlyname,end-ubuf-7);
+ else if ( onlyifknown )
+return( NULL );
+ else
+ ubuf[7]='\0';
+ }
+ }
+return( copy( ubuf ));
+}
+
+
+void NameOTLookup(OTLookup *otl,SplineFont *sf) {
+ char *userfriendly = NULL, *script;
+ FeatureScriptLangList *fl;
+ char *lookuptype;
+ char *format;
+ struct lookup_subtable *subtable;
+ int k;
+ (void)sf;
+
+ LookupInit();
+
+ if ( otl->lookup_name==NULL ) {
+ for ( k=0; k<2; ++k ) {
+#ifndef LUA_FF_LIB
+ for ( fl=otl->features; fl!=NULL ; fl=fl->next ) {
+ /* look first for a feature attached to a default language */
+ if ( k==1 || DefaultLangTagInScriptList(fl->scripts,false)!=NULL ) {
+ userfriendly = TagFullName(sf,fl->featuretag, fl->ismac, true);
+ if ( userfriendly!=NULL )
+ break;
+ }
+ }
+ if ( userfriendly!=NULL )
+ break;
+#endif
+ }
+ if ( userfriendly==NULL ) {
+ if ( (otl->lookup_type&0xff)>= 0xf0 )
+#ifdef LUA_FF_LIB
+ lookuptype = "ma";
+#else
+ lookuptype = _("State Machine");
+#endif
+ else if ( (otl->lookup_type>>8)<2 && (otl->lookup_type&0xff)<10 )
+ lookuptype = _(lookup_type_names[otl->lookup_type>>8][otl->lookup_type&0xff]);
+ else
+#ifdef LUA_FF_LIB
+ lookuptype = "un";
+#else
+ lookuptype = S_("LookupType|Unknown");
+#endif
+ for ( fl=otl->features; fl!=NULL && !fl->ismac; fl=fl->next );
+ if ( fl==NULL )
+ userfriendly = copy(lookuptype);
+ else {
+ userfriendly = galloc( strlen(lookuptype) + 16);
+#ifdef LUA_FF_LIB
+ if ( (otl->lookup_type&0xff)>= 0xf0 ) {
+ sprintf( userfriendly, "%s_<%d,%d>", lookuptype,
+ (fl->featuretag>>16), (fl->featuretag&0xffff));
+ } else {
+ sprintf( userfriendly, "%s_%c%c%c%c", lookuptype,
+ fl->featuretag>>24,
+ fl->featuretag>>16,
+ fl->featuretag>>8 ,
+ fl->featuretag );
+ }
+#else
+ sprintf( userfriendly, "%s '%c%c%c%c'", lookuptype,
+ fl->featuretag>>24,
+ fl->featuretag>>16,
+ fl->featuretag>>8 ,
+ fl->featuretag );
+#endif
+ }
+ }
+ script = NULL;
+ if ( fl==NULL ) fl = otl->features;
+ if ( fl!=NULL && fl->scripts!=NULL ) {
+ char buf[8];
+ int j;
+ struct scriptlanglist *sl, *found, *found2;
+ uint32 script_tag = fl->scripts->script;
+ found = found2 = NULL;
+ for ( sl = fl->scripts; sl!=NULL; sl=sl->next ) {
+ if ( sl->script == DEFAULT_SCRIPT )
+ /* Ignore it */;
+ else if ( DefaultLangTagInOneScriptList(sl)) {
+ if ( found==NULL )
+ found = sl;
+ else {
+ found = found2 = NULL;
+ break;
+ }
+ } else if ( found2 == NULL )
+ found2 = sl;
+ else
+ found2 = (struct scriptlanglist *) -1;
+ }
+ if ( found==NULL && found2!=NULL && found2 != (struct scriptlanglist *) -1 )
+ found = found2;
+ if ( found!=NULL ) {
+ script_tag = found->script;
+ for ( j=0; localscripts[j].text!=NULL && script_tag!=localscripts[j].tag; ++j );
+#ifdef LUA_FF_LIB
+ buf[0] = fl->scripts->script>>24;
+ buf[1] = (fl->scripts->script>>16)&0xff;
+ buf[2] = (fl->scripts->script>>8)&0xff;
+ buf[3] = fl->scripts->script&0xff;
+ buf[4] = 0;
+ script = copy(buf);
+#else
+ if ( localscripts[j].text!=NULL )
+ script = copy( S_((char *) localscripts[j].text) );
+ else {
+ buf[0] = '\'';
+ buf[1] = fl->scripts->script>>24;
+ buf[2] = (fl->scripts->script>>16)&0xff;
+ buf[3] = (fl->scripts->script>>8)&0xff;
+ buf[4] = fl->scripts->script&0xff;
+ buf[5] = '\'';
+ buf[6] = 0;
+ script = copy(buf);
+ }
+#endif
+ }
+ }
+ if ( script!=NULL ) {
+/* GT: This string is used to generate a name for each OpenType lookup. */
+/* GT: The %s will be filled with the user friendly name of the feature used to invoke the lookup */
+/* GT: The second %s (if present) is the script */
+/* GT: While the %d is the index into the lookup list and is used to disambiguate it */
+/* GT: In case that is needed */
+#ifdef LUA_FF_LIB
+ format = "%s_%s_l_%d";
+#else
+ format = _("%s in %s lookup %d");
+#endif
+ otl->lookup_name = galloc( strlen(userfriendly)+strlen(format)+strlen(script)+10 );
+ sprintf( otl->lookup_name, format, userfriendly, script, otl->lookup_index );
+ } else {
+#ifdef LUA_FF_LIB
+ format = "%s_l_%d";
+#else
+ format = _("%s lookup %d");
+#endif
+ otl->lookup_name = galloc( strlen(userfriendly)+strlen(format)+10 );
+ sprintf( otl->lookup_name, format, userfriendly, otl->lookup_index );
+ }
+ free(script);
+ free(userfriendly);
+ }
+
+ if ( otl->subtables==NULL )
+ /* IError( _("Lookup with no subtables"))*/;
+ else {
+ int cnt = 0;
+ for ( subtable = otl->subtables; subtable!=NULL; subtable=subtable->next, ++cnt )
+ if ( subtable->subtable_name==NULL ) {
+ if ( subtable==otl->subtables && subtable->next==NULL )
+/* GT: This string is used to generate a name for an OpenType lookup subtable. */
+/* GT: %s is the lookup name */
+#ifdef LUA_FF_LIB
+ format = "%s_s";
+#else
+ format = _("%s subtable");
+#endif
+ else if ( subtable->per_glyph_pst_or_kern )
+/* GT: This string is used to generate a name for an OpenType lookup subtable. */
+/* GT: %s is the lookup name, %d is the index of the subtable in the lookup */
+#ifdef LUA_FF_LIB
+ format = "%s_g_%d";
+#else
+ format = _("%s per glyph data %d");
+#endif
+ else if ( subtable->kc!=NULL )
+#ifdef LUA_FF_LIB
+ format = "%s_k_%d";
+#else
+ format = _("%s kerning class %d");
+#endif
+ else if ( subtable->fpst!=NULL )
+#ifdef LUA_FF_LIB
+ format = "%s_c_%d";
+#else
+ format = _("%s contextual %d");
+#endif
+ else if ( subtable->anchor_classes )
+#ifdef LUA_FF_LIB
+ format = "%s_a_%d";
+#else
+ format = _("%s anchor %d");
+#endif
+ else {
+ IError("Subtable status not filled in for %dth subtable of %s", cnt, otl->lookup_name );
+ format = "%s !!!!!!!! %d";
+ }
+ subtable->subtable_name = galloc( strlen(otl->lookup_name)+strlen(format)+10 );
+ sprintf( subtable->subtable_name, format, otl->lookup_name, cnt );
+ }
+ }
+ if ( otl->lookup_type==gsub_ligature ) {
+ for ( fl=otl->features; fl!=NULL; fl=fl->next )
+ if ( fl->featuretag==CHR('l','i','g','a') || fl->featuretag==CHR('r','l','i','g'))
+ otl->store_in_afm = true;
+ }
+
+ if ( otl->lookup_type==gsub_single )
+ for ( subtable = otl->subtables; subtable!=NULL; subtable=subtable->next )
+ subtable->suffix = SuffixFromTags(otl->features);
+}
+
+static void LangOrder(struct scriptlanglist *sl) {
+ int i,j;
+ uint32 lang, lang2;
+
+ for ( i=0; i<sl->lang_cnt; ++i ) {
+ lang = i<MAX_LANG ? sl->langs[i] : sl->morelangs[i-MAX_LANG];
+ for ( j=i+1; j<sl->lang_cnt; ++j ) {
+ lang2 = j<MAX_LANG ? sl->langs[j] : sl->morelangs[j-MAX_LANG];
+ if ( lang>lang2 ) {
+ if ( i<MAX_LANG )
+ sl->langs[i] = lang2;
+ else
+ sl->morelangs[i-MAX_LANG] = lang2;
+ if ( j<MAX_LANG )
+ sl->langs[j] = lang;
+ else
+ sl->morelangs[j-MAX_LANG] = lang;
+ lang = lang2;
+ }
+ }
+ }
+}
+
+static struct scriptlanglist *SLOrder(struct scriptlanglist *sl) {
+ int i,j, cnt;
+ struct scriptlanglist *sl2, *space[30], **allocked=NULL, **test = space;
+
+ for ( sl2=sl, cnt=0; sl2!=NULL; sl2=sl2->next, ++cnt )
+ LangOrder(sl2);
+ if ( cnt<=1 )
+return( sl );
+ if ( cnt>30 )
+ test = allocked = galloc(cnt*sizeof(struct scriptlanglist *));
+ for ( sl2=sl, cnt=0; sl2!=NULL; sl2=sl2->next, ++cnt )
+ test[cnt] = sl2;
+ for ( i=0; i<cnt; ++i ) for ( j=i+1; j<cnt; ++j ) {
+ if ( test[i]->script > test[j]->script ) {
+ struct scriptlanglist *temp;
+ temp = test[i];
+ test[i] = test[j];
+ test[j] = temp;
+ }
+ }
+ sl = test[0];
+ for ( i=1; i<cnt; ++i )
+ test[i-1]->next = test[i];
+ test[i-1]->next = NULL;
+ free( allocked );
+return( sl );
+}
+
+FeatureScriptLangList *FLOrder(FeatureScriptLangList *fl) {
+ int i,j, cnt;
+ FeatureScriptLangList *fl2, *space[30], **allocked=NULL, **test = space;
+
+ for ( fl2=fl, cnt=0; fl2!=NULL; fl2=fl2->next, ++cnt )
+ fl2->scripts = SLOrder(fl2->scripts);
+ if ( cnt<=1 )
+return( fl );
+ if ( cnt>30 )
+ test = allocked = galloc(cnt*sizeof(FeatureScriptLangList *));
+ for ( fl2=fl, cnt=0; fl2!=NULL; fl2=fl2->next, ++cnt )
+ test[cnt] = fl2;
+ for ( i=0; i<cnt; ++i ) for ( j=i+1; j<cnt; ++j ) {
+ if ( test[i]->featuretag > test[j]->featuretag ) {
+ FeatureScriptLangList *temp;
+ temp = test[i];
+ test[i] = test[j];
+ test[j] = temp;
+ }
+ }
+ fl = test[0];
+ for ( i=1; i<cnt; ++i )
+ test[i-1]->next = test[i];
+ test[i-1]->next = NULL;
+ free( allocked );
+return( fl );
+}
+
+struct scriptlanglist *SLCopy(struct scriptlanglist *sl) {
+ struct scriptlanglist *newsl;
+
+ newsl = chunkalloc(sizeof(struct scriptlanglist));
+ *newsl = *sl;
+ newsl->next = NULL;
+
+ if ( sl->lang_cnt>MAX_LANG ) {
+ newsl->morelangs = galloc((newsl->lang_cnt-MAX_LANG)*sizeof(uint32));
+ memcpy(newsl->morelangs,sl->morelangs,(newsl->lang_cnt-MAX_LANG)*sizeof(uint32));
+ }
+return( newsl );
+}
+
+struct scriptlanglist *SListCopy(struct scriptlanglist *sl) {
+ struct scriptlanglist *head=NULL, *last=NULL, *cur;
+
+ for ( ; sl!=NULL; sl=sl->next ) {
+ cur = SLCopy(sl);
+ if ( head==NULL )
+ head = cur;
+ else
+ last->next = cur;
+ last = cur;
+ }
+return( head );
+}
+
+FeatureScriptLangList *FeatureListCopy(FeatureScriptLangList *fl) {
+ FeatureScriptLangList *newfl;
+
+ if ( fl==NULL )
+return( NULL );
+
+ newfl = chunkalloc(sizeof(FeatureScriptLangList));
+ *newfl = *fl;
+ newfl->next = NULL;
+
+ newfl->scripts = SListCopy(fl->scripts);
+return( newfl );
+}
+
+static void LangMerge(struct scriptlanglist *into, struct scriptlanglist *from) {
+ int i,j;
+ uint32 flang, tlang;
+
+ for ( i=0 ; i<from->lang_cnt; ++i ) {
+ flang = i<MAX_LANG ? from->langs[i] : from->morelangs[i-MAX_LANG];
+ for ( j=0; j<into->lang_cnt; ++j ) {
+ tlang = j<MAX_LANG ? into->langs[j] : into->morelangs[j-MAX_LANG];
+ if ( tlang==flang )
+ break;
+ }
+ if ( j==into->lang_cnt ) {
+ if ( into->lang_cnt<MAX_LANG )
+ into->langs[into->lang_cnt++] = flang;
+ else {
+ into->morelangs = grealloc(into->morelangs,(into->lang_cnt+1-MAX_LANG)*sizeof(uint32));
+ into->morelangs[into->lang_cnt++-MAX_LANG] = flang;
+ }
+ }
+ }
+}
+
+void SLMerge(FeatureScriptLangList *into, struct scriptlanglist *fsl) {
+ struct scriptlanglist *isl;
+
+ for ( ; fsl!=NULL; fsl = fsl->next ) {
+ for ( isl=into->scripts; isl!=NULL; isl=isl->next ) {
+ if ( fsl->script==isl->script )
+ break;
+ }
+ if ( isl!=NULL )
+ LangMerge(isl,fsl);
+ else {
+ isl = SLCopy(fsl);
+ isl->next = into->scripts;
+ into->scripts = isl;
+ }
+ }
+}
+
+void FLMerge(OTLookup *into, OTLookup *from) {
+ /* Merge the feature list from "from" into "into" */
+ FeatureScriptLangList *ifl, *ffl;
+
+ /* first check for common featuretags and merge the scripts of each */
+ for ( ffl = from->features; ffl!=NULL; ffl = ffl->next ) {
+ for ( ifl=into->features; ifl!=NULL; ifl=ifl->next ) {
+ if ( ffl->featuretag==ifl->featuretag )
+ break;
+ }
+ if ( ifl!=NULL )
+ SLMerge(ffl,ifl->scripts);
+ else {
+ ifl = FeatureListCopy(ffl);
+ ifl->next = into->features;
+ into->features = ifl;
+ }
+ }
+ into->features = FLOrder(into->features);
+}
+
+void SFSubTablesMerge(SplineFont *_sf,struct lookup_subtable *subfirst,
+ struct lookup_subtable *subsecond) {
+ unsigned lookup_type = subfirst->lookup->lookup_type;
+ int gid,k,isv;
+ SplineChar *sc;
+ SplineFont *sf = _sf;
+ PST *pst, *fpst, *spst, *pstprev, *pstnext;
+ KernPair *fkp, *skp, *kpprev, *kpnext;
+ AnchorClass *ac;
+
+ if ( lookup_type != subsecond->lookup->lookup_type ) {
+ IError("Attempt to merge lookup subtables with mismatch types");
+return;
+ }
+ if ( lookup_type != gsub_single &&
+ lookup_type != gsub_multiple &&
+ lookup_type != gsub_alternate &&
+ lookup_type != gsub_ligature &&
+ lookup_type != gpos_single &&
+ lookup_type != gpos_pair &&
+ lookup_type != gpos_cursive &&
+ lookup_type != gpos_mark2base &&
+ lookup_type != gpos_mark2ligature &&
+ lookup_type != gpos_mark2mark ) {
+ IError("Attempt to merge lookup subtables with bad types");
+return;
+ } else if ( subfirst->kc!=NULL || subsecond->kc != NULL ) {
+ IError("Attempt to merge lookup subtables with kerning classes");
+return;
+ }
+
+ if ( lookup_type==gpos_cursive || lookup_type==gpos_mark2base ||
+ lookup_type==gpos_mark2ligature || lookup_type==gpos_mark2mark ) {
+ for ( ac = sf->anchor; ac!=NULL ; ac=ac->next )
+ if ( ac->subtable == subsecond )
+ ac->subtable = subfirst;
+ } else {
+ k=0;
+ do {
+ sf = _sf->subfontcnt==0 ? _sf : _sf->subfonts[k];
+ for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
+ if ( lookup_type==gsub_single || lookup_type==gsub_multiple ||
+ lookup_type==gsub_alternate || lookup_type==gpos_single ) {
+ fpst = spst = NULL;
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable == subfirst ) {
+ fpst = pst;
+ if ( spst!=NULL )
+ break;
+ } else if ( pst->subtable == subsecond ) {
+ spst = pst;
+ if ( fpst!=NULL )
+ break;
+ }
+ }
+ if ( fpst==NULL && spst!=NULL )
+ spst->subtable = subfirst;
+ else if ( spst!=NULL ) {
+ LogError(_("The glyph, %s, contains a %s from %s and one from %s.\nThe one from %s will be removed.\n"),
+ sc->name,
+ lookup_type==gpos_single ? _("positioning") : _("substitution"),
+ subfirst->subtable_name, subsecond->subtable_name,
+ subsecond->subtable_name );
+ pstprev = NULL;
+ for ( pst=sc->possub; pst!=NULL && pst!=spst; pstprev=pst, pst=pst->next );
+ if ( pstprev==NULL )
+ sc->possub = spst->next;
+ else
+ pstprev = spst->next;
+ spst->next = NULL;
+ PSTFree(spst);
+ }
+ } else if ( lookup_type==gsub_ligature || lookup_type==gpos_pair ) {
+ pstprev = NULL;
+ for ( spst=sc->possub; spst!=NULL ; spst = pstnext ) {
+ pstnext = spst->next;
+ if ( spst->subtable == subsecond ) {
+ for ( fpst=sc->possub; fpst!=NULL; fpst=fpst->next ) {
+ if ( fpst->subtable == subfirst &&
+ strcmp(fpst->u.lig.components,spst->u.lig.components)==0 )
+ break;
+ }
+ if ( fpst==NULL )
+ spst->subtable = subfirst;
+ else {
+ LogError(_("The glyph, %s, contains the same %s from %s and from %s.\nThe one from %s will be removed.\n"),
+ sc->name,
+ lookup_type==gsub_ligature ? _("ligature") : _("kern pair"),
+ subfirst->subtable_name, subsecond->subtable_name,
+ subsecond->subtable_name );
+ if ( pstprev==NULL )
+ sc->possub = pstnext;
+ else
+ pstprev->next = pstnext;
+ spst->next = NULL;
+ PSTFree(spst);
+ spst = pstprev;
+ }
+ }
+ pstprev = spst;
+ }
+ for ( isv=0; isv<2; ++isv ) {
+ kpprev = NULL;
+ for ( skp=isv ? sc->vkerns : sc->kerns; skp!=NULL ; skp = kpnext ) {
+ kpnext = skp->next;
+ if ( skp->subtable == subsecond ) {
+ for ( fkp=isv ? sc->vkerns : sc->kerns; fkp!=NULL; fkp=fkp->next ) {
+ if ( fkp->subtable == subfirst && fkp->sc==skp->sc )
+ break;
+ }
+ if ( fkp==NULL )
+ skp->subtable = subfirst;
+ else {
+ LogError(_("The glyph, %s, contains the same kern pair from %s and from %s.\nThe one from %s will be removed.\n"),
+ sc->name,
+ subfirst->subtable_name, subsecond->subtable_name,
+ subsecond->subtable_name );
+ if ( kpprev!=NULL )
+ kpprev->next = kpnext;
+ else if ( isv )
+ sc->vkerns = kpnext;
+ else
+ sc->kerns = kpnext;
+ skp->next = NULL;
+ KernPairsFree(skp);
+ skp = kpprev;
+ }
+ }
+ kpprev = skp;
+ }
+ }
+ }
+ }
+ ++k;
+ } while ( k<_sf->subfontcnt );
+ }
+}
+
+/* ************************************************************************** */
+/* ******************************* copy lookup ****************************** */
+/* ************************************************************************** */
+
+static char **ClassCopy(int class_cnt,char **classes) {
+ char **newclasses;
+ int i;
+
+ if ( classes==NULL || class_cnt==0 )
+return( NULL );
+ newclasses = galloc(class_cnt*sizeof(char *));
+ for ( i=0; i<class_cnt; ++i )
+ newclasses[i] = copy(classes[i]);
+return( newclasses );
+}
+
+static OTLookup *_OTLookupCopyInto(struct sfmergecontext *mc,
+ OTLookup *from_otl, OTLookup *before, int do_contents);
+static OTLookup *OTLookupCopyNested(struct sfmergecontext *mc,
+ OTLookup *from_otl) {
+ char *newname;
+ OTLookup *to_nested_otl;
+ int l;
+
+ if ( from_otl==NULL )
+return( NULL );
+
+ for ( l=0; l<mc->lcnt; ++l ) {
+ if ( mc->lks[l].from == from_otl )
+return( mc->lks[l].to );
+ }
+
+ newname = strconcat(mc->prefix,from_otl->lookup_name);
+ to_nested_otl = SFFindLookup(mc->sf_to,newname);
+ free(newname);
+ if ( to_nested_otl==NULL )
+ to_nested_otl = _OTLookupCopyInto(mc, from_otl, (OTLookup *) -1, true );
+return( to_nested_otl );
+}
+
+static KernClass *SF_AddKernClass(struct sfmergecontext *mc,KernClass *kc,
+ struct lookup_subtable *sub ) {
+ KernClass *newkc;
+
+ newkc = chunkalloc(sizeof(KernClass));
+ *newkc = *kc;
+ newkc->subtable = sub;
+ if ( sub->vertical_kerning ) {
+ newkc->next = mc->sf_to->vkerns;
+ mc->sf_to->vkerns = newkc;
+ } else {
+ newkc->next = mc->sf_to->kerns;
+ mc->sf_to->kerns = newkc;
+ }
+
+ newkc->firsts = ClassCopy(newkc->first_cnt,newkc->firsts);
+ newkc->seconds = ClassCopy(newkc->second_cnt,newkc->seconds);
+ newkc->offsets = galloc(newkc->first_cnt*newkc->second_cnt*sizeof(int16));
+ memcpy(newkc->offsets,kc->offsets,newkc->first_cnt*newkc->second_cnt*sizeof(int16));
+return( newkc );
+}
+
+static FPST *SF_AddFPST(struct sfmergecontext *mc,FPST *fpst,
+ struct lookup_subtable *sub ) {
+ FPST *newfpst;
+ int i, k, cur;
+
+ newfpst = chunkalloc(sizeof(FPST));
+ *newfpst = *fpst;
+ newfpst->subtable = sub;
+ newfpst->next = mc->sf_to->possub;
+ mc->sf_to->possub = newfpst;
+
+ newfpst->nclass = ClassCopy(newfpst->nccnt,newfpst->nclass);
+ newfpst->bclass = ClassCopy(newfpst->bccnt,newfpst->bclass);
+ newfpst->fclass = ClassCopy(newfpst->fccnt,newfpst->fclass);
+
+ newfpst->rules = galloc(newfpst->rule_cnt*sizeof(struct fpst_rule));
+ memcpy(newfpst->rules,fpst->rules,newfpst->rule_cnt*sizeof(struct fpst_rule));
+
+ cur = 0;
+ for ( i=0; i<newfpst->rule_cnt; ++i ) {
+ struct fpst_rule *r = &newfpst->rules[i], *oldr = &fpst->rules[i];
+
+ r->lookups = galloc(r->lookup_cnt*sizeof(struct seqlookup));
+ memcpy(r->lookups,oldr->lookups,r->lookup_cnt*sizeof(struct seqlookup));
+ for ( k=0; k<r->lookup_cnt; ++k ) {
+ r->lookups[k].lookup = OTLookupCopyNested(mc,
+ r->lookups[k].lookup);
+ }
+
+ switch ( newfpst->format ) {
+ case pst_glyphs:
+ r->u.glyph.names = copy( r->u.glyph.names );
+ r->u.glyph.back = copy( r->u.glyph.back );
+ r->u.glyph.fore = copy( r->u.glyph.fore );
+ break;
+ case pst_class:
+ r->u.class.nclasses = galloc( r->u.class.ncnt*sizeof(uint16));
+ memcpy(r->u.class.nclasses,oldr->u.class.nclasses, r->u.class.ncnt*sizeof(uint16));
+ r->u.class.bclasses = galloc( r->u.class.bcnt*sizeof(uint16));
+ memcpy(r->u.class.bclasses,oldr->u.class.bclasses, r->u.class.ncnt*sizeof(uint16));
+ r->u.class.fclasses = galloc( r->u.class.fcnt*sizeof(uint16));
+ memcpy(r->u.class.fclasses,oldr->u.class.fclasses, r->u.class.fcnt*sizeof(uint16));
+ break;
+ case pst_coverage:
+ r->u.coverage.ncovers = ClassCopy( r->u.coverage.ncnt, r->u.coverage.ncovers );
+ r->u.coverage.bcovers = ClassCopy( r->u.coverage.bcnt, r->u.coverage.bcovers );
+ r->u.coverage.fcovers = ClassCopy( r->u.coverage.fcnt, r->u.coverage.fcovers );
+ break;
+ case pst_reversecoverage:
+ r->u.rcoverage.ncovers = ClassCopy( r->u.rcoverage.always1, r->u.rcoverage.ncovers );
+ r->u.rcoverage.bcovers = ClassCopy( r->u.rcoverage.bcnt, r->u.rcoverage.bcovers );
+ r->u.rcoverage.fcovers = ClassCopy( r->u.rcoverage.fcnt, r->u.rcoverage.fcovers );
+ r->u.rcoverage.replacements = copy( r->u.rcoverage.replacements );
+ break;
+ }
+ }
+return( newfpst );
+}
+
+static ASM *SF_AddASM(struct sfmergecontext *mc,ASM *sm, struct lookup_subtable *sub ) {
+ ASM *newsm;
+ int i;
+
+ newsm = chunkalloc(sizeof(ASM));
+ *newsm = *sm;
+ newsm->subtable = sub;
+ newsm->next = mc->sf_to->sm;
+ mc->sf_to->sm = newsm;
+ mc->sf_to->changed = true;
+ newsm->classes = ClassCopy(newsm->class_cnt, newsm->classes);
+ newsm->state = galloc(newsm->class_cnt*newsm->state_cnt*sizeof(struct asm_state));
+ memcpy(newsm->state,sm->state,
+ newsm->class_cnt*newsm->state_cnt*sizeof(struct asm_state));
+ if ( newsm->type == asm_kern ) {
+ for ( i=newsm->class_cnt*newsm->state_cnt-1; i>=0; --i ) {
+ newsm->state[i].u.kern.kerns = galloc(newsm->state[i].u.kern.kcnt*sizeof(int16));
+ memcpy(newsm->state[i].u.kern.kerns,sm->state[i].u.kern.kerns,newsm->state[i].u.kern.kcnt*sizeof(int16));
+ }
+ } else if ( newsm->type == asm_insert ) {
+ for ( i=0; i<newsm->class_cnt*newsm->state_cnt; ++i ) {
+ struct asm_state *this = &newsm->state[i];
+ this->u.insert.mark_ins = copy(this->u.insert.mark_ins);
+ this->u.insert.cur_ins = copy(this->u.insert.cur_ins);
+ }
+ } else if ( newsm->type == asm_context ) {
+ for ( i=0; i<newsm->class_cnt*newsm->state_cnt; ++i ) {
+ newsm->state[i].u.context.mark_lookup = OTLookupCopyNested(mc,
+ newsm->state[i].u.context.mark_lookup);
+ newsm->state[i].u.context.cur_lookup = OTLookupCopyNested(mc,
+ newsm->state[i].u.context.cur_lookup);
+ }
+ }
+return( newsm );
+}
+
+static SplineChar *SCFindOrMake(SplineFont *into,SplineChar *fromsc) {
+ int to_index;
+
+ if ( into->cidmaster==NULL && into->fv!=NULL ) {
+ to_index = SFFindSlot(into,into->fv->map,fromsc->unicodeenc,fromsc->name);
+ if ( to_index==-1 )
+return( NULL );
+return( SFMakeChar(into,into->fv->map,to_index));
+ }
+return( SFGetChar(into,fromsc->unicodeenc,fromsc->name));
+}
+
+static void SF_SCAddAP(SplineChar *tosc,AnchorPoint *ap, AnchorClass *newac) {
+ AnchorPoint *newap;
+
+ newap = chunkalloc(sizeof(AnchorPoint));
+ *newap = *ap;
+ newap->anchor = newac;
+ newap->next = tosc->anchor;
+ tosc->anchor = newap;
+}
+
+static void SF_AddAnchorClasses(struct sfmergecontext *mc,
+ struct lookup_subtable *from_sub, struct lookup_subtable *sub ) {
+ AnchorClass *ac, *nac;
+ int k, gid;
+ SplineFont *fsf;
+ AnchorPoint *ap;
+ SplineChar *fsc, *tsc;
+
+ for ( ac=mc->sf_from->anchor; ac!=NULL; ac=ac->next ) if ( ac->subtable==from_sub ) {
+ nac = chunkalloc(sizeof(AnchorClass));
+ *nac = *ac;
+ nac->subtable = sub;
+ nac->name = strconcat(mc->prefix,nac->name);
+ nac->next = mc->sf_to->anchor;
+ mc->sf_to->anchor = nac;
+
+ k=0;
+ do {
+ fsf = mc->sf_from->subfontcnt==0 ? mc->sf_from : mc->sf_from->subfonts[k];
+ for ( gid = 0; gid<fsf->glyphcnt; ++gid ) if ( (fsc = fsf->glyphs[gid])!=NULL ) {
+ for ( ap=fsc->anchor; ap!=NULL; ap=ap->next ) {
+ if ( ap->anchor==ac ) {
+ tsc = SCFindOrMake(mc->sf_to,fsc);
+ if ( tsc==NULL )
+ break;
+ SF_SCAddAP(tsc,ap,nac);
+ }
+ }
+ }
+ ++k;
+ } while ( k<mc->sf_from->subfontcnt );
+ }
+}
+
+static int SF_SCAddPST(SplineChar *tosc,PST *pst,struct lookup_subtable *sub) {
+ PST *newpst;
+
+ newpst = chunkalloc(sizeof(PST));
+ *newpst = *pst;
+ newpst->subtable = sub;
+ newpst->next = tosc->possub;
+ tosc->possub = newpst;
+
+ switch( newpst->type ) {
+ case pst_pair:
+ newpst->u.pair.paired = copy(pst->u.pair.paired);
+ newpst->u.pair.vr = chunkalloc(sizeof(struct vr [2]));
+ memcpy(newpst->u.pair.vr,pst->u.pair.vr,sizeof(struct vr [2]));
+ break;
+ case pst_ligature:
+ newpst->u.lig.lig = tosc;
+ /* Fall through */
+ case pst_substitution:
+ case pst_alternate:
+ case pst_multiple:
+ newpst->u.subs.variant = copy(pst->u.subs.variant);
+ break;
+ }
+return( true );
+}
+
+static int SF_SCAddKP(SplineChar *tosc,KernPair *kp,struct lookup_subtable *sub,
+ int isvkern, SplineFont *to_sf ) {
+ SplineChar *tosecond;
+ KernPair *newkp;
+
+ tosecond = SFGetChar(to_sf,kp->sc->unicodeenc,kp->sc->name);
+ if ( tosecond==NULL )
+return( false );
+
+ newkp = chunkalloc(sizeof(KernPair));
+ *newkp = *kp;
+ newkp->subtable = sub;
+ newkp->sc = tosecond;
+ if ( isvkern ) {
+ newkp->next = tosc->vkerns;
+ tosc->vkerns = newkp;
+ } else {
+ newkp->next = tosc->kerns;
+ tosc->kerns = newkp;
+ }
+return(true);
+}
+
+static void SF_AddPSTKern(struct sfmergecontext *mc,struct lookup_subtable *from_sub, struct lookup_subtable *sub) {
+ int k, gid, isv;
+ SplineFont *fsf;
+ SplineChar *fsc, *tsc;
+ PST *pst;
+ KernPair *kp;
+ int iskern = sub->lookup->lookup_type==gpos_pair;
+
+ k=0;
+ do {
+ fsf = mc->sf_from->subfontcnt==0 ? mc->sf_from : mc->sf_from->subfonts[k];
+ for ( gid = 0; gid<fsf->glyphcnt; ++gid ) if ( (fsc = fsf->glyphs[gid])!=NULL ) {
+ tsc = (SplineChar *) -1;
+ for ( pst = fsc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable==from_sub ) {
+ if ( tsc==(SplineChar *) -1 ) {
+ tsc = SCFindOrMake(mc->sf_to,fsc);
+ if ( tsc==NULL )
+ break;
+ }
+ SF_SCAddPST(tsc,pst,sub);
+ }
+ }
+ if ( tsc!=NULL && iskern ) {
+ for ( isv=0; isv<2 && tsc!=NULL; ++isv ) {
+ for ( kp= isv ? fsc->vkerns : fsc->kerns; kp!=NULL; kp=kp->next ) {
+ if ( kp->subtable==sub ) {
+ /* Kerning data tend to be individualistic. Only copy if */
+ /* glyphs exist */
+ if ( tsc==(SplineChar *) -1 ) {
+ tsc = SFGetChar(mc->sf_to,fsc->unicodeenc,fsc->name);
+ if ( tsc==NULL )
+ break;
+ }
+ SF_SCAddKP(tsc,kp,sub,isv,mc->sf_to);
+ }
+ }
+ }
+ }
+ }
+ ++k;
+ } while ( k<mc->sf_from->subfontcnt );
+}
+
+int _FeatureOrderId( int isgpos,uint32 tag ) {
+ /* This is the order in which features should be executed */
+
+ if ( !isgpos ) switch ( tag ) {
+/* GSUB ordering */
+ case CHR('c','c','m','p'): /* Must be first? */
+return( -2 );
+ case CHR('l','o','c','l'): /* Language dependent letter forms (serbian uses some different glyphs than russian) */
+return( -1 );
+ case CHR('i','s','o','l'):
+return( 0 );
+ case CHR('j','a','l','t'): /* must come after 'isol' */
+return( 1 );
+ case CHR('f','i','n','a'):
+return( 2 );
+ case CHR('f','i','n','2'):
+ case CHR('f','a','l','t'): /* must come after 'fina' */
+return( 3 );
+ case CHR('f','i','n','3'):
+return( 4 );
+ case CHR('m','e','d','i'):
+return( 5 );
+ case CHR('m','e','d','2'):
+return( 6 );
+ case CHR('i','n','i','t'):
+return( 7 );
+
+ case CHR('r','t','l','a'):
+return( 100 );
+ case CHR('s','m','c','p'): case CHR('c','2','s','c'):
+return( 200 );
+
+ case CHR('r','l','i','g'):
+return( 300 );
+ case CHR('c','a','l','t'):
+return( 301 );
+ case CHR('l','i','g','a'):
+return( 302 );
+ case CHR('d','l','i','g'): case CHR('h','l','i','g'):
+return( 303 );
+ case CHR('c','s','w','h'):
+return( 304 );
+ case CHR('m','s','e','t'):
+return( 305 );
+
+ case CHR('f','r','a','c'):
+return( 306 );
+
+/* Indic processing */
+ case CHR('n','u','k','t'):
+ case CHR('p','r','e','f'):
+return( 301 );
+ case CHR('a','k','h','n'):
+return( 302 );
+ case CHR('r','p','h','f'):
+return( 303 );
+ case CHR('b','l','w','f'):
+return( 304 );
+ case CHR('h','a','l','f'):
+ case CHR('a','b','v','f'):
+return( 305 );
+ case CHR('p','s','t','f'):
+return( 306 );
+ case CHR('v','a','t','u'):
+return( 307 );
+
+ case CHR('p','r','e','s'):
+return( 310 );
+ case CHR('b','l','w','s'):
+return( 311 );
+ case CHR('a','b','v','s'):
+return( 312 );
+ case CHR('p','s','t','s'):
+return( 313 );
+ case CHR('c','l','i','g'):
+return( 314 );
+
+ case CHR('h','a','l','n'):
+return( 320 );
+/* end indic ordering */
+
+ case CHR('a','f','r','c'):
+ case CHR('l','j','m','o'):
+ case CHR('v','j','m','o'):
+return( 350 );
+ case CHR('v','r','t','2'): case CHR('v','e','r','t'):
+return( 1010 ); /* Documented to come last */
+
+/* Unknown things come after everything but vert/vrt2 */
+ default:
+return( 1000 );
+
+ } else switch ( tag ) {
+/* GPOS ordering */
+ case CHR('c','u','r','s'):
+return( 0 );
+ case CHR('d','i','s','t'):
+return( 100 );
+ case CHR('b','l','w','m'):
+return( 201 );
+ case CHR('a','b','v','m'):
+return( 202 );
+ case CHR('k','e','r','n'):
+return( 300 );
+ case CHR('m','a','r','k'):
+return( 400 );
+ case CHR('m','k','m','k'):
+return( 500 );
+/* Unknown things come after everything */
+ default:
+return( 1000 );
+ }
+}
+
+int FeatureOrderId( int isgpos,FeatureScriptLangList *fl ) {
+ int pos = 9999, temp;
+
+ if ( fl==NULL )
+return( 0 );
+
+ while ( fl!=NULL ) {
+ temp = _FeatureOrderId(isgpos,fl->featuretag );
+ if ( temp<pos ) pos = temp;
+ fl = fl->next;
+ }
+return( pos );
+}
+
+void SortInsertLookup(SplineFont *sf, OTLookup *newotl) {
+ int isgpos = newotl->lookup_type>=gpos_start;
+ int pos;
+ OTLookup *prev, *otl;
+
+ pos = FeatureOrderId(isgpos,newotl->features);
+ for ( prev=NULL, otl= isgpos ? sf->gpos_lookups : sf->gsub_lookups ;
+ otl!=NULL && FeatureOrderId(isgpos,newotl->features)<pos;
+ prev = otl, otl=otl->next );
+ newotl->next = otl;
+ if ( prev!=NULL )
+ prev->next = newotl;
+ else if ( isgpos )
+ sf->gpos_lookups = newotl;
+ else
+ sf->gsub_lookups = newotl;
+}
+
+/* Before may be:
+ * A lookup in into_sf, in which case insert new lookup before it
+ * NULL , in which case insert new lookup at end
+ * -1 , in which case insert new lookup at start
+ * -2 , try to guess a good position
+*/
+static void OrderNewLookup(SplineFont *into_sf,OTLookup *otl,OTLookup *before) {
+ int isgpos = otl->lookup_type>=gpos_start;
+ OTLookup **head = isgpos ? &into_sf->gpos_lookups : &into_sf->gsub_lookups;
+ OTLookup *prev;
+
+ if ( before == (OTLookup *) -2 )
+ SortInsertLookup(into_sf,otl);
+ else if ( before == (OTLookup *) -1 || *head==NULL || *head==before ) {
+ otl->next = *head;
+ *head = otl;
+ } else {
+ for ( prev= *head; prev->next!=NULL && prev->next!=before ; prev=prev->next );
+ otl->next = prev->next;
+ prev->next = otl;
+ }
+}
+
+static OTLookup *_OTLookupCopyInto(struct sfmergecontext *mc,
+ OTLookup *from_otl, OTLookup *before, int do_contents) {
+ OTLookup *otl;
+ struct lookup_subtable *sub, *last, *from_sub;
+ int scnt, l;
+
+ for ( l=0; l<mc->lcnt; ++l ) {
+ if ( mc->lks[l].from == from_otl ) {
+ if ( mc->lks[l].old )
+return( mc->lks[l].to );
+ else
+ break;
+ }
+ }
+
+ if ( l>=mc->lmax )
+ mc->lks = grealloc(mc->lks,(mc->lmax += 20)*sizeof(struct lookup_cvt));
+ mc->sf_to->changed = true;
+
+ if ( l>=mc->lcnt ) {
+ otl = chunkalloc(sizeof(OTLookup));
+ *otl = *from_otl;
+ memset(&mc->lks[l],0,sizeof(mc->lks[l]));
+ mc->lks[l].from = from_otl; mc->lks[l].to = otl; ++mc->lcnt;
+ otl->lookup_name = strconcat(mc->prefix,from_otl->lookup_name);
+ otl->features = FeatureListCopy(from_otl->features);
+ otl->next = NULL; otl->subtables = NULL;
+ OrderNewLookup(mc->sf_to,otl,before);
+ if ( !do_contents )
+ FIOTLookupCopyInto(mc->sf_to,mc->sf_from, from_otl, otl, 0, before);
+ } else
+ otl = mc->lks[l].to;
+ if ( !do_contents )
+return( otl );
+
+ last = NULL;
+ scnt = 0;
+ for ( from_sub = from_otl->subtables; from_sub!=NULL; from_sub=from_sub->next ) {
+ sub = chunkalloc(sizeof(struct lookup_subtable));
+ *sub = *from_sub;
+ sub->lookup = otl;
+ sub->subtable_name = strconcat(mc->prefix,from_sub->subtable_name);
+ sub->suffix = copy(sub->suffix);
+ if ( last==NULL )
+ otl->subtables = sub;
+ else
+ last->next = sub;
+ last = sub;
+ if ( from_sub->kc!=NULL )
+ sub->kc = SF_AddKernClass(mc, from_sub->kc, sub);
+ else if ( from_sub->fpst!=NULL )
+ sub->fpst = SF_AddFPST(mc, from_sub->fpst, sub);
+ else if ( from_sub->sm!=NULL )
+ sub->sm = SF_AddASM(mc, from_sub->sm, sub);
+ else if ( from_sub->anchor_classes )
+ SF_AddAnchorClasses(mc, from_sub, sub);
+ else
+ SF_AddPSTKern(mc, from_sub, sub);
+ ++scnt;
+ }
+ FIOTLookupCopyInto(mc->sf_to,mc->sf_from, from_otl, otl, scnt, before);
+return( otl );
+}
+
+static int NeedsPrefix(SplineFont *into_sf,SplineFont *from_sf, OTLookup **list) {
+ struct lookup_subtable *from_sub;
+ int i,j,k;
+ OTLookup *sublist[2];
+
+ sublist[1] = NULL;
+
+ if ( list==NULL || list[0]==NULL )
+return( false );
+ for ( k=0; list[k]!=NULL; ++k ) {
+ OTLookup *from_otl = list[k];
+ if ( SFFindLookup(into_sf,from_otl->lookup_name)!=NULL )
+return( true );
+ for ( from_sub = from_otl->subtables; from_sub!=NULL; from_sub=from_sub->next ) {
+ if ( from_sub->fpst!=NULL ) {
+ for ( i=0; i<from_sub->fpst->rule_cnt; ++i ) {
+ struct fpst_rule *r = &from_sub->fpst->rules[i];
+ for ( j=0; j<r->lookup_cnt; ++j ) {
+ sublist[0] = r->lookups[j].lookup;
+ if ( NeedsPrefix(into_sf,from_sf, sublist))
+return( true );
+ }
+ }
+ } else if ( from_sub->sm!=NULL && from_sub->sm->type==asm_context ) {
+ for ( i=0; i<from_sub->sm->class_cnt*from_sub->sm->state_cnt; ++i ) {
+ sublist[0] = from_sub->sm->state[i].u.context.mark_lookup;
+ if ( NeedsPrefix(into_sf,from_sf,sublist))
+return( true );
+ sublist[0] = from_sub->sm->state[i].u.context.cur_lookup;
+ if ( NeedsPrefix(into_sf,from_sf,sublist))
+return( true );
+ }
+ }
+ }
+ }
+return( false );
+}
+
+OTLookup *OTLookupCopyInto(SplineFont *into_sf,SplineFont *from_sf, OTLookup *from_otl) {
+ OTLookup *newotl, *list[2];
+ struct sfmergecontext mc;
+
+ memset(&mc,0,sizeof(mc));
+ mc.sf_from = from_sf; mc.sf_to = into_sf;
+
+ list[0] = from_otl; list[1] = NULL;
+ mc.prefix = NeedsPrefix(into_sf,from_sf,list)
+ ? strconcat(from_sf->fontname,"-") : copy("");
+ newotl = _OTLookupCopyInto(&mc,from_otl,(OTLookup *) -2,true);
+ free(mc.lks);
+ free(mc.prefix);
+return( newotl );
+}
+
+void OTLookupsCopyInto(SplineFont *into_sf,SplineFont *from_sf,
+ OTLookup **list, OTLookup *before) {
+ int i, do_contents;
+ struct sfmergecontext mc;
+
+ memset(&mc,0,sizeof(mc));
+ mc.sf_from = from_sf; mc.sf_to = into_sf;
+
+ mc.prefix = NeedsPrefix(into_sf,from_sf,list)
+ ? strconcat(from_sf->fontname,"-") : copy("");
+ for ( i=0; list[i]!=NULL; ++i );
+ mc.lks = galloc((mc.lmax=i+5)*sizeof(struct lookup_cvt));
+ /* First create all the lookups and position them in the right order */
+ /* then create subtables (which may in turn create some new lookups */
+ /* for contextual lookups which invoke other lookups, don't care how */
+ /* those nested lookups are ordered) */
+ for ( do_contents=0; do_contents<2; ++do_contents )
+ for ( i=0; list[i]!=NULL; ++i )
+ (void) _OTLookupCopyInto(&mc,list[i],before,do_contents);
+ free(mc.lks);
+ free(mc.prefix);
+}
+
+/* ************************************************************************** */
+/* ****************************** Apply lookups ***************************** */
+/* ************************************************************************** */
+
+struct lookup_data {
+ struct opentype_str *str;
+ int cnt, max;
+
+ uint32 script;
+ SplineFont *sf;
+
+ struct lookup_subtable *lig_owner;
+ int lcnt, lmax;
+ SplineChar ***ligs; /* For each ligature we have an array of SplineChars that are its components preceded by the ligature glyph itself */
+ /* NULL terminated */
+ int pixelsize;
+ double scale;
+};
+
+static int ApplyLookupAtPos(uint32 tag, OTLookup *otl,struct lookup_data *data,int pos);
+
+static int GlyphNameInClass(char *name,char *class ) {
+ char *pt;
+ int len = strlen(name);
+
+ if ( class==NULL )
+return( false );
+
+ pt = class;
+ while ( (pt=strstr(pt,name))!=NULL ) {
+ if ( pt==NULL )
+return( false );
+ if ( (pt==class || pt[-1]==' ') && (pt[len]=='\0' || pt[len]==' '))
+return( true );
+ pt+=len;
+ }
+
+return( false );
+}
+
+/* ************************************************************************** */
+/* ************************ Apply Apple State Machines ********************** */
+/* ************************************************************************** */
+
+static void ApplyMacIndicRearrangement(struct lookup_data *data,int verb,
+ int first_pos,int last_pos) {
+ struct opentype_str temp, temp2, temp3, temp4;
+ int i;
+
+ if ( first_pos==-1 || last_pos==-1 || last_pos <= first_pos )
+return;
+ switch ( verb ) {
+ case 1: /* Ax => xA */
+ temp = data->str[first_pos];
+ for ( i= first_pos; i<last_pos; ++i )
+ data->str[i] = data->str[i+1];
+ data->str[last_pos] = temp;
+ break;
+ case 2: /* xD => Dx */
+ temp = data->str[last_pos];
+ for ( i= last_pos; i>first_pos; --i )
+ data->str[i] = data->str[i-1];
+ data->str[first_pos] = temp;
+ break;
+ case 3: /* AxD => DxA */
+ temp = data->str[last_pos];
+ data->str[last_pos] = data->str[first_pos];
+ data->str[first_pos] = temp;
+ break;
+ case 4: /* ABx => xAB */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ for ( i= first_pos; i<last_pos-1; ++i )
+ data->str[i] = data->str[i+21];
+ data->str[last_pos-1] = temp;
+ data->str[last_pos] = temp2;
+ break;
+ case 5: /* ABx => xBA */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ for ( i= first_pos; i<last_pos-1; ++i )
+ data->str[i] = data->str[i+21];
+ data->str[last_pos-1] = temp2;
+ data->str[last_pos] = temp;
+ break;
+ case 6: /* xCD => CDx */
+ temp = data->str[last_pos];
+ temp2 = data->str[last_pos-1];
+ for ( i= last_pos; i>first_pos+1; --i )
+ data->str[i] = data->str[i-2];
+ data->str[first_pos+1] = temp;
+ data->str[first_pos] = temp2;
+ break;
+ case 7: /* xCD => DCx */
+ temp = data->str[last_pos];
+ temp2 = data->str[last_pos-1];
+ for ( i= last_pos; i>first_pos+1; --i )
+ data->str[i] = data->str[i-2];
+ data->str[first_pos+1] = temp2;
+ data->str[first_pos] = temp;
+ break;
+ case 8: /* AxCD => CDxA */
+ temp = data->str[first_pos];
+ temp2 = data->str[last_pos-1];
+ temp3 = data->str[last_pos];
+ for ( i= last_pos-1; i>first_pos; --i )
+ data->str[i] = data->str[i-1];
+ data->str[first_pos+1] = temp2;
+ data->str[first_pos] = temp3;
+ data->str[last_pos] = temp;
+ break;
+ case 9: /* AxCD => DCxA */
+ temp = data->str[first_pos];
+ temp2 = data->str[last_pos-1];
+ temp3 = data->str[last_pos];
+ for ( i= last_pos-1; i>first_pos; --i )
+ data->str[i] = data->str[i-1];
+ data->str[first_pos+1] = temp3;
+ data->str[first_pos] = temp2;
+ data->str[last_pos] = temp;
+ break;
+ case 10: /* ABxD => DxAB */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ temp3 = data->str[last_pos];
+ for ( i= first_pos+1; i<last_pos; ++i )
+ data->str[i] = data->str[i+1];
+ data->str[first_pos] = temp3;
+ data->str[last_pos-1] = temp;
+ data->str[last_pos] = temp2;
+ break;
+ case 11: /* ABxD => DxBA */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ temp3 = data->str[last_pos];
+ for ( i= first_pos+1; i<last_pos; ++i )
+ data->str[i] = data->str[i+1];
+ data->str[first_pos] = temp3;
+ data->str[last_pos-1] = temp2;
+ data->str[last_pos] = temp;
+ break;
+ case 12: /* ABxCD => CDxAB */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ temp3 = data->str[last_pos-1];
+ temp4 = data->str[last_pos];
+ data->str[last_pos] = temp2;
+ data->str[last_pos-1] = temp;
+ data->str[first_pos+1] = temp4;
+ data->str[first_pos] = temp3;
+ break;
+ case 13: /* ABxCD => CDxBA */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ temp3 = data->str[last_pos-1];
+ temp4 = data->str[last_pos];
+ data->str[last_pos] = temp;
+ data->str[last_pos-1] = temp2;
+ data->str[first_pos+1] = temp4;
+ data->str[first_pos] = temp3;
+ break;
+ case 14: /* ABxCD => DCxAB */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ temp3 = data->str[last_pos-1];
+ temp4 = data->str[last_pos];
+ data->str[last_pos] = temp2;
+ data->str[last_pos-1] = temp;
+ data->str[first_pos+1] = temp3;
+ data->str[first_pos] = temp4;
+ break;
+ case 15: /* ABxCD => DCxBA */
+ temp = data->str[first_pos];
+ temp2 = data->str[first_pos+1];
+ temp3 = data->str[last_pos-1];
+ temp4 = data->str[last_pos];
+ data->str[last_pos] = temp;
+ data->str[last_pos-1] = temp2;
+ data->str[first_pos+1] = temp3;
+ data->str[first_pos] = temp4;
+ break;
+ }
+}
+
+static int ApplyMacInsert(struct lookup_data *data,int ipos,int cnt,
+ char *glyphnames, int orig_index) {
+ SplineChar *inserts[32];
+ char *start, *pt;
+ int i, ch;
+
+ if ( cnt==0 || glyphnames==NULL || ipos == -1 )
+return( 0 );
+
+ for ( i=0, start = glyphnames; i<cnt; ) {
+ while ( *start==' ' ) ++start;
+ if ( *start=='\0' )
+ break;
+ for ( pt = start; *pt!=' ' && *pt!='\0'; ++pt );
+ ch = *pt; *pt = '\0';
+ inserts[i] = SFGetChar(data->sf,-1,start);
+ *pt = ch;
+ if ( inserts[i]!=NULL )
+ ++i;
+ }
+ cnt = i;
+ if ( i==0 )
+return( 0 );
+ for ( i= data->cnt; i>=ipos; --i )
+ data->str[i+cnt] = data->str[i];
+ memset(data->str+ipos,0,cnt*sizeof(struct opentype_str));
+ for ( i=0; i<cnt; ++i ) {
+ data->str[ipos+i].sc = inserts[i];
+ data->str[ipos+i].orig_index = orig_index;
+ }
+return( cnt );
+}
+
+static void ApplyAppleStateMachine(uint32 tag, OTLookup *otl,struct lookup_data *data) {
+ struct lookup_subtable *sub;
+ int state, class, pos, mark_pos, markend_pos, i;
+ ASM *sm;
+ int cnt_cur, cnt_mark;
+ struct asm_state *entry;
+ int kern_stack[8], kcnt; /* Kerning state machines handle at most 8 glyphs */
+ (void)tag;
+ /* Flaws: Line processing has not been done yet, so we are never in the */
+ /* start of line state and we never get an end of line token. We never */
+ /* get deleted tokens either, those glyphs are just gone */
+ /* Class 0: End of text */
+ /* Class 1: Glyph not in any classes */
+ /* Class 2: Deleted (we never see) */
+ /* Class 3: End of line (we never see) */
+ /* Mac doesn't have the concept of subtables, but a user could create one */
+ /* it will get flattened out into its own "lookup" when written to a file*/
+ /* So if there are multiple subtables, just process them all */
+ for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
+ sm = sub->sm;
+
+ state = 0;
+ mark_pos = markend_pos = -1;
+ for ( pos = 0; pos<=data->cnt; ) {
+ if ( pos==data->cnt )
+ class = 0;
+ else {
+ for ( class = sm->class_cnt-1; class>3; --class )
+ if ( GlyphNameInClass(data->str[i].sc->name,sm->classes[class]) )
+ break;
+ if ( class==3 )
+ class = 1; /* Glyph not in any class */;
+ }
+ entry = &sm->state[state*sm->class_cnt+class];
+ switch ( otl->lookup_type ) {
+ case morx_context:
+ if ( entry->u.context.cur_lookup!=NULL )
+ ApplyLookupAtPos(0,entry->u.context.cur_lookup,data,pos);
+ if ( entry->u.context.mark_lookup!=NULL && mark_pos!=-1 ) {
+ ApplyLookupAtPos(0,entry->u.context.mark_lookup,data,mark_pos);
+ mark_pos = -1;
+ }
+ break;
+ case morx_indic:
+ if ( entry->flags & 0x2000 )
+ markend_pos = pos;
+ if ( (entry->flags&0xf)!=0 ) {
+ ApplyMacIndicRearrangement(data,entry->flags&0xf,mark_pos,markend_pos);
+ mark_pos = markend_pos = -1;
+ }
+ break;
+ case morx_insert:
+ /* I live in total ignorance of what I should do if the glyph */
+ /* "is Kashida like"... so I ignore those flags. */
+ cnt_cur = (entry->flags>>5)&0x1f;
+ cnt_mark = (entry->flags&0x1f);
+ if ( data->cnt + cnt_cur + cnt_mark >= data->max )
+ data->str = grealloc(data->str,(data->max = data->cnt + cnt_cur + cnt_mark +20)*sizeof(struct opentype_str));
+ if ( cnt_cur!=0 )
+ cnt_cur = ApplyMacInsert(data,(entry->flags& 0x0800)? pos : pos+1,
+ cnt_cur,entry->u.insert.cur_ins,data->str[pos].orig_index);
+ if ( cnt_mark!=0 && mark_pos!=-1 ) {
+ cnt_mark = ApplyMacInsert(data,(entry->flags& 0x0800)? mark_pos : mark_pos+1,
+ cnt_mark,entry->u.insert.mark_ins,data->str[mark_pos].orig_index);
+ mark_pos = -1;
+ } else
+ cnt_mark = 0;
+ pos += cnt_cur+cnt_mark;
+ break;
+ case kern_statemachine:
+ if ( entry->u.kern.kcnt!=0 ) {
+ for ( i=0; i<kcnt && i<entry->u.kern.kcnt; ++i )
+ data->str[kern_stack[i]].vr.h_adv_off +=
+ entry->u.kern.kerns[i];
+ kcnt = 0;
+ }
+ if ( entry->flags & 0x8000 ) {
+ for ( i=6; i>=0; --i )
+ kern_stack[i+1] = kern_stack[i];
+ kern_stack[0] = pos;
+ if ( ++kcnt>8 ) kcnt = 8;
+ }
+ break;
+ default: /* for -W */
+ break;
+ }
+ if ( entry->flags & 0x8000 )
+ mark_pos = pos; /* The docs do not state whether this happens before or after substitutions are applied at the mark */
+ /* after is more useful. So assume that */
+ if ( !(entry->flags & 0x4000) )
+ ++pos;
+ state = entry->next_state;
+ }
+ }
+}
+
+/* ************************************************************************** */
+/* ************************* Apply OpenType Lookups ************************* */
+/* ************************************************************************** */
+
+static void LigatureFree(struct lookup_data *data) {
+ int i;
+
+ if ( data->ligs==NULL )
+return;
+ for ( i=0; data->ligs[i]!=NULL; ++i )
+ free(data->ligs[i]);
+}
+
+static void LigatureSearch(struct lookup_subtable *sub, struct lookup_data *data) {
+ SplineFont *sf = data->sf;
+ int gid, ccnt, cnt, ch, err;
+ SplineChar *sc;
+ PST *pst;
+ char *pt, *start;
+
+ LigatureFree(data);
+ cnt = 0;
+ for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) if ( pst->subtable==sub ) {
+ for ( pt = pst->u.lig.components, ccnt=0; *pt; ++pt )
+ if ( *pt==' ' )
+ ++ccnt;
+ if ( cnt>=data->lmax )
+ data->ligs = grealloc(data->ligs,(data->lmax+=100)*sizeof(SplineChar **));
+ data->ligs[cnt] = galloc((ccnt+3)*sizeof(SplineChar *));
+ data->ligs[cnt][0] = sc;
+ ccnt = 1;
+ err = 0;
+ for ( pt = pst->u.lig.components; *pt; ) {
+ while ( *pt==' ' ) ++pt;
+ if ( *pt=='\0' )
+ break;
+ for ( start=pt; *pt!='\0' && *pt!=' '; ++pt );
+ ch = *pt; *pt = '\0';
+ data->ligs[cnt][ccnt++] = SFGetChar(sf,-1,start);
+ *pt = ch;
+ if ( data->ligs[cnt][ccnt-1]==NULL )
+ err = 1;
+ }
+ if ( !err )
+ data->ligs[cnt++][ccnt] = NULL;
+ }
+ }
+ if ( cnt>=data->lmax )
+ data->ligs = grealloc(data->ligs,(data->lmax+=1)*sizeof(SplineChar **));
+ data->ligs[cnt] = NULL;
+ data->lcnt = cnt;
+}
+
+static int skipglyphs(int lookup_flags, struct lookup_data *data, int pos) {
+ int mc, glyph_class;
+ /* The lookup flags tell us what glyphs to ignore. Skip over anything we */
+ /* should ignore */
+
+ if ( lookup_flags==0 )
+return( pos );
+ mc = (lookup_flags>>8);
+ if ( mc<0 || mc>=data->sf->mark_class_cnt )
+ mc = 0;
+ while ( pos<data->cnt ) {
+ glyph_class = gdefclass(data->str[pos].sc);
+ /* 1=>base, 2=>ligature, 3=>mark, 4=>component?, 0=>.notdef */
+ if ( (glyph_class==1 && (lookup_flags&pst_ignorebaseglyphs)) ||
+ (glyph_class==2 && (lookup_flags&pst_ignoreligatures)) ||
+ (glyph_class==3 && (lookup_flags&pst_ignorecombiningmarks)) ||
+ (glyph_class==3 && mc!=0 &&
+ !GlyphNameInClass(data->str[pos].sc->name,data->sf->mark_classes[mc])) ) {
+ ++pos;
+ } else
+ break;
+ }
+return( pos );
+}
+
+static int bskipmarkglyphs(int lookup_flags, struct lookup_data *data, int pos) {
+ int mc, glyph_class;
+ /* The lookup flags tell us what glyphs to ignore. Skip over anything we */
+ /* should ignore. Here we skip backward */
+
+ mc = (lookup_flags>>8);
+ if ( mc<0 || mc>=data->sf->mark_class_cnt )
+ mc = 0;
+ while ( pos>=0 ) {
+ glyph_class = gdefclass(data->str[pos].sc);
+ /* 1=>base, 2=>ligature, 3=>mark, 4=>component?, 0=>.notdef */
+ if ( glyph_class==3 )
+ --pos;
+ else if ( (glyph_class==1 && (lookup_flags&pst_ignorebaseglyphs)) ||
+ (glyph_class==2 && (lookup_flags&pst_ignoreligatures)) ||
+ (glyph_class==3 && (lookup_flags&pst_ignorecombiningmarks)) ||
+ (glyph_class==3 && mc!=0 &&
+ !GlyphNameInClass(data->str[pos].sc->name,data->sf->mark_classes[mc])) ) {
+ --pos;
+ } else
+ break;
+ }
+return( pos );
+}
+
+static int bskipglyphs(int lookup_flags, struct lookup_data *data, int pos) {
+ int mc, glyph_class;
+ /* The lookup flags tell us what glyphs to ignore. Skip over anything we */
+ /* should ignore. Here we skip backward */
+
+ if ( lookup_flags==0 )
+return( pos );
+ mc = (lookup_flags>>8);
+ if ( mc<0 || mc>=data->sf->mark_class_cnt )
+ mc = 0;
+ while ( pos>=0 ) {
+ glyph_class = gdefclass(data->str[pos].sc);
+ /* 1=>base, 2=>ligature, 3=>mark, 4=>component?, 0=>.notdef */
+ if ( (glyph_class==1 && (lookup_flags&pst_ignorebaseglyphs)) ||
+ (glyph_class==2 && (lookup_flags&pst_ignoreligatures)) ||
+ (glyph_class==3 && (lookup_flags&pst_ignorecombiningmarks)) ||
+ (glyph_class==3 && mc!=0 &&
+ !GlyphNameInClass(data->str[pos].sc->name,data->sf->mark_classes[mc])) ) {
+ --pos;
+ } else
+ break;
+ }
+return( pos );
+}
+
+static int ContextualMatch(struct lookup_subtable *sub,struct lookup_data *data,
+ int pos, struct fpst_rule **_rule) {
+ int i, cpos, retpos, r;
+ FPST *fpst = sub->fpst;
+ int lookup_flags = sub->lookup->lookup_flags;
+ char *pt;
+
+ /* If we should skip the current glyph then don't try for a match here */
+ cpos = skipglyphs(lookup_flags,data,pos);
+ if ( cpos!=pos )
+return( 0 );
+
+ for ( r=0; r<fpst->rule_cnt; ++r ) {
+ struct fpst_rule *rule = &fpst->rules[r];
+ for ( i=pos; i<data->cnt; ++i )
+ data->str[i].context_pos = -1;
+
+/* Handle backtrack (backtrace in the rule is stored in reverse textual order) */
+ if ( fpst->type == pst_chainpos || fpst->type == pst_chainsub ) {
+ if ( fpst->format==pst_glyphs ) {
+ pt = rule->u.glyph.back;
+ for ( i=bskipglyphs(lookup_flags,data,pos-1), cpos=0; i>=0; i = bskipglyphs(lookup_flags,data,i-1)) {
+ char *name = data->str[i].sc->name;
+ int len = strlen( name );
+ if ( strncmp(name,pt,len)!=0 || (pt[len]!='\0' && pt[len]!=' '))
+ break;
+ pt += len;
+ while ( *pt==' ' ) ++pt;
+ }
+ if ( *pt!='\0' )
+ continue; /* didn't match */
+ } else if ( fpst->format==pst_class ) {
+ for ( i=bskipglyphs(lookup_flags,data,pos-1), cpos=0; i>=0 && cpos<rule->u.class.bcnt; i = bskipglyphs(lookup_flags,data,i-1)) {
+ if ( !GlyphNameInClass(data->str[i].sc->name,fpst->bclass[rule->u.class.bclasses[cpos]]) )
+ break;
+ ++cpos;
+ }
+ if ( cpos!=rule->u.class.bcnt )
+ continue; /* didn't match */
+ } else if ( fpst->format==pst_coverage ) {
+ for ( i=bskipglyphs(lookup_flags,data,pos-1), cpos=0; i>=0 && cpos<rule->u.coverage.bcnt; i = bskipglyphs(lookup_flags,data,i-1)) {
+ if ( !GlyphNameInClass(data->str[i].sc->name,rule->u.coverage.bcovers[cpos]) )
+ break;
+ ++cpos;
+ }
+ if ( cpos<rule->u.coverage.bcnt )
+ continue; /* didn't match */
+ }
+ }
+/* Handle Match */
+ if ( fpst->format==pst_glyphs ) {
+ pt = rule->u.glyph.names;
+ for ( i=pos, cpos=0; i<data->cnt && *pt!='\0'; i = skipglyphs(lookup_flags,data,i+1)) {
+ char *name = data->str[i].sc->name;
+ int len = strlen( name );
+ if ( strncmp(name,pt,len)!=0 || (pt[len]!='\0' && pt[len]!=' '))
+ break;
+ data->str[i].context_pos = cpos++;
+ pt += len;
+ while ( *pt==' ' ) ++pt;
+ }
+ if ( *pt!='\0' )
+ continue; /* didn't match */
+ } else if ( fpst->format==pst_class ) {
+ for ( i=pos, cpos=0; i<data->cnt && cpos<rule->u.class.ncnt; i = skipglyphs(lookup_flags,data,i+1)) {
+ int class = rule->u.class.nclasses[cpos];
+ if ( class!=0 ) {
+ if ( !GlyphNameInClass(data->str[i].sc->name,fpst->nclass[class]) )
+ break;
+ } else {
+ int c;
+ /* Ok, to match class 0 we must fail to match all other classes */
+ for ( c=1; c<fpst->nccnt; ++c )
+ if ( !GlyphNameInClass(data->str[i].sc->name,fpst->nclass[c]) )
+ break;
+ if ( c!=fpst->nccnt )
+ break; /* It matched another class => not in class 0 */
+ }
+ data->str[i].context_pos = cpos++;
+ }
+ if ( cpos<rule->u.class.ncnt )
+ continue; /* didn't match */
+ } else if ( fpst->format==pst_coverage ) {
+ for ( i=pos, cpos=0; i<data->cnt && cpos<rule->u.coverage.ncnt; i = skipglyphs(lookup_flags,data,i+1)) {
+ if ( !GlyphNameInClass(data->str[i].sc->name,rule->u.coverage.ncovers[cpos]) )
+ break;
+ data->str[i].context_pos = cpos++;
+ }
+ if ( cpos<rule->u.coverage.ncnt )
+ continue; /* didn't match */
+ } else
+return( 0 ); /* Not ready to deal with reverse chainging */
+
+ retpos = i;
+/* Handle lookahead */
+ if ( fpst->type == pst_chainpos || fpst->type == pst_chainsub ) {
+ if ( fpst->format==pst_glyphs ) {
+ pt = rule->u.glyph.fore;
+ for ( i=retpos; i<data->cnt && *pt!='\0'; i = skipglyphs(lookup_flags,data,i+1)) {
+ char *name = data->str[i].sc->name;
+ int len = strlen( name );
+ if ( strncmp(name,pt,len)!=0 || (pt[len]!='\0' && pt[len]!=' '))
+ break;
+ pt += len;
+ while ( *pt==' ' ) ++pt;
+ }
+ if ( *pt!='\0' )
+ continue; /* didn't match */
+ } else if ( fpst->format==pst_class ) {
+ for ( i=retpos, cpos=0; i<data->cnt && cpos<rule->u.class.fcnt; i = skipglyphs(lookup_flags,data,i+1)) {
+ if ( !GlyphNameInClass(data->str[i].sc->name,fpst->fclass[rule->u.class.fclasses[cpos]]) )
+ break;
+ cpos++;
+ }
+ if ( cpos<rule->u.class.fcnt )
+ continue; /* didn't match */
+ } else if ( fpst->format==pst_coverage ) {
+ for ( i=retpos, cpos=0; i<data->cnt && cpos<rule->u.coverage.fcnt; i = skipglyphs(lookup_flags,data,i+1)) {
+ if ( !GlyphNameInClass(data->str[i].sc->name,rule->u.coverage.fcovers[cpos]) )
+ break;
+ cpos++;
+ }
+ if ( cpos<rule->u.coverage.fcnt )
+ continue; /* didn't match */
+ }
+ }
+ *_rule = rule;
+return( retpos );
+ }
+return( 0 );
+}
+
+static int ApplySingleSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ PST *pst;
+ SplineChar *sc;
+
+ for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
+ if ( pst==NULL )
+return( 0 );
+
+ sc = SFGetChar(data->sf,-1,pst->u.subs.variant);
+ if ( sc!=NULL ) {
+ data->str[pos].sc = sc;
+return( pos+1 );
+ } else if ( strcmp(pst->u.subs.variant,MAC_DELETED_GLYPH_NAME)==0 ) {
+ /* Under AAT we delete the glyph. But OpenType doesn't have that concept */
+ int i;
+ for ( i=pos+1; i<data->cnt; ++i )
+ data->str[pos-1] = data->str[pos];
+ --data->cnt;
+return( pos );
+ } else {
+return( 0 );
+ }
+}
+
+static int ApplyMultSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ PST *pst;
+ SplineChar *sc;
+ char *start, *pt;
+ int mcnt, ch, i;
+ SplineChar *mults[20];
+
+ for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
+ if ( pst==NULL )
+return( 0 );
+
+ mcnt = 0;
+ for ( start = pst->u.alt.components; *start==' '; ++start);
+ for ( ; *start; ) {
+ for ( pt=start; *pt!='\0' && *pt!=' '; ++pt );
+ ch = *pt; *pt = '\0';
+ sc = SFGetChar(data->sf,-1,start);
+ *pt = ch;
+ if ( sc==NULL )
+return( 0 );
+ if ( mcnt<20 ) mults[mcnt++] = sc;
+ while ( *pt==' ' ) ++pt;
+ start = pt;
+ }
+
+ if ( mcnt==0 ) {
+ /* Is this legal? that is can we remove a glyph with an empty multiple? */
+ for ( i=pos+1; i<data->cnt; ++i )
+ data->str[i-1] = data->str[i];
+ --data->cnt;
+return( pos );
+ } else if ( mcnt==1 ) {
+ data->str[pos].sc = mults[0];
+return( pos+1 );
+ } else {
+ if ( data->cnt+mcnt-1 >= data->max )
+ data->str = grealloc(data->str,(data->max+=mcnt) * sizeof( struct opentype_str ));
+ for ( i=data->cnt-1; i>pos; --i )
+ data->str[i+mcnt-1] = data->str[i];
+ memset(data->str+pos,0,mcnt*sizeof(struct opentype_str));
+ for ( i=0; i<mcnt; ++i ) {
+ data->str[pos+i].sc = mults[i];
+ data->str[pos+i].orig_index = data->str[pos].orig_index;
+ }
+ data->cnt += (mcnt-1);
+return( pos+mcnt );
+ }
+}
+
+static int ApplyAltSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ PST *pst;
+ SplineChar *sc;
+ char *start, *pt, ch;
+
+ for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
+ if ( pst==NULL )
+return( 0 );
+
+ for ( start = pst->u.alt.components; *start==' '; ++start);
+ for ( ; *start; ) {
+ for ( pt=start; *pt!='\0' && *pt!=' '; ++pt );
+ ch = *pt; *pt = '\0';
+ sc = SFGetChar(data->sf,-1,start);
+ *pt = ch;
+ if ( sc!=NULL ) {
+ data->str[pos].sc = sc;
+return( pos+1 );
+ }
+ while ( *pt==' ' ) ++pt;
+ start = pt;
+ }
+return( 0 );
+}
+
+static int ApplyLigatureSubsAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ int i,k, lpos, npos;
+ int lookup_flags = sub->lookup->lookup_flags;
+ int match_found = -1, match_len=0;
+
+ if ( data->lig_owner!=sub )
+ LigatureSearch(sub,data);
+ for ( i=0; i<data->lcnt; ++i ) {
+ if ( data->ligs[i][1]==data->str[pos].sc ) {
+ lpos = 0;
+ npos = pos+1;
+ for ( k=2; data->ligs[i][k]!=NULL; ++k ) {
+ npos = skipglyphs(lookup_flags,data,npos);
+ if ( npos>=data->cnt || data->str[npos].sc != data->ligs[i][k] )
+ break;
+ ++npos;
+ }
+ if ( data->ligs[i][k]==NULL ) {
+ if ( match_found==-1 || k>match_len ) {
+ match_found = i;
+ match_len = k;
+ }
+ }
+ }
+ }
+ if ( match_found!=-1 ) {
+ /* Matched. Remove the component glyphs, and note which component */
+ /* any intervening marks should be attached to */
+ data->str[pos].sc = data->ligs[match_found][0];
+ npos = pos+1;
+ for ( k=2; data->ligs[match_found][k]!=NULL; ++k ) {
+ lpos = skipglyphs(lookup_flags,data,npos);
+ for ( ; npos<lpos; ++npos )
+ data->str[npos].lig_pos = k-2;
+ /* Remove this glyph (copy the final NUL too) */
+ for ( ++lpos; lpos<=data->cnt; ++lpos )
+ data->str[lpos-1] = data->str[lpos];
+ --data->cnt;
+ }
+ /* Any marks after the last component (which should be attached */
+ /* to it) will not have been tagged, so do that now */
+ lpos = skipglyphs(lookup_flags,data,npos);
+ for ( ; npos<lpos; ++npos )
+ data->str[npos].lig_pos = k-2;
+return( pos+1 );
+ }
+
+return( 0 );
+}
+
+static int ApplyContextual(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ /* On this level there is no difference between GPOS/GSUB contextuals */
+ /* If the contextual matches, then we apply the lookups, otherwise we */
+ /* don't. Now the lookups will be different, but we don't care here */
+ struct fpst_rule *rule;
+ int retpos, i,j;
+
+ retpos = ContextualMatch(sub,data,pos,&rule);
+ if ( retpos==0 )
+return( 0 );
+ for ( i=0; i<rule->lookup_cnt; ++i ) {
+ for ( j=pos; j<data->cnt; ++j ) {
+ if ( data->str[j].context_pos == rule->lookups[i].seq ) {
+ ApplyLookupAtPos(0,rule->lookups[i].lookup,data,j);
+ break;
+ }
+ }
+ }
+return( retpos );
+}
+
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+static int FigureDeviceTable(DeviceTable *dt,int pixelsize) {
+
+ if ( dt==NULL || dt->corrections==NULL || pixelsize<dt->first_pixel_size ||
+ pixelsize>dt->last_pixel_size )
+return( 0 );
+
+return( dt->corrections[pixelsize - dt->last_pixel_size] );
+}
+#endif
+
+static int ApplySinglePosAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ PST *pst;
+
+ for ( pst=data->str[pos].sc->possub; pst!=NULL && pst->subtable!=sub; pst=pst->next );
+ if ( pst==NULL )
+return( 0 );
+
+ data->str[pos].vr.xoff += rint( pst->u.pos.xoff * data->scale );
+ data->str[pos].vr.yoff += rint( pst->u.pos.yoff * data->scale );
+ data->str[pos].vr.h_adv_off += rint( pst->u.pos.h_adv_off * data->scale );
+ data->str[pos].vr.v_adv_off += rint( pst->u.pos.v_adv_off * data->scale );
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ if ( pst->u.pos.adjust!=NULL ) {
+ data->str[pos].vr.xoff += FigureDeviceTable(&pst->u.pos.adjust->xadjust,data->pixelsize);
+ data->str[pos].vr.yoff += FigureDeviceTable(&pst->u.pos.adjust->yadjust,data->pixelsize);
+ data->str[pos].vr.h_adv_off += FigureDeviceTable(&pst->u.pos.adjust->xadv,data->pixelsize);
+ data->str[pos].vr.v_adv_off += FigureDeviceTable(&pst->u.pos.adjust->yadv,data->pixelsize);
+ }
+#endif
+return( pos+1 );
+}
+
+static int ApplyPairPosAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ PST *pst;
+ int npos, isv, within;
+ KernPair *kp;
+
+ npos = skipglyphs(sub->lookup->lookup_flags,data,pos+1);
+ if ( npos>=data->cnt )
+return( 0 );
+ if ( sub->kc!=NULL ) {
+ within = KCFindIndex(sub->kc,data->str[pos].sc->name,data->str[npos].sc->name);
+ if ( within==-1 )
+return( 0 );
+ data->str[pos].kc_index = within;
+ data->str[pos].kc = sub->kc;
+ if ( sub->vertical_kerning ) {
+ data->str[pos].vr.v_adv_off += rint( sub->kc->offsets[within] * data->scale );
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[pos].vr.v_adv_off += FigureDeviceTable(&sub->kc->adjusts[within],data->pixelsize);
+#endif
+ } else if ( sub->lookup->lookup_flags & pst_r2l ) {
+ data->str[npos].vr.h_adv_off += rint( sub->kc->offsets[within] * data->scale );
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[npos].vr.h_adv_off += FigureDeviceTable(&sub->kc->adjusts[within],data->pixelsize);
+#endif
+ } else {
+ data->str[pos].vr.h_adv_off += rint( sub->kc->offsets[within] * data->scale );
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[pos].vr.h_adv_off += FigureDeviceTable(&sub->kc->adjusts[within],data->pixelsize);
+#endif
+ }
+return( pos+1 );
+ } else {
+ for ( pst=data->str[pos].sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable==sub && strcmp(pst->u.pair.paired,data->str[npos].sc->name)==0 ) {
+ data->str[pos].vr.xoff += rint( pst->u.pair.vr[0].xoff * data->scale);
+ data->str[pos].vr.yoff += rint( pst->u.pair.vr[0].yoff * data->scale);
+ data->str[pos].vr.h_adv_off += rint( pst->u.pair.vr[0].h_adv_off * data->scale);
+ data->str[pos].vr.v_adv_off += rint( pst->u.pair.vr[0].v_adv_off * data->scale);
+ data->str[npos].vr.xoff += rint( pst->u.pair.vr[1].xoff * data->scale);
+ data->str[npos].vr.yoff += rint( pst->u.pair.vr[1].yoff * data->scale);
+ data->str[npos].vr.h_adv_off += rint( pst->u.pair.vr[1].h_adv_off * data->scale);
+ data->str[npos].vr.v_adv_off += rint( pst->u.pair.vr[1].v_adv_off * data->scale);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ /* I got bored. I should do all of them */
+ if ( pst->u.pair.vr[0].adjust!=NULL ) {
+ data->str[pos].vr.h_adv_off += FigureDeviceTable(&pst->u.pair.vr[0].adjust->xadv,data->pixelsize);
+ }
+#endif
+return( pos+1 ); /* We do NOT want to return npos+1 */
+ }
+ }
+ for ( isv = 0; isv<2; ++isv ) {
+ for ( kp = isv ? data->str[pos].sc->vkerns : data->str[pos].sc->kerns; kp!=NULL; kp=kp->next ) {
+ if ( kp->subtable == sub && kp->sc == data->str[npos].sc ) {
+ data->str[pos].kp = kp;
+ if ( isv ) {
+ data->str[pos].vr.v_adv_off += rint( kp->off * data->scale);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[pos].vr.v_adv_off += FigureDeviceTable(kp->adjust,data->pixelsize);
+#endif
+ } else if ( sub->lookup->lookup_flags & pst_r2l ) {
+ data->str[npos].vr.h_adv_off += rint( kp->off * data->scale);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[npos].vr.h_adv_off += FigureDeviceTable(kp->adjust,data->pixelsize);
+#endif
+ } else {
+ data->str[pos].vr.h_adv_off += rint( kp->off * data->scale);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[pos].vr.h_adv_off += FigureDeviceTable(kp->adjust,data->pixelsize);
+#endif
+ }
+return( pos+1 );
+ }
+ }
+ }
+ }
+
+return( 0 );
+}
+
+static int ApplyAnchorPosAtPos(struct lookup_subtable *sub,struct lookup_data *data,int pos) {
+ AnchorPoint *ap1, *ap2;
+ int bpos;
+
+ /* Anchors do not position the base glyph, but the mark (or second glyph */
+ /* of a cursive attachment). This means we don't apply the attachment when*/
+ /* we meet the first glyph, but wait until we meet the second, and then */
+ /* walk backwards */
+ /* The backwards walk is different depending on the lookup type (I think) */
+ /* mark to base and mark to ligature lookups will skip all marks even if */
+ /* lookup flags don't specify that */
+ /* mark to mark, and cursive attachment only skip what the lookup flags */
+ /* tell them to skip. */
+ for ( ap2=data->str[pos].sc->anchor; ap2!=NULL ; ap2=ap2->next ) {
+ if ( ap2->anchor->subtable==sub && (ap2->type == at_mark || ap2->type == at_centry))
+ break;
+ }
+ if ( ap2==NULL ) {
+ /* This subtable is not used by this glyph ... at least this glyph is */
+ /* neither a mark nor an entry point for this subtable */
+return( 0 );
+ }
+
+ /* There's only going to be one mark anchor on a glyph in a given subtable*/
+ /* And cursive attachments only allow one anchor class per subtable */
+ /* in either case we have already found the only attachment site possible */
+ /* in the current glyph */
+
+ if ( sub->lookup->lookup_type == gpos_mark2base ||
+ sub->lookup->lookup_type == gpos_mark2ligature )
+ bpos = bskipmarkglyphs(sub->lookup->lookup_flags,data,pos-1);
+ else
+ bpos = bskipglyphs(sub->lookup->lookup_flags,data,pos-1);
+ if ( bpos==-1 )
+return( 0 ); /* No match */
+
+ if ( sub->lookup->lookup_type == gpos_cursive ) {
+ for ( ap1=data->str[bpos].sc->anchor; ap1!=NULL ; ap1=ap1->next ) {
+ if ( ap1->anchor==ap2->anchor && ap1->type==at_cexit )
+ break;
+ }
+ } else if ( sub->lookup->lookup_type == gpos_mark2ligature ) {
+ for ( ap1=data->str[bpos].sc->anchor; ap1!=NULL ; ap1=ap1->next ) {
+ if ( ap1->anchor==ap2->anchor && ap1->type==at_baselig &&
+ ap1->lig_index == data->str[pos].lig_pos )
+ break;
+ }
+ } else {
+ for ( ap1=data->str[bpos].sc->anchor; ap1!=NULL ; ap1=ap1->next ) {
+ if ( ap1->anchor==ap2->anchor &&
+ (ap1->type==at_basechar || ap1->type==at_basemark) )
+ break;
+ }
+ }
+ if ( ap1==NULL )
+return( 0 ); /* No match */
+
+/* This probably doesn't work for vertical text */
+ data->str[pos].vr.yoff = data->str[bpos].vr.yoff +
+ rint((ap1->me.y - ap2->me.y) * data->scale);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[pos].vr.yoff += FigureDeviceTable(&ap1->yadjust,data->pixelsize)-
+ FigureDeviceTable(&ap2->yadjust,data->pixelsize);
+#endif
+ if ( sub->lookup->lookup_flags&pst_r2l ) {
+ data->str[pos].vr.xoff = data->str[bpos].vr.xoff +
+ rint( -(ap1->me.x - ap2->me.x)*data->scale );
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[pos].vr.xoff -= FigureDeviceTable(&ap1->xadjust,data->pixelsize)-
+ FigureDeviceTable(&ap2->xadjust,data->pixelsize);
+#endif
+ } else {
+ data->str[pos].vr.xoff = data->str[bpos].vr.xoff +
+ rint( (ap1->me.x - ap2->me.x - data->str[bpos].sc->width)*data->scale -
+ data->str[bpos].vr.h_adv_off);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ data->str[pos].vr.xoff += FigureDeviceTable(&ap1->xadjust,data->pixelsize)-
+ FigureDeviceTable(&ap2->xadjust,data->pixelsize);
+#endif
+ }
+
+return( pos+1 );
+}
+
+static int ConditionalTagOk(uint32 tag, OTLookup *otl,struct lookup_data *data,int pos) {
+ int npos, bpos;
+ uint32 script;
+ int before_in_script, after_in_script;
+
+ if ( tag==CHR('i','n','i','t') || tag==CHR('i','s','o','l') ||
+ tag==CHR('f','i','n','a') || tag==CHR('m','e','d','i') ) {
+ npos = skipglyphs(otl->lookup_flags,data,pos+1);
+ bpos = bskipglyphs(otl->lookup_flags,data,pos-1);
+ script = SCScriptFromUnicode(data->str[pos].sc);
+ before_in_script = (bpos>=0 && SCScriptFromUnicode(data->str[bpos].sc)==script);
+ after_in_script = (npos<data->cnt && SCScriptFromUnicode(data->str[npos].sc)==script);
+ if ( tag==CHR('i','n','i','t') )
+return( !before_in_script && after_in_script );
+ else if ( tag==CHR('i','s','o','l') )
+return( !before_in_script && !after_in_script );
+ else if ( tag==CHR('f','i','n','a') )
+return( before_in_script && !after_in_script );
+ else
+return( before_in_script && after_in_script );
+ }
+
+return( true );
+}
+
+static int ApplyLookupAtPos(uint32 tag, OTLookup *otl,struct lookup_data *data,int pos) {
+ struct lookup_subtable *sub;
+ int newpos;
+
+ /* Some tags imply a conditional check. Do that now */
+ if ( !ConditionalTagOk(tag,otl,data,pos))
+return( 0 );
+
+ for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
+ switch ( otl->lookup_type ) {
+ case gsub_single:
+ newpos = ApplySingleSubsAtPos(sub,data,pos);
+ break;
+ case gsub_multiple:
+ newpos = ApplyMultSubsAtPos(sub,data,pos);
+ break;
+ case gsub_alternate:
+ newpos = ApplyAltSubsAtPos(sub,data,pos);
+ break;
+ case gsub_ligature:
+ newpos = ApplyLigatureSubsAtPos(sub,data,pos);
+ break;
+ case gsub_context:
+ newpos = ApplyContextual(sub,data,pos);
+ break;
+ case gsub_contextchain:
+ newpos = ApplyContextual(sub,data,pos);
+ break;
+ case gsub_reversecchain:
+ newpos = ApplySingleSubsAtPos(sub,data,pos);
+ break;
+
+ case gpos_single:
+ newpos = ApplySinglePosAtPos(sub,data,pos);
+ break;
+ case gpos_pair:
+ newpos = ApplyPairPosAtPos(sub,data,pos);
+ break;
+ case gpos_cursive:
+ newpos = ApplyAnchorPosAtPos(sub,data,pos);
+ break;
+ case gpos_mark2base:
+ newpos = ApplyAnchorPosAtPos(sub,data,pos);
+ break;
+ case gpos_mark2ligature:
+ newpos = ApplyAnchorPosAtPos(sub,data,pos);
+ break;
+ case gpos_mark2mark:
+ newpos = ApplyAnchorPosAtPos(sub,data,pos);
+ break;
+ case gpos_context:
+ newpos = ApplyContextual(sub,data,pos);
+ break;
+ case gpos_contextchain:
+ newpos = ApplyContextual(sub,data,pos);
+ break;
+ default:
+ /* apple state machines */
+ newpos = 0;
+ break;
+ }
+ /* if a subtable worked, we don't try to apply the next one */
+ if ( newpos!=0 )
+return( newpos );
+ }
+return( 0 );
+}
+
+static void ApplyLookup(uint32 tag, OTLookup *otl,struct lookup_data *data) {
+ int pos, npos;
+ int lt = otl->lookup_type;
+
+ if ( lt == morx_indic || lt == morx_context || lt == morx_insert ||
+ lt == kern_statemachine )
+ ApplyAppleStateMachine(tag,otl,data);
+ else {
+ /* OpenType */
+ for ( pos = 0; pos<data->cnt; ) {
+ npos = ApplyLookupAtPos(tag,otl,data,pos);
+ if ( npos<=pos) /* !!!!! */
+ npos = pos+1;
+ pos = npos;
+ }
+ }
+}
+
+static uint32 FSLLMatches(FeatureScriptLangList *fl,uint32 *flist,uint32 script,uint32 lang) {
+ int i,l;
+ struct scriptlanglist *sl;
+
+ if ( flist==NULL )
+return( 0 );
+
+ while ( fl!=NULL ) {
+ for ( i=0; flist[i]!=0; ++i ) {
+ if ( fl->featuretag==flist[i] )
+ break;
+ }
+ if ( flist[i]!=0 ) {
+ for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
+ if ( sl->script == script ) {
+ if ( fl->ismac ) /* Language irrelevant on macs (scripts too, but we pretend they matter) */
+return( fl->featuretag );
+ for ( l=0; l<sl->lang_cnt; ++l )
+ if ( (l<MAX_LANG && sl->langs[l]==lang) ||
+ (l>=MAX_LANG && sl->morelangs[l-MAX_LANG]==lang))
+return( fl->featuretag );
+ }
+ }
+ }
+ fl = fl->next;
+ }
+return( 0 );
+}
+
+/* This routine takes a string of glyphs and applies the opentype transformations */
+/* indicated by the features (and script and language) we are passed, it returns */
+/* a transformed string with substitutions applied and containing positioning */
+/* info */
+struct opentype_str *ApplyTickedFeatures(SplineFont *sf,uint32 *flist, uint32 script, uint32 lang,
+ int pixelsize, SplineChar **glyphs) {
+ int isgpos, cnt;
+ OTLookup *otl;
+ struct lookup_data data;
+ uint32 *langs, templang;
+ int i;
+
+ memset(&data,0,sizeof(data));
+ for ( cnt=0; glyphs[cnt]!=NULL; ++cnt );
+ data.str = gcalloc(cnt+1,sizeof(struct opentype_str));
+ data.cnt = data.max = cnt;
+ for ( cnt=0; glyphs[cnt]!=NULL; ++cnt ) {
+ data.str[cnt].sc = glyphs[cnt];
+ data.str[cnt].orig_index = cnt;
+ data.str[cnt].lig_pos = data.str[cnt].context_pos = -1;
+ }
+ if ( sf->cidmaster!=NULL ) sf=sf->cidmaster;
+ data.sf = sf;
+ data.pixelsize = pixelsize;
+ data.scale = pixelsize/(double) (sf->ascent+sf->descent);
+
+ /* Indic glyph reordering???? */
+ for ( isgpos=0; isgpos<2; ++isgpos ) {
+ /* Check that this table has an entry for this language */
+ /* if it doesn't use the default language */
+ /* GPOS/GSUB may have different language sets, so we must be prepared */
+ templang = lang;
+ langs = SFLangsInScript(sf,isgpos,script);
+ for ( i=0; langs[i]!=0 && langs[i]!=lang; ++i );
+ if ( langs[i]==0 )
+ templang = DEFAULT_LANG;
+ free(langs);
+
+ for ( otl = isgpos ? sf->gpos_lookups : sf->gsub_lookups; otl!=NULL ; otl = otl->next ) {
+ uint32 tag;
+ if ( (tag=FSLLMatches(otl->features,flist,script,templang))!=0 )
+ ApplyLookup(tag,otl,&data);
+ }
+ }
+ LigatureFree(&data);
+ free(data.ligs);
+
+ data.str = grealloc(data.str,(data.cnt+1)*sizeof(struct opentype_str));
+ memset(&data.str[data.cnt],0,sizeof(struct opentype_str));
+return( data.str );
+}
+
+static void doreplace(char **haystack,char *start,char *search,char *rpl,int slen) {
+ int rlen;
+ char *pt = start+slen;
+ (void)search;
+ rlen = strlen(rpl);
+ if ( slen>=rlen ) {
+ memcpy(start,rpl,rlen);
+ if ( slen>rlen ) {
+ int diff = slen-rlen;
+ for ( ; *pt ; ++pt )
+ pt[-diff] = *pt;
+ pt[-diff] = '\0';
+ }
+ } else {
+ char *base = *haystack;
+ char *new = galloc(pt-base+strlen(pt)+rlen-slen+1);
+ memcpy(new,base,start-base);
+ memcpy(new+(start-base),rpl,rlen);
+ strcpy(new+(start-base)+rlen,pt);
+ free( base );
+ *haystack = new;
+ }
+}
+
+static int rplstr(char **haystack,char *search, char *rpl,int multipleoccurances) {
+ char *start, *pt, *base = *haystack;
+ int ch, match, slen = strlen(search);
+ int any = 0;
+
+ if ( base==NULL )
+return( false );
+
+ for ( pt=base ; ; ) {
+ while ( *pt==' ' ) ++pt;
+ if ( *pt=='\0' )
+return( any );
+ start=pt;
+ while ( *pt!=' ' && *pt!='\0' ) ++pt;
+ if ( pt-start!=slen )
+ match = -1;
+ else {
+ ch = *pt; *pt='\0';
+ match = strcmp(start,search);
+ *pt = ch;
+ }
+ if ( match==0 ) {
+ doreplace(haystack,start,search,rpl,slen);
+ if ( !multipleoccurances )
+return( true );
+ any = true;
+ if ( base!=*haystack ) {
+ pt = *haystack + (start-base)+strlen(rpl);
+ base = *haystack;
+ } else
+ pt = start+strlen(rpl);
+ }
+ }
+}
+
+static int rplglyphname(char **haystack,char *search, char *rpl) {
+ /* If we change "f" to "uni0066" then we should also change "f.sc" to */
+ /* "uni0066.sc" and "f_f_l" to "uni0066_uni0066_l" */
+ char *start, *pt, *base = *haystack;
+ int ch, match;
+ unsigned slen = strlen(search);
+ int any = 0;
+
+ if ( slen>=strlen( base ))
+return( false );
+
+ for ( pt=base ; ; ) {
+ while ( *pt=='_' ) ++pt;
+ if ( *pt=='\0' || *pt=='.' )
+return( any );
+ start=pt;
+ while ( *pt!='_' && *pt!='\0' && *pt!='.' ) ++pt;
+ if ( *pt=='\0' && start==base ) /* Don't change any unsegmented names */
+return( false ); /* In particular don't rename ourselves*/
+ if ( pt-start!=slen )
+ match = -1;
+ else {
+ ch = *pt; *pt='\0';
+ match = strcmp(start,search);
+ *pt = ch;
+ }
+ if ( match==0 ) {
+ doreplace(haystack,start,search,rpl,slen);
+ any = true;
+ if ( base!=*haystack ) {
+ pt = *haystack + (start-base) + strlen(rpl);
+ base = *haystack;
+ } else
+ pt = start+strlen(rpl);
+ }
+ }
+}
+
+static int glyphnameIsComponent(char *haystack,char *search) {
+ /* Check for a glyph name in ligature names and dotted names */
+ char *start, *pt;
+ unsigned slen = strlen(search);
+
+ if ( slen>=strlen( haystack ))
+return( false );
+
+ for ( pt=haystack ; ; ) {
+ while ( *pt=='_' ) ++pt;
+ if ( *pt=='\0' || *pt=='.' )
+return( false );
+ start=pt;
+ while ( *pt!='_' && *pt!='\0' && *pt!='.' ) ++pt;
+ if ( *pt=='\0' && start==haystack )/* Don't change any unsegmented names */
+return( false ); /* In particular don't rename ourselves*/
+ if ( pt-start==slen && strncmp(start,search,slen)==0 )
+return( true );
+ }
+}
+
+static int gvfixup(struct glyphvariants *gv,char *old, char *new) {
+ int i;
+ int ret=0;
+
+ if ( gv==NULL )
+return( false );
+ ret = rplstr(&gv->variants,old,new,false);
+ for ( i=0; i<gv->part_cnt; ++i ) {
+ if ( strcmp(gv->parts[i].component,old)==0 ) {
+ free( gv->parts[i].component);
+ gv->parts[i].component = copy(new);
+ ret = true;
+ }
+ }
+return( ret );
+}
+
+void SFGlyphRenameFixup(SplineFont *sf, char *old, char *new) {
+ int k, gid, isv;
+ int i,r;
+ SplineFont *master = sf;
+ SplineChar *sc;
+ PST *pst;
+ FPST *fpst;
+ KernClass *kc;
+ ASM *sm;
+
+ CVGlyphRenameFixup(sf,old,new);
+ if ( sf->cidmaster!=NULL )
+ master = sf->cidmaster;
+
+ /* Look through all substitutions (and pairwise psts) stored on the glyphs*/
+ /* and change any occurances of the name */
+ /* (KernPairs have a reference to the SC rather than the name, and need no fixup) */
+ /* Also if the name is "f" then look for glyph names like "f.sc" or "f_f_l"*/
+ /* and be ready to change them too */
+ k = 0;
+ do {
+ sf = k<master->subfontcnt ? master->subfonts[k] : master;
+ for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
+ if ( glyphnameIsComponent(sc->name,old)) {
+ char *newer = copy(sc->name);
+ rplglyphname(&newer,old,new);
+ SFGlyphRenameFixup(master,sc->name,newer);
+ free(sc->name);
+ sc->name = newer;
+ sc->namechanged = sc->changed = true;
+ }
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->type==pst_substitution || pst->type==pst_alternate ||
+ pst->type==pst_multiple || pst->type==pst_pair ||
+ pst->type==pst_ligature ) {
+ if ( rplstr(&pst->u.mult.components,old,new,pst->type==pst_ligature))
+ sc->changed = true;
+ }
+ }
+ /* For once I don't want a short circuit eval of "or", so I use */
+ /* bitwise rather than boolean intentionally */
+ if ( gvfixup(sc->vert_variants,old,new) |
+ gvfixup(sc->horiz_variants,old,new))
+ sc->changed = true;
+ }
+ ++k;
+ } while ( k<master->subfontcnt );
+
+ /* Now look for contextual fpsts which might use the name */
+ for ( fpst=master->possub; fpst!=NULL; fpst=fpst->next ) {
+ if ( fpst->format==pst_class ) {
+ for ( i=0; i<fpst->nccnt; ++i ) if ( fpst->nclass[i]!=NULL ) {
+ if ( rplstr(&fpst->nclass[i],old,new,false))
+ break;
+ }
+ for ( i=0; i<fpst->bccnt; ++i ) if ( fpst->bclass[i]!=NULL ) {
+ if ( rplstr(&fpst->bclass[i],old,new,false))
+ break;
+ }
+ for ( i=0; i<fpst->fccnt; ++i ) if ( fpst->fclass[i]!=NULL ) {
+ if ( rplstr(&fpst->fclass[i],old,new,false))
+ break;
+ }
+ }
+ for ( r=0; r<fpst->rule_cnt; ++r ) {
+ struct fpst_rule *rule = &fpst->rules[r];
+ if ( fpst->type==pst_glyphs ) {
+ rplstr(&rule->u.glyph.names,old,new,true);
+ rplstr(&rule->u.glyph.back,old,new,true);
+ rplstr(&rule->u.glyph.fore,old,new,true);
+ } else if ( fpst->type==pst_coverage ||
+ fpst->type==pst_reversecoverage ) {
+ for ( i=0; i<rule->u.coverage.ncnt ; ++i )
+ rplstr(&rule->u.coverage.ncovers[i],old,new,false);
+ for ( i=0; i<rule->u.coverage.bcnt ; ++i )
+ rplstr(&rule->u.coverage.bcovers[i],old,new,false);
+ for ( i=0; i<rule->u.coverage.fcnt ; ++i )
+ rplstr(&rule->u.coverage.fcovers[i],old,new,false);
+ if ( fpst->type==pst_reversecoverage )
+ rplstr(&rule->u.rcoverage.replacements,old,new,true);
+ }
+ }
+ }
+
+ /* Now look for contextual apple state machines which might use the name */
+ for ( sm = master->sm; sm!=NULL; sm=sm->next ) {
+ for ( i=0; i<sm->class_cnt; ++i ) if ( sm->classes[i]!=NULL ) {
+ if ( rplstr(&sm->classes[i],old,new,false))
+ break;
+ }
+ }
+
+ /* Now look for contextual kerning classes which might use the name */
+ for ( isv=0; isv<2; ++isv ) {
+ for ( kc=isv ? master->vkerns : master->kerns; kc!=NULL; kc=kc->next ) {
+ for ( i=0; i<kc->first_cnt; ++i ) if ( kc->firsts[i]!=NULL ) {
+ if ( rplstr(&kc->firsts[i],old,new,false))
+ break;
+ }
+ for ( i=0; i<kc->second_cnt; ++i ) if ( kc->seconds[i]!=NULL ) {
+ if ( rplstr(&kc->seconds[i],old,new,false))
+ break;
+ }
+ }
+ }
+}
+
+struct lookup_subtable *SFSubTableFindOrMake(SplineFont *sf,uint32 tag,uint32 script,
+ int lookup_type ) {
+ OTLookup **base;
+ OTLookup *otl, *found=NULL;
+ int isgpos = lookup_type>=gpos_start;
+ struct lookup_subtable *sub;
+ int isnew = false;
+
+ if ( sf->cidmaster ) sf = sf->cidmaster;
+ base = isgpos ? &sf->gpos_lookups : &sf->gsub_lookups;
+ for ( otl= *base; otl!=NULL; otl=otl->next ) {
+ if ( otl->lookup_type==(unsigned)lookup_type &&
+ FeatureScriptTagInFeatureScriptList(tag,script,otl->features) ) {
+ for ( sub = otl->subtables; sub!=NULL; sub=sub->next )
+ if ( sub->kc==NULL )
+return( sub );
+ found = otl;
+ }
+ }
+
+ if ( found==NULL ) {
+ found = chunkalloc(sizeof(OTLookup));
+ found->lookup_type = lookup_type;
+ found->features = chunkalloc(sizeof(FeatureScriptLangList));
+ found->features->featuretag = tag;
+ found->features->scripts = chunkalloc(sizeof(struct scriptlanglist));
+ found->features->scripts->script = script;
+ found->features->scripts->langs[0] = DEFAULT_LANG;
+ found->features->scripts->lang_cnt = 1;
+
+ SortInsertLookup(sf, found);
+ isnew = true;
+ }
+
+ sub = chunkalloc(sizeof(struct lookup_subtable));
+ sub->next = found->subtables;
+ found->subtables = sub;
+ sub->lookup = found;
+ sub->per_glyph_pst_or_kern = true;
+
+ NameOTLookup(found,sf);
+return( sub );
+}
+
+struct lookup_subtable *SFSubTableMake(SplineFont *sf,uint32 tag,uint32 script,
+ int lookup_type ) {
+ OTLookup **base;
+ OTLookup *otl, *found=NULL;
+ int isgpos = lookup_type>=gpos_start;
+ struct lookup_subtable *sub;
+ int isnew = false;
+
+ if ( sf->cidmaster ) sf = sf->cidmaster;
+ base = isgpos ? &sf->gpos_lookups : &sf->gsub_lookups;
+ for ( otl= *base; otl!=NULL; otl=otl->next ) {
+ if ( otl->lookup_type==(unsigned)lookup_type &&
+ FeatureScriptTagInFeatureScriptList(tag,script,otl->features) ) {
+ found = otl;
+ }
+ }
+
+ if ( found==NULL ) {
+ found = chunkalloc(sizeof(OTLookup));
+ found->lookup_type = lookup_type;
+ found->features = chunkalloc(sizeof(FeatureScriptLangList));
+ found->features->featuretag = tag;
+ found->features->scripts = chunkalloc(sizeof(struct scriptlanglist));
+ found->features->scripts->script = script;
+ found->features->scripts->langs[0] = DEFAULT_LANG;
+ found->features->scripts->lang_cnt = 1;
+
+ SortInsertLookup(sf, found);
+ isnew = true;
+ }
+
+ sub = chunkalloc(sizeof(struct lookup_subtable));
+ sub->next = found->subtables;
+ found->subtables = sub;
+ sub->lookup = found;
+
+ if ( isnew )
+ NameOTLookup(found,sf);
+return( sub );
+}
+
+int LookupUsedNested(SplineFont *sf,OTLookup *checkme) {
+ OTLookup *otl;
+ struct lookup_subtable *sub;
+ int r,c;
+
+ if ( checkme->lookup_type>=gpos_start )
+ otl = sf->gpos_lookups;
+ else
+ otl = sf->gsub_lookups;
+ while ( otl!=NULL ) {
+ for ( sub = otl->subtables; sub!=NULL; sub=sub->next ) {
+ if ( sub->fpst!=NULL ) {
+ for ( r=0; r<sub->fpst->rule_cnt; ++r ) {
+ struct fpst_rule *rule = &sub->fpst->rules[r];
+ for ( c=0; c<rule->lookup_cnt; ++c ) {
+ if ( rule->lookups[c].lookup == checkme )
+return( true );
+ }
+ }
+ } else if ( otl->lookup_type==morx_context ) {
+ for ( c = 0; c<sub->sm->class_cnt*sub->sm->state_cnt; ++c ) {
+ struct asm_state *state = &sub->sm->state[c];
+ if ( state->u.context.mark_lookup==checkme )
+return( true );
+ if ( state->u.context.cur_lookup==checkme )
+return( true );
+ }
+ }
+ }
+ }
+return( false );
+}
+
+static void AALTRemoveOld(SplineFont *sf) {
+ FeatureScriptLangList *fl, *prev;
+ OTLookup *otl, *otlnext;
+
+ for ( otl=sf->gsub_lookups; otl!=NULL; otl=otlnext ) {
+ otlnext = otl->next;
+ prev = NULL;
+ for ( fl = otl->features; fl!=NULL; prev=fl, fl=fl->next ) {
+ if ( fl->featuretag==CHR('a','a','l','t') ) {
+ if ( fl==otl->features && fl->next==NULL && !LookupUsedNested(sf,otl))
+ SFRemoveLookup(sf,otl);
+ else {
+ if ( prev==NULL )
+ otl->features = fl->next;
+ else
+ prev->next = fl->next;
+ fl->next = NULL;
+ FeatureScriptLangListFree(fl);
+ }
+ break;
+ }
+ }
+ }
+}
+
+void SllkFree(struct sllk *sllk,int sllk_cnt) {
+ int i;
+
+ for ( i=0; i<sllk_cnt; ++i ) {
+ free( sllk[i].langs );
+ free( sllk[i].lookups );
+ }
+ free(sllk);
+}
+
+static void AddOTLToSllk(struct sllk *sllk, OTLookup *otl, struct scriptlanglist *sl) {
+ int i,j,k,l;
+
+ if ( otl->lookup_type==gsub_single || otl->lookup_type==gsub_alternate ) {
+ for ( i=0; i<sllk->cnt; ++i )
+ if ( sllk->lookups[i]==otl )
+ break;
+ if ( i==sllk->cnt ) {
+ if ( sllk->cnt>=sllk->max )
+ sllk->lookups = grealloc(sllk->lookups,(sllk->max+=5)*sizeof(OTLookup *));
+ sllk->lookups[sllk->cnt++] = otl;
+ for ( l=0; l<sl->lang_cnt; ++l ) {
+ uint32 lang = l<MAX_LANG ? sl->langs[l] : sl->morelangs[l-MAX_LANG];
+ for ( j=0; j<sllk->lcnt; ++j )
+ if ( sllk->langs[j]==lang )
+ break;
+ if ( j==sllk->lcnt ) {
+ if ( sllk->lcnt>=sllk->lmax )
+ sllk->langs = grealloc(sllk->langs,(sllk->lmax+=sl->lang_cnt+MAX_LANG)*sizeof(uint32));
+ sllk->langs[sllk->lcnt++] = lang;
+ }
+ }
+ }
+ } else if ( otl->lookup_type==gsub_context || otl->lookup_type==gsub_contextchain ) {
+ struct lookup_subtable *sub;
+ for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
+ FPST *fpst = sub->fpst;
+ for ( j=0; j<fpst->rule_cnt; ++j ) {
+ struct fpst_rule *r = &fpst->rules[j];
+ for ( k=0; k<r->lookup_cnt; ++k )
+ AddOTLToSllk(sllk,r->lookups[k].lookup,sl);
+ }
+ }
+ }
+ /* reverse contextual chaining is weird and I shall ignore it. Adobe does too*/
+}
+
+static char *ComponentsFromPSTs(PST **psts,int pcnt) {
+ char **names=NULL;
+ int ncnt=0, nmax=0;
+ int i,j,len;
+ char *ret;
+
+ /* First find all the names */
+ for ( i=0; i<pcnt; ++i ) {
+ char *nlist = psts[i]->u.alt.components;
+ char *start, *pt, ch;
+
+ for ( start = nlist; ; ) {
+ while ( *start==' ' )
+ ++start;
+ if ( *start=='\0' )
+ break;
+ for ( pt=start; *pt!=' ' && *pt!='\0'; ++pt );
+ ch = *pt; *pt = '\0';
+ for ( j=0; j<ncnt; ++j )
+ if ( strcmp( start,names[j])==0 )
+ break;
+ if ( j==ncnt ) {
+ if ( ncnt>=nmax )
+ names = grealloc(names,(nmax+=10)*sizeof(char *));
+ names[ncnt++] = copy(start);
+ }
+ *pt = ch;
+ start = pt;
+ }
+ }
+
+ len = 0;
+ for ( i=0; i<ncnt; ++i )
+ len += strlen(names[i])+1;
+ if ( len==0 ) len=1;
+ ret = galloc(len);
+ len = 0;
+ for ( i=0; i<ncnt; ++i ) {
+ strcpy(ret+len,names[i]);
+ len += strlen(names[i]);
+ ret[len++] = ' ';
+ }
+ if ( len==0 )
+ *ret = '\0';
+ else
+ ret[len-1] = '\0';
+
+ for ( i=0; i<ncnt; ++i )
+ free(names[i]);
+ free(names);
+return( ret );
+}
+
+static int SllkMatch(struct sllk *sllk,int s1,int s2) {
+ int i;
+
+ if ( sllk[s1].cnt != sllk[s2].cnt )
+return( false );
+
+ for ( i=0; i<sllk[s1].cnt; ++i ) {
+ if ( sllk[s1].lookups[i] != sllk[s2].lookups[i] )
+return( false );
+ }
+
+return( true );
+}
+
+struct sllk *AddOTLToSllks( OTLookup *otl, struct sllk *sllk,
+ int *_sllk_cnt, int *_sllk_max ) {
+ FeatureScriptLangList *fl;
+ struct scriptlanglist *sl;
+ int s;
+
+ for ( fl=otl->features; fl!=NULL; fl=fl->next ) {
+ for ( sl=fl->scripts; sl!=NULL; sl=sl->next ) {
+ for ( s=0; s<*_sllk_cnt; ++s )
+ if ( sl->script == sllk[s].script )
+ break;
+ if ( s==*_sllk_cnt ) {
+ if ( *_sllk_cnt>=*_sllk_max )
+ sllk = grealloc(sllk,((*_sllk_max)+=10)*sizeof(struct sllk));
+ memset(&sllk[*_sllk_cnt],0,sizeof(struct sllk));
+ sllk[(*_sllk_cnt)++].script = sl->script;
+ }
+ AddOTLToSllk(&sllk[s], otl,sl);
+ }
+ }
+return( sllk );
+}
+
+OTLookup *NewAALTLookup(SplineFont *sf,struct sllk *sllk, int sllk_cnt, int i) {
+ OTLookup *otl;
+ struct lookup_subtable *sub;
+ FeatureScriptLangList *fl;
+ struct scriptlanglist *sl;
+ PST **psts, *pst;
+ int j,k,l;
+ int gid,pcnt;
+ SplineFont *_sf;
+ SplineChar *sc;
+
+ /* Make the new lookup (and all its supporting data structures) */
+ otl = chunkalloc(sizeof(OTLookup));
+ otl->lookup_type = gsub_alternate;
+ otl->lookup_flags = sllk[i].lookups[0]->lookup_flags & pst_r2l;
+ otl->features = fl = chunkalloc(sizeof(FeatureScriptLangList));
+ fl->featuretag = CHR('a','a','l','t');
+ /* Any other scripts with the same lookup set? */
+ for ( j=i; j<sllk_cnt; ++j ) {
+ if ( i==j || SllkMatch(sllk,i,j)) {
+ sl = chunkalloc(sizeof(struct scriptlanglist));
+ sl->next = fl->scripts;
+ fl->scripts = sl;
+ sl->script = sllk[j].script;
+ sl->lang_cnt = sllk[j].lcnt;
+ if ( sl->lang_cnt>MAX_LANG )
+ sl->morelangs = galloc((sl->lang_cnt-MAX_LANG)*sizeof(uint32));
+ for ( l=0; l<sl->lang_cnt; ++l )
+ if ( l<MAX_LANG )
+ sl->langs[l] = sllk[j].langs[l];
+ else
+ sl->morelangs[l-MAX_LANG] = sllk[j].langs[l];
+ if ( i!=j ) sllk[j].cnt = 0; /* Mark as processed */
+ }
+ }
+ otl->subtables = sub = chunkalloc(sizeof(struct lookup_subtable));
+ sub->lookup = otl;
+ sub->per_glyph_pst_or_kern = true;
+
+ /* Add it to the various lists it needs to be in */
+ otl->next = sf->gsub_lookups;
+ sf->gsub_lookups = otl;
+
+ /* Now look at every glyph in the font, and see if it has any of the */
+ /* lookups we are interested in, and if it does, build a new pst */
+ /* containing all posibilities listed on any of them */
+ if ( sf->cidmaster ) sf = sf->cidmaster;
+ psts = galloc(sllk[i].cnt*sizeof(PST *));
+ k=0;
+ do {
+ _sf = k<sf->subfontcnt ? sf->subfonts[k] : sf;
+ for ( gid=0; gid<_sf->glyphcnt; ++gid ) if ( (sc = _sf->glyphs[gid])!=NULL ) {
+ pcnt = 0;
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->subtable==NULL )
+ continue;
+ for ( j=0; j<sllk[i].cnt; ++j )
+ if ( pst->subtable->lookup == sllk[i].lookups[j] )
+ break;
+ if ( j<sllk[i].cnt )
+ psts[pcnt++] = pst;
+ }
+ if ( pcnt==0 )
+ continue;
+ pst = chunkalloc(sizeof(PST));
+ pst->subtable = sub;
+ pst->type = pst_alternate;
+ pst->next = sc->possub;
+ sc->possub = pst;
+ pst->u.alt.components = ComponentsFromPSTs(psts,pcnt);
+ }
+ ++k;
+ } while ( k<sf->subfontcnt );
+ free(psts);
+ NameOTLookup(otl,sf);
+return( otl );
+}
+
+void AddNewAALTFeatures(SplineFont *sf) {
+ /* different script/lang combinations may need different 'aalt' lookups */
+ /* well, let's just say different script combinations */
+ /* for each script/lang combo find all single/alternate subs for each */
+ /* glyph. Merge those choices and create new lookup with that info */
+ struct sllk *sllk = NULL;
+ int sllk_cnt=0, sllk_max = 0;
+ int i;
+ OTLookup *otl;
+
+ AALTRemoveOld(sf);
+
+ /* Find all scripts, and all the single/alternate lookups for each */
+ /* and all the languages used for these in each script */
+ for ( otl=sf->gsub_lookups; otl!=NULL; otl=otl->next ) {
+ sllk = AddOTLToSllks( otl, sllk, &sllk_cnt, &sllk_max );
+ }
+ /* Each of these gets its own gsub_alternate lookup which gets inserted */
+ /* at the head of the lookup list. Each lookup has one subtable */
+ for ( i=0; i<sllk_cnt; ++i ) {
+ if ( sllk[i].cnt==0 ) /* Script used, but provides no alternates */
+ continue;
+ NewAALTLookup(sf,sllk,sllk_cnt,i);
+ }
+
+ SllkFree(sllk,sllk_cnt);
+}
+
+
+int VerticalKernFeature(SplineFont *sf, OTLookup *otl, int ask) {
+ FeatureScriptLangList *fl;
+ struct lookup_subtable *sub;
+ KernClass *kc;
+ char *buts[3];
+
+ for ( fl=otl->features; fl!=NULL; fl=fl->next ) {
+ if ( fl->featuretag==CHR('k','e','r','n') )
+return( false );
+ else if ( fl->featuretag==CHR('v','k','r','n') )
+return( true );
+ }
+
+ for ( sub=otl->subtables; sub!=NULL; sub=sub->next ) {
+ if ( sub->kc!=NULL ) {
+ for ( kc=sf->kerns; kc!=NULL; kc=kc->next )
+ if ( kc==sub->kc )
+return( false );
+ for ( kc=sf->vkerns; kc!=NULL; kc=kc->next )
+ if ( kc==sub->kc )
+return( true );
+ }
+ }
+
+ if ( !ask )
+return( -1 );
+
+ buts[0] = _("_Horizontal"); buts[1] = _("_Vertical"); buts[2] = NULL;
+return( ff_ask(_("Kerning direction"),(const char **) buts,0,1,_("Is this horizontal or vertical kerning data?")) );
+}
+
+int IsAnchorClassUsed(SplineChar *sc,AnchorClass *an) {
+ AnchorPoint *ap;
+ int waslig=0, sawentry=0, sawexit=0;
+
+ for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
+ if ( ap->anchor==an ) {
+ if ( ap->type==at_centry )
+ sawentry = true;
+ else if ( ap->type==at_cexit )
+ sawexit = true;
+ else if ( an->type==act_mkmk ) {
+ if ( ap->type==at_basemark )
+ sawexit = true;
+ else
+ sawentry = true;
+ } else if ( ap->type!=at_baselig )
+return( -1 );
+ else if ( waslig<ap->lig_index+1 )
+ waslig = ap->lig_index+1;
+ }
+ }
+ if ( sawentry && sawexit )
+return( -1 );
+ else if ( sawentry )
+return( -2 );
+ else if ( sawexit )
+return( -3 );
+return( waslig );
+}
+
+int PSTContains(const char *components,const char *name) {
+ const char *pt;
+ int len = strlen(name);
+
+ for ( pt = strstr(components,name); pt!=NULL; pt = strstr(pt+len,name)) {
+ if (( pt==components || pt[-1]==' ') && (pt[len]==' ' || pt[len]=='\0'))
+return( true );
+ }
+return( false );
+}
+
+int KernClassContains(KernClass *kc, char *name1, char *name2, int ordered ) {
+ int infirst=0, insecond=0, scpos1=0, kwpos1=0, scpos2=0, kwpos2=0;
+ int i;
+
+ for ( i=1; i<kc->first_cnt; ++i ) {
+ if ( PSTContains(kc->firsts[i],name1) ) {
+ scpos1 = i;
+ if ( ++infirst>=3 ) /* The name occurs twice??? */
+ break;
+ } else if ( PSTContains(kc->firsts[i],name2) ) {
+ kwpos1 = i;
+ if ( (infirst+=2)>=3 )
+ break;
+ }
+ }
+ if ( infirst==0 || infirst>3 )
+return( 0 );
+ for ( i=1; i<kc->second_cnt; ++i ) {
+ if ( PSTContains(kc->seconds[i],name1) ) {
+ scpos2 = i;
+ if ( ++insecond>=3 )
+ break;
+ } else if ( PSTContains(kc->seconds[i],name2) ) {
+ kwpos2 = i;
+ if ( (insecond+=2)>=3 )
+ break;
+ }
+ }
+ if ( insecond==0 || insecond>3 )
+return( 0 );
+ if ( (infirst&1) && (insecond&2) ) {
+ if ( kc->offsets[scpos1*kc->second_cnt+kwpos2]!=0 )
+return( kc->offsets[scpos1*kc->second_cnt+kwpos2] );
+ }
+ if ( !ordered ) {
+ if ( (infirst&2) && (insecond&1) ) {
+ if ( kc->offsets[kwpos1*kc->second_cnt+scpos2]!=0 )
+return( kc->offsets[kwpos1*kc->second_cnt+scpos2] );
+ }
+ }
+return( 0 );
+}
+
+int KCFindName(char *name, char **classnames, int cnt ) {
+ int i;
+ char *pt, *end, ch;
+
+ for ( i=0; i<cnt; ++i ) {
+ if ( classnames[i]==NULL )
+ continue;
+ for ( pt = classnames[i]; *pt; pt=end+1 ) {
+ end = strchr(pt,' ');
+ if ( end==NULL ) end = pt+strlen(pt);
+ ch = *end;
+ *end = '\0';
+ if ( strcmp(pt,name)==0 ) {
+ *end = ch;
+return( i );
+ }
+ *end = ch;
+ if ( ch=='\0' )
+ break;
+ }
+ }
+return( 0 );
+}
+
+int KCFindIndex(KernClass *kc,char *name1, char *name2) {
+ int f,l;
+
+ f = KCFindName(name1,kc->firsts,kc->first_cnt);
+ l = KCFindName(name2,kc->seconds,kc->second_cnt);
+ if ( (f!=0 || kc->firsts[0]!=NULL) && l!=0 )
+return( f*kc->second_cnt+l );
+
+return( -1 );
+}
+
+
+static void NOFI_SortInsertLookup(SplineFont *sf, OTLookup *newotl) {
+ (void)sf;
+ (void)newotl;
+}
+
+static void NOFI_OTLookupCopyInto(SplineFont *into_sf,SplineFont *from_sf,
+ OTLookup *from_otl, OTLookup *to_otl, int scnt, OTLookup *before ) {
+ (void)into_sf;
+ (void)from_sf;
+ (void)from_otl;
+ (void)to_otl;
+ (void)scnt;
+ (void)before;
+}
+
+static void NOFI_Destroy(SplineFont *sf) {
+ (void)sf;
+}
+
+struct fi_interface noui_fi = {
+ NOFI_SortInsertLookup,
+ NOFI_OTLookupCopyInto,
+ NOFI_Destroy
+};
+
+struct fi_interface *fi_interface = &noui_fi;
+
+void FF_SetFIInterface(struct fi_interface *fii) {
+ fi_interface = fii;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.h
new file mode 100644
index 00000000000..2489d0c137c
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/lookups.h
@@ -0,0 +1,2 @@
+extern void SortInsertLookup(SplineFont *sf, OTLookup *newotl);
+extern char *SuffixFromTags(FeatureScriptLangList *fl);
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c
new file mode 100644
index 00000000000..2f92df3e03e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macbinary.c
@@ -0,0 +1,1201 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h"
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <ustring.h>
+#include "ttf.h"
+#include "psfont.h"
+#ifdef LUA_FF_LIB
+#undef __Mac
+#endif
+#if __Mac
+# include <ctype.h>
+# include </Developer/Headers/FlatCarbon/Files.h>
+#else
+# include <utype.h>
+#undef __Mac
+#define __Mac 0
+#endif
+
+const int mac_dpi = 72;
+/* I had always assumed that the mac still believed in 72dpi screens, but I */
+/* see that in geneva under OS/9, the pointsize does not match the pixel */
+/* size of the font. But the dpi is not constant (and the differences */
+/* excede those supplied by rounding errors) varying between 96 and 84dpi */
+
+/* A Mac Resource fork */
+/* http://developer.apple.com/techpubs/mac/MoreToolbox/MoreToolbox-9.html */
+/* begins with a 16 byte header containing: */
+/* resource start offset */
+/* map start offset */
+/* resource length */
+/* map length */
+/* then 256-16 bytes of zeros */
+/* the resource section consists of (many) */
+/* 4 byte length count */
+/* resource data */
+/* the map section contains */
+/* A copy of the 16 byte header */
+/* a 4 byte mac internal value (I hope) */
+/* another 4 bytes of mac internal values (I hope) */
+/* a 2 byte offset from the start of the map section to the list of resource types */
+/* a 2 byte offset from the start of the map section to the list of resource names */
+/* The resource type list consists of */
+/* a 2 byte count of the number of resource types (-1) */
+/* (many copies of) */
+/* a 4 byte resource type ('FOND' for example) */
+/* a 2 byte count of the number of resources of this type (-1) */
+/* a 2 byte offset from the type list start to the resource table */
+/* a resource table looks like */
+/* a 2 byte offset from the resource name table to a pascal */
+/* string containing this resource's name (or 0xffff for none) */
+/* 1 byte of resource flags */
+/* 3 bytes of offset from the resource section to the length & */
+/* data of this instance of the resource type */
+/* 4 bytes of 0 */
+/* The resource name section consists of */
+/* a bunch of pascal strings (ie. preceded by a length byte) */
+
+/* The POST resource isn't noticeably documented, it's pretty much a */
+/* straight copy of the pfb file cut up into 0x800 byte chunks. */
+/* (each section of the pfb file has it's own set of chunks, the last may be smaller than 0x800) */
+/* The NFNT resource http://developer.apple.com/techpubs/mac/Text/Text-250.html */
+/* The FOND resource http://developer.apple.com/techpubs/mac/Text/Text-269.html */
+/* The sfnt resource is basically a copy of the ttf file */
+
+/* A MacBinary file */
+/* http://www.lazerware.com/formats/macbinary.html */
+/* begins with a 128 byte header */
+/* (which specifies lengths for data/resource forks) */
+/* (and contains mac type/creator data) */
+/* (and other stuff) */
+/* (and finally a crc checksum) */
+/* is followed by the data section (padded to a mult of 128 bytes) */
+/* is followed by the resource section (padded to a mult of 128 bytes) */
+
+/* ******************************** Creation ******************************** */
+
+
+struct resource {
+ uint32 pos;
+ uint8 flags;
+ uint16 id;
+ char *name;
+ uint32 nameloc;
+ uint32 nameptloc;
+};
+
+struct resourcetype {
+ uint32 tag;
+ struct resource *res;
+ uint32 resloc;
+};
+
+struct macbinaryheader {
+ char *macfilename;
+ char *binfilename; /* if macfilename is null and this is set we will figure out macfilename by removing .bin */
+ uint32 type;
+ uint32 creator;
+};
+
+
+enum psstyle_flags { psf_bold = 1, psf_italic = 2, psf_outline = 4,
+ psf_shadow = 0x8, psf_condense = 0x10, psf_extend = 0x20 };
+
+uint16 _MacStyleCode( char *styles, SplineFont *sf, uint16 *psstylecode ) {
+ unsigned short stylecode= 0, psstyle=0;
+
+ if ( strstrmatch( styles, "Bold" ) || strstrmatch(styles,"Demi") ||
+ strstrmatch( styles,"Heav") || strstrmatch(styles,"Blac") ||
+/* A few fonts have German/French styles in their names */
+ strstrmatch( styles,"Fett") || strstrmatch(styles,"Gras") ) {
+ stylecode = sf_bold;
+ psstyle = psf_bold;
+ } else if ( sf!=NULL && sf->weight!=NULL &&
+ (strstrmatch( sf->weight, "Bold" ) || strstrmatch(sf->weight,"Demi") ||
+ strstrmatch( sf->weight,"Heav") || strstrmatch(sf->weight,"Blac") ||
+ strstrmatch( sf->weight,"Fett") || strstrmatch(sf->weight,"Gras")) ) {
+ stylecode = sf_bold;
+ psstyle = psf_bold;
+ }
+ /* URW uses four leter abbreviations of Italic and Oblique */
+ /* Somebody else uses two letter abbrevs */
+ if ( (sf!=NULL && sf->italicangle!=0) ||
+ strstrmatch( styles, "Ital" ) ||
+ strstrmatch( styles, "Obli" ) ||
+ strstrmatch(styles, "Slanted") ||
+ strstrmatch(styles, "Kurs") ||
+ strstr( styles,"It" ) ) {
+ stylecode |= sf_italic;
+ psstyle |= psf_italic;
+ }
+ if ( strstrmatch( styles, "Underline" ) ) {
+ stylecode |= sf_underline;
+ }
+ if ( strstrmatch( styles, "Outl" ) ) {
+ stylecode |= sf_outline;
+ psstyle |= psf_outline;
+ }
+ if ( strstr(styles,"Shadow")!=NULL ) {
+ stylecode |= sf_shadow;
+ psstyle |= psf_shadow;
+ }
+ if ( strstrmatch( styles, "Cond" ) || strstr( styles,"Cn") ||
+ strstrmatch( styles, "Narrow") ) {
+ stylecode |= sf_condense;
+ psstyle |= psf_condense;
+ }
+ if ( strstrmatch( styles, "Exte" ) || strstr( styles,"Ex") ) {
+ stylecode |= sf_extend;
+ psstyle |= psf_extend;
+ }
+ if ( (psstyle&psf_extend) && (psstyle&psf_condense) ) {
+ if ( sf!=NULL )
+ LogError( _("Warning: %s(%s) is both extended and condensed. That's impossible.\n"),
+ sf->fontname, sf->origname );
+ else
+ LogError( _("Warning: Both extended and condensed. That's impossible.\n") );
+ psstyle &= ~psf_extend;
+ stylecode &= ~sf_extend;
+ }
+ if ( psstylecode!=NULL )
+ *psstylecode = psstyle;
+return( stylecode );
+}
+
+
+
+/* ******************************** Reading ********************************* */
+
+static SplineFont *SearchPostscriptResources(FILE *f,long rlistpos,int subcnt,long rdata_pos,
+ long name_list, int flags) {
+ long here = ftell(f);
+ long *offsets, lenpos;
+ int rname = -1, tmp;
+ int ch1, ch2;
+ int len, type, i, j, rlen;
+ unsigned short id, *rsrcids;
+ /* I don't pretend to understand the rational behind the format of a */
+ /* postscript font. It appears to be split up into chunks where the */
+ /* maximum chunk size is 0x800, each section (ascii, binary, ascii, eof) */
+ /* has its own set of chunks (ie chunks don't cross sections) */
+ char *buffer=NULL;
+ int max = 0;
+ FILE *pfb;
+ FontDict *fd;
+ SplineFont *sf;
+ (void)name_list;
+ fseek(f,rlistpos,SEEK_SET);
+ rsrcids = gcalloc(subcnt,sizeof(short));
+ offsets = gcalloc(subcnt,sizeof(long));
+ for ( i=0; i<subcnt; ++i ) {
+ rsrcids[i] = getushort(f);
+ tmp = (short) getushort(f);
+ if ( rname==-1 ) rname = tmp;
+ /* flags = */ getc(f);
+ ch1 = getc(f); ch2 = getc(f);
+ offsets[i] = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
+ /* mbz = */ getlong(f);
+ }
+
+ pfb = tmpfile();
+ if ( pfb==NULL ) {
+ LogError( _("Can't open temporary file for postscript output\n") );
+ fseek(f,here,SEEK_SET );
+ free(offsets);
+return(NULL);
+ }
+
+ putc(0x80,pfb);
+ putc(1,pfb);
+ lenpos = ftell(pfb);
+ putc(0,pfb);
+ putc(0,pfb);
+ putc(0,pfb);
+ putc(0,pfb);
+ len = 0; type = 1;
+ id = 501;
+ for ( i=0; i<subcnt; ++i ) {
+ for ( j=0; j<subcnt; ++j )
+ if ( rsrcids[j]==id )
+ break;
+ if ( j == subcnt ) {
+ LogError( _("Missing POST resource %u\n"), id );
+ break;
+ }
+ id = id + 1;
+ fseek(f,offsets[j],SEEK_SET);
+ rlen = getlong(f);
+ ch1 = getc(f); ch2 = getc(f);
+ rlen -= 2; /* those two bytes don't count as real data */
+ if ( ch1==type )
+ len += rlen;
+ else {
+ long hold = ftell(pfb);
+ fseek(pfb,lenpos,SEEK_SET);
+ putc(len>>24,pfb);
+ putc((len>>16)&0xff,pfb);
+ putc((len>>8)&0xff,pfb);
+ putc(len&0xff,pfb);
+ fseek(pfb,hold,SEEK_SET);
+ if ( ch1==5 ) /* end of font mark */
+ break;
+ putc(0x80,pfb);
+ putc(ch1,pfb);
+ lenpos = ftell(pfb);
+ putc(0,pfb);
+ putc(0,pfb);
+ putc(0,pfb);
+ putc(0,pfb);
+ type = ch1;
+ len = rlen;
+ }
+ if ( rlen>max ) {
+ free(buffer);
+ max = rlen;
+ if ( max<0x800 ) max = 0x800;
+ buffer=galloc(max);
+ if ( buffer==NULL ) {
+ LogError( _("Out of memory\n") );
+ exit( 1 );
+ }
+ }
+ fread(buffer,1,rlen,f);
+ fwrite(buffer,1,rlen,pfb);
+ }
+ free(buffer);
+ free(offsets);
+ free(rsrcids);
+ putc(0x80,pfb);
+ putc(3,pfb);
+ fseek(pfb,lenpos,SEEK_SET);
+ putc(len>>24,pfb);
+ putc((len>>16)&0xff,pfb);
+ putc((len>>8)&0xff,pfb);
+ putc(len&0xff,pfb);
+ fseek(f,here,SEEK_SET);
+ rewind(pfb);
+ if ( flags&ttf_onlynames )
+return( (SplineFont *) _NamesReadPostscript(pfb) ); /* This closes the font for us */
+
+ fd = _ReadPSFont(pfb);
+ sf = NULL;
+ if ( fd!=NULL ) {
+ sf = SplineFontFromPSFont(fd);
+ PSFontFree(fd);
+ /* There is no FOND in a postscript file, so we can't read any kerning*/
+ }
+ fclose(pfb);
+return( sf );
+}
+
+static SplineFont *SearchTtfResources(FILE *f,long rlistpos,int subcnt,long rdata_pos,
+ long name_list,char *filename,int flags,enum openflags openflags) {
+ long here, start = ftell(f);
+ long roff;
+ int rname = -1;
+ int ch1, ch2;
+ int len, i, rlen, ilen;
+ /* The sfnt resource is just a copy of the ttf file */
+ char *buffer=NULL;
+ int max = 0;
+ FILE *ttf;
+ SplineFont *sf;
+ int which = 0;
+ char **names;
+ char *pt,*lparen, *rparen;
+ char *chosenname=NULL;
+ (void)name_list;
+ fseek(f,rlistpos,SEEK_SET);
+ if ( subcnt>1 || (flags&ttf_onlynames) ) {
+ names = gcalloc(subcnt+1,sizeof(char *));
+ for ( i=0; i<subcnt; ++i ) {
+ /* resource id = */ getushort(f);
+ /* rname = (short) */ getushort(f);
+ /* flags = */ getc(f);
+ ch1 = getc(f); ch2 = getc(f);
+ roff = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
+ /* mbz = */ getlong(f);
+ here = ftell(f);
+ names[i] = TTFGetFontName(f,roff+4,roff+4);
+ if ( names[i]==NULL ) {
+ char buffer[32];
+ sprintf( buffer, "Nameless%d", i );
+ names[i] = copy(buffer);
+ }
+ fseek(f,here,SEEK_SET);
+ }
+ if ( flags&ttf_onlynames ) {
+return( (SplineFont *) names );
+ }
+ if ((pt = strrchr(filename,'/'))==NULL ) pt = filename;
+ /* Someone gave me a font "Nafees Nastaleeq(Updated).ttf" and complained */
+ /* that ff wouldn't open it */
+ /* Now someone will complain about "Nafees(Updated).ttc(fo(ob)ar)" */
+ if ( (lparen = strrchr(pt,'('))!=NULL &&
+ (rparen = strrchr(lparen,')'))!=NULL &&
+ rparen[1]=='\0' ) {
+ char *find = copy(lparen+1);
+ pt = strchr(find,')');
+ if ( pt!=NULL ) *pt='\0';
+ for ( which=subcnt-1; which>=0; --which )
+ if ( strcmp(names[which],find)==0 )
+ break;
+ if ( which==-1 ) {
+ char *end;
+ which = strtol(find,&end,10);
+ if ( *end!='\0' )
+ which = -1;
+ }
+ if ( which==-1 ) {
+ char *fn = copy(filename);
+ fn[lparen-filename] = '\0';
+ ff_post_error(_("Not in Collection"),_("%s is not in %.100s"),find,fn);
+ free(fn);
+ }
+ free(find);
+ } else
+ which = 0;
+ if ( lparen==NULL && which!=-1 )
+ chosenname = copy(names[which]);
+ for ( i=0; i<subcnt; ++i )
+ free(names[i]);
+ free(names);
+ fseek(f,rlistpos,SEEK_SET);
+ }
+
+ for ( i=0; i<subcnt; ++i ) {
+ /* resource id = */ getushort(f);
+ rname = (short) getushort(f);
+ /* flags = */ getc(f);
+ ch1 = getc(f); ch2 = getc(f);
+ roff = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
+ /* mbz = */ getlong(f);
+ if ( i!=which )
+ continue;
+ here = ftell(f);
+
+ ttf = tmpfile();
+ if ( ttf==NULL ) {
+ LogError( _("Can't open temporary file for truetype output.\n") );
+ continue;
+ }
+
+ fseek(f,roff,SEEK_SET);
+ ilen = rlen = getlong(f);
+ if ( rlen>16*1024 )
+ ilen = 16*1024;
+ if ( ilen>max ) {
+ free(buffer);
+ max = ilen;
+ if ( max<0x800 ) max = 0x800;
+ buffer=malloc(max);
+ }
+ for ( len=0; len<rlen; ) {
+ int temp = ilen;
+ if ( rlen-len<ilen ) temp = rlen-len;
+ temp = fread(buffer,1,temp,f);
+ if ( temp==EOF )
+ break;
+ fwrite(buffer,1,temp,ttf);
+ len += temp;
+ }
+ rewind(ttf);
+ sf = _SFReadTTF(ttf,flags,openflags,NULL,NULL);
+ fclose(ttf);
+ if ( sf!=NULL ) {
+ free(buffer);
+ fseek(f,start,SEEK_SET);
+ if ( sf->chosenname==NULL ) sf->chosenname = chosenname;
+return( sf );
+ }
+ fseek(f,here,SEEK_SET);
+ }
+ free(chosenname);
+ free(buffer);
+ fseek(f,start,SEEK_SET);
+return( NULL );
+}
+
+typedef struct fond {
+ char *fondname;
+ int first, last;
+ int assoc_cnt;
+ struct assoc {
+ short size, style, id;
+ } *assoc;
+ /* size==0 => scalable */
+ /* style>>8 is the bit depth (0=>1, 1=>2, 2=>4, 3=>8) */
+ /* search order for ID is sfnt, NFNT, FONT */
+ int stylewidthcnt;
+ struct stylewidths {
+ short style;
+ short *widthtab; /* 4.12 fixed number with the width specified as a fraction of an em */
+ } *stylewidths;
+ int stylekerncnt;
+ struct stylekerns {
+ short style;
+ int kernpairs;
+ struct kerns {
+ unsigned char ch1, ch2;
+ short offset; /* 4.12 */
+ } *kerns;
+ } *stylekerns;
+ char *psnames[48];
+ struct fond *next;
+} FOND;
+
+struct MacFontRec {
+ short fontType;
+ short firstChar;
+ short lastChar;
+ short widthMax;
+ short kernMax; /* bb learing */
+ short Descent; /* maximum negative distance below baseline*/
+ short fRectWidth; /* bounding box width */
+ short fRectHeight; /* bounding box height */
+ unsigned short *offsetWidths;/* offset to start of offset/width table */
+ /* 0xffff => undefined, else high byte is offset in locTable, */
+ /* low byte is width */
+ short ascent;
+ short descent;
+ short leading;
+ short rowWords; /* shorts per row */
+ unsigned short *fontImage; /* rowWords*fRectHeight */
+ /* Images for all characters plus one extra for undefined */
+ unsigned short *locs; /* lastchar-firstchar+3 words */
+ /* Horizontal offset to start of n'th character. Note: applies */
+ /* to each row. Missing characters have same loc as following */
+};
+
+static void FondListFree(FOND *list) {
+ FOND *next;
+ int i;
+
+ while ( list!=NULL ) {
+ next = list->next;
+ free(list->assoc);
+ for ( i=0; i<list->stylewidthcnt; ++i )
+ free(list->stylewidths[i].widthtab);
+ free(list->stylewidths);
+ for ( i=0; i<list->stylekerncnt; ++i )
+ free(list->stylekerns[i].kerns);
+ free(list->stylekerns);
+ for ( i=0; i<48; ++i )
+ free(list->psnames[i]);
+ free(list);
+ list = next;
+ }
+}
+
+/* There's probably only one fond in the file, but there could be more so be */
+/* prepared... */
+/* I want the fond: */
+/* to get the fractional widths for the SWIDTH entry on bdf */
+/* to get the font name */
+/* to get the font association tables */
+/* to get the style flags */
+/* http://developer.apple.com/techpubs/mac/Text/Text-269.html */
+static FOND *BuildFondList(FILE *f,long rlistpos,int subcnt,long rdata_pos,
+ long name_list,int flags) {
+ long here, start = ftell(f);
+ long offset;
+ int rname = -1;
+ char name[300];
+ int ch1, ch2;
+ int i, j, k, cnt, isfixed;
+ FOND *head=NULL, *cur;
+ long widoff, kernoff, styleoff;
+
+ fseek(f,rlistpos,SEEK_SET);
+ for ( i=0; i<subcnt; ++i ) {
+ /* resource id = */ getushort(f);
+ rname = (short) getushort(f);
+ /* flags = */ getc(f);
+ ch1 = getc(f); ch2 = getc(f);
+ offset = rdata_pos+((ch1<<16)|(ch2<<8)|getc(f));
+ /* mbz = */ getlong(f);
+ here = ftell(f);
+
+ cur = gcalloc(1,sizeof(FOND));
+ cur->next = head;
+ head = cur;
+
+ if ( rname!=-1 ) {
+ fseek(f,name_list+rname,SEEK_SET);
+ ch1 = getc(f);
+ fread(name,1,ch1,f);
+ name[ch1] = '\0';
+ cur->fondname = copy(name);
+ }
+
+ offset += 4;
+ fseek(f,offset,SEEK_SET);
+ isfixed = getushort(f)&0x8000?1:0;
+ /* family id = */ getushort(f);
+ cur->first = getushort(f);
+ cur->last = getushort(f);
+/* on a 1 point font... */
+ /* ascent = */ getushort(f);
+ /* descent = (short) */ getushort(f);
+ /* leading = */ getushort(f);
+ /* widmax = */ getushort(f);
+ if ( (widoff = getlong(f))!=0 ) widoff += offset;
+ if ( (kernoff = getlong(f))!=0 ) kernoff += offset;
+ if ( (styleoff = getlong(f))!=0 ) styleoff += offset;
+ for ( j=0; j<9; ++j )
+ getushort(f);
+ /* internal & undefined, for international scripts = */ getlong(f);
+ /* version = */ getushort(f);
+ cur->assoc_cnt = getushort(f)+1;
+ cur->assoc = gcalloc(cur->assoc_cnt,sizeof(struct assoc));
+ for ( j=0; j<cur->assoc_cnt; ++j ) {
+ cur->assoc[j].size = getushort(f);
+ cur->assoc[j].style = getushort(f);
+ cur->assoc[j].id = getushort(f);
+ }
+ if ( widoff!=0 ) {
+ fseek(f,widoff,SEEK_SET);
+ cnt = getushort(f)+1;
+ cur->stylewidthcnt = cnt;
+ cur->stylewidths = gcalloc(cnt,sizeof(struct stylewidths));
+ for ( j=0; j<cnt; ++j ) {
+ cur->stylewidths[j].style = getushort(f);
+ cur->stylewidths[j].widthtab = galloc((cur->last-cur->first+3)*sizeof(short));
+ for ( k=cur->first; k<=cur->last+2; ++k )
+ cur->stylewidths[j].widthtab[k] = getushort(f);
+ }
+ }
+ if ( kernoff!=0 && (flags&ttf_onlykerns) ) {
+ fseek(f,kernoff,SEEK_SET);
+ cnt = getushort(f)+1;
+ cur->stylekerncnt = cnt;
+ cur->stylekerns = gcalloc(cnt,sizeof(struct stylekerns));
+ for ( j=0; j<cnt; ++j ) {
+ cur->stylekerns[j].style = getushort(f);
+ cur->stylekerns[j].kernpairs = getushort(f);
+ cur->stylekerns[j].kerns = galloc(cur->stylekerns[j].kernpairs*sizeof(struct kerns));
+ for ( k=0; k<cur->stylekerns[j].kernpairs; ++k ) {
+ cur->stylekerns[j].kerns[k].ch1 = getc(f);
+ cur->stylekerns[j].kerns[k].ch2 = getc(f);
+ cur->stylekerns[j].kerns[k].offset = getushort(f);
+ }
+ }
+ }
+ if ( styleoff!=0 ) {
+ uint8 stringoffsets[48];
+ int strcnt, stringlen, format;
+ char **strings, *pt;
+ fseek(f,styleoff,SEEK_SET);
+ /* class = */ getushort(f);
+ /* glyph encoding offset = */ getlong(f);
+ /* reserved = */ getlong(f);
+ for ( j=0; j<48; ++j )
+ stringoffsets[j] = getc(f);
+ strcnt = getushort(f);
+ strings = galloc(strcnt*sizeof(char *));
+ for ( j=0; j<strcnt; ++j ) {
+ stringlen = getc(f);
+ strings[j] = galloc(stringlen+2);
+ strings[j][0] = stringlen;
+ strings[j][stringlen+1] = '\0';
+ for ( k=0; k<stringlen; ++k )
+ strings[j][k+1] = getc(f);
+ }
+ for ( j=0; j<48; ++j ) {
+ for ( k=j-1; k>=0; --k )
+ if ( stringoffsets[j]==stringoffsets[k] )
+ break;
+ if ( k!=-1 )
+ continue; /* this style doesn't exist */
+ format = stringoffsets[j]-1;
+ stringlen = strings[0][0];
+ if ( format!=0 )
+ for ( k=0; k<strings[format][0]; ++k )
+ stringlen += strings[ strings[format][k+1]-1 ][0];
+ pt = cur->psnames[j] = galloc(stringlen+1);
+ strcpy(pt,strings[ 0 ]+1);
+ pt += strings[ 0 ][0];
+ if ( format!=0 )
+ for ( k=0; k<strings[format][0]; ++k ) {
+ strcpy(pt,strings[ strings[format][k+1]-1 ]+1);
+ pt += strings[ strings[format][k+1]-1 ][0];
+ }
+ *pt = '\0';
+ }
+ for ( j=0; j<strcnt; ++j )
+ free(strings[j]);
+ free(strings);
+ }
+ fseek(f,here,SEEK_SET);
+ }
+ fseek(f,start,SEEK_SET);
+return( head );
+}
+
+static char *BuildName(char *family,int style) {
+ char buffer[350];
+
+ strncpy(buffer,family,200);
+ if ( style!=0 )
+ strcat(buffer,"-");
+ if ( style&sf_bold )
+ strcat(buffer,"Bold");
+ if ( style&sf_italic )
+ strcat(buffer,"Italic");
+ if ( style&sf_underline )
+ strcat(buffer,"Underline");
+ if ( style&sf_outline )
+ strcat(buffer,"Outline");
+ if ( style&sf_shadow )
+ strcat(buffer,"Shadow");
+ if ( style&sf_condense )
+ strcat(buffer,"Condensed");
+ if ( style&sf_extend )
+ strcat(buffer,"Extended");
+return( copy(buffer));
+}
+
+static int GuessStyle(char *fontname,int *styles,int style_cnt) {
+ int which, style;
+ char *stylenames = _GetModifiers(fontname,NULL,NULL);
+
+ style = _MacStyleCode(stylenames,NULL,NULL);
+ for ( which = style_cnt; which>=0; --which )
+ if ( styles[which] == style )
+return( which );
+
+return( -1 );
+}
+
+static FOND *PickFOND(FOND *fondlist,char *filename,char **name, int *style) {
+ int i,j;
+ FOND *test;
+ uint8 stylesused[96];
+ char **names;
+ FOND **fonds = NULL, *fond = NULL;
+ int *styles = NULL;
+ int cnt, which;
+ char *pt, *lparen;
+ char *find = NULL;
+
+ if ((pt = strrchr(filename,'/'))!=NULL ) pt = filename;
+ if ( (lparen = strchr(filename,'('))!=NULL && strchr(lparen,')')!=NULL ) {
+ find = copy(lparen+1);
+ pt = strchr(find,')');
+ if ( pt!=NULL ) *pt='\0';
+ for ( test=fondlist; test!=NULL; test=test->next ) {
+ for ( i=0; i<48; ++i )
+ if ( test->psnames[i]!=NULL && strcmp(find,test->psnames[i])==0 ) {
+ *style = (i&3) | ((i&~3)<<1); /* PS styles skip underline bit */
+ *name = copy(test->psnames[i]);
+return( test );
+ }
+ }
+ }
+
+ /* The file may contain multiple families, and each family may contain */
+ /* multiple styles (and each style may contain multiple sizes, but that's */
+ /* not an issue for us here) */
+ names = NULL;
+ for ( i=0; i<2; ++i ) {
+ cnt = 0;
+ for ( test=fondlist; test!=NULL; test=test->next ) if ( test->fondname!=NULL ) {
+ memset(stylesused,0,sizeof(stylesused));
+ for ( j=0; j<test->assoc_cnt; ++j ) {
+ if ( test->assoc[j].size!=0 && !stylesused[test->assoc[j].style]) {
+ stylesused[test->assoc[j].style]=true;
+ if ( names!=NULL ) {
+ names[cnt] = BuildName(test->fondname,test->assoc[j].style);
+ styles[cnt] = test->assoc[j].style;
+ fonds[cnt] = test;
+ }
+ ++cnt;
+ }
+ }
+ }
+ if ( names==NULL ) {
+ names = gcalloc(cnt+1,sizeof(char *));
+ fonds = galloc(cnt*sizeof(FOND *));
+ styles = galloc(cnt*sizeof(int));
+ }
+ }
+
+ if ( find!=NULL ) {
+ for ( which=cnt-1; which>=0; --which )
+ if ( strcmp(names[which],find)==0 )
+ break;
+ if ( which==-1 && strstrmatch(find,test->fondname)!=NULL )
+ which = GuessStyle(find,styles,cnt);
+ if ( which==-1 ) {
+ char *fn = copy(filename);
+ fn[lparen-filename] = '\0';
+ ff_post_error(_("Not in Collection"),_("%s is not in %.100s"),find,fn);
+ free(fn);
+ }
+ free(find);
+ } else
+ which = 0;
+
+ if ( which!=-1 ) {
+ fond = fonds[which];
+ *name = copy(names[which]);
+ *style = styles[which];
+ }
+ for ( i=0; i<cnt; ++i )
+ free(names[i]);
+ free(names); free(fonds); free(styles);
+ if ( which==-1 )
+return( NULL );
+
+return( fond );
+}
+
+
+/* Look for kerning info and merge it into the currently existing font "into" */
+static SplineFont *FindFamilyStyleKerns(SplineFont *into,EncMap *map,FOND *fondlist,char *filename) {
+ char *name;
+ int style;
+ FOND *fond;
+ int i,j;
+ int ch1, ch2, offset;
+ KernPair *kp;
+ SplineChar *sc1, *sc2;
+
+ fond = PickFOND(fondlist,filename,&name,&style);
+ if ( fond==NULL || into==NULL )
+return( NULL );
+ for ( i=0; i<fond->stylekerncnt; ++i )
+ if ( fond->stylekerns[i].style==style )
+ break;
+ if ( i==fond->stylekerncnt ) {
+ LogError(_("No kerning table for %s\n"), name );
+ free(name);
+return( NULL );
+ }
+ for ( j=0; j<fond->stylekerns[i].kernpairs; ++j ) {
+ ch1 = fond->stylekerns[i].kerns[j].ch1;
+ ch2 = fond->stylekerns[i].kerns[j].ch2;
+ offset = (fond->stylekerns[i].kerns[j].offset*(into->ascent+into->descent)+(1<<11))>>12;
+ sc1 = SFMakeChar(into,map,ch1);
+ sc2 = SFMakeChar(into,map,ch2);
+ for ( kp=sc1->kerns; kp!=NULL; kp=kp->next )
+ if ( kp->sc==sc2 )
+ break;
+ if ( kp==NULL ) {
+ uint32 script;
+ kp = chunkalloc(sizeof(KernPair));
+ kp->sc = sc2;
+ kp->next = sc1->kerns;
+ sc1->kerns = kp;
+ script = SCScriptFromUnicode(sc1);
+ if ( script==DEFAULT_SCRIPT )
+ script = SCScriptFromUnicode(sc2);
+ kp->subtable = SFSubTableFindOrMake(sc1->parent,CHR('k','e','r','n'),
+ script, gpos_pair);
+ }
+ kp->off = offset;
+ }
+return( into );
+}
+
+/* Look for a bare truetype font in a binhex/macbinary wrapper */
+static SplineFont *MightBeTrueType(FILE *binary,int32 pos,int32 dlen,int flags,
+ enum openflags openflags) {
+ FILE *temp = tmpfile();
+ char *buffer = galloc(8192);
+ int len;
+ SplineFont *sf;
+
+ if ( flags&ttf_onlynames ) {
+ char **ret;
+ char *temp = TTFGetFontName(binary,pos,pos);
+ if ( temp==NULL )
+return( NULL );
+ ret = galloc(2*sizeof(char *));
+ ret[0] = temp;
+ ret[1] = NULL;
+return( (SplineFont *) ret );
+ }
+
+ fseek(binary,pos,SEEK_SET);
+ while ( dlen>0 ) {
+ len = dlen > 8192 ? 8192 : dlen;
+ len = fread(buffer,1,dlen > 8192 ? 8192 : dlen,binary);
+ if ( len==0 )
+ break;
+ fwrite(buffer,1,len,temp);
+ dlen -= len;
+ }
+ rewind(temp);
+ sf = _SFReadTTF(temp,flags,openflags,NULL,NULL);
+ fclose(temp);
+ free(buffer);
+return( sf );
+}
+
+static SplineFont *IsResourceFork(FILE *f, long offset,char *filename,int flags,
+ enum openflags openflags, SplineFont *into,EncMap *map) {
+ /* If it is a good resource fork then the first 16 bytes are repeated */
+ /* at the location specified in bytes 4-7 */
+ /* We include an offset because if we are looking at a mac binary file */
+ /* the resource fork will actually start somewhere in the middle of the */
+ /* file, not at the beginning */
+ unsigned char buffer[16], buffer2[16];
+ long rdata_pos, map_pos, type_list, name_list, rpos;
+ int32 rdata_len, map_len;
+ uint32 nfnt_pos, font_pos, fond_pos;
+ unsigned long tag;
+ int i, cnt, subcnt, nfnt_subcnt=0, font_subcnt=0, fond_subcnt=0;
+ SplineFont *sf;
+ FOND *fondlist=NULL;
+ fond_pos=0;
+ fseek(f,offset,SEEK_SET);
+ if ( fread(buffer,1,16,f)!=16 )
+return( NULL );
+ rdata_pos = offset + ((buffer[0]<<24)|(buffer[1]<<16)|(buffer[2]<<8)|buffer[3]);
+ map_pos = offset + ((buffer[4]<<24)|(buffer[5]<<16)|(buffer[6]<<8)|buffer[7]);
+ rdata_len = ((buffer[8]<<24)|(buffer[9]<<16)|(buffer[10]<<8)|buffer[11]);
+ map_len = ((buffer[12]<<24)|(buffer[13]<<16)|(buffer[14]<<8)|buffer[15]);
+ if ( rdata_pos+rdata_len!=map_pos || rdata_len==0 )
+return( NULL );
+ fseek(f,map_pos,SEEK_SET);
+ buffer2[15] = buffer[15]+1; /* make it be different */
+ if ( fread(buffer2,1,16,f)!=16 )
+return( NULL );
+
+/* Apple's data fork resources appear to have a bunch of zeroes here instead */
+/* of a copy of the first 16 bytes */
+ for ( i=0; i<16; ++i )
+ if ( buffer2[i]!=0 )
+ break;
+ if ( i!=16 ) {
+ for ( i=0; i<16; ++i )
+ if ( buffer[i]!=buffer2[i] )
+return( NULL );
+ }
+ getlong(f); /* skip the handle to the next resource map */
+ getushort(f); /* skip the file resource number */
+ getushort(f); /* skip the attributes */
+ type_list = map_pos + getushort(f);
+ name_list = map_pos + getushort(f);
+
+ fseek(f,type_list,SEEK_SET);
+ cnt = getushort(f)+1;
+ for ( i=0; i<cnt; ++i ) {
+ tag = getlong(f);
+ /* printf( "%c%c%c%c\n", tag>>24, (tag>>16)&0xff, (tag>>8)&0xff, tag&0xff );*/
+ subcnt = getushort(f)+1;
+ rpos = type_list+getushort(f);
+ sf = NULL;
+ if ( tag==CHR('P','O','S','T') && !(flags&(ttf_onlystrikes|ttf_onlykerns))) /* No FOND */
+ sf = SearchPostscriptResources(f,rpos,subcnt,rdata_pos,name_list,flags);
+ else if ( tag==CHR('s','f','n','t') && !(flags&ttf_onlykerns))
+ sf = SearchTtfResources(f,rpos,subcnt,rdata_pos,name_list,filename,flags,openflags);
+ else if ( tag==CHR('N','F','N','T') ) {
+ nfnt_pos = rpos;
+ nfnt_subcnt = subcnt;
+ } else if ( tag==CHR('F','O','N','T') ) {
+ font_pos = rpos;
+ font_subcnt = subcnt;
+ } else if ( tag==CHR('F','O','N','D') ) {
+ fond_pos = rpos;
+ fond_subcnt = subcnt;
+ }
+ if ( sf!=NULL )
+return( sf );
+ }
+ if ( flags&ttf_onlynames ) /* Not interested in bitmap resources here */
+return( NULL );
+
+ if ( flags&ttf_onlykerns ) { /* For kerns */
+ if ( fond_subcnt!=0 )
+ fondlist = BuildFondList(f,fond_pos,fond_subcnt,rdata_pos,name_list,flags);
+ into = FindFamilyStyleKerns(into,map,fondlist,filename);
+ FondListFree(fondlist);
+return( into );
+ }
+ /* Ok. If no outline font, try for a bitmap */
+ if ( nfnt_subcnt==0 ) {
+ nfnt_pos = font_pos;
+ nfnt_subcnt = font_subcnt;
+ }
+return( (SplineFont *) -1 ); /* It's a valid resource file, but just has no fonts */
+}
+
+
+static SplineFont *IsResourceInBinary(FILE *f,char *filename,int flags,
+ enum openflags openflags, SplineFont *into,EncMap *map) {
+ unsigned char header[128];
+ unsigned long offset, dlen, rlen;
+
+ if ( fread(header,1,128,f)!=128 )
+return( NULL );
+ if ( header[0]!=0 || header[74]!=0 || header[82]!=0 || header[1]<=0 ||
+ header[1]>33 || header[63]!=0 || header[2+header[1]]!=0 )
+return( NULL );
+ dlen = ((header[0x53]<<24)|(header[0x54]<<16)|(header[0x55]<<8)|header[0x56]);
+ rlen = ((header[0x57]<<24)|(header[0x58]<<16)|(header[0x59]<<8)|header[0x5a]);
+ /* 128 bytes for header, then the dlen is padded to a 128 byte boundary */
+ offset = 128 + ((dlen+127)&~127);
+/* Look for a bare truetype font in a binhex/macbinary wrapper */
+ if ( dlen!=0 && rlen<=dlen) {
+ int pos = ftell(f);
+ fread(header,1,4,f);
+ header[5] = '\0';
+ if ( strcmp((char *) header,"OTTO")==0 || strcmp((char *) header,"true")==0 ||
+ strcmp((char *) header,"ttcf")==0 ||
+ (header[0]==0 && header[1]==1 && header[2]==0 && header[3]==0))
+return( MightBeTrueType(f,pos,dlen,flags,openflags));
+ }
+return( IsResourceFork(f,offset,filename,flags,openflags,into,map));
+}
+
+static int lastch=0, repeat = 0;
+static void outchr(FILE *binary, int ch) {
+ int i;
+
+ if ( repeat ) {
+ if ( ch==0 ) {
+ /* no repeat, output a literal 0x90 (the repeat flag) */
+ lastch=0x90;
+ putc(lastch,binary);
+ } else {
+ for ( i=1; i<ch; ++i )
+ putc(lastch,binary);
+ }
+ repeat = 0;
+ } else if ( ch==0x90 ) {
+ repeat = 1;
+ } else {
+ putc(ch,binary);
+ lastch = ch;
+ }
+}
+
+static SplineFont *IsResourceInHex(FILE *f,char *filename,int flags,enum openflags openflags,
+ SplineFont *into,EncMap *map) {
+ /* convert file from 6bit to 8bit */
+ /* interesting data is enclosed between two colons */
+ FILE *binary = tmpfile();
+ char *sixbit = "!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr";
+ int ch, val, cnt, i, dlen, rlen;
+ unsigned char header[20]; char *pt;
+ SplineFont *ret;
+
+ if ( binary==NULL ) {
+ LogError( _("can't create temporary file\n") );
+return( NULL );
+ }
+
+ lastch = repeat = 0;
+ while ( (ch=getc(f))!=':' ); /* There may be comments before file start */
+ cnt = val = 0;
+ while ( (ch=getc(f))!=':' ) {
+ if ( isspace(ch))
+ continue;
+ for ( pt=sixbit; *pt!=ch && *pt!='\0'; ++pt );
+ if ( *pt=='\0' ) {
+ fclose(binary);
+return( NULL );
+ }
+ val = (val<<6) | (pt-sixbit);
+ if ( ++cnt==4 ) {
+ outchr(binary,(val>>16)&0xff);
+ outchr(binary,(val>>8)&0xff);
+ outchr(binary,val&0xff);
+ val = cnt = 0;
+ }
+ }
+ if ( cnt!=0 ) {
+ if ( cnt==1 )
+ outchr(binary,val<<2);
+ else if ( cnt==2 ) {
+ val<<=4;
+ outchr(binary,(val>>8)&0xff);
+ outchr(binary,val&0xff);
+ } else if ( cnt==3 ) {
+ val<<=6;
+ outchr(binary,(val>>16)&0xff);
+ outchr(binary,(val>>8)&0xff);
+ outchr(binary,val&0xff);
+ }
+ }
+
+ rewind(binary);
+ ch = getc(binary); /* Name length */
+ /* skip name */
+ for ( i=0; i<ch; ++i )
+ getc(binary);
+ if ( getc(binary)!='\0' ) {
+ fclose(binary);
+return( NULL );
+ }
+ fread(header,1,20,binary);
+ dlen = (header[10]<<24)|(header[11]<<16)|(header[12]<<8)|header[13];
+ rlen = (header[14]<<24)|(header[15]<<16)|(header[16]<<8)|header[17];
+/* Look for a bare truetype font in a binhex/macbinary wrapper */
+ if ( dlen!=0 && rlen<dlen ) {
+ int pos = ftell(binary);
+ fread(header,1,4,binary);
+ header[5] = '\0';
+ if ( strcmp((char *) header,"OTTO")==0 || strcmp((char *) header,"true")==0 ||
+ strcmp((char *) header,"ttcf")==0 ||
+ (header[0]==0 && header[1]==1 && header[2]==0 && header[3]==0)) {
+ ret = MightBeTrueType(binary,pos,dlen,flags,openflags);
+ fclose(binary);
+return( ret );
+ }
+ }
+ if ( rlen==0 ) {
+ fclose(binary);
+return( NULL );
+ }
+
+ ret = IsResourceFork(binary,ftell(binary)+dlen+2,filename,flags,openflags,into,map);
+
+ fclose(binary);
+return( ret );
+}
+
+static SplineFont *IsResourceInFile(char *filename,int flags,enum openflags openflags,
+ SplineFont *into, EncMap *map) {
+ FILE *f;
+ char *spt, *pt;
+ SplineFont *sf;
+ char *temp=filename, *lparen;
+
+ if (( pt=strrchr(filename,'/'))==NULL ) pt = filename;
+ if ( (lparen = strchr(pt,'('))!=NULL && strchr(lparen,')')!=NULL ) {
+ temp = copy(filename);
+ temp[lparen-filename] = '\0';
+ }
+ f = fopen(temp,"rb");
+ if ( temp!=filename ) free(temp);
+ if ( f==NULL )
+return( NULL );
+ spt = strrchr(filename,'/');
+ if ( spt==NULL ) spt = filename;
+ pt = strrchr(spt,'.');
+ if ( pt!=NULL && (pt[1]=='b' || pt[1]=='B') && (pt[2]=='i' || pt[2]=='I') &&
+ (pt[3]=='n' || pt[3]=='N') && (pt[4]=='\0' || pt[4]=='(') ) {
+ if ( (sf = IsResourceInBinary(f,filename,flags,openflags,into,map))) {
+ fclose(f);
+return( sf );
+ }
+ } else if ( pt!=NULL && (pt[1]=='h' || pt[1]=='H') && (pt[2]=='q' || pt[2]=='Q') &&
+ (pt[3]=='x' || pt[3]=='X') && (pt[4]=='\0' || pt[4]=='(')) {
+ if ( (sf = IsResourceInHex(f,filename,flags,openflags,into,map))) {
+ fclose(f);
+return( sf );
+ }
+ }
+
+ sf = IsResourceFork(f,0,filename,flags,openflags,into,map);
+ fclose(f);
+#if __Mac
+ if ( sf==NULL )
+ sf = HasResourceFork(filename,flags,openflags,into,map);
+#endif
+return( sf );
+}
+
+static SplineFont *FindResourceFile(char *filename,int flags,enum openflags openflags,
+ SplineFont *into,EncMap *map) {
+ char *spt, *pt, *dpt;
+ char buffer[1400];
+ SplineFont *sf;
+
+ if ( (sf = IsResourceInFile(filename,flags,openflags,into,map)))
+return( sf );
+
+ /* Well, look in the resource fork directory (if it exists), the resource */
+ /* fork is placed there in a seperate file on (some) non-Mac disks */
+ strcpy(buffer,filename);
+ spt = strrchr(buffer,'/');
+ if ( spt==NULL ) { spt = buffer; pt = filename; }
+ else { ++spt; pt = filename + (spt-buffer); }
+ strcpy(spt,"resource.frk/");
+ strcat(spt,pt);
+ if ( (sf=IsResourceInFile(buffer,flags,openflags,into,map)))
+return( sf );
+
+ /* however the resource fork does not appear to do long names properly */
+ /* names are always lower case 8.3, do some simple things to check */
+ spt = strrchr(buffer,'/')+1;
+ for ( pt=spt; *pt; ++pt )
+ if ( isupper( *pt ))
+ *pt = tolower( *pt );
+ dpt = strchr(spt,'.');
+ if ( dpt==NULL ) dpt = spt+strlen(spt);
+ if ( dpt-spt>8 || strlen(dpt)>4 ) {
+ char exten[8];
+ strncpy(exten,dpt,7);
+ exten[4] = '\0'; /* it includes the dot */
+ if ( dpt-spt>6 )
+ dpt = spt+6;
+ *dpt++ = '~';
+ *dpt++ = '1';
+ strcpy(dpt,exten);
+ }
+return( IsResourceInFile(buffer,flags,openflags,into,map));
+}
+
+SplineFont *SFReadMacBinary(char *filename,int flags,enum openflags openflags) {
+ SplineFont *sf = FindResourceFile(filename,flags,openflags,NULL,NULL);
+
+ if ( sf==NULL )
+ LogError( _("Couldn't find a font file named %s\n"), filename );
+ else if ( sf==(SplineFont *) (-1) ) {
+ LogError( _("%s is a mac resource file but contains no postscript or truetype fonts\n"), filename );
+ sf = NULL;
+ }
+return( sf );
+}
+
+char **NamesReadMacBinary(char *filename) {
+return( (char **) FindResourceFile(filename,ttf_onlynames,0,NULL,NULL));
+}
+
+/* should try to optimize this */
+SplineFont *SFReadMacBinaryInfo(char *filename,int flags,enum openflags openflags) {
+ SplineFont *sf = FindResourceFile(filename,flags,openflags,NULL,NULL);
+
+ if ( sf==NULL )
+ LogError( _("Couldn't find a font file named %s\n"), filename );
+ else if ( sf==(SplineFont *) (-1) ) {
+ LogError( _("%s is a mac resource file but contains no postscript or truetype fonts\n"), filename );
+ sf = NULL;
+ }
+return( sf );
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/macenc.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
index b1518e9099a..a44fc3ab5a6 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/macenc.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2007 by George Williams */
+/* Copyright (C) 2003-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -24,9 +24,10 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "pfaeditui.h"
+#include "fontforgevw.h"
#include <gkeysym.h>
#include <ustring.h>
+#include "ttf.h"
/*
The original data for these mappings may be found at
@@ -1133,16 +1134,37 @@ return( NULL );
size_t inlen, outlen;
if ( enc==NULL )
return( NULL );
- toutf8 = iconv_open("UTF-8",enc->iconv_name!=NULL?enc->iconv_name:enc->enc_name);
+#ifdef UNICHAR_16
+ toutf8 = iconv_open("UCS2",enc->iconv_name!=NULL?enc->iconv_name:enc->enc_name);
+#else
+ toutf8 = iconv_open("UCS4",enc->iconv_name!=NULL?enc->iconv_name:enc->enc_name);
+#endif
if ( toutf8==(iconv_t) -1 || toutf8==NULL )
return( NULL );
in = (char *) str;
inlen = strlen(in);
outlen = (inlen+1)*4;
out = (char *) (ret = galloc(outlen+2));
- iconv(toutf8,&in,&inlen,&out,&outlen);
+ if(iconv(toutf8,&in,&inlen,&out,&outlen)==-1)
+return( NULL );
+ out[0] = '\0';
+ iconv_close(toutf8);
+#ifdef UNICHAR_16
+ toutf8 = iconv_open("UTF-8","UCS2");
+#else
+ toutf8 = iconv_open("UTF-8","UCS4");
+#endif
+ if ( toutf8==(iconv_t) -1 || toutf8==NULL )
+return( NULL );
+ in = (char *) strdup(ret);
+ inlen = strlen(in);
+ outlen = (inlen+1)*4;
+ out = (char *) (ret = galloc(outlen+2));
+ if(iconv(toutf8,&in,&inlen,&out,&outlen)==-1)
+return( NULL );
out[0] = '\0';
iconv_close(toutf8);
+ free(in);
return( ret );
}
@@ -1164,74 +1186,8 @@ return( NULL );
return( ret );
}
-char *Utf8ToMacStr(const char *ustr,int macenc,int maclang) {
- char *ret, *rpt;
- const unichar_t *table;
- int i, ch;
-
- if ( ustr==NULL )
-return( NULL );
-
- if ( macenc==sm_japanese || macenc==sm_korean || macenc==sm_tradchinese ||
- macenc == sm_simpchinese ) {
- Encoding *enc = FindOrMakeEncoding(macenc==sm_japanese ? "Sjis" :
- macenc==sm_korean ? "EUC-KR" :
- macenc==sm_tradchinese ? "Big5" :
- "EUC-CN" );
- iconv_t fromutf8;
- ICONV_CONST char *in;
- char *out;
- size_t inlen, outlen;
- if ( enc==NULL )
-return( NULL );
- fromutf8 = iconv_open(enc->iconv_name!=NULL?enc->iconv_name:enc->enc_name,"UTF-8");
- if ( fromutf8==(iconv_t) -1 || fromutf8==NULL )
-return( NULL );
- in = (char *) ustr;
- inlen = strlen(ustr);
- outlen = sizeof(unichar_t)*strlen(ustr);
- out = ret = galloc(outlen+sizeof(unichar_t));
- iconv(fromutf8,&in,&inlen,&out,&outlen);
- out[0] = out[1] = '\0';
-#ifndef UNICHAR_16
- out[2] = out[3] = '\0';
-#endif
- iconv_close(fromutf8);
-return( ret );
- }
-
- table = macencodings[macenc];
-
- if ( maclang==15 /* Icelandic */ ||
- maclang==30 /* Faroese */ ||
- maclang==149 /* Greenlandic */ )
- table = iceland;
- else if ( maclang == 17 /* turkish */ )
- table = turkish;
- else if ( maclang == 18 /* croatian */ )
- table = croatian;
- else if ( maclang == 37 /* romanian */ )
- table = romanian;
- else if ( maclang == 31 /* Farsi/Persian */ )
- table = farsi;
-
- if ( table==NULL )
-return( NULL );
-
- ret = galloc(strlen(ustr)+1);
- for ( rpt = ret; (ch=utf8_ildb(&ustr)); ) {
- for ( i=0; i<256; ++i )
- if ( table[i]==ch ) {
- *rpt++ = i;
- break;
- }
- }
- *rpt = '\0';
-return( ret );
-}
-
uint8 MacEncFromMacLang(int maclang) {
- if ( maclang<0 || maclang>=sizeof(_MacScriptFromLanguage)/sizeof(_MacScriptFromLanguage[0]))
+ if ( maclang<0 || maclang>=(int)(sizeof(_MacScriptFromLanguage)/sizeof(_MacScriptFromLanguage[0])))
return( 0xff );
return( _MacScriptFromLanguage[maclang] );
@@ -1239,7 +1195,7 @@ return( _MacScriptFromLanguage[maclang] );
uint16 WinLangFromMac(int maclang) {
- if ( maclang<0 || maclang>=sizeof(_WinLangFromMac)/sizeof(_WinLangFromMac[0]))
+ if ( maclang<0 || maclang>=(int)(sizeof(_WinLangFromMac)/sizeof(_WinLangFromMac[0])))
return( 0xffff );
return( _WinLangFromMac[maclang] );
@@ -1248,12 +1204,12 @@ return( _WinLangFromMac[maclang] );
uint16 WinLangToMac(int winlang) {
int i;
- for ( i=0; i<sizeof(_WinLangFromMac)/sizeof(_WinLangFromMac[0]); ++i )
+ for ( i=0; i<(int)(sizeof(_WinLangFromMac)/sizeof(_WinLangFromMac[0])); ++i )
if ( _WinLangFromMac[i] == winlang )
return( i );
winlang &= 0xff;
- for ( i=0; i<sizeof(_WinLangFromMac)/sizeof(_WinLangFromMac[0]); ++i )
+ for ( i=0; i<(int)(sizeof(_WinLangFromMac)/sizeof(_WinLangFromMac[0])); ++i )
if ( (_WinLangFromMac[i]&0xff) == winlang )
return( i );
@@ -1306,7 +1262,7 @@ return(found);
found = 34;
return( found );
}
- for ( i=0; i<sizeof(LanguageCodesFromMacLang)/sizeof(LanguageCodesFromMacLang[0]); ++i ) {
+ for ( i=0; i<(int)(sizeof(LanguageCodesFromMacLang)/sizeof(LanguageCodesFromMacLang[0])); ++i ) {
if ( LanguageCodesFromMacLang[i]!=NULL &&
strncmp(loc,LanguageCodesFromMacLang[i],strlen(LanguageCodesFromMacLang[i]))==0 ) {
found = i;
@@ -1354,42 +1310,6 @@ return( NULL );
return( MacStrToUtf8(mn->name,mn->enc,mn->lang));
}
-MacFeat *FindMacFeature(SplineFont *sf, int feat, MacFeat **secondary) {
- MacFeat *from_f, *from_p;
-
- for ( from_f = sf->features; from_f!=NULL && from_f->feature!=feat; from_f=from_f->next );
- for ( from_p = default_mac_feature_map; from_p!=NULL && from_p->feature!=feat; from_p=from_p->next );
- if ( from_f!=NULL ) {
- if ( secondary!=NULL ) *secondary = from_p;
-return( from_f );
- }
- if ( secondary!=NULL ) *secondary = NULL;
-return( from_p );
-}
-
-struct macsetting *FindMacSetting(SplineFont *sf, int feat, int set,
- struct macsetting **secondary) {
- MacFeat *from_f, *from_p;
- struct macsetting *s_f, *s_p;
-
- if ( sf!=NULL )
- for ( from_f = sf->features; from_f!=NULL && from_f->feature!=feat; from_f=from_f->next );
- else
- from_f = NULL;
- for ( from_p = default_mac_feature_map; from_p!=NULL && from_p->feature!=feat; from_p=from_p->next );
- s_f = s_p = NULL;
- if ( from_f!=NULL )
- for ( s_f = from_f->settings; s_f!=NULL && s_f->setting!=set; s_f=s_f->next );
- if ( from_p!=NULL )
- for ( s_p = from_p->settings; s_p!=NULL && s_p->setting!=set; s_p=s_p->next );
- if ( s_f!=NULL ) {
- if ( secondary!=NULL ) *secondary = s_p;
-return( s_f );
- }
- if ( secondary!=NULL ) *secondary = NULL;
-return( s_p );
-}
-
struct macname *FindMacSettingName(SplineFont *sf, int feat, int set) {
MacFeat *from_f, *from_p;
struct macsetting *s;
@@ -1417,6 +1337,57 @@ return( s->setname );
return( NULL );
}
+struct macsettingname macfeat_otftag[] = {
+ { 1, 0, CHR('r','l','i','g') }, /* Required ligatures */
+ { 1, 2, CHR('l','i','g','a') }, /* Common ligatures */
+ { 1, 4, CHR('d','l','i','g') }, /* rare ligatures => discretionary */
+#if 0
+ { 1, 4, CHR('h','l','i','g') }, /* rare ligatures => historic */
+ { 1, 4, CHR('a','l','i','g') }, /* rare ligatures => ?ancient? */
+#endif
+ /* 2, 1, partially connected cursive */
+ { 2, 2, CHR('i','s','o','l') }, /* Arabic forms */
+ { 2, 2, CHR('c','a','l','t') }, /* ??? */
+ /* 3, 1, all caps */
+ /* 3, 2, all lower */
+ { 3, 3, CHR('s','m','c','p') }, /* small caps */
+ /* 3, 4, initial caps */
+ /* 3, 5, initial caps, small caps */
+ { 4, 0, CHR('v','r','t','2') }, /* vertical forms => vertical rotation */
+#if 0
+ { 4, 0, CHR('v','k','n','a') }, /* vertical forms => vertical kana */
+#endif
+ { 6, 0, CHR('t','n','u','m') }, /* monospace numbers => Tabular numbers */
+ { 10, 1, CHR('s','u','p','s') }, /* superior vertical position => superscript */
+ { 10, 2, CHR('s','u','b','s') }, /* inferior vertical position => subscript */
+#if 0
+ { 10, 3, CHR('s','u','p','s') }, /* ordinal vertical position => superscript */
+#endif
+ { 11, 1, CHR('a','f','r','c') }, /* vertical fraction => fraction ligature */
+ { 11, 2, CHR('f','r','a','c') }, /* diagonal fraction => fraction ligature */
+ { 16, 1, CHR('o','r','n','m') }, /* vertical fraction => fraction ligature */
+ { 20, 0, CHR('t','r','a','d') }, /* traditional characters => traditional forms */
+#if 0
+ { 20, 0, CHR('t','n','a','m') }, /* traditional characters => traditional names */
+#endif
+ { 20, 1, CHR('s','m','p','l') }, /* simplified characters */
+ { 20, 2, CHR('j','p','7','8') }, /* jis 1978 */
+ { 20, 3, CHR('j','p','8','3') }, /* jis 1983 */
+ { 20, 4, CHR('j','p','9','0') }, /* jis 1990 */
+ { 21, 0, CHR('o','n','u','m') }, /* lower case number => old style numbers */
+ { 22, 0, CHR('p','w','i','d') }, /* proportional text => proportional widths */
+ { 22, 2, CHR('h','w','i','d') }, /* half width text => half widths */
+ { 22, 3, CHR('f','w','i','d') }, /* full width text => full widths */
+ { 25, 0, CHR('f','w','i','d') }, /* full width kana => full widths */
+ { 25, 1, CHR('p','w','i','d') }, /* proportional kana => proportional widths */
+ { 26, 0, CHR('f','w','i','d') }, /* full width ideograph => full widths */
+ { 26, 1, CHR('p','w','i','d') }, /* proportional ideograph => proportional widths */
+ { 103, 0, CHR('h','w','i','d') }, /* half width cjk roman => half widths */
+ { 103, 1, CHR('p','w','i','d') }, /* proportional cjk roman => proportional widths */
+ { 103, 3, CHR('f','w','i','d') }, /* full width cjk roman => full widths */
+ { 0, 0, 0 }
+}, *user_macfeat_otftag;
+
static struct macname fs_names[] = {
{ &fs_names[146], 0, 0, "All Typographic Features" },
{ &fs_names[147], 0, 0, "All Type Features" },
@@ -1958,7 +1929,7 @@ static struct macname fs_names[] = {
{ NULL, 0, 4, "Volledige breedte" },
{ NULL, 0, 4, "Unicodeontleding" },
{ NULL, 0, 4, "Canonieke ontleding" },
- { NULL }
+ { NULL, 0, 0, NULL }
};
static struct macsetting fs_settings[] = {
@@ -2078,7 +2049,7 @@ static struct macsetting fs_settings[] = {
{ &fs_settings[112], 2, 0, &fs_names[142], 0 },
{ &fs_settings[113], 1, 0, &fs_names[141], 0 },
{ &fs_settings[114], 0, 0, &fs_names[140], 1 },
- { NULL }
+ { NULL, 0, 0, NULL, 0 }
};
static MacFeat fs_features[] = {
@@ -2109,57 +2080,13 @@ static MacFeat fs_features[] = {
{ &fs_features[23], 2, 1, 0, 0, &fs_names[11], &fs_settings[11] },
{ &fs_features[24], 1, 0, 0, 0, &fs_names[2], &fs_settings[8] },
{ &fs_features[25], 0, 0, 0, 0, &fs_names[0], &fs_settings[0] },
- { NULL }
+ { NULL, 0, 0, 0, 0, NULL, NULL }
};
MacFeat *default_mac_feature_map = &fs_features[26],
*builtin_mac_feature_map=&fs_features[26],
*user_mac_feature_map;
-static int MacNamesDiffer(struct macname *mn, struct macname *mn2) {
-
- for ( ; mn!=NULL && mn2!=NULL; mn=mn->next, mn2 = mn2->next ) {
- if ( mn->lang != mn2->lang || mn->enc!=mn2->enc ||
- strcmp(mn->name,mn2->name)!=0 )
-return( true );
- }
- if ( mn==mn2 ) /* Both NULL */
-return( false );
-
-return( true );
-}
-
-static int MacSettingsDiffer(struct macsetting *ms, struct macsetting *ms2) {
-
- for ( ; ms!=NULL && ms2!=NULL; ms=ms->next, ms2 = ms2->next ) {
- if ( ms->setting != ms2->setting ||
- ms->initially_enabled != ms2->initially_enabled ||
- MacNamesDiffer(ms->setname,ms2->setname) )
-return( true );
- }
- if ( ms==ms2 ) /* Both NULL */
-return( false );
-
-return( true );
-}
-
-int UserFeaturesDiffer(void) {
- MacFeat *mf, *mf2;
- if ( user_mac_feature_map==NULL )
-return( false );
- for ( mf=builtin_mac_feature_map, mf2=user_mac_feature_map;
- mf!=NULL && mf2!=NULL; mf=mf->next, mf2 = mf2->next ) {
- if ( mf->feature != mf2->feature || mf->ismutex != mf2->ismutex ||
- mf->default_setting != mf2->default_setting ||
- MacNamesDiffer(mf->featname,mf2->featname) ||
- MacSettingsDiffer(mf->settings,mf2->settings))
-return( true );
- }
- if ( mf==mf2 ) /* Both NULL */
-return( false );
-
-return( true );
-}
struct macname *MacNameCopy(struct macname *mn) {
struct macname *head=NULL, *last=NULL, *cur;
@@ -2179,180 +2106,129 @@ struct macname *MacNameCopy(struct macname *mn) {
return( head );
}
-#ifndef LUA_FF_LIB
-static struct macsetting *MacSettingCopy(struct macsetting *ms) {
- struct macsetting *head=NULL, *last, *cur;
-
- while ( ms!=NULL ) {
- cur = chunkalloc(sizeof(struct macsetting));
- cur->setting = ms->setting;
- cur->setname = MacNameCopy(ms->setname);
- cur->initially_enabled = ms->initially_enabled;
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- ms = ms->next;
- }
-return( head );
-}
-
-static MacFeat *MacFeatCopy(MacFeat *mf) {
- MacFeat *head=NULL, *last, *cur;
-
- while ( mf!=NULL ) {
- cur = chunkalloc(sizeof(MacFeat));
- cur->feature = mf->feature;
- cur->featname = MacNameCopy(mf->featname);
- cur->settings = MacSettingCopy(mf->settings);
- cur->ismutex = mf->ismutex;
- cur->default_setting = mf->default_setting;
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
- last = cur;
- mf = mf->next;
- }
-return( head );
-}
-#endif
-
-/* ************************************************************************** */
-static GTextInfo maclanguages[] = {
- { (unichar_t *) N_("English"), NULL, 0, 0, (void *) 0, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("French"), NULL, 0, 0, (void *) 1, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("German"), NULL, 0, 0, (void *) 2, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Italian"), NULL, 0, 0, (void *) 3, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Dutch"), NULL, 0, 0, (void *) 4, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Swedish"), NULL, 0, 0, (void *) 5, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Spanish"), NULL, 0, 0, (void *) 6, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Danish"), NULL, 0, 0, (void *) 7, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Portuguese"), NULL, 0, 0, (void *) 8, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Norwegian"), NULL, 0, 0, (void *) 9, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Hebrew"), NULL, 0, 0, (void *) 10, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Japanese"), NULL, 0, 0, (void *) 11, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Arabic"), NULL, 0, 0, (void *) 12, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Finnish"), NULL, 0, 0, (void *) 13, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Greek"), NULL, 0, 0, (void *) 14, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Icelandic"), NULL, 0, 0, (void *) 15, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Maltese"), NULL, 0, 0, (void *) 16, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Turkish"), NULL, 0, 0, (void *) 17, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Croatian"), NULL, 0, 0, (void *) 18, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Traditional Chinese"), NULL, 0, 0, (void *) 19, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Urdu"), NULL, 0, 0, (void *) 20, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Hindi"), NULL, 0, 0, (void *) 21, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Thai"), NULL, 0, 0, (void *) 22, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Korean"), NULL, 0, 0, (void *) 23, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lithuanian"), NULL, 0, 0, (void *) 24, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Polish"), NULL, 0, 0, (void *) 25, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Hungarian"), NULL, 0, 0, (void *) 26, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Estonian"), NULL, 0, 0, (void *) 27, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Latvian"), NULL, 0, 0, (void *) 28, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sami (Lappish)"), NULL, 0, 0, (void *) 29, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Faroese (Icelandic)"), NULL, 0, 0, (void *) 30, NULL, 0, 0, 0, 0, 0, 0, 1},
+/* Sigh. This list is duplicated in macencui.c */
+static struct { char *name; int code; } localmaclang[] = {
+ {N_("English"), 0},
+ {N_("French"), 1},
+ {N_("German"), 2},
+ {N_("Italian"), 3},
+ {N_("Dutch"), 4},
+ {N_("Swedish"), 5},
+ {N_("Spanish"), 6},
+ {N_("Danish"), 7},
+ {N_("Portuguese"), 8},
+ {N_("Norwegian"), 9},
+ {N_("Lang|Hebrew"), 10},
+ {N_("Japanese"), 11},
+ {N_("Lang|Arabic"), 12},
+ {N_("Finnish"), 13},
+ {N_("Lang|Greek"), 14},
+ {N_("Icelandic"), 15},
+ {N_("Maltese"), 16},
+ {N_("Turkish"), 17},
+ {N_("Croatian"), 18},
+ {N_("Traditional Chinese"), 19},
+ {N_("Urdu"), 20},
+ {N_("Hindi"), 21},
+ {N_("Lang|Thai"), 22},
+ {N_("Korean"), 23},
+ {N_("Lithuanian"), 24},
+ {N_("Polish"), 25},
+ {N_("Hungarian"), 26},
+ {N_("Estonian"), 27},
+ {N_("Latvian"), 28},
+ {N_("Sami (Lappish)"), 29},
+ {N_("Faroese (Icelandic)"), 30},
/* GT: See the long comment at "Property|New" */
-/* GT: The msgstr should contain a translation of "Farsi/Persian", ignore "Lang|" */
- { (unichar_t *) N_("Lang|Farsi/Persian"), NULL, 0, 0, (void *) 31, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Russian"), NULL, 0, 0, (void *) 32, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Simplified Chinese"), NULL, 0, 0, (void *) 33, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Flemish"), NULL, 0, 0, (void *) 34, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Irish Gaelic"), NULL, 0, 0, (void *) 35, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Albanian"), NULL, 0, 0, (void *) 36, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Romanian"), NULL, 0, 0, (void *) 37, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Czech"), NULL, 0, 0, (void *) 38, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slovak"), NULL, 0, 0, (void *) 39, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Slovenian"), NULL, 0, 0, (void *) 40, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Yiddish"), NULL, 0, 0, (void *) 41, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Serbian"), NULL, 0, 0, (void *) 42, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Macedonian"), NULL, 0, 0, (void *) 43, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Bulgarian"), NULL, 0, 0, (void *) 44, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Ukrainian"), NULL, 0, 0, (void *) 45, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Byelorussian"), NULL, 0, 0, (void *) 46, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Uzbek"), NULL, 0, 0, (void *) 47, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kazakh"), NULL, 0, 0, (void *) 48, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Axerbaijani (Cyrillic)"), NULL, 0, 0, (void *) 49, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Axerbaijani (Arabic)"), NULL, 0, 0, (void *) 50, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Armenian"), NULL, 0, 0, (void *) 51, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Georgian"), NULL, 0, 0, (void *) 52, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Moldavian"), NULL, 0, 0, (void *) 53, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kirghiz"), NULL, 0, 0, (void *) 54, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tajiki"), NULL, 0, 0, (void *) 55, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Turkmen"), NULL, 0, 0, (void *) 56, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mongolian (Mongolian)"), NULL, 0, 0, (void *) 57, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Mongolian (cyrillic)"), NULL, 0, 0, (void *) 58, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Pashto"), NULL, 0, 0, (void *) 59, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kurdish"), NULL, 0, 0, (void *) 60, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kashmiri"), NULL, 0, 0, (void *) 61, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sindhi"), NULL, 0, 0, (void *) 62, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Tibetan"), NULL, 0, 0, (void *) 63, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Nepali"), NULL, 0, 0, (void *) 64, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sanskrit"), NULL, 0, 0, (void *) 65, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Marathi"), NULL, 0, 0, (void *) 66, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Bengali"), NULL, 0, 0, (void *) 67, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Assamese"), NULL, 0, 0, (void *) 68, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Gujarati"), NULL, 0, 0, (void *) 69, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Punjabi"), NULL, 0, 0, (void *) 70, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Oriya"), NULL, 0, 0, (void *) 71, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Malayalam"), NULL, 0, 0, (void *) 72, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Kannada"), NULL, 0, 0, (void *) 73, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Tamil"), NULL, 0, 0, (void *) 74, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Telugu"), NULL, 0, 0, (void *) 75, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Sinhalese"), NULL, 0, 0, (void *) 76, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Burmese"), NULL, 0, 0, (void *) 77, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Khmer"), NULL, 0, 0, (void *) 78, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Lao"), NULL, 0, 0, (void *) 79, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Vietnamese"), NULL, 0, 0, (void *) 80, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Indonesian"), NULL, 0, 0, (void *) 81, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Tagalog"), NULL, 0, 0, (void *) 82, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Malay (roman)"), NULL, 0, 0, (void *) 83, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Malay (arabic)"), NULL, 0, 0, (void *) 84, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Amharic"), NULL, 0, 0, (void *) 85, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tigrinya"), NULL, 0, 0, (void *) 86, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Galla"), NULL, 0, 0, (void *) 87, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Somali"), NULL, 0, 0, (void *) 88, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Swahili"), NULL, 0, 0, (void *) 89, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Kinyarwanda/Ruanda"), NULL, 0, 0, (void *) 90, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Rundi"), NULL, 0, 0, (void *) 91, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Nyanja/Chewa"), NULL, 0, 0, (void *) 92, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Malagasy"), NULL, 0, 0, (void *) 93, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Esperanto"), NULL, 0, 0, (void *) 94, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Welsh"), NULL, 0, 0, (void *) 128, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Basque"), NULL, 0, 0, (void *) 129, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Catalan"), NULL, 0, 0, (void *) 130, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Latin"), NULL, 0, 0, (void *) 131, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Quechua"), NULL, 0, 0, (void *) 132, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Guarani"), NULL, 0, 0, (void *) 133, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Aymara"), NULL, 0, 0, (void *) 134, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tatar"), NULL, 0, 0, (void *) 135, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Lang|Uighur"), NULL, 0, 0, (void *) 136, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Dzongkha"), NULL, 0, 0, (void *) 137, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Javanese (roman)"), NULL, 0, 0, (void *) 138, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Sundanese (roman)"), NULL, 0, 0, (void *) 139, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Galician"), NULL, 0, 0, (void *) 140, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Afrikaans"), NULL, 0, 0, (void *) 141, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Breton"), NULL, 0, 0, (void *) 142, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Inuktitut"), NULL, 0, 0, (void *) 143, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Scottish Gaelic"), NULL, 0, 0, (void *) 144, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Manx Gaelic"), NULL, 0, 0, (void *) 145, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Irish Gaelic (with dot)"), NULL, 0, 0, (void *) 146, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Tongan"), NULL, 0, 0, (void *) 147, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Greek (polytonic)"), NULL, 0, 0, (void *) 148, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Greenlandic"), NULL, 0, 0, (void *) 149, NULL, 0, 0, 0, 0, 0, 0, 1},
- { (unichar_t *) N_("Azebaijani (roman)"), NULL, 0, 0, (void *) 150, NULL, 0, 0, 0, 0, 0, 0, 1},
- { NULL }};
-
-static void initmaclangs(void) {
- static int inited = false;
- int i;
-
- if ( !inited ) {
- inited = true;
- for ( i=0; maclanguages[i].text!=NULL; ++i )
- maclanguages[i].text = (unichar_t *) S_( (char *) maclanguages[i].text);
- }
-}
+/* GT: The msgstr should contain a translation of "Farsi/Persian"), ignore "Lang|" */
+ {N_("Lang|Farsi/Persian"), 31},
+ {N_("Russian"), 32},
+ {N_("Simplified Chinese"), 33},
+ {N_("Flemish"), 34},
+ {N_("Irish Gaelic"), 35},
+ {N_("Albanian"), 36},
+ {N_("Romanian"), 37},
+ {N_("Czech"), 38},
+ {N_("Slovak"), 39},
+ {N_("Slovenian"), 40},
+ {N_("Yiddish"), 41},
+ {N_("Serbian"), 42},
+ {N_("Macedonian"), 43},
+ {N_("Bulgarian"), 44},
+ {N_("Ukrainian"), 45},
+ {N_("Byelorussian"), 46},
+ {N_("Uzbek"), 47},
+ {N_("Kazakh"), 48},
+ {N_("Axerbaijani (Cyrillic)"), 49},
+ {N_("Axerbaijani (Arabic)"), 50},
+ {N_("Lang|Armenian"), 51},
+ {N_("Lang|Georgian"), 52},
+ {N_("Moldavian"), 53},
+ {N_("Kirghiz"), 54},
+ {N_("Tajiki"), 55},
+ {N_("Turkmen"), 56},
+ {N_("Mongolian (Mongolian)"), 57},
+ {N_("Mongolian (cyrillic)"), 58},
+ {N_("Pashto"), 59},
+ {N_("Kurdish"), 60},
+ {N_("Kashmiri"), 61},
+ {N_("Sindhi"), 62},
+ {N_("Lang|Tibetan"), 63},
+ {N_("Nepali"), 64},
+ {N_("Sanskrit"), 65},
+ {N_("Marathi"), 66},
+ {N_("Lang|Bengali"), 67},
+ {N_("Assamese"), 68},
+ {N_("Lang|Gujarati"), 69},
+ {N_("Punjabi"), 70},
+ {N_("Lang|Oriya"), 71},
+ {N_("Lang|Malayalam"), 72},
+ {N_("Lang|Kannada"), 73},
+ {N_("Lang|Tamil"), 74},
+ {N_("Lang|Telugu"), 75},
+ {N_("Lang|Sinhalese"), 76},
+ {N_("Burmese"), 77},
+ {N_("Lang|Khmer"), 78},
+ {N_("Lang|Lao"), 79},
+ {N_("Vietnamese"), 80},
+ {N_("Indonesian"), 81},
+ {N_("Lang|Tagalog"), 82},
+ {N_("Malay (roman)"), 83},
+ {N_("Malay (arabic)"), 84},
+ {N_("Lang|Amharic"), 85},
+ {N_("Tigrinya"), 86},
+ {N_("Galla"), 87},
+ {N_("Somali"), 88},
+ {N_("Swahili"), 89},
+ {N_("Kinyarwanda/Ruanda"), 90},
+ {N_("Rundi"), 91},
+ {N_("Nyanja/Chewa"), 92},
+ {N_("Malagasy"), 93},
+ {N_("Esperanto"), 94},
+ {N_("Welsh"), 128},
+ {N_("Basque"), 129},
+ {N_("Catalan"), 130},
+ {N_("Lang|Latin"), 131},
+ {N_("Quechua"), 132},
+ {N_("Guarani"), 133},
+ {N_("Aymara"), 134},
+ {N_("Tatar"), 135},
+ {N_("Lang|Uighur"), 136},
+ {N_("Dzongkha"), 137},
+ {N_("Javanese (roman)"), 138},
+ {N_("Sundanese (roman)"), 139},
+ {N_("Galician"), 140},
+ {N_("Afrikaans"), 141},
+ {N_("Breton"), 142},
+ {N_("Inuktitut"), 143},
+ {N_("Scottish Gaelic"), 144},
+ {N_("Manx Gaelic"), 145},
+ {N_("Irish Gaelic (with dot)"), 146},
+ {N_("Tongan"), 147},
+ {N_("Greek (polytonic)"), 148},
+ {N_("Greenlandic"), 149},
+ {N_("Azebaijani (roman)"), 150},
+ { NULL, 0 }};
char *MacLanguageFromCode(int code) {
int i;
@@ -2360,1242 +2236,9 @@ char *MacLanguageFromCode(int code) {
if ( code==-1 )
return( _("Unspecified Language") );
- initmaclangs();
- for ( i=0; maclanguages[i].text!=NULL; ++i )
- if ( (void *) (intpt) code == maclanguages[i].userdata )
-return( (char *) maclanguages[i].text );
+ for ( i=0; localmaclang[i].name!=NULL; ++i )
+ if ( code == localmaclang[i].code )
+return( S_(localmaclang[i].name) );
return( _("Unknown Language"));
}
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-
- /* These first three must match the values in prefs.c */
-#define CID_Features 101
-#define CID_FeatureDel 103
-#define CID_FeatureEdit 105
-
-#define CID_Settings 101
-#define CID_SettingDel 103
-#define CID_SettingEdit 105
-
-#define CID_NameList 201
-#define CID_NameNew 202
-#define CID_NameDel 203
-#define CID_NameEdit 205
-
-#define CID_Cancel 300
-#define CID_OK 301
-#define CID_Id 302
-#define CID_Name 303
-#define CID_Language 304
-#define CID_On 305
-#define CID_Mutex 306
-
-static char *spacer = " ⇒ "; /* right double arrow */
-
-static GTextInfo *Pref_MacNamesList(struct macname *all) {
- GTextInfo *ti;
- int i, j;
- struct macname *mn;
- char *temp, *full;
-
- initmaclangs();
-
- for ( i=0, mn=all; mn!=NULL; mn=mn->next, ++i );
- ti = gcalloc(i+1,sizeof( GTextInfo ));
-
- for ( i=0, mn=all; mn!=NULL; mn=mn->next, ++i ) {
- temp = MacStrToUtf8(mn->name,mn->enc,mn->lang);
- if ( temp==NULL )
- continue;
- for ( j=0 ; maclanguages[j].text!=0; ++j )
- if ( maclanguages[j].userdata == (void *) (intpt) (mn->lang ))
- break;
- if ( maclanguages[j].text!=0 ) {
- char *lang = (char *) maclanguages[j].text;
- full = galloc((strlen(lang)+strlen(temp)+strlen(spacer)+1));
- strcpy(full,lang);
- } else {
- char *hunh = "???";
- full = galloc((strlen(hunh)+strlen(temp)+strlen(spacer)+1));
- strcpy(full,hunh);
- }
- strcat(full,spacer);
- strcat(full,temp);
- free(temp);
- ti[i].text = (unichar_t *) full;
- ti[i].text_is_1byte = true;
- ti[i].userdata = (void *) mn;
- }
-return( ti );
-}
-
-static GTextInfo *Pref_SettingsList(struct macsetting *all) {
- GTextInfo *ti;
- int i;
- struct macsetting *ms;
- unichar_t *full; char *temp;
- char buf[20];
-
- for ( i=0, ms=all; ms!=NULL; ms=ms->next, ++i );
- ti = gcalloc(i+1,sizeof( GTextInfo ));
-
- for ( i=0, ms=all; ms!=NULL; ms=ms->next, ++i ) {
- temp = PickNameFromMacName(ms->setname);
- sprintf(buf,"%3d ", ms->setting);
- if ( temp==NULL )
- full = uc_copy(buf);
- else {
- full = galloc((strlen(buf)+strlen(temp)+1)*sizeof(unichar_t));
- uc_strcpy(full,buf);
- utf82u_strcpy(full+u_strlen(full),temp);
- free(temp);
- }
- ti[i].text = full;
- ti[i].userdata = ms;
- }
-return( ti );
-}
-
-static GTextInfo *Pref_FeaturesList(MacFeat *all) {
- GTextInfo *ti;
- int i;
- MacFeat *mf;
- char *temp;
- unichar_t *full;
- char buf[20];
-
- for ( i=0, mf=all; mf!=NULL; mf=mf->next, ++i );
- ti = gcalloc(i+1,sizeof( GTextInfo ));
-
- for ( i=0, mf=all; mf!=NULL; mf=mf->next, ++i ) {
- temp = PickNameFromMacName(mf->featname);
- sprintf(buf,"%3d ", mf->feature);
- if ( temp==NULL )
- full = uc_copy(buf);
- else {
- full = galloc((strlen(buf)+strlen(temp)+1)*sizeof(unichar_t));
- uc_strcpy(full,buf);
- utf82u_strcpy(full+u_strlen(full),temp);
- free(temp);
- }
- ti[i].text = full;
- ti[i].userdata = mf;
- }
-return( ti );
-}
-
-struct namedata {
- GWindow gw;
- int index;
- int done;
- struct macname *all, *changing;
- GGadget *namelist; /* Not in this dlg, in the dlg which created us */
-};
-
-static int name_e_h(GWindow gw, GEvent *event) {
- struct namedata *nd = GDrawGetUserData(gw);
- int i;
- int32 len;
- GTextInfo **ti, *sel;
- char *ret1, *temp; unichar_t *full;
- int val1, val2;
- struct macname *mn;
- int language;
-
- if ( event->type==et_close ) {
- nd->done = true;
- if ( nd->index==-1 )
- MacNameListFree(nd->changing);
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("prefs.html#Features");
-return( true );
- }
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- if ( GGadgetGetCid(event->u.control.g) == CID_Cancel ) {
- nd->done = true;
- if ( nd->index==-1 )
- MacNameListFree(nd->changing);
- } else if ( GGadgetGetCid(event->u.control.g) == CID_OK ) {
- sel = GGadgetGetListItemSelected(GWidgetGetControl(nd->gw,CID_Language));
- language = nd->changing->lang;
- if ( sel!=NULL )
- language = (intpt) sel->userdata;
- else if ( nd->index==-1 ) {
- gwwv_post_error(_("Bad Language"),_("Bad Language"));
-return( true );
- } /* Otherwise use the original language, it might not be one we recognize */
- if ( language != nd->changing->lang )
- nd->changing->enc = MacEncFromMacLang(language);
- nd->changing->lang = language;
- val1 = (nd->changing->enc<<16) | nd->changing->lang;
- ret1 = GGadgetGetTitle8(GWidgetGetControl(nd->gw,CID_Name));
- free(nd->changing->name);
- nd->changing->name = Utf8ToMacStr(ret1,nd->changing->enc,nd->changing->lang);
- free(ret1);
-
- ti = GGadgetGetList(nd->namelist,&len);
- for ( i=0; i<len; ++i ) if ( i!=nd->index ) {
- val2 = (((struct macname *) (ti[i]->userdata))->enc<<16) |
- (((struct macname *) (ti[i]->userdata))->lang);
- if ( val2==val1 ) {
- gwwv_post_error(_("This feature code is already used"),_("This feature code is already used"));
-return( true );
- }
- }
-
- temp = MacStrToUtf8(nd->changing->name,nd->changing->enc,nd->changing->lang);
- if ( sel!=NULL ) {
- const unichar_t *lang = sel->text;
- full = galloc((u_strlen(lang)+strlen(temp)+6)*sizeof(unichar_t));
- u_strcpy(full,lang);
- } else {
- char *hunh = "???";
- full = galloc((strlen(hunh)+strlen(temp)+6)*sizeof(unichar_t));
- uc_strcpy(full,hunh);
- }
- uc_strcat(full,spacer);
- utf82u_strcpy(full+u_strlen(full),temp);
-
- if ( nd->index==-1 )
- GListAddStr(nd->namelist,full,nd->changing);
- else {
- GListReplaceStr(nd->namelist,nd->index,full,nd->changing);
- if ( nd->all==nd->changing )
- nd->all = nd->changing->next;
- else {
- for ( mn=nd->all ; mn!=NULL && mn->next!=nd->changing; mn=mn->next );
- if ( mn!=NULL ) mn->next = nd->changing->next;
- }
- }
- nd->changing->next = NULL;
- if ( nd->all==NULL || val1< ((nd->all->enc<<16)|nd->all->lang) ) {
- nd->changing->next = nd->all;
- nd->all = nd->changing;
- } else {
- for ( mn=nd->all; mn->next!=NULL && ((mn->next->enc<<16)|mn->next->lang)<val1; mn=mn->next );
- nd->changing->next = mn->next;
- mn->next = nd->changing;
- }
- GGadgetSetUserData(nd->namelist,nd->all);
- nd->done = true;
- }
- }
-return( true );
-}
-
-static char *AskName(struct macname *changing,struct macname *all,GGadget *list, int index) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[8];
- GTextInfo label[8];
- struct namedata nd;
- int i;
-
- initmaclangs();
-
- memset(&nd,0,sizeof(nd));
- nd.namelist = list;
- nd.index = index;
- nd.changing = changing;
- nd.all = all;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Setting");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,270));
- pos.height = GDrawPointsToPixels(NULL,98);
- gw = GDrawCreateTopWindow(NULL,&pos,name_e_h,&nd,&wattrs);
- nd.gw = gw;
-
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
-
- label[0].text = (unichar_t *) _("_Language:");
- label[0].text_is_1byte = true;
- label[0].text_in_resource = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 5; gcd[0].gd.pos.y = 5+4;
- gcd[0].gd.flags = gg_enabled|gg_visible;
- gcd[0].creator = GLabelCreate;
-
- gcd[1].gd.pos.x = 60; gcd[1].gd.pos.y = 5;
- gcd[1].gd.pos.width = 200;
- gcd[1].gd.flags = gg_enabled|gg_visible | gg_list_alphabetic;
- gcd[1].gd.u.list = maclanguages;
- gcd[1].gd.cid = CID_Language;
- gcd[1].creator = GListButtonCreate;
-
- for ( i=0; maclanguages[i].text!=NULL; ++i ) {
- if ( maclanguages[i].userdata == (void *) (intpt) (changing->lang) )
- maclanguages[i].selected = true;
- else
- maclanguages[i].selected = false;
- if ( changing->lang==65535 )
- maclanguages[0].selected = true;
- }
-
- label[2].text = (unichar_t *) _("_Name:");
- label[2].text_is_1byte = true;
- label[2].text_in_resource = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.pos.x = 5; gcd[2].gd.pos.y = gcd[0].gd.pos.y+28;
- gcd[2].gd.flags = gg_enabled|gg_visible;
- gcd[2].creator = GLabelCreate;
-
- label[3].text = (unichar_t *) MacStrToUtf8(changing->name,changing->enc,changing->lang);
- label[3].text_is_1byte = true;
- gcd[3].gd.label = changing->name==NULL ? NULL : &label[3];
- gcd[3].gd.pos.x = gcd[1].gd.pos.x; gcd[3].gd.pos.y = gcd[2].gd.pos.y-4;
- gcd[3].gd.pos.width = 200;
- gcd[3].gd.flags = gg_enabled|gg_visible;
- gcd[3].gd.cid = CID_Name;
- gcd[3].creator = GTextFieldCreate;
-
- i = 4;
-
- gcd[i].gd.pos.x = 13-3; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+30;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_OK");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_OK;
- /*gcd[i].gd.handle_controlevent = Prefs_Ok;*/
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = -13; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_Cancel;
- gcd[i].creator = GButtonCreate;
-
- GGadgetsCreate(gw,gcd);
- GDrawSetVisible(gw,true);
- GWidgetIndicateFocusGadget(gcd[1].ret);
- while ( !nd.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-return( false );
-}
-
-static void ChangeName(GGadget *list,int index) {
- struct macname *mn = GGadgetGetListItemSelected(list)->userdata,
- *all = GGadgetGetUserData(list);
-
- AskName(mn,all,list,index);
-}
-
-static int Pref_NewName(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- GGadget *list = GWidgetGetControl(gw,CID_NameList);
- struct macname *new, *all;
-
- all = GGadgetGetUserData(list);
- new = chunkalloc(sizeof(struct macname));
- new->lang = -1;
- AskName(new,all,list,-1);
- }
-return( true );
-}
-
-static int Pref_DelName(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct macname *mn, *p, *all, *next;
- GWindow gw = GGadgetGetWindow(g);
- GGadget *list = GWidgetGetControl(gw,CID_NameList);
- int32 len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- int i;
-
- all = GGadgetGetUserData(list);
- for ( mn = all, p=NULL; mn!=NULL; mn = next ) {
- next = mn->next;
- for ( i=len-1; i>=0; --i ) {
- if ( ti[i]->selected && ti[i]->userdata==mn )
- break;
- }
- if ( i>=0 ) {
- if ( p==NULL )
- all = next;
- else
- p->next = next;
- mn->next = NULL;
- MacNameListFree(mn);
- } else
- p = mn;
- }
- GGadgetSetUserData(list,all);
- GListDelSelected(list);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameDel),false);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameEdit),false);
- }
-return( true );
-}
-
-static int Pref_EditName(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GGadget *list = GWidgetGetControl(GGadgetGetWindow(g),CID_NameList);
- ChangeName(list,GGadgetGetFirstListSelectedItem(list));
- }
-return( true );
-}
-
-static int Pref_NameSel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(g,&len);
- GWindow gw = GGadgetGetWindow(g);
- int i, sel_cnt=0;
- for ( i=0; i<len; ++i )
- if ( ti[i]->selected ) ++sel_cnt;
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameDel),sel_cnt!=0);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameEdit),sel_cnt==1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- ChangeName(g,e->u.control.u.list.changed_index!=-1?e->u.control.u.list.changed_index:
- GGadgetGetFirstListSelectedItem(g));
- }
-return( true );
-}
-
-struct macname *NameGadgetsGetNames( GWindow gw ) {
-return( GGadgetGetUserData(GWidgetGetControl(gw,CID_NameList)) );
-}
-
-void NameGadgetsSetEnabled( GWindow gw, int enable ) {
-
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameList),enable);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameNew),enable);
- if ( !enable ) {
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameDel),false);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameEdit),false);
- } else {
- int32 len;
- GGadget *list = GWidgetGetControl(gw,CID_NameList);
- GTextInfo **ti = GGadgetGetList(list,&len);
- int i, sel_cnt=0;
- for ( i=0; i<len; ++i )
- if ( ti[i]->selected ) ++sel_cnt;
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameDel),sel_cnt>0);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_NameEdit),sel_cnt=1);
- }
-}
-
-int GCDBuildNames(GGadgetCreateData *gcd,GTextInfo *label,int pos,struct macname *names) {
-
- gcd[pos].gd.pos.x = 6; gcd[pos].gd.pos.y = pos==0 ? 6 :
- gcd[pos-1].creator==GTextFieldCreate ? gcd[pos-1].gd.pos.y+30 :
- gcd[pos-1].gd.pos.y+14;
- gcd[pos].gd.pos.width = 250; gcd[pos].gd.pos.height = 5*12+10;
- gcd[pos].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic | gg_list_multiplesel;
- gcd[pos].gd.cid = CID_NameList;
- gcd[pos].data = names = MacNameCopy(names);
- gcd[pos].gd.u.list = Pref_MacNamesList(names);
- gcd[pos].gd.handle_controlevent = Pref_NameSel;
- gcd[pos++].creator = GListCreate;
-
- gcd[pos].gd.pos.x = 6; gcd[pos].gd.pos.y = gcd[pos-1].gd.pos.y+gcd[pos-1].gd.pos.height+10;
- gcd[pos].gd.flags = gg_visible | gg_enabled;
- label[pos].text = (unichar_t *) S_("MacName|_New...");
- label[pos].text_is_1byte = true;
- label[pos].text_in_resource = true;
- gcd[pos].gd.label = &label[pos];
- gcd[pos].gd.handle_controlevent = Pref_NewName;
- gcd[pos].gd.cid = CID_NameNew;
- gcd[pos++].creator = GButtonCreate;
-
- gcd[pos].gd.pos.x = gcd[pos-1].gd.pos.x+20+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- gcd[pos].gd.pos.y = gcd[pos-1].gd.pos.y;
- gcd[pos].gd.flags = gg_visible ;
- label[pos].text = (unichar_t *) _("_Delete");
- label[pos].text_is_1byte = true;
- label[pos].text_in_resource = true;
- gcd[pos].gd.label = &label[pos];
- gcd[pos].gd.cid = CID_NameDel;
- gcd[pos].gd.handle_controlevent = Pref_DelName;
- gcd[pos++].creator = GButtonCreate;
-
- gcd[pos].gd.pos.x = gcd[pos-1].gd.pos.x+20+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- gcd[pos].gd.pos.y = gcd[pos-1].gd.pos.y;
- gcd[pos].gd.flags = gg_visible ;
- label[pos].text = (unichar_t *) _("_Edit...");
- label[pos].text_is_1byte = true;
- label[pos].text_in_resource = true;
- gcd[pos].gd.label = &label[pos];
- gcd[pos].gd.cid = CID_NameEdit;
- gcd[pos].gd.handle_controlevent = Pref_EditName;
- gcd[pos++].creator = GButtonCreate;
-
-return( pos );
-}
-
-struct setdata {
- GWindow gw;
- int index;
- int done;
- struct macsetting *all, *changing;
- GGadget *settinglist; /* Not in this dlg, in the dlg which created us */
-};
-
-static int set_e_h(GWindow gw, GEvent *event) {
- struct setdata *sd = GDrawGetUserData(gw);
- int i;
- int32 len;
- GTextInfo **ti;
- const unichar_t *ret1; unichar_t *end, *res; char *temp;
- int val1, val2;
- char buf[20];
- struct macsetting *ms;
-
- if ( event->type==et_close ) {
- sd->done = true;
- MacNameListFree(GGadgetGetUserData(GWidgetGetControl(sd->gw,CID_NameList)));
- if ( sd->index==-1 )
- MacSettingListFree(sd->changing);
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("prefs.html#Settings");
-return( true );
- }
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- if ( GGadgetGetCid(event->u.control.g) == CID_Cancel ) {
- sd->done = true;
- MacNameListFree(GGadgetGetUserData(GWidgetGetControl(sd->gw,CID_NameList)));
- if ( sd->index==-1 )
- MacSettingListFree(sd->changing);
- } else if ( GGadgetGetCid(event->u.control.g) == CID_OK ) {
- ret1 = _GGadgetGetTitle(GWidgetGetControl(sd->gw,CID_Id));
- val1 = u_strtol(ret1,&end,10);
- if ( *end!='\0' ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error(_("Bad Number"),_("Bad Number"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Bad Number"),_("Bad Number"));
-#endif
-return( true );
- }
- ti = GGadgetGetList(sd->settinglist,&len);
- for ( i=0; i<len; ++i ) if ( i!=sd->index ) {
- val2 = ((struct macsetting *) (ti[i]->userdata))->setting;
- if ( val2==val1 ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error(_("This setting is already used"),_("This setting is already used"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("This setting is already used"),_("This setting is already used"));
-#endif
-return( true );
- }
- }
- MacNameListFree(sd->changing->setname);
- sd->changing->setname = GGadgetGetUserData(GWidgetGetControl(sd->gw,CID_NameList));
- sd->changing->setting = val1;
- sd->changing->initially_enabled = GGadgetIsChecked(GWidgetGetControl(sd->gw,CID_On));
- if ( sd->changing->initially_enabled &&
- GGadgetIsChecked(GWidgetGetControl(GGadgetGetWindow(sd->settinglist),CID_Mutex)) ) {
- /* If the mutually exclusive bit were set in the feature then */
- /* turning this guy on, means we must turn others off */
- struct macsetting *test;
- for ( test = sd->all; test!=NULL; test = test->next )
- if ( test!=sd->changing )
- test->initially_enabled = false;
- }
-
- sprintf(buf,"%3d ", val1);
- temp = PickNameFromMacName(sd->changing->setname);
- len = strlen(temp);
- res = galloc( (strlen(buf)+len+3)*sizeof(unichar_t) );
- uc_strcpy(res,buf);
- utf82u_strcpy(res+u_strlen(res),temp);
- free(temp);
-
- if ( sd->index==-1 )
- GListAddStr(sd->settinglist,res,sd->changing);
- else {
- GListReplaceStr(sd->settinglist,sd->index,res,sd->changing);
- if ( sd->all==sd->changing )
- sd->all = sd->changing->next;
- else {
- for ( ms=sd->all ; ms!=NULL && ms->next!=sd->changing; ms=ms->next );
- if ( ms!=NULL ) ms->next = sd->changing->next;
- }
- }
- sd->changing->next = NULL;
- if ( sd->all==NULL || sd->changing->setting<sd->all->setting ) {
- sd->changing->next = sd->all;
- sd->all = sd->changing;
- } else {
- for ( ms=sd->all; ms->next!=NULL && ms->next->setting<sd->changing->setting; ms=ms->next );
- sd->changing->next = ms->next;
- ms->next = sd->changing;
- }
- GGadgetSetUserData(sd->settinglist,sd->all);
- sd->done = true;
- }
- }
-return( true );
-}
-
-static char *AskSetting(struct macsetting *changing,struct macsetting *all,
- GGadget *list, int index) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[12];
- GTextInfo label[12];
- struct setdata sd;
- char buf[20];
- int i;
-
- memset(&sd,0,sizeof(sd));
- sd.settinglist = list;
- sd.index = index;
- sd.changing = changing;
- sd.all = all;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Setting");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,270));
- pos.height = GDrawPointsToPixels(NULL,193);
- gw = GDrawCreateTopWindow(NULL,&pos,set_e_h,&sd,&wattrs);
- sd.gw = gw;
-
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
-
- label[0].text = (unichar_t *) _("Setting Id:");
- label[0].text_is_1byte = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 5; gcd[0].gd.pos.y = 5+4;
- gcd[0].gd.flags = gg_enabled|gg_visible;
- gcd[0].creator = GLabelCreate;
-
- sprintf( buf, "%d", changing->setting );
- label[1].text = (unichar_t *) buf;
- label[1].text_is_1byte = true;
- gcd[1].gd.label = &label[1];
- gcd[1].gd.pos.x = 60; gcd[1].gd.pos.y = 5; gcd[1].gd.pos.width = 40;
- gcd[1].gd.flags = gg_enabled|gg_visible;
- gcd[1].gd.cid = CID_Id;
- gcd[1].creator = GTextFieldCreate;
-
- label[2].text = (unichar_t *) _("_Enabled");
- label[2].text_is_1byte = true;
- label[2].text_in_resource = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.pos.x = 110; gcd[2].gd.pos.y = 5;
- gcd[2].gd.flags = gg_enabled|gg_visible | (changing->initially_enabled?gg_cb_on:0);
- gcd[2].gd.cid = CID_On;
- gcd[2].creator = GCheckBoxCreate;
-
- label[3].text = (unichar_t *) _("_Name:");
- label[3].text_is_1byte = true;
- label[3].text_in_resource = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.pos.x = 5; gcd[3].gd.pos.y = 5+24;
- gcd[3].gd.flags = gg_enabled|gg_visible;
- gcd[3].creator = GLabelCreate;
-
-
- i = GCDBuildNames(gcd,label,4,changing->setname);
-
- gcd[i].gd.pos.x = 13-3; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+35;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_OK");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_OK;
- /*gcd[i].gd.handle_controlevent = Prefs_Ok;*/
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = -13; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_Cancel;
- gcd[i].creator = GButtonCreate;
-
- GGadgetsCreate(gw,gcd);
- GTextInfoListFree(gcd[4].gd.u.list);
-
- GDrawSetVisible(gw,true);
- GWidgetIndicateFocusGadget(gcd[1].ret);
- while ( !sd.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-
-return( false );
-}
-
-static void ChangeSetting(GGadget *list,int index) {
- struct macsetting *ms = GGadgetGetListItemSelected(list)->userdata,
- *all = GGadgetGetUserData(list);
-
- AskSetting(ms,all,list,index);
-}
-
-static int Pref_NewSetting(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- GGadget *list = GWidgetGetControl(gw,CID_Settings);
- struct macsetting *new, *ms, *all;
- int expected=0;
-
- all = GGadgetGetUserData(list);
- if ( GGadgetIsChecked(GWidgetGetControl(gw,CID_Mutex)) ) {
- for ( ms=all; ms!=NULL; ms=ms->next ) {
- if ( ms->setting!=expected )
- break;
- ++expected;
- }
- } else {
- for ( ms=all; ms!=NULL; ms=ms->next ) {
- if ( ms->setting&1 ) /* Shouldn't be any odd settings for non-mutex */
- continue;
- if ( ms->setting!=expected )
- break;
- expected += 2;
- }
- }
- new = chunkalloc(sizeof(struct macsetting));
- new->setting = expected;
- AskSetting(new,all,list,-1);
- }
-return( true );
-}
-
-static int Pref_DelSetting(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- struct macsetting *ms, *p, *all, *next;
- GWindow gw = GGadgetGetWindow(g);
- GGadget *list = GWidgetGetControl(gw,CID_Settings);
- int32 len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- int i;
-
- all = GGadgetGetUserData(list);
- for ( ms = all, p=NULL; ms!=NULL; ms = next ) {
- next = ms->next;
- for ( i=len-1; i>=0; --i ) {
- if ( ti[i]->selected && ti[i]->userdata==ms )
- break;
- }
- if ( i>=0 ) {
- if ( p==NULL )
- all = next;
- else
- p->next = next;
- ms->next = NULL;
- MacSettingListFree(ms);
- } else
- p = ms;
- }
- GGadgetSetUserData(list,all);
- GListDelSelected(list);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_SettingDel),false);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_SettingEdit),false);
- }
-return( true );
-}
-
-static int Pref_EditSetting(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GGadget *list = GWidgetGetControl(GGadgetGetWindow(g),CID_Settings);
- ChangeSetting(list,GGadgetGetFirstListSelectedItem(list));
- }
-return( true );
-}
-
-static int Pref_SettingSel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(g,&len);
- GWindow gw = GGadgetGetWindow(g);
- int i, sel_cnt=0;
- for ( i=0; i<len; ++i )
- if ( ti[i]->selected ) ++sel_cnt;
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_SettingDel),sel_cnt!=0);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_SettingEdit),sel_cnt==1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- ChangeSetting(g,e->u.control.u.list.changed_index!=-1?e->u.control.u.list.changed_index:
- GGadgetGetFirstListSelectedItem(g));
- }
-return( true );
-}
-
-struct featdata {
- GWindow gw;
- int index;
- int done;
- MacFeat *all, *changing;
- GGadget *featurelist; /* Not in this dlg, in the dlg which created us */
-};
-
-static int feat_e_h(GWindow gw, GEvent *event) {
- struct featdata *fd = GDrawGetUserData(gw);
- int i;
- int32 len;
- GTextInfo **ti;
- const unichar_t *ret1; unichar_t *end, *res; char *temp;
- int val1, val2;
- char buf[20];
- MacFeat *mf;
-
- if ( event->type==et_close ) {
- fd->done = true;
- if ( fd->index==-1 )
- MacFeatListFree(fd->changing);
- MacSettingListFree(GGadgetGetUserData(GWidgetGetControl(fd->gw,CID_Settings)));
- MacNameListFree(GGadgetGetUserData(GWidgetGetControl(fd->gw,CID_NameList)));
- } else if ( event->type==et_char ) {
- if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
- help("prefs.html#Features");
-return( true );
- }
-return( false );
- } else if ( event->type==et_controlevent && event->u.control.subtype == et_buttonactivate ) {
- if ( GGadgetGetCid(event->u.control.g) == CID_Cancel ) {
- fd->done = true;
- if ( fd->index==-1 )
- MacFeatListFree(fd->changing);
- MacSettingListFree(GGadgetGetUserData(GWidgetGetControl(fd->gw,CID_Settings)));
- MacNameListFree(GGadgetGetUserData(GWidgetGetControl(fd->gw,CID_NameList)));
- } else if ( GGadgetGetCid(event->u.control.g) == CID_OK ) {
- ret1 = _GGadgetGetTitle(GWidgetGetControl(fd->gw,CID_Id));
- val1 = u_strtol(ret1,&end,10);
- if ( *end!='\0' ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error(_("Bad Number"),_("Bad Number"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Bad Number"),_("Bad Number"));
-#endif
-return( true );
- }
- ti = GGadgetGetList(fd->featurelist,&len);
- for ( i=0; i<len; ++i ) if ( i!=fd->index ) {
- val2 = ((MacFeat *) (ti[i]->userdata))->feature;
- if ( val2==val1 ) {
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_post_error(_("This feature code is already used"),_("This feature code is already used"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("This feature code is already used"),_("This feature code is already used"));
-#endif
-return( true );
- }
- }
- MacSettingListFree(fd->changing->settings);
- MacNameListFree(fd->changing->featname);
- fd->changing->featname = GGadgetGetUserData(GWidgetGetControl(fd->gw,CID_NameList));
- fd->changing->settings = GGadgetGetUserData(GWidgetGetControl(fd->gw,CID_Settings));
- fd->changing->ismutex = GGadgetIsChecked(GWidgetGetControl(fd->gw,CID_Mutex));
- if ( fd->changing->ismutex ) {
- struct macsetting *ms;
- for ( i=0, ms = fd->changing->settings; ms!=NULL && !ms->initially_enabled; ms = ms->next, ++i );
- if ( ms==NULL ) i = 0;
- fd->changing->default_setting = i;
- if ( ms!=NULL ) {
- for ( ms=ms->next ; ms!=NULL; ms = ms->next )
- ms->initially_enabled = false;
- }
- }
-
- sprintf(buf,"%3d ", val1);
- temp = PickNameFromMacName(fd->changing->featname);
- len = strlen(temp);
- res = galloc( (strlen(buf)+len+3)*sizeof(unichar_t) );
- uc_strcpy(res,buf);
- utf82u_strcpy(res+u_strlen(res),temp);
- free(temp);
-
- if ( fd->index==-1 )
- GListAddStr(fd->featurelist,res,fd->changing);
- else {
- GListReplaceStr(fd->featurelist,fd->index,res,fd->changing);
- if ( fd->all==fd->changing )
- fd->all = fd->changing->next;
- else {
- for ( mf=fd->all ; mf!=NULL && mf->next!=fd->changing; mf=mf->next );
- if ( mf!=NULL ) mf->next = fd->changing->next;
- }
- }
- fd->changing->next = NULL;
- if ( fd->all==NULL || fd->changing->feature<fd->all->feature ) {
- fd->changing->next = fd->all;
- fd->all = fd->changing;
- } else {
- for ( mf=fd->all; mf->next!=NULL && mf->next->feature<fd->changing->feature; mf=mf->next );
- fd->changing->next = mf->next;
- mf->next = fd->changing;
- }
- GGadgetSetUserData(fd->featurelist,fd->all);
- fd->done = true;
- }
- }
-return( true );
-}
-
-static char *AskFeature(MacFeat *changing,MacFeat *all,GGadget *list, int index) {
- GRect pos;
- GWindow gw;
- GWindowAttrs wattrs;
- GGadgetCreateData gcd[16];
- GTextInfo label[16], *freeme;
- struct featdata fd;
- char buf[20];
- int i;
-
- memset(&fd,0,sizeof(fd));
- fd.featurelist = list;
- fd.index = index;
- fd.changing = changing;
- fd.all = all;
-
- memset(&wattrs,0,sizeof(wattrs));
- wattrs.mask = wam_events|wam_cursor|wam_utf8_wtitle|wam_undercursor|wam_restrict;
- wattrs.event_masks = ~(1<<et_charup);
- wattrs.restrict_input_to_me = 1;
- wattrs.undercursor = 1;
- wattrs.cursor = ct_pointer;
- wattrs.utf8_window_title = _("Feature");
- pos.x = pos.y = 0;
- pos.width = GGadgetScale(GDrawPointsToPixels(NULL,265));
- pos.height = GDrawPointsToPixels(NULL,353);
- gw = GDrawCreateTopWindow(NULL,&pos,feat_e_h,&fd,&wattrs);
- fd.gw = gw;
-
- memset(gcd,0,sizeof(gcd));
- memset(label,0,sizeof(label));
-
- label[0].text = (unichar_t *) _("Feature _Id:");
- label[0].text_is_1byte = true;
- gcd[0].gd.label = &label[0];
- gcd[0].gd.pos.x = 5; gcd[0].gd.pos.y = 5+4;
- gcd[0].gd.flags = gg_enabled|gg_visible;
- gcd[0].creator = GLabelCreate;
-
- sprintf( buf, "%d", changing->feature );
- label[1].text = (unichar_t *) buf;
- label[1].text_is_1byte = true;
- gcd[1].gd.label = &label[1];
- gcd[1].gd.pos.x = 60; gcd[1].gd.pos.y = 5; gcd[1].gd.pos.width = 40;
- gcd[1].gd.flags = gg_enabled|gg_visible;
- gcd[1].gd.cid = CID_Id;
- gcd[1].creator = GTextFieldCreate;
-
- label[2].text = (unichar_t *) _("Mutually Exclusive");
- label[2].text_is_1byte = true;
- gcd[2].gd.label = &label[2];
- gcd[2].gd.pos.x = 105; gcd[2].gd.pos.y = 5+4;
- gcd[2].gd.flags = gg_enabled|gg_visible | (changing->ismutex?gg_cb_on:0);
- gcd[2].gd.cid = CID_Mutex;
- gcd[2].creator = GCheckBoxCreate;
-
- label[3].text = (unichar_t *) _("_Name:");
- label[3].text_is_1byte = true;
- label[3].text_in_resource = true;
- gcd[3].gd.label = &label[3];
- gcd[3].gd.pos.x = 5; gcd[3].gd.pos.y = 5+24;
- gcd[3].gd.flags = gg_enabled|gg_visible;
- gcd[3].creator = GLabelCreate;
-
- i = GCDBuildNames(gcd,label,4,changing->featname);
-
- label[i].text = (unichar_t *) _("Settings");
- label[i].text_is_1byte = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.pos.x = 5; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+35;
- gcd[i].gd.flags = gg_enabled|gg_visible;
- gcd[i++].creator = GLabelCreate;
-
- gcd[i].gd.pos.x = 6; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+14;
- gcd[i].gd.pos.width = 250; gcd[i].gd.pos.height = 8*12+10;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic | gg_list_multiplesel;
- gcd[i].gd.cid = CID_Settings;
- gcd[i].data = MacSettingCopy(changing->settings);
- gcd[i].gd.u.list = freeme = Pref_SettingsList(gcd[i].data);
- gcd[i].gd.handle_controlevent = Pref_SettingSel;
- gcd[i++].creator = GListCreate;
-
- gcd[i].gd.pos.x = 6; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+gcd[i-1].gd.pos.height+10;
- gcd[i].gd.flags = gg_visible | gg_enabled;
- label[i].text = (unichar_t *) S_("MacSetting|_New...");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.handle_controlevent = Pref_NewSetting;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = gcd[i-1].gd.pos.x+20+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- gcd[i].gd.pos.y = gcd[i-1].gd.pos.y;
- gcd[i].gd.flags = gg_visible ;
- label[i].text = (unichar_t *) _("_Delete");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_SettingDel;
- gcd[i].gd.handle_controlevent = Pref_DelSetting;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = gcd[i-1].gd.pos.x+20+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- gcd[i].gd.pos.y = gcd[i-1].gd.pos.y;
- gcd[i].gd.flags = gg_visible ;
- label[i].text = (unichar_t *) _("_Edit...");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_SettingEdit;
- gcd[i].gd.handle_controlevent = Pref_EditSetting;
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = 13-3; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+30;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_default;
- label[i].text = (unichar_t *) _("_OK");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_OK;
- /*gcd[i].gd.handle_controlevent = Prefs_Ok;*/
- gcd[i++].creator = GButtonCreate;
-
- gcd[i].gd.pos.x = -13; gcd[i].gd.pos.y = gcd[i-1].gd.pos.y+3;
- gcd[i].gd.pos.width = -1; gcd[i].gd.pos.height = 0;
- gcd[i].gd.flags = gg_visible | gg_enabled | gg_but_cancel;
- label[i].text = (unichar_t *) _("_Cancel");
- label[i].text_is_1byte = true;
- label[i].text_in_resource = true;
- gcd[i].gd.label = &label[i];
- gcd[i].gd.cid = CID_Cancel;
- gcd[i].creator = GButtonCreate;
-
- GGadgetsCreate(gw,gcd);
- GTextInfoListFree(gcd[4].gd.u.list);
- GTextInfoListFree(freeme);
-
- GDrawSetVisible(gw,true);
- GWidgetIndicateFocusGadget(gcd[1].ret);
- while ( !fd.done )
- GDrawProcessOneEvent(NULL);
- GDrawDestroyWindow(gw);
-
-return( false );
-}
-
-static void ChangeFeature(GGadget *list,int index) {
- MacFeat *mf = GGadgetGetListItemSelected(list)->userdata,
- *all = GGadgetGetUserData(list);
-
- AskFeature(mf,all,list,index);
-}
-
-static int Pref_NewFeat(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GWindow gw = GGadgetGetWindow(g);
- GGadget *list = GWidgetGetControl(gw,CID_Features);
- MacFeat *new, *mf, *all;
- int expected=0;
-
- all = GGadgetGetUserData(list);
- for ( mf=all; mf!=NULL; mf=mf->next ) {
- if ( mf->feature!=expected )
- break;
- ++expected;
- }
- new = chunkalloc(sizeof(MacFeat));
- new->feature = expected;
- AskFeature(new,all,list,-1);
- }
-return( true );
-}
-
-static int Pref_DelFeat(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- MacFeat *mf, *p, *all, *next;
- GWindow gw = GGadgetGetWindow(g);
- GGadget *list = GWidgetGetControl(gw,CID_Features);
- int32 len;
- GTextInfo **ti = GGadgetGetList(list,&len);
- int i;
-
- all = GGadgetGetUserData(list);
- for ( mf = all, p=NULL; mf!=NULL; mf = next ) {
- next = mf->next;
- for ( i=len-1; i>=0; --i ) {
- if ( ti[i]->selected && ti[i]->userdata==mf )
- break;
- }
- if ( i>=0 ) {
- if ( p==NULL )
- all = next;
- else
- p->next = next;
- mf->next = NULL;
- MacFeatListFree(mf);
- } else
- p = mf;
- }
- GGadgetSetUserData(list,all);
- GListDelSelected(list);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_FeatureDel),false);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_FeatureEdit),false);
- }
-return( true );
-}
-
-static int Pref_EditFeat(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GGadget *list = GWidgetGetControl(GGadgetGetWindow(g),CID_Features);
- ChangeFeature(list,GGadgetGetFirstListSelectedItem(list));
- }
-return( true );
-}
-
-static int Pref_FeatureSel(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_listselected ) {
- int32 len;
- GTextInfo **ti = GGadgetGetList(g,&len);
- GWindow gw = GGadgetGetWindow(g);
- int i, sel_cnt=0;
- for ( i=0; i<len; ++i )
- if ( ti[i]->selected ) ++sel_cnt;
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_FeatureDel),sel_cnt!=0);
- GGadgetSetEnabled(GWidgetGetControl(gw,CID_FeatureEdit),sel_cnt==1);
- } else if ( e->type==et_controlevent && e->u.control.subtype == et_listdoubleclick ) {
- ChangeFeature(g,e->u.control.u.list.changed_index!=-1?e->u.control.u.list.changed_index:
- GGadgetGetFirstListSelectedItem(g));
- }
-return( true );
-}
-
-static int Pref_DefaultFeat(GGadget *g, GEvent *e) {
- if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
- GGadget *list = GWidgetGetControl(GGadgetGetWindow(g),CID_Features);
- int inprefs = (intpt) GGadgetGetUserData(g);
- GTextInfo *ti, **arr;
- uint16 cnt;
- /* In preferences the default is the built in data. */
- /* in a font the default is the preference data (which might be built in or might not) */
- MacFeat *def = inprefs ? builtin_mac_feature_map : default_mac_feature_map;
-
- def = MacFeatCopy(def);
- MacFeatListFree(GGadgetGetUserData(list));
- GGadgetSetUserData(list,def);
- ti = Pref_FeaturesList(def);
- arr = GTextInfoArrayFromList(ti,&cnt);
- GGadgetSetList(list,arr,false);
- GTextInfoListFree(ti);
- }
-return( true );
-}
-
-void GCDFillMacFeat(GGadgetCreateData *mfgcd,GTextInfo *mflabels, int width,
- MacFeat *all, int fromprefs, GGadgetCreateData *boxes,
- GGadgetCreateData **array) {
- int sgc;
- GGadgetCreateData **butarray = array+4;
-
- all = MacFeatCopy(all);
-
- sgc = 0;
-
- mfgcd[sgc].gd.pos.x = 6; mfgcd[sgc].gd.pos.y = 6;
- mfgcd[sgc].gd.pos.width = 250; mfgcd[sgc].gd.pos.height = 16*12+10;
- mfgcd[sgc].gd.flags = gg_visible | gg_enabled | gg_list_alphabetic | gg_list_multiplesel;
- mfgcd[sgc].gd.cid = CID_Features;
- mfgcd[sgc].gd.u.list = Pref_FeaturesList(all);
- mfgcd[sgc].gd.handle_controlevent = Pref_FeatureSel;
- mfgcd[sgc].data = all;
- mfgcd[sgc++].creator = GListCreate;
- array[0] = &mfgcd[sgc-1];
-
- mfgcd[sgc].gd.pos.x = 6; mfgcd[sgc].gd.pos.y = mfgcd[sgc-1].gd.pos.y+mfgcd[sgc-1].gd.pos.height+10;
- mfgcd[sgc].gd.flags = gg_visible | gg_enabled;
- mflabels[sgc].text = (unichar_t *) S_("MacFeature|_New...");
- mflabels[sgc].text_is_1byte = true;
- mflabels[sgc].text_in_resource = true;
- mfgcd[sgc].gd.label = &mflabels[sgc];
- /*mfgcd[sgc].gd.cid = CID_AnchorRename;*/
- mfgcd[sgc].gd.handle_controlevent = Pref_NewFeat;
- mfgcd[sgc++].creator = GButtonCreate;
- butarray[0] = GCD_Glue; butarray[1] = &mfgcd[sgc-1];
-
- mfgcd[sgc].gd.pos.x = mfgcd[sgc-1].gd.pos.x+10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- mfgcd[sgc].gd.pos.y = mfgcd[sgc-1].gd.pos.y;
- mfgcd[sgc].gd.flags = gg_visible ;
- mflabels[sgc].text = (unichar_t *) _("_Delete");
- mflabels[sgc].text_is_1byte = true;
- mflabels[sgc].text_in_resource = true;
- mfgcd[sgc].gd.label = &mflabels[sgc];
- mfgcd[sgc].gd.cid = CID_FeatureDel;
- mfgcd[sgc].gd.handle_controlevent = Pref_DelFeat;
- mfgcd[sgc++].creator = GButtonCreate;
- butarray[2] = GCD_Glue; butarray[3] = &mfgcd[sgc-1];
-
- mfgcd[sgc].gd.pos.x = mfgcd[sgc-1].gd.pos.x+10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- mfgcd[sgc].gd.pos.y = mfgcd[sgc-1].gd.pos.y;
- mfgcd[sgc].gd.flags = gg_visible ;
- mflabels[sgc].text = (unichar_t *) _("_Edit...");
- mflabels[sgc].text_is_1byte = true;
- mflabels[sgc].text_in_resource = true;
- mfgcd[sgc].gd.label = &mflabels[sgc];
- mfgcd[sgc].gd.cid = CID_FeatureEdit;
- mfgcd[sgc].gd.handle_controlevent = Pref_EditFeat;
- mfgcd[sgc++].creator = GButtonCreate;
- butarray[4] = GCD_Glue; butarray[5] = &mfgcd[sgc-1];
-
- mfgcd[sgc].gd.pos.x = mfgcd[sgc-1].gd.pos.x+10+GIntGetResource(_NUM_Buttonsize)*100/GIntGetResource(_NUM_ScaleFactor);
- mfgcd[sgc].gd.pos.y = mfgcd[sgc-1].gd.pos.y;
- mfgcd[sgc].gd.flags = gg_visible|gg_enabled ;
- mflabels[sgc].text = (unichar_t *) S_("MacFeature|Default");
- mflabels[sgc].text_is_1byte = true;
- mfgcd[sgc].gd.label = &mflabels[sgc];
- mfgcd[sgc].gd.handle_controlevent = Pref_DefaultFeat;
- mfgcd[sgc].data = (void *) (intpt) fromprefs;
- mfgcd[sgc++].creator = GButtonCreate;
- butarray[6] = GCD_Glue; butarray[7] = &mfgcd[sgc-1];
- butarray[8] = GCD_Glue; butarray[9] = NULL;
-
- boxes[2].gd.flags = gg_enabled|gg_visible;
- boxes[2].gd.u.boxelements = butarray;
- boxes[2].creator = GHBoxCreate;
- array[1] = GCD_Glue;
- array[2] = &boxes[2];
- array[3] = NULL;
-
- boxes[0].gd.flags = gg_enabled|gg_visible;
- boxes[0].gd.u.boxelements = array;
- boxes[0].creator = GVBoxCreate;
-}
-
-void Prefs_ReplaceMacFeatures(GGadget *list) {
- MacFeatListFree(user_mac_feature_map);
- user_mac_feature_map = GGadgetGetUserData(list);
- default_mac_feature_map = user_mac_feature_map;
-}
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mathconstants.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mathconstants.c
new file mode 100644
index 00000000000..551b4419ecf
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mathconstants.c
@@ -0,0 +1,99 @@
+/* Copyright (C) 2007,2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "fontforgevw.h"
+#ifdef __need_size_t
+/* This is a bug on the mac, someone defines this and leaves it defined */
+/* that means when I load stddef.h it only defines size_t and doesn't */
+/* do offset_of, which is what I need */
+# undef __need_size_t
+#endif
+#include <stddef.h>
+
+#define MCD(ui_name,name,msg,np) { ui_name, #name, offsetof(struct MATH,name), -1,msg,np }
+#define MCDD(ui_name,name,devtab_name,msg,np) { ui_name, #name, offsetof(struct MATH,name), -2,msg,np }
+
+struct math_constants_descriptor math_constants_descriptor[] = {
+ MCD(N_("ScriptPercentScaleDown:"),ScriptPercentScaleDown,N_("Percentage scale down for script level 1"),0),
+ MCD(N_("ScriptScriptPercentScaleDown:"),ScriptScriptPercentScaleDown,N_("Percentage scale down for script level 2"),0),
+ MCD(N_("DelimitedSubFormulaMinHeight:"),DelimitedSubFormulaMinHeight,N_("Minimum height at which to treat a delimited\nexpression as a subformula"),0),
+ MCD(N_("DisplayOperatorMinHeight:"),DisplayOperatorMinHeight,N_("Minimum height of n-ary operators (integration, summation, etc.)"),0),
+ MCDD(N_("MathLeading:"),MathLeading,MathLeading_adjust,N_("White space to be left between math formulae\nto ensure proper line spacing."),0),
+ MCDD(N_("AxisHeight:"),AxisHeight,AxisHeight_adjust,N_("Axis height of the font"),0),
+ MCDD(N_("AccentBaseHeight:"),AccentBaseHeight,AccentBaseHeight_adjust,N_("Maximum (ink) height of accent base that\ndoes not require raising the accents."),0),
+ MCDD(N_("FlattenedAccentBaseHeight:"),FlattenedAccentBaseHeight,FlattenedAccentBaseHeight_adjust,N_("Maximum (ink) height of accent base that\ndoes not require flattening the accents."),0),
+ MCDD(N_("SubscriptShiftDown:"),SubscriptShiftDown,SubscriptShiftDown_adjust,N_("The standard shift down applied to subscript elements.\nPositive for moving downward."),1),
+ MCDD(N_("SubscriptTopMax:"),SubscriptTopMax,SubscriptTopMax_adjust,N_("Maximum height of the (ink) top of subscripts\nthat does not require moving\nubscripts further down."),0),
+ MCDD(N_("SubscriptBaselineDropMin:"),SubscriptBaselineDropMin,SubscriptBaselineDropMin_adjust,N_("Maximum allowed drop of the baseline of\nsubscripts realtive to the bottom of the base.\nUsed for bases that are treated as a box\nor extended shape. Positive for subscript\nbaseline dropped below base bottom."),0),
+ MCDD(N_("SuperscriptShiftUp:"),SuperscriptShiftUp,SuperscriptShiftUp_adjust,N_("Standard shift up applied to superscript elements."),0),
+ MCDD(N_("SuperscriptShiftUpCramped:"),SuperscriptShiftUpCramped,SuperscriptShiftUpCramped_adjust,N_("Standard shift of superscript relative\nto base in cramped mode."),0),
+ MCDD(N_("SuperscriptBottomMin:"),SuperscriptBottomMin,SuperscriptBottomMin_adjust,N_("Minimum allowed hieght of the bottom\nof superscripts that does not require moving\nthem further up."),0),
+ MCDD(N_("SuperscriptBaselineDropMax:"),SuperscriptBaselineDropMax,SuperscriptBaselineDropMax_adjust,N_("Maximum allowed drop of the baseline of\nsuperscripts realtive to the top of the base.\nUsed for bases that are treated as a box\nor extended shape. Positive for superscript\nbaseline below base top."),0),
+ MCDD(N_("SubSuperscriptGapMin:"),SubSuperscriptGapMin,SubSuperscriptGapMin_adjust,N_("Minimum gap between the supersecript and subscript ink."),0),
+ MCDD(N_("SuperscriptBottomMaxWithSubscript:"),SuperscriptBottomMaxWithSubscript,SuperscriptBottomMaxWithSubscript_adjust,N_("The maximum level to which the (ink) bottom\nof superscript can be pushed to increase the\ngap between superscript and subscript, before\nsubscript starts being moved down."),0),
+ MCDD(N_("SpaceAfterScript:"),SpaceAfterScript,SpaceAfterScript_adjust,N_("Extra white space to be added after each\nub/superscript."),0),
+ MCDD(N_("UpperLimitGapMin:"),UpperLimitGapMin,UpperLimitGapMin_adjust,N_("Minimum gap between the bottom of the\nupper limit, and the top of the base operator."),1),
+ MCDD(N_("UpperLimitBaselineRiseMin:"),UpperLimitBaselineRiseMin,UpperLimitBaselineRiseMin_adjust,N_("Minimum distance between the baseline of an upper\nlimit and the bottom of the base operator."),0),
+ MCDD(N_("LowerLimitGapMin:"),LowerLimitGapMin,LowerLimitGapMin_adjust,N_("Minimum gap between (ink) top of the lower limit,\nand (ink) bottom of the base operator."),0),
+ MCDD(N_("LowerLimitBaselineDropMin:"),LowerLimitBaselineDropMin,LowerLimitBaselineDropMin_adjust,N_("Minimum distance between the baseline of the\nlower limit and bottom of the base operator."),0),
+ MCDD(N_("StackTopShiftUp:"),StackTopShiftUp,StackTopShiftUp_adjust,N_("Standard shift up applied to the top element of a stack."),1),
+ MCDD(N_("StackTopDisplayStyleShiftUp:"),StackTopDisplayStyleShiftUp,StackTopDisplayStyleShiftUp_adjust,N_("Standard shift up applied to the top element of\na stack in display style."),0),
+ MCDD(N_("StackBottomShiftDown:"),StackBottomShiftDown,StackBottomShiftDown_adjust,N_("Standard shift down applied to the bottom element of a stack.\nPositive values indicate downward motion."),0),
+ MCDD(N_("StackBottomDisplayStyleShiftDown:"),StackBottomDisplayStyleShiftDown,StackBottomDisplayStyleShiftDown_adjust,N_("Standard shift down applied to the bottom\nelement of a stack in display style.\nPositive values indicate downward motion."),0),
+ MCDD(N_("StackGapMin:"),StackGapMin,StackGapMin_adjust,N_("Minimum gap between bottom of the top\nelement of a stack, and the top of the bottom element."),0),
+ MCDD(N_("StackDisplayStyleGapMin:"),StackDisplayStyleGapMin,StackDisplayStyleGapMin_adjust,N_("Minimum gap between bottom of the top\nelement of a stack and the top of the bottom\nelement in display style."),0),
+ MCDD(N_("StretchStackTopShiftUp:"),StretchStackTopShiftUp,StretchStackTopShiftUp_adjust,N_("Standard shift up applied to the top element of the stretch stack."),0),
+ MCDD(N_("StretchStackBottomShiftDown:"),StretchStackBottomShiftDown,StretchStackBottomShiftDown_adjust,N_("Standard shift down applied to the bottom\nelement of the stretch stack.\nPositive values indicate downward motion."),0),
+ MCDD(N_("StretchStackGapAboveMin:"),StretchStackGapAboveMin,StretchStackGapAboveMin_adjust,N_("Minimum gap between the ink of the stretched\nelement and the ink bottom of the element\nabove.."),0),
+ MCDD(N_("StretchStackGapBelowMin:"),StretchStackGapBelowMin,StretchStackGapBelowMin_adjust,N_("Minimum gap between the ink of the stretched\nelement and the ink top of the element below."),0),
+ MCDD(N_("FractionNumeratorShiftUp:"),FractionNumeratorShiftUp,FractionNumeratorShiftUp_adjust,N_("Standard shift up applied to the numerator."),1),
+ MCDD(N_("FractionNumeratorDisplayStyleShiftUp:"),FractionNumeratorDisplayStyleShiftUp,FractionNumeratorDisplayStyleShiftUp_adjust,N_("Standard shift up applied to the\nnumerator in display style."),0),
+ MCDD(N_("FractionDenominatorShiftDown:"),FractionDenominatorShiftDown,FractionDenominatorShiftDown_adjust,N_("Standard shift down applied to the denominator.\nPostive values indicate downward motion."),0),
+ MCDD(N_("FractionDenominatorDisplayStyleShiftDown:"),FractionDenominatorDisplayStyleShiftDown,FractionDenominatorDisplayStyleShiftDown_adjust,N_("Standard shift down applied to the\ndenominator in display style.\nPostive values indicate downward motion."),0),
+ MCDD(N_("FractionNumeratorGapMin:"),FractionNumeratorGapMin,FractionNumeratorGapMin_adjust,N_("Minimum tolerated gap between the ink\nbottom of the numerator and the ink of the fraction bar."),0),
+ MCDD(N_("FractionNumeratorDisplayStyleGapMin:"),FractionNumeratorDisplayStyleGapMin,FractionNumeratorDisplayStyleGapMin_adjust,N_("Minimum tolerated gap between the ink\nbottom of the numerator and the ink of the fraction\nbar in display style."),0),
+ MCDD(N_("FractionRuleThickness:"),FractionRuleThickness,FractionRuleThickness_adjust,N_("Thickness of the fraction bar."),0),
+ MCDD(N_("FractionDenominatorGapMin:"),FractionDenominatorGapMin,FractionDenominatorGapMin_adjust,N_("Minimum tolerated gap between the ink top of the denominator\nand the ink of the fraction bar.."),0),
+ MCDD(N_("FractionDenominatorDisplayStyleGapMin:"),FractionDenominatorDisplayStyleGapMin,FractionDenominatorDisplayStyleGapMin_adjust,N_("Minimum tolerated gap between the ink top of the denominator\nand the ink of the fraction bar in display style."),0),
+ MCDD(N_("SkewedFractionHorizontalGap:"),SkewedFractionHorizontalGap,SkewedFractionHorizontalGap_adjust,N_("Horizontal distance between the top\nand bottom elemnts of a skewed fraction."),0),
+ MCDD(N_("SkewedFractionVerticalGap:"),SkewedFractionVerticalGap,SkewedFractionVerticalGap_adjust,N_("Vertical distance between the ink of the top and\nbottom elements of a skewed fraction."),0),
+ MCDD(N_("OverbarVerticalGap:"),OverbarVerticalGap,OverbarVerticalGap_adjust,N_("Distance between the overbar and\nthe ink top of the base."),1),
+ MCDD(N_("OverbarRuleThickness:"),OverbarRuleThickness,OverbarRuleThickness_adjust,N_("Thickness of the overbar."),0),
+ MCDD(N_("OverbarExtraAscender:"),OverbarExtraAscender,OverbarExtraAscender_adjust,N_("Extra white space reserved above the overbar."),0),
+ MCDD(N_("UnderbarVerticalGap:"),UnderbarVerticalGap,UnderbarVerticalGap_adjust,N_("Distance between underbar and\nthe (ink) bottom of the base."),0),
+ MCDD(N_("UnderbarRuleThickness:"),UnderbarRuleThickness,UnderbarRuleThickness_adjust,N_("Thickness of the underbar."),0),
+ MCDD(N_("UnderbarExtraDescender:"),UnderbarExtraDescender,UnderbarExtraDescender_adjust,N_("Extra white space resevered below the underbar."),0),
+ MCDD(N_("RadicalVerticalGap:"),RadicalVerticalGap,RadicalVerticalGap_adjust,N_("Space between the ink to of the\nexpression and the bar over it."),1),
+ MCDD(N_("RadicalDisplayStyleVerticalGap:"),RadicalDisplayStyleVerticalGap,RadicalDisplayStyleVerticalGap_adjust,N_("Space between the ink top of the\nexpression and the bar over it in display\nstyle."),0),
+ MCDD(N_("RadicalRuleThickness:"),RadicalRuleThickness,RadicalRuleThickness_adjust,N_("Thickness of the radical rule in\ndesigned or constructed radical\nsigns."),0),
+ MCDD(N_("RadicalExtraAscender:"),RadicalExtraAscender,RadicalExtraAscender_adjust,N_("Extra white space reserved above the radical."),0),
+ MCDD(N_("RadicalKernBeforeDegree:"),RadicalKernBeforeDegree,RadicalKernBeforeDegree_adjust,N_("Extra horizontal kern before the degree of a\nradical if such be present."),0),
+ MCDD(N_("RadicalKernAfterDegree:"),RadicalKernAfterDegree,RadicalKernAfterDegree_adjust,N_("Negative horizontal kern after the degree of a\nradical if such be present."),0),
+ MCD(N_("RadicalDegreeBottomRaisePercent:"),RadicalDegreeBottomRaisePercent,N_("Height of the bottom of the radical degree, if\nsuch be present, in proportion to the ascender\nof the radical sign."),0),
+ MCD(N_("MinConnectorOverlap:"),MinConnectorOverlap,N_("Minimum overlap of connecting glyphs during\nglyph construction."),1),
+ { NULL, NULL, 0, 0, NULL, 0 }
+};
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c
new file mode 100644
index 00000000000..6bed24e9a54
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.c
@@ -0,0 +1,235 @@
+/* Copyright (C) 2003-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h"
+#include <ustring.h>
+#include <math.h>
+#include <utype.h>
+#include "ttf.h"
+#include "mm.h"
+
+char *MMAxisAbrev(char *axis_name) {
+ if ( strcmp(axis_name,"Weight")==0 )
+return( "wt" );
+ if ( strcmp(axis_name,"Width")==0 )
+return( "wd" );
+ if ( strcmp(axis_name,"OpticalSize")==0 )
+return( "op" );
+ if ( strcmp(axis_name,"Slant")==0 )
+return( "sl" );
+
+return( axis_name );
+}
+
+double MMAxisUnmap(MMSet *mm,int axis,double ncv) {
+ struct axismap *axismap = &mm->axismaps[axis];
+ int j;
+
+ if ( ncv<=axismap->blends[0] )
+return(axismap->designs[0]);
+
+ for ( j=1; j<axismap->points; ++j ) {
+ if ( ncv<=axismap->blends[j]) {
+ double t = (ncv-axismap->blends[j-1])/(axismap->blends[j]-axismap->blends[j-1]);
+return( axismap->designs[j-1]+ t*(axismap->designs[j]-axismap->designs[j-1]) );
+ }
+ }
+
+return(axismap->designs[axismap->points-1]);
+}
+
+static char *_MMMakeFontname(MMSet *mm,real *normalized,char **fullname) {
+ char *pt, *pt2, *hyphen=NULL;
+ char *ret = NULL;
+ int i,j;
+
+ if ( mm->apple ) {
+ for ( i=0; i<mm->named_instance_count; ++i ) {
+ for ( j=0; j<mm->axis_count; ++j ) {
+ if (( normalized[j] == -1 &&
+ RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].min) ) ||
+ ( normalized[j] == 0 &&
+ RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].def) ) ||
+ ( normalized[j] == 1 &&
+ RealApprox(mm->named_instances[i].coords[j],mm->axismaps[j].max) ))
+ /* A match so far */;
+ else
+ break;
+ }
+ if ( j==mm->axis_count )
+ break;
+ }
+ if ( i!=mm->named_instance_count ) {
+ char *styles = PickNameFromMacName(mm->named_instances[i].names);
+ if ( styles==NULL )
+ styles = FindEnglishNameInMacName(mm->named_instances[i].names);
+ if ( styles!=NULL ) {
+ ret = galloc(strlen(mm->normal->familyname)+ strlen(styles)+3 );
+ strcpy(ret,mm->normal->familyname);
+ hyphen = ret+strlen(ret);
+ strcpy(hyphen," ");
+ strcpy(hyphen+1,styles);
+ free(styles);
+ }
+ }
+ }
+
+ if ( ret==NULL ) {
+ pt = ret = galloc(strlen(mm->normal->familyname)+ mm->axis_count*15 + 1);
+ strcpy(pt,mm->normal->familyname);
+ pt += strlen(pt);
+ *pt++ = '_';
+ for ( i=0; i<mm->axis_count; ++i ) {
+ if ( !mm->apple )
+ sprintf( pt, " %d%s", (int) rint(MMAxisUnmap(mm,i,normalized[i])),
+ MMAxisAbrev(mm->axes[i]));
+ else
+ sprintf( pt, " %.1f%s", MMAxisUnmap(mm,i,normalized[i]),
+ MMAxisAbrev(mm->axes[i]));
+ pt += strlen(pt);
+ }
+ if ( pt>ret && pt[-1]==' ' )
+ --pt;
+ *pt = '\0';
+ }
+
+ *fullname = ret;
+
+ ret = copy(ret);
+ for ( pt=*fullname, pt2=ret; *pt!='\0'; ++pt )
+ if ( pt==hyphen )
+ *pt2++ = '-';
+ else if ( *pt!=' ' )
+ *pt2++ = *pt;
+ *pt2 = '\0';
+return( ret );
+}
+
+char *MMMakeMasterFontname(MMSet *mm,int ipos,char **fullname) {
+return( _MMMakeFontname(mm,&mm->positions[ipos*mm->axis_count],fullname));
+}
+
+static char *_MMGuessWeight(MMSet *mm,real *normalized,char *def) {
+ int i;
+ char *ret;
+ real design;
+
+ for ( i=0; i<mm->axis_count; ++i ) {
+ if ( strcmp(mm->axes[i],"Weight")==0 )
+ break;
+ }
+ if ( i==mm->axis_count )
+return( def );
+ design = MMAxisUnmap(mm,i,normalized[i]);
+ if ( design<50 || design>1500 ) /* Er... Probably not the 0...1000 range I expect */
+return( def );
+ ret = NULL;
+ if ( design<150 )
+ ret = "Thin";
+ else if ( design<350 )
+ ret = "Light";
+ else if ( design<550 )
+ ret = "Medium";
+ else if ( design<650 )
+ ret = "DemiBold";
+ else if ( design<750 )
+ ret = "Bold";
+ else if ( design<850 )
+ ret = "Heavy";
+ else
+ ret = "Black";
+ free( def );
+return( copy(ret) );
+}
+
+char *MMGuessWeight(MMSet *mm,int ipos,char *def) {
+return( _MMGuessWeight(mm,&mm->positions[ipos*mm->axis_count],def));
+}
+
+/* Given a postscript array of scalars, what's the ipos'th element? */
+char *MMExtractNth(char *pt,int ipos) {
+ int i;
+ char *end;
+
+ while ( *pt==' ' ) ++pt;
+ if ( *pt=='[' ) ++pt;
+ for ( i=0; *pt!=']' && *pt!='\0'; ++i ) {
+ while ( *pt==' ' ) ++pt;
+ if ( *pt==']' || *pt=='\0' )
+return( NULL );
+ for ( end=pt; *end!=' ' && *end!=']' && *end!='\0'; ++end );
+ if ( i==ipos )
+return( copyn(pt,end-pt));
+ pt = end;
+ }
+return( NULL );
+}
+
+/* Given a postscript array of arrays, such as those found in Blend Private BlueValues */
+/* return the array composed of the ipos'th element of each sub-array */
+char *MMExtractArrayNth(char *pt,int ipos) {
+ char *hold[40], *ret;
+ int i,j,len;
+
+ while ( *pt==' ' ) ++pt;
+ if ( *pt=='[' ) ++pt;
+ i = 0;
+ while ( *pt!=']' && *pt!=' ' ) {
+ while ( *pt==' ' ) ++pt;
+ if ( *pt=='[' ) {
+ if ( i<(int)(sizeof(hold)/sizeof(hold[0])) )
+ hold[i++] = MMExtractNth(pt,ipos);
+ ++pt;
+ while ( *pt!=']' && *pt!='\0' ) ++pt;
+ }
+ if ( *pt!='\0' )
+ ++pt;
+ }
+ if ( i==0 )
+return( NULL );
+ for ( j=len=0; j<i; ++j ) {
+ if ( hold[j]==NULL ) {
+ for ( j=0; j<i; ++j )
+ free(hold[j]);
+return( NULL );
+ }
+ len += strlen( hold[j] )+1;
+ }
+
+ pt = ret = galloc(len+4);
+ *pt++ = '[';
+ for ( j=0; j<i; ++j ) {
+ strcpy(pt,hold[j]);
+ free(hold[j]);
+ pt += strlen(pt);
+ if ( j!=i-1 )
+ *pt++ = ' ';
+ }
+ *pt++ = ']';
+ *pt++ = '\0';
+return( ret );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.h
new file mode 100644
index 00000000000..c69449e74c0
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/mm.h
@@ -0,0 +1,32 @@
+/* Copyright (C) 2003-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+extern void MMWeightsUnMap(real weights[MmMax], real axiscoords[4],
+ int axis_count);
+extern double MMAxisUnmap(MMSet *mm,int axis,double ncv);
+extern SplineFont *_MMNewFont(MMSet *mm,int index,char *familyname,real *normalized);
+extern SplineFont *MMNewFont(MMSet *mm,int index,char *familyname);
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c
new file mode 100644
index 00000000000..544195b0ff4
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/namelist.c
@@ -0,0 +1,19799 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "fontforgevw.h"
+#include "ustring.h"
+#include <utype.h>
+
+int recognizePUA = false;
+NameList *force_names_when_opening=NULL;
+NameList *force_names_when_saving=NULL;
+
+static struct psaltnames {
+ char *name;
+ int unicode;
+ int provenance; /* 1=> Adobe PUA, 2=>AMS PUA, 3=>TeX */
+} psaltnames[];
+
+static NameList agl_sans, agl, adobepua, greeksc, tex, ams;
+NameList *namelist_for_new_fonts = &agl;
+
+ /* Adobe's standard names are wrong for: */
+ /* 0x0162 is named Tcommaaccent, 0x21A should be */
+ /* 0x0163 is named tcommaaccent, 0x21B should be */
+/* The following have been corrected (at least by intent) or removed */
+ /* 0xf6be is named dotlessj, 0x237 should be */
+ /* 0x2206 is named Delta, 0x394 should be */
+ /* 0x2126 is named Omega, 0x3A9 should be */
+ /* 0x00b5 is named mu, 0x3BC should be */
+
+static int psnamesinited=false;
+#define HASH_SIZE 257
+struct psbucket { const char *name; int uni; struct psbucket *prev; } *psbuckets[HASH_SIZE];
+
+static int hashname(const char *_name) {
+ const unsigned char *name = (const unsigned char *) _name;
+ int hash=0;
+
+ while ( *name ) {
+ if ( *name<=' ' )
+ break;
+ hash = (hash<<3)|((hash>>29)&0x7);
+ hash ^= *name++-(' '+1);
+ }
+ hash ^= (hash>>16);
+ hash &= 0xffff;
+return( hash%HASH_SIZE );
+}
+
+static void psaddbucket(const char *name, int uni) {
+ int hash = hashname(name);
+ struct psbucket *buck = gcalloc(1,sizeof(struct psbucket));
+
+ buck->name = name;
+ buck->uni = uni;
+ buck->prev = psbuckets[hash];
+ psbuckets[hash] = buck;
+}
+
+static void NameListHash(NameList *nl) {
+ int i,j,k;
+ for ( i=0; i<17; ++i ) if ( nl->unicode[i]!=NULL ) {
+ for ( j=0; j<256; ++j ) if ( nl->unicode[i][j]!=NULL ) {
+ for ( k=0; k<256; ++k ) if ( nl->unicode[i][j][k]!=NULL )
+ psaddbucket(nl->unicode[i][j][k],(i<<16)|(j<<8)|k );
+ }
+ }
+}
+
+static void psinitnames(void) {
+ int i;
+ NameList *nl;
+
+ agl.next = &agl_sans;
+ agl_sans.next = &adobepua;
+ adobepua.next = &greeksc;
+ greeksc.next = &tex;
+ tex.next = &ams;
+
+ for ( i=0; psaltnames[i].name!=NULL ; ++i )
+ psaddbucket(psaltnames[i].name,psaltnames[i].unicode);
+ for ( nl=&agl; nl!=NULL; nl=nl->next )
+ NameListHash(nl);
+ psnamesinited = true;
+}
+
+static void psreinitnames(void) {
+ /* If we reread a (loaded) namelist file, then we must remove the old defn*/
+ /* which means we must remove all the old hash entries before we can put */
+ /* in the new ones */
+ int i;
+ struct psbucket *cur, *prev;
+ NameList *nl;
+
+ for ( i=0; i<HASH_SIZE; ++i ) {
+ for ( cur = psbuckets[i]; cur!=NULL; cur=prev ) {
+ prev = cur->prev;
+ chunkfree(cur,sizeof(struct psbucket));
+ }
+ psbuckets[i] = NULL;
+ }
+
+ for ( i=0; psaltnames[i].name!=NULL ; ++i )
+ psaddbucket(psaltnames[i].name,psaltnames[i].unicode);
+ for ( nl=&agl; nl!=NULL; nl=nl->next )
+ NameListHash(nl);
+}
+
+int UniFromName(const char *name,enum uni_interp interp,Encoding *encname) {
+ int i = -1;
+ char *end;
+ struct psbucket *buck;
+
+ if ( strncmp(name,"uni",3)==0 ) {
+ i = strtol(name+3,&end,16);
+ if ( *end || end-name!=7 ) /* uniXXXXXXXX means a ligature of uniXXXX and uniXXXX */
+ i = -1;
+ } else if ( (name[0]=='U' || name[0]=='u') && name[1]=='+' &&
+ (strlen(name)==6 || strlen(name)==7)) {
+ /* Unifont uses this convention */
+ i = strtol(name+2,&end,16);
+ if ( *end )
+ i = -1;
+ } else if ( name[0]=='u' && strlen(name)>=5 ) {
+ i = strtol(name+1,&end,16);
+ if ( *end )
+ i = -1;
+ else if ( encname!=NULL && !encname->is_unicodefull &&
+ (interp==ui_ams || interp==ui_trad_chinese)) {
+ int j;
+ extern const int cns14pua[], amspua[];
+ const int *pua = interp==ui_ams ? amspua : cns14pua;
+ for ( j=0xf8ff-0xe000; j>=0; --j )
+ if ( pua[j]==i ) {
+ i = j+0xe000;
+ break;
+ }
+ }
+ } else if ( name[0]!='\0' && name[1]=='\0' )
+ i = ((unsigned char *) name)[0];
+ if ( i==-1 ) {
+ if ( !psnamesinited )
+ psinitnames();
+ for ( buck = psbuckets[hashname(name)]; buck!=NULL; buck=buck->prev )
+ if ( strcmp(buck->name,name)==0 )
+ break;
+ if ( buck!=NULL )
+ i = buck->uni;
+ }
+ if ( !recognizePUA && i>=0xe000 && i<=0xf8ff )
+ i = -1;
+return( i );
+}
+
+const char *StdGlyphName(char *buffer, int uni,enum uni_interp interp,NameList *for_this_font) {
+ const char *name = NULL;
+ NameList *nl;
+ int up, ub, uc;
+
+ if ( for_this_font==NULL )
+ for_this_font = namelist_for_new_fonts;
+ else if ( for_this_font==(NameList *) -1 )
+ for_this_font = &agl;
+ if ( (uni>=0 && uni<' ') ||
+ (uni>=0x7f && uni<0xa0) )
+ /* standard controls */;
+ else if ( uni!=-1 ) {
+ if ( uni>=0xe000 && uni<=0xf8ff &&
+ (interp==ui_trad_chinese || for_this_font==&ams)) {
+ extern const int cns14pua[], amspua[];
+ const int *pua = interp==ui_trad_chinese ? cns14pua : amspua;
+ if ( pua[uni-0xe000]!=0 )
+ uni = pua[uni-0xe000];
+ }
+ up = uni>>16;
+ ub = (uni&0xff00)>>8;
+ uc = (uni&0xff);
+ if ( up<17 )
+ for ( nl=for_this_font; nl!=NULL; nl=nl->basedon ) {
+ if ( nl->unicode[up]!=NULL && nl->unicode[up][ub]!=NULL &&
+ (name = nl->unicode[up][ub][uc])!=NULL )
+ break;
+ }
+ }
+ if ( name==NULL ) {
+ if ( uni>=0x10000 )
+ sprintf( buffer, "u%04X", uni);
+ else
+ sprintf( buffer, "uni%04X", uni);
+ name = buffer;
+ }
+return( name );
+}
+
+#define RefMax 40
+
+static int transcmp(RefChar *r1, RefChar *r2) {
+ double d1, d2;
+
+ if ( r1->transform[4]<r2->transform[4] )
+return( -1 );
+ else if ( r1->transform[4]>r2->transform[4] )
+return( 1 );
+ if ( (d1 = r1->transform[5])<0 ) d1 = -d1;
+ if ( (d2 = r2->transform[5])<0 ) d2 = -d2;
+ if ( d1<d2 )
+return( -1 );
+ else if ( d1==d2 )
+return( 0 );
+ else
+return( 1 );
+}
+
+static int FindAllRefs(SplineChar *sc,SplineChar *rsc[RefMax], int *au) {
+ RefChar *refs[RefMax], *alp[RefMax], *out[RefMax];
+ RefChar *ref;
+ int layer, last, rcnt, acnt, ocnt, i,j;
+ int alluni;
+ /* We also order the reference. The order stored in the splinechar doesn't*/
+ /* mean anything, so try and guess what is intended semantically. */
+
+ if ( sc==NULL )
+return( 0 );
+ last = ly_fore;
+ if ( sc->parent->multilayer )
+ last = sc->layer_cnt-1;
+ for ( layer=ly_fore; layer<=last; ++layer )
+ if ( sc->layers[layer].splines!=NULL || sc->layers[layer].images!=NULL )
+return( 0 );
+ rcnt = 0;
+ for ( layer=ly_fore; layer<=last; ++layer ) {
+ for ( ref = sc->layers[layer].refs; ref!=NULL; ref = ref->next ) {
+ if ( rcnt>=RefMax )
+return( 0 );
+ refs[rcnt++] = ref;
+ }
+ }
+ alluni = true;
+ for ( i=0; i<rcnt; ++i ) {
+ if ( refs[i]->sc->unicodeenc==-1 ) {
+ alluni = false;
+ break;
+ }
+ }
+ if ( !alluni ) {
+ /* If not all unicode we can't make any guesses about meaning, so */
+ /* order by transformation */
+ for ( i=0; i<rcnt; ++i ) for ( j=i+1; j<rcnt; ++j ) {
+ if ( transcmp(refs[i],refs[j])>0 ) {
+ ref = refs[i];
+ refs[i] = refs[j];
+ refs[j] = ref;
+ }
+ }
+ } else {
+ acnt = 0;
+ for ( i=0; i<rcnt; ++i ) {
+ if ( isalpha(refs[i]->sc->unicodeenc )) {
+ alp[acnt++] = refs[i];
+ --rcnt;
+ for ( j=i; j<rcnt; ++j )
+ refs[j] = refs[j+1];
+ --i;
+ }
+ }
+ for ( i=0; i<acnt; ++i ) for ( j=i+1; j<acnt; ++j ) {
+ if ( transcmp(alp[i],alp[j])>0 ) {
+ ref = alp[i];
+ alp[i] = alp[j];
+ alp[j] = ref;
+ }
+ }
+ for ( i=0; i<rcnt; ++i ) for ( j=i+1; j<rcnt; ++j ) {
+ if ( transcmp(refs[i],refs[j])>0 ) {
+ ref = refs[i];
+ refs[i] = refs[j];
+ refs[j] = ref;
+ }
+ }
+ if ( acnt!=0 ) {
+ int a=0, r=0;
+ real cutpoint;
+ ocnt = 0;
+ out[ocnt++] = alp[a++];
+ forever {
+ if ( a<acnt ) cutpoint = (alp[a]->transform[4]+3*alp[a-1]->transform[4])/4;
+ else cutpoint = 1e30;
+ while ( r<rcnt && refs[r]->transform[4]<cutpoint )
+ out[ocnt++] = refs[r++];
+ if ( a>=acnt )
+ break;
+ out[ocnt++] = alp[a++];
+ }
+ memcpy(refs,out,ocnt*sizeof(RefChar *));
+ rcnt = ocnt;
+ }
+ }
+ for ( i=0; i<rcnt; ++i )
+ rsc[i] = refs[i]->sc;
+ /* alluni now means can be written as uniXXXX.XXXX.XXXX... */
+ for ( i=0; i<rcnt; ++i ) {
+ if ( refs[i]->sc->unicodeenc>0x10000 ) {
+ alluni = false;
+ break;
+ }
+ }
+ *au = alluni;
+return( rcnt );
+}
+
+/* Return a list of all alternate or standard glyph names for this encoding */
+char **AllGlyphNames(int uni, NameList *for_this_font, SplineChar *sc) {
+ int cnt, k, j, i, len;
+ NameList *nl, *nl2, *nl3;
+ char **names = NULL;
+ const char *name;
+ int up, ub, uc;
+ char buffer[40], *pt;
+ SplineChar *refs[RefMax];
+ int rcnt, alluni = 0;
+
+ rcnt = FindAllRefs(sc,refs,&alluni);
+
+ up = uni>>16;
+ ub = (uni&0xff00)>>8;
+ uc = (uni&0xff);
+
+ for ( k=0; k<2; ++k ) {
+ cnt = 0;
+ /* try the default namelist first to put that at the head of the list */
+ name = NULL;
+ nl = nl3 = NULL;
+ if ( uni>=0 && up<17 ) {
+ if ( for_this_font!=NULL ) {
+ for ( nl3=for_this_font; nl3!=NULL; nl3=nl3->basedon ) {
+ if ( nl3->unicode[up]!=NULL && nl3->unicode[up][ub]!=NULL &&
+ (name = nl3->unicode[up][ub][uc])!=NULL )
+ break;
+ }
+ if ( name!=NULL ) {
+ if ( names )
+ names[cnt] = copy(name);
+ ++cnt;
+ }
+ }
+ if ( for_this_font!=namelist_for_new_fonts ) {
+ for ( nl=namelist_for_new_fonts; nl!=NULL; nl=nl->basedon ) if ( nl!=nl3 ) {
+ if ( nl->unicode[up]!=NULL && nl->unicode[up][ub]!=NULL &&
+ (name = nl->unicode[up][ub][uc])!=NULL )
+ break;
+ }
+ if ( name!=NULL ) {
+ if ( names )
+ names[cnt] = copy(name);
+ ++cnt;
+ }
+ }
+ for ( nl2 = &agl; nl2!=NULL; nl2=nl2->next ) if ( nl2!=nl && nl2!=nl3) {
+ if ( nl2->unicode[up]!=NULL && nl2->unicode[up][ub]!=NULL &&
+ (name = nl2->unicode[up][ub][uc])!=NULL ) {
+ if ( names )
+ names[cnt] = copy(name);
+ ++cnt;
+ }
+ }
+ for ( i=0; psaltnames[i].name!=NULL ; ++i ) {
+ if ( psaltnames[i].unicode==uni ) {
+ if ( names )
+ names[cnt] = copy(psaltnames[i].name);
+ ++cnt;
+ }
+ }
+ if ( uni<0x10000 ) {
+ if ( names ) {
+ sprintf( buffer, "uni%04X", uni);
+ names[cnt] = copy(buffer);
+ }
+ ++cnt;
+ }
+ if ( names ) {
+ sprintf( buffer, "u%04X", uni);
+ names[cnt] = copy(buffer);
+ }
+ ++cnt;
+ }
+ if ( rcnt>1 && alluni && (uni<0 || (uni>=0xe000 && uni<0xf900) || uni>=0xf0000 ) ) {
+ if ( names ) {
+ names[cnt] = galloc(4+4*rcnt);
+ strcpy(names[cnt],"uni");
+ pt = names[cnt]+3;
+ for ( i=0; i<rcnt; ++i ) {
+ if ( refs[i]->unicodeenc==0x131 || refs[i]->unicodeenc==0x237 ||
+ refs[i]->unicodeenc==0xf6be )
+ sprintf( pt,"%04X", refs[i]->unicodeenc==0x131?'i':'j' );
+ else
+ sprintf( pt,"%04X", CanonicalCombiner(refs[i]->unicodeenc));
+ pt += 4;
+ }
+ }
+ ++cnt;
+ }
+ if ( rcnt>1 ) {
+ if ( names ) {
+ for ( i=len=0; i<rcnt; ++i )
+ len += strlen( refs[i]->name )+1;
+ names[cnt] = pt = galloc(len);
+ for ( i=len=0; i<rcnt; ++i ) {
+ strcpy(pt,refs[i]->name);
+ pt += strlen(pt);
+ *pt++ = '_';
+ }
+ pt[-1] = '\0';
+ }
+ ++cnt;
+ }
+ if ( uni<0 || up>=17 ) {
+ if ( names )
+ names[cnt] = copy(".notdef");
+ ++cnt;
+ }
+ if ( k==0 ) {
+ names = galloc((cnt+1)*sizeof(char *));
+ names[cnt] = NULL;
+ }
+ }
+ /* Remove any names from multiiple namelists */
+ for ( i=0; i<cnt; ++i ) for ( j=i+1; j<cnt; ++j ) {
+ if ( strcmp(names[i],names[j])==0 ) {
+ for ( k=j+1; k<cnt; ++k )
+ names[k-1] = names[k];
+ names[--cnt] = NULL;
+ --j;
+ }
+ }
+return( names );
+}
+
+char **AllNamelistNames(void) {
+ NameList *nl;
+ int cnt;
+ char **names;
+
+ for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt );
+ names = galloc((cnt+1) *sizeof(char *));
+ for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt )
+ names[cnt] = copy(_(nl->title));
+ names[cnt] = NULL;
+return( names );
+}
+
+#if 0
+uint8 *AllNamelistUnicodes(void) {
+ NameList *nl;
+ int cnt;
+ uint8 *uses;
+
+ for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt );
+ uses = galloc((cnt+1) *sizeof(uint8));
+ for ( nl = &agl, cnt=0; nl!=NULL; nl=nl->next, ++cnt )
+ uses[cnt] = nl->uses_unicode;
+ uses[cnt] = 0xff;
+return( uses );
+}
+#endif
+
+NameList *DefaultNameListForNewFonts(void) {
+return( namelist_for_new_fonts );
+}
+
+NameList *NameListByName(char *name) {
+ NameList *nl;
+ for ( nl = &agl; nl!=NULL; nl=nl->next ) {
+ if ( strcmp(_(nl->title),name)==0 || strcmp(nl->title,name)==0 )
+return( nl );
+ }
+return( NULL );
+}
+
+static void NameListFreeContents(NameList *nl) {
+ int np, nb, nc, i;
+
+ for ( np=0; np<17; ++np ) if ( nl->unicode[np]!=NULL ) {
+ for ( nb=0; nb<256; ++nb ) if ( nl->unicode[np][nb]!=NULL ) {
+ for ( nc=0; nc<256; ++nc ) if ( nl->unicode[np][nb][nc]!=NULL )
+ free((char *)nl->unicode[np][nb][nc] );
+ free( (char **) nl->unicode[np][nb]);
+ }
+ free( (char ***) nl->unicode[np]);
+ }
+ free( nl->title );
+ if ( nl->renames!=NULL ) {
+ for ( i=0; nl->renames[i].from!=NULL; ++i ) {
+ free(nl->renames[i].from);
+ free(nl->renames[i].to);
+ }
+ free(nl->renames);
+ }
+ free(nl->a_utf8_name);
+}
+
+static void NameListFree(NameList *nl) {
+ NameListFreeContents(nl);
+ chunkfree(nl,sizeof(NameList));
+}
+/* ************************************************************************** */
+
+#include <sys/types.h>
+#include <dirent.h>
+
+NameList *LoadNamelist(char *filename) {
+ FILE *file = fopen(filename,"r");
+ NameList *nl, *nl2;
+ char buffer[400];
+ char *pt, *end, *test;
+ int uni;
+ int len;
+ int up, ub, uc;
+ int rn_cnt=0, rn_max = 0;
+ int uses_unicode = false;
+
+ if ( file==NULL )
+return( NULL );
+
+ if ( !psnamesinited )
+ psinitnames();
+
+ nl = chunkalloc(sizeof(NameList));
+ pt = strrchr(filename,'/');
+ if ( pt==NULL ) pt = filename; else ++pt;
+ nl->title = def2utf8_copy(pt);
+ pt = strrchr(nl->title,'.');
+ if ( pt!=NULL ) *pt = '\0';
+
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( buffer[0]=='#' || buffer[0]=='\n' || buffer[0]=='\r' )
+ continue;
+ len = strlen( buffer );
+ if ( buffer[len-1]=='\n' ) buffer[--len] = '\0';
+ if ( buffer[len-1]=='\r' ) buffer[--len] = '\0';
+ if ( strncmp(buffer,"Based:",6)==0 ) {
+ for ( pt=buffer+6; *pt==' ' || *pt=='\t'; ++pt);
+ for ( nl2 = &agl; nl2!=NULL; nl2 = nl2->next )
+ if ( strcmp( nl2->title,pt )==0 )
+ break;
+ if ( nl2==NULL ) {
+ ff_post_error(_("NameList base missing"),_("NameList %s based on %s which could not be found"), nl->title, pt );
+ NameListFree(nl);
+return( NULL );
+ } else if ( nl->basedon!=NULL ) {
+ ff_post_error(_("NameList based twice"),_("NameList %s based on two NameLists"), nl->title );
+ NameListFree(nl);
+return( NULL );
+ }
+ nl->basedon = nl2;
+ } else if ( strncmp(buffer,"Rename:",7)==0 ) {
+ for ( pt=buffer+7; *pt==' ' || *pt=='\t'; ++pt);
+ for ( test=pt; *test!=' ' && *test!='\t' && *test!='\0'; ++test );
+ if ( *test=='\0' ) {
+ ff_post_error(_("NameList parsing error"),_("Missing rename \"to\" name %s\n%s"), nl->title, buffer );
+ NameListFree(nl);
+return( NULL );
+ }
+ *test='\0';
+ for ( ++test; *test==' ' || *test=='\t'; ++test);
+ if ( (test[0]=='-' || test[0]=='=') && test[1]=='>' )
+ for ( test+=2; *test==' ' || *test=='\t'; ++test);
+ if ( *test=='\0' ) {
+ ff_post_error(_("NameList parsing error"),_("Missing rename \"to\" name %s\n%s"), nl->title, buffer );
+ NameListFree(nl);
+return( NULL );
+ }
+ if ( rn_cnt>=rn_max-1 )
+ nl->renames = grealloc(nl->renames,(rn_max+=20)*sizeof(struct renames));
+ nl->renames[rn_cnt].from = copy(pt);
+ nl->renames[rn_cnt].to = copy(test);
+ nl->renames[++rn_cnt].from = NULL; /* End mark */
+ } else {
+ pt = buffer;
+ if ( *pt=='0' && (pt[1]=='x' || pt[1]=='X'))
+ pt += 2;
+ else if (( *pt=='u' || *pt=='U') && pt[1]=='+' )
+ pt += 2;
+ uni = strtol(pt,&end,16);
+ if ( end==pt || uni<0 || uni>=unicode4_size ) {
+ ff_post_error(_("NameList parsing error"),_("Bad unicode value when parsing %s\n%s"), nl->title, buffer );
+ NameListFree(nl);
+return( NULL );
+ }
+ pt = end;
+ while ( *pt==' ' || *pt==';' || *pt=='\t' ) ++pt;
+ if ( *pt=='\0' ) {
+ ff_post_error(_("NameList parsing error"),_("Missing name when parsing %s for unicode %x"), nl->title, uni );
+ NameListFree(nl);
+return( NULL );
+ }
+ for ( test=pt; *test; ++test ) {
+ if ( (*test<=' ' && *test>=0) ||
+ *test=='(' || *test=='[' || *test=='{' || *test=='<' ||
+ *test==')' || *test==']' || *test=='}' || *test=='>' ||
+ *test=='%' || *test=='/' ) {
+ ff_post_error(_("NameList parsing error"),_("Bad name when parsing %s for unicode %x"), nl->title, uni );
+ NameListFree(nl);
+return( NULL );
+ }
+ if ( *test&0x80 ) {
+ uses_unicode = true;
+ if ( nl->a_utf8_name==NULL )
+ nl->a_utf8_name = copy(pt);
+ }
+ }
+ up = uni>>16;
+ ub = (uni&0xff00)>>8;
+ uc = uni&0xff;
+ if ( nl->unicode[up]==NULL )
+ nl->unicode[up] = gcalloc(256,sizeof(char **));
+ if ( nl->unicode[up][ub]==NULL )
+ nl->unicode[up][ub] = gcalloc(256,sizeof(char *));
+ if ( nl->unicode[up][ub][uc]==NULL )
+ nl->unicode[up][ub][uc]=copy(pt);
+ else {
+ ff_post_error(_("NameList parsing error"),_("Multiple names when parsing %s for unicode %x"), nl->title, uni );
+ NameListFree(nl);
+return( NULL );
+ }
+ }
+ }
+
+ nl->uses_unicode = uses_unicode;
+ if ( nl->basedon!=NULL && nl->basedon->uses_unicode )
+ nl->uses_unicode = true;
+ fclose(file);
+ for ( nl2 = &agl; nl2->next!=NULL; nl2=nl2->next ) {
+ if ( strcmp(nl2->title,nl->title)==0 ) { /* Replace old version */
+ NameList *next = nl2->next;
+ NameListFreeContents(nl2);
+ *nl2 = *nl;
+ nl2->next = next;
+ chunkfree(nl,sizeof(NameList));
+ psreinitnames();
+return( nl2 );
+ }
+ }
+ NameListHash(nl);
+ nl2->next = nl;
+return( nl );
+}
+
+
+/* ************************************************************************** */
+const char *RenameGlyphToNamelist(char *buffer, SplineChar *sc,NameList *old,NameList *new) {
+ int i, up, ub, uc, ch;
+ char space[80]; /* glyph names are supposed to be less<=31 chars */
+ char tempbuf[32];
+ char *pt, *start, *opt, *oend; const char *newsubname;
+ SplineChar *tempsc;
+ NameList *nl;
+
+ if ( sc->unicodeenc!=-1 ) {
+ up = sc->unicodeenc>>16;
+ ub = (sc->unicodeenc>>8)&0xff;
+ uc = (sc->unicodeenc&0xff);
+ for ( nl=new; nl!=NULL; nl=nl->basedon )
+ if ( nl->unicode[up]!=NULL && nl->unicode[up][ub]!=NULL && nl->unicode[up][ub][uc]!=NULL )
+return( nl->unicode[up][ub][uc] );
+ if ( up==0 )
+ sprintf( buffer, "uni%04X", sc->unicodeenc );
+ else
+ sprintf( buffer, "u%04X", sc->unicodeenc );
+return( buffer );
+ } else {
+ if ( old!=NULL && old->renames!=NULL ) {
+ for ( i=0; old->renames[i].from!=NULL; ++i )
+ if ( strcmp(sc->name,old->renames[i].from)==0 )
+return( old->renames[i].to );
+ }
+ if ( new->renames!=NULL ) {
+ for ( i=0; new->renames[i].from!=NULL; ++i )
+ if ( strcmp(sc->name,new->renames[i].to)==0 )
+return( new->renames[i].from );
+ }
+ if ( strlen(sc->name)>sizeof(space)-1 )
+return( sc->name );
+ strcpy(space,sc->name);
+ opt = buffer; oend = buffer+31;
+ start = space;
+ /* Check for composite names f_i, A.small */
+ while ( *start ) {
+ for ( pt=start; *pt!='\0' && *pt!='.' && *pt!='_'; ++pt );
+ if ( *pt=='\0' && start==space )
+return( sc->name );
+ ch = *pt;
+ *pt = '\0';
+ tempsc = SFGetChar(sc->parent,-1,start);
+ if ( tempsc==NULL )
+return( sc->name );
+ newsubname = RenameGlyphToNamelist(tempbuf,tempsc,old,new);
+ while ( opt<oend && *newsubname )
+ *opt++ = *newsubname++;
+ if ( *newsubname )
+return( sc->name );
+ if ( ch=='\0' ) {
+ *opt = '\0';
+return( buffer );
+ } else if ( ch=='.' ) {
+ /* don't attempt to translate anything after a '.' just copy that litterally */
+ while ( opt<oend && *pt )
+ *opt++ = *pt++;
+ if ( *pt )
+return( sc->name );
+ *opt = '\0';
+return( buffer );
+ } else { /* _ */
+ *opt++ = '_';
+ start = pt+1;
+ }
+ }
+ *opt = '\0';
+return( buffer );
+ }
+}
+
+void SFRenameGlyphsToNamelist(SplineFont *sf,NameList *new) {
+ int gid;
+ char buffer[40]; const char *name;
+ SplineChar *sc;
+
+ if ( new==NULL )
+return;
+
+ for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
+ name = RenameGlyphToNamelist(buffer,sc,sf->for_new_glyphs,new);
+ if ( name!=sc->name ) {
+ free(sc->name);
+ sc->name = copy(name);
+ }
+ }
+ sf->for_new_glyphs = new;
+}
+
+char **SFTemporaryRenameGlyphsToNamelist(SplineFont *sf,NameList *new) {
+ int gid;
+ char buffer[40]; const char *name;
+ SplineChar *sc;
+ char **ret;
+
+ if ( new==NULL )
+return( NULL );
+
+ ret = gcalloc(sf->glyphcnt,sizeof(char *));
+ for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
+ name = RenameGlyphToNamelist(buffer,sc,sf->for_new_glyphs,new);
+ if ( name!=sc->name ) {
+ ret[gid] = sc->name;
+ sc->name = copy(name);
+ }
+ }
+return( ret );
+}
+
+void SFTemporaryRestoreGlyphNames(SplineFont *sf,char **former) {
+ int gid;
+ SplineChar *sc;
+
+ for ( gid = 0; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
+ if ( former[gid]!=NULL ) {
+ free(sc->name);
+ sc->name = former[gid];
+ }
+ }
+ free(former);
+}
+/* ************************************************************************** */
+static const char *agl_sans_p0_b0[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "space",
+ "exclam",
+ "quotedbl",
+ "numbersign",
+ "dollar",
+ "percent",
+ "ampersand",
+ "quotesingle",
+ "parenleft",
+ "parenright",
+ "asterisk",
+ "plus",
+ "comma",
+ "hyphen",
+ "period",
+ "slash",
+ "zero",
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+ "nine",
+ "colon",
+ "semicolon",
+ "less",
+ "equal",
+ "greater",
+ "question",
+ "at",
+ "A",
+ "B",
+ "C",
+ "D",
+ "E",
+ "F",
+ "G",
+ "H",
+ "I",
+ "J",
+ "K",
+ "L",
+ "M",
+ "N",
+ "O",
+ "P",
+ "Q",
+ "R",
+ "S",
+ "T",
+ "U",
+ "V",
+ "W",
+ "X",
+ "Y",
+ "Z",
+ "bracketleft",
+ "backslash",
+ "bracketright",
+ "asciicircum",
+ "underscore",
+ "grave",
+ "a",
+ "b",
+ "c",
+ "d",
+ "e",
+ "f",
+ "g",
+ "h",
+ "i",
+ "j",
+ "k",
+ "l",
+ "m",
+ "n",
+ "o",
+ "p",
+ "q",
+ "r",
+ "s",
+ "t",
+ "u",
+ "v",
+ "w",
+ "x",
+ "y",
+ "z",
+ "braceleft",
+ "bar",
+ "braceright",
+ "asciitilde",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdown",
+ "cent",
+ "sterling",
+ "currency",
+ "yen",
+ "brokenbar",
+ "section",
+ "dieresis",
+ "copyright",
+ "ordfeminine",
+ "guillemotleft",
+ "logicalnot",
+ NULL,
+ "registered",
+ "macron",
+ "degree",
+ "plusminus",
+ NULL,
+ NULL,
+ "acute",
+ NULL,
+ "paragraph",
+ "periodcentered",
+ "cedilla",
+ NULL,
+ "ordmasculine",
+ "guillemotright",
+ "onequarter",
+ "onehalf",
+ "threequarters",
+ "questiondown",
+ "Agrave",
+ "Aacute",
+ "Acircumflex",
+ "Atilde",
+ "Adieresis",
+ "Aring",
+ "AE",
+ "Ccedilla",
+ "Egrave",
+ "Eacute",
+ "Ecircumflex",
+ "Edieresis",
+ "Igrave",
+ "Iacute",
+ "Icircumflex",
+ "Idieresis",
+ "Eth",
+ "Ntilde",
+ "Ograve",
+ "Oacute",
+ "Ocircumflex",
+ "Otilde",
+ "Odieresis",
+ "multiply",
+ "Oslash",
+ "Ugrave",
+ "Uacute",
+ "Ucircumflex",
+ "Udieresis",
+ "Yacute",
+ "Thorn",
+ "germandbls",
+ "agrave",
+ "aacute",
+ "acircumflex",
+ "atilde",
+ "adieresis",
+ "aring",
+ "ae",
+ "ccedilla",
+ "egrave",
+ "eacute",
+ "ecircumflex",
+ "edieresis",
+ "igrave",
+ "iacute",
+ "icircumflex",
+ "idieresis",
+ "eth",
+ "ntilde",
+ "ograve",
+ "oacute",
+ "ocircumflex",
+ "otilde",
+ "odieresis",
+ "divide",
+ "oslash",
+ "ugrave",
+ "uacute",
+ "ucircumflex",
+ "udieresis",
+ "yacute",
+ "thorn",
+ "ydieresis"
+};
+
+static const char *agl_sans_p0_b1[] = {
+ "Amacron",
+ "amacron",
+ "Abreve",
+ "abreve",
+ "Aogonek",
+ "aogonek",
+ "Cacute",
+ "cacute",
+ "Ccircumflex",
+ "ccircumflex",
+ "Cdotaccent",
+ "cdotaccent",
+ "Ccaron",
+ "ccaron",
+ "Dcaron",
+ "dcaron",
+ "Dcroat",
+ "dcroat",
+ "Emacron",
+ "emacron",
+ "Ebreve",
+ "ebreve",
+ "Edotaccent",
+ "edotaccent",
+ "Eogonek",
+ "eogonek",
+ "Ecaron",
+ "ecaron",
+ "Gcircumflex",
+ "gcircumflex",
+ "Gbreve",
+ "gbreve",
+ "Gdotaccent",
+ "gdotaccent",
+ "Gcommaaccent",
+ "gcommaaccent",
+ "Hcircumflex",
+ "hcircumflex",
+ "Hbar",
+ "hbar",
+ "Itilde",
+ "itilde",
+ "Imacron",
+ "imacron",
+ "Ibreve",
+ "ibreve",
+ "Iogonek",
+ "iogonek",
+ "Idotaccent",
+ "dotlessi",
+ "IJ",
+ "ij",
+ "Jcircumflex",
+ "jcircumflex",
+ "Kcommaaccent",
+ "kcommaaccent",
+ "kgreenlandic",
+ "Lacute",
+ "lacute",
+ "Lcommaaccent",
+ "lcommaaccent",
+ "Lcaron",
+ "lcaron",
+ "Ldot",
+ "ldot",
+ "Lslash",
+ "lslash",
+ "Nacute",
+ "nacute",
+ "Ncommaaccent",
+ "ncommaaccent",
+ "Ncaron",
+ "ncaron",
+ "napostrophe",
+ "Eng",
+ "eng",
+ "Omacron",
+ "omacron",
+ "Obreve",
+ "obreve",
+ "Ohungarumlaut",
+ "ohungarumlaut",
+ "OE",
+ "oe",
+ "Racute",
+ "racute",
+ "Rcommaaccent",
+ "rcommaaccent",
+ "Rcaron",
+ "rcaron",
+ "Sacute",
+ "sacute",
+ "Scircumflex",
+ "scircumflex",
+ "Scedilla",
+ "scedilla",
+ "Scaron",
+ "scaron",
+ NULL,
+ NULL,
+ "Tcaron",
+ "tcaron",
+ "Tbar",
+ "tbar",
+ "Utilde",
+ "utilde",
+ "Umacron",
+ "umacron",
+ "Ubreve",
+ "ubreve",
+ "Uring",
+ "uring",
+ "Uhungarumlaut",
+ "uhungarumlaut",
+ "Uogonek",
+ "uogonek",
+ "Wcircumflex",
+ "wcircumflex",
+ "Ycircumflex",
+ "ycircumflex",
+ "Ydieresis",
+ "Zacute",
+ "zacute",
+ "Zdotaccent",
+ "zdotaccent",
+ "Zcaron",
+ "zcaron",
+ "longs",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "florin",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Ohorn",
+ "ohorn",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Uhorn",
+ "uhorn",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Gcaron",
+ "gcaron",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Aringacute",
+ "aringacute",
+ "AEacute",
+ "aeacute",
+ "Oslashacute",
+ "oslashacute"
+};
+
+static const char *agl_sans_p0_b2[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Scommaaccent",
+ "scommaaccent",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "circumflex",
+ "caron",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "breve",
+ "dotaccent",
+ "ring",
+ "ogonek",
+ "tilde",
+ "hungarumlaut",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b3[] = {
+ "gravecomb",
+ "acutecomb",
+ NULL,
+ "tildecomb",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "hookabovecomb",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "dotbelowcomb",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "tonos",
+ "dieresistonos",
+ "Alphatonos",
+ "anoteleia",
+ "Epsilontonos",
+ "Etatonos",
+ "Iotatonos",
+ NULL,
+ "Omicrontonos",
+ NULL,
+ "Upsilontonos",
+ "Omegatonos",
+ "iotadieresistonos",
+ "Alpha",
+ "Beta",
+ "Gamma",
+ "Delta",
+ "Epsilon",
+ "Zeta",
+ "Eta",
+ "Theta",
+ "Iota",
+ "Kappa",
+ "Lambda",
+ "Mu",
+ "Nu",
+ "Xi",
+ "Omicron",
+ "Pi",
+ "Rho",
+ NULL,
+ "Sigma",
+ "Tau",
+ "Upsilon",
+ "Phi",
+ "Chi",
+ "Psi",
+ "Omega",
+ "Iotadieresis",
+ "Upsilondieresis",
+ "alphatonos",
+ "epsilontonos",
+ "etatonos",
+ "iotatonos",
+ "upsilondieresistonos",
+ "alpha",
+ "beta",
+ "gamma",
+ "delta",
+ "epsilon",
+ "zeta",
+ "eta",
+ "theta",
+ "iota",
+ "kappa",
+ "lambda",
+ "mu",
+ "nu",
+ "xi",
+ "omicron",
+ "pi",
+ "rho",
+ "sigma1",
+ "sigma",
+ "tau",
+ "upsilon",
+ "phi",
+ "chi",
+ "psi",
+ "omega",
+ "iotadieresis",
+ "upsilondieresis",
+ "omicrontonos",
+ "upsilontonos",
+ "omegatonos",
+ NULL,
+ NULL,
+ "theta1",
+ "Upsilon1",
+ NULL,
+ NULL,
+ "phi1",
+ "omega1",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b1e[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Wgrave",
+ "wgrave",
+ "Wacute",
+ "wacute",
+ "Wdieresis",
+ "wdieresis",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Ygrave",
+ "ygrave",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b20[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "figuredash",
+ "endash",
+ "emdash",
+ NULL,
+ NULL,
+ "underscoredbl",
+ "quoteleft",
+ "quoteright",
+ "quotesinglbase",
+ "quotereversed",
+ "quotedblleft",
+ "quotedblright",
+ "quotedblbase",
+ NULL,
+ "dagger",
+ "daggerdbl",
+ "bullet",
+ NULL,
+ "onedotenleader",
+ "twodotenleader",
+ "ellipsis",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "perthousand",
+ NULL,
+ "minute",
+ "second",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "guilsinglleft",
+ "guilsinglright",
+ NULL,
+ "exclamdbl",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "fraction",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "colonmonetary",
+ NULL,
+ "franc",
+ "lira",
+ NULL,
+ NULL,
+ "peseta",
+ NULL,
+ NULL,
+ NULL,
+ "dong",
+ "Euro",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b21[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Ifraktur",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "weierstrass",
+ NULL,
+ NULL,
+ NULL,
+ "Rfraktur",
+ NULL,
+ "prescription",
+ NULL,
+ NULL,
+ NULL,
+ "trademark",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "estimated",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "aleph",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "onethird",
+ "twothirds",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "oneeighth",
+ "threeeighths",
+ "fiveeighths",
+ "seveneighths",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "arrowleft",
+ "arrowup",
+ "arrowright",
+ "arrowdown",
+ "arrowboth",
+ "arrowupdn",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "arrowupdnbse",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "carriagereturn",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "arrowdblleft",
+ "arrowdblup",
+ "arrowdblright",
+ "arrowdbldown",
+ "arrowdblboth",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b22[] = {
+ "universal",
+ NULL,
+ "partialdiff",
+ "existential",
+ NULL,
+ "emptyset",
+ NULL,
+ "gradient",
+ "element",
+ "notelement",
+ NULL,
+ "suchthat",
+ NULL,
+ NULL,
+ NULL,
+ "product",
+ NULL,
+ "summation",
+ "minus",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "asteriskmath",
+ NULL,
+ NULL,
+ "radical",
+ NULL,
+ NULL,
+ "proportional",
+ "infinity",
+ "orthogonal",
+ "angle",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "logicaland",
+ "logicalor",
+ "intersection",
+ "union",
+ "integral",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "therefore",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "similar",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "congruent",
+ NULL,
+ NULL,
+ "approxequal",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "notequal",
+ "equivalence",
+ NULL,
+ NULL,
+ "lessequal",
+ "greaterequal",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "propersubset",
+ "propersuperset",
+ "notsubset",
+ NULL,
+ "reflexsubset",
+ "reflexsuperset",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "circleplus",
+ NULL,
+ "circlemultiply",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "perpendicular",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "dotmath",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b23[] = {
+ NULL,
+ NULL,
+ "house",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "revlogicalnot",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "integraltp",
+ "integralbt",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "angleleft",
+ "angleright",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b25[] = {
+ "SF100000",
+ NULL,
+ "SF110000",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "SF010000",
+ NULL,
+ NULL,
+ NULL,
+ "SF030000",
+ NULL,
+ NULL,
+ NULL,
+ "SF020000",
+ NULL,
+ NULL,
+ NULL,
+ "SF040000",
+ NULL,
+ NULL,
+ NULL,
+ "SF080000",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "SF090000",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "SF060000",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "SF070000",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "SF050000",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "SF430000",
+ "SF240000",
+ "SF510000",
+ "SF520000",
+ "SF390000",
+ "SF220000",
+ "SF210000",
+ "SF250000",
+ "SF500000",
+ "SF490000",
+ "SF380000",
+ "SF280000",
+ "SF270000",
+ "SF260000",
+ "SF360000",
+ "SF370000",
+ "SF420000",
+ "SF190000",
+ "SF200000",
+ "SF230000",
+ "SF470000",
+ "SF480000",
+ "SF410000",
+ "SF450000",
+ "SF460000",
+ "SF400000",
+ "SF540000",
+ "SF530000",
+ "SF440000",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "upblock",
+ NULL,
+ NULL,
+ NULL,
+ "dnblock",
+ NULL,
+ NULL,
+ NULL,
+ "block",
+ NULL,
+ NULL,
+ NULL,
+ "lfblock",
+ NULL,
+ NULL,
+ NULL,
+ "rtblock",
+ "ltshade",
+ "shade",
+ "dkshade",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "filledbox",
+ "H22073",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "H18543",
+ "H18551",
+ "filledrect",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "triagup",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "triagrt",
+ NULL,
+ "triagdn",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "triaglf",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "lozenge",
+ "circle",
+ NULL,
+ NULL,
+ NULL,
+ "H18533",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "invbullet",
+ "invcircle",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "openbullet",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_sans_p0_b26[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "smileface",
+ "invsmileface",
+ "sun",
+ NULL,
+ NULL,
+ NULL,
+ "female",
+ NULL,
+ "male",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "spade",
+ NULL,
+ NULL,
+ "club",
+ NULL,
+ "heart",
+ "diamond",
+ NULL,
+ NULL,
+ NULL,
+ "musicalnote",
+ "musicalnotedbl",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char **agl_sans_p0[] = {
+ agl_sans_p0_b0,
+ agl_sans_p0_b1,
+ agl_sans_p0_b2,
+ agl_sans_p0_b3,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ agl_sans_p0_b1e,
+ NULL,
+ agl_sans_p0_b20,
+ agl_sans_p0_b21,
+ agl_sans_p0_b22,
+ agl_sans_p0_b23,
+ NULL,
+ agl_sans_p0_b25,
+ agl_sans_p0_b26,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static NameList agl_sans = {
+ NULL,
+ N_("AGL without afii"),
+ { agl_sans_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ NULL, 0, 0, NULL
+};
+/* ************************************************************************** */
+static const char *agl_p0_b1[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Tcommaaccent",
+ "tcommaaccent",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_p0_b2[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57929",
+ "afii64937",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_p0_b4[] = {
+ NULL,
+ "afii10023",
+ "afii10051",
+ "afii10052",
+ "afii10053",
+ "afii10054",
+ "afii10055",
+ "afii10056",
+ "afii10057",
+ "afii10058",
+ "afii10059",
+ "afii10060",
+ "afii10061",
+ NULL,
+ "afii10062",
+ "afii10145",
+ "afii10017",
+ "afii10018",
+ "afii10019",
+ "afii10020",
+ "afii10021",
+ "afii10022",
+ "afii10024",
+ "afii10025",
+ "afii10026",
+ "afii10027",
+ "afii10028",
+ "afii10029",
+ "afii10030",
+ "afii10031",
+ "afii10032",
+ "afii10033",
+ "afii10034",
+ "afii10035",
+ "afii10036",
+ "afii10037",
+ "afii10038",
+ "afii10039",
+ "afii10040",
+ "afii10041",
+ "afii10042",
+ "afii10043",
+ "afii10044",
+ "afii10045",
+ "afii10046",
+ "afii10047",
+ "afii10048",
+ "afii10049",
+ "afii10065",
+ "afii10066",
+ "afii10067",
+ "afii10068",
+ "afii10069",
+ "afii10070",
+ "afii10072",
+ "afii10073",
+ "afii10074",
+ "afii10075",
+ "afii10076",
+ "afii10077",
+ "afii10078",
+ "afii10079",
+ "afii10080",
+ "afii10081",
+ "afii10082",
+ "afii10083",
+ "afii10084",
+ "afii10085",
+ "afii10086",
+ "afii10087",
+ "afii10088",
+ "afii10089",
+ "afii10090",
+ "afii10091",
+ "afii10092",
+ "afii10093",
+ "afii10094",
+ "afii10095",
+ "afii10096",
+ "afii10097",
+ NULL,
+ "afii10071",
+ "afii10099",
+ "afii10100",
+ "afii10101",
+ "afii10102",
+ "afii10103",
+ "afii10104",
+ "afii10105",
+ "afii10106",
+ "afii10107",
+ "afii10108",
+ "afii10109",
+ NULL,
+ "afii10110",
+ "afii10193",
+ NULL,
+ NULL,
+ "afii10146",
+ "afii10194",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii10147",
+ "afii10195",
+ "afii10148",
+ "afii10196",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii10050",
+ "afii10098",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii10846",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_p0_b5[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57799",
+ "afii57801",
+ "afii57800",
+ "afii57802",
+ "afii57793",
+ "afii57794",
+ "afii57795",
+ "afii57798",
+ "afii57797",
+ "afii57806",
+ NULL,
+ "afii57796",
+ "afii57807",
+ "afii57839",
+ "afii57645",
+ "afii57841",
+ "afii57842",
+ "afii57804",
+ "afii57803",
+ "afii57658",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57664",
+ "afii57665",
+ "afii57666",
+ "afii57667",
+ "afii57668",
+ "afii57669",
+ "afii57670",
+ "afii57671",
+ "afii57672",
+ "afii57673",
+ "afii57674",
+ "afii57675",
+ "afii57676",
+ "afii57677",
+ "afii57678",
+ "afii57679",
+ "afii57680",
+ "afii57681",
+ "afii57682",
+ "afii57683",
+ "afii57684",
+ "afii57685",
+ "afii57686",
+ "afii57687",
+ "afii57688",
+ "afii57689",
+ "afii57690",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57716",
+ "afii57717",
+ "afii57718",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_p0_b6[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57388",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57403",
+ NULL,
+ NULL,
+ NULL,
+ "afii57407",
+ NULL,
+ "afii57409",
+ "afii57410",
+ "afii57411",
+ "afii57412",
+ "afii57413",
+ "afii57414",
+ "afii57415",
+ "afii57416",
+ "afii57417",
+ "afii57418",
+ "afii57419",
+ "afii57420",
+ "afii57421",
+ "afii57422",
+ "afii57423",
+ "afii57424",
+ "afii57425",
+ "afii57426",
+ "afii57427",
+ "afii57428",
+ "afii57429",
+ "afii57430",
+ "afii57431",
+ "afii57432",
+ "afii57433",
+ "afii57434",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57440",
+ "afii57441",
+ "afii57442",
+ "afii57443",
+ "afii57444",
+ "afii57445",
+ "afii57446",
+ "afii57470",
+ "afii57448",
+ "afii57449",
+ "afii57450",
+ "afii57451",
+ "afii57452",
+ "afii57453",
+ "afii57454",
+ "afii57455",
+ "afii57456",
+ "afii57457",
+ "afii57458",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57392",
+ "afii57393",
+ "afii57394",
+ "afii57395",
+ "afii57396",
+ "afii57397",
+ "afii57398",
+ "afii57399",
+ "afii57400",
+ "afii57401",
+ "afii57381",
+ NULL,
+ NULL,
+ "afii63167",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57511",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57506",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57507",
+ NULL,
+ "afii57512",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57513",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57508",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57505",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57509",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57514",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57519",
+ NULL,
+ NULL,
+ "afii57534",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_p0_b20[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii61664",
+ "afii301",
+ "afii299",
+ "afii300",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii00208",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii61573",
+ "afii61574",
+ "afii61575",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii57636",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *agl_p0_b21[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii61248",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii61289",
+ NULL,
+ NULL,
+ "afii61352",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char **agl_p0[] = {
+ NULL,
+ agl_p0_b1,
+ agl_p0_b2,
+ NULL,
+ agl_p0_b4,
+ agl_p0_b5,
+ agl_p0_b6,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ agl_p0_b20,
+ agl_p0_b21,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static NameList agl = {
+ &agl_sans,
+ N_("Adobe Glyph List"),
+ { agl_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ NULL, 0, 0, NULL
+};
+/* ************************************************************************** */
+static const char *adobepua_p0_bf6[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "perthousand.oldstyle",
+ "cent.denominator",
+ "dollar.denominator",
+ "hyphen.denominator",
+ "parenleft.denominator",
+ "parenright.denominator",
+ "cent.numerator",
+ "dollar.numerator",
+ "hyphen.numerator",
+ "parenleft.numerator",
+ "parenright.numerator",
+ "at.cap",
+ "commaaccent.cap",
+ "commaaccent.small",
+ "pi.math",
+ "h.superior",
+ "zero.slash",
+ "zero.fitted",
+ "two.fitted",
+ "three.fitted",
+ "four.fitted",
+ "five.fitted",
+ "six.fitted",
+ "seven.fitted",
+ "eight.fitted",
+ "nine.fitted",
+ "percent.oldstyle",
+ "zero.taboldstyle",
+ "one.taboldstyle",
+ "two.taboldstyle",
+ "three.taboldstyle",
+ "four.taboldstyle",
+ "five.taboldstyle",
+ "six.taboldstyle",
+ "seven.taboldstyle",
+ "eight.taboldstyle",
+ "nine.taboldstyle",
+ "colonmonetary.taboldstyle",
+ "Euro.taboldstyle",
+ "florin.taboldstyle",
+ "numbersign.taboldstyle",
+ "sterling.taboldstyle",
+ "yen.taboldstyle",
+ "dollar.taboldstyle",
+ "cent.taboldstyle",
+ "zero.denominator",
+ "one.denominator",
+ "two.denominator",
+ "three.denominator",
+ "four.denominator",
+ "five.denominator",
+ "six.denominator",
+ "seven.denominator",
+ "eight.denominator",
+ "nine.denominator",
+ "comma.denominator",
+ "period.denominator",
+ "zero.numerator",
+ "one.numerator",
+ "two.numerator",
+ "three.numerator",
+ "four.numerator",
+ "five.numerator",
+ "six.numerator",
+ "seven.numerator",
+ "eight.numerator",
+ "nine.numerator",
+ "comma.numerator",
+ "period.numerator",
+ "Abreve.small",
+ "Amacron.small",
+ "Aogonek.small",
+ "AEacute.small",
+ "Cacute.small",
+ "Ccaron.small",
+ "Ccircumflex.small",
+ "Cdotaccent.small",
+ "Dcaron.small",
+ "Dcroat.small",
+ "Ebreve.small",
+ "Ecaron.small",
+ "Edotaccent.small",
+ "Emacron.small",
+ "Eng.small",
+ "Eogonek.small",
+ "Gbreve.small",
+ "Gcircumflex.small",
+ "Gcommaaccent.small",
+ "Gdotaccent.small",
+ "Hbar.small",
+ "Hcircumflex.small",
+ "Ibreve.small",
+ "IJ.small",
+ "Imacron.small",
+ "Iogonek.small",
+ "Itilde.small",
+ "Jcircumflex.small",
+ "Kcommaaccent.small",
+ "Lacute.small",
+ "Lcaron.small",
+ "Lcommaaccent.small",
+ "Ldot.small",
+ "Nacute.small",
+ "Ncaron.small",
+ "Ncommaaccent.small",
+ "Obreve.small",
+ "Ohungarumlaut.small",
+ "Omacron.small",
+ "Oslashacute.small",
+ "Racute.small",
+ "Rcaron.small",
+ "Rcommaaccent.small",
+ "Sacute.small",
+ "Scedilla.small",
+ "Scircumflex.small",
+ "Scommaaccent.small",
+ "Tbar.small",
+ "Tcaron.small",
+ "Tcommaaccent.small",
+ "Ubreve.small",
+ "Uhungarumlaut.small",
+ "Umacron.small",
+ "Uogonek.small",
+ "Uring.small",
+ "Utilde.small",
+ "Wacute.small",
+ "Wcircumflex.small",
+ "Wdieresis.small",
+ "Wgrave.small",
+ "Ycircumflex.small",
+ "Ygrave.small",
+ "Zacute.small",
+ "Zdotaccent.small",
+ "Idotaccent.small",
+ "parenleft.cap",
+ "parenright.cap",
+ "bracketleft.cap",
+ "bracketright.cap",
+ "braceleft.cap",
+ "braceright.cap",
+ "exclamdown.cap",
+ "questiondown.cap",
+ "guillemotleft.cap",
+ "guillemotright.cap",
+ "guilsinglleft.cap",
+ "guilsinglright.cap",
+ "hyphen.cap",
+ "endash.cap",
+ "emdash.cap",
+ "periodcentered.cap",
+ "j.dotless",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "afii10068.ital",
+ "afii10066.ital",
+ "afii10069.ital",
+ "afii10081.ital",
+ "afii10084.ital",
+ "acute.cap",
+ "caron.cap",
+ "dieresis.cap",
+ "space_uni0308_uni0301.cap",
+ "space_uni0308_uni0300.cap",
+ "grave.cap",
+ "hungarumlaut.cap",
+ "macron.cap",
+ "breve.cyrcap",
+ "circumflex.cyrcap",
+ "space_uni030F.cap",
+ "breve.cyr",
+ "circumflex.cyr",
+ "space_uni030F",
+ "space_uni0308_uni0301",
+ "space_uni0308_uni0300",
+ "copyright.serif",
+ "registered.serif",
+ "trademark.serif",
+ "one.fitted",
+ "R_p",
+ "uni2014.alt",
+ "cent.inferior",
+ "cent.superior",
+ "comma.inferior",
+ "comma.superior",
+ "dollar.inferior",
+ "dollar.superior",
+ "hyphen.inferior",
+ "hyphen.superior",
+ "period.inferior",
+ "period.superior",
+ "a.superior",
+ "b.superior",
+ "d.superior",
+ "e.superior",
+ "i.superior",
+ "l.superior",
+ "m.superior",
+ "o.superior",
+ "r.superior",
+ "s.superior",
+ "t.superior",
+ "breve.sc",
+ "caron.sc",
+ "circumflex.sc",
+ "dotaccent.sc",
+ "hungarumlaut.sc",
+ "lslash.sc",
+ "oe.sc",
+ "ogonek.sc",
+ "ring.sc",
+ "scaron.sc",
+ "tilde.sc",
+ "zcaron.sc"
+};
+
+static const char *adobepua_p0_bf7[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclam.sc",
+ NULL,
+ NULL,
+ "dollar.oldstyle",
+ NULL,
+ "ampersand.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "zero.oldstyle",
+ "one.oldstyle",
+ "two.oldstyle",
+ "three.oldstyle",
+ "four.oldstyle",
+ "five.oldstyle",
+ "six.oldstyle",
+ "seven.oldstyle",
+ "eight.oldstyle",
+ "nine.oldstyle",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "question.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "grave.sc",
+ "a.sc",
+ "b.sc",
+ "c.sc",
+ "d.sc",
+ "e.sc",
+ "f.sc",
+ "g.sc",
+ "h.sc",
+ "i.sc",
+ "j.sc",
+ "k.sc",
+ "l.sc",
+ "m.sc",
+ "n.sc",
+ "o.sc",
+ "p.sc",
+ "q.sc",
+ "r.sc",
+ "s.sc",
+ "t.sc",
+ "u.sc",
+ "v.sc",
+ "w.sc",
+ "x.sc",
+ "y.sc",
+ "z.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "exclamdown.sc",
+ "cent.oldstyle",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "dieresis.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "macron.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "acute.sc",
+ NULL,
+ NULL,
+ NULL,
+ "cedilla.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "questiondown.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "agrave.sc",
+ "aacute.sc",
+ "acircumflex.sc",
+ "atilde.sc",
+ "adieresis.sc",
+ "aring.sc",
+ "ae.sc",
+ "ccedilla.sc",
+ "egrave.sc",
+ "eacute.sc",
+ "ecircumflex.sc",
+ "edieresis.sc",
+ "igrave.sc",
+ "iacute.sc",
+ "icircumflex.sc",
+ "idieresis.sc",
+ "eth.sc",
+ "ntilde.sc",
+ "ograve.sc",
+ "oacute.sc",
+ "ocircumflex.sc",
+ "otilde.sc",
+ "odieresis.sc",
+ NULL,
+ "oslash.sc",
+ "ugrave.sc",
+ "uacute.sc",
+ "ucircumflex.sc",
+ "udieresis.sc",
+ "yacute.sc",
+ "thorn.sc",
+ "ydieresis.sc"
+};
+
+static const char *adobepua_p0_bf8[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "registered.sans",
+ "copyright.sans",
+ "trademark.sans",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *adobepua_p0_bfb[] = {
+ "f_f",
+ "f_i",
+ "f_l",
+ "f_f_i",
+ "f_f_l",
+ "longs_t",
+ "s_t",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char **adobepua_p0[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ adobepua_p0_bf6,
+ adobepua_p0_bf7,
+ adobepua_p0_bf8,
+ NULL,
+ NULL,
+ adobepua_p0_bfb,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static NameList adobepua = {
+ &agl,
+ N_("AGL with PUA"),
+ { adobepua_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ NULL, 0, 0, NULL
+};
+/* ************************************************************************** */
+static const char *greeksc_p0_bf5[] = {
+ "alpha.sc",
+ "beta.sc",
+ "gamma.sc",
+ "delta.sc",
+ "epsilon.sc",
+ "zeta.sc",
+ "eta.sc",
+ "theta.sc",
+ "iota.sc",
+ "kappa.sc",
+ "lambda.sc",
+ "mu.sc",
+ "nu.sc",
+ "xi.sc",
+ "omicron.sc",
+ "pi.sc",
+ "rho.sc",
+ NULL,
+ "sigma.sc",
+ "tau.sc",
+ "upsilon.sc",
+ "phi.sc",
+ "chi.sc",
+ "psi.sc",
+ "omega.sc",
+ "iotadieresis.sc",
+ "upsilondieresis.sc",
+ "alphaiota.sc",
+ "etaiota.sc",
+ "omegaiota.sc",
+ "prosgegrammeni.sc",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char **greeksc_p0[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ greeksc_p0_bf5,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static NameList greeksc = {
+ &adobepua,
+ N_("Greek small caps"),
+ { greeksc_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ NULL, 0, 0, NULL
+};
+/* ************************************************************************** */
+static const char *tex_p0_b20[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "closure",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "leftharpoonaccent",
+ "rightharpoonaccent",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_b21[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "shortleftarrow",
+ "shortuparrow",
+ "shortrightarrow",
+ "shortdownarrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "leftwavyarrow",
+ "rightwavyarrow",
+ NULL,
+ "twoheaduparrow",
+ NULL,
+ "twoheaddownarrow",
+ NULL,
+ NULL,
+ NULL,
+ "mapsup",
+ NULL,
+ "mapsdown",
+ "updownarrowbar",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "leftrightwavyarrow",
+ NULL,
+ "downzigzagarrow",
+ NULL,
+ NULL,
+ "Ldsh",
+ "Rdsh",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "acwopencirclearrow",
+ "cwopencirclearrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "updownarrows",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Nwarrow",
+ "Nearrow",
+ "Searrow",
+ "Swarrow",
+ NULL,
+ NULL,
+ "longleftzigzagarrow",
+ "rightzigzagarrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "barleftarrow",
+ "rightarrowbar",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "downuparrows",
+ "rightthreearrows",
+ "nvleftarrow",
+ "nvrightarrow",
+ "nvleftrightarrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_b22[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ltrpar",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "difference",
+ NULL,
+ "ac",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "approxident",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "arceq",
+ NULL,
+ "veeeq",
+ "stareq",
+ NULL,
+ "eqdef",
+ "measeq",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Equiv",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "prurel",
+ "scurel",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "origof",
+ "imageof",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "eqless",
+ "eqgtr",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "disin",
+ NULL,
+ "isins",
+ "isindot",
+ NULL,
+ NULL,
+ "isinvb",
+ "isinE",
+ "nisd",
+ NULL,
+ "nis",
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_b23[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "invnot",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "turnednot",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "solbar",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "rangledownzigzagarrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_b27[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "longrightzigzagarrow"
+};
+
+static const char *tex_p0_b29[] = {
+ NULL,
+ NULL,
+ "nvLeftarrow",
+ "nvRightarrow",
+ "nvLeftrightarrow",
+ "twoheadmapsto",
+ NULL,
+ NULL,
+ "downarrowbarred",
+ "uparrowbarred",
+ "Uuparrow",
+ "Ddownarrow",
+ "leftbkarrow",
+ "rightbkarrow",
+ "leftdbkarrow",
+ NULL,
+ NULL,
+ "rightdotarrow",
+ "baruparrow",
+ "downarrowbar",
+ NULL,
+ NULL,
+ "twoheadrightarrowtail",
+ NULL,
+ NULL,
+ "lefttail",
+ "righttail",
+ "leftdbltail",
+ "rightdbltail",
+ "diamondleftarrow",
+ "rightarrowdiamond",
+ "diamondleftarrowbar",
+ "barrightarrowdiamond",
+ "nwsearrow",
+ "neswarrow",
+ "hknwarrow",
+ "hknearrow",
+ "hksearrow",
+ "hkswarrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "rdiagovfdiag",
+ "fdiagovrdiag",
+ "seovnearrow",
+ "neovsearrow",
+ "fdiagovnearrow",
+ "rdiagovsearrow",
+ "neovnwarrow",
+ "nwovnearrow",
+ "rightcurvedarrow",
+ NULL,
+ NULL,
+ "leftdowncurvedarrow",
+ "rightdowncurvedarrow",
+ "cwhalfcirclearrow",
+ "acwhalfcirclearrow",
+ NULL,
+ "acwundercurvearrow",
+ "curvearrowrightminus",
+ "curvearrowleftplus",
+ "cwundercurvearrow",
+ NULL,
+ NULL,
+ NULL,
+ "rightarrowshortleftarrow",
+ "leftarrowshortrightarrow",
+ "shortrightarrowleftarrow",
+ "rightarrowplus",
+ "leftarrowplus",
+ "rightarrowx",
+ "leftrightarrowcircle",
+ "twoheaduparrowcircle",
+ "leftrightharpoonupdown",
+ "leftrightharpoondownup",
+ "updownharpoonrightleft",
+ "updownharpoonleftright",
+ "leftrightharpoonupup",
+ "updownharpoonrightright",
+ "leftrightharpoondowndown",
+ "updownharpoonleftleft",
+ "barleftharpoonup",
+ "rightharpoonupbar",
+ "barupharpoonright",
+ "downharpoonrightbar",
+ "barleftharpoondown",
+ "rightharpoondownbar",
+ "barupharpoonleft",
+ "downharpoonleftbar",
+ "leftharpoonupbar",
+ "barrightharpoonup",
+ "upharpoonrightbar",
+ "bardownharpoonright",
+ "leftharpoondownbar",
+ "barrightharpoondown",
+ "upharpoonleftbar",
+ "bardownharpoonleft",
+ "leftharpoonsupdown",
+ "upharpoonsleftright",
+ "rightharpoonsupdown",
+ "downharpoonsleftright",
+ "leftrightharpoonsup",
+ "leftrightharpoonsdown",
+ "rightleftharpoonsup",
+ "rightleftharpoonsdown",
+ "leftharpoonupdash",
+ "dashleftharpoondown",
+ "rightharpoonupdash",
+ "dashrightharpoondown",
+ "updownharpoonsleftright",
+ "downupharpoonsleftright",
+ "rightimply",
+ "equalrightarrow",
+ "similarrightarrow",
+ "leftarrowsimilar",
+ "rightarrowsimilar",
+ "rightarrowapprox",
+ "ltlarr",
+ "leftarrowless",
+ "gtrarr",
+ "subrarr",
+ "leftarrowsubset",
+ "suplarr",
+ "leftfishtail",
+ "rightfishtail",
+ "upfishtail",
+ "downfishtail",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "rtriltri",
+ "ltrivb",
+ "vbrtri",
+ "lfbowtie",
+ "rfbowtie",
+ "fbowtie",
+ "lftimes",
+ "rftimes",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "eqvparsl",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "ruledelayed",
+ NULL,
+ "dsol",
+ "rsolbar",
+ "xsol",
+ "xbsol",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_b2a[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "congdot",
+ NULL,
+ NULL,
+ "approxeqq",
+ NULL,
+ NULL,
+ "eqqsim",
+ "Coloneq",
+ "eqeq",
+ NULL,
+ NULL,
+ "equivDD",
+ "ltcir",
+ "gtcir",
+ "ltquest",
+ "gtquest",
+ NULL,
+ NULL,
+ "lesdot",
+ "gesdot",
+ "lesdoto",
+ "gesdoto",
+ "lesdotor",
+ "gesdotol",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "lsime",
+ "gsime",
+ "lsimg",
+ "gsiml",
+ "lgE",
+ "glE",
+ "lesges",
+ "gesles",
+ NULL,
+ NULL,
+ "elsdot",
+ "egsdot",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "simless",
+ "simgtr",
+ "simlE",
+ "simgE",
+ "Lt",
+ "Gt",
+ NULL,
+ "glj",
+ "gla",
+ "ltcc",
+ "gtcc",
+ "lescc",
+ "gescc",
+ "smt",
+ "lat",
+ "smte",
+ "late",
+ "bumpeqq",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "prE",
+ "scE",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Pr",
+ "Sc",
+ "subsetdot",
+ "supsetdot",
+ "subsetplus",
+ "supsetplus",
+ "submult",
+ "supmult",
+ "subedot",
+ "supedot",
+ NULL,
+ NULL,
+ "subsim",
+ "supsim",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "csub",
+ "csup",
+ "csube",
+ "csupe",
+ "subsup",
+ "supsub",
+ "subsub",
+ "supsup",
+ "suphsub",
+ "supdsub",
+ "forkv",
+ "topfork",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "Barv",
+ "vBar",
+ "vBarv",
+ "barV",
+ "Vbar",
+ "Not",
+ "bNot",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_be2[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "rightdbkarrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "nrightwavyarrow",
+ NULL,
+ "nrightcurvedarrow",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "race",
+ "acE",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_be3[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "lesg",
+ "gesl",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "smtes",
+ "lates",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "bsolhsub",
+ "suphsol",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "congruence",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_be4[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "mostpos",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *tex_p0_be6[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "varrightfishtail",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char **tex_p0[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ tex_p0_b20,
+ tex_p0_b21,
+ tex_p0_b22,
+ tex_p0_b23,
+ NULL,
+ NULL,
+ NULL,
+ tex_p0_b27,
+ NULL,
+ tex_p0_b29,
+ tex_p0_b2a,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ tex_p0_be2,
+ tex_p0_be3,
+ tex_p0_be4,
+ NULL,
+ tex_p0_be6,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static NameList tex = {
+ &agl,
+ NU_("ΤεΧ Names"),
+ { tex_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ NULL, 0, 0, NULL
+};
+/* ************************************************************************** */
+static const char *ams_p0_be2[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni219D0338",
+ NULL,
+ "uni29330338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2192.short",
+ "uni2190.short",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni222AFE00",
+ "uni2229FE00",
+ "uni2294FE00",
+ "uni2293FE00",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni223E0332.reversed",
+ "uni223E0333",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2269FE00",
+ NULL,
+ NULL,
+ "uni2268FE00",
+ "uni22670338",
+ "uni2A7E0338",
+ "uni2A7D0338",
+ "uni22660338",
+ NULL,
+ "uni2224.short",
+ "uni2226.short",
+ "uni228220D2",
+ "uni228620D2",
+ "uni2AC50338",
+ "uni228320D2",
+ "uni2AC60338",
+ "uni228720D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2ACBFE00",
+ "uni228AFE00",
+ "uni228BFE00",
+ "uni2ACCFE00",
+ "uni224B0338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni226420D2",
+ "uni226520D2",
+ "uni003C20D2",
+ "uni003E20D2",
+ "uni2A6D0338",
+ "uni224820D2",
+ "uni2A700338",
+ NULL,
+ "uni2AA120D2",
+ "uni2AA220D2",
+ "uni226A0338",
+ "uni226B0338",
+ "uni22D80338",
+ "uni22D90338",
+ "uni22B520D2",
+ "uni22B420D2",
+ NULL,
+ NULL,
+ NULL,
+ "uni006A.dotless",
+ "uni210F.var",
+ NULL,
+ NULL,
+ "uni222020D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_be3[] = {
+ NULL,
+ "uni2223.short",
+ "uni2225.short",
+ NULL,
+ NULL,
+ NULL,
+ "uni2248.bold",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni22DAFE00",
+ "uni22DBFE00",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2AACFE00",
+ "uni2AADFE00",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni220B20D2",
+ "uni220D0338",
+ NULL,
+ NULL,
+ "uni220820D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2A15.up",
+ "uni2A16.up",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni226120E5",
+ "uni003D20E5",
+ "uni2AFD20E5",
+ "uni22500338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni22020338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2A10.up",
+ NULL,
+ "uni2A12.up",
+ "uni2A13.up",
+ "uni2A14.up",
+ "uni2A17.up",
+ "uni2A11.up",
+ NULL,
+ "uni22F50338",
+ NULL,
+ "uni22F90338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2026.em",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni220A0338",
+ "uni227320D2",
+ "uni227220D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni223E.reversed",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni0265.superscript",
+ "uni0252.superscript",
+ NULL,
+ NULL,
+ NULL,
+ "uni2A0F.up",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2A9B20D2",
+ "uni2A9C20D2",
+ "uni2A9B0338",
+ "uni2A9C0338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_be4[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni223E.var",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni223C20D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_be5[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2A3CFE00",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2AAF0338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni224220D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2AB00338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_be6[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni228F0338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni22900338",
+ "uni224E0338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2205.var",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni0077.subscript",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni1D0B.reversed",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni025102DE",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni025B02DE",
+ "uni025402DE",
+ NULL,
+ "uni03C9.inverted",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni297D.var",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni223C.bold",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_be8[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni227E0338",
+ "uni227F0338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2216.var",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni224F0338",
+ "uni22420338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_bea[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni00730336",
+ NULL,
+ "uni006C0321",
+ NULL,
+ NULL,
+ "uni03040304",
+ NULL,
+ NULL,
+ "uni229CFE00",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni03020302",
+ NULL,
+ "uni03030303",
+ "uni033103310331",
+ "uni0331033103310331",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni03070302",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni03040303",
+ "uni03310330",
+ "uni03040308",
+ "uni03300331",
+ NULL,
+ "uni00640321",
+ "uni00680321",
+ "uni006B0321",
+ "uni00780321",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni00730321",
+ "uni007A0321",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2034.notsup",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2A0B.up",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni227620D2",
+ "uni227720D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_bec[] = {
+ NULL,
+ NULL,
+ "uni2A3DFE00",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_bed[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni220A20D2",
+ "uni220D20D2",
+ "uni22F60338",
+ "uni22FD0338",
+ "uni22F620D2",
+ "uni22FD20D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2295FE00",
+ "uni2297FE00",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni224320D2",
+ "uni224520D2",
+ NULL,
+ "uni2A6C0338",
+ "uni2A6C20D2",
+ "uni2A7020D2",
+ "uni224D20D2",
+ "uni223F.reversed",
+ "uni003D20D2",
+ NULL,
+ "uni226120D2",
+ "uni22630338",
+ "uni226320D2",
+ NULL,
+ NULL,
+ "uni2A7D20D2",
+ "uni2A7E20D2",
+ "uni226620D2",
+ "uni226720D2",
+ "uni2A950338",
+ "uni2A960338",
+ "uni2A9520D2",
+ "uni2A9620D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2A990338",
+ "uni2A9A0338",
+ "uni2A9920D2",
+ "uni2A9A20D2",
+ "uni2272FE00",
+ "uni2273FE00",
+ "uni2A9DFE00",
+ "uni2A9EFE00",
+ NULL,
+ NULL,
+ "uni227A20D2",
+ "uni227B20D2",
+ "uni227C20D2",
+ "uni227D20D2",
+ "uni22DE20D2",
+ "uni22DF20D2",
+ "uni22DE0338",
+ "uni22DF0338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2AC520D2",
+ "uni2AC620D2",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2AF40338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2A0A.lgdisplay",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni220A.narrow",
+ "uni220D.narrow",
+ NULL,
+ "u1D6FB.narrow",
+ "uni002820090029",
+ "uni002822C50029",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_bee[] = {
+ "stixEE00",
+ "stixEE01",
+ "stixEE02",
+ "stixEE03",
+ "stixEE04",
+ "stixEE05",
+ "stixEE06",
+ "stixEE07",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "stixEE10",
+ "stixEE11",
+ "stixEE12",
+ "stixEE13",
+ "stixEE14",
+ "stixEE15",
+ "stixEE16",
+ "stixEE17",
+ "stixEE18",
+ "stixEE19",
+ "stixEE1A",
+ "stixEE1B",
+ "stixEE1C",
+ "stixEE1D",
+ "stixEE1E",
+ "stixEE1F",
+ "stixEE20",
+ "stixEE21",
+ "stixEE22",
+ "stixEE23",
+ "stixEE24",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "stixEE30",
+ "stixEE31",
+ "stixEE32",
+ "stixEE33",
+ "stixEE34",
+ "stixEE35",
+ "stixEE36",
+ "stixEE37",
+ "stixEE38",
+ "stixEE39",
+ "stixEE3A",
+ "stixEE3B",
+ "stixEE3C",
+ "stixEE3D",
+ "stixEE3E",
+ NULL,
+ "stixEE40",
+ "stixEE41",
+ "stixEE42",
+ "stixEE43",
+ "stixEE44",
+ "stixEE45",
+ "stixEE46",
+ "stixEE47",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "stixEE50",
+ "stixEE51",
+ "stixEE52",
+ "stixEE53",
+ "stixEE54",
+ "stixEE55",
+ "stixEE56",
+ "stixEE57",
+ "stixEE58",
+ "stixEE59",
+ "stixEE5A",
+ "stixEE5B",
+ "stixEE5C",
+ "stixEE5D",
+ "stixEE5E",
+ "stixEE5F",
+ "stixEE60",
+ "stixEE61",
+ "stixEE62",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "stixEE70",
+ "stixEE71",
+ "stixEE72",
+ "stixEE73",
+ "stixEE74",
+ "stixEE75",
+ "stixEE76",
+ "stixEE77",
+ "stixEE78",
+ "stixEE79",
+ "stixEE7A",
+ "stixEE7B",
+ "stixEE7C",
+ "stixEE7D",
+ "stixEE7E",
+ "stixEE7F",
+ "stixEE80",
+ "stixEE81",
+ "stixEE82",
+ "stixEE83",
+ "stixEE84",
+ "stixEE85",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "stixEE90",
+ "stixEE91",
+ "stixEE92",
+ "stixEE93",
+ "stixEE94",
+ "stixEE95",
+ "stixEE96",
+ "stixEE97",
+ "stixEE98",
+ "stixEE99",
+ "stixEE9A",
+ "stixEE9B",
+ "stixEE9C",
+ "stixEE9D",
+ "stixEE9E",
+ "stixEE9F",
+ "stixEEA0",
+ "stixEEA1",
+ "stixEEA2",
+ "stixEEA3",
+ "stixEEA4",
+ "stixEEA5",
+ "stixEEA6",
+ "stixEEA7",
+ "stixEEA8",
+ "stixEEA9",
+ "stixEEAA",
+ "stixEEAB",
+ "stixEEAC",
+ NULL,
+ NULL,
+ NULL,
+ "stixEEB0",
+ "stixEEB1",
+ "stixEEB2",
+ "stixEEB3",
+ "stixEEB4",
+ "stixEEB5",
+ "stixEEB6",
+ "stixEEB7",
+ "stixEEB8",
+ "stixEEB9",
+ "stixEEBA",
+ "stixEEBB",
+ "stixEEBC",
+ "stixEEBD",
+ "stixEEBE",
+ "stixEEBF",
+ "stixEEC0",
+ "stixEEC1",
+ "stixEEC2",
+ "stixEEC3",
+ "stixEEC4",
+ "stixEEC5",
+ "stixEEC6",
+ "stixEEC7",
+ "stixEEC8",
+ "stixEEC9",
+ "stixEECA",
+ "stixEECB",
+ NULL,
+ "stixEECD",
+ "stixEECE",
+ "stixEECF",
+ "stixEED0",
+ "stixEED1",
+ "stixEED2",
+ "stixEED3",
+ "stixEED4",
+ "stixEED5",
+ "stixEED6",
+ "stixEED7",
+ "stixEED8",
+ "stixEED9",
+ "stixEEDA",
+ "stixEEDB",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_bf4[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni29CF0338",
+ "uni29D00338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2AA10338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2AA20338",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *ams_p0_bf5[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ "uni2191.short",
+ "uni2193.short",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char **ams_p0[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ams_p0_be2,
+ ams_p0_be3,
+ ams_p0_be4,
+ ams_p0_be5,
+ ams_p0_be6,
+ NULL,
+ ams_p0_be8,
+ NULL,
+ ams_p0_bea,
+ NULL,
+ ams_p0_bec,
+ ams_p0_bed,
+ ams_p0_bee,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ ams_p0_bf4,
+ ams_p0_bf5,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static NameList ams = {
+ &tex,
+ N_("AMS Names"),
+ { ams_p0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ NULL, 0, 0, NULL
+};
+/* ************************************************************************** */
+static struct psaltnames psaltnames[] = {
+ { "AEmacron", 0x01e2 , 0 },
+ { "AEsmall", 0xf7e6 , 0 },
+ { "Aacutesmall", 0xf7e1 , 0 },
+ { "Abreveacute", 0x1eae , 0 },
+ { "Abrevecyrillic", 0x04d0 , 0 },
+ { "Abrevedotbelow", 0x1eb6 , 0 },
+ { "Abrevegrave", 0x1eb0 , 0 },
+ { "Abrevehookabove", 0x1eb2 , 0 },
+ { "Abrevetilde", 0x1eb4 , 0 },
+ { "Acaron", 0x01cd , 0 },
+ { "Acircle", 0x24b6 , 0 },
+ { "Acircumflexacute", 0x1ea4 , 0 },
+ { "Acircumflexdotbelow", 0x1eac , 0 },
+ { "Acircumflexgrave", 0x1ea6 , 0 },
+ { "Acircumflexhookabove", 0x1ea8 , 0 },
+ { "Acircumflexsmall", 0xf7e2 , 0 },
+ { "Acircumflextilde", 0x1eaa , 0 },
+ { "Acute", 0xf6c9 , 0 },
+ { "Acutesmall", 0xf7b4 , 0 },
+ { "Acyrillic", 0x0410 , 0 },
+ { "Adblgrave", 0x0200 , 0 },
+ { "Adieresiscyrillic", 0x04d2 , 0 },
+ { "Adieresismacron", 0x01de , 0 },
+ { "Adieresissmall", 0xf7e4 , 0 },
+ { "Adotbelow", 0x1ea0 , 0 },
+ { "Adotmacron", 0x01e0 , 0 },
+ { "Agravesmall", 0xf7e0 , 0 },
+ { "Ahookabove", 0x1ea2 , 0 },
+ { "Aiecyrillic", 0x04d4 , 0 },
+ { "Ainvertedbreve", 0x0202 , 0 },
+ { "Amonospace", 0xff21 , 0 },
+ { "Aringbelow", 0x1e00 , 0 },
+ { "Aringsmall", 0xf7e5 , 0 },
+ { "Asmall", 0xf761 , 0 },
+ { "Atildesmall", 0xf7e3 , 0 },
+ { "Aybarmenian", 0x0531 , 0 },
+ { "Bcircle", 0x24b7 , 0 },
+ { "Bdotaccent", 0x1e02 , 0 },
+ { "Bdotbelow", 0x1e04 , 0 },
+ { "Becyrillic", 0x0411 , 0 },
+ { "Benarmenian", 0x0532 , 0 },
+ { "Bhook", 0x0181 , 0 },
+ { "Blinebelow", 0x1e06 , 0 },
+ { "Bmonospace", 0xff22 , 0 },
+ { "Brevesmall", 0xf6f4 , 0 },
+ { "Bsmall", 0xf762 , 0 },
+ { "Btopbar", 0x0182 , 0 },
+ { "Caarmenian", 0x053e , 0 },
+ { "Caron", 0xf6ca , 0 },
+ { "Caronsmall", 0xf6f5 , 0 },
+ { "Ccedillaacute", 0x1e08 , 0 },
+ { "Ccedillasmall", 0xf7e7 , 0 },
+ { "Ccircle", 0x24b8 , 0 },
+ { "Cdot", 0x010a , 0 },
+ { "Cedillasmall", 0xf7b8 , 0 },
+ { "Chaarmenian", 0x0549 , 0 },
+ { "Cheabkhasiancyrillic", 0x04bc , 0 },
+ { "Checyrillic", 0x0427 , 0 },
+ { "Chedescenderabkhasiancyrillic", 0x04be , 0 },
+ { "Chedescendercyrillic", 0x04b6 , 0 },
+ { "Chedieresiscyrillic", 0x04f4 , 0 },
+ { "Cheharmenian", 0x0543 , 0 },
+ { "Chekhakassiancyrillic", 0x04cb , 0 },
+ { "Cheverticalstrokecyrillic", 0x04b8 , 0 },
+ { "Chook", 0x0187 , 0 },
+ { "Circumflexsmall", 0xf6f6 , 0 },
+ { "Cmonospace", 0xff23 , 0 },
+ { "Coarmenian", 0x0551 , 0 },
+ { "Csmall", 0xf763 , 0 },
+ { "DZ", 0x01f1 , 0 },
+ { "DZcaron", 0x01c4 , 0 },
+ { "Daarmenian", 0x0534 , 0 },
+ { "Dafrican", 0x0189 , 0 },
+ { "Dcedilla", 0x1e10 , 0 },
+ { "Dcircle", 0x24b9 , 0 },
+ { "Dcircumflexbelow", 0x1e12 , 0 },
+ { "Ddotaccent", 0x1e0a , 0 },
+ { "Ddotbelow", 0x1e0c , 0 },
+ { "Decyrillic", 0x0414 , 0 },
+ { "Deicoptic", 0x03ee , 0 },
+ { "Deltagreek", 0x0394 , 0 },
+ { "Dhook", 0x018a , 0 },
+ { "Dieresis", 0xf6cb , 0 },
+ { "diaeresis", 0x00a8 , 0 },
+ { "Diaeresis", 0xf6cb , 0 },
+ { "DieresisAcute", 0xf6cc , 0 },
+ { "DieresisGrave", 0xf6cd , 0 },
+ { "Dieresissmall", 0xf7a8 , 0 },
+ { "Digammagreek", 0x03dc , 0 },
+ { "Djecyrillic", 0x0402 , 0 },
+ { "Dlinebelow", 0x1e0e , 0 },
+ { "Dmonospace", 0xff24 , 0 },
+ { "Dotaccentsmall", 0xf6f7 , 0 },
+ { "Dslash", 0x0110 , 0 },
+ { "Dsmall", 0xf764 , 0 },
+ { "Dtopbar", 0x018b , 0 },
+ { "Dz", 0x01f2 , 0 },
+ { "Dzcaron", 0x01c5 , 0 },
+ { "Dzeabkhasiancyrillic", 0x04e0 , 0 },
+ { "Dzecyrillic", 0x0405 , 0 },
+ { "Dzhecyrillic", 0x040f , 0 },
+ { "Eacutesmall", 0xf7e9 , 0 },
+ { "Ecedillabreve", 0x1e1c , 0 },
+ { "Echarmenian", 0x0535 , 0 },
+ { "Ecircle", 0x24ba , 0 },
+ { "Ecircumflexacute", 0x1ebe , 0 },
+ { "Ecircumflexbelow", 0x1e18 , 0 },
+ { "Ecircumflexdotbelow", 0x1ec6 , 0 },
+ { "Ecircumflexgrave", 0x1ec0 , 0 },
+ { "Ecircumflexhookabove", 0x1ec2 , 0 },
+ { "Ecircumflexsmall", 0xf7ea , 0 },
+ { "Ecircumflextilde", 0x1ec4 , 0 },
+ { "Ecyrillic", 0x0404 , 0 },
+ { "Edblgrave", 0x0204 , 0 },
+ { "Edieresissmall", 0xf7eb , 0 },
+ { "Edot", 0x0116 , 0 },
+ { "Edotbelow", 0x1eb8 , 0 },
+ { "Efcyrillic", 0x0424 , 0 },
+ { "Egravesmall", 0xf7e8 , 0 },
+ { "Eharmenian", 0x0537 , 0 },
+ { "Ehookabove", 0x1eba , 0 },
+ { "Eightroman", 0x2167 , 0 },
+ { "Einvertedbreve", 0x0206 , 0 },
+ { "Eiotifiedcyrillic", 0x0464 , 0 },
+ { "Elcyrillic", 0x041b , 0 },
+ { "Elevenroman", 0x216a , 0 },
+ { "Emacronacute", 0x1e16 , 0 },
+ { "Emacrongrave", 0x1e14 , 0 },
+ { "Emcyrillic", 0x041c , 0 },
+ { "Emonospace", 0xff25 , 0 },
+ { "Encyrillic", 0x041d , 0 },
+ { "Endescendercyrillic", 0x04a2 , 0 },
+ { "Enghecyrillic", 0x04a4 , 0 },
+ { "Enhookcyrillic", 0x04c7 , 0 },
+ { "Eopen", 0x0190 , 0 },
+ { "Ercyrillic", 0x0420 , 0 },
+ { "Ereversed", 0x018e , 0 },
+ { "Ereversedcyrillic", 0x042d , 0 },
+ { "Escyrillic", 0x0421 , 0 },
+ { "Esdescendercyrillic", 0x04aa , 0 },
+ { "Esh", 0x01a9 , 0 },
+ { "Esmall", 0xf765 , 0 },
+ { "Etarmenian", 0x0538 , 0 },
+ { "Ethsmall", 0xf7f0 , 0 },
+ { "Etilde", 0x1ebc , 0 },
+ { "Etildebelow", 0x1e1a , 0 },
+ { "Ezh", 0x01b7 , 0 },
+ { "Ezhcaron", 0x01ee , 0 },
+ { "Ezhreversed", 0x01b8 , 0 },
+ { "Fcircle", 0x24bb , 0 },
+ { "Fdotaccent", 0x1e1e , 0 },
+ { "Feharmenian", 0x0556 , 0 },
+ { "Feicoptic", 0x03e4 , 0 },
+ { "Fhook", 0x0191 , 0 },
+ { "Fitacyrillic", 0x0472 , 0 },
+ { "Fiveroman", 0x2164 , 0 },
+ { "Fmonospace", 0xff26 , 0 },
+ { "Fourroman", 0x2163 , 0 },
+ { "Fsmall", 0xf766 , 0 },
+ { "GBsquare", 0x3387 , 0 },
+ { "Gacute", 0x01f4 , 0 },
+ { "Gammaafrican", 0x0194 , 0 },
+ { "Gangiacoptic", 0x03ea , 0 },
+ { "Gcedilla", 0x0122 , 0 },
+ { "Gcircle", 0x24bc , 0 },
+ { "Gdot", 0x0120 , 0 },
+ { "Gecyrillic", 0x0413 , 0 },
+ { "Ghadarmenian", 0x0542 , 0 },
+ { "Ghemiddlehookcyrillic", 0x0494 , 0 },
+ { "Ghestrokecyrillic", 0x0492 , 0 },
+ { "Gheupturncyrillic", 0x0490 , 0 },
+ { "Ghook", 0x0193 , 0 },
+ { "Gimarmenian", 0x0533 , 0 },
+ { "Gjecyrillic", 0x0403 , 0 },
+ { "Gmacron", 0x1e20 , 0 },
+ { "Gmonospace", 0xff27 , 0 },
+ { "Grave", 0xf6ce , 0 },
+ { "Gravesmall", 0xf760 , 0 },
+ { "Gsmall", 0xf767 , 0 },
+ { "Gsmallhook", 0x029b , 0 },
+ { "Gstroke", 0x01e4 , 0 },
+ { "HPsquare", 0x33cb , 0 },
+ { "Haabkhasiancyrillic", 0x04a8 , 0 },
+ { "Hadescendercyrillic", 0x04b2 , 0 },
+ { "Hardsigncyrillic", 0x042a , 0 },
+ { "Hbrevebelow", 0x1e2a , 0 },
+ { "Hcedilla", 0x1e28 , 0 },
+ { "Hcircle", 0x24bd , 0 },
+ { "Hdieresis", 0x1e26 , 0 },
+ { "Hdotaccent", 0x1e22 , 0 },
+ { "Hdotbelow", 0x1e24 , 0 },
+ { "Hmonospace", 0xff28 , 0 },
+ { "Hoarmenian", 0x0540 , 0 },
+ { "Horicoptic", 0x03e8 , 0 },
+ { "Hsmall", 0xf768 , 0 },
+ { "Hungarumlaut", 0xf6cf , 0 },
+ { "Hungarumlautsmall", 0xf6f8 , 0 },
+ { "Hzsquare", 0x3390 , 0 },
+ { "IAcyrillic", 0x042f , 0 },
+ { "IUcyrillic", 0x042e , 0 },
+ { "Iacutesmall", 0xf7ed , 0 },
+ { "Icaron", 0x01cf , 0 },
+ { "Icircle", 0x24be , 0 },
+ { "Icircumflexsmall", 0xf7ee , 0 },
+ { "Icyrillic", 0x0406 , 0 },
+ { "Idblgrave", 0x0208 , 0 },
+ { "Idieresisacute", 0x1e2e , 0 },
+ { "Idieresiscyrillic", 0x04e4 , 0 },
+ { "Idieresissmall", 0xf7ef , 0 },
+ { "Idot", 0x0130 , 0 },
+ { "Idotbelow", 0x1eca , 0 },
+ { "Iebrevecyrillic", 0x04d6 , 0 },
+ { "Iecyrillic", 0x0415 , 0 },
+ { "Igravesmall", 0xf7ec , 0 },
+ { "Ihookabove", 0x1ec8 , 0 },
+ { "Iicyrillic", 0x0418 , 0 },
+ { "Iinvertedbreve", 0x020a , 0 },
+ { "Iishortcyrillic", 0x0419 , 0 },
+ { "Imacroncyrillic", 0x04e2 , 0 },
+ { "Imonospace", 0xff29 , 0 },
+ { "Iniarmenian", 0x053b , 0 },
+ { "Iocyrillic", 0x0401 , 0 },
+ { "Iotaafrican", 0x0196 , 0 },
+ { "Ismall", 0xf769 , 0 },
+ { "Istroke", 0x0197 , 0 },
+ { "Itildebelow", 0x1e2c , 0 },
+ { "Izhitsacyrillic", 0x0474 , 0 },
+ { "Izhitsadblgravecyrillic", 0x0476 , 0 },
+ { "Jaarmenian", 0x0541 , 0 },
+ { "Jcircle", 0x24bf , 0 },
+ { "Jecyrillic", 0x0408 , 0 },
+ { "Jheharmenian", 0x054b , 0 },
+ { "Jmonospace", 0xff2a , 0 },
+ { "Jsmall", 0xf76a , 0 },
+ { "KBsquare", 0x3385 , 0 },
+ { "KKsquare", 0x33cd , 0 },
+ { "Kabashkircyrillic", 0x04a0 , 0 },
+ { "Kacute", 0x1e30 , 0 },
+ { "Kacyrillic", 0x041a , 0 },
+ { "Kadescendercyrillic", 0x049a , 0 },
+ { "Kahookcyrillic", 0x04c3 , 0 },
+ { "Kastrokecyrillic", 0x049e , 0 },
+ { "Kaverticalstrokecyrillic", 0x049c , 0 },
+ { "Kcaron", 0x01e8 , 0 },
+ { "Kcedilla", 0x0136 , 0 },
+ { "Kcircle", 0x24c0 , 0 },
+ { "Kdotbelow", 0x1e32 , 0 },
+ { "Keharmenian", 0x0554 , 0 },
+ { "Kenarmenian", 0x053f , 0 },
+ { "Khacyrillic", 0x0425 , 0 },
+ { "Kheicoptic", 0x03e6 , 0 },
+ { "Khook", 0x0198 , 0 },
+ { "Kjecyrillic", 0x040c , 0 },
+ { "Klinebelow", 0x1e34 , 0 },
+ { "Kmonospace", 0xff2b , 0 },
+ { "Koppacyrillic", 0x0480 , 0 },
+ { "Koppagreek", 0x03de , 0 },
+ { "Ksicyrillic", 0x046e , 0 },
+ { "Ksmall", 0xf76b , 0 },
+ { "LJ", 0x01c7 , 0 },
+ { "LL", 0xf6bf , 0 },
+ { "Lcedilla", 0x013b , 0 },
+ { "Lcircle", 0x24c1 , 0 },
+ { "Lcircumflexbelow", 0x1e3c , 0 },
+ { "Ldotaccent", 0x013f , 0 },
+ { "Ldotbelow", 0x1e36 , 0 },
+ { "Ldotbelowmacron", 0x1e38 , 0 },
+ { "Liwnarmenian", 0x053c , 0 },
+ { "Lj", 0x01c8 , 0 },
+ { "Ljecyrillic", 0x0409 , 0 },
+ { "Llinebelow", 0x1e3a , 0 },
+ { "Lmonospace", 0xff2c , 0 },
+ { "Lslashsmall", 0xf6f9 , 0 },
+ { "Lsmall", 0xf76c , 0 },
+ { "MBsquare", 0x3386 , 0 },
+ { "Macron", 0xf6d0 , 0 },
+ { "Macronsmall", 0xf7af , 0 },
+ { "Macute", 0x1e3e , 0 },
+ { "Mcircle", 0x24c2 , 0 },
+ { "Mdotaccent", 0x1e40 , 0 },
+ { "Mdotbelow", 0x1e42 , 0 },
+ { "Menarmenian", 0x0544 , 0 },
+ { "Mmonospace", 0xff2d , 0 },
+ { "Msmall", 0xf76d , 0 },
+ { "Mturned", 0x019c , 0 },
+ { "NJ", 0x01ca , 0 },
+ { "Ncedilla", 0x0145 , 0 },
+ { "Ncircle", 0x24c3 , 0 },
+ { "Ncircumflexbelow", 0x1e4a , 0 },
+ { "Ndotaccent", 0x1e44 , 0 },
+ { "Ndotbelow", 0x1e46 , 0 },
+ { "Nhookleft", 0x019d , 0 },
+ { "Nineroman", 0x2168 , 0 },
+ { "Nj", 0x01cb , 0 },
+ { "Njecyrillic", 0x040a , 0 },
+ { "Nlinebelow", 0x1e48 , 0 },
+ { "Nmonospace", 0xff2e , 0 },
+ { "Nowarmenian", 0x0546 , 0 },
+ { "Nsmall", 0xf76e , 0 },
+ { "Ntildesmall", 0xf7f1 , 0 },
+ { "OEsmall", 0xf6fa , 0 },
+ { "Oacutesmall", 0xf7f3 , 0 },
+ { "Obarredcyrillic", 0x04e8 , 0 },
+ { "Obarreddieresiscyrillic", 0x04ea , 0 },
+ { "Ocaron", 0x01d1 , 0 },
+ { "Ocenteredtilde", 0x019f , 0 },
+ { "Ocircle", 0x24c4 , 0 },
+ { "Ocircumflexacute", 0x1ed0 , 0 },
+ { "Ocircumflexdotbelow", 0x1ed8 , 0 },
+ { "Ocircumflexgrave", 0x1ed2 , 0 },
+ { "Ocircumflexhookabove", 0x1ed4 , 0 },
+ { "Ocircumflexsmall", 0xf7f4 , 0 },
+ { "Ocircumflextilde", 0x1ed6 , 0 },
+ { "Ocyrillic", 0x041e , 0 },
+ { "Odblacute", 0x0150 , 0 },
+ { "Odblgrave", 0x020c , 0 },
+ { "Odieresiscyrillic", 0x04e6 , 0 },
+ { "Odieresissmall", 0xf7f6 , 0 },
+ { "Odotbelow", 0x1ecc , 0 },
+ { "Ogoneksmall", 0xf6fb , 0 },
+ { "Ogravesmall", 0xf7f2 , 0 },
+ { "Oharmenian", 0x0555 , 0 },
+ { "Ohm", 0x2126 , 0 },
+ { "Ohookabove", 0x1ece , 0 },
+ { "Ohornacute", 0x1eda , 0 },
+ { "Ohorndotbelow", 0x1ee2 , 0 },
+ { "Ohorngrave", 0x1edc , 0 },
+ { "Ohornhookabove", 0x1ede , 0 },
+ { "Ohorntilde", 0x1ee0 , 0 },
+ { "Oi", 0x01a2 , 0 },
+ { "Oinvertedbreve", 0x020e , 0 },
+ { "Omacronacute", 0x1e52 , 0 },
+ { "Omacrongrave", 0x1e50 , 0 },
+ { "Omegacyrillic", 0x0460 , 0 },
+ { "Omegagreek", 0x03a9 , 0 },
+ { "Omegaroundcyrillic", 0x047a , 0 },
+ { "Omegatitlocyrillic", 0x047c , 0 },
+ { "Omonospace", 0xff2f , 0 },
+ { "Oneroman", 0x2160 , 0 },
+ { "Oogonek", 0x01ea , 0 },
+ { "Oogonekmacron", 0x01ec , 0 },
+ { "Oopen", 0x0186 , 0 },
+ { "Oslashsmall", 0xf7f8 , 0 },
+ { "Osmall", 0xf76f , 0 },
+ { "Ostrokeacute", 0x01fe , 0 },
+ { "Otcyrillic", 0x047e , 0 },
+ { "Otildeacute", 0x1e4c , 0 },
+ { "Otildedieresis", 0x1e4e , 0 },
+ { "Otildesmall", 0xf7f5 , 0 },
+ { "Pacute", 0x1e54 , 0 },
+ { "Pcircle", 0x24c5 , 0 },
+ { "Pdotaccent", 0x1e56 , 0 },
+ { "Pecyrillic", 0x041f , 0 },
+ { "Peharmenian", 0x054a , 0 },
+ { "Pemiddlehookcyrillic", 0x04a6 , 0 },
+ { "Phook", 0x01a4 , 0 },
+ { "Piwrarmenian", 0x0553 , 0 },
+ { "Pmonospace", 0xff30 , 0 },
+ { "Psicyrillic", 0x0470 , 0 },
+ { "Psmall", 0xf770 , 0 },
+ { "Qcircle", 0x24c6 , 0 },
+ { "Qmonospace", 0xff31 , 0 },
+ { "Qsmall", 0xf771 , 0 },
+ { "Raarmenian", 0x054c , 0 },
+ { "Rcedilla", 0x0156 , 0 },
+ { "Rcircle", 0x24c7 , 0 },
+ { "Rdblgrave", 0x0210 , 0 },
+ { "Rdotaccent", 0x1e58 , 0 },
+ { "Rdotbelow", 0x1e5a , 0 },
+ { "Rdotbelowmacron", 0x1e5c , 0 },
+ { "Reharmenian", 0x0550 , 0 },
+ { "Ringsmall", 0xf6fc , 0 },
+ { "Rinvertedbreve", 0x0212 , 0 },
+ { "Rlinebelow", 0x1e5e , 0 },
+ { "Rmonospace", 0xff32 , 0 },
+ { "Rsmall", 0xf772 , 0 },
+ { "Rsmallinverted", 0x0281 , 0 },
+ { "Rsmallinvertedsuperior", 0x02b6 , 0 },
+ { "Sacutedotaccent", 0x1e64 , 0 },
+ { "Sampigreek", 0x03e0 , 0 },
+ { "Scarondotaccent", 0x1e66 , 0 },
+ { "Scaronsmall", 0xf6fd , 0 },
+ { "Schwa", 0x018f , 0 },
+ { "Schwacyrillic", 0x04d8 , 0 },
+ { "Schwadieresiscyrillic", 0x04da , 0 },
+ { "Scircle", 0x24c8 , 0 },
+ { "Sdotaccent", 0x1e60 , 0 },
+ { "Sdotbelow", 0x1e62 , 0 },
+ { "Sdotbelowdotaccent", 0x1e68 , 0 },
+ { "Seharmenian", 0x054d , 0 },
+ { "Sevenroman", 0x2166 , 0 },
+ { "Shaarmenian", 0x0547 , 0 },
+ { "Shacyrillic", 0x0428 , 0 },
+ { "Shchacyrillic", 0x0429 , 0 },
+ { "Sheicoptic", 0x03e2 , 0 },
+ { "Shhacyrillic", 0x04ba , 0 },
+ { "Shimacoptic", 0x03ec , 0 },
+ { "Sixroman", 0x2165 , 0 },
+ { "Smonospace", 0xff33 , 0 },
+ { "Softsigncyrillic", 0x042c , 0 },
+ { "Ssmall", 0xf773 , 0 },
+ { "Stigmagreek", 0x03da , 0 },
+ { "Tcedilla", 0x0162 , 0 },
+ { "Tcircle", 0x24c9 , 0 },
+ { "Tcircumflexbelow", 0x1e70 , 0 },
+ { "Tdotaccent", 0x1e6a , 0 },
+ { "Tdotbelow", 0x1e6c , 0 },
+ { "Tecyrillic", 0x0422 , 0 },
+ { "Tedescendercyrillic", 0x04ac , 0 },
+ { "Tenroman", 0x2169 , 0 },
+ { "Tetsecyrillic", 0x04b4 , 0 },
+ { "Thook", 0x01ac , 0 },
+ { "Thornsmall", 0xf7fe , 0 },
+ { "Threeroman", 0x2162 , 0 },
+ { "Tildesmall", 0xf6fe , 0 },
+ { "Tiwnarmenian", 0x054f , 0 },
+ { "Tlinebelow", 0x1e6e , 0 },
+ { "Tmonospace", 0xff34 , 0 },
+ { "Toarmenian", 0x0539 , 0 },
+ { "Tonefive", 0x01bc , 0 },
+ { "Tonesix", 0x0184 , 0 },
+ { "Tonetwo", 0x01a7 , 0 },
+ { "Tretroflexhook", 0x01ae , 0 },
+ { "Tsecyrillic", 0x0426 , 0 },
+ { "Tshecyrillic", 0x040b , 0 },
+ { "Tsmall", 0xf774 , 0 },
+ { "Twelveroman", 0x216b , 0 },
+ { "Tworoman", 0x2161 , 0 },
+ { "Uacutesmall", 0xf7fa , 0 },
+ { "Ucaron", 0x01d3 , 0 },
+ { "Ucircle", 0x24ca , 0 },
+ { "Ucircumflexbelow", 0x1e76 , 0 },
+ { "Ucircumflexsmall", 0xf7fb , 0 },
+ { "Ucyrillic", 0x0423 , 0 },
+ { "Udblacute", 0x0170 , 0 },
+ { "Udblgrave", 0x0214 , 0 },
+ { "Udieresisacute", 0x01d7 , 0 },
+ { "Udieresisbelow", 0x1e72 , 0 },
+ { "Udieresiscaron", 0x01d9 , 0 },
+ { "Udieresiscyrillic", 0x04f0 , 0 },
+ { "Udieresisgrave", 0x01db , 0 },
+ { "Udieresismacron", 0x01d5 , 0 },
+ { "Udieresissmall", 0xf7fc , 0 },
+ { "Udotbelow", 0x1ee4 , 0 },
+ { "Ugravesmall", 0xf7f9 , 0 },
+ { "Uhookabove", 0x1ee6 , 0 },
+ { "Uhornacute", 0x1ee8 , 0 },
+ { "Uhorndotbelow", 0x1ef0 , 0 },
+ { "Uhorngrave", 0x1eea , 0 },
+ { "Uhornhookabove", 0x1eec , 0 },
+ { "Uhorntilde", 0x1eee , 0 },
+ { "Uhungarumlautcyrillic", 0x04f2 , 0 },
+ { "Uinvertedbreve", 0x0216 , 0 },
+ { "Ukcyrillic", 0x0478 , 0 },
+ { "Umacroncyrillic", 0x04ee , 0 },
+ { "Umacrondieresis", 0x1e7a , 0 },
+ { "Umonospace", 0xff35 , 0 },
+ { "Upsilonacutehooksymbolgreek", 0x03d3 , 0 },
+ { "Upsilonafrican", 0x01b1 , 0 },
+ { "Upsilondieresishooksymbolgreek", 0x03d4 , 0 },
+ { "Upsilonhooksymbol", 0x03d2 , 0 },
+ { "Ushortcyrillic", 0x040e , 0 },
+ { "Usmall", 0xf775 , 0 },
+ { "Ustraightcyrillic", 0x04ae , 0 },
+ { "Ustraightstrokecyrillic", 0x04b0 , 0 },
+ { "Utildeacute", 0x1e78 , 0 },
+ { "Utildebelow", 0x1e74 , 0 },
+ { "Vcircle", 0x24cb , 0 },
+ { "Vdotbelow", 0x1e7e , 0 },
+ { "Vecyrillic", 0x0412 , 0 },
+ { "Vewarmenian", 0x054e , 0 },
+ { "Vhook", 0x01b2 , 0 },
+ { "Vmonospace", 0xff36 , 0 },
+ { "Voarmenian", 0x0548 , 0 },
+ { "Vsmall", 0xf776 , 0 },
+ { "Vtilde", 0x1e7c , 0 },
+ { "Wcircle", 0x24cc , 0 },
+ { "Wdotaccent", 0x1e86 , 0 },
+ { "Wdotbelow", 0x1e88 , 0 },
+ { "Wmonospace", 0xff37 , 0 },
+ { "Wsmall", 0xf777 , 0 },
+ { "Xcircle", 0x24cd , 0 },
+ { "Xdieresis", 0x1e8c , 0 },
+ { "Xdotaccent", 0x1e8a , 0 },
+ { "Xeharmenian", 0x053d , 0 },
+ { "Xmonospace", 0xff38 , 0 },
+ { "Xsmall", 0xf778 , 0 },
+ { "Yacutesmall", 0xf7fd , 0 },
+ { "Yatcyrillic", 0x0462 , 0 },
+ { "Ycircle", 0x24ce , 0 },
+ { "Ydieresissmall", 0xf7ff , 0 },
+ { "Ydotaccent", 0x1e8e , 0 },
+ { "Ydotbelow", 0x1ef4 , 0 },
+ { "Yericyrillic", 0x042b , 0 },
+ { "Yerudieresiscyrillic", 0x04f8 , 0 },
+ { "Yhook", 0x01b3 , 0 },
+ { "Yhookabove", 0x1ef6 , 0 },
+ { "Yiarmenian", 0x0545 , 0 },
+ { "Yicyrillic", 0x0407 , 0 },
+ { "Yiwnarmenian", 0x0552 , 0 },
+ { "Ymonospace", 0xff39 , 0 },
+ { "Ysmall", 0xf779 , 0 },
+ { "Ytilde", 0x1ef8 , 0 },
+ { "Yusbigcyrillic", 0x046a , 0 },
+ { "Yusbigiotifiedcyrillic", 0x046c , 0 },
+ { "Yuslittlecyrillic", 0x0466 , 0 },
+ { "Yuslittleiotifiedcyrillic", 0x0468 , 0 },
+ { "Zaarmenian", 0x0536 , 0 },
+ { "Zcaronsmall", 0xf6ff , 0 },
+ { "Zcircle", 0x24cf , 0 },
+ { "Zcircumflex", 0x1e90 , 0 },
+ { "Zdot", 0x017b , 0 },
+ { "Zdotbelow", 0x1e92 , 0 },
+ { "Zecyrillic", 0x0417 , 0 },
+ { "Zedescendercyrillic", 0x0498 , 0 },
+ { "Zedieresiscyrillic", 0x04de , 0 },
+ { "Zhearmenian", 0x053a , 0 },
+ { "Zhebrevecyrillic", 0x04c1 , 0 },
+ { "Zhecyrillic", 0x0416 , 0 },
+ { "Zhedescendercyrillic", 0x0496 , 0 },
+ { "Zhedieresiscyrillic", 0x04dc , 0 },
+ { "Zlinebelow", 0x1e94 , 0 },
+ { "Zmonospace", 0xff3a , 0 },
+ { "Zsmall", 0xf77a , 0 },
+ { "Zstroke", 0x01b5 , 0 },
+ { "aabengali", 0x0986 , 0 },
+ { "aadeva", 0x0906 , 0 },
+ { "aagujarati", 0x0a86 , 0 },
+ { "aagurmukhi", 0x0a06 , 0 },
+ { "aamatragurmukhi", 0x0a3e , 0 },
+ { "aarusquare", 0x3303 , 0 },
+ { "aavowelsignbengali", 0x09be , 0 },
+ { "aavowelsigndeva", 0x093e , 0 },
+ { "aavowelsigngujarati", 0x0abe , 0 },
+ { "abbreviationmarkarmenian", 0x055f , 0 },
+ { "abbreviationsigndeva", 0x0970 , 0 },
+ { "abengali", 0x0985 , 0 },
+ { "abopomofo", 0x311a , 0 },
+ { "abreveacute", 0x1eaf , 0 },
+ { "abrevecyrillic", 0x04d1 , 0 },
+ { "abrevedotbelow", 0x1eb7 , 0 },
+ { "abrevegrave", 0x1eb1 , 0 },
+ { "abrevehookabove", 0x1eb3 , 0 },
+ { "abrevetilde", 0x1eb5 , 0 },
+ { "acaron", 0x01ce , 0 },
+ { "acircle", 0x24d0 , 0 },
+ { "acircumflexacute", 0x1ea5 , 0 },
+ { "acircumflexdotbelow", 0x1ead , 0 },
+ { "acircumflexgrave", 0x1ea7 , 0 },
+ { "acircumflexhookabove", 0x1ea9 , 0 },
+ { "acircumflextilde", 0x1eab , 0 },
+ { "acutebelowcmb", 0x0317 , 0 },
+ { "acutecmb", 0x0301 , 0 },
+ { "acutedeva", 0x0954 , 0 },
+ { "acutelowmod", 0x02cf , 0 },
+ { "acutetonecmb", 0x0341 , 0 },
+ { "acyrillic", 0x0430 , 0 },
+ { "adblgrave", 0x0201 , 0 },
+ { "addakgurmukhi", 0x0a71 , 0 },
+ { "adeva", 0x0905 , 0 },
+ { "adieresiscyrillic", 0x04d3 , 0 },
+ { "adieresismacron", 0x01df , 0 },
+ { "adotbelow", 0x1ea1 , 0 },
+ { "adotmacron", 0x01e1 , 0 },
+ { "aekorean", 0x3150 , 0 },
+ { "aemacron", 0x01e3 , 0 },
+ { "afii08941", 0x20a4 , 0 },
+ { "afii10063", 0xf6c4 , 0 },
+ { "afii10064", 0xf6c5 , 0 },
+ { "afii10192", 0xf6c6 , 0 },
+ { "afii10831", 0xf6c7 , 0 },
+ { "afii10832", 0xf6c8 , 0 },
+ { "afii57694", 0xfb2a , 0 },
+ { "afii57695", 0xfb2b , 0 },
+ { "afii57700", 0xfb4b , 0 },
+ { "afii57705", 0xfb1f , 0 },
+ { "afii57723", 0xfb35 , 0 },
+ { "agujarati", 0x0a85 , 0 },
+ { "agurmukhi", 0x0a05 , 0 },
+ { "ahiragana", 0x3042 , 0 },
+ { "ahookabove", 0x1ea3 , 0 },
+ { "aibengali", 0x0990 , 0 },
+ { "aibopomofo", 0x311e , 0 },
+ { "aideva", 0x0910 , 0 },
+ { "aiecyrillic", 0x04d5 , 0 },
+ { "aigujarati", 0x0a90 , 0 },
+ { "aigurmukhi", 0x0a10 , 0 },
+ { "aimatragurmukhi", 0x0a48 , 0 },
+ { "ainarabic", 0x0639 , 0 },
+ { "ainfinalarabic", 0xfeca , 0 },
+ { "aininitialarabic", 0xfecb , 0 },
+ { "ainmedialarabic", 0xfecc , 0 },
+ { "ainvertedbreve", 0x0203 , 0 },
+ { "aivowelsignbengali", 0x09c8 , 0 },
+ { "aivowelsigndeva", 0x0948 , 0 },
+ { "aivowelsigngujarati", 0x0ac8 , 0 },
+ { "akatakana", 0x30a2 , 0 },
+ { "akatakanahalfwidth", 0xff71 , 0 },
+ { "akorean", 0x314f , 0 },
+ { "alef", 0x05d0 , 0 },
+ { "alefarabic", 0x0627 , 0 },
+ { "alefdageshhebrew", 0xfb30 , 0 },
+ { "aleffinalarabic", 0xfe8e , 0 },
+ { "alefhamzaabovearabic", 0x0623 , 0 },
+ { "alefhamzaabovefinalarabic", 0xfe84 , 0 },
+ { "alefhamzabelowarabic", 0x0625 , 0 },
+ { "alefhamzabelowfinalarabic", 0xfe88 , 0 },
+ { "alefhebrew", 0x05d0 , 0 },
+ { "aleflamedhebrew", 0xfb4f , 0 },
+ { "alefmaddaabovearabic", 0x0622 , 0 },
+ { "alefmaddaabovefinalarabic", 0xfe82 , 0 },
+ { "alefmaksuraarabic", 0x0649 , 0 },
+ { "alefmaksurafinalarabic", 0xfef0 , 0 },
+ { "alefmaksurainitialarabic", 0xfef3 , 0 },
+ { "alefmaksuramedialarabic", 0xfef4 , 0 },
+ { "alefpatahhebrew", 0xfb2e , 0 },
+ { "alefqamatshebrew", 0xfb2f , 0 },
+ { "allequal", 0x224c , 0 },
+ { "amonospace", 0xff41 , 0 },
+ { "ampersandmonospace", 0xff06 , 0 },
+ { "ampersandsmall", 0xf726 , 0 },
+ { "amsquare", 0x33c2 , 0 },
+ { "anbopomofo", 0x3122 , 0 },
+ { "angbopomofo", 0x3124 , 0 },
+ { "angkhankhuthai", 0x0e5a , 0 },
+ { "anglebracketleft", 0x3008 , 0 },
+ { "anglebracketleftvertical", 0xfe3f , 0 },
+ { "anglebracketright", 0x3009 , 0 },
+ { "anglebracketrightvertical", 0xfe40 , 0 },
+ { "angstrom", 0x212b , 0 },
+ { "anudattadeva", 0x0952 , 0 },
+ { "anusvarabengali", 0x0982 , 0 },
+ { "anusvaradeva", 0x0902 , 0 },
+ { "anusvaragujarati", 0x0a82 , 0 },
+ { "apaatosquare", 0x3300 , 0 },
+ { "aparen", 0x249c , 0 },
+ { "apostrophearmenian", 0x055a , 0 },
+ { "apostrophemod", 0x02bc , 0 },
+ { "apple", 0xf8ff , 0 },
+ { "approaches", 0x2250 , 0 },
+ { "approxequalorimage", 0x2252 , 0 },
+ { "approximatelyequal", 0x2245 , 0 },
+ { "araeaekorean", 0x318e , 0 },
+ { "araeakorean", 0x318d , 0 },
+ { "arc", 0x2312 , 0 },
+ { "arighthalfring", 0x1e9a , 0 },
+ { "aringbelow", 0x1e01 , 0 },
+ { "arrowdashdown", 0x21e3 , 0 },
+ { "arrowdashleft", 0x21e0 , 0 },
+ { "arrowdashright", 0x21e2 , 0 },
+ { "arrowdashup", 0x21e1 , 0 },
+ { "arrowdownleft", 0x2199 , 0 },
+ { "arrowdownright", 0x2198 , 0 },
+ { "arrowdownwhite", 0x21e9 , 0 },
+ { "arrowheaddownmod", 0x02c5 , 0 },
+ { "arrowheadleftmod", 0x02c2 , 0 },
+ { "arrowheadrightmod", 0x02c3 , 0 },
+ { "arrowheadupmod", 0x02c4 , 0 },
+ { "arrowhorizex", 0xf8e7 , 0 },
+ { "arrowleftdbl", 0x21d0 , 0 },
+ { "arrowleftdblstroke", 0x21cd , 0 },
+ { "arrowleftoverright", 0x21c6 , 0 },
+ { "arrowleftwhite", 0x21e6 , 0 },
+ { "arrowrightdblstroke", 0x21cf , 0 },
+ { "arrowrightheavy", 0x279e , 0 },
+ { "arrowrightoverleft", 0x21c4 , 0 },
+ { "arrowrightwhite", 0x21e8 , 0 },
+ { "arrowtableft", 0x21e4 , 0 },
+ { "arrowtabright", 0x21e5 , 0 },
+ { "arrowupdownbase", 0x21a8 , 0 },
+ { "arrowupleft", 0x2196 , 0 },
+ { "arrowupleftofdown", 0x21c5 , 0 },
+ { "arrowupright", 0x2197 , 0 },
+ { "arrowupwhite", 0x21e7 , 0 },
+ { "arrowvertex", 0xf8e6 , 0 },
+ { "asciicircummonospace", 0xff3e , 0 },
+ { "asciitildemonospace", 0xff5e , 0 },
+ { "ascript", 0x0251 , 0 },
+ { "ascriptturned", 0x0252 , 0 },
+ { "asmallhiragana", 0x3041 , 0 },
+ { "asmallkatakana", 0x30a1 , 0 },
+ { "asmallkatakanahalfwidth", 0xff67 , 0 },
+ { "asteriskaltonearabic", 0x066d , 0 },
+ { "asteriskarabic", 0x066d , 0 },
+ { "asteriskmonospace", 0xff0a , 0 },
+ { "asterisksmall", 0xfe61 , 0 },
+ { "asterism", 0x2042 , 0 },
+ { "asuperior", 0xf6e9 , 0 },
+ { "asymptoticallyequal", 0x2243 , 0 },
+ { "atmonospace", 0xff20 , 0 },
+ { "atsmall", 0xfe6b , 0 },
+ { "aturned", 0x0250 , 0 },
+ { "aubengali", 0x0994 , 0 },
+ { "aubopomofo", 0x3120 , 0 },
+ { "audeva", 0x0914 , 0 },
+ { "augujarati", 0x0a94 , 0 },
+ { "augurmukhi", 0x0a14 , 0 },
+ { "aulengthmarkbengali", 0x09d7 , 0 },
+ { "aumatragurmukhi", 0x0a4c , 0 },
+ { "auvowelsignbengali", 0x09cc , 0 },
+ { "auvowelsigndeva", 0x094c , 0 },
+ { "auvowelsigngujarati", 0x0acc , 0 },
+ { "avagrahadeva", 0x093d , 0 },
+ { "aybarmenian", 0x0561 , 0 },
+ { "ayin", 0x05e2 , 0 },
+ { "ayinaltonehebrew", 0xfb20 , 0 },
+ { "ayinhebrew", 0x05e2 , 0 },
+ { "babengali", 0x09ac , 0 },
+ { "backslashmonospace", 0xff3c , 0 },
+ { "badeva", 0x092c , 0 },
+ { "bagujarati", 0x0aac , 0 },
+ { "bagurmukhi", 0x0a2c , 0 },
+ { "bahiragana", 0x3070 , 0 },
+ { "bahtthai", 0x0e3f , 0 },
+ { "bakatakana", 0x30d0 , 0 },
+ { "barmonospace", 0xff5c , 0 },
+ { "bbopomofo", 0x3105 , 0 },
+ { "bcircle", 0x24d1 , 0 },
+ { "bdotaccent", 0x1e03 , 0 },
+ { "bdotbelow", 0x1e05 , 0 },
+ { "beamedsixteenthnotes", 0x266c , 0 },
+ { "because", 0x2235 , 0 },
+ { "becyrillic", 0x0431 , 0 },
+ { "beharabic", 0x0628 , 0 },
+ { "behfinalarabic", 0xfe90 , 0 },
+ { "behinitialarabic", 0xfe91 , 0 },
+ { "behiragana", 0x3079 , 0 },
+ { "behmedialarabic", 0xfe92 , 0 },
+ { "behmeeminitialarabic", 0xfc9f , 0 },
+ { "behmeemisolatedarabic", 0xfc08 , 0 },
+ { "behnoonfinalarabic", 0xfc6d , 0 },
+ { "bekatakana", 0x30d9 , 0 },
+ { "benarmenian", 0x0562 , 0 },
+ { "bet", 0x05d1 , 0 },
+ { "betasymbolgreek", 0x03d0 , 0 },
+ { "betdagesh", 0xfb31 , 0 },
+ { "betdageshhebrew", 0xfb31 , 0 },
+ { "bethebrew", 0x05d1 , 0 },
+ { "betrafehebrew", 0xfb4c , 0 },
+ { "bhabengali", 0x09ad , 0 },
+ { "bhadeva", 0x092d , 0 },
+ { "bhagujarati", 0x0aad , 0 },
+ { "bhagurmukhi", 0x0a2d , 0 },
+ { "bhook", 0x0253 , 0 },
+ { "bihiragana", 0x3073 , 0 },
+ { "bikatakana", 0x30d3 , 0 },
+ { "bilabialclick", 0x0298 , 0 },
+ { "bindigurmukhi", 0x0a02 , 0 },
+ { "birusquare", 0x3331 , 0 },
+ { "blackcircle", 0x25cf , 0 },
+ { "blackdiamond", 0x25c6 , 0 },
+ { "blackdownpointingtriangle", 0x25bc , 0 },
+ { "blackleftpointingpointer", 0x25c4 , 0 },
+ { "blackleftpointingtriangle", 0x25c0 , 0 },
+ { "blacklenticularbracketleft", 0x3010 , 0 },
+ { "blacklenticularbracketleftvertical", 0xfe3b , 0 },
+ { "blacklenticularbracketright", 0x3011 , 0 },
+ { "blacklenticularbracketrightvertical", 0xfe3c , 0 },
+ { "blacklowerlefttriangle", 0x25e3 , 0 },
+ { "blacklowerrighttriangle", 0x25e2 , 0 },
+ { "blackrectangle", 0x25ac , 0 },
+ { "blackrightpointingpointer", 0x25ba , 0 },
+ { "blackrightpointingtriangle", 0x25b6 , 0 },
+ { "blacksmallsquare", 0x25aa , 0 },
+ { "blacksmilingface", 0x263b , 0 },
+ { "blacksquare", 0x25a0 , 0 },
+ { "blackstar", 0x2605 , 0 },
+ { "blackupperlefttriangle", 0x25e4 , 0 },
+ { "blackupperrighttriangle", 0x25e5 , 0 },
+ { "blackuppointingsmalltriangle", 0x25b4 , 0 },
+ { "blackuppointingtriangle", 0x25b2 , 0 },
+ { "blank", 0x2423 , 0 },
+ { "blinebelow", 0x1e07 , 0 },
+ { "bmonospace", 0xff42 , 0 },
+ { "bobaimaithai", 0x0e1a , 0 },
+ { "bohiragana", 0x307c , 0 },
+ { "bokatakana", 0x30dc , 0 },
+ { "bparen", 0x249d , 0 },
+ { "bqsquare", 0x33c3 , 0 },
+ { "braceex", 0xf8f4 , 0 },
+ { "braceleftbt", 0xf8f3 , 0 },
+ { "braceleftmid", 0xf8f2 , 0 },
+ { "braceleftmonospace", 0xff5b , 0 },
+ { "braceleftsmall", 0xfe5b , 0 },
+ { "bracelefttp", 0xf8f1 , 0 },
+ { "braceleftvertical", 0xfe37 , 0 },
+ { "bracerightbt", 0xf8fe , 0 },
+ { "bracerightmid", 0xf8fd , 0 },
+ { "bracerightmonospace", 0xff5d , 0 },
+ { "bracerightsmall", 0xfe5c , 0 },
+ { "bracerighttp", 0xf8fc , 0 },
+ { "bracerightvertical", 0xfe38 , 0 },
+ { "bracketleftbt", 0xf8f0 , 0 },
+ { "bracketleftex", 0xf8ef , 0 },
+ { "bracketleftmonospace", 0xff3b , 0 },
+ { "bracketlefttp", 0xf8ee , 0 },
+ { "bracketrightbt", 0xf8fb , 0 },
+ { "bracketrightex", 0xf8fa , 0 },
+ { "bracketrightmonospace", 0xff3d , 0 },
+ { "bracketrighttp", 0xf8f9 , 0 },
+ { "brevebelowcmb", 0x032e , 0 },
+ { "brevecmb", 0x0306 , 0 },
+ { "breveinvertedbelowcmb", 0x032f , 0 },
+ { "breveinvertedcmb", 0x0311 , 0 },
+ { "breveinverteddoublecmb", 0x0361 , 0 },
+ { "bridgebelowcmb", 0x032a , 0 },
+ { "bridgeinvertedbelowcmb", 0x033a , 0 },
+ { "bstroke", 0x0180 , 0 },
+ { "bsuperior", 0xf6ea , 0 },
+ { "btopbar", 0x0183 , 0 },
+ { "buhiragana", 0x3076 , 0 },
+ { "bukatakana", 0x30d6 , 0 },
+ { "bulletinverse", 0x25d8 , 0 },
+ { "bulletoperator", 0x2219 , 0 },
+ { "bullseye", 0x25ce , 0 },
+ { "caarmenian", 0x056e , 0 },
+ { "cabengali", 0x099a , 0 },
+ { "cadeva", 0x091a , 0 },
+ { "cagujarati", 0x0a9a , 0 },
+ { "cagurmukhi", 0x0a1a , 0 },
+ { "calsquare", 0x3388 , 0 },
+ { "candrabindubengali", 0x0981 , 0 },
+ { "candrabinducmb", 0x0310 , 0 },
+ { "candrabindudeva", 0x0901 , 0 },
+ { "candrabindugujarati", 0x0a81 , 0 },
+ { "capslock", 0x21ea , 0 },
+ { "careof", 0x2105 , 0 },
+ { "caronbelowcmb", 0x032c , 0 },
+ { "caroncmb", 0x030c , 0 },
+ { "cbopomofo", 0x3118 , 0 },
+ { "ccedillaacute", 0x1e09 , 0 },
+ { "ccircle", 0x24d2 , 0 },
+ { "ccurl", 0x0255 , 0 },
+ { "cdot", 0x010b , 0 },
+ { "cdsquare", 0x33c5 , 0 },
+ { "cedillacmb", 0x0327 , 0 },
+ { "centigrade", 0x2103 , 0 },
+ { "centinferior", 0xf6df , 0 },
+ { "centmonospace", 0xffe0 , 0 },
+ { "centoldstyle", 0xf7a2 , 0 },
+ { "centsuperior", 0xf6e0 , 0 },
+ { "chaarmenian", 0x0579 , 0 },
+ { "chabengali", 0x099b , 0 },
+ { "chadeva", 0x091b , 0 },
+ { "chagujarati", 0x0a9b , 0 },
+ { "chagurmukhi", 0x0a1b , 0 },
+ { "chbopomofo", 0x3114 , 0 },
+ { "cheabkhasiancyrillic", 0x04bd , 0 },
+ { "checkmark", 0x2713 , 0 },
+ { "checyrillic", 0x0447 , 0 },
+ { "chedescenderabkhasiancyrillic", 0x04bf , 0 },
+ { "chedescendercyrillic", 0x04b7 , 0 },
+ { "chedieresiscyrillic", 0x04f5 , 0 },
+ { "cheharmenian", 0x0573 , 0 },
+ { "chekhakassiancyrillic", 0x04cc , 0 },
+ { "cheverticalstrokecyrillic", 0x04b9 , 0 },
+ { "chieuchacirclekorean", 0x3277 , 0 },
+ { "chieuchaparenkorean", 0x3217 , 0 },
+ { "chieuchcirclekorean", 0x3269 , 0 },
+ { "chieuchkorean", 0x314a , 0 },
+ { "chieuchparenkorean", 0x3209 , 0 },
+ { "chochangthai", 0x0e0a , 0 },
+ { "chochanthai", 0x0e08 , 0 },
+ { "chochingthai", 0x0e09 , 0 },
+ { "chochoethai", 0x0e0c , 0 },
+ { "chook", 0x0188 , 0 },
+ { "cieucacirclekorean", 0x3276 , 0 },
+ { "cieucaparenkorean", 0x3216 , 0 },
+ { "cieuccirclekorean", 0x3268 , 0 },
+ { "cieuckorean", 0x3148 , 0 },
+ { "cieucparenkorean", 0x3208 , 0 },
+ { "cieucuparenkorean", 0x321c , 0 },
+ { "circleot", 0x2299 , 0 }, /* Typo in Adobe's glyphlist */
+ { "circledot", 0x2299 , 0 }, /* But same typo exists in acrobat */
+ { "circlepostalmark", 0x3036 , 0 },
+ { "circlewithlefthalfblack", 0x25d0 , 0 },
+ { "circlewithrighthalfblack", 0x25d1 , 0 },
+ { "circumflexbelowcmb", 0x032d , 0 },
+ { "circumflexcmb", 0x0302 , 0 },
+ { "clear", 0x2327 , 0 },
+ { "clickalveolar", 0x01c2 , 0 },
+ { "clickdental", 0x01c0 , 0 },
+ { "clicklateral", 0x01c1 , 0 },
+ { "clickretroflex", 0x01c3 , 0 },
+ { "clubsuitblack", 0x2663 , 0 },
+ { "clubsuitwhite", 0x2667 , 0 },
+ { "cmcubedsquare", 0x33a4 , 0 },
+ { "cmonospace", 0xff43 , 0 },
+ { "cmsquaredsquare", 0x33a0 , 0 },
+ { "coarmenian", 0x0581 , 0 },
+ { "colonmonospace", 0xff1a , 0 },
+ { "colonsign", 0x20a1 , 0 },
+ { "colonsmall", 0xfe55 , 0 },
+ { "colontriangularhalfmod", 0x02d1 , 0 },
+ { "colontriangularmod", 0x02d0 , 0 },
+ { "commaabovecmb", 0x0313 , 0 },
+ { "commaaboverightcmb", 0x0315 , 0 },
+ { "commaaccent", 0xf6c3 , 0 },
+ { "commaarabic", 0x060c , 0 },
+ { "commaarmenian", 0x055d , 0 },
+ { "commainferior", 0xf6e1 , 0 },
+ { "commamonospace", 0xff0c , 0 },
+ { "commareversedabovecmb", 0x0314 , 0 },
+ { "commareversedmod", 0x02bd , 0 },
+ { "commasmall", 0xfe50 , 0 },
+ { "commasuperior", 0xf6e2 , 0 },
+ { "commaturnedabovecmb", 0x0312 , 0 },
+ { "commaturnedmod", 0x02bb , 0 },
+ { "compass", 0x263c , 0 },
+ { "contourintegral", 0x222e , 0 },
+ { "control", 0x2303 , 0 },
+ { "controlACK", 0x0006 , 0 },
+ { "controlBEL", 0x0007 , 0 },
+ { "controlBS", 0x0008 , 0 },
+ { "controlCAN", 0x0018 , 0 },
+ { "controlCR", 0x000d , 0 },
+ { "controlDC1", 0x0011 , 0 },
+ { "controlDC2", 0x0012 , 0 },
+ { "controlDC3", 0x0013 , 0 },
+ { "controlDC4", 0x0014 , 0 },
+ { "controlDEL", 0x007f , 0 },
+ { "controlDLE", 0x0010 , 0 },
+ { "controlEM", 0x0019 , 0 },
+ { "controlENQ", 0x0005 , 0 },
+ { "controlEOT", 0x0004 , 0 },
+ { "controlESC", 0x001b , 0 },
+ { "controlETB", 0x0017 , 0 },
+ { "controlETX", 0x0003 , 0 },
+ { "controlFF", 0x000c , 0 },
+ { "controlFS", 0x001c , 0 },
+ { "controlGS", 0x001d , 0 },
+ { "controlHT", 0x0009 , 0 },
+ { "controlLF", 0x000a , 0 },
+ { "controlNAK", 0x0015 , 0 },
+ { "controlRS", 0x001e , 0 },
+ { "controlSI", 0x000f , 0 },
+ { "controlSO", 0x000e , 0 },
+ { "controlSOT", 0x0002 , 0 },
+ { "controlSTX", 0x0001 , 0 },
+ { "controlSUB", 0x001a , 0 },
+ { "controlSYN", 0x0016 , 0 },
+ { "controlUS", 0x001f , 0 },
+ { "controlVT", 0x000b , 0 },
+ { "copyrightsans", 0xf8e9 , 0 },
+ { "copyrightserif", 0xf6d9 , 0 },
+ { "cornerbracketleft", 0x300c , 0 },
+ { "cornerbracketlefthalfwidth", 0xff62 , 0 },
+ { "cornerbracketleftvertical", 0xfe41 , 0 },
+ { "cornerbracketright", 0x300d , 0 },
+ { "cornerbracketrighthalfwidth", 0xff63 , 0 },
+ { "cornerbracketrightvertical", 0xfe42 , 0 },
+ { "corporationsquare", 0x337f , 0 },
+ { "cosquare", 0x33c7 , 0 },
+ { "coverkgsquare", 0x33c6 , 0 },
+ { "cparen", 0x249e , 0 },
+ { "cruzeiro", 0x20a2 , 0 },
+ { "cstretched", 0x0297 , 0 },
+ { "curlyand", 0x22cf , 0 },
+ { "curlyor", 0x22ce , 0 },
+ { "cyrBreve", 0xf6d1 , 0 },
+ { "cyrFlex", 0xf6d2 , 0 },
+ { "cyrbreve", 0xf6d4 , 0 },
+ { "cyrflex", 0xf6d5 , 0 },
+ { "daarmenian", 0x0564 , 0 },
+ { "dabengali", 0x09a6 , 0 },
+ { "dadarabic", 0x0636 , 0 },
+ { "dadeva", 0x0926 , 0 },
+ { "dadfinalarabic", 0xfebe , 0 },
+ { "dadinitialarabic", 0xfebf , 0 },
+ { "dadmedialarabic", 0xfec0 , 0 },
+ { "dagesh", 0x05bc , 0 },
+ { "dageshhebrew", 0x05bc , 0 },
+ { "dagujarati", 0x0aa6 , 0 },
+ { "dagurmukhi", 0x0a26 , 0 },
+ { "dahiragana", 0x3060 , 0 },
+ { "dakatakana", 0x30c0 , 0 },
+ { "dalarabic", 0x062f , 0 },
+ { "dalet", 0x05d3 , 0 },
+ { "daletdagesh", 0xfb33 , 0 },
+ { "daletdageshhebrew", 0xfb33 , 0 },
+ { "dalethatafpatah", 0x05d3 , 0 },
+ { "dalethatafpatahhebrew", 0x05d3 , 0 },
+ { "dalethatafsegol", 0x05d3 , 0 },
+ { "dalethatafsegolhebrew", 0x05d3 , 0 },
+ { "dalethebrew", 0x05d3 , 0 },
+ { "dalethiriq", 0x05d3 , 0 },
+ { "dalethiriqhebrew", 0x05d3 , 0 },
+ { "daletholam", 0x05d3 , 0 },
+ { "daletholamhebrew", 0x05d3 , 0 },
+ { "daletpatah", 0x05d3 , 0 },
+ { "daletpatahhebrew", 0x05d3 , 0 },
+ { "daletqamats", 0x05d3 , 0 },
+ { "daletqamatshebrew", 0x05d3 , 0 },
+ { "daletqubuts", 0x05d3 , 0 },
+ { "daletqubutshebrew", 0x05d3 , 0 },
+ { "daletsegol", 0x05d3 , 0 },
+ { "daletsegolhebrew", 0x05d3 , 0 },
+ { "daletsheva", 0x05d3 , 0 },
+ { "daletshevahebrew", 0x05d3 , 0 },
+ { "dalettsere", 0x05d3 , 0 },
+ { "dalettserehebrew", 0x05d3 , 0 },
+ { "dalfinalarabic", 0xfeaa , 0 },
+ { "dammaarabic", 0x064f , 0 },
+ { "dammalowarabic", 0x064f , 0 },
+ { "dammatanaltonearabic", 0x064c , 0 },
+ { "dammatanarabic", 0x064c , 0 },
+ { "danda", 0x0964 , 0 },
+ { "dargahebrew", 0x05a7 , 0 },
+ { "dargalefthebrew", 0x05a7 , 0 },
+ { "dasiapneumatacyrilliccmb", 0x0485 , 0 },
+ { "dblGrave", 0xf6d3 , 0 },
+ { "dblanglebracketleft", 0x300a , 0 },
+ { "dblanglebracketleftvertical", 0xfe3d , 0 },
+ { "dblanglebracketright", 0x300b , 0 },
+ { "dblanglebracketrightvertical", 0xfe3e , 0 },
+ { "dblarchinvertedbelowcmb", 0x032b , 0 },
+ { "dblarrowleft", 0x21d4 , 0 },
+ { "dblarrowright", 0x21d2 , 0 },
+ { "dbldanda", 0x0965 , 0 },
+ { "dblgrave", 0xf6d6 , 0 },
+ { "dblgravecmb", 0x030f , 0 },
+ { "dblintegral", 0x222c , 0 },
+ { "dbllowline", 0x2017 , 0 },
+ { "dbllowlinecmb", 0x0333 , 0 },
+ { "dbloverlinecmb", 0x033f , 0 },
+ { "dblprimemod", 0x02ba , 0 },
+ { "dblverticalbar", 0x2016 , 0 },
+ { "dblverticallineabovecmb", 0x030e , 0 },
+ { "dbopomofo", 0x3109 , 0 },
+ { "dbsquare", 0x33c8 , 0 },
+ { "dcedilla", 0x1e11 , 0 },
+ { "dcircle", 0x24d3 , 0 },
+ { "dcircumflexbelow", 0x1e13 , 0 },
+ { "ddabengali", 0x09a1 , 0 },
+ { "ddadeva", 0x0921 , 0 },
+ { "ddagujarati", 0x0aa1 , 0 },
+ { "ddagurmukhi", 0x0a21 , 0 },
+ { "ddalarabic", 0x0688 , 0 },
+ { "ddalfinalarabic", 0xfb89 , 0 },
+ { "dddhadeva", 0x095c , 0 },
+ { "ddhabengali", 0x09a2 , 0 },
+ { "ddhadeva", 0x0922 , 0 },
+ { "ddhagujarati", 0x0aa2 , 0 },
+ { "ddhagurmukhi", 0x0a22 , 0 },
+ { "ddotaccent", 0x1e0b , 0 },
+ { "ddotbelow", 0x1e0d , 0 },
+ { "decimalseparatorarabic", 0x066b , 0 },
+ { "decimalseparatorpersian", 0x066b , 0 },
+ { "decyrillic", 0x0434 , 0 },
+ { "dehihebrew", 0x05ad , 0 },
+ { "dehiragana", 0x3067 , 0 },
+ { "deicoptic", 0x03ef , 0 },
+ { "dekatakana", 0x30c7 , 0 },
+ { "deleteleft", 0x232b , 0 },
+ { "deleteright", 0x2326 , 0 },
+ { "deltaturned", 0x018d , 0 },
+ { "denominatorminusonenumeratorbengali", 0x09f8 , 0 },
+ { "dezh", 0x02a4 , 0 },
+ { "dhabengali", 0x09a7 , 0 },
+ { "dhadeva", 0x0927 , 0 },
+ { "dhagujarati", 0x0aa7 , 0 },
+ { "dhagurmukhi", 0x0a27 , 0 },
+ { "dhook", 0x0257 , 0 },
+ { "dialytikatonos", 0x0385 , 0 },
+ { "dialytikatonoscmb", 0x0344 , 0 },
+ { "diamondsuitwhite", 0x2662 , 0 },
+ { "dieresisacute", 0xf6d7 , 0 },
+ { "dieresisbelowcmb", 0x0324 , 0 },
+ { "dieresiscmb", 0x0308 , 0 },
+ { "dieresisgrave", 0xf6d8 , 0 },
+ { "dihiragana", 0x3062 , 0 },
+ { "dikatakana", 0x30c2 , 0 },
+ { "dittomark", 0x3003 , 0 },
+ { "divides", 0x2223 , 0 },
+ { "divisionslash", 0x2215 , 0 },
+ { "djecyrillic", 0x0452 , 0 },
+ { "dlinebelow", 0x1e0f , 0 },
+ { "dlsquare", 0x3397 , 0 },
+ { "dmacron", 0x0111 , 0 },
+ { "dmonospace", 0xff44 , 0 },
+ { "dochadathai", 0x0e0e , 0 },
+ { "dodekthai", 0x0e14 , 0 },
+ { "dohiragana", 0x3069 , 0 },
+ { "dokatakana", 0x30c9 , 0 },
+ { "dollarinferior", 0xf6e3 , 0 },
+ { "dollarmonospace", 0xff04 , 0 },
+ { "dollaroldstyle", 0xf724 , 0 },
+ { "dollarsmall", 0xfe69 , 0 },
+ { "dollarsuperior", 0xf6e4 , 0 },
+ { "dorusquare", 0x3326 , 0 },
+ { "dotaccentcmb", 0x0307 , 0 },
+ { "dotbelowcmb", 0x0323 , 0 },
+ { "dotkatakana", 0x30fb , 0 },
+ { "dotlessj", 0x0237 , 0 }, /* !!!! AGL Still says this is 0xf6be */
+ { "dotlessjstrokehook", 0x0284 , 0 },
+ { "dottedcircle", 0x25cc , 0 },
+ { "doubleyodpatah", 0xfb1f , 0 },
+ { "doubleyodpatahhebrew", 0xfb1f , 0 },
+ { "downtackbelowcmb", 0x031e , 0 },
+ { "downtackmod", 0x02d5 , 0 },
+ { "dparen", 0x249f , 0 },
+ { "dsuperior", 0xf6eb , 0 },
+ { "dtail", 0x0256 , 0 },
+ { "dtopbar", 0x018c , 0 },
+ { "duhiragana", 0x3065 , 0 },
+ { "dukatakana", 0x30c5 , 0 },
+ { "dz", 0x01f3 , 0 },
+ { "dzaltone", 0x02a3 , 0 },
+ { "dzcaron", 0x01c6 , 0 },
+ { "dzcurl", 0x02a5 , 0 },
+ { "dzeabkhasiancyrillic", 0x04e1 , 0 },
+ { "dzecyrillic", 0x0455 , 0 },
+ { "dzhecyrillic", 0x045f , 0 },
+ { "earth", 0x2641 , 0 },
+ { "ebengali", 0x098f , 0 },
+ { "ebopomofo", 0x311c , 0 },
+ { "ecandradeva", 0x090d , 0 },
+ { "ecandragujarati", 0x0a8d , 0 },
+ { "ecandravowelsigndeva", 0x0945 , 0 },
+ { "ecandravowelsigngujarati", 0x0ac5 , 0 },
+ { "ecedillabreve", 0x1e1d , 0 },
+ { "echarmenian", 0x0565 , 0 },
+ { "echyiwnarmenian", 0x0587 , 0 },
+ { "ecircle", 0x24d4 , 0 },
+ { "ecircumflexacute", 0x1ebf , 0 },
+ { "ecircumflexbelow", 0x1e19 , 0 },
+ { "ecircumflexdotbelow", 0x1ec7 , 0 },
+ { "ecircumflexgrave", 0x1ec1 , 0 },
+ { "ecircumflexhookabove", 0x1ec3 , 0 },
+ { "ecircumflextilde", 0x1ec5 , 0 },
+ { "ecyrillic", 0x0454 , 0 },
+ { "edblgrave", 0x0205 , 0 },
+ { "edeva", 0x090f , 0 },
+ { "edot", 0x0117 , 0 },
+ { "edotbelow", 0x1eb9 , 0 },
+ { "eegurmukhi", 0x0a0f , 0 },
+ { "eematragurmukhi", 0x0a47 , 0 },
+ { "efcyrillic", 0x0444 , 0 },
+ { "egujarati", 0x0a8f , 0 },
+ { "eharmenian", 0x0567 , 0 },
+ { "ehbopomofo", 0x311d , 0 },
+ { "ehiragana", 0x3048 , 0 },
+ { "ehookabove", 0x1ebb , 0 },
+ { "eibopomofo", 0x311f , 0 },
+ { "eightarabic", 0x0668 , 0 },
+ { "eightbengali", 0x09ee , 0 },
+ { "eightcircle", 0x2467 , 0 },
+ { "eightcircleinversesansserif", 0x2791 , 0 },
+ { "eightdeva", 0x096e , 0 },
+ { "eighteencircle", 0x2471 , 0 },
+ { "eighteenparen", 0x2485 , 0 },
+ { "eighteenperiod", 0x2499 , 0 },
+ { "eightgujarati", 0x0aee , 0 },
+ { "eightgurmukhi", 0x0a6e , 0 },
+ { "eighthackarabic", 0x0668 , 0 },
+ { "eighthangzhou", 0x3028 , 0 },
+ { "eighthnotebeamed", 0x266b , 0 },
+ { "eightideographicparen", 0x3227 , 0 },
+ { "eightinferior", 0x2088 , 0 },
+ { "eightmonospace", 0xff18 , 0 },
+ { "eightoldstyle", 0xf738 , 0 },
+ { "eightparen", 0x247b , 0 },
+ { "eightperiod", 0x248f , 0 },
+ { "eightpersian", 0x06f8 , 0 },
+ { "eightroman", 0x2177 , 0 },
+ { "eightsuperior", 0x2078 , 0 },
+ { "eightthai", 0x0e58 , 0 },
+ { "einvertedbreve", 0x0207 , 0 },
+ { "eiotifiedcyrillic", 0x0465 , 0 },
+ { "ekatakana", 0x30a8 , 0 },
+ { "ekatakanahalfwidth", 0xff74 , 0 },
+ { "ekonkargurmukhi", 0x0a74 , 0 },
+ { "ekorean", 0x3154 , 0 },
+ { "elcyrillic", 0x043b , 0 },
+ { "elevencircle", 0x246a , 0 },
+ { "elevenparen", 0x247e , 0 },
+ { "elevenperiod", 0x2492 , 0 },
+ { "elevenroman", 0x217a , 0 },
+ { "ellipsisvertical", 0x22ee , 0 },
+ { "emacronacute", 0x1e17 , 0 },
+ { "emacrongrave", 0x1e15 , 0 },
+ { "emcyrillic", 0x043c , 0 },
+ { "emdashvertical", 0xfe31 , 0 },
+ { "emonospace", 0xff45 , 0 },
+ { "emphasismarkarmenian", 0x055b , 0 },
+ { "enbopomofo", 0x3123 , 0 },
+ { "encyrillic", 0x043d , 0 },
+ { "endashvertical", 0xfe32 , 0 },
+ { "endescendercyrillic", 0x04a3 , 0 },
+ { "engbopomofo", 0x3125 , 0 },
+ { "enghecyrillic", 0x04a5 , 0 },
+ { "enhookcyrillic", 0x04c8 , 0 },
+ { "enspace", 0x2002 , 0 },
+ { "eokorean", 0x3153 , 0 },
+ { "eopen", 0x025b , 0 },
+ { "eopenclosed", 0x029a , 0 },
+ { "eopenreversed", 0x025c , 0 },
+ { "eopenreversedclosed", 0x025e , 0 },
+ { "eopenreversedhook", 0x025d , 0 },
+ { "eparen", 0x24a0 , 0 },
+ { "equalmonospace", 0xff1d , 0 },
+ { "equalsmall", 0xfe66 , 0 },
+ { "equalsuperior", 0x207c , 0 },
+ { "erbopomofo", 0x3126 , 0 },
+ { "ercyrillic", 0x0440 , 0 },
+ { "ereversed", 0x0258 , 0 },
+ { "ereversedcyrillic", 0x044d , 0 },
+ { "escyrillic", 0x0441 , 0 },
+ { "esdescendercyrillic", 0x04ab , 0 },
+ { "esh", 0x0283 , 0 },
+ { "eshcurl", 0x0286 , 0 },
+ { "eshortdeva", 0x090e , 0 },
+ { "eshortvowelsigndeva", 0x0946 , 0 },
+ { "eshreversedloop", 0x01aa , 0 },
+ { "eshsquatreversed", 0x0285 , 0 },
+ { "esmallhiragana", 0x3047 , 0 },
+ { "esmallkatakana", 0x30a7 , 0 },
+ { "esmallkatakanahalfwidth", 0xff6a , 0 },
+ { "esuperior", 0xf6ec , 0 },
+ { "etarmenian", 0x0568 , 0 },
+ { "etilde", 0x1ebd , 0 },
+ { "etildebelow", 0x1e1b , 0 },
+ { "etnahtafoukhhebrew", 0x0591 , 0 },
+ { "etnahtafoukhlefthebrew", 0x0591 , 0 },
+ { "etnahtahebrew", 0x0591 , 0 },
+ { "etnahtalefthebrew", 0x0591 , 0 },
+ { "eturned", 0x01dd , 0 },
+ { "eukorean", 0x3161 , 0 },
+ { "euro", 0x20ac , 0 },
+ { "evowelsignbengali", 0x09c7 , 0 },
+ { "evowelsigndeva", 0x0947 , 0 },
+ { "evowelsigngujarati", 0x0ac7 , 0 },
+ { "exclamarmenian", 0x055c , 0 },
+ { "exclamdownsmall", 0xf7a1 , 0 },
+ { "exclammonospace", 0xff01 , 0 },
+ { "exclamsmall", 0xf721 , 0 },
+ { "ezh", 0x0292 , 0 },
+ { "ezhcaron", 0x01ef , 0 },
+ { "ezhcurl", 0x0293 , 0 },
+ { "ezhreversed", 0x01b9 , 0 },
+ { "ezhtail", 0x01ba , 0 },
+ { "fadeva", 0x095e , 0 },
+ { "fagurmukhi", 0x0a5e , 0 },
+ { "fahrenheit", 0x2109 , 0 },
+ { "fathaarabic", 0x064e , 0 },
+ { "fathalowarabic", 0x064e , 0 },
+ { "fathatanarabic", 0x064b , 0 },
+ { "fbopomofo", 0x3108 , 0 },
+ { "fcircle", 0x24d5 , 0 },
+ { "fdotaccent", 0x1e1f , 0 },
+ { "feharabic", 0x0641 , 0 },
+ { "feharmenian", 0x0586 , 0 },
+ { "fehfinalarabic", 0xfed2 , 0 },
+ { "fehinitialarabic", 0xfed3 , 0 },
+ { "fehmedialarabic", 0xfed4 , 0 },
+ { "feicoptic", 0x03e5 , 0 },
+ { "ff", 0xfb00 , 0 },
+ { "ffi", 0xfb03 , 0 },
+ { "ffl", 0xfb04 , 0 },
+ { "fi", 0xfb01 , 0 },
+ { "fifteencircle", 0x246e , 0 },
+ { "fifteenparen", 0x2482 , 0 },
+ { "fifteenperiod", 0x2496 , 0 },
+ { "finalkaf", 0x05da , 0 },
+ { "finalkafdagesh", 0xfb3a , 0 },
+ { "finalkafdageshhebrew", 0xfb3a , 0 },
+ { "finalkafhebrew", 0x05da , 0 },
+ { "finalkafqamats", 0x05da , 0 },
+ { "finalkafqamatshebrew", 0x05da , 0 },
+ { "finalkafsheva", 0x05da , 0 },
+ { "finalkafshevahebrew", 0x05da , 0 },
+ { "finalmem", 0x05dd , 0 },
+ { "finalmemhebrew", 0x05dd , 0 },
+ { "finalnun", 0x05df , 0 },
+ { "finalnunhebrew", 0x05df , 0 },
+ { "finalpe", 0x05e3 , 0 },
+ { "finalpehebrew", 0x05e3 , 0 },
+ { "finaltsadi", 0x05e5 , 0 },
+ { "finaltsadihebrew", 0x05e5 , 0 },
+ { "firsttonechinese", 0x02c9 , 0 },
+ { "fisheye", 0x25c9 , 0 },
+ { "fitacyrillic", 0x0473 , 0 },
+ { "fivearabic", 0x0665 , 0 },
+ { "fivebengali", 0x09eb , 0 },
+ { "fivecircle", 0x2464 , 0 },
+ { "fivecircleinversesansserif", 0x278e , 0 },
+ { "fivedeva", 0x096b , 0 },
+ { "fivegujarati", 0x0aeb , 0 },
+ { "fivegurmukhi", 0x0a6b , 0 },
+ { "fivehackarabic", 0x0665 , 0 },
+ { "fivehangzhou", 0x3025 , 0 },
+ { "fiveideographicparen", 0x3224 , 0 },
+ { "fiveinferior", 0x2085 , 0 },
+ { "fivemonospace", 0xff15 , 0 },
+ { "fiveoldstyle", 0xf735 , 0 },
+ { "fiveparen", 0x2478 , 0 },
+ { "fiveperiod", 0x248c , 0 },
+ { "fivepersian", 0x06f5 , 0 },
+ { "fiveroman", 0x2174 , 0 },
+ { "fivesuperior", 0x2075 , 0 },
+ { "fivethai", 0x0e55 , 0 },
+ { "fl", 0xfb02 , 0 },
+ { "fmonospace", 0xff46 , 0 },
+ { "fmsquare", 0x3399 , 0 },
+ { "fofanthai", 0x0e1f , 0 },
+ { "fofathai", 0x0e1d , 0 },
+ { "fongmanthai", 0x0e4f , 0 },
+ { "forall", 0x2200 , 0 },
+ { "fourarabic", 0x0664 , 0 },
+ { "fourbengali", 0x09ea , 0 },
+ { "fourcircle", 0x2463 , 0 },
+ { "fourcircleinversesansserif", 0x278d , 0 },
+ { "fourdeva", 0x096a , 0 },
+ { "fourgujarati", 0x0aea , 0 },
+ { "fourgurmukhi", 0x0a6a , 0 },
+ { "fourhackarabic", 0x0664 , 0 },
+ { "fourhangzhou", 0x3024 , 0 },
+ { "fourideographicparen", 0x3223 , 0 },
+ { "fourinferior", 0x2084 , 0 },
+ { "fourmonospace", 0xff14 , 0 },
+ { "fournumeratorbengali", 0x09f7 , 0 },
+ { "fouroldstyle", 0xf734 , 0 },
+ { "fourparen", 0x2477 , 0 },
+ { "fourperiod", 0x248b , 0 },
+ { "fourpersian", 0x06f4 , 0 },
+ { "fourroman", 0x2173 , 0 },
+ { "foursuperior", 0x2074 , 0 },
+ { "fourteencircle", 0x246d , 0 },
+ { "fourteenparen", 0x2481 , 0 },
+ { "fourteenperiod", 0x2495 , 0 },
+ { "fourthai", 0x0e54 , 0 },
+ { "fourthtonechinese", 0x02cb , 0 },
+ { "fparen", 0x24a1 , 0 },
+ { "gabengali", 0x0997 , 0 },
+ { "gacute", 0x01f5 , 0 },
+ { "gadeva", 0x0917 , 0 },
+ { "gafarabic", 0x06af , 0 },
+ { "gaffinalarabic", 0xfb93 , 0 },
+ { "gafinitialarabic", 0xfb94 , 0 },
+ { "gafmedialarabic", 0xfb95 , 0 },
+ { "gagujarati", 0x0a97 , 0 },
+ { "gagurmukhi", 0x0a17 , 0 },
+ { "gahiragana", 0x304c , 0 },
+ { "gakatakana", 0x30ac , 0 },
+ { "gammalatinsmall", 0x0263 , 0 },
+ { "gammasuperior", 0x02e0 , 0 },
+ { "gangiacoptic", 0x03eb , 0 },
+ { "gbopomofo", 0x310d , 0 },
+ { "gcedilla", 0x0123 , 0 },
+ { "gcircle", 0x24d6 , 0 },
+ { "gdot", 0x0121 , 0 },
+ { "gecyrillic", 0x0433 , 0 },
+ { "gehiragana", 0x3052 , 0 },
+ { "gekatakana", 0x30b2 , 0 },
+ { "geometricallyequal", 0x2251 , 0 },
+ { "gereshaccenthebrew", 0x059c , 0 },
+ { "gereshhebrew", 0x05f3 , 0 },
+ { "gereshmuqdamhebrew", 0x059d , 0 },
+ { "gershayimaccenthebrew", 0x059e , 0 },
+ { "gershayimhebrew", 0x05f4 , 0 },
+ { "getamark", 0x3013 , 0 },
+ { "ghabengali", 0x0998 , 0 },
+ { "ghadarmenian", 0x0572 , 0 },
+ { "ghadeva", 0x0918 , 0 },
+ { "ghagujarati", 0x0a98 , 0 },
+ { "ghagurmukhi", 0x0a18 , 0 },
+ { "ghainarabic", 0x063a , 0 },
+ { "ghainfinalarabic", 0xfece , 0 },
+ { "ghaininitialarabic", 0xfecf , 0 },
+ { "ghainmedialarabic", 0xfed0 , 0 },
+ { "ghemiddlehookcyrillic", 0x0495 , 0 },
+ { "ghestrokecyrillic", 0x0493 , 0 },
+ { "gheupturncyrillic", 0x0491 , 0 },
+ { "ghhadeva", 0x095a , 0 },
+ { "ghhagurmukhi", 0x0a5a , 0 },
+ { "ghook", 0x0260 , 0 },
+ { "ghzsquare", 0x3393 , 0 },
+ { "gihiragana", 0x304e , 0 },
+ { "gikatakana", 0x30ae , 0 },
+ { "gimarmenian", 0x0563 , 0 },
+ { "gimel", 0x05d2 , 0 },
+ { "gimeldagesh", 0xfb32 , 0 },
+ { "gimeldageshhebrew", 0xfb32 , 0 },
+ { "gimelhebrew", 0x05d2 , 0 },
+ { "gjecyrillic", 0x0453 , 0 },
+ { "glottalinvertedstroke", 0x01be , 0 },
+ { "glottalstop", 0x0294 , 0 },
+ { "glottalstopinverted", 0x0296 , 0 },
+ { "glottalstopmod", 0x02c0 , 0 },
+ { "glottalstopreversed", 0x0295 , 0 },
+ { "glottalstopreversedmod", 0x02c1 , 0 },
+ { "glottalstopreversedsuperior", 0x02e4 , 0 },
+ { "glottalstopstroke", 0x02a1 , 0 },
+ { "glottalstopstrokereversed", 0x02a2 , 0 },
+ { "gmacron", 0x1e21 , 0 },
+ { "gmonospace", 0xff47 , 0 },
+ { "gohiragana", 0x3054 , 0 },
+ { "gokatakana", 0x30b4 , 0 },
+ { "gparen", 0x24a2 , 0 },
+ { "gpasquare", 0x33ac , 0 },
+ { "gravebelowcmb", 0x0316 , 0 },
+ { "gravecmb", 0x0300 , 0 },
+ { "gravedeva", 0x0953 , 0 },
+ { "gravelowmod", 0x02ce , 0 },
+ { "gravemonospace", 0xff40 , 0 },
+ { "gravetonecmb", 0x0340 , 0 },
+ { "greaterequalorless", 0x22db , 0 },
+ { "greatermonospace", 0xff1e , 0 },
+ { "greaterorequivalent", 0x2273 , 0 },
+ { "greaterorless", 0x2277 , 0 },
+ { "greateroverequal", 0x2267 , 0 },
+ { "greatersmall", 0xfe65 , 0 },
+ { "gscript", 0x0261 , 0 },
+ { "gstroke", 0x01e5 , 0 },
+ { "guhiragana", 0x3050 , 0 },
+ { "gukatakana", 0x30b0 , 0 },
+ { "guramusquare", 0x3318 , 0 },
+ { "gysquare", 0x33c9 , 0 },
+ { "haabkhasiancyrillic", 0x04a9 , 0 },
+ { "haaltonearabic", 0x06c1 , 0 },
+ { "habengali", 0x09b9 , 0 },
+ { "hadescendercyrillic", 0x04b3 , 0 },
+ { "hadeva", 0x0939 , 0 },
+ { "hagujarati", 0x0ab9 , 0 },
+ { "hagurmukhi", 0x0a39 , 0 },
+ { "haharabic", 0x062d , 0 },
+ { "hahfinalarabic", 0xfea2 , 0 },
+ { "hahinitialarabic", 0xfea3 , 0 },
+ { "hahiragana", 0x306f , 0 },
+ { "hahmedialarabic", 0xfea4 , 0 },
+ { "haitusquare", 0x332a , 0 },
+ { "hakatakana", 0x30cf , 0 },
+ { "hakatakanahalfwidth", 0xff8a , 0 },
+ { "halantgurmukhi", 0x0a4d , 0 },
+ { "hamzaarabic", 0x0621 , 0 },
+ { "hamzadammaarabic", 0x0621 , 0 },
+ { "hamzadammatanarabic", 0x0621 , 0 },
+ { "hamzafathaarabic", 0x0621 , 0 },
+ { "hamzafathatanarabic", 0x0621 , 0 },
+ { "hamzalowarabic", 0x0621 , 0 },
+ { "hamzalowkasraarabic", 0x0621 , 0 },
+ { "hamzalowkasratanarabic", 0x0621 , 0 },
+ { "hamzasukunarabic", 0x0621 , 0 },
+ { "hangulfiller", 0x3164 , 0 },
+ { "hardsigncyrillic", 0x044a , 0 },
+ { "harpoonleftbarbup", 0x21bc , 0 },
+ { "harpoonrightbarbup", 0x21c0 , 0 },
+ { "hasquare", 0x33ca , 0 },
+ { "hatafpatah", 0x05b2 , 0 },
+ { "hatafpatah16", 0x05b2 , 0 },
+ { "hatafpatah23", 0x05b2 , 0 },
+ { "hatafpatah2f", 0x05b2 , 0 },
+ { "hatafpatahhebrew", 0x05b2 , 0 },
+ { "hatafpatahnarrowhebrew", 0x05b2 , 0 },
+ { "hatafpatahquarterhebrew", 0x05b2 , 0 },
+ { "hatafpatahwidehebrew", 0x05b2 , 0 },
+ { "hatafqamats", 0x05b3 , 0 },
+ { "hatafqamats1b", 0x05b3 , 0 },
+ { "hatafqamats28", 0x05b3 , 0 },
+ { "hatafqamats34", 0x05b3 , 0 },
+ { "hatafqamatshebrew", 0x05b3 , 0 },
+ { "hatafqamatsnarrowhebrew", 0x05b3 , 0 },
+ { "hatafqamatsquarterhebrew", 0x05b3 , 0 },
+ { "hatafqamatswidehebrew", 0x05b3 , 0 },
+ { "hatafsegol", 0x05b1 , 0 },
+ { "hatafsegol17", 0x05b1 , 0 },
+ { "hatafsegol24", 0x05b1 , 0 },
+ { "hatafsegol30", 0x05b1 , 0 },
+ { "hatafsegolhebrew", 0x05b1 , 0 },
+ { "hatafsegolnarrowhebrew", 0x05b1 , 0 },
+ { "hatafsegolquarterhebrew", 0x05b1 , 0 },
+ { "hatafsegolwidehebrew", 0x05b1 , 0 },
+ { "hbopomofo", 0x310f , 0 },
+ { "hbrevebelow", 0x1e2b , 0 },
+ { "hcedilla", 0x1e29 , 0 },
+ { "hcircle", 0x24d7 , 0 },
+ { "hdieresis", 0x1e27 , 0 },
+ { "hdotaccent", 0x1e23 , 0 },
+ { "hdotbelow", 0x1e25 , 0 },
+ { "he", 0x05d4 , 0 },
+ { "heartsuitblack", 0x2665 , 0 },
+ { "heartsuitwhite", 0x2661 , 0 },
+ { "hedagesh", 0xfb34 , 0 },
+ { "hedageshhebrew", 0xfb34 , 0 },
+ { "hehaltonearabic", 0x06c1 , 0 },
+ { "heharabic", 0x0647 , 0 },
+ { "hehebrew", 0x05d4 , 0 },
+ { "hehfinalaltonearabic", 0xfba7 , 0 },
+ { "hehfinalalttwoarabic", 0xfeea , 0 },
+ { "hehfinalarabic", 0xfeea , 0 },
+ { "hehhamzaabovefinalarabic", 0xfba5 , 0 },
+ { "hehhamzaaboveisolatedarabic", 0xfba4 , 0 },
+ { "hehinitialaltonearabic", 0xfba8 , 0 },
+ { "hehinitialarabic", 0xfeeb , 0 },
+ { "hehiragana", 0x3078 , 0 },
+ { "hehmedialaltonearabic", 0xfba9 , 0 },
+ { "hehmedialarabic", 0xfeec , 0 },
+ { "heiseierasquare", 0x337b , 0 },
+ { "hekatakana", 0x30d8 , 0 },
+ { "hekatakanahalfwidth", 0xff8d , 0 },
+ { "hekutaarusquare", 0x3336 , 0 },
+ { "henghook", 0x0267 , 0 },
+ { "herutusquare", 0x3339 , 0 },
+ { "het", 0x05d7 , 0 },
+ { "hethebrew", 0x05d7 , 0 },
+ { "hhook", 0x0266 , 0 },
+ { "hhooksuperior", 0x02b1 , 0 },
+ { "hieuhacirclekorean", 0x327b , 0 },
+ { "hieuhaparenkorean", 0x321b , 0 },
+ { "hieuhcirclekorean", 0x326d , 0 },
+ { "hieuhkorean", 0x314e , 0 },
+ { "hieuhparenkorean", 0x320d , 0 },
+ { "hihiragana", 0x3072 , 0 },
+ { "hikatakana", 0x30d2 , 0 },
+ { "hikatakanahalfwidth", 0xff8b , 0 },
+ { "hiriq", 0x05b4 , 0 },
+ { "hiriq14", 0x05b4 , 0 },
+ { "hiriq21", 0x05b4 , 0 },
+ { "hiriq2d", 0x05b4 , 0 },
+ { "hiriqhebrew", 0x05b4 , 0 },
+ { "hiriqnarrowhebrew", 0x05b4 , 0 },
+ { "hiriqquarterhebrew", 0x05b4 , 0 },
+ { "hiriqwidehebrew", 0x05b4 , 0 },
+ { "hlinebelow", 0x1e96 , 0 },
+ { "hmonospace", 0xff48 , 0 },
+ { "hoarmenian", 0x0570 , 0 },
+ { "hohipthai", 0x0e2b , 0 },
+ { "hohiragana", 0x307b , 0 },
+ { "hokatakana", 0x30db , 0 },
+ { "hokatakanahalfwidth", 0xff8e , 0 },
+ { "holam", 0x05b9 , 0 },
+ { "holam19", 0x05b9 , 0 },
+ { "holam26", 0x05b9 , 0 },
+ { "holam32", 0x05b9 , 0 },
+ { "holamhebrew", 0x05b9 , 0 },
+ { "holamnarrowhebrew", 0x05b9 , 0 },
+ { "holamquarterhebrew", 0x05b9 , 0 },
+ { "holamwidehebrew", 0x05b9 , 0 },
+ { "honokhukthai", 0x0e2e , 0 },
+ { "hookcmb", 0x0309 , 0 },
+ { "hookpalatalizedbelowcmb", 0x0321 , 0 },
+ { "hookretroflexbelowcmb", 0x0322 , 0 },
+ { "hoonsquare", 0x3342 , 0 },
+ { "horicoptic", 0x03e9 , 0 },
+ { "horizontalbar", 0x2015 , 0 },
+ { "horncmb", 0x031b , 0 },
+ { "hotsprings", 0x2668 , 0 },
+ { "hparen", 0x24a3 , 0 },
+ { "hsuperior", 0x02b0 , 0 },
+ { "hturned", 0x0265 , 0 },
+ { "huhiragana", 0x3075 , 0 },
+ { "huiitosquare", 0x3333 , 0 },
+ { "hukatakana", 0x30d5 , 0 },
+ { "hukatakanahalfwidth", 0xff8c , 0 },
+ { "hungarumlautcmb", 0x030b , 0 },
+ { "hv", 0x0195 , 0 },
+ { "hypheninferior", 0xf6e5 , 0 },
+ { "hyphenmonospace", 0xff0d , 0 },
+ { "hyphensmall", 0xfe63 , 0 },
+ { "hyphensuperior", 0xf6e6 , 0 },
+ { "hyphentwo", 0x2010 , 0 },
+ { "iacyrillic", 0x044f , 0 },
+ { "ibengali", 0x0987 , 0 },
+ { "ibopomofo", 0x3127 , 0 },
+ { "icaron", 0x01d0 , 0 },
+ { "icircle", 0x24d8 , 0 },
+ { "icyrillic", 0x0456 , 0 },
+ { "idblgrave", 0x0209 , 0 },
+ { "ideographearthcircle", 0x328f , 0 },
+ { "ideographfirecircle", 0x328b , 0 },
+ { "ideographicallianceparen", 0x323f , 0 },
+ { "ideographiccallparen", 0x323a , 0 },
+ { "ideographiccentrecircle", 0x32a5 , 0 },
+ { "ideographicclose", 0x3006 , 0 },
+ { "ideographiccomma", 0x3001 , 0 },
+ { "ideographiccommaleft", 0xff64 , 0 },
+ { "ideographiccongratulationparen", 0x3237 , 0 },
+ { "ideographiccorrectcircle", 0x32a3 , 0 },
+ { "ideographicearthparen", 0x322f , 0 },
+ { "ideographicenterpriseparen", 0x323d , 0 },
+ { "ideographicexcellentcircle", 0x329d , 0 },
+ { "ideographicfestivalparen", 0x3240 , 0 },
+ { "ideographicfinancialcircle", 0x3296 , 0 },
+ { "ideographicfinancialparen", 0x3236 , 0 },
+ { "ideographicfireparen", 0x322b , 0 },
+ { "ideographichaveparen", 0x3232 , 0 },
+ { "ideographichighcircle", 0x32a4 , 0 },
+ { "ideographiciterationmark", 0x3005 , 0 },
+ { "ideographiclaborcircle", 0x3298 , 0 },
+ { "ideographiclaborparen", 0x3238 , 0 },
+ { "ideographicleftcircle", 0x32a7 , 0 },
+ { "ideographiclowcircle", 0x32a6 , 0 },
+ { "ideographicmedicinecircle", 0x32a9 , 0 },
+ { "ideographicmetalparen", 0x322e , 0 },
+ { "ideographicmoonparen", 0x322a , 0 },
+ { "ideographicnameparen", 0x3234 , 0 },
+ { "ideographicperiod", 0x3002 , 0 },
+ { "ideographicprintcircle", 0x329e , 0 },
+ { "ideographicreachparen", 0x3243 , 0 },
+ { "ideographicrepresentparen", 0x3239 , 0 },
+ { "ideographicresourceparen", 0x323e , 0 },
+ { "ideographicrightcircle", 0x32a8 , 0 },
+ { "ideographicsecretcircle", 0x3299 , 0 },
+ { "ideographicselfparen", 0x3242 , 0 },
+ { "ideographicsocietyparen", 0x3233 , 0 },
+ { "ideographicspace", 0x3000 , 0 },
+ { "ideographicspecialparen", 0x3235 , 0 },
+ { "ideographicstockparen", 0x3231 , 0 },
+ { "ideographicstudyparen", 0x323b , 0 },
+ { "ideographicsunparen", 0x3230 , 0 },
+ { "ideographicsuperviseparen", 0x323c , 0 },
+ { "ideographicwaterparen", 0x322c , 0 },
+ { "ideographicwoodparen", 0x322d , 0 },
+ { "ideographiczero", 0x3007 , 0 },
+ { "ideographmetalcircle", 0x328e , 0 },
+ { "ideographmooncircle", 0x328a , 0 },
+ { "ideographnamecircle", 0x3294 , 0 },
+ { "ideographsuncircle", 0x3290 , 0 },
+ { "ideographwatercircle", 0x328c , 0 },
+ { "ideographwoodcircle", 0x328d , 0 },
+ { "ideva", 0x0907 , 0 },
+ { "idieresisacute", 0x1e2f , 0 },
+ { "idieresiscyrillic", 0x04e5 , 0 },
+ { "idotbelow", 0x1ecb , 0 },
+ { "iebrevecyrillic", 0x04d7 , 0 },
+ { "iecyrillic", 0x0435 , 0 },
+ { "ieungacirclekorean", 0x3275 , 0 },
+ { "ieungaparenkorean", 0x3215 , 0 },
+ { "ieungcirclekorean", 0x3267 , 0 },
+ { "ieungkorean", 0x3147 , 0 },
+ { "ieungparenkorean", 0x3207 , 0 },
+ { "igujarati", 0x0a87 , 0 },
+ { "igurmukhi", 0x0a07 , 0 },
+ { "ihiragana", 0x3044 , 0 },
+ { "ihookabove", 0x1ec9 , 0 },
+ { "iibengali", 0x0988 , 0 },
+ { "iicyrillic", 0x0438 , 0 },
+ { "iideva", 0x0908 , 0 },
+ { "iigujarati", 0x0a88 , 0 },
+ { "iigurmukhi", 0x0a08 , 0 },
+ { "iimatragurmukhi", 0x0a40 , 0 },
+ { "iinvertedbreve", 0x020b , 0 },
+ { "iishortcyrillic", 0x0439 , 0 },
+ { "iivowelsignbengali", 0x09c0 , 0 },
+ { "iivowelsigndeva", 0x0940 , 0 },
+ { "iivowelsigngujarati", 0x0ac0 , 0 },
+ { "ikatakana", 0x30a4 , 0 },
+ { "ikatakanahalfwidth", 0xff72 , 0 },
+ { "ikorean", 0x3163 , 0 },
+ { "ilde", 0x02dc , 0 },
+ { "iluyhebrew", 0x05ac , 0 },
+ { "imacroncyrillic", 0x04e3 , 0 },
+ { "imageorapproximatelyequal", 0x2253 , 0 },
+ { "imatragurmukhi", 0x0a3f , 0 },
+ { "imonospace", 0xff49 , 0 },
+ { "increment", 0x2206 , 0 },
+ { "iniarmenian", 0x056b , 0 },
+ { "integralbottom", 0x2321 , 0 },
+ { "integralex", 0xf8f5 , 0 },
+ { "integraltop", 0x2320 , 0 },
+ { "intisquare", 0x3305 , 0 },
+ { "iocyrillic", 0x0451 , 0 },
+ { "iotalatin", 0x0269 , 0 },
+ { "iparen", 0x24a4 , 0 },
+ { "irigurmukhi", 0x0a72 , 0 },
+ { "ismallhiragana", 0x3043 , 0 },
+ { "ismallkatakana", 0x30a3 , 0 },
+ { "ismallkatakanahalfwidth", 0xff68 , 0 },
+ { "issharbengali", 0x09fa , 0 },
+ { "istroke", 0x0268 , 0 },
+ { "isuperior", 0xf6ed , 0 },
+ { "iterationhiragana", 0x309d , 0 },
+ { "iterationkatakana", 0x30fd , 0 },
+ { "itildebelow", 0x1e2d , 0 },
+ { "iubopomofo", 0x3129 , 0 },
+ { "iucyrillic", 0x044e , 0 },
+ { "ivowelsignbengali", 0x09bf , 0 },
+ { "ivowelsigndeva", 0x093f , 0 },
+ { "ivowelsigngujarati", 0x0abf , 0 },
+ { "izhitsacyrillic", 0x0475 , 0 },
+ { "izhitsadblgravecyrillic", 0x0477 , 0 },
+ { "jaarmenian", 0x0571 , 0 },
+ { "jabengali", 0x099c , 0 },
+ { "jadeva", 0x091c , 0 },
+ { "jagujarati", 0x0a9c , 0 },
+ { "jagurmukhi", 0x0a1c , 0 },
+ { "jbopomofo", 0x3110 , 0 },
+ { "jcaron", 0x01f0 , 0 },
+ { "jcircle", 0x24d9 , 0 },
+ { "jcrossedtail", 0x029d , 0 },
+ { "jdotlessstroke", 0x025f , 0 },
+ { "jecyrillic", 0x0458 , 0 },
+ { "jeemarabic", 0x062c , 0 },
+ { "jeemfinalarabic", 0xfe9e , 0 },
+ { "jeeminitialarabic", 0xfe9f , 0 },
+ { "jeemmedialarabic", 0xfea0 , 0 },
+ { "jeharabic", 0x0698 , 0 },
+ { "jehfinalarabic", 0xfb8b , 0 },
+ { "jhabengali", 0x099d , 0 },
+ { "jhadeva", 0x091d , 0 },
+ { "jhagujarati", 0x0a9d , 0 },
+ { "jhagurmukhi", 0x0a1d , 0 },
+ { "jheharmenian", 0x057b , 0 },
+ { "jis", 0x3004 , 0 },
+ { "jmonospace", 0xff4a , 0 },
+ { "jparen", 0x24a5 , 0 },
+ { "jsuperior", 0x02b2 , 0 },
+ { "kabashkircyrillic", 0x04a1 , 0 },
+ { "kabengali", 0x0995 , 0 },
+ { "kacute", 0x1e31 , 0 },
+ { "kacyrillic", 0x043a , 0 },
+ { "kadescendercyrillic", 0x049b , 0 },
+ { "kadeva", 0x0915 , 0 },
+ { "kaf", 0x05db , 0 },
+ { "kafarabic", 0x0643 , 0 },
+ { "kafdagesh", 0xfb3b , 0 },
+ { "kafdageshhebrew", 0xfb3b , 0 },
+ { "kaffinalarabic", 0xfeda , 0 },
+ { "kafhebrew", 0x05db , 0 },
+ { "kafinitialarabic", 0xfedb , 0 },
+ { "kafmedialarabic", 0xfedc , 0 },
+ { "kafrafehebrew", 0xfb4d , 0 },
+ { "kagujarati", 0x0a95 , 0 },
+ { "kagurmukhi", 0x0a15 , 0 },
+ { "kahiragana", 0x304b , 0 },
+ { "kahookcyrillic", 0x04c4 , 0 },
+ { "kakatakana", 0x30ab , 0 },
+ { "kakatakanahalfwidth", 0xff76 , 0 },
+ { "kappasymbolgreek", 0x03f0 , 0 },
+ { "kapyeounmieumkorean", 0x3171 , 0 },
+ { "kapyeounphieuphkorean", 0x3184 , 0 },
+ { "kapyeounpieupkorean", 0x3178 , 0 },
+ { "kapyeounssangpieupkorean", 0x3179 , 0 },
+ { "karoriisquare", 0x330d , 0 },
+ { "kashidaautoarabic", 0x0640 , 0 },
+ { "kashidaautonosidebearingarabic", 0x0640 , 0 },
+ { "kasmallkatakana", 0x30f5 , 0 },
+ { "kasquare", 0x3384 , 0 },
+ { "kasraarabic", 0x0650 , 0 },
+ { "kasratanarabic", 0x064d , 0 },
+ { "kastrokecyrillic", 0x049f , 0 },
+ { "katahiraprolongmarkhalfwidth", 0xff70 , 0 },
+ { "kaverticalstrokecyrillic", 0x049d , 0 },
+ { "kbopomofo", 0x310e , 0 },
+ { "kcalsquare", 0x3389 , 0 },
+ { "kcaron", 0x01e9 , 0 },
+ { "kcedilla", 0x0137 , 0 },
+ { "kcircle", 0x24da , 0 },
+ { "kdotbelow", 0x1e33 , 0 },
+ { "keharmenian", 0x0584 , 0 },
+ { "kehiragana", 0x3051 , 0 },
+ { "kekatakana", 0x30b1 , 0 },
+ { "kekatakanahalfwidth", 0xff79 , 0 },
+ { "kenarmenian", 0x056f , 0 },
+ { "kesmallkatakana", 0x30f6 , 0 },
+ { "khabengali", 0x0996 , 0 },
+ { "khacyrillic", 0x0445 , 0 },
+ { "khadeva", 0x0916 , 0 },
+ { "khagujarati", 0x0a96 , 0 },
+ { "khagurmukhi", 0x0a16 , 0 },
+ { "khaharabic", 0x062e , 0 },
+ { "khahfinalarabic", 0xfea6 , 0 },
+ { "khahinitialarabic", 0xfea7 , 0 },
+ { "khahmedialarabic", 0xfea8 , 0 },
+ { "kheicoptic", 0x03e7 , 0 },
+ { "khhadeva", 0x0959 , 0 },
+ { "khhagurmukhi", 0x0a59 , 0 },
+ { "khieukhacirclekorean", 0x3278 , 0 },
+ { "khieukhaparenkorean", 0x3218 , 0 },
+ { "khieukhcirclekorean", 0x326a , 0 },
+ { "khieukhkorean", 0x314b , 0 },
+ { "khieukhparenkorean", 0x320a , 0 },
+ { "khokhaithai", 0x0e02 , 0 },
+ { "khokhonthai", 0x0e05 , 0 },
+ { "khokhuatthai", 0x0e03 , 0 },
+ { "khokhwaithai", 0x0e04 , 0 },
+ { "khomutthai", 0x0e5b , 0 },
+ { "khook", 0x0199 , 0 },
+ { "khorakhangthai", 0x0e06 , 0 },
+ { "khzsquare", 0x3391 , 0 },
+ { "kihiragana", 0x304d , 0 },
+ { "kikatakana", 0x30ad , 0 },
+ { "kikatakanahalfwidth", 0xff77 , 0 },
+ { "kiroguramusquare", 0x3315 , 0 },
+ { "kiromeetorusquare", 0x3316 , 0 },
+ { "kirosquare", 0x3314 , 0 },
+ { "kiyeokacirclekorean", 0x326e , 0 },
+ { "kiyeokaparenkorean", 0x320e , 0 },
+ { "kiyeokcirclekorean", 0x3260 , 0 },
+ { "kiyeokkorean", 0x3131 , 0 },
+ { "kiyeokparenkorean", 0x3200 , 0 },
+ { "kiyeoksioskorean", 0x3133 , 0 },
+ { "kjecyrillic", 0x045c , 0 },
+ { "klinebelow", 0x1e35 , 0 },
+ { "klsquare", 0x3398 , 0 },
+ { "kmcubedsquare", 0x33a6 , 0 },
+ { "kmonospace", 0xff4b , 0 },
+ { "kmsquaredsquare", 0x33a2 , 0 },
+ { "kohiragana", 0x3053 , 0 },
+ { "kohmsquare", 0x33c0 , 0 },
+ { "kokaithai", 0x0e01 , 0 },
+ { "kokatakana", 0x30b3 , 0 },
+ { "kokatakanahalfwidth", 0xff7a , 0 },
+ { "kooposquare", 0x331e , 0 },
+ { "koppacyrillic", 0x0481 , 0 },
+ { "koreanstandardsymbol", 0x327f , 0 },
+ { "koroniscmb", 0x0343 , 0 },
+ { "kparen", 0x24a6 , 0 },
+ { "kpasquare", 0x33aa , 0 },
+ { "ksicyrillic", 0x046f , 0 },
+ { "ktsquare", 0x33cf , 0 },
+ { "kturned", 0x029e , 0 },
+ { "kuhiragana", 0x304f , 0 },
+ { "kukatakana", 0x30af , 0 },
+ { "kukatakanahalfwidth", 0xff78 , 0 },
+ { "kvsquare", 0x33b8 , 0 },
+ { "kwsquare", 0x33be , 0 },
+ { "labengali", 0x09b2 , 0 },
+ { "ladeva", 0x0932 , 0 },
+ { "lagujarati", 0x0ab2 , 0 },
+ { "lagurmukhi", 0x0a32 , 0 },
+ { "lakkhangyaothai", 0x0e45 , 0 },
+ { "lamaleffinalarabic", 0xfefc , 0 },
+ { "lamalefhamzaabovefinalarabic", 0xfef8 , 0 },
+ { "lamalefhamzaaboveisolatedarabic", 0xfef7 , 0 },
+ { "lamalefhamzabelowfinalarabic", 0xfefa , 0 },
+ { "lamalefhamzabelowisolatedarabic", 0xfef9 , 0 },
+ { "lamalefisolatedarabic", 0xfefb , 0 },
+ { "lamalefmaddaabovefinalarabic", 0xfef6 , 0 },
+ { "lamalefmaddaaboveisolatedarabic", 0xfef5 , 0 },
+ { "lamarabic", 0x0644 , 0 },
+ { "lambdastroke", 0x019b , 0 },
+ { "lamed", 0x05dc , 0 },
+ { "lameddagesh", 0xfb3c , 0 },
+ { "lameddageshhebrew", 0xfb3c , 0 },
+ { "lamedhebrew", 0x05dc , 0 },
+ { "lamedholam", 0x05dc , 0 },
+ { "lamedholamdagesh", 0x05dc , 0 },
+ { "lamedholamdageshhebrew", 0x05dc , 0 },
+ { "lamedholamhebrew", 0x05dc , 0 },
+ { "lamfinalarabic", 0xfede , 0 },
+ { "lamhahinitialarabic", 0xfcca , 0 },
+ { "laminitialarabic", 0xfedf , 0 },
+ { "lamjeeminitialarabic", 0xfcc9 , 0 },
+ { "lamkhahinitialarabic", 0xfccb , 0 },
+ { "lamlamhehisolatedarabic", 0xfdf2 , 0 },
+ { "lammedialarabic", 0xfee0 , 0 },
+ { "lammeemhahinitialarabic", 0xfd88 , 0 },
+ { "lammeeminitialarabic", 0xfccc , 0 },
+ { "lammeemjeeminitialarabic", 0xfedf , 0 },
+ { "lammeemkhahinitialarabic", 0xfedf , 0 },
+ { "largecircle", 0x25ef , 0 },
+ { "lbar", 0x019a , 0 },
+ { "lbelt", 0x026c , 0 },
+ { "lbopomofo", 0x310c , 0 },
+ { "lcedilla", 0x013c , 0 },
+ { "lcircle", 0x24db , 0 },
+ { "lcircumflexbelow", 0x1e3d , 0 },
+ { "ldotaccent", 0x0140 , 0 },
+ { "ldotbelow", 0x1e37 , 0 },
+ { "ldotbelowmacron", 0x1e39 , 0 },
+ { "leftangleabovecmb", 0x031a , 0 },
+ { "lefttackbelowcmb", 0x0318 , 0 },
+ { "lessequalorgreater", 0x22da , 0 },
+ { "lessmonospace", 0xff1c , 0 },
+ { "lessorequivalent", 0x2272 , 0 },
+ { "lessorgreater", 0x2276 , 0 },
+ { "lessoverequal", 0x2266 , 0 },
+ { "lesssmall", 0xfe64 , 0 },
+ { "lezh", 0x026e , 0 },
+ { "lhookretroflex", 0x026d , 0 },
+ { "liwnarmenian", 0x056c , 0 },
+ { "lj", 0x01c9 , 0 },
+ { "ljecyrillic", 0x0459 , 0 },
+ { "ll", 0xf6c0 , 0 },
+ { "lladeva", 0x0933 , 0 },
+ { "llagujarati", 0x0ab3 , 0 },
+ { "llinebelow", 0x1e3b , 0 },
+ { "llladeva", 0x0934 , 0 },
+ { "llvocalicbengali", 0x09e1 , 0 },
+ { "llvocalicdeva", 0x0961 , 0 },
+ { "llvocalicvowelsignbengali", 0x09e3 , 0 },
+ { "llvocalicvowelsigndeva", 0x0963 , 0 },
+ { "lmiddletilde", 0x026b , 0 },
+ { "lmonospace", 0xff4c , 0 },
+ { "lmsquare", 0x33d0 , 0 },
+ { "lochulathai", 0x0e2c , 0 },
+ { "logicalnotreversed", 0x2310 , 0 },
+ { "lolingthai", 0x0e25 , 0 },
+ { "lowlinecenterline", 0xfe4e , 0 },
+ { "lowlinecmb", 0x0332 , 0 },
+ { "lowlinedashed", 0xfe4d , 0 },
+ { "lparen", 0x24a7 , 0 },
+ { "lsquare", 0x2113 , 0 },
+ { "lsuperior", 0xf6ee , 0 },
+ { "luthai", 0x0e26 , 0 },
+ { "lvocalicbengali", 0x098c , 0 },
+ { "lvocalicdeva", 0x090c , 0 },
+ { "lvocalicvowelsignbengali", 0x09e2 , 0 },
+ { "lvocalicvowelsigndeva", 0x0962 , 0 },
+ { "lxsquare", 0x33d3 , 0 },
+ { "mabengali", 0x09ae , 0 },
+ { "macronbelowcmb", 0x0331 , 0 },
+ { "macroncmb", 0x0304 , 0 },
+ { "macronlowmod", 0x02cd , 0 },
+ { "macronmonospace", 0xffe3 , 0 },
+ { "macute", 0x1e3f , 0 },
+ { "madeva", 0x092e , 0 },
+ { "magujarati", 0x0aae , 0 },
+ { "magurmukhi", 0x0a2e , 0 },
+ { "mahapakhhebrew", 0x05a4 , 0 },
+ { "mahapakhlefthebrew", 0x05a4 , 0 },
+ { "mahiragana", 0x307e , 0 },
+ { "maichattawalowleftthai", 0xf895 , 0 },
+ { "maichattawalowrightthai", 0xf894 , 0 },
+ { "maichattawathai", 0x0e4b , 0 },
+ { "maichattawaupperleftthai", 0xf893 , 0 },
+ { "maieklowleftthai", 0xf88c , 0 },
+ { "maieklowrightthai", 0xf88b , 0 },
+ { "maiekthai", 0x0e48 , 0 },
+ { "maiekupperleftthai", 0xf88a , 0 },
+ { "maihanakatleftthai", 0xf884 , 0 },
+ { "maihanakatthai", 0x0e31 , 0 },
+ { "maitaikhuleftthai", 0xf889 , 0 },
+ { "maitaikhuthai", 0x0e47 , 0 },
+ { "maitholowleftthai", 0xf88f , 0 },
+ { "maitholowrightthai", 0xf88e , 0 },
+ { "maithothai", 0x0e49 , 0 },
+ { "maithoupperleftthai", 0xf88d , 0 },
+ { "maitrilowleftthai", 0xf892 , 0 },
+ { "maitrilowrightthai", 0xf891 , 0 },
+ { "maitrithai", 0x0e4a , 0 },
+ { "maitriupperleftthai", 0xf890 , 0 },
+ { "maiyamokthai", 0x0e46 , 0 },
+ { "makatakana", 0x30de , 0 },
+ { "makatakanahalfwidth", 0xff8f , 0 },
+ { "mansyonsquare", 0x3347 , 0 },
+ { "maqafhebrew", 0x05be , 0 },
+ { "mars", 0x2642 , 0 },
+ { "masoracirclehebrew", 0x05af , 0 },
+ { "masquare", 0x3383 , 0 },
+ { "mbopomofo", 0x3107 , 0 },
+ { "mbsquare", 0x33d4 , 0 },
+ { "mcircle", 0x24dc , 0 },
+ { "mcubedsquare", 0x33a5 , 0 },
+ { "mdotaccent", 0x1e41 , 0 },
+ { "mdotbelow", 0x1e43 , 0 },
+ { "meemarabic", 0x0645 , 0 },
+ { "meemfinalarabic", 0xfee2 , 0 },
+ { "meeminitialarabic", 0xfee3 , 0 },
+ { "meemmedialarabic", 0xfee4 , 0 },
+ { "meemmeeminitialarabic", 0xfcd1 , 0 },
+ { "meemmeemisolatedarabic", 0xfc48 , 0 },
+ { "meetorusquare", 0x334d , 0 },
+ { "mehiragana", 0x3081 , 0 },
+ { "meizierasquare", 0x337e , 0 },
+ { "mekatakana", 0x30e1 , 0 },
+ { "mekatakanahalfwidth", 0xff92 , 0 },
+ { "mem", 0x05de , 0 },
+ { "memdagesh", 0xfb3e , 0 },
+ { "memdageshhebrew", 0xfb3e , 0 },
+ { "memhebrew", 0x05de , 0 },
+ { "menarmenian", 0x0574 , 0 },
+ { "merkhahebrew", 0x05a5 , 0 },
+ { "merkhakefulahebrew", 0x05a6 , 0 },
+ { "merkhakefulalefthebrew", 0x05a6 , 0 },
+ { "merkhalefthebrew", 0x05a5 , 0 },
+ { "mhook", 0x0271 , 0 },
+ { "mhzsquare", 0x3392 , 0 },
+ { "middledotkatakanahalfwidth", 0xff65 , 0 },
+ { "middot", 0x00b7 , 0 },
+ { "mieumacirclekorean", 0x3272 , 0 },
+ { "mieumaparenkorean", 0x3212 , 0 },
+ { "mieumcirclekorean", 0x3264 , 0 },
+ { "mieumkorean", 0x3141 , 0 },
+ { "mieumpansioskorean", 0x3170 , 0 },
+ { "mieumparenkorean", 0x3204 , 0 },
+ { "mieumpieupkorean", 0x316e , 0 },
+ { "mieumsioskorean", 0x316f , 0 },
+ { "mihiragana", 0x307f , 0 },
+ { "mikatakana", 0x30df , 0 },
+ { "mikatakanahalfwidth", 0xff90 , 0 },
+ { "minusbelowcmb", 0x0320 , 0 },
+ { "minuscircle", 0x2296 , 0 },
+ { "minusmod", 0x02d7 , 0 },
+ { "minusplus", 0x2213 , 0 },
+ { "miribaarusquare", 0x334a , 0 },
+ { "mirisquare", 0x3349 , 0 },
+ { "mlonglegturned", 0x0270 , 0 },
+ { "mlsquare", 0x3396 , 0 },
+ { "mmcubedsquare", 0x33a3 , 0 },
+ { "mmonospace", 0xff4d , 0 },
+ { "mmsquaredsquare", 0x339f , 0 },
+ { "mohiragana", 0x3082 , 0 },
+ { "mohmsquare", 0x33c1 , 0 },
+ { "mokatakana", 0x30e2 , 0 },
+ { "mokatakanahalfwidth", 0xff93 , 0 },
+ { "molsquare", 0x33d6 , 0 },
+ { "momathai", 0x0e21 , 0 },
+ { "moverssquare", 0x33a7 , 0 },
+ { "moverssquaredsquare", 0x33a8 , 0 },
+ { "mparen", 0x24a8 , 0 },
+ { "mpasquare", 0x33ab , 0 },
+ { "mssquare", 0x33b3 , 0 },
+ { "msuperior", 0xf6ef , 0 },
+ { "mturned", 0x026f , 0 },
+ { "mu1", 0x00b5 , 0 },
+ { "muasquare", 0x3382 , 0 },
+ { "muchgreater", 0x226b , 0 },
+ { "muchless", 0x226a , 0 },
+ { "mufsquare", 0x338c , 0 },
+ { "mugreek", 0x03bc , 0 },
+ { "mugsquare", 0x338d , 0 },
+ { "muhiragana", 0x3080 , 0 },
+ { "mukatakana", 0x30e0 , 0 },
+ { "mukatakanahalfwidth", 0xff91 , 0 },
+ { "mulsquare", 0x3395 , 0 },
+ { "mumsquare", 0x339b , 0 },
+ { "munahhebrew", 0x05a3 , 0 },
+ { "munahlefthebrew", 0x05a3 , 0 },
+ { "musicflatsign", 0x266d , 0 },
+ { "musicsharpsign", 0x266f , 0 },
+ { "mussquare", 0x33b2 , 0 },
+ { "muvsquare", 0x33b6 , 0 },
+ { "muwsquare", 0x33bc , 0 },
+ { "mvmegasquare", 0x33b9 , 0 },
+ { "mvsquare", 0x33b7 , 0 },
+ { "mwmegasquare", 0x33bf , 0 },
+ { "mwsquare", 0x33bd , 0 },
+ { "nabengali", 0x09a8 , 0 },
+ { "nabla", 0x2207 , 0 },
+ { "nadeva", 0x0928 , 0 },
+ { "nagujarati", 0x0aa8 , 0 },
+ { "nagurmukhi", 0x0a28 , 0 },
+ { "nahiragana", 0x306a , 0 },
+ { "nakatakana", 0x30ca , 0 },
+ { "nakatakanahalfwidth", 0xff85 , 0 },
+ { "nasquare", 0x3381 , 0 },
+ { "nbopomofo", 0x310b , 0 },
+ { "nbspace", 0x00a0 , 0 },
+ { "ncedilla", 0x0146 , 0 },
+ { "ncircle", 0x24dd , 0 },
+ { "ncircumflexbelow", 0x1e4b , 0 },
+ { "ndotaccent", 0x1e45 , 0 },
+ { "ndotbelow", 0x1e47 , 0 },
+ { "nehiragana", 0x306d , 0 },
+ { "nekatakana", 0x30cd , 0 },
+ { "nekatakanahalfwidth", 0xff88 , 0 },
+ { "newsheqelsign", 0x20aa , 0 },
+ { "nfsquare", 0x338b , 0 },
+ { "ngabengali", 0x0999 , 0 },
+ { "ngadeva", 0x0919 , 0 },
+ { "ngagujarati", 0x0a99 , 0 },
+ { "ngagurmukhi", 0x0a19 , 0 },
+ { "ngonguthai", 0x0e07 , 0 },
+ { "nhiragana", 0x3093 , 0 },
+ { "nhookleft", 0x0272 , 0 },
+ { "nhookretroflex", 0x0273 , 0 },
+ { "nieunacirclekorean", 0x326f , 0 },
+ { "nieunaparenkorean", 0x320f , 0 },
+ { "nieuncieuckorean", 0x3135 , 0 },
+ { "nieuncirclekorean", 0x3261 , 0 },
+ { "nieunhieuhkorean", 0x3136 , 0 },
+ { "nieunkorean", 0x3134 , 0 },
+ { "nieunpansioskorean", 0x3168 , 0 },
+ { "nieunparenkorean", 0x3201 , 0 },
+ { "nieunsioskorean", 0x3167 , 0 },
+ { "nieuntikeutkorean", 0x3166 , 0 },
+ { "nihiragana", 0x306b , 0 },
+ { "nikatakana", 0x30cb , 0 },
+ { "nikatakanahalfwidth", 0xff86 , 0 },
+ { "nikhahitleftthai", 0xf899 , 0 },
+ { "nikhahitthai", 0x0e4d , 0 },
+ { "ninearabic", 0x0669 , 0 },
+ { "ninebengali", 0x09ef , 0 },
+ { "ninecircle", 0x2468 , 0 },
+ { "ninecircleinversesansserif", 0x2792 , 0 },
+ { "ninedeva", 0x096f , 0 },
+ { "ninegujarati", 0x0aef , 0 },
+ { "ninegurmukhi", 0x0a6f , 0 },
+ { "ninehackarabic", 0x0669 , 0 },
+ { "ninehangzhou", 0x3029 , 0 },
+ { "nineideographicparen", 0x3228 , 0 },
+ { "nineinferior", 0x2089 , 0 },
+ { "ninemonospace", 0xff19 , 0 },
+ { "nineoldstyle", 0xf739 , 0 },
+ { "nineparen", 0x247c , 0 },
+ { "nineperiod", 0x2490 , 0 },
+ { "ninepersian", 0x06f9 , 0 },
+ { "nineroman", 0x2178 , 0 },
+ { "ninesuperior", 0x2079 , 0 },
+ { "nineteencircle", 0x2472 , 0 },
+ { "nineteenparen", 0x2486 , 0 },
+ { "nineteenperiod", 0x249a , 0 },
+ { "ninethai", 0x0e59 , 0 },
+ { "nj", 0x01cc , 0 },
+ { "njecyrillic", 0x045a , 0 },
+ { "nkatakana", 0x30f3 , 0 },
+ { "nkatakanahalfwidth", 0xff9d , 0 },
+ { "nlegrightlong", 0x019e , 0 },
+ { "nlinebelow", 0x1e49 , 0 },
+ { "nmonospace", 0xff4e , 0 },
+ { "nmsquare", 0x339a , 0 },
+ { "nnabengali", 0x09a3 , 0 },
+ { "nnadeva", 0x0923 , 0 },
+ { "nnagujarati", 0x0aa3 , 0 },
+ { "nnagurmukhi", 0x0a23 , 0 },
+ { "nnnadeva", 0x0929 , 0 },
+ { "nohiragana", 0x306e , 0 },
+ { "nokatakana", 0x30ce , 0 },
+ { "nokatakanahalfwidth", 0xff89 , 0 },
+ { "nonbreakingspace", 0x00a0 , 0 },
+ { "nonenthai", 0x0e13 , 0 },
+ { "nonuthai", 0x0e19 , 0 },
+ { "noonarabic", 0x0646 , 0 },
+ { "noonfinalarabic", 0xfee6 , 0 },
+ { "noonghunnaarabic", 0x06ba , 0 },
+ { "noonghunnafinalarabic", 0xfb9f , 0 },
+ { "noonhehinitialarabic", 0xfee7 , 0 },
+ { "nooninitialarabic", 0xfee7 , 0 },
+ { "noonjeeminitialarabic", 0xfcd2 , 0 },
+ { "noonjeemisolatedarabic", 0xfc4b , 0 },
+ { "noonmedialarabic", 0xfee8 , 0 },
+ { "noonmeeminitialarabic", 0xfcd5 , 0 },
+ { "noonmeemisolatedarabic", 0xfc4e , 0 },
+ { "noonnoonfinalarabic", 0xfc8d , 0 },
+ { "notcontains", 0x220c , 0 },
+ { "notelementof", 0x2209 , 0 },
+ { "notgreater", 0x226f , 0 },
+ { "notgreaternorequal", 0x2271 , 0 },
+ { "notgreaternorless", 0x2279 , 0 },
+ { "notidentical", 0x2262 , 0 },
+ { "notless", 0x226e , 0 },
+ { "notlessnorequal", 0x2270 , 0 },
+ { "notparallel", 0x2226 , 0 },
+ { "notprecedes", 0x2280 , 0 },
+ { "notsucceeds", 0x2281 , 0 },
+ { "notsuperset", 0x2285 , 0 },
+ { "nowarmenian", 0x0576 , 0 },
+ { "nparen", 0x24a9 , 0 },
+ { "nssquare", 0x33b1 , 0 },
+ { "nsuperior", 0x207f , 0 },
+ { "nuhiragana", 0x306c , 0 },
+ { "nukatakana", 0x30cc , 0 },
+ { "nukatakanahalfwidth", 0xff87 , 0 },
+ { "nuktabengali", 0x09bc , 0 },
+ { "nuktadeva", 0x093c , 0 },
+ { "nuktagujarati", 0x0abc , 0 },
+ { "nuktagurmukhi", 0x0a3c , 0 },
+ { "numbersignmonospace", 0xff03 , 0 },
+ { "numbersignsmall", 0xfe5f , 0 },
+ { "numeralsigngreek", 0x0374 , 0 },
+ { "numeralsignlowergreek", 0x0375 , 0 },
+ { "numero", 0x2116 , 0 },
+ { "nun", 0x05e0 , 0 },
+ { "nundagesh", 0xfb40 , 0 },
+ { "nundageshhebrew", 0xfb40 , 0 },
+ { "nunhebrew", 0x05e0 , 0 },
+ { "nvsquare", 0x33b5 , 0 },
+ { "nwsquare", 0x33bb , 0 },
+ { "nyabengali", 0x099e , 0 },
+ { "nyadeva", 0x091e , 0 },
+ { "nyagujarati", 0x0a9e , 0 },
+ { "nyagurmukhi", 0x0a1e , 0 },
+ { "oangthai", 0x0e2d , 0 },
+ { "obarred", 0x0275 , 0 },
+ { "obarredcyrillic", 0x04e9 , 0 },
+ { "obarreddieresiscyrillic", 0x04eb , 0 },
+ { "obengali", 0x0993 , 0 },
+ { "obopomofo", 0x311b , 0 },
+ { "ocandradeva", 0x0911 , 0 },
+ { "ocandragujarati", 0x0a91 , 0 },
+ { "ocandravowelsigndeva", 0x0949 , 0 },
+ { "ocandravowelsigngujarati", 0x0ac9 , 0 },
+ { "ocaron", 0x01d2 , 0 },
+ { "ocircle", 0x24de , 0 },
+ { "ocircumflexacute", 0x1ed1 , 0 },
+ { "ocircumflexdotbelow", 0x1ed9 , 0 },
+ { "ocircumflexgrave", 0x1ed3 , 0 },
+ { "ocircumflexhookabove", 0x1ed5 , 0 },
+ { "ocircumflextilde", 0x1ed7 , 0 },
+ { "ocyrillic", 0x043e , 0 },
+ { "odblacute", 0x0151 , 0 },
+ { "odblgrave", 0x020d , 0 },
+ { "odeva", 0x0913 , 0 },
+ { "odieresiscyrillic", 0x04e7 , 0 },
+ { "odotbelow", 0x1ecd , 0 },
+ { "oekorean", 0x315a , 0 },
+ { "ogonekcmb", 0x0328 , 0 },
+ { "ogujarati", 0x0a93 , 0 },
+ { "oharmenian", 0x0585 , 0 },
+ { "ohiragana", 0x304a , 0 },
+ { "ohookabove", 0x1ecf , 0 },
+ { "ohornacute", 0x1edb , 0 },
+ { "ohorndotbelow", 0x1ee3 , 0 },
+ { "ohorngrave", 0x1edd , 0 },
+ { "ohornhookabove", 0x1edf , 0 },
+ { "ohorntilde", 0x1ee1 , 0 },
+ { "oi", 0x01a3 , 0 },
+ { "oinvertedbreve", 0x020f , 0 },
+ { "okatakana", 0x30aa , 0 },
+ { "okatakanahalfwidth", 0xff75 , 0 },
+ { "okorean", 0x3157 , 0 },
+ { "olehebrew", 0x05ab , 0 },
+ { "omacronacute", 0x1e53 , 0 },
+ { "omacrongrave", 0x1e51 , 0 },
+ { "omdeva", 0x0950 , 0 },
+ { "omegacyrillic", 0x0461 , 0 },
+ { "omegalatinclosed", 0x0277 , 0 },
+ { "omegaroundcyrillic", 0x047b , 0 },
+ { "omegatitlocyrillic", 0x047d , 0 },
+ { "omgujarati", 0x0ad0 , 0 },
+ { "omonospace", 0xff4f , 0 },
+ { "onearabic", 0x0661 , 0 },
+ { "onebengali", 0x09e7 , 0 },
+ { "onecircle", 0x2460 , 0 },
+ { "onecircleinversesansserif", 0x278a , 0 },
+ { "onedeva", 0x0967 , 0 },
+ { "onefitted", 0xf6dc , 0 },
+ { "onegujarati", 0x0ae7 , 0 },
+ { "onegurmukhi", 0x0a67 , 0 },
+ { "onehackarabic", 0x0661 , 0 },
+ { "onehangzhou", 0x3021 , 0 },
+ { "oneideographicparen", 0x3220 , 0 },
+ { "oneinferior", 0x2081 , 0 },
+ { "onemonospace", 0xff11 , 0 },
+ { "onenumeratorbengali", 0x09f4 , 0 },
+ { "oneoldstyle", 0xf731 , 0 },
+ { "oneparen", 0x2474 , 0 },
+ { "oneperiod", 0x2488 , 0 },
+ { "onepersian", 0x06f1 , 0 },
+ { "oneroman", 0x2170 , 0 },
+ { "onesuperior", 0x00b9 , 0 },
+ { "onethai", 0x0e51 , 0 },
+ { "oogonek", 0x01eb , 0 },
+ { "oogonekmacron", 0x01ed , 0 },
+ { "oogurmukhi", 0x0a13 , 0 },
+ { "oomatragurmukhi", 0x0a4b , 0 },
+ { "oopen", 0x0254 , 0 },
+ { "oparen", 0x24aa , 0 },
+ { "option", 0x2325 , 0 },
+ { "oshortdeva", 0x0912 , 0 },
+ { "oshortvowelsigndeva", 0x094a , 0 },
+ { "osmallhiragana", 0x3049 , 0 },
+ { "osmallkatakana", 0x30a9 , 0 },
+ { "osmallkatakanahalfwidth", 0xff6b , 0 },
+ { "ostrokeacute", 0x01ff , 0 },
+ { "osuperior", 0xf6f0 , 0 },
+ { "otcyrillic", 0x047f , 0 },
+ { "otildeacute", 0x1e4d , 0 },
+ { "otildedieresis", 0x1e4f , 0 },
+ { "oubopomofo", 0x3121 , 0 },
+ { "overline", 0x203e , 0 },
+ { "overlinecenterline", 0xfe4a , 0 },
+ { "overlinecmb", 0x0305 , 0 },
+ { "overlinedashed", 0xfe49 , 0 },
+ { "overlinedblwavy", 0xfe4c , 0 },
+ { "overlinewavy", 0xfe4b , 0 },
+ { "overscore", 0x00af , 0 },
+ { "ovowelsignbengali", 0x09cb , 0 },
+ { "ovowelsigndeva", 0x094b , 0 },
+ { "ovowelsigngujarati", 0x0acb , 0 },
+ { "paampssquare", 0x3380 , 0 },
+ { "paasentosquare", 0x332b , 0 },
+ { "pabengali", 0x09aa , 0 },
+ { "pacute", 0x1e55 , 0 },
+ { "padeva", 0x092a , 0 },
+ { "pagedown", 0x21df , 0 },
+ { "pageup", 0x21de , 0 },
+ { "pagujarati", 0x0aaa , 0 },
+ { "pagurmukhi", 0x0a2a , 0 },
+ { "pahiragana", 0x3071 , 0 },
+ { "paiyannoithai", 0x0e2f , 0 },
+ { "pakatakana", 0x30d1 , 0 },
+ { "palatalizationcyrilliccmb", 0x0484 , 0 },
+ { "palochkacyrillic", 0x04c0 , 0 },
+ { "pansioskorean", 0x317f , 0 },
+ { "parallel", 0x2225 , 0 },
+ { "parenleftaltonearabic", 0xfd3e , 0 },
+ { "parenleftbt", 0xf8ed , 0 },
+ { "parenleftex", 0xf8ec , 0 },
+ { "parenleftinferior", 0x208d , 0 },
+ { "parenleftmonospace", 0xff08 , 0 },
+ { "parenleftsmall", 0xfe59 , 0 },
+ { "parenleftsuperior", 0x207d , 0 },
+ { "parenlefttp", 0xf8eb , 0 },
+ { "parenleftvertical", 0xfe35 , 0 },
+ { "parenrightaltonearabic", 0xfd3f , 0 },
+ { "parenrightbt", 0xf8f8 , 0 },
+ { "parenrightex", 0xf8f7 , 0 },
+ { "parenrightinferior", 0x208e , 0 },
+ { "parenrightmonospace", 0xff09 , 0 },
+ { "parenrightsmall", 0xfe5a , 0 },
+ { "parenrightsuperior", 0x207e , 0 },
+ { "parenrighttp", 0xf8f6 , 0 },
+ { "parenrightvertical", 0xfe36 , 0 },
+ { "paseqhebrew", 0x05c0 , 0 },
+ { "pashtahebrew", 0x0599 , 0 },
+ { "pasquare", 0x33a9 , 0 },
+ { "patah", 0x05b7 , 0 },
+ { "patah11", 0x05b7 , 0 },
+ { "patah1d", 0x05b7 , 0 },
+ { "patah2a", 0x05b7 , 0 },
+ { "patahhebrew", 0x05b7 , 0 },
+ { "patahnarrowhebrew", 0x05b7 , 0 },
+ { "patahquarterhebrew", 0x05b7 , 0 },
+ { "patahwidehebrew", 0x05b7 , 0 },
+ { "pazerhebrew", 0x05a1 , 0 },
+ { "pbopomofo", 0x3106 , 0 },
+ { "pcircle", 0x24df , 0 },
+ { "pdotaccent", 0x1e57 , 0 },
+ { "pe", 0x05e4 , 0 },
+ { "pecyrillic", 0x043f , 0 },
+ { "pedagesh", 0xfb44 , 0 },
+ { "pedageshhebrew", 0xfb44 , 0 },
+ { "peezisquare", 0x333b , 0 },
+ { "pefinaldageshhebrew", 0xfb43 , 0 },
+ { "peharabic", 0x067e , 0 },
+ { "peharmenian", 0x057a , 0 },
+ { "pehebrew", 0x05e4 , 0 },
+ { "pehfinalarabic", 0xfb57 , 0 },
+ { "pehinitialarabic", 0xfb58 , 0 },
+ { "pehiragana", 0x307a , 0 },
+ { "pehmedialarabic", 0xfb59 , 0 },
+ { "pekatakana", 0x30da , 0 },
+ { "pemiddlehookcyrillic", 0x04a7 , 0 },
+ { "perafehebrew", 0xfb4e , 0 },
+ { "percentarabic", 0x066a , 0 },
+ { "percentmonospace", 0xff05 , 0 },
+ { "percentsmall", 0xfe6a , 0 },
+ { "periodarmenian", 0x0589 , 0 },
+ { "periodhalfwidth", 0xff61 , 0 },
+ { "periodinferior", 0xf6e7 , 0 },
+ { "periodmonospace", 0xff0e , 0 },
+ { "periodsmall", 0xfe52 , 0 },
+ { "periodsuperior", 0xf6e8 , 0 },
+ { "perispomenigreekcmb", 0x0342 , 0 },
+ { "pfsquare", 0x338a , 0 },
+ { "phabengali", 0x09ab , 0 },
+ { "phadeva", 0x092b , 0 },
+ { "phagujarati", 0x0aab , 0 },
+ { "phagurmukhi", 0x0a2b , 0 },
+ { "phieuphacirclekorean", 0x327a , 0 },
+ { "phieuphaparenkorean", 0x321a , 0 },
+ { "phieuphcirclekorean", 0x326c , 0 },
+ { "phieuphkorean", 0x314d , 0 },
+ { "phieuphparenkorean", 0x320c , 0 },
+ { "philatin", 0x0278 , 0 },
+ { "phinthuthai", 0x0e3a , 0 },
+ { "phisymbolgreek", 0x03d5 , 0 },
+ { "phook", 0x01a5 , 0 },
+ { "phophanthai", 0x0e1e , 0 },
+ { "phophungthai", 0x0e1c , 0 },
+ { "phosamphaothai", 0x0e20 , 0 },
+ { "pieupacirclekorean", 0x3273 , 0 },
+ { "pieupaparenkorean", 0x3213 , 0 },
+ { "pieupcieuckorean", 0x3176 , 0 },
+ { "pieupcirclekorean", 0x3265 , 0 },
+ { "pieupkiyeokkorean", 0x3172 , 0 },
+ { "pieupkorean", 0x3142 , 0 },
+ { "pieupparenkorean", 0x3205 , 0 },
+ { "pieupsioskiyeokkorean", 0x3174 , 0 },
+ { "pieupsioskorean", 0x3144 , 0 },
+ { "pieupsiostikeutkorean", 0x3175 , 0 },
+ { "pieupthieuthkorean", 0x3177 , 0 },
+ { "pieuptikeutkorean", 0x3173 , 0 },
+ { "pihiragana", 0x3074 , 0 },
+ { "pikatakana", 0x30d4 , 0 },
+ { "pisymbolgreek", 0x03d6 , 0 },
+ { "piwrarmenian", 0x0583 , 0 },
+ { "plusbelowcmb", 0x031f , 0 },
+ { "pluscircle", 0x2295 , 0 },
+ { "plusmod", 0x02d6 , 0 },
+ { "plusmonospace", 0xff0b , 0 },
+ { "plussmall", 0xfe62 , 0 },
+ { "plussuperior", 0x207a , 0 },
+ { "pmonospace", 0xff50 , 0 },
+ { "pmsquare", 0x33d8 , 0 },
+ { "pohiragana", 0x307d , 0 },
+ { "pointingindexdownwhite", 0x261f , 0 },
+ { "pointingindexleftwhite", 0x261c , 0 },
+ { "pointingindexrightwhite", 0x261e , 0 },
+ { "pointingindexupwhite", 0x261d , 0 },
+ { "pokatakana", 0x30dd , 0 },
+ { "poplathai", 0x0e1b , 0 },
+ { "postalmark", 0x3012 , 0 },
+ { "postalmarkface", 0x3020 , 0 },
+ { "pparen", 0x24ab , 0 },
+ { "precedes", 0x227a , 0 },
+ { "primemod", 0x02b9 , 0 },
+ { "primereversed", 0x2035 , 0 },
+ { "projective", 0x2305 , 0 },
+ { "prolongedkana", 0x30fc , 0 },
+ { "propellor", 0x2318 , 0 },
+ { "proportion", 0x2237 , 0 },
+ { "psicyrillic", 0x0471 , 0 },
+ { "psilipneumatacyrilliccmb", 0x0486 , 0 },
+ { "pssquare", 0x33b0 , 0 },
+ { "puhiragana", 0x3077 , 0 },
+ { "pukatakana", 0x30d7 , 0 },
+ { "pvsquare", 0x33b4 , 0 },
+ { "pwsquare", 0x33ba , 0 },
+ { "qadeva", 0x0958 , 0 },
+ { "qadmahebrew", 0x05a8 , 0 },
+ { "qafarabic", 0x0642 , 0 },
+ { "qaffinalarabic", 0xfed6 , 0 },
+ { "qafinitialarabic", 0xfed7 , 0 },
+ { "qafmedialarabic", 0xfed8 , 0 },
+ { "qamats", 0x05b8 , 0 },
+ { "qamats10", 0x05b8 , 0 },
+ { "qamats1a", 0x05b8 , 0 },
+ { "qamats1c", 0x05b8 , 0 },
+ { "qamats27", 0x05b8 , 0 },
+ { "qamats29", 0x05b8 , 0 },
+ { "qamats33", 0x05b8 , 0 },
+ { "qamatsde", 0x05b8 , 0 },
+ { "qamatshebrew", 0x05b8 , 0 },
+ { "qamatsnarrowhebrew", 0x05b8 , 0 },
+ { "qamatsqatanhebrew", 0x05b8 , 0 },
+ { "qamatsqatannarrowhebrew", 0x05b8 , 0 },
+ { "qamatsqatanquarterhebrew", 0x05b8 , 0 },
+ { "qamatsqatanwidehebrew", 0x05b8 , 0 },
+ { "qamatsquarterhebrew", 0x05b8 , 0 },
+ { "qamatswidehebrew", 0x05b8 , 0 },
+ { "qarneyparahebrew", 0x059f , 0 },
+ { "qbopomofo", 0x3111 , 0 },
+ { "qcircle", 0x24e0 , 0 },
+ { "qhook", 0x02a0 , 0 },
+ { "qmonospace", 0xff51 , 0 },
+ { "qof", 0x05e7 , 0 },
+ { "qofdagesh", 0xfb47 , 0 },
+ { "qofdageshhebrew", 0xfb47 , 0 },
+ { "qofhatafpatah", 0x05e7 , 0 },
+ { "qofhatafpatahhebrew", 0x05e7 , 0 },
+ { "qofhatafsegol", 0x05e7 , 0 },
+ { "qofhatafsegolhebrew", 0x05e7 , 0 },
+ { "qofhebrew", 0x05e7 , 0 },
+ { "qofhiriq", 0x05e7 , 0 },
+ { "qofhiriqhebrew", 0x05e7 , 0 },
+ { "qofholam", 0x05e7 , 0 },
+ { "qofholamhebrew", 0x05e7 , 0 },
+ { "qofpatah", 0x05e7 , 0 },
+ { "qofpatahhebrew", 0x05e7 , 0 },
+ { "qofqamats", 0x05e7 , 0 },
+ { "qofqamatshebrew", 0x05e7 , 0 },
+ { "qofqubuts", 0x05e7 , 0 },
+ { "qofqubutshebrew", 0x05e7 , 0 },
+ { "qofsegol", 0x05e7 , 0 },
+ { "qofsegolhebrew", 0x05e7 , 0 },
+ { "qofsheva", 0x05e7 , 0 },
+ { "qofshevahebrew", 0x05e7 , 0 },
+ { "qoftsere", 0x05e7 , 0 },
+ { "qoftserehebrew", 0x05e7 , 0 },
+ { "qparen", 0x24ac , 0 },
+ { "quarternote", 0x2669 , 0 },
+ { "qubuts", 0x05bb , 0 },
+ { "qubuts18", 0x05bb , 0 },
+ { "qubuts25", 0x05bb , 0 },
+ { "qubuts31", 0x05bb , 0 },
+ { "qubutshebrew", 0x05bb , 0 },
+ { "qubutsnarrowhebrew", 0x05bb , 0 },
+ { "qubutsquarterhebrew", 0x05bb , 0 },
+ { "qubutswidehebrew", 0x05bb , 0 },
+ { "questionarabic", 0x061f , 0 },
+ { "questionarmenian", 0x055e , 0 },
+ { "questiondownsmall", 0xf7bf , 0 },
+ { "questiongreek", 0x037e , 0 },
+ { "questionmonospace", 0xff1f , 0 },
+ { "questionsmall", 0xf73f , 0 },
+ { "quotedblmonospace", 0xff02 , 0 },
+ { "quotedblprime", 0x301e , 0 },
+ { "quotedblprimereversed", 0x301d , 0 },
+ { "quoteleftreversed", 0x201b , 0 },
+ { "quoterightn", 0x0149 , 0 },
+ { "quotesinglemonospace", 0xff07 , 0 },
+ { "raarmenian", 0x057c , 0 },
+ { "rabengali", 0x09b0 , 0 },
+ { "radeva", 0x0930 , 0 },
+ { "radicalex", 0xf8e5 , 0 },
+ { "radoverssquare", 0x33ae , 0 },
+ { "radoverssquaredsquare", 0x33af , 0 },
+ { "radsquare", 0x33ad , 0 },
+ { "rafe", 0x05bf , 0 },
+ { "rafehebrew", 0x05bf , 0 },
+ { "ragujarati", 0x0ab0 , 0 },
+ { "ragurmukhi", 0x0a30 , 0 },
+ { "rahiragana", 0x3089 , 0 },
+ { "rakatakana", 0x30e9 , 0 },
+ { "rakatakanahalfwidth", 0xff97 , 0 },
+ { "ralowerdiagonalbengali", 0x09f1 , 0 },
+ { "ramiddlediagonalbengali", 0x09f0 , 0 },
+ { "ramshorn", 0x0264 , 0 },
+ { "ratio", 0x2236 , 0 },
+ { "rbopomofo", 0x3116 , 0 },
+ { "rcedilla", 0x0157 , 0 },
+ { "rcircle", 0x24e1 , 0 },
+ { "rdblgrave", 0x0211 , 0 },
+ { "rdotaccent", 0x1e59 , 0 },
+ { "rdotbelow", 0x1e5b , 0 },
+ { "rdotbelowmacron", 0x1e5d , 0 },
+ { "referencemark", 0x203b , 0 },
+ { "registersans", 0xf8e8 , 0 },
+ { "registerserif", 0xf6da , 0 },
+ { "reharabic", 0x0631 , 0 },
+ { "reharmenian", 0x0580 , 0 },
+ { "rehfinalarabic", 0xfeae , 0 },
+ { "rehiragana", 0x308c , 0 },
+ { "rehyehaleflamarabic", 0x0631 , 0 },
+ { "rekatakana", 0x30ec , 0 },
+ { "rekatakanahalfwidth", 0xff9a , 0 },
+ { "resh", 0x05e8 , 0 },
+ { "reshdageshhebrew", 0xfb48 , 0 },
+ { "reshhatafpatah", 0x05e8 , 0 },
+ { "reshhatafpatahhebrew", 0x05e8 , 0 },
+ { "reshhatafsegol", 0x05e8 , 0 },
+ { "reshhatafsegolhebrew", 0x05e8 , 0 },
+ { "reshhebrew", 0x05e8 , 0 },
+ { "reshhiriq", 0x05e8 , 0 },
+ { "reshhiriqhebrew", 0x05e8 , 0 },
+ { "reshholam", 0x05e8 , 0 },
+ { "reshholamhebrew", 0x05e8 , 0 },
+ { "reshpatah", 0x05e8 , 0 },
+ { "reshpatahhebrew", 0x05e8 , 0 },
+ { "reshqamats", 0x05e8 , 0 },
+ { "reshqamatshebrew", 0x05e8 , 0 },
+ { "reshqubuts", 0x05e8 , 0 },
+ { "reshqubutshebrew", 0x05e8 , 0 },
+ { "reshsegol", 0x05e8 , 0 },
+ { "reshsegolhebrew", 0x05e8 , 0 },
+ { "reshsheva", 0x05e8 , 0 },
+ { "reshshevahebrew", 0x05e8 , 0 },
+ { "reshtsere", 0x05e8 , 0 },
+ { "reshtserehebrew", 0x05e8 , 0 },
+ { "reversedtilde", 0x223d , 0 },
+ { "reviahebrew", 0x0597 , 0 },
+ { "reviamugrashhebrew", 0x0597 , 0 },
+ { "rfishhook", 0x027e , 0 },
+ { "rfishhookreversed", 0x027f , 0 },
+ { "rhabengali", 0x09dd , 0 },
+ { "rhadeva", 0x095d , 0 },
+ { "rhook", 0x027d , 0 },
+ { "rhookturned", 0x027b , 0 },
+ { "rhookturnedsuperior", 0x02b5 , 0 },
+ { "rhosymbolgreek", 0x03f1 , 0 },
+ { "rhotichookmod", 0x02de , 0 },
+ { "rieulacirclekorean", 0x3271 , 0 },
+ { "rieulaparenkorean", 0x3211 , 0 },
+ { "rieulcirclekorean", 0x3263 , 0 },
+ { "rieulhieuhkorean", 0x3140 , 0 },
+ { "rieulkiyeokkorean", 0x313a , 0 },
+ { "rieulkiyeoksioskorean", 0x3169 , 0 },
+ { "rieulkorean", 0x3139 , 0 },
+ { "rieulmieumkorean", 0x313b , 0 },
+ { "rieulpansioskorean", 0x316c , 0 },
+ { "rieulparenkorean", 0x3203 , 0 },
+ { "rieulphieuphkorean", 0x313f , 0 },
+ { "rieulpieupkorean", 0x313c , 0 },
+ { "rieulpieupsioskorean", 0x316b , 0 },
+ { "rieulsioskorean", 0x313d , 0 },
+ { "rieulthieuthkorean", 0x313e , 0 },
+ { "rieultikeutkorean", 0x316a , 0 },
+ { "rieulyeorinhieuhkorean", 0x316d , 0 },
+ { "rightangle", 0x221f , 0 },
+ { "righttackbelowcmb", 0x0319 , 0 },
+ { "righttriangle", 0x22bf , 0 },
+ { "rihiragana", 0x308a , 0 },
+ { "rikatakana", 0x30ea , 0 },
+ { "rikatakanahalfwidth", 0xff98 , 0 },
+ { "ringbelowcmb", 0x0325 , 0 },
+ { "ringcmb", 0x030a , 0 },
+ { "ringhalfleft", 0x02bf , 0 },
+ { "ringhalfleftarmenian", 0x0559 , 0 },
+ { "ringhalfleftbelowcmb", 0x031c , 0 },
+ { "ringhalfleftcentered", 0x02d3 , 0 },
+ { "ringhalfright", 0x02be , 0 },
+ { "ringhalfrightbelowcmb", 0x0339 , 0 },
+ { "ringhalfrightcentered", 0x02d2 , 0 },
+ { "rinvertedbreve", 0x0213 , 0 },
+ { "rittorusquare", 0x3351 , 0 },
+ { "rlinebelow", 0x1e5f , 0 },
+ { "rlongleg", 0x027c , 0 },
+ { "rlonglegturned", 0x027a , 0 },
+ { "rmonospace", 0xff52 , 0 },
+ { "rohiragana", 0x308d , 0 },
+ { "rokatakana", 0x30ed , 0 },
+ { "rokatakanahalfwidth", 0xff9b , 0 },
+ { "roruathai", 0x0e23 , 0 },
+ { "rparen", 0x24ad , 0 },
+ { "rrabengali", 0x09dc , 0 },
+ { "rradeva", 0x0931 , 0 },
+ { "rragurmukhi", 0x0a5c , 0 },
+ { "rreharabic", 0x0691 , 0 },
+ { "rrehfinalarabic", 0xfb8d , 0 },
+ { "rrvocalicbengali", 0x09e0 , 0 },
+ { "rrvocalicdeva", 0x0960 , 0 },
+ { "rrvocalicgujarati", 0x0ae0 , 0 },
+ { "rrvocalicvowelsignbengali", 0x09c4 , 0 },
+ { "rrvocalicvowelsigndeva", 0x0944 , 0 },
+ { "rrvocalicvowelsigngujarati", 0x0ac4 , 0 },
+ { "rsuperior", 0xf6f1 , 0 },
+ { "rturned", 0x0279 , 0 },
+ { "rturnedsuperior", 0x02b4 , 0 },
+ { "ruhiragana", 0x308b , 0 },
+ { "rukatakana", 0x30eb , 0 },
+ { "rukatakanahalfwidth", 0xff99 , 0 },
+ { "rupeemarkbengali", 0x09f2 , 0 },
+ { "rupeesignbengali", 0x09f3 , 0 },
+ { "rupiah", 0xf6dd , 0 },
+ { "ruthai", 0x0e24 , 0 },
+ { "rvocalicbengali", 0x098b , 0 },
+ { "rvocalicdeva", 0x090b , 0 },
+ { "rvocalicgujarati", 0x0a8b , 0 },
+ { "rvocalicvowelsignbengali", 0x09c3 , 0 },
+ { "rvocalicvowelsigndeva", 0x0943 , 0 },
+ { "rvocalicvowelsigngujarati", 0x0ac3 , 0 },
+ { "sabengali", 0x09b8 , 0 },
+ { "sacutedotaccent", 0x1e65 , 0 },
+ { "sadarabic", 0x0635 , 0 },
+ { "sadeva", 0x0938 , 0 },
+ { "sadfinalarabic", 0xfeba , 0 },
+ { "sadinitialarabic", 0xfebb , 0 },
+ { "sadmedialarabic", 0xfebc , 0 },
+ { "sagujarati", 0x0ab8 , 0 },
+ { "sagurmukhi", 0x0a38 , 0 },
+ { "sahiragana", 0x3055 , 0 },
+ { "sakatakana", 0x30b5 , 0 },
+ { "sakatakanahalfwidth", 0xff7b , 0 },
+ { "sallallahoualayhewasallamarabic", 0xfdfa , 0 },
+ { "samekh", 0x05e1 , 0 },
+ { "samekhdagesh", 0xfb41 , 0 },
+ { "samekhdageshhebrew", 0xfb41 , 0 },
+ { "samekhhebrew", 0x05e1 , 0 },
+ { "saraaathai", 0x0e32 , 0 },
+ { "saraaethai", 0x0e41 , 0 },
+ { "saraaimaimalaithai", 0x0e44 , 0 },
+ { "saraaimaimuanthai", 0x0e43 , 0 },
+ { "saraamthai", 0x0e33 , 0 },
+ { "saraathai", 0x0e30 , 0 },
+ { "saraethai", 0x0e40 , 0 },
+ { "saraiileftthai", 0xf886 , 0 },
+ { "saraiithai", 0x0e35 , 0 },
+ { "saraileftthai", 0xf885 , 0 },
+ { "saraithai", 0x0e34 , 0 },
+ { "saraothai", 0x0e42 , 0 },
+ { "saraueeleftthai", 0xf888 , 0 },
+ { "saraueethai", 0x0e37 , 0 },
+ { "saraueleftthai", 0xf887 , 0 },
+ { "sarauethai", 0x0e36 , 0 },
+ { "sarauthai", 0x0e38 , 0 },
+ { "sarauuthai", 0x0e39 , 0 },
+ { "sbopomofo", 0x3119 , 0 },
+ { "scarondotaccent", 0x1e67 , 0 },
+ { "schwa", 0x0259 , 0 },
+ { "schwacyrillic", 0x04d9 , 0 },
+ { "schwadieresiscyrillic", 0x04db , 0 },
+ { "schwahook", 0x025a , 0 },
+ { "scircle", 0x24e2 , 0 },
+ { "sdotaccent", 0x1e61 , 0 },
+ { "sdotbelow", 0x1e63 , 0 },
+ { "sdotbelowdotaccent", 0x1e69 , 0 },
+ { "seagullbelowcmb", 0x033c , 0 },
+ { "secondtonechinese", 0x02ca , 0 },
+ { "seenarabic", 0x0633 , 0 },
+ { "seenfinalarabic", 0xfeb2 , 0 },
+ { "seeninitialarabic", 0xfeb3 , 0 },
+ { "seenmedialarabic", 0xfeb4 , 0 },
+ { "segol", 0x05b6 , 0 },
+ { "segol13", 0x05b6 , 0 },
+ { "segol1f", 0x05b6 , 0 },
+ { "segol2c", 0x05b6 , 0 },
+ { "segolhebrew", 0x05b6 , 0 },
+ { "segolnarrowhebrew", 0x05b6 , 0 },
+ { "segolquarterhebrew", 0x05b6 , 0 },
+ { "segoltahebrew", 0x0592 , 0 },
+ { "segolwidehebrew", 0x05b6 , 0 },
+ { "seharmenian", 0x057d , 0 },
+ { "sehiragana", 0x305b , 0 },
+ { "sekatakana", 0x30bb , 0 },
+ { "sekatakanahalfwidth", 0xff7e , 0 },
+ { "semicolonarabic", 0x061b , 0 },
+ { "semicolonmonospace", 0xff1b , 0 },
+ { "semicolonsmall", 0xfe54 , 0 },
+ { "semivoicedmarkkana", 0x309c , 0 },
+ { "semivoicedmarkkanahalfwidth", 0xff9f , 0 },
+ { "sentisquare", 0x3322 , 0 },
+ { "sentosquare", 0x3323 , 0 },
+ { "sevenarabic", 0x0667 , 0 },
+ { "sevenbengali", 0x09ed , 0 },
+ { "sevencircle", 0x2466 , 0 },
+ { "sevencircleinversesansserif", 0x2790 , 0 },
+ { "sevendeva", 0x096d , 0 },
+ { "sevengujarati", 0x0aed , 0 },
+ { "sevengurmukhi", 0x0a6d , 0 },
+ { "sevenhackarabic", 0x0667 , 0 },
+ { "sevenhangzhou", 0x3027 , 0 },
+ { "sevenideographicparen", 0x3226 , 0 },
+ { "seveninferior", 0x2087 , 0 },
+ { "sevenmonospace", 0xff17 , 0 },
+ { "sevenoldstyle", 0xf737 , 0 },
+ { "sevenparen", 0x247a , 0 },
+ { "sevenperiod", 0x248e , 0 },
+ { "sevenpersian", 0x06f7 , 0 },
+ { "sevenroman", 0x2176 , 0 },
+ { "sevensuperior", 0x2077 , 0 },
+ { "seventeencircle", 0x2470 , 0 },
+ { "seventeenparen", 0x2484 , 0 },
+ { "seventeenperiod", 0x2498 , 0 },
+ { "seventhai", 0x0e57 , 0 },
+ { "sfthyphen", 0x00ad , 0 },
+ { "shaarmenian", 0x0577 , 0 },
+ { "shabengali", 0x09b6 , 0 },
+ { "shacyrillic", 0x0448 , 0 },
+ { "shaddaarabic", 0x0651 , 0 },
+ { "shaddadammaarabic", 0xfc61 , 0 },
+ { "shaddadammatanarabic", 0xfc5e , 0 },
+ { "shaddafathaarabic", 0xfc60 , 0 },
+ { "shaddafathatanarabic", 0x0651 , 0 },
+ { "shaddakasraarabic", 0xfc62 , 0 },
+ { "shaddakasratanarabic", 0xfc5f , 0 },
+ { "shadedark", 0x2593 , 0 },
+ { "shadelight", 0x2591 , 0 },
+ { "shademedium", 0x2592 , 0 },
+ { "shadeva", 0x0936 , 0 },
+ { "shagujarati", 0x0ab6 , 0 },
+ { "shagurmukhi", 0x0a36 , 0 },
+ { "shalshelethebrew", 0x0593 , 0 },
+ { "shbopomofo", 0x3115 , 0 },
+ { "shchacyrillic", 0x0449 , 0 },
+ { "sheenarabic", 0x0634 , 0 },
+ { "sheenfinalarabic", 0xfeb6 , 0 },
+ { "sheeninitialarabic", 0xfeb7 , 0 },
+ { "sheenmedialarabic", 0xfeb8 , 0 },
+ { "sheicoptic", 0x03e3 , 0 },
+ { "sheqel", 0x20aa , 0 },
+ { "sheqelhebrew", 0x20aa , 0 },
+ { "sheva", 0x05b0 , 0 },
+ { "sheva115", 0x05b0 , 0 },
+ { "sheva15", 0x05b0 , 0 },
+ { "sheva22", 0x05b0 , 0 },
+ { "sheva2e", 0x05b0 , 0 },
+ { "shevahebrew", 0x05b0 , 0 },
+ { "shevanarrowhebrew", 0x05b0 , 0 },
+ { "shevaquarterhebrew", 0x05b0 , 0 },
+ { "shevawidehebrew", 0x05b0 , 0 },
+ { "shhacyrillic", 0x04bb , 0 },
+ { "shimacoptic", 0x03ed , 0 },
+ { "shin", 0x05e9 , 0 },
+ { "shindagesh", 0xfb49 , 0 },
+ { "shindageshhebrew", 0xfb49 , 0 },
+ { "shindageshshindot", 0xfb2c , 0 },
+ { "shindageshshindothebrew", 0xfb2c , 0 },
+ { "shindageshsindot", 0xfb2d , 0 },
+ { "shindageshsindothebrew", 0xfb2d , 0 },
+ { "shindothebrew", 0x05c1 , 0 },
+ { "shinhebrew", 0x05e9 , 0 },
+ { "shinshindot", 0xfb2a , 0 },
+ { "shinshindothebrew", 0xfb2a , 0 },
+ { "shinsindot", 0xfb2b , 0 },
+ { "shinsindothebrew", 0xfb2b , 0 },
+ { "shook", 0x0282 , 0 },
+ { "sigmafinal", 0x03c2 , 0 },
+ { "sigmalunatesymbolgreek", 0x03f2 , 0 },
+ { "sihiragana", 0x3057 , 0 },
+ { "sikatakana", 0x30b7 , 0 },
+ { "sikatakanahalfwidth", 0xff7c , 0 },
+ { "siluqhebrew", 0x05bd , 0 },
+ { "siluqlefthebrew", 0x05bd , 0 },
+ { "sindothebrew", 0x05c2 , 0 },
+ { "siosacirclekorean", 0x3274 , 0 },
+ { "siosaparenkorean", 0x3214 , 0 },
+ { "sioscieuckorean", 0x317e , 0 },
+ { "sioscirclekorean", 0x3266 , 0 },
+ { "sioskiyeokkorean", 0x317a , 0 },
+ { "sioskorean", 0x3145 , 0 },
+ { "siosnieunkorean", 0x317b , 0 },
+ { "siosparenkorean", 0x3206 , 0 },
+ { "siospieupkorean", 0x317d , 0 },
+ { "siostikeutkorean", 0x317c , 0 },
+ { "sixarabic", 0x0666 , 0 },
+ { "sixbengali", 0x09ec , 0 },
+ { "sixcircle", 0x2465 , 0 },
+ { "sixcircleinversesansserif", 0x278f , 0 },
+ { "sixdeva", 0x096c , 0 },
+ { "sixgujarati", 0x0aec , 0 },
+ { "sixgurmukhi", 0x0a6c , 0 },
+ { "sixhackarabic", 0x0666 , 0 },
+ { "sixhangzhou", 0x3026 , 0 },
+ { "sixideographicparen", 0x3225 , 0 },
+ { "sixinferior", 0x2086 , 0 },
+ { "sixmonospace", 0xff16 , 0 },
+ { "sixoldstyle", 0xf736 , 0 },
+ { "sixparen", 0x2479 , 0 },
+ { "sixperiod", 0x248d , 0 },
+ { "sixpersian", 0x06f6 , 0 },
+ { "sixroman", 0x2175 , 0 },
+ { "sixsuperior", 0x2076 , 0 },
+ { "sixteencircle", 0x246f , 0 },
+ { "sixteencurrencydenominatorbengali", 0x09f9 , 0 },
+ { "sixteenparen", 0x2483 , 0 },
+ { "sixteenperiod", 0x2497 , 0 },
+ { "sixthai", 0x0e56 , 0 },
+ { "slashmonospace", 0xff0f , 0 },
+ { "slong", 0x017f , 0 },
+ { "slongdotaccent", 0x1e9b , 0 },
+ { "smonospace", 0xff53 , 0 },
+ { "sofpasuqhebrew", 0x05c3 , 0 },
+ { "softhyphen", 0x00ad , 0 },
+ { "softsigncyrillic", 0x044c , 0 },
+ { "sohiragana", 0x305d , 0 },
+ { "sokatakana", 0x30bd , 0 },
+ { "sokatakanahalfwidth", 0xff7f , 0 },
+ { "soliduslongoverlaycmb", 0x0338 , 0 },
+ { "solidusshortoverlaycmb", 0x0337 , 0 },
+ { "sorusithai", 0x0e29 , 0 },
+ { "sosalathai", 0x0e28 , 0 },
+ { "sosothai", 0x0e0b , 0 },
+ { "sosuathai", 0x0e2a , 0 },
+ { "spacehackarabic", 0x0020 , 0 },
+ { "spadesuitblack", 0x2660 , 0 },
+ { "spadesuitwhite", 0x2664 , 0 },
+ { "sparen", 0x24ae , 0 },
+ { "squarebelowcmb", 0x033b , 0 },
+ { "squarecc", 0x33c4 , 0 },
+ { "squarecm", 0x339d , 0 },
+ { "squarediagonalcrosshatchfill", 0x25a9 , 0 },
+ { "squarehorizontalfill", 0x25a4 , 0 },
+ { "squarekg", 0x338f , 0 },
+ { "squarekm", 0x339e , 0 },
+ { "squarekmcapital", 0x33ce , 0 },
+ { "squareln", 0x33d1 , 0 },
+ { "squarelog", 0x33d2 , 0 },
+ { "squaremg", 0x338e , 0 },
+ { "squaremil", 0x33d5 , 0 },
+ { "squaremm", 0x339c , 0 },
+ { "squaremsquared", 0x33a1 , 0 },
+ { "squareorthogonalcrosshatchfill", 0x25a6 , 0 },
+ { "squareupperlefttolowerrightfill", 0x25a7 , 0 },
+ { "squareupperrighttolowerleftfill", 0x25a8 , 0 },
+ { "squareverticalfill", 0x25a5 , 0 },
+ { "squarewhitewithsmallblack", 0x25a3 , 0 },
+ { "srsquare", 0x33db , 0 },
+ { "ssabengali", 0x09b7 , 0 },
+ { "ssadeva", 0x0937 , 0 },
+ { "ssagujarati", 0x0ab7 , 0 },
+ { "ssangcieuckorean", 0x3149 , 0 },
+ { "ssanghieuhkorean", 0x3185 , 0 },
+ { "ssangieungkorean", 0x3180 , 0 },
+ { "ssangkiyeokkorean", 0x3132 , 0 },
+ { "ssangnieunkorean", 0x3165 , 0 },
+ { "ssangpieupkorean", 0x3143 , 0 },
+ { "ssangsioskorean", 0x3146 , 0 },
+ { "ssangtikeutkorean", 0x3138 , 0 },
+ { "ssuperior", 0xf6f2 , 0 },
+ { "sterlingmonospace", 0xffe1 , 0 },
+ { "strokelongoverlaycmb", 0x0336 , 0 },
+ { "strokeshortoverlaycmb", 0x0335 , 0 },
+ { "subset", 0x2282 , 0 },
+ { "subsetnotequal", 0x228a , 0 },
+ { "subsetorequal", 0x2286 , 0 },
+ { "succeeds", 0x227b , 0 },
+ { "suhiragana", 0x3059 , 0 },
+ { "sukatakana", 0x30b9 , 0 },
+ { "sukatakanahalfwidth", 0xff7d , 0 },
+ { "sukunarabic", 0x0652 , 0 },
+ { "superset", 0x2283 , 0 },
+ { "supersetnotequal", 0x228b , 0 },
+ { "supersetorequal", 0x2287 , 0 },
+ { "svsquare", 0x33dc , 0 },
+ { "syouwaerasquare", 0x337c , 0 },
+ { "tabengali", 0x09a4 , 0 },
+ { "tackdown", 0x22a4 , 0 },
+ { "tackleft", 0x22a3 , 0 },
+ { "tadeva", 0x0924 , 0 },
+ { "tagujarati", 0x0aa4 , 0 },
+ { "tagurmukhi", 0x0a24 , 0 },
+ { "taharabic", 0x0637 , 0 },
+ { "tahfinalarabic", 0xfec2 , 0 },
+ { "tahinitialarabic", 0xfec3 , 0 },
+ { "tahiragana", 0x305f , 0 },
+ { "tahmedialarabic", 0xfec4 , 0 },
+ { "taisyouerasquare", 0x337d , 0 },
+ { "takatakana", 0x30bf , 0 },
+ { "takatakanahalfwidth", 0xff80 , 0 },
+ { "tatweelarabic", 0x0640 , 0 },
+ { "tav", 0x05ea , 0 },
+ { "tavdages", 0xfb4a , 0 },
+ { "tavdagesh", 0xfb4a , 0 },
+ { "tavdageshhebrew", 0xfb4a , 0 },
+ { "tavhebrew", 0x05ea , 0 },
+ { "tbopomofo", 0x310a , 0 },
+ { "tccurl", 0x02a8 , 0 },
+ { "tcedilla", 0x0163 , 0 },
+ { "tcheharabic", 0x0686 , 0 },
+ { "tchehfinalarabic", 0xfb7b , 0 },
+ { "tchehinitialarabic", 0xfb7c , 0 },
+ { "tchehmedialarabic", 0xfb7d , 0 },
+ { "tchehmeeminitialarabic", 0xfb7c , 0 },
+ { "tcircle", 0x24e3 , 0 },
+ { "tcircumflexbelow", 0x1e71 , 0 },
+ { "tdieresis", 0x1e97 , 0 },
+ { "tdotaccent", 0x1e6b , 0 },
+ { "tdotbelow", 0x1e6d , 0 },
+ { "tecyrillic", 0x0442 , 0 },
+ { "tedescendercyrillic", 0x04ad , 0 },
+ { "teharabic", 0x062a , 0 },
+ { "tehfinalarabic", 0xfe96 , 0 },
+ { "tehhahinitialarabic", 0xfca2 , 0 },
+ { "tehhahisolatedarabic", 0xfc0c , 0 },
+ { "tehinitialarabic", 0xfe97 , 0 },
+ { "tehiragana", 0x3066 , 0 },
+ { "tehjeeminitialarabic", 0xfca1 , 0 },
+ { "tehjeemisolatedarabic", 0xfc0b , 0 },
+ { "tehmarbutaarabic", 0x0629 , 0 },
+ { "tehmarbutafinalarabic", 0xfe94 , 0 },
+ { "tehmedialarabic", 0xfe98 , 0 },
+ { "tehmeeminitialarabic", 0xfca4 , 0 },
+ { "tehmeemisolatedarabic", 0xfc0e , 0 },
+ { "tehnoonfinalarabic", 0xfc73 , 0 },
+ { "tekatakana", 0x30c6 , 0 },
+ { "tekatakanahalfwidth", 0xff83 , 0 },
+ { "telephone", 0x2121 , 0 },
+ { "telephoneblack", 0x260e , 0 },
+ { "telishagedolahebrew", 0x05a0 , 0 },
+ { "telishaqetanahebrew", 0x05a9 , 0 },
+ { "tencircle", 0x2469 , 0 },
+ { "tenideographicparen", 0x3229 , 0 },
+ { "tenparen", 0x247d , 0 },
+ { "tenperiod", 0x2491 , 0 },
+ { "tenroman", 0x2179 , 0 },
+ { "tesh", 0x02a7 , 0 },
+ { "tet", 0x05d8 , 0 },
+ { "tetdagesh", 0xfb38 , 0 },
+ { "tetdageshhebrew", 0xfb38 , 0 },
+ { "tethebrew", 0x05d8 , 0 },
+ { "tetsecyrillic", 0x04b5 , 0 },
+ { "tevirhebrew", 0x059b , 0 },
+ { "tevirlefthebrew", 0x059b , 0 },
+ { "thabengali", 0x09a5 , 0 },
+ { "thadeva", 0x0925 , 0 },
+ { "thagujarati", 0x0aa5 , 0 },
+ { "thagurmukhi", 0x0a25 , 0 },
+ { "thalarabic", 0x0630 , 0 },
+ { "thalfinalarabic", 0xfeac , 0 },
+ { "thanthakhatlowleftthai", 0xf898 , 0 },
+ { "thanthakhatlowrightthai", 0xf897 , 0 },
+ { "thanthakhatthai", 0x0e4c , 0 },
+ { "thanthakhatupperleftthai", 0xf896 , 0 },
+ { "theharabic", 0x062b , 0 },
+ { "thehfinalarabic", 0xfe9a , 0 },
+ { "thehinitialarabic", 0xfe9b , 0 },
+ { "thehmedialarabic", 0xfe9c , 0 },
+ { "thereexists", 0x2203 , 0 },
+ { "thetasymbolgreek", 0x03d1 , 0 },
+ { "thieuthacirclekorean", 0x3279 , 0 },
+ { "thieuthaparenkorean", 0x3219 , 0 },
+ { "thieuthcirclekorean", 0x326b , 0 },
+ { "thieuthkorean", 0x314c , 0 },
+ { "thieuthparenkorean", 0x320b , 0 },
+ { "thirteencircle", 0x246c , 0 },
+ { "thirteenparen", 0x2480 , 0 },
+ { "thirteenperiod", 0x2494 , 0 },
+ { "thonangmonthothai", 0x0e11 , 0 },
+ { "thook", 0x01ad , 0 },
+ { "thophuthaothai", 0x0e12 , 0 },
+ { "thothahanthai", 0x0e17 , 0 },
+ { "thothanthai", 0x0e10 , 0 },
+ { "thothongthai", 0x0e18 , 0 },
+ { "thothungthai", 0x0e16 , 0 },
+ { "thousandcyrillic", 0x0482 , 0 },
+ { "thousandsseparatorarabic", 0x066c , 0 },
+ { "thousandsseparatorpersian", 0x066c , 0 },
+ { "threearabic", 0x0663 , 0 },
+ { "threebengali", 0x09e9 , 0 },
+ { "threecircle", 0x2462 , 0 },
+ { "threecircleinversesansserif", 0x278c , 0 },
+ { "threedeva", 0x0969 , 0 },
+ { "threegujarati", 0x0ae9 , 0 },
+ { "threegurmukhi", 0x0a69 , 0 },
+ { "threehackarabic", 0x0663 , 0 },
+ { "threehangzhou", 0x3023 , 0 },
+ { "threeideographicparen", 0x3222 , 0 },
+ { "threeinferior", 0x2083 , 0 },
+ { "threemonospace", 0xff13 , 0 },
+ { "threenumeratorbengali", 0x09f6 , 0 },
+ { "threeoldstyle", 0xf733 , 0 },
+ { "threeparen", 0x2476 , 0 },
+ { "threeperiod", 0x248a , 0 },
+ { "threepersian", 0x06f3 , 0 },
+ { "threequartersemdash", 0xf6de , 0 },
+ { "threeroman", 0x2172 , 0 },
+ { "threesuperior", 0x00b3 , 0 },
+ { "threethai", 0x0e53 , 0 },
+ { "thzsquare", 0x3394 , 0 },
+ { "tihiragana", 0x3061 , 0 },
+ { "tikatakana", 0x30c1 , 0 },
+ { "tikatakanahalfwidth", 0xff81 , 0 },
+ { "tikeutacirclekorean", 0x3270 , 0 },
+ { "tikeutaparenkorean", 0x3210 , 0 },
+ { "tikeutcirclekorean", 0x3262 , 0 },
+ { "tikeutkorean", 0x3137 , 0 },
+ { "tikeutparenkorean", 0x3202 , 0 },
+ { "tildebelowcmb", 0x0330 , 0 },
+ { "tildecmb", 0x0303 , 0 },
+ { "tildedoublecmb", 0x0360 , 0 },
+ { "tildeoperator", 0x223c , 0 },
+ { "tildeoverlaycmb", 0x0334 , 0 },
+ { "tildeverticalcmb", 0x033e , 0 },
+ { "timescircle", 0x2297 , 0 },
+ { "tipehahebrew", 0x0596 , 0 },
+ { "tipehalefthebrew", 0x0596 , 0 },
+ { "tippigurmukhi", 0x0a70 , 0 },
+ { "titlocyrilliccmb", 0x0483 , 0 },
+ { "tiwnarmenian", 0x057f , 0 },
+ { "tlinebelow", 0x1e6f , 0 },
+ { "tmonospace", 0xff54 , 0 },
+ { "toarmenian", 0x0569 , 0 },
+ { "tohiragana", 0x3068 , 0 },
+ { "tokatakana", 0x30c8 , 0 },
+ { "tokatakanahalfwidth", 0xff84 , 0 },
+ { "tonebarextrahighmod", 0x02e5 , 0 },
+ { "tonebarextralowmod", 0x02e9 , 0 },
+ { "tonebarhighmod", 0x02e6 , 0 },
+ { "tonebarlowmod", 0x02e8 , 0 },
+ { "tonebarmidmod", 0x02e7 , 0 },
+ { "tonefive", 0x01bd , 0 },
+ { "tonesix", 0x0185 , 0 },
+ { "tonetwo", 0x01a8 , 0 },
+ { "tonsquare", 0x3327 , 0 },
+ { "topatakthai", 0x0e0f , 0 },
+ { "tortoiseshellbracketleft", 0x3014 , 0 },
+ { "tortoiseshellbracketleftsmall", 0xfe5d , 0 },
+ { "tortoiseshellbracketleftvertical", 0xfe39 , 0 },
+ { "tortoiseshellbracketright", 0x3015 , 0 },
+ { "tortoiseshellbracketrightsmall", 0xfe5e , 0 },
+ { "tortoiseshellbracketrightvertical", 0xfe3a , 0 },
+ { "totaothai", 0x0e15 , 0 },
+ { "tpalatalhook", 0x01ab , 0 },
+ { "tparen", 0x24af , 0 },
+ { "trademarksans", 0xf8ea , 0 },
+ { "trademarkserif", 0xf6db , 0 },
+ { "tretroflexhook", 0x0288 , 0 },
+ { "ts", 0x02a6 , 0 },
+ { "tsadi", 0x05e6 , 0 },
+ { "tsadidagesh", 0xfb46 , 0 },
+ { "tsadidageshhebrew", 0xfb46 , 0 },
+ { "tsadihebrew", 0x05e6 , 0 },
+ { "tsecyrillic", 0x0446 , 0 },
+ { "tsere", 0x05b5 , 0 },
+ { "tsere12", 0x05b5 , 0 },
+ { "tsere1e", 0x05b5 , 0 },
+ { "tsere2b", 0x05b5 , 0 },
+ { "tserehebrew", 0x05b5 , 0 },
+ { "tserenarrowhebrew", 0x05b5 , 0 },
+ { "tserequarterhebrew", 0x05b5 , 0 },
+ { "tserewidehebrew", 0x05b5 , 0 },
+ { "tshecyrillic", 0x045b , 0 },
+ { "tsuperior", 0xf6f3 , 0 },
+ { "ttabengali", 0x099f , 0 },
+ { "ttadeva", 0x091f , 0 },
+ { "ttagujarati", 0x0a9f , 0 },
+ { "ttagurmukhi", 0x0a1f , 0 },
+ { "tteharabic", 0x0679 , 0 },
+ { "ttehfinalarabic", 0xfb67 , 0 },
+ { "ttehinitialarabic", 0xfb68 , 0 },
+ { "ttehmedialarabic", 0xfb69 , 0 },
+ { "tthabengali", 0x09a0 , 0 },
+ { "tthadeva", 0x0920 , 0 },
+ { "tthagujarati", 0x0aa0 , 0 },
+ { "tthagurmukhi", 0x0a20 , 0 },
+ { "tturned", 0x0287 , 0 },
+ { "tuhiragana", 0x3064 , 0 },
+ { "tukatakana", 0x30c4 , 0 },
+ { "tukatakanahalfwidth", 0xff82 , 0 },
+ { "tusmallhiragana", 0x3063 , 0 },
+ { "tusmallkatakana", 0x30c3 , 0 },
+ { "tusmallkatakanahalfwidth", 0xff6f , 0 },
+ { "twelvecircle", 0x246b , 0 },
+ { "twelveparen", 0x247f , 0 },
+ { "twelveperiod", 0x2493 , 0 },
+ { "twelveroman", 0x217b , 0 },
+ { "twentycircle", 0x2473 , 0 },
+ { "twentyhangzhou", 0x5344 , 0 },
+ { "twentyparen", 0x2487 , 0 },
+ { "twentyperiod", 0x249b , 0 },
+ { "twoarabic", 0x0662 , 0 },
+ { "twobengali", 0x09e8 , 0 },
+ { "twocircle", 0x2461 , 0 },
+ { "twocircleinversesansserif", 0x278b , 0 },
+ { "twodeva", 0x0968 , 0 },
+ { "twodotleader", 0x2025 , 0 },
+ { "twodotleadervertical", 0xfe30 , 0 },
+ { "twogujarati", 0x0ae8 , 0 },
+ { "twogurmukhi", 0x0a68 , 0 },
+ { "twohackarabic", 0x0662 , 0 },
+ { "twohangzhou", 0x3022 , 0 },
+ { "twoideographicparen", 0x3221 , 0 },
+ { "twoinferior", 0x2082 , 0 },
+ { "twomonospace", 0xff12 , 0 },
+ { "twonumeratorbengali", 0x09f5 , 0 },
+ { "twooldstyle", 0xf732 , 0 },
+ { "twoparen", 0x2475 , 0 },
+ { "twoperiod", 0x2489 , 0 },
+ { "twopersian", 0x06f2 , 0 },
+ { "tworoman", 0x2171 , 0 },
+ { "twostroke", 0x01bb , 0 },
+ { "twosuperior", 0x00b2 , 0 },
+ { "twothai", 0x0e52 , 0 },
+ { "ubar", 0x0289 , 0 },
+ { "ubengali", 0x0989 , 0 },
+ { "ubopomofo", 0x3128 , 0 },
+ { "ucaron", 0x01d4 , 0 },
+ { "ucircle", 0x24e4 , 0 },
+ { "ucircumflexbelow", 0x1e77 , 0 },
+ { "ucyrillic", 0x0443 , 0 },
+ { "udattadeva", 0x0951 , 0 },
+ { "udblacute", 0x0171 , 0 },
+ { "udblgrave", 0x0215 , 0 },
+ { "udeva", 0x0909 , 0 },
+ { "udieresisacute", 0x01d8 , 0 },
+ { "udieresisbelow", 0x1e73 , 0 },
+ { "udieresiscaron", 0x01da , 0 },
+ { "udieresiscyrillic", 0x04f1 , 0 },
+ { "udieresisgrave", 0x01dc , 0 },
+ { "udieresismacron", 0x01d6 , 0 },
+ { "udotbelow", 0x1ee5 , 0 },
+ { "ugujarati", 0x0a89 , 0 },
+ { "ugurmukhi", 0x0a09 , 0 },
+ { "uhiragana", 0x3046 , 0 },
+ { "uhookabove", 0x1ee7 , 0 },
+ { "uhornacute", 0x1ee9 , 0 },
+ { "uhorndotbelow", 0x1ef1 , 0 },
+ { "uhorngrave", 0x1eeb , 0 },
+ { "uhornhookabove", 0x1eed , 0 },
+ { "uhorntilde", 0x1eef , 0 },
+ { "uhungarumlautcyrillic", 0x04f3 , 0 },
+ { "uinvertedbreve", 0x0217 , 0 },
+ { "ukatakana", 0x30a6 , 0 },
+ { "ukatakanahalfwidth", 0xff73 , 0 },
+ { "ukcyrillic", 0x0479 , 0 },
+ { "ukorean", 0x315c , 0 },
+ { "umacroncyrillic", 0x04ef , 0 },
+ { "umacrondieresis", 0x1e7b , 0 },
+ { "umatragurmukhi", 0x0a41 , 0 },
+ { "umonospace", 0xff55 , 0 },
+ { "underscoremonospace", 0xff3f , 0 },
+ { "underscorevertical", 0xfe33 , 0 },
+ { "underscorewavy", 0xfe4f , 0 },
+ { "uparen", 0x24b0 , 0 },
+ { "upperdothebrew", 0x05c4 , 0 },
+ { "upsilonlatin", 0x028a , 0 },
+ { "uptackbelowcmb", 0x031d , 0 },
+ { "uptackmod", 0x02d4 , 0 },
+ { "uragurmukhi", 0x0a73 , 0 },
+ { "ushortcyrillic", 0x045e , 0 },
+ { "usmallhiragana", 0x3045 , 0 },
+ { "usmallkatakana", 0x30a5 , 0 },
+ { "usmallkatakanahalfwidth", 0xff69 , 0 },
+ { "ustraightcyrillic", 0x04af , 0 },
+ { "ustraightstrokecyrillic", 0x04b1 , 0 },
+ { "utildeacute", 0x1e79 , 0 },
+ { "utildebelow", 0x1e75 , 0 },
+ { "uubengali", 0x098a , 0 },
+ { "uudeva", 0x090a , 0 },
+ { "uugujarati", 0x0a8a , 0 },
+ { "uugurmukhi", 0x0a0a , 0 },
+ { "uumatragurmukhi", 0x0a42 , 0 },
+ { "uuvowelsignbengali", 0x09c2 , 0 },
+ { "uuvowelsigndeva", 0x0942 , 0 },
+ { "uuvowelsigngujarati", 0x0ac2 , 0 },
+ { "uvowelsignbengali", 0x09c1 , 0 },
+ { "uvowelsigndeva", 0x0941 , 0 },
+ { "uvowelsigngujarati", 0x0ac1 , 0 },
+ { "vadeva", 0x0935 , 0 },
+ { "vagujarati", 0x0ab5 , 0 },
+ { "vagurmukhi", 0x0a35 , 0 },
+ { "vakatakana", 0x30f7 , 0 },
+ { "vav", 0x05d5 , 0 },
+ { "vavdagesh", 0xfb35 , 0 },
+ { "vavdagesh65", 0xfb35 , 0 },
+ { "vavdageshhebrew", 0xfb35 , 0 },
+ { "vavhebrew", 0x05d5 , 0 },
+ { "vavholam", 0xfb4b , 0 },
+ { "vavholamhebrew", 0xfb4b , 0 },
+ { "vavvavhebrew", 0x05f0 , 0 },
+ { "vavyodhebrew", 0x05f1 , 0 },
+ { "vcircle", 0x24e5 , 0 },
+ { "vdotbelow", 0x1e7f , 0 },
+ { "vecyrillic", 0x0432 , 0 },
+ { "veharabic", 0x06a4 , 0 },
+ { "vehfinalarabic", 0xfb6b , 0 },
+ { "vehinitialarabic", 0xfb6c , 0 },
+ { "vehmedialarabic", 0xfb6d , 0 },
+ { "vekatakana", 0x30f9 , 0 },
+ { "venus", 0x2640 , 0 },
+ { "verticalbar", 0x007c , 0 },
+ { "verticallineabovecmb", 0x030d , 0 },
+ { "verticallinebelowcmb", 0x0329 , 0 },
+ { "verticallinelowmod", 0x02cc , 0 },
+ { "verticallinemod", 0x02c8 , 0 },
+ { "vewarmenian", 0x057e , 0 },
+ { "vhook", 0x028b , 0 },
+ { "vikatakana", 0x30f8 , 0 },
+ { "viramabengali", 0x09cd , 0 },
+ { "viramadeva", 0x094d , 0 },
+ { "viramagujarati", 0x0acd , 0 },
+ { "visargabengali", 0x0983 , 0 },
+ { "visargadeva", 0x0903 , 0 },
+ { "visargagujarati", 0x0a83 , 0 },
+ { "vmonospace", 0xff56 , 0 },
+ { "voarmenian", 0x0578 , 0 },
+ { "voicediterationhiragana", 0x309e , 0 },
+ { "voicediterationkatakana", 0x30fe , 0 },
+ { "voicedmarkkana", 0x309b , 0 },
+ { "voicedmarkkanahalfwidth", 0xff9e , 0 },
+ { "vokatakana", 0x30fa , 0 },
+ { "vparen", 0x24b1 , 0 },
+ { "vtilde", 0x1e7d , 0 },
+ { "vturned", 0x028c , 0 },
+ { "vuhiragana", 0x3094 , 0 },
+ { "vukatakana", 0x30f4 , 0 },
+ { "waekorean", 0x3159 , 0 },
+ { "wahiragana", 0x308f , 0 },
+ { "wakatakana", 0x30ef , 0 },
+ { "wakatakanahalfwidth", 0xff9c , 0 },
+ { "wakorean", 0x3158 , 0 },
+ { "wasmallhiragana", 0x308e , 0 },
+ { "wasmallkatakana", 0x30ee , 0 },
+ { "wattosquare", 0x3357 , 0 },
+ { "wavedash", 0x301c , 0 },
+ { "wavyunderscorevertical", 0xfe34 , 0 },
+ { "wawarabic", 0x0648 , 0 },
+ { "wawfinalarabic", 0xfeee , 0 },
+ { "wawhamzaabovearabic", 0x0624 , 0 },
+ { "wawhamzaabovefinalarabic", 0xfe86 , 0 },
+ { "wbsquare", 0x33dd , 0 },
+ { "wcircle", 0x24e6 , 0 },
+ { "wdotaccent", 0x1e87 , 0 },
+ { "wdotbelow", 0x1e89 , 0 },
+ { "wehiragana", 0x3091 , 0 },
+ { "wekatakana", 0x30f1 , 0 },
+ { "wekorean", 0x315e , 0 },
+ { "weokorean", 0x315d , 0 },
+ { "whitebullet", 0x25e6 , 0 },
+ { "whitecircle", 0x25cb , 0 },
+ { "whitecircleinverse", 0x25d9 , 0 },
+ { "whitecornerbracketleft", 0x300e , 0 },
+ { "whitecornerbracketleftvertical", 0xfe43 , 0 },
+ { "whitecornerbracketright", 0x300f , 0 },
+ { "whitecornerbracketrightvertical", 0xfe44 , 0 },
+ { "whitediamond", 0x25c7 , 0 },
+ { "whitediamondcontainingblacksmalldiamond", 0x25c8 , 0 },
+ { "whitedownpointingsmalltriangle", 0x25bf , 0 },
+ { "whitedownpointingtriangle", 0x25bd , 0 },
+ { "whiteleftpointingsmalltriangle", 0x25c3 , 0 },
+ { "whiteleftpointingtriangle", 0x25c1 , 0 },
+ { "whitelenticularbracketleft", 0x3016 , 0 },
+ { "whitelenticularbracketright", 0x3017 , 0 },
+ { "whiterightpointingsmalltriangle", 0x25b9 , 0 },
+ { "whiterightpointingtriangle", 0x25b7 , 0 },
+ { "whitesmallsquare", 0x25ab , 0 },
+ { "whitesmilingface", 0x263a , 0 },
+ { "whitesquare", 0x25a1 , 0 },
+ { "whitestar", 0x2606 , 0 },
+ { "whitetelephone", 0x260f , 0 },
+ { "whitetortoiseshellbracketleft", 0x3018 , 0 },
+ { "whitetortoiseshellbracketright", 0x3019 , 0 },
+ { "whiteuppointingsmalltriangle", 0x25b5 , 0 },
+ { "whiteuppointingtriangle", 0x25b3 , 0 },
+ { "wihiragana", 0x3090 , 0 },
+ { "wikatakana", 0x30f0 , 0 },
+ { "wikorean", 0x315f , 0 },
+ { "wmonospace", 0xff57 , 0 },
+ { "wohiragana", 0x3092 , 0 },
+ { "wokatakana", 0x30f2 , 0 },
+ { "wokatakanahalfwidth", 0xff66 , 0 },
+ { "won", 0x20a9 , 0 },
+ { "wonmonospace", 0xffe6 , 0 },
+ { "wowaenthai", 0x0e27 , 0 },
+ { "wparen", 0x24b2 , 0 },
+ { "wring", 0x1e98 , 0 },
+ { "wsuperior", 0x02b7 , 0 },
+ { "wturned", 0x028d , 0 },
+ { "wynn", 0x01bf , 0 },
+ { "xabovecmb", 0x033d , 0 },
+ { "xbopomofo", 0x3112 , 0 },
+ { "xcircle", 0x24e7 , 0 },
+ { "xdieresis", 0x1e8d , 0 },
+ { "xdotaccent", 0x1e8b , 0 },
+ { "xeharmenian", 0x056d , 0 },
+ { "xmonospace", 0xff58 , 0 },
+ { "xparen", 0x24b3 , 0 },
+ { "xsuperior", 0x02e3 , 0 },
+ { "yaadosquare", 0x334e , 0 },
+ { "yabengali", 0x09af , 0 },
+ { "yadeva", 0x092f , 0 },
+ { "yaekorean", 0x3152 , 0 },
+ { "yagujarati", 0x0aaf , 0 },
+ { "yagurmukhi", 0x0a2f , 0 },
+ { "yahiragana", 0x3084 , 0 },
+ { "yakatakana", 0x30e4 , 0 },
+ { "yakatakanahalfwidth", 0xff94 , 0 },
+ { "yakorean", 0x3151 , 0 },
+ { "yamakkanthai", 0x0e4e , 0 },
+ { "yasmallhiragana", 0x3083 , 0 },
+ { "yasmallkatakana", 0x30e3 , 0 },
+ { "yasmallkatakanahalfwidth", 0xff6c , 0 },
+ { "yatcyrillic", 0x0463 , 0 },
+ { "ycircle", 0x24e8 , 0 },
+ { "ydotaccent", 0x1e8f , 0 },
+ { "ydotbelow", 0x1ef5 , 0 },
+ { "yeharabic", 0x064a , 0 },
+ { "yehbarreearabic", 0x06d2 , 0 },
+ { "yehbarreefinalarabic", 0xfbaf , 0 },
+ { "yehfinalarabic", 0xfef2 , 0 },
+ { "yehhamzaabovearabic", 0x0626 , 0 },
+ { "yehhamzaabovefinalarabic", 0xfe8a , 0 },
+ { "yehhamzaaboveinitialarabic", 0xfe8b , 0 },
+ { "yehhamzaabovemedialarabic", 0xfe8c , 0 },
+ { "yehinitialarabic", 0xfef3 , 0 },
+ { "yehmedialarabic", 0xfef4 , 0 },
+ { "yehmeeminitialarabic", 0xfcdd , 0 },
+ { "yehmeemisolatedarabic", 0xfc58 , 0 },
+ { "yehnoonfinalarabic", 0xfc94 , 0 },
+ { "yehthreedotsbelowarabic", 0x06d1 , 0 },
+ { "yekorean", 0x3156 , 0 },
+ { "yenmonospace", 0xffe5 , 0 },
+ { "yeokorean", 0x3155 , 0 },
+ { "yeorinhieuhkorean", 0x3186 , 0 },
+ { "yerahbenyomohebrew", 0x05aa , 0 },
+ { "yerahbenyomolefthebrew", 0x05aa , 0 },
+ { "yericyrillic", 0x044b , 0 },
+ { "yerudieresiscyrillic", 0x04f9 , 0 },
+ { "yesieungkorean", 0x3181 , 0 },
+ { "yesieungpansioskorean", 0x3183 , 0 },
+ { "yesieungsioskorean", 0x3182 , 0 },
+ { "yetivhebrew", 0x059a , 0 },
+ { "yhook", 0x01b4 , 0 },
+ { "yhookabove", 0x1ef7 , 0 },
+ { "yiarmenian", 0x0575 , 0 },
+ { "yicyrillic", 0x0457 , 0 },
+ { "yikorean", 0x3162 , 0 },
+ { "yinyang", 0x262f , 0 },
+ { "yiwnarmenian", 0x0582 , 0 },
+ { "ymonospace", 0xff59 , 0 },
+ { "yod", 0x05d9 , 0 },
+ { "yoddagesh", 0xfb39 , 0 },
+ { "yoddageshhebrew", 0xfb39 , 0 },
+ { "yodhebrew", 0x05d9 , 0 },
+ { "yodyodhebrew", 0x05f2 , 0 },
+ { "yodyodpatahhebrew", 0xfb1f , 0 },
+ { "yohiragana", 0x3088 , 0 },
+ { "yoikorean", 0x3189 , 0 },
+ { "yokatakana", 0x30e8 , 0 },
+ { "yokatakanahalfwidth", 0xff96 , 0 },
+ { "yokorean", 0x315b , 0 },
+ { "yosmallhiragana", 0x3087 , 0 },
+ { "yosmallkatakana", 0x30e7 , 0 },
+ { "yosmallkatakanahalfwidth", 0xff6e , 0 },
+ { "yotgreek", 0x03f3 , 0 },
+ { "yoyaekorean", 0x3188 , 0 },
+ { "yoyakorean", 0x3187 , 0 },
+ { "yoyakthai", 0x0e22 , 0 },
+ { "yoyingthai", 0x0e0d , 0 },
+ { "yparen", 0x24b4 , 0 },
+ { "ypogegrammeni", 0x037a , 0 },
+ { "ypogegrammenigreekcmb", 0x0345 , 0 },
+ { "yr", 0x01a6 , 0 },
+ { "yring", 0x1e99 , 0 },
+ { "ysuperior", 0x02b8 , 0 },
+ { "ytilde", 0x1ef9 , 0 },
+ { "yturned", 0x028e , 0 },
+ { "yuhiragana", 0x3086 , 0 },
+ { "yuikorean", 0x318c , 0 },
+ { "yukatakana", 0x30e6 , 0 },
+ { "yukatakanahalfwidth", 0xff95 , 0 },
+ { "yukorean", 0x3160 , 0 },
+ { "yusbigcyrillic", 0x046b , 0 },
+ { "yusbigiotifiedcyrillic", 0x046d , 0 },
+ { "yuslittlecyrillic", 0x0467 , 0 },
+ { "yuslittleiotifiedcyrillic", 0x0469 , 0 },
+ { "yusmallhiragana", 0x3085 , 0 },
+ { "yusmallkatakana", 0x30e5 , 0 },
+ { "yusmallkatakanahalfwidth", 0xff6d , 0 },
+ { "yuyekorean", 0x318b , 0 },
+ { "yuyeokorean", 0x318a , 0 },
+ { "yyabengali", 0x09df , 0 },
+ { "yyadeva", 0x095f , 0 },
+ { "zaarmenian", 0x0566 , 0 },
+ { "zadeva", 0x095b , 0 },
+ { "zagurmukhi", 0x0a5b , 0 },
+ { "zaharabic", 0x0638 , 0 },
+ { "zahfinalarabic", 0xfec6 , 0 },
+ { "zahinitialarabic", 0xfec7 , 0 },
+ { "zahiragana", 0x3056 , 0 },
+ { "zahmedialarabic", 0xfec8 , 0 },
+ { "zainarabic", 0x0632 , 0 },
+ { "zainfinalarabic", 0xfeb0 , 0 },
+ { "zakatakana", 0x30b6 , 0 },
+ { "zaqefgadolhebrew", 0x0595 , 0 },
+ { "zaqefqatanhebrew", 0x0594 , 0 },
+ { "zarqahebrew", 0x0598 , 0 },
+ { "zayin", 0x05d6 , 0 },
+ { "zayindagesh", 0xfb36 , 0 },
+ { "zayindageshhebrew", 0xfb36 , 0 },
+ { "zayinhebrew", 0x05d6 , 0 },
+ { "zbopomofo", 0x3117 , 0 },
+ { "zcircle", 0x24e9 , 0 },
+ { "zcircumflex", 0x1e91 , 0 },
+ { "zcurl", 0x0291 , 0 },
+ { "zdot", 0x017c , 0 },
+ { "zdotbelow", 0x1e93 , 0 },
+ { "zecyrillic", 0x0437 , 0 },
+ { "zedescendercyrillic", 0x0499 , 0 },
+ { "zedieresiscyrillic", 0x04df , 0 },
+ { "zehiragana", 0x305c , 0 },
+ { "zekatakana", 0x30bc , 0 },
+ { "zeroarabic", 0x0660 , 0 },
+ { "zerobengali", 0x09e6 , 0 },
+ { "zerodeva", 0x0966 , 0 },
+ { "zerogujarati", 0x0ae6 , 0 },
+ { "zerogurmukhi", 0x0a66 , 0 },
+ { "zerohackarabic", 0x0660 , 0 },
+ { "zeroinferior", 0x2080 , 0 },
+ { "zeromonospace", 0xff10 , 0 },
+ { "zerooldstyle", 0xf730 , 0 },
+ { "zeropersian", 0x06f0 , 0 },
+ { "zerosuperior", 0x2070 , 0 },
+ { "zerothai", 0x0e50 , 0 },
+ { "zerowidthjoiner", 0xfeff , 0 },
+ { "zerowidthnonjoiner", 0x200c , 0 },
+ { "zerowidthspace", 0x200b , 0 },
+ { "zhbopomofo", 0x3113 , 0 },
+ { "zhearmenian", 0x056a , 0 },
+ { "zhebrevecyrillic", 0x04c2 , 0 },
+ { "zhecyrillic", 0x0436 , 0 },
+ { "zhedescendercyrillic", 0x0497 , 0 },
+ { "zhedieresiscyrillic", 0x04dd , 0 },
+ { "zihiragana", 0x3058 , 0 },
+ { "zikatakana", 0x30b8 , 0 },
+ { "zinorhebrew", 0x05ae , 0 },
+ { "zlinebelow", 0x1e95 , 0 },
+ { "zmonospace", 0xff5a , 0 },
+ { "zohiragana", 0x305e , 0 },
+ { "zokatakana", 0x30be , 0 },
+ { "zparen", 0x24b5 , 0 },
+ { "zretroflexhook", 0x0290 , 0 },
+ { "zstroke", 0x01b6 , 0 },
+ { "zuhiragana", 0x305a , 0 },
+ { "zukatakana", 0x30ba , 0 },
+ { "dotaccent.cap", 0xefed , 0 },
+ { "breve.cap", 0xefee , 0 },
+ { "ogonek.cap", 0xeff1 , 0 },
+ { "cedilla.cap", 0xeff2 , 0 },
+ { "ring.cap", 0xeff3 , 0 },
+ { "tilde.cap", 0xeff5 , 0 },
+ { "circumflex.cap", 0xeff7 , 0 },
+ { "a1", 0x2701 , 0 },
+ { "a2", 0x2702 , 0 },
+ { "a202", 0x2703 , 0 },
+ { "a3", 0x2704 , 0 },
+ { "a4", 0x260e , 0 },
+ { "a5", 0x2706 , 0 },
+ { "a119", 0x2707 , 0 },
+ { "a118", 0x2708 , 0 },
+ { "a117", 0x2709 , 0 },
+ { "a11", 0x261b , 0 },
+ { "a12", 0x261e , 0 },
+ { "a13", 0x270c , 0 },
+ { "a14", 0x270d , 0 },
+ { "a15", 0x270e , 0 },
+ { "a16", 0x270f , 0 },
+ { "a105", 0x2710 , 0 },
+ { "a17", 0x2711 , 0 },
+ { "a18", 0x2712 , 0 },
+ { "a19", 0x2713 , 0 },
+ { "a20", 0x2714 , 0 },
+ { "a21", 0x2715 , 0 },
+ { "a22", 0x2716 , 0 },
+ { "a23", 0x2717 , 0 },
+ { "a24", 0x2718 , 0 },
+ { "a25", 0x2719 , 0 },
+ { "a26", 0x271a , 0 },
+ { "a27", 0x271b , 0 },
+ { "a28", 0x271c , 0 },
+ { "a6", 0x271d , 0 },
+ { "a7", 0x271e , 0 },
+ { "a8", 0x271f , 0 },
+ { "a9", 0x2720 , 0 },
+ { "a10", 0x2721 , 0 },
+ { "a29", 0x2722 , 0 },
+ { "a30", 0x2723 , 0 },
+ { "a31", 0x2724 , 0 },
+ { "a32", 0x2725 , 0 },
+ { "a33", 0x2726 , 0 },
+ { "a34", 0x2727 , 0 },
+ { "a35", 0x2605 , 0 },
+ { "a36", 0x2729 , 0 },
+ { "a37", 0x272a , 0 },
+ { "a38", 0x272b , 0 },
+ { "a39", 0x272c , 0 },
+ { "a40", 0x272d , 0 },
+ { "a41", 0x272e , 0 },
+ { "a42", 0x272f , 0 },
+ { "a43", 0x2730 , 0 },
+ { "a44", 0x2731 , 0 },
+ { "a45", 0x2732 , 0 },
+ { "a46", 0x2733 , 0 },
+ { "a47", 0x2734 , 0 },
+ { "a48", 0x2735 , 0 },
+ { "a49", 0x2736 , 0 },
+ { "a50", 0x2737 , 0 },
+ { "a51", 0x2738 , 0 },
+ { "a52", 0x2739 , 0 },
+ { "a53", 0x273a , 0 },
+ { "a54", 0x273b , 0 },
+ { "a55", 0x273c , 0 },
+ { "a56", 0x273d , 0 },
+ { "a57", 0x273e , 0 },
+ { "a58", 0x273f , 0 },
+ { "a59", 0x2740 , 0 },
+ { "a60", 0x2741 , 0 },
+ { "a61", 0x2742 , 0 },
+ { "a62", 0x2743 , 0 },
+ { "a63", 0x2744 , 0 },
+ { "a64", 0x2745 , 0 },
+ { "a65", 0x2746 , 0 },
+ { "a66", 0x2747 , 0 },
+ { "a67", 0x2748 , 0 },
+ { "a68", 0x2749 , 0 },
+ { "a69", 0x274a , 0 },
+ { "a70", 0x274b , 0 },
+ { "a71", 0x25cf , 0 },
+ { "a72", 0x274d , 0 },
+ { "a73", 0x25a0 , 0 },
+ { "a74", 0x274f , 0 },
+ { "a203", 0x2750 , 0 },
+ { "a75", 0x2751 , 0 },
+ { "a204", 0x2752 , 0 },
+ { "a76", 0x25b2 , 0 },
+ { "a77", 0x25bc , 0 },
+ { "a78", 0x25c6 , 0 },
+ { "a79", 0x2756 , 0 },
+ { "a81", 0x25d7 , 0 },
+ { "a82", 0x2758 , 0 },
+ { "a83", 0x2759 , 0 },
+ { "a84", 0x275a , 0 },
+ { "a97", 0x275b , 0 },
+ { "a98", 0x275c , 0 },
+ { "a99", 0x275d , 0 },
+ { "a100", 0x275e , 0 },
+ { "a89", 0x2768 , 0 },
+ { "a90", 0x2769 , 0 },
+ { "a93", 0x276a , 0 },
+ { "a94", 0x276b , 0 },
+ { "a91", 0x276c , 0 },
+ { "a92", 0x276d , 0 },
+ { "a205", 0x276e , 0 },
+ { "a85", 0x276f , 0 },
+ { "a206", 0x2770 , 0 },
+ { "a86", 0x2771 , 0 },
+ { "a87", 0x2772 , 0 },
+ { "a88", 0x2773 , 0 },
+ { "a95", 0x2774 , 0 },
+ { "a96", 0x2775 , 0 },
+ { "a101", 0x2761 , 0 },
+ { "a102", 0x2762 , 0 },
+ { "a103", 0x2763 , 0 },
+ { "a104", 0x2764 , 0 },
+ { "a106", 0x2765 , 0 },
+ { "a107", 0x2766 , 0 },
+ { "a108", 0x2767 , 0 },
+ { "a112", 0x2663 , 0 },
+ { "a111", 0x2666 , 0 },
+ { "a110", 0x2665 , 0 },
+ { "a109", 0x2660 , 0 },
+ { "a120", 0x2460 , 0 },
+ { "a121", 0x2461 , 0 },
+ { "a122", 0x2462 , 0 },
+ { "a123", 0x2463 , 0 },
+ { "a124", 0x2464 , 0 },
+ { "a125", 0x2465 , 0 },
+ { "a126", 0x2466 , 0 },
+ { "a127", 0x2467 , 0 },
+ { "a128", 0x2468 , 0 },
+ { "a129", 0x2469 , 0 },
+ { "a130", 0x2776 , 0 },
+ { "a131", 0x2777 , 0 },
+ { "a132", 0x2778 , 0 },
+ { "a133", 0x2779 , 0 },
+ { "a134", 0x277a , 0 },
+ { "a135", 0x277b , 0 },
+ { "a136", 0x277c , 0 },
+ { "a137", 0x277d , 0 },
+ { "a138", 0x277e , 0 },
+ { "a139", 0x277f , 0 },
+ { "a140", 0x2780 , 0 },
+ { "a141", 0x2781 , 0 },
+ { "a142", 0x2782 , 0 },
+ { "a143", 0x2783 , 0 },
+ { "a144", 0x2784 , 0 },
+ { "a145", 0x2785 , 0 },
+ { "a146", 0x2786 , 0 },
+ { "a147", 0x2787 , 0 },
+ { "a148", 0x2788 , 0 },
+ { "a149", 0x2789 , 0 },
+ { "a150", 0x278a , 0 },
+ { "a151", 0x278b , 0 },
+ { "a152", 0x278c , 0 },
+ { "a153", 0x278d , 0 },
+ { "a154", 0x278e , 0 },
+ { "a155", 0x278f , 0 },
+ { "a156", 0x2790 , 0 },
+ { "a157", 0x2791 , 0 },
+ { "a158", 0x2792 , 0 },
+ { "a159", 0x2793 , 0 },
+ { "a160", 0x2794 , 0 },
+ { "a161", 0x2192 , 0 },
+ { "a163", 0x2194 , 0 },
+ { "a164", 0x2195 , 0 },
+ { "a196", 0x2798 , 0 },
+ { "a165", 0x2799 , 0 },
+ { "a192", 0x279a , 0 },
+ { "a166", 0x279b , 0 },
+ { "a167", 0x279c , 0 },
+ { "a168", 0x279d , 0 },
+ { "a169", 0x279e , 0 },
+ { "a170", 0x279f , 0 },
+ { "a171", 0x27a0 , 0 },
+ { "a172", 0x27a1 , 0 },
+ { "a173", 0x27a2 , 0 },
+ { "a162", 0x27a3 , 0 },
+ { "a174", 0x27a4 , 0 },
+ { "a175", 0x27a5 , 0 },
+ { "a176", 0x27a6 , 0 },
+ { "a177", 0x27a7 , 0 },
+ { "a178", 0x27a8 , 0 },
+ { "a179", 0x27a9 , 0 },
+ { "a193", 0x27aa , 0 },
+ { "a180", 0x27ab , 0 },
+ { "a199", 0x27ac , 0 },
+ { "a181", 0x27ad , 0 },
+ { "a200", 0x27ae , 0 },
+ { "a182", 0x27af , 0 },
+ { "a201", 0x27b1 , 0 },
+ { "a183", 0x27b2 , 0 },
+ { "a184", 0x27b3 , 0 },
+ { "a197", 0x27b4 , 0 },
+ { "a185", 0x27b5 , 0 },
+ { "a194", 0x27b6 , 0 },
+ { "a198", 0x27b7 , 0 },
+ { "a186", 0x27b8 , 0 },
+ { "a195", 0x27b9 , 0 },
+ { "a187", 0x27ba , 0 },
+ { "a188", 0x27bb , 0 },
+ { "a189", 0x27bc , 0 },
+ { "a190", 0x27bd , 0 },
+ { "a191", 0x27be , 0 },
+ { "register.sans", 0xf8e8 , 0 },
+ { "register.serif", 0xf6da , 0 },
+ { "one.superior", 0x00b9 , 0 },
+ { "two.superior", 0x00b2 , 0 },
+ { "three.superior", 0x00b3 , 0 },
+ { "parenleft.superior", 0x207d , 0 },
+ { "parenright.superior", 0x207e , 0 },
+ { "n.superior", 0x207f , 0 },
+ { "parenleft.inferior", 0x208d , 0 },
+ { "parenright.inferior", 0x208e , 0 },
+ { "zero.superior", 0x2070 , 0 },
+ { "four.superior", 0x2074 , 0 },
+ { "five.superior", 0x2075 , 0 },
+ { "six.superior", 0x2076 , 0 },
+ { "seven.superior", 0x2077 , 0 },
+ { "eight.superior", 0x2078 , 0 },
+ { "nine.superior", 0x2079 , 0 },
+ { "zero.inferior", 0x2080 , 0 },
+ { "one.inferior", 0x2081 , 0 },
+ { "two.inferior", 0x2082 , 0 },
+ { "three.inferior", 0x2083 , 0 },
+ { "four.inferior", 0x2084 , 0 },
+ { "five.inferior", 0x2085 , 0 },
+ { "six.inferior", 0x2086 , 0 },
+ { "seven.inferior", 0x2087 , 0 },
+ { "eight.inferior", 0x2088 , 0 },
+ { "nine.inferior", 0x2089 , 0 },
+ { "mu.greek", 0x03bc , 0 },
+ { "Delta.greek", 0x0394 , 0 },
+ { "Omega.greek", 0x03a9 , 0 },
+ { "sigma.end", 0x03c2 , 0 },
+ { "beta.alt", 0x03d0 , 0 },
+ { "kappa.alt", 0x03f0 , 0 },
+ { "theta.alt", 0x03d1 , 0 },
+ { "Upsilon.alt", 0x03d2 , 0 },
+ { "phi.alt", 0x03d5 , 0 },
+ { "pi.alt", 0x03d6 , 0 },
+ { "A.cyr", 0x0410 , 0 },
+ { "Ghe.up", 0x0490 , 0 },
+ { "I.cyr", 0x0418 , 0 },
+ { "I.short", 0x0419 , 0 },
+ { "O.cyr", 0x041e , 0 },
+ { "U.cyr", 0x0423 , 0 },
+ { "E.cyr", 0x042d , 0 },
+ { "Ie.ukran", 0x0404 , 0 },
+ { "I.ukran", 0x0406 , 0 },
+ { "U.short", 0x040e , 0 },
+ { "a.cyr", 0x0430 , 0 },
+ { "ghe.up", 0x0491 , 0 },
+ { "i.cyr", 0x0438 , 0 },
+ { "i.short", 0x0439 , 0 },
+ { "o.cyr", 0x043e , 0 },
+ { "u.cyr", 0x0443 , 0 },
+ { "e.cyr", 0x044d , 0 },
+ { "ie.ukran", 0x0454 , 0 },
+ { "i.ukran", 0x0456 , 0 },
+ { "u.short", 0x045e , 0 },
+ { "ghe.ital", 0xf6c4 , 0 },
+ { "afii10068.ital", 0xf6c4 , 0 },
+ { "afii10066.ital", 0xf6c5 , 0 },
+ { "be.alt", 0xf6c5 , 0 },
+ { "afii10069.ital", 0xf6c6 , 0 },
+ { "de.ital", 0xf6c6 , 0 },
+ { "afii10081.ital", 0xf6c7 , 0 },
+ { "pe.ital", 0xf6c7 , 0 },
+ { "afii10084.ital", 0xf6c8 , 0 },
+ { "te.ital", 0xf6c8 , 0 },
+ { "Omega.math", 0x2126 , 0 },
+ { "Delta.math", 0x2206 , 0 },
+ { "afii57689_afii57804", 0xfb2a , 0 },
+ { "afii57689_afii57803", 0xfb2b , 0 },
+ { "afii57669_afii57806", 0xfb4b , 0 },
+ { "afii57718_afii57798", 0xfb1f , 0 },
+ { "afii57669_afii57807", 0xfb35 , 0 },
+ { ".null", 0x0000 , 0 },
+ { "dialytika_perispomeni", 0x1fc1 , 0 },
+ { "psili_varia", 0x1fcd , 0 },
+ { "psili_oxia", 0x1fce , 0 },
+ { "psili_perispomeni", 0x1fcf , 0 },
+ { "dasia_varia", 0x1fdd , 0 },
+ { "dasia_oxia", 0x1fde , 0 },
+ { "dasia_perispomeni", 0x1fdf , 0 },
+ { "dialytika_varia", 0x1fed , 0 },
+ { "dialytika_oxia", 0x1fee , 0 },
+ { "Alphaacute", 0x1fbb , 0 },
+ { "Alphaasper", 0x1f09 , 0 },
+ { "Alphaasperacute", 0x1f0d , 0 },
+ { "Alphaaspergrave", 0x1f0b , 0 },
+ { "Alphaaspertilde", 0x1f0f , 0 },
+ { "Alphabreve", 0x1fb8 , 0 },
+ { "Alphagrave", 0x1fba , 0 },
+ { "Alphaiotasub", 0x1fbc , 0 },
+ { "Alphaiotasubasper", 0x1f89 , 0 },
+ { "Alphaiotasubasperacute", 0x1f8d , 0 },
+ { "Alphaiotasubaspergrave", 0x1f8b , 0 },
+ { "Alphaiotasubaspertilde", 0x1f8f , 0 },
+ { "Alphaiotasublenis", 0x1f88 , 0 },
+ { "Alphaiotasublenisacute", 0x1f8c , 0 },
+ { "Alphaiotasublenisgrave", 0x1f8a , 0 },
+ { "Alphaiotasublenistilde", 0x1f8e , 0 },
+ { "Alphalenis", 0x1f08 , 0 },
+ { "Alphalenisacute", 0x1f0c , 0 },
+ { "Alphalenisgrave", 0x1f0a , 0 },
+ { "Alphalenistilde", 0x1f0e , 0 },
+ { "Alphamacron", 0x1fb9 , 0 },
+ { "Epsilonacute", 0x1fc9 , 0 },
+ { "Epsilonasper", 0x1f19 , 0 },
+ { "Epsilonasperacute", 0x1f1d , 0 },
+ { "Epsilonaspergrave", 0x1f1b , 0 },
+ { "Epsilongrave", 0x1fc8 , 0 },
+ { "Epsilonlenis", 0x1f18 , 0 },
+ { "Epsilonlenisacute", 0x1f1c , 0 },
+ { "Epsilonlenisgrave", 0x1f1a , 0 },
+ { "Etaacute", 0x1fcb , 0 },
+ { "Etaasper", 0x1f29 , 0 },
+ { "Etaasperacute", 0x1f2d , 0 },
+ { "Etaaspergrave", 0x1f2b , 0 },
+ { "Etaaspertilde", 0x1f2f , 0 },
+ { "Etagrave", 0x1fca , 0 },
+ { "Etaiotasub", 0x1fcc , 0 },
+ { "Etaiotasubasper", 0x1f99 , 0 },
+ { "Etaiotasubasperacute", 0x1f9d , 0 },
+ { "Etaiotasubaspergrave", 0x1f9b , 0 },
+ { "Etaiotasubaspertilde", 0x1f9f , 0 },
+ { "Etaiotasublenis", 0x1f98 , 0 },
+ { "Etaiotasublenisacute", 0x1f9c , 0 },
+ { "Etaiotasublenisgrave", 0x1f9a , 0 },
+ { "Etaiotasublenistilde", 0x1f9e , 0 },
+ { "Etalenis", 0x1f28 , 0 },
+ { "Etalenisacute", 0x1f2c , 0 },
+ { "Etalenisgrave", 0x1f2a , 0 },
+ { "Etalenistilde", 0x1f2e , 0 },
+ { "Iotaacute", 0x1fdb , 0 },
+ { "Iotaasper", 0x1f39 , 0 },
+ { "Iotaasperacute", 0x1f3d , 0 },
+ { "Iotaaspergrave", 0x1f3b , 0 },
+ { "Iotaaspertilde", 0x1f3f , 0 },
+ { "Iotabreve", 0x1fd8 , 0 },
+ { "Iotagrave", 0x1fda , 0 },
+ { "Iotalenis", 0x1f38 , 0 },
+ { "Iotalenisacute", 0x1f3c , 0 },
+ { "Iotalenisgrave", 0x1f3a , 0 },
+ { "Iotalenistilde", 0x1f3e , 0 },
+ { "Iotamacron", 0x1fd9 , 0 },
+ { "Omegaacute", 0x1ffb , 0 },
+ { "Omegaasper", 0x1f69 , 0 },
+ { "Omegaasperacute", 0x1f6d , 0 },
+ { "Omegaaspergrave", 0x1f6b , 0 },
+ { "Omegaaspertilde", 0x1f6f , 0 },
+ { "Omegagrave", 0x1ffa , 0 },
+ { "Omegaiotasub", 0x1ffc , 0 },
+ { "Omegaiotasubasper", 0x1fa9 , 0 },
+ { "Omegaiotasubasperacute", 0x1fad , 0 },
+ { "Omegaiotasubaspergrave", 0x1fab , 0 },
+ { "Omegaiotasubaspertilde", 0x1faf , 0 },
+ { "Omegaiotasublenis", 0x1fa8 , 0 },
+ { "Omegaiotasublenisacute", 0x1fac , 0 },
+ { "Omegaiotasublenisgrave", 0x1faa , 0 },
+ { "Omegaiotasublenistilde", 0x1fae , 0 },
+ { "Omegalenis", 0x1f68 , 0 },
+ { "Omegalenisacute", 0x1f6c , 0 },
+ { "Omegalenisgrave", 0x1f6a , 0 },
+ { "Omegalenistilde", 0x1f6e , 0 },
+ { "Omicronacute", 0x1ff9 , 0 },
+ { "Omicronasper", 0x1f49 , 0 },
+ { "Omicronasperacute", 0x1f4d , 0 },
+ { "Omicronaspergrave", 0x1f4b , 0 },
+ { "Omicrongrave", 0x1ff8 , 0 },
+ { "Omicronlenis", 0x1f48 , 0 },
+ { "Omicronlenisacute", 0x1f4c , 0 },
+ { "Omicronlenisgrave", 0x1f4a , 0 },
+ { "Rhoasper", 0x1fec , 0 },
+ { "Upsilonacute", 0x1feb , 0 },
+ { "Upsilonasper", 0x1f59 , 0 },
+ { "Upsilonasperacute", 0x1f5d , 0 },
+ { "Upsilonaspergrave", 0x1f5b , 0 },
+ { "Upsilonaspertilde", 0x1f5f , 0 },
+ { "Upsilonbreve", 0x1fe8 , 0 },
+ { "Upsilongrave", 0x1fea , 0 },
+ { "Upsilonmacron", 0x1fe9 , 0 },
+ { "numeralsign", 0x0374 , 0 },
+ { "lownumeralsign", 0x0375 , 0 },
+ { "lowcomma", 0x037a , 0 },
+ { "stigma", 0x03da , 0 },
+ { "koppa", 0x03de , 0 },
+ { "sampi", 0x03e0 , 0 },
+ { "lenis", 0x1fbd , 0 },
+ { "iotasubscript", 0x1fbe , 0 },
+ { "dieresistilde", 0x1fc1 , 0 },
+ { "lenisgrave", 0x1fcd , 0 },
+ { "lenisacute", 0x1fce , 0 },
+ { "lenistilde", 0x1fcf , 0 },
+ { "aspergrave", 0x1fdd , 0 },
+ { "asperacute", 0x1fde , 0 },
+ { "aspertilde", 0x1fdf , 0 },
+ { "dialytikagrave", 0x1fed , 0 },
+ { "dialytikaacute", 0x1fee , 0 },
+ { "asper", 0x1ffe , 0 },
+ { "alphalenis", 0x1f00 , 0 },
+ { "alphaasper", 0x1f01 , 0 },
+ { "alphalenisgrave", 0x1f02 , 0 },
+ { "alphaaspergrave", 0x1f03 , 0 },
+ { "alphalenisacute", 0x1f04 , 0 },
+ { "alphaasperacute", 0x1f05 , 0 },
+ { "alphalenistilde", 0x1f06 , 0 },
+ { "alphaaspertilde", 0x1f07 , 0 },
+ { "epsilonlenis", 0x1f10 , 0 },
+ { "epsilonasper", 0x1f11 , 0 },
+ { "epsilonlenisgrave", 0x1f12 , 0 },
+ { "epsilonaspergrave", 0x1f13 , 0 },
+ { "epsilonlenisacute", 0x1f14 , 0 },
+ { "epsilonasperacute", 0x1f15 , 0 },
+ { "etalenis", 0x1f20 , 0 },
+ { "etaasper", 0x1f21 , 0 },
+ { "etalenisgrave", 0x1f22 , 0 },
+ { "etaaspergrave", 0x1f23 , 0 },
+ { "etalenisacute", 0x1f24 , 0 },
+ { "etaasperacute", 0x1f25 , 0 },
+ { "etalenistilde", 0x1f26 , 0 },
+ { "etaaspertilde", 0x1f27 , 0 },
+ { "iotalenis", 0x1f30 , 0 },
+ { "iotaasper", 0x1f31 , 0 },
+ { "iotalenisgrave", 0x1f32 , 0 },
+ { "iotaaspergrave", 0x1f33 , 0 },
+ { "iotalenisacute", 0x1f34 , 0 },
+ { "iotaasperacute", 0x1f35 , 0 },
+ { "iotalenistilde", 0x1f36 , 0 },
+ { "iotaaspertilde", 0x1f37 , 0 },
+ { "omicronlenis", 0x1f40 , 0 },
+ { "omicronasper", 0x1f41 , 0 },
+ { "omicronlenisgrave", 0x1f42 , 0 },
+ { "omicronaspergrave", 0x1f43 , 0 },
+ { "omicronlenisacute", 0x1f44 , 0 },
+ { "omicronasperacute", 0x1f45 , 0 },
+ { "upsilonlenis", 0x1f50 , 0 },
+ { "upsilonasper", 0x1f51 , 0 },
+ { "upsilonlenisgrave", 0x1f52 , 0 },
+ { "upsilonaspergrave", 0x1f53 , 0 },
+ { "upsilonlenisacute", 0x1f54 , 0 },
+ { "upsilonasperacute", 0x1f55 , 0 },
+ { "upsilonlenistilde", 0x1f56 , 0 },
+ { "upsilonaspertilde", 0x1f57 , 0 },
+ { "omegalenis", 0x1f60 , 0 },
+ { "omegaasper", 0x1f61 , 0 },
+ { "omegalenisgrave", 0x1f62 , 0 },
+ { "omegaaspergrave", 0x1f63 , 0 },
+ { "omegalenisacute", 0x1f64 , 0 },
+ { "omegaasperacute", 0x1f65 , 0 },
+ { "omegalenistilde", 0x1f66 , 0 },
+ { "omegaaspertilde", 0x1f67 , 0 },
+ { "alphagrave", 0x1f70 , 0 },
+ { "alphaacute", 0x1f71 , 0 },
+ { "epsilongrave", 0x1f72 , 0 },
+ { "epsilonacute", 0x1f73 , 0 },
+ { "etagrave", 0x1f74 , 0 },
+ { "etaacute", 0x1f75 , 0 },
+ { "iotagrave", 0x1f76 , 0 },
+ { "iotaacute", 0x1f77 , 0 },
+ { "omicrongrave", 0x1f78 , 0 },
+ { "omicronacute", 0x1f79 , 0 },
+ { "upsilongrave", 0x1f7a , 0 },
+ { "upsilonacute", 0x1f7b , 0 },
+ { "omegagrave", 0x1f7c , 0 },
+ { "omegaacute", 0x1f7d , 0 },
+ { "alphaiotasublenis", 0x1f80 , 0 },
+ { "alphaiotasubasper", 0x1f81 , 0 },
+ { "alphaiotasublenisgrave", 0x1f82 , 0 },
+ { "alphaiotasubaspergrave", 0x1f83 , 0 },
+ { "alphaiotasublenisacute", 0x1f84 , 0 },
+ { "alphaiotasubasperacute", 0x1f85 , 0 },
+ { "alphaiotasublenistilde", 0x1f86 , 0 },
+ { "alphaiotasubaspertilde", 0x1f87 , 0 },
+ { "etaiotasublenis", 0x1f90 , 0 },
+ { "etaiotasubasper", 0x1f91 , 0 },
+ { "etaiotasublenisgrave", 0x1f92 , 0 },
+ { "etaiotasubaspergrave", 0x1f93 , 0 },
+ { "etaiotasublenisacute", 0x1f94 , 0 },
+ { "etaiotasubasperacute", 0x1f95 , 0 },
+ { "etaiotasublenistilde", 0x1f96 , 0 },
+ { "etaiotasubaspertilde", 0x1f97 , 0 },
+ { "omegaiotasublenis", 0x1fa0 , 0 },
+ { "omegaiotasubasper", 0x1fa1 , 0 },
+ { "omegaiotasublenisgrave", 0x1fa2 , 0 },
+ { "omegaiotasubaspergrave", 0x1fa3 , 0 },
+ { "omegaiotasublenisacute", 0x1fa4 , 0 },
+ { "omegaiotasubasperacute", 0x1fa5 , 0 },
+ { "omegaiotasublenistilde", 0x1fa6 , 0 },
+ { "omegaiotasubaspertilde", 0x1fa7 , 0 },
+ { "alphabreve", 0x1fb0 , 0 },
+ { "alphamacron", 0x1fb1 , 0 },
+ { "alphaiotasubgrave", 0x1fb2 , 0 },
+ { "alphaiotasub", 0x1fb3 , 0 },
+ { "alphatilde", 0x1fb6 , 0 },
+ { "alphaiotasubtilde", 0x1fb7 , 0 },
+ { "etaiotasubgrave", 0x1fc2 , 0 },
+ { "etaiotasub", 0x1fc3 , 0 },
+ { "etaiotasubacute", 0x1fc4 , 0 },
+ { "etatilde", 0x1fc6 , 0 },
+ { "etaiotasubtilde", 0x1fc7 , 0 },
+ { "iotabreve", 0x1fd0 , 0 },
+ { "iotamacron", 0x1fd1 , 0 },
+ { "iotadieresisgrave", 0x1fd2 , 0 },
+ { "iotadieresisacute", 0x1fd3 , 0 },
+ { "iotatilde", 0x1fd6 , 0 },
+ { "iotadieresistilde", 0x1fd7 , 0 },
+ { "upsilonbreve", 0x1fe0 , 0 },
+ { "upsilonmacron", 0x1fe1 , 0 },
+ { "upsilondieresisgrave", 0x1fe2 , 0 },
+ { "upsilondieresisacute", 0x1fe3 , 0 },
+ { "rholenis", 0x1fe4 , 0 },
+ { "rhoasper", 0x1fe5 , 0 },
+ { "upsilontilde", 0x1fe6 , 0 },
+ { "omegaiotasubgrave", 0x1ff2 , 0 },
+ { "omegaiotasub", 0x1ff3 , 0 },
+ { "omegaiotasubacute", 0x1ff4 , 0 },
+ { "omegatilde", 0x1ff6 , 0 },
+ { "omegaiotasubtilde", 0x1ff7 , 0 },
+ { "alphaiotasubacute", 0x1fb4 , 0 },
+ { "upsilondieresistilde", 0x1fe7 , 0 },
+ { "digamma", 0xefd5 , 0 },
+ { "Be", 0x0411 , 0 },
+ { "Ve", 0x0412 , 0 },
+ { "Ghe", 0x0413 , 0 },
+ { "De", 0x0414 , 0 },
+ { "Ie", 0x0415 , 0 },
+ { "Zhe", 0x0416 , 0 },
+ { "Ze", 0x0417 , 0 },
+ { "Ka", 0x041a , 0 },
+ { "El", 0x041b , 0 },
+ { "Em", 0x041c , 0 },
+ { "En", 0x041d , 0 },
+ { "Pe", 0x041f , 0 },
+ { "Er", 0x0420 , 0 },
+ { "Es", 0x0421 , 0 },
+ { "Te", 0x0422 , 0 },
+ { "Ef", 0x0424 , 0 },
+ { "Ha", 0x0425 , 0 },
+ { "Tse", 0x0426 , 0 },
+ { "Che", 0x0427 , 0 },
+ { "Sha", 0x0428 , 0 },
+ { "Shcha", 0x0429 , 0 },
+ { "Hard", 0x042a , 0 },
+ { "Yeru", 0x042b , 0 },
+ { "Soft", 0x042c , 0 },
+ { "Yu", 0x042e , 0 },
+ { "Ya", 0x042f , 0 },
+ { "Io", 0x0401 , 0 },
+ { "Dje", 0x0402 , 0 },
+ { "Gje", 0x0403 , 0 },
+ { "Dze", 0x0405 , 0 },
+ { "Yi", 0x0407 , 0 },
+ { "Je", 0x0408 , 0 },
+ { "Lje", 0x0409 , 0 },
+ { "Nje", 0x040a , 0 },
+ { "Tshe", 0x040b , 0 },
+ { "Kje", 0x040c , 0 },
+ { "Dzhe", 0x040f , 0 },
+ { "Yat", 0x0462 , 0 },
+ { "Fita", 0x0472 , 0 },
+ { "Izhitsa", 0x0474 , 0 },
+ { "be", 0x0431 , 0 },
+ { "ve", 0x0432 , 0 },
+ { "ghe", 0x0433 , 0 },
+ { "de", 0x0434 , 0 },
+ { "ie", 0x0435 , 0 },
+ { "zhe", 0x0436 , 0 },
+ { "ze", 0x0437 , 0 },
+ { "ka", 0x043a , 0 },
+ { "el", 0x043b , 0 },
+ { "em", 0x043c , 0 },
+ { "en", 0x043d , 0 },
+ { "er", 0x0440 , 0 },
+ { "es", 0x0441 , 0 },
+ { "te", 0x0442 , 0 },
+ { "ef", 0x0444 , 0 },
+ { "ha", 0x0445 , 0 },
+ { "tse", 0x0446 , 0 },
+ { "che", 0x0447 , 0 },
+ { "sha", 0x0448 , 0 },
+ { "shcha", 0x0449 , 0 },
+ { "hard", 0x044a , 0 },
+ { "yeru", 0x044b , 0 },
+ { "soft", 0x044c , 0 },
+ { "yu", 0x044e , 0 },
+ { "ya", 0x044f , 0 },
+ { "io", 0x0451 , 0 },
+ { "dje", 0x0452 , 0 },
+ { "gje", 0x0453 , 0 },
+ { "dze", 0x0455 , 0 },
+ { "yi", 0x0457 , 0 },
+ { "je", 0x0458 , 0 },
+ { "lje", 0x0459 , 0 },
+ { "nje", 0x045a , 0 },
+ { "tshe", 0x045b , 0 },
+ { "kje", 0x045c , 0 },
+ { "dzhe", 0x045f , 0 },
+ { "yat", 0x0463 , 0 },
+ { "fita", 0x0473 , 0 },
+ { "izhitsa", 0x0475 , 0 },
+ { "litre", 0x2113 , 0 },
+ { "Dotaccent", 0xefed , 0 },
+ { "Breve", 0xefee , 0 },
+ { "Ogonek", 0xeff1 , 0 },
+ { "Cedilla", 0xeff2 , 0 },
+ { "Ring", 0xeff3 , 0 },
+ { "Tilde", 0xeff5 , 0 },
+ { "Circumflex", 0xeff7 , 0 },
+ { "dbar", 0x0111 , 0 },
+ { "st", 0xfb06 , 0 },
+ { "TeXtext32", 0x0337 , 0 },
+ { "DD070", 0x2014 , 0 },
+ { "monospacedash", 0x2014 , 0 },
+ { "Dash1cent", 0x2015 , 0 },
+ { "apostrophereverse", 0x201b , 0 },
+ { "Pts", 0x20a7 , 0 },
+ { "SM760000", 0x2195 , 0 },
+ { "SM770000", 0x21a8 , 0 },
+ { "SP320000", 0x2219 , 0 },
+ { "SD630000", 0x22c5 , 0 },
+ { "SM790000", 0x2302 , 0 },
+ { "caretinverted", 0x2304 , 0 },
+ { "SM680000", 0x2310 , 0 },
+ { "SA420000", 0x2319 , 0 },
+ { "BorderULCorner1", 0x231c , 0 },
+ { "DD010", 0x231c , 0 },
+ { "DD101", 0x231c , 0 },
+ { "BorderURCorner1", 0x231d , 0 },
+ { "DD012", 0x231d , 0 },
+ { "DD104", 0x231d , 0 },
+ { "BorderLLCorner1", 0x231e , 0 },
+ { "DD014", 0x231e , 0 },
+ { "DD109", 0x231e , 0 },
+ { "BorderLRCorner1", 0x231f , 0 },
+ { "DD015", 0x231f , 0 },
+ { "DD112", 0x231f , 0 },
+ { "SS260000", 0x2320 , 0 },
+ { "SS270000", 0x2321 , 0 },
+ { "hook", 0x2440 , 0 },
+ { "chair", 0x2441 , 0 },
+ { "fork", 0x2442 , 0 },
+ { "SF600000", 0x2580 , 0 },
+ { "BorderLower1", 0x2581 , 0 },
+ { "DD011", 0x2581 , 0 },
+ { "DD021", 0x2581 , 0 },
+ { "DD110", 0x2581 , 0 },
+ { "Flower1l", 0x2581 , 0 },
+ { "SF570000", 0x2584 , 0 },
+ { "SF610000", 0x2588 , 0 },
+ { "Tile", 0x2588 , 0 },
+ { "HalfTile", 0x258c , 0 },
+ { "SF580000", 0x258c , 0 },
+ { "BorderLeftVertical1", 0x258f , 0 },
+ { "DD013", 0x258f , 0 },
+ { "DD034", 0x258f , 0 },
+ { "DD105", 0x258f , 0 },
+ { "Flower1d", 0x258f , 0 },
+ { "SF590000", 0x2590 , 0 },
+ { "SF140000", 0x2591 , 0 },
+ { "SF150000", 0x2592 , 0 },
+ { "SF160000", 0x2593 , 0 },
+ { "BorderUpper1", 0x2594 , 0 },
+ { "DD024", 0x2594 , 0 },
+ { "DD102", 0x2594 , 0 },
+ { "BorderRightVertical1", 0x2595 , 0 },
+ { "DD031", 0x2595 , 0 },
+ { "DD106", 0x2595 , 0 },
+ { "Flower2dr", 0x2595 , 0 },
+ { "SM600000", 0x25b2 , 0 },
+ { "SM590000", 0x25b6 , 0 },
+ { "SV040000", 0x25bc , 0 },
+ { "SM630000", 0x25c0 , 0 },
+ { "SM750000", 0x25cb , 0 },
+ { "SM570001", 0x25d8 , 0 },
+ { "SM750002", 0x25d9 , 0 },
+ { "ShootingStar", 0x2604 , 0 },
+ { "DD130", 0x2605 , 0 },
+ { "StarDingbat1", 0x2605 , 0 },
+ { "TheSun", 0x2609 , 0 },
+ { "FleuronLeft", 0x2619 , 0 },
+ { "cross", 0x2629 , 0 },
+ { "SS000000", 0x263a , 0 },
+ { "SS010000", 0x263b , 0 },
+ { "SM690000", 0x263c , 0 },
+ { "TheMoon", 0x263d , 0 },
+ { "Moon", 0x263e , 0 },
+ { "Mercury", 0x263f , 0 },
+ { "Venus", 0x2640 , 0 },
+ { "Earth", 0x2641 , 0 },
+ { "Mars", 0x2642 , 0 },
+ { "Jupiter", 0x2643 , 0 },
+ { "Saturn", 0x2644 , 0 },
+ { "Uranus", 0x2645 , 0 },
+ { "Neptune", 0x2646 , 0 },
+ { "Pluto", 0x2647 , 0 },
+ { "Aries", 0x2648 , 0 },
+ { "Taurus", 0x2649 , 0 },
+ { "Gemini", 0x264a , 0 },
+ { "Cancer", 0x264b , 0 },
+ { "Leo", 0x264c , 0 },
+ { "Virgo", 0x264d , 0 },
+ { "Libra", 0x264e , 0 },
+ { "Scorpio", 0x264f , 0 },
+ { "Sagittarius", 0x2650 , 0 },
+ { "Capricorn", 0x2651 , 0 },
+ { "Aquarius", 0x2652 , 0 },
+ { "Pisces", 0x2653 , 0 },
+ { "diamondopen", 0x2662 , 0 },
+ { "FleuronCenter", 0x2766 , 0 },
+ { "FleuronRight", 0x2767 , 0 },
+ { "st1", 0xfb06 , 0 },
+ { "zeroslash", 0xf638 , 0 },
+ { "pi1", 0x03d6 , 0 },
+ { "hyphen-minus", 0x002d , 0 },
+ { "hyphenminus", 0x002d , 0 },
+ { "nonmarkingreturn", 0x000d , 0 },
+ { "micro", 0x00b5 , 0 },
+ { "Dmacron", 0x0110 , 0 },
+ { "kra", 0x0138 , 0 },
+ { "bbar", 0x0180 , 0 },
+ { "Dbar", 0x0189 , 0 },
+ { "deltaturn", 0x018d , 0 },
+ { "Eturn", 0x018e , 0 },
+ { "Epsilonlatin", 0x0190 , 0 },
+ { "Gammalatin", 0x0194 , 0 },
+ { "Iotalatin", 0x0196 , 0 },
+ { "Ibar", 0x0197 , 0 },
+ { "lambdabar", 0x019b , 0 },
+ { "mcapturn", 0x019c , 0 },
+ { "Nhook", 0x019d , 0 },
+ { "nleg", 0x019e , 0 },
+ { "Obar", 0x019f , 0 },
+ { "OI", 0x01a2 , 0 },
+ { "YR", 0x01a6 , 0 },
+ { "eshlooprev", 0x01aa , 0 },
+ { "Trthook", 0x01ae , 0 },
+ { "Upsilonlatin", 0x01b1 , 0 },
+ { "Vcursive", 0x01b2 , 0 },
+ { "Zbar", 0x01b5 , 0 },
+ { "zbar", 0x01b6 , 0 },
+ { "Yogh", 0x01b7 , 0 },
+ { "Yoghrev", 0x01b8 , 0 },
+ { "yoghrev", 0x01b9 , 0 },
+ { "yoghtail", 0x01ba , 0 },
+ { "twobar", 0x01bb , 0 },
+ { "glottalstopbarinv", 0x01be , 0 },
+ { "pipe", 0x01c0 , 0 },
+ { "pipedbl", 0x01c1 , 0 },
+ { "pipedblbar", 0x01c2 , 0 },
+ { "exclamlatin", 0x01c3 , 0 },
+ { "DZhacek", 0x01c4 , 0 },
+ { "Dzhacek", 0x01c5 , 0 },
+ { "dzhacek", 0x01c6 , 0 },
+ { "Ahacek", 0x01cd , 0 },
+ { "ahacek", 0x01ce , 0 },
+ { "Ihacek", 0x01cf , 0 },
+ { "ihacek", 0x01d0 , 0 },
+ { "Ohacek", 0x01d1 , 0 },
+ { "ohacek", 0x01d2 , 0 },
+ { "Uhacek", 0x01d3 , 0 },
+ { "uhacek", 0x01d4 , 0 },
+ { "Udieresishacek", 0x01d9 , 0 },
+ { "udieresishacek", 0x01da , 0 },
+ { "eturn", 0x01dd , 0 },
+ { "Gbar", 0x01e4 , 0 },
+ { "gbar", 0x01e5 , 0 },
+ { "Ghacek", 0x01e6 , 0 },
+ { "ghacek", 0x01e7 , 0 },
+ { "Khacek", 0x01e8 , 0 },
+ { "khacek", 0x01e9 , 0 },
+ { "Yoghhacek", 0x01ee , 0 },
+ { "yoghhacek", 0x01ef , 0 },
+ { "jhacek", 0x01f0 , 0 },
+ { "aturn", 0x0250 , 0 },
+ { "ascriptturn", 0x0252 , 0 },
+ { "cturn", 0x0254 , 0 },
+ { "drthook", 0x0256 , 0 },
+ { "erev", 0x0258 , 0 },
+ { "epsilonlatin", 0x025b , 0 },
+ { "epsilonlatinrev", 0x025c , 0 },
+ { "epsilonlatinrevhook", 0x025d , 0 },
+ { "epsilonlatinrevclosed", 0x025e , 0 },
+ { "jdotlessbar", 0x025f , 0 },
+ { "gcursive", 0x0261 , 0 },
+ { "Gsmallcap", 0x0262 , 0 },
+ { "gammalatin", 0x0263 , 0 },
+ { "babygamma", 0x0264 , 0 },
+ { "hturn", 0x0265 , 0 },
+ { "ibar", 0x0268 , 0 },
+ { "Ismallcap", 0x026a , 0 },
+ { "lmidtilde", 0x026b , 0 },
+ { "lrthook", 0x026d , 0 },
+ { "lyogh", 0x026e , 0 },
+ { "mturn", 0x026f , 0 },
+ { "mturndescend", 0x0270 , 0 },
+ { "nlftlfthook", 0x0272 , 0 },
+ { "nrthook", 0x0273 , 0 },
+ { "Nsmallcap", 0x0274 , 0 },
+ { "obar", 0x0275 , 0 },
+ { "OEsmallcap", 0x0276 , 0 },
+ { "omegaclosed", 0x0277 , 0 },
+ { "rturn", 0x0279 , 0 },
+ { "rturnascend", 0x027a , 0 },
+ { "rturnrthook", 0x027b , 0 },
+ { "rdescend", 0x027c , 0 },
+ { "rrthook", 0x027d , 0 },
+ { "rfishhookrev", 0x027f , 0 },
+ { "Rsmallcap", 0x0280 , 0 },
+ { "Rsmallcapinv", 0x0281 , 0 },
+ { "srthook", 0x0282 , 0 },
+ { "jhookdblbar", 0x0284 , 0 },
+ { "eshshortrev", 0x0285 , 0 },
+ { "tturn", 0x0287 , 0 },
+ { "trthook", 0x0288 , 0 },
+ { "vscript", 0x028b , 0 },
+ { "vturn", 0x028c , 0 },
+ { "wturn", 0x028d , 0 },
+ { "yturn", 0x028e , 0 },
+ { "Ysmallcap", 0x028f , 0 },
+ { "zrthook", 0x0290 , 0 },
+ { "yogh", 0x0292 , 0 },
+ { "yoghcurl", 0x0293 , 0 },
+ { "glottalstoprevinv", 0x0295 , 0 },
+ { "glottalstopinv", 0x0296 , 0 },
+ { "cstretch", 0x0297 , 0 },
+ { "kiss", 0x0298 , 0 },
+ { "Bsmallcap", 0x0299 , 0 },
+ { "epsilonclosed", 0x029a , 0 },
+ { "Gsmallcaphook", 0x029b , 0 },
+ { "Hsmallcap", 0x029c , 0 },
+ { "jcrosstail", 0x029d , 0 },
+ { "kturn", 0x029e , 0 },
+ { "Lsmallcap", 0x029f , 0 },
+ { "glottalstopbar", 0x02a1 , 0 },
+ { "glottalstopbarrev", 0x02a2 , 0 },
+ { "dyogh", 0x02a4 , 0 },
+ { "hsuper", 0x02b0 , 0 },
+ { "hhooksuper", 0x02b1 , 0 },
+ { "jsuper", 0x02b2 , 0 },
+ { "rsuper", 0x02b3 , 0 },
+ { "rturnsuper", 0x02b4 , 0 },
+ { "rturnrthooksuper", 0x02b5 , 0 },
+ { "Rturnsuper", 0x02b6 , 0 },
+ { "wsuper", 0x02b7 , 0 },
+ { "ysuper", 0x02b8 , 0 },
+ { "primedblmod", 0x02ba , 0 },
+ { "quoteleftmod", 0x02bb , 0 },
+ { "apostrophe", 0x02bc , 0 },
+ { "apostropherev", 0x02bd , 0 },
+ { "ringrighthalfsuper", 0x02be , 0 },
+ { "ringlefthalfsuper", 0x02bf , 0 },
+ { "glottal", 0x02c0 , 0 },
+ { "glottalrev", 0x02c1 , 0 },
+ { "fronted", 0x02c2 , 0 },
+ { "backed", 0x02c3 , 0 },
+ { "raised", 0x02c4 , 0 },
+ { "lowered", 0x02c5 , 0 },
+ { "linevert", 0x02c8 , 0 },
+ { "macronmodifier", 0x02c9 , 0 },
+ { "acutemodifier", 0x02ca , 0 },
+ { "gravemodifier", 0x02cb , 0 },
+ { "linevertsub", 0x02cc , 0 },
+ { "macronsub", 0x02cd , 0 },
+ { "gravesub", 0x02ce , 0 },
+ { "acutesub", 0x02cf , 0 },
+ { "length", 0x02d0 , 0 },
+ { "halflength", 0x02d1 , 0 },
+ { "ringrighthalfcenter", 0x02d2 , 0 },
+ { "ringlefthalfsup", 0x02d3 , 0 },
+ { "tackupmid", 0x02d4 , 0 },
+ { "tackdownmid", 0x02d5 , 0 },
+ { "rhotichook", 0x02de , 0 },
+ { "gammasuper", 0x02e0 , 0 },
+ { "lsuper", 0x02e1 , 0 },
+ { "ssuper", 0x02e2 , 0 },
+ { "xsuper", 0x02e3 , 0 },
+ { "glottalrevsuper", 0x02e4 , 0 },
+ { "toneextrahigh", 0x02e5 , 0 },
+ { "tonehigh", 0x02e6 , 0 },
+ { "tonemid", 0x02e7 , 0 },
+ { "tonelow", 0x02e8 , 0 },
+ { "toneextralow", 0x02e9 , 0 },
+ { "gravenosp", 0x0300 , 0 },
+ { "acutenosp", 0x0301 , 0 },
+ { "circumflexnosp", 0x0302 , 0 },
+ { "tildenosp", 0x0303 , 0 },
+ { "macronnosp", 0x0304 , 0 },
+ { "overscorenosp", 0x0305 , 0 },
+ { "brevenosp", 0x0306 , 0 },
+ { "dotnosp", 0x0307 , 0 },
+ { "dieresisnosp", 0x0308 , 0 },
+ { "hooksupnosp", 0x0309 , 0 },
+ { "ringnosp", 0x030a , 0 },
+ { "acutedblnosp", 0x030b , 0 },
+ { "haceknosp", 0x030c , 0 },
+ { "linevertnosp", 0x030d , 0 },
+ { "linevertdblnosp", 0x030e , 0 },
+ { "gravedblnosp", 0x030f , 0 },
+ { "candrabindunosp", 0x0310 , 0 },
+ { "breveinvnosp", 0x0311 , 0 },
+ { "commaturnsupnosp", 0x0312 , 0 },
+ { "apostrophesupnosp", 0x0313 , 0 },
+ { "commasuprevnosp", 0x0314 , 0 },
+ { "commasuprightnosp", 0x0315 , 0 },
+ { "gravesubnosp", 0x0316 , 0 },
+ { "acutesubnosp", 0x0317 , 0 },
+ { "tackleftsubnosp", 0x0318 , 0 },
+ { "tackrightsubnosp", 0x0319 , 0 },
+ { "anglesupnosp", 0x031a , 0 },
+ { "hornnosp", 0x031b , 0 },
+ { "ringlefthalfsubnosp", 0x031c , 0 },
+ { "tackupsubnosp", 0x031d , 0 },
+ { "tackdownsubnosp", 0x031e , 0 },
+ { "plussubnosp", 0x031f , 0 },
+ { "minussubnosp", 0x0320 , 0 },
+ { "hooksubpalatnosp", 0x0321 , 0 },
+ { "hooksubretronosp", 0x0322 , 0 },
+ { "dotsubnosp", 0x0323 , 0 },
+ { "dotdblsubnosp", 0x0324 , 0 },
+ { "ringsubnosp", 0x0325 , 0 },
+ { "commasubnosp", 0x0326 , 0 },
+ { "cedillanosp", 0x0327 , 0 },
+ { "ogoneknosp", 0x0328 , 0 },
+ { "linevertsubnosp", 0x0329 , 0 },
+ { "bridgesubnosp", 0x032a , 0 },
+ { "archdblsubnosp", 0x032b , 0 },
+ { "haceksubnosp", 0x032c , 0 },
+ { "circumflexsubnosp", 0x032d , 0 },
+ { "brevesubnosp", 0x032e , 0 },
+ { "breveinvsubnosp", 0x032f , 0 },
+ { "tildesubnosp", 0x0330 , 0 },
+ { "macronsubnosp", 0x0331 , 0 },
+ { "underscorenosp", 0x0332 , 0 },
+ { "underscoredblnosp", 0x0333 , 0 },
+ { "tildemidnosp", 0x0334 , 0 },
+ { "barmidshortnosp", 0x0335 , 0 },
+ { "barmidlongnosp", 0x0336 , 0 },
+ { "slashshortnosp", 0x0337 , 0 },
+ { "slashlongnosp", 0x0338 , 0 },
+ { "ringrighthalfsubnosp", 0x0339 , 0 },
+ { "bridgeinvsubnosp", 0x033a , 0 },
+ { "squaresubnosp", 0x033b , 0 },
+ { "seagullsubnosp", 0x033c , 0 },
+ { "xsupnosp", 0x033d , 0 },
+ { "tildevertsupnosp", 0x033e , 0 },
+ { "overscoredblnosp", 0x033f , 0 },
+ { "graveleftnosp", 0x0340 , 0 },
+ { "acuterightnosp", 0x0341 , 0 },
+ { "wavyoverscorenosp", 0x0342 , 0 },
+ { "zigzagoverscorenosp", 0x0343 , 0 },
+ { "diaeresistonosnosp", 0x0344 , 0 },
+ { "iotasubnosp", 0x0345 , 0 },
+ { "iotasub", 0x037a , 0 },
+ { "diaeresistonos", 0x0385 , 0 },
+ { "iotadiaeresistonos", 0x0390 , 0 },
+ { "Iotadiaeresis", 0x03aa , 0 },
+ { "Upsilondiaeresis", 0x03ab , 0 },
+ { "upsilondiaeresistonos", 0x03b0 , 0 },
+ { "iotadiaeresis", 0x03ca , 0 },
+ { "upsilondiaeresis", 0x03cb , 0 },
+ { "betacurled", 0x03d0 , 0 },
+ { "thetascript", 0x03d1 , 0 },
+ { "Upsilonhook", 0x03d2 , 0 },
+ { "Upsilonhooktonos", 0x03d3 , 0 },
+ { "Upsilonhookdiaeresis", 0x03d4 , 0 },
+ { "phiscript", 0x03d5 , 0 },
+ { "omegapi", 0x03d6 , 0 },
+ { "Stigma", 0x03da , 0 },
+ { "stigma", 0x03db , 0 },
+ { "Digamma", 0x03dc , 0 },
+ { "digamma", 0x03dd , 0 },
+ { "Koppa", 0x03de , 0 },
+ { "koppa", 0x03df , 0 },
+ { "Sampi", 0x03e0 , 0 },
+ { "sampi", 0x03e1 , 0 },
+ { "Shei", 0x03e2 , 0 },
+ { "shei", 0x03e3 , 0 },
+ { "Fei", 0x03e4 , 0 },
+ { "fei", 0x03e5 , 0 },
+ { "Khei", 0x03e6 , 0 },
+ { "khei", 0x03e7 , 0 },
+ { "Hori", 0x03e8 , 0 },
+ { "hori", 0x03e9 , 0 },
+ { "Gangia", 0x03ea , 0 },
+ { "gangia", 0x03eb , 0 },
+ { "Shima", 0x03ec , 0 },
+ { "shima", 0x03ed , 0 },
+ { "Dei", 0x03ee , 0 },
+ { "dei", 0x03ef , 0 },
+ { "kappascript", 0x03f0 , 0 },
+ { "sigmalunate", 0x03f2 , 0 },
+ { "Io", 0x0401 , 0 },
+ { "Dje", 0x0402 , 0 },
+ { "Gje", 0x0403 , 0 },
+ { "Ecyril", 0x0404 , 0 },
+ { "Dze", 0x0405 , 0 },
+ { "Icyril", 0x0406 , 0 },
+ { "Yi", 0x0407 , 0 },
+ { "Je", 0x0408 , 0 },
+ { "Lje", 0x0409 , 0 },
+ { "Nje", 0x040a , 0 },
+ { "Tshe", 0x040b , 0 },
+ { "Kje", 0x040c , 0 },
+ { "Ucyrilbreve", 0x040e , 0 },
+ { "Dzhe", 0x040f , 0 },
+ { "Acyril", 0x0410 , 0 },
+ { "Be", 0x0411 , 0 },
+ { "Ve", 0x0412 , 0 },
+ { "Ge", 0x0413 , 0 },
+ { "De", 0x0414 , 0 },
+ { "Ie", 0x0415 , 0 },
+ { "Zhe", 0x0416 , 0 },
+ { "Ze", 0x0417 , 0 },
+ { "Ii", 0x0418 , 0 },
+ { "Iibreve", 0x0419 , 0 },
+ { "Ka", 0x041a , 0 },
+ { "El", 0x041b , 0 },
+ { "Em", 0x041c , 0 },
+ { "En", 0x041d , 0 },
+ { "Ocyril", 0x041e , 0 },
+ { "Pecyril", 0x041f , 0 },
+ { "Er", 0x0420 , 0 },
+ { "Es", 0x0421 , 0 },
+ { "Te", 0x0422 , 0 },
+ { "Ucyril", 0x0423 , 0 },
+ { "Ef", 0x0424 , 0 },
+ { "Kha", 0x0425 , 0 },
+ { "Tse", 0x0426 , 0 },
+ { "Che", 0x0427 , 0 },
+ { "Sha", 0x0428 , 0 },
+ { "Shcha", 0x0429 , 0 },
+ { "Hard", 0x042a , 0 },
+ { "Yeri", 0x042b , 0 },
+ { "Soft", 0x042c , 0 },
+ { "Ecyrilrev", 0x042d , 0 },
+ { "Iu", 0x042e , 0 },
+ { "Ia", 0x042f , 0 },
+ { "acyril", 0x0430 , 0 },
+ { "be", 0x0431 , 0 },
+ { "ve", 0x0432 , 0 },
+ { "ge", 0x0433 , 0 },
+ { "de", 0x0434 , 0 },
+ { "ie", 0x0435 , 0 },
+ { "zhe", 0x0436 , 0 },
+ { "ze", 0x0437 , 0 },
+ { "ii", 0x0438 , 0 },
+ { "iibreve", 0x0439 , 0 },
+ { "ka", 0x043a , 0 },
+ { "el", 0x043b , 0 },
+ { "em", 0x043c , 0 },
+ { "en", 0x043d , 0 },
+ { "ocyril", 0x043e , 0 },
+ { "pecyril", 0x043f , 0 },
+ { "er", 0x0440 , 0 },
+ { "es", 0x0441 , 0 },
+ { "te", 0x0442 , 0 },
+ { "ucyril", 0x0443 , 0 },
+ { "ef", 0x0444 , 0 },
+ { "kha", 0x0445 , 0 },
+ { "tse", 0x0446 , 0 },
+ { "che", 0x0447 , 0 },
+ { "sha", 0x0448 , 0 },
+ { "shcha", 0x0449 , 0 },
+ { "hard", 0x044a , 0 },
+ { "yeri", 0x044b , 0 },
+ { "soft", 0x044c , 0 },
+ { "ecyrilrev", 0x044d , 0 },
+ { "iu", 0x044e , 0 },
+ { "ia", 0x044f , 0 },
+ { "io", 0x0451 , 0 },
+ { "dje", 0x0452 , 0 },
+ { "gje", 0x0453 , 0 },
+ { "ecyril", 0x0454 , 0 },
+ { "dze", 0x0455 , 0 },
+ { "icyril", 0x0456 , 0 },
+ { "yi", 0x0457 , 0 },
+ { "je", 0x0458 , 0 },
+ { "lje", 0x0459 , 0 },
+ { "nje", 0x045a , 0 },
+ { "tshe", 0x045b , 0 },
+ { "kje", 0x045c , 0 },
+ { "ucyrilbreve", 0x045e , 0 },
+ { "dzhe", 0x045f , 0 },
+ { "Yat", 0x0462 , 0 },
+ { "yat", 0x0463 , 0 },
+ { "Yusbig", 0x046a , 0 },
+ { "yusbig", 0x046b , 0 },
+ { "Psicyril", 0x0470 , 0 },
+ { "psicyril", 0x0471 , 0 },
+ { "Fita", 0x0472 , 0 },
+ { "fita", 0x0473 , 0 },
+ { "Izhitsa", 0x0474 , 0 },
+ { "izhitsa", 0x0475 , 0 },
+ { "Izhitsagravedbl", 0x0476 , 0 },
+ { "izhitsagravedbl", 0x0477 , 0 },
+ { "Digraphuk", 0x0478 , 0 },
+ { "digraphuk", 0x0479 , 0 },
+ { "Omegaround", 0x047a , 0 },
+ { "omegaround", 0x047b , 0 },
+ { "Omegatitlo", 0x047c , 0 },
+ { "omegatitlo", 0x047d , 0 },
+ { "OT", 0x047e , 0 },
+ { "ot", 0x047f , 0 },
+ { "Geupturn", 0x0490 , 0 },
+ { "geupturn", 0x0491 , 0 },
+ { "Gebar", 0x0492 , 0 },
+ { "gebar", 0x0493 , 0 },
+ { "Gehook", 0x0494 , 0 },
+ { "gehook", 0x0495 , 0 },
+ { "Zhertdes", 0x0496 , 0 },
+ { "zhertdes", 0x0497 , 0 },
+ { "Zecedilla", 0x0498 , 0 },
+ { "zecedilla", 0x0499 , 0 },
+ { "Kartdes", 0x049a , 0 },
+ { "kartdes", 0x049b , 0 },
+ { "Kavertbar", 0x049c , 0 },
+ { "kavertbar", 0x049d , 0 },
+ { "Kabar", 0x049e , 0 },
+ { "kabar", 0x049f , 0 },
+ { "GeKarev", 0x04a0 , 0 },
+ { "gekarev", 0x04a1 , 0 },
+ { "Enrtdes", 0x04a2 , 0 },
+ { "enrtdes", 0x04a3 , 0 },
+ { "EnGe", 0x04a4 , 0 },
+ { "enge", 0x04a5 , 0 },
+ { "Pehook", 0x04a6 , 0 },
+ { "pehook", 0x04a7 , 0 },
+ { "Ohook", 0x04a8 , 0 },
+ { "ohook", 0x04a9 , 0 },
+ { "Escedilla", 0x04aa , 0 },
+ { "escedilla", 0x04ab , 0 },
+ { "Tertdes", 0x04ac , 0 },
+ { "tertdes", 0x04ad , 0 },
+ { "Ustrt", 0x04ae , 0 },
+ { "ustrt", 0x04af , 0 },
+ { "Ustrtbar", 0x04b0 , 0 },
+ { "ustrtbar", 0x04b1 , 0 },
+ { "Khartdes", 0x04b2 , 0 },
+ { "khartdes", 0x04b3 , 0 },
+ { "TeTse", 0x04b4 , 0 },
+ { "tetse", 0x04b5 , 0 },
+ { "Chertdes", 0x04b6 , 0 },
+ { "chertdes", 0x04b7 , 0 },
+ { "Chevertbar", 0x04b8 , 0 },
+ { "chevertbar", 0x04b9 , 0 },
+ { "Hcyril", 0x04ba , 0 },
+ { "hcyril", 0x04bb , 0 },
+ { "Iehook", 0x04bc , 0 },
+ { "iehook", 0x04bd , 0 },
+ { "Iehookogonek", 0x04be , 0 },
+ { "iehookogonek", 0x04bf , 0 },
+ { "Icyril1", 0x04c0 , 0 },
+ { "Zhebreve", 0x04c1 , 0 },
+ { "zhebreve", 0x04c2 , 0 },
+ { "Kahook", 0x04c3 , 0 },
+ { "kahook", 0x04c4 , 0 },
+ { "Enhook", 0x04c7 , 0 },
+ { "enhook", 0x04c8 , 0 },
+ { "Cheleftdes", 0x04cb , 0 },
+ { "cheleftdes", 0x04cc , 0 },
+ { "qibuts", 0x05bb , 0 },
+ { "meteg", 0x05bd , 0 },
+ { "maqaf", 0x05be , 0 },
+ { "paseq", 0x05c0 , 0 },
+ { "shindot", 0x05c1 , 0 },
+ { "sindot", 0x05c2 , 0 },
+ { "sofpasuq", 0x05c3 , 0 },
+ { "kaffinal", 0x05da , 0 },
+ { "memfinal", 0x05dd , 0 },
+ { "nunfinal", 0x05df , 0 },
+ { "pefinal", 0x05e3 , 0 },
+ { "tsadifinal", 0x05e5 , 0 },
+ { "vavdbl", 0x05f0 , 0 },
+ { "vavyod", 0x05f1 , 0 },
+ { "yoddbl", 0x05f2 , 0 },
+ { "geresh", 0x05f3 , 0 },
+ { "gershayim", 0x05f4 , 0 },
+ { "varika", 0x05f5 , 0 },
+ { "enquad", 0x2000 , 0 },
+ { "emquad", 0x2001 , 0 },
+ { "emspace", 0x2003 , 0 },
+ { "threeperemspace", 0x2004 , 0 },
+ { "fourperemspace", 0x2005 , 0 },
+ { "sixperemspace", 0x2006 , 0 },
+ { "figurespace", 0x2007 , 0 },
+ { "punctuationspace", 0x2008 , 0 },
+ { "thinspace", 0x2009 , 0 },
+ { "hairspace", 0x200a , 0 },
+ { "zerospace", 0x200b , 0 },
+ { "zeronojoin", 0x200c , 0 },
+ { "zerojoin", 0x200d , 0 },
+ { "hyphennobreak", 0x2011 , 0 },
+ { "quotedash", 0x2015 , 0 },
+ { "dashdbl", 0x2016 , 0 },
+ { "quotesinglrev", 0x201b , 0 },
+ { "quotedblrev", 0x201f , 0 },
+ { "trianglebullet", 0x2023 , 0 },
+ { "onedotlead", 0x2024 , 0 },
+ { "twodotlead", 0x2025 , 0 },
+ { "hyphendot", 0x2027 , 0 },
+ { "lineseparator", 0x2028 , 0 },
+ { "paragraphseparator", 0x2029 , 0 },
+ { "lre", 0x202a , 0 },
+ { "rle", 0x202b , 0 },
+ { "pdf", 0x202c , 0 },
+ { "lro", 0x202d , 0 },
+ { "rlo", 0x202e , 0 },
+ { "pertenthousand", 0x2031 , 0 },
+ { "prime", 0x2032 , 0 },
+ { "primedbl", 0x2033 , 0 },
+ { "primetriple", 0x2034 , 0 },
+ { "primerev", 0x2035 , 0 },
+ { "primedblrev", 0x2036 , 0 },
+ { "primetriplerev", 0x2037 , 0 },
+ { "caret", 0x2038 , 0 },
+ { "refmark", 0x203b , 0 },
+ { "interrobang", 0x203d , 0 },
+ { "tie", 0x2040 , 0 },
+ { "caretinsert", 0x2041 , 0 },
+ { "hyphenbullet", 0x2043 , 0 },
+ { "minussuperior", 0x207b , 0 },
+ { "plusinferior", 0x208a , 0 },
+ { "equalinferior", 0x208c , 0 },
+ { "eurocurrency", 0x20a0 , 0 },
+ { "coloncurrency", 0x20a1 , 0 },
+ { "mill", 0x20a5 , 0 },
+ { "naira", 0x20a6 , 0 },
+ { "pesetas", 0x20a7 , 0 },
+ { "rupee", 0x20a8 , 0 },
+ { "newsheqel", 0x20aa , 0 },
+ { "accountof", 0x2100 , 0 },
+ { "addresssubject", 0x2101 , 0 },
+ { "Cbb", 0x2102 , 0 },
+ { "degreecentigrade", 0x2103 , 0 },
+ { "CL", 0x2104 , 0 },
+ { "cadauna", 0x2106 , 0 },
+ { "Euler", 0x2107 , 0 },
+ { "scruple", 0x2108 , 0 },
+ { "degreefarenheit", 0x2109 , 0 },
+ { "Hscript", 0x210b , 0 },
+ { "Hblackletter", 0x210c , 0 },
+ { "Hbb", 0x210d , 0 },
+ { "planck", 0x210e , 0 },
+ { "planckover2pi", 0x210f , 0 },
+ { "Iscript", 0x2110 , 0 },
+ { "Lscript", 0x2112 , 0 },
+ { "lscript", 0x2113 , 0 },
+ { "lbbar", 0x2114 , 0 },
+ { "Nbb", 0x2115 , 0 },
+ { "recordright", 0x2117 , 0 },
+ { "Pbb", 0x2119 , 0 },
+ { "Qbb", 0x211a , 0 },
+ { "Rscript", 0x211b , 0 },
+ { "Rfractur", 0x211c , 0 },
+ { "Rbb", 0x211d , 0 },
+ { "Rx", 0x211e , 0 },
+ { "response", 0x211f , 0 },
+ { "servicemark", 0x2120 , 0 },
+ { "tel", 0x2121 , 0 },
+ { "versicle", 0x2123 , 0 },
+ { "Zbb", 0x2124 , 0 },
+ { "ounce", 0x2125 , 0 },
+ { "ohm", 0x2126 , 0 },
+ { "mho", 0x2127 , 0 },
+ { "Zblackletter", 0x2128 , 0 },
+ { "iotaturn", 0x2129 , 0 },
+ { "degreekelvin", 0x212a , 0 },
+ { "Bscript", 0x212c , 0 },
+ { "Cblackletter", 0x212d , 0 },
+ { "escript", 0x212f , 0 },
+ { "Escript", 0x2130 , 0 },
+ { "Fscript", 0x2131 , 0 },
+ { "Fturn", 0x2132 , 0 },
+ { "Mscript", 0x2133 , 0 },
+ { "u0scrip", 0x2134 , 0 },
+ { "alephmath", 0x2135 , 0 },
+ { "gimelmath", 0x2137 , 0 },
+ { "dalethmath", 0x2138 , 0 },
+ { "twothird", 0x2154 , 0 },
+ { "onefifth", 0x2155 , 0 },
+ { "twofifths", 0x2156 , 0 },
+ { "threefifths", 0x2157 , 0 },
+ { "fourfifths", 0x2158 , 0 },
+ { "onesixth", 0x2159 , 0 },
+ { "fivesixths", 0x215a , 0 },
+ { "onenumerator", 0x215f , 0 },
+ { "arrowlongboth", 0x2194 , 0 },
+ { "arrowlongbothv", 0x2195 , 0 },
+ { "arrownorthwest", 0x2196 , 0 },
+ { "arrownortheast", 0x2197 , 0 },
+ { "arrowsoutheast", 0x2198 , 0 },
+ { "arrowsouthwest", 0x2199 , 0 },
+ { "arrowleftnot", 0x219a , 0 },
+ { "arrowrightnot", 0x219b , 0 },
+ { "arrowwaveleft", 0x219c , 0 },
+ { "arrowwaveright", 0x219d , 0 },
+ { "dblarrowheadleft", 0x219e , 0 },
+ { "dblarrowheadup", 0x219f , 0 },
+ { "dblarrowheadright", 0x21a0 , 0 },
+ { "dblarrowheaddown", 0x21a1 , 0 },
+ { "arrowtailleft", 0x21a2 , 0 },
+ { "arrowtailright", 0x21a3 , 0 },
+ { "arrowbarleft", 0x21a4 , 0 },
+ { "arrowbarup", 0x21a5 , 0 },
+ { "arrowbarright", 0x21a6 , 0 },
+ { "arrowbardown", 0x21a7 , 0 },
+ { "arrowbothvbase", 0x21a8 , 0 },
+ { "arrowhookleft", 0x21a9 , 0 },
+ { "arrowhookright", 0x21aa , 0 },
+ { "arrowloopleft", 0x21ab , 0 },
+ { "arrowloopright", 0x21ac , 0 },
+ { "arrowwaveboth", 0x21ad , 0 },
+ { "arrowlongbothnot", 0x21ae , 0 },
+ { "arrowzigzag", 0x21af , 0 },
+ { "arrowrightdown", 0x21b4 , 0 },
+ { "carriagerreturn", 0x21b5 , 0 },
+ { "arrowsemanticlockw", 0x21b6 , 0 },
+ { "arrowsemclockw", 0x21b7 , 0 },
+ { "home", 0x21b8 , 0 },
+ { "tableftright", 0x21b9 , 0 },
+ { "arrowanticlockw", 0x21ba , 0 },
+ { "arrowclockw", 0x21bb , 0 },
+ { "arrowlefttophalf", 0x21bc , 0 },
+ { "arrowleftbothalf", 0x21bd , 0 },
+ { "harpoonupright", 0x21be , 0 },
+ { "harpoonupleft", 0x21bf , 0 },
+ { "arrowrighttophalf", 0x21c0 , 0 },
+ { "arrowrightbothalf", 0x21c1 , 0 },
+ { "harpoondownright", 0x21c2 , 0 },
+ { "harpoondownleft", 0x21c3 , 0 },
+ { "arrowparrrightleft", 0x21c4 , 0 },
+ { "dblarrowupdown", 0x21c5 , 0 },
+ { "arrowparrleftright", 0x21c6 , 0 },
+ { "dblarrowup", 0x21c8 , 0 },
+ { "dblarrowdown", 0x21ca , 0 },
+ { "harpoonleftright", 0x21cb , 0 },
+ { "harpoonrightleft", 0x21cc , 0 },
+ { "arrowdblleftnot", 0x21cd , 0 },
+ { "arrowdbllongbothnot", 0x21ce , 0 },
+ { "arrowdblrightnot", 0x21cf , 0 },
+ { "arrowdbllongboth", 0x21d4 , 0 },
+ { "arrowdbllongbothv", 0x21d5 , 0 },
+ { "arrowdblnw", 0x21d6 , 0 },
+ { "arrowdblne", 0x21d7 , 0 },
+ { "arrowdblse", 0x21d8 , 0 },
+ { "arrowdblsw", 0x21d9 , 0 },
+ { "arrowtripleleft", 0x21da , 0 },
+ { "arrowtripleright", 0x21db , 0 },
+ { "arrowsquiggleleft", 0x21dc , 0 },
+ { "arrowsquiggleright", 0x21dd , 0 },
+ { "arrowopenleft", 0x21e6 , 0 },
+ { "arrowopenup", 0x21e7 , 0 },
+ { "arrowopenright", 0x21e8 , 0 },
+ { "arrowopendown", 0x21e9 , 0 },
+ { "complement", 0x2201 , 0 },
+ { "notexistential", 0x2204 , 0 },
+ { "elementsmall", 0x220a , 0 },
+ { "owner", 0x220b , 0 },
+ { "notowner", 0x220c , 0 },
+ { "ownersmall", 0x220d , 0 },
+ { "eop", 0x220e , 0 },
+ { "coproduct", 0x2210 , 0 },
+ { "dotplus", 0x2214 , 0 },
+ { "slashmath", 0x2215 , 0 },
+ { "backslashmath", 0x2216 , 0 },
+ { "ringoperator", 0x2218 , 0 },
+ { "bulletmath", 0x2219 , 0 },
+ { "cuberoot", 0x221b , 0 },
+ { "fourthroot", 0x221c , 0 },
+ { "measuredangle", 0x2221 , 0 },
+ { "sphericalangle", 0x2222 , 0 },
+ { "notbar", 0x2224 , 0 },
+ { "parallelto", 0x2225 , 0 },
+ { "notbardbl", 0x2226 , 0 },
+ { "integraldbl", 0x222c , 0 },
+ { "integraltrpl", 0x222d , 0 },
+ { "contintegral", 0x222e , 0 },
+ { "surfintegral", 0x222f , 0 },
+ { "volintegral", 0x2230 , 0 },
+ { "clwintegral", 0x2231 , 0 },
+ { "clwcontintegral", 0x2232 , 0 },
+ { "cclwcontintegral", 0x2233 , 0 },
+ { "dotminus", 0x2238 , 0 },
+ { "excess", 0x2239 , 0 },
+ { "geomproportion", 0x223a , 0 },
+ { "homothetic", 0x223b , 0 },
+ { "revsimilar", 0x223d , 0 },
+ { "lazysinv", 0x223e , 0 },
+ { "sine", 0x223f , 0 },
+ { "wreathproduct", 0x2240 , 0 },
+ { "notsimilar", 0x2241 , 0 },
+ { "minustilde", 0x2242 , 0 },
+ { "asymptequal", 0x2243 , 0 },
+ { "notasymptequal", 0x2244 , 0 },
+ { "approxorequal", 0x2245 , 0 },
+ { "approxnotequal", 0x2246 , 0 },
+ { "notapproxequal", 0x2247 , 0 },
+ { "almostequal", 0x2248 , 0 },
+ { "notalmostequal", 0x2249 , 0 },
+ { "almostorequal", 0x224a , 0 },
+ { "tildetrpl", 0x224b , 0 },
+ { "equivasymptotic", 0x224d , 0 },
+ { "geomequivalent", 0x224e , 0 },
+ { "difference", 0x224f , 0 },
+ { "approachlimit", 0x2250 , 0 },
+ { "geomequal", 0x2251 , 0 },
+ { "imageorapproxequal", 0x2253 , 0 },
+ { "colonequal", 0x2254 , 0 },
+ { "equalcolon", 0x2255 , 0 },
+ { "ringinequal", 0x2256 , 0 },
+ { "ringequal", 0x2257 , 0 },
+ { "corresponds", 0x2258 , 0 },
+ { "estimates", 0x2259 , 0 },
+ { "equiangular", 0x225a , 0 },
+ { "starequal", 0x225b , 0 },
+ { "deltaequal", 0x225c , 0 },
+ { "definequal", 0x225d , 0 },
+ { "measurequal", 0x225e , 0 },
+ { "questionequal", 0x225f , 0 },
+ { "notequivalence", 0x2262 , 0 },
+ { "strictequivalence", 0x2263 , 0 },
+ { "lessdblequal", 0x2266 , 0 },
+ { "greaterdblequal", 0x2267 , 0 },
+ { "lessnotdblequal", 0x2268 , 0 },
+ { "greaternotdblequal", 0x2269 , 0 },
+ { "lessmuch", 0x226a , 0 },
+ { "greatermuch", 0x226b , 0 },
+ { "between", 0x226c , 0 },
+ { "notequivasymptotic", 0x226d , 0 },
+ { "notlessequal", 0x2270 , 0 },
+ { "notgreaterequal", 0x2271 , 0 },
+ { "lessequivlnt", 0x2272 , 0 },
+ { "greaterequivlnt", 0x2273 , 0 },
+ { "notlessequivlnt", 0x2274 , 0 },
+ { "notgreaterequivlnt", 0x2275 , 0 },
+ { "notlessgreater", 0x2278 , 0 },
+ { "notgreaterless", 0x2279 , 0 },
+ { "follows", 0x227b , 0 },
+ { "precedesequal", 0x227c , 0 },
+ { "followsequal", 0x227d , 0 },
+ { "precedequivlnt", 0x227e , 0 },
+ { "followsequivlnt", 0x227f , 0 },
+ { "notpreceeds", 0x2280 , 0 },
+ { "notfollows", 0x2281 , 0 },
+ { "notpropersubset", 0x2284 , 0 },
+ { "notpropersuperset", 0x2285 , 0 },
+ { "notreflexsubset", 0x2288 , 0 },
+ { "notreflexsuperset", 0x2289 , 0 },
+ { "multiset", 0x228c , 0 },
+ { "multiplymultiset", 0x228d , 0 },
+ { "unionmulti", 0x228e , 0 },
+ { "squareimage", 0x228f , 0 },
+ { "squareoriginal", 0x2290 , 0 },
+ { "subsetsqequal", 0x2291 , 0 },
+ { "supersetsqequal", 0x2292 , 0 },
+ { "intersectionsq", 0x2293 , 0 },
+ { "unionsq", 0x2294 , 0 },
+ { "circleminus", 0x2296 , 0 },
+ { "circledivide", 0x2298 , 0 },
+ { "circledot", 0x2299 , 0 },
+ { "circlering", 0x229a , 0 },
+ { "circleasterisk", 0x229b , 0 },
+ { "circleequal", 0x229c , 0 },
+ { "circlevertbar", 0x229d , 0 },
+ { "squareplus", 0x229e , 0 },
+ { "squareminus", 0x229f , 0 },
+ { "squaremultiply", 0x22a0 , 0 },
+ { "squaredot", 0x22a1 , 0 },
+ { "turnstileleft", 0x22a2 , 0 },
+ { "turnstileright", 0x22a3 , 0 },
+ { "latticetop", 0x22a4 , 0 },
+ { "assertion", 0x22a6 , 0 },
+ { "truestate", 0x22a7 , 0 },
+ { "satisfy", 0x22a8 , 0 },
+ { "force", 0x22a9 , 0 },
+ { "tacktrpl", 0x22aa , 0 },
+ { "forceextr", 0x22ab , 0 },
+ { "notturnstileleft", 0x22ac , 0 },
+ { "notsatisfy", 0x22ad , 0 },
+ { "notforce", 0x22ae , 0 },
+ { "notforceextr", 0x22af , 0 },
+ { "lowerrank", 0x22b0 , 0 },
+ { "higherrank", 0x22b1 , 0 },
+ { "triangleright", 0x22b2 , 0 },
+ { "triangleleft", 0x22b3 , 0 },
+ { "triangleftequal", 0x22b4 , 0 },
+ { "triangrightequal", 0x22b5 , 0 },
+ { "original", 0x22b6 , 0 },
+ { "image", 0x22b7 , 0 },
+ { "multimap", 0x22b8 , 0 },
+ { "hermitconjmatrix", 0x22b9 , 0 },
+ { "intercal", 0x22ba , 0 },
+ { "xor", 0x22bb , 0 },
+ { "nand", 0x22bc , 0 },
+ { "nor", 0x22bd , 0 },
+ { "rightanglearc", 0x22be , 0 },
+ { "narylogicaland", 0x22c0 , 0 },
+ { "narylogicalor", 0x22c1 , 0 },
+ { "naryintersection", 0x22c2 , 0 },
+ { "naryunion", 0x22c3 , 0 },
+ { "diamondmath", 0x22c4 , 0 },
+ { "divideonmultiply", 0x22c7 , 0 },
+ { "bowtie", 0x22c8 , 0 },
+ { "multicloseleft", 0x22c9 , 0 },
+ { "multicloseright", 0x22ca , 0 },
+ { "multiopenleft", 0x22cb , 0 },
+ { "multiopenright", 0x22cc , 0 },
+ { "revasymptequal", 0x22cd , 0 },
+ { "curlor", 0x22ce , 0 },
+ { "curland", 0x22cf , 0 },
+ { "subsetdbl", 0x22d0 , 0 },
+ { "supersetdbl", 0x22d1 , 0 },
+ { "uniondbl", 0x22d2 , 0 },
+ { "intersectiondbl", 0x22d3 , 0 },
+ { "fork", 0x22d4 , 0 },
+ { "equalparallel", 0x22d5 , 0 },
+ { "lessdot", 0x22d6 , 0 },
+ { "greaterdot", 0x22d7 , 0 },
+ { "verymuchless", 0x22d8 , 0 },
+ { "verymuchgreater", 0x22d9 , 0 },
+ { "lessequalgreater", 0x22da , 0 },
+ { "greaterequalless", 0x22db , 0 },
+ { "equalless", 0x22dc , 0 },
+ { "equalgreater", 0x22dd , 0 },
+ { "equalprecedes", 0x22de , 0 },
+ { "equalfollows", 0x22df , 0 },
+ { "preceedsnotequal", 0x22e0 , 0 },
+ { "followsnotequal", 0x22e1 , 0 },
+ { "notsubsetsqequal", 0x22e2 , 0 },
+ { "notsupersetsqequal", 0x22e3 , 0 },
+ { "sqimageornotequal", 0x22e4 , 0 },
+ { "sqoriginornotequal", 0x22e5 , 0 },
+ { "lessnotequivlnt", 0x22e6 , 0 },
+ { "greaternotequivlnt", 0x22e7 , 0 },
+ { "preceedsnotsimilar", 0x22e8 , 0 },
+ { "followsnotequivlnt", 0x22e9 , 0 },
+ { "nottriangleleft", 0x22ea , 0 },
+ { "nottriangleright", 0x22eb , 0 },
+ { "nottriangleleftequal", 0x22ec , 0 },
+ { "nottrianglerightequal", 0x22ed , 0 },
+ { "vertellipsis", 0x22ee , 0 },
+ { "midhorizellipsis", 0x22ef , 0 },
+ { "upslopeellipsis", 0x22f0 , 0 },
+ { "downslopeellipsis", 0x22f1 , 0 },
+ { "perspcorrespond", 0x2306 , 0 },
+ { "ceilingleft", 0x2308 , 0 },
+ { "ceilingright", 0x2309 , 0 },
+ { "floorleft", 0x230a , 0 },
+ { "floorright", 0x230b , 0 },
+ { "slurabove", 0x2322 , 0 },
+ { "slurbelow", 0x2323 , 0 },
+ { "null", 0x2400 , 0 },
+ { "startofhead", 0x2401 , 0 },
+ { "starttext", 0x2402 , 0 },
+ { "endtext", 0x2403 , 0 },
+ { "endtrans", 0x2404 , 0 },
+ { "enquiry", 0x2405 , 0 },
+ { "acknowledge", 0x2406 , 0 },
+ { "bell", 0x2407 , 0 },
+ { "backspace", 0x2408 , 0 },
+ { "horiztab", 0x2409 , 0 },
+ { "linefeed", 0x240a , 0 },
+ { "verttab", 0x240b , 0 },
+ { "formfeed", 0x240c , 0 },
+ { "shiftout", 0x240e , 0 },
+ { "shiftin", 0x240f , 0 },
+ { "datalinkescape", 0x2410 , 0 },
+ { "devcon1", 0x2411 , 0 },
+ { "devcon2", 0x2412 , 0 },
+ { "devcon3", 0x2413 , 0 },
+ { "devcon4", 0x2414 , 0 },
+ { "negacknowledge", 0x2415 , 0 },
+ { "synch", 0x2416 , 0 },
+ { "endtransblock", 0x2417 , 0 },
+ { "cancel", 0x2418 , 0 },
+ { "endmedium", 0x2419 , 0 },
+ { "substitute", 0x241a , 0 },
+ { "escape", 0x241b , 0 },
+ { "fileseparator", 0x241c , 0 },
+ { "groupseparator", 0x241d , 0 },
+ { "recordseparator", 0x241e , 0 },
+ { "unitseparator", 0x241f , 0 },
+ { "spaceliteral", 0x2420 , 0 },
+ { "delete", 0x2421 , 0 },
+ { "blankb", 0x2422 , 0 },
+ { "spaceopenbox", 0x2423 , 0 },
+ { "newline", 0x2424 , 0 },
+ { "lthorizform", 0x2500 , 0 },
+ { "hvhorizform", 0x2501 , 0 },
+ { "ltvertform", 0x2502 , 0 },
+ { "hvvertform", 0x2503 , 0 },
+ { "ltdashtriphorizform", 0x2504 , 0 },
+ { "hvdashtriphorizform", 0x2505 , 0 },
+ { "ltdashtripvertform", 0x2506 , 0 },
+ { "hvdashtripvertform", 0x2507 , 0 },
+ { "ltdashquadhorizform", 0x2508 , 0 },
+ { "hvdashquadhorizform", 0x2509 , 0 },
+ { "ltdashquadvertform", 0x250a , 0 },
+ { "hvdashquadvertform", 0x250b , 0 },
+ { "ltdnrtform", 0x250c , 0 },
+ { "dnltrthvform", 0x250d , 0 },
+ { "dnhvrtltform", 0x250e , 0 },
+ { "hvdnrtform", 0x250f , 0 },
+ { "ltdnleftform", 0x2510 , 0 },
+ { "dnltlefthvform", 0x2511 , 0 },
+ { "dnhvleftltform", 0x2512 , 0 },
+ { "hvdnleftform", 0x2513 , 0 },
+ { "ltuprtform", 0x2514 , 0 },
+ { "upltrthvform", 0x2515 , 0 },
+ { "uphvrtltform", 0x2516 , 0 },
+ { "hvuprtform", 0x2517 , 0 },
+ { "ltupleftform", 0x2518 , 0 },
+ { "upltlefthvform", 0x2519 , 0 },
+ { "uphvleftltform", 0x251a , 0 },
+ { "hvupleftform", 0x251b , 0 },
+ { "ltvertrightform", 0x251c , 0 },
+ { "vertltrthvform", 0x251d , 0 },
+ { "uphvrtdnltform", 0x251e , 0 },
+ { "dnhvrtupltform", 0x251f , 0 },
+ { "verthvrtltform", 0x2520 , 0 },
+ { "dnltrtuphvform", 0x2521 , 0 },
+ { "upltrtdnhvform", 0x2522 , 0 },
+ { "hvvertrtform", 0x2523 , 0 },
+ { "ltvertleftform", 0x2524 , 0 },
+ { "vtltlefthvform", 0x2525 , 0 },
+ { "uphvleftdnltform", 0x2526 , 0 },
+ { "dnhvleftupltform", 0x2527 , 0 },
+ { "verthvleftltform", 0x2528 , 0 },
+ { "dnltleftuphvform", 0x2529 , 0 },
+ { "upltleftdnhvform", 0x252a , 0 },
+ { "hvvertleftform", 0x252b , 0 },
+ { "ltdnhorizform", 0x252c , 0 },
+ { "lefthvrtdnltform", 0x252d , 0 },
+ { "rthvleftdnltform", 0x252e , 0 },
+ { "dnlthorizhvform", 0x252f , 0 },
+ { "dnhvhorizltform", 0x2530 , 0 },
+ { "rtltrtdnhvform", 0x2531 , 0 },
+ { "leftltrtdnhvform", 0x2532 , 0 },
+ { "hvdnhorizform", 0x2533 , 0 },
+ { "ltuphorizform", 0x2534 , 0 },
+ { "lefthvrtupltform", 0x2535 , 0 },
+ { "rthvleftupltform", 0x2536 , 0 },
+ { "uplthorizhvform", 0x2537 , 0 },
+ { "uphvhorizltform", 0x2538 , 0 },
+ { "rtltleftuphvform", 0x2539 , 0 },
+ { "leftltrtuphvform", 0x253a , 0 },
+ { "hvuphorizform", 0x253b , 0 },
+ { "ltverthorizform", 0x253c , 0 },
+ { "lefthvrtvertltform", 0x253d , 0 },
+ { "rthvleftvertltform", 0x253e , 0 },
+ { "vertlthorizhvform", 0x253f , 0 },
+ { "uphvdnhorizltform", 0x2540 , 0 },
+ { "dnhvuphorizltform", 0x2541 , 0 },
+ { "verthvhorizltform", 0x2542 , 0 },
+ { "leftuphvrtdnltform", 0x2543 , 0 },
+ { "rtuphvleftdnltform", 0x2544 , 0 },
+ { "leftdnhvrtupltform", 0x2545 , 0 },
+ { "rtdnhvleftupltform", 0x2546 , 0 },
+ { "dnltuphorizhvform", 0x2547 , 0 },
+ { "upltdnhorizhvform", 0x2548 , 0 },
+ { "rtltleftverthvform", 0x2549 , 0 },
+ { "leftltrtverthvform", 0x254a , 0 },
+ { "hvverthorizform", 0x254b , 0 },
+ { "ltdashdblhorizform", 0x254c , 0 },
+ { "hvdashdblhorizform", 0x254d , 0 },
+ { "ltdashdblvertform", 0x254e , 0 },
+ { "hvdashdblvertform", 0x254f , 0 },
+ { "horizdblbar", 0x2550 , 0 },
+ { "vertdblbar", 0x2551 , 0 },
+ { "dnrtdblform", 0x2552 , 0 },
+ { "dndblrtform", 0x2553 , 0 },
+ { "dbldnrtform", 0x2554 , 0 },
+ { "dnleftdblform", 0x2555 , 0 },
+ { "dndblleftform", 0x2556 , 0 },
+ { "dbldnleftform", 0x2557 , 0 },
+ { "uprtdblform", 0x2558 , 0 },
+ { "updblrtform", 0x2559 , 0 },
+ { "dbluprtform", 0x255a , 0 },
+ { "upleftdblform", 0x255b , 0 },
+ { "updblleftform", 0x255c , 0 },
+ { "dblupleftform", 0x255d , 0 },
+ { "vertrtdblform", 0x255e , 0 },
+ { "vertdblrtform", 0x255f , 0 },
+ { "dblvertrtform", 0x2560 , 0 },
+ { "vertleftdblform", 0x2561 , 0 },
+ { "vertdblleftform", 0x2562 , 0 },
+ { "dblvertleftform", 0x2563 , 0 },
+ { "dnhorizdblform", 0x2564 , 0 },
+ { "dndblhorizform", 0x2565 , 0 },
+ { "dbldnhorizform", 0x2566 , 0 },
+ { "uphorizdblform", 0x2567 , 0 },
+ { "updblhorizform", 0x2568 , 0 },
+ { "dbluphorizform", 0x2569 , 0 },
+ { "verthorizdblform", 0x256a , 0 },
+ { "vertdblhorizform", 0x256b , 0 },
+ { "dblverthorizform", 0x256c , 0 },
+ { "ltarcdnrtform", 0x256d , 0 },
+ { "ltarcdnleftform", 0x256e , 0 },
+ { "ltarcupleftform", 0x256f , 0 },
+ { "ltarcuprtform", 0x2570 , 0 },
+ { "forwarddiagonal", 0x2571 , 0 },
+ { "backwarddiagonal", 0x2572 , 0 },
+ { "ltdiagonalcross", 0x2573 , 0 },
+ { "dneighthblock", 0x2581 , 0 },
+ { "dnquarterblock", 0x2582 , 0 },
+ { "dnthreeeighthblock", 0x2583 , 0 },
+ { "dnfiveeighthblock", 0x2585 , 0 },
+ { "dnthreequarterblock", 0x2586 , 0 },
+ { "dnseveneighthblock", 0x2587 , 0 },
+ { "lfseveneighthblock", 0x2589 , 0 },
+ { "lfthreequarterblock", 0x258a , 0 },
+ { "lffiveeighthblock", 0x258b , 0 },
+ { "lfthreeeighthblock", 0x258d , 0 },
+ { "lfquarterblock", 0x258e , 0 },
+ { "lfeighthblock", 0x258f , 0 },
+ { "upeighthblock", 0x2594 , 0 },
+ { "rteighthblock", 0x2595 , 0 },
+ { "box", 0x25a1 , 0 },
+ { "boxrounded", 0x25a2 , 0 },
+ { "boxnested", 0x25a3 , 0 },
+ { "boxhorizhatch", 0x25a4 , 0 },
+ { "boxverthatch", 0x25a5 , 0 },
+ { "boxcrosshatch", 0x25a6 , 0 },
+ { "boxleftdiaghatch", 0x25a7 , 0 },
+ { "boxrtdiaghatch", 0x25a8 , 0 },
+ { "boxcrossdiaghatch", 0x25a9 , 0 },
+ { "smallboxfilled", 0x25aa , 0 },
+ { "smallbox", 0x25ab , 0 },
+ { "rectangle", 0x25ad , 0 },
+ { "filledvertrect", 0x25ae , 0 },
+ { "vertrectangle", 0x25af , 0 },
+ { "filledparallelogram", 0x25b0 , 0 },
+ { "parallelogram", 0x25b1 , 0 },
+ { "triangle", 0x25b3 , 0 },
+ { "smalltrianglesld", 0x25b4 , 0 },
+ { "smalltriangle", 0x25b5 , 0 },
+ { "trianglerightsld1", 0x25b6 , 0 },
+ { "triangleright1", 0x25b7 , 0 },
+ { "smalltrianglerightsld", 0x25b8 , 0 },
+ { "smalltriangleright", 0x25b9 , 0 },
+ { "triagrtopen", 0x25bb , 0 },
+ { "triangleinv", 0x25bd , 0 },
+ { "smalltriangleinvsld", 0x25be , 0 },
+ { "smalltriangleinv", 0x25bf , 0 },
+ { "triangleleftsld1", 0x25c0 , 0 },
+ { "triangleleft1", 0x25c1 , 0 },
+ { "smalltriangleleftsld", 0x25c2 , 0 },
+ { "smalltriangleleft", 0x25c3 , 0 },
+ { "triaglfopen", 0x25c5 , 0 },
+ { "diamondrhombsolid", 0x25c6 , 0 },
+ { "diamondrhomb", 0x25c7 , 0 },
+ { "diamondrhombnested", 0x25c8 , 0 },
+ { "circledash", 0x25cc , 0 },
+ { "circleverthatch", 0x25cd , 0 },
+ { "circlesolid", 0x25cf , 0 },
+ { "circleleftsld", 0x25d0 , 0 },
+ { "circlerightsld", 0x25d1 , 0 },
+ { "circlebottomsld", 0x25d2 , 0 },
+ { "circletopsld", 0x25d3 , 0 },
+ { "circlenesld", 0x25d4 , 0 },
+ { "circlenwopen", 0x25d5 , 0 },
+ { "semicircleleftsld", 0x25d6 , 0 },
+ { "semicirclelertsld", 0x25d7 , 0 },
+ { "invsemicircleup", 0x25da , 0 },
+ { "invsemicircledn", 0x25db , 0 },
+ { "nwquadarc", 0x25dc , 0 },
+ { "nequadarc", 0x25dd , 0 },
+ { "sequadarc", 0x25de , 0 },
+ { "swquadarc", 0x25df , 0 },
+ { "toparc", 0x25e0 , 0 },
+ { "bottomarc", 0x25e1 , 0 },
+ { "trianglesesld", 0x25e2 , 0 },
+ { "triangleswsld", 0x25e3 , 0 },
+ { "tranglenwsld", 0x25e4 , 0 },
+ { "trianglenesld", 0x25e5 , 0 },
+ { "squareleftsld", 0x25e7 , 0 },
+ { "squarerightsld", 0x25e8 , 0 },
+ { "squarenwsld", 0x25e9 , 0 },
+ { "squaresesld", 0x25ea , 0 },
+ { "squarevertbisect", 0x25eb , 0 },
+ { "triangledot", 0x25ec , 0 },
+ { "triangleleftsld", 0x25ed , 0 },
+ { "trianglerightsld", 0x25ee , 0 },
+ { "heartopen", 0x2661 , 0 },
+ { "diamondopen", 0x2662 , 0 },
+ { "spadeopen", 0x2664 , 0 },
+ { "Omegaiotasubleniscircumflex", 0x1fae , 0 },
+ { "Omegaleniscircumflex", 0x1f6e , 0 },
+ { "Upsilonaspercircumflex", 0x1f5f , 0 },
+ { "dieresiscircumflex", 0x1fc1 , 0 },
+ { "leniscircumflex", 0x1fcf , 0 },
+ { "aspercircumflex", 0x1fdf , 0 },
+ { "alphaleniscircumflex", 0x1f06 , 0 },
+ { "alphaaspercircumflex", 0x1f07 , 0 },
+ { "etaleniscircumflex", 0x1f26 , 0 },
+ { "etaaspercircumflex", 0x1f27 , 0 },
+ { "iotaleniscircumflex", 0x1f36 , 0 },
+ { "iotaaspercircumflex", 0x1f37 , 0 },
+ { "upsilonleniscircumflex", 0x1f56 , 0 },
+ { "upsilonaspercircumflex", 0x1f57 , 0 },
+ { "omegaleniscircumflex", 0x1f66 , 0 },
+ { "omegaaspercircumflex", 0x1f67 , 0 },
+ { "alphaiotasubleniscircumflex", 0x1f86 , 0 },
+ { "alphaiotasubaspercircumflex", 0x1f87 , 0 },
+ { "etaiotasubleniscircumflex", 0x1f96 , 0 },
+ { "etaiotasubaspercircumflex", 0x1f97 , 0 },
+ { "omegaiotasubleniscircumflex", 0x1fa6 , 0 },
+ { "omegaiotasubaspercircumflex", 0x1fa7 , 0 },
+ { "alphacircumflex", 0x1fb6 , 0 },
+ { "alphaiotasubcircumflex", 0x1fb7 , 0 },
+ { "etacircumflex", 0x1fc6 , 0 },
+ { "etaiotasubcircumflex", 0x1fc7 , 0 },
+ { "iotacircumflex", 0x1fd6 , 0 },
+ { "iotadieresiscircumflex", 0x1fd7 , 0 },
+ { "upsiloncircumflex", 0x1fe6 , 0 },
+ { "omegacircumflex", 0x1ff6 , 0 },
+ { "omegaiotasubcircumflex", 0x1ff7 , 0 },
+ { "upsilondieresiscircumflex", 0x1fe7 , 0 },
+ { "dialytika", 0x0308 , 0 },
+ { "koronis", 0x1fbd , 0 },
+ { "prosgegrammeni", 0x1fbe , 0 },
+ { "psili", 0x1fbf , 0 },
+ { "perispomeni", 0x1fc0 , 0 },
+ { "varia", 0x1fef , 0 },
+ { "oxia", 0x1ffd , 0 },
+ { "dasia", 0x1ffe , 0 },
+ { "Alphasmall", 0xf500 , 0 },
+ { "Betasmall", 0xf501 , 0 },
+ { "Gammasmall", 0xf502 , 0 },
+ { "Deltasmall", 0xf503 , 0 },
+ { "Epsilonsmall", 0xf504 , 0 },
+ { "Zetasmall", 0xf505 , 0 },
+ { "Etasmall", 0xf506 , 0 },
+ { "Thetasmall", 0xf507 , 0 },
+ { "Iotasmall", 0xf508 , 0 },
+ { "Kappasmall", 0xf509 , 0 },
+ { "Lambdasmall", 0xf50a , 0 },
+ { "Musmall", 0xf50b , 0 },
+ { "Nusmall", 0xf50c , 0 },
+ { "Xismall", 0xf50d , 0 },
+ { "Omicronsmall", 0xf50e , 0 },
+ { "Pismall", 0xf50f , 0 },
+ { "Rhosmall", 0xf510 , 0 },
+ { "Sigmasmall", 0xf512 , 0 },
+ { "Tausmall", 0xf513 , 0 },
+ { "Upsilonsmall", 0xf514 , 0 },
+ { "Phismall", 0xf515 , 0 },
+ { "Chismall", 0xf516 , 0 },
+ { "Psismall", 0xf517 , 0 },
+ { "Omegasmall", 0xf518 , 0 },
+ { "Iotadieresissmall", 0xf519 , 0 },
+ { "Upsilondieresissmall", 0xf51a , 0 },
+ { "uni2A0B.lgdisplay", 0xea57 , 0 },
+ { "uni2A0B.uplgdisplay", 0xea57 , 0 },
+ { "uni2A15.lgdisplay", 0xe376 , 0 },
+ { "uni2A15.uplgdisplay", 0xe376 , 0 },
+ { "uni2A16.lgdisplay", 0xe377 , 0 },
+ { "uni2A16.uplgdisplay", 0xe377 , 0 },
+ { "uni2A10.lgdisplay", 0xe395 , 0 },
+ { "uni2A10.uplgdisplay", 0xe395 , 0 },
+ { "uni2A12.lgdisplay", 0xe397 , 0 },
+ { "uni2A12.uplgdisplay", 0xe397 , 0 },
+ { "uni2A13.lgdisplay", 0xe398 , 0 },
+ { "uni2A13.uplgdisplay", 0xe398 , 0 },
+ { "uni2A14.lgdisplay", 0xe399 , 0 },
+ { "uni2A14.uplgdisplay", 0xe399 , 0 },
+ { "uni2A17.lgdisplay", 0xe39a , 0 },
+ { "uni2A17.uplgdisplay", 0xe39a , 0 },
+ { "uni2A11.uplgdisplay", 0xe39b , 0 },
+ { "uni2A11.lgdisplay", 0xe39b , 0 },
+ { "uni2A0F.lgdisplay", 0xe3d3 , 0 },
+ { "uni2A0F.uplgdisplay", 0xe3d3 , 0 },
+/* From Richard Kinch's TeX list of glyph aliases */
+ { "fscript", 0x192 , 0 },
+ { "fraction1", 0x2215 , 0 },
+ { "negationslash", 0x2215 , 0 },
+ { "circleR", 0xae , 0 },
+ { "circlecopyrt", 0xa9 , 0 },
+ { "smile", 0x263a , 0 },
+ { "Ifractur", 0x2111 , 0 },
+ { "Rfractur", 0x211C , 0 },
+ { "Omegainv", 0x2127 , 0 },
+ { "mho", 0x2127 , 0 },
+ { "alephmath", 0x2135 , 0 },
+ { "beth", 0x2136 , 0 },
+ { "bethmath", 0x2136 , 0 },
+ { "gimelmath", 0x2137 , 0 },
+ { "daleth", 0x2138 , 0 },
+ { "daletmath", 0x2138 , 0 },
+ { "arrowbothv", 0x2195 , 0 },
+ { "prime1", 0x2032 , 0 },
+ { "primerev1", 0x2035 , 0 },
+ { "primereverse", 0x2035 , 0 },
+ { "followsequal1", 0x227d , 0 },
+ { "similarequal", 0x2243 , 0 },
+ { "square", 0x25a1 , 0 },
+ { "squaresolid", 0x25a0 , 0 },
+ { "squaresmallsolid", 0x25aa , 0 },
+ { "diamondsolid", 0x25c6 , 0 },
+ { "clockwise", 0x21bb , 0 },
+ { "anticlockwise", 0x21ba , 0 },
+ { "forces", 0x22a9 , 0 },
+ { "forcesbar", 0x22aa , 0 },
+ { "satisfies", 0x22a8 , 0 },
+ { "dblarrowdwn", 0x21ca , 0 },
+ { "shiftleft", 0x2196 , 0 },
+ { "shiftright", 0x2197 , 0 },
+ { "squiggleright", 0x21dd , 0 },
+ { "squiggleleft", 0x21dc , 0 },
+ { "squiggleleftright", 0x21ad , 0 },
+ { "curlyleft", 0x21ab , 0 },
+ { "curlyright", 0x21ac , 0 },
+ { "followsorequal", 0x227d , 0 },
+ { "equalsdots", 0x2251 , 0 },
+ { "defines", 0x225c , 0 },
+ { "ng", 0x014b , 0 },
+ { "Ng", 0x014a , 0 },
+ { "visiblespace", 0x2420 , 0 },
+ { "dslash", 0x0111 , 0 },
+ { "tie1", 0x2040 , 0 },
+ { "arrowdblbothv", 0x21d5 , 0 },
+ { "precedesequal1", 0x227c , 0 },
+ { "greaterorsimilar", 0x2273 , 0 },
+ { "precedesorequal", 0x227e , 0 },
+ { "lessorsimilar", 0x2272 , 0 },
+ { "equalorgreater", 0x22dd , 0 },
+ { "lessorequalslant", 0x2264 , 0 },
+ { "equaldotrightleft", 0x2253 , 0 },
+ { "equaldotleftright", 0x2252 , 0 },
+ { "followsorcurly", 0x227d , 0 },
+ { "greaterorequalslant", 0x2265 , 0 },
+ { "trianglerightequal", 0x22b5 , 0 },
+ { "triangleleftequal", 0x22b4 , 0 },
+ { "triangledownsld", 0x25bc , 0 },
+ { "arrowaxisright", 0x2192 , 0 },
+ { "arrowaxisleft", 0x2190 , 0 },
+ { "trianglesolid", 0x25b2 , 0 },
+ { "greaterlessequal", 0x22db , 0 },
+ { "orunderscore", 0x22bb , 0 },
+ { "frown", 0x2322 , 0 },
+ { "uprise", 0x22cf , 0 },
+ { "downfall", 0x22ce , 0 },
+ { "subsetdblequal", 0x2286 , 0 },
+ { "supersetdblequal", 0x2287 , 0 },
+ { "Finv", 0x2132 , 0 },
+ { "notarrowboth", 0x21ae , 0 },
+ { "archleftdown", 0x21b6 , 0 },
+ { "archrightdown", 0x21b7 , 0 },
+ { "notdblarrowleft", 0x21cd , 0 },
+ { "notdblarrowboth", 0x21ce , 0 },
+ { "notdblarrowright", 0x21cf , 0 },
+ { "epsiloninv", 0x220a , 0 },
+ { "equalorsimilar", 0x2242 , 0 },
+ { "notprecedes", 0x2280 , 0 },
+ { "notsubseteql", 0x2288 , 0 },
+ { "notsuperseteql", 0x2289 , 0 },
+ { "subsetnoteql", 0x228a , 0 },
+ { "supersetnoteql", 0x228b , 0 },
+ { "notturnstile", 0x22ac , 0 },
+ { "notforcesextra", 0x22af , 0 },
+ { "dividemultiply", 0x22c7 , 0 },
+ { "notprecedesoreql", 0x22e0 , 0 },
+ { "notfollowsoreql", 0x22e1 , 0 },
+ { "lessornotsimilar", 0x22e6 , 0 },
+ { "greaterornotsimilar", 0x22e7 , 0 },
+ { "precedeornoteqvlnt", 0x22e8 , 0 },
+ { "followornoteqvlnt", 0x22e9 , 0 },
+ { "nottriangeqlleft", 0x22ec , 0 },
+ { "nottriangeqlright", 0x22ed , 0 },
+ { "angbracketleft", 0x3008 , 0 },
+ { "angbracketright", 0x3009 , 0 },
+ { "check", 0x2713 , 0 },
+ { "circleS", 0x24c8 , 0 },
+ { "rightanglenw", 0x250c , 0 },
+ { "rightanglene", 0x2510 , 0 },
+ { "rightanglesw", 0x2514 , 0 },
+ { "rightanglese", 0x2518 , 0 },
+ { "Yen", 0x00a5 , 0 },
+ { "permill", 0x2030 , 0 },
+ { "recipe", 0x211e , 0 },
+ { "pertenmill", 0x2031 , 0 },
+ { "lnot", 0x00ac , 0 },
+ { "circleP", 0x2117 , 0 },
+ { "surd", 0x221a , 0 },
+ { "asciigrave", 0x60 , 0 },
+ { "asciigrave", 0x60 , 0 },
+ { "asciiacute", 0xb4 , 0 },
+ { "asciidieresis", 0xa8 , 0 },
+ { "pilcrow", 0xb6 , 0 },
+/* Useful names to use to find glyphs */
+ { "circumflexcomb", 0x302 , 0 },
+ { "macroncomb", 0x304 , 0 },
+ { "brevecomb", 0x306 , 0 },
+ { "diaeresiscomb", 0x308 , 0 },
+ { "caroncomb", 0x30c , 0 },
+ { "vrachycomb", 0x306 , 0 },
+ { "psilicomb", 0x313 , 0 },
+ { "dasiacomb", 0x314 , 0 },
+ { "psilivaria", 0x1fcd , 0 },
+ { "psilioxia", 0x1fce , 0 },
+ { "psiliperispomeni", 0x1fcf , 0 },
+ { "dasiavaria", 0x1fdd , 0 },
+ { "dasiaoxia", 0x1fde , 0 },
+ { "dasiaperispomeni", 0x1fdf , 0 },
+ { "dialytikavaria", 0x1fed , 0 },
+ { "dialytikaoxia", 0x1fee , 0 },
+ { "dialytikaperispomeni", 0x1fc1 , 0 },
+/* Adobe spells diaeresis the American way, as dieresis */
+ { "diaeresis", 0xa8 , 0 },
+ { "Adiaeresis", 0xC4 , 0 },
+ { "Ediaeresis", 0xCB , 0 },
+ { "Idiaeresis", 0xCF , 0 },
+ { "Odiaeresis", 0xD6 , 0 },
+ { "Udiaeresis", 0xDC , 0 },
+ { "adiaeresis", 0xE4 , 0 },
+ { "ediaeresis", 0xEB , 0 },
+ { "idiaeresis", 0xEF , 0 },
+ { "odiaeresis", 0xF6 , 0 },
+ { "udiaeresis", 0xFC , 0 },
+ { "Ydiaeresis", 0x178 , 0 },
+ { "diaeresistonos", 0x385 , 0 },
+ { "iotadiaeresistonos", 0x390 , 0 },
+ { "Iotadiaeresis", 0x3AA , 0 },
+ { "Upsilondiaeresis", 0x3AB , 0 },
+ { "upsilondiaeresistonos", 0x3B0 , 0 },
+ { "iotadiaeresis", 0x3CA , 0 },
+ { "upsilondiaeresis", 0x3CB , 0 },
+ { "Wdiaeresis", 0x1e84 , 0 },
+ { "wdiaeresis", 0x1e85 , 0 },
+ { "ETH", 0xd0 , 0 },
+ { "THORN", 0xde , 0 },
+ { "ssharp", 0xdf , 0 },
+ { "Ooblique", 0xd8 , 0 },
+ { "notsign", 0xac , 0 },
+/* Sun has used "masculine" for ordmasculine */
+ { NULL, 0, 0 },
+};
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c
new file mode 100644
index 00000000000..bc23f7d23c4
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/noprefs.c
@@ -0,0 +1,602 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include "plugins.h"
+#include <charset.h>
+#include <gfile.h>
+#include <ustring.h>
+
+#include <sys/types.h>
+#include <dirent.h>
+#include <locale.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+
+#include "ttf.h"
+
+#if HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
+
+static char *othersubrsfile = NULL;
+
+extern int adjustwidth;
+extern int adjustlbearing;
+extern Encoding *default_encoding;
+extern int autohint_before_rasterize;
+extern int autohint_before_generate;
+extern int accent_offset;
+extern int GraveAcuteCenterBottom;
+extern int PreferSpacingAccents;
+extern int CharCenterHighest;
+extern int recognizePUA;
+extern int snaptoint;
+extern float joinsnap;
+extern char *BDFFoundry;
+extern char *TTFFoundry;
+extern char *xuid;
+extern char *SaveTablesPref;
+extern int maxundoes; /* in cvundoes */
+extern int prefer_cjk_encodings; /* in parsettf */
+extern int onlycopydisplayed, copymetadata, copyttfinstr;
+extern int oldformatstate; /* in savefontdlg.c */
+extern int oldbitmapstate; /* in savefontdlg.c */
+extern int old_ttf_flags; /* in savefontdlg.c */
+extern int old_ps_flags; /* in savefontdlg.c */
+extern int old_otf_flags; /* in savefontdlg.c */
+extern int preferpotrace; /* in autotrace.c */
+extern int autotrace_ask; /* in autotrace.c */
+extern int mf_ask; /* in autotrace.c */
+extern int mf_clearbackgrounds; /* in autotrace.c */
+extern int mf_showerrors; /* in autotrace.c */
+extern char *mf_args; /* in autotrace.c */
+extern int coverageformatsallowed; /* in tottfgpos.c */
+extern int hint_diagonal_ends; /* in stemdb.c */
+extern int hint_diagonal_intersections; /* in stemdb.c */
+extern int hint_bounding_boxes; /* in stemdb.c */
+extern int detect_diagonal_stems; /* in stemdb.c */
+extern int new_em_size; /* in splineutil2.c */
+extern int new_fonts_are_order2; /* in splineutil2.c */
+extern int loaded_fonts_same_as_new; /* in splineutil2.c */
+extern int use_second_indic_scripts; /* in tottfgpos.c */
+extern MacFeat *default_mac_feature_map, /* from macenc.c */
+ *user_mac_feature_map;
+extern int allow_utf8_glyphnames; /* in charinfo.c */
+extern int ask_user_for_cmap; /* in parsettf.c */
+extern NameList *force_names_when_opening;
+extern NameList *force_names_when_saving;
+extern NameList *namelist_for_new_fonts;
+extern int default_fv_row_count; /* in splineutil2.c */
+extern int default_fv_col_count; /* in splineutil2.c */
+extern int use_freetype_to_rasterize_fv; /* in bitmapchar.c */
+
+/* UI preferences which we don't use, but will preserve to so we can read/write */
+/* UI preference files without loss of data */
+static char *xdefs_filename;
+static char *helpdir=NULL; /* in uiutil.c */
+static int splash=1;
+static int cv_auto_goto=1;
+static int OpenCharsInNewWindow=1;
+static float arrowAmount=1;
+static float arrowAccelFactor=10;
+static float snapdistance=3.5;
+static int stop_at_join=0;
+static int updateflex=0; /* in charview.c */
+static int ask_user_for_resolution=1;
+static int default_fv_showhmetrics=0; /* in fontview */
+static int default_fv_showvmetrics=0; /* in fontview */
+static int default_fv_glyphlabel=0; /* in fontview */
+static int save_to_dir=0; /* in fontview, use sfdir rather than sfd */
+static int palettes_docked=1; /* in cvpalettes */
+static int cvvisible[2]={1,1}, bvvisible[3]={1,1,1}; /* in cvpalettes.c */
+static int infowindowdistance=10; /* in cvruler.c */
+static int loacal_markextrema, loacal_markpoi, loacal_showrulers,
+ loacal_showcpinfo, loacal_showsidebearings, loacal_showpoints,
+ loacal_showfilled, loacal_showtabs, loacal_showrefnames;
+static int oldsystem=100;
+static char *oflib_username;
+static char *oflib_password;
+static int rectelipse=0, polystar=0, regular_star=0; /* from cvpalettes.c */
+static int center_out[2]={0,0}; /* from cvpalettes.c */
+static float rr_radius=0; /* from cvpalettes.c */
+static int ps_pointcnt=5; /* from cvpalettes.c */
+static float star_percent=100; /* from cvpalettes.c */
+static int debug_wins=0; /* in cvdebug.c */
+static int gridfit_dpi=100, gridfit_depth=1; /* in cvgridfit.c */
+static float gridfit_pointsizex=12; /* in cvgridfit.c */
+static float gridfit_pointsizey=12; /* in cvgridfit.c */
+static int gridfit_x_sameas_y=true; /* in cvgridfit.c */
+static int default_font_filter_index=0;
+static int ItalicConstrained = true;
+extern int clear_tt_instructions_when_needed; /* cvundoes.c */
+static int default_cv_width; /* in charview.c */
+static int default_cv_height; /* in charview.c */
+static int mv_width; /* in metricsview.c */
+static int mv_height; /* in metricsview.c */
+static int bv_width; /* in bitmapview.c */
+static int bv_height; /* in bitmapview.c */
+static int mvshowgrid; /* in metricsview.c */
+static int old_validate = true;
+static int old_fontlog = false;
+static int home_char = 'A';
+static int compact_font_on_open=0;
+static int oflib_automagic_preview; /* from oflib.c */
+static int aa_pixelsize; /* from anchorsaway.c */
+
+static int gfc_showhidden, gfc_dirplace;
+static char *gfc_bookmarks=NULL;
+static char *pixmapdir=NULL;
+
+enum pref_types { pr_int, pr_real, pr_bool, pr_enum, pr_encoding, pr_string,
+ pr_file, pr_namelist, pr_unicode };
+
+int unused = 0;
+char *unused_string = NULL;
+
+static struct prefs_list {
+ char *name;
+ /* In the prefs file the untranslated name will always be used, but */
+ /* in the UI that name may be translated. */
+ enum pref_types type;
+ void *val;
+ void *(*get)(void);
+ void (*set)(void *);
+ char mn;
+ struct enums *enums;
+ unsigned int dontdisplay: 1;
+ char *popup;
+} core_list[] = {
+ { N_("OtherSubrsFile"), pr_file, &othersubrsfile, NULL, NULL, 'O', NULL, 0, N_("If you wish to replace Adobe's OtherSubrs array (for Type1 fonts)\nwith an array of your own, set this to point to a file containing\na list of up to 14 PostScript subroutines. Each subroutine must\nbe preceded by a line starting with '%%%%' (any text before the\nfirst '%%%%' line will be treated as an initial copyright notice).\nThe first three subroutines are for flex hints, the next for hint\nsubstitution (this MUST be present), the 14th (or 13 as the\nnumbering actually starts with 0) is for counter hints.\nThe subroutines should not be enclosed in a [ ] pair.") },
+ { N_("AutoHint"), pr_bool, &unused, NULL, NULL, 'A', NULL, 0, N_("AutoHint before rasterizing") },
+ { N_("NewCharset"), pr_encoding, &default_encoding, NULL, NULL, 'N', NULL, 0, N_("Default encoding for\nnew fonts") },
+ { N_("NewEmSize"), pr_int, &new_em_size, NULL, NULL, 'S', NULL, 0, N_("The default size of the Em-Square in a newly created font.") },
+ { N_("NewFontsQuadratic"), pr_bool, &new_fonts_are_order2, NULL, NULL, 'Q', NULL, 0, N_("Whether new fonts should contain splines of quadratic (truetype)\nor cubic (postscript & opentype).") },
+ { N_("FreeTypeInFontView"), pr_bool, &unused, NULL, NULL, 'O', NULL, 0, N_("Use the FreeType rasterizer (when available)\nto rasterize glyphs in the font view.\nThis generally results in better quality.") },
+ { N_("LoadedFontsAsNew"), pr_bool, &loaded_fonts_same_as_new, NULL, NULL, 'L', NULL, 0, N_("Whether fonts loaded from the disk should retain their splines\nwith the original order (quadratic or cubic), or whether the\nsplines should be converted to the default order for new fonts\n(see NewFontsQuadratic).") },
+ { N_("PreferCJKEncodings"), pr_bool, &prefer_cjk_encodings, NULL, NULL, 'C', NULL, 0, N_("When loading a truetype or opentype font which has both a unicode\nand a CJK encoding table, use this flag to specify which\nshould be loaded for the font.") },
+ { N_("AskUserForCMap"), pr_bool, &ask_user_for_cmap, NULL, NULL, 'O', NULL, 0, N_("When loading a font in sfnt format (TrueType, OpenType, etc.),\nask the user to specify which cmap to use initially.") },
+ { N_("PreserveTables"), pr_string, &SaveTablesPref, NULL, NULL, 'P', NULL, 0, N_("Enter a list of 4 letter table tags, separated by commas.\nFontForge will make a binary copy of these tables when it\nloads a True/OpenType font, and will output them (unchanged)\nwhen it generates the font. Do not include table tags which\nFontForge thinks it understands.") },
+ { N_("ItalicConstrained"), pr_bool, &ItalicConstrained, NULL, NULL, '\0', NULL, 0, N_("In the Outline View, the Shift key constrains motion to be parallel to the ItalicAngle rather than constraining it to be vertical.") },
+ { N_("SnapToInt"), pr_bool, &snaptoint, NULL, NULL, '\0', NULL, 0, N_("When the user clicks in the editing window, round the location to the nearest integers.") },
+ { N_("JoinSnap"), pr_real, &joinsnap, NULL, NULL, '\0', NULL, 0, N_("The Edit->Join command will join points which are this close together\nA value of 0 means they must be coincident") },
+ { N_("CopyMetaData"), pr_bool, &copymetadata, NULL, NULL, '\0', NULL, 0, N_("When copying glyphs from the font view, also copy the\nglyphs' metadata (name, encoding, comment, etc).") },
+ { N_("UndoDepth"), pr_int, &maxundoes, NULL, NULL, '\0', NULL, 0, N_("The maximum number of Undoes/Redoes stored in a glyph") },
+ { N_("AutoWidthSync"), pr_bool, &adjustwidth, NULL, NULL, '\0', NULL, 0, N_("Changing the width of a glyph\nchanges the widths of all accented\nglyphs based on it.") },
+ { N_("AutoLBearingSync"), pr_bool, &adjustlbearing, NULL, NULL, '\0', NULL, 0, N_("Changing the left side bearing\nof a glyph adjusts the lbearing\nof other references in all accented\nglyphs based on it.") },
+ { N_("ClearInstrsBigChanges"), pr_bool, &clear_tt_instructions_when_needed, NULL, NULL, 'C', NULL, 0, N_("Instructions in a TrueType font refer to\npoints by number, so if you edit a glyph\nin such a way that some points have different\nnumbers (add points, remove them, etc.) then\nthe instructions will be applied to the wrong\npoints with disasterous results.\n Normally FontForge will remove the instructions\nif it detects that the points have been renumbered\nin order to avoid the above problem. You may turn\nthis behavior off -- but be careful!") },
+ { N_("CopyTTFInstrs"), pr_bool, &copyttfinstr, NULL, NULL, '\0', NULL, 0, N_("When copying glyphs from the font view, also copy the\nglyphs' metadata (name, encoding, comment, etc).") },
+ { N_("AccentOffsetPercent"), pr_int, &accent_offset, NULL, NULL, '\0', NULL, 0, N_("The percentage of an em by which an accent is offset from its base glyph in Build Accent") },
+ { N_("AccentCenterLowest"), pr_bool, &GraveAcuteCenterBottom, NULL, NULL, '\0', NULL, 0, N_("When placing grave and acute accents above letters, should\nFontForge center them based on their full width, or\nshould it just center based on the lowest point\nof the accent.") },
+ { N_("CharCenterHighest"), pr_bool, &CharCenterHighest, NULL, NULL, '\0', NULL, 0, N_("When centering an accent over a glyph, should the accent\nbe centered on the highest point(s) of the glyph,\nor the middle of the glyph?") },
+ { N_("PreferSpacingAccents"), pr_bool, &PreferSpacingAccents, NULL, NULL, '\0', NULL, 0, N_("Use spacing accents (Unicode: 02C0-02FF) rather than\ncombining accents (Unicode: 0300-036F) when\nbuilding accented glyphs.") },
+ { N_("PreferPotrace"), pr_bool, &unused, NULL, NULL, '\0', NULL, 0, N_("FontForge supports two different helper applications to do autotracing\n autotrace and potrace\nIf your system only has one it will use that one, if you have both\nuse this option to tell FontForge which to pick.") },
+ { N_("AutotraceArgs"), pr_string, &unused_string, NULL, NULL, '\0', NULL, 0, N_("Extra arguments for configuring the autotrace program\n(either autotrace or potrace)") },
+ { N_("AutotraceAsk"), pr_bool, &unused, NULL, NULL, '\0', NULL, 0, N_("Ask the user for autotrace arguments each time autotrace is invoked") },
+ { N_("MfArgs"), pr_string, &unused_string, NULL, NULL, '\0', NULL, 0, N_("Commands to pass to mf (metafont) program, the filename will follow these") },
+ { N_("MfAsk"), pr_bool, &unused, NULL, NULL, '\0', NULL, 0, N_("Ask the user for mf commands each time mf is invoked") },
+ { N_("MfClearBg"), pr_bool, &unused, NULL, NULL, '\0', NULL, 0, N_("FontForge loads large images into the background of each glyph\nprior to autotracing them. You may retain those\nimages to look at after mf processing is complete, or\nremove them to save space") },
+ { N_("MfShowErr"), pr_bool, &unused, NULL, NULL, '\0', NULL, 0, N_("MetaFont (mf) generates lots of verbiage to stdout.\nMost of the time I find it an annoyance but it is\nimportant to see if something goes wrong.") },
+ { N_("FoundryName"), pr_string, &unused_string, NULL, NULL, 'F', NULL, 0, N_("Name used for foundry field in bdf\nfont generation") },
+ { N_("TTFFoundry"), pr_string, &TTFFoundry, NULL, NULL, 'T', NULL, 0, N_("Name used for Vendor ID field in\nttf (OS/2 table) font generation.\nMust be no more than 4 characters") },
+ { N_("NewFontNameList"), pr_namelist, &namelist_for_new_fonts, NULL, NULL, '\0', NULL, 0, N_("FontForge will use this namelist when assigning\nglyph names to code points in a new font.") },
+ { N_("RecognizePUANames"), pr_bool, &recognizePUA, NULL, NULL, 'U', NULL, 0, N_("Once upon a time, Adobe assigned PUA (public use area) encodings\nfor many stylistic variants of characters (small caps, old style\nnumerals, etc.). Adobe no longer believes this to be a good idea,\nand recommends that these encodings be ignored.\n\n The assignments were originally made because most applications\ncould not handle OpenType features for accessing variants. Adobe\nnow believes that all apps that matter can now do so. Applications\nlike Word and OpenOffice still can't handle these features, so\n fontforge's default behavior is to ignore Adobe's current\nrecommendations.\n\nNote: This does not affect figuring out unicode from the font's encoding,\nit just controls determining unicode from a name.") },
+ { N_("UnicodeGlyphNames"), pr_bool, &allow_utf8_glyphnames, NULL, NULL, 'O', NULL, 0, N_("Allow the full unicode character set in glyph names.\nThis does not conform to adobe's glyph name standard.\nSuch names should be for internal use only and\nshould NOT end up in production fonts." ) },
+ { N_("XUID-Base"), pr_string, &xuid, NULL, NULL, 'X', NULL, 0, N_("If specified this should be a space separated list of integers each\nless than 16777216 which uniquely identify your organization\nFontForge will generate a random number for the final component.") },
+ { N_("AskBDFResolution"), pr_bool, &ask_user_for_resolution, NULL, NULL, 'B', NULL, 0, N_("When generating a set of BDF fonts ask the user\nto specify the screen resolution of the fonts\notherwise FontForge will guess depending on the pixel size.") },
+ { N_("HintForGen"), pr_bool, &autohint_before_generate, NULL, NULL, 'H', NULL, 0, N_("AutoHint changed glyphs before generating a font") },
+ { N_("HintBoundingBoxes"), pr_bool, &hint_bounding_boxes, NULL, NULL, '\0', NULL, 0, N_("FontForge will place vertical or horizontal hints to describe the bounding boxes of suitable glyphs.") },
+ { N_("HintDiagonalEnds"), pr_bool, &hint_diagonal_ends, NULL, NULL, '\0', NULL, 0, N_("FontForge will place vertical or horizontal hints at the ends of diagonal stems.") },
+ { N_("HintDiagonalInter"), pr_bool, &hint_diagonal_intersections, NULL, NULL, '\0', NULL, 0, N_("FontForge will place vertical or horizontal hints at the intersections of diagonal stems.") },
+ { N_("DetectDiagonalStems"), pr_bool, &detect_diagonal_stems, NULL, NULL, '\0', NULL, 0, N_("FontForge will generate diagonal stem hints, which then can be used by the AutoInstr command.") },
+ { N_("UseNewIndicScripts"), pr_bool, &use_second_indic_scripts, NULL, NULL, 'C', NULL, 0, N_("MS has changed (in August 2006) the inner workings of their Indic shaping\nengine, and to disambiguate this change has created a parallel set of script\ntags (generally ending in '2') for Indic writing systems. If you are working\nwith the new system set this flag, if you are working with the old unset it.\n(if you aren't doing Indic work, this flag is irrelevant).") },
+ { "AntiAlias", pr_bool, &default_fv_antialias, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultFVSize", pr_int, &default_fv_font_size, NULL, NULL, 'S', NULL, 1, NULL },
+ { "DefaultFVRowCount", pr_int, &default_fv_row_count, NULL, NULL, 'S', NULL, 1, NULL },
+ { "DefaultFVColCount", pr_int, &default_fv_col_count, NULL, NULL, 'S', NULL, 1, NULL },
+ { "OnlyCopyDisplayed", pr_bool, &onlycopydisplayed, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultOutputFormat", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultBitmapFormat", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "SaveValidate", pr_int, &old_validate, NULL, NULL, '\0', NULL, 1, NULL },
+ { "SaveFontLogAsk", pr_int, &old_fontlog, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultTTFflags", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultPSflags", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultOTFflags", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "PageWidth", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "PageHeight", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "PrintType", pr_int, &unused, NULL, NULL, '\0', NULL, 1, NULL },
+ { "PrintCommand", pr_string, &unused_string, NULL, NULL, '\0', NULL, 1, NULL },
+ { "PageLazyPrinter", pr_string, &unused_string, NULL, NULL, '\0', NULL, 1, NULL },
+ { "CoverageFormatsAllowed", pr_int, &coverageformatsallowed, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ForceNamesWhenOpening", pr_namelist, &force_names_when_opening, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ForceNamesWhenSaving", pr_namelist, &force_names_when_saving, NULL, NULL, '\0', NULL, 1, NULL },
+ { NULL, 0, NULL, NULL, NULL, 0, NULL, 0, NULL },
+},
+ extras[] = {
+ { N_("ResourceFile"), pr_file, &xdefs_filename, NULL, NULL, 'R', NULL, 0, N_("When FontForge starts up, it loads display related resources from a\nproperty on the screen. Sometimes it is useful to be able to store\nthese resources in a file. These resources are only read at start\nup, so changing this has no effect until the next time you start\nFontForge.") },
+ { N_("HelpDir"), pr_file, &helpdir, NULL, NULL, 'H', NULL, 0, N_("The directory on your local system in which FontForge will search for help\nfiles. If a file is not found there, then FontForge will look for it on the net.") },
+ { N_("SplashScreen"), pr_bool, &splash, NULL, NULL, 'S', NULL, 0, N_("Show splash screen on start-up") },
+ { N_("GlyphAutoGoto"), pr_bool, &cv_auto_goto, NULL, NULL, '\0', NULL, 0, N_("Typing a normal character in the glyph view window changes the window to look at that character") },
+ { N_("OpenCharsInNewWindow"), pr_bool, &OpenCharsInNewWindow, NULL, NULL, '\0', NULL, 0, N_("When double clicking on a character in the font view\nopen that character in a new window, otherwise\nreuse an existing one.") },
+ { N_("ArrowMoveSize"), pr_real, &arrowAmount, NULL, NULL, '\0', NULL, 0, N_("The number of em-units by which an arrow key will move a selected point") },
+ { N_("ArrowAccelFactor"), pr_real, &arrowAccelFactor, NULL, NULL, '\0', NULL, 0, N_("Holding down the Alt (or Meta) key will speed up arrow key motion by this factor") },
+ { N_("SnapDistance"), pr_real, &snapdistance, NULL, NULL, '\0', NULL, 0, N_("When the mouse pointer is within this many pixels\nof one of the various interesting features (baseline,\nwidth, grid splines, etc.) the pointer will snap\nto that feature.") },
+ { N_("StopAtJoin"), pr_bool, &stop_at_join, NULL, NULL, '\0', NULL, 0, N_("When dragging points in the outline view a join may occur\n(two open contours may connect at their endpoints). When\nthis is On a join will cause FontForge to stop moving the\nselection (as if the user had released the mouse button).\nThis is handy if your fingers are inclined to wiggle a bit.") },
+ { N_("UpdateFlex"), pr_bool, &updateflex, NULL, NULL, '\0', NULL, 0, N_("Figure out flex hints after every change") },
+ { N_("AskBDFResolution"), pr_bool, &ask_user_for_resolution, NULL, NULL, 'B', NULL, 0, N_("When generating a set of BDF fonts ask the user\nto specify the screen resolution of the fonts\notherwise FontForge will guess depending on the pixel size.") },
+ { "DefaultFVShowHmetrics", pr_int, &default_fv_showhmetrics, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultFVShowVmetrics", pr_int, &default_fv_showvmetrics, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultFVGlyphLabel", pr_int, &default_fv_glyphlabel, NULL, NULL, 'S', NULL, 1, NULL },
+ { "SaveToDir", pr_int, &save_to_dir, NULL, NULL, 'S', NULL, 1, NULL },
+ { "PalettesDocked", pr_bool, &palettes_docked, NULL, NULL, '\0', NULL, 1, NULL },
+ { "CVVisible0", pr_bool, &cvvisible[0], NULL, NULL, '\0', NULL, 1, NULL },
+ { "CVVisible1", pr_bool, &cvvisible[1], NULL, NULL, '\0', NULL, 1, NULL },
+ { "BVVisible0", pr_bool, &bvvisible[0], NULL, NULL, '\0', NULL, 1, NULL },
+ { "BVVisible1", pr_bool, &bvvisible[1], NULL, NULL, '\0', NULL, 1, NULL },
+ { "BVVisible2", pr_bool, &bvvisible[2], NULL, NULL, '\0', NULL, 1, NULL },
+ { "InfoWindowDistance", pr_int, &infowindowdistance, NULL, NULL, '\0', NULL, 1, NULL },
+ { "MarkExtrema", pr_int, &loacal_markextrema, NULL, NULL, '\0', NULL, 1, NULL },
+ { "MarkPointsOfInflect", pr_int, &loacal_markpoi, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ShowRulers", pr_bool, &loacal_showrulers, NULL, NULL, '\0', NULL, 1, N_("Display rulers in the Outline Glyph View") },
+ { "ShowCPInfo", pr_int, &loacal_showcpinfo, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ShowSideBearings", pr_int, &loacal_showsidebearings, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ShowRefNames", pr_int, &loacal_showrefnames, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ShowPoints", pr_bool, &loacal_showpoints, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ShowFilled", pr_int, &loacal_showfilled, NULL, NULL, '\0', NULL, 1, NULL },
+ { "ShowTabs", pr_int, &loacal_showtabs, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultScreenDpiSystem", pr_int, &oldsystem, NULL, NULL, '\0', NULL, 1, NULL },
+ { "OFLibUsername", pr_string, &oflib_username, NULL, NULL, '\0', NULL, 1, NULL },
+ { "OFLibPassword", pr_string, &oflib_password, NULL, NULL, '\0', NULL, 1, NULL },
+ { "RegularStar", pr_bool, &regular_star, NULL, NULL, '\0', NULL, 1, NULL },
+ { "PolyStar", pr_bool, &polystar, NULL, NULL, '\0', NULL, 1, NULL },
+ { "RectEllipse", pr_bool, &rectelipse, NULL, NULL, '\0', NULL, 1, NULL },
+ { "RectCenterOut", pr_bool, &center_out[0], NULL, NULL, '\0', NULL, 1, NULL },
+ { "EllipseCenterOut", pr_bool, &center_out[1], NULL, NULL, '\0', NULL, 1, NULL },
+ { "PolyStartPointCnt", pr_int, &ps_pointcnt, NULL, NULL, '\0', NULL, 1, NULL },
+ { "RoundRectRadius", pr_real, &rr_radius, NULL, NULL, '\0', NULL, 1, NULL },
+ { "StarPercent", pr_real, &star_percent, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DebugWins", pr_int, &debug_wins, NULL, NULL, '\0', NULL, 1, NULL },
+ { "GridFitDpi", pr_int, &gridfit_dpi, NULL, NULL, '\0', NULL, 1, NULL },
+ { "GridFitDepth", pr_int, &gridfit_depth, NULL, NULL, '\0', NULL, 1, NULL },
+ { "GridFitPointSize", pr_real, &gridfit_pointsizey, NULL, NULL, '\0', NULL, 1, NULL },
+ { "GridFitPointSizeX", pr_real, &gridfit_pointsizex, NULL, NULL, '\0', NULL, 1, NULL },
+ { "GridFitSameAs", pr_int, &gridfit_x_sameas_y, NULL, NULL, '\0', NULL, 1, NULL },
+ { "MVShowGrid", pr_int, &mvshowgrid, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultFontFilterIndex", pr_int, &default_font_filter_index, NULL, NULL, '\0', NULL, 1, NULL },
+ { "SeekChar", pr_unicode, &home_char, NULL, NULL, '\0', NULL, 1, NULL },
+ { "CompactOnOpen", pr_bool, &compact_font_on_open, NULL, NULL, '\0', NULL, 1, NULL },
+ { "PixmapDir", pr_file, &pixmapdir, NULL, NULL, 'R', NULL, 0, NULL },
+ { "DefaultCVWidth", pr_int, &default_cv_width, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultCVHeight", pr_int, &default_cv_height, NULL, NULL, '\0', NULL, 1, NULL },
+ { "FCShowHidden", pr_bool, &gfc_showhidden, NULL, NULL, '\0', NULL, 1, NULL },
+ { "FCDirPlacement", pr_int, &gfc_dirplace, NULL, NULL, '\0', NULL, 1, NULL },
+ { "FCBookmarks", pr_string, &gfc_bookmarks, NULL, NULL, '\0', NULL, 1, NULL },
+ { "OFLibAutomagicPreview", pr_int, &oflib_automagic_preview, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultMVWidth", pr_int, &mv_width, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultMVHeight", pr_int, &mv_height, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultBVWidth", pr_int, &bv_width, NULL, NULL, '\0', NULL, 1, NULL },
+ { "DefaultBVHeight", pr_int, &bv_height, NULL, NULL, '\0', NULL, 1, NULL },
+ { "AnchorControlPixelSize", pr_int, &aa_pixelsize, NULL, NULL, '\0', NULL, 1, NULL },
+ { NULL, 0, NULL, NULL, NULL, 0, NULL, 0, NULL },
+},
+ *prefs_list[] = { core_list, extras, NULL };
+
+static int NOUI_GetPrefs(char *name,Val *val) {
+ int i,j;
+
+ for ( i=0; prefs_list[i]!=NULL; ++i ) for ( j=0; prefs_list[i][j].name!=NULL; ++j ) {
+ if ( strcmp(prefs_list[i][j].name,name)==0 ) {
+ struct prefs_list *pf = &prefs_list[i][j];
+ if ( pf->type == pr_bool || pf->type == pr_int || pf->type == pr_unicode ) {
+ val->type = v_int;
+ val->u.ival = *((int *) (pf->val));
+ } else if ( pf->type == pr_string || pf->type == pr_file ) {
+ val->type = v_str;
+ val->u.sval = copy( *((char **) (pf->val)));
+ } else if ( pf->type == pr_encoding ) {
+ val->type = v_str;
+ if ( *((NameList **) (pf->val))==NULL )
+ val->u.sval = copy( "NULL" );
+ else
+ val->u.sval = copy( (*((Encoding **) (pf->val)))->enc_name );
+ } else if ( pf->type == pr_namelist ) {
+ val->type = v_str;
+ val->u.sval = copy( (*((NameList **) (pf->val)))->title );
+ } else if ( pf->type == pr_real ) {
+ val->type = v_real;
+ val->u.fval = *((float *) (pf->val));
+ } else
+return( false );
+
+return( true );
+ }
+ }
+return( false );
+}
+
+static int NOUI_SetPrefs(char *name,Val *val1, Val *val2) {
+ int i,j;
+
+ for ( i=0; prefs_list[i]!=NULL; ++i ) for ( j=0; prefs_list[i][j].name!=NULL; ++j ) {
+ if ( strcmp(prefs_list[i][j].name,name)==0 ) {
+ struct prefs_list *pf = &prefs_list[i][j];
+ if ( pf->type == pr_bool || pf->type == pr_int || pf->type == pr_unicode ) {
+ if ( (val1->type!=v_int && val1->type!=v_unicode) || val2!=NULL )
+return( -1 );
+ *((int *) (pf->val)) = val1->u.ival;
+ } else if ( pf->type == pr_real ) {
+ if ( val1->type==v_real && val2==NULL )
+ *((float *) (pf->val)) = val1->u.fval;
+ else if ( val1->type!=v_int || (val2!=NULL && val2->type!=v_int ))
+return( -1 );
+ else
+ *((float *) (pf->val)) = (val2==NULL ? val1->u.ival : val1->u.ival / (double) val2->u.ival);
+ } else if ( pf->type == pr_string || pf->type == pr_file ) {
+ if ( val1->type!=v_str || val2!=NULL )
+return( -1 );
+ if ( pf->set ) {
+ pf->set( val1->u.sval );
+ } else {
+ free( *((char **) (pf->val)));
+ *((char **) (pf->val)) = copy( val1->u.sval );
+ }
+ } else if ( pf->type == pr_encoding ) {
+ if ( val2!=NULL )
+return( -1 );
+ else if ( val1->type==v_str && pf->val == &default_encoding) {
+ Encoding *enc = FindOrMakeEncoding(val1->u.sval);
+ if ( enc==NULL )
+return( -1 );
+ *((Encoding **) (pf->val)) = enc;
+ } else
+return( -1 );
+ } else if ( pf->type == pr_namelist ) {
+ if ( val2!=NULL )
+return( -1 );
+ else if ( val1->type==v_str ) {
+ NameList *nl = NameListByName(val1->u.sval);
+ if ( strcmp(val1->u.sval,"NULL")==0 && pf->val != &namelist_for_new_fonts )
+ nl = NULL;
+ else if ( nl==NULL )
+return( -1 );
+ *((NameList **) (pf->val)) = nl;
+ } else
+return( -1 );
+ } else
+return( false );
+
+ SavePrefs(true);
+return( true );
+ }
+ }
+return( false );
+}
+
+static char *NOUI_getFontForgeShareDir(void) {
+#if defined(SHAREDIR)
+return( SHAREDIR "/fontforge" );
+#elif defined(PREFIX)
+return( PREFIX "/share/fontforge" );
+#else
+return( NULL );
+#endif
+}
+
+# include <charset.h> /* we still need the charsets & encoding to set local_encoding */
+static int encmatch(const char *enc,int subok) {
+ static struct { char *name; int enc; } encs[] = {
+ { "US-ASCII", e_usascii },
+ { "ASCII", e_usascii },
+ { "ISO646-NO", e_iso646_no },
+ { "ISO646-SE", e_iso646_se },
+ { "LATIN1", e_iso8859_1 },
+ { "ISO-8859-1", e_iso8859_1 },
+ { "ISO-8859-2", e_iso8859_2 },
+ { "ISO-8859-3", e_iso8859_3 },
+ { "ISO-8859-4", e_iso8859_4 },
+ { "ISO-8859-5", e_iso8859_4 },
+ { "ISO-8859-6", e_iso8859_4 },
+ { "ISO-8859-7", e_iso8859_4 },
+ { "ISO-8859-8", e_iso8859_4 },
+ { "ISO-8859-9", e_iso8859_4 },
+ { "ISO-8859-10", e_iso8859_10 },
+ { "ISO-8859-11", e_iso8859_11 },
+ { "ISO-8859-13", e_iso8859_13 },
+ { "ISO-8859-14", e_iso8859_14 },
+ { "ISO-8859-15", e_iso8859_15 },
+ { "ISO_8859-1", e_iso8859_1 },
+ { "ISO_8859-2", e_iso8859_2 },
+ { "ISO_8859-3", e_iso8859_3 },
+ { "ISO_8859-4", e_iso8859_4 },
+ { "ISO_8859-5", e_iso8859_4 },
+ { "ISO_8859-6", e_iso8859_4 },
+ { "ISO_8859-7", e_iso8859_4 },
+ { "ISO_8859-8", e_iso8859_4 },
+ { "ISO_8859-9", e_iso8859_4 },
+ { "ISO_8859-10", e_iso8859_10 },
+ { "ISO_8859-11", e_iso8859_11 },
+ { "ISO_8859-13", e_iso8859_13 },
+ { "ISO_8859-14", e_iso8859_14 },
+ { "ISO_8859-15", e_iso8859_15 },
+ { "ISO8859-1", e_iso8859_1 },
+ { "ISO8859-2", e_iso8859_2 },
+ { "ISO8859-3", e_iso8859_3 },
+ { "ISO8859-4", e_iso8859_4 },
+ { "ISO8859-5", e_iso8859_4 },
+ { "ISO8859-6", e_iso8859_4 },
+ { "ISO8859-7", e_iso8859_4 },
+ { "ISO8859-8", e_iso8859_4 },
+ { "ISO8859-9", e_iso8859_4 },
+ { "ISO8859-10", e_iso8859_10 },
+ { "ISO8859-11", e_iso8859_11 },
+ { "ISO8859-13", e_iso8859_13 },
+ { "ISO8859-14", e_iso8859_14 },
+ { "ISO8859-15", e_iso8859_15 },
+ { "ISO88591", e_iso8859_1 },
+ { "ISO88592", e_iso8859_2 },
+ { "ISO88593", e_iso8859_3 },
+ { "ISO88594", e_iso8859_4 },
+ { "ISO88595", e_iso8859_4 },
+ { "ISO88596", e_iso8859_4 },
+ { "ISO88597", e_iso8859_4 },
+ { "ISO88598", e_iso8859_4 },
+ { "ISO88599", e_iso8859_4 },
+ { "ISO885910", e_iso8859_10 },
+ { "ISO885911", e_iso8859_11 },
+ { "ISO885913", e_iso8859_13 },
+ { "ISO885914", e_iso8859_14 },
+ { "ISO885915", e_iso8859_15 },
+ { "8859_1", e_iso8859_1 },
+ { "8859_2", e_iso8859_2 },
+ { "8859_3", e_iso8859_3 },
+ { "8859_4", e_iso8859_4 },
+ { "8859_5", e_iso8859_4 },
+ { "8859_6", e_iso8859_4 },
+ { "8859_7", e_iso8859_4 },
+ { "8859_8", e_iso8859_4 },
+ { "8859_9", e_iso8859_4 },
+ { "8859_10", e_iso8859_10 },
+ { "8859_11", e_iso8859_11 },
+ { "8859_13", e_iso8859_13 },
+ { "8859_14", e_iso8859_14 },
+ { "8859_15", e_iso8859_15 },
+ { "KOI8-R", e_koi8_r },
+ { "KOI8R", e_koi8_r },
+ { "WINDOWS-1252", e_win },
+ { "CP1252", e_win },
+ { "Big5", e_big5 },
+ { "Big-5", e_big5 },
+ { "BigFive", e_big5 },
+ { "Big-Five", e_big5 },
+ { "Big5HKSCS", e_big5hkscs },
+ { "Big5-HKSCS", e_big5hkscs },
+ { "UTF-8", e_utf8 },
+ { "ISO-10646/UTF-8", e_utf8 },
+ { "ISO_10646/UTF-8", e_utf8 },
+ { "UCS2", e_unicode },
+ { "UCS-2", e_unicode },
+ { "UCS-2-INTERNAL", e_unicode },
+ { "ISO-10646", e_unicode },
+ { "ISO_10646", e_unicode },
+ { NULL, 0 }};
+ int i;
+ char buffer[80];
+
+ if ( strchr(enc,'@')!=NULL && strlen(enc)<sizeof(buffer)-1 ) {
+ strcpy(buffer,enc);
+ *strchr(buffer,'@') = '\0';
+ enc = buffer;
+ }
+
+ for ( i=0; encs[i].name!=NULL; ++i )
+ if ( strmatch(enc,encs[i].name)==0 )
+return( encs[i].enc );
+
+ if ( subok ) {
+ for ( i=0; encs[i].name!=NULL; ++i )
+ if ( strstrmatch(enc,encs[i].name)!=NULL )
+return( encs[i].enc );
+
+ fprintf( stderr, "FontForge does not support your encoding (%s), it will pretend the local encoding is latin1\n", enc );
+
+return( e_iso8859_1 );
+ }
+return( e_unknown );
+}
+
+static int DefaultEncoding(void) {
+ const char *loc;
+ int enc;
+
+ loc = getenv("LC_ALL");
+ if ( loc==NULL ) loc = getenv("LC_CTYPE");
+ if ( loc==NULL ) loc = getenv("LANG");
+
+ if ( loc==NULL )
+return( e_iso8859_1 );
+
+ enc = encmatch(loc,false);
+ if ( enc==e_unknown ) {
+ loc = strrchr(loc,'.');
+ if ( loc==NULL )
+return( e_iso8859_1 );
+ enc = encmatch(loc+1,true);
+ }
+ if ( enc==e_unknown )
+return( e_iso8859_1 );
+
+return( enc );
+}
+
+static void DefaultXUID(void) {
+ /* Adobe has assigned PfaEdit a base XUID of 1021. Each new user is going */
+ /* to get a couple of random numbers appended to that, hoping that will */
+ /* make for a fairly safe system. */
+ /* FontForge will use the same scheme */
+ int r1, r2;
+ char buffer[50];
+ struct timeval tv;
+
+ gettimeofday(&tv,NULL);
+ srand(tv.tv_usec);
+ do {
+ r1 = rand()&0x3ff;
+ } while ( r1==0 ); /* I reserve "0" for me! */
+ gettimeofday(&tv,NULL);
+ r2 = rand();
+ sprintf( buffer, "1021 %d %d", r1, r2 );
+ free(xuid);
+ xuid = copy(buffer);
+}
+
+static void NOUI_SetDefaults(void) {
+
+ DefaultXUID();
+ local_encoding = DefaultEncoding();
+}
+
+static void NOUI_LoadPrefs(void) {
+}
+
+static void NOUI_SavePrefs(int not_if_script) {
+ (void)not_if_script;
+}
+
+static struct prefs_interface prefsnoui = {
+ NOUI_SavePrefs,
+ NOUI_LoadPrefs,
+ NOUI_GetPrefs,
+ NOUI_SetPrefs,
+ NOUI_getFontForgeShareDir,
+ NOUI_SetDefaults
+};
+
+struct prefs_interface *prefs_interface = &prefsnoui;
+
+void FF_SetPrefsInterface(struct prefs_interface *prefsi) {
+ prefs_interface = prefsi;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/nouiutil.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/nouiutil.c
new file mode 100644
index 00000000000..d3199f05ee7
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/nouiutil.c
@@ -0,0 +1,203 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "uiinterface.h"
+#include "splinefont.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <basics.h>
+#include <ustring.h>
+
+static void NOUI_IError(const char *format,...) {
+ va_list ap;
+ va_start(ap,format);
+ fprintf(stderr, "Internal Error: " );
+ vfprintf(stderr,format,ap);
+ va_end(ap);
+}
+
+static void NOUI__LogError(const char *format,va_list ap) {
+ char buffer[400], *str;
+ vsnprintf(buffer,sizeof(buffer),format,ap);
+ str = utf82def_copy(buffer);
+ fprintf(stderr,"%s",str);
+ if ( str[strlen(str)-1]!='\n' )
+ putc('\n',stderr);
+ free(str);
+}
+
+static void NOUI_LogError(const char *format,...) {
+ va_list ap;
+
+ va_start(ap,format);
+ NOUI__LogError(format,ap);
+ va_end(ap);
+}
+
+static void NOUI_post_notice(const char *title,const char *statement,...) {
+ va_list ap;
+ (void)title;
+ va_start(ap,statement);
+ NOUI__LogError(statement,ap);
+ va_end(ap);
+}
+
+static void NOUI_post_error(const char *title,const char *statement,...) {
+ va_list ap;
+ (void)title;
+ va_start(ap,statement);
+ NOUI__LogError(statement,ap);
+ va_end(ap);
+}
+
+static int NOUI_ask(const char *title, const char **answers,
+ int def, int cancel,const char *question,...) {
+ (void)title;
+ (void)answers;
+ (void)def;
+ (void)cancel;
+ (void)question;
+return( def );
+}
+
+static int NOUI_choose(const char *title, const char **choices,int cnt, int def,
+ const char *question,...) {
+ (void)title;
+ (void)choices;
+ (void)def;
+ (void)cnt;
+ (void)question;
+return( def );
+}
+
+static int NOUI_choose_multiple(char *title, const char **choices,char *sel,
+ int cnt, char *buts[2], const char *question,...) {
+ (void)title;
+ (void)choices;
+ (void)sel;
+ (void)cnt;
+ (void)buts;
+ (void)question;
+return( -1 );
+}
+
+static char *NOUI_ask_string(const char *title, const char *def,
+ const char *question,...) {
+ (void)title;
+ (void)def;
+ (void)question;
+return( (char *) def );
+}
+
+static char *NOUI_open_file(const char *title, const char *defaultfile,
+ const char *initial_filter) {
+ (void)title;
+ (void)defaultfile;
+ (void)initial_filter;
+return( NULL );
+}
+
+static char *NOUI_saveas_file(const char *title, const char *defaultfile,
+ const char *initial_filter) {
+ (void)title;
+ (void)initial_filter;
+return( copy(defaultfile) );
+}
+
+static void NOUI_progress_start(int delay, const char *title, const char *line1,
+ const char *line2, int tot, int stages) {
+ (void)delay;
+ (void)title;
+ (void)line1;
+ (void)line2;
+ (void)tot;
+ (void)stages;
+}
+
+static void NOUI_void_void_noop(void) {
+}
+
+static void NOUI_void_int_noop(int useless) {
+ (void)useless;
+}
+
+static int NOUI_int_int_noop(int useless) {
+ (void)useless;
+return( true );
+}
+
+static void NOUI_void_str_noop(const char * useless) {
+ (void)useless;
+}
+
+static int NOUI_alwaystrue(void) {
+return( true );
+}
+
+static int NOUI_DefaultStrokeFlags(void) {
+return( sf_correctdir );
+}
+
+static struct ui_interface noui_interface = {
+ NOUI_IError,
+ NOUI_post_error,
+ NOUI_LogError,
+ NOUI_post_notice,
+ NOUI_ask,
+ NOUI_choose,
+ NOUI_choose_multiple,
+ NOUI_ask_string,
+ NOUI_ask_string, /* password */
+ NOUI_open_file,
+ NOUI_saveas_file,
+
+ NOUI_progress_start,
+ NOUI_void_void_noop,
+ NOUI_void_void_noop,
+ NOUI_void_int_noop,
+ NOUI_alwaystrue,
+ NOUI_alwaystrue,
+ NOUI_int_int_noop,
+ NOUI_void_str_noop,
+ NOUI_void_str_noop,
+ NOUI_void_void_noop,
+ NOUI_void_void_noop,
+ NOUI_void_int_noop,
+ NOUI_void_int_noop,
+ NOUI_alwaystrue,
+
+ NOUI_void_void_noop,
+
+ NOUI_TTFNameIds,
+ NOUI_MSLangString,
+
+ NOUI_DefaultStrokeFlags
+};
+struct ui_interface *ui_interface = &noui_interface;
+
+void FF_SetUiInterface(struct ui_interface *uii) {
+ ui_interface = uii;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsepfa.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c
index 8b18e2a63b5..0c4108fa99e 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsepfa.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsepfa.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -30,22 +30,6 @@
#include <string.h>
#include <ustring.h>
#include <utype.h>
-
-#ifdef LUA_FF_LIB
-/* no need for iconv here, since PS is 8-bit legacy */
-#define Isspace(a) ((a)==' '|| ((a) >= '\t' && (a) <= '\r'))
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#define Isalpha(a) (((a)>='a' && (a)<='z') || ((a)>='A' && (a)<='Z'))
-#define Isalnum(a) (Isalpha(a)||Isdigit(a))
-#define Ishexdigit(a) (((a)>='0' && (a)<='9')||((a)>='a' && (a)<='f')||((a)>='A' && (a)<='F'))
-#else
-#define Isspace isspace
-#define Isdigit isdigit
-#define Isalpha isalpha
-#define Isalnum isalnum
-#define Ishexdigit ishexdigit
-#endif
-
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -997,7 +981,7 @@ static char *gettoken(char *start) {
while ( *start!='\0' && *start!='/' && *start!='(' ) ++start;
if ( *start=='/' || *start=='(' ) ++start;
- for ( end = start; *end!='\0' && !Isspace(*end) && *end!='[' && *end!='/' && *end!='{' && *end!='(' && *end!=')'; ++end );
+ for ( end = start; *end!='\0' && !isspace(*end) && *end!='[' && *end!='/' && *end!='{' && *end!='(' && *end!=')'; ++end );
ret = galloc(end-start+1);
if ( end>start )
strncpy(ret,start,end-start);
@@ -1007,7 +991,7 @@ return( ret );
static int getbool(char *start) {
- while ( Isspace(*start) ) ++start;
+ while ( isspace(*start) ) ++start;
if ( *start=='T' || *start=='t' )
return( 1 );
@@ -1025,7 +1009,7 @@ static void fillintarray(int *array,char *start,int maxentries) {
if ( start==end )
return;
start = end;
- while ( Isspace(*start) ) ++start;
+ while ( isspace(*start) ) ++start;
}
}
@@ -1036,8 +1020,8 @@ static void fillrealarray(real *array,char *start,int maxentries) {
while ( *start!='\0' && *start!='[' && *start!='{' ) ++start;
if ( *start=='[' || *start=='{' ) ++start;
for ( i=0; i<maxentries && *start!=']' && *start!='}'; ++i ) {
- while ( Isspace( *start )) ++start;
- if ( Isdigit(*start) || *start=='-' || *start=='.' )
+ while ( isspace( *start )) ++start;
+ if ( isdigit(*start) || *start=='-' || *start=='.' )
array[i] = strtod(start,&end);
else if ( strncmp(start,"div",3)==0 && i>=2 ) {
/* Some of Luc Devroye's fonts have a "div" in the FontMatrix */
@@ -1049,13 +1033,13 @@ return;
if ( start==end )
return;
start = end;
- while ( Isspace(*start) ) ++start;
+ while ( isspace(*start) ) ++start;
}
}
static void InitDict(struct psdict *dict,char *line) {
while ( *line!='/' && *line!='\0' ) ++line;
- while ( !Isspace(*line) && *line!='\0' ) ++line;
+ while ( !isspace(*line) && *line!='\0' ) ++line;
dict->cnt += strtol(line,NULL,10);
if ( dict->next>0 ) { int i; /* Shouldn't happen, but did in a bad file */
dict->keys = grealloc(dict->keys,dict->cnt*sizeof(char *));
@@ -1071,28 +1055,24 @@ static void InitDict(struct psdict *dict,char *line) {
static void InitChars(struct pschars *chars,char *line) {
while ( *line!='/' && *line!='\0' ) ++line;
- while ( !Isspace(*line) && *line!='\0' ) ++line;
+ while ( !isspace(*line) && *line!='\0' ) ++line;
chars->cnt = strtol(line,NULL,10);
if ( chars->cnt>0 ) {
chars->keys = gcalloc(chars->cnt,sizeof(char *));
chars->values = gcalloc(chars->cnt,sizeof(char *));
chars->lens = gcalloc(chars->cnt,sizeof(int));
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_change_total(chars->cnt);
-#endif
+ ff_progress_change_total(chars->cnt);
}
}
static void InitCharProcs(struct charprocs *cp, char *line) {
while ( *line!='/' && *line!='\0' ) ++line;
- while ( !Isspace(*line) && *line!='\0' ) ++line;
+ while ( !isspace(*line) && *line!='\0' ) ++line;
cp->cnt = strtol(line,NULL,10);
if ( cp->cnt>0 ) {
cp->keys = gcalloc(cp->cnt,sizeof(char *));
cp->values = gcalloc(cp->cnt,sizeof(SplineChar *));
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_change_total(cp->cnt);
-#endif
+ ff_progress_change_total(cp->cnt);
}
}
@@ -1113,7 +1093,7 @@ static void ContinueValue(struct fontparse *fp, struct psdict *dict, char *line)
(strncmp(line,"def",3)==0 ||
strncmp(line,"|-",2)==0 || strncmp(line,"ND",2)==0)) {
while ( 1 ) {
- while ( fp->vpt>fp->vbuf+1 && Isspace(fp->vpt[-1]) )
+ while ( fp->vpt>fp->vbuf+1 && isspace(fp->vpt[-1]) )
--fp->vpt;
if ( fp->vpt>fp->vbuf+8 && strncmp(fp->vpt-8,"noaccess",8)==0 )
fp->vpt -= 8;
@@ -1173,8 +1153,8 @@ static void AddValue(struct fontparse *fp, struct psdict *dict, char *line, char
dict->keys[dict->next] = copyn(line+1,endtok-(line+1));
}
pt = line+strlen(line)-1;
- while ( Isspace(*endtok)) ++endtok;
- while ( pt>endtok && Isspace(*pt)) --pt;
+ while ( isspace(*endtok)) ++endtok;
+ while ( pt>endtok && isspace(*pt)) --pt;
++pt;
if ( strncmp(pt-3,"def",3)==0 )
pt -= 3;
@@ -1186,7 +1166,7 @@ static void AddValue(struct fontparse *fp, struct psdict *dict, char *line, char
return;
}
forever {
- while ( pt-1>endtok && Isspace(pt[-1])) --pt;
+ while ( pt-1>endtok && isspace(pt[-1])) --pt;
if ( pt-8>endtok && strncmp(pt-8,"noaccess",8)==0 )
pt -= 8;
else if ( pt-8>endtok && strncmp(pt-8,"readonly",8)==0 )
@@ -1256,7 +1236,7 @@ static void findstring(struct fontparse *fp,struct pschars *subrs,int index,char
char buffer[1024], *bpt, *bs, *end = buffer+sizeof(buffer)-1;
int val;
- while ( Isspace(*str)) ++str;
+ while ( isspace(*str)) ++str;
if ( *str=='(' ) {
++str;
bpt = buffer;
@@ -1264,11 +1244,11 @@ static void findstring(struct fontparse *fp,struct pschars *subrs,int index,char
if ( *str!='\\' )
val = *str++;
else {
- if ( Isdigit( *++str )) {
+ if ( isdigit( *++str )) {
val = *str++-'0';
- if ( Isdigit( *str )) {
+ if ( isdigit( *str )) {
val = (val<<3) | (*str++-'0');
- if ( Isdigit( *str ))
+ if ( isdigit( *str ))
val = (val<<3) | (*str++-'0');
}
} else
@@ -1292,16 +1272,16 @@ static void findstring(struct fontparse *fp,struct pschars *subrs,int index,char
static void findnumbers(struct fontparse *fp,struct pschars *chars,char *str) {
int val;
char *end;
-
+ (void)fp;
forever {
int index = chars->next;
char *namestrt;
- while ( Isspace(*str)) ++str;
+ while ( isspace(*str)) ++str;
if ( *str!='/' )
break;
namestrt = ++str;
- while ( Isalnum(*str) || *str=='.' ) ++str;
+ while ( isalnum(*str) || *str=='.' ) ++str;
*str = '\0';
index = chars->next;
@@ -1312,7 +1292,7 @@ static void findnumbers(struct fontparse *fp,struct pschars *chars,char *str) {
chars->values[index] = (void *) (intpt) val;
chars->next = index+1;
str = end;
- while ( Isspace(*str)) ++str;
+ while ( isspace(*str)) ++str;
if ( str[0]=='d' && str[1]=='e' && str[2]=='f' )
str += 3;
}
@@ -1354,9 +1334,9 @@ static void sfnts2tempfile(struct fontparse *fp,FILE *in,char *line) {
instring = true;
for ( ++pt; *pt && *pt!='>'; ++pt ) {
- if ( Isspace(*pt))
+ if ( isspace(*pt))
continue;
- if ( Isdigit(*pt))
+ if ( isdigit(*pt))
nibble = *pt-'0';
else if ( *pt>='a' && *pt<='f' )
nibble = *pt-'a'+10;
@@ -1393,7 +1373,7 @@ static void sfnts2tempfile(struct fontparse *fp,FILE *in,char *line) {
while ( (ch=getc(in))!=EOF ) {
if ( ch==']' )
goto skip_to_eol;
- if ( Isspace(ch))
+ if ( isspace(ch))
continue;
if ( !instring && ch=='<' ) {
instring = true;
@@ -1411,7 +1391,7 @@ static void sfnts2tempfile(struct fontparse *fp,FILE *in,char *line) {
}
instring = false;
} else {
- if ( Isdigit(ch))
+ if ( isdigit(ch))
nibble = ch-'0';
else if ( ch>='a' && ch<='f' )
nibble = ch-'a'+10;
@@ -1444,7 +1424,7 @@ static void ParseSimpleEncoding(struct fontparse *fp,char *line) {
char tok[200], *pt;
while ( *line!='\0' && *line!=']' ) {
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
if ( *line==']' )
break;
if ( *line!='/' ) {
@@ -1452,8 +1432,8 @@ static void ParseSimpleEncoding(struct fontparse *fp,char *line) {
continue;
}
++line;
- while ( Isspace(*line)) ++line;
- for ( pt=tok; !Isspace(*line) && *line!='\0' && *line!='/' && *line!=']'; ) {
+ while ( isspace(*line)) ++line;
+ for ( pt=tok; !isspace(*line) && *line!='\0' && *line!='/' && *line!=']'; ) {
if ( pt<tok+sizeof(tok)-2 )
*pt++ = *line++;
else
@@ -1480,7 +1460,7 @@ return;
ParseSimpleEncoding(fp,line);
return;
} else if (( fp->inencoding && strncmp(line,"dup",3)==0 ) ||
- ( strncmp(line,"dup ",4)==0 && Isdigit(line[4]) &&
+ ( strncmp(line,"dup ",4)==0 && isdigit(line[4]) &&
strstr(line+strlen(line)-6," put")!=NULL && strchr(line,'/')!=NULL )) {
/* Fontographer's type3 fonts claim to be standard, but then aren't */
fp->fd->encoding_name = &custom;
@@ -1489,17 +1469,17 @@ return;
char *end;
int pos = strtol(line+3,&end,10);
line = end;
- while ( Isspace( *line )) ++line;
+ while ( isspace( *line )) ++line;
if ( *line=='/' ) ++line;
- for ( pt = buffer; !Isspace(*line); *pt++ = *line++ );
+ for ( pt = buffer; !isspace(*line); *pt++ = *line++ );
*pt = '\0';
if ( pos>=0 && pos<256 ) {
free(fp->fd->encoding[pos]);
fp->fd->encoding[pos] = copy(buffer);
}
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
if ( strncmp(line,"put",3)==0 ) line+=3;
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
}
return;
} else if ( fp->inencoding && strstr(line,"for")!=NULL && strstr(line,"/.notdef")!=NULL ) {
@@ -1515,15 +1495,15 @@ return;
/* Saw a type 3 font with lines like "Encoding 1 /_a0 put" */
char *end;
int pos;
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
if ( strncmp(line,"Encoding ",9)==0 ) {
line+=9;
pos = strtol(line,&end,10);
line = end;
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
if ( *line=='/' ) {
++line;
- for ( pt = buffer; !Isspace(*line); *pt++ = *line++ );
+ for ( pt = buffer; !isspace(*line); *pt++ = *line++ );
*pt = '\0';
if ( pos>=0 && pos<256 )
fp->fd->encoding[pos] = copy(buffer);
@@ -1532,7 +1512,7 @@ return;
return;
} else if ( fp->insubs ) {
struct pschars *subrs = fp->fd->private->subrs;
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
if ( strncmp(line,"dup ",4)==0 ) {
int i;
char *ept;
@@ -1557,12 +1537,12 @@ return;
}
} else if ( fp->inchars ) {
struct pschars *chars = fp->fd->chars;
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
if ( strncmp(line,"end",3)==0 )
fp->ignore = fp->inchars = false;
else if ( *line=='\n' || *line=='\0' )
/* Ignore it */;
- else if ( *line!='/' || !(Isalpha(line[1]) || line[1]=='.')) {
+ else if ( *line!='/' || !(isalpha(line[1]) || line[1]=='.')) {
LogError( _("No name for CharStrings dictionary \"%s"), rmbinary(line) );
fp->alreadycomplained = true;
} else if ( fp->ignore ) {
@@ -1574,21 +1554,19 @@ return;
else {
int i = chars->next;
char *namestrt = ++line;
- while ( Isalnum(*line) || *line=='.' ) ++line;
+ while ( isalnum(*line) || *line=='.' ) ++line;
*line = '\0';
findstring(fp,chars,i,namestrt,line+1);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
return;
}
fp->inencoding = 0;
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
endtok = NULL;
if ( *line=='/' )
- for ( endtok=line+1; !Isspace(*endtok) && *endtok!='(' &&
+ for ( endtok=line+1; !isspace(*endtok) && *endtok!='(' && *endtok!='/' &&
*endtok!='{' && *endtok!='[' && *endtok!='\0'; ++endtok );
if ( strstr(line,"/shareddict")!=NULL && strstr(line,"where")!=NULL ) {
@@ -1980,7 +1958,7 @@ return;
retry:
if ( fp->insubs ) {
struct pschars *chars = /*fp->insubs ?*/ fp->fd->private->subrs /*: fp->fd->private->othersubrs*/;
- while ( Isspace(*line)) ++line;
+ while ( isspace(*line)) ++line;
if ( strncmp(line,"dup ",4)==0 ) {
int i = strtol(line+4,NULL,10);
if ( fp->ignore )
@@ -2015,9 +1993,7 @@ return;
chars->values[i] = galloc(binlen);
memcpy(chars->values[i],binstart,binlen);
++chars->next;
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
} else if ( !fp->alreadycomplained ) {
/* Special hacks for known badly formatted fonts */
@@ -2109,9 +2085,9 @@ return( 0 );
if ( --cnt==0 )
inbinary = 0;
} else if ( inhex ) {
- if ( Ishexdigit(ch)) {
+ if ( ishexdigit(ch)) {
int h;
- if ( Isdigit(ch)) h = ch-'0';
+ if ( isdigit(ch)) h = ch-'0';
else if ( ch>='a' && ch<='f' ) h = ch-'a'+10;
else h = ch-'A'+10;
if ( firstnibble ) {
@@ -2130,7 +2106,7 @@ return( 0 );
} else if ( ch=='/' ) {
intok = 1;
tokpt = temptok;
- } else if ( intok && !Isspace(ch) && ch!='{' && ch!='[' ) {
+ } else if ( intok && !isspace(ch) && ch!='{' && ch!='[' ) {
*tokpt++ = ch;
} else if ( (intok||sptok) && (ch=='{' || ch=='[')) {
*tokpt = '\0';
@@ -2140,11 +2116,11 @@ return( 0 );
*tokpt = '\0';
intok = 0;
sptok = 1;
- } else if ( sptok && Isspace(ch)) {
+ } else if ( sptok && isspace(ch)) {
nowspace = 1;
if ( ch=='\n' || ch=='\r' )
break;
- } else if ( sptok && !Isdigit(ch))
+ } else if ( sptok && !isdigit(ch))
sptok = 0;
else if ( rpt!=NULL && ch==*rpt ) {
if ( *++rpt=='\0' ) {
@@ -2159,14 +2135,14 @@ return( 0 );
} else if ( rpt!=NULL ) {
rpt = NULL;
willbehex = false;
- } else if ( Isdigit(ch)) {
+ } else if ( isdigit(ch)) {
sptok = 0;
nownum = 1;
if ( innum )
val = 10*val + ch-'0';
else
val = ch-'0';
- } else if ( Isspace(ch)) {
+ } else if ( isspace(ch)) {
nowspace = 1;
if ( ch=='\n' || ch=='\r' )
break;
@@ -2186,7 +2162,7 @@ return( 0 );
if ( *++rdpt =='\0' ) {
ch = getc(temp);
*pt++ = ch;
- if ( Isspace(ch) && val!=0 ) {
+ if ( isspace(ch) && val!=0 ) {
inhex = fp->useshexstrings;
inbinary = !fp->useshexstrings;
firstnibble = true;
@@ -2199,7 +2175,7 @@ return( 0 );
} else if ( wasminus && ch=='!' ) {
ch = getc(temp);
*pt++ = ch;
- if ( Isspace(ch) && val!=0 ) {
+ if ( isspace(ch) && val!=0 ) {
inhex = 1;
cnt = val;
binstart = pt;
@@ -2300,8 +2276,8 @@ return;
nrandombytes[3] = decode(hex(ch3,ch4));
zcnt = 0;
while (( ch1=bgetc(extra,in))!=EOF ) {
- while ( ch1!=EOF && Isspace(ch1)) ch1 = bgetc(extra,in);
- while ( (ch2=bgetc(extra,in))!=EOF && Isspace(ch2));
+ while ( ch1!=EOF && isspace(ch1)) ch1 = bgetc(extra,in);
+ while ( (ch2=bgetc(extra,in))!=EOF && isspace(ch2));
if ( ch1=='0' && ch2=='0' ) ++zcnt; else { dumpzeros(temp,zeros,zcnt); zcnt = 0;}
if ( zcnt>EODMARKLEN )
break;
@@ -2311,7 +2287,7 @@ return;
zeros[zcnt-1] = decode(hex(ch1,ch2));
}
}
- while (( ch1=bgetc(extra,in))=='0' || Isspace(ch1) );
+ while (( ch1=bgetc(extra,in))=='0' || isspace(ch1) );
if ( ch1!=EOF ) ungetc(ch1,in);
}
@@ -2368,9 +2344,7 @@ static void figurecids(struct fontparse *fp,FILE *temp) {
fd->cidlens = galloc(cidcnt*sizeof(int16));
fd->cidfds = galloc((cidcnt+1)*sizeof(int16));
offsets = galloc((cidcnt+1)*sizeof(int));
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_change_total(cidcnt);
-#endif
+ ff_progress_change_total(cidcnt);
fseek(temp,fd->mapoffset,SEEK_SET);
for ( i=0; i<=fd->cidcnt; ++i ) {
@@ -2401,9 +2375,7 @@ static void figurecids(struct fontparse *fp,FILE *temp) {
fd->fds[fd->cidfds[i]]->private->leniv);
fd->cidlens[i] -= fd->fds[fd->cidfds[i]]->private->leniv;
}
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
free(offsets);
@@ -2474,7 +2446,7 @@ static void dodata( struct fontparse *fp, FILE *in, FILE *temp) {
LogError( _("Failed to parse the StartData command properly, bad count\n") );
}
cnt = len;
- while ( Isspace(ch=getc(in)) );
+ while ( isspace(ch=getc(in)) );
ungetc(ch,in);
for ( pt="StartData "; *pt; ++pt )
getc(in); /* And if it didn't match, what could I do about it? */
@@ -2487,8 +2459,8 @@ static void dodata( struct fontparse *fp, FILE *in, FILE *temp) {
} else {
while ( cnt>0 ) {
/* Hex data are allowed to contain whitespace */
- while ( Isspace(ch=getc(in)) );
- while ( Isspace(ch2=getc(in)) );
+ while ( isspace(ch=getc(in)) );
+ while ( isspace(ch2=getc(in)) );
ch = hex(ch,ch2);
putc(ch,temp);
--cnt;
@@ -2517,9 +2489,15 @@ static void realdecrypt(struct fontparse *fp,FILE *in, FILE *temp) {
if ( strstr(buffer, "Blend")!=NULL )
saw_blend = true;
if ( first && buffer[0]=='\200' ) {
+ int len = strlen( buffer );
hassectionheads = 1;
fp->fd->wasbinary = true;
- parseline(fp,buffer+6,in);
+ /* if there were a newline in the section header (in the length word)*/
+ /* we would stop at it, and not read the full header */
+ if ( len<6 ) /* eat the header */
+ while ( len<6 ) { getc(in); ++len; }
+ else /* Otherwise parse anything else on the line */
+ parseline(fp,buffer+6,in);
} else if ( strstr(buffer,"CharProcs")!=NULL && strstr(buffer,"begin")!=NULL ) {
parsetype3(fp,in);
return;
@@ -2740,9 +2718,9 @@ char **_NamesReadPostscript(FILE *ps) {
strstr(buffer,"/CIDFontName")!=NULL ) {
pt = strstr(buffer,"FontName");
pt += strlen("FontName");
- while ( Isspace(*pt)) ++pt;
+ while ( isspace(*pt)) ++pt;
if ( *pt=='/' ) ++pt;
- for ( end = pt; *end!='\0' && !Isspace(*end); ++end );
+ for ( end = pt; *end!='\0' && !isspace(*end); ++end );
ret = galloc(2*sizeof(char *));
ret[0] = copyn(pt,end-pt);
ret[1] = NULL;
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettf.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
index accfe87e1eb..1e1cf2ccad5 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettf.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -33,14 +33,14 @@
#include <gwidget.h>
#include "ttf.h"
-
-/* needed for ps validation */
#ifdef LUA_FF_LIB
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#else
-#define Isdigit isdigit
+SplineFont *_SFReadTTFInfo(FILE *ttf, int flags,enum openflags openflags, char *filename,struct fontdict *fd);
+void THPatchSplineChar(SplineChar *sc);
#endif
+char *SaveTablesPref;
+int ask_user_for_cmap = false;
+
/* True Type is a really icky format. Nothing is together. It's badly described */
/* much of the description is misleading */
/* Apple's version: */
@@ -55,10 +55,263 @@
/* It grows on you though... now that I understand it better it seems better designed */
/* but the docs remain in conflict. Sometimes badly so */
-/* !!!I don't currently parse instructions to get hints, but I do save them */
-
int prefer_cjk_encodings=false;
+/* ************************************************************************** */
+static struct ms_2_locales { char *loc_name; int local_id; } ms_2_locals[] = {
+ { "af", 0x436 },
+ { "sq_AL", 0x41c },
+ { "am", 0x45e },
+ { "ar_SA", 0x401 },
+ { "ar_IQ", 0x801 },
+ { "ar_EG", 0xc01 },
+ { "ar_LY", 0x1001 },
+ { "ar_DZ", 0x1401 },
+ { "ar_MA", 0x1801 },
+ { "ar_TN", 0x1C01 },
+ { "ar_OM", 0x2001 },
+ { "ar_YE", 0x2401 },
+ { "ar_SY", 0x2801 },
+ { "ar_JO", 0x2c01 },
+ { "ar_LB", 0x3001 },
+ { "ar_KW", 0x3401 },
+ { "ar_AE", 0x3801 },
+ { "ar_BH", 0x3c01 },
+ { "ar_QA", 0x4001 },
+ { "hy", 0x42b },
+ { "as", 0x44d },
+ { "az", 0x42c },
+ { "az", 0x82c },
+ { "eu", 0x42d },
+ { "be_BY", 0x423 },
+ { "bn_IN", 0x445 },
+ { "bn_BD", 0x845 },
+ { "bg_BG", 0x402 },
+ { "my", 0x455 },
+ { "ca", 0x403 },
+ { "km", 0x453 },
+ { "zh_TW", 0x404 }, /* Trad */
+ { "zh_CN", 0x804 }, /* Simp */
+ { "zh_HK", 0xc04 }, /* Trad */
+ { "zh_SG", 0x1004 }, /* Simp */
+ { "zh_MO", 0x1404 }, /* Trad */
+ { "hr", 0x41a },
+ { "hr_BA", 0x101a },
+ { "cs_CZ", 0x405 },
+ { "da_DK", 0x406 },
+ { "div", 0x465 },
+ { "nl_NL", 0x413 },
+ { "nl_BE", 0x813 },
+ { "en_UK", 0x809 },
+ { "en_US", 0x409 },
+ { "en_CA", 0x1009 },
+ { "en_AU", 0xc09 },
+ { "en_NZ", 0x1409 },
+ { "en_IE", 0x1809 },
+ { "en_ZA", 0x1c09 },
+ { "en_JM", 0x2009 },
+ { "en", 0x2409 },
+ { "en_BZ", 0x2809 },
+ { "en_TT", 0x2c09 },
+ { "en_ZW", 0x3009 },
+ { "en_PH", 0x3409 },
+ { "en_ID", 0x3809 },
+ { "en_HK", 0x3c09 },
+ { "en_IN", 0x4009 },
+ { "en_MY", 0x4409 },
+ { "et_EE", 0x425 },
+ { "fo", 0x438 },
+/* No language code for filipino */
+ { "fa", 0x429 },
+ { "fi_FI", 0x40b },
+ { "fr_FR", 0x40c },
+ { "fr_BE", 0x80c },
+ { "fr_CA", 0xc0c },
+ { "fr_CH", 0x100c },
+ { "fr_LU", 0x140c },
+ { "fr_MC", 0x180c },
+ { "fr", 0x1c0c }, /* West Indes */
+ { "fr_RE", 0x200c },
+ { "fr_CD", 0x240c },
+ { "fr_SN", 0x280c },
+ { "fr_CM", 0x2c0c },
+ { "fr_CI", 0x300c },
+ { "fr_ML", 0x340c },
+ { "fr_MA", 0x380c },
+ { "fr_HT", 0x3c0c },
+ { "fr_DZ", 0xe40c }, /* North African is most likely to be Algeria, possibly Tunisia */
+ { "fy", 0x462 },
+ { "gl", 0x456 },
+ { "ka", 0x437 },
+ { "de_DE", 0x407 },
+ { "de_CH", 0x807 },
+ { "de_AT", 0xc07 },
+ { "de_LU", 0x1007 },
+ { "de_LI", 0x1407 },
+ { "el_GR", 0x408 },
+ { "ga", 0x83c },
+ { "gd", 0x43c },
+ { "gn", 0x474 },
+ { "gu", 0x447 },
+ { "ha", 0x468 },
+ { "he_IL", 0x40d },
+ { "iw", 0x40d }, /* Obsolete name for Hebrew */
+ { "hi", 0x439 },
+ { "hu_HU", 0x40e },
+ { "is_IS", 0x40f },
+ { "id", 0x421 },
+ { "in", 0x421 }, /* Obsolete name for Indonesean */
+ { "iu", 0x45d },
+ { "it_IT", 0x410 },
+ { "it_CH", 0x810 },
+ { "ja_JP", 0x411 },
+ { "kn", 0x44b },
+ { "ks_IN", 0x860 },
+ { "kk", 0x43f },
+ { "ky", 0x440 },
+ { "km", 0x453 },
+ { "kok", 0x457 },
+ { "ko", 0x412 },
+ { "ko", 0x812 }, /*Johab */
+ { "lo", 0x454 },
+ { "la", 0x476 },
+ { "lv_LV", 0x426 },
+ { "lt_LT", 0x427 },
+ { "lt", 0x827 }, /* Classic */
+ { "mk", 0x42f },
+ { "ms", 0x43e },
+ { "ms", 0x83e },
+ { "ml", 0x44c },
+ { "mt", 0x43a },
+ { "mr", 0x44e },
+ { "mn", 0x450 },
+ { "ne_NP", 0x461 },
+ { "ne_IN", 0x861 },
+ { "no_NO", 0x414 }, /* Bokmal */
+ { "no_NO", 0x814 }, /* Nynorsk */
+ { "or", 0x448 },
+ { "om", 0x472 },
+ { "ps", 0x463 },
+ { "pl_PL", 0x415 },
+ { "pt_PT", 0x416 },
+ { "pt_BR", 0x816 },
+ { "pa_IN", 0x446 },
+ { "pa_PK", 0x846 },
+ { "qu_BO", 0x46b },
+ { "qu_EC", 0x86b },
+ { "qu_PE", 0xc6b },
+ { "rm", 0x417 },
+ { "ro_RO", 0x418 },
+ { "ro_MD", 0x818 },
+ { "ru_RU", 0x419 },
+ { "ru_MD", 0x819 },
+ { "smi", 0x43b },
+ { "sa", 0x43b },
+/* No language code for Sepedi */
+ { "sr", 0xc1a }, /* Cyrillic */
+ { "sr", 0x81a }, /* Latin */
+ { "sd_IN", 0x459 },
+ { "sd_PK", 0x859 },
+ { "si", 0x45b },
+ { "sk_SK", 0x41b },
+ { "sl_SI", 0x424 },
+ { "wen", 0x42e },
+ { "es_ES", 0x40a }, /* traditional spanish */
+ { "es_MX", 0x80a },
+ { "es_ES", 0xc0a }, /* Modern spanish */
+ { "es_GT", 0x100a },
+ { "es_CR", 0x140a },
+ { "es_PA", 0x180a },
+ { "es_DO", 0x1c0a },
+ { "es_VE", 0x200a },
+ { "es_CO", 0x240a },
+ { "es_PE", 0x280a },
+ { "es_AR", 0x2c0a },
+ { "es_EC", 0x300a },
+ { "es_CL", 0x340a },
+ { "es_UY", 0x380a },
+ { "es_PY", 0x3c0a },
+ { "es_BO", 0x400a },
+ { "es_SV", 0x440a },
+ { "es_HN", 0x480a },
+ { "es_NI", 0x4c0a },
+ { "es_PR", 0x500a },
+ { "es_US", 0x540a },
+ { "sutu", 0x430 },
+ { "sw_KE", 0x441 },
+ { "sv_SE", 0x41d },
+ { "sv_FI", 0x81d },
+ { "tl", 0x464 },
+ { "tg", 0x464 },
+ { "ta", 0x449 },
+ { "tt", 0x444 },
+ { "te", 0x44a },
+ { "th", 0x41e },
+ { "bo_CN", 0x451 },
+ { "bo_BT", 0x451 },
+ { "ti_ET", 0x473 },
+ { "ti_ER", 0x873 },
+ { "ts", 0x431 },
+ { "tn", 0x432 },
+ { "tr_TR", 0x41f },
+ { "tk", 0x442 },
+ { "uk_UA", 0x422 },
+ { "ug", 0x480 },
+ { "ur_PK", 0x420 },
+ { "ur_IN", 0x820 },
+ { "uz", 0x443 }, /* Latin */
+ { "uz", 0x843 }, /* Cyrillic */
+ { "ven", 0x433 },
+ { "vi", 0x42a },
+ { "cy", 0x452 },
+ { "xh", 0x434 },
+ { "yi", 0x43d },
+ { "ji", 0x43d }, /* Obsolete Yiddish */
+ { "yo", 0x46a },
+ { "zu", 0x435 },
+ { NULL, 0 }};
+
+int MSLanguageFromLocale(void) {
+ const char *lang=NULL;
+ int i, langlen;
+ static char *envs[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
+ char langcountry[8], language[4];
+ int langcode, langlocalecode;
+
+ for ( i=0; envs[i]!=NULL; ++i ) {
+ lang = getenv(envs[i]);
+ if ( lang!=NULL ) {
+ langlen = strlen(lang);
+ if (( langlen>5 && lang[5]=='.' && lang[2]=='_' ) ||
+ (langlen==5 && lang[2]=='_' ) ||
+ (langlen==2) ||
+ (langlen==3)) /* Some obscure languages have a 3 letter code */
+ /* I understand this language */
+ break;
+ }
+ }
+ if ( lang==NULL )
+ lang = "en_US";
+ strncpy(langcountry,lang,5); langcountry[5] = '\0';
+ strncpy(language,lang,3); language[3] = '\0';
+ if ( language[2]=='_' ) language[2] = '\0';
+ langlen = strlen(language);
+
+ langcode = langlocalecode = -1;
+ for ( i=0; ms_2_locals[i].loc_name!=NULL; ++i ) {
+ if ( strmatch(langcountry,ms_2_locals[i].loc_name)==0 ) {
+ langlocalecode = ms_2_locals[i].local_id;
+ langcode = langlocalecode&0x3ff;
+ break;
+ } else if ( strncmp(language,ms_2_locals[i].loc_name,langlen)==0 )
+ langcode = ms_2_locals[i].local_id&0x3ff;
+ }
+ if ( langcode==-1 ) /* Default to English */
+ langcode = 0x9;
+return( langlocalecode==-1 ? (langcode|0x400) : langlocalecode );
+}
+/* ************************************************************************** */
+
int getushort(FILE *ttf) {
int ch1 = getc(ttf);
int ch2 = getc(ttf);
@@ -158,10 +411,11 @@ static Encoding *enc_from_platspec(int platform,int specific) {
} else if ( platform==7 ) { /* Used internally in freetype, but */
if ( specific==0 ) /* there's no harm in looking for it */
enc = "AdobeStandard"; /* even if it never happens */
- else if ( specific==1 )
+ else if ( specific==1 ) {
/* adobe_expert */;
- else if ( specific==2 )
+ } else if ( specific==2 ) {
/* adobe_custom */;
+ }
}
e = FindOrMakeEncoding(enc);
if ( e==NULL ) {
@@ -237,14 +491,15 @@ return( ret );
char *TTFGetFontName(FILE *ttf,int32 offset,int32 off2) {
int i,num;
- int32 tag, nameoffset, length, stringoffset;
+ int32 tag, length, stringoffset;
int plat, spec, lang, name, len, off, val;
- int fullval, fullstr, fulllen, famval, famstr, famlen;
Encoding *enc;
- int fullplat, fullspec, fulllang, famplat, famspec, famlang;
+ int32 nameoffset = 0;
+ int fullval=0, fullstr=0, fulllen=0, famval=0, famstr=0, famlen=0;
+ int fullplat=0, fullspec=0, fulllang=0, famplat=0, famspec=0, famlang=0;
+ int locale = MSLanguageFromLocale();
+ int maclang = WinLangToMac(locale);
- nameoffset = 0; fullstr=0; fulllen=0; famval=0; famstr=0; famlen=0;
- fullplat=0; fullspec=0; fulllang=0; famplat=0; famspec=0; famlang=0;
fseek(ttf,offset,SEEK_SET);
/* version = */ getlong(ttf);
num = getushort(ttf);
@@ -278,11 +533,19 @@ return( NULL );
if ( enc==NULL )
continue;
val = 0;
- /* I really want an english name */
- if ( (plat==0 || plat==1) && !enc->is_custom && lang==0 )
- val = 11;
- else if ( plat==3 && !enc->is_custom && (lang&0xff)==0x09 )
+ if ( plat==3 && !enc->is_custom && lang==locale )
+ val = 15;
+ else if ( plat==3 && !enc->is_custom && (lang&0xff)==(locale&0xff) )
+ val = 14;
+ else if ( (plat==0 || plat==1) && !enc->is_custom && lang==maclang )
+ val = 13;
+ /* Ok, that didn't work, how about an english name? */
+ else if ( plat==3 && !enc->is_custom && lang==0x409 )
val = 12;
+ else if ( plat==3 && !enc->is_custom && (lang&0xff)==0x09 )
+ val = 11;
+ else if ( (plat==0 || plat==1) && !enc->is_custom && lang==0 )
+ val = 10;
/* failing that I'll take what I can get */
else if ( !enc->is_custom )
val = 1;
@@ -319,53 +582,57 @@ return( _readencstring(ttf,stringoffset+fullstr,fulllen,fullplat,fullspec,fullla
static int PickTTFFont(FILE *ttf,char *filename,char **chosenname) {
int32 *offsets, cnt, i, choice, j;
char **names;
- char *pt, *lparen;
+ char *pt, *lparen, *rparen;
/* TTCF version = */ getlong(ttf);
cnt = getlong(ttf);
if ( cnt==1 ) {
- /* This is easy, don't bother to ask the user, there's no choice */
- int32 offset = getlong(ttf);
- fseek(ttf,offset,SEEK_SET);
-return( true );
+ /* This is easy, don't bother to ask the user, there's no choice */
+ int32 offset = getlong(ttf);
+ fseek(ttf,offset,SEEK_SET);
+ return( true );
}
offsets = galloc(cnt*sizeof(int32));
for ( i=0; i<cnt; ++i )
- offsets[i] = getlong(ttf);
+ offsets[i] = getlong(ttf);
names = galloc(cnt*sizeof(char *));
for ( i=j=0; i<cnt; ++i ) {
- names[j] = TTFGetFontName(ttf,offsets[i],0);
- if ( names[j]!=NULL ) ++j;
+ names[j] = TTFGetFontName(ttf,offsets[i],0);
+ if ( names[j]!=NULL ) ++j;
}
pt = strrchr(filename,'/');
if ( pt==NULL ) pt = filename;
- if ( (lparen = strchr(pt,'('))!=NULL && strchr(lparen,')')!=NULL ) {
- char *find = copy(lparen+1);
- pt = strchr(find,')');
- if ( pt!=NULL ) *pt='\0';
- for ( choice=cnt-1; choice>=0; --choice )
- if ( strcmp(names[choice],find)==0 )
- break;
- if ( choice==-1 ) {
- char *fn = copy(filename);
- fn[lparen-filename] = '\0';
- gwwv_post_error(_("Not in Collection"),
+ /* Someone gave me a font "Nafees Nastaleeq(Updated).ttf" and complained */
+ /* that ff wouldn't open it */
+ /* Now someone will complain about "Nafees(Updated).ttc(fo(ob)ar)" */
+ if ( (lparen = strrchr(pt,'('))!=NULL &&
+ (rparen = strrchr(lparen,')'))!=NULL &&
+ rparen[1]=='\0' ) {
+ char *find = copy(lparen+1);
+ pt = strchr(find,')');
+ if ( pt!=NULL ) *pt='\0';
+ for ( choice=cnt-1; choice>=0; --choice )
+ if ( strcmp(names[choice],find)==0 )
+ break;
+ if ( choice==-1 ) {
+ char *end;
+ choice = strtol(find,&end,10);
+ if ( *end!='\0' )
+ choice = -1;
+ }
+ if ( choice==-1 ) {
+ char *fn = copy(filename);
+ fn[lparen-filename] = '\0';
+ ff_post_error(_("Not in Collection"),
/* GT: The user is trying to open a font file which contains multiple fonts and */
/* GT: has asked for a font which is not in that file. */
/* GT: The string will look like: <fontname> is not in <filename> */
_("%1$s is not in %2$.100s"),find,fn);
- free(fn);
- }
- free(find);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- } else if ( no_windowing_ui )
- choice = 0;
- else
- choice = gwwv_choose(_("Pick a font, any font..."),(const char **) names,j,0,_("There are multiple fonts in this file, pick one"));
-#else
+ free(fn);
+ }
+ free(find);
} else
- choice = 0;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
+ choice = 0;
if ( choice!=-1 ) {
fseek(ttf,offsets[choice],SEEK_SET);
*chosenname = copy(names[choice]);
@@ -385,15 +652,7 @@ static int PickCFFFont(char **fontnames) {
names = gcalloc(cnt+1,sizeof(unichar_t *));
for ( i=0; i<cnt; ++i )
names[i] = uc_copy(fontnames[i]);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- if ( no_windowing_ui )
- choice = 0;
- else
- choice = gwwv_choose(_("Pick a font, any font..."),
- (const char **) names,cnt,0,_("There are multiple fonts in this file, pick one"));
-#elif defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
choice = 0;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
for ( i=0; i<cnt; ++i )
free(names[i]);
free(names);
@@ -430,10 +689,278 @@ return;
}
}
+static int32 filechecksum(FILE *file, int start, int len) {
+ uint32 sum = 0, chunk;
+
+ fseek(file,start,SEEK_SET);
+ if ( len!=-1 ) len=(len+3)>>2;
+ while ( len==-1 || --len>=0 ) {
+ chunk = getlong(file);
+ if ( feof(file))
+ break;
+ sum += chunk;
+ }
+return( sum );
+}
+
+static void ValidateTTFHead(FILE *ttf,struct ttfinfo *info) {
+ /* When doing font lint we want to check the ttf header and make */
+ /* sure all the offsets and lengths are valid, and the checksums */
+ /* match. Most of the time this is just extra work and we don't */
+ /* bather */
+ uint32 restore_this_pos = ftell(ttf);
+ struct tt_tables {
+ uint32 tag;
+ uint32 checksum;
+ uint32 offset;
+ uint32 length;
+ } *tabs, temp;
+ int i,j;
+ uint32 file_len;
+ int sr, es, rs, e_sr, e_es, e_rs;
+ int hashead, hashhea, hasmaxp, masos2, haspost, hasname, hasos2;
+ int hasloca, hascff, hasglyf;
+
+ info->numtables = getushort(ttf);
+ sr = getushort(ttf);
+ es = getushort(ttf);
+ rs = getushort(ttf);
+ e_sr = (info->numtables<8?4:info->numtables<16?8:info->numtables<32?16:info->numtables<64?32:64)*16;
+ e_es = (info->numtables<8?2:info->numtables<16?3:info->numtables<32?4:info->numtables<64?5:6);
+ e_rs = info->numtables*16-e_sr;
+ if ( e_sr!=sr || e_es!=es || e_rs!=rs ) {
+ LogError( _("Unexpected values for binsearch header. Based on the number of tables I\n expect searchRange=%d (not %d), entrySel=%d (not %d) rangeShift=%d (not %d)\n"),
+ e_sr, sr, e_es, es, e_rs, rs );
+ info->bad_sfnt_header = true;
+ }
+
+ if ( info->numtables<=0 ) {
+ LogError(_("An sfnt file must contain SOME tables, but this one does not."));
+ info->bad_sfnt_header = true;
+ fseek(ttf,restore_this_pos,SEEK_SET);
+return;
+ } else if ( info->numtables>1000 ) {
+ LogError(_("An sfnt file may contain a large number of tables, but this one has over 1000\n and that seems like too many\n"));
+ info->bad_sfnt_header = true;
+ fseek(ttf,restore_this_pos,SEEK_SET);
+return;
+ }
+
+ tabs = galloc(info->numtables*sizeof(struct tt_tables));
+
+ for ( i=0; i<info->numtables; ++i ) {
+ tabs[i].tag = getlong(ttf);
+ tabs[i].checksum = getlong(ttf);
+ tabs[i].offset = getlong(ttf);
+ tabs[i].length = getlong(ttf);
+ if ( i!=0 && tabs[i].tag<tabs[i-1].tag && !info->bad_sfnt_header ) {
+ LogError(_("Table tags should be in alphabetic order in the font header\n but '%c%c%c%c', appears after '%c%c%c%c'."),
+ tabs[i-1].tag>>24, tabs[i-1].tag>>16, tabs[i-1].tag>>8, tabs[i-1].tag,
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag );
+ info->bad_sfnt_header = true;
+ }
+ }
+ fseek(ttf,0,SEEK_END);
+ file_len = ftell(ttf);
+
+ for ( i=0; i<info->numtables; ++i ) for ( j=i+1; j<info->numtables; ++j ) {
+ if ( tabs[i].offset>tabs[j].offset ) {
+ temp = tabs[i];
+ tabs[i] = tabs[j];
+ tabs[j] = temp;
+ }
+ }
+ for ( i=0; i<info->numtables-1; ++i ) {
+ for ( j=i+1; j<info->numtables; ++j ) {
+ if ( tabs[i].tag==tabs[j].tag ) {
+ LogError(_("Same table tag, '%c%c%c%c', appears twice in sfnt header"),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag );
+ info->bad_sfnt_header = true;
+ }
+ }
+ if ( tabs[i].offset+tabs[i].length > tabs[i+1].offset ) {
+ LogError(_("Tables '%c%c%c%c' and '%c%c%c%c' overlap"),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag,
+ tabs[j].tag>>24, tabs[j].tag>>16, tabs[j].tag>>8, tabs[j].tag );
+ }
+ }
+ if ( tabs[i].offset+tabs[i].length > file_len ) {
+ LogError(_("Table '%c%c%c%c' extends beyond end of file."),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag );
+ info->bad_sfnt_header = true;
+ }
+
+ /* Checksums. First file as a whole, then each table */
+ if ( filechecksum(ttf,0,-1)!=(int)0xb1b0afba ) {
+ LogError(_("File checksum is incorrect."));
+ info->bad_sfnt_header = true;
+ }
+ for ( i=0; i<info->numtables-1; ++i ) if ( tabs[i].tag!=CHR('h','e','a','d')) {
+ if ( filechecksum(ttf,tabs[i].offset,tabs[i].length)!=(int)tabs[i].checksum ) {
+ LogError(_("Table '%c%c%c%c' has a bad checksum."),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag );
+ info->bad_sfnt_header = true;
+ }
+ }
+
+ hashead = hashhea = hasmaxp = masos2 = haspost = hasname = hasos2 = false;
+ hasloca = hascff = hasglyf = false;
+ for ( i=0; i<info->numtables-1; ++i ) {
+ switch ( tabs[i].tag ) {
+ case CHR('c','v','t',' '):
+ if ( tabs[i].length&1 )
+ LogError(_("Table '%c%c%c%c' has a bad length, must be even."),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag );
+ break;
+ case CHR('b','h','e','d'): /* Fonts with bitmaps but no outlines get bhea */
+ case CHR('h','e','a','d'):
+ if ( tabs[i].length!=54 )
+ LogError(_("Table '%c%c%c%c' has a bad length, must be 54 but is %d."),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag,
+ tabs[i].length );
+ hashead = true;
+ break;
+ case CHR('h','h','e','a'):
+ hashhea = true;
+ case CHR('v','h','e','a'):
+ if ( tabs[i].length!=36 )
+ LogError(_("Table '%c%c%c%c' has a bad length, must be 36 but is %d."),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag,
+ tabs[i].length );
+ break;
+ case CHR('m','a','x','p'):
+ hasmaxp = true;
+ if ( tabs[i].length!=32 && tabs[i].length!=6 )
+ LogError(_("Table '%c%c%c%c' has a bad length, must be 32 or 6 but is %d."),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag,
+ tabs[i].length );
+ break;
+ case CHR('O','S','/','2'):
+ hasos2 = true;
+ if ( tabs[i].length!=78 && tabs[i].length!=86 && tabs[i].length!=96 )
+ LogError(_("Table '%c%c%c%c' has a bad length, must be 78, 86 or 96 but is %d."),
+ tabs[i].tag>>24, tabs[i].tag>>16, tabs[i].tag>>8, tabs[i].tag,
+ tabs[i].length );
+ break;
+ case CHR('p','o','s','t'):
+ haspost = true;
+ break;
+ case CHR('n','a','m','e'):
+ hasname = true;
+ break;
+ case CHR('l','o','c','a'):
+ hasloca = true;
+ break;
+ case CHR('g','l','y','f'):
+ hasglyf = true;
+ break;
+ case CHR('C','F','F',' '):
+ hascff = true;
+ break;
+ }
+ }
+ if ( !hashead )
+ LogError(_("Missing required table: \"head\""));
+ if ( !hashhea )
+ LogError(_("Missing required table: \"hhea\""));
+ if ( !hasmaxp )
+ LogError(_("Missing required table: \"maxp\""));
+ if ( !haspost )
+ LogError(_("Missing required table: \"post\""));
+ if ( !hasname )
+ LogError(_("Missing required table: \"name\""));
+ if ( hasglyf && !hasloca )
+ LogError(_("Missing required table: \"loca\""));
+ if ( !hasos2 )
+ LogError(_("Missing \"OS/2\" table"));
+ if ( !hasglyf && hasloca )
+ LogError(_("Missing required table: \"glyf\""));
+ if ( !hasglyf && !hascff )
+ LogError(_("This font contains neither \"CFF \" nor \"glyf\"/\"loca\" tables"));
+
+ free(tabs);
+ fseek(ttf,restore_this_pos,SEEK_SET);
+}
+
+static struct tablenames { uint32 tag; char *name; } stdtables[] = {
+ { CHR('a','c','n','t'), N_("accent attachment table") },
+ { CHR('a','v','a','r'), N_("axis variation table") },
+ { CHR('B','A','S','E'), N_("Baseline table (OT version)") },
+ { CHR('b','d','a','t'), N_("bitmap data table (AAT version)") },
+ { CHR('B','D','F',' '), N_("BDF bitmap properties table") },
+ { CHR('b','h','e','d'), N_("bitmap font header table") },
+ { CHR('b','l','o','c'), N_("bitmap location table (AAT version)") },
+ { CHR('b','s','l','n'), N_("baseline table (AAT version)") },
+ { CHR('C','F','F',' '), N_("PostScript font program (Compact Font Format)") },
+ { CHR('C','I','D',' '), N_("Obsolete table for a type1 CID keyed font") },
+ { CHR('c','m','a','p'), N_("character code mapping table") },
+ { CHR('c','v','a','r'), N_("CVT variation table") },
+ { CHR('c','v','t',' '), N_("control value table") },
+ { CHR('D','S','I','G'), N_("digital signature table") },
+ { CHR('E','B','D','T'), N_("bitmap data table (OT version)") },
+ { CHR('E','B','L','C'), N_("bitmap location table (OT version)") },
+ { CHR('E','B','S','C'), N_("embedded bitmap scaling control table") },
+ { CHR('E','L','U','A'), N_("electronic end user license table") },
+ { CHR('f','d','s','c'), N_("font descriptor table") },
+ { CHR('f','e','a','t'), N_("layout feature table") },
+ { CHR('F','e','a','t'), N_("SIL Graphite layout feature table") },
+ { CHR('F','F','T','M'), N_("FontForge time stamp table") },
+ { CHR('f','m','t','x'), N_("font metrics table") },
+ { CHR('f','p','g','m'), N_("font program table") },
+ { CHR('f','v','a','r'), N_("font variation table") },
+ { CHR('g','a','s','p'), N_("grid-fitting and scan-conversion procedure table") },
+ { CHR('G','D','E','F'), N_("glyph definition table") },
+ { CHR('G','l','a','t'), N_("Graphite glyph attribute table") },
+ { CHR('G','l','o','c'), N_("Graphite glyph location in Glat table") },
+ { CHR('g','l','y','f'), N_("glyph outline table") },
+ { CHR('G','P','O','S'), N_("glyph positioning table") },
+ { CHR('g','v','a','r'), N_("glyph variation table") },
+ { CHR('G','S','U','B'), N_("glyph substitution table") },
+ { CHR('h','d','m','x'), N_("horizontal device metrics table") },
+ { CHR('h','e','a','d'), N_("font header table") },
+ { CHR('h','h','e','a'), N_("horizontal header table") },
+ { CHR('h','m','t','x'), N_("horizontal metrics table") },
+ { CHR('h','s','t','y'), N_("horizontal style table") },
+ { CHR('j','u','s','t'), N_("justification table (AAT version)") },
+ { CHR('J','S','T','F'), N_("justification table (OT version)") },
+ { CHR('k','e','r','n'), N_("kerning table") },
+ { CHR('l','c','a','r'), N_("ligature caret table") },
+ { CHR('l','o','c','a'), N_("glyph location table") },
+ { CHR('L','T','S','H'), N_("linear threshold table") },
+ { CHR('M','A','T','H'), N_("math table") },
+ { CHR('m','a','x','p'), N_("maximum profile table") },
+ { CHR('M','M','S','D'), N_("Multi-Master table, obsolete") },
+ { CHR('M','M','F','X'), N_("Multi-Master table, obsolete") },
+ { CHR('m','o','r','t'), N_("metamorphosis table") },
+ { CHR('m','o','r','x'), N_("extended metamorphosis table") },
+ { CHR('n','a','m','e'), N_("name table") },
+ { CHR('o','p','b','d'), N_("optical bounds table") },
+ { CHR('O','S','/','2'), N_("OS/2 and Windows specific metrics table") },
+ { CHR('P','C','L','T'), N_("PCL 5 data table") },
+ { CHR('P','f','E','d'), N_("FontForge font debugging table") },
+ { CHR('p','o','s','t'), N_("glyph name and PostScript compatibility table") },
+ { CHR('p','r','e','p'), N_("control value program table") },
+ { CHR('p','r','o','p'), N_("properties table") },
+ { CHR('S','i','l','f'), N_("SIL Graphite rule table") },
+ { CHR('S','i','l','l'), N_("(unspecified) SIL Graphite table") },
+ { CHR('S','i','l','t'), N_("unknown SIL table") },
+ { CHR('T','e','X',' '), N_("TeX table") },
+ { CHR('t','r','a','k'), N_("tracking table") },
+ { CHR('T','Y','P','1'), N_("Obsolete table for a type1 font") },
+ { CHR('V','D','M','X'), N_("vertical device metrics table") },
+ { CHR('v','h','e','a'), N_("vertical header table") },
+ { CHR('v','m','t','x'), N_("vertical metrics table") },
+ { CHR('V','O','R','G'), N_("vertical origin table") },
+ { CHR('Z','a','p','f'), N_("glyph reference table") },
+ { 0 , NULL }
+};
+
static int readttfheader(FILE *ttf, struct ttfinfo *info,char *filename,
char **choosenname) {
- int i, j;
- int tag, checksum, offset, length, version;
+ int i, j, k;
+ unsigned tag;
+ int checksum, offset, length, version;
+ int first = true;
version=getlong(ttf);
if ( version==CHR('t','t','c','f')) {
@@ -449,14 +976,19 @@ return( 0 );
/* Apple says that 'typ1' is a valid code for a type1 font wrapped up in */
/* a truetype table structure, but gives no docs on what tables get used */
- /* or how */
- if ( version==CHR('t','y','p','1')) {
+ /* or how */ /* Turns out to be pretty simple */
+ /* typ1 is used for both type1 fonts and CID type1 fonts, I don't think a version of 'CID ' is actually used */
+ if ( version==CHR('t','y','p','1') || version==CHR('C','I','D',' ')) {
LogError( _("Nifty, you've got one of the old Apple/Adobe type1 sfnts here\n") );
} else if ( version!=0x00010000 && version!=CHR('t','r','u','e') &&
version!=0x00020000 && /* Windows 3.1 Chinese version used this version for some arphic fonts */
/* See discussion on freetype list, july 2004 */
version!=CHR('O','T','T','O'))
return( 0 ); /* Not version 1 of true type, nor Open Type */
+
+ if ( info->openflags & of_fontlint )
+ ValidateTTFHead(ttf,info);
+
info->numtables = getushort(ttf);
/* searchRange = */ getushort(ttf);
/* entrySelector = */ getushort(ttf);
@@ -473,6 +1005,12 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
printf( "%c%c%c%c\n", tag>>24, (tag>>16)&0xff, (tag>>8)&0xff, tag&0xff );
#endif
switch ( tag ) {
+ case CHR('B','A','S','E'):
+ info->base_start = offset;
+ break;
+ case CHR('b','s','l','n'):
+ info->bsln_start = offset;
+ break;
case CHR('C','F','F',' '):
info->cff_start = offset;
info->cff_length = length;
@@ -541,6 +1079,7 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
case CHR('O','S','/','2'):
info->os2_start = offset;
break;
+ case CHR('C','I','D',' '):
case CHR('T','Y','P','1'):
info->typ1_start = offset;
info->typ1_length = length;
@@ -551,13 +1090,16 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
case CHR('v','m','t','x'):
info->vmetrics_start = offset;
break;
- case CHR('V','O','R','G'):
- info->vorg_start = offset;
+ case CHR('M','A','T','H'):
+ info->math_start = offset;
+ info->math_length = length;
break;
/* Apple stuff */
+#if 0
case CHR('a','c','n','t'):
info->acnt_start = offset;
break;
+#endif
case CHR('f','e','a','t'):
info->feat_start = offset;
break;
@@ -628,8 +1170,35 @@ return( 0 ); /* Not version 1 of true type, nor Open Type */
info->savetab[j].len = length;
break;
}
+ if ( j==info->savecnt ) {
+ if ( first ) {
+ LogError( _("The following table(s) in the font have been ignored by FontForge\n") );
+ first = false;
+ }
+ for ( k=0; stdtables[k].tag!=0; ++k )
+ if ( stdtables[k].tag == tag )
+ break;
+ if ( stdtables[k].tag==0 ) {
+ LogError( _(" Ignoring '%c%c%c%c'\n"), tag>>24, tag>>16, tag>>8, tag);
+ } else {
+ LogError( _(" Ignoring '%c%c%c%c' %s\n"), tag>>24, tag>>16, tag>>8, tag,
+ _(stdtables[k].name));
+ }
+ }
}
}
+ if ( info->glyphlocations_start!=0 && info->cff_start!=0 )
+ LogError( _("This font contains both truetype and PostScript glyph descriptions\n only one will be used.\n"));
+ else if ( (info->glyphlocations_start!=0) +
+ (info->cff_start!=0) +
+ (info->typ1_start!=0)>1 )
+ LogError( _("This font contains multiple glyph descriptions\n only one will be used.\n"));
+ if ( info->gpos_start!=0 && info->kern_start!=0 )
+ LogError( _("This font contains both a 'kern' table and a 'GPOS' table.\n The 'kern' table will only be read if there is no 'kern' feature in 'GPOS'.\n"));
+ if ( (info->mort_start!=0 || info->morx_start!=0) && info->gsub_start!=0 )
+ LogError( _("This font contains both a 'mor[tx]' table and a 'GSUB' table.\n FF will only read feature/settings in 'morx' which do not match features\n found in 'GSUB'.\n"));
+ if ( info->base_start!=0 && info->bsln_start!=0 )
+ LogError( _("This font contains both a 'BASE' table and a 'bsln' table.\n FontForge will only read one of them ('BASE').\n"));
return( true );
}
@@ -683,7 +1252,12 @@ static void readttfhead(FILE *ttf,struct ttfinfo *info) {
fseek(ttf,info->head_start+4*4,SEEK_SET); /* skip over the version number and a bunch of junk */
flags = getushort(ttf);
info->optimized_for_cleartype = (flags&(1<<13))?1:0;
+ info->apply_lsb = !(flags&(1<<1));
info->emsize = getushort(ttf);
+
+ info->ascent = .8*info->emsize;
+ info->descent = info->emsize-info->ascent;
+
for ( i=0; i<12; ++i )
getushort(ttf);
info->macstyle = getushort(ttf);
@@ -715,9 +1289,6 @@ static void readttfhhea(FILE *ttf,struct ttfinfo *info) {
info->pfminfo.hheadset = true;
/*info->ascent = info->pfminfo.hhead_ascent;*/
- info->ascent = .8*info->emsize;
- info->descent = info->emsize-info->ascent;
-
for ( i=0; i<12; ++i )
getushort(ttf);
info->width_cnt = getushort(ttf);
@@ -733,9 +1304,8 @@ static void readttfmaxp(FILE *ttf,struct ttfinfo *info) {
/* X11 OpenType bitmap format */;
info->onlystrikes = true;
} else if ( cnt!=info->glyph_cnt && info->loca_length!=0 ) {
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
ff_post_notice(_("Bad Glyph Count"), _("Font file has bad glyph count field. maxp says: %d sizeof(loca)=>%d"), cnt, info->glyph_cnt);
-#endif
+ info->bad_glyph_data = true;
if ( cnt>info->glyph_cnt )
cnt = info->glyph_cnt; /* Use the smaller of the two values */
}
@@ -821,7 +1391,7 @@ return;
}
}
-static void ValidatePostScriptFontName(char *str) {
+static void ValidatePostScriptFontName(struct ttfinfo *info, char *str) {
char *end, *pt, *npt;
int complained = false;
@@ -830,15 +1400,15 @@ static void ValidatePostScriptFontName(char *str) {
/* only printable ASCII should be used */
if ( ((uint8 *) str)[0] == 0xef && ((uint8 *) str)[1]==0xbb && ((uint8 *) str)[2] == 0xbf ) {
LogError(_("The fontname begins with the utf8 byte order sequence. This is illegal. %s"), str+3 );
+ info->bad_ps_fontname = true;
for ( pt=str+3; *pt; ++pt )
pt[-3] = *pt; /* ANSI says we can't strcpy overlapping strings */
}
strtod(str,&end);
- if ( (*end=='\0' || (Isdigit(str[0]) && strchr(str,'#')!=NULL)) &&
+ if ( (*end=='\0' || (isdigit(str[0]) && strchr(str,'#')!=NULL)) &&
*str!='\0' ) {
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_post_error(_("Bad Font Name"),_("A Postscript name may not be a number"));
-#endif
+ ff_post_error(_("Bad Font Name"),_("A Postscript name may not be a number"));
+ info->bad_ps_fontname = true;
*str = 'a';
complained = true;
}
@@ -848,9 +1418,8 @@ static void ValidatePostScriptFontName(char *str) {
*pt==')' || *pt==']' || *pt=='}' || *pt=='>' ||
*pt=='%' || *pt=='/' ) {
if ( !complained ) {
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_post_error(_("Bad Font Name"),_("The Postscript font name \"%.63s\" is invalid.\nIt should be printable ASCII,\nmust not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"),str);
-#endif
+ ff_post_error(_("Bad Font Name"),_("The Postscript font name \"%.63s\" is invalid.\nIt should be printable ASCII,\nmust not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"),str);
+ info->bad_ps_fontname = true;
}
complained = true;
for ( npt=pt; npt[1]; ++npt )
@@ -860,9 +1429,8 @@ static void ValidatePostScriptFontName(char *str) {
}
}
if ( strlen(str)>63 ) {
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_post_error(_("Bad Font Name"),_("The Postscript font name \"%.63s\" is invalid.\nIt should be printable ASCII,\nmust not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"),str);
-#endif
+ ff_post_error(_("Bad Font Name"),_("The Postscript font name \"%.63s\" is invalid.\nIt should be printable ASCII,\nmust not contain (){}[]<>%%/ or space\nand must be shorter than 63 characters"),str);
+ info->bad_ps_fontname = true;
str[63] = '\0';
}
}
@@ -874,7 +1442,7 @@ char *EnforcePostScriptName(char *old) {
return( old );
strtod(str,&end);
- if ( (*end=='\0' || (Isdigit(str[0]) && strchr(str,'#')!=NULL)) &&
+ if ( (*end=='\0' || (isdigit(str[0]) && strchr(str,'#')!=NULL)) &&
*str!='\0' ) {
free(str);
str=galloc(strlen(old)+2);
@@ -896,7 +1464,6 @@ return( old );
return( str );
}
-#ifndef LUA_FF_LIB
static int IsSubSetOf(const char *substr,const char *fullstr ) {
/* The mac string is often a subset of the unicode string. Certain */
/* characters can't be expressed in the mac encoding and are omitted */
@@ -923,7 +1490,6 @@ return( true );
}
return( ch1=='\0' );
}
-#endif
static void TTFAddLangStr(FILE *ttf, struct ttfinfo *info, int id,
int strlen, int stroff,int plat,int spec,int language) {
@@ -940,7 +1506,7 @@ return;
if ( str==NULL ) /* we didn't understand the encoding */
return;
if ( id==ttf_postscriptname )
- ValidatePostScriptFontName(str);
+ ValidatePostScriptFontName(info,str);
if ( *str=='\0' ) {
free(str);
return;
@@ -976,7 +1542,6 @@ return;
cur->frommac[id/32] &= ~(1<<(id&0x1f));
} else if ( plat==1 ) {
/* Mac string doesn't match mac unicode string */
-#ifndef LUA_FF_LIB
if ( !IsSubSetOf(str,cur->names[id]) )
LogError( _("Warning: Mac and Unicode entries in the 'name' table differ for the\n %s string in the language %s\n Mac String: %s\nMac Unicode String: %s\n"),
TTFNameIds(id),MSLangString(language),
@@ -984,10 +1549,8 @@ return;
else
LogError( _("Warning: Mac string is a subset of the Unicode string in the 'name' table\n for the %s string in the %s language.\n"),
TTFNameIds(id),MSLangString(language));
-#endif
free(str);
} else if ( plat==3 && (cur->frommac[id/32] & (1<<(id&0x1f))) ) {
-#ifndef LUA_FF_LIB
if ( !IsSubSetOf(cur->names[id],str) )
LogError( _("Warning: Mac and Windows entries in the 'name' table differ for the\n %s string in the language %s\n Mac String: %s\nWindows String: %s\n"),
TTFNameIds(id),MSLangString(language),
@@ -995,35 +1558,15 @@ return;
else
LogError( _("Warning: Mac string is a subset of the Windows string in the 'name' table\n for the %s string in the %s language.\n"),
TTFNameIds(id),MSLangString(language));
-#endif
free(cur->names[id]);
cur->names[id] = str;
cur->frommac[id/32] &= ~(1<<(id&0x1f));
} else {
int ret;
- extern int running_script;
if ( info->dupnamestate!=0 )
ret = info->dupnamestate;
- else if ( running_script )
- ret = 3;
- else {
- char *buts[5];
- buts[0] = _("Use _First");
- buts[1] = _("First to _All");
- buts[2] = _("Second _to All");
- buts[3] = _("Use _Second");
- buts[4] = NULL;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- ret = gwwv_ask(_("Multiple names for language"),(const char **)buts,0,3,
- _("The 'name' table contains (at least) two strings for the %s in language %s, the first '%.12s...' the second '%.12s...'.\nWhich do you prefer?"),
- TTFNameIds(id),MSLangString(language),
- cur->names[id],str);
-#else
+ else
ret = 3;
-#endif
- if ( ret==1 || ret==2 )
- info->dupnamestate = ret;
- }
if ( ret==0 || ret==1 )
free(str);
else {
@@ -1179,7 +1722,7 @@ static void readttfcopyrights(FILE *ttf,struct ttfinfo *info) {
if ( info->fontname==NULL && info->familyname!=NULL )
info->fontname = stripspaces(copy(info->familyname));
if ( info->fontname!=NULL )
- ValidatePostScriptFontName(info->fontname);
+ ValidatePostScriptFontName(info,info->fontname);
}
if ( info->features ) {
@@ -1352,8 +1895,8 @@ static SplineSet *ttfbuildcontours(int path_cnt,uint16 *endpt, char *flags,
cur->last = cur->first;
}
for ( sp=cur->first; ; ) {
- if ( sp->ttfindex!=0xffff && SPInterpolate(sp) )
- sp->dontinterpolate = true;
+ /*if ( sp->ttfindex!=0xffff && SPInterpolate(sp) )
+ sp->dontinterpolate = true;*/ /* TODO: needs checking */
if ( sp->next==NULL )
break;
sp=sp->next->to;
@@ -1375,6 +1918,7 @@ static void readttfsimpleglyph(FILE *ttf,struct ttfinfo *info,SplineChar *sc, in
for ( i=0; i<path_cnt; ++i ) {
endpt[i] = getushort(ttf);
if ( i!=0 && endpt[i]<endpt[i-1] ) {
+ info->bad_glyph_data = true;
LogError( _("Bad tt font: contour ends make no sense in glyph %d.\n"),
sc->orig_pos );
return;
@@ -1450,22 +1994,27 @@ return;
free(endpt);
free(flags);
free(pts);
- if ( feof(ttf))
+ if ( feof(ttf)) {
LogError( _("Reached end of file when reading simple glyph\n") );
+ info->bad_glyph_data = true;
+ }
}
static void readttfcompositglyph(FILE *ttf,struct ttfinfo *info,SplineChar *sc, int32 end) {
- RefChar *head=NULL, *last=NULL, *cur;
+ RefChar *head=NULL, *last=NULL, *cur=NULL;
int flags=0, arg1, arg2;
+ int use_my_metrics=0;
if ( ftell(ttf)>=end ) {
LogError( _("Empty composite %d\n"), sc->orig_pos );
+ info->bad_glyph_data = true;
return;
}
do {
if ( ftell(ttf)>=end ) {
LogError( _("Bad flags value, implied MORE components at end of glyph %d\n"), sc->orig_pos );
+ info->bad_glyph_data = true;
break;
}
cur = RefCharCreate();
@@ -1473,6 +2022,7 @@ return;
cur->orig_pos = getushort(ttf);
if ( feof(ttf) || cur->orig_pos>=info->glyph_cnt ) {
LogError(_("Reference to glyph %d out of bounds when parsing 'glyf' table.\n"), cur->orig_pos );
+ info->bad_glyph_data = true;
cur->orig_pos = 0;
}
if ( info->inuse!=NULL )
@@ -1485,6 +2035,13 @@ return;
arg2 = (signed char) getc(ttf);
}
cur->use_my_metrics = (flags & _USE_MY_METRICS) ? 1 : 0;
+ if ( cur->use_my_metrics ) {
+ if ( use_my_metrics ) {
+ LogError( _("Use-my-metrics flag set on at least two components in glyph %d\n"), sc->orig_pos );
+ info->bad_glyph_data = true;
+ } else
+ use_my_metrics = true;
+ }
cur->round_translation_to_grid = (flags & _ROUND) ? 1 : 0;
if ( flags & _ARGS_ARE_XY ) {
/* There is some very strange stuff (half-)documented on the apple*/
@@ -1575,6 +2132,7 @@ return;
}
if ( feof(ttf)) {
LogError(_("Reached end of file when reading composit glyph\n") );
+ info->bad_glyph_data = true;
break;
}
} while ( flags&_MORE );
@@ -1589,28 +2147,30 @@ return;
} else
sc->ttf_instrs_len = 0;
}
- /* I'm ignoring many things that I don't understand here */
- /* what happens if ARGS AREN'T XY */
- /* ROUND means that offsets should rounded to the grid before being added */
- /* (it's irrelevant for my purposes) */
sc->layers[ly_fore].refs = head;
}
static SplineChar *readttfglyph(FILE *ttf,struct ttfinfo *info,int start, int end,int gid) {
int path_cnt;
- SplineChar *sc = SplineCharCreate();
+ SplineChar *sc = SplineCharCreate(2);
sc->unicodeenc = -1;
sc->vwidth = info->emsize;
- /* sc->manualhints = 1; */ /* But only when I know how to read them in!!!! */
+ sc->orig_pos = gid;
- if ( end>info->glyph_length ) {
+ if ( end>(int)info->glyph_length ) {
if ( !info->complainedbeyondglyfend )
LogError(_("Bad glyph (%d), its definition extends beyond the end of the glyf table\n"), gid );
+ info->bad_glyph_data = true;
info->complainedbeyondglyfend = true;
SplineCharFree(sc);
return( NULL );
+ } else if ( end<start ) {
+ LogError(_("Bad glyph (%d), its data length is negative\n"), gid );
+ SplineCharFree(sc);
+return( NULL );
}
+
if ( start==end ) {
/* This isn't mentioned, but we seem to get some glyphs with no size,*/
/* not even a path cnt. They appear to be empty glyphs */
@@ -1618,29 +2178,34 @@ return( sc );
}
fseek(ttf,info->glyph_start+start,SEEK_SET);
path_cnt = (short) getushort(ttf);
+
#ifdef LUA_FF_LIB
sc->xmin = getushort(ttf);
sc->ymin = getushort(ttf);
sc->xmax = getushort(ttf);
sc->ymax = getushort(ttf);
- /* TH: this was ugly, and not needed
- sc->lsidebearing = sc->ymax;
- */
+ sc->lsidebearing = sc->xmin;
#else
- /* xmin = */ getushort(ttf);
+ /* xmin = */ sc->lsidebearing = getushort(ttf);
/* ymin = */ getushort(ttf);
/* xmax = */ getushort(ttf);
- /* ymax = */ sc->lsidebearing = getushort(ttf);
+ /* ymax = */ /* sc->lsidebearing = */ getushort(ttf); /* what was this for? */
#endif
- sc->orig_pos = gid;
if ( path_cnt>=0 )
readttfsimpleglyph(ttf,info,sc,path_cnt);
else
readttfcompositglyph(ttf,info,sc,info->glyph_start+end);
- if ( start>end )
+ if ( start>end ) {
LogError(_("Bad glyph (%d), disordered 'loca' table (start comes after end)\n"), gid );
- else if ( ftell(ttf)>info->glyph_start+end )
+ info->bad_glyph_data = true;
+ } else if ( ftell(ttf)>info->glyph_start+end ) {
LogError(_("Bad glyph (%d), its definition extends beyond the space allowed for it\n"), gid );
+ info->bad_glyph_data = true;
+ }
+
+ /* find the bb */
+ THPatchSplineChar(sc);
+
return( sc );
}
@@ -1663,33 +2228,31 @@ static void readttfglyphs(FILE *ttf,struct ttfinfo *info) {
}
info->chars = gcalloc(info->glyph_cnt,sizeof(SplineChar *));
- if ( !info->is_ttc ) {
+ if ( !info->is_ttc || (info->openflags&of_all_glyphs_in_ttc)) {
/* read all the glyphs */
for ( i=0; i<info->glyph_cnt ; ++i ) {
info->chars[i] = readttfglyph(ttf,info,goffsets[i],goffsets[i+1],i);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
} else {
/* only read the glyphs we actually use in this font */
/* this is complicated by references (and substitutions), */
/* we can't just rely on the encoding to tell us what is used */
info->inuse = gcalloc(info->glyph_cnt,sizeof(char));
- readttfencodings(ttf,info,true);
+ readttfencodings(ttf,info,git_justinuse);
if ( info->gsub_start!=0 ) /* Some glyphs may appear in substitutions and not in the encoding... */
readttfgsubUsed(ttf,info);
- /* I don't bother to read the morx table because mac doesn't */
- /* support ttc files */
+ if ( info->math_start!=0 )
+ otf_read_math_used(ttf,info);
+ /* I don't bother to read the morx table because mac doesn't */
+ /* support ttc files */
anyread = true;
while ( anyread ) {
anyread = false;
for ( i=0; i<info->glyph_cnt ; ++i ) {
if ( info->inuse[i] && info->chars[i]==NULL ) {
info->chars[i] = readttfglyph(ttf,info,goffsets[i],goffsets[i+1],i);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
anyread = info->chars[i]!=NULL;
}
}
@@ -1700,9 +2263,7 @@ static void readttfglyphs(FILE *ttf,struct ttfinfo *info) {
for ( i=0; i<info->glyph_cnt ; ++i )
if ( info->chars[i]!=NULL )
info->chars[i]->orig_pos = i;
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next_stage();
-#endif
+ ff_progress_next_stage();
}
/* Standard names for cff */
@@ -2102,7 +2663,7 @@ const char *cffnames[] = {
};
const int nStdStrings = sizeof(cffnames)/sizeof(cffnames[0])-1;
-static char **readcfffontnames(FILE *ttf,int *cnt) {
+static char **readcfffontnames(FILE *ttf,int *cnt,struct ttfinfo *info) {
uint16 count = getushort(ttf);
int offsize;
uint32 *offsets;
@@ -2124,6 +2685,7 @@ return( NULL );
/* GT: is bad. It is an index of many of the names used in the CFF font. */
/* GT: We hope the user will never see this. */
LogError( _("Bad CFF name INDEX\n") );
+ if ( info!=NULL ) info->bad_cff = true;
while ( i<count ) {
names[i] = copy("");
++i;
@@ -2131,7 +2693,7 @@ return( NULL );
--i;
} else {
names[i] = galloc(offsets[i+1]-offsets[i]+1);
- for ( j=0; j<offsets[i+1]-offsets[i]; ++j )
+ for ( j=0; j<(int)(offsets[i+1]-offsets[i]); ++j )
names[i][j] = getc(ttf);
names[i][j] = '\0';
}
@@ -2158,7 +2720,7 @@ static char *addnibble(char *pt, int nib) {
return( pt );
}
-static int readcffthing(FILE *ttf,int *_ival,real *dval,int *operand) {
+static int readcffthing(FILE *ttf,int *_ival,real *dval,int *operand,struct ttfinfo *info) {
char buffer[50], *pt;
int ch, ival;
@@ -2203,6 +2765,7 @@ return( 1 );
return( 1 );
}
LogError(_("Unexpected value in dictionary %d\n"), ch );
+ info->bad_cff = true;
*_ival = 0;
return( 0 );
}
@@ -2255,6 +2818,7 @@ struct topdicts {
int painttype;
int charstringtype;
real fontmatrix[6];
+ int fontmatrix_set;
int uniqueid;
real fontbb[4];
real strokewidth;
@@ -2331,7 +2895,7 @@ static void TopDictFree(struct topdicts *dict) {
free(dict);
}
-static void readcffsubrs(FILE *ttf, struct pschars *subs) {
+static void readcffsubrs(FILE *ttf, struct pschars *subs, struct ttfinfo *info) {
uint16 count = getushort(ttf);
int offsize;
uint32 *offsets;
@@ -2353,12 +2917,13 @@ return;
if ( offsets[i+1]>offsets[i] && offsets[i+1]-offsets[i]<0x10000 ) {
subs->lens[i] = offsets[i+1]-offsets[i];
subs->values[i] = galloc(offsets[i+1]-offsets[i]+1);
- for ( j=0; j<offsets[i+1]-offsets[i]; ++j )
+ for ( j=0; j<(int)(offsets[i+1]-offsets[i]); ++j )
subs->values[i][j] = getc(ttf);
subs->values[i][j] = '\0';
} else {
if ( !err )
LogError( _("Bad subroutine INDEX in cff font.\n" ));
+ info->bad_cff = true;
err = true;
subs->lens[i] = 1;
subs->values[i] = galloc(2);
@@ -2370,14 +2935,15 @@ return;
free(offsets);
}
-static struct topdicts *readcfftopdict(FILE *ttf, char *fontname, int len) {
+static struct topdicts *readcfftopdict(FILE *ttf, char *fontname, int len,
+ struct ttfinfo *info) {
struct topdicts *td = gcalloc(1,sizeof(struct topdicts));
long base = ftell(ttf);
int ival, oval, sp, ret, i;
real stack[50];
if ( fontname!=NULL )
- ValidatePostScriptFontName(fontname);
+ ValidatePostScriptFontName(info,fontname);
td->fontname = fontname;
td->underlinepos = -100;
@@ -2395,7 +2961,7 @@ static struct topdicts *readcfftopdict(FILE *ttf, char *fontname, int len) {
/* blend operators. We're ignoring that */
while ( ftell(ttf)<base+len ) {
sp = 0;
- while ( (ret=readcffthing(ttf,&ival,&stack[sp],&oval))!=3 && ftell(ttf)<base+len ) {
+ while ( (ret=readcffthing(ttf,&ival,&stack[sp],&oval,info))!=3 && ftell(ttf)<base+len ) {
if ( ret==1 )
stack[sp]=ival;
if ( ret!=0 && sp<45 )
@@ -2403,9 +2969,10 @@ static struct topdicts *readcfftopdict(FILE *ttf, char *fontname, int len) {
}
if ( ret==3 && oval==31 /* "T2" operator, can have 0 arguments */ ) {
skipcfft2thing(ttf);
- } else if ( sp==0 )
+ } else if ( sp==0 ) {
LogError( _("No argument to operator\n") );
- else if ( ret==3 ) switch( oval ) {
+ info->bad_cff = true;
+ } else if ( ret==3 ) switch( oval ) {
case 0:
td->version = stack[sp-1];
break;
@@ -2444,6 +3011,7 @@ static struct topdicts *readcfftopdict(FILE *ttf, char *fontname, int len) {
break;
case (12<<8)+7:
memcpy(td->fontmatrix,stack,(sp>=6?6:sp)*sizeof(real));
+ td->fontmatrix_set = 1;
break;
case 13:
td->uniqueid = stack[sp-1];
@@ -2487,6 +3055,7 @@ static struct topdicts *readcfftopdict(FILE *ttf, char *fontname, int len) {
break;
case (12<<8)+24:
LogError( _("FontForge does not support type2 multiple master fonts\n") );
+ info->bad_cff = true;
td->nMasters = stack[0];
td->nAxes = sp-4;
memcpy(td->weightvector,stack+1,(sp-4)*sizeof(real));
@@ -2533,13 +3102,14 @@ static struct topdicts *readcfftopdict(FILE *ttf, char *fontname, int len) {
break;
default:
LogError(_("Unknown operator in %s: %x\n"), fontname, oval );
+ info->bad_cff = true;
break;
}
}
return( td );
}
-static void readcffprivate(FILE *ttf, struct topdicts *td) {
+static void readcffprivate(FILE *ttf, struct topdicts *td, struct ttfinfo *info) {
int ival, oval, sp, ret, i;
real stack[50];
int32 end = td->cff_start+td->private_offset+td->private_size;
@@ -2553,8 +3123,12 @@ static void readcffprivate(FILE *ttf, struct topdicts *td) {
td->bluescale = .039625;
while ( ftell(ttf)<end ) {
+ if ( feof(ttf) ) {
+ LogError("End of file found when reading private dictionary.\n" );
+ break;
+ }
sp = 0;
- while ( (ret=readcffthing(ttf,&ival,&stack[sp],&oval))!=3 && ftell(ttf)<end ) {
+ while ( (ret=readcffthing(ttf,&ival,&stack[sp],&oval,info))!=3 && ftell(ttf)<end ) {
if ( ret==1 )
stack[sp]=ival;
if ( ret!=0 && sp<45 )
@@ -2562,9 +3136,10 @@ static void readcffprivate(FILE *ttf, struct topdicts *td) {
}
if ( ret==3 && oval==31 /* "T2" operator, can have 0 arguments */ ) {
skipcfft2thing(ttf);
- } else if ( sp==0 && oval!=6 && oval!=7 && oval!=8 && oval!=9 && oval !=(12<<8)+12 && oval !=(12<<8)+13)
+ } else if ( sp==0 && oval!=6 && oval!=7 && oval!=8 && oval!=9 && oval !=(12<<8)+12 && oval !=(12<<8)+13) {
LogError( _("No argument to operator %d in private dict\n"), oval );
- else if ( ret==3 ) switch( oval ) {
+ info->bad_cff = true;
+ } else if ( ret==3 ) switch( oval ) {
case 6:
for ( i=0; i<sp && i<14; ++i ) {
td->bluevalues[i] = stack[i];
@@ -2625,7 +3200,7 @@ static void readcffprivate(FILE *ttf, struct topdicts *td) {
case (12<<8)+14:
td->forcebold = stack[sp-1];
break;
- case (12<<8)+15:
+ case (12<<8)+15: /* obsolete */
td->forceboldthreshold = stack[sp-1];
break;
case (12<<8)+16:
@@ -2652,17 +3227,19 @@ static void readcffprivate(FILE *ttf, struct topdicts *td) {
break;
default:
LogError(_("Unknown operator in %s: %x\n"), td->fontname, oval );
+ info->bad_cff = true;
break;
}
}
if ( td->subrsoff!=-1 ) {
fseek(ttf,td->cff_start+td->private_offset+td->subrsoff,SEEK_SET);
- readcffsubrs(ttf,&td->local_subrs);
+ readcffsubrs(ttf,&td->local_subrs,info);
}
}
-static struct topdicts **readcfftopdicts(FILE *ttf, char **fontnames, int32 cff_start) {
+static struct topdicts **readcfftopdicts(FILE *ttf, char **fontnames, int32 cff_start,
+ struct ttfinfo *info, struct topdicts *parent_dict) {
uint16 count = getushort(ttf);
int offsize;
uint32 *offsets;
@@ -2678,7 +3255,10 @@ return( NULL );
dicts = galloc((count+1)*sizeof(struct topdicts *));
for ( i=0; i<count; ++i ) {
dicts[i] = readcfftopdict(ttf,fontnames!=NULL?fontnames[i]:NULL,
- offsets[i+1]-offsets[i]);
+ offsets[i+1]-offsets[i], info);
+ if ( parent_dict!=NULL && parent_dict->fontmatrix_set ) {
+ MatMultiply(parent_dict->fontmatrix,dicts[i]->fontmatrix,dicts[i]->fontmatrix);
+ }
dicts[i]->cff_start = cff_start;
}
dicts[i] = NULL;
@@ -2686,13 +3266,14 @@ return( NULL );
return( dicts );
}
-static const char *getsid(int sid,char **strings,int scnt) {
+static const char *getsid(int sid,char **strings,int scnt,struct ttfinfo *info) {
if ( sid==-1 )
return( NULL );
else if ( sid<nStdStrings )
return( cffnames[sid] );
else if ( sid-nStdStrings>scnt ) {
LogError( _("Bad sid %d (must be less than %d)\n"), sid, scnt+nStdStrings );
+ if ( info!=NULL ) info->bad_cff = true;
return( NULL );
} else
return( strings[sid-nStdStrings]);
@@ -2752,14 +3333,16 @@ return; /* Use cids instead */
++first;
}
}
- } else
+ } else {
LogError( _("Unexpected encoding format in cff: %d\n"), format );
+ if ( info!=NULL ) info->bad_cff = true;
+ }
if ( format&0x80 ) {
cnt = getc(ttf);
for ( i=0; i<cnt; ++i ) {
dupenc = getc(ttf);
sid = getushort(ttf);
- name = getsid(sid,strings,scnt);
+ name = getsid(sid,strings,scnt,info);
if ( name==NULL ) /* Table is erroneous */
break;
for ( j=0; j<info->glyph_cnt; ++j )
@@ -2773,7 +3356,7 @@ return; /* Use cids instead */
info->map = map;
}
-static void readcffset(FILE *ttf,struct topdicts *dict) {
+static void readcffset(FILE *ttf,struct topdicts *dict,struct ttfinfo *info) {
int len = dict->glyphs.cnt;
int i;
int format, cnt, j, first;
@@ -2874,13 +3457,15 @@ static void readcffset(FILE *ttf,struct topdicts *dict) {
for ( j=0; j<cnt; ++j )
dict->charset[i++] = ++first;
}
- } else
+ } else {
LogError( _("Unexpected charset format in cff: %d\n"), format );
+ if ( info!=NULL ) info->bad_cff = true;
+ }
}
while ( i<len ) dict->charset[i++] = 0;
}
-static uint8 *readfdselect(FILE *ttf,int numglyphs) {
+static uint8 *readfdselect(FILE *ttf,int numglyphs,struct ttfinfo *info) {
uint8 *fdselect = gcalloc(numglyphs,sizeof(uint8));
int i, j, format, nr, first, end, fd;
@@ -2895,15 +3480,17 @@ static uint8 *readfdselect(FILE *ttf,int numglyphs) {
fd = getc(ttf);
end = getushort(ttf);
for ( j=first; j<end; ++j ) {
- if ( j>=numglyphs )
+ if ( j>=numglyphs ) {
LogError( _("Bad fdselect\n") );
- else
+ if ( info!=NULL ) info->bad_cff = true;
+ } else
fdselect[j] = fd;
}
first = end;
}
} else {
LogError( _("Didn't understand format for fdselect %d\n"), format );
+ if ( info!=NULL ) info->bad_cff = true;
}
return( fdselect );
}
@@ -2926,13 +3513,15 @@ return( NULL );
return( ret );
}
-static char *realarray2str(real *array, int size) {
+static char *realarray2str(real *array, int size, int must_be_even) {
int i,j;
char *pt, *ret;
for ( i=size-1; i>=0 && array[i]==0; --i );
if ( i==-1 )
return( NULL );
+ if ( must_be_even && !(i&1) && array[i]<0 )
+ ++i; /* Someone gave us a bluevalues of [-20 0] and we reported [-20] */
ret = pt = galloc((i+1)*20+12);
*pt++ = '[';
for ( j=0; j<=i; ++j ) {
@@ -2966,9 +3555,9 @@ return;
privateadd(private,key,copy(buf));
}
-static void privateaddreal(struct psdict *private,char *key,double val) {
+static void privateaddreal(struct psdict *private,char *key,double val,double def) {
char buf[10];
- if ( val==0 )
+ if ( val==def )
return;
sprintf( buf,"%g", val );
privateadd(private,key,copy(buf));
@@ -2979,37 +3568,37 @@ static void cffprivatefillup(struct psdict *private, struct topdicts *dict) {
private->keys = galloc(14*sizeof(char *));
private->values = galloc(14*sizeof(char *));
privateadd(private,"BlueValues",
- realarray2str(dict->bluevalues,sizeof(dict->bluevalues)/sizeof(dict->bluevalues[0])));
+ realarray2str(dict->bluevalues,sizeof(dict->bluevalues)/sizeof(dict->bluevalues[0]),true));
privateadd(private,"OtherBlues",
- realarray2str(dict->otherblues,sizeof(dict->otherblues)/sizeof(dict->otherblues[0])));
+ realarray2str(dict->otherblues,sizeof(dict->otherblues)/sizeof(dict->otherblues[0]),true));
privateadd(private,"FamilyBlues",
- realarray2str(dict->familyblues,sizeof(dict->familyblues)/sizeof(dict->familyblues[0])));
+ realarray2str(dict->familyblues,sizeof(dict->familyblues)/sizeof(dict->familyblues[0]),true));
privateadd(private,"FamilyOtherBlues",
- realarray2str(dict->familyotherblues,sizeof(dict->familyotherblues)/sizeof(dict->familyotherblues[0])));
- privateaddreal(private,"BlueScale",dict->bluescale);
- privateaddreal(private,"BlueShift",dict->blueshift);
- privateaddreal(private,"BlueFuzz",dict->bluefuzz);
+ realarray2str(dict->familyotherblues,sizeof(dict->familyotherblues)/sizeof(dict->familyotherblues[0]),true));
+ privateaddreal(private,"BlueScale",dict->bluescale,0.039625);
+ privateaddreal(private,"BlueShift",dict->blueshift,7);
+ privateaddreal(private,"BlueFuzz",dict->bluefuzz,1);
privateaddintarray(private,"StdHW",dict->stdhw);
privateaddintarray(private,"StdVW",dict->stdvw);
- privateadd(private,"SnapStemH",
- realarray2str(dict->stemsnaph,sizeof(dict->stemsnaph)/sizeof(dict->stemsnaph[0])));
- privateadd(private,"SnapStemV",
- realarray2str(dict->stemsnapv,sizeof(dict->stemsnapv)/sizeof(dict->stemsnapv[0])));
+ privateadd(private,"StemSnapH",
+ realarray2str(dict->stemsnaph,sizeof(dict->stemsnaph)/sizeof(dict->stemsnaph[0]),false));
+ privateadd(private,"StemSnapV",
+ realarray2str(dict->stemsnapv,sizeof(dict->stemsnapv)/sizeof(dict->stemsnapv[0]),false));
if ( dict->forcebold )
privateadd(private,"ForceBold",copy("true"));
if ( dict->forceboldthreshold!=0 )
- privateaddreal(private,"ForceBoldThreshold",dict->forceboldthreshold);
+ privateaddreal(private,"ForceBoldThreshold",dict->forceboldthreshold,0);
privateaddint(private,"LanguageGroup",dict->languagegroup);
- privateaddreal(private,"ExpansionFactor",dict->expansionfactor);
+ privateaddreal(private,"ExpansionFactor",dict->expansionfactor,0.06);
}
static SplineFont *cffsffillup(struct topdicts *subdict, char **strings,
- int scnt) {
+ int scnt, struct ttfinfo *info) {
SplineFont *sf = SplineFontEmpty();
int emsize;
static int nameless;
- sf->fontname = utf8_verify_copy(getsid(subdict->sid_fontname,strings,scnt));
+ sf->fontname = utf8_verify_copy(getsid(subdict->sid_fontname,strings,scnt,info));
if ( sf->fontname==NULL ) {
char buffer[40];
sprintf(buffer,"UntitledSubFont_%d", ++nameless );
@@ -3023,13 +3612,13 @@ static SplineFont *cffsffillup(struct topdicts *subdict, char **strings,
sf->ascent = .8*emsize;
sf->descent = emsize - sf->ascent;
if ( subdict->copyright!=-1 )
- sf->copyright = utf8_verify_copy(getsid(subdict->copyright,strings,scnt));
+ sf->copyright = utf8_verify_copy(getsid(subdict->copyright,strings,scnt,info));
else
- sf->copyright = utf8_verify_copy(getsid(subdict->notice,strings,scnt));
- sf->familyname = utf8_verify_copy(getsid(subdict->familyname,strings,scnt));
- sf->fullname = utf8_verify_copy(getsid(subdict->fullname,strings,scnt));
- sf->weight = utf8_verify_copy(getsid(subdict->weight,strings,scnt));
- sf->version = utf8_verify_copy(getsid(subdict->version,strings,scnt));
+ sf->copyright = utf8_verify_copy(getsid(subdict->notice,strings,scnt,info));
+ sf->familyname = utf8_verify_copy(getsid(subdict->familyname,strings,scnt,info));
+ sf->fullname = utf8_verify_copy(getsid(subdict->fullname,strings,scnt,info));
+ sf->weight = utf8_verify_copy(getsid(subdict->weight,strings,scnt,info));
+ sf->version = utf8_verify_copy(getsid(subdict->version,strings,scnt,info));
sf->italicangle = subdict->italicangle;
sf->upos = subdict->underlinepos;
sf->uwidth = subdict->underlinewidth;
@@ -3064,24 +3653,24 @@ static void cffinfofillup(struct ttfinfo *info, struct topdicts *dict,
if ( dict->copyright!=-1 || dict->notice!=-1 )
free( info->copyright );
if ( dict->copyright!=-1 )
- info->copyright = utf8_verify_copy(getsid(dict->copyright,strings,scnt));
+ info->copyright = utf8_verify_copy(getsid(dict->copyright,strings,scnt,info));
else if ( dict->notice!=-1 )
- info->copyright = utf8_verify_copy(getsid(dict->notice,strings,scnt));
+ info->copyright = utf8_verify_copy(getsid(dict->notice,strings,scnt,info));
if ( dict->familyname!=-1 ) {
free(info->familyname);
- info->familyname = utf8_verify_copy(getsid(dict->familyname,strings,scnt));
+ info->familyname = utf8_verify_copy(getsid(dict->familyname,strings,scnt,info));
}
if ( dict->fullname!=-1 ) {
free(info->fullname);
- info->fullname = utf8_verify_copy(getsid(dict->fullname,strings,scnt));
+ info->fullname = utf8_verify_copy(getsid(dict->fullname,strings,scnt,info));
}
if ( dict->weight!=-1 ) {
free(info->weight);
- info->weight = utf8_verify_copy(getsid(dict->weight,strings,scnt));
+ info->weight = utf8_verify_copy(getsid(dict->weight,strings,scnt,info));
}
if ( dict->version!=-1 ) {
free(info->version);
- info->version = utf8_verify_copy(getsid(dict->version,strings,scnt));
+ info->version = utf8_verify_copy(getsid(dict->version,strings,scnt,info));
}
if ( dict->fontname!=NULL ) {
free(info->fontname);
@@ -3100,8 +3689,8 @@ static void cffinfofillup(struct ttfinfo *info, struct topdicts *dict,
cffprivatefillup(info->private,dict);
}
if ( dict->ros_registry!=-1 ) {
- info->cidregistry = copy(getsid(dict->ros_registry,strings,scnt));
- info->ordering = copy(getsid(dict->ros_ordering,strings,scnt));
+ info->cidregistry = copy(getsid(dict->ros_registry,strings,scnt,info));
+ info->ordering = copy(getsid(dict->ros_ordering,strings,scnt,info));
info->supplement = dict->ros_supplement;
info->cidfontversion = dict->cidfontversion;
}
@@ -3112,9 +3701,6 @@ static void cfffigure(struct ttfinfo *info, struct topdicts *dict,
int i, cstype;
struct pschars *subrs;
struct pscontext pscontext;
-#ifdef LUA_FF_LIB
- DBounds bb;
-#endif
memset(&pscontext,0,sizeof(pscontext));
cffinfofillup(info, dict, strings, scnt );
@@ -3136,17 +3722,10 @@ static void cfffigure(struct ttfinfo *info, struct topdicts *dict,
info->chars = gcalloc(info->glyph_cnt,sizeof(SplineChar *));
for ( i=0; i<info->glyph_cnt; ++i ) {
- info->chars[i] = PSCharStringToSplines(
+ info->chars[i] = PSCharStringToSplines(
dict->glyphs.values[i], dict->glyphs.lens[i],&pscontext,
- subrs,gsubrs,getsid(dict->charset[i],strings,scnt));
-#ifdef LUA_FF_LIB
- SplineCharFindBounds(info->chars[i],&bb);
- info->chars[i]->xmin = bb.minx;
- info->chars[i]->ymin = bb.miny;
- info->chars[i]->xmax = bb.maxx;
- info->chars[i]->ymax = bb.maxy;
-#endif
- info->chars[i]->vwidth = info->emsize;
+ subrs,gsubrs,getsid(dict->charset[i],strings,scnt,info));
+ info->chars[i]->vwidth = info->emsize;
if ( cstype==2 ) {
if ( info->chars[i]->width == (int16) 0x8000 )
info->chars[i]->width = dict->defaultwidthx;
@@ -3168,9 +3747,6 @@ static void cidfigure(struct ttfinfo *info, struct topdicts *dict,
struct cidmap *map;
char buffer[100];
struct pscontext pscontext;
-#ifdef LUA_FF_LIB
- DBounds bb;
-#endif
EncMap *encmap = NULL;
memset(&pscontext,0,sizeof(pscontext));
@@ -3184,7 +3760,7 @@ static void cidfigure(struct ttfinfo *info, struct topdicts *dict,
info->subfontcnt = j;
info->subfonts = gcalloc(j+1,sizeof(SplineFont *));
for ( j=0; subdicts[j]!=NULL; ++j ) {
- info->subfonts[j] = cffsffillup(subdicts[j],strings,scnt);
+ info->subfonts[j] = cffsffillup(subdicts[j],strings,scnt,info);
info->subfonts[j]->map = encmap;
}
for ( i=0; i<info->glyph_cnt; ++i ) {
@@ -3232,15 +3808,6 @@ static void cidfigure(struct ttfinfo *info, struct topdicts *dict,
info->chars[i] = PSCharStringToSplines(
dict->glyphs.values[i], dict->glyphs.lens[i],&pscontext,
subrs,gsubrs,buffer);
-
-#ifdef LUA_FF_LIB
- SplineCharFindBounds(info->chars[i],&bb);
- info->chars[i]->xmin = bb.minx;
- info->chars[i]->ymin = bb.miny;
- info->chars[i]->xmax = bb.maxx;
- info->chars[i]->ymax = bb.maxy;
-#endif
-
info->chars[i]->vwidth = sf->ascent+sf->descent;
info->chars[i]->unicodeenc = uni;
sf->glyphs[cid] = info->chars[i];
@@ -3248,15 +3815,16 @@ static void cidfigure(struct ttfinfo *info, struct topdicts *dict,
sf->glyphs[cid]->orig_pos = cid; /* Bug! should be i, but I assume sf->chars[orig_pos]->orig_pos==orig_pos */
if ( sf->glyphs[cid]->layers[ly_fore].refs!=NULL )
IError( "Reference found in CID font. Can't fix it up");
+
+ THPatchSplineChar(sf->glyphs[cid]);
+
if ( cstype==2 ) {
if ( sf->glyphs[cid]->width == (int16) 0x8000 )
sf->glyphs[cid]->width = subdicts[j]->defaultwidthx;
else
sf->glyphs[cid]->width += subdicts[j]->nominalwidthx;
}
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
/* No need to do a reference fixup here-- the chars aren't associated */
/* with any encoding as is required for seac */
@@ -3275,6 +3843,7 @@ static int readcffglyphs(FILE *ttf,struct ttfinfo *info) {
fseek(ttf,info->cff_start,SEEK_SET);
if ( getc(ttf)!='\1' ) { /* Major version */
LogError( _("CFF version mismatch\n" ));
+ info->bad_cff = true;
return( 0 );
}
getc(ttf); /* Minor version */
@@ -3282,7 +3851,7 @@ return( 0 );
offsize = getc(ttf);
if ( hdrsize!=4 )
fseek(ttf,info->cff_start+hdrsize,SEEK_SET);
- fontnames = readcfffontnames(ttf,NULL);
+ fontnames = readcfffontnames(ttf,NULL,info);
which = 0;
if ( fontnames[1]!=NULL ) { /* More than one? Can that even happen in OpenType? */
which = PickCFFFont(fontnames);
@@ -3293,31 +3862,31 @@ return( 0 );
return( 0 );
}
}
- dicts = readcfftopdicts(ttf,fontnames,info->cff_start);
+ dicts = readcfftopdicts(ttf,fontnames,info->cff_start,info, NULL);
/* String index is just the same as fontname index */
- strings = readcfffontnames(ttf,&scnt);
- readcffsubrs(ttf,&gsubs );
+ strings = readcfffontnames(ttf,&scnt,info);
+ readcffsubrs(ttf,&gsubs,info );
/* Can be many fonts here. Only decompose the one */
if ( dicts[which]->charstringsoff!=-1 ) {
fseek(ttf,info->cff_start+dicts[which]->charstringsoff,SEEK_SET);
- readcffsubrs(ttf,&dicts[which]->glyphs);
+ readcffsubrs(ttf,&dicts[which]->glyphs,info);
}
if ( dicts[which]->private_offset!=-1 )
- readcffprivate(ttf,dicts[which]);
+ readcffprivate(ttf,dicts[which],info);
if ( dicts[which]->charsetoff!=-1 )
- readcffset(ttf,dicts[which]);
+ readcffset(ttf,dicts[which],info);
if ( dicts[which]->fdarrayoff==-1 )
cfffigure(info,dicts[which],strings,scnt,&gsubs);
else {
fseek(ttf,info->cff_start+dicts[which]->fdarrayoff,SEEK_SET);
- subdicts = readcfftopdicts(ttf,NULL,info->cff_start);
+ subdicts = readcfftopdicts(ttf,NULL,info->cff_start,info,dicts[which]);
fseek(ttf,info->cff_start+dicts[which]->fdselectoff,SEEK_SET);
- fdselect = readfdselect(ttf,dicts[which]->glyphs.cnt);
+ fdselect = readfdselect(ttf,dicts[which]->glyphs.cnt,info);
for ( j=0; subdicts[j]!=NULL; ++j ) {
if ( subdicts[j]->private_offset!=-1 )
- readcffprivate(ttf,subdicts[j]);
+ readcffprivate(ttf,subdicts[j],info);
if ( subdicts[j]->charsetoff!=-1 )
- readcffset(ttf,subdicts[j]);
+ readcffset(ttf,subdicts[j],info);
}
cidfigure(info,dicts[which],strings,scnt,&gsubs,subdicts,fdselect);
for ( j=0; subdicts[j]!=NULL; ++j )
@@ -3359,10 +3928,26 @@ static int readtyp1glyphs(FILE *ttf,struct ttfinfo *info) {
FontDict *fd;
FILE *tmp;
int i;
+ SplineChar *sc;
fseek(ttf,info->typ1_start,SEEK_SET);
+/* There appear to be about 20 bytes of garbage (well, I don't know what they */
+/* mean, so they are garbage to me) before the start of the PostScript. But */
+/* it's not exactly 20. I've seen 22 and 24. So see if we can find "%!PS-Adobe" */
+/* in the first few bytes of the file, and skip to there if found */
+ { char buffer[41];
+ fread(buffer,1,sizeof(buffer),ttf);
+ buffer[40] = '\0';
+ for ( i=39; i>=0; --i )
+ if ( buffer[i]=='%' && buffer[i+1]=='!' )
+ break;
+ if ( i<0 )
+ i = 0;
+ fseek(ttf,info->typ1_start+i,SEEK_SET);
+ }
+
tmp = tmpfile();
- for ( i=0; i<info->typ1_length; ++i )
+ for ( i=0; i<(int)info->typ1_length; ++i )
putc(getc(ttf),tmp);
rewind(tmp);
fd = _ReadPSFont(tmp);
@@ -3370,13 +3955,26 @@ static int readtyp1glyphs(FILE *ttf,struct ttfinfo *info) {
if ( fd!=NULL ) {
SplineFont *sf = SplineFontFromPSFont(fd);
PSFontFree(fd);
- info->chars = sf->glyphs;
- info->glyph_cnt = sf->glyphcnt;
info->emsize = (sf->ascent+sf->descent);
info->ascent = sf->ascent;
info->descent = sf->descent;
- sf->glyphs = NULL;
- sf->glyphcnt = 0;
+ if ( sf->subfontcnt!=0 ) {
+ info->subfontcnt = sf->subfontcnt;
+ info->subfonts = sf->subfonts;
+ info->cidregistry = copy(sf->cidregistry);
+ info->ordering = copy(sf->ordering);
+ info->supplement = sf->supplement;
+ info->cidfontversion = sf->cidversion;
+ sf->subfonts = NULL;
+ sf->subfontcnt = 0;
+ } else {
+ info->chars = sf->glyphs;
+ info->glyph_cnt = sf->glyphcnt;
+ for ( i=sf->glyphcnt-1; i>=0; --i ) if ( (sc=sf->glyphs[i])!=NULL )
+ sc->parent = NULL;
+ sf->glyphs = NULL;
+ sf->glyphcnt = 0;
+ }
SplineFontFree(sf);
return( true );
}
@@ -3385,15 +3983,22 @@ return( false );
static void readttfwidths(FILE *ttf,struct ttfinfo *info) {
int i,j;
- int lastwidth = info->emsize;
+ int lastwidth = info->emsize, lsb;
/* I'm not interested in the lsb, I'm not sure what it means if it differs*/
/* from that is specified in the outline. Do we move the outline? */
+ /* Ah... I am interested in it if bit 1 of 'head'.flags is set, then we */
+ /* do move the outline */
int check_width_consistency = info->cff_start!=0 && info->glyph_start==0;
SplineChar *sc;
+ real trans[6];
+
+ memset(trans,0,sizeof(trans));
+ trans[0] = trans[3] = 1;
fseek(ttf,info->hmetrics_start,SEEK_SET);
for ( i=0; i<info->width_cnt && i<info->glyph_cnt; ++i ) {
lastwidth = getushort(ttf);
+ lsb = (short) getushort(ttf);
if ( (sc = info->chars[i])!=NULL ) { /* can happen in ttc files */
if ( check_width_consistency && sc->width!=lastwidth ) {
if ( info->fontname!=NULL && sc->name!=NULL )
@@ -3402,20 +4007,35 @@ static void readttfwidths(FILE *ttf,struct ttfinfo *info) {
else
LogError("In GID %d, 'CFF ' advance width (%d) and 'hmtx' width (%d) do not match.\n (Subsequent mismatches will not be reported)\n",
i, sc->width, lastwidth );
+ info->bad_metrics = true;
check_width_consistency = false;
}
sc->width = lastwidth;
sc->widthset = true;
+ if ( info->apply_lsb ) {
+ if ( sc->lsidebearing!=lsb ) {
+ trans[4] = lsb-sc->lsidebearing;
+ SplinePointListTransform(sc->layers[ly_fore].splines,trans,true);
+ }
+ }
}
- /* lsb = */ getushort(ttf);
}
- if ( i==0 )
+ if ( i==0 ) {
LogError( _("Invalid ttf hmtx table (or hhea), numOfLongMetrics is 0\n") );
+ info->bad_metrics = true;
+ }
for ( j=i; j<info->glyph_cnt; ++j ) {
- if ( info->chars[j]!=NULL ) { /* In a ttc file we may skip some */
- info->chars[j]->width = lastwidth;
- info->chars[j]->widthset = true;
+ if ( (sc = info->chars[j])!=NULL ) { /* In a ttc file we may skip some */
+ sc->width = lastwidth;
+ sc->widthset = true;
+ if ( info->apply_lsb ) {
+ lsb = (short) getushort(ttf);
+ if ( sc->lsidebearing!=lsb ) {
+ trans[4] = lsb-sc->lsidebearing;
+ SplinePointListTransform(sc->layers[ly_fore].splines,trans,true);
+ }
+ }
}
}
}
@@ -3424,7 +4044,7 @@ static void dummywidthsfromstrike(FILE *ttf,struct ttfinfo *info) {
BDFFont *bdf;
int i, cnt;
double scaled_sum;
-
+ (void)ttf; /* -Wall */
if ( info->bitmaps==NULL )
return;
#if 0
@@ -3452,8 +4072,8 @@ return;
static void readttfvwidths(FILE *ttf,struct ttfinfo *info) {
int i,j;
- int lastvwidth = info->emsize, vwidth_cnt, tsb, cnt=0;
- int32 voff=0;
+ int lastvwidth = info->emsize, vwidth_cnt, tsb/*, cnt=0*/;
+ /* int32 voff=0; */
fseek(ttf,info->vhea_start+4+4,SEEK_SET); /* skip over the version number & typo right/left */
info->pfminfo.vlinegap = getushort(ttf);
@@ -3469,45 +4089,46 @@ static void readttfvwidths(FILE *ttf,struct ttfinfo *info) {
tsb = getushort(ttf);
if ( info->chars[i]!=NULL ) { /* can happen in ttc files */
info->chars[i]->vwidth = lastvwidth;
+#if 0 /* this used to mean something once */
+ /* At one point I stored the ymax of loading the glyph in lsidebearing*/
+ /* I've removed that as it now seems pointless */
if ( info->cff_start==0 ) {
voff += tsb + info->chars[i]->lsidebearing /* actually maxy */;
++cnt;
}
+#endif
}
}
- if ( i==0 )
+ if ( i==0 ) {
LogError( _("Invalid ttf vmtx table (or vhea), numOfLongVerMetrics is 0\n") );
-
+ info->bad_metrics = true;
+ }
+
for ( j=i; j<info->glyph_cnt; ++j ) {
if ( info->chars[j]!=NULL ) /* In a ttc file we may skip some */
info->chars[j]->vwidth = lastvwidth;
}
- /* for truetype fonts the vertical offset is found by adding the ymax of a */
- /* character to the top side bearing. I set the font wide value to the */
- /* average of them all */
- /* But opentype doesn't give us the ymax easily, and rather than compute */
- /* the bounding box I'll just punt and pick a reasonable value */
- /* Of course I hope it will be over riden by the VORG table */
- if ( cnt!=0 )
- info->vertical_origin = (voff+cnt/2)/cnt;
- if ( info->vertical_origin==0 )
- info->vertical_origin = info->ascent;
- if ( info->vorg_start!=0 ) {
- fseek(ttf,info->vorg_start+4,SEEK_SET);
- info->vertical_origin = (short) getushort(ttf);
- }
}
static int modenc(int enc,int modtype) {
+ (void)modtype; /* for -Wall */
return( enc );
}
-static int umodenc(int enc,int modtype) {
+static int badencoding(struct ttfinfo *info) {
+ if ( !info->bad_cmap ) {
+ LogError("Bad encoding information in 'cmap' table.");
+ info->bad_cmap = true;
+ }
+return( -1 );
+}
+
+static int umodenc(int enc,int modtype, struct ttfinfo *info) {
if ( modtype==-1 )
return( -1 );
if ( modtype<=1 /* Unicode */ ) {
- /* No conversion */;
+ /* No conversion needed, already unicode */;
} else if ( modtype==2 /* SJIS */ ) {
if ( enc<=127 ) {
/* Latin */
@@ -3515,6 +4136,9 @@ return( -1 );
} else if ( enc>=161 && enc<=223 ) {
/* Katakana */
enc = unicode_from_jis201[enc];
+ } else if ( enc<255 ) {
+ /* This is erroneous as I understand SJIS */
+ enc = badencoding(info);
} else {
int ch1 = enc>>8, ch2 = enc&0xff;
if ( ch1 >= 129 && ch1<= 159 )
@@ -3531,7 +4155,10 @@ return( -1 );
--ch1;
ch2 -= 31;
}
- enc = unicode_from_jis208[(ch1-0x21)*94+(ch2-0x21)];
+ if ( ch1<0x21 || ch2<0x21 || ch1>0x7f || ch2>0x7f )
+ enc = badencoding(info);
+ else
+ enc = unicode_from_jis208[(ch1-0x21)*94+(ch2-0x21)];
}
} else if ( modtype==3 /* GB2312 offset by 0x8080, parse just like wansung */ ) {
if ( enc>0xa1a1 ) {
@@ -3540,12 +4167,12 @@ return( -1 );
enc = unicode_from_gb2312[enc];
if ( enc==0 ) enc = -1;
} else if ( enc>0x100 )
- enc = -1;
+ enc = badencoding(info);
} else if ( modtype==4 /* BIG5 */ ) { /* old ms docs say big5 is modtype==3, but new ones say 4 */
if ( enc>0x8100 )
enc = unicode_from_big5hkscs[enc-0x8100];
else if ( enc>0x100 )
- enc = -1;
+ enc = badencoding(info);
} else if ( modtype==5 /* Wansung == KSC 5601-1987, I hope */ ) {
if ( enc>0xa1a1 ) {
enc -= 0xa1a1;
@@ -3553,12 +4180,12 @@ return( -1 );
enc = unicode_from_ksc5601[enc];
if ( enc==0 ) enc = -1;
} else if ( enc>0x100 )
- enc = -1;
+ enc = badencoding(info);
} else if ( modtype==6 /* Johab */ ) {
if ( enc>0x8400 )
enc = unicode_from_johab[enc-0x8400];
else if ( enc>0x100 )
- enc = -1;
+ enc = badencoding(info);
}
if ( enc==0 )
enc = -1;
@@ -3574,7 +4201,7 @@ struct cmap_encs {
Encoding *enc;
};
-static int SubtableIsntSupported(FILE *ttf,uint32 offset,struct cmap_encs *cmap_enc) {
+static int SubtableIsntSupported(FILE *ttf,uint32 offset,struct cmap_encs *cmap_enc, struct ttfinfo *info) {
uint32 here = ftell(ttf);
int format, len, ret=false;
@@ -3584,6 +4211,7 @@ static int SubtableIsntSupported(FILE *ttf,uint32 offset,struct cmap_encs *cmap_
if ( format<0 || (format&1) || format>12 ) {
LogError( _("Encoding subtable for platform=%d, specific=%d has an unsupported format %d.\n"),
cmap_enc->platform, cmap_enc->specific, format );
+ info->bad_cmap = true;
ret = true;
}
@@ -3598,12 +4226,121 @@ static int SubtableIsntSupported(FILE *ttf,uint32 offset,struct cmap_encs *cmap_
if ( len==0 ) {
LogError( _("Encoding subtable for platform=%d, specific=%d has a 0 length subtable.\n"),
cmap_enc->platform, cmap_enc->specific );
+ info->bad_cmap = true;
ret = true;
}
fseek(ttf,here,SEEK_SET);
return( ret );
}
+static int SubtableMustBe14(FILE *ttf,uint32 offset,struct ttfinfo *info) {
+ uint32 here = ftell(ttf);
+ int format, ret=true;
+
+ fseek(ttf,offset,SEEK_SET);
+
+ format = getushort(ttf);
+ if ( format!=14 ) {
+ LogError( _("Encoding subtable for platform=%d, specific=%d (which must be 14)\nhas an unsupported format %d.\n"),
+ 0, 5, format );
+ info->bad_cmap = true;
+ ret = false;
+ }
+ fseek(ttf,here,SEEK_SET);
+return( ret );
+}
+
+static void ApplyVariationSequenceSubtable(FILE *ttf,uint32 vs_map,
+ struct ttfinfo *info,int justinuse) {
+ int sub_table_len, vs_cnt, i, j, rcnt, gid;
+ struct vs_data { int vs; uint32 def, non_def; } *vs_data;
+ SplineChar *sc;
+
+ fseek(ttf,vs_map,SEEK_SET);
+ /* We/ve already checked the format is 14 */ getushort(ttf);
+ sub_table_len = getlong(ttf);
+ vs_cnt = getlong(ttf);
+ vs_data = galloc(vs_cnt*sizeof(struct vs_data));
+ for ( i=0; i<vs_cnt; ++i ) {
+ vs_data[i].vs = get3byte(ttf);
+ vs_data[i].def = getlong(ttf);
+ vs_data[i].non_def = getlong(ttf);
+ }
+
+ for ( i=0; i<vs_cnt; ++i ) {
+ if ( vs_data[i].def!=0 && justinuse==git_normal ) {
+ fseek(ttf,vs_map+vs_data[i].def,SEEK_SET);
+ rcnt = getlong(ttf);
+ for ( j=0; j<rcnt; ++j ) {
+ int start_uni = get3byte(ttf);
+ int cnt = getc(ttf);
+ int uni;
+ for ( uni=start_uni; uni<=start_uni+cnt; ++uni ) {
+ SplineChar *sc=NULL;
+ struct altuni *altuni;
+ for ( gid = 0; gid<info->glyph_cnt; ++gid ) {
+ if ( (sc = info->chars[gid])!=NULL ) {
+ if ( sc->unicodeenc==uni )
+ break;
+ for ( altuni = sc->altuni; altuni!=NULL; altuni=altuni->next )
+ if ( altuni->unienc==uni && altuni->vs == -1 && altuni->fid==0 )
+ break;
+ if ( altuni!=NULL )
+ break;
+ }
+ }
+ if ( gid==info->glyph_cnt ) {
+ LogError( _("No glyph with unicode U+%05x in font\n"),
+ uni );
+ info->bad_cmap = true;
+ } else {
+ altuni = chunkalloc(sizeof(struct altuni));
+ altuni->unienc = uni;
+ altuni->vs = vs_data[i].vs;
+ altuni->fid = 0;
+ altuni->next = sc->altuni;
+ sc->altuni = altuni;
+ }
+ }
+ }
+ }
+ if ( vs_data[i].non_def!=0 ) {
+ fseek(ttf,vs_map+vs_data[i].non_def,SEEK_SET);
+ rcnt = getlong(ttf);
+ for ( j=0; j<rcnt; ++j ) {
+ int uni = get3byte(ttf);
+ int curgid = getushort(ttf);
+ if ( justinuse==git_justinuse ) {
+ if ( curgid<info->glyph_cnt && curgid>=0)
+ info->inuse[curgid] = 1;
+ } else if ( justinuse==git_justinuse ) {
+ if ( curgid<info->glyph_cnt && curgid>=0 &&
+ (sc=info->chars[curgid])!=NULL && sc->name==NULL ) {
+ char buffer[32];
+ sprintf(buffer, "u%04X.vs%04X", uni, vs_data[i].vs );
+ sc->name = copy(buffer);
+ }
+ } else {
+ if ( curgid>=info->glyph_cnt || curgid<0 ||
+ info->chars[curgid]==NULL ) {
+ LogError( _("GID out of range (%d) in format 14 'cmap' subtable\n"),
+ curgid );
+ info->bad_cmap = true;
+ } else {
+ SplineChar *sc = info->chars[curgid];
+ struct altuni *altuni = chunkalloc(sizeof(struct altuni));
+ altuni->unienc = uni;
+ altuni->vs = vs_data[i].vs;
+ altuni->fid = 0;
+ altuni->next = sc->altuni;
+ sc->altuni = altuni;
+ }
+ }
+ }
+ }
+ }
+}
+
static enum uni_interp amscheck(struct ttfinfo *info, EncMap *map) {
int cnt = 0;
/* Try to guess if the font uses the AMS math PUA assignments */
@@ -3676,7 +4413,7 @@ static int PickCMap(struct cmap_encs *cmap_encs,int enccnt,int def) {
sprintf(buffer,"%d (%s) %d %s %s %s",
cmap_encs[i].platform,
- cmap_encs[i].platform==0 ? _("Apple Unicode") :
+ cmap_encs[i].platform==0 ? _("Unicode") :
cmap_encs[i].platform==1 ? _("Apple") :
cmap_encs[i].platform==2 ? _("ISO (Deprecated)") :
cmap_encs[i].platform==3 ? _("MicroSoft") :
@@ -3696,12 +4433,8 @@ static int PickCMap(struct cmap_encs *cmap_encs,int enccnt,int def) {
"Unknown format" );
choices[i] = copy(buffer);
}
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- ret = gwwv_choose(_("Pick a CMap subtable"),(const char **) choices,enccnt,def,
+ ret = ff_choose(_("Pick a CMap subtable"),(const char **) choices,enccnt,def,
_("Pick a CMap subtable"));
-#else
- ret = -1;
-#endif
for ( i=0; i<enccnt; ++i )
free(choices[i]);
free(choices);
@@ -3718,6 +4451,7 @@ static void readttfencodings(FILE *ttf,struct ttfinfo *info, int justinuse) {
int platform, specific;
int offset, encoff=0;
int format, len;
+ uint32 vs_map=0;
uint16 table[256];
int segCount;
uint16 *endchars, *startchars, *delta, *rangeOffset, *glyphs;
@@ -3736,18 +4470,26 @@ static void readttfencodings(FILE *ttf,struct ttfinfo *info, int justinuse) {
version = getushort(ttf);
nencs = getushort(ttf);
if ( version!=0 && nencs==0 )
- nencs = version; /* Sometimes they are backwards */
+ nencs = version; /* Sometimes they are backwards */ /* Or was I just confused early on? */
cmap_encs = galloc(nencs*sizeof(struct cmap_encs));
for ( i=usable_encs=0; i<nencs; ++i ) {
cmap_encs[usable_encs].platform = getushort(ttf);
cmap_encs[usable_encs].specific = getushort(ttf);
cmap_encs[usable_encs].offset = getlong(ttf);
+ if ( cmap_encs[usable_encs].platform == 0 && cmap_encs[usable_encs].specific == 5 ) {
+ /* This isn't a true encoding. */
+ /* It's an optional set of encoding modifications (sort of) */
+ /* applied to a format 4/10 encoding (unicode BMP/Full) */
+ if ( SubtableMustBe14(ttf,info->encoding_start+cmap_encs[usable_encs].offset,info) )
+ vs_map = info->encoding_start+cmap_encs[usable_encs].offset;
+ continue;
+ }
temp = enc_from_platspec(cmap_encs[usable_encs].platform,cmap_encs[usable_encs].specific);
if ( temp==NULL ) /* iconv doesn't support this. Some sun iconvs seem limited */
temp = FindOrMakeEncoding("Custom");
cmap_encs[usable_encs].enc = temp;
if ( SubtableIsntSupported(ttf,info->encoding_start+cmap_encs[usable_encs].offset,
- &cmap_encs[usable_encs]))
+ &cmap_encs[usable_encs],info))
continue;
++usable_encs;
}
@@ -3808,8 +4550,15 @@ return;
unicode_cmap = i;
}
- if ( justinuse || !ask_user_for_cmap || (i = PickCMap(cmap_encs,usable_encs,def))==-1 )
+ if ( justinuse==git_justinuse || !ask_user_for_cmap || (i = PickCMap(cmap_encs,usable_encs,def))==-1 )
i = def;
+
+ if ( i==-1 ) {
+ LogError( _("Could not find a usable encoding table" ));
+ free(cmap_encs);
+return;
+ }
+
info->platform = cmap_encs[i].platform;
info->specific = cmap_encs[i].specific;
@@ -3825,14 +4574,14 @@ return;
++dcnt;
}
} else {
- if ( i!=def ) {
+ if ( i!=def && def!=-1 ) {
desired_cmaps[1] = cmap_encs[def];
++dcnt;
}
}
map = NULL;
- if ( justinuse ) {
+ if ( justinuse==git_justinuse ) {
dcmap_cnt = usable_encs;
dcmap = cmap_encs;
} else {
@@ -3849,7 +4598,7 @@ return;
enc = dcmap[dc].enc;
encoff = dcmap[dc].offset;
- if ( dc==0 && !justinuse ) {
+ if ( dc==0 && justinuse==git_normal ) {
interp = interp_from_encoding(enc,ui_none);
mod = 0;
if ( dcmap[dc].platform==3 && (dcmap[dc].specific>=2 && dcmap[dc].specific<=6 ))
@@ -3874,7 +4623,7 @@ return;
enc = FindOrMakeEncoding("UnicodeFull");
if ( format==0 ) {
- if ( !justinuse && map!=NULL && map->enccount<256 ) {
+ if ( justinuse==git_normal && map!=NULL && map->enccount<256 ) {
map->map = grealloc(map->map,256*sizeof(int));
memset(map->map,-1,(256-map->enccount)*sizeof(int));
map->enccount = map->encmax = 256;
@@ -3885,7 +4634,7 @@ return;
if ( trans==NULL && dcmap[dc].platform==1 )
trans = MacEncToUnicode(dcmap[dc].specific,dcmap[dc].lang-1);
for ( i=0; i<256 && i<len-6; ++i )
- if ( !justinuse ) {
+ if ( justinuse==git_normal ) {
if ( table[i]<info->glyph_cnt && info->chars[table[i]]!=NULL ) {
if ( map!=NULL )
map->map[i] = table[i];
@@ -3931,17 +4680,19 @@ return;
/* Done */;
else if ( rangeOffset[i]==0 ) {
for ( j=startchars[i]; j<=endchars[i]; ++j ) {
- if ( justinuse && (uint16) (j+delta[i])<info->glyph_cnt )
+ if ( justinuse==git_justinuse && (uint16) (j+delta[i])<info->glyph_cnt )
info->inuse[(uint16) (j+delta[i])] = true;
- else if ( (uint16) (j+delta[i])>=info->glyph_cnt || info->chars[(uint16) (j+delta[i])]==NULL )
+ else if ( (uint16) (j+delta[i])>=info->glyph_cnt || info->chars[(uint16) (j+delta[i])]==NULL ) {
LogError( _("Attempt to encode missing glyph %d to %d (0x%x)\n"),
(uint16) (j+delta[i]), modenc(j,mod), modenc(j,mod));
- else {
- int uenc = umodenc(j,mod);
+ info->bad_cmap = true;
+ } else {
+ int uenc = umodenc(j,mod,info);
int lenc = modenc(j,mod);
if ( uenc!=-1 && used[uenc] ) {
if ( !badencwarned ) {
LogError( _("Multiple glyphs map to the same unicode encoding U+%04X, only one will be used\n"), uenc );
+ info->bad_cmap = true;
badencwarned = true;
}
} else {
@@ -3962,31 +4713,36 @@ return;
index = glyphs[ temp ];
else {
/* This happened in mingliu.ttc(PMingLiU) */
- if ( !justinuse )
+ if ( justinuse==git_normal ) {
LogError( _("Glyph index out of bounds. Was %d, must be less than %d.\n In attempt to associate a glyph with encoding %x in segment %d\n with platform=%d, specific=%d (in 'cmap')\n"),
temp, glyph_tot, j, i, dcmap[dc].platform, dcmap[dc].specific );
+ info->bad_cmap = true;
+ }
index = 0;
}
if ( index!=0 ) {
index = (unsigned short) (index+delta[i]);
- if ( index>=info->glyph_cnt )
+ if ( index>=info->glyph_cnt ) {
/* This isn't mentioned either, but in some */
/* MS Chinese fonts (kaiu.ttf) the index */
/* goes out of bounds. and MS's ttf dump */
/* program says it is treated as 0 */
LogError( _("Attempt to encode missing glyph %d to %d (0x%x)\n"),
index, modenc(j,mod), modenc(j,mod));
- else if ( justinuse )
+ info->bad_cmap = true;
+ } else if ( justinuse==git_justinuse )
info->inuse[index] = 1;
- else if ( info->chars[index]==NULL )
+ else if ( info->chars[index]==NULL ) {
LogError( _("Attempt to encode missing glyph %d to %d (0x%x)\n"),
index, modenc(j,mod), modenc(j,mod));
- else {
- int uenc = umodenc(j,mod);
+ info->bad_cmap = true;
+ } else {
+ int uenc = umodenc(j,mod,info);
int lenc = modenc(j,mod);
if ( uenc!=-1 && used[uenc] ) {
if ( !badencwarned ) {
LogError( _("Multiple glyphs map to the same unicode encoding U+%04X, only one will be used\n"), uenc );
+ info->bad_cmap = true;
badencwarned = true;
}
} else {
@@ -3999,8 +4755,10 @@ return;
}
}
}
- } else
+ } else {
LogError( _("Use of a range offset of 0xffff to mean a missing glyph in cmap table\n") );
+ info->bad_cmap = true;
+ }
}
free(glyphs);
free(rangeOffset);
@@ -4019,14 +4777,14 @@ return;
trans = enc->unicode;
if ( trans==NULL && dcmap[dc].platform==1 && first+count<=256 )
trans = MacEncToUnicode(dcmap[dc].specific,dcmap[dc].lang-1);
- if ( justinuse )
+ if ( justinuse==git_justinuse )
for ( i=0; i<count; ++i )
info->inuse[getushort(ttf)]= 1;
else {
for ( i=0; i<count; ++i ) {
int gid = getushort(ttf);
if ( dounicode )
- info->chars[gid]->unicodeenc = trans==NULL ? trans[first+1] : first+i;
+ info->chars[gid]->unicodeenc = trans!=NULL ? trans[first+1] : first+i;
if ( map!=NULL && first+i < map->enccount )
map->map[first+i] = gid;
}
@@ -4074,7 +4832,7 @@ return;
index = (uint32) (index+subheads[0].delta);
/* I assume the single byte codes are just ascii or latin1*/
if ( index!=0 && index<info->glyph_cnt ) {
- if ( justinuse )
+ if ( justinuse==git_justinuse )
info->inuse[index] = 1;
else if ( info->chars[index]==NULL )
/* Do Nothing */;
@@ -4097,13 +4855,13 @@ return;
if ( index!=0 && index<info->glyph_cnt ) {
enc = (i<<8)|(j+subheads[k].first);
lenc = modenc(enc,mod);
- if ( justinuse )
+ if ( justinuse==git_justinuse )
info->inuse[index] = 1;
else if ( info->chars[index]==NULL )
/* Do Nothing */;
else {
if ( dounicode && info->chars[index]->unicodeenc==-1 )
- info->chars[index]->unicodeenc = umodenc(enc,mod);
+ info->chars[index]->unicodeenc = umodenc(enc,mod,info);
if ( map!=NULL && lenc<map->enccount )
map->map[lenc] = index;
}
@@ -4125,15 +4883,15 @@ return;
/* anything else */
fseek(ttf,8192,SEEK_CUR);
ngroups = getlong(ttf);
- for ( j=0; j<ngroups; ++j ) {
+ for ( j=0; j<(int)ngroups; ++j ) {
start = getlong(ttf);
end = getlong(ttf);
startglyph = getlong(ttf);
- if ( justinuse )
- for ( i=start; i<=end; ++i )
+ if ( justinuse==git_justinuse )
+ for ( i=start; i<=(int)end; ++i )
info->inuse[startglyph+i-start]= 1;
else
- for ( i=start; i<=end; ++i ) {
+ for ( i=start; i<=(int)end; ++i ) {
int uenc = ((i>>16)-0xd800)*0x400 + (i&0xffff)-0xdc00 + 0x10000;
sc = info->chars[startglyph+i-start];
if ( dounicode && sc->unicodeenc==-1 )
@@ -4151,7 +4909,7 @@ return;
}
first = getlong(ttf);
count = getlong(ttf);
- if ( justinuse )
+ if ( justinuse==git_justinuse )
for ( i=0; i<count; ++i )
info->inuse[getushort(ttf)]= 1;
else
@@ -4169,21 +4927,22 @@ return;
enc = FindOrMakeEncoding("UnicodeFull");
}
ngroups = getlong(ttf);
- for ( j=0; j<ngroups; ++j ) {
+ for ( j=0; j<(int)ngroups; ++j ) {
start = getlong(ttf);
end = getlong(ttf);
startglyph = getlong(ttf);
- if ( justinuse ) {
- for ( i=start; i<=end; ++i )
- if ( startglyph+i-start < info->glyph_cnt )
+ if ( justinuse==git_justinuse ) {
+ for ( i=start; i<=(int)end; ++i )
+ if ( startglyph+i-start < (unsigned)info->glyph_cnt )
info->inuse[startglyph+i-start]= 1;
else
break;
} else
- for ( i=start; i<=end; ++i ) {
- if ( startglyph+i-start >= info->glyph_cnt ||
+ for ( i=start; i<=(int)end; ++i ) {
+ if ( startglyph+i-start >= (unsigned)info->glyph_cnt ||
info->chars[startglyph+i-start]==NULL ) {
LogError( _("Bad font: Encoding data out of range.\n") );
+ info->bad_cmap = true;
break;
} else {
if ( dounicode )
@@ -4200,7 +4959,10 @@ return;
for ( i=0; i<info->glyph_cnt; ++i )
if ( info->chars[i]!=NULL && info->chars[i]->unicodeenc==0xffff )
info->chars[i]->unicodeenc = -1;
- if ( !justinuse ) {
+ info->vs_start = vs_map;
+ if ( vs_map!=0 )
+ ApplyVariationSequenceSubtable(ttf,vs_map,info,justinuse);
+ if ( justinuse==git_normal ) {
if ( interp==ui_none )
info->uni_interp = amscheck(info,map);
map->enc = enc; /* This can be changed from the initial value */
@@ -4238,10 +5000,11 @@ static void readttfos2metrics(FILE *ttf,struct ttfinfo *info) {
info->pfminfo.panose[0]==3 ? 0x41 : /* Script */
info->pfminfo.panose[0]==4 ? 0x51 : /* Decorative */
0x51; /* And pictorial doesn't fit into pfm */
- /* unicoderange[] */ getlong(ttf);
- /* unicoderange[] */ getlong(ttf);
- /* unicoderange[] */ getlong(ttf);
- /* unicoderange[] */ getlong(ttf);
+ info->pfminfo.unicoderanges[0] = getlong(ttf);
+ info->pfminfo.unicoderanges[1] = getlong(ttf);
+ info->pfminfo.unicoderanges[2] = getlong(ttf);
+ info->pfminfo.unicoderanges[3] = getlong(ttf);
+ info->pfminfo.hasunicoderanges = true;
info->pfminfo.os2_vendor[0] = getc(ttf);
info->pfminfo.os2_vendor[1] = getc(ttf);
info->pfminfo.os2_vendor[2] = getc(ttf);
@@ -4250,7 +5013,7 @@ static void readttfos2metrics(FILE *ttf,struct ttfinfo *info) {
if ( info->os2_version>=4 ) {
info->use_typo_metrics = (sel&128)?1:0;
info->weight_width_slope_only = (sel&256)?1:0;
- }
+ }
#ifdef LUA_FF_LIB
info->pfminfo.firstchar = getushort(ttf);
info->pfminfo.lastchar = getushort(ttf);
@@ -4267,24 +5030,34 @@ static void readttfos2metrics(FILE *ttf,struct ttfinfo *info) {
info->pfminfo.os2_typolinegap = getushort(ttf);
info->pfminfo.os2_winascent = getushort(ttf);
info->pfminfo.os2_windescent = getushort(ttf);
+ info->pfminfo.winascent_add = info->pfminfo.windescent_add = false;
+ info->pfminfo.typoascent_add = info->pfminfo.typodescent_add = false;
+ info->pfminfo.pfmset = true;
+ info->pfminfo.panose_set = true;
+ info->pfminfo.subsuper_set = true;
+ if ( info->os2_version>=1 ) {
+ info->pfminfo.codepages[0] = getlong(ttf);
+ info->pfminfo.codepages[1] = getlong(ttf);
+ info->pfminfo.hascodepages = true;
+ }
#ifdef LUA_FF_LIB
if ( info->os2_version>=3 ) { /* TH just in case */
- /* unicoderange[] */ getlong(ttf);
- /* unicoderange[] */ getlong(ttf);
info->pfminfo.os2_xheight = getushort(ttf); /* four new fields */
info->pfminfo.os2_capheight = getushort(ttf);
info->pfminfo.os2_defaultchar = getushort(ttf);
info->pfminfo.os2_breakchar = getushort(ttf);
}
#endif
- info->pfminfo.winascent_add = info->pfminfo.windescent_add = false;
- info->pfminfo.typoascent_add = info->pfminfo.typodescent_add = false;
-
- info->pfminfo.pfmset = true;
- info->pfminfo.panose_set = true;
- info->pfminfo.subsuper_set = true;
+ if ( info->os2_version==0 ) {
+ LogError("Windows will reject fonts with an OS/2 version number of 0\n");
+ info->bad_os2_version = true;
+ } else if ( info->os2_version==1 && info->cff_start!=0 ) {
+ LogError("Windows will reject otf (cff) fonts with an OS/2 version number of 1\n");
+ info->bad_os2_version = true;
+ }
}
+#if 0
static int cmapEncFromName(struct ttfinfo *info,const char *nm, int glyphid) {
int uni;
int i;
@@ -4312,6 +5085,7 @@ return( -1 );
}
return( uni );
}
+#endif
static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
int i,j;
@@ -4321,10 +5095,9 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
uint16 *indexes;
extern const char *ttfstandardnames[];
int notdefwarned = false;
+ int anynames = false;
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_change_line2(_("Reading Names"));
-#endif
+ ff_progress_change_line2(_("Reading Names"));
/* Give ourselves an xuid, just in case they want to convert to PostScript*/
/* (even type42) */
@@ -4339,6 +5112,7 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
info->italicAngle = getfixed(ttf);
info->upos = (short) getushort(ttf);
info->uwidth = (short) getushort(ttf);
+ info->upos += info->uwidth/2; /* 'post' defn of this field is different from FontInfo defn and I didn't notice */
/* fixedpitch = */ getlong(ttf);
/* mem1 = */ getlong(ttf);
/* mem2 = */ getlong(ttf);
@@ -4357,8 +5131,10 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
/* if we are only loading bitmaps, we can get holes in our data */
for ( i=0; i<258; ++i ) if ( indexes[i]!=0 || i==0 ) if ( indexes[i]<info->glyph_cnt && info->chars[indexes[i]]!=NULL ) {
info->chars[indexes[i]]->name = copy(ttfstandardnames[i]);
+#if 0 /* Too many fonts have badly named glyphs */
if ( info->chars[indexes[i]]->unicodeenc==-1 )
info->chars[indexes[i]]->unicodeenc = cmapEncFromName(info,ttfstandardnames[i],indexes[i]);
+#endif
}
gcbig += 258;
for ( i=258; i<gcbig; ++i ) {
@@ -4372,11 +5148,14 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
nm[j] = '\0';
if ( indexes[i]<info->glyph_cnt && info->chars[indexes[i]]!=NULL ) {
info->chars[indexes[i]]->name = nm;
+#if 0 /* Too many fonts have badly named glyphs */
if ( info->chars[indexes[i]]->unicodeenc==-1 )
info->chars[indexes[i]]->unicodeenc = cmapEncFromName(info,nm,indexes[i]);
+#endif
}
}
free(indexes);
+ anynames = true;
}
}
@@ -4402,8 +5181,6 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
}
}
- /* where no names are given, but we've got a unicode encoding use */
- /* that to guess at them */
for ( i=0; i<info->glyph_cnt; ++i ) if ( info->chars[i]!=NULL ) {
/* info->chars[i] can be null in some TTC files */
if ( i!=0 && info->chars[i]->name!=NULL &&
@@ -4418,6 +5195,10 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
}
free(info->chars[i]->name);
info->chars[i]->name = NULL;
+ /* I used to check for glyphs with bad names (ie. names indicative of */
+ /* another unicode code point than the one applied to the glyph) but */
+ /* this proves too early for that check, as we don't have the altunis*/
+ /* figured out yet. So I've moved that into its own routine later */
}
/* And some volt files actually assign nul strings to the name */
if ( (info->chars[i]->name!=NULL && *info->chars[i]->name!='\0' ))
@@ -4428,11 +5209,20 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
else if ( info->chars[i]->unicodeenc==-1 ) {
/* Do this later */;
name = NULL;
- } else
+ } else {
name = StdGlyphName(buffer,info->chars[i]->unicodeenc,info->uni_interp,NULL);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ if ( anynames ) {
+ for ( j=0; j<info->glyph_cnt; ++j ) {
+ if ( info->chars[j]!=NULL && j!=i && info->chars[j]->name!=NULL ) {
+ if ( strcmp(info->chars[j]->name,name)==0 ) {
+ name = NULL;
+ break;
+ }
+ }
+ }
+ }
+ }
+ ff_progress_next();
info->chars[i]->name = copy(name);
}
@@ -4445,8 +5235,12 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
for ( i=info->glyph_cnt-1; i>=0 ; --i )
if ( info->chars[i]!=NULL && info->chars[i]->name==NULL )
break;
+ if ( i>=0 && info->vs_start!=0 )
+ ApplyVariationSequenceSubtable(ttf,info->vs_start,info,git_findnames);
if ( i>=0 && info->gsub_start!=0 )
GuessNamesFromGSUB(ttf,info);
+ if ( i>=0 && info->math_start!=0 )
+ GuessNamesFromMATH(ttf,info);
for ( i=0; i<info->glyph_cnt; ++i ) {
/* info->chars[i] can be null in some TTC files */
@@ -4456,19 +5250,15 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
continue;
if ( info->ordering!=NULL )
sprintf(buffer, "%.20s-%d", info->ordering, i );
- else if ( info->map!=NULL && info->map->map[i]!=-1 )
+ else if ( info->map!=NULL && info->map->backmap[i]!=-1 )
sprintf(buffer, "nounicode.%d.%d.%x", info->platform, info->specific,
- (int) info->map->map[i] );
+ (int) info->map->backmap[i] );
else
sprintf( buffer, "glyph%d", i );
info->chars[i]->name = copy(buffer);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next_stage();
-#endif
+ ff_progress_next_stage();
}
static void readttfgasp(FILE *ttf,struct ttfinfo *info) {
@@ -4496,14 +5286,14 @@ static void UnfigureControls(Spline *spline,BasePoint *pos) {
pos->y = rint( (spline->splines[1].c+2*spline->splines[1].d)/2 );
}
-int ttfFindPointInSC(SplineChar *sc,int pnum,BasePoint *pos,
+int ttfFindPointInSC(SplineChar *sc,int layer,int pnum,BasePoint *pos,
RefChar *bound) {
SplineSet *ss;
SplinePoint *sp;
int last=0, ret;
RefChar *refs;
- for ( ss = sc->layers[ly_fore].splines; ss!=NULL; ss=ss->next ) {
+ for ( ss = sc->layers[layer].splines; ss!=NULL; ss=ss->next ) {
for ( sp=ss->first; ; ) {
if ( sp->ttfindex==pnum ) {
*pos = sp->me;
@@ -4517,10 +5307,10 @@ return(-1);
}
return( -1 );
}
- if ( !sp->nonextcp && last<sp->nextcpindex )
- last = sp->nextcpindex;
+ if ( !sp->nonextcp && last<=sp->nextcpindex )
+ last = sp->nextcpindex+1;
else if ( sp->ttfindex!=0xffff )
- last = sp->ttfindex;
+ last = sp->ttfindex+1;
if ( sp->next==NULL )
break;
sp = sp->next->to;
@@ -4528,12 +5318,12 @@ return( -1 );
break;
}
}
- for ( refs=sc->layers[ly_fore].refs; refs!=NULL; refs=refs->next ) {
+ for ( refs=sc->layers[layer].refs; refs!=NULL; refs=refs->next ) {
if ( refs==bound ) {
LogError( _("Invalid point match. Point would be after this reference.\n") );
return( 0x800000 );
}
- ret = ttfFindPointInSC(refs->sc,pnum-last,pos,NULL);
+ ret = ttfFindPointInSC(refs->sc,ly_fore,pnum-last,pos,NULL);
if ( ret==-1 ) {
BasePoint p;
p.x = refs->transform[0]*pos->x + refs->transform[2]*pos->y + refs->transform[4];
@@ -4542,6 +5332,10 @@ return( 0x800000 );
return( -1 );
}
last += ret;
+ if ( last>pnum ) {
+ IError("Point match failure last=%d, pnum=%d", last, pnum );
+return( 0x800000 );
+ }
}
return( last ); /* Count of number of points in the character */
}
@@ -4549,8 +5343,8 @@ return( last ); /* Count of number of points in the character */
static void ttfPointMatch(SplineChar *sc,RefChar *rf) {
BasePoint sofar, inref;
- if ( ttfFindPointInSC(sc,rf->match_pt_base,&sofar,rf)!=-1 ||
- ttfFindPointInSC(rf->sc,rf->match_pt_ref,&inref,NULL)!=-1 ) {
+ if ( ttfFindPointInSC(sc,ly_fore,rf->match_pt_base,&sofar,rf)!=-1 ||
+ ttfFindPointInSC(rf->sc,ly_fore,rf->match_pt_ref,&inref,NULL)!=-1 ) {
LogError( _("Could not match points in composite glyph (%d to %d) when adding %s to %s\n"),
rf->match_pt_base, rf->match_pt_ref, rf->sc->name, sc->name);
return;
@@ -4583,7 +5377,7 @@ return( false );
ref->adobe_enc = getAdobeEnc(ref->sc->name);
if ( ref->point_match )
ttfPointMatch(chars[i],ref);
- SCReinstanciateRefChar(chars[i],ref);
+ SCReinstanciateRefChar(chars[i],ref,ly_fore);
SCMakeDependent(chars[i],ref->sc);
prev = ref;
}
@@ -4595,18 +5389,14 @@ return( true );
static void ttfFixupReferences(struct ttfinfo *info) {
int i;
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_change_line2(_("Fixing up References"));
-#endif
+ ff_progress_change_line2(_("Fixing up References"));
+ for ( i=0; i<info->glyph_cnt; ++i ) if ( info->chars[i]!=NULL )
+ info->chars[i]->ticked = false;
for ( i=0; i<info->glyph_cnt; ++i ) {
ttfFixupRef(info->chars,i);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_next_stage();
-#endif
+ ff_progress_next_stage();
}
static void TtfCopyTableBlindly(struct ttfinfo *info,FILE *ttf,
@@ -4630,21 +5420,29 @@ return;
info->tabs = tab;
}
+static int LookupListHasFeature(OTLookup *otl,uint32 tag) {
+ FeatureScriptLangList *feat;
+
+ while ( otl!=NULL ) {
+ for ( feat = otl->features; feat!=NULL; feat=feat->next )
+ if ( feat->featuretag == tag )
+return( true );
+ otl = otl->next;
+ }
+return( false );
+}
+
static int readttf(FILE *ttf, struct ttfinfo *info, char *filename) {
char *oldloc;
int i;
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_change_stages(3);
-#endif
+ ff_progress_change_stages(3);
if ( !readttfheader(ttf,info,filename,&info->chosenname)) {
return( 0 );
}
oldloc = setlocale(LC_NUMERIC,"C"); /* TrueType doesn't need this but opentype dictionaries do */
readttfpreglyph(ttf,info);
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_progress_change_total(info->glyph_cnt);
-#endif
+ ff_progress_change_total(info->glyph_cnt);
/* If font only contains bitmaps, then only read bitmaps */
if ( (info->glyphlocations_start==0 || info->glyph_length==0) &&
@@ -4659,16 +5457,9 @@ return( 0 );
int choice;
buts[0] = _("TTF 'glyf'");
buts[1] = _("OTF 'CFF '");
- buts[3] = NULL;
-#if defined(FONTFORGE_CONFIG_GDRAW)
buts[2] = _("_Cancel");
- choice = gwwv_ask(_("Pick a font, any font..."),(const char **) buts,0,2,_("This font contains both a TrueType 'glyf' table and an OpenType 'CFF ' table. FontForge can only deal with one at a time, please pick which one you want to use"));
-#elif defined(FONTFORGE_CONFIG_GTK)
- buts[2] = GTK_STOCK_CANCEL;
- choice = gwwv_ask(_("Pick a font, any font..."),(const char **) buts,0,2,_("This font contains both a TrueType 'glyf' table and an OpenType 'CFF ' table. FontForge can only deal with one at a time, please pick which one you want to use"));
-#else
- choice = 0;
-#endif
+ buts[3] = NULL;
+ choice = ff_ask(_("Pick a font, any font..."),(const char **) buts,0,2,_("This font contains both a TrueType 'glyf' table and an OpenType 'CFF ' table. FontForge can only deal with one at a time, please pick which one you want to use"));
if ( choice==2 ) {
setlocale(LC_NUMERIC,oldloc);
return( 0 );
@@ -4705,16 +5496,9 @@ return( 0 );
return( 0 );
}
if ( info->bitmapdata_start!=0 && info->bitmaploc_start!=0 )
-#ifndef LUA_FF_LIB
- TTFLoadBitmaps(ttf,info,info->onlyonestrike);
-#endif
- ;
+ ; /*TTFLoadBitmaps(ttf,info,info->onlyonestrike);*/
else if ( info->onlystrikes )
-#if !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- gwwv_post_error( _("No Bitmap Strikes"), _("No (useable) bitmap strikes in this TTF font: %s"), filename==NULL ? "<unknown>" : filename );
-#else
- ;
-#endif
+ ff_post_error( _("No Bitmap Strikes"), _("No (useable) bitmap strikes in this TTF font: %s"), filename==NULL ? "<unknown>" : filename );
if ( info->onlystrikes && info->bitmaps==NULL ) {
free(info->chars);
setlocale(LC_NUMERIC,oldloc);
@@ -4729,7 +5513,7 @@ return( 0 );
/* 'cmap' is not meaningful for cid keyed fonts, and not supplied for */
/* type42 fonts */
if ( info->cidregistry==NULL && info->encoding_start!=0 )
- readttfencodings(ttf,info,false);
+ readttfencodings(ttf,info,git_normal);
if ( info->os2_start!=0 )
readttfos2metrics(ttf,info);
readttfpostnames(ttf,info); /* If no postscript table we'll guess at names */
@@ -4741,6 +5525,10 @@ return( 0 );
if ( info->lcar_start!=0 )
readttflcar(ttf,info);
}
+ if ( info->base_start!=0 )
+ readttfbase(ttf,info);
+ else if ( info->bsln_start!=0 )
+ readttfbsln(ttf,info);
if ( info->gasp_start!=0 )
readttfgasp(ttf,info);
/* read the cvt table before reading variation data */
@@ -4749,11 +5537,9 @@ return( 0 );
/* copy too for those fields we can't compute on our own */
/* Like size of twilight zone, etc. */
TtfCopyTableBlindly(info,ttf,info->maxp_start,info->maxp_len,CHR('m','a','x','p'));
-#ifndef LUA_FF_LIB
TtfCopyTableBlindly(info,ttf,info->cvt_start,info->cvt_len,CHR('c','v','t',' '));
TtfCopyTableBlindly(info,ttf,info->fpgm_start,info->fpgm_len,CHR('f','p','g','m'));
TtfCopyTableBlindly(info,ttf,info->prep_start,info->prep_len,CHR('p','r','e','p'));
-#endif
}
for ( i=0; i<info->savecnt; ++i ) if ( info->savetab[i].offset!=0 )
TtfCopyTableBlindly(info,ttf,info->savetab[i].offset,info->savetab[i].len,info->savetab[i].tag);
@@ -4762,23 +5548,23 @@ return( 0 );
readttfvariations(info,ttf);
if ( info->gpos_start!=0 ) /* kerning info may live in the gpos table too */
readttfgpossub(ttf,info,true);
- else {
- if ( info->kern_start!=0 )
- readttfkerns(ttf,info);
- if ( info->opbd_start!=0 )
- readttfopbd(ttf,info);
- }
+ /* Load the 'kern' table if the GPOS table either didn't exist or didn't */
+ /* contain any kerning info */
+ if ( info->kern_start!=0 && !LookupListHasFeature(info->gpos_lookups,CHR('k','e','r','n')))
+ readttfkerns(ttf,info);
+ if ( info->opbd_start!=0 && !LookupListHasFeature(info->gpos_lookups,CHR('l','f','b','d')))
+ readttfopbd(ttf,info);
if ( info->gsub_start!=0 )
readttfgpossub(ttf,info,false);
- else {
- /* We will default the gsub table later... */;
- if ( info->morx_start!=0 || info->mort_start!=0 )
- readttfmort(ttf,info);
- }
+ if ( info->morx_start!=0 || info->mort_start!=0 )
+ readttfmort(ttf,info);
+
if ( info->pfed_start!=0 )
pfed_read(ttf,info);
if ( info->tex_start!=0 )
tex_read(ttf,info);
+ if ( info->math_start!=0 )
+ otf_read_math(ttf,info);
setlocale(LC_NUMERIC,oldloc);
if ( !info->onlystrikes && info->glyphlocations_start!=0 && info->glyph_start!=0 )
ttfFixupReferences(info);
@@ -4788,25 +5574,6 @@ return( 0 );
return( true );
}
-
-#ifdef LUA_FF_LIB
-static int readttfinfo(FILE *ttf, struct ttfinfo *info, char *filename) {
-
- if ( !readttfheader(ttf,info,filename,&info->chosenname)) {
-return( 0 );
- }
- readttfpreglyph(ttf,info);
- if ( info->os2_start!=0 )
- readttfos2metrics(ttf,info);
- if ( info->postscript_start!=0 ) {
- fseek(ttf,info->postscript_start,SEEK_SET);
- (void)getlong(ttf);
- info->italicAngle = getfixed(ttf);
- }
-return( true );
-}
-#endif
-
static void SymbolFixup(struct ttfinfo *info) {
/* convert a two-byte symbol encoding (one using PUA) into expected */
/* one-byte encoding. */
@@ -4838,15 +5605,92 @@ void AltUniFigure(SplineFont *sf,EncMap *map) {
}
}
+static void NameConsistancyCheck(SplineFont *sf,EncMap *map) {
+ /* Many fonts seem to have glyph names which mean something other than */
+ /* what the encoding says of the glyph */
+ /* I used to ask about fixing the names up, but people didn't like that */
+ /* so now I just produce warnings */
+ int gid, uni;
+ SplineChar *sc;
+#if 0
+ char buffer[100];
+ int response, asked=-1;
+ char *buts[5];
+#endif
+
+#if 0
+ buts[0] = _("Yes"); buts[1] = _("Yes to _All");
+ buts[2] = _("No _to All"); buts[3] = _("No");
+ buts[4] = NULL;
+#endif
+
+ for ( gid = 0 ; gid<sf->glyphcnt; ++gid ) if ( (sc=sf->glyphs[gid])!=NULL ) {
+ if ( sc->name!=NULL &&
+ strcmp(sc->name,".null")!=0 &&
+ strcmp(sc->name,"nonmarkingreturn")!=0 &&
+ (uni = UniFromName(sc->name,sf->uni_interp,map==NULL ? &custom : map->enc))!= -1 &&
+ sc->unicodeenc != uni ) {
+#if 1
+ if ( uni>=0xe000 && uni<=0xf8ff )
+ /* Don't complain about adobe's old PUA assignments for things like "eight.oldstyle" */;
+ else if ( uni<0x20 )
+ /* Nor about control characters */;
+ else if ( sc->unicodeenc==-1 ) {
+#if 0
+ LogError(_("The glyph named %.30s is not mapped to any unicode code point.\nBut its name indicates it should be mapped to U+%04X.\n"),
+ sc->name,uni);
+#endif
+ } else {
+ /* Ah, but suppose there's an altuni? */
+ struct altuni *alt;
+ for ( alt = sc->altuni; alt!=NULL && alt->unienc!=uni; alt=alt->next );
+ if ( alt==NULL )
+ LogError( _("The glyph named %.30s is mapped to U+%04X.\nBut its name indicates it should be mapped to U+%04X.\n"),
+ sc->name,sc->unicodeenc, uni);
+ else if ( alt->vs==0 ) {
+ alt->unienc = sc->unicodeenc;
+ sc->unicodeenc = uni;
+ }
+ }
+#else
+ if ( asked!=-1 )
+ response = asked;
+ else if ( sc->unicodeenc==-1 )
+ response = ff_ask(_("Bad glyph name"),(const char **) buts,1,1,_("The glyph named %.30s is not mapped to any unicode code point. But its name indicates it should be mapped to U+%04X.\nWould you like to retain the name in spite of this?"),
+ sc->name,uni);
+ else
+ response = ff_ask(_("Bad glyph name"),(const char **) buts,1,1,_("The glyph named %.30s is mapped to U+%04X.\nBut its name indicates it should be mapped to U+%04X.\nWould you like to retain the name in spite of this?"),
+ sc->name,sc->unicodeenc, uni);
+ if ( response==1 )
+ asked = response = 0;
+ else if ( response==2 )
+ asked = response = 3;
+ if ( response==3 ) {
+ free(sc->name);
+ if ( sc->unicodeenc==-1 )
+ sc->name = StdGlyphName(buffer,sc->unicodeenc,sf->uni_interp,NULL);
+ else {
+ sprintf( buffer, "glyph%d", gid );
+ sc->name = copy( buffer );
+ }
+ }
+#endif
+ }
+ }
+}
+
static void UseGivenEncoding(SplineFont *sf,struct ttfinfo *info) {
int i;
RefChar *rf, *prev, *next;
+ SplineChar *sc;
sf->glyphs = info->chars;
sf->glyphcnt = sf->glyphmax = info->glyph_cnt;
for ( i=0; i<sf->glyphcnt; ++i )
- if ( sf->glyphs[i]!=NULL )
- sf->glyphs[i]->parent = sf;
+ if ( (sc = sf->glyphs[i])!=NULL ) {
+ sc->layers[ly_fore].order2 = sc->layers[ly_back].order2 = info->to_order2;
+ sc->parent = sf;
+ }
/* A CFF font could contain type1 charstrings, or a type2 font could use */
/* the depreciated convention that endchar =~ seac */
@@ -4870,6 +5714,7 @@ static void UseGivenEncoding(SplineFont *sf,struct ttfinfo *info) {
sf->map = info->map;
sf->uni_interp = info->uni_interp;
AltUniFigure(sf,sf->map);
+ NameConsistancyCheck(sf, sf->map);
}
static char *AxisNameConvert(uint32 tag) {
@@ -4907,7 +5752,7 @@ static SplineFont *SFFromTuple(SplineFont *basesf,struct variations *v,int tuple
SplineFont *sf;
int i;
RefChar *r;
-
+ (void)info; /* for -Wall */
sf = SplineFontEmpty();
sf->display_size = basesf->display_size;
sf->display_antialias = basesf->display_antialias;
@@ -4921,7 +5766,6 @@ static SplineFont *SFFromTuple(SplineFont *basesf,struct variations *v,int tuple
sf->upos = basesf->upos;
sf->uwidth = basesf->uwidth;
sf->ascent = basesf->ascent;
- sf->vertical_origin = basesf->vertical_origin;
sf->hasvmetrics = basesf->hasvmetrics;
sf->descent = basesf->descent;
sf->kerns = v->tuples[tuple].khead;
@@ -4930,14 +5774,17 @@ static SplineFont *SFFromTuple(SplineFont *basesf,struct variations *v,int tuple
sf->mm = mm;
sf->glyphmax = sf->glyphcnt = basesf->glyphcnt;
sf->glyphs = v->tuples[tuple].chars;
- sf->order2 = true;
+ sf->layers[ly_fore].order2 = sf->layers[ly_back].order2 = true;
for ( i=0; i<sf->glyphcnt; ++i ) if ( basesf->glyphs[i]!=NULL ) {
- sf->glyphs[i]->orig_pos = i;
- sf->glyphs[i]->parent = sf;
+ SplineChar *sc = sf->glyphs[i];
+ sc->orig_pos = i;
+ sc->parent = sf;
+ sc->layers[ly_fore].order2 = sc->layers[ly_back].order2 = true;
}
+ sf->grid.order2 = true;
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
for ( r=sf->glyphs[i]->layers[ly_fore].refs; r!=NULL; r=r->next )
- SCReinstanciateRefChar(sf->glyphs[i],r);
+ SCReinstanciateRefChar(sf->glyphs[i],r,ly_fore);
}
sf->ttf_tables = v->tuples[tuple].cvt;
@@ -5010,7 +5857,7 @@ static void SFRelativeWinAsDs(SplineFont *sf) {
if ( !sf->pfminfo.winascent_add || !sf->pfminfo.windescent_add ||
!sf->pfminfo.hheadascent_add || !sf->pfminfo.hheaddescent_add ) {
DBounds b;
- CIDFindBounds(sf,&b);
+ CIDLayerFindBounds(sf,ly_fore,&b);
if ( !sf->pfminfo.winascent_add ) {
sf->pfminfo.winascent_add = true;
if ( sf->pfminfo.os2_winascent < sf->ascent/8 ) {
@@ -5095,27 +5942,79 @@ return;
map->backmap[map->map[i]] = i;
}
+void TTF_PSDupsDefault(SplineFont *sf) {
+ struct ttflangname *english;
+ char versionbuf[40];
+
+ /* Ok, if we've just loaded a ttf file then we've got a bunch of langnames*/
+ /* we copied some of them (copyright, family, fullname, etc) into equiv */
+ /* postscript entries in the sf. If we then use FontInfo and change the */
+ /* obvious postscript entries we are left with the old ttf entries. If */
+ /* we generate a ttf file and then load it the old values pop up. */
+ /* Solution: Anything we can generate by default should be set to NULL */
+ for ( english=sf->names; english!=NULL && english->lang!=0x409; english=english->next );
+ if ( english==NULL )
+return;
+ if ( english->names[ttf_family]!=NULL &&
+ strcmp(english->names[ttf_family],sf->familyname)==0 ) {
+ free(english->names[ttf_family]);
+ english->names[ttf_family]=NULL;
+ }
+ if ( english->names[ttf_copyright]!=NULL &&
+ strcmp(english->names[ttf_copyright],sf->copyright)==0 ) {
+ free(english->names[ttf_copyright]);
+ english->names[ttf_copyright]=NULL;
+ }
+ if ( english->names[ttf_fullname]!=NULL &&
+ strcmp(english->names[ttf_fullname],sf->fullname)==0 ) {
+ free(english->names[ttf_fullname]);
+ english->names[ttf_fullname]=NULL;
+ }
+ if ( sf->subfontcnt!=0 || sf->version!=NULL ) {
+ if ( sf->subfontcnt!=0 )
+ sprintf( versionbuf, "Version %f", sf->cidversion );
+ else
+ sprintf(versionbuf,"Version %.20s ", sf->version);
+ if ( english->names[ttf_version]!=NULL &&
+ strcmp(english->names[ttf_version],versionbuf)==0 ) {
+ free(english->names[ttf_version]);
+ english->names[ttf_version]=NULL;
+ }
+ }
+ if ( english->names[ttf_subfamily]!=NULL &&
+ strcmp(english->names[ttf_subfamily],SFGetModifiers(sf))==0 ) {
+ free(english->names[ttf_subfamily]);
+ english->names[ttf_subfamily]=NULL;
+ }
+
+ /* User should not be allowed any access to this one, not ever */
+ free(english->names[ttf_postscriptname]);
+ english->names[ttf_postscriptname]=NULL;
+}
+
static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
SplineFont *sf, *_sf;
int i,k;
- BDFFont *bdf;
SplineChar *sc;
struct ttf_table *last[2], *tab, *next;
sf = SplineFontEmpty();
+ sf->display_size = -default_fv_font_size;
#ifdef LUA_FF_LIB
sf->units_per_em = info->emsize;
#endif
- sf->display_size = -default_fv_font_size;
sf->display_antialias = default_fv_antialias;
sf->fontname = info->fontname;
sf->fullname = info->fullname;
sf->familyname = info->familyname;
sf->chosenname = info->chosenname;
sf->onlybitmaps = info->onlystrikes;
- sf->order2 = info->to_order2;
+ sf->layers[ly_fore].order2 = info->to_order2;
+ sf->layers[ly_back].order2 = info->to_order2;
sf->comments = info->fontcomments;
+ sf->fontlog = info->fontlog;
+ sf->cvt_names = info->cvt_names;
sf->creationtime = info->creationtime;
sf->modificationtime = info->modificationtime;
@@ -5128,6 +6027,7 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
sf->gasp_cnt = info->gasp_cnt;
sf->gasp = info->gasp;
+ sf->MATH = info->math;
sf->texdata = info->texdata;
@@ -5187,7 +6087,6 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
sf->upos = info->upos;
sf->uwidth = info->uwidth;
sf->ascent = info->ascent;
- sf->vertical_origin = info->vertical_origin;
if ( info->vhea_start!=0 && info->vmetrics_start!=0 )
sf->hasvmetrics = true;
sf->descent = info->descent;
@@ -5245,10 +6144,21 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
sf->supplement = info->supplement;
sf->cidversion = info->cidfontversion;
sf->bitmaps = info->bitmaps;
- for ( bdf = info->bitmaps; bdf!=NULL; bdf = bdf->next ) {
- bdf->sf = sf;
+ sf->grid = info->guidelines;
+ sf->horiz_base = info->horiz_base;
+ sf->vert_base = info->vert_base;
+ if ( info->layers!=NULL ) {
+ info->layers[ly_fore] = sf->layers[ly_fore];
+ sf->layers[ly_fore].name = NULL;
+ if ( info->layers[ly_back].name==NULL )
+ info->layers[ly_back].name = sf->layers[ly_back].name;
+ else
+ free( sf->layers[ly_back].name );
+ free( sf->layers );
+ sf->layers = info->layers;
+ sf->layer_cnt = info->layer_cnt;
}
- SFDefaultAscent(sf);
+
for ( i=0; i<info->glyph_cnt; ++i ) if ( info->chars[i]!=NULL ) {
SCOrderAP(info->chars[i]);
@@ -5262,7 +6172,6 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
free(info->chars); /* This is the GID->char index, don't need it now */
for ( i=0; i<sf->subfontcnt; ++i ) {
sf->subfonts[i]->cidmaster = sf;
- sf->subfonts[i]->vertical_origin = sf->vertical_origin;
sf->subfonts[i]->hasvmetrics = sf->hasvmetrics;
}
}
@@ -5293,7 +6202,7 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
if ( info->variations!=NULL )
MMFillFromVAR(sf,info);
- if ( info->cff_length!=0 && !sf->order2 ) {
+ if ( info->cff_length!=0 && !sf->layers[ly_fore].order2 ) {
/* Clean up the hint masks, We create an initial hintmask whether we */
/* need it or not */
k=0;
@@ -5311,6 +6220,17 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
}
SFRelativeWinAsDs(sf);
free(info->savetab);
+ sf->loadvalidation_state =
+ (info->bad_ps_fontname ?lvs_bad_ps_fontname:0) |
+ (info->bad_glyph_data ?lvs_bad_glyph_table:0) |
+ (info->bad_cff ?lvs_bad_cff_table:0) |
+ (info->bad_metrics ?lvs_bad_metrics_table:0) |
+ (info->bad_cmap ?lvs_bad_cmap_table:0) |
+ (info->bad_embedded_bitmap ?lvs_bad_bitmaps_table:0) |
+ (info->bad_gx ?lvs_bad_gx_table:0) |
+ (info->bad_ot ?lvs_bad_ot_table:0) |
+ (info->bad_os2_version ?lvs_bad_os2_version:0)|
+ (info->bad_sfnt_header ?lvs_bad_sfnt_header:0);
return( sf );
}
@@ -5322,6 +6242,7 @@ SplineFont *_SFReadTTF(FILE *ttf, int flags,enum openflags openflags, char *file
info.onlystrikes = (flags&ttf_onlystrikes)?1:0;
info.onlyonestrike = (flags&ttf_onlyonestrike)?1:0;
info.use_typo_metrics = true;
+ info.openflags = openflags;
info.fd = fd;
ret = readttf(ttf,&info,filename);
if ( !ret )
@@ -5332,11 +6253,13 @@ return( SFFillFromTTF(&info));
SplineFont *SFReadTTF(char *filename, int flags, enum openflags openflags) {
FILE *ttf;
SplineFont *sf;
- char *temp=filename, *pt, *lparen;
+ char *temp=filename, *pt, *lparen, *rparen;
pt = strrchr(filename,'/');
if ( pt==NULL ) pt = filename;
- if ( (lparen=strchr(pt,'('))!=NULL && strchr(lparen,')')!=NULL ) {
+ if ( (lparen = strrchr(pt,'('))!=NULL &&
+ (rparen = strrchr(lparen,')'))!=NULL &&
+ rparen[1]=='\0' ) {
temp = copy(filename);
pt = temp + (lparen-filename);
*pt = '\0';
@@ -5353,10 +6276,48 @@ return( sf );
#ifdef LUA_FF_LIB
+static int readttfinfo(FILE *ttf, struct ttfinfo *info, char *filename) {
+
+ if ( !readttfheader(ttf,info,filename,&info->chosenname)) {
+return( 0 );
+ }
+ readttfpreglyph(ttf,info);
+ if ( info->os2_start!=0 )
+ readttfos2metrics(ttf,info);
+ if ( info->postscript_start!=0 ) {
+ fseek(ttf,info->postscript_start,SEEK_SET);
+ (void)getlong(ttf);
+ info->italicAngle = getfixed(ttf);
+ }
+return( true );
+}
+
/* I am not sure what happens to the ttinfo struct's members.
perhaps some need free()-ing
*/
+void THPatchSplineChar (SplineChar *sc)
+{
+ DBounds bb;
+ if (sc->layers!=NULL && sc->layers[ly_fore].splines != NULL) {
+ if (sc->xmax==0 && sc->ymax==0 && sc->xmin==0 && sc->ymin==0) {
+ SplineCharFindBounds(sc,&bb);
+ sc->xmin = bb.minx;
+ sc->ymin = bb.miny;
+ sc->xmax = bb.maxx;
+ sc->ymax = bb.maxy;
+ }
+ /* free the curves */
+ SplinePointListsFree(sc->layers[ly_fore].splines);
+ sc->layers[ly_fore].splines=NULL;
+ }
+ if (sc->layers[ly_fore].refs!=NULL) {
+ RefCharsFree(sc->layers[ly_fore].refs);
+ sc->layers[ly_fore].refs = NULL;
+ }
+}
+
+
static SplineFont *SFFillFromTTFInfo(struct ttfinfo *info) {
SplineFont *sf ;
@@ -5406,7 +6367,7 @@ return( sf );
SplineFont *_SFReadTTFInfo(FILE *ttf, int flags,enum openflags openflags, char *filename,struct fontdict *fd) {
struct ttfinfo info;
int ret;
-
+ (void)openflags; /* for -Wall */
memset(&info,'\0',sizeof(struct ttfinfo));
info.onlystrikes = (flags&ttf_onlystrikes)?1:0;
info.onlyonestrike = (flags&ttf_onlyonestrike)?1:0;
@@ -5418,7 +6379,6 @@ return( NULL );
return( SFFillFromTTFInfo(&info));
}
-
SplineFont *SFReadTTFInfo(char *filename, int flags, enum openflags openflags) {
FILE *ttf;
SplineFont *sf;
@@ -5442,9 +6402,9 @@ return( sf );
}
#endif
-
SplineFont *_CFFParse(FILE *temp,int len, char *fontsetname) {
struct ttfinfo info;
+ (void)fontsetname; /* for -Wall */
memset(&info,'\0',sizeof(info));
info.cff_start = 0;
@@ -5456,7 +6416,7 @@ return( SFFillFromTTF(&info));
}
SplineFont *CFFParse(char *filename) {
- FILE *cff = fopen(filename,"rb");
+ FILE *cff = fopen(filename,"r");
SplineFont *sf;
long len;
@@ -5470,35 +6430,6 @@ return( NULL );
return( sf );
}
-#ifdef LUA_FF_LIB
-SplineFont *_CFFParseInfo(FILE *temp,int len, char *fontsetname) {
- struct ttfinfo info;
-
- memset(&info,'\0',sizeof(info));
- info.cff_start = 0;
- info.cff_length = len;
- info.barecff = true;
- if ( !readcffglyphs(temp,&info) )
-return( NULL );
-return( SFFillFromTTFInfo(&info));
-}
-
-SplineFont *CFFParseInfo(char *filename) {
- FILE *cff = fopen(filename,"rb");
- SplineFont *sf;
- long len;
-
- if ( cff == NULL )
-return( NULL );
- fseek(cff,0,SEEK_END);
- len = ftell(cff);
- fseek(cff,0,SEEK_SET);
- sf = _CFFParseInfo(cff,len,NULL);
- fclose(cff);
-return( sf );
-}
-#endif
-
char **NamesReadCFF(char *filename) {
FILE *cff = fopen(filename,"rb");
int32 hdrsize, offsize;
@@ -5516,7 +6447,7 @@ return( NULL );
offsize = getc(cff);
if ( hdrsize!=4 )
fseek(cff,hdrsize,SEEK_SET);
- fontnames = readcfffontnames(cff,NULL);
+ fontnames = readcfffontnames(cff,NULL,NULL);
fclose(cff);
return( fontnames );
}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettfatt.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c
index 6f068ec921d..8b86752fc20 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettfatt.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfatt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -34,7 +34,7 @@
#include <ggadget.h> /* For GTextInfo */
#include "ttf.h"
-static uint16 *getAppleClassTable(FILE *ttf, int classdef_offset, int cnt, int sub, int div) {
+static uint16 *getAppleClassTable(FILE *ttf, int classdef_offset, int cnt, int sub, int div, struct ttfinfo *info) {
uint16 *class = gcalloc(cnt,sizeof(uint16));
int first, i, n;
/* Apple stores its class tables as containing offsets. I find it hard to */
@@ -44,8 +44,10 @@ static uint16 *getAppleClassTable(FILE *ttf, int classdef_offset, int cnt, int s
fseek(ttf,classdef_offset,SEEK_SET);
first = getushort(ttf);
n = getushort(ttf);
- if ( first+n-1>=cnt )
+ if ( first+n-1>=cnt ) {
LogError( _("Bad Apple Kern Class\n") );
+ info->bad_gx = true;
+ }
for ( i=0; i<n && i+first<cnt; ++i )
class[first+i] = (getushort(ttf)-sub)/div;
return( class );
@@ -67,8 +69,10 @@ static char **ClassToNames(struct ttfinfo *info,int class_cnt,uint16 *class,int
strcpy(ret[class[i]]+lens[class[i]], info->chars[i]->name );
lens[class[i]] += strlen(info->chars[i]->name)+1;
ret[class[i]][lens[class[i]]-1] = ' ';
- } else
+ } else {
LogError( _("Class index out of range %d (must be <%d)\n"),class[i], class_cnt );
+ info->bad_ot = true;
+ }
}
for ( i=1; i<class_cnt ; ++i )
if ( lens[i]==0 )
@@ -133,7 +137,7 @@ static int cmpuint16(const void *u1, const void *u2) {
return( ((int) *((const uint16 *) u1)) - ((int) *((const uint16 *) u2)) );
}
-static char *GlyphsToNames(struct ttfinfo *info,uint16 *glyphs, int make_uniq) {
+static char *GlyphsToNames(struct ttfinfo *info,uint16 *glyphs,int make_uniq) {
int i, j, len, off;
char *ret, *pt;
@@ -201,8 +205,6 @@ struct lookup {
OTLookup *otlookup;
};
-enum gsub_inusetype { git_normal, git_justinuse, git_findnames };
-
static uint16 *getCoverageTable(FILE *ttf, int coverage_offset, struct ttfinfo *info) {
int format, cnt, i,j, rcnt;
uint16 *glyphs=NULL;
@@ -215,21 +217,26 @@ static uint16 *getCoverageTable(FILE *ttf, int coverage_offset, struct ttfinfo *
glyphs = galloc((cnt+1)*sizeof(uint16));
if ( ftell(ttf)+2*cnt > info->g_bounds ) {
LogError( _("coverage table extends beyond end of table\n") );
+ info->bad_ot = true;
if ( ftell(ttf)>info->g_bounds )
return( NULL );
cnt = (info->g_bounds-ftell(ttf))/2;
}
for ( i=0; i<cnt; ++i ) {
- if ( cnt&0xffff0000 )
+ if ( cnt&0xffff0000 ) {
LogError( _("Bad count.\n"));
+ info->bad_ot = true;
+ }
glyphs[i] = getushort(ttf);
if ( feof(ttf) ) {
LogError( _("End of file found in coverage table.\n") );
+ info->bad_ot = true;
free(glyphs);
return( NULL );
}
if ( glyphs[i]>=info->glyph_cnt ) {
LogError( _("Bad coverage table. Glyph %d out of range [0,%d)\n"), glyphs[i], info->glyph_cnt );
+ info->bad_ot = true;
glyphs[i] = 0;
}
}
@@ -238,6 +245,7 @@ return( NULL );
rcnt = getushort(ttf); cnt = 0;
if ( ftell(ttf)+6*rcnt > info->g_bounds ) {
LogError( _("coverage table extends beyond end of table\n") );
+ info->bad_ot = true;
rcnt = (info->g_bounds-ftell(ttf))/6;
}
@@ -247,11 +255,13 @@ return( NULL );
ind = getushort(ttf);
if ( feof(ttf) ) {
LogError( _("End of file found in coverage table.\n") );
+ info->bad_ot = true;
free(glyphs);
return( NULL );
}
if ( start>end || end>=info->glyph_cnt ) {
LogError( _("Bad coverage table. Glyph range %d-%d out of range [0,%d)\n"), start, end, info->glyph_cnt );
+ info->bad_ot = true;
start = end = 0;
}
if ( ind+end-start+2 >= max ) {
@@ -270,6 +280,7 @@ return( NULL );
}
} else {
LogError( _("Bad format for coverage table %d\n"), format );
+ info->bad_ot = true;
return( NULL );
}
glyphs[cnt] = 0xffff;
@@ -284,12 +295,13 @@ struct valuerecord {
uint16 offXadvanceDev, offYadvanceDev;
};
-static uint16 *getClassDefTable(FILE *ttf, int classdef_offset, int cnt,
- uint32 g_bounds) {
+static uint16 *getClassDefTable(FILE *ttf, int classdef_offset, struct ttfinfo *info) {
int format, i, j;
uint16 start, glyphcnt, rangecnt, end, class;
uint16 *glist=NULL;
int warned = false;
+ int cnt = info->glyph_cnt;
+ uint32 g_bounds = info->g_bounds;
fseek(ttf, classdef_offset, SEEK_SET);
glist = gcalloc(cnt,sizeof(uint16)); /* Class 0 is default */
@@ -299,9 +311,11 @@ static uint16 *getClassDefTable(FILE *ttf, int classdef_offset, int cnt,
glyphcnt = getushort(ttf);
if ( start+(int) glyphcnt>cnt ) {
LogError( _("Bad class def table. start=%d cnt=%d, max glyph=%d\n"), start, glyphcnt, cnt );
+ info->bad_ot = true;
glyphcnt = cnt-start;
} else if ( ftell(ttf)+2*glyphcnt > g_bounds ) {
- LogError( _("Class definition table extends beyond end of table\n") );
+ LogError( _("Class definition sub-table extends beyond end of table\n") );
+ info->bad_ot = true;
glyphcnt = (g_bounds-ftell(ttf))/2;
}
for ( i=0; i<glyphcnt; ++i )
@@ -309,20 +323,25 @@ static uint16 *getClassDefTable(FILE *ttf, int classdef_offset, int cnt,
} else if ( format==2 ) {
rangecnt = getushort(ttf);
if ( ftell(ttf)+6*rangecnt > g_bounds ) {
- LogError( _("Class definition table extends beyond end of table\n") );
+ LogError( _("Class definition sub-table extends beyond end of table\n") );
+ info->bad_ot = true;
rangecnt = (g_bounds-ftell(ttf))/6;
}
for ( i=0; i<rangecnt; ++i ) {
start = getushort(ttf);
end = getushort(ttf);
- if ( start>end || end>=cnt )
+ if ( start>end || end>=cnt ) {
LogError( _("Bad class def table. Glyph range %d-%d out of range [0,%d)\n"), start, end, cnt );
+ info->bad_ot = true;
+ }
class = getushort(ttf);
for ( j=start; j<=end; ++j ) if ( j<cnt )
glist[j] = class;
}
- } else
+ } else {
LogError( _("Unknown class table format: %d\n"), format );
+ info->bad_ot = true;
+ }
/* Do another validity test */
for ( i=0; i<cnt; ++i ) {
@@ -330,6 +349,7 @@ static uint16 *getClassDefTable(FILE *ttf, int classdef_offset, int cnt,
if ( !warned ) {
LogError( _("Nonsensical class assigned to a glyph-- class=%d is too big. Glyph=%d\n"),
glist[i], i );
+ info->bad_ot = true;
warned = true;
}
glist[i] = 0;
@@ -360,7 +380,8 @@ static void readvaluerecord(struct valuerecord *vr,int vf,FILE *ttf) {
}
#ifdef FONTFORGE_CONFIG_DEVICETABLES
-static void ReadDeviceTable(FILE *ttf,DeviceTable *adjust,uint32 devtab) {
+static void ReadDeviceTable(FILE *ttf,DeviceTable *adjust,uint32 devtab,
+ struct ttfinfo *info) {
long here;
int pack;
int w,b,i,c;
@@ -374,6 +395,7 @@ return;
pack = getushort(ttf);
if ( adjust->first_pixel_size>adjust->last_pixel_size || pack==0 || pack>3 ) {
LogError(_("Bad device table\n" ));
+ info->bad_ot = true;
adjust->first_pixel_size = adjust->last_pixel_size = 0;
} else {
c = adjust->last_pixel_size-adjust->first_pixel_size+1;
@@ -398,7 +420,8 @@ return;
fseek(ttf,here,SEEK_SET);
}
-static ValDevTab *readValDevTab(FILE *ttf,struct valuerecord *vr,uint32 base) {
+static ValDevTab *readValDevTab(FILE *ttf,struct valuerecord *vr,uint32 base,
+ struct ttfinfo *info) {
ValDevTab *ret;
if ( vr->offXplaceDev==0 && vr->offYplaceDev==0 &&
@@ -406,13 +429,13 @@ static ValDevTab *readValDevTab(FILE *ttf,struct valuerecord *vr,uint32 base) {
return( NULL );
ret = chunkalloc(sizeof(ValDevTab));
if ( vr->offXplaceDev!=0 )
- ReadDeviceTable(ttf,&ret->xadjust,base + vr->offXplaceDev);
+ ReadDeviceTable(ttf,&ret->xadjust,base + vr->offXplaceDev,info);
if ( vr->offYplaceDev!=0 )
- ReadDeviceTable(ttf,&ret->yadjust,base + vr->offYplaceDev);
+ ReadDeviceTable(ttf,&ret->yadjust,base + vr->offYplaceDev,info);
if ( vr->offXadvanceDev!=0 )
- ReadDeviceTable(ttf,&ret->xadv,base + vr->offXadvanceDev);
+ ReadDeviceTable(ttf,&ret->xadv,base + vr->offXadvanceDev,info);
if ( vr->offYadvanceDev!=0 )
- ReadDeviceTable(ttf,&ret->yadv,base + vr->offYadvanceDev);
+ ReadDeviceTable(ttf,&ret->yadv,base + vr->offYadvanceDev,info);
return( ret );
}
#endif
@@ -420,7 +443,9 @@ return( ret );
static void addPairPos(struct ttfinfo *info, int glyph1, int glyph2,
struct lookup *l, struct lookup_subtable *subtable, struct valuerecord *vr1,struct valuerecord *vr2,
uint32 base,FILE *ttf) {
-
+ (void)ttf; /* for -Wall */
+ (void)l; /* for -Wall */
+ (void)base; /* for -Wall */
if ( glyph1<info->glyph_cnt && glyph2<info->glyph_cnt ) {
PST *pos = chunkalloc(sizeof(PST));
pos->type = pst_pair;
@@ -438,18 +463,23 @@ static void addPairPos(struct ttfinfo *info, int glyph1, int glyph2,
pos->u.pair.vr[1].h_adv_off = vr2->xadvance;
pos->u.pair.vr[1].v_adv_off = vr2->yadvance;
#ifdef FONTFORGE_CONFIG_DEVICETABLES
- pos->u.pair.vr[0].adjust = readValDevTab(ttf,vr1,base);
- pos->u.pair.vr[1].adjust = readValDevTab(ttf,vr2,base);
+ pos->u.pair.vr[0].adjust = readValDevTab(ttf,vr1,base,info);
+ pos->u.pair.vr[1].adjust = readValDevTab(ttf,vr2,base,info);
#endif
- } else
+ } else {
LogError( _("Bad pair position: glyphs %d & %d should have been < %d\n"),
glyph1, glyph2, info->glyph_cnt );
+ info->bad_ot = true;
+ }
}
static int addKernPair(struct ttfinfo *info, int glyph1, int glyph2,
int16 offset, uint32 devtab, struct lookup *l, struct lookup_subtable *subtable,int isv,
FILE *ttf) {
KernPair *kp;
+ (void)ttf; /* for -Wall */
+ (void)l; /* for -Wall */
+ (void)devtab; /* for -Wall */
if ( glyph1<info->glyph_cnt && glyph2<info->glyph_cnt &&
info->chars[glyph1]!=NULL && info->chars[glyph2]!=NULL ) {
for ( kp=isv ? info->chars[glyph1]->vkerns : info->chars[glyph1]->kerns;
@@ -465,7 +495,7 @@ static int addKernPair(struct ttfinfo *info, int glyph1, int glyph2,
#ifdef FONTFORGE_CONFIG_DEVICETABLES
if ( devtab!=0 ) {
kp->adjust = chunkalloc(sizeof(DeviceTable));
- ReadDeviceTable(ttf,kp->adjust,devtab);
+ ReadDeviceTable(ttf,kp->adjust,devtab,info);
}
#endif
if ( isv ) {
@@ -477,9 +507,12 @@ static int addKernPair(struct ttfinfo *info, int glyph1, int glyph2,
}
} else if ( kp->subtable!=subtable )
return( true );
- } else
+ } else if ( glyph1>=info->glyph_cnt || glyph2>=info->glyph_cnt ) {
+ /* Might be NULL in a ttc file where we omit glyphs */
LogError( _("Bad kern pair: glyphs %d & %d should have been < %d\n"),
glyph1, glyph2, info->glyph_cnt );
+ info->bad_ot = true;
+ }
return( false );
}
@@ -501,15 +534,17 @@ return;
vf1 = getushort(ttf);
vf2 = getushort(ttf);
r2l = 0;
- if ( (vf1==0x0088 || vf1==0x0008) && vf2==0x0000 )
+
+ /* Accept forms both with and without device tables */
+ if ( (vf1==0x0008 || vf1==0x0088) && vf2==0x0000 )
isv = 1; /* Top to bottom */
- else if ( vf1==0x0000 && (vf2==0x0044 || vf2==0x0004)) {
+ else if ( vf1==0x0000 && (vf2==0x0004 || vf2==0x0044) && (l->flags&pst_r2l)) {
isv = 0; /* Right to left */
r2l = 1;
- } else if ( (vf1==0x0044 || vf1==0x0004) && vf2==0x0000 )
+ } else if ( (vf1==0x0004 || vf1==0x0044) && vf2==0x0000 && !(l->flags&pst_r2l) )
isv = 0; /* Left to right */
else
- isv = 2;
+ isv = 2; /* Can't optimize, store all 8 settings */
if ( format==1 ) {
subtable->per_glyph_pst_or_kern = true;
cnt = getushort(ttf);
@@ -554,8 +589,8 @@ return;
cd1 = getushort(ttf);
cd2 = getushort(ttf);
foffset = ftell(ttf);
- class1 = getClassDefTable(ttf, stoffset+cd1, info->glyph_cnt, info->g_bounds);
- class2 = getClassDefTable(ttf, stoffset+cd2, info->glyph_cnt, info->g_bounds);
+ class1 = getClassDefTable(ttf, stoffset+cd1, info);
+ class2 = getClassDefTable(ttf, stoffset+cd2, info);
glyphs = getCoverageTable(ttf,stoffset+coverage,info);
fseek(ttf, foffset, SEEK_SET); /* come back */
c1_cnt = getushort(ttf);
@@ -601,13 +636,13 @@ return;
#ifdef FONTFORGE_CONFIG_DEVICETABLES
if ( isv ) {
if ( vr1.offYadvanceDev!=0 )
- ReadDeviceTable(ttf,&kc->adjusts[i*c2_cnt+j],stoffset+vr1.offYadvanceDev);
+ ReadDeviceTable(ttf,&kc->adjusts[i*c2_cnt+j],stoffset+vr1.offYadvanceDev,info);
} else if ( r2l ) {
if ( vr2.offXadvanceDev!=0 )
- ReadDeviceTable(ttf,&kc->adjusts[i*c2_cnt+j],stoffset+vr2.offXadvanceDev);
+ ReadDeviceTable(ttf,&kc->adjusts[i*c2_cnt+j],stoffset+vr2.offXadvanceDev,info);
} else {
if ( vr1.offXadvanceDev!=0 )
- ReadDeviceTable(ttf,&kc->adjusts[i*c2_cnt+j],stoffset+vr1.offXadvanceDev);
+ ReadDeviceTable(ttf,&kc->adjusts[i*c2_cnt+j],stoffset+vr1.offXadvanceDev,info);
}
#endif
}
@@ -635,10 +670,10 @@ return;
}
static AnchorPoint *readAnchorPoint(FILE *ttf,uint32 base,AnchorClass *class,
- enum anchor_type type,AnchorPoint *last) {
+ enum anchor_type type,AnchorPoint *last, struct ttfinfo *info) {
AnchorPoint *ap;
int format;
-
+ (void)info; /* for -Wall */
fseek(ttf,base,SEEK_SET);
ap = chunkalloc(sizeof(AnchorPoint));
@@ -659,10 +694,10 @@ static AnchorPoint *readAnchorPoint(FILE *ttf,uint32 base,AnchorClass *class,
int devoff;
devoff = getushort(ttf);
if ( devoff!=0 )
- ReadDeviceTable(ttf,&ap->xadjust,base+devoff);
+ ReadDeviceTable(ttf,&ap->xadjust,base+devoff,info);
devoff = getushort(ttf);
if ( devoff!=0 )
- ReadDeviceTable(ttf,&ap->yadjust,base+devoff);
+ ReadDeviceTable(ttf,&ap->yadjust,base+devoff,info);
}
#endif
ap->next = last;
@@ -676,7 +711,7 @@ static void gposCursiveSubTable(FILE *ttf, int stoffset, struct ttfinfo *info,st
AnchorClass *class;
SplineChar *sc;
char buf[50];
-
+ (void)l; /* for -Wall */
format=getushort(ttf);
if ( format!=1 ) /* Unknown subtable format */
return;
@@ -708,11 +743,11 @@ return;
sc = info->chars[glyphs[i]];
if ( offsets[i].entry!=0 ) {
sc->anchor = readAnchorPoint(ttf,stoffset+offsets[i].entry,class,
- at_centry,sc->anchor);
+ at_centry,sc->anchor,info);
}
if ( offsets[i].exit!=0 ) {
sc->anchor = readAnchorPoint(ttf,stoffset+offsets[i].exit,class,
- at_cexit,sc->anchor);
+ at_cexit,sc->anchor,info);
}
}
free(offsets);
@@ -749,6 +784,7 @@ static AnchorClass **MarkGlyphsProcessMarks(FILE *ttf,int markoffset,
cnt = getushort(ttf);
if ( feof(ttf) ) {
LogError( _("Bad mark table.\n") );
+ info->bad_ot = true;
return( NULL );
}
at_offsets = galloc(cnt*sizeof(struct mr));
@@ -757,7 +793,11 @@ return( NULL );
at_offsets[i].offset = getushort(ttf);
if ( at_offsets[i].class>=classcnt ) {
at_offsets[i].class = 0;
- LogError( _("Class out of bounds in GPOS mark sub-table\n") );
+ if ( markglyphs[i]>=info->glyph_cnt )
+ LogError( _("Class out of bounds in GPOS mark sub-table\n") );
+ else
+ LogError( _("Class out of bounds in GPOS mark sub-table for mark %.30s\n"), info->chars[markglyphs[i]]->name);
+ info->bad_ot = true;
}
}
for ( i=0; i<cnt; ++i ) {
@@ -767,7 +807,7 @@ return( NULL );
if ( sc==NULL || at_offsets[i].offset==0 )
continue;
sc->anchor = readAnchorPoint(ttf,markoffset+at_offsets[i].offset,
- classes[at_offsets[i].class],at_mark,sc->anchor);
+ classes[at_offsets[i].class],at_mark,sc->anchor,info);
}
free(at_offsets);
return( classes );
@@ -779,11 +819,13 @@ static void MarkGlyphsProcessBases(FILE *ttf,int baseoffset,
int basecnt,i, j, ibase;
uint16 *offsets;
SplineChar *sc;
-
+ (void)subtable; /* for -Wall */
+ (void)l; /* for -Wall */
fseek(ttf,baseoffset,SEEK_SET);
basecnt = getushort(ttf);
if ( feof(ttf) ) {
LogError( _("Bad base table.\n") );
+ info->bad_ot = true;
return;
}
offsets = galloc(basecnt*classcnt*sizeof(uint16));
@@ -797,7 +839,7 @@ return;
continue;
for ( j=0; j<classcnt; ++j ) if ( offsets[ibase+j]!=0 ) {
sc->anchor = readAnchorPoint(ttf,baseoffset+offsets[ibase+j],
- classes[j], at,sc->anchor);
+ classes[j], at,sc->anchor,info);
}
}
free(offsets);
@@ -809,11 +851,13 @@ static void MarkGlyphsProcessLigs(FILE *ttf,int baseoffset,
int basecnt,compcnt, i, j, k, kbase;
uint16 *loffsets, *aoffsets;
SplineChar *sc;
-
+ (void)subtable; /* for -Wall */
+ (void)l; /* for -Wall */
fseek(ttf,baseoffset,SEEK_SET);
basecnt = getushort(ttf);
if ( feof(ttf) ) {
LogError( _("Bad ligature base table.\n") );
+ info->bad_ot = true;
return;
}
loffsets = galloc(basecnt*sizeof(uint16));
@@ -827,6 +871,7 @@ return;
compcnt = getushort(ttf);
if ( feof(ttf)) {
LogError(_("Bad ligature anchor count.\n"));
+ info->bad_ot = true;
continue;
}
aoffsets = galloc(compcnt*classcnt*sizeof(uint16));
@@ -835,7 +880,7 @@ return;
for ( k=kbase=0; k<compcnt; ++k, kbase+=classcnt ) {
for ( j=0; j<classcnt; ++j ) if ( aoffsets[kbase+j]!=0 ) {
sc->anchor = readAnchorPoint(ttf,baseoffset+loffsets[i]+aoffsets[kbase+j],
- classes[j], at_baselig,sc->anchor);
+ classes[j], at_baselig,sc->anchor,info);
sc->anchor->lig_index = k;
}
}
@@ -879,8 +924,8 @@ return;
MarkGlyphsProcessLigs(ttf,stoffset+baseoffset,
info,l,subtable,baseglyphs,classcnt,classes);
break;
- default:
- break;
+ default:
+ break;
}
info->anchor_class_cnt += classcnt;
++ info->anchor_merge_cnt;
@@ -894,7 +939,7 @@ static void gposSimplePos(FILE *ttf, int stoffset, struct ttfinfo *info,
uint16 format;
uint16 *glyphs;
struct valuerecord *vr=NULL, _vr, *which;
-
+ (void)l; /* for -Wall */
format=getushort(ttf);
if ( format!=1 && format!=2 ) /* Unknown subtable format */
return;
@@ -933,7 +978,7 @@ return;
pos->u.pos.h_adv_off = which->xadvance;
pos->u.pos.v_adv_off = which->yadvance;
#ifdef FONTFORGE_CONFIG_DEVICETABLES
- pos->u.pos.adjust = readValDevTab(ttf,which,stoffset);
+ pos->u.pos.adjust = readValDevTab(ttf,which,stoffset,info);
#endif
}
subtable->per_glyph_pst_or_kern = true;
@@ -944,11 +989,12 @@ return;
static void ProcessSubLookups(FILE *ttf,struct ttfinfo *info,int gpos,
struct lookup *alllooks,struct seqlookup *sl) {
int i;
-
+ (void)ttf; /* for -Wall */
i = (intpt) sl->lookup;
if ( i<0 || i>=info->lookup_cnt ) {
LogError( _("Attempt to reference lookup %d (within a contextual lookup), but there are\n only %d lookups in %s\n"),
i, info->lookup_cnt, gpos ? "'GPOS'" : "'GSUB'" );
+ info->bad_ot = true;
sl->lookup = NULL;
return;
}
@@ -976,7 +1022,7 @@ static void g___ContextSubTable1(FILE *ttf, int stoffset,
FPST *fpst;
struct fpst_rule *rule;
int warned = false, warned2 = false;
-
+ (void)l; /* for -Wall */
coverage = getushort(ttf);
rcnt = getushort(ttf); /* glyph count in coverage table */
rules = galloc(rcnt*sizeof(struct rule));
@@ -1003,8 +1049,9 @@ static void g___ContextSubTable1(FILE *ttf, int stoffset,
if ( !warned )
LogError( _("Bad contextual or chaining sub table. Glyph %d out of range [0,%d)\n"),
rules[i].subrules[j].glyphs[k], info->glyph_cnt );
+ info->bad_ot = true;
warned = true;
- rules[i].subrules[j].glyphs[k] = 0;
+ rules[i].subrules[j].glyphs[k] = 0;
}
}
rules[i].subrules[j].glyphs[k] = 0xffff;
@@ -1015,6 +1062,7 @@ static void g___ContextSubTable1(FILE *ttf, int stoffset,
if ( !warned2 ) {
LogError( _("Attempt to apply a lookup to a location out of the range of this contextual\n lookup seq=%d max=%d\n"),
rules[i].subrules[j].sl[k].seq, rules[i].subrules[j].gcnt );
+ info->bad_ot = true;
warned2 = true;
}
rules[i].subrules[j].sl[k].lookup = (void *) (intpt) getushort(ttf);
@@ -1039,7 +1087,7 @@ static void g___ContextSubTable1(FILE *ttf, int stoffset,
cnt = 0;
for ( i=0; i<rcnt; ++i ) for ( j=0; j<rules[i].scnt; ++j ) {
- rule[cnt].u.glyph.names = GlyphsToNames(info,rules[i].subrules[j].glyphs,false);
+ rule[cnt].u.glyph.names = GlyphsToNames(info,rules[i].subrules[j].glyphs,false);
rule[cnt].lookup_cnt = rules[i].subrules[j].scnt;
rule[cnt].lookups = rules[i].subrules[j].sl;
rules[i].subrules[j].sl = NULL;
@@ -1081,7 +1129,7 @@ static void g___ChainingSubTable1(FILE *ttf, int stoffset,
FPST *fpst;
struct fpst_rule *rule;
int warned = false, warned2 = false;
-
+ (void)l; /* for -Wall */
coverage = getushort(ttf);
rcnt = getushort(ttf); /* glyph count in coverage table */
rules = galloc(rcnt*sizeof(struct rule));
@@ -1105,6 +1153,7 @@ return;
rules[i].subrules[j].bcnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in contextual chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
rules[i].subrules[j].bglyphs = galloc((rules[i].subrules[j].bcnt+1)*sizeof(uint16));
@@ -1115,6 +1164,7 @@ return;
rules[i].subrules[j].gcnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in contextual chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
rules[i].subrules[j].glyphs = galloc((rules[i].subrules[j].gcnt+1)*sizeof(uint16));
@@ -1126,6 +1176,7 @@ return;
rules[i].subrules[j].fcnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in contextual chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
rules[i].subrules[j].fglyphs = galloc((rules[i].subrules[j].fcnt+1)*sizeof(uint16));
@@ -1139,6 +1190,7 @@ return;
if ( !warned )
LogError( _("Bad contextual or chaining sub table. Glyph %d out of range [0,%d)\n"),
(&rules[i].subrules[j].glyphs)[which][k], info->glyph_cnt );
+ info->bad_ot = true;
warned = true;
(&rules[i].subrules[j].glyphs)[which][k] = 0;
}
@@ -1148,6 +1200,7 @@ return;
rules[i].subrules[j].scnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in contextual chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
rules[i].subrules[j].sl = galloc(rules[i].subrules[j].scnt*sizeof(struct seqlookup));
@@ -1157,6 +1210,7 @@ return;
if ( !warned2 ) {
LogError( _("Attempt to apply a lookup to a location out of the range of this contextual\n lookup seq=%d max=%d\n"),
rules[i].subrules[j].sl[k].seq, rules[i].subrules[j].gcnt );
+ info->bad_ot = true;
warned2 = true;
}
rules[i].subrules[j].sl[k].lookup = (void *) (intpt) getushort(ttf);
@@ -1181,9 +1235,9 @@ return;
cnt = 0;
for ( i=0; i<rcnt; ++i ) for ( j=0; j<rules[i].scnt; ++j ) {
- rule[cnt].u.glyph.back = GlyphsToNames(info,rules[i].subrules[j].bglyphs,false);
- rule[cnt].u.glyph.names = GlyphsToNames(info,rules[i].subrules[j].glyphs,false);
- rule[cnt].u.glyph.fore = GlyphsToNames(info,rules[i].subrules[j].fglyphs,false);
+ rule[cnt].u.glyph.back = GlyphsToNames(info,rules[i].subrules[j].bglyphs,false);
+ rule[cnt].u.glyph.names = GlyphsToNames(info,rules[i].subrules[j].glyphs,false);
+ rule[cnt].u.glyph.fore = GlyphsToNames(info,rules[i].subrules[j].fglyphs,false);
rule[cnt].lookup_cnt = rules[i].subrules[j].scnt;
rule[cnt].lookups = rules[i].subrules[j].sl;
rules[i].subrules[j].sl = NULL;
@@ -1226,9 +1280,9 @@ static void g___ContextSubTable2(FILE *ttf, int stoffset,
} *rules;
FPST *fpst;
struct fpst_rule *rule;
- uint16 *class;
+ uint16 *glyphs, *class;
int warned2 = false;
-
+ (void)l; /* for -Wall */
coverage = getushort(ttf);
classoff = getushort(ttf);
rcnt = getushort(ttf); /* class count in coverage table *//* == number of top level rules */
@@ -1236,11 +1290,12 @@ static void g___ContextSubTable2(FILE *ttf, int stoffset,
for ( i=0; i<rcnt; ++i )
rules[i].offsets = getushort(ttf)+stoffset;
cnt = 0;
- for ( i=0; i<rcnt; ++i ) if ( rules[i].offsets!=stoffset ) { /* some classes might be unused */
+ for ( i=0; i<rcnt; ++i ) if ( rules[i].offsets!=(unsigned)stoffset ) { /* some classes might be unused */
fseek(ttf,rules[i].offsets,SEEK_SET);
rules[i].scnt = getushort(ttf);
if ( rules[i].scnt<0 ) {
LogError( _("Bad count in context chaining sub-table.\n") );
+ info->bad_ot = true;
return;
}
cnt += rules[i].scnt;
@@ -1253,6 +1308,7 @@ return;
rules[i].subrules[j].scnt = getushort(ttf);
if ( rules[i].subrules[j].ccnt<0 ) {
LogError( _("Bad class count in contextual chaining sub-table.\n") );
+ info->bad_ot = true;
free(rules);
return;
}
@@ -1262,6 +1318,7 @@ return;
rules[i].subrules[j].classindeces[k] = getushort(ttf);
if ( rules[i].subrules[j].scnt<0 ) {
LogError( _("Bad count in contextual chaining sub-table.\n") );
+ info->bad_ot = true;
free(rules);
return;
}
@@ -1272,6 +1329,7 @@ return;
if ( !warned2 ) {
LogError( _("Attempt to apply a lookup to a location out of the range of this contextual\n lookup seq=%d max=%d\n"),
rules[i].subrules[j].sl[k].seq, rules[i].subrules[j].ccnt-1);
+ info->bad_ot = true;
warned2 = true;
}
rules[i].subrules[j].sl[k].lookup = (void *) (intpt) getushort(ttf);
@@ -1293,10 +1351,14 @@ return;
fpst->rules = rule = gcalloc(cnt,sizeof(struct fpst_rule));
fpst->rule_cnt = cnt;
- class = getClassDefTable(ttf, stoffset+classoff, info->glyph_cnt, info->g_bounds);
+ class = getClassDefTable(ttf, stoffset+classoff, info);
fpst->nccnt = ClassFindCnt(class,info->glyph_cnt);
fpst->nclass = ClassToNames(info,fpst->nccnt,class,info->glyph_cnt);
- free(class); class = NULL;
+
+ /* Just in case they used the coverage table to redefine class 0 */
+ glyphs = getCoverageTable(ttf,stoffset+coverage,info);
+ fpst->nclass[0] = CoverageMinusClasses(glyphs,class,info);
+ free(glyphs); free(class); class = NULL;
cnt = 0;
for ( i=0; i<rcnt; ++i ) for ( j=0; j<rules[i].scnt; ++j ) {
@@ -1342,9 +1404,9 @@ static void g___ChainingSubTable2(FILE *ttf, int stoffset,
} *rules;
FPST *fpst;
struct fpst_rule *rule;
- uint16 *class;
+ uint16 *glyphs, *class;
int warned2 = false;
-
+ (void)l; /* for -Wall */
coverage = getushort(ttf);
bclassoff = getushort(ttf);
classoff = getushort(ttf);
@@ -1361,6 +1423,7 @@ static void g___ChainingSubTable2(FILE *ttf, int stoffset,
rules[i].scnt = getushort(ttf);
if ( rules[i].scnt<0 ) {
LogError( _("Bad count in context chaining sub-table.\n") );
+ info->bad_ot = true;
return;
}
cnt += rules[i].scnt;
@@ -1372,6 +1435,7 @@ return;
rules[i].subrules[j].bccnt = getushort(ttf);
if ( rules[i].subrules[j].bccnt<0 ) {
LogError( _("Bad class count in contextual chaining sub-table.\n") );
+ info->bad_ot = true;
free(rules);
return;
}
@@ -1381,6 +1445,7 @@ return;
rules[i].subrules[j].ccnt = getushort(ttf);
if ( rules[i].subrules[j].ccnt<0 ) {
LogError( _("Bad class count in contextual chaining sub-table.\n") );
+ info->bad_ot = true;
free(rules);
return;
}
@@ -1391,6 +1456,7 @@ return;
rules[i].subrules[j].fccnt = getushort(ttf);
if ( rules[i].subrules[j].fccnt<0 ) {
LogError( _("Bad class count in contextual chaining sub-table.\n") );
+ info->bad_ot = true;
free(rules);
return;
}
@@ -1400,6 +1466,7 @@ return;
rules[i].subrules[j].scnt = getushort(ttf);
if ( rules[i].subrules[j].scnt<0 ) {
LogError( _("Bad count in contextual chaining sub-table.\n") );
+ info->bad_ot = true;
free(rules);
return;
}
@@ -1410,6 +1477,7 @@ return;
if ( !warned2 ) {
LogError( _("Attempt to apply a lookup to a location out of the range of this contextual\n lookup seq=%d max=%d\n"),
rules[i].subrules[j].sl[k].seq, rules[i].subrules[j].ccnt-1);
+ info->bad_ot = true;
warned2 = true;
}
rules[i].subrules[j].sl[k].lookup = (void *) (intpt) getushort(ttf);
@@ -1432,20 +1500,25 @@ return;
fpst->rules = rule = gcalloc(cnt,sizeof(struct fpst_rule));
fpst->rule_cnt = cnt;
- class = getClassDefTable(ttf, stoffset+classoff, info->glyph_cnt, info->g_bounds);
+ class = getClassDefTable(ttf, stoffset+classoff, info);
fpst->nccnt = ClassFindCnt(class,info->glyph_cnt);
fpst->nclass = ClassToNames(info,fpst->nccnt,class,info->glyph_cnt);
- free(class);
+
+ /* Just in case they used the coverage table to redefine class 0 */
+ glyphs = getCoverageTable(ttf,stoffset+coverage,info);
+ fpst->nclass[0] = CoverageMinusClasses(glyphs,class,info);
+ free(glyphs); free(class); class = NULL;
+
/* The docs don't mention this, but in mangal.ttf fclassoff==0 NULL */
if ( bclassoff!=0 )
- class = getClassDefTable(ttf, stoffset+bclassoff, info->glyph_cnt, info->g_bounds);
+ class = getClassDefTable(ttf, stoffset+bclassoff, info);
else
class = gcalloc(info->glyph_cnt,sizeof(uint16));
fpst->bccnt = ClassFindCnt(class,info->glyph_cnt);
fpst->bclass = ClassToNames(info,fpst->bccnt,class,info->glyph_cnt);
free(class);
if ( fclassoff!=0 )
- class = getClassDefTable(ttf, stoffset+fclassoff, info->glyph_cnt, info->g_bounds);
+ class = getClassDefTable(ttf, stoffset+fclassoff, info);
else
class = gcalloc(info->glyph_cnt,sizeof(uint16));
fpst->fccnt = ClassFindCnt(class,info->glyph_cnt);
@@ -1492,11 +1565,12 @@ static void g___ContextSubTable3(FILE *ttf, int stoffset,
FPST *fpst;
struct fpst_rule *rule;
int warned2 = false;
-
+ (void)l; /* for -Wall */
gcnt = getushort(ttf);
scnt = getushort(ttf);
if ( feof(ttf) ) {
- LogError( _("Bad count in context chaining sub-table.\n") );
+ LogError( _("End of file in context chaining sub-table.\n") );
+ info->bad_ot = true;
return;
}
coverage = galloc(gcnt*sizeof(uint16));
@@ -1508,6 +1582,7 @@ return;
if ( sl[k].seq >= gcnt && !warned2 ) {
LogError( _("Attempt to apply a lookup to a location out of the range of this contextual\n lookup seq=%d, max=%d\n"),
sl[k].seq, gcnt-1 );
+ info->bad_ot = true;
warned2 = true;
}
sl[k].lookup = (void *) (intpt) getushort(ttf);
@@ -1553,10 +1628,11 @@ static void g___ChainingSubTable3(FILE *ttf, int stoffset,
FPST *fpst;
struct fpst_rule *rule;
int warned2 = false;
-
+ (void)l; /* for -Wall */
bcnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("End of file in context chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
bcoverage = galloc(bcnt*sizeof(uint16));
@@ -1565,6 +1641,7 @@ return;
gcnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("End of file in context chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
coverage = galloc(gcnt*sizeof(uint16));
@@ -1573,6 +1650,7 @@ return;
fcnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("End of file in context chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
fcoverage = galloc(fcnt*sizeof(uint16));
@@ -1581,6 +1659,7 @@ return;
scnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("End of file in context chaining subtable.\n") );
+ info->bad_ot = true;
return;
}
sl = galloc(scnt*sizeof(struct seqlookup));
@@ -1589,6 +1668,7 @@ return;
if ( sl[k].seq >= gcnt && !warned2 ) {
LogError( _("Attempt to apply a lookup to a location out of the range of this contextual\n lookup seq=%d, max=%d\n"),
sl[k].seq, gcnt-1 );
+ info->bad_ot = true;
warned2 = true;
}
sl[k].lookup = (void *) (intpt) getushort(ttf);
@@ -1755,6 +1835,7 @@ return;
if ( which>=info->glyph_cnt ) {
LogError( _("Bad substitution glyph: GID %d not less than %d\n"),
which, info->glyph_cnt);
+ info->bad_ot = true;
which = 0;
}
if ( info->chars[which]!=NULL ) { /* Might be in a ttc file */
@@ -1793,6 +1874,7 @@ return;
cnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in GSUB sub-table.\n"));
+ info->bad_ot = true;
return;
}
offsets = galloc(cnt*sizeof(uint16));
@@ -1806,6 +1888,7 @@ return;
for ( i=0; glyphs[i]!=0xffff; ++i );
if ( i!=cnt ) {
LogError( _("Coverage table specifies a different number of glyphs than the sub-table expects.\n" ));
+ info->bad_ot = true;
if ( cnt<i )
glyphs[cnt] = 0xffff;
else
@@ -1819,6 +1902,7 @@ return;
cnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in GSUB sub-table.\n"));
+ info->bad_ot = true;
return;
}
if ( cnt>max ) {
@@ -1830,12 +1914,14 @@ return;
glyph2s[j] = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in GSUB sub-table.\n" ));
+ info->bad_ot = true;
return;
}
if ( glyph2s[j]>=info->glyph_cnt ) {
if ( !justinuse )
LogError( _("Bad Multiple/Alternate substitution glyph. GID %d not less than %d\n"),
glyph2s[j], info->glyph_cnt );
+ info->bad_ot = true;
if ( ++badcnt>20 )
return;
glyph2s[j] = 0;
@@ -1886,6 +1972,7 @@ static void gsubLigatureSubTable(FILE *ttf, int stoffset,
cnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in GSUB ligature sub-table.\n" ));
+ info->bad_ot = true;
return;
}
ls_offsets = galloc(cnt*sizeof(uint16));
@@ -1899,6 +1986,7 @@ return;
lig_cnt = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in GSUB ligature sub-table.\n" ));
+ info->bad_ot = true;
return;
}
lig_offsets = galloc(lig_cnt*sizeof(uint16));
@@ -1906,6 +1994,7 @@ return;
lig_offsets[j] = getushort(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file in GSUB ligature sub-table.\n" ));
+ info->bad_ot = true;
return;
}
for ( j=0; j<lig_cnt; ++j ) {
@@ -1914,11 +2003,13 @@ return;
if ( lig>=info->glyph_cnt ) {
LogError( _("Bad ligature glyph. GID %d not less than %d\n"),
lig, info->glyph_cnt );
+ info->bad_ot = true;
lig = 0;
}
cc = getushort(ttf);
if ( cc<0 || cc>100 ) {
LogError( _("Unlikely count of ligature components (%d), I suspect this ligature sub-\n table is garbage, I'm giving up on it.\n"), cc );
+ info->bad_ot = true;
free(glyphs); free(lig_offsets);
return;
}
@@ -1930,6 +2021,7 @@ return;
if ( justinuse==git_normal )
LogError( _("Bad ligature component glyph. GID %d not less than %d (in ligature %d)\n"),
lig_glyphs[k], info->glyph_cnt, lig );
+ info->bad_ot = true;
lig_glyphs[k] = 0;
}
}
@@ -2044,7 +2136,7 @@ static void gsubReverseChainSubTable(FILE *ttf, int stoffset,
uint16 coverage, *bcoverage, *fcoverage, *sglyphs, *glyphs;
FPST *fpst;
struct fpst_rule *rule;
-
+ (void)l; /* for -Wall */
if ( justinuse==git_findnames )
return; /* Don't give names to these guys, they might not be unique */
if ( getushort(ttf)!=1 )
@@ -2065,6 +2157,7 @@ return; /* Don't understand this format type */
if (( sglyphs[i] = getushort(ttf))>=info->glyph_cnt ) {
LogError( _("Bad reverse contextual chaining substitution glyph: %d is not less than %d\n"),
sglyphs[i], info->glyph_cnt );
+ info->bad_ot = true;
sglyphs[i] = 0;
}
sglyphs[i] = 0xffff;
@@ -2131,6 +2224,7 @@ return;
if ( info->last_size_pos!=0 ) {
LogError( _("This font, %s, has multiple GPOS 'size' features. I'm not sure how to interpret that. I shall pick one arbitrarily.\n"),
info->fontname==NULL? _("<Untitled>") : info->fontname );
+ info->bad_ot = true;
return;
}
@@ -2165,6 +2259,7 @@ return;
}
if ( i==2 ) {
LogError(_("The 'size' feature does not seem to follow the standard,\nnor does it conform to Adobe's early misinterpretation of\nthe standard. I cannot parse it.\n") );
+ info->bad_ot = true;
info->design_size = info->design_range_bottom = info->design_range_top = info->fontstyle_id = 0;
info->fontstyle_name = NULL;
} else if ( i==1 ) {
@@ -2179,17 +2274,23 @@ return;
#endif
}
-static struct scripts *readttfscripts(FILE *ttf,int32 pos) {
+static struct scripts *readttfscripts(FILE *ttf,int32 pos, struct ttfinfo *info, int isgpos) {
int i,j,k,cnt;
int deflang, lcnt;
struct scripts *scripts;
+ if ( pos>=(int32)info->g_bounds ) {
+ LogError(_("Attempt to read script data beyond end of %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
fseek(ttf,pos,SEEK_SET);
cnt = getushort(ttf);
if ( cnt<=0 )
return( NULL );
else if ( cnt>1000 ) {
LogError( _("Too many scripts %d\n"), cnt );
+ info->bad_ot = true;
return( NULL );
}
@@ -2216,15 +2317,32 @@ return( NULL );
scripts[i].languages[j].offset = scripts[i].offset+getushort(ttf);
}
for ( j=0; j<lcnt; ++j ) {
+ if ( pos+scripts[i].languages[j].offset>=info->g_bounds ) {
+ LogError(_("Attempt to read script data beyond end of %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
fseek(ttf,pos+scripts[i].languages[j].offset,SEEK_SET);
(void) getushort(ttf); /* lookup ordering table undefined */
scripts[i].languages[j].req = getushort(ttf);
scripts[i].languages[j].fcnt = getushort(ttf);
+ if ( feof(ttf)) {
+ LogError(_("End of file when reading scripts in %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
scripts[i].languages[j].features = galloc(scripts[i].languages[j].fcnt*sizeof(uint16));
for ( k=0; k<scripts[i].languages[j].fcnt; ++k )
scripts[i].languages[j].features[k] = getushort(ttf);
}
}
+
+ if ( feof(ttf)) {
+ LogError(_("End of file in %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
+
return( scripts );
}
@@ -2236,12 +2354,18 @@ static struct feature *readttffeatures(FILE *ttf,int32 pos,int isgpos, struct tt
struct feature *features;
int parameters;
+ if ( pos>=(int32)info->g_bounds ) {
+ LogError(_("Attempt to read feature data beyond end of %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
fseek(ttf,pos,SEEK_SET);
info->feature_cnt = cnt = getushort(ttf);
if ( cnt<=0 )
return( NULL );
else if ( cnt>1000 ) {
LogError( _("Too many features %d\n"), cnt );
+ info->bad_ot = true;
return( NULL );
}
@@ -2252,15 +2376,21 @@ return( NULL );
}
for ( i=0; i<cnt; ++i ) {
+ if ( pos+features[i].offset>=info->g_bounds ) {
+ LogError(_("Attempt to read feature data beyond end of %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
fseek(ttf,pos+features[i].offset,SEEK_SET);
parameters = getushort(ttf);
- if ( features[i].tag==CHR('s','i','z','e') && parameters!=0 )
+ if ( features[i].tag==CHR('s','i','z','e') && parameters!=0 && !feof(ttf))
readttfsizeparameters(ttf,pos+parameters,
pos+parameters+features[i].offset,info);
features[i].lcnt = getushort(ttf);
- if ( features[i].lcnt<0 ) {
- LogError(_("Bad lookup count in feature.\n") );
- features[i].lcnt = 0;
+ if ( feof(ttf) ) {
+ LogError(_("End of file when reading features in %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
}
features[i].lookups = galloc(features[i].lcnt*sizeof(uint16));
for ( j=0; j<features[i].lcnt; ++j )
@@ -2276,6 +2406,12 @@ static struct lookup *readttflookups(FILE *ttf,int32 pos, struct ttfinfo *info,
OTLookup *otlookup, *last=NULL;
struct lookup_subtable *st;
+ if ( pos>=(int32)info->g_bounds ) {
+ LogError(_("Attempt to read lookup data beyond end of %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
+
fseek(ttf,pos,SEEK_SET);
info->lookup_cnt = cnt = getushort(ttf);
info->cur_lookups = NULL;
@@ -2283,6 +2419,7 @@ static struct lookup *readttflookups(FILE *ttf,int32 pos, struct ttfinfo *info,
return( NULL );
else if ( cnt>1000 ) {
LogError( _("Too many lookups %d\n"), cnt );
+ info->bad_ot = true;
return( NULL );
}
@@ -2290,6 +2427,11 @@ return( NULL );
for ( i=0; i<cnt; ++i )
lookups[i].offset = getushort(ttf);
for ( i=0; i<cnt; ++i ) {
+ if ( pos+lookups[i].offset>=info->g_bounds ) {
+ LogError(_("Attempt to read lookup data beyond end of %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
fseek(ttf,pos+lookups[i].offset,SEEK_SET);
lookups[i].type = getushort(ttf);
lookups[i].flags = getushort(ttf);
@@ -2308,6 +2450,11 @@ return( NULL );
otlookup->lookup_type = (isgpos<<8) | lookups[i].type;
otlookup->lookup_flags = lookups[i].flags;
otlookup->lookup_index = i;
+ if ( feof(ttf) ) {
+ LogError(_("End of file when reading lookups in %s table"), isgpos ? "GPOS" : "GSUB" );
+ info->bad_ot = true;
+return( NULL );
+ }
for ( j=0; j<lookups[i].subtabcnt; ++j ) {
st = chunkalloc(sizeof(struct lookup_subtable));
st->next = otlookup->subtables;
@@ -2336,9 +2483,10 @@ static void tagLookupsWithFeature(uint32 script_tag,uint32 lang_tag,
script_tag = DEFAULT_SCRIPT;
for ( i=0; i < feature->lcnt; ++i ) {
- if ( feature->lookups[i]>=info->lookup_cnt )
+ if ( feature->lookups[i]>=info->lookup_cnt ) {
LogError( _("Lookup out of bounds in feature table.\n") );
- else {
+ info->bad_ot = true;
+ } else {
otlookup = lookups[feature->lookups[i]].otlookup;
for ( fl = otlookup->features; fl!=NULL && fl->featuretag!=feature_tag; fl=fl->next );
if ( fl==NULL ) {
@@ -2368,15 +2516,17 @@ return; /* Legal, I'd guess, but not very interesting. Perhaps all lookups are
for ( lang=s->languages, i=0; i<s->langcnt; ++i, ++lang ) {
if ( lang->req==0xffff )
/* Do Nothing */;
- else if ( lang->req>= info->feature_cnt )
+ else if ( lang->req>= info->feature_cnt ) {
LogError( _("Required feature out of bounds in script table.\n") );
- else
+ info->bad_ot = true;
+ } else
tagLookupsWithFeature(s->tag,lang->tag,true,&features[lang->req],
lookups,info);
for ( j=0; j<lang->fcnt; ++j ) {
- if ( lang->features[j]>=info->feature_cnt )
+ if ( lang->features[j]>=info->feature_cnt ) {
LogError( _("Feature out of bounds in script table.\n") );
- else
+ info->bad_ot = true;
+ } else
tagLookupsWithFeature(s->tag,lang->tag,false,&features[lang->features[j]],
lookups,info);
}
@@ -2406,7 +2556,7 @@ static void gposExtensionSubTable(FILE *ttf, int stoffset,
struct lookup *alllooks) {
uint32 base = ftell(ttf), st, offset;
int lu_type;
-
+ (void)stoffset; /* for -Wall */
/* Format = */ getushort(ttf);
lu_type = getushort(ttf);
offset = getlong(ttf);
@@ -2435,14 +2585,18 @@ static void gposExtensionSubTable(FILE *ttf, int stoffset,
break;
case 9:
LogError( _("This font is erroneous: it has a GPOS extension subtable that points to\nanother extension sub-table.\n") );
+ info->bad_ot = true;
break;
/* Any cases added here also need to go in the gposLookupSwitch */
default:
LogError( _("Unknown GPOS sub-table type: %d\n"), lu_type );
+ info->bad_ot = true;
break;
}
- if ( ftell(ttf)>info->gpos_start+info->gpos_length )
+ if ( ftell(ttf)>info->gpos_start+info->gpos_length ) {
LogError( _("Subtable extends beyond end of GPOS table\n") );
+ info->bad_ot = true;
+ }
}
static void gsubExtensionSubTable(FILE *ttf, int stoffset,
@@ -2450,7 +2604,7 @@ static void gsubExtensionSubTable(FILE *ttf, int stoffset,
struct lookup *alllooks) {
uint32 base = ftell(ttf), st, offset;
int lu_type;
-
+ (void)stoffset; /* for -Wall */
/* Format = */ getushort(ttf);
lu_type = getushort(ttf);
offset = getlong(ttf);
@@ -2476,6 +2630,7 @@ static void gsubExtensionSubTable(FILE *ttf, int stoffset,
break;
case 7:
LogError( _("This font is erroneous: it has a GSUB extension subtable that points to\nanother extension sub-table.\n") );
+ info->bad_ot = true;
break;
case 8:
gsubReverseChainSubTable(ttf,st,info,l,subtable,justinuse);
@@ -2483,17 +2638,20 @@ static void gsubExtensionSubTable(FILE *ttf, int stoffset,
/* Any cases added here also need to go in the gsubLookupSwitch */
default:
LogError( _("Unknown GSUB sub-table type: %d\n"), lu_type );
+ info->bad_ot = true;
break;
}
- if ( ftell(ttf)>info->gsub_start+info->gsub_length )
+ if ( ftell(ttf)>info->gsub_start+info->gsub_length ) {
LogError( _("Subtable extends beyond end of GSUB table\n") );
+ info->bad_ot = true;
+ }
}
static void gposLookupSwitch(FILE *ttf, int st,
struct ttfinfo *info, struct lookup *l, struct lookup_subtable *subtable,
struct lookup *alllooks) {
- switch ( l->otlookup->lookup_type ) {
+ switch ( l->type | 0x100 ) {
case gpos_single:
gposSimplePos(ttf,st,info,l,subtable);
break;
@@ -2518,17 +2676,20 @@ static void gposLookupSwitch(FILE *ttf, int st,
/* Any cases added here also need to go in the gposExtensionSubTable */
default:
LogError( _("Unknown GPOS sub-table type: %d\n"), l->otlookup->lookup_type );
+ info->bad_ot = true;
break;
}
- if ( ftell(ttf)>info->gpos_start+info->gpos_length )
+ if ( ftell(ttf)>info->gpos_start+info->gpos_length ) {
LogError( _("Subtable extends beyond end of GPOS table\n") );
+ info->bad_ot = true;
+ }
}
static void gsubLookupSwitch(FILE *ttf, int st,
struct ttfinfo *info, struct lookup *l, struct lookup_subtable *subtable, int justinuse,
struct lookup *alllooks) {
- switch ( l->otlookup->lookup_type ) {
+ switch ( l->type ) {
case gsub_single:
gsubSimpleSubTable(ttf,st,info,l,subtable,justinuse);
break;
@@ -2553,10 +2714,13 @@ static void gsubLookupSwitch(FILE *ttf, int st,
/* Any cases added here also need to go in the gsubExtensionSubTable */
default:
LogError( _("Unknown GSUB sub-table type: %d\n"), l->otlookup->lookup_type );
+ info->bad_ot = true;
break;
}
- if ( ftell(ttf)>info->g_bounds )
+ if ( ftell(ttf)>info->g_bounds ) {
LogError( _("Subtable extends beyond end of GSUB table\n" ));
+ info->bad_ot = true;
+ }
}
static void ScriptsFree(struct scripts *scripts) {
@@ -2613,7 +2777,7 @@ static void ProcessGPOSGSUB(FILE *ttf,struct ttfinfo *info,int gpos,int inusetyp
feature_off = getushort(ttf);
lookup_start = base+getushort(ttf);
- scripts = readttfscripts(ttf,base+script_off);
+ scripts = readttfscripts(ttf,base+script_off,info,gpos);
features = readttffeatures(ttf,base+feature_off,gpos,info);
/* It is legal to have lookups with no features or scripts */
/* For example if all the lookups were controlled by the JSTF table */
@@ -2684,7 +2848,7 @@ return;
mac = getushort(ttf); /* mark attach class */
if ( gclass!=0 ) {
- uint16 *gclasses = getClassDefTable(ttf,info->gdef_start+gclass,info->glyph_cnt, info->g_bounds);
+ uint16 *gclasses = getClassDefTable(ttf,info->gdef_start+gclass, info);
for ( i=0; i<info->glyph_cnt; ++i )
if ( info->chars[i]!=NULL && gclasses[i]!=0 )
info->chars[i]->glyph_class = gclasses[i]+1;
@@ -2692,7 +2856,7 @@ return;
}
if ( mac!=0 ) {
- uint16 *mclasses = getClassDefTable(ttf,info->gdef_start+mac,info->glyph_cnt, info->g_bounds);
+ uint16 *mclasses = getClassDefTable(ttf,info->gdef_start+mac, info);
const char *format_spec = _("MarkClass-%d");
info->mark_class_cnt = ClassFindCnt(mclasses,info->glyph_cnt);
info->mark_classes = ClassToNames(info,info->mark_class_cnt,mclasses,info->glyph_cnt);
@@ -2728,6 +2892,7 @@ return;
sc->possub = pst;
pst->type = pst_lcaret;
pst->subtable = NULL;
+ sc->lig_caret_cnt_fixed = true;
}
caret_base = ftell(ttf);
pst->u.lcaret.cnt = getushort(ttf);
@@ -2749,6 +2914,7 @@ return;
/* in device table = */ getushort(ttf);
} else {
LogError( _("!!!! Unknown caret format %d !!!!\n"), format );
+ info->bad_ot = true;
}
}
free(offsets);
@@ -2787,6 +2953,7 @@ static void readttf_applelookup(FILE *ttf,struct ttfinfo *info,
(!allow_out_of_bounds && last>=info->glyph_cnt )) {
LogError( _("Bad lookup table: format=2 (%d/%d), first=%d last=%d total glyphs in font=%d\n"),
i,cnt,first,last,info->glyph_cnt );
+ info->bad_gx = true;
} else {
if ( apply_default!=NULL )
apply_default(info,prev,first-1,def);
@@ -2810,6 +2977,7 @@ static void readttf_applelookup(FILE *ttf,struct ttfinfo *info,
(!allow_out_of_bounds && last>=info->glyph_cnt )) {
LogError( _("Bad lookup table: format=4 (%d/%d), first=%d last=%d total glyphs in font=%d\n"),
i,cnt,first,last,info->glyph_cnt );
+ info->bad_gx = true;
} else {
here = ftell(ttf);
if ( apply_default!=NULL )
@@ -2833,6 +3001,7 @@ static void readttf_applelookup(FILE *ttf,struct ttfinfo *info,
if ( first>=0xffff || (!allow_out_of_bounds && first>=info->glyph_cnt )) {
LogError( _("Bad lookup table: format=6, first=%d total glyphs in font=%d\n"),
first,info->glyph_cnt );
+ info->bad_gx = true;
} else {
if ( apply_default!=NULL )
apply_default(info,prev,first-1,def);
@@ -2847,6 +3016,7 @@ static void readttf_applelookup(FILE *ttf,struct ttfinfo *info,
if ( first+cnt>=0xffff || (!allow_out_of_bounds && first+cnt>=info->glyph_cnt )) {
LogError( _("Bad lookup table: format=8, first=%d cnt=%d total glyphs in font=%d\n"),
first,cnt,info->glyph_cnt );
+ info->bad_gx = true;
} else {
if ( apply_default!=NULL ) {
apply_default(info,0,first-1,def);
@@ -2857,6 +3027,7 @@ static void readttf_applelookup(FILE *ttf,struct ttfinfo *info,
break;
default:
LogError( _("Invalid lookup table format. %d\n"), format );
+ info->bad_gx = true;
break;
}
}
@@ -2881,6 +3052,20 @@ static void OTLAppend(struct ttfinfo *info,OTLookup *otl,int gpos) {
otl->lookup_index = pos;
}
+static void OTLRemove(struct ttfinfo *info,OTLookup *otl,int gpos) {
+ /* Remove the most recent lookup. We got bad data and can't use it */
+ OTLookup *prev, **base;
+
+ base = gpos ? &info->gpos_lookups : &info->gsub_lookups;
+ if ( *base==otl )
+ *base = NULL;
+ else if ( *base!=NULL ) {
+ for ( prev = *base; prev->next!=NULL && prev->next!=otl; prev = prev->next );
+ prev->next = NULL;
+ }
+ OTLookupFree(otl);
+}
+
static OTLookup *NewMacLookup(struct ttfinfo *info,int gpos) {
OTLookup *otl;
@@ -2917,10 +3102,19 @@ return( subs[nest_index] );
/* GT: a statemachine. The %s is the name of the statemachine('s lookup) */
/* GT: and the %d is n, where this lookup is the n'th defined for this state */
/* GT: machine */
+#ifdef LUA_FF_LIB
+ format = _("%s_ns_%d");
+#else
format = _("%s nested-substitutions %d");
+#endif
name = galloc(strlen(parent->lookup_name)+strlen(format)+10);
sprintf( name, format, parent->lookup_name, nest_index );
otl->lookup_name = name;
+#ifdef LUA_FF_LIB
+ otl->subtables->subtable_name = strconcat(name,"_s");
+#else
+ otl->subtables->subtable_name = strconcat3(name," ",_("subtable"));
+#endif
OTLAppend(info,otl,false);
subs[nest_index] = otl;
return( otl );
@@ -2940,6 +3134,7 @@ static void TTF_SetProp(struct ttfinfo *info,int gnum, int prop) {
if ( gnum<0 || gnum>=info->glyph_cnt ) {
LogError( _("Glyph out of bounds in 'prop' table %d\n"), gnum );
+ info->bad_gx = true;
return;
}
@@ -3011,17 +3206,19 @@ static void TTF_SetLcaret(struct ttfinfo *info, int gnum, int offset, FILE *ttf)
if ( gnum<0 || gnum>=info->glyph_cnt ) {
LogError( _("Glyph out of bounds in 'lcar' table %d\n"), gnum );
+ info->bad_gx = true;
return;
} else if ( (sc=info->chars[gnum])==NULL )
return;
- fseek(ttf,info->lcar_start+offset+6,SEEK_SET); /* skip over the lcar table header */
+ fseek(ttf,info->lcar_start+offset,SEEK_SET);
cnt = getushort(ttf);
pst = chunkalloc(sizeof(PST));
pst->type = pst_lcaret;
pst->subtable = NULL;
pst->next = sc->possub;
sc->possub = pst;
+ sc->lig_caret_cnt_fixed = true;
pst->u.lcaret.cnt = cnt;
pst->u.lcaret.carets = galloc(cnt*sizeof(uint16));
for ( i=0; i<cnt; ++i )
@@ -3064,6 +3261,7 @@ return;
if ( gnum<0 || gnum>=info->glyph_cnt ) {
LogError( _("Glyph out of bounds in 'opbd' table %d\n"), gnum );
+ info->bad_gx = true;
return;
} else if ( (sc=info->chars[gnum])==NULL )
return;
@@ -3169,7 +3367,7 @@ return( info->badgids[i] );
if ( info->badgid_cnt>=info->badgid_max )
info->badgids = grealloc(info->badgids,(info->badgid_max += 20)*sizeof(SplineChar *));
- fake = SplineCharCreate();
+ fake = SplineCharCreate(2);
fake->orig_pos = badgid;
sprintf( name, "Out-Of-Range-GID-%d", badgid );
fake->name = copy(name);
@@ -3189,6 +3387,7 @@ return;
if ( gnum<0 || gnum>=info->glyph_cnt ) {
if ( !info->warned_morx_out_of_bounds_glyph ) {
LogError( _("Glyph out of bounds in 'mort'/'morx' table %d\n"), gnum );
+ info->bad_gx = true;
info->warned_morx_out_of_bounds_glyph = true;
}
sc = CreateBadGid(info,gnum);
@@ -3198,6 +3397,7 @@ return;
if ( gsubs<0 || (gsubs>=info->glyph_cnt && gsubs!=0xffff)) {
if ( !info->warned_morx_out_of_bounds_glyph ) {
LogError( _("Substitute glyph out of bounds in 'mort'/'morx' table %d\n"), gsubs );
+ info->bad_gx = true;
info->warned_morx_out_of_bounds_glyph = true;
}
ssc = CreateBadGid(info,gsubs);
@@ -3295,7 +3495,8 @@ struct statemachine {
int cnt;
};
-static void mort_figure_ligatures(struct statemachine *sm, int lcp, int off, int32 lig_offset) {
+static void mort_figure_ligatures(struct statemachine *sm, int lcp, int off, int32 lig_offset,
+ struct ttfinfo *info) {
uint32 lig;
int i, j, lig_glyph;
PST *pst;
@@ -3313,6 +3514,7 @@ return;
if ( lig&0xc0000000 ) {
if ( lig_offset+1 > sm->length ) {
LogError( _("Invalid ligature offset\n") );
+ info->bad_gx = true;
break;
}
lig_glyph = memushort(sm->data,sm->length,lig_offset);
@@ -3322,6 +3524,7 @@ return;
for ( j=lcp; j<sm->lcp; ++j )
LogError("%d ",sm->lig_comp_glyphs[j]);
LogError("\n");
+ info->bad_gx = true;
} else {
char *comp;
for ( len=0, j=lcp; j<sm->lcp; ++j )
@@ -3362,15 +3565,17 @@ return;
free(comp);
} else {
LogError( _("Bad font: Ligature glyph %d is missing\n"), lig_glyph );
+ info->bad_gx = true;
}
}
} else
- mort_figure_ligatures(sm,lcp-1,off,lig_offset);
+ mort_figure_ligatures(sm,lcp-1,off,lig_offset,info);
lig_offset -= memushort(sm->data,sm->length,2*( ((((int32) lig)<<2)>>2) + i ) );
}
}
-static void follow_mort_state(struct statemachine *sm,int offset,int class) {
+static void follow_mort_state(struct statemachine *sm,int offset,int class,
+ struct ttfinfo *info) {
int state = (offset-sm->stateOffset)/sm->nClasses;
int class_top, class_bottom;
@@ -3382,6 +3587,7 @@ return;
/* GT: This is a reference to "Much Ado About Nothing". The string should read */
/* GT: "A ligature sub-table in Apple's 'mort'/'morx' table is too\ncomplex for me to understand. I shall give up on it.\nYour ligatures may not be complete." */
LogError(_("In an attempt to process the ligatures of this font, I've concluded\nthat the state machine in Apple's mort/morx table is\n(like the learned constable) too cunning to be understood.\nI shall give up on it. Your ligatures may be incomplete.\n") );
+ info->bad_gx = true;
return;
}
sm->states_in_use[state] = true;
@@ -3401,22 +3607,23 @@ return;
if ( flags&0x8000 ) /* Set component */
sm->lig_comp_classes[sm->lcp++] = class;
if ( flags&0x3fff ) {
- mort_figure_ligatures(sm, sm->lcp-1, flags & 0x3fff, 0);
+ mort_figure_ligatures(sm, sm->lcp-1, flags & 0x3fff, 0,info);
} else if ( flags&0x8000 )
- follow_mort_state(sm,newState,(flags&0x4000)?class:-1);
+ follow_mort_state(sm,newState,(flags&0x4000)?class:-1,info);
if ( flags&0x8000 )
--sm->lcp;
}
sm->states_in_use[state] = false;
}
-static void morx_figure_ligatures(struct statemachine *sm, int lcp, int ligindex, int32 lig_offset) {
+static void morx_figure_ligatures(struct statemachine *sm, int lcp, int ligindex, int32 lig_offset,
+ struct ttfinfo *info) {
uint32 lig;
int i, j, lig_glyph;
PST *pst;
int len;
- if ( lcp<0 || sm->ligActOff+4*ligindex+3>sm->length )
+ if ( lcp<0 || sm->ligActOff+4*ligindex+3>(unsigned)sm->length )
return;
lig = memlong(sm->data,sm->length, sm->ligActOff+4*ligindex);
@@ -3426,14 +3633,16 @@ return;
sm->lig_comp_glyphs[lcp] = i;
lig_offset += memushort(sm->data,sm->length,sm->compOff + 2*( ((((int32) lig)<<2)>>2) + i ) );
if ( lig&0xc0000000 ) {
- if ( sm->ligOff+2*lig_offset+1 > sm->length ) {
+ if ( sm->ligOff+2*lig_offset+1 > (unsigned)sm->length ) {
LogError( _("Invalid ligature offset\n") );
+ info->bad_gx = true;
break;
}
lig_glyph = memushort(sm->data,sm->length,sm->ligOff+2*lig_offset);
if ( lig_glyph>=sm->info->glyph_cnt || sm->info->chars[lig_glyph]==NULL ) {
LogError( _("Attempt to make a ligature for (non-existent) glyph %d out of "),
lig_glyph );
+ info->bad_gx = true;
for ( j=lcp; j<sm->lcp; ++j )
LogError("%d ",sm->lig_comp_glyphs[j]);
LogError("\n");
@@ -3471,12 +3680,13 @@ return;
free(comp);
}
} else
- morx_figure_ligatures(sm,lcp-1,ligindex,lig_offset);
+ morx_figure_ligatures(sm,lcp-1,ligindex,lig_offset,info);
lig_offset -= memushort(sm->data,sm->length,sm->compOff + 2*( ((((int32) lig)<<2)>>2) + i ) );
}
}
-static void follow_morx_state(struct statemachine *sm,int state,int class) {
+static void follow_morx_state(struct statemachine *sm,int state,int class,
+ struct ttfinfo *info) {
int class_top, class_bottom;
if ( state<0 || state>=sm->smax || sm->states_in_use[state] || sm->lcp>=MAX_LIG_COMP )
@@ -3485,6 +3695,7 @@ return;
if ( sm->cnt>=10000 ) {
if ( sm->cnt==10000 )
LogError(_("In an attempt to process the ligatures of this font, I've concluded\nthat the state machine in Apple's mort/morx table is\n(like the learned constable) too cunning to be understood.\nI shall give up on it. Your ligatures may be incomplete.\n") );
+ info->bad_gx = true;
return;
}
sm->states_in_use[state] = true;
@@ -3505,9 +3716,9 @@ return;
if ( flags&0x8000 ) /* Set component */
sm->lig_comp_classes[sm->lcp++] = class;
if ( flags&0x2000 ) {
- morx_figure_ligatures(sm, sm->lcp-1, ligindex, 0);
+ morx_figure_ligatures(sm, sm->lcp-1, ligindex, 0,info);
} else if ( flags&0x8000 )
- follow_morx_state(sm,newState,(flags&0x4000)?class:-1);
+ follow_morx_state(sm,newState,(flags&0x4000)?class:-1,info);
if ( flags&0x8000 )
--sm->lcp;
}
@@ -3528,6 +3739,7 @@ static void readttf_mortx_lig(FILE *ttf,struct ttfinfo *info,int ismorx,uint32 b
if ( fread(sm.data,1,length,ttf)!=length ) {
free(sm.data);
LogError( _("Bad mort ligature table. Not long enough\n"));
+ info->bad_gx = true;
return;
}
fseek(ttf,here,SEEK_SET);
@@ -3550,7 +3762,7 @@ return;
mortclass_apply_values,mortclass_apply_value,NULL,NULL,true);
sm.smax = length/(2*sm.nClasses);
sm.states_in_use = gcalloc(sm.smax,sizeof(uint8));
- follow_morx_state(&sm,0,-1);
+ follow_morx_state(&sm,0,-1,info);
} else {
sm.nClasses = memushort(sm.data,sm.length, 0);
sm.classOffset = memushort(sm.data,sm.length, sizeof(uint16));
@@ -3568,7 +3780,7 @@ return;
sm.classes[first+i] = sm.data[sm.classOffset+2*sizeof(uint16)+i];
sm.smax = length/sm.nClasses;
sm.states_in_use = gcalloc(sm.smax,sizeof(uint8));
- follow_mort_state(&sm,sm.stateOffset,-1);
+ follow_mort_state(&sm,sm.stateOffset,-1,info);
}
free(sm.data);
free(sm.states_in_use);
@@ -3640,6 +3852,7 @@ static struct statetable *read_statetable(FILE *ttf, int ent_extras, int ismorx,
if ( /*st->classes2[i]<0 ||*/ st->classes2[i]>=st->nclasses ) {
if ( !error )
LogError( _("Bad class in state machine.\n" ));
+ info->bad_gx = true;
error = true;
st->classes2[i] = 1; /* Out of bounds */
}
@@ -3649,6 +3862,7 @@ static struct statetable *read_statetable(FILE *ttf, int ent_extras, int ismorx,
st->nglyphs = getushort(ttf);
if ( feof(ttf)) {
LogError(_("Bad glyph count in mort table.\n"));
+ info->bad_gx = true;
st->nglyphs = 0;
}
st->classes = galloc(st->nglyphs);
@@ -3657,6 +3871,7 @@ static struct statetable *read_statetable(FILE *ttf, int ent_extras, int ismorx,
if ( /*st->classes[i]<0 ||*/ st->classes[i]>=st->nclasses ) {
if ( !error )
LogError( _("Bad class in state machine.\n" ));
+ info->bad_gx = true;
error = true;
st->classes[i] = 1; /* Out of bounds */
}
@@ -3682,7 +3897,7 @@ static struct statetable *read_statetable(FILE *ttf, int ent_extras, int ismorx,
state_max = 2; ent_max = 0;
while ( old_state_max!=state_max ) {
i = old_state_max*nclasses;
- fseek(ttf,here+state_off+(ismorx?i*sizeof(uint16):i),SEEK_SET);
+ fseek(ttf,here+state_off+(ismorx?(int)(i*sizeof(uint16)):i),SEEK_SET);
old_state_max = state_max;
for ( ; i<state_max*nclasses; ++i ) {
ent = ismorx ? getushort(ttf) : getc(ttf);
@@ -3693,6 +3908,7 @@ static struct statetable *read_statetable(FILE *ttf, int ent_extras, int ismorx,
break;
if ( ent_max>1000 ) {
LogError( _("It looks to me as though there's a morx sub-table with more than 1000\n transitions. Which makes me think there's probably an error\n" ));
+ info->bad_gx = true;
free(st);
return( NULL );
}
@@ -3711,6 +3927,7 @@ return( NULL );
}
if ( state_max>1000 ) {
LogError( _("It looks to me as though there's a morx sub-table with more than 1000\n states. Which makes me think there's probably an error\n" ));
+ info->bad_gx = true;
free(st);
return( NULL );
}
@@ -3939,9 +4156,9 @@ static void read_perglyph_subs(FILE *ttf,struct ttfinfo *info,
continue;
if ( subs==0 ) /* A little risky, one could substitute notdef */
continue; /* but they shouldn't */
- if ( here<subs_base )
+ if ( here<(unsigned)subs_base )
continue;
- if ( here>=subs_end )
+ if ( here>=(unsigned)subs_end )
break;
if ( evermarked ) {
if ( used[(here-subs_base)/2] )
@@ -4086,7 +4303,7 @@ return(NULL);
if ( index>index_max ) index_max = index;
}
}
- subs = gcalloc(index_max,sizeof(OTLookup *));
+ subs = gcalloc(index_max+1,sizeof(OTLookup *));
for ( i=0; i<st->nclasses*st->nstates; ++i ) {
if ( as->state[i].u.context.mark_lookup!=NULL ) {
@@ -4181,6 +4398,28 @@ return(NULL);
return( as );
}
+static int InfoHasGSUBTag(struct ttfinfo *info, uint32 tag, int apple_lookup_type) {
+ OTLookup *otl;
+ FeatureScriptLangList *feat;
+
+ if ( apple_lookup_type==0 || /* Indic rearrangement */
+ apple_lookup_type==1 || /* Contextual substitution */
+ apple_lookup_type==5 ) /* Contextual insertion */
+return( false ); /* These types can either not be represented in OT */
+ /* or not converted to AAT -- so we'd better read them */
+ /* We can't really do contextual ligatures either, but we parse that table*/
+ /* for the non-contextual ligs (which is most of them) */
+
+ for ( otl = info->gsub_lookups; otl!=NULL; otl=otl->next ) {
+ for ( feat = otl->features; feat!=NULL; feat=feat->next ) {
+ if ( feat->featuretag == tag &&
+ Macable(NULL,otl))
+return( true );
+ }
+ }
+return( false );
+}
+
static void FeatMarkAsEnabled(struct ttfinfo *info,int featureType,
int featureSetting);
@@ -4194,7 +4433,7 @@ static uint32 readmortchain(FILE *ttf,struct ttfinfo *info, uint32 base, int ism
uint32 tag;
struct tagmaskfeature { uint32 tag, enable_flags; uint16 ismac, feat, set; } tmf[32];
int r2l;
-
+ (void)base; /* for -Wall */
default_flags = getlong(ttf);
chain_len = getlong(ttf);
if ( ismorx ) {
@@ -4206,7 +4445,7 @@ static uint32 readmortchain(FILE *ttf,struct ttfinfo *info, uint32 base, int ism
}
k = 0;
- for ( i=0; i<nfeatures; ++i ) {
+ for ( i=0; i<(int)nfeatures; ++i ) {
featureType = getushort(ttf);
featureSetting = getushort(ttf);
enable_flags = getlong(ttf);
@@ -4232,7 +4471,7 @@ return( chain_len );
if ( k==0 )
return( chain_len );
- for ( i=0; i<nsubtables; ++i ) {
+ for ( i=0; i<(int)nsubtables; ++i ) {
here = ftell(ttf);
if ( ismorx ) {
length = getlong(ttf);
@@ -4261,7 +4500,16 @@ return( chain_len );
info->mort_r2l = r2l;
info->mort_tag_mac = tmf[j].ismac;
info->mort_feat = tmf[j].feat; info->mort_setting = tmf[j].set;
- switch( coverage&0xff ) {
+ /* If we've already read gsub. And this feature setting matches */
+ /* and opentype feature tag. And we've got an OpenType lookup */
+ /* attached to that feature tag. And it's a lookup type we can */
+ /* convert... Then don't parse this sub-table, we shall assume */
+ /* it is simply a duplicate of the OT version */
+ if ( info->gsub_start!=0 &&
+ (tag = MacFeatureToOTTag(tmf[j].feat,tmf[j].set))!=0 &&
+ InfoHasGSUBTag(info,tag,coverage&0xff))
+ /* Skip it */;
+ else switch( coverage&0xff ) {
case 0: /* Indic rearangement */
readttf_mortx_asm(ttf,info,ismorx,length,asm_indic,0,
coverage,NULL);
@@ -4327,6 +4575,7 @@ return;
nchains = getlong(ttf);
if ( feof(ttf)) {
LogError( _("Unexpected end of file found in morx chain.\n" ));
+ info->bad_gx = true;
return;
}
info->mort_max = nchains*33; /* Maximum of one feature per bit ? */
@@ -4335,6 +4584,7 @@ return;
len = readmortchain(ttf,info,base,ismorx);
if ( feof(ttf)) {
LogError( _("Unexpected end of file found in morx chain.\n"));
+ info->bad_gx = true;
break;
}
fseek(ttf,here+len,SEEK_SET);
@@ -4423,6 +4673,10 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
/* format 0, horizontal kerning data (as pairs) not perpendicular */
chars = tupleIndex==-1 ? info->chars : info->variations->tuples[tupleIndex].chars;
npairs = getushort(ttf);
+ if ( version==0 && (len-14 != 6*npairs || npairs>10920 )) {
+ LogError( _("In the 'kern' table, a subtable's length does not match the number of kerning pairs.") );
+ info->bad_gx = true;
+ }
/* searchRange = */ getushort(ttf);
/* entrySelector = */ getushort(ttf);
/* rangeShift = */ getushort(ttf);
@@ -4446,9 +4700,12 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
kp->next = chars[left]->kerns;
chars[left]->kerns = kp;
}
- } else
+ } else if ( left>=info->glyph_cnt || right>=info->glyph_cnt ) {
+ /* Holes happen when reading ttc files. They are probably ok */
LogError( _("Bad kern pair: glyphs %d & %d must be less than %d\n"),
left, right, info->glyph_cnt );
+ info->bad_gx = true;
+ }
}
InfoNameOTLookup(otl,info);
} else if ( flags_good && format==1 ) {
@@ -4489,8 +4746,8 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
right = getushort(ttf);
array = getushort(ttf);
kc->second_cnt = rowWidth/sizeof(uint16);
- class1 = getAppleClassTable(ttf, begin_table+left, info->glyph_cnt, array, rowWidth );
- class2 = getAppleClassTable(ttf, begin_table+right, info->glyph_cnt, 0, sizeof(uint16) );
+ class1 = getAppleClassTable(ttf, begin_table+left, info->glyph_cnt, array, rowWidth, info );
+ class2 = getAppleClassTable(ttf, begin_table+right, info->glyph_cnt, 0, sizeof(uint16), info );
for ( i=0; i<info->glyph_cnt; ++i )
if ( class1[i]>kc->first_cnt )
kc->first_cnt = class1[i];
@@ -4512,9 +4769,11 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
kc->first_cnt = getc(ttf);
kc->second_cnt = getc(ttf);
flags = getc(ttf);
- if ( gc>info->glyph_cnt )
+ if ( gc>info->glyph_cnt ) {
LogError( _("Kerning subtable 3 says the glyph count is %d, but maxp says %d\n"),
gc, info->glyph_cnt );
+ info->bad_gx = true;
+ }
class1 = gcalloc(gc>info->glyph_cnt?gc:info->glyph_cnt,sizeof(uint16));
class2 = gcalloc(gc>info->glyph_cnt?gc:info->glyph_cnt,sizeof(uint16));
kvs = galloc(kv*sizeof(int16));
@@ -4546,7 +4805,11 @@ void readttfkerns(FILE *ttf,struct ttfinfo *info) {
kc->subtable = otl->subtables;
InfoNameOTLookup(otl,info);
} else {
+ LogError(_("Invalid or unsupported format (%d) for subtable of 'kern' table"), format );
+ info->bad_gx = true;
fseek(ttf,len-header_size,SEEK_CUR);
+ if ( otl!=NULL )
+ OTLRemove(info,otl,true);
}
}
}
@@ -4564,6 +4827,7 @@ void readmacfeaturemap(FILE *ttf,struct ttfinfo *info) {
/* reserved */ getlong(ttf);
if ( feof(ttf)) {
LogError( _("End of file in feat table.\n" ));
+ info->bad_gx = true;
return;
}
@@ -4587,6 +4851,7 @@ return;
if ( feof(ttf)) {
free(fs);
LogError( _("End of file in feat table.\n" ));
+ info->bad_gx = true;
return;
}
}
@@ -4607,6 +4872,7 @@ return;
if ( feof(ttf)) {
free(fs);
LogError( _("End of file in feat table.\n") );
+ info->bad_gx = true;
return;
}
}
@@ -4633,3 +4899,696 @@ return;
}
return;
}
+
+/******************************************************************************/
+/* ******************************* MATH Table ******************************* */
+/* ********************** (Not strictly OpenType yet) *********************** */
+/******************************************************************************/
+
+/* ******************************** Read MATH ******************************* */
+
+static void ttf_math_read_constants(FILE *ttf,struct ttfinfo *info, uint32 start) {
+ struct MATH *math;
+ int i;
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ uint16 off;
+#endif
+
+ fseek(ttf,start,SEEK_SET);
+ info->math = math = gcalloc(1,sizeof(struct MATH));
+
+ for ( i=0; math_constants_descriptor[i].script_name!=NULL; ++i ) {
+ int16 *pos = (int16 *) (((char *) (math)) + math_constants_descriptor[i].offset );
+ if ( pos == (int16 *) &math->MinConnectorOverlap )
+ continue; /* Actually lives in the Variant table, not here */
+ *pos = getushort(ttf);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ if ( math_constants_descriptor[i].devtab_offset >= 0 ) {
+ DeviceTable **devtab = (DeviceTable **) (((char *) (math)) + math_constants_descriptor[i].devtab_offset );
+ off = getushort(ttf);
+ if ( off!=0 ) {
+ *devtab = chunkalloc(sizeof(DeviceTable));
+ ReadDeviceTable(ttf,*devtab,start+off,info);
+ }
+ }
+#else
+ /* No support for device tables, skip it */
+ if ( math_constants_descriptor[i].devtab_offset != -1 )
+ (void) getushort(ttf);
+#endif
+ }
+}
+
+static void ttf_math_read_icta(FILE *ttf,struct ttfinfo *info, uint32 start, int is_ic) {
+ /* The italic correction and top accent sub-tables have the same format */
+ int coverage, cnt, i, val, offset;
+ uint16 *glyphs;
+
+ fseek(ttf,start,SEEK_SET);
+ coverage = getushort(ttf);
+ cnt = getushort(ttf);
+ glyphs = getCoverageTable(ttf,start+coverage,info);
+ if ( glyphs==NULL )
+return;
+ fseek(ttf,start+4,SEEK_SET);
+ for ( i=0; i<cnt; ++i ) if ( glyphs[i]<info->glyph_cnt && info->chars[ glyphs[i]]!=NULL ) {
+ val = (int16) getushort(ttf);
+ if ( is_ic )
+ info->chars[ glyphs[i] ]->italic_correction = val;
+ else
+ info->chars[ glyphs[i] ]->top_accent_horiz = val;
+ offset = getushort(ttf);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ if ( offset!=0 ) {
+ DeviceTable *dv = chunkalloc(sizeof(DeviceTable));
+ ReadDeviceTable(ttf,dv,start+offset,info);
+ if ( is_ic )
+ info->chars[ glyphs[i] ]->italic_adjusts = dv;
+ else
+ info->chars[ glyphs[i] ]->top_accent_adjusts = dv;
+ }
+#endif
+ }
+ free(glyphs);
+}
+
+static void ttf_math_read_extended(FILE *ttf,struct ttfinfo *info, uint32 start) {
+ int i;
+ uint16 *glyphs;
+
+ glyphs = getCoverageTable(ttf,start,info);
+ if ( glyphs==NULL )
+return;
+ for ( i=0; glyphs[i]!=0xffff; ++i ) if ( glyphs[i]<info->glyph_cnt && info->chars[ glyphs[i]]!=NULL )
+ info->chars[ glyphs[i] ]->is_extended_shape = true;
+ free(glyphs);
+}
+
+static void ttf_math_read_mathkernv(FILE *ttf, uint32 start,struct mathkernvertex *mkv,
+ SplineChar *sc, int istop, struct ttfinfo *info) {
+ int cnt, i;
+ (void)info; /* for -Wall */
+ fseek(ttf,start,SEEK_SET);
+ /* There is one more width than height. I store the width count */
+ /* and guess a dummy height later */
+ mkv->cnt = cnt = getushort(ttf)+1;
+ mkv->mkd = gcalloc(cnt,sizeof(struct mathkerndata));
+
+ for ( i=0; i<cnt-1; ++i ) {
+ mkv->mkd[i].height = getushort(ttf);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ mkv->mkd[i].height_adjusts = (void *) (intpt) getushort(ttf);
+#else
+ (void) getushort(ttf);
+#endif
+ }
+
+ for ( i=0; i<cnt; ++i ) {
+ mkv->mkd[i].kern = getushort(ttf);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ mkv->mkd[i].kern_adjusts = (void *) (intpt) getushort(ttf);
+#else
+ (void) getushort(ttf);
+#endif
+ }
+
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ for ( i=0; i<cnt; ++i ) {
+ DeviceTable *dv;
+ uint32 offset;
+ if ( mkv->mkd[i].height_adjusts!=NULL ) {
+ offset = start + (intpt) mkv->mkd[i].height_adjusts;
+ mkv->mkd[i].height_adjusts = dv = chunkalloc(sizeof(DeviceTable));
+ ReadDeviceTable(ttf,dv,offset,info);
+ }
+ if ( mkv->mkd[i].kern_adjusts!=NULL ) {
+ offset = start + (intpt) mkv->mkd[i].kern_adjusts;
+ mkv->mkd[i].kern_adjusts = dv = chunkalloc(sizeof(DeviceTable));
+ ReadDeviceTable(ttf,dv,offset,info);
+ }
+ }
+#endif
+
+ if ( cnt>=3 )
+ mkv->mkd[cnt-1].height = 2*mkv->mkd[cnt-2].height - mkv->mkd[cnt-3].height;
+ else if ( cnt>=2 )
+ mkv->mkd[cnt-1].height = mkv->mkd[cnt-2].height + 100;
+ else if ( cnt==1 ) {
+ if ( istop ) {
+ DBounds b;
+ SplineCharQuickBounds(sc,&b);
+ mkv->mkd[cnt-1].height = b.maxy;
+ } else
+ mkv->mkd[cnt-1].height = 0;
+ }
+}
+
+static void ttf_math_read_mathkern(FILE *ttf,struct ttfinfo *info, uint32 start) {
+ int coverage, cnt, i;
+ uint16 *glyphs;
+ struct koff { uint16 tr, tl, br, bl; } *koff;
+
+ fseek(ttf,start,SEEK_SET);
+ coverage = getushort(ttf);
+ cnt = getushort(ttf);
+ koff = galloc(cnt*sizeof(struct koff));
+ for ( i=0; i<cnt; ++i ) {
+ koff[i].tr = getushort(ttf);
+ koff[i].tl = getushort(ttf);
+ koff[i].br = getushort(ttf);
+ koff[i].bl = getushort(ttf);
+ }
+ glyphs = getCoverageTable(ttf,start+coverage,info);
+ if ( glyphs==NULL ) {
+ free(koff);
+return;
+ }
+ for ( i=0; i<cnt; ++i ) if ( glyphs[i]<info->glyph_cnt && info->chars[ glyphs[i]]!=NULL ) {
+ SplineChar *sc = info->chars[ glyphs[i]];
+ sc->mathkern = chunkalloc(sizeof(struct mathkern));
+ if ( koff[i].tr!=0 )
+ ttf_math_read_mathkernv(ttf,start+koff[i].tr,&sc->mathkern->top_right,sc,true,info);
+ if ( koff[i].tl!=0 )
+ ttf_math_read_mathkernv(ttf,start+koff[i].tl,&sc->mathkern->top_left,sc,true,info);
+ if ( koff[i].br!=0 )
+ ttf_math_read_mathkernv(ttf,start+koff[i].br,&sc->mathkern->bottom_right,sc,false,info);
+ if ( koff[i].bl!=0 )
+ ttf_math_read_mathkernv(ttf,start+koff[i].bl,&sc->mathkern->bottom_left,sc,false,info);
+ }
+ free(koff);
+ free(glyphs);
+}
+
+static void ttf_math_read_glyphinfo(FILE *ttf,struct ttfinfo *info, uint32 start) {
+ int icoff,taoff,esoff,kioff;
+
+ fseek(ttf,start,SEEK_SET);
+ icoff = getushort(ttf);
+ taoff = getushort(ttf);
+ esoff = getushort(ttf);
+ kioff = getushort(ttf);
+
+ if ( icoff!=0 )
+ ttf_math_read_icta(ttf,info,start+icoff,true);
+ if ( taoff!=0 )
+ ttf_math_read_icta(ttf,info,start+taoff,false);
+ if ( esoff!=0 )
+ ttf_math_read_extended(ttf,info,start+esoff);
+ if ( kioff!=0 )
+ ttf_math_read_mathkern(ttf,info,start+kioff);
+}
+
+static struct glyphvariants *ttf_math_read_gvtable(FILE *ttf,struct ttfinfo *info, uint32 start,
+ enum gsub_inusetype justinuse, SplineChar *basesc, int isv ) {
+ struct glyphvariants *gv = chunkalloc(sizeof(struct glyphvariants));
+ int ga_offset;
+ int vcnt;
+ uint16 *glyphs;
+ int i, j, len;
+ char *pt;
+ int ic_offset, pcnt;
+ SplineChar *sc;
+ char ebuf[10], buffer[50], *ext;
+
+ fseek(ttf,start,SEEK_SET);
+ ga_offset = getushort(ttf);
+ vcnt = getushort(ttf);
+ if ( vcnt!=0 ) {
+ if ( justinuse==git_justinuse ) {
+ for ( i=0; i<vcnt; ++i ) {
+ int gid = getushort(ttf);
+ /* sizes[i] = */ getushort(ttf);
+ if ( gid>=0 && gid<info->glyph_cnt )
+ info->inuse[gid] = true;
+ }
+ } else if ( justinuse==git_findnames ) {
+ for ( i=0; i<vcnt; ++i ) {
+ int gid = getushort(ttf);
+ /* sizes[i] = */ getushort(ttf);
+ if ( basesc!=NULL && basesc->name!=NULL &&
+ gid>=0 && gid<info->glyph_cnt &&
+ (sc = info->chars[gid])!=NULL && sc->name==NULL ) {
+ snprintf(buffer,sizeof(buffer),"%.30s.%csize%d",
+ basesc->name, isv?'v':'h', i);
+ sc->name = copy(buffer);
+ }
+ }
+ } else {
+ glyphs = galloc(vcnt*sizeof(uint16));
+ len = 0;
+ for ( i=0; i<vcnt; ++i ) {
+ glyphs[i] = getushort(ttf);
+ /* sizes[i] = */ getushort(ttf);
+ if ( glyphs[i]<info->glyph_cnt && (sc = info->chars[ glyphs[i]])!=NULL )
+ len += strlen(sc->name)+1;
+ }
+ if ( len!=0 ) {
+ gv->variants = pt = galloc(len);
+ for ( i=len=0; i<vcnt; ++i ) {
+ if ( glyphs[i]<info->glyph_cnt && (sc = info->chars[ glyphs[i]])!=NULL ) {
+ strcpy(pt+len,sc->name);
+ len += strlen(sc->name);
+ pt[len++] = ' ';
+ }
+ }
+ pt[len-1] = '\0';
+ }
+ free(glyphs);
+ }
+ }
+ if ( ga_offset!=0 ) {
+ start += ga_offset;
+ fseek(ttf,start,SEEK_SET);
+ gv->italic_correction = getushort(ttf);
+ ic_offset = getushort(ttf);
+ gv->part_cnt = pcnt = getushort(ttf);
+ if ( justinuse==git_normal )
+ gv->parts = gcalloc(pcnt,sizeof(struct gv_part));
+ for ( i=j=0; i<pcnt; ++i ) {
+ int gid, start, end, full, flags;
+ gid = getushort(ttf);
+ start = getushort(ttf);
+ end = getushort(ttf);
+ full = getushort(ttf);
+ flags = getushort(ttf);
+ if ( feof(ttf)) {
+ LogError( _("Bad glyph variant subtable of MATH table.\n") );
+ info->bad_ot = true;
+ chunkfree(gv,sizeof(*gv));
+return( NULL );
+ }
+ if ( justinuse==git_justinuse ) {
+ if ( gid<info->glyph_cnt )
+ info->inuse[gid] = true;
+ } else if ( justinuse==git_findnames ) {
+ if ( basesc!=NULL && basesc->name!=NULL &&
+ gid>=0 && gid<info->glyph_cnt &&
+ (sc = info->chars[gid])!=NULL && sc->name==NULL ) {
+ if ( pcnt==1 )
+ ext = "repeat";
+ if ( i==0 )
+ ext = isv ? "bot" : "left";
+ else if ( i==pcnt-1 )
+ ext = isv ? "top" : "right";
+ else if ( i==1 && pcnt==3 )
+ ext = "mid";
+ else {
+ sprintf( ebuf, "%cpart%d", isv?'v':'h', i );
+ ext = ebuf;
+ }
+ snprintf(buffer,sizeof(buffer),"%.30s.%s",
+ basesc->name, ext );
+ sc->name = copy(buffer);
+ }
+ } else {
+ if ( gid<info->glyph_cnt && (sc = info->chars[gid])!=NULL ) {
+ gv->parts[j].component = copy( sc->name );
+ gv->parts[j].startConnectorLength = start;
+ gv->parts[j].endConnectorLength = end;
+ gv->parts[j].fullAdvance = full;
+ gv->parts[j++].is_extender = flags&1;
+ }
+ }
+ }
+ gv->part_cnt = j;
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ if ( ic_offset!=0 && justinuse==git_normal ) {
+ gv->italic_adjusts = chunkalloc(sizeof(DeviceTable));
+ ReadDeviceTable(ttf,gv->italic_adjusts,start+ic_offset,info);
+ }
+#endif
+ }
+ if ( justinuse==git_justinuse ) {
+ chunkfree(gv,sizeof(*gv));
+return( NULL );
+ }
+return( gv );
+}
+
+static void ttf_math_read_variants(FILE *ttf,struct ttfinfo *info, uint32 start,
+ enum gsub_inusetype justinuse) {
+ int vcoverage, hcoverage, vcnt, hcnt;
+ int *hoffs, *voffs;
+ uint16 *hglyphs, *vglyphs;
+ int i;
+
+ fseek(ttf,start,SEEK_SET);
+ if ( info->math==NULL )
+ info->math = gcalloc(1,sizeof(struct MATH));
+ info->math->MinConnectorOverlap = getushort(ttf);
+ vcoverage = getushort(ttf);
+ hcoverage = getushort(ttf);
+ vcnt = getushort(ttf);
+ hcnt = getushort(ttf);
+ hoffs = galloc(hcnt*sizeof(int));
+ voffs = galloc(vcnt*sizeof(int));
+
+ for ( i=0; i<vcnt; ++i )
+ voffs[i] = getushort(ttf);
+ for ( i=0; i<hcnt; ++i )
+ hoffs[i] = getushort(ttf);
+ vglyphs = hglyphs = NULL;
+ if ( vcoverage!=0 )
+ vglyphs = getCoverageTable(ttf,start+vcoverage,info);
+ if ( hcoverage!=0 )
+ hglyphs = getCoverageTable(ttf,start+hcoverage,info);
+
+ if ( vglyphs!=NULL ) {
+ for ( i=0; i<vcnt; ++i ) if ( vglyphs[i]<info->glyph_cnt && voffs[i]!=0) {
+ if ( justinuse == git_normal || justinuse == git_findnames ) {
+ SplineChar *sc = info->chars[ vglyphs[i]];
+ if ( sc!=NULL )
+ sc->vert_variants = ttf_math_read_gvtable(ttf,info,start+voffs[i],justinuse,sc,true);
+ } else if ( info->inuse[ vglyphs[i]])
+ ttf_math_read_gvtable(ttf,info,start+voffs[i],justinuse,NULL,true);
+ }
+ }
+ if ( hglyphs!=NULL ) {
+ for ( i=0; i<hcnt; ++i ) if ( hglyphs[i]<info->glyph_cnt && hoffs[i]!=0) {
+ if ( justinuse == git_normal || justinuse == git_findnames ) {
+ SplineChar *sc = info->chars[ hglyphs[i]];
+ if ( sc!=NULL )
+ sc->horiz_variants = ttf_math_read_gvtable(ttf,info,start+hoffs[i],justinuse,sc,false);
+ } else if ( info->inuse[ hglyphs[i]])
+ ttf_math_read_gvtable(ttf,info,start+hoffs[i],justinuse,NULL,false);
+ }
+ }
+
+ free(vglyphs); free(voffs);
+ free(hglyphs); free(hoffs);
+}
+
+static void _otf_read_math(FILE *ttf,struct ttfinfo *info,
+ enum gsub_inusetype justinuse) {
+ int constants, glyphinfo, variants;
+ if ( info->math_start==0 )
+return;
+ fseek(ttf,info->math_start,SEEK_SET);
+
+ info->g_bounds = info->math_start+info->math_length;
+
+ if ( getlong(ttf)!=0x00010000 )
+return;
+ constants = getushort(ttf);
+ glyphinfo = getushort(ttf);
+ variants = getushort(ttf);
+
+ if ( justinuse == git_normal ) {
+ if ( constants!=0 )
+ ttf_math_read_constants(ttf,info,info->math_start+constants);
+ if ( glyphinfo!=0 )
+ ttf_math_read_glyphinfo(ttf,info,info->math_start+glyphinfo);
+ }
+ if ( variants!=0 )
+ ttf_math_read_variants(ttf,info,info->math_start+variants,justinuse);
+ if ( ftell(ttf)>info->g_bounds ) {
+ LogError("MATH table extends beyond table bounds");
+ info->bad_ot = true;
+ }
+ info->g_bounds = 0;
+}
+
+void otf_read_math(FILE *ttf,struct ttfinfo *info) {
+ _otf_read_math(ttf,info,git_normal);
+}
+
+void otf_read_math_used(FILE *ttf,struct ttfinfo *info) {
+ _otf_read_math(ttf,info,git_justinuse);
+}
+
+void GuessNamesFromMATH(FILE *ttf,struct ttfinfo *info) {
+ _otf_read_math(ttf,info,git_findnames);
+}
+
+static struct baselangextent *readttfbaseminmax(FILE *ttf,uint32 offset,struct ttfinfo *info,
+ uint32 script_tag,uint32 lang_tag) {
+ int j,feat_cnt;
+ struct baselangextent *lang, *cur, *last;
+ (void)info; /* for -Wall */
+ (void)script_tag; /* for -Wall */
+ fseek(ttf,offset,SEEK_SET);
+ lang = chunkalloc(sizeof(struct baselangextent));
+ lang->lang = lang_tag;
+ lang->descent = (short) getushort(ttf);
+ lang->ascent = (short) getushort(ttf);
+
+ feat_cnt = getushort(ttf);
+ last = NULL;
+ for ( j=0; j<feat_cnt; ++j ) {
+ cur = chunkalloc(sizeof(struct baselangextent));
+ if ( last==NULL )
+ lang->features = cur;
+ else
+ last->next = cur;
+ last = cur;
+ cur->lang = getlong(ttf); /* Actually feature tag here */
+ cur->descent = (short) getushort(ttf);
+ cur->ascent = (short) getushort(ttf);
+ }
+return( lang );
+}
+
+void readttfbase(FILE *ttf,struct ttfinfo *info) {
+ int version;
+ uint32 axes[2];
+ uint32 basetags, basescripts;
+ int basescriptcnt;
+ struct tagoff { uint32 tag; uint32 offset; } *bs;
+ int axis,i,j, tot;
+ struct Base *curBase;
+ struct basescript *curScript, *last;
+ struct baselangextent *cur, *lastLang;
+
+ if ( info->base_start==0 )
+return;
+ fseek(ttf,info->base_start,SEEK_SET);
+
+ version = getlong(ttf);
+ if ( version!=0x00010000 )
+return;
+ axes[0] = getushort(ttf); /* Horizontal */
+ axes[1] = getushort(ttf); /* Vertical */
+
+ for ( axis=0; axis<2; ++axis ) {
+ if ( axes[axis]==0 )
+ continue;
+ fseek(ttf,info->base_start+axes[axis],SEEK_SET);
+ curBase = chunkalloc(sizeof(struct Base));
+ if ( axis==0 ) info->horiz_base = curBase; else info->vert_base = curBase;
+ basetags = getushort(ttf);
+ basescripts = getushort(ttf);
+ if ( basetags==0 ) {
+ curBase->baseline_cnt = 0;
+ curBase->baseline_tags = NULL;
+ } else {
+ fseek(ttf,info->base_start+axes[axis]+basetags,SEEK_SET);
+ curBase->baseline_cnt = getushort(ttf);
+ curBase->baseline_tags = gcalloc(curBase->baseline_cnt,sizeof(uint32));
+ for ( i=0; i<curBase->baseline_cnt; ++i )
+ curBase->baseline_tags[i] = getlong(ttf);
+ }
+ if ( basescripts!=0 ) {
+ fseek(ttf,info->base_start+axes[axis]+basescripts,SEEK_SET);
+ basescriptcnt = getushort(ttf);
+ bs = gcalloc(basescriptcnt,sizeof(struct tagoff));
+ for ( i=0; i<basescriptcnt; ++i ) {
+ bs[i].tag = getlong(ttf);
+ bs[i].offset = getushort(ttf);
+ if ( bs[i].offset != 0 )
+ bs[i].offset += info->base_start+axes[axis]+basescripts;
+ }
+ last = NULL;
+ for ( i=0; i<basescriptcnt; ++i ) if ( bs[i].offset!=0 ) {
+ int basevalues, defminmax;
+ int langsyscnt;
+ struct tagoff *ls;
+ fseek(ttf,bs[i].offset,SEEK_SET);
+ basevalues = getushort(ttf);
+ defminmax = getushort(ttf);
+ langsyscnt = getushort(ttf);
+ ls = gcalloc(langsyscnt,sizeof(struct tagoff));
+ for ( j=0; j<langsyscnt; ++j ) {
+ ls[j].tag = getlong(ttf);
+ ls[j].offset = getushort(ttf);
+ }
+ curScript = chunkalloc(sizeof(struct basescript));
+ if ( last==NULL )
+ curBase->scripts = curScript;
+ else
+ last->next = curScript;
+ last = curScript;
+ curScript->script = bs[i].tag;
+ if ( basevalues!=0 ) {
+ int coordcnt;
+ int *coords;
+
+ fseek( ttf,bs[i].offset+basevalues,SEEK_SET);
+ curScript->def_baseline = getushort(ttf);
+ tot = coordcnt = getushort(ttf);
+ if ( coordcnt!=curBase->baseline_cnt ) {
+ info->bad_ot = true;
+ LogError( "!!!!! Coord count (%d) for '%c%c%c%c' script does not match base tag count (%d) in 'BASE' table\n",
+ coordcnt,
+ bs[i].tag>>24, bs[i].tag>>16, bs[i].tag>>8, bs[i].tag,
+ curBase->baseline_cnt );
+ if ( tot<curBase->baseline_cnt )
+ tot = curBase->baseline_cnt;
+ }
+ coords = gcalloc(coordcnt,sizeof(int));
+ curScript->baseline_pos = gcalloc(tot,sizeof(int16));
+ for ( j=0; j<coordcnt; ++j )
+ coords[j] = getushort(ttf);
+ for ( j=0; j<coordcnt; ++j ) if ( coords[j]!=0 ) {
+ int format;
+ fseek( ttf,bs[i].offset+basevalues+coords[j],SEEK_SET);
+ format = getushort(ttf);
+ curScript->baseline_pos[j] = (short) getushort(ttf);
+ if ( format!=1 && format!=2 && format!=3 ) {
+ info->bad_ot = true;
+ LogError("!!!!! Bad Base Coord format (%d) for '%c%c%c%c' in '%c%c%c%c' script in 'BASE' table\n",
+ format,
+ curBase->baseline_tags[j]>>24, curBase->baseline_tags[j]>>16, curBase->baseline_tags[j]>>8, curBase->baseline_tags[j],
+ bs[i].tag>>24, bs[i].tag>>16, bs[i].tag>>8, bs[i].tag );
+ }
+ }
+ free(coords);
+ }
+ lastLang = NULL;
+ if ( defminmax!=0 )
+ curScript->langs = lastLang = readttfbaseminmax(ttf,bs[i].offset+defminmax,info,bs[i].tag,DEFAULT_LANG);
+ if ( langsyscnt!=0 ) {
+ for ( j=0; j<langsyscnt; ++j ) if ( ls[j].offset!=0 ) {
+ cur = readttfbaseminmax(ttf,bs[i].offset+ls[j].offset,info,bs[i].tag,ls[j].tag);
+ if ( last==NULL )
+ curScript->langs = cur;
+ else
+ lastLang->next = cur;
+ lastLang = cur;
+ }
+ }
+ free(ls);
+ }
+ free(bs);
+ }
+ }
+}
+
+static void bsln_apply_values(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
+ int i;
+
+ for ( i=gfirst; i<=glast; ++i )
+ info->bsln_values[i]= getushort(ttf);
+}
+
+static void bsln_apply_value(struct ttfinfo *info, int gfirst, int glast,FILE *ttf) {
+ int i;
+ int bsln;
+
+ bsln = getushort(ttf);
+ for ( i=gfirst; i<=glast; ++i )
+ info->bsln_values[i]= bsln;
+}
+
+static void bsln_apply_default(struct ttfinfo *info, int gfirst, int glast,void *def) {
+ int def_bsln, i;
+
+ def_bsln = (intpt) def;
+ for ( i=gfirst; i<=glast; ++i )
+ info->bsln_values[i]= def_bsln;
+}
+
+void readttfbsln(FILE *ttf,struct ttfinfo *info) {
+ int def, ap_def, version, format;
+ uint16 *values;
+ int offsets[32];
+ SplineChar *sc;
+ BasePoint pos;
+ int mapping[32];
+ int i;
+ struct Base *base;
+ struct basescript *bs;
+
+ fseek(ttf,info->bsln_start,SEEK_SET);
+ version = getlong(ttf);
+ if ( version!=0x00010000 )
+return;
+ format = getushort(ttf);
+ def = getushort(ttf);
+ if ( format==0 || format==1 ) {
+ for ( i=0; i<32; ++i )
+ offsets[i] = (int16) getushort(ttf);
+ } else if ( format==2 || format==3 ) {
+ int stdGID = getushort(ttf);
+ int ptnum;
+ if ( stdGID>=info->glyph_cnt || (sc = info->chars[stdGID])==NULL )
+return;
+ for ( i=0; i<32; ++i ) {
+ ptnum = getushort(ttf);
+ if ( ttfFindPointInSC(sc,ly_fore,ptnum,&pos,NULL)!=-1 )
+return;
+ offsets[i] = pos.y;
+ }
+ }
+
+ if ( format&1 ) {
+ info->bsln_values = values = gcalloc(info->glyph_cnt,sizeof(uint16));
+ readttf_applelookup(ttf,info,
+ bsln_apply_values,bsln_apply_value,
+ bsln_apply_default,(void *) (intpt) def, false);
+ } else
+ values = NULL;
+
+ for ( i=1; i<32; ++i ) mapping[i] = 3; /* Roman */
+
+ info->horiz_base = base = chunkalloc(sizeof(struct Base));
+ base->baseline_cnt = 4;
+ base->baseline_tags = galloc(4*sizeof(uint32));
+ base->baseline_tags[0] = CHR('h','a','n','g'); /* Apple 3 */
+ if ( offsets[1]!= offsets[2] ) {
+ base->baseline_tags[1] = CHR('i','d','e','o'); /* Apple 2 */
+ base->baseline_tags[2] = CHR('m','a','t','h'); /* Apple 4 */
+ base->baseline_tags[3] = CHR('r','o','m','n'); /* Apple 0 */
+
+ /* Map from Apple's baseline indeces, to OT tag positions */
+ mapping[3] = 0;
+ mapping[2] = 1;
+ mapping[4] = 2;
+ mapping[0] = 3;
+ /* Apple baseline 1 does not map to an OT tag */
+ /* I assume baseline 1 is the normal baseline for CJK on Macs */
+ /* (because baseline 2 often (and wrongly) contains the same value */
+ } else {
+ /* baseline 1 (centered ideographic) and baseline 2 (low ideographic) */
+ /* are documented to be different. Yet most of the fonts I have looked*/
+ /* at (and I've only got about 4 test cases) have the low ideographic*/
+ /* baseline set to the centered baseline. If I were to copy that to */
+ /* OT it would be really bad. So even though baseline data is provided*/
+ /* I shall ignore it if it looks WRONG! */
+ base->baseline_cnt = 3;
+ base->baseline_tags[1] = CHR('m','a','t','h'); /* Apple 4 */
+ base->baseline_tags[2] = CHR('r','o','m','n'); /* Apple 0 */
+ mapping[3] = 0;
+ mapping[4] = 1;
+ mapping[0] = 2;
+ }
+
+ for ( i=0; i<info->glyph_cnt; ++i ) if ( (sc=info->chars[i])!=NULL ) {
+ uint32 script = SCScriptFromUnicode(sc);
+ if ( script==DEFAULT_SCRIPT )
+ continue;
+ for ( bs=base->scripts; bs!=NULL && bs->script!=script; bs=bs->next );
+ if ( bs!=NULL )
+ continue;
+ bs = chunkalloc(sizeof(struct basescript));
+ bs->script = script;
+ ap_def = def;
+ if ( values!=NULL )
+ ap_def = values[i];
+ bs->def_baseline = mapping[ap_def];
+ bs->baseline_pos = galloc(4*sizeof(int16));
+ for ( i=0; i<5; ++i ) if ( i!=1 )
+ bs->baseline_pos[mapping[i]] = offsets[i] - offsets[ap_def];
+ bs->next = base->scripts;
+ base->scripts = bs;
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettfvar.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c
index 07852f9f648..1467fcbc06b 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/parsettfvar.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettfvar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -118,7 +118,7 @@ return;
LogError( _("Hmm, this 'fvar' table has an unexpected size for an instance, I shan't parse it\n") );
return;
}
- if ( data_off+axis_count*20+instance_count*(4+4*axis_count)> info->fvar_len ) {
+ if ( data_off+axis_count*20+instance_count*(4+4*axis_count)> (int)info->fvar_len ) {
LogError( _("Hmm, this 'fvar' table is too short\n") );
return;
}
@@ -356,7 +356,7 @@ return;
for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
ref->transform[4] += xd;
ref->transform[5] += yd;
- SCReinstanciateRefChar(sc,ref);
+ SCReinstanciateRefChar(sc,ref,ly_fore);
}
}
@@ -375,7 +375,7 @@ static void VaryGlyph(SplineChar *sc,int *points, int *xdeltas, int *ydeltas,
if ( xdeltas[i]!=0 || ydeltas[i]!=0 ) {
ref->transform[4] += xdeltas[i];
ref->transform[5] += ydeltas[i];
- SCReinstanciateRefChar(sc,ref);
+ SCReinstanciateRefChar(sc,ref,ly_fore);
}
}
} else {
@@ -411,7 +411,7 @@ static void VaryGlyph(SplineChar *sc,int *points, int *xdeltas, int *ydeltas,
if ( xdeltas[j]!=0 || ydeltas[j]!=0 ) {
ref->transform[4] += xdeltas[j];
ref->transform[5] += ydeltas[j];
- SCReinstanciateRefChar(sc,ref);
+ SCReinstanciateRefChar(sc,ref,ly_fore);
}
++j;
}
@@ -760,14 +760,7 @@ void readttfvariations(struct ttfinfo *info, FILE *ttf) {
if ( info->gvar_start==0 || info->gvar_len==0 || info->fvar_start==0 || info->fvar_len==0 )
return;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_progress_change_line2(_("Processing Variations"));
- if ( !no_windowing_ui )
- GDrawProcessPendingEvents(NULL);
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_change_line2(_("Processing Variations"));
- /* !!! force an expose */
-#endif
+ ff_progress_change_line2(_("Processing Variations"));
parsefvar(info,ttf);
if ( info->variations!=NULL && info->avar_start!=0 )
parseavar(info,ttf);
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pfaedit.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h
index 1e257cef0c3..ac10e80f070 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pfaedit.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pfaedit.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -28,35 +28,18 @@
#define _PFAEDIT_H_
#include "configure-pfaedit.h"
-#if defined( FONTFORGE_CONFIG_GTK )
-# include "basics.h"
-# include "gimage.h"
-# include <gtk/gtk.h>
-# include <gwwv.h>
-#else /*if defined( FONTFORGE_CONFIG_GDRAW )*/
-# include <basics.h>
-# include <stdio.h>
-# include <string.h>
-# if defined( FONTFORGE_CONFIG_GDRAW )
-# include <gprogress.h>
-# endif
-#endif
+#include <basics.h>
+#include <stdio.h>
+#include <string.h>
+#include <intl.h>
#include "splinefont.h"
-
-#if defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
-#include "intl.h"
-#endif
+#include "uiinterface.h"
static const int unicode4_size = 17*65536;
/* Unicode goes up to 0x10ffff */
-extern void IError(const char *fmt,...);
-extern int ErrorWindowExists(void);
-extern void ShowErrorWindow(void);
-extern void LogError(const char *format,...);
-extern void ff_post_notice(const char *title,const char *statement,...);
-
+extern void ProcessNativeScript(int argc, char *argv[], FILE *script);
extern void CheckIsScript(int argc, char *argv[]);
extern char *AdobeStandardEncoding[256];
@@ -76,7 +59,6 @@ extern int adjustlbearing;
extern int autohint_before_rasterize;
extern int autohint_before_generate;
extern int seperate_hint_controls;
-extern int ItalicConstrained;
extern int no_windowing_ui;
extern uint32 default_background;
extern int use_utf8_in_script;
@@ -93,19 +75,29 @@ extern char *printcommand, *printlazyprinter;
extern Encoding *enclist;
-#define RECENT_MAX 4
-extern char *RecentFiles[RECENT_MAX];
#define SCRIPT_MENU_MAX 10
-#if defined( FONTFORGE_CONFIG_GTK )
-extern char *script_menu_names[SCRIPT_MENU_MAX];
-#else
-extern unichar_t *script_menu_names[SCRIPT_MENU_MAX];
-#endif
-extern char *script_filenames[SCRIPT_MENU_MAX];
extern MacFeat *default_mac_feature_map;
-
+typedef struct library_version_configuration {
+ uint16 major, minor;
+ long library_source_modtime;
+ char *library_source_modtime_string;
+ int library_source_versiondate;
+ uint16 sizeof_me;
+ uint16 sizeof_splinefont;
+ uint16 sizeof_splinechar;
+ uint16 sizeof_fvbase;
+ uint16 sizeof_cvbase;
+ uint16 sizeof_cvcontainer;
+ uint8 config_had_devicetables;
+ uint8 config_had_multilayer;
+ uint8 config_had_python;
+ uint8 mba1; /* Must be all ones (0xff), config values are 0,1 need to distinquish from both */
+} Library_Version_Configuration;
+extern Library_Version_Configuration library_version_configuration;
+
+extern int check_library_version(Library_Version_Configuration *exe_lib_version, int fatal, int quiet);
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/plugins.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/plugins.h
index 6e1079c768e..58ae2448484 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/plugins.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/plugins.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2007 by George Williams */
+/* Copyright (C) 2005-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/psfont.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psfont.h
index 72c4efa4ef5..5362ccd3cf1 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/psfont.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psfont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/psread.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c
index 2c3ece7d11d..c5e4958d0f5 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/psread.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/psread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -31,22 +31,11 @@
#include <utype.h>
#include "psfont.h"
#include "sd.h"
-#if defined(FONTFORGE_CONFIG_TYPE3) && !defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
-# include "views.h" /* For CharView */
-#endif
+#include "views.h" /* For CharViewBase */
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h> /* Solaris defines isnan in ieeefp rather than math.h */
#endif
-#ifdef LUA_FF_LIB
-/* no need for iconv here, since PS is 8-bit legacy */
-#define Isspace(a) ((a)==' '|| ((a) >= '\t' && (a) <= '\r'))
-#define Isdigit(a) ((a)>='0' && (a)<='9')
-#else
-#define Isspace isspace
-#define Isdigit isdigit
-#endif
-
typedef struct _io {
char *macro, *start;
FILE *ps, *fog;
@@ -58,6 +47,7 @@ typedef struct _io {
typedef struct io {
struct _io *top;
int endedstopped;
+ int advance_width; /* Can be set from a PS comment by MF2PT1 */
} IO;
typedef struct growbuf {
@@ -165,7 +155,7 @@ enum pstoks { pt_eof=-1, pt_moveto, pt_rmoveto, pt_curveto, pt_rcurveto,
pt_setgray, pt_currentgray, pt_sethsbcolor, pt_currenthsbcolor,
pt_setrgbcolor, pt_currentrgbcolor, pt_setcmykcolor, pt_currentcmykcolor,
pt_currentpoint,
- pt_fill, pt_stroke,
+ pt_fill, pt_stroke, pt_clip,
pt_imagemask,
@@ -210,7 +200,7 @@ static char *toknames[] = { "moveto", "rmoveto", "curveto", "rcurveto",
"setgray", "currentgray", "sethsbcolor", "currenthsbcolor",
"setrgbcolor", "currentrgbcolor", "setcmykcolor", "currentcmykcolor",
"currentpoint",
- "fill", "stroke",
+ "fill", "stroke", "clip",
"imagemask",
@@ -245,8 +235,8 @@ static char *toknames[] = { "moveto", "rmoveto", "curveto", "rcurveto",
static int getfoghex(_IO *io) {
int ch,val;
- while ( Isspace( ch = getc(io->fog)));
- if ( Isdigit(ch))
+ while ( isspace( ch = getc(io->fog)));
+ if ( isdigit(ch))
val = ch-'0';
else if ( ch >= 'A' && ch <= 'F' )
val = ch-'A'+10;
@@ -256,8 +246,8 @@ static int getfoghex(_IO *io) {
return(EOF);
val <<= 4;
- while ( Isspace( ch = getc(io->fog)));
- if ( Isdigit(ch))
+ while ( isspace( ch = getc(io->fog)));
+ if ( isdigit(ch))
val |= ch-'0';
else if ( ch >= 'A' && ch <= 'F' )
val |= ch-'A'+10;
@@ -402,7 +392,7 @@ static int ioescapestopped(IO *wrapper, struct psstack *stack, int sp) {
free(io);
if ( wasstopped ) {
wrapper->top = iop;
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_bool;
stack[sp++].u.tf = true;
}
@@ -426,42 +416,30 @@ return( true );
return( false );
}
-static int CheckCodePointsComment(IO *wrapper) {
- /* Check to see if this encoding includes the special comment we use */
- /* to indicate that the encoding is based on unicode code points rather */
- /* than glyph names */
- char commentbuffer[128], *pt;
- int ch;
-
- /* Eat whitespace and comments. Comments last to eol (or formfeed) */
- while ( Isspace(ch = nextch(wrapper)) );
- if ( ch!='%' ) {
- unnextch(ch,wrapper);
-return( false );
- }
-
- pt = commentbuffer;
- while ( (ch=nextch(wrapper))!=EOF && ch!='\r' && ch!='\n' && ch!='\f' ) {
- if ( pt-commentbuffer < sizeof(commentbuffer)-1 )
- *pt++ = ch;
- }
- *pt = '\0';
- if ( strcmp(commentbuffer," Use codepoints.")== 0 )
-return( true );
-
-return( false );
-}
static int nextpstoken(IO *wrapper, real *val, char *tokbuf, int tbsize) {
int ch, r, i;
char *pt, *end;
+ float mf2pt_advance_width;
+
+ pt = tokbuf;
+ end = pt+tbsize-1;
/* Eat whitespace and comments. Comments last to eol (or formfeed) */
while ( 1 ) {
- while ( Isspace(ch = nextch(wrapper)) );
+ while ( isspace(ch = nextch(wrapper)) );
if ( ch!='%' )
break;
- while ( (ch=nextch(wrapper))!=EOF && ch!='\r' && ch!='\n' && ch!='\f' );
+ while ( (ch=nextch(wrapper))!=EOF && ch!='\r' && ch!='\n' && ch!='\f' )
+ if ( pt<end )
+ *pt++ = ch;
+ *pt='\0';
+ /* Some comments have meanings (that we care about) */
+ if ( sscanf( tokbuf, " MF2PT1: bbox %*g %*g %g %*g", &mf2pt_advance_width )==1 )
+ wrapper->advance_width = mf2pt_advance_width;
+ else if ( sscanf( tokbuf, " MF2PT1: glyph_dimensions %*g %*g %g %*g", &mf2pt_advance_width )==1 )
+ wrapper->advance_width = mf2pt_advance_width;
+ pt = tokbuf;
}
if ( ch==EOF )
@@ -520,7 +498,7 @@ return( pt_closearray );
return( pt_unknown ); /* single character token */
} else if ( ch=='/' ) {
pt = tokbuf;
- while ( (ch=nextch(wrapper))!=EOF && !Isspace(ch) && ch!='%' &&
+ while ( (ch=nextch(wrapper))!=EOF && !isspace(ch) && ch!='%' &&
ch!='(' && ch!=')' && ch!='<' && ch!='>' && ch!='[' && ch!=']' &&
ch!='{' && ch!='}' && ch!='/' )
if ( pt<tokbuf+tbsize-2 )
@@ -529,7 +507,7 @@ return( pt_unknown ); /* single character token */
unnextch(ch,wrapper);
return( pt_namelit ); /* name literal */
} else {
- while ( (ch=nextch(wrapper))!=EOF && !Isspace(ch) && ch!='%' &&
+ while ( (ch=nextch(wrapper))!=EOF && !isspace(ch) && ch!='%' &&
ch!='(' && ch!=')' && ch!='<' && ch!='>' && ch!='[' && ch!=']' &&
ch!='{' && ch!='}' && ch!='/' ) {
if ( pt<tokbuf+tbsize-2 )
@@ -568,7 +546,7 @@ return( pt_unknown );
}
}
-static void Transform(BasePoint *to, BasePoint *from, real trans[6]) {
+static void Transform(BasePoint *to, DBasePoint *from, real trans[6]) {
to->x = trans[0]*from->x+trans[2]*from->y+trans[4];
to->y = trans[1]*from->x+trans[3]*from->y+trans[5];
}
@@ -614,6 +592,7 @@ static void ECCatagorizePoints( EntityChar *ec ) {
for ( ent=ec->splines; ent!=NULL; ent=ent->next ) if ( ent->type == et_splines ) {
SPLCatagorizePoints( ent->u.splines.splines );
+ SPLCatagorizePoints( ent->clippath );
}
}
@@ -721,7 +700,7 @@ static void CheckMake(SplinePoint *from, SplinePoint *to) {
static void circlearcto(real a1, real a2, real cx, real cy, real r,
SplineSet *cur, real *transform ) {
SplinePoint *pt;
- BasePoint temp, base, cp;
+ DBasePoint temp, base, cp;
real cplen;
int sign=1;
real s1, s2, c1, c2;
@@ -834,7 +813,7 @@ static int aload(int sp, struct psstack *stack,int stacktop, struct garbage *tof
++sp;
}
}
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_array;
stack[sp].u.dict = dict;
++sp;
@@ -980,7 +959,7 @@ return(nsp);
}
static Entity *EntityCreate(SplinePointList *head,int linecap,int linejoin,
- real linewidth, real *transform) {
+ real linewidth, real *transform, SplineSet *clippath) {
Entity *ent = gcalloc(1,sizeof(Entity));
ent->type = et_splines;
ent->u.splines.splines = head;
@@ -991,245 +970,11 @@ static Entity *EntityCreate(SplinePointList *head,int linecap,int linejoin,
ent->u.splines.stroke.col = 0xffffffff;
ent->u.splines.fill.opacity = 1.0;
ent->u.splines.stroke.opacity = 1.0;
+ ent->clippath = SplinePointListCopy(clippath);
memcpy(ent->u.splines.transform,transform,6*sizeof(real));
return( ent );
}
-#ifdef FONTFORGE_CONFIG_TYPE3
-static uint8 *StringToBytes(struct psstack *stackel,int *len) {
- char *pt;
- uint8 *upt, *base, *ret;
- int half, sofar, val, nesting;
- int i,j;
-
- pt = stackel->u.str;
- if ( stackel->type==ps_instr ) {
- /* imagemask operators take strings or procedures or files */
- /* we support strings, or procedures containing strings */
- while ( Isspace(*pt)) ++pt;
- if ( *pt=='{' || *pt=='[' ) ++pt;
- while ( Isspace(*pt)) ++pt;
- } else if ( stackel->type!=pt_string )
-return( NULL );
-
- upt = base = galloc(65536+1); /* Maximum size of ps string */
-
- if ( *pt=='(' ) {
- /* A conventional string */
- ++pt;
- nesting = 0;
- while ( *pt!='\0' && (nesting!=0 || *pt!=')') ) {
- if ( *pt=='(' ) {
- ++nesting;
- *upt++ = *pt++;
- } else if ( *pt==')' ) {
- --nesting;
- *upt++ = *pt++;
- } else if ( *pt=='\r' || *pt=='\n' ) {
- /* any of lf, cr, crlf gets translated to \n */
- if ( *pt=='\r' && pt[1]=='\n' ) ++pt;
- *upt++ = '\n';
- ++pt;
- } else if ( *pt!='\\' ) {
- *upt++ = *pt++;
- } else {
- ++pt;
- if ( *pt=='\r' || *pt=='\n' ) {
- /* any of \lf, \cr, \crlf gets ignored */
- if ( *pt=='\r' && pt[1]=='\n' ) ++pt;
- ++pt;
- } else if ( *pt=='n' ) {
- *upt++ = '\n';
- ++pt;
- } else if ( *pt=='r' ) {
- *upt++ = '\r';
- ++pt;
- } else if ( *pt=='t' ) {
- *upt++ = '\t';
- ++pt;
- } else if ( *pt=='b' ) {
- *upt++ = '\b';
- ++pt;
- } else if ( *pt=='f' ) {
- *upt++ = '\f';
- ++pt;
- } else if ( *pt>='0' && *pt<='7' ) {
- if ( pt[1]<'0' || pt[1]>'7' ) /* This isn't really legal postscript */
- *upt++ = *pt++ - '0';
- else if ( pt[2]<'0' || pt[2]>'7' ) {/* 3 octal digits are required */
- *upt++ = ((*pt - '0')<<3) + (pt[1]-'0');
- pt += 2;
- } else {
- *upt++ = ((*pt - '0')<<6) + ((pt[1]-'0')<<3) + (pt[2]-'0');
- pt += 3;
- }
- } else if ( *pt=='(' || *pt==')' || *pt=='\\' )
- *upt++ = *pt++;
- else {
- LogError( _("Unknown character after backslash in literal string.\n"));
- *upt++ = *pt++;
- }
- }
- }
- } else if ( *pt!='<' ) {
- LogError( _("Unknown string type\n" ));
-return( NULL );
- } else if ( pt[1]!='~' ) {
- /* A hex string. Ignore any characters which aren't hex */
- half = sofar = 0;
- ++pt;
- while ( *pt!='>' && *pt!='\0' ) {
- if ( *pt>='a' && *pt<='f' )
- val = *pt++-'a'+10;
- else if ( *pt>='A' && *pt<='F' )
- val = *pt++-'A'+10;
- else if ( Isdigit(*pt))
- val = *pt++-'0';
- else {
- ++pt; /* Not hex */
- continue;
- }
- if ( !half ) {
- half = true;
- sofar = val<<4;
- } else {
- *upt++ = sofar|val;
- half = false;
- }
- }
- if ( half )
- *upt++ = sofar;
- } else {
- /* An ASCII-85 string */
- /* c1 c2 c3 c4 c5 (c>='!' && c<='u') => ((c1-'!')*85+(c2-'!'))*85... */
- /* z => 32bits of 0 */
- pt += 2;
- while ( *pt!='\0' && *pt!='~' ) {
- if ( upt-base+4 > 65536 )
- break;
- if ( *pt=='z' ) {
- *upt++ = 0;
- *upt++ = 0;
- *upt++ = 0;
- *upt++ = 0;
- ++pt;
- } else if ( *pt>='!' && *pt<='u' ) {
- val = 0;
- for ( i=0; i<5 && *pt>='!' && *pt<='u'; ++i )
- val = (val*85) + *pt++ - '!';
- for ( j=i; j<5; ++j )
- val *= 85;
- *upt++ = val>>24 ;
- if ( i>2 )
- *upt++ = (val>>16)&0xff;
- if ( i>3 )
- *upt++ = (val>>8 )&0xff;
- if ( i>4 )
- *upt++ = val &0xff;
- if ( i<5 )
- break;
- } else if ( Isspace( *pt ) ) {
- ++pt;
- } else
- break;
- }
- }
- *len = upt-base;
- ret = galloc(upt-base);
- memcpy(ret,base,upt-base);
- free(base);
-return(ret);
-}
-
-static int PSAddImagemask(EntityChar *ec,struct psstack *stack,int sp,
- real transform[6],Color fillcol) {
- uint8 *data;
- int datalen, width, height, polarity;
- real trans[6];
- struct _GImage *base;
- GImage *gi;
- Entity *ent;
- int i,j;
-
- if ( sp<5 || (stack[sp-1].type!=ps_instr && stack[sp-1].type!=ps_string)) {
- LogError( _("FontForge does not support dictionary based imagemask operators.\n" ));
-return( sp-1 );
- }
-
- if ( stack[sp-2].type!=ps_array || stack[sp-2].u.dict.cnt!=6 ) {
- LogError( _("Fourth argument of imagemask must be a 6-element transformation matrix.\n" ));
-return( sp-5 );
- }
-
- if ( stack[sp-3].type!=ps_bool ) {
- LogError( _("Third argument of imagemask must be a boolean.\n" ));
-return( sp-5 );
- }
- polarity = stack[sp-3].u.tf;
-
- if ( stack[sp-4].type!=ps_num || stack[sp-5].type!=ps_num ) {
- LogError( _("First and second arguments of imagemask must be integers.\n" ));
-return( sp-5 );
- }
- height = stack[sp-4].u.val;
- width = stack[sp-5].u.val;
-
- data = StringToBytes(&stack[sp-1],&datalen);
-
- if ( width<=0 || height<=0 || ((width+7)/8)*height>datalen ) {
- LogError( _("Width or height arguments to imagemask contain invalid values\n(either negative or they require more data than provided).\n" ));
- free(data);
-return( sp-5 );
- }
- trans[0] = stack[sp-2].u.dict.entries[0].u.val;
- trans[1] = stack[sp-2].u.dict.entries[1].u.val;
- trans[2] = stack[sp-2].u.dict.entries[2].u.val;
- trans[3] = stack[sp-2].u.dict.entries[3].u.val;
- trans[4] = stack[sp-2].u.dict.entries[4].u.val;
- trans[5] = stack[sp-2].u.dict.entries[5].u.val;
-
- gi = GImageCreate(it_mono,width,height);
- base = gi->u.image;
- base->trans = 1;
- if ( polarity ) {
- for ( i=0; i<datalen; ++i )
- data[i] ^= 0xff;
- }
- if ( trans[0]>0 && trans[3]<0 )
- memcpy(base->data,data,datalen);
- else if ( trans[0]>0 && trans[3]>0 ) {
- for ( i=0; i<height; ++i )
- memcpy(base->data+i*base->bytes_per_line,data+(height-i)*base->bytes_per_line,
- base->bytes_per_line);
- } else if ( trans[0]<0 && trans[3]<0 ) {
- for ( i=0; i<height; ++i ) for ( j=0; j<width; ++j ) {
- if ( data[i*base->bytes_per_line+ (j>>3)]&(0x80>>(j&7)) )
- base->data[i*base->bytes_per_line + ((width-j-1)>>3)] |=
- (0x80>>((width-j-1)&7));
- }
- } else {
- for ( i=0; i<height; ++i ) for ( j=0; j<width; ++j ) {
- if ( data[i*base->bytes_per_line+ (j>>3)]&(0x80>>(j&7)) )
- base->data[(height-i-1)*base->bytes_per_line + ((width-j-1)>>3)] |=
- (0x80>>((width-j-1)&7));
- }
- }
- free(data);
-
- ent = gcalloc(1,sizeof(Entity));
- ent->type = et_image;
- ent->u.image.image = gi;
- memcpy(ent->u.image.transform,transform,sizeof(real[6]));
- ent->u.image.transform[0] /= width;
- ent->u.image.transform[3] /= height;
- ent->u.image.transform[5] += height;
- ent->u.image.col = fillcol;
-
- ent->next = ec->splines;
- ec->splines = ent;
-return( sp-5 );
-}
-#endif
static void HandleType3Reference(IO *wrapper,EntityChar *ec,real transform[6],
char *tokbuf, int toksize) {
@@ -1253,7 +998,7 @@ return; /* Hunh. I don't understand it. I give up */
return; /* Hunh. I don't understand it. I give up */
/* Ok, it looks very much like a reference to glyphname */
- ref = chunkalloc(sizeof(RefChar));
+ ref = RefCharCreate();
memcpy(ref->transform,transform,sizeof(ref->transform));
ref->sc = (SplineChar *) glyphname;
ref->next = ec->refs;
@@ -1262,7 +1007,7 @@ return; /* Hunh. I don't understand it. I give up */
static void _InterpretPS(IO *wrapper, EntityChar *ec, RetStack *rs) {
SplinePointList *cur=NULL, *head=NULL;
- BasePoint current, temp;
+ DBasePoint current, temp;
int tok, i, j;
struct psstack stack[100];
real dval;
@@ -1272,11 +1017,12 @@ static void _InterpretPS(IO *wrapper, EntityChar *ec, RetStack *rs) {
real transform[6], t[6];
struct graphicsstate {
real transform[6];
- BasePoint current;
+ DBasePoint current;
real linewidth;
int linecap, linejoin;
Color fore;
DashType dashes[DASH_MAX];
+ SplineSet *clippath;
} gsaves[30];
int gsp = 0;
int ccnt=0;
@@ -1291,15 +1037,9 @@ static void _InterpretPS(IO *wrapper, EntityChar *ec, RetStack *rs) {
char *oldloc;
int warned = 0;
struct garbage tofrees;
-#if !defined(FONTFORGE_CONFIG_TYPE3)
+ SplineSet *clippath = NULL;
char tokbuf[100];
const int tokbufsize = 100;
-#else
- char *tokbuf;
- const int tokbufsize = 2*65536+10;
-
- tokbuf = galloc(tokbufsize);
-#endif
oldloc = setlocale(LC_NUMERIC,"C");
@@ -1326,12 +1066,12 @@ static void _InterpretPS(IO *wrapper, EntityChar *ec, RetStack *rs) {
while ( (tok = nextpstoken(wrapper,&dval,tokbuf,tokbufsize))!=pt_eof ) {
if ( endedstopped(wrapper)) {
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_bool;
stack[sp++].u.tf = false;
}
}
- if ( sp>sizeof(stack)/sizeof(stack[0])*4/5 ) {
+ if ( sp>(int)(sizeof(stack)/sizeof(stack[0])*4/5) ) {
/* We don't interpret all of postscript */
/* Sometimes we leave garbage on the stack that a real PS interp */
/* would have handled. If the stack gets too deep, clean out the */
@@ -1346,7 +1086,7 @@ static void _InterpretPS(IO *wrapper, EntityChar *ec, RetStack *rs) {
if ( ccnt>0 )
AddTok(&gb,tokbuf,tok==pt_namelit);
else {
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_instr;
if ( gb.pt==NULL )
stack[sp++].u.str = copy("");
@@ -1359,7 +1099,7 @@ static void _InterpretPS(IO *wrapper, EntityChar *ec, RetStack *rs) {
} else if ( tok==pt_unknown && (kv=lookup(&dict,tokbuf))!=NULL ) {
if ( kv->type == ps_instr )
pushio(wrapper,NULL,copy(kv->u.str),0);
- else if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ else if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = kv->type;
stack[sp++].u = kv->u;
if ( kv->type==ps_instr || kv->type==ps_lit || kv->type==ps_string )
@@ -1371,34 +1111,12 @@ static void _InterpretPS(IO *wrapper, EntityChar *ec, RetStack *rs) {
}
}
} else {
-#if 0 /* /ps{count /foo exch def count copy foo array astore ==}def */
- /* printstack */
-int ii;
-for ( ii=0; ii<sp; ++ii )
- if ( stack[ii].type==ps_num )
- printf( "%g ", stack[ii].u.val );
- else if ( stack[ii].type==ps_bool )
- printf( "%s ", stack[ii].u.tf ? "true" : "false" );
- else if ( stack[ii].type==ps_string )
- printf( "(%s) ", stack[ii].u.str );
- else if ( stack[ii].type==ps_lit )
- printf( "/%s ", stack[ii].u.str );
- else if ( stack[ii].type==ps_instr )
- printf( "-%s- ", stack[ii].u.str );
- else if ( stack[ii].type==ps_mark )
- printf( "--mark-- " );
- else if ( stack[ii].type==ps_array )
- printf( "--[]-- " );
- else
- printf( "--" "???" "-- " );
-printf( "-%s-\n", toknames[tok]);
-#endif
if ( tok==pt_unknown ) {
if ( strcmp(tokbuf,"Cache")==0 ) /* Fontographer type3s */
tok = pt_setcachedevice;
else if ( strcmp(tokbuf,"SetWid")==0 ) {
tok = pt_setcharwidth;
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = 0;
}
@@ -1431,7 +1149,7 @@ printf( "-%s-\n", toknames[tok]);
stack[sp-1].u.val>=0 && stack[sp-1].u.val<=255 ) ||
(wrapper->top->fogns && sp>6 && stack[sp-7].type == ps_num &&
stack[sp-7].u.val>=0 && stack[sp-7].u.val<=255 )) {
- ref = chunkalloc(sizeof(RefChar));
+ ref = RefCharCreate();
memcpy(ref->transform,transform,sizeof(ref->transform));
if ( wrapper->top->fogns ) {
sp -= 6;
@@ -1456,19 +1174,19 @@ printf( "-%s-\n", toknames[tok]);
}
switch ( tok ) {
case pt_number:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = dval;
}
break;
case pt_string:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_string;
stack[sp++].u.str = copyn(tokbuf+1,strlen(tokbuf)-2);
}
break;
case pt_true: case pt_false:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_bool;
stack[sp++].u.tf = tok==pt_true;
}
@@ -1483,7 +1201,7 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_count:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp].u.val = sp;
++sp;
@@ -1510,7 +1228,7 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_dup:
- if ( sp>0 && sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp>0 && sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp] = stack[sp-1];
if ( stack[sp].type==ps_string || stack[sp].type==ps_instr ||
stack[sp].type==ps_lit )
@@ -1525,7 +1243,7 @@ printf( "-%s-\n", toknames[tok]);
case pt_copy:
if ( sp>0 ) {
int n = stack[--sp].u.val;
- if ( n+sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( n+sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
int i;
for ( i=0; i<n; ++i ) {
stack[sp] = stack[sp-n];
@@ -2023,7 +1741,7 @@ printf( "-%s-\n", toknames[tok]);
case pt_namelit:
if ( strcmp(tokbuf,"CharProcs")==0 && ec!=NULL ) {
HandleType3Reference(wrapper,ec,transform,tokbuf,tokbufsize);
- } else if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ } else if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_lit;
stack[sp++].u.str = copy(tokbuf);
}
@@ -2041,6 +1759,9 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_newpath:
+ SplinePointListsFree(head);
+ head = NULL;
+ cur = NULL;
break;
case pt_lineto: case pt_rlineto:
case pt_moveto: case pt_rmoveto:
@@ -2191,7 +1912,7 @@ printf( "-%s-\n", toknames[tok]);
xt1 = x1 + t*(current.x-x1)/l1; yt1 = y1 + t*(current.y-y1)/l1;
xt2 = x1 + t*(x2-x1)/l2; yt2 = y1 + t*(y2-y1)/l2;
if ( xt1!=current.x || yt1!=current.y ) {
- BasePoint temp;
+ DBasePoint temp;
temp.x = xt1; temp.y = yt1;
pt = chunkalloc(sizeof(SplinePoint));
Transform(&pt->me,&temp,transform);
@@ -2224,7 +1945,9 @@ printf( "-%s-\n", toknames[tok]);
if ( RealNear(cur->first->me.x,cur->last->me.x) && RealNear(cur->first->me.y,cur->last->me.y) ) {
SplinePoint *oldlast = cur->last;
cur->first->prevcp = oldlast->prevcp;
- cur->first->noprevcp = false;
+ cur->first->prevcp.x += (cur->first->me.x-oldlast->me.x);
+ cur->first->prevcp.y += (cur->first->me.y-oldlast->me.y);
+ cur->first->noprevcp = oldlast->noprevcp;
oldlast->prev->from->next = NULL;
cur->last = oldlast->prev->from;
SplineFree(oldlast->prev);
@@ -2257,22 +1980,22 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_currentlinecap: case pt_currentlinejoin:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = tok==pt_currentlinecap?linecap:linejoin;
}
break;
case pt_currentlinewidth:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = linewidth;
}
break;
case pt_currentdash:
- if ( sp+1<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp+1<(int)(sizeof(stack)/sizeof(stack[0])) ) {
struct pskeydict dict;
- for ( i=0; i<DASH_MAX && dashes[i]!=0; ++i );
dict.is_executable = 0;
+ for ( i=0; i<DASH_MAX && dashes[i]!=0; ++i );
dict.cnt = dict.max = i;
dict.entries = gcalloc(i,sizeof(struct pskeyval));
for ( j=0; j<i; ++j ) {
@@ -2286,7 +2009,7 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_currentgray:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = (3*((fore>>16)&0xff) + 6*((fore>>8)&0xff) + (fore&0xff))/2550.;
}
@@ -2306,7 +2029,7 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_currenthsbcolor: case pt_currentrgbcolor:
- if ( sp+2<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp+2<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = stack[sp+1].type = stack[sp+2].type = ps_num;
if ( tok==pt_currentrgbcolor ) {
stack[sp++].u.val = ((fore>>16)&0xff)/255.;
@@ -2345,7 +2068,7 @@ printf( "-%s-\n", toknames[tok]);
case pt_sethsbcolor:
if ( sp>=3 ) {
real h = stack[sp-3].u.val, s = stack[sp-2].u.val, b = stack[sp-1].u.val;
- int r = 0,g = 0,bl =0 ;
+ int r=0,g=0,bl=0;
if ( s==0 ) /* it's grey */
fore = ((int) (b*255)) * 0x010101;
else {
@@ -2378,7 +2101,7 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_currentcmykcolor:
- if ( sp+3<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp+3<(int)(sizeof(stack)/sizeof(stack[0])) ) {
real c,m,y,k;
stack[sp].type = stack[sp+1].type = stack[sp+2].type = stack[sp+3].type = ps_num;
y = 1.-(fore&0xff)/255.;
@@ -2414,7 +2137,7 @@ printf( "-%s-\n", toknames[tok]);
}
break;
case pt_currentpoint:
- if ( sp+1<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp+1<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = current.x;
stack[sp].type = ps_num;
@@ -2431,7 +2154,7 @@ printf( "-%s-\n", toknames[tok]);
memcpy(ent->u.splines.transform,transform,sizeof(transform));
}
} else {
- ent = EntityCreate(head,linecap,linejoin,linewidth,transform);
+ ent = EntityCreate(head,linecap,linejoin,linewidth,transform,clippath);
ent->next = ec->splines;
ec->splines = ent;
}
@@ -2441,29 +2164,26 @@ printf( "-%s-\n", toknames[tok]);
ent->u.splines.stroke.col = fore;
head = NULL; cur = NULL;
break;
-
- case pt_imagemask:
-#ifdef FONTFORGE_CONFIG_TYPE3
- i = PSAddImagemask(ec,stack,sp,transform,fore);
- while ( sp>i ) {
- --sp;
- if ( stack[sp].type==ps_string || stack[sp].type==ps_instr ||
- stack[sp].type==ps_lit )
- free(stack[sp].u.str);
- else if ( stack[sp].type==ps_array || stack[sp].type==ps_dict )
- dictfree(&stack[sp].u.dict);
+ case pt_clip:
+ /* I really should intersect the old clip path with the new, but */
+ /* I don't trust my intersect routine, crashes too often */
+ SplinePointListsFree(clippath);
+ clippath = SplinePointListCopy(head);
+ if ( clippath!=NULL && clippath->first!=clippath->last ) {
+ SplineMake3(clippath->last,clippath->first);
+ clippath->last = clippath->first;
}
-#else
+ break;
+ case pt_imagemask:
LogError( _("This version of FontForge does not support the imagemask operator.\nFor support configure --with-multilayer.\n") );
if ( sp>=5 && (stack[sp-1].type==ps_instr || stack[sp-1].type==ps_string))
sp -= 5;
-#endif
break;
/* We don't do these right, but at least we'll avoid some errors with this hack */
case pt_save: case pt_currentmatrix:
/* push some junk on the stack */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = 0;
}
@@ -2476,6 +2196,7 @@ printf( "-%s-\n", toknames[tok]);
gsaves[gsp].linecap = linecap;
gsaves[gsp].linejoin = linejoin;
gsaves[gsp].fore = fore;
+ gsaves[gsp].clippath = SplinePointListCopy(clippath);
++gsp;
/* I should be saving the "current path" too, but that's too hard */
}
@@ -2494,18 +2215,20 @@ printf( "-%s-\n", toknames[tok]);
linecap = gsaves[gsp].linecap;
linejoin = gsaves[gsp].linejoin;
fore = gsaves[gsp].fore;
+ SplinePointListsFree(clippath);
+ clippath = gsaves[gsp].clippath;
}
break;
case pt_null:
/* push a 0. I don't handle pointers properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 0;
stack[sp++].type = ps_num;
}
break;
case pt_currentoverprint:
/* push false. I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 0;
stack[sp++].type = ps_bool;
}
@@ -2517,7 +2240,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_currentflat:
/* push 1.0 (default value). I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0]) )) {
stack[sp].u.val = 1.0;
stack[sp++].type = ps_num;
}
@@ -2529,7 +2252,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_currentmiterlimit:
/* push 10.0 (default value). I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 10.0;
stack[sp++].type = ps_num;
}
@@ -2541,7 +2264,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_currentpacking:
/* push false (default value). I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 0;
stack[sp++].type = ps_bool;
}
@@ -2553,7 +2276,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_currentstrokeadjust:
/* push false (default value). I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 0;
stack[sp++].type = ps_bool;
}
@@ -2565,7 +2288,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_currentsmoothness:
/* default value is installation dependant. I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 1.0;
stack[sp++].type = ps_num;
}
@@ -2577,7 +2300,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_currentobjectformat:
/* default value is installation dependant. I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 0.0;
stack[sp++].type = ps_num;
}
@@ -2589,7 +2312,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_currentglobal: case pt_currentshared:
/* push false (default value). I don't handle this properly */
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].u.val = 0;
stack[sp++].type = ps_bool;
}
@@ -2601,7 +2324,7 @@ printf( "-%s-\n", toknames[tok]);
break;
case pt_openarray: case pt_mark:
- if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp++].type = ps_mark;
}
break;
@@ -2611,7 +2334,7 @@ printf( "-%s-\n", toknames[tok]);
break;
if ( i==sp )
LogError( _("No mark in counttomark\n") );
- else if ( sp<sizeof(stack)/sizeof(stack[0]) ) {
+ else if ( sp<(int)(sizeof(stack)/sizeof(stack[0])) ) {
stack[sp].type = ps_num;
stack[sp++].u.val = i;
}
@@ -2641,6 +2364,7 @@ printf( "-%s-\n", toknames[tok]);
LogError( _("No mark in ] (close array)\n") );
else {
struct pskeydict dict;
+ dict.is_executable = 0;
dict.cnt = dict.max = i;
dict.entries = gcalloc(i,sizeof(struct pskeyval));
for ( j=0; j<i; ++j ) {
@@ -2824,21 +2548,26 @@ printf( "-%s-\n", toknames[tok]);
}
freestuff(stack,sp,&dict,&gb,&tofrees);
if ( head!=NULL ) {
- ent = EntityCreate(head,linecap,linejoin,linewidth,transform);
+ ent = EntityCreate(head,linecap,linejoin,linewidth,transform,clippath);
ent->next = ec->splines;
ec->splines = ent;
}
+ while ( gsp>0 ) {
+ --gsp;
+ SplinePointListsFree(gsaves[gsp].clippath);
+ }
+ SplinePointListsFree(clippath);
ECCatagorizePoints(ec);
+ if ( ec->width == UNDEFINED_WIDTH )
+ ec->width = wrapper->advance_width;
setlocale(LC_NUMERIC,oldloc);
-#ifdef FONTFORGE_CONFIG_TYPE3
- free(tokbuf);
-#endif
}
static void InterpretPS(FILE *ps, char *psstr, EntityChar *ec, RetStack *rs) {
IO wrapper;
memset(&wrapper,0,sizeof(wrapper));
+ wrapper.advance_width = UNDEFINED_WIDTH;
pushio(&wrapper,ps,psstr,0);
_InterpretPS(&wrapper,ec,rs);
}
@@ -2891,166 +2620,10 @@ static Entity *EntityReverse(Entity *ent) {
return( last );
}
-#ifdef FONTFORGE_CONFIG_TYPE3
-static SplinePointList *SplinesFromLayers(SplineChar *sc,int *flags, int tostroke) {
- int layer;
- SplinePointList *head=NULL, *last, *new, *nlast, *temp, *each, *transed;
- StrokeInfo si;
- /*SplineSet *spl;*/
- int handle_eraser;
- real inversetrans[6], transform[6];
- int changed;
-
- if ( tostroke ) {
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- if ( sc->layers[layer].splines==NULL )
- continue;
- else if ( head==NULL )
- head = sc->layers[layer].splines;
- else
- last->next = sc->layers[layer].splines;
- for ( last = sc->layers[layer].splines; last->next!=NULL; last=last->next );
- sc->layers[layer].splines = NULL;
- }
-return( head );
- }
-
- if ( *flags==-1 )
- *flags = PsStrokeFlagsDlg();
-
- if ( *flags & sf_correctdir ) {
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) if ( sc->layers[layer].dofill )
- SplineSetsCorrect(sc->layers[layer].splines,&changed);
- }
-
- handle_eraser = *flags & sf_handle_eraser;
-
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- if ( sc->layers[layer].dostroke ) {
- memset(&si,'\0',sizeof(si));
- si.toobigwarn = *flags & sf_toobigwarn ? 1 : 0;
- si.join = sc->layers[layer].stroke_pen.linejoin;
- si.cap = sc->layers[layer].stroke_pen.linecap;
- si.removeoverlapifneeded = *flags & sf_removeoverlap ? 1 : 0;
- si.radius = sc->layers[layer].stroke_pen.width/2.0;
- if ( sc->layers[layer].stroke_pen.width==WIDTH_INHERITED )
- si.radius = .5;
- if ( si.cap == lc_inherited ) si.cap = lc_butt;
- if ( si.join == lc_inherited ) si.join = lj_miter;
- new = NULL;
- memcpy(transform,sc->layers[layer].stroke_pen.trans,4*sizeof(real));
- transform[4] = transform[5] = 0;
- MatInverse(inversetrans,transform);
- transed = SplinePointListTransform(SplinePointListCopy(
- sc->layers[layer].splines),inversetrans,true);
- for ( each = transed; each!=NULL; each=each->next ) {
- temp = SplineSetStroke(each,&si,sc);
- if ( new==NULL )
- new=temp;
- else
- nlast->next = temp;
- if ( temp!=NULL )
- for ( nlast=temp; nlast->next!=NULL; nlast=nlast->next );
- }
- new = SplinePointListTransform(new,transform,true);
- SplinePointListsFree(transed);
- if ( handle_eraser && sc->layers[layer].stroke_pen.brush.col==0xffffff ) {
- head = EraseStroke(sc,head,new);
- last = head;
- if ( last!=NULL )
- for ( ; last->next!=NULL; last=last->next );
- } else {
- if ( head==NULL )
- head = new;
- else
- last->next = new;
- if ( new!=NULL )
- for ( last = new; last->next!=NULL; last=last->next );
- }
- if ( si.toobigwarn )
- *flags |= sf_toobigwarn;
- }
- if ( sc->layers[layer].dofill ) {
- if ( handle_eraser && sc->layers[layer].fill_brush.col==0xffffff ) {
- head = EraseStroke(sc,head,sc->layers[layer].splines);
- last = head;
- if ( last!=NULL )
- for ( ; last->next!=NULL; last=last->next );
- } else {
- new = SplinePointListCopy(sc->layers[layer].splines);
- if ( head==NULL )
- head = new;
- else
- last->next = new;
- if ( new!=NULL )
- for ( last = new; last->next!=NULL; last=last->next );
- }
- }
- }
-return( head );
-}
-
-void SFSplinesFromLayers(SplineFont *sf,int tostroke) {
- /* User has turned off multi-layer, flatten the font */
- int i, layer;
- int flags= -1;
- Layer *new;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- CharView *cv;
-#endif
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- SplineChar *sc = sf->glyphs[i];
- SplineSet *splines = SplinesFromLayers(sc,&flags,tostroke);
- RefChar *head=NULL, *last=NULL;
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- if ( head==NULL )
- head = last = sc->layers[layer].refs;
- else
- last->next = sc->layers[layer].refs;
- if ( last!=NULL )
- while ( last->next!=NULL ) last = last->next;
- sc->layers[layer].refs = NULL;
- }
- new = gcalloc(2,sizeof(Layer));
- new[ly_back] = sc->layers[ly_back];
- memset(&sc->layers[ly_back],0,sizeof(Layer));
- LayerDefault(&new[ly_fore]);
- new[ly_fore].splines = splines;
- new[ly_fore].refs = head;
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- SplinePointListsMDFree(sc,sc->layers[layer].splines);
- RefCharsFree(sc->layers[layer].refs);
- ImageListsFree(sc->layers[layer].images);
- }
- free(sc->layers);
- sc->layers = new;
- sc->layer_cnt = 2;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- for ( cv=sc->views; cv!=NULL; cv=cv->next ) {
- cv->layerheads[dm_back] = &sc->layers[ly_back];
- cv->layerheads[dm_fore] = &sc->layers[ly_fore];
- }
-#endif
- }
- SFReinstanciateRefs(sf);
-}
-
-void SFSetLayerWidthsStroked(SplineFont *sf, real strokewidth) {
- int i;
- /* We changed from a stroked font to a multilayered font */
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- SplineChar *sc = sf->glyphs[i];
- sc->layers[ly_fore].dofill = false;
- sc->layers[ly_fore].dostroke = true;
- sc->layers[ly_fore].stroke_pen.width = strokewidth;
- }
-}
-#else
void SFSplinesFromLayers(SplineFont *sf, int tostroke) {
+ (void)sf;
+ (void)tostroke;
}
-#endif
static void EntityCharCorrectDir(EntityChar *ec) {
SplineSet *ss;
@@ -3069,11 +2642,12 @@ static void EntityCharCorrectDir(EntityChar *ec) {
for ( ss=ent->u.splines.splines; ss!=NULL; ss=ss->next )
SplineSetReverse(ss);
}
+ SplineSetsCorrect(ent->clippath,&changed);
}
}
}
-void EntityDefaultStrokeFill(Entity *ent) {
+static void EntityDefaultStrokeFill(Entity *ent) {
while ( ent!=NULL ) {
if ( ent->type == et_splines &&
ent->u.splines.stroke.col==0xffffffff &&
@@ -3097,7 +2671,7 @@ void EntityDefaultStrokeFill(Entity *ent) {
}
}
-SplinePointList *SplinesFromEntityChar(EntityChar *ec,int *flags,int is_stroked) {
+static SplinePointList *SplinesFromEntityChar(EntityChar *ec,int *flags,int is_stroked) {
Entity *ent, *next;
SplinePointList *head=NULL, *last, *new, *nlast, *temp, *each, *transed;
StrokeInfo si;
@@ -3105,7 +2679,7 @@ SplinePointList *SplinesFromEntityChar(EntityChar *ec,int *flags,int is_stroked)
/*SplineSet *spl;*/
int handle_eraser = false;
int ask = false;
- nlast = NULL; last = NULL;
+
EntityDefaultStrokeFill(ec->splines);
if ( !is_stroked ) {
@@ -3114,15 +2688,14 @@ SplinePointList *SplinesFromEntityChar(EntityChar *ec,int *flags,int is_stroked)
for ( ent=ec->splines; ent!=NULL; ent = ent->next ) {
if ( ent->type == et_splines &&
(ent->u.splines.fill.col==0xffffff ||
+ /*ent->u.splines.clippath!=NULL ||*/
(ent->u.splines.stroke_width!=0 && ent->u.splines.stroke.col!=0xffffffff))) {
ask = true;
break;
}
}
-#ifndef LUA_FF_LIB
if ( ask )
*flags = PsStrokeFlagsDlg();
-#endif
}
if ( *flags & sf_correctdir ) /* Will happen if flags still unset (-1) */
@@ -3212,37 +2785,12 @@ SplinePointList *SplinesFromEntityChar(EntityChar *ec,int *flags,int is_stroked)
for ( last = new; last->next!=NULL; last=last->next );
}
}
+ SplinePointListsFree(ent->clippath);
free(ent);
}
return( head );
}
-SplinePointList *SplinesFromEntities(Entity *ent,int *flags,int is_stroked) {
- EntityChar ec;
-
- memset(&ec,'\0',sizeof(ec));
- ec.splines = ent;
-return( SplinesFromEntityChar(&ec,flags,is_stroked));
-}
-
-SplinePointList *SplinePointListInterpretPS(FILE *ps,int flags,int is_stroked) {
- EntityChar ec;
- SplineChar sc;
-
- memset(&ec,'\0',sizeof(ec));
- memset(&sc,0,sizeof(sc)); sc.name = "<No particular character>";
- ec.sc = &sc;
- InterpretPS(ps,NULL,&ec,NULL);
-return( SplinesFromEntityChar(&ec,&flags,is_stroked));
-}
-
-Entity *EntityInterpretPS(FILE *ps) {
- EntityChar ec;
-
- memset(&ec,'\0',sizeof(ec));
- InterpretPS(ps,NULL,&ec,NULL);
-return( ec.splines );
-}
static RefChar *revrefs(RefChar *cur) {
RefChar *p, *n;
@@ -3266,10 +2814,11 @@ static void SCInterpretPS(FILE *ps,SplineChar *sc, int *flags) {
IO wrapper;
int ch;
- while ( Isspace(ch = getc(ps)) );
+ while ( isspace(ch = getc(ps)) );
ungetc(ch,ps);
memset(&wrapper,0,sizeof(wrapper));
+ wrapper.advance_width = UNDEFINED_WIDTH;
if ( ch!='<' ) {
pushio(&wrapper,ps,NULL,0);
@@ -3284,13 +2833,7 @@ static void SCInterpretPS(FILE *ps,SplineChar *sc, int *flags) {
ec.sc = sc;
_InterpretPS(&wrapper,&ec,NULL);
sc->width = ec.width;
-#ifdef FONTFORGE_CONFIG_TYPE3
- sc->layer_cnt = 1;
- SCAppendEntityLayers(sc,ec.splines);
- if ( sc->layer_cnt==1 ) ++sc->layer_cnt;
-#else
sc->layers[ly_fore].splines = SplinesFromEntityChar(&ec,flags,false);
-#endif
sc->layers[ly_fore].refs = revrefs(ec.refs);
free(wrapper.top);
}
@@ -3305,6 +2848,7 @@ void PSFontInterpretPS(FILE *ps,struct charprocs *cp,char **encoding) {
int flags = -1;
wrapper.top = NULL;
+ wrapper.advance_width = UNDEFINED_WIDTH;
pushio(&wrapper,ps,NULL,0);
while ( (tok = nextpstoken(&wrapper,&dval,tokbuf,sizeof(tokbuf)))!=pt_eof && tok!=pt_end ) {
@@ -3315,16 +2859,12 @@ void PSFontInterpretPS(FILE *ps,struct charprocs *cp,char **encoding) {
cp->values = grealloc(cp->values,cp->cnt*sizeof(char *));
}
if ( cp->next<cp->cnt ) {
- sc = SplineCharCreate();
+ sc = SplineCharCreate(2);
cp->keys[cp->next] = copy(tokbuf);
cp->values[cp->next++] = sc;
sc->name = copy(tokbuf);
SCInterpretPS(ps,sc,&flags);
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_progress_next();
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
} else {
memset(&dummy,0,sizeof(dummy));
dummy.fromtype3 = true;
@@ -3367,112 +2907,20 @@ void PSFontInterpretPS(FILE *ps,struct charprocs *cp,char **encoding) {
}
}
-/* Slurp up an encoding in the form:
- /Enc-name [
- /charname
- ...
- ] def
-We're not smart here no: 0 1 255 {1 index exch /.notdef put} for */
-Encoding *PSSlurpEncodings(FILE *file) {
- char *names[1024];
- int32 encs[1024];
- Encoding *item, *head = NULL, *last = NULL;
- char *encname;
- char tokbuf[200];
- IO wrapper;
- real dval;
- int i, max, any, enc, codepointsonly;
- int tok;
-
- wrapper.top = NULL;
- pushio(&wrapper,file,NULL,0);
-
- while ( (tok = nextpstoken(&wrapper,&dval,tokbuf,sizeof(tokbuf)))!=pt_eof ) {
- encname = NULL;
- if ( tok==pt_namelit ) {
- encname = copy(tokbuf);
- tok = nextpstoken(&wrapper,&dval,tokbuf,sizeof(tokbuf));
- }
- if ( tok!=pt_openarray && tok!=pt_opencurly )
-return( head );
- for ( i=0; i<sizeof(names)/sizeof(names[0]); ++i ) {
- encs[i] = -1;
- names[i]=NULL;
- }
- codepointsonly = CheckCodePointsComment(&wrapper);
-
- max = -1; any = 0; i=0;
- while ( (tok = nextpstoken(&wrapper,&dval,tokbuf,sizeof(tokbuf)))!=pt_eof &&
- tok!=pt_closearray && tok!=pt_closecurly ) {
- if ( tok==pt_namelit && i<sizeof(names)/sizeof(names[0]) ) {
- max = i;
- if ( strcmp(tokbuf,".notdef")==0 ) {
- encs[i] = -1;
- } else if ( (enc=UniFromName(tokbuf,ui_none,&custom))!=-1 ) {
- encs[i] = enc;
- /* Used not to do this, but there are several legal names */
- /* for some slots and people get unhappy (rightly) if we */
- /* use the wrong one */
- names[i] = copy(tokbuf);
- any = 1;
- } else {
- names[i] = copy(tokbuf);
- any = 1;
- }
- }
- ++i;
- }
- if ( encname!=NULL ) {
- tok = nextpstoken(&wrapper,&dval,tokbuf,sizeof(tokbuf));
- if ( tok==pt_def )
- /* Good */;
- }
- if ( max!=-1 ) {
- if ( ++max<256 ) max = 256;
- item = gcalloc(1,sizeof(Encoding));
- item->enc_name = encname;
- item->char_cnt = max;
- item->unicode = galloc(max*sizeof(int32));
- memcpy(item->unicode,encs,max*sizeof(int32));
- if ( any && !codepointsonly ) {
- item->psnames = gcalloc(max,sizeof(char *));
- memcpy(item->psnames,names,max*sizeof(char *));
- } else {
- for ( i=0; i<max; ++i )
- free(names[i]);
- }
- if ( head==NULL )
- head = item;
- else
- last->next = item;
- last = item;
- }
- }
-
-return( head );
-}
-
-int EvaluatePS(char *str,real *stack,int size) {
- EntityChar ec;
- RetStack rs;
-
- memset(&ec,'\0',sizeof(ec));
- memset(&rs,'\0',sizeof(rs));
- rs.max = size;
- rs.stack = stack;
- InterpretPS(NULL,str,&ec,&rs);
-return( rs.cnt );
-}
-
static void closepath(SplinePointList *cur, int is_type2) {
if ( cur!=NULL && cur->first==cur->last && cur->first->prev==NULL && is_type2 )
return; /* The "path" is just a single point created by a moveto */
/* Probably we're just doing another moveto */
if ( cur!=NULL && cur->first!=NULL && cur->first!=cur->last ) {
- if ( RealNear(cur->first->me.x,cur->last->me.x) && RealNear(cur->first->me.y,cur->last->me.y) ) {
+/* I allow for greater errors here than I do in the straight postscript code */
+/* because: 1) the rel-rel operators will accumulate more rounding errors */
+/* 2) I only output 2 decimal digits after the decimal in type1 output */
+ if ( RealWithin(cur->first->me.x,cur->last->me.x,.05) && RealWithin(cur->first->me.y,cur->last->me.y,.05) ) {
SplinePoint *oldlast = cur->last;
cur->first->prevcp = oldlast->prevcp;
- cur->first->noprevcp = false;
+ cur->first->prevcp.x += (cur->first->me.x-oldlast->me.x);
+ cur->first->prevcp.y += (cur->first->me.y-oldlast->me.y);
+ cur->first->noprevcp = oldlast->noprevcp;
oldlast->prev->from->next = NULL;
cur->last = oldlast->prev->from;
chunkfree(oldlast->prev,sizeof(*oldlast));
@@ -3635,11 +3083,11 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
int is_type2 = context->is_type2;
real stack[50]; int sp=0, v; /* Type1 stack is about 25 long, Type2 stack is 48 */
real transient[32];
- SplineChar *ret = SplineCharCreate();
+ SplineChar *ret = SplineCharCreate(2);
SplinePointList *cur=NULL, *oldcur=NULL;
RefChar *r1, *r2, *rlast=NULL;
- BasePoint current;
- real dx, dy, dx2, dy2, dx3, dy3, dx4, dy4, dx5, dy5, dx6, dy6;
+ DBasePoint current;
+ real dx, dy, dx2, dy2, dx3, dy3, dx4, dy4, dx5, dy5, dx6=0, dy6;
SplinePoint *pt;
/* subroutines may be nested to a depth of 10 */
struct substate { unsigned char *type1; int len; int subnum; } pcstack[11];
@@ -3658,7 +3106,6 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
real unblended[2][MmMax];
int last_was_b1=false, old_last_was_b1;
- dx6=0; /* compiler warning */
if ( !is_type2 && context->instance_count>1 )
memset(unblended,0,sizeof(unblended));
@@ -4173,27 +3620,27 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
}
if ( cur!=NULL && cur->first!=NULL && (cur->first!=cur->last || cur->first->next==NULL) ) {
current.x = rint((current.x+dx)*1024)/1024; current.y = rint((current.y+dy)*1024)/1024;
- cur->last->nextcp = current;
+ cur->last->nextcp.x = current.x; cur->last->nextcp.y = current.y;
cur->last->nonextcp = false;
current.x = rint((current.x+dx2)*1024)/1024; current.y = rint((current.y+dy2)*1024)/1024;
pt = chunkalloc(sizeof(SplinePoint));
pt->hintmask = pending_hm; pending_hm = NULL;
- pt->prevcp = current;
+ pt->prevcp.x = current.x; pt->prevcp.y = current.y;
current.x = rint((current.x+dx3)*1024)/1024; current.y = rint((current.y+dy3)*1024)/1024;
- pt->me = current;
+ pt->me.x = current.x; pt->me.y = current.y;
pt->nonextcp = true;
CheckMake(cur->last,pt);
SplineMake3(cur->last,pt);
cur->last = pt;
current.x = rint((current.x+dx4)*1024)/1024; current.y = rint((current.y+dy4)*1024)/1024;
- cur->last->nextcp = current;
+ cur->last->nextcp.x = current.x; cur->last->nextcp.y = current.y;
cur->last->nonextcp = false;
current.x = rint((current.x+dx5)*1024)/1024; current.y = rint((current.y+dy5)*1024)/1024;
pt = chunkalloc(sizeof(SplinePoint));
- pt->prevcp = current;
+ pt->prevcp.x = current.x; pt->prevcp.y = current.y;
current.x = rint((current.x+dx6)*1024)/1024; current.y = rint((current.y+dy6)*1024)/1024;
- pt->me = current;
+ pt->me.x = current.x; pt->me.y = current.y;
pt->nonextcp = true;
CheckMake(cur->last,pt);
SplineMake3(cur->last,pt);
@@ -4210,10 +3657,10 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
case 1: /* hstem */
case 18: /* hstemhm */
base = 0;
- if ( sp&1 ) {
+ if ( (sp&1) && ret->width == (int16) 0x8000 )
ret->width = stack[0];
+ if ( sp&1 )
base=1;
- }
if ( sp-base<2 )
LogError( _("Stack underflow on hstem in %s\n"), name );
/* stack[0] is absolute y for start of horizontal hint */
@@ -4252,14 +3699,15 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
case 19: /* hintmask */
case 20: /* cntrmask */
/* If there's anything on the stack treat it as a vstem hint */
- base = 0;
case 3: /* vstem */
case 23: /* vstemhm */
+ base = 0;
if ( cur==NULL || v==3 || v==23 ) {
- if ( (sp&1) && is_type2 ) {
+ if ( (sp&1) && is_type2 && ret->width == (int16) 0x8000 ) {
ret->width = stack[0];
- base=1;
}
+ if ( sp&1 )
+ base=1;
/* I've seen a vstemhm with no arguments. I've no idea what that */
/* means. It came right after a hintmask */
/* I'm confused about v/hstemhm because the manual says it needs */
@@ -4301,7 +3749,7 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
sp = 0;
}
if ( v==19 || v==20 ) { /* hintmask, cntrmask */
- int bytes = (hint_cnt+7)/8;
+ unsigned bytes = (hint_cnt+7)/8;
if ( bytes>sizeof(HintMask) ) bytes = sizeof(HintMask);
if ( v==19 ) {
ret->hstem = HintsAppend(ret->hstem,activeh); activeh=NULL;
@@ -4309,18 +3757,23 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
if ( pending_hm==NULL )
pending_hm = chunkalloc(sizeof(HintMask));
memcpy(pending_hm,type1,bytes);
- } else if ( cp<sizeof(counters)/sizeof(counters[0]) ) {
+ } else if ( cp<(int)(sizeof(counters)/sizeof(counters[0])) ) {
counters[cp] = chunkalloc(sizeof(HintMask));
memcpy(counters[cp],type1,bytes);
++cp;
}
+ if ( bytes!=(unsigned)hint_cnt/8 ) {
+ int mask = 0xff>>(hint_cnt&7);
+ if ( type1[bytes-1]&mask )
+ LogError( _("Hint mask (or counter mask) with too many hints in %s\n"), name );
+ }
type1 += bytes;
len -= bytes;
}
break;
case 14: /* endchar */
/* endchar is allowed to terminate processing even within a subroutine */
- if ( (sp&1) && is_type2 )
+ if ( (sp&1) && is_type2 && ret->width == (int16) 0x8000 )
ret->width = stack[0];
if ( context->painttype!=2 )
closepath(cur,is_type2);
@@ -4363,20 +3816,19 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
case 22: /* hmoveto */
case 4: /* vmoveto */
if ( is_type2 ) {
- if ( (v==21 && sp==3) || (v!=21 && sp==2)) {
+ if (( (v==21 && sp==3) || (v!=21 && sp==2)) && ret->width == (int16) 0x8000 )
/* Character's width may be specified on the first moveto */
ret->width = stack[0];
- stack[0] = stack[1]; stack[1] = stack[2]; --sp;
+ if ( v==21 && sp>2 ) {
+ stack[0] = stack[sp-2]; stack[1] = stack[sp-1];
+ sp = 2;
+ } else if ( v!=21 && sp>1 ) {
+ stack[0] = stack[sp-1];
+ sp = 1;
}
if ( context->painttype!=2 )
closepath(cur,true);
}
-#if 0 /* This doesn't work. It breaks type1 flex hinting. */
- /* There's now a special hack just before returning which closes any */
- /* open paths */
- else if ( cur!=NULL && cur->first->prev==NULL )
- closepath(cur,false); /* Even in type1 fonts closepath is optional */
-#endif
case 5: /* rlineto */
case 6: /* hlineto */
case 7: /* vlineto */
@@ -4408,12 +3860,12 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
current.x = rint((current.x+dx)*1024)/1024; current.y = rint((current.y+dy)*1024)/1024;
pt = chunkalloc(sizeof(SplinePoint));
pt->hintmask = pending_hm; pending_hm = NULL;
- pt->me = current;
+ pt->me.x = current.x; pt->me.y = current.y;
pt->noprevcp = true; pt->nonextcp = true;
if ( v==4 || v==21 || v==22 ) {
if ( cur!=NULL && cur->first==cur->last && cur->first->prev==NULL && is_type2 ) {
/* Two adjacent movetos should not create single point paths */
- cur->first->me = current;
+ cur->first->me.x = current.x; cur->first->me.y = current.y;
SplinePointFree(pt);
} else {
SplinePointList *spl = chunkalloc(sizeof(SplinePointList));
@@ -4445,7 +3897,7 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
if ( cur!=NULL ) {
pt = chunkalloc(sizeof(SplinePoint));
pt->hintmask = pending_hm; pending_hm = NULL;
- pt->me = current;
+ pt->me.x = current.x; pt->me.y = current.y;
pt->noprevcp = true; pt->nonextcp = true;
CheckMake(cur->last,pt);
SplineMake3(cur->last,pt);
@@ -4523,14 +3975,14 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
++polarity;
if ( cur!=NULL && cur->first!=NULL && (cur->first!=cur->last || cur->first->next==NULL) ) {
current.x = rint((current.x+dx)*1024)/1024; current.y = rint((current.y+dy)*1024)/1024;
- cur->last->nextcp = current;
+ cur->last->nextcp.x = current.x; cur->last->nextcp.y = current.y;
cur->last->nonextcp = false;
current.x = rint((current.x+dx2)*1024)/1024; current.y = rint((current.y+dy2)*1024)/1024;
pt = chunkalloc(sizeof(SplinePoint));
pt->hintmask = pending_hm; pending_hm = NULL;
- pt->prevcp = current;
+ pt->prevcp.x = current.x; pt->prevcp.y = current.y;
current.x = rint((current.x+dx3)*1024)/1024; current.y = rint((current.y+dy3)*1024)/1024;
- pt->me = current;
+ pt->me.x = current.x; pt->me.y = current.y;
pt->nonextcp = true;
CheckMake(cur->last,pt);
SplineMake3(cur->last,pt);
@@ -4543,7 +3995,7 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
if ( cur!=NULL ) { /* In legal code, cur can't be null here, but I got something illegal... */
pt = chunkalloc(sizeof(SplinePoint));
pt->hintmask = pending_hm; pending_hm = NULL;
- pt->me = current;
+ pt->me.x = current.x; pt->me.y = current.y;
pt->noprevcp = true; pt->nonextcp = true;
CheckMake(cur->last,pt);
SplineMake3(cur->last,pt);
@@ -4658,12 +4110,12 @@ SplineChar *PSCharStringToSplines(uint8 *type1, int len, struct pscontext *conte
}
ret->hstem = HintCleanup(ret->hstem,true,context->instance_count);
ret->vstem = HintCleanup(ret->vstem,true,context->instance_count);
- SCGuessHHintInstancesList(ret);
- SCGuessVHintInstancesList(ret);
+ SCGuessHHintInstancesList(ret,ly_fore);
+ SCGuessVHintInstancesList(ret,ly_fore);
ret->hconflicts = StemListAnyConflicts(ret->hstem);
ret->vconflicts = StemListAnyConflicts(ret->vstem);
if ( context->instance_count==1 && !ret->hconflicts && !ret->vconflicts )
- SCClearHintMasks(ret,false);
+ SCClearHintMasks(ret,ly_fore,false);
HintsRenumber(ret);
if ( name!=NULL && strcmp(name,".notdef")!=0 )
ret->widthset = true;
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pua.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pua.c
index 3e7582829bf..3e7582829bf 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/pua.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/pua.c
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/python.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/python.c
new file mode 100644
index 00000000000..e9ddbbecc94
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/python.c
@@ -0,0 +1,320 @@
+/* Copyright (C) 2007,2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/* Python Interface to FontForge */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include "uiinterface.h"
+
+typedef struct flaglist {
+ const char *name;
+ int flag;
+} flaglist;
+
+/* These don't get translated. They are a copy of a similar list in fontinfo.c */
+static struct flaglist sfnt_name_str_ids[] = {
+ { "SubFamily", 2},
+ { "Copyright", 0},
+ { "Family", 1},
+ { "Fullname", 4},
+ { "UniqueID", 3},
+ { "Version", 5},
+ { "PostscriptName", 6},
+ { "Trademark", 7},
+ { "Manufacturer", 8},
+ { "Designer", 9},
+ { "Descriptor", 10},
+ { "Vendor URL", 11},
+ { "Designer URL", 12},
+ { "License", 13},
+ { "License URL", 14},
+/* slot 15 is reserved */
+ { "Preferred Family", 16},
+ { "Preferred Styles", 17},
+ { "Compatible Full", 18},
+ { "Sample Text", 19},
+ { "CID findfont Name", 20},
+ { "WWS Family", 21},
+ { "WWS Subfamily", 22},
+ { NULL, 0 }
+};
+/* These don't get translated. They are a copy of a similar list in fontinfo.c */
+static struct flaglist sfnt_name_mslangs[] = {
+ { "Afrikaans", 0x436},
+ { "Albanian", 0x41c},
+ { "Amharic", 0x45e},
+ { "Arabic (Saudi Arabia)", 0x401},
+ { "Arabic (Iraq)", 0x801},
+ { "Arabic (Egypt)", 0xc01},
+ { "Arabic (Libya)", 0x1001},
+ { "Arabic (Algeria)", 0x1401},
+ { "Arabic (Morocco)", 0x1801},
+ { "Arabic (Tunisia)", 0x1C01},
+ { "Arabic (Oman)", 0x2001},
+ { "Arabic (Yemen)", 0x2401},
+ { "Arabic (Syria)", 0x2801},
+ { "Arabic (Jordan)", 0x2c01},
+ { "Arabic (Lebanon)", 0x3001},
+ { "Arabic (Kuwait)", 0x3401},
+ { "Arabic (U.A.E.)", 0x3801},
+ { "Arabic (Bahrain)", 0x3c01},
+ { "Arabic (Qatar)", 0x4001},
+ { "Armenian", 0x42b},
+ { "Assamese", 0x44d},
+ { "Azeri (Latin)", 0x42c},
+ { "Azeri (Cyrillic)", 0x82c},
+ { "Basque", 0x42d},
+ { "Byelorussian", 0x423},
+ { "Bengali", 0x445},
+ { "Bengali Bangladesh", 0x845},
+ { "Bulgarian", 0x402},
+ { "Burmese", 0x455},
+ { "Catalan", 0x403},
+ { "Cambodian", 0x453},
+ { "Cherokee", 0x45c},
+ { "Chinese (Taiwan)", 0x404},
+ { "Chinese (PRC)", 0x804},
+ { "Chinese (Hong Kong)", 0xc04},
+ { "Chinese (Singapore)", 0x1004},
+ { "Chinese (Macau)", 0x1404},
+ { "Croatian", 0x41a},
+ { "Croatian Bosnia/Herzegovina", 0x101a},
+ { "Czech", 0x405},
+ { "Danish", 0x406},
+ { "Divehi", 0x465},
+ { "Dutch", 0x413},
+ { "Flemish (Belgian Dutch)", 0x813},
+ { "Edo", 0x466},
+ { "English (British)", 0x809},
+ { "English (US)", 0x409},
+ { "English (Canada)", 0x1009},
+ { "English (Australian)", 0xc09},
+ { "English (New Zealand)", 0x1409},
+ { "English (Irish)", 0x1809},
+ { "English (South Africa)", 0x1c09},
+ { "English (Jamaica)", 0x2009},
+ { "English (Caribbean)", 0x2409},
+ { "English (Belize)", 0x2809},
+ { "English (Trinidad)", 0x2c09},
+ { "English (Zimbabwe)", 0x3009},
+ { "English (Philippines)", 0x3409},
+ { "English (Indonesia)", 0x3809},
+ { "English (Hong Kong)", 0x3c09},
+ { "English (India)", 0x4009},
+ { "English (Malaysia)", 0x4409},
+ { "Estonian", 0x425},
+ { "Faeroese", 0x438},
+ { "Farsi", 0x429},
+ { "Filipino", 0x464},
+ { "Finnish", 0x40b},
+ { "French French", 0x40c},
+ { "French Belgium", 0x80c},
+ { "French Canadian", 0xc0c},
+ { "French Swiss", 0x100c},
+ { "French Luxembourg", 0x140c},
+ { "French Monaco", 0x180c},
+ { "French West Indies", 0x1c0c},
+ { "French Réunion", 0x200c},
+ { "French D.R. Congo", 0x240c},
+ { "French Senegal", 0x280c},
+ { "French Camaroon", 0x2c0c},
+ { "French Côte d'Ivoire", 0x300c},
+ { "French Mali", 0x340c},
+ { "French Morocco", 0x380c},
+ { "French Haiti", 0x3c0c},
+ { "French North Africa", 0xe40c},
+ { "Frisian", 0x462},
+ { "Fulfulde", 0x467},
+ { "Gaelic (Scottish)", 0x43c},
+ { "Gaelic (Irish)", 0x83c},
+ { "Galician", 0x467},
+ { "Georgian", 0x437},
+ { "German German", 0x407},
+ { "German Swiss", 0x807},
+ { "German Austrian", 0xc07},
+ { "German Luxembourg", 0x1007},
+ { "German Liechtenstein", 0x1407},
+ { "Greek", 0x408},
+ { "Guarani", 0x474},
+ { "Gujarati", 0x447},
+ { "Hausa", 0x468},
+ { "Hawaiian", 0x475},
+ { "Hebrew", 0x40d},
+ { "Hindi", 0x439},
+ { "Hungarian", 0x40e},
+ { "Ibibio", 0x469},
+ { "Icelandic", 0x40f},
+ { "Igbo", 0x470},
+ { "Indonesian", 0x421},
+ { "Inuktitut", 0x45d},
+ { "Italian", 0x410},
+ { "Italian Swiss", 0x810},
+ { "Japanese", 0x411},
+ { "Kannada", 0x44b},
+ { "Kanuri", 0x471},
+ { "Kashmiri (India)", 0x860},
+ { "Kazakh", 0x43f},
+ { "Khmer", 0x453},
+ { "Kirghiz", 0x440},
+ { "Konkani", 0x457},
+ { "Korean", 0x412},
+ { "Korean (Johab)", 0x812},
+ { "Lao", 0x454},
+ { "Latvian", 0x426},
+ { "Latin", 0x476},
+ { "Lithuanian", 0x427},
+ { "Lithuanian (Classic)", 0x827},
+ { "Macedonian", 0x42f},
+ { "Malay", 0x43e},
+ { "Malay (Brunei)", 0x83e},
+ { "Malayalam", 0x44c},
+ { "Maltese", 0x43a},
+ { "Manipuri", 0x458},
+ { "Maori", 0x481},
+ { "Marathi", 0x44e},
+ { "Mongolian (Cyrillic)", 0x450},
+ { "Mongolian (Mongolian)", 0x850},
+ { "Nepali", 0x461},
+ { "Nepali (India)", 0x861},
+ { "Norwegian (Bokmal)", 0x414},
+ { "Norwegian (Nynorsk)", 0x814},
+ { "Oriya", 0x448},
+ { "Oromo", 0x472},
+ { "Papiamentu", 0x479},
+ { "Pashto", 0x463},
+ { "Polish", 0x415},
+ { "Portugese (Portugal)", 0x416},
+ { "Portuguese (Brasil)", 0x816},
+ { "Punjabi (India)", 0x446},
+ { "Punjabi (Pakistan)", 0x846},
+ { "Quecha (Bolivia)", 0x46b},
+ { "Quecha (Ecuador)", 0x86b},
+ { "Quecha (Peru)", 0xc6b},
+ { "Rhaeto-Romanic", 0x417},
+ { "Romanian", 0x418},
+ { "Romanian (Moldova)", 0x818},
+ { "Russian", 0x419},
+ { "Russian (Moldova)", 0x819},
+ { "Sami (Lappish)", 0x43b},
+ { "Sanskrit", 0x43b},
+ { "Sepedi", 0x46c},
+ { "Serbian (Cyrillic)", 0xc1a},
+ { "Serbian (Latin)", 0x81a},
+ { "Sindhi India", 0x459},
+ { "Sindhi Pakistan", 0x859},
+ { "Sinhalese", 0x45b},
+ { "Slovak", 0x41b},
+ { "Slovenian", 0x424},
+ { "Sorbian", 0x42e},
+ { "Spanish (Traditional)", 0x40a},
+ { "Spanish Mexico", 0x80a},
+ { "Spanish (Modern)", 0xc0a},
+ { "Spanish (Guatemala)", 0x100a},
+ { "Spanish (Costa Rica)", 0x140a},
+ { "Spanish (Panama)", 0x180a},
+ { "Spanish (Dominican Republic)", 0x1c0a},
+ { "Spanish (Venezuela)", 0x200a},
+ { "Spanish (Colombia)", 0x240a},
+ { "Spanish (Peru)", 0x280a},
+ { "Spanish (Argentina)", 0x2c0a},
+ { "Spanish (Ecuador)", 0x300a},
+ { "Spanish (Chile)", 0x340a},
+ { "Spanish (Uruguay)", 0x380a},
+ { "Spanish (Paraguay)", 0x3c0a},
+ { "Spanish (Bolivia)", 0x400a},
+ { "Spanish (El Salvador)", 0x440a},
+ { "Spanish (Honduras)", 0x480a},
+ { "Spanish (Nicaragua)", 0x4c0a},
+ { "Spanish (Puerto Rico)", 0x500a},
+ { "Spanish (United States)", 0x540a},
+ { "Spanish (Latin America)", 0xe40a},
+ { "Sutu", 0x430},
+ { "Swahili (Kenyan)", 0x441},
+ { "Swedish (Sweden)", 0x41d},
+ { "Swedish (Finland)", 0x81d},
+ { "Syriac", 0x45a},
+ { "Tagalog", 0x464},
+ { "Tajik", 0x428},
+ { "Tamazight (Arabic)", 0x45f},
+ { "Tamazight (Latin)", 0x85f},
+ { "Tamil", 0x449},
+ { "Tatar (Tatarstan)", 0x444},
+ { "Telugu", 0x44a},
+ { "Thai", 0x41e},
+ { "Tibetan (PRC)", 0x451},
+ { "Tibetan Bhutan", 0x851},
+ { "Tigrinya Ethiopia", 0x473},
+ { "Tigrinyan Eritrea", 0x873},
+ { "Tsonga", 0x431},
+ { "Tswana", 0x432},
+ { "Turkish", 0x41f},
+ { "Turkmen", 0x442},
+ { "Uighur", 0x480},
+ { "Ukrainian", 0x422},
+ { "Urdu (Pakistan)", 0x420},
+ { "Urdu (India)", 0x820},
+ { "Uzbek (Latin)", 0x443},
+ { "Uzbek (Cyrillic)", 0x843},
+ { "Venda", 0x433},
+ { "Vietnamese", 0x42a},
+ { "Welsh", 0x452},
+ { "Xhosa", 0x434},
+ { "Yi", 0x478},
+ { "Yiddish", 0x43d},
+ { "Yoruba", 0x46a},
+ { "Zulu", 0x435},
+ { NULL, 0 }};
+
+const char *NOUI_TTFNameIds(int id) {
+ int i;
+
+ for ( i=0; sfnt_name_str_ids[i].name!=NULL; ++i )
+ if ( sfnt_name_str_ids[i].flag == id )
+return( (char *) sfnt_name_str_ids[i].name );
+
+return( "Unknown" );
+}
+
+const char *NOUI_MSLangString(int language) {
+ int i;
+
+ for ( i=0; sfnt_name_mslangs[i].name!=NULL; ++i )
+ if ( sfnt_name_mslangs[i].flag == language )
+return( (char *) sfnt_name_mslangs[i].name );
+
+ language &= 0xff;
+ for ( i=0; sfnt_name_mslangs[i].name!=NULL; ++i )
+ if ( sfnt_name_mslangs[i].flag == language )
+return( (char *) sfnt_name_mslangs[i].name );
+
+return( "Unknown" );
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/scripting.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/scripting.h
index 0e5756c5b31..f24eecca9be 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/scripting.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/scripting.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2007 by George Williams */
+/* Copyright (C) 2005-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -28,7 +28,7 @@
#ifndef _SCRIPTING_H
#define _SCRIPTING_H
-#include "pfaeditui.h"
+#include "fontforgevw.h"
#include <setjmp.h>
#include <stdarg.h>
@@ -89,10 +89,12 @@ typedef struct context {
char *filename; /* Irrelevant for user defined funcs */
int lineno; /* Irrelevant for user defined funcs */
int ungotch; /* Irrelevant for user defined funcs */
- FontView *curfv; /* Current fontview */
+ FontViewBase *curfv; /* Current fontview */
jmp_buf *err_env; /* place to longjump to on an error */
} Context;
+void arrayfree(Array *);
+
void FontImage(SplineFont *sf,char *filename,Array *arr,int width,int height);
/* Adds a user defined scripting function to the interpretter */
@@ -126,4 +128,13 @@ void ScriptErrorString( Context *c, const char *msg, const char *name);
void ScriptErrorF( Context *c, const char *fmt, ... );
/* Standard printf-style spec. All string arguments assumed to be in */
/* utf8 */
+
+extern int running_script;
+
+/* Hooks so a scripting dlg can execute fontforge's legacy scripting language */
+extern void ff_VerboseCheck(void);
+extern enum token_type ff_NextToken(Context *c);
+extern void ff_backuptok(Context *c);
+extern void ff_statement(Context*);
+
#endif /* _SCRIPTING_H */
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/sd.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sd.h
index 6428c079537..ab365789148 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/sd.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -26,22 +26,24 @@
*/
#ifndef _SD_H
#define _SD_H
+# include <gimage.h>
/* All coordinates are in millimeters */
/* they will be displayed to the user scaled by the units field of the design */
#include "splinefont.h"
-#if defined(FONTFORGE_CONFIG_GTK)
-# include <gtk/gtk.h>
-#elif defined(FONTFORGE_CONFIG_GDRAW)
-# include "gdraw.h"
-#else
-# include <ggadget.h> /* Need GImage, gettext, etc. even if no UI */
-#endif
+
+struct epattern {
+ struct entity *tile;
+ real width, height;
+ DBounds bbox;
+ real transform[6];
+};
typedef struct entpen {
Color col;
- struct tile *tile;
+ struct gradient *grad;
+ struct epattern *tile;
float scale;
float opacity;
} Pen;
@@ -81,6 +83,7 @@ typedef struct entity {
struct entity *group;
} group;
} u;
+ SplineSet *clippath;
DBounds bb;
struct entity *next;
} Entity;
@@ -93,16 +96,8 @@ typedef struct entlayer {
typedef struct tile {
Entity *tile;
-#ifdef FONTFORGE_CONFIG_NO_WINDOWING_UI
- struct tileinstance { real scale;struct tileinstance *next; }
- *instances;
-#elif defined( FONTFORGE_CONFIG_GTK )
- struct tileinstance { real scale; GdkWindow pixmap; struct tileinstance *next; }
+ struct tileinstance { real scale; struct gwindow *pixmap; struct tileinstance *next; }
*instances;
-#elif defined( FONTFORGE_CONFIG_GDRAW )
- struct tileinstance { real scale; GWindow pixmap; struct tileinstance *next; }
- *instances;
-#endif
char *name;
} Tile;
@@ -119,11 +114,11 @@ typedef struct splinedesign {
struct dview *dvs;
} SplineDesign, Design;
-extern Entity *EntityInterpretPS(FILE *ps);
+extern Entity *EntityInterpretPS(FILE *ps,int *width);
extern Entity *EntityInterpretSVG(char *filename,char *memory, int memlen, int em_size,int ascent);
+extern Entity *EntityInterpretPDFPage(FILE *pdf,int select_page);
extern SplinePointList *SplinesFromEntities(Entity *ent,int *flags,int is_stroked);
extern void SCAppendEntityLayers(SplineChar *sc, Entity *ent);
-extern void EntityDefaultStrokeFill(Entity *ent);
/* Used for type3 fonts briefly */
/* This is not a "real" structure. It is a temporary hack that encompasses */
@@ -136,8 +131,6 @@ typedef struct entitychar {
uint8 fromtype3;
} EntityChar;
-extern SplinePointList *SplinesFromEntityChar(EntityChar *ec,int *flags,int is_stroked);
-
struct pskeydict {
int16 cnt, max;
uint8 is_executable;
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/scriptfuncs.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.c
index f00fb737b81..0cbfbaf1d0a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/scriptfuncs.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006,2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -25,15 +25,24 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _SCRIPTFUNCS_H
-#define _SCRIPTFUNCS_H
+#include "pfaedit.h"
+#include "sfd1.h"
+#include <string.h>
-#include "scripting.h"
-extern int CompareGlyphs(Context *c, real pt_err, real spline_err,
- real pixel_off_frac, int bb_err, int comp_hints, int diffs_are_errors );
-extern int CompareLayer(Context *c, const SplineSet *ss1,const SplineSet *ss2,
- const RefChar *refs1, const RefChar *refs2,
- real pt_err, real spline_err, const char *name, int diffs_are_errors,
- SplinePoint **_hmfail);
-#endif /* _SCRIPTFUNCS_H */
+enum uni_interp interp_from_encoding(Encoding *enc,enum uni_interp interp) {
+
+ if ( enc==NULL )
+return( interp );
+
+ if ( enc->is_japanese )
+ interp = ui_japanese;
+ else if ( enc->is_korean )
+ interp = ui_korean;
+ else if ( enc->is_tradchinese )
+ interp = ui_trad_chinese;
+ else if ( enc->is_simplechinese )
+ interp = ui_simp_chinese;
+return( interp );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/sfd1.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h
index b8fd236689f..6d72f3e8630 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/sfd1.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/sfd1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c
new file mode 100644
index 00000000000..7245bb926bb
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinechar.c
@@ -0,0 +1,266 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "fontforgevw.h"
+#include <math.h>
+#include <locale.h>
+# include <ustring.h>
+# include <utype.h>
+# include <gresource.h>
+#ifdef HAVE_IEEEFP_H
+# include <ieeefp.h> /* Solaris defines isnan in ieeefp rather than math.h */
+#endif
+#include "ttf.h"
+
+int adjustwidth = true;
+int adjustlbearing = true;
+int allow_utf8_glyphnames = false;
+int clear_tt_instructions_when_needed = true;
+
+void SCClearRounds(SplineChar *sc,int layer) {
+ SplineSet *ss;
+ SplinePoint *sp;
+
+ for ( ss=sc->layers[layer].splines; ss!=NULL; ss=ss->next ) {
+ for ( sp=ss->first; ; ) {
+ sp->roundx = sp->roundy = false;
+ if ( sp->next==NULL )
+ break;
+ sp = sp->next->to;
+ if ( sp==ss->first )
+ break;
+ }
+ }
+}
+
+
+void SCClearLayer(SplineChar *sc,int layer) {
+ RefChar *refs, *next;
+
+ SplinePointListsFree(sc->layers[layer].splines);
+ sc->layers[layer].splines = NULL;
+ for ( refs=sc->layers[layer].refs; refs!=NULL; refs = next ) {
+ next = refs->next;
+ SCRemoveDependent(sc,refs,layer);
+ }
+ sc->layers[layer].refs = NULL;
+ ImageListsFree(sc->layers[layer].images);
+ sc->layers[layer].images = NULL;
+}
+
+void SCClearContents(SplineChar *sc,int layer) {
+ int ly_first, ly_last;
+
+ if ( sc==NULL )
+return;
+ if ( sc->parent!=NULL && sc->parent->multilayer ) {
+ ly_first = ly_fore;
+ ly_last = sc->layer_cnt-1;
+ } else
+ ly_first = ly_last = layer;
+ for ( layer = ly_first; layer<=ly_last; ++layer )
+ SCClearLayer(sc,layer);
+ --layer;
+
+ if ( sc->parent!=NULL &&
+ (sc->parent->multilayer ||
+ (!sc->parent->layers[layer].background && SCWasEmpty(sc,layer)))) {
+ sc->widthset = false;
+ if ( sc->parent!=NULL && sc->width!=0 )
+ sc->width = sc->parent->ascent+sc->parent->descent;
+ AnchorPointsFree(sc->anchor);
+ sc->anchor = NULL;
+ StemInfosFree(sc->hstem); sc->hstem = NULL;
+ StemInfosFree(sc->vstem); sc->vstem = NULL;
+ DStemInfosFree(sc->dstem); sc->dstem = NULL;
+ MinimumDistancesFree(sc->md); sc->md = NULL;
+ free(sc->ttf_instrs);
+ sc->ttf_instrs = NULL;
+ sc->ttf_instrs_len = 0;
+ SCOutOfDateBackground(sc);
+ }
+}
+
+
+void SplinePointRound(SplinePoint *sp,real factor) {
+
+ sp->nextcp.x = rint(sp->nextcp.x*factor)/factor;
+ sp->nextcp.y = rint(sp->nextcp.y*factor)/factor;
+ if ( sp->next!=NULL && sp->next->order2 )
+ sp->next->to->prevcp = sp->nextcp;
+ sp->prevcp.x = rint(sp->prevcp.x*factor)/factor;
+ sp->prevcp.y = rint(sp->prevcp.y*factor)/factor;
+ if ( sp->prev!=NULL && sp->prev->order2 )
+ sp->prev->from->nextcp = sp->prevcp;
+ if ( sp->prev!=NULL && sp->next!=NULL && sp->next->order2 &&
+ sp->ttfindex == 0xffff ) {
+ sp->me.x = (sp->nextcp.x + sp->prevcp.x)/2;
+ sp->me.y = (sp->nextcp.y + sp->prevcp.y)/2;
+ } else {
+ sp->me.x = rint(sp->me.x*factor)/factor;
+ sp->me.y = rint(sp->me.y*factor)/factor;
+ }
+}
+
+void SplineSetsRound2Int(SplineSet *spl,real factor, int inspiro, int onlysel) {
+ SplinePoint *sp;
+
+ for ( ; spl!=NULL; spl=spl->next ) {
+ if ( inspiro ) {
+ } else {
+ for ( sp=spl->first; ; ) {
+ if ( sp->selected || !onlysel )
+ SplinePointRound(sp,factor);
+ if ( sp->prev!=NULL )
+ SplineRefigure(sp->prev);
+ if ( sp->next==NULL )
+ break;
+ sp = sp->next->to;
+ if ( sp==spl->first )
+ break;
+ }
+ if ( spl->first->prev!=NULL )
+ SplineRefigure(spl->first->prev);
+ }
+ }
+}
+
+
+void AltUniAdd(SplineChar *sc,int uni) {
+ struct altuni *altuni;
+
+ if ( sc!=NULL && uni!=-1 && uni!=sc->unicodeenc ) {
+ for ( altuni = sc->altuni; altuni!=NULL && (altuni->unienc!=uni ||
+ altuni->vs!=-1 ||
+ altuni->fid); altuni=altuni->next );
+ if ( altuni==NULL ) {
+ altuni = chunkalloc(sizeof(struct altuni));
+ altuni->next = sc->altuni;
+ sc->altuni = altuni;
+ altuni->unienc = uni;
+ altuni->vs = -1;
+ altuni->fid = 0;
+ }
+ }
+}
+
+void SCOrderAP(SplineChar *sc) {
+ int lc=0, cnt=0, out=false, i,j;
+ AnchorPoint *ap, **array;
+ /* Order so that first ligature index comes first */
+
+ for ( ap=sc->anchor; ap!=NULL; ap=ap->next ) {
+ if ( ap->lig_index<lc ) out = true;
+ if ( ap->lig_index>lc ) lc = ap->lig_index;
+ ++cnt;
+ }
+ if ( !out )
+return;
+
+ array = galloc(cnt*sizeof(AnchorPoint *));
+ for ( i=0, ap=sc->anchor; ap!=NULL; ++i, ap=ap->next )
+ array[i] = ap;
+ for ( i=0; i<cnt-1; ++i ) {
+ for ( j=i+1; j<cnt; ++j ) {
+ if ( array[i]->lig_index>array[j]->lig_index ) {
+ ap = array[i];
+ array[i] = array[j];
+ array[j] = ap;
+ }
+ }
+ }
+ sc->anchor = array[0];
+ for ( i=0; i<cnt-1; ++i )
+ array[i]->next = array[i+1];
+ array[cnt-1]->next = NULL;
+ free( array );
+}
+
+
+static void SCUpdateNothing(SplineChar *sc) {
+}
+
+static void SCHintsChng(SplineChar *sc) {
+ sc->changedsincelasthinted = false;
+ if ( !sc->changed ) {
+ sc->changed = true;
+ sc->parent->changed = true;
+ }
+}
+
+static void _SCChngNoUpdate(SplineChar *sc,int layer,int changed) {
+}
+
+static void SCChngNoUpdate(SplineChar *sc,int layer) {
+ _SCChngNoUpdate(sc,layer,true);
+}
+
+static void SCB_MoreLayers(SplineChar *sc,Layer *old) {
+}
+
+static struct sc_interface noui_sc = {
+ SCUpdateNothing,
+ SCUpdateNothing,
+ SCUpdateNothing,
+ SCHintsChng,
+ SCChngNoUpdate,
+ _SCChngNoUpdate,
+ SCUpdateNothing,
+ SCUpdateNothing,
+ SCB_MoreLayers
+};
+
+struct sc_interface *sc_interface = &noui_sc;
+
+void FF_SetSCInterface(struct sc_interface *sci) {
+ sc_interface = sci;
+}
+
+static void CVChngNoUpdate(CharViewBase *cv) {
+}
+
+static void _CVChngNoUpdate(CharViewBase *cv,int changed) {
+}
+
+static void CVGlphRenameFixup(SplineFont *sf,char *oldname, char *newname) {
+}
+
+static void CV__LayerPaletteCheck(SplineFont *sf) {
+}
+
+static struct cv_interface noui_cv = {
+ CVChngNoUpdate,
+ _CVChngNoUpdate,
+ CVGlphRenameFixup,
+ CV__LayerPaletteCheck
+};
+
+struct cv_interface *cv_interface = &noui_cv;
+
+void FF_SetCVInterface(struct cv_interface *cvi) {
+ cv_interface = cvi;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c
new file mode 100644
index 00000000000..c8f55197d6e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefill.c
@@ -0,0 +1,535 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include <stdio.h>
+#include <string.h>
+#include <ustring.h>
+#include <math.h>
+#include "gdraw.h"
+#include "splinefont.h"
+#include "edgelist.h"
+
+Color default_background = 0xffffff; /* white */
+
+static void HintsFree(Hints *h) {
+ Hints *hnext;
+ for ( ; h!=NULL; h = hnext ) {
+ hnext = h->next;
+ free(h);
+ }
+}
+
+static void _FreeEdgeList(EdgeList *es) {
+ int i;
+
+ /* edges will be NULL if the user tries to make an enormous bitmap */
+ /* if the linear size is bigger than several thousand, we just */
+ /* ignore the request */
+ if ( es->edges!=NULL ) {
+ for ( i=0; i<es->cnt; ++i ) {
+ Edge *e, *next;
+ for ( e = es->edges[i]; e!=NULL; e = next ) {
+ next = e->esnext;
+ free(e);
+ }
+ es->edges[i] = NULL;
+ }
+ }
+}
+
+void FreeEdges(EdgeList *es) {
+ _FreeEdgeList(es);
+ free(es->edges);
+ free(es->interesting);
+ HintsFree(es->hhints);
+ HintsFree(es->vhints);
+}
+
+extended IterateSplineSolve(const Spline1D *sp, extended tmin, extended tmax,
+ extended sought,double err) {
+ extended t, low, high, test;
+ Spline1D temp;
+ int cnt;
+
+ /* Now the closed form CubicSolver can have rounding errors so if we know */
+ /* the spline to be monotonic, an iterative approach is more accurate */
+
+ temp = *sp;
+ temp.d -= sought;
+
+ if ( temp.a==0 && temp.b==0 && temp.c!=0 ) {
+ t = -temp.d/(extended) temp.c;
+ if ( t<0 || t>1 )
+return( -1 );
+return( t );
+ }
+
+ low = ((temp.a*tmin+temp.b)*tmin+temp.c)*tmin+temp.d;
+ high = ((temp.a*tmax+temp.b)*tmax+temp.c)*tmax+temp.d;
+ if ( low<err && low>-err )
+return(tmin);
+ if ( high<err && high>-err )
+return(tmax);
+ if (( low<0 && high>0 ) ||
+ ( low>0 && high<0 )) {
+
+ for ( cnt=0; cnt<1000; ++cnt ) { /* Avoid impossible error limits */
+ t = (tmax+tmin)/2;
+ test = ((temp.a*t+temp.b)*t+temp.c)*t+temp.d;
+ if ( test>-err && test<err )
+return( t );
+ if ( (low<0 && test<0) || (low>0 && test>0) )
+ tmin=t;
+ else
+ tmax = t;
+ }
+return( (tmax+tmin)/2 );
+ }
+return( -1 );
+}
+
+double TOfNextMajor(Edge *e, EdgeList *es, double sought_m ) {
+ /* We want to find t so that Mspline(t) = sought_m */
+ /* the curve is monotonic */
+ Spline1D *msp = &e->spline->splines[es->major];
+ double new_t;
+
+ if ( es->is_overlap ) {
+
+ /* if we've adjusted the height then we won't be able to find it restricting */
+ /* t between [0,1] as we do. So it's a special case. (this is to handle */
+ /* hstem hints) */
+ if ( e->max_adjusted && sought_m==e->mmax ) {
+ e->m_cur = sought_m;
+return( e->up?1.0:0.0 );
+ }
+
+ new_t = IterateSplineSolve(msp,e->t_mmin,e->t_mmax,(sought_m+es->mmin)/es->scale,.001);
+ if ( new_t==-1 )
+ IError( "No Solution");
+ e->m_cur = (((msp->a*new_t + msp->b)*new_t+msp->c)*new_t + msp->d)*es->scale - es->mmin;
+return( new_t );
+ } else {
+ Spline *sp = e->spline;
+
+ if ( sp->islinear ) {
+ new_t = e->t_cur + (sought_m-e->m_cur)/(es->scale * msp->c);
+ e->m_cur = (msp->c*new_t + msp->d)*es->scale - es->mmin;
+return( new_t );
+ }
+ /* if we have a spline that is nearly horizontal at its max. endpoint */
+ /* then finding A value of t for which y has the right value isn't good */
+ /* enough (at least not when finding intersections) */
+ if ( sought_m+1>e->mmax ) {
+ e->m_cur = e->mmax;
+return( e->t_mmax );
+ }
+
+ /* if we've adjusted the height then we won't be able to find it restricting */
+ /* t between [0,1] as we do. So it's a special case. (this is to handle */
+ /* hstem hints) */
+ if ( e->max_adjusted && sought_m==e->mmax ) {
+ e->m_cur = sought_m;
+return( e->up?1.0:0.0 );
+ }
+ new_t = IterateSplineSolve(msp,e->t_mmin,e->t_mmax,(sought_m+es->mmin)/es->scale,.001);
+ if ( new_t==-1 )
+ IError( "No Solution");
+ e->m_cur = (((msp->a*new_t + msp->b)*new_t+msp->c)*new_t + msp->d)*es->scale - es->mmin;
+return( new_t );
+ }
+}
+
+static int SlopeLess(Edge *e, Edge *p, int other) {
+ Spline1D *osp = &e->spline->splines[other];
+ Spline1D *psp = &p->spline->splines[other];
+ Spline1D *msp = &e->spline->splines[!other];
+ Spline1D *qsp = &p->spline->splines[!other];
+ real os = (3*osp->a*e->t_cur+2*osp->b)*e->t_cur+osp->c,
+ ps = (3*psp->a*p->t_cur+2*psp->b)*p->t_cur+psp->c;
+ real ms = (3*msp->a*e->t_cur+2*msp->b)*e->t_cur+msp->c,
+ qs = (3*qsp->a*p->t_cur+2*qsp->b)*p->t_cur+qsp->c;
+ if ( ms<.0001 && ms>-.0001 ) ms = 0;
+ if ( qs<.0001 && qs>-.0001 ) qs = 0;
+ if ( qs==0 ) {
+ if ( p->t_cur==1 ) {
+ qs = (3*qsp->a*.9999+2*qsp->b)*.9999+qsp->c;
+ ps = (3*psp->a*.9999+2*psp->b)*.9999+psp->c;
+ } else {
+ qs = (3*qsp->a*(p->t_cur+.0001)+2*qsp->b)*(p->t_cur+.0001)+qsp->c;
+ ps = (3*psp->a*(p->t_cur+.0001)+2*psp->b)*(p->t_cur+.0001)+psp->c;
+ }
+ }
+ if ( ms==0 ) {
+ if ( e->t_cur==1 ) {
+ ms = (3*msp->a*.9999+2*msp->b)*.9999+msp->c;
+ os = (3*osp->a*.9999+2*osp->b)*.9999+osp->c;
+ } else {
+ ms = (3*msp->a*(e->t_cur+.0001)+2*msp->b)*(e->t_cur+.0001)+msp->c;
+ os = (3*osp->a*(e->t_cur+.0001)+2*osp->b)*(e->t_cur+.0001)+osp->c;
+ }
+ }
+ if ( e->t_cur-e->tmin > e->tmax-e->t_cur ) { os = -os; ms = -ms; }
+ if ( p->t_cur-p->tmin > p->tmax-p->t_cur ) { ps = -ps; qs = -qs; }
+ if ( ms!=0 && qs!=0 ) { os /= ms; ps /= qs; }
+ else if ( ms==0 && qs==0 ) /* Do Nothing */;
+ else if ( (ms==0 && os>0) || (qs==0 && ps<0) ) /* Does this make sense? */
+return( false );
+ else if ( (ms==0 && os<0) || (qs==0 && ps>0) ) /* Does this make sense? */
+return( true );
+
+ if ( os==ps || ms==0 || qs==0 )
+return( e->o_mmax<p->o_mmax );
+
+return( os<ps );
+}
+
+static void AddEdge(EdgeList *es, Spline *sp, real tmin, real tmax ) {
+ Edge *e, *pr;
+ real m1, m2;
+ int mpos;
+ Hints *hint;
+ Spline1D *msp = &sp->splines[es->major], *osp = &sp->splines[es->other];
+
+ e = gcalloc(1,sizeof(Edge));
+ e->spline = sp;
+
+ m1 = ( ((msp->a*tmin+msp->b)*tmin+msp->c)*tmin + msp->d ) * es->scale;
+ m2 = ( ((msp->a*tmax+msp->b)*tmax+msp->c)*tmax + msp->d ) * es->scale;
+ if ( m1>m2 ) {
+ e->mmin = m2;
+ e->t_mmin = tmax;
+ e->mmax = m1;
+ e->t_mmax = tmin;
+ e->up = false;
+ } else {
+ e->mmax = m2;
+ e->t_mmax = tmax;
+ e->mmin = m1;
+ e->t_mmin = tmin;
+ e->up = true;
+ }
+ if ( RealNear(e->mmin,es->mmin)) e->mmin = es->mmin;
+ e->o_mmin = ( ((osp->a*e->t_mmin+osp->b)*e->t_mmin+osp->c)*e->t_mmin + osp->d ) * es->scale;
+ e->o_mmax = ( ((osp->a*e->t_mmax+osp->b)*e->t_mmax+osp->c)*e->t_mmax + osp->d ) * es->scale;
+ e->mmin -= es->mmin; e->mmax -= es->mmin;
+ e->t_cur = e->t_mmin;
+ e->o_cur = e->o_mmin;
+ e->m_cur = e->mmin;
+ e->last_opos = e->last_mpos = -2;
+ e->tmin = tmin; e->tmax = tmax;
+
+ if ( e->mmin<0 || e->mmin>=e->mmax ) {
+ /*IError("Probably not serious, but we've got a zero length spline in AddEdge in %s",es->sc==NULL?<nameless>:es->sc->name);*/
+ free(e);
+return;
+ }
+
+ if ( es->sc!=NULL ) for ( hint=es->hhints; hint!=NULL; hint=hint->next ) {
+ if ( hint->adjustb ) {
+ if ( e->m_cur>hint->b1 && e->m_cur<hint->b2 ) {
+ e->m_cur = e->mmin = hint->ab;
+ e->min_adjusted = true;
+ } else if ( e->mmax>hint->b1 && e->mmax<hint->b2 ) {
+ e->mmax = hint->ab;
+ e->max_adjusted = true;
+ }
+ } else if ( hint->adjuste ) {
+ if ( e->m_cur>hint->e1 && e->m_cur<hint->e2 ) {
+ e->m_cur = e->mmin = hint->ae;
+ e->min_adjusted = true;
+ } else if ( e->mmax>hint->e1 && e->mmax<hint->e2 ) {
+ e->mmax = hint->ae;
+ e->max_adjusted = true;
+ }
+ }
+ }
+
+ mpos = (int) ceil(e->m_cur);
+ if ( mpos>e->mmax || mpos>=es->cnt ) {
+ free(e);
+return;
+ }
+
+ if ( e->m_cur!=ceil(e->m_cur) ) {
+ /* bring the new edge up to its first scan line */
+ e->t_cur = TOfNextMajor(e,es,ceil(e->m_cur));
+ e->o_cur = ( ((osp->a*e->t_cur+osp->b)*e->t_cur+osp->c)*e->t_cur + osp->d ) * es->scale;
+ }
+
+ e->before = es->last;
+ if ( es->last!=NULL )
+ es->last->after = e;
+ if ( es->last==NULL )
+ es->splinesetfirst = e;
+ es->last = e;
+
+ if ( es->edges[mpos]==NULL || e->o_cur<es->edges[mpos]->o_cur ||
+ (e->o_cur==es->edges[mpos]->o_cur && SlopeLess(e,es->edges[mpos],es->other))) {
+ e->esnext = es->edges[mpos];
+ es->edges[mpos] = e;
+ } else {
+ for ( pr=es->edges[mpos]; pr->esnext!=NULL && pr->esnext->o_cur<e->o_cur ;
+ pr = pr->esnext );
+ /* When two splines share a vertex which is a local minimum, then */
+ /* o_cur will be equal for both (to the vertex's o value) and so */
+ /* the above code randomly picked one to go first. That screws up */
+ /* the overlap code, which wants them properly ordered from the */
+ /* start. so look at the end point, nope the end point isn't always */
+ /* meaningful, look at the slope... */
+ if ( pr->esnext!=NULL && pr->esnext->o_cur==e->o_cur &&
+ SlopeLess(e,pr->esnext,es->other)) {
+ pr = pr->esnext;
+ }
+ e->esnext = pr->esnext;
+ pr->esnext = e;
+ }
+ if ( es->interesting ) {
+ /* Mark the other end of the spline as interesting */
+ es->interesting[(int) ceil(e->mmax)]=1;
+ }
+}
+
+static void AddMajorEdge(EdgeList *es, Spline *sp) {
+ Edge *e, *pr;
+ real m1;
+ Spline1D *msp = &sp->splines[es->major], *osp = &sp->splines[es->other];
+
+ e = gcalloc(1,sizeof(Edge));
+ e->spline = sp;
+
+ e->mmin = e->mmax = m1 = msp->d * es->scale - es->mmin;
+ e->t_mmin = 0;
+ e->t_mmax = 1;
+ e->up = false;
+ e->o_mmin = osp->d * es->scale;
+ e->o_mmax = ( osp->a + osp->b + osp->c + osp->d ) * es->scale;
+ if ( e->o_mmin == e->o_mmax ) { /* Just a point? */
+ free(e);
+return;
+ }
+ if ( e->mmin<0 )
+ IError("Grg!");
+
+ if ( ceil(e->m_cur)>e->mmax ) {
+ free(e);
+return;
+ }
+
+ if ( es->majors==NULL || es->majors->mmin>=m1 ) {
+ e->esnext = es->majors;
+ es->majors = e;
+ } else {
+ for ( pr=es->majors; pr->esnext!=NULL && pr->esnext->mmin<m1; pr = pr->esnext );
+ e->esnext = pr->esnext;
+ pr->esnext = e;
+ }
+}
+
+static void AddSpline(EdgeList *es, Spline *sp ) {
+ real t1=2, t2=2, t;
+ real b2_fourac;
+ real fm, tm;
+ Spline1D *msp = &sp->splines[es->major], *osp = &sp->splines[es->other];
+
+ /* Find the points of extrema on the curve discribing y behavior */
+ if ( !RealNear(msp->a,0) ) {
+ /* cubic, possibly 2 extrema (possibly none) */
+ b2_fourac = 4*msp->b*msp->b - 12*msp->a*msp->c;
+ if ( b2_fourac>=0 ) {
+ b2_fourac = sqrt(b2_fourac);
+ t1 = CheckExtremaForSingleBitErrors(msp,(-2*msp->b - b2_fourac) / (6*msp->a));
+ t2 = CheckExtremaForSingleBitErrors(msp,(-2*msp->b + b2_fourac) / (6*msp->a));
+ if ( t1>t2 ) { real temp = t1; t1 = t2; t2 = temp; }
+ else if ( t1==t2 ) t2 = 2.0;
+
+ /* check for curves which have such a small slope they might */
+ /* as well be horizontal */
+ fm = es->major==1?sp->from->me.y:sp->from->me.x;
+ tm = es->major==1?sp->to->me.y:sp->to->me.x;
+ if ( fm==tm ) {
+ real m1, m2, d1, d2;
+ m1 = m2 = fm;
+ if ( t1>0 && t1<1 )
+ m1 = ((msp->a*t1+msp->b)*t1+msp->c)*t1 + msp->d;
+ if ( t2>0 && t2<1 )
+ m2 = ((msp->a*t2+msp->b)*t2+msp->c)*t2 + msp->d;
+ d1 = (m1-fm)*es->scale;
+ d2 = (m2-fm)*es->scale;
+ if ( d1>-.5 && d1<.5 && d2>-.5 && d2<.5 ) {
+ sp->ishorvert = true;
+ if ( es->genmajoredges )
+ AddMajorEdge(es,sp);
+return; /* Pretend it's horizontal, ignore it */
+ }
+ }
+ }
+ } else if ( !RealNear(msp->b,0) ) {
+ /* Quadratic, at most one extremum */
+ t1 = -msp->c/(2.0*msp->b);
+ } else if ( !RealNear(msp->c,0) ) {
+ /* linear, no points of extrema */
+ } else {
+ sp->ishorvert = true;
+ if ( es->genmajoredges )
+ AddMajorEdge(es,sp);
+return; /* Horizontal line, ignore it */
+ }
+
+ if ( RealNear(t1,0)) t1=0;
+ if ( RealNear(t1,1)) t1=1;
+ if ( RealNear(t2,0)) t2=0;
+ if ( RealNear(t2,1)) t2=1;
+ if ( RealNear(t1,t2)) t2=2;
+ t=0;
+ if ( t1>0 && t1<1 ) {
+ AddEdge(es,sp,0,t1);
+ t = t1;
+ }
+ if ( t2>0 && t2<1 ) {
+ AddEdge(es,sp,t,t2);
+ t = t2;
+ }
+ AddEdge(es,sp,t,1.0);
+ if ( es->interesting ) {
+ /* Also store up points of extrema in X as interesting (we got the endpoints, just internals now)*/
+ extended ot1, ot2;
+ int mpos;
+ SplineFindExtrema(osp,&ot1,&ot2);
+ if ( ot1>0 && ot1<1 ) {
+ mpos = (int) ceil( ( ((msp->a*ot1+msp->b)*ot1+msp->c)*ot1+msp->d )*es->scale-es->mmin );
+ es->interesting[mpos] = 1;
+ }
+ if ( ot2>0 && ot2<1 ) {
+ mpos = (int) ceil( ( ((msp->a*ot2+msp->b)*ot2+msp->c)*ot2+msp->d )*es->scale-es->mmin );
+ es->interesting[mpos] = 1;
+ }
+ }
+}
+
+void FindEdgesSplineSet(SplinePointList *spl, EdgeList *es, int ignore_clip) {
+ Spline *spline, *first;
+
+ for ( ; spl!=NULL; spl = spl->next ) {
+ if ( spl->first->prev!=NULL && spl->first->prev->from!=spl->first &&
+ (!ignore_clip || (ignore_clip==1 && !spl->is_clip_path) || (ignore_clip==2 && spl->is_clip_path))) {
+ first = NULL;
+ es->last = es->splinesetfirst = NULL;
+ /* Set so there is no previous point!!! */
+ for ( spline = spl->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
+ AddSpline(es,spline);
+ if ( first==NULL ) first = spline;
+ }
+ if ( es->last!=NULL ) {
+ es->splinesetfirst->before = es->last;
+ es->last->after = es->splinesetfirst;
+ }
+ }
+ }
+}
+
+Edge *ActiveEdgesInsertNew(EdgeList *es, Edge *active,int i) {
+ Edge *apt, *pr, *npt;
+
+ for ( pr=NULL, apt=active, npt=es->edges[(int) i]; apt!=NULL && npt!=NULL; ) {
+ if ( npt->o_cur<apt->o_cur ) {
+ npt->aenext = apt;
+ if ( pr==NULL )
+ active = npt;
+ else
+ pr->aenext = npt;
+ pr = npt;
+ npt = npt->esnext;
+ } else {
+ pr = apt;
+ apt = apt->aenext;
+ }
+ }
+ while ( npt!=NULL ) {
+ npt->aenext = NULL;
+ if ( pr==NULL )
+ active = npt;
+ else
+ pr->aenext = npt;
+ pr = npt;
+ npt = npt->esnext;
+ }
+return( active );
+}
+
+Edge *ActiveEdgesRefigure(EdgeList *es, Edge *active,real i) {
+ Edge *apt, *pr;
+ int any;
+
+ /* first remove any entry which doesn't intersect the new scan line */
+ /* (ie. stopped on last line) */
+ for ( pr=NULL, apt=active; apt!=NULL; apt = apt->aenext ) {
+ if ( apt->mmax<i ) {
+ if ( pr==NULL )
+ active = apt->aenext;
+ else
+ pr->aenext = apt->aenext;
+ } else
+ pr = apt;
+ }
+ /* then move the active list to the next line */
+ for ( apt=active; apt!=NULL; apt = apt->aenext ) {
+ Spline1D *osp = &apt->spline->splines[es->other];
+ apt->t_cur = TOfNextMajor(apt,es,i);
+ apt->o_cur = ( ((osp->a*apt->t_cur+osp->b)*apt->t_cur+osp->c)*apt->t_cur + osp->d ) * es->scale;
+ }
+ /* reorder list */
+ if ( active!=NULL ) {
+ any = true;
+ while ( any ) {
+ any = false;
+ for ( pr=NULL, apt=active; apt->aenext!=NULL; ) {
+ if ( apt->o_cur <= apt->aenext->o_cur ) {
+ /* still ordered */;
+ pr = apt;
+ apt = apt->aenext;
+ } else if ( pr==NULL ) {
+ active = apt->aenext;
+ apt->aenext = apt->aenext->aenext;
+ active->aenext = apt;
+ /* don't need to set any, since this reorder can't disorder the list */
+ pr = active;
+ } else {
+ pr->aenext = apt->aenext;
+ apt->aenext = apt->aenext->aenext;
+ pr->aenext->aenext = apt;
+ any = true;
+ pr = pr->aenext;
+ }
+ }
+ }
+ }
+ /* Insert new nodes */
+ active = ActiveEdgesInsertNew(es,active,i);
+return( active );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
new file mode 100644
index 00000000000..1fa40c46072
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
@@ -0,0 +1,642 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "fontforgevw.h"
+#include <utype.h>
+#include <ustring.h>
+#include <math.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <gfile.h>
+#include <time.h>
+#include "unicoderange.h"
+#include "psfont.h"
+
+#ifdef _WIN32
+#define MKDIR(A,B) mkdir(A)
+#else
+#define MKDIR(A,B) mkdir(A,B)
+#endif
+
+
+void SFUntickAll(SplineFont *sf) {
+ int i;
+
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
+ sf->glyphs[i]->ticked = false;
+}
+
+SplineChar *SCBuildDummy(SplineChar *dummy,SplineFont *sf,EncMap *map,int i) {
+ static char namebuf[100];
+ static Layer layers[2];
+
+ memset(dummy,'\0',sizeof(*dummy));
+ dummy->color = COLOR_DEFAULT;
+ dummy->layer_cnt = 2;
+ dummy->layers = layers;
+ if ( sf->cidmaster!=NULL ) {
+ /* CID fonts don't have encodings, instead we must look up the cid */
+ if ( sf->cidmaster->loading_cid_map )
+ dummy->unicodeenc = -1;
+ else
+ dummy->unicodeenc = CID2NameUni(FindCidMap(sf->cidmaster->cidregistry,sf->cidmaster->ordering,sf->cidmaster->supplement,sf->cidmaster),
+ i,namebuf,sizeof(namebuf));
+ } else
+ dummy->unicodeenc = UniFromEnc(i,map->enc);
+
+ if ( sf->cidmaster!=NULL )
+ dummy->name = namebuf;
+ else if ( map->enc->psnames!=NULL && i<map->enc->char_cnt &&
+ map->enc->psnames[i]!=NULL )
+ dummy->name = map->enc->psnames[i];
+ else if ( dummy->unicodeenc==-1 )
+ dummy->name = NULL;
+ else
+ dummy->name = (char *) StdGlyphName(namebuf,dummy->unicodeenc,sf->uni_interp,sf->for_new_glyphs);
+ if ( dummy->name==NULL ) {
+ /*if ( dummy->unicodeenc!=-1 || i<256 )
+ dummy->name = ".notdef";
+ else*/ {
+ int j;
+ sprintf( namebuf, "NameMe.%d", i);
+ j=0;
+ while ( SFFindExistingSlot(sf,-1,namebuf)!=-1 )
+ sprintf( namebuf, "NameMe.%d.%d", i, ++j);
+ dummy->name = namebuf;
+ }
+ }
+ dummy->width = dummy->vwidth = sf->ascent+sf->descent;
+ if ( dummy->unicodeenc>0 && dummy->unicodeenc<0x10000 &&
+ iscombining(dummy->unicodeenc)) {
+ /* Mark characters should be 0 width */
+ dummy->width = 0;
+ /* Except in monospaced fonts on windows, where they should be the */
+ /* same width as everything else */
+ }
+ /* Actually, in a monospace font, all glyphs should be the same width */
+ /* whether mark or not */
+ if ( sf->pfminfo.panose_set && sf->pfminfo.panose[3]==9 &&
+ sf->glyphcnt>0 ) {
+ for ( i=sf->glyphcnt-1; i>=0; --i )
+ if ( SCWorthOutputting(sf->glyphs[i])) {
+ dummy->width = sf->glyphs[i]->width;
+ break;
+ }
+ }
+ dummy->parent = sf;
+ dummy->orig_pos = 0xffff;
+return( dummy );
+}
+
+static SplineChar *_SFMakeChar(SplineFont *sf,EncMap *map,int enc) {
+ SplineChar dummy, *sc;
+ SplineFont *ssf;
+ int j, real_uni, gid;
+ extern const int cns14pua[], amspua[];
+
+ if ( enc>=map->enccount )
+ gid = -1;
+ else
+ gid = map->map[enc];
+ if ( sf->subfontcnt!=0 && gid!=-1 ) {
+ ssf = NULL;
+ for ( j=0; j<sf->subfontcnt; ++j )
+ if ( gid<sf->subfonts[j]->glyphcnt ) {
+ ssf = sf->subfonts[j];
+ if ( ssf->glyphs[gid]!=NULL ) {
+return( ssf->glyphs[gid] );
+ }
+ }
+ sf = ssf;
+ }
+
+ if ( gid==-1 || (sc = sf->glyphs[gid])==NULL ) {
+ if (( map->enc->is_unicodebmp || map->enc->is_unicodefull ) &&
+ ( enc>=0xe000 && enc<=0xf8ff ) &&
+ ( sf->uni_interp==ui_ams || sf->uni_interp==ui_trad_chinese ) &&
+ ( real_uni = (sf->uni_interp==ui_ams ? amspua : cns14pua)[enc-0xe000])!=0 ) {
+ if ( real_uni<map->enccount ) {
+ SplineChar *sc;
+ /* if necessary, create the real unicode code point */
+ /* and then make us be a duplicate of it */
+ sc = _SFMakeChar(sf,map,real_uni);
+ map->map[enc] = gid = sc->orig_pos;
+ SCCharChangedUpdate(sc,ly_all);
+return( sc );
+ }
+ }
+
+ SCBuildDummy(&dummy,sf,map,enc);
+ /* Let's say a user has a postscript encoding where the glyph ".notdef" */
+ /* is assigned to many slots. Once the user creates a .notdef glyph */
+ /* all those slots should fill in. If they don't they damn well better*/
+ /* when the user clicks on one to edit it */
+ /* Used to do that with all encodings. It just confused people */
+ if ( map->enc->psnames!=NULL &&
+ (sc = SFGetChar(sf,dummy.unicodeenc,dummy.name))!=NULL ) {
+ map->map[enc] = sc->orig_pos;
+ AltUniAdd(sc,dummy.unicodeenc);
+return( sc );
+ }
+ sc = SFSplineCharCreate(sf);
+ sc->unicodeenc = dummy.unicodeenc;
+ sc->name = copy(dummy.name);
+ sc->width = dummy.width;
+ sc->orig_pos = 0xffff;
+ /*SCLigDefault(sc);*/
+ SFAddGlyphAndEncode(sf,sc,map,enc);
+ }
+return( sc );
+}
+
+SplineChar *SFMakeChar(SplineFont *sf,EncMap *map, int enc) {
+ int gid;
+
+ if ( enc==-1 )
+return( NULL );
+ if ( enc>=map->enccount )
+ gid = -1;
+ else
+ gid = map->map[enc];
+ if ( sf->mm!=NULL && (gid==-1 || sf->glyphs[gid]==NULL) ) {
+ int j;
+ _SFMakeChar(sf->mm->normal,map,enc);
+ for ( j=0; j<sf->mm->instance_count; ++j )
+ _SFMakeChar(sf->mm->instances[j],map,enc);
+ }
+return( _SFMakeChar(sf,map,enc));
+}
+
+struct unicoderange specialnames[] = {
+ { NULL, 0, 0, 0, 0, 0, 0 }
+};
+
+
+static SplineFont *_SFReadPostscript(FILE *file,char *filename) {
+ FontDict *fd=NULL;
+ SplineFont *sf=NULL;
+
+ ff_progress_change_stages(2);
+ fd = _ReadPSFont(file);
+ ff_progress_next_stage();
+ ff_progress_change_line2(_("Interpreting Glyphs"));
+ if ( fd!=NULL ) {
+ sf = SplineFontFromPSFont(fd);
+ PSFontFree(fd);
+ if ( sf!=NULL )
+ CheckAfmOfPostscript(sf,filename,sf->map);
+ }
+return( sf );
+}
+
+static SplineFont *SFReadPostscript(char *filename) {
+ FontDict *fd=NULL;
+ SplineFont *sf=NULL;
+
+ ff_progress_change_stages(2);
+ fd = ReadPSFont(filename);
+ ff_progress_next_stage();
+ ff_progress_change_line2(_("Interpreting Glyphs"));
+ if ( fd!=NULL ) {
+ sf = SplineFontFromPSFont(fd);
+ PSFontFree(fd);
+ if ( sf!=NULL )
+ CheckAfmOfPostscript(sf,filename,sf->map);
+ }
+return( sf );
+}
+
+
+struct compressors compressors[] = {
+ { ".gz", "gunzip", "gzip" },
+ { ".bz2", "bunzip2", "bzip2" },
+ { ".bz", "bunzip2", "bzip2" },
+ { ".Z", "gunzip", "compress" },
+/* file types which are both archived and compressed (.tgz, .zip) are handled */
+/* by the archiver above */
+ { NULL, NULL, NULL }
+};
+
+char *Decompress(char *name, int compression) {
+ char *dir = getenv("TMPDIR");
+ char buf[1500];
+ char *tmpfile;
+
+ if ( dir==NULL ) dir = P_tmpdir;
+ tmpfile = galloc(strlen(dir)+strlen(GFileNameTail(name))+2);
+ strcpy(tmpfile,dir);
+ strcat(tmpfile,"/");
+ strcat(tmpfile,GFileNameTail(name));
+ *strrchr(tmpfile,'.') = '\0';
+#if defined( _NO_SNPRINTF ) || defined( __VMS )
+ sprintf( buf, "%s < %s > %s", compressors[compression].decomp, name, tmpfile );
+#else
+ snprintf( buf, sizeof(buf), "%s < %s > %s", compressors[compression].decomp, name, tmpfile );
+#endif
+ if ( system(buf)==0 )
+return( tmpfile );
+ free(tmpfile);
+return( NULL );
+}
+
+static char *ForceFileToHaveName(FILE *file, char *exten) {
+ char tmpfilename[L_tmpnam+100];
+ static int try=0;
+ FILE *newfile;
+
+ forever {
+ sprintf( tmpfilename, P_tmpdir "/fontforge%d-%d", getpid(), try++ );
+ if ( exten!=NULL )
+ strcat(tmpfilename,exten);
+ if ( access( tmpfilename, F_OK )==-1 &&
+ (newfile = fopen(tmpfilename,"w"))!=NULL ) {
+ char buffer[1024];
+ int len;
+ while ( (len = fread(buffer,1,sizeof(buffer),file))>0 )
+ fwrite(buffer,1,len,newfile);
+ fclose(newfile);
+ }
+return(copy(tmpfilename)); /* The filename does not exist */
+ }
+}
+
+/* This does not check currently existing fontviews, and should only be used */
+/* by LoadSplineFont (which does) and by RevertFile (which knows what it's doing) */
+SplineFont *_ReadSplineFont(FILE *file,char *filename,enum openflags openflags) {
+ SplineFont *sf;
+ char ubuf[250], *temp;
+ int fromsfd = false;
+ int i;
+ char *pt, *strippedname, *oldstrippedname, *tmpfile=NULL, *paren=NULL, *fullname=filename, *rparen;
+ int len;
+ int checked;
+ int compression=0;
+ int wasurl = false, nowlocal = true;
+
+ if ( filename==NULL )
+return( NULL );
+
+ strippedname = filename;
+ pt = strrchr(filename,'/');
+ if ( pt==NULL ) pt = filename;
+ /* Someone gave me a font "Nafees Nastaleeq(Updated).ttf" and complained */
+ /* that ff wouldn't open it */
+ /* Now someone will complain about "Nafees(Updated).ttc(fo(ob)ar)" */
+ if ( (paren = strrchr(pt,'('))!=NULL &&
+ (rparen = strrchr(paren,')'))!=NULL &&
+ rparen[1]=='\0' ) {
+ strippedname = copy(filename);
+ strippedname[paren-filename] = '\0';
+ }
+
+ pt = strrchr(strippedname,'.');
+
+ i = -1;
+ if ( pt!=NULL ) for ( i=0; compressors[i].ext!=NULL; ++i )
+ if ( strcmp(compressors[i].ext,pt)==0 )
+ break;
+ oldstrippedname = strippedname;
+ if ( i==-1 || compressors[i].ext==NULL )
+ i=-1;
+ else {
+ if ( file!=NULL ) {
+ char *spuriousname = ForceFileToHaveName(file,compressors[i].ext);
+ tmpfile = Decompress(spuriousname,i);
+ fclose(file); file = NULL;
+ unlink(spuriousname); free(spuriousname);
+ } else
+ tmpfile = Decompress(strippedname,i);
+ if ( tmpfile!=NULL ) {
+ strippedname = tmpfile;
+ } else {
+ ff_post_error(_("Decompress Failed!"),_("Decompress Failed!"));
+return( NULL );
+ }
+ compression = i+1;
+ if ( strippedname!=filename && paren!=NULL ) {
+ fullname = galloc(strlen(strippedname)+strlen(paren)+1);
+ strcpy(fullname,strippedname);
+ strcat(fullname,paren);
+ } else
+ fullname = strippedname;
+ }
+
+ /* If there are no pfaedit windows, give them something to look at */
+ /* immediately. Otherwise delay a bit */
+ strcpy(ubuf,_("Loading font from "));
+ len = strlen(ubuf);
+ if ( !wasurl || i==-1 ) /* If it wasn't compressed, or it wasn't an url, then the fullname is reasonable, else use the original name */
+ strncat(ubuf,temp = def2utf8_copy(GFileNameTail(fullname)),100);
+ else
+ strncat(ubuf,temp = def2utf8_copy(GFileNameTail(filename)),100);
+ free(temp);
+ ubuf[100+len] = '\0';
+ ff_progress_start_indicator(FontViewFirst()==NULL?0:10,_("Loading..."),ubuf,_("Reading Glyphs"),0,1);
+ ff_progress_enable_stop(0);
+
+ if ( file==NULL ) {
+ file = fopen(strippedname,"rb");
+ nowlocal = true;
+ }
+
+ sf = NULL;
+ checked = false;
+/* checked == false => not checked */
+/* checked == 'u' => UFO */
+/* checked == 't' => TTF/OTF */
+/* checked == 'p' => pfb/general postscript */
+/* checked == 'P' => pdf */
+/* checked == 'c' => cff */
+/* checked == 'S' => svg */
+/* checked == 'f' => sfd */
+/* checked == 'F' => sfdir */
+/* checked == 'b' => bdf */
+/* checked == 'i' => ikarus */
+ if ( file!=NULL ) {
+ /* Try to guess the file type from the first few characters... */
+ int ch1 = getc(file);
+ int ch2 = getc(file);
+ int ch3 = getc(file);
+ int ch4 = getc(file);
+ int ch9, ch10;
+ fseek(file, 98, SEEK_SET);
+ ch9 = getc(file);
+ ch10 = getc(file);
+ rewind(file);
+ if (( ch1==0 && ch2==1 && ch3==0 && ch4==0 ) ||
+ (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O') ||
+ (ch1=='t' && ch2=='r' && ch3=='u' && ch4=='e') ||
+ (ch1=='t' && ch2=='t' && ch3=='c' && ch4=='f') ) {
+ sf = _SFReadTTF(file,0,openflags,fullname,NULL);
+ checked = 't';
+ } else if (( ch1=='%' && ch2=='!' ) ||
+ ( ch1==0x80 && ch2=='\01' ) ) { /* PFB header */
+ sf = _SFReadPostscript(file,fullname);
+ checked = 'p';
+ } else if ( ch1==1 && ch2==0 && ch3==4 ) {
+ int len;
+ fseek(file,0,SEEK_END);
+ len = ftell(file);
+ fseek(file,0,SEEK_SET);
+ sf = _CFFParse(file,len,NULL);
+ checked = 'c';
+ } /* Too hard to figure out a valid mark for a mac resource file */
+ if ( file!=NULL ) fclose(file);
+ }
+
+ if ( sf!=NULL )
+ /* good */;
+ else if (( strmatch(fullname+strlen(fullname)-4, ".ttf")==0 ||
+ strmatch(fullname+strlen(strippedname)-4, ".ttc")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".gai")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".otf")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".otb")==0 ) && checked!='t') {
+ sf = SFReadTTF(fullname,0,openflags);
+ } else if ( strmatch(fullname+strlen(strippedname)-4, ".bin")==0 ||
+ strmatch(fullname+strlen(strippedname)-4, ".hqx")==0 ||
+ strmatch(fullname+strlen(strippedname)-6, ".dfont")==0 ) {
+ sf = SFReadMacBinary(fullname,0,openflags);
+ } else if ( (strmatch(fullname+strlen(fullname)-4, ".pfa")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".pfb")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".pf3")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".cid")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".gsf")==0 ||
+ strmatch(fullname+strlen(fullname)-4, ".pt3")==0 ||
+ strmatch(fullname+strlen(fullname)-3, ".ps")==0 ) && checked!='p' ) {
+ sf = SFReadPostscript(fullname);
+ } else if ( strmatch(fullname+strlen(fullname)-4, ".cff")==0 && checked!='c' ) {
+ sf = CFFParse(fullname);
+ } else {
+ sf = SFReadMacBinary(fullname,0,openflags);
+ }
+ ff_progress_end_indicator();
+
+ if ( sf!=NULL ) {
+ SplineFont *norm = sf->mm!=NULL ? sf->mm->normal : sf;
+ if ( compression!=0 ) {
+ free(sf->filename);
+ *strrchr(oldstrippedname,'.') = '\0';
+ sf->filename = copy( oldstrippedname );
+ }
+ if ( fromsfd )
+ sf->compression = compression;
+ free( norm->origname );
+ if ( sf->chosenname!=NULL && strippedname==filename ) {
+ norm->origname = galloc(strlen(filename)+strlen(sf->chosenname)+8);
+ strcpy(norm->origname,filename);
+ strcat(norm->origname,"(");
+ strcat(norm->origname,sf->chosenname);
+ strcat(norm->origname,")");
+ } else
+ norm->origname = copy(filename);
+ free( norm->chosenname ); norm->chosenname = NULL;
+ if ( sf->mm!=NULL ) {
+ int j;
+ for ( j=0; j<sf->mm->instance_count; ++j ) {
+ free(sf->mm->instances[j]->origname);
+ sf->mm->instances[j]->origname = copy(norm->origname);
+ }
+ }
+ } else if ( !GFileExists(filename) )
+ ff_post_error(_("Couldn't open font"),_("The requested file, %.100s, does not exist"),GFileNameTail(filename));
+ else if ( !GFileReadable(filename) )
+ ff_post_error(_("Couldn't open font"),_("You do not have permission to read %.100s"),GFileNameTail(filename));
+ else
+ ff_post_error(_("Couldn't open font"),_("%.100s is not in a known format (or is so badly corrupted as to be unreadable)"),GFileNameTail(filename));
+
+ if ( oldstrippedname!=filename )
+ free(oldstrippedname);
+ if ( fullname!=filename && fullname!=strippedname )
+ free(fullname);
+ if ( tmpfile!=NULL ) {
+ unlink(tmpfile);
+ free(tmpfile);
+ }
+ if ( (openflags&of_fstypepermitted) && sf!=NULL && (sf->pfminfo.fstype&0xff)==0x0002 ) {
+ /* Ok, they have told us from a script they have access to the font */
+ } else if ( !fromsfd && sf!=NULL && (sf->pfminfo.fstype&0xff)==0x0002 ) {
+ char *buts[3];
+ buts[0] = _("_Yes"); buts[1] = _("_No"); buts[2] = NULL;
+ if ( ff_ask(_("Restricted Font"),(const char **) buts,1,1,_("This font is marked with an FSType of 2 (Restricted\nLicense). That means it is not editable without the\npermission of the legal owner.\n\nDo you have such permission?"))==1 ) {
+ SplineFontFree(sf);
+return( NULL );
+ }
+ }
+return( sf );
+}
+
+SplineFont *ReadSplineFont(char *filename,enum openflags openflags) {
+return( _ReadSplineFont(NULL,filename,openflags));
+}
+
+
+SplineFont *ReadSplineFontInfo(char *filename,enum openflags openflags) {
+ SplineFont *sf, *sf_ptr;
+ char **fontlist;
+ char *pt =NULL, *strippedname=filename, *paren=NULL, *fullname=filename;
+ FILE *foo = NULL;
+ int checked = 0;
+ char s[512] = {0};
+
+ if ( filename==NULL )
+return( NULL );
+
+ pt = strrchr(filename,'/');
+ if ( pt==NULL ) pt = filename;
+ if ( (paren=strchr(pt,'('))!=NULL && strchr(paren,')')!=NULL ) {
+ strippedname = copy(filename);
+ strippedname[paren-filename] = '\0';
+ }
+
+ sf = NULL;
+ foo = fopen(strippedname,"rb");
+ checked = false;
+ if ( foo!=NULL ) {
+ /* Try to guess the file type from the first few characters... */
+ int ch1 = getc(foo);
+ int ch2 = getc(foo);
+ int ch3 = getc(foo);
+ int ch4 = getc(foo);
+ fclose(foo);
+ if (( ch1==0 && ch2==1 && ch3==0 && ch4==0 ) ||
+ (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O') ||
+ (ch1=='t' && ch2=='r' && ch3=='u' && ch4=='e') ) {
+ sf = SFReadTTFInfo(fullname,0,openflags);
+ checked = 't';
+ } else if ((ch1=='t' && ch2=='t' && ch3=='c' && ch4=='f')) {
+ /* read all fonts in a collection */
+ fontlist = NamesReadTTF(fullname);
+ if (fontlist) {
+ while (*fontlist != NULL) {
+ snprintf(s,511, "%s(%s)", fullname,*fontlist);
+ sf_ptr = SFReadTTFInfo(s,0,openflags);
+ if (sf != NULL)
+ sf_ptr->next = sf;
+ sf = sf_ptr;
+ fontlist++;
+ }
+ }
+ } else if ( strmatch(fullname+strlen(strippedname)-4, ".bin")==0 ||
+ strmatch(fullname+strlen(strippedname)-4, ".hqx")==0 ||
+ strmatch(fullname+strlen(strippedname)-6, ".dfont")==0 ) {
+ fontlist = NamesReadMacBinary(fullname);
+ if (fontlist) {
+ while (*fontlist != NULL) {
+ snprintf(s,511, "%s(%s)", fullname,*fontlist);
+ sf_ptr = SFReadMacBinaryInfo(s,0,openflags);
+ if (sf != NULL)
+ sf_ptr->next = sf;
+ sf = sf_ptr;
+ fontlist++;
+ }
+ }
+ } else {
+ sf = ReadSplineFont (fullname, openflags);
+ }
+ }
+ if ( strippedname!=filename )
+ free(strippedname);
+return( sf );
+}
+
+
+/* Use URW 4 letter abbreviations */
+char *knownweights[] = { "Demi", "Bold", "Regu", "Medi", "Book", "Thin",
+ "Ligh", "Heav", "Blac", "Ultr", "Nord", "Norm", "Gras", "Stan", "Halb",
+ "Fett", "Mage", "Mitt", "Buch", NULL };
+char *realweights[] = { "Demi", "Bold", "Regular", "Medium", "Book", "Thin",
+ "Light", "Heavy", "Black", "Ultra", "Nord", "Normal", "Gras", "Standard", "Halbfett",
+ "Fett", "Mager", "Mittel", "Buchschrift", NULL};
+static char *moreweights[] = { "ExtraLight", "VeryLight", NULL };
+char **noticeweights[] = { moreweights, realweights, knownweights, NULL };
+
+static char *modifierlist[] = { "Ital", "Obli", "Kursive", "Cursive", "Slanted",
+ "Expa", "Cond", NULL };
+static char *modifierlistfull[] = { "Italic", "Oblique", "Kursive", "Cursive", "Slanted",
+ "Expanded", "Condensed", NULL };
+static char **mods[] = { knownweights, modifierlist, NULL };
+static char **fullmods[] = { realweights, modifierlistfull, NULL };
+
+char *_GetModifiers(char *fontname, char *familyname,char *weight) {
+ char *pt, *fpt;
+ int i, j;
+
+ /* URW fontnames don't match the familyname */
+ /* "NimbusSanL-Regu" vs "Nimbus Sans L" (note "San" vs "Sans") */
+ /* so look for a '-' if there is one and use that as the break point... */
+
+ if ( (fpt=strchr(fontname,'-'))!=NULL ) {
+ ++fpt;
+ if ( *fpt=='\0' )
+ fpt = NULL;
+ } else if ( familyname!=NULL ) {
+ for ( pt = fontname, fpt=familyname; *fpt!='\0' && *pt!='\0'; ) {
+ if ( *fpt == *pt ) {
+ ++fpt; ++pt;
+ } else if ( *fpt==' ' )
+ ++fpt;
+ else if ( *pt==' ' )
+ ++pt;
+ else if ( *fpt=='a' || *fpt=='e' || *fpt=='i' || *fpt=='o' || *fpt=='u' )
+ ++fpt; /* allow vowels to be omitted from family when in fontname */
+ else
+ break;
+ }
+ if ( *fpt=='\0' && *pt!='\0' )
+ fpt = pt;
+ else
+ fpt = NULL;
+ }
+
+ if ( fpt == NULL ) {
+ for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
+ pt = strstr(fontname,mods[i][j]);
+ if ( pt!=NULL && (fpt==NULL || pt<fpt))
+ fpt = pt;
+ }
+ }
+ if ( fpt!=NULL ) {
+ for ( i=0; mods[i]!=NULL; ++i ) for ( j=0; mods[i][j]!=NULL; ++j ) {
+ if ( strcmp(fpt,mods[i][j])==0 )
+return( fullmods[i][j]);
+ }
+ if ( strcmp(fpt,"BoldItal")==0 )
+return( "BoldItalic" );
+ else if ( strcmp(fpt,"BoldObli")==0 )
+return( "BoldOblique" );
+
+return( fpt );
+ }
+
+return( weight==NULL || *weight=='\0' ? "Regular": weight );
+}
+
+char *SFGetModifiers(SplineFont *sf) {
+return( _GetModifiers(sf->fontname,sf->familyname,sf->weight));
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinefont.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h
index 57c6f1547a0..fa989d61543 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinefont.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -68,6 +68,37 @@
#define MmMax 16 /* PS says at most this many instances for type1/2 mm fonts */
#define AppleMmMax 26 /* Apple sort of has a limit of 4095, but we only support this many */
+typedef struct ipoint {
+ int x;
+ int y;
+} IPoint;
+
+typedef struct basepoint {
+ real x;
+ real y;
+} BasePoint;
+
+typedef struct dbasepoint {
+ bigreal x;
+ bigreal y;
+} DBasePoint;
+
+typedef struct tpoint {
+ real x;
+ real y;
+ real t;
+} TPoint;
+
+typedef struct dbounds {
+ real minx, maxx;
+ real miny, maxy;
+} DBounds;
+
+typedef struct ibounds {
+ int minx, maxx;
+ int miny, maxy;
+} IBounds;
+
typedef struct val {
enum val_type { v_int, v_real, v_str, v_unicode, v_lval, v_arr, v_arrfree,
v_int32pt, v_int16pt, v_int8pt, v_void } type;
@@ -109,12 +140,38 @@ enum linecap {
lc_square, /* Extend lines by radius, then join them */
lc_inherited
};
+enum spreadMethod {
+ sm_pad, sm_reflect, sm_repeat
+};
#define COLOR_INHERITED 0xfffffffe
+struct gradient {
+ BasePoint start; /* focal of a radial gradient, start of a linear */
+ BasePoint stop; /* center of a radial gradient, end of a linear */
+ real radius; /* 0=>linear gradient, else radius of a radial gradient */
+ enum spreadMethod sm;
+ int stop_cnt;
+ struct grad_stops {
+ real offset;
+ uint32 col;
+ real opacity;
+ } *grad_stops;
+};
+
+struct pattern {
+ char *pattern;
+ real width, height; /* Pattern is scaled to be repeated every width/height (in user coordinates) */
+ real transform[6];
+ /* Used during rasterization process */
+ struct bdfchar *pat;
+ real invtrans[6];
+ int bminx, bminy, bwidth, bheight; /* of the pattern at bdfchar scale */
+};
+
struct brush {
uint32 col;
- /*void *pattern;*/ /* Don't know how to deal with these yet */
- /*void *gradient;*/
- float opacity; /* number between [0,1], only for svg */
+ float opacity; /* number between [0,1], only for svg/pdf */
+ struct pattern *pattern; /* A pattern to be tiled */
+ struct gradient *gradient; /* A gradient fill */
};
#define WIDTH_INHERITED (-1)
#define DASH_INHERITED 255 /* if the dashes[0]==0 && dashes[1]==DASH_INHERITED */
@@ -176,31 +233,69 @@ struct simplifyinfo {
int check_selected_contours;
};
-typedef struct ipoint {
- int x;
- int y;
-} IPoint;
-
-typedef struct basepoint {
- real x;
- real y;
-} BasePoint;
-
-typedef struct tpoint {
- real x;
- real y;
- real t;
-} TPoint;
-
-typedef struct dbounds {
- real minx, maxx;
- real miny, maxy;
-} DBounds;
-
-typedef struct ibounds {
- int minx, maxx;
- int miny, maxy;
-} IBounds;
+typedef struct italicinfo {
+ double italic_angle;
+ double xheight_percent;
+ struct hsquash { double lsb_percent, stem_percent, counter_percent, rsb_percent; }
+ lc, uc, neither;
+ enum { srf_flat, srf_simpleslant, srf_complexslant } secondary_serif;
+ /* | | (flat) | | (simple) | | (complex) */
+ /* | | | / | / */
+ /* | | | / | / */
+ /* +----+ |/ \ / */
+
+ unsigned int transform_bottom_serifs: 1;
+ unsigned int transform_top_xh_serifs: 1; /* Those at x-height */
+ unsigned int transform_top_as_serifs: 1; /* Those at ascender-height */
+ unsigned int transform_diagon_serifs: 1; /* Those at baseline/xheight */
+
+ unsigned int a_from_d: 1; /* replace the "a" glyph with the variant which looks like a "d" without an ascender */
+ /* When I say "f" I also mean "f_f" ligature, "longs", cyrillic phi and other things shaped like "f" */
+ unsigned int f_long_tail: 1; /* Some Italic fonts have the "f" grow an extension of the main stem below the baseline */
+ unsigned int f_rotate_top: 1; /* Most Italic fonts take the top curve of the "f", rotate it 180 and attach to the bottom */
+ unsigned int pq_deserif: 1; /* Remove a serif from the descender of p or q and replace with a secondary serif as above */
+
+ /* Unsupported */
+ /* e becomes rounder, cross bar slightly slanted */
+ /* g closed counter at bottom */
+ /* k closed counter at top */
+ /* v-z diagonal stems become more curvatious */
+
+ unsigned int cyrl_phi: 1; /* Gains an "f" like top, bottom treated like "f" */
+ unsigned int cyrl_i: 1; /* Turns into a latin u */
+ unsigned int cyrl_pi: 1; /* Turns into a latin n */
+ unsigned int cyrl_te: 1; /* Turns into a latin m */
+ unsigned int cyrl_sha: 1; /* Turns into a latin m rotated 180 */
+ unsigned int cyrl_dje: 1; /* Turns into a latin smallcaps T */
+ unsigned int cyrl_dzhe: 1; /* Turns into a latin u */
+ /* Is there a difference between dzhe and i? both look like u to me */
+
+ /* Unsupported */
+ /* u432 curved B */
+ /* u433 strange gamma */
+ /* u434 normal delta */
+ /* u436 */
+ /* u43b lambda ? */
+ /* u43c */
+ /* u446 */
+ /* u449 */
+ /* u449 */
+ /* u44a */
+
+/* This half of the structure gets filled in later */
+ double tan_ia;
+ double x_height;
+ double pq_depth;
+ double ascender_height;
+ double emsize;
+ int order2;
+ struct splinefont *sf;
+ int layer;
+ double serif_extent, serif_height;
+ struct splinepoint *f_start, *f_end; /* start has next pointing into the f head and up */
+ struct splinepoint *ff_start1, *ff_end1, *ff_start2, *ff_end2;
+ double f_height, ff_height;
+} ItalicInfo;
typedef struct bluedata {
real xheight, xheighttop; /* height of "x" and "o" (u,v,w,x,y,z) */
@@ -384,6 +479,7 @@ typedef struct anchorclass {
uint8 type; /* anchorclass_type */
uint8 has_base;
uint8 processed, has_mark, matches, ac_num;
+ uint8 ticked;
struct anchorclass *next;
} AnchorClass;
@@ -534,7 +630,7 @@ typedef struct generic_asm { /* Apple State Machine */
} kern;
} u;
} *state;
- uint32 opentype_tag; /* If converted from opentype */
+ /*uint32 opentype_tag; */ /* If converted from opentype */
} ASM;
/* State Flags:
Indic:
@@ -570,13 +666,18 @@ typedef struct generic_asm { /* Apple State Machine */
struct opentype_str {
struct splinechar *sc;
- struct vr vr;
+ struct vr vr; /* Scaled and rounded gpos modifications (device table info included in xoff, etc. not in adjusts) */
struct kernpair *kp;
struct kernclass *kc;
- int kc_index;
+ int16 advance_width; /* Basic advance, modifications in vr, scaled and rounded */
+ int16 kc_index;
int16 lig_pos; /* when skipping marks to form a ligature keep track of what ligature element a mark was attached to */
int16 context_pos; /* When doing a contextual match remember which glyphs are used, and where in the match they occur. Skipped glyphs have -1 */
- int16 orig_index;
+ int32 orig_index;
+ void *fl;
+ unsigned int line_break_after: 1;
+ unsigned int r2l: 1;
+ int16 bsln_off;
};
struct macname {
@@ -630,7 +731,6 @@ typedef struct undoes {
PST *possub; /* only for ut_statename */
struct splinepointlist *splines;
struct refchar *refs;
- struct minimumdistance *md;
struct imagelist *images;
void *hints; /* ut_statehint, ut_statename */
@@ -775,9 +875,11 @@ typedef struct bdffont {
BDFChar **glyphs; /* an array of charcnt entries */
int16 pixelsize;
int16 ascent, descent;
+ int16 layer; /* for piecemeal fonts */
unsigned int piecemeal: 1;
unsigned int bbsized: 1;
unsigned int ticked: 1;
+ unsigned int unhinted_freetype: 1;
struct bdffont *next;
struct clut *clut;
char *foundry;
@@ -792,7 +894,7 @@ typedef struct bdffont {
#define HntMax 96 /* PS says at most 96 hints */
typedef uint8 HintMask[HntMax/8];
-enum pointtype { pt_curve, pt_corner, pt_tangent };
+enum pointtype { pt_curve, pt_corner, pt_tangent, pt_hvcurve };
typedef struct splinepoint {
BasePoint me;
BasePoint nextcp; /* control point */
@@ -864,6 +966,7 @@ typedef struct spline {
unsigned int touched: 1;
unsigned int leftedge: 1;
unsigned int rightedge: 1;
+ unsigned int acceptableextrema: 1; /* This spline has extrema, but we don't care */
SplinePoint *from, *to;
Spline1D splines[2]; /* splines[0] is the x spline, splines[1] is y */
struct linearapprox *approx;
@@ -873,9 +976,14 @@ typedef struct spline {
*/
} Spline;
+
typedef struct splinepointlist {
SplinePoint *first, *last;
struct splinepointlist *next;
+ uint8 ticked;
+ uint8 beziers_need_optimizer; /* If the spiros have changed in spiro mode, then reverting to bezier mode might, someday, run a simplifier */
+ uint8 is_clip_path; /* In type3/svg fonts */
+ char *contour_name;
} SplinePointList, SplineSet;
typedef struct imagelist {
@@ -904,21 +1012,20 @@ typedef struct refchar {
int orig_pos;
int unicode_enc; /* used by paste */
real transform[6]; /* transformation matrix (first 2 rows of a 3x3 matrix, missing row is 0,0,1) */
-#ifdef FONTFORGE_CONFIG_TYPE3
struct reflayer {
- struct brush fill_brush;
- struct pen stroke_pen;
+ unsigned int background: 1;
+ unsigned int order2: 1;
+ unsigned int anyflexes: 1;
+#ifdef FONTFORGE_CONFIG_TYPE3
unsigned int dofill: 1;
unsigned int dostroke: 1;
unsigned int fillfirst: 1;
+ struct brush fill_brush;
+ struct pen stroke_pen;
+#endif
SplinePointList *splines;
- ImageList *images;
+ ImageList *images; /* Only in background or type3 layer(s) */
} *layers;
-#else
- struct reflayer {
- SplinePointList *splines;
- } layers[1];
-#endif
int layer_cnt;
struct refchar *next;
DBounds bb;
@@ -965,7 +1072,6 @@ typedef struct steminfo {
unsigned int linearedges: 1;/* If we have a nice rectangle then we aren't */
/* interested in the orientation which is */
/* wider than long */
- unsigned int bigsteminfo: 1;/* See following structure */
int16 hintnumber; /* when dumping out hintmasks we need to know */
/* what bit to set for this hint */
union {
@@ -978,25 +1084,14 @@ typedef struct steminfo {
HintInstance *where; /* location(s) in the other coord */
} StemInfo;
-typedef struct pointlist { struct pointlist *next; SplinePoint *sp; } PointList;
-typedef struct bigsteminfo {
- StemInfo s;
- PointList *left, *right;
-} BigStemInfo;
-
typedef struct dsteminfo {
struct dsteminfo *next; /* First two fields match those in steminfo */
unsigned int hinttype: 2; /* Only used by undoes */
unsigned int used: 1; /* used only by tottf.c:gendinstrs, metafont.c to mark a hint that has been dealt with */
- unsigned int bigsteminfo: 1;/* See following structure */
- BasePoint leftedgetop, leftedgebottom, rightedgetop, rightedgebottom; /* this order is important in tottf.c: DStemInteresect */
+ BasePoint left, right, unit;
+ HintInstance *where; /* location(s) along the unit vector */
} DStemInfo;
-typedef struct bigdsteminfo {
- DStemInfo s;
- PointList *left, *right;
-} BigDStemInfo;
-
typedef struct minimumdistance {
/* If either point is NULL it will be assumed to mean either the origin */
/* or the width point (depending on which is closer). This allows user */
@@ -1008,47 +1103,150 @@ typedef struct minimumdistance {
} MinimumDistance;
typedef struct layer /* : reflayer */{
+ unsigned int background: 1;
+ unsigned int order2: 1;
+ unsigned int anyflexes: 1;
#ifdef FONTFORGE_CONFIG_TYPE3
- struct brush fill_brush;
- struct pen stroke_pen;
unsigned int dofill: 1;
unsigned int dostroke: 1;
unsigned int fillfirst: 1;
+ struct brush fill_brush;
+ struct pen stroke_pen;
#endif
SplinePointList *splines;
ImageList *images; /* Only in background or type3 layer(s) */
RefChar *refs; /* Only in foreground layer(s) */
Undoes *undoes;
Undoes *redoes;
+ uint32 validation_state;
+ uint32 old_vs;
} Layer;
-enum layer_type { ly_grid= -1, ly_back=0, ly_fore=1 /* Possibly other foreground layers for multi-layered things */ };
+enum layer_type { ly_all=-2, ly_grid= -1, ly_back=0, ly_fore=1,
+ /* Possibly other foreground layers for type3 things */
+ /* Possibly other background layers for normal fonts */
+ ly_none = -3
+ };
+
+/* For the 'MATH' table (and for TeX) */
+struct glyphvariants {
+ char *variants; /* Space separated list of glyph names */
+/* Glyph assembly */
+ int16 italic_correction; /* Of the composed glyph */
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ DeviceTable *italic_adjusts;
+#endif
+ int part_cnt;
+ struct gv_part {
+ char *component;
+ unsigned int is_extender: 1; /* This component may be skipped or repeated */
+ uint16 startConnectorLength;
+ uint16 endConnectorLength;
+ uint16 fullAdvance;
+ } *parts;
+};
+
+/* For the 'MATH' table */
+struct mathkernvertex {
+ int cnt; /* There is one more kern entry than height entry */
+ /* So the last mkd should have its height ignored */
+ /* The MATH table stores the height count, I think the kern count */
+ /* is more useful. They differ by 1 */
+ struct mathkerndata {
+ int16 height,kern;
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ DeviceTable *height_adjusts;
+ DeviceTable *kern_adjusts;
+#endif
+ } *mkd;
+};
+
+struct mathkern {
+ struct mathkernvertex top_right;
+ struct mathkernvertex top_left;
+ struct mathkernvertex bottom_right;
+ struct mathkernvertex bottom_left;
+};
+
+enum privatedict_state {
+ pds_odd = 0x1, /* Odd number of entries */
+ pds_outoforder = 0x2, /* Bluevalues should be listed in order */
+ pds_toomany = 0x4, /* arrays are of limited sizes */
+ pds_tooclose = 0x8, /* adjacent zones must not be within 2*bluefuzz+1 (or 3, if bluefuzz omitted) */
+ pds_notintegral= 0x10, /* Must be integers */
+ pds_toobig = 0x20, /* within pair difference have some relation to BlueScale but the docs make no sense to me */
+ pds_shift = 8, /* BlueValues/OtherBlues, unshifted, FamilyBlues/FamilyOtherBlues shifted once */
+
+ pds_missingblue = 0x010000,
+ pds_badbluefuzz = 0x020000,
+ pds_badbluescale = 0x040000,
+ pds_badstdhw = 0x080000,
+ pds_badstdvw = 0x100000,
+ pds_badstemsnaph = 0x200000,
+ pds_badstemsnapv = 0x400000,
+ pds_stemsnapnostdh = 0x0800000,
+ pds_stemsnapnostdv = 0x1000000,
+ pds_badblueshift = 0x2000000
+
+};
+
+enum validation_state { vs_unknown = 0,
+ vs_known=0x01, /* It has been validated */
+ vs_opencontour=0x02,
+ vs_selfintersects=0x04,
+ vs_wrongdirection=0x08,
+ vs_flippedreferences=0x10, /* special case of wrong direction */
+ vs_missingextrema=0x20,
+ vs_missingglyphnameingsub=0x40,
+ /* Next few are postscript only */
+ vs_toomanypoints=0x80,
+ vs_toomanyhints=0x100,
+ vs_badglyphname=0x200,
+ /* Next few are only for fontlint */
+ /* These are relative to maxp values which ff would fix on generating a font */
+ vs_maxp_toomanypoints =0x400,
+ vs_maxp_toomanypaths =0x800,
+ vs_maxp_toomanycomppoints=0x1000,
+ vs_maxp_toomanycomppaths =0x2000,
+ vs_maxp_instrtoolong =0x4000,
+ vs_maxp_toomanyrefs =0x8000,
+ vs_maxp_refstoodeep =0x10000,
+ /* vs_maxp_prepfpgmtoolong=0x20000, */ /* I think I was wrong about this "error" */
+ /* Oops, we need another one, two, for the glyphs */
+ vs_pointstoofarapart = 0x40000,
+ vs_nonintegral = 0x80000, /* This will never be interesting in a real font, but might be in an sfd file */
+ vs_missinganchor = 0x100000,
+ vs_dupname = 0x200000,
+ vs_dupunicode = 0x400000,
+
+ vs_last = vs_dupunicode,
+ vs_maskps = 0x3fe | vs_pointstoofarapart | vs_missinganchor | vs_dupname | vs_dupunicode,
+ vs_maskcid = 0x1fe | vs_pointstoofarapart | vs_missinganchor | vs_dupname,
+ vs_maskttf = 0x7e | vs_pointstoofarapart | vs_nonintegral | vs_missinganchor | vs_dupunicode,
+ vs_maskfindproblems = 0x1be | vs_pointstoofarapart | vs_nonintegral | vs_missinganchor
+ };
typedef struct splinechar {
char *name;
int unicodeenc;
int orig_pos; /* Original position in the glyph list */
int16 width, vwidth;
-#ifdef LUA_FF_LIB
int16 xmin, ymin, xmax, ymax;
-#endif
int16 lsidebearing; /* only used when reading in a type1 font */
/* Or an otf font where it is the subr number of a refered character */
- /* or a ttf font with vert metrics where it is the ymax value */
+ /* or a ttf font without bit 1 of head.flags set */
+ /* or (once upon a time, but no longer) a ttf font with vert metrics where it is the ymax value when we had a font-wide vertical offset */
/* or when generating morx where it is the mask of tables in which the glyph occurs */
/* Always a temporary value */
int ttf_glyph; /* only used when writing out a ttf or otf font */
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer *layers; /* layer[0] is background, layer[1-n] foreground */
-#else
- Layer layers[2]; /* layer[0] is background, layer[1] foreground */
-#endif
+ Layer *layers; /* layer[0] is background, layer[1] foreground */
+ /* In type3 fonts 2-n are also foreground, otherwise also background */
int layer_cnt;
StemInfo *hstem; /* hstem hints have a vertical offset but run horizontally */
StemInfo *vstem; /* vstem hints have a horizontal offset but run vertically */
DStemInfo *dstem; /* diagonal hints for ttf */
MinimumDistance *md;
- struct charview *views;
+ struct charviewbase *views;
struct charinfo *charinfo;
struct splinefont *parent;
unsigned int changed: 1;
@@ -1060,18 +1258,21 @@ typedef struct splinechar {
unsigned int widthset: 1; /* needed so an emspace char doesn't disappear */
unsigned int vconflicts: 1; /* Any hint overlaps in the vstem list? */
unsigned int hconflicts: 1; /* Any hint overlaps in the hstem list? */
- unsigned int anyflexes: 1;
unsigned int searcherdummy: 1;
unsigned int changed_since_search: 1;
unsigned int wasopen: 1;
unsigned int namechanged: 1;
unsigned int blended: 1; /* An MM blended character */
- unsigned int unused_so_far: 1;
- unsigned int glyph_class: 3; /* 0=> fontforge determines class automagically, else one more than the class value in gdef */
+ unsigned int ticked2: 1;
+ unsigned int glyph_class: 3; /* 0=> fontforge determines class automagically, else one more than the class value in gdef so 2+1=>lig, 3+1=>mark */
unsigned int numberpointsbackards: 1;
unsigned int instructions_out_of_date: 1;
unsigned int complained_about_ptnums: 1;
- /* 10 bits left (one more if we ignore compositionunit below) */
+ unsigned int vs_open: 1;
+ unsigned int unlink_rm_ovrlp_save_undo: 1;
+ unsigned int inspiro: 1;
+ unsigned int lig_caret_cnt_fixed: 1;
+ /* 6 bits left (one more if we ignore compositionunit below) */
#if HANYANG
unsigned int compositionunit: 1;
int16 jamo, varient;
@@ -1092,12 +1293,45 @@ typedef struct splinechar {
int16 ttf_instrs_len;
int16 countermask_cnt;
HintMask *countermasks;
+ struct altuni { struct altuni *next; int unienc, vs, fid; } *altuni;
+ /* vs is the "variation selector" a unicode codepoint which modifieds */
+ /* the code point before it. If vs is -1 then unienc is just an */
+ /* alternate encoding (greek Alpha and latin A), but if vs is one */
+ /* of unicode's variation selectors then this glyph is somehow a */
+ /* variant shape. The specifics depend on the selector and script */
+ /* fid is currently unused, but may, someday, be used to do ttcs */
+ /* NOTE: GlyphInfo displays vs==-1 as vs==0, and fixes things up */
+/* for TeX */
int16 tex_height, tex_depth;
- int16 tex_sub_pos, tex_super_pos; /* Only for math fonts */
- struct altuni { struct altuni *next; int unienc; } *altuni;
+/* TeX also uses italic_correction and glyph variants below */
+/* For the 'MATH' table (and for TeX) */
+ unsigned int is_extended_shape: 1;
+ int16 italic_correction;
+ int16 top_accent_horiz; /* MATH table allows you to specific a*/
+ /* horizontal anchor for accent attachments, vertical */
+ /* positioning is done elsewhere */
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+ DeviceTable *italic_adjusts;
+ DeviceTable *top_accent_adjusts;
+#endif
+ struct glyphvariants *vert_variants;
+ struct glyphvariants *horiz_variants;
+ struct mathkern *mathkern;
+/* End of MATH/TeX fields */
#ifndef _NO_PYTHON
void *python_sc_object;
- void *python_data;
+ void *python_temporary;
+#endif
+ void *python_persistent; /* If python this will hold a python object, if not python this will hold a string containing a pickled object. We do nothing with it (if not python) except save it back out unchanged */
+#ifdef FONTFORGE_CONFIG_TYPE3
+ /* If the glyph is used as a tile pattern, then the next two values */
+ /* determine the amount of white space around the tile. If extra is*/
+ /* non-zero then we add it to the max components of the bbox and */
+ /* subtract it from the min components. If extra is 0 then tile_bounds*/
+ /* will be used. If tile_bounds is all zeros then the glyph's bbox */
+ /* will be used. */
+ real tile_margin; /* If the glyph is used as a tile */
+ DBounds tile_bounds;
#endif
} SplineChar;
@@ -1108,7 +1342,7 @@ enum ttfnames { ttf_copyright=0, ttf_family, ttf_subfamily, ttf_uniqueid,
ttf_manufacturer, ttf_designer, ttf_descriptor, ttf_venderurl,
ttf_designerurl, ttf_license, ttf_licenseurl, ttf_idontknow/*reserved*/,
ttf_preffamilyname, ttf_prefmodifiers, ttf_compatfull, ttf_sampletext,
- ttf_cidfindfontname, ttf_namemax };
+ ttf_cidfindfontname, ttf_wwsfamily, ttf_wwssubfamily, ttf_namemax };
struct ttflangname {
int lang;
char *names[ttf_namemax]; /* in utf8 */
@@ -1116,7 +1350,230 @@ struct ttflangname {
struct ttflangname *next;
};
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+struct MATH {
+/* From the MATH Constants subtable (constants for positioning glyphs. Not PI)*/
+ int16 ScriptPercentScaleDown;
+ int16 ScriptScriptPercentScaleDown;
+ uint16 DelimitedSubFormulaMinHeight;
+ uint16 DisplayOperatorMinHeight;
+ int16 MathLeading;
+ DeviceTable *MathLeading_adjust;
+ int16 AxisHeight;
+ DeviceTable *AxisHeight_adjust;
+ int16 AccentBaseHeight;
+ DeviceTable *AccentBaseHeight_adjust;
+ int16 FlattenedAccentBaseHeight;
+ DeviceTable *FlattenedAccentBaseHeight_adjust;
+ int16 SubscriptShiftDown;
+ DeviceTable *SubscriptShiftDown_adjust;
+ int16 SubscriptTopMax;
+ DeviceTable *SubscriptTopMax_adjust;
+ int16 SubscriptBaselineDropMin;
+ DeviceTable *SubscriptBaselineDropMin_adjust;
+ int16 SuperscriptShiftUp;
+ DeviceTable *SuperscriptShiftUp_adjust;
+ int16 SuperscriptShiftUpCramped;
+ DeviceTable *SuperscriptShiftUpCramped_adjust;
+ int16 SuperscriptBottomMin;
+ DeviceTable *SuperscriptBottomMin_adjust;
+ int16 SuperscriptBaselineDropMax;
+ DeviceTable *SuperscriptBaselineDropMax_adjust;
+ int16 SubSuperscriptGapMin;
+ DeviceTable *SubSuperscriptGapMin_adjust;
+ int16 SuperscriptBottomMaxWithSubscript;
+ DeviceTable *SuperscriptBottomMaxWithSubscript_adjust;
+ int16 SpaceAfterScript;
+ DeviceTable *SpaceAfterScript_adjust;
+ int16 UpperLimitGapMin;
+ DeviceTable *UpperLimitGapMin_adjust;
+ int16 UpperLimitBaselineRiseMin;
+ DeviceTable *UpperLimitBaselineRiseMin_adjust;
+ int16 LowerLimitGapMin;
+ DeviceTable *LowerLimitGapMin_adjust;
+ int16 LowerLimitBaselineDropMin;
+ DeviceTable *LowerLimitBaselineDropMin_adjust;
+ int16 StackTopShiftUp;
+ DeviceTable *StackTopShiftUp_adjust;
+ int16 StackTopDisplayStyleShiftUp;
+ DeviceTable *StackTopDisplayStyleShiftUp_adjust;
+ int16 StackBottomShiftDown;
+ DeviceTable *StackBottomShiftDown_adjust;
+ int16 StackBottomDisplayStyleShiftDown;
+ DeviceTable *StackBottomDisplayStyleShiftDown_adjust;
+ int16 StackGapMin;
+ DeviceTable *StackGapMin_adjust;
+ int16 StackDisplayStyleGapMin;
+ DeviceTable *StackDisplayStyleGapMin_adjust;
+ int16 StretchStackTopShiftUp;
+ DeviceTable *StretchStackTopShiftUp_adjust;
+ int16 StretchStackBottomShiftDown;
+ DeviceTable *StretchStackBottomShiftDown_adjust;
+ int16 StretchStackGapAboveMin;
+ DeviceTable *StretchStackGapAboveMin_adjust;
+ int16 StretchStackGapBelowMin;
+ DeviceTable *StretchStackGapBelowMin_adjust;
+ int16 FractionNumeratorShiftUp;
+ DeviceTable *FractionNumeratorShiftUp_adjust;
+ int16 FractionNumeratorDisplayStyleShiftUp;
+ DeviceTable *FractionNumeratorDisplayStyleShiftUp_adjust;
+ int16 FractionDenominatorShiftDown;
+ DeviceTable *FractionDenominatorShiftDown_adjust;
+ int16 FractionDenominatorDisplayStyleShiftDown;
+ DeviceTable *FractionDenominatorDisplayStyleShiftDown_adjust;
+ int16 FractionNumeratorGapMin;
+ DeviceTable *FractionNumeratorGapMin_adjust;
+ int16 FractionNumeratorDisplayStyleGapMin;
+ DeviceTable *FractionNumeratorDisplayStyleGapMin_adjust;
+ int16 FractionRuleThickness;
+ DeviceTable *FractionRuleThickness_adjust;
+ int16 FractionDenominatorGapMin;
+ DeviceTable *FractionDenominatorGapMin_adjust;
+ int16 FractionDenominatorDisplayStyleGapMin;
+ DeviceTable *FractionDenominatorDisplayStyleGapMin_adjust;
+ int16 SkewedFractionHorizontalGap;
+ DeviceTable *SkewedFractionHorizontalGap_adjust;
+ int16 SkewedFractionVerticalGap;
+ DeviceTable *SkewedFractionVerticalGap_adjust;
+ int16 OverbarVerticalGap;
+ DeviceTable *OverbarVerticalGap_adjust;
+ int16 OverbarRuleThickness;
+ DeviceTable *OverbarRuleThickness_adjust;
+ int16 OverbarExtraAscender;
+ DeviceTable *OverbarExtraAscender_adjust;
+ int16 UnderbarVerticalGap;
+ DeviceTable *UnderbarVerticalGap_adjust;
+ int16 UnderbarRuleThickness;
+ DeviceTable *UnderbarRuleThickness_adjust;
+ int16 UnderbarExtraDescender;
+ DeviceTable *UnderbarExtraDescender_adjust;
+ int16 RadicalVerticalGap;
+ DeviceTable *RadicalVerticalGap_adjust;
+ int16 RadicalDisplayStyleVerticalGap;
+ DeviceTable *RadicalDisplayStyleVerticalGap_adjust;
+ int16 RadicalRuleThickness;
+ DeviceTable *RadicalRuleThickness_adjust;
+ int16 RadicalExtraAscender;
+ DeviceTable *RadicalExtraAscender_adjust;
+ int16 RadicalKernBeforeDegree;
+ DeviceTable *RadicalKernBeforeDegree_adjust;
+ int16 RadicalKernAfterDegree;
+ DeviceTable *RadicalKernAfterDegree_adjust;
+ uint16 RadicalDegreeBottomRaisePercent;
+/* Global constants from other subtables */
+ uint16 MinConnectorOverlap; /* in the math variants sub-table */
+};
+#else
+struct MATH {
+/* From the MATH Constants subtable (constants for positioning glyphs. Not PI)*/
+ int16 ScriptPercentScaleDown;
+ int16 ScriptScriptPercentScaleDown;
+ uint16 DelimitedSubFormulaMinHeight;
+ uint16 DisplayOperatorMinHeight;
+ int16 MathLeading;
+ int16 AxisHeight;
+ int16 AccentBaseHeight;
+ int16 FlattenedAccentBaseHeight;
+ int16 SubscriptShiftDown;
+ int16 SubscriptTopMax;
+ int16 SubscriptBaselineDropMin;
+ int16 SuperscriptShiftUp;
+ int16 SuperscriptShiftUpCramped;
+ int16 SuperscriptBottomMin;
+ int16 SuperscriptBaselineDropMax;
+ int16 SubSuperscriptGapMin;
+ int16 SuperscriptBottomMaxWithSubscript;
+ int16 SpaceAfterScript;
+ int16 UpperLimitGapMin;
+ int16 UpperLimitBaselineRiseMin;
+ int16 LowerLimitGapMin;
+ int16 LowerLimitBaselineDropMin;
+ int16 StackTopShiftUp;
+ int16 StackTopDisplayStyleShiftUp;
+ int16 StackBottomShiftDown;
+ int16 StackBottomDisplayStyleShiftDown;
+ int16 StackGapMin;
+ int16 StackDisplayStyleGapMin;
+ int16 StretchStackTopShiftUp;
+ int16 StretchStackBottomShiftDown;
+ int16 StretchStackGapAboveMin;
+ int16 StretchStackGapBelowMin;
+ int16 FractionNumeratorShiftUp;
+ int16 FractionNumeratorDisplayStyleShiftUp;
+ int16 FractionDenominatorShiftDown;
+ int16 FractionDenominatorDisplayStyleShiftDown;
+ int16 FractionNumeratorGapMin;
+ int16 FractionNumeratorDisplayStyleGapMin;
+ int16 FractionRuleThickness;
+ int16 FractionDenominatorGapMin;
+ int16 FractionDenominatorDisplayStyleGapMin;
+ int16 SkewedFractionHorizontalGap;
+ int16 SkewedFractionVerticalGap;
+ int16 OverbarVerticalGap;
+ int16 OverbarRuleThickness;
+ int16 OverbarExtraAscender;
+ int16 UnderbarVerticalGap;
+ int16 UnderbarRuleThickness;
+ int16 UnderbarExtraDescender;
+ int16 RadicalVerticalGap;
+ int16 RadicalDisplayStyleVerticalGap;
+ int16 RadicalRuleThickness;
+ int16 RadicalExtraAscender;
+ int16 RadicalKernBeforeDegree;
+ int16 RadicalKernAfterDegree;
+ uint16 RadicalDegreeBottomRaisePercent;
+/* Global constants from other subtables */
+ uint16 MinConnectorOverlap; /* in the math variants sub-table */
+};
+#endif
+
enum backedup_state { bs_dontknow=0, bs_not=1, bs_backedup=2 };
+enum loadvalidation_state {
+ lvs_bad_ps_fontname = 0x001,
+ lvs_bad_glyph_table = 0x002,
+ lvs_bad_cff_table = 0x004,
+ lvs_bad_metrics_table = 0x008,
+ lvs_bad_cmap_table = 0x010,
+ lvs_bad_bitmaps_table = 0x020,
+ lvs_bad_gx_table = 0x040,
+ lvs_bad_ot_table = 0x080,
+ lvs_bad_os2_version = 0x100,
+ lvs_bad_sfnt_header = 0x200
+ };
+
+typedef struct layerinfo {
+ char *name;
+ unsigned int background: 1; /* Layer is to be treated as background: No width, images, not worth outputting */
+ unsigned int order2: 1; /* Layer's data are order 2 bezier splines (truetype) rather than order 3 (postscript) */
+ /* In all glyphs in the font */
+ unsigned int ticked: 1;
+} LayerInfo;
+
+/* Baseline data from the 'BASE' table */
+struct baselangextent {
+ uint32 lang; /* also used for feature tag */
+ struct baselangextent *next;
+ int16 ascent, descent;
+ struct baselangextent *features;
+};
+
+struct basescript {
+ uint32 script;
+ struct basescript *next;
+ int def_baseline; /* index [0-baseline_cnt) */
+ int16 *baseline_pos; /* baseline_cnt of these */
+ struct baselangextent *langs; /* Language specific extents (may be NULL) */
+ /* The default one has the tag DEFAULT_LANG */
+};
+
+struct Base {
+ int baseline_cnt;
+ uint32 *baseline_tags;
+ /* A font does not need to provide info on all baselines, but if one script */
+ /* talks about a baseline, then all must. So the set of baselines is global*/
+ struct basescript *scripts;
+};
+
typedef struct splinefont {
char *fontname, *fullname, *familyname, *weight;
char *copyright;
@@ -1124,12 +1581,9 @@ typedef struct splinefont {
char *defbasefilename;
char *version;
real italicangle, upos, uwidth; /* In font info */
-#ifdef LUA_FF_LIB
int units_per_em;
struct splinefont *next;
-#endif
int ascent, descent;
- int vertical_origin; /* height of vertical origin in character coordinate system */
int uniqueid; /* Not copied when reading in!!!! */
int glyphcnt, glyphmax; /* allocated size of glyphs array */
SplineChar **glyphs;
@@ -1147,7 +1601,6 @@ typedef struct splinefont {
unsigned int loading_cid_map: 1;
unsigned int dupnamewarn: 1; /* Warn about duplicate names when loading bdf font */
unsigned int encodingchanged: 1; /* Font's encoding has changed since it was loaded */
- unsigned int order2: 1; /* Font's data are order 2 bezier splines (truetype) rather than order 3 (postscript) */
unsigned int multilayer: 1; /* only applies if TYPE3 is set, means this font can contain strokes & fills */
/* I leave it in so as to avoid cluttering up code with #ifdefs */
unsigned int strokedfont: 1;
@@ -1162,13 +1615,13 @@ typedef struct splinefont {
unsigned int save_to_dir: 1; /* Loaded from an sfdir collection rather than a simple sfd file */
unsigned int head_optimized_for_cleartype: 1;/* Bit in the 'head' flags field, if unset "East Asian fonts in the Windows Presentation Framework (Avalon) will not be hinted" */
unsigned int ticked: 1;
- /* 6 bits left */
- struct fontview *fv;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
+ unsigned int internal_temp: 1; /* Internal temporary font to be passed to freetype for rasterizing. Don't complain about oddities */
+ unsigned int complained_about_spiros: 1;
+ unsigned int use_xuid: 1; /* Adobe has deprecated these two */
+ unsigned int use_uniqueid: 1; /* fields. Mostly we don't want to use them */
+ /* 2 bits left */
+ struct fontviewbase *fv;
struct metricsview *metrics;
-#else
- void *metrics;
-#endif
enum uni_interp uni_interp;
NameList *for_new_glyphs;
EncMap *map; /* only used when opening a font to provide original default encoding */
@@ -1191,6 +1644,8 @@ typedef struct splinefont {
unsigned int panose_set: 1;
unsigned int hheadset: 1;
unsigned int vheadset: 1;
+ unsigned int hascodepages: 1;
+ unsigned int hasunicoderanges: 1;
unsigned char pfmfamily;
int16 weight;
int16 width;
@@ -1206,7 +1661,8 @@ typedef struct splinefont {
int16 os2_strikeysize, os2_strikeypos;
char os2_vendor[4];
int16 os2_family_class;
-#ifdef LUA_FF_LIB
+ uint32 codepages[2];
+ uint32 unicoderanges[4];
uint16 avgwidth;
uint16 firstchar;
uint16 lastchar;
@@ -1214,7 +1670,6 @@ typedef struct splinefont {
int16 os2_capheight;
uint16 os2_defaultchar;
uint16 os2_breakchar;
-#endif
} pfminfo;
struct ttflangname *names;
char *cidregistry, *ordering;
@@ -1226,7 +1681,8 @@ typedef struct splinefont {
#if HANYANG
struct compositionrules *rules;
#endif
- char *comments;
+ char *comments; /* Used to be restricted to ASCII, now utf8 */
+ char *fontlog;
int tempuniqueid;
int top_enc;
uint16 desired_row_cnt, desired_col_cnt;
@@ -1238,7 +1694,10 @@ typedef struct splinefont {
struct ttf_table *next;
FILE *temp; /* Temporary storage used during generation */
} *ttf_tables, *ttf_tab_saved;
- /* We copy: fpgm, prep, cvt, maxp */
+ /* We copy: fpgm, prep, cvt, maxp (into ttf_tables) user can ask for others, into saved*/
+ char **cvt_names;
+ /* The end of this array is marked by a special entry: */
+#define END_CVT_NAMES ((char *) (~(intpt) 0))
struct instrdata *instr_dlgs; /* Pointer to all table and character instruction dlgs in this font */
struct shortview *cvt_dlg;
struct kernclasslistdlg *kcld, *vkcld;
@@ -1289,8 +1748,18 @@ typedef struct splinefont {
uint16 ppem;
uint16 flags;
} *gasp;
- uint8 sfd_version; /* Used only when reading in an sfd file */
+ struct MATH *MATH;
+ float sfd_version; /* Used only when reading in an sfd file */
struct gfi_data *fontinfo;
+ struct val_data *valwin;
+ void *python_temporary;
+ void *python_persistent; /* If python this will hold a python object, if not python this will hold a string containing a pickled object. We do nothing with it (if not python) except save it back out unchanged */
+ enum loadvalidation_state loadvalidation_state;
+ LayerInfo *layers;
+ int layer_cnt;
+ int display_layer;
+ struct Base *horiz_base, *vert_base;
+ int extrema_bound; /* Splines do not count for extrema complaints when the distance between the endpoints is less than or equal to this */
} SplineFont;
/* I am going to simplify my life and not encourage intermediate designs */
@@ -1359,9 +1828,15 @@ enum ttf_flags { ttf_flag_shortps = 1, ttf_flag_nohints = 2,
ttf_flag_TeXtable=0x80,
ttf_flag_ofm=0x100,
ttf_flag_oldkern=0x200, /* never set in conjunction with applemode */
- ttf_flag_brokensize=0x400 /* Adobe originally issued fonts with a bug in the size feature. They now claim (Aug 2006) that this has been fixed. Legacy programs will do the wrong thing with the fixed feature though */
+ ttf_flag_brokensize=0x400, /* Adobe originally issued fonts with a bug in the size feature. They now claim (Aug 2006) that this has been fixed. Legacy programs will do the wrong thing with the fixed feature though */
+ ttf_flag_pfed_lookupnames=0x800,
+ ttf_flag_pfed_guides=0x1000,
+ ttf_flag_pfed_layers=0x2000,
+ ttf_flag_symbol=0x4000,
+ ttf_flag_dummyDSIG=0x8000
};
-enum openflags { of_fstypepermitted=1, of_askcmap=2 };
+enum openflags { of_fstypepermitted=1, of_askcmap=2, of_all_glyphs_in_ttc=4,
+ of_fontlint=8, of_hidewindow=0x10 };
enum ps_flags { ps_flag_nohintsubs = 0x10000, ps_flag_noflex=0x20000,
ps_flag_nohints = 0x40000, ps_flag_restrict256=0x80000,
ps_flag_afm = 0x100000, ps_flag_pfm = 0x200000,
@@ -1374,11 +1849,16 @@ enum ps_flags { ps_flag_nohintsubs = 0x10000, ps_flag_noflex=0x20000,
ps_flag_identitycidmap = 0x2000000,
ps_flag_afmwithmarks = 0x4000000,
ps_flag_noseac = 0x8000000,
+ ps_flag_outputfontlog = 0x10000000,
ps_flag_mask = (ps_flag_nohintsubs|ps_flag_noflex|
ps_flag_afm|ps_flag_pfm|ps_flag_tfm|ps_flag_round)
};
struct compressors { char *ext, *decomp, *recomp; };
+struct archivers {
+ char *ext, *unarchive, *archive, *listargs, *extractargs, *appendargs;
+ enum archive_list_style { ars_tar, ars_zip } ars;
+};
struct fontdict;
struct pschars;
@@ -1420,7 +1900,7 @@ enum fontformat { ff_pfa, ff_pfb, ff_pfbmacbin, ff_multiple, ff_mma, ff_mmb,
ff_ttf, ff_ttfsym, ff_ttfmacbin, ff_ttfdfont, ff_otf, ff_otfdfont,
ff_otfcid, ff_otfciddfont, ff_svg, ff_ufo, ff_none };
extern struct pschars *SplineFont2ChrsSubrs(SplineFont *sf, int iscjk,
- struct pschars *subrs,int flags,enum fontformat format);
+ struct pschars *subrs,int flags,enum fontformat format,int layer);
extern int CanonicalCombiner(int uni);
struct cidbytes;
struct fd2data;
@@ -1428,15 +1908,15 @@ struct ttfinfo;
struct alltabs;
struct growbuf;
struct glyphdata;
-extern int UnitsParallel(BasePoint *u1,BasePoint *u2);
+extern int UnitsParallel(BasePoint *u1,BasePoint *u2,int strict);
extern int CvtPsStem3(struct growbuf *gb, SplineChar *scs[MmMax], int instance_count,
int ishstem, int round);
-extern struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,int flags);
+extern struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,int flags,int layer);
extern struct pschars *SplineFont2ChrsSubrs2(SplineFont *sf, int nomwid,
int defwid, const int *bygid, int cnt, int flags,
- struct pschars **_subrs);
+ struct pschars **_subrs,int layer);
extern struct pschars *CID2ChrsSubrs2(SplineFont *cidmaster,struct fd2data *fds,
- int flags, struct pschars **_glbls);
+ int flags, struct pschars **_glbls,int layer);
enum bitmapformat { bf_bdf, bf_ttf, bf_sfnt_dfont, bf_sfnt_ms, bf_otb,
bf_nfntmacbin, /*bf_nfntdfont, */bf_fon, bf_fnt, bf_palm,
bf_ptype3,
@@ -1444,37 +1924,40 @@ enum bitmapformat { bf_bdf, bf_ttf, bf_sfnt_dfont, bf_sfnt_ms, bf_otb,
extern const char *GetAuthor(void);
extern SplineChar *SFFindExistingCharMac(SplineFont *,EncMap *map, int unienc);
extern void SC_PSDump(void (*dumpchar)(int ch,void *data), void *data,
- SplineChar *sc, int refs_to_splines, int pdfopers );
-extern int _WritePSFont(FILE *out,SplineFont *sf,enum fontformat format,int flags,EncMap *enc,SplineFont *fullsf);
-extern int WritePSFont(char *fontname,SplineFont *sf,enum fontformat format,int flags,EncMap *enc,SplineFont *fullsf);
+ SplineChar *sc, int refs_to_splines, int pdfopers,int layer );
+extern int _WritePSFont(FILE *out,SplineFont *sf,enum fontformat format,int flags,EncMap *enc,SplineFont *fullsf,int layer);
+extern int WritePSFont(char *fontname,SplineFont *sf,enum fontformat format,int flags,EncMap *enc,SplineFont *fullsf,int layer);
extern int WriteMacPSFont(char *fontname,SplineFont *sf,enum fontformat format,
- int flags,EncMap *enc);
+ int flags,EncMap *enc,int layer);
extern int _WriteTTFFont(FILE *ttf,SplineFont *sf, enum fontformat format,
- int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc);
+ int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern int WriteTTFFont(char *fontname,SplineFont *sf, enum fontformat format,
- int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc);
+ int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern int _WriteType42SFNTS(FILE *type42,SplineFont *sf,enum fontformat format,
- int flags,EncMap *enc);
+ int flags,EncMap *enc,int layer);
extern int WriteMacTTFFont(char *fontname,SplineFont *sf, enum fontformat format,
- int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc);
+ int32 *bsizes, enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern int WriteMacBitmaps(char *filename,SplineFont *sf, int32 *sizes,
int is_dfont,EncMap *enc);
extern int WritePalmBitmaps(char *filename,SplineFont *sf, int32 *sizes,EncMap *enc);
extern int WriteMacFamily(char *filename,struct sflist *sfs,enum fontformat format,
- enum bitmapformat bf,int flags,EncMap *enc);
+ enum bitmapformat bf,int flags,EncMap *enc,int layer);
extern long mactime(void);
-extern int WriteSVGFont(char *fontname,SplineFont *sf,enum fontformat format,int flags,EncMap *enc);
-extern int WriteUFOFont(char *fontname,SplineFont *sf,enum fontformat format,int flags,EncMap *enc);
+extern int WriteSVGFont(char *fontname,SplineFont *sf,enum fontformat format,int flags,EncMap *enc,int layer);
+extern int WriteUFOFont(char *fontname,SplineFont *sf,enum fontformat format,int flags,EncMap *enc,int layer);
extern void SfListFree(struct sflist *sfs);
extern void TTF_PSDupsDefault(SplineFont *sf);
extern void DefaultTTFEnglishNames(struct ttflangname *dummy, SplineFont *sf);
extern void TeXDefaultParams(SplineFont *sf);
+extern int AlreadyMSSymbolArea(SplineFont *sf,EncMap *map);
extern void OS2FigureCodePages(SplineFont *sf, uint32 CodePage[2]);
+extern void OS2FigureUnicodeRanges(SplineFont *sf, uint32 Ranges[4]);
extern void SFDefaultOS2Info(struct pfminfo *pfminfo,SplineFont *sf,char *fontname);
extern void SFDefaultOS2Simple(struct pfminfo *pfminfo,SplineFont *sf);
extern void SFDefaultOS2SubSuper(struct pfminfo *pfminfo,int emsize,double italicangle);
extern void VerifyLanguages(SplineFont *sf);
extern int ScriptIsRightToLeft(uint32 script);
+extern void ScriptMainRange(uint32 script, int *start, int *end);
extern uint32 ScriptFromUnicode(int u,SplineFont *sf);
extern uint32 SCScriptFromUnicode(SplineChar *sc);
extern int SCRightToLeft(SplineChar *sc);
@@ -1487,9 +1970,12 @@ extern void SFMatchGlyphs(SplineFont *sf,SplineFont *target,int addempties);
extern void MMMatchGlyphs(MMSet *mm);
extern char *_GetModifiers(char *fontname, char *familyname,char *weight);
extern char *SFGetModifiers(SplineFont *sf);
+extern const unichar_t *_uGetModifiers(const unichar_t *fontname, const unichar_t *familyname,
+ const unichar_t *weight);
extern void SFSetFontName(SplineFont *sf, char *family, char *mods, char *full);
extern void ttfdumpbitmap(SplineFont *sf,struct alltabs *at,int32 *sizes);
extern void ttfdumpbitmapscaling(SplineFont *sf,struct alltabs *at,int32 *sizes);
+extern void SplineFontSetUnChanged(SplineFont *sf);
extern int RealNear(real a,real b);
extern int RealNearish(real a,real b);
@@ -1497,6 +1983,9 @@ extern int RealApprox(real a,real b);
extern int RealWithin(real a,real b,real fudge);
extern int RealRatio(real a,real b,real fudge);
+extern int PointsDiagonalable(SplineFont *sf,BasePoint **bp,BasePoint *unit);
+extern int MergeDStemInfo(SplineFont *sf,DStemInfo **ds, DStemInfo *test);
+
extern void LineListFree(LineList *ll);
extern void LinearApproxFree(LinearApprox *la);
extern void SplineFree(Spline *spline);
@@ -1508,6 +1997,7 @@ extern void SplinePointListFree(SplinePointList *spl);
extern void SplinePointListMDFree(SplineChar *sc,SplinePointList *spl);
extern void SplinePointListsMDFree(SplineChar *sc,SplinePointList *spl);
extern void SplinePointListsFree(SplinePointList *head);
+extern void SplineSetBeziersClear(SplineSet *spl);
extern void RefCharFree(RefChar *ref);
extern void RefCharsFree(RefChar *ref);
extern void RefCharsFreeRef(RefChar *ref);
@@ -1529,6 +2019,7 @@ extern AnchorPoint *APAnchorClassMerge(AnchorPoint *anchors,AnchorClass *into,An
extern void AnchorClassMerge(SplineFont *sf,AnchorClass *into,AnchorClass *from);
extern void AnchorClassesFree(AnchorClass *kp);
extern void TtfTablesFree(struct ttf_table *tab);
+extern void SFRemoveSavedTable(SplineFont *sf, uint32 tag);
extern AnchorClass *AnchorClassMatch(SplineChar *sc1,SplineChar *sc2,
AnchorClass *restrict_, AnchorPoint **_ap1,AnchorPoint **_ap2 );
extern AnchorClass *AnchorClassMkMkMatch(SplineChar *sc1,SplineChar *sc2,
@@ -1549,6 +2040,7 @@ extern int PSTContains(const char *components,const char *name);
extern StemInfo *StemInfoCopy(StemInfo *h);
extern DStemInfo *DStemInfoCopy(DStemInfo *h);
extern MinimumDistance *MinimumDistanceCopy(MinimumDistance *h);
+extern void SPChangePointType(SplinePoint *sp, int pointtype);
struct sfmergecontext {
SplineFont *sf_from, *sf_to;
int lcnt;
@@ -1558,6 +2050,8 @@ struct sfmergecontext {
int acnt;
struct ac_cvt { AnchorClass *from, *to; int old;} *acs;
char *prefix;
+ int preserveCrossFontKerning;
+ int lmax;
};
extern PST *PSTCopy(PST *base,SplineChar *sc,struct sfmergecontext *mc);
extern struct lookup_subtable *MCConvertSubtable(struct sfmergecontext *mc,struct lookup_subtable *sub);
@@ -1565,6 +2059,7 @@ extern AnchorClass *MCConvertAnchorClass(struct sfmergecontext *mc,AnchorClass *
extern void SFFinishMergeContext(struct sfmergecontext *mc);
extern SplineChar *SplineCharCopy(SplineChar *sc,SplineFont *into,struct sfmergecontext *);
extern BDFChar *BDFCharCopy(BDFChar *bc);
+extern void BCFlattenFloat(BDFChar *bc);
extern void BitmapsCopy(SplineFont *to, SplineFont *from, int to_index, int from_index );
extern struct gimage *ImageAlterClut(struct gimage *image);
extern void ImageListsFree(ImageList *imgs);
@@ -1575,10 +2070,12 @@ extern void AltUniRemove(SplineChar *sc,int uni);
extern void AltUniAdd(SplineChar *sc,int uni);
extern void MinimumDistancesFree(MinimumDistance *md);
extern void LayerDefault(Layer *);
-extern SplineChar *SplineCharCreate(void);
+extern SplineChar *SplineCharCreate(int layer_cnt);
+extern SplineChar *SFSplineCharCreate(SplineFont *sf);
extern RefChar *RefCharCreate(void);
-extern void SCAddRef(SplineChar *sc,SplineChar *rsc,real xoff, real yoff);
-extern void _SCAddRef(SplineChar *sc,SplineChar *rsc,real transform[6]);
+extern RefChar *RefCharsCopy(RefChar *ref); /* Still needs to be instanciated and have the dependency list adjusted */
+extern void SCAddRef(SplineChar *sc,SplineChar *rsc,int layer, real xoff, real yoff);
+extern void _SCAddRef(SplineChar *sc,SplineChar *rsc,int layer, real transform[6]);
extern KernClass *KernClassCopy(KernClass *kc);
extern void KernClassFreeContents(KernClass *kc);
extern void KernClassListFree(KernClass *kc);
@@ -1586,13 +2083,20 @@ extern int KernClassContains(KernClass *kc, char *name1, char *name2, int ordere
extern void OTLookupFree(OTLookup *lookup);
extern void OTLookupListFree(OTLookup *lookup );
extern FPST *FPSTCopy(FPST *fpst);
+extern void FPSTRuleContentsFree(struct fpst_rule *r, enum fpossub_format format);
+extern void FPSTRulesFree(struct fpst_rule *r, enum fpossub_format format, int rcnt);
extern void FPSTFree(FPST *fpst);
extern void ASMFree(ASM *sm);
extern struct macname *MacNameCopy(struct macname *mn);
extern void MacNameListFree(struct macname *mn);
extern void MacSettingListFree(struct macsetting *ms);
extern void MacFeatListFree(MacFeat *mf);
+extern void GlyphVariantsFree(struct glyphvariants *gv);
+extern void MathKernVContentsFree(struct mathkernvertex *mk);
+extern void MathKernFree(struct mathkern *mk);
+extern struct mathkern *MathKernCopy(struct mathkern *mk);
extern void SplineCharListsFree(struct splinecharlist *dlist);
+extern void LayerFreeContents(SplineChar *sc, int layer);
extern void SplineCharFreeContents(SplineChar *sc);
extern void SplineCharFree(SplineChar *sc);
extern void EncMapFree(EncMap *map);
@@ -1604,7 +2108,14 @@ extern EncMap *EncMapCopy(EncMap *map);
extern void SFExpandGlyphCount(SplineFont *sf, int newcnt);
extern void ScriptLangListFree(struct scriptlanglist *sl);
extern void FeatureScriptLangListFree(FeatureScriptLangList *fl);
+extern void SFBaseSort(SplineFont *sf);
+extern struct baselangextent *BaseLangCopy(struct baselangextent *extent);
+extern void BaseLangFree(struct baselangextent *extent);
+extern void BaseScriptFree(struct basescript *bs);
+extern void BaseFree(struct Base *base);
extern void SplineFontFree(SplineFont *sf);
+extern void MATHFree(struct MATH *math);
+extern struct MATH *MathTableNew(SplineFont *sf);
extern void OtfNameListFree(struct otfname *on);
extern void MarkClassFree(int cnt,char **classes,char **names);
extern void MMSetFreeContents(MMSet *mm);
@@ -1616,9 +2127,11 @@ extern Spline *SplineMake3(SplinePoint *from, SplinePoint *to);
extern LinearApprox *SplineApproximate(Spline *spline, real scale);
extern int SplinePointListIsClockwise(const SplineSet *spl);
extern void SplineSetFindBounds(const SplinePointList *spl, DBounds *bounds);
+extern void SplineCharLayerFindBounds(SplineChar *sc,int layer,DBounds *bounds);
extern void SplineCharFindBounds(SplineChar *sc,DBounds *bounds);
+extern void SplineFontLayerFindBounds(SplineFont *sf,int layer,DBounds *bounds);
extern void SplineFontFindBounds(SplineFont *sf,DBounds *bounds);
-extern void CIDFindBounds(SplineFont *sf,DBounds *bounds);
+extern void CIDLayerFindBounds(SplineFont *sf,int layer,DBounds *bounds);
extern void SplineSetQuickBounds(SplineSet *ss,DBounds *b);
extern void SplineCharQuickBounds(SplineChar *sc, DBounds *b);
extern void SplineSetQuickConservativeBounds(SplineSet *ss,DBounds *b);
@@ -1641,18 +2154,18 @@ extern HintMask *HintMaskFromTransformedRef(RefChar *ref,BasePoint *trans,
extern SplinePointList *SPLCopyTranslatedHintMasks(SplinePointList *base,
SplineChar *basesc, SplineChar *subsc, BasePoint *trans);
extern SplinePointList *SPLCopyTransformedHintMasks(RefChar *r,
- SplineChar *basesc, BasePoint *trans);
+ SplineChar *basesc, BasePoint *trans,int layer);
extern SplinePointList *SplinePointListRemoveSelected(SplineChar *sc,SplinePointList *base);
extern void SplinePointListSet(SplinePointList *tobase, SplinePointList *frombase);
extern void SplinePointListSelect(SplinePointList *spl,int sel);
-extern void SCRefToSplines(SplineChar *sc,RefChar *rf);
+extern void SCRefToSplines(SplineChar *sc,RefChar *rf,int layer);
extern void RefCharFindBounds(RefChar *rf);
-extern void SCReinstanciateRefChar(SplineChar *sc,RefChar *rf);
-extern void SCReinstanciateRef(SplineChar *sc,SplineChar *rsc);
+extern void SCReinstanciateRefChar(SplineChar *sc,RefChar *rf,int layer);
+extern void SCReinstanciateRef(SplineChar *sc,SplineChar *rsc,int layer);
extern void SFReinstanciateRefs(SplineFont *sf);
extern void SFInstanciateRefs(SplineFont *sf);
extern SplineChar *MakeDupRef(SplineChar *base, int local_enc, int uni_enc);
-extern void SCRemoveDependent(SplineChar *dependent,RefChar *rf);
+extern void SCRemoveDependent(SplineChar *dependent,RefChar *rf,int layer);
extern void SCRemoveLayerDependents(SplineChar *dependent,int layer);
extern void SCRemoveDependents(SplineChar *dependent);
extern int SCDependsOnSC(SplineChar *parent, SplineChar *child);
@@ -1661,18 +2174,22 @@ extern void BCRegularizeBitmap(BDFChar *bdfc);
extern void BCRegularizeGreymap(BDFChar *bdfc);
extern void BCPasteInto(BDFChar *bc,BDFChar *rbc,int ixoff,int iyoff, int invert, int cleartoo);
extern void BCRotateCharForVert(BDFChar *bc,BDFChar *from, BDFFont *frombdf);
-extern BDFChar *SplineCharRasterize(SplineChar *sc, double pixelsize);
+extern int GradientHere(double scale,DBounds *bbox,int iy,int ix,
+ struct gradient *grad,struct pattern *pat, int defgrey);
+extern void PatternPrep(SplineChar *sc,struct brush *brush,double scale);
+extern BDFChar *SplineCharRasterize(SplineChar *sc, int layer, double pixelsize);
extern BDFFont *SplineFontToBDFHeader(SplineFont *_sf, int pixelsize, int indicate);
-extern BDFFont *SplineFontRasterize(SplineFont *sf, int pixelsize, int indicate);
+extern BDFFont *SplineFontRasterize(SplineFont *sf, int layer, int pixelsize, int indicate);
extern void BDFCAntiAlias(BDFChar *bc, int linear_scale);
-extern BDFChar *SplineCharAntiAlias(SplineChar *sc, int pixelsize,int linear_scale);
-extern BDFFont *SplineFontAntiAlias(SplineFont *sf, int pixelsize,int linear_scale);
+extern BDFChar *SplineCharAntiAlias(SplineChar *sc, int layer, int pixelsize,int linear_scale);
+extern BDFFont *SplineFontAntiAlias(SplineFont *sf, int layer, int pixelsize,int linear_scale);
extern struct clut *_BDFClut(int linear_scale);
extern void BDFClut(BDFFont *bdf, int linear_scale);
extern int BDFDepth(BDFFont *bdf);
extern BDFChar *BDFPieceMeal(BDFFont *bdf, int index);
-enum piecemeal_flags { pf_antialias=1, pf_bbsized=2 };
-extern BDFFont *SplineFontPieceMeal(SplineFont *sf,int pixelsize,int flags,void *freetype_context);
+extern BDFChar *BDFPieceMealCheck(BDFFont *bdf, int index);
+enum piecemeal_flags { pf_antialias=1, pf_bbsized=2, pf_ft_nohints=4 };
+extern BDFFont *SplineFontPieceMeal(SplineFont *sf,int layer,int pixelsize,int flags,void *freetype_context);
extern void BDFCharFindBounds(BDFChar *bc,IBounds *bb);
extern BDFFont *BitmapFontScaleTo(BDFFont *old, int to);
extern void BDFCharFree(BDFChar *bdfc);
@@ -1688,7 +2205,12 @@ extern void SFReplaceEncodingBDFProps(SplineFont *sf,EncMap *map);
extern void SFReplaceFontnameBDFProps(SplineFont *sf);
extern int IsUnsignedBDFKey(char *key);
extern int BdfPropHasInt(BDFFont *font,const char *key, int def );
+extern char *BdfPropHasString(BDFFont *font,const char *key, char *def );
+extern void def_Charset_Enc(EncMap *map,char *reg,char *enc);
+extern void Default_XLFD(BDFFont *bdf,EncMap *map, int res);
+extern void Default_Properties(BDFFont *bdf,EncMap *map,char *onlyme);
extern void BDFDefaultProps(BDFFont *bdf, EncMap *map, int res);
+extern BDFProperties *BdfPropsCopy(BDFProperties *props, int cnt );
struct xlfd_components {
char foundry[80];
char family[100];
@@ -1706,6 +2228,11 @@ struct xlfd_components {
char cs_enc[80]; /* encoding version? */
int char_cnt;
};
+struct std_bdf_props {
+ char *name;
+ int type;
+ int defaultable;
+};
extern void XLFD_GetComponents(char *xlfd,struct xlfd_components *comp);
extern void XLFD_CreateComponents(BDFFont *bdf,EncMap *map,int res,struct xlfd_components *comp);
/* Two lines intersect in at most 1 point */
@@ -1724,6 +2251,23 @@ extern extended SplineSolve(const Spline1D *sp, real tmin, real tmax, extended s
extern int SplineSolveFull(const Spline1D *sp,extended val, extended ts[3]);
extern void SplineFindExtrema(const Spline1D *sp, extended *_t1, extended *_t2 );
+SplineSet *SplineSetsInterpolate(SplineSet *base, SplineSet *other, real amount, SplineChar *sc);
+SplineChar *SplineCharInterpolate(SplineChar *base, SplineChar *other, real amount);
+extern SplineFont *InterpolateFont(SplineFont *base, SplineFont *other, real amount, Encoding *enc);
+
+double SFSerifHeight(SplineFont *sf);
+
+extern void DumpPfaEditEncodings(void);
+extern void ParseEncodingFile(char *filename);
+extern void LoadPfaEditEncodings(void);
+
+extern int GenerateScript(SplineFont *sf,char *filename,char *bitmaptype,
+ int fmflags,int res, char *subfontdirectory,struct sflist *sfs,
+ EncMap *map,NameList *rename_to,int layer);
+
+extern void _SCAutoTrace(SplineChar *sc, int layer, char **args);
+extern char **AutoTraceArgs(int ask);
+
#define CURVATURE_ERROR -1e9
extern double SplineCurvature(Spline *s, double t);
@@ -1748,9 +2292,13 @@ extern Spline *ApproximateSplineFromPoints(SplinePoint *from, SplinePoint *to,
extern Spline *ApproximateSplineFromPointsSlopes(SplinePoint *from, SplinePoint *to,
TPoint *mid, int cnt,int order2);
extern double SplineLength(Spline *spline);
+extern double SplineLengthRange(Spline *spline, real from_t, real to_t);
+extern double PathLength(SplineSet *ss);
+extern Spline *PathFindDistance(SplineSet *path,double d,double *_t);
+extern SplineSet *SplineSetBindToPath(SplineSet *ss,int doscale, int glyph_as_unit,
+ int align,real offset, SplineSet *path);
extern int SplineIsLinear(Spline *spline);
extern int SplineIsLinearMake(Spline *spline);
-extern int SplineInSplineSet(Spline *spline, SplineSet *spl);
extern int SSPointWithin(SplineSet *spl,BasePoint *pt);
extern SplineSet *SSRemoveZeroLengthSplines(SplineSet *base);
extern void SSRemoveStupidControlPoints(SplineSet *base);
@@ -1766,8 +2314,9 @@ extern void SplinePointListSimplify(SplineChar *sc,SplinePointList *spl,
extern SplineSet *SplineCharSimplify(SplineChar *sc,SplineSet *head,
struct simplifyinfo *smpl);
extern void SPLStartToLeftmost(SplineChar *sc,SplinePointList *spl, int *changed);
-extern void SPLsStartToLeftmost(SplineChar *sc);
-extern void CanonicalContours(SplineChar *sc);
+extern void SPLsStartToLeftmost(SplineChar *sc,int layer);
+extern void CanonicalContours(SplineChar *sc,int layer);
+extern void SplineSetJoinCpFixup(SplinePoint *sp);
extern SplineSet *SplineSetJoin(SplineSet *start,int doall,real fudge,int *changed);
enum ae_type { ae_all, ae_between_selected, ae_only_good, ae_only_good_rm_later };
extern Spline *SplineAddExtrema(Spline *s,int always,real lenbound,
@@ -1794,13 +2343,13 @@ extern void SplineCharDefaultPrevCP(SplinePoint *base);
extern void SplineCharDefaultNextCP(SplinePoint *base);
extern void SplineCharTangentNextCP(SplinePoint *sp);
extern void SplineCharTangentPrevCP(SplinePoint *sp);
+extern void SPHVCurveForce(SplinePoint *sp);
extern void SPSmoothJoint(SplinePoint *sp);
extern int PointListIsSelected(SplinePointList *spl);
-extern void SplineSetsUntick(SplineSet *spl);
+extern void SCSplinePointsUntick(SplineChar *sc,int layer);
extern void SFOrderBitmapList(SplineFont *sf);
extern int KernThreshold(SplineFont *sf, int cnt);
extern real SFGuessItalicAngle(SplineFont *sf);
-extern void SFHasSerifs(SplineFont *sf);
extern SplinePoint *SplineTtfApprox(Spline *ps);
extern SplineSet *SSttfApprox(SplineSet *ss);
@@ -1817,6 +2366,12 @@ extern void SCConvertToOrder2(SplineChar *sc);
extern void SFConvertToOrder2(SplineFont *sf);
extern void SCConvertToOrder3(SplineChar *sc);
extern void SFConvertToOrder3(SplineFont *sf);
+extern void SFConvertGridToOrder2(SplineFont *_sf);
+extern void SCConvertLayerToOrder2(SplineChar *sc,int layer);
+extern void SFConvertLayerToOrder2(SplineFont *sf,int layer);
+extern void SFConvertGridToOrder3(SplineFont *_sf);
+extern void SCConvertLayerToOrder3(SplineChar *sc,int layer);
+extern void SFConvertLayerToOrder3(SplineFont *sf,int layer);
extern void SCConvertOrder(SplineChar *sc, int to_order2);
extern void SplinePointPrevCPChanged2(SplinePoint *sp);
extern void SplinePointNextCPChanged2(SplinePoint *sp);
@@ -1830,53 +2385,104 @@ extern int IntersectLinesClip(BasePoint *inter,
#if 0
extern void SSBisectTurners(SplineSet *spl);
#endif
-extern void SSRemoveBacktracks(SplineSet *ss);
extern SplineSet *SplineSetStroke(SplineSet *spl,StrokeInfo *si,SplineChar *sc);
extern SplineSet *SSStroke(SplineSet *spl,StrokeInfo *si,SplineChar *sc);
extern SplineSet *SplineSetRemoveOverlap(SplineChar *sc,SplineSet *base,enum overlap_type);
+extern SplineSet *SSShadow(SplineSet *spl,real angle, real outline_width,
+ real shadow_length,SplineChar *sc, int wireframe);
+extern double BlueScaleFigureForced(struct psdict *private,real bluevalues[], real otherblues[]);
extern double BlueScaleFigure(struct psdict *private,real bluevalues[], real otherblues[]);
-extern void FindBlues( SplineFont *sf, real blues[14], real otherblues[10]);
-extern void QuickBlues(SplineFont *sf, BlueData *bd);
+extern void FindBlues( SplineFont *sf, int layer, real blues[14], real otherblues[10]);
+extern void QuickBlues(SplineFont *sf, int layer, BlueData *bd);
extern void FindHStems( SplineFont *sf, real snaps[12], real cnt[12]);
extern void FindVStems( SplineFont *sf, real snaps[12], real cnt[12]);
-extern int SplineCharIsFlexible(SplineChar *sc);
-extern void SCGuessHHintInstancesAndAdd(SplineChar *sc, StemInfo *stem, real guess1, real guess2);
-extern void SCGuessVHintInstancesAndAdd(SplineChar *sc, StemInfo *stem, real guess1, real guess2);
-extern void SCGuessHHintInstancesList(SplineChar *sc);
-extern void SCGuessVHintInstancesList(SplineChar *sc);
+extern double SFStdVW(SplineFont *sf);
+extern int SplineCharIsFlexible(SplineChar *sc,int layer);
+extern void SCGuessHintInstancesList(SplineChar *sc,int layer,StemInfo *hstem,StemInfo *vstem,DStemInfo *dstem,int hvforce,int dforce);
+extern void SCGuessDHintInstances(SplineChar *sc, int layer,DStemInfo *ds );
+extern void SCGuessHHintInstancesAndAdd(SplineChar *sc, int layer,StemInfo *stem, real guess1, real guess2);
+extern void SCGuessVHintInstancesAndAdd(SplineChar *sc, int layer,StemInfo *stem, real guess1, real guess2);
+extern void SCGuessHHintInstancesList(SplineChar *sc, int layer);
+extern void SCGuessVHintInstancesList(SplineChar *sc, int layer);
extern real HIlen( StemInfo *stems);
extern real HIoverlap( HintInstance *mhi, HintInstance *thi);
extern int StemInfoAnyOverlaps(StemInfo *stems);
extern int StemListAnyConflicts(StemInfo *stems);
extern HintInstance *HICopyTrans(HintInstance *hi, real mul, real offset);
extern void MDAdd(SplineChar *sc, int x, SplinePoint *sp1, SplinePoint *sp2);
-extern int SFNeedsAutoHint( SplineFont *_sf);
-extern void SCAutoInstr( SplineChar *sc,BlueData *bd );
+extern int SFNeedsAutoHint( SplineFont *_sf,int layer);
+
+typedef struct bluezone {
+ real base;
+ int cvtindex;
+ real family_base; /* NaN if none */
+ int family_cvtindex;
+ real overshoot; /* relative to baseline, NOT to base */
+ int highest; /* used in autoinstructing for HStem positioning */
+ int lowest; /* as above */
+} BlueZone;
+
+typedef struct stdstem {
+ real width; /* -1 if none */
+ int cvtindex;
+ struct stdstem *snapto;/* NULL means stem isn't snapped to any other */
+ int stopat; /* at which ppem stop snapping to snapto */
+} StdStem;
+
+typedef struct globalinstrct {
+ SplineFont *sf;
+ int layer;
+ BlueData *bd;
+ double fudge;
+
+ /* Did we initialize the tables needed? 'maxp' is skipped because */
+ /* its initialization always succeeds. */
+ int cvt_done;
+ int fpgm_done;
+ int prep_done;
+
+ /* PS private data with truetype-specific information added */
+ BlueZone blues[12]; /* like in BlueData */
+ int bluecnt;
+ StdStem stdhw;
+ StdStem *stemsnaph; /* StdHW excluded */
+ int stemsnaphcnt;
+ StdStem stdvw;
+ StdStem *stemsnapv; /* StdVW excluded */
+ int stemsnapvcnt;
+} GlobalInstrCt;
+
+extern void InitGlobalInstrCt( GlobalInstrCt *gic,SplineFont *sf,int layer,
+ BlueData *bd );
+extern void FreeGlobalInstrCt( GlobalInstrCt *gic );
+extern void NowakowskiSCAutoInstr( GlobalInstrCt *gic,SplineChar *sc );
extern void CVT_ImportPrivate(SplineFont *sf);
-extern void SCModifyHintMasksAdd(SplineChar *sc,StemInfo *new);
+
+extern void SCModifyHintMasksAdd(SplineChar *sc,int layer,StemInfo *new);
extern void SCClearHints(SplineChar *sc);
-extern void SCClearHintMasks(SplineChar *sc,int counterstoo);
+extern void SCClearHintMasks(SplineChar *sc,int layer,int counterstoo);
extern void SCFigureVerticalCounterMasks(SplineChar *sc);
extern void SCFigureCounterMasks(SplineChar *sc);
-extern void SCFigureHintMasks(SplineChar *sc);
-extern void _SplineCharAutoHint( SplineChar *sc, BlueData *bd, struct glyphdata *gd2 );
-extern void SplineCharAutoHint( SplineChar *sc,BlueData *bd);
-extern void SFSCAutoHint( SplineChar *sc,BlueData *bd);
-extern void SplineFontAutoHint( SplineFont *sf);
-extern void SplineFontAutoHintRefs( SplineFont *sf);
+extern void SCFigureHintMasks(SplineChar *sc,int layer);
+extern void _SplineCharAutoHint( SplineChar *sc, int layer, BlueData *bd, struct glyphdata *gd2, int gen_undoes );
+extern void SplineCharAutoHint( SplineChar *sc,int layer, BlueData *bd);
+extern void SFSCAutoHint( SplineChar *sc,int layer,BlueData *bd);
+extern void SplineFontAutoHint( SplineFont *sf, int layer);
+extern void SplineFontAutoHintRefs( SplineFont *sf, int layer);
extern StemInfo *HintCleanup(StemInfo *stem,int dosort,int instance_count);
-extern int SplineFontIsFlexible(SplineFont *sf,int flags);
+extern int SplineFontIsFlexible(SplineFont *sf,int layer, int flags);
extern int SCDrawsSomething(SplineChar *sc);
-extern int SCWorthOutputting(SplineChar *sc);
+#define SCWorthOutputting(a) 1
extern int SFFindNotdef(SplineFont *sf, int fixed);
+extern int doesGlyphExpandHorizontally(SplineChar *sc);
extern int IsntBDFChar(BDFChar *bdfc);
extern int CIDWorthOutputting(SplineFont *cidmaster, int enc); /* Returns -1 on failure, font number on success */
-extern int AmfmSplineFont(FILE *afm, MMSet *mm,int formattype,EncMap *map);
-extern int AfmSplineFont(FILE *afm, SplineFont *sf,int formattype,EncMap *map, int docc, SplineFont *fullsf);
-extern int PfmSplineFont(FILE *pfm, SplineFont *sf,int type0,EncMap *map);
-extern int TfmSplineFont(FILE *afm, SplineFont *sf,int formattype,EncMap *map);
-extern int OfmSplineFont(FILE *afm, SplineFont *sf,int formattype,EncMap *map);
+extern int AmfmSplineFont(FILE *afm, MMSet *mm,int formattype,EncMap *map,int layer);
+extern int AfmSplineFont(FILE *afm, SplineFont *sf,int formattype,EncMap *map, int docc, SplineFont *fullsf,int layer);
+extern int PfmSplineFont(FILE *pfm, SplineFont *sf,int type0,EncMap *map,int layer);
+extern int TfmSplineFont(FILE *afm, SplineFont *sf,int formattype,EncMap *map,int layer);
+extern int OfmSplineFont(FILE *afm, SplineFont *sf,int formattype,EncMap *map,int layer);
extern char *EncodingName(Encoding *map);
extern char *SFEncodingName(SplineFont *sf,EncMap *map);
extern void SFLigaturePrepare(SplineFont *sf);
@@ -1896,6 +2502,7 @@ extern MacFeat *SFDParseMacFeatures(FILE *sfd, char *tok);
extern int SFDWrite(char *filename,SplineFont *sf,EncMap *map,EncMap *normal, int todir);
extern int SFDWriteBak(SplineFont *sf,EncMap *map,EncMap *normal);
extern SplineFont *SFDRead(char *filename);
+extern SplineFont *_SFDRead(char *filename,FILE *sfd);
extern SplineFont *SFDirRead(char *filename);
extern SplineChar *SFDReadOneChar(SplineFont *sf,const char *name);
extern char *TTFGetFontName(FILE *ttf,int32 offset,int32 off2);
@@ -1912,7 +2519,14 @@ extern SplineFont *SFReadMacBinary(char *filename,int flags,enum openflags openf
extern SplineFont *SFReadWinFON(char *filename,int toback);
extern SplineFont *SFReadPalmPdb(char *filename,int toback);
extern SplineFont *LoadSplineFont(char *filename,enum openflags);
+extern SplineFont *_ReadSplineFont(FILE *file,char *filename, enum openflags openflags);
extern SplineFont *ReadSplineFont(char *filename,enum openflags); /* Don't use this, use LoadSF instead */
+extern FILE *URLToTempFile(char *url,void *lock);
+extern int URLFromFile(char *url,FILE *from);
+extern int HttpGetBuf(char *url, char *databuf, int *datalen, void *mutex);
+extern void ArchiveCleanup(char *archivedir);
+extern char *Unarchive(char *name, char **_archivedir);
+extern char *Decompress(char *name, int compression);
extern SplineFont *SFFromBDF(char *filename,int ispk,int toback);
extern SplineFont *SFFromMF(char *filename);
extern void SFCheckPSBitmap(SplineFont *sf);
@@ -1939,12 +2553,14 @@ extern SplineChar *SCBuildDummy(SplineChar *dummy,SplineFont *sf,EncMap *map,int
extern SplineChar *SFMakeChar(SplineFont *sf,EncMap *map,int i);
extern char *AdobeLigatureFormat(char *name);
extern uint32 LigTagFromUnicode(int uni);
-extern void SCLigCaretCheck(SplineChar *sc,int clean);
+extern void SCLigCaretheck(SplineChar *sc,int clean);
extern BDFChar *BDFMakeGID(BDFFont *bdf,int gid);
extern BDFChar *BDFMakeChar(BDFFont *bdf,EncMap *map,int enc);
+extern RefChar *RefCharsCopyState(SplineChar *sc,int layer);
+extern int SCWasEmpty(SplineChar *sc, int skip_this_layer);
extern void SCUndoSetLBearingChange(SplineChar *sc,int lb);
-extern Undoes *SCPreserveHints(SplineChar *sc);
+extern Undoes *SCPreserveHints(SplineChar *sc,int layer);
extern Undoes *SCPreserveLayer(SplineChar *sc,int layer,int dohints);
extern Undoes *SCPreserveState(SplineChar *sc,int dohints);
extern Undoes *SCPreserveBackground(SplineChar *sc);
@@ -1952,21 +2568,17 @@ extern Undoes *SFPreserveGuide(SplineFont *sf);
extern Undoes *SCPreserveWidth(SplineChar *sc);
extern Undoes *SCPreserveVWidth(SplineChar *sc);
extern Undoes *BCPreserveState(BDFChar *bc);
-extern void BCDoRedo(BDFChar *bc,struct fontview *fv);
-extern void BCDoUndo(BDFChar *bc,struct fontview *fv);
-
-extern int SFIsCompositBuildable(SplineFont *sf,int unicodeenc,SplineChar *sc);
-extern int SFIsSomethingBuildable(SplineFont *sf,SplineChar *sc,int onlyaccents);
-extern int SFIsRotatable(SplineFont *sf,SplineChar *sc);
-extern int SCMakeDotless(SplineFont *sf, SplineChar *dotless, int copybmp, int doit);
-extern void SCBuildComposit(SplineFont *sf, SplineChar *sc, int copybmp,
- struct fontview *fv);
-extern int SCAppendAccent(SplineChar *sc,char *glyph_name,int uni,int pos);
-#ifdef FONTFORGE_CONFIG_GTK
-extern const char *SFGetAlternate(SplineFont *sf, int base,SplineChar *sc,int nocheck);
-#else
+extern void BCDoRedo(BDFChar *bc);
+extern void BCDoUndo(BDFChar *bc);
+
+extern int isaccent(int uni);
+extern int SFIsCompositBuildable(SplineFont *sf,int unicodeenc,SplineChar *sc, int layer);
+extern int SFIsSomethingBuildable(SplineFont *sf,SplineChar *sc, int layer,int onlyaccents);
+extern int SFIsRotatable(SplineFont *sf,SplineChar *sc, int layer);
+extern int SCMakeDotless(SplineFont *sf, SplineChar *dotless, int layer, int copybmp, int doit);
+extern void SCBuildComposit(SplineFont *sf, SplineChar *sc, int layer, int copybmp);
+extern int SCAppendAccent(SplineChar *sc,int layer, char *glyph_name,int uni,int pos);
extern const unichar_t *SFGetAlternate(SplineFont *sf, int base,SplineChar *sc,int nocheck);
-#endif
extern int getAdobeEnc(char *name);
@@ -1974,7 +2586,8 @@ extern void SFSplinesFromLayers(SplineFont *sf,int tostroke);
extern void SFSetLayerWidthsStroked(SplineFont *sf, real strokewidth);
extern SplineSet *SplinePointListInterpretSVG(char *filename,char *memory, int memlen, int em_size, int ascent,int stroked);
extern SplineSet *SplinePointListInterpretGlif(char *filename,char *memory, int memlen, int em_size, int ascent,int stroked);
-extern SplinePointList *SplinePointListInterpretPS(FILE *ps,int flags,int stroked);
+#define UNDEFINED_WIDTH -999999
+extern SplinePointList *SplinePointListInterpretPS(FILE *ps,int flags,int stroked,int *width);
extern void PSFontInterpretPS(FILE *ps,struct charprocs *cp,char **encoding);
extern struct enc *PSSlurpEncodings(FILE *file);
extern int EvaluatePS(char *str,real *stack,int size);
@@ -1993,6 +2606,7 @@ extern void MatMultiply(real m1[6], real m2[6], real to[6]);
extern int NameToEncoding(SplineFont *sf,EncMap *map,const char *uname);
extern void GlyphHashFree(SplineFont *sf);
extern void SFHashGlyph(SplineFont *sf,SplineChar *sc);
+extern SplineChar *SFHashName(SplineFont *sf,const char *name);
extern int SFFindGID(SplineFont *sf, int unienc, const char *name );
extern int SFFindSlot(SplineFont *sf, EncMap *map, int unienc, const char *name );
extern int SFCIDFindCID(SplineFont *sf, int unienc, const char *name );
@@ -2004,10 +2618,10 @@ extern int SFCIDFindExistingChar(SplineFont *sf, int unienc, const char *name );
extern int SFHasCID(SplineFont *sf, int cid);
extern char *getPfaEditDir(char *buffer);
-extern void DoAutoSaves(void);
+extern void _DoAutoSaves(struct fontviewbase *);
extern void CleanAutoRecovery(void);
-extern int DoAutoRecovery(void);
-extern SplineFont *SFRecoverFile(char *autosavename);
+extern int DoAutoRecovery(int);
+extern SplineFont *SFRecoverFile(char *autosavename,int inquire, int *state);
extern void SFAutoSave(SplineFont *sf,EncMap *map);
extern void SFClearAutoSave(SplineFont *sf);
@@ -2018,16 +2632,21 @@ extern int PSDictFindEntry(struct psdict *dict, char *key);
extern char *PSDictHasEntry(struct psdict *dict, char *key);
extern int PSDictRemoveEntry(struct psdict *dict, char *key);
extern int PSDictChangeEntry(struct psdict *dict, char *key, char *newval);
+extern int SFPrivateGuess(SplineFont *sf,int layer, struct psdict *private,
+ char *name, int onlyone);
+
+extern void SFRemoveLayer(SplineFont *sf,int l);
+extern void SFAddLayer(SplineFont *sf,char *name,int order2, int background);
+extern void SFLayerSetBackground(SplineFont *sf,int layer,int is_back);
-extern void SplineSetsRound2Int(SplineSet *spl,real factor);
-extern void SCRound2Int(SplineChar *sc,real factor);
+extern void SplineSetsRound2Int(SplineSet *spl,real factor,int inspiro,int onlysel);
+extern void SCRound2Int(SplineChar *sc,int layer, real factor);
extern int SCRoundToCluster(SplineChar *sc,int layer,int sel,double within,double max);
extern int SplineSetsRemoveAnnoyingExtrema(SplineSet *ss,double err);
extern int hascomposing(SplineFont *sf,int u,SplineChar *sc);
#if 0
extern void SFFigureGrid(SplineFont *sf);
#endif
-extern int FVWinInfo(struct fontview *,int *cc,int *rc);
struct cidmap; /* private structure to encoding.c */
extern int CIDFromName(char *name,SplineFont *cidmaster);
@@ -2040,7 +2659,6 @@ extern struct cidmap *LoadMapFromFile(char *file,char *registry,char *ordering,
extern struct cidmap *FindCidMap(char *registry,char *ordering,int supplement,
SplineFont *sf);
extern void SFEncodeToMap(SplineFont *sf,struct cidmap *map);
-extern struct cidmap *AskUserForCIDMap(SplineFont *sf);
extern SplineFont *CIDFlatten(SplineFont *cidmaster,SplineChar **chars,int charcnt);
extern void SFFlatten(SplineFont *cidmaster);
extern int SFFlattenByCMap(SplineFont *sf,char *cmapname);
@@ -2056,28 +2674,28 @@ void putlong(FILE *file,int val);
void putfixed(FILE *file,real dval);
int ttfcopyfile(FILE *ttf, FILE *other, int pos, char *table_name);
-extern void SCCopyFgToBg(SplineChar *sc,int show);
-extern void SCCopyBgToFg(SplineChar *sc,int show);
+extern void SCCopyLayerToLayer(SplineChar *sc, int from, int to,int doclear);
extern int hasFreeType(void);
extern int hasFreeTypeDebugger(void);
extern int hasFreeTypeByteCode(void);
extern int FreeTypeAtLeast(int major, int minor, int patch);
extern void doneFreeType(void);
-extern void *_FreeTypeFontContext(SplineFont *sf,SplineChar *sc,struct fontview *fv,
- enum fontformat ff,int flags,void *shared_ftc);
-extern void *FreeTypeFontContext(SplineFont *sf,SplineChar *sc,struct fontview *fv);
+extern void *_FreeTypeFontContext(SplineFont *sf,SplineChar *sc,struct fontviewbase *fv,
+ int layer, enum fontformat ff,int flags,void *shared_ftc);
+extern void *FreeTypeFontContext(SplineFont *sf,SplineChar *sc,struct fontviewbase *fv,int layer);
extern BDFFont *SplineFontFreeTypeRasterize(void *freetypecontext,int pixelsize,int depth);
extern BDFChar *SplineCharFreeTypeRasterize(void *freetypecontext,int gid,
int pixelsize,int depth);
extern void FreeTypeFreeContext(void *freetypecontext);
extern SplineSet *FreeType_GridFitChar(void *single_glyph_context,
- int enc, real ptsize, int dpi, int16 *width, SplineChar *sc);
+ int enc, real ptsizey, real ptsizex, int dpi, uint16 *width, SplineChar *sc, int depth);
extern struct freetype_raster *FreeType_GetRaster(void *single_glyph_context,
- int enc, real ptsize, int dpi,int depth);
-extern BDFChar *SplineCharFreeTypeRasterizeNoHints(SplineChar *sc,
+ int enc, real ptsizey, real ptsizex, int dpi,int depth);
+extern BDFChar *SplineCharFreeTypeRasterizeNoHints(SplineChar *sc,int layer,
+ int pixelsize,int depth);
+extern BDFFont *SplineFontFreeTypeRasterizeNoHints(SplineFont *sf,int layer,
int pixelsize,int depth);
-extern BDFFont *SplineFontFreeTypeRasterizeNoHints(SplineFont *sf,int pixelsize,int depth);
extern void FreeType_FreeRaster(struct freetype_raster *raster);
struct TT_ExecContextRec_;
extern struct freetype_raster *DebuggerCurrentRaster(struct TT_ExecContextRec_ *exc,int depth);
@@ -2095,21 +2713,16 @@ extern void SFRenameGlyphsToNamelist(SplineFont *sf,NameList *new);
extern char **SFTemporaryRenameGlyphsToNamelist(SplineFont *sf,NameList *new);
extern void SFTemporaryRestoreGlyphNames(SplineFont *sf,char **former);
-extern void doversion(void);
+extern void doversion(const char *);
-#ifdef FONTFORGE_CONFIG_GTK
-extern AnchorPos *AnchorPositioning(SplineChar *sc,char *ustr,SplineChar **sstr );
-#else
extern AnchorPos *AnchorPositioning(SplineChar *sc,unichar_t *ustr,SplineChar **sstr );
-#endif
extern void AnchorPosFree(AnchorPos *apos);
-extern int SFCloseAllInstrs(SplineFont *sf);
-extern void SCMarkInstrDlgAsChanged(SplineChar *sc);
-extern int SSTtfNumberPoints(SplineSet *ss);
-extern int SCNumberPoints(SplineChar *sc);
-extern int SCPointsNumberedProperly(SplineChar *sc);
-extern int ttfFindPointInSC(SplineChar *sc,int pnum,BasePoint *pos,
+extern int SF_CloseAllInstrs(SplineFont *sf);
+extern int SSTtfNumberPoints(SplineSet *ss);
+extern int SCNumberPoints(SplineChar *sc,int layer);
+extern int SCPointsNumberedProperly(SplineChar *sc,int layer);
+extern int ttfFindPointInSC(SplineChar *sc,int layer,int pnum,BasePoint *pos,
RefChar *bound);
int SFFigureDefWidth(SplineFont *sf, int *_nomwid);
@@ -2117,7 +2730,6 @@ int SFFigureDefWidth(SplineFont *sf, int *_nomwid);
extern int SFRenameTheseFeatureTags(SplineFont *sf, uint32 tag, int sli, int flags,
uint32 totag, int tosli, int toflags, int ismac);
extern int SFRemoveUnusedNestedFeatures(SplineFont *sf);
-extern int SFHasNestedLookupWithTag(SplineFont *sf,uint32 tag,int ispos);
extern int ClassesMatch(int cnt1,char **classes1,int cnt2,char **classes2);
extern FPST *FPSTGlyphToClass(FPST *fpst);
@@ -2151,7 +2763,6 @@ extern int BpColinear(BasePoint *first, BasePoint *mid, BasePoint *last);
enum psstrokeflags { sf_toobigwarn=1, sf_removeoverlap=2, sf_handle_eraser=4,
sf_correctdir=8, sf_clearbeforeinput=16 };
-extern enum psstrokeflags PsStrokeFlagsDlg(void);
extern char *MMAxisAbrev(char *axis_name);
extern char *MMMakeMasterFontname(MMSet *mm,int ipos,char **fullname);
@@ -2162,15 +2773,9 @@ extern int MMValid(MMSet *mm,int complain);
extern void MMKern(SplineFont *sf,SplineChar *first,SplineChar *second,int diff,
struct lookup_subtable *sub,KernPair *oldkp);
extern char *MMBlendChar(MMSet *mm, int gid);
-extern int MMReblend(struct fontview *fv, MMSet *mm);
-struct fontview *MMCreateBlendedFont(MMSet *mm,struct fontview *fv,real blends[MmMax],int tonew );
extern char *EnforcePostScriptName(char *old);
-extern const char *TTFNameIds(int id);
-extern const char *MSLangString(int language);
-extern void FontInfoInit(void);
-extern void LookupUIInit(void);
extern char *ToAbsolute(char *filename);
enum Compare_Ret { SS_DiffContourCount = 1,
@@ -2209,6 +2814,7 @@ enum font_compare_flags { fcf_outlines=1, fcf_exact=2, fcf_warn_not_exact=4,
fcf_adddiff2sf1=0x800, fcf_addmissing=0x1000 };
extern int CompareFonts(SplineFont *sf1, EncMap *map1, SplineFont *sf2,
FILE *diffs, int flags);
+extern int LayersSimilar(Layer *ly1, Layer *ly2, double spline_err);
# if HANYANG
@@ -2228,6 +2834,7 @@ extern void SFSetModTime(SplineFont *sf);
extern void SFTimesFromFile(SplineFont *sf,FILE *);
extern int SFHasInstructions(SplineFont *sf);
+extern int RefDepth(RefChar *ref,int layer);
extern SplineChar *SCHasSubs(SplineChar *sc,uint32 tag);
@@ -2241,6 +2848,7 @@ extern SplineChar **SFGlyphsWithPSTinSubtable(SplineFont *sf,struct lookup_subta
extern SplineChar **SFGlyphsWithLigatureinLookup(SplineFont *sf,struct lookup_subtable *subtable);
extern void SFFindUnusedLookups(SplineFont *sf);
extern void SFFindClearUnusedLookupBits(SplineFont *sf);
+extern int LookupUsedNested(SplineFont *sf,OTLookup *checkme);
extern void SFRemoveUnusedLookupSubTables(SplineFont *sf,
int remove_incomplete_anchorclasses,
int remove_unused_lookups);
@@ -2253,15 +2861,18 @@ extern void NameOTLookup(OTLookup *otl,SplineFont *sf);
extern void FListAppendScriptLang(FeatureScriptLangList *fl,uint32 script_tag,uint32 lang_tag);
extern void FListsAppendScriptLang(FeatureScriptLangList *fl,uint32 script_tag,uint32 lang_tag);
struct scriptlanglist *SLCopy(struct scriptlanglist *sl);
+struct scriptlanglist *SListCopy(struct scriptlanglist *sl);
extern FeatureScriptLangList *FeatureListCopy(FeatureScriptLangList *fl);
extern void SLMerge(FeatureScriptLangList *into, struct scriptlanglist *fsl);
extern void FLMerge(OTLookup *into, OTLookup *from);
extern FeatureScriptLangList *FLOrder(FeatureScriptLangList *fl);
extern int FeatureScriptTagInFeatureScriptList(uint32 tag, uint32 script, FeatureScriptLangList *fl);
+extern FeatureScriptLangList *FindFeatureTagInFeatureScriptList(uint32 tag, FeatureScriptLangList *fl);
extern int FeatureTagInFeatureScriptList(uint32 tag, FeatureScriptLangList *fl);
extern int DefaultLangTagInOneScriptList(struct scriptlanglist *sl);
extern struct scriptlanglist *DefaultLangTagInScriptList(struct scriptlanglist *sl, int DFLT_ok);
extern int ScriptInFeatureScriptList(uint32 script, FeatureScriptLangList *fl);
+extern int _FeatureOrderId( int isgpos,uint32 tag );
extern int FeatureOrderId( int isgpos,FeatureScriptLangList *fl );
extern void SFSubTablesMerge(SplineFont *_sf,struct lookup_subtable *subfirst,
struct lookup_subtable *subsecond);
@@ -2270,22 +2881,87 @@ extern struct lookup_subtable *SFSubTableFindOrMake(SplineFont *sf,uint32 tag,ui
extern struct lookup_subtable *SFSubTableMake(SplineFont *sf,uint32 tag,uint32 script,
int lookup_type );
extern OTLookup *OTLookupCopyInto(SplineFont *into_sf,SplineFont *from_sf, OTLookup *from_otl);
+extern void OTLookupsCopyInto(SplineFont *into_sf,SplineFont *from_sf,
+ OTLookup **from_list, OTLookup *before);
extern struct opentype_str *ApplyTickedFeatures(SplineFont *sf,uint32 *flist, uint32 script, uint32 lang,
- SplineChar **glyphs);
+ int pixelsize, SplineChar **glyphs);
extern int VerticalKernFeature(SplineFont *sf, OTLookup *otl, int ask);
+extern void SFGlyphRenameFixup(SplineFont *sf, char *old, char *new);
+struct sllk { uint32 script; int cnt, max; OTLookup **lookups; int lcnt, lmax; uint32 *langs; };
+extern void SllkFree(struct sllk *sllk,int sllk_cnt);
+extern struct sllk *AddOTLToSllks( OTLookup *otl, struct sllk *sllk,
+ int *_sllk_cnt, int *_sllk_max );
+extern OTLookup *NewAALTLookup(SplineFont *sf,struct sllk *sllk, int sllk_cnt, int i);
+extern void AddNewAALTFeatures(SplineFont *sf);
+
+extern void SplinePointRound(SplinePoint *,real);
+
+extern int KCFindName(char *name, char **classnames, int cnt );
extern int KCFindIndex(KernClass *kc,char *name1, char *name2);
extern KernClass *SFFindKernClass(SplineFont *sf,SplineChar *first,SplineChar *last,
int *index,int allow_zero);
extern KernClass *SFFindVKernClass(SplineFont *sf,SplineChar *first,SplineChar *last,
int *index,int allow_zero);
-#ifdef LUA_FF_LIB
-extern SplineFont *SFReadTTFInfo(char *filename,int flags,enum openflags openflags);
-extern SplineFont *CFFParseInfo(char *filename);
-extern SplineFont *SFReadMacBinaryInfo(char *filename,int flags,enum openflags openflags);
-extern SplineFont *ReadSplineFontInfo(char *filename,enum openflags);
-#endif
+extern void SCClearRounds(SplineChar *sc,int layer);
+extern void MDReplace(MinimumDistance *md,SplineSet *old,SplineSet *rpl);
+extern void SCSynchronizeWidth(SplineChar *sc,real newwidth, real oldwidth,struct fontviewbase *fv);
+extern RefChar *HasUseMyMetrics(SplineChar *sc,int layer);
+extern void SCSynchronizeLBearing(SplineChar *sc,real off,int layer);
+extern void RevertedGlyphReferenceFixup(SplineChar *sc, SplineFont *sf);
+
+extern void SFUntickAll(SplineFont *sf);
+
+extern void BDFOrigFixup(BDFFont *bdf,int orig_cnt,SplineFont *sf);
+
+extern int HasSVG(void);
+extern void SCImportSVG(SplineChar *sc,int layer,char *path,char *memory, int memlen,int doclear);
+extern int HasUFO(void);
+extern void SCImportGlif(SplineChar *sc,int layer,char *path,char *memory, int memlen,int doclear);
+extern void SCImportPS(SplineChar *sc,int layer,char *path,int doclear, int flags);
+extern void SCImportPSFile(SplineChar *sc,int layer,FILE *ps,int doclear,int flags);
+extern void SCImportPDF(SplineChar *sc,int layer,char *path,int doclear, int flags);
+extern void SCImportPDFFile(SplineChar *sc,int layer,FILE *ps,int doclear,int flags);
+extern void SCImportPlateFile(SplineChar *sc,int layer,FILE *plate,int doclear,int flags);
+extern void SCAddScaleImage(SplineChar *sc,struct gimage *image,int doclear,int layer);
+extern void SCInsertImage(SplineChar *sc,struct gimage *image,real scale,real yoff, real xoff, int layer);
+extern void SCImportFig(SplineChar *sc,int layer,char *path,int doclear);
+
+extern int _ExportPlate(FILE *pdf,SplineChar *sc,int layer);
+extern int _ExportPDF(FILE *pdf,SplineChar *sc,int layer);
+extern int _ExportEPS(FILE *eps,SplineChar *sc,int layer, int gen_preview);
+extern int _ExportSVG(FILE *svg,SplineChar *sc,int layer);
+extern int _ExportGlif(FILE *glif,SplineChar *sc,int layer);
+extern int ExportEPS(char *filename,SplineChar *sc,int layer);
+extern int ExportPDF(char *filename,SplineChar *sc,int layer);
+extern int ExportPlate(char *filename,SplineChar *sc,int layer);
+extern int ExportSVG(char *filename,SplineChar *sc,int layer);
+extern int ExportGlif(char *filename,SplineChar *sc,int layer);
+extern int ExportFig(char *filename,SplineChar *sc,int layer);
+extern int BCExportXBM(char *filename,BDFChar *bdfc, int format);
+extern int ExportImage(char *filename,SplineChar *sc, int layer, int format, int pixelsize, int bitsperpixel);
+extern void ScriptExport(SplineFont *sf, BDFFont *bdf, int format, int gid,
+ char *format_spec, EncMap *map);
+
+extern EncMap *EncMapFromEncoding(SplineFont *sf,Encoding *enc);
+extern void SFRemoveGlyph(SplineFont *sf,SplineChar *sc, int *flags);
+extern void SFAddEncodingSlot(SplineFont *sf,int gid);
+extern void SFAddGlyphAndEncode(SplineFont *sf,SplineChar *sc,EncMap *basemap, int baseenc);
+extern void SCDoRedo(SplineChar *sc,int layer);
+extern void SCDoUndo(SplineChar *sc,int layer);
+extern void SCCopyWidth(SplineChar *sc,enum undotype);
+extern void SCAppendPosSub(SplineChar *sc,enum possub_type type, char **d,SplineFont *copied_from);
+extern void SCClearBackground(SplineChar *sc);
+extern void BackgroundImageTransform(SplineChar *sc, ImageList *img,real transform[6]);
+extern int SFIsDuplicatable(SplineFont *sf, SplineChar *sc);
+
+extern void DoAutoSaves(void);
+
+extern void SCClearLayer(SplineChar *sc,int layer);
+extern void SCClearContents(SplineChar *sc,int layer);
+extern void SCClearAll(SplineChar *sc,int layer);
+extern void BCClearAll(BDFChar *bc);
#if !defined(_NO_PYTHON)
extern void FontForge_PythonInit(void);
@@ -2293,11 +2969,76 @@ extern void PyFF_ErrorString(const char *msg,const char *str);
extern void PyFF_ErrorF3(const char *frmt, const char *str, int size, int depth);
extern void PyFF_Stdin(void);
extern void PyFF_Main(int argc,char **argv,int start);
-extern void PyFF_ScriptFile(struct fontview *fv,char *filename);
-extern void PyFF_ScriptString(struct fontview *fv,char *str);
-extern void PyFF_FreeFV(struct fontview *fv);
+extern void PyFF_ScriptFile(struct fontviewbase *fv,SplineChar *sc,char *filename);
+extern void PyFF_ScriptString(struct fontviewbase *fv,SplineChar *sc,int layer,char *str);
+extern void PyFF_FreeFV(struct fontviewbase *fv);
extern void PyFF_FreeSC(SplineChar *sc);
-struct gtextinfo;
-extern void scriptingSaveEnglishNames(struct gtextinfo *ids,struct gtextinfo *langs);
+extern void PyFF_FreeSF(SplineFont *sf);
+extern void PyFF_ProcessInitFiles(void);
+extern char *PyFF_PickleMeToString(void *pydata);
+extern void *PyFF_UnPickleMeToObjects(char *str);
+struct _object; /* Python Object */
+extern void PyFF_CallDictFunc(struct _object *dict,char *key,char *argtypes, ... );
+extern void ff_init(void);
+#endif
+extern void doinitFontForgeMain(void);
+
+extern void InitSimpleStuff(void);
+
+extern int SSExistsInLayer(SplineSet *ss,SplineSet *lots );
+extern int SplineExistsInSS(Spline *s,SplineSet *ss);
+extern int SpExistsInSS(SplinePoint *sp,SplineSet *ss);
+
+extern int MSLanguageFromLocale(void);
+
+extern struct math_constants_descriptor {
+ char *ui_name;
+ char *script_name;
+ int offset;
+ int devtab_offset;
+ char *message;
+ int new_page;
+} math_constants_descriptor[];
+
+extern int BPTooFar(BasePoint *bp1, BasePoint *bp2);
+extern char *VSErrorsFromMask(int mask,int private_mask);
+extern int SCValidate(SplineChar *sc, int layer, int force);
+extern AnchorClass *SCValidateAnchors(SplineChar *sc);
+extern void SCTickValidationState(SplineChar *sc,int layer);
+extern int ValidatePrivate(SplineFont *sf);
+extern int SFValidate(SplineFont *sf, int layer, int force);
+extern int VSMaskFromFormat(SplineFont *sf, int layer, enum fontformat format);
+
+struct lang_frequencies;
+extern unichar_t *PrtBuildDef( SplineFont *sf, void *tf,
+ void (*langsyscallback)(void *tf, int end, uint32 script, uint32 lang) );
+extern char *RandomParaFromScriptLang(uint32 script, uint32 lang, SplineFont *sf,
+ struct lang_frequencies *freq);
+extern char *RandomParaFromScript(uint32 script, uint32 *lang, SplineFont *sf);
+extern int SF2Scripts(SplineFont *sf,uint32 scripts[100]);
+extern char **SFScriptLangs(SplineFont *sf,struct lang_frequencies ***freq);
+
+extern int SSHasClip(SplineSet *ss);
+extern int SSHasDrawn(SplineSet *ss);
+extern struct gradient *GradientCopy(struct gradient *old);
+extern void GradientFree(struct gradient *grad);
+extern struct pattern *PatternCopy(struct pattern *old);
+extern void PatternFree(struct pattern *pat);
+extern void BrushCopy(struct brush *into, struct brush *from);
+extern void PenCopy(struct pen *into, struct pen *from);
+extern void PatternSCBounds(SplineChar *sc,DBounds *b);
+
+extern char *SFDefaultImage(SplineFont *sf,char *filename);
+extern void SCClearInstrsOrMark(SplineChar *sc, int layer, int complain);
+extern void instrcheck(SplineChar *sc,int layer);
+extern void TTFPointMatches(SplineChar *sc,int layer,int top);
+
+#ifdef LUA_FF_LIB
+extern SplineFont *ReadSplineFontInfo(char *filename,enum openflags openflags); /* splinefont.c */
+extern SplineFont *SFReadTTFInfo(char *filename, int flags, enum openflags openflags); /* parsettf.c */
+extern SplineFont *SFReadMacBinaryInfo(char *filename,int flags,enum openflags openflags); /* macbinary.c */
#endif
+
+
+
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineorder2.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineorder2.c
index 2c2aa350a67..e807b105e38 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineorder2.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineorder2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -496,17 +496,42 @@ static SplinePoint *CvtDataToSplines(QPoint *data,int qfirst,int qlast,SplinePoi
end = SplinePointCreate(data[i].bp.x,data[i].bp.y);
start->nextcp = end->prevcp = data[i-1].cp;
start->nonextcp = end->noprevcp = false;
+ if (( data[i-1].cp.x == data[i].bp.x && data[i-1].cp.y == data[i].bp.y ) ||
+ ( data[i-1].cp.x == start->me.x && data[i-1].cp.y == start->me.y ))
+ start->nonextcp = end->noprevcp = true;
SplineMake2(start,end);
start = end;
}
return( start );
}
+static int SplineWithWellBehavedControlPoints(Spline *ps) {
+ BasePoint splineunit;
+ double splinelen, npos, ppos;
+
+ splineunit.x = ps->to->me.x - ps->from->me.x;
+ splineunit.y = ps->to->me.y - ps->from->me.y;
+ splinelen = sqrt(splineunit.x*splineunit.x + splineunit.y*splineunit.y);
+ if ( splinelen!=0 ) {
+ splineunit.x /= splinelen;
+ splineunit.y /= splinelen;
+ }
+
+ npos = (ps->from->nextcp.x-ps->from->me.x) * splineunit.x +
+ (ps->from->nextcp.y-ps->from->me.y) * splineunit.y;
+ ppos = (ps->to->prevcp.x-ps->from->me.x) * splineunit.x +
+ (ps->to->prevcp.y-ps->from->me.y) * splineunit.y;
+return( npos>=0 && /* npos<=ppos &&*/ ppos<=splinelen );
+}
+
static int PrettyApprox(Spline *ps,double tmin, double tmax,
QPoint *data, int qcnt, int round_to_int ) {
int ptcnt, q, i;
double distance, dx, dy, tstart;
BasePoint end, mid, slopemin, slopemid, slopeend;
+ BasePoint splineunit, start;
+ double splinelen, midpos, lastpos, lastpos2, cppos;
+ int do_good_spline_check;
QPoint data2[12];
if ( qcnt==-1 )
@@ -514,11 +539,38 @@ return( -1 );
slopemin.x = (3*ps->splines[0].a*tmin+2*ps->splines[0].b)*tmin+ps->splines[0].c;
slopemin.y = (3*ps->splines[1].a*tmin+2*ps->splines[1].b)*tmin+ps->splines[1].c;
+ if ( slopemin.x==0 && slopemin.y==0 ) {
+ double t = tmin + (tmax-tmin)/256;
+ /* If there is no control point for this end point, then the slope is */
+ /* 0/0 at the end point. Which isn't useful, it leads to a quadratic */
+ /* control point at the end point, but this one is real because it */
+ /* is used to interpolate the next point, but we get all confused */
+ /* because we don't expect a real cp to be on the base point. */
+ slopemin.x = (3*ps->splines[0].a*t+2*ps->splines[0].b)*t+ps->splines[0].c;
+ slopemin.y = (3*ps->splines[1].a*t+2*ps->splines[1].b)*t+ps->splines[1].c;
+ }
end.x = ((ps->splines[0].a*tmax+ps->splines[0].b)*tmax+ps->splines[0].c)*tmax+ps->splines[0].d;
end.y = ((ps->splines[1].a*tmax+ps->splines[1].b)*tmax+ps->splines[1].c)*tmax+ps->splines[1].d;
slopeend.x = (3*ps->splines[0].a*tmax+2*ps->splines[0].b)*tmax+ps->splines[0].c;
slopeend.y = (3*ps->splines[1].a*tmax+2*ps->splines[1].b)*tmax+ps->splines[1].c;
+ if ( slopemin.x==0 && slopemin.y==0 ) {
+ double t = tmax - (tmax-tmin)/256;
+ /* Same problem as above, except at the other end */
+ slopeend.x = (3*ps->splines[0].a*t+2*ps->splines[0].b)*t+ps->splines[0].c;
+ slopeend.y = (3*ps->splines[1].a*t+2*ps->splines[1].b)*t+ps->splines[1].c;
+ }
+
+ start.x = data[qcnt-1].bp.x;
+ start.y = data[qcnt-1].bp.y;
+ splineunit.x = end.x - start.x;
+ splineunit.y = end.y - start.y;
+ splinelen = sqrt(splineunit.x*splineunit.x + splineunit.y*splineunit.y);
+ if ( splinelen!=0 ) {
+ splineunit.x /= splinelen;
+ splineunit.y /= splinelen;
+ }
+ do_good_spline_check = SplineWithWellBehavedControlPoints(ps);
if ( round_to_int && tmax!=1 ) {
end.x = rint( end.x );
@@ -528,11 +580,20 @@ return( -1 );
dx = end.x-data[qcnt-1].bp.x; dy = end.y-data[qcnt-1].bp.y;
distance = dx*dx + dy*dy;
+ if ( distance<.3 ) {
+ /* This is meaningless in truetype, use a line */
+ data[qcnt-1].cp = data[qcnt-1].bp;
+ data[qcnt].bp = end;
+ data[qcnt].t = 1;
+return( qcnt+1 );
+ }
+
for ( ptcnt=0; ptcnt<10; ++ptcnt ) {
if ( ptcnt>1 && distance/(ptcnt*ptcnt)<100 )
return( -1 ); /* Points too close for a good approx */
q = qcnt;
data2[ptcnt+1].bp = end;
+ lastpos=0; lastpos2 = splinelen;
for ( i=0; i<=ptcnt; ++i ) {
tstart = (tmin*(ptcnt-i) + tmax*(i+1))/(ptcnt+1);
mid.x = ((ps->splines[0].a*tstart+ps->splines[0].b)*tstart+ps->splines[0].c)*tstart+ps->splines[0].d;
@@ -560,6 +621,16 @@ return( -1 ); /* Points too close for a good approx */
data[q-1].cp.x = 2*data[q-1].bp.x - data[q-2].cp.x;
data[q-1].cp.y = 2*data[q-1].bp.y - data[q-2].cp.y;
}
+
+ midpos = (mid.x-start.x)*splineunit.x + (mid.y-start.y)*splineunit.y;
+ cppos = (data[q-1].cp.x-start.x)*splineunit.x + (data[q-1].cp.y-start.y)*splineunit.y;
+
+ if ( ((do_good_spline_check || i!=0 ) && cppos<lastpos) || cppos>midpos ) {
+ i = 0; /* Means we failed */
+ break;
+ }
+ lastpos = midpos;
+
data[q].bp = mid;
data[q++].t = tstart;
@@ -590,6 +661,15 @@ return( -1 ); /* Points too close for a good approx */
data2[ptcnt-i].cp.y = 2*data2[ptcnt-i+1].bp.y - data2[ptcnt-i+1].cp.y;
}
data2[ptcnt-i].bp = mid;
+
+ midpos = (mid.x-start.x)*splineunit.x + (mid.y-start.y)*splineunit.y;
+ cppos = (data2[ptcnt-i].cp.x-start.x)*splineunit.x + (data2[ptcnt-i].cp.y-start.y)*splineunit.y;
+ if ( ((do_good_spline_check || i!=0 ) && cppos>lastpos2) || cppos<midpos ) {
+ i = 0; /* Means we failed */
+ break;
+ }
+ lastpos2 = midpos;
+
}
if ( i==0 )
continue;
@@ -814,6 +894,9 @@ SplineSet *SSttfApprox(SplineSet *ss) {
first = NULL;
for ( spline=ss->first->next; spline!=NULL && spline!=first; spline=spline->to->next ) {
ret->last = ttfApprox(spline,ret->last);
+ ret->last->ptindex = spline->to->ptindex;
+ ret->last->ttfindex = spline->to->ttfindex;
+ ret->last->nextcpindex = spline->to->nextcpindex;
if ( spline->to->hintmask != NULL ) {
ret->last->hintmask = chunkalloc(sizeof(HintMask));
memcpy(ret->last->hintmask,spline->to->hintmask,sizeof(HintMask));
@@ -836,7 +919,7 @@ return( ret );
}
SplineSet *SplineSetsTTFApprox(SplineSet *ss) {
- SplineSet *head=NULL, *last=NULL, *cur;
+ SplineSet *head=NULL, *last, *cur;
while ( ss!=NULL ) {
cur = SSttfApprox(ss);
@@ -891,11 +974,12 @@ SplineSet *SSPSApprox(SplineSet *ss) {
ret->last = ret->first;
}
}
+ ret->is_clip_path = ss->is_clip_path;
return( ret );
}
SplineSet *SplineSetsPSApprox(SplineSet *ss) {
- SplineSet *head=NULL, *last=NULL, *cur;
+ SplineSet *head=NULL, *last, *cur;
while ( ss!=NULL ) {
cur = SSPSApprox(ss);
@@ -909,165 +993,49 @@ SplineSet *SplineSetsPSApprox(SplineSet *ss) {
return( head );
}
-SplineSet *SplineSetsConvertOrder(SplineSet *ss, int to_order2) {
- SplineSet *new;
-
- if ( to_order2 )
- new = SplineSetsTTFApprox(ss);
- else
- new = SplineSetsPSApprox(ss);
- SplinePointListsFree(ss);
-return( new );
-}
-
-void SCConvertToOrder2(SplineChar *sc) {
+void SCConvertLayerToOrder2(SplineChar *sc,int layer) {
SplineSet *new;
if ( sc==NULL )
return;
- new = SplineSetsTTFApprox(sc->layers[ly_fore].splines);
- SplinePointListsFree(sc->layers[ly_fore].splines);
- sc->layers[ly_fore].splines = new;
-
- new = SplineSetsTTFApprox(sc->layers[ly_back].splines);
- SplinePointListsFree(sc->layers[ly_back].splines);
- sc->layers[ly_back].splines = new;
+ new = SplineSetsTTFApprox(sc->layers[layer].splines);
+ SplinePointListsFree(sc->layers[layer].splines);
+ sc->layers[layer].splines = new;
- UndoesFree(sc->layers[ly_fore].undoes); UndoesFree(sc->layers[ly_back].undoes);
- UndoesFree(sc->layers[ly_fore].redoes); UndoesFree(sc->layers[ly_back].redoes);
- sc->layers[ly_fore].undoes = sc->layers[ly_back].undoes = NULL;
- sc->layers[ly_fore].redoes = sc->layers[ly_back].redoes = NULL;
+ UndoesFree(sc->layers[layer].undoes);
+ UndoesFree(sc->layers[layer].redoes);
+ sc->layers[layer].undoes = NULL;
+ sc->layers[layer].redoes = NULL;
+ sc->layers[layer].order2 = true;
MinimumDistancesFree(sc->md); sc->md = NULL;
}
-static void SCConvertRefs(SplineChar *sc) {
- RefChar *rf;
-
- sc->ticked = true;
- for ( rf=sc->layers[ly_fore].refs; rf!=NULL; rf=rf->next ) {
- if ( !rf->sc->ticked )
- SCConvertRefs(rf->sc);
- SCReinstanciateRefChar(sc,rf); /* Conversion is done by reinstanciating */
- /* Since the base thing will have been converted, all we do is copy its data */
- }
-}
-
-void SFConvertToOrder2(SplineFont *_sf) {
- int i, k;
- SplineSet *new;
- SplineFont *sf;
-
- if ( _sf->cidmaster!=NULL ) _sf=_sf->cidmaster;
- k = 0;
- do {
- sf = _sf->subfonts==NULL ? _sf : _sf->subfonts[k];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- SCConvertToOrder2(sf->glyphs[i]);
- sf->glyphs[i]->ticked = false;
- sf->glyphs[i]->changedsincelasthinted = false;
- }
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL && !sf->glyphs[i]->ticked )
- SCConvertRefs(sf->glyphs[i]);
-
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
- SCNumberPoints(sf->glyphs[i]);
-
- new = SplineSetsTTFApprox(sf->grid.splines);
- SplinePointListsFree(sf->grid.splines);
- sf->grid.splines = new;
-
- UndoesFree(sf->grid.undoes); UndoesFree(sf->grid.redoes);
- sf->grid.undoes = sf->grid.redoes = NULL;
- sf->order2 = true;
- ++k;
- } while ( k<_sf->subfontcnt );
- _sf->order2 = true;
-}
-
-void SCConvertToOrder3(SplineChar *sc) {
- SplineSet *new;
- RefChar *ref;
- AnchorPoint *ap;
-
- new = SplineSetsPSApprox(sc->layers[ly_fore].splines);
- SplinePointListsFree(sc->layers[ly_fore].splines);
- sc->layers[ly_fore].splines = new;
-
- new = SplineSetsPSApprox(sc->layers[ly_back].splines);
- SplinePointListsFree(sc->layers[ly_back].splines);
- sc->layers[ly_back].splines = new;
-
- UndoesFree(sc->layers[ly_fore].undoes); UndoesFree(sc->layers[ly_back].undoes);
- UndoesFree(sc->layers[ly_fore].redoes); UndoesFree(sc->layers[ly_back].redoes);
- sc->layers[ly_fore].undoes = sc->layers[ly_back].undoes = NULL;
- sc->layers[ly_fore].redoes = sc->layers[ly_back].redoes = NULL;
-
- MinimumDistancesFree(sc->md); sc->md = NULL;
-
- /* OpenType/PostScript fonts don't support point matching to position */
- /* references or anchors */
- for ( ref = sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next )
- ref->point_match = false;
- for ( ap = sc->anchor; ap!=NULL; ap=ap->next )
- ap->has_ttf_pt = false;
+void SCConvertToOrder2(SplineChar *sc) {
+ int layer;
- free(sc->ttf_instrs);
- sc->ttf_instrs = NULL; sc->ttf_instrs_len = 0;
- /* If this character has any cv's showing instructions then remove the instruction pane!!!!! */
-}
+ if ( sc==NULL )
+return;
-void SCConvertOrder(SplineChar *sc, int to_order2) {
- if ( to_order2 )
- SCConvertToOrder2(sc);
- else
- SCConvertToOrder3(sc);
+ for ( layer=ly_back; layer<sc->layer_cnt; ++layer )
+ SCConvertLayerToOrder2(sc,layer);
}
-void SFConvertToOrder3(SplineFont *_sf) {
- int i, k;
- SplineSet *new;
- SplineFont *sf;
-
- if ( _sf->cidmaster!=NULL ) _sf=_sf->cidmaster;
- k = 0;
- do {
- sf = _sf->subfonts==NULL ? _sf : _sf->subfonts[k];
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- SCConvertToOrder3(sf->glyphs[i]);
- sf->glyphs[i]->ticked = false;
- sf->glyphs[i]->changedsincelasthinted = true;
- }
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL && !sf->glyphs[i]->ticked )
- SCConvertRefs(sf->glyphs[i]);
-
- new = SplineSetsPSApprox(sf->grid.splines);
- SplinePointListsFree(sf->grid.splines);
- sf->grid.splines = new;
-
- UndoesFree(sf->grid.undoes); UndoesFree(sf->grid.redoes);
- sf->grid.undoes = sf->grid.redoes = NULL;
-
- TtfTablesFree(sf->ttf_tables);
- sf->ttf_tables = NULL;
-
- sf->order2 = false;
- ++k;
- } while ( k<_sf->subfontcnt );
- _sf->order2 = false;
-}
/* ************************************************************************** */
void SplineRefigure2(Spline *spline) {
SplinePoint *from = spline->from, *to = spline->to;
Spline1D *xsp = &spline->splines[0], *ysp = &spline->splines[1];
+ Spline old;
#ifdef DEBUG
if ( RealNear(from->me.x,to->me.x) && RealNear(from->me.y,to->me.y))
IError("Zero length spline created");
#endif
+ if ( spline->acceptableextrema )
+ old = *spline;
if ( from->nonextcp || to->noprevcp ||
( from->nextcp.x==from->me.x && from->nextcp.y == from->me.y ) ||
@@ -1085,8 +1053,15 @@ void SplineRefigure2(Spline *spline) {
RealNear(from->nextcp.y,to->prevcp.y)) {
from->nextcp.x = to->prevcp.x = (from->nextcp.x+to->prevcp.x)/2;
from->nextcp.y = to->prevcp.y = (from->nextcp.y+to->prevcp.y)/2;
- } else
+ } else {
IError("Invalid 2nd order spline in SplineRefigure2" );
+#ifndef GWW_TEST
+ /* I don't want these to go away when I'm debugging. I want to */
+ /* know how I got them */
+ from->nextcp.x = to->prevcp.x = (from->nextcp.x+to->prevcp.x)/2;
+ from->nextcp.y = to->prevcp.y = (from->nextcp.y+to->prevcp.y)/2;
+#endif
+ }
}
xsp->d = from->me.x; ysp->d = from->me.y;
@@ -1121,6 +1096,17 @@ void SplineRefigure2(Spline *spline) {
SplineIsLinear(spline);
spline->isquadratic = !spline->knownlinear;
spline->order2 = true;
+
+ if ( spline->acceptableextrema ) {
+ /* I don't check "d", because changes to that reflect simple */
+ /* translations which will not affect the shape of the spline */
+ /* (I don't check "a" because it is always 0 in a quadratic spline) */
+ if ( !RealNear(old.splines[0].b,spline->splines[0].b) ||
+ !RealNear(old.splines[0].c,spline->splines[0].c) ||
+ !RealNear(old.splines[1].b,spline->splines[1].b) ||
+ !RealNear(old.splines[1].c,spline->splines[1].c) )
+ spline->acceptableextrema = false;
+ }
}
void SplineRefigure(Spline *spline) {
@@ -1132,24 +1118,106 @@ return;
SplineRefigure3(spline);
}
+static int IsHV(Spline *spline, int isfrom) {
+ SplinePoint *sp;
+
+ if ( spline==NULL )
+return( false );
+
+ if ( !isfrom ) {
+ sp = spline->to;
+ if ( sp->noprevcp )
+return( false );
+ if ( sp->me.x == sp->prevcp.x )
+return( 2 ); /* Vertical */
+ else if ( sp->me.y == sp->prevcp.y )
+return( 1 ); /* Horizontal */
+ else
+return( 0 ); /* Neither */
+ } else {
+ sp = spline->from;
+ if ( sp->nonextcp )
+return( false );
+ if ( sp->me.x == sp->nextcp.x )
+return( 2 ); /* Vertical */
+ else if ( sp->me.y == sp->nextcp.y )
+return( 1 ); /* Horizontal */
+ else
+return( 0 ); /* Neither */
+ }
+}
+
void SplineRefigureFixup(Spline *spline) {
SplinePoint *from, *to, *prev, *next;
BasePoint foff, toff, unit, new;
double len;
+ enum pointtype fpt, tpt;
+ int done = false;
+ extern int snaptoint;
if ( !spline->order2 ) {
SplineRefigure3(spline);
return;
}
from = spline->from; to = spline->to;
+ if ( from->pointtype==pt_hvcurve && to->pointtype==pt_hvcurve ) {
+ done = true;
+ if ( !IsHV(from->prev,0) && !IsHV(to->next,1) ) {
+ if ( to->me.x == from->me.x ) {
+ from->nextcp.x = to->prevcp.x = to->me.x;
+ from->nextcp.y = to->prevcp.y = (from->me.y+from->me.y)/2;
+ } else if ( to->me.y==from->me.y ) {
+ from->nextcp.y = to->prevcp.y = to->me.y;
+ from->nextcp.x = to->prevcp.x = (from->me.x+from->me.x)/2;
+ /* Assume they are drawing clockwise */
+ } else if (( to->me.x>from->me.x && to->me.y>=from->me.y ) ||
+ (to->me.x<from->me.x && to->me.y<=from->me.y )) {
+ from->nextcp.x = to->prevcp.x = from->me.x;
+ from->nextcp.y = to->prevcp.y = to->me.y;
+ } else {
+ from->nextcp.x = to->prevcp.x = to->me.x;
+ from->nextcp.y = to->prevcp.y = from->me.y;
+ }
+ } else if ( !IsHV(to->next,1)) {
+ if ( IsHV(from->prev,0)==1 ) {
+ from->nextcp.x = to->prevcp.x = to->me.x;
+ from->nextcp.y = to->prevcp.y = from->me.y;
+ } else {
+ from->nextcp.x = to->prevcp.x = from->me.x;
+ from->nextcp.y = to->prevcp.y = to->me.y;
+ }
+ } else if ( !IsHV(from->prev,0)) {
+ if ( IsHV(to->next,1)==1 ) {
+ from->nextcp.x = to->prevcp.x = from->me.x;
+ from->nextcp.y = to->prevcp.y = to->me.y;
+ } else {
+ from->nextcp.x = to->prevcp.x = to->me.x;
+ from->nextcp.y = to->prevcp.y = from->me.y;
+ }
+ } else {
+ if ( IsHV(from->prev,0)==1 && IsHV(to->next,1)==2 ) {
+ from->nextcp.x = to->prevcp.x = to->me.x;
+ from->nextcp.y = to->prevcp.y = from->me.y;
+ } else if ( IsHV(from->prev,0)==2 && IsHV(to->next,1)==1 ) {
+ from->nextcp.x = to->prevcp.x = from->me.x;
+ from->nextcp.y = to->prevcp.y = to->me.y;
+ } else
+ done = false;
+ }
+ if ( done )
+ to->noprevcp = from->nonextcp = false;
+ }
+ if ( !done ) {
unit.x = from->nextcp.x-from->me.x;
unit.y = from->nextcp.y-from->me.y;
len = sqrt(unit.x*unit.x + unit.y*unit.y);
if ( len!=0 )
unit.x /= len; unit.y /= len;
- if ( from->nextcpdef && to->prevcpdef ) switch ( from->pointtype*3+to->pointtype ) {
+ if ( (fpt = from->pointtype)==pt_hvcurve ) fpt = pt_curve;
+ if ( (tpt = to->pointtype)==pt_hvcurve ) tpt = pt_curve;
+ if ( from->nextcpdef && to->prevcpdef ) switch ( fpt*3+tpt ) {
case pt_corner*3+pt_corner:
case pt_corner*3+pt_tangent:
case pt_tangent*3+pt_corner:
@@ -1163,7 +1231,7 @@ return;
case pt_corner*3+pt_curve:
case pt_tangent*3+pt_curve:
case pt_curve*3+pt_tangent:
- if ( from->prev!=NULL && from->pointtype==pt_tangent ) {
+ if ( from->prev!=NULL && (from->pointtype==pt_tangent || from->pointtype==pt_hvcurve)) {
prev = from->prev->from;
foff.x = prev->me.x;
foff.y = prev->me.y;
@@ -1176,7 +1244,7 @@ return;
foff.y = from->me.y + (to->me.x-from->me.x)+(to->me.y-from->me.y);
prev = NULL;
}
- if ( to->next!=NULL && to->pointtype==pt_tangent ) {
+ if ( to->next!=NULL && (to->pointtype==pt_tangent || to->pointtype==pt_hvcurve)) {
next = to->next->to;
toff.x = next->me.x;
toff.y = next->me.y;
@@ -1189,17 +1257,51 @@ return;
toff.y = to->me.y - (to->me.x-from->me.x)+(to->me.y-from->me.y);
next = NULL;
}
+ if (( from->pointtype==pt_hvcurve && foff.x!=from->me.x && foff.y!=from->me.y ) ||
+ ( to->pointtype==pt_hvcurve && toff.x!=to->me.x && toff.y!=to->me.y )) {
+ if ( from->me.x == to->me.x ) {
+ if ( from->pointtype==pt_hvcurve )
+ foff.x = from->me.x;
+ if ( to->pointtype==pt_hvcurve )
+ toff.x = to->me.x;
+ } else if ( from->me.y == to->me.y ) {
+ if ( from->pointtype==pt_hvcurve )
+ foff.y = from->me.y;
+ if ( to->pointtype==pt_hvcurve )
+ toff.y = to->me.y;
+ } else {
+ if ( from->pointtype==pt_hvcurve && foff.x!=from->me.x && foff.y!=from->me.y ) {
+ if ( fabs(foff.x-from->me.x) > fabs(foff.y-from->me.y) )
+ foff.y = from->me.y;
+ else
+ foff.x = from->me.x;
+ }
+ if ( to->pointtype==pt_hvcurve && toff.x!=to->me.x && toff.y!=to->me.y ) {
+ if ( from->pointtype==pt_hvcurve ) {
+ if ( from->me.x==foff.x )
+ toff.y = to->me.y;
+ else
+ toff.x = to->me.x;
+ } else if ( fabs(toff.x-to->me.x) > fabs(toff.y-to->me.y) )
+ toff.y = to->me.y;
+ else
+ toff.x = to->me.x;
+ }
+ }
+ }
if ( IntersectLinesClip(&from->nextcp,&foff,&from->me,&toff,&to->me)) {
from->nonextcp = to->noprevcp = false;
to->prevcp = from->nextcp;
- if ( from->pointtype==pt_curve && !from->noprevcp && from->prev!=NULL ) {
+ if ( (from->pointtype==pt_curve || from->pointtype==pt_hvcurve ) &&
+ !from->noprevcp && from->prev!=NULL ) {
prev = from->prev->from;
if ( IntersectLinesClip(&from->prevcp,&from->nextcp,&from->me,&prev->nextcp,&prev->me)) {
prev->nextcp = from->prevcp;
SplineRefigure2(from->prev);
}
}
- if ( to->pointtype==pt_curve && !to->nonextcp && to->next!=NULL ) {
+ if ( (to->pointtype==pt_curve || to->pointtype==pt_hvcurve) &&
+ !to->nonextcp && to->next!=NULL ) {
next = to->next->to;
if ( IntersectLinesClip(&to->nextcp,&to->prevcp,&to->me,&next->prevcp,&next->me)) {
next->prevcp = to->nextcp;
@@ -1210,7 +1312,8 @@ return;
break;
} else {
/* Can't set things arbetrarily here, but make sure they are consistant */
- if ( from->pointtype==pt_curve && !from->noprevcp && !from->nonextcp ) {
+ if ( (from->pointtype==pt_curve || from->pointtype==pt_hvcurve ) &&
+ !from->noprevcp && !from->nonextcp ) {
unit.x = from->nextcp.x-from->me.x;
unit.y = from->nextcp.y-from->me.y;
len = sqrt(unit.x*unit.x + unit.y*unit.y);
@@ -1245,7 +1348,8 @@ return;
to->prevcp = from->nextcp;
}
}
- if ( to->pointtype==pt_curve && !to->noprevcp && !to->nonextcp ) {
+ if ( (to->pointtype==pt_curve || to->pointtype==pt_hvcurve ) &&
+ !to->noprevcp && !to->nonextcp ) {
unit.x = to->prevcp.x-to->nextcp.x;
unit.y = to->prevcp.y-to->nextcp.y;
len = sqrt(unit.x*unit.x + unit.y*unit.y);
@@ -1305,7 +1409,23 @@ return;
to->prevcp = to->me;
}
}
+ }
+ if ( snaptoint && !from->nonextcp ) {
+ from->nextcp.x = to->prevcp.x = rint(from->nextcp.x);
+ from->nextcp.y = to->prevcp.y = rint(from->nextcp.y);
+ }
SplineRefigure2(spline);
+
+ /* Now in order2 splines it is possible to request combinations that are */
+ /* mathematically impossible -- two adjacent hv points often don't work */
+ if ( to->pointtype==pt_hvcurve &&
+ !(to->prevcp.x == to->me.x && to->prevcp.y != to->me.y ) &&
+ !(to->prevcp.y == to->me.y && to->prevcp.x != to->me.x ) )
+ to->pointtype = pt_curve;
+ if ( from->pointtype==pt_hvcurve &&
+ !(from->nextcp.x == from->me.x && from->nextcp.y != from->me.y ) &&
+ !(from->nextcp.y == from->me.y && from->nextcp.x != from->me.x ) )
+ from->pointtype = pt_curve;
}
Spline *SplineMake2(SplinePoint *from, SplinePoint *to) {
@@ -1385,100 +1505,4 @@ return( false );
return( true );
}
-void SplinePointPrevCPChanged2(SplinePoint *sp) {
- SplinePoint *p, *pp;
- BasePoint p_pcp;
-
- if ( sp->prev!=NULL ) {
- p = sp->prev->from;
- if ( SPInterpolate(p) && !sp->noprevcp ) {
- p->nextcp = sp->prevcp;
- p->me.x = ( p->prevcp.x+p->nextcp.x)/2;
- p->me.y = ( p->prevcp.y+p->nextcp.y)/2;
- SplineRefigure2(sp->prev);
- if (p->prev != NULL) SplineRefigure2(p->prev);
- } else {
- p->nextcp = sp->prevcp;
- p->nonextcp = sp->noprevcp;
- if ( sp->noprevcp ) {
- p->nonextcp = true;
- p->nextcp = p->me;
- SplineRefigure2(sp->prev);
- } else if ( p->pointtype==pt_curve && !p->noprevcp ) {
- SplineRefigure2(sp->prev);
- if ( p->prev==NULL ) {
- double len1, len2;
- len1 = sqrt((p->nextcp.x-p->me.x)*(p->nextcp.x-p->me.x) +
- (p->nextcp.y-p->me.y)*(p->nextcp.y-p->me.y));
- len2 = sqrt((p->prevcp.x-p->me.x)*(p->prevcp.x-p->me.x) +
- (p->prevcp.y-p->me.y)*(p->prevcp.y-p->me.y));
- len2 /= len1;
- p->prevcp.x = len2 * (p->me.x-p->prevcp.x) + p->me.x;
- p->prevcp.y = len2 * (p->me.y-p->prevcp.y) + p->me.y;
- } else {
- pp = p->prev->from;
- /* Find the intersection (if any) of the lines between */
- /* pp->nextcp&pp->me with p->prevcp&p->me */
- if ( IntersectLines(&p_pcp,&pp->nextcp,&pp->me,&p->nextcp,&p->me)) {
- double len = (pp->me.x-p->me.x)*(pp->me.x-p->me.x) + (pp->me.y-p->me.y)*(pp->me.y-p->me.y);
- double d1 = (p_pcp.x-p->me.x)*(pp->me.x-p->me.x) + (p_pcp.y-p->me.y)*(pp->me.y-p->me.y);
- double d2 = (p_pcp.x-pp->me.x)*(p->me.x-pp->me.x) + (p_pcp.y-pp->me.y)*(p->me.y-pp->me.y);
- if ( d1>=0 && d1<=len && d2>=0 && d2<=len ) {
- p->prevcp = pp->nextcp = p_pcp;
- SplineRefigure2(p->prev);
- }
- }
- }
- }
- }
- }
-}
-void SplinePointNextCPChanged2(SplinePoint *sp) {
- SplinePoint *n, *nn;
- BasePoint n_ncp;
-
- if ( sp->next!=NULL ) {
- n = sp->next->to;
- if ( SPInterpolate(n) && !sp->nonextcp ) {
- n->prevcp = sp->nextcp;
- n->me.x = ( n->prevcp.x+n->nextcp.x)/2;
- n->me.y = ( n->prevcp.y+n->nextcp.y)/2;
- SplineRefigure2(sp->next);
- if (n->next != NULL) SplineRefigure2(n->next);
- } else {
- n->prevcp = sp->nextcp;
- n->noprevcp = sp->nonextcp;
- if ( sp->nonextcp ) {
- n->noprevcp = true;
- n->prevcp = n->me;
- SplineRefigure2(sp->next);
- } else if ( n->pointtype==pt_curve && !n->nonextcp ) {
- SplineRefigure2(sp->next);
- if ( n->next==NULL ) {
- double len1, len2;
- len1 = sqrt((n->prevcp.x-n->me.x)*(n->prevcp.x-n->me.x) +
- (n->prevcp.y-n->me.y)*(n->prevcp.y-n->me.y));
- len2 = sqrt((n->nextcp.x-n->me.x)*(n->nextcp.x-n->me.x) +
- (n->nextcp.y-n->me.y)*(n->nextcp.y-n->me.y));
- len2 /= len1;
- n->nextcp.x = len2 * (n->me.x-n->nextcp.x) + n->me.x;
- n->nextcp.y = len2 * (n->me.y-n->nextcp.y) + n->me.y;
- } else {
- nn = n->next->to;
- /* Find the intersection (if any) of the lines between */
- /* nn->prevcp&nn->me with n->nextcp&.->me */
- if ( IntersectLines(&n_ncp,&nn->prevcp,&nn->me,&n->prevcp,&n->me)) {
- double len = (nn->me.x-n->me.x)*(nn->me.x-n->me.x) + (nn->me.y-n->me.y)*(nn->me.y-n->me.y);
- double d1 = (n_ncp.x-n->me.x)*(nn->me.x-n->me.x) + (n_ncp.y-n->me.y)*(nn->me.y-n->me.y);
- double d2 = (n_ncp.x-nn->me.x)*(n->me.x-nn->me.x) + (n_ncp.y-nn->me.y)*(n->me.y-nn->me.y);
- if ( d1>=0 && d1<=len && d2>=0 && d2<=len ) {
- n->nextcp = nn->prevcp = n_ncp;
- SplineRefigure2(n->next);
- }
- }
- }
- }
- }
- }
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineoverlap.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c
index 62a6e4267f1..1b459508f2a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineoverlap.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineoverlap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -269,7 +269,7 @@ return( start );
return( start );
}
-Monotonic *SSsToMContours(SplineSet *spl, enum overlap_type ot) {
+static Monotonic *SSsToMContours(SplineSet *spl, enum overlap_type ot) {
Monotonic *head=NULL, *last = NULL;
while ( spl!=NULL ) {
@@ -579,27 +579,9 @@ static Intersection *AddIntersection(Intersection *ilist,Monotonic *m1,
if ( t1<m1->tstart || t1>m1->tend || t2<m2->tstart || t2>m2->tend )
return( ilist );
-#if 0
- if (( m1->start==m2->start && m1->start!=NULL && RealNear(t1,m1->tstart) && RealNear(t2,m2->tstart)) ||
- ( m1->start==m2->end && m1->start!=NULL && RealNear(t1,m1->tstart) && RealNear(t2,m2->tend)) ||
- ( m1->end==m2->start && m1->end!=NULL && RealNear(t1,m1->tend) && RealNear(t2,m2->tstart)) ||
- ( m1->end==m2->end && m1->end!=NULL && RealNear(t1,m1->tend) && RealNear(t2,m2->tend)) )
-return( ilist );
- else
- if ( RealWithin(t1,1.0,.01) && RealWithin(t2,0.0,.01) && BpSame(&m1->s->to->me,&m2->s->from->me)) {
- t1 = 1.0;
- t2 = 0.0;
- } else if ( RealWithin(t2,1.0,.01) && RealWithin(t1,0.0,.01) && BpSame(&m2->s->to->me,&m1->s->from->me)) {
- t1 = 0.0;
- t2 = 1.0;
- } else {
-#endif
t1 = RoundToEndpoints(m1,t1,inter);
t2 = RoundToEndpoints(m2,t2,inter);
t1 = RoundToEndpoints(m1,t1,inter); /* Do it twice. rounding t2 can mean we now need to round t1 */
-#if 0
- }
-#endif
if (( m1->s->to == m2->s->from && RealWithin(t1,1.0,.01) && RealWithin(t2,0,.01)) ||
( m1->s->from == m2->s->to && RealWithin(t1,0,.01) && RealWithin(t2,1.0,.01)))
@@ -726,7 +708,7 @@ return( ilist ); /* Not interesting. Only intersection is at an endpoint */
}
} else if ( b.maxy-b.miny > b.maxx-b.minx ) {
extended diff, y, x1,x2, x1o,x2o;
- extended t1=0,t2=0, t1o=0,t2o=0 ;
+ extended t1,t2, t1o,t2o ;
diff = (b.maxy-b.miny)/32;
y = b.miny;
@@ -745,12 +727,6 @@ return( ilist ); /* Not interesting. Only intersection is at an endpoint */
break;
y += diff;
}
-#if 0
- if ( x1o==x2o ) {
- pt.x = x1o; pt.y = y;
- ilist = AddIntersection(ilist,m1,m2,t1o,t2o,&pt);
- }
-#endif
for ( y+=diff; ; y += diff ) {
/* I used to say y<=b.maxy in the above for statement. */
/* that seemed to get rounding errors on the mac, so we do it */
@@ -766,14 +742,6 @@ return( ilist ); /* Not interesting. Only intersection is at an endpoint */
continue;
x1 = ((m1->s->splines[0].a*t1+m1->s->splines[0].b)*t1+m1->s->splines[0].c)*t1+m1->s->splines[0].d;
x2 = ((m2->s->splines[0].a*t2+m2->s->splines[0].b)*t2+m2->s->splines[0].c)*t2+m2->s->splines[0].d;
-#if 0
- if ( x1==x2 && x1o!=x2o ) {
- pt.x = x1; pt.y = y;
- ilist = AddIntersection(ilist,m1,m2,t1,t2,&pt);
- if ( m1->tend==t1 && m1->s==m1->next->s ) m1 = m1->next;
- if ( m2->tend==t2 && m2->s==m2->next->s ) m2 = m2->next;
- } else
-#endif
if ( x1o!=x2o && (x1o>x2o) != ( x1>x2 ) ) {
/* A cross over has occured. (assume we have a small enough */
/* region that three cross-overs can't have occurred) */
@@ -809,7 +777,7 @@ return( ilist ); /* Not interesting. Only intersection is at an endpoint */
}
} else {
extended diff, x, y1,y2, y1o,y2o;
- extended t1=0,t2=0, t1o=0,t2o=0 ;
+ extended t1,t2, t1o,t2o ;
diff = (b.maxx-b.minx)/32;
x = b.minx;
@@ -828,12 +796,6 @@ return( ilist ); /* Not interesting. Only intersection is at an endpoint */
break;
x += diff;
}
-#if 0
- if ( y1o==y2o ) {
- pt.y = y1o; pt.x = x;
- ilist = AddIntersection(ilist,m1,m2,t1o,t2o,&pt);
- }
-#endif
y1 = y2 = 0;
for ( x+=diff; ; x += diff ) {
if ( x>b.maxx ) {
@@ -847,14 +809,6 @@ return( ilist ); /* Not interesting. Only intersection is at an endpoint */
continue;
y1 = ((m1->s->splines[1].a*t1+m1->s->splines[1].b)*t1+m1->s->splines[1].c)*t1+m1->s->splines[1].d;
y2 = ((m2->s->splines[1].a*t2+m2->s->splines[1].b)*t2+m2->s->splines[1].c)*t2+m2->s->splines[1].d;
-#if 0
- if ( y1==y2 && y1o!=y2o ) {
- pt.y = y1; pt.x = x;
- ilist = AddIntersection(ilist,m1,m2,t1,t2,&pt);
- if ( m1->tend==t1 && m1->s==m1->next->s ) m1 = m1->next;
- if ( m2->tend==t2 && m2->s==m2->next->s ) m2 = m2->next;
- } else
-#endif
if ( (y1o>y2o) != ( y1>y2 ) ) {
/* A cross over has occured. (assume we have a small enough */
/* region that three cross-overs can't have occurred) */
@@ -892,17 +846,6 @@ return( ilist ); /* Not interesting. Only intersection is at an endpoint */
return( ilist );
}
-#if 0
-static void SubsetSpline1(Spline1D *subset,Spline1D *orig,
- extended tstart,extended tend,extended d) {
- extended f = tend-tstart;
-
- subset->a = orig->a*f*f*f;
- subset->b = (orig->b + 3*orig->a*tstart) *f*f;
- subset->c = (orig->c + (2*orig->b + 3*orig->a*tstart)*tstart) * f;
- subset->d = d;
-}
-#endif
static extended SplineContainsPoint(Monotonic *m,BasePoint *pt) {
int which, nw;
@@ -981,28 +924,6 @@ return( false );
/* Ok, if we've gotten this far we know that two of the end points are */
/* on both splines. */
-#if 0
- /* Interesting. The following algorithem does not produce a unique */
- /* representation of the subset spline. Must test each point */
- /* Then subset each spline so that [0,1] runs along the range we just */
- /* found for it. Compare these two subsets, if they are almost equal */
- /* then assume they are coincident, and return the two endpoints as */
- /* the intersection points. */
- SubsetSpline1(&subs1,&m1->s->splines[0],t1s[0],t1s[1],pts[0].x);
- SubsetSpline1(&subs2,&m2->s->splines[0],t2s[0],t2s[1],pts[0].x);
- if ( !RealWithin(subs1.a,subs2.a,.1) || !RealWithin(subs1.b,subs2.b,.1) ||
- !RealWithin(subs1.c,subs2.c,.2) /* Don't need to check d, it's always pts[0].x */)
-return( false );
-
- SubsetSpline1(&subs1,&m1->s->splines[1],t1s[0],t1s[1],pts[0].y);
- SubsetSpline1(&subs2,&m2->s->splines[1],t2s[0],t2s[1],pts[0].y);
- if ( !RealWithin(subs1.a,subs2.a,.1) || !RealWithin(subs1.b,subs2.b,.1) ||
- !RealWithin(subs1.c,subs2.c,.2) /* Don't need to check d, it's always pts[0].x */)
-return( false );
-
- t1s[2] = t2s[2] = -1;
-return( true );
-#else
t1s[2] = t2s[2] = -1;
if ( !m1->s->knownlinear || !m1->s->knownlinear ) {
if ( t1s[1]<t1s[0] ) {
@@ -1031,7 +952,6 @@ return( false );
}
return( true );
-#endif
}
static void FigureProperMonotonicsAtIntersections(Intersection *ilist) {
@@ -1250,7 +1170,7 @@ return( -1 );
return( 0 );
}
-int MonotonicFindAt(Monotonic *ms,int which, extended test, Monotonic **space ) {
+static int MonotonicFindAt(Monotonic *ms,int which, extended test, Monotonic **space ) {
/* Find all monotonic sections which intersect the line (x,y)[which] == test */
/* find the value of the other coord on that line */
/* Order them (by the other coord) */
@@ -1339,41 +1259,6 @@ static void FigureNeeds(Monotonic *ms,int which, extended test, Monotonic **spac
MonotonicFindAt(ms,which,test,space);
-#if 0 /* Really slow, and it fixes some problems at the expense of causing others */
- for ( i=0; space[i+1]!=NULL; ++i ) {
- /* If two splines are very close to each other, we may miss an */
- /* intersection. If that has happened, reorder the splines */
- if ( space[i+1]->other - space[i]->other < .1 ) {
- extended oi, oi1, ti, ti1, test2;
- if ( which==1 ) {
- if ( space[i+1]->b.miny > space[i]->b.miny )
- test2 = space[i]->b.miny;
- else
- test2 = space[i+1]->b.miny;
- } else {
- if ( space[i+1]->b.minx > space[i]->b.minx )
- test2 = space[i]->b.minx;
- else
- test2 = space[i+1]->b.minx;
- }
- ti = BoundIterateSplineSolve(&space[i]->s->splines[which],
- space[i]->tstart,space[i]->tend,test2,error);
- ti1= BoundIterateSplineSolve(&space[i+1]->s->splines[which],
- space[i+1]->tstart,space[i+1]->tend,test2,error);
- oi = ((space[i]->s->splines[nw].a*ti+space[i]->s->splines[nw].b)*ti+
- space[i]->s->splines[nw].c)*ti+space[i]->s->splines[nw].d;
- oi1= ((space[i+1]->s->splines[nw].a*ti1+space[i+1]->s->splines[nw].b)*ti1+
- space[i+1]->s->splines[nw].c)*ti1+space[i+1]->s->splines[nw].d;
- if ( oi1<oi ) {
- m = space[i];
- space[i] = space[i+1];
- space[i+1] = m;
- fprintf( stderr, "Flipped\n" );
- }
- }
- }
-#endif
-
winding = 0; ew = 0; was_close = false;
for ( i=0; space[i]!=NULL; ++i ) {
int needed, unneeded, inverted=false;
@@ -1608,16 +1493,6 @@ static void TestForBadDirections(Intersection *ilist) {
++cnt;
if ( ml->m->isneeded ) ++ncnt;
}
-#if 0
- if ( cnt>=4 && ncnt==cnt ) {
- ff_post_notice(_("Warning"),_("Glyph %.40s contains an overlapped region where two contours with opposite orientations intersect. This will not be removed. In many cases doing Element->Correct Direction before Remove Overlap will improve matters."),
- glyphname );
- fprintf( stderr, "%s: Fully needed intersection at (%g,%g)\n",
- glyphname,
- ilist->inter.x, ilist->inter.y );
- break;
- }
-#endif
ilist = ilist->next;
}
}
@@ -1703,24 +1578,6 @@ static MList *FindMLOfM(Intersection *curil,Monotonic *finalm) {
if ( ml->m==finalm )
return( ml );
}
-#if 0
- if ( ml->isend ) {
- for ( m=ml->m; m!=NULL ; m=m->prev ) {
- if ( m==finalm )
-return( ml );
- if ( m->start != NULL )
- break;
- }
- } else {
- for ( m=ml->m; m!=NULL; m=m->next ) {
- if ( m==finalm )
-return( ml );
- if ( m->end!=NULL )
- break;
- }
- }
- }
-#endif
return( NULL );
}
@@ -2012,7 +1869,7 @@ static SplineSet *MergeOpenAndFreeClosed(SplineSet *new,SplineSet *old,
return(new);
}
-void FreeMonotonics(Monotonic *m) {
+static void FreeMonotonics(Monotonic *m) {
Monotonic *next;
while ( m!=NULL ) {
@@ -2341,7 +2198,7 @@ return( -1 );
return( t1 );
}
-void SSRemoveBacktracks(SplineSet *ss) {
+static void SSRemoveBacktracks(SplineSet *ss) {
SplinePoint *sp;
if ( ss==NULL )
@@ -2369,6 +2226,12 @@ return;
SplineFree(sp->prev);
SplinePointFree(isp);
SplinePointFree(sp);
+ if ( psp->next->order2 ) {
+ psp->nextcp.x = nsp->prevcp.x = (psp->nextcp.x+nsp->prevcp.x)/2;
+ psp->nextcp.y = nsp->prevcp.y = (psp->nextcp.y+nsp->prevcp.y)/2;
+ if ( psp->nonextcp || nsp->noprevcp )
+ psp->nonextcp = nsp->noprevcp = true;
+ }
SplineRefigure(psp->next);
if ( ss->first==sp )
ss->first = psp;
@@ -2386,6 +2249,12 @@ return;
SplineFree(sp->next);
SplinePointFree(isp);
SplinePointFree(sp);
+ if ( psp->next->order2 ) {
+ psp->nextcp.x = nsp->prevcp.x = (psp->nextcp.x+nsp->prevcp.x)/2;
+ psp->nextcp.y = nsp->prevcp.y = (psp->nextcp.y+nsp->prevcp.y)/2;
+ if ( psp->nonextcp || nsp->noprevcp )
+ psp->nonextcp = nsp->noprevcp = true;
+ }
SplineRefigure(nsp->prev);
if ( ss->first==sp )
ss->first = psp;
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinerefigure.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinerefigure.c
index 59472ad6409..b651a241960 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinerefigure.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinerefigure.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -38,11 +38,14 @@
void SplineRefigure3(Spline *spline) {
SplinePoint *from = spline->from, *to = spline->to;
Spline1D *xsp = &spline->splines[0], *ysp = &spline->splines[1];
+ Spline old;
#ifdef DEBUG
if ( RealNear(from->me.x,to->me.x) && RealNear(from->me.y,to->me.y))
IError("Zero length spline created");
#endif
+ if ( spline->acceptableextrema )
+ old = *spline;
xsp->d = from->me.x; ysp->d = from->me.y;
if ( from->nonextcp ) from->nextcp = from->me;
else if ( from->nextcp.x==from->me.x && from->nextcp.y == from->me.y ) from->nonextcp = true;
@@ -72,7 +75,7 @@ void SplineRefigure3(Spline *spline) {
if ( ysp->a==0 && xsp->a==0 && ysp->b==0 && xsp->b==0 )
spline->islinear = true; /* This seems extremely unlikely... */
}
- if ( isnan(ysp->a) || isnan(xsp->a) )
+ if ( !finite(ysp->a) || !finite(xsp->a) || !finite(ysp->c) || !finite(xsp->c) || !finite(ysp->d) || !finite(xsp->d))
IError("NaN value in spline creation");
LinearApproxFree(spline->approx);
spline->approx = NULL;
@@ -84,18 +87,15 @@ void SplineRefigure3(Spline *spline) {
spline->isquadratic = true; /* Only likely if we read in a TTF */
spline->order2 = false;
-#if 0
- _SplineRefigure3(&s);
-# define RealNear(a,b) ((a)==(b))
-
- if ( !RealNear(spline->splines[0].a,s.splines[0].a) ||
- !RealNear(spline->splines[0].b,s.splines[0].b) ||
- !RealNear(spline->splines[0].c,s.splines[0].c) ||
- !RealNear(spline->splines[0].d,s.splines[0].d) ||
- !RealNear(spline->splines[1].a,s.splines[1].a) ||
- !RealNear(spline->splines[1].b,s.splines[1].b) ||
- !RealNear(spline->splines[1].c,s.splines[1].c) ||
- !RealNear(spline->splines[1].d,s.splines[1].d) )
- fprintf( stderr, "error\n" );
-#endif
+ if ( spline->acceptableextrema ) {
+ /* I don't check "d", because changes to that reflect simple */
+ /* translations which will not affect the shape of the spline */
+ if ( !RealNear(old.splines[0].a,spline->splines[0].a) ||
+ !RealNear(old.splines[0].b,spline->splines[0].b) ||
+ !RealNear(old.splines[0].c,spline->splines[0].c) ||
+ !RealNear(old.splines[1].a,spline->splines[1].a) ||
+ !RealNear(old.splines[1].b,spline->splines[1].b) ||
+ !RealNear(old.splines[1].c,spline->splines[1].c) )
+ spline->acceptableextrema = false;
+ }
}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinesave.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c
index 46cf2cd2604..91e14934ad2 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinesave.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesave.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -34,6 +34,8 @@
#include <utype.h>
#include <gwidget.h>
+int autohint_before_generate = 1;
+
/* Let's talk about references. */
/* If we are doing Type1 output, then the obvious way of doing them is seac */
/* but that's so limitting. It only works for exactly two characters both */
@@ -123,6 +125,7 @@ typedef struct glyphinfo {
uint8 wasseac;
} *gb, *active;
SplineFont *sf;
+ int layer;
int glyphcnt;
int subfontcnt;
int bcnt, bmax;
@@ -155,7 +158,7 @@ struct hintdb {
unsigned int skiphm: 1; /* Set when coming back to the start point of a contour. hintmask should be set the first time, not the second */
unsigned int donefirsthm: 1;
int cursub; /* Current subr number */
- BasePoint current;
+ DBasePoint current;
GlyphInfo *gi;
};
@@ -163,11 +166,15 @@ static void GIContentsFree(GlyphInfo *gi,SplineChar *dummynotdef) {
int i,j;
if ( gi->glyphcnt>0 && gi->gb[0].sc == dummynotdef ) {
- SplinePointListsFree(dummynotdef->layers[ly_fore].splines);
+ if ( dummynotdef->layers!=NULL ) {
+ SplinePointListsFree(dummynotdef->layers[gi->layer].splines);
+ dummynotdef->layers[gi->layer].splines = NULL;
+ }
StemInfosFree(dummynotdef->hstem);
StemInfosFree(dummynotdef->vstem);
- dummynotdef->layers[ly_fore].splines = NULL;
dummynotdef->vstem = dummynotdef->hstem = NULL;
+ free(dummynotdef->layers);
+ dummynotdef->layers = NULL;
}
for ( i=0; i<gi->pcnt; ++i ) {
@@ -337,21 +344,18 @@ void RefCharsFreeRef(RefChar *ref) {
while ( ref!=NULL ) {
rnext = ref->next;
/* don't free the splines */
-#ifdef FONTFORGE_CONFIG_TYPE3
- free(ref->layers);
-#endif
chunkfree(ref,sizeof(RefChar));
ref = rnext;
}
}
-static void MarkTranslationRefs(SplineFont *sf) {
+static void MarkTranslationRefs(SplineFont *sf,int layer) {
int i;
SplineChar *sc;
RefChar *r;
for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc = sf->glyphs[i])!=NULL ) {
- for ( r = sc->layers[ly_fore].refs; r!=NULL; r=r->next )
+ for ( r = sc->layers[layer].refs; r!=NULL; r=r->next )
r->justtranslated = (r->transform[0]==1 && r->transform[3]==1 &&
r->transform[1]==0 && r->transform[2]==0);
}
@@ -886,14 +890,9 @@ return( false );
return( true );
}
-static int AnyRefs(SplineChar *sc) {
- int i;
-
- for ( i=ly_fore; i<sc->layer_cnt; ++i )
- if ( sc->layers[i].refs!=NULL )
-return( true );
+static int AnyRefs(SplineChar *sc,int layer) {
-return( false );
+return( sc->layers[layer].refs!=NULL );
}
static void refmoveto(GrowBuf *gb,BasePoint *current,BasePoint rpos[MmMax],
@@ -1155,92 +1154,37 @@ static void _CvtPsSplineSet(GrowBuf *gb, SplinePointList *spl[MmMax], int instan
SplinePointListsFree(freeme);
}
-static RefChar *IsRefable(RefChar *ref, int isps, real transform[6], RefChar *sofar) {
- real trans[6];
- RefChar *sub;
-#ifdef FONTFORGE_CONFIG_TYPE3
- struct reflayer *rl;
-#endif
- trans[0] = ref->transform[0]*transform[0] +
- ref->transform[1]*transform[2];
- trans[1] = ref->transform[0]*transform[1] +
- ref->transform[1]*transform[3];
- trans[2] = ref->transform[2]*transform[0] +
- ref->transform[3]*transform[2];
- trans[3] = ref->transform[2]*transform[1] +
- ref->transform[3]*transform[3];
- trans[4] = ref->transform[4]*transform[0] +
- ref->transform[5]*transform[2] +
- transform[4];
- trans[5] = ref->transform[4]*transform[1] +
- ref->transform[5]*transform[3] +
- transform[5];
-
- if (( isps==1 && ref->adobe_enc!=-1 ) ||
- (/*isps!=1 &&*/ (ref->sc->layers[ly_fore].splines!=NULL || ref->sc->layers[ly_fore].refs==NULL))) {
- /* If we're in postscript mode and the character we are refering to */
- /* has an adobe encoding then we are done. */
- /* In TrueType mode, if the character has no refs itself then we are */
- /* done, but if it has splines as well as refs we are also done */
- /* because it will have to be dumped out as splines */
- /* Type2 PS (opentype) is the same as truetype here */
- /* Now that I allow refs to be subrs in type1, it also uses the ttf test */
- sub = RefCharCreate();
-#ifdef FONTFORGE_CONFIG_TYPE3
- rl = sub->layers;
- *sub = *ref;
- sub->layers = rl;
- *rl = ref->layers[0];
-#else
- *sub = *ref;
-#endif
- sub->next = sofar;
- /*sub->layers[0].splines = NULL;*/
- memcpy(sub->transform,trans,sizeof(trans));
-return( sub );
- } else if ( /* isps &&*/ ( ref->sc->layers[ly_fore].refs==NULL || ref->sc->layers[ly_fore].splines!=NULL) ) {
- RefCharsFreeRef(sofar);
-return( NULL );
- }
- for ( sub=ref->sc->layers[ly_fore].refs; sub!=NULL; sub=sub->next ) {
- sofar = IsRefable(sub,isps,trans, sofar);
- if ( sofar==NULL )
-return( NULL );
- }
-return( sofar );
-}
-
-static int IsPSSeacable(SplineChar *sc) {
+static int IsPSSeacable(SplineChar *sc,int layer) {
RefChar *ref;
- if ( sc->layers[ly_fore].refs==NULL || sc->layers[ly_fore].splines!=NULL )
+ if ( sc->layers[layer].refs==NULL || sc->layers[layer].splines!=NULL )
return( false );
- for ( ref=sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next ) {
+ for ( ref=sc->layers[layer].refs; ref!=NULL; ref=ref->next ) {
if ( !ref->justtranslated )
return( false );
}
return( true );
}
-static RefChar *RefFindAdobe(RefChar *r, RefChar *t) {
+static RefChar *RefFindAdobe(RefChar *r, RefChar *t,int layer) {
*t = *r;
- while ( t->adobe_enc==-1 && t->sc->layers[ly_fore].refs!=NULL &&
- t->sc->layers[ly_fore].refs->next==NULL &&
- t->sc->layers[ly_fore].splines==NULL &&
- t->sc->layers[ly_fore].refs->justtranslated ) {
- t->transform[4] += t->sc->layers[ly_fore].refs->transform[4];
- t->transform[5] += t->sc->layers[ly_fore].refs->transform[5];
- t->adobe_enc = t->sc->layers[ly_fore].refs->adobe_enc;
- t->orig_pos = t->sc->layers[ly_fore].refs->orig_pos;
- t->sc = t->sc->layers[ly_fore].refs->sc;
+ while ( t->adobe_enc==-1 && t->sc->layers[layer].refs!=NULL &&
+ t->sc->layers[layer].refs->next==NULL &&
+ t->sc->layers[layer].splines==NULL &&
+ t->sc->layers[layer].refs->justtranslated ) {
+ t->transform[4] += t->sc->layers[layer].refs->transform[4];
+ t->transform[5] += t->sc->layers[layer].refs->transform[5];
+ t->adobe_enc = t->sc->layers[layer].refs->adobe_enc;
+ t->orig_pos = t->sc->layers[layer].refs->orig_pos;
+ t->sc = t->sc->layers[layer].refs->sc;
}
return( t );
}
static int IsSeacable(GrowBuf *gb, SplineChar *scs[MmMax],
- int instance_count, int round) {
+ int instance_count, int round,int layer) {
/* can be at most two chars in a seac (actually must be exactly 2, but */
/* I'll put in a space if there's only one (and if splace is blank) */
RefChar *r1, *r2, *rt, *refs;
@@ -1250,18 +1194,18 @@ static int IsSeacable(GrowBuf *gb, SplineChar *scs[MmMax],
real data[MmMax][6];
for ( j=0 ; j<instance_count; ++j )
- if ( !IsPSSeacable(scs[j]))
+ if ( !IsPSSeacable(scs[j],layer))
return( false );
- refs = scs[0]->layers[ly_fore].refs;
+ refs = scs[0]->layers[layer].refs;
if ( refs==NULL )
return( false );
r1 = refs;
if ((r2 = r1->next)==NULL ) {
- RefChar *refs = r1->sc->layers[ly_fore].refs;
+ RefChar *refs = r1->sc->layers[layer].refs;
if ( refs!=NULL && refs->next!=NULL && refs->next->next==NULL &&
- r1->sc->layers[ly_fore].splines==NULL &&
+ r1->sc->layers[layer].splines==NULL &&
refs->adobe_enc!=-1 && refs->next->adobe_enc!=-1 ) {
r2 = refs->next;
r1 = refs;
@@ -1280,7 +1224,7 @@ return( false );
r2 = NULL; /* No space???? */
else {
space.sc = scs[0]->parent->glyphs[i];
- if ( space.sc->layers[ly_fore].splines!=NULL || space.sc->layers[ly_fore].refs!=NULL )
+ if ( space.sc->layers[layer].splines!=NULL || space.sc->layers[layer].refs!=NULL )
r2 = NULL;
}
} else if ( r2->next!=NULL )
@@ -1291,9 +1235,9 @@ return( false );
/* does) */
if ( r2!=NULL ) {
if ( r1->adobe_enc==-1 )
- r1 = RefFindAdobe(r1,&t1);
+ r1 = RefFindAdobe(r1,&t1,layer);
if ( r2->adobe_enc==-1 )
- r2 = RefFindAdobe(r2,&t2);
+ r2 = RefFindAdobe(r2,&t2,layer);
}
/* CID fonts have no encodings. So we can't use seac to reference characters */
@@ -1331,12 +1275,12 @@ return( false );
RefChar *r3, t3;
SplineCharFindBounds(r2sc,&b);
- if ( scs[j]->layers[ly_fore].refs!=NULL && scs[j]->layers[ly_fore].refs->next==NULL )
+ if ( scs[j]->layers[layer].refs!=NULL && scs[j]->layers[layer].refs->next==NULL )
r3 = r2; /* Space, not offset */
else if ( swap )
- r3 = RefFindAdobe(scs[j]->layers[ly_fore].refs,&t3);
+ r3 = RefFindAdobe(scs[j]->layers[layer].refs,&t3,layer);
else
- r3 = RefFindAdobe(scs[j]->layers[ly_fore].refs->next,&t3);
+ r3 = RefFindAdobe(scs[j]->layers[layer].refs->next,&t3,layer);
b.minx = myround(b.minx,round);
data[j][0] = b.minx;
@@ -1354,32 +1298,32 @@ return( false );
return( true );
}
-static int _SCNeedsSubsPts(SplineChar *sc) {
+static int _SCNeedsSubsPts(SplineChar *sc,int layer) {
RefChar *ref;
if ( sc->hstem==NULL && sc->vstem==NULL )
return( false );
- if ( sc->layers[ly_fore].splines!=NULL )
-return( sc->layers[ly_fore].splines->first->hintmask==NULL );
+ if ( sc->layers[layer].splines!=NULL )
+return( sc->layers[layer].splines->first->hintmask==NULL );
- for ( ref = sc->layers[ly_fore].refs; ref!=NULL; ref=ref->next )
+ for ( ref = sc->layers[layer].refs; ref!=NULL; ref=ref->next )
if ( ref->layers[0].splines!=NULL )
return( ref->layers[0].splines->first->hintmask==NULL );
return( false ); /* It's empty. that's easy. */
}
-static int SCNeedsSubsPts(SplineChar *sc,enum fontformat format) {
+static int SCNeedsSubsPts(SplineChar *sc,enum fontformat format,int layer) {
if ( (format!=ff_mma && format!=ff_mmb) || sc->parent->mm==NULL ) {
if ( !sc->hconflicts && !sc->vconflicts )
return( false ); /* No conflicts, no swap-over points needed */
-return( _SCNeedsSubsPts(sc));
+return( _SCNeedsSubsPts(sc,layer));
} else {
MMSet *mm = sc->parent->mm;
int i;
for ( i=0; i<mm->instance_count; ++i ) if ( sc->orig_pos<mm->instances[i]->glyphcnt ) {
- if ( _SCNeedsSubsPts(mm->instances[i]->glyphs[sc->orig_pos]) )
+ if ( _SCNeedsSubsPts(mm->instances[i]->glyphs[sc->orig_pos],layer) )
return( true );
}
return( false );
@@ -1389,7 +1333,7 @@ return( false );
static void ExpandRef1(GrowBuf *gb, SplineChar *scs[MmMax], int instance_count,
struct hintdb *hdb, RefChar *r[MmMax], BasePoint trans[MmMax],
BasePoint current[MmMax],
- struct pschars *subrs, int round, int iscjk) {
+ struct pschars *subrs, int round, int iscjk, int layer) {
BasePoint *bpt;
BasePoint rtrans[MmMax], rpos[MmMax];
int i;
@@ -1412,7 +1356,7 @@ static void ExpandRef1(GrowBuf *gb, SplineChar *scs[MmMax], int instance_count,
}
} else {
/* Hints for a real reference */
- if ( !NeverConflicts(r,instance_count) || r[0]->sc->anyflexes || AnyRefs(r[0]->sc) )
+ if ( !NeverConflicts(r,instance_count) || r[0]->sc->layers[layer].anyflexes || AnyRefs(r[0]->sc,layer) )
/* Hints already done */;
else if ( hdb->noconflicts )
/* Hints already done */;
@@ -1453,7 +1397,7 @@ static void ExpandRef1(GrowBuf *gb, SplineChar *scs[MmMax], int instance_count,
static void RSC2PS1(GrowBuf *gb, SplineChar *base[MmMax],SplineChar *rsc[MmMax],
struct hintdb *hdb, BasePoint *trans, struct pschars *subrs,
BasePoint current[MmMax], int flags, int iscjk,
- int instance_count ) {
+ int instance_count, int layer ) {
BasePoint subtrans[MmMax];
SplineChar *rscs[MmMax];
int round = (flags&ps_flag_round)? true : false;
@@ -1463,40 +1407,40 @@ static void RSC2PS1(GrowBuf *gb, SplineChar *base[MmMax],SplineChar *rsc[MmMax],
int wasntconflicted = hdb->noconflicts;
for ( i=0; i<instance_count; ++i ) {
- spls[i] = rsc[i]->layers[ly_fore].splines;
+ spls[i] = rsc[i]->layers[layer].splines;
if ( base[0]!=rsc[0] )
spls[i] = freeme[i] = SPLCopyTranslatedHintMasks(spls[i],base[i],rsc[i],&trans[i]);
}
_CvtPsSplineSet(gb,spls,instance_count,current,round,hdb,
- base[0]->parent->order2,base[0]->parent->strokedfont);
+ base[0]->layers[layer].order2,base[0]->parent->strokedfont);
if ( base[0]!=rsc[0] )
for ( i=0; i<instance_count; ++i )
SplinePointListsFree(freeme[i]);
for ( i=0; i<instance_count; ++i )
- refs[i] = rsc[i]->layers[ly_fore].refs;
+ refs[i] = rsc[i]->layers[layer].refs;
while ( refs[0]!=NULL ) {
for ( i=0; i<instance_count; ++i )
spls[i] = refs[i]->layers[0].splines;
if ( !refs[0]->justtranslated ) {
for ( i=0; i<instance_count; ++i )
- spls[i] = freeme[i] = SPLCopyTransformedHintMasks(refs[i],base[i],&trans[i]);
+ spls[i] = freeme[i] = SPLCopyTransformedHintMasks(refs[i],base[i],&trans[i],layer);
if ( NeverConflicts(refs,instance_count) && !hdb->noconflicts &&
refs[0]->transform[1]==0 && refs[0]->transform[2]==0 )
CallTransformedHintSubr(gb,hdb,base,refs,trans,instance_count,round);
_CvtPsSplineSet(gb,spls,instance_count,current,round,hdb,
- base[0]->parent->order2,base[0]->parent->strokedfont);
+ base[0]->layers[layer].order2,base[0]->parent->strokedfont);
for ( i=0; i<instance_count; ++i )
SplinePointListsFree(freeme[i]);
} else if ( refs[0]->sc->ttf_glyph!=0x7fff &&
((flags&ps_flag_nohints) ||
- !refs[0]->sc->anyflexes ||
+ !refs[0]->sc->layers[layer].anyflexes ||
(refs[0]->transform[4]+trans[0].x==0 && refs[0]->transform[5]+trans[0].y==0)) &&
((flags&ps_flag_nohints) ||
NeverConflicts(refs,instance_count) ||
AllStationary(refs,trans,instance_count)) ) {
ExpandRef1(gb,base,instance_count,hdb,refs,trans,
- current,subrs,round,iscjk);
+ current,subrs,round,iscjk,layer);
} else {
for ( i=0; i<instance_count; ++i ) {
subtrans[i].x = trans[i].x + refs[i]->transform[4];
@@ -1508,7 +1452,7 @@ static void RSC2PS1(GrowBuf *gb, SplineChar *base[MmMax],SplineChar *rsc[MmMax],
hdb->noconflicts = true;
}
RSC2PS1(gb,base,rscs,hdb,subtrans,subrs,current,flags,iscjk,
- instance_count);
+ instance_count,layer);
hdb->noconflicts = wasntconflicted;
}
for ( i=0; i<instance_count; ++i )
@@ -1534,8 +1478,8 @@ static unsigned char *SplineChar2PS(SplineChar *sc,int *len,int round,int iscjk,
HintMask *hm[MmMax];
int fixuphm = false;
- if ( !(flags&ps_flag_nohints) && SCNeedsSubsPts(sc,format))
- SCFigureHintMasks(sc);
+ if ( !(flags&ps_flag_nohints) && SCNeedsSubsPts(sc,format,gi->layer))
+ SCFigureHintMasks(sc,gi->layer);
if ( (format==ff_mma || format==ff_mmb) && mm!=NULL ) {
instance_count = mm->instance_count;
@@ -1560,11 +1504,11 @@ static unsigned char *SplineChar2PS(SplineChar *sc,int *len,int round,int iscjk,
for ( i=0; i<instance_count; ++i )
if ( scs[i]->vconflicts || scs[i]->hconflicts )
break;
- if ( scs[0]->layers[ly_fore].splines!=NULL && i==instance_count ) { /* No conflicts */
+ if ( scs[0]->layers[gi->layer].splines!=NULL && i==instance_count ) { /* No conflicts */
fixuphm = true;
for ( i=0; i<instance_count; ++i ) {
- hm[i] = scs[i]->layers[ly_fore].splines->first->hintmask;
- scs[i]->layers[ly_fore].splines->first->hintmask = NULL;
+ hm[i] = scs[i]->layers[gi->layer].splines->first->hintmask;
+ scs[i]->layers[gi->layer].splines->first->hintmask = NULL;
}
}
}
@@ -1599,7 +1543,7 @@ static unsigned char *SplineChar2PS(SplineChar *sc,int *len,int round,int iscjk,
/* seac (they have no encoding so it doesn't work), that's what iscjk&0x100 */
/* tests for */
if ( scs[0]->ttf_glyph==0x7fff && !(iscjk&0x100) && !(flags&ps_flag_noseac) &&
- IsSeacable(&gb,scs,instance_count,round)) {
+ IsSeacable(&gb,scs,instance_count,round,gi->layer)) {
if ( gi )
gi->active->wasseac = true;
/* in MM fonts, all should share the same refs, so all should be */
@@ -1614,7 +1558,7 @@ static unsigned char *SplineChar2PS(SplineChar *sc,int *len,int round,int iscjk,
}
memset(&trans,0,sizeof(trans));
RSC2PS1(&gb,scs,scs,hdb,trans,subrs,current,flags,iscjk,
- instance_count);
+ instance_count,gi->layer);
}
if ( gi->bcnt==-1 ) { /* If it's whitespace */
gi->bcnt = 0;
@@ -1639,199 +1583,20 @@ static unsigned char *SplineChar2PS(SplineChar *sc,int *len,int round,int iscjk,
}
} else if ( fixuphm ) {
for ( i=0; i<instance_count; ++i )
- scs[i]->layers[ly_fore].splines->first->hintmask = hm[i];
+ scs[i]->layers[gi->layer].splines->first->hintmask = hm[i];
}
return( ret );
}
-#ifdef FONTFORGE_CONFIG_PS_REFS_GET_SUBRS
-static int AlwaysSeacable(SplineChar *sc,int flags) {
- struct splinecharlist *d;
- RefChar *r;
-
- if ( sc->parent->cidmaster!=NULL ) /* Can't use seac in CID fonts, no encoding */
-return( false );
- if ( flags&ps_flag_noseac )
-return( false );
-
- for ( d=sc->dependents; d!=NULL; d = d->next ) {
- if ( d->sc->layers[ly_fore].splines!=NULL ) /* I won't deal with things with both splines and refs. */
- continue; /* skip it */
- for ( r=d->sc->layers[ly_fore].refs; r!=NULL; r=r->next ) {
- if ( !r->justtranslated )
- break; /* Can't deal with it either way */
- }
- if ( r!=NULL ) /* Bad transform matrix */
- continue; /* Can't handle either way, skip */
-
- for ( r=d->sc->layers[ly_fore].refs; r!=NULL; r=r->next ) {
- if ( r->adobe_enc==-1 )
-return( false ); /* not seacable, but could go in subr */
- }
- r = d->sc->layers[ly_fore].refs;
- if ( r->next!=NULL && r->next->next!=NULL )
-return( false ); /* seac only takes 2 glyphs */
- if ( r->next!=NULL &&
- ((r->transform[4]!=0 || r->transform[5]!=0 || r->sc->width!=d->sc->width) &&
- (r->next->transform[4]!=0 || r->next->transform[5]!=0 || r->next->sc->width!=d->sc->width)))
-return( false ); /* seac only allows one to be translated, and the untranslated one must have the right width */
- if ( r->next==NULL &&
- (r->transform[4]!=0 || r->transform[5]!=0 || r->sc->width!=d->sc->width))
-return( false );
- }
- /* Either always can be represented by seac, or sometimes by neither */
-return( true );
-}
-
-/* normally we can't put a character with hint conflicts into a subroutine */
-/* (because when we would have to invoke the hints within the subr and */
-/* hints are expressed as absolute positions, so if the char has been */
-/* translated we can't do the hints right). BUT if the character is not */
-/* translated, and if it has the right lbearing, then the hints in the */
-/* ref will match those in the character and we can use a subroutine for */
-/* both */
-/* If at least one ref fits our requirements then return true */
-/* The same reasoning applies to flex hints. There are absolute expressions */
-/* in them too. */
-static int SpecialCaseConflicts(SplineChar *sc) {
- struct splinecharlist *d;
- RefChar *r;
- DBounds sb, db;
-
- SplineCharFindBounds(sc,&sb);
- for ( d=sc->dependents; d!=NULL; d = d->next ) {
- SplineCharFindBounds(d->sc,&db);
- if ( db.minx != sb.minx )
- continue;
- for ( r=d->sc->layers[ly_fore].refs; r!=NULL; r=r->next )
- if ( r->sc == sc && r->justtranslated &&
- r->transform[4]==0 && r->transform[5]==0 )
-return( true );
- }
-return( false );
-}
-
-static BasePoint *FigureStartStop(SplineChar *sc, GlyphInfo *gi ) {
- int m, didfirst;
- SplineChar *msc;
- SplineSet *spl;
- RefChar *r;
- BasePoint *startstop;
-
- /* We need to know the location of the first point on the */
- /* first path (need to rmoveto it, and the location of the */
- /* last point on the last path (will need to move from it */
- /* for the next component) */
-
- startstop = gcalloc(2*gi->instance_count,sizeof(BasePoint));
- for ( m=0; m<gi->instance_count; ++m ) {
- if ( gi->instance_count==1 || sc->parent->mm==NULL )
- msc = sc;
- else
- msc = sc->parent->mm->instances[m]->glyphs[sc->orig_pos];
- didfirst = false;
- spl = msc->layers[ly_fore].splines;
- if ( spl!=NULL ) {
- startstop[0] = spl->first->me;
- didfirst = true;
- while ( spl!=NULL ) {
- /* Closepath does NOT set the current point */
- /* Remember we reverse PostScript */
- if ( spl->last==spl->first && spl->first->next!=NULL &&
- spl->first->next->knownlinear )
- startstop[1] = spl->first->next->to->me;
- else
- startstop[1] = spl->last->me;
- spl = spl->next;
- }
- }
- for ( r=msc->layers[ly_fore].refs; r!=NULL; r=r->next ) {
- spl = r->layers[0].splines;
- if ( spl!=NULL ) {
- if ( !didfirst )
- startstop[0] = spl->first->me;
- didfirst = true;
- }
- while ( spl!=NULL ) {
- /* Closepath does NOT set the current point */
- /* Remember we reverse PostScript */
- if ( spl->last==spl->first && spl->first->next!=NULL &&
- spl->first->next->knownlinear )
- startstop[1] = spl->first->next->to->me;
- else
- startstop[1] = spl->last->me;
- spl = spl->next;
- }
- }
- }
-return( startstop );
-}
-#endif /* FONTFORGE_CONFIG_PS_REFS_GET_SUBRS */
/* Mark those glyphs which can live totally in subrs */
static void SplineFont2FullSubrs1(int flags,GlyphInfo *gi) {
int i;
SplineChar *sc;
-#ifdef FONTFORGE_CONFIG_PS_REFS_GET_SUBRS
- int anydone, cc;
- struct potentialsubrs *ps;
- SplineSet *spl;
- RefChar *r;
-#endif /* FONTFORGE_CONFIG_PS_REFS_GET_SUBRS */
- if ( !autohint_before_generate && !(flags&ps_flag_nohints))
- SplineFontAutoHintRefs(gi->sf);
for ( i=0; i<gi->glyphcnt; ++i ) if ( (sc=gi->gb[i].sc)!=NULL )
sc->ttf_glyph = 0x7fff;
-#ifdef FONTFORGE_CONFIG_PS_REFS_GET_SUBRS
- anydone = true;
- while ( anydone ) {
- anydone = false;
- for ( i=0; i<gi->glyphcnt; ++i ) if ( (sc=gi->gb[i].sc)!=NULL ) {
- if ( !SCWorthOutputting(sc) || sc->ttf_glyph!=0x7fff )
- continue;
- /* if the glyph is a single contour with no hintmasks then */
- /* our single contour code will find it. If we do it here too */
- /* we'll get a subr which points to another subr. Very dull and */
- /* a waste of space */
- cc = 0;
- for ( spl=sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next )
- ++cc;
- for ( r= sc->layers[ly_fore].refs; r!=NULL && cc<2 ; r=r->next ) {
- for ( spl=r->layers[0].splines; spl!=NULL; spl=spl->next )
- ++cc;
- }
- if ( cc<2 )
- continue;
- /* Put the */
- /* character into a subr if it is referenced by other characters */
- if ( (sc->dependents!=NULL &&
- ((!sc->hconflicts && !sc->vconflicts && !sc->anyflexes) ||
- SpecialCaseConflicts(sc)) &&
- !AlwaysSeacable(sc,flags))) {
- RefChar *r;
-
- for ( r=sc->layers[ly_fore].refs; r!=NULL; r=r->next )
- if ( r->sc->ttf_glyph==0x7fff )
- break;
- if ( r!=NULL ) /* Contains a reference to something which is */
- continue; /* not in a sub itself. Skip it for now, we'll*/
- /* come back to it next pass when perhaps the */
- /* reference will be nicely ensconsed itself */
- if ( gi->pcnt>=gi->pmax )
- gi->psubrs = grealloc(gi->psubrs,(gi->pmax+=gi->glyphcnt)*sizeof(struct potentialsubrs));
- ps = &gi->psubrs[gi->pcnt];
- memset(ps,0,sizeof(*ps)); /* set cnt to 0 */
- ps->idx = gi->pcnt++;
- ps->full_glyph_index = i;
- sc->ttf_glyph = gi->pcnt-1;
- ps->startstop = FigureStartStop(sc,gi);
- anydone = true;
- }
- }
- }
-#endif /* FONTFORGE_CONFIG_PS_REFS_GET_SUBRS */
}
int SFOneWidth(SplineFont *sf) {
@@ -1862,6 +1627,8 @@ int CIDOneWidth(SplineFont *_sf) {
do {
sf = _sf->subfonts==NULL? _sf : _sf->subfonts[k];
for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sf->glyphs[i]) &&
+ strcmp(sf->glyphs[i]->name,".null")!=0 &&
+ strcmp(sf->glyphs[i]->name,"nonmarkingreturn")!=0 &&
(strcmp(sf->glyphs[i]->name,".notdef")!=0 || sf->glyphs[i]->layers[ly_fore].splines!=NULL)) {
/* Only trust the width of notdef if it's got some content */
/* (at least as far as fixed pitch determination goes) */
@@ -1876,52 +1643,6 @@ int CIDOneWidth(SplineFont *_sf) {
return(width);
}
-int SFOneHeight(SplineFont *sf) {
- int width, i;
-
- if ( !sf->hasvmetrics )
-return( sf->ascent+sf->descent );
-
- width = -2;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( SCWorthOutputting(sf->glyphs[i]) &&
- (strcmp(sf->glyphs[i]->name,".notdef")!=0 || sf->glyphs[i]->layers[ly_fore].splines!=NULL)) {
- /* Only trust the width of notdef if it's got some content */
- /* (at least as far as fixed pitch determination goes) */
- if ( width==-2 ) width = sf->glyphs[i]->vwidth;
- else if ( width!=sf->glyphs[i]->vwidth ) {
- width = -1;
- break;
- }
- }
-return(width);
-}
-
-int SFIsCJK(SplineFont *sf,EncMap *map) {
- char *val;
-
- if ( (val = PSDictHasEntry(sf->private,"LanguageGroup"))!=NULL )
-return( strtol(val,NULL,10));
-
- if ( map->enc->is_japanese || map->enc->is_korean ||
- map->enc->is_tradchinese || map->enc->is_simplechinese )
-return( true );
- if ( (map->enc->is_unicodebmp || map->enc->is_unicodefull) &&
- sf->glyphcnt>0x3000 &&
- SCWorthOutputting(sf->glyphs[0x3000]) &&
- !SCWorthOutputting(sf->glyphs['A']) )
-return( true );
- if ( map->enc==&custom ) {
- /* If it's in a CID font and it doesn't contain alphabetics, then */
- /* it's assumed to be CJK */
- if ( sf->cidmaster!=NULL )
-return( !SCWorthOutputting(SFGetChar(sf,'A',NULL)) &&
- !SCWorthOutputting(SFGetChar(sf,0x391,NULL)) && /* Alpha */
- !SCWorthOutputting(SFGetChar(sf,0x410,NULL)) && /* Cyrillic A */
- !SCWorthOutputting(SFGetChar(sf,-1,"uni0041.hw")) ); /* Halfwidth A, non standard name, from my cidmap */
- }
-
-return( false );
-}
static void SetupType1Subrs(struct pschars *subrs,GlyphInfo *gi) {
int scnt, call_size;
@@ -2051,122 +1772,8 @@ static void SetupType1Chrs(struct pschars *chrs,struct pschars *subrs,GlyphInfo
}
}
-struct pschars *SplineFont2ChrsSubrs(SplineFont *sf, int iscjk,
- struct pschars *subrs,int flags, enum fontformat format) {
- struct pschars *chrs = gcalloc(1,sizeof(struct pschars));
- int i, cnt, instance_count;
- int fixed;
- int notdef_pos;
- MMSet *mm = sf->mm;
- int round = (flags&ps_flag_round)? true : false;
- GlyphInfo gi;
- SplineChar dummynotdef, *sc;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer dummylayers[2];
-#endif
-
- if ( (format==ff_mma || format==ff_mmb) && mm!=NULL ) {
- instance_count = mm->instance_count;
- sf = mm->instances[0];
- fixed = 0;
- for ( i=0; i<instance_count; ++i ) {
- MarkTranslationRefs(mm->instances[i]);
- fixed = SFOneWidth(mm->instances[i]);
- if ( fixed==-1 )
- break;
- }
- } else {
- MarkTranslationRefs(sf);
- fixed = SFOneWidth(sf);
- instance_count = 1;
- }
-
- notdef_pos = SFFindNotdef(sf,fixed);
- cnt = 0;
- for ( i=0; i<sf->glyphcnt; ++i )
-#if HANYANG
- if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->compositionunit )
- /* Don't count it */;
- else
-#endif
- if ( SCWorthOutputting(sf->glyphs[i]) &&
- ( i==notdef_pos || strcmp(sf->glyphs[i]->name,".notdef")!=0))
- ++cnt;
-/* only honor the width on .notdef in non-fixed pitch fonts (or ones where there is an actual outline in notdef) */
- if ( notdef_pos==-1 )
- ++cnt; /* one notdef entry */
-
- memset(&gi,0,sizeof(gi));
- memset(&gi.hashed,-1,sizeof(gi.hashed));
- gi.instance_count = 1;
- gi.sf = sf;
- gi.glyphcnt = cnt;
- gi.gb = gcalloc(cnt,sizeof(struct glyphbits));
- gi.pmax = 3*cnt;
- gi.psubrs = galloc(gi.pmax*sizeof(struct potentialsubrs));
- gi.instance_count = instance_count;
-
- if ( notdef_pos==-1 ) {
- memset(&dummynotdef,0,sizeof(dummynotdef));
- dummynotdef.name = ".notdef";
- dummynotdef.parent = sf;
- dummynotdef.layer_cnt = 2;
-#ifdef FONTFORGE_CONFIG_TYPE3
- dummynotdef.layers = dummylayers;
- memset(dummylayers,0,sizeof(dummylayers));
-#endif
- dummynotdef.width = SFOneWidth(sf);
- if ( dummynotdef.width==-1 )
- dummynotdef.width = (sf->ascent+sf->descent)/2;
- gi.gb[0].sc = &dummynotdef;
- } else
- gi.gb[0].sc = sf->glyphs[notdef_pos];
- cnt = 1;
- for ( i=0 ; i<sf->glyphcnt; ++i ) {
-#if HANYANG
- if ( sf->glyphs[i]!=NULL && sf->glyphs[i]->compositionunit )
- /* don't output it, should be in a subroutine */;
- else
-#endif
- if ( SCWorthOutputting(sf->glyphs[i]) &&
- strcmp(sf->glyphs[i]->name,".notdef")!=0) /* We've already added .notdef */
- gi.gb[cnt++].sc = sf->glyphs[i];
- }
-
- SplineFont2FullSubrs1(flags,&gi);
-
- for ( i=0; i<cnt; ++i ) {
- if ( (sc = gi.gb[i].sc)==NULL )
- continue;
- gi.active = &gi.gb[i];
- SplineChar2PS(sc,NULL, round,iscjk,subrs,flags,format,&gi);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next()) {
- PSCharsFree(chrs);
- GIFree(&gi,&dummynotdef);
-return( NULL );
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- }
-
- SetupType1Subrs(subrs,&gi);
- chrs->cnt = cnt;
- chrs->keys = galloc(cnt*sizeof(char *));
- chrs->lens = galloc(cnt*sizeof(int));
- chrs->values = galloc(cnt*sizeof(unsigned char *));
-
- SetupType1Chrs(chrs,subrs,&gi,false);
-
- GIFree(&gi,&dummynotdef);
-
- chrs->next = cnt;
- if ( chrs->next>chrs->cnt )
- IError("Character estimate failed, about to die..." );
-return( chrs );
-}
-
-struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,int flags) {
+struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,int flags,int layer) {
struct pschars *chrs = gcalloc(1,sizeof(struct pschars));
int i, cnt, cid;
SplineFont *sf = NULL;
@@ -2176,9 +1783,6 @@ struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,in
GlyphInfo gi;
int notdef_subfont;
SplineChar dummynotdef, *sc;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer dummylayers[2];
-#endif
cnt = 0; notdef_subfont = -1;
for ( i=0; i<cidmaster->subfontcnt; ++i ) {
@@ -2194,11 +1798,8 @@ struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,in
memset(&dummynotdef,0,sizeof(dummynotdef));
dummynotdef.name = ".notdef";
dummynotdef.parent = cidmaster->subfonts[0];
- dummynotdef.layer_cnt = 2;
-#ifdef FONTFORGE_CONFIG_TYPE3
- dummynotdef.layers = dummylayers;
- memset(dummylayers,0,sizeof(dummylayers));
-#endif
+ dummynotdef.layer_cnt = layer+1;
+ dummynotdef.layers = gcalloc(layer+1,sizeof(Layer));;
dummynotdef.width = SFOneWidth(dummynotdef.parent);
if ( dummynotdef.width==-1 )
dummynotdef.width = (dummynotdef.parent->ascent+dummynotdef.parent->descent);
@@ -2210,6 +1811,7 @@ struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,in
gi.gb = galloc(cnt*sizeof(struct glyphbits));
gi.pmax = 3*cnt;
gi.psubrs = galloc(gi.pmax*sizeof(struct potentialsubrs));
+ gi.layer = layer;
chrs->cnt = cnt;
chrs->lens = gcalloc(cnt,sizeof(int));
@@ -2221,7 +1823,7 @@ struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,in
/* as there are no global subrs */
for ( i=0; i<cidmaster->subfontcnt; ++i ) {
gi.sf = sf = cidmaster->subfonts[i];
- MarkTranslationRefs(sf);
+ MarkTranslationRefs(sf,layer);
fd = &cidbytes->fds[i];
memset(&gi.hashed,-1,sizeof(gi.hashed));
gi.instance_count = 1;
@@ -2244,14 +1846,11 @@ struct pschars *CID2ChrsSubrs(SplineFont *cidmaster,struct cidbytes *cidbytes,in
gi.active = &gi.gb[cid];
SplineChar2PS(sc,NULL, round,fd->iscjk|0x100,fd->subrs,
flags,ff_cid,&gi);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- if ( !gwwv_progress_next()) {
+ if ( !ff_progress_next()) {
PSCharsFree(chrs);
GIFree(&gi,&dummynotdef);
return( NULL );
- }
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
-
+ }
}
SetupType1Subrs(fd->subrs,&gi);
@@ -2406,7 +2005,8 @@ static void moveto2(GrowBuf *gb,struct hintdb *hdb,SplinePoint *to, int round) {
AddNumber2(gb,tom->y-hdb->current.y,round);
*(gb->pt)++ = 21; /* r move to */
}
- hdb->current = *tom;
+ hdb->current.x = rint(32768*tom->x)/32768;
+ hdb->current.y = rint(32768*tom->y)/32768;
StartNextSubroutine(gb,hdb);
}
@@ -2486,7 +2086,8 @@ static Spline *lineto2(GrowBuf *gb,struct hintdb *hdb,Spline *spline, Spline *do
AddNumber2(gb,tom->y-fromm->y,round);
else
AddNumber2(gb,tom->x-fromm->x,round);
- hdb->current = *tom;
+ hdb->current.x = rint(32768*tom->x)/32768;
+ hdb->current.y = rint(32768*tom->y)/32768;
if ( test==lasthvgood ) {
test = test->to->next;
break;
@@ -2517,7 +2118,8 @@ return( test );
}
AddNumber2(gb,tom->x-fromm->x,round);
AddNumber2(gb,tom->y-fromm->y,round);
- hdb->current = *tom;
+ hdb->current.x = rint(32768*tom->x)/32768;
+ hdb->current.y = rint(32768*tom->y)/32768;
if ( test==lastgood ) {
test = test->to->next;
break;
@@ -2532,7 +2134,7 @@ return( test );
static Spline *curveto2(GrowBuf *gb,struct hintdb *hdb,Spline *spline, Spline *done, int round) {
int cnt=0, hv;
Spline *first;
- BasePoint start;
+ DBasePoint start;
int donehm;
HintSetup2(gb,hdb,spline->to,true);
@@ -2664,7 +2266,8 @@ static void flexto2(GrowBuf *gb,struct hintdb *hdb,Spline *pspline,int round) {
*gb->pt++ = 12; *gb->pt++ = 37; /* flex1 */
}
- hdb->current = *end;
+ hdb->current.x = rint(32768*end->x)/32768;
+ hdb->current.y = rint(32768*end->y)/32768;
}
static void CvtPsSplineSet2(GrowBuf *gb, SplinePointList *spl,
@@ -2778,7 +2381,7 @@ return;
}
static void DumpRefsHints(GrowBuf *gb, struct hintdb *hdb,RefChar *cur,StemInfo *h,StemInfo *v,
- BasePoint *trans, int round) {
+ BasePoint *trans, int round,int layer) {
uint8 masks[12];
int cnt, sets=0;
StemInfo *rs;
@@ -2788,11 +2391,11 @@ static void DumpRefsHints(GrowBuf *gb, struct hintdb *hdb,RefChar *cur,StemInfo
/* If we have a subroutine containing conflicts, then its hints will match*/
/* ours exactly, and we can use its hintmasks directly */
if (( cur->sc->hconflicts || cur->sc->vconflicts ) &&
- cur->sc->layers[ly_fore].splines!=NULL &&
- cur->sc->layers[ly_fore].splines->first->hintmask!=NULL ) {
- AddMask2(gb,*cur->sc->layers[ly_fore].splines->first->hintmask,hdb->cnt,19); /* hintmask */
+ cur->sc->layers[layer].splines!=NULL &&
+ cur->sc->layers[layer].splines->first->hintmask!=NULL ) {
+ AddMask2(gb,*cur->sc->layers[layer].splines->first->hintmask,hdb->cnt,19); /* hintmask */
hdb->donefirsthm = true;
- memcpy(hdb->mask,*cur->sc->layers[ly_fore].splines->first->hintmask,sizeof(HintMask));
+ memcpy(hdb->mask,*cur->sc->layers[layer].splines->first->hintmask,sizeof(HintMask));
return;
}
@@ -2858,7 +2461,7 @@ static void SetTransformedHintMask(GrowBuf *gb,struct hintdb *hdb,
static void ExpandRef2(GrowBuf *gb, SplineChar *sc, struct hintdb *hdb,
RefChar *r, BasePoint *trans,
- struct pschars *subrs, int round) {
+ struct pschars *subrs, int round,int layer) {
BasePoint *bpt;
BasePoint temp, rtrans;
GlyphInfo *gi;
@@ -2873,7 +2476,7 @@ static void ExpandRef2(GrowBuf *gb, SplineChar *sc, struct hintdb *hdb,
BreakSubroutine(gb,hdb);
if ( hdb->cnt>0 && !hdb->noconflicts )
- DumpRefsHints(gb,hdb,r,sc->hstem,sc->vstem,&rtrans,round);
+ DumpRefsHints(gb,hdb,r,sc->hstem,sc->vstem,&rtrans,round,layer);
/* Translate from end of last character to where this one should */
/* start (we must have one moveto operator to start off, none */
@@ -2904,7 +2507,7 @@ static void ExpandRef2(GrowBuf *gb, SplineChar *sc, struct hintdb *hdb,
static void RSC2PS2(GrowBuf *gb, SplineChar *base,SplineChar *rsc,
struct hintdb *hdb, BasePoint *trans, struct pschars *subrs,
- int flags ) {
+ int flags, int layer ) {
BasePoint subtrans;
int stationary = trans->x==0 && trans->y==0;
RefChar *r, *unsafe=NULL;
@@ -2914,14 +2517,14 @@ static void RSC2PS2(GrowBuf *gb, SplineChar *base,SplineChar *rsc,
int hc, vc;
SplineSet *freeme, *temp;
int wasntconflicted = hdb->noconflicts;
- oldh = NULL; oldv = NULL; hc = 0; vc = 0; /* for -Wall */
+
if ( flags&ps_flag_nohints ) {
oldh = rsc->hstem; oldv = rsc->vstem;
hc = rsc->hconflicts; vc = rsc->vconflicts;
rsc->hstem = NULL; rsc->vstem = NULL;
rsc->hconflicts = false; rsc->vconflicts = false;
} else {
- for ( r=rsc->layers[ly_fore].refs; r!=NULL; r=r->next ) {
+ for ( r=rsc->layers[layer].refs; r!=NULL; r=r->next ) {
if ( !r->justtranslated )
continue;
if ( r->sc->hconflicts || r->sc->vconflicts ) {
@@ -2938,22 +2541,22 @@ static void RSC2PS2(GrowBuf *gb, SplineChar *base,SplineChar *rsc,
if ( unsafe && allwithouthints ) {
if ( unsafe->sc->lsidebearing!=0x7fff ) {
- ExpandRef2(gb,base,hdb,unsafe,trans,subrs,round);
+ ExpandRef2(gb,base,hdb,unsafe,trans,subrs,round,layer);
} else if ( unsafe->transform[4]==0 && unsafe->transform[5]==0 )
- RSC2PS2(gb,base,unsafe->sc,hdb,trans,subrs,flags);
+ RSC2PS2(gb,base,unsafe->sc,hdb,trans,subrs,flags,layer);
else
unsafe = NULL;
} else
unsafe = NULL;
/* What is the hintmask state here? It should not matter */
- freeme = NULL; temp = rsc->layers[ly_fore].splines;
+ freeme = NULL; temp = rsc->layers[layer].splines;
if ( base!=rsc )
temp = freeme = SPLCopyTranslatedHintMasks(temp,base,rsc,trans);
- CvtPsSplineSet2(gb,temp,hdb,rsc->parent->order2,round);
+ CvtPsSplineSet2(gb,temp,hdb,rsc->layers[layer].order2,round);
SplinePointListsFree(freeme);
- for ( r = rsc->layers[ly_fore].refs; r!=NULL; r = r->next ) if ( r!=unsafe ) {
+ for ( r = rsc->layers[layer].refs; r!=NULL; r = r->next ) if ( r!=unsafe ) {
if ( !r->justtranslated ) {
if ( !r->sc->hconflicts && !r->sc->vconflicts && !hdb->noconflicts &&
r->transform[1]==0 && r->transform[2]==0 &&
@@ -2961,13 +2564,13 @@ static void RSC2PS2(GrowBuf *gb, SplineChar *base,SplineChar *rsc,
SetTransformedHintMask(gb,hdb,base,r,trans,round);
if ( !hdb->donefirsthm )
DummyHintmask(gb,hdb);
- temp = SPLCopyTransformedHintMasks(r,base,trans);
- CvtPsSplineSet2(gb,temp,hdb,rsc->parent->order2,round);
+ temp = SPLCopyTransformedHintMasks(r,base,trans,layer);
+ CvtPsSplineSet2(gb,temp,hdb,rsc->layers[layer].order2,round);
SplinePointListsFree(temp);
} else if ( r->sc->lsidebearing!=0x7fff &&
((flags&ps_flag_nohints) ||
(!r->sc->hconflicts && !r->sc->vconflicts)) ) {
- ExpandRef2(gb,base,hdb,r,trans,subrs,round);
+ ExpandRef2(gb,base,hdb,r,trans,subrs,round,layer);
} else {
subtrans.x = trans->x + r->transform[4];
subtrans.y = trans->y + r->transform[5];
@@ -2975,7 +2578,7 @@ static void RSC2PS2(GrowBuf *gb, SplineChar *base,SplineChar *rsc,
SetTransformedHintMask(gb,hdb,base,r,trans,round);
hdb->noconflicts = true;
}
- RSC2PS2(gb,base,r->sc,hdb,&subtrans,subrs,flags);
+ RSC2PS2(gb,base,r->sc,hdb,&subtrans,subrs,flags,layer);
hdb->noconflicts = wasntconflicted;
}
}
@@ -2998,22 +2601,19 @@ static unsigned char *SplineChar2PS2(SplineChar *sc,int *len, int nomwid,
int round = (flags&ps_flag_round)? true : false;
HintMask *hm = NULL;
BasePoint trans;
- oldh = NULL; oldv = NULL; hc = 0; vc = 0; /* for -Wall */
- if ( autohint_before_generate && sc->changedsincelasthinted &&
- !sc->manualhints && !(flags&ps_flag_nohints))
- SplineCharAutoHint(sc,NULL);
- if ( !(flags&ps_flag_nohints) && SCNeedsSubsPts(sc,ff_otf))
- SCFigureHintMasks(sc);
+
+ if ( !(flags&ps_flag_nohints) && SCNeedsSubsPts(sc,ff_otf,gi->layer))
+ SCFigureHintMasks(sc,gi->layer);
if ( flags&ps_flag_nohints ) {
oldh = sc->hstem; oldv = sc->vstem;
hc = sc->hconflicts; vc = sc->vconflicts;
sc->hstem = NULL; sc->vstem = NULL;
sc->hconflicts = false; sc->vconflicts = false;
- } else if ( sc->layers[ly_fore].splines!=NULL && !sc->vconflicts &&
+ } else if ( sc->layers[gi->layer].splines!=NULL && !sc->vconflicts &&
!sc->hconflicts ) {
- hm = sc->layers[ly_fore].splines->first->hintmask;
- sc->layers[ly_fore].splines->first->hintmask = NULL;
+ hm = sc->layers[gi->layer].splines->first->hintmask;
+ sc->layers[gi->layer].splines->first->hintmask = NULL;
}
memset(&gb,'\0',sizeof(gb));
@@ -3040,7 +2640,7 @@ static unsigned char *SplineChar2PS2(SplineChar *sc,int *len, int nomwid,
DumpHints(&gb,sc->vstem,sc->hconflicts || sc->vconflicts?-1:3,
sc->hconflicts || sc->vconflicts?23:3,round);
CounterHints2(&gb, sc, hdb.cnt );
- RSC2PS2(&gb,sc,sc,&hdb,&trans,subrs,flags);
+ RSC2PS2(&gb,sc,sc,&hdb,&trans,subrs,flags,gi->layer);
if ( gi->bcnt==-1 ) { /* If it's whitespace */
gi->bcnt = 0;
@@ -3055,17 +2655,17 @@ static unsigned char *SplineChar2PS2(SplineChar *sc,int *len, int nomwid,
sc->hstem = oldh; sc->vstem = oldv;
sc->hconflicts = hc; sc->vconflicts = vc;
} else if ( hm!=NULL )
- sc->layers[ly_fore].splines->first->hintmask = hm;
+ sc->layers[gi->layer].splines->first->hintmask = hm;
return( ret );
}
-static SplinePoint *LineTo(SplinePoint *last, int x, int y) {
+static SplinePoint *FFLineTo(SplinePoint *last, int x, int y) {
SplinePoint *sp = SplinePointCreate(x,y);
SplineMake3(last,sp);
return( sp );
}
-static void Type2NotDefSplines(SplineFont *sf,SplineChar *sc) {
+static void Type2NotDefSplines(SplineFont *sf,SplineChar *sc,int layer) {
/* I'd always assumed that Type2 notdefs would look like type1 notdefs */
/* but they don't, they look like truetype notdefs. And Ralf Stubner */
/* points out that the spec says they should. So make a box here */
@@ -3078,21 +2678,21 @@ static void Type2NotDefSplines(SplineFont *sf,SplineChar *sc) {
ss = chunkalloc(sizeof(SplineSet));
ss->first = ss->last = SplinePointCreate(stem,0);
- ss->last = LineTo(ss->last,stem,ymax);
- ss->last = LineTo(ss->last,sc->width-stem,ymax);
- ss->last = LineTo(ss->last,sc->width-stem,0);
+ ss->last = FFLineTo(ss->last,stem,ymax);
+ ss->last = FFLineTo(ss->last,sc->width-stem,ymax);
+ ss->last = FFLineTo(ss->last,sc->width-stem,0);
SplineMake3(ss->last,ss->first);
ss->last = ss->first;
ss->next = inner = chunkalloc(sizeof(SplineSet));
inner->first = inner->last = SplinePointCreate(2*stem,stem);
- inner->last = LineTo(inner->last,sc->width-2*stem,stem);
- inner->last = LineTo(inner->last,sc->width-2*stem,ymax-stem);
- inner->last = LineTo(inner->last,2*stem,ymax-stem);
+ inner->last = FFLineTo(inner->last,sc->width-2*stem,stem);
+ inner->last = FFLineTo(inner->last,sc->width-2*stem,ymax-stem);
+ inner->last = FFLineTo(inner->last,2*stem,ymax-stem);
SplineMake3(inner->last,inner->first);
inner->last = inner->first;
- sc->layers[ly_fore].splines = ss;
+ sc->layers[layer].splines = ss;
hints = chunkalloc(sizeof(StemInfo));
hints->start = stem;
@@ -3111,108 +2711,29 @@ static void Type2NotDefSplines(SplineFont *sf,SplineChar *sc) {
sc->hstem = hints;
}
-#ifdef FONTFORGE_CONFIG_PS_REFS_GET_SUBRS
-/* This char has hint conflicts. Check to see if we can put it into a subr */
-/* in spite of that. If there is at least one dependent character which: */
-/* refers to us without translating us */
-/* and all its other refs contain no hints at all */
-static int Type2SpecialCase(SplineChar *sc) {
- struct splinecharlist *d;
- RefChar *r;
-
- for ( d=sc->dependents; d!=NULL; d=d->next ) {
- for ( r=d->sc->layers[ly_fore].refs; r!=NULL; r = r->next ) {
- if ( autohint_before_generate && r->sc!=NULL &&
- r->sc->changedsincelasthinted && !r->sc->manualhints )
- SplineCharAutoHint(r->sc,NULL);
- if ( r->transform[0]!=1 || r->transform[1]!=0 ||
- r->transform[2]!=0 || r->transform[3]!=1 )
- break;
- if ( r->sc!=sc && (r->sc->hstem!=NULL || r->sc->vstem!=NULL))
- break;
- if ( r->sc==sc && (r->transform[4]!=0 || r->transform[5]!=0))
- break;
- }
- if ( r==NULL )
-return( true );
- }
-return( false );
-}
-#endif /* FONTFORGE_CONFIG_PS_REFS_GET_SUBRS */
-
/* Mark those glyphs which can live totally in subrs */
static void SplineFont2FullSubrs2(int flags,GlyphInfo *gi) {
int i;
SplineChar *sc;
-#ifdef FONTFORGE_CONFIG_PS_REFS_GET_SUBRS
- int cc;
- RefChar *r;
- struct potentialsubrs *ps;
- SplineSet *spl;
-#endif /* FONTFORGE_CONFIG_PS_REFS_GET_SUBRS */
-
- if ( !autohint_before_generate && !(flags&ps_flag_nohints))
- SplineFontAutoHintRefs(gi->sf);
for ( i=0; i<gi->glyphcnt; ++i ) if ( (sc=gi->gb[i].sc)!=NULL )
sc->lsidebearing = 0x7fff;
-/* This code allows us to put whole glyphs into subroutines */
-/* I found slight improvements in space on some fonts, and large increases */
-/* in others. So I'm disabling it for now */
-#ifdef FONTFORGE_CONFIG_PS_REFS_GET_SUBRS
- /* We don't allow refs to refs. It's too complex */
- for ( i=0; i<gi->glyphcnt; ++i ) if ( (sc=gi->gb[i].sc)!=NULL ) {
- if ( SCWorthOutputting(sc) &&
- (( sc->layers[ly_fore].refs==NULL && sc->dependents!=NULL &&
- ( (!sc->hconflicts && !sc->vconflicts) ||
- Type2SpecialCase(sc)) ) )) {
- /* if the glyph is a single contour with no hintmasks then */
- /* our single contour code will find it. If we do it here too */
- /* we'll get a subr which points to another subr. Very dull and */
- /* a waste of space */
- cc = 0;
- for ( spl=sc->layers[ly_fore].splines; spl!=NULL; spl=spl->next )
- ++cc;
- for ( r= sc->layers[ly_fore].refs; r!=NULL && cc<2 ; r=r->next ) {
- for ( spl=r->layers[0].splines; spl!=NULL; spl=spl->next )
- ++cc;
- }
- if ( cc<2 )
- continue;
- /* Put the */
- /* character into a subr if it is referenced by other characters */
- if ( gi->pcnt>=gi->pmax )
- gi->psubrs = grealloc(gi->psubrs,(gi->pmax+=gi->glyphcnt)*sizeof(struct potentialsubrs));
- ps = &gi->psubrs[gi->pcnt];
- memset(ps,0,sizeof(*ps)); /* set cnt to 0 */
- ps->idx = gi->pcnt++;
- ps->full_glyph_index = i;
- sc->lsidebearing = gi->pcnt-1;
- ps->startstop = FigureStartStop(sc,gi);
- }
- }
-#endif /* FONTFORGE_CONFIG_PS_REFS_GET_SUBRS */
}
struct pschars *SplineFont2ChrsSubrs2(SplineFont *sf, int nomwid, int defwid,
- const int *bygid, int cnt, int flags, struct pschars **_subrs) {
+ const int *bygid, int cnt, int flags, struct pschars **_subrs, int layer) {
struct pschars *subrs, *chrs;
int i,j,k,scnt;
SplineChar *sc;
GlyphInfo gi;
SplineChar dummynotdef;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer dummylayers[2];
-#endif
-
- if ( !autohint_before_generate && !(flags&ps_flag_nohints))
- SplineFontAutoHintRefs(sf);
memset(&gi,0,sizeof(gi));
memset(&gi.hashed,-1,sizeof(gi.hashed));
gi.instance_count = 1;
gi.sf = sf;
+ gi.layer = layer;
gi.glyphcnt = cnt;
gi.bygid = bygid;
gi.gb = gcalloc(cnt,sizeof(struct glyphbits));
@@ -3225,27 +2746,20 @@ struct pschars *SplineFont2ChrsSubrs2(SplineFont *sf, int nomwid, int defwid,
memset(sc,0,sizeof(dummynotdef));
dummynotdef.name = ".notdef";
dummynotdef.parent = sf;
- dummynotdef.layer_cnt = 2;
-#ifdef FONTFORGE_CONFIG_TYPE3
- dummynotdef.layers = dummylayers;
- memset(dummylayers,0,sizeof(dummylayers));
-#endif
+ dummynotdef.layer_cnt = sf->layer_cnt;
+ dummynotdef.layers = gcalloc(sf->layer_cnt,sizeof(Layer));
dummynotdef.width = SFOneWidth(sf);
if ( dummynotdef.width==-1 )
dummynotdef.width = (sf->ascent+sf->descent)/2;
- Type2NotDefSplines(sf,&dummynotdef);
+ Type2NotDefSplines(sf,&dummynotdef,layer);
} else if ( gid!=-1 )
sc = sf->glyphs[gid];
else
continue;
gi.gb[i].sc = sc;
- if ( autohint_before_generate && sc!=NULL &&
- sc->changedsincelasthinted && !sc->manualhints &&
- !(flags&ps_flag_nohints))
- SplineCharAutoHint(sc,NULL);
sc->lsidebearing = 0x7fff;
}
- MarkTranslationRefs(sf);
+ MarkTranslationRefs(sf,layer);
SplineFont2FullSubrs2(flags,&gi);
for ( i=0; i<cnt; ++i ) {
@@ -3253,9 +2767,7 @@ struct pschars *SplineFont2ChrsSubrs2(SplineFont *sf, int nomwid, int defwid,
continue;
gi.active = &gi.gb[i];
SplineChar2PS2(sc,NULL,nomwid,defwid,NULL,flags,&gi);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
for ( i=scnt=0; i<gi.pcnt; ++i ) {
@@ -3401,7 +2913,7 @@ return( chrs );
}
struct pschars *CID2ChrsSubrs2(SplineFont *cidmaster,struct fd2data *fds,
- int flags, struct pschars **_glbls) {
+ int flags, struct pschars **_glbls, int layer) {
struct pschars *chrs, *glbls;
int i, j, cnt, cid, max, fd;
int *scnts;
@@ -3412,15 +2924,12 @@ struct pschars *CID2ChrsSubrs2(SplineFont *cidmaster,struct fd2data *fds,
/* we add it. */
GlyphInfo gi;
SplineChar dummynotdef;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer dummylayers[2];
-#endif
max = 0;
for ( i=0; i<cidmaster->subfontcnt; ++i ) {
if ( max<cidmaster->subfonts[i]->glyphcnt )
max = cidmaster->subfonts[i]->glyphcnt;
- MarkTranslationRefs(cidmaster->subfonts[i]);
+ MarkTranslationRefs(cidmaster->subfonts[i],layer);
}
cnt = 1; /* for .notdef */
for ( cid = 1; cid<max; ++cid ) {
@@ -3445,6 +2954,7 @@ struct pschars *CID2ChrsSubrs2(SplineFont *cidmaster,struct fd2data *fds,
gi.gb = gcalloc(cnt,sizeof(struct glyphbits));
gi.pmax = 3*cnt;
gi.psubrs = galloc(gi.pmax*sizeof(struct potentialsubrs));
+ gi.layer = layer;
for ( cid = cnt = 0; cid<max; ++cid ) {
sf = NULL;
@@ -3462,15 +2972,12 @@ struct pschars *CID2ChrsSubrs2(SplineFont *cidmaster,struct fd2data *fds,
memset(sc,0,sizeof(dummynotdef));
dummynotdef.name = ".notdef";
dummynotdef.parent = sf;
- dummynotdef.layer_cnt = 2;
-#ifdef FONTFORGE_CONFIG_TYPE3
- dummynotdef.layers = dummylayers;
- memset(dummylayers,0,sizeof(dummylayers));
-#endif
+ dummynotdef.layer_cnt = layer+1;
+ dummynotdef.layers = gcalloc(layer+1,sizeof(Layer));
dummynotdef.width = SFOneWidth(sf);
if ( dummynotdef.width==-1 )
dummynotdef.width = (sf->ascent+sf->descent);
- Type2NotDefSplines(sf,&dummynotdef);
+ Type2NotDefSplines(sf,&dummynotdef,layer);
gi.gb[cnt].sc = sc;
gi.gb[cnt].fd = i = cidmaster->subfontcnt-1;
#if 0 && HANYANG /* Too much stuff knows the glyph cnt, can't refigure it here at the end */
@@ -3487,9 +2994,7 @@ struct pschars *CID2ChrsSubrs2(SplineFont *cidmaster,struct fd2data *fds,
sc->ttf_glyph = cnt++;
SplineChar2PS2(sc,NULL,fds[i].nomwid,fds[i].defwid,NULL,flags,&gi);
}
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
scnts = gcalloc( cidmaster->subfontcnt+1,sizeof(int));
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesaveafm.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesaveafm.c
new file mode 100644
index 00000000000..4607ee38819
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinesaveafm.c
@@ -0,0 +1,261 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h" /* For Error */
+#include <stdio.h>
+#include "splinefont.h"
+#include <utype.h>
+#include <ustring.h>
+#include <time.h>
+#include <math.h>
+
+#include <sys/types.h> /* For stat */
+#include <sys/stat.h>
+#include <unistd.h>
+
+#ifdef __CygWin
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+#endif
+
+static void *mygets(FILE *file,char *buffer,int size) {
+ char *end = buffer+size-1;
+ char *pt = buffer;
+ int ch;
+
+ while ( (ch=getc(file))!=EOF && ch!='\r' && ch!='\n' && pt<end )
+ *pt++ = ch;
+ *pt = '\0';
+ if ( ch==EOF && pt==buffer )
+return( NULL );
+ if ( ch=='\r' ) {
+ ch = getc(file);
+ if ( ch!='\n' )
+ ungetc(ch,file);
+ }
+return( buffer );
+}
+
+/* ************************************************************************** */
+/* **************************** Reading AFM files *************************** */
+/* ************************************************************************** */
+static void KPInsert( SplineChar *sc1, SplineChar *sc2, int off, int isv ) {
+ KernPair *kp;
+ int32 script;
+
+ if ( sc1!=NULL && sc2!=NULL ) {
+ for ( kp=sc1->kerns; kp!=NULL && kp->sc!=sc2; kp = kp->next );
+ if ( kp!=NULL )
+ kp->off = off;
+ else if ( off!=0 ) {
+ kp = chunkalloc(sizeof(KernPair));
+ kp->sc = sc2;
+ kp->off = off;
+ script = SCScriptFromUnicode(sc1);
+ if ( script==DEFAULT_SCRIPT )
+ script = SCScriptFromUnicode(sc2);
+ kp->subtable = SFSubTableFindOrMake(sc1->parent,
+ isv?CHR('v','k','r','n'):CHR('k','e','r','n'),
+ script, gpos_pair);
+ if ( isv ) {
+ kp->next = sc1->vkerns;
+ sc1->vkerns = kp;
+ } else {
+ kp->next = sc1->kerns;
+ sc1->kerns = kp;
+ }
+ }
+ }
+}
+
+int LoadKerningDataFromAfm(SplineFont *sf, char *filename,EncMap *map) {
+ FILE *file = fopen(filename,"r");
+ char buffer[200], *pt, *ept, ch;
+ SplineChar *sc1, *sc2;
+ int off;
+ char name[44], second[44], lig[44], buf2[100];
+ PST *liga;
+ double scale = (sf->ascent+sf->descent)/1000.0;
+
+ if ( file==NULL )
+return( 0 );
+ ff_progress_change_line2(_("Reading AFM file"));
+ while ( mygets(file,buffer,sizeof(buffer))!=NULL ) {
+ if ( strncmp(buffer,"KPX",3)==0 || strncmp(buffer,"KPY",3)==0 ) {
+ int isv = strncmp(buffer,"KPY",3)==0;
+ for ( pt=buffer+3; isspace(*pt); ++pt);
+ for ( ept = pt; *ept!='\0' && !isspace(*ept); ++ept );
+ ch = *ept; *ept = '\0';
+ sc1 = SFGetChar(sf,-1,pt);
+ *ept = ch;
+ for ( pt=ept; isspace(*pt); ++pt);
+ for ( ept = pt; *ept!='\0' && !isspace(*ept); ++ept );
+ ch = *ept; *ept = '\0';
+ sc2 = SFGetChar(sf,-1,pt);
+ *ept = ch;
+ off = strtol(ept,NULL,10);
+ KPInsert(sc1,sc2,rint(off*scale),isv);
+ } else if ( buffer[0]=='C' && isspace(buffer[1])) {
+ char *pt;
+ sc2 = NULL;
+ for ( pt= strchr(buffer,';'); pt!=NULL; pt=strchr(pt+1,';') ) {
+ if ( sscanf( pt, "; N %40s", name )==1 )
+ sc2 = SFGetChar(sf,-1,name);
+ else if ( sc2!=NULL &&
+ sscanf( pt, "; L %40s %40s", second, lig)==2 ) {
+ sc1 = SFGetChar(sf,-1,lig);
+ if ( sc1!=NULL ) {
+ sprintf( buf2, "%s %s", name, second);
+ for ( liga=sc1->possub; liga!=NULL; liga=liga->next ) {
+ if ( liga->type == pst_ligature && strcmp(liga->u.lig.components,buf2)==0 )
+ break;
+ }
+ if ( liga==NULL ) {
+ liga = chunkalloc(sizeof(PST));
+ liga->subtable = SFSubTableFindOrMake(sf,
+ CHR('l','i','g','a'),SCScriptFromUnicode(sc2),
+ gsub_ligature);
+ liga->subtable->lookup->store_in_afm = true;
+ liga->type = pst_ligature;
+ liga->next = sc1->possub;
+ sc1->possub = liga;
+ liga->u.lig.lig = sc1;
+ liga->u.lig.components = copy( buf2 );
+ }
+ }
+ }
+ }
+ }
+ }
+ fclose(file);
+return( 1 );
+}
+
+static void CheckMMAfmFile(SplineFont *sf,char *amfm_filename,char *fontname,EncMap *map) {
+ /* the afm file should be in the same directory as the amfm file */
+ /* with the fontname as the filename */
+ char *temp, *pt;
+
+ free(sf->fontname);
+ sf->fontname = copy(fontname);
+
+ temp = galloc(strlen(amfm_filename)+strlen(fontname)+strlen(".afm")+1);
+ strcpy(temp, amfm_filename);
+ pt = strrchr(temp,'/');
+ if ( pt==NULL ) pt = temp;
+ else ++pt;
+ strcpy(pt,fontname);
+ pt += strlen(pt);
+ strcpy(pt,".afm");
+ if ( !LoadKerningDataFromAfm(sf,temp,map) ) {
+ strcpy(pt,".AFM");
+ LoadKerningDataFromAfm(sf,temp,map);
+ }
+ free(temp);
+}
+
+int LoadKerningDataFromAmfm(SplineFont *sf, char *filename,EncMap *map) {
+ FILE *file=NULL;
+ char buffer[280], *pt, lastname[257];
+ int index, i;
+ MMSet *mm = sf->mm;
+
+ if ( mm!=NULL )
+ file = fopen(filename,"r");
+ pt = strstrmatch(filename,".amfm");
+ if ( pt!=NULL ) {
+ char *afmname = copy(filename);
+ strcpy(afmname+(pt-filename),isupper(pt[1])?".AFM":".afm");
+ LoadKerningDataFromAfm(mm->normal,afmname,map);
+ free(afmname);
+ }
+ if ( file==NULL )
+return( 0 );
+
+ ff_progress_change_line2(_("Reading AFM file"));
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( strstrmatch(buffer,"StartMaster")!=NULL )
+ break;
+ }
+ index = -1; lastname[0] = '\0';
+ while ( fgets(buffer,sizeof(buffer),file)!=NULL ) {
+ if ( strstrmatch(buffer,"EndMaster")!=NULL ) {
+ if ( lastname[0]!='\0' && index!=-1 && index<mm->instance_count )
+ CheckMMAfmFile(mm->instances[index],filename,lastname,map);
+ index = -1; lastname[0] = '\0';
+ } else if ( sscanf(buffer,"FontName %256s", lastname )== 1 ) {
+ /* Do Nothing, all done */
+ } else if ( (pt = strstr(buffer,"WeightVector"))!=NULL ) {
+ pt += strlen("WeightVector");
+ while ( *pt==' ' || *pt=='[' ) ++pt;
+ i = 0;
+ while ( *pt!=']' && *pt!='\0' ) {
+ if ( *pt=='0' )
+ ++i;
+ else if ( *pt=='1' ) {
+ index = i;
+ break;
+ }
+ ++pt;
+ }
+ }
+ }
+ fclose(file);
+return( true );
+}
+
+int CheckAfmOfPostscript(SplineFont *sf,char *psname, EncMap *map) {
+ char *new, *pt;
+ int ret;
+ int wasuc=false;
+
+ new = galloc(strlen(psname)+6);
+ strcpy(new,psname);
+ pt = strrchr(new,'.');
+ if ( pt==NULL ) pt = new+strlen(new);
+ else wasuc = isupper(pt[1]);
+
+ if ( sf->mm!=NULL ) {
+ strcpy(pt,wasuc?".AMFM":".amfm");
+ if ( !LoadKerningDataFromAmfm(sf,new,map)) {
+ strcpy(pt,wasuc?".amfm":".AMFM");
+ ret = LoadKerningDataFromAmfm(sf,new,map);
+ } else
+ ret = true;
+ /* The above routine reads from the afm file if one exist */
+ } else {
+ strcpy(pt,wasuc?".AFM":".afm");
+ if ( !LoadKerningDataFromAfm(sf,new,map)) {
+ strcpy(pt,wasuc?".afm":".AFM");
+ ret = LoadKerningDataFromAfm(sf,new,map);
+ } else
+ ret = true;
+ }
+ free(new);
+return( ret );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinestroke.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c
index 468c50d790a..ad73a9194c6 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splinestroke.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinestroke.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -27,10 +27,7 @@
#include "pfaedit.h"
#include "splinefont.h"
#include <math.h>
-#if defined(FONTFORGE_CONFIG_GTK)
-#else
#include <gwidget.h>
-#endif
#define PI 3.1415926535897932
@@ -331,6 +328,24 @@ static SplinePoint *ChordMid(double angle,BasePoint *center,BasePoint *from,
return( sp );
}
+static int IntersectionTooFar(BasePoint *inter,SplinePoint *from,SplinePoint *to,StrokeInfo *si) {
+ /* Things look really ugly when we try to miter acute angles -- we get */
+ /* huge spikes. So if mitering is going to give bad results, just bevel */
+ double len, xoff, yoff;
+
+ xoff = inter->x-from->me.x; yoff = inter->y-from->me.y;
+ len = xoff*xoff + yoff*yoff;
+ if ( len > (5*si->radius * 5*si->radius) )
+return( true );
+
+ xoff = inter->x-to->me.x; yoff = inter->y-to->me.y;
+ len = xoff*xoff + yoff*yoff;
+ if ( len > (5*si->radius * 5*si->radius) )
+return( true );
+
+return( false );
+}
+
static void MakeJoints(SplinePoint *from,SplinePoint *to,StrokeInfo *si,
BasePoint *inter, BasePoint *center,
int incr,double pangle, double nangle, real factor) {
@@ -364,13 +379,15 @@ static void MakeJoints(SplinePoint *from,SplinePoint *to,StrokeInfo *si,
}
SplineMake3(mid,to);
}
- } else if ( si->join==lj_bevel ) {
- SplineMake3(from,to);
- } else if ( si->join == lj_miter ) {
+ } else if ( si->join == lj_miter && !IntersectionTooFar(inter,from,to,si)) {
mid = SplinePointCreate(inter->x,inter->y);
mid->pointtype = pt_corner;
SplineMake3(from,mid);
SplineMake3(mid,to);
+ if ( from->ptindex == to->ptindex )
+ mid->ptindex = from->ptindex;
+ } else if ( si->join==lj_bevel ) {
+ SplineMake3(from,to);
} else {
double cplen = CircleCpDist(nangle-pangle);
mid = NULL;
@@ -444,52 +461,6 @@ return( pptval!=-1 || mmtval!=-1 || pmtval!=-1 || mptval==-1 );
#define BasePtDistance(pt1, pt2) sqrt(((pt1)->x-(pt2)->x)*((pt1)->x-(pt2)->x) + ((pt1)->y-(pt2)->y)*((pt1)->y-(pt2)->y))
-#if 0
-static int PointToSplineLessThan(BasePoint *test,Spline *against,real radius) {
- BasePoint here;
- double t;
- double xdiff,ydiff, delta;
-
- if ( BasePtDistance(test,&against->from->me)<=radius+.01 )
-return( true );
- if ( BasePtDistance(test,&against->to->me)<=radius+.01 )
-return( true );
- if ( (xdiff = against->from->me.x-against->to->me.x)<0 ) xdiff = -xdiff;
- if ( (ydiff = against->from->me.y-against->to->me.y)<0 ) ydiff = -ydiff;
- delta = radius/(2*(xdiff+ydiff));
- if ( delta<.0625 ) delta = .0625;
- for ( t=delta; t<.99999 ; t+=delta ) {
- here.x = ((against->splines[0].a*t+against->splines[0].b)*t+against->splines[0].c)*t+against->splines[0].d;
- here.y = ((against->splines[1].a*t+against->splines[1].b)*t+against->splines[1].c)*t+against->splines[1].d;
- if ( BasePtDistance(test,&here)<=radius )
-return( true );
- }
-return( false );
-}
-
-static int EntirelyWithin(SplinePoint *start,Spline *s,int dir,real radius) {
- /* Return whether every point along the splines starting at start is */
- /* within radius of some point along the spline s */
- Spline *test = dir ? start->next : start->prev;
- BasePoint here;
- double t;
-
- while ( test!=NULL ) {
- if ( !PointToSplineLessThan(&test->from->me,s,radius) ||
- !PointToSplineLessThan(&test->to->me,s,radius))
-return( false );
- for ( t=.125; t<.99999 ; t+=.125 ) {
- here.x = ((test->splines[0].a*t+test->splines[0].b)*t+test->splines[0].c)*t+test->splines[0].d;
- here.y = ((test->splines[1].a*t+test->splines[1].b)*t+test->splines[1].c)*t+test->splines[1].d;
- if ( !PointToSplineLessThan(&test->to->me,s,radius))
-return( false );
- }
- if ( dir ) test = test->to->next;
- else test = test->from->prev;
- }
-return( true );
-}
-#endif
static SplinePoint *MergeSplinePoint(SplinePoint *sp1,SplinePoint *sp2) {
/* sp1 and sp2 should be close together, use their average for the */
@@ -858,6 +829,7 @@ static int DoIntersect_Splines(struct strokedspline *before,
after->minusfrom = SplineCopyAfter(afterat,&after->minusto);
SplineFreeBetween(before->minusfrom,before->minusto,false/*keep minusfrom*/,true);
before->minusto = SplinePointCreate(afterat->me.x,afterat->me.y);
+ before->minusto->ptindex = afterat->ptindex;
before->minusfrom->nextcp = before->minusfrom->me;
before->minusfrom->nonextcp = true;
SplineMake3(before->minusfrom,before->minusto); /* This line goes backwards */
@@ -884,6 +856,7 @@ static int DoIntersect_Splines(struct strokedspline *before,
/* No intersection everything can stay as it is */
if ( force_connect && BasePtDistance(&after->minusfrom->me,&before->minusto->me)>3 ) {
beforeat = SplinePointCreate(after->minusfrom->me.x,after->minusfrom->me.y);
+ beforeat->ptindex = after->minusfrom->ptindex;
if ( si->join==lj_round )
SplineMakeRound(before->minusto,beforeat,si->radius);
else
@@ -899,7 +872,7 @@ static int DoIntersect_Splines(struct strokedspline *before,
si->gottoobig = si->gottoobiglocal = true;
if ( !si->toobigwarn ) {
si->toobigwarn = true;
- gwwv_post_error( _("Bad Stroke"), _("The stroke width is so big that the generated path\nmay intersect itself in %.100s"),
+ ff_post_error( _("Bad Stroke"), _("The stroke width is so big that the generated path\nmay intersect itself in %.100s"),
sc==NULL?"<nameless char>": sc->name );
}
}
@@ -999,7 +972,6 @@ static int SplineSolveForPen(Spline *s,StrokeInfo *si,double *ts,int *pinners,
Spline1D *xsp = &s->splines[0], *ysp = &s->splines[1];
BasePoint pp, pm, np, nm, testp, testm;
- a =0;b =0;c =0;
ts[cnt++] = tstart;
for ( i=0; i<2; ++i ) {
if ( i==0 ) {
@@ -1056,40 +1028,6 @@ return(cnt);
return( cnt );
}
-#if 0
-static void SplineSetFixRidiculous(SplineSet *ss) {
- /* Make sure we don't have any splines with ridiculous control points */
- /* No control point, when projected onto the vector between the two */
- /* end points should be far beyond either of the end points... */
- Spline *s, *first;
- double vx, vy, test, end;
- int unreasonable;
-
- first = NULL;
- for ( s=ss->first->next; s!=NULL && s!=first; s = s->to->next ) {
- if ( first==NULL ) first = s;
- vx = s->to->me.x-s->from->me.x; vy = s->to->me.y-s->from->me.y;
- end = vx*vx + vy*vy;
- unreasonable = false;
- test = vx*(s->from->nextcp.x-s->from->me.x) +
- vy*(s->from->nextcp.y-s->from->me.y);
- if ( test<-2*end || test>2*end ) {
- s->from->nextcp = s->from->me;
- s->from->nonextcp = true;
- unreasonable = true;
- }
- test = vx*(s->to->prevcp.x-s->from->me.x) +
- vy*(s->to->prevcp.y-s->from->me.y);
- if ( test<-2*end || test>2*end ) {
- s->to->prevcp = s->to->me;
- s->to->noprevcp = true;
- unreasonable = true;
- }
- if ( unreasonable )
- SplineRefigure(s);
- }
-}
-#endif
static void SplineSetFixCPs(SplineSet *ss) {
SplinePoint *sp;
@@ -1105,33 +1043,14 @@ static void SplineSetFixCPs(SplineSet *ss) {
SPLCatagorizePoints(ss);
}
-static SplineSet *SSFixupOverlap(StrokeInfo *si,SplineChar *sc,
- SplineSet *ssplus,SplineSet *ssminus, int reversed) {
- ssplus->next = ssminus;
- ssplus = SplineSetRemoveOverlap(sc,ssplus,over_remove);
- if ( si->removeinternal || si->removeexternal ) {
- SplineSet *prev, *spl, *next;
- prev = NULL;
- for ( spl=ssplus; spl!=NULL; spl = next ) {
- int clock = SplinePointListIsClockwise(spl) ^ reversed;
- next = spl->next;
- if (( !clock && si->removeinternal ) || ( clock && si->removeexternal )) {
- SplinePointListFree(spl);
- if ( prev==NULL )
- ssplus = next;
- else
- prev->next = next;
- } else
- prev = spl;
- }
- }
-return( ssplus );
-}
-
static SplinePoint *SPNew(SplinePoint *base,BasePoint *pos,BasePoint *cp,int isnext) {
SplinePoint *sp = SplinePointCreate(pos->x,pos->y);
sp->pointtype = base->pointtype;
+ /* Embolden wants these three preserved */
+ sp->ptindex = base->ptindex;
+ sp->ttfindex = base->ttfindex;
+ sp->nextcpindex = base->nextcpindex;
if ( isnext ) {
sp->nextcp.x = pos->x + (cp->x-base->me.x);
sp->nextcp.y = pos->y + (cp->y-base->me.y);
@@ -1407,7 +1326,7 @@ static struct strokedspline *_SplineSetApprox(SplineSet *spl,StrokeInfo *si,Spli
si->gottoobig = si->gottoobiglocal = true;
if ( !si->toobigwarn ) {
si->toobigwarn = true;
- gwwv_post_error( _("Bad Stroke"), _("The stroke width is so big that the generated path\nmay intersect itself in %.100s"),
+ ff_post_error( _("Bad Stroke"), _("The stroke width is so big that the generated path\nmay intersect itself in %.100s"),
sc==NULL?"<nameless char>": sc->name );
}
}
@@ -1524,6 +1443,7 @@ static SplineSet *_SplineSetStroke(SplineSet *spl,StrokeInfo *si,SplineChar *sc)
SplineSet *ssplus, *ssminus;
int reversed = false;
struct strokedspline *head, *cur, *first, *lastp, *lastm;
+ Spline *s1, *s2;
si->gottoobiglocal = false;
@@ -1620,15 +1540,10 @@ return( ssplus );
ssplus = ssminus;
ssminus = temp;
}
- /* I can't always detect an overlap, so let's always do the remove */
- /* Sigh, no. That is still too dangerous */
- /* Note: SSFixupOverlap will remove internal/external as needed */
SplineSetReverse(ssminus);
if ( ssplus != NULL )
SplineSetReverse(ssplus);
- if ( si->removeoverlapifneeded && si->gottoobiglocal && ssplus!=NULL )
- ssplus = SSFixupOverlap(si,sc,ssplus,ssminus,reversed);
- else if ( si->removeinternal && ssplus!=NULL ) {
+ if ( si->removeinternal && ssplus!=NULL ) {
SplinePointListFree(ssminus);
} else if ( si->removeexternal ) {
SplinePointListFree(ssplus);
@@ -1643,6 +1558,10 @@ return( ssplus );
/* that doesn't work always if a contour self intersects */
/* I think it should always be correct */
}
+ /* I can't always detect an overlap, so let's always do the remove */
+ /* Sigh, no. That is still too dangerous */
+ if ( si->removeoverlapifneeded && ssplus!=NULL && SplineSetIntersect(ssplus,&s1,&s2))
+ ssplus = SplineSetRemoveOverlap(sc,ssplus,over_remove);
if ( reversed ) /* restore original, just in case we want it */
SplineSetReverse(spl);
} else if ( si->stroke_type==si_std || si->stroke_type==si_elipse )
@@ -1651,73 +1570,6 @@ return( ssplus );
return( ssplus );
}
-#if 0
-static void BisectTurners(SplineSet *spl) {
- Spline *first, *s, *next;
- double len,lenf,lent, dott,dotf;
-
- /* Also if we have a spline which turns through about 180 degrees */
- /* our approximations degrade. So bisect any such splines */
- first = NULL;
- for ( s = spl->first->next; s!=NULL && s!=first; s=next ) {
- next = s->to->next;
- if ( first==NULL ) first = s;
- len = sqrt( (s->from->me.x-s->to->me.x)*(s->from->me.x-s->to->me.x) +
- (s->from->me.y-s->to->me.y)*(s->from->me.y-s->to->me.y) );
- lenf= sqrt( (s->from->me.x-s->from->nextcp.x)*(s->from->me.x-s->from->nextcp.x) +
- (s->from->me.y-s->from->nextcp.y)*(s->from->me.y-s->from->nextcp.y) );
- dotf = ((s->from->me.x-s->to->me.x)*(s->from->me.x-s->from->nextcp.x) +
- (s->from->me.y-s->to->me.y)*(s->from->me.y-s->from->nextcp.y))/
- (len*lenf);
- lent= sqrt( (s->to->prevcp.x-s->to->me.x)*(s->to->prevcp.x-s->to->me.x) +
- (s->to->prevcp.y-s->to->me.y)*(s->to->prevcp.y-s->to->me.y) );
- dott = ((s->from->me.x-s->to->me.x)*(s->to->prevcp.x-s->to->me.x) +
- (s->from->me.y-s->to->me.y)*(s->to->prevcp.y-s->to->me.y))/
- (len*lent);
- dotf = acos(dotf); dott = acos(dott);
- if ( dotf+dott > PI/2 )
- SplineBisect(s,.5);
- }
-}
-
-void SSBisectTurners(SplineSet *spl) {
- while ( spl!=NULL ) {
- BisectTurners(spl);
- spl = spl->next;
- }
-}
-#endif
-
-#ifdef LOCAL_DEBUG
-static void touchall(SplineSet *spl) {
- SplinePoint *sp;
-
- for ( sp=spl->last; sp!=NULL; ) {
- if ( sp->prev==NULL )
- break;
- sp = sp->prev->from;
- if ( sp==spl->last )
- break;
- }
- for ( sp=spl->first; sp!=NULL; ) {
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
-}
-
-/* I know there's no prototype. It's just a useful routine to make valgrind */
-/* check consistency */
-void splstouchall(SplineSet *ss) {
- while ( ss!=NULL ) {
- touchall(ss);
- ss = ss->next;
- }
-}
-#endif
-
static SplineSet *SSRemoveUTurns(SplineSet *base, StrokeInfo *si) {
/* All too often in MetaPost output splines have tiny cps which */
/* make the slope at the end-points irrelevant when looking at */
@@ -1840,12 +1692,12 @@ static SplineSet *SSRemoveUTurns(SplineSet *base, StrokeInfo *si) {
if ( offx+offy<1 || linear ) {
s->from->nextcp = s->from->me;
s->from->nonextcp = true;
- if ( s->from->pointtype == pt_curve )
+ if ( s->from->pointtype == pt_curve || s->from->pointtype == pt_hvcurve )
s->from->pointtype = pt_corner;
if ( s->order2 ) {
s->to->prevcp = s->to->me;
s->to->noprevcp = true;
- if ( s->to->pointtype==pt_curve )
+ if ( s->to->pointtype==pt_curve || s->to->pointtype == pt_hvcurve )
s->to->pointtype = pt_corner;
}
SplineRefigure(s);
@@ -1861,12 +1713,12 @@ static SplineSet *SSRemoveUTurns(SplineSet *base, StrokeInfo *si) {
if ( offx+offy<1 || linear ) {
s->to->prevcp = s->to->me;
s->to->noprevcp = true;
- if ( s->to->pointtype==pt_curve )
+ if ( s->to->pointtype==pt_curve || s->to->pointtype == pt_hvcurve )
s->to->pointtype = pt_corner;
if ( s->order2 ) {
s->from->nextcp = s->from->me;
s->from->nonextcp = true;
- if ( s->from->pointtype == pt_curve )
+ if ( s->from->pointtype == pt_curve || s->from->pointtype == pt_hvcurve )
s->from->pointtype = pt_corner;
}
SplineRefigure(s);
@@ -1905,12 +1757,71 @@ static SplineSet *SSRemoveUTurns(SplineSet *base, StrokeInfo *si) {
}
}
-#if 0
- BisectTurners(spl);
-#endif
return( base );
}
+static void SSRemoveColinearPoints(SplineSet *ss) {
+ SplinePoint *sp, *nsp, *nnsp;
+ BasePoint dir, ndir;
+ double len;
+ int removed;
+
+ sp = ss->first;
+ if ( sp->prev==NULL )
+return;
+ nsp = sp->next->to;
+ if ( nsp==sp )
+return;
+ dir.x = nsp->me.x - sp->me.x; dir.y = nsp->me.y - sp->me.y;
+ len = dir.x*dir.x + dir.y*dir.y;
+ if ( len!=0 ) {
+ len = sqrt(len);
+ dir.x /= len; dir.y /= len;
+ }
+ nnsp = nsp->next->to;
+ if ( nnsp==sp )
+return;
+ memset(&ndir,0,sizeof(ndir));
+ forever {
+ removed = false;
+ if ( nsp->next->islinear ) {
+ ndir.x = nnsp->me.x - nsp->me.x; ndir.y = nnsp->me.y - nsp->me.y;
+ len = ndir.x*ndir.x + ndir.y*ndir.y;
+ if ( len!=0 ) {
+ len = sqrt(len);
+ ndir.x /= len; ndir.y /= len;
+ }
+ }
+ if ( sp->next->islinear && nsp->next->islinear ) {
+ double dot =dir.x*ndir.y - dir.y*ndir.x;
+ if ( dot<.001 && dot>-.001 ) {
+ sp->next->to = nnsp;
+ nnsp->prev = sp->next;
+ SplineRefigure(sp->next);
+ SplineFree(nsp->next);
+ SplinePointFree(nsp);
+ if ( ss->first==nsp ) ss->first = sp;
+ if ( ss->last ==nsp ) ss->last = sp;
+ removed = true;
+ } else
+ sp = nsp;
+ } else
+ sp = nsp;
+ dir = ndir;
+ nsp = nnsp;
+ nnsp = nsp->next->to;
+ if ( !removed && sp==ss->first )
+ break;
+ }
+}
+
+static void SSesRemoveColinearPoints(SplineSet *ss) {
+ while ( ss!=NULL ) {
+ SSRemoveColinearPoints(ss);
+ ss = ss->next;
+ }
+}
+
SplineSet *SplineSetStroke(SplineSet *spl,StrokeInfo *si,SplineChar *sc) {
SplineSet *ret, *temp, *temp2;
SplineSet *order3 = NULL;
@@ -1954,34 +1865,11 @@ SplineSet *SplineSetStroke(SplineSet *spl,StrokeInfo *si,SplineChar *sc) {
SplinePointListFree(order3);
ret = temp;
}
+ /* We tend to get (small) rounding errors */
+ SplineSetsRound2Int(ret,1024.,false,false);
+ /* If we use butt line caps or miter joins then we will likely have */
+ /* some spurious colinear points. If we do, remove them */
+ SSesRemoveColinearPoints(ret);
return( ret );
}
- /* for angles between [penangle,penangle+90] use (-r,t/2) rotated by penangle */
- /* [penangle+90,penangle+180] use (-r,-t/2) */
- /* [penangle+180,penangle+270] use (r,-t/2) */
- /* [penangle+270,penangle] use (r,t/2) */
-
-SplineSet *SSStroke(SplineSet *spl,StrokeInfo *si,SplineChar *sc) {
- SplineSet *head=NULL, *last=NULL, *cur;
- /*int was_clock = true;*/
-
- for ( ; spl!=NULL; spl = spl->next ) {
-#if 0
- if ( si->removeinternal || si->removeexternal )
- was_clock = SplinePointListIsClockwise(spl);
-#endif
- cur = SplineSetStroke(spl,si,sc);
- if ( head==NULL )
- head = cur;
- else
- last->next = cur;
-#if 0
- if ( was_clock==0 ) /* there'd better be only one spl in cur */
- SplineSetReverse(cur);
-#endif
- while ( cur->next!=NULL ) cur = cur->next;
- last = cur;
- }
-return( head );
-}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineutil.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
index 173d2d4ad68..195c1f0536f 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineutil.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -24,14 +24,12 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "pfaeditui.h"
+#include "fontforgevw.h"
#include <math.h>
#include "psfont.h"
#include "ustring.h"
#include "utype.h"
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
#include "views.h" /* for FindSel structure */
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h> /* Solaris defines isnan in ieeefp rather than math.h */
#endif
@@ -101,7 +99,7 @@ return( gcalloc(1,size));
if ( size&(CHUNK_UNIT-1) )
size = (size+CHUNK_UNIT-1)&~(CHUNK_UNIT-1);
- if ( (size&(CHUNK_UNIT-1)) || size>=CHUNK_MAX*CHUNK_UNIT || size<=sizeof(struct chunk)) {
+ if ( (size&(CHUNK_UNIT-1)) || size>=(int)(CHUNK_MAX*CHUNK_UNIT) || size<=(int)sizeof(struct chunk)) {
fprintf( stderr, "Attempt to allocate something of size %d\n", size );
return( gcalloc(1,size));
}
@@ -148,7 +146,7 @@ return;
if ( size&(CHUNK_UNIT-1) )
size = (size+CHUNK_UNIT-1)&~(CHUNK_UNIT-1);
- if ( (size&(CHUNK_UNIT-1)) || size>=CHUNK_MAX*CHUNK_UNIT || size<=sizeof(struct chunk)) {
+ if ( (size&(CHUNK_UNIT-1)) || size>=(int)(CHUNK_MAX*CHUNK_UNIT) || size<=(int)sizeof(struct chunk)) {
fprintf( stderr, "Attempt to free something of size %d\n", size );
free(item);
} else {
@@ -187,7 +185,7 @@ char *strconcat3(const char *str1,const char *str2, const char *str3) {
char *ret = galloc(len1+len2+strlen(str3)+1);
strcpy(ret,str1);
strcpy(ret+len1,str2);
- strcpy(ret+len1+len2,str2);
+ strcpy(ret+len1+len2,str3);
return( ret );
}
@@ -283,6 +281,27 @@ return;
}
}
+void SplineSetBeziersClear(SplinePointList *spl) {
+ Spline *first, *spline, *next;
+ int nonext;
+
+ if ( spl==NULL )
+return;
+ if ( spl->first!=NULL ) {
+ nonext = spl->first->next==NULL;
+ first = NULL;
+ for ( spline = spl->first->next; spline!=NULL && spline!=first; spline = next ) {
+ next = spline->to->next;
+ SplinePointFree(spline->to);
+ SplineFree(spline);
+ if ( first==NULL ) first = spline;
+ }
+ if ( spl->last!=spl->first || nonext )
+ SplinePointFree(spl->first);
+ }
+ spl->first = spl->last = NULL;
+}
+
void SplinePointListFree(SplinePointList *spl) {
Spline *first, *spline, *next;
int nonext;
@@ -301,6 +320,7 @@ return;
if ( spl->last!=spl->first || nonext )
SplinePointFree(spl->first);
}
+ free(spl->contour_name);
chunkfree(spl,sizeof(SplinePointList));
}
@@ -322,6 +342,7 @@ return;
if ( freefirst )
SplinePointMDFree(sc,spl->first);
}
+ free(spl->contour_name);
chunkfree(spl,sizeof(SplinePointList));
}
@@ -355,7 +376,6 @@ void ImageListsFree(ImageList *imgs) {
}
void RefCharFree(RefChar *ref) {
-#ifdef FONTFORGE_CONFIG_TYPE3
int i;
if ( ref==NULL )
@@ -365,26 +385,13 @@ return;
ImageListsFree(ref->layers[i].images);
}
free(ref->layers);
-#else
- if ( ref==NULL )
-return;
- SplinePointListsFree(ref->layers[0].splines);
-#endif
chunkfree(ref,sizeof(RefChar));
}
RefChar *RefCharCreate(void) {
RefChar *ref = chunkalloc(sizeof(RefChar));
-#ifdef FONTFORGE_CONFIG_TYPE3
- ref->layers = gcalloc(1,sizeof(struct reflayer));
- ref->layers[0].fill_brush.opacity = ref->layers[0].stroke_pen.brush.opacity = 1.0;
- ref->layers[0].fill_brush.col = ref->layers[0].stroke_pen.brush.col = COLOR_INHERITED;
- ref->layers[0].stroke_pen.width = WIDTH_INHERITED;
- ref->layers[0].stroke_pen.linecap = lc_inherited;
- ref->layers[0].stroke_pen.linejoin = lj_inherited;
- ref->layers[0].dofill = true;
-#endif
ref->layer_cnt = 1;
+ ref->layers = gcalloc(1,sizeof(struct reflayer));
ref->round_translation_to_grid = true;
return( ref );
}
@@ -399,197 +406,36 @@ void RefCharsFree(RefChar *ref) {
}
}
-static extended SolveCubic(extended a, extended b, extended c, extended d, double err, extended t0) {
- /* find t between t0 and .5 where at^3+bt^2+ct+d == +/- err */
- extended t, val, offset;
- int first;
-
- offset=a;
- if ( a<0 ) offset = -a;
- if ( b<0 ) offset -= b; else offset += b;
- if ( c<0 ) offset -= c; else offset += c;
- offset += 1; /* Make sure it isn't 0 */
- offset = err/(10.*offset);
- if ( offset<.00001 ) offset = .00001; else if ( offset>.01 ) offset = .01;
-
- first = 1;
- for ( t=t0+offset; t<.5; t += offset ) {
- val = ((a*t+b)*t+c)*t+d;
- if ( val>=err || val<=-err )
- break;
- first = 0;
- }
- if ( !first )
- t -= offset;
- if ( t>.5 ) t=.5;
-
-return( t );
-}
-
-static extended SolveCubicBack(extended a, extended b, extended c, extended d, double err, extended t0) {
- /* find t between .5 and t0 where at^3+bt^2+ct+d == +/- err */
- extended t, val, offset;
- int first;
-
- offset=a;
- if ( a<0 ) offset = -a;
- if ( b<0 ) offset -= b; else offset += b;
- if ( c<0 ) offset -= c; else offset += c;
- offset += 1; /* Make sure it isn't 0 */
- offset = err/(10.*offset);
- if ( offset<.00001 ) offset = .00001; else if ( offset>.01 ) offset = .01;
-
- first = 1;
- for ( t=t0-offset; t>.5; t -= offset ) {
- val = ((a*t+b)*t+c)*t+d;
- if ( val>=err || val<=-err )
- break;
- first = 0;
- }
- if ( !first )
- t -= offset;
- if ( t<.5 ) t=.5;
-
-return( t );
-}
-
-/* Remove line segments which are just one point long */
-/* Merge colinear line segments */
-/* Merge two segments each of which involves a single pixel change in one dimension (cut corners) */
-static void SimplifyLineList(LineList *prev) {
- LineList *next, *lines;
- if ( prev->next==NULL )
-return;
- lines = prev->next;
- while ( (next = lines->next)!=NULL ) {
- if ( (prev->here.x==lines->here.x && prev->here.y == lines->here.y ) ||
- ( prev->here.x==lines->here.x && lines->here.x==next->here.x ) ||
- ( prev->here.y==lines->here.y && lines->here.y==next->here.y ) ||
- (( prev->here.x==next->here.x+1 || prev->here.x==next->here.x-1 ) &&
- ( prev->here.y==next->here.y+1 || prev->here.y==next->here.y-1 )) ) {
- lines->here = next->here;
- lines->next = next->next;
- chunkfree(next,sizeof(*next));
- } else {
- prev = lines;
- lines = next;
- }
- }
- if ( prev!=NULL &&
- prev->here.x==lines->here.x && prev->here.y == lines->here.y ) {
- prev->next = lines->next;
- chunkfree(lines,sizeof(*lines));
- lines = prev->next;
- }
-
- if ( lines!=NULL ) while ( (next = lines->next)!=NULL ) {
- if ( prev->here.x!=next->here.x ) {
- double slope = (next->here.y-prev->here.y) / (double) (next->here.x-prev->here.x);
- double inter = prev->here.y - slope*prev->here.x;
- int y = rint(lines->here.x*slope + inter);
- if ( y == lines->here.y ) {
- lines->here = next->here;
- lines->next = next->next;
- chunkfree(next,sizeof(*next));
- } else
- lines = next;
- } else
- lines = next;
- }
-}
-
-LinearApprox *SplineApproximate(Spline *spline, real scale) {
- LinearApprox *test;
- LineList *cur, *last=NULL, *prev;
- double tx,ty,t;
- double slpx, slpy;
- double intx, inty;
-
- for ( test = spline->approx; test!=NULL && test->scale!=scale; test = test->next );
- if ( test!=NULL )
-return( test );
-
- test = chunkalloc(sizeof(LinearApprox));
- test->scale = scale;
- test->next = spline->approx;
- spline->approx = test;
-
- cur = chunkalloc(sizeof(LineList) );
- cur->here.x = rint(spline->from->me.x*scale);
- cur->here.y = rint(spline->from->me.y*scale);
- test->lines = last = cur;
- if ( spline->knownlinear ) {
- cur = chunkalloc(sizeof(LineList) );
- cur->here.x = rint(spline->to->me.x*scale);
- cur->here.y = rint(spline->to->me.y*scale);
- last->next = cur;
+typedef struct spline1 {
+ Spline1D sp;
+ real s0, s1;
+ real c0, c1;
+} Spline1;
+
+static void FigureSpline1(Spline1 *sp1,bigreal t0, bigreal t1, Spline1D *sp ) {
+ bigreal s = (t1-t0);
+ if ( sp->a==0 && sp->b==0 ) {
+ sp1->sp.d = sp->d + t0*sp->c;
+ sp1->sp.c = s*sp->c;
+ sp1->sp.b = sp1->sp.a = 0;
} else {
- /* find t so that (xt,yt) is a half pixel off from (cx*t+dx,cy*t+dy) */
- /* min t of scale*(ax*t^3+bx*t^2)==.5, scale*(ay*t^3+by*t^2)==.5 */
- /* I do this from both ends in. this is because I miss essential */
- /* symmetry if I go from one end to the other. */
- /* first start at 0 and go to .5, the first linear approximation is easy */
- /* it's just the function itself ignoring higher orders, so the error*/
- /* is just the higher orders */
- tx = SolveCubic(spline->splines[0].a,spline->splines[0].b,0,0,.5/scale,0);
- ty = SolveCubic(spline->splines[1].a,spline->splines[1].b,0,0,.5/scale,0);
- t = (tx<ty)?tx:ty;
- cur = chunkalloc(sizeof(LineList) );
- cur->here.x = rint( (((spline->splines[0].a*t+spline->splines[0].b)*t+spline->splines[0].c)*t + spline->splines[0].d)*scale );
- cur->here.y = rint( (((spline->splines[1].a*t+spline->splines[1].b)*t+spline->splines[1].c)*t + spline->splines[1].d)*scale );
- last->next = cur;
- last = cur;
- while ( t<.5 ) {
- slpx = (3*spline->splines[0].a*t+2*spline->splines[0].b)*t+spline->splines[0].c;
- slpy = (3*spline->splines[1].a*t+2*spline->splines[1].b)*t+spline->splines[1].c;
- intx = ((spline->splines[0].a*t+spline->splines[0].b)*t+spline->splines[0].c-slpx)*t + spline->splines[0].d;
- inty = ((spline->splines[1].a*t+spline->splines[1].b)*t+spline->splines[1].c-slpy)*t + spline->splines[1].d;
- tx = SolveCubic(spline->splines[0].a,spline->splines[0].b,spline->splines[0].c-slpx,spline->splines[0].d-intx,.5/scale,t);
- ty = SolveCubic(spline->splines[1].a,spline->splines[1].b,spline->splines[1].c-slpy,spline->splines[1].d-inty,.5/scale,t);
- t = (tx<ty)?tx:ty;
- cur = chunkalloc(sizeof(LineList));
- cur->here.x = rint( (((spline->splines[0].a*t+spline->splines[0].b)*t+spline->splines[0].c)*t + spline->splines[0].d)*scale );
- cur->here.y = rint( (((spline->splines[1].a*t+spline->splines[1].b)*t+spline->splines[1].c)*t + spline->splines[1].d)*scale );
- last->next = cur;
- last = cur;
- }
-
- /* Now start at t=1 and work back to t=.5 */
- prev = NULL;
- cur = chunkalloc(sizeof(LineList) );
- cur->here.x = rint(spline->to->me.x*scale);
- cur->here.y = rint(spline->to->me.y*scale);
- prev = cur;
- t=1.0;
- while ( 1 ) {
- slpx = (3*spline->splines[0].a*t+2*spline->splines[0].b)*t+spline->splines[0].c;
- slpy = (3*spline->splines[1].a*t+2*spline->splines[1].b)*t+spline->splines[1].c;
- intx = ((spline->splines[0].a*t+spline->splines[0].b)*t+spline->splines[0].c-slpx)*t + spline->splines[0].d;
- inty = ((spline->splines[1].a*t+spline->splines[1].b)*t+spline->splines[1].c-slpy)*t + spline->splines[1].d;
- tx = SolveCubicBack(spline->splines[0].a,spline->splines[0].b,spline->splines[0].c-slpx,spline->splines[0].d-intx,.5/scale,t);
- ty = SolveCubicBack(spline->splines[1].a,spline->splines[1].b,spline->splines[1].c-slpy,spline->splines[1].d-inty,.5/scale,t);
- t = (tx>ty)?tx:ty;
- cur = chunkalloc(sizeof(LineList) );
- cur->here.x = rint( (((spline->splines[0].a*t+spline->splines[0].b)*t+spline->splines[0].c)*t + spline->splines[0].d)*scale );
- cur->here.y = rint( (((spline->splines[1].a*t+spline->splines[1].b)*t+spline->splines[1].c)*t + spline->splines[1].d)*scale );
- cur->next = prev;
- prev = cur;
- if ( t<=.5 )
- break;
- }
- last->next = cur;
- SimplifyLineList(test->lines);
- }
- if ( test->lines->next==NULL ) {
- test->oneline = 1;
- test->onepoint = 1;
- } else if ( test->lines->next->next == NULL ) {
- test->oneline = 1;
+ sp1->sp.d = sp->d + t0*(sp->c + t0*(sp->b + t0*sp->a));
+ sp1->sp.c = s*(sp->c + t0*(2*sp->b + 3*sp->a*t0));
+ sp1->sp.b = s*s*(sp->b+3*sp->a*t0);
+ sp1->sp.a = s*s*s*sp->a;
+#if 0 /* Got invoked once on a perfectly good spline */
+ sp1->s1 = sp1->sp.a+sp1->sp.b+sp1->sp.c+sp1->sp.d;
+ if ( ((sp1->s1>.001 || sp1->s1<-.001) && !RealNear((double) sp1->sp.a+sp1->sp.b+sp1->sp.c+sp1->sp.d,sp1->s1)) ||
+ !RealNear(sp1->sp.d,sp1->s0))
+ IError( "Created spline does not work in FigureSpline1");
+#endif
}
-return( test );
+ sp1->c0 = sp1->sp.c/3 + sp1->sp.d;
+ sp1->c1 = sp1->c0 + (sp1->sp.b+sp1->sp.c)/3;
}
+
static void SplineFindBounds(const Spline *sp, DBounds *bounds) {
real t, b2_fourac, v;
real min, max;
@@ -668,88 +514,89 @@ static void _SplineSetFindBounds(const SplinePointList *spl, DBounds *bounds) {
}
}
+
void SplineSetFindBounds(const SplinePointList *spl, DBounds *bounds) {
memset(bounds,'\0',sizeof(*bounds));
_SplineSetFindBounds(spl,bounds);
}
-#ifdef FONTFORGE_CONFIG_TYPE3
-static void _ImageFindBounds(ImageList *img,DBounds *bounds) {
- if ( bounds->minx==0 && bounds->maxx==0 && bounds->miny==0 && bounds->maxy == 0 )
- *bounds = img->bb;
- else if ( img->bb.minx!=0 || img->bb.maxx != 0 || img->bb.maxy != 0 || img->bb.miny!=0 ) {
- if ( img->bb.minx < bounds->minx ) bounds->minx = img->bb.minx;
- if ( img->bb.miny < bounds->miny ) bounds->miny = img->bb.miny;
- if ( img->bb.maxx > bounds->maxx ) bounds->maxx = img->bb.maxx;
- if ( img->bb.maxy > bounds->maxy ) bounds->maxy = img->bb.maxy;
+static void _SplineCharLayerFindBounds(SplineChar *sc,int layer, DBounds *bounds) {
+ RefChar *rf;
+
+ for ( rf=sc->layers[layer].refs; rf!=NULL; rf = rf->next ) {
+ if ( bounds->minx==0 && bounds->maxx==0 && bounds->miny==0 && bounds->maxy == 0 )
+ *bounds = rf->bb;
+ else if ( rf->bb.minx!=0 || rf->bb.maxx != 0 || rf->bb.maxy != 0 || rf->bb.miny!=0 ) {
+ if ( rf->bb.minx < bounds->minx ) bounds->minx = rf->bb.minx;
+ if ( rf->bb.miny < bounds->miny ) bounds->miny = rf->bb.miny;
+ if ( rf->bb.maxx > bounds->maxx ) bounds->maxx = rf->bb.maxx;
+ if ( rf->bb.maxy > bounds->maxy ) bounds->maxy = rf->bb.maxy;
+ }
+ }
+ _SplineSetFindBounds(sc->layers[layer].splines,bounds);
+
+ if ( sc->parent!=NULL && sc->parent->strokedfont &&
+ (bounds->minx!=bounds->maxx || bounds->miny!=bounds->maxy)) {
+ real sw = sc->parent->strokewidth;
+ bounds->minx -= sw; bounds->miny -= sw;
+ bounds->maxx += sw; bounds->maxy += sw;
+ }
+}
+
+void SplineCharLayerFindBounds(SplineChar *sc,int layer,DBounds *bounds) {
+
+ if ( sc->parent!=NULL && sc->parent->multilayer ) {
+ SplineCharFindBounds(sc,bounds);
+return;
}
+
+ /* a char with no splines (ie. a space) must have an lbearing of 0 */
+ bounds->minx = bounds->maxx = 0;
+ bounds->miny = bounds->maxy = 0;
+
+ _SplineCharLayerFindBounds(sc,layer,bounds);
}
-#endif
void SplineCharFindBounds(SplineChar *sc,DBounds *bounds) {
- RefChar *rf;
int i;
-#ifdef FONTFORGE_CONFIG_TYPE3
- ImageList *img;
- real e;
- DBounds b;
-#endif
+ int first,last;
/* a char with no splines (ie. a space) must have an lbearing of 0 */
bounds->minx = bounds->maxx = 0;
bounds->miny = bounds->maxy = 0;
- for ( i=ly_fore; i<sc->layer_cnt; ++i ) {
- for ( rf=sc->layers[i].refs; rf!=NULL; rf = rf->next ) {
- if ( bounds->minx==0 && bounds->maxx==0 && bounds->miny==0 && bounds->maxy == 0 )
- *bounds = rf->bb;
- else if ( rf->bb.minx!=0 || rf->bb.maxx != 0 || rf->bb.maxy != 0 || rf->bb.miny!=0 ) {
- if ( rf->bb.minx < bounds->minx ) bounds->minx = rf->bb.minx;
- if ( rf->bb.miny < bounds->miny ) bounds->miny = rf->bb.miny;
- if ( rf->bb.maxx > bounds->maxx ) bounds->maxx = rf->bb.maxx;
- if ( rf->bb.maxy > bounds->maxy ) bounds->maxy = rf->bb.maxy;
- }
- }
-#ifdef FONTFORGE_CONFIG_TYPE3
- memset(&b,0,sizeof(b));
- _SplineSetFindBounds(sc->layers[i].splines,&b);
- for ( img=sc->layers[i].images; img!=NULL; img=img->next )
- _ImageFindBounds(img,bounds);
- if ( sc->layers[i].dostroke ) {
- if ( sc->layers[i].stroke_pen.width!=WIDTH_INHERITED )
- e = sc->layers[i].stroke_pen.width*sc->layers[i].stroke_pen.trans[0];
- else
- e = sc->layers[i].stroke_pen.trans[0];
- b.minx -= e; b.maxx += e;
- b.miny -= e; b.maxy += e;
- }
- if ( bounds->minx==0 && bounds->maxx==0 && bounds->miny==0 && bounds->maxy == 0 )
- *bounds = b;
- else if ( b.minx!=0 || b.maxx != 0 || b.maxy != 0 || b.miny!=0 ) {
- if ( b.minx < bounds->minx ) bounds->minx = b.minx;
- if ( b.miny < bounds->miny ) bounds->miny = b.miny;
- if ( b.maxx > bounds->maxx ) bounds->maxx = b.maxx;
- if ( b.maxy > bounds->maxy ) bounds->maxy = b.maxy;
- }
-#else
- _SplineSetFindBounds(sc->layers[i].splines,bounds);
-#endif
+ first = last = ly_fore;
+ if ( sc->parent!=NULL && sc->parent->multilayer )
+ last = sc->layer_cnt-1;
+ for ( i=first; i<=last; ++i )
+ _SplineCharLayerFindBounds(sc,i,bounds);
+}
+
+void SplineFontLayerFindBounds(SplineFont *sf,int layer,DBounds *bounds) {
+ int i, k, first, last;
+ (void)layer;
+ if ( sf->multilayer ) {
+ SplineFontFindBounds(sf,bounds);
+return;
}
- if ( sc->parent!=NULL && sc->parent->strokedfont &&
- (bounds->minx!=bounds->maxx || bounds->miny!=bounds->maxy)) {
- real sw = sc->parent->strokewidth;
- bounds->minx -= sw; bounds->miny -= sw;
- bounds->maxx += sw; bounds->maxy += sw;
+
+ bounds->minx = bounds->maxx = 0;
+ bounds->miny = bounds->maxy = 0;
+
+ for ( i = 0; i<sf->glyphcnt; ++i ) {
+ SplineChar *sc = sf->glyphs[i];
+ if ( sc!=NULL ) {
+ first = last = ly_fore;
+ if ( sc->parent != NULL && sc->parent->multilayer )
+ last = sc->layer_cnt-1;
+ for ( k=first; k<=last; ++k )
+ _SplineCharLayerFindBounds(sc,k,bounds);
+ }
}
}
void SplineFontFindBounds(SplineFont *sf,DBounds *bounds) {
- RefChar *rf;
- int i, k;
-#ifdef FONTFORGE_CONFIG_TYPE3
- real extra=0,e;
- ImageList *img;
-#endif
+ int i, k, first, last;
bounds->minx = bounds->maxx = 0;
bounds->miny = bounds->maxy = 0;
@@ -757,40 +604,16 @@ void SplineFontFindBounds(SplineFont *sf,DBounds *bounds) {
for ( i = 0; i<sf->glyphcnt; ++i ) {
SplineChar *sc = sf->glyphs[i];
if ( sc!=NULL ) {
- for ( k=ly_fore; k<sc->layer_cnt; ++k ) {
- for ( rf=sc->layers[k].refs; rf!=NULL; rf = rf->next ) {
- if ( bounds->minx==0 && bounds->maxx==0 && bounds->miny==0 && bounds->maxy == 0 )
- *bounds = rf->bb;
- else if ( rf->bb.minx!=0 || rf->bb.maxx != 0 || rf->bb.maxy != 0 || rf->bb.miny!=0 ) {
- if ( rf->bb.minx < bounds->minx ) bounds->minx = rf->bb.minx;
- if ( rf->bb.miny < bounds->miny ) bounds->miny = rf->bb.miny;
- if ( rf->bb.maxx > bounds->maxx ) bounds->maxx = rf->bb.maxx;
- if ( rf->bb.maxy > bounds->maxy ) bounds->maxy = rf->bb.maxy;
- }
- }
-
- _SplineSetFindBounds(sc->layers[k].splines,bounds);
-#ifdef FONTFORGE_CONFIG_TYPE3
- for ( img=sc->layers[k].images; img!=NULL; img=img->next )
- _ImageFindBounds(img,bounds);
- if ( sc->layers[k].dostroke ) {
- if ( sc->layers[k].stroke_pen.width!=WIDTH_INHERITED )
- e = sc->layers[k].stroke_pen.width*sc->layers[k].stroke_pen.trans[0];
- else
- e = sc->layers[k].stroke_pen.trans[0];
- if ( e>extra ) extra = e;
- }
-#endif
- }
+ first = last = ly_fore;
+ if ( sf->multilayer )
+ last = sc->layer_cnt-1;
+ for ( k=first; k<=last; ++k )
+ _SplineCharLayerFindBounds(sc,k,bounds);
}
}
-#ifdef FONTFORGE_CONFIG_TYPE3
- bounds->minx -= extra; bounds->miny -= extra;
- bounds->maxx += extra; bounds->maxy += extra;
-#endif
}
-void CIDFindBounds(SplineFont *cidmaster,DBounds *bounds) {
+void CIDLayerFindBounds(SplineFont *cidmaster,int layer,DBounds *bounds) {
SplineFont *sf;
int i;
DBounds b;
@@ -799,17 +622,17 @@ void CIDFindBounds(SplineFont *cidmaster,DBounds *bounds) {
if ( cidmaster->cidmaster )
cidmaster = cidmaster->cidmaster;
if ( cidmaster->subfonts==NULL ) {
- SplineFontFindBounds(cidmaster,bounds);
+ SplineFontLayerFindBounds(cidmaster,layer,bounds);
return;
}
sf = cidmaster->subfonts[0];
- SplineFontFindBounds(sf,bounds);
+ SplineFontLayerFindBounds(sf,layer,bounds);
factor = 1000.0/(sf->ascent+sf->descent);
bounds->maxx *= factor; bounds->minx *= factor; bounds->miny *= factor; bounds->maxy *= factor;
for ( i=1; i<cidmaster->subfontcnt; ++i ) {
sf = cidmaster->subfonts[i];
- SplineFontFindBounds(sf,&b);
+ SplineFontLayerFindBounds(sf,layer,&b);
factor = 1000.0/(sf->ascent+sf->descent);
b.maxx *= factor; b.minx *= factor; b.miny *= factor; b.maxy *= factor;
if ( b.maxx>bounds->maxx ) bounds->maxx = b.maxx;
@@ -834,14 +657,12 @@ static void _SplineSetFindTop(SplineSet *ss,BasePoint *top) {
}
}
-#ifndef FONTFORGE_CONFIG_TYPE3
static void SplineSetFindTop(SplineSet *ss,BasePoint *top) {
top->y = -1e10;
_SplineSetFindTop(ss,top);
if ( top->y < -65536 ) top->y = top->x = 0;
}
-#endif
void SplineSetQuickBounds(SplineSet *ss,DBounds *b) {
SplinePoint *sp;
@@ -869,28 +690,15 @@ void SplineSetQuickBounds(SplineSet *ss,DBounds *b) {
void SplineCharQuickBounds(SplineChar *sc, DBounds *b) {
RefChar *ref;
- int i;
+ int i,first, last;
DBounds temp;
-#ifdef FONTFORGE_CONFIG_TYPE3
- real e;
- ImageList *img;
-#endif
memset(b,0,sizeof(*b));
- for ( i=ly_fore; i<sc->layer_cnt; ++i ) {
+ first = last = ly_fore;
+ if ( sc->parent!=NULL && sc->parent->multilayer )
+ last = sc->layer_cnt-1;
+ for ( i=first; i<=last; ++i ) {
SplineSetQuickBounds(sc->layers[i].splines,&temp);
-#ifdef FONTFORGE_CONFIG_TYPE3
- for ( img=sc->layers[i].images; img!=NULL; img=img->next )
- _ImageFindBounds(img,b);
- if ( sc->layers[i].dostroke && sc->layers[i].splines!=NULL ) {
- if ( sc->layers[i].stroke_pen.width!=WIDTH_INHERITED )
- e = sc->layers[i].stroke_pen.width*sc->layers[i].stroke_pen.trans[0];
- else
- e = sc->layers[i].stroke_pen.trans[0];
- temp.minx -= e; temp.maxx += e;
- temp.miny -= e; temp.maxy += e;
- }
-#endif
if ( temp.minx!=0 || temp.maxx != 0 || temp.maxy != 0 || temp.miny!=0 ) {
if ( temp.minx < b->minx ) b->minx = temp.minx;
if ( temp.miny < b->miny ) b->miny = temp.miny;
@@ -909,7 +717,8 @@ void SplineCharQuickBounds(SplineChar *sc, DBounds *b) {
}
}
}
- if ( sc->parent->strokedfont && (b->minx!=b->maxx || b->miny!=b->maxy)) {
+ if ( sc->parent!=NULL && sc->parent->strokedfont &&
+ (b->minx!=b->maxx || b->miny!=b->maxy)) {
real sw = sc->parent->strokewidth;
b->minx -= sw; b->miny -= sw;
b->maxx += sw; b->maxy += sw;
@@ -950,28 +759,15 @@ void SplineSetQuickConservativeBounds(SplineSet *ss,DBounds *b) {
void SplineCharQuickConservativeBounds(SplineChar *sc, DBounds *b) {
RefChar *ref;
- int i;
+ int i, first,last;
DBounds temp;
-#ifdef FONTFORGE_CONFIG_TYPE3
- real e;
- ImageList *img;
-#endif
memset(b,0,sizeof(*b));
- for ( i=ly_fore; i<sc->layer_cnt; ++i ) {
+ first = last = ly_fore;
+ if ( sc->parent!=NULL && sc->parent->multilayer )
+ last = sc->layer_cnt-1;
+ for ( i=first; i<=last; ++i ) {
SplineSetQuickConservativeBounds(sc->layers[i].splines,&temp);
-#ifdef FONTFORGE_CONFIG_TYPE3
- for ( img=sc->layers[i].images; img!=NULL; img=img->next )
- _ImageFindBounds(img,b);
- if ( sc->layers[i].dostroke && sc->layers[i].splines!=NULL ) {
- if ( sc->layers[i].stroke_pen.width!=WIDTH_INHERITED )
- e = sc->layers[i].stroke_pen.width*sc->layers[i].stroke_pen.trans[0];
- else
- e = sc->layers[i].stroke_pen.trans[0];
- temp.minx -= e; temp.maxx += e;
- temp.miny -= e; temp.maxy += e;
- }
-#endif
if ( temp.minx!=0 || temp.maxx != 0 || temp.maxy != 0 || temp.miny!=0 ) {
if ( temp.minx < b->minx ) b->minx = temp.minx;
if ( temp.miny < b->miny ) b->miny = temp.miny;
@@ -1017,6 +813,7 @@ void SplineFontQuickConservativeBounds(SplineFont *sf,DBounds *b) {
}
void SplinePointCatagorize(SplinePoint *sp) {
+ int oldpointtype = sp->pointtype;
sp->pointtype = pt_corner;
if ( sp->next==NULL && sp->prev==NULL )
@@ -1031,10 +828,9 @@ void SplinePointCatagorize(SplinePoint *sp) {
} else if ( sp->nonextcp && sp->noprevcp ) {
;
} else {
- BasePoint ndir, ncdir, pdir, pcdir;
+ BasePoint ndir, ncdir, ncunit, pdir, pcdir, pcunit;
double nlen, nclen, plen, pclen;
- double slop;
- double minlen;
+ double dot;
ncdir.x = sp->nextcp.x - sp->me.x; ncdir.y = sp->nextcp.y - sp->me.y;
pcdir.x = sp->prevcp.x - sp->me.x; pcdir.y = sp->prevcp.y - sp->me.y;
@@ -1049,31 +845,34 @@ void SplinePointCatagorize(SplinePoint *sp) {
pclen = sqrt(pcdir.x*pcdir.x + pcdir.y*pcdir.y);
nlen = sqrt(ndir.x*ndir.x + ndir.y*ndir.y);
plen = sqrt(pdir.x*pdir.x + pdir.y*pdir.y);
- if ( nclen!=0 ) { ncdir.x /= nclen; ncdir.y /= nclen; }
- if ( pclen!=0 ) { pcdir.x /= pclen; pcdir.y /= pclen; }
+ ncunit = ncdir; pcunit = pcdir;
+ if ( nclen!=0 ) { ncunit.x /= nclen; ncunit.y /= nclen; }
+ if ( pclen!=0 ) { pcunit.x /= pclen; pcunit.y /= pclen; }
if ( nlen!=0 ) { ndir.x /= nlen; ndir.y /= nlen; }
if ( plen!=0 ) { pdir.x /= plen; pdir.y /= plen; }
- /* as the cp gets closer to the base point (being bound to integer */
- /* coordinates in many cases) we need to be less precise in our defn */
- /* of colinear. */
- if ( pclen>=1 && nclen>=1 )
- minlen = pclen<nclen ? pclen : nclen;
- else if ( pclen>=1 )
- minlen = pclen;
- else
- minlen = nclen;
- if ( minlen<2 )
- slop = -.95;
- else if ( minlen<5 )
- slop = -.98;
- else
- slop = -.99;
- if ( nclen!=0 && pclen!=0 && ncdir.x*pcdir.x+ncdir.y*pcdir.y<slop )
+
+ /* find out which side has the shorter control vector. Dot that vector */
+ /* with the normal of the unit vector on the other side. If the */
+ /* result is less than 1 em-unit then we've got colinear control points */
+ /* (within the resolution of the integer grid) */
+ if ( nclen!=0 && pclen!=0 &&
+ ((nclen>=pclen && (dot = pcdir.x*ncunit.y - pcdir.y*ncunit.x)<1.0 && dot>-1.0 ) ||
+ (pclen>nclen && (dot = ncdir.x*pcunit.y - ncdir.y*pcunit.x)<1.0 && dot>-1.0 )))
sp->pointtype = pt_curve;
- else if (( nclen!=0 || plen!=0 ) &&
- (nclen==0 || ncdir.x*pdir.x+ncdir.y*pdir.y<slop ) &&
- (pclen==0 || ndir.x*pcdir.x+ndir.y*pcdir.y<slop ))
+ /* Dot product of control point with unit vector normal to line in */
+ /* opposite direction should be less than an em-unit for a tangent */
+ else if (( nclen==0 && pclen!=0 && (dot = pcdir.x*ndir.y-pcdir.y*ndir.x)<1.0 && dot>-1.0 ) ||
+ ( pclen==0 && nclen!=0 && (dot = ncdir.x*pdir.y-ncdir.y*pdir.x)<1.0 && dot>-1.0 ))
sp->pointtype = pt_tangent;
+
+ /* If a point started out hv, and could still be hv, them make it so */
+ /* but don't make hv points de novo, Alexey doesn't like change */
+ /* (this only works because hv isn't a default setting, so if it's */
+ /* there it was done intentionally) */
+ if ( sp->pointtype == pt_curve && oldpointtype == pt_hvcurve &&
+ ((sp->nextcp.x==sp->me.x && sp->prevcp.x==sp->me.x && sp->nextcp.y!=sp->me.y) ||
+ (sp->nextcp.y==sp->me.y && sp->prevcp.y==sp->me.y && sp->nextcp.x!=sp->me.x)))
+ sp->pointtype = pt_hvcurve;
}
}
@@ -1102,13 +901,7 @@ void SPLCatagorizePoints(SplinePointList *spl) {
}
void SCCatagorizePoints(SplineChar *sc) {
-#ifdef FONTFORGE_CONFIG_TYPE3
- int i;
- for ( i=ly_fore; i<sc->layer_cnt; ++i )
- SPLCatagorizePoints(sc->layers[i].splines);
-#else
SPLCatagorizePoints(sc->layers[ly_fore].splines);
-#endif
}
static int CharsNotInEncoding(FontDict *fd) {
@@ -1157,6 +950,7 @@ SplinePointList *SplinePointListCopy1(const SplinePointList *spl) {
Spline *spline;
cur = chunkalloc(sizeof(SplinePointList));
+ cur->is_clip_path = spl->is_clip_path;
for ( pt=spl->first; ; ) {
cpt = chunkalloc(sizeof(SplinePoint));
@@ -1209,10 +1003,10 @@ static SplinePointList *SplinePointListCopySelected1(SplinePointList *spl) {
start = spl->first;
if ( spl->first==spl->last ) {
- /* If it's a circle and the start point is selected then we don't know*/
- /* where that selection began (and we have to keep it with the things*/
- /* that precede it when we make the new splinesets), so loop until we*/
- /* find something unselected */
+ /* If it's a closed contour and the start point is selected then we */
+ /* don't know where that selection began (and we have to keep it with */
+ /* the things that precede it when we make the new splinesets), so */
+ /* loop until we find something unselected */
while ( start->selected )
start = start->next->to;
}
@@ -1263,6 +1057,7 @@ static SplinePointList *SplinePointListCopySelected1(SplinePointList *spl) {
return( head );
}
+
SplinePointList *SplinePointListCopy(const SplinePointList *base) {
SplinePointList *head=NULL, *last=NULL, *cur;
@@ -1307,16 +1102,18 @@ SplinePointList *SplinePointListCopySelected(SplinePointList *base) {
return( head );
}
+
+
static SplinePointList *SplinePointListSplit(SplineChar *sc,SplinePointList *spl) {
SplinePointList *head=NULL, *last=NULL, *cur;
SplinePoint *first, *start, *next;
start = spl->first;
if ( spl->first==spl->last ) {
- /* If it's a circle and the start point isnt selected then we don't know*/
- /* where that selection began (and we have to keep it with the things*/
- /* that precede it when we make the new splinesets), so loop until we*/
- /* find something selected */
+ /* If it's a closed contour and the start point is selected then we */
+ /* don't know where that selection began (and we have to keep it with */
+ /* the things that precede it when we make the new splinesets), so */
+ /* loop until we find something unselected */
while ( !start->selected )
start = start->next->to;
}
@@ -1376,25 +1173,27 @@ SplinePointList *SplinePointListRemoveSelected(SplineChar *sc,SplinePointList *b
for ( ; base!=NULL; base = next ) {
next = base->next;
anysel = false; allsel = true;
- first = NULL;
- for ( pt=base->first; pt!=NULL && pt!=first; pt = pt->next->to ) {
- if ( pt->selected ) anysel = true;
- else allsel = false;
- if ( first==NULL ) first = pt;
- if ( pt->next==NULL )
- break;
- }
+ first = NULL;
+ for ( pt=base->first; pt!=NULL && pt!=first; pt = pt->next->to ) {
+ if ( pt->selected ) anysel = true;
+ else allsel = false;
+ if ( first==NULL ) first = pt;
+ if ( pt->next==NULL )
+ break;
+ }
if ( allsel ) {
SplinePointListMDFree(sc,base);
continue;
}
- if ( head==NULL )
- head = base;
- else
- last->next = base;
- last = base;
- if ( anysel )
- last = SplinePointListSplit(sc,base);
+ if ( !anysel ) {
+ if ( head==NULL )
+ head = base;
+ else
+ last->next = base;
+ last = base;
+ if ( anysel )
+ last = SplinePointListSplit(sc,base);
+ }
}
if ( last!=NULL ) last->next = NULL;
return( head );
@@ -1417,35 +1216,6 @@ ImageList *ImageListCopy(ImageList *cimg) {
return( head );
}
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-ImageList *ImageListTransform(ImageList *img, real transform[6]) {
- ImageList *head = img;
-
- /* Don't support rotating, flipping or skewing images */;
- if ( transform[0]!=0 && transform[3]!=0 ) {
- while ( img!=NULL ) {
- double x = img->xoff;
- img->xoff = transform[0]*x + transform[2]*img->yoff + transform[4];
- img->yoff = transform[1]*x + transform[3]*img->yoff + transform[5];
- if (( img->xscale *= transform[0])<0 ) {
- img->xoff += img->xscale *
- (img->image->list_len==0?img->image->u.image:img->image->u.images[0])->width;
- img->xscale = -img->xscale;
- }
- if (( img->yscale *= transform[3])<0 ) {
- img->yoff += img->yscale *
- (img->image->list_len==0?img->image->u.image:img->image->u.images[0])->height;
- img->yscale = -img->yscale;
- }
- img->bb.minx = img->xoff; img->bb.maxy = img->yoff;
- img->bb.maxx = img->xoff + GImageGetWidth(img->image)*img->xscale;
- img->bb.miny = img->yoff - GImageGetHeight(img->image)*img->yscale;
- img = img->next;
- }
- }
-return( head );
-}
-#endif
void ApTransform(AnchorPoint *ap, real transform[6]) {
BasePoint p;
@@ -1478,6 +1248,14 @@ static void TransformPoint(SplinePoint *sp, real transform[6]) {
sp->prevcp = p;
} else
sp->prevcp = sp->me;
+ if ( sp->pointtype == pt_hvcurve ) {
+ if (
+ ((sp->nextcp.x==sp->me.x && sp->prevcp.x==sp->me.x && sp->nextcp.y!=sp->me.y) ||
+ (sp->nextcp.y==sp->me.y && sp->prevcp.y==sp->me.y && sp->nextcp.x!=sp->me.x)))
+ /* Do Nothing */;
+ else
+ sp->pointtype = pt_curve;
+ }
}
SplinePointList *SplinePointListTransform(SplinePointList *base, real transform[6], int allpoints ) {
@@ -1493,6 +1271,20 @@ SplinePointList *SplinePointListTransform(SplinePointList *base, real transform[
if ( pfirst==NULL ) pfirst = spt;
if ( allpoints || spt->selected ) {
TransformPoint(spt,transform);
+ if ( !allpoints ) {
+ if ( spt->next!=NULL && spt->next->order2 && !spt->next->to->selected && spt->next->to->ttfindex==0xffff ) {
+ SplinePoint *to = spt->next->to;
+ to->prevcp = spt->nextcp;
+ to->me.x = (to->prevcp.x+to->nextcp.x)/2;
+ to->me.y = (to->prevcp.y+to->nextcp.y)/2;
+ }
+ if ( spt->prev!=NULL && spt->prev->order2 && !spt->prev->from->selected && spt->prev->from->ttfindex==0xffff ) {
+ SplinePoint *from = spt->prev->from;
+ from->nextcp = spt->prevcp;
+ from->me.x = (from->prevcp.x+from->nextcp.x)/2;
+ from->me.y = (from->prevcp.y+from->nextcp.y)/2;
+ }
+ }
anysel = true;
} else
allsel = alldone = false;
@@ -1501,6 +1293,7 @@ SplinePointList *SplinePointListTransform(SplinePointList *base, real transform[
}
if ( !anysel ) /* This splineset had no selected points it's unchanged */
continue;
+
/* if we changed all the points then the control points are right */
/* otherwise those near the edges may be wonky, fix 'em up */
/* Figuring out where the edges of the selection are is difficult */
@@ -1510,6 +1303,12 @@ SplinePointList *SplinePointListTransform(SplinePointList *base, real transform[
pfirst = NULL;
for ( spt = spl->first ; spt!=pfirst; spt = spt->next->to ) {
if ( pfirst==NULL ) pfirst = spt;
+ if ( spt->selected && spt->prev!=NULL && !spt->prev->from->selected &&
+ spt->prev->from->pointtype == pt_tangent )
+ SplineCharTangentPrevCP(spt->prev->from);
+ if ( spt->selected && spt->next!=NULL && !spt->next->to->selected &&
+ spt->next->to->pointtype == pt_tangent )
+ SplineCharTangentNextCP(spt->next->to);
if ( spt->prev!=NULL && spt->prevcpdef )
SplineCharDefaultPrevCP(spt);
if ( spt->next==NULL )
@@ -1527,6 +1326,7 @@ SplinePointList *SplinePointListTransform(SplinePointList *base, real transform[
return( base );
}
+
SplinePointList *SplinePointListShift(SplinePointList *base,real xoff,int allpoints ) {
real transform[6];
if ( xoff==0 )
@@ -1646,15 +1446,15 @@ SplinePointList *SPLCopyTranslatedHintMasks(SplinePointList *base,
return( head );
}
-static SplinePointList *_SPLCopyTransformedHintMasks(SplineChar *subsc,real transform[6],
- SplineChar *basesc ) {
+static SplinePointList *_SPLCopyTransformedHintMasks(SplineChar *subsc,int layer,
+ real transform[6], SplineChar *basesc ) {
SplinePointList *spl, *spl2, *head, *last=NULL, *cur, *base;
SplinePoint *spt, *spt2, *pfirst;
Spline *s, *first;
real trans[6];
RefChar *rf;
- base = subsc->layers[ly_fore].splines;
+ base = subsc->layers[layer].splines;
head = SplinePointListCopy(base);
if ( head!=NULL )
for ( last = head; last->next!=NULL; last=last->next );
@@ -1677,7 +1477,7 @@ static SplinePointList *_SPLCopyTransformedHintMasks(SplineChar *subsc,real tran
if ( first==NULL ) first = s;
}
}
- for ( rf=subsc->layers[ly_fore].refs; rf!=NULL; rf=rf->next ) {
+ for ( rf=subsc->layers[layer].refs; rf!=NULL; rf=rf->next ) {
trans[0] = rf->transform[0]*transform[0] +
rf->transform[1]*transform[2];
trans[1] = rf->transform[0]*transform[1] +
@@ -1692,7 +1492,7 @@ static SplinePointList *_SPLCopyTransformedHintMasks(SplineChar *subsc,real tran
trans[5] = rf->transform[4]*transform[1] +
rf->transform[5]*transform[3] +
transform[5];
- cur = _SPLCopyTransformedHintMasks(rf->sc,trans,basesc);
+ cur = _SPLCopyTransformedHintMasks(rf->sc,layer,trans,basesc);
if ( head==NULL )
head = cur;
else
@@ -1706,12 +1506,12 @@ return( head );
}
SplinePointList *SPLCopyTransformedHintMasks(RefChar *r,
- SplineChar *basesc, BasePoint *trans ) {
+ SplineChar *basesc, BasePoint *trans,int layer ) {
real transform[6];
memcpy(transform,r->transform,sizeof(transform));
transform[4] += trans->x; transform[5] += trans->y;
-return( _SPLCopyTransformedHintMasks(r->sc,transform,basesc));
+return( _SPLCopyTransformedHintMasks(r->sc,layer,transform,basesc));
}
void SplinePointListSelect(SplinePointList *spl,int sel) {
@@ -1743,7 +1543,7 @@ return;
}
static void InstanciateReference(SplineFont *sf, RefChar *topref, RefChar *refs,
- real transform[6], SplineChar *dsc) {
+ real transform[6], SplineChar *dsc, int layer) {
real trans[6];
RefChar *rf;
SplineChar *rsc;
@@ -1788,39 +1588,12 @@ return;
trans[5] = rf->transform[4]*transform[1] +
rf->transform[5]*transform[3] +
transform[5];
- InstanciateReference(sf,topref,rf,trans,rsc);
+ InstanciateReference(sf,topref,rf,trans,rsc,layer);
}
rsc->ticked = false;
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( sf->multilayer ) {
- int lbase = topref->layer_cnt;
- if ( topref->layer_cnt==0 ) {
- topref->layers = gcalloc(rsc->layer_cnt-1,sizeof(struct reflayer));
- topref->layer_cnt = rsc->layer_cnt-1;
- } else {
- topref->layer_cnt += rsc->layer_cnt-1;
- topref->layers = grealloc(topref->layers,topref->layer_cnt*sizeof(struct reflayer));
- memset(topref->layers+lbase,0,(rsc->layer_cnt-1)*sizeof(struct reflayer));
- }
- for ( i=ly_fore; i<rsc->layer_cnt; ++i ) {
- topref->layers[i-ly_fore+lbase].splines = SplinePointListTransform(SplinePointListCopy(rsc->layers[i].splines),transform,true);
- topref->layers[i-ly_fore+lbase].fill_brush = rsc->layers[i].fill_brush;
- topref->layers[i-ly_fore+lbase].stroke_pen = rsc->layers[i].stroke_pen;
- topref->layers[i-ly_fore+lbase].dofill = rsc->layers[i].dofill;
- topref->layers[i-ly_fore+lbase].dostroke = rsc->layers[i].dostroke;
- topref->layers[i-ly_fore+lbase].fillfirst = rsc->layers[i].fillfirst;
- /* ??? and images? Can't read images yet, so not a problem yet */
- }
- } else {
- if ( topref->layer_cnt==0 ) {
- topref->layers = gcalloc(1,sizeof(struct reflayer));
- topref->layer_cnt = 1;
- }
-#else
{
-#endif
- new = SplinePointListTransform(SplinePointListCopy(rsc->layers[ly_fore].splines),transform,true);
+ new = SplinePointListTransform(SplinePointListCopy(rsc->layers[layer].splines),transform,true);
if ( new!=NULL ) {
for ( spl = new; spl->next!=NULL; spl = spl->next );
spl->next = topref->layers[0].splines;
@@ -1888,7 +1661,7 @@ char *XUIDFromFD(int xuid[20]) {
return( ret );
}
-void SplineFontMetaData(SplineFont *sf,struct fontdict *fd) {
+static void SplineFontMetaData(SplineFont *sf,struct fontdict *fd) {
int em;
sf->fontname = utf8_verify_copy(fd->cidfontname?fd->cidfontname:fd->fontname);
@@ -1992,7 +1765,7 @@ return; /* It's just the expected matrix */
}
for ( i=0; i<sf->glyphcnt; ++i ) if ( (sc=sf->glyphs[i])!=NULL ) {
for ( refs=sc->layers[ly_fore].refs; refs!=NULL; refs=refs->next )
- SCReinstanciateRefChar(sc,refs);
+ SCReinstanciateRefChar(sc,refs,ly_fore);
}
}
@@ -2006,11 +1779,11 @@ void SFInstanciateRefs(SplineFont *sf) {
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
SplineChar *sc = sf->glyphs[i];
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
+ for ( layer=ly_back; layer<sc->layer_cnt; ++layer ) {
for ( pr=NULL, refs = sc->layers[layer].refs; refs!=NULL; refs=next ) {
next = refs->next;
sc->ticked = true;
- InstanciateReference(sf, refs, refs, refs->transform,sc);
+ InstanciateReference(sf, refs, refs, refs->transform,sc,layer);
if ( refs->sc!=NULL ) {
SplineSetFindBounds(refs->layers[0].splines,&refs->bb);
sc->ticked = false;
@@ -2048,10 +1821,6 @@ static void _SplineFontFromType1(SplineFont *sf, FontDict *fd, struct pscontext
} else
map = sf->map;
sf->glyphs = gcalloc(map->backmax,sizeof(SplineChar *));
-#ifdef FONTFORGE_CONFIG_TYPE3
- if ( istype3 ) /* We read a type3 */
- sf->multilayer = true;
-#endif
if ( istype3 )
notdefpos = LookupCharString(".notdef",(struct pschars *) (fd->charprocs));
else
@@ -2116,11 +1885,7 @@ static void _SplineFontFromType1(SplineFont *sf, FontDict *fd, struct pscontext
sf->glyphs[i]->parent = sf;
/* SCLigDefault(sf->glyphs[i]);*/ /* Also reads from AFM file, but it probably doesn't exist */
}
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_progress_next();
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
SFInstanciateRefs(sf);
if ( fd->metrics!=NULL ) {
@@ -2143,7 +1908,7 @@ static void _SplineFontFromType1(SplineFont *sf, FontDict *fd, struct pscontext
/* seac to that character and a space (since I can only make */
/* real char links), so if we find a space link, get rid of*/
/* it. It's an artifact */
- SCRefToSplines(sf->glyphs[i],refs);
+ SCRefToSplines(sf->glyphs[i],refs,ly_fore);
}
}
/* sometimes (some apple oblique fonts) the fontmatrix is not just a */
@@ -2170,7 +1935,6 @@ static void SplineFontFromType1(SplineFont *sf, FontDict *fd, struct pscontext *
}
}
-#ifndef LUA_FF_LIB
static SplineFont *SplineFontFromMMType1(SplineFont *sf, FontDict *fd, struct pscontext *pscontext) {
char *pt, *end, *origweight;
MMSet *mm;
@@ -2181,11 +1945,7 @@ static SplineFont *SplineFontFromMMType1(SplineFont *sf, FontDict *fd, struct ps
if ( fd->weightvector==NULL || fd->fontinfo->blenddesignpositions==NULL ||
fd->fontinfo->blenddesignmap==NULL || fd->fontinfo->blendaxistypes==NULL ) {
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Bad Multiple Master Font"),_("Bad Multiple Master Font"));
-#else
- gwwv_post_error(_("Bad Multiple Master Font"),_("Bad Multiple Master Font"));
-#endif
+ ff_post_error(_("Bad Multiple Master Font"),_("Bad Multiple Master Font"));
SplineFontFree(sf);
return( NULL );
}
@@ -2200,7 +1960,7 @@ return( NULL );
if ( pt==end )
break;
++(pscontext->instance_count);
- if ( pscontext->instance_count>=sizeof(pscontext->blend_values)/sizeof(pscontext->blend_values[0])) {
+ if ( pscontext->instance_count>=(int)(sizeof(pscontext->blend_values)/sizeof(pscontext->blend_values[0]))) {
LogError( _("Multiple master font with more than 16 instances\n") );
break;
}
@@ -2225,7 +1985,7 @@ return( NULL );
for ( end=pt; *end!=' ' && *end!=']' && *end!='\0'; ++end );
if ( pt==end )
break;
- if ( mm->axis_count>=sizeof(mm->axes)/sizeof(mm->axes[0])) {
+ if ( mm->axis_count>=(int)(sizeof(mm->axes)/sizeof(mm->axes[0]))) {
LogError( _("Multiple master font with more than 4 axes\n") );
break;
}
@@ -2234,17 +1994,9 @@ return( NULL );
}
if ( mm->instance_count < (1<<mm->axis_count) )
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Bad Multiple Master Font"),_("This multiple master font has %1$d instance fonts, but it needs at least %2$d master fonts for %3$d axes. FontForge will not be able to edit this correctly"),mm->instance_count,1<<mm->axis_count,mm->axis_count);
-#else
- gwwv_post_error(_("Bad Multiple Master Font"),_("This multiple master font has %1$d instance fonts, but it needs at least %2$d master fonts for %3$d axes. FontForge will not be able to edit this correctly"),mm->instance_count,1<<mm->axis_count,mm->axis_count);
-#endif
+ ff_post_error(_("Bad Multiple Master Font"),_("This multiple master font has %1$d instance fonts, but it needs at least %2$d master fonts for %3$d axes. FontForge will not be able to edit this correctly"),mm->instance_count,1<<mm->axis_count,mm->axis_count);
else if ( mm->instance_count > (1<<mm->axis_count) )
-#if defined(FONTFORGE_CONFIG_GTK)
- gwwv_post_error(_("Bad Multiple Master Font"),_("This multiple master font has %1$d instance fonts, but FontForge can only handle %2$d master fonts for %3$d axes. FontForge will not be able to edit this correctly"),mm->instance_count,1<<mm->axis_count,mm->axis_count);
-#else
- gwwv_post_error(_("Bad Multiple Master Font"),_("This multiple master font has %1$d instance fonts, but FontForge can only handle %2$d master fonts for %3$d axes. FontForge will not be able to edit this correctly"),mm->instance_count,1<<mm->axis_count,mm->axis_count);
-#endif
+ ff_post_error(_("Bad Multiple Master Font"),_("This multiple master font has %1$d instance fonts, but FontForge can only handle %2$d master fonts for %3$d axes. FontForge will not be able to edit this correctly"),mm->instance_count,1<<mm->axis_count,mm->axis_count);
mm->positions = gcalloc(mm->axis_count*mm->instance_count,sizeof(real));
pt = fd->fontinfo->blenddesignpositions;
while ( *pt==' ' ) ++pt;
@@ -2412,11 +2164,11 @@ return( NULL );
return( sf );
}
-#endif
static SplineFont *SplineFontFromCIDType1(SplineFont *sf, FontDict *fd,
struct pscontext *pscontext) {
- int i,j,k, bad, uni;
+ int i,j,k, uni;
+ unsigned bad;
SplineChar **chars;
char buffer[100];
struct cidmap *map;
@@ -2431,7 +2183,7 @@ static SplineFont *SplineFontFromCIDType1(SplineFont *sf, FontDict *fd,
if ( bad!=0x80000000 || fd->cidfonttype!=0 ) {
LogError( _("Could not parse a CID font, %sCIDFontType %d, %sfonttype %d\n"),
( fd->cidfonttype!=0 ) ? "unexpected " : "",
- ( bad!=0x80000000 ) ? "unexpected " : "",
+ ( bad!=0x80000000 ) ? "unexpected " : "",
fd->cidfonttype, bad );
SplineFontFree(sf);
return( NULL );
@@ -2447,6 +2199,9 @@ return( NULL );
sf->subfontcnt = fd->fdcnt;
sf->subfonts = galloc((sf->subfontcnt+1)*sizeof(SplineFont *));
for ( i=0; i<fd->fdcnt; ++i ) {
+ if ( fd->fontmatrix[0]!=0 ) {
+ MatMultiply(fd->fontmatrix,fd->fds[i]->fontmatrix,fd->fds[i]->fontmatrix);
+ }
sf->subfonts[i] = SplineFontEmpty();
SplineFontMetaData(sf->subfonts[i],fd->fds[i]);
sf->subfonts[i]->cidmaster = sf;
@@ -2476,11 +2231,7 @@ return( NULL );
if ( chars[i]->layers[ly_fore].refs!=NULL )
IError( "Reference found in CID font. Can't fix it up");
sf->subfonts[j]->glyphcnt = sf->subfonts[j]->glyphmax = i+1;
-#if defined(FONTFORGE_CONFIG_GDRAW)
- gwwv_progress_next();
-#elif defined(FONTFORGE_CONFIG_GTK)
- gwwv_progress_next();
-#endif
+ ff_progress_next();
}
for ( i=0; i<fd->fdcnt; ++i )
sf->subfonts[i]->glyphs = gcalloc(sf->subfonts[i]->glyphcnt,sizeof(SplineChar *));
@@ -2528,154 +2279,43 @@ SplineFont *SplineFontFromPSFont(FontDict *fd) {
sf = fd->sf;
} else if ( fd->fdcnt!=0 )
sf = SplineFontFromCIDType1(sf,fd,&pscontext);
-#ifndef LUA_FF_LIB
else if ( fd->weightvector!=NULL )
SplineFontFromMMType1(sf,fd,&pscontext);
-#endif
else
SplineFontFromType1(sf,fd,&pscontext);
- if ( loaded_fonts_same_as_new && new_fonts_are_order2 &&
- fd->weightvector==NULL )
- SFConvertToOrder2(sf);
}
- if ( sf->multilayer )
- SFCheckPSBitmap(sf);
return( sf );
}
-#ifdef FONTFORGE_CONFIG_TYPE3
-static void LayerToRefLayer(struct reflayer *rl,Layer *layer) {
- rl->fill_brush = layer->fill_brush;
- rl->stroke_pen = layer->stroke_pen;
- rl->dofill = layer->dofill;
- rl->dostroke = layer->dostroke;
- rl->fillfirst = layer->fillfirst;
-}
-#endif
-
void RefCharFindBounds(RefChar *rf) {
-#ifdef FONTFORGE_CONFIG_TYPE3
- int i;
- SplineChar *rsc = rf->sc;
- real extra=0,e;
-
- memset(&rf->bb,'\0',sizeof(rf->bb));
- rf->top.y = -1e10;
- for ( i=0; i<rf->layer_cnt; ++i ) {
- _SplineSetFindBounds(rf->layers[i].splines,&rf->bb);
- _SplineSetFindTop(rf->layers[i].splines,&rf->top);
- if ( rsc->layers[i].dostroke ) {
- if ( rf->layers[i].stroke_pen.width!=WIDTH_INHERITED )
- e = rf->layers[i].stroke_pen.width*rf->layers[i].stroke_pen.trans[0];
- else
- e = rf->layers[i].stroke_pen.trans[0];
- if ( e>extra ) extra = e;
- }
- }
- if ( rf->top.y < -65536 ) rf->top.y = rf->top.x = 0;
- rf->bb.minx -= extra; rf->bb.miny -= extra;
- rf->bb.maxx += extra; rf->bb.maxy += extra;
-#else
SplineSetFindBounds(rf->layers[0].splines,&rf->bb);
SplineSetFindTop(rf->layers[0].splines,&rf->top);
-#endif
}
-void SCReinstanciateRefChar(SplineChar *sc,RefChar *rf) {
- SplinePointList *spl, *new;
+void SCReinstanciateRefChar(SplineChar *sc,RefChar *rf,int layer) {
+ SplinePointList *new, *last;
RefChar *refs;
-#ifdef FONTFORGE_CONFIG_TYPE3
- int i,j;
- SplineChar *rsc = rf->sc;
- real extra=0,e;
-
- for ( i=0; i<rf->layer_cnt; ++i )
- SplinePointListsFree(rf->layers[i].splines);
- free( rf->layers );
- rf->layers = NULL;
- rf->layer_cnt = 0;
- if ( rsc==NULL )
-return;
- /* Can be called before sc->parent is set, but only when reading a ttf */
- /* file which won't be multilayer */
- if ( sc->parent!=NULL && sc->parent->multilayer ) {
- int cnt = 0;
- RefChar *subref;
- for ( i=ly_fore; i<rsc->layer_cnt; ++i ) {
- if ( rsc->layers[i].splines!=NULL || rsc->layers[i].images!=NULL )
- ++cnt;
- for ( subref=rsc->layers[i].refs; subref!=NULL; subref=subref->next )
- cnt += subref->layer_cnt;
- }
-
- rf->layer_cnt = cnt;
- rf->layers = gcalloc(cnt,sizeof(struct reflayer));
- cnt = 0;
- for ( i=ly_fore; i<rsc->layer_cnt; ++i ) {
- if ( rsc->layers[i].splines!=NULL || rsc->layers[i].images!=NULL ) {
- rf->layers[cnt].splines =
- SplinePointListTransform(
- SplinePointListCopy(rsc->layers[i].splines),rf->transform,true);
- rf->layers[cnt].images =
- ImageListTransform(
- ImageListCopy(rsc->layers[i].images),rf->transform);
- LayerToRefLayer(&rf->layers[cnt],&rsc->layers[i]);
- ++cnt;
- }
- for ( subref=rsc->layers[i].refs; subref!=NULL; subref=subref->next ) {
- for ( j=0; j<subref->layer_cnt; ++j ) if ( subref->layers[j].images!=NULL || subref->layers[j].splines!=NULL ) {
- rf->layers[cnt] = subref->layers[j];
- rf->layers[cnt].splines =
- SplinePointListTransform(
- SplinePointListCopy(subref->layers[j].splines),rf->transform,true);
- rf->layers[cnt].images =
- ImageListTransform(
- ImageListCopy(subref->layers[j].images),rf->transform);
- ++cnt;
- }
- }
- }
-
- memset(&rf->bb,'\0',sizeof(rf->bb));
- rf->top.y = -1e10;
- for ( i=0; i<rf->layer_cnt; ++i ) {
- _SplineSetFindBounds(rf->layers[i].splines,&rf->bb);
- _SplineSetFindTop(rf->layers[i].splines,&rf->top);
- if ( rsc->layers[i].dostroke ) {
- if ( rf->layers[i].stroke_pen.width!=WIDTH_INHERITED )
- e = rf->layers[i].stroke_pen.width*rf->layers[i].stroke_pen.trans[0];
- else
- e = rf->layers[i].stroke_pen.trans[0];
- if ( e>extra ) extra = e;
- }
+ (void)sc;
+ {
+ if ( rf->layer_cnt>0 ) {
+ SplinePointListsFree(rf->layers[0].splines);
+ rf->layers[0].splines = NULL;
}
- if ( rf->top.y < -65536 ) rf->top.y = rf->top.x = 0;
- rf->bb.minx -= extra; rf->bb.miny -= extra;
- rf->bb.maxx += extra; rf->bb.maxy += extra;
- } else {
rf->layers = gcalloc(1,sizeof(struct reflayer));
rf->layer_cnt = 1;
- rf->layers[0].dofill = true;
-#else
- SplinePointListsFree(rf->layers[0].splines);
- rf->layers[0].splines = NULL;
- if ( rf->sc==NULL )
-return;
- {
-#endif
- new = SplinePointListTransform(SplinePointListCopy(rf->sc->layers[ly_fore].splines),rf->transform,true);
- if ( new!=NULL ) {
- for ( spl = new; spl->next!=NULL; spl = spl->next );
- spl->next = rf->layers[0].splines;
- rf->layers[0].splines = new;
- }
- for ( refs = rf->sc->layers[ly_fore].refs; refs!=NULL; refs = refs->next ) {
+ new = SplinePointListTransform(SplinePointListCopy(rf->sc->layers[layer].splines),rf->transform,true);
+ rf->layers[0].splines = new;
+ last = NULL;
+ if ( new!=NULL )
+ for ( last = new; last->next!=NULL; last = last->next );
+ for ( refs = rf->sc->layers[layer].refs; refs!=NULL; refs = refs->next ) {
new = SplinePointListTransform(SplinePointListCopy(refs->layers[0].splines),rf->transform,true);
- if ( new!=NULL ) {
- for ( spl = new; spl->next!=NULL; spl = spl->next );
- spl->next = rf->layers[0].splines;
+ if ( last!=NULL )
+ last->next = new;
+ else
rf->layers[0].splines = new;
- }
+ if ( new!=NULL )
+ for ( last = new; last->next!=NULL; last = last->next );
}
}
RefCharFindBounds(rf);
@@ -2692,7 +2332,7 @@ static void _SFReinstanciateRefs(SplineFont *sf) {
cnt = 0;
while ( undone && cnt<200) {
undone = false;
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL && !sf->glyphs[i]->ticked ) {
undoable = false;
for ( j=0; j<sf->glyphs[i]->layer_cnt; ++j ) {
for ( ref=sf->glyphs[i]->layers[j].refs; ref!=NULL; ref=ref->next ) {
@@ -2705,7 +2345,7 @@ static void _SFReinstanciateRefs(SplineFont *sf) {
else {
for ( j=0; j<sf->glyphs[i]->layer_cnt; ++j ) {
for ( ref=sf->glyphs[i]->layers[j].refs; ref!=NULL; ref=ref->next )
- SCReinstanciateRefChar(sf->glyphs[i],ref);
+ SCReinstanciateRefChar(sf->glyphs[i],ref,j);
}
sf->glyphs[i]->ticked = true;
}
@@ -2725,22 +2365,22 @@ void SFReinstanciateRefs(SplineFont *sf) {
_SFReinstanciateRefs(sf);
}
-void SCReinstanciateRef(SplineChar *sc,SplineChar *rsc) {
+void SCReinstanciateRef(SplineChar *sc,SplineChar *rsc,int layer) {
RefChar *rf;
- for ( rf=sc->layers[ly_fore].refs; rf!=NULL; rf=rf->next ) if ( rf->sc==rsc ) {
- SCReinstanciateRefChar(sc,rf);
+ for ( rf=sc->layers[layer].refs; rf!=NULL; rf=rf->next ) if ( rf->sc==rsc ) {
+ SCReinstanciateRefChar(sc,rf,layer);
}
}
-void SCRemoveDependent(SplineChar *dependent,RefChar *rf) {
+void SCRemoveDependent(SplineChar *dependent,RefChar *rf,int layer) {
struct splinecharlist *dlist, *pd;
RefChar *prev;
- if ( dependent->layers[ly_fore].refs==rf )
- dependent->layers[ly_fore].refs = rf->next;
+ if ( dependent->layers[layer].refs==rf )
+ dependent->layers[layer].refs = rf->next;
else {
- for ( prev = dependent->layers[ly_fore].refs; prev->next!=rf; prev=prev->next );
+ for ( prev = dependent->layers[layer].refs; prev->next!=rf; prev=prev->next );
prev->next = rf->next;
}
/* Check for multiple dependencies (colon has two refs to period) */
@@ -2767,7 +2407,7 @@ void SCRemoveLayerDependents(SplineChar *dependent,int layer) {
for ( rf=dependent->layers[layer].refs; rf!=NULL; rf=next ) {
next = rf->next;
- SCRemoveDependent(dependent,rf);
+ SCRemoveDependent(dependent,rf,layer);
}
dependent->layers[layer].refs = NULL;
}
@@ -2779,48 +2419,18 @@ void SCRemoveDependents(SplineChar *dependent) {
SCRemoveLayerDependents(dependent,layer);
}
-void SCRefToSplines(SplineChar *sc,RefChar *rf) {
+void SCRefToSplines(SplineChar *sc,RefChar *rf,int layer) {
SplineSet *spl;
-#ifdef FONTFORGE_CONFIG_TYPE3
- int layer;
-
- if ( sc->parent->multilayer ) {
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- Layer *old = sc->layers;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- sc->layers = grealloc(sc->layers,(sc->layer_cnt+rf->layer_cnt)*sizeof(Layer));
- for ( layer = 0; layer<rf->layer_cnt; ++layer ) {
- LayerDefault(&sc->layers[sc->layer_cnt+layer]);
- sc->layers[sc->layer_cnt+layer].splines = rf->layers[layer].splines;
- rf->layers[layer].splines = NULL;
- sc->layers[sc->layer_cnt+layer].images = rf->layers[layer].images;
- rf->layers[layer].images = NULL;
- sc->layers[sc->layer_cnt+layer].refs = NULL;
- sc->layers[sc->layer_cnt+layer].undoes = NULL;
- sc->layers[sc->layer_cnt+layer].redoes = NULL;
- sc->layers[sc->layer_cnt+layer].fill_brush = rf->layers[layer].fill_brush;
- sc->layers[sc->layer_cnt+layer].stroke_pen = rf->layers[layer].stroke_pen;
- sc->layers[sc->layer_cnt+layer].dofill = rf->layers[layer].dofill;
- sc->layers[sc->layer_cnt+layer].dostroke = rf->layers[layer].dostroke;
- sc->layers[sc->layer_cnt+layer].fillfirst = rf->layers[layer].fillfirst;
- }
- sc->layer_cnt += rf->layer_cnt;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- SCMoreLayers(sc,old);
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
- } else {
-#else
{
-#endif
if ( (spl = rf->layers[0].splines)!=NULL ) {
while ( spl->next!=NULL )
spl = spl->next;
- spl->next = sc->layers[ly_fore].splines;
- sc->layers[ly_fore].splines = rf->layers[0].splines;
+ spl->next = sc->layers[layer].splines;
+ sc->layers[layer].splines = rf->layers[0].splines;
rf->layers[0].splines = NULL;
}
}
- SCRemoveDependent(sc,rf);
+ SCRemoveDependent(sc,rf,layer);
}
/* This returns all real solutions, even those out of bounds */
@@ -2938,276 +2548,6 @@ return( false );
return( true );
}
-#if 0
-/* These methods purport to solve all quartics. But they don't solve mine */
-/* so I may have miscopied or something, but I'll give up on algebraic solns*/
-static int QuarticAlternate(Quartic *q,double ts[4],double offset) {
- Spline1D sp;
- double zs[3], h, j, temp;
- int i;
-
- sp.a = 1; sp.b = 2*q->c; sp.c = q->c*q->c-4*q->e;
- sp.d = q->d*q->d;
- if ( !_CubicSolve(&sp,zs))
-return(-1);
- for ( i=0; i<3; ++i )
- if ( zs[i]>0 )
- break;
- if ( i>=3 )
-return( -1 );
- h = sqrt(zs[i]);
- j = (q->c+zs[i]-q->d/h)/2;
-
- /* Now the roots of q are the roots of y^2+hy+j and y^2-hy+(q->e)/j */
- i = 0;
- temp = h*h-4*j;
- if ( temp>=0 ) {
- temp = sqrt(temp);
- ts[i++] = (-h+temp)/2 - offset;
- ts[i++] = (-h-temp)/2 - offset;
- }
- temp = h*h-4*q->e/j;
- if ( temp>=0 ) {
- temp = sqrt(temp);
- ts[i++] = (h+temp)/2 - offset;
- ts[i++] = (h-temp)/2 - offset;
- }
-return( i );
-}
-
-static int _QuarticSolve(Quartic *q,double ts[4]) {
- Quartic work;
- double zs[3], pq[2], r;
- double f,offset;
- Spline1D sp;
- int i,j;
-
- ts[0] = ts[1] = ts[2] = ts[3] = -1;
- if ( RealNear(q->a,0) ) {
- /* I got a quadratic here once so this can happen ... */
- i = 0;
- if ( RealNear(q->b,0)) {
- if ( RealNear(q->c,0)) {
- if ( !RealNear(q->d,0))
- ts[i++] = -q->e/q->d;
- } else {
- f = q->d*q->d - 4*q->c*q->e;
- if ( f>=0 ) {
- f=sqrt(f);
- ts[i++] = (-q->d + f)/(2*q->c);
- ts[i++] = (-q->d - f)/(2*q->c);
- }
- }
- } else {
- sp.a = q->b; sp.b = q->c; sp.c = q->d; sp.d = q->e;
- ts[3] = -1;
- if ( !CubicSolve(&sp,ts))
-return( -1 );
- for ( i=0; i<3 && ts[i]!=-1; ++i );
- }
- } else if ( RealNear(q->e,0)) {
- sp.a = q->a; sp.b = q->b; sp.c = q->c; sp.d = q->d;
- CubicSolve(&sp,ts);
- for ( i=0; i<3 && ts[i]!=-1; ++i );
- ts[i++] = 0;
- } else {
- /* http://mathforum.org/dr.math/faq/faq.cubic.equations.html */
- /* divide by q->a, substitute t=s - q->b/4 */
- offset = q->b/(4*q->a);
-
- work.a = 1;
- work.b = 0;
- work.c = (q->c-3*q->b*q->b/(8*q->a))/q->a;
- work.d = (q->b*q->b*q->b/(8*q->a*q->a) - q->b*q->c/(2*q->a) + q->d)/q->a;
- work.e = (-3*q->b*q->b*q->b*q->b/(256*q->a*q->a*q->a) + (q->b*q->b*q->c)/(16*q->a*q->a) -
- q->b*q->d/(4*q->a) + q->e)/q->a;
-
- if ( RealNear(work.e,0)) {
- sp.a = work.a; sp.b = work.b; sp.c = work.c; sp.d = work.d;
- CubicSolve(&sp,ts);
- for ( i=0; i<3 && ts[i]!=-1; ++i );
- ts[i++] = 0;
- for ( j=0; j<i; ++j )
- ts[j] -= offset;
- } else if ( RealNear(work.d,0)) {
- /* now we have a quadratic in s^2 */
- double b24ac = work.c*work.c - 4*work.e, t1, t2;
- if ( b24ac<0 && b24ac>-.0001 ) b24ac = 0;
- if ( b24ac < 0 ) /* All roots imaginary */
-return( -1 );
- b24ac = sqrt(b24ac);
- t1 = (-work.c + b24ac)/2;
- t2 = (-work.c - b24ac)/2;
- i = 0;
- if ( t1>0 ) {
- ts[0] = sqrt(t1);
- ts[1] = -ts[0];
- i=2;
- } else if ( t1>-.0001 )
- ts[i++] = 0;
- if ( t2>0 ) {
- ts[i++] = sqrt(t2);
- ts[i] = -ts[i-1];
- ++i;
- } else if ( t2>-.0001 )
- ts[i++] = 0;
- for ( j=0; j<i ; ++j )
- ts[j] -= offset;
- if ( i==0 )
-return( -1 );
- } else {
- sp.a = 1;
- sp.b = work.c/2;
- sp.c = (work.c*work.c-4*work.e)/16;
- sp.d = work.d*work.d/64;
- if ( !_CubicSolve(&sp,zs) )
-return( QuarticAlternate(&work,ts,offset));
-
- j = 0;
- for ( i=0; zs[i]!=-999999; ++i )
- if ( zs[i]>0 ) {
- pq[j++] = zs[i];
- if ( j==2 )
- break;
- }
- if ( j!=2 )
-return( QuarticAlternate(&work,ts,offset));
- pq[0] = sqrt(pq[0]);
- pq[1] = sqrt(pq[1]);
- r = -work.d/(8 * pq[0] *pq[1]);
- ts[0] = pq[0]+pq[1]+r - offset;
- ts[1] = pq[0]-pq[1]-r - offset;
- ts[2] = -pq[0]+pq[1]-r - offset;
- ts[3] = -pq[0]-pq[1]+r - offset;
- i = 4;
- }
- }
-return( i );
-}
-#else
-static int _QuarticSolve(Quartic *q,extended ts[4]) {
- extended extrema[5];
- Spline1D sp;
- int ecnt = 0, i, zcnt;
-
- /* Two special cases */
- if ( q->a==0 ) { /* It's really a cubic */
- sp.a = q->b;
- sp.b = q->c;
- sp.c = q->d;
- sp.d = q->e;
- ts[4] = -999999;
-return( _CubicSolve(&sp,ts));
- } else if ( q->e==0 ) { /* we can factor out a zero root */
- sp.a = q->a;
- sp.b = q->b;
- sp.c = q->c;
- sp.d = q->d;
- ts[0] = 0;
-return( _CubicSolve(&sp,ts+1)+1);
- }
-
- sp.a = 4*q->a;
- sp.b = 3*q->b;
- sp.c = 2*q->c;
- sp.d = q->d;
- if ( _CubicSolve(&sp,extrema)) {
- ecnt = 1;
- if ( extrema[1]!=-999999 ) {
- ecnt = 2;
- if ( extrema[1]<extrema[0] ) {
- extended temp = extrema[1]; extrema[1] = extrema[0]; extrema[0]=temp;
- }
- if ( extrema[2]!=-999999 ) {
- ecnt = 3;
- if ( extrema[2]<extrema[0] ) {
- extended temp = extrema[2]; extrema[2] = extrema[0]; extrema[0]=temp;
- }
- if ( extrema[2]<extrema[1] ) {
- extended temp = extrema[2]; extrema[2] = extrema[1]; extrema[1]=temp;
- }
- }
- }
- }
- for ( i=ecnt-1; i>=0 ; --i )
- extrema[i+1] = extrema[i];
- /* Upper and lower bounds within which we'll search */
- extrema[0] = -999;
- extrema[ecnt+1] = 999;
- ecnt += 2;
- /* divide into monotonic sections & use binary search to find zeroes */
- for ( i=zcnt=0; i<ecnt-1; ++i ) {
- extended top, bottom, val;
- extended topt, bottomt, t;
- topt = extrema[i+1];
- bottomt = extrema[i];
- top = (((q->a*topt+q->b)*topt+q->c)*topt+q->d)*topt+q->e;
- bottom = (((q->a*bottomt+q->b)*bottomt+q->c)*bottomt+q->d)*bottomt+q->e;
- if ( top<bottom ) {
- extended temp = top; top = bottom; bottom = temp;
- temp = topt; topt = bottomt; bottomt = temp;
- }
- if ( bottom>.001 ) /* this monotonic is all above 0 */
- continue;
- if ( top<-.001 ) /* this monotonic is all below 0 */
- continue;
- if ( bottom>0 ) {
- ts[zcnt++] = bottomt;
- continue;
- }
- if ( top<0 ) {
- ts[zcnt++] = topt;
- continue;
- }
- forever {
- t = (topt+bottomt)/2;
- if ( t==topt || t==bottomt ) {
- ts[zcnt++] = t;
- break;
- }
-
- val = (((q->a*t+q->b)*t+q->c)*t+q->d)*t+q->e;
- if ( val>-.0001 && val<.0001 ) {
- ts[zcnt++] = t;
- break;
- } else if ( val>0 ) {
- top = val;
- topt = t;
- } else {
- bottom = val;
- bottomt = t;
- }
- }
- }
- for ( i=zcnt; i<4; ++i )
- ts[i] = -999999;
-return( zcnt );
-}
-#endif
-
-static int QuarticSolve(Quartic *q,extended ts[4]) {
- int i,j,k;
-
- if ( _QuarticSolve(q,ts)==-1 )
-return( -1 );
-
- for ( i=0; i<4 && ts[i]!=-999999; ++i ) {
- if ( ts[i]>-.0001 && ts[i]<0 ) ts[i] = 0;
- if ( ts[i]>1.0 && ts[i]<1.0001 ) ts[i] = 1;
- if ( ts[i]>1.0 || ts[i]<0 ) ts[i] = -999999;
- }
- for ( i=3; i>=0 && ts[i]==-999999; --i );
- if ( i==-1 )
-return( -1 );
- for ( j=i ; j>=0 ; --j ) {
- if ( ts[j]<0 ) {
- for ( k=j+1; k<=i; ++k )
- ts[k-1] = ts[k];
- ts[i--] = -999999;
- }
- }
-return(i+1);
-}
extended SplineSolve(const Spline1D *sp, real tmin, real tmax, extended sought,real err) {
/* We want to find t so that spline(t) = sought */
@@ -3217,7 +2557,7 @@ extended SplineSolve(const Spline1D *sp, real tmin, real tmax, extended sought,r
extended ts[3];
int i;
extended t;
-
+ (void)err;
temp = *sp;
temp.d -= sought;
CubicSolve(&temp,ts);
@@ -3486,6 +2826,8 @@ return( 0 );
if ( t>=0 && t<=1.0 )
poi[cnt++] = t;
}
+ if ( cnt<2 )
+ poi[cnt] = -1;
return( cnt );
}
@@ -3523,8 +2865,9 @@ void SplineRemoveExtremaTooClose(Spline1D *sp, extended *_t1, extended *_t2 ) {
t2 = -1;
else if ( t1!=-1 )
t1 = -1;
- else
+ else {
/* Well we should just remove the whole spline? */;
+ }
}
*_t1 = t1; *_t2 = t2;
}
@@ -3538,26 +2881,6 @@ int SplineSolveFull(const Spline1D *sp,extended val, extended ts[3]) {
return( ts[0]!=-1 );
}
-#if 0
-static int CheckEndpoint(BasePoint *end,Spline *s,int te,BasePoint *pts,
- real *tarray,real *ts,int soln) {
- double t;
- int i;
-
- for ( i=0; i<soln; ++i )
- if ( end->x==pts[i].x && end->y==pts[i].y )
-return( soln );
-
- t = SplineNearPoint(s,end,.01);
- if ( t<=0 || t>=1 ) /* If both splines are at end points then it's a join not an intersection */
-return( soln );
- tarray[soln] = te;
- ts[soln] = t;
- pts[soln] = *end;
-return( soln+1 );
-}
-#endif
-
static int AddPoint(extended x,extended y,extended t,extended s,BasePoint *pts,
extended t1s[3],extended t2s[3], int soln) {
int i;
@@ -3565,6 +2888,8 @@ static int AddPoint(extended x,extended y,extended t,extended s,BasePoint *pts,
for ( i=0; i<soln; ++i )
if ( x==pts[i].x && y==pts[i].y )
return( soln );
+ if ( soln>=9 )
+ IError( "Too many solutions!\n" );
t1s[soln] = t;
t2s[soln] = s;
pts[soln].x = x;
@@ -3572,43 +2897,6 @@ return( soln );
return( soln+1 );
}
-static int AddQuadraticSoln(extended s,const Spline *s1, const Spline *s2, BasePoint pts[3],
- extended t1s[3], extended t2s[3], int soln ) {
- extended t, x, y, d;
- int i;
-
- if ( s<-.0001 || s>1.0001 )
-return( soln );
- if ( s<0 ) s=0; else if ( s>1 ) s=1;
-
- x = (s2->splines[0].b*s+s2->splines[0].c)*s+s2->splines[0].d;
- y = (s2->splines[1].b*s+s2->splines[1].c)*s+s2->splines[1].d;
-
- for ( i=0; i<soln; ++i )
- if ( x==pts[i].x && y==pts[i].y )
-return( soln );
-
- d = s1->splines[0].c*(extended) s1->splines[0].c-4*(extended) s1->splines[0].a*(s1->splines[0].d-x);
- if ( RealNear(d,0)) d = 0;
- if ( d<0 )
-return( soln );
- t = (-s1->splines[0].c-d)/(2*s1->splines[0].b);
- if ( t>-.0001 && t<1.0001 ) {
- if ( t<=0 ) {t=0; x=s1->from->me.x; y = s1->from->me.y; }
- else if ( t>=1 ) { t=1; x=s1->to->me.x; y = s1->to->me.y; }
- if ( RealNear(y, (s1->splines[1].b*t+s1->splines[1].c)*t+s1->splines[1].d ) )
-return( AddPoint(x,y,t,s,pts,t1s,t2s,soln));
- }
- t = (-s1->splines[0].c+d)/(2*s1->splines[0].b);
- if ( t>-.0001 && t<1.0001 ) {
- if ( t<=0 ) {t=0; x=s1->from->me.x; y = s1->from->me.y; }
- else if ( t>=1 ) { t=1; x=s1->to->me.x; y = s1->to->me.y; }
- if ( RealNear(y, (s1->splines[1].b*t+s1->splines[1].c)*t+s1->splines[1].d) )
-return( AddPoint(x,y,t,s,pts,t1s,t2s,soln));
- }
-return( soln );
-}
-
static void IterateSolve(const Spline1D *sp,extended ts[3]) {
/* The closed form solution has too many rounding errors for my taste... */
int i,j;
@@ -3637,9 +2925,9 @@ static void IterateSolve(const Spline1D *sp,extended ts[3]) {
}
} else if ( sp->c!=0 ) {
ts[0] = -sp->d/(extended) sp->c;
- } else
+ } else {
/* No solutions, or all solutions */;
-
+ }
for ( i=j=0; i<3; ++i )
if ( ts[i]>=0 && ts[i]<=1 )
ts[j++] = ts[i];
@@ -3705,7 +2993,11 @@ return( -1 );
}
static int ICAddInter(int cnt,BasePoint *foundpos,extended *foundt1,extended *foundt2,
- const Spline *s1,const Spline *s2,extended t1,extended t2) {
+ const Spline *s1,const Spline *s2,extended t1,extended t2, int maxcnt) {
+ (void)s2;
+ if ( cnt>=maxcnt )
+return( cnt );
+
foundt1[cnt] = t1;
foundt2[cnt] = t2;
foundpos[cnt].x = ((s1->splines[0].a*t1+s1->splines[0].b)*t1+
@@ -3717,7 +3009,8 @@ return( cnt+1 );
static int ICBinarySearch(int cnt,BasePoint *foundpos,extended *foundt1,extended *foundt2,
int other,
- const Spline *s1,const Spline *s2,extended t1low,extended t1high,extended t2low,extended t2high) {
+ const Spline *s1,const Spline *s2,extended t1low,extended t1high,extended t2low,extended t2high,
+ int maxcnt) {
int major;
extended t1, t2;
extended o1o, o2o, o1n, o2n, m;
@@ -3741,7 +3034,7 @@ return( cnt );
s2->splines[other].c)*t2+s2->splines[other].d;
if (( o1n-o2n<.001 && o1n-o2n>-.001) ||
(t1-t1low<.0001 && t1-t1low>-.0001))
-return( ICAddInter(cnt,foundpos,foundt1,foundt2,s1,s2,t1,t2));
+return( ICAddInter(cnt,foundpos,foundt1,foundt2,s1,s2,t1,t2,maxcnt));
if ( (o1o>o2o && o1n<o2n) || (o1o<o2o && o1n>o2n)) {
t1high = t1;
t2high = t2;
@@ -3754,7 +3047,8 @@ return( ICAddInter(cnt,foundpos,foundt1,foundt2,s1,s2,t1,t2));
static int CubicsIntersect(const Spline *s1,extended lowt1,extended hight1,BasePoint *min1,BasePoint *max1,
const Spline *s2,extended lowt2,extended hight2,BasePoint *min2,BasePoint *max2,
- BasePoint *foundpos,extended *foundt1,extended *foundt2) {
+ BasePoint *foundpos,extended *foundt1,extended *foundt2,
+ int maxcnt) {
int major, other;
BasePoint max, min;
extended t1max, t1min, t2max, t2min, t1, t2, t1diff, oldt2;
@@ -3789,8 +3083,10 @@ return( 0 );
o2o = ((s2->splines[other].a*t2+s2->splines[other].b)*t2+
s2->splines[other].c)*t2+s2->splines[other].d;
if ( o1o==o2o )
- cnt = ICAddInter(cnt,foundpos,foundt1,foundt2,s1,s2,t1,t2);
+ cnt = ICAddInter(cnt,foundpos,foundt1,foundt2,s1,s2,t1,t2,maxcnt);
forever {
+ if ( cnt>=maxcnt )
+ break;
t1 += t1diff;
if (( t1max>t1min && t1>t1max ) || (t1max<t1min && t1<t1max) || cnt>3 )
break;
@@ -3806,10 +3102,10 @@ return( 0 );
o2n = ((s2->splines[other].a*t2+s2->splines[other].b)*t2+
s2->splines[other].c)*t2+s2->splines[other].d;
if ( o1n==o2n )
- cnt = ICAddInter(cnt,foundpos,foundt1,foundt2,s1,s2,t1,t2);
+ cnt = ICAddInter(cnt,foundpos,foundt1,foundt2,s1,s2,t1,t2,maxcnt);
if ( (o1o>o2o && o1n<o2n) || (o1o<o2o && o1n>o2n))
cnt = ICBinarySearch(cnt,foundpos,foundt1,foundt2,other,
- s1,s2,t1-t1diff,t1,oldt2,t2);
+ s1,s2,t1-t1diff,t1,oldt2,t2,maxcnt);
o1o = o1n; o2o = o2n;
}
return( cnt );
@@ -3840,11 +3136,9 @@ int SplinesIntersect(const Spline *s1, const Spline *s2, BasePoint pts[9],
extended t1s[10], extended t2s[10]) { /* One extra for a trailing -1 */
BasePoint min1, max1, min2, max2;
int soln = 0;
- extended x,y,s,t, ac0, ac1;
- extended d;
+ extended x,y,t, ac0, ac1;
int i,j,found;
- Spline1D spline, temp;
- Quartic quad;
+ Spline1D spline;
extended tempts[4]; /* 3 solns for cubics, 4 for quartics */
extended extrema1[6], extrema2[6];
int ecnt1, ecnt2;
@@ -3919,11 +3213,11 @@ return( false ); /* no intersection of bounding boxes */
#endif
if ( s1->knownlinear ) {
- spline.d = s1->splines[1].c*(s2->splines[0].d-s1->splines[0].d)-
- s1->splines[0].c*(s2->splines[1].d-s1->splines[1].d);
- spline.c = s1->splines[1].c*s2->splines[0].c - s1->splines[0].c*s2->splines[1].c;
- spline.b = s1->splines[1].c*s2->splines[0].b - s1->splines[0].c*s2->splines[1].b;
- spline.a = s1->splines[1].c*s2->splines[0].a - s1->splines[0].c*s2->splines[1].a;
+ spline.d = s1->splines[1].c*((bigreal) s2->splines[0].d-(bigreal) s1->splines[0].d)-
+ s1->splines[0].c*((bigreal) s2->splines[1].d-(bigreal) s1->splines[1].d);
+ spline.c = s1->splines[1].c*(bigreal) s2->splines[0].c - s1->splines[0].c*(bigreal) s2->splines[1].c;
+ spline.b = s1->splines[1].c*(bigreal) s2->splines[0].b - s1->splines[0].c*(bigreal) s2->splines[1].b;
+ spline.a = s1->splines[1].c*(bigreal) s2->splines[0].a - s1->splines[0].c*(bigreal) s2->splines[1].a;
IterateSolve(&spline,tempts);
if ( tempts[0]==-1 )
return( false );
@@ -3963,6 +3257,7 @@ return( false );
soln = AddPoint(x,y,t,tempts[i],pts,t1s,t2s,soln);
}
return( soln!=0 );
+#if 0 /* This doesn't work. */
} else if ( s1->isquadratic && s2->isquadratic ) {
temp.a = 0;
temp.b = s1->splines[1].b*s2->splines[0].b - s1->splines[0].b*s2->splines[1].b;
@@ -4004,6 +3299,7 @@ return( soln!=0 );
soln = AddQuadraticSoln(s,s1,s2,pts,t1s,t2s,soln);
}
return( soln!=0 );
+#endif
}
/* if one of the splines is quadratic then we can get an expression */
/* relating c*t+d to poly(s^3), and substituting this back we get */
@@ -4051,12 +3347,12 @@ return( soln!=0 );
else if ( s1!=s2 )
found += CubicsIntersect(s1,extrema1[i],extrema1[i+1],&min1,&max1,
s2,extrema2[j],extrema2[j+1],&min2,&max2,
- &pts[found],&t1s[found],&t2s[found]);
+ &pts[found],&t1s[found],&t2s[found],9-found);
else {
int k,l;
int cnt = CubicsIntersect(s1,extrema1[i],extrema1[i+1],&min1,&max1,
s2,extrema2[j],extrema2[j+1],&min2,&max2,
- &pts[found],&t1s[found],&t2s[found]);
+ &pts[found],&t1s[found],&t2s[found],9-found);
for ( k=0; k<cnt; ++k ) {
if ( RealNear(t1s[found+k],t2s[found+k]) ) {
for ( l=k+1; l<cnt; ++l ) {
@@ -4069,55 +3365,17 @@ return( soln!=0 );
}
found += cnt;
}
+ if ( found>=8 ) {
+ /* If the splines are colinear then we might get an unbounded */
+ /* number of intersections */
+ break;
+ }
}
}
t1s[found] = t2s[found] = -1;
return( found!=0 );
}
-/* Puts all the contours of the glyph together. Next routine undoes this */
-SplineSet *LayerAllSplines(Layer *layer) {
- SplineSet *head=NULL, *last=NULL;
- RefChar *r;
-
- head = layer->splines;
- if ( head!=NULL )
- for ( last=head; last->next!=NULL; last = last->next );
- for ( r=layer->refs; r!=NULL; r=r->next ) {
- if ( last!=NULL ) {
- last->next = r->layers[0].splines;
- for ( ; last->next!=NULL; last=last->next );
- } else {
- head = r->layers[0].splines;
- if ( head!=NULL )
- for ( last=head; last->next!=NULL; last = last->next );
- }
- }
-return( head );
-}
-
-SplineSet *LayerUnAllSplines(Layer *layer) {
- SplineSet *spl = layer->splines;
- RefChar *r = layer->refs;
-
- if ( spl==NULL ) {
- while ( r!=NULL && r->layers[0].splines==NULL )
- r = r->next;
- if ( r==NULL )
-return( NULL );
- spl = r->layers[0].splines;
- r = r->next;
- }
- while ( r!=NULL ) {
- while ( spl!=NULL && spl->next!=r->layers[0].splines )
- spl = spl->next;
- spl->next = NULL;
- spl = r->layers[0].splines;
- r = r->next;
- }
-return( layer->splines );
-}
-
int SplineSetIntersect(SplineSet *spl, Spline **_spline, Spline **_spline2) {
BasePoint pts[9];
extended t1s[10], t2s[10];
@@ -4163,356 +3421,6 @@ int SplineSetIntersect(SplineSet *spl, Spline **_spline, Spline **_spline2) {
return( found );
}
-int LineTangentToSplineThroughPt(Spline *s, BasePoint *pt, extended ts[4],
- extended tmin, extended tmax) {
- /* attempt to find a line though the point pt which is tangent to the spline */
- /* we return t of the tangent point on the spline (if any) */
- /* So the slope of the line through pt&tangent point must match slope */
- /* at the tangent point on the spline. Or... */
- /* (pt.x-xt)/(pt.y-yt) = (dx/dt)/(dy/dt) */
- /* (pt.x-xt)*(dy/dt) = (pt.y-yt)*(dx/dt) */
- /* (pt.x - ax*t^3 - bx*t^2 - cx*t - dx)(3ay*t^2 + 2by*t + cy) = */
- /* (pt.y - ay*t^3 - by*t^2 - cy*t^2 - dy)(3ax*t^2 + 2bx*t + cx) */
- /* (-ax*3ay + ay*3ax) * t^5 + */
- /* (-ax*2by - bx*3ay + ay*2bx + by*3ax) * t^4 + */
- /* (-ax*cy - bx*2by - cx*3ay + ay*cx + by*2bx + cy*3ax) * t^3 + */
- /* (pt.x*3ay - bx*cy - cx*2by - dx*3ay - pt.y*3ax + by*cx + cy*2bx + dy*3ax) * t^2 + */
- /* (pt.x*2by - cx*cy - dx*2by - pt.y*2bx + cy*cx + dy*2bx) * t + */
- /* (pt.x*cy - dx*cy - pt.y*cx + dy*cx) = 0 */
- /* Yeah! The order 5 terms cancel out */
- /* (ax*by - bx*ay) * t^4 + */
- /* (2*ax*cy - 2*cx*ay) * t^3 + */
- /* (3*pt.x*ay + bx*cy - cx*by - 3*dx*ay - 3*pt.y*ax + 3*dy*ax) * t^2 + */
- /* (2*pt.x*by - 2*dx*by - 2*pt.y*bx + 2*dy*bx) * t + */
- /* (pt.x*cy - dx*cy - pt.y*cx + dy*cx) = 0 */
- Quartic quad;
- int i,j,k;
-
- if ( !finite(pt->x) || !finite(pt->y) ) {
- IError( "Non-finite arguments passed to LineTangentToSplineThroughPt");
-return( -1 );
- }
-
- quad.a = s->splines[0].a*s->splines[1].b - s->splines[0].b*s->splines[1].a;
- quad.b = 2*s->splines[0].a*s->splines[1].c - 2*s->splines[0].c*s->splines[1].a;
- quad.c = 3*pt->x*s->splines[1].a + s->splines[0].b*s->splines[1].c - s->splines[0].c*s->splines[1].b - 3*s->splines[0].d*s->splines[1].a - 3*pt->y*s->splines[0].a + 3*s->splines[1].d*s->splines[0].a;
- quad.d = 2*pt->x*s->splines[1].b - 2*s->splines[0].d*s->splines[1].b - 2*pt->y*s->splines[0].b + 2*s->splines[1].d*s->splines[0].b;
- quad.e = pt->x*s->splines[1].c - s->splines[0].d*s->splines[1].c - pt->y*s->splines[0].c + s->splines[1].d*s->splines[0].c;
-
- if ( _QuarticSolve(&quad,ts)==-1 )
-return( -1 );
-
- for ( i=0; i<4 && ts[i]!=-999999; ++i ) {
- if ( ts[i]>tmin-.0001 && ts[i]<tmin ) ts[i] = tmin;
- if ( ts[i]>tmax && ts[i]<tmax+.001 ) ts[i] = tmax;
- if ( ts[i]>tmax || ts[i]<tmin ) ts[i] = -999999;
- }
- for ( i=3; i>=0 && ts[i]==-999999; --i );
- if ( i==-1 )
-return( -1 );
- for ( j=i ; j>=0 ; --j ) {
- if ( ts[j]<0 ) {
- for ( k=j+1; k<=i; ++k )
- ts[k-1] = ts[k];
- ts[i--] = -999999;
- }
- }
-return(i+1);
-}
-
-static int XSolve(Spline *spline,real tmin, real tmax,FindSel *fs) {
- Spline1D *yspline = &spline->splines[1], *xspline = &spline->splines[0];
- bigreal t,x,y;
-
- fs->p->t = t = SplineSolve(xspline,tmin,tmax,fs->p->cx,.001);
- if ( t>=0 && t<=1 ) {
- y = ((yspline->a*t+yspline->b)*t+yspline->c)*t + yspline->d;
- if ( fs->yl<y && fs->yh>y )
-return( true );
- }
- /* Although we know that globaly there's more x change, locally there */
- /* maybe more y change */
- fs->p->t = t = SplineSolve(yspline,tmin,tmax,fs->p->cy,.001);
- if ( t>=0 && t<=1 ) {
- x = ((xspline->a*t+xspline->b)*t+xspline->c)*t + xspline->d;
- if ( fs->xl<x && fs->xh>x )
-return( true );
- }
-return( false );
-}
-
-static int YSolve(Spline *spline,real tmin, real tmax,FindSel *fs) {
- Spline1D *yspline = &spline->splines[1], *xspline = &spline->splines[0];
- bigreal t,x,y;
-
- fs->p->t = t = SplineSolve(yspline,tmin,tmax,fs->p->cy,.001);
- if ( t>=0 && t<=1 ) {
- x = ((xspline->a*t+xspline->b)*t+xspline->c)*t + xspline->d;
- if ( fs->xl<x && fs->xh>x )
-return( true );
- }
- /* Although we know that globaly there's more y change, locally there */
- /* maybe more x change */
- fs->p->t = t = SplineSolve(xspline,tmin,tmax,fs->p->cx,.001);
- if ( t>=0 && t<=1 ) {
- y = ((yspline->a*t+yspline->b)*t+yspline->c)*t + yspline->d;
- if ( fs->yl<y && fs->yh>y )
-return( true );
- }
-return( false );
-}
-
-static int NearXSpline(FindSel *fs, Spline *spline) {
- /* If we get here we've checked the bounding box and we're in it */
- /* the y spline is a horizontal line */
- /* the x spline is not linear */
- bigreal t,y;
- Spline1D *yspline = &spline->splines[1], *xspline = &spline->splines[0];
-
- if ( xspline->a!=0 ) {
- extended t1, t2, tbase;
- SplineFindExtrema(xspline,&t1,&t2);
- tbase = 0;
- if ( t1!=-1 ) {
- if ( XSolve(spline,0,t1,fs))
-return( true );
- tbase = t1;
- }
- if ( t2!=-1 ) {
- if ( XSolve(spline,tbase,t2,fs))
-return( true );
- tbase = t2;
- }
- if ( XSolve(spline,tbase,1.0,fs))
-return( true );
- } else if ( xspline->b!=0 ) {
- bigreal root = xspline->c*xspline->c - 4*xspline->b*(xspline->d-fs->p->cx);
- if ( root < 0 )
-return( false );
- root = sqrt(root);
- fs->p->t = t = (-xspline->c + root)/(2*xspline->b);
- if ( t>=0 && t<=1 ) {
- y = ((yspline->a*t+yspline->b)*t+yspline->c)*t + yspline->d;
- if ( fs->yl<y && fs->yh>y )
-return( true );
- }
- fs->p->t = t = (-xspline->c - root)/(2*xspline->b);
- if ( t>=0 && t<=1 ) {
- y = ((yspline->a*t+yspline->b)*t+yspline->c)*t + yspline->d;
- if ( fs->yl<y && fs->yh>y )
-return( true );
- }
- } else /* xspline->c can't be 0 because dx>dy => dx!=0 => xspline->c!=0 */ {
- fs->p->t = t = (fs->p->cx-xspline->d)/xspline->c;
- y = ((yspline->a*t+yspline->b)*t+yspline->c)*t + yspline->d;
- if ( fs->yl<y && fs->yh>y )
-return( true );
- }
-return( false );
-}
-
-int NearSpline(FindSel *fs, Spline *spline) {
- bigreal t,x,y;
- Spline1D *yspline = &spline->splines[1], *xspline = &spline->splines[0];
- bigreal dx, dy;
-
- if (( dx = spline->to->me.x-spline->from->me.x)<0 ) dx = -dx;
- if (( dy = spline->to->me.y-spline->from->me.y)<0 ) dy = -dy;
-
- if ( spline->knownlinear ) {
- if ( fs->xl > spline->from->me.x && fs->xl > spline->to->me.x )
-return( false );
- if ( fs->xh < spline->from->me.x && fs->xh < spline->to->me.x )
-return( false );
- if ( fs->yl > spline->from->me.y && fs->yl > spline->to->me.y )
-return( false );
- if ( fs->yh < spline->from->me.y && fs->yh < spline->to->me.y )
-return( false );
- if ( xspline->c==0 && yspline->c==0 ) /* It's a point. */
-return( true );
- if ( dy>dx ) {
- t = (fs->p->cy-yspline->d)/yspline->c;
- fs->p->t = t;
- x = xspline->c*t + xspline->d;
- if ( fs->xl<x && fs->xh>x && t>=0 && t<=1 )
-return( true );
- } else {
- t = (fs->p->cx-xspline->d)/xspline->c;
- fs->p->t = t;
- y = yspline->c*t + yspline->d;
- if ( fs->yl<y && fs->yh>y && t>=0 && t<=1 )
-return( true );
- }
-return( false );
- } else {
- if ( fs->xl > spline->from->me.x && fs->xl > spline->to->me.x &&
- fs->xl > spline->from->nextcp.x && fs->xl > spline->to->prevcp.x )
-return( false );
- if ( fs->xh < spline->from->me.x && fs->xh < spline->to->me.x &&
- fs->xh < spline->from->nextcp.x && fs->xh < spline->to->prevcp.x )
-return( false );
- if ( fs->yl > spline->from->me.y && fs->yl > spline->to->me.y &&
- fs->yl > spline->from->nextcp.y && fs->yl > spline->to->prevcp.y )
-return( false );
- if ( fs->yh < spline->from->me.y && fs->yh < spline->to->me.y &&
- fs->yh < spline->from->nextcp.y && fs->yh < spline->to->prevcp.y )
-return( false );
-
- if ( dx>dy )
-return( NearXSpline(fs,spline));
- else if ( yspline->a == 0 && yspline->b == 0 ) {
- fs->p->t = t = (fs->p->cy-yspline->d)/yspline->c;
- x = ((xspline->a*t+xspline->b)*t+xspline->c)*t + xspline->d;
- if ( fs->xl<x && fs->xh>x && t>=0 && t<=1 )
-return( true );
- } else if ( yspline->a==0 ) {
- bigreal root = yspline->c*yspline->c - 4*yspline->b*(yspline->d-fs->p->cy);
- if ( root < 0 )
-return( false );
- root = sqrt(root);
- fs->p->t = t = (-yspline->c + root)/(2*yspline->b);
- x = ((xspline->a*t+xspline->b)*t+xspline->c)*t + xspline->d;
- if ( fs->xl<x && fs->xh>x && t>0 && t<1 )
-return( true );
- fs->p->t = t = (-yspline->c - root)/(2*yspline->b);
- x = ((xspline->a*t+xspline->b)*t+xspline->c)*t + xspline->d;
- if ( fs->xl<x && fs->xh>x && t>=0 && t<=1 )
-return( true );
- } else {
- extended t1, t2, tbase;
- SplineFindExtrema(yspline,&t1,&t2);
- tbase = 0;
- if ( t1!=-1 ) {
- if ( YSolve(spline,0,t1,fs))
-return( true );
- tbase = t1;
- }
- if ( t2!=-1 ) {
- if ( YSolve(spline,tbase,t2,fs))
-return( true );
- tbase = t2;
- }
- if ( YSolve(spline,tbase,1.0,fs))
-return( true );
- }
- }
-return( false );
-}
-
-real SplineNearPoint(Spline *spline, BasePoint *bp, real fudge) {
- PressedOn p;
- FindSel fs;
-
- memset(&fs,'\0',sizeof(fs));
- memset(&p,'\0',sizeof(p));
- fs.p = &p;
- p.cx = bp->x;
- p.cy = bp->y;
- fs.fudge = fudge;
- fs.xl = p.cx-fudge;
- fs.xh = p.cx+fudge;
- fs.yl = p.cy-fudge;
- fs.yh = p.cy+fudge;
- if ( !NearSpline(&fs,spline))
-return( -1 );
-
-return( p.t );
-}
-
-static int SplinePrevMinMax(Spline *s,int up) {
- const double t = .9999;
- double y;
- int pup;
-
- s = s->from->prev;
- while ( s->from->me.y==s->to->me.y && s->islinear )
- s = s->from->prev;
- y = ((s->splines[1].a*t + s->splines[1].b)*t + s->splines[1].c)*t + s->splines[1].d;
- pup = s->to->me.y > y;
-return( pup!=up );
-}
-
-static int SplineNextMinMax(Spline *s,int up) {
- const double t = .0001;
- double y;
- int nup;
-
- s = s->to->next;
- while ( s->from->me.y==s->to->me.y && s->islinear )
- s = s->to->next;
- y = ((s->splines[1].a*t + s->splines[1].b)*t + s->splines[1].c)*t + s->splines[1].d;
- nup = y > s->from->me.y;
-return( nup!=up );
-}
-
-static int Crossings(Spline *s,BasePoint *pt) {
- extended ext[4];
- int i, cnt=0;
- bigreal yi, yi1, t, x;
-
- ext[0] = 0; ext[3] = 1.0;
- SplineFindExtrema(&s->splines[1],&ext[1],&ext[2]);
- if ( ext[2]!=-1 && SplineAtInflection(&s->splines[1],ext[2])) ext[2]=-1;
- if ( ext[1]!=-1 && SplineAtInflection(&s->splines[1],ext[1])) {ext[1] = ext[2]; ext[2]=-1;}
- if ( ext[1]==-1 ) ext[1] = 1.0;
- else if ( ext[2]==-1 ) ext[2] = 1.0;
- yi = s->splines[1].d;
- for ( i=0; ext[i]!=1.0; ++i, yi=yi1 ) {
- yi1 = ((s->splines[1].a*ext[i+1]+s->splines[1].b)*ext[i+1]+s->splines[1].c)*ext[i+1]+s->splines[1].d;
- if ( yi==yi1 )
- continue; /* Ignore horizontal lines */
- if ( (yi>yi1 && (pt->y<yi1 || pt->y>yi)) ||
- (yi<yi1 && (pt->y<yi || pt->y>yi1)) )
- continue;
- t = IterateSplineSolve(&s->splines[1],ext[i],ext[i+1],pt->y,.0001);
- if ( t==-1 )
- continue;
- x = ((s->splines[0].a*t+s->splines[0].b)*t+s->splines[0].c)*t+s->splines[0].d;
- if ( x>=pt->x ) /* Things on the edge are not inside */
- continue;
- if (( ext[i]!=0 && RealApprox(t,ext[i]) && SplineAtMinMax(&s->splines[1],ext[i]) ) ||
- ( ext[i+1]!=1 && RealApprox(t,ext[i+1]) && SplineAtMinMax(&s->splines[1],ext[i+1]) ))
- continue; /* Min/Max points don't add to count */
- if (( RealApprox(t,0) && SplinePrevMinMax(s,yi1>yi) ) ||
- ( RealApprox(t,1) && SplineNextMinMax(s,yi1>yi) ))
- continue; /* ditto */
- if ( pt->y==yi1 ) /* Not a min/max. prev/next spline continues same direction */
- continue; /* If it's at an endpoint we don't want to count it twice */
- /* So only add to count at start endpoint, never at final */
- if ( yi1>yi )
- ++cnt;
- else
- --cnt;
- }
-return( cnt );
-}
-
-/* Return whether this point is within the set of contours in spl */
-/* Draw a line from [-infinity,pt.y] to [pt.x,pt.y] and count contour crossings */
-int SSPointWithin(SplineSet *spl,BasePoint *pt) {
- int cnt=0;
- Spline *s, *first;
-
- while ( spl!=NULL ) {
- if ( spl->first->prev!=NULL ) {
- first = NULL;
- for ( s = spl->first->next; s!=first; s=s->to->next ) {
- if ( first==NULL ) first = s;
- if (( s->from->me.x>pt->x && s->from->nextcp.x>pt->x &&
- s->to->me.x>pt->x && s->to->prevcp.x>pt->x) ||
- ( s->from->me.y>pt->y && s->from->nextcp.y>pt->y &&
- s->to->me.y>pt->y && s->to->prevcp.y>pt->y) ||
- ( s->from->me.y<pt->y && s->from->nextcp.y<pt->y &&
- s->to->me.y<pt->y && s->to->prevcp.y<pt->y))
- continue;
- cnt += Crossings(s,pt);
- }
- }
- spl = spl->next;
- }
-return( cnt!=0 );
-}
-
void StemInfoFree(StemInfo *h) {
HintInstance *hi, *n;
@@ -4538,14 +3446,24 @@ void StemInfosFree(StemInfo *h) {
}
void DStemInfoFree(DStemInfo *h) {
+ HintInstance *hi, *n;
+ for ( hi=h->where; hi!=NULL; hi=n ) {
+ n = hi->next;
+ chunkfree(hi,sizeof(HintInstance));
+ }
chunkfree(h,sizeof(DStemInfo));
}
void DStemInfosFree(DStemInfo *h) {
DStemInfo *hnext;
+ HintInstance *hi, *n;
for ( ; h!=NULL; h = hnext ) {
+ for ( hi=h->where; hi!=NULL; hi=n ) {
+ n = hi->next;
+ chunkfree(hi,sizeof(HintInstance));
+ }
hnext = h->next;
chunkfree(h,sizeof(DStemInfo));
}
@@ -4583,6 +3501,7 @@ return( head );
DStemInfo *DStemInfoCopy(DStemInfo *h) {
DStemInfo *head=NULL, *last=NULL, *cur;
+ HintInstance *hilast, *hicur, *hi;
for ( ; h!=NULL; h = h->next ) {
cur = chunkalloc(sizeof(DStemInfo));
@@ -4594,6 +3513,18 @@ DStemInfo *DStemInfoCopy(DStemInfo *h) {
last->next = cur;
last = cur;
}
+ cur->where = hilast = NULL;
+ for ( hi=h->where; hi!=NULL; hi=hi->next ) {
+ hicur = chunkalloc(sizeof(StemInfo));
+ *hicur = *hi;
+ hicur->next = NULL;
+ if ( hilast==NULL )
+ cur->where = hilast = hicur;
+ else {
+ hilast->next = hicur;
+ hilast = hicur;
+ }
+ }
}
return( head );
}
@@ -4619,12 +3550,6 @@ void KernPairsFree(KernPair *kp) {
KernPair *knext;
for ( ; kp!=NULL; kp = knext ) {
knext = kp->next;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( kp->adjust!=NULL ) {
- free(kp->adjust->corrections);
- chunkfree(kp->adjust,sizeof(DeviceTable));
- }
-#endif
chunkfree(kp,sizeof(KernPair));
}
}
@@ -4641,8 +3566,11 @@ static AnchorPoint *AnchorPointsRemoveName(AnchorPoint *alist,AnchorClass *an) {
prev->next = next;
ap->next = NULL;
AnchorPointsFree(ap);
- if ( ap->type==at_mark || ap->type==at_basechar || ap->type==at_basemark )
- next = NULL; /* Names only occur once, unless it's a ligature or cursive */
+ if ( an->type == act_mark || (an->type==act_mklg && ap->type==at_mark))
+ next = NULL; /* Only one instance of an anchor class in a glyph for mark to base anchors */
+ /* Or for the mark glyphs of ligature classes */
+ /* Mark to mark & cursive will (probably) have 2 occurances */
+ /* and ligatures may have lots */
} else
prev = ap;
}
@@ -4669,8 +3597,6 @@ void SFRemoveAnchorClass(SplineFont *sf,AnchorClass *an) {
int i;
AnchorClass *prev, *test;
- PasteRemoveAnchorClass(sf,an);
-
for ( i=0; i<sf->glyphcnt; ++i )
SCRemoveAnchorClass(sf->glyphs[i],an);
prev = NULL;
@@ -4716,37 +3642,12 @@ AnchorPoint *APAnchorClassMerge(AnchorPoint *anchors,AnchorClass *into,AnchorCla
return( anchors );
}
-void AnchorClassMerge(SplineFont *sf,AnchorClass *into,AnchorClass *from) {
- int i;
-
- if ( into==from )
-return;
- PasteAnchorClassMerge(sf,into,from);
- for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
- SplineChar *sc = sf->glyphs[i];
-
- sc->anchor = APAnchorClassMerge(sc->anchor,into,from);
- }
-}
-
AnchorPoint *AnchorPointsCopy(AnchorPoint *alist) {
AnchorPoint *head=NULL, *last=NULL, *ap;
-
+
while ( alist!=NULL ) {
ap = chunkalloc(sizeof(AnchorPoint));
*ap = *alist;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- if ( ap->xadjust.corrections!=NULL ) {
- int len = ap->xadjust.last_pixel_size-ap->xadjust.first_pixel_size+1;
- ap->xadjust.corrections = galloc(len);
- memcpy(ap->xadjust.corrections,alist->xadjust.corrections,len);
- }
- if ( ap->yadjust.corrections!=NULL ) {
- int len = ap->yadjust.last_pixel_size-ap->yadjust.first_pixel_size+1;
- ap->yadjust.corrections = galloc(len);
- memcpy(ap->yadjust.corrections,alist->yadjust.corrections,len);
- }
-#endif
if ( head==NULL )
head = ap;
else
@@ -4761,141 +3662,180 @@ void AnchorPointsFree(AnchorPoint *ap) {
AnchorPoint *anext;
for ( ; ap!=NULL; ap = anext ) {
anext = ap->next;
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- free(ap->xadjust.corrections);
- free(ap->yadjust.corrections);
-#endif
chunkfree(ap,sizeof(AnchorPoint));
}
}
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
-void ValDevFree(ValDevTab *adjust) {
- if ( adjust==NULL )
-return;
- free( adjust->xadjust.corrections );
- free( adjust->yadjust.corrections );
- free( adjust->xadv.corrections );
- free( adjust->yadv.corrections );
- chunkfree(adjust,sizeof(ValDevTab));
-}
-
-ValDevTab *ValDevTabCopy(ValDevTab *orig) {
- ValDevTab *new;
- int i;
- if ( orig==NULL )
-return( NULL );
- new = chunkalloc(sizeof(ValDevTab));
- for ( i=0; i<4; ++i ) {
- if ( (&orig->xadjust)[i].corrections!=NULL ) {
- int len = (&orig->xadjust)[i].last_pixel_size - (&orig->xadjust)[i].first_pixel_size + 1;
- (&new->xadjust)[i] = (&orig->xadjust)[i];
- (&new->xadjust)[i].corrections = galloc(len);
- memcpy((&new->xadjust)[i].corrections,(&orig->xadjust)[i].corrections,len);
+void PSTFree(PST *pst) {
+ PST *pnext;
+ for ( ; pst!=NULL; pst = pnext ) {
+ pnext = pst->next;
+ if ( pst->type==pst_lcaret )
+ free(pst->u.lcaret.carets);
+ else if ( pst->type==pst_pair ) {
+ free(pst->u.pair.paired);
+ chunkfree(pst->u.pair.vr,sizeof(struct vr [2]));
+ } else if ( pst->type!=pst_position ) {
+ free(pst->u.subs.variant);
+ } else if ( pst->type==pst_position ) {
}
+ chunkfree(pst,sizeof(PST));
}
-return( new );
}
-void DeviceTableFree(DeviceTable *dt) {
-
- if ( dt==NULL )
-return;
+void FPSTRuleContentsFree(struct fpst_rule *r, enum fpossub_format format) {
+ int j;
- free(dt->corrections);
- chunkfree(dt,sizeof(DeviceTable));
+ switch ( format ) {
+ case pst_glyphs:
+ free(r->u.glyph.names);
+ free(r->u.glyph.back);
+ free(r->u.glyph.fore);
+ break;
+ case pst_class:
+ free(r->u.class.nclasses);
+ free(r->u.class.bclasses);
+ free(r->u.class.fclasses);
+ break;
+ case pst_reversecoverage:
+ free(r->u.rcoverage.replacements);
+ case pst_coverage:
+ for ( j=0 ; j<r->u.coverage.ncnt ; ++j )
+ free(r->u.coverage.ncovers[j]);
+ free(r->u.coverage.ncovers);
+ for ( j=0 ; j<r->u.coverage.bcnt ; ++j )
+ free(r->u.coverage.bcovers[j]);
+ free(r->u.coverage.bcovers);
+ for ( j=0 ; j<r->u.coverage.fcnt ; ++j )
+ free(r->u.coverage.fcovers[j]);
+ free(r->u.coverage.fcovers);
+ break;
+ default:
+ break;
+ }
+ free(r->lookups);
+}
+
+void FPSTRulesFree(struct fpst_rule *r, enum fpossub_format format, int rcnt) {
+ int i;
+ for ( i=0; i<rcnt; ++i )
+ FPSTRuleContentsFree(&r[i],format);
+ free(r);
}
-DeviceTable *DeviceTableCopy(DeviceTable *orig) {
- DeviceTable *new;
- int len;
+static struct fpst_rule *RulesCopy(struct fpst_rule *from, int cnt,
+ enum fpossub_format format ) {
+ int i, j;
+ struct fpst_rule *to, *f, *t;
- if ( orig==NULL )
+ if ( cnt==0 )
return( NULL );
- new = chunkalloc(sizeof(DeviceTable));
- *new = *orig;
- len = orig->last_pixel_size - orig->first_pixel_size + 1;
- new->corrections = galloc(len);
- memcpy(new->corrections,orig->corrections,len);
-return( new );
-}
-
-void DeviceTableSet(DeviceTable *adjust, int size, int correction) {
- int len, i, j;
- len = adjust->last_pixel_size-adjust->first_pixel_size + 1;
- if ( correction==0 ) {
- if ( adjust->corrections==NULL ||
- size<adjust->first_pixel_size ||
- size>adjust->last_pixel_size )
-return;
- adjust->corrections[size-adjust->first_pixel_size] = 0;
- for ( i=0; i<len; ++i )
- if ( adjust->corrections[i]!=0 )
- break;
- if ( i==len ) {
- free(adjust->corrections);
- memset(adjust,0,sizeof(DeviceTable));
- } else {
- if ( i!=0 ) {
- for ( j=0; j<len-i; ++j )
- adjust->corrections[j] = adjust->corrections[j+i];
- adjust->first_pixel_size += i;
- len -= i;
+ to = gcalloc(cnt,sizeof(struct fpst_rule));
+ for ( i=0; i<cnt; ++i ) {
+ f = from+i; t = to+i;
+ switch ( format ) {
+ case pst_glyphs:
+ t->u.glyph.names = copy(f->u.glyph.names);
+ t->u.glyph.back = copy(f->u.glyph.back);
+ t->u.glyph.fore = copy(f->u.glyph.fore);
+ break;
+ case pst_class:
+ t->u.class.ncnt = f->u.class.ncnt;
+ t->u.class.bcnt = f->u.class.bcnt;
+ t->u.class.fcnt = f->u.class.fcnt;
+ t->u.class.nclasses = galloc( f->u.class.ncnt*sizeof(uint16));
+ memcpy(t->u.class.nclasses,f->u.class.nclasses,
+ f->u.class.ncnt*sizeof(uint16));
+ if ( t->u.class.bcnt!=0 ) {
+ t->u.class.bclasses = galloc( f->u.class.bcnt*sizeof(uint16));
+ memcpy(t->u.class.bclasses,f->u.class.bclasses,
+ f->u.class.bcnt*sizeof(uint16));
}
- for ( i=len-1; i>=0; --i )
- if ( adjust->corrections[i]!=0 )
- break;
- adjust->last_pixel_size = adjust->first_pixel_size+i;
+ if ( t->u.class.fcnt!=0 ) {
+ t->u.class.fclasses = galloc( f->u.class.fcnt*sizeof(uint16));
+ memcpy(t->u.class.fclasses,f->u.class.fclasses,
+ f->u.class.fcnt*sizeof(uint16));
+ }
+ break;
+ case pst_reversecoverage:
+ t->u.rcoverage.replacements = copy(f->u.rcoverage.replacements);
+ case pst_coverage:
+ t->u.coverage.ncnt = f->u.coverage.ncnt;
+ t->u.coverage.bcnt = f->u.coverage.bcnt;
+ t->u.coverage.fcnt = f->u.coverage.fcnt;
+ t->u.coverage.ncovers = galloc( f->u.coverage.ncnt*sizeof(char *));
+ for ( j=0; j<t->u.coverage.ncnt; ++j )
+ t->u.coverage.ncovers[j] = copy(f->u.coverage.ncovers[j]);
+ if ( t->u.coverage.bcnt!=0 ) {
+ t->u.coverage.bcovers = galloc( f->u.coverage.bcnt*sizeof(char *));
+ for ( j=0; j<t->u.coverage.bcnt; ++j )
+ t->u.coverage.bcovers[j] = copy(f->u.coverage.bcovers[j]);
+ }
+ if ( t->u.coverage.fcnt!=0 ) {
+ t->u.coverage.fcovers = galloc( f->u.coverage.fcnt*sizeof(char *));
+ for ( j=0; j<t->u.coverage.fcnt; ++j )
+ t->u.coverage.fcovers[j] = copy(f->u.coverage.fcovers[j]);
+ }
+ break;
+ default:
+ break;
}
- } else {
- if ( adjust->corrections==NULL ) {
- adjust->first_pixel_size = adjust->last_pixel_size = size;
- adjust->corrections = galloc(1);
- } else if ( size>=adjust->first_pixel_size &&
- size<=adjust->last_pixel_size ) {
- } else if ( size>adjust->last_pixel_size ) {
- adjust->corrections = grealloc(adjust->corrections,
- size-adjust->first_pixel_size);
- for ( i=len; i<size-adjust->first_pixel_size; ++i )
- adjust->corrections[i] = 0;
- adjust->last_pixel_size = size;
- } else {
- int8 *new = galloc(adjust->last_pixel_size-size+1);
- memset(new,0,adjust->first_pixel_size-size);
- memcpy(new+adjust->first_pixel_size-size,
- adjust->corrections, len);
- adjust->first_pixel_size = size;
- free(adjust->corrections);
- adjust->corrections = new;
+ if ( f->lookup_cnt!=0 ) {
+ t->lookup_cnt = f->lookup_cnt;
+ t->lookups = galloc(t->lookup_cnt*sizeof(struct seqlookup));
+ memcpy(t->lookups,f->lookups,t->lookup_cnt*sizeof(struct seqlookup));
}
- adjust->corrections[size-adjust->first_pixel_size] = correction;
}
+return( to );
}
-#endif
-void PSTFree(PST *pst) {
- PST *pnext;
- for ( ; pst!=NULL; pst = pnext ) {
- pnext = pst->next;
- if ( pst->type==pst_lcaret )
- free(pst->u.lcaret.carets);
- else if ( pst->type==pst_pair ) {
- free(pst->u.pair.paired);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- ValDevFree(pst->u.pair.vr[0].adjust);
- ValDevFree(pst->u.pair.vr[1].adjust);
-#endif
- chunkfree(pst->u.pair.vr,sizeof(struct vr [2]));
- } else if ( pst->type!=pst_position ) {
- free(pst->u.subs.variant);
- } else if ( pst->type==pst_position ) {
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- ValDevFree(pst->u.pos.adjust);
-#endif
+FPST *FPSTCopy(FPST *fpst) {
+ FPST *nfpst;
+ int i;
+
+ nfpst = chunkalloc(sizeof(FPST));
+ *nfpst = *fpst;
+ nfpst->next = NULL;
+ if ( nfpst->nccnt!=0 ) {
+ nfpst->nclass = galloc(nfpst->nccnt*sizeof(char *));
+ for ( i=0; i<nfpst->nccnt; ++i )
+ nfpst->nclass[i] = copy(fpst->nclass[i]);
+ }
+ if ( nfpst->bccnt!=0 ) {
+ nfpst->bclass = galloc(nfpst->bccnt*sizeof(char *));
+ for ( i=0; i<nfpst->bccnt; ++i )
+ nfpst->bclass[i] = copy(fpst->bclass[i]);
+ }
+ if ( nfpst->fccnt!=0 ) {
+ nfpst->fclass = galloc(nfpst->fccnt*sizeof(char *));
+ for ( i=0; i<nfpst->fccnt; ++i )
+ nfpst->fclass[i] = copy(fpst->fclass[i]);
+ }
+ nfpst->rules = RulesCopy(fpst->rules,fpst->rule_cnt,fpst->format);
+return( nfpst );
+}
+
+void FPSTFree(FPST *fpst) {
+ FPST *next;
+ int i;
+
+ while ( fpst!=NULL ) {
+ next = fpst->next;
+ for ( i=0; i<fpst->nccnt; ++i )
+ free(fpst->nclass[i]);
+ for ( i=0; i<fpst->bccnt; ++i )
+ free(fpst->bclass[i]);
+ for ( i=0; i<fpst->fccnt; ++i )
+ free(fpst->fclass[i]);
+ free(fpst->nclass); free(fpst->bclass); free(fpst->fclass);
+ for ( i=0; i<fpst->rule_cnt; ++i ) {
+ FPSTRuleContentsFree( &fpst->rules[i],fpst->format );
}
- chunkfree(pst,sizeof(PST));
+ free(fpst->rules);
+ chunkfree(fpst,sizeof(FPST));
+ fpst = next;
}
}
@@ -4934,38 +3874,84 @@ void AltUniFree(struct altuni *altuni) {
void LayerDefault(Layer *layer) {
memset(layer,0,sizeof(Layer));
-#ifdef FONTFORGE_CONFIG_TYPE3
- layer->fill_brush.opacity = layer->stroke_pen.brush.opacity = 1.0;
- layer->fill_brush.col = layer->stroke_pen.brush.col = COLOR_INHERITED;
- layer->stroke_pen.width = 10;
- layer->stroke_pen.linecap = lc_round;
- layer->stroke_pen.linejoin = lj_round;
- layer->dofill = true;
- layer->fillfirst = true;
- layer->stroke_pen.trans[0] = layer->stroke_pen.trans[3] = 1.0;
- layer->stroke_pen.trans[1] = layer->stroke_pen.trans[2] = 0.0;
- /* Dashes default to an unbroken line */
-#endif
}
-SplineChar *SplineCharCreate(void) {
+SplineChar *SplineCharCreate(int layer_cnt) {
SplineChar *sc = chunkalloc(sizeof(SplineChar));
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
+ int i;
+
sc->color = COLOR_DEFAULT;
-#endif
sc->orig_pos = 0xffff;
sc->unicodeenc = -1;
- sc->layer_cnt = 2;
-#ifdef FONTFORGE_CONFIG_TYPE3
- sc->layers = gcalloc(2,sizeof(Layer));
- LayerDefault(&sc->layers[0]);
- LayerDefault(&sc->layers[1]);
-#endif
- sc->tex_height = sc->tex_depth = sc->tex_sub_pos = sc->tex_super_pos =
+ sc->layer_cnt = layer_cnt;
+ sc->layers = gcalloc(layer_cnt,sizeof(Layer));
+ for ( i=0; i<layer_cnt; ++i )
+ LayerDefault(&sc->layers[i]);
+ sc->tex_height = sc->tex_depth = sc->italic_correction = sc->top_accent_horiz =
TEX_UNDEF;
return( sc );
}
+SplineChar *SFSplineCharCreate(SplineFont *sf) {
+ SplineChar *sc = SplineCharCreate(sf->layer_cnt);
+ int i;
+
+ for ( i=0; i<sf->layer_cnt; ++i ) {
+ sc->layers[i].background = sf->layers[i].background;
+ sc->layers[i].order2 = sf->layers[i].order2;
+ }
+ sc->parent = sf;
+return( sc );
+}
+
+void GlyphVariantsFree(struct glyphvariants *gv) {
+ int i;
+
+ if ( gv==NULL )
+return;
+ free(gv->variants);
+ for ( i=0; i<gv->part_cnt; ++i )
+ free( gv->parts[i].component );
+ free(gv->parts);
+ chunkfree(gv,sizeof(*gv));
+}
+
+struct mathkern *MathKernCopy(struct mathkern *mk) {
+ int i,j;
+ struct mathkern *mknew;
+
+ if ( mk==NULL )
+return( NULL );
+ mknew = chunkalloc(sizeof(*mknew));
+ for ( i=0; i<4; ++i ) {
+ struct mathkernvertex *mkv = &(&mk->top_right)[i];
+ struct mathkernvertex *mknewv = &(&mknew->top_right)[i];
+ mknewv->cnt = mkv->cnt;
+ if ( mknewv->cnt!=0 ) {
+ mknewv->mkd = gcalloc(mkv->cnt,sizeof(struct mathkerndata));
+ for ( j=0; j<mkv->cnt; ++j ) {
+ mknewv->mkd[j].height = mkv->mkd[j].height;
+ mknewv->mkd[j].kern = mkv->mkd[j].kern;
+ }
+ }
+ }
+return( mknew );
+}
+
+void MathKernVContentsFree(struct mathkernvertex *mk) {
+ free(mk->mkd);
+}
+
+void MathKernFree(struct mathkern *mk) {
+ int i;
+
+ if ( mk==NULL )
+return;
+ for ( i=0; i<4; ++i )
+ MathKernVContentsFree( &(&mk->top_right)[i] );
+ chunkfree(mk,sizeof(*mk));
+}
+
void SplineCharListsFree(struct splinecharlist *dlist) {
struct splinecharlist *dnext;
for ( ; dlist!=NULL; dlist = dnext ) {
@@ -4974,6 +3960,15 @@ void SplineCharListsFree(struct splinecharlist *dlist) {
}
}
+void LayerFreeContents(SplineChar *sc,int layer) {
+ SplinePointListsFree(sc->layers[layer].splines);
+ RefCharsFree(sc->layers[layer].refs);
+ ImageListsFree(sc->layers[layer].images);
+ /* image garbage collection????!!!! */
+ UndoesFree(sc->layers[layer].undoes);
+ UndoesFree(sc->layers[layer].redoes);
+}
+
void SplineCharFreeContents(SplineChar *sc) {
int i;
@@ -4981,14 +3976,8 @@ void SplineCharFreeContents(SplineChar *sc) {
return;
free(sc->name);
free(sc->comment);
- for ( i=0; i<sc->layer_cnt; ++i ) {
- SplinePointListsFree(sc->layers[i].splines);
- RefCharsFree(sc->layers[i].refs);
- ImageListsFree(sc->layers[i].images);
- /* image garbage collection????!!!! */
- UndoesFree(sc->layers[i].undoes);
- UndoesFree(sc->layers[i].redoes);
- }
+ for ( i=0; i<sc->layer_cnt; ++i )
+ LayerFreeContents(sc,i);
StemInfosFree(sc->hstem);
StemInfosFree(sc->vstem);
DStemInfosFree(sc->dstem);
@@ -5000,11 +3989,14 @@ return;
PSTFree(sc->possub);
free(sc->ttf_instrs);
free(sc->countermasks);
-#ifdef FONTFORGE_CONFIG_TYPE3
free(sc->layers);
-#endif
AltUniFree(sc->altuni);
-#ifndef _NO_PYTHON
+ GlyphVariantsFree(sc->horiz_variants);
+ GlyphVariantsFree(sc->vert_variants);
+ MathKernFree(sc->mathkern);
+#if defined(_NO_PYTHON)
+ free( sc->python_persistent ); /* It's a string of pickled data which we leave as a string */
+#else
PyFF_FreeSC(sc);
#endif
}
@@ -5097,18 +4089,6 @@ return( NULL );
new->firsts[i] = copy(kc->firsts[i]);
for ( i=0; i<new->second_cnt; ++i )
new->seconds[i] = copy(kc->seconds[i]);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- new->adjusts = gcalloc(new->first_cnt*new->second_cnt,sizeof(DeviceTable));
- memcpy(new->adjusts,kc->adjusts, new->first_cnt*new->second_cnt*sizeof(DeviceTable));
- for ( i=new->first_cnt*new->second_cnt-1; i>=0 ; --i ) {
- if ( new->adjusts[i].corrections!=NULL ) {
- int8 *old = new->adjusts[i].corrections;
- int len = new->adjusts[i].last_pixel_size - new->adjusts[i].first_pixel_size + 1;
- new->adjusts[i].corrections = galloc(len);
- memcpy(new->adjusts[i].corrections,old,len);
- }
- }
-#endif
new->next = NULL;
return( new );
}
@@ -5123,11 +4103,6 @@ void KernClassFreeContents(KernClass *kc) {
free(kc->firsts);
free(kc->seconds);
free(kc->offsets);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
- for ( i=kc->first_cnt*kc->second_cnt-1; i>=0 ; --i )
- free(kc->adjusts[i].corrections);
- free(kc->adjusts);
-#endif
}
void KernClassListFree(KernClass *kc) {
@@ -5293,9 +4268,57 @@ void MarkClassFree(int cnt,char **classes,char **names) {
free( names );
}
+struct baselangextent *BaseLangCopy(struct baselangextent *extent) {
+ struct baselangextent *head, *last, *cur;
+
+ last = head = NULL;
+ for ( ; extent!=NULL; extent = extent->next ) {
+ cur = chunkalloc(sizeof(struct baselangextent));
+ *cur = *extent;
+ cur->features = BaseLangCopy(cur->features);
+ if ( head==NULL )
+ head = cur;
+ else
+ last->next = cur;
+ last = cur;
+ }
+return( head );
+}
+
+void BaseLangFree(struct baselangextent *extent) {
+ struct baselangextent *next;
+
+ while ( extent!=NULL ) {
+ next = extent->next;
+ BaseLangFree(extent->features);
+ chunkfree(extent,sizeof(struct baselangextent));
+ extent = next;
+ }
+}
+
+void BaseScriptFree(struct basescript *bs) {
+ struct basescript *next;
+
+ while ( bs!=NULL ) {
+ next = bs->next;
+ free(bs->baseline_pos);
+ BaseLangFree(bs->langs);
+ chunkfree(bs,sizeof(struct basescript));
+ bs = next;
+ }
+}
+
+void BaseFree(struct Base *base) {
+ if ( base==NULL )
+return;
+
+ free(base->baseline_tags);
+ BaseScriptFree(base->scripts);
+ chunkfree(base,sizeof(struct Base));
+}
+
void SplineFontFree(SplineFont *sf) {
int i;
- BDFFont *bdf, *bnext;
if ( sf==NULL )
return;
@@ -5303,12 +4326,6 @@ return;
MMSetFree(sf->mm);
return;
}
- CopyBufferClearCopiedFrom(sf);
- PasteRemoveSFAnchors(sf);
- for ( bdf = sf->bitmaps; bdf!=NULL; bdf = bnext ) {
- bnext = bdf->next;
- BDFFontFree(bdf);
- }
for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
SplineCharFree(sf->glyphs[i]);
free(sf->glyphs);
@@ -5326,10 +4343,11 @@ return;
free(sf->cidregistry);
free(sf->ordering);
MacFeatListFree(sf->features);
- /* We don't free the EncMap. That field is only a temporary pointer. Let the FontView free it, that's where it really lives */
+ /* We don't free the EncMap. That field is only a temporary pointer. Let the FontViewBase free it, that's where it really lives */
SplinePointListsFree(sf->grid.splines);
AnchorClassesFree(sf->anchor);
TtfTablesFree(sf->ttf_tables);
+ TtfTablesFree(sf->ttf_tab_saved);
UndoesFree(sf->grid.undoes);
UndoesFree(sf->grid.redoes);
PSDictFree(sf->private);
@@ -5347,6 +4365,13 @@ return;
OtfNameListFree(sf->fontstyle_name);
MarkClassFree(sf->mark_class_cnt,sf->mark_classes,sf->mark_class_names);
free( sf->gasp );
+#if defined(_NO_PYTHON)
+ free( sf->python_persistent ); /* It's a string of pickled data which we leave as a string */
+#else
+ PyFF_FreeSF(sf);
+#endif
+ BaseFree(sf->horiz_base);
+ BaseFree(sf->vert_base);
free(sf);
}
@@ -5389,267 +4414,6 @@ void MMSetFree(MMSet *mm) {
chunkfree(mm,sizeof(*mm));
}
-static int xcmp(const void *_p1, const void *_p2) {
- const SplinePoint * const *_spt1 = _p1, * const *_spt2 = _p2;
- const SplinePoint *sp1 = *_spt1, *sp2 = *_spt2;
-
- if ( sp1->me.x>sp2->me.x )
-return( 1 );
- else if ( sp1->me.x<sp2->me.x )
-return( -1 );
-
-return( 0 );
-}
-
-static int ycmp(const void *_p1, const void *_p2) {
- const SplinePoint * const *_spt1 = _p1, * const *_spt2 = _p2;
- const SplinePoint *sp1 = *_spt1, *sp2 = *_spt2;
-
- if ( sp1->me.y>sp2->me.y )
-return( 1 );
- else if ( sp1->me.y<sp2->me.y )
-return( -1 );
-
-return( 0 );
-}
-
-struct cluster {
- int cnt;
- int first, last;
-};
-
-static void countcluster(SplinePoint **ptspace, struct cluster *cspace,
- int ptcnt, int is_y, int i, double within, double max) {
- int j;
-
- cspace[i].cnt = 1; /* current point is always within its own cluster */
- cspace[i].first = cspace[i].last = i;
- for ( j=i-1; j>=0; --j ) {
- if ( cspace[j].cnt==0 ) /* Already allocated to a different cluster */
- break;
- if ( (&ptspace[j+1]->me.x)[is_y]-(&ptspace[j]->me.x)[is_y]<within &&
- (&ptspace[i]->me.x)[is_y]-(&ptspace[j]->me.x)[is_y]<max ) {
- ++cspace[i].cnt;
- cspace[i].first = j;
- } else
- break;
- }
- for ( j=i+1; j<ptcnt; ++j ) {
- if ( cspace[j].cnt==0 ) /* Already allocated to a different cluster */
- break;
- if ( (&ptspace[j]->me.x)[is_y]-(&ptspace[j-1]->me.x)[is_y]<within &&
- (&ptspace[j]->me.x)[is_y]-(&ptspace[i]->me.x)[is_y]<max ) {
- ++cspace[i].cnt;
- cspace[i].last = j;
- } else
- break;
- }
-}
-
-static int _SplineCharRoundToCluster(SplineChar *sc,SplinePoint **ptspace,
- struct cluster *cspace,int ptcnt,int is_y,int dohints,
- int layer, int changed,
- double within, double max ) {
- int i,j,best;
- double low,high,cur;
-
- for ( i=0; i<ptcnt; ++i )
- cspace[i].cnt = 1; /* Initialize to non-zero */
- for ( i=0; i<ptcnt; ++i )
- countcluster(ptspace,cspace,ptcnt,is_y,i,within,max);
-
- forever {
- j=0; best = cspace[0].cnt;
- for ( i=1; i<ptcnt; ++i ) {
- if ( cspace[i].cnt>best ) {
- j=i;
- best = cspace[i].cnt;
- }
- }
- if ( best<=1 ) /* No more clusters */
-return( changed );
- for ( i=j+1; i<=cspace[j].last && cspace[i].cnt==cspace[j].cnt; ++i );
- j = (j+i-1)/2; /* There are probably several points with the */
- /* same values for cspace. Pick one in the */
- /* middle, so that when round we round to the */
- /* middle rather than to an edge */
- low = (&ptspace[cspace[j].first]->me.x)[is_y];
- high = (&ptspace[cspace[j].last]->me.x)[is_y];
- cur = (&ptspace[j]->me.x)[is_y];
- if ( low==high ) {
- for ( i=cspace[j].first; i<=cspace[j].last; ++i )
- cspace[i].cnt = 0;
- continue;
- }
- if ( !changed ) {
- if ( layer==-2 )
- SCPreserveState(sc,dohints);
- else if ( layer!=-1 )
- SCPreserveLayer(sc,layer,dohints);
- changed = true;
- }
- for ( i=cspace[j].first; i<=cspace[j].last; ++i ) {
- double off = (&ptspace[i]->me.x)[is_y] - cur;
- (&ptspace[i]->nextcp.x)[is_y] -= off;
- (&ptspace[i]->prevcp.x)[is_y] -= off;
- (&ptspace[i]->me.x)[is_y] -= off;
- if ( (&ptspace[i]->prevcp.x)[is_y]-cur>-within &&
- (&ptspace[i]->prevcp.x)[is_y]-cur<within ) {
- (&ptspace[i]->prevcp.x)[is_y] = cur;
- if ( (&ptspace[i]->prevcp.x)[!is_y]==(&ptspace[i]->me.x)[!is_y] )
- ptspace[i]->noprevcp = true;
- }
- if ( (&ptspace[i]->nextcp.x)[is_y]-cur>-within &&
- (&ptspace[i]->nextcp.x)[is_y]-cur<within ) {
- (&ptspace[i]->nextcp.x)[is_y] = cur;
- if ( (&ptspace[i]->nextcp.x)[!is_y]==(&ptspace[i]->me.x)[!is_y] )
- ptspace[i]->nonextcp = true;
- }
- cspace[i].cnt = 0;
- }
- if ( dohints ) {
- StemInfo *h = is_y ? sc->hstem : sc->vstem;
- while ( h!=NULL && h->start<=high ) {
- if ( h->start>=low ) {
- h->width -= (h->start-cur);
- h->start = cur;
- }
- if ( h->start+h->width>=low && h->start+h->width<=high )
- h->width = cur-h->start;
- h = h->next;
- }
- }
- /* Ok, surrounding points can no longer use the ones allocated to */
- /* this cluster. So refigure them */
- for ( i=cspace[j].first-1; i>=0 &&
- ( (&ptspace[i]->me.x)[is_y]-cur>-max && (&ptspace[i]->me.x)[is_y]-cur<max ); --i )
- countcluster(ptspace,cspace,ptcnt,is_y,i,within,max);
- for ( i=cspace[j].last+1; i<ptcnt &&
- ( (&ptspace[i]->me.x)[is_y]-cur>-max && (&ptspace[i]->me.x)[is_y]-cur<max ); ++i )
- countcluster(ptspace,cspace,ptcnt,is_y,i,within,max);
- }
-}
-
-int SCRoundToCluster(SplineChar *sc,int layer,int sel,double within,double max) {
- /* Do a cluster analysis on the points in this character. Look at each */
- /* axis in turn. Order all points in char along this axis. For each pt: */
- /* look at the two points before & after it. If those to pts are within */
- /* the error bound (within) then continue until we reach a point that */
- /* is further from its nearest point than "within" or is further from */
- /* the center point than "max". Count all the points we have found. */
- /* These points make up the cluster centered on this point. */
- /* Then find the largest cluster & round everything to the center point */
- /* (shift each point & its cps to center point. Then if cps are "within" */
- /* set the cps to the center point too) */
- /* Refigure all clusters within "max" of this one, Find the next largest */
- /* cluster, and continue. We stop when the largest cluster has only one */
- /* point in it */
- /* if "sel" is true then we are only interested in selected points */
- /* (if there are no selected points then all points in the current layer) */
- /* if "layer"==-1 then use sf->grid. if layer==-2 then all foreground layers*/
- /* if "layer"==ly_fore or -2 then round hints that fall in our clusters too*/
- int ptcnt, selcnt;
- int l,k,changed;
- SplineSet *spl;
- SplinePoint *sp;
- SplinePoint **ptspace;
- struct cluster *cspace;
- Spline *s, *first;
-
- ptspace = NULL;
- /* First figure out what points we will need */
- for ( k=0; k<2; ++k ) {
- ptcnt = selcnt = 0;
- if ( layer==-2 ) {
- for ( l=ly_fore; l<sc->layer_cnt; ++l ) {
- for ( spl = sc->layers[l].splines; spl!=NULL; spl=spl->next ) {
- for ( sp = spl->first; ; ) {
- if ( k && (!sel || (sel && sp->selected)) )
- ptspace[ptcnt++] = sp;
- else if ( !k )
- ++ptcnt;
- if ( sp->selected ) ++selcnt;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
- }
- } else {
- if ( layer==-1 )
- spl = sc->parent->grid.splines;
- else
- spl = sc->layers[layer].splines;
- for ( ; spl!=NULL; spl=spl->next ) {
- for ( sp = spl->first; ; ) {
- if ( k && (!sel || (sel && sp->selected)) )
- ptspace[ptcnt++] = sp;
- else if ( !k )
- ++ptcnt;
- if ( sp->selected ) ++selcnt;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- }
- }
- if ( sel && selcnt==0 )
- sel = false;
- if ( sel ) ptcnt = selcnt;
- if ( ptcnt<=1 )
-return(false); /* Can't be any clusters */
- if ( k==0 )
- ptspace = galloc((ptcnt+1)*sizeof(SplinePoint *));
- else
- ptspace[ptcnt] = NULL;
- }
-
- cspace = galloc(ptcnt*sizeof(struct cluster));
-
- qsort(ptspace,ptcnt,sizeof(SplinePoint *),xcmp);
- changed = _SplineCharRoundToCluster(sc,ptspace,cspace,ptcnt,false,
- (layer==-2 || layer==ly_fore) && !sel,layer,false,within,max);
-
- qsort(ptspace,ptcnt,sizeof(SplinePoint *),ycmp);
- changed = _SplineCharRoundToCluster(sc,ptspace,cspace,ptcnt,true,
- (layer==-2 || layer==ly_fore) && !sel,layer,changed,within,max);
-
- free(ptspace);
- free(cspace);
-
- if ( changed ) {
- if ( layer==-2 ) {
- for ( l=ly_fore; l<sc->layer_cnt; ++l ) {
- for ( spl = sc->layers[l].splines; spl!=NULL; spl=spl->next ) {
- first = NULL;
- for ( s=spl->first->next; s!=NULL && s!=first; s=s->to->next ) {
- SplineRefigure(s);
- if ( first==NULL ) first = s;
- }
- }
- }
- } else {
- if ( layer==-1 )
- spl = sc->parent->grid.splines;
- else
- spl = sc->layers[layer].splines;
- for ( ; spl!=NULL; spl=spl->next ) {
- first = NULL;
- for ( s=spl->first->next; s!=NULL && s!=first; s=s->to->next ) {
- SplineRefigure(s);
- if ( first==NULL ) first = s;
- }
- }
- }
- SCCharChangedUpdate(sc);
- }
-return( changed );
-}
-
static int SplineRemoveAnnoyingExtrema1(Spline *s,int which,double err_sq) {
/* Remove extrema which are very close to one of the spline end-points */
/* and which are in the oposite direction (along the normal of the */
@@ -5774,3 +4538,87 @@ int SplineSetsRemoveAnnoyingExtrema(SplineSet *ss,double err) {
}
return( changed );
}
+
+SplinePoint *SplineBisect(Spline *spline, extended t) {
+ Spline1 xstart, xend;
+ Spline1 ystart, yend;
+ Spline *spline1, *spline2;
+ SplinePoint *mid;
+ SplinePoint *old0, *old1;
+ Spline1D *xsp = &spline->splines[0], *ysp = &spline->splines[1];
+ int order2 = spline->order2;
+
+#ifdef DEBUG
+ if ( t<=1e-3 || t>=1-1e-3 )
+ IError("Bisection to create a zero length spline");
+#endif
+ xstart.s0 = xsp->d; ystart.s0 = ysp->d;
+ xend.s1 = (extended) xsp->a+xsp->b+xsp->c+xsp->d;
+ yend.s1 = (extended) ysp->a+ysp->b+ysp->c+ysp->d;
+ xstart.s1 = xend.s0 = ((xsp->a*t+xsp->b)*t+xsp->c)*t + xsp->d;
+ ystart.s1 = yend.s0 = ((ysp->a*t+ysp->b)*t+ysp->c)*t + ysp->d;
+ FigureSpline1(&xstart,0,t,xsp);
+ FigureSpline1(&xend,t,1,xsp);
+ FigureSpline1(&ystart,0,t,ysp);
+ FigureSpline1(&yend,t,1,ysp);
+
+ mid = chunkalloc(sizeof(SplinePoint));
+ mid->me.x = xstart.s1; mid->me.y = ystart.s1;
+ if ( order2 ) {
+ mid->nextcp.x = xend.sp.d + xend.sp.c/2;
+ mid->nextcp.y = yend.sp.d + yend.sp.c/2;
+ mid->prevcp.x = xstart.sp.d + xstart.sp.c/2;
+ mid->prevcp.y = ystart.sp.d + ystart.sp.c/2;
+ } else {
+ mid->nextcp.x = xend.c0; mid->nextcp.y = yend.c0;
+ mid->prevcp.x = xstart.c1; mid->prevcp.y = ystart.c1;
+ }
+ if ( mid->me.x==mid->nextcp.x && mid->me.y==mid->nextcp.y )
+ mid->nonextcp = true;
+ if ( mid->me.x==mid->prevcp.x && mid->me.y==mid->prevcp.y )
+ mid->noprevcp = true;
+
+ old0 = spline->from; old1 = spline->to;
+ if ( order2 ) {
+ old0->nextcp = mid->prevcp;
+ old1->prevcp = mid->nextcp;
+ } else {
+ old0->nextcp.x = xstart.c0; old0->nextcp.y = ystart.c0;
+ old1->prevcp.x = xend.c1; old1->prevcp.y = yend.c1;
+ }
+ old0->nonextcp = (old0->nextcp.x==old0->me.x && old0->nextcp.y==old0->me.y);
+ old1->noprevcp = (old1->prevcp.x==old1->me.x && old1->prevcp.y==old1->me.y);
+ old0->nextcpdef = false;
+ old1->prevcpdef = false;
+ SplineFree(spline);
+
+ spline1 = chunkalloc(sizeof(Spline));
+ spline1->splines[0] = xstart.sp; spline1->splines[1] = ystart.sp;
+ spline1->from = old0;
+ spline1->to = mid;
+ spline1->order2 = order2;
+ old0->next = spline1;
+ mid->prev = spline1;
+ if ( SplineIsLinear(spline1)) {
+ spline1->islinear = spline1->from->nonextcp = spline1->to->noprevcp = true;
+ spline1->from->nextcp = spline1->from->me;
+ spline1->to->prevcp = spline1->to->me;
+ }
+ SplineRefigure(spline1);
+
+ spline2 = chunkalloc(sizeof(Spline));
+ spline2->splines[0] = xend.sp; spline2->splines[1] = xend.sp;
+ spline2->from = mid;
+ spline2->to = old1;
+ spline2->order2 = order2;
+ mid->next = spline2;
+ old1->prev = spline2;
+ if ( SplineIsLinear(spline2)) {
+ spline2->islinear = spline2->from->nonextcp = spline2->to->noprevcp = true;
+ spline2->from->nextcp = spline2->from->me;
+ spline2->to->prevcp = spline2->to->me;
+ }
+ SplineRefigure(spline2);
+return( mid );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineutil2.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c
index 036446f02a7..43626aec6dc 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/splineutil2.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -33,6 +33,16 @@
#include <stdlib.h>
#include "views.h" /* For SCCharChangedUpdate */
+int new_em_size = 1000;
+int new_fonts_are_order2 = false;
+int loaded_fonts_same_as_new = false;
+int default_fv_row_count = 4;
+int default_fv_col_count = 16;
+int default_fv_font_size = 24;
+int default_fv_antialias=true;
+int default_fv_bbsized=true;
+int snaptoint=0;
+
/*#define DEBUG 1*/
int RealNear(real a,real b) {
@@ -211,187 +221,18 @@ return( true );
spline->from->nextcp = spline->from->me;
if ( spline->from->nonextcp && spline->from->noprevcp )
spline->from->pointtype = pt_corner;
- else if ( spline->from->pointtype == pt_curve )
+ else if ( spline->from->pointtype == pt_curve || spline->from->pointtype == pt_hvcurve )
spline->from->pointtype = pt_tangent;
spline->to->prevcp = spline->to->me;
if ( spline->to->nonextcp && spline->to->noprevcp )
spline->to->pointtype = pt_corner;
- else if ( spline->to->pointtype == pt_curve )
+ else if ( spline->to->pointtype == pt_curve || spline->to->pointtype == pt_hvcurve )
spline->to->pointtype = pt_tangent;
SplineRefigure(spline);
}
return( spline->islinear );
}
-typedef struct spline1 {
- Spline1D sp;
- real s0, s1;
- real c0, c1;
-} Spline1;
-
-static void FigureSpline1(Spline1 *sp1,bigreal t0, bigreal t1, Spline1D *sp ) {
- bigreal s = (t1-t0);
- if ( sp->a==0 && sp->b==0 ) {
- sp1->sp.d = sp->d + t0*sp->c;
- sp1->sp.c = s*sp->c;
- sp1->sp.b = sp1->sp.a = 0;
- } else {
- sp1->sp.d = sp->d + t0*(sp->c + t0*(sp->b + t0*sp->a));
- sp1->sp.c = s*(sp->c + t0*(2*sp->b + 3*sp->a*t0));
- sp1->sp.b = s*s*(sp->b+3*sp->a*t0);
- sp1->sp.a = s*s*s*sp->a;
-#if 0 /* Got invoked once on a perfectly good spline */
- sp1->s1 = sp1->sp.a+sp1->sp.b+sp1->sp.c+sp1->sp.d;
- if ( ((sp1->s1>.001 || sp1->s1<-.001) && !RealNear((double) sp1->sp.a+sp1->sp.b+sp1->sp.c+sp1->sp.d,sp1->s1)) ||
- !RealNear(sp1->sp.d,sp1->s0))
- IError( "Created spline does not work in FigureSpline1");
-#endif
- }
- sp1->c0 = sp1->sp.c/3 + sp1->sp.d;
- sp1->c1 = sp1->c0 + (sp1->sp.b+sp1->sp.c)/3;
-}
-
-SplinePoint *SplineBisect(Spline *spline, extended t) {
- Spline1 xstart, xend;
- Spline1 ystart, yend;
- Spline *spline1, *spline2;
- SplinePoint *mid;
- SplinePoint *old0, *old1;
- Spline1D *xsp = &spline->splines[0], *ysp = &spline->splines[1];
- int order2 = spline->order2;
-
-#ifdef DEBUG
- if ( t<=1e-3 || t>=1-1e-3 )
- IError("Bisection to create a zero length spline");
-#endif
- xstart.s0 = xsp->d; ystart.s0 = ysp->d;
- xend.s1 = (extended) xsp->a+xsp->b+xsp->c+xsp->d;
- yend.s1 = (extended) ysp->a+ysp->b+ysp->c+ysp->d;
- xstart.s1 = xend.s0 = ((xsp->a*t+xsp->b)*t+xsp->c)*t + xsp->d;
- ystart.s1 = yend.s0 = ((ysp->a*t+ysp->b)*t+ysp->c)*t + ysp->d;
- FigureSpline1(&xstart,0,t,xsp);
- FigureSpline1(&xend,t,1,xsp);
- FigureSpline1(&ystart,0,t,ysp);
- FigureSpline1(&yend,t,1,ysp);
-
- mid = chunkalloc(sizeof(SplinePoint));
- mid->me.x = xstart.s1; mid->me.y = ystart.s1;
- if ( order2 ) {
- mid->nextcp.x = xend.sp.d + xend.sp.c/2;
- mid->nextcp.y = yend.sp.d + yend.sp.c/2;
- mid->prevcp.x = xstart.sp.d + xstart.sp.c/2;
- mid->prevcp.y = ystart.sp.d + ystart.sp.c/2;
- } else {
- mid->nextcp.x = xend.c0; mid->nextcp.y = yend.c0;
- mid->prevcp.x = xstart.c1; mid->prevcp.y = ystart.c1;
- }
- if ( mid->me.x==mid->nextcp.x && mid->me.y==mid->nextcp.y )
- mid->nonextcp = true;
- if ( mid->me.x==mid->prevcp.x && mid->me.y==mid->prevcp.y )
- mid->noprevcp = true;
-
- old0 = spline->from; old1 = spline->to;
- if ( order2 ) {
- old0->nextcp = mid->prevcp;
- old1->prevcp = mid->nextcp;
- } else {
- old0->nextcp.x = xstart.c0; old0->nextcp.y = ystart.c0;
- old1->prevcp.x = xend.c1; old1->prevcp.y = yend.c1;
- }
- old0->nonextcp = (old0->nextcp.x==old0->me.x && old0->nextcp.y==old0->me.y);
- old1->noprevcp = (old1->prevcp.x==old1->me.x && old1->prevcp.y==old1->me.y);
- old0->nextcpdef = false;
- old1->prevcpdef = false;
- SplineFree(spline);
-
- spline1 = chunkalloc(sizeof(Spline));
- spline1->splines[0] = xstart.sp; spline1->splines[1] = ystart.sp;
- spline1->from = old0;
- spline1->to = mid;
- spline1->order2 = order2;
- old0->next = spline1;
- mid->prev = spline1;
- if ( SplineIsLinear(spline1)) {
- spline1->islinear = spline1->from->nonextcp = spline1->to->noprevcp = true;
- spline1->from->nextcp = spline1->from->me;
- spline1->to->prevcp = spline1->to->me;
- }
- SplineRefigure(spline1);
-
- spline2 = chunkalloc(sizeof(Spline));
- spline2->splines[0] = xend.sp; spline2->splines[1] = xend.sp;
- spline2->from = mid;
- spline2->to = old1;
- spline2->order2 = order2;
- mid->next = spline2;
- old1->prev = spline2;
- if ( SplineIsLinear(spline2)) {
- spline2->islinear = spline2->from->nonextcp = spline2->to->noprevcp = true;
- spline2->from->nextcp = spline2->from->me;
- spline2->to->prevcp = spline2->to->me;
- }
- SplineRefigure(spline2);
-return( mid );
-}
-
-Spline *SplineSplit(Spline *spline, extended ts[3]) {
- /* Split the current spline in up to 3 places */
- Spline1 splines[2][4];
- int i,cnt;
- bigreal base;
- SplinePoint *last, *sp;
- Spline *new;
- int order2 = spline->order2;
-
- memset(splines,0,sizeof(splines));
- base=0;
- for ( i=cnt=0; i<3 && ts[i]!=-1; ++i ) {
- if ( base>1-1e-3 ) /* Avoid tiny splines */
- break;
- else if ( base<ts[i]-1e-3 ) {
- FigureSpline1(&splines[0][cnt],base,ts[i],&spline->splines[0]);
- FigureSpline1(&splines[1][cnt++],base,ts[i],&spline->splines[1]);
- base = ts[i];
- }
- }
- if ( base==0 )
-return( spline );
-
- FigureSpline1(&splines[0][cnt],base,1.0,&spline->splines[0]);
- FigureSpline1(&splines[1][cnt],base,1.0,&spline->splines[1]);
-
- last = spline->from;
- for ( i=0; i<=cnt; ++i ) {
- if ( order2 ) {
- last->nextcp.x = splines[0][i].sp.d+splines[0][i].sp.c/2;
- last->nextcp.y = splines[1][i].sp.d+splines[1][i].sp.c/2;
- } else {
- last->nextcp.x = splines[0][i].c0;
- last->nextcp.y = splines[1][i].c0;
- }
- if ( i==cnt )
- sp = spline->to;
- else {
- sp = chunkalloc(sizeof(SplinePoint));
- sp->me.x = splines[0][i+1].sp.d;
- sp->me.y = splines[1][i+1].sp.d;
- }
- if ( order2 ) {
- sp->prevcp = last->nextcp;
- SplineMake2(last,sp);
- } else {
- sp->prevcp.x = splines[0][i].c1;
- sp->prevcp.y = splines[1][i].c1;
- SplineMake3(last,sp);
- }
- last = sp;
- }
-
- new = spline->from->next;
- SplineFree(spline);
-return( new );
-}
-
static Spline *IsLinearApprox(SplinePoint *from, SplinePoint *to,
TPoint *mid, int cnt, int order2) {
double vx, vy, slope;
@@ -417,29 +258,6 @@ return( NULL );
return( SplineMake(from,to,order2) );
}
-#if 0
-static void CleanupDir(BasePoint *newcp,BasePoint *oldcp,BasePoint *base) {
- double orig, new;
- orig = atan2(oldcp->y-base->y,oldcp->x-base->x);
- new = atan2(newcp->y-base->y,newcp->x-base->x);
- if ( !RealNearish(orig,new)) {
- double c = cos(orig), s = sin(orig);
- /*double len = sqrt((newcp->x-base->x)*(newcp->x-base->x) + (newcp->y-base->y)*(newcp->y-base->y));*/
- /* use dot product rather than length */
- double len;
- if ( c<1e-6 && c>-1e-6 ) { c=0; if ( s<0 ) s=-1; else s=1; }
- if ( s<1e-6 && s>-1e-6 ) { s=0; if ( c<0 ) c=-1; else c=1; }
- len = (newcp->x-base->x)*c + (newcp->y-base->y)*s;
- newcp->x = len*c; newcp->y = len*s;
- if ( newcp->x*(oldcp->x-base->x) + newcp->y*(oldcp->y-base->y)<0 ) {
- IError( "Control points in wrong direction" );
- newcp->x = -newcp->x; newcp->y = -newcp->y;
- }
- newcp->x += base->x; newcp->y += base->y;
- }
-}
-#endif
-
/* Least squares tells us that:
| S(xi*ti^3) | | S(ti^6) S(ti^5) S(ti^4) S(ti^3) | | a |
| S(xi*ti^2) | = | S(ti^5) S(ti^4) S(ti^3) S(ti^2) | * | b |
@@ -823,7 +641,7 @@ static void ApproxBounds(DBounds *b,TPoint *mid, int cnt, struct dotbounds *db)
static int GoodCurve(SplinePoint *sp, int check_prev ) {
double dx, dy, lenx, leny;
- if ( sp->pointtype!=pt_curve )
+ if ( sp->pointtype!=pt_curve && sp->pointtype!=pt_hvcurve )
return( false );
if ( check_prev ) {
dx = sp->me.x - sp->prevcp.x;
@@ -916,9 +734,17 @@ return( ApproximateSplineFromPoints(from,to,mid,cnt,order2) );
/* If we are going to honour the slopes of a quadratic spline, there is */
/* only one possibility */
if ( order2 ) {
- if ( from->nonextcp || to->noprevcp )
-return( ApproximateSplineFromPoints(from,to,mid,cnt,order2) );
- else if ( !IntersectLines(&nextcp,&from->nextcp,&from->me,&to->prevcp,&to->me) ) {
+ if ( from->nonextcp )
+ from->nextcp = from->next->to->me;
+ if ( to->noprevcp )
+ to->prevcp = to->prev->from->me;
+ from->nonextcp = to->noprevcp = false;
+ fromunit.x = from->nextcp.x-from->me.x; fromunit.y = from->nextcp.y-from->me.y;
+ tounit.x = to->prevcp.x-to->me.x; tounit.y = to->prevcp.y-to->me.y;
+
+ if ( !IntersectLines(&nextcp,&from->nextcp,&from->me,&to->prevcp,&to->me) ||
+ (nextcp.x-from->me.x)*fromunit.x + (nextcp.y-from->me.y)*fromunit.y < 0 ||
+ (nextcp.x-to->me.x)*tounit.x + (nextcp.y-to->me.y)*tounit.y < 0 ) {
/* If the slopes don't intersect then use a line */
/* (or if the intersection is patently absurd) */
from->nonextcp = to->noprevcp = true;
@@ -933,13 +759,46 @@ return( SplineMake2(from,to));
}
/* From here down we are only working with cubic splines */
- if ( !to->noprevcp || to->pointtype == pt_corner ) {
+ if ( cnt==0 ) {
+ /* Just use what we've got, no data to improve it */
+ /* But we do sometimes get some cps which are too big */
+ double len = sqrt((to->me.x-from->me.x)*(to->me.x-from->me.x) + (to->me.y-from->me.y)*(to->me.y-from->me.y));
+ if ( len==0 ) {
+ from->nonextcp = to->noprevcp = true;
+ from->nextcp = from->me;
+ to->prevcp = to->me;
+ } else {
+ BasePoint noff, poff;
+ double nlen, plen;
+ noff.x = from->nextcp.x-from->me.x; noff.y = from->nextcp.y-from->me.y;
+ poff.x = to->me.x-to->prevcp.x; poff.y = to->me.y-to->prevcp.y;
+ nlen = sqrt(noff.x*noff.x + noff.y+noff.y);
+ plen = sqrt(poff.x*poff.x + poff.y+poff.y);
+ if ( nlen>len/3 ) {
+ noff.x *= len/3/nlen; noff.y *= len/3/nlen;
+ from->nextcp.x = from->me.x + noff.x;
+ from->nextcp.y = from->me.y + noff.y;
+ }
+ if ( plen>len/3 ) {
+ poff.x *= len/3/plen; poff.y *= len/3/plen;
+ to->prevcp.x = to->me.x + poff.x;
+ to->prevcp.y = to->me.y + poff.y;
+ }
+ }
+return( SplineMake3(from,to));
+ }
+
+ if ( to->prev!=NULL && (( to->noprevcp && to->nonextcp ) || to->prev->knownlinear )) {
+ tounit.x = to->prev->from->me.x-to->me.x; tounit.y = to->prev->from->me.y-to->me.y;
+ } else if ( !to->noprevcp || to->pointtype == pt_corner ) {
tounit.x = to->prevcp.x-to->me.x; tounit.y = to->prevcp.y-to->me.y;
} else {
tounit.x = to->me.x-to->nextcp.x; tounit.y = to->me.y-to->nextcp.y;
}
tlen = sqrt(tounit.x*tounit.x + tounit.y*tounit.y);
- if ( !from->nonextcp || from->pointtype == pt_corner ) {
+ if ( from->next!=NULL && (( from->noprevcp && from->nonextcp ) || from->next->knownlinear) ) {
+ fromunit.x = from->next->to->me.x-from->me.x; fromunit.y = from->next->to->me.y-from->me.y;
+ } else if ( !from->nonextcp || from->pointtype == pt_corner ) {
fromunit.x = from->nextcp.x-from->me.x; fromunit.y = from->nextcp.y-from->me.y;
} else {
fromunit.x = from->me.x-from->prevcp.x; fromunit.y = from->me.y-from->prevcp.y;
@@ -956,7 +815,8 @@ return( SplineMake2(from,to));
}
}
if ( tlen==0 ) {
- if ( to->pointtype==pt_curve && to->next && !to->nonextcp ) {
+ if ( (to->pointtype==pt_curve || to->pointtype==pt_hvcurve) &&
+ to->next && !to->nonextcp ) {
tounit.x = to->me.x-to->nextcp.x; tounit.y = to->me.y-to->nextcp.y;
/* Doesn't work
} else if ( to->pointtype==pt_tangent && to->next ) {
@@ -971,7 +831,8 @@ return( SplineMake2(from,to));
tounit.x /= tlen; tounit.y /= tlen;
if ( flen==0 ) {
- if ( from->pointtype==pt_curve && from->prev && !from->noprevcp ) {
+ if ( (from->pointtype==pt_curve || from->pointtype==pt_hvcurve) &&
+ from->prev && !from->noprevcp ) {
fromunit.x = from->me.x-from->prevcp.x; fromunit.y = from->me.y-from->prevcp.y;
/*
} else if ( from->pointtype==pt_tangent && from->prev ) {
@@ -1128,7 +989,7 @@ return( SplineMake2(from,to));
} else if ( offp+incrp<tmax && tadiff<curdiff &&
(tadiff<=fsdiff && tadiff<=fadiff && tadiff<=tsdiff)) {
offp += incrp;
- if ( betterp>0 )
+ if ( betterp<0 )
incrp /= 2;
betterp = 1;
nocnt = 0;
@@ -1226,6 +1087,7 @@ double SplineLength(Spline *spline) {
return( len );
}
+
static TPoint *SplinesFigureTPsBetween(SplinePoint *from, SplinePoint *to,
int *tot) {
int cnt, i, j, pcnt;
@@ -1296,10 +1158,21 @@ static TPoint *SplinesFigureTPsBetween(SplinePoint *from, SplinePoint *to,
return( tp );
}
+static void SplinePointReCatagorize(SplinePoint *sp,int oldpt) {
+ SplinePointCatagorize(sp);
+ if ( sp->pointtype!=oldpt ) {
+ if ( sp->pointtype==pt_curve && oldpt==pt_hvcurve &&
+ ((sp->nextcp.x == sp->me.x && sp->nextcp.y != sp->me.y ) ||
+ (sp->nextcp.y == sp->me.y && sp->nextcp.x != sp->me.x )))
+ sp->pointtype = pt_hvcurve;
+ }
+}
+
void SplinesRemoveBetween(SplineChar *sc, SplinePoint *from, SplinePoint *to,int type) {
int tot;
TPoint *tp;
SplinePoint *np, oldfrom;
+ int oldfpt = from->pointtype, oldtpt = to->pointtype;
Spline *sp;
int order2 = from->next->order2;
@@ -1324,86 +1197,10 @@ void SplinesRemoveBetween(SplineChar *sc, SplinePoint *from, SplinePoint *to,int
free(tp);
- SplinePointCatagorize(from);
- SplinePointCatagorize(to);
+ SplinePointReCatagorize(from,oldfpt);
+ SplinePointReCatagorize(to,oldtpt);
}
-static void RemoveZeroLengthSplines(SplineSet *spl, int onlyselected, double bound) {
- SplinePoint *curp, *next, *prev;
- double plen, nlen;
-
- bound *= bound;
-
- for ( curp = spl->first, prev=NULL; curp!=NULL ; curp=next ) {
- next = NULL;
- if ( curp->next!=NULL )
- next = curp->next->to;
- if ( curp==next ) /* Once we've worked a contour down to a single point we can't do anything more here. Someone else will have to free the contour */
-return;
- /* Zero length splines give us NaNs */
- if ( curp!=NULL && (curp->selected || !onlyselected) ) {
- plen = nlen = 1e10;
- if ( curp->prev!=NULL )
- plen = (curp->me.x-curp->prev->from->me.x)*(curp->me.x-curp->prev->from->me.x) +
- (curp->me.y-curp->prev->from->me.y)*(curp->me.y-curp->prev->from->me.y);
- if ( curp->next!=NULL )
- nlen = (curp->me.x-next->me.x)*(curp->me.x-next->me.x) +
- (curp->me.y-next->me.y)*(curp->me.y-next->me.y);
- if (( curp->prev!=NULL && plen<=bound && plen<nlen ) ||
- (curp->next!=NULL && nlen<bound && nlen<plen )) {
- if ( curp->prev!=NULL && plen<=bound && plen<nlen ) {
- SplinePoint *other = curp->prev->from;
- other->nextcp = curp->nextcp;
- other->nonextcp = curp->nonextcp;
- other->nextcpdef = curp->nextcpdef;
- other->next = curp->next;
- if ( curp->next!=NULL ) other->next->from = other;
- SplineFree(curp->prev);
- } else {
- SplinePoint *other = next;
- other->prevcp = curp->prevcp;
- other->noprevcp = curp->noprevcp;
- other->prevcpdef = curp->prevcpdef;
- other->prev = curp->prev;
- if ( curp->prev!=NULL ) other->prev->to = other;
- SplineFree(curp->next);
- }
- SplinePointFree(curp);
- if ( spl->first==curp ) {
- spl->first = next;
- if ( spl->last==curp )
- spl->last = next;
- } else if ( spl->last==curp )
- spl->last = prev;
- } else
- prev = curp;
- } else
- prev = curp;
- if ( next==spl->first )
- break;
- }
-}
-
-SplineSet *SSRemoveZeroLengthSplines(SplineSet *base) {
- SplineSet *spl, *prev, *next;
-
- for ( prev = NULL, spl=base; spl!=NULL; spl=next ) {
- next = spl->next;
- if ( spl->first->next!=NULL && spl->first->next->to==spl->first &&
- spl->first->nonextcp && spl->first->noprevcp ) {
- if ( prev==NULL )
- base = next;
- else
- prev->next = next;
- spl->next = NULL;
- SplinePointListFree(spl);
- } else {
- RemoveZeroLengthSplines(spl,false,0);
- prev = spl;
- }
- }
-return( base );
-}
static void RemoveStupidControlPoints(SplineSet *spl) {
double len, normal, dir;
@@ -1572,1260 +1369,6 @@ void SSOverlapClusterCpAngles(SplineSet *base,double within) {
OverlapClusterCpAngles(spl,within);
}
-static SplinePointList *SplinePointListMerge(SplineChar *sc, SplinePointList *spl,int type) {
- Spline *spline, *first;
- SplinePoint *nextp, *curp, *selectme;
- int all;
-
- /* If the entire splineset is selected, it should merge into oblivion */
- first = NULL;
- all = spl->first->selected;
- for ( spline = spl->first->next; spline!=NULL && spline!=first && all; spline=spline->to->next ) {
- if ( !spline->to->selected ) all = false;
- if ( first==NULL ) first = spline;
- }
- if ( spl->first->next!=NULL && spl->first->next->to==spl->first &&
- spl->first->nonextcp && spl->first->noprevcp )
- all = true; /* Merge away any splines which are just dots */
- if ( all )
-return( NULL ); /* Some one else should free it and reorder the spline set list */
- RemoveZeroLengthSplines(spl,true,.3);
-
- if ( spl->first!=spl->last ) {
- /* If the spline isn't closed, then any selected points at the ends */
- /* get deleted */
- while ( spl->first->selected ) {
- nextp = spl->first->next->to;
- SplineFree(spl->first->next);
- SplinePointMDFree(sc,spl->first);
- spl->first = nextp;
- nextp->prev = NULL;
- }
- while ( spl->last->selected ) {
- nextp = spl->last->prev->from;
- SplineFree(spl->last->prev);
- SplinePointMDFree(sc,spl->last);
- spl->last = nextp;
- nextp->next = NULL;
- }
- } else {
- while ( spl->first->selected ) {
- spl->first = spl->first->next->to;
- spl->last = spl->first;
- }
- }
-
- /* when we get here spl->first is not selected */
- if ( spl->first->selected ) IError( "spl->first is selected in SplinePointListMerge");
- curp = spl->first;
- selectme = NULL;
- while ( 1 ) {
- while ( !curp->selected ) {
- if ( curp->next==NULL )
- curp = NULL;
- else
- curp = curp->next->to;
- if ( curp==spl->first || curp==NULL )
- break;
- }
- if ( curp==NULL || !curp->selected )
- break;
- for ( nextp=curp->next->to; nextp->selected; nextp = nextp->next->to );
- /* we don't need to check for the end of the splineset here because */
- /* we know that spl->last is not selected */
- SplinesRemoveBetween(sc,curp->prev->from,nextp,type);
- curp = nextp;
- selectme = nextp;
- }
- if ( selectme!=NULL ) selectme->selected = true;
-return( spl );
-}
-
-void SplineCharMerge(SplineChar *sc,SplineSet **head,int type) {
- SplineSet *spl, *prev=NULL, *next;
-
- for ( spl = *head; spl!=NULL; spl = next ) {
- next = spl->next;
- if ( SplinePointListMerge(sc,spl,type)==NULL ) {
- if ( prev==NULL )
- *head = next;
- else
- prev->next = next;
- chunkfree(spl,sizeof(*spl));
- } else
- prev = spl;
- }
-}
-
-static int SPisExtremum(SplinePoint *sp) {
- BasePoint *prev, *next;
- SplinePoint *psp, *nsp;
-
- if ( sp->prev==NULL || sp->next==NULL )
-return( true );
-
- nsp = sp->next->to;
- psp = sp->prev->from;
-
- /* A point that changes from curved to straight horizontal/vertical should*/
- /* be treated as an extremum */
- if (( !sp->next->knownlinear && sp->prev->knownlinear &&
- (RealWithin(sp->me.x,sp->prev->from->me.x,.02) ||
- RealWithin(sp->me.y,sp->prev->from->me.y,.02))) ||
- ( !sp->prev->knownlinear && sp->next->knownlinear &&
- (RealWithin(sp->me.x,sp->next->to->me.x,.02) ||
- RealWithin(sp->me.y,sp->next->to->me.y,.02))))
-return( true );
-
- if ( sp->prev->knownlinear )
- prev = &psp->me;
- else if ( !sp->noprevcp )
- prev = &sp->prevcp;
- else
- prev = &psp->nextcp;
- if ( sp->next->knownlinear )
- next = &nsp->me;
- else if ( !sp->nonextcp )
- next = &sp->nextcp;
- else
- next = &nsp->prevcp;
-
- if ( sp->next->knownlinear && sp->prev->knownlinear &&
- ((sp->me.x==nsp->me.x && sp->me.x==psp->me.x &&
- ((sp->me.y<=nsp->me.y && psp->me.y<=sp->me.y) ||
- (sp->me.y>=nsp->me.y && psp->me.y>=sp->me.y))) ||
- (sp->me.y==nsp->me.y && sp->me.y==psp->me.y &&
- ((sp->me.x<=nsp->me.x && psp->me.x<=sp->me.x) ||
- (sp->me.x>=nsp->me.x && psp->me.x>=sp->me.x)))) )
-return( false ); /* A point in the middle of a horizontal/vertical line */
- /* is not an extrema and can be removed */
-
- if ( prev->x==sp->me.x && next->x==sp->me.x ) {
- if ( prev->y==sp->me.y && next->y==sp->me.y )
-return( false ); /* this should be caught above */
-#if 0 /* no matter what the control points look like this guy is either an */
- /* an extremum or a point of inflection, so we don't need to check */
- if (( prev->y<=sp->me.y && sp->me.y <= next->y ) ||
- (prev->y>=sp->me.y && sp->me.y >= next->y ))
-#endif
-return( true );
- } else if ( prev->y==sp->me.y && next->y==sp->me.y ) {
-return( true );
- } else if (( prev->x<=sp->me.x && next->x<=sp->me.x ) ||
- (prev->x>=sp->me.x && next->x>=sp->me.x ))
-return( true );
- else if (( prev->y<=sp->me.y && next->y<=sp->me.y ) ||
- (prev->y>=sp->me.y && next->y>=sp->me.y ))
-return( true );
-
-return( false );
-}
-
-/* Almost exactly the same as SplinesRemoveBetween, but this one is conditional */
-/* the intermediate points/splines are removed only if we have a good match */
-/* used for simplify */
-static int SplinesRemoveBetweenMaybe(SplineChar *sc,
- SplinePoint *from, SplinePoint *to, int flags, double err) {
- int i,tot;
- SplinePoint *afterfrom, *sp, *next;
- TPoint *tp, *tp2;
- BasePoint test;
- int good;
- BasePoint fncp, tpcp;
- int fpt, tpt;
- int order2 = from->next->order2;
-
- afterfrom = from->next->to;
- fncp = from->nextcp; tpcp = to->prevcp;
- fpt = from->pointtype; tpt = to->pointtype;
-
- if ( afterfrom==to || from==to )
-return( false );
-
- tp = SplinesFigureTPsBetween(from,to,&tot);
- tp2 = galloc((tot+1)*sizeof(TPoint));
- memcpy(tp2,tp,tot*sizeof(TPoint));
-
- if ( !(flags&sf_ignoreslopes) )
- ApproximateSplineFromPointsSlopes(from,to,tp,tot-1,order2);
- else {
- ApproximateSplineFromPoints(from,to,tp,tot-1,order2);
- }
-
- i = tot;
-
- good = true;
- while ( --i>0 && good ) {
- /* tp[0] is the same as from (easier to include it), but the SplineNear*/
- /* routine will sometimes reject the end-points of the spline */
- /* so just don't check it */
- test.x = tp2[i].x; test.y = tp2[i].y;
- good = SplineNearPoint(from->next,&test,err)!= -1;
- }
-
- free(tp);
- free(tp2);
- if ( good ) {
- SplineFree(afterfrom->prev);
- for ( sp=afterfrom; sp!=to; sp=next ) {
- next = sp->next->to;
- SplineFree(sp->next);
- SplinePointMDFree(sc,sp);
- }
- SplinePointCatagorize(from);
- SplinePointCatagorize(to);
- } else {
- SplineFree(from->next);
- from->next = afterfrom->prev;
- from->nextcp = fncp;
- from->nonextcp = ( fncp.x==from->me.x && fncp.y==from->me.y);
- from->pointtype = fpt;
- for ( sp=afterfrom; sp->next->to!=to; sp=sp->next->to );
- to->prev = sp->next;
- to->prevcp = tpcp;
- to->noprevcp = ( tpcp.x==to->me.x && tpcp.y==to->me.y);
- to->pointtype = tpt;
- }
-return( good );
-}
-
-/* In truetype we can interpolate away an on curve point. Try this */
-static int Spline2Interpolate(SplinePoint *mid, double err) {
- SplinePoint *from, *to;
- BasePoint midme, test;
- int i,tot, good;
- TPoint *tp;
-
- midme = mid->me;
- from = mid->prev->from; to = mid->next->to;
- tp = SplinesFigureTPsBetween(from,to,&tot);
-
- mid->me.x = (mid->prevcp.x + mid->nextcp.x)/2;
- mid->me.y = (mid->prevcp.y + mid->nextcp.y)/2;
- SplineRefigure(mid->next);
- SplineRefigure(mid->prev);
-
- i = tot;
- good = true;
- while ( --i>0 && good ) {
- /* tp[0] is the same as from (easier to include it), but the SplineNear*/
- /* routine will sometimes reject the end-points of the spline */
- /* so just don't check it */
- test.x = tp[i].x; test.y = tp[i].y;
- if ( i>tot/2 )
- good = SplineNearPoint(mid->next,&test,err)!= -1 ||
- SplineNearPoint(mid->prev,&test,err)!= -1;
- else
- good = SplineNearPoint(mid->prev,&test,err)!= -1 ||
- SplineNearPoint(mid->next,&test,err)!= -1;
- }
- if ( !good ) {
- mid->me = midme;
- SplineRefigure(mid->next);
- SplineRefigure(mid->prev);
- }
- free(tp);
-return( good );
-}
-
-int SPInterpolate(SplinePoint *sp) {
- /* Using truetype rules, can we interpolate this point? */
-return( !sp->dontinterpolate && !sp->nonextcp && !sp->noprevcp &&
- !sp->roundx && !sp->roundy &&
- (RealWithin(sp->me.x,(sp->nextcp.x+sp->prevcp.x)/2,.1) &&
- RealWithin(sp->me.y,(sp->nextcp.y+sp->prevcp.y)/2,.1)) );
-}
-
-static int _SplinesRemoveMidMaybe(SplineChar *sc,SplinePoint *mid, int flags,
- double err, double lenmax2) {
- SplinePoint *from, *to;
-#if 0 /* See comment below */
- BasePoint fncp, tpcp, fncp2, tpcp2;
- int fpt, tpt;
-#endif
-
- if ( mid->prev==NULL || mid->next==NULL )
-return( false );
-
- from = mid->prev->from; to = mid->next->to;
-
- /* Retain points which are horizontal or vertical, because postscript says*/
- /* type1 fonts should always have a point at the extrema (except for small*/
- /* things like serifs), and the extrema occur at horizontal/vertical points*/
- /* tt says something similar */
- if ( !(flags&sf_ignoreextremum) && SPisExtremum(mid) )
-return( false );
-
- if ( !(flags&sf_mergelines) && (mid->pointtype==pt_corner ||
- mid->prev->knownlinear || mid->next->knownlinear) ) {
- /* Be very careful about merging straight lines. Generally they should*/
- /* remain straight... */
- /* Actually it's not that the lines are straight, the significant thing */
- /* is that if there is a abrupt change in direction at this point */
- /* (a corner) we don't want to get rid of it */
- BasePoint prevu, nextu;
- double plen, nlen;
-
- if ( mid->next->knownlinear || mid->nonextcp ) {
- nextu.x = to->me.x-mid->me.x;
- nextu.y = to->me.y-mid->me.y;
- } else {
- nextu.x = mid->nextcp.x-mid->me.x;
- nextu.y = mid->nextcp.y-mid->me.y;
- }
- if ( mid->prev->knownlinear || mid->noprevcp ) {
- prevu.x = from->me.x-mid->me.x;
- prevu.y = from->me.y-mid->me.y;
- } else {
- prevu.x = mid->prevcp.x-mid->me.x;
- prevu.y = mid->prevcp.y-mid->me.y;
- }
- nlen = sqrt(nextu.x*nextu.x + nextu.y*nextu.y);
- plen = sqrt(prevu.x*prevu.x + prevu.y*prevu.y);
- if ( nlen==0 || plen==0 )
- /* Not a real corner */;
- else if ( (nextu.x*prevu.x + nextu.y*prevu.y)/(nlen*plen)>((nlen+plen>20)?-.98:-.95) ) {
- /* If the cos if the angle between the two segments is too far */
- /* from parallel then don't try to smooth the point into oblivion */
- double flen, tlen;
- flen = (from->me.x-mid->me.x)*(from->me.x-mid->me.x) +
- (from->me.y-mid->me.y)*(from->me.y-mid->me.y);
- tlen = (to->me.x-mid->me.x)*(to->me.x-mid->me.x) +
- (to->me.y-mid->me.y)*(to->me.y-mid->me.y);
- if ( (flen<.7 && tlen<.7) || flen<.25 || tlen<.25 )
- /* Too short to matter */;
- else
-return( false );
- }
-
- if ( mid->prev->knownlinear && mid->next->knownlinear ) {
- /* Special checks for horizontal/vertical lines */
- /* don't let the smoothing distort them */
- if ( from->me.x==to->me.x ) {
- if ( mid->me.x!=to->me.x )
-return( false );
- } else if ( from->me.y==to->me.y ) {
- if ( mid->me.y!=to->me.y )
-return( false );
- } else if ( !RealRatio((from->me.y-to->me.y)/(from->me.x-to->me.x),
- (mid->me.y-to->me.y)/(mid->me.x-to->me.x),
- .05) ) {
-return( false );
- }
- } else if ( mid->prev->knownlinear ) {
- if ( (mid->me.x-from->me.x)*(mid->me.x-from->me.x) + (mid->me.y-from->me.y)*(mid->me.y-from->me.y)
- > lenmax2 )
-return( false );
- } else {
- if ( (mid->me.x-to->me.x)*(mid->me.x-to->me.x) + (mid->me.y-to->me.y)*(mid->me.y-to->me.y)
- > lenmax2 )
-return( false );
- }
- }
-
-#if 0 /* Used to try to enforce tangentness of a point */
- /* I now think it's better to change the point to a curve */
- fncp2 = fncp = from->nextcp; tpcp2 = tpcp = to->prevcp;
- fpt = from->pointtype; tpt = to->pointtype;
-
- /* if from or to is a tangent then we can only remove mid if it's on the */
- /* line between them */
- if (( from->pointtype==pt_tangent && !from->noprevcp) ||
- ( to->pointtype==pt_tangent && !to->nonextcp)) {
- if ( from->me.x==to->me.x ) {
- if ( mid->me.x!=to->me.x )
-return( false );
- } else if ( !RealNear((from->me.y-to->me.y)/(from->me.x-to->me.x),
- (mid->me.y-to->me.y)/(mid->me.x-to->me.x)) )
-return( false );
- }
-#endif
-
- if ( mid->next->order2 ) {
- if ( SPInterpolate(from) && SPInterpolate(to) && SPInterpolate(mid))
-return( false );
- }
-
-return ( SplinesRemoveBetweenMaybe(sc,from,to,flags,err));
-}
-
-/* A wrapper to SplinesRemoveBetweenMaybe to handle some extra checking for a */
-/* common case */
-static int SplinesRemoveMidMaybe(SplineChar *sc,SplinePoint *mid, int flags,
- double err, double lenmax2) {
- int changed1 = false;
- if ( mid->next->order2 ) {
- if ( !mid->dontinterpolate && !mid->nonextcp && !mid->noprevcp &&
- !(RealWithin(mid->me.x,(mid->nextcp.x+mid->prevcp.x)/2,.1) &&
- RealWithin(mid->me.y,(mid->nextcp.y+mid->prevcp.y)/2,.1)) )
- changed1 = Spline2Interpolate(mid,err);
- }
-return( _SplinesRemoveMidMaybe(sc,mid,flags,err,lenmax2) || changed1 );
-}
-
-#ifndef LUA_FF_LIB
-void SPLNearlyHvCps(SplineChar *sc,SplineSet *ss,double err) {
- Spline *s, *first=NULL;
- int refresh;
- SplinePoint *from, *to;
-
- for ( s = ss->first->next; s!=NULL && s!=first; s=s->to->next ) {
- if ( first==NULL ) first = s;
- refresh = false;
- from = s->from; to = s->to;
- if ( !from->nonextcp && from->nextcp.x-from->me.x<err && from->nextcp.x-from->me.x>-err ) {
- from->nextcp.x = from->me.x;
- if ( s->order2 ) to->prevcp = from->nextcp;
- if ( from->nextcp.y==from->me.y ) from->nonextcp = true;
- refresh = true;
- } else if ( !from->nonextcp && from->nextcp.y-from->me.y<err && from->nextcp.y-from->me.y>-err ) {
- from->nextcp.y = from->me.y;
- if ( s->order2 ) to->prevcp = from->nextcp;
- if ( from->nextcp.x==from->me.x ) from->nonextcp = true;
- refresh = true;
- }
- if ( !to->noprevcp && to->prevcp.x-to->me.x<err && to->prevcp.x-to->me.x>-err ) {
- to->prevcp.x = to->me.x;
- if ( s->order2 ) from->nextcp = to->prevcp;
- if ( to->prevcp.y==to->me.y ) to->noprevcp = true;
- refresh = true;
- } else if ( !to->noprevcp && to->prevcp.y-to->me.y<err && to->prevcp.y-to->me.y>-err ) {
- to->prevcp.y = to->me.y;
- if ( s->order2 ) from->nextcp = to->prevcp;
- if ( to->prevcp.x==to->me.x ) to->noprevcp = true;
- refresh = true;
- }
- if ( refresh )
- SplineRefigure(s);
- }
-}
-#endif
-
-void SPLNearlyHvLines(SplineChar *sc,SplineSet *ss,double err) {
- Spline *s, *first=NULL;
-
- for ( s = ss->first->next; s!=NULL && s!=first; s=s->to->next ) {
- if ( first==NULL ) first = s;
- if ( s->knownlinear ) {
- if ( s->to->me.x-s->from->me.x<err && s->to->me.x-s->from->me.x>-err ) {
- s->to->nextcp.x += (s->from->me.x-s->to->me.x);
- s->to->me.x = s->from->me.x;
- s->to->prevcp = s->to->me;
- s->from->nextcp = s->from->me;
- SplineRefigure(s);
- if ( s->to->next != NULL )
- SplineRefigure(s->to->next);
- } else if ( s->to->me.y-s->from->me.y<err && s->to->me.y-s->from->me.y>-err ) {
- s->to->nextcp.y += (s->from->me.y-s->to->me.y);
- s->to->me.y = s->from->me.y;
- s->to->prevcp = s->to->me;
- s->from->nextcp = s->from->me;
- SplineRefigure(s);
- if ( s->to->next != NULL )
- SplineRefigure(s->to->next);
- }
- }
- }
-}
-
-#ifndef LUA_FF_LIB
-/* Does this spline deviate from a straight line between its endpoints by more*/
-/* than err? */
-/* Rotate the spline so that the line between the endpoints is horizontal, */
-/* then find the maxima/minima of the y spline (this is the deviation) */
-/* check that that is less than err */
-static int SplineCloseToLinear(Spline *s, double err) {
- double angle;
- extended co,si, t1, t2, y;
- SplinePoint from, to;
- Spline sp;
- BasePoint bp;
-
- from = *s->from; to = *s->to;
- to.me.x -= from.me.x; to.me.y -= from.me.y;
- to.prevcp.x -= from.me.x; to.prevcp.y -= from.me.y;
- from.nextcp.x -= from.me.x ; from.nextcp.y -= from.me.y;
- from.me.x = from.me.y = 0;
- angle = atan2(to.me.y, to.me.x);
-
- si = sin(angle); co = cos(angle);
- bp.x = to.me.x*co + to.me.y*si;
- bp.y = -to.me.x*si + to.me.y*co;
- to.me = bp;
-
- bp.x = to.prevcp.x*co + to.prevcp.y*si;
- bp.y = -to.prevcp.x*si + to.prevcp.y*co;
- to.prevcp = bp;
-
- bp.x = from.nextcp.x*co + from.nextcp.y*si;
- bp.y = -from.nextcp.x*si + from.nextcp.y*co;
- from.nextcp = bp;
-
- memset(&sp,0,sizeof(Spline));
- sp.from = &from; sp.to = &to;
- sp.order2 = s->order2;
- SplineRefigure(&sp);
- SplineFindExtrema(&sp.splines[1],&t1,&t2);
-
- if ( t1==-1 )
-return( true );
-
- y = ((sp.splines[1].a*t1 + sp.splines[1].b)*t1 + sp.splines[1].c)*t1 + sp.splines[1].d;
- if ( y>err || y<-err )
-return( false );
-
- if ( t2==-1 )
-return( true );
- y = ((sp.splines[1].a*t2 + sp.splines[1].b)*t2 + sp.splines[1].c)*t2 + sp.splines[1].d;
-return( y<=err && y>=-err );
-}
-
-int SPLNearlyLines(SplineChar *sc,SplineSet *ss,double err) {
- Spline *s, *first=NULL;
- int changed = false;
-
- for ( s = ss->first->next; s!=NULL && s!=first; s=s->to->next ) {
- if ( first==NULL ) first = s;
- if ( s->islinear )
- /* Nothing to be done */;
- else if ( s->knownlinear || SplineCloseToLinear(s,err)) {
- s->from->nextcp = s->from->me;
- s->from->nonextcp = true;
- s->to->prevcp = s->to->me;
- s->to->noprevcp = true;
- SplineRefigure(s);
- changed = true;
- }
- }
-return( changed );
-}
-#endif
-
-static void SPLForceLines(SplineChar *sc,SplineSet *ss,double bump_size) {
- Spline *s, *first=NULL;
- SplinePoint *sp;
- int any;
- BasePoint unit;
- double len, minlen = (sc->parent->ascent+sc->parent->descent)/20.0;
- double diff, xoff, yoff, len2;
-
- for ( s = ss->first->next; s!=NULL && s!=first; s=s->to->next ) {
- if ( first==NULL ) first = s;
- if ( s->knownlinear ) {
- unit.x = s->to->me.x-s->from->me.x;
- unit.y = s->to->me.y-s->from->me.y;
- len = sqrt(unit.x*unit.x + unit.y*unit.y);
- if ( len<minlen )
- continue;
- unit.x /= len; unit.y /= len;
- do {
- any = false;
- if ( s->from->prev!=NULL && s->from->prev!=s ) {
- sp = s->from->prev->from;
- len2 = sqrt((sp->me.x-s->from->me.x)*(sp->me.x-s->from->me.x) + (sp->me.y-s->from->me.y)*(sp->me.y-s->from->me.y));
- diff = (sp->me.x-s->from->me.x)*unit.y - (sp->me.y-s->from->me.y)*unit.x;
- if ( len2<len && fabs(diff)<=bump_size ) {
- xoff = diff*unit.y; yoff = -diff*unit.x;
- sp->me.x -= xoff; sp->me.y -= yoff;
- sp->prevcp.x -= xoff; sp->prevcp.y -= yoff;
- sp->nextcp = sp->me; sp->nonextcp = true;
- if ( sp->next==first ) first = NULL;
- SplineFree(sp->next);
- if ( s->from==ss->first ) {
- if ( ss->first==ss->last ) ss->last = sp;
- ss->first = sp;
- }
- SplinePointMDFree(sc,s->from);
- sp->next = s; s->from = sp;
- SplineRefigure(s);
- if ( sp->prev!=NULL )
- SplineRefigure(sp->prev);
- sp->pointtype = pt_corner;
- any = true;
-
- /* We must recalculate the length each time, we */
- /* might have shortened it. */
- unit.x = s->to->me.x-s->from->me.x;
- unit.y = s->to->me.y-s->from->me.y;
- len = sqrt(unit.x*unit.x + unit.y*unit.y);
- if ( len<minlen )
- break;
- unit.x /= len; unit.y /= len;
- }
- }
- if ( s->to->next!=NULL && s->to->next!=s ) {
- sp = s->to->next->to;
- /* If the next spline is a longer line than we are, then don't */
- /* merge it to us, rather merge us into it next time through the loop */
- /* Hmm. Don't merge out the bump in general if the "bump" is longer than we are */
- len2 = sqrt((sp->me.x-s->to->me.x)*(sp->me.x-s->to->me.x) + (sp->me.y-s->to->me.y)*(sp->me.y-s->to->me.y));
- diff = (sp->me.x-s->to->me.x)*unit.y - (sp->me.y-s->to->me.y)*unit.x;
- if ( len2<len && fabs(diff)<=bump_size ) {
- xoff = diff*unit.y; yoff = -diff*unit.x;
- sp->me.x -= xoff; sp->me.y -= yoff;
- sp->nextcp.x -= xoff; sp->nextcp.y -= yoff;
- sp->prevcp = sp->me; sp->noprevcp = true;
- if ( sp->prev==first ) first = NULL;
- SplineFree(sp->prev);
- if ( s->to==ss->last ) {
- if ( ss->first==ss->last ) ss->first = sp;
- ss->last = sp;
- }
- SplinePointMDFree(sc,s->to);
- sp->prev = s; s->to = sp;
- SplineRefigure(s);
- if ( sp->next!=NULL )
- SplineRefigure(sp->next);
- sp->pointtype = pt_corner;
- any = true;
-
- unit.x = s->to->me.x-s->from->me.x;
- unit.y = s->to->me.y-s->from->me.y;
- len = sqrt(unit.x*unit.x + unit.y*unit.y);
- if ( len<minlen )
- break;
- unit.x /= len; unit.y /= len;
- }
- }
- } while ( any );
- }
- }
-}
-
-static int SPLSmoothControlPoints(SplineSet *ss,double tan_bounds,int vert_check) {
- SplinePoint *sp;
- /* If a point has control points, and if those cps are in nearly the same */
- /* direction (within tan_bounds) then adjust them so that they are in the*/
- /* same direction */
- BasePoint unit, unit2;
- double len, len2, para, norm, tn;
- int changed=false, found;
-
- for ( sp = ss->first; ; ) {
- if (( !sp->nonextcp && !sp->noprevcp && sp->pointtype==pt_corner ) ||
- ((sp->pointtype==pt_corner || sp->pointtype==pt_curve) &&
- (( !sp->nonextcp && sp->noprevcp && sp->prev!=NULL && sp->prev->knownlinear ) ||
- ( !sp->noprevcp && sp->nonextcp && sp->next!=NULL && sp->next->knownlinear )))) {
- BasePoint *next = sp->nonextcp ? &sp->next->to->me : &sp->nextcp;
- BasePoint *prev = sp->noprevcp ? &sp->prev->to->me : &sp->prevcp;
- unit.x = next->x-sp->me.x;
- unit.y = next->y-sp->me.y;
- len = sqrt(unit.x*unit.x + unit.y*unit.y);
- unit.x /= len; unit.y /= len;
- para = (sp->me.x-prev->x)*unit.x + (sp->me.y-prev->y)*unit.y;
- norm = (sp->me.x-prev->x)*unit.y - (sp->me.y-prev->y)*unit.x;
- if ( para==0 )
- tn = 1000;
- else
- tn = norm/para;
- if ( tn<0 ) tn = -tn;
- if ( tn<tan_bounds && para>0 ) {
- found = 0;
- unit2.x = sp->me.x-sp->prevcp.x;
- unit2.y = sp->me.y-sp->prevcp.y;
- len2 = sqrt(unit2.x*unit2.x + unit2.y*unit2.y);
- unit2.x /= len2; unit2.y /= len2;
- if ( vert_check ) {
- if ( fabs(unit.x)>fabs(unit.y) ) {
- /* Closer to horizontal */
- if ( (unit.y<=0 && unit2.y>=0) || (unit.y>=0 && unit2.y<=0) ) {
- unit2.x = unit2.x<0 ? -1 : 1; unit2.y = 0;
- found = 1;
- }
- } else {
- if ( (unit.x<=0 && unit2.x>=0) || (unit.x>=0 && unit2.x<=0) ) {
- unit2.y = unit2.y<0 ? -1 : 1; unit2.x = 0;
- found = 1;
- }
- }
- }
- /* If we're next to a line, we must extend the line. No choice */
- if ( sp->nonextcp ) {
- if ( len<len2 )
- goto nextpt;
- found = true;
- unit2 = unit;
- } else if ( sp->noprevcp ) {
- if ( len2<len )
- goto nextpt;
- found = true;
- } else if ( !found ) {
- unit2.x = (unit.x*len + unit2.x*len2)/(len+len2);
- unit2.y = (unit.y*len + unit2.y*len2)/(len+len2);
- }
- sp->nextcp.x = sp->me.x + len*unit2.x;
- sp->nextcp.y = sp->me.y + len*unit2.y;
- sp->prevcp.x = sp->me.x - len2*unit2.x;
- sp->prevcp.y = sp->me.y - len2*unit2.y;
- sp->pointtype = pt_curve;
- if ( sp->prev )
- SplineRefigure(sp->prev);
- if ( sp->next )
- SplineRefigure(sp->next);
- changed = true;
- }
- }
- nextpt:
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
-return( changed );
-}
-
-static void GetNextUnitVector(SplinePoint *sp,BasePoint *uv) {
- double len;
-
- if ( sp->next==NULL ) {
- uv->x = uv->y = 0;
- } else if ( sp->next->knownlinear ) {
- uv->x = sp->next->to->me.x - sp->me.x;
- uv->y = sp->next->to->me.y - sp->me.y;
- } else if ( sp->nonextcp ) {
- uv->x = sp->next->to->prevcp.x - sp->me.x;
- uv->y = sp->next->to->prevcp.y - sp->me.y;
- } else {
- uv->x = sp->nextcp.x - sp->me.x;
- uv->y = sp->nextcp.y - sp->me.y;
- }
- len = sqrt(uv->x*uv->x + uv->y*uv->y );
- if ( len!= 0 ) {
- uv->x /= len;
- uv->y /= len;
- }
-}
-
-static int isExtreme(SplinePoint *sp) {
- if ( sp->next==NULL || sp->prev==NULL )
-return( 2 ); /* End point. Always extreme */
- if ( sp->nonextcp ) {
- if ( !sp->next->knownlinear )
-return( false );
- if ( sp->next->to->me.x == sp->me.x || sp->next->to->me.y == sp->me.y )
- /* Ok, horizontal or vertical line, that'll do */;
- else
-return( false );
- } else {
- if ( sp->nextcp.x != sp->me.x && sp->nextcp.y != sp->me.y )
-return( false );
- }
- if ( sp->noprevcp ) {
- if ( !sp->prev->knownlinear )
-return( false );
- if ( sp->prev->from->me.x == sp->me.x || sp->prev->from->me.y == sp->me.y )
- /* Ok, horizontal or vertical line, that'll do */;
- else
-return( false );
- } else {
- if ( sp->prevcp.x != sp->me.x && sp->prevcp.y != sp->me.y )
-return( false );
- }
-return( true );
-}
-
-/* If the start point of a contour is not at an extremum, and the contour has */
-/* a point which is at an extremum, then make the start point be that point */
-/* leave it unchanged if start point is already extreme, or no extreme point */
-/* could be found */
-static void SPLStartToExtremum(SplineChar *sc,SplinePointList *spl) {
- SplinePoint *sp;
-
- while ( spl!=NULL ) {
- if ( spl->first==spl->last ) { /* It's closed */
- for ( sp=spl->first; !isExtreme(sp); ) {
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- if ( sp!=spl->first )
- spl->first = spl->last = sp;
- }
- spl = spl->next;
- }
-}
-
-/* Cleanup just turns splines with control points which happen to trace out */
-/* lines into simple lines */
-/* it also checks for really nasty control points which point in the wrong */
-/* direction but are very close to the base point. We get these from some */
-/* TeX fonts. I assume they are due to rounding errors (or just errors) in*/
-/* some autotracer */
-void SplinePointListSimplify(SplineChar *sc,SplinePointList *spl,
- struct simplifyinfo *smpl) {
- SplinePoint *first, *next, *sp, *nsp;
- BasePoint suv, nuv;
- double lenmax2 = smpl->linelenmax*smpl->linelenmax;
-
- if ( spl==NULL )
-return;
-
- RemoveZeroLengthSplines(spl,false,0.1);
- RemoveStupidControlPoints(spl);
- SSRemoveBacktracks(spl);
- if ( smpl->flags!=sf_cleanup && (smpl->flags&sf_setstart2extremum))
- SPLStartToExtremum(sc,spl);
- if ( spl->first->next!=NULL && spl->first->next->to==spl->first &&
- spl->first->nonextcp && spl->first->noprevcp )
-return; /* Ignore any splines which are just dots */
-
- if ( smpl->flags!=sf_cleanup && (smpl->flags&sf_forcelines)) {
- SPLNearlyHvLines(sc,spl,smpl->linefixup);
- SPLForceLines(sc,spl,smpl->linefixup);
- }
-
- if ( smpl->flags!=sf_cleanup && spl->first->prev!=NULL && spl->first->prev!=spl->first->next ) {
- /* first thing to try is to remove everything between two extrema */
- /* We do this even if they checked ignore extrema. After this pass */
- /* we'll come back and check every point individually */
- /* However, if we turn through more than 90 degrees we can't approximate */
- /* a good match, and it takes us forever to make the attempt and fail*/
- /* We take a dot product to prevent that */
- for ( sp = spl->first; ; ) {
- if ( sp->next==NULL )
- break;
- if ( SPisExtremum(sp) ) {
- GetNextUnitVector(sp,&suv);
- for ( nsp=sp->next->to; nsp!=sp; nsp = nsp->next->to ) {
- if ( nsp->next==NULL )
- break;
- if ( nsp->prev->knownlinear &&
- (nsp->me.x-nsp->prev->from->me.x)*(nsp->me.x-nsp->prev->from->me.x) +
- (nsp->me.y-nsp->prev->from->me.y)*(nsp->me.y-nsp->prev->from->me.y)
- >= lenmax2 )
- goto nogood;
- GetNextUnitVector(nsp,&nuv);
- if ( suv.x*nuv.x + suv.y*nuv.y < 0 ) {
- if ( suv.x*nuv.x + suv.y*nuv.y > -.1 )
- break;
- goto nogood;
- }
- if ( SPisExtremum(nsp) || nsp==spl->first)
- break;
- }
- /* nsp is something we don't want to remove */
- if ( nsp==sp )
- break;
- else if ( sp->next->to == nsp )
- goto nogood; /* Nothing to remove */
- if ( SplinesRemoveBetweenMaybe(sc,sp,nsp,smpl->flags,smpl->err)) {
- if ( spl->last==spl->first )
- spl->last = spl->first = sp; /* We know this point didn't get removed */
- }
- nogood:
- sp = nsp;
- } else
- sp = sp->next->to;
- if ( sp == spl->first )
- break;
- }
-
- while ( 1 ) {
- first = spl->first->prev->from;
- if ( first->prev == first->next )
-return;
- if ( !SplinesRemoveMidMaybe(sc,spl->first,smpl->flags,smpl->err,lenmax2))
- break;
- if ( spl->first==spl->last )
- spl->last = first;
- spl->first = first;
- }
- }
-
- /* Special case checks for paths containing only one point */
- /* else we get lots of nans (or only two points) */
- if ( spl->first->next == NULL )
-return;
- for ( sp = spl->first->next->to; sp->next!=NULL; sp = next ) {
- SplineIsLinearMake(sp->prev); /* First see if we can turn it*/
- /* into a line, then try to merge two splines */
- next = sp->next->to;
- if ( sp->prev == sp->next ||
- (sp->next!=NULL && sp->next->to->next!=NULL &&
- sp->next->to->next->to == sp ))
-return;
- if ( smpl->flags!=sf_cleanup ) {
- if ( SplinesRemoveMidMaybe(sc,sp,smpl->flags,smpl->err,lenmax2) ) {
- if ( spl->first==sp )
- spl->first = next;
- if ( spl->last==sp )
- spl->last = next;
- }
- } else {
- while ( sp->me.x==next->me.x && sp->me.y==next->me.y &&
- sp->nextcp.x>sp->me.x-1 && sp->nextcp.x<sp->me.x+1 &&
- sp->nextcp.y>sp->me.y-1 && sp->nextcp.y<sp->me.y+1 &&
- next->prevcp.x>next->me.x-1 && next->prevcp.x<next->me.x+1 &&
- next->prevcp.y>next->me.y-1 && next->prevcp.y<next->me.y+1 ) {
- SplineFree(sp->next);
- sp->next = next->next;
- if ( sp->next!=NULL )
- sp->next->from = sp;
- sp->nextcp = next->nextcp;
- sp->nonextcp = next->nonextcp;
- sp->nextcpdef = next->nextcpdef;
- SplinePointMDFree(sc,next);
- if ( sp->next!=NULL )
- next = sp->next->to;
- else {
- next = NULL;
- break;
- }
- }
- if ( next==NULL )
- break;
- }
- if ( next->prev!=NULL && next->prev->from==spl->last )
- break;
- }
- if ( smpl->flags!=sf_cleanup && (smpl->flags&sf_smoothcurves))
- SPLSmoothControlPoints(spl,smpl->tan_bounds,smpl->flags&sf_choosehv);
-}
-
-/* cleanup may be: -1 => lines become lines, 0 => simplify & retain slopes, 1=> simplify and discard slopes, 2=>discard extrema */
-SplineSet *SplineCharSimplify(SplineChar *sc,SplineSet *head,
- struct simplifyinfo *smpl) {
- SplineSet *spl, *prev, *snext;
- int anysel=0, wassingleton;
-
- if ( smpl->check_selected_contours ) {
- for ( spl = head; spl!=NULL && !anysel; spl = spl->next ) {
- anysel = PointListIsSelected(spl);
- }
- }
-
- prev = NULL;
- for ( spl = head; spl!=NULL; spl = snext ) {
- snext = spl->next;
- if ( !anysel || PointListIsSelected(spl)) {
- wassingleton = spl->first->prev==spl->first->next &&
- (spl->first->prev==NULL ||
- (spl->first->noprevcp && spl->first->nonextcp));
- SplinePointListSimplify(sc,spl,smpl);
- /* remove any singleton points */
- if (( !wassingleton ||
- (smpl->flags!=sf_cleanup && (smpl->flags&sf_rmsingletonpoints))) &&
- spl->first->prev==spl->first->next &&
- (spl->first->prev==NULL ||
- (spl->first->noprevcp && spl->first->nonextcp))) {
- if ( prev==NULL )
- head = snext;
- else
- prev->next = snext;
- spl->next = NULL;
- SplinePointListMDFree(sc,spl);
- } else
- prev = spl;
- }
- }
- SplineSetsRemoveAnnoyingExtrema(head,.3);
- SPLCatagorizePoints(head);
-#if 0
- printf( "nocnt=%d totcnt=%d curdif=%d incr=%d\n", nocnt_cnt, totcnt_cnt, curdiff_cnt, incr_cnt );
-#endif
-return( head );
-}
-
-#ifndef LUA_FF_LIB
-/* If the start point of a contour to be the left most point on it. If there */
-/* are several points with that same value, use the one closest to the base */
-/* line */
-void SPLStartToLeftmost(SplineChar *sc,SplinePointList *spl, int *changed) {
- SplinePoint *sp;
- SplinePoint *best;
-
- if ( spl->first==spl->last ) { /* It's closed */
- best = spl->first;
- for ( sp=spl->first; ; ) {
- if ( sp->me.x < best->me.x ||
- (sp->me.x==best->me.x && (fabs(sp->me.y)<fabs(best->me.y))) )
- best = sp;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- if ( best!=spl->first ) {
- if ( !*changed ) {
- SCPreserveState(sc,false);
- *changed = true;
- }
- spl->first = spl->last = best;
- }
- }
-}
-
-void SPLsStartToLeftmost(SplineChar *sc) {
- int changed = 0;
- int layer;
- SplineSet *ss;
-
- if ( sc==NULL )
-return;
-
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- for ( ss = sc->layers[layer].splines; ss!=NULL; ss=ss->next )
- SPLStartToLeftmost(sc,ss,&changed);
- }
- if ( changed )
- SCCharChangedUpdate(sc);
-}
-
-struct contourinfo {
- SplineSet *ss;
- BasePoint *min;
-};
-
-static int order_contours(const void *_c1, const void *_c2) {
- const struct contourinfo *c1 = _c1, *c2 = _c2;
-
- if ( c1->min->x<c2->min->x )
-return( -1 );
- else if ( c1->min->x>c2->min->x )
-return( 1 );
- else if ( fabs(c1->min->y)<fabs(c2->min->y) )
-return( -1 );
- else if ( fabs(c1->min->y)>fabs(c2->min->y) )
-return( 1 );
- else
-return( 0 );
-}
-
-void CanonicalContours(SplineChar *sc) {
- int changed;
- int layer;
- SplineSet *ss;
- SplinePoint *sp, *best;
- int contour_cnt, contour_max=0, i, diff;
- struct contourinfo *ci;
-
- if ( sc==NULL )
-return;
-
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- contour_cnt = 0;
- for ( ss = sc->layers[layer].splines; ss!=NULL; ss=ss->next )
- ++contour_cnt;
- if ( contour_cnt>contour_max )
- contour_max = contour_cnt;
- }
-
- if ( contour_max<=1 ) /* Can't be out of order */
-return;
-
- changed = 0;
- ci = gcalloc(contour_max,sizeof(struct contourinfo));
- for ( layer=ly_fore; layer<sc->layer_cnt; ++layer ) {
- contour_cnt = 0;
- for ( ss = sc->layers[layer].splines; ss!=NULL; ss=ss->next ) {
- best = ss->first;
- for ( sp=ss->first; ; ) {
- if ( sp->me.x < best->me.x ||
- (sp->me.x==best->me.x && (fabs(sp->me.y)<fabs(best->me.y))) )
- best = sp;
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==ss->first )
- break;
- }
- ci[contour_cnt].ss = ss;
- ci[contour_cnt++].min = &best->me;
- }
- qsort(ci,contour_cnt,sizeof(struct contourinfo),order_contours);
- diff = 0;
- for ( i=0, ss = sc->layers[layer].splines; ss!=NULL; ss=ss->next ) {
- if ( ci[i].ss != ss ) {
- diff = true;
- break;
- }
- }
- if ( diff && !changed ) {
- SCPreserveState(sc,false);
- changed = true;
- }
- if ( diff ) {
- sc->layers[layer].splines = ci[0].ss;
- for ( i=1; i<contour_cnt; ++i )
- ci[i-1].ss->next = ci[i].ss;
- ci[contour_cnt-1].ss->next = NULL;
- }
- }
- free(ci);
- if ( changed )
- SCCharChangedUpdate(sc);
-}
-#endif
-
-static int SplineSetMakeLoop(SplineSet *spl,real fudge) {
- if ( spl->first!=spl->last &&
- (spl->first->me.x >= spl->last->me.x-fudge &&
- spl->first->me.x <= spl->last->me.x+fudge &&
- spl->first->me.y >= spl->last->me.y-fudge &&
- spl->first->me.y <= spl->last->me.y+fudge )) {
- spl->first->prev = spl->last->prev;
- spl->first->prev->to = spl->first;
- spl->first->prevcp = spl->last->prevcp;
- spl->first->noprevcp = spl->last->noprevcp;
- spl->first->prevcpdef = spl->last->prevcpdef;
- SplinePointFree(spl->last);
- spl->last = spl->first;
-return( true );
- }
-return( false );
-}
-
-SplineSet *SplineSetJoin(SplineSet *start,int doall,real fudge,int *changed) {
- SplineSet *spl, *spl2, *prev;
-
- *changed = false;
- for ( spl=start; spl!=NULL; spl=spl->next ) {
- if ( spl->first->prev==NULL &&
- (doall || PointListIsSelected(spl)) ) {
- if ( SplineSetMakeLoop(spl,fudge) ) {
- *changed = true;
- } else {
- prev = NULL;
- for ( spl2=start ; spl2!=NULL; prev = spl2, spl2=spl2->next ) if ( spl2!=spl ) {
- if (!( spl->first->me.x >= spl2->last->me.x-fudge &&
- spl->first->me.x <= spl2->last->me.x+fudge &&
- spl->first->me.y >= spl2->last->me.y-fudge &&
- spl->first->me.y <= spl2->last->me.y+fudge )) {
- if (( spl->last->me.x >= spl2->last->me.x-fudge &&
- spl->last->me.x <= spl2->last->me.x+fudge &&
- spl->last->me.y >= spl2->last->me.y-fudge &&
- spl->last->me.y <= spl2->last->me.y+fudge ) ||
- ( spl->last->me.x >= spl2->first->me.x-fudge &&
- spl->last->me.x <= spl2->first->me.x+fudge &&
- spl->last->me.y >= spl2->first->me.y-fudge &&
- spl->last->me.y <= spl2->first->me.y+fudge ))
- SplineSetReverse(spl);
- }
- if ( spl->first->me.x >= spl2->first->me.x-fudge &&
- spl->first->me.x <= spl2->first->me.x+fudge &&
- spl->first->me.y >= spl2->first->me.y-fudge &&
- spl->first->me.y <= spl2->first->me.y+fudge )
- SplineSetReverse(spl2);
- if ( spl->first->me.x >= spl2->last->me.x-fudge &&
- spl->first->me.x <= spl2->last->me.x+fudge &&
- spl->first->me.y >= spl2->last->me.y-fudge &&
- spl->first->me.y <= spl2->last->me.y+fudge ) {
- spl->first->prev = spl2->last->prev;
- spl->first->prev->to = spl->first;
- spl->first->prevcp = spl2->last->prevcp;
- spl->first->noprevcp = spl2->last->noprevcp;
- spl->first->prevcpdef = spl2->last->prevcpdef;
- SplinePointFree(spl2->last);
- spl->first = spl2->first;
- spl2->first = spl2->last = NULL;
- if ( prev!=NULL )
- prev->next = spl2->next;
- else
- start = spl2->next;
- chunkfree(spl2,sizeof(SplineSet));
- SplineSetMakeLoop(spl,fudge);
- *changed = true;
- break;
- }
- }
- }
- }
- }
-return(start);
-}
-
-#ifndef LUA_FF_LIB
-SplineSet *SplineCharRemoveTiny(SplineChar *sc,SplineSet *head) {
- SplineSet *spl, *snext, *pr;
- Spline *spline, *next, *first;
- const double err = 1.0/64.0;
-
- for ( spl = head, pr=NULL; spl!=NULL; spl = snext ) {
- first = NULL;
- for ( spline=spl->first->next; spline!=NULL && spline!=first; spline=next ) {
- next = spline->to->next;
- if ( spline->from->me.x-spline->to->me.x>-err && spline->from->me.x-spline->to->me.x<err &&
- spline->from->me.y-spline->to->me.y>-err && spline->from->me.y-spline->to->me.y<err &&
- (spline->from->nonextcp || spline->to->noprevcp) &&
- spline->from->prev!=NULL ) {
- if ( spline->from==spline->to )
- break;
- if ( spl->last==spline->from ) spl->last = NULL;
- if ( spl->first==spline->from ) spl->first = NULL;
- if ( first==spline->from->prev ) first=NULL;
- /*SplinesRemoveBetween(sc,spline->from->prev->from,spline->to);*/
- spline->to->prevcp = spline->from->prevcp;
- spline->to->noprevcp = spline->from->noprevcp;
- spline->to->prevcpdef = spline->from->prevcpdef;
- spline->from->prev->to = spline->to;
- spline->to->prev = spline->from->prev;
- SplineRefigure(spline->from->prev);
- SplinePointFree(spline->from);
- SplineFree(spline);
- if ( first==NULL ) first = next->from->prev;
- if ( spl->first==NULL ) spl->first = next->from;
- if ( spl->last==NULL ) spl->last = next->from;
- } else {
- if ( first==NULL ) first = spline;
- }
- }
- snext = spl->next;
- if ( spl->first->next==spl->first->prev ) {
- spl->next = NULL;
- SplinePointListMDFree(sc,spl);
- if ( pr==NULL )
- head = snext;
- else
- pr->next = snext;
- } else
- pr = spl;
- }
-return( head );
-}
-#endif
-
-#if 0
-Spline *SplineAddPointsOfInflection(Spline *s) {
- double ts[2];
- int cnt;
- SplinePoint *sp;
-
- forever {
- if ( s->knownlinear )
-return( s );
- cnt = Spline2DFindPointsOfInflection(s,ts);
- if ( cnt==0 )
-return( s );
- if ( cnt==2 && ts[0]>ts[1] )
- ts[0] = ts[1];
- sp = SplineBisect(s,ts[0]);
- s = sp->next;
- if ( cnt==1 )
-return( s );
- /* As with add extrema, if we had more than one, loop back to look */
- /* at any others. The spline is different now, easier to compute the */
- /* new value than to fix up the old */
- }
-}
-
-void SplineSetAddPointsOfInflection(SplineChar *sc, SplineSet *ss) {
- Spline *s, *first;
-
- first = NULL;
- for ( s = ss->first->next; s!=NULL && s!=first; s = s->to->next ) {
- s = SplineAddPointsOfInflection(s);
- if ( first==NULL ) first = s;
- }
-}
-
-void SplineCharAddPointsOfInflection(SplineChar *sc, SplineSet *head) {
- SplineSet *ss;
-
- for ( ss=head; ss!=NULL; ss=ss->next ) {
- SplineSetAddPointsOfInflection(sc,ss,between_selected,sf);
- }
-}
-#endif
Spline *SplineAddExtrema(Spline *s,int always,real lenbound, real offsetbound,
DBounds *b) {
@@ -2834,7 +1377,7 @@ Spline *SplineAddExtrema(Spline *s,int always,real lenbound, real offsetbound,
uint8 rmfrom[4], rmto[4];
int p, i,j, p_s, mini;
SplinePoint *sp;
- real len = 0;
+ real len;
if ( !always ) {
real xlen, ylen;
@@ -3050,13 +1593,6 @@ void SplineSetAddExtrema(SplineChar *sc, SplineSet *ss,enum ae_type between_sele
}
}
-void SplineCharAddExtrema(SplineChar *sc, SplineSet *head,enum ae_type between_selected,int emsize) {
- SplineSet *ss;
-
- for ( ss=head; ss!=NULL; ss=ss->next ) {
- SplineSetAddExtrema(sc,ss,between_selected,emsize);
- }
-}
char *GetNextUntitledName(void) {
static int untitled_cnt=1;
@@ -3079,6 +1615,7 @@ SplineFont *SplineFontEmpty(void) {
sf->display_antialias = default_fv_antialias;
sf->display_bbsized = default_fv_bbsized;
sf->display_size = -default_fv_font_size;
+ sf->display_layer = ly_fore;
sf->pfminfo.winascent_add = sf->pfminfo.windescent_add = true;
sf->pfminfo.hheadascent_add = sf->pfminfo.hheaddescent_add = true;
sf->pfminfo.typoascent_add = sf->pfminfo.typodescent_add = true;
@@ -3089,64 +1626,19 @@ SplineFont *SplineFontEmpty(void) {
sf->for_new_glyphs = DefaultNameListForNewFonts();
time(&now);
sf->creationtime = sf->modificationtime = now;
-return( sf );
-}
-SplineFont *SplineFontBlank(int charcnt) {
- SplineFont *sf;
- char buffer[200];
- time_t now;
- struct tm *tm;
- const char *author = GetAuthor();
-
- sf = SplineFontEmpty();
- sf->fontname = GetNextUntitledName();
- sf->fullname = copy(sf->fontname);
- sf->familyname = copy(sf->fontname);
- sprintf( buffer, "%s.sfd", sf->fontname);
- sf->origname = copy(buffer);
- sf->weight = copy("Medium");
- if ( author!=NULL )
- sprintf( buffer, "Created by %.50s with FontForge 2.0 (http://fontforge.sf.net)", author );
- else
- strcpy( buffer, "Created with FontForge 2.0 (http://fontforge.sf.net)" );
- sf->copyright = copy(buffer);
- if ( xuid!=NULL ) {
- sf->xuid = galloc(strlen(xuid)+20);
- sprintf(sf->xuid,"[%s %d]", xuid, (rand()&0xffffff));
- }
- time(&now);
- tm = localtime(&now);
- sprintf( buffer, "%d-%d-%d: Created.", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday );
- sf->comments = copy(buffer);
- sf->version = copy("001.000");
- sf->ascent = rint(new_em_size*.8); sf->descent = new_em_size-sf->ascent;
- sf->upos = -rint(new_em_size*.1); sf->uwidth = rint(new_em_size*.05); /* defaults for cff */
- sf->glyphcnt = 0;
- sf->glyphmax = charcnt;
- sf->glyphs = gcalloc(charcnt,sizeof(SplineChar *));
- sf->pfminfo.fstype = -1;
- sf->order2 = false;
- sf->use_typo_metrics = true;
-return( sf );
-}
+ sf->layer_cnt = 2;
+ sf->layers = gcalloc(2,sizeof(LayerInfo));
+ sf->layers[0].name = copy(_("Back"));
+ sf->layers[0].background = true;
+ sf->layers[1].name = copy(_("Fore"));
+ sf->layers[1].background = false;
+ sf->grid.background = true;
-SplineFont *SplineFontNew(void) {
- SplineFont *sf;
- int enclen = default_encoding->char_cnt;
-
- sf = SplineFontBlank(enclen);
- sf->onlybitmaps = true;
- sf->new = true;
- sf->order2 = new_fonts_are_order2;
-
- sf->map = EncMapNew(enclen,enclen,default_encoding);
-#ifdef LUA_FF_LIB
- sf->next = NULL;
-#endif
return( sf );
}
+
static void SFChangeXUID(SplineFont *sf, int random) {
char *pt, *new, *npt;
int val;
@@ -3189,7 +1681,8 @@ void SPWeightedAverageCps(SplinePoint *sp) {
double pangle, nangle, angle, plen, nlen, c, s;
if ( sp->noprevcp || sp->nonextcp )
/*SPAverageCps(sp)*/; /* Expand Stroke wants this case to hold still */
- else if ( sp->pointtype==pt_curve && sp->prev && sp->next ) {
+ else if (( sp->pointtype==pt_curve || sp->pointtype==pt_hvcurve) &&
+ sp->prev && sp->next ) {
pangle = atan2(sp->me.y-sp->prevcp.y,sp->me.x-sp->prevcp.x);
nangle = atan2(sp->nextcp.y-sp->me.y,sp->nextcp.x-sp->me.x);
if ( pangle<0 && nangle>0 && nangle-pangle>=3.1415926 )
@@ -3218,7 +1711,8 @@ void SPWeightedAverageCps(SplinePoint *sp) {
void SPAverageCps(SplinePoint *sp) {
double pangle, nangle, angle, plen, nlen, c, s;
- if ( sp->pointtype==pt_curve && sp->prev && sp->next ) {
+ if (( sp->pointtype==pt_curve || sp->pointtype==pt_hvcurve) &&
+ sp->prev && sp->next ) {
if ( sp->noprevcp )
pangle = atan2(sp->me.y-sp->prev->from->me.y,sp->me.x-sp->prev->from->me.x);
else
@@ -3265,25 +1759,11 @@ void SPAverageCps(SplinePoint *sp) {
}
}
-void SPLAverageCps(SplinePointList *spl) {
- SplinePoint *sp;
-
- while ( spl!=NULL ) {
- for ( sp=spl->first ; ; ) {
- SPAverageCps(sp);
- if ( sp->next==NULL )
- break;
- sp = sp->next->to;
- if ( sp==spl->first )
- break;
- }
- spl = spl->next;
- }
-}
void SplineCharTangentNextCP(SplinePoint *sp) {
double len;
BasePoint *bp, unit;
+ extern int snaptoint;
if ( sp->prev==NULL )
return;
@@ -3298,8 +1778,13 @@ return;
len = sqrt((sp->nextcp.y-sp->me.y)*(sp->nextcp.y-sp->me.y) + (sp->nextcp.x-sp->me.x)*(sp->nextcp.x-sp->me.x));
sp->nextcp.x = sp->me.x + len*unit.x;
sp->nextcp.y = sp->me.y + len*unit.y;
- sp->nextcp.x = rint(sp->nextcp.x*1024)/1024;
- sp->nextcp.y = rint(sp->nextcp.y*1024)/1024;
+ if ( snaptoint ) {
+ sp->nextcp.x = rint(sp->nextcp.x);
+ sp->nextcp.y = rint(sp->nextcp.y);
+ } else {
+ sp->nextcp.x = rint(sp->nextcp.x*1024)/1024;
+ sp->nextcp.y = rint(sp->nextcp.y*1024)/1024;
+ }
if ( sp->next!=NULL && sp->next->order2 )
sp->next->to->prevcp = sp->nextcp;
}
@@ -3307,6 +1792,7 @@ return;
void SplineCharTangentPrevCP(SplinePoint *sp) {
double len;
BasePoint *bp, unit;
+ extern int snaptoint;
if ( sp->next==NULL )
return;
@@ -3321,17 +1807,41 @@ return;
len = sqrt((sp->prevcp.y-sp->me.y)*(sp->prevcp.y-sp->me.y) + (sp->prevcp.x-sp->me.x)*(sp->prevcp.x-sp->me.x));
sp->prevcp.x = sp->me.x + len*unit.x;
sp->prevcp.y = sp->me.y + len*unit.y;
- sp->prevcp.x = rint(sp->prevcp.x*1024)/1024;
- sp->prevcp.y = rint(sp->prevcp.y*1024)/1024;
+ if ( snaptoint ) {
+ sp->prevcp.x = rint(sp->prevcp.x);
+ sp->prevcp.y = rint(sp->prevcp.y);
+ } else {
+ sp->prevcp.x = rint(sp->prevcp.x*1024)/1024;
+ sp->prevcp.y = rint(sp->prevcp.y*1024)/1024;
+ }
if ( sp->prev!=NULL && sp->prev->order2 )
sp->prev->from->nextcp = sp->prevcp;
}
+static void BP_HVForce(BasePoint *vector) {
+ /* Force vector to be horizontal/vertical */
+ double dx, dy, len;
+
+ if ( (dx= vector->x)<0 ) dx = -dx;
+ if ( (dy= vector->y)<0 ) dy = -dy;
+ if ( dx==0 || dy==0 )
+return;
+ len = sqrt(dx*dx + dy*dy);
+ if ( dx>dy ) {
+ vector->x = vector->x<0 ? -len : len;
+ vector->y = 0;
+ } else {
+ vector->y = vector->y<0 ? -len : len;
+ vector->x = 0;
+ }
+}
+
#define NICE_PROPORTION .39
void SplineCharDefaultNextCP(SplinePoint *base) {
SplinePoint *prev=NULL, *next;
double len, plen, ulen;
BasePoint unit;
+ extern int snaptoint;
if ( base->next==NULL )
return;
@@ -3357,17 +1867,23 @@ return;
unit.x /= ulen, unit.y /= ulen;
base->nonextcp = false;
- if ( base->pointtype == pt_curve ) {
+ if ( base->pointtype == pt_curve || base->pointtype == pt_hvcurve ) {
if ( prev!=NULL && (base->prevcpdef || base->noprevcp)) {
unit.x = next->me.x - prev->me.x;
unit.y = next->me.y - prev->me.y;
ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
if ( ulen!=0 )
unit.x /= ulen, unit.y /= ulen;
+ if ( base->pointtype == pt_hvcurve )
+ BP_HVForce(&unit);
plen = sqrt((base->prevcp.x-base->me.x)*(base->prevcp.x-base->me.x) +
(base->prevcp.y-base->me.y)*(base->prevcp.y-base->me.y));
base->prevcp.x = base->me.x - plen*unit.x;
base->prevcp.y = base->me.y - plen*unit.y;
+ if ( snaptoint ) {
+ base->prevcp.x = rint(base->prevcp.x);
+ base->prevcp.y = rint(base->prevcp.y);
+ }
SplineRefigureFixup(base->prev);
} else if ( prev!=NULL ) {
/* The prev control point is fixed. So we've got to use the same */
@@ -3382,8 +1898,10 @@ return;
base->noprevcp = true;
base->prevcpdef = true;
}
+ if ( base->pointtype == pt_hvcurve )
+ BP_HVForce(&unit);
} else if ( base->pointtype == pt_corner ) {
- if ( next->pointtype != pt_curve ) {
+ if ( next->pointtype != pt_curve && next->pointtype != pt_hvcurve ) {
base->nonextcp = true;
}
} else /* tangent */ {
@@ -3411,8 +1929,13 @@ return;
else {
base->nextcp.x = base->me.x + len*unit.x;
base->nextcp.y = base->me.y + len*unit.y;
- base->nextcp.x = rint(base->nextcp.x*1024)/1024;
- base->nextcp.y = rint(base->nextcp.y*1024)/1024;
+ if ( snaptoint ) {
+ base->nextcp.x = rint(base->nextcp.x);
+ base->nextcp.y = rint(base->nextcp.y);
+ } else {
+ base->nextcp.x = rint(base->nextcp.x*1024)/1024;
+ base->nextcp.y = rint(base->nextcp.y*1024)/1024;
+ }
if ( base->next != NULL )
SplineRefigureFixup(base->next);
}
@@ -3422,6 +1945,7 @@ void SplineCharDefaultPrevCP(SplinePoint *base) {
SplinePoint *next=NULL, *prev;
double len, nlen, ulen;
BasePoint unit;
+ extern int snaptoint;
if ( base->prev==NULL )
return;
@@ -3447,17 +1971,23 @@ return;
unit.x /= ulen, unit.y /= ulen;
base->noprevcp = false;
- if ( base->pointtype == pt_curve ) {
+ if ( base->pointtype == pt_curve || base->pointtype == pt_hvcurve ) {
if ( next!=NULL && (base->nextcpdef || base->nonextcp)) {
unit.x = prev->me.x - next->me.x;
unit.y = prev->me.y - next->me.y;
ulen = sqrt(unit.x*unit.x + unit.y*unit.y);
if ( ulen!=0 )
unit.x /= ulen, unit.y /= ulen;
+ if ( base->pointtype == pt_hvcurve )
+ BP_HVForce(&unit);
nlen = sqrt((base->nextcp.x-base->me.x)*(base->nextcp.x-base->me.x) +
(base->nextcp.y-base->me.y)*(base->nextcp.y-base->me.y));
base->nextcp.x = base->me.x - nlen*unit.x;
base->nextcp.y = base->me.y - nlen*unit.y;
+ if ( snaptoint ) {
+ base->nextcp.x = rint(base->nextcp.x);
+ base->nextcp.y = rint(base->nextcp.y);
+ }
SplineRefigureFixup(base->next);
} else if ( next!=NULL ) {
/* The next control point is fixed. So we got to use the same */
@@ -3472,8 +2002,10 @@ return;
base->nonextcp = true;
base->nextcpdef = true;
}
+ if ( base->pointtype == pt_hvcurve )
+ BP_HVForce(&unit);
} else if ( base->pointtype == pt_corner ) {
- if ( prev->pointtype != pt_curve ) {
+ if ( prev->pointtype != pt_curve && prev->pointtype != pt_hvcurve ) {
base->noprevcp = true;
}
} else /* tangent */ {
@@ -3501,107 +2033,18 @@ return;
else {
base->prevcp.x = base->me.x + len*unit.x;
base->prevcp.y = base->me.y + len*unit.y;
- base->prevcp.x = rint(base->prevcp.x*1024)/1024;
- base->prevcp.y = rint(base->prevcp.y*1024)/1024;
+ if ( snaptoint ) {
+ base->prevcp.x = rint(base->prevcp.x);
+ base->prevcp.y = rint(base->prevcp.y);
+ } else {
+ base->prevcp.x = rint(base->prevcp.x*1024)/1024;
+ base->prevcp.y = rint(base->prevcp.y*1024)/1024;
+ }
if ( base->prev!=NULL )
SplineRefigureFixup(base->prev);
}
}
-void SPSmoothJoint(SplinePoint *sp) {
- BasePoint unitn, unitp;
- double len, dot, dotn, dotp;
- if ( sp->prev==NULL || sp->next==NULL || sp->pointtype==pt_corner )
-return;
-
- if ( sp->pointtype==pt_curve && !sp->nonextcp && !sp->noprevcp ) {
- unitn.x = sp->nextcp.x-sp->me.x;
- unitn.y = sp->nextcp.y-sp->me.y;
- len = sqrt(unitn.x*unitn.x + unitn.y*unitn.y);
- if ( len==0 )
-return;
- unitn.x /= len; unitn.y /= len;
- unitp.x = sp->me.x - sp->prevcp.x;
- unitp.y = sp->me.y - sp->prevcp.y;
- len = sqrt(unitp.x*unitp.x + unitp.y*unitp.y);
- if ( len==0 )
-return;
- unitp.x /= len; unitp.y /= len;
- dotn = unitp.y*(sp->nextcp.x-sp->me.x) - unitp.x*(sp->nextcp.y-sp->me.y);
- dotp = unitn.y*(sp->me.x - sp->prevcp.x) - unitn.x*(sp->me.y - sp->prevcp.y);
- sp->nextcp.x -= dotn*unitp.y/2;
- sp->nextcp.y -= -dotn*unitp.x/2;
- sp->prevcp.x += dotp*unitn.y/2;
- sp->prevcp.y += -dotp*unitn.x/2;
- SplineRefigure(sp->prev); SplineRefigure(sp->next);
- }
- if ( sp->pointtype==pt_tangent && !sp->nonextcp ) {
- unitp.x = sp->me.x - sp->prev->from->me.x;
- unitp.y = sp->me.y - sp->prev->from->me.y;
- len = sqrt(unitp.x*unitp.x + unitp.y*unitp.y);
- if ( len!=0 ) {
- unitp.x /= len; unitp.y /= len;
- dot = unitp.y*(sp->nextcp.x-sp->me.x) - unitp.x*(sp->nextcp.y-sp->me.y);
- sp->nextcp.x -= dot*unitp.y;
- sp->nextcp.y -= -dot*unitp.x;
- SplineRefigure(sp->next);
- }
- }
- if ( sp->pointtype==pt_tangent && !sp->noprevcp ) {
- unitn.x = sp->nextcp.x-sp->me.x;
- unitn.y = sp->nextcp.y-sp->me.y;
- len = sqrt(unitn.x*unitn.x + unitn.y*unitn.y);
- if ( len!=0 ) {
- unitn.x /= len; unitn.y /= len;
- dot = unitn.y*(sp->me.x-sp->prevcp.x) - unitn.x*(sp->me.y-sp->prevcp.y);
- sp->prevcp.x += dot*unitn.y;
- sp->prevcp.y += -dot*unitn.x;
- SplineRefigure(sp->prev);
- }
- }
-}
-
-void SplinePointListSet(SplinePointList *tobase, SplinePointList *frombase) {
- SplinePoint *tsp, *first, *fsp;
- Spline *tspline, *firstsp, *fspline;
-
- for ( ; tobase!=NULL && frombase!=NULL; tobase = tobase->next , frombase=frombase->next ) {
- first = NULL;
- for ( tsp = tobase->first, fsp=frombase->first; tsp!=first; tsp=tsp->next->to, fsp=fsp->next->to ) {
- tsp->me = fsp->me;
- tsp->nextcp = fsp->nextcp;
- tsp->prevcp = fsp->prevcp;
- tsp->noprevcp = fsp->noprevcp;
- tsp->nonextcp = fsp->nonextcp;
- if ( first==NULL ) first = tsp;
- if ( tsp->next==NULL )
- break;
- }
- firstsp = NULL;
- for ( tspline = tobase->first->next, fspline=frombase->first->next;
- tspline!=NULL && tspline!=firstsp;
- tspline=tspline->to->next, fspline=fspline->to->next ) {
- tspline->splines[0] = fspline->splines[0];
- tspline->splines[1] = fspline->splines[1];
- LinearApproxFree(tspline->approx);
- tspline->approx = NULL;
- if ( firstsp==NULL ) firstsp = tspline;
- }
- }
-}
-
-int PointListIsSelected(SplinePointList *spl) {
- int anypoints = 0;
- Spline *spline, *first;
-
- first = NULL;
- if ( spl->first->selected ) anypoints = true;
- for ( spline=spl->first->next; spline!=NULL && spline!=first && !anypoints; spline = spline->to->next ) {
- if ( spline->to->selected ) anypoints = true;
- if ( first == NULL ) first = spline;
- }
-return( anypoints );
-}
SplineSet *SplineSetReverse(SplineSet *spl) {
Spline *spline, *first, *next;
@@ -3658,10 +2101,11 @@ return( spl ); /* Only one point, reversal is meaningless */
spl->first->prev = NULL;
spl->last->next = NULL;
}
+
return( spl );
}
-void SplineSetsUntick(SplineSet *spl) {
+static void SplineSetsUntick(SplineSet *spl) {
Spline *spline, *first;
while ( spl!=NULL ) {
@@ -3704,7 +2148,7 @@ return( spl );
return( NULL );
}
-int SplineInSplineSet(Spline *spline, SplineSet *spl) {
+static int SplineInSplineSet(Spline *spline, SplineSet *spl) {
Spline *first, *s;
first = NULL;
@@ -3750,45 +2194,6 @@ return( 0 );
return( 1 );
}
-SplineSet *SplineSetsExtractOpen(SplineSet **tbase) {
- SplineSet *spl, *openhead=NULL, *openlast=NULL, *prev=NULL, *snext;
-
- for ( spl= *tbase; spl!=NULL; spl = snext ) {
- snext = spl->next;
- if ( spl->first->prev==NULL ) {
- if ( prev==NULL )
- *tbase = snext;
- else
- prev->next = snext;
- if ( openhead==NULL )
- openhead = spl;
- else
- openlast->next = spl;
- openlast = spl;
- spl->next = NULL;
- } else
- prev = spl;
- }
-return( openhead );
-}
-
-void SplineSetsInsertOpen(SplineSet **tbase,SplineSet *open) {
- SplineSet *e, *p, *spl, *next;
-
- for ( p=NULL, spl=*tbase, e=open; e!=NULL; e = next ) {
- next = e->next;
- while ( spl!=NULL && spl->first->ttfindex<e->first->ttfindex ) {
- p = spl;
- spl = spl->next;
- }
- if ( p==NULL )
- *tbase = e;
- else
- p->next = e;
- e->next = spl;
- p = e;
- }
-}
/* The idea behind SplineSetsCorrect is simple. However there are many splinesets */
/* where it is impossible, so bear in mind that this only works for nice */
@@ -3816,6 +2221,7 @@ SplineSet *SplineSetsCorrect(SplineSet *base,int *changed) {
es.mmax = ceil(b.maxy*es.scale);
es.omin = b.minx*es.scale;
es.omax = b.maxx*es.scale;
+ es.layer = ly_fore; /* Not meaningful */
/* Give up if we are given unreasonable values (ie. if rounding errors might screw us up) */
if ( es.mmin<1e5 && es.mmax>-1e5 && es.omin<1e5 && es.omax>-1e5 ) {
@@ -3824,7 +2230,7 @@ SplineSet *SplineSetsCorrect(SplineSet *base,int *changed) {
es.interesting = gcalloc(es.cnt,sizeof(char));
es.sc = NULL;
es.major = 1; es.other = 0;
- FindEdgesSplineSet(base,&es);
+ FindEdgesSplineSet(base,&es,false);
check_cnt = 0;
for ( i=0; i<es.cnt && check_cnt<sscnt; ++i ) {
@@ -3865,101 +2271,6 @@ SplineSet *SplineSetsCorrect(SplineSet *base,int *changed) {
return( base );
}
-SplineSet *SplineSetsAntiCorrect(SplineSet *base) {
- int changed;
- SplineSet *spl;
-
- SplineSetsCorrect(base,&changed);
- for ( spl = base; spl!=NULL; spl = spl->next )
- SplineSetReverse(spl);
-return( base );
-}
-
-/* This is exactly the same as SplineSetsCorrect, but instead of correcting */
-/* problems we merely search for them and if we find any return the first */
-SplineSet *SplineSetsDetectDir(SplineSet **_base,int *_lastscan) {
- SplineSet *ret, *base;
- EIList el;
- EI *active=NULL, *apt, *pr, *e;
- int i, winding,change,waschange;
- int lastscan = *_lastscan;
- SplineChar dummy;
-#ifdef FONTFORGE_CONFIG_TYPE3
- Layer layers[2];
-#endif
-
- base = *_base;
-
- memset(&el,'\0',sizeof(el));
- memset(&dummy,'\0',sizeof(dummy));
-#ifdef FONTFORGE_CONFIG_TYPE3
- memset(layers,0,sizeof(layers));
- dummy.layers = layers;
-#endif
- dummy.layer_cnt = 2;
- dummy.layers[ly_fore].splines = base;
- ELFindEdges(&dummy,&el);
- if ( el.coordmax[1]-el.coordmin[1] > 1.e6 ) {
- LogError( _("Warning: Unreasonably big splines. They will be ignored.\n") );
-return( NULL );
- }
- el.major = 1;
- ELOrder(&el,el.major);
-
- ret = NULL;
- waschange = false;
- for ( i=0; i<el.cnt && ret==NULL; ++i ) {
- active = EIActiveEdgesRefigure(&el,active,i,1,&change);
- if ( i<=lastscan )
- continue;
- if ( el.ordered[i]!=NULL || el.ends[i] ) {
- waschange = change;
- continue; /* Just too hard to get the edges sorted when we are at a start vertex */
- }
- if ( !( waschange || change || el.ends[i] || el.ordered[i]!=NULL ||
- (i!=el.cnt-1 && (el.ends[i+1] || el.ordered[i+1]!=NULL)) ))
- continue;
- waschange = change;
- for ( apt=active; apt!=NULL && ret==NULL; apt = e) {
- if ( EISkipExtremum(apt,i+el.low,1)) {
- e = apt->aenext->aenext;
- continue;
- }
- if ( !apt->up ) {
- ret = SplineSetOfSpline(base,active->spline);
- break;
- }
- winding = apt->up?1:-1;
- for ( pr=apt, e=apt->aenext; e!=NULL && winding!=0; pr=e, e=e->aenext ) {
- if ( EISkipExtremum(e,i+el.low,1)) {
- e = e->aenext;
- continue;
- }
- if ( pr->up!=e->up ) {
- if ( (winding<=0 && !e->up) || (winding>0 && e->up )) {
- ret = SplineSetOfSpline(base,active->spline);
- break;
- }
- winding += (e->up?1:-1);
- } else if ( EISameLine(pr,e,i+el.low,1) )
- /* This just continues the line and doesn't change count */;
- else {
- if ( (winding<=0 && !e->up) || (winding>0 && e->up )) {
- ret = SplineSetOfSpline(base,active->spline);
- break;
- }
- winding += (e->up?1:-1);
- }
- }
- }
- }
- free(el.ordered);
- free(el.ends);
- ElFreeEI(&el);
- *_base = base;
- *_lastscan = i;
-return( ret );
-}
int SplinePointListIsClockwise(const SplineSet *spl) {
EIList el;
@@ -3968,19 +2279,16 @@ int SplinePointListIsClockwise(const SplineSet *spl) {
SplineChar dummy;
SplineSet *next;
int ret = -1, maybe=-1;
-#ifdef FONTFORGE_CONFIG_TYPE3
Layer layers[2];
-#endif
if ( spl->first!=spl->last || spl->first->next == NULL )
return( -1 ); /* Open paths, (open paths with only one point are a special case) */
memset(&el,'\0',sizeof(el));
memset(&dummy,'\0',sizeof(dummy));
-#ifdef FONTFORGE_CONFIG_TYPE3
memset(layers,0,sizeof(layers));
+ el.layer = ly_fore;
dummy.layers = layers;
-#endif
dummy.layer_cnt = 2;
dummy.layers[ly_fore].splines = (SplineSet *) spl;
next = spl->next; ((SplineSet *) spl)->next = NULL;
@@ -4019,51 +2327,3 @@ return( -1 );
ret = maybe;
return( ret );
}
-
-#if 0
-void SFFigureGrid(SplineFont *sf) {
- /* Look for any horizontal/vertical lines in the grid splineset */
- int hsnaps[40], hcnt=0, vsnaps[40], vcnt=0, i;
- SplineSet *ss;
- Spline *s, *first;
-
- for ( ss = sf->gridsplines; ss!=NULL; ss=ss->next ) {
- first = NULL;
- for ( s=ss->first->next; s!=NULL && s!=first; s=s->to->next ) {
- if ( s->knownlinear ) {
- if ( s->from->me.x==s->to->me.x && hcnt<40 )
- hsnaps[hcnt++] = s->from->me.x;
- if ( s->from->me.y==s->to->me.y && vcnt<40 )
- vsnaps[vcnt++] = s->from->me.y;
- }
- if ( first==NULL ) first = s;
- }
- }
-
- if ( sf->hsnaps!=NULL ) {
- for ( i=0; i<hcnt && sf->hsnaps[i]==hsnaps[i]; ++i );
- if ( i!=hcnt || sf->hsnaps[i]!=0x80000000 ) {
- free( sf->hsnaps );
- sf->hsnaps = NULL;
- }
- }
- if ( sf->vsnaps!=NULL ) {
- for ( i=0; i<vcnt && sf->vsnaps[i]==vsnaps[i]; ++i );
- if ( i!=vcnt || sf->vsnaps[i]!=0x80000000 ) {
- free( sf->vsnaps );
- sf->vsnaps = NULL;
- }
- }
-
- if ( hcnt!=0 && sf->hsnaps==NULL ) {
- sf->hsnaps = galloc((hcnt+1)*sizeof(int));
- memcpy(sf->hsnaps,hsnaps,hcnt*sizeof(int));
- sf->hsnaps[hcnt] = 0x80000000;
- }
- if ( vcnt!=0 && sf->vsnaps==NULL ) {
- sf->vsnaps = galloc((vcnt+1)*sizeof(int));
- memcpy(sf->vsnaps,vsnaps,vcnt*sizeof(int));
- sf->vsnaps[vcnt] = 0x80000000;
- }
-}
-#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/start.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/start.c
new file mode 100644
index 00000000000..71fb1b4ee8d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/start.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h"
+#include <gfile.h>
+#include <time.h>
+#include <sys/time.h>
+#include <locale.h>
+#include <unistd.h>
+
+int32 unicode_from_adobestd[256];
+struct lconv localeinfo;
+char *coord_sep = ",";
+const struct unicode_nameannot * const *const *_UnicodeNameAnnot = NULL;
+
+static void initadobeenc(void) {
+ int i,j;
+
+ for ( i=0; i<0x100; ++i ) {
+ if ( strcmp(AdobeStandardEncoding[i],".notdef")==0 )
+ unicode_from_adobestd[i] = 0xfffd;
+ else {
+ j = UniFromName(AdobeStandardEncoding[i],ui_none,&custom);
+ if ( j==-1 ) j = 0xfffd;
+ unicode_from_adobestd[i] = j;
+ }
+ }
+}
+
+static void initrand(void) {
+ struct timeval tv;
+
+ gettimeofday(&tv,NULL);
+ srand(tv.tv_usec);
+}
+
+void InitSimpleStuff(void) {
+ initrand();
+ initadobeenc();
+
+ setlocale(LC_ALL,"");
+ localeinfo = *localeconv();
+ coord_sep = ",";
+ if ( *localeinfo.decimal_point=='.' ) coord_sep=",";
+ else if ( *localeinfo.decimal_point!='.' ) coord_sep=" ";
+
+ SetDefaults();
+}
+
+void doversion(const char *source_version_str) {
+ if ( source_version_str!=NULL )
+ printf( "fontforge %s\n", source_version_str );
+exit(0);
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/stemdb.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/stemdb.c
new file mode 100644
index 00000000000..60ecac660d5
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/stemdb.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2005-2008 by George Williams and Alexey Kryukov */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include "edgelist2.h"
+#include "stemdb.h"
+
+#include <math.h>
+#include <utype.h>
+
+/* A diagonal end is like the top or bottom of a slash. Should we add a vertical stem at the end? */
+/* A diagonal corner is like the bottom of circumflex. Should we add a horizontal stem? */
+int hint_diagonal_ends = 0,
+ hint_diagonal_intersections = 0,
+ hint_bounding_boxes = 1,
+ detect_diagonal_stems = 0;
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stemdb.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/stemdb.h
index 149792a65f3..83a02842a6a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/stemdb.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/stemdb.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2007 by George Williams */
+/* Copyright (C) 2005-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -29,11 +29,16 @@
# include "pfaedit.h"
-struct glyphdata {
+typedef struct glyphdata {
SplineFont *sf;
BlueData bd;
+ int fuzz;
SplineChar *sc;
- int fudge;
+ int layer;
+ int emsize;
+ int order2;
+ int has_slant;
+ BasePoint slant_unit;
int ccnt;
int *contourends;
int realcnt; /* Includes control points, excludes implied points */
@@ -44,6 +49,9 @@ struct glyphdata {
struct stemdata *stems;
int linecnt;
struct linedata *lines;
+ struct stembundle *hbundle;
+ struct stembundle *vbundle;
+ struct stembundle *ibundle;
/* Temporary values, quickly freed */
int mcnt;
@@ -54,76 +62,123 @@ struct glyphdata {
struct st *stspace;
DBounds size;
struct pointdata **pspace;
- struct stembundle *bundles;
- struct segment { double start, end, base; int curved; } *lspace, *rspace, *bothspace, *activespace;
+ struct segment {
+ double start, end, sbase, ebase;
+ int curved, scurved, ecurved;
+ } *lspace, *rspace, *bothspace, *activespace;
int only_hv;
-};
+} GlyphData;
-struct pointdata {
+typedef struct pointdata {
SplinePoint *sp;
SplineSet *ss;
+ int ttfindex; /* normally same as sp->ttfindex, but needed for offcurve points */
+ BasePoint base; /* normally same as sp->me, but needed for offcurve points */
BasePoint nextunit, prevunit; /* unit vectors pointing in the next/prev directions */
struct linedata *nextline, *prevline; /* any other points lying on approximately the same line */
- Spline *nextedge, *prevedge; /* There should always be a matching spline, which may end up as part of a stem, and may not */
+ Spline *nextedges[2], *prevedges[2]; /* There should always be a matching spline, which may end up as part of a stem, and may not */
Spline *bothedge;
- double next_e_t, prev_e_t; /* Location on other edge where our normal hits it */
+ double next_e_t[2], prev_e_t[2]; /* Location on other edge where our normal hits it */
double both_e_t;
- struct stemdata *nextstem, *prevstem;
- struct stemdata *bothstem;
+ int next_e_cnt, prev_e_cnt;
+ double next_dist[2], prev_dist[2]; /* Distance from the point to the matching edge */
+ struct stemdata **nextstems, **prevstems;
+ int *next_is_l, *prev_is_l;
+ int nextcnt, prevcnt;
double nextlen, prevlen;
+ int value; /* Temporary value, used to compare points assigned to the same edge and determine which one can be used as a reference point*/
unsigned int nextlinear: 1;
unsigned int nextzero: 1;
unsigned int prevlinear: 1;
unsigned int prevzero: 1;
unsigned int colinear: 1;
- unsigned int symetrical_h: 1; /* Are next & prev symetrical? */
- unsigned int symetrical_v: 1; /* Are next & prev symetrical? */
+ unsigned int symetrical_h: 1; /* Are next & prev symetrical? */
+ unsigned int symetrical_v: 1; /* Are next & prev symetrical? */
unsigned int next_hor: 1;
unsigned int next_ver: 1;
unsigned int prev_hor: 1;
unsigned int prev_ver: 1;
- unsigned int newpos_set: 2; /* Holds three values: 0 (not), 1 (positioned by 1 stem), 2 (2 stems) */
- unsigned int next_is_l: 1;
- unsigned int prev_is_l: 1;
+ unsigned int ticked: 1;
+ uint8 touched, affected;
+ uint8 x_extr, y_extr;
+ uint8 x_corner, y_corner;
BasePoint newpos;
BasePoint newnext, newprev;
BasePoint posdir; /* If point has been positioned in 1 direction, this is that direction */
double projection; /* temporary value */
-};
+} PointData;
-struct linedata {
- BasePoint unitvector;
+typedef struct linedata {
+ BasePoint unit;
BasePoint online;
+ uint8 is_left;
int pcnt;
+ double length;
struct pointdata **points;
-};
+} LineData;
-struct stemdata {
+typedef struct stemdata {
BasePoint unit; /* Unit vector pointing in direction of stem */
BasePoint l_to_r; /* Unit vector pointing from left to right (across stem) */
BasePoint left; /* a point on one side of the stem (not necissarily left, even for vertical stems) */
BasePoint right; /* and one on the other */
+ BasePoint newunit; /* Unit vector after repositioning (e. g. in Metafont routines) */
+ BasePoint newleft, newright;/* Left and right edges after repositioning */
+ int leftidx, rightidx; /* TTF indices of the left and right key points */
+ struct pointdata *keypts[4];/* Uppest and lowest points on left and right edges. Used for positioning diagonal stems */
+ double lmin, lmax, rmin, rmax;
double width;
int chunk_cnt; /* number of separate point-pairs on this stem */
struct stem_chunk {
+ struct stemdata *parent;
struct pointdata *l;
struct pointdata *r;
- struct pointdata *lpotential, *rpotential;
+ uint8 lpotential, rpotential;
uint8 lnext, rnext; /* are we using the next/prev side of the left/right points */
uint8 ltick, rtick;
+ uint8 stub;
uint8 stemcheat; /* It's not a real stem, but it's something we'd like PostScript to hint for us */
+ uint8 is_ball; /* Specifies if this chunk marks the opposite sides of a ball terminal (useful for TTF instructions) */
+ int l_e_idx, r_e_idx; /* Which of the opposed edges assigned to the left and right points corresponds to this chunk */
} *chunks;
int activecnt;
struct segment *active;
uint8 toobig; /* Stem is fatter than tall, unlikely to be a real stem */
uint8 positioned;
uint8 ticked;
+ uint8 ghost;
+ uint8 bbox;
+ uint8 ldone, rdone;
+ uint8 italic;
+ int blue; /* Blue zone a ghost hint is attached to */
double len, clen; /* Length of linear segments. clen adds "length" of curved bits */
struct stembundle *bundle;
- double lpos, rpos; /* When placed in a bundle, relative to the bundle's basepoint in l_to_r */
- double lnew, rnew; /* New position of left, right edges relative to bp,l_to_r */
-};
+ int lpcnt, rpcnt; /* Count of points assigned to left and right edges of this stem */
+ struct linedata *leftline, *rightline;
+ struct stemdata *master, *next_c_m, *prev_c_m;
+ int confl_cnt;
+ int dep_cnt;
+ int serif_cnt;
+ struct dependent_stem {
+ struct stemdata *stem;
+ uint8 lbase;
+ char dep_type; /* can be 'a' (align), 'i' (interpolate), 'm' (move) or 's' (serif) */
+ } *dependent; /* Lists other stems dependent from the given stem */
+ struct dependent_serif {
+ struct stemdata *stem;
+ double width; /* The distance from an edge of the main stem to the opposite edge of the serif stem */
+ uint8 lbase;
+ uint8 is_ball;
+ } *serifs; /* Lists serifs and other elements protruding from the base stem */
+} StemData;
+
+typedef struct vchunk {
+ struct stem_chunk *chunk;
+ double dist;
+ int parallel;
+ int value;
+} VChunk;
struct stembounds {
struct stembounds *next;
@@ -137,17 +192,19 @@ struct splinesteminfo {
struct stembounds *sb;
};
-struct stembundle {
- BasePoint *unit; /* All these stems are parallel, pointing in unit direction */
- BasePoint *l_to_r; /* Axis along which these stems are ordered (normal to unit) */
- BasePoint *bp; /* Base point for measuring by l_to_r (stem->lpos,rpos) */
+typedef struct stembundle {
+ BasePoint unit; /* All these stems are parallel, pointing in unit direction */
+ BasePoint l_to_r; /* Axis along which these stems are ordered (normal to unit) */
+ BasePoint bp; /* Base point for measuring by l_to_r (stem->lpos,rpos) */
int cnt; /* Number of stems in the bundle */
struct stemdata **stemlist;
- struct stembundle *next;
-};
+} StemBundle;
-
-extern struct glyphdata *GlyphDataBuild(SplineChar *sc, int only_hv);
+extern struct glyphdata *GlyphDataBuild(SplineChar *sc, int layer, BlueData *bd, int use_existing);
+extern struct glyphdata *GlyphDataInit(SplineChar *sc, int layer, double em_size, int only_hv);
+extern struct glyphdata *StemInfoToStemData( struct glyphdata *gd,StemInfo *si,int is_v );
+extern struct glyphdata *DStemInfoToStemData( struct glyphdata *gd,DStemInfo *dsi );
+extern int IsStemAssignedToPoint( struct pointdata *pd,struct stemdata *stem,int is_next );
extern void GlyphDataFree(struct glyphdata *gd);
#endif /* _STEMDB_H_ */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c
new file mode 100644
index 00000000000..0a89f32fa0e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottf.c
@@ -0,0 +1,2048 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include <math.h>
+#include <unistd.h>
+#include <time.h>
+#include <locale.h>
+#include <utype.h>
+#include <ustring.h>
+#include <chardata.h>
+#include <gwidget.h>
+
+#ifdef __CygWin
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+#endif
+
+#include "ttf.h"
+
+char *TTFFoundry=NULL;
+
+/* This file produces a ttf file given a splinefont. */
+
+/* ************************************************************************** */
+
+/* Required tables:
+ cmap encoding
+ head header data
+ hhea horizontal metrics header data
+ hmtx horizontal metrics (widths, lsidebearing)
+ maxp various maxima in the font
+ name various names associated with the font
+ post postscript names and other stuff
+Required by windows but not mac
+ OS/2 bleah.
+Required for TrueType
+ loca pointers to the glyphs
+ glyf character shapes
+Required for OpenType (Postscript)
+ CFF A complete postscript CFF font here with all its internal tables
+Required for bitmaps
+ bdat/EBDT bitmap data
+ bloc/EBLC pointers to bitmaps
+ bhed for apple bitmap only fonts, replaces head
+Optional for bitmaps
+ EBSC bitmap scaling table (used in windows "bitmap-only" fonts)
+"Advanced Typograpy"
+ Apple
+ feat (mapping between morx features and 'name' names)
+ kern (if data are present)
+ lcar (ligature caret, if data present)
+ morx (substitutions, if data present)
+ prop (glyph properties, if data present)
+ opbd (optical bounds, if data present)
+ OpenType
+ GPOS (opentype, if kern,anchor data are present)
+ GSUB (opentype, if ligature (other subs) data are present)
+ GDEF (opentype, if anchor data are present)
+MATH
+ MATH (MS proposal, if math data present)
+Apple variation tables (for distortable (multiple master type) fonts)
+ fvar (font variations)
+ gvar (glyph variations)
+ cvar (cvt variations)
+ avar (axis variations)
+additional tables
+ cvt for hinting
+ gasp to control when things should be hinted
+ fpgm for hinting (currently only copied and dumped verbatim)
+ prep for hinting (currently only copied and dumped verbatim)
+FontForge
+ PfEd My own table
+TeX
+ TeX TeX specific info (stuff that used to live in tfm files)
+*/
+
+const char *ttfstandardnames[258] = {
+".notdef",
+".null",
+"nonmarkingreturn",
+"space",
+"exclam",
+"quotedbl",
+"numbersign",
+"dollar",
+"percent",
+"ampersand",
+"quotesingle",
+"parenleft",
+"parenright",
+"asterisk",
+"plus",
+"comma",
+"hyphen",
+"period",
+"slash",
+"zero",
+"one",
+"two",
+"three",
+"four",
+"five",
+"six",
+"seven",
+"eight",
+"nine",
+"colon",
+"semicolon",
+"less",
+"equal",
+"greater",
+"question",
+"at",
+"A",
+"B",
+"C",
+"D",
+"E",
+"F",
+"G",
+"H",
+"I",
+"J",
+"K",
+"L",
+"M",
+"N",
+"O",
+"P",
+"Q",
+"R",
+"S",
+"T",
+"U",
+"V",
+"W",
+"X",
+"Y",
+"Z",
+"bracketleft",
+"backslash",
+"bracketright",
+"asciicircum",
+"underscore",
+"grave",
+"a",
+"b",
+"c",
+"d",
+"e",
+"f",
+"g",
+"h",
+"i",
+"j",
+"k",
+"l",
+"m",
+"n",
+"o",
+"p",
+"q",
+"r",
+"s",
+"t",
+"u",
+"v",
+"w",
+"x",
+"y",
+"z",
+"braceleft",
+"bar",
+"braceright",
+"asciitilde",
+"Adieresis",
+"Aring",
+"Ccedilla",
+"Eacute",
+"Ntilde",
+"Odieresis",
+"Udieresis",
+"aacute",
+"agrave",
+"acircumflex",
+"adieresis",
+"atilde",
+"aring",
+"ccedilla",
+"eacute",
+"egrave",
+"ecircumflex",
+"edieresis",
+"iacute",
+"igrave",
+"icircumflex",
+"idieresis",
+"ntilde",
+"oacute",
+"ograve",
+"ocircumflex",
+"odieresis",
+"otilde",
+"uacute",
+"ugrave",
+"ucircumflex",
+"udieresis",
+"dagger",
+"degree",
+"cent",
+"sterling",
+"section",
+"bullet",
+"paragraph",
+"germandbls",
+"registered",
+"copyright",
+"trademark",
+"acute",
+"dieresis",
+"notequal",
+"AE",
+"Oslash",
+"infinity",
+"plusminus",
+"lessequal",
+"greaterequal",
+"yen",
+"mu",
+"partialdiff",
+"summation",
+"product",
+"pi",
+"integral",
+"ordfeminine",
+"ordmasculine",
+"Omega",
+"ae",
+"oslash",
+"questiondown",
+"exclamdown",
+"logicalnot",
+"radical",
+"florin",
+"approxequal",
+"Delta",
+"guillemotleft",
+"guillemotright",
+"ellipsis",
+"nonbreakingspace",
+"Agrave",
+"Atilde",
+"Otilde",
+"OE",
+"oe",
+"endash",
+"emdash",
+"quotedblleft",
+"quotedblright",
+"quoteleft",
+"quoteright",
+"divide",
+"lozenge",
+"ydieresis",
+"Ydieresis",
+"fraction",
+"currency",
+"guilsinglleft",
+"guilsinglright",
+"fi",
+"fl",
+"daggerdbl",
+"periodcentered",
+"quotesinglbase",
+"quotedblbase",
+"perthousand",
+"Acircumflex",
+"Ecircumflex",
+"Aacute",
+"Edieresis",
+"Egrave",
+"Iacute",
+"Icircumflex",
+"Idieresis",
+"Igrave",
+"Oacute",
+"Ocircumflex",
+"apple",
+"Ograve",
+"Uacute",
+"Ucircumflex",
+"Ugrave",
+"dotlessi",
+"circumflex",
+"tilde",
+"macron",
+"breve",
+"dotaccent",
+"ring",
+"cedilla",
+"hungarumlaut",
+"ogonek",
+"caron",
+"Lslash",
+"lslash",
+"Scaron",
+"scaron",
+"Zcaron",
+"zcaron",
+"brokenbar",
+"Eth",
+"eth",
+"Yacute",
+"yacute",
+"Thorn",
+"thorn",
+"minus",
+"multiply",
+"onesuperior",
+"twosuperior",
+"threesuperior",
+"onehalf",
+"onequarter",
+"threequarters",
+"franc",
+"Gbreve",
+"gbreve",
+"Idotaccent",
+"Scedilla",
+"scedilla",
+"Cacute",
+"cacute",
+"Ccaron",
+"ccaron",
+"dcroat"
+};
+
+
+void putshort(FILE *file,int sval) {
+ putc((sval>>8)&0xff,file);
+ putc(sval&0xff,file);
+}
+
+void putlong(FILE *file,int val) {
+ putc((val>>24)&0xff,file);
+ putc((val>>16)&0xff,file);
+ putc((val>>8)&0xff,file);
+ putc(val&0xff,file);
+}
+#define dumpabsoffset putlong
+
+static void dumpoffset(FILE *file,int offsize,int val) {
+ if ( offsize==1 )
+ putc(val,file);
+ else if ( offsize==2 )
+ putshort(file,val);
+ else if ( offsize==3 ) {
+ putc((val>>16)&0xff,file);
+ putc((val>>8)&0xff,file);
+ putc(val&0xff,file);
+ } else
+ putlong(file,val);
+}
+
+void putfixed(FILE *file,real dval) {
+ int val;
+ int mant;
+
+ val = floor(dval);
+ mant = floor(65536.*(dval-val));
+ val = (val<<16) | mant;
+ putlong(file,val);
+}
+
+int ttfcopyfile(FILE *ttf, FILE *other, int pos, char *tab_name) {
+ int ch;
+ int ret = 1;
+
+ if ( ferror(ttf) || ferror(other)) {
+ IError("Disk error of some nature. Perhaps no space on device?\nGenerated font will be unusable" );
+ } else if ( pos!=ftell(ttf)) {
+ IError("File Offset wrong for ttf table (%s), %d expected %d", tab_name, ftell(ttf), pos );
+ }
+ rewind(other);
+ while (( ch = getc(other))!=EOF )
+ putc(ch,ttf);
+ if ( ferror(other)) ret = 0;
+ if ( fclose(other)) ret = 0;
+return( ret );
+}
+
+static void FigureFullMetricsEnd(SplineFont *sf,struct glyphinfo *gi, int istt ) {
+ /* We can reduce the size of the width array by removing a run at the end */
+ /* of the same width. So start at the end, find the width of the last */
+ /* character we'll output, then run backwards as long as we've got the */
+ /* same width */
+ /* (do same thing for vertical metrics too */
+ int i, lasti, lastv, lastdefault = istt ? 3 : 1;
+ int width, vwidth;
+
+ lasti = lastv = gi->gcnt-1;
+ for ( i=gi->gcnt-1; i>lastdefault && gi->bygid[i]==-1; --i );
+ if ( i>=lastdefault ) {
+ width = sf->glyphs[gi->bygid[i]]->width;
+ vwidth = sf->glyphs[gi->bygid[i]]->vwidth;
+ lasti = lastv = i;
+ for ( i=lasti-1; i>=lastdefault; --i ) {
+ if ( SCWorthOutputting(sf->glyphs[gi->bygid[i]]) ) {
+ if ( sf->glyphs[gi->bygid[i]]->width!=width )
+ break;
+ else
+ lasti = i;
+ }
+ }
+ gi->lasthwidth = lasti;
+ if ( sf->hasvmetrics ) {
+ for ( i=lastv-1; i>=lastdefault; --i ) {
+ if ( SCWorthOutputting(sf->glyphs[gi->bygid[i]]) ) {
+ if ( sf->glyphs[gi->bygid[i]]->vwidth!=vwidth )
+ break;
+ else
+ lastv = i;
+ }
+ }
+ gi->lastvwidth = lastv;
+ }
+ } else {
+ gi->lasthwidth = 0;
+ gi->lastvwidth = 0;
+ }
+}
+
+
+#define _On_Curve 1
+#define _X_Short 2
+#define _Y_Short 4
+#define _Repeat 8
+#define _X_Same 0x10
+#define _Y_Same 0x20
+
+int RefDepth(RefChar *ref,int layer) {
+ int rd, temp;
+ SplineChar *sc = ref->sc;
+
+ if ( sc->layers[layer].refs==NULL || sc->layers[layer].splines!=NULL )
+return( 1 );
+ rd = 0;
+ for ( ref = sc->layers[layer].refs; ref!=NULL; ref=ref->next ) {
+ if ( ref->transform[0]>=-2 || ref->transform[0]<=1.999939 ||
+ ref->transform[1]>=-2 || ref->transform[1]<=1.999939 ||
+ ref->transform[2]>=-2 || ref->transform[2]<=1.999939 ||
+ ref->transform[3]>=-2 || ref->transform[3]<=1.999939 ) {
+ temp = RefDepth(ref,layer);
+ if ( temp>rd ) rd = temp;
+ }
+ }
+return( rd+1 );
+}
+
+void SFDummyUpCIDs(struct glyphinfo *gi,SplineFont *sf) {
+ int i,j,k,max;
+ int *bygid;
+
+ max = 0;
+ for ( k=0; k<sf->subfontcnt; ++k )
+ if ( sf->subfonts[k]->glyphcnt>max ) max = sf->subfonts[k]->glyphcnt;
+ if ( max == 0 )
+return;
+
+ sf->glyphs = gcalloc(max,sizeof(SplineChar *));
+ sf->glyphcnt = sf->glyphmax = max;
+ for ( k=0; k<sf->subfontcnt; ++k )
+ for ( i=0; i<sf->subfonts[k]->glyphcnt; ++i ) if ( sf->subfonts[k]->glyphs[i]!=NULL )
+ sf->glyphs[i] = sf->subfonts[k]->glyphs[i];
+
+ if ( gi==NULL )
+return;
+
+ bygid = galloc((sf->glyphcnt+3)*sizeof(int));
+ memset(bygid,0xff, (sf->glyphcnt+3)*sizeof(int));
+
+ j=1;
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
+ if ( bygid[0]== -1 && strcmp(sf->glyphs[i]->name,".notdef")==0 ) {
+ sf->glyphs[i]->ttf_glyph = 0;
+ bygid[0] = i;
+ } else if ( SCWorthOutputting(sf->glyphs[i])) {
+ sf->glyphs[i]->ttf_glyph = j;
+ bygid[j++] = i;
+ }
+ }
+ gi->bygid = bygid;
+ gi->gcnt = j;
+}
+
+static void AssignNotdefNull(SplineFont *sf,int *bygid, int iscff) {
+ int i;
+
+ /* The first three glyphs are magic, glyph 0 is .notdef */
+ /* glyph 1 is .null and glyph 2 is nonmarking return */
+ /* We may generate them automagically */
+
+ bygid[0] = bygid[1] = bygid[2] = -1;
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
+ if ( bygid[0]== -1 && strcmp(sf->glyphs[i]->name,".notdef")==0 ) {
+ sf->glyphs[i]->ttf_glyph = 0;
+ bygid[0] = i;
+ } else if ( !iscff && bygid[1]== -1 &&
+ (strcmp(sf->glyphs[i]->name,".null")==0 ||
+ strcmp(sf->glyphs[i]->name,"uni0000")==0 ||
+ (i==1 && strcmp(sf->glyphs[1]->name,"glyph1")==0)) ) {
+ sf->glyphs[i]->ttf_glyph = 1;
+ bygid[1] = i;
+ } else if ( !iscff && bygid[2]== -1 &&
+ (strcmp(sf->glyphs[i]->name,"nonmarkingreturn")==0 ||
+ strcmp(sf->glyphs[i]->name,"uni000D")==0 ||
+ (i==2 && strcmp(sf->glyphs[2]->name,"glyph2")==0)) ) {
+ sf->glyphs[i]->ttf_glyph = 2;
+ bygid[2] = i;
+ }
+ }
+}
+
+static int AssignTTFGlyph(struct glyphinfo *gi,SplineFont *sf,EncMap *map,int iscff) {
+ int *bygid = galloc((sf->glyphcnt+3)*sizeof(int));
+ int i,j;
+
+ memset(bygid,0xff, (sf->glyphcnt+3)*sizeof(int));
+
+ AssignNotdefNull(sf,bygid,iscff);
+
+ j = iscff ? 1 : 3;
+ for ( i=0; i<map->enccount; ++i ) if ( map->map[i]!=-1 ) {
+ SplineChar *sc = sf->glyphs[map->map[i]];
+ if ( SCWorthOutputting(sc) && sc->ttf_glyph==-1
+#if HANYANG
+ && (!iscff || !sc->compositionunit)
+#endif
+ ) {
+ sc->ttf_glyph = j;
+ bygid[j++] = sc->orig_pos;
+ }
+ }
+
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
+ SplineChar *sc = sf->glyphs[i];
+ if ( SCWorthOutputting(sc) && sc->ttf_glyph==-1
+#if HANYANG
+ && (!iscff || !sc->compositionunit)
+#endif
+ ) {
+ sc->ttf_glyph = j;
+ bygid[j++] = i;
+ }
+ }
+ gi->bygid = bygid;
+ gi->gcnt = j;
+return j;
+}
+
+/* Standard names for cff */
+extern const char *cffnames[];
+extern const int nStdStrings;
+
+static int storesid(struct alltabs *at,char *str) {
+ int i;
+ FILE *news;
+ char *pt;
+ long pos;
+
+ if ( str!=NULL ) { /* NULL is the magic string at end of array */
+ for ( i=0; cffnames[i]!=NULL; ++i ) {
+ if ( strcmp(cffnames[i],str)==0 )
+return( i );
+ }
+ }
+
+ pos = ftell(at->sidf)+1;
+ if ( pos>=65536 && !at->sidlongoffset ) {
+ at->sidlongoffset = true;
+ news = tmpfile();
+ rewind(at->sidh);
+ for ( i=0; i<at->sidcnt; ++i )
+ putlong(news,getushort(at->sidh));
+ fclose(at->sidh);
+ at->sidh = news;
+ }
+ if ( at->sidlongoffset )
+ putlong(at->sidh,pos);
+ else
+ putshort(at->sidh,pos);
+
+ if ( str!=NULL ) {
+ for ( pt=str; *pt; ++pt )
+ putc(*pt,at->sidf);
+ }
+return( at->sidcnt++ + nStdStrings );
+}
+
+static void dumpint(FILE *cfff,int num) {
+
+ if ( num>=-107 && num<=107 )
+ putc(num+139,cfff);
+ else if ( num>=108 && num<=1131 ) {
+ num -= 108;
+ putc((num>>8)+247,cfff);
+ putc(num&0xff,cfff);
+ } else if ( num>=-1131 && num<=-108 ) {
+ num = -num;
+ num -= 108;
+ putc((num>>8)+251,cfff);
+ putc(num&0xff,cfff);
+ } else if ( num>=-32768 && num<32768 ) {
+ putc(28,cfff);
+ putc(num>>8,cfff);
+ putc(num&0xff,cfff);
+ } else { /* In dict data we have 4 byte ints, in type2 strings we don't */
+ putc(29,cfff);
+ putc((num>>24)&0xff,cfff);
+ putc((num>>16)&0xff,cfff);
+ putc((num>>8)&0xff,cfff);
+ putc(num&0xff,cfff);
+ }
+}
+
+static void dumpdbl(FILE *cfff,double d) {
+ if ( d-rint(d)>-.00001 && d-rint(d)<.00001 )
+ dumpint(cfff,(int) d);
+ else {
+ /* The type2 strings have a fixed format, but the dict data does not */
+ char buffer[20], *pt;
+ int sofar,n,odd;
+ sprintf( buffer, "%g", d);
+ sofar = 0; odd=true;
+ putc(30,cfff); /* Start a double */
+ for ( pt=buffer; *pt; ++pt ) {
+ if ( isdigit(*pt) )
+ n = *pt-'0';
+ else if ( *pt=='.' )
+ n = 0xa;
+ else if ( *pt=='-' )
+ n = 0xe;
+ else if (( *pt=='E' || *pt=='e') && pt[1]=='-' ) {
+ n = 0xc;
+ ++pt;
+ } else if ( *pt=='E' || *pt=='e')
+ n = 0xb;
+ else
+ n = 0; /* Should never happen */
+ if ( odd ) {
+ sofar = n<<4;
+ odd = false;
+ } else {
+ putc(sofar|n,cfff);
+ sofar=0;
+ odd = true;
+ }
+ }
+ if ( sofar==0 )
+ putc(0xff,cfff);
+ else
+ putc(sofar|0xf,cfff);
+ }
+}
+
+static void dumpoper(FILE *cfff,int oper ) {
+ if ( oper!=-1 ) {
+ if ( oper>=256 )
+ putc(oper>>8,cfff);
+ putc(oper&0xff,cfff);
+ }
+}
+
+static void dumpdbloper(FILE *cfff,double d, int oper ) {
+ dumpdbl(cfff,d);
+ dumpoper(cfff,oper);
+}
+
+static void dumpintoper(FILE *cfff,int v, int oper ) {
+ dumpint(cfff,v);
+ dumpoper(cfff,oper);
+}
+
+static void dumpsizedint(FILE *cfff,int big,int num, int oper ) {
+ if ( big ) {
+ putc(29,cfff);
+ putc((num>>24)&0xff,cfff);
+ putc((num>>16)&0xff,cfff);
+ putc((num>>8)&0xff,cfff);
+ putc(num&0xff,cfff);
+ } else {
+ putc(28,cfff);
+ putc(num>>8,cfff);
+ putc(num&0xff,cfff);
+ }
+ dumpoper(cfff,oper);
+}
+
+static void dumpsid(FILE *cfff,struct alltabs *at,char *str,int oper) {
+ if ( str==NULL )
+return;
+ dumpint(cfff,storesid(at,str));
+ dumpoper(cfff,oper);
+}
+
+static void DumpStrDouble(char *pt,FILE *cfff,int oper) {
+ real d;
+ if ( *pt=='[' ) ++pt; /* For StdHW, StdVW */
+ d = strtod(pt,NULL);
+ dumpdbloper(cfff,d,oper);
+}
+
+static void DumpDblArray(real *arr,int n,FILE *cfff, int oper) {
+ int mi,i;
+
+ for ( mi=n-1; mi>=0 && arr[mi]==0; --mi );
+ if ( mi<0 )
+return;
+ dumpdbl(cfff,arr[0]);
+ for ( i=1; i<=mi; ++i )
+ dumpdbl(cfff,arr[i]-arr[i-1]);
+ dumpoper(cfff,oper);
+}
+
+static void DumpStrArray(char *pt,FILE *cfff,int oper) {
+ real d, last=0;
+ char *end;
+
+ while ( *pt==' ' ) ++pt;
+ if ( *pt=='\0' )
+return;
+ if ( *pt=='[' ) ++pt;
+ while ( *pt==' ' ) ++pt;
+ while ( *pt!=']' && *pt!='\0' ) {
+ d = strtod(pt,&end);
+ if ( pt==end ) /* User screwed up. Should be a number */
+ break;
+ dumpdbl(cfff,d-last);
+ last = d;
+ pt = end;
+ while ( *pt==' ' ) ++pt;
+ }
+ dumpoper(cfff,oper);
+}
+
+static void dumpcffheader(SplineFont *sf,FILE *cfff) {
+ putc('\1',cfff); /* Major version: 1 */
+ putc('\0',cfff); /* Minor version: 0 */
+ putc('\4',cfff); /* Header size in bytes */
+ putc('\4',cfff); /* Absolute Offset size. */
+ /* I don't think there are any absolute offsets that aren't encoded */
+ /* in a dict as numbers (ie. inherently variable sized items) */
+}
+
+static void dumpcffnames(SplineFont *sf,FILE *cfff) {
+ char *pt;
+
+ putshort(cfff,1); /* One font name */
+ putc('\1',cfff); /* Offset size */
+ putc('\1',cfff); /* Offset to first name */
+ putc('\1'+strlen(sf->fontname),cfff);
+ for ( pt=sf->fontname; *pt; ++pt )
+ putc(*pt,cfff);
+}
+
+static void dumpcffcharset(SplineFont *sf,struct alltabs *at) {
+ int i;
+
+ at->gn_sid = gcalloc(at->gi.gcnt,sizeof(uint32));
+ putc(0,at->charset);
+ /* I always use a format 0 charset. ie. an array of SIDs in random order */
+
+ /* First element must be ".notdef" and is omitted */
+
+ for ( i=1; i<at->gi.gcnt; ++i )
+ if ( at->gi.bygid[i]!=-1 && SCWorthOutputting(sf->glyphs[at->gi.bygid[i]])) {
+ at->gn_sid[i] = storesid(at,sf->glyphs[at->gi.bygid[i]]->name);
+ putshort(at->charset,at->gn_sid[i]);
+ }
+}
+
+static void dumpcffcidset(SplineFont *sf,struct alltabs *at) {
+ int gid, start;
+
+ putc(2,at->charset);
+
+ start = -1; /* Glyph 0 always maps to CID 0, and is omitted */
+ for ( gid = 1; gid<at->gi.gcnt; ++gid ) {
+ if ( start==-1 )
+ start = gid;
+ else if ( at->gi.bygid[gid]-at->gi.bygid[start]!=gid-start ) {
+ putshort(at->charset,at->gi.bygid[start]);
+ putshort(at->charset,at->gi.bygid[gid-1]-at->gi.bygid[start]);
+ start = gid;
+ }
+ }
+ if ( start!=-1 ) {
+ putshort(at->charset,at->gi.bygid[start]);
+ putshort(at->charset,at->gi.bygid[gid-1]-at->gi.bygid[start]);
+ }
+}
+
+static void dumpcfffdselect(SplineFont *sf,struct alltabs *at) {
+ int cid, k, lastfd, cnt;
+ int gid;
+
+ putc(3,at->fdselect);
+ putshort(at->fdselect,0); /* number of ranges, fill in later */
+
+ for ( k=0; k<sf->subfontcnt; ++k )
+ if ( SCWorthOutputting(sf->subfonts[k]->glyphs[0]))
+ break;
+ if ( k==sf->subfontcnt ) --k; /* If CID 0 not defined, put it in last font */
+ putshort(at->fdselect,0);
+ putc(k,at->fdselect);
+ lastfd = k;
+ cnt = 1;
+ for ( gid = 1; gid<at->gi.gcnt; ++gid ) {
+ cid = at->gi.bygid[gid];
+ for ( k=0; k<sf->subfontcnt; ++k ) {
+ if ( cid<sf->subfonts[k]->glyphcnt &&
+ SCWorthOutputting(sf->subfonts[k]->glyphs[cid]) )
+ break;
+ }
+ if ( k==sf->subfontcnt )
+ /* Doesn't map to a glyph, irrelevant */;
+ else {
+ if ( k!=lastfd ) {
+ putshort(at->fdselect,gid);
+ putc(k,at->fdselect);
+ lastfd = k;
+ ++cnt;
+ }
+ }
+ }
+ putshort(at->fdselect,gid);
+ fseek(at->fdselect,1,SEEK_SET);
+ putshort(at->fdselect,cnt);
+ fseek(at->fdselect,0,SEEK_END);
+}
+
+static void dumpcffencoding(SplineFont *sf,struct alltabs *at) {
+ int i, cnt, anydups;
+ uint32 start_pos = ftell(at->encoding);
+ SplineChar *sc;
+ EncMap *map = at->map;
+
+ putc(0,at->encoding);
+ /* I always use a format 0 encoding. ie. an array of glyph indexes */
+ putc(0xff,at->encoding); /* fixup later */
+
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
+ sf->glyphs[i]->ticked = false;
+
+ cnt = 0;
+ anydups = 0;
+ for ( i=0; i<256 && i<map->enccount; ++i ) if ( map->map[i]!=-1 && (sc=sf->glyphs[map->map[i]])!=NULL ) {
+ if ( sc->ttf_glyph>255 )
+ continue;
+ if ( sc->ticked ) {
+ ++anydups;
+ } else if ( sc->ttf_glyph>0 ) {
+ if ( cnt>=255 )
+ break;
+ putc(i,at->encoding);
+ ++cnt;
+ sc->ticked = true;
+ }
+ }
+ if ( anydups ) {
+ fseek(at->encoding,start_pos,SEEK_SET);
+ putc(0x80,at->encoding);
+ putc(cnt,at->encoding);
+ fseek(at->encoding,0,SEEK_END);
+ putc(anydups,at->encoding);
+
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
+ sf->glyphs[i]->ticked = false;
+ for ( i=0; i<256 && i<map->enccount; ++i ) if ( map->map[i]!=-1 && (sc=sf->glyphs[map->map[i]])!=NULL ) {
+ if ( sc->ttf_glyph>255 )
+ continue;
+ if ( sc->ticked ) {
+ putc(i,at->encoding);
+ putshort(at->encoding,at->gn_sid[sc->ttf_glyph]);
+ }
+ sc->ticked = true;
+ }
+ } else {
+ fseek(at->encoding,start_pos+1,SEEK_SET);
+ putc(cnt,at->encoding);
+ fseek(at->encoding,0,SEEK_END);
+ }
+ free( at->gn_sid );
+ at->gn_sid = NULL;
+}
+
+static void _dumpcffstrings(FILE *file, struct pschars *strs) {
+ int i, len, offsize;
+
+ /* First figure out the offset size */
+ len = 1;
+ for ( i=0; i<strs->next; ++i )
+ len += strs->lens[i];
+
+ /* Then output the index size and offsets */
+ putshort( file, strs->next );
+ if ( strs->next!=0 ) {
+ /* presumably offsets are unsigned. But the docs don't state this in the obvious place */
+ offsize = len<=255?1:len<=65535?2:len<=0xffffff?3:4;
+ putc(offsize,file);
+ len = 1;
+ for ( i=0; i<strs->next; ++i ) {
+ dumpoffset(file,offsize,len);
+ len += strs->lens[i];
+ }
+ dumpoffset(file,offsize,len);
+
+ /* last of all the strings */
+ for ( i=0; i<strs->next; ++i ) {
+ uint8 *pt = strs->values[i], *end = pt+strs->lens[i];
+ while ( pt<end )
+ putc( *pt++, file );
+ }
+ }
+}
+
+static FILE *dumpcffstrings(struct pschars *strs) {
+ FILE *file = tmpfile();
+ _dumpcffstrings(file,strs);
+ PSCharsFree(strs);
+return( file );
+}
+
+int SFFigureDefWidth(SplineFont *sf, int *_nomwid) {
+ uint16 *widths; uint32 *cumwid;
+ int nomwid, defwid, i, sameval=(int) 0x80000000, maxw=0, allsame=true;
+ int cnt,j;
+
+ for ( i=0; i<sf->glyphcnt; ++i )
+ if ( SCWorthOutputting(sf->glyphs[i]) ) {
+ if ( maxw<sf->glyphs[i]->width ) maxw = sf->glyphs[i]->width;
+ if ( sameval == 0x8000000 )
+ sameval = sf->glyphs[i]->width;
+ else if ( sameval!=sf->glyphs[i]->width )
+ allsame = false;
+ }
+ if ( allsame ) {
+ nomwid = defwid = sameval;
+ } else {
+ ++maxw;
+ if ( maxw>65535 ) maxw = 3*(sf->ascent+sf->descent);
+ widths = gcalloc(maxw,sizeof(uint16));
+ cumwid = gcalloc(maxw,sizeof(uint32));
+ defwid = 0; cnt=0;
+ for ( i=0; i<sf->glyphcnt; ++i )
+ if ( SCWorthOutputting(sf->glyphs[i]) &&
+ sf->glyphs[i]->width>=0 &&
+ sf->glyphs[i]->width<maxw )
+ if ( ++widths[sf->glyphs[i]->width] > cnt ) {
+ defwid = sf->glyphs[i]->width;
+ cnt = widths[defwid];
+ }
+ widths[defwid] = 0;
+ for ( i=0; i<maxw; ++i )
+ for ( j=-107; j<=107; ++j )
+ if ( i+j>=0 && i+j<maxw )
+ cumwid[i] += widths[i+j];
+ cnt = 0; nomwid = 0;
+ for ( i=0; i<maxw; ++i )
+ if ( cnt<cumwid[i] ) {
+ cnt = cumwid[i];
+ nomwid = i;
+ }
+ free(widths); free(cumwid);
+ }
+ if ( _nomwid!=NULL )
+ *_nomwid = nomwid;
+return( defwid );
+}
+
+static void ATFigureDefWidth(SplineFont *sf, struct alltabs *at, int subfont) {
+ int nomwid, defwid;
+
+ defwid = SFFigureDefWidth(sf,&nomwid);
+ if ( subfont==-1 )
+ at->defwid = defwid;
+ else
+ at->fds[subfont].defwid = defwid;
+ if ( subfont==-1 )
+ at->nomwid = nomwid;
+ else
+ at->fds[subfont].nomwid = nomwid;
+}
+
+static void dumpcffprivate(SplineFont *sf,struct alltabs *at,int subfont,
+ int subrcnt) {
+ char *pt;
+ FILE *private = subfont==-1?at->private:at->fds[subfont].private;
+ int mi,i;
+ real bluevalues[14], otherblues[10];
+ real snapcnt[12];
+ real stemsnaph[12], stemsnapv[12];
+ real stdhw[1], stdvw[1];
+ int hasblue=0, hash=0, hasv=0, bs;
+ int nomwid, defwid;
+ EncMap *map = at->map;
+ double bluescale;
+
+ /* The private dict is not in an index, so no index header. Just the data */
+
+ if ( subfont==-1 )
+ defwid = at->defwid;
+ else
+ defwid = at->fds[subfont].defwid;
+ dumpintoper(private,defwid,20); /* Default Width */
+ if ( subfont==-1 )
+ nomwid = at->nomwid;
+ else
+ nomwid = at->fds[subfont].nomwid;
+ dumpintoper(private,nomwid,21); /* Nominative Width */
+
+ bs = SplineFontIsFlexible(sf,at->gi.layer,at->gi.flags);
+ hasblue = PSDictHasEntry(sf->private,"BlueValues")!=NULL;
+ hash = PSDictHasEntry(sf->private,"StdHW")!=NULL;
+ hasv = PSDictHasEntry(sf->private,"StdVW")!=NULL;
+ ff_progress_change_stages(2+autohint_before_generate+!hasblue);
+
+ otherblues[0] = otherblues[1] = bluevalues[0] = bluevalues[1] = 0;
+ if ( !hasblue ) {
+ FindBlues(sf,at->gi.layer,bluevalues,otherblues);
+ ff_progress_next_stage();
+ }
+
+ stdhw[0] = stdvw[0] = 0;
+ if ( !hash ) {
+ FindHStems(sf,stemsnaph,snapcnt);
+ mi = -1;
+ for ( i=0; stemsnaph[i]!=0 && i<12; ++i )
+ if ( mi==-1 ) mi = i;
+ else if ( snapcnt[i]>snapcnt[mi] ) mi = i;
+ if ( mi!=-1 ) stdhw[0] = stemsnaph[mi];
+ }
+
+ if ( !hasv ) {
+ FindVStems(sf,stemsnapv,snapcnt);
+ mi = -1;
+ for ( i=0; stemsnapv[i]!=0 && i<12; ++i )
+ if ( mi==-1 ) mi = i;
+ else if ( snapcnt[i]>snapcnt[mi] ) mi = i;
+ if ( mi!=-1 ) stdvw[0] = stemsnapv[mi];
+ }
+ ff_progress_change_line1(_("Saving OpenType Font"));
+
+ if ( hasblue )
+ DumpStrArray(PSDictHasEntry(sf->private,"BlueValues"),private,6);
+ else
+ DumpDblArray(bluevalues,sizeof(bluevalues)/sizeof(bluevalues[0]),private,6);
+ if ( (pt=PSDictHasEntry(sf->private,"OtherBlues"))!=NULL )
+ DumpStrArray(pt,private,7);
+ else if ( !hasblue )
+ DumpDblArray(otherblues,sizeof(otherblues)/sizeof(otherblues[0]),private,7);
+ if ( (pt=PSDictHasEntry(sf->private,"FamilyBlues"))!=NULL )
+ DumpStrArray(pt,private,8);
+ bluescale = BlueScaleFigure(sf->private,bluevalues,otherblues);
+ if ( (pt=PSDictHasEntry(sf->private,"FamilyOtherBlues"))!=NULL )
+ DumpStrArray(pt,private,9);
+ if ( (pt=PSDictHasEntry(sf->private,"BlueScale"))!=NULL )
+ DumpStrDouble(pt,private,(12<<8)+9);
+ else if ( bluescale!=-1 )
+ dumpdbloper(private,bluescale,(12<<8)+9);
+ if ( (pt=PSDictHasEntry(sf->private,"BlueShift"))!=NULL )
+ DumpStrDouble(pt,private,(12<<8)+10);
+ else
+ dumpintoper(private,bs,(12<<8)+10);
+ if ( (pt=PSDictHasEntry(sf->private,"BlueFuzz"))!=NULL )
+ DumpStrDouble(pt,private,(12<<8)+11);
+ if ( hash ) {
+ DumpStrDouble(PSDictHasEntry(sf->private,"StdHW"),private,10);
+ if ( (pt=PSDictHasEntry(sf->private,"StemSnapH"))!=NULL )
+ DumpStrArray(pt,private,(12<<8)|12);
+ } else {
+ if ( stdhw[0]!=0 )
+ dumpdbloper(private,stdhw[0],10);
+ DumpDblArray(stemsnaph,sizeof(stemsnaph)/sizeof(stemsnaph[0]),private,(12<<8)|12);
+ }
+ if ( hasv ) {
+ DumpStrDouble(PSDictHasEntry(sf->private,"StdVW"),private,11);
+ if ( (pt=PSDictHasEntry(sf->private,"StemSnapV"))!=NULL )
+ DumpStrArray(pt,private,(12<<8)|13);
+ } else {
+ if ( stdvw[0]!=0 )
+ dumpdbloper(private,stdvw[0],11);
+ DumpDblArray(stemsnapv,sizeof(stemsnapv)/sizeof(stemsnapv[0]),private,(12<<8)|13);
+ }
+ if ( (pt=PSDictHasEntry(sf->private,"ForceBold"))!=NULL ) {
+ dumpintoper(private,*pt=='t'||*pt=='T',(12<<8)|14);
+ } else if ( sf->weight!=NULL &&
+ (strstrmatch(sf->weight,"Bold")!=NULL ||
+ strstrmatch(sf->weight,"Demi")!=NULL ||
+ strstrmatch(sf->weight,"Fett")!=NULL ||
+ strstrmatch(sf->weight,"Gras")!=NULL ||
+ strstrmatch(sf->weight,"Heavy")!=NULL ||
+ strstrmatch(sf->weight,"Black")!=NULL))
+ dumpintoper(private,1,(12<<8)|14);
+ if ( (pt=PSDictHasEntry(sf->private,"LanguageGroup"))!=NULL )
+ DumpStrDouble(pt,private,(12<<8)+17);
+ else if ( map->enc->is_japanese ||
+ map->enc->is_korean ||
+ map->enc->is_tradchinese ||
+ map->enc->is_simplechinese )
+ dumpintoper(private,1,(12<<8)|17);
+ if ( (pt=PSDictHasEntry(sf->private,"ExpansionFactor"))!=NULL )
+ DumpStrDouble(pt,private,(12<<8)+18);
+ if ( subrcnt!=0 )
+ dumpsizedint(private,false,ftell(private)+3+1,19); /* Subrs */
+
+ if ( subfont==-1 )
+ at->privatelen = ftell(private);
+ else
+ at->fds[subfont].privatelen = ftell(private);
+}
+
+/* When we exit this the topdict is not complete, we still need to fill in */
+/* values for charset,encoding,charstrings and private. Then we need to go */
+/* back and fill in the table length (at lenpos) */
+static void dumpcfftopdict(SplineFont *sf,struct alltabs *at) {
+ char *pt, *end;
+ FILE *cfff = at->cfff;
+ DBounds b;
+
+ putshort(cfff,1); /* One top dict */
+ putc('\2',cfff); /* Offset size */
+ putshort(cfff,1); /* Offset to topdict */
+ at->lenpos = ftell(cfff);
+ putshort(cfff,0); /* placeholder for final position (final offset in index points beyond last element) */
+ dumpsid(cfff,at,sf->version,0);
+ dumpsid(cfff,at,sf->copyright,1);
+ dumpsid(cfff,at,sf->fullname?sf->fullname:sf->fontname,2);
+ dumpsid(cfff,at,sf->familyname,3);
+ dumpsid(cfff,at,sf->weight,4);
+ if ( at->gi.fixed_width!=-1 ) dumpintoper(cfff,1,(12<<8)|1);
+ if ( sf->italicangle!=0 ) dumpdbloper(cfff,sf->italicangle,(12<<8)|2);
+ if ( sf->upos!=-100 ) dumpdbloper(cfff,sf->upos,(12<<8)|3);
+ if ( sf->uwidth!=50 ) dumpdbloper(cfff,sf->uwidth,(12<<8)|4);
+ if ( sf->strokedfont ) {
+ dumpintoper(cfff,2,(12<<8)|5);
+ dumpdbloper(cfff,sf->strokewidth,(12<<8)|8);
+ }
+ /* We'll never set CharstringType */
+ if ( sf->ascent+sf->descent!=1000 ) {
+ dumpdbl(cfff,1.0/(sf->ascent+sf->descent));
+ dumpint(cfff,0);
+ dumpint(cfff,0);
+ dumpdbl(cfff,1.0/(sf->ascent+sf->descent));
+ dumpint(cfff,0);
+ dumpintoper(cfff,0,(12<<8)|7);
+ }
+ if ( sf->uniqueid!=-1 && sf->use_uniqueid )
+ dumpintoper(cfff, sf->uniqueid?sf->uniqueid:4000000 + (rand()&0x3ffff), 13 );
+ SplineFontLayerFindBounds(sf,at->gi.layer,&b);
+ at->gi.xmin = b.minx;
+ at->gi.ymin = b.miny;
+ at->gi.xmax = b.maxx;
+ at->gi.ymax = b.maxy;
+ dumpdbl(cfff,floor(b.minx));
+ dumpdbl(cfff,floor(b.miny));
+ dumpdbl(cfff,ceil(b.maxx));
+ dumpdbloper(cfff,ceil(b.maxy),5);
+ /* We'll never set StrokeWidth */
+ if ( sf->xuid!=NULL && sf->use_xuid ) {
+ pt = sf->xuid; if ( *pt=='[' ) ++pt;
+ while ( *pt && *pt!=']' ) {
+ dumpint(cfff,strtol(pt,&end,10));
+ if ( pt==end ) /* garbage in XUID */
+ break;
+ for ( pt = end; *pt==' '; ++pt );
+ }
+ putc(14,cfff);
+ if ( sf->changed_since_xuidchanged )
+ SFIncrementXUID(sf);
+ }
+ /* Offset to charset (oper=15) needed here */
+ /* Offset to encoding (oper=16) needed here (not for CID )*/
+ /* Offset to charstrings (oper=17) needed here */
+ /* Length of, and Offset to private (oper=18) needed here (not for CID )*/
+}
+
+static int dumpcffdict(SplineFont *sf,struct alltabs *at) {
+ FILE *fdarray = at->fdarray;
+ int pstart;
+ /* according to the PSRef Man v3, only fontname, fontmatrix and private */
+ /* appear in this dictionary */
+
+ dumpsid(fdarray,at,sf->fontname,(12<<8)|38);
+ if ( sf->ascent+sf->descent!=1000 ) {
+ dumpdbl(fdarray,1.0/(sf->ascent+sf->descent));
+ dumpint(fdarray,0);
+ dumpint(fdarray,0);
+ dumpdbl(fdarray,1.0/(sf->ascent+sf->descent));
+ dumpint(fdarray,0);
+ dumpintoper(fdarray,0,(12<<8)|7);
+ }
+ pstart = ftell(fdarray);
+ dumpsizedint(fdarray,false,0,-1); /* private length */
+ dumpsizedint(fdarray,true,0,18); /* private offset */
+return( pstart );
+}
+
+static void dumpcffdictindex(SplineFont *sf,struct alltabs *at) {
+ int i;
+ int pos;
+
+ putshort(at->fdarray,sf->subfontcnt);
+ putc('\2',at->fdarray); /* DICTs aren't very big, and there are at most 255 */
+ putshort(at->fdarray,1); /* Offset to first dict */
+ for ( i=0; i<sf->subfontcnt; ++i )
+ putshort(at->fdarray,0); /* Dump offset placeholders (note there's one extra to mark the end) */
+ pos = ftell(at->fdarray)-1;
+ for ( i=0; i<sf->subfontcnt; ++i ) {
+ at->fds[i].fillindictmark = dumpcffdict(sf->subfonts[i],at);
+ at->fds[i].eodictmark = ftell(at->fdarray);
+ if ( at->fds[i].eodictmark>65536 )
+ IError("The DICT INDEX got too big, result won't work");
+ }
+ fseek(at->fdarray,2*sizeof(short)+sizeof(char),SEEK_SET);
+ for ( i=0; i<sf->subfontcnt; ++i )
+ putshort(at->fdarray,at->fds[i].eodictmark-pos);
+ fseek(at->fdarray,0,SEEK_END);
+}
+
+static void dumpcffcidtopdict(SplineFont *sf,struct alltabs *at) {
+ char *pt, *end;
+ FILE *cfff = at->cfff;
+ DBounds b;
+ int cidcnt=0, k;
+
+ for ( k=0; k<sf->subfontcnt; ++k )
+ if ( sf->subfonts[k]->glyphcnt>cidcnt ) cidcnt = sf->subfonts[k]->glyphcnt;
+
+ putshort(cfff,1); /* One top dict */
+ putc('\2',cfff); /* Offset size */
+ putshort(cfff,1); /* Offset to topdict */
+ at->lenpos = ftell(cfff);
+ putshort(cfff,0); /* placeholder for final position */
+ dumpsid(cfff,at,sf->cidregistry,-1);
+ dumpsid(cfff,at,sf->ordering,-1);
+ dumpintoper(cfff,sf->supplement,(12<<8)|30); /* ROS operator must be first */
+ dumpdbloper(cfff,sf->cidversion,(12<<8)|31);
+ dumpintoper(cfff,cidcnt,(12<<8)|34);
+ if ( sf->use_uniqueid )
+ dumpintoper(cfff, sf->uniqueid?sf->uniqueid:4000000 + (rand()&0x3ffff), (12<<8)|35 );
+
+ dumpsid(cfff,at,sf->copyright,1);
+ dumpsid(cfff,at,sf->fullname?sf->fullname:sf->fontname,2);
+ dumpsid(cfff,at,sf->familyname,3);
+ dumpsid(cfff,at,sf->weight,4);
+ /* FontMatrix (identity here, real ones in sub fonts)*/
+ /* Actually there is no fontmatrix in the adobe cid font I'm looking at */
+ /* which means it should default to [.001...] but it doesn't so the */
+ /* docs aren't completely accurate */
+ /* I now see I've no idea what the FontMatrix means in a CID keyed font */
+ /* it seems to be ignored everywhere */
+#if 0
+ dumpdbl(cfff,1.0);
+ dumpint(cfff,0);
+ dumpint(cfff,0);
+ dumpdbl(cfff,1.0);
+ dumpint(cfff,0);
+ dumpintoper(cfff,0,(12<<8)|7);
+#endif
+
+ CIDLayerFindBounds(sf,at->gi.layer,&b);
+ at->gi.xmin = b.minx;
+ at->gi.ymin = b.miny;
+ at->gi.xmax = b.maxx;
+ at->gi.ymax = b.maxy;
+ dumpdbl(cfff,floor(b.minx));
+ dumpdbl(cfff,floor(b.miny));
+ dumpdbl(cfff,ceil(b.maxx));
+ dumpdbloper(cfff,ceil(b.maxy),5);
+ /* We'll never set StrokeWidth */
+ if ( sf->xuid!=NULL && sf->use_xuid ) {
+ pt = sf->xuid; if ( *pt=='[' ) ++pt;
+ while ( *pt && *pt!=']' ) {
+ dumpint(cfff,strtol(pt,&end,10));
+ for ( pt = end; *pt==' '; ++pt );
+ }
+ putc(14,cfff);
+ if ( sf->changed_since_xuidchanged )
+ SFIncrementXUID(sf);
+ }
+#if 0
+ /* Acrobat doesn't seem to care about a private dict here. Ghostscript */
+ /* dies. Tech Note: 5176.CFF.PDF, top of page 23 says: */
+ /* A Private DICT is required, but may be specified as having */
+ /* a length of 0 if there are no non-default values to be stored*/
+ /* No indication >where< it is required. I assumed everywhere. Perhaps */
+ /* just in basefonts? */
+ dumpint(cfff,0); /* Docs say a private dict is required and they don't specifically omit CID top dicts */
+ dumpintoper(cfff,0,18); /* But they do say it can be zero */
+#endif
+ /* Offset to charset (oper=15) needed here */
+ /* Offset to charstrings (oper=17) needed here */
+ /* Offset to FDArray (oper=12,36) needed here */
+ /* Offset to FDSelect (oper=12,37) needed here */
+}
+
+static int isStdEncoding(SplineFont *sf,EncMap *map) {
+ int i;
+
+ for ( i=0; i<256 && i<map->enccount; ++i ) if ( map->map[i]!=-1 && sf->glyphs[map->map[i]]!=NULL )
+ if ( sf->glyphs[map->map[i]]->unicodeenc!=-1 )
+ if ( sf->glyphs[map->map[i]]->unicodeenc!=unicode_from_adobestd[i] )
+return( 0 );
+
+return( 1 );
+}
+
+static void finishup(SplineFont *sf,struct alltabs *at) {
+ int strlen, shlen, glen,enclen,csetlen,cstrlen,prvlen;
+ int base, eotop, strhead;
+ int output_enc = ( at->format==ff_cff && !isStdEncoding(sf,at->map));
+
+ storesid(at,NULL); /* end the strings index */
+ strlen = ftell(at->sidf) + (shlen = ftell(at->sidh));
+ glen = sizeof(short); /* Single entry: 0, no globals */
+ enclen = ftell(at->encoding);
+ csetlen = ftell(at->charset);
+ cstrlen = ftell(at->charstrings);
+ prvlen = ftell(at->private);
+ base = ftell(at->cfff);
+ if ( base+6*3+strlen+glen+enclen+csetlen+cstrlen+prvlen > 32767 ) {
+ at->cfflongoffset = true;
+ base += 5*5+4;
+ } else
+ base += 5*3+4;
+ strhead = 2+(at->sidcnt>1);
+ base += strhead;
+
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen,15); /* Charset */
+ if ( output_enc ) /* encoding offset */
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen,16); /* encoding offset */
+ else {
+ dumpsizedint(at->cfff,at->cfflongoffset,0,16);
+ enclen = 0;
+ }
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+enclen,17);/* charstrings */
+ dumpsizedint(at->cfff,at->cfflongoffset,at->privatelen,-1);
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+enclen+cstrlen,18); /* private size */
+ eotop = base-strhead-at->lenpos-1;
+ if ( at->cfflongoffset ) {
+ fseek(at->cfff,3,SEEK_SET);
+ putc(4,at->cfff);
+ }
+ fseek(at->cfff,at->lenpos,SEEK_SET);
+ putshort(at->cfff,eotop);
+ fseek(at->cfff,0,SEEK_END);
+
+ /* String Index */
+ putshort(at->cfff,at->sidcnt-1);
+ if ( at->sidcnt!=1 ) { /* Everybody gets an added NULL */
+ putc(at->sidlongoffset?4:2,at->cfff);
+ if ( !ttfcopyfile(at->cfff,at->sidh,base,"CFF-StringBase")) at->error = true;
+ if ( !ttfcopyfile(at->cfff,at->sidf,base+shlen,"CFF-StringData")) at->error = true;
+ }
+
+ /* Global Subrs */
+ putshort(at->cfff,0);
+
+ /* Charset */
+ if ( !ttfcopyfile(at->cfff,at->charset,base+strlen+glen,"CFF-Charset")) at->error = true;
+
+ /* Encoding */
+ if ( !ttfcopyfile(at->cfff,at->encoding,base+strlen+glen+csetlen,"CFF-Encoding")) at->error = true;
+
+ /* Char Strings */
+ if ( !ttfcopyfile(at->cfff,at->charstrings,base+strlen+glen+csetlen+enclen,"CFF-CharStrings")) at->error = true;
+
+ /* Private & Subrs */
+ if ( !ttfcopyfile(at->cfff,at->private,base+strlen+glen+csetlen+enclen+cstrlen,"CFF-Private")) at->error = true;
+}
+
+static void finishupcid(SplineFont *sf,struct alltabs *at) {
+ int strlen, shlen, glen,csetlen,cstrlen,fdsellen,fdarrlen,prvlen;
+ int base, eotop, strhead;
+ int i;
+
+ storesid(at,NULL); /* end the strings index */
+ strlen = ftell(at->sidf) + (shlen = ftell(at->sidh));
+ glen = ftell(at->globalsubrs);
+ /* No encodings */
+ csetlen = ftell(at->charset);
+ fdsellen = ftell(at->fdselect);
+ cstrlen = ftell(at->charstrings);
+ fdarrlen = ftell(at->fdarray);
+ base = ftell(at->cfff);
+
+ at->cfflongoffset = true;
+ base += 5*4+4+2; /* two of the opers below are two byte opers */
+ strhead = 2+(at->sidcnt>1);
+ base += strhead;
+
+ prvlen = 0;
+ for ( i=0; i<sf->subfontcnt; ++i ) {
+ fseek(at->fdarray,at->fds[i].fillindictmark,SEEK_SET);
+ dumpsizedint(at->fdarray,false,at->fds[i].privatelen,-1); /* Private len */
+ dumpsizedint(at->fdarray,true,base+strlen+glen+csetlen+fdsellen+cstrlen+fdarrlen+prvlen,18); /* Private offset */
+ prvlen += ftell(at->fds[i].private); /* private & subrs */
+ }
+
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen,15); /* charset */
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen,(12<<8)|37); /* fdselect */
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+fdsellen,17); /* charstrings */
+ dumpsizedint(at->cfff,at->cfflongoffset,base+strlen+glen+csetlen+fdsellen+cstrlen,(12<<8)|36); /* fdarray */
+ eotop = base-strhead-at->lenpos-1;
+ fseek(at->cfff,at->lenpos,SEEK_SET);
+ putshort(at->cfff,eotop);
+ fseek(at->cfff,0,SEEK_END);
+
+ /* String Index */
+ putshort(at->cfff,at->sidcnt-1);
+ if ( at->sidcnt!=1 ) { /* Everybody gets an added NULL */
+ putc(at->sidlongoffset?4:2,at->cfff);
+ if ( !ttfcopyfile(at->cfff,at->sidh,base,"CFF-StringBase")) at->error = true;
+ if ( !ttfcopyfile(at->cfff,at->sidf,base+shlen,"CFF-StringData")) at->error = true;
+ }
+
+ /* Global Subrs */
+ if ( !ttfcopyfile(at->cfff,at->globalsubrs,base+strlen,"CFF-GlobalSubrs")) at->error = true;
+
+ /* Charset */
+ if ( !ttfcopyfile(at->cfff,at->charset,base+strlen+glen,"CFF-Charset")) at->error = true;
+
+ /* FDSelect */
+ if ( !ttfcopyfile(at->cfff,at->fdselect,base+strlen+glen+csetlen,"CFF-FDSelect")) at->error = true;
+
+ /* Char Strings */
+ if ( !ttfcopyfile(at->cfff,at->charstrings,base+strlen+glen+csetlen+fdsellen,"CFF-CharStrings")) at->error = true;
+
+ /* FDArray (DICT Index) */
+ if ( !ttfcopyfile(at->cfff,at->fdarray,base+strlen+glen+csetlen+fdsellen+cstrlen,"CFF-FDArray")) at->error = true;
+
+ /* Private & Subrs */
+ prvlen = 0;
+ for ( i=0; i<sf->subfontcnt; ++i ) {
+ int temp = ftell(at->fds[i].private);
+ if ( !ttfcopyfile(at->cfff,at->fds[i].private,
+ base+strlen+glen+csetlen+fdsellen+cstrlen+fdarrlen+prvlen,"CFF-PrivateSubrs")) at->error = true;
+ prvlen += temp;
+ }
+
+ free(at->fds);
+}
+
+static int dumpcffhmtx(struct alltabs *at,SplineFont *sf,int bitmaps) {
+ DBounds b;
+ SplineChar *sc;
+ int i,cnt;
+ int dovmetrics = sf->hasvmetrics;
+ int width = at->gi.fixed_width;
+
+ at->gi.hmtx = tmpfile();
+ if ( dovmetrics )
+ at->gi.vmtx = tmpfile();
+ FigureFullMetricsEnd(sf,&at->gi,bitmaps); /* Bitmap fonts use ttf convention of 3 magic glyphs */
+ if ( at->gi.bygid[0]!=-1 && (sf->glyphs[at->gi.bygid[0]]->width==width || width==-1 )) {
+ putshort(at->gi.hmtx,sf->glyphs[at->gi.bygid[0]]->width);
+ SplineCharLayerFindBounds(sf->glyphs[at->gi.bygid[0]],at->gi.layer,&b);
+ putshort(at->gi.hmtx,b.minx);
+ if ( dovmetrics ) {
+ putshort(at->gi.vmtx,sf->glyphs[at->gi.bygid[0]]->vwidth);
+ putshort(at->gi.vmtx,/*sf->vertical_origin-*/b.miny);
+ }
+ } else {
+ putshort(at->gi.hmtx,width==-1?(sf->ascent+sf->descent)/2:width);
+ putshort(at->gi.hmtx,0);
+ if ( dovmetrics ) {
+ putshort(at->gi.vmtx,sf->ascent+sf->descent);
+ putshort(at->gi.vmtx,0);
+ }
+ }
+ cnt = 1;
+ if ( bitmaps ) {
+ if ( width==-1 ) width = (sf->ascent+sf->descent)/3;
+ putshort(at->gi.hmtx,width);
+ putshort(at->gi.hmtx,0);
+ if ( dovmetrics ) {
+ putshort(at->gi.vmtx,sf->ascent+sf->descent);
+ putshort(at->gi.vmtx,0);
+ }
+ putshort(at->gi.hmtx,width);
+ putshort(at->gi.hmtx,0);
+ if ( dovmetrics ) {
+ putshort(at->gi.vmtx,sf->ascent+sf->descent);
+ putshort(at->gi.vmtx,0);
+ }
+ cnt = 3;
+ }
+
+ for ( i=cnt; i<at->gi.gcnt; ++i ) if ( at->gi.bygid[i]!=-1 ) {
+ sc = sf->glyphs[at->gi.bygid[i]];
+ if ( SCWorthOutputting(sc) ) {
+ if ( i<=at->gi.lasthwidth )
+ putshort(at->gi.hmtx,sc->width);
+ SplineCharLayerFindBounds(sc,at->gi.layer,&b);
+ putshort(at->gi.hmtx,b.minx);
+ if ( dovmetrics ) {
+ if ( i<=at->gi.lastvwidth )
+ putshort(at->gi.vmtx,sc->vwidth);
+ putshort(at->gi.vmtx,/*sf->vertical_origin-*/b.maxy);
+ }
+ ++cnt;
+ if ( i==at->gi.lasthwidth )
+ at->gi.hfullcnt = cnt;
+ if ( i==at->gi.lastvwidth )
+ at->gi.vfullcnt = cnt;
+ }
+ }
+ at->gi.hmtxlen = ftell(at->gi.hmtx);
+ if ( at->gi.hmtxlen&2 ) putshort(at->gi.hmtx,0);
+ if ( dovmetrics ) {
+ at->gi.vmtxlen = ftell(at->gi.vmtx);
+ if ( at->gi.vmtxlen&2 ) putshort(at->gi.vmtx,0);
+ }
+
+ at->gi.maxp->numGlyphs = cnt;
+return( true );
+}
+
+static void dumpcffcidhmtx(struct alltabs *at,SplineFont *_sf) {
+ DBounds b;
+ SplineChar *sc;
+ int cid,i,cnt=0,max;
+ SplineFont *sf = NULL;
+ int dovmetrics = _sf->hasvmetrics;
+
+ at->gi.hmtx = tmpfile();
+ if ( dovmetrics )
+ at->gi.vmtx = tmpfile();
+ FigureFullMetricsEnd(_sf,&at->gi,false);
+
+ max = 0;
+ for ( i=0; i<_sf->subfontcnt; ++i )
+ if ( max<_sf->subfonts[i]->glyphcnt )
+ max = _sf->subfonts[i]->glyphcnt;
+ for ( cid = 0; cid<max; ++cid ) {
+ for ( i=0; i<_sf->subfontcnt; ++i ) {
+ sf = _sf->subfonts[i];
+ if ( cid<sf->glyphcnt && SCWorthOutputting(sf->glyphs[cid]))
+ break;
+ }
+ if ( i!=_sf->subfontcnt ) {
+ sc = sf->glyphs[cid];
+ if ( sc->ttf_glyph<=at->gi.lasthwidth )
+ putshort(at->gi.hmtx,sc->width);
+ SplineCharLayerFindBounds(sc,at->gi.layer,&b);
+ putshort(at->gi.hmtx,b.minx);
+ if ( dovmetrics ) {
+ if ( sc->ttf_glyph<=at->gi.lastvwidth )
+ putshort(at->gi.vmtx,sc->vwidth);
+ putshort(at->gi.vmtx,/*sf->vertical_origin-*/b.maxy);
+ }
+ ++cnt;
+ if ( sc->ttf_glyph==at->gi.lasthwidth )
+ at->gi.hfullcnt = cnt;
+ if ( sc->ttf_glyph==at->gi.lastvwidth )
+ at->gi.vfullcnt = cnt;
+ } else if ( cid==0 ) {
+ /* Create a dummy entry for .notdef */
+ sf = _sf->subfonts[0];
+ putshort(at->gi.hmtx,sf->ascent+sf->descent);
+ putshort(at->gi.hmtx,0);
+ ++cnt;
+ if ( dovmetrics ) {
+ putshort(at->gi.vmtx,sf->ascent+sf->descent);
+ putshort(at->gi.vmtx,0);
+ }
+ }
+ }
+ at->gi.hmtxlen = ftell(at->gi.hmtx);
+ if ( at->gi.hmtxlen&2 ) putshort(at->gi.hmtx,0);
+ if ( dovmetrics ) {
+ at->gi.vmtxlen = ftell(at->gi.vmtx);
+ if ( at->gi.vmtxlen&2 ) putshort(at->gi.vmtx,0);
+ }
+
+ at->gi.maxp->numGlyphs = cnt;
+}
+
+static int dumptype2glyphs(SplineFont *sf,struct alltabs *at) {
+ int i;
+ struct pschars *subrs, *chrs;
+
+ at->cfff = tmpfile();
+ at->sidf = tmpfile();
+ at->sidh = tmpfile();
+ at->charset = tmpfile();
+ at->encoding = tmpfile();
+ at->private = tmpfile();
+
+ dumpcffheader(sf,at->cfff);
+ dumpcffnames(sf,at->cfff);
+ dumpcffcharset(sf,at);
+ ff_progress_change_stages(2+at->gi.strikecnt);
+
+ ATFigureDefWidth(sf,at,-1);
+ if ((chrs =SplineFont2ChrsSubrs2(sf,at->nomwid,at->defwid,at->gi.bygid,at->gi.gcnt,at->gi.flags,&subrs,at->gi.layer))==NULL )
+return( false );
+ dumpcffprivate(sf,at,-1,subrs->next);
+ if ( subrs->next!=0 )
+ _dumpcffstrings(at->private,subrs);
+ ff_progress_next_stage();
+ at->charstrings = dumpcffstrings(chrs);
+ PSCharsFree(subrs);
+ if ( at->charstrings == NULL )
+return( false );
+ if ( at->format==ff_cff && !isStdEncoding(sf,at->map))
+ dumpcffencoding(sf,at); /* Do this after we've assigned glyph ids */
+ dumpcfftopdict(sf,at);
+ finishup(sf,at);
+
+ at->cfflen = ftell(at->cfff);
+ if ( at->cfflen&3 ) {
+ for ( i=4-(at->cfflen&3); i>0; --i )
+ putc('\0',at->cfff);
+ }
+
+ if ( at->format!=ff_cff )
+ dumpcffhmtx(at,sf,false);
+ free(at->gn_sid); at->gn_sid=NULL;
+return( true );
+}
+
+static int dumpcidglyphs(SplineFont *sf,struct alltabs *at) {
+ int i;
+ struct pschars *glbls = NULL, *chrs;
+
+ at->cfff = tmpfile();
+ at->sidf = tmpfile();
+ at->sidh = tmpfile();
+ at->charset = tmpfile();
+ at->fdselect = tmpfile();
+ at->fdarray = tmpfile();
+ at->globalsubrs = tmpfile();
+
+ at->fds = gcalloc(sf->subfontcnt,sizeof(struct fd2data));
+ for ( i=0; i<sf->subfontcnt; ++i ) {
+ at->fds[i].private = tmpfile();
+ ATFigureDefWidth(sf->subfonts[i],at,i);
+ }
+ if ( (chrs = CID2ChrsSubrs2(sf,at->fds,at->gi.flags,&glbls,at->gi.layer))==NULL )
+return( false );
+ for ( i=0; i<sf->subfontcnt; ++i ) {
+ dumpcffprivate(sf->subfonts[i],at,i,at->fds[i].subrs->next);
+ if ( at->fds[i].subrs->next!=0 )
+ _dumpcffstrings(at->fds[i].private,at->fds[i].subrs);
+ PSCharsFree(at->fds[i].subrs);
+ }
+ _dumpcffstrings(at->globalsubrs,glbls);
+ PSCharsFree(glbls);
+
+ dumpcffheader(sf,at->cfff);
+ dumpcffnames(sf,at->cfff);
+ dumpcffcidset(sf,at);
+ dumpcfffdselect(sf,at);
+ dumpcffdictindex(sf,at);
+ if ( (at->charstrings = dumpcffstrings(chrs))==NULL )
+return( false );
+ dumpcffcidtopdict(sf,at);
+ finishupcid(sf,at);
+
+ at->cfflen = ftell(at->cfff);
+ if ( at->cfflen&3 ) {
+ for ( i=4-(at->cfflen&3); i>0; --i )
+ putc('\0',at->cfff);
+ }
+
+ if ( at->format!=ff_cffcid )
+ dumpcffcidhmtx(at,sf);
+return( true );
+}
+
+
+
+static void OS2WeightCheck(struct pfminfo *pfminfo,char *weight) {
+ if ( weight==NULL ) {
+ /* default it */
+ } else if ( strstrmatch(weight,"medi")!=NULL ) {
+ pfminfo->weight = 500;
+ pfminfo->panose[2] = 6;
+ } else if ( strstrmatch(weight,"demi")!=NULL ||
+ strstrmatch(weight,"halb")!=NULL ||
+ (strstrmatch(weight,"semi")!=NULL &&
+ strstrmatch(weight,"bold")!=NULL) ) {
+ pfminfo->weight = 600;
+ pfminfo->panose[2] = 7;
+ } else if ( strstrmatch(weight,"bold")!=NULL ||
+ strstrmatch(weight,"fett")!=NULL ||
+ strstrmatch(weight,"gras")!=NULL ) {
+ pfminfo->weight = 700;
+ pfminfo->panose[2] = 8;
+ } else if ( strstrmatch(weight,"heavy")!=NULL ) {
+ pfminfo->weight = 800;
+ pfminfo->panose[2] = 9;
+ } else if ( strstrmatch(weight,"black")!=NULL ) {
+ pfminfo->weight = 900;
+ pfminfo->panose[2] = 10;
+ } else if ( strstrmatch(weight,"nord")!=NULL ) {
+ pfminfo->weight = 950;
+ pfminfo->panose[2] = 11;
+ } else if ( strstrmatch(weight,"thin")!=NULL ) {
+ pfminfo->weight = 100;
+ pfminfo->panose[2] = 2;
+ } else if ( strstrmatch(weight,"extra")!=NULL ||
+ strstrmatch(weight,"light")!=NULL ) {
+ pfminfo->weight = 200;
+ pfminfo->panose[2] = 3;
+ } else if ( strstrmatch(weight,"light")!=NULL ) {
+ pfminfo->weight = 300;
+ pfminfo->panose[2] = 4;
+ }
+}
+
+void SFDefaultOS2Simple(struct pfminfo *pfminfo,SplineFont *sf) {
+ pfminfo->pfmfamily = 0x11;
+ pfminfo->panose[0] = 2;
+ pfminfo->weight = 400;
+ pfminfo->panose[2] = 5;
+ pfminfo->width = 5;
+ pfminfo->panose[3] = 3;
+ pfminfo->winascent_add = pfminfo->windescent_add = true;
+ pfminfo->hheadascent_add = pfminfo->hheaddescent_add = true;
+ pfminfo->typoascent_add = pfminfo->typodescent_add = true;
+ pfminfo->os2_winascent = pfminfo->os2_windescent = 0;
+
+ if ( sf->subfonts!=NULL ) sf = sf->subfonts[0];
+ pfminfo->linegap = pfminfo->vlinegap = pfminfo->os2_typolinegap =
+ rint(.09*(sf->ascent+sf->descent));
+}
+
+void SFDefaultOS2SubSuper(struct pfminfo *pfminfo,int emsize,double italic_angle) {
+ double s = sin(italic_angle*3.1415926535897932/180.0);
+ pfminfo->os2_supysize = pfminfo->os2_subysize = .7*emsize;
+ pfminfo->os2_supxsize = pfminfo->os2_subxsize = .65*emsize;
+ pfminfo->os2_subyoff = .14*emsize;
+ pfminfo->os2_supyoff = .48*emsize;
+ pfminfo->os2_supxoff = s*pfminfo->os2_supyoff;
+ pfminfo->os2_subxoff = -s*pfminfo->os2_subyoff;
+ pfminfo->os2_strikeysize = 102*emsize/2048;
+ pfminfo->os2_strikeypos = 530*emsize/2048;
+}
+
+void SFDefaultOS2Info(struct pfminfo *pfminfo,SplineFont *sf,char *fontname) {
+ int samewid= -1;
+ char *weight = sf->cidmaster==NULL ? sf->weight : sf->cidmaster->weight;
+
+ if ( sf->pfminfo.pfmset ) {
+ if ( pfminfo!=&sf->pfminfo )
+ *pfminfo = sf->pfminfo;
+ if ( !pfminfo->panose_set ) {
+ struct pfminfo info;
+ memset(&info,0,sizeof(info));
+ sf->pfminfo.pfmset = false;
+ SFDefaultOS2Info(&info,sf,fontname);
+ sf->pfminfo.pfmset = true;
+ memcpy(pfminfo->panose,info.panose,sizeof(info.panose));
+ }
+ } else {
+ struct pfminfo hold;
+ if ( pfminfo->hheadset || pfminfo->vheadset )
+ hold = *pfminfo;
+ else
+ hold.hheadset = hold.vheadset = false;
+ memset(pfminfo,'\0',sizeof(*pfminfo));
+ SFDefaultOS2Simple(pfminfo,sf);
+ samewid = CIDOneWidth(sf);
+
+ pfminfo->pfmfamily = 0x10;
+ if ( samewid>0 ) {
+ pfminfo->pfmfamily = 0x30;
+ /* pfminfo->panose[3] = 9; */ /* This is done later */
+ } else if ( strstrmatch(fontname,"sans")!=NULL )
+ pfminfo->pfmfamily = 0x20;
+ else if ( strstrmatch(fontname,"script")!=NULL ) {
+ pfminfo->pfmfamily = 0x40;
+ pfminfo->panose[0] = 3;
+ }
+ if ( samewid==-1 )
+ pfminfo->pfmfamily |= 0x1; /* Else it assumes monospace */
+
+/* urw uses 4 character abreviations */
+ if ( weight!=NULL )
+ OS2WeightCheck(pfminfo,weight);
+ OS2WeightCheck(pfminfo,fontname);
+
+ if ( strstrmatch(fontname,"ultra")!=NULL &&
+ strstrmatch(fontname,"condensed")!=NULL ) {
+ pfminfo->width = 1;
+ pfminfo->panose[3] = 8;
+ } else if ( strstrmatch(fontname,"extra")!=NULL &&
+ strstrmatch(fontname,"condensed")!=NULL ) {
+ pfminfo->width = 2;
+ pfminfo->panose[3] = 8;
+ } else if ( strstrmatch(fontname,"semi")!=NULL &&
+ strstrmatch(fontname,"condensed")!=NULL ) {
+ pfminfo->width = 4;
+ pfminfo->panose[3] = 6;
+ } else if ( strstrmatch(fontname,"condensed")!=NULL ||
+ strstrmatch(fontname,"narrow")!=NULL ) {
+ pfminfo->width = 3;
+ pfminfo->panose[3] = 6;
+ } else if ( strstrmatch(fontname,"ultra")!=NULL &&
+ strstrmatch(fontname,"expanded")!=NULL ) {
+ pfminfo->width = 9;
+ pfminfo->panose[3] = 7;
+ } else if ( strstrmatch(fontname,"extra")!=NULL &&
+ strstrmatch(fontname,"expanded")!=NULL ) {
+ pfminfo->width = 8;
+ pfminfo->panose[3] = 7;
+ } else if ( strstrmatch(fontname,"semi")!=NULL &&
+ strstrmatch(fontname,"expanded")!=NULL ) {
+ pfminfo->width = 6;
+ pfminfo->panose[3] = 5;
+ } else if ( strstrmatch(fontname,"expanded")!=NULL ) {
+ pfminfo->width = 7;
+ pfminfo->panose[3] = 5;
+ }
+ if ( samewid>0 )
+ pfminfo->panose[3] = 9;
+ if ( hold.hheadset ) {
+ pfminfo->hheadset = true;
+ pfminfo->hheadascent_add = hold.hheadascent_add;
+ pfminfo->hheaddescent_add = hold.hheaddescent_add;
+ pfminfo->hhead_ascent = hold.hhead_ascent;
+ pfminfo->hhead_descent = hold.hhead_descent;
+ pfminfo->linegap = hold.linegap;
+ }
+ if ( hold.vheadset ) {
+ pfminfo->vheadset = true;
+ pfminfo->vlinegap = hold.vlinegap;
+ }
+ }
+ if ( !pfminfo->subsuper_set )
+ SFDefaultOS2SubSuper(pfminfo,sf->ascent+sf->descent,sf->italicangle);
+}
+
+char *utf8_verify_copy(const char *str) {
+ /* When given a postscript string it SHOULD be in ASCII. But it will often*/
+ /* contain a copyright symbol (sometimes in latin1, sometimes in macroman)*/
+ /* unfortunately both encodings use 0xa9 for copyright so we can't distinguish */
+ /* guess that it's latin1 (or that copyright is the only odd char which */
+ /* means a latin1 conversion will work for macs too). */
+
+ if ( str==NULL )
+return( NULL );
+
+ if ( utf8_valid(str))
+return( copy(str)); /* Either in ASCII (good) or appears to be utf8*/
+return( latin1_2_utf8_copy(str));
+}
+
+int SFHasInstructions(SplineFont *sf) {
+ int i;
+
+ if ( sf->mm!=NULL && sf->mm->apple )
+ sf = sf->mm->normal;
+
+ if ( sf->subfontcnt!=0 )
+return( false ); /* Truetype doesn't support cid keyed fonts */
+
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL ) {
+ if ( strcmp(sf->glyphs[i]->name,".notdef")==0 )
+ continue; /* ff produces fonts with instructions in .notdef & not elsewhere. Ignore these */
+ if ( sf->glyphs[i]->ttf_instrs!=NULL )
+return( true );
+ }
+return( false );
+}
+
+static int dumpcff(struct alltabs *at,SplineFont *sf,enum fontformat format,
+ FILE *cff) {
+ int ret;
+
+ if ( format==ff_cff ) {
+ AssignTTFGlyph(&at->gi,sf,at->map,true);
+ ret = dumptype2glyphs(sf,at);
+ } else {
+ SFDummyUpCIDs(&at->gi,sf); /* life is easier if we ignore the seperate fonts of a cid keyed fonts and treat it as flat */
+ ret = dumpcidglyphs(sf,at);
+ free(sf->glyphs); sf->glyphs = NULL;
+ sf->glyphcnt = sf->glyphmax = 0;
+ }
+ free( at->gi.bygid );
+
+ if ( !ret )
+ at->error = true;
+ else if ( at->gi.flags & ps_flag_nocffsugar ) {
+ if ( !ttfcopyfile(cff,at->cfff,0,"CFF"))
+ at->error = true;
+ } else {
+ long len;
+ char buffer[80];
+ fprintf(cff,"%%!PS-Adobe-3.0 Resource-FontSet\n");
+ fprintf(cff,"%%%%DocumentNeedResources:ProcSet (FontSetInit)\n");
+ fprintf(cff,"%%%%Title: (FontSet/%s)\n", sf->fontname);
+ fprintf(cff,"%%%%EndComments\n" );
+ fprintf(cff,"%%%%IncludeResource: ProcSet(FontSetInit)\n" );
+ fprintf(cff,"%%%%BeginResource: FontSet(%s)\n", sf->fontname );
+ fprintf(cff,"/FontSetInit /ProcSet findresource begin\n" );
+ fseek(at->cfff,0,SEEK_END);
+ len = ftell(at->cfff);
+ rewind(at->cfff);
+ sprintf( buffer, "/%s %ld StartData\n", sf->fontname, len );
+ fprintf(cff,"%%%%BeginData: %ld Binary Bytes\n", (long) (len+strlen(buffer)) );
+ fputs(buffer,cff);
+ if ( !ttfcopyfile(cff,at->cfff,ftell(cff),"CFF"))
+ at->error = true;
+ fprintf(cff,"\n%%%%EndData\n" );
+ fprintf(cff,"%%%%EndResource\n" );
+ fprintf(cff,"%%%%EOF\n" );
+ }
+return( !at->error );
+}
+
+int _WriteTTFFont(FILE *ttf,SplineFont *sf,enum fontformat format,
+ int32 *bsizes, enum bitmapformat bf,int flags,EncMap *map, int layer) {
+ struct alltabs at;
+ char *oldloc;
+ int i, anyglyphs;
+
+ oldloc = setlocale(LC_NUMERIC,"C"); /* TrueType probably doesn't need this, but OpenType does for floats in dictionaries */
+ if ( format==ff_otfcid || format== ff_cffcid ) {
+ if ( sf->cidmaster ) sf = sf->cidmaster;
+ } else {
+ if ( sf->subfontcnt!=0 ) sf = sf->subfonts[0];
+ }
+
+ if ( sf->subfontcnt==0 ) {
+ anyglyphs = false;
+ for ( i=sf->glyphcnt-1; i>0 ; --i ) {
+ if ( SCWorthOutputting(sf->glyphs[i])) {
+ anyglyphs = true;
+ if ( sf->glyphs[i]->unicodeenc!=-1 )
+ break;
+ }
+ }
+ if ( !anyglyphs && !sf->internal_temp ) {
+ ff_post_error(_("No Encoded Glyphs"),_("Warning: Font contained no glyphs"));
+ }
+ if ( format!=ff_ttfsym && !(flags&ttf_flag_symbol) && !sf->internal_temp ) {
+ if ( i==0 && anyglyphs ) {
+ if ( map->enccount<=256 ) {
+ char *buts[3];
+ buts[0] = _("_Yes"); buts[1] = _("_No"); buts[2] = NULL;
+ if ( ff_ask(_("No Encoded Glyphs"),(const char **) buts,0,1,_("This font contains no glyphs with unicode encodings.\nWould you like to use a \"Symbol\" encoding instead of Unicode?"))==0 )
+ flags |= ttf_flag_symbol;
+ } else
+ ff_post_error(_("No Encoded Glyphs"),_("This font contains no glyphs with unicode encodings.\nYou will probably not be able to use the output."));
+ }
+ }
+ }
+
+ for ( i=0; i<sf->glyphcnt; ++i ) if ( sf->glyphs[i]!=NULL )
+ sf->glyphs[i]->ttf_glyph = -1;
+
+ memset(&at,'\0',sizeof(struct alltabs));
+ at.gi.flags = flags;
+ at.gi.layer = layer;
+ at.gi.is_ttf = false;
+ at.applemode = 0;
+ at.opentypemode = 0;
+ at.msbitmaps = false;
+ at.applebitmaps = false;
+ at.gi.onlybitmaps = false;
+ at.gi.bsizes = bsizes;
+ at.gi.fixed_width = CIDOneWidth(sf);
+ at.isotf = false;
+ at.format = format;
+ at.next_strid = 256;
+ at.sf = sf;
+ at.map = map;
+
+ if ( format==ff_cff || format==ff_cffcid ) {
+ dumpcff(&at,sf,format,ttf);
+ } else {
+ /* TODO: remove top function layers here */
+ }
+ setlocale(LC_NUMERIC,oldloc);
+ if ( at.error || ferror(ttf))
+return( 0 );
+
+#ifdef __CygWin
+ /* Modern versions of windows want the execute bit set on a ttf file */
+ /* I've no idea what this corresponds to in windows, nor any idea on */
+ /* how to set it from the windows UI, but this seems to work */
+ {
+ struct stat buf;
+ fstat(fileno(ttf),&buf);
+ fchmod(fileno(ttf),S_IXUSR | buf.st_mode );
+ }
+#endif
+
+return( 1 );
+}
+
+int WriteTTFFont(char *fontname,SplineFont *sf,enum fontformat format,
+ int32 *bsizes, enum bitmapformat bf,int flags,EncMap *map, int layer) {
+ FILE *ttf;
+ int ret;
+
+ if ( strstr(fontname,"://")!=NULL ) {
+ if (( ttf = tmpfile())==NULL )
+return( 0 );
+ } else {
+ if (( ttf=fopen(fontname,"wb+"))==NULL )
+return( 0 );
+ }
+ ret = _WriteTTFFont(ttf,sf,format,bsizes,bf,flags,map,layer);
+ if ( fclose(ttf)==-1 )
+return( 0 );
+return( ret );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c
new file mode 100644
index 00000000000..e5722cfc27d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfaat.c
@@ -0,0 +1,134 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include <utype.h>
+
+#include "ttf.h"
+
+/* This file contains routines to create some of the Apple Advanced Typography Tables */
+/* (or GX fonts) */
+
+/* ************************************************************************** */
+/* ************************* The 'morx' table ************************* */
+/* ************************* (and 'feat') ************************* */
+/* ************************************************************************** */
+
+/* Each lookup gets its own subtable, so there may be multiple subtables */
+/* with the same feature/setting. The subtables will be ordered the same */
+/* way the lookups are, which might lead to awkwardness if there are many */
+/* chains and the same feature occurs in several of them */
+/* (only the default language will be used) */
+struct feature {
+ int16 featureType, featureSetting;
+ MacFeat *mf, *smf;
+ struct macsetting *ms, *sms;
+ unsigned int vertOnly: 1;
+ unsigned int r2l: 1; /* I think this is the "descending" flag */
+ unsigned int needsOff: 1;
+ unsigned int singleMutex: 1;
+ unsigned int dummyOff: 1;
+ uint8 subtable_type;
+ int chain;
+ int32 flag, offFlags;
+ uint32 feature_start;
+ uint32 feature_len; /* Does not include header yet */
+ struct feature *next; /* features in output order */
+ struct feature *nexttype; /* features in feature/setting order */
+ struct feature *nextsame; /* all features with the same feature/setting */
+ int setting_cnt, setting_index, real_index;
+};
+
+
+
+struct transition { uint16 next_state, dontconsume, ismark, trans_ent; LigList *l; };
+struct trans_entries { uint16 next_state, flags, act_index; LigList *l; };
+
+
+int Macable(SplineFont *sf, OTLookup *otl) {
+ int ft, fs;
+ FeatureScriptLangList *features;
+
+ switch ( otl->lookup_type ) {
+ /* These lookup types are mac only */
+ case kern_statemachine: case morx_indic: case morx_context: case morx_insert:
+return( true );
+ /* These lookup types or OpenType only */
+ case gsub_multiple: case gsub_alternate:
+ case gpos_single: case gpos_cursive: case gpos_mark2base:
+ case gpos_mark2ligature: case gpos_mark2mark:
+return( false );
+ /* These are OpenType only, but they might be convertable to a state */
+ /* machine */
+ case gsub_context:
+ case gsub_contextchain: case gsub_reversecchain:
+ case gpos_context: case gpos_contextchain:
+ if ( sf==NULL || sf->sm!=NULL )
+return( false );
+ /* Else fall through into the test on the feature tag */;
+ /* These two can be expressed in both, and might be either */
+ case gsub_single: case gsub_ligature: case gpos_pair:
+ for ( features = otl->features; features!=NULL; features = features->next ) {
+ if ( features->ismac || OTTagToMacFeature(features->featuretag,&ft,&fs))
+return( true );
+ }
+ }
+return( false );
+}
+
+
+/* ************************************************************************** */
+/* ************************* utility routines ************************* */
+/* ************************************************************************** */
+
+uint32 MacFeatureToOTTag(int featureType,int featureSetting) {
+ int i;
+ struct macsettingname *msn = user_macfeat_otftag ? user_macfeat_otftag : macfeat_otftag;
+
+ for ( i=0; msn[i].otf_tag!=0; ++i )
+ if ( msn[i].mac_feature_type == featureType &&
+ msn[i].mac_feature_setting == featureSetting )
+return( msn[i].otf_tag );
+
+return( 0 );
+}
+
+int OTTagToMacFeature(uint32 tag, int *featureType,int *featureSetting) {
+ int i;
+ struct macsettingname *msn = user_macfeat_otftag ? user_macfeat_otftag : macfeat_otftag;
+
+ for ( i=0; msn[i].otf_tag!=0; ++i )
+ if ( msn[i].otf_tag == tag ) {
+ *featureType = msn[i].mac_feature_type;
+ *featureSetting = msn[i].mac_feature_setting;
+return( true );
+ }
+
+ *featureType = 0;
+ *featureSetting = 0;
+return( false );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfgpos.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfgpos.c
new file mode 100644
index 00000000000..d89177e211f
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/tottfgpos.c
@@ -0,0 +1,366 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "fontforgevw.h"
+#include <utype.h>
+#include <ustring.h>
+
+int coverageformatsallowed=3;
+int use_second_indic_scripts = false;
+
+#include "ttf.h"
+
+/* This file contains routines to create the otf gpos and gsub tables and their */
+/* attendant subtables */
+
+/* Undocumented fact: ATM (which does kerning for otf fonts in Word) can't handle features with multiple lookups */
+
+/* Undocumented fact: Only one feature with a given tag allowed per script/lang */
+/* So if we have multiple lookups with the same tag they must be merged into */
+/* one feature with many lookups */
+
+/* scripts (for opentype) that I understand */
+ /* see also list in lookups.c mapping script tags to friendly names */
+
+static uint32 scripts[][15] = {
+/* Arabic */ { CHR('a','r','a','b'), 0x0600, 0x06ff, 0xfb50, 0xfdff, 0xfe70, 0xfefe },
+/* Aramaic */ { CHR('a','r','a','m'), 0x820, 0x83f },
+/* Armenian */ { CHR('a','r','m','n'), 0x0530, 0x058f, 0xfb13, 0xfb17 },
+/* Balinese */ { CHR('b','a','l','i'), 0x1b00, 0x1b7f },
+/* Bengali */ { CHR('b','e','n','g'), 0x0980, 0x09ff },
+/* Bliss symb */{ CHR('b','l','i','s'), 0x12200, 0x124ff },
+/* Bopomofo */ { CHR('b','o','p','o'), 0x3100, 0x312f, 0x31a0, 0x31bf },
+/* Braille */ { CHR('b','r','a','i'), 0x2800, 0x28ff },
+/* Buginese */ { CHR('b','u','g','i'), 0x1a00, 0x1a1f },
+/* Buhid */ { CHR('b','u','h','d'), 0x1740, 0x1753 },
+/* Byzantine M*/{ CHR('b','y','z','m'), 0x1d000, 0x1d0ff },
+/* Canadian Syl*/{CHR('c','a','n','s'), 0x1400, 0x167f },
+/* Carian */ {CHR('c','a','r','i'), 0x0, 0x0 },
+/* Cham */ {CHR('c','h','a','m'), 0x0, 0x0 },
+/* Cherokee */ { CHR('c','h','e','r'), 0x13a0, 0x13ff },
+/* Cirth */ { CHR('c','i','r','t'), 0x12080, 0x120ff },
+/* CJKIdeogra */{ CHR('h','a','n','i'), 0x3300, 0x9fff, 0xf900, 0xfaff, 0x020000, 0x02ffff },
+/* Coptic */ { CHR('c','o','p','t'), 0x2c80, 0x2cff },
+/* Cypriot */ { CHR('c','p','m','n'), 0x10800, 0x1083f },
+/* Cyrillic */ { CHR('c','y','r','l'), 0x0400, 0x052f, 0x1d2b, 0x1d2b, 0x1d78, 0x1d78,
+ 0x2de0, 0x2dff, 0xa640, 0xa6ff },
+/* Deseret */ { CHR('d','s','r','t'), 0x10400, 0x1044f },
+/* Devanagari */{ CHR('d','e','v','a'), 0x0900, 0x097f },
+/* Ethiopic */ { CHR('e','t','h','i'), 0x1200, 0x139f },
+/* Georgian */ { CHR('g','e','o','r'), 0x1080, 0x10ff },
+/* Glagolitic */{ CHR('g','l','a','g'), 0x1080, 0x10ff },
+/* Gothic */ { CHR('g','o','t','h'), 0x10330, 0x1034a },
+/* Greek */ { CHR('g','r','e','k'), 0x0370, 0x03ff, 0x1f00, 0x1fff },
+/* Gujarati */ { CHR('g','u','j','r'), 0x0a80, 0x0aff },
+/* Gurmukhi */ { CHR('g','u','r','u'), 0x0a00, 0x0a7f },
+/* Hangul */ { CHR('h','a','n','g'), 0xac00, 0xd7af, 0x3130, 0x319f, 0xffa0, 0xff9f },
+/* Hanunoo */ { CHR('h','a','n','o'), 0x1720, 0x1734 },
+ /* I'm not sure what the difference is between the 'hang' tag and the 'jamo' */
+ /* tag. 'Jamo' is said to be the precomposed forms, but what's 'hang'? */
+/* Hebrew */ { CHR('h','e','b','r'), 0x0590, 0x05ff, 0xfb1e, 0xfb4f },
+#if 0 /* Hiragana used to have its own tag, but has since been merged with katakana */
+/* Hiragana */ { CHR('h','i','r','a'), 0x3040, 0x309f },
+#endif
+/* Hangul Jamo*/{ CHR('j','a','m','o'), 0x1100, 0x11ff, 0x3130, 0x319f, 0xffa0, 0xffdf },
+/* Javanese */ { CHR('j','a','v','a'), 0 }, /* MS has a tag, but there is no unicode range */
+/* Katakana */ { CHR('k','a','n','a'), 0x3040, 0x30ff, 0xff60, 0xff9f },
+/* Kayah Li */ { CHR('k','a','l','i'), 0 },
+/* Kannada */ { CHR('k','n','d','a'), 0x0c80, 0x0cff },
+/* Kharosthi */ { CHR('k','h','a','r'), 0x10a00, 0x10a5f },
+/* Khmer */ { CHR('k','h','m','r'), 0x1780, 0x17ff },
+/* Latin */ { CHR('l','a','t','n'), 0x0041, 0x005a, 0x0061, 0x007a,
+ 0x00c0, 0x02af, 0x1d00, 0x1eff, 0xfb00, 0xfb0f, 0xff00, 0xff5f, 0xa770, 0xa7ff },
+/* Lao */ { CHR('l','a','o',' '), 0x0e80, 0x0eff },
+/* Lepcha */ { CHR('l','e','p','c'), 0 },
+/* Limbu */ { CHR('l','i','m','b'), 0x1900, 0x194f },
+/* Linear A */ /*{ CHR('l','i','n','a'), 0x10180, 0x102cf },*/ /* What happened to linear A? */
+/* Linear B */ { CHR('l','i','n','b'), 0x10000, 0x100fa },
+/* Lycian */ { CHR('l','y','c','i'), 0 },
+/* Lydian */ { CHR('l','y','d','i'), 0 },
+/* Malayalam */ { CHR('m','l','y','m'), 0x0d00, 0x0d7f },
+/* Mathematical Alphanumeric Symbols */
+ { CHR('m','a','t','h'), 0x1d400, 0x1d7ff },
+/* Mongolian */ { CHR('m','o','n','g'), 0x1800, 0x18af },
+/* Musical */ { CHR('m','u','s','i'), 0x1d100, 0x1d1ff },
+/* Myanmar */ { CHR('m','y','m','r'), 0x1000, 0x107f },
+/* New Tai Lue*/{ CHR('t','a','l','u'), 0 },
+/* N'Ko */ { CHR('n','k','o',' '), 0x07c0, 0x07fa },
+/* Ogham */ { CHR('o','g','a','m'), 0x1680, 0x169f },
+/* Ol Chiki */ { CHR('o','l','c','k'), 0 },
+/* Old Italic */{ CHR('i','t','a','l'), 0x10300, 0x1031e },
+/* Old Permic */{ CHR('p','e','r','m'), 0x10350, 0x1037f },
+/* Old Persian cuneiform */
+ { CHR('x','p','e','o'), 0x103a0, 0x103df },
+/* Oriya */ { CHR('o','r','y','a'), 0x0b00, 0x0b7f },
+/* Osmanya */ { CHR('o','s','m','a'), 0x10480, 0x104a9 },
+/* Phags-pa */ { CHR('p','h','a','g'), 0xa840, 0xa87f },
+/* Phoenician */{ CHR('p','h','n','x'), 0x10900, 0x1091f },
+/* Pollard */ { CHR('p','l','r','d'), 0x104b0, 0x104d9 },
+/* Rejang */ { CHR('r','j','n','g'), 0 },
+/* Rongorongo */{ CHR('r','o','r','o'), 0 },
+/* Runic */ { CHR('r','u','n','r'), 0x16a0, 0x16ff },
+/* Saurashtra*/ { CHR('s','a','u','r'), 0 },
+/* Shavian */ { CHR('s','h','a','w'), 0x10450, 0x1047f },
+/* Sinhala */ { CHR('s','i','n','h'), 0x0d80, 0x0dff },
+/* Sumero-Akkadian Cuneiform */
+ { CHR('x','s','u','x'), 0x12000, 0x1236e },
+/* Sundanese */ { CHR('s','u','n','d'), 0 },
+/* Syloti Nagri */
+ { CHR('s','y','l','o'), 0xa800, 0xa82f },
+/* Syriac */ { CHR('s','y','r','c'), 0x0700, 0x074f },
+/* Tagalog */ { CHR('t','a','g','l'), 0x1700, 0x1714 },
+/* Tagbanwa */ { CHR('t','a','g','b'), 0x1760, 0x1773 },
+/* Tai Le */ { CHR('t','a','l','e'), 0x1950, 0x1974 },
+/* Tai Lu */ { CHR('t','a','l','u'), 0x1980, 0x19df },
+/* Tamil */ { CHR('t','a','m','l'), 0x0b80, 0x0bff },
+/* Telugu */ { CHR('t','e','l','u'), 0x0c00, 0x0c7f },
+/* Tengwar */ { CHR('t','e','n','g'), 0x12000, 0x1207f },
+/* Thaana */ { CHR('t','h','a','a'), 0x0780, 0x07bf },
+/* Thai */ { CHR('t','h','a','i'), 0x0e00, 0x0e7f },
+/* Tibetan */ { CHR('t','i','b','t'), 0x0f00, 0x0fff },
+/* Tifinagh */ { CHR('t','f','n','g'), 0x2d30, 0x2d7f },
+/* Ugaritic */ { CHR('u','g','a','r'), 0x10380, 0x1039d },
+/* Yi */ { CHR('y','i',' ',' '), 0xa000, 0xa4c6 },
+ { 0 }
+};
+
+int ScriptIsRightToLeft(uint32 script) {
+ if ( script==CHR('a','r','a','b') || script==CHR('h','e','b','r') ||
+ script==CHR('c','p','m','n') || script==CHR('k','h','a','r') ||
+ script==CHR('s','y','r','c') || script==CHR('t','h','a','a') ||
+ script==CHR('n','k','o',' '))
+return( true );
+
+return( false );
+}
+
+uint32 ScriptFromUnicode(int u,SplineFont *sf) {
+ int s, k;
+
+ if ( u!=-1 ) {
+ for ( s=0; scripts[s][0]!=0; ++s ) {
+ for ( k=1; scripts[s][k+1]!=0; k += 2 )
+ if ( u>=scripts[s][k] && u<=scripts[s][k+1] )
+ break;
+ if ( scripts[s][k+1]!=0 )
+ break;
+ }
+ if ( scripts[s][0]!=0 ) {
+ uint32 script = scripts[s][0];
+ if ( use_second_indic_scripts ) {
+ /* MS has a parallel set of script tags for their new */
+ /* Indic font shaper */
+ if ( script == CHR('b','e','n','g' )) script = CHR('b','n','g','2');
+ else if ( script == CHR('d','e','v','a' )) script = CHR('d','e','v','2');
+ else if ( script == CHR('g','u','j','r' )) script = CHR('g','j','r','2');
+ else if ( script == CHR('g','u','r','u' )) script = CHR('g','u','r','2');
+ else if ( script == CHR('k','n','d','a' )) script = CHR('k','n','d','2');
+ else if ( script == CHR('m','l','y','m' )) script = CHR('m','l','y','2');
+ else if ( script == CHR('o','r','y','a' )) script = CHR('o','r','y','2');
+ else if ( script == CHR('t','a','m','l' )) script = CHR('t','m','l','2');
+ else if ( script == CHR('t','e','l','u' )) script = CHR('t','e','l','2');
+ }
+return( script );
+ }
+ } else if ( sf!=NULL ) {
+ if ( sf->cidmaster!=NULL || sf->subfontcnt!=0 ) {
+ if ( sf->cidmaster!=NULL ) sf = sf->cidmaster;
+ if ( strmatch(sf->ordering,"Identity")==0 )
+return( DEFAULT_SCRIPT );
+ else if ( strmatch(sf->ordering,"Korean")==0 )
+return( CHR('h','a','n','g'));
+ else
+return( CHR('h','a','n','i') );
+ }
+ }
+
+return( DEFAULT_SCRIPT );
+}
+
+uint32 SCScriptFromUnicode(SplineChar *sc) {
+ char *pt;
+ PST *pst;
+ SplineFont *sf;
+ int i; unsigned uni;
+ FeatureScriptLangList *features;
+
+ if ( sc==NULL )
+return( DEFAULT_SCRIPT );
+
+ sf = sc->parent;
+ if ( sc->unicodeenc!=-1 &&
+ !(sc->unicodeenc>=0xe000 && sc->unicodeenc<0xf8ff) &&
+ !(sc->unicodeenc>=0xf0000 && sc->unicodeenc<0x10ffff))
+return( ScriptFromUnicode( sc->unicodeenc,sf ));
+
+ pt = sc->name;
+ if ( *pt ) for ( ++pt; *pt!='\0' && *pt!='_' && *pt!='.'; ++pt );
+ if ( *pt!='\0' ) {
+ char *str = copyn(sc->name,pt-sc->name);
+ int uni = sf==NULL || sf->fv==NULL ? UniFromName(str,ui_none,&custom) :
+ UniFromName(str,sf->uni_interp,sf->fv->map->enc);
+ free(str);
+ if ( uni!=-1 )
+return( ScriptFromUnicode( uni,sf ));
+ }
+ /* Adobe ligature uniXXXXXXXX */
+ if ( strncmp(sc->name,"uni",3)==0 && sscanf(sc->name+3,"%4x", &uni)==1 )
+return( ScriptFromUnicode( uni,sf ));
+
+ if ( sf==NULL )
+return( DEFAULT_SCRIPT );
+
+ if ( sf->cidmaster ) sf=sf->cidmaster;
+ else if ( sf->mm!=NULL ) sf=sf->mm->normal;
+ for ( i=0; i<2; ++i ) {
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->type == pst_lcaret )
+ continue;
+ for ( features = pst->subtable->lookup->features; features!=NULL; features=features->next ) {
+ if ( features->scripts!=NULL )
+return( features->scripts->script );
+ }
+ }
+ }
+return( ScriptFromUnicode( sc->unicodeenc,sf ));
+}
+
+
+SplineChar **SFGlyphsFromNames(SplineFont *sf,char *names) {
+ int cnt, ch;
+ char *pt, *end;
+ SplineChar *sc, **glyphs;
+
+ cnt = 0;
+ for ( pt = names; *pt; pt = end+1 ) {
+ ++cnt;
+ end = strchr(pt,' ');
+ if ( end==NULL )
+ break;
+ }
+
+ glyphs = galloc((cnt+1)*sizeof(SplineChar *));
+ cnt = 0;
+ for ( pt = names; *pt; pt = end+1 ) {
+ end = strchr(pt,' ');
+ if ( end==NULL )
+ end = pt+strlen(pt);
+ ch = *end;
+ *end = '\0';
+ sc = SFGetChar(sf,-1,pt);
+ if ( sc!=NULL && sc->ttf_glyph!=-1 )
+ glyphs[cnt++] = sc;
+ *end = ch;
+ if ( ch=='\0' )
+ break;
+ }
+ glyphs[cnt] = NULL;
+return( glyphs );
+}
+
+
+static int glyphnameinlist(char *haystack,char *name) {
+ char *start, *pt;
+ int ch, match, slen = strlen(name);
+
+ for ( pt=haystack ; ; ) {
+ while ( *pt==' ' ) ++pt;
+ if ( *pt=='\0' )
+return( false );
+ start=pt;
+ while ( *pt!=' ' && *pt!='\0' ) ++pt;
+ if ( pt-start==slen ) {
+ ch = *pt; *pt='\0';
+ match = strcmp(start,name);
+ *pt = ch;
+ if ( match==0 )
+return( true );
+ }
+ }
+}
+
+static int ReferencedByGSUB(SplineChar *sc) {
+ PST *pst;
+ SplineFont *sf = sc->parent;
+ int gid;
+ SplineChar *testsc;
+ char *name = sc->name;
+
+ /* If it is itself a ligature it will be referenced by GSUB */
+ /* (because we store ligatures on the glyph generated) */
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next )
+ if ( pst->type == pst_ligature )
+return( true );
+
+ for ( gid=0; gid<sf->glyphcnt; ++gid ) if ( (testsc=sf->glyphs[gid])!=NULL ) {
+ for ( pst=testsc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->type==pst_substitution || pst->type==pst_alternate ||
+ pst->type==pst_multiple ) {
+ if ( glyphnameinlist(pst->u.mult.components,name) )
+return( true );
+ }
+ }
+ }
+return( false );
+}
+
+int gdefclass(SplineChar *sc) {
+ PST *pst;
+ AnchorPoint *ap;
+
+ if ( sc->glyph_class!=0 )
+return( sc->glyph_class-1 );
+
+ if ( strcmp(sc->name,".notdef")==0 )
+return( 0 );
+
+ /* It isn't clear to me what should be done if a glyph is both a ligature */
+ /* and a mark (There are some greek accent ligatures, it is probably more*/
+ /* important that they be indicated as marks). Here I chose mark rather */
+ /* than ligature as the mark class is far more likely to be used */
+ ap=sc->anchor;
+ while ( ap!=NULL && (ap->type==at_centry || ap->type==at_cexit) )
+ ap = ap->next;
+ if ( ap!=NULL && (ap->type==at_mark || ap->type==at_basemark) )
+return( 3 );
+
+ for ( pst=sc->possub; pst!=NULL; pst=pst->next ) {
+ if ( pst->type == pst_ligature )
+return( 2 ); /* Ligature */
+ }
+
+ /* I not quite sure what a componant glyph is. Probably something */
+ /* that is not in the cmap table and is referenced in other glyphs */
+ /* (I've never seen it used by others) */
+ /* (Note: No glyph in a CID font can be components as all CIDs mean */
+ /* something) (I think) */
+ if ( sc->unicodeenc==-1 && sc->dependents!=NULL &&
+ sc->parent->cidmaster!=NULL && !ReferencedByGSUB(sc))
+return( 4 );
+ else
+return( 1 );
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ttf.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h
index a88bf3ecf21..0827658bf92 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/ttf.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2007 by George Williams */
+/* Copyright (C) 2001-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -81,6 +81,7 @@ struct ttfinfo {
unsigned int use_typo_metrics: 1;
unsigned int weight_width_slope_only: 1;
unsigned int optimized_for_cleartype: 1;
+ unsigned int apply_lsb: 1;
enum openflags openflags;
/* Mac fonts platform=0/1, platform specific enc id, roman=0, english is lang code 0 */
/* iso platform=2, platform specific enc id, latin1=0/2, no language */
@@ -105,12 +106,15 @@ struct ttfinfo {
short gasp_version;
int dupnamestate;
struct ttflangname *names;
- char *fontcomments;
+ char *fontcomments, *fontlog;
+ char **cvt_names;
SplineChar **chars; /* from all over, glyf table for contours */
/* cmap table for encodings */
/* hmtx table for widths */
/* post table for names */
/* Or from CFF table for everything in opentype */
+ LayerInfo *layers;
+ int layer_cnt;
BDFFont *bitmaps;
char *cidregistry, *ordering;
int supplement;
@@ -120,11 +124,14 @@ struct ttfinfo {
char *inuse; /* What glyphs are used by this font in the ttc */
int numtables;
+ /* BASE */
+ uint32 base_start; /* Offset from sof to start of 'BASE' table */
/* CFF */
uint32 cff_start; /* Offset from sof to start of postscript compact font format */
uint32 cff_length;
/* cmap */
uint32 encoding_start; /* Offset from sof to start of encoding table */
+ uint32 vs_start; /* Offset within 'cmap' to variant selector table */
/* gasp */
uint32 gasp_start;
/* glyf */
@@ -198,6 +205,11 @@ struct ttfinfo {
uint32 feat_start;
uint32 mort_start;
uint32 morx_start;
+ uint32 bsln_start;
+
+ /* MATH Table */
+ uint32 math_start;
+ uint32 math_length;
/* Info for instructions */
uint32 cvt_start, cvt_len;
@@ -226,6 +238,7 @@ struct ttfinfo {
OTLookup *mort_subs_lookup, *mort_pos_lookup2;
int mort_r2l, mort_tag_mac, mort_feat, mort_setting, mort_is_nested;
uint16 *morx_classes;
+ uint16 *bsln_values;
int mort_max;
@@ -271,8 +284,24 @@ struct ttfinfo {
#endif
int gasp_cnt;
struct gasp *gasp;
+ struct MATH *math;
+ /* Set of errors we found when loading the font */
+ unsigned int bad_ps_fontname: 1;
+ unsigned int bad_glyph_data: 1;
+ unsigned int bad_cff: 1;
+ unsigned int bad_metrics: 1;
+ unsigned int bad_cmap: 1;
+ unsigned int bad_embedded_bitmap: 1;
+ unsigned int bad_gx: 1;
+ unsigned int bad_ot: 1;
+ unsigned int bad_os2_version: 1;
+ unsigned int bad_sfnt_header: 1;
+ Layer guidelines;
+ struct Base *horiz_base, *vert_base;
};
+enum gsub_inusetype { git_normal, git_justinuse, git_findnames };
+
#define MAX_TAB 48
struct tabdir {
int32 version; /* 0x00010000 */
@@ -289,7 +318,9 @@ struct tabdir {
uint16 dup_of;
uint16 orderingval;
} tabs[MAX_TAB]; /* room for all the above tables */
- struct taboff *ordered[MAX_TAB];
+ /* Not in any particular order. */
+ struct taboff *ordered[MAX_TAB]; /* Ordered the way the tables should be output in file */
+ struct taboff *alpha[MAX_TAB]; /* Ordered alphabetically by tag for the ttf header */
};
struct glyphhead {
@@ -380,7 +411,6 @@ struct maxp {
uint16 maxcomponentdepth;
/* Apple docs say: 0 (if no composits), maximum value 1 (one level of composit) */
/* OpenType docs say: 1 (if no composits), any depth allowed */
- uint16 mbz; /* pad out to a 4byte boundary */
};
struct nametab {
@@ -513,6 +543,7 @@ struct glyphinfo {
int32 *pointcounts;
int *bygid; /* glyph list */
int gcnt;
+ int layer;
};
struct vorg {
@@ -560,6 +591,10 @@ struct alltabs {
int maxplen;
FILE *os2f;
int os2len;
+ FILE *math;
+ int mathlen;
+ FILE *base;
+ int baselen;
FILE *cvtf;
int cvtlen;
FILE *fpgmf; /* Copied from an original ttf file and dumped out. Never generated */
@@ -601,6 +636,8 @@ struct alltabs {
int featlen;
FILE *morx;
int morxlen;
+ FILE *bsln;
+ int bslnlen;
FILE *pfed;
int pfedlen;
FILE *tex;
@@ -617,6 +654,10 @@ struct alltabs {
int avarlen;
FILE *fftmf;
int fftmlen;
+ FILE *dsigf;
+ int dsiglen;
+ FILE *hdmxf;
+ int hdmxlen;
int defwid, nomwid;
int sidcnt;
int lenpos;
@@ -647,6 +688,8 @@ struct alltabs {
int fontstyle_name_strid; /* For GPOS 'size' */
SplineFont *sf;
EncMap *map;
+ struct ttf_table *oldcvt;
+ int oldcvtlen;
};
struct subhead { uint16 first, cnt, delta, rangeoff; }; /* a sub header in 8/16 cmap table */
@@ -701,6 +744,8 @@ extern int ttfFixupRef(SplineChar **chars,int i);
extern void otf_dumpgpos(struct alltabs *at, SplineFont *sf);
extern void otf_dumpgsub(struct alltabs *at, SplineFont *sf);
extern void otf_dumpgdef(struct alltabs *at, SplineFont *sf);
+extern void otf_dumpbase(struct alltabs *at, SplineFont *sf);
+extern void otf_dump_dummydsig(struct alltabs *at, SplineFont *sf);
extern int gdefclass(SplineChar *sc);
/* Apple Advanced Typography Tables */
@@ -710,6 +755,7 @@ extern void aat_dumplcar(struct alltabs *at, SplineFont *sf);
extern void aat_dumpmorx(struct alltabs *at, SplineFont *sf);
extern void aat_dumpopbd(struct alltabs *at, SplineFont *sf);
extern void aat_dumpprop(struct alltabs *at, SplineFont *sf);
+extern void aat_dumpbsln(struct alltabs *at, SplineFont *sf);
extern int LookupHasDefault(OTLookup *otl);
extern int scriptsHaveDefault(struct scriptlanglist *sl);
extern int FPSTisMacable(SplineFont *sf, FPST *fpst);
@@ -717,6 +763,8 @@ extern uint32 MacFeatureToOTTag(int featureType,int featureSetting);
extern int OTTagToMacFeature(uint32 tag, int *featureType,int *featureSetting);
extern uint16 *props_array(SplineFont *sf,struct glyphinfo *gi);
extern int haslrbounds(SplineChar *sc, PST **left, PST **right);
+extern int16 *PerGlyphDefBaseline(SplineFont *sf,int *def_baseline);
+extern void FigureBaseOffsets(SplineFont *sf,int def_bsln,int offsets[32]);
/* Apple variation tables */
extern int ContourPtNumMatch(MMSet *mm, int gid);
@@ -737,10 +785,12 @@ extern int memushort(uint8 *data,int table_len, int offset);
extern void memputshort(uint8 *data,int offset,uint16 val);
extern int TTF__getcvtval(SplineFont *sf,int val);
extern int TTF_getcvtval(SplineFont *sf,int val);
-extern void initforinstrs(SplineChar *sc);
+extern void SCinitforinstrs(SplineChar *sc);
extern int SSAddPoints(SplineSet *ss,int ptcnt,BasePoint *bp, char *flags);
+extern int Macable(SplineFont *sf, OTLookup *otl);
/* Used by both otf and apple */
+extern int LigCaretCnt(SplineChar *sc);
extern uint16 *ClassesFromNames(SplineFont *sf,char **classnames,int class_cnt,
int numGlyphs, SplineChar ***glyphs, int apple_kc);
extern SplineChar **SFGlyphsFromNames(SplineFont *sf,char *names);
@@ -774,6 +824,11 @@ extern void ttf_bdf_read(FILE *ttf,struct ttfinfo *info);
/* The FFTM table, to some timestamps I'd like */
extern int ttf_fftm_dump(SplineFont *sf,struct alltabs *at);
+ /* The MATH table */
+extern void otf_dump_math(struct alltabs *at, SplineFont *sf);
+extern void otf_read_math(FILE *ttf,struct ttfinfo *info);
+extern void otf_read_math_used(FILE *ttf,struct ttfinfo *info);
+extern void GuessNamesFromMATH(FILE *ttf,struct ttfinfo *info);
/* Parsing advanced typography */
extern void readmacfeaturemap(FILE *ttf,struct ttfinfo *info);
@@ -782,10 +837,12 @@ extern void readttfmort(FILE *ttf,struct ttfinfo *info);
extern void readttfopbd(FILE *ttf,struct ttfinfo *info);
extern void readttflcar(FILE *ttf,struct ttfinfo *info);
extern void readttfprop(FILE *ttf,struct ttfinfo *info);
+extern void readttfbsln(FILE *ttf,struct ttfinfo *info);
extern void readttfgsubUsed(FILE *ttf,struct ttfinfo *info);
extern void GuessNamesFromGSUB(FILE *ttf,struct ttfinfo *info);
extern void readttfgpossub(FILE *ttf,struct ttfinfo *info,int gpos);
extern void readttfgdef(FILE *ttf,struct ttfinfo *info);
+extern void readttfbase(FILE *ttf,struct ttfinfo *info);
extern void VariationFree(struct ttfinfo *info);
extern void readttfvariations(struct ttfinfo *info, FILE *ttf);
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttfspecial.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttfspecial.c
new file mode 100644
index 00000000000..dad61caa268
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/ttfspecial.c
@@ -0,0 +1,903 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "pfaedit.h"
+#include <math.h>
+#include <time.h>
+#include <utype.h>
+#include <ustring.h>
+#include <gimage.h> /* For COLOR_DEFAULT */
+
+#include "ttf.h"
+
+/* This file contains routines to generate non-standard true/opentype tables */
+/* The first is the 'PfEd' table containing PfaEdit specific information */
+/* glyph comments & colours ... perhaps other info later */
+
+/* ************************************************************************** */
+/* ************************* The 'PfEd' table ************************* */
+/* ************************* Output ************************* */
+/* ************************************************************************** */
+
+#include "PfEd.h" /* This describes the format of the 'PfEd' table */
+ /* and its many subtables. */
+
+#define MAX_SUBTABLE_TYPES 20
+
+/* ************************* The 'PfEd' table ************************* */
+/* ************************* Input ************************* */
+
+static void pfed_readfontcomment(FILE *ttf,struct ttfinfo *info,uint32 base,
+ uint32 tag) {
+ int len;
+ char *start, *pt, *end;
+ int use_utf8;
+
+ fseek(ttf,base,SEEK_SET);
+ use_utf8 = getushort(ttf);
+ if ( use_utf8!=0 && use_utf8!=1 )
+return; /* Bad version number */
+ len = getushort(ttf);
+ start = pt = galloc(len+1);
+
+ end = pt+len;
+ if ( use_utf8 ) {
+ while ( pt<end )
+ *pt++ = getc(ttf);
+ } else {
+ while ( pt<end )
+ *pt++ = getushort(ttf);
+ }
+ *pt = '\0';
+ if ( !use_utf8 ) {
+ pt = latin1_2_utf8_copy(info->fontcomments);
+ free(start);
+ start = pt;
+ }
+ if ( tag==flog_TAG )
+ info->fontlog = start;
+ else
+ info->fontcomments = start;
+}
+
+static char *pfed_read_utf8(FILE *ttf, uint32 start) {
+ int ch, len;
+ char *str, *pt;
+
+ fseek( ttf, start, SEEK_SET);
+ len = 0;
+ while ( (ch=getc(ttf))!='\0' && ch!=EOF )
+ ++len;
+ fseek( ttf, start, SEEK_SET);
+ str = pt = galloc(len+1);
+ while ( (ch=getc(ttf))!='\0' && ch!=EOF )
+ *pt++ = ch;
+ *pt = '\0';
+return( str );
+}
+
+static char *pfed_read_ucs2_len(FILE *ttf,uint32 offset,int len) {
+ char *pt, *str;
+ uint32 uch, uch2;
+ int i;
+
+ if ( len<0 )
+return( NULL );
+
+ len>>=1;
+ pt = str = galloc(3*len);
+ fseek(ttf,offset,SEEK_SET);
+ for ( i=0; i<len; ++i ) {
+ uch = getushort(ttf);
+ if ( uch>=0xd800 && uch<0xdc00 ) {
+ uch2 = getushort(ttf);
+ if ( uch2>=0xdc00 && uch2<0xe000 )
+ uch = ((uch-0xd800)<<10) | (uch2&0x3ff);
+ else {
+ pt = utf8_idpb(pt,uch);
+ uch = uch2;
+ }
+ }
+ pt = utf8_idpb(pt,uch);
+ }
+ *pt++ = 0;
+return( grealloc(str,pt-str) );
+}
+
+static char *pfed_read_utf8_len(FILE *ttf,uint32 offset,int len) {
+ char *pt, *str;
+ int i;
+
+ if ( len<0 )
+return( NULL );
+
+ pt = str = galloc(len+1);
+ fseek(ttf,offset,SEEK_SET);
+ for ( i=0; i<len; ++i )
+ *pt++ = getc(ttf);
+ *pt = '\0';
+return( str );
+}
+
+static void pfed_readcvtcomments(FILE *ttf,struct ttfinfo *info,uint32 base ) {
+ int count, i;
+ uint16 *offsets;
+
+ fseek(ttf,base,SEEK_SET);
+ if ( getushort(ttf)!=0 )
+return; /* Bad version number */
+ count = getushort(ttf);
+
+ offsets = galloc(count*sizeof(uint16));
+ info->cvt_names = galloc((count+1)*sizeof(char *));
+ for ( i=0; i<count; ++i )
+ offsets[i] = getushort(ttf);
+ for ( i=0; i<count; ++i ) {
+ if ( offsets[i]==0 )
+ info->cvt_names[i] = NULL;
+ else
+ info->cvt_names[i] = pfed_read_utf8(ttf,base+offsets[i]);
+ }
+ free(offsets);
+}
+
+static void pfed_readglyphcomments(FILE *ttf,struct ttfinfo *info,uint32 base) {
+ int n, i, j;
+ struct grange { int start, end; uint32 offset; } *grange;
+ uint32 offset, next;
+ int use_utf8;
+
+ fseek(ttf,base,SEEK_SET);
+ use_utf8 = getushort(ttf);
+ if ( use_utf8!=0 && use_utf8!=1 )
+return; /* Bad version number */
+ n = getushort(ttf);
+ grange = galloc(n*sizeof(struct grange));
+ for ( i=0; i<n; ++i ) {
+ grange[i].start = getushort(ttf);
+ grange[i].end = getushort(ttf);
+ grange[i].offset = getlong(ttf);
+ if ( grange[i].start>grange[i].end || grange[i].end>info->glyph_cnt ) {
+ LogError( _("Bad glyph range specified in glyph comment subtable of PfEd table\n") );
+ grange[i].start = 1; grange[i].end = 0;
+ }
+ }
+ for ( i=0; i<n; ++i ) {
+ for ( j=grange[i].start; j<=grange[i].end; ++j ) {
+ fseek( ttf,base+grange[i].offset+(j-grange[i].start)*sizeof(uint32),SEEK_SET);
+ offset = getlong(ttf);
+ next = getlong(ttf);
+ if ( use_utf8 )
+ info->chars[j]->comment = pfed_read_utf8_len(ttf,base+offset,next-offset);
+ else
+ info->chars[j]->comment = pfed_read_ucs2_len(ttf,base+offset,next-offset);
+ if ( info->chars[j]->comment == NULL )
+ LogError("Invalid comment string (negative length?) in 'PfEd' table for glyph %s.",
+ info->chars[j]->name );
+ }
+ }
+ free(grange);
+}
+
+static void pfed_readcolours(FILE *ttf,struct ttfinfo *info,uint32 base) {
+ int n, i, j, start, end;
+ uint32 col;
+
+ fseek(ttf,base,SEEK_SET);
+ if ( getushort(ttf)!=0 )
+return; /* Bad version number */
+ n = getushort(ttf);
+ for ( i=0; i<n; ++i ) {
+ start = getushort(ttf);
+ end = getushort(ttf);
+ col = getlong(ttf);
+ if ( start>end || end>info->glyph_cnt )
+ LogError( _("Bad glyph range specified in colour subtable of PfEd table\n") );
+ else {
+ for ( j=start; j<=end; ++j )
+ info->chars[j]->color = col;
+ }
+ }
+}
+
+static void pfed_readlookupnames(FILE *ttf,struct ttfinfo *info,uint32 base,
+ OTLookup *lookups) {
+ OTLookup *otl;
+ struct lookup_subtable *sub;
+ AnchorClass *ac;
+ int i, j, k, n, s, a;
+ struct lstruct { int name_off, subs_off; } *ls, *ss, *as;
+
+ fseek(ttf,base,SEEK_SET);
+ if ( getushort(ttf)!=0 )
+return; /* Bad version number */
+ n = getushort(ttf);
+ ls = galloc(n*sizeof(struct lstruct));
+ for ( i=0; i<n; ++i ) {
+ ls[i].name_off = getushort(ttf);
+ ls[i].subs_off = getushort(ttf);
+ }
+ for ( i=0, otl=lookups; i<n && otl!=NULL; ++i, otl=otl->next ) {
+ if ( ls[i].name_off!=0 ) {
+ free( otl->lookup_name );
+ otl->lookup_name = pfed_read_utf8(ttf,base+ls[i].name_off);
+ }
+ if ( ls[i].subs_off!=0 ) {
+ fseek(ttf,base+ls[i].subs_off,SEEK_SET);
+ s = getushort(ttf);
+ ss = galloc(s*sizeof(struct lstruct));
+ for ( j=0; j<s; ++j ) {
+ ss[j].name_off = getushort(ttf);
+ ss[j].subs_off = getushort(ttf);
+ }
+ for ( j=0, sub=otl->subtables; j<s && sub!=NULL; ++j, sub=sub->next ) {
+ if ( ss[j].name_off!=0 ) {
+ free( sub->subtable_name );
+ sub->subtable_name = pfed_read_utf8(ttf,base+ss[j].name_off);
+ }
+ if ( ss[j].subs_off!=0 ) {
+ if ( !sub->anchor_classes )
+ LogError("Whoops, attempt to name anchors in a subtable which doesn't contain any\n");
+ else {
+ fseek(ttf,base+ss[j].subs_off,SEEK_SET);
+ a = getushort(ttf);
+ as = galloc(a*sizeof(struct lstruct));
+ for ( k=0; k<a; ++k ) {
+ as[k].name_off = getushort(ttf);
+ }
+ k=0;
+ for ( ac=info->ahead; ac!=NULL; ac=ac->next ) {
+ if ( ac->subtable==sub ) {
+ if ( as[k].name_off!=0 ) {
+ free( ac->name );
+ ac->name = pfed_read_utf8(ttf,base+as[k].name_off);
+ }
+ ++k;
+ }
+ }
+ free(as);
+ }
+ }
+ }
+ /* I guess it's ok for some subtables to be unnamed, so no check for sub!=NULL */
+ if ( j<s )
+ LogError("Whoops, more names than subtables of lookup %s\n", otl->lookup_name );
+ free(ss);
+ }
+ }
+ /* I guess it's ok for some lookups to be unnamed, so no check for otf!=NULL */
+ if ( i<n )
+ LogError("Whoops, more names than lookups\n" );
+ free(ls);
+}
+
+static float pfed_get_coord(FILE *ttf,int mod) {
+ if ( mod==V_B )
+return( (float) (signed char) getc(ttf) );
+ else if ( mod==V_S )
+return( (float) (short) getushort(ttf));
+ else if ( mod==V_F )
+return( getlong(ttf)/256.0 );
+ else {
+ LogError( "Bad data type in contour verb in 'PfEd'\n");
+return( 0 );
+ }
+}
+
+static void pfed_read_normal_contour(FILE *ttf,SplineSet *ss,
+ uint32 base, int type) {
+ SplinePoint *sp, *current;
+ int verb, v, m;
+ float offx, offy, offx1 = 0, offy1 = 0, offx2, offy2;
+ int was_implicit=false;
+
+ fseek(ttf,base,SEEK_SET);
+
+ verb = getc(ttf);
+ if ( COM_VERB(verb)!=V_MoveTo ) {
+ LogError("Whoops, contours must begin with a move to\n" );
+ ss->first = ss->last = SplinePointCreate(0,0);
+return;
+ }
+ offx = pfed_get_coord(ttf,COM_MOD(verb));
+ offy = pfed_get_coord(ttf,COM_MOD(verb));
+ ss->first = current = SplinePointCreate(offx,offy);
+ forever {
+ verb = getc(ttf);
+ v = COM_VERB(verb); m = COM_MOD(verb);
+ if ( m==3 ) {
+ LogError("Bad data modifier in contour command in 'PfEd'\n" );
+ break;
+ }
+ if ( verb==V_Close || verb==V_End )
+ break;
+ else if ( v>=V_LineTo && v<=V_VLineTo ) {
+ offx = offy = 0;
+ if ( v==V_LineTo ) {
+ offx = pfed_get_coord(ttf,m);
+ offy = pfed_get_coord(ttf,m);
+ } else if ( v==V_HLineTo )
+ offx = pfed_get_coord(ttf,m);
+ else if ( v==V_VLineTo )
+ offy = pfed_get_coord(ttf,m);
+ sp = SplinePointCreate(current->me.x+offx,current->me.y+offy);
+ } else if ( v>=V_QCurveTo && v<=V_QVImplicit ) {
+ int will_be_implicit = true;
+ offx = offy = 0; offx1 = offy1 = 1; /* else implicit points become straight lines too soon */
+ if ( v==V_QCurveTo ) {
+ offx = pfed_get_coord(ttf,m);
+ offy = pfed_get_coord(ttf,m);
+ offx1 = pfed_get_coord(ttf,m);
+ offy1 = pfed_get_coord(ttf,m);
+ will_be_implicit = false;
+ } else if ( v==V_QImplicit ) {
+ offx = pfed_get_coord(ttf,m);
+ offy = pfed_get_coord(ttf,m);
+ } else if ( v==V_QHImplicit ) {
+ offx = pfed_get_coord(ttf,m);
+ } else if ( v==V_QVImplicit ) {
+ offy = pfed_get_coord(ttf,m);
+ }
+
+ current->nextcp.x = current->me.x+offx;
+ current->nextcp.y = current->me.y+offy;
+ current->nonextcp = false;
+ sp = SplinePointCreate(current->nextcp.x+offx1,current->nextcp.y+offy1);
+ sp->prevcp = current->nextcp;
+ sp->noprevcp = false;
+ if ( was_implicit ) {
+ current->me.x = (current->prevcp.x + current->nextcp.x)/2;
+ current->me.y = (current->prevcp.y + current->nextcp.y)/2;
+ SplineRefigure(current->prev);
+ }
+ was_implicit = will_be_implicit;
+ } else if ( v>=V_CurveTo && v<=V_HVCurveTo ) {
+ offx=offy=offx2=offy2=0;
+ if ( v==V_CurveTo ) {
+ offx = pfed_get_coord(ttf,m);
+ offy = pfed_get_coord(ttf,m);
+ offx1 = pfed_get_coord(ttf,m);
+ offy1 = pfed_get_coord(ttf,m);
+ offx2 = pfed_get_coord(ttf,m);
+ offy2 = pfed_get_coord(ttf,m);
+ } else if ( v==V_VHCurveTo ) {
+ offy = pfed_get_coord(ttf,m);
+ offx1 = pfed_get_coord(ttf,m);
+ offy1 = pfed_get_coord(ttf,m);
+ offx2 = pfed_get_coord(ttf,m);
+ } else if ( v==V_HVCurveTo ) {
+ offx = pfed_get_coord(ttf,m);
+ offx1 = pfed_get_coord(ttf,m);
+ offy1 = pfed_get_coord(ttf,m);
+ offy2 = pfed_get_coord(ttf,m);
+ }
+ current->nextcp.x = current->me.x+offx;
+ current->nextcp.y = current->me.y+offy;
+ current->nonextcp = false;
+ sp = SplinePointCreate(current->nextcp.x+offx1+offx2,current->nextcp.y+offy1+offy2);
+ sp->prevcp.x = current->nextcp.x+offx1;
+ sp->prevcp.y = current->nextcp.y+offy1;
+ sp->noprevcp = false;
+ } else {
+ LogError("Whoops, unexpected verb in contour %d.%d\n", v, m );
+ break;
+ }
+ SplineMake(current,sp,type==2);
+ current = sp;
+ }
+ if ( verb==V_Close ) {
+ if ( was_implicit ) {
+ current->me.x = (current->prevcp.x + ss->first->nextcp.x)/2;
+ current->me.y = (current->prevcp.y + ss->first->nextcp.y)/2;
+ }
+ if ( current->me.x==ss->first->me.x && current->me.y==ss->first->me.y ) {
+ current->prev->to = ss->first;
+ ss->first->prev = current->prev;
+ ss->first->prevcp = current->prevcp;
+ ss->first->noprevcp = current->noprevcp;
+ SplinePointFree(current);
+ } else
+ SplineMake(current,ss->first,type==2);
+ ss->last = ss->first;
+ } else {
+ ss->last = current;
+ }
+ SPLCatagorizePoints(ss);
+}
+
+
+static void pfed_read_glyph_layer(FILE *ttf,struct ttfinfo *info,Layer *ly,
+ uint32 base, int type, int version) {
+ int cc, ic, rc, i, j;
+ SplineSet *ss;
+ struct contours { int data_off, name_off; SplineSet *ss; } *contours;
+ int gid;
+ RefChar *last, *cur;
+
+ fseek(ttf,base,SEEK_SET);
+ cc = getushort(ttf);
+ rc = 0;
+ if ( version==1 )
+ rc = getushort(ttf);
+ ic = getushort(ttf);
+ contours = galloc(cc*sizeof(struct contours));
+ for ( i=0; i<cc; ++i ) {
+ contours[i].data_off = getushort(ttf);
+ contours[i].name_off = getushort(ttf);
+ }
+ last = NULL;
+ for ( i=0; i<rc; ++i ) {
+ cur = RefCharCreate();
+ for ( j=0; j<6; ++j )
+ cur->transform[j] = getlong(ttf)/32768.0;
+ gid = getushort(ttf);
+ cur->sc = info->chars[gid];
+ cur->orig_pos = gid;
+ cur->unicode_enc = cur->sc->unicodeenc;
+ if ( last==NULL )
+ ly->refs = cur;
+ else
+ last->next = cur;
+ last = cur;
+ }
+
+ ss = ly->splines; /* Only relevant for spiros where they live in someone else's layer */
+ for ( i=0; i<cc; ++i ) {
+ if ( type!=1 ) { /* Not spiros */
+ contours[i].ss = chunkalloc(sizeof(SplineSet));
+ if ( i==0 )
+ ly->splines = contours[i].ss;
+ else
+ contours[i-1].ss->next = contours[i].ss;
+ if ( contours[i].name_off!=0 )
+ contours[i].ss->contour_name = pfed_read_utf8(ttf,base+contours[i].name_off);
+ pfed_read_normal_contour(ttf,contours[i].ss,base+contours[i].data_off,type);
+ }
+ }
+ free(contours);
+}
+
+static void pfed_readguidelines(FILE *ttf,struct ttfinfo *info,uint32 base) {
+ int i,v,h,off;
+ int version;
+ SplinePoint *sp, *nsp;
+ SplineSet *ss;
+
+ fseek(ttf,base,SEEK_SET);
+ version = getushort(ttf);
+ if ( version>1 )
+return; /* Bad version number */
+ v = getushort(ttf);
+ h = getushort(ttf);
+ (void) getushort(ttf);
+ off = getushort(ttf);
+
+ if ( off!=0 ) {
+ pfed_read_glyph_layer(ttf,info,&info->guidelines,base+off,info->to_order2?2:3,version);
+ } else {
+ struct npos { int pos; int offset; } *vs, *hs;
+ vs = galloc(v*sizeof(struct npos));
+ hs = galloc(h*sizeof(struct npos));
+ for ( i=0; i<v; ++i ) {
+ vs[i].pos = (short) getushort(ttf);
+ vs[i].offset = getushort(ttf);
+ }
+ for ( i=0; i<h; ++i ) {
+ hs[i].pos = (short) getushort(ttf);
+ hs[i].offset = getushort(ttf);
+ }
+ for ( i=0; i<v; ++i ) {
+ sp = SplinePointCreate(vs[i].pos,-info->emsize);
+ nsp = SplinePointCreate(vs[i].pos,2*info->emsize);
+ SplineMake(sp,nsp,info->to_order2);
+ ss = chunkalloc(sizeof(SplineSet));
+ ss->first = sp; ss->last = nsp;
+ if ( vs[i].offset!=0 )
+ ss->contour_name = pfed_read_utf8(ttf,base+vs[i].offset);
+ ss->next = info->guidelines.splines;
+ info->guidelines.splines = ss;
+ }
+ for ( i=0; i<h; ++i ) {
+ sp = SplinePointCreate(-info->emsize,hs[i].pos);
+ nsp = SplinePointCreate(2*info->emsize,hs[i].pos);
+ SplineMake(sp,nsp,info->to_order2);
+ ss = chunkalloc(sizeof(SplineSet));
+ ss->first = sp; ss->last = nsp;
+ if ( hs[i].offset!=0 )
+ ss->contour_name = pfed_read_utf8(ttf,base+hs[i].offset);
+ ss->next = info->guidelines.splines;
+ info->guidelines.splines = ss;
+ }
+ SPLCatagorizePoints(info->guidelines.splines);
+ free(vs); free(hs);
+ }
+}
+
+static void pfed_redo_refs(SplineChar *sc,int layer) {
+ RefChar *refs;
+
+ sc->ticked = true;
+ for ( refs=sc->layers[layer].refs; refs!=NULL; refs=refs->next ) {
+ if ( !refs->sc->ticked )
+ pfed_redo_refs(refs->sc,layer);
+ SCReinstanciateRefChar(sc,refs,layer);
+ }
+}
+
+static void pfed_read_layer(FILE *ttf,struct ttfinfo *info,int layer,int type, uint32 base,
+ uint32 start,int version) {
+ uint32 *loca = gcalloc(info->glyph_cnt,sizeof(uint32));
+ int i,j;
+ SplineChar *sc;
+ int rcnt;
+ struct range { int start, last; uint32 offset; } *ranges;
+
+ fseek(ttf,start,SEEK_SET);
+ rcnt = getushort(ttf);
+ ranges = galloc(rcnt*sizeof(struct range));
+ for ( i=0; i<rcnt; ++i ) {
+ ranges[i].start = getushort(ttf);
+ ranges[i].last = getushort(ttf);
+ ranges[i].offset = getlong(ttf);
+ }
+ for ( i=0; i<rcnt; ++i ) {
+ fseek(ttf,base+ranges[i].offset,SEEK_SET);
+ for ( j=ranges[i].start; j<=ranges[i].last; ++j )
+ loca[j] = getlong(ttf);
+ for ( j=ranges[i].start; j<=ranges[i].last; ++j ) {
+ Layer *ly;
+ sc = info->chars[j];
+ ly = &sc->layers[layer];
+ if ( loca[j]!=0 )
+ pfed_read_glyph_layer(ttf,info,ly,base+loca[j],type,version);
+ }
+ }
+ free(ranges); free(loca);
+
+ for ( i=0; i<info->glyph_cnt; ++i ) if ( info->chars[i]!=NULL )
+ info->chars[i]->ticked = false;
+ for ( i=0; i<info->glyph_cnt; ++i ) if ( info->chars[i]!=NULL )
+ pfed_redo_refs(info->chars[i],layer);
+}
+
+static void pfed_readotherlayers(FILE *ttf,struct ttfinfo *info,uint32 base) {
+ int i, l, lcnt, spiro_index, gid;
+ int version;
+ struct layer_info { int type, name_off, data_off, sf_layer; char *name; } *layers;
+ int non_spiro_cnt=0;
+ SplineChar *sc;
+
+ fseek(ttf,base,SEEK_SET);
+ version = getushort(ttf);
+ if ( version>1 )
+return; /* Bad version number */
+ lcnt = getushort(ttf);
+ layers = galloc(lcnt*sizeof(struct layer_info));
+ for ( i=0; i<lcnt; ++i ) {
+ layers[i].type = getushort(ttf);
+ layers[i].name_off = getushort(ttf);
+ layers[i].data_off = getlong(ttf);
+ layers[i].sf_layer = -1;
+ }
+ spiro_index = -1;
+ non_spiro_cnt = 0;
+ for ( i=0; i<lcnt; ++i ) {
+ if ( layers[i].name_off==0 )
+ layers[i].name = copy("Unnamed");
+ else {
+ layers[i].name = pfed_read_utf8(ttf,base+layers[i].name_off);
+ if ( layers[i].type==1 && strcmp(layers[i].name,"Spiro")==0 )
+ spiro_index = i;
+ }
+ if ( layers[i].type==2 || layers[i].type==3 || layers[i].type==0x102 || layers[i].type==0x103 )
+ ++non_spiro_cnt;
+ }
+ if ( spiro_index==-1 ) {
+ for ( i=0; i<lcnt; ++i )
+ if ( layers[i].type==1 ) {
+ spiro_index=i;
+ break;
+ }
+ }
+
+ if ( non_spiro_cnt!=0 ) {
+ info->layer_cnt = non_spiro_cnt+1;
+ info->layers = gcalloc(info->layer_cnt+1,sizeof(LayerInfo));
+ info->layers[ly_back].background = true;
+ info->layers[ly_fore].order2 = info->to_order2;
+ info->layers[ly_fore].background = false;
+ l = i = 0;
+ if ( (layers[i].type&0xff)==1 )
+ ++i;
+ if ( layers[i].type&0x100 ) {
+ /* first layer output is foreground, so it can't replace the background layer */
+ ++info->layer_cnt;
+ l = 2;
+ info->layers[ly_back].order2 = info->to_order2;
+ }
+ for ( ; i<lcnt; ++i ) if ( (layers[i].type&0xff)==2 || (layers[i].type&0xff)==3 ) {
+ info->layers[l].name = layers[i].name;
+ layers[i].name = NULL;
+ layers[i].sf_layer = l;
+ info->layers[l].order2 = (layers[i].type&0xff)==2;
+ info->layers[l].background = (layers[i].type&0x100)?0:1;
+ if ( l==0 ) l=2; else ++l;
+ }
+ if ( info->layer_cnt!=2 ) {
+ for ( gid = 0; gid<info->glyph_cnt; ++gid ) if ((sc=info->chars[gid])!=NULL ) {
+ sc->layers = grealloc(sc->layers,info->layer_cnt*sizeof(Layer));
+ memset(sc->layers+2,0,(info->layer_cnt-2)*sizeof(Layer));
+ sc->layer_cnt = info->layer_cnt;
+ }
+ }
+ }
+ if ( spiro_index!=-1 )
+ pfed_read_layer(ttf,info,ly_fore,layers[spiro_index].type,base,base+layers[spiro_index].data_off,version);
+ for ( i=0; i<lcnt; ++i ) if ( layers[i].sf_layer!=-1 ) {
+ pfed_read_layer(ttf,info,layers[i].sf_layer,layers[i].type&0xff,
+ base,base+layers[i].data_off,version);
+ }
+ for ( i=0; i<lcnt; ++i )
+ free( layers[i].name );
+ free( layers );
+}
+
+void pfed_read(FILE *ttf,struct ttfinfo *info) {
+ int n,i;
+ struct tagoff { uint32 tag, offset; } tagoff[MAX_SUBTABLE_TYPES+30];
+
+ fseek(ttf,info->pfed_start,SEEK_SET);
+
+ if ( getlong(ttf)!=0x00010000 )
+return;
+ n = getlong(ttf);
+ if ( n>=MAX_SUBTABLE_TYPES+30 )
+ n = MAX_SUBTABLE_TYPES+30;
+ for ( i=0; i<n; ++i ) {
+ tagoff[i].tag = getlong(ttf);
+ tagoff[i].offset = getlong(ttf);
+ }
+ for ( i=0; i<n; ++i ) switch ( tagoff[i].tag ) {
+ case fcmt_TAG: case flog_TAG:
+ pfed_readfontcomment(ttf,info,info->pfed_start+tagoff[i].offset, tagoff[i].tag);
+ break;
+ case cvtc_TAG:
+ pfed_readcvtcomments(ttf,info,info->pfed_start+tagoff[i].offset);
+ break;
+ case cmnt_TAG:
+ pfed_readglyphcomments(ttf,info,info->pfed_start+tagoff[i].offset);
+ break;
+ case colr_TAG:
+ pfed_readcolours(ttf,info,info->pfed_start+tagoff[i].offset);
+ break;
+ case GPOS_TAG:
+ pfed_readlookupnames(ttf,info,info->pfed_start+tagoff[i].offset,info->gpos_lookups);
+ break;
+ case GSUB_TAG:
+ pfed_readlookupnames(ttf,info,info->pfed_start+tagoff[i].offset,info->gsub_lookups);
+ break;
+ case layr_TAG:
+ pfed_readotherlayers(ttf,info,info->pfed_start+tagoff[i].offset);
+ break;
+ case guid_TAG:
+ pfed_readguidelines(ttf,info,info->pfed_start+tagoff[i].offset);
+ break;
+ default:
+ LogError( _("Unknown subtable '%c%c%c%c' in 'PfEd' table, ignored\n"),
+ tagoff[i].tag>>24, (tagoff[i].tag>>16)&0xff, (tagoff[i].tag>>8)&0xff, tagoff[i].tag&0xff );
+ break;
+ }
+}
+
+/* 'TeX ' table format is as follows... */
+/* uint32 version number 0x00010000 */
+/* uint32 subtable count */
+/* struct { uint32 tab, offset } tag/offset for first subtable */
+/* struct { uint32 tab, offset } tag/offset for second subtable */
+/* ... */
+
+/* 'TeX ' 'ftpm' font parameter subtable format */
+/* short version number 0 */
+/* parameter count */
+/* array of { 4chr tag, value } */
+
+/* 'TeX ' 'htdp' per-glyph height/depth subtable format */
+/* short version number 0 */
+/* short glyph-count */
+/* array[glyph-count] of { int16 height,depth } */
+
+/* 'TeX ' 'itlc' per-glyph italic correction subtable */
+/* short version number 0 */
+/* short glyph-count */
+/* array[glyph-count] of int16 italic_correction */
+
+/* !!!!!!!!!!! OBSOLETE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/* 'TeX ' 'sbsp' per-glyph sub/super script positioning subtable */
+/* short version number 0 */
+/* short glyph-count */
+/* array[glyph-count] of { int16 sub,super } */
+
+#undef MAX_SUBTABLE_TYPES
+#define MAX_SUBTABLE_TYPES 4
+
+struct TeX_subtabs {
+ int next;
+ struct {
+ FILE *data;
+ uint32 tag;
+ uint32 offset;
+ } subtabs[MAX_SUBTABLE_TYPES];
+};
+
+static uint32 tex_text_params[] = {
+ TeX_Slant,
+ TeX_Space,
+ TeX_Stretch,
+ TeX_Shrink,
+ TeX_XHeight,
+ TeX_Quad,
+ TeX_ExtraSp,
+ 0
+};
+static uint32 tex_math_params[] = {
+ TeX_Slant,
+ TeX_Space,
+ TeX_Stretch,
+ TeX_Shrink,
+ TeX_XHeight,
+ TeX_Quad,
+ TeX_MathSp,
+ TeX_Num1,
+ TeX_Num2,
+ TeX_Num3,
+ TeX_Denom1,
+ TeX_Denom2,
+ TeX_Sup1,
+ TeX_Sup2,
+ TeX_Sup3,
+ TeX_Sub1,
+ TeX_Sub2,
+ TeX_SupDrop,
+ TeX_SubDrop,
+ TeX_Delim1,
+ TeX_Delim2,
+ TeX_AxisHeight,
+ 0};
+static uint32 tex_mathext_params[] = {
+ TeX_Slant,
+ TeX_Space,
+ TeX_Stretch,
+ TeX_Shrink,
+ TeX_XHeight,
+ TeX_Quad,
+ TeX_MathSp,
+ TeX_DefRuleThick,
+ TeX_BigOpSpace1,
+ TeX_BigOpSpace2,
+ TeX_BigOpSpace3,
+ TeX_BigOpSpace4,
+ TeX_BigOpSpace5,
+ 0};
+
+
+/* ************************* The 'TeX ' table ************************* */
+/* ************************* Input ************************* */
+
+static void TeX_readFontParams(FILE *ttf,struct ttfinfo *info,uint32 base) {
+ int i,pcnt;
+ static uint32 *alltags[] = { tex_text_params, tex_math_params, tex_mathext_params };
+ int j,k;
+ uint32 tag;
+ int32 val;
+
+ fseek(ttf,base,SEEK_SET);
+ if ( getushort(ttf)!=0 ) /* Don't know how to read this version of the subtable */
+return;
+ pcnt = getushort(ttf);
+ if ( pcnt==22 ) info->texdata.type = tex_math;
+ else if ( pcnt==13 ) info->texdata.type = tex_mathext;
+ else if ( pcnt>=7 ) info->texdata.type = tex_text;
+ for ( i=0; i<pcnt; ++i ) {
+ tag = getlong(ttf);
+ val = getlong(ttf);
+ for ( j=0; j<3; ++j ) {
+ for ( k=0; alltags[j][k]!=0; ++k )
+ if ( alltags[j][k]==tag )
+ break;
+ if ( alltags[j][k]==tag )
+ break;
+ }
+ if ( j<3 )
+ info->texdata.params[k] = val;
+ }
+}
+
+static void TeX_readHeightDepth(FILE *ttf,struct ttfinfo *info,uint32 base) {
+ int i,gcnt;
+
+ fseek(ttf,base,SEEK_SET);
+ if ( getushort(ttf)!=0 ) /* Don't know how to read this version of the subtable */
+return;
+ gcnt = getushort(ttf);
+ for ( i=0; i<gcnt && i<info->glyph_cnt; ++i ) {
+ int h, d;
+ h = getushort(ttf);
+ d = getushort(ttf);
+ if ( info->chars[i]!=NULL ) {
+ info->chars[i]->tex_height = h;
+ info->chars[i]->tex_depth = d;
+ }
+ }
+}
+
+static void TeX_readItalicCorr(FILE *ttf,struct ttfinfo *info,uint32 base) {
+ int i,gcnt;
+
+ fseek(ttf,base,SEEK_SET);
+ if ( getushort(ttf)!=0 ) /* Don't know how to read this version of the subtable */
+return;
+ gcnt = getushort(ttf);
+ for ( i=0; i<gcnt && i<info->glyph_cnt; ++i ) {
+ int ital;
+ ital = getushort(ttf);
+ if ( info->chars[i]!=NULL ) {
+ info->chars[i]->italic_correction = ital;
+ }
+ }
+}
+
+void tex_read(FILE *ttf,struct ttfinfo *info) {
+ int n,i;
+ struct tagoff { uint32 tag, offset; } tagoff[MAX_SUBTABLE_TYPES+30];
+
+ fseek(ttf,info->tex_start,SEEK_SET);
+
+ if ( getlong(ttf)!=0x00010000 )
+return;
+ n = getlong(ttf);
+ if ( n>=MAX_SUBTABLE_TYPES+30 )
+ n = MAX_SUBTABLE_TYPES+30;
+ for ( i=0; i<n; ++i ) {
+ tagoff[i].tag = getlong(ttf);
+ tagoff[i].offset = getlong(ttf);
+ }
+ for ( i=0; i<n; ++i ) switch ( tagoff[i].tag ) {
+ case CHR('f','t','p','m'):
+ TeX_readFontParams(ttf,info,info->tex_start+tagoff[i].offset);
+ break;
+ case CHR('h','t','d','p'):
+ TeX_readHeightDepth(ttf,info,info->tex_start+tagoff[i].offset);
+ break;
+ case CHR('i','t','l','c'):
+ TeX_readItalicCorr(ttf,info,info->tex_start+tagoff[i].offset);
+ break;
+ default:
+ LogError( _("Unknown subtable '%c%c%c%c' in 'TeX ' table, ignored\n"),
+ tagoff[i].tag>>24, (tagoff[i].tag>>16)&0xff, (tagoff[i].tag>>8)&0xff, tagoff[i].tag&0xff );
+ break;
+ }
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/uiinterface.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/uiinterface.h
new file mode 100644
index 00000000000..81409b72499
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/uiinterface.h
@@ -0,0 +1,511 @@
+/* Copyright (C) 2007,2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _UIINTERFACE_H
+#define _UIINTERFACE_H
+# include "basics.h"
+/* This encapsulates a set of callbacks and stubs. The callbacks get activated*/
+/* when an event happens (a glyph in a font changes for example, then all */
+/* charviews looking at it must be updated), and the stubs provide some simple*/
+/* UI routines: Post an error, etc. */
+
+/* ************************************************************************** */
+/* Basic, low-level UI routines for events we discover deep inside script code*/
+/* ************************************************************************** */
+
+struct ui_interface {
+ /* The following is used to post a fontforge internal error */
+ /* currently it puts up a dlg displaying the error text */
+ void (*ierror)(const char *fmt,...);
+
+ /* The following is a simple dialog to alert the user that s/he has */
+ /* made an error. Currently it posts a modal dlg and waits for the */
+ /* user to dismiss it */
+ /* The title argument is the window's title. The error argument is the */
+ /* text of the message. It may contain printf formatting. It may contain */
+ /* newlines to force line breaks -- even if it doesn't contain new lines */
+ /* the routine will wrap the text if a line is too long */
+ void (*post_error)(const char *title,const char *error,...);
+
+ /* The following is used to post a warning message in such a way that it */
+ /* will not impede the user. Currently it creates a little window at the */
+ /* bottom right of the screen and writes successive messages there */
+ void (*logwarning)(const char *fmt,...);
+
+ /* The following is another way to post a warning message in such a way */
+ /* that it will not impede the user. Currently it pops up a little */
+ /* non-modal dlg which vanishes after a minute or two (or if the user */
+ /* dismisses it, of course */
+ void (*post_warning)(const char *title,const char *statement,...);
+
+ /* Occasionally we we be deep in a non-ui routine and we find we must ask */
+ /* the user a question. In this routine the choices are displayed as */
+ /* buttons, one button is the default, another is a cancel choice */
+ int (*ask)(const char *title, const char **answers,
+ int def, int cancel,const char *question,...);
+
+ /* Similar to the above, except here the choices are presented as a */
+ /* scrolled list. Return -1 if the user cancels */
+ int (*choose)(const char *title, const char **answers,
+ int def, int cancel,const char *question,...);
+
+ /* Multiple things can be selected, sel is an in/out parameter, one byte */
+ /* per entry in the choice array. 0=> not selected, 1=>selected */
+ int (*choose_multiple)(char *title, const char **choices,char *sel,
+ int cnt, char *buts[2], const char *question,...);
+
+ /* Here we want a string. We are passed a default answer (or NULL) */
+ /* The return is NULL on cancel, otherwise a string which must be freed */
+ char *(*ask_string)(const char *title,
+ const char *def,const char *question,...);
+ /* Same as above, except for entering a password */
+ char *(*ask_password)(const char *title,
+ const char *def,const char *question,...);
+
+ /* The next two routines are only used in the python interface to provide */
+ /* a python script running in ff a way to open a file */
+ /* Arguments are a window title for the dlg, a default file (or NULL), and */
+ /* an initial filter (unix wildcards) or NULL */
+ char *(*open_file)(const char *title, const char *defaultfile,
+ const char *initial_filter);
+ char *(*saveas_file)(const char *title, const char *defaultfile,
+ const char *initial_filter);
+
+ /* These routines are for a progress indicator */
+ void (*progress_start)(int delay, const char *title, const char *line1,
+ const char *line2, int tot, int stages);
+ void (*progress_end)(void);
+ void (*progress_show)(void);
+ void (*progress_enable_stop)(int);
+ int (*progress_next)(void);
+ int (*progress_next_stage)(void);
+ int (*progress_increment)(int);
+ void (*progress_change_line1)(const char *);
+ void (*progress_change_line2)(const char *);
+ void (*progress_pause)(void);
+ void (*progress_resume)(void);
+ void (*progress_change_stages)(int);
+ void (*progress_change_total)(int);
+ int (*progress_reset)(void);
+
+ void (*allow_events)(void);
+
+ /* These next few provide friendly names of various opentype tags */
+ /* The ui version will probably be translated, while the non-ui list */
+ /* will probably not. The distinction isn't necessary, but is present in ff*/
+ const char *(*strid)(int);
+ const char *(*mslang)(int);
+
+ /* pops up a dlg asking user whether to do remove overlap (and other stuff)*/
+ /* when loading an eps file with strokes, etc. */
+ int (*stroke_flags)(void);
+};
+extern struct ui_interface *ui_interface;
+
+#define IError (ui_interface->ierror)
+#define LogError (ui_interface->logwarning)
+#define ff_post_notice (ui_interface->post_warning)
+#define ff_post_error (ui_interface->post_error)
+#define ff_ask (ui_interface->ask)
+#define ff_choose (ui_interface->choose)
+#define ff_choose_multiple (ui_interface->choose_multiple)
+#define ff_ask_string (ui_interface->ask_string)
+#define ff_ask_password (ui_interface->ask_password)
+
+#define ff_open_filename (ui_interface->open_file)
+#define ff_save_filename (ui_interface->saveas_file)
+
+#define ff_progress_start_indicator (ui_interface->progress_start)
+#define ff_progress_end_indicator (ui_interface->progress_end)
+#define ff_progress_show (ui_interface->progress_show)
+#define ff_progress_enable_stop (ui_interface->progress_enable_stop)
+#define ff_progress_next (ui_interface->progress_next)
+#define ff_progress_next_stage (ui_interface->progress_next_stage)
+#define ff_progress_increment (ui_interface->progress_increment)
+#define ff_progress_change_line1 (ui_interface->progress_change_line1)
+#define ff_progress_change_line2 (ui_interface->progress_change_line2)
+#define ff_progress_pause_timer (ui_interface->progress_pause)
+#define ff_progress_resume_timer (ui_interface->progress_resume)
+#define ff_progress_change_stages (ui_interface->progress_change_stages)
+#define ff_progress_change_total (ui_interface->progress_change_total)
+#define ff_progress_reset (ui_interface->progress_reset)
+
+#define ff_progress_allow_events (ui_interface->allow_events)
+
+#define TTFNameIds (ui_interface->strid)
+#define MSLangString (ui_interface->mslang)
+
+#define PsStrokeFlagsDlg (ui_interface->stroke_flags)
+
+void FF_SetUiInterface(struct ui_interface *uii);
+
+/* ************************************************************************** */
+/* Preferences */
+/* ************************************************************************** */
+struct val;
+
+struct prefs_interface {
+ void (*save_prefs)(int not_if_running_script);
+ void (*load_prefs)(void);
+ int (*get_prefs)(char *name,struct val *value);
+ int (*set_prefs)(char *name,struct val *val1, struct val *val2);
+ char *(*get_exe_share_dir)(void);
+ void (*init_prefs)(void);
+};
+extern struct prefs_interface *prefs_interface;
+
+#define SavePrefs (prefs_interface->save_prefs)
+#define LoadPrefs (prefs_interface->load_prefs)
+#define GetPrefs (prefs_interface->get_prefs)
+#define SetPrefs (prefs_interface->set_prefs)
+#define getFontForgeShareDir (prefs_interface->get_exe_share_dir)
+#define SetDefaults (prefs_interface->init_prefs)
+
+void FF_SetPrefsInterface(struct prefs_interface *prefsi);
+
+/* ************************************************************************** */
+/* Updating glyph windows */
+/* ************************************************************************** */
+
+struct splinechar;
+struct layer;
+
+struct sc_interface {
+ /* Update all windows looking at this glyph */
+ void (*update_all)(struct splinechar *);
+
+ /* Background images or kerning info have changed for this glyph and */
+ /* all windows displaying them need to be refreshed */
+ void (*out_of_date_background)(struct splinechar *);
+
+ /* The name or code point or encoding of this glyph has changed */
+ /* update all window titles of any windows looking at us */
+ void (*refresh_titles)(struct splinechar *);
+
+ /* The hints of the glyph have changed */
+ void (*hints_changed)(struct splinechar *);
+
+ /* Mark the glyph as changed, and force an update */
+ void (*glyph_changed_update)(struct splinechar *,int layer);
+
+ /* As above, except this time the change might take the glyph back to */
+ /* an "unchanged" state (ie. an Undo) */
+ void (*glyph__changed_update)(struct splinechar *,int layer,int);
+
+ /* The glyph's instructions have changed, so any dlgs looking at */
+ /* our instructions need to be updated */
+ void (*instructions_changed)(struct splinechar *sc);
+
+ /* We are removing this glyph (or something like it), get rid of any */
+ /* glyph outline windows which display it */
+ void (*close_all_windows)(struct splinechar *);
+
+ /* Called when a multilayered glyph increases its layer count */
+ /* the charview needs to add more layers to its layer window, etc. */
+ void (*more_layers)(struct splinechar *, struct layer *);
+};
+extern struct sc_interface *sc_interface;
+
+#define SCUpdateAll (sc_interface->update_all)
+#define SCOutOfDateBackground (sc_interface->out_of_date_background)
+#define SCRefreshTitles (sc_interface->refresh_titles)
+#define SCHintsChanged (sc_interface->hints_changed)
+#define _SCCharChangedUpdate (sc_interface->glyph__changed_update)
+#define SCCharChangedUpdate (sc_interface->glyph_changed_update)
+#define SCMarkInstrDlgAsChanged (sc_interface->instructions_changed)
+#define SCCloseAllViews (sc_interface->close_all_windows)
+#define SCMoreLayers (sc_interface->more_layers)
+
+void FF_SetSCInterface(struct sc_interface *sci);
+
+/* ************************************************************************** */
+/* Updating glyph windows 2 */
+/* ************************************************************************** */
+
+struct charviewbase;
+struct splinefont;
+
+struct cv_interface {
+ /* Update all windows looking at what this char window looks at */
+ /* which might be a glyph, or perhaps the grid layer */
+ /* And mark as changed */
+ void (*glyph_changed_update)(struct charviewbase *);
+ void (*_glyph_changed_update)(struct charviewbase *, int);
+
+ /* A glyph's name has changed find all charviews with tabs with that name */
+ /* and update those tabs */
+ void (*glyph_name_change)(struct splinefont *sf, char *oldname, char *newname);
+
+ /* We've added a layer to a font */
+ void (*layer_palette_check)(struct splinefont *sf);
+};
+extern struct cv_interface *cv_interface;
+
+#define CVCharChangedUpdate (cv_interface->glyph_changed_update)
+#define _CVCharChangedUpdate (cv_interface->_glyph_changed_update)
+#define CVGlyphRenameFixup (cv_interface->glyph_name_change)
+#define CVLayerPaletteCheck (cv_interface->layer_palette_check)
+
+void FF_SetCVInterface(struct cv_interface *cvi);
+
+/* ************************************************************************** */
+/* Updating bitmap windows */
+/* ************************************************************************** */
+
+struct bdfchar;
+
+struct bc_interface {
+ /* Update all windows looking at this bitmap glyph */
+ /* And mark as changed */
+ void (*glyph_changed_update)(struct bdfchar *);
+
+ /* Force a refresh on all open bitmap windows of this glyph */
+ void (*refresh_all)(struct bdfchar *);
+
+ /* Destroy all open bitmap windows of this glyph */
+ void (*destroy_all)(struct bdfchar *);
+};
+extern struct bc_interface *bc_interface;
+
+#define BCCharChangedUpdate (bc_interface->glyph_changed_update)
+#define BCRefreshAll (bc_interface->refresh_all)
+#define BCDestroyAll (bc_interface->destroy_all)
+
+void FF_SetBCInterface(struct bc_interface *bci);
+
+/* ************************************************************************** */
+/* Access to metrics views */
+/* ************************************************************************** */
+
+struct metricsview;
+struct splinefont;
+
+struct mv_interface {
+ /* Number of glyphs displayed in the view */
+ int (*glyph_cnt)(struct metricsview *);
+
+ /* Access to the i'th member */
+ struct splinechar *(*get_glyph)(struct metricsview *,int);
+
+ /* Kerning information for this font has changed. Remetric the metric views*/
+ /* Now-a-days, call this when any kind of lookup information changes, not */
+ /* just kerning */
+ void (*rekern)(struct splinefont *);
+
+ /* Close any metrics views associated with this font */
+ void (*sf_close_metrics)(struct splinefont *sf);
+};
+extern struct mv_interface *mv_interface;
+
+#define MVGlyphCount (mv_interface->glyph_cnt)
+#define MVGlyphIndex (mv_interface->get_glyph)
+#define MVReKernAll (mv_interface->rekern)
+#define MVDestroyAll (mv_interface->sf_close_metrics)
+
+void FF_SetMVInterface(struct mv_interface *mvi);
+
+/* ************************************************************************** */
+/* Access to font info */
+/* ************************************************************************** */
+struct otlookup;
+
+struct fi_interface {
+ /* Insert a new lookup into the fontinfo lookup list */
+ void (*insert_lookup)(struct splinefont *, struct otlookup *);
+
+ /* Merge lookup in from another font */
+ void (*copy_into)(struct splinefont *, struct splinefont *,
+ struct otlookup *, struct otlookup *, int, struct otlookup *);
+
+ /* Removes any font info window for this font */
+ void (*destroy)(struct splinefont *);
+};
+extern struct fi_interface *fi_interface;
+
+#define FISortInsertLookup (fi_interface->insert_lookup)
+#define FIOTLookupCopyInto (fi_interface->copy_into)
+#define FontInfo_Destroy (fi_interface->destroy)
+
+void FF_SetFIInterface(struct fi_interface *fii);
+
+/* ************************************************************************** */
+/* Updating font windows */
+/* ************************************************************************** */
+
+struct fontviewbase;
+struct bdffont;
+
+struct fv_interface {
+ /* Create a new font view. Whatever that may entail */
+ struct fontviewbase *(*create)(struct splinefont *,int hide);
+
+ /* Create a new font view but without attaching it to a window */
+ struct fontviewbase *(*_create)(struct splinefont *);
+
+ /* Free a font view (we assume all windows have already been destroyed) */
+ void (*close)(struct fontviewbase *);
+
+ /* Free a font view (we assume all windows have already been destroyed) */
+ void (*free)(struct fontviewbase *);
+
+ /* Set the window title of this fontview */
+ void (*set_title)(struct fontviewbase *);
+
+ /* Set the window title of all fontviews associated with this font */
+ void (*set_titles)(struct splinefont *);
+
+ /* Refresh all displays of all fontviews associated with this font */
+ void (*refresh_all)(struct splinefont *);
+
+ /* Reformat this particular fontview (after encoding change, etc) */
+ void (*reformat_one)(struct fontviewbase *);
+
+ /* Reformat all fontviews associated with this font */
+ void (*reformat_all)(struct splinefont *);
+
+ /* The active layer has changed. Possibly because the old one was deleted */
+ void (*layer_changed)(struct fontviewbase *);
+
+ /* toggle the change indicator of this glyph in the font view */
+ void (*flag_glyph_changed)(struct splinechar *);
+
+ /* Retrieve the window's size in rows and columns */
+ int (*win_info)(struct fontviewbase *, int *cols, int *rows);
+
+ /* Is this font currently open? (It was open once, this check is to make */
+ /* sure the user hasn't closed it since they copied from it -- so we can */
+ /* follow references appropriately if the font we are pasting into doesn't*/
+ /* have the needed glyph */
+ int (*font_is_active)(struct splinefont *);
+
+ /* Sometimes we just need a fontview, any fontview as a last resort fallback*/
+ struct fontviewbase *(*first_font)(void);
+
+ /* Append this fontview to the list of them */
+ struct fontviewbase *(*append)(struct fontviewbase *);
+
+ /* Look through all loaded fontviews and see if any contains a font */
+ /* which lives in the given filename */
+ struct splinefont *(*font_of_filename)(const char *);
+
+ /* We've just added some extra encoding slots, which means we may need */
+ /* to increase the number of rows in the fontview display and perhaps */
+ /* adjust its scrollbar */
+ void (*extra_enc_slots)(struct fontviewbase *,int new_enc_max);
+
+ /* My fontviews contain a glyph cache (a BDFPieceMeal font) whenever */
+ /* more glyphs are added to the font, more bitmap glyph slots need to */
+ /* be added to the font cache */
+ void (*bigger_glyph_cache)(struct fontviewbase *,int new_glyph_cnt);
+
+ /* If we want to change the font displayed in a fontview */
+ void (*change_display_bitmap)(struct fontviewbase *, struct bdffont *);
+
+ /* We just deleted the active bitmap, so switch to a rasteriztion of the outlines */
+ void (*display_filled)(struct fontviewbase *);
+
+ /* When we revert a font we need to change the alegence of all outline */
+ /* glyph windows to the new value of the font */
+ void (*reattach_cvs)(struct splinefont *old, struct splinefont *new);
+
+ /* deselect any selected glyphs */
+ void (*deselect_all)(struct fontviewbase *);
+
+ /* Scroll (or whatever) the fontview so that the desired */
+ /* gid is displayed */
+ void (*display_gid)(struct fontviewbase *,int gid);
+
+ /* Scroll (or whatever) the fontview so that the desired */
+ /* encoding is displayed */
+ void (*display_enc)(struct fontviewbase *,int enc);
+
+ /* Scroll (or whatever) the fontview so that the desired */
+ /* glyph is displayed */
+ void (*select_gid)(struct fontviewbase *,int gid);
+
+ /* Close any open glyph instruction windows in the font */
+ int (*close_all_instrs)(struct splinefont *);
+};
+extern struct fv_interface *fv_interface;
+
+#define FontViewCreate (fv_interface->create)
+#define _FontViewCreate (fv_interface->_create)
+#define FontViewClose (fv_interface->close)
+#define FontViewFree (fv_interface->free)
+#define FVSetTitle (fv_interface->set_title)
+#define FVSetTitles (fv_interface->set_titles)
+#define FVRefreshAll (fv_interface->refresh_all)
+#define FontViewReformatOne (fv_interface->reformat_one)
+#define FontViewReformatAll (fv_interface->reformat_all)
+#define FontViewLayerChanged (fv_interface->layer_changed)
+#define FVToggleCharChanged (fv_interface->flag_glyph_changed)
+#define FVWinInfo (fv_interface->win_info)
+#define SFIsActive (fv_interface->font_is_active)
+#define FontViewFirst (fv_interface->first_font)
+#define FVAppend (fv_interface->append)
+#define FontWithThisFilename (fv_interface->font_of_filename)
+#define FVAdjustScrollBarRows (fv_interface->extra_enc_slots)
+#define FVBiggerGlyphCache (fv_interface->bigger_glyph_cache)
+#define FVChangeDisplayBitmap (fv_interface->change_display_bitmap)
+#define FVShowFilled (fv_interface->display_filled)
+#define FVReattachCVs (fv_interface->reattach_cvs)
+#define FVDisplayGID (fv_interface->display_gid)
+#define FVDisplayEnc (fv_interface->display_enc)
+#define FVChangeGID (fv_interface->select_gid)
+#define SFCloseAllInstrs (fv_interface->close_all_instrs)
+
+void FF_SetFVInterface(struct fv_interface *fvi);
+
+/* ************************************************************************** */
+/* Clibboard access (copy/paste) */
+/* ************************************************************************** */
+
+struct clip_interface {
+ /* Announce we own the clipboard selection */
+ void (*grab_clip)(void);
+ /* Either place data in the clipboard of a given type, or */
+ /* provide a routine to call which will give data on demand */
+ /* (and another routine to clean things up) */
+ void (*add_data_type)(const char *type, void *data, int cnt, int size,
+ void *(*gendata)(void *,int32 *len), void (*freedata)(void *));
+ /* Does the clipboard contain something of the given type? */
+ int (*clip_has_type)(const char *mimetype);
+ /* Ask for the clipboard, and waits (and returns) for the response */
+ void *(*request_clip)(const char *mimetype,int *len);
+
+};
+extern struct clip_interface *clip_interface;
+
+#define ClipboardGrab (clip_interface->grab_clip)
+#define ClipboardAddDataType (clip_interface->add_data_type)
+#define ClipboardRequest (clip_interface->request_clip)
+#define ClipboardHasType (clip_interface->clip_has_type)
+
+void FF_SetClipInterface(struct clip_interface *clipi);
+
+extern const char *NOUI_TTFNameIds(int id);
+extern const char *NOUI_MSLangString(int language);
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/unicoderange.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/unicoderange.h
index 48df4b7b1c7..02dca59b0cd 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/unicoderange.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/unicoderange.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006,2007 by George Williams */
+/* Copyright (C) 2006-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -36,12 +36,3 @@ extern struct unicoderange {
int actual; /* Count of assigned codepoints in this range */
} unicoderange[];
-struct rangeinfo {
- struct unicoderange *range;
- int cnt;
- int actual;
-};
-
-enum ur_flags { ur_includeempty = 1, ur_sortbyname = 2, ur_sortbyunicode = 4 };
-extern struct rangeinfo *SFUnicodeRanges(SplineFont *sf, enum ur_flags flags);
-int unicoderange_cnt;
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/views.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/views.h
index 1b50d36de63..a3a02cb6314 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/fontforge/views.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/views.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -27,22 +27,14 @@
#ifndef _VIEWS_H
#define _VIEWS_H
-#include "splinefont.h"
+#include "baseviews.h"
-#if defined(FONTFORGE_CONFIG_GTK)
-# include <gtk/gtk.h>
-# include <gdk/gdk.h>
-#elif defined(FONTFORGE_CONFIG_GDRAW)
-# include <ggadget.h>
-#else
-# include <ggadget.h> /* Need GImage, gettext, etc. even if no UI */
-#endif
+#include <ggadget.h>
struct gfi_data;
struct contextchaindlg;
struct statemachinedlg;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
extern struct cvshows {
int showfore, showback, showgrids, showhhints, showvhints, showdhints;
int showpoints, showfilled;
@@ -57,142 +49,44 @@ extern struct cvshows {
int showcpinfo;
int showtabs; /* with the names of former glyphs */
int showsidebearings;
+ int showrefnames;
+ int snapoutlines;
+ int showalmosthvlines;
+ int showalmosthvcurves;
+ int hvoffset;
} CVShows;
extern struct bvshows {
int showfore, showoutline, showgrid;
int lastpixelsize;
} BVShows;
-#endif
-
-typedef struct drect {
- real x, y;
- real width, height;
-} DRect;
-
-typedef struct pressedOn {
- int x,y; /* screen location of the press */
- real cx, cy; /* Translated into character space */
- SplinePoint *sp;
- unsigned int nextcp: 1; /* Is the cursor on the "next" control point of */
- unsigned int prevcp: 1; /* the spline point, or the "prev" control point */
- unsigned int anysel: 1; /* did we hit anything? */
-/* unsigned int width: 1; / * we're moving the width rather than a spline */
-/* unsigned int vwidth: 1; / * we're moving the width rather than a spline */
- unsigned int pressed: 1;
- unsigned int rubberbanding: 1;
- unsigned int rubberlining: 1;
- unsigned int transany: 1;
- unsigned int transanyrefs: 1;
- Spline *spline;
- real t; /* location on the spline where we pressed */
- RefChar *ref;
- SplinePointList *spl; /* containing spline or point */
- ImageList *img;
- AnchorPoint *ap;
- float ex, ey; /* end of last rubber band rectangle */
- BasePoint constrain; /* Point to which we constrain movement */
- BasePoint cp; /* Original control point position */
-} PressedOn;
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-/* Note: These are ordered as they are displayed in the tools palette */
-enum cvtools { cvt_pointer, cvt_magnify,
- cvt_freehand, cvt_hand,
- cvt_curve, cvt_corner, cvt_tangent, cvt_pen,
- cvt_knife, cvt_ruler,
- cvt_scale, cvt_flip,
- cvt_rotate, cvt_skew,
- cvt_3d_rotate, cvt_perspective,
- cvt_rect, cvt_poly,
- cvt_elipse, cvt_star,
- cvt_minify, cvt_max=cvt_minify,
- cvt_none = -1};
-#endif
-enum bvtools { bvt_pointer, bvt_magnify,
- bvt_pencil, bvt_line,
- bvt_shift, bvt_hand,
- bvt_minify, bvt_eyedropper, bvt_max=bvt_eyedropper,
- bvt_setwidth, bvt_setvwidth,
- bvt_rect, bvt_filledrect,
- bvt_elipse, bvt_filledelipse,
- bvt_max2 = bvt_filledelipse,
- bvt_none = -1,
- bvt_fliph=0, bvt_flipv, bvt_rotate90cw, bvt_rotate90ccw, bvt_rotate180, bvt_skew, bvt_transmove };
-enum drawmode { dm_grid, dm_back, dm_fore, dm_max };
-
-typedef struct bvtfunc {
- enum bvtools func;
- int x,y; /* used by skew and move */
-} BVTFunc;
-
-struct freetype_raster {
- int16 rows, cols;
- int16 as, lb;
- int16 bytes_per_row;
- int16 num_greys;
- uint8 *bitmap;
-};
-enum byte_types { bt_instr, bt_cnt, bt_byte, bt_wordhi, bt_wordlo, bt_impliedreturn };
-struct instrdata {
- uint8 *instrs;
- int instr_cnt, max;
- uint8 *bts;
- unsigned int changed: 1;
- unsigned int in_composit: 1;
- SplineFont *sf;
- SplineChar *sc;
- uint32 tag;
- struct instrdlg *id;
- struct instrdata *next;
-};
+enum debug_wins { dw_registers=0x1, dw_stack=0x2, dw_storage=0x4, dw_points=0x8,
+ dw_cvt=0x10, dw_raster=0x20, dw_gloss=0x40 };
struct instrinfo {
-#if defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *v;
- GtkWidget *vsb;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
+ int isel_pos;
+ int16 lheight,lpos;
+ char *scroll, *offset;
GWindow v;
GGadget *vsb;
-#else
- int v;
-#endif
int16 sbw;
int16 vheight, vwidth;
- int16 lheight,lpos;
int16 lstopped;
int16 as, fh;
struct instrdata *instrdata;
-#if defined(FONTFORGE_CONFIG_GDRAW)
GFont *gfont;
-#endif
- int isel_pos;
unsigned int showaddr: 1;
unsigned int showhex: 1;
unsigned int mousedown: 1;
void *userdata;
void (*selection_callback)(struct instrinfo *,int ip);
int (*bpcheck)(struct instrinfo *,int ip);
-#if defined(FONTFORGE_CONFIG_GTK)
- int (*handle_char)(struct instrinfo *,GdkEvent *e);
-#elif defined(FONTFORGE_CONFIG_GDRAW)
int (*handle_char)(struct instrinfo *,GEvent *e);
-#endif
};
-enum debug_wins { dw_registers=0x1, dw_stack=0x2, dw_storage=0x4, dw_points=0x8,
- dw_cvt=0x10, dw_raster=0x20, dw_gloss=0x40 };
-
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
typedef struct debugview {
struct debugger_context *dc; /* Local to freetype.c */
-#if defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *dv, *v;
- GtkWidget *regs, *stack, *storage, *points, *cvt, *raster, *gloss; /* Order matters */
- GtkWidget *points_v;
- GtkWidget *cvtsb, *pts_vsb, *glosssb, *storagesb, *regsb, *stacksb;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
GWindow dv, v;
/* Windows for twilight points, cvt, registers, stack, storage, stack gloss */
GWindow regs, stack, storage, points, cvt, raster, gloss; /* order matters */
@@ -203,12 +97,11 @@ typedef struct debugview {
GGadget *storagesb;
GGadget *regsb;
GGadget *stacksb;
-#endif
struct instrdata id;
struct instrinfo ii;
int dwidth, toph;
struct charview *cv;
- double scale;
+ double scalex, scaley;
int pts_head, cvt_offtop, gloss_offtop, storage_offtop, stack_offtop, reg_offtop;
int points_offtop;
@@ -216,17 +109,14 @@ typedef struct debugview {
uint8 initialbytes[4];
struct reflist { RefChar *ref; struct reflist *parent; } *active_refs;
int last_npoints;
+ int layer;
} DebugView;
enum dv_coderange { cr_none=0, cr_fpgm, cr_prep, cr_glyph }; /* cleverly chosen to match ttobjs.h */
-#endif
-
-#if !defined( FONTFORGE_CONFIG_NO_WINDOWING_UI ) || defined(_DEFINE_SEARCHVIEW_)
-#define FORMER_MAX 10
typedef struct charview {
- SplineChar *sc;
- unsigned int showback:1;
+ CharViewBase b;
+ uint32 showback[BACK_LAYER_MAX/32];
unsigned int showfore:1;
unsigned int showgrids:1;
unsigned int showhhints:1;
@@ -248,13 +138,14 @@ typedef struct charview {
unsigned int markpoi:1;
unsigned int needsrasterize:1; /* Rasterization (of fill or fontview) needed on mouse up */
unsigned int recentchange:1; /* a change happened in the grids or background. don't need to rasterize */
- unsigned int drawmode:2;
unsigned int info_within: 1; /* cursor is within main window */
unsigned int back_img_out_of_date: 1; /* Force redraw of back image pixmap */
unsigned int cntrldown:1;
unsigned int joinvalid:1;
unsigned int widthsel:1;
unsigned int vwidthsel:1;
+ unsigned int icsel:1;
+ unsigned int tah_sel:1;
unsigned int inactive:1; /* When in a search view */
unsigned int show_ft_results: 1; /* 32 */
unsigned int coderange: 2; /* For the debugger */
@@ -262,16 +153,16 @@ typedef struct charview {
unsigned int showcpinfo: 1;
unsigned int showtabs: 1;
unsigned int showsidebearings: 1;
- Layer *layerheads[dm_max];
+ unsigned int showing_spiro_pt_menu: 1;
+ unsigned int ruler_pressed: 1;
+ unsigned int ruler_pressedv: 1;
+ unsigned int showrefnames: 1;
+ unsigned int snapoutlines: 1;
+ unsigned int showalmosthvlines: 1;
+ unsigned int showalmosthvcurves: 1;
+ int hvoffset; /* for showalmosthvlines */
+ int layers_off_top;
real scale;
-#if defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *gw, *v;
- GtkWidget *vsb, *hsb, *mb, *tabs;
- PangoFont *small, *normal;
- GtkWindow *icon; /* Pixmap? */
- guint pressed; /* glib timer id */
- GtkWindow backimgs; /* Pixmap? */
-#elif defined(FONTFORGE_CONFIG_GDRAW)
GWindow gw, v;
GGadget *vsb, *hsb, *mb, *tabs;
GFont *small, *normal;
@@ -281,35 +172,23 @@ typedef struct charview {
GTimer *pressed;
GWindow backimgs;
GIC *gic;
-#else
- void *gw, *v;
-#endif
+ GIC *gwgic;
int width, height;
int xoff, yoff;
int mbh, infoh, rulerh;
- int16 sas, sfh, nas, nfh;
+ int16 sas, sfh, sdh, nas, nfh;
BasePoint info;
SplinePoint *info_sp;
-#if defined(FONTFORGE_CONFIG_GTK)
- GdkPoint e; /* mouse location */
- GdkPoint olde;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
+ Spline *info_spline;
+ real info_t;
GPoint e; /* mouse location */
GPoint olde;
-#endif
BasePoint last_c;
BDFChar *filled;
-#ifdef FONTFORGE_CONFIG_GDRAW
- GImage gi;
-#endif
- struct charview *next;
- struct fontview *fv;
+ GImage gi; /* used for fill bitmap only */
int enc;
EncMap *map_of_enc; /* Only use for comparison against fontview's map to see if our enc be valid */
/* Will not be updated when fontview is reencoded */
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
- PressedOn p;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
SplinePoint *lastselpt;
/*GWindow tools, layers;*/
int8 b1_tool, cb1_tool, b2_tool, cb2_tool; /* Button 3 does a popup */
@@ -337,51 +216,38 @@ typedef struct charview {
struct jamodisplay *jamodisplay;
#endif
real oldwidth, oldvwidth;
+ int16 oldic, oldtah;
#if _ModKeysAutoRepeat
-# if defined(FONTFORGE_CONFIG_GTK)
-# elif defined(FONTFORGE_CONFIG_GDRAW)
GTimer *autorpt;
int keysym, oldstate;
int oldkeyx, oldkeyy;
GWindow oldkeyw;
-# endif
#endif
- struct searchview *searcher; /* The sv within which this view is embedded (if it is) */
PST *lcarets;
int16 nearcaret;
/* freetype results display */
- int16 ft_dpi, ft_ppem, ft_gridfitwidth, ft_depth;
- real ft_pointsize;
- SplineSet *gridfit;
+ int16 ft_dpi, ft_ppemy, ft_ppemx, ft_depth;
+ real ft_pointsizey, ft_pointsizex;
struct freetype_raster *raster, *oldraster;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
DebugView *dv;
-#endif
uint32 mmvisible;
char *former_names[FORMER_MAX];
int former_cnt;
AnchorPoint *apmine, *apmatch;
SplineChar *apsc;
+ int guide_pos;
} CharView;
-#endif
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
typedef struct bitmapview {
BDFChar *bc;
BDFFont *bdf;
struct fontview *fv;
EncMap *map_of_enc;
int enc;
-#if defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *v;
- GtkWidget *gw;
- GtkWidget *vsb, *hsb, *mb;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
GWindow gw, v;
GGadget *vsb, *hsb, *mb;
GGadget *recalc;
GFont *small;
-#endif
int xoff, yoff;
int width, height;
int infoh, mbh;
@@ -405,11 +271,8 @@ typedef struct bitmapview {
int event_x, event_y;
int16 sas, sfh;
#if _ModKeysAutoRepeat
-# if defined(FONTFORGE_CONFIG_GTK)
-# elif defined(FONTFORGE_CONFIG_GDRAW)
GTimer *autorpt;
int keysym, oldstate;
-# endif
#endif
int color; /* for greyscale fonts (between 0,255) */
int color_under_cursor;
@@ -417,25 +280,21 @@ typedef struct bitmapview {
struct aplist { AnchorPoint *ap; int connected_to, selected; struct aplist *next; };
+enum mv_grids { mv_hidegrid, mv_showgrid, mv_partialgrid, mv_hidemovinggrid };
+enum mv_type { mv_kernonly, mv_widthonly, mv_kernwidth };
typedef struct metricsview {
struct fontview *fv;
SplineFont *sf;
int pixelsize;
BDFFont *bdf; /* We can also see metric info on a bitmap font */
BDFFont *show; /* Or the rasterized version of the outline font */
-#if defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *gw;
- PangoFont *font;
- GtkWidget *hsb, *vsb, *mb, *text, *subtable_list;
- GtkWidget *namelab, *widthlab, *lbearinglab, *rbearinglab, *kernlab;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
- GWindow gw;
+ GWindow gw, v;
GFont *font;
GGadget *hsb, *vsb, *mb, *text, *script, *features, *subtable_list;
GGadget *namelab, *widthlab, *lbearinglab, *rbearinglab, *kernlab;
-#endif
int16 xstart;
int16 width, height, dwidth;
+ int16 vwidth, vheight;
int16 mbh,sbh;
int16 topend; /* y value of the end of the region containing the text field */
int16 displayend; /* y value of the end of the region showing filled characters */
@@ -450,11 +309,7 @@ typedef struct metricsview {
int16 mx, mwidth; /* position and width of the text underneath */
int16 kernafter;
unsigned int selected: 1;
-#if defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *width, *lbearing, *rbearing, *kern, *name;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
GGadget *width, *lbearing, *rbearing, *kern, *name;
-#endif
} *perchar;
SplineChar **sstr; /* Character input stream */
int16 mwidth, mbase;
@@ -467,34 +322,26 @@ typedef struct metricsview {
unsigned int pressed: 1;
unsigned int pressedwidth: 1;
unsigned int pressedkern: 1;
- unsigned int showgrid: 1;
+ unsigned int showgrid: 2;
unsigned int antialias: 1;
unsigned int vertical: 1;
- struct aplist *pressed_apl;
+ unsigned int type: 2; /* enum mv_type */
int xp, yp, ap_owner;
BasePoint ap_start;
int cursor;
int scale_index;
struct lookup_subtable *cur_subtable;
GTextInfo *scriptlangs;
+ int word_index;
+ int layer;
+ int fake_unicode_base;
+ GIC *gwgic;
} MetricsView;
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
enum fv_metrics { fvm_baseline=1, fvm_origin=2, fvm_advanceat=4, fvm_advanceto=8 };
typedef struct fontview {
- EncMap *map;
- EncMap *normal; /* If this is not NULL then we have a compacted encoding in map, and this is the original */
- SplineFont *sf;
+ FontViewBase b;
BDFFont *show, *filled;
-#if defined(FONTFORGE_CONFIG_NO_WINDOWING_UI)
- void *gw, *v;
-#elif defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *gw, *v;
- PangoFont **fontset;
- GtkWidget *vsb, *mb;
- guint pressed; /* gtk timer id */
- GdkGC *gc;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
GWindow gw, v;
GFont **fontset;
GGadget *vsb, *mb;
@@ -502,21 +349,18 @@ typedef struct fontview {
GTimer *resize;
GEvent resize_event;
GIC *gic;
-#endif
+ GIC *gwgic;
int width, height; /* of v */
int16 infoh,mbh;
int16 lab_height, lab_as;
int16 colcnt, rowcnt; /* of display window */
int32 rowoff, rowltot; /* Can be really big in full unicode */
int16 cbw,cbh; /* width/height of a character box */
- struct fontview *next; /* Next on list of open fontviews */
- struct fontview *nextsame; /* Next fv looking at this font */
int pressed_pos, end_pos;
- uint8 *selected;
unsigned int antialias:1;
unsigned int bbsized:1; /* displayed bitmap should be scaled by bounding box rather than emsize */
unsigned int wasonlybitmaps:1;
- unsigned int refstate: 3; /* 0x1 => paste orig of all non exist refs, 0x2=>don't, 0x3 => don't warn about non-exist refs with no source font */
+ /*unsigned int refstate: 3;*/ /* 0x1 => paste orig of all non exist refs, 0x2=>don't, 0x3 => don't warn about non-exist refs with no source font */
unsigned int touched: 1;
unsigned int showhmetrics: 4;
unsigned int showvmetrics: 4;
@@ -531,41 +375,28 @@ typedef struct fontview {
unsigned int glyphlabel: 2;
int16 magnify;
int16 user_requested_magnify;
- SplineFont *cidmaster;
- int32 *mapping; /* an array mapping grid cells (0=upper left) to font indeces (enc, 0=NUL) */
- /* So the default array would contain NUL, ^A, ^B, ... */
- int mapcnt; /* Number of chars in the current group (mapping) */
- struct dictionary *fontvars; /* Scripting */
struct searchview *sv;
SplineChar *sc_near_top;
int sel_index;
struct lookup_subtable *cur_subtable;
-#ifndef _NO_PYTHON
- void *python_fv_object;
- void *python_data;
-#endif
} FontView;
typedef struct findsel {
-#if defined(FONTFORGE_CONFIG_GTK)
- GdkEvent *e;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
GEvent *e;
-#endif
real fudge; /* One pixel fudge factor */
real xl,xh, yl, yh; /* One pixel fudge factor */
+ real c_xl,c_xh, c_yl, c_yh; /* fudge rectangle for control points, larger than above if alt is depressed */
unsigned int select_controls: 1; /* notice control points */
unsigned int seek_controls: 1; /* notice control points before base points */
unsigned int all_controls: 1; /* notice control points even if the base points aren't selected (in truetype point numbering mode where all cps are visible) */
real scale;
- PressedOn *p;
} FindSel;
-#if !defined( FONTFORGE_CONFIG_NO_WINDOWING_UI ) || defined(_DEFINE_SEARCHVIEW_)
typedef struct searchview {
+ struct cvcontainer base;
FontView dummy_fv;
SplineFont dummy_sf;
- SplineChar sc_srch, sc_rpl;
+ LayerInfo layerinfo[2];
SplineChar *chars[2];
EncMap dummy_map;
int32 map[2], backmap[2];
@@ -573,65 +404,115 @@ typedef struct searchview {
CharView cv_srch, cv_rpl;
CharView *lastcv;
/* ****** */
-#if defined(FONTFORGE_CONFIG_GTK)
- GtkWidget *gw;
- GtkWidget *mb;
- PangoFont *plain, *bold;
-#elif defined(FONTFORGE_CONFIG_GDRAW)
GWindow gw;
GGadget *mb;
GFont *plain, *bold;
-#else
- void *gw;
-#endif
int mbh;
int fh, as;
int rpl_x, cv_y;
int cv_width, cv_height;
short button_height, button_width;
/* ****** */
- FontView *fv;
- SplineChar *curchar;
- SplineSet *path, *revpath, *replacepath, *revreplace;
- int pointcnt, rpointcnt;
- real fudge;
- real fudge_percent; /* a value of .05 here represents 5% (we don't store the integer) */
- unsigned int tryreverse: 1;
- unsigned int tryflips: 1;
- unsigned int tryrotate: 1;
- unsigned int tryscale: 1;
- unsigned int onlyselected: 1;
- unsigned int subpatternsearch: 1;
- unsigned int doreplace: 1;
- unsigned int replaceall: 1;
- unsigned int findall: 1;
- unsigned int searchback: 1;
- unsigned int wrap: 1;
- unsigned int wasreversed: 1;
- unsigned int isvisible: 1;
+ SearchData sd;
+ unsigned int showsfindnext: 1;
unsigned int findenabled: 1;
unsigned int rplallenabled: 1;
unsigned int rplenabled: 1;
- unsigned int showsfindnext: 1;
- unsigned int replacewithref: 1;
- SplineSet *matched_spl;
- SplinePoint *matched_sp, *last_sp;
- real matched_rot, matched_scale;
- real matched_x, matched_y;
- double matched_co, matched_si; /* Precomputed sin, cos */
- enum flipset { flip_none = 0, flip_x, flip_y, flip_xy } matched_flip;
-#ifdef _HAS_LONGLONG
- unsigned long long matched_refs; /* Bit map of which refs in the char were matched */
- unsigned long long matched_ss; /* Bit map of which splines in the char were matched */
- /* In multi-path mode */
- unsigned long long matched_ss_start;/* Bit map of which splines we tried to start matches with */
-#else
- unsigned long matched_refs;
- unsigned long matched_ss;
- unsigned long matched_ss_start;
-#endif
+ unsigned int isvisible: 1;
} SearchView;
-#endif
+
+typedef struct mathkernview {
+ struct cvcontainer base;
+ FontView dummy_fv;
+ SplineFont dummy_sf;
+ LayerInfo layerinfo[2];
+ SplineChar sc_topright, sc_topleft, sc_bottomright, sc_bottomleft;
+ SplineChar *chars[4];
+ EncMap dummy_map;
+ int32 map[4], backmap[4];
+ uint8 sel[4];
+ CharView cv_topright, cv_topleft, cv_bottomright, cv_bottomleft;
+ CharView *lastcv;
+/* ****** */
+ GWindow gw;
+ GWindow cvparent_w;
+ GGadget *mb;
+ GFont *plain, *bold;
+ int mbh;
+ int fh, as;
+ int mid_space, cv_y;
+ int cv_width, cv_height;
+ short button_height, button_width;
+/* ****** */
+ SplineChar *cursc;
+ int def_layer;
+ struct mathkern *orig_mathkern;
+ uint8 saved_mathkern; /* Can't just check if orig is non-NULL, because NULL is a perfectly valid initial state */
+ uint8 last_aspect;
+ uint8 done;
+} MathKernDlg;
+
+# ifdef FONTFORGE_CONFIG_TILEPATH
+
+typedef struct tilepathdlg {
+ struct cvcontainer base;
+ FontView dummy_fv;
+ SplineFont dummy_sf;
+ LayerInfo layerinfo[2];
+ SplineChar sc_first, sc_medial, sc_final, sc_isolated;
+ SplineChar *chars[4];
+ EncMap dummy_map;
+ int32 map[4], backmap[4];
+ uint8 sel[4];
+ CharView cv_first, cv_medial, cv_final, cv_isolated;
+ CharView *lastcv;
+/* ****** */
+ GWindow gw;
+ GGadget *mb;
+ GFont *plain, *bold;
+ int mbh;
+ int fh, as;
+ int mid_space, cv_y;
+ int cv_width, cv_height;
+/* ****** */
+ struct tiledata *td;
+ SplineFont *base_sf;
+ uint8 done, oked;
+} TilePathDlg;
+extern void TPDChar(TilePathDlg *tpd, GEvent *event);
+extern void TPDCharViewInits(TilePathDlg *tpd, int cid);
+extern void PTDChar(TilePathDlg *tpd, GEvent *event);
+extern void PTDCharViewInits(TilePathDlg *tpd, int cid);
+#endif /* Tile Path */
+
+# ifdef FONTFORGE_CONFIG_TYPE3
+
+typedef struct gradientdlg {
+ struct cvcontainer base;
+ FontView dummy_fv;
+ SplineFont dummy_sf;
+ LayerInfo layerinfo[2];
+ SplineChar sc_grad;
+ SplineChar *chars[1];
+ EncMap dummy_map;
+ int32 map[1], backmap[1];
+ uint8 sel[1];
+ CharView cv_grad;
+/* ****** */
+ GWindow gw;
+ GGadget *mb;
+ GFont *plain, *bold;
+ int mbh;
+ int fh, as;
+ int mid_space, cv_y;
+ int cv_width, cv_height;
+/* ****** */
+ uint8 done, oked;
+ struct gradient *active;
+} GradientDlg;
+extern void GDDChar(GradientDlg *tpd, GEvent *event);
+extern void GDDCharViewInits(GradientDlg *gdd,int cid);
+#endif /* Tile Path */
struct lkdata {
int cnt, max;
@@ -642,18 +523,21 @@ struct lkdata {
unsigned int deleted: 1;
unsigned int new: 1;
unsigned int selected: 1;
+ unsigned int moved: 1;
int16 subtable_cnt, subtable_max;
struct lksubinfo {
struct lookup_subtable *subtable;
unsigned int deleted: 1;
unsigned int new: 1;
unsigned int selected: 1;
+ unsigned int moved: 1;
} *subtables;
} *all;
};
-struct gfi_data {
+struct gfi_data { /* FontInfo */
SplineFont *sf;
+ int def_layer;
GWindow gw;
int tn_active;
int private_aspect, ttfv_aspect, tn_aspect, tx_aspect, unicode_aspect;
@@ -665,9 +549,9 @@ struct gfi_data {
unsigned int human_untitled: 1;
unsigned int done: 1;
unsigned int mpdone: 1;
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
+ unsigned int lk_drag_and_drop: 1;
+ unsigned int lk_dropablecursor: 1;
struct anchor_shows { CharView *cv; SplineChar *sc; int restart; } anchor_shows[2];
-#endif
struct texdata texdata;
struct contextchaindlg *ccd;
struct statemachinedlg *smd;
@@ -681,207 +565,47 @@ struct gfi_data {
int as, fh;
struct lkdata tables[2];
int lkwidth, lkheight;
+ int first_sel_lookup, first_sel_subtable;
};
-enum widthtype { wt_width, wt_lbearing, wt_rbearing, wt_vwidth };
-
-enum fvtrans_flags { fvt_dobackground=1, fvt_round_to_int=2,
- fvt_dontsetwidth=4, fvt_dontmovewidth=8, fvt_scalekernclasses=0x10,
- fvt_scalepstpos=0x20, fvt_dogrid=0x40, fvt_partialreftrans=0x80 };
-enum origins { or_zero, or_center, or_lastpress, or_value, or_undefined };
-struct pov_data {
- enum origins xorigin, yorigin;
- double x, y, z;
- double direction; /* Direction of gaze projected into xy plane */
- double tilt; /* Angle which drawing plane is tilted with respect to projection plane */
- double d; /* Distance to projection plane */
- double sintilt; /* Used internally */
-};
-
-extern FontView *_FontViewCreate(SplineFont *sf);
-extern FontView *FontViewCreate(SplineFont *sf);
-extern void SplineFontSetUnChanged(SplineFont *sf);
-extern void FontViewFree(FontView *fv);
-extern void FVToggleCharChanged(SplineChar *sc);
extern void FVMarkHintsOutOfDate(SplineChar *sc);
extern void FVRefreshChar(FontView *fv,int gid);
extern int _FVMenuSave(FontView *fv);
extern int _FVMenuSaveAs(FontView *fv);
extern int _FVMenuGenerate(FontView *fv,int family);
extern void _FVCloseWindows(FontView *fv);
-extern void SCClearBackground(SplineChar *sc);
extern char *GetPostscriptFontName(char *defdir,int mult);
extern void MergeKernInfo(SplineFont *sf,EncMap *map);
-extern void _FVSimplify(FontView *fv,struct simplifyinfo *smpl);
#ifdef FONTFORGE_CONFIG_WRITE_PFM
extern int WritePfmFile(char *filename,SplineFont *sf, int type0, EncMap *map);
#endif
-extern int GenerateScript(SplineFont *sf,char *filename,char *bitmaptype,
- int fmflags,int res, char *subfontdirectory,struct sflist *sfs,
- EncMap *map,NameList *rename_to);
-extern int SFGenerateFont(SplineFont *sf,int family,EncMap *map);
-
-extern int SFScaleToEm(SplineFont *sf, int ascent, int descent);
-extern void TransHints(StemInfo *stem,real mul1, real off1, real mul2, real off2, int round_to_int );
-extern void VrTrans(struct vr *vr,real transform[6]);
-extern void FVTransFunc(void *_fv,real transform[6],int otype, BVTFunc *bvts,
- enum fvtrans_flags );
-extern void FVTrans(FontView *fv,SplineChar *sc,real transform[6],uint8 *sel,
- enum fvtrans_flags);
-extern int SFNLTrans(FontView *fv,char *x_expr,char *y_expr);
+extern int SFGenerateFont(SplineFont *sf,int layer, int family,EncMap *map);
+
extern void NonLinearDlg(FontView *fv,struct charview *cv);
-extern void FVPointOfView(FontView *fv,struct pov_data *);
-extern void FVBuildAccent(FontView *fv,int onlyaccents);
-extern void FVBuildDuplicate(FontView *fv);
extern void FVChangeChar(FontView *fv,int encoding);
-extern void SCClearContents(SplineChar *sc);
-extern void SCClearAll(SplineChar *sc);
-extern void BCClearAll(BDFChar *bc);
-extern void UnlinkThisReference(FontView *fv,SplineChar *sc);
-extern void FVFakeMenus(FontView *fv,int cmd);
-extern void FVMetricsCenter(FontView *fv,int docenter);
-extern void MergeFont(FontView *fv,SplineFont *other);
extern void FVMergeFonts(FontView *fv);
-extern SplineFont *InterpolateFont(SplineFont *base, SplineFont *other, real amount, Encoding *enc);
extern void FVInterpolateFonts(FontView *fv);
-extern void FVRevert(FontView *fv);
-extern void FVRevertBackup(FontView *fv);
extern void FVDeselectAll(FontView *fv);
extern void FVAutoKern(FontView *fv);
extern void FVAutoWidth(FontView *fv);
-extern void FVRemoveKerns(FontView *fv);
-extern void FVRemoveVKerns(FontView *fv);
-extern void FVVKernFromHKern(FontView *fv);
-extern int AutoWidthScript(FontView *fv,int spacing);
-extern int AutoKernScript(FontView *fv,int spacing, int threshold,
- struct lookup_subtable *sub, char *kernfile);
-
-enum fvformats { fv_bdf, fv_ttf, fv_pk, fv_pcf, fv_mac, fv_win, fv_palm,
- fv_image, fv_imgtemplate, fv_eps, fv_epstemplate,
- fv_svg, fv_svgtemplate,
- fv_glif, fv_gliftemplate,
- fv_fig };
-extern int HasSVG(void);
-extern void SCImportSVG(SplineChar *sc,int layer,char *path,char *memory, int memlen,int doclear);
-extern int HasUFO(void);
-extern void SCImportGlif(SplineChar *sc,int layer,char *path,char *memory, int memlen,int doclear);
-extern void SCImportPS(SplineChar *sc,int layer,char *path,int doclear, int flags);
-extern void SCImportPSFile(SplineChar *sc,int layer,FILE *ps,int doclear,int flags);
-extern void SCAddScaleImage(SplineChar *sc,GImage *image,int doclear,int layer);
-extern void SCInsertImage(SplineChar *sc,GImage *image,real scale,real yoff, real xoff, int layer);
-extern int FVImportImages(FontView *fv,char *path,int isimage,int toback,int flags);
-extern int FVImportImageTemplate(FontView *fv,char *path,int isimage,int toback,int flags);
-
-extern int _ExportPDF(FILE *pdf,SplineChar *sc);
-extern int _ExportEPS(FILE *eps,SplineChar *sc,int gen_preview);
-extern int _ExportSVG(FILE *svg,SplineChar *sc);
-extern int _ExportGlif(FILE *glif,SplineChar *sc);
-extern int ExportImage(char *filename,SplineChar *sc, int format, int pixelsize, int bitsperpixel);
-extern void ScriptExport(SplineFont *sf, BDFFont *bdf, int format, int gid,
- char *format_spec, EncMap *map);
-
-extern void BCFlattenFloat(BDFChar *bc);
-extern void BCTrans(BDFFont *bdf,BDFChar *bc,BVTFunc *bvts,FontView *fv );
-
-extern enum undotype CopyUndoType(void);
-extern int CopyContainsSomething(void);
-extern int CopyContainsBitmap(void);
-extern const Undoes *CopyBufferGet(void);
-extern RefChar *CopyContainsRef(SplineFont *);
-extern char **CopyGetPosSubData(enum possub_type *type,SplineFont **copied_from,
- int pst_depth);
-extern void CopyReference(SplineChar *sc);
-extern void SCCopyLookupData(SplineChar *sc);
-extern void PasteRemoveSFAnchors(SplineFont *);
-extern void PasteAnchorClassMerge(SplineFont *sf,AnchorClass *into,AnchorClass *from);
-extern void PasteRemoveAnchorClass(SplineFont *sf,AnchorClass *dying);
-extern void ClipboardClear(void);
-extern SplineSet *ClipBoardToSplineSet(void);
-extern void BCCopySelected(BDFChar *bc,int pixelsize,int depth);
-extern void PasteToBC(BDFChar *bc,int pixelsize,int depth,FontView *fv);
-extern void FVCopyWidth(FontView *fv,enum undotype ut);
-extern void FVCopyAnchors(FontView *fv);
-enum fvcopy_type { ct_fullcopy, ct_reference, ct_lookups, ct_unlinkrefs };
-extern void FVCopy(FontView *fv, enum fvcopy_type copytype);
-extern void PasteIntoFV(FontView *fv, int pasteinto, real trans[6]);
-
-extern void SCUpdateAll(SplineChar *sc);
-extern void SCOutOfDateBackground(SplineChar *sc);
-extern void SCClearSelPt(SplineChar *sc);
-extern void _SCCharChangedUpdate(SplineChar *sc,int changed);
-extern void SCCharChangedUpdate(SplineChar *sc);
-extern void SCHintsChanged(SplineChar *sc);
-extern void SCSynchronizeWidth(SplineChar *sc,real newwidth, real oldwidth,FontView *fv);
-extern RefChar *HasUseMyMetrics(SplineChar *sc);
-extern void SCSynchronizeLBearing(SplineChar *sc,real off);
-extern void BackgroundImageTransform(SplineChar *sc, ImageList *img,real transform[6]);
-extern void SCClearRounds(SplineChar *sc);
-extern void SCMoreLayers(SplineChar *,Layer *old);
-extern void SCLayersChange(SplineChar *sc);
-extern void SFLayerChange(SplineFont *sf);
-extern void SCTile(SplineChar *sc);
-
-extern void ExecuteScriptFile(FontView *fv, char *filename);
-extern void DictionaryFree(struct dictionary *dica);
-
-extern void BCCharChangedUpdate(BDFChar *bc);
-extern BDFFloat *BDFFloatCreate(BDFChar *bc,int xmin,int xmax,int ymin,int ymax, int clear);
-extern BDFFloat *BDFFloatCopy(BDFFloat *sel);
-extern BDFFloat *BDFFloatConvert(BDFFloat *sel,int newdepth, int olddepth);
-extern void BDFFloatFree(BDFFloat *sel);
-
-extern void SCDoRedo(SplineChar *sc,int layer);
-extern void SCDoUndo(SplineChar *sc,int layer);
-extern void SCCopyWidth(SplineChar *sc,enum undotype);
-extern void SCAppendPosSub(SplineChar *sc,enum possub_type type, char **d,SplineFont *copied_from);
-#if !defined( FONTFORGE_CONFIG_NO_WINDOWING_UI ) || defined(_DEFINE_SEARCHVIEW_)
-extern void PasteToCV(CharView *cv);
-#endif
-extern void MDReplace(MinimumDistance *md,SplineSet *old,SplineSet *rpl);
+extern void SC_MarkInstrDlgAsChanged(SplineChar *sc);
-extern void _SCAutoTrace(SplineChar *sc, char **args);
-extern char **AutoTraceArgs(int ask);
-extern void FVAutoTrace(FontView *fv,int ask);
-extern char *FindAutoTraceName(void);
-extern char *FindMFName(void);
-extern char *ProgramExists(char *prog,char *buffer);
-extern void *GetAutoTraceArgs(void);
-extern void SetAutoTraceArgs(void *a);
-extern void MfArgsInit(void);
-
-extern void DumpPfaEditEncodings(void);
-extern void ParseEncodingFile(char *filename);
-extern void LoadPfaEditEncodings(void);
+extern void PythonUI_Init(void);
extern void SCStroke(SplineChar *sc);
-extern void FVOutline(FontView *fv, real width);
-extern void FVInline(FontView *fv, real width, real inset);
-extern void FVShadow(FontView *fv,real angle, real outline_width,
- real shadow_length,int wireframe);
-
-extern void SetDefaults(void);
-extern char *getPfaEditShareDir(void);
-extern void LoadPrefs(void);
-extern void PrefDefaultEncoding(void);
-extern void _SavePrefs(void);
-extern void SavePrefs(void);
+
extern void PfaEditSetFallback(void);
extern void RecentFilesRemember(char *filename);
-extern int GetPrefs(char *name,Val *val); /* for scripting */
-extern int SetPrefs(char *name,Val *val1, Val *val2); /* for scripting */
-extern int FVImportBDF(FontView *fv, char *filename,int ispk, int toback);
-extern int FVImportMult(FontView *fv, char *filename,int toback,int bf);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
struct debugger_context;
extern void DebuggerTerminate(struct debugger_context *dc);
-extern void DebuggerReset(struct debugger_context *dc,real pointsize,int dpi,int dbg_fpgm, int is_bitmap);
-extern struct debugger_context *DebuggerCreate(SplineChar *sc,real pointsize,int dpi,int dbg_fpgm, int is_bitmap);
+extern void DebuggerReset(struct debugger_context *dc,real pointsizey, real pointsizex,int dpi,int dbg_fpgm, int is_bitmap);
+extern struct debugger_context *DebuggerCreate(SplineChar *sc,int layer,real pointsizey,real pointsizex,int dpi,int dbg_fpgm, int is_bitmap);
enum debug_gotype { dgt_continue, dgt_step, dgt_next, dgt_stepout };
extern void DebuggerGo(struct debugger_context *dc,enum debug_gotype,DebugView *dv);
extern struct TT_ExecContextRec_ *DebuggerGetEContext(struct debugger_context *dc);
@@ -895,52 +619,35 @@ extern int DebuggerIsStorageSet(struct debugger_context *dc, int index);
extern void DebuggerSetWatchCvts(struct debugger_context *dc,int n, uint8 *w);
extern uint8 *DebuggerGetWatchCvts(struct debugger_context *dc, int *n);
extern int DebuggingFpgm(struct debugger_context *dc);
-#endif
-extern int BitmapControl(FontView *fv,int32 *sizes,int isavail,int rasterize);
-
-#if defined(FONTFORGE_CONFIG_GTK)
-extern void ScriptPrint(FontView *fv,int type,int32 *pointsizes,char *samplefile,
- char *sample, char *outputfile);
-extern char *PrtBuildDef( SplineFont *sf, int istwobyte );
-#elif defined(FONTFORGE_CONFIG_GDRAW)
-extern void ScriptPrint(FontView *fv,int type,int32 *pointsizes,char *samplefile,
- unichar_t *sample, char *outputfile);
-extern unichar_t *PrtBuildDef( SplineFont *sf, int istwobyte );
-#endif
+extern void PrintWindowClose(void);
+extern void InsertTextDlg(CharView *cv);
extern char *Kern2Text(SplineChar *other,KernPair *kp,int isv);
extern char *PST2Text(PST *pst,SplineFont *sf);
-extern void FVStrokeItScript(FontView *fv, StrokeInfo *si);
+
+void EmboldenDlg(FontView *fv, CharView *cv);
+void CondenseExtendDlg(FontView *fv, CharView *cv);
+void AddSmallCapsDlg(FontView *fv);
+void AddSubSupDlg(FontView *fv);
+void ObliqueDlg(FontView *fv, CharView *cv);
+void GlyphChangeDlg(FontView *fv, CharView *cv, enum glyphchange_type gc);
+void ItalicDlg(FontView *fv, CharView *cv);
+void ChangeXHeightDlg(FontView *fv,CharView *cv);
extern int FVParseSelectByPST(FontView *fv,struct lookup_subtable *sub,
int search_type);
-#if defined(FONTFORGE_CONFIG_GTK)
-extern void DropChars2Text(GdkWindow gw, GtkWidget *glyphs,GdkEvent *event);
-#elif defined(FONTFORGE_CONFIG_GDRAW)
extern void DropChars2Text(GWindow gw, GGadget *glyphs,GEvent *event);
-#endif
-extern void FVSetWidthScript(FontView *fv,enum widthtype wtype,int val,int incr);
extern void FVReplaceOutlineWithReference( FontView *fv, double fudge );
+extern void SVDestroy(struct searchview *sv);
-extern void skewselect(BVTFunc *bvtf,real t);
-extern int UserFeaturesDiffer(void);
extern int SLICount(SplineFont *sf);
-#if defined(FONTFORGE_CONFIG_GTK)
-extern char *ClassName(const char *name,uint32 feature_tag,
- uint16 flags, int script_lang_index, int merge_with, int act_type,
- int macfeature,SplineFont *sf);
-extern char *DecomposeClassName(const char *clsnm, char **name,
- uint32 *feature_tag, int *macfeature,
- uint16 *flags, uint16 *script_lang_index,int *merge_with,int *act_type,
- SplineFont *sf);
-#elif defined(FONTFORGE_CONFIG_GDRAW)
extern unichar_t *ClassName(const char *name,uint32 feature_tag,
uint16 flags, int script_lang_index, int merge_with, int act_type,
int macfeature,SplineFont *sf);
@@ -948,23 +655,13 @@ extern unichar_t *DecomposeClassName(const unichar_t *clsnm, unichar_t **name,
uint32 *feature_tag, int *macfeature,
uint16 *flags, uint16 *script_lang_index,int *merge_with,int *act_type,
SplineFont *sf);
-#endif
extern PST *AddSubs(PST *last,uint32 tag,char *name,uint16 flags,
uint16 sli,SplineChar *sc);
-#ifndef FONTFORGE_CONFIG_NO_WINDOWING_UI
-extern void FVSetTitle(FontView *fv);
extern void FVScrollToChar(FontView *fv,int i);
extern void FVRegenChar(FontView *fv,SplineChar *sc);
extern FontView *FontNew(void);
-extern FontView *ViewPostscriptFont(char *filename);
-#if defined(FONTFORGE_CONFIG_GTK)
- /* Many of these are defined in interface.h */
-extern char *AskNameTag(char *title,char *def,uint32 def_tag,uint16 flags,
- int script_lang_index, enum possub_type type, SplineFont *sf, SplineChar *default_script,
- int merge_with,int act_type);
-#elif defined(FONTFORGE_CONFIG_GDRAW)
extern void _MenuWarnings(GWindow gw,struct gmenuitem *mi,GEvent *e);
extern void MenuPrefs(GWindow base,struct gmenuitem *mi,GEvent *e);
extern void MenuSaveAll(GWindow base,struct gmenuitem *mi,GEvent *e);
@@ -980,6 +677,7 @@ extern void MenuRecentBuild(GWindow base,struct gmenuitem *mi,GEvent *);
extern void MenuScriptsBuild(GWindow base,struct gmenuitem *mi,GEvent *);
extern void mb2DoGetText(GMenuItem2 *mb);
extern void mbDoGetText(GMenuItem *mb);
+extern void OFLibBrowse(void);
extern int RecentFilesAny(void);
extern void _aplistbuild(struct gmenuitem *mi,SplineFont *sf,
void (*func)(GWindow,struct gmenuitem *,GEvent *));
@@ -998,12 +696,13 @@ extern GTextInfo *GListChangeLine(GGadget *list,int pos, const unichar_t *line);
extern GTextInfo *GListAppendLine(GGadget *list,const unichar_t *line,int select);
extern GTextInfo *GListChangeLine8(GGadget *list,int pos, const char *line);
extern GTextInfo *GListAppendLine8(GGadget *list,const char *line,int select);
-#endif
extern void CharInfoInit(void);
-#ifdef FONTFORGE_CONFIG_DEVICETABLES
+extern void SCLigCaretCheck(SplineChar *sc,int clean);
+extern char *DevTab_Dlg(GGadget *g, int r, int c);
extern int DeviceTableOK(char *dvstr, int *_low, int *_high);
-extern DeviceTable *DeviceTableParse(DeviceTable *dv,char *dvstr);
extern void VRDevTabParse(struct vr *vr,struct matrix_data *md);
+#ifdef FONTFORGE_CONFIG_DEVICETABLES
+extern DeviceTable *DeviceTableParse(DeviceTable *dv,char *dvstr);
extern void DevTabToString(char **str,DeviceTable *adjust);
extern void ValDevTabToStrings(struct matrix_data *mds,int first_offset,ValDevTab *adjust);
#endif
@@ -1011,7 +710,7 @@ extern void KpMDParse(SplineFont *sf,SplineChar *sc,struct lookup_subtable *sub,
struct matrix_data *possub,int rows,int cols,int i);
extern void GFI_LookupEnableButtons(struct gfi_data *gfi, int isgpos);
extern void GFI_LookupScrollbars(struct gfi_data *gfi, int isgpos, int refresh);
-extern void FontInfo(SplineFont *sf,int aspect,int sync);
+extern void FontInfo(SplineFont *sf,int layer,int aspect,int sync);
extern void FontInfoDestroy(SplineFont *sf);
extern void FontMenuFontInfo(void *fv);
extern void GFI_CCDEnd(struct gfi_data *d);
@@ -1019,13 +718,7 @@ extern struct enc *MakeEncoding(SplineFont *sf, EncMap *map);
extern void LoadEncodingFile(void);
extern void RemoveEncoding(void);
extern void SFPrivateInfo(SplineFont *sf);
-extern void FontViewReformatAll(SplineFont *sf);
-extern void FontViewReformatOne(FontView *fv);
-extern void FVShowFilled(FontView *fv);
-extern void FVChangeDisplayBitmap(FontView *fv,BDFFont *bdf);
extern void FVDelay(FontView *fv,void (*func)(FontView *));
-#if defined(FONTFORGE_CONFIG_GTK)
-#elif defined(FONTFORGE_CONFIG_GDRAW)
extern void GFI_FinishContextNew(struct gfi_data *d,FPST *fpst, int success);
extern void SCPreparePopup(GWindow gw,SplineChar *sc, struct remap *remap, int enc, int actualuni);
extern void CVDrawSplineSet(CharView *cv, GWindow pixmap, SplinePointList *set,
@@ -1034,11 +727,11 @@ extern GWindow CVMakeTools(CharView *cv);
extern GWindow CVMakeLayers(CharView *cv);
extern GWindow BVMakeTools(BitmapView *bv);
extern GWindow BVMakeLayers(BitmapView *bv);
+extern void CVSetLayer(CharView *cv,int layer);
extern int CVPaletteMnemonicCheck(GEvent *event);
extern int TrueCharState(GEvent *event);
extern void CVToolsPopup(CharView *cv, GEvent *event);
extern void BVToolsPopup(BitmapView *bv, GEvent *event);
-#endif
extern real CVRoundRectRadius(void);
extern int CVRectElipseCenter(void);
extern void CVRectEllipsePosDlg(CharView *cv);
@@ -1053,6 +746,7 @@ extern void CVPalettesRaise(CharView *cv);
extern void CVLayersSet(CharView *cv);
extern void _CVPaletteActivate(CharView *cv,int force);
extern void CVPaletteActivate(CharView *cv);
+extern void CV_LayerPaletteCheck(SplineFont *sf);
extern void CVPalettesHideIfMine(CharView *cv);
extern int BVPaletteIsVisible(BitmapView *bv,int which);
extern void BVPaletteSetVisible(BitmapView *bv,int which,int visible);
@@ -1079,8 +773,6 @@ extern void SCRemoveSelectedMinimumDistances(SplineChar *sc,int inx);
extern int CVExport(CharView *cv);
extern int BVExport(BitmapView *bv);
-#if defined(FONTFORGE_CONFIG_GTK)
-#elif defined(FONTFORGE_CONFIG_GDRAW)
extern void DrawAnchorPoint(GWindow pixmap,int x, int y,int selected);
extern void DefaultY(GRect *pos);
extern void CVDrawRubberRect(GWindow pixmap, CharView *cv);
@@ -1088,30 +780,21 @@ extern void CVInfoDraw(CharView *cv, GWindow pixmap );
extern void CVChar(CharView *cv, GEvent *event );
extern void PI_ShowHints(SplineChar *sc, GGadget *list, int set);
extern GTextInfo *SCHintList(SplineChar *sc,HintMask *);
-#endif
extern void CVResize(CharView *cv );
extern CharView *CharViewCreate(SplineChar *sc,FontView *fv,int enc);
extern void CharViewFree(CharView *cv);
extern int CVValid(SplineFont *sf, SplineChar *sc, CharView *cv);
extern void CVSetCharChanged(CharView *cv,int changed);
-extern void _CVCharChangedUpdate(CharView *cv,int changed);
-extern void CVCharChangedUpdate(CharView *cv);
extern int CVAnySel(CharView *cv, int *anyp, int *anyr, int *anyi, int *anya);
-extern SplinePoint *CVAnySelPoints(CharView *cv);
+extern int CVAnySelPoints(CharView *cv);
extern void CVSelectPointAt(CharView *cv);
-extern int CVTwoForePointsSelected(CharView *cv, SplinePoint **sp1, SplinePoint **sp2);
-extern int CVIsDiagonalable(SplinePoint *sp1, SplinePoint *sp2, SplinePoint **sp3, SplinePoint **sp4);
extern int CVClearSel(CharView *cv);
extern int CVSetSel(CharView *cv,int mask);
extern void CVInvertSel(CharView *cv);
extern int CVAllSelected(CharView *cv);
extern SplinePointList *CVAnySelPointList(CharView *cv);
-extern SplinePoint *CVAnySelPoint(CharView *cv);
-extern int CVOneThingSel(CharView *cv, SplinePoint **sp, SplinePointList **spl,
- RefChar **ref, ImageList **img, AnchorPoint **ap);
extern int CVOneContourSel(CharView *cv, SplinePointList **_spl,
RefChar **ref, ImageList **img);
-extern void RevertedGlyphReferenceFixup(SplineChar *sc, SplineFont *sf);
extern void CVImport(CharView *cv);
extern void BVImport(BitmapView *bv);
extern void FVImport(FontView *bv);
@@ -1123,32 +806,44 @@ extern void OutlineDlg(FontView *fv, CharView *cv,MetricsView *mv,int isinline);
extern void ShadowDlg(FontView *fv, CharView *cv,MetricsView *mv,int wireframe);
extern void CVTile(CharView *cv);
extern void FVTile(FontView *fv);
-extern void SCCharInfo(SplineChar *sc,EncMap *map,int enc);
+extern void CVPatternTile(CharView *cv);
+extern void FVPatternTile(FontView *fv);
+extern void SCCharInfo(SplineChar *sc,int deflayer,EncMap *map,int enc);
extern void CharInfoDestroy(struct charinfo *ci);
extern SplineChar *SuffixCheck(SplineChar *sc,char *suffix);
extern void SCSubtableDefaultSubsCheck(SplineChar *sc, struct lookup_subtable *sub, struct matrix_data *possub, int col_cnt, int r);
+extern GImage *PST_GetImage(GGadget *pstk,SplineFont *sf,int def_layer,
+ struct lookup_subtable *sub,int popup_r, SplineChar *sc );
+extern GImage *NameList_GetImage(SplineFont *sf,SplineChar *sc,int def_layer,
+ char *namelist, int isliga );
+extern GImage *GV_GetConstructedImage(SplineChar *sc,int def_layer, struct glyphvariants *gv,
+ int is_horiz);
+extern GImage *SC_GetLinedImage(SplineChar *sc, int def_layer, int pos, int is_italic_cor);
+extern struct glyphvariants *GV_ParseConstruction(struct glyphvariants *gv,
+ struct matrix_data *stuff, int rows, int cols);
+extern void GV_ToMD(GGadget *g, struct glyphvariants *gv);
extern void CVGetInfo(CharView *cv);
extern void CVPGetInfo(CharView *cv);
extern int SCUsedBySubs(SplineChar *sc);
extern void SCSubBy(SplineChar *sc);
extern void SCRefBy(SplineChar *sc);
extern void ApGetInfo(CharView *cv, AnchorPoint *ap);
+extern void CVMakeClipPath(CharView *cv);
extern void CVAddAnchor(CharView *cv);
extern AnchorClass *AnchorClassUnused(SplineChar *sc,int *waslig);
extern void FVSetWidth(FontView *fv,enum widthtype wtype);
extern void CVSetWidth(CharView *cv,enum widthtype wtype);
extern void CVChangeSC(CharView *cv, SplineChar *sc );
-extern void SCRefreshTitles(SplineChar *sc);
-extern void SPChangePointType(SplinePoint *sp, int pointtype);
+extern Undoes *CVPreserveTState(CharView *cv);
+extern void CVRestoreTOriginalState(CharView *cv);
+extern void CVUndoCleanup(CharView *cv);
extern void CVAdjustPoint(CharView *cv, SplinePoint *sp);
extern void CVMergeSplineSets(CharView *cv, SplinePoint *active, SplineSet *activess,
SplinePoint *merge, SplineSet *mergess);
extern void CVAdjustControl(CharView *cv,BasePoint *cp, BasePoint *to);
extern int CVMoveSelection(CharView *cv, real dx, real dy, uint32 input_state);
-#if defined(FONTFORGE_CONFIG_GDRAW)
extern int CVTestSelectFromEvent(CharView *cv,GEvent *event);
-extern void CVMouseMovePen(CharView *cv, PressedOn *p, GEvent *event);
extern void CVMouseUpPoint(CharView *cv,GEvent *event);
extern int CVMouseMovePointer(CharView *cv, GEvent *event);
extern void CVMouseDownPointer(CharView *cv, FindSel *fs, GEvent *event);
@@ -1165,9 +860,7 @@ extern void CPStartInfo(CharView *cv, GEvent *event);
extern void CPUpdateInfo(CharView *cv, GEvent *event);
extern void CPEndInfo(CharView *cv);
extern void BVChar(BitmapView *cv, GEvent *event );
-#endif
extern void CVMouseDownPoint(CharView *cv,GEvent *event);
-extern void CVMouseMovePoint(CharView *cv,PressedOn *);
extern void CVMouseUpPointer(CharView *cv );
extern void CVCheckResizeCursors(CharView *cv);
extern void CVMouseDownHand(CharView *cv);
@@ -1176,45 +869,22 @@ extern void CVMouseDownTransform(CharView *cv);
extern void CVMouseMoveTransform(CharView *cv);
extern void CVMouseUpTransform(CharView *cv);
extern void CVMouseDownKnife(CharView *cv);
-extern void CVMouseMoveKnife(CharView *cv,PressedOn *);
extern void CVMouseUpKnife(CharView *cv,GEvent *event);
extern void CVMouseMoveShape(CharView *cv);
extern void CVMouseUpShape(CharView *cv);
-#ifdef FONTFORGE_CONFIG_GDRAW
extern void LogoExpose(GWindow pixmap,GEvent *event, GRect *r,enum drawmode dm);
-#endif
extern void CVDebugPointPopup(CharView *cv);
extern int GotoChar(SplineFont *sf,EncMap *map);
-extern int CVLayer(CharView *cv);
-extern Undoes *CVPreserveStateHints(CharView *cv);
-extern Undoes *CVPreserveState(CharView *cv);
-extern Undoes *CVPreserveTState(CharView *cv);
-extern Undoes *CVPreserveWidth(CharView *cv,int width);
-extern Undoes *CVPreserveVWidth(CharView *cv,int vwidth);
-extern void CVDoRedo(CharView *cv);
-extern void CVDoUndo(CharView *cv);
-extern void CVRestoreTOriginalState(CharView *cv);
-extern void CVUndoCleanup(CharView *cv);
-extern void CVRemoveTopUndo(CharView *cv);
-extern void CopySelected(CharView *cv);
-extern void CVCopyGridFit(CharView *cv);
-extern void CopyWidth(CharView *cv,enum undotype);
-extern void MVCopyChar(MetricsView *mv, SplineChar *sc, enum fvcopy_type fullcopy);
-extern void PasteIntoMV(MetricsView *mv,SplineChar *sc, int doclear);
-
extern void CVShowPoint(CharView *cv, BasePoint *me);
extern BitmapView *BitmapViewCreate(BDFChar *bc, BDFFont *bdf, FontView *fv,int enc);
extern BitmapView *BitmapViewCreatePick(int enc, FontView *fv);
extern void BitmapViewFree(BitmapView *bv);
-#ifdef FONTFORGE_CONFIG_GDRAW
extern void BVMenuRotateInvoked(GWindow gw,struct gmenuitem *mi, GEvent *e);
-#endif
extern void BVRotateBitmap(BitmapView *bv,enum bvtools type );
extern int BVColor(BitmapView *bv);
-extern void BCSetPoint(BDFChar *bc, int x, int y, int color);
extern void BCGeneralFunction(BitmapView *bv,
void (*SetPoint)(BitmapView *,int x, int y, void *data),void *data);
extern char *BVFlipNames[];
@@ -1227,10 +897,10 @@ extern void MVReKern(MetricsView *mv);
extern MetricsView *MetricsViewCreate(FontView *fv,SplineChar *sc,BDFFont *bdf);
extern void MetricsViewFree(MetricsView *mv);
extern void MVRefreshAll(MetricsView *mv);
+extern void MV_FriendlyFeatures(GGadget *g, int pos);
+extern GTextInfo *SLOfFont(SplineFont *sf);
extern void DoPrefs(void);
-#if defined(FONTFORGE_CONFIG_GTK)
-#elif defined(FONTFORGE_CONFIG_GDRAW)
extern void GListAddStr(GGadget *list,unichar_t *str, void *ud);
extern void GListReplaceStr(GGadget *list,int index, unichar_t *str, void *ud);
extern struct macname *NameGadgetsGetNames( GWindow gw );
@@ -1240,39 +910,20 @@ extern void GCDFillMacFeat(GGadgetCreateData *mfgcd,GTextInfo *mflabels, int wid
MacFeat *all, int fromprefs, GGadgetCreateData *boxes,
GGadgetCreateData **array);
extern void Prefs_ReplaceMacFeatures(GGadget *list);
-#endif
-#if defined(FONTFORGE_CONFIG_GTK)
-extern char *FVOpenFont(char *title, const char *defaultfile,
- const char *initial_filter,int mult);
-#elif defined(FONTFORGE_CONFIG_GDRAW)
-extern void SCAutoTrace(SplineChar *sc,GWindow v,int ask);
extern unichar_t *FVOpenFont(char *title, const char *defaultfile, int mult);
-#endif
-extern void PrintDlg(FontView *fv,SplineChar *sc,MetricsView *mv);
-#if defined(FONTFORGE_CONFIG_GTK)
-#elif defined(FONTFORGE_CONFIG_GDRAW)
-enum sftf_fonttype { sftf_pfb, sftf_ttf, sftf_otf, sftf_bitmap, sftf_pfaedit };
-extern int SFTFSetFont(GGadget *g, int start, int end, SplineFont *sf,
- enum sftf_fonttype, int size, int antialias);
-extern void SFTFRegisterCallback(GGadget *g, void *cbcontext,
- void (*changefontcallback)(void *,SplineFont *,enum sftf_fonttype,int size,int aa));
-extern GGadget *SFTextAreaCreate(struct gwindow *base, GGadgetData *gd,void *data);
-#endif
-extern void DisplayDlg(SplineFont *sf);
extern void ShowAboutScreen(void);
extern void DelayEvent(void (*func)(void *), void *data);
extern void FindProblems(FontView *fv,CharView *cv,SplineChar *sc);
-extern void MetaFont(FontView *fv,CharView *cv,SplineChar *sc);
extern void CVConstrainSelection(CharView *cv,int type);
extern void CVMakeParallel(CharView *cv);
-extern void ScriptDlg(FontView *fv);
+extern void ScriptDlg(FontView *fv,CharView *cv);
# if HANYANG
extern void MenuNewComposition(GWindow gw, struct gmenuitem *, GEvent *);
@@ -1284,68 +935,64 @@ extern void Disp_DefaultTemplate(CharView *cv);
extern SearchView *SVCreate(FontView *fv);
extern void SVCharViewInits(SearchView *sv);
-#ifdef FONTFORGE_CONFIG_GDRAW
-extern void SVMenuClose(GWindow gw,struct gmenuitem *mi,GEvent *e);
+extern void SV_DoClose(struct cvcontainer *cvc);
extern void SVChar(SearchView *sv, GEvent *event);
-#endif
extern void SVMakeActive(SearchView *sv,CharView *cv);
extern int SVAttachFV(FontView *fv,int ask_if_difficult);
extern void SVDetachFV(FontView *fv);
-extern void ShowAtt(SplineFont *sf);
+extern void MKDMakeActive(MathKernDlg *mkd,CharView *cv);
+extern void MKDChar(MathKernDlg *mkd, GEvent *event);
+extern void MKD_DoClose(struct cvcontainer *cvc);
+extern void MKDCharViewInits(MathKernDlg *mkd);
+extern void MathKernDialog(SplineChar *sc,int def_layer);
+
+extern void ShowAtt(SplineFont *sf,int def_layer);
extern void FontCompareDlg(FontView *fv);
-extern void SFShowKernPairs(SplineFont *sf,SplineChar *sc,AnchorClass *ac);
+extern void SFShowKernPairs(SplineFont *sf,SplineChar *sc,AnchorClass *ac,int layer);
extern void SFShowLigatures(SplineFont *sf,SplineChar *sc);
extern void SCEditInstructions(SplineChar *sc);
extern void SFEditTable(SplineFont *sf, uint32 tag);
extern void IIScrollTo(struct instrinfo *ii,int ip,int mark_stop);
extern void IIReinit(struct instrinfo *ii,int ip);
-#ifdef FONTFORGE_CONFIG_GDRAW
extern int ii_v_e_h(GWindow gw, GEvent *event);
extern void instr_scroll(struct instrinfo *ii,struct sbevent *sb);
-#endif
extern void CVGridFitChar(CharView *cv);
extern void CVFtPpemDlg(CharView *cv,int debug);
extern void SCDeGridFit(SplineChar *sc);
+extern void SCReGridFit(SplineChar *sc,int layer);
extern void CVDebugReInit(CharView *cv,int restart_debug,int dbg_fpgm);
extern void CVDebugFree(DebugView *dv);
-#if defined(FONTFORGE_CONFIG_GDRAW)
extern int DVChar(DebugView *dv, GEvent *e);
-#endif
-extern void KernClassD(KernClass *kc, SplineFont *sf, int isv);
-extern void ShowKernClasses(SplineFont *sf,MetricsView *mv,int isv);
+extern void KernClassD(KernClass *kc, SplineFont *sf, int layer, int isv);
+extern void ShowKernClasses(SplineFont *sf,MetricsView *mv,int layer,int isv);
extern void KCLD_End(struct kernclasslistdlg *kcld);
extern void KCLD_MvDetach(struct kernclasslistdlg *kcld,MetricsView *mv);
-extern void KernPairD(SplineFont *sf,SplineChar *sc1,SplineChar *sc2,int isv);
-#if defined(FONTFORGE_CONFIG_GDRAW)
+extern void KernPairD(SplineFont *sf,SplineChar *sc1,SplineChar *sc2,int layer, int isv);
extern void KCD_DrawGlyph(GWindow pixmap,int x,int baseline,BDFChar *bdfc,int mag);
-#endif
extern GTextInfo *BuildFontList(FontView *except);
extern void TFFree(GTextInfo *tf);
-extern void AnchorControl(SplineChar *sc,AnchorPoint *ap);
-extern void AnchorControlClass(SplineFont *_sf,AnchorClass *ac);
+extern void AnchorControl(SplineChar *sc,AnchorPoint *ap,int layer);
+extern void AnchorControlClass(SplineFont *_sf,AnchorClass *ac,int layer);
extern void FVSelectByPST(FontView *fv);
-extern void SFUntickAll(SplineFont *sf);
enum hist_type { hist_hstem, hist_vstem, hist_blues };
struct psdict;
-extern void SFHistogram(SplineFont *sf,struct psdict *private,uint8 *selected,
+extern void SFHistogram(SplineFont *sf,int layer, struct psdict *private,uint8 *selected,
EncMap *map, enum hist_type which);
extern void CCD_Close(struct contextchaindlg *ccd);
extern int CCD_NameListCheck(SplineFont *sf,const char *ret,int empty_bad,char *title);
-#if defined(FONTFORGE_CONFIG_GDRAW)
extern struct contextchaindlg *ContextChainEdit(SplineFont *sf,FPST *fpst,
struct gfi_data *gfi,unichar_t *newname);
extern int CCD_InvalidClassList(char *ret,GGadget *list,int wasedit);
extern char *cu_copybetween(const unichar_t *start, const unichar_t *end);
-#endif
extern struct statemachinedlg *StateMachineEdit(SplineFont *sf,ASM *sm,struct gfi_data *d);
extern void SMD_Close(struct statemachinedlg *smd);
@@ -1355,31 +1002,22 @@ extern void GFI_SMDEnd(struct gfi_data *d);
extern void MMChangeBlend(MMSet *mm,FontView *fv,int tonew);
extern void MMWizard(MMSet *mm);
-extern int LayerDialog(Layer *layer);
+extern int LayerDialog(Layer *layer,SplineFont *sf);
extern void CVLayerChange(CharView *cv);
-extern void CVPointOfView(CharView *cv,struct pov_data *);
extern int PointOfViewDlg(struct pov_data *pov,SplineFont *sf,int flags);
extern SplineChar *FVMakeChar(FontView *fv,int i);
-extern void CVYPerspective(CharView *cv,double x_vanish, double y_vanish);
+extern void CVPointOfView(CharView *cv,struct pov_data *);
extern void DVCreateGloss(DebugView *dv);
extern int CVXPos(DebugView *dv,int offset,int width);
-extern EncMap *EncMapFromEncoding(SplineFont *sf,Encoding *enc);
-extern void SFRemoveGlyph(SplineFont *sf,SplineChar *sc, int *flags);
-extern void FVAddEncodingSlot(FontView *fv,int gid);
-extern void SFAddEncodingSlot(SplineFont *sf,int gid);
-extern void SFAddGlyphAndEncode(SplineFont *sf,SplineChar *sc,EncMap *basemap, int baseenc);
-#if defined(FONTFORGE_CONFIG_GDRAW)
extern GMenuItem *GetEncodingMenu(void (*func)(GWindow,GMenuItem *,GEvent *),
Encoding *current);
extern GTextInfo *TIFromName(const char *name);
-#endif
-#endif /* FONTFORGE_CONFIG_NO_WINDOWING_UI */
enum subtable_data_flags {
/* I have flags for each alternative because I want "unspecified" to be */
@@ -1396,25 +1034,54 @@ struct subtable_data {
};
extern GTextInfo **SFLookupListFromType(SplineFont *sf, int lookup_type );
-extern GTextInfo **SFSubtablesOfType(SplineFont *sf, int lookup_type, int kernclass);
-extern GTextInfo *SFSubtableListOfType(SplineFont *sf, int lookup_type, int kernclass);
-extern struct lookup_subtable *SFNewLookupSubtableOfType(SplineFont *sf, int lookup_type, struct subtable_data *sd );
+extern GTextInfo **SFSubtablesOfType(SplineFont *sf, int lookup_type, int kernclass, int add_none);
+extern GTextInfo *SFSubtableListOfType(SplineFont *sf, int lookup_type, int kernclass, int add_none);
+extern struct lookup_subtable *SFNewLookupSubtableOfType(SplineFont *sf, int lookup_type, struct subtable_data *sd, int def_layer );
extern int EditLookup(OTLookup *otl,int isgpos,SplineFont *sf);
extern int EditSubtable(struct lookup_subtable *sub,int isgpos,SplineFont *sf,
- struct subtable_data *sd);
+ struct subtable_data *sd,int def_layer);
extern void _LookupSubtableContents(SplineFont *sf, struct lookup_subtable *sub,
- struct subtable_data *sd);
+ struct subtable_data *sd,int def_layer);
+extern unichar_t **SFGlyphNameCompletion(SplineFont *sf,GGadget *t,int from_tab,
+ int new_name_after_space);
+extern void AddRmLang(SplineFont *sf, struct lkdata *lk,int add_lang);
+extern void FVMassGlyphRename(FontView *fv);
extern void SFBdfProperties(SplineFont *sf, EncMap *map, BDFFont *thisone);
-struct instrdlg;
-uint8 *_IVParse(struct instrdlg *iv, char *text, int *len);
-char *_IVUnParseInstrs(uint8 *instrs,int instr_cnt);
-#ifdef FONTFORGE_CONFIG_GDRAW
extern GMenuItem2 helplist[];
-#endif
extern BasePoint last_ruler_offset[];
+extern void CVCopyLayerToLayer(CharView *cv);
+extern void FVCopyLayerToLayer(FontView *fv);
+extern void CVCompareLayerToLayer(CharView *cv);
+extern void FVCompareLayerToLayer(FontView *fv);
+
+extern void MathInit(void);
+extern void SFMathDlg(SplineFont *sf,int def_layer);
+
+extern GMenuItem2 *cvpy_menu, *fvpy_menu;
+extern void cvpy_tllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e);
+extern void fvpy_tllistcheck(GWindow gw,struct gmenuitem *mi,GEvent *e);
+
+extern void SFValidationWindow(SplineFont *sf,int layer, enum fontformat format);
+extern void ValidationDestroy(SplineFont *sf);
+
+
+
+extern const char *UI_TTFNameIds(int id);
+extern const char *UI_MSLangString(int language);
+extern void FontInfoInit(void);
+extern void LookupUIInit(void);
+extern enum psstrokeflags Ps_StrokeFlagsDlg(void);
+extern struct cidmap *AskUserForCIDMap(void);
+
+extern void DefineGroups(struct fontview *fv);
+extern void DisplayGroups(struct fontview *fv);
+
+extern struct Base *SFBaselines(SplineFont *sf,struct Base *old,int is_vertical);
+
+extern struct hslrgb *SFFontCols(SplineFont *sf,struct hslrgb fontcols[6]);
#endif /* _VIEWS_H */
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gdraw/Makefile.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gdraw/Makefile.in
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gdraw/Makefile.in
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/Makefile.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/Makefile.in
new file mode 100644
index 00000000000..f03229b8806
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/Makefile.in
@@ -0,0 +1,45 @@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+VPATH = @srcdir@
+bindir = @bindir@
+libdir = @libdir@
+
+GU_VERSION=1
+GU_REVISION=3
+GU_AGE=0
+
+LIBTOOL = @LIBTOOL@
+CC = @CC@
+
+X_CFLAGS = @X_CFLAGS@
+X_LIBS = @X_LIBS@
+X_11LIB = @X_11LIB@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+STATIC_LIBS = @STATIC_LIBS@
+
+libgutils_OBJECTS = fsys.lo gwwintl.lo
+
+Incs = -I$(top_builddir)/inc -I$(top_srcdir)/inc -I/usr/pkg/include -I/usr/pkg/include/giflib
+CFLAGS = @CFLAGS@ @CPPFLAGS@ $(Incs) @WFLAGS@ $(X_CFLAGS) -DNOTHREADS @DEFS@ -DLIBDIR='"$(libdir)"'
+
+both: ../libgutils.la
+
+../libgutils.la: $(libgutils_OBJECTS)
+ $(LIBTOOL) --mode=link $(CC) -no-undefined $(CFLAGS) @LDFLAGS@ -o ../libgutils.la $(libgutils_OBJECTS) \
+ ../libgunicode.la @LIBS@ \
+ $(STATIC_LIBS) \
+ -rpath $(libdir) -version-info $(GU_VERSION):$(GU_REVISION):$(GU_AGE)
+
+%.lo: %.c
+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<
+
+clean:
+ -rm -f *.lo *.o .libs/* ../libgutils.la
+
+distclean cleaner:
+ -rm -f *.lo *.o ../libgutils.la Makefile .libs/*
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/fsys.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/fsys.c
new file mode 100644
index 00000000000..dfad4bd395e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/fsys.c
@@ -0,0 +1,487 @@
+/* Copyright (C) 2000-2004 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include "ustring.h"
+#include "fileutil.h"
+#include "gfile.h"
+#include <sys/types.h>
+#include <sys/stat.h> /* for mkdir */
+#include <unistd.h>
+
+#ifdef _WIN32
+#define MKDIR(A,B) mkdir(A)
+#else
+#define MKDIR(A,B) mkdir(A,B)
+#endif
+
+static char dirname_[1024];
+
+char *GFileGetAbsoluteName(char *name, char *result, int rsiz) {
+ /* result may be the same as name */
+ char buffer[1000];
+
+ if ( *name!='/' ) {
+ char *pt, *spt, *rpt, *bpt;
+
+ if ( dirname_[0]=='\0' ) {
+ getcwd(dirname_,sizeof(dirname_));
+ }
+ strcpy(buffer,dirname_);
+ if ( buffer[strlen(buffer)-1]!='/' )
+ strcat(buffer,"/");
+ strcat(buffer,name);
+
+ /* Normalize out any .. */
+ spt = rpt = buffer;
+ while ( *spt!='\0' ) {
+ if ( *spt=='/' ) ++spt;
+ for ( pt = spt; *pt!='\0' && *pt!='/'; ++pt );
+ if ( pt==spt ) /* Found // in a path spec, reduce to / (we've*/
+ strcpy(spt,pt); /* skipped past the :// of the machine name) */
+ else if ( pt==spt+1 && spt[0]=='.' ) /* Noop */
+ strcpy(spt,pt);
+ else if ( pt==spt+2 && spt[0]=='.' && spt[1]=='.' ) {
+ for ( bpt=spt-2 ; bpt>rpt && *bpt!='/'; --bpt );
+ if ( bpt>=rpt && *bpt=='/' ) {
+ strcpy(bpt,pt);
+ spt = bpt;
+ } else {
+ rpt = pt;
+ spt = pt;
+ }
+ } else
+ spt = pt;
+ }
+ name = buffer;
+ if ( rsiz>sizeof(buffer)) rsiz = sizeof(buffer); /* Else valgrind gets unhappy */
+ }
+ if (result!=name) {
+ strncpy(result,name,rsiz);
+ result[rsiz-1]='\0';
+ }
+return(result);
+}
+
+char *GFileMakeAbsoluteName(char *name) {
+ char buffer[1025];
+
+ GFileGetAbsoluteName(name,buffer,sizeof(buffer));
+return( copy(buffer));
+}
+
+char *GFileBuildName(char *dir,char *fname,char *buffer,int size) {
+ int len;
+
+ if ( dir==NULL || *dir=='\0' ) {
+ if ( strlen( fname )<size-1 ) /* valgrind didn't like my strncpies but this complication makes it happy */
+ strcpy(buffer,fname);
+ else {
+ strncpy(buffer,fname,size-1);
+ buffer[size-1]='\0';
+ }
+ } else {
+ if ( buffer!=dir ) {
+ if ( strlen( dir )<size-3 )
+ strcpy(buffer,dir);
+ else {
+ strncpy(buffer,dir,size-3);
+ buffer[size-3]='\0';
+ }
+ }
+ len = strlen(buffer);
+ if ( buffer[len-1]!='/' )
+ buffer[len++] = '/';
+ if ( strlen( fname )<size-1 )
+ strcpy(buffer+len,fname);
+ else {
+ strncpy(buffer+len,fname,size-len-1);
+ buffer[size-1]='\0';
+ }
+ }
+return( buffer );
+}
+
+/* Given a filename in a directory, pick the directory out of it, and */
+/* create a new filename using that directory and the given nametail */
+char *GFileReplaceName(char *oldname,char *fname,char *buffer,int size) {
+ int len;
+ char *dirend;
+
+ dirend = strrchr(oldname,'/');
+ if ( dirend == NULL ) {
+ strncpy(buffer,fname,size-1);
+ buffer[size-1]='\0';
+ } else {
+ *dirend = '\0';
+ if ( buffer!=oldname ) {
+ strncpy(buffer,oldname,size-3);
+ buffer[size-3]='\0';
+ }
+ len = strlen(buffer);
+ *dirend = '/';
+ buffer[len++] = '/';
+ strncpy(buffer+len,fname,size-len-1);
+ buffer[size-1]='\0';
+ }
+return( buffer );
+}
+
+char *GFileNameTail(const char *oldname) {
+ char *pt;
+
+ pt = strrchr(oldname,'/');
+ if ( pt !=NULL )
+return( pt+1);
+ else
+return( (char *)oldname );
+}
+
+char *GFileAppendFile(char *dir,char *name,int isdir) {
+ char *ret, *pt;
+
+ ret = galloc((strlen(dir)+strlen(name)+3));
+ strcpy(ret,dir);
+ pt = ret+strlen(ret);
+ if ( pt>ret && pt[-1]!='/' )
+ *pt++ = '/';
+ strcpy(pt,name);
+ if ( isdir ) {
+ pt += strlen(pt);
+ if ( pt>ret && pt[-1]!='/' ) {
+ *pt++ = '/';
+ *pt = '\0';
+ }
+ }
+return(ret);
+}
+
+int GFileIsAbsolute(const char *file) {
+ if ( *file=='/' )
+return( true );
+ if ( strstr(file,"://")!=NULL )
+return( true );
+
+return( false );
+}
+
+int GFileIsDir(const char *file) {
+#ifdef _WIN32
+ struct stat info;
+ if (stat(file, &info))
+return 0;
+ else
+return ((info.st_mode&_S_IFDIR));
+#else
+ char buffer[1000];
+ sprintf(buffer,"%s/.",file);
+return( access(buffer,0)==0 );
+#endif
+}
+
+int GFileExists(const char *file) {
+return( access(file,0)==0 );
+}
+
+int GFileModifyable(const char *file) {
+return( access(file,02)==0 );
+}
+
+int GFileModifyableDir(const char *file) {
+ char buffer[1024], *pt;
+
+ strcpy(buffer,file);
+ pt = strrchr(buffer,'/');
+ if ( pt==NULL )
+ strcpy(buffer,".");
+ else
+ *pt='\0';
+return( GFileModifyable(buffer));
+}
+
+int GFileReadable(char *file) {
+return( access(file,04)==0 );
+}
+
+int GFileMkDir(char *name) {
+return( MKDIR(name,0755));
+}
+
+int GFileRmDir(char *name) {
+return(rmdir(name));
+}
+
+int GFileUnlink(char *name) {
+return(unlink(name));
+}
+
+char *_GFile_find_program_dir(char *prog) {
+ char *pt, *path, *program_dir=NULL;
+ char filename[2000];
+
+ if ( (pt = strrchr(prog,'/'))!=NULL )
+ program_dir = copyn(prog,pt-prog);
+ else if ( (path = getenv("PATH"))!=NULL ) {
+ while ((pt = strchr(path,':'))!=NULL ) {
+ sprintf(filename,"%.*s/%s", (int)(pt-path), path, prog);
+ /* Under cygwin, applying access to "potrace" will find "potrace.exe" */
+ /* no need for special check to add ".exe" */
+ if ( access(filename,1)!= -1 ) {
+ program_dir = copyn(path,pt-path);
+ break;
+ }
+ path = pt+1;
+ }
+ if ( program_dir==NULL ) {
+ sprintf(filename,"%s/%s", path, prog);
+ if ( access(filename,1)!= -1 )
+ program_dir = copy(path);
+ }
+ }
+ if ( program_dir==NULL )
+return( NULL );
+ GFileGetAbsoluteName(program_dir,filename,sizeof(filename));
+ gfree(program_dir);
+ program_dir = copy(filename);
+return( program_dir );
+}
+
+unichar_t *u_GFileGetAbsoluteName(unichar_t *name, unichar_t *result, int rsiz) {
+ /* result may be the same as name */
+ unichar_t buffer[1000];
+
+ if ( *name!='/' ) {
+ unichar_t *pt, *spt, *rpt, *bpt;
+
+ if ( dirname_[0]=='\0' ) {
+ getcwd(dirname_,sizeof(dirname_));
+ }
+ uc_strcpy(buffer,dirname_);
+ if ( buffer[u_strlen(buffer)-1]!='/' )
+ uc_strcat(buffer,"/");
+ u_strcat(buffer,name);
+
+ /* Normalize out any .. */
+ spt = rpt = buffer;
+ while ( *spt!='\0' ) {
+ if ( *spt=='/' ) ++spt;
+ for ( pt = spt; *pt!='\0' && *pt!='/'; ++pt );
+ if ( pt==spt ) /* Found // in a path spec, reduce to / (we've*/
+ u_strcpy(spt,pt); /* skipped past the :// of the machine name) */
+ else if ( pt==spt+1 && spt[0]=='.' ) /* Noop */
+ u_strcpy(spt,pt);
+ else if ( pt==spt+2 && spt[0]=='.' && spt[1]=='.' ) {
+ for ( bpt=spt-2 ; bpt>rpt && *bpt!='/'; --bpt );
+ if ( bpt>=rpt && *bpt=='/' ) {
+ u_strcpy(bpt,pt);
+ spt = bpt;
+ } else {
+ rpt = pt;
+ spt = pt;
+ }
+ } else
+ spt = pt;
+ }
+ name = buffer;
+ }
+ if (result!=name) {
+ u_strncpy(result,name,rsiz);
+ result[rsiz-1]='\0';
+ }
+return(result);
+}
+
+unichar_t *u_GFileBuildName(unichar_t *dir,unichar_t *fname,unichar_t *buffer,int size) {
+ int len;
+
+ if ( dir==NULL || *dir=='\0' ) {
+ u_strncpy(buffer,fname,size-1);
+ buffer[size-1]='\0';
+ } else {
+ if ( buffer!=dir ) {
+ u_strncpy(buffer,dir,size-3);
+ buffer[size-3]='\0';
+ }
+ len = u_strlen(buffer);
+ if ( buffer[len-1]!='/' )
+ buffer[len++] = '/';
+ u_strncpy(buffer+len,fname,size-len-1);
+ buffer[size-1]='\0';
+ }
+return( buffer );
+}
+
+/* Given a filename in a directory, pick the directory out of it, and */
+/* create a new filename using that directory and the given nametail */
+unichar_t *u_GFileReplaceName(unichar_t *oldname,unichar_t *fname,unichar_t *buffer,int size) {
+ int len;
+ unichar_t *dirend;
+
+ dirend = u_strrchr(oldname,'/');
+ if ( dirend == NULL ) {
+ u_strncpy(buffer,fname,size-1);
+ buffer[size-1]='\0';
+ } else {
+ *dirend = '\0';
+ if ( buffer!=oldname ) {
+ u_strncpy(buffer,oldname,size-3);
+ buffer[size-3]='\0';
+ }
+ len = u_strlen(buffer);
+ *dirend = '/';
+ buffer[len++] = '/';
+ u_strncpy(buffer+len,fname,size-len-1);
+ buffer[size-1]='\0';
+ }
+return( buffer );
+}
+
+unichar_t *u_GFileNameTail(const unichar_t *oldname) {
+ unichar_t *pt;
+
+ pt = u_strrchr(oldname,'/');
+ if ( pt !=NULL )
+return( pt+1);
+ else
+return( (unichar_t *)oldname );
+}
+
+unichar_t *u_GFileNormalize(unichar_t *name) {
+ unichar_t *pt, *base, *ppt;
+
+ if ( (pt = uc_strstr(name,"://"))!=NULL ) {
+ base = u_strchr(pt+3,'/');
+ if ( base==NULL )
+return( name );
+ ++base;
+ } else if ( *name=='/' )
+ base = name+1;
+ else
+ base = name;
+ for ( pt=base; *pt!='\0'; ) {
+ if ( *pt=='/' )
+ u_strcpy(pt,pt+1);
+ else if ( uc_strncmp(pt,"./",2)==0 )
+ u_strcpy(pt,pt+2);
+ else if ( uc_strncmp(pt,"../",2)==0 ) {
+ for ( ppt=pt-2; ppt>=base && *ppt!='/'; --ppt );
+ ++ppt;
+ if ( ppt>=base ) {
+ u_strcpy(ppt,pt+3);
+ pt = ppt;
+ } else
+ pt += 3;
+ } else {
+ while ( *pt!='/' && *pt!='\0' ) ++pt;
+ if ( *pt == '/' ) ++pt;
+ }
+ }
+return( name );
+}
+
+unichar_t *u_GFileAppendFile(unichar_t *dir,unichar_t *name,int isdir) {
+ unichar_t *ret, *pt;
+
+ ret = galloc((u_strlen(dir)+u_strlen(name)+3)*sizeof(unichar_t));
+ u_strcpy(ret,dir);
+ pt = ret+u_strlen(ret);
+ if ( pt>ret && pt[-1]!='/' )
+ *pt++ = '/';
+ u_strcpy(pt,name);
+ if ( isdir ) {
+ pt += u_strlen(pt);
+ if ( pt>ret && pt[-1]!='/' ) {
+ *pt++ = '/';
+ *pt = '\0';
+ }
+ }
+return(ret);
+}
+
+int u_GFileIsAbsolute(const unichar_t *file) {
+ if ( *file=='/' )
+return( true );
+ if ( uc_strstr(file,"://")!=NULL )
+return( true );
+
+return( false );
+}
+
+int u_GFileIsDir(const unichar_t *file) {
+ char buffer[1024];
+ cu_strcpy(buffer,file);
+ strcat(buffer,"/.");
+return( access(buffer,0)==0 );
+}
+
+int u_GFileExists(const unichar_t *file) {
+ char buffer[1024];
+ cu_strcpy(buffer,file);
+return( access(buffer,0)==0 );
+}
+
+int u_GFileModifyable(const unichar_t *file) {
+ char buffer[1024];
+ cu_strcpy(buffer,file);
+return( access(buffer,02)==0 );
+}
+
+int u_GFileModifyableDir(const unichar_t *file) {
+ char buffer[1024], *pt;
+
+ cu_strcpy(buffer,file);
+ pt = strrchr(buffer,'/');
+ if ( pt==NULL )
+ strcpy(buffer,".");
+ else
+ *pt='\0';
+return( GFileModifyable(buffer));
+}
+
+int u_GFileReadable(unichar_t *file) {
+ char buffer[1024];
+ cu_strcpy(buffer,file);
+return( access(buffer,04)==0 );
+}
+
+int u_GFileMkDir(unichar_t *name) {
+ char buffer[1024];
+ cu_strcpy(buffer,name);
+return( MKDIR(buffer,0755));
+}
+
+int u_GFileRmDir(unichar_t *name) {
+ char buffer[1024];
+ cu_strcpy(buffer,name);
+return(rmdir(buffer));
+}
+
+int u_GFileUnlink(unichar_t *name) {
+ char buffer[1024];
+ cu_strcpy(buffer,name);
+return(unlink(buffer));
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/gwwintl.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/gwwintl.c
new file mode 100644
index 00000000000..701f52311c3
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/gutils/gwwintl.c
@@ -0,0 +1,136 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <basics.h>
+#include <intl.h>
+
+char *sgettext(const char *msgid) {
+ const char *msgval = _(msgid);
+ char *found;
+ if (msgval == msgid)
+ if ( (found = strrchr (msgid, '|'))!=NULL )
+ msgval = found+1;
+return (char *) msgval;
+}
+
+#if defined( HAVE_LIBINTL_H ) && !defined( NODYNAMIC ) && !defined ( _STATIC_LIBINTL )
+# include <dynamic.h>
+
+static DL_CONST void *libintl = NULL;
+
+static char *(*_bind_textdomain_codeset)(const char *, const char *);
+static char *(*_bindtextdomain)(const char *, const char *);
+static char *(*_textdomain)(const char *);
+static char *(*_gettext)(const char *);
+static char *(*_ngettext)(const char *, const char *, unsigned long int);
+static char *(*_dgettext)(const char *, const char *);
+
+static int init_gettext(void) {
+
+ if ( libintl == (void *) -1 )
+return( false );
+ else if ( libintl !=NULL )
+return( true );
+
+ libintl = dlopen("libintl" SO_EXT,RTLD_LAZY);
+ if ( libintl==NULL ) {
+ libintl = (void *) -1;
+return( false );
+ }
+
+ _bind_textdomain_codeset = (char *(*)(const char *, const char *)) dlsym(libintl,"bind_textdomain_codeset");
+ _bindtextdomain = (char *(*)(const char *, const char *)) dlsym(libintl,"bindtextdomain");
+ _textdomain = (char *(*)(const char *)) dlsym(libintl,"textdomain");
+ _gettext = (char *(*)(const char *)) dlsym(libintl,"gettext");
+ _ngettext = (char *(*)(const char *, const char *, unsigned long int)) dlsym(libintl,"ngettext");
+ _dgettext = (char *(*)(const char *, const char *)) dlsym(libintl,"dgettext");
+
+ if ( _bind_textdomain_codeset==NULL || _bindtextdomain==NULL ||
+ _textdomain==NULL || _gettext==NULL || _ngettext==NULL ) {
+ libintl = (void *) -1;
+ fprintf( stderr, "Found a copy of libintl but could not use it.\n" );
+return( false );
+ }
+return( true );
+}
+
+char *gwwv_bind_textdomain_codeset(const char *domain, const char *dir) {
+ if ( libintl==NULL )
+ init_gettext();
+ if ( libintl!=(void *) -1 )
+return( (_bind_textdomain_codeset)(domain,dir));
+
+return( NULL );
+}
+
+char *gwwv_bindtextdomain(const char *domain, const char *dir) {
+ if ( libintl==NULL )
+ init_gettext();
+ if ( libintl!=(void *) -1 )
+return( (_bindtextdomain)(domain,dir));
+
+return( NULL );
+}
+
+char *gwwv_textdomain(const char *domain) {
+ if ( libintl==NULL )
+ init_gettext();
+ if ( libintl!=(void *) -1 )
+return( (_textdomain)(domain));
+
+return( NULL );
+}
+
+char *gwwv_gettext(const char *msg) {
+ if ( libintl==NULL )
+ init_gettext();
+ if ( libintl!=(void *) -1 )
+return( (_gettext)(msg));
+
+return( (char *) msg );
+}
+
+char *gwwv_ngettext(const char *msg, const char *pmsg,unsigned long int n) {
+ if ( libintl==NULL )
+ init_gettext();
+ if ( libintl!=(void *) -1 )
+return( (_ngettext)(msg,pmsg,n));
+
+return( (char *) (n==1?msg:pmsg) );
+}
+
+char *gwwv_dgettext(const char *domain, const char *msg) {
+ if ( libintl==NULL )
+ init_gettext();
+ if ( libintl!=(void *) -1 && _dgettext!=NULL )
+return( (_dgettext)(domain,msg));
+
+return( (char *) msg );
+}
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/basics.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/basics.h
index 97c172d4461..54454b5961e 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/basics.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/basics.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -30,6 +30,15 @@
#ifdef VMS /* these three lines from Jacob Jansen, Open VMS port */
# include <vms_jackets.h>
#endif
+#ifdef HAVE_CONFIG_H
+/* cross-compiler woes */
+#ifdef __MINGW32__
+#define _CTYPE_H_
+#endif
+# include "config.h"
+#endif
+#define gfree ff_gfree
+#define grealloc ff_grealloc
#include <stdio.h> /* for NULL */
#ifdef HAVE_STDINT_H
@@ -45,16 +54,11 @@
#define forever for (;;)
-#ifndef _AIX
-
typedef int32_t int32;
-typedef int16_t int16;
-typedef int8_t int8;
-
-#endif
-
typedef uint32_t uint32;
+typedef int16_t int16;
typedef uint16_t uint16;
+typedef int8_t int8;
typedef uint8_t uint8;
/* An integral type which can hold a pointer */
@@ -66,12 +70,6 @@ typedef uint16 unichar_t;
typedef uint32 unichar_t;
#endif
-
-#define gfree ff_gree
-#define galloc ff_galloc
-#define grealloc ff_grealloc
-#define gcalloc ff_gcalloc
-
extern void *galloc(long size);
extern void *gcalloc(int cnt, long size);
extern void *grealloc(void *,long size);
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/chardata.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/chardata.h
index fd2247f7e1b..fd2247f7e1b 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/chardata.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/chardata.h
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/charset.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/charset.h
index f893c2f0ec4..124c56b6088 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/charset.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/charset.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -65,7 +65,7 @@ extern int /*enum charset*/ local_encoding;
# include <iconv.h>
extern char *iconv_local_encoding_name;
#else
-# include <gwwiconv.h> /* My fake iconv based on encodings in gdraw/gunicode */
+# include "gwwiconv.h" /* My fake iconv based on encodings in gdraw/gunicode */
#endif
extern struct namemap { char *name; int map; } encodingnames[];
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/config.h.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/config.h.in
new file mode 100644
index 00000000000..a27baff5fda
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/config.h.in
@@ -0,0 +1,67 @@
+#ifndef _FF_CONFIG_H
+# define _FF_CONFIG_H 1
+#define LUA_FF_LIB 1
+#undef HAVE_DLFCN_H
+#define _NO_PYTHON 1
+#undef HAVE_ICONV_H
+#undef HAVE_STDINT_H
+#undef HAVE_LANGINFO_H
+#undef HAVE_PTHREAD_H
+/* #undef HAVE_LIBINTL_H */
+#undef HAVE_IEEEFP_H
+#undef FREETYPE_HAS_DEBUGGER
+/* #undef HAVE_LONG_DOUBLE */ /* don't do this */
+/* #undef _HAS_LONGLONG */ /* don't do this */
+#undef _STATIC_LIBINTL
+#undef _STATIC_LIBUNGIF
+#undef _STATIC_LIBPNG
+#undef _STATIC_LIBPNG12
+#undef _STATIC_LIBTIFF
+#undef _STATIC_LIBJPEG
+#undef _STATIC_LIBSPIRO
+#undef _STATIC_LIBXML2
+#undef _STATIC_LIBFREETYPE
+#undef _STATIC_LIBUNINAMESLIST
+#undef _STATIC_LIBCAIRO
+#define _NO_LIBUNINAMESLIST 1
+#undef SHAREDIR
+#undef LIBDIR
+#undef PREFIX
+#undef _CursorsMustBe16x16
+#undef _Keyboard
+#undef __Mac
+#undef _BrokenBitmapImages
+#undef _ModKeysAutoRepeat
+#undef __CygWin
+#define _NO_XINPUT 1
+/* #undef FONTFORGE_CONFIG_CAPSLOCK_FOR_ALT */
+/* #undef FONTFORGE_CONFIG_SHOW_RAW_POINTS */
+/* #undef FONTFORGE_CONFIG_TYPE3 */
+/* #undef FONTFORGE_CONFIG_DEVICETABLES */
+/* #undef FONTFORGE_CONFIG_USE_DOUBLE */
+/* #undef FONTFORGE_CONFIG_USE_LONGDOUBLE */
+/* #undef FONTFORGE_CONFIG_PASTEAFTER */
+/* #undef FONTFORGE_CONFIG_GB12345 */
+/* #undef FONTFORGE_CONFIG_TILEPATH */
+#define _NO_FFSCRIPT 1
+#undef _NO_TZSET
+#define _NO_FREETYPE 1
+#define _NO_LIBXML 1
+#define _NO_LIBUNGIF 1
+#define _NO_LIBPNG 1
+#undef _LIBPNG12
+#define _NO_LIBJPEG 1
+#define _NO_LIBTIFF 1
+#define _NO_LIBSPIRO 1
+#define NODYNAMIC 1
+#define NOPLUGIN 1
+#undef FREETYPE_HAS_DEBUGGER
+#undef _NO_SNPRINTF
+#define _NO_XKB 1
+#define X_DISPLAY_MISSING 1
+#undef PYTHON_LIB_NAME
+#define _NO_LIBCAIRO 1
+#define _NO_LIBPANGO 1
+#undef WORDS_BIGENDIAN
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/dynamic.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/dynamic.h
index fce7746f20f..4c5be9d8ac4 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/dynamic.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/dynamic.h
@@ -6,18 +6,36 @@
#ifndef __DYNAMIC_H
# define __DYNAMIC_H
-# ifdef __Mac
+# if defined(__Mac)
+/* In 10.3 the mac got normal dlopen routines */
+# include <dlfcn.h>
+# define SO_EXT ".dylib"
+# define SO_0_EXT ".0.dylib"
+# define SO_1_EXT ".1.dylib"
+# define SO_2_EXT ".2.dylib"
+# define SO_6_EXT ".6.dylib"
+# define DL_CONST
+# define dlopen(name,foo) gwwv_dlopen(name,foo)
+extern void *gwwv_dlopen(char *name,int flags);
+# elif defined(__Mac)
# include <mach-o/dyld.h>
extern const void *gwwv_NSAddImage(char *name,uint32_t options);
# define SO_EXT ".dylib"
+# define SO_0_EXT ".0.dylib"
+# define SO_1_EXT ".1.dylib"
+# define SO_2_EXT ".2.dylib"
+# define SO_6_EXT ".6.dylib"
/* man NSModule */
# define dlopen(name,foo) gwwv_NSAddImage(name,NSADDIMAGE_OPTION_WITH_SEARCHING|NSADDIMAGE_OPTION_RETURN_ON_ERROR)
/* It would have been nice if the Mac's docs had mentioned that the linker adds*/
/* an underscore to symbol names.... */
# define dlsym(image,symname) NSAddressOfSymbol(NSLookupSymbolInImage(image,"_" symname,NSLOOKUPSYMBOLINIMAGE_OPTION_BIND|NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR))
+# define dlsymmod(symname) ("_" symname)
+# define dlsymbare(image,symname) NSAddressOfSymbol(NSLookupSymbolInImage(image,symname,NSLOOKUPSYMBOLINIMAGE_OPTION_BIND|NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR))
# define DL_CONST const
# define dlclose(image_ptr) /* Don't know how to do this on mac */
# define dlerror() "Error when loading dynamic library"
+# elif defined(__Mac)
# else
# include <dlfcn.h>
# ifdef __CygWin
@@ -27,9 +45,18 @@ void *libtool_laopen(const char *filename, int flags);
#ifdef __VMS
# define SO_EXT ".exe"
#else
-# define SO_EXT ".so"
+# define SO_EXT ".so"
+# define SO_0_EXT ".so.0"
+# define SO_1_EXT ".so.1"
+# define SO_2_EXT ".so.2"
+# define SO_6_EXT ".so.6"
#endif
#define DL_CONST
# endif
+# ifndef dlsymmod
+# define dlsymmod(symname) (symname)
+# define dlsymbare(image,symname) dlsym(image,symname)
+# endif
+
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/fileutil.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/fileutil.h
index 5c9be3a2af3..37b022414d3 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/fileutil.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/fileutil.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gdraw.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gdraw.h
index 9d273ad63f8..4b4fae77435 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gdraw.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gdraw.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -26,69 +26,9 @@
*/
#ifndef _GDRAW_H
#define _GDRAW_H
-#include "basics.h"
+#include "gimage.h"
#include "charset.h"
-typedef uint32 Color;
-
-#define COLOR_UNKNOWN ((Color) 0xffffffff)
-#define COLOR_TRANSPARENT ((Color) 0xffffffff)
-#define COLOR_DEFAULT ((Color) 0xfffffffe)
-#define COLOR_CREATE(r,g,b) (((r)<<16) | ((g)<<8) | (b))
-#define COLOR_RED(col) ((col)>>16)
-#define COLOR_GREEN(col) (((col)>>8) & 0xff)
-#define COLOR_BLUE(col) ((col)&0xff)
-
-typedef struct clut {
- int16 clut_len;
- unsigned int is_grey: 1;
- uint32 trans_index; /* will be ignored for cluts in images, use base->trans instead */
- Color clut[256];
-} GClut;
-
-typedef struct revcmap RevCMap;
-
-enum image_type { it_mono, it_bitmap=it_mono, it_index, it_true };
-
-struct _GImage {
-/* Format: bitmaps are stored with the most significant bit first in byte units
- indexed images are stored in byte units
- true color images are stored in 4 byte units, 0,red,green,blue
-*/
- unsigned int image_type: 2;
- int16 delay; /* for animated GIFs, delay to next frame */
- int32 width, height;
- int32 bytes_per_line;
- uint8 *data;
- GClut *clut;
- Color trans; /* PNG supports more than one transparent color, we don't */
- /* for non-true color images this is the index, not a color */
-};
-
-/* We deal with 1 bit, 8 bit and 32 bit images internal. 1 bit images may have*/
-/* a clut (if they don't assume bw, 0==black, 1==white), 8 bit must have a */
-/* clut, 32bit are actually 24 bit RGB images, but we pad them for easy */
-/* accessing. it_screen means that we've got an image that can be drawn */
-/* directly on the screen */
-typedef struct gimage {
- short list_len; /* length of list */
- union { /* depends on whether has_list is set */
- struct _GImage *image;
- struct _GImage **images;
- } u;
- void *userdata;
-} GImage;
-
-enum pastetrans_type { ptt_paste_trans_to_trans, ptt_old_shines_through};
-
-typedef struct grect {
- int32 x,y,width,height;
-} GRect;
-
-typedef struct gpoint {
- int16 x,y;
-} GPoint;
-
enum font_style { fs_none, fs_italic=1, fs_smallcaps=2, fs_condensed=4, fs_extended=8 };
enum font_type { ft_unknown, ft_serif, ft_sans, ft_mono, ft_cursive, ft_max };
enum text_mods { tm_none, tm_upper=1, tm_lower=2, tm_initialcaps=4, tm_showsofthyphen=8 };
@@ -156,7 +96,7 @@ typedef struct gtextbounds {
/* "width" which may be totally different */
} GTextBounds;
-enum selnames { sn_primary, sn_clipboard, sn_drag_and_drop, sn_max };
+enum selnames { sn_primary, sn_clipboard, sn_drag_and_drop, sn_user1, sn_user2, sn_max };
typedef struct gwindow *GWindow;
typedef struct gdisplay GDisplay;
typedef struct gtimer GTimer;
@@ -169,11 +109,15 @@ enum keystate_mask { ksm_shift=1, ksm_capslock=2, ksm_control=4, ksm_meta=8,
ksm_numlock=0x10, /* It's numlock on my 386 system */
ksm_super=0x40, /* RedHat mask for the key with the windows flag on it */
ksm_hyper=0x80,
-/* Both Suse and Mac OS/X now map option to 0x2000, but under 10.0 it was meta */
- ksm_option=0x2000,
+/* Both Suse and Mac OS/X.2 now map option to 0x2000, but under 10.0 it was meta */
+/* Under 10.4 it is the meta mask again */
+ /*ksm_option=0x2000,*/
+ ksm_menumask=(ksm_control|ksm_meta|ksm_cmdmacosx|0xf0),
+
ksm_button1=(1<<8), ksm_button2=(1<<9), ksm_button3=(1<<10),
ksm_button4=(1<<11), ksm_button5=(1<<12),
- ksm_buttons=(ksm_button1|ksm_button2|ksm_button3|ksm_button4|ksm_button5)};
+ ksm_buttons=(ksm_button1|ksm_button2|ksm_button3|ksm_button4|ksm_button5)
+ };
enum mnemonic_focus { mf_normal, mf_tab, mf_mnemonic, mf_shortcut };
typedef struct gevent {
enum event_type { et_noevent = -1, et_char, et_charup,
@@ -294,7 +238,8 @@ typedef struct gwindow_attrs {
wam_noresize=0x2000, wam_restrict=0x4000, wam_redirect=0x8000,
wam_isdlg=0x10000, wam_notrestricted=0x20000,
wam_transient=0x40000,
- wam_utf8_wtitle=0x80000, wam_utf8_ititle=0x100000 } mask;
+ wam_utf8_wtitle=0x80000, wam_utf8_ititle=0x100000,
+ wam_cairo=0x200000 } mask;
uint32 event_masks; /* (1<<et_char) | (1<<et_mouseup) etc */
int16 border_width;
Color border_color; /* Color_UNKNOWN if unspecified */
@@ -352,6 +297,13 @@ typedef struct gdeveventmask {
} GDevEventMask;
enum gzoom_flags { gzf_pos=1, gzf_size=2 };
+ /* bit flags for the hasCairo query */
+enum gcairo_flags { gc_buildpath=1, /* Has build path commands (postscript, cairo) */
+ gc_alpha=2, /* Supports alpha channels & translucent colors (cairo, pdf) */
+ gc_xor=4, /* Cairo can't do the traditional XOR drawing that X11 does */
+ gc_pango=8,
+ gc_all = gc_buildpath|gc_alpha
+ };
typedef int (*GDrawEH)(GWindow,GEvent *);
@@ -393,6 +345,7 @@ extern GRect *GDrawGetSize(GWindow w, GRect *ret);
extern GDrawEH GDrawGetEH(GWindow w);
extern void GDrawSetEH(GWindow w,GDrawEH e_h);
extern void GDrawGetPointerPosition(GWindow w, GEvent *mouse);
+extern GWindow GDrawGetPointerWindow(GWindow w);
extern void GDrawRaise(GWindow w);
extern void GDrawRaiseAbove(GWindow w,GWindow below);
extern int GDrawIsAbove(GWindow w,GWindow other);
@@ -436,28 +389,35 @@ extern FontRequest *GDrawDecomposeFont(GFont *fi, FontRequest *rq);
extern enum charset GDrawFindEncoding(unichar_t *text, int32 len,
GFont *fi, unichar_t **next, int *ulevel);
extern void GDrawFontMetrics(GFont *fi,int *as, int *ds, int *ld);
+extern void GDrawWindowFontMetrics(GWindow gw,GFont *fi,int *as, int *ds, int *ld);
extern int32 GDrawGetTextPtAfterPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
extern int32 GDrawGetTextPtBeforePos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
extern int32 GDrawGetTextPtFromPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
-int32 GDrawGetTextBounds(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
+int32 GDrawGetTextBounds(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods,
GTextBounds *size);
extern int32 GDrawGetTextWidth(GWindow gw, const unichar_t *text, int32 cnt, FontMods *mods);
extern int32 GDrawDrawText(GWindow gw, int32 x, int32 y, const unichar_t *txt, int32 cnt, FontMods *mods, Color col);
/* Routines that handle bidirectional text */
/* (slower than the equivalent left to right routines) */
-extern int32 GDrawDrawBiText(GWindow gw, int32 x, int32 y, unichar_t *txt, int32 cnt, FontMods *mods, Color col);
-extern int32 GDrawGetBiTextWidth(GWindow gw,unichar_t *text, int len, int32 cnt, FontMods *mods);
-extern int32 GDrawGetBiTextPtAfterPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
+/* will call pango if available. */
+extern int32 GDrawDrawBiText(GWindow gw, int32 x, int32 y, const unichar_t *txt, int32 cnt, FontMods *mods, Color col);
+extern int32 GDrawDrawBiText8(GWindow gw, int32 x, int32 y, const char *txt, int32 cnt, FontMods *mods, Color col);
+extern int32 GDrawGetBiTextWidth(GWindow gw,const unichar_t *text, int len, int32 cnt, FontMods *mods);
+extern int32 GDrawGetBiText8Width(GWindow gw,const char *text, int len, int32 cnt, FontMods *mods);
+extern int32 GDrawGetBiTextPtAfterPos(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
-extern int32 GDrawGetBiTextPtBeforePos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
+extern int32 GDrawGetBiTextPtBeforePos(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
-extern int32 GDrawGetBiTextPtFromPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
+extern int32 GDrawGetBiTextPtFromPos(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
+extern int32 GDrawGetBiTextBounds(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods, GTextBounds *bounds);
+extern int32 GDrawGetBiText8Bounds(GWindow gw,const char *text, int32 cnt, FontMods *mods, GTextBounds *bounds);
extern int GDrawFontHasCharset(FontInstance *fi,/*enum charset*/int charset);
-extern int32 GDrawIsAllLeftToRight(unichar_t *text, int32 cnt);
+extern int32 GDrawIsAllLeftToRight(const unichar_t *text, int32 cnt);
+extern int32 GDrawIsAllLeftToRight8(const char *text, int32 cnt);
extern void GDrawBiText1(GBiText *bd, const unichar_t *text, int32 cnt);
extern void GDrawArabicForms(GBiText *bd, int32 start, int32 end);
extern void _GDrawBiText2(GBiText *bd, int32 start, int32 end);
@@ -489,6 +449,7 @@ extern void GDrawDrawPoly(GWindow w, GPoint *pts, int16 cnt, Color col);
extern void GDrawFillPoly(GWindow w, GPoint *pts, int16 cnt, Color col);
extern void GDrawScroll(GWindow w, GRect *rect, int32 hor, int32 vert);
extern void GDrawDrawImage(GWindow w, GImage *img, GRect *src, int32 x, int32 y);
+extern void GDrawDrawGlyph(GWindow w, GImage *img, GRect *src, int32 x, int32 y);
extern void GDrawDrawScaledImage(GWindow w, GImage *img, int32 x, int32 y);
extern void GDrawDrawImageMagnified(GWindow w, GImage *img, GRect *src, int32 x, int32 y,
int32 width, int32 height);
@@ -503,6 +464,11 @@ extern void GDrawAddSelectionType(GWindow w,enum selnames sel,char *type,
void (*freedata)(void *));
extern void *GDrawRequestSelection(GWindow w,enum selnames sn, char *typename, int32 *len);
extern int GDrawSelectionHasType(GWindow w,enum selnames sn, char *typename);
+extern void GDrawBindSelection(GDisplay *disp,enum selnames sel, char *atomname);
+extern int GDrawSelectionOwned(GDisplay *disp,enum selnames sel);
+extern void GDrawPropertyToSelectionOwner(GDisplay *disp,enum selnames sel,
+ char *property, char *type, int format, int mode,
+ uint8 *data, int nelements);
extern void GDrawPointerUngrab(GDisplay *disp);
extern void GDrawPointerGrab(GWindow w);
@@ -532,62 +498,35 @@ extern void GDrawSetBuildCharHooks(void (*hook)(GDisplay *), void (*inshook)(GDi
extern int GDrawRequestDeviceEvents(GWindow w,int devcnt,struct gdeveventmask *de);
+extern enum gcairo_flags GDrawHasCairo(GWindow w);
+extern void GDrawQueueDrawing(GWindow w,void (*)(GWindow,void *),void *);
+extern void GDrawPathStartNew(GWindow w);
+extern void GDrawPathClose(GWindow w);
+extern void GDrawPathMoveTo(GWindow w,double x, double y);
+extern void GDrawPathLineTo(GWindow w,double x, double y);
+extern void GDrawPathCurveTo(GWindow w,
+ double cx1, double cy1,
+ double cx2, double cy2,
+ double x, double y);
+extern void GDrawPathStroke(GWindow w,Color col);
+extern void GDrawPathFill(GWindow w,Color col);
+extern void GDrawPathFillAndStroke(GWindow w,Color fillcol, Color strokecol);
+extern void GDrawEnableCairo(int on);
+extern void GDrawEnablePango(int on);
+
+extern void GDrawLayoutInit(GWindow w, char *text, int cnt, GFont *fi);
+extern void GDrawLayoutDraw(GWindow w, int32 x, int32 y, Color fg);
+extern void GDrawLayoutIndexToPos(GWindow w, int index, GRect *pos);
+extern int GDrawLayoutXYToIndex(GWindow w, int x, int y);
+extern void GDrawLayoutExtents(GWindow w, GRect *size);
+extern void GDrawLayoutSetWidth(GWindow w, int width);
+extern int GDrawLayoutLineCount(GWindow w);
+extern int GDrawLayoutLineStart(GWindow w,int line);
+
extern void GDrawFatalError(const char *fmt,...);
extern void GDrawIError(const char *fmt,...);
extern void GDrawError(const char *fmt,...);
-extern GImage *GImageCreate(enum image_type type, int32 width, int32 height);
-extern GImage *_GImage_Create(enum image_type type, int32 width, int32 height);
-extern void GImageDestroy(GImage *gi);
-extern GImage *GImageCreateAnimation(GImage **images, int n);
-extern GImage *GImageAddImageBefore(GImage *dest, GImage *src, int pos);
-
-extern GImage *GImageBaseGetSub(struct _GImage *base, enum image_type it, GRect *src, GClut *nclut, RevCMap *rev);
-extern GImage *GImageGetSub(GImage *image,enum image_type it, GRect *src, GClut *nclut, RevCMap *rev);
-extern int GImageInsertToBase(struct _GImage *tobase, GImage *from, GRect *src, RevCMap *rev,
- int to_x, int to_y, enum pastetrans_type ptt );
-extern int GImageInsert(GImage *to, GImage *from, GRect *src, RevCMap *rev,
- int to_x, int to_y, enum pastetrans_type ptt );
-extern Color GImageGetPixelColor(GImage *base,int x, int y);
-extern int GImageGetWidth(GImage *);
-extern int GImageGetHeight(GImage *);
extern int GImageGetScaledWidth(GWindow gw, GImage *img);
extern int GImageGetScaledHeight(GWindow gw, GImage *img);
-extern void *GImageGetUserData(GImage *img);
-extern void GImageSetUserData(GImage *img,void *userdata);
-extern void GImageResize(struct _GImage *tobase, struct _GImage *fbase,
- GRect *src, RevCMap *rev);
-extern GImage *GImageResize32(GImage *from, GRect *src, int width, int height, Color trans);
-extern GImage *GImageResizeSame(GImage *from, GRect *src, int width, int height, RevCMap *rev);
-extern RevCMap *GClutReverse(GClut *clut,int side_size);
-void GClut_RevCMapFree(RevCMap *rev);
-extern GClut *GImageFindCLUT(GImage *image,GClut *clut,int clutmax);
-extern int GImageSameClut(GClut *clut,GClut *nclut);
-extern int GImageGreyClut(GClut *clut);
-extern Color GImageColourFName(unichar_t *name);
-extern Color _GImage_ColourFName(char *name);
-extern char *GImageNameFColour(Color col);
-extern Color GDrawColorDarken(Color col, int by);
-extern Color GDrawColorBrighten(Color col, int by);
-
-extern int GImageWriteGImage(GImage *gi, char *filename);
-extern int GImageWriteBmp(GImage *gi, char *filename);
-extern GImage *GImageRead_Bmp(FILE *file);
-extern GImage *GImageReadBmp(char *filename);
-extern int GImageWriteXbm(GImage *gi, char *filename);
-extern GImage *GImageReadXbm(char *filename);
-extern int GImageWriteXpm(GImage *gi, char *filename);
-extern GImage *GImageReadXpm(char *filename);
-extern int GImageWriteEps(GImage *gi, char *filename);
-extern GImage *GImageReadTiff(char *filename);
-extern GImage *GImageReadJpeg(char *filename);
-extern int GImageWriteJpeg(GImage *gi, char *filename, int quality, int progressive);
-extern GImage *GImageRead_Png(FILE *fp);
-extern GImage *GImageReadPng(char *filename);
-extern int GImageWritePng(GImage *gi, char *filename, int progressive);
-extern GImage *GImageReadGif(char *filename);
-extern int GImageWriteGif(GImage *gi,char *filename,int progressive);
-extern GImage *GImageReadRas(char *filename); /* Sun Raster */
-extern GImage *GImageReadRgb(char *filename); /* SGI */
-extern GImage *GImageRead(char *filename);
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gfile.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gfile.h
index 8a8ee5bcaca..ac60403c3e0 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gfile.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gfile.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/ggadget.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/ggadget.h
index 90e69ddb5a2..41bdba7b909 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/ggadget.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/ggadget.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -51,6 +51,27 @@ typedef struct gtextinfo {
/* should really be in menuitem, but that wastes space and complicates GTextInfoDraw */
} GTextInfo;
+typedef struct gtextinfo2 {
+ unichar_t *text;
+ GImage *image;
+ Color fg;
+ Color bg;
+ void *userdata;
+ GFont *font;
+ unsigned int disabled: 1;
+ unsigned int image_precedes: 1;
+ unsigned int checkable: 1; /* Only for menus */
+ unsigned int checked: 1; /* Only for menus */
+ unsigned int selected: 1; /* Only for lists (used internally for menu(bar)s, when cursor is on the line) */
+ unsigned int line: 1; /* Only for menus */
+ unsigned int text_is_1byte: 1; /* If passed in as 1byte (ie. iso-8859-1) text, will be converted */
+ unsigned int text_in_resource: 1; /* the text field is actually an index into the string resource table */
+ unsigned int changed: 1; /* If a row/column widget changed this */
+ unsigned int sort_me_first_in_list: 1; /* used for directories in file chooser widgets */
+ unichar_t mnemonic; /* Only for menus and menubars */
+ /* should really be in menuitem, but that wastes space and complicates GTextInfoDraw */
+} GTextInfo2;
+
typedef struct gmenuitem {
GTextInfo ti;
unichar_t shortcut;
@@ -90,7 +111,8 @@ enum box_flags {
box_foreground_shadow_outer = 8, /* 1 point line, bottom&right */
box_do_depressed_background = 0x10,
box_draw_default = 0x20, /* if a default button draw a depressed rect around button */
- box_generate_colors = 0x40 /* use border_brightest to compute other border cols */
+ box_generate_colors = 0x40, /* use border_brightest to compute other border cols */
+ box_gradient_bg = 0x80
};
typedef struct gbox {
unsigned char border_type;
@@ -109,6 +131,7 @@ typedef struct gbox {
Color disabled_foreground;
Color active_border;
Color depressed_background;
+ Color gradient_bg_end;
} GBox;
typedef struct ggadget GGadget;
@@ -117,6 +140,7 @@ typedef struct ggadget *GGadgetSet;
enum sb_type { sb_upline, sb_downline, sb_uppage, sb_downpage, sb_track, sb_trackrelease };
typedef int (*GGadgetHandler)(GGadget *,GEvent *);
+typedef unichar_t **(*GTextCompletionHandler)(GGadget *,int from_tab);
typedef struct ggadgetdata {
GRect pos;
@@ -135,6 +159,7 @@ typedef struct ggadgetdata {
struct ggadgetcreatedata **boxelements; /* An array of things to go in the box */
struct matrixinit *matrix;
GDrawEH drawable_e_h; /* Drawable event handler */
+ GTextCompletionHandler completion;
} u;
enum gg_flags { gg_visible=1, gg_enabled=2, gg_pos_in_pixels=4,
gg_sb_vert=8, gg_line_vert=gg_sb_vert,
@@ -189,7 +214,9 @@ struct matrixinit {
struct col_init {
enum me_type { me_int, me_enum, me_real, me_string, me_bigstr, me_func,
me_funcedit,
- me_stringchoice, me_stringchoicetrans, me_stringchoicetag } me_type;
+ me_stringchoice, me_stringchoicetrans, me_stringchoicetag,
+ me_button,
+ me_hex, me_uhex, me_addr } me_type;
char *(*func)(GGadget *,int r,int c);
GTextInfo *enum_vals;
void (*enable_enum)(GGadget *,GMenuItem *, int r, int c);
@@ -201,6 +228,7 @@ struct matrixinit {
intpt md_ival;
double md_real;
char *md_str;
+ void *md_addr;
} u;
uint8 frozen;
uint8 user_bits;
@@ -220,6 +248,7 @@ struct gdirentry;
typedef enum fchooserret (*GFileChooserFilterType)(GGadget *g,struct gdirentry *ent,
const unichar_t *dir);
+ /* Obsolete */
#define _STR_NULL (-1) /* Null string resource */
#define _STR_Language 0
#define _STR_OK 1
@@ -258,6 +287,7 @@ extern void GStringSetFallbackArray(const unichar_t **array,const unichar_t *mn,
const int *ires);
unichar_t *GStringFileGetResource(char *filename, int index,unichar_t *mnemonic);
extern void GResourceUseGetText(void);
+extern FontInstance *GResourceFindFont(char *resourcename,FontInstance *deffont);
void GGadgetDestroy(GGadget *g);
void GGadgetSetVisible(GGadget *g,int visible);
@@ -270,6 +300,7 @@ void GGadgetSetUserData(GGadget *g, void *d);
void GGadgetSetPopupMsg(GGadget *g, const unichar_t *msg);
GRect *GGadgetGetInnerSize(GGadget *g,GRect *rct);
GRect *GGadgetGetSize(GGadget *g,GRect *rct);
+void GGadgetGetDesiredVisibleSize(GGadget *g,GRect *outer, GRect *inner);
void GGadgetGetDesiredSize(GGadget *g,GRect *outer, GRect *inner);
void GGadgetSetDesiredSize(GGadget *g,GRect *outer, GRect *inner);
int GGadgetGetCid(GGadget *g);
@@ -295,6 +326,8 @@ GGadgetHandler GGadgetGetHandler(GGadget *g);
void GTextFieldSelect(GGadget *g,int sel_start, int sel_end);
void GTextFieldShow(GGadget *g,int pos);
void GTextFieldReplace(GGadget *g,const unichar_t *txt);
+void GCompletionFieldSetCompletion(GGadget *g,GTextCompletionHandler completion);
+void GCompletionFieldSetCompletionMode(GGadget *g,int enabled);
void GGadgetClearList(GGadget *g);
void GGadgetSetList(GGadget *g, GTextInfo **ti, int32 copyit);
GTextInfo **GGadgetGetList(GGadget *g,int32 *len); /* Do not free!!! */
@@ -324,6 +357,8 @@ void GTabSetSetNestedExpose(GGadget *g, void (*)(GWindow,GGadget *,GEvent *));
void GTabSetSetNestedMouse(GGadget *g, int (*)(GGadget *,GEvent *));
void GTabSetChangeTabName(GGadget *g, char *name, int pos);
void GTabSetRemetric(GGadget *g);
+void GTabSetRemoveTabByPos(GGadget *g, int pos);
+void GTabSetRemoveTabByName(GGadget *g, char *name);
int32 GScrollBarGetPos(GGadget *g);
int32 GScrollBarSetPos(GGadget *g,int32 pos);
@@ -337,6 +372,8 @@ void GMenuBarSetItemEnabled(GGadget *g, int mid, int enabled);
void GMenuBarSetItemName(GGadget *g, int mid, const unichar_t *name);
void GMenuSetShortcutDomain(char *domain);
const char *GMenuGetShortcutDomain(void);
+int GMenuIsCommand(GEvent *event,char *shortcut);
+int GMenuMask(void);
void GFileChooserPopupCheck(GGadget *g,GEvent *e);
@@ -356,11 +393,19 @@ unichar_t **GFileChooserGetMimetypes(GGadget *g);
void GFileChooserGetChildren(GGadget *g,GGadget **pulldown, GGadget **list, GGadget **tf);
int GFileChooserPosIsDir(GGadget *g, int pos);
unichar_t *GFileChooserFileNameOfPos(GGadget *g, int pos);
+void GFileChooserSetShowHidden(int sh);
+int GFileChooserGetShowHidden(void);
+void GFileChooserSetDirectoryPlacement(int dp);
+int GFileChooserGetDirectoryPlacement(void);
+void GFileChooserSetBookmarks(unichar_t **b);
+unichar_t **GFileChooserGetBookmarks(void);
+void GFileChooserSetPrefsChangedCallback(void *data, void (*p_c)(void *));
void GHVBoxSetExpandableCol(GGadget *g,int col);
void GHVBoxSetExpandableRow(GGadget *g,int row);
void GHVBoxSetPadding(GGadget *g,int hpad, int vpad);
void GHVBoxFitWindow(GGadget *g);
+void GHVBoxReflow(GGadget *g);
void GMatrixEditSet(GGadget *g,struct matrix_data *data, int rows, int copy_it);
struct matrix_data *GMatrixEditGet(GGadget *g, int *rows);
@@ -370,12 +415,14 @@ int GMatrixEditGetColCnt(GGadget *g);
int GMatrixEditGetActiveRow(GGadget *g);
int GMatrixEditGetActiveCol(GGadget *g);
void GMatrixEditDeleteRow(GGadget *g,int row);
+void GMatrixEditScrollToRowCol(GGadget *g,int r, int c);
int GMatrixEditStringDlg(GGadget *g,int row,int col);
void GMatrixEditSetNewText(GGadget *g, char *text);
void GMatrixEditSetOtherButtonEnable(GGadget *g, void (*sob)(GGadget *g, int r, int c));
void GMatrixEditSetMouseMoveReporter(GGadget *g, void (*rmm)(GGadget *g, int r, int c));
void GMatrixEditSetTextChangeReporter(GGadget *g, void (*tcr)(GGadget *g, int r, int c, GGadget *text));
void GMatrixEditSetValidateStr(GGadget *g, char *(*validate)(GGadget *g, int r, int c, int wasnew, char *str));
+void GMatrixEditSetBeforeDelete(GGadget *g, void (*predelete)(GGadget *g, int r));
void GMatrixEditUp(GGadget *g);
void GMatrixEditDown(GGadget *g);
void GMatrixEditSetUpDownVisible(GGadget *g, int enabled);
@@ -383,6 +430,7 @@ void GMatrixEditAddButtons(GGadget *g, GGadgetCreateData *gcd);
void GMatrixEditEnableColumn(GGadget *g, int col, int enabled);
void GMatrixEditShowColumn(GGadget *g, int col, int visible);
void GMatrixEditSetColumnChoices(GGadget *g, int col, GTextInfo *ti);
+void GMatrixEditSetColumnCompletion(GGadget *g, int col, GTextCompletionHandler completion);
GWindow GDrawableGetWindow(GGadget *g);
@@ -423,8 +471,10 @@ GGadget *GListCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GTextFieldCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GPasswordCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GNumericFieldCreate(struct gwindow *base, GGadgetData *gd,void *data);
+GGadget *GTextCompletionCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GTextAreaCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GListFieldCreate(struct gwindow *base, GGadgetData *gd,void *data);
+GGadget *GSimpleListFieldCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GMenuBarCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GMenu2BarCreate(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *GTabSetCreate(struct gwindow *base, GGadgetData *gd,void *data);
@@ -441,44 +491,19 @@ GGadget *CreateFileChooser(struct gwindow *base, GGadgetData *gd,void *data);
GGadget *CreateGadgets(struct gwindow *base, GGadgetCreateData *gcd);
GTextInfo **GTextInfoArrayFromList(GTextInfo *ti, uint16 *cnt);
+GImage *GGadgetResourceFindImage(char *name, GImage *def);
+
+void GGadgetSetImageDir(char *dir);
+void GGadgetSetImagePath(char *path);
+GImage *GGadgetImageCache(char *filename);
extern unichar_t *utf82u_mncopy(const char *utf8buf,unichar_t *mn);
-#if 0
-void GadgetRedraw(Gadget *g);
-void GadgetSetBox(Gadget *g,Box *b);
-Box *GadgetGetBox(Gadget *g);
-Rect *GadgetGetPos(Gadget *g);
-void GadgetMove(Gadget *g, int x, int y);
-void GadgetResize(Gadget *g, int width, int height);
-void GadgetReposition(Gadget *g, Rect *r);
-void GadgetSetVisible(Gadget *g, int visible);
-int GadgetIsVisible(Gadget *g);
-void GadgetSetEnabled(Gadget *g, int enabled);
-int GadgetIsEnabled(Gadget *g);
-void GadgetSetFocus(Gadget *g);
-int GadgetHasFocus(Gadget *g);
-void GadgetSetMnemonic(Gadget *g, int ch);
-int GadgetGetMnemonic(Gadget *g);
-void GadgetSetAccel(Gadget *g, int ch, short mask);
-int GadgetGetAccelChar(Gadget *g);
-short GadgetGetAccelMask(Gadget *g);
-
-void GadgetSetTitle(Gadget *g,const unichar_t *title);
-unichar_t *GadgetGetTitle(Gadget *g);
-void GadgetSetFont(Gadget *g,GFont *font);
-GFont *GadgetGetFont(Gadget *g);
-
-void GadgetSetCheck(Gadget *g,int checked);
-int GadgetGetChecked(Gadget *g);
-
-void GadgetClearList(Gadget *g);
-void GadgetSetListTI(Gadget *g,GTextInfo *ti);
-void GadgetSetList(Gadget *g,unichar_t **list);
-void GadgetPrependToList(Gadget *g,unichar_t *
-
-void GadgetSetMenuItem(Gadget *,MenuItem *m);
-MenuItem *GadgetGetMenuItem(Gadget *);
-#endif
+extern double GetCalmReal8(GWindow gw,int cid,char *namer,int *err);
+extern double GetReal8(GWindow gw,int cid,char *namer,int *err);
+extern int GetCalmInt8(GWindow gw,int cid,char *name,int *err);
+extern int GetInt8(GWindow gw,int cid,char *namer,int *err);
+extern int GetUnicodeChar8(GWindow gw,int cid,char *namer,int *err);
+extern void GGadgetProtest8(char *labelr);
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gicons.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gicons.h
index ecf7d027c92..0499de6b951 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gicons.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gicons.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -50,3 +50,9 @@ extern GImage _GIcon_macttf;
extern GImage _GIcon_compressed;
extern GImage _GIcon_tar;
extern GImage _GIcon_homefolder;
+extern GImage _GIcon_configtool;
+extern GImage _GIcon_bookmark;
+extern GImage _GIcon_nobookmark;
+extern GImage _GIcon_nobookmark;
+extern GImage _GIcon_backarrow;
+extern GImage _GIcon_forwardarrow;
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gimage.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gimage.h
new file mode 100644
index 00000000000..c4f5b8a089a
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gimage.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 2000-2008 by George Williams */
+/*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+
+ * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _GIMAGE_H
+#define _GIMAGE_H
+#include "basics.h"
+
+typedef uint32 Color;
+
+#define COLOR_UNKNOWN ((Color) 0xffffffff)
+#define COLOR_TRANSPARENT ((Color) 0xffffffff)
+#define COLOR_DEFAULT ((Color) 0xfffffffe)
+#define COLOR_CREATE(r,g,b) (((r)<<16) | ((g)<<8) | (b))
+#define COLOR_ALPHA(col) (((col)>>24))
+#define COLOR_RED(col) (((col)>>16) & 0xff)
+#define COLOR_GREEN(col) (((col)>>8) & 0xff)
+#define COLOR_BLUE(col) ((col)&0xff)
+
+struct hslrgb {
+ double h,s,l,v;
+ double r,g,b;
+ uint8 rgb, hsl, hsv;
+};
+
+typedef struct clut {
+ int16 clut_len;
+ unsigned int is_grey: 1;
+ uint32 trans_index; /* will be ignored for cluts in images, use base->trans instead */
+ Color clut[256];
+} GClut;
+
+typedef struct revcmap RevCMap;
+
+enum image_type { it_mono, it_bitmap=it_mono, it_index, it_true, it_rgba };
+
+struct _GImage {
+/* Format: bitmaps are stored with the most significant bit first in byte units
+ indexed images are stored in byte units
+ true color images are stored in 4 byte units, 0,red,green,blue
+ rgba images are stored in 4 byte units, alpha,red,green blue
+*/
+ unsigned int image_type: 2;
+ int16 delay; /* for animated GIFs, delay to next frame */
+ int32 width, height;
+ int32 bytes_per_line;
+ uint8 *data;
+ GClut *clut;
+ Color trans; /* PNG supports more than one transparent color, we don't */
+ /* for non-true color images this is the index, not a color */
+};
+
+/* We deal with 1 bit, 8 bit and 32 bit images internal. 1 bit images may have*/
+/* a clut (if they don't assume bw, 0==black, 1==white), 8 bit must have a */
+/* clut, 32bit are actually 24 bit RGB images, but we pad them for easy */
+/* accessing. it_screen means that we've got an image that can be drawn */
+/* directly on the screen */
+typedef struct gimage {
+ short list_len; /* length of list */
+ union { /* depends on whether has_list is set */
+ struct _GImage *image;
+ struct _GImage **images;
+ } u;
+ void *userdata;
+} GImage;
+
+enum pastetrans_type { ptt_paste_trans_to_trans, ptt_old_shines_through};
+
+typedef struct grect {
+ int32 x,y,width,height;
+} GRect;
+
+typedef struct gpoint {
+ int16 x,y;
+} GPoint;
+
+extern GImage *GImageCreate(enum image_type type, int32 width, int32 height);
+extern GImage *_GImage_Create(enum image_type type, int32 width, int32 height);
+extern void GImageDestroy(GImage *gi);
+extern GImage *GImageCreateAnimation(GImage **images, int n);
+extern GImage *GImageAddImageBefore(GImage *dest, GImage *src, int pos);
+
+extern GImage *GImageBaseGetSub(struct _GImage *base, enum image_type it, GRect *src, GClut *nclut, RevCMap *rev);
+extern GImage *GImageGetSub(GImage *image,enum image_type it, GRect *src, GClut *nclut, RevCMap *rev);
+extern int GImageInsertToBase(struct _GImage *tobase, GImage *from, GRect *src, RevCMap *rev,
+ int to_x, int to_y, enum pastetrans_type ptt );
+extern int GImageInsert(GImage *to, GImage *from, GRect *src, RevCMap *rev,
+ int to_x, int to_y, enum pastetrans_type ptt );
+extern Color _GImageGetPixelColor(struct _GImage *base,int x, int y); /* Obsolete */
+extern Color GImageGetPixelColor(GImage *base,int x, int y); /* Obsolete */
+extern Color GImageGetPixelRGBA(GImage *base,int x, int y);
+extern int GImageGetWidth(GImage *);
+extern int GImageGetHeight(GImage *);
+extern void *GImageGetUserData(GImage *img);
+extern void GImageSetUserData(GImage *img,void *userdata);
+extern void GImageResize(struct _GImage *tobase, struct _GImage *fbase,
+ GRect *src, RevCMap *rev);
+extern GImage *GImageResize32(GImage *from, GRect *src, int width, int height, Color trans);
+extern GImage *GImageResizeSame(GImage *from, GRect *src, int width, int height, RevCMap *rev);
+extern RevCMap *GClutReverse(GClut *clut,int side_size);
+void GClut_RevCMapFree(RevCMap *rev);
+extern GClut *GImageFindCLUT(GImage *image,GClut *clut,int clutmax);
+extern int GImageSameClut(GClut *clut,GClut *nclut);
+extern int GImageGreyClut(GClut *clut);
+extern Color GImageColourFName(unichar_t *name);
+extern Color _GImage_ColourFName(char *name);
+extern char *GImageNameFColour(Color col);
+extern Color GDrawColorDarken(Color col, int by);
+extern Color GDrawColorBrighten(Color col, int by);
+
+extern int GImageWriteGImage(GImage *gi, char *filename);
+extern int GImageWrite_Bmp(GImage *gi, FILE *fp);
+extern int GImageWriteBmp(GImage *gi, char *filename);
+extern GImage *GImageRead_Bmp(FILE *file);
+extern GImage *GImageReadBmp(char *filename);
+extern int GImageWriteXbm(GImage *gi, char *filename);
+extern GImage *GImageReadXbm(char *filename);
+extern int GImageWriteXpm(GImage *gi, char *filename);
+extern GImage *GImageReadXpm(char *filename);
+extern int GImageWriteEps(GImage *gi, char *filename);
+extern GImage *GImageReadTiff(char *filename);
+extern GImage *GImageReadJpeg(char *filename);
+extern GImage *GImageRead_Jpeg(FILE *fp);
+extern int GImageWrite_Jpeg(GImage *gi, FILE *outfile, int quality, int progressive);
+extern int GImageWriteJpeg(GImage *gi, char *filename, int quality, int progressive);
+extern GImage *GImageRead_Png(FILE *fp);
+extern GImage *GImageReadPng(char *filename);
+extern int GImageWrite_Png(GImage *gi, FILE *fp, int progressive);
+extern int GImageWritePng(GImage *gi, char *filename, int progressive);
+extern GImage *GImageReadGif(char *filename);
+extern int GImageWriteGif(GImage *gi,char *filename,int progressive);
+extern GImage *GImageReadRas(char *filename); /* Sun Raster */
+extern GImage *GImageReadRgb(char *filename); /* SGI */
+extern GImage *GImageRead(char *filename);
+
+extern void GImageDrawRect(GImage *img,GRect *r,Color col);
+extern void GImageDrawImage(GImage *dest,GImage *src,void *junk,int x, int y);
+
+extern void gRGB2HSL(struct hslrgb *col);
+extern void gHSL2RGB(struct hslrgb *col);
+extern void gRGB2HSV(struct hslrgb *col);
+extern void gHSV2RGB(struct hslrgb *col);
+extern void gColor2Hslrgb(struct hslrgb *col,Color from);
+extern Color gHslrgb2Color(struct hslrgb *col);
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gio.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gio.h
index b49ab8ddc87..3138b0d2c07 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gio.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -30,11 +30,6 @@
#include "basics.h"
#include <time.h>
-typedef struct gauth {
- unichar_t *username;
- unichar_t *password;
-} GAuth;
-
enum giofuncs { gf_dir, gf_statfile, gf_getfile, gf_putfile,
gf_mkdir, gf_delfile, gf_deldir, gf_renamefile,
/*gf_lockfile, gf_unlockfile,*/
@@ -44,7 +39,6 @@ typedef struct giocontrol {
unichar_t *path;
unichar_t *origpath; /* what the user asked for (before any redirects), NULL if path doesn't change */
unichar_t *topath; /* for renames and copies */
- GAuth auth;
void *userdata;
struct gio_connectiondata *connectiondata;
struct gio_threaddata *threaddata;
@@ -106,4 +100,10 @@ extern void GIOSetUserAgent(unichar_t *agent);
extern unichar_t *GIOguessMimeType(const unichar_t *path,int isdir);
extern unichar_t *_GioMacMime(const char *path);
+
+extern char *GIO_PasswordCache(char *proto,char *host,char *username,char *password);
+extern char *_GIO_decomposeURL(const unichar_t *url,char **host, int *port, char **username,
+ char **password);
+
+extern void GIO_SetThreadCallback(void (*callback)(void *,void *,void *));
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gkeysym.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gkeysym.h
index 7d4d2e59f5b..7d4d2e59f5b 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gkeysym.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gkeysym.h
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gprogress.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gprogress.h
index d0d26581b70..14dc596b550 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gprogress.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gprogress.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -52,6 +52,7 @@ extern void GProgressEnableStop(int enabled); /* Allows you to disable and enab
extern int GProgressNextStage(void); /* Move to the next stage in the topmost indicator */
extern int GProgressNext(void); /* Increment progress by one sub-entity */
extern int GProgressIncrementBy(int cnt); /* Increment progress by cnt sub-entities */
+extern int GProgressReset(void); /* Set progress to 0 */
extern void GProgressPauseTimer(void); /* Don't bring up the progress dlg because of */
extern void GProgressResumeTimer(void); /* time spent between a pause and resume */
extern void GProgressShow(void); /* Display the damn thing whether we should or not */
@@ -71,6 +72,7 @@ extern void GProgressChangeLine2_8(const char *line2); /* Changes the text in th
#define gwwv_progress_change_total GProgressChangeTotal
#define gwwv_progress_change_stages GProgressChangeStages
#define gwwv_progress_increment GProgressIncrementBy
+#define gwwv_progress_reset GProgressReset
#define gwwv_progress_pause_timer GProgressPauseTimer
#define gwwv_progress_resume_timer GProgressResumeTimer
#define gwwv_progress_enable_stop GProgressEnableStop
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gresource.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gresource.h
index 11e6274bbc1..33f91bceae1 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gresource.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gresource.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gwidget.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gwidget.h
index da470eab786..3b701ec5799 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gwidget.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gwidget.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -134,8 +134,11 @@ int GWidgetAskCentered8(const char *title,
const char ** answers, int def, int cancel,const char *question,...);
char *GWidgetAskString8(const char *title,
const char *def,const char *question,...);
+char *GWidgetAskPassword8(const char *title,
+ const char *def,const char *question,...);
void GWidgetPostNotice8(const char *title,const char *statement,...);
-void _GWidgetPostNotice8(const char *title,const char *statement,va_list ap);
+void _GWidgetPostNotice8(const char *title,const char *statement,va_list ap,int timeout);
+void GWidgetPostNoticeTimeout8(int timeout, const char *title,const char *statement,...);
int GWidgetPostNoticeActive8(const char *title);
void GWidgetError8(const char *title,const char *statement,...);
@@ -151,14 +154,18 @@ int GWidgetChoicesB8(char *title, const char **choices, int cnt, int def,
int GWidgetChoicesBM8(char *title, const char **choices,char *sel,
int cnt, char *buts[2], const char *question,...);
+extern struct hslrgb GWidgetColor(const char *title,struct hslrgb *defcol,struct hslrgb fontcols[6]);
+
#define gwwv_choose_multiple GWidgetChoicesBM8
#define gwwv_choose_with_buttons GWidgetChoicesB8
#define gwwv_choose GWidgetChoices8
#define gwwv_ask_string GWidgetAskString8
+#define gwwv_ask_password GWidgetAskPassword8
#define gwwv_ask GWidgetAsk8
#define gwwv_ask_centered GWidgetAskCentered8
#define gwwv_post_error GWidgetError8
#define gwwv_post_notice GWidgetPostNotice8
+#define gwwv_post_notice_timeout GWidgetPostNoticeTimeout8
#define gwwv_open_filename(tit,def,filter,filtfunc) GWidgetOpenFile8(tit,def,filter,NULL,filtfunc)
#define gwwv_save_filename(tit,def,filter) GWidgetSaveAsFile8(tit,def,filter,NULL,NULL)
#define gwwv_save_filename_with_gadget(tit,def,filter,gcd) GWidgetSaveAsFileWithGadget8(tit,def,filter,NULL,NULL,gcd)
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gwwiconv.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gwwiconv.h
index 914056c9227..fc3cd314a1d 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/gwwiconv.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/gwwiconv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2007 by George Williams */
+/* Copyright (C) 2004-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -46,6 +46,7 @@ extern size_t gww_iconv( gww_iconv_t cd,
# define iconv_arg2_t char **
# else /* HAVE_ICONV_H */
+# include <iconv.h>
# ifdef iconv /* libiconv has a different calling convention */
# define iconv_arg2_t const char **
# else
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/intl.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/intl.h
index 5a42d49e9a2..f5b0005dc0c 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/intl.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/intl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2007 by George Williams */
+/* Copyright (C) 2005-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -32,7 +32,19 @@
# define P_(str1,str_non1,n) ((n)==1?str1:str_non1)
# define U_(str) (str)
+/* the next if statement is because Solaris includes its libintl.h
+ (that we dont need) from locale.h (that we do need) */
#if ! defined(__sun__) && ! defined(__sun)
+# ifdef bindtextdomain
+# undef bindtextdomain
+# endif
+# ifdef bind_textdomain_codeset
+# undef bind_textdomain_codeset
+# endif
+# ifdef textdomain
+# undef textdomain
+# endif
+
# define bindtextdomain(domain,dir)
# define bind_textdomain_codeset(domain,enc)
# define textdomain(domain)
@@ -56,6 +68,16 @@
# define P_(str1,str_non1,n) gwwv_ngettext(str1,str_non1,n)
# define U_(str) gwwv_gettext(str)
+# ifdef bindtextdomain
+# undef bindtextdomain
+# endif
+# ifdef bind_textdomain_codeset
+# undef bind_textdomain_codeset
+# endif
+# ifdef textdomain
+# undef textdomain
+# endif
+
# define bindtextdomain(domain,dir) gwwv_bindtextdomain(domain,dir)
# define bind_textdomain_codeset(domain,enc) gwwv_bind_textdomain_codeset(domain,enc)
# define textdomain(domain) gwwv_textdomain(domain)
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/ustring.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/ustring.h
index 14d01c89377..a5e21e87dc9 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/ustring.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/ustring.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2007 by George Williams */
+/* Copyright (C) 2000-2008 by George Williams */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -106,6 +106,7 @@ extern int utf8_strlen(const char *utf8_str); /* how many characters in the stri
extern int utf82u_strlen(const char *utf8_str); /* how many long would this be in shorts (UCS2) */
extern char *def2utf8_copy(const char *from);
extern char *utf82def_copy(const char *ufrom);
+extern char *utf8_strchr(const char *utf8_str, int search_char);
extern unichar_t *utf82u_strncpy(unichar_t *ubuf,const char *utf8buf,int len);
extern unichar_t *utf82u_strcpy(unichar_t *ubuf,const char *utf8buf);
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/utype.h b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/utype.h
index e99f4d2b286..7b55c1cf97a 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/fontforge/inc/utype.h
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/inc/utype.h
@@ -1,9 +1,6 @@
#ifndef _UTYPE_H
-
#define _UTYPE_H
-#ifndef LUA_FF_LIB
-
#define ____L 0x1
#define ____U 0x2
#define ____TITLE 0x4
@@ -50,22 +47,16 @@
#define ____TOUCHING 0x100000
#define ____COMBININGPOSMASK 0x1fff00
-extern const unsigned int ____utype[];
extern const unsigned short ____tolower[];
+#if 0
extern const unsigned short ____toupper[];
-extern const unsigned short ____totitle[];
-extern const unsigned short ____tomirror[];
-extern const unsigned char ____digitval[];
-
-extern const unsigned int ____utype2[];
-
-extern const unsigned int ____codepointassigned[];
+#endif
+extern const unsigned int ____utype[];
#define tolower(ch) (____tolower[(ch)+1])
+#if 0
#define toupper(ch) (____toupper[(ch)+1])
-#define totitle(ch) (____totitle[(ch)+1])
-#define tomirror(ch) (____tomirror[(ch)+1])
-#define tovalue(ch) (____digitval[(ch)+1])
+#endif
#define islower(ch) (____utype[(ch)+1]&____L)
#define isupper(ch) (____utype[(ch)+1]&____U)
#define istitle(ch) (____utype[(ch)+1]&____TITLE)
@@ -73,6 +64,7 @@ extern const unsigned int ____codepointassigned[];
#define isdigit(ch) (____utype[(ch)+1]&____D)
#define isalnum(ch) (____utype[(ch)+1]&(____L|____U|____TITLE|____AL|____D))
#define isideographic(ch) (____utype[(ch)+1]&____ID)
+#define isideoalpha(ch) (____utype[(ch)+1]&(____ID|____L|____U|____TITLE|____AL))
#define isspace(ch) (____utype[(ch)+1]&____S)
#define ispunct(ch) (____utype[(ch)+1]&_____P)
#define ishexdigit(ch) (____utype[(ch)+1]&____X)
@@ -94,12 +86,6 @@ extern const unsigned int ____codepointassigned[];
#define isdecompositionnormative(ch) (____utype[(ch)+1]&____DECOMPNORM)
-#define combiningclass(ch) (____utype2[(ch)+1]&____COMBININGCLASS)
-#define combiningposmask(ch) (____utype2[(ch)+1]&____COMBININGPOSMASK)
-
-#define isunicodepointassigned(ch) (____codepointassigned[(ch)/32]&(1<<((ch)%32)))
-
-
extern struct arabicforms {
unsigned short initial, medial, final, isolated;
unsigned int isletter: 1;
@@ -111,5 +97,4 @@ extern struct arabicforms {
#define _DOUBLE_S 0xdf
-#endif /* LUA_FF_LIB */
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/plugins/Makefile.in b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/plugins/Makefile.in
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/plugins/Makefile.in
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c b/Build/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c
new file mode 100644
index 00000000000..88757af288c
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/src/ffdummies.c
@@ -0,0 +1,256 @@
+
+/* some dummy functions and variables so that a few ff source files can be ignored */
+
+#include "uiinterface.h"
+#include "fontforgevw.h"
+#include "splinefont.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <basics.h>
+#include <ustring.h>
+
+
+char **gww_errors = NULL;
+int gww_error_count = 0;
+
+void gwwv_errors_free (void) {
+ int i;
+ if (gww_error_count>0) {
+ for (i=0;i<gww_error_count;i++) {
+ free(gww_errors[i]);
+ }
+ free(gww_errors);
+ gww_error_count = 0;
+ gww_errors = NULL;
+ }
+}
+
+
+static void LUAUI_IError(const char *format,...) {
+ va_list ap;
+ va_start(ap,format);
+ fprintf(stderr, "Internal Error: " );
+ vfprintf(stderr,format,ap);
+ va_end(ap);
+}
+
+static void LUAUI__LogError(const char *format,va_list ap) {
+ char buffer[400], *str;
+ vsnprintf(buffer,sizeof(buffer),format,ap);
+ str = utf82def_copy(buffer);
+ gww_errors = realloc(gww_errors, (gww_error_count+2)*sizeof(char *));
+ if (gww_errors==NULL) {
+ perror("memory allocation failed");
+ exit(EXIT_FAILURE);
+ }
+ gww_errors[gww_error_count ] = str ;
+ gww_error_count ++;
+ gww_errors[gww_error_count ] = NULL;
+}
+
+/* this is not static because it is used by gwwiconv.c */
+
+void LUAUI_LogError(const char *format,...) {
+ va_list ap;
+ va_start(ap,format);
+ LUAUI__LogError(format,ap);
+ va_end(ap);
+}
+
+static void LUAUI_post_notice(const char *title,const char *statement,...) {
+ va_list ap;
+ (void)title;
+ va_start(ap,statement);
+ LUAUI__LogError(statement,ap);
+ va_end(ap);
+}
+
+static void LUAUI_post_error(const char *title,const char *statement,...) {
+ va_list ap;
+ (void)title;
+ va_start(ap,statement);
+ LUAUI__LogError(statement,ap);
+ va_end(ap);
+}
+
+static int LUAUI_ask(const char *title, const char **answers,
+ int def, int cancel,const char *question,...) {
+ (void)title;
+ (void)answers;
+ (void)cancel;
+ (void)question;
+return( def );
+}
+
+static int LUAUI_choose(const char *title, const char **choices,int cnt, int def,
+ const char *question,...) {
+ (void)title;
+ (void)choices;
+ (void)cnt;
+ (void)question;
+return( def );
+}
+
+static int LUAUI_choose_multiple(char *title, const char **choices,char *sel,
+ int cnt, char *buts[2], const char *question,...) {
+ (void)title;
+ (void)choices;
+ (void)sel;
+ (void)cnt;
+ (void)buts;
+ (void)question;
+return( -1 );
+}
+
+static char *LUAUI_ask_string(const char *title, const char *def,
+ const char *question,...) {
+ (void)title;
+ (void)def;
+ (void)question;
+return( (char *) def );
+}
+
+static char *LUAUI_open_file(const char *title, const char *defaultfile,
+ const char *initial_filter) {
+ (void)title;
+ (void)initial_filter;
+ (void)defaultfile;
+return( NULL );
+}
+
+static char *LUAUI_saveas_file(const char *title, const char *defaultfile,
+ const char *initial_filter) {
+ (void)title;
+ (void)initial_filter;
+return( copy(defaultfile) );
+}
+
+static void LUAUI_progress_start(int delay, const char *title, const char *line1,
+ const char *line2, int tot, int stages) {
+ (void)delay;
+ (void)title;
+ (void)line1;
+ (void)line2;
+ (void)tot;
+ (void)stages;
+}
+
+static void LUAUI_void_void_noop(void) {
+}
+
+static void LUAUI_void_int_noop(int useless) {
+ (void)useless;
+}
+
+static int LUAUI_int_int_noop(int useless) {
+ (void)useless;
+return( true );
+}
+
+static void LUAUI_void_str_noop(const char * useless) {
+ (void)useless;
+}
+
+static int LUAUI_alwaystrue(void) {
+return( true );
+}
+
+static int LUAUI_DefaultStrokeFlags(void) {
+return( sf_correctdir );
+}
+
+struct ui_interface luaui_interface = {
+ LUAUI_IError,
+ LUAUI_post_error,
+ LUAUI_LogError,
+ LUAUI_post_notice,
+ LUAUI_ask,
+ LUAUI_choose,
+ LUAUI_choose_multiple,
+ LUAUI_ask_string,
+ LUAUI_ask_string, /* password */
+ LUAUI_open_file,
+ LUAUI_saveas_file,
+
+ LUAUI_progress_start,
+ LUAUI_void_void_noop,
+ LUAUI_void_void_noop,
+ LUAUI_void_int_noop,
+ LUAUI_alwaystrue,
+ LUAUI_alwaystrue,
+ LUAUI_int_int_noop,
+ LUAUI_void_str_noop,
+ LUAUI_void_str_noop,
+ LUAUI_void_void_noop,
+ LUAUI_void_void_noop,
+ LUAUI_void_int_noop,
+ LUAUI_void_int_noop,
+ LUAUI_alwaystrue,
+
+ LUAUI_void_void_noop,
+
+ NOUI_TTFNameIds,
+ NOUI_MSLangString,
+
+ LUAUI_DefaultStrokeFlags
+};
+
+/* some bits and pieces */
+
+int URLFromFile(char *url,FILE *from) {
+ (void)url;
+ (void)from;
+ return false;
+}
+
+/* print.c */
+int pagewidth = 0, pageheight=0; /* In points */
+char *printlazyprinter=NULL;
+char *printcommand=NULL;
+int printtype = 0;
+
+void ScriptPrint(FontViewBase *fv,int type,int32 *pointsizes,char *samplefile,
+ unichar_t *sample, char *outputfile) {
+ (void)fv;
+ (void)type;
+ (void)pointsizes;
+ (void)samplefile;
+ (void)sample;
+ (void)outputfile;
+}
+
+int PdfDumpGlyphResources(void *pi, SplineChar *sc) {
+ (void)pi;
+ (void)sc;
+ return 0;
+}
+
+/* autotrace.c */
+int autotrace_ask=0, mf_ask=0, mf_clearbackgrounds=0, mf_showerrors=0;
+char *mf_args = NULL;
+int preferpotrace=0;
+
+void *GetAutoTraceArgs(void) {
+return NULL;
+}
+
+void SetAutoTraceArgs(void *a) {
+ (void)a;
+}
+
+void FVAutoTrace(FontViewBase *fv,int ask) {
+ (void)fv; (void)ask;
+}
+
+SplineFont *SFFromMF(char *filename) {
+ (void)filename;
+return NULL;
+}
+
+/* http.c */
+
+FILE *URLToTempFile(char *url,void *_lock) {
+ (void)_lock; (void)url;
+ ff_post_error(_("Could not parse URL"),_("FontForge only handles ftp and http URLs at the moment"));
+return( NULL );
+}
diff --git a/Build/source/texk/web2c/luatexdir/luafontforge/src/luafflib.c b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c
index 8c67e0b2697..bc344fdd416 100644
--- a/Build/source/texk/web2c/luatexdir/luafontforge/src/luafflib.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/src/luafflib.c
@@ -8,31 +8,39 @@
#include <stdio.h>
#include <lua.h>
#include <lauxlib.h>
+#include <locale.h>
#include "pfaedit.h"
-
-extern void LoadPrefs(void);
+#include "ustring.h"
extern char **gww_errors;
extern int gww_error_count;
extern void gwwv_errors_free (void);
+extern struct ui_interface luaui_interface;
+
+extern int readbinfile(FILE *f, unsigned char **b, int *s);
-#define FONT_METATABLE "fontforge.splinefont"
+#define FONT_METATABLE "fontloader.splinefont"
-#define LUA_OTF_VERSION "0.2"
+#define LUA_OTF_VERSION "0.3"
-char *possub_type_enum[] = {
+static char *possub_type_enum[] = {
"null", "position", "pair", "substitution",
"alternate", "multiple", "ligature", "lcaret",
"kerning", "vkerning", "anchors", "contextpos",
"contextsub", "chainpos", "chainsub","reversesub",
- "max", "kernback", "vkernback"};
+ "max", "kernback", "vkernback", NULL };
#define LAST_POSSUB_TYPE_ENUM 18
#define eight_nulls() NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-char *otf_lookup_type_enum[] = {
+static char *asm_type_enum[] = {
+ "indic", "context", "lig", NULL, "simple", "insert", NULL, NULL,
+ eight_nulls(),
+ NULL, "kern" };
+
+static char *otf_lookup_type_enum[] = {
"gsub_start", "gsub_single", "gsub_multiple", "gsub_alternate",
"gsub_ligature", "gsub_context", "gsub_contextchain", NULL,
"gsub_reversecontextchain", NULL, NULL, NULL, NULL, NULL, NULL, NULL, /*0x00F */
@@ -72,18 +80,43 @@ char *otf_lookup_type_enum[] = {
};
-char *anchor_type_enum[] = { "mark", "basechar", "baselig", "basemark", "centry", "cexit", "max", NULL };
+static char *anchor_type_enum[] = {
+ "mark", "basechar", "baselig", "basemark", "centry", "cexit", "max", NULL };
+
#define MAX_ANCHOR_TYPE 7
-char *anchorclass_type_enum[] = { "mark", "mkmk", "curs", "mklg", NULL };
-char *glyph_class_enum[] = { "automatic", "none" ,"base", "ligature","mark", "component", NULL };
+static char *anchorclass_type_enum[] = {
+ "mark", "mkmk", "curs", "mklg", NULL };
+
+static char *glyph_class_enum[] = {
+ "automatic", "none" ,"base", "ligature","mark", "component", NULL };
+
+static char *ttfnames_enum[ttf_namemax] = {
+ "copyright", "family", "subfamily", "uniqueid",
+ "fullname", "version", "postscriptname", "trademark",
+ "manufacturer", "designer", "descriptor", "venderurl",
+ "designerurl", "license", "licenseurl", "idontknow",
+ "preffamilyname", "prefmodifiers", "compatfull", "sampletext",
+ "cidfindfontname", "wwsfamily", "wwssubfamily" };
+
+static char *fpossub_format_enum [] = {
+ "glyphs", "class","coverage","reversecoverage" , NULL};
+
+static char *tex_type_enum[4] = { "unset", "text", "math", "mathext"};
+/* has an offset of 1, ui_none = 0. */
+static char *uni_interp_enum[9] = {
+ "unset", "none", "adobe", "greek", "japanese",
+ "trad_chinese", "simp_chinese", "korean", "ams" };
+
#define check_isfont(L,b) (SplineFont **)luaL_checkudata(L,b,FONT_METATABLE)
void handle_generic_pst (lua_State *L, struct generic_pst *pst); /* forward */
void handle_generic_fpst (lua_State *L, struct generic_fpst *fpst); /* forward */
+void handle_generic_asm (lua_State *L, struct generic_asm *sm) ;
void handle_kernclass (lua_State *L, struct kernclass *kerns);
void handle_anchorclass (lua_State *L, struct anchorclass *anchor);
+void handle_splinefont(lua_State *L, struct splinefont *sf) ;
void
@@ -119,25 +152,32 @@ ff_open (lua_State *L) {
lua_error(L);
}
args = lua_gettop(L);
- if (args>=2) {
- if (lua_isstring(L,2)) {
- if (*(fontname+strlen(fontname))!=')') {
- /* possibly fails for embedded parens in the font name */
- snprintf(s,511,"%s(%s)", fontname, lua_tolstring(L,2,&len));
- if (len==0) {
- snprintf(s,511,"%s", fontname);
- }
- }
- }
+ if (args>=2 && lua_isstring(L,2)) {
+ if (*(fontname+strlen(fontname))!=')') {
+ /* possibly fails for embedded parens in the font name */
+ snprintf(s,511,"%s(%s)", fontname, lua_tolstring(L,2,&len));
+ if (len==0) {
+ snprintf(s,511,"%s", fontname);
+ }
+ }
} else {
snprintf(s,511,"%s", fontname);
}
if (strlen(s)>0) {
+ gww_error_count=0;
sf = ReadSplineFont((char *)s,openflags);
if (sf==NULL) {
- lua_pushfstring(L,"font loading failed for %s\n", fontname);
+ lua_pushfstring(L,"font loading failed for %s\n", s);
+ if (gww_error_count>0) {
+ for (i=0;i<gww_error_count;i++) {
+ lua_pushstring(L,gww_errors[i]);
+ lua_concat(L,2);
+ }
+ gwwv_errors_free();
+ }
lua_error(L);
} else {
+ FVAppend(_FontViewCreate(sf));
lua_ff_pushfont(L,sf);
if (gww_error_count>0) {
lua_newtable(L);
@@ -201,6 +241,15 @@ dump_intfield (lua_State *L, char *name, long int field) {
lua_rawset(L,-3);
}
+static void
+dump_realfield (lua_State *L, char *name, real field) {
+ lua_checkstack(L,2);
+ lua_pushstring(L,name);
+ lua_pushnumber(L,field);
+ lua_rawset(L,-3);
+}
+
+
#define dump_cond_intfield(a,b,c) if ((c)!=0) { dump_intfield ((a),(b),(c)); }
@@ -279,6 +328,29 @@ dump_mactag (lua_State *L, char *name, unsigned int field) {
lua_rawset(L,-3);
}
+void
+dump_subtable_name (lua_State *L, char *name, struct lookup_subtable *s) {
+ /* this is likely a backref */
+ if (s==NULL)
+ return;
+ lua_checkstack(L,2);
+ if (s->next == NULL) {
+ dump_stringfield(L,name,s->subtable_name);
+ } else {
+ /* can this really happen ? */
+ int i = 0;
+ lua_newtable(L);
+ while (s!=NULL) {
+ lua_pushstring(L, s->subtable_name);
+ lua_rawseti(L, -2, ++i);
+ s = s->next;
+ }
+ lua_setfield(L, -2, name);
+ }
+}
+
+
+
#define NESTED_TABLE(a,b,c) { \
int k = 1; \
next = b; \
@@ -363,16 +435,23 @@ do_handle_lookup_subtable (lua_State *L, struct lookup_subtable *subtable) {
lua_setfield(L,-2, "kernclass");
}
- /* generic_asm *sm; */ /* TODO, Apple state machine */
+#if 0
+ if (subtable->fpst != NULL) {
+ /* lua_newtable(L); */
+ handle_generic_fpst(L, subtable->fpst);
+ /* lua_setfield(L,-2, "fpst"); */
+ }
+#endif
+ if (subtable->sm != NULL) {
+ lua_newtable(L);
+ handle_generic_asm(L, subtable->sm);
+ lua_setfield(L,-2, "sm");
+ }
/* int subtable_offset; */ /* used by OTF file generation */
/* int32 *extra_subtables; */ /* used by OTF file generation */
}
-/* subtables have to be dumped as an array because the ordering
- * has to be preserved
- */
-
void
handle_lookup_subtable (lua_State *L, struct lookup_subtable *subtable) {
struct lookup_subtable *next;
@@ -416,10 +495,14 @@ do_handle_lookup (lua_State *L, struct otlookup *lookup ) {
/* dump_intfield (L,"unused", lookup->unused); */
/* dump_intfield (L,"empty", lookup->empty); */
+ /* dump_intfield (L,"store_in_afm", lookup->store_in_afm); */
+ /* dump_intfield (L,"needs_extension", lookup->needs_extension); */
+ /* dump_intfield (L,"temporary_kern", lookup->temporary_kern); */
/* dump_intfield (L,"def_lang_checked", lookup->def_lang_checked); */
/* dump_intfield (L,"def_lang_found", lookup->def_lang_found); */
+ /* dump_intfield (L,"ticked", lookup->ticked); */
/* dump_intfield (L,"subcnt", lookup->subcnt); */
- /* dump_intfield (L,"index", lookup->lookup_index); */ /* identical to array index */
+ /* dump_intfield (L,"lookup_index", lookup->lookup_index); */ /* identical to array index */
/* dump_intfield (L,"lookup_offset", lookup->lookup_offset); */
/* dump_intfield (L,"lookup_length", lookup->lookup_length); */
/* dump_stringfield(L,"tempname", lookup->tempname); */
@@ -438,9 +521,8 @@ do_handle_kernpair (lua_State *L, struct kernpair *kp) {
if (kp->sc != NULL)
dump_char_ref(L, kp->sc);
dump_intfield(L,"off", kp->off);
- if (kp->subtable!=NULL) {
- dump_stringfield(L,"lookup",kp->subtable->subtable_name);
- }
+ /* uint16 kcid; */ /* temporary value */
+ dump_subtable_name(L, "lookup", kp->subtable);
}
void
@@ -466,6 +548,32 @@ handle_splinecharlist (lua_State *L, struct splinecharlist *scl) {
}
+
+/* vs is the "variation selector" a unicode codepoint which modifieds */
+/* the code point before it. If vs is -1 then unienc is just an */
+/* alternate encoding (greek Alpha and latin A), but if vs is one */
+/* of unicode's variation selectors then this glyph is somehow a */
+/* variant shape. The specifics depend on the selector and script */
+/* fid is currently unused, but may, someday, be used to do ttcs */
+/* NOTE: GlyphInfo displays vs==-1 as vs==0, and fixes things up */
+void
+handle_altuni (lua_State *L, struct altuni *au) {
+ struct altuni *next = au;
+ int k = 1;
+ lua_checkstack(L,3);
+ while( next != NULL) {
+ lua_newtable(L);
+ dump_intfield(L, "unicode", next->unienc);
+ if (next->vs != -1)
+ dump_intfield(L, "variant", next->vs);
+ /* dump_intfield(L, "fid", next->fid); */
+ lua_rawseti(L, -2, k++);
+ next = next->next;
+ }
+}
+
+
+
#define interesting_vr(a) (((a)->xoff!=0) || ((a)->yoff!=0) || ((a)->h_adv_off!=0) || ((a)->v_adv_off!=0))
void handle_vr (lua_State *L, struct vr *pos) {
@@ -485,8 +593,9 @@ do_handle_generic_pst (lua_State *L, struct generic_pst *pst) {
} else {
dump_enumfield(L,"type", pst->type, possub_type_enum);
}
-
- /*dump_intfield(L,"macfeature", pst->macfeature); */
+ /* unsigned int ticked: 1;*/
+ /* unsigned int temporary: 1;*/ /* Used in afm ligature closure */
+ /* struct lookup_subtable *subtable; */ /* handled by caller */
lua_checkstack(L,4);
lua_pushstring(L,"specification");
@@ -593,19 +702,6 @@ handle_liglist (lua_State *L, struct liglist *ligofme) {
NESTED_TABLE(do_handle_liglist,ligofme,3);
}
-/*
-if glyph.anchor then
- local t = { }
- for k,v in ipairs(glyph.anchor) do
- if not t[v.type] then t[v.type] = { } end
- t[v.type][v.anchor] = v
- v.anchor = nil
- v.type = nil
- end
- glyph.anchor = t
- end
-*/
-
void
do_handle_anchorpoint (lua_State *L, struct anchorpoint *anchor) {
@@ -618,6 +714,8 @@ do_handle_anchorpoint (lua_State *L, struct anchorpoint *anchor) {
lua_pushstring(L,"Anchorpoint has an unknown type!");
lua_error(L);
}
+ /* unsigned int selected: 1; */
+ /* unsigned int ticked: 1; */
lua_rawget(L,-2);
if (!lua_istable(L,-1)) {
@@ -645,10 +743,9 @@ do_handle_anchorpoint (lua_State *L, struct anchorpoint *anchor) {
lua_newtable(L);
dump_intfield(L,"x", anchor->me.x);
dump_intfield(L,"y", anchor->me.y);
-
if (anchor->has_ttf_pt)
dump_intfield(L,"ttf_pt_index", anchor->ttf_pt_index);
- /* dump_intfield(L,"lig_index", anchor->lig_index); */
+ dump_intfield(L,"lig_index", anchor->lig_index);
lua_rawseti(L,-2,(anchor->lig_index+1));
lua_pop(L,1);
} else {
@@ -656,9 +753,9 @@ do_handle_anchorpoint (lua_State *L, struct anchorpoint *anchor) {
lua_newtable(L);
dump_intfield(L,"x", anchor->me.x);
dump_intfield(L,"y", anchor->me.y);
-
if (anchor->has_ttf_pt)
dump_intfield(L,"ttf_pt_index", anchor->ttf_pt_index);
+ dump_intfield(L,"lig_index", anchor->lig_index);
lua_rawset(L,-3);
}
lua_pop(L,1);
@@ -674,9 +771,61 @@ handle_anchorpoint (lua_State *L, struct anchorpoint *anchor) {
}
}
+void
+handle_glyphvariants (lua_State *L, struct glyphvariants *vars) {
+ int i ;
+ dump_stringfield(L, "variants", vars->variants);
+ dump_intfield (L, "italic_correction", vars->italic_correction);
+ lua_newtable(L);
+ for (i=0; i< vars->part_cnt; i++) {
+ lua_newtable(L);
+ dump_stringfield(L, "component", vars->parts[i].component);
+ dump_intfield(L, "extender", vars->parts[i].is_extender);
+ dump_intfield(L, "start", vars->parts[i].startConnectorLength);
+ dump_intfield(L, "end", vars->parts[i].endConnectorLength);
+ dump_intfield(L, "advance", vars->parts[i].fullAdvance);
+ lua_rawseti(L,-2,(i+1));
+ }
+ lua_setfield(L, -2, "parts");
+}
+
+void handle_mathkernvertex (lua_State *L, struct mathkernvertex *mkv) {
+ int i;
+ for (i=0; i<mkv->cnt;i++) {
+ lua_newtable(L);
+ dump_intfield(L, "height", mkv->mkd[i].height );
+ dump_intfield(L, "kern", mkv->mkd[i].kern );
+ lua_rawseti(L,-2, (i+1));
+ }
+}
+
+void handle_mathkern (lua_State *L, struct mathkern *mk) {
+ lua_newtable(L);
+ handle_mathkernvertex(L, &(mk->top_right));
+ lua_setfield(L, -2, "top_right");
+ lua_newtable(L);
+ handle_mathkernvertex(L, &(mk->top_left));
+ lua_setfield(L, -2, "top_left");
+ lua_newtable(L);
+ handle_mathkernvertex(L, &(mk->bottom_right));
+ lua_setfield(L, -2, "bottom_right");
+ lua_newtable(L);
+ handle_mathkernvertex(L, &(mk->bottom_left));
+ lua_setfield(L, -2, "bottom_left");
+}
+
+
+
void
handle_splinechar (lua_State *L,struct splinechar *glyph, int hasvmetrics) {
-
+ DBounds bb;
+ if (glyph->xmax==0 && glyph->ymax==0 && glyph->xmin==0 && glyph->ymin==0) {
+ SplineCharFindBounds(glyph,&bb);
+ glyph->xmin = bb.minx;
+ glyph->ymin = bb.miny;
+ glyph->xmax = bb.maxx;
+ glyph->ymax = bb.maxy;
+ }
dump_stringfield(L,"name", glyph->name);
dump_intfield(L,"unicode", glyph->unicodeenc);
lua_createtable(L,4,0);
@@ -685,13 +834,15 @@ handle_splinechar (lua_State *L,struct splinechar *glyph, int hasvmetrics) {
lua_pushnumber(L,3); lua_pushnumber(L,glyph->xmax); lua_rawset(L,-3);
lua_pushnumber(L,4); lua_pushnumber(L,glyph->ymax); lua_rawset(L,-3);
lua_setfield(L,-2,"boundingbox");
-
/*dump_intfield(L,"orig_pos", glyph->orig_pos);*/
if (hasvmetrics)
dump_intfield(L,"vwidth", glyph->vwidth);
dump_intfield(L,"width", glyph->width);
- dump_cond_intfield(L,"lsidebearing", glyph->lsidebearing);
+ if (glyph->lsidebearing != glyph->xmin) {
+ dump_cond_intfield(L,"lsidebearing", glyph->lsidebearing);
+ }
+ /* dump_intfield(L,"ttf_glyph", glyph->ttf_glyph); */
/* Layer layers[2]; */ /* TH Not used */
/* int layer_cnt; */ /* TH Not used */
@@ -700,37 +851,37 @@ handle_splinechar (lua_State *L,struct splinechar *glyph, int hasvmetrics) {
/* DStemInfo *dstem; */ /* TH Not used */
/* MinimumDistance *md; */ /* TH Not used */
- /* struct charview *views; */ /* TH Not used */
+ /* struct charviewbase *views; */ /* TH Not used */
/* struct charinfo *charinfo; */ /* TH ? (charinfo.c) */
+ /* struct splinefont *parent; */ /* TH Not used */
- /* struct splinefont *parent; */ /* TH Not used */
-
- /*
-
- */
if (glyph->glyph_class>0) {
dump_enumfield(L,"class", glyph->glyph_class, glyph_class_enum);
}
/* TH: internal fontforge stuff
- dump_intfield(L,"ticked", glyph->ticked);
- dump_intfield(L,"widthset", glyph->widthset);
- dump_intfield(L,"ttf_glyph", glyph->ttf_glyph);
dump_intfield(L,"changed", glyph->changed);
dump_intfield(L,"changedsincelasthinted", glyph->changedsincelasthinted);
dump_intfield(L,"manualhints", glyph->manualhints);
+ dump_intfield(L,"ticked", glyph->ticked);
dump_intfield(L,"changed_since_autosave", glyph->changed_since_autosave);
+ dump_intfield(L,"widthset", glyph->widthset);
dump_intfield(L,"vconflicts", glyph->vconflicts);
dump_intfield(L,"hconflicts", glyph->hconflicts);
- dump_intfield(L,"anyflexes", glyph->anyflexes);
dump_intfield(L,"searcherdummy", glyph->searcherdummy);
dump_intfield(L,"changed_since_search", glyph->changed_since_search);
dump_intfield(L,"wasopen", glyph->wasopen);
dump_intfield(L,"namechanged", glyph->namechanged);
dump_intfield(L,"blended", glyph->blended);
+ dump_intfield(L,"ticked2", glyph->ticked2);
dump_intfield(L,"unused_so_far", glyph->unused_so_far);
dump_intfield(L,"numberpointsbackards", glyph->numberpointsbackards);
dump_intfield(L,"instructions_out_of_date", glyph->instructions_out_of_date);
dump_intfield(L,"complained_about_ptnums", glyph->complained_about_ptnums);
+ unsigned int vs_open: 1;
+ unsigned int unlink_rm_ovrlp_save_undo: 1;
+ unsigned int inspiro: 1;
+ unsigned int lig_caret_cnt_fixed: 1;
+
uint8 *ttf_instrs;
int16 ttf_instrs_len;
@@ -777,17 +928,39 @@ handle_splinechar (lua_State *L,struct splinechar *glyph, int hasvmetrics) {
handle_anchorpoint(L,glyph->anchor);
lua_setfield(L,-2,"anchors");
}
-
+
+ if (glyph->altuni != NULL) {
+ lua_newtable(L);
+ handle_altuni(L, glyph->altuni);
+ lua_setfield(L,-2,"altuni");
+ }
+
if (glyph->tex_height != TEX_UNDEF)
dump_intfield(L,"tex_height", glyph->tex_height);
if (glyph->tex_depth != TEX_UNDEF)
dump_intfield(L,"tex_depth", glyph->tex_depth);
- if (glyph->tex_sub_pos != TEX_UNDEF)
- dump_intfield(L,"tex_sub_pos", glyph->tex_sub_pos);
- if (glyph->tex_super_pos != TEX_UNDEF)
- dump_intfield(L,"tex_super_pos", glyph->tex_super_pos);
-
- /* struct altuni { struct altuni *next; int unienc; } *altuni; */
+
+ dump_cond_intfield(L, "is_extended_shape", glyph->is_extended_shape);
+ if (glyph->italic_correction != TEX_UNDEF)
+ dump_intfield(L, "italic_correction", glyph->italic_correction);
+ if (glyph->top_accent_horiz != TEX_UNDEF)
+ dump_intfield(L, "top_accent", glyph->top_accent_horiz);
+
+ if (glyph->vert_variants != NULL) {
+ lua_newtable(L);
+ handle_glyphvariants(L, glyph->vert_variants);
+ lua_setfield(L,-2,"vert_variants");
+ }
+ if (glyph->horiz_variants != NULL) {
+ lua_newtable(L);
+ handle_glyphvariants(L, glyph->horiz_variants);
+ lua_setfield(L,-2,"horiz_variants");
+ }
+ if (glyph->mathkern != NULL) {
+ lua_newtable(L);
+ handle_mathkern(L, glyph->mathkern);
+ lua_setfield(L,-2,"mathkern");
+ }
}
char *panose_values_0[] = { "Any", "No Fit", "Text and Display", "Script", "Decorative", "Pictorial" };
@@ -885,6 +1058,20 @@ handle_pfminfo (lua_State *L, struct pfminfo pfm) {
dump_intfield (L, "os2_capheight", pfm.os2_capheight);
dump_intfield (L, "os2_defaultchar", pfm.os2_defaultchar);
dump_intfield (L, "os2_breakchar", pfm.os2_breakchar);
+ if (pfm.hascodepages) {
+ lua_newtable(L);
+ lua_pushnumber(L, pfm.codepages[0]); lua_rawseti(L,-2,1);
+ lua_pushnumber(L, pfm.codepages[1]); lua_rawseti(L,-2,2);
+ lua_setfield(L,-2,"codepages");
+ }
+ if (pfm.hasunicoderanges) {
+ lua_newtable(L);
+ lua_pushnumber(L, pfm.unicoderanges[0]); lua_rawseti(L,-2,1);
+ lua_pushnumber(L, pfm.unicoderanges[1]); lua_rawseti(L,-2,2);
+ lua_pushnumber(L, pfm.unicoderanges[2]); lua_rawseti(L,-2,3);
+ lua_pushnumber(L, pfm.unicoderanges[3]); lua_rawseti(L,-2,4);
+ lua_setfield(L,-2,"unicoderanges");
+ }
}
@@ -938,15 +1125,7 @@ do_handle_enc (lua_State *L, struct enc *enc) {
dump_stringfield(L,"iconv_name", enc->iconv_name);
- /* TH: iconv internal information, ignorable */
- /* iconv_t *tounicode; */
- /* iconv_t *fromunicode; */
- /* int (*tounicode_func)(int); */
- /* int (*fromunicode_func)(int); */
-
- /*dump_intfield (L,"is_temporary", enc->is_temporary);*/
dump_intfield (L,"char_max", enc->char_max);
-
}
void
@@ -956,7 +1135,7 @@ handle_enc (lua_State *L, struct enc *enc) {
}
void
-handle_encmap (lua_State *L, struct encmap *map) {
+handle_encmap (lua_State *L, struct encmap *map, int notdef_loc) {
int i;
dump_intfield(L,"enccount", map->enccount) ;
dump_intfield(L,"encmax", map->encmax) ;
@@ -974,8 +1153,12 @@ handle_encmap (lua_State *L, struct encmap *map) {
lua_createtable(L,map->encmax,1);
for (i=0;i<map->encmax;i++) {
if (map->map[i]!=-1) {
- lua_pushnumber(L,i);
- lua_pushnumber(L,map->map[i]);
+ int l = map->map[i];
+ lua_pushnumber(L,i);
+ if (l<notdef_loc)
+ lua_pushnumber(L,(l+1));
+ else
+ lua_pushnumber(L,l);
lua_rawset(L,-3);
}
}
@@ -985,8 +1168,14 @@ handle_encmap (lua_State *L, struct encmap *map) {
if (map->backmax > 0 && map->backmap != NULL) {
lua_newtable(L);
for (i=0;i<map->backmax;i++) {
- if (map->backmap[i]!=-1) {
- lua_pushnumber(L,i);
+ if (map->backmap[i]!=-1) { /* TODO: check this, because valgrind sometimes says
+ "Conditional jump or move depends on uninitialised value(s)"
+ needs a test file.
+ */
+ if (i<notdef_loc)
+ lua_pushnumber(L,(i+1));
+ else
+ lua_pushnumber(L,i);
lua_pushnumber(L,map->backmap[i]);
lua_rawset(L,-3);
}
@@ -1013,13 +1202,6 @@ handle_psdict (lua_State *L, struct psdict *private) {
}
}
-char *ttfnames_enum[ttf_namemax] = { "copyright", "family", "subfamily", "uniqueid",
- "fullname", "version", "postscriptname", "trademark",
- "manufacturer", "designer", "descriptor", "venderurl",
- "designerurl", "license", "licenseurl", "idontknow",
- "preffamilyname", "prefmodifiers", "compatfull", "sampletext",
- "cidfindfontname"};
-
void
do_handle_ttflangname (lua_State *L, struct ttflangname *names) {
int k;
@@ -1046,10 +1228,11 @@ void
do_handle_anchorclass (lua_State *L, struct anchorclass *anchor) {
dump_stringfield(L,"name", anchor->name);
- if (anchor->subtable!=NULL) {
- dump_stringfield(L,"lookup",anchor->subtable->subtable_name);
- }
+ dump_subtable_name (L, "lookup", anchor->subtable);
dump_enumfield(L,"type", anchor->type, anchorclass_type_enum);
+ /* uint8 has_base; */
+ /* uint8 processed, has_mark, matches, ac_num; */
+ /* uint8 ticked; */
}
void
@@ -1098,10 +1281,8 @@ do_handle_kernclass (lua_State *L, struct kernclass *kerns) {
}
lua_setfield(L,-2,"seconds");
- if (kerns->subtable != NULL) {
- dump_stringfield(L,"lookup", kerns->subtable->subtable_name);
- }
- /*dump_intfield(L,"kcid", kerns->kcid); *//* probably not needed */
+ dump_subtable_name(L, "lookup", kerns->subtable);
+ /*dump_intfield(L,"kcid", kerns->kcid); *//* probably not needed */
lua_createtable(L,kerns->second_cnt*kerns->first_cnt,1);
for (k=0;k<(kerns->second_cnt*kerns->first_cnt);k++) {
@@ -1154,9 +1335,6 @@ handle_kernclass (lua_State *L, struct kernclass *kerns) {
lua_setfield(L,-2,s); } }
-
-static char *fpossub_format_enum [] = { "glyphs", "class","coverage","reversecoverage"};
-
void handle_fpst_rule (lua_State *L, struct fpst_rule *rule, int format) {
int k;
@@ -1265,21 +1443,21 @@ handle_generic_fpst(lua_State *L, struct generic_fpst *fpst) {
}
lua_createtable(L,0,10);
do_handle_generic_fpst(L,fpst);
- lua_rawset(L,-3);
- next = fpst->next;
- while (next != NULL) {
- lua_checkstack(L,3);
- if (next->subtable != NULL &&
- next->subtable->subtable_name != NULL) {
- lua_pushstring(L,next->subtable->subtable_name);
- } else {
- lua_pushnumber(L,k); k++;
- }
- lua_createtable(L,0,10);
- do_handle_generic_fpst(L, next);
- lua_rawset(L,-3);
- next = next->next;
- }
+ lua_rawset(L,-3);
+ next = fpst->next;
+ while (next != NULL) {
+ lua_checkstack(L,3);
+ if (next->subtable != NULL &&
+ next->subtable->subtable_name != NULL) {
+ lua_pushstring(L,next->subtable->subtable_name);
+ } else {
+ lua_pushnumber(L,k); k++;
+ }
+ lua_createtable(L,0,10);
+ do_handle_generic_fpst(L, next);
+ lua_rawset(L,-3);
+ next = next->next;
+ }
}
void
@@ -1353,17 +1531,341 @@ handle_macfeat (lua_State *L, struct macfeat *features) {
NESTED_TABLE(do_handle_macfeat,features,6);
}
-char *tex_type_enum[4] = { "unset", "text", "math", "mathext"};
-/* has an offset of 1, ui_none = 0. */
-char *uni_interp_enum[9] = {
- "unset", "none", "adobe", "greek", "japanese",
- "trad_chinese", "simp_chinese", "korean", "ams" };
-
+/* asm_state flags:
+ Indic:
+ 0x8000 mark current glyph as first in rearrangement
+ 0x4000 don't advance to next glyph
+ 0x2000 mark current glyph as last
+ 0x000f verb
+ 0 = no change 8 = AxCD => CDxA
+ 1 = Ax => xA 9 = AxCD => DCxA
+ 2 = xD => Dx a = ABxD => DxAB
+ 3 = AxD => DxA b = ABxD => DxBA
+ 4 = ABx => xAB c = ABxCD => CDxAB
+ 5 = ABx => xBA d = ABxCD => CDxBA
+ 6 = xCD => CDx e = ABxCD => DCxAB
+ 7 = xCD => DCx f = ABxCD => DCxBA
+ Contextual:
+ 0x8000 mark current glyph
+ 0x4000 don't advance to next glyph
+ Insert:
+ 0x8000 mark current glyph
+ 0x4000 don't advance to next glyph
+ 0x2000 current is Kashida like
+ 0x1000 mark is Kashida like
+ 0x0800 current insert before
+ 0x0400 mark insert before
+ 0x03e0 count of chars to be inserted at current (31 max)
+ 0x001f count of chars to be inserted at mark (31 max)
+ Kern:
+ 0x8000 add current glyph to kerning stack
+ 0x4000 don't advance to next glyph
+ 0x3fff value offset
+*/
+/* to be tested */
+void
+do_handle_generic_asm (lua_State *L, struct generic_asm *sm) {
+ int i, k;
+
+ dump_enumfield (L,"type", sm->type, asm_type_enum);
+ /* backref */
+ dump_subtable_name(L, "lookup", sm->subtable);
+ /* uint8 ticked; */
+ lua_newtable(L);
+ if (sm->flags & asm_vert) {
+ lua_pushstring(L,"vert"); lua_pushboolean(L,1); lua_rawset(L,-3);
+ }
+ if (sm->flags & asm_descending) {
+ lua_pushstring(L,"descending"); lua_pushboolean(L,1); lua_rawset(L,-3);
+ }
+ if (sm->flags & asm_always) {
+ lua_pushstring(L,"always"); lua_pushboolean(L,1); lua_rawset(L,-3);
+ }
+ lua_setfield(L,-2,"flags");
+
+ if (sm->class_cnt >0) {
+ lua_newtable(L);
+ for (i=0; i<sm->class_cnt; i++) {
+ if (sm->classes[i]!=NULL) {
+ lua_pushstring(L,sm->classes[i]);
+ lua_rawseti(L,-2,(i+1));
+ }
+ }
+ lua_setfield(L,-2,"classes");
+ }
+ if (sm->state_cnt >0) {
+ lua_newtable(L);
+ for (i=0; i<(sm->class_cnt * sm->state_cnt); i++) {
+ struct asm_state as = sm->state[i];
+ dump_intfield(L,"next", as.next_state);
+ dump_intfield(L,"flags", as.flags);
+ if (sm->type==asm_context) {
+ lua_newtable(L);
+ if (as.u.context.mark_lookup!=NULL)
+ dump_stringfield(L,"mark", as.u.context.mark_lookup->lookup_name); /* backref */
+ if (as.u.context.cur_lookup!=NULL)
+ dump_stringfield(L,"cur", as.u.context.cur_lookup->lookup_name); /* backref */
+ lua_setfield(L,-2,"context");
+ } else if (sm->type==asm_insert) {
+ lua_newtable(L);
+ lua_pushstring(L, as.u.insert.mark_ins);
+ lua_setfield(L, -2, "mark");
+ lua_pushstring(L, as.u.insert.cur_ins);
+ lua_setfield(L, -2, "cur");
+ lua_setfield(L,-2,"insert");
+ } else if (sm->type==asm_kern) {
+ lua_newtable(L);
+ for (k=0;k<as.u.kern.kcnt;k++) {
+ lua_pushnumber(L,as.u.kern.kerns[k]);
+ lua_rawseti(L,-2, (k+1));
+ }
+ lua_setfield(L,-2,"kerns");
+ }
+ }
+ lua_setfield(L,-2,"states");
+ }
+}
+
+void
+handle_generic_asm (lua_State *L, struct generic_asm *sm) {
+ struct generic_asm *next;
+ NESTED_TABLE(do_handle_generic_asm,sm,6);
+}
+
+
+
+
+void handle_MATH (lua_State *L, struct MATH *MATH) {
+ dump_intfield(L,"ScriptPercentScaleDown",MATH->ScriptPercentScaleDown);
+ dump_intfield(L,"ScriptScriptPercentScaleDown",MATH->ScriptScriptPercentScaleDown);
+ dump_intfield(L,"DelimitedSubFormulaMinHeight",MATH->DelimitedSubFormulaMinHeight);
+ dump_intfield(L,"DisplayOperatorMinHeight",MATH->DisplayOperatorMinHeight);
+ dump_intfield(L,"MathLeading",MATH->MathLeading);
+ dump_intfield(L,"AxisHeight",MATH->AxisHeight);
+ dump_intfield(L,"AccentBaseHeight",MATH->AccentBaseHeight);
+ dump_intfield(L,"FlattenedAccentBaseHeight",MATH->FlattenedAccentBaseHeight);
+ dump_intfield(L,"SubscriptShiftDown",MATH->SubscriptShiftDown);
+ dump_intfield(L,"SubscriptTopMax",MATH->SubscriptTopMax);
+ dump_intfield(L,"SubscriptBaselineDropMin",MATH->SubscriptBaselineDropMin);
+ dump_intfield(L,"SuperscriptShiftUp",MATH->SuperscriptShiftUp);
+ dump_intfield(L,"SuperscriptShiftUpCramped",MATH->SuperscriptShiftUpCramped);
+ dump_intfield(L,"SuperscriptBottomMin",MATH->SuperscriptBottomMin);
+ dump_intfield(L,"SuperscriptBaselineDropMax",MATH->SuperscriptBaselineDropMax);
+ dump_intfield(L,"SubSuperscriptGapMin",MATH->SubSuperscriptGapMin);
+ dump_intfield(L,"SuperscriptBottomMaxWithSubscript",MATH->SuperscriptBottomMaxWithSubscript);
+ dump_intfield(L,"SpaceAfterScript",MATH->SpaceAfterScript);
+ dump_intfield(L,"UpperLimitGapMin",MATH->UpperLimitGapMin);
+ dump_intfield(L,"UpperLimitBaselineRiseMin",MATH->UpperLimitBaselineRiseMin);
+ dump_intfield(L,"LowerLimitGapMin",MATH->LowerLimitGapMin);
+ dump_intfield(L,"LowerLimitBaselineDropMin",MATH->LowerLimitBaselineDropMin);
+ dump_intfield(L,"StackTopShiftUp",MATH->StackTopShiftUp);
+ dump_intfield(L,"StackTopDisplayStyleShiftUp",MATH->StackTopDisplayStyleShiftUp);
+ dump_intfield(L,"StackBottomShiftDown",MATH->StackBottomShiftDown);
+ dump_intfield(L,"StackBottomDisplayStyleShiftDown",MATH->StackBottomDisplayStyleShiftDown);
+ dump_intfield(L,"StackGapMin",MATH->StackGapMin);
+ dump_intfield(L,"StackDisplayStyleGapMin",MATH->StackDisplayStyleGapMin);
+ dump_intfield(L,"StretchStackTopShiftUp",MATH->StretchStackTopShiftUp);
+ dump_intfield(L,"StretchStackBottomShiftDown",MATH->StretchStackBottomShiftDown);
+ dump_intfield(L,"StretchStackGapAboveMin",MATH->StretchStackGapAboveMin);
+ dump_intfield(L,"StretchStackGapBelowMin",MATH->StretchStackGapBelowMin);
+ dump_intfield(L,"FractionNumeratorShiftUp",MATH->FractionNumeratorShiftUp);
+ dump_intfield(L,"FractionNumeratorDisplayStyleShiftUp",MATH->FractionNumeratorDisplayStyleShiftUp);
+ dump_intfield(L,"FractionDenominatorShiftDown",MATH->FractionDenominatorShiftDown);
+ dump_intfield(L,"FractionDenominatorDisplayStyleShiftDown",MATH->FractionDenominatorDisplayStyleShiftDown);
+ dump_intfield(L,"FractionNumeratorGapMin",MATH->FractionNumeratorGapMin);
+ dump_intfield(L,"FractionNumeratorDisplayStyleGapMin",MATH->FractionNumeratorDisplayStyleGapMin);
+ dump_intfield(L,"FractionRuleThickness",MATH->FractionRuleThickness);
+ dump_intfield(L,"FractionDenominatorGapMin",MATH->FractionDenominatorGapMin);
+ dump_intfield(L,"FractionDenominatorDisplayStyleGapMin",MATH->FractionDenominatorDisplayStyleGapMin);
+ dump_intfield(L,"SkewedFractionHorizontalGap",MATH->SkewedFractionHorizontalGap);
+ dump_intfield(L,"SkewedFractionVerticalGap",MATH->SkewedFractionVerticalGap);
+ dump_intfield(L,"OverbarVerticalGap",MATH->OverbarVerticalGap);
+ dump_intfield(L,"OverbarRuleThickness",MATH->OverbarRuleThickness);
+ dump_intfield(L,"OverbarExtraAscender",MATH->OverbarExtraAscender);
+ dump_intfield(L,"UnderbarVerticalGap",MATH->UnderbarVerticalGap);
+ dump_intfield(L,"UnderbarRuleThickness",MATH->UnderbarRuleThickness);
+ dump_intfield(L,"UnderbarExtraDescender",MATH->UnderbarExtraDescender);
+ dump_intfield(L,"RadicalVerticalGap",MATH->RadicalVerticalGap);
+ dump_intfield(L,"RadicalDisplayStyleVerticalGap",MATH->RadicalDisplayStyleVerticalGap);
+ dump_intfield(L,"RadicalRuleThickness",MATH->RadicalRuleThickness);
+ dump_intfield(L,"RadicalExtraAscender",MATH->RadicalExtraAscender);
+ dump_intfield(L,"RadicalKernBeforeDegree",MATH->RadicalKernBeforeDegree);
+ dump_intfield(L,"RadicalKernAfterDegree",MATH->RadicalKernAfterDegree);
+ dump_intfield(L,"RadicalDegreeBottomRaisePercent",MATH->RadicalDegreeBottomRaisePercent);
+ dump_intfield(L,"MinConnectorOverlap",MATH->MinConnectorOverlap);
+}
+
+/* the handling of BASE is untested, no font */
+void handle_baselangextent (lua_State *L, struct baselangextent *ble);
+
+void
+do_handle_baselangextent (lua_State *L, struct baselangextent *ble) {
+ dump_tag(L,"tag",ble->lang);
+ dump_intfield(L,"ascent",ble->ascent);
+ dump_intfield(L,"descent",ble->descent);
+ lua_newtable(L);
+ handle_baselangextent(L, ble->features);
+ lua_setfield(L,-2,"features");
+}
+
+
+void handle_baselangextent (lua_State *L, struct baselangextent *ble) {
+ struct baselangextent *next;
+ NESTED_TABLE(do_handle_baselangextent,ble,4);
+}
+
+
+void handle_base (lua_State *L, struct Base *Base) {
+ int i;
+ struct basescript *next = Base->scripts;
+ lua_newtable(L);
+ for ( i=0; i<Base->baseline_cnt; i++ ) {
+ lua_pushstring(L,make_tag_string(Base->baseline_tags[i]));
+ lua_rawseti(L,-2,(i+1));
+ }
+ lua_setfield(L,-2,"tags");
+ if (next != NULL) {
+ lua_newtable(L);
+ while (next != NULL) {
+ lua_pushstring(L,make_tag_string(next->script));
+ lua_newtable(L);
+ dump_intfield(L, "default_baseline", (next->def_baseline+1)) ;
+ lua_newtable(L);
+ for ( i=0; i<Base->baseline_cnt; i++ ) {
+ lua_pushnumber(L, next->baseline_pos[i]) ;
+ lua_rawseti(L,-2, (i+1));
+ }
+ lua_setfield(L, -2, "baseline");
+ lua_newtable(L);
+ handle_baselangextent(L, next->langs);
+ lua_setfield(L, -2, "lang");
+ lua_rawset(L,-3);
+ next = next->next;
+ }
+ lua_setfield(L,-2,"scripts");
+ }
+}
+
+
+void
+handle_axismap (lua_State *L, struct axismap *am) {
+ int i;
+ lua_checkstack(L,3);
+ lua_newtable(L);
+ for (i=0;i<am->points;i++) {
+ lua_pushnumber(L, am->blends[i] ) ;
+ lua_rawseti(L,-2, (i+1));
+ }
+ lua_setfield(L,-2,"blends");
+ lua_newtable(L);
+ for (i=0;i<am->points;i++) {
+ lua_pushnumber(L, am->designs[i] ) ;
+ lua_rawseti(L,-2, (i+1));
+ }
+ lua_setfield(L,-2,"designs");
+ dump_realfield(L, "min", am->min) ;
+ dump_realfield(L, "def", am->def) ;
+ dump_realfield(L, "max", am->max) ;
+ if (am->axisnames != NULL ){
+ lua_newtable(L);
+ handle_macname(L, am->axisnames);
+ lua_setfield(L,-2,"axisnames");
+ }
+}
+
+
+void
+handle_mmset (lua_State *L, struct mmset *mm) {
+ int i, k;
+ lua_newtable(L);
+ for (i=0;i<mm->axis_count;i++) {
+ lua_pushstring(L, mm->axes[i]) ;
+ lua_rawseti(L,-2, (i+1));
+ }
+ lua_setfield(L,-2,"axes");
+
+ dump_intfield(L,"instance_count",mm->instance_count);
+ /* SplineFont *normal; */ /* this is the parent */
+ if (mm->instance_count>0) {
+ lua_newtable(L);
+ for (i=0;i<mm->instance_count*mm->axis_count;i++) {
+ lua_pushnumber(L, mm->positions[i]) ;
+ lua_rawseti(L,-2, (i+1));
+ }
+ lua_setfield(L,-2,"positions");
+
+ /* better not to do this */
+#if 0
+ {
+ struct mmset *mmsave ;
+ lua_newtable(L);
+ for (i=0;i<mm->instance_count;i++) {
+ lua_checkstack(L,20);
+ lua_createtable(L,0,60);
+ mmsave = mm->instances[i]->mm;
+ mm->instances[i]->mm = NULL;
+ handle_splinefont(L, mm->instances[i]);
+ mm->instances[i]->mm = mmsave;
+ lua_rawseti(L,-2, (i+1));
+ }
+ lua_setfield(L,-2,"instances");
+ }
+#endif
+
+ lua_newtable(L);
+ for (i=0;i<mm->instance_count;i++) {
+ lua_pushnumber(L, mm->defweights[i]) ;
+ lua_rawseti(L,-2, (i+1));
+ }
+ lua_setfield(L,-2,"defweights");
+ }
+
+ if (mm->axismaps != NULL) {
+ lua_newtable(L);
+ for (i=0;i<mm->axis_count;i++) {
+ lua_newtable(L);
+ handle_axismap(L, &(mm->axismaps[i]));
+ lua_rawseti(L, -2, (i+1));
+ }
+ lua_setfield(L,-2,"axismaps");
+ }
+ dump_stringfield(L,"cdv",mm->cdv);
+ dump_stringfield(L,"ndv",mm->ndv);
+ dump_intfield(L,"named_instance_count",mm->named_instance_count);
+
+ if (mm->named_instance_count>0) {
+ lua_newtable(L);
+ for (i=0; i<mm->named_instance_count;i++) {
+ struct named_instance *ni = &(mm->named_instances[i]);
+ lua_newtable(L);
+
+ lua_newtable(L);
+ for (k=0;k<=mm->axis_count;k++) {
+ lua_pushnumber(L,ni->coords[k]);
+ lua_rawseti(L,-2,(k+1));
+ }
+ lua_setfield(L,-2,"coords");
+
+ lua_newtable(L);
+ handle_macname(L, ni->names);
+ lua_setfield(L,-2,"names");
+
+ lua_rawseti(L,-2,(i+1));
+ }
+ lua_setfield(L,-2,"named_instances");
+ }
+ /* unsigned int changed: 1; */
+ dump_intfield(L,"apple",mm->apple);
+}
+
+
void
handle_splinefont(lua_State *L, struct splinefont *sf) {
- int k,l;
+ int k;
+ int fix_notdef = 0;
+ int l = -1;
dump_stringfield(L,"table_version", LUA_OTF_VERSION);
dump_stringfield(L,"fontname", sf->fontname);
@@ -1372,18 +1874,17 @@ handle_splinefont(lua_State *L, struct splinefont *sf) {
dump_stringfield(L,"weight", sf->weight);
dump_stringfield(L,"copyright", sf->copyright);
dump_stringfield(L,"filename", sf->filename);
- dump_stringfield(L,"defbasefilename", sf->defbasefilename);
+ /* dump_stringfield(L,"defbasefilename", sf->defbasefilename); */
dump_stringfield(L,"version", sf->version);
dump_floatfield (L,"italicangle", sf->italicangle);
dump_floatfield (L,"upos", sf->upos);
dump_floatfield (L,"uwidth", sf->uwidth);
- dump_intfield (L,"units_per_em", sf->units_per_em);
dump_intfield (L,"ascent", sf->ascent);
dump_intfield (L,"descent", sf->descent);
- dump_intfield (L,"vertical_origin", sf->vertical_origin);
dump_intfield (L,"uniqueid", sf->uniqueid);
dump_intfield (L,"glyphcnt", sf->glyphcnt);
dump_intfield (L,"glyphmax", sf->glyphmax);
+ dump_intfield (L,"units_per_em", sf->units_per_em);
if (sf->possub != NULL) {
lua_newtable(L);
@@ -1393,37 +1894,74 @@ handle_splinefont(lua_State *L, struct splinefont *sf) {
lua_checkstack(L,4);
lua_createtable(L,sf->glyphcnt,0);
- /* here is a bit of hackery for .notdef's that appear in the middle
- of a type1 font. This situation should be handled nicer, because the
- trick assumes a specific way of handling cff fonts, and that will
- fail. The current code will at least make sure that the intended use
- works, for now. */
- l = 0;
- for (k=0;k<sf->glyphcnt;k++,l++) {
- lua_pushnumber(L,l);
- lua_createtable(L,0,12);
- if (sf->glyphs[k]) {
- if (k>0 && strcmp(sf->glyphs[k]->name,".notdef") == 0) {
- l--;
- } else {
- handle_splinechar(L,sf->glyphs[k], sf->hasvmetrics);
- }
- }
- lua_rawset(L,-3);
+
+ /* This after-the-fact type discovery is not brilliant,
+ I should really add a 'format' key in the structure */
+ if ((sf->origname != NULL) &&
+ (strmatch(sf->origname+strlen(sf->origname)-4, ".pfa")==0 ||
+ strmatch(sf->origname+strlen(sf->origname)-4, ".pfb")==0)) {
+ fix_notdef = 1;
+ }
+
+ if (fix_notdef) {
+ /* some code to ensure that the .notdef ends up in slot 0
+ (this will actually be enforced by the CFF writer) */
+ for (k=0;k<sf->glyphcnt;k++) {
+ if (sf->glyphs[k]) {
+ if (strcmp(sf->glyphs[k]->name,".notdef") == 0) {
+ l = k;
+ }
+ }
+ }
+ if (l==-1) { /* fake a .notdef at the end */
+ l = sf->glyphcnt;
+ }
+ for (k=0;k<l;k++) {
+ lua_pushnumber(L,(k+1));
+ lua_createtable(L,0,12);
+ if (sf->glyphs[k]) {
+ handle_splinechar(L,sf->glyphs[k], sf->hasvmetrics);
+ }
+ lua_rawset(L,-3);
+ }
+ if (sf->glyphs != NULL && l<sf->glyphcnt) {
+ lua_pushnumber(L,0);
+ lua_createtable(L,0,12);
+ if (sf->glyphs[l]) {
+ handle_splinechar(L,sf->glyphs[l], sf->hasvmetrics);
+ }
+ lua_rawset(L,-3);
+ }
+ }
+ if ((l+1)<sf->glyphcnt) {
+ for (k=(l+1);k<sf->glyphcnt;k++) {
+ lua_pushnumber(L,k);
+ lua_createtable(L,0,12);
+ if (sf->glyphs[k]) {
+ handle_splinechar(L,sf->glyphs[k], sf->hasvmetrics);
+ }
+ lua_rawset(L,-3);
+ }
}
lua_setfield(L,-2,"glyphs");
- dump_intfield(L,"changed", sf->changed);
+ /* dump_intfield(L,"changed", sf->changed); */
dump_intfield(L,"hasvmetrics", sf->hasvmetrics);
- dump_intfield(L,"order2", sf->order2);
+ dump_intfield(L,"onlybitmaps", sf->onlybitmaps);
+ dump_intfield(L,"serifcheck", sf->serifcheck);
+ dump_intfield(L,"isserif", sf->isserif);
+ dump_intfield(L,"issans", sf->issans);
+ dump_intfield(L,"encodingchanged", sf->encodingchanged);
dump_intfield(L,"strokedfont", sf->strokedfont);
+ dump_intfield(L,"use_typo_metrics", sf->use_typo_metrics);
dump_intfield(L,"weight_width_slope_only", sf->weight_width_slope_only);
dump_intfield(L,"head_optimized_for_cleartype",sf->head_optimized_for_cleartype);
+
dump_enumfield(L,"uni_interp", (sf->uni_interp+1), uni_interp_enum);
if (sf->map != NULL ) {
lua_newtable(L);
- handle_encmap(L,sf->map);
+ handle_encmap(L,sf->map, l);
lua_setfield(L,-2,"map");
}
@@ -1454,6 +1992,7 @@ handle_splinefont(lua_State *L, struct splinefont *sf) {
dump_intfield (L,"supplement", sf->supplement);
lua_setfield(L,-2,"cidinfo");
+ /* SplineFont *cidmaster */ /* parent in a subfont */
if (sf->subfontcnt>0) {
lua_createtable(L,sf->subfontcnt,0);
for (k=0;k<sf->subfontcnt;k++) {
@@ -1465,22 +2004,30 @@ handle_splinefont(lua_State *L, struct splinefont *sf) {
lua_setfield(L,-2,"subfonts");
}
- /* always the parent of a subfont, so why bother? */
- /*
- if (sf->cidmaster != NULL) {
- lua_pushstring(L, sf->cidmaster->origname);
- lua_setfield(L,-2,"cidmaster");
- }
- */
-
dump_stringfield(L,"comments", sf->comments);
-
+ dump_stringfield(L,"fontlog", sf->fontlog);
+
+ if (sf->cvt_names != NULL) {
+ lua_newtable(L);
+ for (k=0; sf->cvt_names[k]!=END_CVT_NAMES; ++k) {
+ lua_pushstring(L, sf->cvt_names[k]);
+ lua_rawseti(L,-2,(k+1));
+ }
+ lua_setfield(L,-2,"cvt_names");
+ }
+
if (sf->ttf_tables != NULL) {
lua_newtable(L);
handle_ttf_table(L,sf->ttf_tables);
lua_setfield(L,-2,"ttf_tables");
}
+ if (sf->ttf_tab_saved != NULL) {
+ lua_newtable(L);
+ handle_ttf_table(L,sf->ttf_tab_saved);
+ lua_setfield(L,-2,"ttf_tab_saved");
+ }
+
if (sf->texdata.type != tex_unset) {
lua_newtable(L);
dump_enumfield(L,"type", sf->texdata.type, tex_type_enum);
@@ -1519,17 +2066,21 @@ handle_splinefont(lua_State *L, struct splinefont *sf) {
lua_setfield(L,-2,"gpos");
}
- /* Todo: a set of Apple-related items */
- /*
- ASM *sm;
- if (sf->features != NULL) {
- lua_newtable(L);
- handle_macfeat(L,sf->features);
- lua_setfield(L,-2,"features");
- }
- struct mmset *mm;
- */
-
+ if (sf->sm != NULL) {
+ lua_newtable(L);
+ handle_generic_asm(L,sf->sm);
+ lua_setfield(L,-2,"sm");
+ }
+ if (sf->features != NULL) {
+ lua_newtable(L);
+ handle_macfeat(L,sf->features);
+ lua_setfield(L,-2,"features");
+ }
+ if (sf->mm != NULL) {
+ lua_newtable(L);
+ handle_mmset (L,sf->mm);
+ lua_setfield(L,-2,"mm");
+ }
dump_stringfield(L,"chosenname", sf->chosenname);
dump_intfield(L,"macstyle", sf->macstyle);
@@ -1547,7 +2098,6 @@ handle_splinefont(lua_State *L, struct splinefont *sf) {
dump_intfield(L,"design_range_bottom",sf->design_range_bottom);
dump_intfield(L,"design_range_top", sf->design_range_top);
dump_floatfield(L,"strokewidth", sf->strokewidth);
- /*dump_intfield(L,"mark_class_cnt", sf->mark_class_cnt);*/
if (sf->mark_class_cnt>0) {
lua_newtable(L);
@@ -1571,16 +2121,62 @@ handle_splinefont(lua_State *L, struct splinefont *sf) {
dump_intfield(L,"modificationtime", sf->modificationtime);
dump_intfield(L,"os2_version", sf->os2_version);
- /* Grid-fitting And Scan-conversion Procedures: not needed */
+ dump_intfield(L,"sfd_version", sf->sfd_version);
- /*
- dump_intfield(L,"gasp_version", sf->gasp_version);
- dump_intfield(L,"gasp_cnt", sf->gasp_cnt);
- dump_intfield(L,"gasp", (int)sf->gasp);
- */
+ if (sf->MATH != NULL) {
+ lua_newtable(L);
+ handle_MATH(L, sf->MATH);
+ lua_setfield(L,-2,"math");
+ }
+
+ if (sf->loadvalidation_state != 0) {
+ lua_newtable(L);
+ int val = 1;
+ int st = sf->loadvalidation_state;
+ if (st & lvs_bad_ps_fontname) {
+ lua_pushliteral(L, "bad_ps_fontname"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_glyph_table) {
+ lua_pushliteral(L, "bad_glyph_table"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_cff_table) {
+ lua_pushliteral(L, "bad_cff_table"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_metrics_table) {
+ lua_pushliteral(L, "bad_metrics_table"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_cmap_table) {
+ lua_pushliteral(L, "bad_cmap_table"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_bitmaps_table) {
+ lua_pushliteral(L, "bad_bitmaps_table"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_gx_table) {
+ lua_pushliteral(L, "bad_gx_table"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_ot_table) {
+ lua_pushliteral(L, "bad_ot_table"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_os2_version) {
+ lua_pushliteral(L, "bad_os2_version"); lua_rawseti(L,-2,val++);
+ }
+ if (st & lvs_bad_sfnt_header) {
+ lua_pushliteral(L, "bad_sfnt_header"); lua_rawseti(L,-2,val++);
+ }
+ lua_setfield(L,-2,"validation_state");
+ }
- /* uint8 sfd_version; */ /* Used only when reading in an sfd file */
- /* struct gfi_data *fontinfo; */ /* TH: looks like this is screen-related */
+ if (sf->horiz_base != NULL) {
+ lua_newtable(L);
+ handle_base(L, sf->horiz_base);
+ lua_setfield(L,-2,"horiz_base");
+ }
+ if (sf->vert_base != NULL) {
+ lua_newtable(L);
+ handle_base(L, sf->vert_base);
+ lua_setfield(L,-2,"vert_base");
+ }
+ dump_intfield(L,"extrema_bound", sf->extrema_bound);
}
int
@@ -1633,14 +2229,16 @@ ff_info (lua_State *L) {
lua_error(L);
} else {
if (sf->next != NULL) {
+ SplineFont *sf_next;
i = 1;
lua_newtable(L);
while (sf) {
do_ff_info(L, sf);
lua_rawseti(L,-2,i);
i++;
+ sf_next = sf->next;
SplineFontFree(sf);
- sf = sf->next;
+ sf = sf_next;
}
} else {
do_ff_info(L, sf);
@@ -1650,38 +2248,6 @@ ff_info (lua_State *L) {
return 1;
}
-/* possible flags:
-
- ttf_flag_shortps = 1,
- ttf_flag_nohints = 2,
- ttf_flag_applemode=4,
- ttf_flag_pfed_comments=8,
- ttf_flag_pfed_colors=0x10,
- ttf_flag_otmode=0x20,
- ttf_flag_glyphmap=0x40,
- ttf_flag_TeXtable=0x80,
- ttf_flag_ofm=0x100,
- ttf_flag_oldkern=0x200,
- ttf_flag_brokensize=0x400
-
- ps_flag_nohintsubs = 0x10000,
- ps_flag_noflex=0x20000,
- ps_flag_nohints = 0x40000,
- ps_flag_restrict256=0x80000,
- ps_flag_afm = 0x100000,
- ps_flag_pfm = 0x200000,
- ps_flag_tfm = 0x400000,
- ps_flag_round = 0x800000,
- ps_flag_nocffsugar = 0x1000000,
- ps_flag_identitycidmap = 0x2000000,
- ps_flag_afmwithmarks = 0x4000000,
- ps_flag_noseac = 0x8000000,
-
-
-*/
-
-extern int readbinfile(FILE *f, unsigned char **b, int *s);
-
static void ff_do_cff (SplineFont *sf, char *filename, unsigned char **buf, int *bufsiz) {
FILE *f;
int32 *bsizes = NULL;
@@ -1690,7 +2256,7 @@ static void ff_do_cff (SplineFont *sf, char *filename, unsigned char **buf, int
map = EncMap1to1(sf->glyphcnt);
- if(WriteTTFFont(filename, sf, ff_cff, bsizes, bf_none, flags, map)) {
+ if(WriteTTFFont(filename, sf, ff_cff, bsizes, bf_none, flags, map, ly_fore)) {
/* success */
f = fopen(filename,"rb");
readbinfile(f , buf, bufsiz);
@@ -1699,7 +2265,7 @@ static void ff_do_cff (SplineFont *sf, char *filename, unsigned char **buf, int
return;
}
/* errors */
- /*fprintf(stdout,"\n%s => CFF, failed\n", sf->filename);*/
+ fprintf(stdout,"\n%s => CFF, failed\n", sf->filename);
}
@@ -1749,27 +2315,43 @@ int ff_get_ttc_index(char *ffname, char*psname) {
return index;
}
+static int warning_given = 0;
-static int ff_make_cff (lua_State *L) {
- SplineFont **sf;
- char *s;
- unsigned char *buf = NULL;
- int bufsiz = 0;
- sf = check_isfont(L,1);
- s = (char *)luaL_checkstring(L,2);
- ff_do_cff (*sf, s, &buf, &bufsiz);
- return 0;
+static int
+ffold_info (lua_State *L) {
+ if (warning_given<5) {
+ fprintf (stderr, "Warning: The 'fontforge' table has been renamed to 'fontloader'.\n");
+ fprintf (stderr, " Please update your source file(s) accordingly.\n");
+ warning_given ++;
+ }
+ return ff_info(L);
+}
+
+static int
+ffold_open (lua_State *L) {
+ fprintf (stderr, "Warning: The 'fontforge' table has been renamed to 'fontloader'.\n");
+ fprintf (stderr, " Please update your source file(s) accordingly.\n");
+ return ff_open(L);
}
static struct luaL_reg fflib[] = {
+ {"open", ffold_open},
+ {"info", ffold_info},
+ {"close", ff_close},
+ {"apply_afmfile", ff_apply_afmfile},
+ {"apply_featurefile", ff_apply_featurefile},
+ {"to_table", ff_make_table},
+ {NULL, NULL}
+};
+
+static struct luaL_reg fllib[] = {
{"open", ff_open},
{"info", ff_info},
{"close", ff_close},
{"apply_afmfile", ff_apply_afmfile},
{"apply_featurefile", ff_apply_featurefile},
{"to_table", ff_make_table},
- {"to_cff", ff_make_cff},
{NULL, NULL}
};
@@ -1778,12 +2360,20 @@ static const struct luaL_reg fflib_m [] = {
{NULL, NULL} /* sentinel */
};
+extern char *SaveTablesPref;
+extern char *coord_sep ;
int luaopen_ff (lua_State *L) {
- LoadPrefs();
+ InitSimpleStuff();
+ setlocale(LC_ALL,"C"); /* undo whatever InitSimpleStuff has caused */
+ coord_sep = ",";
+ FF_SetUiInterface(&luaui_interface);
+ default_encoding = FindOrMakeEncoding("ISO8859-1");
+ SaveTablesPref = "VORG,JSTF,acnt,bsln,fdsc,fmtx,hsty,just,trak,Zapf,LINO";
luaL_newmetatable(L,FONT_METATABLE);
luaL_register(L, NULL, fflib_m);
luaL_openlib(L, "fontforge", fflib, 0);
+ luaL_openlib(L, "fontloader", fllib, 0);
return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/Makefile b/Build/source/texk/web2c/luatexdir/luaprofiler/Makefile
new file mode 100644
index 00000000000..57ccbfd165f
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/Makefile
@@ -0,0 +1,19 @@
+
+srcdir=../../../src/libs/luaprofiler
+
+OBJS= clocks.o \
+ core_profiler.o \
+ function_meter.o \
+ stack.o \
+ lua50_profiler.o
+
+
+profiler: $(OBJS)
+ ar cru libprofiler.a $(OBJS)
+ ranlib libprofiler.a
+
+clean:
+ rm -f $(OBJS) libprofiler.a
+
+%.o: $(srcdir)/%.c
+ $(CC) -c -I../../../src/libs/lua51 $< $(CFLAGS) -o $@
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/clocks.c b/Build/source/texk/web2c/luatexdir/luaprofiler/clocks.c
new file mode 100644
index 00000000000..e693c48535f
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/clocks.c
@@ -0,0 +1,63 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: clocks.c,v 1.4 2007/08/22 19:23:53 carregal Exp $
+*/
+
+/*****************************************************************************
+clocks.c:
+ Module to register the time (seconds) between two events
+
+Design:
+ 'lprofC_start_timer()' marks the first event
+ 'lprofC_get_seconds()' gives you the seconds elapsed since the timer
+ was started
+*****************************************************************************/
+
+#include <stdio.h>
+#include "clocks.h"
+
+/*
+ Here you can choose what time function you are going to use.
+ These two defines ('TIMES' and 'CLOCK') correspond to the usage of
+ functions times() and clock() respectively.
+ Which one is better? It depends on your needs:
+ TIMES - returns the clock ticks since the system was up
+ (you may use it if you want to measure a system
+ delay for a task, like time spent to get input from keyboard)
+ CLOCK - returns the clock ticks dedicated to the program
+ (this should be prefered in a multithread system and is
+ the default choice)
+
+ note: I guess TIMES don't work for win32
+*/
+
+#ifdef TIMES
+
+ #include <sys/times.h>
+
+ static struct tms t;
+
+ #define times(t) times(t)
+
+#else /* ifdef CLOCK */
+
+ #define times(t) clock()
+
+#endif
+
+
+void lprofC_start_timer(clock_t *time_marker) {
+ *time_marker = times(&t);
+}
+
+static clock_t get_clocks(clock_t time_marker) {
+ return times(&t) - time_marker;
+}
+
+float lprofC_get_seconds(clock_t time_marker) {
+clock_t clocks;
+ clocks = get_clocks(time_marker);
+ return (float)clocks / (float)CLOCKS_PER_SEC;
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/clocks.h b/Build/source/texk/web2c/luatexdir/luaprofiler/clocks.h
new file mode 100644
index 00000000000..b2c7fd7d4d5
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/clocks.h
@@ -0,0 +1,20 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: clocks.h,v 1.4 2007/08/22 19:23:53 carregal Exp $
+*/
+
+/*****************************************************************************
+clocks.h:
+ Module to register the time (seconds) between two events
+
+Design:
+ 'lprofC_start_timer()' marks the first event
+ 'lprofC_get_seconds()' gives you the seconds elapsed since the timer
+ was started
+*****************************************************************************/
+
+#include <time.h>
+
+void lprofC_start_timer(clock_t *time_marker);
+float lprofC_get_seconds(clock_t time_marker);
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.c b/Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.c
new file mode 100644
index 00000000000..0f70fba106e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.c
@@ -0,0 +1,180 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005.2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: core_profiler.c,v 1.9 2008/05/19 18:36:23 mascarenhas Exp $
+*/
+
+/*****************************************************************************
+core_profiler.c:
+ Lua version independent profiler interface.
+ Responsible for handling the "enter function" and "leave function" events
+ and for writing the log file.
+
+Design (using the Lua callhook mechanism) :
+ 'lprofP_init_core_profiler' set up the profile service
+ 'lprofP_callhookIN' called whenever Lua enters a function
+ 'lprofP_callhookOUT' called whenever Lua leaves a function
+*****************************************************************************/
+
+/*****************************************************************************
+ The profiled program can be viewed as a graph with the following properties:
+directed, multigraph, cyclic and connected. The log file generated by a
+profiler section corresponds to a path on this graph.
+ There are several graphs for which this path fits on. Some times it is
+easier to consider this path as being generated by a simpler graph without
+properties like cyclic and multigraph.
+ The profiler log file can be viewed as a "reversed" depth-first search
+(with the depth-first search number for each vertex) vertex listing of a graph
+with the following properties: simple, acyclic, directed and connected, for
+which each vertex appears as many times as needed to strip the cycles and
+each vertex has an indegree of 1.
+ "reversed" depth-first search means that instead of being "printed" before
+visiting the vertex's descendents (as done in a normal depth-first search),
+the vertex is "printed" only after all his descendents have been processed (in
+a depth-first search recursive algorithm).
+*****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+
+#include "function_meter.h"
+
+#include "core_profiler.h"
+
+ /* default log name (%s is used to place a random string) */
+#define OUT_FILENAME "lprof_%s.out"
+
+ /* for faster execution (??) */
+static FILE *outf;
+static lprofS_STACK_RECORD *info;
+static float function_call_time;
+
+
+/* output a line to the log file, using 'printf()' syntax */
+/* assume the timer is off */
+static void output(const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(outf, format, ap);
+ va_end(ap);
+
+ /* write now to avoid delays when the timer is on */
+ fflush(outf);
+}
+
+
+/* do not allow a string with '\n' and '|' (log file format reserved chars) */
+/* - replace them by ' ' */
+static void formats(char *s) {
+ int i;
+ if (!s)
+ return;
+ for (i = strlen(s); i>=0; i--) {
+ if ((s[i] == '|') || (s[i] == '\n'))
+ s[i] = ' ';
+ }
+}
+
+
+/* computes new stack and new timer */
+void lprofP_callhookIN(lprofP_STATE* S, char *func_name, char *file, int linedefined, int currentline) {
+ S->stack_level++;
+ lprofM_enter_function(S, file, func_name, linedefined, currentline);
+}
+
+
+/* pauses all timers to write a log line and computes the new stack */
+/* returns if there is another function in the stack */
+int lprofP_callhookOUT(lprofP_STATE* S) {
+
+ if (S->stack_level == 0) {
+ return 0;
+ }
+
+ S->stack_level--;
+
+ /* 0: do not resume the parent function's timer yet... */
+ info = lprofM_leave_function(S, 0);
+ /* writing a log may take too long to be computed with the function's time ...*/
+ lprofM_pause_total_time(S);
+ info->local_time += function_call_time;
+ info->total_time += function_call_time;
+ formats(info->file_defined);
+ formats(info->function_name);
+ output("%d\t%s\t%s\t%d\t%d\t%f\t%f\n", S->stack_level, info->file_defined,
+ info->function_name,
+ info->line_defined, info->current_line,
+ info->local_time, info->total_time);
+ /* ... now it's ok to resume the timer */
+ if (S->stack_level != 0) {
+ lprofM_resume_function(S);
+ }
+
+ return 1;
+
+}
+
+
+/* opens the log file */
+/* returns true if the file could be opened */
+lprofP_STATE* lprofP_init_core_profiler(const char *_out_filename, int isto_printheader, float _function_call_time) {
+ lprofP_STATE* S;
+ char auxs[256];
+ char *s;
+ char *randstr;
+ const char *out_filename;
+
+ function_call_time = _function_call_time;
+ out_filename = (_out_filename) ? (_out_filename):(OUT_FILENAME);
+
+ /* the random string to build the logname is extracted */
+ /* from 'tmpnam()' (the '/tmp/' part is deleted) */
+ randstr = tmpnam(NULL);
+ for (s = strtok(randstr, "/\\"); s; s = strtok(NULL, "/\\")) {
+ randstr = s;
+ }
+
+ if(randstr[strlen(randstr)-1]=='.')
+ randstr[strlen(randstr)-1]='\0';
+
+ sprintf(auxs, out_filename, randstr);
+ outf = fopen(auxs, "a");
+ if (!outf) {
+ return 0;
+ }
+
+ if (isto_printheader) {
+ output("stack_level\tfile_defined\tfunction_name\tline_defined\tcurrent_line\tlocal_time\ttotal_time\n");
+ }
+
+ /* initialize the 'function_meter' */
+ S = lprofM_init();
+ if(!S) {
+ fclose(outf);
+ return 0;
+ }
+
+ return S;
+}
+
+void lprofP_close_core_profiler(lprofP_STATE* S) {
+ if(outf) fclose(outf);
+ if(S) free(S);
+}
+
+lprofP_STATE* lprofP_create_profiler(float _function_call_time) {
+ lprofP_STATE* S;
+
+ function_call_time = _function_call_time;
+
+ /* initialize the 'function_meter' */
+ S = lprofM_init();
+ if(!S) {
+ return 0;
+ }
+
+ return S;
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.h b/Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.h
new file mode 100644
index 00000000000..d066ef3d08b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/core_profiler.h
@@ -0,0 +1,31 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: core_profiler.h,v 1.6 2007/08/22 19:23:53 carregal Exp $
+*/
+
+/*****************************************************************************
+core_profiler.h:
+ Lua version independent profiler interface.
+ Responsible for handling the "enter function" and "leave function" events
+ and for writing the log file.
+
+Design (using the Lua callhook mechanism) :
+ 'lprofP_init_core_profiler' set up the profile service
+ 'lprofP_callhookIN' called whenever Lua enters a function
+ 'lprofP_callhookOUT' called whenever Lua leaves a function
+*****************************************************************************/
+
+#include "stack.h"
+
+/* computes new stack and new timer */
+void lprofP_callhookIN(lprofP_STATE* S, char *func_name, char *file, int linedefined, int currentline);
+
+/* pauses all timers to write a log line and computes the new stack */
+/* returns if there is another function in the stack */
+int lprofP_callhookOUT(lprofP_STATE* S);
+
+/* opens the log file */
+/* returns true if the file could be opened */
+lprofP_STATE* lprofP_init_core_profiler(const char *_out_filename, int isto_printheader, float _function_call_time);
+
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.c b/Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.c
new file mode 100644
index 00000000000..2636ee16028
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.c
@@ -0,0 +1,203 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: function_meter.c,v 1.9 2008/05/19 18:36:23 mascarenhas Exp $
+*/
+
+/*****************************************************************************
+function_meter.c:
+ Module to compute the times for functions (local times and total times)
+
+Design:
+ 'lprofM_init' set up the function times meter service
+ 'lprofM_enter_function' called when the function stack increases one level
+ 'lprofM_leave_function' called when the function stack decreases one level
+
+ 'lprofM_resume_function' called when the profiler is returning from a time
+ consuming task
+ 'lprofM_resume_total_time' idem
+ 'lprofM_resume_local_time' called when a child function returns the execution
+ to it's caller (current function)
+ 'lprofM_pause_function' called when the profiler need to do things that
+ may take too long (writing a log, for example)
+ 'lprofM_pause_total_time' idem
+ 'lprofM_pause_local_time' called when the current function has called
+ another one or when the function terminates
+*****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "clocks.h"
+
+/* #include "stack.h" is done by function_meter.h */
+#include "function_meter.h"
+
+#ifdef DEBUG
+#include <stdlib.h>
+#define ASSERT(e, msg) if (!e) { \
+ fprintf(stdout, \
+ "function_meter.c: assertion failed: %s\n", \
+ msg); \
+ exit(1); }
+#else
+#define ASSERT(e, msg)
+#endif
+
+/* structures to receive stack elements, declared globals */
+/* in the hope they will perform faster */
+static lprofS_STACK_RECORD newf; /* used in 'enter_function' */
+static lprofS_STACK_RECORD leave_ret; /* used in 'leave_function' */
+
+
+
+/* sum the seconds based on the time marker */
+static void compute_local_time(lprofS_STACK_RECORD *e) {
+ ASSERT(e, "local time null");
+ e->local_time += lprofC_get_seconds(e->time_marker_function_local_time);
+}
+
+
+/* sum the seconds based on the time marker */
+static void compute_total_time(lprofS_STACK_RECORD *e) {
+ ASSERT(e, "total time null");
+ e->total_time += lprofC_get_seconds(e->time_marker_function_total_time);
+}
+
+
+/* compute the local time for the current function */
+void lprofM_pause_local_time(lprofP_STATE* S) {
+ compute_local_time(S->stack_top);
+}
+
+
+/* pause the total timer for all the functions that are in the stack */
+void lprofM_pause_total_time(lprofP_STATE* S) {
+ lprofS_STACK aux;
+
+ ASSERT(S->stack_top, "pause_total_time: stack_top null");
+
+ /* auxiliary stack */
+ aux = S->stack_top;
+
+ /* pause */
+ while (aux) {
+ compute_total_time(aux);
+ aux = aux->next;
+ }
+}
+
+
+/* pause the local and total timers for all functions in the stack */
+void lprofM_pause_function(lprofP_STATE* S) {
+
+ ASSERT(S->stack_top, "pause_function: stack_top null");
+
+ lprofM_pause_local_time(S);
+ lprofM_pause_total_time(S);
+}
+
+
+/* resume the local timer for the current function */
+void lprofM_resume_local_time(lprofP_STATE* S) {
+
+ ASSERT(S->stack_top, "resume_local_time: stack_top null");
+
+ /* the function is in the top of the stack */
+ lprofC_start_timer(&(S->stack_top->time_marker_function_local_time));
+}
+
+
+/* resume the total timer for all the functions in the stack */
+void lprofM_resume_total_time(lprofP_STATE* S) {
+ lprofS_STACK aux;
+
+ ASSERT(S->stack_top, "resume_total_time: stack_top null");
+
+ /* auxiliary stack */
+ aux = S->stack_top;
+
+ /* resume */
+ while (aux) {
+ lprofC_start_timer(&(aux->time_marker_function_total_time));
+ aux = aux->next;
+ }
+}
+
+
+/* resume the local and total timers for all functions in the stack */
+void lprofM_resume_function(lprofP_STATE* S) {
+
+ ASSERT(S->stack_top, "resume_function: stack_top null");
+
+ lprofM_resume_local_time(S);
+ lprofM_resume_total_time(S);
+}
+
+
+/* the local time for the parent function is paused */
+/* and the local and total time markers are started */
+void lprofM_enter_function(lprofP_STATE* S, char *file_defined, char *fcn_name, long linedefined, long currentline) {
+ char* prev_name;
+ char* cur_name;
+ /* the flow has changed to another function: */
+ /* pause the parent's function timer timer */
+ if (S->stack_top) {
+ lprofM_pause_local_time(S);
+ prev_name = S->stack_top->function_name;
+ } else prev_name = "top level";
+ /* measure new function */
+ lprofC_start_timer(&(newf.time_marker_function_local_time));
+ lprofC_start_timer(&(newf.time_marker_function_total_time));
+ newf.file_defined = file_defined;
+ if(fcn_name != NULL) {
+ newf.function_name = fcn_name;
+ } else if(strcmp(file_defined, "=[C]") == 0) {
+ cur_name = (char*)malloc(sizeof(char)*(strlen("called from ")+strlen(prev_name)+1));
+ sprintf(cur_name, "called from %s", prev_name);
+ newf.function_name = cur_name;
+ } else {
+ cur_name = (char*)malloc(sizeof(char)*(strlen(file_defined)+12));
+ sprintf(cur_name, "%s:%li", file_defined, linedefined);
+ newf.function_name = cur_name;
+ }
+ newf.line_defined = linedefined;
+ newf.current_line = currentline;
+ newf.local_time = 0.0;
+ newf.total_time = 0.0;
+ lprofS_push(&(S->stack_top), newf);
+}
+
+
+/* computes times and remove the top of the stack */
+/* 'isto_resume' specifies if the parent function's timer */
+/* should be restarted automatically. If it's false, */
+/* 'resume_local_time()' must be called when the resume */
+/* should be done */
+/* returns the funcinfo structure */
+/* warning: use it before another call to this function, */
+/* because the funcinfo will be overwritten */
+lprofS_STACK_RECORD *lprofM_leave_function(lprofP_STATE* S, int isto_resume) {
+
+ ASSERT(S->stack_top, "leave_function: stack_top null");
+
+ leave_ret = lprofS_pop(&(S->stack_top));
+ compute_local_time(&leave_ret);
+ compute_total_time(&leave_ret);
+ /* resume the timer for the parent function ? */
+ if (isto_resume)
+ lprofM_resume_local_time(S);
+ return &leave_ret;
+}
+
+
+/* init stack */
+lprofP_STATE* lprofM_init() {
+ lprofP_STATE *S;
+ S = (lprofP_STATE*)malloc(sizeof(lprofP_STATE));
+ if(S) {
+ S->stack_level = 0;
+ S->stack_top = NULL;
+ return S;
+ } else return NULL;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.h b/Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.h
new file mode 100644
index 00000000000..d2eb5a7ca71
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/function_meter.h
@@ -0,0 +1,64 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: function_meter.h,v 1.5 2007/08/22 19:23:53 carregal Exp $
+*/
+
+/*****************************************************************************
+function_meter.c:
+ Module to compute the times for functions (local times and total times)
+
+Design:
+ 'lprofM_init' set up the function times meter service
+ 'lprofM_enter_function' called when the function stack increases one level
+ 'lprofM_leave_function' called when the function stack decreases one level
+
+ 'lprofM_resume_function' called when the profiler is returning from a time
+ consuming task
+ 'lprofM_resume_total_time' idem
+ 'lprofM_resume_local_time' called when a child function returns the execution
+ to it's caller (current function)
+ 'lprofM_pause_function' called when the profiler need to do things that
+ may take too long (writing a log, for example)
+ 'lprofM_pause_total_time' idem
+ 'lprofM_pause_local_time' called when the current function has called
+ another one or when the function terminates
+*****************************************************************************/
+
+#include "stack.h"
+
+
+/* compute the local time for the current function */
+void lprofM_pause_local_time(lprofP_STATE* S);
+
+/* pause the total timer for all the functions that are in the stack */
+void lprofM_pause_total_time(lprofP_STATE* S);
+
+/* pause the local and total timers for all functions in the stack */
+void lprofM_pause_function(lprofP_STATE* S);
+
+/* resume the local timer for the current function */
+void lprofM_resume_local_time(lprofP_STATE* S);
+
+/* resume the total timer for all the functions in the stack */
+void lprofM_resume_total_time(lprofP_STATE* S);
+
+/* resume the local and total timers for all functions in the stack */
+void lprofM_resume_function(lprofP_STATE* S);
+
+/* the local time for the parent function is paused */
+/* and the local and total time markers are started */
+void lprofM_enter_function(lprofP_STATE* S, char *file_defined, char *fcn_name, long linedefined, long currentline);
+
+/* computes times and remove the top of the stack */
+/* 'isto_resume' specifies if the parent function's timer */
+/* should be restarted automatically. If it's false, */
+/* 'resume_local_time()' must be called when the resume */
+/* should be done */
+/* returns the funcinfo structure */
+/* warning: use it before another call to this function, */
+/* because the funcinfo will be overwritten */
+lprofS_STACK_RECORD *lprofM_leave_function(lprofP_STATE* S, int isto_resume);
+
+/* init stack */
+lprofP_STATE* lprofM_init();
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/lua50_profiler.c b/Build/source/texk/web2c/luatexdir/luaprofiler/lua50_profiler.c
new file mode 100644
index 00000000000..54533425c3b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/lua50_profiler.c
@@ -0,0 +1,230 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: lua50_profiler.c,v 1.13 2008/05/19 18:36:23 mascarenhas Exp $
+*/
+
+/*****************************************************************************
+lua50_profiler.c:
+ Lua version dependent profiler interface
+*****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "clocks.h"
+#include "core_profiler.h"
+#include "function_meter.h"
+
+#include "lua.h"
+#include "lauxlib.h"
+
+/* Indices for the main profiler stack and for the original exit function */
+static int exit_id;
+static int profstate_id;
+
+/* Forward declaration */
+static float calcCallTime(lua_State *L);
+
+/* called by Lua (via the callhook mechanism) */
+static void callhook(lua_State *L, lua_Debug *ar) {
+ int currentline;
+ lua_Debug previous_ar;
+ lprofP_STATE* S;
+ lua_pushlightuserdata(L, &profstate_id);
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ S = (lprofP_STATE*)lua_touserdata(L, -1);
+
+ if (lua_getstack(L, 1, &previous_ar) == 0) {
+ currentline = -1;
+ } else {
+ lua_getinfo(L, "l", &previous_ar);
+ currentline = previous_ar.currentline;
+ }
+
+ lua_getinfo(L, "nS", ar);
+
+ if (!ar->event) {
+ /* entering a function */
+ lprofP_callhookIN(S, (char *)ar->name,
+ (char *)ar->source, ar->linedefined,
+ currentline);
+ }
+ else { /* ar->event == "return" */
+ lprofP_callhookOUT(S);
+ }
+}
+
+
+/* Lua function to exit politely the profiler */
+/* redefines the lua exit() function to not break the log file integrity */
+/* The log file is assumed to be valid if the last entry has a stack level */
+/* of 1 (meaning that the function 'main' has been exited) */
+static void exit_profiler(lua_State *L) {
+ lprofP_STATE* S;
+ lua_pushlightuserdata(L, &profstate_id);
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ S = (lprofP_STATE*)lua_touserdata(L, -1);
+ /* leave all functions under execution */
+ while (lprofP_callhookOUT(S)) ;
+ /* call the original Lua 'exit' function */
+ lua_pushlightuserdata(L, &exit_id);
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ lua_call(L, 0, 0);
+}
+
+/* Our new coroutine.create function */
+/* Creates a new profile state for the coroutine */
+#if 0
+static int coroutine_create(lua_State *L) {
+ lprofP_STATE* S;
+ lua_State *NL = lua_newthread(L);
+ luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1,
+ "Lua function expected");
+ lua_pushvalue(L, 1); /* move function to top */
+ lua_xmove(L, NL, 1); /* move function from L to NL */
+ /* Inits profiler and sets profiler hook for this coroutine */
+ S = lprofM_init();
+ lua_pushlightuserdata(L, NL);
+ lua_pushlightuserdata(L, S);
+ lua_settable(L, LUA_REGISTRYINDEX);
+ lua_sethook(NL, (lua_Hook)callhook, LUA_MASKCALL | LUA_MASKRET, 0);
+ return 1;
+}
+#endif
+
+static int profiler_pause(lua_State *L) {
+ lprofP_STATE* S;
+ lua_pushlightuserdata(L, &profstate_id);
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ S = (lprofP_STATE*)lua_touserdata(L, -1);
+ lprofM_pause_function(S);
+ return 0;
+}
+
+static int profiler_resume(lua_State *L) {
+ lprofP_STATE* S;
+ lua_pushlightuserdata(L, &profstate_id);
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ S = (lprofP_STATE*)lua_touserdata(L, -1);
+ lprofM_pause_function(S);
+ return 0;
+}
+
+static int profiler_init(lua_State *L) {
+ lprofP_STATE* S;
+ const char* outfile;
+ float function_call_time;
+
+ function_call_time = calcCallTime(L);
+
+ outfile = NULL;
+ if(lua_gettop(L) == 1)
+ outfile = luaL_checkstring(L, -1);
+
+ lua_sethook(L, (lua_Hook)callhook, LUA_MASKCALL | LUA_MASKRET, 0);
+ /* init with default file name and printing a header line */
+ if (!(S=lprofP_init_core_profiler(outfile, 1, function_call_time))) {
+ luaL_error(L,"LuaProfiler error: output file could not be opened!");
+ lua_pushnil(L);
+ return 1;
+ }
+
+ lua_pushlightuserdata(L, &profstate_id);
+ lua_pushlightuserdata(L, S);
+ lua_settable(L, LUA_REGISTRYINDEX);
+
+ /* use our own exit function instead */
+ lua_getglobal(L, "os");
+ lua_pushlightuserdata(L, &exit_id);
+ lua_pushstring(L, "exit");
+ lua_gettable(L, -3);
+ lua_settable(L, LUA_REGISTRYINDEX);
+ lua_pushstring(L, "exit");
+ lua_pushcfunction(L, (lua_CFunction)exit_profiler);
+ lua_settable(L, -3);
+
+#if 0
+ /* use our own coroutine.create function instead */
+ lua_getglobal(L, "coroutine");
+ lua_pushstring(L, "create");
+ lua_pushcfunction(L, (lua_CFunction)coroutine_create);
+ lua_settable(L, -3);
+#endif
+
+ /* the following statement is to simulate how the execution stack is */
+ /* supposed to be by the time the profiler is activated when loaded */
+ /* as a library. */
+
+ lprofP_callhookIN(S, "profiler_init", "(C)", -1, -1);
+
+ lua_pushboolean(L, 1);
+ return 1;
+}
+
+static int profiler_stop(lua_State *L) {
+ lprofP_STATE* S;
+ lua_sethook(L, (lua_Hook)callhook, 0, 0);
+ lua_pushlightuserdata(L, &profstate_id);
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ if(!lua_isnil(L, -1)) {
+ S = (lprofP_STATE*)lua_touserdata(L, -1);
+ /* leave all functions under execution */
+ while (lprofP_callhookOUT(S));
+ lprofP_close_core_profiler(S);
+ lua_pushboolean(L, 1);
+ } else { lua_pushboolean(L, 0); }
+ return 1;
+}
+
+/* calculates the approximate time Lua takes to call a function */
+static float calcCallTime(lua_State *L) {
+ clock_t timer;
+ char lua_code[] = " \
+ function lprofT_mesure_function() \
+ local i \
+ \
+ local t = function() \
+ end \
+ \
+ i = 1 \
+ while (i < 100000) do \
+ t() \
+ i = i + 1 \
+ end \
+ end \
+ \
+ lprofT_mesure_function() \
+ lprofT_mesure_function = nil \
+ ";
+
+ lprofC_start_timer(&timer);
+ luaL_dostring(L, lua_code);
+ return lprofC_get_seconds(timer) / (float) 100000;
+}
+
+static const luaL_reg prof_funcs[] = {
+ { "pause", profiler_pause },
+ { "resume", profiler_resume },
+ { "start", profiler_init },
+ { "stop", profiler_stop },
+ { NULL, NULL }
+};
+
+int luaopen_profiler(lua_State *L) {
+ luaL_openlib(L, "profiler", prof_funcs, 0);
+ lua_pushliteral (L, "_COPYRIGHT");
+ lua_pushliteral (L, "Copyright (C) 2003-2007 Kepler Project");
+ lua_settable (L, -3);
+ lua_pushliteral (L, "_DESCRIPTION");
+ lua_pushliteral (L, "LuaProfiler is a time profiler designed to help finding bottlenecks in your Lua program.");
+ lua_settable (L, -3);
+ lua_pushliteral (L, "_NAME");
+ lua_pushliteral (L, "LuaProfiler");
+ lua_settable (L, -3);
+ lua_pushliteral (L, "_VERSION");
+ lua_pushliteral (L, "2.0.1");
+ lua_settable (L, -3);
+ return 1;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/luaprofiler.h b/Build/source/texk/web2c/luatexdir/luaprofiler/luaprofiler.h
new file mode 100644
index 00000000000..155f7996fef
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/luaprofiler.h
@@ -0,0 +1,14 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: luaprofiler.h,v 1.4 2007/08/22 19:23:53 carregal Exp $
+*/
+
+/*****************************************************************************
+luaprofiler.h:
+ Must be included by your main module, in order to profile Lua programs
+*****************************************************************************/
+
+
+void init_profiler(void *);
+
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/stack.c b/Build/source/texk/web2c/luatexdir/luaprofiler/stack.c
new file mode 100644
index 00000000000..07754ad95b1
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/stack.c
@@ -0,0 +1,33 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: stack.c,v 1.4 2007/08/22 19:23:53 carregal Exp $
+*/
+
+/*****************************************************************************
+stack.c:
+ Simple stack manipulation
+*****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "stack.h"
+
+void lprofS_push(lprofS_STACK *p, lprofS_STACK_RECORD r) {
+lprofS_STACK q;
+ q=(lprofS_STACK)malloc(sizeof(lprofS_STACK_RECORD));
+ *q=r;
+ q->next=*p;
+ *p=q;
+}
+
+lprofS_STACK_RECORD lprofS_pop(lprofS_STACK *p) {
+lprofS_STACK_RECORD r;
+lprofS_STACK q;
+
+ r=**p;
+ q=*p;
+ *p=(*p)->next;
+ free(q);
+ return r;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luaprofiler/stack.h b/Build/source/texk/web2c/luatexdir/luaprofiler/stack.h
new file mode 100644
index 00000000000..ac27aaa2907
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luaprofiler/stack.h
@@ -0,0 +1,44 @@
+/*
+** LuaProfiler
+** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
+** $Id: stack.h,v 1.5 2007/08/22 19:23:53 carregal Exp $
+*/
+
+/*****************************************************************************
+stack.h:
+ Simple stack manipulation
+*****************************************************************************/
+
+#ifndef _STACK_H
+#define _STACK_H
+
+#include <time.h>
+
+typedef struct lprofS_sSTACK_RECORD lprofS_STACK_RECORD;
+
+struct lprofS_sSTACK_RECORD {
+ clock_t time_marker_function_local_time;
+ clock_t time_marker_function_total_time;
+ char *file_defined;
+ char *function_name;
+ char *source_code;
+ long line_defined;
+ long current_line;
+ float local_time;
+ float total_time;
+ lprofS_STACK_RECORD *next;
+};
+
+typedef lprofS_STACK_RECORD *lprofS_STACK;
+
+typedef struct lprofP_sSTATE lprofP_STATE;
+
+struct lprofP_sSTATE {
+ int stack_level;
+ lprofS_STACK stack_top;
+};
+
+void lprofS_push(lprofS_STACK *p, lprofS_STACK_RECORD r);
+lprofS_STACK_RECORD lprofS_pop(lprofS_STACK *p);
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/LICENSE b/Build/source/texk/web2c/luatexdir/luasocket/LICENSE
new file mode 100644
index 00000000000..8c3cfe5bcad
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/LICENSE
@@ -0,0 +1,20 @@
+LuaSocket 2.0.2 license
+Copyright © 2004-2007 Diego Nehab
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/NEW b/Build/source/texk/web2c/luatexdir/luasocket/NEW
new file mode 100644
index 00000000000..0191ccd500d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/NEW
@@ -0,0 +1,14 @@
+What's New
+
+This is just a bug-fix/update release.
+
+ * Improved: http.request() now supports deprecated HTTP/0.9
+ servers (Florian Berger)
+ * Fixed: could return "timedout" instead of "timeout" (Leo Leo)
+ * Fixed: crash when reading '*a' on closed socket (Paul Ducklin);
+ * Fixed: return values are consistent when reading from closed sockets;
+ * Fixed: case sensitivity in headers of multipart messages in
+ smtp.message() (Graham Henstridge);
+ * Fixed a couple instances of error() being called instead of base.error(). These would cause an error when an error was reported. :) (Ketmar Dark);
+ * Fixed: test script now uses pairs() iterator instead of the old
+ Lua syntax (Robert Dodier).
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/README b/Build/source/texk/web2c/luatexdir/luasocket/README
new file mode 100644
index 00000000000..5d65f882fce
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/README
@@ -0,0 +1,6 @@
+This is the LuaSocket 2.0.1. It has been tested on WinXP, Mac OS X,
+and Linux. Please use the Lua mailing list to report any bugs
+(or "features") you encounter.
+
+Have fun,
+Diego Nehab.
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/config b/Build/source/texk/web2c/luatexdir/luasocket/config
new file mode 100644
index 00000000000..49958ebcbbe
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/config
@@ -0,0 +1,60 @@
+#------
+# LuaSocket makefile configuration
+#
+
+#------
+# Output file names
+#
+EXT=so
+SOCKET_V=2.0.2
+MIME_V=1.0.2
+SOCKET_SO=socket.$(EXT).$(SOCKET_V)
+MIME_SO=mime.$(EXT).$(MIME_V)
+UNIX_SO=unix.$(EXT)
+
+#------
+# Lua includes and libraries
+#
+#LUAINC=-I/usr/local/include/lua50
+#LUAINC=-I/usr/local/include/lua5.1
+#LUAINC=-Ilua-5.1.1/src
+
+#------
+# Compat-5.1 directory
+#
+#COMPAT=compat-5.1r5
+
+#------
+# Top of your Lua installation
+# Relative paths will be inside the src tree
+#
+#INSTALL_TOP_SHARE=/usr/local/share/lua/5.0
+#INSTALL_TOP_LIB=/usr/local/lib/lua/5.0
+INSTALL_TOP_SHARE=/usr/local/share/lua/5.1
+INSTALL_TOP_LIB=/usr/local/lib/lua/5.1
+
+INSTALL_DATA=cp
+INSTALL_EXEC=cp
+
+#------
+# Compiler and linker settings
+# for Mac OS X
+#
+#CC=gcc
+#DEF= -DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN
+#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fno-common
+#LDFLAGS=-bundle -undefined dynamic_lookup
+#LD=export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc
+
+#------
+# Compiler and linker settings
+# for Linux
+CC=gcc
+DEF=-DLUASOCKET_DEBUG
+CFLAGS= $(LUAINC) $(DEF) -pedantic -Wall -O2 -fpic
+LDFLAGS=-O -shared -fpic
+LD=gcc
+
+#------
+# End of makefile configuration
+#
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html
new file mode 100644
index 00000000000..f4c3b07d2b7
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/dns.html
@@ -0,0 +1,132 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: DNS support">
+<meta name="keywords" content="Lua, LuaSocket, DNS, Network, Library, Support">
+<title>LuaSocket: DNS support</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- dns ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=dns>DNS</h2>
+
+<p>
+Name resolution functions return <em>all</em> information obtained from the
+resolver in a table of the form:
+</p>
+
+<blockquote><tt>
+resolved = {<br>
+&nbsp;&nbsp;name = <i>canonic-name</i>,<br>
+&nbsp;&nbsp;alias = <i>alias-list</i>,<br>
+&nbsp;&nbsp;ip = <i>ip-address-list</i><br>
+}
+</tt> </blockquote>
+
+<p>
+Note that the <tt>alias</tt> list can be empty.
+</p>
+
+<!-- gethostname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=gethostname>
+socket.dns.<b>gethostname()</b>
+</p>
+
+<p class=description>
+Returns the standard host name for the machine as a string.
+</p>
+
+<!-- tohostname +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=tohostname>
+socket.dns.<b>tohostname(</b>address<b>)</b>
+</p>
+
+<p class=description>
+Converts from IP address to host name.
+</p>
+
+<p class=parameters>
+<tt>Address</tt> can be an IP address or host name.
+</p>
+
+<p class=return>
+The function returns a string with the canonic host name of the given
+<tt>address</tt>, followed by a table with all information returned by
+the resolver. In case of error, the function returns <b><tt>nil</tt></b>
+followed by an error message.
+</p>
+
+<!-- toip +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=toip>
+socket.dns.<b>toip(</b>address<b>)</b>
+</p>
+
+<p class=description>
+Converts from host name to IP address.
+</p>
+
+<p class=parameters>
+<tt>Address</tt> can be an IP address or host name.
+</p>
+
+<p class=return>
+Returns a string with the first IP address found for <tt>address</tt>,
+followed by a table with all information returned by the resolver.
+In case of error, the function returns <b><tt>nil</tt></b> followed by an error
+message.
+</p>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:07 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html
new file mode 100644
index 00000000000..9884f31339d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ftp.html
@@ -0,0 +1,289 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: FTP support">
+<meta name="keywords" content="Lua, LuaSocket, FTP, Network, Library, Support">
+<title>LuaSocket: FTP support</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- ftp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=ftp>FTP</h2>
+
+<p>
+FTP (File Transfer Protocol) is a protocol used to transfer files
+between hosts. The <tt>ftp</tt> namespace offers thorough support
+to FTP, under a simple interface. The implementation conforms to
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc0959.txt">RFC 959</a>.
+</p>
+
+<p>
+High level functions are provided supporting the most common operations.
+These high level functions are implemented on top of a lower level
+interface. Using the low-level interface, users can easily create their
+own functions to access <em>any</em> operation supported by the FTP
+protocol. For that, check the implementation.
+</p>
+
+<p>
+To really benefit from this module, a good understanding of
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">
+LTN012, Filters sources and sinks</a> is necessary.
+</p>
+
+<p>
+To obtain the <tt>ftp</tt> namespace, run:
+</p>
+
+<pre class=example>
+-- loads the FTP module and any libraries it requires
+local ftp = require("socket.ftp")
+</pre>
+
+<p>
+URLs MUST conform to
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc1738.txt">RFC
+1738</a>, that is, an URL is a string in the form:
+</p>
+
+<blockquote>
+<tt>
+[ftp://][&lt;user&gt;[:&lt;password&gt;]@]&lt;host&gt;[:&lt;port&gt;][/&lt;path&gt;][<i>type</i>=a|i]</tt>
+</blockquote>
+
+<p>
+The following constants in the namespace can be set to control the default behavior of
+the FTP module:
+</p>
+
+<ul>
+<li> <tt>PASSWORD</tt>: default anonymous password.
+<li> <tt>PORT</tt>: default port used for the control connection;
+<li> <tt>TIMEOUT</tt>: sets the timeout for all I/O operations;
+<li> <tt>USER</tt>: default anonymous user;
+</ul>
+
+
+<!-- ftp.get ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=get>
+ftp.<b>get(</b>url<b>)</b><br>
+ftp.<b>get{</b><br>
+&nbsp;&nbsp;host = <i>string</i>,<br>
+&nbsp;&nbsp;sink = <i>LTN12 sink</i>,<br>
+&nbsp;&nbsp;argument <i>or</i> path = <i>string</i>,<br>
+&nbsp;&nbsp;[user = <i>string</i>,]<br>
+&nbsp;&nbsp;[password = <i>string</i>]<br>
+&nbsp;&nbsp;[command = <i>string</i>,]<br>
+&nbsp;&nbsp;[port = <i>number</i>,]<br>
+&nbsp;&nbsp;[type = <i>string</i>,]<br>
+&nbsp;&nbsp;[step = <i>LTN12 pump step</i>,]<br>
+&nbsp;&nbsp;[create = <i>function</i>]<br>
+<b>}</b>
+</p>
+
+<p class=description>
+The <tt>get</tt> function has two forms. The simple form has fixed
+functionality: it downloads the contents of a URL and returns it as a
+string. The generic form allows a <em>lot</em> more control, as explained
+below.
+</p>
+
+<p class=parameters>
+If the argument of the <tt>get</tt> function is a table, the function
+expects at least the fields <tt>host</tt>, <tt>sink</tt>, and one of
+<tt>argument</tt> or <tt>path</tt> (<tt>argument</tt> takes
+precedence). <tt>Host</tt> is the server to connect to. <tt>Sink</tt> is
+the <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+sink that will receive the downloaded data. <tt>Argument</tt> or
+<tt>path</tt> give the target path to the resource in the server. The
+optional arguments are the following:
+</p>
+<ul>
+<li><tt>user</tt>, <tt>password</tt>: User name and password used for
+authentication. Defaults to "<tt>ftp:anonymous@anonymous.org</tt>";
+<li><tt>command</tt>: The FTP command used to obtain data. Defaults to
+"<tt>retr</tt>", but see example below;
+<li><tt>port</tt>: The port to used for the control connection. Defaults to 21;
+<li><tt>type</tt>: The transfer mode. Can take values "<tt>i</tt>" or
+"<tt>a</tt>". Defaults to whatever is the server default;
+<li><tt>step</tt>:
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+pump step function used to pass data from the
+server to the sink. Defaults to the LTN12 <tt>pump.step</tt> function;
+<li><tt>create</tt>: An optional function to be used instead of
+<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
+</ul>
+
+<p class=return>
+If successful, the simple version returns the URL contents as a
+string, and the generic function returns 1. In case of error, both
+functions return <b><tt>nil</tt></b> and an error message describing the
+error.
+</p>
+
+<pre class=example>
+-- load the ftp support
+local ftp = require("socket.ftp")
+
+-- Log as user "anonymous" on server "ftp.tecgraf.puc-rio.br",
+-- and get file "lua.tar.gz" from directory "pub/lua" as binary.
+f, e = ftp.get("ftp://ftp.tecgraf.puc-rio.br/pub/lua/lua.tar.gz;type=i")
+</pre>
+
+<pre class=example>
+-- load needed modules
+local ftp = require("socket.ftp")
+local ltn12 = require("ltn12")
+local url = require("socket.url")
+
+-- a function that returns a directory listing
+function nlst(u)
+ local t = {}
+ local p = url.parse(u)
+ p.command = "nlst"
+ p.sink = ltn12.sink.table(t)
+ local r, e = ftp.get(p)
+ return r and table.concat(t), e
+end
+</pre>
+
+<!-- put ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=put>
+ftp.<b>put(</b>url, content<b>)</b><br>
+ftp.<b>put{</b><br>
+&nbsp;&nbsp;host = <i>string</i>,<br>
+&nbsp;&nbsp;source = <i>LTN12 sink</i>,<br>
+&nbsp;&nbsp;argument <i>or</i> path = <i>string</i>,<br>
+&nbsp;&nbsp;[user = <i>string</i>,]<br>
+&nbsp;&nbsp;[password = <i>string</i>]<br>
+&nbsp;&nbsp;[command = <i>string</i>,]<br>
+&nbsp;&nbsp;[port = <i>number</i>,]<br>
+&nbsp;&nbsp;[type = <i>string</i>,]<br>
+&nbsp;&nbsp;[step = <i>LTN12 pump step</i>,]<br>
+&nbsp;&nbsp;[create = <i>function</i>]<br>
+<b>}</b>
+</p>
+
+<p class=description>
+The <tt>put</tt> function has two forms. The simple form has fixed
+functionality: it uploads a string of content into a URL. The generic form
+allows a <em>lot</em> more control, as explained below.
+</p>
+
+<p class=parameters>
+If the argument of the <tt>put</tt> function is a table, the function
+expects at least the fields <tt>host</tt>, <tt>source</tt>, and one of
+<tt>argument</tt> or <tt>path</tt> (<tt>argument</tt> takes
+precedence). <tt>Host</tt> is the server to connect to. <tt>Source</tt> is
+the <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+source that will provide the contents to be uploaded.
+<tt>Argument</tt> or
+<tt>path</tt> give the target path to the resource in the server. The
+optional arguments are the following:
+</p>
+<ul>
+<li><tt>user</tt>, <tt>password</tt>: User name and password used for
+authentication. Defaults to "<tt>ftp:anonymous@anonymous.org</tt>";
+<li><tt>command</tt>: The FTP command used to send data. Defaults to
+"<tt>stor</tt>", but see example below;
+<li><tt>port</tt>: The port to used for the control connection. Defaults to 21;
+<li><tt>type</tt>: The transfer mode. Can take values "<tt>i</tt>" or
+"<tt>a</tt>". Defaults to whatever is the server default;
+<li><tt>step</tt>:
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+pump step function used to pass data from the
+server to the sink. Defaults to the LTN12 <tt>pump.step</tt> function;
+<li><tt>create</tt>: An optional function to be used instead of
+<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
+</ul>
+
+<p class=return>
+Both functions return 1 if successful, or <b><tt>nil</tt></b> and an error
+message describing the reason for failure.
+</p>
+
+<pre class=example>
+-- load the ftp support
+local ftp = require("socket.ftp")
+
+-- Log as user "fulano" on server "ftp.example.com",
+-- using password "silva", and store a file "README" with contents
+-- "wrong password, of course"
+f, e = ftp.put("ftp://fulano:silva@ftp.example.com/README",
+ "wrong password, of course")
+</pre>
+
+<pre class=example>
+-- load the ftp support
+local ftp = require("socket.ftp")
+local ltn12 = require("ltn12")
+
+-- Log as user "fulano" on server "ftp.example.com",
+-- using password "silva", and append to the remote file "LOG", sending the
+-- contents of the local file "LOCAL-LOG"
+f, e = ftp.put{
+ host = "ftp.example.com",
+ user = "fulano",
+ password = "silva",
+ command = "appe",
+ argument = "LOG",
+ source = ltn12.source.file(io.open("LOCAL-LOG", "r"))
+}
+</pre>
+
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:18 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html
new file mode 100644
index 00000000000..0acac13feec
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/http.html
@@ -0,0 +1,333 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: HTTP support">
+<meta name="keywords" content="Lua, HTTP, Library, WWW, Browser, Network, Support">
+<title>LuaSocket: HTTP support</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- http +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=http>HTTP</h2>
+
+<p>
+HTTP (Hyper Text Transfer Protocol) is the protocol used to exchange
+information between web-browsers and servers. The <tt>http</tt>
+namespace offers full support for the client side of the HTTP
+protocol (i.e.,
+the facilities that would be used by a web-browser implementation). The
+implementation conforms to the HTTP/1.1 standard,
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2616.txt">RFC
+2616</a>.
+</p>
+
+<p>
+The module exports functions that provide HTTP functionality in different
+levels of abstraction. From the simple
+string oriented requests, through generic
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> based, down to even lower-level if you bother to look through the source code.
+</p>
+
+<p>
+To obtain the <tt>http</tt> namespace, run:
+</p>
+
+<pre class=example>
+-- loads the HTTP module and any libraries it requires
+local http = require("socket.http")
+</pre>
+
+<p>
+URLs must conform to
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc1738.txt">RFC
+1738</a>,
+that is, an URL is a string in the form:
+</p>
+
+<blockquote>
+<pre>
+[http://][&lt;user&gt;[:&lt;password&gt;]@]&lt;host&gt;[:&lt;port&gt;][/&lt;path&gt;]
+</pre>
+</blockquote>
+
+<p>
+MIME headers are represented as a Lua table in the form:
+</p>
+
+<blockquote>
+<table summary="MIME headers in Lua table">
+<tr><td><tt>
+headers = {<br>
+&nbsp;&nbsp;field-1-name = <i>field-1-value</i>,<br>
+&nbsp;&nbsp;field-2-name = <i>field-2-value</i>,<br>
+&nbsp;&nbsp;field-3-name = <i>field-3-value</i>,<br>
+&nbsp;&nbsp;...<br>
+&nbsp;&nbsp;field-n-name = <i>field-n-value</i><br>
+}
+</tt></td></tr>
+</table>
+</blockquote>
+
+<p>
+Field names are case insensitive (as specified by the standard) and all
+functions work with lowercase field names.
+Field values are left unmodified.
+</p>
+
+<p class=note>
+Note: MIME headers are independent of order. Therefore, there is no problem
+in representing them in a Lua table.
+</p>
+
+<p>
+The following constants can be set to control the default behavior of
+the HTTP module:
+</p>
+
+<ul>
+<li> <tt>PORT</tt>: default port used for connections;
+<li> <tt>PROXY</tt>: default proxy used for connections;
+<li> <tt>TIMEOUT</tt>: sets the timeout for all I/O operations;
+<li> <tt>USERAGENT</tt>: default user agent reported to server.
+</ul>
+
+<!-- http.request ++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=request>
+http.<b>request(</b>url [, body]<b>)</b><br>
+http.<b>request{</b><br>
+&nbsp;&nbsp;url = <i>string</i>,<br>
+&nbsp;&nbsp;[sink = <i>LTN12 sink</i>,]<br>
+&nbsp;&nbsp;[method = <i>string</i>,]<br>
+&nbsp;&nbsp;[headers = <i>header-table</i>,]<br>
+&nbsp;&nbsp;[source = <i>LTN12 source</i>],<br>
+&nbsp;&nbsp;[step = <i>LTN12 pump step</i>,]<br>
+&nbsp;&nbsp;[proxy = <i>string</i>,]<br>
+&nbsp;&nbsp;[redirect = <i>boolean</i>,]<br>
+&nbsp;&nbsp;[create = <i>function</i>]<br>
+<b>}</b>
+</p>
+
+<p class=description>
+The request function has two forms. The simple form downloads
+a URL using the <tt>GET</tt> or <tt>POST</tt> method and is based
+on strings. The generic form performs any HTTP method and is
+<a href=http://lua-users.org/wiki/FiltersSourcesAndSinks>LTN12</a> based.
+</p>
+
+<p class=parameters>
+If the first argument of the <tt>request</tt> function is a string, it
+should be an <tt>url</tt>. In that case, if a <tt>body</tt>
+is provided as a string, the function will perform a <tt>POST</tt> method
+in the <tt>url</tt>. Otherwise, it performs a <tt>GET</tt> in the
+<tt>url</tt>
+</p>
+
+<p class=parameters>
+If the first argument is instead a table, the most important fields are
+the <tt>url</tt> and the <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+<tt>sink</tt> that will receive the downloaded content.
+Any part of the <tt>url</tt> can be overridden by including
+the appropriate field in the request table.
+If authentication information is provided, the function
+uses the Basic Authentication Scheme (see <a href="#authentication">note</a>)
+to retrieve the document. If <tt>sink</tt> is <tt><b>nil</b></tt>, the
+function discards the downloaded data. The optional parameters are the
+following:
+</p>
+<ul>
+<li><tt>method</tt>: The HTTP request method. Defaults to "GET";
+<li><tt>headers</tt>: Any additional HTTP headers to send with the request;
+<li><tt>source</tt>: <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+source to provide the request body. If there
+is a body, you need to provide an appropriate "<tt>content-length</tt>"
+request header field, or the function will attempt to send the body as
+"<tt>chunked</tt>" (something few servers support). Defaults to the empty source;
+<li><tt>step</tt>:
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+pump step function used to move data.
+Defaults to the LTN12 <tt>pump.step</tt> function.
+<li><tt>proxy</tt>: The URL of a proxy server to use. Defaults to no proxy;
+<li><tt>redirect</tt>: Set to <tt><b>false</b></tt> to prevent the
+function from automatically following 301 or 302 server redirect messages;
+<li><tt>create</tt>: An optional function to be used instead of
+<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
+</ul>
+
+<p class=return>
+In case of failure, the function returns <tt><b>nil</b></tt> followed by an
+error message. If successful, the simple form returns the response
+body as a string, followed by the response status code, the response
+headers and the response status line. The generic function returns the same
+information, except the first return value is just the number 1 (the body
+goes to the <tt>sink</tt>).
+</p>
+
+<p class=return>
+Even when the server fails to provide the contents of the requested URL (URL not found, for example),
+it usually returns a message body (a web page informing the
+URL was not found or some other useless page). To make sure the
+operation was successful, check the returned status <tt>code</tt>. For
+a list of the possible values and their meanings, refer to <a
+href="http://www.cs.princeton.edu/~diego/rfc/rfc2616.txt">RFC
+2616</a>.
+</p>
+
+<p class=description>
+Here are a few examples with the simple interface:
+</p>
+
+<pre class=example>
+-- load the http module
+local io = require("io")
+local http = require("socket.http")
+local ltn12 = require("ltn12")
+
+-- connect to server "www.cs.princeton.edu" and retrieves this manual
+-- file from "~diego/professional/luasocket/http.html" and print it to stdout
+http.request{
+ url = "http://www.cs.princeton.edu/~diego/professional/luasocket/http.html",
+ sink = ltn12.sink.file(io.stdout)
+}
+
+-- connect to server "www.example.com" and tries to retrieve
+-- "/private/index.html". Fails because authentication is needed.
+b, c, h = http.request("http://www.example.com/private/index.html")
+-- b returns some useless page telling about the denied access,
+-- h returns authentication information
+-- and c returns with value 401 (Authentication Required)
+
+-- tries to connect to server "wrong.host" to retrieve "/"
+-- and fails because the host does not exist.
+r, e = http.request("http://wrong.host/")
+-- r is nil, and e returns with value "host not found"
+</pre>
+
+<p class=description>
+And here is an example using the generic interface:
+</p>
+
+<pre class=example>
+-- load the http module
+http = require("socket.http")
+
+-- Requests information about a document, without downloading it.
+-- Useful, for example, if you want to display a download gauge and need
+-- to know the size of the document in advance
+r, c, h = http.request {
+ method = "HEAD",
+ url = "http://www.tecgraf.puc-rio.br/~diego"
+}
+-- r is 1, c is 200, and h would return the following headers:
+-- h = {
+-- date = "Tue, 18 Sep 2001 20:42:21 GMT",
+-- server = "Apache/1.3.12 (Unix) (Red Hat/Linux)",
+-- ["last-modified"] = "Wed, 05 Sep 2001 06:11:20 GMT",
+-- ["content-length"] = 15652,
+-- ["connection"] = "close",
+-- ["content-Type"] = "text/html"
+-- }
+</pre>
+
+<p class=note id=post>
+Note: When sending a POST request, simple interface adds a
+"<tt>Content-type: application/x-www-form-urlencoded</tt>"
+header to the request. This is the type used by
+HTML forms. If you need another type, use the generic
+interface.
+</p>
+
+<p class=note id=authentication>
+Note: Some URLs are protected by their
+servers from anonymous download. For those URLs, the server must receive
+some sort of authentication along with the request or it will deny
+download and return status "401&nbsp;Authentication Required".
+</p>
+
+<p class=note>
+The HTTP/1.1 standard defines two authentication methods: the Basic
+Authentication Scheme and the Digest Authentication Scheme, both
+explained in detail in
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2068.txt">RFC 2068</a>.
+</p>
+
+<p class=note>The Basic Authentication Scheme sends
+<tt>&lt;user&gt;</tt> and
+<tt>&lt;password&gt;</tt> unencrypted to the server and is therefore
+considered unsafe. Unfortunately, by the time of this implementation,
+the wide majority of servers and browsers support the Basic Scheme only.
+Therefore, this is the method used by the toolkit whenever
+authentication is required.
+</p>
+
+<pre class=example>
+-- load required modules
+http = require("socket.http")
+mime = require("mime")
+
+-- Connect to server "www.example.com" and tries to retrieve
+-- "/private/index.html", using the provided name and password to
+-- authenticate the request
+b, c, h = http.request("http://fulano:silva@www.example.com/private/index.html")
+
+-- Alternatively, one could fill the appropriate header and authenticate
+-- the request directly.
+r, c = http.request {
+ url = "http://www.example.com/private/index.html",
+ headers = { authentication = "Basic " .. (mime.b64("fulano:silva")) }
+}
+</pre>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:26 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html
new file mode 100644
index 00000000000..57a790714ac
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/index.html
@@ -0,0 +1,208 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="The LuaSocket Homepage">
+<meta name="keywords" content="Lua, LuaSocket, Network, Library, Support, Internet">
+<title>LuaSocket: Network support for the Lua language </title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- whatis +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=whatis>What is LuaSocket?</h2>
+
+<p>
+LuaSocket is a <a href="http://www.lua.org">Lua</a> extension library
+that is composed by two parts: a C core that provides support for the TCP
+and UDP transport layers, and a set of Lua modules that add support for
+functionality commonly needed by applications that deal with the Internet.
+</p>
+
+<p>
+The core support has been implemented so that it is both efficient and
+simple to use. It is available to any Lua application once it has been
+properly initialized by the interpreter in use. The code has been tested
+and runs well on several Windows and Unix platforms. </p>
+
+<p>
+Among the support modules, the most commonly used implement the
+<a href=smtp.html>SMTP</a>
+(sending e-mails),
+<a href=http.html>HTTP</a>
+(WWW access) and
+<a href=ftp.html>FTP</a>
+(uploading and downloading files) client
+protocols. These provide a very natural and generic interface to the
+functionality defined by each protocol.
+In addition, you will find that the
+<a href=mime.html>MIME</a> (common encodings),
+<a href=url.html>URL</a>
+(anything you could possible want to do with one) and
+<a href=ltn12.html>LTN12</a>
+(filters, sinks, sources and pumps) modules can be very handy.
+</p>
+
+<p>
+The library is available under the same
+<a href="http://www.lua.org/copyright.html">
+terms and conditions</a> as the Lua language, the MIT license. The idea is
+that if you can use Lua in a project, you should also be able to use
+LuaSocket.
+</p>
+
+<p>
+Copyright &copy; 2004-2007 Diego Nehab. All rights reserved. <br>
+Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
+</p>
+
+<!-- download +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=download>Download</h2>
+
+<p>
+LuaSocket version 2.0.2 is now available for download! It is
+compatible with Lua&nbsp;5.1, and has
+been tested on Windows&nbsp;XP, Linux, and Mac OS X. Chances
+are it works well on most UNIX distributions and Windows flavors.
+</p>
+
+<p>
+The library can be downloaded in source code from the
+<a href=http://luaforge.net/projects/luasocket/>LuaSocket
+project page</a> at LuaForge.
+Besides the full C and Lua source code for the library, the distribution
+contains several examples, this user's manual and basic test procedures.
+</p>
+
+<p>
+Danilo Tuler is maintaining Win32 binaries for LuaSocket, which are also
+available from LuaForge. These are compatible with the
+<a href=http://luaforge.net/projects/luabinaries>LuaBinaries</a>,
+also available from LuaForge.
+</p>
+
+<p> Take a look at the <a
+href=installation.html>installation</a> section of the
+manual to find out how to properly install the library.
+</p>
+
+<!-- thanks +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=thanks>Special thanks</h2>
+
+<p>
+Throughout LuaSocket's history, many people gave suggestions that helped
+improve it. For that, I thank the Lua community.
+Special thanks go to
+David Burgess, who has helped push the library to a new level of quality and
+from whom I have learned a lot of stuff that doesn't show up in RFCs.
+Special thanks also to Carlos Cassino, who played a big part in the
+extensible design seen in the C core of LuaSocket 2.0. Mike Pall
+has been helping a lot too! Thanks to you all!
+</p>
+
+<!-- whatsnew +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=new>What's New</h2>
+
+<p>
+2.0.2 is just a bug-fix/update release.
+</p>
+
+<ul>
+<li> Improved: http.request() now supports deprecated
+HTTP/0.9 servers (Florian Berger);
+<li> Fixed: could return "timedout" instead of "timeout" (Leo Leo);
+<li> Fixed: crash when reading '*a' on closed socket (Paul Ducklin);
+<li> Fixed: return values are consistent when reading from closed sockets;
+<li> Fixed: case sensitivity in headers of multipart
+messages in smtp.message() (Graham Henstridge);
+<li> Fixed a couple instances of error() being called instead of
+base.error(). These would cause an error when an error was
+reported :) (Ketmar Dark);
+<li> Fixed: test script now uses pairs() iterator instead
+of the old Lua syntax (Robert Dodier).
+</ul>
+
+<p>
+2.0.1 is just a bug-fix/update release.
+</p>
+
+<ul>
+<li> Updated: now using <tt>compat-5.1r5</tt>;
+<li> Improved: <tt>http.request</tt> is more robust to
+malformed URLs (Adrian Sietsma);
+<li> Improved: the simple <tt>http.request</tt> interface sends a
+"<tt>Content-type: application/x-www-form-urlencoded</tt>"
+header (William Trenker);
+<li> Improved: <tt>http.request</tt> is robust to evil
+servers that send inappropriate 100-continue messages
+(David Burgess);
+<li> Fixed: <tt>http.request</tt> was using the old host header during
+redirects (Florian Berger);
+<li> Fixed: sample <tt>unix.c</tt> had fallen through the
+cracks during development (Matthew Percival);
+<li> Fixed: error code was not being propagated correctly in
+ftp.lua (David Burgess).
+</ul>
+
+<!-- old ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=old>Old Versions</h2>
+
+<p>
+All previous versions of the LuaSocket library can be downloaded <a
+href="http://www.cs.princeton.edu/~diego/professional/luasocket/old">
+here</a>. Although these versions are no longer supported, they are
+still available for those that have compatibility issues.
+</p>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Wed Oct 3 02:07:59 BRT 2007
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html
new file mode 100644
index 00000000000..0288f4af31a
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/installation.html
@@ -0,0 +1,163 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: Introduction to the core">
+<meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network, Support,
+Installation">
+<title>LuaSocket: Installation</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- installation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2>Installation</h2>
+
+<p> LuaSocket 2.0.2 uses the new package system for Lua 5.1.
+All Lua library developers are encouraged to update their libraries so that
+all libraries can coexist peacefully and users can benefit from the
+standardization and flexibility of the standard.
+</p>
+
+<p>
+Those stuck with Lua 5.0 will need the
+<a href=http://www.keplerproject.org/compat/>compat-5.1</a>
+module. It is maintained by
+<a href=http://www.keplerproject.org/>The Kepler
+Project</a>'s team, and implements the Lua 5.1 package proposal
+on top of Lua 5.0. </p>
+
+<p> Here we will only describe the standard distribution.
+If the standard doesn't meet your needs, we refer you to the
+Lua discussion list, where any question about the package
+scheme will likely already have been answered. </p>
+
+<h3>Directory structure</h3>
+
+<p> On Unix systems, the standard distribution uses two base
+directories, one for system dependent files, and another for system
+independent files. Let's call these directories <tt>&lt;CDIR&gt;</tt>
+and <tt>&lt;LDIR&gt;</tt>, respectively.
+For instance, in my laptop, I use '<tt>/usr/local/lib/lua/5.0</tt>' for
+<tt>&lt;CDIR&gt;</tt> and '<tt>/usr/local/share/lua/5.0</tt>' for
+<tt>&lt;LDIR&gt;</tt>. On Windows, sometimes only one directory is used, say
+'<tt>c:\program files\lua\5.0</tt>'. Here is the standard LuaSocket
+distribution directory structure:</p>
+
+<pre class=example>
+&lt;LDIR&gt;/compat-5.1.lua
+&lt;LDIR&gt;/ltn12.lua
+&lt;LDIR&gt;/socket.lua
+&lt;CDIR&gt;/socket/core.dll
+&lt;LDIR&gt;/socket/http.lua
+&lt;LDIR&gt;/socket/tp.lua
+&lt;LDIR&gt;/socket/ftp.lua
+&lt;LDIR&gt;/socket/smtp.lua
+&lt;LDIR&gt;/socket/url.lua
+&lt;LDIR&gt;/mime.lua
+&lt;CDIR&gt;/mime/core.dll
+</pre>
+
+<p> Naturally, on Unix systems, <tt>core.dll</tt>
+would be replaced by <tt>core.so</tt>.
+</p>
+
+<p> In order for the interpreter to find all LuaSocket components, three
+environment variables need to be set. The first environment variable tells
+the interpreter to load the <tt>compat-5.1.lua</tt> module at startup: </p>
+
+<pre class=example>
+LUA_INIT=@&lt;LDIR&gt;/compat-5.1.lua
+</pre>
+
+<p>
+This is only need for Lua&nbsp;5.0! Lua&nbsp;5.1 comes with
+the package system built in, of course.
+</p>
+
+<p>
+The other two environment variables instruct the compatibility module to
+look for dynamic libraries and extension modules in the appropriate
+directories and with the appropriate filename extensions.
+</p>
+
+<pre class=example>
+LUA_PATH=&lt;LDIR&gt;/?.lua;?.lua
+LUA_CPATH=&lt;CDIR&gt;/?.dll;?.dll
+</pre>
+
+<p> Again, naturally, on Unix systems the shared library extension would be
+<tt>.so</tt> instead of <tt>.dll</tt>.</p>
+
+<h3>Using LuaSocket</h3>
+
+<p> With the above setup, and an interpreter with shared library support,
+it should be easy to use LuaSocket. Just fire the interpreter and use the
+<tt>require</tt> function to gain access to whatever module you need:</p>
+
+<pre class=example>
+Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
+&gt; socket = require("socket")
+&gt; print(socket._VERSION)
+--&gt; LuaSocket 2.0.2
+</pre>
+
+<p> Each module loads their dependencies automatically, so you only need to
+load the modules you directly depend upon: </p>
+
+<pre class=example>
+Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
+&gt; http = require("socket.http")
+&gt; print(http.request("http://www.cs.princeton.edu/~diego/professional/luasocket"))
+--&gt; homepage gets dumped to terminal
+</pre>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:30 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html
new file mode 100644
index 00000000000..eff63676750
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/introduction.html
@@ -0,0 +1,333 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: Introduction to the core">
+<meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network,
+Library, Support">
+<title>LuaSocket: Introduction to the core</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- introduction +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2>Introduction</h2>
+
+<p>
+LuaSocket is a <a href="http://www.lua.org">Lua</a> extension library
+that is composed by two parts: a C core that provides support for the TCP
+and UDP transport layers, and a set of Lua modules that add support for
+the SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and
+downloading files) protocols and other functionality commonly needed by
+applications that deal with the Internet. This introduction is about the C
+core.
+</p>
+
+<p>
+Communication in LuaSocket is performed via I/O objects. These can
+represent different network domains. Currently, support is provided for TCP
+and UDP, but nothing prevents other developers from implementing SSL, Local
+Domain, Pipes, File Descriptors etc. I/O objects provide a standard
+interface to I/O across different domains and operating systems.
+</p>
+
+<p>
+The API design had two goals in mind. First, users
+experienced with the C API to sockets should feel comfortable using LuaSocket.
+Second, the simplicity and the feel of the Lua language should be
+preserved. To achieve these goals, the LuaSocket API keeps the function names and semantics the C API whenever possible, but their usage in Lua has been greatly simplified.
+</p>
+
+
+<p>
+One of the simplifications is the receive pattern capability.
+Applications can read data from stream domains (such as TCP)
+line by line, block by block, or until the connection is closed.
+All I/O reads are buffered and the performance differences between
+different receive patterns are negligible.
+</p>
+
+<p>
+Another advantage is the flexible timeout control
+mechanism. As in C, all I/O operations are blocking by default. For
+example, the <a href=tcp.html#send><tt>send</tt></a>,
+<a href=tcp.html#receive><tt>receive</tt></a> and
+<a href=tcp.html#accept><tt>accept</tt></a> methods
+of the TCP domain will block the caller application until
+the operation is completed (if ever!). However, with a call to the
+<a href=tcp.html#settimeout><tt>settimeout</tt></a>
+method, an application can specify upper limits on
+the time it can be blocked by LuaSocket (the "<tt>total</tt>" timeout), on
+the time LuaSocket can internally be blocked by any OS call (the
+"<tt>block</tt>" timeout) or a combination of the two. Each LuaSocket
+call might perform several OS calls, so that the two timeout values are
+<em>not</em> equivalent.
+</p>
+
+<p>
+Finally, the host name resolution is transparent, meaning that most
+functions and methods accept both IP addresses and host names. In case a
+host name is given, the library queries the system's resolver and
+tries the main IP address returned. Note that direct use of IP addresses
+is more efficient, of course. The
+<a href=dns.html#toip><tt>toip</tt></a>
+and <a href=dns.html#tohostname><tt>tohostname</tt></a>
+functions from the DNS module are provided to convert between host names and IP addresses.
+</p>
+
+<p>
+Together, these changes make network programming in LuaSocket much simpler
+than it is in C, as the following sections will show.
+</p>
+
+<!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id=tcp>TCP</h3>
+
+<p>
+TCP (Transfer Control Protocol) is reliable stream protocol. In other
+words, applications communicating through TCP can send and receive data as
+an error free stream of bytes. Data is split in one end and
+reassembled transparently on the other end. There are no boundaries in
+the data transfers. The library allows users to read data from the
+sockets in several different granularities: patterns are available for
+lines, arbitrary sized blocks or "read up to connection closed", all with
+good performance.
+</p>
+
+<p>
+The library distinguishes three types of TCP sockets: <em>master</em>,
+<em>client</em> and <em>server</em> sockets.
+</p>
+
+<p>
+Master sockets are newly created TCP sockets returned by the function
+<a href=tcp.html#tcp><tt>socket.tcp</tt></a>. A master socket is
+transformed into a server socket
+after it is associated with a <em>local</em> address by a call to the
+<a href=tcp.html#bind><tt>bind</tt></a> method followed by a call to the
+<a href=tcp.html#listen><tt>listen</tt></a>. Conversely, a master socket
+can be changed into a client socket with the method
+<a href=tcp.html#connect><tt>connect</tt></a>,
+which associates it with a <em>remote</em> address.
+</p>
+
+<p>
+On server sockets, applications can use the
+<a href=tcp.html#accept><tt>accept</tt></a> method
+to wait for a client connection. Once a connection is established, a
+client socket object is returned representing this connection. The
+other methods available for server socket objects are
+<a href=tcp.html#getsockname><tt>getsockname</tt></a>,
+<a href=tcp.html#setoption><tt>setoption</tt></a>,
+<a href=tcp.html#settimeout><tt>settimeout</tt></a>, and
+<a href=tcp.html#close><tt>close</tt></a>.
+</p>
+
+<p>
+Client sockets are used to exchange data between two applications over
+the Internet. Applications can call the methods
+<a href=tcp.html#send><tt>send</tt></a> and
+<a href=tcp.html#receive><tt>receive</tt></a>
+to send and receive data. The other methods
+available for client socket objects are
+<a href=tcp.html#getsockname><tt>getsockname</tt></a>,
+<a href=tcp.html#getpeername><tt>getpeername</tt></a>,
+<a href=tcp.html#setoption><tt>setoption</tt></a>,
+<a href=tcp.html#settimeout><tt>settimeout</tt></a>,
+<a href=tcp.html#shutdown><tt>shutdown</tt></a>, and
+<a href=tcp.html#close><tt>close</tt></a>.
+</p>
+
+<p>
+Example:
+</p>
+<blockquote>
+<p>
+A simple echo server, using LuaSocket. The program binds to an ephemeral
+port (one that is chosen by the operating system) on the local host and
+awaits client connections on that port. When a connection is established,
+the program reads a line from the remote end and sends it back, closing
+the connection immediately. You can test it using the telnet
+program.
+</p>
+
+<pre class=example>
+-- load namespace
+local socket = require("socket")
+-- create a TCP socket and bind it to the local host, at any port
+local server = assert(socket.bind("*", 0))
+-- find out which port the OS chose for us
+local ip, port = server:getsockname()
+-- print a message informing what's up
+print("Please telnet to localhost on port " .. port)
+print("After connecting, you have 10s to enter a line to be echoed")
+-- loop forever waiting for clients
+while 1 do
+ -- wait for a connection from any client
+ local client = server:accept()
+ -- make sure we don't block waiting for this client's line
+ client:settimeout(10)
+ -- receive the line
+ local line, err = client:receive()
+ -- if there was no error, send it back to the client
+ if not err then client:send(line .. "\n") end
+ -- done with client, close the object
+ client:close()
+end
+</pre>
+</blockquote>
+
+<!-- udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id=udp>UDP</h3>
+
+<p>
+UDP (User Datagram Protocol) is a non-reliable datagram protocol. In
+other words, applications communicating through UDP send and receive
+data as independent blocks, which are not guaranteed to reach the other
+end. Even when they do reach the other end, they are not guaranteed to be
+error free. Data transfers are atomic, one datagram at a time. Reading
+only part of a datagram discards the rest, so that the following read
+operation will act on the next datagram. The advantages are in
+simplicity (no connection setup) and performance (no error checking or
+error correction).
+</p>
+
+<p>
+Note that although no guarantees are made, these days
+networks are so good that, under normal circumstances, few errors
+happen in practice.
+</p>
+
+<p>
+An UDP socket object is created by the
+<a href=udp.html#udp><tt>socket.udp</tt></a> function. UDP
+sockets do not need to be connected before use. The method
+<a href=udp.html#sendto><tt>sendto</tt></a>
+can be used immediately after creation to
+send a datagram to IP address and port. Host names are not allowed
+because performing name resolution for each packet would be forbiddingly
+slow. Methods
+<a href=udp.html#receive><tt>receive</tt></a> and
+<a href=udp.html#receivefrom><tt>receivefrom</tt></a>
+can be used to retrieve datagrams, the latter returning the IP and port of
+the sender as extra return values (thus being slightly less
+efficient).
+</p>
+
+<p>
+When communication is performed repeatedly with a single peer, an
+application should call the
+<a href=udp.html#setpeername><tt>setpeername</tt></a> method to specify a
+permanent partner. Methods
+<a href=udp.html#sendto><tt>sendto</tt></a> and
+<a href=udp.html#receivefrom><tt>receivefrom</tt></a>
+can no longer be used, but the method
+<a href=udp.html#send><tt>send</tt></a> can be used to send data
+directly to the peer, and the method
+<a href=udp.html#receive><tt>receive</tt></a>
+will only return datagrams originating
+from that peer. There is about 30% performance gain due to this practice.
+</p>
+
+<p>
+To associate an UDP socket with a local address, an application calls the
+<a href=udp.html#setsockname><tt>setsockname</tt></a>
+method <em>before</em> sending any datagrams. Otherwise, the socket is
+automatically bound to an ephemeral address before the first data
+transmission and once bound the local address cannot be changed.
+The other methods available for UDP sockets are
+<a href=udp.html#getpeername><tt>getpeername</tt></a>,
+<a href=udp.html#getsockname><tt>getsockname</tt></a>,
+<a href=udp.html#settimeout><tt>settimeout</tt></a>,
+<a href=udp.html#setoption><tt>setoption</tt></a> and
+<a href=udp.html#close><tt>close</tt></a>.
+</p>
+
+<p>
+Example:
+</p>
+<blockquote>
+<p>
+A simple daytime client, using LuaSocket. The program connects to a remote
+server and tries to retrieve the daytime, printing the answer it got or an
+error message.
+</p>
+
+<pre class=example>
+-- change here to the host an port you want to contact
+local host, port = "localhost", 13
+-- load namespace
+local socket = require("socket")
+-- convert host name to ip address
+local ip = assert(socket.dns.toip(host))
+-- create a new UDP object
+local udp = assert(socket.udp())
+-- contact daytime host
+assert(udp:sendto("anything", ip, port))
+-- retrieve the answer and print results
+io.write(assert(udp:receive()))
+</pre>
+</blockquote>
+
+<!-- More +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id=more>Support modules</h3>
+
+<p> Although not covered in the introduction, LuaSocket offers
+much more than TCP and UDP functionality. As the library
+evolved, support for <a href=http.html>HTTP</a>, <a href=ftp.html>FTP</a>,
+and <a href=smtp.html>SMTP</a> were built on top of these. These modules
+and many others are covered by the <a href=reference.html>reference manual</a>.
+</p>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:36 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html
new file mode 100644
index 00000000000..001395030af
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/ltn12.html
@@ -0,0 +1,430 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: LTN12 support">
+<meta name="keywords" content="Lua, LuaSocket, Filters, Source, Sink,
+Pump, Support, Library">
+<title>LuaSocket: LTN12 module</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- ltn12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=ltn12>LTN12</h2>
+
+<p> The <tt>ltn12</tt> namespace implements the ideas described in
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">
+LTN012, Filters sources and sinks</a>. This manual simply describes the
+functions. Please refer to the LTN for a deeper explanation of the
+functionality provided by this module.
+</p>
+
+<p>
+To obtain the <tt>ltn12</tt> namespace, run:
+</p>
+
+<pre class=example>
+-- loads the LTN21 module
+local ltn12 = require("ltn12")
+</pre>
+
+<!-- filters ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id="filter">Filters</h3>
+
+<!-- chain ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="filter.chain">
+ltn12.filter.<b>chain(</b>filter<sub>1</sub>, filter<sub>2</sub>
+[, ... filter<sub>N</sub>]<b>)</b>
+</p>
+
+<p class=description>
+Returns a filter that passes all data it receives through each of a
+series of given filters.
+</p>
+
+<p class=parameters>
+<tt>Filter<sub>1</sub></tt> to <tt>filter<sub>N</sub></tt> are simple
+filters.
+</p>
+
+<p class=return>
+The function returns the chained filter.
+</p>
+
+<p class=note>
+The nesting of filters can be arbitrary. For instance, the useless filter
+below doesn't do anything but return the data that was passed to it,
+unaltered.
+</p>
+
+<pre class=example>
+-- load required modules
+local ltn12 = require("ltn12")
+local mime = require("mime")
+
+-- create a silly identity filter
+id = ltn12.filter.chain(
+ mime.encode("quoted-printable"),
+ mime.encode("base64"),
+ mime.decode("base64"),
+ mime.decode("quoted-printable")
+)
+</pre>
+
+<!-- cycle ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="filter.cycle">
+ltn12.filter.<b>cycle(</b>low [, ctx, extra]<b>)</b>
+</p>
+
+<p class=description>
+Returns a high-level filter that cycles though a low-level filter by
+passing it each chunk and updating a context between calls.
+</p>
+
+<p class=parameters>
+<tt>Low</tt> is the low-level filter to be cycled,
+<tt>ctx</tt> is the initial context and <tt>extra</tt> is any extra
+argument the low-level filter might take.
+</p>
+
+<p class=return>
+The function returns the high-level filter.
+</p>
+
+<pre class=example>
+-- load the ltn12 module
+local ltn12 = require("ltn12")
+
+-- the base64 mime filter factory
+encodet['base64'] = function()
+ return ltn12.filter.cycle(b64, "")
+end
+</pre>
+
+<!-- pumps ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id="pump">Pumps</h3>
+
+<!-- all ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="pump.all">
+ltn12.pump.<b>all(</b>source, sink<b>)</b>
+</p>
+
+<p class=description>
+Pumps <em>all</em> data from a <tt>source</tt> to a <tt>sink</tt>.
+</p>
+
+<p class=return>
+If successful, the function returns a value that evaluates to
+<b><tt>true</tt></b>. In case
+of error, the function returns a <b><tt>false</tt></b> value, followed by an error message.
+</p>
+
+<!-- step +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="pump.step">
+ltn12.pump.<b>step(</b>source, sink<b>)</b>
+</p>
+
+<p class=description>
+Pumps <em>one</em> chunk of data from a <tt>source</tt> to a <tt>sink</tt>.
+</p>
+
+<p class=return>
+If successful, the function returns a value that evaluates to
+<b><tt>true</tt></b>. In case
+of error, the function returns a <b><tt>false</tt></b> value, followed by an error message.
+</p>
+
+<!-- sinks ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id="sink">Sinks</h3>
+
+<!-- chain ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="sink.chain">
+ltn12.sink.<b>chain(</b>filter, sink<b>)</b>
+</p>
+
+<p class=description>
+Creates and returns a new sink that passes data through a <tt>filter</tt> before sending it to a given <tt>sink</tt>.
+</p>
+
+<!-- error ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="sink.error">
+ltn12.sink.<b>error(</b>message<b>)</b>
+</p>
+
+<p class=description>
+Creates and returns a sink that aborts transmission with the error
+<tt>message</tt>.
+</p>
+
+<!-- file +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="sink.file">
+ltn12.sink.<b>file(</b>handle, message<b>)</b>
+</p>
+
+<p class=description>
+Creates a sink that sends data to a file.
+</p>
+
+<p class=parameters>
+<tt>Handle</tt> is a file handle. If <tt>handle</tt> is <tt><b>nil</b></tt>,
+<tt>message</tt> should give the reason for failure.
+</p>
+
+<p class=return>
+The function returns a sink that sends all data to the given <tt>handle</tt>
+and closes the file when done, or a sink that aborts the transmission with
+the error <tt>message</tt>
+</p>
+
+<p class=note>
+In the following example, notice how the prototype is designed to
+fit nicely with the <tt>io.open</tt> function.
+</p>
+
+<pre class=example>
+-- load the ltn12 module
+local ltn12 = require("ltn12")
+
+-- copy a file
+ltn12.pump.all(
+ ltn12.source.file(io.open("original.png")),
+ ltn12.sink.file(io.open("copy.png"))
+)
+</pre>
+
+<!-- null +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="sink.null">
+ltn12.sink.<b>null()</b>
+</p>
+
+<p class=description>
+Returns a sink that ignores all data it receives.
+</p>
+
+<!-- simplify +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="sink.simplify">
+ltn12.sink.<b>simplify(</b>sink<b>)</b>
+</p>
+
+<p class=description>
+Creates and returns a simple sink given a fancy <tt>sink</tt>.
+</p>
+
+<!-- table ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="sink.table">
+ltn12.sink.<b>table(</b>[table]<b>)</b>
+</p>
+
+<p class=description>
+Creates a sink that stores all chunks in a table. The chunks can later be
+efficiently concatenated into a single string.
+</p>
+
+<p class=parameters>
+<tt>Table</tt> is used to hold the chunks. If
+<tt><b>nil</b></tt>, the function creates its own table.
+</p>
+
+<p class=return>
+The function returns the sink and the table used to store the chunks.
+</p>
+
+<pre class=example>
+-- load needed modules
+local http = require("socket.http")
+local ltn12 = require("ltn12")
+
+-- a simplified http.get function
+function http.get(u)
+ local t = {}
+ local respt = request{
+ url = u,
+ sink = ltn12.sink.table(t)
+ }
+ return table.concat(t), respt.headers, respt.code
+end
+</pre>
+
+<!-- sinks ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id="source">Sources</h3>
+
+<!-- cat ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="source.cat">
+ltn12.source.<b>cat(</b>source<sub>1</sub> [, source<sub>2</sub>, ...,
+source<sub>N</sub>]<b>)</b>
+</p>
+
+<p class=description>
+Creates a new source that produces the concatenation of the data produced
+by a number of sources.
+</p>
+
+<p class=parameters>
+<tt>Source<sub>1</sub></tt> to <tt>source<sub>N</sub></tt> are the original
+sources.
+</p>
+
+<p class=return>
+The function returns the new source.
+</p>
+
+<!-- chain ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="source.chain">
+ltn12.source.<b>chain(</b>source, filter<b>)</b>
+</p>
+
+<p class=description>
+Creates a new <tt>source</tt> that passes data through a <tt>filter</tt>
+before returning it.
+</p>
+
+<p class=return>
+The function returns the new source.
+</p>
+
+<!-- empty ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="source.empty">
+ltn12.source.<b>empty()</b>
+</p>
+
+<p class=description>
+Creates and returns an empty source.
+</p>
+
+<!-- error ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="source.error">
+ltn12.source.<b>error(</b>message<b>)</b>
+</p>
+
+<p class=description>
+Creates and returns a source that aborts transmission with the error
+<tt>message</tt>.
+</p>
+
+<!-- file +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="source.file">
+ltn12.source.<b>file(</b>handle, message<b>)</b>
+</p>
+
+<p class=description>
+Creates a source that produces the contents of a file.
+</p>
+
+<p class=parameters>
+<tt>Handle</tt> is a file handle. If <tt>handle</tt> is <tt><b>nil</b></tt>,
+<tt>message</tt> should give the reason for failure.
+</p>
+
+<p class=return>
+The function returns a source that reads chunks of data from
+given <tt>handle</tt> and returns it to the user,
+closing the file when done, or a source that aborts the transmission with
+the error <tt>message</tt>
+</p>
+
+<p class=note>
+In the following example, notice how the prototype is designed to
+fit nicely with the <tt>io.open</tt> function.
+</p>
+
+<pre class=example>
+-- load the ltn12 module
+local ltn12 = require("ltn12")
+
+-- copy a file
+ltn12.pump.all(
+ ltn12.source.file(io.open("original.png")),
+ ltn12.sink.file(io.open("copy.png"))
+)
+</pre>
+
+<!-- simplify +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="source.simplify">
+ltn12.source.<b>simplify(</b>source<b>)</b>
+</p>
+
+<p class=description>
+Creates and returns a simple source given a fancy <tt>source</tt>.
+</p>
+
+<!-- string +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="source.string">
+ltn12.source.<b>string(</b>string<b>)</b>
+</p>
+
+<p class=description>
+Creates and returns a source that produces the contents of a
+<tt>string</tt>, chunk by chunk.
+</p>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:41 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/luasocket.png b/Build/source/texk/web2c/luatexdir/luasocket/doc/luasocket.png
new file mode 100644
index 00000000000..d24a95495b5
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/luasocket.png
Binary files differ
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html
new file mode 100644
index 00000000000..d7faf52cbcb
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/mime.html
@@ -0,0 +1,476 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: MIME support">
+<meta name="keywords" content="Lua, LuaSocket, MIME, Library, Support">
+<title>LuaSocket: MIME module</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- mime +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=mime>MIME</h2>
+
+<p>
+The <tt>mime</tt> namespace offers filters that apply and remove common
+content transfer encodings, such as Base64 and Quoted-Printable.
+It also provides functions to break text into lines and change
+the end-of-line convention.
+MIME is described mainly in
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2045.txt">RFC 2045</a>,
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2046.txt">2046</a>,
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2047.txt">2047</a>,
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2047.txt">2048</a>, and
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2048.txt">2049</a>.
+</p>
+
+<p>
+All functionality provided by the MIME module
+follows the ideas presented in
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">
+LTN012, Filters sources and sinks</a>.
+</p>
+
+<p>
+To obtain the <tt>mime</tt> namespace, run:
+</p>
+
+<pre class=example>
+-- loads the MIME module and everything it requires
+local mime = require("mime")
+</pre>
+
+
+<!-- High-level +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id=high>High-level filters</h3>
+
+<!-- normalize ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="normalize">
+mime.<b>normalize(</b>[marker]<b>)</b>
+</p>
+
+<p class=description>
+Converts most common end-of-line markers to a specific given marker.
+</p>
+
+<p class=parameters>
+<tt>Marker</tt> is the new marker. It defaults to CRLF, the canonic
+end-of-line marker defined by the MIME standard.
+</p>
+
+<p class=return>
+The function returns a filter that performs the conversion.
+</p>
+
+<p class=note>
+Note: There is no perfect solution to this problem. Different end-of-line
+markers are an evil that will probably plague developers forever.
+This function, however, will work perfectly for text created with any of
+the most common end-of-line markers, i.e. the Mac OS (CR), the Unix (LF),
+or the DOS (CRLF) conventions. Even if the data has mixed end-of-line
+markers, the function will still work well, although it doesn't
+guarantee that the number of empty lines will be correct.
+</p>
+
+<!-- decode +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="decode">
+mime.<b>decode(</b>"base64"<b>)</b><br>
+mime.<b>decode(</b>"quoted-printable"<b>)</b>
+</p>
+
+<p class=description>
+Returns a filter that decodes data from a given transfer content
+encoding.
+</p>
+
+<!-- encode +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="encode">
+mime.<b>encode(</b>"base64"<b>)</b><br>
+mime.<b>encode(</b>"quoted-printable" [, mode]<b>)</b>
+</p>
+
+<p class=description>
+Returns a filter that encodes data according to a given transfer content
+encoding.
+</p>
+
+<p class=parameters>
+In the Quoted-Printable case, the user can specify whether the data is
+textual or binary, by passing the <tt>mode</tt> strings "<tt>text</tt>" or
+"<tt>binary</tt>". <tt>Mode</tt> defaults to "<tt>text</tt>".
+</p>
+
+<p class=note>
+Although both transfer content encodings specify a limit for the line
+length, the encoding filters do <em>not</em> break text into lines (for
+added flexibility).
+Below is a filter that converts binary data to the Base64 transfer content
+encoding and breaks it into lines of the correct size.
+</p>
+
+<pre class=example>
+base64 = ltn12.filter.chain(
+ mime.encode("base64"),
+ mime.wrap("base64")
+)
+</pre>
+
+<p class=note>
+Note: Text data <em>has</em> to be converted to canonic form
+<em>before</em> being encoded.
+</p>
+
+<pre class=example>
+base64 = ltn12.filter.chain(
+ mime.normalize(),
+ mime.encode("base64"),
+ mime.wrap("base64")
+)
+</pre>
+
+<!-- stuff +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="stuff">
+mime.<b>stuff()</b><br>
+</p>
+
+<p class=description>
+Creates and returns a filter that performs stuffing of SMTP messages.
+</p>
+
+<p class=note>
+Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
+uses this filter automatically. You don't need to chain it with your
+source, or apply it to your message body.
+</p>
+
+<!-- wrap +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="wrap">
+mime.<b>wrap(</b>"text" [, length]<b>)</b><br>
+mime.<b>wrap(</b>"base64"<b>)</b><br>
+mime.<b>wrap(</b>"quoted-printable"<b>)</b>
+</p>
+
+<p class=description>
+Returns a filter that breaks data into lines.
+</p>
+
+<p class=parameters>
+The "<tt>text</tt>" line-wrap filter simply breaks text into lines by
+inserting CRLF end-of-line markers at appropriate positions.
+<tt>Length</tt> defaults 76.
+The "<tt>base64</tt>" line-wrap filter works just like the default
+"<tt>text</tt>" line-wrap filter with default length.
+The function can also wrap "<tt>quoted-printable</tt>" lines, taking care
+not to break lines in the middle of an escaped character. In that case, the
+line length is fixed at 76.
+</p>
+
+<p class=note>
+For example, to create an encoding filter for the Quoted-Printable transfer content encoding of text data, do the following:
+</p>
+
+<pre class=example>
+qp = ltn12.filter.chain(
+ mime.normalize(),
+ mime.encode("quoted-printable"),
+ mime.wrap("quoted-printable")
+)
+</pre>
+
+<p class=note>
+Note: To break into lines with a different end-of-line convention, apply
+a normalization filter after the line break filter.
+</p>
+
+<!-- Low-level ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h3 id=low>Low-level filters</h3>
+
+<!-- b64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="b64">
+A, B = mime.<b>b64(</b>C [, D]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to perform Base64 encoding.
+</p>
+
+<p class=description>
+<tt>A</tt> is the encoded version of the largest prefix of
+<tt>C..D</tt>
+that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of
+<tt>C..D</tt>, <em>before</em> encoding.
+If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is padded with
+the encoding of the remaining bytes of <tt>C</tt>.
+</p>
+
+<p class=note>
+Note: The simplest use of this function is to encode a string into it's
+Base64 transfer content encoding. Notice the extra parenthesis around the
+call to <tt>mime.b64</tt>, to discard the second return value.
+</p>
+
+<pre class=example>
+print((mime.b64("diego:password")))
+--&gt; ZGllZ286cGFzc3dvcmQ=
+</pre>
+
+<!-- dot +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<p class=name id="dot">
+A, n = mime.<b>dot(</b>m [, B]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to perform SMTP stuffing and enable transmission of
+messages containing the sequence "CRLF.CRLF".
+</p>
+
+<p class=parameters>
+<tt>A</tt> is the stuffed version of <tt>B</tt>. '<tt>n</tt>' gives the
+number of characters from the sequence CRLF seen in the end of <tt>B</tt>.
+'<tt>m</tt>' should tell the same, but for the previous chunk.
+</p>
+
+<p class=note>Note: The message body is defined to begin with
+an implicit CRLF. Therefore, to stuff a message correctly, the
+first <tt>m</tt> should have the value 2.
+</p>
+
+<pre class=example>
+print((string.gsub(mime.dot(2, ".\r\nStuffing the message.\r\n.\r\n."), "\r\n", "\\n")))
+--&gt; ..\nStuffing the message.\n..\n..
+</pre>
+
+<p class=note>
+Note: The <a href=smtp.html#send><tt>smtp.send</tt></a> function
+uses this filter automatically. You don't need to
+apply it again.
+</p>
+
+<!-- eol ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="eol">
+A, B = mime.<b>eol(</b>C [, D, marker]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to perform end-of-line marker translation.
+For each chunk, the function needs to know if the last character of the
+previous chunk could be part of an end-of-line marker or not. This is the
+context the function receives besides the chunk. An updated version of
+the context is returned after each new chunk.
+</p>
+
+<p class=parameters>
+<tt>A</tt> is the translated version of <tt>D</tt>. <tt>C</tt> is the
+ASCII value of the last character of the previous chunk, if it was a
+candidate for line break, or 0 otherwise.
+<tt>B</tt> is the same as <tt>C</tt>, but for the current
+chunk. <tt>Marker</tt> gives the new end-of-line marker and defaults to CRLF.
+</p>
+
+<pre class=example>
+-- translates the end-of-line marker to UNIX
+unix = mime.eol(0, dos, "\n")
+</pre>
+
+<!-- qp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="qp">
+A, B = mime.<b>qp(</b>C [, D, marker]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to perform Quoted-Printable encoding.
+</p>
+
+<p class=parameters>
+<tt>A</tt> is the encoded version of the largest prefix of
+<tt>C..D</tt>
+that can be encoded unambiguously. <tt>B</tt> has the remaining bytes of
+<tt>C..D</tt>, <em>before</em> encoding.
+If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is padded with
+the encoding of the remaining bytes of <tt>C</tt>.
+Throughout encoding, occurrences of CRLF are replaced by the
+<tt>marker</tt>, which itself defaults to CRLF.
+</p>
+
+<p class=note>
+Note: The simplest use of this function is to encode a string into it's
+Quoted-Printable transfer content encoding.
+Notice the extra parenthesis around the call to <tt>mime.qp</tt>, to discard the second return value.
+</p>
+
+<pre class=example>
+print((mime.qp("maçã")))
+--&gt; ma=E7=E3=
+</pre>
+
+<!-- qpwrp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="qpwrp">
+A, m = mime.<b>qpwrp(</b>n [, B, length]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to break Quoted-Printable text into lines.
+</p>
+
+<p class=parameters>
+<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
+<tt>length</tt> bytes (defaults to 76).
+'<tt>n</tt>' should tell how many bytes are left for the first
+line of <tt>B</tt> and '<tt>m</tt>' returns the number of bytes
+left in the last line of <tt>A</tt>.
+</p>
+
+<p class=note>
+Note: Besides breaking text into lines, this function makes sure the line
+breaks don't fall in the middle of an escaped character combination. Also,
+this function only breaks lines that are bigger than <tt>length</tt> bytes.
+</p>
+
+<!-- unb64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="unb64">
+A, B = mime.<b>unb64(</b>C [, D]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to perform Base64 decoding.
+</p>
+
+<p class=parameters>
+<tt>A</tt> is the decoded version of the largest prefix of
+<tt>C..D</tt>
+that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
+<tt>C..D</tt>, <em>before</em> decoding.
+If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is the empty string
+and <tt>B</tt> returns whatever couldn't be decoded.
+</p>
+
+<p class=note>
+Note: The simplest use of this function is to decode a string from it's
+Base64 transfer content encoding.
+Notice the extra parenthesis around the call to <tt>mime.unqp</tt>, to discard the second return value.
+</p>
+
+<pre class=example>
+print((mime.unb64("ZGllZ286cGFzc3dvcmQ=")))
+--&gt; diego:password
+</pre>
+
+<!-- unqp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="unqp">
+A, B = mime.<b>unqp(</b>C [, D]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to remove the Quoted-Printable transfer content encoding
+from data.
+</p>
+
+<p class=parameters>
+<tt>A</tt> is the decoded version of the largest prefix of
+<tt>C..D</tt>
+that can be decoded unambiguously. <tt>B</tt> has the remaining bytes of
+<tt>C..D</tt>, <em>before</em> decoding.
+If <tt>D</tt> is <tt><b>nil</b></tt>, <tt>A</tt> is augmented with
+the encoding of the remaining bytes of <tt>C</tt>.
+</p>
+
+<p class=note>
+Note: The simplest use of this function is to decode a string from it's
+Quoted-Printable transfer content encoding.
+Notice the extra parenthesis around the call to <tt>mime.unqp</tt>, to discard the second return value.
+</p>
+
+<pre class=example>
+print((mime.qp("ma=E7=E3=")))
+--&gt; maçã
+</pre>
+
+<!-- wrp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="wrp">
+A, m = mime.<b>wrp(</b>n [, B, length]<b>)</b>
+</p>
+
+<p class=description>
+Low-level filter to break text into lines with CRLF marker.
+Text is assumed to be in the <a href=#normalize><tt>normalize</tt></a> form.
+</p>
+
+<p class=parameters>
+<tt>A</tt> is a copy of <tt>B</tt>, broken into lines of at most
+<tt>length</tt> bytes (defaults to 76).
+'<tt>n</tt>' should tell how many bytes are left for the first
+line of <tt>B</tt> and '<tt>m</tt>' returns the number of bytes
+left in the last line of <tt>A</tt>.
+</p>
+
+<p class=note>
+Note: This function only breaks lines that are bigger than
+<tt>length</tt> bytes. The resulting line length does not include the CRLF
+marker.
+</p>
+
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:44 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css
new file mode 100644
index 00000000000..b1dd25d70bb
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.css
@@ -0,0 +1,54 @@
+body {
+ margin-left: 1em;
+ margin-right: 1em;
+ font-family: "Verdana", sans-serif;
+}
+
+tt {
+ font-family: "Andale Mono", monospace;
+}
+
+h1, h2, h3, h4 { margin-left: 0em; }
+
+
+h3 { padding-top: 1em; }
+
+p { margin-left: 1em; }
+
+p.name {
+ font-family: "Andale Mono", monospace;
+ padding-top: 1em;
+ margin-left: 0em;
+}
+
+a[href] { color: #00007f; }
+
+blockquote { margin-left: 3em; }
+
+pre.example {
+ background: #ccc;
+ padding: 1em;
+ margin-left: 1em;
+ font-family: "Andale Mono", monospace;
+ font-size: small;
+}
+
+hr {
+ margin-left: 0em;
+ background: #00007f;
+ border: 0px;
+ height: 1px;
+}
+
+ul { list-style-type: disc; }
+
+table.index { border: 1px #00007f; }
+table.index td { text-align: left; vertical-align: top; }
+table.index ul { padding-top: 0em; margin-top: 0em; }
+
+h1:first-letter,
+h2:first-letter,
+h2:first-letter,
+h3:first-letter { color: #00007f; }
+
+div.header, div.footer { margin-left: 0em; }
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html
new file mode 100644
index 00000000000..b329f57f58b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/reference.html
@@ -0,0 +1,239 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: Index to reference manual">
+<meta name="keywords" content="Lua, LuaSocket, Index, Manual, Network, Library,
+Support, Manual">
+<title>LuaSocket: Index to reference manual</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- reference +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2>Reference</h2>
+
+<blockquote>
+<a href="dns.html">DNS (in socket)</a>
+<blockquote>
+<a href="dns.html#toip">toip</a>,
+<a href="dns.html#tohostname">tohostname</a>,
+<a href="dns.html#gethostname">gethostname</a>.
+</blockquote>
+</blockquote>
+
+<!-- ftp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="ftp.html">FTP</a>
+<blockquote>
+<a href="ftp.html#get">get</a>,
+<a href="ftp.html#put">put</a>.
+</blockquote>
+</blockquote>
+
+<!-- http +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="http.html">HTTP</a>
+<blockquote>
+<a href="http.html#request">request</a>.
+</blockquote>
+</blockquote>
+
+<!-- ltn12 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="ltn12.html">LTN12</a>
+<blockquote>
+<a href="ltn12.html#filter">filter</a>:
+<a href="ltn12.html#filter.chain">chain</a>,
+<a href="ltn12.html#filter.cycle">cycle</a>.
+</blockquote>
+<blockquote>
+<a href="ltn12.html#pump">pump</a>:
+<a href="ltn12.html#pump.all">all</a>,
+<a href="ltn12.html#pump.step">step</a>.
+</blockquote>
+<blockquote>
+<a href="ltn12.html#sink">sink</a>:
+<a href="ltn12.html#sink.chain">chain</a>,
+<a href="ltn12.html#sink.error">error</a>,
+<a href="ltn12.html#sink.file">file</a>,
+<a href="ltn12.html#sink.null">null</a>,
+<a href="ltn12.html#sink.simplify">simplify</a>,
+<a href="ltn12.html#sink.table">table</a>.
+</blockquote>
+<blockquote>
+<a href="ltn12.html#source">source</a>:
+<a href="ltn12.html#source.cat">cat</a>,
+<a href="ltn12.html#source.chain">chain</a>,
+<a href="ltn12.html#source.empty">empty</a>,
+<a href="ltn12.html#source.error">error</a>,
+<a href="ltn12.html#source.file">file</a>,
+<a href="ltn12.html#source.simplify">simplify</a>,
+<a href="ltn12.html#source.string">string</a>.
+</blockquote>
+</blockquote>
+
+<!-- mime +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="mime.html">MIME</a>
+<blockquote>
+<a href="mime.html#high">high-level</a>:
+<a href="mime.html#normalize">normalize</a>,
+<a href="mime.html#decode">decode</a>,
+<a href="mime.html#encode">encode</a>,
+<a href="mime.html#stuff">stuff</a>,
+<a href="mime.html#wrap">wrap</a>.
+</blockquote>
+<blockquote>
+<a href="mime.html#low">low-level</a>:
+<a href="mime.html#b64">b64</a>,
+<a href="mime.html#dot">dot</a>,
+<a href="mime.html#eol">eol</a>,
+<a href="mime.html#qp">qp</a>,
+<a href="mime.html#wrp">wrp</a>,
+<a href="mime.html#qpwrp">qpwrp</a>.
+<a href="mime.html#unb64">unb64</a>,
+<a href="mime.html#unqp">unqp</a>,
+</blockquote>
+</blockquote>
+
+<!-- smtp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="smtp.html">SMTP</a>
+<blockquote>
+<a href="smtp.html#message">message</a>,
+<a href="smtp.html#send">send</a>.
+</blockquote>
+</blockquote>
+
+<!-- socket +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="socket.html">Socket</a>
+<blockquote>
+<a href="socket.html#debug">_DEBUG</a>,
+<a href="dns.html#dns">dns</a>,
+<a href="socket.html#gettime">gettime</a>,
+<a href="socket.html#newtry">newtry</a>,
+<a href="socket.html#protect">protect</a>,
+<a href="socket.html#select">select</a>,
+<a href="socket.html#sink">sink</a>,
+<a href="socket.html#skip">skip</a>,
+<a href="socket.html#sleep">sleep</a>,
+<a href="socket.html#source">source</a>,
+<a href="tcp.html#tcp">tcp</a>,
+<a href="socket.html#try">try</a>,
+<a href="udp.html#udp">udp</a>,
+<a href="socket.html#version">_VERSION</a>.
+</blockquote>
+</blockquote>
+
+<!-- tcp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="tcp.html">TCP (in socket)</a>
+<blockquote>
+<a href="tcp.html#accept">accept</a>,
+<a href="tcp.html#bind">bind</a>,
+<a href="tcp.html#close">close</a>,
+<a href="tcp.html#connect">connect</a>,
+<a href="tcp.html#getpeername">getpeername</a>,
+<a href="tcp.html#getsockname">getsockname</a>,
+<a href="tcp.html#getstats">getstats</a>,
+<a href="tcp.html#receive">receive</a>,
+<a href="tcp.html#send">send</a>,
+<a href="tcp.html#setoption">setoption</a>,
+<a href="tcp.html#setstats">setstats</a>,
+<a href="tcp.html#settimeout">settimeout</a>,
+<a href="tcp.html#shutdown">shutdown</a>.
+</blockquote>
+</blockquote>
+
+<!-- udp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="udp.html">UDP (in socket)</a>
+<blockquote>
+<a href="udp.html#close">close</a>,
+<a href="udp.html#getpeername">getpeername</a>,
+<a href="udp.html#getsockname">getsockname</a>,
+<a href="udp.html#receive">receive</a>,
+<a href="udp.html#receivefrom">receivefrom</a>,
+<a href="udp.html#send">send</a>,
+<a href="udp.html#sendto">sendto</a>,
+<a href="udp.html#setpeername">setpeername</a>,
+<a href="udp.html#setsockname">setsockname</a>,
+<a href="udp.html#setoption">setoption</a>,
+<a href="udp.html#settimeout">settimeout</a>.
+</blockquote>
+</blockquote>
+
+<!-- url ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<blockquote>
+<a href="url.html">URL</a>
+<blockquote>
+<a href="url.html#absolute">absolute</a>,
+<a href="url.html#build">build</a>,
+<a href="url.html#build_path">build_path</a>,
+<a href="url.html#escape">escape</a>,
+<a href="url.html#parse">parse</a>,
+<a href="url.html#parse_path">parse_path</a>,
+<a href="url.html#unescape">unescape</a>.
+</blockquote>
+</blockquote>
+
+<!-- footer ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:47 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html
new file mode 100644
index 00000000000..27dd4736b4b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/smtp.html
@@ -0,0 +1,417 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: SMTP support">
+<meta name="keywords" content="Lua, LuaSocket, SMTP, E-Mail, MIME, Multipart,
+Library, Support">
+<title>LuaSocket: SMTP support</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- smtp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=smtp>SMTP</h2>
+
+<p> The <tt>smtp</tt> namespace provides functionality to send e-mail
+messages. The high-level API consists of two functions: one to
+define an e-mail message, and another to actually send the message.
+Although almost all users will find that these functions provide more than
+enough functionality, the underlying implementation allows for even more
+control (if you bother to read the code).
+</p>
+
+<p>The implementation conforms to the Simple Mail Transfer Protocol,
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2821.txt">RFC 2821</a>.
+Another RFC of interest is <a
+href="http://www.cs.princeton.edu/~diego/rfc/rfc2822.txt">RFC 2822</a>,
+which governs the Internet Message Format.
+Multipart messages (those that contain attachments) are part
+of the MIME standard, but described mainly
+in <a href="http://www.cs.princeton.edu/~diego/rfc/rfc2046.txt">RFC
+2046</a>
+
+<p> In the description below, good understanding of <a
+href="http://lua-users.org/wiki/FiltersSourcesAndSinks"> LTN012, Filters
+sources and sinks</a> and the <a href=mime.html>MIME</a> module is
+assumed. In fact, the SMTP module was the main reason for their
+creation. </p>
+
+<p>
+To obtain the <tt>smtp</tt> namespace, run:
+</p>
+
+<pre class=example>
+-- loads the SMTP module and everything it requires
+local smtp = require("socket.smtp")
+</pre>
+
+<p>
+MIME headers are represented as a Lua table in the form:
+</p>
+
+<blockquote>
+<table summary="MIME headers in Lua table">
+<tr><td><tt>
+headers = {<br>
+&nbsp;&nbsp;field-1-name = <i>field-1-value</i>,<br>
+&nbsp;&nbsp;field-2-name = <i>field-2-value</i>,<br>
+&nbsp;&nbsp;field-3-name = <i>field-3-value</i>,<br>
+&nbsp;&nbsp;...<br>
+&nbsp;&nbsp;field-n-name = <i>field-n-value</i><br>
+}
+</tt></td></tr>
+</table>
+</blockquote>
+
+<p>
+Field names are case insensitive (as specified by the standard) and all
+functions work with lowercase field names.
+Field values are left unmodified.
+</p>
+
+<p class=note>
+Note: MIME headers are independent of order. Therefore, there is no problem
+in representing them in a Lua table.
+</p>
+
+<p>
+The following constants can be set to control the default behavior of
+the SMTP module:
+</p>
+
+<ul>
+<li> <tt>DOMAIN</tt>: domain used to greet the server;
+<li> <tt>PORT</tt>: default port used for the connection;
+<li> <tt>SERVER</tt>: default server used for the connection;
+<li> <tt>TIMEOUT</tt>: default timeout for all I/O operations;
+<li> <tt>ZONE</tt>: default time zone.
+</ul>
+
+<!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=send>
+smtp.<b>send{</b><br>
+&nbsp;&nbsp;from = <i>string</i>,<br>
+&nbsp;&nbsp;rcpt = <i>string</i> or <i>string-table</i>,<br>
+&nbsp;&nbsp;source = <i>LTN12 source</i>,<br>
+&nbsp;&nbsp;[user = <i>string</i>,]<br>
+&nbsp;&nbsp;[password = <i>string</i>,]<br>
+&nbsp;&nbsp;[server = <i>string</i>,]<br>
+&nbsp;&nbsp;[port = <i>number</i>,]<br>
+&nbsp;&nbsp;[domain = <i>string</i>,]<br>
+&nbsp;&nbsp;[step = <i>LTN12 pump step</i>,]<br>
+&nbsp;&nbsp;[create = <i>function</i>]<br>
+<b>}</b>
+</p>
+
+<p class=description>
+Sends a message to a recipient list. Since sending messages is not as
+simple as downloading an URL from a FTP or HTTP server, this function
+doesn't have a simple interface. However, see the
+<a href=#message><tt>message</tt></a> source factory for
+a very powerful way to define the message contents.
+</p>
+
+
+<p class=parameters>
+The sender is given by the e-mail address in the <tt>from</tt> field.
+<tt>Rcpt</tt> is a Lua table with one entry for each recipient e-mail
+address, or a string
+in case there is just one recipient.
+The contents of the message are given by a <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+<tt>source</tt>. Several arguments are optional:
+</p>
+<ul>
+<li> <tt>user</tt>, <tt>password</tt>: User and password for
+authentication. The function will attempt LOGIN and PLAIN authentication
+methods if supported by the server (both are unsafe);
+<li> <tt>server</tt>: Server to connect to. Defaults to "localhost";
+<li> <tt>port</tt>: Port to connect to. Defaults to 25;
+<li> <tt>domain</tt>: Domain name used to greet the server; Defaults to the
+local machine host name;
+<li> <tt>step</tt>:
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+pump step function used to pass data from the
+source to the server. Defaults to the LTN12 <tt>pump.step</tt> function;
+<li><tt>create</tt>: An optional function to be used instead of
+<a href=tcp.html#socket.tcp><tt>socket.tcp</tt></a> when the communications socket is created.
+</ul>
+
+<p class=return>
+If successful, the function returns 1. Otherwise, the function returns
+<b><tt>nil</tt></b> followed by an error message.
+</p>
+
+<p class=note>
+Note: SMTP servers can be very picky with the format of e-mail
+addresses. To be safe, use only addresses of the form
+"<tt>&lt;fulano@example.com&gt;</tt>" in the <tt>from</tt> and
+<tt>rcpt</tt> arguments to the <tt>send</tt> function. In headers, e-mail
+addresses can take whatever form you like. </p>
+
+<p class=note>
+Big note: There is a good deal of misconception with the use of the
+destination address field headers, i.e., the '<tt>To</tt>', '<tt>Cc</tt>',
+and, more importantly, the '<tt>Bcc</tt>' headers. Do <em>not</em> add a
+'<tt>Bcc</tt>' header to your messages because it will probably do the
+exact opposite of what you expect.
+</p>
+
+<p class=note>
+Only recipients specified in the <tt>rcpt</tt> list will receive a copy of the
+message. Each recipient of an SMTP mail message receives a copy of the
+message body along with the headers, and nothing more. The headers
+<em>are</em> part of the message and should be produced by the
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+<tt>source</tt> function. The <tt>rcpt</tt> list is <em>not</em>
+part of the message and will not be sent to anyone.
+</p>
+
+<p class=note>
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2822.txt">RFC 2822</a>
+has two <em>important and short</em> sections, "3.6.3. Destination address
+fields" and "5. Security considerations", explaining the proper
+use of these headers. Here is a summary of what it says:
+</p>
+
+<ul>
+<li> <tt>To</tt>: contains the address(es) of the primary recipient(s)
+of the message;
+<li> <tt>Cc</tt>: (where the "Cc" means "Carbon Copy" in the sense of
+making a copy on a typewriter using carbon paper) contains the
+addresses of others who are to receive the message, though the
+content of the message may not be directed at them;
+<li> <tt>Bcc</tt>: (where the "Bcc" means "Blind Carbon
+Copy") contains addresses of recipients of the message whose addresses are not to be revealed to other recipients of the message.
+</ul>
+
+<p class=note>
+The LuaSocket <tt>send</tt> function does not care or interpret the
+headers you send, but it gives you full control over what is sent and
+to whom it is sent:
+</p>
+<ul>
+<li> If someone is to receive the message, the e-mail address <em>has</em>
+to be in the recipient list. This is the only parameter that controls who
+gets a copy of the message;
+<li> If there are multiple recipients, none of them will automatically
+know that someone else got that message. That is, the default behavior is
+similar to the <tt>Bcc</tt> field of popular e-mail clients;
+<li> It is up to you to add the <tt>To</tt> header with the list of primary
+recipients so that other recipients can see it;
+<li> It is also up to you to add the <tt>Cc</tt> header with the
+list of additional recipients so that everyone else sees it;
+<li> Adding a header <tt>Bcc</tt> is nonsense, unless it is
+empty. Otherwise, everyone receiving the message will see it and that is
+exactly what you <em>don't</em> want to happen!
+</ul>
+
+<p class=note>
+I hope this clarifies the issue. Otherwise, please refer to
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2821.txt">RFC 2821</a>
+and
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2822.txt">RFC 2822</a>.
+</p>
+
+<pre class=example>
+-- load the smtp support
+local smtp = require("socket.smtp")
+
+-- Connects to server "localhost" and sends a message to users
+-- "fulano@example.com", "beltrano@example.com",
+-- and "sicrano@example.com".
+-- Note that "fulano" is the primary recipient, "beltrano" receives a
+-- carbon copy and neither of them knows that "sicrano" received a blind
+-- carbon copy of the message.
+from = "&lt;luasocket@example.com&gt;"
+
+rcpt = {
+ "&lt;fulano@example.com&gt;",
+ "&lt;beltrano@example.com&gt;",
+ "&lt;sicrano@example.com&gt;"
+}
+
+mesgt = {
+ headers = {
+ to = "Fulano da Silva &lt;fulano@example.com&gt;",
+ cc = '"Beltrano F. Nunes" &lt;beltrano@example.com&gt;',
+ subject = "My first message"
+ },
+ body = "I hope this works. If it does, I can send you another 1000 copies."
+}
+
+r, e = smtp.send{
+ from = from,
+ rcpt = rcpt,
+ source = smtp.message(mesgt)
+}
+</pre>
+
+<!-- message ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=message>
+smtp.<b>message(</b>mesgt<b>)</b>
+</p>
+
+<p class=description>
+Returns a <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> source that sends an SMTP message body, possibly multipart (arbitrarily deep).
+</p>
+
+<p class=parameters>
+The only parameter of the function is a table describing the message.
+<tt>Mesgt</tt> has the following form (notice the recursive structure):
+</p>
+
+<blockquote>
+<table summary="Mesgt table structure">
+<tr><td><tt>
+mesgt = {<br>
+&nbsp;&nbsp;headers = <i>header-table</i>,<br>
+&nbsp;&nbsp;body = <i>LTN12 source</i> or <i>string</i> or
+<i>multipart-mesgt</i><br>
+}<br>
+&nbsp;<br>
+multipart-mesgt = {<br>
+&nbsp;&nbsp;[preamble = <i>string</i>,]<br>
+&nbsp;&nbsp;[1] = <i>mesgt</i>,<br>
+&nbsp;&nbsp;[2] = <i>mesgt</i>,<br>
+&nbsp;&nbsp;...<br>
+&nbsp;&nbsp;[<i>n</i>] = <i>mesgt</i>,<br>
+&nbsp;&nbsp;[epilogue = <i>string</i>,]<br>
+}<br>
+</tt></td></tr>
+</table>
+</blockquote>
+
+<p class=parameters>
+For a simple message, all that is needed is a set of <tt>headers</tt>
+and the <tt>body</tt>. The message <tt>body</tt> can be given as a string
+or as a <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+source. For multipart messages, the body is a table that
+recursively defines each part as an independent message, plus an optional
+<tt>preamble</tt> and <tt>epilogue</tt>.
+</p>
+
+<p class=return>
+The function returns a <em>simple</em>
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+source that produces the
+message contents as defined by <tt>mesgt</tt>, chunk by chunk.
+Hopefully, the following
+example will make things clear. When in doubt, refer to the appropriate RFC
+as listed in the introduction. </p>
+
+<pre class=example>
+-- load the smtp support and its friends
+local smtp = require("socket.smtp")
+local mime = require("mime")
+local ltn12 = require("ltn12")
+
+-- creates a source to send a message with two parts. The first part is
+-- plain text, the second part is a PNG image, encoded as base64.
+source = smtp.message{
+ headers = {
+ -- Remember that headers are *ignored* by smtp.send.
+ from = "Sicrano de Oliveira &lt;sicrano@example.com&gt;",
+ to = "Fulano da Silva &lt;fulano@example.com&gt;",
+ subject = "Here is a message with attachments"
+ },
+ body = {
+ preamble = "If your client doesn't understand attachments, \r\n" ..
+ "it will still display the preamble and the epilogue.\r\n" ..
+ "Preamble will probably appear even in a MIME enabled client.",
+ -- first part: no headers means plain text, us-ascii.
+ -- The mime.eol low-level filter normalizes end-of-line markers.
+ [1] = {
+ body = mime.eol(0, [[
+ Lines in a message body should always end with CRLF.
+ The smtp module will *NOT* perform translation. However, the
+ send function *DOES* perform SMTP stuffing, whereas the message
+ function does *NOT*.
+ ]])
+ },
+ -- second part: headers describe content to be a png image,
+ -- sent under the base64 transfer content encoding.
+ -- notice that nothing happens until the message is actually sent.
+ -- small chunks are loaded into memory right before transmission and
+ -- translation happens on the fly.
+ [2] = {
+ headers = {
+ ["content-type"] = 'image/png; name="image.png"',
+ ["content-disposition"] = 'attachment; filename="image.png"',
+ ["content-description"] = 'a beautiful image',
+ ["content-transfer-encoding"] = "BASE64"
+ },
+ body = ltn12.source.chain(
+ ltn12.source.file(io.open("image.png", "rb")),
+ ltn12.filter.chain(
+ mime.encode("base64"),
+ mime.wrap()
+ )
+ )
+ },
+ epilogue = "This might also show up, but after the attachments"
+ }
+}
+
+-- finally send it
+r, e = smtp.send{
+ from = "&lt;sicrano@example.com&gt;",
+ rcpt = "&lt;fulano@example.com&gt;",
+ source = source,
+}
+</pre>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:51 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
new file mode 100644
index 00000000000..ba4b7303e32
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/socket.html
@@ -0,0 +1,404 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: The core namespace">
+<meta name="keywords" content="Lua, LuaSocket, Socket, Network, Library, Support">
+<title>LuaSocket: The socket namespace</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- socket +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=socket>The socket namespace</h2>
+
+<p>
+The <tt>socket</tt> namespace contains the core functionality of LuaSocket.
+</p>
+
+<p>
+To obtain the <tt>socket</tt> namespace, run:
+</p>
+
+<pre class=example>
+-- loads the socket module
+local socket = require("socket")
+</pre>
+
+<!-- bind ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=bind>
+socket.<b>bind(</b>address, port [, backlog]<b>)</b>
+</p>
+
+<p class=description>
+This function is a shortcut that creates and returns a TCP server object
+bound to a local <tt>address</tt> and <tt>port</tt>, ready to
+accept client connections. Optionally,
+user can also specify the <tt>backlog</tt> argument to the
+<a href=tcp.html#listen><tt>listen</tt></a> method (defaults to 32).
+</p>
+
+<p class=note>
+Note: The server object returned will have the option "<tt>reuseaddr</tt>"
+set to <tt><b>true</b></tt>.
+</p>
+
+<!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=connect>
+socket.<b>connect(</b>address, port [, locaddr, locport]<b>)</b>
+</p>
+
+<p class=description>
+This function is a shortcut that creates and returns a TCP client object
+connected to a remote <tt>host</tt> at a given <tt>port</tt>. Optionally,
+the user can also specify the local address and port to bind
+(<tt>locaddr</tt> and <tt>locport</tt>).
+</p>
+
+<!-- debug ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=debug>
+socket.<b>_DEBUG</b>
+</p>
+
+<p class=description>
+This constant is set to <tt><b>true</b></tt> if the library was compiled
+with debug support.
+</p>
+
+<!-- newtry +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=newtry>
+socket.<b>newtry(</b>finalizer<b>)</b>
+</p>
+
+<p class=description>
+Creates and returns a <em>clean</em>
+<a href="#try"><tt>try</tt></a>
+function that allows for cleanup before the exception
+is raised.
+</p>
+
+<p class=parameters>
+<tt>Finalizer</tt> is a function that will be called before
+<tt>try</tt> throws the exception. It will be called
+in <em>protected</em> mode.
+</p>
+
+<p class=return>
+The function returns your customized <tt>try</tt> function.
+</p>
+
+<p class=note>
+Note: This idea saved a <em>lot</em> of work with the
+implementation of protocols in LuaSocket:
+</p>
+
+<pre class=example>
+foo = socket.protect(function()
+ -- connect somewhere
+ local c = socket.try(socket.connect("somewhere", 42))
+ -- create a try function that closes 'c' on error
+ local try = socket.newtry(function() c:close() end)
+ -- do everything reassured c will be closed
+ try(c:send("hello there?\r\n"))
+ local answer = try(c:receive())
+ ...
+ try(c:send("good bye\r\n"))
+ c:close()
+end)
+</pre>
+
+
+<!-- protect +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=protect>
+socket.<b>protect(</b>func<b>)</b>
+</p>
+
+<p class=description>
+Converts a function that throws exceptions into a safe function. This
+function only catches exceptions thrown by the <a href=#try><tt>try</tt></a>
+and <a href=#newtry><tt>newtry</tt></a> functions. It does not catch normal
+Lua errors.
+</p>
+
+<p class=parameters>
+<tt>Func</tt> is a function that calls
+<a href=#try><tt>try</tt></a> (or <tt>assert</tt>, or <tt>error</tt>)
+to throw exceptions.
+</p>
+
+<p class=return>
+Returns an equivalent function that instead of throwing exceptions,
+returns <tt><b>nil</b></tt> followed by an error message.
+</p>
+
+<p class=note>
+Note: Beware that if your function performs some illegal operation that
+raises an error, the protected function will catch the error and return it
+as a string. This is because the <a href=#try><tt>try</tt></a> function
+uses errors as the mechanism to throw exceptions.
+</p>
+
+<!-- select +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=select>
+socket.<b>select(</b>recvt, sendt [, timeout]<b>)</b>
+</p>
+
+<p class=description>
+Waits for a number of sockets to change status.
+</p>
+
+<p class=parameters>
+<tt>Recvt</tt> is an array with the sockets to test for characters
+available for reading. Sockets in the <tt>sendt</tt> array are watched to
+see if it is OK to immediately write on them. <tt>Timeout</tt> is the
+maximum amount of time (in seconds) to wait for a change in status. A
+<tt><b>nil</b></tt>, negative or omitted <tt>timeout</tt> value allows the
+function to block indefinitely. <tt>Recvt</tt> and <tt>sendt</tt> can also
+be empty tables or <tt><b>nil</b></tt>. Non-socket values (or values with
+non-numeric indices) in the arrays will be silently ignored.
+</p>
+
+<p class=return> The function returns a list with the sockets ready for
+reading, a list with the sockets ready for writing and an error message.
+The error message is "<tt>timeout</tt>" if a timeout condition was met and
+<tt><b>nil</b></tt> otherwise. The returned tables are
+doubly keyed both by integers and also by the sockets
+themselves, to simplify the test if a specific socket has
+changed status.
+</p>
+
+<p class=note>
+<b>Important note</b>: a known bug in WinSock causes <tt>select</tt> to fail
+on non-blocking TCP sockets. The function may return a socket as
+writable even though the socket is <em>not</em> ready for sending.
+</p>
+
+<p class=note>
+<b>Another important note</b>: calling select with a server socket in the receive parameter before a call to accept does <em>not</em> guarantee
+<a href=tcp.html#accept><tt>accept</tt></a> will return immediately.
+Use the <a href=tcp.html#settimeout><tt>settimeout</tt></a>
+method or <tt>accept</tt> might block forever.
+</p>
+
+<p class=note>
+<b>Yet another note</b>: If you close a socket and pass
+it to <tt>select</tt>, it will be ignored.
+</p>
+
+<!-- sink ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=sink>
+socket.<b>sink(</b>mode, socket<b>)</b>
+</p>
+
+<p class=description>
+Creates an
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+sink from a stream socket object.
+</p>
+
+<p class=parameters>
+<tt>Mode</tt> defines the behavior of the sink. The following
+options are available:
+</p>
+<ul>
+<li> <tt>"http-chunked"</tt>: sends data through socket after applying the
+<em>chunked transfer coding</em>, closing the socket when done;
+<li> <tt>"close-when-done"</tt>: sends all received data through the
+socket, closing the socket when done;
+<li> <tt>"keep-open"</tt>: sends all received data through the
+socket, leaving it open when done.
+</ul>
+<p>
+<tt>Socket</tt> is the stream socket object used to send the data.
+</p>
+
+<p class=return>
+The function returns a sink with the appropriate behavior.
+</p>
+
+<!-- skip ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=skip>
+socket.<b>skip(</b>d [, ret<sub>1</sub>, ret<sub>2</sub> ... ret<sub>N</sub>]<b>)</b>
+</p>
+
+<p class=description>
+Drops a number of arguments and returns the remaining.
+</p>
+
+<p class=parameters>
+<tt>D</tt> is the number of arguments to drop. <tt>Ret<sub>1</sub></tt> to
+<tt>ret<sub>N</sub></tt> are the arguments.
+</p>
+
+<p class=return>
+The function returns <tt>ret<sub>d+1</sub></tt> to <tt>ret<sub>N</sub></tt>.
+</p>
+
+<p class=note>
+Note: This function is useful to avoid creation of dummy variables:
+</p>
+
+<pre class=example>
+-- get the status code and separator from SMTP server reply
+local code, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)"))
+</pre>
+
+<!-- sleep ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=sleep>
+socket.<b>sleep(</b>time<b>)</b>
+</p>
+
+<p class=description>
+Freezes the program execution during a given amount of time.
+</p>
+
+<p class=parameters>
+<tt>Time</tt> is the number of seconds to sleep for.
+</p>
+
+<!-- source +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=source>
+socket.<b>source(</b>mode, socket [, length]<b>)</b>
+</p>
+
+<p class=description>
+Creates an
+<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a>
+source from a stream socket object.
+</p>
+
+<p class=parameters>
+<tt>Mode</tt> defines the behavior of the source. The following
+options are available:
+</p>
+<ul>
+<li> <tt>"http-chunked"</tt>: receives data from socket and removes the
+<em>chunked transfer coding</em> before returning the data;
+<li> <tt>"by-length"</tt>: receives a fixed number of bytes from the
+socket. This mode requires the extra argument <tt>length</tt>;
+<li> <tt>"until-closed"</tt>: receives data from a socket until the other
+side closes the connection.
+</ul>
+<p>
+<tt>Socket</tt> is the stream socket object used to receive the data.
+</p>
+
+<p class=return>
+The function returns a source with the appropriate behavior.
+</p>
+
+<!-- time ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=gettime>
+socket.<b>gettime()</b>
+</p>
+
+<p class=description>
+Returns the time in seconds, relative to the origin of the
+universe. You should subtract the values returned by this function
+to get meaningful values.
+</p>
+
+<pre class=example>
+t = socket.gettime()
+-- do stuff
+print(socket.gettime() - t .. " seconds elapsed")
+</pre>
+
+<!-- try ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=try>
+socket.<b>try(</b>ret<sub>1</sub> [, ret<sub>2</sub> ... ret<sub>N</sub>]<b>)</b>
+</p>
+
+<p class=description>
+Throws an exception in case of error. The exception can only be caught
+by the <a href=#protect><tt>protect</tt></a> function. It does not explode
+into an error message.
+</p>
+
+<p class=parameters>
+<tt>Ret<sub>1</sub></tt> to <tt>ret<sub>N</sub></tt> can be arbitrary
+arguments, but are usually the return values of a function call
+nested with <tt>try</tt>.
+</p>
+
+<p class=return>
+The function returns <tt>ret</tt><sub>1</sub> to <tt>ret</tt><sub>N</sub> if
+<tt>ret</tt><sub>1</sub> is not <tt><b>nil</b></tt>. Otherwise, it calls <tt>error</tt> passing <tt>ret</tt><sub>2</sub>.
+</p>
+
+<pre class=example>
+-- connects or throws an exception with the appropriate error message
+c = socket.try(socket.connect("localhost", 80))
+</pre>
+
+<!-- version ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=version>
+socket.<b>_VERSION</b>
+</p>
+
+<p class=description>
+This constant has a string describing the current LuaSocket version.
+</p>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:54 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
new file mode 100644
index 00000000000..a16a09ed538
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/tcp.html
@@ -0,0 +1,533 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: The TCP/IP support">
+<meta name="keywords" content="Lua, LuaSocket, Socket, TCP, Library, Network, Support">
+<title>LuaSocket: TCP/IP support</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- tcp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=tcp>TCP</h2>
+
+<!-- socket.tcp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=socket.tcp>
+socket.<b>tcp()</b>
+</p>
+
+<p class=description>
+Creates and returns a TCP master object. A master object can
+be transformed into a server object with the method
+<a href=#listen><tt>listen</tt></a> (after a call to <a
+href=#bind><tt>bind</tt></a>) or into a client object with
+the method <a href=#connect><tt>connect</tt></a>. The only other
+method supported by a master object is the
+<a href=#close><tt>close</tt></a> method.</p>
+
+<p class=return>
+In case of success, a new master object is returned. In case of error,
+<b><tt>nil</tt></b> is returned, followed by an error message.
+</p>
+
+<!-- accept +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=accept>
+server:<b>accept()</b>
+</p>
+
+<p class=description>
+Waits for a remote connection on the server
+object and returns a client object representing that connection.
+</p>
+
+<p class=return>
+If a connection is successfully initiated, a client object is returned.
+If a timeout condition is met, the method returns <b><tt>nil</tt></b>
+followed by the error string '<tt>timeout</tt>'. Other errors are
+reported by <b><tt>nil</tt></b> followed by a message describing the error.
+</p>
+
+<p class=note>
+Note: calling <a href=socket.html#select><tt>socket.select</tt></a>
+with a server object in
+the <tt>recvt</tt> parameter before a call to <tt>accept</tt> does
+<em>not</em> guarantee <tt>accept</tt> will return immediately. Use the <a
+href=#settimeout><tt>settimeout</tt></a> method or <tt>accept</tt>
+might block until <em>another</em> client shows up.
+</p>
+
+<!-- bind +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=bind>
+master:<b>bind(</b>address, port<b>)</b>
+</p>
+
+<p class=description>
+Binds a master object to <tt>address</tt> and <tt>port</tt> on the
+local host.
+
+<p class=parameters>
+<tt>Address</tt> can be an IP address or a host name.
+<tt>Port</tt> must be an integer number in the range [0..64K).
+If <tt>address</tt>
+is '<tt>*</tt>', the system binds to all local interfaces
+using the <tt>INADDR_ANY</tt> constant. If <tt>port</tt> is 0, the system automatically
+chooses an ephemeral port.
+</p>
+
+<p class=return>
+In case of success, the method returns 1. In case of error, the
+method returns <b><tt>nil</tt></b> followed by an error message.
+</p>
+
+<p class=note>
+Note: The function <a href=socket.html#bind><tt>socket.bind</tt></a>
+is available and is a shortcut for the creation of server sockets.
+</p>
+
+<!-- close ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=close>
+master:<b>close()</b><br>
+client:<b>close()</b><br>
+server:<b>close()</b>
+</p>
+
+<p class=description>
+Closes a TCP object. The internal socket used by the object is closed
+and the local address to which the object was
+bound is made available to other applications. No further operations
+(except for further calls to the <tt>close</tt> method) are allowed on
+a closed socket.
+</p>
+
+<p class=note>
+Note: It is important to close all used sockets once they are not
+needed, since, in many systems, each socket uses a file descriptor,
+which are limited system resources. Garbage-collected objects are
+automatically closed before destruction, though.
+</p>
+
+<!-- connect ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=connect>
+master:<b>connect(</b>address, port<b>)</b>
+</p>
+
+<p class=description>
+Attempts to connect a master object to a remote host, transforming it into a
+client object.
+Client objects support methods
+<a href=#send><tt>send</tt></a>,
+<a href=#receive><tt>receive</tt></a>,
+<a href=#getsockname><tt>getsockname</tt></a>,
+<a href=#getpeername><tt>getpeername</tt></a>,
+<a href=#settimeout><tt>settimeout</tt></a>,
+and <a href=#close><tt>close</tt></a>.
+</p>
+
+<p class=parameters>
+<tt>Address</tt> can be an IP address or a host name.
+<tt>Port</tt> must be an integer number in the range [1..64K).
+</p>
+
+<p class=return>
+In case of error, the method returns <b><tt>nil</tt></b> followed by a string
+describing the error. In case of success, the method returns 1.
+</p>
+
+<p class=note>
+Note: The function <a href=socket.html#connect><tt>socket.connect</tt></a>
+is available and is a shortcut for the creation of client sockets.
+</p>
+
+<p class=note>
+Note: Starting with LuaSocket 2.0,
+the <a href=#settimeout><tt>settimeout</tt></a>
+method affects the behavior of <tt>connect</tt>, causing it to return
+with an error in case of a timeout. If that happens, you can still call <a
+href=socket.html#select><tt>socket.select</tt></a> with the socket in the
+<tt>sendt</tt> table. The socket will be writable when the connection is
+established.
+</p>
+
+<!-- getpeername ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=getpeername>
+client:<b>getpeername()</b>
+</p>
+
+<p class=description>
+Returns information about the remote side of a connected client object.
+</p>
+
+<p class=return>
+Returns a string with the IP address of the peer, followed by the
+port number that peer is using for the connection.
+In case of error, the method returns <b><tt>nil</tt></b>.
+</p>
+
+<p class=note>
+Note: It makes no sense to call this method on server objects.
+</p>
+
+<!-- getsockname ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=getsockname>
+master:<b>getsockname()</b><br>
+client:<b>getsockname()</b><br>
+server:<b>getsockname()</b>
+</p>
+
+<p class=description>
+Returns the local address information associated to the object.
+</p>
+
+<p class=return>
+The method returns a string with local IP address and a number with
+the port. In case of error, the method returns <b><tt>nil</tt></b>.
+</p>
+
+<!-- getstats +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=getstats>
+master:<b>getstats()</b><br>
+client:<b>getstats()</b><br>
+server:<b>getstats()</b><br>
+</p>
+
+<p class=description>
+Returns accounting information on the socket, useful for throttling
+of bandwidth.
+</p>
+
+<p class=return>
+The method returns the number of bytes received, the number of bytes sent,
+and the age of the socket object in seconds.
+</p>
+
+<!-- listen ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=listen>
+master:<b>listen(</b>backlog<b>)</b>
+</p>
+
+<p class=description>
+Specifies the socket is willing to receive connections, transforming the
+object into a server object. Server objects support the
+<a href=#accept><tt>accept</tt></a>,
+<a href=#getsockname><tt>getsockname</tt></a>,
+<a href=#setoption><tt>setoption</tt></a>,
+<a href=#settimeout><tt>settimeout</tt></a>,
+and <a href=#close><tt>close</tt></a> methods.
+</p>
+
+<p class=parameters>
+The parameter <tt>backlog</tt> specifies the number of client
+connections that can
+be queued waiting for service. If the queue is full and another client
+attempts connection, the connection is refused.
+</p>
+
+<p class=return>
+In case of success, the method returns 1. In case of error, the
+method returns <b><tt>nil</tt></b> followed by an error message.
+</p>
+
+<!-- receive ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=receive>
+client:<b>receive(</b>[pattern [, prefix]]<b>)</b>
+</p>
+
+<p class=description>
+Reads data from a client object, according to the specified <em>read
+pattern</em>. Patterns follow the Lua file I/O format, and the difference in performance between all patterns is negligible.
+</p>
+
+<p class=parameters>
+<tt>Pattern</tt> can be any of the following:
+</p>
+
+<ul>
+<li> '<tt>*a</tt>': reads from the socket until the connection is
+closed. No end-of-line translation is performed;
+<li> '<tt>*l</tt>': reads a line of text from the socket. The line is
+terminated by a LF character (ASCII&nbsp;10), optionally preceded by a
+CR character (ASCII&nbsp;13). The CR and LF characters are not included in
+the returned line. In fact, <em>all</em> CR characters are
+ignored by the pattern. This is the default pattern;
+<li> <tt>number</tt>: causes the method to read a specified <tt>number</tt>
+of bytes from the socket.
+</ul>
+
+<p class=parameters>
+<tt>Prefix</tt> is an optional string to be concatenated to the beginning
+of any received data before return.
+</p>
+
+<p class=return>
+If successful, the method returns the received pattern. In case of error,
+the method returns <tt><b>nil</b></tt> followed by an error message which
+can be the string '<tt>closed</tt>' in case the connection was
+closed before the transmission was completed or the string
+'<tt>timeout</tt>' in case there was a timeout during the operation.
+Also, after the error message, the function returns the partial result of
+the transmission.
+</p>
+
+<p class=note>
+<b>Important note</b>: This function was changed <em>severely</em>. It used
+to support multiple patterns (but I have never seen this feature used) and
+now it doesn't anymore. Partial results used to be returned in the same
+way as successful results. This last feature violated the idea that all
+functions should return <tt><b>nil</b></tt> on error. Thus it was changed
+too.
+</p>
+
+<!-- send +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=send>
+client:<b>send(</b>data [, i [, j]]<b>)</b>
+</p>
+
+<p class=description>
+Sends <tt>data</tt> through client object.
+</p>
+
+<p class=parameters>
+<tt>Data</tt> is the string to be sent. The optional arguments
+<tt>i</tt> and <tt>j</tt> work exactly like the standard
+<tt>string.sub</tt> Lua function to allow the selection of a
+substring to be sent.
+</p>
+
+<p class=return>
+If successful, the method returns the index of the last byte
+within <tt>[i, j]</tt> that has been sent. Notice that, if
+<tt>i</tt> is 1 or absent, this is effectively the total
+number of bytes sent. In case of error, the method returns
+<b><tt>nil</tt></b>, followed by an error message, followed
+by the index of the last byte within <tt>[i, j]</tt> that
+has been sent. You might want to try again from the byte
+following that. The error message can be '<tt>closed</tt>'
+in case the connection was closed before the transmission
+was completed or the string '<tt>timeout</tt>' in case
+there was a timeout during the operation.
+</p>
+
+<p class=note>
+Note: Output is <em>not</em> buffered. For small strings,
+it is always better to concatenate them in Lua
+(with the '<tt>..</tt>' operator) and send the result in one call
+instead of calling the method several times.
+</p>
+
+<!-- setoption ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=setoption>
+client:<b>setoption(</b>option [, value]<b>)</b><br>
+server:<b>setoption(</b>option [, value]<b>)</b>
+</p>
+
+<p class=description>
+Sets options for the TCP object. Options are only needed by low-level or
+time-critical applications. You should only modify an option if you
+are sure you need it.
+</p>
+
+<p class=parameters>
+<tt>Option</tt> is a string with the option name, and <tt>value</tt>
+depends on the option being set:
+
+<ul>
+
+<li> '<tt>keepalive</tt>': Setting this option to <tt>true</tt> enables
+the periodic transmission of messages on a connected socket. Should the
+connected party fail to respond to these messages, the connection is
+considered broken and processes using the socket are notified;
+
+<li> '<tt>linger</tt>': Controls the action taken when unsent data are
+queued on a socket and a close is performed. The value is a table with a
+boolean entry '<tt>on</tt>' and a numeric entry for the time interval
+'<tt>timeout</tt>' in seconds. If the '<tt>on</tt>' field is set to
+<tt>true</tt>, the system will block the process on the close attempt until
+it is able to transmit the data or until '<tt>timeout</tt>' has passed. If
+'<tt>on</tt>' is <tt>false</tt> and a close is issued, the system will
+process the close in a manner that allows the process to continue as
+quickly as possible. I do not advise you to set this to anything other than
+zero;
+
+<li> '<tt>reuseaddr</tt>': Setting this option indicates that the rules
+used in validating addresses supplied in a call to
+<a href=#bind><tt>bind</tt></a> should allow reuse of local addresses;
+
+<li> '<tt>tcp-nodelay</tt>': Setting this option to <tt>true</tt>
+disables the Nagle's algorithm for the connection.
+
+</ul>
+
+<p class=return>
+The method returns 1 in case of success, or <b><tt>nil</tt></b> otherwise.
+</p>
+
+<p class=note>
+Note: The descriptions above come from the man pages.
+</p>
+
+<!-- setstats +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=setstats>
+master:<b>setstats(</b>received, sent, age<b>)</b><br>
+client:<b>setstats(</b>received, sent, age<b>)</b><br>
+server:<b>setstats(</b>received, sent, age<b>)</b><br>
+</p>
+
+<p class=description>
+Resets accounting information on the socket, useful for throttling
+of bandwidth.
+</p>
+
+<p class=parameters>
+<tt>Received</tt> is a number with the new number of bytes received.
+<tt>Sent</tt> is a number with the new number of bytes sent.
+<tt>Age</tt> is the new age in seconds.
+</p>
+
+<p class=return>
+The method returns 1 in case of success and <tt><b>nil</b></tt> otherwise.
+</p>
+
+<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=settimeout>
+master:<b>settimeout(</b>value [, mode]<b>)</b><br>
+client:<b>settimeout(</b>value [, mode]<b>)</b><br>
+server:<b>settimeout(</b>value [, mode]<b>)</b>
+</p>
+
+<p class=description>
+Changes the timeout values for the object. By default,
+all I/O operations are blocking. That is, any call to the methods
+<a href=#send><tt>send</tt></a>,
+<a href=#receive><tt>receive</tt></a>, and
+<a href=#accept><tt>accept</tt></a>
+will block indefinitely, until the operation completes. The
+<tt>settimeout</tt> method defines a limit on the amount of time the
+I/O methods can block. When a timeout is set and the specified amount of
+time has elapsed, the affected methods give up and fail with an error code.
+</p>
+
+<p class=parameters>
+The amount of time to wait is specified as the
+<tt>value</tt> parameter, in seconds. There are two timeout modes and
+both can be used together for fine tuning:
+</p>
+
+<ul>
+<li> '<tt>b</tt>': <em>block</em> timeout. Specifies the upper limit on
+the amount of time LuaSocket can be blocked by the operating system
+while waiting for completion of any single I/O operation. This is the
+default mode;</li>
+
+<li> '<tt>t</tt>': <em>total</em> timeout. Specifies the upper limit on
+the amount of time LuaSocket can block a Lua script before returning from
+a call.</li>
+</ul>
+
+<p class=parameters>
+The <b><tt>nil</tt></b> timeout <tt>value</tt> allows operations to block
+indefinitely. Negative timeout values have the same effect.
+</p>
+
+<p class=note>
+Note: although timeout values have millisecond precision in LuaSocket,
+large blocks can cause I/O functions not to respect timeout values due
+to the time the library takes to transfer blocks to and from the OS
+and to and from the Lua interpreter. Also, function that accept host names
+and perform automatic name resolution might be blocked by the resolver for
+longer than the specified timeout value.
+</p>
+
+<p class=note>
+Note: The old <tt>timeout</tt> method is deprecated. The name has been
+changed for sake of uniformity, since all other method names already
+contained verbs making their imperative nature obvious.
+</p>
+
+<!-- shutdown +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=shutdown>
+client:<b>shutdown(</b>mode<b>)</b><br>
+</p>
+
+<p class=description>
+Shuts down part of a full-duplex connection.
+</p>
+
+<p class=parameters>
+Mode tells which way of the connection should be shut down and can
+take the value:
+<ul>
+<li>"<tt>both</tt>": disallow further sends and receives on the object.
+This is the default mode;
+<li>"<tt>send</tt>": disallow further sends on the object;
+<li>"<tt>receive</tt>": disallow further receives on the object.
+</ul>
+
+<p class=return>
+This function returns 1.
+</p>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:25:57 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html
new file mode 100644
index 00000000000..688649decb9
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/udp.html
@@ -0,0 +1,416 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: The UDP support">
+<meta name="keywords" content="Lua, LuaSocket, Socket, UDP, Library, Network, Support">
+<title>LuaSocket: UDP support</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+
+<!-- udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=udp>UDP</h2>
+
+<!-- socket.udp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="socket.udp">
+socket.<b>udp()</b>
+</p>
+
+<p class="description">
+Creates and returns an unconnected UDP object. Unconnected objects support the
+<a href="#sendto"><tt>sendto</tt></a>,
+<a href="#receive"><tt>receive</tt></a>,
+<a href="#receivefrom"><tt>receivefrom</tt></a>,
+<a href="#getsockname"><tt>getsockname</tt></a>,
+<a href="#setoption"><tt>setoption</tt></a>,
+<a href="#settimeout"><tt>settimeout</tt></a>,
+<a href="#setpeername"><tt>setpeername</tt></a>,
+<a href="#setsockname"><tt>setsockname</tt></a>, and
+<a href="#close"><tt>close</tt></a>.
+The <a href="#setpeername"><tt>setpeername</tt></a>
+is used to connect the object.
+</p>
+
+<p class="return">
+In case of success, a new unconnected UDP object
+returned. In case of error, <b><tt>nil</tt></b> is returned, followed by
+an error message.
+</p>
+
+<!-- close +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="close">
+connected:<b>close()</b><br>
+unconnected:<b>close()</b>
+</p>
+
+<p class="description">
+Closes a UDP object. The internal socket
+used by the object is closed and the local address to which the
+object was bound is made available to other applications. No
+further operations (except for further calls to the <tt>close</tt>
+method) are allowed on a closed socket.
+</p>
+
+<p class="note">
+Note: It is important to close all used sockets
+once they are not needed, since, in many systems, each socket uses
+a file descriptor, which are limited system resources.
+Garbage-collected objects are automatically closed before
+destruction, though.
+</p>
+
+<!-- getpeername +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="getpeername">
+connected:<b>getpeername()</b>
+</p>
+
+<p class="description">
+Retrieves information about the peer
+associated with a connected UDP object.
+</p>
+
+<p class="return">
+Returns the IP address and port number of the peer.
+</p>
+
+<p class="note">
+Note: It makes no sense to call this method on unconnected objects.
+</p>
+
+<!-- getsockname +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="getsockname">
+connected:<b>getsockname()</b><br>
+unconnected:<b>getsockname()</b>
+</p>
+
+<p class="description">
+Returns the local address information associated to the object.
+</p>
+
+<p class="return">
+The method returns a string with local IP
+address and a number with the port. In case of error, the method
+returns <b><tt>nil</tt></b>.
+</p>
+
+<p class="note">
+Note: UDP sockets are not bound to any address
+until the <a href="#setsockname"><tt>setsockname</tt></a> or the
+<a href="#sendto"><tt>sendto</tt></a> method is called for the
+first time (in which case it is bound to an ephemeral port and the
+wild-card address).
+</p>
+
+<!-- receive +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="receive">
+connected:<b>receive(</b>[size]<b>)</b><br>
+unconnected:<b>receive(</b>[size]<b>)</b>
+</p>
+
+<p class="description">
+Receives a datagram from the UDP object. If
+the UDP object is connected, only datagrams coming from the peer
+are accepted. Otherwise, the returned datagram can come from any
+host.
+</p>
+
+<p class="parameters">
+The optional <tt>size</tt> parameter
+specifies the maximum size of the datagram to be retrieved. If
+there are more than <tt>size</tt> bytes available in the datagram,
+the excess bytes are discarded. If there are less then
+<tt>size</tt> bytes available in the current datagram, the
+available bytes are returned. If <tt>size</tt> is omitted, the
+maximum datagram size is used (which is currently limited by the
+implementation to 8192 bytes).
+</p>
+
+<p class="return">
+In case of success, the method returns the
+received datagram. In case of timeout, the method returns
+<b><tt>nil</tt></b> followed by the string '<tt>timeout</tt>'.
+</p>
+
+<!-- receivefrom +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="receivefrom">
+unconnected:<b>receivefrom(</b>[size]<b>)</b>
+</p>
+
+<p class="description">
+Works exactly as the <a href="#receive"><tt>receive</tt></a>
+method, except it returns the IP
+address and port as extra return values (and is therefore slightly less
+efficient).
+</p>
+
+<!-- send ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="send">
+connected:<b>send(</b>datagram<b>)</b>
+</p>
+
+<p class="description">
+Sends a datagram to the UDP peer of a connected object.
+</p>
+
+<p class="parameters">
+<tt>Datagram</tt> is a string with the datagram contents.
+The maximum datagram size for UDP is 64K minus IP layer overhead.
+However datagrams larger than the link layer packet size will be
+fragmented, which may deteriorate performance and/or reliability.
+</p>
+
+<p class="return">
+If successful, the method returns 1. In case of
+error, the method returns <b><tt>nil</tt></b> followed by an error message.
+</p>
+
+<p class="note">
+Note: In UDP, the <tt>send</tt> method never blocks
+and the only way it can fail is if the underlying transport layer
+refuses to send a message to the specified address (i.e. no
+interface accepts the address).
+</p>
+
+<!-- sendto ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="sendto">
+unconnected:<b>sendto(</b>datagram, ip, port<b>)</b>
+</p>
+
+<p class="description">
+Sends a datagram to the specified IP address and port number.
+</p>
+
+<p class="parameters">
+<tt>Datagram</tt> is a string with the
+datagram contents.
+The maximum datagram size for UDP is 64K minus IP layer overhead.
+However datagrams larger than the link layer packet size will be
+fragmented, which may deteriorate performance and/or reliability.
+<tt>Ip</tt> is the IP address of the recipient.
+Host names are <em>not</em> allowed for performance reasons.
+
+<tt>Port</tt> is the port number at the recipient.
+</p>
+
+<p class="return">
+If successful, the method returns 1. In case of
+error, the method returns <b><tt>nil</tt></b> followed by an error message.
+</p>
+
+<p class="note">
+Note: In UDP, the <tt>send</tt> method never blocks
+and the only way it can fail is if the underlying transport layer
+refuses to send a message to the specified address (i.e. no
+interface accepts the address).
+</p>
+
+<!-- setpeername +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="setpeername">
+connected:<b>setpeername(</b>'*'<b>)</b><br>
+unconnected:<b>setpeername(</b>address, port<b>)</b>
+</p>
+
+<p class="description">
+Changes the peer of a UDP object. This
+method turns an unconnected UDP object into a connected UDP
+object or vice versa.
+</p>
+
+<p class="description">
+For connected objects, outgoing datagrams
+will be sent to the specified peer, and datagrams received from
+other peers will be discarded by the OS. Connected UDP objects must
+use the <a href="#send"><tt>send</tt></a> and
+<a href="#receive"><tt>receive</tt></a> methods instead of
+<a href="#sendto"><tt>sendto</tt></a> and
+<a href="#receivefrom"><tt>receivefrom</tt></a>.
+</p>
+
+<p class="parameters">
+<tt>Address</tt> can be an IP address or a
+host name. <tt>Port</tt> is the port number. If <tt>address</tt> is
+'<tt>*</tt>' and the object is connected, the peer association is
+removed and the object becomes an unconnected object again. In that
+case, the <tt>port</tt> argument is ignored.
+</p>
+
+<p class="return">
+In case of error the method returns
+<b><tt>nil</tt></b> followed by an error message. In case of success, the
+method returns 1.
+</p>
+
+<p class="note">
+Note: Since the address of the peer does not have
+to be passed to and from the OS, the use of connected UDP objects
+is recommended when the same peer is used for several transmissions
+and can result in up to 30% performance gains.
+</p>
+
+<!-- setsockname +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="setsockname">
+unconnected:<b>setsockname(</b>address, port<b>)</b>
+</p>
+
+<p class="description">
+Binds the UDP object to a local address.
+</p>
+
+<p class="parameters">
+<tt>Address</tt> can be an IP address or a
+host name. If <tt>address</tt> is '<tt>*</tt>' the system binds to
+all local interfaces using the constant <tt>INADDR_ANY</tt>. If
+<tt>port</tt> is 0, the system chooses an ephemeral port.
+</p>
+
+<p class="return">
+If successful, the method returns 1. In case of
+error, the method returns <b><tt>nil</tt></b> followed by an error
+message.
+</p>
+
+<p class="note">
+Note: This method can only be called before any
+datagram is sent through the UDP object, and only once. Otherwise,
+the system automatically binds the object to all local interfaces
+and chooses an ephemeral port as soon as the first datagram is
+sent. After the local address is set, either automatically by the
+system or explicitly by <tt>setsockname</tt>, it cannot be
+changed.
+</p>
+
+<!-- setoption +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="setoption">
+connected:<b>setoption(</b>option [, value]<b>)</b><br>
+unconnected:<b>setoption(</b>option [, value]<b>)</b>
+</p>
+
+<p class="description">
+Sets options for the UDP object. Options are
+only needed by low-level or time-critical applications. You should
+only modify an option if you are sure you need it.</p>
+<p class="parameters"><tt>Option</tt> is a string with the option
+name, and <tt>value</tt> depends on the option being set:
+</p>
+
+<ul>
+<li>'<tt>dontroute</tt>': Setting this option to <tt>true</tt>
+indicates that outgoing messages should bypass the standard routing
+facilities;</li>
+<li>'<tt>broadcast</tt>': Setting this option to <tt>true</tt>
+requests permission to send broadcast datagrams on the
+socket.</li>
+</ul>
+
+<p class="return">
+The method returns 1 in case of success, or
+<b><tt>nil</tt></b> followed by an error message otherwise.
+</p>
+
+<p class="note">
+Note: The descriptions above come from the man
+pages.
+</p>
+
+<!-- settimeout +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class="name" id="settimeout">
+connected:<b>settimeout(</b>value<b>)</b><br>
+unconnected:<b>settimeout(</b>value<b>)</b>
+</p>
+
+<p class="description">
+Changes the timeout values for the object. By default, the
+<a href="#receive"><tt>receive</tt></a> and
+<a href="#receivefrom"><tt>receivefrom</tt></a>
+operations are blocking. That is, any call to the methods will block
+indefinitely, until data arrives. The <tt>settimeout</tt> function defines
+a limit on the amount of time the functions can block. When a timeout is
+set and the specified amount of time has elapsed, the affected methods
+give up and fail with an error code.
+</p>
+
+<p class="parameters">
+The amount of time to wait is specified as
+the <tt>value</tt> parameter, in seconds. The <b><tt>nil</tt></b> timeout
+<tt>value</tt> allows operations to block indefinitely. Negative
+timeout values have the same effect.
+</p>
+
+<p class="note">
+Note: In UDP, the <a href="#send"><tt>send</tt></a>
+and <a href="#sentdo"><tt>sendto</tt></a> methods never block (the
+datagram is just passed to the OS and the call returns
+immediately). Therefore, the <tt>settimeout</tt> method has no
+effect on them.
+</p>
+
+<p class="note">
+Note: The old <tt>timeout</tt> method is
+deprecated. The name has been changed for sake of uniformity, since
+all other method names already contained verbs making their
+imperative nature obvious.
+</p>
+
+<!-- footer ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:26:01 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/doc/url.html b/Build/source/texk/web2c/luatexdir/luasocket/doc/url.html
new file mode 100644
index 00000000000..e87126fa316
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/doc/url.html
@@ -0,0 +1,329 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+
+<head>
+<meta name="description" content="LuaSocket: URL manipulation">
+<meta name="keywords" content="Lua, LuaSocket, URL, Library, Link, Network, Support">
+<title>LuaSocket: URL support</title>
+<link rel="stylesheet" href="reference.css" type="text/css">
+</head>
+
+<body>
+
+<!-- header +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=header>
+<hr>
+<center>
+<table summary="LuaSocket logo">
+<tr><td align=center><a href="http://www.lua.org">
+<img width=128 height=128 border=0 alt="LuaSocket" src="luasocket.png">
+</a></td></tr>
+<tr><td align=center valign=top>Network support for the Lua language
+</td></tr>
+</table>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#download">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+</center>
+<hr>
+</div>
+
+<!-- url ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<h2 id=url>URL</h2>
+
+<p>
+The <tt>url</tt> namespace provides functions to parse, protect,
+and build URLs, as well as functions to compose absolute URLs
+from base and relative URLs, according to
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2396.txt">RFC
+2396</a>.
+</p>
+
+<p>
+To obtain the <tt>url</tt> namespace, run:
+</p>
+
+<pre class=example>
+-- loads the URL module
+local url = require("socket.url")
+</pre>
+
+<p>
+An URL is defined by the following grammar:
+</p>
+
+<blockquote>
+<tt>
+&lt;url&gt; ::= [&lt;scheme&gt;:][//&lt;authority&gt;][/&lt;path&gt;][;&lt;params&gt;][?&lt;query&gt;][#&lt;fragment&gt;]<br>
+&lt;authority&gt; ::= [&lt;userinfo&gt;@]&lt;host&gt;[:&lt;port&gt;]<br>
+&lt;userinfo&gt; ::= &lt;user&gt;[:&lt;password&gt;]<br>
+&lt;path&gt; ::= {&lt;segment&gt;/}&lt;segment&gt;<br>
+</tt>
+</blockquote>
+
+<!-- absolute +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=absolute>
+url.<b>absolute(</b>base, relative<b>)</b>
+</p>
+
+<p class=description>
+Builds an absolute URL from a base URL and a relative URL.
+</p>
+
+<p class=parameters>
+<tt>Base</tt> is a string with the base URL or
+a parsed URL table. <tt>Relative</tt> is a
+string with the relative URL.
+</p>
+
+<p class=return>
+The function returns a string with the absolute URL.
+</p>
+
+<p class=note>
+Note: The rules that
+govern the composition are fairly complex, and are described in detail in
+<a href="http://www.cs.princeton.edu/~diego/rfc/rfc2396.txt">RFC 2396</a>.
+The example bellow should give an idea of what the rules are.
+</p>
+
+<pre class=example>
+http://a/b/c/d;p?q
+
++
+
+g:h = g:h
+g = http://a/b/c/g
+./g = http://a/b/c/g
+g/ = http://a/b/c/g/
+/g = http://a/g
+//g = http://g
+?y = http://a/b/c/?y
+g?y = http://a/b/c/g?y
+#s = http://a/b/c/d;p?q#s
+g#s = http://a/b/c/g#s
+g?y#s = http://a/b/c/g?y#s
+;x = http://a/b/c/;x
+g;x = http://a/b/c/g;x
+g;x?y#s = http://a/b/c/g;x?y#s
+. = http://a/b/c/
+./ = http://a/b/c/
+.. = http://a/b/
+../ = http://a/b/
+../g = http://a/b/g
+../.. = http://a/
+../../ = http://a/
+../../g = http://a/g
+</pre>
+
+<!-- build ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=build>
+url.<b>build(</b>parsed_url<b>)</b>
+</p>
+
+<p class=description>
+Rebuilds an URL from its parts.
+</p>
+
+<p class=parameters>
+<tt>Parsed_url</tt> is a table with same components returned by
+<a href="#parse"><tt>parse</tt></a>.
+Lower level components, if specified,
+take precedence over high level components of the URL grammar.
+</p>
+
+<p class=return>
+The function returns a string with the built URL.
+</p>
+
+<!-- build_path +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=build_path>
+url.<b>build_path(</b>segments, unsafe<b>)</b>
+</p>
+
+<p class=description>
+Builds a <tt>&lt;path&gt;</tt> component from a list of
+<tt>&lt;segment&gt;</tt> parts.
+Before composition, any reserved characters found in a segment are escaped into
+their protected form, so that the resulting path is a valid URL path
+component.
+</p>
+
+<p class=parameters>
+<tt>Segments</tt> is a list of strings with the <tt>&lt;segment&gt;</tt>
+parts. If <tt>unsafe</tt> is anything but <b><tt>nil</tt></b>, reserved
+characters are left untouched.
+</p>
+
+<p class=return>
+The function returns a string with the
+built <tt>&lt;path&gt;</tt> component.
+</p>
+
+<!-- escape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="escape">
+url.<b>escape(</b>content<b>)</b>
+</p>
+
+<p class=description>
+Applies the URL escaping content coding to a string
+Each byte is encoded as a percent character followed
+by the two byte hexadecimal representation of its integer
+value.
+</p>
+
+<p class=parameters>
+<tt>Content</tt> is the string to be encoded.
+</p>
+
+<p class=result>
+The function returns the encoded string.
+</p>
+
+<pre class=example>
+-- load url module
+url = require("socket.url")
+
+code = url.escape("/#?;")
+-- code = "%2f%23%3f%3b"
+</pre>
+
+<!-- parse ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=parse>
+url.<b>parse(</b>url, default<b>)</b>
+</p>
+
+<p class=description>
+Parses an URL given as a string into a Lua table with its components.
+</p>
+
+<p class=parameters>
+<tt>Url</tt> is the URL to be parsed. If the <tt>default</tt> table is
+present, it is used to store the parsed fields. Only fields present in the
+URL are overwritten. Therefore, this table can be used to pass default
+values for each field.
+</p>
+
+<p class=return>
+The function returns a table with all the URL components:
+</p>
+
+<blockquote><tt>
+parsed_url = {<br>
+&nbsp;&nbsp;url = <i>string</i>,<br>
+&nbsp;&nbsp;scheme = <i>string</i>,<br>
+&nbsp;&nbsp;authority = <i>string</i>,<br>
+&nbsp;&nbsp;path = <i>string</i>,<br>
+&nbsp;&nbsp;params = <i>string</i>,<br>
+&nbsp;&nbsp;query = <i>string</i>,<br>
+&nbsp;&nbsp;fragment = <i>string</i>,<br>
+&nbsp;&nbsp;userinfo = <i>string</i>,<br>
+&nbsp;&nbsp;host = <i>string</i>,<br>
+&nbsp;&nbsp;port = <i>string</i>,<br>
+&nbsp;&nbsp;user = <i>string</i>,<br>
+&nbsp;&nbsp;password = <i>string</i><br>
+}
+</tt></blockquote>
+
+<pre class=example>
+-- load url module
+url = require("socket.url")
+
+parsed_url = url.parse("http://www.example.com/cgilua/index.lua?a=2#there")
+-- parsed_url = {
+-- scheme = "http",
+-- authority = "www.example.com",
+-- path = "/cgilua/index.lua"
+-- query = "a=2",
+-- fragment = "there",
+-- host = "www.puc-rio.br",
+-- }
+
+parsed_url = url.parse("ftp://root:passwd@unsafe.org/pub/virus.exe;type=i")
+-- parsed_url = {
+-- scheme = "ftp",
+-- authority = "root:passwd@unsafe.org",
+-- path = "/pub/virus.exe",
+-- params = "type=i",
+-- userinfo = "root:passwd",
+-- host = "unsafe.org",
+-- user = "root",
+-- password = "passwd",
+-- }
+</pre>
+
+<!-- parse_path +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id=parse_path>
+url.<b>parse_path(</b>path<b>)</b>
+</p>
+
+<p class=description>
+Breaks a <tt>&lt;path&gt;</tt> URL component into all its
+<tt>&lt;segment&gt;</tt> parts.
+</p>
+
+<p class=description>
+<tt>Path</tt> is a string with the path to be parsed.
+</p>
+
+<p class=return>
+Since some characters are reserved in URLs, they must be escaped
+whenever present in a <tt>&lt;path&gt;</tt> component. Therefore, before
+returning a list with all the parsed segments, the function removes
+escaping from all of them.
+</p>
+
+<!-- unescape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<p class=name id="unescape">
+url.<b>unescape(</b>content<b>)</b>
+</p>
+
+<p class=description>
+Removes the URL escaping content coding from a string.
+</p>
+
+<p class=parameters>
+<tt>Content</tt> is the string to be decoded.
+</p>
+
+<p class=return>
+The function returns the decoded string.
+</p>
+
+<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+
+<div class=footer>
+<hr>
+<center>
+<p class=bar>
+<a href="home.html">home</a> &middot;
+<a href="home.html#down">download</a> &middot;
+<a href="installation.html">installation</a> &middot;
+<a href="introduction.html">introduction</a> &middot;
+<a href="reference.html">reference</a>
+</p>
+<p>
+<small>
+Last modified by Diego Nehab on <br>
+Thu Apr 20 00:26:05 EDT 2006
+</small>
+</p>
+</center>
+</div>
+
+</body>
+</html>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/README b/Build/source/texk/web2c/luatexdir/luasocket/etc/README
new file mode 100644
index 00000000000..cfd3e372fad
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/README
@@ -0,0 +1,89 @@
+This directory contains code that is more useful than the
+samples. This code *is* supported.
+
+ tftp.lua -- Trivial FTP client
+
+This module implements file retrieval by the TFTP protocol.
+Its main use was to test the UDP code, but since someone
+found it usefull, I turned it into a module that is almost
+official (no uploads, yet).
+
+ dict.lua -- Dict client
+
+The dict.lua module started with a cool simple client
+for the DICT protocol, written by Luiz Henrique Figueiredo.
+This new version has been converted into a library, similar
+to the HTTP and FTP libraries, that can be used from within
+any luasocket application. Take a look on the source code
+and you will be able to figure out how to use it.
+
+ lp.lua -- LPD client library
+
+The lp.lua module implements the client part of the Line
+Printer Daemon protocol, used to print files on Unix
+machines. It is courtesy of David Burgess! See the source
+code and the lpr.lua in the examples directory.
+
+ b64.lua
+ qp.lua
+ eol.lua
+
+These are tiny programs that perform Base64,
+Quoted-Printable and end-of-line marker conversions.
+
+ get.lua -- file retriever
+
+This little program is a client that uses the FTP and
+HTTP code to implement a command line file graber. Just
+run
+
+ lua get.lua <remote-file> [<local-file>]
+
+to download a remote file (either ftp:// or http://) to
+the specified local file. The program also prints the
+download throughput, elapsed time, bytes already downloaded
+etc during download.
+
+ check-memory.lua -- checks memory consumption
+
+This is just to see how much memory each module uses.
+
+ dispatch.lua -- coroutine based dispatcher
+
+This is a first try at a coroutine based non-blocking
+dispatcher for LuaSocket. Take a look at 'check-links.lua'
+and at 'forward.lua' to see how to use it.
+
+ check-links.lua -- HTML link checker program
+
+This little program scans a HTML file and checks for broken
+links. It is similar to check-links.pl by Jamie Zawinski,
+but uses all facilities of the LuaSocket library and the Lua
+language. It has not been thoroughly tested, but it should
+work. Just run
+
+ lua check-links.lua [-n] {<url>} > output
+
+and open the result to see a list of broken links. Make sure
+you check the '-n' switch. It runs in non-blocking mode,
+using coroutines, and is MUCH faster!
+
+ forward.lua -- coroutine based forward server
+
+This is a forward server that can accept several connections
+and transfers simultaneously using non-blocking I/O and the
+coroutine-based dispatcher. You can run, for example
+
+ lua forward.lua 8080:proxy.com:3128
+
+to redirect all local conections to port 8080 to the host
+'proxy.com' at port 3128.
+
+ unix.c and unix.h
+
+This is an implementation of Unix local domain sockets and
+demonstrates how to extend LuaSocket with a new type of
+transport. It has been tested on Linux and on Mac OS X.
+
+Good luck,
+Diego.
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/b64.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/b64.lua
new file mode 100644
index 00000000000..f75c4232db6
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/b64.lua
@@ -0,0 +1,20 @@
+-----------------------------------------------------------------------------
+-- Little program to convert to and from Base64
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: b64.lua,v 1.8 2004/06/16 04:28:21 diego Exp $
+-----------------------------------------------------------------------------
+local ltn12 = require("ltn12")
+local mime = require("mime")
+local source = ltn12.source.file(io.stdin)
+local sink = ltn12.sink.file(io.stdout)
+local convert
+if arg and arg[1] == '-d' then
+ convert = mime.decode("base64")
+else
+ local base64 = mime.encode("base64")
+ local wrap = mime.wrap()
+ convert = ltn12.filter.chain(base64, wrap)
+end
+sink = ltn12.sink.chain(convert, sink)
+ltn12.pump.all(source, sink)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/check-links.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/check-links.lua
new file mode 100644
index 00000000000..a989f8c271e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/check-links.lua
@@ -0,0 +1,112 @@
+-----------------------------------------------------------------------------
+-- Little program that checks links in HTML files, using coroutines and
+-- non-blocking I/O via the dispatcher module.
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $$
+-----------------------------------------------------------------------------
+local url = require("socket.url")
+local dispatch = require("dispatch")
+local http = require("socket.http")
+dispatch.TIMEOUT = 10
+
+-- make sure the user knows how to invoke us
+arg = arg or {}
+if table.getn(arg) < 1 then
+ print("Usage:\n luasocket check-links.lua [-n] {<url>}")
+ exit()
+end
+
+-- '-n' means we are running in non-blocking mode
+if arg[1] == "-n" then
+ -- if non-blocking I/O was requested, use real dispatcher interface
+ table.remove(arg, 1)
+ handler = dispatch.newhandler("coroutine")
+else
+ -- if using blocking I/O, use fake dispatcher interface
+ handler = dispatch.newhandler("sequential")
+end
+
+local nthreads = 0
+
+-- get the status of a URL using the dispatcher
+function getstatus(link)
+ local parsed = url.parse(link, {scheme = "file"})
+ if parsed.scheme == "http" then
+ nthreads = nthreads + 1
+ handler:start(function()
+ local r, c, h, s = http.request{
+ method = "HEAD",
+ url = link,
+ create = handler.tcp
+ }
+ if r and c == 200 then io.write('\t', link, '\n')
+ else io.write('\t', link, ': ', tostring(c), '\n') end
+ nthreads = nthreads - 1
+ end)
+ end
+end
+
+function readfile(path)
+ path = url.unescape(path)
+ local file, error = io.open(path, "r")
+ if file then
+ local body = file:read("*a")
+ file:close()
+ return body
+ else return nil, error end
+end
+
+function load(u)
+ local parsed = url.parse(u, { scheme = "file" })
+ local body, headers, code, error
+ local base = u
+ if parsed.scheme == "http" then
+ body, code, headers = http.request(u)
+ if code == 200 then
+ -- if there was a redirect, update base to reflect it
+ base = headers.location or base
+ end
+ if not body then
+ error = code
+ end
+ elseif parsed.scheme == "file" then
+ body, error = readfile(parsed.path)
+ else error = string.format("unhandled scheme '%s'", parsed.scheme) end
+ return base, body, error
+end
+
+function getlinks(body, base)
+ -- get rid of comments
+ body = string.gsub(body, "%<%!%-%-.-%-%-%>", "")
+ local links = {}
+ -- extract links
+ body = string.gsub(body, '[Hh][Rr][Ee][Ff]%s*=%s*"([^"]*)"', function(href)
+ table.insert(links, url.absolute(base, href))
+ end)
+ body = string.gsub(body, "[Hh][Rr][Ee][Ff]%s*=%s*'([^']*)'", function(href)
+ table.insert(links, url.absolute(base, href))
+ end)
+ string.gsub(body, "[Hh][Rr][Ee][Ff]%s*=%s*(.-)>", function(href)
+ table.insert(links, url.absolute(base, href))
+ end)
+ return links
+end
+
+function checklinks(address)
+ local base, body, error = load(address)
+ if not body then print(error) return end
+ print("Checking ", base)
+ local links = getlinks(body, base)
+ for _, link in ipairs(links) do
+ getstatus(link)
+ end
+end
+
+for _, address in ipairs(arg) do
+ checklinks(url.absolute("file:", address))
+end
+
+while nthreads > 0 do
+ handler:step()
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/check-memory.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/check-memory.lua
new file mode 100644
index 00000000000..7bd984d8ee8
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/check-memory.lua
@@ -0,0 +1,17 @@
+function load(s)
+ collectgarbage()
+ local a = gcinfo()
+ _G[s] = require(s)
+ collectgarbage()
+ local b = gcinfo()
+ print(s .. ":\t " .. (b-a) .. "k")
+end
+
+load("socket.url")
+load("ltn12")
+load("socket")
+load("mime")
+load("socket.tp")
+load("socket.smtp")
+load("socket.http")
+load("socket.ftp")
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/dict.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/dict.lua
new file mode 100644
index 00000000000..c082c24c0db
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/dict.lua
@@ -0,0 +1,152 @@
+-----------------------------------------------------------------------------
+-- Little program to download DICT word definitions
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: dict.lua,v 1.22 2005/11/22 08:33:29 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Load required modules
+-----------------------------------------------------------------------------
+local base = _G
+local string = require("string")
+local table = require("table")
+local socket = require("socket")
+local url = require("socket.url")
+local tp = require("socket.tp")
+module("socket.dict")
+
+-----------------------------------------------------------------------------
+-- Globals
+-----------------------------------------------------------------------------
+HOST = "dict.org"
+PORT = 2628
+TIMEOUT = 10
+
+-----------------------------------------------------------------------------
+-- Low-level dict API
+-----------------------------------------------------------------------------
+local metat = { __index = {} }
+
+function open(host, port)
+ local tp = socket.try(tp.connect(host or HOST, port or PORT, TIMEOUT))
+ return base.setmetatable({tp = tp}, metat)
+end
+
+function metat.__index:greet()
+ return socket.try(self.tp:check(220))
+end
+
+function metat.__index:check(ok)
+ local code, status = socket.try(self.tp:check(ok))
+ return code,
+ base.tonumber(socket.skip(2, string.find(status, "^%d%d%d (%d*)")))
+end
+
+function metat.__index:getdef()
+ local line = socket.try(self.tp:receive())
+ local def = {}
+ while line ~= "." do
+ table.insert(def, line)
+ line = socket.try(self.tp:receive())
+ end
+ return table.concat(def, "\n")
+end
+
+function metat.__index:define(database, word)
+ database = database or "!"
+ socket.try(self.tp:command("DEFINE", database .. " " .. word))
+ local code, count = self:check(150)
+ local defs = {}
+ for i = 1, count do
+ self:check(151)
+ table.insert(defs, self:getdef())
+ end
+ self:check(250)
+ return defs
+end
+
+function metat.__index:match(database, strat, word)
+ database = database or "!"
+ strat = strat or "."
+ socket.try(self.tp:command("MATCH", database .." ".. strat .." ".. word))
+ self:check(152)
+ local mat = {}
+ local line = socket.try(self.tp:receive())
+ while line ~= '.' do
+ database, word = socket.skip(2, string.find(line, "(%S+) (.*)"))
+ if not mat[database] then mat[database] = {} end
+ table.insert(mat[database], word)
+ line = socket.try(self.tp:receive())
+ end
+ self:check(250)
+ return mat
+end
+
+function metat.__index:quit()
+ self.tp:command("QUIT")
+ return self:check(221)
+end
+
+function metat.__index:close()
+ return self.tp:close()
+end
+
+-----------------------------------------------------------------------------
+-- High-level dict API
+-----------------------------------------------------------------------------
+local default = {
+ scheme = "dict",
+ host = "dict.org"
+}
+
+local function there(f)
+ if f == "" then return nil
+ else return f end
+end
+
+local function parse(u)
+ local t = socket.try(url.parse(u, default))
+ socket.try(t.scheme == "dict", "invalid scheme '" .. t.scheme .. "'")
+ socket.try(t.path, "invalid path in url")
+ local cmd, arg = socket.skip(2, string.find(t.path, "^/(.)(.*)$"))
+ socket.try(cmd == "d" or cmd == "m", "<command> should be 'm' or 'd'")
+ socket.try(arg and arg ~= "", "need at least <word> in URL")
+ t.command, t.argument = cmd, arg
+ arg = string.gsub(arg, "^:([^:]+)", function(f) t.word = f end)
+ socket.try(t.word, "need at least <word> in URL")
+ arg = string.gsub(arg, "^:([^:]*)", function(f) t.database = there(f) end)
+ if cmd == "m" then
+ arg = string.gsub(arg, "^:([^:]*)", function(f) t.strat = there(f) end)
+ end
+ string.gsub(arg, ":([^:]*)$", function(f) t.n = base.tonumber(f) end)
+ return t
+end
+
+local function tget(gett)
+ local con = open(gett.host, gett.port)
+ con:greet()
+ if gett.command == "d" then
+ local def = con:define(gett.database, gett.word)
+ con:quit()
+ con:close()
+ if gett.n then return def[gett.n]
+ else return def end
+ elseif gett.command == "m" then
+ local mat = con:match(gett.database, gett.strat, gett.word)
+ con:quit()
+ con:close()
+ return mat
+ else return nil, "invalid command" end
+end
+
+local function sget(u)
+ local gett = parse(u)
+ return tget(gett)
+end
+
+get = socket.protect(function(gett)
+ if base.type(gett) == "string" then return sget(gett)
+ else return tget(gett) end
+end)
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/dispatch.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/dispatch.lua
new file mode 100644
index 00000000000..3ef1e72b690
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/dispatch.lua
@@ -0,0 +1,302 @@
+-----------------------------------------------------------------------------
+-- A hacked dispatcher module
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $$
+-----------------------------------------------------------------------------
+local base = _G
+local table = require("table")
+local socket = require("socket")
+local coroutine = require("coroutine")
+module("dispatch")
+
+-- if too much time goes by without any activity in one of our sockets, we
+-- just kill it
+TIMEOUT = 60
+
+-----------------------------------------------------------------------------
+-- We implement 3 types of dispatchers:
+-- sequential
+-- coroutine
+-- threaded
+-- The user can choose whatever one is needed
+-----------------------------------------------------------------------------
+local handlert = {}
+
+-- default handler is coroutine
+function newhandler(mode)
+ mode = mode or "coroutine"
+ return handlert[mode]()
+end
+
+local function seqstart(self, func)
+ return func()
+end
+
+-- sequential handler simply calls the functions and doesn't wrap I/O
+function handlert.sequential()
+ return {
+ tcp = socket.tcp,
+ start = seqstart
+ }
+end
+
+-----------------------------------------------------------------------------
+-- Mega hack. Don't try to do this at home.
+-----------------------------------------------------------------------------
+-- we can't yield across calls to protect, so we rewrite it with coxpcall
+-- make sure you don't require any module that uses socket.protect before
+-- loading our hack
+function socket.protect(f)
+ return function(...)
+ local co = coroutine.create(f)
+ while true do
+ local results = {coroutine.resume(co, base.unpack(arg))}
+ local status = table.remove(results, 1)
+ if not status then
+ if type(results[1]) == 'table' then
+ return nil, results[1][1]
+ else base.error(results[1]) end
+ end
+ if coroutine.status(co) == "suspended" then
+ arg = {coroutine.yield(base.unpack(results))}
+ else
+ return base.unpack(results)
+ end
+ end
+ end
+end
+
+-----------------------------------------------------------------------------
+-- Simple set data structure. O(1) everything.
+-----------------------------------------------------------------------------
+local function newset()
+ local reverse = {}
+ local set = {}
+ return base.setmetatable(set, {__index = {
+ insert = function(set, value)
+ if not reverse[value] then
+ table.insert(set, value)
+ reverse[value] = table.getn(set)
+ end
+ end,
+ remove = function(set, value)
+ local index = reverse[value]
+ if index then
+ reverse[value] = nil
+ local top = table.remove(set)
+ if top ~= value then
+ reverse[top] = index
+ set[index] = top
+ end
+ end
+ end
+ }})
+end
+
+-----------------------------------------------------------------------------
+-- socket.tcp() wrapper for the coroutine dispatcher
+-----------------------------------------------------------------------------
+local function cowrap(dispatcher, tcp, error)
+ if not tcp then return nil, error end
+ -- put it in non-blocking mode right away
+ tcp:settimeout(0)
+ -- metatable for wrap produces new methods on demand for those that we
+ -- don't override explicitly.
+ local metat = { __index = function(table, key)
+ table[key] = function(...)
+ arg[1] = tcp
+ return tcp[key](base.unpack(arg))
+ end
+ return table[key]
+ end}
+ -- does our user want to do his own non-blocking I/O?
+ local zero = false
+ -- create a wrap object that will behave just like a real socket object
+ local wrap = { }
+ -- we ignore settimeout to preserve our 0 timeout, but record whether
+ -- the user wants to do his own non-blocking I/O
+ function wrap:settimeout(value, mode)
+ if value == 0 then zero = true
+ else zero = false end
+ return 1
+ end
+ -- send in non-blocking mode and yield on timeout
+ function wrap:send(data, first, last)
+ first = (first or 1) - 1
+ local result, error
+ while true do
+ -- return control to dispatcher and tell it we want to send
+ -- if upon return the dispatcher tells us we timed out,
+ -- return an error to whoever called us
+ if coroutine.yield(dispatcher.sending, tcp) == "timeout" then
+ return nil, "timeout"
+ end
+ -- try sending
+ result, error, first = tcp:send(data, first+1, last)
+ -- if we are done, or there was an unexpected error,
+ -- break away from loop
+ if error ~= "timeout" then return result, error, first end
+ end
+ end
+ -- receive in non-blocking mode and yield on timeout
+ -- or simply return partial read, if user requested timeout = 0
+ function wrap:receive(pattern, partial)
+ local error = "timeout"
+ local value
+ while true do
+ -- return control to dispatcher and tell it we want to receive
+ -- if upon return the dispatcher tells us we timed out,
+ -- return an error to whoever called us
+ if coroutine.yield(dispatcher.receiving, tcp) == "timeout" then
+ return nil, "timeout"
+ end
+ -- try receiving
+ value, error, partial = tcp:receive(pattern, partial)
+ -- if we are done, or there was an unexpected error,
+ -- break away from loop. also, if the user requested
+ -- zero timeout, return all we got
+ if (error ~= "timeout") or zero then
+ return value, error, partial
+ end
+ end
+ end
+ -- connect in non-blocking mode and yield on timeout
+ function wrap:connect(host, port)
+ local result, error = tcp:connect(host, port)
+ if error == "timeout" then
+ -- return control to dispatcher. we will be writable when
+ -- connection succeeds.
+ -- if upon return the dispatcher tells us we have a
+ -- timeout, just abort
+ if coroutine.yield(dispatcher.sending, tcp) == "timeout" then
+ return nil, "timeout"
+ end
+ -- when we come back, check if connection was successful
+ result, error = tcp:connect(host, port)
+ if result or error == "already connected" then return 1
+ else return nil, "non-blocking connect failed" end
+ else return result, error end
+ end
+ -- accept in non-blocking mode and yield on timeout
+ function wrap:accept()
+ while 1 do
+ -- return control to dispatcher. we will be readable when a
+ -- connection arrives.
+ -- if upon return the dispatcher tells us we have a
+ -- timeout, just abort
+ if coroutine.yield(dispatcher.receiving, tcp) == "timeout" then
+ return nil, "timeout"
+ end
+ local client, error = tcp:accept()
+ if error ~= "timeout" then
+ return cowrap(dispatcher, client, error)
+ end
+ end
+ end
+ -- remove cortn from context
+ function wrap:close()
+ dispatcher.stamp[tcp] = nil
+ dispatcher.sending.set:remove(tcp)
+ dispatcher.sending.cortn[tcp] = nil
+ dispatcher.receiving.set:remove(tcp)
+ dispatcher.receiving.cortn[tcp] = nil
+ return tcp:close()
+ end
+ return base.setmetatable(wrap, metat)
+end
+
+
+-----------------------------------------------------------------------------
+-- Our coroutine dispatcher
+-----------------------------------------------------------------------------
+local cometat = { __index = {} }
+
+function schedule(cortn, status, operation, tcp)
+ if status then
+ if cortn and operation then
+ operation.set:insert(tcp)
+ operation.cortn[tcp] = cortn
+ operation.stamp[tcp] = socket.gettime()
+ end
+ else base.error(operation) end
+end
+
+function kick(operation, tcp)
+ operation.cortn[tcp] = nil
+ operation.set:remove(tcp)
+end
+
+function wakeup(operation, tcp)
+ local cortn = operation.cortn[tcp]
+ -- if cortn is still valid, wake it up
+ if cortn then
+ kick(operation, tcp)
+ return cortn, coroutine.resume(cortn)
+ -- othrewise, just get scheduler not to do anything
+ else
+ return nil, true
+ end
+end
+
+function abort(operation, tcp)
+ local cortn = operation.cortn[tcp]
+ if cortn then
+ kick(operation, tcp)
+ coroutine.resume(cortn, "timeout")
+ end
+end
+
+-- step through all active cortns
+function cometat.__index:step()
+ -- check which sockets are interesting and act on them
+ local readable, writable = socket.select(self.receiving.set,
+ self.sending.set, 1)
+ -- for all readable connections, resume their cortns and reschedule
+ -- when they yield back to us
+ for _, tcp in base.ipairs(readable) do
+ schedule(wakeup(self.receiving, tcp))
+ end
+ -- for all writable connections, do the same
+ for _, tcp in base.ipairs(writable) do
+ schedule(wakeup(self.sending, tcp))
+ end
+ -- politely ask replacement I/O functions in idle cortns to
+ -- return reporting a timeout
+ local now = socket.gettime()
+ for tcp, stamp in base.pairs(self.stamp) do
+ if tcp.class == "tcp{client}" and now - stamp > TIMEOUT then
+ abort(self.sending, tcp)
+ abort(self.receiving, tcp)
+ end
+ end
+end
+
+function cometat.__index:start(func)
+ local cortn = coroutine.create(func)
+ schedule(cortn, coroutine.resume(cortn))
+end
+
+function handlert.coroutine()
+ local stamp = {}
+ local dispatcher = {
+ stamp = stamp,
+ sending = {
+ name = "sending",
+ set = newset(),
+ cortn = {},
+ stamp = stamp
+ },
+ receiving = {
+ name = "receiving",
+ set = newset(),
+ cortn = {},
+ stamp = stamp
+ },
+ }
+ function dispatcher.tcp()
+ return cowrap(dispatcher, socket.tcp())
+ end
+ return base.setmetatable(dispatcher, cometat)
+end
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/eol.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/eol.lua
new file mode 100644
index 00000000000..b90be79d8f9
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/eol.lua
@@ -0,0 +1,14 @@
+-----------------------------------------------------------------------------
+-- Little program to adjust end of line markers.
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: eol.lua,v 1.8 2005/11/22 08:33:29 diego Exp $
+-----------------------------------------------------------------------------
+local mime = require("mime")
+local ltn12 = require("ltn12")
+local marker = '\n'
+if arg and arg[1] == '-d' then marker = '\r\n' end
+local filter = mime.normalize(marker)
+local source = ltn12.source.chain(ltn12.source.file(io.stdin), filter)
+local sink = ltn12.sink.file(io.stdout)
+ltn12.pump.all(source, sink)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/forward.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/forward.lua
new file mode 100644
index 00000000000..9073ac4d0fa
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/forward.lua
@@ -0,0 +1,65 @@
+-- load our favourite library
+local dispatch = require("dispatch")
+local handler = dispatch.newhandler()
+
+-- make sure the user knows how to invoke us
+if table.getn(arg) < 1 then
+ print("Usage")
+ print(" lua forward.lua <iport:ohost:oport> ...")
+ os.exit(1)
+end
+
+-- function to move data from one socket to the other
+local function move(foo, bar)
+ local live
+ while 1 do
+ local data, error, partial = foo:receive(2048)
+ live = data or error == "timeout"
+ data = data or partial
+ local result, error = bar:send(data)
+ if not live or not result then
+ foo:close()
+ bar:close()
+ break
+ end
+ end
+end
+
+-- for each tunnel, start a new server
+for i, v in ipairs(arg) do
+ -- capture forwarding parameters
+ local _, _, iport, ohost, oport = string.find(v, "([^:]+):([^:]+):([^:]+)")
+ assert(iport, "invalid arguments")
+ -- create our server socket
+ local server = assert(handler.tcp())
+ assert(server:setoption("reuseaddr", true))
+ assert(server:bind("*", iport))
+ assert(server:listen(32))
+ -- handler for the server object loops accepting new connections
+ handler:start(function()
+ while 1 do
+ local client = assert(server:accept())
+ assert(client:settimeout(0))
+ -- for each new connection, start a new client handler
+ handler:start(function()
+ -- handler tries to connect to peer
+ local peer = assert(handler.tcp())
+ assert(peer:settimeout(0))
+ assert(peer:connect(ohost, oport))
+ -- if sucessful, starts a new handler to send data from
+ -- client to peer
+ handler:start(function()
+ move(client, peer)
+ end)
+ -- afte starting new handler, enter in loop sending data from
+ -- peer to client
+ move(peer, client)
+ end)
+ end
+ end)
+end
+
+-- simply loop stepping the server
+while 1 do
+ handler:step()
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/get.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/get.lua
new file mode 100644
index 00000000000..3df6a451262
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/get.lua
@@ -0,0 +1,142 @@
+-----------------------------------------------------------------------------
+-- Little program to download files from URLs
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: get.lua,v 1.25 2007/03/12 04:08:40 diego Exp $
+-----------------------------------------------------------------------------
+local socket = require("socket")
+local http = require("socket.http")
+local ftp = require("socket.ftp")
+local url = require("socket.url")
+local ltn12 = require("ltn12")
+
+-- formats a number of seconds into human readable form
+function nicetime(s)
+ local l = "s"
+ if s > 60 then
+ s = s / 60
+ l = "m"
+ if s > 60 then
+ s = s / 60
+ l = "h"
+ if s > 24 then
+ s = s / 24
+ l = "d" -- hmmm
+ end
+ end
+ end
+ if l == "s" then return string.format("%5.0f%s", s, l)
+ else return string.format("%5.2f%s", s, l) end
+end
+
+-- formats a number of bytes into human readable form
+function nicesize(b)
+ local l = "B"
+ if b > 1024 then
+ b = b / 1024
+ l = "KB"
+ if b > 1024 then
+ b = b / 1024
+ l = "MB"
+ if b > 1024 then
+ b = b / 1024
+ l = "GB" -- hmmm
+ end
+ end
+ end
+ return string.format("%7.2f%2s", b, l)
+end
+
+-- returns a string with the current state of the download
+local remaining_s = "%s received, %s/s throughput, %2.0f%% done, %s remaining"
+local elapsed_s = "%s received, %s/s throughput, %s elapsed "
+function gauge(got, delta, size)
+ local rate = got / delta
+ if size and size >= 1 then
+ return string.format(remaining_s, nicesize(got), nicesize(rate),
+ 100*got/size, nicetime((size-got)/rate))
+ else
+ return string.format(elapsed_s, nicesize(got),
+ nicesize(rate), nicetime(delta))
+ end
+end
+
+-- creates a new instance of a receive_cb that saves to disk
+-- kind of copied from luasocket's manual callback examples
+function stats(size)
+ local start = socket.gettime()
+ local last = start
+ local got = 0
+ return function(chunk)
+ -- elapsed time since start
+ local current = socket.gettime()
+ if chunk then
+ -- total bytes received
+ got = got + string.len(chunk)
+ -- not enough time for estimate
+ if current - last > 1 then
+ io.stderr:write("\r", gauge(got, current - start, size))
+ io.stderr:flush()
+ last = current
+ end
+ else
+ -- close up
+ io.stderr:write("\r", gauge(got, current - start), "\n")
+ end
+ return chunk
+ end
+end
+
+-- determines the size of a http file
+function gethttpsize(u)
+ local r, c, h = http.request {method = "HEAD", url = u}
+ if c == 200 then
+ return tonumber(h["content-length"])
+ end
+end
+
+-- downloads a file using the http protocol
+function getbyhttp(u, file)
+ local save = ltn12.sink.file(file or io.stdout)
+ -- only print feedback if output is not stdout
+ if file then save = ltn12.sink.chain(stats(gethttpsize(u)), save) end
+ local r, c, h, s = http.request {url = u, sink = save }
+ if c ~= 200 then io.stderr:write(s or c, "\n") end
+end
+
+-- downloads a file using the ftp protocol
+function getbyftp(u, file)
+ local save = ltn12.sink.file(file or io.stdout)
+ -- only print feedback if output is not stdout
+ -- and we don't know how big the file is
+ if file then save = ltn12.sink.chain(stats(), save) end
+ local gett = url.parse(u)
+ gett.sink = save
+ gett.type = "i"
+ local ret, err = ftp.get(gett)
+ if err then print(err) end
+end
+
+-- determines the scheme
+function getscheme(u)
+ -- this is an heuristic to solve a common invalid url poblem
+ if not string.find(u, "//") then u = "//" .. u end
+ local parsed = url.parse(u, {scheme = "http"})
+ return parsed.scheme
+end
+
+-- gets a file either by http or ftp, saving as <name>
+function get(u, name)
+ local fout = name and io.open(name, "wb")
+ local scheme = getscheme(u)
+ if scheme == "ftp" then getbyftp(u, fout)
+ elseif scheme == "http" then getbyhttp(u, fout)
+ else print("unknown scheme" .. scheme) end
+end
+
+-- main program
+arg = arg or {}
+if table.getn(arg) < 1 then
+ io.write("Usage:\n lua get.lua <remote-url> [<local-file>]\n")
+ os.exit(1)
+else get(arg[1], arg[2]) end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/lp.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/lp.lua
new file mode 100644
index 00000000000..32699209c6b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/lp.lua
@@ -0,0 +1,324 @@
+-----------------------------------------------------------------------------
+-- LPD support for the Lua language
+-- LuaSocket toolkit.
+-- Author: David Burgess
+-- Modified by Diego Nehab, but David is in charge
+-- RCS ID: $Id: lp.lua,v 1.14 2005/11/21 07:04:44 diego Exp $
+-----------------------------------------------------------------------------
+--[[
+ if you have any questions: RFC 1179
+]]
+-- make sure LuaSocket is loaded
+local io = require("io")
+local base = _G
+local os = require("os")
+local math = require("math")
+local string = require("string")
+local socket = require("socket")
+local ltn12 = require("ltn12")
+module("socket.lp")
+
+-- default port
+PORT = 515
+SERVER = os.getenv("SERVER_NAME") or os.getenv("COMPUTERNAME") or "localhost"
+PRINTER = os.getenv("PRINTER") or "printer"
+
+local function connect(localhost, option)
+ local host = option.host or SERVER
+ local port = option.port or PORT
+ local skt
+ local try = socket.newtry(function() if skt then skt:close() end end)
+ if option.localbind then
+ -- bind to a local port (if we can)
+ local localport = 721
+ local done, err
+ repeat
+ skt = socket.try(socket.tcp())
+ try(skt:settimeout(30))
+ done, err = skt:bind(localhost, localport)
+ if not done then
+ localport = localport + 1
+ skt:close()
+ skt = nil
+ else break end
+ until localport > 731
+ socket.try(skt, err)
+ else skt = socket.try(socket.tcp()) end
+ try(skt:connect(host, port))
+ return { skt = skt, try = try }
+end
+
+--[[
+RFC 1179
+5.3 03 - Send queue state (short)
+
+ +----+-------+----+------+----+
+ | 03 | Queue | SP | List | LF |
+ +----+-------+----+------+----+
+ Command code - 3
+ Operand 1 - Printer queue name
+ Other operands - User names or job numbers
+
+ If the user names or job numbers or both are supplied then only those
+ jobs for those users or with those numbers will be sent.
+
+ The response is an ASCII stream which describes the printer queue.
+ The stream continues until the connection closes. Ends of lines are
+ indicated with ASCII LF control characters. The lines may also
+ contain ASCII HT control characters.
+
+5.4 04 - Send queue state (long)
+
+ +----+-------+----+------+----+
+ | 04 | Queue | SP | List | LF |
+ +----+-------+----+------+----+
+ Command code - 4
+ Operand 1 - Printer queue name
+ Other operands - User names or job numbers
+
+ If the user names or job numbers or both are supplied then only those
+ jobs for those users or with those numbers will be sent.
+
+ The response is an ASCII stream which describes the printer queue.
+ The stream continues until the connection closes. Ends of lines are
+ indicated with ASCII LF control characters. The lines may also
+ contain ASCII HT control characters.
+]]
+
+-- gets server acknowledement
+local function recv_ack(con)
+ local ack = con.skt:receive(1)
+ con.try(string.char(0) == ack, "failed to receive server acknowledgement")
+end
+
+-- sends client acknowledement
+local function send_ack(con)
+ local sent = con.skt:send(string.char(0))
+ con.try(sent == 1, "failed to send acknowledgement")
+end
+
+-- sends queue request
+-- 5.2 02 - Receive a printer job
+--
+-- +----+-------+----+
+-- | 02 | Queue | LF |
+-- +----+-------+----+
+-- Command code - 2
+-- Operand - Printer queue name
+--
+-- Receiving a job is controlled by a second level of commands. The
+-- daemon is given commands by sending them over the same connection.
+-- The commands are described in the next section (6).
+--
+-- After this command is sent, the client must read an acknowledgement
+-- octet from the daemon. A positive acknowledgement is an octet of
+-- zero bits. A negative acknowledgement is an octet of any other
+-- pattern.
+local function send_queue(con, queue)
+ queue = queue or PRINTER
+ local str = string.format("\2%s\10", queue)
+ local sent = con.skt:send(str)
+ con.try(sent == string.len(str), "failed to send print request")
+ recv_ack(con)
+end
+
+-- sends control file
+-- 6.2 02 - Receive control file
+--
+-- +----+-------+----+------+----+
+-- | 02 | Count | SP | Name | LF |
+-- +----+-------+----+------+----+
+-- Command code - 2
+-- Operand 1 - Number of bytes in control file
+-- Operand 2 - Name of control file
+--
+-- The control file must be an ASCII stream with the ends of lines
+-- indicated by ASCII LF. The total number of bytes in the stream is
+-- sent as the first operand. The name of the control file is sent as
+-- the second. It should start with ASCII "cfA", followed by a three
+-- digit job number, followed by the host name which has constructed the
+-- control file. Acknowledgement processing must occur as usual after
+-- the command is sent.
+--
+-- The next "Operand 1" octets over the same TCP connection are the
+-- intended contents of the control file. Once all of the contents have
+-- been delivered, an octet of zero bits is sent as an indication that
+-- the file being sent is complete. A second level of acknowledgement
+-- processing must occur at this point.
+
+-- sends data file
+-- 6.3 03 - Receive data file
+--
+-- +----+-------+----+------+----+
+-- | 03 | Count | SP | Name | LF |
+-- +----+-------+----+------+----+
+-- Command code - 3
+-- Operand 1 - Number of bytes in data file
+-- Operand 2 - Name of data file
+--
+-- The data file may contain any 8 bit values at all. The total number
+-- of bytes in the stream may be sent as the first operand, otherwise
+-- the field should be cleared to 0. The name of the data file should
+-- start with ASCII "dfA". This should be followed by a three digit job
+-- number. The job number should be followed by the host name which has
+-- constructed the data file. Interpretation of the contents of the
+-- data file is determined by the contents of the corresponding control
+-- file. If a data file length has been specified, the next "Operand 1"
+-- octets over the same TCP connection are the intended contents of the
+-- data file. In this case, once all of the contents have been
+-- delivered, an octet of zero bits is sent as an indication that the
+-- file being sent is complete. A second level of acknowledgement
+-- processing must occur at this point.
+
+
+local function send_hdr(con, control)
+ local sent = con.skt:send(control)
+ con.try(sent and sent >= 1 , "failed to send header file")
+ recv_ack(con)
+end
+
+local function send_control(con, control)
+ local sent = con.skt:send(control)
+ con.try(sent and sent >= 1, "failed to send control file")
+ send_ack(con)
+end
+
+local function send_data(con,fh,size)
+ local buf
+ while size > 0 do
+ buf,message = fh:read(8192)
+ if buf then
+ st = con.try(con.skt:send(buf))
+ size = size - st
+ else
+ con.try(size == 0, "file size mismatch")
+ end
+ end
+ recv_ack(con) -- note the double acknowledgement
+ send_ack(con)
+ recv_ack(con)
+ return size
+end
+
+
+--[[
+local control_dflt = {
+ "H"..string.sub(socket.hostname,1,31).."\10", -- host
+ "C"..string.sub(socket.hostname,1,31).."\10", -- class
+ "J"..string.sub(filename,1,99).."\10", -- jobname
+ "L"..string.sub(user,1,31).."\10", -- print banner page
+ "I"..tonumber(indent).."\10", -- indent column count ('f' only)
+ "M"..string.sub(mail,1,128).."\10", -- mail when printed user@host
+ "N"..string.sub(filename,1,131).."\10", -- name of source file
+ "P"..string.sub(user,1,31).."\10", -- user name
+ "T"..string.sub(title,1,79).."\10", -- title for banner ('p' only)
+ "W"..tonumber(width or 132).."\10", -- width of print f,l,p only
+
+ "f"..file.."\10", -- formatted print (remove control chars)
+ "l"..file.."\10", -- print
+ "o"..file.."\10", -- postscript
+ "p"..file.."\10", -- pr format - requires T, L
+ "r"..file.."\10", -- fortran format
+ "U"..file.."\10", -- Unlink (data file only)
+}
+]]
+
+-- generate a varying job number
+local seq = 0
+local function newjob(connection)
+ seq = seq + 1
+ return math.floor(socket.gettime() * 1000 + seq)%1000
+end
+
+
+local format_codes = {
+ binary = 'l',
+ text = 'f',
+ ps = 'o',
+ pr = 'p',
+ fortran = 'r',
+ l = 'l',
+ r = 'r',
+ o = 'o',
+ p = 'p',
+ f = 'f'
+}
+
+-- lp.send{option}
+-- requires option.file
+
+send = socket.protect(function(option)
+ socket.try(option and base.type(option) == "table", "invalid options")
+ local file = option.file
+ socket.try(file, "invalid file name")
+ local fh = socket.try(io.open(file,"rb"))
+ local datafile_size = fh:seek("end") -- get total size
+ fh:seek("set") -- go back to start of file
+ local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME")
+ or "localhost"
+ local con = connect(localhost, option)
+-- format the control file
+ local jobno = newjob()
+ local localip = socket.dns.toip(localhost)
+ localhost = string.sub(localhost,1,31)
+ local user = string.sub(option.user or os.getenv("LPRUSER") or
+ os.getenv("USERNAME") or os.getenv("USER") or "anonymous", 1,31)
+ local lpfile = string.format("dfA%3.3d%-s", jobno, localhost);
+ local fmt = format_codes[option.format] or 'l'
+ local class = string.sub(option.class or localip or localhost,1,31)
+ local _,_,ctlfn = string.find(file,".*[%/%\\](.*)")
+ ctlfn = string.sub(ctlfn or file,1,131)
+ local cfile =
+ string.format("H%-s\nC%-s\nJ%-s\nP%-s\n%.1s%-s\nU%-s\nN%-s\n",
+ localhost,
+ class,
+ option.job or "LuaSocket",
+ user,
+ fmt, lpfile,
+ lpfile,
+ ctlfn); -- mandatory part of ctl file
+ if (option.banner) then cfile = cfile .. 'L'..user..'\10' end
+ if (option.indent) then cfile = cfile .. 'I'..base.tonumber(option.indent)..'\10' end
+ if (option.mail) then cfile = cfile .. 'M'..string.sub((option.mail),1,128)..'\10' end
+ if (fmt == 'p' and option.title) then cfile = cfile .. 'T'..string.sub((option.title),1,79)..'\10' end
+ if ((fmt == 'p' or fmt == 'l' or fmt == 'f') and option.width) then
+ cfile = cfile .. 'W'..base.tonumber(option,width)..'\10'
+ end
+
+ con.skt:settimeout(option.timeout or 65)
+-- send the queue header
+ send_queue(con, option.queue)
+-- send the control file header
+ local cfilecmd = string.format("\2%d cfA%3.3d%-s\n",string.len(cfile), jobno, localhost);
+ send_hdr(con,cfilecmd)
+
+-- send the control file
+ send_control(con,cfile)
+
+-- send the data file header
+ local dfilecmd = string.format("\3%d dfA%3.3d%-s\n",datafile_size, jobno, localhost);
+ send_hdr(con,dfilecmd)
+
+-- send the data file
+ send_data(con,fh,datafile_size)
+ fh:close()
+ con.skt:close();
+ return jobno, datafile_size
+end)
+
+--
+-- lp.query({host=,queue=printer|'*', format='l'|'s', list=})
+--
+query = socket.protect(function(p)
+ p = p or {}
+ local localhost = socket.dns.gethostname() or os.getenv("COMPUTERNAME")
+ or "localhost"
+ local con = connect(localhost,p)
+ local fmt
+ if string.sub(p.format or 's',1,1) == 's' then fmt = 3 else fmt = 4 end
+ con.try(con.skt:send(string.format("%c%s %s\n", fmt, p.queue or "*",
+ p.list or "")))
+ local data = con.try(con.skt:receive("*a"))
+ con.skt:close()
+ return data
+end)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/qp.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/qp.lua
new file mode 100644
index 00000000000..a4c0cad5933
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/qp.lua
@@ -0,0 +1,24 @@
+-----------------------------------------------------------------------------
+-- Little program to convert to and from Quoted-Printable
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: qp.lua,v 1.5 2004/06/17 21:46:22 diego Exp $
+-----------------------------------------------------------------------------
+local ltn12 = require("ltn12")
+local mime = require("mime")
+local convert
+arg = arg or {}
+local mode = arg and arg[1] or "-et"
+if mode == "-et" then
+ local normalize = mime.normalize()
+ local qp = mime.encode("quoted-printable")
+ local wrap = mime.wrap("quoted-printable")
+ convert = ltn12.filter.chain(normalize, qp, wrap)
+elseif mode == "-eb" then
+ local qp = mime.encode("quoted-printable", "binary")
+ local wrap = mime.wrap("quoted-printable")
+ convert = ltn12.filter.chain(qp, wrap)
+else convert = mime.decode("quoted-printable") end
+local source = ltn12.source.chain(ltn12.source.file(io.stdin), convert)
+local sink = ltn12.sink.file(io.stdout)
+ltn12.pump.all(source, sink)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/etc/tftp.lua b/Build/source/texk/web2c/luatexdir/luasocket/etc/tftp.lua
new file mode 100644
index 00000000000..94eaf3424d8
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/etc/tftp.lua
@@ -0,0 +1,155 @@
+-----------------------------------------------------------------------------
+-- TFTP support for the Lua language
+-- LuaSocket toolkit.
+-- Author: Diego Nehab
+-- RCS ID: $Id: tftp.lua,v 1.16 2005/11/22 08:33:29 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Load required files
+-----------------------------------------------------------------------------
+local base = _G
+local table = require("table")
+local math = require("math")
+local string = require("string")
+local socket = require("socket")
+local ltn12 = require("ltn12")
+local url = require("socket.url")
+module("socket.tftp")
+
+-----------------------------------------------------------------------------
+-- Program constants
+-----------------------------------------------------------------------------
+local char = string.char
+local byte = string.byte
+
+PORT = 69
+local OP_RRQ = 1
+local OP_WRQ = 2
+local OP_DATA = 3
+local OP_ACK = 4
+local OP_ERROR = 5
+local OP_INV = {"RRQ", "WRQ", "DATA", "ACK", "ERROR"}
+
+-----------------------------------------------------------------------------
+-- Packet creation functions
+-----------------------------------------------------------------------------
+local function RRQ(source, mode)
+ return char(0, OP_RRQ) .. source .. char(0) .. mode .. char(0)
+end
+
+local function WRQ(source, mode)
+ return char(0, OP_RRQ) .. source .. char(0) .. mode .. char(0)
+end
+
+local function ACK(block)
+ local low, high
+ low = math.mod(block, 256)
+ high = (block - low)/256
+ return char(0, OP_ACK, high, low)
+end
+
+local function get_OP(dgram)
+ local op = byte(dgram, 1)*256 + byte(dgram, 2)
+ return op
+end
+
+-----------------------------------------------------------------------------
+-- Packet analysis functions
+-----------------------------------------------------------------------------
+local function split_DATA(dgram)
+ local block = byte(dgram, 3)*256 + byte(dgram, 4)
+ local data = string.sub(dgram, 5)
+ return block, data
+end
+
+local function get_ERROR(dgram)
+ local code = byte(dgram, 3)*256 + byte(dgram, 4)
+ local msg
+ _,_, msg = string.find(dgram, "(.*)\000", 5)
+ return string.format("error code %d: %s", code, msg)
+end
+
+-----------------------------------------------------------------------------
+-- The real work
+-----------------------------------------------------------------------------
+local function tget(gett)
+ local retries, dgram, sent, datahost, dataport, code
+ local last = 0
+ socket.try(gett.host, "missing host")
+ local con = socket.try(socket.udp())
+ local try = socket.newtry(function() con:close() end)
+ -- convert from name to ip if needed
+ gett.host = try(socket.dns.toip(gett.host))
+ con:settimeout(1)
+ -- first packet gives data host/port to be used for data transfers
+ local path = string.gsub(gett.path or "", "^/", "")
+ path = url.unescape(path)
+ retries = 0
+ repeat
+ sent = try(con:sendto(RRQ(path, "octet"), gett.host, gett.port))
+ dgram, datahost, dataport = con:receivefrom()
+ retries = retries + 1
+ until dgram or datahost ~= "timeout" or retries > 5
+ try(dgram, datahost)
+ -- associate socket with data host/port
+ try(con:setpeername(datahost, dataport))
+ -- default sink
+ local sink = gett.sink or ltn12.sink.null()
+ -- process all data packets
+ while 1 do
+ -- decode packet
+ code = get_OP(dgram)
+ try(code ~= OP_ERROR, get_ERROR(dgram))
+ try(code == OP_DATA, "unhandled opcode " .. code)
+ -- get data packet parts
+ local block, data = split_DATA(dgram)
+ -- if not repeated, write
+ if block == last+1 then
+ try(sink(data))
+ last = block
+ end
+ -- last packet brings less than 512 bytes of data
+ if string.len(data) < 512 then
+ try(con:send(ACK(block)))
+ try(con:close())
+ try(sink(nil))
+ return 1
+ end
+ -- get the next packet
+ retries = 0
+ repeat
+ sent = try(con:send(ACK(last)))
+ dgram, err = con:receive()
+ retries = retries + 1
+ until dgram or err ~= "timeout" or retries > 5
+ try(dgram, err)
+ end
+end
+
+local default = {
+ port = PORT,
+ path ="/",
+ scheme = "tftp"
+}
+
+local function parse(u)
+ local t = socket.try(url.parse(u, default))
+ socket.try(t.scheme == "tftp", "invalid scheme '" .. t.scheme .. "'")
+ socket.try(t.host, "invalid host")
+ return t
+end
+
+local function sget(u)
+ local gett = parse(u)
+ local t = {}
+ gett.sink = ltn12.sink.table(t)
+ tget(gett)
+ return table.concat(t)
+end
+
+get = socket.protect(function(gett)
+ if base.type(gett) == "string" then return sget(gett)
+ else return tget(gett) end
+end)
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/luasocket.sln b/Build/source/texk/web2c/luatexdir/luasocket/luasocket.sln
new file mode 100644
index 00000000000..a674c33caab
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/luasocket.sln
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "socket", "socket.vcproj", "{66E3CE14-884D-4AEA-9F20-15A0BEAF8C5A}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mime", "mime.vcproj", "{128E8BD0-174A-48F0-8771-92B1E8D18713}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libluasocket", "libluasocket.vcproj", "{599EAD40-60EE-4043-9C14-AE090A8A092D}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {66E3CE14-884D-4AEA-9F20-15A0BEAF8C5A}.Debug.ActiveCfg = Debug|Win32
+ {66E3CE14-884D-4AEA-9F20-15A0BEAF8C5A}.Debug.Build.0 = Debug|Win32
+ {66E3CE14-884D-4AEA-9F20-15A0BEAF8C5A}.Release.ActiveCfg = Release|Win32
+ {66E3CE14-884D-4AEA-9F20-15A0BEAF8C5A}.Release.Build.0 = Release|Win32
+ {128E8BD0-174A-48F0-8771-92B1E8D18713}.Debug.ActiveCfg = Debug|Win32
+ {128E8BD0-174A-48F0-8771-92B1E8D18713}.Debug.Build.0 = Debug|Win32
+ {128E8BD0-174A-48F0-8771-92B1E8D18713}.Release.ActiveCfg = Release|Win32
+ {128E8BD0-174A-48F0-8771-92B1E8D18713}.Release.Build.0 = Release|Win32
+ {599EAD40-60EE-4043-9C14-AE090A8A092D}.Debug.ActiveCfg = Debug|Win32
+ {599EAD40-60EE-4043-9C14-AE090A8A092D}.Debug.Build.0 = Debug|Win32
+ {599EAD40-60EE-4043-9C14-AE090A8A092D}.Release.ActiveCfg = Release|Win32
+ {599EAD40-60EE-4043-9C14-AE090A8A092D}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/makefile b/Build/source/texk/web2c/luatexdir/luasocket/makefile
new file mode 100644
index 00000000000..6d700392a0a
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/makefile
@@ -0,0 +1,51 @@
+#------
+# Load configuration
+#
+include config
+
+#------
+# Hopefully no need to change anything below this line
+#
+INSTALL_SOCKET_SHARE=$(INSTALL_TOP_SHARE)/socket
+INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket
+INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime
+INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime
+
+all clean:
+ cd src; $(MAKE) $@
+
+#------
+# Files to install
+#
+TO_SOCKET_SHARE:= \
+ http.lua \
+ url.lua \
+ tp.lua \
+ ftp.lua \
+ smtp.lua
+
+TO_TOP_SHARE:= \
+ ltn12.lua \
+ socket.lua \
+ mime.lua
+
+TO_MIME_SHARE:=
+
+#------
+# Install LuaSocket according to recommendation
+#
+install: all
+ cd src; mkdir -p $(INSTALL_TOP_SHARE)
+ cd src; $(INSTALL_DATA) $(TO_TOP_SHARE) $(INSTALL_TOP_SHARE)
+ cd src; mkdir -p $(INSTALL_SOCKET_SHARE)
+ cd src; $(INSTALL_DATA) $(TO_SOCKET_SHARE) $(INSTALL_SOCKET_SHARE)
+ cd src; mkdir -p $(INSTALL_SOCKET_LIB)
+ cd src; $(INSTALL_EXEC) $(SOCKET_SO) $(INSTALL_SOCKET_LIB)/core.$(EXT)
+ #cd src; mkdir -p $(INSTALL_MIME_SHARE)
+ #cd src; $(INSTALL_DATA) $(TO_MIME_SHARE) $(INSTALL_MIME_SHARE)
+ cd src; mkdir -p $(INSTALL_MIME_LIB)
+ cd src; $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(EXT)
+
+#------
+# End of makefile
+#
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/mime.vcproj b/Build/source/texk/web2c/luatexdir/luasocket/mime.vcproj
new file mode 100644
index 00000000000..8ad790040ba
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/mime.vcproj
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="mime"
+ ProjectGUID="{128E8BD0-174A-48F0-8771-92B1E8D18713}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="src"
+ IntermediateDirectory="src"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="h:\include\lua5.1"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MIME_EXPORTS;MIME_API=__declspec(dllexport)"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/mime.dll"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="h:\lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/mime.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/mime.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="src"
+ IntermediateDirectory="src"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="h:\include\lua5.1"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MIME_EXPORTS; MIME_API=__declspec(dllexport)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/mime.dll"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="h:\lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/mime.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="src\mime.c">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ <File
+ RelativePath="..\..\lib\lua5.1.dll.lib">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/README b/Build/source/texk/web2c/luatexdir/luasocket/samples/README
new file mode 100644
index 00000000000..e63a6f52147
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/README
@@ -0,0 +1,50 @@
+This directory contains some sample programs using
+LuaSocket. This code is not supported.
+
+ listener.lua -- socket to stdout
+ talker.lua -- stdin to socket
+
+listener.lua and talker.lua are about the simplest
+applications you can write using LuaSocket. Run
+
+ 'lua listener.lua' and 'lua talker.lua'
+
+on different terminals. Whatever you type on talk.lua will
+be printed by listen.lua.
+
+ lpr.lua -- lpr client
+
+This is a cool program written by David Burgess to print
+files using the Line Printer Daemon protocol, widely used in
+Unix machines. It uses the lp.lua implementation, in the
+etc directory. Just run 'lua lpr.lua <filename>
+queue=<printername>' and the file will print!
+
+ cddb.lua -- CDDB client
+
+This is the first try on a simple CDDB client. Not really
+useful, but one day it might become a module.
+
+ daytimeclnt.lua -- day time client
+
+Just run the program to retrieve the hour and date in
+readable form from any server running an UDP daytime daemon.
+
+ echoclnt.lua -- UDP echo client
+ echosrvr.lua -- UDP echo server
+
+These are a UDP echo client/server pair. They work with
+other client and servers as well.
+
+ tinyirc.lua -- irc like broadcast server
+
+This is a simple server that waits simultaneously on two
+server sockets for telnet connections. Everything it
+receives from the telnet clients is broadcasted to every
+other connected client. It tests the select function and
+shows how to create a simple server whith LuaSocket. Just
+run tinyirc.lua and then open as many telnet connections
+as you want to ports 8080 and 8081.
+
+Good luck,
+Diego.
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua
new file mode 100644
index 00000000000..883730c3a4c
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua
@@ -0,0 +1,46 @@
+local socket = require("socket")
+local http = require("socket.http")
+
+if not arg or not arg[1] or not arg[2] then
+ print("luasocket cddb.lua <category> <disc-id> [<server>]")
+ os.exit(1)
+end
+
+local server = arg[3] or "http://freedb.freedb.org/~cddb/cddb.cgi"
+
+function parse(body)
+ local lines = string.gfind(body, "(.-)\r\n")
+ local status = lines()
+ local code, message = socket.skip(2, string.find(status, "(%d%d%d) (.*)"))
+ if tonumber(code) ~= 210 then
+ return nil, code, message
+ end
+ local data = {}
+ for l in lines do
+ local c = string.sub(l, 1, 1)
+ if c ~= '#' and c ~= '.' then
+ local key, value = socket.skip(2, string.find(l, "(.-)=(.*)"))
+ value = string.gsub(value, "\\n", "\n")
+ value = string.gsub(value, "\\\\", "\\")
+ value = string.gsub(value, "\\t", "\t")
+ data[key] = value
+ end
+ end
+ return data, code, message
+end
+
+local host = socket.dns.gethostname()
+local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6"
+local url = string.format(query, server, arg[1], arg[2], host)
+local body, headers, code = http.get(url)
+
+if code == 200 then
+ local data, code, error = parse(body)
+ if not data then
+ print(error or code)
+ else
+ for i,v in pairs(data) do
+ io.write(i, ': ', v, '\n')
+ end
+ end
+else print(error) end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/daytimeclnt.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/daytimeclnt.lua
new file mode 100644
index 00000000000..90ab39e9713
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/daytimeclnt.lua
@@ -0,0 +1,23 @@
+-----------------------------------------------------------------------------
+-- UDP sample: daytime protocol client
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: daytimeclnt.lua,v 1.11 2004/06/21 06:07:57 diego Exp $
+-----------------------------------------------------------------------------
+local socket = require"socket"
+host = host or "127.0.0.1"
+port = port or 13
+if arg then
+ host = arg[1] or host
+ port = arg[2] or port
+end
+host = socket.dns.toip(host)
+udp = socket.udp()
+print("Using host '" ..host.. "' and port " ..port.. "...")
+udp:setpeername(host, port)
+udp:settimeout(3)
+sent, err = udp:send("anything")
+if err then print(err) os.exit() end
+dgram, err = udp:receive()
+if not dgram then print(err) os.exit() end
+io.write(dgram)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/echoclnt.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/echoclnt.lua
new file mode 100644
index 00000000000..038be4c239d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/echoclnt.lua
@@ -0,0 +1,24 @@
+-----------------------------------------------------------------------------
+-- UDP sample: echo protocol client
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: echoclnt.lua,v 1.10 2005/01/02 22:44:00 diego Exp $
+-----------------------------------------------------------------------------
+local socket = require("socket")
+host = host or "localhost"
+port = port or 7
+if arg then
+ host = arg[1] or host
+ port = arg[2] or port
+end
+host = socket.dns.toip(host)
+udp = assert(socket.udp())
+assert(udp:setpeername(host, port))
+print("Using remote host '" ..host.. "' and port " .. port .. "...")
+while 1 do
+ line = io.read()
+ if not line or line == "" then os.exit() end
+ assert(udp:send(line))
+ dgram = assert(udp:receive())
+ print(dgram)
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/echosrvr.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/echosrvr.lua
new file mode 100644
index 00000000000..2697ca46d69
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/echosrvr.lua
@@ -0,0 +1,29 @@
+-----------------------------------------------------------------------------
+-- UDP sample: echo protocol server
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: echosrvr.lua,v 1.12 2005/11/22 08:33:29 diego Exp $
+-----------------------------------------------------------------------------
+local socket = require("socket")
+host = host or "127.0.0.1"
+port = port or 7
+if arg then
+ host = arg[1] or host
+ port = arg[2] or port
+end
+print("Binding to host '" ..host.. "' and port " ..port.. "...")
+udp = assert(socket.udp())
+assert(udp:setsockname(host, port))
+assert(udp:settimeout(5))
+ip, port = udp:getsockname()
+assert(ip, port)
+print("Waiting packets on " .. ip .. ":" .. port .. "...")
+while 1 do
+ dgram, ip, port = udp:receivefrom()
+ if dgram then
+ print("Echoing '" .. dgram .. "' to " .. ip .. ":" .. port)
+ udp:sendto(dgram, ip, port)
+ else
+ print(ip)
+ end
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/listener.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/listener.lua
new file mode 100644
index 00000000000..9260fbb0f35
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/listener.lua
@@ -0,0 +1,26 @@
+-----------------------------------------------------------------------------
+-- TCP sample: Little program to dump lines received at a given port
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: listener.lua,v 1.11 2005/01/02 22:44:00 diego Exp $
+-----------------------------------------------------------------------------
+local socket = require("socket")
+host = host or "*"
+port = port or 8080
+if arg then
+ host = arg[1] or host
+ port = arg[2] or port
+end
+print("Binding to host '" ..host.. "' and port " ..port.. "...")
+s = assert(socket.bind(host, port))
+i, p = s:getsockname()
+assert(i, p)
+print("Waiting connection from talker on " .. i .. ":" .. p .. "...")
+c = assert(s:accept())
+print("Connected. Here is the stuff:")
+l, e = c:receive()
+while not e do
+ print(l)
+ l, e = c:receive()
+end
+print(e)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/lpr.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/lpr.lua
new file mode 100644
index 00000000000..2b059b15871
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/lpr.lua
@@ -0,0 +1,51 @@
+local lp = require("socket.lp")
+
+local function usage()
+ print('\nUsage: lua lpr.lua [filename] [keyword=val...]\n')
+ print('Valid keywords are :')
+ print(
+ ' host=remote host or IP address (default "localhost")\n' ..
+ ' queue=remote queue or printer name (default "printer")\n' ..
+ ' port=remote port number (default 515)\n' ..
+ ' user=sending user name\n' ..
+ ' format=["binary" | "text" | "ps" | "pr" | "fortran"] (default "binary")\n' ..
+ ' banner=true|false\n' ..
+ ' indent=number of columns to indent\n' ..
+ ' mail=email of address to notify when print is complete\n' ..
+ ' title=title to use for "pr" format\n' ..
+ ' width=width for "text" or "pr" formats\n' ..
+ ' class=\n' ..
+ ' job=\n' ..
+ ' name=\n' ..
+ ' localbind=true|false\n'
+ )
+ return nil
+end
+
+if not arg or not arg[1] then
+ return usage()
+end
+
+do
+ local opt = {}
+ local pat = "[%s%c%p]*([%w]*)=([\"]?[%w%s_!@#$%%^&*()<>:;]+[\"]\?\.?)"
+ for i = 2, table.getn(arg), 1 do
+ string.gsub(arg[i], pat, function(name, value) opt[name] = value end)
+ end
+ if not arg[2] then
+ return usage()
+ end
+ if arg[1] ~= "query" then
+ opt.file = arg[1]
+ r,e=lp.send(opt)
+ io.stdout:write(tostring(r or e),'\n')
+ else
+ r,e=lp.query(opt)
+ io.stdout:write(tostring(r or e), '\n')
+ end
+end
+
+-- trivial tests
+--lua lp.lua lp.lua queue=default host=localhost
+--lua lp.lua lp.lua queue=default host=localhost format=binary localbind=1
+--lua lp.lua query queue=default host=localhost
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/talker.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/talker.lua
new file mode 100644
index 00000000000..607ff31989b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/talker.lua
@@ -0,0 +1,21 @@
+-----------------------------------------------------------------------------
+-- TCP sample: Little program to send text lines to a given host/port
+-- LuaSocket sample files
+-- Author: Diego Nehab
+-- RCS ID: $Id: talker.lua,v 1.9 2005/01/02 22:44:00 diego Exp $
+-----------------------------------------------------------------------------
+local socket = require("socket")
+host = host or "localhost"
+port = port or 8080
+if arg then
+ host = arg[1] or host
+ port = arg[2] or port
+end
+print("Attempting connection to host '" ..host.. "' and port " ..port.. "...")
+c = assert(socket.connect(host, port))
+print("Connected! Please type stuff (empty line to stop):")
+l = io.read()
+while l and l ~= "" and not e do
+ assert(c:send(l .. "\n"))
+ l = io.read()
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/tinyirc.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/tinyirc.lua
new file mode 100644
index 00000000000..f474302e0a2
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/samples/tinyirc.lua
@@ -0,0 +1,90 @@
+-----------------------------------------------------------------------------
+-- Select sample: simple text line server
+-- LuaSocket sample files.
+-- Author: Diego Nehab
+-- RCS ID: $Id: tinyirc.lua,v 1.14 2005/11/22 08:33:29 diego Exp $
+-----------------------------------------------------------------------------
+local socket = require("socket")
+host = host or "*"
+port1 = port1 or 8080
+port2 = port2 or 8181
+if arg then
+ host = arg[1] or host
+ port1 = arg[2] or port1
+ port2 = arg[3] or port2
+end
+
+server1 = assert(socket.bind(host, port1))
+server2 = assert(socket.bind(host, port2))
+server1:settimeout(1) -- make sure we don't block in accept
+server2:settimeout(1)
+
+io.write("Servers bound\n")
+
+-- simple set implementation
+-- the select function doesn't care about what is passed to it as long as
+-- it behaves like a table
+-- creates a new set data structure
+function newset()
+ local reverse = {}
+ local set = {}
+ return setmetatable(set, {__index = {
+ insert = function(set, value)
+ if not reverse[value] then
+ table.insert(set, value)
+ reverse[value] = table.getn(set)
+ end
+ end,
+ remove = function(set, value)
+ local index = reverse[value]
+ if index then
+ reverse[value] = nil
+ local top = table.remove(set)
+ if top ~= value then
+ reverse[top] = index
+ set[index] = top
+ end
+ end
+ end
+ }})
+end
+
+set = newset()
+
+io.write("Inserting servers in set\n")
+set:insert(server1)
+set:insert(server2)
+
+while 1 do
+ local readable, _, error = socket.select(set, nil)
+ for _, input in ipairs(readable) do
+ -- is it a server socket?
+ if input == server1 or input == server2 then
+ io.write("Waiting for clients\n")
+ local new = input:accept()
+ if new then
+ new:settimeout(1)
+ io.write("Inserting client in set\n")
+ set:insert(new)
+ end
+ -- it is a client socket
+ else
+ local line, error = input:receive()
+ if error then
+ input:close()
+ io.write("Removing client from set\n")
+ set:remove(input)
+ else
+ io.write("Broadcasting line '", line, "'\n")
+ writable, error = socket.skip(1, socket.select(nil, set, 1))
+ if not error then
+ for __, output in ipairs(writable) do
+ if output ~= input then
+ output:send(line .. "\n")
+ end
+ end
+ else io.write("No client ready to receive!!!\n") end
+ end
+ end
+ end
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/socket.vcproj b/Build/source/texk/web2c/luatexdir/luasocket/socket.vcproj
new file mode 100644
index 00000000000..b7c4a083297
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/socket.vcproj
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="socket"
+ ProjectGUID="{66E3CE14-884D-4AEA-9F20-15A0BEAF8C5A}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="src"
+ IntermediateDirectory="src"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="h:\include\lua5.1"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LUASOCKET_EXPORTS;LUASOCKET_API=__declspec(dllexport)"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib"
+ OutputFile="$(OutDir)/socket.dll"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="h:\lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/socket.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/socket.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="./src"
+ IntermediateDirectory="./src"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="h:\include\lua5.1"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LUASOCKET_EXPORTS;LUASOCKET_API=__declspec(dllexport); LUASOCKET_DEBUG"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib"
+ OutputFile="$(OutDir)/socket.dll"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="h:\lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/socket.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="src\auxiliar.c">
+ </File>
+ <File
+ RelativePath="src\buffer.c">
+ </File>
+ <File
+ RelativePath="src\except.c">
+ </File>
+ <File
+ RelativePath="src\inet.c">
+ </File>
+ <File
+ RelativePath="src\io.c">
+ </File>
+ <File
+ RelativePath="src\luasocket.c">
+ </File>
+ <File
+ RelativePath="src\options.c">
+ </File>
+ <File
+ RelativePath="src\select.c">
+ </File>
+ <File
+ RelativePath="src\tcp.c">
+ </File>
+ <File
+ RelativePath="src\timeout.c">
+ </File>
+ <File
+ RelativePath="src\udp.c">
+ </File>
+ <File
+ RelativePath="src\wsocket.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ GeneratePreprocessedFile="0"/>
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ <File
+ RelativePath="..\..\lib\lua5.1.dll.lib">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/Makefile b/Build/source/texk/web2c/luatexdir/luasocket/src/Makefile
new file mode 100644
index 00000000000..f42d62047c5
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/Makefile
@@ -0,0 +1,63 @@
+
+SOCKET_SO=socket.a
+
+INSTALL_TOP_SHARE=/usr/local/share/lua/5.1
+INSTALL_TOP_LIB=/usr/local/lib/lua/5.1
+
+LUAINC = -I../../lua51
+
+DEF = -DLUASOCKET_DEBUG
+CFLAGS = $(LUAINC) $(DEF) $(XCFLAGS)
+AR=ar
+ARFLAGS=rc
+
+SOCKET_OBJS:= \
+ luasocket.o \
+ timeout.o \
+ buffer.o \
+ io.o \
+ auxiliar.o \
+ options.o \
+ inet.o \
+ tcp.o \
+ udp.o \
+ except.o \
+ select.o \
+ socket.o \
+ mime.o \
+ lua_preload.o
+
+all: $(SOCKET_SO)
+
+$(SOCKET_SO): $(SOCKET_OBJS)
+ $(AR) $(ARFLAGS) $@ $(SOCKET_OBJS)
+
+#------
+# List of dependencies
+#
+auxiliar.o: auxiliar.c auxiliar.h
+buffer.o: buffer.c buffer.h io.h timeout.h
+except.o: except.c except.h
+inet.o: inet.c inet.h socket.h io.h timeout.h usocket.h
+io.o: io.c io.h timeout.h
+luasocket.o: luasocket.c luasocket.h auxiliar.h except.h timeout.h \
+ buffer.h io.h inet.h socket.h usocket.h tcp.h udp.h select.h
+mime.o: mime.c mime.h
+options.o: options.c auxiliar.h options.h socket.h io.h timeout.h \
+ usocket.h inet.h
+select.o: select.c socket.h io.h timeout.h usocket.h select.h
+tcp.o: tcp.c auxiliar.h socket.h io.h timeout.h usocket.h inet.h \
+ options.h tcp.h buffer.h
+timeout.o: timeout.c auxiliar.h timeout.h
+udp.o: udp.c auxiliar.h socket.h io.h timeout.h usocket.h inet.h \
+ options.h udp.h
+unix.o: unix.c auxiliar.h socket.h io.h timeout.h usocket.h options.h \
+ unix.h buffer.h
+usocket.o: usocket.c socket.h io.h timeout.h usocket.h
+
+clean:
+ rm -f $(SOCKET_SO) $(SOCKET_OBJS)
+
+#------
+# End of makefile configuration
+#
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.c b/Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.c
new file mode 100644
index 00000000000..9514970119f
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.c
@@ -0,0 +1,149 @@
+/*=========================================================================*\
+* Auxiliar routines for class hierarchy manipulation
+* LuaSocket toolkit
+*
+* RCS ID: $Id: auxiliar.c,v 1.14 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+#include <stdio.h>
+
+#include "auxiliar.h"
+
+/*=========================================================================*\
+* Exported functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Initializes the module
+\*-------------------------------------------------------------------------*/
+int auxiliar_open(lua_State *L) {
+ (void) L;
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Creates a new class with given methods
+* Methods whose names start with __ are passed directly to the metatable.
+\*-------------------------------------------------------------------------*/
+void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func) {
+ luaL_newmetatable(L, classname); /* mt */
+ /* create __index table to place methods */
+ lua_pushstring(L, "__index"); /* mt,"__index" */
+ lua_newtable(L); /* mt,"__index",it */
+ /* put class name into class metatable */
+ lua_pushstring(L, "class"); /* mt,"__index",it,"class" */
+ lua_pushstring(L, classname); /* mt,"__index",it,"class",classname */
+ lua_rawset(L, -3); /* mt,"__index",it */
+ /* pass all methods that start with _ to the metatable, and all others
+ * to the index table */
+ for (; func->name; func++) { /* mt,"__index",it */
+ lua_pushstring(L, func->name);
+ lua_pushcfunction(L, func->func);
+ lua_rawset(L, func->name[0] == '_' ? -5: -3);
+ }
+ lua_rawset(L, -3); /* mt */
+ lua_pop(L, 1);
+}
+
+/*-------------------------------------------------------------------------*\
+* Prints the value of a class in a nice way
+\*-------------------------------------------------------------------------*/
+int auxiliar_tostring(lua_State *L) {
+ char buf[32];
+ if (!lua_getmetatable(L, 1)) goto error;
+ lua_pushstring(L, "__index");
+ lua_gettable(L, -2);
+ if (!lua_istable(L, -1)) goto error;
+ lua_pushstring(L, "class");
+ lua_gettable(L, -2);
+ if (!lua_isstring(L, -1)) goto error;
+ sprintf(buf, "%p", lua_touserdata(L, 1));
+ lua_pushfstring(L, "%s: %s", lua_tostring(L, -1), buf);
+ return 1;
+error:
+ lua_pushstring(L, "invalid object passed to 'auxiliar.c:__tostring'");
+ lua_error(L);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Insert class into group
+\*-------------------------------------------------------------------------*/
+void auxiliar_add2group(lua_State *L, const char *classname, const char *groupname) {
+ luaL_getmetatable(L, classname);
+ lua_pushstring(L, groupname);
+ lua_pushboolean(L, 1);
+ lua_rawset(L, -3);
+ lua_pop(L, 1);
+}
+
+/*-------------------------------------------------------------------------*\
+* Make sure argument is a boolean
+\*-------------------------------------------------------------------------*/
+int auxiliar_checkboolean(lua_State *L, int objidx) {
+ if (!lua_isboolean(L, objidx))
+ luaL_typerror(L, objidx, lua_typename(L, LUA_TBOOLEAN));
+ return lua_toboolean(L, objidx);
+}
+
+/*-------------------------------------------------------------------------*\
+* Return userdata pointer if object belongs to a given class, abort with
+* error otherwise
+\*-------------------------------------------------------------------------*/
+void *auxiliar_checkclass(lua_State *L, const char *classname, int objidx) {
+ void *data = auxiliar_getclassudata(L, classname, objidx);
+ if (!data) {
+ char msg[45];
+ sprintf(msg, "%.35s expected", classname);
+ luaL_argerror(L, objidx, msg);
+ }
+ return data;
+}
+
+/*-------------------------------------------------------------------------*\
+* Return userdata pointer if object belongs to a given group, abort with
+* error otherwise
+\*-------------------------------------------------------------------------*/
+void *auxiliar_checkgroup(lua_State *L, const char *groupname, int objidx) {
+ void *data = auxiliar_getgroupudata(L, groupname, objidx);
+ if (!data) {
+ char msg[45];
+ sprintf(msg, "%.35s expected", groupname);
+ luaL_argerror(L, objidx, msg);
+ }
+ return data;
+}
+
+/*-------------------------------------------------------------------------*\
+* Set object class
+\*-------------------------------------------------------------------------*/
+void auxiliar_setclass(lua_State *L, const char *classname, int objidx) {
+ luaL_getmetatable(L, classname);
+ if (objidx < 0) objidx--;
+ lua_setmetatable(L, objidx);
+}
+
+/*-------------------------------------------------------------------------*\
+* Get a userdata pointer if object belongs to a given group. Return NULL
+* otherwise
+\*-------------------------------------------------------------------------*/
+void *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx) {
+ if (!lua_getmetatable(L, objidx))
+ return NULL;
+ lua_pushstring(L, groupname);
+ lua_rawget(L, -2);
+ if (lua_isnil(L, -1)) {
+ lua_pop(L, 2);
+ return NULL;
+ } else {
+ lua_pop(L, 2);
+ return lua_touserdata(L, objidx);
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Get a userdata pointer if object belongs to a given class. Return NULL
+* otherwise
+\*-------------------------------------------------------------------------*/
+void *auxiliar_getclassudata(lua_State *L, const char *classname, int objidx) {
+ return luaL_checkudata(L, objidx, classname);
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.h b/Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.h
new file mode 100644
index 00000000000..18b849554ff
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/auxiliar.h
@@ -0,0 +1,48 @@
+#ifndef AUXILIAR_H
+#define AUXILIAR_H
+/*=========================================================================*\
+* Auxiliar routines for class hierarchy manipulation
+* LuaSocket toolkit (but completely independent of other LuaSocket modules)
+*
+* A LuaSocket class is a name associated with Lua metatables. A LuaSocket
+* group is a name associated with a class. A class can belong to any number
+* of groups. This module provides the functionality to:
+*
+* - create new classes
+* - add classes to groups
+* - set the class of objects
+* - check if an object belongs to a given class or group
+* - get the userdata associated to objects
+* - print objects in a pretty way
+*
+* LuaSocket class names follow the convention <module>{<class>}. Modules
+* can define any number of classes and groups. The module tcp.c, for
+* example, defines the classes tcp{master}, tcp{client} and tcp{server} and
+* the groups tcp{client,server} and tcp{any}. Module functions can then
+* perform type-checking on their arguments by either class or group.
+*
+* LuaSocket metatables define the __index metamethod as being a table. This
+* table has one field for each method supported by the class, and a field
+* "class" with the class name.
+*
+* The mapping from class name to the corresponding metatable and the
+* reverse mapping are done using lauxlib.
+*
+* RCS ID: $Id: auxiliar.h,v 1.9 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int auxiliar_open(lua_State *L);
+void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func);
+void auxiliar_add2group(lua_State *L, const char *classname, const char *group);
+void auxiliar_setclass(lua_State *L, const char *classname, int objidx);
+void *auxiliar_checkclass(lua_State *L, const char *classname, int objidx);
+void *auxiliar_checkgroup(lua_State *L, const char *groupname, int objidx);
+void *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx);
+void *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx);
+int auxiliar_checkboolean(lua_State *L, int objidx);
+int auxiliar_tostring(lua_State *L);
+
+#endif /* AUXILIAR_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/buffer.c b/Build/source/texk/web2c/luatexdir/luasocket/src/buffer.c
new file mode 100644
index 00000000000..73f4ffa85e6
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/buffer.c
@@ -0,0 +1,268 @@
+/*=========================================================================*\
+* Input/Output interface for Lua programs
+* LuaSocket toolkit
+*
+* RCS ID: $Id: buffer.c,v 1.28 2007/06/11 23:44:54 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "buffer.h"
+
+/*=========================================================================*\
+* Internal function prototypes
+\*=========================================================================*/
+static int recvraw(p_buffer buf, size_t wanted, luaL_Buffer *b);
+static int recvline(p_buffer buf, luaL_Buffer *b);
+static int recvall(p_buffer buf, luaL_Buffer *b);
+static int buffer_get(p_buffer buf, const char **data, size_t *count);
+static void buffer_skip(p_buffer buf, size_t count);
+static int sendraw(p_buffer buf, const char *data, size_t count, size_t *sent);
+
+/* min and max macros */
+#ifndef MIN
+#define MIN(x, y) ((x) < (y) ? x : y)
+#endif
+#ifndef MAX
+#define MAX(x, y) ((x) > (y) ? x : y)
+#endif
+
+/*=========================================================================*\
+* Exported functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int buffer_open(lua_State *L) {
+ (void) L;
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Initializes C structure
+\*-------------------------------------------------------------------------*/
+void buffer_init(p_buffer buf, p_io io, p_timeout tm) {
+ buf->first = buf->last = 0;
+ buf->io = io;
+ buf->tm = tm;
+ buf->received = buf->sent = 0;
+ buf->birthday = timeout_gettime();
+}
+
+/*-------------------------------------------------------------------------*\
+* object:getstats() interface
+\*-------------------------------------------------------------------------*/
+int buffer_meth_getstats(lua_State *L, p_buffer buf) {
+ lua_pushnumber(L, buf->received);
+ lua_pushnumber(L, buf->sent);
+ lua_pushnumber(L, timeout_gettime() - buf->birthday);
+ return 3;
+}
+
+/*-------------------------------------------------------------------------*\
+* object:setstats() interface
+\*-------------------------------------------------------------------------*/
+int buffer_meth_setstats(lua_State *L, p_buffer buf) {
+ buf->received = (long) luaL_optnumber(L, 2, buf->received);
+ buf->sent = (long) luaL_optnumber(L, 3, buf->sent);
+ if (lua_isnumber(L, 4)) buf->birthday = timeout_gettime() - lua_tonumber(L, 4);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* object:send() interface
+\*-------------------------------------------------------------------------*/
+int buffer_meth_send(lua_State *L, p_buffer buf) {
+ int top = lua_gettop(L);
+ int err = IO_DONE;
+ size_t size = 0, sent = 0;
+ const char *data = luaL_checklstring(L, 2, &size);
+ long start = (long) luaL_optnumber(L, 3, 1);
+ long end = (long) luaL_optnumber(L, 4, -1);
+ p_timeout tm = timeout_markstart(buf->tm);
+ if (start < 0) start = (long) (size+start+1);
+ if (end < 0) end = (long) (size+end+1);
+ if (start < 1) start = (long) 1;
+ if (end > (long) size) end = (long) size;
+ if (start <= end) err = sendraw(buf, data+start-1, end-start+1, &sent);
+ /* check if there was an error */
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, buf->io->error(buf->io->ctx, err));
+ lua_pushnumber(L, sent+start-1);
+ } else {
+ lua_pushnumber(L, sent+start-1);
+ lua_pushnil(L);
+ lua_pushnil(L);
+ }
+#ifdef LUASOCKET_DEBUG
+ /* push time elapsed during operation as the last return value */
+ lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));
+#endif
+ return lua_gettop(L) - top;
+}
+
+/*-------------------------------------------------------------------------*\
+* object:receive() interface
+\*-------------------------------------------------------------------------*/
+int buffer_meth_receive(lua_State *L, p_buffer buf) {
+ int err = IO_DONE, top = lua_gettop(L);
+ luaL_Buffer b;
+ size_t size;
+ const char *part = luaL_optlstring(L, 3, "", &size);
+ p_timeout tm = timeout_markstart(buf->tm);
+ /* initialize buffer with optional extra prefix
+ * (useful for concatenating previous partial results) */
+ luaL_buffinit(L, &b);
+ luaL_addlstring(&b, part, size);
+ /* receive new patterns */
+ if (!lua_isnumber(L, 2)) {
+ const char *p= luaL_optstring(L, 2, "*l");
+ if (p[0] == '*' && p[1] == 'l') err = recvline(buf, &b);
+ else if (p[0] == '*' && p[1] == 'a') err = recvall(buf, &b);
+ else luaL_argcheck(L, 0, 2, "invalid receive pattern");
+ /* get a fixed number of bytes (minus what was already partially
+ * received) */
+ } else err = recvraw(buf, (size_t) lua_tonumber(L, 2)-size, &b);
+ /* check if there was an error */
+ if (err != IO_DONE) {
+ /* we can't push anyting in the stack before pushing the
+ * contents of the buffer. this is the reason for the complication */
+ luaL_pushresult(&b);
+ lua_pushstring(L, buf->io->error(buf->io->ctx, err));
+ lua_pushvalue(L, -2);
+ lua_pushnil(L);
+ lua_replace(L, -4);
+ } else {
+ luaL_pushresult(&b);
+ lua_pushnil(L);
+ lua_pushnil(L);
+ }
+#ifdef LUASOCKET_DEBUG
+ /* push time elapsed during operation as the last return value */
+ lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));
+#endif
+ return lua_gettop(L) - top;
+}
+
+/*-------------------------------------------------------------------------*\
+* Determines if there is any data in the read buffer
+\*-------------------------------------------------------------------------*/
+int buffer_isempty(p_buffer buf) {
+ return buf->first >= buf->last;
+}
+
+/*=========================================================================*\
+* Internal functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Sends a block of data (unbuffered)
+\*-------------------------------------------------------------------------*/
+#define STEPSIZE 8192
+static int sendraw(p_buffer buf, const char *data, size_t count, size_t *sent) {
+ p_io io = buf->io;
+ p_timeout tm = buf->tm;
+ size_t total = 0;
+ int err = IO_DONE;
+ while (total < count && err == IO_DONE) {
+ size_t done;
+ size_t step = (count-total <= STEPSIZE)? count-total: STEPSIZE;
+ err = io->send(io->ctx, data+total, step, &done, tm);
+ total += done;
+ }
+ *sent = total;
+ buf->sent += total;
+ return err;
+}
+
+/*-------------------------------------------------------------------------*\
+* Reads a fixed number of bytes (buffered)
+\*-------------------------------------------------------------------------*/
+static int recvraw(p_buffer buf, size_t wanted, luaL_Buffer *b) {
+ int err = IO_DONE;
+ size_t total = 0;
+ while (err == IO_DONE) {
+ size_t count; const char *data;
+ err = buffer_get(buf, &data, &count);
+ count = MIN(count, wanted - total);
+ luaL_addlstring(b, data, count);
+ buffer_skip(buf, count);
+ total += count;
+ if (total >= wanted) break;
+ }
+ return err;
+}
+
+/*-------------------------------------------------------------------------*\
+* Reads everything until the connection is closed (buffered)
+\*-------------------------------------------------------------------------*/
+static int recvall(p_buffer buf, luaL_Buffer *b) {
+ int err = IO_DONE;
+ size_t total = 0;
+ while (err == IO_DONE) {
+ const char *data; size_t count;
+ err = buffer_get(buf, &data, &count);
+ total += count;
+ luaL_addlstring(b, data, count);
+ buffer_skip(buf, count);
+ }
+ if (err == IO_CLOSED) {
+ if (total > 0) return IO_DONE;
+ else return IO_CLOSED;
+ } else return err;
+}
+
+/*-------------------------------------------------------------------------*\
+* Reads a line terminated by a CR LF pair or just by a LF. The CR and LF
+* are not returned by the function and are discarded from the buffer
+\*-------------------------------------------------------------------------*/
+static int recvline(p_buffer buf, luaL_Buffer *b) {
+ int err = IO_DONE;
+ while (err == IO_DONE) {
+ size_t count, pos; const char *data;
+ err = buffer_get(buf, &data, &count);
+ pos = 0;
+ while (pos < count && data[pos] != '\n') {
+ /* we ignore all \r's */
+ if (data[pos] != '\r') luaL_putchar(b, data[pos]);
+ pos++;
+ }
+ if (pos < count) { /* found '\n' */
+ buffer_skip(buf, pos+1); /* skip '\n' too */
+ break; /* we are done */
+ } else /* reached the end of the buffer */
+ buffer_skip(buf, pos);
+ }
+ return err;
+}
+
+/*-------------------------------------------------------------------------*\
+* Skips a given number of bytes from read buffer. No data is read from the
+* transport layer
+\*-------------------------------------------------------------------------*/
+static void buffer_skip(p_buffer buf, size_t count) {
+ buf->received += count;
+ buf->first += count;
+ if (buffer_isempty(buf))
+ buf->first = buf->last = 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Return any data available in buffer, or get more data from transport layer
+* if buffer is empty
+\*-------------------------------------------------------------------------*/
+static int buffer_get(p_buffer buf, const char **data, size_t *count) {
+ int err = IO_DONE;
+ p_io io = buf->io;
+ p_timeout tm = buf->tm;
+ if (buffer_isempty(buf)) {
+ size_t got;
+ err = io->recv(io->ctx, buf->data, BUF_SIZE, &got, tm);
+ buf->first = 0;
+ buf->last = got;
+ }
+ *count = buf->last - buf->first;
+ *data = buf->data + buf->first;
+ return err;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/buffer.h b/Build/source/texk/web2c/luatexdir/luasocket/src/buffer.h
new file mode 100644
index 00000000000..baf93caa031
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/buffer.h
@@ -0,0 +1,47 @@
+#ifndef BUF_H
+#define BUF_H
+/*=========================================================================*\
+* Input/Output interface for Lua programs
+* LuaSocket toolkit
+*
+* Line patterns require buffering. Reading one character at a time involves
+* too many system calls and is very slow. This module implements the
+* LuaSocket interface for input/output on connected objects, as seen by
+* Lua programs.
+*
+* Input is buffered. Output is *not* buffered because there was no simple
+* way of making sure the buffered output data would ever be sent.
+*
+* The module is built on top of the I/O abstraction defined in io.h and the
+* timeout management is done with the timeout.h interface.
+*
+* RCS ID: $Id: buffer.h,v 1.12 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+
+#include "io.h"
+#include "timeout.h"
+
+/* buffer size in bytes */
+#define BUF_SIZE 8192
+
+/* buffer control structure */
+typedef struct t_buffer_ {
+ double birthday; /* throttle support info: creation time, */
+ size_t sent, received; /* bytes sent, and bytes received */
+ p_io io; /* IO driver used for this buffer */
+ p_timeout tm; /* timeout management for this buffer */
+ size_t first, last; /* index of first and last bytes of stored data */
+ char data[BUF_SIZE]; /* storage space for buffer data */
+} t_buffer;
+typedef t_buffer *p_buffer;
+
+int buffer_open(lua_State *L);
+void buffer_init(p_buffer buf, p_io io, p_timeout tm);
+int buffer_meth_send(lua_State *L, p_buffer buf);
+int buffer_meth_receive(lua_State *L, p_buffer buf);
+int buffer_meth_getstats(lua_State *L, p_buffer buf);
+int buffer_meth_setstats(lua_State *L, p_buffer buf);
+int buffer_isempty(p_buffer buf);
+
+#endif /* BUF_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/except.c b/Build/source/texk/web2c/luatexdir/luasocket/src/except.c
new file mode 100644
index 00000000000..5faa5be0039
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/except.c
@@ -0,0 +1,99 @@
+/*=========================================================================*\
+* Simple exception support
+* LuaSocket toolkit
+*
+* RCS ID: $Id: except.c,v 1.8 2005/09/29 06:11:41 diego Exp $
+\*=========================================================================*/
+#include <stdio.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "except.h"
+
+/*=========================================================================*\
+* Internal function prototypes.
+\*=========================================================================*/
+static int global_protect(lua_State *L);
+static int global_newtry(lua_State *L);
+static int protected_(lua_State *L);
+static int finalize(lua_State *L);
+static int do_nothing(lua_State *L);
+
+/* except functions */
+static luaL_reg func[] = {
+ {"newtry", global_newtry},
+ {"protect", global_protect},
+ {NULL, NULL}
+};
+
+/*-------------------------------------------------------------------------*\
+* Try factory
+\*-------------------------------------------------------------------------*/
+static void wrap(lua_State *L) {
+ lua_newtable(L);
+ lua_pushnumber(L, 1);
+ lua_pushvalue(L, -3);
+ lua_settable(L, -3);
+ lua_insert(L, -2);
+ lua_pop(L, 1);
+}
+
+static int finalize(lua_State *L) {
+ if (!lua_toboolean(L, 1)) {
+ lua_pushvalue(L, lua_upvalueindex(1));
+ lua_pcall(L, 0, 0, 0);
+ lua_settop(L, 2);
+ wrap(L);
+ lua_error(L);
+ return 0;
+ } else return lua_gettop(L);
+}
+
+static int do_nothing(lua_State *L) {
+ (void) L;
+ return 0;
+}
+
+static int global_newtry(lua_State *L) {
+ lua_settop(L, 1);
+ if (lua_isnil(L, 1)) lua_pushcfunction(L, do_nothing);
+ lua_pushcclosure(L, finalize, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Protect factory
+\*-------------------------------------------------------------------------*/
+static int unwrap(lua_State *L) {
+ if (lua_istable(L, -1)) {
+ lua_pushnumber(L, 1);
+ lua_gettable(L, -2);
+ lua_pushnil(L);
+ lua_insert(L, -2);
+ return 1;
+ } else return 0;
+}
+
+static int protected_(lua_State *L) {
+ lua_pushvalue(L, lua_upvalueindex(1));
+ lua_insert(L, 1);
+ if (lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0) != 0) {
+ if (unwrap(L)) return 2;
+ else lua_error(L);
+ return 0;
+ } else return lua_gettop(L);
+}
+
+static int global_protect(lua_State *L) {
+ lua_pushcclosure(L, protected_, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Init module
+\*-------------------------------------------------------------------------*/
+int except_open(lua_State *L) {
+ luaL_openlib(L, NULL, func, 0);
+ return 0;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/except.h b/Build/source/texk/web2c/luatexdir/luasocket/src/except.h
new file mode 100644
index 00000000000..81efb29be53
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/except.h
@@ -0,0 +1,35 @@
+#ifndef EXCEPT_H
+#define EXCEPT_H
+/*=========================================================================*\
+* Exception control
+* LuaSocket toolkit (but completely independent from other modules)
+*
+* This provides support for simple exceptions in Lua. During the
+* development of the HTTP/FTP/SMTP support, it became aparent that
+* error checking was taking a substantial amount of the coding. These
+* function greatly simplify the task of checking errors.
+*
+* The main idea is that functions should return nil as its first return
+* value when it finds an error, and return an error message (or value)
+* following nil. In case of success, as long as the first value is not nil,
+* the other values don't matter.
+*
+* The idea is to nest function calls with the "try" function. This function
+* checks the first value, and calls "error" on the second if the first is
+* nil. Otherwise, it returns all values it received.
+*
+* The protect function returns a new function that behaves exactly like the
+* function it receives, but the new function doesn't throw exceptions: it
+* returns nil followed by the error message instead.
+*
+* With these two function, it's easy to write functions that throw
+* exceptions on error, but that don't interrupt the user script.
+*
+* RCS ID: $Id: except.h,v 1.2 2005/09/29 06:11:41 diego Exp $
+\*=========================================================================*/
+
+#include "lua.h"
+
+int except_open(lua_State *L);
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/ftp.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/ftp.lua
new file mode 100644
index 00000000000..598f65dcaf0
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/ftp.lua
@@ -0,0 +1,281 @@
+-----------------------------------------------------------------------------
+-- FTP support for the Lua language
+-- LuaSocket toolkit.
+-- Author: Diego Nehab
+-- RCS ID: $Id: ftp.lua,v 1.45 2007/07/11 19:25:47 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module and import dependencies
+-----------------------------------------------------------------------------
+local base = _G
+local table = require("table")
+local string = require("string")
+local math = require("math")
+local socket = require("socket")
+local url = require("socket.url")
+local tp = require("socket.tp")
+local ltn12 = require("ltn12")
+module("socket.ftp")
+
+-----------------------------------------------------------------------------
+-- Program constants
+-----------------------------------------------------------------------------
+-- timeout in seconds before the program gives up on a connection
+TIMEOUT = 60
+-- default port for ftp service
+PORT = 21
+-- this is the default anonymous password. used when no password is
+-- provided in url. should be changed to your e-mail.
+USER = "ftp"
+PASSWORD = "anonymous@anonymous.org"
+
+-----------------------------------------------------------------------------
+-- Low level FTP API
+-----------------------------------------------------------------------------
+local metat = { __index = {} }
+
+function open(server, port, create)
+ local tp = socket.try(tp.connect(server, port or PORT, TIMEOUT, create))
+ local f = base.setmetatable({ tp = tp }, metat)
+ -- make sure everything gets closed in an exception
+ f.try = socket.newtry(function() f:close() end)
+ return f
+end
+
+function metat.__index:portconnect()
+ self.try(self.server:settimeout(TIMEOUT))
+ self.data = self.try(self.server:accept())
+ self.try(self.data:settimeout(TIMEOUT))
+end
+
+function metat.__index:pasvconnect()
+ self.data = self.try(socket.tcp())
+ self.try(self.data:settimeout(TIMEOUT))
+ self.try(self.data:connect(self.pasvt.ip, self.pasvt.port))
+end
+
+function metat.__index:login(user, password)
+ self.try(self.tp:command("user", user or USER))
+ local code, reply = self.try(self.tp:check{"2..", 331})
+ if code == 331 then
+ self.try(self.tp:command("pass", password or PASSWORD))
+ self.try(self.tp:check("2.."))
+ end
+ return 1
+end
+
+function metat.__index:pasv()
+ self.try(self.tp:command("pasv"))
+ local code, reply = self.try(self.tp:check("2.."))
+ local pattern = "(%d+)%D(%d+)%D(%d+)%D(%d+)%D(%d+)%D(%d+)"
+ local a, b, c, d, p1, p2 = socket.skip(2, string.find(reply, pattern))
+ self.try(a and b and c and d and p1 and p2, reply)
+ self.pasvt = {
+ ip = string.format("%d.%d.%d.%d", a, b, c, d),
+ port = p1*256 + p2
+ }
+ if self.server then
+ self.server:close()
+ self.server = nil
+ end
+ return self.pasvt.ip, self.pasvt.port
+end
+
+function metat.__index:port(ip, port)
+ self.pasvt = nil
+ if not ip then
+ ip, port = self.try(self.tp:getcontrol():getsockname())
+ self.server = self.try(socket.bind(ip, 0))
+ ip, port = self.try(self.server:getsockname())
+ self.try(self.server:settimeout(TIMEOUT))
+ end
+ local pl = math.mod(port, 256)
+ local ph = (port - pl)/256
+ local arg = string.gsub(string.format("%s,%d,%d", ip, ph, pl), "%.", ",")
+ self.try(self.tp:command("port", arg))
+ self.try(self.tp:check("2.."))
+ return 1
+end
+
+function metat.__index:send(sendt)
+ self.try(self.pasvt or self.server, "need port or pasv first")
+ -- if there is a pasvt table, we already sent a PASV command
+ -- we just get the data connection into self.data
+ if self.pasvt then self:pasvconnect() end
+ -- get the transfer argument and command
+ local argument = sendt.argument or
+ url.unescape(string.gsub(sendt.path or "", "^[/\\]", ""))
+ if argument == "" then argument = nil end
+ local command = sendt.command or "stor"
+ -- send the transfer command and check the reply
+ self.try(self.tp:command(command, argument))
+ local code, reply = self.try(self.tp:check{"2..", "1.."})
+ -- if there is not a a pasvt table, then there is a server
+ -- and we already sent a PORT command
+ if not self.pasvt then self:portconnect() end
+ -- get the sink, source and step for the transfer
+ local step = sendt.step or ltn12.pump.step
+ local readt = {self.tp.c}
+ local checkstep = function(src, snk)
+ -- check status in control connection while downloading
+ local readyt = socket.select(readt, nil, 0)
+ if readyt[tp] then code = self.try(self.tp:check("2..")) end
+ return step(src, snk)
+ end
+ local sink = socket.sink("close-when-done", self.data)
+ -- transfer all data and check error
+ self.try(ltn12.pump.all(sendt.source, sink, checkstep))
+ if string.find(code, "1..") then self.try(self.tp:check("2..")) end
+ -- done with data connection
+ self.data:close()
+ -- find out how many bytes were sent
+ local sent = socket.skip(1, self.data:getstats())
+ self.data = nil
+ return sent
+end
+
+function metat.__index:receive(recvt)
+ self.try(self.pasvt or self.server, "need port or pasv first")
+ if self.pasvt then self:pasvconnect() end
+ local argument = recvt.argument or
+ url.unescape(string.gsub(recvt.path or "", "^[/\\]", ""))
+ if argument == "" then argument = nil end
+ local command = recvt.command or "retr"
+ self.try(self.tp:command(command, argument))
+ local code = self.try(self.tp:check{"1..", "2.."})
+ if not self.pasvt then self:portconnect() end
+ local source = socket.source("until-closed", self.data)
+ local step = recvt.step or ltn12.pump.step
+ self.try(ltn12.pump.all(source, recvt.sink, step))
+ if string.find(code, "1..") then self.try(self.tp:check("2..")) end
+ self.data:close()
+ self.data = nil
+ return 1
+end
+
+function metat.__index:cwd(dir)
+ self.try(self.tp:command("cwd", dir))
+ self.try(self.tp:check(250))
+ return 1
+end
+
+function metat.__index:type(type)
+ self.try(self.tp:command("type", type))
+ self.try(self.tp:check(200))
+ return 1
+end
+
+function metat.__index:greet()
+ local code = self.try(self.tp:check{"1..", "2.."})
+ if string.find(code, "1..") then self.try(self.tp:check("2..")) end
+ return 1
+end
+
+function metat.__index:quit()
+ self.try(self.tp:command("quit"))
+ self.try(self.tp:check("2.."))
+ return 1
+end
+
+function metat.__index:close()
+ if self.data then self.data:close() end
+ if self.server then self.server:close() end
+ return self.tp:close()
+end
+
+-----------------------------------------------------------------------------
+-- High level FTP API
+-----------------------------------------------------------------------------
+local function override(t)
+ if t.url then
+ local u = url.parse(t.url)
+ for i,v in base.pairs(t) do
+ u[i] = v
+ end
+ return u
+ else return t end
+end
+
+local function tput(putt)
+ putt = override(putt)
+ socket.try(putt.host, "missing hostname")
+ local f = open(putt.host, putt.port, putt.create)
+ f:greet()
+ f:login(putt.user, putt.password)
+ if putt.type then f:type(putt.type) end
+ f:pasv()
+ local sent = f:send(putt)
+ f:quit()
+ f:close()
+ return sent
+end
+
+local default = {
+ path = "/",
+ scheme = "ftp"
+}
+
+local function parse(u)
+ local t = socket.try(url.parse(u, default))
+ socket.try(t.scheme == "ftp", "wrong scheme '" .. t.scheme .. "'")
+ socket.try(t.host, "missing hostname")
+ local pat = "^type=(.)$"
+ if t.params then
+ t.type = socket.skip(2, string.find(t.params, pat))
+ socket.try(t.type == "a" or t.type == "i",
+ "invalid type '" .. t.type .. "'")
+ end
+ return t
+end
+
+local function sput(u, body)
+ local putt = parse(u)
+ putt.source = ltn12.source.string(body)
+ return tput(putt)
+end
+
+put = socket.protect(function(putt, body)
+ if base.type(putt) == "string" then return sput(putt, body)
+ else return tput(putt) end
+end)
+
+local function tget(gett)
+ gett = override(gett)
+ socket.try(gett.host, "missing hostname")
+ local f = open(gett.host, gett.port, gett.create)
+ f:greet()
+ f:login(gett.user, gett.password)
+ if gett.type then f:type(gett.type) end
+ f:pasv()
+ f:receive(gett)
+ f:quit()
+ return f:close()
+end
+
+local function sget(u)
+ local gett = parse(u)
+ local t = {}
+ gett.sink = ltn12.sink.table(t)
+ tget(gett)
+ return table.concat(t)
+end
+
+command = socket.protect(function(cmdt)
+ cmdt = override(cmdt)
+ socket.try(cmdt.host, "missing hostname")
+ socket.try(cmdt.command, "missing command")
+ local f = open(cmdt.host, cmdt.port, cmdt.create)
+ f:greet()
+ f:login(cmdt.user, cmdt.password)
+ f.try(f.tp:command(cmdt.command, cmdt.argument))
+ if cmdt.check then f.try(f.tp:check(cmdt.check)) end
+ f:quit()
+ return f:close()
+end)
+
+get = socket.protect(function(gett)
+ if base.type(gett) == "string" then return sget(gett)
+ else return tget(gett) end
+end)
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/ftp_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/ftp_lua.c
new file mode 100644
index 00000000000..b359db30b5c
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/ftp_lua.c
@@ -0,0 +1,470 @@
+/*
+ * This file is auto-generated by "./lua2c ftp.lua ftp_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_ftp_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 70, 84, 80, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,116,104,101,
+ 32, 76,117, 97, 32,108, 97,110,103,117, 97,103,101, 10, 45, 45, 32, 76,117, 97,
+ 83,111, 99,107,101,116, 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,
+117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45,
+ 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, 73,100, 58, 32,102,116,112, 46,108,
+117, 97, 44,118, 32, 49, 46, 52, 53, 32, 50, 48, 48, 55, 47, 48, 55, 47, 49, 49,
+ 32, 49, 57, 58, 50, 53, 58, 52, 55, 32,100,105,101,103,111, 32, 69,120,112, 32,
+ 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,
+ 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45,
+ 45, 32, 68,101, 99,108, 97,114,101, 32,109,111,100,117,108,101, 32, 97,110,100,
+ 32,105,109,112,111,114,116, 32,100,101,112,101,110,100,101,110, 99,105,101,115,
+ 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,
+111, 99, 97,108, 32, 98, 97,115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108,
+ 32,116, 97, 98,108,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,116, 97,
+ 98,108,101, 34, 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61,
+ 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108,
+111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, 40,
+ 34,109, 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99,107,101,116,
+ 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 34, 41,
+ 10,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32,114,101,113,117,105,114,101,
+ 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, 41, 10,108,111, 99, 97,108,
+ 32,116,112, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,
+116, 46,116,112, 34, 41, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, 61,
+ 32,114,101,113,117,105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,109,111,
+100,117,108,101, 40, 34,115,111, 99,107,101,116, 46,102,116,112, 34, 41, 10, 10,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97,110,116,115, 10, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,
+116,105,109,101,111,117,116, 32,105,110, 32,115,101, 99,111,110,100,115, 32, 98,
+101,102,111,114,101, 32,116,104,101, 32,112,114,111,103,114, 97,109, 32,103,105,
+118,101,115, 32,117,112, 32,111,110, 32, 97, 32, 99,111,110,110,101, 99,116,105,
+111,110, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100,
+101,102, 97,117,108,116, 32,112,111,114,116, 32,102,111,114, 32,102,116,112, 32,
+115,101,114,118,105, 99,101, 10, 80, 79, 82, 84, 32, 61, 32, 50, 49, 10, 45, 45,
+ 32,116,104,105,115, 32,105,115, 32,116,104,101, 32,100,101,102, 97,117,108,116,
+ 32, 97,110,111,110,121,109,111,117,115, 32,112, 97,115,115,119,111,114,100, 46,
+ 32,117,115,101,100, 32,119,104,101,110, 32,110,111, 32,112, 97,115,115,119,111,
+114,100, 32,105,115, 10, 45, 45, 32,112,114,111,118,105,100,101,100, 32,105,110,
+ 32,117,114,108, 46, 32,115,104,111,117,108,100, 32, 98,101, 32, 99,104, 97,110,
+103,101,100, 32,116,111, 32,121,111,117,114, 32,101, 45,109, 97,105,108, 46, 10,
+ 85, 83, 69, 82, 32, 61, 32, 34,102,116,112, 34, 10, 80, 65, 83, 83, 87, 79, 82,
+ 68, 32, 61, 32, 34, 97,110,111,110,121,109,111,117,115, 64, 97,110,111,110,121,
+109,111,117,115, 46,111,114,103, 34, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32,108,101,118,101,
+108, 32, 70, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109,101,116, 97,116, 32,
+ 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123,125, 32,125, 10, 10,
+102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,115,101,114,118,101,114,
+ 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32, 32, 32,
+108,111, 99, 97,108, 32,116,112, 32, 61, 32,115,111, 99,107,101,116, 46,116,114,
+121, 40,116,112, 46, 99,111,110,110,101, 99,116, 40,115,101,114,118,101,114, 44,
+ 32,112,111,114,116, 32,111,114, 32, 80, 79, 82, 84, 44, 32, 84, 73, 77, 69, 79,
+ 85, 84, 44, 32, 99,114,101, 97,116,101, 41, 41, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,102, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116,
+ 97, 98,108,101, 40,123, 32,116,112, 32, 61, 32,116,112, 32,125, 44, 32,109,101,
+116, 97,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,
+101, 32,101,118,101,114,121,116,104,105,110,103, 32,103,101,116,115, 32, 99,108,
+111,115,101,100, 32,105,110, 32, 97,110, 32,101,120, 99,101,112,116,105,111,110,
+ 10, 32, 32, 32, 32,102, 46,116,114,121, 32, 61, 32,115,111, 99,107,101,116, 46,
+110,101,119,116,114,121, 40,102,117,110, 99,116,105,111,110, 40, 41, 32,102, 58,
+ 99,108,111,115,101, 40, 41, 32,101,110,100, 41, 10, 32, 32, 32, 32,114,101,116,
+117,114,110, 32,102, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,
+109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112,111,114,116, 99,111,
+110,110,101, 99,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121,
+ 40,115,101,108,102, 46,115,101,114,118,101,114, 58,115,101,116,116,105,109,101,
+111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,115,101,
+108,102, 46,100, 97,116, 97, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,
+101,108,102, 46,115,101,114,118,101,114, 58, 97, 99, 99,101,112,116, 40, 41, 41,
+ 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,100,
+ 97,116, 97, 58,115,101,116,116,105,109,101,111,117,116, 40, 84, 73, 77, 69, 79,
+ 85, 84, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,
+101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112, 97,115,118, 99,111,110,
+110,101, 99,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,100, 97,116, 97,
+ 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,111, 99,107,101,116, 46,116,
+ 99,112, 40, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,
+101,108,102, 46,100, 97,116, 97, 58,115,101,116,116,105,109,101,111,117,116, 40,
+ 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,
+114,121, 40,115,101,108,102, 46,100, 97,116, 97, 58, 99,111,110,110,101, 99,116,
+ 40,115,101,108,102, 46,112, 97,115,118,116, 46,105,112, 44, 32,115,101,108,102,
+ 46,112, 97,115,118,116, 46,112,111,114,116, 41, 41, 10,101,110,100, 10, 10,102,
+117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,
+120, 58,108,111,103,105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111,
+114,100, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,
+102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,117,115,101,114, 34, 44,
+ 32,117,115,101,114, 32,111,114, 32, 85, 83, 69, 82, 41, 41, 10, 32, 32, 32, 32,
+108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108,121, 32, 61, 32,
+115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101,
+ 99,107,123, 34, 50, 46, 46, 34, 44, 32, 51, 51, 49,125, 41, 10, 32, 32, 32, 32,
+105,102, 32, 99,111,100,101, 32, 61, 61, 32, 51, 51, 49, 32,116,104,101,110, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,
+102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,112, 97,115,115, 34, 44,
+ 32,112, 97,115,115,119,111,114,100, 32,111,114, 32, 80, 65, 83, 83, 87, 79, 82,
+ 68, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121,
+ 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34,
+ 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,
+110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,
+116, 97,116, 46, 95, 95,105,110,100,101,120, 58,112, 97,115,118, 40, 41, 10, 32,
+ 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,
+ 99,111,109,109, 97,110,100, 40, 34,112, 97,115,118, 34, 41, 41, 10, 32, 32, 32,
+ 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108,121, 32, 61,
+ 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,
+101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97,
+108, 32,112, 97,116,116,101,114,110, 32, 61, 32, 34, 40, 37,100, 43, 41, 37, 68,
+ 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 37,
+ 68, 40, 37,100, 43, 41, 37, 68, 40, 37,100, 43, 41, 34, 10, 32, 32, 32, 32,108,
+111, 99, 97,108, 32, 97, 44, 32, 98, 44, 32, 99, 44, 32,100, 44, 32,112, 49, 44,
+ 32,112, 50, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44,
+ 32,115,116,114,105,110,103, 46,102,105,110,100, 40,114,101,112,108,121, 44, 32,
+112, 97,116,116,101,114,110, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,
+114,121, 40, 97, 32, 97,110,100, 32, 98, 32, 97,110,100, 32, 99, 32, 97,110,100,
+ 32,100, 32, 97,110,100, 32,112, 49, 32, 97,110,100, 32,112, 50, 44, 32,114,101,
+112,108,121, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,112, 97,115,118,116, 32,
+ 61, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,112, 32, 61, 32,115,116,114,
+105,110,103, 46,102,111,114,109, 97,116, 40, 34, 37,100, 46, 37,100, 46, 37,100,
+ 46, 37,100, 34, 44, 32, 97, 44, 32, 98, 44, 32, 99, 44, 32,100, 41, 44, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,112,111,114,116, 32, 61, 32,112, 49, 42, 50, 53, 54,
+ 32, 43, 32,112, 50, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,105,102, 32,115,
+101,108,102, 46,115,101,114,118,101,114, 32,116,104,101,110, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,115,101,108,102, 46,115,101,114,118,101,114, 58, 99,108,111,115,
+101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,115,101,114,
+118,101,114, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,112, 97,115,118,116, 46,
+105,112, 44, 32,115,101,108,102, 46,112, 97,115,118,116, 46,112,111,114,116, 10,
+101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46,
+ 95, 95,105,110,100,101,120, 58,112,111,114,116, 40,105,112, 44, 32,112,111,114,
+116, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,112, 97,115,118,116, 32, 61, 32,
+110,105,108, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,105,112, 32,116,104,
+101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,112, 44, 32,112,111,114,116, 32,
+ 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,103,
+101,116, 99,111,110,116,114,111,108, 40, 41, 58,103,101,116,115,111, 99,107,110,
+ 97,109,101, 40, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,
+115,101,114,118,101,114, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,111,
+ 99,107,101,116, 46, 98,105,110,100, 40,105,112, 44, 32, 48, 41, 41, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32,105,112, 44, 32,112,111,114,116, 32, 61, 32,115,101,108,
+102, 46,116,114,121, 40,115,101,108,102, 46,115,101,114,118,101,114, 58,103,101,
+116,115,111, 99,107,110, 97,109,101, 40, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,115,101,114,118,101,
+114, 58,115,101,116,116,105,109,101,111,117,116, 40, 84, 73, 77, 69, 79, 85, 84,
+ 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108,
+ 32,112,108, 32, 61, 32,109, 97,116,104, 46,109,111,100, 40,112,111,114,116, 44,
+ 32, 50, 53, 54, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112,104, 32, 61,
+ 32, 40,112,111,114,116, 32, 45, 32,112,108, 41, 47, 50, 53, 54, 10, 32, 32, 32,
+ 32,108,111, 99, 97,108, 32, 97,114,103, 32, 61, 32,115,116,114,105,110,103, 46,
+103,115,117, 98, 40,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 34,
+ 37,115, 44, 37,100, 44, 37,100, 34, 44, 32,105,112, 44, 32,112,104, 44, 32,112,
+108, 41, 44, 32, 34, 37, 46, 34, 44, 32, 34, 44, 34, 41, 10, 32, 32, 32, 32,115,
+101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109,
+ 97,110,100, 40, 34,112,111,114,116, 34, 44, 32, 97,114,103, 41, 41, 10, 32, 32,
+ 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,
+104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,
+117,114,110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,
+109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,115,101,110,100, 40,115,
+101,110,100,116, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,
+101,108,102, 46,112, 97,115,118,116, 32,111,114, 32,115,101,108,102, 46,115,101,
+114,118,101,114, 44, 32, 34,110,101,101,100, 32,112,111,114,116, 32,111,114, 32,
+112, 97,115,118, 32,102,105,114,115,116, 34, 41, 10, 32, 32, 32, 32, 45, 45, 32,
+105,102, 32,116,104,101,114,101, 32,105,115, 32, 97, 32,112, 97,115,118,116, 32,
+116, 97, 98,108,101, 44, 32,119,101, 32, 97,108,114,101, 97,100,121, 32,115,101,
+110,116, 32, 97, 32, 80, 65, 83, 86, 32, 99,111,109,109, 97,110,100, 10, 32, 32,
+ 32, 32, 45, 45, 32,119,101, 32,106,117,115,116, 32,103,101,116, 32,116,104,101,
+ 32,100, 97,116, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 32,105,110,116,
+111, 32,115,101,108,102, 46,100, 97,116, 97, 10, 32, 32, 32, 32,105,102, 32,115,
+101,108,102, 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58,
+112, 97,115,118, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32,
+ 32, 32, 45, 45, 32,103,101,116, 32,116,104,101, 32,116,114, 97,110,115,102,101,
+114, 32, 97,114,103,117,109,101,110,116, 32, 97,110,100, 32, 99,111,109,109, 97,
+110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,114,103,117,109,101,110,
+116, 32, 61, 32,115,101,110,100,116, 46, 97,114,103,117,109,101,110,116, 32,111,
+114, 10, 32, 32, 32, 32, 32, 32, 32, 32,117,114,108, 46,117,110,101,115, 99, 97,
+112,101, 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,115,101,110,100,116,
+ 46,112, 97,116,104, 32,111,114, 32, 34, 34, 44, 32, 34, 94, 91, 47, 92, 92, 93,
+ 34, 44, 32, 34, 34, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 97,114,103,117,109,
+101,110,116, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, 97,114,103,117,109,
+101,110,116, 32, 61, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,108,111,
+ 99, 97,108, 32, 99,111,109,109, 97,110,100, 32, 61, 32,115,101,110,100,116, 46,
+ 99,111,109,109, 97,110,100, 32,111,114, 32, 34,115,116,111,114, 34, 10, 32, 32,
+ 32, 32, 45, 45, 32,115,101,110,100, 32,116,104,101, 32,116,114, 97,110,115,102,
+101,114, 32, 99,111,109,109, 97,110,100, 32, 97,110,100, 32, 99,104,101, 99,107,
+ 32,116,104,101, 32,114,101,112,108,121, 10, 32, 32, 32, 32,115,101,108,102, 46,
+116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40,
+ 99,111,109,109, 97,110,100, 44, 32, 97,114,103,117,109,101,110,116, 41, 41, 10,
+ 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,114,101,112,108,
+121, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112,
+ 58, 99,104,101, 99,107,123, 34, 50, 46, 46, 34, 44, 32, 34, 49, 46, 46, 34,125,
+ 41, 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115,
+ 32,110,111,116, 32, 97, 32, 97, 32,112, 97,115,118,116, 32,116, 97, 98,108,101,
+ 44, 32,116,104,101,110, 32,116,104,101,114,101, 32,105,115, 32, 97, 32,115,101,
+114,118,101,114, 10, 32, 32, 32, 32, 45, 45, 32, 97,110,100, 32,119,101, 32, 97,
+108,114,101, 97,100,121, 32,115,101,110,116, 32, 97, 32, 80, 79, 82, 84, 32, 99,
+111,109,109, 97,110,100, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,101,
+108,102, 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58,112,
+111,114,116, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, 32,
+ 32, 45, 45, 32,103,101,116, 32,116,104,101, 32,115,105,110,107, 44, 32,115,111,
+117,114, 99,101, 32, 97,110,100, 32,115,116,101,112, 32,102,111,114, 32,116,104,
+101, 32,116,114, 97,110,115,102,101,114, 10, 32, 32, 32, 32,108,111, 99, 97,108,
+ 32,115,116,101,112, 32, 61, 32,115,101,110,100,116, 46,115,116,101,112, 32,111,
+114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32,114,101, 97,100,116, 32, 61, 32,123,115,101,108,
+102, 46,116,112, 46, 99,125, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,
+101, 99,107,115,116,101,112, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115,
+114, 99, 44, 32,115,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,
+ 99,104,101, 99,107, 32,115,116, 97,116,117,115, 32,105,110, 32, 99,111,110,116,
+114,111,108, 32, 99,111,110,110,101, 99,116,105,111,110, 32,119,104,105,108,101,
+ 32,100,111,119,110,108,111, 97,100,105,110,103, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,108,111, 99, 97,108, 32,114,101, 97,100,121,116, 32, 61, 32,115,111, 99,107,
+101,116, 46,115,101,108,101, 99,116, 40,114,101, 97,100,116, 44, 32,110,105,108,
+ 44, 32, 48, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,114,101, 97,100,
+121,116, 91,116,112, 93, 32,116,104,101,110, 32, 99,111,100,101, 32, 61, 32,115,
+101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,
+107, 40, 34, 50, 46, 46, 34, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,115,116,101,112, 40,115,114, 99, 44, 32,115,
+110,107, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,
+108, 32,115,105,110,107, 32, 61, 32,115,111, 99,107,101,116, 46,115,105,110,107,
+ 40, 34, 99,108,111,115,101, 45,119,104,101,110, 45,100,111,110,101, 34, 44, 32,
+115,101,108,102, 46,100, 97,116, 97, 41, 10, 32, 32, 32, 32, 45, 45, 32,116,114,
+ 97,110,115,102,101,114, 32, 97,108,108, 32,100, 97,116, 97, 32, 97,110,100, 32,
+ 99,104,101, 99,107, 32,101,114,114,111,114, 10, 32, 32, 32, 32,115,101,108,102,
+ 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, 97,108,108, 40,
+115,101,110,100,116, 46,115,111,117,114, 99,101, 44, 32,115,105,110,107, 44, 32,
+ 99,104,101, 99,107,115,116,101,112, 41, 41, 10, 32, 32, 32, 32,105,102, 32,115,
+116,114,105,110,103, 46,102,105,110,100, 40, 99,111,100,101, 44, 32, 34, 49, 46,
+ 46, 34, 41, 32,116,104,101,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,
+108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 32,
+101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,100,111,110,101, 32,119,105,116,104,
+ 32,100, 97,116, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 10, 32, 32, 32,
+ 32,115,101,108,102, 46,100, 97,116, 97, 58, 99,108,111,115,101, 40, 41, 10, 32,
+ 32, 32, 32, 45, 45, 32,102,105,110,100, 32,111,117,116, 32,104,111,119, 32,109,
+ 97,110,121, 32, 98,121,116,101,115, 32,119,101,114,101, 32,115,101,110,116, 10,
+ 32, 32, 32, 32,108,111, 99, 97,108, 32,115,101,110,116, 32, 61, 32,115,111, 99,
+107,101,116, 46,115,107,105,112, 40, 49, 44, 32,115,101,108,102, 46,100, 97,116,
+ 97, 58,103,101,116,115,116, 97,116,115, 40, 41, 41, 10, 32, 32, 32, 32,115,101,
+108,102, 46,100, 97,116, 97, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32,115,101,110,116, 10,101,110,100, 10, 10,102,117,110, 99,116,
+105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101,
+ 99,101,105,118,101, 40,114,101, 99,118,116, 41, 10, 32, 32, 32, 32,115,101,108,
+102, 46,116,114,121, 40,115,101,108,102, 46,112, 97,115,118,116, 32,111,114, 32,
+115,101,108,102, 46,115,101,114,118,101,114, 44, 32, 34,110,101,101,100, 32,112,
+111,114,116, 32,111,114, 32,112, 97,115,118, 32,102,105,114,115,116, 34, 41, 10,
+ 32, 32, 32, 32,105,102, 32,115,101,108,102, 46,112, 97,115,118,116, 32,116,104,
+101,110, 32,115,101,108,102, 58,112, 97,115,118, 99,111,110,110,101, 99,116, 40,
+ 41, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,114,103,117,
+109,101,110,116, 32, 61, 32,114,101, 99,118,116, 46, 97,114,103,117,109,101,110,
+116, 32,111,114, 10, 32, 32, 32, 32, 32, 32, 32, 32,117,114,108, 46,117,110,101,
+115, 99, 97,112,101, 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,114,101,
+ 99,118,116, 46,112, 97,116,104, 32,111,114, 32, 34, 34, 44, 32, 34, 94, 91, 47,
+ 92, 92, 93, 34, 44, 32, 34, 34, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 97,114,
+103,117,109,101,110,116, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32, 97,114,
+103,117,109,101,110,116, 32, 61, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32,
+ 32,108,111, 99, 97,108, 32, 99,111,109,109, 97,110,100, 32, 61, 32,114,101, 99,
+118,116, 46, 99,111,109,109, 97,110,100, 32,111,114, 32, 34,114,101,116,114, 34,
+ 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,
+112, 58, 99,111,109,109, 97,110,100, 40, 99,111,109,109, 97,110,100, 44, 32, 97,
+114,103,117,109,101,110,116, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,
+ 99,111,100,101, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102,
+ 46,116,112, 58, 99,104,101, 99,107,123, 34, 49, 46, 46, 34, 44, 32, 34, 50, 46,
+ 46, 34,125, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,101,108,102,
+ 46,112, 97,115,118,116, 32,116,104,101,110, 32,115,101,108,102, 58,112,111,114,
+116, 99,111,110,110,101, 99,116, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,108,
+111, 99, 97,108, 32,115,111,117,114, 99,101, 32, 61, 32,115,111, 99,107,101,116,
+ 46,115,111,117,114, 99,101, 40, 34,117,110,116,105,108, 45, 99,108,111,115,101,
+100, 34, 44, 32,115,101,108,102, 46,100, 97,116, 97, 41, 10, 32, 32, 32, 32,108,
+111, 99, 97,108, 32,115,116,101,112, 32, 61, 32,114,101, 99,118,116, 46,115,116,
+101,112, 32,111,114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,
+112, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,108,116,110, 49, 50,
+ 46,112,117,109,112, 46, 97,108,108, 40,115,111,117,114, 99,101, 44, 32,114,101,
+ 99,118,116, 46,115,105,110,107, 44, 32,115,116,101,112, 41, 41, 10, 32, 32, 32,
+ 32,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40, 99,111,100,101,
+ 44, 32, 34, 49, 46, 46, 34, 41, 32,116,104,101,110, 32,115,101,108,102, 46,116,
+114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46,
+ 46, 34, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32,115,101,108,102, 46,100, 97,
+116, 97, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,
+100, 97,116, 97, 32, 61, 32,110,105,108, 10, 32, 32, 32, 32,114,101,116,117,114,
+110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,
+116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,119,100, 40,100,105,114, 41,
+ 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,
+112, 58, 99,111,109,109, 97,110,100, 40, 34, 99,119,100, 34, 44, 32,100,105,114,
+ 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102,
+ 46,116,112, 58, 99,104,101, 99,107, 40, 50, 53, 48, 41, 41, 10, 32, 32, 32, 32,
+114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10,102,117,110, 99,116,105,
+111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,116,121,112,
+101, 40,116,121,112,101, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121,
+ 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,116,121,
+112,101, 34, 44, 32,116,121,112,101, 41, 41, 10, 32, 32, 32, 32,115,101,108,102,
+ 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 50,
+ 48, 48, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,
+100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,
+105,110,100,101,120, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,108,111,
+ 99, 97,108, 32, 99,111,100,101, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,
+115,101,108,102, 46,116,112, 58, 99,104,101, 99,107,123, 34, 49, 46, 46, 34, 44,
+ 32, 34, 50, 46, 46, 34,125, 41, 10, 32, 32, 32, 32,105,102, 32,115,116,114,105,
+110,103, 46,102,105,110,100, 40, 99,111,100,101, 44, 32, 34, 49, 46, 46, 34, 41,
+ 32,116,104,101,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,
+116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 32,101,110,100,
+ 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10,102,
+117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,
+120, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,
+121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34,113,
+117,105,116, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,
+115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41,
+ 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100, 10, 10,
+102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,
+101,120, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,105,102, 32,115,101,
+108,102, 46,100, 97,116, 97, 32,116,104,101,110, 32,115,101,108,102, 46,100, 97,
+116, 97, 58, 99,108,111,115,101, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,105,
+102, 32,115,101,108,102, 46,115,101,114,118,101,114, 32,116,104,101,110, 32,115,
+101,108,102, 46,115,101,114,118,101,114, 58, 99,108,111,115,101, 40, 41, 32,101,
+110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116,
+112, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 72,105,103,104,
+ 32,108,101,118,101,108, 32, 70, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,102,
+117,110, 99,116,105,111,110, 32,111,118,101,114,114,105,100,101, 40,116, 41, 10,
+ 32, 32, 32, 32,105,102, 32,116, 46,117,114,108, 32,116,104,101,110, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,117, 32, 61, 32,117,114,108, 46,
+112, 97,114,115,101, 40,116, 46,117,114,108, 41, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46,112, 97,105,
+114,115, 40,116, 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32,117, 91,105, 93, 32, 61, 32,118, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,
+100, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,117, 10, 32,
+ 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,116, 32,101,110,100,
+ 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110,
+ 32,116,112,117,116, 40,112,117,116,116, 41, 10, 32, 32, 32, 32,112,117,116,116,
+ 32, 61, 32,111,118,101,114,114,105,100,101, 40,112,117,116,116, 41, 10, 32, 32,
+ 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,112,117,116,116, 46,104,111,
+115,116, 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109,
+101, 34, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,111,112,
+101,110, 40,112,117,116,116, 46,104,111,115,116, 44, 32,112,117,116,116, 46,112,
+111,114,116, 44, 32,112,117,116,116, 46, 99,114,101, 97,116,101, 41, 10, 32, 32,
+ 32, 32,102, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,102, 58,108,111,
+103,105,110, 40,112,117,116,116, 46,117,115,101,114, 44, 32,112,117,116,116, 46,
+112, 97,115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,105,102, 32,112,117,116,
+116, 46,116,121,112,101, 32,116,104,101,110, 32,102, 58,116,121,112,101, 40,112,
+117,116,116, 46,116,121,112,101, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58,
+112, 97,115,118, 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,101,110,
+116, 32, 61, 32,102, 58,115,101,110,100, 40,112,117,116,116, 41, 10, 32, 32, 32,
+ 32,102, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,102, 58, 99,108,111,115,
+101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,110,116, 10,
+101,110,100, 10, 10,108,111, 99, 97,108, 32,100,101,102, 97,117,108,116, 32, 61,
+ 32,123, 10, 9,112, 97,116,104, 32, 61, 32, 34, 47, 34, 44, 10, 9,115, 99,104,
+101,109,101, 32, 61, 32, 34,102,116,112, 34, 10,125, 10, 10,108,111, 99, 97,108,
+ 32,102,117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 40,117, 41, 10, 32,
+ 32, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,115,111, 99,107,101,116, 46,
+116,114,121, 40,117,114,108, 46,112, 97,114,115,101, 40,117, 44, 32,100,101,102,
+ 97,117,108,116, 41, 41, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114,
+121, 40,116, 46,115, 99,104,101,109,101, 32, 61, 61, 32, 34,102,116,112, 34, 44,
+ 32, 34,119,114,111,110,103, 32,115, 99,104,101,109,101, 32, 39, 34, 32, 46, 46,
+ 32,116, 46,115, 99,104,101,109,101, 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32,
+ 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,116, 46,104,111,115,116, 44,
+ 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109,101, 34, 41,
+ 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,116, 32, 61, 32, 34, 94,116,
+121,112,101, 61, 40, 46, 41, 36, 34, 10, 32, 32, 32, 32,105,102, 32,116, 46,112,
+ 97,114, 97,109,115, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,116,
+ 46,116,121,112,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40,
+ 50, 44, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,116, 46,112, 97,114,
+ 97,109,115, 44, 32,112, 97,116, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,
+111, 99,107,101,116, 46,116,114,121, 40,116, 46,116,121,112,101, 32, 61, 61, 32,
+ 34, 97, 34, 32,111,114, 32,116, 46,116,121,112,101, 32, 61, 61, 32, 34,105, 34,
+ 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 34,105,110,118, 97,108,
+105,100, 32,116,121,112,101, 32, 39, 34, 32, 46, 46, 32,116, 46,116,121,112,101,
+ 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32,
+ 32,114,101,116,117,114,110, 32,116, 10,101,110,100, 10, 10,108,111, 99, 97,108,
+ 32,102,117,110, 99,116,105,111,110, 32,115,112,117,116, 40,117, 44, 32, 98,111,
+100,121, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112,117,116,116, 32, 61,
+ 32,112, 97,114,115,101, 40,117, 41, 10, 32, 32, 32, 32,112,117,116,116, 46,115,
+111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, 99,101,
+ 46,115,116,114,105,110,103, 40, 98,111,100,121, 41, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32,116,112,117,116, 40,112,117,116,116, 41, 10,101,110,100, 10,
+ 10,112,117,116, 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116,101, 99,
+116, 40,102,117,110, 99,116,105,111,110, 40,112,117,116,116, 44, 32, 98,111,100,
+121, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112,101, 40,
+112,117,116,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32,116,104,
+101,110, 32,114,101,116,117,114,110, 32,115,112,117,116, 40,112,117,116,116, 44,
+ 32, 98,111,100,121, 41, 10, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,
+114,110, 32,116,112,117,116, 40,112,117,116,116, 41, 32,101,110,100, 10,101,110,
+100, 41, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,116,
+103,101,116, 40,103,101,116,116, 41, 10, 32, 32, 32, 32,103,101,116,116, 32, 61,
+ 32,111,118,101,114,114,105,100,101, 40,103,101,116,116, 41, 10, 32, 32, 32, 32,
+115,111, 99,107,101,116, 46,116,114,121, 40,103,101,116,116, 46,104,111,115,116,
+ 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,109,101, 34,
+ 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,111,112,101,110,
+ 40,103,101,116,116, 46,104,111,115,116, 44, 32,103,101,116,116, 46,112,111,114,
+116, 44, 32,103,101,116,116, 46, 99,114,101, 97,116,101, 41, 10, 32, 32, 32, 32,
+102, 58,103,114,101,101,116, 40, 41, 10, 32, 32, 32, 32,102, 58,108,111,103,105,
+110, 40,103,101,116,116, 46,117,115,101,114, 44, 32,103,101,116,116, 46,112, 97,
+115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,105,102, 32,103,101,116,116, 46,
+116,121,112,101, 32,116,104,101,110, 32,102, 58,116,121,112,101, 40,103,101,116,
+116, 46,116,121,112,101, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58,112, 97,
+115,118, 40, 41, 10, 32, 32, 32, 32,102, 58,114,101, 99,101,105,118,101, 40,103,
+101,116,116, 41, 10, 32, 32, 32, 32,102, 58,113,117,105,116, 40, 41, 10, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,102, 58, 99,108,111,115,101, 40, 41, 10,101,
+110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115,
+103,101,116, 40,117, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,103,101,116,
+116, 32, 61, 32,112, 97,114,115,101, 40,117, 41, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32,103,101,116,116, 46,115,
+105,110,107, 32, 61, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,116, 97, 98,
+108,101, 40,116, 41, 10, 32, 32, 32, 32,116,103,101,116, 40,103,101,116,116, 41,
+ 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,116, 97, 98,108,101, 46, 99,111,
+110, 99, 97,116, 40,116, 41, 10,101,110,100, 10, 10, 99,111,109,109, 97,110,100,
+ 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116,101, 99,116, 40,102,117,
+110, 99,116,105,111,110, 40, 99,109,100,116, 41, 10, 32, 32, 32, 32, 99,109,100,
+116, 32, 61, 32,111,118,101,114,114,105,100,101, 40, 99,109,100,116, 41, 10, 32,
+ 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40, 99,109,100,116, 46,104,
+111,115,116, 44, 32, 34,109,105,115,115,105,110,103, 32,104,111,115,116,110, 97,
+109,101, 34, 41, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,
+ 99,109,100,116, 46, 99,111,109,109, 97,110,100, 44, 32, 34,109,105,115,115,105,
+110,103, 32, 99,111,109,109, 97,110,100, 34, 41, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,102, 32, 61, 32,111,112,101,110, 40, 99,109,100,116, 46,104,111,115,
+116, 44, 32, 99,109,100,116, 46,112,111,114,116, 44, 32, 99,109,100,116, 46, 99,
+114,101, 97,116,101, 41, 10, 32, 32, 32, 32,102, 58,103,114,101,101,116, 40, 41,
+ 10, 32, 32, 32, 32,102, 58,108,111,103,105,110, 40, 99,109,100,116, 46,117,115,
+101,114, 44, 32, 99,109,100,116, 46,112, 97,115,115,119,111,114,100, 41, 10, 32,
+ 32, 32, 32,102, 46,116,114,121, 40,102, 46,116,112, 58, 99,111,109,109, 97,110,
+100, 40, 99,109,100,116, 46, 99,111,109,109, 97,110,100, 44, 32, 99,109,100,116,
+ 46, 97,114,103,117,109,101,110,116, 41, 41, 10, 32, 32, 32, 32,105,102, 32, 99,
+109,100,116, 46, 99,104,101, 99,107, 32,116,104,101,110, 32,102, 46,116,114,121,
+ 40,102, 46,116,112, 58, 99,104,101, 99,107, 40, 99,109,100,116, 46, 99,104,101,
+ 99,107, 41, 41, 32,101,110,100, 10, 32, 32, 32, 32,102, 58,113,117,105,116, 40,
+ 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102, 58, 99,108,111,115,101,
+ 40, 41, 10,101,110,100, 41, 10, 10,103,101,116, 32, 61, 32,115,111, 99,107,101,
+116, 46,112,114,111,116,101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,103,
+101,116,116, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112,
+101, 40,103,101,116,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32,
+116,104,101,110, 32,114,101,116,117,114,110, 32,115,103,101,116, 40,103,101,116,
+116, 41, 10, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,116,
+103,101,116, 40,103,101,116,116, 41, 32,101,110,100, 10,101,110,100, 41, 10, 10,
+
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/http.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/http.lua
new file mode 100644
index 00000000000..ad8db1ee065
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/http.lua
@@ -0,0 +1,350 @@
+-----------------------------------------------------------------------------
+-- HTTP/1.1 client support for the Lua language.
+-- LuaSocket toolkit.
+-- Author: Diego Nehab
+-- RCS ID: $Id: http.lua,v 1.71 2007/10/13 23:55:20 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module and import dependencies
+-------------------------------------------------------------------------------
+local socket = require("socket")
+local url = require("socket.url")
+local ltn12 = require("ltn12")
+local mime = require("mime")
+local string = require("string")
+local base = _G
+local table = require("table")
+module("socket.http")
+
+-----------------------------------------------------------------------------
+-- Program constants
+-----------------------------------------------------------------------------
+-- connection timeout in seconds
+TIMEOUT = 60
+-- default port for document retrieval
+PORT = 80
+-- user agent field sent in request
+USERAGENT = socket._VERSION
+
+-----------------------------------------------------------------------------
+-- Reads MIME headers from a connection, unfolding where needed
+-----------------------------------------------------------------------------
+local function receiveheaders(sock, headers)
+ local line, name, value, err
+ headers = headers or {}
+ -- get first line
+ line, err = sock:receive()
+ if err then return nil, err end
+ -- headers go until a blank line is found
+ while line ~= "" do
+ -- get field-name and value
+ name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)"))
+ if not (name and value) then return nil, "malformed reponse headers" end
+ name = string.lower(name)
+ -- get next line (value might be folded)
+ line, err = sock:receive()
+ if err then return nil, err end
+ -- unfold any folded values
+ while string.find(line, "^%s") do
+ value = value .. line
+ line = sock:receive()
+ if err then return nil, err end
+ end
+ -- save pair in table
+ if headers[name] then headers[name] = headers[name] .. ", " .. value
+ else headers[name] = value end
+ end
+ return headers
+end
+
+-----------------------------------------------------------------------------
+-- Extra sources and sinks
+-----------------------------------------------------------------------------
+socket.sourcet["http-chunked"] = function(sock, headers)
+ return base.setmetatable({
+ getfd = function() return sock:getfd() end,
+ dirty = function() return sock:dirty() end
+ }, {
+ __call = function()
+ -- get chunk size, skip extention
+ local line, err = sock:receive()
+ if err then return nil, err end
+ local size = base.tonumber(string.gsub(line, ";.*", ""), 16)
+ if not size then return nil, "invalid chunk size" end
+ -- was it the last chunk?
+ if size > 0 then
+ -- if not, get chunk and skip terminating CRLF
+ local chunk, err, part = sock:receive(size)
+ if chunk then sock:receive() end
+ return chunk, err
+ else
+ -- if it was, read trailers into headers table
+ headers, err = receiveheaders(sock, headers)
+ if not headers then return nil, err end
+ end
+ end
+ })
+end
+
+socket.sinkt["http-chunked"] = function(sock)
+ return base.setmetatable({
+ getfd = function() return sock:getfd() end,
+ dirty = function() return sock:dirty() end
+ }, {
+ __call = function(self, chunk, err)
+ if not chunk then return sock:send("0\r\n\r\n") end
+ local size = string.format("%X\r\n", string.len(chunk))
+ return sock:send(size .. chunk .. "\r\n")
+ end
+ })
+end
+
+-----------------------------------------------------------------------------
+-- Low level HTTP API
+-----------------------------------------------------------------------------
+local metat = { __index = {} }
+
+function open(host, port, create)
+ -- create socket with user connect function, or with default
+ local c = socket.try((create or socket.tcp)())
+ local h = base.setmetatable({ c = c }, metat)
+ -- create finalized try
+ h.try = socket.newtry(function() h:close() end)
+ -- set timeout before connecting
+ h.try(c:settimeout(TIMEOUT))
+ h.try(c:connect(host, port or PORT))
+ -- here everything worked
+ return h
+end
+
+function metat.__index:sendrequestline(method, uri)
+ local reqline = string.format("%s %s HTTP/1.1\r\n", method or "GET", uri)
+ return self.try(self.c:send(reqline))
+end
+
+function metat.__index:sendheaders(headers)
+ local h = "\r\n"
+ for i, v in base.pairs(headers) do
+ h = i .. ": " .. v .. "\r\n" .. h
+ end
+ self.try(self.c:send(h))
+ return 1
+end
+
+function metat.__index:sendbody(headers, source, step)
+ source = source or ltn12.source.empty()
+ step = step or ltn12.pump.step
+ -- if we don't know the size in advance, send chunked and hope for the best
+ local mode = "http-chunked"
+ if headers["content-length"] then mode = "keep-open" end
+ return self.try(ltn12.pump.all(source, socket.sink(mode, self.c), step))
+end
+
+function metat.__index:receivestatusline()
+ local status = self.try(self.c:receive(5))
+ -- identify HTTP/0.9 responses, which do not contain a status line
+ -- this is just a heuristic, but is what the RFC recommends
+ if status ~= "HTTP/" then return nil, status end
+ -- otherwise proceed reading a status line
+ status = self.try(self.c:receive("*l", status))
+ local code = socket.skip(2, string.find(status, "HTTP/%d*%.%d* (%d%d%d)"))
+ return self.try(base.tonumber(code), status)
+end
+
+function metat.__index:receiveheaders()
+ return self.try(receiveheaders(self.c))
+end
+
+function metat.__index:receivebody(headers, sink, step)
+ sink = sink or ltn12.sink.null()
+ step = step or ltn12.pump.step
+ local length = base.tonumber(headers["content-length"])
+ local t = headers["transfer-encoding"] -- shortcut
+ local mode = "default" -- connection close
+ if t and t ~= "identity" then mode = "http-chunked"
+ elseif base.tonumber(headers["content-length"]) then mode = "by-length" end
+ return self.try(ltn12.pump.all(socket.source(mode, self.c, length),
+ sink, step))
+end
+
+function metat.__index:receive09body(status, sink, step)
+ local source = ltn12.source.rewind(socket.source("until-closed", self.c))
+ source(status)
+ return self.try(ltn12.pump.all(source, sink, step))
+end
+
+function metat.__index:close()
+ return self.c:close()
+end
+
+-----------------------------------------------------------------------------
+-- High level HTTP API
+-----------------------------------------------------------------------------
+local function adjusturi(reqt)
+ local u = reqt
+ -- if there is a proxy, we need the full url. otherwise, just a part.
+ if not reqt.proxy and not PROXY then
+ u = {
+ path = socket.try(reqt.path, "invalid path 'nil'"),
+ params = reqt.params,
+ query = reqt.query,
+ fragment = reqt.fragment
+ }
+ end
+ return url.build(u)
+end
+
+local function adjustproxy(reqt)
+ local proxy = reqt.proxy or PROXY
+ if proxy then
+ proxy = url.parse(proxy)
+ return proxy.host, proxy.port or 3128
+ else
+ return reqt.host, reqt.port
+ end
+end
+
+local function adjustheaders(reqt)
+ -- default headers
+ local lower = {
+ ["user-agent"] = USERAGENT,
+ ["host"] = reqt.host,
+ ["connection"] = "close, TE",
+ ["te"] = "trailers"
+ }
+ -- if we have authentication information, pass it along
+ if reqt.user and reqt.password then
+ lower["authorization"] =
+ "Basic " .. (mime.b64(reqt.user .. ":" .. reqt.password))
+ end
+ -- override with user headers
+ for i,v in base.pairs(reqt.headers or lower) do
+ lower[string.lower(i)] = v
+ end
+ return lower
+end
+
+-- default url parts
+local default = {
+ host = "",
+ port = PORT,
+ path ="/",
+ scheme = "http"
+}
+
+local function adjustrequest(reqt)
+ -- parse url if provided
+ local nreqt = reqt.url and url.parse(reqt.url, default) or {}
+ -- explicit components override url
+ for i,v in base.pairs(reqt) do nreqt[i] = v end
+ if nreqt.port == "" then nreqt.port = 80 end
+ socket.try(nreqt.host and nreqt.host ~= "",
+ "invalid host '" .. base.tostring(nreqt.host) .. "'")
+ -- compute uri if user hasn't overriden
+ nreqt.uri = reqt.uri or adjusturi(nreqt)
+ -- ajust host and port if there is a proxy
+ nreqt.host, nreqt.port = adjustproxy(nreqt)
+ -- adjust headers in request
+ nreqt.headers = adjustheaders(nreqt)
+ return nreqt
+end
+
+local function shouldredirect(reqt, code, headers)
+ return headers.location and
+ string.gsub(headers.location, "%s", "") ~= "" and
+ (reqt.redirect ~= false) and
+ (code == 301 or code == 302) and
+ (not reqt.method or reqt.method == "GET" or reqt.method == "HEAD")
+ and (not reqt.nredirects or reqt.nredirects < 5)
+end
+
+local function shouldreceivebody(reqt, code)
+ if reqt.method == "HEAD" then return nil end
+ if code == 204 or code == 304 then return nil end
+ if code >= 100 and code < 200 then return nil end
+ return 1
+end
+
+-- forward declarations
+local trequest, tredirect
+
+function tredirect(reqt, location)
+ local result, code, headers, status = trequest {
+ -- the RFC says the redirect URL has to be absolute, but some
+ -- servers do not respect that
+ url = url.absolute(reqt.url, location),
+ source = reqt.source,
+ sink = reqt.sink,
+ headers = reqt.headers,
+ proxy = reqt.proxy,
+ nredirects = (reqt.nredirects or 0) + 1,
+ create = reqt.create
+ }
+ -- pass location header back as a hint we redirected
+ headers = headers or {}
+ headers.location = headers.location or location
+ return result, code, headers, status
+end
+
+function trequest(reqt)
+ -- we loop until we get what we want, or
+ -- until we are sure there is no way to get it
+ local nreqt = adjustrequest(reqt)
+ local h = open(nreqt.host, nreqt.port, nreqt.create)
+ -- send request line and headers
+ h:sendrequestline(nreqt.method, nreqt.uri)
+ h:sendheaders(nreqt.headers)
+ -- if there is a body, send it
+ if nreqt.source then
+ h:sendbody(nreqt.headers, nreqt.source, nreqt.step)
+ end
+ local code, status = h:receivestatusline()
+ -- if it is an HTTP/0.9 server, simply get the body and we are done
+ if not code then
+ h:receive09body(status, nreqt.sink, nreqt.step)
+ return 1, 200
+ end
+ local headers
+ -- ignore any 100-continue messages
+ while code == 100 do
+ headers = h:receiveheaders()
+ code, status = h:receivestatusline()
+ end
+ headers = h:receiveheaders()
+ -- at this point we should have a honest reply from the server
+ -- we can't redirect if we already used the source, so we report the error
+ if shouldredirect(nreqt, code, headers) and not nreqt.source then
+ h:close()
+ return tredirect(reqt, headers.location)
+ end
+ -- here we are finally done
+ if shouldreceivebody(nreqt, code) then
+ h:receivebody(headers, nreqt.sink, nreqt.step)
+ end
+ h:close()
+ return 1, code, headers, status
+end
+
+local function srequest(u, b)
+ local t = {}
+ local reqt = {
+ url = u,
+ sink = ltn12.sink.table(t)
+ }
+ if b then
+ reqt.source = ltn12.source.string(b)
+ reqt.headers = {
+ ["content-length"] = string.len(b),
+ ["content-type"] = "application/x-www-form-urlencoded"
+ }
+ reqt.method = "POST"
+ end
+ local code, headers, status = socket.skip(1, trequest(reqt))
+ return table.concat(t), code, headers, status
+end
+
+request = socket.protect(function(reqt, body)
+ if base.type(reqt) == "string" then return srequest(reqt, body)
+ else return trequest(reqt) end
+end)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/http_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/http_lua.c
new file mode 100644
index 00000000000..fa287503798
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/http_lua.c
@@ -0,0 +1,623 @@
+/*
+ * This file is auto-generated by "./lua2c http.lua http_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_http_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 72, 84, 84, 80, 47, 49, 46, 49, 32, 99,108,105,101,110,116, 32,115,117,112,
+112,111,114,116, 32,102,111,114, 32,116,104,101, 32, 76,117, 97, 32,108, 97,110,
+103,117, 97,103,101, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32,
+116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32,
+ 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73,
+ 68, 58, 32, 36, 73,100, 58, 32,104,116,116,112, 46,108,117, 97, 44,118, 32, 49,
+ 46, 55, 49, 32, 50, 48, 48, 55, 47, 49, 48, 47, 49, 51, 32, 50, 51, 58, 53, 53,
+ 58, 50, 48, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108,
+ 97,114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,
+116, 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108,
+ 32,115,111, 99,107,101,116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,
+111, 99,107,101,116, 34, 41, 10,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32,
+114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34,
+ 41, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32, 61, 32,114,101,113,117,
+105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,108,111, 99, 97,108, 32,109,
+105,109,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,109,105,109,101, 34,
+ 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114,101,113,
+117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108,111, 99, 97,108,
+ 32, 98, 97,115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,116, 97, 98,
+108,101, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,116, 97, 98,108,101, 34,
+ 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101,116, 46,104,116,116,
+112, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 10, 45, 45, 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97,
+110,116,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 10, 45, 45, 32, 99,111,110,110,101, 99,116,105,111,110, 32,116,105,109,101,
+111,117,116, 32,105,110, 32,115,101, 99,111,110,100,115, 10, 84, 73, 77, 69, 79,
+ 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100,101,102, 97,117,108,116, 32,112,
+111,114,116, 32,102,111,114, 32,100,111, 99,117,109,101,110,116, 32,114,101,116,
+114,105,101,118, 97,108, 10, 80, 79, 82, 84, 32, 61, 32, 56, 48, 10, 45, 45, 32,
+117,115,101,114, 32, 97,103,101,110,116, 32,102,105,101,108,100, 32,115,101,110,
+116, 32,105,110, 32,114,101,113,117,101,115,116, 10, 85, 83, 69, 82, 65, 71, 69,
+ 78, 84, 32, 61, 32,115,111, 99,107,101,116, 46, 95, 86, 69, 82, 83, 73, 79, 78,
+ 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,
+ 45, 45, 32, 82,101, 97,100,115, 32, 77, 73, 77, 69, 32,104,101, 97,100,101,114,
+115, 32,102,114,111,109, 32, 97, 32, 99,111,110,110,101, 99,116,105,111,110, 44,
+ 32,117,110,102,111,108,100,105,110,103, 32,119,104,101,114,101, 32,110,101,101,
+100,101,100, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,114,101, 99,
+101,105,118,101,104,101, 97,100,101,114,115, 40,115,111, 99,107, 44, 32,104,101,
+ 97,100,101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,105,110,
+101, 44, 32,110, 97,109,101, 44, 32,118, 97,108,117,101, 44, 32,101,114,114, 10,
+ 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104,101, 97,100,101,114,
+115, 32,111,114, 32,123,125, 10, 32, 32, 32, 32, 45, 45, 32,103,101,116, 32,102,
+105,114,115,116, 32,108,105,110,101, 10, 32, 32, 32, 32,108,105,110,101, 44, 32,
+101,114,114, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41,
+ 10, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116,
+117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32,
+ 32, 45, 45, 32,104,101, 97,100,101,114,115, 32,103,111, 32,117,110,116,105,108,
+ 32, 97, 32, 98,108, 97,110,107, 32,108,105,110,101, 32,105,115, 32,102,111,117,
+110,100, 10, 32, 32, 32, 32,119,104,105,108,101, 32,108,105,110,101, 32,126, 61,
+ 32, 34, 34, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,103,101,
+116, 32,102,105,101,108,100, 45,110, 97,109,101, 32, 97,110,100, 32,118, 97,108,
+117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,110, 97,109,101, 44, 32,118, 97,108,
+117,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,
+115,116,114,105,110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94,
+ 40, 46, 45, 41, 58, 37,115, 42, 40, 46, 42, 41, 34, 41, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,105,102, 32,110,111,116, 32, 40,110, 97,109,101, 32, 97,110,100,
+ 32,118, 97,108,117,101, 41, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,
+110,105,108, 44, 32, 34,109, 97,108,102,111,114,109,101,100, 32,114,101,112,111,
+110,115,101, 32,104,101, 97,100,101,114,115, 34, 32,101,110,100, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32,110, 97,109,101, 32, 61, 32,115,116,114,105,110,103, 46,108,
+111,119,101,114, 40,110, 97,109,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45,
+ 45, 32,103,101,116, 32,110,101,120,116, 32,108,105,110,101, 32, 40,118, 97,108,
+117,101, 32,109,105,103,104,116, 32, 98,101, 32,102,111,108,100,101,100, 41, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32,108,105,110,101, 44, 32,101,114,114, 32, 32, 61,
+ 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116,117,
+114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 45, 45, 32,117,110,102,111,108,100, 32, 97,110,121, 32,102,111,
+108,100,101,100, 32,118, 97,108,117,101,115, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+119,104,105,108,101, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,108,105,
+110,101, 44, 32, 34, 94, 37,115, 34, 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,118, 97,108,117,101, 32, 61, 32,118, 97,108,117,101, 32,
+ 46, 46, 32,108,105,110,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+108,105,110,101, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40,
+ 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114,
+ 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,
+114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 45, 45, 32,115, 97,118,101, 32,112, 97,105,114, 32,105,
+110, 32,116, 97, 98,108,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,104,
+101, 97,100,101,114,115, 91,110, 97,109,101, 93, 32,116,104,101,110, 32,104,101,
+ 97,100,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,104,101, 97,100,101,114,
+115, 91,110, 97,109,101, 93, 32, 46, 46, 32, 34, 44, 32, 34, 32, 46, 46, 32,118,
+ 97,108,117,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,104,101,
+ 97,100,101,114,115, 91,110, 97,109,101, 93, 32, 61, 32,118, 97,108,117,101, 32,
+101,110,100, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,104,101, 97,100,101,114,115, 10,101,110,100, 10, 10, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 69,120,116,
+114, 97, 32,115,111,117,114, 99,101,115, 32, 97,110,100, 32,115,105,110,107,115,
+ 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,115,
+111, 99,107,101,116, 46,115,111,117,114, 99,101,116, 91, 34,104,116,116,112, 45,
+ 99,104,117,110,107,101,100, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110,
+ 40,115,111, 99,107, 44, 32,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32,
+114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116,
+ 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100,
+ 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110,
+ 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116,
+105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105,
+114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99,
+116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 45,
+ 45, 32,103,101,116, 32, 99,104,117,110,107, 32,115,105,122,101, 44, 32,115,107,
+105,112, 32,101,120,116,101,110,116,105,111,110, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,105,110,101, 44, 32,101,114,114,
+ 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,
+110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,
+100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,
+115,105,122,101, 32, 61, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114,
+ 40,115,116,114,105,110,103, 46,103,115,117, 98, 40,108,105,110,101, 44, 32, 34,
+ 59, 46, 42, 34, 44, 32, 34, 34, 41, 44, 32, 49, 54, 41, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,105,122,101, 32,116,
+104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32, 34,105,110,118,
+ 97,108,105,100, 32, 99,104,117,110,107, 32,115,105,122,101, 34, 32,101,110,100,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,119, 97,115, 32,
+105,116, 32,116,104,101, 32,108, 97,115,116, 32, 99,104,117,110,107, 63, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,105,122,101, 32, 62,
+ 32, 48, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 45, 45, 32,105,102, 32,110,111,116, 44, 32,103,101,116, 32, 99,
+104,117,110,107, 32, 97,110,100, 32,115,107,105,112, 32,116,101,114,109,105,110,
+ 97,116,105,110,103, 32, 67, 82, 76, 70, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,
+101,114,114, 44, 32,112, 97,114,116, 32, 61, 32,115,111, 99,107, 58,114,101, 99,
+101,105,118,101, 40,115,105,122,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, 32,116,104,101,110,
+ 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40, 41, 32,101,110,100, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,
+114,110, 32, 99,104,117,110,107, 44, 32,101,114,114, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,105,102, 32,105,116, 32,119, 97,115, 44,
+ 32,114,101, 97,100, 32,116,114, 97,105,108,101,114,115, 32,105,110,116,111, 32,
+104,101, 97,100,101,114,115, 32,116, 97, 98,108,101, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 44, 32,101,
+114,114, 32, 61, 32,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40,
+115,111, 99,107, 44, 32,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,104,101,
+ 97,100,101,114,115, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,
+108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32,
+ 32, 32, 32,125, 41, 10,101,110,100, 10, 10,115,111, 99,107,101,116, 46,115,105,
+110,107,116, 91, 34,104,116,116,112, 45, 99,104,117,110,107,101,100, 34, 93, 32,
+ 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, 32, 32, 32,
+ 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,
+116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,
+100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,
+110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,
+116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,
+105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110,
+ 99,116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, 44, 32,101,
+114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,
+111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110,
+ 32,115,111, 99,107, 58,115,101,110,100, 40, 34, 48, 92,114, 92,110, 92,114, 92,
+110, 34, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+108,111, 99, 97,108, 32,115,105,122,101, 32, 61, 32,115,116,114,105,110,103, 46,
+102,111,114,109, 97,116, 40, 34, 37, 88, 92,114, 92,110, 34, 44, 32,115,116,114,
+105,110,103, 46,108,101,110, 40, 99,104,117,110,107, 41, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,
+115,101,110,100, 40,115,105,122,101, 32, 46, 46, 32, 32, 99,104,117,110,107, 32,
+ 46, 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,
+110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32,
+108,101,118,101,108, 32, 72, 84, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109,
+101,116, 97,116, 32, 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123,
+125, 32,125, 10, 10,102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,104,
+111,115,116, 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32,
+ 32, 32, 32, 45, 45, 32, 99,114,101, 97,116,101, 32,115,111, 99,107,101,116, 32,
+119,105,116,104, 32,117,115,101,114, 32, 99,111,110,110,101, 99,116, 32,102,117,
+110, 99,116,105,111,110, 44, 32,111,114, 32,119,105,116,104, 32,100,101,102, 97,
+117,108,116, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99, 32, 61, 32,115,111,
+ 99,107,101,116, 46,116,114,121, 40, 40, 99,114,101, 97,116,101, 32,111,114, 32,
+115,111, 99,107,101,116, 46,116, 99,112, 41, 40, 41, 41, 10, 32, 32, 32, 32,108,
+111, 99, 97,108, 32,104, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116,
+ 97,116, 97, 98,108,101, 40,123, 32, 99, 32, 61, 32, 99, 32,125, 44, 32,109,101,
+116, 97,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, 99,114,101, 97,116,101, 32,102,
+105,110, 97,108,105,122,101,100, 32,116,114,121, 10, 32, 32, 32, 32,104, 46,116,
+114,121, 32, 61, 32,115,111, 99,107,101,116, 46,110,101,119,116,114,121, 40,102,
+117,110, 99,116,105,111,110, 40, 41, 32,104, 58, 99,108,111,115,101, 40, 41, 32,
+101,110,100, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,116, 32,116,105,109,101,
+111,117,116, 32, 98,101,102,111,114,101, 32, 99,111,110,110,101, 99,116,105,110,
+103, 10, 32, 32, 32, 32,104, 46,116,114,121, 40, 99, 58,115,101,116,116,105,109,
+101,111,117,116, 40, 84, 73, 77, 69, 79, 85, 84, 41, 41, 10, 32, 32, 32, 32,104,
+ 46,116,114,121, 40, 99, 58, 99,111,110,110,101, 99,116, 40,104,111,115,116, 44,
+ 32,112,111,114,116, 32,111,114, 32, 80, 79, 82, 84, 41, 41, 10, 32, 32, 32, 32,
+ 45, 45, 32,104,101,114,101, 32,101,118,101,114,121,116,104,105,110,103, 32,119,
+111,114,107,101,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,104, 10,101,
+110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95,
+ 95,105,110,100,101,120, 58,115,101,110,100,114,101,113,117,101,115,116,108,105,
+110,101, 40,109,101,116,104,111,100, 44, 32,117,114,105, 41, 10, 32, 32, 32, 32,
+108,111, 99, 97,108, 32,114,101,113,108,105,110,101, 32, 61, 32,115,116,114,105,
+110,103, 46,102,111,114,109, 97,116, 40, 34, 37,115, 32, 37,115, 32, 72, 84, 84,
+ 80, 47, 49, 46, 49, 92,114, 92,110, 34, 44, 32,109,101,116,104,111,100, 32,111,
+114, 32, 34, 71, 69, 84, 34, 44, 32,117,114,105, 41, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46, 99,
+ 58,115,101,110,100, 40,114,101,113,108,105,110,101, 41, 41, 10,101,110,100, 10,
+ 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,
+100,101,120, 58,115,101,110,100,104,101, 97,100,101,114,115, 40,104,101, 97,100,
+101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, 61, 32, 34,
+ 92,114, 92,110, 34, 10, 32, 32, 32, 32,102,111,114, 32,105, 44, 32,118, 32,105,
+110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101,114,115,
+ 41, 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 32, 61, 32,105, 32, 46,
+ 46, 32, 34, 58, 32, 34, 32, 46, 46, 32,118, 32, 46, 46, 32, 34, 92,114, 92,110,
+ 34, 32, 46, 46, 32,104, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,115,
+101,108,102, 46,116,114,121, 40,115,101,108,102, 46, 99, 58,115,101,110,100, 40,
+104, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100,
+ 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,
+110,100,101,120, 58,115,101,110,100, 98,111,100,121, 40,104,101, 97,100,101,114,
+115, 44, 32,115,111,117,114, 99,101, 44, 32,115,116,101,112, 41, 10, 32, 32, 32,
+ 32,115,111,117,114, 99,101, 32, 61, 32,115,111,117,114, 99,101, 32,111,114, 32,
+108,116,110, 49, 50, 46,115,111,117,114, 99,101, 46,101,109,112,116,121, 40, 41,
+ 10, 32, 32, 32, 32,115,116,101,112, 32, 61, 32,115,116,101,112, 32,111,114, 32,
+108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32, 32, 32,
+ 45, 45, 32,105,102, 32,119,101, 32,100,111,110, 39,116, 32,107,110,111,119, 32,
+116,104,101, 32,115,105,122,101, 32,105,110, 32, 97,100,118, 97,110, 99,101, 44,
+ 32,115,101,110,100, 32, 99,104,117,110,107,101,100, 32, 97,110,100, 32,104,111,
+112,101, 32,102,111,114, 32,116,104,101, 32, 98,101,115,116, 10, 32, 32, 32, 32,
+108,111, 99, 97,108, 32,109,111,100,101, 32, 61, 32, 34,104,116,116,112, 45, 99,
+104,117,110,107,101,100, 34, 10, 32, 32, 32, 32,105,102, 32,104,101, 97,100,101,
+114,115, 91, 34, 99,111,110,116,101,110,116, 45,108,101,110,103,116,104, 34, 93,
+ 32,116,104,101,110, 32,109,111,100,101, 32, 61, 32, 34,107,101,101,112, 45,111,
+112,101,110, 34, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,
+115,101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46,
+ 97,108,108, 40,115,111,117,114, 99,101, 44, 32,115,111, 99,107,101,116, 46,115,
+105,110,107, 40,109,111,100,101, 44, 32,115,101,108,102, 46, 99, 41, 44, 32,115,
+116,101,112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,
+109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118,
+101,115,116, 97,116,117,115,108,105,110,101, 40, 41, 10, 32, 32, 32, 32,108,111,
+ 99, 97,108, 32,115,116, 97,116,117,115, 32, 61, 32,115,101,108,102, 46,116,114,
+121, 40,115,101,108,102, 46, 99, 58,114,101, 99,101,105,118,101, 40, 53, 41, 41,
+ 10, 32, 32, 32, 32, 45, 45, 32,105,100,101,110,116,105,102,121, 32, 72, 84, 84,
+ 80, 47, 48, 46, 57, 32,114,101,115,112,111,110,115,101,115, 44, 32,119,104,105,
+ 99,104, 32,100,111, 32,110,111,116, 32, 99,111,110,116, 97,105,110, 32, 97, 32,
+115,116, 97,116,117,115, 32,108,105,110,101, 10, 32, 32, 32, 32, 45, 45, 32,116,
+104,105,115, 32,105,115, 32,106,117,115,116, 32, 97, 32,104,101,117,114,105,115,
+116,105, 99, 44, 32, 98,117,116, 32,105,115, 32,119,104, 97,116, 32,116,104,101,
+ 32, 82, 70, 67, 32,114,101, 99,111,109,109,101,110,100,115, 10, 32, 32, 32, 32,
+105,102, 32,115,116, 97,116,117,115, 32,126, 61, 32, 34, 72, 84, 84, 80, 47, 34,
+ 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,115,116,
+ 97,116,117,115, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,111,116,104,101,
+114,119,105,115,101, 32,112,114,111, 99,101,101,100, 32,114,101, 97,100,105,110,
+103, 32, 97, 32,115,116, 97,116,117,115, 32,108,105,110,101, 10, 32, 32, 32, 32,
+115,116, 97,116,117,115, 32, 61, 32,115,101,108,102, 46,116,114,121, 40,115,101,
+108,102, 46, 99, 58,114,101, 99,101,105,118,101, 40, 34, 42,108, 34, 44, 32,115,
+116, 97,116,117,115, 41, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,
+100,101, 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,
+115,116,114,105,110,103, 46,102,105,110,100, 40,115,116, 97,116,117,115, 44, 32,
+ 34, 72, 84, 84, 80, 47, 37,100, 42, 37, 46, 37,100, 42, 32, 40, 37,100, 37,100,
+ 37,100, 41, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,
+108,102, 46,116,114,121, 40, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114,
+ 40, 99,111,100,101, 41, 44, 32,115,116, 97,116,117,115, 41, 10,101,110,100, 10,
+ 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,
+100,101,120, 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, 41,
+ 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116,114,121,
+ 40,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40,115,101,108,102,
+ 46, 99, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,
+101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118,101,
+ 98,111,100,121, 40,104,101, 97,100,101,114,115, 44, 32,115,105,110,107, 44, 32,
+115,116,101,112, 41, 10, 32, 32, 32, 32,115,105,110,107, 32, 61, 32,115,105,110,
+107, 32,111,114, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,110,117,108,108,
+ 40, 41, 10, 32, 32, 32, 32,115,116,101,112, 32, 61, 32,115,116,101,112, 32,111,
+114, 32,108,116,110, 49, 50, 46,112,117,109,112, 46,115,116,101,112, 10, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32,108,101,110,103,116,104, 32, 61, 32, 98, 97,115,
+101, 46,116,111,110,117,109, 98,101,114, 40,104,101, 97,100,101,114,115, 91, 34,
+ 99,111,110,116,101,110,116, 45,108,101,110,103,116,104, 34, 93, 41, 10, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,104,101, 97,100,101,114,115, 91,
+ 34,116,114, 97,110,115,102,101,114, 45,101,110, 99,111,100,105,110,103, 34, 93,
+ 32, 45, 45, 32,115,104,111,114,116, 99,117,116, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,109,111,100,101, 32, 61, 32, 34,100,101,102, 97,117,108,116, 34, 32,
+ 45, 45, 32, 99,111,110,110,101, 99,116,105,111,110, 32, 99,108,111,115,101, 10,
+ 32, 32, 32, 32,105,102, 32,116, 32, 97,110,100, 32,116, 32,126, 61, 32, 34,105,
+100,101,110,116,105,116,121, 34, 32,116,104,101,110, 32,109,111,100,101, 32, 61,
+ 32, 34,104,116,116,112, 45, 99,104,117,110,107,101,100, 34, 10, 32, 32, 32, 32,
+101,108,115,101,105,102, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114,
+ 40,104,101, 97,100,101,114,115, 91, 34, 99,111,110,116,101,110,116, 45,108,101,
+110,103,116,104, 34, 93, 41, 32,116,104,101,110, 32,109,111,100,101, 32, 61, 32,
+ 34, 98,121, 45,108,101,110,103,116,104, 34, 32,101,110,100, 10, 32, 32, 32, 32,
+114,101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,108,116,110, 49,
+ 50, 46,112,117,109,112, 46, 97,108,108, 40,115,111, 99,107,101,116, 46,115,111,
+117,114, 99,101, 40,109,111,100,101, 44, 32,115,101,108,102, 46, 99, 44, 32,108,
+101,110,103,116,104, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,105,110,107,
+ 44, 32,115,116,101,112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,
+111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,
+101,105,118,101, 48, 57, 98,111,100,121, 40,115,116, 97,116,117,115, 44, 32,115,
+105,110,107, 44, 32,115,116,101,112, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108,
+ 32,115,111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114,
+ 99,101, 46,114,101,119,105,110,100, 40,115,111, 99,107,101,116, 46,115,111,117,
+114, 99,101, 40, 34,117,110,116,105,108, 45, 99,108,111,115,101,100, 34, 44, 32,
+115,101,108,102, 46, 99, 41, 41, 10, 32, 32, 32, 32,115,111,117,114, 99,101, 40,
+115,116, 97,116,117,115, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,
+101,108,102, 46,116,114,121, 40,108,116,110, 49, 50, 46,112,117,109,112, 46, 97,
+108,108, 40,115,111,117,114, 99,101, 44, 32,115,105,110,107, 44, 32,115,116,101,
+112, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,
+116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,108,111,115,101, 40, 41, 10,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58, 99,108,
+111,115,101, 40, 41, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, 32,108,101,118,
+101,108, 32, 72, 84, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,102,117,110, 99,
+116,105,111,110, 32, 97,100,106,117,115,116,117,114,105, 40,114,101,113,116, 41,
+ 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117, 32, 61, 32,114,101,113,116, 10,
+ 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115, 32, 97,
+ 32,112,114,111,120,121, 44, 32,119,101, 32,110,101,101,100, 32,116,104,101, 32,
+102,117,108,108, 32,117,114,108, 46, 32,111,116,104,101,114,119,105,115,101, 44,
+ 32,106,117,115,116, 32, 97, 32,112, 97,114,116, 46, 10, 32, 32, 32, 32,105,102,
+ 32,110,111,116, 32,114,101,113,116, 46,112,114,111,120,121, 32, 97,110,100, 32,
+110,111,116, 32, 80, 82, 79, 88, 89, 32,116,104,101,110, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32,117, 32, 61, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+112, 97,116,104, 32, 61, 32,115,111, 99,107,101,116, 46,116,114,121, 40,114,101,
+113,116, 46,112, 97,116,104, 44, 32, 34,105,110,118, 97,108,105,100, 32,112, 97,
+116,104, 32, 39,110,105,108, 39, 34, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,112, 97,114, 97,109,115, 32, 61, 32,114,101,113,116, 46,112, 97,114,
+ 97,109,115, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,113,117,101,114,
+121, 32, 61, 32,114,101,113,116, 46,113,117,101,114,121, 44, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,102,114, 97,103,109,101,110,116, 32, 61, 32,114,101,
+113,116, 46,102,114, 97,103,109,101,110,116, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+125, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110,
+ 32,117,114,108, 46, 98,117,105,108,100, 40,117, 41, 10,101,110,100, 10, 10,108,
+111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116,
+112,114,111,120,121, 40,114,101,113,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,
+108, 32,112,114,111,120,121, 32, 61, 32,114,101,113,116, 46,112,114,111,120,121,
+ 32,111,114, 32, 80, 82, 79, 88, 89, 10, 32, 32, 32, 32,105,102, 32,112,114,111,
+120,121, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,112,114,111,120,
+121, 32, 61, 32,117,114,108, 46,112, 97,114,115,101, 40,112,114,111,120,121, 41,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,112,114,111,120,
+121, 46,104,111,115,116, 44, 32,112,114,111,120,121, 46,112,111,114,116, 32,111,
+114, 32, 51, 49, 50, 56, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,113,116, 46,104,111,115,116,
+ 44, 32,114,101,113,116, 46,112,111,114,116, 10, 32, 32, 32, 32,101,110,100, 10,
+101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,
+ 97,100,106,117,115,116,104,101, 97,100,101,114,115, 40,114,101,113,116, 41, 10,
+ 32, 32, 32, 32, 45, 45, 32,100,101,102, 97,117,108,116, 32,104,101, 97,100,101,
+114,115, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,111,119,101,114, 32, 61,
+ 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34,117,115,101,114, 45, 97,103,
+101,110,116, 34, 93, 32, 61, 32, 85, 83, 69, 82, 65, 71, 69, 78, 84, 44, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 91, 34,104,111,115,116, 34, 93, 32, 61, 32,114,101,
+113,116, 46,104,111,115,116, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99,
+111,110,110,101, 99,116,105,111,110, 34, 93, 32, 61, 32, 34, 99,108,111,115,101,
+ 44, 32, 84, 69, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34,116,101, 34,
+ 93, 32, 61, 32, 34,116,114, 97,105,108,101,114,115, 34, 10, 32, 32, 32, 32,125,
+ 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,119,101, 32,104, 97,118,101, 32, 97,
+117,116,104,101,110,116,105, 99, 97,116,105,111,110, 32,105,110,102,111,114,109,
+ 97,116,105,111,110, 44, 32,112, 97,115,115, 32,105,116, 32, 97,108,111,110,103,
+ 10, 32, 32, 32, 32,105,102, 32,114,101,113,116, 46,117,115,101,114, 32, 97,110,
+100, 32,114,101,113,116, 46,112, 97,115,115,119,111,114,100, 32,116,104,101,110,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111,119,101,114, 91, 34, 97,117,116,104,
+111,114,105,122, 97,116,105,111,110, 34, 93, 32, 61, 32, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 34, 66, 97,115,105, 99, 32, 34, 32, 46, 46, 32, 32,
+ 40,109,105,109,101, 46, 98, 54, 52, 40,114,101,113,116, 46,117,115,101,114, 32,
+ 46, 46, 32, 34, 58, 34, 32, 46, 46, 32,114,101,113,116, 46,112, 97,115,115,119,
+111,114,100, 41, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45,
+ 32,111,118,101,114,114,105,100,101, 32,119,105,116,104, 32,117,115,101,114, 32,
+104,101, 97,100,101,114,115, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,
+105,110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,114,101,113,116, 46,104,
+101, 97,100,101,114,115, 32,111,114, 32,108,111,119,101,114, 41, 32,100,111, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32,108,111,119,101,114, 91,115,116,114,105,110,103,
+ 46,108,111,119,101,114, 40,105, 41, 93, 32, 61, 32,118, 10, 32, 32, 32, 32,101,
+110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,111,119,101,114, 10,
+101,110,100, 10, 10, 45, 45, 32,100,101,102, 97,117,108,116, 32,117,114,108, 32,
+112, 97,114,116,115, 10,108,111, 99, 97,108, 32,100,101,102, 97,117,108,116, 32,
+ 61, 32,123, 10, 32, 32, 32, 32,104,111,115,116, 32, 61, 32, 34, 34, 44, 10, 32,
+ 32, 32, 32,112,111,114,116, 32, 61, 32, 80, 79, 82, 84, 44, 10, 32, 32, 32, 32,
+112, 97,116,104, 32, 61, 34, 47, 34, 44, 10, 32, 32, 32, 32,115, 99,104,101,109,
+101, 32, 61, 32, 34,104,116,116,112, 34, 10,125, 10, 10,108,111, 99, 97,108, 32,
+102,117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116,114,101,113,117,101,
+115,116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,112, 97,114,115,
+101, 32,117,114,108, 32,105,102, 32,112,114,111,118,105,100,101,100, 10, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32,110,114,101,113,116, 32, 61, 32,114,101,113,116,
+ 46,117,114,108, 32, 97,110,100, 32,117,114,108, 46,112, 97,114,115,101, 40,114,
+101,113,116, 46,117,114,108, 44, 32,100,101,102, 97,117,108,116, 41, 32,111,114,
+ 32,123,125, 10, 32, 32, 32, 32, 45, 45, 32,101,120,112,108,105, 99,105,116, 32,
+ 99,111,109,112,111,110,101,110,116,115, 32,111,118,101,114,114,105,100,101, 32,
+117,114,108, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98,
+ 97,115,101, 46,112, 97,105,114,115, 40,114,101,113,116, 41, 32,100,111, 32,110,
+114,101,113,116, 91,105, 93, 32, 61, 32,118, 32,101,110,100, 10, 32, 32, 32, 32,
+105,102, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, 61, 32, 34, 34, 32,
+116,104,101,110, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61, 32, 56, 48,
+ 32,101,110,100, 10, 32, 32, 32, 32,115,111, 99,107,101,116, 46,116,114,121, 40,
+110,114,101,113,116, 46,104,111,115,116, 32, 97,110,100, 32,110,114,101,113,116,
+ 46,104,111,115,116, 32,126, 61, 32, 34, 34, 44, 32, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 34,105,110,118, 97,108,105,100, 32,104,111,115,116, 32, 39, 34, 32, 46,
+ 46, 32, 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110,114,101,113,
+116, 46,104,111,115,116, 41, 32, 46, 46, 32, 34, 39, 34, 41, 10, 32, 32, 32, 32,
+ 45, 45, 32, 99,111,109,112,117,116,101, 32,117,114,105, 32,105,102, 32,117,115,
+101,114, 32,104, 97,115,110, 39,116, 32,111,118,101,114,114,105,100,101,110, 10,
+ 32, 32, 32, 32,110,114,101,113,116, 46,117,114,105, 32, 61, 32,114,101,113,116,
+ 46,117,114,105, 32,111,114, 32, 97,100,106,117,115,116,117,114,105, 40,110,114,
+101,113,116, 41, 10, 32, 32, 32, 32, 45, 45, 32, 97,106,117,115,116, 32,104,111,
+115,116, 32, 97,110,100, 32,112,111,114,116, 32,105,102, 32,116,104,101,114,101,
+ 32,105,115, 32, 97, 32,112,114,111,120,121, 10, 32, 32, 32, 32,110,114,101,113,
+116, 46,104,111,115,116, 44, 32,110,114,101,113,116, 46,112,111,114,116, 32, 61,
+ 32, 97,100,106,117,115,116,112,114,111,120,121, 40,110,114,101,113,116, 41, 10,
+ 32, 32, 32, 32, 45, 45, 32, 97,100,106,117,115,116, 32,104,101, 97,100,101,114,
+115, 32,105,110, 32,114,101,113,117,101,115,116, 10, 32, 32, 32, 32,110,114,101,
+113,116, 46,104,101, 97,100,101,114,115, 32, 61, 32, 97,100,106,117,115,116,104,
+101, 97,100,101,114,115, 40,110,114,101,113,116, 41, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32,110,114,101,113,116, 10,101,110,100, 10, 10,108,111, 99, 97,
+108, 32,102,117,110, 99,116,105,111,110, 32,115,104,111,117,108,100,114,101,100,
+105,114,101, 99,116, 40,114,101,113,116, 44, 32, 99,111,100,101, 44, 32,104,101,
+ 97,100,101,114,115, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,104,101,
+ 97,100,101,114,115, 46,108,111, 99, 97,116,105,111,110, 32, 97,110,100, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116,114,105,110,103, 46,103,115,117,
+ 98, 40,104,101, 97,100,101,114,115, 46,108,111, 99, 97,116,105,111,110, 44, 32,
+ 34, 37,115, 34, 44, 32, 34, 34, 41, 32,126, 61, 32, 34, 34, 32, 97,110,100, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40,114,101,113,116, 46,114,101,100,
+105,114,101, 99,116, 32,126, 61, 32,102, 97,108,115,101, 41, 32, 97,110,100, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 99,111,100,101, 32, 61, 61, 32,
+ 51, 48, 49, 32,111,114, 32, 99,111,100,101, 32, 61, 61, 32, 51, 48, 50, 41, 32,
+ 97,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40,110,111,116, 32,
+114,101,113,116, 46,109,101,116,104,111,100, 32,111,114, 32,114,101,113,116, 46,
+109,101,116,104,111,100, 32, 61, 61, 32, 34, 71, 69, 84, 34, 32,111,114, 32,114,
+101,113,116, 46,109,101,116,104,111,100, 32, 61, 61, 32, 34, 72, 69, 65, 68, 34,
+ 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 97,110,100, 32, 40,110,111,
+116, 32,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32,111,114,
+ 32,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32, 60, 32, 53,
+ 41, 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,
+110, 32,115,104,111,117,108,100,114,101, 99,101,105,118,101, 98,111,100,121, 40,
+114,101,113,116, 44, 32, 99,111,100,101, 41, 10, 32, 32, 32, 32,105,102, 32,114,
+101,113,116, 46,109,101,116,104,111,100, 32, 61, 61, 32, 34, 72, 69, 65, 68, 34,
+ 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 32,101,110,100,
+ 10, 32, 32, 32, 32,105,102, 32, 99,111,100,101, 32, 61, 61, 32, 50, 48, 52, 32,
+111,114, 32, 99,111,100,101, 32, 61, 61, 32, 51, 48, 52, 32,116,104,101,110, 32,
+114,101,116,117,114,110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,105,
+102, 32, 99,111,100,101, 32, 62, 61, 32, 49, 48, 48, 32, 97,110,100, 32, 99,111,
+100,101, 32, 60, 32, 50, 48, 48, 32,116,104,101,110, 32,114,101,116,117,114,110,
+ 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,
+ 49, 10,101,110,100, 10, 10, 45, 45, 32,102,111,114,119, 97,114,100, 32,100,101,
+ 99,108, 97,114, 97,116,105,111,110,115, 10,108,111, 99, 97,108, 32,116,114,101,
+113,117,101,115,116, 44, 32,116,114,101,100,105,114,101, 99,116, 10, 10,102,117,
+110, 99,116,105,111,110, 32,116,114,101,100,105,114,101, 99,116, 40,114,101,113,
+116, 44, 32,108,111, 99, 97,116,105,111,110, 41, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,114,101,115,117,108,116, 44, 32, 99,111,100,101, 44, 32,104,101, 97,
+100,101,114,115, 44, 32,115,116, 97,116,117,115, 32, 61, 32,116,114,101,113,117,
+101,115,116, 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32,116,104,101,
+ 32, 82, 70, 67, 32,115, 97,121,115, 32,116,104,101, 32,114,101,100,105,114,101,
+ 99,116, 32, 85, 82, 76, 32,104, 97,115, 32,116,111, 32, 98,101, 32, 97, 98,115,
+111,108,117,116,101, 44, 32, 98,117,116, 32,115,111,109,101, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 45, 45, 32,115,101,114,118,101,114,115, 32,100,111, 32,110,111,
+116, 32,114,101,115,112,101, 99,116, 32,116,104, 97,116, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32,117,114,108, 32, 61, 32,117,114,108, 46, 97, 98,115,111,108,117,116,
+101, 40,114,101,113,116, 46,117,114,108, 44, 32,108,111, 99, 97,116,105,111,110,
+ 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,111,117,114, 99,101, 32, 61, 32,
+114,101,113,116, 46,115,111,117,114, 99,101, 44, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,115,105,110,107, 32, 61, 32,114,101,113,116, 46,115,105,110,107, 44, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,114,101,113,
+116, 46,104,101, 97,100,101,114,115, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,112,
+114,111,120,121, 32, 61, 32,114,101,113,116, 46,112,114,111,120,121, 44, 32, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32,110,114,101,100,105,114,101, 99,116,115, 32, 61,
+ 32, 40,114,101,113,116, 46,110,114,101,100,105,114,101, 99,116,115, 32,111,114,
+ 32, 48, 41, 32, 43, 32, 49, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99,114,101,
+ 97,116,101, 32, 61, 32,114,101,113,116, 46, 99,114,101, 97,116,101, 10, 32, 32,
+ 32, 32,125, 32, 32, 32, 10, 32, 32, 32, 32, 45, 45, 32,112, 97,115,115, 32,108,
+111, 99, 97,116,105,111,110, 32,104,101, 97,100,101,114, 32, 98, 97, 99,107, 32,
+ 97,115, 32, 97, 32,104,105,110,116, 32,119,101, 32,114,101,100,105,114,101, 99,
+116,101,100, 10, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104,101,
+ 97,100,101,114,115, 32,111,114, 32,123,125, 10, 32, 32, 32, 32,104,101, 97,100,
+101,114,115, 46,108,111, 99, 97,116,105,111,110, 32, 61, 32,104,101, 97,100,101,
+114,115, 46,108,111, 99, 97,116,105,111,110, 32,111,114, 32,108,111, 99, 97,116,
+105,111,110, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,114,101,115,117,108,
+116, 44, 32, 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 44, 32,115,116,
+ 97,116,117,115, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,116,
+114,101,113,117,101,115,116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32, 45, 45,
+ 32,119,101, 32,108,111,111,112, 32,117,110,116,105,108, 32,119,101, 32,103,101,
+116, 32,119,104, 97,116, 32,119,101, 32,119, 97,110,116, 44, 32,111,114, 10, 32,
+ 32, 32, 32, 45, 45, 32,117,110,116,105,108, 32,119,101, 32, 97,114,101, 32,115,
+117,114,101, 32,116,104,101,114,101, 32,105,115, 32,110,111, 32,119, 97,121, 32,
+116,111, 32,103,101,116, 32,105,116, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,
+110,114,101,113,116, 32, 61, 32, 97,100,106,117,115,116,114,101,113,117,101,115,
+116, 40,114,101,113,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32,
+ 61, 32,111,112,101,110, 40,110,114,101,113,116, 46,104,111,115,116, 44, 32,110,
+114,101,113,116, 46,112,111,114,116, 44, 32,110,114,101,113,116, 46, 99,114,101,
+ 97,116,101, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,114,101,113,
+117,101,115,116, 32,108,105,110,101, 32, 97,110,100, 32,104,101, 97,100,101,114,
+115, 10, 32, 32, 32, 32,104, 58,115,101,110,100,114,101,113,117,101,115,116,108,
+105,110,101, 40,110,114,101,113,116, 46,109,101,116,104,111,100, 44, 32,110,114,
+101,113,116, 46,117,114,105, 41, 10, 32, 32, 32, 32,104, 58,115,101,110,100,104,
+101, 97,100,101,114,115, 40,110,114,101,113,116, 46,104,101, 97,100,101,114,115,
+ 41, 10, 32, 32, 32, 32, 45, 45, 32,105,102, 32,116,104,101,114,101, 32,105,115,
+ 32, 97, 32, 98,111,100,121, 44, 32,115,101,110,100, 32,105,116, 10, 32, 32, 32,
+ 32,105,102, 32,110,114,101,113,116, 46,115,111,117,114, 99,101, 32,116,104,101,
+110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 58,115,101,110,100, 98,111,100,121,
+ 40,110,114,101,113,116, 46,104,101, 97,100,101,114,115, 44, 32,110,114,101,113,
+116, 46,115,111,117,114, 99,101, 44, 32,110,114,101,113,116, 46,115,116,101,112,
+ 41, 32, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108,
+ 32, 99,111,100,101, 44, 32,115,116, 97,116,117,115, 32, 61, 32,104, 58,114,101,
+ 99,101,105,118,101,115,116, 97,116,117,115,108,105,110,101, 40, 41, 10, 32, 32,
+ 32, 32, 45, 45, 32,105,102, 32,105,116, 32,105,115, 32, 97,110, 32, 72, 84, 84,
+ 80, 47, 48, 46, 57, 32,115,101,114,118,101,114, 44, 32,115,105,109,112,108,121,
+ 32,103,101,116, 32,116,104,101, 32, 98,111,100,121, 32, 97,110,100, 32,119,101,
+ 32, 97,114,101, 32,100,111,110,101, 10, 32, 32, 32, 32,105,102, 32,110,111,116,
+ 32, 99,111,100,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104,
+ 58,114,101, 99,101,105,118,101, 48, 57, 98,111,100,121, 40,115,116, 97,116,117,
+115, 44, 32,110,114,101,113,116, 46,115,105,110,107, 44, 32,110,114,101,113,116,
+ 46,115,116,101,112, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,
+110, 32, 49, 44, 32, 50, 48, 48, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32,
+ 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, 10, 32, 32, 32, 32, 45,
+ 45, 32,105,103,110,111,114,101, 32, 97,110,121, 32, 49, 48, 48, 45, 99,111,110,
+116,105,110,117,101, 32,109,101,115,115, 97,103,101,115, 10, 32, 32, 32, 32,119,
+104,105,108,101, 32, 99,111,100,101, 32, 61, 61, 32, 49, 48, 48, 32,100,111, 32,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,104,101, 97,100,101,114,115, 32, 61, 32,104,
+ 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114,115, 40, 41, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 99,111,100,101, 44, 32,115,116, 97,116,117,115, 32, 61,
+ 32,104, 58,114,101, 99,101,105,118,101,115,116, 97,116,117,115,108,105,110,101,
+ 40, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,104,101, 97,100,101,
+114,115, 32, 61, 32,104, 58,114,101, 99,101,105,118,101,104,101, 97,100,101,114,
+115, 40, 41, 10, 32, 32, 32, 32, 45, 45, 32, 97,116, 32,116,104,105,115, 32,112,
+111,105,110,116, 32,119,101, 32,115,104,111,117,108,100, 32,104, 97,118,101, 32,
+ 97, 32,104,111,110,101,115,116, 32,114,101,112,108,121, 32,102,114,111,109, 32,
+116,104,101, 32,115,101,114,118,101,114, 10, 32, 32, 32, 32, 45, 45, 32,119,101,
+ 32, 99, 97,110, 39,116, 32,114,101,100,105,114,101, 99,116, 32,105,102, 32,119,
+101, 32, 97,108,114,101, 97,100,121, 32,117,115,101,100, 32,116,104,101, 32,115,
+111,117,114, 99,101, 44, 32,115,111, 32,119,101, 32,114,101,112,111,114,116, 32,
+116,104,101, 32,101,114,114,111,114, 32, 10, 32, 32, 32, 32,105,102, 32,115,104,
+111,117,108,100,114,101,100,105,114,101, 99,116, 40,110,114,101,113,116, 44, 32,
+ 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 41, 32, 97,110,100, 32,110,
+111,116, 32,110,114,101,113,116, 46,115,111,117,114, 99,101, 32,116,104,101,110,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 58, 99,108,111,115,101, 40, 41, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,116,114,101,100,105,114,
+101, 99,116, 40,114,101,113,116, 44, 32,104,101, 97,100,101,114,115, 46,108,111,
+ 99, 97,116,105,111,110, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+ 45, 45, 32,104,101,114,101, 32,119,101, 32, 97,114,101, 32,102,105,110, 97,108,
+108,121, 32,100,111,110,101, 10, 32, 32, 32, 32,105,102, 32,115,104,111,117,108,
+100,114,101, 99,101,105,118,101, 98,111,100,121, 40,110,114,101,113,116, 44, 32,
+ 99,111,100,101, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,104,
+ 58,114,101, 99,101,105,118,101, 98,111,100,121, 40,104,101, 97,100,101,114,115,
+ 44, 32,110,114,101,113,116, 46,115,105,110,107, 44, 32,110,114,101,113,116, 46,
+115,116,101,112, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,104, 58,
+ 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49,
+ 44, 32, 99,111,100,101, 44, 32,104,101, 97,100,101,114,115, 44, 32,115,116, 97,
+116,117,115, 10,101,110,100, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,
+105,111,110, 32,115,114,101,113,117,101,115,116, 40,117, 44, 32, 98, 41, 10, 32,
+ 32, 32, 32,108,111, 99, 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32,
+108,111, 99, 97,108, 32,114,101,113,116, 32, 61, 32,123, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32,117,114,108, 32, 61, 32,117, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+115,105,110,107, 32, 61, 32,108,116,110, 49, 50, 46,115,105,110,107, 46,116, 97,
+ 98,108,101, 40,116, 41, 10, 32, 32, 32, 32,125, 10, 32, 32, 32, 32,105,102, 32,
+ 98, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,113,116, 46,
+115,111,117,114, 99,101, 32, 61, 32,108,116,110, 49, 50, 46,115,111,117,114, 99,
+101, 46,115,116,114,105,110,103, 40, 98, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+114,101,113,116, 46,104,101, 97,100,101,114,115, 32, 61, 32,123, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99,111,110,116,101,110,116, 45,108,
+101,110,103,116,104, 34, 93, 32, 61, 32,115,116,114,105,110,103, 46,108,101,110,
+ 40, 98, 41, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 34, 99,
+111,110,116,101,110,116, 45,116,121,112,101, 34, 93, 32, 61, 32, 34, 97,112,112,
+108,105, 99, 97,116,105,111,110, 47,120, 45,119,119,119, 45,102,111,114,109, 45,
+117,114,108,101,110, 99,111,100,101,100, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+125, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,113,116, 46,109,101,116,104,111,
+100, 32, 61, 32, 34, 80, 79, 83, 84, 34, 10, 32, 32, 32, 32,101,110,100, 10, 32,
+ 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44, 32,104,101, 97,100,101,
+114,115, 44, 32,115,116, 97,116,117,115, 32, 61, 32,115,111, 99,107,101,116, 46,
+115,107,105,112, 40, 49, 44, 32,116,114,101,113,117,101,115,116, 40,114,101,113,
+116, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,116, 97, 98,108,101,
+ 46, 99,111,110, 99, 97,116, 40,116, 41, 44, 32, 99,111,100,101, 44, 32,104,101,
+ 97,100,101,114,115, 44, 32,115,116, 97,116,117,115, 10,101,110,100, 10, 10,114,
+101,113,117,101,115,116, 32, 61, 32,115,111, 99,107,101,116, 46,112,114,111,116,
+101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,114,101,113,116, 44, 32, 98,
+111,100,121, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,112,
+101, 40,114,101,113,116, 41, 32, 61, 61, 32, 34,115,116,114,105,110,103, 34, 32,
+116,104,101,110, 32,114,101,116,117,114,110, 32,115,114,101,113,117,101,115,116,
+ 40,114,101,113,116, 44, 32, 98,111,100,121, 41, 10, 32, 32, 32, 32,101,108,115,
+101, 32,114,101,116,117,114,110, 32,116,114,101,113,117,101,115,116, 40,114,101,
+113,116, 41, 32,101,110,100, 10,101,110,100, 41, 10,
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/inet.c b/Build/source/texk/web2c/luatexdir/luasocket/src/inet.c
new file mode 100644
index 00000000000..3d30698cadc
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/inet.c
@@ -0,0 +1,285 @@
+/*=========================================================================*\
+* Internet domain functions
+* LuaSocket toolkit
+*
+* RCS ID: $Id: inet.c,v 1.28 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include <stdio.h>
+#include <string.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "inet.h"
+
+#if defined(__SUNOS__) || defined (__SUN__)
+#define INET_ATON 1
+#endif
+
+/*=========================================================================*\
+* Internal function prototypes.
+\*=========================================================================*/
+static int inet_global_toip(lua_State *L);
+static int inet_global_tohostname(lua_State *L);
+static void inet_pushresolved(lua_State *L, struct hostent *hp);
+static int inet_global_gethostname(lua_State *L);
+
+/* DNS functions */
+static luaL_reg func[] = {
+ { "toip", inet_global_toip },
+ { "tohostname", inet_global_tohostname },
+ { "gethostname", inet_global_gethostname},
+ { NULL, NULL}
+};
+
+/*=========================================================================*\
+* Exported functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int inet_open(lua_State *L)
+{
+ lua_pushstring(L, "dns");
+ lua_newtable(L);
+ luaL_openlib(L, NULL, func, 0);
+ lua_settable(L, -3);
+ return 0;
+}
+
+/*=========================================================================*\
+* Global Lua functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Returns all information provided by the resolver given a host name
+* or ip address
+\*-------------------------------------------------------------------------*/
+static int inet_gethost(const char *address, struct hostent **hp) {
+ struct in_addr addr;
+ if (inet_aton(address, &addr))
+ return socket_gethostbyaddr((char *) &addr, sizeof(addr), hp);
+ else
+ return socket_gethostbyname(address, hp);
+}
+
+/*-------------------------------------------------------------------------*\
+* Returns all information provided by the resolver given a host name
+* or ip address
+\*-------------------------------------------------------------------------*/
+static int inet_global_tohostname(lua_State *L) {
+ const char *address = luaL_checkstring(L, 1);
+ struct hostent *hp = NULL;
+ int err = inet_gethost(address, &hp);
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, socket_hoststrerror(err));
+ return 2;
+ }
+ lua_pushstring(L, hp->h_name);
+ inet_pushresolved(L, hp);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Returns all information provided by the resolver given a host name
+* or ip address
+\*-------------------------------------------------------------------------*/
+static int inet_global_toip(lua_State *L)
+{
+ const char *address = luaL_checkstring(L, 1);
+ struct hostent *hp = NULL;
+ int err = inet_gethost(address, &hp);
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, socket_hoststrerror(err));
+ return 2;
+ }
+ lua_pushstring(L, inet_ntoa(*((struct in_addr *) hp->h_addr)));
+ inet_pushresolved(L, hp);
+ return 2;
+}
+
+
+/*-------------------------------------------------------------------------*\
+* Gets the host name
+\*-------------------------------------------------------------------------*/
+static int inet_global_gethostname(lua_State *L)
+{
+ char name[257];
+ name[256] = '\0';
+ if (gethostname(name, 256) < 0) {
+ lua_pushnil(L);
+ lua_pushstring(L, "gethostname failed");
+ return 2;
+ } else {
+ lua_pushstring(L, name);
+ return 1;
+ }
+}
+
+
+
+/*=========================================================================*\
+* Lua methods
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Retrieves socket peer name
+\*-------------------------------------------------------------------------*/
+int inet_meth_getpeername(lua_State *L, p_socket ps)
+{
+ struct sockaddr_in peer;
+ socklen_t peer_len = sizeof(peer);
+ if (getpeername(*ps, (SA *) &peer, &peer_len) < 0) {
+ lua_pushnil(L);
+ lua_pushstring(L, "getpeername failed");
+ } else {
+ lua_pushstring(L, inet_ntoa(peer.sin_addr));
+ lua_pushnumber(L, ntohs(peer.sin_port));
+ }
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Retrieves socket local name
+\*-------------------------------------------------------------------------*/
+int inet_meth_getsockname(lua_State *L, p_socket ps)
+{
+ struct sockaddr_in local;
+ socklen_t local_len = sizeof(local);
+ if (getsockname(*ps, (SA *) &local, &local_len) < 0) {
+ lua_pushnil(L);
+ lua_pushstring(L, "getsockname failed");
+ } else {
+ lua_pushstring(L, inet_ntoa(local.sin_addr));
+ lua_pushnumber(L, ntohs(local.sin_port));
+ }
+ return 2;
+}
+
+/*=========================================================================*\
+* Internal functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Passes all resolver information to Lua as a table
+\*-------------------------------------------------------------------------*/
+static void inet_pushresolved(lua_State *L, struct hostent *hp)
+{
+ char **alias;
+ struct in_addr **addr;
+ int i, resolved;
+ lua_newtable(L); resolved = lua_gettop(L);
+ lua_pushstring(L, "name");
+ lua_pushstring(L, hp->h_name);
+ lua_settable(L, resolved);
+ lua_pushstring(L, "ip");
+ lua_pushstring(L, "alias");
+ i = 1;
+ alias = hp->h_aliases;
+ lua_newtable(L);
+ if (alias) {
+ while (*alias) {
+ lua_pushnumber(L, i);
+ lua_pushstring(L, *alias);
+ lua_settable(L, -3);
+ i++; alias++;
+ }
+ }
+ lua_settable(L, resolved);
+ i = 1;
+ lua_newtable(L);
+ addr = (struct in_addr **) hp->h_addr_list;
+ if (addr) {
+ while (*addr) {
+ lua_pushnumber(L, i);
+ lua_pushstring(L, inet_ntoa(**addr));
+ lua_settable(L, -3);
+ i++; addr++;
+ }
+ }
+ lua_settable(L, resolved);
+}
+
+/*-------------------------------------------------------------------------*\
+* Tries to create a new inet socket
+\*-------------------------------------------------------------------------*/
+const char *inet_trycreate(p_socket ps, int type) {
+ return socket_strerror(socket_create(ps, AF_INET, type, 0));
+}
+
+/*-------------------------------------------------------------------------*\
+* Tries to connect to remote address (address, port)
+\*-------------------------------------------------------------------------*/
+const char *inet_tryconnect(p_socket ps, const char *address,
+ unsigned short port, p_timeout tm)
+{
+ struct sockaddr_in remote;
+ int err;
+ memset(&remote, 0, sizeof(remote));
+ remote.sin_family = AF_INET;
+ remote.sin_port = htons(port);
+ if (strcmp(address, "*")) {
+ if (!inet_aton(address, &remote.sin_addr)) {
+ struct hostent *hp = NULL;
+ struct in_addr **addr;
+ err = socket_gethostbyname(address, &hp);
+ if (err != IO_DONE) return socket_hoststrerror(err);
+ addr = (struct in_addr **) hp->h_addr_list;
+ memcpy(&remote.sin_addr, *addr, sizeof(struct in_addr));
+ }
+ } else remote.sin_family = AF_UNSPEC;
+ err = socket_connect(ps, (SA *) &remote, sizeof(remote), tm);
+ return socket_strerror(err);
+}
+
+/*-------------------------------------------------------------------------*\
+* Tries to bind socket to (address, port)
+\*-------------------------------------------------------------------------*/
+const char *inet_trybind(p_socket ps, const char *address, unsigned short port)
+{
+ struct sockaddr_in local;
+ int err;
+ memset(&local, 0, sizeof(local));
+ /* address is either wildcard or a valid ip address */
+ local.sin_addr.s_addr = htonl(INADDR_ANY);
+ local.sin_port = htons(port);
+ local.sin_family = AF_INET;
+ if (strcmp(address, "*") && !inet_aton(address, &local.sin_addr)) {
+ struct hostent *hp = NULL;
+ struct in_addr **addr;
+ err = socket_gethostbyname(address, &hp);
+ if (err != IO_DONE) return socket_hoststrerror(err);
+ addr = (struct in_addr **) hp->h_addr_list;
+ memcpy(&local.sin_addr, *addr, sizeof(struct in_addr));
+ }
+ err = socket_bind(ps, (SA *) &local, sizeof(local));
+ if (err != IO_DONE) socket_destroy(ps);
+ return socket_strerror(err);
+}
+
+/*-------------------------------------------------------------------------*\
+* Some systems do not provide this so that we provide our own. It's not
+* marvelously fast, but it works just fine.
+\*-------------------------------------------------------------------------*/
+#ifdef INET_ATON
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+ unsigned int a = 0, b = 0, c = 0, d = 0;
+ int n = 0, r;
+ unsigned long int addr = 0;
+ r = sscanf(cp, "%u.%u.%u.%u%n", &a, &b, &c, &d, &n);
+ if (r == 0 || n == 0) return 0;
+ cp += n;
+ if (*cp) return 0;
+ if (a > 255 || b > 255 || c > 255 || d > 255) return 0;
+ if (inp) {
+ addr += a; addr <<= 8;
+ addr += b; addr <<= 8;
+ addr += c; addr <<= 8;
+ addr += d;
+ inp->s_addr = htonl(addr);
+ }
+ return 1;
+}
+#endif
+
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/inet.h b/Build/source/texk/web2c/luatexdir/luasocket/src/inet.h
new file mode 100644
index 00000000000..7662266110a
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/inet.h
@@ -0,0 +1,42 @@
+#ifndef INET_H
+#define INET_H
+/*=========================================================================*\
+* Internet domain functions
+* LuaSocket toolkit
+*
+* This module implements the creation and connection of internet domain
+* sockets, on top of the socket.h interface, and the interface of with the
+* resolver.
+*
+* The function inet_aton is provided for the platforms where it is not
+* available. The module also implements the interface of the internet
+* getpeername and getsockname functions as seen by Lua programs.
+*
+* The Lua functions toip and tohostname are also implemented here.
+*
+* RCS ID: $Id: inet.h,v 1.16 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+#include "socket.h"
+#include "timeout.h"
+
+#ifdef _WIN32
+#define INET_ATON
+#endif
+
+int inet_open(lua_State *L);
+
+const char *inet_trycreate(p_socket ps, int type);
+const char *inet_tryconnect(p_socket ps, const char *address,
+ unsigned short port, p_timeout tm);
+const char *inet_trybind(p_socket ps, const char *address,
+ unsigned short port);
+
+int inet_meth_getpeername(lua_State *L, p_socket ps);
+int inet_meth_getsockname(lua_State *L, p_socket ps);
+
+#ifdef INET_ATON
+int inet_aton(const char *cp, struct in_addr *inp);
+#endif
+
+#endif /* INET_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/io.c b/Build/source/texk/web2c/luatexdir/luasocket/src/io.c
new file mode 100644
index 00000000000..06dc50ecacc
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/io.c
@@ -0,0 +1,32 @@
+/*=========================================================================*\
+* Input/Output abstraction
+* LuaSocket toolkit
+*
+* RCS ID: $Id: io.c,v 1.6 2005/09/29 06:11:41 diego Exp $
+\*=========================================================================*/
+#include "io.h"
+
+/*=========================================================================*\
+* Exported functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Initializes C structure
+\*-------------------------------------------------------------------------*/
+void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx) {
+ io->send = send;
+ io->recv = recv;
+ io->error = error;
+ io->ctx = ctx;
+}
+
+/*-------------------------------------------------------------------------*\
+* I/O error strings
+\*-------------------------------------------------------------------------*/
+const char *io_strerror(int err) {
+ switch (err) {
+ case IO_DONE: return NULL;
+ case IO_CLOSED: return "closed";
+ case IO_TIMEOUT: return "timeout";
+ default: return "unknown error";
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/io.h b/Build/source/texk/web2c/luatexdir/luasocket/src/io.h
new file mode 100644
index 00000000000..cce3aaf556b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/io.h
@@ -0,0 +1,67 @@
+#ifndef IO_H
+#define IO_H
+/*=========================================================================*\
+* Input/Output abstraction
+* LuaSocket toolkit
+*
+* This module defines the interface that LuaSocket expects from the
+* transport layer for streamed input/output. The idea is that if any
+* transport implements this interface, then the buffer.c functions
+* automatically work on it.
+*
+* The module socket.h implements this interface, and thus the module tcp.h
+* is very simple.
+*
+* RCS ID: $Id: io.h,v 1.11 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include <stdio.h>
+#include "lua.h"
+
+#include "timeout.h"
+
+/* IO error codes */
+enum {
+ IO_DONE = 0, /* operation completed successfully */
+ IO_TIMEOUT = -1, /* operation timed out */
+ IO_CLOSED = -2, /* the connection has been closed */
+ IO_UNKNOWN = -3
+};
+
+/* interface to error message function */
+typedef const char *(*p_error) (
+ void *ctx, /* context needed by send */
+ int err /* error code */
+);
+
+/* interface to send function */
+typedef int (*p_send) (
+ void *ctx, /* context needed by send */
+ const char *data, /* pointer to buffer with data to send */
+ size_t count, /* number of bytes to send from buffer */
+ size_t *sent, /* number of bytes sent uppon return */
+ p_timeout tm /* timeout control */
+);
+
+/* interface to recv function */
+typedef int (*p_recv) (
+ void *ctx, /* context needed by recv */
+ char *data, /* pointer to buffer where data will be writen */
+ size_t count, /* number of bytes to receive into buffer */
+ size_t *got, /* number of bytes received uppon return */
+ p_timeout tm /* timeout control */
+);
+
+/* IO driver definition */
+typedef struct t_io_ {
+ void *ctx; /* context needed by send/recv */
+ p_send send; /* send function pointer */
+ p_recv recv; /* receive function pointer */
+ p_error error; /* strerror function */
+} t_io;
+typedef t_io *p_io;
+
+void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx);
+const char *io_strerror(int err);
+
+#endif /* IO_H */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/ltn12.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/ltn12.lua
new file mode 100644
index 00000000000..b42689a34ab
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/ltn12.lua
@@ -0,0 +1,292 @@
+-----------------------------------------------------------------------------
+-- LTN12 - Filters, sources, sinks and pumps.
+-- LuaSocket toolkit.
+-- Author: Diego Nehab
+-- RCS ID: $Id: ltn12.lua,v 1.31 2006/04/03 04:45:42 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module
+-----------------------------------------------------------------------------
+local string = require("string")
+local table = require("table")
+local base = _G
+module("ltn12")
+
+filter = {}
+source = {}
+sink = {}
+pump = {}
+
+-- 2048 seems to be better in windows...
+BLOCKSIZE = 2048
+_VERSION = "LTN12 1.0.1"
+
+-----------------------------------------------------------------------------
+-- Filter stuff
+-----------------------------------------------------------------------------
+-- returns a high level filter that cycles a low-level filter
+function filter.cycle(low, ctx, extra)
+ base.assert(low)
+ return function(chunk)
+ local ret
+ ret, ctx = low(ctx, chunk, extra)
+ return ret
+ end
+end
+
+-- chains a bunch of filters together
+-- (thanks to Wim Couwenberg)
+function filter.chain(...)
+ local n = table.getn(arg)
+ local top, index = 1, 1
+ local retry = ""
+ return function(chunk)
+ retry = chunk and retry
+ while true do
+ if index == top then
+ chunk = arg[index](chunk)
+ if chunk == "" or top == n then return chunk
+ elseif chunk then index = index + 1
+ else
+ top = top+1
+ index = top
+ end
+ else
+ chunk = arg[index](chunk or "")
+ if chunk == "" then
+ index = index - 1
+ chunk = retry
+ elseif chunk then
+ if index == n then return chunk
+ else index = index + 1 end
+ else base.error("filter returned inappropriate nil") end
+ end
+ end
+ end
+end
+
+-----------------------------------------------------------------------------
+-- Source stuff
+-----------------------------------------------------------------------------
+-- create an empty source
+local function empty()
+ return nil
+end
+
+function source.empty()
+ return empty
+end
+
+-- returns a source that just outputs an error
+function source.error(err)
+ return function()
+ return nil, err
+ end
+end
+
+-- creates a file source
+function source.file(handle, io_err)
+ if handle then
+ return function()
+ local chunk = handle:read(BLOCKSIZE)
+ if not chunk then handle:close() end
+ return chunk
+ end
+ else return source.error(io_err or "unable to open file") end
+end
+
+-- turns a fancy source into a simple source
+function source.simplify(src)
+ base.assert(src)
+ return function()
+ local chunk, err_or_new = src()
+ src = err_or_new or src
+ if not chunk then return nil, err_or_new
+ else return chunk end
+ end
+end
+
+-- creates string source
+function source.string(s)
+ if s then
+ local i = 1
+ return function()
+ local chunk = string.sub(s, i, i+BLOCKSIZE-1)
+ i = i + BLOCKSIZE
+ if chunk ~= "" then return chunk
+ else return nil end
+ end
+ else return source.empty() end
+end
+
+-- creates rewindable source
+function source.rewind(src)
+ base.assert(src)
+ local t = {}
+ return function(chunk)
+ if not chunk then
+ chunk = table.remove(t)
+ if not chunk then return src()
+ else return chunk end
+ else
+ table.insert(t, chunk)
+ end
+ end
+end
+
+function source.chain(src, f)
+ base.assert(src and f)
+ local last_in, last_out = "", ""
+ local state = "feeding"
+ local err
+ return function()
+ if not last_out then
+ base.error('source is empty!', 2)
+ end
+ while true do
+ if state == "feeding" then
+ last_in, err = src()
+ if err then return nil, err end
+ last_out = f(last_in)
+ if not last_out then
+ if last_in then
+ base.error('filter returned inappropriate nil')
+ else
+ return nil
+ end
+ elseif last_out ~= "" then
+ state = "eating"
+ if last_in then last_in = "" end
+ return last_out
+ end
+ else
+ last_out = f(last_in)
+ if last_out == "" then
+ if last_in == "" then
+ state = "feeding"
+ else
+ base.error('filter returned ""')
+ end
+ elseif not last_out then
+ if last_in then
+ base.error('filter returned inappropriate nil')
+ else
+ return nil
+ end
+ else
+ return last_out
+ end
+ end
+ end
+ end
+end
+
+-- creates a source that produces contents of several sources, one after the
+-- other, as if they were concatenated
+-- (thanks to Wim Couwenberg)
+function source.cat(...)
+ local src = table.remove(arg, 1)
+ return function()
+ while src do
+ local chunk, err = src()
+ if chunk then return chunk end
+ if err then return nil, err end
+ src = table.remove(arg, 1)
+ end
+ end
+end
+
+-----------------------------------------------------------------------------
+-- Sink stuff
+-----------------------------------------------------------------------------
+-- creates a sink that stores into a table
+function sink.table(t)
+ t = t or {}
+ local f = function(chunk, err)
+ if chunk then table.insert(t, chunk) end
+ return 1
+ end
+ return f, t
+end
+
+-- turns a fancy sink into a simple sink
+function sink.simplify(snk)
+ base.assert(snk)
+ return function(chunk, err)
+ local ret, err_or_new = snk(chunk, err)
+ if not ret then return nil, err_or_new end
+ snk = err_or_new or snk
+ return 1
+ end
+end
+
+-- creates a file sink
+function sink.file(handle, io_err)
+ if handle then
+ return function(chunk, err)
+ if not chunk then
+ handle:close()
+ return 1
+ else return handle:write(chunk) end
+ end
+ else return sink.error(io_err or "unable to open file") end
+end
+
+-- creates a sink that discards data
+local function null()
+ return 1
+end
+
+function sink.null()
+ return null
+end
+
+-- creates a sink that just returns an error
+function sink.error(err)
+ return function()
+ return nil, err
+ end
+end
+
+-- chains a sink with a filter
+function sink.chain(f, snk)
+ base.assert(f and snk)
+ return function(chunk, err)
+ if chunk ~= "" then
+ local filtered = f(chunk)
+ local done = chunk and ""
+ while true do
+ local ret, snkerr = snk(filtered, err)
+ if not ret then return nil, snkerr end
+ if filtered == done then return 1 end
+ filtered = f(done)
+ end
+ else return 1 end
+ end
+end
+
+-----------------------------------------------------------------------------
+-- Pump stuff
+-----------------------------------------------------------------------------
+-- pumps one chunk from the source to the sink
+function pump.step(src, snk)
+ local chunk, src_err = src()
+ local ret, snk_err = snk(chunk, src_err)
+ if chunk and ret then return 1
+ else return nil, src_err or snk_err end
+end
+
+-- pumps all data from a source to a sink, using a step function
+function pump.all(src, snk, step)
+ base.assert(src and snk)
+ step = step or pump.step
+ while true do
+ local ret, err = step(src, snk)
+ if not ret then
+ if err then return nil, err
+ else return 1 end
+ end
+ end
+end
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/ltn12_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/ltn12_lua.c
new file mode 100644
index 00000000000..308bc31f0df
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/ltn12_lua.c
@@ -0,0 +1,422 @@
+/*
+ * This file is auto-generated by "./lua2c ltn12.lua ltn12_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_ltn12_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 76, 84, 78, 49, 50, 32, 45, 32, 70,105,108,116,101,114,115, 44, 32,115,111,
+117,114, 99,101,115, 44, 32,115,105,110,107,115, 32, 97,110,100, 32,112,117,109,
+112,115, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32,116,111,111,
+108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101,
+103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32,
+ 36, 73,100, 58, 32,108,116,110, 49, 50, 46,108,117, 97, 44,118, 32, 49, 46, 51,
+ 49, 32, 50, 48, 48, 54, 47, 48, 52, 47, 48, 51, 32, 48, 52, 58, 52, 53, 58, 52,
+ 50, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114,
+101, 32,109,111,100,117,108,101, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32,
+ 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,
+108,111, 99, 97,108, 32,116, 97, 98,108,101, 32, 61, 32,114,101,113,117,105,114,
+101, 40, 34,116, 97, 98,108,101, 34, 41, 10,108,111, 99, 97,108, 32, 98, 97,115,
+101, 32, 61, 32, 95, 71, 10,109,111,100,117,108,101, 40, 34,108,116,110, 49, 50,
+ 34, 41, 10, 10,102,105,108,116,101,114, 32, 61, 32,123,125, 10,115,111,117,114,
+ 99,101, 32, 61, 32,123,125, 10,115,105,110,107, 32, 61, 32,123,125, 10,112,117,
+109,112, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 50, 48, 52, 56, 32,115,101,101,
+109,115, 32,116,111, 32, 98,101, 32, 98,101,116,116,101,114, 32,105,110, 32,119,
+105,110,100,111,119,115, 46, 46, 46, 10, 66, 76, 79, 67, 75, 83, 73, 90, 69, 32,
+ 61, 32, 50, 48, 52, 56, 10, 95, 86, 69, 82, 83, 73, 79, 78, 32, 61, 32, 34, 76,
+ 84, 78, 49, 50, 32, 49, 46, 48, 46, 49, 34, 10, 10, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 70,105,108,116,101,114,
+ 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,104,105,
+103,104, 32,108,101,118,101,108, 32,102,105,108,116,101,114, 32,116,104, 97,116,
+ 32, 99,121, 99,108,101,115, 32, 97, 32,108,111,119, 45,108,101,118,101,108, 32,
+102,105,108,116,101,114, 10,102,117,110, 99,116,105,111,110, 32,102,105,108,116,
+101,114, 46, 99,121, 99,108,101, 40,108,111,119, 44, 32, 99,116,120, 44, 32,101,
+120,116,114, 97, 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,
+116, 40,108,111,119, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,
+110, 99,116,105,111,110, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32,114,101,116, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+114,101,116, 44, 32, 99,116,120, 32, 61, 32,108,111,119, 40, 99,116,120, 44, 32,
+ 99,104,117,110,107, 44, 32,101,120,116,114, 97, 41, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,114,101,116, 10, 32, 32, 32, 32,101,110,100,
+ 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 97,105,110,115, 32, 97, 32, 98,117,
+110, 99,104, 32,111,102, 32,102,105,108,116,101,114,115, 32,116,111,103,101,116,
+104,101,114, 10, 45, 45, 32, 40,116,104, 97,110,107,115, 32,116,111, 32, 87,105,
+109, 32, 67,111,117,119,101,110, 98,101,114,103, 41, 10,102,117,110, 99,116,105,
+111,110, 32,102,105,108,116,101,114, 46, 99,104, 97,105,110, 40, 46, 46, 46, 41,
+ 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,110, 32, 61, 32,116, 97, 98,108,101,
+ 46,103,101,116,110, 40, 97,114,103, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108,
+ 32,116,111,112, 44, 32,105,110,100,101,120, 32, 61, 32, 49, 44, 32, 49, 10, 32,
+ 32, 32, 32,108,111, 99, 97,108, 32,114,101,116,114,121, 32, 61, 32, 34, 34, 10,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40,
+ 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,114,121,
+ 32, 61, 32, 99,104,117,110,107, 32, 97,110,100, 32,114,101,116,114,121, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,105,110,100,101,
+120, 32, 61, 61, 32,116,111,112, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, 32, 97,114,
+103, 91,105,110,100,101,120, 93, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107,
+ 32, 61, 61, 32, 34, 34, 32,111,114, 32,116,111,112, 32, 61, 61, 32,110, 32,116,
+104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105,102, 32,
+ 99,104,117,110,107, 32,116,104,101,110, 32,105,110,100,101,120, 32, 61, 32,105,
+110,100,101,120, 32, 43, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,116,111,112, 32, 61, 32,116,111,112, 43,
+ 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,105,110,100,101,120, 32, 61, 32,116,111,112, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61, 32, 97,114,103, 91,105,
+110,100,101,120, 93, 40, 99,104,117,110,107, 32,111,114, 32, 34, 34, 41, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,
+117,110,107, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,110,100,101,120,
+ 32, 61, 32,105,110,100,101,120, 32, 45, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117,110,107, 32, 61,
+ 32,114,101,116,114,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,101,108,115,101,105,102, 32, 99,104,117,110,107, 32,116,104,101,110,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32,105,102, 32,105,110,100,101,120, 32, 61, 61, 32,110, 32,116,104,101,110, 32,
+114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,105,110,
+100,101,120, 32, 61, 32,105,110,100,101,120, 32, 43, 32, 49, 32,101,110,100, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,
+ 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 34,102,105,108,116,101,114, 32,
+114,101,116,117,114,110,101,100, 32,105,110, 97,112,112,114,111,112,114,105, 97,
+116,101, 32,110,105,108, 34, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100,
+ 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 83,111,117,114, 99,
+101, 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,114,101, 97,116,101, 32, 97,110, 32,101,
+109,112,116,121, 32,115,111,117,114, 99,101, 10,108,111, 99, 97,108, 32,102,117,
+110, 99,116,105,111,110, 32,101,109,112,116,121, 40, 41, 10, 32, 32, 32, 32,114,
+101,116,117,114,110, 32,110,105,108, 10,101,110,100, 10, 10,102,117,110, 99,116,
+105,111,110, 32,115,111,117,114, 99,101, 46,101,109,112,116,121, 40, 41, 10, 32,
+ 32, 32, 32,114,101,116,117,114,110, 32,101,109,112,116,121, 10,101,110,100, 10,
+ 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,115,111,117,114, 99,101,
+ 32,116,104, 97,116, 32,106,117,115,116, 32,111,117,116,112,117,116,115, 32, 97,
+110, 32,101,114,114,111,114, 10,102,117,110, 99,116,105,111,110, 32,115,111,117,
+114, 99,101, 46,101,114,114,111,114, 40,101,114,114, 41, 10, 32, 32, 32, 32,114,
+101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114,
+ 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101,
+ 97,116,101,115, 32, 97, 32,102,105,108,101, 32,115,111,117,114, 99,101, 10,102,
+117,110, 99,116,105,111,110, 32,115,111,117,114, 99,101, 46,102,105,108,101, 40,
+104, 97,110,100,108,101, 44, 32,105,111, 95,101,114,114, 41, 10, 32, 32, 32, 32,
+105,102, 32,104, 97,110,100,108,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,
+104,117,110,107, 32, 61, 32,104, 97,110,100,108,101, 58,114,101, 97,100, 40, 66,
+ 76, 79, 67, 75, 83, 73, 90, 69, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 32,
+104, 97,110,100,108,101, 58, 99,108,111,115,101, 40, 41, 32,101,110,100, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,104,
+117,110,107, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+101,108,115,101, 32,114,101,116,117,114,110, 32,115,111,117,114, 99,101, 46,101,
+114,114,111,114, 40,105,111, 95,101,114,114, 32,111,114, 32, 34,117,110, 97, 98,
+108,101, 32,116,111, 32,111,112,101,110, 32,102,105,108,101, 34, 41, 32,101,110,
+100, 10,101,110,100, 10, 10, 45, 45, 32,116,117,114,110,115, 32, 97, 32,102, 97,
+110, 99,121, 32,115,111,117,114, 99,101, 32,105,110,116,111, 32, 97, 32,115,105,
+109,112,108,101, 32,115,111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110,
+ 32,115,111,117,114, 99,101, 46,115,105,109,112,108,105,102,121, 40,115,114, 99,
+ 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114,
+ 99, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,
+111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,
+104,117,110,107, 44, 32,101,114,114, 95,111,114, 95,110,101,119, 32, 61, 32,115,
+114, 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,114, 99, 32, 61, 32,101,
+114,114, 95,111,114, 95,110,101,119, 32,111,114, 32,115,114, 99, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,
+101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 95,111,
+114, 95,110,101,119, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,
+101,116,117,114,110, 32, 99,104,117,110,107, 32,101,110,100, 10, 32, 32, 32, 32,
+101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32,
+115,116,114,105,110,103, 32,115,111,117,114, 99,101, 10,102,117,110, 99,116,105,
+111,110, 32,115,111,117,114, 99,101, 46,115,116,114,105,110,103, 40,115, 41, 10,
+ 32, 32, 32, 32,105,102, 32,115, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32,105, 32, 61, 32, 49, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,
+117,110,107, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,115, 44, 32,
+105, 44, 32,105, 43, 66, 76, 79, 67, 75, 83, 73, 90, 69, 45, 49, 41, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105, 32, 61, 32,105, 32, 43, 32, 66, 76,
+ 79, 67, 75, 83, 73, 90, 69, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+105,102, 32, 99,104,117,110,107, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32,
+114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,110,105,108,
+ 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32,
+ 32,101,108,115,101, 32,114,101,116,117,114,110, 32,115,111,117,114, 99,101, 46,
+101,109,112,116,121, 40, 41, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,
+ 99,114,101, 97,116,101,115, 32,114,101,119,105,110,100, 97, 98,108,101, 32,115,
+111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,111,117,114, 99,
+101, 46,114,101,119,105,110,100, 40,115,114, 99, 41, 10, 32, 32, 32, 32, 98, 97,
+115,101, 46, 97,115,115,101,114,116, 40,115,114, 99, 41, 10, 32, 32, 32, 32,108,
+111, 99, 97,108, 32,116, 32, 61, 32,123,125, 10, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,102,117,110, 99,116,105,111,110, 40, 99,104,117,110,107, 41, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,
+116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99,104,117,
+110,107, 32, 61, 32,116, 97, 98,108,101, 46,114,101,109,111,118,101, 40,116, 41,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,
+ 99,104,117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,115,114,
+ 99, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,
+ 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 32,101,110,100, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,116, 44, 32, 99,
+104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32,
+ 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,
+115,111,117,114, 99,101, 46, 99,104, 97,105,110, 40,115,114, 99, 44, 32,102, 41,
+ 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114, 99,
+ 32, 97,110,100, 32,102, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108, 97,
+115,116, 95,105,110, 44, 32,108, 97,115,116, 95,111,117,116, 32, 61, 32, 34, 34,
+ 44, 32, 34, 34, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,116, 97,116,101,
+ 32, 61, 32, 34,102,101,101,100,105,110,103, 34, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,101,114,114, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,
+110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,
+110,111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104,101,110, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114,
+ 40, 39,115,111,117,114, 99,101, 32,105,115, 32,101,109,112,116,121, 33, 39, 44,
+ 32, 50, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,116, 97,116,101, 32, 61,
+ 61, 32, 34,102,101,101,100,105,110,103, 34, 32,116,104,101,110, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 95,105,110,
+ 44, 32,101,114,114, 32, 61, 32,115,114, 99, 40, 41, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,
+110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,
+100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,
+115,116, 95,111,117,116, 32, 61, 32,102, 40,108, 97,115,116, 95,105,110, 41, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,
+111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104,101,110, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,
+108, 97,115,116, 95,105,110, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,
+101, 46,101,114,114,111,114, 40, 39,102,105,108,116,101,114, 32,114,101,116,117,
+114,110,101,100, 32,105,110, 97,112,112,114,111,112,114,105, 97,116,101, 32,110,
+105,108, 39, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110,
+ 32,110,105,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,101,108,115,101,105,102, 32,108, 97,115,116, 95,111,117,116,
+ 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116, 97,116,101, 32, 61, 32,
+ 34,101, 97,116,105,110,103, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95,105,110, 32,
+116,104,101,110, 32,108, 97,115,116, 95,105,110, 32, 61, 32, 34, 34, 32,101,110,
+100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,108, 97,115,116, 95,111,117,116, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108, 97,115,116, 95,111,117,116, 32,
+ 61, 32,102, 40,108, 97,115,116, 95,105,110, 41, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95,111,117,116,
+ 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,108, 97,115,116, 95,
+105,110, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,116,
+ 97,116,101, 32, 61, 32, 34,102,101,101,100,105,110,103, 34, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 39,102,105,108,
+116,101,114, 32,114,101,116,117,114,110,101,100, 32, 34, 34, 39, 41, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,
+100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,
+115,101,105,102, 32,110,111,116, 32,108, 97,115,116, 95,111,117,116, 32,116,104,
+101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,105,102, 32,108, 97,115,116, 95,105,110, 32,116,104,101,110, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114, 40, 39,102,105,108,116,101,
+114, 32,114,101,116,117,114,110,101,100, 32,105,110, 97,112,112,114,111,112,114,
+105, 97,116,101, 32,110,105,108, 39, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+114,101,116,117,114,110, 32,110,105,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,108, 97,115,116, 95,111,117,116, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10,
+ 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97,
+116,101,115, 32, 97, 32,115,111,117,114, 99,101, 32,116,104, 97,116, 32,112,114,
+111,100,117, 99,101,115, 32, 99,111,110,116,101,110,116,115, 32,111,102, 32,115,
+101,118,101,114, 97,108, 32,115,111,117,114, 99,101,115, 44, 32,111,110,101, 32,
+ 97,102,116,101,114, 32,116,104,101, 10, 45, 45, 32,111,116,104,101,114, 44, 32,
+ 97,115, 32,105,102, 32,116,104,101,121, 32,119,101,114,101, 32, 99,111,110, 99,
+ 97,116,101,110, 97,116,101,100, 10, 45, 45, 32, 40,116,104, 97,110,107,115, 32,
+116,111, 32, 87,105,109, 32, 67,111,117,119,101,110, 98,101,114,103, 41, 10,102,
+117,110, 99,116,105,111,110, 32,115,111,117,114, 99,101, 46, 99, 97,116, 40, 46,
+ 46, 46, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,114, 99, 32, 61, 32,
+116, 97, 98,108,101, 46,114,101,109,111,118,101, 40, 97,114,103, 44, 32, 49, 41,
+ 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110,
+ 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,115,114, 99,
+ 32,100,111, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,
+108, 32, 99,104,117,110,107, 44, 32,101,114,114, 32, 61, 32,115,114, 99, 40, 41,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,
+107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 32,
+101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,
+114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,
+101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+115,114, 99, 32, 61, 32,116, 97, 98,108,101, 46,114,101,109,111,118,101, 40, 97,
+114,103, 44, 32, 49, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32,
+ 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 83,105,110,107, 32,115,116,
+117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105,110,107, 32,
+116,104, 97,116, 32,115,116,111,114,101,115, 32,105,110,116,111, 32, 97, 32,116,
+ 97, 98,108,101, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,116,
+ 97, 98,108,101, 40,116, 41, 10, 32, 32, 32, 32,116, 32, 61, 32,116, 32,111,114,
+ 32,123,125, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,102,117,
+110, 99,116,105,111,110, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,117,110,107, 32,116,104,101,110,
+ 32,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,116, 44, 32, 99,104,117,
+110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,
+114,110, 32, 49, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,114,101,116,
+117,114,110, 32,102, 44, 32,116, 10,101,110,100, 10, 10, 45, 45, 32,116,117,114,
+110,115, 32, 97, 32,102, 97,110, 99,121, 32,115,105,110,107, 32,105,110,116,111,
+ 32, 97, 32,115,105,109,112,108,101, 32,115,105,110,107, 10,102,117,110, 99,116,
+105,111,110, 32,115,105,110,107, 46,115,105,109,112,108,105,102,121, 40,115,110,
+107, 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,
+110,107, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,
+105,111,110, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, 95,111,
+114, 95,110,101,119, 32, 61, 32,115,110,107, 40, 99,104,117,110,107, 44, 32,101,
+114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,
+101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,
+101,114,114, 95,111,114, 95,110,101,119, 32,101,110,100, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32,115,110,107, 32, 61, 32,101,114,114, 95,111,114, 95,110,101,119, 32,
+111,114, 32,115,110,107, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,
+110, 32, 49, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,
+ 99,114,101, 97,116,101,115, 32, 97, 32,102,105,108,101, 32,115,105,110,107, 10,
+102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,102,105,108,101, 40,104,
+ 97,110,100,108,101, 44, 32,105,111, 95,101,114,114, 41, 10, 32, 32, 32, 32,105,
+102, 32,104, 97,110,100,108,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 99,104,
+117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,105,102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,104, 97,110,100,
+108,101, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,
+104, 97,110,100,108,101, 58,119,114,105,116,101, 40, 99,104,117,110,107, 41, 32,
+101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+101,108,115,101, 32,114,101,116,117,114,110, 32,115,105,110,107, 46,101,114,114,
+111,114, 40,105,111, 95,101,114,114, 32,111,114, 32, 34,117,110, 97, 98,108,101,
+ 32,116,111, 32,111,112,101,110, 32,102,105,108,101, 34, 41, 32,101,110,100, 10,
+101,110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105,
+110,107, 32,116,104, 97,116, 32,100,105,115, 99, 97,114,100,115, 32,100, 97,116,
+ 97, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,110,117,108,
+108, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 49, 10,101,110,100,
+ 10, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46,110,117,108,108,
+ 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,110,117,108,108, 10,101,
+110,100, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32, 97, 32,115,105,110,
+107, 32,116,104, 97,116, 32,106,117,115,116, 32,114,101,116,117,114,110,115, 32,
+ 97,110, 32,101,114,114,111,114, 10,102,117,110, 99,116,105,111,110, 32,115,105,
+110,107, 46,101,114,114,111,114, 40,101,114,114, 41, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 10,
+ 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32, 99,104, 97,105,
+110,115, 32, 97, 32,115,105,110,107, 32,119,105,116,104, 32, 97, 32,102,105,108,
+116,101,114, 10,102,117,110, 99,116,105,111,110, 32,115,105,110,107, 46, 99,104,
+ 97,105,110, 40,102, 44, 32,115,110,107, 41, 10, 32, 32, 32, 32, 98, 97,115,101,
+ 46, 97,115,115,101,114,116, 40,102, 32, 97,110,100, 32,115,110,107, 41, 10, 32,
+ 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,111,110, 40, 99,
+104,117,110,107, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,
+102, 32, 99,104,117,110,107, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,102,105,108,
+116,101,114,101,100, 32, 61, 32,102, 40, 99,104,117,110,107, 41, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,100,111,110,101, 32,
+ 61, 32, 99,104,117,110,107, 32, 97,110,100, 32, 34, 34, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,114,101,116, 44, 32,115,110,107,101,114,114, 32, 61, 32,115,110,107,
+ 40,102,105,108,116,101,114,101,100, 44, 32,101,114,114, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,
+101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,
+115,110,107,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,105,102, 32,102,105,108,116,101,114,101,100, 32, 61,
+ 61, 32,100,111,110,101, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 49,
+ 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32,102,105,108,116,101,114,101,100, 32, 61, 32,102, 40,100,111,110,101, 41, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 49, 32,101,110,
+100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 80,117,109,112,
+ 32,115,116,117,102,102, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 10, 45, 45, 32,112,117,109,112,115, 32,111,110,101, 32, 99,104,
+117,110,107, 32,102,114,111,109, 32,116,104,101, 32,115,111,117,114, 99,101, 32,
+116,111, 32,116,104,101, 32,115,105,110,107, 10,102,117,110, 99,116,105,111,110,
+ 32,112,117,109,112, 46,115,116,101,112, 40,115,114, 99, 44, 32,115,110,107, 41,
+ 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,115,114,
+ 99, 95,101,114,114, 32, 61, 32,115,114, 99, 40, 41, 10, 32, 32, 32, 32,108,111,
+ 99, 97,108, 32,114,101,116, 44, 32,115,110,107, 95,101,114,114, 32, 61, 32,115,
+110,107, 40, 99,104,117,110,107, 44, 32,115,114, 99, 95,101,114,114, 41, 10, 32,
+ 32, 32, 32,105,102, 32, 99,104,117,110,107, 32, 97,110,100, 32,114,101,116, 32,
+116,104,101,110, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32,101,108,
+115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,115,114, 99, 95,101,
+114,114, 32,111,114, 32,115,110,107, 95,101,114,114, 32,101,110,100, 10,101,110,
+100, 10, 10, 45, 45, 32,112,117,109,112,115, 32, 97,108,108, 32,100, 97,116, 97,
+ 32,102,114,111,109, 32, 97, 32,115,111,117,114, 99,101, 32,116,111, 32, 97, 32,
+115,105,110,107, 44, 32,117,115,105,110,103, 32, 97, 32,115,116,101,112, 32,102,
+117,110, 99,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32,112,117,109,
+112, 46, 97,108,108, 40,115,114, 99, 44, 32,115,110,107, 44, 32,115,116,101,112,
+ 41, 10, 32, 32, 32, 32, 98, 97,115,101, 46, 97,115,115,101,114,116, 40,115,114,
+ 99, 32, 97,110,100, 32,115,110,107, 41, 10, 32, 32, 32, 32,115,116,101,112, 32,
+ 61, 32,115,116,101,112, 32,111,114, 32,112,117,109,112, 46,115,116,101,112, 10,
+ 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114,
+ 32, 61, 32,115,116,101,112, 40,115,114, 99, 44, 32,115,110,107, 41, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,116, 32,116,104,101,
+110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114,
+ 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,
+114, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,
+101,116,117,114,110, 32, 49, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100, 10, 10,
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c b/Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c
new file mode 100644
index 00000000000..8e27995a414
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c
@@ -0,0 +1,73 @@
+
+#include <stdlib.h>
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "socket_lua.c"
+#include "ftp_lua.c"
+#include "http_lua.c"
+#include "smtp_lua.c"
+#include "tp_lua.c"
+#include "url_lua.c"
+#include "ltn12_lua.c"
+#include "mime_lua.c"
+
+
+void luatex_socketlua_open (lua_State *L) {
+ lua_getglobal(L, "package");
+ lua_getfield(L, -1, "loaded");
+ if (!lua_istable(L,-1)) {
+ lua_newtable(L);
+ lua_setfield(L, -2, "loaded");
+ lua_getfield(L, -1, "loaded");
+ }
+ if(!luatex_socket_lua_open(L)) {
+ lua_setfield(L, -2, "socket");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ if(!luatex_ltn12_lua_open(L)) {
+ lua_setfield(L, -2, "ltn12");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ if(!luatex_mime_lua_open(L)) {
+ lua_setfield(L, -2, "mime");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ if(!luatex_url_lua_open(L)) {
+ lua_setfield(L, -2, "socket.url");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ if(!luatex_tp_lua_open(L)) {
+ lua_setfield(L, -2, "socket.tp");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ if(!luatex_smtp_lua_open(L)) {
+ lua_setfield(L, -2, "socket.smtp");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ if(!luatex_http_lua_open(L)) {
+ lua_setfield(L, -2, "socket.http");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ if(!luatex_ftp_lua_open(L)) {
+ lua_setfield(L, -2, "socket.ftp");
+ } else {
+ fprintf(stderr,"FATAL error while preloading lua modules");
+ exit(1);
+ }
+ lua_pop(L,2);
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.c b/Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.c
new file mode 100644
index 00000000000..11ffee94c46
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.c
@@ -0,0 +1,118 @@
+/*=========================================================================*\
+* LuaSocket toolkit
+* Networking support for the Lua language
+* Diego Nehab
+* 26/11/1999
+*
+* This library is part of an effort to progressively increase the network
+* connectivity of the Lua language. The Lua interface to networking
+* functions follows the Sockets API closely, trying to simplify all tasks
+* involved in setting up both client and server connections. The provided
+* IO routines, however, follow the Lua style, being very similar to the
+* standard Lua read and write functions.
+*
+* RCS ID: $Id: luasocket.c,v 1.53 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+
+/*=========================================================================*\
+* Standard include files
+\*=========================================================================*/
+#include "lua.h"
+#include "lauxlib.h"
+
+#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501)
+#include "compat-5.1.h"
+#endif
+
+/*=========================================================================*\
+* LuaSocket includes
+\*=========================================================================*/
+#include "luasocket.h"
+#include "auxiliar.h"
+#include "except.h"
+#include "timeout.h"
+#include "buffer.h"
+#include "inet.h"
+#include "tcp.h"
+#include "udp.h"
+#include "select.h"
+
+/*-------------------------------------------------------------------------*\
+* Internal function prototypes
+\*-------------------------------------------------------------------------*/
+static int global_skip(lua_State *L);
+static int global_unload(lua_State *L);
+static int base_open(lua_State *L);
+
+/*-------------------------------------------------------------------------*\
+* Modules and functions
+\*-------------------------------------------------------------------------*/
+static const luaL_reg mod[] = {
+ {"auxiliar", auxiliar_open},
+ {"except", except_open},
+ {"timeout", timeout_open},
+ {"buffer", buffer_open},
+ {"inet", inet_open},
+ {"tcp", tcp_open},
+ {"udp", udp_open},
+ {"select", select_open},
+ {NULL, NULL}
+};
+
+static luaL_reg func[] = {
+ {"skip", global_skip},
+ {"__unload", global_unload},
+ {NULL, NULL}
+};
+
+/*-------------------------------------------------------------------------*\
+* Skip a few arguments
+\*-------------------------------------------------------------------------*/
+static int global_skip(lua_State *L) {
+ int amount = luaL_checkint(L, 1);
+ int ret = lua_gettop(L) - amount - 1;
+ return ret >= 0 ? ret : 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Unloads the library
+\*-------------------------------------------------------------------------*/
+static int global_unload(lua_State *L) {
+ (void) L;
+ socket_close();
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Setup basic stuff.
+\*-------------------------------------------------------------------------*/
+static int base_open(lua_State *L) {
+ if (socket_open()) {
+ /* export functions (and leave namespace table on top of stack) */
+ luaL_openlib(L, "socket", func, 0);
+#ifdef LUASOCKET_DEBUG
+ lua_pushstring(L, "_DEBUG");
+ lua_pushboolean(L, 1);
+ lua_rawset(L, -3);
+#endif
+ /* make version string available to scripts */
+ lua_pushstring(L, "_VERSION");
+ lua_pushstring(L, LUASOCKET_VERSION);
+ lua_rawset(L, -3);
+ return 1;
+ } else {
+ lua_pushstring(L, "unable to initialize library");
+ lua_error(L);
+ return 0;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Initializes all library modules.
+\*-------------------------------------------------------------------------*/
+LUASOCKET_API int luaopen_socket_core(lua_State *L) {
+ int i;
+ base_open(L);
+ for (i = 0; mod[i].name; i++) mod[i].func(L);
+ return 1;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.h b/Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.h
new file mode 100644
index 00000000000..67270abb937
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/luasocket.h
@@ -0,0 +1,32 @@
+#ifndef LUASOCKET_H
+#define LUASOCKET_H
+/*=========================================================================*\
+* LuaSocket toolkit
+* Networking support for the Lua language
+* Diego Nehab
+* 9/11/1999
+*
+* RCS ID: $Id: luasocket.h,v 1.25 2007/06/11 23:44:54 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+
+/*-------------------------------------------------------------------------*\
+* Current socket library version
+\*-------------------------------------------------------------------------*/
+#define LUASOCKET_VERSION "LuaSocket 2.0.2"
+#define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2007 Diego Nehab"
+#define LUASOCKET_AUTHORS "Diego Nehab"
+
+/*-------------------------------------------------------------------------*\
+* This macro prefixes all exported API functions
+\*-------------------------------------------------------------------------*/
+#ifndef LUASOCKET_API
+#define LUASOCKET_API extern
+#endif
+
+/*-------------------------------------------------------------------------*\
+* Initializes the library.
+\*-------------------------------------------------------------------------*/
+LUASOCKET_API int luaopen_socket_core(lua_State *L);
+
+#endif /* LUASOCKET_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/mime.c b/Build/source/texk/web2c/luatexdir/luasocket/src/mime.c
new file mode 100644
index 00000000000..700fa05e930
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/mime.c
@@ -0,0 +1,711 @@
+/*=========================================================================*\
+* MIME support functions
+* LuaSocket toolkit
+*
+* RCS ID: $Id: mime.c,v 1.28 2005/11/20 07:20:23 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501)
+#include "compat-5.1.h"
+#endif
+
+#include "mime.h"
+
+/*=========================================================================*\
+* Don't want to trust escape character constants
+\*=========================================================================*/
+typedef unsigned char UC;
+static const char CRLF[] = "\r\n";
+static const char EQCRLF[] = "=\r\n";
+
+/*=========================================================================*\
+* Internal function prototypes.
+\*=========================================================================*/
+static int mime_global_wrp(lua_State *L);
+static int mime_global_b64(lua_State *L);
+static int mime_global_unb64(lua_State *L);
+static int mime_global_qp(lua_State *L);
+static int mime_global_unqp(lua_State *L);
+static int mime_global_qpwrp(lua_State *L);
+static int mime_global_eol(lua_State *L);
+static int mime_global_dot(lua_State *L);
+
+static size_t dot(int c, size_t state, luaL_Buffer *buffer);
+static void b64setup(UC *b64unbase);
+static size_t b64encode(UC c, UC *input, size_t size, luaL_Buffer *buffer);
+static size_t b64pad(const UC *input, size_t size, luaL_Buffer *buffer);
+static size_t b64decode(UC c, UC *input, size_t size, luaL_Buffer *buffer);
+
+static void qpsetup(UC *qpclass, UC *qpunbase);
+static void qpquote(UC c, luaL_Buffer *buffer);
+static size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer);
+static size_t qpencode(UC c, UC *input, size_t size,
+ const char *marker, luaL_Buffer *buffer);
+static size_t qppad(UC *input, size_t size, luaL_Buffer *buffer);
+
+/* code support functions */
+static luaL_reg func[] = {
+ { "dot", mime_global_dot },
+ { "b64", mime_global_b64 },
+ { "eol", mime_global_eol },
+ { "qp", mime_global_qp },
+ { "qpwrp", mime_global_qpwrp },
+ { "unb64", mime_global_unb64 },
+ { "unqp", mime_global_unqp },
+ { "wrp", mime_global_wrp },
+ { NULL, NULL }
+};
+
+/*-------------------------------------------------------------------------*\
+* Quoted-printable globals
+\*-------------------------------------------------------------------------*/
+static UC qpclass[256];
+static UC qpbase[] = "0123456789ABCDEF";
+static UC qpunbase[256];
+enum {QP_PLAIN, QP_QUOTED, QP_CR, QP_IF_LAST};
+
+/*-------------------------------------------------------------------------*\
+* Base64 globals
+\*-------------------------------------------------------------------------*/
+static const UC b64base[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static UC b64unbase[256];
+
+/*=========================================================================*\
+* Exported functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+MIME_API int luaopen_mime_core(lua_State *L)
+{
+ luaL_openlib(L, "mime", func, 0);
+ /* make version string available to scripts */
+ lua_pushstring(L, "_VERSION");
+ lua_pushstring(L, MIME_VERSION);
+ lua_rawset(L, -3);
+ /* initialize lookup tables */
+ qpsetup(qpclass, qpunbase);
+ b64setup(b64unbase);
+ return 1;
+}
+
+/*=========================================================================*\
+* Global Lua functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Incrementaly breaks a string into lines. The string can have CRLF breaks.
+* A, n = wrp(l, B, length)
+* A is a copy of B, broken into lines of at most 'length' bytes.
+* 'l' is how many bytes are left for the first line of B.
+* 'n' is the number of bytes left in the last line of A.
+\*-------------------------------------------------------------------------*/
+static int mime_global_wrp(lua_State *L)
+{
+ size_t size = 0;
+ int left = (int) luaL_checknumber(L, 1);
+ const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size);
+ const UC *last = input + size;
+ int length = (int) luaL_optnumber(L, 3, 76);
+ luaL_Buffer buffer;
+ /* end of input black-hole */
+ if (!input) {
+ /* if last line has not been terminated, add a line break */
+ if (left < length) lua_pushstring(L, CRLF);
+ /* otherwise, we are done */
+ else lua_pushnil(L);
+ lua_pushnumber(L, length);
+ return 2;
+ }
+ luaL_buffinit(L, &buffer);
+ while (input < last) {
+ switch (*input) {
+ case '\r':
+ break;
+ case '\n':
+ luaL_addstring(&buffer, CRLF);
+ left = length;
+ break;
+ default:
+ if (left <= 0) {
+ left = length;
+ luaL_addstring(&buffer, CRLF);
+ }
+ luaL_putchar(&buffer, *input);
+ left--;
+ break;
+ }
+ input++;
+ }
+ luaL_pushresult(&buffer);
+ lua_pushnumber(L, left);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Fill base64 decode map.
+\*-------------------------------------------------------------------------*/
+static void b64setup(UC *b64unbase)
+{
+ int i;
+ for (i = 0; i <= 255; i++) b64unbase[i] = (UC) 255;
+ for (i = 0; i < 64; i++) b64unbase[b64base[i]] = (UC) i;
+ b64unbase['='] = 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Acumulates bytes in input buffer until 3 bytes are available.
+* Translate the 3 bytes into Base64 form and append to buffer.
+* Returns new number of bytes in buffer.
+\*-------------------------------------------------------------------------*/
+static size_t b64encode(UC c, UC *input, size_t size,
+ luaL_Buffer *buffer)
+{
+ input[size++] = c;
+ if (size == 3) {
+ UC code[4];
+ unsigned long value = 0;
+ value += input[0]; value <<= 8;
+ value += input[1]; value <<= 8;
+ value += input[2];
+ code[3] = b64base[value & 0x3f]; value >>= 6;
+ code[2] = b64base[value & 0x3f]; value >>= 6;
+ code[1] = b64base[value & 0x3f]; value >>= 6;
+ code[0] = b64base[value];
+ luaL_addlstring(buffer, (char *) code, 4);
+ size = 0;
+ }
+ return size;
+}
+
+/*-------------------------------------------------------------------------*\
+* Encodes the Base64 last 1 or 2 bytes and adds padding '='
+* Result, if any, is appended to buffer.
+* Returns 0.
+\*-------------------------------------------------------------------------*/
+static size_t b64pad(const UC *input, size_t size,
+ luaL_Buffer *buffer)
+{
+ unsigned long value = 0;
+ UC code[4] = {'=', '=', '=', '='};
+ switch (size) {
+ case 1:
+ value = input[0] << 4;
+ code[1] = b64base[value & 0x3f]; value >>= 6;
+ code[0] = b64base[value];
+ luaL_addlstring(buffer, (char *) code, 4);
+ break;
+ case 2:
+ value = input[0]; value <<= 8;
+ value |= input[1]; value <<= 2;
+ code[2] = b64base[value & 0x3f]; value >>= 6;
+ code[1] = b64base[value & 0x3f]; value >>= 6;
+ code[0] = b64base[value];
+ luaL_addlstring(buffer, (char *) code, 4);
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Acumulates bytes in input buffer until 4 bytes are available.
+* Translate the 4 bytes from Base64 form and append to buffer.
+* Returns new number of bytes in buffer.
+\*-------------------------------------------------------------------------*/
+static size_t b64decode(UC c, UC *input, size_t size,
+ luaL_Buffer *buffer)
+{
+ /* ignore invalid characters */
+ if (b64unbase[c] > 64) return size;
+ input[size++] = c;
+ /* decode atom */
+ if (size == 4) {
+ UC decoded[3];
+ int valid, value = 0;
+ value = b64unbase[input[0]]; value <<= 6;
+ value |= b64unbase[input[1]]; value <<= 6;
+ value |= b64unbase[input[2]]; value <<= 6;
+ value |= b64unbase[input[3]];
+ decoded[2] = (UC) (value & 0xff); value >>= 8;
+ decoded[1] = (UC) (value & 0xff); value >>= 8;
+ decoded[0] = (UC) value;
+ /* take care of paddding */
+ valid = (input[2] == '=') ? 1 : (input[3] == '=') ? 2 : 3;
+ luaL_addlstring(buffer, (char *) decoded, valid);
+ return 0;
+ /* need more data */
+ } else return size;
+}
+
+/*-------------------------------------------------------------------------*\
+* Incrementally applies the Base64 transfer content encoding to a string
+* A, B = b64(C, D)
+* A is the encoded version of the largest prefix of C .. D that is
+* divisible by 3. B has the remaining bytes of C .. D, *without* encoding.
+* The easiest thing would be to concatenate the two strings and
+* encode the result, but we can't afford that or Lua would dupplicate
+* every chunk we received.
+\*-------------------------------------------------------------------------*/
+static int mime_global_b64(lua_State *L)
+{
+ UC atom[3];
+ size_t isize = 0, asize = 0;
+ const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);
+ const UC *last = input + isize;
+ luaL_Buffer buffer;
+ /* end-of-input blackhole */
+ if (!input) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* process first part of the input */
+ luaL_buffinit(L, &buffer);
+ while (input < last)
+ asize = b64encode(*input++, atom, asize, &buffer);
+ input = (UC *) luaL_optlstring(L, 2, NULL, &isize);
+ /* if second part is nil, we are done */
+ if (!input) {
+ asize = b64pad(atom, asize, &buffer);
+ luaL_pushresult(&buffer);
+ if (!(*lua_tostring(L, -1))) lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* otherwise process the second part */
+ last = input + isize;
+ while (input < last)
+ asize = b64encode(*input++, atom, asize, &buffer);
+ luaL_pushresult(&buffer);
+ lua_pushlstring(L, (char *) atom, asize);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Incrementally removes the Base64 transfer content encoding from a string
+* A, B = b64(C, D)
+* A is the encoded version of the largest prefix of C .. D that is
+* divisible by 4. B has the remaining bytes of C .. D, *without* encoding.
+\*-------------------------------------------------------------------------*/
+static int mime_global_unb64(lua_State *L)
+{
+ UC atom[4];
+ size_t isize = 0, asize = 0;
+ const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);
+ const UC *last = input + isize;
+ luaL_Buffer buffer;
+ /* end-of-input blackhole */
+ if (!input) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* process first part of the input */
+ luaL_buffinit(L, &buffer);
+ while (input < last)
+ asize = b64decode(*input++, atom, asize, &buffer);
+ input = (UC *) luaL_optlstring(L, 2, NULL, &isize);
+ /* if second is nil, we are done */
+ if (!input) {
+ luaL_pushresult(&buffer);
+ if (!(*lua_tostring(L, -1))) lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* otherwise, process the rest of the input */
+ last = input + isize;
+ while (input < last)
+ asize = b64decode(*input++, atom, asize, &buffer);
+ luaL_pushresult(&buffer);
+ lua_pushlstring(L, (char *) atom, asize);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Quoted-printable encoding scheme
+* all (except CRLF in text) can be =XX
+* CLRL in not text must be =XX=XX
+* 33 through 60 inclusive can be plain
+* 62 through 126 inclusive can be plain
+* 9 and 32 can be plain, unless in the end of a line, where must be =XX
+* encoded lines must be no longer than 76 not counting CRLF
+* soft line-break are =CRLF
+* To encode one byte, we need to see the next two.
+* Worst case is when we see a space, and wonder if a CRLF is comming
+\*-------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------*\
+* Split quoted-printable characters into classes
+* Precompute reverse map for encoding
+\*-------------------------------------------------------------------------*/
+static void qpsetup(UC *qpclass, UC *qpunbase)
+{
+ int i;
+ for (i = 0; i < 256; i++) qpclass[i] = QP_QUOTED;
+ for (i = 33; i <= 60; i++) qpclass[i] = QP_PLAIN;
+ for (i = 62; i <= 126; i++) qpclass[i] = QP_PLAIN;
+ qpclass['\t'] = QP_IF_LAST;
+ qpclass[' '] = QP_IF_LAST;
+ qpclass['\r'] = QP_CR;
+ for (i = 0; i < 256; i++) qpunbase[i] = 255;
+ qpunbase['0'] = 0; qpunbase['1'] = 1; qpunbase['2'] = 2;
+ qpunbase['3'] = 3; qpunbase['4'] = 4; qpunbase['5'] = 5;
+ qpunbase['6'] = 6; qpunbase['7'] = 7; qpunbase['8'] = 8;
+ qpunbase['9'] = 9; qpunbase['A'] = 10; qpunbase['a'] = 10;
+ qpunbase['B'] = 11; qpunbase['b'] = 11; qpunbase['C'] = 12;
+ qpunbase['c'] = 12; qpunbase['D'] = 13; qpunbase['d'] = 13;
+ qpunbase['E'] = 14; qpunbase['e'] = 14; qpunbase['F'] = 15;
+ qpunbase['f'] = 15;
+}
+
+/*-------------------------------------------------------------------------*\
+* Output one character in form =XX
+\*-------------------------------------------------------------------------*/
+static void qpquote(UC c, luaL_Buffer *buffer)
+{
+ luaL_putchar(buffer, '=');
+ luaL_putchar(buffer, qpbase[c >> 4]);
+ luaL_putchar(buffer, qpbase[c & 0x0F]);
+}
+
+/*-------------------------------------------------------------------------*\
+* Accumulate characters until we are sure about how to deal with them.
+* Once we are sure, output to the buffer, in the correct form.
+\*-------------------------------------------------------------------------*/
+static size_t qpencode(UC c, UC *input, size_t size,
+ const char *marker, luaL_Buffer *buffer)
+{
+ input[size++] = c;
+ /* deal with all characters we can have */
+ while (size > 0) {
+ switch (qpclass[input[0]]) {
+ /* might be the CR of a CRLF sequence */
+ case QP_CR:
+ if (size < 2) return size;
+ if (input[1] == '\n') {
+ luaL_addstring(buffer, marker);
+ return 0;
+ } else qpquote(input[0], buffer);
+ break;
+ /* might be a space and that has to be quoted if last in line */
+ case QP_IF_LAST:
+ if (size < 3) return size;
+ /* if it is the last, quote it and we are done */
+ if (input[1] == '\r' && input[2] == '\n') {
+ qpquote(input[0], buffer);
+ luaL_addstring(buffer, marker);
+ return 0;
+ } else luaL_putchar(buffer, input[0]);
+ break;
+ /* might have to be quoted always */
+ case QP_QUOTED:
+ qpquote(input[0], buffer);
+ break;
+ /* might never have to be quoted */
+ default:
+ luaL_putchar(buffer, input[0]);
+ break;
+ }
+ input[0] = input[1]; input[1] = input[2];
+ size--;
+ }
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Deal with the final characters
+\*-------------------------------------------------------------------------*/
+static size_t qppad(UC *input, size_t size, luaL_Buffer *buffer)
+{
+ size_t i;
+ for (i = 0; i < size; i++) {
+ if (qpclass[input[i]] == QP_PLAIN) luaL_putchar(buffer, input[i]);
+ else qpquote(input[i], buffer);
+ }
+ if (size > 0) luaL_addstring(buffer, EQCRLF);
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Incrementally converts a string to quoted-printable
+* A, B = qp(C, D, marker)
+* Marker is the text to be used to replace CRLF sequences found in A.
+* A is the encoded version of the largest prefix of C .. D that
+* can be encoded without doubts.
+* B has the remaining bytes of C .. D, *without* encoding.
+\*-------------------------------------------------------------------------*/
+static int mime_global_qp(lua_State *L)
+{
+
+ size_t asize = 0, isize = 0;
+ UC atom[3];
+ const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);
+ const UC *last = input + isize;
+ const char *marker = luaL_optstring(L, 3, CRLF);
+ luaL_Buffer buffer;
+ /* end-of-input blackhole */
+ if (!input) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* process first part of input */
+ luaL_buffinit(L, &buffer);
+ while (input < last)
+ asize = qpencode(*input++, atom, asize, marker, &buffer);
+ input = (UC *) luaL_optlstring(L, 2, NULL, &isize);
+ /* if second part is nil, we are done */
+ if (!input) {
+ asize = qppad(atom, asize, &buffer);
+ luaL_pushresult(&buffer);
+ if (!(*lua_tostring(L, -1))) lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* otherwise process rest of input */
+ last = input + isize;
+ while (input < last)
+ asize = qpencode(*input++, atom, asize, marker, &buffer);
+ luaL_pushresult(&buffer);
+ lua_pushlstring(L, (char *) atom, asize);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Accumulate characters until we are sure about how to deal with them.
+* Once we are sure, output the to the buffer, in the correct form.
+\*-------------------------------------------------------------------------*/
+static size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer) {
+ int d;
+ input[size++] = c;
+ /* deal with all characters we can deal */
+ switch (input[0]) {
+ /* if we have an escape character */
+ case '=':
+ if (size < 3) return size;
+ /* eliminate soft line break */
+ if (input[1] == '\r' && input[2] == '\n') return 0;
+ /* decode quoted representation */
+ c = qpunbase[input[1]]; d = qpunbase[input[2]];
+ /* if it is an invalid, do not decode */
+ if (c > 15 || d > 15) luaL_addlstring(buffer, (char *)input, 3);
+ else luaL_putchar(buffer, (c << 4) + d);
+ return 0;
+ case '\r':
+ if (size < 2) return size;
+ if (input[1] == '\n') luaL_addlstring(buffer, (char *)input, 2);
+ return 0;
+ default:
+ if (input[0] == '\t' || (input[0] > 31 && input[0] < 127))
+ luaL_putchar(buffer, input[0]);
+ return 0;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Incrementally decodes a string in quoted-printable
+* A, B = qp(C, D)
+* A is the decoded version of the largest prefix of C .. D that
+* can be decoded without doubts.
+* B has the remaining bytes of C .. D, *without* decoding.
+\*-------------------------------------------------------------------------*/
+static int mime_global_unqp(lua_State *L)
+{
+ size_t asize = 0, isize = 0;
+ UC atom[3];
+ const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);
+ const UC *last = input + isize;
+ luaL_Buffer buffer;
+ /* end-of-input blackhole */
+ if (!input) {
+ lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* process first part of input */
+ luaL_buffinit(L, &buffer);
+ while (input < last)
+ asize = qpdecode(*input++, atom, asize, &buffer);
+ input = (UC *) luaL_optlstring(L, 2, NULL, &isize);
+ /* if second part is nil, we are done */
+ if (!input) {
+ luaL_pushresult(&buffer);
+ if (!(*lua_tostring(L, -1))) lua_pushnil(L);
+ lua_pushnil(L);
+ return 2;
+ }
+ /* otherwise process rest of input */
+ last = input + isize;
+ while (input < last)
+ asize = qpdecode(*input++, atom, asize, &buffer);
+ luaL_pushresult(&buffer);
+ lua_pushlstring(L, (char *) atom, asize);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Incrementally breaks a quoted-printed string into lines
+* A, n = qpwrp(l, B, length)
+* A is a copy of B, broken into lines of at most 'length' bytes.
+* 'l' is how many bytes are left for the first line of B.
+* 'n' is the number of bytes left in the last line of A.
+* There are two complications: lines can't be broken in the middle
+* of an encoded =XX, and there might be line breaks already
+\*-------------------------------------------------------------------------*/
+static int mime_global_qpwrp(lua_State *L)
+{
+ size_t size = 0;
+ int left = (int) luaL_checknumber(L, 1);
+ const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size);
+ const UC *last = input + size;
+ int length = (int) luaL_optnumber(L, 3, 76);
+ luaL_Buffer buffer;
+ /* end-of-input blackhole */
+ if (!input) {
+ if (left < length) lua_pushstring(L, EQCRLF);
+ else lua_pushnil(L);
+ lua_pushnumber(L, length);
+ return 2;
+ }
+ /* process all input */
+ luaL_buffinit(L, &buffer);
+ while (input < last) {
+ switch (*input) {
+ case '\r':
+ break;
+ case '\n':
+ left = length;
+ luaL_addstring(&buffer, CRLF);
+ break;
+ case '=':
+ if (left <= 3) {
+ left = length;
+ luaL_addstring(&buffer, EQCRLF);
+ }
+ luaL_putchar(&buffer, *input);
+ left--;
+ break;
+ default:
+ if (left <= 1) {
+ left = length;
+ luaL_addstring(&buffer, EQCRLF);
+ }
+ luaL_putchar(&buffer, *input);
+ left--;
+ break;
+ }
+ input++;
+ }
+ luaL_pushresult(&buffer);
+ lua_pushnumber(L, left);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Here is what we do: \n, and \r are considered candidates for line
+* break. We issue *one* new line marker if any of them is seen alone, or
+* followed by a different one. That is, \n\n and \r\r will issue two
+* end of line markers each, but \r\n, \n\r etc will only issue *one*
+* marker. This covers Mac OS, Mac OS X, VMS, Unix and DOS, as well as
+* probably other more obscure conventions.
+*
+* c is the current character being processed
+* last is the previous character
+\*-------------------------------------------------------------------------*/
+#define eolcandidate(c) (c == '\r' || c == '\n')
+static int eolprocess(int c, int last, const char *marker,
+ luaL_Buffer *buffer)
+{
+ if (eolcandidate(c)) {
+ if (eolcandidate(last)) {
+ if (c == last) luaL_addstring(buffer, marker);
+ return 0;
+ } else {
+ luaL_addstring(buffer, marker);
+ return c;
+ }
+ } else {
+ luaL_putchar(buffer, c);
+ return 0;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Converts a string to uniform EOL convention.
+* A, n = eol(o, B, marker)
+* A is the converted version of the largest prefix of B that can be
+* converted unambiguously. 'o' is the context returned by the previous
+* call. 'n' is the new context.
+\*-------------------------------------------------------------------------*/
+static int mime_global_eol(lua_State *L)
+{
+ int ctx = luaL_checkint(L, 1);
+ size_t isize = 0;
+ const char *input = luaL_optlstring(L, 2, NULL, &isize);
+ const char *last = input + isize;
+ const char *marker = luaL_optstring(L, 3, CRLF);
+ luaL_Buffer buffer;
+ luaL_buffinit(L, &buffer);
+ /* end of input blackhole */
+ if (!input) {
+ lua_pushnil(L);
+ lua_pushnumber(L, 0);
+ return 2;
+ }
+ /* process all input */
+ while (input < last)
+ ctx = eolprocess(*input++, ctx, marker, &buffer);
+ luaL_pushresult(&buffer);
+ lua_pushnumber(L, ctx);
+ return 2;
+}
+
+/*-------------------------------------------------------------------------*\
+* Takes one byte and stuff it if needed.
+\*-------------------------------------------------------------------------*/
+static size_t dot(int c, size_t state, luaL_Buffer *buffer)
+{
+ luaL_putchar(buffer, c);
+ switch (c) {
+ case '\r':
+ return 1;
+ case '\n':
+ return (state == 1)? 2: 0;
+ case '.':
+ if (state == 2)
+ luaL_putchar(buffer, '.');
+ default:
+ return 0;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Incrementally applies smtp stuffing to a string
+* A, n = dot(l, D)
+\*-------------------------------------------------------------------------*/
+static int mime_global_dot(lua_State *L)
+{
+ size_t isize = 0, state = (size_t) luaL_checknumber(L, 1);
+ const char *input = luaL_optlstring(L, 2, NULL, &isize);
+ const char *last = input + isize;
+ luaL_Buffer buffer;
+ /* end-of-input blackhole */
+ if (!input) {
+ lua_pushnil(L);
+ lua_pushnumber(L, 2);
+ return 2;
+ }
+ /* process all input */
+ luaL_buffinit(L, &buffer);
+ while (input < last)
+ state = dot(*input++, state, &buffer);
+ luaL_pushresult(&buffer);
+ lua_pushnumber(L, state);
+ return 2;
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/mime.h b/Build/source/texk/web2c/luatexdir/luasocket/src/mime.h
new file mode 100644
index 00000000000..85ee2a39856
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/mime.h
@@ -0,0 +1,31 @@
+#ifndef MIME_H
+#define MIME_H
+/*=========================================================================*\
+* Core MIME support
+* LuaSocket toolkit
+*
+* This module provides functions to implement transfer content encodings
+* and formatting conforming to RFC 2045. It is used by mime.lua, which
+* provide a higher level interface to this functionality.
+*
+* RCS ID: $Id: mime.h,v 1.15 2007/06/11 23:44:54 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+
+/*-------------------------------------------------------------------------*\
+* Current MIME library version
+\*-------------------------------------------------------------------------*/
+#define MIME_VERSION "MIME 1.0.2"
+#define MIME_COPYRIGHT "Copyright (C) 2004-2007 Diego Nehab"
+#define MIME_AUTHORS "Diego Nehab"
+
+/*-------------------------------------------------------------------------*\
+* This macro prefixes all exported API functions
+\*-------------------------------------------------------------------------*/
+#ifndef MIME_API
+#define MIME_API extern
+#endif
+
+MIME_API int luaopen_mime_core(lua_State *L);
+
+#endif /* MIME_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/mime.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/mime.lua
new file mode 100644
index 00000000000..169eda29a94
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/mime.lua
@@ -0,0 +1,87 @@
+-----------------------------------------------------------------------------
+-- MIME support for the Lua language.
+-- Author: Diego Nehab
+-- Conforming to RFCs 2045-2049
+-- RCS ID: $Id: mime.lua,v 1.29 2007/06/11 23:44:54 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module and import dependencies
+-----------------------------------------------------------------------------
+local base = _G
+local ltn12 = require("ltn12")
+local mime = require("mime.core")
+local io = require("io")
+local string = require("string")
+module("mime")
+
+-- encode, decode and wrap algorithm tables
+encodet = {}
+decodet = {}
+wrapt = {}
+
+-- creates a function that chooses a filter by name from a given table
+local function choose(table)
+ return function(name, opt1, opt2)
+ if base.type(name) ~= "string" then
+ name, opt1, opt2 = "default", name, opt1
+ end
+ local f = table[name or "nil"]
+ if not f then
+ base.error("unknown key (" .. base.tostring(name) .. ")", 3)
+ else return f(opt1, opt2) end
+ end
+end
+
+-- define the encoding filters
+encodet['base64'] = function()
+ return ltn12.filter.cycle(b64, "")
+end
+
+encodet['quoted-printable'] = function(mode)
+ return ltn12.filter.cycle(qp, "",
+ (mode == "binary") and "=0D=0A" or "\r\n")
+end
+
+-- define the decoding filters
+decodet['base64'] = function()
+ return ltn12.filter.cycle(unb64, "")
+end
+
+decodet['quoted-printable'] = function()
+ return ltn12.filter.cycle(unqp, "")
+end
+
+local function format(chunk)
+ if chunk then
+ if chunk == "" then return "''"
+ else return string.len(chunk) end
+ else return "nil" end
+end
+
+-- define the line-wrap filters
+wrapt['text'] = function(length)
+ length = length or 76
+ return ltn12.filter.cycle(wrp, length, length)
+end
+wrapt['base64'] = wrapt['text']
+wrapt['default'] = wrapt['text']
+
+wrapt['quoted-printable'] = function()
+ return ltn12.filter.cycle(qpwrp, 76, 76)
+end
+
+-- function that choose the encoding, decoding or wrap algorithm
+encode = choose(encodet)
+decode = choose(decodet)
+wrap = choose(wrapt)
+
+-- define the end-of-line normalization filter
+function normalize(marker)
+ return ltn12.filter.cycle(eol, 0, marker)
+end
+
+-- high level stuffing filter
+function stuff()
+ return ltn12.filter.cycle(dot, 2)
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/mime_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/mime_lua.c
new file mode 100644
index 00000000000..e131536a8b4
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/mime_lua.c
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated by "./lua2c mime.lua mime_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_mime_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 77, 73, 77, 69, 32,115,117,112,112,111,114,116, 32,102,111,114, 32,116,104,
+101, 32, 76,117, 97, 32,108, 97,110,103,117, 97,103,101, 46, 10, 45, 45, 32, 65,
+117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45,
+ 45, 32, 67,111,110,102,111,114,109,105,110,103, 32,116,111, 32, 82, 70, 67,115,
+ 32, 50, 48, 52, 53, 45, 50, 48, 52, 57, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68,
+ 58, 32, 36, 73,100, 58, 32,109,105,109,101, 46,108,117, 97, 44,118, 32, 49, 46,
+ 50, 57, 32, 50, 48, 48, 55, 47, 48, 54, 47, 49, 49, 32, 50, 51, 58, 52, 52, 58,
+ 53, 52, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,
+114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116,
+ 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,
+115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,108,116,110, 49, 50, 32,
+ 61, 32,114,101,113,117,105,114,101, 40, 34,108,116,110, 49, 50, 34, 41, 10,108,
+111, 99, 97,108, 32,109,105,109,101, 32, 61, 32,114,101,113,117,105,114,101, 40,
+ 34,109,105,109,101, 46, 99,111,114,101, 34, 41, 10,108,111, 99, 97,108, 32,105,
+111, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,105,111, 34, 41, 10,108,111,
+ 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114,101,113,117,105,114,101,
+ 40, 34,115,116,114,105,110,103, 34, 41, 10,109,111,100,117,108,101, 40, 34,109,
+105,109,101, 34, 41, 10, 10, 45, 45, 32,101,110, 99,111,100,101, 44, 32,100,101,
+ 99,111,100,101, 32, 97,110,100, 32,119,114, 97,112, 32, 97,108,103,111,114,105,
+116,104,109, 32,116, 97, 98,108,101,115, 10,101,110, 99,111,100,101,116, 32, 61,
+ 32,123,125, 10,100,101, 99,111,100,101,116, 32, 61, 32,123,125, 10,119,114, 97,
+112,116, 32, 61, 32,123,125, 10, 10, 45, 45, 32, 99,114,101, 97,116,101,115, 32,
+ 97, 32,102,117,110, 99,116,105,111,110, 32,116,104, 97,116, 32, 99,104,111,111,
+115,101,115, 32, 97, 32,102,105,108,116,101,114, 32, 98,121, 32,110, 97,109,101,
+ 32,102,114,111,109, 32, 97, 32,103,105,118,101,110, 32,116, 97, 98,108,101, 10,
+108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32, 99,104,111,111,115,
+101, 40,116, 97, 98,108,101, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,
+102,117,110, 99,116,105,111,110, 40,110, 97,109,101, 44, 32,111,112,116, 49, 44,
+ 32,111,112,116, 50, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 98, 97,
+115,101, 46,116,121,112,101, 40,110, 97,109,101, 41, 32,126, 61, 32, 34,115,116,
+114,105,110,103, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,110, 97,109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, 32,
+ 61, 32, 34,100,101,102, 97,117,108,116, 34, 44, 32,110, 97,109,101, 44, 32,111,
+112,116, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,108,111, 99, 97,108, 32,102, 32, 61, 32,116, 97, 98,108,101, 91,
+110, 97,109,101, 32,111,114, 32, 34,110,105,108, 34, 93, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32,105,102, 32,110,111,116, 32,102, 32,116,104,101,110, 32, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 46,101,114,114,111,114,
+ 40, 34,117,110,107,110,111,119,110, 32,107,101,121, 32, 40, 34, 32, 46, 46, 32,
+ 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110, 97,109,101, 41, 32,
+ 46, 46, 32, 34, 41, 34, 44, 32, 51, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,
+108,115,101, 32,114,101,116,117,114,110, 32,102, 40,111,112,116, 49, 44, 32,111,
+112,116, 50, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100,
+ 10, 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,101,110, 99,111,
+100,105,110,103, 32,102,105,108,116,101,114,115, 10,101,110, 99,111,100,101,116,
+ 91, 39, 98, 97,115,101, 54, 52, 39, 93, 32, 61, 32,102,117,110, 99,116,105,111,
+110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,116,110, 49, 50,
+ 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, 40, 98, 54, 52, 44, 32, 34,
+ 34, 41, 10,101,110,100, 10, 10,101,110, 99,111,100,101,116, 91, 39,113,117,111,
+116,101,100, 45,112,114,105,110,116, 97, 98,108,101, 39, 93, 32, 61, 32,102,117,
+110, 99,116,105,111,110, 40,109,111,100,101, 41, 10, 32, 32, 32, 32,114,101,116,
+117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,
+108,101, 40,113,112, 44, 32, 34, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 40,
+109,111,100,101, 32, 61, 61, 32, 34, 98,105,110, 97,114,121, 34, 41, 32, 97,110,
+100, 32, 34, 61, 48, 68, 61, 48, 65, 34, 32,111,114, 32, 34, 92,114, 92,110, 34,
+ 41, 10,101,110,100, 10, 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101,
+ 32,100,101, 99,111,100,105,110,103, 32,102,105,108,116,101,114,115, 10,100,101,
+ 99,111,100,101,116, 91, 39, 98, 97,115,101, 54, 52, 39, 93, 32, 61, 32,102,117,
+110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,
+108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,101, 40,117,
+110, 98, 54, 52, 44, 32, 34, 34, 41, 10,101,110,100, 10, 10,100,101, 99,111,100,
+101,116, 91, 39,113,117,111,116,101,100, 45,112,114,105,110,116, 97, 98,108,101,
+ 39, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,
+114,101,116,117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46,
+ 99,121, 99,108,101, 40,117,110,113,112, 44, 32, 34, 34, 41, 10,101,110,100, 10,
+ 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,102,111,114,109,
+ 97,116, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32,105,102, 32, 99,104,117,
+110,107, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,
+104,117,110,107, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32,114,101,116,117,
+114,110, 32, 34, 39, 39, 34, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,
+ 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,108,101,110, 40, 99,
+104,117,110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,108,115,101, 32,114,
+101,116,117,114,110, 32, 34,110,105,108, 34, 32,101,110,100, 10,101,110,100, 10,
+ 10, 45, 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,108,105,110,101, 45,
+119,114, 97,112, 32,102,105,108,116,101,114,115, 10,119,114, 97,112,116, 91, 39,
+116,101,120,116, 39, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,108,101,
+110,103,116,104, 41, 10, 32, 32, 32, 32,108,101,110,103,116,104, 32, 61, 32,108,
+101,110,103,116,104, 32,111,114, 32, 55, 54, 10, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,
+101, 40,119,114,112, 44, 32,108,101,110,103,116,104, 44, 32,108,101,110,103,116,
+104, 41, 10,101,110,100, 10,119,114, 97,112,116, 91, 39, 98, 97,115,101, 54, 52,
+ 39, 93, 32, 61, 32,119,114, 97,112,116, 91, 39,116,101,120,116, 39, 93, 10,119,
+114, 97,112,116, 91, 39,100,101,102, 97,117,108,116, 39, 93, 32, 61, 32,119,114,
+ 97,112,116, 91, 39,116,101,120,116, 39, 93, 10, 10,119,114, 97,112,116, 91, 39,
+113,117,111,116,101,100, 45,112,114,105,110,116, 97, 98,108,101, 39, 93, 32, 61,
+ 32,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,
+101, 40,113,112,119,114,112, 44, 32, 55, 54, 44, 32, 55, 54, 41, 10,101,110,100,
+ 10, 10, 45, 45, 32,102,117,110, 99,116,105,111,110, 32,116,104, 97,116, 32, 99,
+104,111,111,115,101, 32,116,104,101, 32,101,110, 99,111,100,105,110,103, 44, 32,
+100,101, 99,111,100,105,110,103, 32,111,114, 32,119,114, 97,112, 32, 97,108,103,
+111,114,105,116,104,109, 10,101,110, 99,111,100,101, 32, 61, 32, 99,104,111,111,
+115,101, 40,101,110, 99,111,100,101,116, 41, 10,100,101, 99,111,100,101, 32, 61,
+ 32, 99,104,111,111,115,101, 40,100,101, 99,111,100,101,116, 41, 10,119,114, 97,
+112, 32, 61, 32, 99,104,111,111,115,101, 40,119,114, 97,112,116, 41, 10, 10, 45,
+ 45, 32,100,101,102,105,110,101, 32,116,104,101, 32,101,110,100, 45,111,102, 45,
+108,105,110,101, 32,110,111,114,109, 97,108,105,122, 97,116,105,111,110, 32,102,
+105,108,116,101,114, 10,102,117,110, 99,116,105,111,110, 32,110,111,114,109, 97,
+108,105,122,101, 40,109, 97,114,107,101,114, 41, 10, 32, 32, 32, 32,114,101,116,
+117,114,110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,
+108,101, 40,101,111,108, 44, 32, 48, 44, 32,109, 97,114,107,101,114, 41, 10,101,
+110,100, 10, 10, 45, 45, 32,104,105,103,104, 32,108,101,118,101,108, 32,115,116,
+117,102,102,105,110,103, 32,102,105,108,116,101,114, 10,102,117,110, 99,116,105,
+111,110, 32,115,116,117,102,102, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,
+110, 32,108,116,110, 49, 50, 46,102,105,108,116,101,114, 46, 99,121, 99,108,101,
+ 40,100,111,116, 44, 32, 50, 41, 10,101,110,100, 10,
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/options.c b/Build/source/texk/web2c/luatexdir/luasocket/src/options.c
new file mode 100644
index 00000000000..5da3c518c28
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/options.c
@@ -0,0 +1,149 @@
+/*=========================================================================*\
+* Common option interface
+* LuaSocket toolkit
+*
+* RCS ID: $Id: options.c,v 1.6 2005/11/20 07:20:23 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+
+#include "lauxlib.h"
+
+#include "auxiliar.h"
+#include "options.h"
+#include "inet.h"
+
+
+/*=========================================================================*\
+* Internal functions prototypes
+\*=========================================================================*/
+static int opt_setmembership(lua_State *L, p_socket ps, int level, int name);
+static int opt_setboolean(lua_State *L, p_socket ps, int level, int name);
+static int opt_set(lua_State *L, p_socket ps, int level, int name,
+ void *val, int len);
+
+/*=========================================================================*\
+* Exported functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Calls appropriate option handler
+\*-------------------------------------------------------------------------*/
+int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps)
+{
+ const char *name = luaL_checkstring(L, 2); /* obj, name, ... */
+ while (opt->name && strcmp(name, opt->name))
+ opt++;
+ if (!opt->func) {
+ char msg[45];
+ sprintf(msg, "unsupported option `%.35s'", name);
+ luaL_argerror(L, 2, msg);
+ }
+ return opt->func(L, ps);
+}
+
+/* enables reuse of local address */
+int opt_reuseaddr(lua_State *L, p_socket ps)
+{
+ return opt_setboolean(L, ps, SOL_SOCKET, SO_REUSEADDR);
+}
+
+/* disables the Naggle algorithm */
+int opt_tcp_nodelay(lua_State *L, p_socket ps)
+{
+ return opt_setboolean(L, ps, IPPROTO_TCP, TCP_NODELAY);
+}
+
+int opt_keepalive(lua_State *L, p_socket ps)
+{
+ return opt_setboolean(L, ps, SOL_SOCKET, SO_KEEPALIVE);
+}
+
+int opt_dontroute(lua_State *L, p_socket ps)
+{
+ return opt_setboolean(L, ps, SOL_SOCKET, SO_DONTROUTE);
+}
+
+int opt_broadcast(lua_State *L, p_socket ps)
+{
+ return opt_setboolean(L, ps, SOL_SOCKET, SO_BROADCAST);
+}
+
+int opt_ip_multicast_loop(lua_State *L, p_socket ps)
+{
+ return opt_setboolean(L, ps, IPPROTO_IP, IP_MULTICAST_LOOP);
+}
+
+int opt_linger(lua_State *L, p_socket ps)
+{
+ struct linger li; /* obj, name, table */
+ if (!lua_istable(L, 3)) luaL_typerror(L, 3, lua_typename(L, LUA_TTABLE));
+ lua_pushstring(L, "on");
+ lua_gettable(L, 3);
+ if (!lua_isboolean(L, -1))
+ luaL_argerror(L, 3, "boolean 'on' field expected");
+ li.l_onoff = (u_short) lua_toboolean(L, -1);
+ lua_pushstring(L, "timeout");
+ lua_gettable(L, 3);
+ if (!lua_isnumber(L, -1))
+ luaL_argerror(L, 3, "number 'timeout' field expected");
+ li.l_linger = (u_short) lua_tonumber(L, -1);
+ return opt_set(L, ps, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(li));
+}
+
+int opt_ip_multicast_ttl(lua_State *L, p_socket ps)
+{
+ int val = (int) luaL_checknumber(L, 3); /* obj, name, int */
+ return opt_set(L, ps, SOL_SOCKET, SO_LINGER, (char *) &val, sizeof(val));
+}
+
+int opt_ip_add_membership(lua_State *L, p_socket ps)
+{
+ return opt_setmembership(L, ps, IPPROTO_IP, IP_ADD_MEMBERSHIP);
+}
+
+int opt_ip_drop_membersip(lua_State *L, p_socket ps)
+{
+ return opt_setmembership(L, ps, IPPROTO_IP, IP_DROP_MEMBERSHIP);
+}
+
+/*=========================================================================*\
+* Auxiliar functions
+\*=========================================================================*/
+static int opt_setmembership(lua_State *L, p_socket ps, int level, int name)
+{
+ struct ip_mreq val; /* obj, name, table */
+ if (!lua_istable(L, 3)) luaL_typerror(L, 3, lua_typename(L, LUA_TTABLE));
+ lua_pushstring(L, "multiaddr");
+ lua_gettable(L, 3);
+ if (!lua_isstring(L, -1))
+ luaL_argerror(L, 3, "string 'multiaddr' field expected");
+ if (!inet_aton(lua_tostring(L, -1), &val.imr_multiaddr))
+ luaL_argerror(L, 3, "invalid 'multiaddr' ip address");
+ lua_pushstring(L, "interface");
+ lua_gettable(L, 3);
+ if (!lua_isstring(L, -1))
+ luaL_argerror(L, 3, "string 'interface' field expected");
+ val.imr_interface.s_addr = htonl(INADDR_ANY);
+ if (strcmp(lua_tostring(L, -1), "*") &&
+ !inet_aton(lua_tostring(L, -1), &val.imr_interface))
+ luaL_argerror(L, 3, "invalid 'interface' ip address");
+ return opt_set(L, ps, level, name, (char *) &val, sizeof(val));
+}
+
+static
+int opt_set(lua_State *L, p_socket ps, int level, int name, void *val, int len)
+{
+ if (setsockopt(*ps, level, name, (char *) val, len) < 0) {
+ lua_pushnil(L);
+ lua_pushstring(L, "setsockopt failed");
+ return 2;
+ }
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+static int opt_setboolean(lua_State *L, p_socket ps, int level, int name)
+{
+ int val = auxiliar_checkboolean(L, 3); /* obj, name, bool */
+ return opt_set(L, ps, level, name, (char *) &val, sizeof(val));
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/options.h b/Build/source/texk/web2c/luatexdir/luasocket/src/options.h
new file mode 100644
index 00000000000..4981cf2a0ef
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/options.h
@@ -0,0 +1,39 @@
+#ifndef OPTIONS_H
+#define OPTIONS_H
+/*=========================================================================*\
+* Common option interface
+* LuaSocket toolkit
+*
+* This module provides a common interface to socket options, used mainly by
+* modules UDP and TCP.
+*
+* RCS ID: $Id: options.h,v 1.4 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+
+#include "lua.h"
+#include "socket.h"
+
+/* option registry */
+typedef struct t_opt {
+ const char *name;
+ int (*func)(lua_State *L, p_socket ps);
+} t_opt;
+typedef t_opt *p_opt;
+
+/* supported options */
+int opt_dontroute(lua_State *L, p_socket ps);
+int opt_broadcast(lua_State *L, p_socket ps);
+int opt_reuseaddr(lua_State *L, p_socket ps);
+int opt_tcp_nodelay(lua_State *L, p_socket ps);
+int opt_keepalive(lua_State *L, p_socket ps);
+int opt_linger(lua_State *L, p_socket ps);
+int opt_reuseaddr(lua_State *L, p_socket ps);
+int opt_ip_multicast_ttl(lua_State *L, p_socket ps);
+int opt_ip_multicast_loop(lua_State *L, p_socket ps);
+int opt_ip_add_membership(lua_State *L, p_socket ps);
+int opt_ip_drop_membersip(lua_State *L, p_socket ps);
+
+/* invokes the appropriate option handler */
+int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps);
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/select.c b/Build/source/texk/web2c/luatexdir/luasocket/src/select.c
new file mode 100644
index 00000000000..d70f662713a
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/select.c
@@ -0,0 +1,200 @@
+/*=========================================================================*\
+* Select implementation
+* LuaSocket toolkit
+*
+* RCS ID: $Id: select.c,v 1.22 2005/11/20 07:20:23 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "socket.h"
+#include "timeout.h"
+#include "select.h"
+
+/*=========================================================================*\
+* Internal function prototypes.
+\*=========================================================================*/
+static t_socket getfd(lua_State *L);
+static int dirty(lua_State *L);
+static t_socket collect_fd(lua_State *L, int tab, t_socket max_fd,
+ int itab, fd_set *set);
+static int check_dirty(lua_State *L, int tab, int dtab, fd_set *set);
+static void return_fd(lua_State *L, fd_set *set, t_socket max_fd,
+ int itab, int tab, int start);
+static void make_assoc(lua_State *L, int tab);
+static int global_select(lua_State *L);
+
+/* functions in library namespace */
+static luaL_reg func[] = {
+ {"select", global_select},
+ {NULL, NULL}
+};
+
+/*=========================================================================*\
+* Exported functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int select_open(lua_State *L) {
+ luaL_openlib(L, NULL, func, 0);
+ return 0;
+}
+
+/*=========================================================================*\
+* Global Lua functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Waits for a set of sockets until a condition is met or timeout.
+\*-------------------------------------------------------------------------*/
+static int global_select(lua_State *L) {
+ int rtab, wtab, itab, ret, ndirty;
+ t_socket max_fd;
+ fd_set rset, wset;
+ t_timeout tm;
+ double t = luaL_optnumber(L, 3, -1);
+ FD_ZERO(&rset); FD_ZERO(&wset);
+ lua_settop(L, 3);
+ lua_newtable(L); itab = lua_gettop(L);
+ lua_newtable(L); rtab = lua_gettop(L);
+ lua_newtable(L); wtab = lua_gettop(L);
+ max_fd = collect_fd(L, 1, SOCKET_INVALID, itab, &rset);
+ ndirty = check_dirty(L, 1, rtab, &rset);
+ t = ndirty > 0? 0.0: t;
+ timeout_init(&tm, t, -1);
+ timeout_markstart(&tm);
+ max_fd = collect_fd(L, 2, max_fd, itab, &wset);
+ ret = socket_select(max_fd+1, &rset, &wset, NULL, &tm);
+ if (ret > 0 || ndirty > 0) {
+ return_fd(L, &rset, max_fd+1, itab, rtab, ndirty);
+ return_fd(L, &wset, max_fd+1, itab, wtab, 0);
+ make_assoc(L, rtab);
+ make_assoc(L, wtab);
+ return 2;
+ } else if (ret == 0) {
+ lua_pushstring(L, "timeout");
+ return 3;
+ } else {
+ lua_pushstring(L, "error");
+ return 3;
+ }
+}
+
+/*=========================================================================*\
+* Internal functions
+\*=========================================================================*/
+static t_socket getfd(lua_State *L) {
+ t_socket fd = SOCKET_INVALID;
+ lua_pushstring(L, "getfd");
+ lua_gettable(L, -2);
+ if (!lua_isnil(L, -1)) {
+ lua_pushvalue(L, -2);
+ lua_call(L, 1, 1);
+ if (lua_isnumber(L, -1))
+ fd = (t_socket) lua_tonumber(L, -1);
+ }
+ lua_pop(L, 1);
+ return fd;
+}
+
+static int dirty(lua_State *L) {
+ int is = 0;
+ lua_pushstring(L, "dirty");
+ lua_gettable(L, -2);
+ if (!lua_isnil(L, -1)) {
+ lua_pushvalue(L, -2);
+ lua_call(L, 1, 1);
+ is = lua_toboolean(L, -1);
+ }
+ lua_pop(L, 1);
+ return is;
+}
+
+static t_socket collect_fd(lua_State *L, int tab, t_socket max_fd,
+ int itab, fd_set *set) {
+ int i = 1;
+ if (lua_isnil(L, tab))
+ return max_fd;
+ while (1) {
+ t_socket fd;
+ lua_pushnumber(L, i);
+ lua_gettable(L, tab);
+ if (lua_isnil(L, -1)) {
+ lua_pop(L, 1);
+ break;
+ }
+ fd = getfd(L);
+ if (fd != SOCKET_INVALID) {
+ FD_SET(fd, set);
+ if (max_fd == SOCKET_INVALID || max_fd < fd)
+ max_fd = fd;
+ lua_pushnumber(L, fd);
+ lua_pushvalue(L, -2);
+ lua_settable(L, itab);
+ }
+ lua_pop(L, 1);
+ i = i + 1;
+ }
+ return max_fd;
+}
+
+static int check_dirty(lua_State *L, int tab, int dtab, fd_set *set) {
+ int ndirty = 0, i = 1;
+ if (lua_isnil(L, tab))
+ return 0;
+ while (1) {
+ t_socket fd;
+ lua_pushnumber(L, i);
+ lua_gettable(L, tab);
+ if (lua_isnil(L, -1)) {
+ lua_pop(L, 1);
+ break;
+ }
+ fd = getfd(L);
+ if (fd != SOCKET_INVALID && dirty(L)) {
+ lua_pushnumber(L, ++ndirty);
+ lua_pushvalue(L, -2);
+ lua_settable(L, dtab);
+ FD_CLR(fd, set);
+ }
+ lua_pop(L, 1);
+ i = i + 1;
+ }
+ return ndirty;
+}
+
+static void return_fd(lua_State *L, fd_set *set, t_socket max_fd,
+ int itab, int tab, int start) {
+ t_socket fd;
+ for (fd = 0; fd < max_fd; fd++) {
+ if (FD_ISSET(fd, set)) {
+ lua_pushnumber(L, ++start);
+ lua_pushnumber(L, fd);
+ lua_gettable(L, itab);
+ lua_settable(L, tab);
+ }
+ }
+}
+
+static void make_assoc(lua_State *L, int tab) {
+ int i = 1, atab;
+ lua_newtable(L); atab = lua_gettop(L);
+ while (1) {
+ lua_pushnumber(L, i);
+ lua_gettable(L, tab);
+ if (!lua_isnil(L, -1)) {
+ lua_pushnumber(L, i);
+ lua_pushvalue(L, -2);
+ lua_settable(L, atab);
+ lua_pushnumber(L, i);
+ lua_settable(L, atab);
+ } else {
+ lua_pop(L, 1);
+ break;
+ }
+ i = i+1;
+ }
+}
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/select.h b/Build/source/texk/web2c/luatexdir/luasocket/src/select.h
new file mode 100644
index 00000000000..aa3db4adf3b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/select.h
@@ -0,0 +1,17 @@
+#ifndef SELECT_H
+#define SELECT_H
+/*=========================================================================*\
+* Select implementation
+* LuaSocket toolkit
+*
+* Each object that can be passed to the select function has to export
+* method getfd() which returns the descriptor to be passed to the
+* underlying select function. Another method, dirty(), should return
+* true if there is data ready for reading (required for buffered input).
+*
+* RCS ID: $Id: select.h,v 1.7 2004/06/16 01:02:07 diego Exp $
+\*=========================================================================*/
+
+int select_open(lua_State *L);
+
+#endif /* SELECT_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/smtp.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/smtp.lua
new file mode 100644
index 00000000000..8f3cfcff6e4
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/smtp.lua
@@ -0,0 +1,251 @@
+-----------------------------------------------------------------------------
+-- SMTP client support for the Lua language.
+-- LuaSocket toolkit.
+-- Author: Diego Nehab
+-- RCS ID: $Id: smtp.lua,v 1.46 2007/03/12 04:08:40 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module and import dependencies
+-----------------------------------------------------------------------------
+local base = _G
+local coroutine = require("coroutine")
+local string = require("string")
+local math = require("math")
+local os = require("os")
+local socket = require("socket")
+local tp = require("socket.tp")
+local ltn12 = require("ltn12")
+local mime = require("mime")
+module("socket.smtp")
+
+-----------------------------------------------------------------------------
+-- Program constants
+-----------------------------------------------------------------------------
+-- timeout for connection
+TIMEOUT = 60
+-- default server used to send e-mails
+SERVER = "localhost"
+-- default port
+PORT = 25
+-- domain used in HELO command and default sendmail
+-- If we are under a CGI, try to get from environment
+DOMAIN = os.getenv("SERVER_NAME") or "localhost"
+-- default time zone (means we don't know)
+ZONE = "-0000"
+
+---------------------------------------------------------------------------
+-- Low level SMTP API
+-----------------------------------------------------------------------------
+local metat = { __index = {} }
+
+function metat.__index:greet(domain)
+ self.try(self.tp:check("2.."))
+ self.try(self.tp:command("EHLO", domain or DOMAIN))
+ return socket.skip(1, self.try(self.tp:check("2..")))
+end
+
+function metat.__index:mail(from)
+ self.try(self.tp:command("MAIL", "FROM:" .. from))
+ return self.try(self.tp:check("2.."))
+end
+
+function metat.__index:rcpt(to)
+ self.try(self.tp:command("RCPT", "TO:" .. to))
+ return self.try(self.tp:check("2.."))
+end
+
+function metat.__index:data(src, step)
+ self.try(self.tp:command("DATA"))
+ self.try(self.tp:check("3.."))
+ self.try(self.tp:source(src, step))
+ self.try(self.tp:send("\r\n.\r\n"))
+ return self.try(self.tp:check("2.."))
+end
+
+function metat.__index:quit()
+ self.try(self.tp:command("QUIT"))
+ return self.try(self.tp:check("2.."))
+end
+
+function metat.__index:close()
+ return self.tp:close()
+end
+
+function metat.__index:login(user, password)
+ self.try(self.tp:command("AUTH", "LOGIN"))
+ self.try(self.tp:check("3.."))
+ self.try(self.tp:command(mime.b64(user)))
+ self.try(self.tp:check("3.."))
+ self.try(self.tp:command(mime.b64(password)))
+ return self.try(self.tp:check("2.."))
+end
+
+function metat.__index:plain(user, password)
+ local auth = "PLAIN " .. mime.b64("\0" .. user .. "\0" .. password)
+ self.try(self.tp:command("AUTH", auth))
+ return self.try(self.tp:check("2.."))
+end
+
+function metat.__index:auth(user, password, ext)
+ if not user or not password then return 1 end
+ if string.find(ext, "AUTH[^\n]+LOGIN") then
+ return self:login(user, password)
+ elseif string.find(ext, "AUTH[^\n]+PLAIN") then
+ return self:plain(user, password)
+ else
+ self.try(nil, "authentication not supported")
+ end
+end
+
+-- send message or throw an exception
+function metat.__index:send(mailt)
+ self:mail(mailt.from)
+ if base.type(mailt.rcpt) == "table" then
+ for i,v in base.ipairs(mailt.rcpt) do
+ self:rcpt(v)
+ end
+ else
+ self:rcpt(mailt.rcpt)
+ end
+ self:data(ltn12.source.chain(mailt.source, mime.stuff()), mailt.step)
+end
+
+function open(server, port, create)
+ local tp = socket.try(tp.connect(server or SERVER, port or PORT,
+ TIMEOUT, create))
+ local s = base.setmetatable({tp = tp}, metat)
+ -- make sure tp is closed if we get an exception
+ s.try = socket.newtry(function()
+ s:close()
+ end)
+ return s
+end
+
+-- convert headers to lowercase
+local function lower_headers(headers)
+ local lower = {}
+ for i,v in base.pairs(headers or lower) do
+ lower[string.lower(i)] = v
+ end
+ return lower
+end
+
+---------------------------------------------------------------------------
+-- Multipart message source
+-----------------------------------------------------------------------------
+-- returns a hopefully unique mime boundary
+local seqno = 0
+local function newboundary()
+ seqno = seqno + 1
+ return string.format('%s%05d==%05u', os.date('%d%m%Y%H%M%S'),
+ math.random(0, 99999), seqno)
+end
+
+-- send_message forward declaration
+local send_message
+
+-- yield the headers all at once, it's faster
+local function send_headers(headers)
+ local h = "\r\n"
+ for i,v in base.pairs(headers) do
+ h = i .. ': ' .. v .. "\r\n" .. h
+ end
+ coroutine.yield(h)
+end
+
+-- yield multipart message body from a multipart message table
+local function send_multipart(mesgt)
+ -- make sure we have our boundary and send headers
+ local bd = newboundary()
+ local headers = lower_headers(mesgt.headers or {})
+ headers['content-type'] = headers['content-type'] or 'multipart/mixed'
+ headers['content-type'] = headers['content-type'] ..
+ '; boundary="' .. bd .. '"'
+ send_headers(headers)
+ -- send preamble
+ if mesgt.body.preamble then
+ coroutine.yield(mesgt.body.preamble)
+ coroutine.yield("\r\n")
+ end
+ -- send each part separated by a boundary
+ for i, m in base.ipairs(mesgt.body) do
+ coroutine.yield("\r\n--" .. bd .. "\r\n")
+ send_message(m)
+ end
+ -- send last boundary
+ coroutine.yield("\r\n--" .. bd .. "--\r\n\r\n")
+ -- send epilogue
+ if mesgt.body.epilogue then
+ coroutine.yield(mesgt.body.epilogue)
+ coroutine.yield("\r\n")
+ end
+end
+
+-- yield message body from a source
+local function send_source(mesgt)
+ -- make sure we have a content-type
+ local headers = lower_headers(mesgt.headers or {})
+ headers['content-type'] = headers['content-type'] or
+ 'text/plain; charset="iso-8859-1"'
+ send_headers(headers)
+ -- send body from source
+ while true do
+ local chunk, err = mesgt.body()
+ if err then coroutine.yield(nil, err)
+ elseif chunk then coroutine.yield(chunk)
+ else break end
+ end
+end
+
+-- yield message body from a string
+local function send_string(mesgt)
+ -- make sure we have a content-type
+ local headers = lower_headers(mesgt.headers or {})
+ headers['content-type'] = headers['content-type'] or
+ 'text/plain; charset="iso-8859-1"'
+ send_headers(headers)
+ -- send body from string
+ coroutine.yield(mesgt.body)
+end
+
+-- message source
+function send_message(mesgt)
+ if base.type(mesgt.body) == "table" then send_multipart(mesgt)
+ elseif base.type(mesgt.body) == "function" then send_source(mesgt)
+ else send_string(mesgt) end
+end
+
+-- set defaul headers
+local function adjust_headers(mesgt)
+ local lower = lower_headers(mesgt.headers)
+ lower["date"] = lower["date"] or
+ os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or ZONE)
+ lower["x-mailer"] = lower["x-mailer"] or socket._VERSION
+ -- this can't be overriden
+ lower["mime-version"] = "1.0"
+ return lower
+end
+
+function message(mesgt)
+ mesgt.headers = adjust_headers(mesgt)
+ -- create and return message source
+ local co = coroutine.create(function() send_message(mesgt) end)
+ return function()
+ local ret, a, b = coroutine.resume(co)
+ if ret then return a, b
+ else return nil, a end
+ end
+end
+
+---------------------------------------------------------------------------
+-- High level SMTP API
+-----------------------------------------------------------------------------
+send = socket.protect(function(mailt)
+ local s = open(mailt.server, mailt.port, mailt.create)
+ local ext = s:greet(mailt.domain)
+ s:auth(mailt.user, mailt.password, ext)
+ s:send(mailt)
+ s:quit()
+ return s:close()
+end)
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/smtp_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/smtp_lua.c
new file mode 100644
index 00000000000..8743ff557eb
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/smtp_lua.c
@@ -0,0 +1,412 @@
+/*
+ * This file is auto-generated by "./lua2c smtp.lua smtp_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_smtp_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 83, 77, 84, 80, 32, 99,108,105,101,110,116, 32,115,117,112,112,111,114,116,
+ 32,102,111,114, 32,116,104,101, 32, 76,117, 97, 32,108, 97,110,103,117, 97,103,
+101, 46, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116, 32,116,111,111,108,
+107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101,103,
+111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36,
+ 73,100, 58, 32,115,109,116,112, 46,108,117, 97, 44,118, 32, 49, 46, 52, 54, 32,
+ 50, 48, 48, 55, 47, 48, 51, 47, 49, 50, 32, 48, 52, 58, 48, 56, 58, 52, 48, 32,
+100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114,101, 32,
+109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, 32,100,101,
+112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,115,101, 32,
+ 61, 32, 95, 71, 10,108,111, 99, 97,108, 32, 99,111,114,111,117,116,105,110,101,
+ 32, 61, 32,114,101,113,117,105,114,101, 40, 34, 99,111,114,111,117,116,105,110,
+101, 34, 41, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32, 61, 32,114,
+101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,108,111, 99,
+ 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,109,
+ 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,111,115, 32, 61, 32,114,101,113,
+117,105,114,101, 40, 34,111,115, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99,
+107,101,116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,
+116, 34, 41, 10,108,111, 99, 97,108, 32,116,112, 32, 61, 32,114,101,113,117,105,
+114,101, 40, 34,115,111, 99,107,101,116, 46,116,112, 34, 41, 10,108,111, 99, 97,
+108, 32,108,116,110, 49, 50, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,108,
+116,110, 49, 50, 34, 41, 10,108,111, 99, 97,108, 32,109,105,109,101, 32, 61, 32,
+114,101,113,117,105,114,101, 40, 34,109,105,109,101, 34, 41, 10,109,111,100,117,
+108,101, 40, 34,115,111, 99,107,101,116, 46,115,109,116,112, 34, 41, 10, 10, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,
+ 80,114,111,103,114, 97,109, 32, 99,111,110,115,116, 97,110,116,115, 10, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,116,
+105,109,101,111,117,116, 32,102,111,114, 32, 99,111,110,110,101, 99,116,105,111,
+110, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 45, 45, 32,100,101,
+102, 97,117,108,116, 32,115,101,114,118,101,114, 32,117,115,101,100, 32,116,111,
+ 32,115,101,110,100, 32,101, 45,109, 97,105,108,115, 10, 83, 69, 82, 86, 69, 82,
+ 32, 61, 32, 34,108,111, 99, 97,108,104,111,115,116, 34, 10, 45, 45, 32,100,101,
+102, 97,117,108,116, 32,112,111,114,116, 10, 80, 79, 82, 84, 32, 61, 32, 50, 53,
+ 10, 45, 45, 32,100,111,109, 97,105,110, 32,117,115,101,100, 32,105,110, 32, 72,
+ 69, 76, 79, 32, 99,111,109,109, 97,110,100, 32, 97,110,100, 32,100,101,102, 97,
+117,108,116, 32,115,101,110,100,109, 97,105,108, 10, 45, 45, 32, 73,102, 32,119,
+101, 32, 97,114,101, 32,117,110,100,101,114, 32, 97, 32, 67, 71, 73, 44, 32,116,
+114,121, 32,116,111, 32,103,101,116, 32,102,114,111,109, 32,101,110,118,105,114,
+111,110,109,101,110,116, 10, 68, 79, 77, 65, 73, 78, 32, 61, 32,111,115, 46,103,
+101,116,101,110,118, 40, 34, 83, 69, 82, 86, 69, 82, 95, 78, 65, 77, 69, 34, 41,
+ 32,111,114, 32, 34,108,111, 99, 97,108,104,111,115,116, 34, 10, 45, 45, 32,100,
+101,102, 97,117,108,116, 32,116,105,109,101, 32,122,111,110,101, 32, 40,109,101,
+ 97,110,115, 32,119,101, 32,100,111,110, 39,116, 32,107,110,111,119, 41, 10, 90,
+ 79, 78, 69, 32, 61, 32, 34, 45, 48, 48, 48, 48, 34, 10, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 76,111,119, 32,108,101,
+118,101,108, 32, 83, 77, 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32,109,101,116,
+ 97,116, 32, 61, 32,123, 32, 95, 95,105,110,100,101,120, 32, 61, 32,123,125, 32,
+125, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,
+105,110,100,101,120, 58,103,114,101,101,116, 40,100,111,109, 97,105,110, 41, 10,
+ 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112,
+ 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,115,
+101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109,
+ 97,110,100, 40, 34, 69, 72, 76, 79, 34, 44, 32,100,111,109, 97,105,110, 32,111,
+114, 32, 68, 79, 77, 65, 73, 78, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,
+110, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 49, 44, 32,115,101,108,
+102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40,
+ 34, 50, 46, 46, 34, 41, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,
+111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,109, 97,105,
+108, 40,102,114,111,109, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121,
+ 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 77, 65,
+ 73, 76, 34, 44, 32, 34, 70, 82, 79, 77, 58, 34, 32, 46, 46, 32,102,114,111,109,
+ 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116,
+114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46,
+ 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,
+101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,114, 99,112,116, 40,116,111,
+ 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,
+116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 82, 67, 80, 84, 34, 44, 32, 34,
+ 84, 79, 58, 34, 32, 46, 46, 32,116,111, 41, 41, 10, 32, 32, 32, 32,114,101,116,
+117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112,
+ 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10,
+102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,
+101,120, 58,100, 97,116, 97, 40,115,114, 99, 44, 32,115,116,101,112, 41, 10, 32,
+ 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,
+ 99,111,109,109, 97,110,100, 40, 34, 68, 65, 84, 65, 34, 41, 41, 10, 32, 32, 32,
+ 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,
+101, 99,107, 40, 34, 51, 46, 46, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102,
+ 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,115,111,117,114, 99,101, 40,
+115,114, 99, 44, 32,115,116,101,112, 41, 41, 10, 32, 32, 32, 32,115,101,108,102,
+ 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,115,101,110,100, 40, 34, 92,
+114, 92,110, 46, 92,114, 92,110, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,
+ 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10,102,
+117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,
+120, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,
+121, 40,115,101,108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 81,
+ 85, 73, 84, 34, 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,
+108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107,
+ 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,
+111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,108,111,
+115,101, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102,
+ 46,116,112, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 10, 10,102,117,110,
+ 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,
+108,111,103,105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100,
+ 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,
+116,112, 58, 99,111,109,109, 97,110,100, 40, 34, 65, 85, 84, 72, 34, 44, 32, 34,
+ 76, 79, 71, 73, 78, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,
+121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 51, 46, 46,
+ 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,
+102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40,109,105,109,101, 46, 98, 54,
+ 52, 40,117,115,101,114, 41, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,
+114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 51, 46,
+ 46, 34, 41, 41, 10, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,
+108,102, 46,116,112, 58, 99,111,109,109, 97,110,100, 40,109,105,109,101, 46, 98,
+ 54, 52, 40,112, 97,115,115,119,111,114,100, 41, 41, 41, 10, 32, 32, 32, 32,114,
+101,116,117,114,110, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,
+116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46, 46, 34, 41, 41, 10,101,110,100,
+ 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,
+110,100,101,120, 58,112,108, 97,105,110, 40,117,115,101,114, 44, 32,112, 97,115,
+115,119,111,114,100, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 97,117,116,
+104, 32, 61, 32, 34, 80, 76, 65, 73, 78, 32, 34, 32, 46, 46, 32,109,105,109,101,
+ 46, 98, 54, 52, 40, 34, 92, 48, 34, 32, 46, 46, 32,117,115,101,114, 32, 46, 46,
+ 32, 34, 92, 48, 34, 32, 46, 46, 32,112, 97,115,115,119,111,114,100, 41, 10, 32,
+ 32, 32, 32,115,101,108,102, 46,116,114,121, 40,115,101,108,102, 46,116,112, 58,
+ 99,111,109,109, 97,110,100, 40, 34, 65, 85, 84, 72, 34, 44, 32, 97,117,116,104,
+ 41, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,116,
+114,121, 40,115,101,108,102, 46,116,112, 58, 99,104,101, 99,107, 40, 34, 50, 46,
+ 46, 34, 41, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,
+101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 97,117,116,104, 40,117,115,
+101,114, 44, 32,112, 97,115,115,119,111,114,100, 44, 32,101,120,116, 41, 10, 32,
+ 32, 32, 32,105,102, 32,110,111,116, 32,117,115,101,114, 32,111,114, 32,110,111,
+116, 32,112, 97,115,115,119,111,114,100, 32,116,104,101,110, 32,114,101,116,117,
+114,110, 32, 49, 32,101,110,100, 10, 32, 32, 32, 32,105,102, 32,115,116,114,105,
+110,103, 46,102,105,110,100, 40,101,120,116, 44, 32, 34, 65, 85, 84, 72, 91, 94,
+ 92,110, 93, 43, 76, 79, 71, 73, 78, 34, 41, 32,116,104,101,110, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 58,108,111,103,
+105,110, 40,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, 41, 10, 32,
+ 32, 32, 32,101,108,115,101,105,102, 32,115,116,114,105,110,103, 46,102,105,110,
+100, 40,101,120,116, 44, 32, 34, 65, 85, 84, 72, 91, 94, 92,110, 93, 43, 80, 76,
+ 65, 73, 78, 34, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,
+101,116,117,114,110, 32,115,101,108,102, 58,112,108, 97,105,110, 40,117,115,101,
+114, 44, 32,112, 97,115,115,119,111,114,100, 41, 10, 32, 32, 32, 32,101,108,115,
+101, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 46,116,114,121, 40,110,
+105,108, 44, 32, 34, 97,117,116,104,101,110,116,105, 99, 97,116,105,111,110, 32,
+110,111,116, 32,115,117,112,112,111,114,116,101,100, 34, 41, 10, 32, 32, 32, 32,
+101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,115,101,110,100, 32,109,101,115,
+115, 97,103,101, 32,111,114, 32,116,104,114,111,119, 32, 97,110, 32,101,120, 99,
+101,112,116,105,111,110, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,
+116, 46, 95, 95,105,110,100,101,120, 58,115,101,110,100, 40,109, 97,105,108,116,
+ 41, 10, 32, 32, 32, 32,115,101,108,102, 58,109, 97,105,108, 40,109, 97,105,108,
+116, 46,102,114,111,109, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,
+116,121,112,101, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 32, 61, 61, 32,
+ 34,116, 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46,105,112, 97,
+105,114,115, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 32,100,111, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 58,114, 99,112,116,
+ 40,118, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,108,102, 58,114, 99,
+112,116, 40,109, 97,105,108,116, 46,114, 99,112,116, 41, 10, 32, 32, 32, 32,101,
+110,100, 10, 32, 32, 32, 32,115,101,108,102, 58,100, 97,116, 97, 40,108,116,110,
+ 49, 50, 46,115,111,117,114, 99,101, 46, 99,104, 97,105,110, 40,109, 97,105,108,
+116, 46,115,111,117,114, 99,101, 44, 32,109,105,109,101, 46,115,116,117,102,102,
+ 40, 41, 41, 44, 32,109, 97,105,108,116, 46,115,116,101,112, 41, 10,101,110,100,
+ 10, 10,102,117,110, 99,116,105,111,110, 32,111,112,101,110, 40,115,101,114,118,
+101,114, 44, 32,112,111,114,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32,116,112, 32, 61, 32,115,111, 99,107,101,116, 46,
+116,114,121, 40,116,112, 46, 99,111,110,110,101, 99,116, 40,115,101,114,118,101,
+114, 32,111,114, 32, 83, 69, 82, 86, 69, 82, 44, 32,112,111,114,116, 32,111,114,
+ 32, 80, 79, 82, 84, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 84, 73, 77, 69, 79,
+ 85, 84, 44, 32, 99,114,101, 97,116,101, 41, 41, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,115, 32, 61, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116,
+ 97, 98,108,101, 40,123,116,112, 32, 61, 32,116,112,125, 44, 32,109,101,116, 97,
+116, 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32,
+116,112, 32,105,115, 32, 99,108,111,115,101,100, 32,105,102, 32,119,101, 32,103,
+101,116, 32, 97,110, 32,101,120, 99,101,112,116,105,111,110, 10, 32, 32, 32, 32,
+115, 46,116,114,121, 32, 61, 32,115,111, 99,107,101,116, 46,110,101,119,116,114,
+121, 40,102,117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,115, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32,115, 10,101,110,100, 10, 10, 45, 45,
+ 32, 99,111,110,118,101,114,116, 32,104,101, 97,100,101,114,115, 32,116,111, 32,
+108,111,119,101,114, 99, 97,115,101, 10,108,111, 99, 97,108, 32,102,117,110, 99,
+116,105,111,110, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,104,
+101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,108,111,
+119,101,114, 32, 61, 32,123,125, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118,
+ 32,105,110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101,
+114,115, 32,111,114, 32,108,111,119,101,114, 41, 32,100,111, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,108,111,119,101,114, 91,115,116,114,105,110,103, 46,108,111,119,
+101,114, 40,105, 41, 93, 32, 61, 32,118, 10, 32, 32, 32, 32,101,110,100, 10, 32,
+ 32, 32, 32,114,101,116,117,114,110, 32,108,111,119,101,114, 10,101,110,100, 10,
+ 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,
+ 77,117,108,116,105,112, 97,114,116, 32,109,101,115,115, 97,103,101, 32,115,111,
+117,114, 99,101, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 10, 45, 45, 32,114,101,116,117,114,110,115, 32, 97, 32,104,111,112,101,
+102,117,108,108,121, 32,117,110,105,113,117,101, 32,109,105,109,101, 32, 98,111,
+117,110,100, 97,114,121, 10,108,111, 99, 97,108, 32,115,101,113,110,111, 32, 61,
+ 32, 48, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,110,101,
+119, 98,111,117,110,100, 97,114,121, 40, 41, 10, 32, 32, 32, 32,115,101,113,110,
+111, 32, 61, 32,115,101,113,110,111, 32, 43, 32, 49, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 39,
+ 37,115, 37, 48, 53,100, 61, 61, 37, 48, 53,117, 39, 44, 32,111,115, 46,100, 97,
+116,101, 40, 39, 37,100, 37,109, 37, 89, 37, 72, 37, 77, 37, 83, 39, 41, 44, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32,109, 97,116,104, 46,114, 97,110,100,111,109, 40,
+ 48, 44, 32, 57, 57, 57, 57, 57, 41, 44, 32,115,101,113,110,111, 41, 10,101,110,
+100, 10, 10, 45, 45, 32,115,101,110,100, 95,109,101,115,115, 97,103,101, 32,102,
+111,114,119, 97,114,100, 32,100,101, 99,108, 97,114, 97,116,105,111,110, 10,108,
+111, 99, 97,108, 32,115,101,110,100, 95,109,101,115,115, 97,103,101, 10, 10, 45,
+ 45, 32,121,105,101,108,100, 32,116,104,101, 32,104,101, 97,100,101,114,115, 32,
+ 97,108,108, 32, 97,116, 32,111,110, 99,101, 44, 32,105,116, 39,115, 32,102, 97,
+115,116,101,114, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,
+115,101,110,100, 95,104,101, 97,100,101,114,115, 40,104,101, 97,100,101,114,115,
+ 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104, 32, 61, 32, 34, 92,114, 92,
+110, 34, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,
+115,101, 46,112, 97,105,114,115, 40,104,101, 97,100,101,114,115, 41, 32,100,111,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,104, 32, 61, 32,105, 32, 46, 46, 32, 39, 58,
+ 32, 39, 32, 46, 46, 32,118, 32, 46, 46, 32, 34, 92,114, 92,110, 34, 32, 46, 46,
+ 32,104, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 99,111,114,111,117,
+116,105,110,101, 46,121,105,101,108,100, 40,104, 41, 10,101,110,100, 10, 10, 45,
+ 45, 32,121,105,101,108,100, 32,109,117,108,116,105,112, 97,114,116, 32,109,101,
+115,115, 97,103,101, 32, 98,111,100,121, 32,102,114,111,109, 32, 97, 32,109,117,
+108,116,105,112, 97,114,116, 32,109,101,115,115, 97,103,101, 32,116, 97, 98,108,
+101, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115,101,110,
+100, 95,109,117,108,116,105,112, 97,114,116, 40,109,101,115,103,116, 41, 10, 32,
+ 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32,119,101, 32,104,
+ 97,118,101, 32,111,117,114, 32, 98,111,117,110,100, 97,114,121, 32, 97,110,100,
+ 32,115,101,110,100, 32,104,101, 97,100,101,114,115, 10, 32, 32, 32, 32,108,111,
+ 99, 97,108, 32, 98,100, 32, 61, 32,110,101,119, 98,111,117,110,100, 97,114,121,
+ 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115,
+ 32, 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,109,101,115,
+103,116, 46,104,101, 97,100,101,114,115, 32,111,114, 32,123,125, 41, 10, 32, 32,
+ 32, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,
+121,112,101, 39, 93, 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,
+116,101,110,116, 45,116,121,112,101, 39, 93, 32,111,114, 32, 39,109,117,108,116,
+105,112, 97,114,116, 47,109,105,120,101,100, 39, 10, 32, 32, 32, 32,104,101, 97,
+100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, 93,
+ 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,
+116,121,112,101, 39, 93, 32, 46, 46, 10, 32, 32, 32, 32, 32, 32, 32, 32, 39, 59,
+ 32, 98,111,117,110,100, 97,114,121, 61, 34, 39, 32, 46, 46, 32, 32, 98,100, 32,
+ 46, 46, 32, 39, 34, 39, 10, 32, 32, 32, 32,115,101,110,100, 95,104,101, 97,100,
+101,114,115, 40,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 45, 45, 32,
+115,101,110,100, 32,112,114,101, 97,109, 98,108,101, 10, 32, 32, 32, 32,105,102,
+ 32,109,101,115,103,116, 46, 98,111,100,121, 46,112,114,101, 97,109, 98,108,101,
+ 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116,
+105,110,101, 46,121,105,101,108,100, 40,109,101,115,103,116, 46, 98,111,100,121,
+ 46,112,114,101, 97,109, 98,108,101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99,
+111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40, 34, 92,114, 92,110,
+ 34, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,115,101,
+110,100, 32,101, 97, 99,104, 32,112, 97,114,116, 32,115,101,112, 97,114, 97,116,
+101,100, 32, 98,121, 32, 97, 32, 98,111,117,110,100, 97,114,121, 10, 32, 32, 32,
+ 32,102,111,114, 32,105, 44, 32,109, 32,105,110, 32, 98, 97,115,101, 46,105,112,
+ 97,105,114,115, 40,109,101,115,103,116, 46, 98,111,100,121, 41, 32,100,111, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116,105,110,101, 46,121,105,
+101,108,100, 40, 34, 92,114, 92,110, 45, 45, 34, 32, 46, 46, 32, 98,100, 32, 46,
+ 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,115,101,
+110,100, 95,109,101,115,115, 97,103,101, 40,109, 41, 10, 32, 32, 32, 32,101,110,
+100, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,108, 97,115,116, 32, 98,
+111,117,110,100, 97,114,121, 10, 32, 32, 32, 32, 99,111,114,111,117,116,105,110,
+101, 46,121,105,101,108,100, 40, 34, 92,114, 92,110, 45, 45, 34, 32, 46, 46, 32,
+ 98,100, 32, 46, 46, 32, 34, 45, 45, 92,114, 92,110, 92,114, 92,110, 34, 41, 10,
+ 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32,101,112,105,108,111,103,117,101,
+ 10, 32, 32, 32, 32,105,102, 32,109,101,115,103,116, 46, 98,111,100,121, 46,101,
+112,105,108,111,103,117,101, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40,109,101,115,
+103,116, 46, 98,111,100,121, 46,101,112,105,108,111,103,117,101, 41, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108,
+100, 40, 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32,101,110,100, 10,101,110,
+100, 10, 10, 45, 45, 32,121,105,101,108,100, 32,109,101,115,115, 97,103,101, 32,
+ 98,111,100,121, 32,102,114,111,109, 32, 97, 32,115,111,117,114, 99,101, 10,108,
+111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,115,101,110,100, 95,115,
+111,117,114, 99,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,
+109, 97,107,101, 32,115,117,114,101, 32,119,101, 32,104, 97,118,101, 32, 97, 32,
+ 99,111,110,116,101,110,116, 45,116,121,112,101, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,104,101, 97,100,101,114,115, 32, 61, 32,108,111,119,101,114, 95,104,
+101, 97,100,101,114,115, 40,109,101,115,103,116, 46,104,101, 97,100,101,114,115,
+ 32,111,114, 32,123,125, 41, 10, 32, 32, 32, 32,104,101, 97,100,101,114,115, 91,
+ 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39, 93, 32, 61, 32,104,101,
+ 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121,112,101, 39,
+ 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32, 32, 32, 39,116,101,120,116, 47,112,
+108, 97,105,110, 59, 32, 99,104, 97,114,115,101,116, 61, 34,105,115,111, 45, 56,
+ 56, 53, 57, 45, 49, 34, 39, 10, 32, 32, 32, 32,115,101,110,100, 95,104,101, 97,
+100,101,114,115, 40,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32, 32, 45, 45,
+ 32,115,101,110,100, 32, 98,111,100,121, 32,102,114,111,109, 32,115,111,117,114,
+ 99,101, 10, 32, 32, 32, 32,119,104,105,108,101, 32,116,114,117,101, 32,100,111,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107,
+ 44, 32,101,114,114, 32, 61, 32,109,101,115,103,116, 46, 98,111,100,121, 40, 41,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114, 32,116,104,101,110,
+ 32, 99,111,114,111,117,116,105,110,101, 46,121,105,101,108,100, 40,110,105,108,
+ 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105,
+102, 32, 99,104,117,110,107, 32,116,104,101,110, 32, 99,111,114,111,117,116,105,
+110,101, 46,121,105,101,108,100, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,101,108,115,101, 32, 98,114,101, 97,107, 32,101,110,100, 10, 32,
+ 32, 32, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,121,105,101,108,100,
+ 32,109,101,115,115, 97,103,101, 32, 98,111,100,121, 32,102,114,111,109, 32, 97,
+ 32,115,116,114,105,110,103, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,
+111,110, 32,115,101,110,100, 95,115,116,114,105,110,103, 40,109,101,115,103,116,
+ 41, 10, 32, 32, 32, 32, 45, 45, 32,109, 97,107,101, 32,115,117,114,101, 32,119,
+101, 32,104, 97,118,101, 32, 97, 32, 99,111,110,116,101,110,116, 45,116,121,112,
+101, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,104,101, 97,100,101,114,115, 32,
+ 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,115, 40,109,101,115,103,
+116, 46,104,101, 97,100,101,114,115, 32,111,114, 32,123,125, 41, 10, 32, 32, 32,
+ 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,101,110,116, 45,116,121,
+112,101, 39, 93, 32, 61, 32,104,101, 97,100,101,114,115, 91, 39, 99,111,110,116,
+101,110,116, 45,116,121,112,101, 39, 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 39,116,101,120,116, 47,112,108, 97,105,110, 59, 32, 99,104, 97,114,115,
+101,116, 61, 34,105,115,111, 45, 56, 56, 53, 57, 45, 49, 34, 39, 10, 32, 32, 32,
+ 32,115,101,110,100, 95,104,101, 97,100,101,114,115, 40,104,101, 97,100,101,114,
+115, 41, 10, 32, 32, 32, 32, 45, 45, 32,115,101,110,100, 32, 98,111,100,121, 32,
+102,114,111,109, 32,115,116,114,105,110,103, 10, 32, 32, 32, 32, 99,111,114,111,
+117,116,105,110,101, 46,121,105,101,108,100, 40,109,101,115,103,116, 46, 98,111,
+100,121, 41, 10,101,110,100, 10, 10, 45, 45, 32,109,101,115,115, 97,103,101, 32,
+115,111,117,114, 99,101, 10,102,117,110, 99,116,105,111,110, 32,115,101,110,100,
+ 95,109,101,115,115, 97,103,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,
+105,102, 32, 98, 97,115,101, 46,116,121,112,101, 40,109,101,115,103,116, 46, 98,
+111,100,121, 41, 32, 61, 61, 32, 34,116, 97, 98,108,101, 34, 32,116,104,101,110,
+ 32,115,101,110,100, 95,109,117,108,116,105,112, 97,114,116, 40,109,101,115,103,
+116, 41, 10, 32, 32, 32, 32,101,108,115,101,105,102, 32, 98, 97,115,101, 46,116,
+121,112,101, 40,109,101,115,103,116, 46, 98,111,100,121, 41, 32, 61, 61, 32, 34,
+102,117,110, 99,116,105,111,110, 34, 32,116,104,101,110, 32,115,101,110,100, 95,
+115,111,117,114, 99,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,101,108,
+115,101, 32,115,101,110,100, 95,115,116,114,105,110,103, 40,109,101,115,103,116,
+ 41, 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 32,115,101,116, 32,100,101,
+102, 97,117,108, 32,104,101, 97,100,101,114,115, 10,108,111, 99, 97,108, 32,102,
+117,110, 99,116,105,111,110, 32, 97,100,106,117,115,116, 95,104,101, 97,100,101,
+114,115, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,
+108,111,119,101,114, 32, 61, 32,108,111,119,101,114, 95,104,101, 97,100,101,114,
+115, 40,109,101,115,103,116, 46,104,101, 97,100,101,114,115, 41, 10, 32, 32, 32,
+ 32,108,111,119,101,114, 91, 34,100, 97,116,101, 34, 93, 32, 61, 32,108,111,119,
+101,114, 91, 34,100, 97,116,101, 34, 93, 32,111,114, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,111,115, 46,100, 97,116,101, 40, 34, 33, 37, 97, 44, 32, 37,100, 32, 37,
+ 98, 32, 37, 89, 32, 37, 72, 58, 37, 77, 58, 37, 83, 32, 34, 41, 32, 46, 46, 32,
+ 40,109,101,115,103,116, 46,122,111,110,101, 32,111,114, 32, 90, 79, 78, 69, 41,
+ 10, 32, 32, 32, 32,108,111,119,101,114, 91, 34,120, 45,109, 97,105,108,101,114,
+ 34, 93, 32, 61, 32,108,111,119,101,114, 91, 34,120, 45,109, 97,105,108,101,114,
+ 34, 93, 32,111,114, 32,115,111, 99,107,101,116, 46, 95, 86, 69, 82, 83, 73, 79,
+ 78, 10, 32, 32, 32, 32, 45, 45, 32,116,104,105,115, 32, 99, 97,110, 39,116, 32,
+ 98,101, 32,111,118,101,114,114,105,100,101,110, 10, 32, 32, 32, 32,108,111,119,
+101,114, 91, 34,109,105,109,101, 45,118,101,114,115,105,111,110, 34, 93, 32, 61,
+ 32, 34, 49, 46, 48, 34, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,108,111,
+119,101,114, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,
+115,115, 97,103,101, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32,109,101,115,
+103,116, 46,104,101, 97,100,101,114,115, 32, 61, 32, 97,100,106,117,115,116, 95,
+104,101, 97,100,101,114,115, 40,109,101,115,103,116, 41, 10, 32, 32, 32, 32, 45,
+ 45, 32, 99,114,101, 97,116,101, 32, 97,110,100, 32,114,101,116,117,114,110, 32,
+109,101,115,115, 97,103,101, 32,115,111,117,114, 99,101, 10, 32, 32, 32, 32,108,
+111, 99, 97,108, 32, 99,111, 32, 61, 32, 99,111,114,111,117,116,105,110,101, 46,
+ 99,114,101, 97,116,101, 40,102,117,110, 99,116,105,111,110, 40, 41, 32,115,101,
+110,100, 95,109,101,115,115, 97,103,101, 40,109,101,115,103,116, 41, 32,101,110,
+100, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,105,
+111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,
+101,116, 44, 32, 97, 44, 32, 98, 32, 61, 32, 99,111,114,111,117,116,105,110,101,
+ 46,114,101,115,117,109,101, 40, 99,111, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+105,102, 32,114,101,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 97,
+ 44, 32, 98, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,
+117,114,110, 32,110,105,108, 44, 32, 97, 32,101,110,100, 10, 32, 32, 32, 32,101,
+110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 10, 45, 45, 32, 72,105,103,104, 32,108,101,118,101,108, 32, 83, 77,
+ 84, 80, 32, 65, 80, 73, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 10,115,101,110,100, 32, 61, 32,115,111, 99,107,101,116, 46,112,
+114,111,116,101, 99,116, 40,102,117,110, 99,116,105,111,110, 40,109, 97,105,108,
+116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115, 32, 61, 32,111,112,101,
+110, 40,109, 97,105,108,116, 46,115,101,114,118,101,114, 44, 32,109, 97,105,108,
+116, 46,112,111,114,116, 44, 32,109, 97,105,108,116, 46, 99,114,101, 97,116,101,
+ 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,101,120,116, 32, 61, 32,115, 58,
+103,114,101,101,116, 40,109, 97,105,108,116, 46,100,111,109, 97,105,110, 41, 10,
+ 32, 32, 32, 32,115, 58, 97,117,116,104, 40,109, 97,105,108,116, 46,117,115,101,
+114, 44, 32,109, 97,105,108,116, 46,112, 97,115,115,119,111,114,100, 44, 32,101,
+120,116, 41, 10, 32, 32, 32, 32,115, 58,115,101,110,100, 40,109, 97,105,108,116,
+ 41, 10, 32, 32, 32, 32,115, 58,113,117,105,116, 40, 41, 10, 32, 32, 32, 32,114,
+101,116,117,114,110, 32,115, 58, 99,108,111,115,101, 40, 41, 10,101,110,100, 41,
+ 10,
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/socket.c b/Build/source/texk/web2c/luatexdir/luasocket/src/socket.c
new file mode 100644
index 00000000000..84165c70e5e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/socket.c
@@ -0,0 +1,5 @@
+#ifdef _WIN32
+#include "wsocket.c"
+#else
+#include "usocket.c"
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/socket.h b/Build/source/texk/web2c/luatexdir/luasocket/src/socket.h
new file mode 100644
index 00000000000..656c7f5d5ce
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/socket.h
@@ -0,0 +1,76 @@
+#ifndef SOCKET_H
+#define SOCKET_H
+/*=========================================================================*\
+* Socket compatibilization module
+* LuaSocket toolkit
+*
+* BSD Sockets and WinSock are similar, but there are a few irritating
+* differences. Also, not all *nix platforms behave the same. This module
+* (and the associated usocket.h and wsocket.h) factor these differences and
+* creates a interface compatible with the io.h module.
+*
+* RCS ID: $Id: socket.h,v 1.20 2005/11/20 07:20:23 diego Exp $
+\*=========================================================================*/
+#include "io.h"
+
+/*=========================================================================*\
+* Platform specific compatibilization
+\*=========================================================================*/
+#ifdef _WIN32
+#include "wsocket.h"
+#else
+#include "usocket.h"
+#endif
+
+/*=========================================================================*\
+* The connect and accept functions accept a timeout and their
+* implementations are somewhat complicated. We chose to move
+* the timeout control into this module for these functions in
+* order to simplify the modules that use them.
+\*=========================================================================*/
+#include "timeout.h"
+
+/* we are lazy... */
+typedef struct sockaddr SA;
+
+/*=========================================================================*\
+* Functions bellow implement a comfortable platform independent
+* interface to sockets
+\*=========================================================================*/
+int socket_open(void);
+int socket_close(void);
+void socket_destroy(p_socket ps);
+void socket_shutdown(p_socket ps, int how);
+int socket_sendto(p_socket ps, const char *data, size_t count,
+ size_t *sent, SA *addr, socklen_t addr_len, p_timeout tm);
+int socket_recvfrom(p_socket ps, char *data, size_t count,
+ size_t *got, SA *addr, socklen_t *addr_len, p_timeout tm);
+
+void socket_setnonblocking(p_socket ps);
+void socket_setblocking(p_socket ps);
+
+int socket_waitfd(p_socket ps, int sw, p_timeout tm);
+int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds,
+ p_timeout tm);
+
+int socket_connect(p_socket ps, SA *addr, socklen_t addr_len, p_timeout tm);
+int socket_create(p_socket ps, int domain, int type, int protocol);
+int socket_bind(p_socket ps, SA *addr, socklen_t addr_len);
+int socket_listen(p_socket ps, int backlog);
+int socket_accept(p_socket ps, p_socket pa, SA *addr,
+ socklen_t *addr_len, p_timeout tm);
+
+const char *socket_hoststrerror(int err);
+const char *socket_strerror(int err);
+
+/* these are perfect to use with the io abstraction module
+ and the buffered input module */
+int socket_send(p_socket ps, const char *data, size_t count,
+ size_t *sent, p_timeout tm);
+int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm);
+const char *socket_ioerror(p_socket ps, int err);
+
+int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp);
+int socket_gethostbyname(const char *addr, struct hostent **hp);
+
+#endif /* SOCKET_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/socket.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/socket.lua
new file mode 100644
index 00000000000..211adcd1d98
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/socket.lua
@@ -0,0 +1,133 @@
+-----------------------------------------------------------------------------
+-- LuaSocket helper module
+-- Author: Diego Nehab
+-- RCS ID: $Id: socket.lua,v 1.22 2005/11/22 08:33:29 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module and import dependencies
+-----------------------------------------------------------------------------
+local base = _G
+local string = require("string")
+local math = require("math")
+local socket = require("socket.core")
+module("socket")
+
+-----------------------------------------------------------------------------
+-- Exported auxiliar functions
+-----------------------------------------------------------------------------
+function connect(address, port, laddress, lport)
+ local sock, err = socket.tcp()
+ if not sock then return nil, err end
+ if laddress then
+ local res, err = sock:bind(laddress, lport, -1)
+ if not res then return nil, err end
+ end
+ local res, err = sock:connect(address, port)
+ if not res then return nil, err end
+ return sock
+end
+
+function bind(host, port, backlog)
+ local sock, err = socket.tcp()
+ if not sock then return nil, err end
+ sock:setoption("reuseaddr", true)
+ local res, err = sock:bind(host, port)
+ if not res then return nil, err end
+ res, err = sock:listen(backlog)
+ if not res then return nil, err end
+ return sock
+end
+
+try = newtry()
+
+function choose(table)
+ return function(name, opt1, opt2)
+ if base.type(name) ~= "string" then
+ name, opt1, opt2 = "default", name, opt1
+ end
+ local f = table[name or "nil"]
+ if not f then base.error("unknown key (".. base.tostring(name) ..")", 3)
+ else return f(opt1, opt2) end
+ end
+end
+
+-----------------------------------------------------------------------------
+-- Socket sources and sinks, conforming to LTN12
+-----------------------------------------------------------------------------
+-- create namespaces inside LuaSocket namespace
+sourcet = {}
+sinkt = {}
+
+BLOCKSIZE = 2048
+
+sinkt["close-when-done"] = function(sock)
+ return base.setmetatable({
+ getfd = function() return sock:getfd() end,
+ dirty = function() return sock:dirty() end
+ }, {
+ __call = function(self, chunk, err)
+ if not chunk then
+ sock:close()
+ return 1
+ else return sock:send(chunk) end
+ end
+ })
+end
+
+sinkt["keep-open"] = function(sock)
+ return base.setmetatable({
+ getfd = function() return sock:getfd() end,
+ dirty = function() return sock:dirty() end
+ }, {
+ __call = function(self, chunk, err)
+ if chunk then return sock:send(chunk)
+ else return 1 end
+ end
+ })
+end
+
+sinkt["default"] = sinkt["keep-open"]
+
+sink = choose(sinkt)
+
+sourcet["by-length"] = function(sock, length)
+ return base.setmetatable({
+ getfd = function() return sock:getfd() end,
+ dirty = function() return sock:dirty() end
+ }, {
+ __call = function()
+ if length <= 0 then return nil end
+ local size = math.min(socket.BLOCKSIZE, length)
+ local chunk, err = sock:receive(size)
+ if err then return nil, err end
+ length = length - string.len(chunk)
+ return chunk
+ end
+ })
+end
+
+sourcet["until-closed"] = function(sock)
+ local done
+ return base.setmetatable({
+ getfd = function() return sock:getfd() end,
+ dirty = function() return sock:dirty() end
+ }, {
+ __call = function()
+ if done then return nil end
+ local chunk, err, partial = sock:receive(socket.BLOCKSIZE)
+ if not err then return chunk
+ elseif err == "closed" then
+ sock:close()
+ done = 1
+ return partial
+ else return nil, err end
+ end
+ })
+end
+
+
+sourcet["default"] = sourcet["until-closed"]
+
+source = choose(sourcet)
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/socket_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/socket_lua.c
new file mode 100644
index 00000000000..4f3709e0d0e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/socket_lua.c
@@ -0,0 +1,217 @@
+/*
+ * This file is auto-generated by "./lua2c socket.lua socket_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_socket_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 76,117, 97, 83,111, 99,107,101,116, 32,104,101,108,112,101,114, 32,109,111,
+100,117,108,101, 10, 45, 45, 32, 65,117,116,104,111,114, 58, 32, 68,105,101,103,
+111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36,
+ 73,100, 58, 32,115,111, 99,107,101,116, 46,108,117, 97, 44,118, 32, 49, 46, 50,
+ 50, 32, 50, 48, 48, 53, 47, 49, 49, 47, 50, 50, 32, 48, 56, 58, 51, 51, 58, 50,
+ 57, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,114,
+101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116, 32,
+100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,115,
+101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103, 32,
+ 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41, 10,
+108,111, 99, 97,108, 32,109, 97,116,104, 32, 61, 32,114,101,113,117,105,114,101,
+ 40, 34,109, 97,116,104, 34, 41, 10,108,111, 99, 97,108, 32,115,111, 99,107,101,
+116, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,111, 99,107,101,116, 46,
+ 99,111,114,101, 34, 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101,
+116, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 10, 45, 45, 32, 69,120,112,111,114,116,101,100, 32, 97,117,120,105,108,
+105, 97,114, 32,102,117,110, 99,116,105,111,110,115, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110,
+ 32, 99,111,110,110,101, 99,116, 40, 97,100,100,114,101,115,115, 44, 32,112,111,
+114,116, 44, 32,108, 97,100,100,114,101,115,115, 44, 32,108,112,111,114,116, 41,
+ 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,111, 99,107, 44, 32,101,114,114,
+ 32, 61, 32,115,111, 99,107,101,116, 46,116, 99,112, 40, 41, 10, 32, 32, 32, 32,
+105,102, 32,110,111,116, 32,115,111, 99,107, 32,116,104,101,110, 32,114,101,116,
+117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32,
+ 32,105,102, 32,108, 97,100,100,114,101,115,115, 32,116,104,101,110, 10, 32, 32,
+ 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, 32,101,114,114,
+ 32, 61, 32,115,111, 99,107, 58, 98,105,110,100, 40,108, 97,100,100,114,101,115,
+115, 44, 32,108,112,111,114,116, 44, 32, 45, 49, 41, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32,105,102, 32,110,111,116, 32,114,101,115, 32,116,104,101,110, 32,114,101,
+116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32,
+ 32, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44,
+ 32,101,114,114, 32, 61, 32,115,111, 99,107, 58, 99,111,110,110,101, 99,116, 40,
+ 97,100,100,114,101,115,115, 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105,
+102, 32,110,111,116, 32,114,101,115, 32,116,104,101,110, 32,114,101,116,117,114,
+110, 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32,114,
+101,116,117,114,110, 32,115,111, 99,107, 10,101,110,100, 10, 10,102,117,110, 99,
+116,105,111,110, 32, 98,105,110,100, 40,104,111,115,116, 44, 32,112,111,114,116,
+ 44, 32, 98, 97, 99,107,108,111,103, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108,
+ 32,115,111, 99,107, 44, 32,101,114,114, 32, 61, 32,115,111, 99,107,101,116, 46,
+116, 99,112, 40, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,115,111, 99,
+107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,
+114,114, 32,101,110,100, 10, 32, 32, 32, 32,115,111, 99,107, 58,115,101,116,111,
+112,116,105,111,110, 40, 34,114,101,117,115,101, 97,100,100,114, 34, 44, 32,116,
+114,117,101, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,115, 44, 32,
+101,114,114, 32, 61, 32,115,111, 99,107, 58, 98,105,110,100, 40,104,111,115,116,
+ 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,
+101,115, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,
+101,114,114, 32,101,110,100, 10, 32, 32, 32, 32,114,101,115, 44, 32,101,114,114,
+ 32, 61, 32,115,111, 99,107, 58,108,105,115,116,101,110, 40, 98, 97, 99,107,108,
+111,103, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,115, 32,116,
+104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,
+101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,111, 99,107, 10,
+101,110,100, 10, 10,116,114,121, 32, 61, 32,110,101,119,116,114,121, 40, 41, 10,
+ 10,102,117,110, 99,116,105,111,110, 32, 99,104,111,111,115,101, 40,116, 97, 98,
+108,101, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,102,117,110, 99,116,
+105,111,110, 40,110, 97,109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50,
+ 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,116,121,
+112,101, 40,110, 97,109,101, 41, 32,126, 61, 32, 34,115,116,114,105,110,103, 34,
+ 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,110, 97,
+109,101, 44, 32,111,112,116, 49, 44, 32,111,112,116, 50, 32, 61, 32, 34,100,101,
+102, 97,117,108,116, 34, 44, 32,110, 97,109,101, 44, 32,111,112,116, 49, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,108,
+111, 99, 97,108, 32,102, 32, 61, 32,116, 97, 98,108,101, 91,110, 97,109,101, 32,
+111,114, 32, 34,110,105,108, 34, 93, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102,
+ 32,110,111,116, 32,102, 32,116,104,101,110, 32, 98, 97,115,101, 46,101,114,114,
+111,114, 40, 34,117,110,107,110,111,119,110, 32,107,101,121, 32, 40, 34, 46, 46,
+ 32, 98, 97,115,101, 46,116,111,115,116,114,105,110,103, 40,110, 97,109,101, 41,
+ 32, 46, 46, 34, 41, 34, 44, 32, 51, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,
+108,115,101, 32,114,101,116,117,114,110, 32,102, 40,111,112,116, 49, 44, 32,111,
+112,116, 50, 41, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 10,101,110,100,
+ 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,
+ 45, 45, 32, 83,111, 99,107,101,116, 32,115,111,117,114, 99,101,115, 32, 97,110,
+100, 32,115,105,110,107,115, 44, 32, 99,111,110,102,111,114,109,105,110,103, 32,
+116,111, 32, 76, 84, 78, 49, 50, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 99,114,101, 97,116,101, 32,110, 97,109,
+101,115,112, 97, 99,101,115, 32,105,110,115,105,100,101, 32, 76,117, 97, 83,111,
+ 99,107,101,116, 32,110, 97,109,101,115,112, 97, 99,101, 10,115,111,117,114, 99,
+101,116, 32, 61, 32,123,125, 10,115,105,110,107,116, 32, 61, 32,123,125, 10, 10,
+ 66, 76, 79, 67, 75, 83, 73, 90, 69, 32, 61, 32, 50, 48, 52, 56, 10, 10,115,105,
+110,107,116, 91, 34, 99,108,111,115,101, 45,119,104,101,110, 45,100,111,110,101,
+ 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,
+101,116, 97,116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,
+101,116,102,100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,
+116,117,114,110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,
+100, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,
+117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,
+107, 58,100,105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44,
+ 32,123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,
+102,117,110, 99,116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107,
+ 44, 32,101,114,114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,
+102, 32,110,111,116, 32, 99,104,117,110,107, 32,116,104,101,110, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,111, 99,107, 58, 99,108,
+111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32, 49, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,
+115,101,110,100, 40, 99,104,117,110,107, 41, 32,101,110,100, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110,100, 10, 10,
+115,105,110,107,116, 91, 34,107,101,101,112, 45,111,112,101,110, 34, 93, 32, 61,
+ 32,102,117,110, 99,116,105,111,110, 40,115,111, 99,107, 41, 10, 32, 32, 32, 32,
+114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116,
+ 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100,
+ 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110,
+ 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116,
+105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105,
+114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99,
+116,105,111,110, 40,115,101,108,102, 44, 32, 99,104,117,110,107, 44, 32,101,114,
+114, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 99,104,
+117,110,107, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,115,111, 99,107,
+ 58,115,101,110,100, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 49, 32,101,
+110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125,
+ 41, 10,101,110,100, 10, 10,115,105,110,107,116, 91, 34,100,101,102, 97,117,108,
+116, 34, 93, 32, 61, 32,115,105,110,107,116, 91, 34,107,101,101,112, 45,111,112,
+101,110, 34, 93, 10, 10,115,105,110,107, 32, 61, 32, 99,104,111,111,115,101, 40,
+115,105,110,107,116, 41, 10, 10,115,111,117,114, 99,101,116, 91, 34, 98,121, 45,
+108,101,110,103,116,104, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,
+115,111, 99,107, 44, 32,108,101,110,103,116,104, 41, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116, 97,116, 97, 98,
+108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,116,102,100, 32, 61,
+ 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,
+111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100, 44, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,110, 99,116,105,111,
+110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107, 58,100,105,114,116,
+121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,123, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,117,110, 99,116,105,
+111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,
+108,101,110,103,116,104, 32, 60, 61, 32, 48, 32,116,104,101,110, 32,114,101,116,
+117,114,110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32,108,111, 99, 97,108, 32,115,105,122,101, 32, 61, 32,109, 97,116,
+104, 46,109,105,110, 40,115,111, 99,107,101,116, 46, 66, 76, 79, 67, 75, 83, 73,
+ 90, 69, 44, 32,108,101,110,103,116,104, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,101,114,114,
+ 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,118,101, 40,115,105,122,101,
+ 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,101,114,114,
+ 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,
+114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,101,
+110,103,116,104, 32, 61, 32,108,101,110,103,116,104, 32, 45, 32,115,116,114,105,
+110,103, 46,108,101,110, 40, 99,104,117,110,107, 41, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,104,117,110,107, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,125, 41, 10,101,110,
+100, 10, 10,115,111,117,114, 99,101,116, 91, 34,117,110,116,105,108, 45, 99,108,
+111,115,101,100, 34, 93, 32, 61, 32,102,117,110, 99,116,105,111,110, 40,115,111,
+ 99,107, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,100,111,110,101, 10, 32,
+ 32, 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,
+116, 97,116, 97, 98,108,101, 40,123, 10, 32, 32, 32, 32, 32, 32, 32, 32,103,101,
+116,102,100, 32, 61, 32,102,117,110, 99,116,105,111,110, 40, 41, 32,114,101,116,
+117,114,110, 32,115,111, 99,107, 58,103,101,116,102,100, 40, 41, 32,101,110,100,
+ 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,100,105,114,116,121, 32, 61, 32,102,117,
+110, 99,116,105,111,110, 40, 41, 32,114,101,116,117,114,110, 32,115,111, 99,107,
+ 58,100,105,114,116,121, 40, 41, 32,101,110,100, 10, 32, 32, 32, 32,125, 44, 32,
+123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 95, 95, 99, 97,108,108, 32, 61, 32,102,
+117,110, 99,116,105,111,110, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,105,102, 32,100,111,110,101, 32,116,104,101,110, 32,114,101,116,117,114,
+110, 32,110,105,108, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32, 99,104,117,110,107, 44, 32,101,114,114, 44, 32,
+112, 97,114,116,105, 97,108, 32, 61, 32,115,111, 99,107, 58,114,101, 99,101,105,
+118,101, 40,115,111, 99,107,101,116, 46, 66, 76, 79, 67, 75, 83, 73, 90, 69, 41,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,
+101,114,114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 99,104,117,110,
+107, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101,105,102,
+ 32,101,114,114, 32, 61, 61, 32, 34, 99,108,111,115,101,100, 34, 32,116,104,101,
+110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115,111,
+ 99,107, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,100,111,110,101, 32, 61, 32, 49, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,112,
+ 97,114,116,105, 97,108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,
+108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,114,114, 32,
+101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,
+125, 41, 10,101,110,100, 10, 10, 10,115,111,117,114, 99,101,116, 91, 34,100,101,
+102, 97,117,108,116, 34, 93, 32, 61, 32,115,111,117,114, 99,101,116, 91, 34,117,
+110,116,105,108, 45, 99,108,111,115,101,100, 34, 93, 10, 10,115,111,117,114, 99,
+101, 32, 61, 32, 99,104,111,111,115,101, 40,115,111,117,114, 99,101,116, 41, 10,
+ 10,
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c b/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c
new file mode 100644
index 00000000000..6b8a79b4bc5
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c
@@ -0,0 +1,339 @@
+/*=========================================================================*\
+* TCP object
+* LuaSocket toolkit
+*
+* RCS ID: $Id: tcp.c,v 1.41 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "auxiliar.h"
+#include "socket.h"
+#include "inet.h"
+#include "options.h"
+#include "tcp.h"
+
+/*=========================================================================*\
+* Internal function prototypes
+\*=========================================================================*/
+static int global_create(lua_State *L);
+static int meth_connect(lua_State *L);
+static int meth_listen(lua_State *L);
+static int meth_bind(lua_State *L);
+static int meth_send(lua_State *L);
+static int meth_getstats(lua_State *L);
+static int meth_setstats(lua_State *L);
+static int meth_getsockname(lua_State *L);
+static int meth_getpeername(lua_State *L);
+static int meth_shutdown(lua_State *L);
+static int meth_receive(lua_State *L);
+static int meth_accept(lua_State *L);
+static int meth_close(lua_State *L);
+static int meth_setoption(lua_State *L);
+static int meth_settimeout(lua_State *L);
+static int meth_getfd(lua_State *L);
+static int meth_setfd(lua_State *L);
+static int meth_dirty(lua_State *L);
+
+/* tcp object methods */
+static luaL_reg tcp[] = {
+ {"__gc", meth_close},
+ {"__tostring", auxiliar_tostring},
+ {"accept", meth_accept},
+ {"bind", meth_bind},
+ {"close", meth_close},
+ {"connect", meth_connect},
+ {"dirty", meth_dirty},
+ {"getfd", meth_getfd},
+ {"getpeername", meth_getpeername},
+ {"getsockname", meth_getsockname},
+ {"getstats", meth_getstats},
+ {"setstats", meth_setstats},
+ {"listen", meth_listen},
+ {"receive", meth_receive},
+ {"send", meth_send},
+ {"setfd", meth_setfd},
+ {"setoption", meth_setoption},
+ {"setpeername", meth_connect},
+ {"setsockname", meth_bind},
+ {"settimeout", meth_settimeout},
+ {"shutdown", meth_shutdown},
+ {NULL, NULL}
+};
+
+/* socket option handlers */
+static t_opt opt[] = {
+ {"keepalive", opt_keepalive},
+ {"reuseaddr", opt_reuseaddr},
+ {"tcp-nodelay", opt_tcp_nodelay},
+ {"linger", opt_linger},
+ {NULL, NULL}
+};
+
+/* functions in library namespace */
+static luaL_reg func[] = {
+ {"tcp", global_create},
+ {NULL, NULL}
+};
+
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int tcp_open(lua_State *L)
+{
+ /* create classes */
+ auxiliar_newclass(L, "tcp{master}", tcp);
+ auxiliar_newclass(L, "tcp{client}", tcp);
+ auxiliar_newclass(L, "tcp{server}", tcp);
+ /* create class groups */
+ auxiliar_add2group(L, "tcp{master}", "tcp{any}");
+ auxiliar_add2group(L, "tcp{client}", "tcp{any}");
+ auxiliar_add2group(L, "tcp{server}", "tcp{any}");
+ /* define library functions */
+ luaL_openlib(L, NULL, func, 0);
+ return 0;
+}
+
+/*=========================================================================*\
+* Lua methods
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Just call buffered IO methods
+\*-------------------------------------------------------------------------*/
+static int meth_send(lua_State *L) {
+ p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
+ return buffer_meth_send(L, &tcp->buf);
+}
+
+static int meth_receive(lua_State *L) {
+ p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
+ return buffer_meth_receive(L, &tcp->buf);
+}
+
+static int meth_getstats(lua_State *L) {
+ p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
+ return buffer_meth_getstats(L, &tcp->buf);
+}
+
+static int meth_setstats(lua_State *L) {
+ p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
+ return buffer_meth_setstats(L, &tcp->buf);
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call option handler
+\*-------------------------------------------------------------------------*/
+static int meth_setoption(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ return opt_meth_setoption(L, opt, &tcp->sock);
+}
+
+/*-------------------------------------------------------------------------*\
+* Select support methods
+\*-------------------------------------------------------------------------*/
+static int meth_getfd(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ lua_pushnumber(L, (int) tcp->sock);
+ return 1;
+}
+
+/* this is very dangerous, but can be handy for those that are brave enough */
+static int meth_setfd(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ tcp->sock = (t_socket) luaL_checknumber(L, 2);
+ return 0;
+}
+
+static int meth_dirty(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ lua_pushboolean(L, !buffer_isempty(&tcp->buf));
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Waits for and returns a client object attempting connection to the
+* server object
+\*-------------------------------------------------------------------------*/
+static int meth_accept(lua_State *L)
+{
+ p_tcp server = (p_tcp) auxiliar_checkclass(L, "tcp{server}", 1);
+ p_timeout tm = timeout_markstart(&server->tm);
+ t_socket sock;
+ int err = socket_accept(&server->sock, &sock, NULL, NULL, tm);
+ /* if successful, push client socket */
+ if (err == IO_DONE) {
+ p_tcp clnt = (p_tcp) lua_newuserdata(L, sizeof(t_tcp));
+ auxiliar_setclass(L, "tcp{client}", -1);
+ /* initialize structure fields */
+ socket_setnonblocking(&sock);
+ clnt->sock = sock;
+ io_init(&clnt->io, (p_send) socket_send, (p_recv) socket_recv,
+ (p_error) socket_ioerror, &clnt->sock);
+ timeout_init(&clnt->tm, -1, -1);
+ buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
+ return 1;
+ } else {
+ lua_pushnil(L);
+ lua_pushstring(L, socket_strerror(err));
+ return 2;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Binds an object to an address
+\*-------------------------------------------------------------------------*/
+static int meth_bind(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{master}", 1);
+ const char *address = luaL_checkstring(L, 2);
+ unsigned short port = (unsigned short) luaL_checknumber(L, 3);
+ const char *err = inet_trybind(&tcp->sock, address, port);
+ if (err) {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Turns a master tcp object into a client object.
+\*-------------------------------------------------------------------------*/
+static int meth_connect(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ const char *address = luaL_checkstring(L, 2);
+ unsigned short port = (unsigned short) luaL_checknumber(L, 3);
+ p_timeout tm = timeout_markstart(&tcp->tm);
+ const char *err = inet_tryconnect(&tcp->sock, address, port, tm);
+ /* have to set the class even if it failed due to non-blocking connects */
+ auxiliar_setclass(L, "tcp{client}", 1);
+ if (err) {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+ /* turn master object into a client object */
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Closes socket used by object
+\*-------------------------------------------------------------------------*/
+static int meth_close(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ socket_destroy(&tcp->sock);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Puts the sockt in listen mode
+\*-------------------------------------------------------------------------*/
+static int meth_listen(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{master}", 1);
+ int backlog = (int) luaL_optnumber(L, 2, 32);
+ int err = socket_listen(&tcp->sock, backlog);
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, socket_strerror(err));
+ return 2;
+ }
+ /* turn master object into a server object */
+ auxiliar_setclass(L, "tcp{server}", 1);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Shuts the connection down partially
+\*-------------------------------------------------------------------------*/
+static int meth_shutdown(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
+ const char *how = luaL_optstring(L, 2, "both");
+ switch (how[0]) {
+ case 'b':
+ if (strcmp(how, "both")) goto error;
+ socket_shutdown(&tcp->sock, 2);
+ break;
+ case 's':
+ if (strcmp(how, "send")) goto error;
+ socket_shutdown(&tcp->sock, 1);
+ break;
+ case 'r':
+ if (strcmp(how, "receive")) goto error;
+ socket_shutdown(&tcp->sock, 0);
+ break;
+ }
+ lua_pushnumber(L, 1);
+ return 1;
+error:
+ luaL_argerror(L, 2, "invalid shutdown method");
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call inet methods
+\*-------------------------------------------------------------------------*/
+static int meth_getpeername(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ return inet_meth_getpeername(L, &tcp->sock);
+}
+
+static int meth_getsockname(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ return inet_meth_getsockname(L, &tcp->sock);
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call tm methods
+\*-------------------------------------------------------------------------*/
+static int meth_settimeout(lua_State *L)
+{
+ p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
+ return timeout_meth_settimeout(L, &tcp->tm);
+}
+
+/*=========================================================================*\
+* Library functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Creates a master tcp object
+\*-------------------------------------------------------------------------*/
+static int global_create(lua_State *L)
+{
+ t_socket sock;
+ const char *err = inet_trycreate(&sock, SOCK_STREAM);
+ /* try to allocate a system socket */
+ if (!err) {
+ /* allocate tcp object */
+ p_tcp tcp = (p_tcp) lua_newuserdata(L, sizeof(t_tcp));
+ /* set its type as master object */
+ auxiliar_setclass(L, "tcp{master}", -1);
+ /* initialize remaining structure fields */
+ socket_setnonblocking(&sock);
+ tcp->sock = sock;
+ io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
+ (p_error) socket_ioerror, &tcp->sock);
+ timeout_init(&tcp->tm, -1, -1);
+ buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
+ return 1;
+ } else {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.h b/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.h
new file mode 100644
index 00000000000..511357f371a
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.h
@@ -0,0 +1,36 @@
+#ifndef TCP_H
+#define TCP_H
+/*=========================================================================*\
+* TCP object
+* LuaSocket toolkit
+*
+* The tcp.h module is basicly a glue that puts together modules buffer.h,
+* timeout.h socket.h and inet.h to provide the LuaSocket TCP (AF_INET,
+* SOCK_STREAM) support.
+*
+* Three classes are defined: master, client and server. The master class is
+* a newly created tcp object, that has not been bound or connected. Server
+* objects are tcp objects bound to some local address. Client objects are
+* tcp objects either connected to some address or returned by the accept
+* method of a server object.
+*
+* RCS ID: $Id: tcp.h,v 1.7 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+
+#include "buffer.h"
+#include "timeout.h"
+#include "socket.h"
+
+typedef struct t_tcp_ {
+ t_socket sock;
+ t_io io;
+ t_buffer buf;
+ t_timeout tm;
+} t_tcp;
+
+typedef t_tcp *p_tcp;
+
+int tcp_open(lua_State *L);
+
+#endif /* TCP_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/timeout.c b/Build/source/texk/web2c/luatexdir/luasocket/src/timeout.c
new file mode 100644
index 00000000000..c1df1021811
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/timeout.c
@@ -0,0 +1,207 @@
+/*=========================================================================*\
+* Timeout management functions
+* LuaSocket toolkit
+*
+* RCS ID: $Id: timeout.c,v 1.30 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include <stdio.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "auxiliar.h"
+#include "timeout.h"
+
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <time.h>
+#include <sys/time.h>
+#endif
+
+/* min and max macros */
+#ifndef MIN
+#define MIN(x, y) ((x) < (y) ? x : y)
+#endif
+#ifndef MAX
+#define MAX(x, y) ((x) > (y) ? x : y)
+#endif
+
+/*=========================================================================*\
+* Internal function prototypes
+\*=========================================================================*/
+static int timeout_lua_gettime(lua_State *L);
+static int timeout_lua_sleep(lua_State *L);
+
+static luaL_reg func[] = {
+ { "gettime", timeout_lua_gettime },
+ { "sleep", timeout_lua_sleep },
+ { NULL, NULL }
+};
+
+/*=========================================================================*\
+* Exported functions.
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Initialize structure
+\*-------------------------------------------------------------------------*/
+void timeout_init(p_timeout tm, double block, double total) {
+ tm->block = block;
+ tm->total = total;
+}
+
+/*-------------------------------------------------------------------------*\
+* Determines how much time we have left for the next system call,
+* if the previous call was successful
+* Input
+* tm: timeout control structure
+* Returns
+* the number of ms left or -1 if there is no time limit
+\*-------------------------------------------------------------------------*/
+double timeout_get(p_timeout tm) {
+ if (tm->block < 0.0 && tm->total < 0.0) {
+ return -1;
+ } else if (tm->block < 0.0) {
+ double t = tm->total - timeout_gettime() + tm->start;
+ return MAX(t, 0.0);
+ } else if (tm->total < 0.0) {
+ return tm->block;
+ } else {
+ double t = tm->total - timeout_gettime() + tm->start;
+ return MIN(tm->block, MAX(t, 0.0));
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Returns time since start of operation
+* Input
+* tm: timeout control structure
+* Returns
+* start field of structure
+\*-------------------------------------------------------------------------*/
+double timeout_getstart(p_timeout tm) {
+ return tm->start;
+}
+
+/*-------------------------------------------------------------------------*\
+* Determines how much time we have left for the next system call,
+* if the previous call was a failure
+* Input
+* tm: timeout control structure
+* Returns
+* the number of ms left or -1 if there is no time limit
+\*-------------------------------------------------------------------------*/
+double timeout_getretry(p_timeout tm) {
+ if (tm->block < 0.0 && tm->total < 0.0) {
+ return -1;
+ } else if (tm->block < 0.0) {
+ double t = tm->total - timeout_gettime() + tm->start;
+ return MAX(t, 0.0);
+ } else if (tm->total < 0.0) {
+ double t = tm->block - timeout_gettime() + tm->start;
+ return MAX(t, 0.0);
+ } else {
+ double t = tm->total - timeout_gettime() + tm->start;
+ return MIN(tm->block, MAX(t, 0.0));
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Marks the operation start time in structure
+* Input
+* tm: timeout control structure
+\*-------------------------------------------------------------------------*/
+p_timeout timeout_markstart(p_timeout tm) {
+ tm->start = timeout_gettime();
+ return tm;
+}
+
+/*-------------------------------------------------------------------------*\
+* Gets time in s, relative to January 1, 1970 (UTC)
+* Returns
+* time in s.
+\*-------------------------------------------------------------------------*/
+#ifdef _WIN32
+double timeout_gettime(void) {
+ FILETIME ft;
+ double t;
+ GetSystemTimeAsFileTime(&ft);
+ /* Windows file time (time since January 1, 1601 (UTC)) */
+ t = ft.dwLowDateTime/1.0e7 + ft.dwHighDateTime*(4294967296.0/1.0e7);
+ /* convert to Unix Epoch time (time since January 1, 1970 (UTC)) */
+ return (t - 11644473600.0);
+}
+#else
+double timeout_gettime(void) {
+ struct timeval v;
+ gettimeofday(&v, (struct timezone *) NULL);
+ /* Unix Epoch time (time since January 1, 1970 (UTC)) */
+ return v.tv_sec + v.tv_usec/1.0e6;
+}
+#endif
+
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int timeout_open(lua_State *L) {
+ luaL_openlib(L, NULL, func, 0);
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Sets timeout values for IO operations
+* Lua Input: base, time [, mode]
+* time: time out value in seconds
+* mode: "b" for block timeout, "t" for total timeout. (default: b)
+\*-------------------------------------------------------------------------*/
+int timeout_meth_settimeout(lua_State *L, p_timeout tm) {
+ double t = luaL_optnumber(L, 2, -1);
+ const char *mode = luaL_optstring(L, 3, "b");
+ switch (*mode) {
+ case 'b':
+ tm->block = t;
+ break;
+ case 'r': case 't':
+ tm->total = t;
+ break;
+ default:
+ luaL_argcheck(L, 0, 3, "invalid timeout mode");
+ break;
+ }
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*=========================================================================*\
+* Test support functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Returns the time the system has been up, in secconds.
+\*-------------------------------------------------------------------------*/
+static int timeout_lua_gettime(lua_State *L)
+{
+ lua_pushnumber(L, timeout_gettime());
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Sleep for n seconds.
+\*-------------------------------------------------------------------------*/
+int timeout_lua_sleep(lua_State *L)
+{
+ double n = luaL_checknumber(L, 1);
+#ifdef _WIN32
+ Sleep((int)(n*1000));
+#else
+ struct timespec t, r;
+ t.tv_sec = (int) n;
+ n -= t.tv_sec;
+ t.tv_nsec = (int) (n * 1000000000);
+ if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999;
+ while (nanosleep(&t, &r) != 0) {
+ t.tv_sec = r.tv_sec;
+ t.tv_nsec = r.tv_nsec;
+ }
+#endif
+ return 0;
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/timeout.h b/Build/source/texk/web2c/luatexdir/luasocket/src/timeout.h
new file mode 100644
index 00000000000..d2d8964100f
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/timeout.h
@@ -0,0 +1,30 @@
+#ifndef TIMEOUT_H
+#define TIMEOUT_H
+/*=========================================================================*\
+* Timeout management functions
+* LuaSocket toolkit
+*
+* RCS ID: $Id: timeout.h,v 1.14 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+
+/* timeout control structure */
+typedef struct t_timeout_ {
+ double block; /* maximum time for blocking calls */
+ double total; /* total number of miliseconds for operation */
+ double start; /* time of start of operation */
+} t_timeout;
+typedef t_timeout *p_timeout;
+
+int timeout_open(lua_State *L);
+void timeout_init(p_timeout tm, double block, double total);
+double timeout_get(p_timeout tm);
+double timeout_getretry(p_timeout tm);
+p_timeout timeout_markstart(p_timeout tm);
+double timeout_getstart(p_timeout tm);
+double timeout_gettime(void);
+int timeout_meth_settimeout(lua_State *L, p_timeout tm);
+
+#define timeout_iszero(tm) ((tm)->block == 0.0)
+
+#endif /* TIMEOUT_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/tp.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/tp.lua
new file mode 100644
index 00000000000..0683869499f
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/tp.lua
@@ -0,0 +1,123 @@
+-----------------------------------------------------------------------------
+-- Unified SMTP/FTP subsystem
+-- LuaSocket toolkit.
+-- Author: Diego Nehab
+-- RCS ID: $Id: tp.lua,v 1.22 2006/03/14 09:04:15 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module and import dependencies
+-----------------------------------------------------------------------------
+local base = _G
+local string = require("string")
+local socket = require("socket")
+local ltn12 = require("ltn12")
+module("socket.tp")
+
+-----------------------------------------------------------------------------
+-- Program constants
+-----------------------------------------------------------------------------
+TIMEOUT = 60
+
+-----------------------------------------------------------------------------
+-- Implementation
+-----------------------------------------------------------------------------
+-- gets server reply (works for SMTP and FTP)
+local function get_reply(c)
+ local code, current, sep
+ local line, err = c:receive()
+ local reply = line
+ if err then return nil, err end
+ code, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)"))
+ if not code then return nil, "invalid server reply" end
+ if sep == "-" then -- reply is multiline
+ repeat
+ line, err = c:receive()
+ if err then return nil, err end
+ current, sep = socket.skip(2, string.find(line, "^(%d%d%d)(.?)"))
+ reply = reply .. "\n" .. line
+ -- reply ends with same code
+ until code == current and sep == " "
+ end
+ return code, reply
+end
+
+-- metatable for sock object
+local metat = { __index = {} }
+
+function metat.__index:check(ok)
+ local code, reply = get_reply(self.c)
+ if not code then return nil, reply end
+ if base.type(ok) ~= "function" then
+ if base.type(ok) == "table" then
+ for i, v in base.ipairs(ok) do
+ if string.find(code, v) then
+ return base.tonumber(code), reply
+ end
+ end
+ return nil, reply
+ else
+ if string.find(code, ok) then return base.tonumber(code), reply
+ else return nil, reply end
+ end
+ else return ok(base.tonumber(code), reply) end
+end
+
+function metat.__index:command(cmd, arg)
+ if arg then
+ return self.c:send(cmd .. " " .. arg.. "\r\n")
+ else
+ return self.c:send(cmd .. "\r\n")
+ end
+end
+
+function metat.__index:sink(snk, pat)
+ local chunk, err = c:receive(pat)
+ return snk(chunk, err)
+end
+
+function metat.__index:send(data)
+ return self.c:send(data)
+end
+
+function metat.__index:receive(pat)
+ return self.c:receive(pat)
+end
+
+function metat.__index:getfd()
+ return self.c:getfd()
+end
+
+function metat.__index:dirty()
+ return self.c:dirty()
+end
+
+function metat.__index:getcontrol()
+ return self.c
+end
+
+function metat.__index:source(source, step)
+ local sink = socket.sink("keep-open", self.c)
+ local ret, err = ltn12.pump.all(source, sink, step or ltn12.pump.step)
+ return ret, err
+end
+
+-- closes the underlying c
+function metat.__index:close()
+ self.c:close()
+ return 1
+end
+
+-- connect with server and return c object
+function connect(host, port, timeout, create)
+ local c, e = (create or socket.tcp)()
+ if not c then return nil, e end
+ c:settimeout(timeout or TIMEOUT)
+ local r, e = c:connect(host, port)
+ if not r then
+ c:close()
+ return nil, e
+ end
+ return base.setmetatable({c = c}, metat)
+end
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/tp_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/tp_lua.c
new file mode 100644
index 00000000000..897579d53ef
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/tp_lua.c
@@ -0,0 +1,194 @@
+/*
+ * This file is auto-generated by "./lua2c tp.lua tp_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_tp_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 85,110,105,102,105,101,100, 32, 83, 77, 84, 80, 47, 70, 84, 80, 32,115,117,
+ 98,115,121,115,116,101,109, 10, 45, 45, 32, 76,117, 97, 83,111, 99,107,101,116,
+ 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,117,116,104,111,114, 58,
+ 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45, 45, 32, 82, 67, 83, 32,
+ 73, 68, 58, 32, 36, 73,100, 58, 32,116,112, 46,108,117, 97, 44,118, 32, 49, 46,
+ 50, 50, 32, 50, 48, 48, 54, 47, 48, 51, 47, 49, 52, 32, 48, 57, 58, 48, 52, 58,
+ 49, 53, 32,100,105,101,103,111, 32, 69,120,112, 32, 36, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 68,101, 99,108, 97,
+114,101, 32,109,111,100,117,108,101, 32, 97,110,100, 32,105,109,112,111,114,116,
+ 32,100,101,112,101,110,100,101,110, 99,105,101,115, 10, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108, 32, 98, 97,
+115,101, 32, 61, 32, 95, 71, 10,108,111, 99, 97,108, 32,115,116,114,105,110,103,
+ 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,116,114,105,110,103, 34, 41,
+ 10,108,111, 99, 97,108, 32,115,111, 99,107,101,116, 32, 61, 32,114,101,113,117,
+105,114,101, 40, 34,115,111, 99,107,101,116, 34, 41, 10,108,111, 99, 97,108, 32,
+108,116,110, 49, 50, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,108,116,110,
+ 49, 50, 34, 41, 10,109,111,100,117,108,101, 40, 34,115,111, 99,107,101,116, 46,
+116,112, 34, 41, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 10, 45, 45, 32, 80,114,111,103,114, 97,109, 32, 99,111,110,115,116,
+ 97,110,116,115, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 10, 84, 73, 77, 69, 79, 85, 84, 32, 61, 32, 54, 48, 10, 10, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 73,109,
+112,108,101,109,101,110,116, 97,116,105,111,110, 10, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,103,101,116,115, 32,115,
+101,114,118,101,114, 32,114,101,112,108,121, 32, 40,119,111,114,107,115, 32,102,
+111,114, 32, 83, 77, 84, 80, 32, 97,110,100, 32, 70, 84, 80, 41, 10,108,111, 99,
+ 97,108, 32,102,117,110, 99,116,105,111,110, 32,103,101,116, 95,114,101,112,108,
+121, 40, 99, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101, 44,
+ 32, 99,117,114,114,101,110,116, 44, 32,115,101,112, 10, 32, 32, 32, 32,108,111,
+ 99, 97,108, 32,108,105,110,101, 44, 32,101,114,114, 32, 61, 32, 99, 58,114,101,
+ 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,114,101,
+112,108,121, 32, 61, 32,108,105,110,101, 10, 32, 32, 32, 32,105,102, 32,101,114,
+114, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,101,
+114,114, 32,101,110,100, 10, 32, 32, 32, 32, 99,111,100,101, 44, 32,115,101,112,
+ 32, 61, 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,115,116,
+114,105,110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 40, 37,
+100, 37,100, 37,100, 41, 40, 46, 63, 41, 34, 41, 41, 10, 32, 32, 32, 32,105,102,
+ 32,110,111,116, 32, 99,111,100,101, 32,116,104,101,110, 32,114,101,116,117,114,
+110, 32,110,105,108, 44, 32, 34,105,110,118, 97,108,105,100, 32,115,101,114,118,
+101,114, 32,114,101,112,108,121, 34, 32,101,110,100, 10, 32, 32, 32, 32,105,102,
+ 32,115,101,112, 32, 61, 61, 32, 34, 45, 34, 32,116,104,101,110, 32, 45, 45, 32,
+114,101,112,108,121, 32,105,115, 32,109,117,108,116,105,108,105,110,101, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,114,101,112,101, 97,116, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,108,105,110,101, 44, 32,101,114,114, 32, 61, 32, 99, 58,
+114,101, 99,101,105,118,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,105,102, 32,101,114,114, 32,116,104,101,110, 32,114,101,116,117,114,110,
+ 32,110,105,108, 44, 32,101,114,114, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 99,117,114,114,101,110,116, 44, 32,115,101,112, 32, 61,
+ 32,115,111, 99,107,101,116, 46,115,107,105,112, 40, 50, 44, 32,115,116,114,105,
+110,103, 46,102,105,110,100, 40,108,105,110,101, 44, 32, 34, 94, 40, 37,100, 37,
+100, 37,100, 41, 40, 46, 63, 41, 34, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32,114,101,112,108,121, 32, 61, 32,114,101,112,108,121, 32, 46, 46,
+ 32, 34, 92,110, 34, 32, 46, 46, 32,108,105,110,101, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 45, 45, 32,114,101,112,108,121, 32,101,110,100,115, 32,119,105,116,104,
+ 32,115, 97,109,101, 32, 99,111,100,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,117,
+110,116,105,108, 32, 99,111,100,101, 32, 61, 61, 32, 99,117,114,114,101,110,116,
+ 32, 97,110,100, 32,115,101,112, 32, 61, 61, 32, 34, 32, 34, 10, 32, 32, 32, 32,
+101,110,100, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32, 99,111,100,101, 44,
+ 32,114,101,112,108,121, 10,101,110,100, 10, 10, 45, 45, 32,109,101,116, 97,116,
+ 97, 98,108,101, 32,102,111,114, 32,115,111, 99,107, 32,111, 98,106,101, 99,116,
+ 10,108,111, 99, 97,108, 32,109,101,116, 97,116, 32, 61, 32,123, 32, 95, 95,105,
+110,100,101,120, 32, 61, 32,123,125, 32,125, 10, 10,102,117,110, 99,116,105,111,
+110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,104,101, 99,
+107, 40,111,107, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,100,101,
+ 44, 32,114,101,112,108,121, 32, 61, 32,103,101,116, 95,114,101,112,108,121, 40,
+115,101,108,102, 46, 99, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99,
+111,100,101, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,110,105,108, 44,
+ 32,114,101,112,108,121, 32,101,110,100, 10, 32, 32, 32, 32,105,102, 32, 98, 97,
+115,101, 46,116,121,112,101, 40,111,107, 41, 32,126, 61, 32, 34,102,117,110, 99,
+116,105,111,110, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,
+102, 32, 98, 97,115,101, 46,116,121,112,101, 40,111,107, 41, 32, 61, 61, 32, 34,
+116, 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32,102,111,114, 32,105, 44, 32,118, 32,105,110, 32, 98, 97,115,101,
+ 46,105,112, 97,105,114,115, 40,111,107, 41, 32,100,111, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115,116,114,105,110,103,
+ 46,102,105,110,100, 40, 99,111,100,101, 44, 32,118, 41, 32,116,104,101,110, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+114,101,116,117,114,110, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114,
+ 40, 99,111,100,101, 41, 44, 32,114,101,112,108,121, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,114,101,112,108,121, 10,
+ 32, 32, 32, 32, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,105,102, 32,115,116,114,105,110,103, 46,102,105,110,100, 40,
+ 99,111,100,101, 44, 32,111,107, 41, 32,116,104,101,110, 32,114,101,116,117,114,
+110, 32, 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, 40, 99,111,100,101,
+ 41, 44, 32,114,101,112,108,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32,101,108,115,101, 32,114,101,116,117,114,110, 32,110,105,108, 44, 32,114,101,
+112,108,121, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10,
+ 32, 32, 32, 32,101,108,115,101, 32,114,101,116,117,114,110, 32,111,107, 40, 98,
+ 97,115,101, 46,116,111,110,117,109, 98,101,114, 40, 99,111,100,101, 41, 44, 32,
+114,101,112,108,121, 41, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,
+116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58, 99,
+111,109,109, 97,110,100, 40, 99,109,100, 44, 32, 97,114,103, 41, 10, 32, 32, 32,
+ 32,105,102, 32, 97,114,103, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58,115,101,110,100, 40,
+ 99,109,100, 32, 46, 46, 32, 34, 32, 34, 32, 46, 46, 32, 97,114,103, 46, 46, 32,
+ 34, 92,114, 92,110, 34, 41, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 58,115,
+101,110,100, 40, 99,109,100, 32, 46, 46, 32, 34, 92,114, 92,110, 34, 41, 10, 32,
+ 32, 32, 32,101,110,100, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110,
+ 32,109,101,116, 97,116, 46, 95, 95,105,110,100,101,120, 58,115,105,110,107, 40,
+115,110,107, 44, 32,112, 97,116, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,
+ 99,104,117,110,107, 44, 32,101,114,114, 32, 61, 32, 99, 58,114,101, 99,101,105,
+118,101, 40,112, 97,116, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,
+110,107, 40, 99,104,117,110,107, 44, 32,101,114,114, 41, 10,101,110,100, 10, 10,
+102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,
+101,120, 58,115,101,110,100, 40,100, 97,116, 97, 41, 10, 32, 32, 32, 32,114,101,
+116,117,114,110, 32,115,101,108,102, 46, 99, 58,115,101,110,100, 40,100, 97,116,
+ 97, 41, 10,101,110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116,
+ 97,116, 46, 95, 95,105,110,100,101,120, 58,114,101, 99,101,105,118,101, 40,112,
+ 97,116, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46,
+ 99, 58,114,101, 99,101,105,118,101, 40,112, 97,116, 41, 10,101,110,100, 10, 10,
+102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,110,100,
+101,120, 58,103,101,116,102,100, 40, 41, 10, 32, 32, 32, 32,114,101,116,117,114,
+110, 32,115,101,108,102, 46, 99, 58,103,101,116,102,100, 40, 41, 10,101,110,100,
+ 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,105,
+110,100,101,120, 58,100,105,114,116,121, 40, 41, 10, 32, 32, 32, 32,114,101,116,
+117,114,110, 32,115,101,108,102, 46, 99, 58,100,105,114,116,121, 40, 41, 10,101,
+110,100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95,
+ 95,105,110,100,101,120, 58,103,101,116, 99,111,110,116,114,111,108, 40, 41, 10,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32,115,101,108,102, 46, 99, 10,101,110,
+100, 10, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95, 95,
+105,110,100,101,120, 58,115,111,117,114, 99,101, 40,115,111,117,114, 99,101, 44,
+ 32,115,116,101,112, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,115,105,110,
+107, 32, 61, 32,115,111, 99,107,101,116, 46,115,105,110,107, 40, 34,107,101,101,
+112, 45,111,112,101,110, 34, 44, 32,115,101,108,102, 46, 99, 41, 10, 32, 32, 32,
+ 32,108,111, 99, 97,108, 32,114,101,116, 44, 32,101,114,114, 32, 61, 32,108,116,
+110, 49, 50, 46,112,117,109,112, 46, 97,108,108, 40,115,111,117,114, 99,101, 44,
+ 32,115,105,110,107, 44, 32,115,116,101,112, 32,111,114, 32,108,116,110, 49, 50,
+ 46,112,117,109,112, 46,115,116,101,112, 41, 10, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,114,101,116, 44, 32,101,114,114, 10,101,110,100, 10, 10, 45, 45, 32,
+ 99,108,111,115,101,115, 32,116,104,101, 32,117,110,100,101,114,108,121,105,110,
+103, 32, 99, 10,102,117,110, 99,116,105,111,110, 32,109,101,116, 97,116, 46, 95,
+ 95,105,110,100,101,120, 58, 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32,115,
+101,108,102, 46, 99, 58, 99,108,111,115,101, 40, 41, 10, 9,114,101,116,117,114,
+110, 32, 49, 10,101,110,100, 10, 10, 45, 45, 32, 99,111,110,110,101, 99,116, 32,
+119,105,116,104, 32,115,101,114,118,101,114, 32, 97,110,100, 32,114,101,116,117,
+114,110, 32, 99, 32,111, 98,106,101, 99,116, 10,102,117,110, 99,116,105,111,110,
+ 32, 99,111,110,110,101, 99,116, 40,104,111,115,116, 44, 32,112,111,114,116, 44,
+ 32,116,105,109,101,111,117,116, 44, 32, 99,114,101, 97,116,101, 41, 10, 32, 32,
+ 32, 32,108,111, 99, 97,108, 32, 99, 44, 32,101, 32, 61, 32, 40, 99,114,101, 97,
+116,101, 32,111,114, 32,115,111, 99,107,101,116, 46,116, 99,112, 41, 40, 41, 10,
+ 32, 32, 32, 32,105,102, 32,110,111,116, 32, 99, 32,116,104,101,110, 32,114,101,
+116,117,114,110, 32,110,105,108, 44, 32,101, 32,101,110,100, 10, 32, 32, 32, 32,
+ 99, 58,115,101,116,116,105,109,101,111,117,116, 40,116,105,109,101,111,117,116,
+ 32,111,114, 32, 84, 73, 77, 69, 79, 85, 84, 41, 10, 32, 32, 32, 32,108,111, 99,
+ 97,108, 32,114, 44, 32,101, 32, 61, 32, 99, 58, 99,111,110,110,101, 99,116, 40,
+104,111,115,116, 44, 32,112,111,114,116, 41, 10, 32, 32, 32, 32,105,102, 32,110,
+111,116, 32,114, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 99, 58,
+ 99,108,111,115,101, 40, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,
+114,110, 32,110,105,108, 44, 32,101, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32,
+ 32, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 46,115,101,116,109,101,116,
+ 97,116, 97, 98,108,101, 40,123, 99, 32, 61, 32, 99,125, 44, 32,109,101,116, 97,
+116, 41, 10,101,110,100, 10, 10,
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/udp.c b/Build/source/texk/web2c/luatexdir/luasocket/src/udp.c
new file mode 100644
index 00000000000..fc25aa027dc
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/udp.c
@@ -0,0 +1,336 @@
+/*=========================================================================*\
+* UDP object
+* LuaSocket toolkit
+*
+* RCS ID: $Id: udp.c,v 1.29 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "auxiliar.h"
+#include "socket.h"
+#include "inet.h"
+#include "options.h"
+#include "udp.h"
+
+/* min and max macros */
+#ifndef MIN
+#define MIN(x, y) ((x) < (y) ? x : y)
+#endif
+#ifndef MAX
+#define MAX(x, y) ((x) > (y) ? x : y)
+#endif
+
+/*=========================================================================*\
+* Internal function prototypes
+\*=========================================================================*/
+static int global_create(lua_State *L);
+static int meth_send(lua_State *L);
+static int meth_sendto(lua_State *L);
+static int meth_receive(lua_State *L);
+static int meth_receivefrom(lua_State *L);
+static int meth_getsockname(lua_State *L);
+static int meth_getpeername(lua_State *L);
+static int meth_setsockname(lua_State *L);
+static int meth_setpeername(lua_State *L);
+static int meth_close(lua_State *L);
+static int meth_setoption(lua_State *L);
+static int meth_settimeout(lua_State *L);
+static int meth_getfd(lua_State *L);
+static int meth_setfd(lua_State *L);
+static int meth_dirty(lua_State *L);
+
+/* udp object methods */
+static luaL_reg udp[] = {
+ {"__gc", meth_close},
+ {"__tostring", auxiliar_tostring},
+ {"close", meth_close},
+ {"dirty", meth_dirty},
+ {"getfd", meth_getfd},
+ {"getpeername", meth_getpeername},
+ {"getsockname", meth_getsockname},
+ {"receive", meth_receive},
+ {"receivefrom", meth_receivefrom},
+ {"send", meth_send},
+ {"sendto", meth_sendto},
+ {"setfd", meth_setfd},
+ {"setoption", meth_setoption},
+ {"setpeername", meth_setpeername},
+ {"setsockname", meth_setsockname},
+ {"settimeout", meth_settimeout},
+ {NULL, NULL}
+};
+
+/* socket options */
+static t_opt opt[] = {
+ {"dontroute", opt_dontroute},
+ {"broadcast", opt_broadcast},
+ {"reuseaddr", opt_reuseaddr},
+ {"ip-multicast-ttl", opt_ip_multicast_ttl},
+ {"ip-multicast-loop", opt_ip_multicast_loop},
+ {"ip-add-membership", opt_ip_add_membership},
+ {"ip-drop-membership", opt_ip_drop_membersip},
+ {NULL, NULL}
+};
+
+/* functions in library namespace */
+static luaL_reg func[] = {
+ {"udp", global_create},
+ {NULL, NULL}
+};
+
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int udp_open(lua_State *L)
+{
+ /* create classes */
+ auxiliar_newclass(L, "udp{connected}", udp);
+ auxiliar_newclass(L, "udp{unconnected}", udp);
+ /* create class groups */
+ auxiliar_add2group(L, "udp{connected}", "udp{any}");
+ auxiliar_add2group(L, "udp{unconnected}", "udp{any}");
+ auxiliar_add2group(L, "udp{connected}", "select{able}");
+ auxiliar_add2group(L, "udp{unconnected}", "select{able}");
+ /* define library functions */
+ luaL_openlib(L, NULL, func, 0);
+ return 0;
+}
+
+/*=========================================================================*\
+* Lua methods
+\*=========================================================================*/
+const char *udp_strerror(int err) {
+ /* a 'closed' error on an unconnected means the target address was not
+ * accepted by the transport layer */
+ if (err == IO_CLOSED) return "refused";
+ else return socket_strerror(err);
+}
+
+/*-------------------------------------------------------------------------*\
+* Send data through connected udp socket
+\*-------------------------------------------------------------------------*/
+static int meth_send(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1);
+ p_timeout tm = &udp->tm;
+ size_t count, sent = 0;
+ int err;
+ const char *data = luaL_checklstring(L, 2, &count);
+ timeout_markstart(tm);
+ err = socket_send(&udp->sock, data, count, &sent, tm);
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, udp_strerror(err));
+ return 2;
+ }
+ lua_pushnumber(L, sent);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Send data through unconnected udp socket
+\*-------------------------------------------------------------------------*/
+static int meth_sendto(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1);
+ size_t count, sent = 0;
+ const char *data = luaL_checklstring(L, 2, &count);
+ const char *ip = luaL_checkstring(L, 3);
+ unsigned short port = (unsigned short) luaL_checknumber(L, 4);
+ p_timeout tm = &udp->tm;
+ struct sockaddr_in addr;
+ int err;
+ memset(&addr, 0, sizeof(addr));
+ if (!inet_aton(ip, &addr.sin_addr))
+ luaL_argerror(L, 3, "invalid ip address");
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+ timeout_markstart(tm);
+ err = socket_sendto(&udp->sock, data, count, &sent,
+ (SA *) &addr, sizeof(addr), tm);
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, udp_strerror(err));
+ return 2;
+ }
+ lua_pushnumber(L, sent);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Receives data from a UDP socket
+\*-------------------------------------------------------------------------*/
+static int meth_receive(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ char buffer[UDP_DATAGRAMSIZE];
+ size_t got, count = (size_t) luaL_optnumber(L, 2, sizeof(buffer));
+ int err;
+ p_timeout tm = &udp->tm;
+ count = MIN(count, sizeof(buffer));
+ timeout_markstart(tm);
+ err = socket_recv(&udp->sock, buffer, count, &got, tm);
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, udp_strerror(err));
+ return 2;
+ }
+ lua_pushlstring(L, buffer, got);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Receives data and sender from a UDP socket
+\*-------------------------------------------------------------------------*/
+static int meth_receivefrom(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1);
+ struct sockaddr_in addr;
+ socklen_t addr_len = sizeof(addr);
+ char buffer[UDP_DATAGRAMSIZE];
+ size_t got, count = (size_t) luaL_optnumber(L, 2, sizeof(buffer));
+ int err;
+ p_timeout tm = &udp->tm;
+ timeout_markstart(tm);
+ count = MIN(count, sizeof(buffer));
+ err = socket_recvfrom(&udp->sock, buffer, count, &got,
+ (SA *) &addr, &addr_len, tm);
+ if (err == IO_DONE) {
+ lua_pushlstring(L, buffer, got);
+ lua_pushstring(L, inet_ntoa(addr.sin_addr));
+ lua_pushnumber(L, ntohs(addr.sin_port));
+ return 3;
+ } else {
+ lua_pushnil(L);
+ lua_pushstring(L, udp_strerror(err));
+ return 2;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Select support methods
+\*-------------------------------------------------------------------------*/
+static int meth_getfd(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ lua_pushnumber(L, (int) udp->sock);
+ return 1;
+}
+
+/* this is very dangerous, but can be handy for those that are brave enough */
+static int meth_setfd(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ udp->sock = (t_socket) luaL_checknumber(L, 2);
+ return 0;
+}
+
+static int meth_dirty(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ (void) udp;
+ lua_pushboolean(L, 0);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call inet methods
+\*-------------------------------------------------------------------------*/
+static int meth_getpeername(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1);
+ return inet_meth_getpeername(L, &udp->sock);
+}
+
+static int meth_getsockname(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ return inet_meth_getsockname(L, &udp->sock);
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call option handler
+\*-------------------------------------------------------------------------*/
+static int meth_setoption(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ return opt_meth_setoption(L, opt, &udp->sock);
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call tm methods
+\*-------------------------------------------------------------------------*/
+static int meth_settimeout(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ return timeout_meth_settimeout(L, &udp->tm);
+}
+
+/*-------------------------------------------------------------------------*\
+* Turns a master udp object into a client object.
+\*-------------------------------------------------------------------------*/
+static int meth_setpeername(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ p_timeout tm = &udp->tm;
+ const char *address = luaL_checkstring(L, 2);
+ int connecting = strcmp(address, "*");
+ unsigned short port = connecting ?
+ (unsigned short) luaL_checknumber(L, 3) :
+ (unsigned short) luaL_optnumber(L, 3, 0);
+ const char *err = inet_tryconnect(&udp->sock, address, port, tm);
+ if (err) {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+ /* change class to connected or unconnected depending on address */
+ if (connecting) auxiliar_setclass(L, "udp{connected}", 1);
+ else auxiliar_setclass(L, "udp{unconnected}", 1);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Closes socket used by object
+\*-------------------------------------------------------------------------*/
+static int meth_close(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkgroup(L, "udp{any}", 1);
+ socket_destroy(&udp->sock);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Turns a master object into a server object
+\*-------------------------------------------------------------------------*/
+static int meth_setsockname(lua_State *L) {
+ p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1);
+ const char *address = luaL_checkstring(L, 2);
+ unsigned short port = (unsigned short) luaL_checknumber(L, 3);
+ const char *err = inet_trybind(&udp->sock, address, port);
+ if (err) {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*=========================================================================*\
+* Library functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Creates a master udp object
+\*-------------------------------------------------------------------------*/
+static int global_create(lua_State *L) {
+ t_socket sock;
+ const char *err = inet_trycreate(&sock, SOCK_DGRAM);
+ /* try to allocate a system socket */
+ if (!err) {
+ /* allocate tcp object */
+ p_udp udp = (p_udp) lua_newuserdata(L, sizeof(t_udp));
+ auxiliar_setclass(L, "udp{unconnected}", -1);
+ /* initialize remaining structure fields */
+ socket_setnonblocking(&sock);
+ udp->sock = sock;
+ timeout_init(&udp->tm, -1, -1);
+ return 1;
+ } else {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/udp.h b/Build/source/texk/web2c/luatexdir/luasocket/src/udp.h
new file mode 100644
index 00000000000..28017121714
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/udp.h
@@ -0,0 +1,33 @@
+#ifndef UDP_H
+#define UDP_H
+/*=========================================================================*\
+* UDP object
+* LuaSocket toolkit
+*
+* The udp.h module provides LuaSocket with support for UDP protocol
+* (AF_INET, SOCK_DGRAM).
+*
+* Two classes are defined: connected and unconnected. UDP objects are
+* originally unconnected. They can be "connected" to a given address
+* with a call to the setpeername function. The same function can be used to
+* break the connection.
+*
+* RCS ID: $Id: udp.h,v 1.10 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+
+#include "timeout.h"
+#include "socket.h"
+
+/* can't be larger than wsocket.c MAXCHUNK!!! */
+#define UDP_DATAGRAMSIZE 8192
+
+typedef struct t_udp_ {
+ t_socket sock;
+ t_timeout tm;
+} t_udp;
+typedef t_udp *p_udp;
+
+int udp_open(lua_State *L);
+
+#endif /* UDP_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/unix.c b/Build/source/texk/web2c/luatexdir/luasocket/src/unix.c
new file mode 100644
index 00000000000..158d319a5f2
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/unix.c
@@ -0,0 +1,356 @@
+/*=========================================================================*\
+* Unix domain socket
+* LuaSocket toolkit
+*
+* RCS ID: $Id: unix.c,v 1.13 2006/03/13 07:16:39 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+
+#include "lua.h"
+#include "lauxlib.h"
+
+#include "auxiliar.h"
+#include "socket.h"
+#include "options.h"
+#include "unix.h"
+#include <sys/un.h>
+
+/*=========================================================================*\
+* Internal function prototypes
+\*=========================================================================*/
+static int global_create(lua_State *L);
+static int meth_connect(lua_State *L);
+static int meth_listen(lua_State *L);
+static int meth_bind(lua_State *L);
+static int meth_send(lua_State *L);
+static int meth_shutdown(lua_State *L);
+static int meth_receive(lua_State *L);
+static int meth_accept(lua_State *L);
+static int meth_close(lua_State *L);
+static int meth_setoption(lua_State *L);
+static int meth_settimeout(lua_State *L);
+static int meth_getfd(lua_State *L);
+static int meth_setfd(lua_State *L);
+static int meth_dirty(lua_State *L);
+static int meth_getstats(lua_State *L);
+static int meth_setstats(lua_State *L);
+
+static const char *unix_tryconnect(p_unix un, const char *path);
+static const char *unix_trybind(p_unix un, const char *path);
+
+/* unix object methods */
+static luaL_reg un[] = {
+ {"__gc", meth_close},
+ {"__tostring", auxiliar_tostring},
+ {"accept", meth_accept},
+ {"bind", meth_bind},
+ {"close", meth_close},
+ {"connect", meth_connect},
+ {"dirty", meth_dirty},
+ {"getfd", meth_getfd},
+ {"getstats", meth_getstats},
+ {"setstats", meth_setstats},
+ {"listen", meth_listen},
+ {"receive", meth_receive},
+ {"send", meth_send},
+ {"setfd", meth_setfd},
+ {"setoption", meth_setoption},
+ {"setpeername", meth_connect},
+ {"setsockname", meth_bind},
+ {"settimeout", meth_settimeout},
+ {"shutdown", meth_shutdown},
+ {NULL, NULL}
+};
+
+/* socket option handlers */
+static t_opt opt[] = {
+ {"keepalive", opt_keepalive},
+ {"reuseaddr", opt_reuseaddr},
+ {"linger", opt_linger},
+ {NULL, NULL}
+};
+
+/* our socket creation function */
+static luaL_reg func[] = {
+ {"unix", global_create},
+ {NULL, NULL}
+};
+
+
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int luaopen_socket_unix(lua_State *L) {
+ /* create classes */
+ auxiliar_newclass(L, "unix{master}", un);
+ auxiliar_newclass(L, "unix{client}", un);
+ auxiliar_newclass(L, "unix{server}", un);
+ /* create class groups */
+ auxiliar_add2group(L, "unix{master}", "unix{any}");
+ auxiliar_add2group(L, "unix{client}", "unix{any}");
+ auxiliar_add2group(L, "unix{server}", "unix{any}");
+ /* make sure the function ends up in the package table */
+ luaL_openlib(L, "socket", func, 0);
+ /* return the function instead of the 'socket' table */
+ lua_pushstring(L, "unix");
+ lua_gettable(L, -2);
+ return 1;
+}
+
+/*=========================================================================*\
+* Lua methods
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Just call buffered IO methods
+\*-------------------------------------------------------------------------*/
+static int meth_send(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
+ return buffer_meth_send(L, &un->buf);
+}
+
+static int meth_receive(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
+ return buffer_meth_receive(L, &un->buf);
+}
+
+static int meth_getstats(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
+ return buffer_meth_getstats(L, &un->buf);
+}
+
+static int meth_setstats(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
+ return buffer_meth_setstats(L, &un->buf);
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call option handler
+\*-------------------------------------------------------------------------*/
+static int meth_setoption(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
+ return opt_meth_setoption(L, opt, &un->sock);
+}
+
+/*-------------------------------------------------------------------------*\
+* Select support methods
+\*-------------------------------------------------------------------------*/
+static int meth_getfd(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
+ lua_pushnumber(L, (int) un->sock);
+ return 1;
+}
+
+/* this is very dangerous, but can be handy for those that are brave enough */
+static int meth_setfd(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
+ un->sock = (t_socket) luaL_checknumber(L, 2);
+ return 0;
+}
+
+static int meth_dirty(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
+ lua_pushboolean(L, !buffer_isempty(&un->buf));
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Waits for and returns a client object attempting connection to the
+* server object
+\*-------------------------------------------------------------------------*/
+static int meth_accept(lua_State *L) {
+ p_unix server = (p_unix) auxiliar_checkclass(L, "unix{server}", 1);
+ p_timeout tm = timeout_markstart(&server->tm);
+ t_socket sock;
+ int err = socket_accept(&server->sock, &sock, NULL, NULL, tm);
+ /* if successful, push client socket */
+ if (err == IO_DONE) {
+ p_unix clnt = (p_unix) lua_newuserdata(L, sizeof(t_unix));
+ auxiliar_setclass(L, "unix{client}", -1);
+ /* initialize structure fields */
+ socket_setnonblocking(&sock);
+ clnt->sock = sock;
+ io_init(&clnt->io, (p_send)socket_send, (p_recv)socket_recv,
+ (p_error) socket_ioerror, &clnt->sock);
+ timeout_init(&clnt->tm, -1, -1);
+ buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
+ return 1;
+ } else {
+ lua_pushnil(L);
+ lua_pushstring(L, socket_strerror(err));
+ return 2;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Binds an object to an address
+\*-------------------------------------------------------------------------*/
+static const char *unix_trybind(p_unix un, const char *path) {
+ struct sockaddr_un local;
+ size_t len = strlen(path);
+ int err;
+ if (len >= sizeof(local.sun_path)) return "path too long";
+ memset(&local, 0, sizeof(local));
+ strcpy(local.sun_path, path);
+ local.sun_family = AF_UNIX;
+#ifdef UNIX_HAS_SUN_LEN
+ local.sun_len = sizeof(local.sun_family) + sizeof(local.sun_len)
+ + len + 1;
+ err = socket_bind(&un->sock, (SA *) &local, local.sun_len);
+
+#else
+ err = socket_bind(&un->sock, (SA *) &local,
+ sizeof(local.sun_family) + len);
+#endif
+ if (err != IO_DONE) socket_destroy(&un->sock);
+ return socket_strerror(err);
+}
+
+static int meth_bind(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{master}", 1);
+ const char *path = luaL_checkstring(L, 2);
+ const char *err = unix_trybind(un, path);
+ if (err) {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Turns a master unix object into a client object.
+\*-------------------------------------------------------------------------*/
+static const char *unix_tryconnect(p_unix un, const char *path)
+{
+ struct sockaddr_un remote;
+ int err;
+ size_t len = strlen(path);
+ if (len >= sizeof(remote.sun_path)) return "path too long";
+ memset(&remote, 0, sizeof(remote));
+ strcpy(remote.sun_path, path);
+ remote.sun_family = AF_UNIX;
+ timeout_markstart(&un->tm);
+#ifdef UNIX_HAS_SUN_LEN
+ remote.sun_len = sizeof(remote.sun_family) + sizeof(remote.sun_len)
+ + len + 1;
+ err = socket_connect(&un->sock, (SA *) &remote, remote.sun_len, &un->tm);
+#else
+ err = socket_connect(&un->sock, (SA *) &remote,
+ sizeof(remote.sun_family) + len, &un->tm);
+#endif
+ if (err != IO_DONE) socket_destroy(&un->sock);
+ return socket_strerror(err);
+}
+
+static int meth_connect(lua_State *L)
+{
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{master}", 1);
+ const char *path = luaL_checkstring(L, 2);
+ const char *err = unix_tryconnect(un, path);
+ if (err) {
+ lua_pushnil(L);
+ lua_pushstring(L, err);
+ return 2;
+ }
+ /* turn master object into a client object */
+ auxiliar_setclass(L, "unix{client}", 1);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Closes socket used by object
+\*-------------------------------------------------------------------------*/
+static int meth_close(lua_State *L)
+{
+ p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
+ socket_destroy(&un->sock);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Puts the sockt in listen mode
+\*-------------------------------------------------------------------------*/
+static int meth_listen(lua_State *L)
+{
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{master}", 1);
+ int backlog = (int) luaL_optnumber(L, 2, 32);
+ int err = socket_listen(&un->sock, backlog);
+ if (err != IO_DONE) {
+ lua_pushnil(L);
+ lua_pushstring(L, socket_strerror(err));
+ return 2;
+ }
+ /* turn master object into a server object */
+ auxiliar_setclass(L, "unix{server}", 1);
+ lua_pushnumber(L, 1);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Shuts the connection down partially
+\*-------------------------------------------------------------------------*/
+static int meth_shutdown(lua_State *L)
+{
+ p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
+ const char *how = luaL_optstring(L, 2, "both");
+ switch (how[0]) {
+ case 'b':
+ if (strcmp(how, "both")) goto error;
+ socket_shutdown(&un->sock, 2);
+ break;
+ case 's':
+ if (strcmp(how, "send")) goto error;
+ socket_shutdown(&un->sock, 1);
+ break;
+ case 'r':
+ if (strcmp(how, "receive")) goto error;
+ socket_shutdown(&un->sock, 0);
+ break;
+ }
+ lua_pushnumber(L, 1);
+ return 1;
+error:
+ luaL_argerror(L, 2, "invalid shutdown method");
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*\
+* Just call tm methods
+\*-------------------------------------------------------------------------*/
+static int meth_settimeout(lua_State *L) {
+ p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
+ return timeout_meth_settimeout(L, &un->tm);
+}
+
+/*=========================================================================*\
+* Library functions
+\*=========================================================================*/
+/*-------------------------------------------------------------------------*\
+* Creates a master unix object
+\*-------------------------------------------------------------------------*/
+static int global_create(lua_State *L) {
+ t_socket sock;
+ int err = socket_create(&sock, AF_UNIX, SOCK_STREAM, 0);
+ /* try to allocate a system socket */
+ if (err == IO_DONE) {
+ /* allocate unix object */
+ p_unix un = (p_unix) lua_newuserdata(L, sizeof(t_unix));
+ /* set its type as master object */
+ auxiliar_setclass(L, "unix{master}", -1);
+ /* initialize remaining structure fields */
+ socket_setnonblocking(&sock);
+ un->sock = sock;
+ io_init(&un->io, (p_send) socket_send, (p_recv) socket_recv,
+ (p_error) socket_ioerror, &un->sock);
+ timeout_init(&un->tm, -1, -1);
+ buffer_init(&un->buf, &un->io, &un->tm);
+ return 1;
+ } else {
+ lua_pushnil(L);
+ lua_pushstring(L, socket_strerror(err));
+ return 2;
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/unix.h b/Build/source/texk/web2c/luatexdir/luasocket/src/unix.h
new file mode 100644
index 00000000000..32b7380fffa
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/unix.h
@@ -0,0 +1,28 @@
+#ifndef UNIX_H
+#define UNIX_H
+/*=========================================================================*\
+* Unix domain object
+* LuaSocket toolkit
+*
+* This module is just an example of how to extend LuaSocket with a new
+* domain.
+*
+* RCS ID: $Id: unix.h,v 1.9 2006/03/13 07:16:39 diego Exp $
+\*=========================================================================*/
+#include "lua.h"
+
+#include "buffer.h"
+#include "timeout.h"
+#include "socket.h"
+
+typedef struct t_unix_ {
+ t_socket sock;
+ t_io io;
+ t_buffer buf;
+ t_timeout tm;
+} t_unix;
+typedef t_unix *p_unix;
+
+int luaopen_socket_unix(lua_State *L);
+
+#endif /* UNIX_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/url.lua b/Build/source/texk/web2c/luatexdir/luasocket/src/url.lua
new file mode 100644
index 00000000000..0e31d8af20d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/url.lua
@@ -0,0 +1,297 @@
+-----------------------------------------------------------------------------
+-- URI parsing, composition and relative URL resolution
+-- LuaSocket toolkit.
+-- Author: Diego Nehab
+-- RCS ID: $Id: url.lua,v 1.38 2006/04/03 04:45:42 diego Exp $
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Declare module
+-----------------------------------------------------------------------------
+local string = require("string")
+local base = _G
+local table = require("table")
+module("socket.url")
+
+-----------------------------------------------------------------------------
+-- Module version
+-----------------------------------------------------------------------------
+_VERSION = "URL 1.0.1"
+
+-----------------------------------------------------------------------------
+-- Encodes a string into its escaped hexadecimal representation
+-- Input
+-- s: binary string to be encoded
+-- Returns
+-- escaped representation of string binary
+-----------------------------------------------------------------------------
+function escape(s)
+ return string.gsub(s, "([^A-Za-z0-9_])", function(c)
+ return string.format("%%%02x", string.byte(c))
+ end)
+end
+
+-----------------------------------------------------------------------------
+-- Protects a path segment, to prevent it from interfering with the
+-- url parsing.
+-- Input
+-- s: binary string to be encoded
+-- Returns
+-- escaped representation of string binary
+-----------------------------------------------------------------------------
+local function make_set(t)
+ local s = {}
+ for i,v in base.ipairs(t) do
+ s[t[i]] = 1
+ end
+ return s
+end
+
+-- these are allowed withing a path segment, along with alphanum
+-- other characters must be escaped
+local segment_set = make_set {
+ "-", "_", ".", "!", "~", "*", "'", "(",
+ ")", ":", "@", "&", "=", "+", "$", ",",
+}
+
+local function protect_segment(s)
+ return string.gsub(s, "([^A-Za-z0-9_])", function (c)
+ if segment_set[c] then return c
+ else return string.format("%%%02x", string.byte(c)) end
+ end)
+end
+
+-----------------------------------------------------------------------------
+-- Encodes a string into its escaped hexadecimal representation
+-- Input
+-- s: binary string to be encoded
+-- Returns
+-- escaped representation of string binary
+-----------------------------------------------------------------------------
+function unescape(s)
+ return string.gsub(s, "%%(%x%x)", function(hex)
+ return string.char(base.tonumber(hex, 16))
+ end)
+end
+
+-----------------------------------------------------------------------------
+-- Builds a path from a base path and a relative path
+-- Input
+-- base_path
+-- relative_path
+-- Returns
+-- corresponding absolute path
+-----------------------------------------------------------------------------
+local function absolute_path(base_path, relative_path)
+ if string.sub(relative_path, 1, 1) == "/" then return relative_path end
+ local path = string.gsub(base_path, "[^/]*$", "")
+ path = path .. relative_path
+ path = string.gsub(path, "([^/]*%./)", function (s)
+ if s ~= "./" then return s else return "" end
+ end)
+ path = string.gsub(path, "/%.$", "/")
+ local reduced
+ while reduced ~= path do
+ reduced = path
+ path = string.gsub(reduced, "([^/]*/%.%./)", function (s)
+ if s ~= "../../" then return "" else return s end
+ end)
+ end
+ path = string.gsub(reduced, "([^/]*/%.%.)$", function (s)
+ if s ~= "../.." then return "" else return s end
+ end)
+ return path
+end
+
+-----------------------------------------------------------------------------
+-- Parses a url and returns a table with all its parts according to RFC 2396
+-- The following grammar describes the names given to the URL parts
+-- <url> ::= <scheme>://<authority>/<path>;<params>?<query>#<fragment>
+-- <authority> ::= <userinfo>@<host>:<port>
+-- <userinfo> ::= <user>[:<password>]
+-- <path> :: = {<segment>/}<segment>
+-- Input
+-- url: uniform resource locator of request
+-- default: table with default values for each field
+-- Returns
+-- table with the following fields, where RFC naming conventions have
+-- been preserved:
+-- scheme, authority, userinfo, user, password, host, port,
+-- path, params, query, fragment
+-- Obs:
+-- the leading '/' in {/<path>} is considered part of <path>
+-----------------------------------------------------------------------------
+function parse(url, default)
+ -- initialize default parameters
+ local parsed = {}
+ for i,v in base.pairs(default or parsed) do parsed[i] = v end
+ -- empty url is parsed to nil
+ if not url or url == "" then return nil, "invalid url" end
+ -- remove whitespace
+ -- url = string.gsub(url, "%s", "")
+ -- get fragment
+ url = string.gsub(url, "#(.*)$", function(f)
+ parsed.fragment = f
+ return ""
+ end)
+ -- get scheme
+ url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
+ function(s) parsed.scheme = s; return "" end)
+ -- get authority
+ url = string.gsub(url, "^//([^/]*)", function(n)
+ parsed.authority = n
+ return ""
+ end)
+ -- get query stringing
+ url = string.gsub(url, "%?(.*)", function(q)
+ parsed.query = q
+ return ""
+ end)
+ -- get params
+ url = string.gsub(url, "%;(.*)", function(p)
+ parsed.params = p
+ return ""
+ end)
+ -- path is whatever was left
+ if url ~= "" then parsed.path = url end
+ local authority = parsed.authority
+ if not authority then return parsed end
+ authority = string.gsub(authority,"^([^@]*)@",
+ function(u) parsed.userinfo = u; return "" end)
+ authority = string.gsub(authority, ":([^:]*)$",
+ function(p) parsed.port = p; return "" end)
+ if authority ~= "" then parsed.host = authority end
+ local userinfo = parsed.userinfo
+ if not userinfo then return parsed end
+ userinfo = string.gsub(userinfo, ":([^:]*)$",
+ function(p) parsed.password = p; return "" end)
+ parsed.user = userinfo
+ return parsed
+end
+
+-----------------------------------------------------------------------------
+-- Rebuilds a parsed URL from its components.
+-- Components are protected if any reserved or unallowed characters are found
+-- Input
+-- parsed: parsed URL, as returned by parse
+-- Returns
+-- a stringing with the corresponding URL
+-----------------------------------------------------------------------------
+function build(parsed)
+ local ppath = parse_path(parsed.path or "")
+ local url = build_path(ppath)
+ if parsed.params then url = url .. ";" .. parsed.params end
+ if parsed.query then url = url .. "?" .. parsed.query end
+ local authority = parsed.authority
+ if parsed.host then
+ authority = parsed.host
+ if parsed.port then authority = authority .. ":" .. parsed.port end
+ local userinfo = parsed.userinfo
+ if parsed.user then
+ userinfo = parsed.user
+ if parsed.password then
+ userinfo = userinfo .. ":" .. parsed.password
+ end
+ end
+ if userinfo then authority = userinfo .. "@" .. authority end
+ end
+ if authority then url = "//" .. authority .. url end
+ if parsed.scheme then url = parsed.scheme .. ":" .. url end
+ if parsed.fragment then url = url .. "#" .. parsed.fragment end
+ -- url = string.gsub(url, "%s", "")
+ return url
+end
+
+-----------------------------------------------------------------------------
+-- Builds a absolute URL from a base and a relative URL according to RFC 2396
+-- Input
+-- base_url
+-- relative_url
+-- Returns
+-- corresponding absolute url
+-----------------------------------------------------------------------------
+function absolute(base_url, relative_url)
+ if base.type(base_url) == "table" then
+ base_parsed = base_url
+ base_url = build(base_parsed)
+ else
+ base_parsed = parse(base_url)
+ end
+ local relative_parsed = parse(relative_url)
+ if not base_parsed then return relative_url
+ elseif not relative_parsed then return base_url
+ elseif relative_parsed.scheme then return relative_url
+ else
+ relative_parsed.scheme = base_parsed.scheme
+ if not relative_parsed.authority then
+ relative_parsed.authority = base_parsed.authority
+ if not relative_parsed.path then
+ relative_parsed.path = base_parsed.path
+ if not relative_parsed.params then
+ relative_parsed.params = base_parsed.params
+ if not relative_parsed.query then
+ relative_parsed.query = base_parsed.query
+ end
+ end
+ else
+ relative_parsed.path = absolute_path(base_parsed.path or "",
+ relative_parsed.path)
+ end
+ end
+ return build(relative_parsed)
+ end
+end
+
+-----------------------------------------------------------------------------
+-- Breaks a path into its segments, unescaping the segments
+-- Input
+-- path
+-- Returns
+-- segment: a table with one entry per segment
+-----------------------------------------------------------------------------
+function parse_path(path)
+ local parsed = {}
+ path = path or ""
+ --path = string.gsub(path, "%s", "")
+ string.gsub(path, "([^/]+)", function (s) table.insert(parsed, s) end)
+ for i = 1, table.getn(parsed) do
+ parsed[i] = unescape(parsed[i])
+ end
+ if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end
+ if string.sub(path, -1, -1) == "/" then parsed.is_directory = 1 end
+ return parsed
+end
+
+-----------------------------------------------------------------------------
+-- Builds a path component from its segments, escaping protected characters.
+-- Input
+-- parsed: path segments
+-- unsafe: if true, segments are not protected before path is built
+-- Returns
+-- path: corresponding path stringing
+-----------------------------------------------------------------------------
+function build_path(parsed, unsafe)
+ local path = ""
+ local n = table.getn(parsed)
+ if unsafe then
+ for i = 1, n-1 do
+ path = path .. parsed[i]
+ path = path .. "/"
+ end
+ if n > 0 then
+ path = path .. parsed[n]
+ if parsed.is_directory then path = path .. "/" end
+ end
+ else
+ for i = 1, n-1 do
+ path = path .. protect_segment(parsed[i])
+ path = path .. "/"
+ end
+ if n > 0 then
+ path = path .. protect_segment(parsed[n])
+ if parsed.is_directory then path = path .. "/" end
+ end
+ end
+ if parsed.is_absolute then path = "/" .. path end
+ return path
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/url_lua.c b/Build/source/texk/web2c/luatexdir/luasocket/src/url_lua.c
new file mode 100644
index 00000000000..7b4a6e799c0
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/url_lua.c
@@ -0,0 +1,540 @@
+/*
+ * This file is auto-generated by "./lua2c url.lua url_lua"
+ */
+
+#include "lua.h"
+#include "lauxlib.h"
+
+int luatex_url_lua_open (lua_State *L) {
+ static unsigned char B[] = {
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45,
+ 32, 85, 82, 73, 32,112, 97,114,115,105,110,103, 44, 32, 99,111,109,112,111,115,
+105,116,105,111,110, 32, 97,110,100, 32,114,101,108, 97,116,105,118,101, 32, 85,
+ 82, 76, 32,114,101,115,111,108,117,116,105,111,110, 10, 45, 45, 32, 76,117, 97,
+ 83,111, 99,107,101,116, 32,116,111,111,108,107,105,116, 46, 10, 45, 45, 32, 65,
+117,116,104,111,114, 58, 32, 68,105,101,103,111, 32, 78,101,104, 97, 98, 10, 45,
+ 45, 32, 82, 67, 83, 32, 73, 68, 58, 32, 36, 73,100, 58, 32,117,114,108, 46,108,
+117, 97, 44,118, 32, 49, 46, 51, 56, 32, 50, 48, 48, 54, 47, 48, 52, 47, 48, 51,
+ 32, 48, 52, 58, 52, 53, 58, 52, 50, 32,100,105,101,103,111, 32, 69,120,112, 32,
+ 36, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,
+ 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45,
+ 45, 32, 68,101, 99,108, 97,114,101, 32,109,111,100,117,108,101, 10, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108,
+ 32,115,116,114,105,110,103, 32, 61, 32,114,101,113,117,105,114,101, 40, 34,115,
+116,114,105,110,103, 34, 41, 10,108,111, 99, 97,108, 32, 98, 97,115,101, 32, 61,
+ 32, 95, 71, 10,108,111, 99, 97,108, 32,116, 97, 98,108,101, 32, 61, 32,114,101,
+113,117,105,114,101, 40, 34,116, 97, 98,108,101, 34, 41, 10,109,111,100,117,108,
+101, 40, 34,115,111, 99,107,101,116, 46,117,114,108, 34, 41, 10, 10, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 77,111,
+100,117,108,101, 32,118,101,114,115,105,111,110, 10, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 95, 86, 69, 82, 83, 73, 79, 78, 32,
+ 61, 32, 34, 85, 82, 76, 32, 49, 46, 48, 46, 49, 34, 10, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 69,110, 99,111,
+100,101,115, 32, 97, 32,115,116,114,105,110,103, 32,105,110,116,111, 32,105,116,
+115, 32,101,115, 99, 97,112,101,100, 32,104,101,120, 97,100,101, 99,105,109, 97,
+108, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110, 10, 45, 45, 32,
+ 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, 98,105,110, 97,114,121,
+ 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32,101,110, 99,111,100,101,
+100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, 32,101,115,
+ 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110,
+ 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, 97,114,121, 10, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99,
+116,105,111,110, 32,101,115, 99, 97,112,101, 40,115, 41, 10, 32, 32, 32, 32,114,
+101,116,117,114,110, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,115, 44,
+ 32, 34, 40, 91, 94, 65, 45, 90, 97, 45,122, 48, 45, 57, 95, 93, 41, 34, 44, 32,
+102,117,110, 99,116,105,111,110, 40, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116,
+ 40, 34, 37, 37, 37, 48, 50,120, 34, 44, 32,115,116,114,105,110,103, 46, 98,121,
+116,101, 40, 99, 41, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10,101,110,100, 10,
+ 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45,
+ 45, 32, 80,114,111,116,101, 99,116,115, 32, 97, 32,112, 97,116,104, 32,115,101,
+103,109,101,110,116, 44, 32,116,111, 32,112,114,101,118,101,110,116, 32,105,116,
+ 32,102,114,111,109, 32,105,110,116,101,114,102,101,114,105,110,103, 32,119,105,
+116,104, 32,116,104,101, 10, 45, 45, 32,117,114,108, 32,112, 97,114,115,105,110,
+103, 46, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32,
+ 98,105,110, 97,114,121, 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32,
+101,110, 99,111,100,101,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45,
+ 45, 32, 32, 32,101,115, 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110,
+116, 97,116,105,111,110, 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110,
+ 97,114,121, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110, 32,109, 97,107,
+101, 95,115,101,116, 40,116, 41, 10, 9,108,111, 99, 97,108, 32,115, 32, 61, 32,
+123,125, 10, 9,102,111,114, 32,105, 44,118, 32,105,110, 32, 98, 97,115,101, 46,
+105,112, 97,105,114,115, 40,116, 41, 32,100,111, 10, 9, 9,115, 91,116, 91,105,
+ 93, 93, 32, 61, 32, 49, 10, 9,101,110,100, 10, 9,114,101,116,117,114,110, 32,
+115, 10,101,110,100, 10, 10, 45, 45, 32,116,104,101,115,101, 32, 97,114,101, 32,
+ 97,108,108,111,119,101,100, 32,119,105,116,104,105,110,103, 32, 97, 32,112, 97,
+116,104, 32,115,101,103,109,101,110,116, 44, 32, 97,108,111,110,103, 32,119,105,
+116,104, 32, 97,108,112,104, 97,110,117,109, 10, 45, 45, 32,111,116,104,101,114,
+ 32, 99,104, 97,114, 97, 99,116,101,114,115, 32,109,117,115,116, 32, 98,101, 32,
+101,115, 99, 97,112,101,100, 10,108,111, 99, 97,108, 32,115,101,103,109,101,110,
+116, 95,115,101,116, 32, 61, 32,109, 97,107,101, 95,115,101,116, 32,123, 10, 32,
+ 32, 32, 32, 34, 45, 34, 44, 32, 34, 95, 34, 44, 32, 34, 46, 34, 44, 32, 34, 33,
+ 34, 44, 32, 34,126, 34, 44, 32, 34, 42, 34, 44, 32, 34, 39, 34, 44, 32, 34, 40,
+ 34, 44, 10, 9, 34, 41, 34, 44, 32, 34, 58, 34, 44, 32, 34, 64, 34, 44, 32, 34,
+ 38, 34, 44, 32, 34, 61, 34, 44, 32, 34, 43, 34, 44, 32, 34, 36, 34, 44, 32, 34,
+ 44, 34, 44, 10,125, 10, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,
+110, 32,112,114,111,116,101, 99,116, 95,115,101,103,109,101,110,116, 40,115, 41,
+ 10, 9,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,103,115,117, 98,
+ 40,115, 44, 32, 34, 40, 91, 94, 65, 45, 90, 97, 45,122, 48, 45, 57, 95, 93, 41,
+ 34, 44, 32,102,117,110, 99,116,105,111,110, 32, 40, 99, 41, 10, 9, 9,105,102,
+ 32,115,101,103,109,101,110,116, 95,115,101,116, 91, 99, 93, 32,116,104,101,110,
+ 32,114,101,116,117,114,110, 32, 99, 10, 9, 9,101,108,115,101, 32,114,101,116,
+117,114,110, 32,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 34, 37,
+ 37, 37, 48, 50,120, 34, 44, 32,115,116,114,105,110,103, 46, 98,121,116,101, 40,
+ 99, 41, 41, 32,101,110,100, 10, 9,101,110,100, 41, 10,101,110,100, 10, 10, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32,
+ 69,110, 99,111,100,101,115, 32, 97, 32,115,116,114,105,110,103, 32,105,110,116,
+111, 32,105,116,115, 32,101,115, 99, 97,112,101,100, 32,104,101,120, 97,100,101,
+ 99,105,109, 97,108, 32,114,101,112,114,101,115,101,110,116, 97,116,105,111,110,
+ 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,115, 58, 32, 98,105,
+110, 97,114,121, 32,115,116,114,105,110,103, 32,116,111, 32, 98,101, 32,101,110,
+ 99,111,100,101,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32,
+ 32, 32,101,115, 99, 97,112,101,100, 32,114,101,112,114,101,115,101,110,116, 97,
+116,105,111,110, 32,111,102, 32,115,116,114,105,110,103, 32, 98,105,110, 97,114,
+121, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,
+102,117,110, 99,116,105,111,110, 32,117,110,101,115, 99, 97,112,101, 40,115, 41,
+ 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46,103,
+115,117, 98, 40,115, 44, 32, 34, 37, 37, 40, 37,120, 37,120, 41, 34, 44, 32,102,
+117,110, 99,116,105,111,110, 40,104,101,120, 41, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,114,101,116,117,114,110, 32,115,116,114,105,110,103, 46, 99,104, 97,114, 40,
+ 98, 97,115,101, 46,116,111,110,117,109, 98,101,114, 40,104,101,120, 44, 32, 49,
+ 54, 41, 41, 10, 32, 32, 32, 32,101,110,100, 41, 10,101,110,100, 10, 10, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 66,
+117,105,108,100,115, 32, 97, 32,112, 97,116,104, 32,102,114,111,109, 32, 97, 32,
+ 98, 97,115,101, 32,112, 97,116,104, 32, 97,110,100, 32, 97, 32,114,101,108, 97,
+116,105,118,101, 32,112, 97,116,104, 10, 45, 45, 32, 73,110,112,117,116, 10, 45,
+ 45, 32, 32, 32, 98, 97,115,101, 95,112, 97,116,104, 10, 45, 45, 32, 32, 32,114,
+101,108, 97,116,105,118,101, 95,112, 97,116,104, 10, 45, 45, 32, 82,101,116,117,
+114,110,115, 10, 45, 45, 32, 32, 32, 99,111,114,114,101,115,112,111,110,100,105,
+110,103, 32, 97, 98,115,111,108,117,116,101, 32,112, 97,116,104, 10, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,108,111, 99, 97,108,
+ 32,102,117,110, 99,116,105,111,110, 32, 97, 98,115,111,108,117,116,101, 95,112,
+ 97,116,104, 40, 98, 97,115,101, 95,112, 97,116,104, 44, 32,114,101,108, 97,116,
+105,118,101, 95,112, 97,116,104, 41, 10, 32, 32, 32, 32,105,102, 32,115,116,114,
+105,110,103, 46,115,117, 98, 40,114,101,108, 97,116,105,118,101, 95,112, 97,116,
+104, 44, 32, 49, 44, 32, 49, 41, 32, 61, 61, 32, 34, 47, 34, 32,116,104,101,110,
+ 32,114,101,116,117,114,110, 32,114,101,108, 97,116,105,118,101, 95,112, 97,116,
+104, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,116,104,
+ 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 98, 97,115,101, 95,
+112, 97,116,104, 44, 32, 34, 91, 94, 47, 93, 42, 36, 34, 44, 32, 34, 34, 41, 10,
+ 32, 32, 32, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32,114,
+101,108, 97,116,105,118,101, 95,112, 97,116,104, 10, 32, 32, 32, 32,112, 97,116,
+104, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104,
+ 44, 32, 34, 40, 91, 94, 47, 93, 42, 37, 46, 47, 41, 34, 44, 32,102,117,110, 99,
+116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,
+115, 32,126, 61, 32, 34, 46, 47, 34, 32,116,104,101,110, 32,114,101,116,117,114,
+110, 32,115, 32,101,108,115,101, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,
+110,100, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, 32, 32, 32,112, 97,116,104,
+ 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, 44,
+ 32, 34, 47, 37, 46, 36, 34, 44, 32, 34, 47, 34, 41, 10, 32, 32, 32, 32,108,111,
+ 99, 97,108, 32,114,101,100,117, 99,101,100, 10, 32, 32, 32, 32,119,104,105,108,
+101, 32,114,101,100,117, 99,101,100, 32,126, 61, 32,112, 97,116,104, 32,100,111,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,100,117, 99,101,100, 32, 61, 32,112,
+ 97,116,104, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,116,104, 32, 61, 32,115,
+116,114,105,110,103, 46,103,115,117, 98, 40,114,101,100,117, 99,101,100, 44, 32,
+ 34, 40, 91, 94, 47, 93, 42, 47, 37, 46, 37, 46, 47, 41, 34, 44, 32,102,117,110,
+ 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32,105,102, 32,115, 32,126, 61, 32, 34, 46, 46, 47, 46, 46, 47, 34, 32,116,
+104,101,110, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,108,115,101, 32,114,
+101,116,117,114,110, 32,115, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+101,110,100, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,112, 97,116,
+104, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,114,101,100,117,
+ 99,101,100, 44, 32, 34, 40, 91, 94, 47, 93, 42, 47, 37, 46, 37, 46, 41, 36, 34,
+ 44, 32,102,117,110, 99,116,105,111,110, 32, 40,115, 41, 10, 32, 32, 32, 32, 32,
+ 32, 32, 32,105,102, 32,115, 32,126, 61, 32, 34, 46, 46, 47, 46, 46, 34, 32,116,
+104,101,110, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,108,115,101, 32,114,
+101,116,117,114,110, 32,115, 32,101,110,100, 10, 32, 32, 32, 32,101,110,100, 41,
+ 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97,116,104, 10,101,110,100,
+ 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,
+ 45, 45, 32, 80, 97,114,115,101,115, 32, 97, 32,117,114,108, 32, 97,110,100, 32,
+114,101,116,117,114,110,115, 32, 97, 32,116, 97, 98,108,101, 32,119,105,116,104,
+ 32, 97,108,108, 32,105,116,115, 32,112, 97,114,116,115, 32, 97, 99, 99,111,114,
+100,105,110,103, 32,116,111, 32, 82, 70, 67, 32, 50, 51, 57, 54, 10, 45, 45, 32,
+ 84,104,101, 32,102,111,108,108,111,119,105,110,103, 32,103,114, 97,109,109, 97,
+114, 32,100,101,115, 99,114,105, 98,101,115, 32,116,104,101, 32,110, 97,109,101,
+115, 32,103,105,118,101,110, 32,116,111, 32,116,104,101, 32, 85, 82, 76, 32,112,
+ 97,114,116,115, 10, 45, 45, 32, 60,117,114,108, 62, 32, 58, 58, 61, 32, 60,115,
+ 99,104,101,109,101, 62, 58, 47, 47, 60, 97,117,116,104,111,114,105,116,121, 62,
+ 47, 60,112, 97,116,104, 62, 59, 60,112, 97,114, 97,109,115, 62, 63, 60,113,117,
+101,114,121, 62, 35, 60,102,114, 97,103,109,101,110,116, 62, 10, 45, 45, 32, 60,
+ 97,117,116,104,111,114,105,116,121, 62, 32, 58, 58, 61, 32, 60,117,115,101,114,
+105,110,102,111, 62, 64, 60,104,111,115,116, 62, 58, 60,112,111,114,116, 62, 10,
+ 45, 45, 32, 60,117,115,101,114,105,110,102,111, 62, 32, 58, 58, 61, 32, 60,117,
+115,101,114, 62, 91, 58, 60,112, 97,115,115,119,111,114,100, 62, 93, 10, 45, 45,
+ 32, 60,112, 97,116,104, 62, 32, 58, 58, 32, 61, 32,123, 60,115,101,103,109,101,
+110,116, 62, 47,125, 60,115,101,103,109,101,110,116, 62, 10, 45, 45, 32, 73,110,
+112,117,116, 10, 45, 45, 32, 32, 32,117,114,108, 58, 32,117,110,105,102,111,114,
+109, 32,114,101,115,111,117,114, 99,101, 32,108,111, 99, 97,116,111,114, 32,111,
+102, 32,114,101,113,117,101,115,116, 10, 45, 45, 32, 32, 32,100,101,102, 97,117,
+108,116, 58, 32,116, 97, 98,108,101, 32,119,105,116,104, 32,100,101,102, 97,117,
+108,116, 32,118, 97,108,117,101,115, 32,102,111,114, 32,101, 97, 99,104, 32,102,
+105,101,108,100, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32,
+ 32,116, 97, 98,108,101, 32,119,105,116,104, 32,116,104,101, 32,102,111,108,108,
+111,119,105,110,103, 32,102,105,101,108,100,115, 44, 32,119,104,101,114,101, 32,
+ 82, 70, 67, 32,110, 97,109,105,110,103, 32, 99,111,110,118,101,110,116,105,111,
+110,115, 32,104, 97,118,101, 10, 45, 45, 32, 32, 32, 98,101,101,110, 32,112,114,
+101,115,101,114,118,101,100, 58, 10, 45, 45, 32, 32, 32, 32, 32,115, 99,104,101,
+109,101, 44, 32, 97,117,116,104,111,114,105,116,121, 44, 32,117,115,101,114,105,
+110,102,111, 44, 32,117,115,101,114, 44, 32,112, 97,115,115,119,111,114,100, 44,
+ 32,104,111,115,116, 44, 32,112,111,114,116, 44, 10, 45, 45, 32, 32, 32, 32, 32,
+112, 97,116,104, 44, 32,112, 97,114, 97,109,115, 44, 32,113,117,101,114,121, 44,
+ 32,102,114, 97,103,109,101,110,116, 10, 45, 45, 32, 79, 98,115, 58, 10, 45, 45,
+ 32, 32, 32,116,104,101, 32,108,101, 97,100,105,110,103, 32, 39, 47, 39, 32,105,
+110, 32,123, 47, 60,112, 97,116,104, 62,125, 32,105,115, 32, 99,111,110,115,105,
+100,101,114,101,100, 32,112, 97,114,116, 32,111,102, 32, 60,112, 97,116,104, 62,
+ 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,
+117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 40,117,114,108, 44, 32,100,
+101,102, 97,117,108,116, 41, 10, 32, 32, 32, 32, 45, 45, 32,105,110,105,116,105,
+ 97,108,105,122,101, 32,100,101,102, 97,117,108,116, 32,112, 97,114, 97,109,101,
+116,101,114,115, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,112, 97,114,115,101,
+100, 32, 61, 32,123,125, 10, 32, 32, 32, 32,102,111,114, 32,105, 44,118, 32,105,
+110, 32, 98, 97,115,101, 46,112, 97,105,114,115, 40,100,101,102, 97,117,108,116,
+ 32,111,114, 32,112, 97,114,115,101,100, 41, 32,100,111, 32,112, 97,114,115,101,
+100, 91,105, 93, 32, 61, 32,118, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,
+101,109,112,116,121, 32,117,114,108, 32,105,115, 32,112, 97,114,115,101,100, 32,
+116,111, 32,110,105,108, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,117,114,
+108, 32,111,114, 32,117,114,108, 32, 61, 61, 32, 34, 34, 32,116,104,101,110, 32,
+114,101,116,117,114,110, 32,110,105,108, 44, 32, 34,105,110,118, 97,108,105,100,
+ 32,117,114,108, 34, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,114,101,109,
+111,118,101, 32,119,104,105,116,101,115,112, 97, 99,101, 10, 32, 32, 32, 32, 45,
+ 45, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,
+117,114,108, 44, 32, 34, 37,115, 34, 44, 32, 34, 34, 41, 10, 32, 32, 32, 32, 45,
+ 45, 32,103,101,116, 32,102,114, 97,103,109,101,110,116, 10, 32, 32, 32, 32,117,
+114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,114,108,
+ 44, 32, 34, 35, 40, 46, 42, 41, 36, 34, 44, 32,102,117,110, 99,116,105,111,110,
+ 40,102, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115,101,100, 46,102,
+114, 97,103,109,101,110,116, 32, 61, 32,102, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32,
+ 32, 32, 32, 45, 45, 32,103,101,116, 32,115, 99,104,101,109,101, 10, 32, 32, 32,
+ 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,
+114,108, 44, 32, 34, 94, 40, 91, 37,119, 93, 91, 37,119, 37, 43, 37, 45, 37, 46,
+ 93, 42, 41, 37, 58, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,102,117,110, 99,
+116,105,111,110, 40,115, 41, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109,
+101, 32, 61, 32,115, 59, 32,114,101,116,117,114,110, 32, 34, 34, 32,101,110,100,
+ 41, 10, 32, 32, 32, 32, 45, 45, 32,103,101,116, 32, 97,117,116,104,111,114,105,
+116,121, 10, 32, 32, 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,
+103,115,117, 98, 40,117,114,108, 44, 32, 34, 94, 47, 47, 40, 91, 94, 47, 93, 42,
+ 41, 34, 44, 32,102,117,110, 99,116,105,111,110, 40,110, 41, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32,112, 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121,
+ 32, 61, 32,110, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32,
+ 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10, 32, 32, 32, 32, 45, 45, 32,103,
+101,116, 32,113,117,101,114,121, 32,115,116,114,105,110,103,105,110,103, 10, 32,
+ 32, 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98,
+ 40,117,114,108, 44, 32, 34, 37, 63, 40, 46, 42, 41, 34, 44, 32,102,117,110, 99,
+116,105,111,110, 40,113, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115,
+101,100, 46,113,117,101,114,121, 32, 61, 32,113, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10,
+ 32, 32, 32, 32, 45, 45, 32,103,101,116, 32,112, 97,114, 97,109,115, 10, 32, 32,
+ 32, 32,117,114,108, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,
+117,114,108, 44, 32, 34, 37, 59, 40, 46, 42, 41, 34, 44, 32,102,117,110, 99,116,
+105,111,110, 40,112, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32,112, 97,114,115,101,
+100, 46,112, 97,114, 97,109,115, 32, 61, 32,112, 10, 32, 32, 32, 32, 32, 32, 32,
+ 32,114,101,116,117,114,110, 32, 34, 34, 10, 32, 32, 32, 32,101,110,100, 41, 10,
+ 32, 32, 32, 32, 45, 45, 32,112, 97,116,104, 32,105,115, 32,119,104, 97,116,101,
+118,101,114, 32,119, 97,115, 32,108,101,102,116, 10, 32, 32, 32, 32,105,102, 32,
+117,114,108, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32,112, 97,114,115,101,
+100, 46,112, 97,116,104, 32, 61, 32,117,114,108, 32,101,110,100, 10, 32, 32, 32,
+ 32,108,111, 99, 97,108, 32, 97,117,116,104,111,114,105,116,121, 32, 61, 32,112,
+ 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, 10, 32, 32, 32, 32,
+105,102, 32,110,111,116, 32, 97,117,116,104,111,114,105,116,121, 32,116,104,101,
+110, 32,114,101,116,117,114,110, 32,112, 97,114,115,101,100, 32,101,110,100, 10,
+ 32, 32, 32, 32, 97,117,116,104,111,114,105,116,121, 32, 61, 32,115,116,114,105,
+110,103, 46,103,115,117, 98, 40, 97,117,116,104,111,114,105,116,121, 44, 34, 94,
+ 40, 91, 94, 64, 93, 42, 41, 64, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32,102,
+117,110, 99,116,105,111,110, 40,117, 41, 32,112, 97,114,115,101,100, 46,117,115,
+101,114,105,110,102,111, 32, 61, 32,117, 59, 32,114,101,116,117,114,110, 32, 34,
+ 34, 32,101,110,100, 41, 10, 32, 32, 32, 32, 97,117,116,104,111,114,105,116,121,
+ 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40, 97,117,116,104,111,
+114,105,116,121, 44, 32, 34, 58, 40, 91, 94, 58, 93, 42, 41, 36, 34, 44, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 40,112, 41, 32,112,
+ 97,114,115,101,100, 46,112,111,114,116, 32, 61, 32,112, 59, 32,114,101,116,117,
+114,110, 32, 34, 34, 32,101,110,100, 41, 10, 32, 32, 32, 32,105,102, 32, 97,117,
+116,104,111,114,105,116,121, 32,126, 61, 32, 34, 34, 32,116,104,101,110, 32,112,
+ 97,114,115,101,100, 46,104,111,115,116, 32, 61, 32, 97,117,116,104,111,114,105,
+116,121, 32,101,110,100, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117,115,101,
+114,105,110,102,111, 32, 61, 32,112, 97,114,115,101,100, 46,117,115,101,114,105,
+110,102,111, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32,117,115,101,114,105,
+110,102,111, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,112, 97,114,115,
+101,100, 32,101,110,100, 10, 32, 32, 32, 32,117,115,101,114,105,110,102,111, 32,
+ 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,115,101,114,105,110,
+102,111, 44, 32, 34, 58, 40, 91, 94, 58, 93, 42, 41, 36, 34, 44, 10, 32, 32, 32,
+ 32, 32, 32, 32, 32,102,117,110, 99,116,105,111,110, 40,112, 41, 32,112, 97,114,
+115,101,100, 46,112, 97,115,115,119,111,114,100, 32, 61, 32,112, 59, 32,114,101,
+116,117,114,110, 32, 34, 34, 32,101,110,100, 41, 10, 32, 32, 32, 32,112, 97,114,
+115,101,100, 46,117,115,101,114, 32, 61, 32,117,115,101,114,105,110,102,111, 10,
+ 32, 32, 32, 32,114,101,116,117,114,110, 32,112, 97,114,115,101,100, 10,101,110,
+100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 10, 45, 45, 32, 82,101, 98,117,105,108,100,115, 32, 97, 32,112, 97,114,115,101,
+100, 32, 85, 82, 76, 32,102,114,111,109, 32,105,116,115, 32, 99,111,109,112,111,
+110,101,110,116,115, 46, 10, 45, 45, 32, 67,111,109,112,111,110,101,110,116,115,
+ 32, 97,114,101, 32,112,114,111,116,101, 99,116,101,100, 32,105,102, 32, 97,110,
+121, 32,114,101,115,101,114,118,101,100, 32,111,114, 32,117,110, 97,108,108,111,
+119,101,100, 32, 99,104, 97,114, 97, 99,116,101,114,115, 32, 97,114,101, 32,102,
+111,117,110,100, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,112,
+ 97,114,115,101,100, 58, 32,112, 97,114,115,101,100, 32, 85, 82, 76, 44, 32, 97,
+115, 32,114,101,116,117,114,110,101,100, 32, 98,121, 32,112, 97,114,115,101, 10,
+ 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32, 32, 97, 32,115,116,
+114,105,110,103,105,110,103, 32,119,105,116,104, 32,116,104,101, 32, 99,111,114,
+114,101,115,112,111,110,100,105,110,103, 32, 85, 82, 76, 10, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,
+110, 32, 98,117,105,108,100, 40,112, 97,114,115,101,100, 41, 10, 32, 32, 32, 32,
+108,111, 99, 97,108, 32,112,112, 97,116,104, 32, 61, 32,112, 97,114,115,101, 95,
+112, 97,116,104, 40,112, 97,114,115,101,100, 46,112, 97,116,104, 32,111,114, 32,
+ 34, 34, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,117,114,108, 32, 61, 32,
+ 98,117,105,108,100, 95,112, 97,116,104, 40,112,112, 97,116,104, 41, 10, 32, 32,
+ 32, 32,105,102, 32,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,116,
+104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, 32, 34, 59, 34,
+ 32, 46, 46, 32,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,101,110,
+100, 10, 32, 32, 32, 32,105,102, 32,112, 97,114,115,101,100, 46,113,117,101,114,
+121, 32,116,104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46, 32,
+ 34, 63, 34, 32, 46, 46, 32,112, 97,114,115,101,100, 46,113,117,101,114,121, 32,
+101,110,100, 10, 9,108,111, 99, 97,108, 32, 97,117,116,104,111,114,105,116,121,
+ 32, 61, 32,112, 97,114,115,101,100, 46, 97,117,116,104,111,114,105,116,121, 10,
+ 9,105,102, 32,112, 97,114,115,101,100, 46,104,111,115,116, 32,116,104,101,110,
+ 10, 9, 9, 97,117,116,104,111,114,105,116,121, 32, 61, 32,112, 97,114,115,101,
+100, 46,104,111,115,116, 10, 9, 9,105,102, 32,112, 97,114,115,101,100, 46,112,
+111,114,116, 32,116,104,101,110, 32, 97,117,116,104,111,114,105,116,121, 32, 61,
+ 32, 97,117,116,104,111,114,105,116,121, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46,
+ 32,112, 97,114,115,101,100, 46,112,111,114,116, 32,101,110,100, 10, 9, 9,108,
+111, 99, 97,108, 32,117,115,101,114,105,110,102,111, 32, 61, 32,112, 97,114,115,
+101,100, 46,117,115,101,114,105,110,102,111, 10, 9, 9,105,102, 32,112, 97,114,
+115,101,100, 46,117,115,101,114, 32,116,104,101,110, 10, 9, 9, 9,117,115,101,
+114,105,110,102,111, 32, 61, 32,112, 97,114,115,101,100, 46,117,115,101,114, 10,
+ 9, 9, 9,105,102, 32,112, 97,114,115,101,100, 46,112, 97,115,115,119,111,114,
+100, 32,116,104,101,110, 10, 9, 9, 9, 9,117,115,101,114,105,110,102,111, 32,
+ 61, 32,117,115,101,114,105,110,102,111, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46,
+ 32,112, 97,114,115,101,100, 46,112, 97,115,115,119,111,114,100, 10, 9, 9, 9,
+101,110,100, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32,117,115,101,114,105,
+110,102,111, 32,116,104,101,110, 32, 97,117,116,104,111,114,105,116,121, 32, 61,
+ 32,117,115,101,114,105,110,102,111, 32, 46, 46, 32, 34, 64, 34, 32, 46, 46, 32,
+ 97,117,116,104,111,114,105,116,121, 32,101,110,100, 10, 9,101,110,100, 10, 32,
+ 32, 32, 32,105,102, 32, 97,117,116,104,111,114,105,116,121, 32,116,104,101,110,
+ 32,117,114,108, 32, 61, 32, 34, 47, 47, 34, 32, 46, 46, 32, 97,117,116,104,111,
+114,105,116,121, 32, 46, 46, 32,117,114,108, 32,101,110,100, 10, 32, 32, 32, 32,
+105,102, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109,101, 32,116,104,101,
+110, 32,117,114,108, 32, 61, 32,112, 97,114,115,101,100, 46,115, 99,104,101,109,
+101, 32, 46, 46, 32, 34, 58, 34, 32, 46, 46, 32,117,114,108, 32,101,110,100, 10,
+ 32, 32, 32, 32,105,102, 32,112, 97,114,115,101,100, 46,102,114, 97,103,109,101,
+110,116, 32,116,104,101,110, 32,117,114,108, 32, 61, 32,117,114,108, 32, 46, 46,
+ 32, 34, 35, 34, 32, 46, 46, 32,112, 97,114,115,101,100, 46,102,114, 97,103,109,
+101,110,116, 32,101,110,100, 10, 32, 32, 32, 32, 45, 45, 32,117,114,108, 32, 61,
+ 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,117,114,108, 44, 32, 34, 37,
+115, 34, 44, 32, 34, 34, 41, 10, 32, 32, 32, 32,114,101,116,117,114,110, 32,117,
+114,108, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 10, 45, 45, 32, 66,117,105,108,100,115, 32, 97, 32, 97, 98,
+115,111,108,117,116,101, 32, 85, 82, 76, 32,102,114,111,109, 32, 97, 32, 98, 97,
+115,101, 32, 97,110,100, 32, 97, 32,114,101,108, 97,116,105,118,101, 32, 85, 82,
+ 76, 32, 97, 99, 99,111,114,100,105,110,103, 32,116,111, 32, 82, 70, 67, 32, 50,
+ 51, 57, 54, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32, 98, 97,
+115,101, 95,117,114,108, 10, 45, 45, 32, 32, 32,114,101,108, 97,116,105,118,101,
+ 95,117,114,108, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45, 32, 32,
+ 32, 99,111,114,114,101,115,112,111,110,100,105,110,103, 32, 97, 98,115,111,108,
+117,116,101, 32,117,114,108, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, 32, 97, 98,115,111,108,
+117,116,101, 40, 98, 97,115,101, 95,117,114,108, 44, 32,114,101,108, 97,116,105,
+118,101, 95,117,114,108, 41, 10, 32, 32, 32, 32,105,102, 32, 98, 97,115,101, 46,
+116,121,112,101, 40, 98, 97,115,101, 95,117,114,108, 41, 32, 61, 61, 32, 34,116,
+ 97, 98,108,101, 34, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98,
+ 97,115,101, 95,112, 97,114,115,101,100, 32, 61, 32, 98, 97,115,101, 95,117,114,
+108, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,101, 95,117,114,108, 32, 61,
+ 32, 98,117,105,108,100, 40, 98, 97,115,101, 95,112, 97,114,115,101,100, 41, 10,
+ 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 98, 97,115,
+101, 95,112, 97,114,115,101,100, 32, 61, 32,112, 97,114,115,101, 40, 98, 97,115,
+101, 95,117,114,108, 41, 10, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32,108,
+111, 99, 97,108, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100,
+ 32, 61, 32,112, 97,114,115,101, 40,114,101,108, 97,116,105,118,101, 95,117,114,
+108, 41, 10, 32, 32, 32, 32,105,102, 32,110,111,116, 32, 98, 97,115,101, 95,112,
+ 97,114,115,101,100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,114,101,
+108, 97,116,105,118,101, 95,117,114,108, 10, 32, 32, 32, 32,101,108,115,101,105,
+102, 32,110,111,116, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,
+100, 32,116,104,101,110, 32,114,101,116,117,114,110, 32, 98, 97,115,101, 95,117,
+114,108, 10, 32, 32, 32, 32,101,108,115,101,105,102, 32,114,101,108, 97,116,105,
+118,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101,109,101, 32,116,104,101,
+110, 32,114,101,116,117,114,110, 32,114,101,108, 97,116,105,118,101, 95,117,114,
+108, 10, 32, 32, 32, 32,101,108,115,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,114,
+101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101,109,
+101, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, 46,115, 99,104,101,
+109,101, 10, 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,
+108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46, 97,117,116,104,111,114,
+105,116,121, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46, 97,117,116,
+104,111,114,105,116,121, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100,
+ 46, 97,117,116,104,111,114,105,116,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116,105,118,101, 95,112,
+ 97,114,115,101,100, 46,112, 97,116,104, 32,116,104,101,110, 10, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101,
+ 95,112, 97,114,115,101,100, 46,112, 97,116,104, 32, 61, 32, 98, 97,115,101, 95,
+112, 97,114,115,101,100, 46,112, 97,116,104, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116,
+105,118,101, 95,112, 97,114,115,101,100, 46,112, 97,114, 97,109,115, 32,116,104,
+101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 46,112,
+ 97,114, 97,109,115, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100, 46,
+112, 97,114, 97,109,115, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,105,102, 32,110,111,116, 32,114,101,108, 97,116,105,
+118,101, 95,112, 97,114,115,101,100, 46,113,117,101,114,121, 32,116,104,101,110,
+ 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100,
+ 46,113,117,101,114,121, 32, 61, 32, 98, 97,115,101, 95,112, 97,114,115,101,100,
+ 46,113,117,101,114,121, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,101,108,115,101, 32, 32, 32, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,114,
+115,101,100, 46,112, 97,116,104, 32, 61, 32, 97, 98,115,111,108,117,116,101, 95,
+112, 97,116,104, 40, 98, 97,115,101, 95,112, 97,114,115,101,100, 46,112, 97,116,
+104, 32,111,114, 32, 34, 34, 44, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32,114,101,108, 97,116,105,118,101, 95,112, 97,
+114,115,101,100, 46,112, 97,116,104, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32,101,110,100, 10, 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, 32,
+ 32, 32, 32, 32, 32, 32, 32,114,101,116,117,114,110, 32, 98,117,105,108,100, 40,
+114,101,108, 97,116,105,118,101, 95,112, 97,114,115,101,100, 41, 10, 32, 32, 32,
+ 32,101,110,100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 10, 45, 45, 32, 66,114,101, 97,107,115, 32, 97, 32,
+112, 97,116,104, 32,105,110,116,111, 32,105,116,115, 32,115,101,103,109,101,110,
+116,115, 44, 32,117,110,101,115, 99, 97,112,105,110,103, 32,116,104,101, 32,115,
+101,103,109,101,110,116,115, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32,
+ 32, 32,112, 97,116,104, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45, 45,
+ 32, 32, 32,115,101,103,109,101,110,116, 58, 32, 97, 32,116, 97, 98,108,101, 32,
+119,105,116,104, 32,111,110,101, 32,101,110,116,114,121, 32,112,101,114, 32,115,
+101,103,109,101,110,116, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 10,102,117,110, 99,116,105,111,110, 32,112, 97,114,115,101, 95,
+112, 97,116,104, 40,112, 97,116,104, 41, 10, 9,108,111, 99, 97,108, 32,112, 97,
+114,115,101,100, 32, 61, 32,123,125, 10, 9,112, 97,116,104, 32, 61, 32,112, 97,
+116,104, 32,111,114, 32, 34, 34, 10, 9, 45, 45,112, 97,116,104, 32, 61, 32,115,
+116,114,105,110,103, 46,103,115,117, 98, 40,112, 97,116,104, 44, 32, 34, 37,115,
+ 34, 44, 32, 34, 34, 41, 10, 9,115,116,114,105,110,103, 46,103,115,117, 98, 40,
+112, 97,116,104, 44, 32, 34, 40, 91, 94, 47, 93, 43, 41, 34, 44, 32,102,117,110,
+ 99,116,105,111,110, 32, 40,115, 41, 32,116, 97, 98,108,101, 46,105,110,115,101,
+114,116, 40,112, 97,114,115,101,100, 44, 32,115, 41, 32,101,110,100, 41, 10, 9,
+102,111,114, 32,105, 32, 61, 32, 49, 44, 32,116, 97, 98,108,101, 46,103,101,116,
+110, 40,112, 97,114,115,101,100, 41, 32,100,111, 10, 9, 9,112, 97,114,115,101,
+100, 91,105, 93, 32, 61, 32,117,110,101,115, 99, 97,112,101, 40,112, 97,114,115,
+101,100, 91,105, 93, 41, 10, 9,101,110,100, 10, 9,105,102, 32,115,116,114,105,
+110,103, 46,115,117, 98, 40,112, 97,116,104, 44, 32, 49, 44, 32, 49, 41, 32, 61,
+ 61, 32, 34, 47, 34, 32,116,104,101,110, 32,112, 97,114,115,101,100, 46,105,115,
+ 95, 97, 98,115,111,108,117,116,101, 32, 61, 32, 49, 32,101,110,100, 10, 9,105,
+102, 32,115,116,114,105,110,103, 46,115,117, 98, 40,112, 97,116,104, 44, 32, 45,
+ 49, 44, 32, 45, 49, 41, 32, 61, 61, 32, 34, 47, 34, 32,116,104,101,110, 32,112,
+ 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114,121, 32, 61,
+ 32, 49, 32,101,110,100, 10, 9,114,101,116,117,114,110, 32,112, 97,114,115,101,
+100, 10,101,110,100, 10, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 10, 45, 45, 32, 66,117,105,108,100,115, 32, 97, 32,112, 97,116,
+104, 32, 99,111,109,112,111,110,101,110,116, 32,102,114,111,109, 32,105,116,115,
+ 32,115,101,103,109,101,110,116,115, 44, 32,101,115, 99, 97,112,105,110,103, 32,
+112,114,111,116,101, 99,116,101,100, 32, 99,104, 97,114, 97, 99,116,101,114,115,
+ 46, 10, 45, 45, 32, 73,110,112,117,116, 10, 45, 45, 32, 32, 32,112, 97,114,115,
+101,100, 58, 32,112, 97,116,104, 32,115,101,103,109,101,110,116,115, 10, 45, 45,
+ 32, 32, 32,117,110,115, 97,102,101, 58, 32,105,102, 32,116,114,117,101, 44, 32,
+115,101,103,109,101,110,116,115, 32, 97,114,101, 32,110,111,116, 32,112,114,111,
+116,101, 99,116,101,100, 32, 98,101,102,111,114,101, 32,112, 97,116,104, 32,105,
+115, 32, 98,117,105,108,116, 10, 45, 45, 32, 82,101,116,117,114,110,115, 10, 45,
+ 45, 32, 32, 32,112, 97,116,104, 58, 32, 99,111,114,114,101,115,112,111,110,100,
+105,110,103, 32,112, 97,116,104, 32,115,116,114,105,110,103,105,110,103, 10, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10,102,117,110,
+ 99,116,105,111,110, 32, 98,117,105,108,100, 95,112, 97,116,104, 40,112, 97,114,
+115,101,100, 44, 32,117,110,115, 97,102,101, 41, 10, 9,108,111, 99, 97,108, 32,
+112, 97,116,104, 32, 61, 32, 34, 34, 10, 9,108,111, 99, 97,108, 32,110, 32, 61,
+ 32,116, 97, 98,108,101, 46,103,101,116,110, 40,112, 97,114,115,101,100, 41, 10,
+ 9,105,102, 32,117,110,115, 97,102,101, 32,116,104,101,110, 10, 9, 9,102,111,
+114, 32,105, 32, 61, 32, 49, 44, 32,110, 45, 49, 32,100,111, 10, 9, 9, 9,112,
+ 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32,112, 97,114,115,101,100,
+ 91,105, 93, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46,
+ 46, 32, 34, 47, 34, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32,110, 32, 62,
+ 32, 48, 32,116,104,101,110, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,
+116,104, 32, 46, 46, 32,112, 97,114,115,101,100, 91,110, 93, 10, 9, 9, 9,105,
+102, 32,112, 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114,
+121, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46,
+ 46, 32, 34, 47, 34, 32,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,108,115,
+101, 10, 9, 9,102,111,114, 32,105, 32, 61, 32, 49, 44, 32,110, 45, 49, 32,100,
+111, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46, 46, 32,
+112,114,111,116,101, 99,116, 95,115,101,103,109,101,110,116, 40,112, 97,114,115,
+101,100, 91,105, 93, 41, 10, 9, 9, 9,112, 97,116,104, 32, 61, 32,112, 97,116,
+104, 32, 46, 46, 32, 34, 47, 34, 10, 9, 9,101,110,100, 10, 9, 9,105,102, 32,
+110, 32, 62, 32, 48, 32,116,104,101,110, 10, 9, 9, 9,112, 97,116,104, 32, 61,
+ 32,112, 97,116,104, 32, 46, 46, 32,112,114,111,116,101, 99,116, 95,115,101,103,
+109,101,110,116, 40,112, 97,114,115,101,100, 91,110, 93, 41, 10, 9, 9, 9,105,
+102, 32,112, 97,114,115,101,100, 46,105,115, 95,100,105,114,101, 99,116,111,114,
+121, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32,112, 97,116,104, 32, 46,
+ 46, 32, 34, 47, 34, 32,101,110,100, 10, 9, 9,101,110,100, 10, 9,101,110,100,
+ 10, 9,105,102, 32,112, 97,114,115,101,100, 46,105,115, 95, 97, 98,115,111,108,
+117,116,101, 32,116,104,101,110, 32,112, 97,116,104, 32, 61, 32, 34, 47, 34, 32,
+ 46, 46, 32,112, 97,116,104, 32,101,110,100, 10, 9,114,101,116,117,114,110, 32,
+112, 97,116,104, 10,101,110,100, 10,
+ 0 };
+ return luaL_dostring(L, (const char*)B);
+} /* end of embedded lua code */
+
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/usocket.c b/Build/source/texk/web2c/luatexdir/luasocket/src/usocket.c
new file mode 100644
index 00000000000..40d7596227c
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/usocket.c
@@ -0,0 +1,377 @@
+/*=========================================================================*\
+* Socket compatibilization module for Unix
+* LuaSocket toolkit
+*
+* The code is now interrupt-safe.
+* The penalty of calling select to avoid busy-wait is only paid when
+* the I/O call fail in the first place.
+*
+* RCS ID: $Id: usocket.c,v 1.38 2007/10/13 23:55:20 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+#include <signal.h>
+
+#include "socket.h"
+
+#if defined(__sun__)
+#define HSTRERROR(A) "unknown host error"
+#else
+#define HSTRERROR(A) hstrerror(A)
+#endif
+
+
+/*-------------------------------------------------------------------------*\
+* Wait for readable/writable/connected socket with timeout
+\*-------------------------------------------------------------------------*/
+#ifdef SOCKET_POLL
+#include <sys/poll.h>
+
+#define WAITFD_R POLLIN
+#define WAITFD_W POLLOUT
+#define WAITFD_C (POLLIN|POLLOUT)
+int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
+ int ret;
+ struct pollfd pfd;
+ pfd.fd = *ps;
+ pfd.events = sw;
+ pfd.revents = 0;
+ if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */
+ do {
+ int t = (int)(timeout_getretry(tm)*1e3);
+ ret = poll(&pfd, 1, t >= 0? t: -1);
+ } while (ret == -1 && errno == EINTR);
+ if (ret == -1) return errno;
+ if (ret == 0) return IO_TIMEOUT;
+ if (sw == WAITFD_C && (pfd.revents & (POLLIN|POLLERR))) return IO_CLOSED;
+ return IO_DONE;
+}
+#else
+
+#define WAITFD_R 1
+#define WAITFD_W 2
+#define WAITFD_C (WAITFD_R|WAITFD_W)
+
+int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
+ int ret;
+ fd_set rfds, wfds, *rp, *wp;
+ struct timeval tv, *tp;
+ double t;
+ if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */
+ do {
+ /* must set bits within loop, because select may have modifed them */
+ rp = wp = NULL;
+ if (sw & WAITFD_R) { FD_ZERO(&rfds); FD_SET(*ps, &rfds); rp = &rfds; }
+ if (sw & WAITFD_W) { FD_ZERO(&wfds); FD_SET(*ps, &wfds); wp = &wfds; }
+ t = timeout_getretry(tm);
+ tp = NULL;
+ if (t >= 0.0) {
+ tv.tv_sec = (int)t;
+ tv.tv_usec = (int)((t-tv.tv_sec)*1.0e6);
+ tp = &tv;
+ }
+ ret = select(*ps+1, rp, wp, NULL, tp);
+ } while (ret == -1 && errno == EINTR);
+ if (ret == -1) return errno;
+ if (ret == 0) return IO_TIMEOUT;
+ if (sw == WAITFD_C && FD_ISSET(*ps, &rfds)) return IO_CLOSED;
+ return IO_DONE;
+}
+#endif
+
+
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int socket_open(void) {
+ /* instals a handler to ignore sigpipe or it will crash us */
+ signal(SIGPIPE, SIG_IGN);
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Close module
+\*-------------------------------------------------------------------------*/
+int socket_close(void) {
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Close and inutilize socket
+\*-------------------------------------------------------------------------*/
+void socket_destroy(p_socket ps) {
+ if (*ps != SOCKET_INVALID) {
+ socket_setblocking(ps);
+ close(*ps);
+ *ps = SOCKET_INVALID;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+* Select with timeout control
+\*-------------------------------------------------------------------------*/
+int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds,
+ p_timeout tm) {
+ int ret;
+ do {
+ struct timeval tv;
+ double t = timeout_getretry(tm);
+ tv.tv_sec = (int) t;
+ tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);
+ /* timeout = 0 means no wait */
+ ret = select(n, rfds, wfds, efds, t >= 0.0 ? &tv: NULL);
+ } while (ret < 0 && errno == EINTR);
+ return ret;
+}
+
+/*-------------------------------------------------------------------------*\
+* Creates and sets up a socket
+\*-------------------------------------------------------------------------*/
+int socket_create(p_socket ps, int domain, int type, int protocol) {
+ *ps = socket(domain, type, protocol);
+ if (*ps != SOCKET_INVALID) return IO_DONE;
+ else return errno;
+}
+
+/*-------------------------------------------------------------------------*\
+* Binds or returns error message
+\*-------------------------------------------------------------------------*/
+int socket_bind(p_socket ps, SA *addr, socklen_t len) {
+ int err = IO_DONE;
+ socket_setblocking(ps);
+ if (bind(*ps, addr, len) < 0) err = errno;
+ socket_setnonblocking(ps);
+ return err;
+}
+
+/*-------------------------------------------------------------------------*\
+*
+\*-------------------------------------------------------------------------*/
+int socket_listen(p_socket ps, int backlog) {
+ int err = IO_DONE;
+ socket_setblocking(ps);
+ if (listen(*ps, backlog)) err = errno;
+ socket_setnonblocking(ps);
+ return err;
+}
+
+/*-------------------------------------------------------------------------*\
+*
+\*-------------------------------------------------------------------------*/
+void socket_shutdown(p_socket ps, int how) {
+ socket_setblocking(ps);
+ shutdown(*ps, how);
+ socket_setnonblocking(ps);
+}
+
+/*-------------------------------------------------------------------------*\
+* Connects or returns error message
+\*-------------------------------------------------------------------------*/
+int socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) {
+ int err;
+ /* avoid calling on closed sockets */
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ /* call connect until done or failed without being interrupted */
+ do if (connect(*ps, addr, len) == 0) return IO_DONE;
+ while ((err = errno) == EINTR);
+ /* if connection failed immediately, return error code */
+ if (err != EINPROGRESS && err != EAGAIN) return err;
+ /* zero timeout case optimization */
+ if (timeout_iszero(tm)) return IO_TIMEOUT;
+ /* wait until we have the result of the connection attempt or timeout */
+ err = socket_waitfd(ps, WAITFD_C, tm);
+ if (err == IO_CLOSED) {
+ if (recv(*ps, (char *) &err, 0, 0) == 0) return IO_DONE;
+ else return errno;
+ } else return err;
+}
+
+/*-------------------------------------------------------------------------*\
+* Accept with timeout
+\*-------------------------------------------------------------------------*/
+int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len, p_timeout tm) {
+ SA daddr;
+ socklen_t dlen = sizeof(daddr);
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ if (!addr) addr = &daddr;
+ if (!len) len = &dlen;
+ for ( ;; ) {
+ int err;
+ if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID) return IO_DONE;
+ err = errno;
+ if (err == EINTR) continue;
+ if (err != EAGAIN && err != ECONNABORTED) return err;
+ if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
+ }
+ /* can't reach here */
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Send with timeout
+\*-------------------------------------------------------------------------*/
+int socket_send(p_socket ps, const char *data, size_t count,
+ size_t *sent, p_timeout tm)
+{
+ int err;
+ *sent = 0;
+ /* avoid making system calls on closed sockets */
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ /* loop until we send something or we give up on error */
+ for ( ;; ) {
+ long put = (long) send(*ps, data, count, 0);
+ /* if we sent anything, we are done */
+ if (put > 0) {
+ *sent = put;
+ return IO_DONE;
+ }
+ err = errno;
+ /* send can't really return 0, but EPIPE means the connection was
+ closed */
+ if (put == 0 || err == EPIPE) return IO_CLOSED;
+ /* we call was interrupted, just try again */
+ if (err == EINTR) continue;
+ /* if failed fatal reason, report error */
+ if (err != EAGAIN) return err;
+ /* wait until we can send something or we timeout */
+ if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;
+ }
+ /* can't reach here */
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Sendto with timeout
+\*-------------------------------------------------------------------------*/
+int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent,
+ SA *addr, socklen_t len, p_timeout tm)
+{
+ int err;
+ *sent = 0;
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ for ( ;; ) {
+ long put = (long) sendto(*ps, data, count, 0, addr, len);
+ if (put > 0) {
+ *sent = put;
+ return IO_DONE;
+ }
+ err = errno;
+ if (put == 0 || err == EPIPE) return IO_CLOSED;
+ if (err == EINTR) continue;
+ if (err != EAGAIN) return err;
+ if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;
+ }
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Receive with timeout
+\*-------------------------------------------------------------------------*/
+int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm) {
+ int err;
+ *got = 0;
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ for ( ;; ) {
+ long taken = (long) recv(*ps, data, count, 0);
+ if (taken > 0) {
+ *got = taken;
+ return IO_DONE;
+ }
+ err = errno;
+ if (taken == 0) return IO_CLOSED;
+ if (err == EINTR) continue;
+ if (err != EAGAIN) return err;
+ if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
+ }
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Recvfrom with timeout
+\*-------------------------------------------------------------------------*/
+int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got,
+ SA *addr, socklen_t *len, p_timeout tm) {
+ int err;
+ *got = 0;
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ for ( ;; ) {
+ long taken = (long) recvfrom(*ps, data, count, 0, addr, len);
+ if (taken > 0) {
+ *got = taken;
+ return IO_DONE;
+ }
+ err = errno;
+ if (taken == 0) return IO_CLOSED;
+ if (err == EINTR) continue;
+ if (err != EAGAIN) return err;
+ if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
+ }
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Put socket into blocking mode
+\*-------------------------------------------------------------------------*/
+void socket_setblocking(p_socket ps) {
+ int flags = fcntl(*ps, F_GETFL, 0);
+ flags &= (~(O_NONBLOCK));
+ fcntl(*ps, F_SETFL, flags);
+}
+
+/*-------------------------------------------------------------------------*\
+* Put socket into non-blocking mode
+\*-------------------------------------------------------------------------*/
+void socket_setnonblocking(p_socket ps) {
+ int flags = fcntl(*ps, F_GETFL, 0);
+ flags |= O_NONBLOCK;
+ fcntl(*ps, F_SETFL, flags);
+}
+
+/*-------------------------------------------------------------------------*\
+* DNS helpers
+\*-------------------------------------------------------------------------*/
+int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp) {
+ *hp = gethostbyaddr(addr, len, AF_INET);
+ if (*hp) return IO_DONE;
+ else if (h_errno) return h_errno;
+ else if (errno) return errno;
+ else return IO_UNKNOWN;
+}
+
+int socket_gethostbyname(const char *addr, struct hostent **hp) {
+ *hp = gethostbyname(addr);
+ if (*hp) return IO_DONE;
+ else if (h_errno) return h_errno;
+ else if (errno) return errno;
+ else return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Error translation functions
+* Make sure important error messages are standard
+\*-------------------------------------------------------------------------*/
+const char *socket_hoststrerror(int err) {
+ if (err <= 0) return io_strerror(err);
+ switch (err) {
+ case HOST_NOT_FOUND: return "host not found";
+ default: return HSTRERROR(err);
+ }
+}
+
+const char *socket_strerror(int err) {
+ if (err <= 0) return io_strerror(err);
+ switch (err) {
+ case EADDRINUSE: return "address already in use";
+ case EISCONN: return "already connected";
+ case EACCES: return "permission denied";
+ case ECONNREFUSED: return "connection refused";
+ case ECONNABORTED: return "closed";
+ case ECONNRESET: return "closed";
+ case ETIMEDOUT: return "timeout";
+ default: return strerror(errno);
+ }
+}
+
+const char *socket_ioerror(p_socket ps, int err) {
+ (void) ps;
+ return socket_strerror(err);
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/usocket.h b/Build/source/texk/web2c/luatexdir/luasocket/src/usocket.h
new file mode 100644
index 00000000000..f2a89aa0d21
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/usocket.h
@@ -0,0 +1,40 @@
+#ifndef USOCKET_H
+#define USOCKET_H
+/*=========================================================================*\
+* Socket compatibilization module for Unix
+* LuaSocket toolkit
+*
+* RCS ID: $Id: usocket.h,v 1.7 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+
+/*=========================================================================*\
+* BSD include files
+\*=========================================================================*/
+/* error codes */
+#include <errno.h>
+/* close function */
+#include <unistd.h>
+/* fnctnl function and associated constants */
+#include <fcntl.h>
+/* struct sockaddr */
+#include <sys/types.h>
+/* socket function */
+#include <sys/socket.h>
+/* struct timeval */
+#include <sys/time.h>
+/* gethostbyname and gethostbyaddr functions */
+#include <netdb.h>
+/* sigpipe handling */
+#include <signal.h>
+/* IP stuff*/
+#include <netinet/in.h>
+#include <arpa/inet.h>
+/* TCP options (nagle algorithm disable) */
+#include <netinet/tcp.h>
+
+typedef int t_socket;
+typedef t_socket *p_socket;
+
+#define SOCKET_INVALID (-1)
+
+#endif /* USOCKET_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.c b/Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.c
new file mode 100644
index 00000000000..6022565188a
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.c
@@ -0,0 +1,401 @@
+/*=========================================================================*\
+* Socket compatibilization module for Win32
+* LuaSocket toolkit
+*
+* The penalty of calling select to avoid busy-wait is only paid when
+* the I/O call fail in the first place.
+*
+* RCS ID: $Id: wsocket.c,v 1.36 2007/06/11 23:44:54 diego Exp $
+\*=========================================================================*/
+#include <string.h>
+
+#include "socket.h"
+
+/* WinSock doesn't have a strerror... */
+static const char *wstrerror(int err);
+
+/*-------------------------------------------------------------------------*\
+* Initializes module
+\*-------------------------------------------------------------------------*/
+int socket_open(void) {
+ WSADATA wsaData;
+ WORD wVersionRequested = MAKEWORD(2, 0);
+ int err = WSAStartup(wVersionRequested, &wsaData );
+ if (err != 0) return 0;
+ if ((LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 0) &&
+ (LOBYTE(wsaData.wVersion) != 1 || HIBYTE(wsaData.wVersion) != 1)) {
+ WSACleanup();
+ return 0;
+ }
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Close module
+\*-------------------------------------------------------------------------*/
+int socket_close(void) {
+ WSACleanup();
+ return 1;
+}
+
+/*-------------------------------------------------------------------------*\
+* Wait for readable/writable/connected socket with timeout
+\*-------------------------------------------------------------------------*/
+#define WAITFD_R 1
+#define WAITFD_W 2
+#define WAITFD_E 4
+#define WAITFD_C (WAITFD_E|WAITFD_W)
+
+int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
+ int ret;
+ fd_set rfds, wfds, efds, *rp = NULL, *wp = NULL, *ep = NULL;
+ struct timeval tv, *tp = NULL;
+ double t;
+ if (timeout_iszero(tm)) return IO_TIMEOUT; /* optimize timeout == 0 case */
+ if (sw & WAITFD_R) {
+ FD_ZERO(&rfds);
+ FD_SET(*ps, &rfds);
+ rp = &rfds;
+ }
+ if (sw & WAITFD_W) { FD_ZERO(&wfds); FD_SET(*ps, &wfds); wp = &wfds; }
+ if (sw & WAITFD_C) { FD_ZERO(&efds); FD_SET(*ps, &efds); ep = &efds; }
+ if ((t = timeout_get(tm)) >= 0.0) {
+ tv.tv_sec = (int) t;
+ tv.tv_usec = (int) ((t-tv.tv_sec)*1.0e6);
+ tp = &tv;
+ }
+ ret = select(0, rp, wp, ep, tp);
+ if (ret == -1) return WSAGetLastError();
+ if (ret == 0) return IO_TIMEOUT;
+ if (sw == WAITFD_C && FD_ISSET(*ps, &efds)) return IO_CLOSED;
+ return IO_DONE;
+}
+
+/*-------------------------------------------------------------------------*\
+* Select with int timeout in ms
+\*-------------------------------------------------------------------------*/
+int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds,
+ p_timeout tm) {
+ struct timeval tv;
+ double t = timeout_get(tm);
+ tv.tv_sec = (int) t;
+ tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);
+ if (n <= 0) {
+ Sleep((DWORD) (1000*t));
+ return 0;
+ } else return select(0, rfds, wfds, efds, t >= 0.0? &tv: NULL);
+}
+
+/*-------------------------------------------------------------------------*\
+* Close and inutilize socket
+\*-------------------------------------------------------------------------*/
+void socket_destroy(p_socket ps) {
+ if (*ps != SOCKET_INVALID) {
+ socket_setblocking(ps); /* close can take a long time on WIN32 */
+ closesocket(*ps);
+ *ps = SOCKET_INVALID;
+ }
+}
+
+/*-------------------------------------------------------------------------*\
+*
+\*-------------------------------------------------------------------------*/
+void socket_shutdown(p_socket ps, int how) {
+ socket_setblocking(ps);
+ shutdown(*ps, how);
+ socket_setnonblocking(ps);
+}
+
+/*-------------------------------------------------------------------------*\
+* Creates and sets up a socket
+\*-------------------------------------------------------------------------*/
+int socket_create(p_socket ps, int domain, int type, int protocol) {
+ *ps = socket(domain, type, protocol);
+ if (*ps != SOCKET_INVALID) return IO_DONE;
+ else return WSAGetLastError();
+}
+
+/*-------------------------------------------------------------------------*\
+* Connects or returns error message
+\*-------------------------------------------------------------------------*/
+int socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) {
+ int err;
+ /* don't call on closed socket */
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ /* ask system to connect */
+ if (connect(*ps, addr, len) == 0) return IO_DONE;
+ /* make sure the system is trying to connect */
+ err = WSAGetLastError();
+ if (err != WSAEWOULDBLOCK && err != WSAEINPROGRESS) return err;
+ /* zero timeout case optimization */
+ if (timeout_iszero(tm)) return IO_TIMEOUT;
+ /* we wait until something happens */
+ err = socket_waitfd(ps, WAITFD_C, tm);
+ if (err == IO_CLOSED) {
+ int len = sizeof(err);
+ /* give windows time to set the error (yes, disgusting) */
+ Sleep(10);
+ /* find out why we failed */
+ getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &len);
+ /* we KNOW there was an error. if 'why' is 0, we will return
+ * "unknown error", but it's not really our fault */
+ return err > 0? err: IO_UNKNOWN;
+ } else return err;
+
+}
+
+/*-------------------------------------------------------------------------*\
+* Binds or returns error message
+\*-------------------------------------------------------------------------*/
+int socket_bind(p_socket ps, SA *addr, socklen_t len) {
+ int err = IO_DONE;
+ socket_setblocking(ps);
+ if (bind(*ps, addr, len) < 0) err = WSAGetLastError();
+ socket_setnonblocking(ps);
+ return err;
+}
+
+/*-------------------------------------------------------------------------*\
+*
+\*-------------------------------------------------------------------------*/
+int socket_listen(p_socket ps, int backlog) {
+ int err = IO_DONE;
+ socket_setblocking(ps);
+ if (listen(*ps, backlog) < 0) err = WSAGetLastError();
+ socket_setnonblocking(ps);
+ return err;
+}
+
+/*-------------------------------------------------------------------------*\
+* Accept with timeout
+\*-------------------------------------------------------------------------*/
+int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len,
+ p_timeout tm) {
+ SA daddr;
+ socklen_t dlen = sizeof(daddr);
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ if (!addr) addr = &daddr;
+ if (!len) len = &dlen;
+ for ( ;; ) {
+ int err;
+ /* try to get client socket */
+ if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID) return IO_DONE;
+ /* find out why we failed */
+ err = WSAGetLastError();
+ /* if we failed because there was no connectoin, keep trying */
+ if (err != WSAEWOULDBLOCK && err != WSAECONNABORTED) return err;
+ /* call select to avoid busy wait */
+ if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
+ }
+ /* can't reach here */
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Send with timeout
+* On windows, if you try to send 10MB, the OS will buffer EVERYTHING
+* this can take an awful lot of time and we will end up blocked.
+* Therefore, whoever calls this function should not pass a huge buffer.
+\*-------------------------------------------------------------------------*/
+int socket_send(p_socket ps, const char *data, size_t count,
+ size_t *sent, p_timeout tm)
+{
+ int err;
+ *sent = 0;
+ /* avoid making system calls on closed sockets */
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ /* loop until we send something or we give up on error */
+ for ( ;; ) {
+ /* try to send something */
+ int put = send(*ps, data, (int) count, 0);
+ /* if we sent something, we are done */
+ if (put > 0) {
+ *sent = put;
+ return IO_DONE;
+ }
+ /* deal with failure */
+ err = WSAGetLastError();
+ /* we can only proceed if there was no serious error */
+ if (err != WSAEWOULDBLOCK) return err;
+ /* avoid busy wait */
+ if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;
+ }
+ /* can't reach here */
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Sendto with timeout
+\*-------------------------------------------------------------------------*/
+int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent,
+ SA *addr, socklen_t len, p_timeout tm)
+{
+ int err;
+ *sent = 0;
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ for ( ;; ) {
+ int put = sendto(*ps, data, (int) count, 0, addr, len);
+ if (put > 0) {
+ *sent = put;
+ return IO_DONE;
+ }
+ err = WSAGetLastError();
+ if (err != WSAEWOULDBLOCK) return err;
+ if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;
+ }
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Receive with timeout
+\*-------------------------------------------------------------------------*/
+int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm) {
+ int err;
+ *got = 0;
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ for ( ;; ) {
+ int taken = recv(*ps, data, (int) count, 0);
+ if (taken > 0) {
+ *got = taken;
+ return IO_DONE;
+ }
+ if (taken == 0) return IO_CLOSED;
+ err = WSAGetLastError();
+ if (err != WSAEWOULDBLOCK) return err;
+ if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
+ }
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Recvfrom with timeout
+\*-------------------------------------------------------------------------*/
+int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got,
+ SA *addr, socklen_t *len, p_timeout tm) {
+ int err;
+ *got = 0;
+ if (*ps == SOCKET_INVALID) return IO_CLOSED;
+ for ( ;; ) {
+ int taken = recvfrom(*ps, data, (int) count, 0, addr, len);
+ if (taken > 0) {
+ *got = taken;
+ return IO_DONE;
+ }
+ if (taken == 0) return IO_CLOSED;
+ err = WSAGetLastError();
+ if (err != WSAEWOULDBLOCK) return err;
+ if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
+ }
+ return IO_UNKNOWN;
+}
+
+/*-------------------------------------------------------------------------*\
+* Put socket into blocking mode
+\*-------------------------------------------------------------------------*/
+void socket_setblocking(p_socket ps) {
+ u_long argp = 0;
+ ioctlsocket(*ps, FIONBIO, &argp);
+}
+
+/*-------------------------------------------------------------------------*\
+* Put socket into non-blocking mode
+\*-------------------------------------------------------------------------*/
+void socket_setnonblocking(p_socket ps) {
+ u_long argp = 1;
+ ioctlsocket(*ps, FIONBIO, &argp);
+}
+
+/*-------------------------------------------------------------------------*\
+* DNS helpers
+\*-------------------------------------------------------------------------*/
+int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp) {
+ *hp = gethostbyaddr(addr, len, AF_INET);
+ if (*hp) return IO_DONE;
+ else return WSAGetLastError();
+}
+
+int socket_gethostbyname(const char *addr, struct hostent **hp) {
+ *hp = gethostbyname(addr);
+ if (*hp) return IO_DONE;
+ else return WSAGetLastError();
+}
+
+/*-------------------------------------------------------------------------*\
+* Error translation functions
+\*-------------------------------------------------------------------------*/
+const char *socket_hoststrerror(int err) {
+ if (err <= 0) return io_strerror(err);
+ switch (err) {
+ case WSAHOST_NOT_FOUND: return "host not found";
+ default: return wstrerror(err);
+ }
+}
+
+const char *socket_strerror(int err) {
+ if (err <= 0) return io_strerror(err);
+ switch (err) {
+ case WSAEADDRINUSE: return "address already in use";
+ case WSAECONNREFUSED: return "connection refused";
+ case WSAEISCONN: return "already connected";
+ case WSAEACCES: return "permission denied";
+ case WSAECONNABORTED: return "closed";
+ case WSAECONNRESET: return "closed";
+ case WSAETIMEDOUT: return "timeout";
+ default: return wstrerror(err);
+ }
+}
+
+const char *socket_ioerror(p_socket ps, int err) {
+ (void) ps;
+ return socket_strerror(err);
+}
+
+static const char *wstrerror(int err) {
+ switch (err) {
+ case WSAEINTR: return "Interrupted function call";
+ case WSAEACCES: return "Permission denied";
+ case WSAEFAULT: return "Bad address";
+ case WSAEINVAL: return "Invalid argument";
+ case WSAEMFILE: return "Too many open files";
+ case WSAEWOULDBLOCK: return "Resource temporarily unavailable";
+ case WSAEINPROGRESS: return "Operation now in progress";
+ case WSAEALREADY: return "Operation already in progress";
+ case WSAENOTSOCK: return "Socket operation on nonsocket";
+ case WSAEDESTADDRREQ: return "Destination address required";
+ case WSAEMSGSIZE: return "Message too long";
+ case WSAEPROTOTYPE: return "Protocol wrong type for socket";
+ case WSAENOPROTOOPT: return "Bad protocol option";
+ case WSAEPROTONOSUPPORT: return "Protocol not supported";
+ case WSAESOCKTNOSUPPORT: return "Socket type not supported";
+ case WSAEOPNOTSUPP: return "Operation not supported";
+ case WSAEPFNOSUPPORT: return "Protocol family not supported";
+ case WSAEAFNOSUPPORT:
+ return "Address family not supported by protocol family";
+ case WSAEADDRINUSE: return "Address already in use";
+ case WSAEADDRNOTAVAIL: return "Cannot assign requested address";
+ case WSAENETDOWN: return "Network is down";
+ case WSAENETUNREACH: return "Network is unreachable";
+ case WSAENETRESET: return "Network dropped connection on reset";
+ case WSAECONNABORTED: return "Software caused connection abort";
+ case WSAECONNRESET: return "Connection reset by peer";
+ case WSAENOBUFS: return "No buffer space available";
+ case WSAEISCONN: return "Socket is already connected";
+ case WSAENOTCONN: return "Socket is not connected";
+ case WSAESHUTDOWN: return "Cannot send after socket shutdown";
+ case WSAETIMEDOUT: return "Connection timed out";
+ case WSAECONNREFUSED: return "Connection refused";
+ case WSAEHOSTDOWN: return "Host is down";
+ case WSAEHOSTUNREACH: return "No route to host";
+ case WSAEPROCLIM: return "Too many processes";
+ case WSASYSNOTREADY: return "Network subsystem is unavailable";
+ case WSAVERNOTSUPPORTED: return "Winsock.dll version out of range";
+ case WSANOTINITIALISED:
+ return "Successful WSAStartup not yet performed";
+ case WSAEDISCON: return "Graceful shutdown in progress";
+ case WSAHOST_NOT_FOUND: return "Host not found";
+ case WSATRY_AGAIN: return "Nonauthoritative host not found";
+ case WSANO_RECOVERY: return "Nonrecoverable name lookup error";
+ case WSANO_DATA: return "Valid name, no data record of requested type";
+ default: return "Unknown error";
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.h b/Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.h
new file mode 100644
index 00000000000..b536683685c
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/src/wsocket.h
@@ -0,0 +1,21 @@
+#ifndef WSOCKET_H
+#define WSOCKET_H
+/*=========================================================================*\
+* Socket compatibilization module for Win32
+* LuaSocket toolkit
+*
+* RCS ID: $Id: wsocket.h,v 1.4 2005/10/07 04:40:59 diego Exp $
+\*=========================================================================*/
+
+/*=========================================================================*\
+* WinSock include files
+\*=========================================================================*/
+#include <winsock.h>
+
+typedef int socklen_t;
+typedef SOCKET t_socket;
+typedef t_socket *p_socket;
+
+#define SOCKET_INVALID (INVALID_SOCKET)
+
+#endif /* WSOCKET_H */
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/test/README b/Build/source/texk/web2c/luatexdir/luasocket/test/README
new file mode 100644
index 00000000000..180fa277ca7
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/test/README
@@ -0,0 +1,12 @@
+This provides the automated test scripts used to make sure the library
+is working properly.
+
+The files provided are:
+
+ testsrvr.lua -- test server
+ testclnt.lua -- test client
+
+To run these tests, just run lua on the server and then on the client.
+
+Good luck,
+Diego.
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/test/testclnt.lua b/Build/source/texk/web2c/luatexdir/luasocket/test/testclnt.lua
new file mode 100644
index 00000000000..a7ca1ba6768
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/test/testclnt.lua
@@ -0,0 +1,713 @@
+local socket = require"socket"
+
+host = host or "localhost"
+port = port or "8383"
+
+function pass(...)
+ local s = string.format(unpack(arg))
+ io.stderr:write(s, "\n")
+end
+
+function fail(...)
+ local s = string.format(unpack(arg))
+ io.stderr:write("ERROR: ", s, "!\n")
+socket.sleep(3)
+ os.exit()
+end
+
+function warn(...)
+ local s = string.format(unpack(arg))
+ io.stderr:write("WARNING: ", s, "\n")
+end
+
+function remote(...)
+ local s = string.format(unpack(arg))
+ s = string.gsub(s, "\n", ";")
+ s = string.gsub(s, "%s+", " ")
+ s = string.gsub(s, "^%s*", "")
+ control:send(s .. "\n")
+ control:receive()
+end
+
+function test(test)
+ io.stderr:write("----------------------------------------------\n",
+ "testing: ", test, "\n",
+ "----------------------------------------------\n")
+end
+
+function check_timeout(tm, sl, elapsed, err, opp, mode, alldone)
+ if tm < sl then
+ if opp == "send" then
+ if not err then warn("must be buffered")
+ elseif err == "timeout" then pass("proper timeout")
+ else fail("unexpected error '%s'", err) end
+ else
+ if err ~= "timeout" then fail("should have timed out")
+ else pass("proper timeout") end
+ end
+ else
+ if mode == "total" then
+ if elapsed > tm then
+ if err ~= "timeout" then fail("should have timed out")
+ else pass("proper timeout") end
+ elseif elapsed < tm then
+ if err then fail(err)
+ else pass("ok") end
+ else
+ if alldone then
+ if err then fail("unexpected error '%s'", err)
+ else pass("ok") end
+ else
+ if err ~= "timeout" then fail(err)
+ else pass("proper timeoutk") end
+ end
+ end
+ else
+ if err then fail(err)
+ else pass("ok") end
+ end
+ end
+end
+
+if not socket._DEBUG then
+ fail("Please define LUASOCKET_DEBUG and recompile LuaSocket")
+end
+
+io.stderr:write("----------------------------------------------\n",
+"LuaSocket Test Procedures\n",
+"----------------------------------------------\n")
+
+start = socket.gettime()
+
+function reconnect()
+ io.stderr:write("attempting data connection... ")
+ if data then data:close() end
+ remote [[
+ if data then data:close() data = nil end
+ data = server:accept()
+ data:setoption("tcp-nodelay", true)
+ ]]
+ data, err = socket.connect(host, port)
+ if not data then fail(err)
+ else pass("connected!") end
+ data:setoption("tcp-nodelay", true)
+end
+
+pass("attempting control connection...")
+control, err = socket.connect(host, port)
+if err then fail(err)
+else pass("connected!") end
+control:setoption("tcp-nodelay", true)
+
+------------------------------------------------------------------------
+function test_methods(sock, methods)
+ for _, v in pairs(methods) do
+ if type(sock[v]) ~= "function" then
+ fail(sock.class .. " method '" .. v .. "' not registered")
+ end
+ end
+ pass(sock.class .. " methods are ok")
+end
+
+------------------------------------------------------------------------
+function test_mixed(len)
+ reconnect()
+ local inter = math.ceil(len/4)
+ local p1 = "unix " .. string.rep("x", inter) .. "line\n"
+ local p2 = "dos " .. string.rep("y", inter) .. "line\r\n"
+ local p3 = "raw " .. string.rep("z", inter) .. "bytes"
+ local p4 = "end" .. string.rep("w", inter) .. "bytes"
+ local bp1, bp2, bp3, bp4
+remote (string.format("str = data:receive(%d)",
+ string.len(p1)+string.len(p2)+string.len(p3)+string.len(p4)))
+ sent, err = data:send(p1..p2..p3..p4)
+ if err then fail(err) end
+remote "data:send(str); data:close()"
+ bp1, err = data:receive()
+ if err then fail(err) end
+ bp2, err = data:receive()
+ if err then fail(err) end
+ bp3, err = data:receive(string.len(p3))
+ if err then fail(err) end
+ bp4, err = data:receive("*a")
+ if err then fail(err) end
+ if bp1.."\n" == p1 and bp2.."\r\n" == p2 and bp3 == p3 and bp4 == p4 then
+ pass("patterns match")
+ else fail("patterns don't match") end
+end
+
+------------------------------------------------------------------------
+function test_asciiline(len)
+ reconnect()
+ local str, str10, back, err
+ str = string.rep("x", math.mod(len, 10))
+ str10 = string.rep("aZb.c#dAe?", math.floor(len/10))
+ str = str .. str10
+remote "str = data:receive()"
+ sent, err = data:send(str.."\n")
+ if err then fail(err) end
+remote "data:send(str ..'\\n')"
+ back, err = data:receive()
+ if err then fail(err) end
+ if back == str then pass("lines match")
+ else fail("lines don't match") end
+end
+
+------------------------------------------------------------------------
+function test_rawline(len)
+ reconnect()
+ local str, str10, back, err
+ str = string.rep(string.char(47), math.mod(len, 10))
+ str10 = string.rep(string.char(120,21,77,4,5,0,7,36,44,100),
+ math.floor(len/10))
+ str = str .. str10
+remote "str = data:receive()"
+ sent, err = data:send(str.."\n")
+ if err then fail(err) end
+remote "data:send(str..'\\n')"
+ back, err = data:receive()
+ if err then fail(err) end
+ if back == str then pass("lines match")
+ else fail("lines don't match") end
+end
+
+------------------------------------------------------------------------
+function test_raw(len)
+ reconnect()
+ local half = math.floor(len/2)
+ local s1, s2, back, err
+ s1 = string.rep("x", half)
+ s2 = string.rep("y", len-half)
+remote (string.format("str = data:receive(%d)", len))
+ sent, err = data:send(s1)
+ if err then fail(err) end
+ sent, err = data:send(s2)
+ if err then fail(err) end
+remote "data:send(str)"
+ back, err = data:receive(len)
+ if err then fail(err) end
+ if back == s1..s2 then pass("blocks match")
+ else fail("blocks don't match") end
+end
+
+------------------------------------------------------------------------
+function test_totaltimeoutreceive(len, tm, sl)
+ reconnect()
+ local str, err, partial
+ pass("%d bytes, %ds total timeout, %ds pause", len, tm, sl)
+ remote (string.format ([[
+ data:settimeout(%d)
+ str = string.rep('a', %d)
+ data:send(str)
+ print('server: sleeping for %ds')
+ socket.sleep(%d)
+ print('server: woke up')
+ data:send(str)
+ ]], 2*tm, len, sl, sl))
+ data:settimeout(tm, "total")
+local t = socket.gettime()
+ str, err, partial, elapsed = data:receive(2*len)
+ check_timeout(tm, sl, elapsed, err, "receive", "total",
+ string.len(str or partial) == 2*len)
+end
+
+------------------------------------------------------------------------
+function test_totaltimeoutsend(len, tm, sl)
+ reconnect()
+ local str, err, total
+ pass("%d bytes, %ds total timeout, %ds pause", len, tm, sl)
+ remote (string.format ([[
+ data:settimeout(%d)
+ str = data:receive(%d)
+ print('server: sleeping for %ds')
+ socket.sleep(%d)
+ print('server: woke up')
+ str = data:receive(%d)
+ ]], 2*tm, len, sl, sl, len))
+ data:settimeout(tm, "total")
+ str = string.rep("a", 2*len)
+ total, err, partial, elapsed = data:send(str)
+ check_timeout(tm, sl, elapsed, err, "send", "total",
+ total == 2*len)
+end
+
+------------------------------------------------------------------------
+function test_blockingtimeoutreceive(len, tm, sl)
+ reconnect()
+ local str, err, partial
+ pass("%d bytes, %ds blocking timeout, %ds pause", len, tm, sl)
+ remote (string.format ([[
+ data:settimeout(%d)
+ str = string.rep('a', %d)
+ data:send(str)
+ print('server: sleeping for %ds')
+ socket.sleep(%d)
+ print('server: woke up')
+ data:send(str)
+ ]], 2*tm, len, sl, sl))
+ data:settimeout(tm)
+ str, err, partial, elapsed = data:receive(2*len)
+ check_timeout(tm, sl, elapsed, err, "receive", "blocking",
+ string.len(str or partial) == 2*len)
+end
+
+------------------------------------------------------------------------
+function test_blockingtimeoutsend(len, tm, sl)
+ reconnect()
+ local str, err, total
+ pass("%d bytes, %ds blocking timeout, %ds pause", len, tm, sl)
+ remote (string.format ([[
+ data:settimeout(%d)
+ str = data:receive(%d)
+ print('server: sleeping for %ds')
+ socket.sleep(%d)
+ print('server: woke up')
+ str = data:receive(%d)
+ ]], 2*tm, len, sl, sl, len))
+ data:settimeout(tm)
+ str = string.rep("a", 2*len)
+ total, err, partial, elapsed = data:send(str)
+ check_timeout(tm, sl, elapsed, err, "send", "blocking",
+ total == 2*len)
+end
+
+------------------------------------------------------------------------
+function empty_connect()
+ reconnect()
+ if data then data:close() data = nil end
+ remote [[
+ if data then data:close() data = nil end
+ data = server:accept()
+ ]]
+ data, err = socket.connect("", port)
+ if not data then
+ pass("ok")
+ data = socket.connect(host, port)
+ else
+ pass("gethostbyname returns localhost on empty string...")
+ end
+end
+
+------------------------------------------------------------------------
+function isclosed(c)
+ return c:getfd() == -1 or c:getfd() == (2^32-1)
+end
+
+function active_close()
+ reconnect()
+ if isclosed(data) then fail("should not be closed") end
+ data:close()
+ if not isclosed(data) then fail("should be closed") end
+ data = nil
+ local udp = socket.udp()
+ if isclosed(udp) then fail("should not be closed") end
+ udp:close()
+ if not isclosed(udp) then fail("should be closed") end
+ pass("ok")
+end
+
+------------------------------------------------------------------------
+function test_closed()
+ local back, partial, err
+ local str = 'little string'
+ reconnect()
+ pass("trying read detection")
+ remote (string.format ([[
+ data:send('%s')
+ data:close()
+ data = nil
+ ]], str))
+ -- try to get a line
+ back, err, partial = data:receive()
+ if not err then fail("should have gotten 'closed'.")
+ elseif err ~= "closed" then fail("got '"..err.."' instead of 'closed'.")
+ elseif str ~= partial then fail("didn't receive partial result.")
+ else pass("graceful 'closed' received") end
+ reconnect()
+ pass("trying write detection")
+ remote [[
+ data:close()
+ data = nil
+ ]]
+ total, err, partial = data:send(string.rep("ugauga", 100000))
+ if not err then
+ pass("failed: output buffer is at least %d bytes long!", total)
+ elseif err ~= "closed" then
+ fail("got '"..err.."' instead of 'closed'.")
+ else
+ pass("graceful 'closed' received after %d bytes were sent", partial)
+ end
+end
+
+------------------------------------------------------------------------
+function test_selectbugs()
+ local r, s, e = socket.select(nil, nil, 0.1)
+ assert(type(r) == "table" and type(s) == "table" and
+ (e == "timeout" or e == "error"))
+ pass("both nil: ok")
+ local udp = socket.udp()
+ udp:close()
+ r, s, e = socket.select({ udp }, { udp }, 0.1)
+ assert(type(r) == "table" and type(s) == "table" and
+ (e == "timeout" or e == "error"))
+ pass("closed sockets: ok")
+ e = pcall(socket.select, "wrong", 1, 0.1)
+ assert(e == false)
+ e = pcall(socket.select, {}, 1, 0.1)
+ assert(e == false)
+ pass("invalid input: ok")
+end
+
+------------------------------------------------------------------------
+function accept_timeout()
+ io.stderr:write("accept with timeout (if it hangs, it failed): ")
+ local s, e = socket.bind("*", 0, 0)
+ assert(s, e)
+ local t = socket.gettime()
+ s:settimeout(1)
+ local c, e = s:accept()
+ assert(not c, "should not accept")
+ assert(e == "timeout", string.format("wrong error message (%s)", e))
+ t = socket.gettime() - t
+ assert(t < 2, string.format("took to long to give up (%gs)", t))
+ s:close()
+ pass("good")
+end
+
+------------------------------------------------------------------------
+function connect_timeout()
+ io.stderr:write("connect with timeout (if it hangs, it failed!): ")
+ local t = socket.gettime()
+ local c, e = socket.tcp()
+ assert(c, e)
+ c:settimeout(0.1)
+ local t = socket.gettime()
+ local r, e = c:connect("10.0.0.1", 81)
+print(r, e)
+ assert(not r, "should not connect")
+ assert(socket.gettime() - t < 2, "took too long to give up.")
+ c:close()
+ print("ok")
+end
+
+------------------------------------------------------------------------
+function accept_errors()
+ io.stderr:write("not listening: ")
+ local d, e = socket.bind("*", 0)
+ assert(d, e);
+ local c, e = socket.tcp();
+ assert(c, e);
+ d:setfd(c:getfd())
+ d:settimeout(2)
+ local r, e = d:accept()
+ assert(not r and e)
+ print("ok: ", e)
+ io.stderr:write("not supported: ")
+ local c, e = socket.udp()
+ assert(c, e);
+ d:setfd(c:getfd())
+ local r, e = d:accept()
+ assert(not r and e)
+ print("ok: ", e)
+end
+
+------------------------------------------------------------------------
+function connect_errors()
+ io.stderr:write("connection refused: ")
+ local c, e = socket.connect("localhost", 1);
+ assert(not c and e)
+ print("ok: ", e)
+ io.stderr:write("host not found: ")
+ local c, e = socket.connect("host.is.invalid", 1);
+ assert(not c and e, e)
+ print("ok: ", e)
+end
+
+------------------------------------------------------------------------
+function rebind_test()
+ local c = socket.bind("localhost", 0)
+ local i, p = c:getsockname()
+ local s, e = socket.tcp()
+ assert(s, e)
+ s:setoption("reuseaddr", false)
+ r, e = s:bind("localhost", p)
+ assert(not r, "managed to rebind!")
+ assert(e)
+ print("ok: ", e)
+end
+
+------------------------------------------------------------------------
+function getstats_test()
+ reconnect()
+ local t = 0
+ for i = 1, 25 do
+ local c = math.random(1, 100)
+ remote (string.format ([[
+ str = data:receive(%d)
+ data:send(str)
+ ]], c))
+ data:send(string.rep("a", c))
+ data:receive(c)
+ t = t + c
+ local r, s, a = data:getstats()
+ assert(r == t, "received count failed" .. tostring(r)
+ .. "/" .. tostring(t))
+ assert(s == t, "sent count failed" .. tostring(s)
+ .. "/" .. tostring(t))
+ end
+ print("ok")
+end
+
+
+------------------------------------------------------------------------
+function test_nonblocking(size)
+ reconnect()
+print("Testing " .. 2*size .. " bytes")
+remote(string.format([[
+ data:send(string.rep("a", %d))
+ socket.sleep(0.5)
+ data:send(string.rep("b", %d) .. "\n")
+]], size, size))
+ local err = "timeout"
+ local part = ""
+ local str
+ data:settimeout(0)
+ while 1 do
+ str, err, part = data:receive("*l", part)
+ if err ~= "timeout" then break end
+ end
+ assert(str == (string.rep("a", size) .. string.rep("b", size)))
+ reconnect()
+remote(string.format([[
+ str = data:receive(%d)
+ socket.sleep(0.5)
+ str = data:receive(2*%d, str)
+ data:send(str)
+]], size, size))
+ data:settimeout(0)
+ local start = 0
+ while 1 do
+ ret, err, start = data:send(str, start+1)
+ if err ~= "timeout" then break end
+ end
+ data:send("\n")
+ data:settimeout(-1)
+ local back = data:receive(2*size)
+ assert(back == str, "'" .. back .. "' vs '" .. str .. "'")
+ print("ok")
+end
+
+------------------------------------------------------------------------
+function test_readafterclose()
+ local back, partial, err
+ local str = 'little string'
+ reconnect()
+ pass("trying repeated '*a' pattern")
+ remote (string.format ([[
+ data:send('%s')
+ data:close()
+ data = nil
+ ]], str))
+ back, err, partial = data:receive("*a")
+ assert(back == str, "unexpected data read")
+ back, err, partial = data:receive("*a")
+ assert(back == nil and err == "closed", "should have returned 'closed'")
+ print("ok")
+ reconnect()
+ pass("trying active close before '*a'")
+ remote (string.format ([[
+ data:close()
+ data = nil
+ ]]))
+ data:close()
+ back, err, partial = data:receive("*a")
+ assert(back == nil and err == "closed", "should have returned 'closed'")
+ print("ok")
+ reconnect()
+ pass("trying active close before '*l'")
+ remote (string.format ([[
+ data:close()
+ data = nil
+ ]]))
+ data:close()
+ back, err, partial = data:receive()
+ assert(back == nil and err == "closed", "should have returned 'closed'")
+ print("ok")
+ reconnect()
+ pass("trying active close before raw 1")
+ remote (string.format ([[
+ data:close()
+ data = nil
+ ]]))
+ data:close()
+ back, err, partial = data:receive(1)
+ assert(back == nil and err == "closed", "should have returned 'closed'")
+ print("ok")
+ reconnect()
+ pass("trying active close before raw 0")
+ remote (string.format ([[
+ data:close()
+ data = nil
+ ]]))
+ data:close()
+ back, err, partial = data:receive(0)
+ assert(back == nil and err == "closed", "should have returned 'closed'")
+ print("ok")
+end
+
+test("method registration")
+test_methods(socket.tcp(), {
+ "accept",
+ "bind",
+ "close",
+ "connect",
+ "dirty",
+ "getfd",
+ "getpeername",
+ "getsockname",
+ "getstats",
+ "setstats",
+ "listen",
+ "receive",
+ "send",
+ "setfd",
+ "setoption",
+ "setpeername",
+ "setsockname",
+ "settimeout",
+ "shutdown",
+})
+
+test_methods(socket.udp(), {
+ "close",
+ "getpeername",
+ "dirty",
+ "getfd",
+ "getpeername",
+ "getsockname",
+ "receive",
+ "receivefrom",
+ "send",
+ "sendto",
+ "setfd",
+ "setoption",
+ "setpeername",
+ "setsockname",
+ "settimeout"
+})
+
+test("testing read after close")
+test_readafterclose()
+
+test("select function")
+test_selectbugs()
+
+test("connect function")
+connect_timeout()
+empty_connect()
+connect_errors()
+
+test("rebinding: ")
+rebind_test()
+
+test("active close: ")
+active_close()
+
+test("closed connection detection: ")
+test_closed()
+
+test("accept function: ")
+accept_timeout()
+accept_errors()
+
+test("getstats test")
+getstats_test()
+
+test("character line")
+test_asciiline(1)
+test_asciiline(17)
+test_asciiline(200)
+test_asciiline(4091)
+test_asciiline(80199)
+test_asciiline(8000000)
+test_asciiline(80199)
+test_asciiline(4091)
+test_asciiline(200)
+test_asciiline(17)
+test_asciiline(1)
+
+test("mixed patterns")
+test_mixed(1)
+test_mixed(17)
+test_mixed(200)
+test_mixed(4091)
+test_mixed(801990)
+test_mixed(4091)
+test_mixed(200)
+test_mixed(17)
+test_mixed(1)
+
+test("binary line")
+test_rawline(1)
+test_rawline(17)
+test_rawline(200)
+test_rawline(4091)
+test_rawline(80199)
+test_rawline(8000000)
+test_rawline(80199)
+test_rawline(4091)
+test_rawline(200)
+test_rawline(17)
+test_rawline(1)
+
+test("raw transfer")
+test_raw(1)
+test_raw(17)
+test_raw(200)
+test_raw(4091)
+test_raw(80199)
+test_raw(8000000)
+test_raw(80199)
+test_raw(4091)
+test_raw(200)
+test_raw(17)
+test_raw(1)
+
+test("non-blocking transfer")
+test_nonblocking(1)
+test_nonblocking(17)
+test_nonblocking(200)
+test_nonblocking(4091)
+test_nonblocking(80199)
+test_nonblocking(800000)
+test_nonblocking(80199)
+test_nonblocking(4091)
+test_nonblocking(200)
+test_nonblocking(17)
+test_nonblocking(1)
+
+test("total timeout on send")
+test_totaltimeoutsend(800091, 1, 3)
+test_totaltimeoutsend(800091, 2, 3)
+test_totaltimeoutsend(800091, 5, 2)
+test_totaltimeoutsend(800091, 3, 1)
+
+test("total timeout on receive")
+test_totaltimeoutreceive(800091, 1, 3)
+test_totaltimeoutreceive(800091, 2, 3)
+test_totaltimeoutreceive(800091, 3, 2)
+test_totaltimeoutreceive(800091, 3, 1)
+
+test("blocking timeout on send")
+test_blockingtimeoutsend(800091, 1, 3)
+test_blockingtimeoutsend(800091, 2, 3)
+test_blockingtimeoutsend(800091, 3, 2)
+test_blockingtimeoutsend(800091, 3, 1)
+
+test("blocking timeout on receive")
+test_blockingtimeoutreceive(800091, 1, 3)
+test_blockingtimeoutreceive(800091, 2, 3)
+test_blockingtimeoutreceive(800091, 3, 2)
+test_blockingtimeoutreceive(800091, 3, 1)
+
+test(string.format("done in %.2fs", socket.gettime() - start))
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/test/testsrvr.lua b/Build/source/texk/web2c/luatexdir/luasocket/test/testsrvr.lua
new file mode 100644
index 00000000000..f1972c2273c
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/test/testsrvr.lua
@@ -0,0 +1,15 @@
+socket = require("socket");
+host = host or "localhost";
+port = port or "8383";
+server = assert(socket.bind(host, port));
+ack = "\n";
+while 1 do
+ print("server: waiting for client connection...");
+ control = assert(server:accept());
+ while 1 do
+ command = assert(control:receive());
+ assert(control:send(ack));
+ print(command);
+ (loadstring(command))();
+ end
+end
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/test/testsupport.lua b/Build/source/texk/web2c/luatexdir/luasocket/test/testsupport.lua
new file mode 100644
index 00000000000..acad8f5bce6
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/luasocket/test/testsupport.lua
@@ -0,0 +1,37 @@
+function readfile(name)
+ local f = io.open(name, "rb")
+ if not f then return nil end
+ local s = f:read("*a")
+ f:close()
+ return s
+end
+
+function similar(s1, s2)
+ return string.lower(string.gsub(s1 or "", "%s", "")) ==
+ string.lower(string.gsub(s2 or "", "%s", ""))
+end
+
+function fail(msg)
+ msg = msg or "failed"
+ error(msg, 2)
+end
+
+function compare(input, output)
+ local original = readfile(input)
+ local recovered = readfile(output)
+ if original ~= recovered then fail("comparison failed")
+ else print("ok") end
+end
+
+local G = _G
+local set = rawset
+local warn = print
+
+local setglobal = function(table, key, value)
+ warn("changed " .. key)
+ set(table, key, value)
+end
+
+setmetatable(G, {
+ __newindex = setglobal
+})
diff --git a/Build/source/texk/web2c/luatexdir/luatangle.ch b/Build/source/texk/web2c/luatexdir/luatangle.ch
index f6de622eeb2..936e4d62ab4 100644
--- a/Build/source/texk/web2c/luatexdir/luatangle.ch
+++ b/Build/source/texk/web2c/luatexdir/luatangle.ch
@@ -1,12 +1,13 @@
-% otangle.ch: web2c changes to file tangle.ch
+% luatangle.ch: web2c changes to file tangle.ch
+% $Id$
%
-% This file is part of the Omega project, which
-% is based in the web2c distribution of TeX.
+% This file is part of LuaTeX.
%
% Copyright (c) 1994--1998 John Plaice and Yannis Haralambous
+% Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
% applies only to the changes to the original tangle.ch.
%
-% otangle.ch for C compilation with web2c.
+% luatangle.ch for C compilation with web2c.
%
% 10/9/82 (HT) Original version
% 11/29 (HT) New version, with conversion to lowercase handled properly
diff --git a/Build/source/texk/web2c/luatexdir/luatex-api.h b/Build/source/texk/web2c/luatexdir/luatex-api.h
index 3585e01dea7..8cb7363e216 100644
--- a/Build/source/texk/web2c/luatexdir/luatex-api.h
+++ b/Build/source/texk/web2c/luatexdir/luatex-api.h
@@ -1,4 +1,23 @@
-/* $Id */
+/* luatex-api.h
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id$ */
#include <stdlib.h>
#include <stdio.h>
@@ -13,92 +32,97 @@ typedef struct LoadS {
size_t size;
} LoadS;
-extern lua_State *Luas[];
+extern lua_State *Luas;
+
+extern void make_table(lua_State * L, char *tab, char *getfunc, char *setfunc);
-extern void make_table (lua_State *L, char *tab, char *getfunc, char*setfunc);
+extern int luac_main(int argc, char *argv[]);
-extern int luac_main (int argc, char* argv[]);
+extern int luaopen_tex(lua_State * L);
-extern int luaopen_tex (lua_State *L);
+extern int luaopen_pdf(lua_State * L);
-extern int luaopen_pdf (lua_State *L);
+#define LUA_TEXFILEHANDLE "TEXFILE*"
-#define LUA_TEXFILEHANDLE "TEXFILE*"
+extern int luaopen_texio(lua_State * L);
-extern int luaopen_texio (lua_State *L);
+extern int luaopen_lang(lua_State * L);
-extern int luaopen_lang (lua_State *L);
+extern void luatex_load_init(int s, LoadS * ls);
-extern void luatex_load_init (int s, LoadS *ls);
+extern lua_State *luatex_error(lua_State * L, int fatal);
-extern lua_State *luatex_error (lua_State *L, int fatal);
+extern int luaopen_unicode(lua_State * L);
+extern int luaopen_zip(lua_State * L);
+extern int luaopen_lfs(lua_State * L);
+extern int luaopen_lpeg(lua_State * L);
+extern int luaopen_md5(lua_State * L);
+extern int luaopen_zlib(lua_State * L);
+extern int luaopen_gzip(lua_State * L);
+extern int luaopen_ff(lua_State * L);
+extern int luaopen_profiler(lua_State * L);
-extern int luaopen_unicode (lua_State *L);
-extern int luaopen_zip (lua_State *L);
-extern int luaopen_lfs (lua_State *L);
-extern int luaopen_lpeg (lua_State *L);
-extern int luaopen_md5 (lua_State *L);
-extern int luaopen_zlib (lua_State *L);
-extern int luaopen_gzip (lua_State *L);
-extern int luaopen_ff (lua_State *L);
+extern int luaopen_socket_core(lua_State * L);
+extern int luaopen_mime_core(lua_State * L);
+extern void luatex_socketlua_open(lua_State * L);
-extern int luaopen_img (lua_State *L);
-extern int luaopen_mp (lua_State *L);
+extern int luaopen_img(lua_State * L);
+extern int l_new_image(lua_State * L);
+extern int luaopen_mplib(lua_State * L);
-extern void open_oslibext (lua_State *L, int safer_option);
+extern void open_oslibext(lua_State * L, int safer_option);
-extern void initfilecallbackids (int max);
-extern void setinputfilecallbackid (int n, int i) ;
-extern void setreadfilecallbackid (int n, int i) ;
-extern int getinputfilecallbackid (int n);
-extern int getreadfilecallbackid (int n);
+extern void initfilecallbackids(int max);
+extern void setinputfilecallbackid(int n, int i);
+extern void setreadfilecallbackid(int n, int i);
+extern int getinputfilecallbackid(int n);
+extern int getreadfilecallbackid(int n);
-extern void lua_initialize (int ac, char **av);
+extern void lua_initialize(int ac, char **av);
-extern int luaopen_kpse (lua_State *L);
+extern int luaopen_kpse(lua_State * L);
-extern int luaopen_callback (lua_State *L);
+extern int luaopen_callback(lua_State * L);
-extern int luaopen_lua (lua_State *L, int n, char *fname);
+extern int luaopen_lua(lua_State * L, char *fname);
-extern int luaopen_stats (lua_State *L);
+extern int luaopen_stats(lua_State * L);
-extern int luaopen_font (lua_State *L);
-extern int font_to_lua (lua_State *L, int f) ;
-extern int font_from_lua (lua_State *L, int f) ; /* return is boolean */
+extern int luaopen_font(lua_State * L);
+extern int font_to_lua(lua_State * L, int f);
+extern int font_from_lua(lua_State * L, int f); /* return is boolean */
-extern int luaopen_token (lua_State *L);
-extern char *tokenlist_to_cstring (int p , int inhibit_par, int *siz);
-extern void tokenlist_to_lua(lua_State *L, int p);
-extern void tokenlist_to_luastring(lua_State *L, int p) ;
-extern int tokenlist_from_lua(lua_State *L);
+extern int luaopen_token(lua_State * L);
+extern char *tokenlist_to_cstring(int p, int inhibit_par, int *siz);
+extern void tokenlist_to_lua(lua_State * L, int p);
+extern void tokenlist_to_luastring(lua_State * L, int p);
+extern int tokenlist_from_lua(lua_State * L);
-extern void lua_nodelib_push (lua_State *L) ;
-extern int luaopen_node (lua_State *L);
-extern void nodelist_to_lua (lua_State *L, int n) ;
-extern int nodelist_from_lua (lua_State *L);
+extern void lua_nodelib_push(lua_State * L);
+extern int luaopen_node(lua_State * L);
+extern void nodelist_to_lua(lua_State * L, int n);
+extern int nodelist_from_lua(lua_State * L);
-extern int dimen_to_number (lua_State *L, char *s);
+extern int dimen_to_number(lua_State * L, char *s);
-extern void dump_luac_registers (void);
+extern void dump_luac_registers(void);
-extern void undump_luac_registers (void);
+extern void undump_luac_registers(void);
-extern void unhide_lua_table(lua_State *lua, char *name, int r);
-extern int hide_lua_table (lua_State *lua, char *name);
+extern void unhide_lua_table(lua_State * lua, char *name, int r);
+extern int hide_lua_table(lua_State * lua, char *name);
-extern void unhide_lua_value(lua_State *lua, char *name, char *item, int r);
-extern int hide_lua_value (lua_State *lua, char *name, char *item);
+extern void unhide_lua_value(lua_State * lua, char *name, char *item, int r);
+extern int hide_lua_value(lua_State * lua, char *name, char *item);
typedef struct command_item_ {
- char *cmd_name;
- int command_offset;
- char **commands;
+ char *cmd_name;
+ int command_offset;
+ char **commands;
} command_item;
-
+
extern command_item command_names[];
extern int callback_callbacks_id;
-void luainterpreter (int n) ;
-
+extern void luainterpreter(void);
diff --git a/Build/source/texk/web2c/luatexdir/luatex.ch b/Build/source/texk/web2c/luatexdir/luatex.ch
index 0ae368beb80..5361f6550ca 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.ch
+++ b/Build/source/texk/web2c/luatexdir/luatex.ch
@@ -1,3 +1,24 @@
+% luatex.ch
+%
+% Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+%
+% This file is part of LuaTeX.
+%
+% LuaTeX is free software; you can redistribute it and/or modify it under
+% the terms of the GNU General Public License as published by the Free
+% Software Foundation; either version 2 of the License, or (at your
+% option) any later version.
+%
+% LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU General Public License along
+% with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
+%
+% $Id$
+%
@x
\def\?##1]{\hbox to 1in{\hfil##1.\ }}
}
@@ -8,11 +29,11 @@
@z
@x
-@d banner==luaTeX_banner
+@d banner==LuaTeX_banner
@y
-@d luaTeXk_banner=='This is luaTeXk, Version ',luatex_version_string
+@d luaTeXk_banner=='This is LuaTeXk, Version ',luatex_version_string
@#
-@d banner==luaTeX_banner
+@d banner==LuaTeX_banner
@d banner_k==luaTeXk_banner
@z
@@ -20,6 +41,7 @@
Actually the heading shown here is not quite normal: The |program| line
does not mention any |output| file, because \ph\ would ask the \TeX\ user
to specify a file name if |output| were specified here.
+@:PASCAL H}{\ph@>
@^system dependencies@>
@y
@z
@@ -129,7 +151,7 @@ versions of the program.
{Larger values than 65536 cause the arrays consume much more memory.}
@<Constants...@>=
-@!hash_offset=514; {smallest index in hash array, i.e., |hash_base| }
+@!hash_offset=0; {smallest index in hash array, i.e., |hash_base| }
{Use |hash_offset=0| for compilers which cannot decrement pointers.}
@!engine_name='luatex'; {the name of this engine}
@#
@@ -185,20 +207,6 @@ versions of the program.
@z
@x
-@d font_base=0 {smallest internal font number; must not be less
- than |min_quarterword|}
-@d hash_size=2100 {maximum number of control sequences; it should be at most
- about |(fix_mem_max-fix_mem_min)/10|}
-@d hash_prime=1777 {a prime number equal to about 85\pct! of |hash_size|}
-@y
-@d font_base=0 {smallest internal font number; must not be less
- than |min_quarterword|}
-@d hash_size=65536 {maximum number of control sequences; it should be at most
- about |(mem_max-mem_min)/10|}
-@d hash_prime=55711 {a prime number equal to about 85\pct! of |hash_size|}
-@z
-
-@x
@d incr(#) == #:=#+1 {increase a variable by unity}
@d decr(#) == #:=#-1 {decrease a variable by unity}
@y
@@ -279,6 +287,7 @@ end;
@x
@ Files can be closed with the \ph\ routine `|close(f)|', which
+@:PASCAL H}{\ph@>
@^system dependencies@>
should be used when all input or output with respect to |f| has been completed.
This makes |f| available to be opened again, if desired; and if |f| was used for
@@ -391,21 +400,12 @@ tini@/
@!filelineerrorstylep:cinttype; {format messages as file:line:error}
@!haltonerrorp:cinttype; {stop at first error}
@!quoted_filename:boolean; {current filename is quoted}
-{Variables for source specials}
-@!srcspecialsp : boolean;{Whether |src_specials| are enabled at all}
-@!insertsrcspecialauto : boolean;
-@!insertsrcspecialeverypar : boolean;
-@!insertsrcspecialeveryparend : boolean;
-@!insertsrcspecialeverycr : boolean;
-@!insertsrcspecialeverymath : boolean;
-@!insertsrcspecialeveryhbox : boolean;
-@!insertsrcspecialeveryvbox : boolean;
-@!insertsrcspecialeverydisplay : boolean;
@z
@x
@ Here is how to open the terminal files
in \ph. The `\.{/I}' switch suppresses the first |get|.
+@:PASCAL H}{\ph@>
@^system dependencies@>
@d t_open_in==reset(term_in,'TTY:','/O/I') {open the terminal for text input}
@@ -420,6 +420,7 @@ any command line arguments the user has provided. It's defined in C.
@x
these operations can be specified in \ph:
+@:PASCAL H}{\ph@>
@^system dependencies@>
@d update_terminal == break(term_out) {empty the terminal output buffer}
@@ -574,47 +575,6 @@ end;
@z
@x
-line ready to be edited. But such an extension requires some system
-wizardry, so the present implementation simply types out the name of the
-file that should be
-edited and the relevant line number.
-@^system dependencies@>
-
-There is a secret `\.D' option available when the debugging routines haven't
-been commented~out.
-@^debugging@>
-@y
-line ready to be edited.
-We do this by calling the external procedure |calledit| with a pointer to
-the filename, its length, and the line number.
-However, here we just set up the variables that will be used as arguments,
-since we don't want to do the switch-to-editor until after TeX has closed
-its files.
-@^system dependencies@>
-
-There is a secret `\.D' option available when the debugging routines haven't
-been commented~out.
-@^debugging@>
-@d edit_file==input_stack[base_ptr]
-@z
-
-@x
-"E": if base_ptr>0 then
- begin print_nl("You want to edit file ");
-@.You want to edit file x@>
- slow_print(input_stack[base_ptr].name_field);
- print(" at line "); print_int(line);
- interaction:=scroll_mode; jump_out;
-@y
-"E": if base_ptr>0 then
- begin edit_name_start:=str_start_macro(edit_file.name_field);
- edit_name_length:=str_start_macro(edit_file.name_field+1) -
- str_start_macro(edit_file.name_field);
- edit_line:=line;
- jump_out;
-@z
-
-@x
|remainder|, holds the remainder after a division.
@<Glob...@>=
@@ -687,18 +647,6 @@ So they have been simplified here in the obvious way.
@z
@x
- if abs(vmem(p+glue_offset).int)<@'4000000 then print("?.?")
- else if abs(g)>float_constant(20000) then
-@y
- { The Unix |pc| folks removed this restriction with a remark that
- invalid bit patterns were vanishingly improbable, so we follow
- their example without really understanding it.
- |if abs(vmem(p+glue_offset).int)<@'4000000 then print('?.?')|
- |else| }
- if fabs(g)>float_constant(20000) then
-@z
-
-@x
begin if m>0 then
case m div (max_command+1) of
0:print("vertical");
@@ -751,10 +699,8 @@ end;
@z
@x
-local_par:=null; local_par_bool:=false;
@<Start a new current page@>;
@y
-local_par:=null; local_par_bool:=false;
@/{The following piece of code is a copy of module 991:}
page_contents:=empty; page_tail:=page_head; {|link(page_head):=null;|}@/
last_glue:=max_halfword; last_penalty:=0; last_kern:=0;
@@ -771,20 +717,10 @@ page_depth:=0; page_max_depth:=0;
@z
@x
-@d frozen_null_font=frozen_control_sequence+12
- {permanent `\.{\\nullfont}'}
-@y
-@d frozen_special=frozen_control_sequence+12
- {permanent `\.{\\special}'}
-@d frozen_null_font=frozen_control_sequence+13
- {permanent `\.{\\nullfont}'}
-@z
-
-@x
-for k:=active_base to undefined_control_sequence-1 do
+for k:=null_cs to undefined_control_sequence-1 do
eqtb[k]:=eqtb[undefined_control_sequence];
@y
-for k:=active_base to eqtb_top do
+for k:=null_cs to eqtb_top do
eqtb[k]:=eqtb[undefined_control_sequence];
@z
@@ -823,7 +759,7 @@ else if (n<glue_base) or ((n>eqtb_size)and(n<=eqtb_top)) then
@z
@x
-@!eqtb:array[active_base..eqtb_size] of memory_word;
+@!eqtb:array[null_cs..eqtb_size] of memory_word;
@y
@!zeqtb:^memory_word;
@z
@@ -856,32 +792,6 @@ hash_high:=0;
@z
@x
-@ @<Insert a new control...@>=
-begin if text(p)>0 then
- begin repeat if hash_is_full then overflow("hash size",hash_size);
-@:TeX capacity exceeded hash size}{\quad hash size@>
- decr(hash_used);
- until text(hash_used)=0; {search for an empty location in |hash|}
- next(p):=hash_used; p:=hash_used;
- end;
-@y
-@ @<Insert a new control...@>=
-begin if text(p)>0 then
- begin if hash_high<hash_extra then
- begin incr(hash_high);
- next(p):=hash_high+eqtb_size; p:=hash_high+eqtb_size;
- end
- else begin
- repeat if hash_is_full then overflow("hash size",hash_size+hash_extra);
-@:TeX capacity exceeded hash size}{\quad hash size@>
- decr(hash_used);
- until text(hash_used)=0; {search for an empty location in |hash|}
- next(p):=hash_used; p:=hash_used;
- end;
- end;
-@z
-
-@x
else if p>=undefined_control_sequence then print_esc("IMPOSSIBLE.")
@y
else if ((p>=undefined_control_sequence)and(p<=eqtb_size))or(p>eqtb_top) then
@@ -1026,203 +936,6 @@ In C, the default paths are specified separately.
@z
@x
-begin area_delimiter:=0; ext_delimiter:=0;
-@y
-begin area_delimiter:=0; ext_delimiter:=0; quoted_filename:=false;
-@z
-
-@x
-begin if c=" " then more_name:=false
-@y
-begin if (c=" ") and stop_at_space and (not quoted_filename) then
- more_name:=false
-else if c="""" then begin
- quoted_filename:=not quoted_filename;
- more_name:=true;
- end
-@z
-
-@x
- if (c=">")or(c=":") then
-@y
- if ISDIRSEP(c) then
-@z
-
-@x
- else if (c=".")and(ext_delimiter=0) then ext_delimiter:=cur_length;
-@y
- else if c="." then ext_delimiter:=cur_length;
-@z
-
-@x
-@ The third.
-@^system dependencies@>
-
-@p procedure end_name;
-@y
-@ The third.
-@^system dependencies@>
-If a string is already in the string pool, the function
-|slow_make_string| does not create a new string but returns this string
-number, thus saving string space. Because of this new property of the
-returned string number it is not possible to apply |flush_string| to
-these strings.
-
-@p procedure end_name;
-var temp_str: str_number; {result of file name cache lookups}
-@!j,@!s,@!t: pool_pointer; {running indices}
-@!must_quote:boolean; {whether we need to quote a string}
-@z
-
-@x
-@:TeX capacity exceeded number of strings}{\quad number of strings@>
-@y
-@:TeX capacity exceeded number of strings}{\quad number of strings@>
-str_room(6); {Room for quotes, if needed.}
-{add quotes if needed}
-if area_delimiter<>0 then begin
- {maybe quote |cur_area|}
- must_quote:=false;
- s:=str_start_macro(str_ptr);
- t:=str_start_macro(str_ptr)+area_delimiter;
- j:=s;
- while (not must_quote) and (j<t) do begin
- must_quote:=str_pool[j]=" "; incr(j);
- end;
- if must_quote then begin
- for j:=pool_ptr-1 downto t do str_pool[j+2]:=str_pool[j];
- str_pool[t+1]:="""";
- for j:=t-1 downto s do str_pool[j+1]:=str_pool[j];
- str_pool[s]:="""";
- if ext_delimiter<>0 then ext_delimiter:=ext_delimiter+2;
- area_delimiter:=area_delimiter+2;
- pool_ptr:=pool_ptr+2;
- end;
- end;
-{maybe quote |cur_name|}
-s:=str_start_macro(str_ptr)+area_delimiter;
-if ext_delimiter=0 then t:=pool_ptr else t:=str_start_macro(str_ptr)+ext_delimiter-1;
-must_quote:=false;
-j:=s;
-while (not must_quote) and (j<t) do begin
- must_quote:=str_pool[j]=" "; incr(j);
- end;
-if must_quote then begin
- for j:=pool_ptr-1 downto t do str_pool[j+2]:=str_pool[j];
- str_pool[t+1]:="""";
- for j:=t-1 downto s do str_pool[j+1]:=str_pool[j];
- str_pool[s]:="""";
- if ext_delimiter<>0 then ext_delimiter:=ext_delimiter+2;
- pool_ptr:=pool_ptr+2;
- end;
-if ext_delimiter<>0 then begin
- {maybe quote |cur_ext|}
- s:=str_start_macro(str_ptr)+ext_delimiter-1;
- t:=pool_ptr;
- must_quote:=false;
- j:=s;
- while (not must_quote) and (j<t) do begin
- must_quote:=str_pool[j]=" "; incr(j);
- end;
- if must_quote then begin
- str_pool[t+1]:="""";
- for j:=t-1 downto s do str_pool[j+1]:=str_pool[j];
- str_pool[s]:="""";
- pool_ptr:=pool_ptr+2;
- end;
- end;
-@z
-
-@x
- str_start_macro(str_ptr+1):=str_start_macro(str_ptr)+area_delimiter; incr(str_ptr);
- end;
-if ext_delimiter=0 then
- begin cur_ext:=""; cur_name:=make_string;
-@y
- str_start_macro(str_ptr+1):=str_start_macro(str_ptr)+area_delimiter; incr(str_ptr);
- temp_str:=search_string(cur_area);
- if temp_str>0 then
- begin cur_area:=temp_str;
- decr(str_ptr); {no |flush_string|, |pool_ptr| will be wrong!}
- for j:=str_start_macro(str_ptr+1) to pool_ptr-1 do
- begin str_pool[j-area_delimiter]:=str_pool[j];
- end;
- pool_ptr:=pool_ptr-area_delimiter; {update |pool_ptr|}
- end;
- end;
-if ext_delimiter=0 then
- begin cur_ext:=""; cur_name:=slow_make_string;
-@z
-
-@x
-else begin cur_name:=str_ptr;
- str_start_macro(str_ptr+1):=str_start_macro(str_ptr)+ext_delimiter-area_delimiter-1;
- incr(str_ptr); cur_ext:=make_string;
-@y
-else begin cur_name:=str_ptr;
- str_start_macro(str_ptr+1):=str_start_macro(str_ptr)+ext_delimiter-area_delimiter-1;
- incr(str_ptr); cur_ext:=make_string;
- decr(str_ptr); {undo extension string to look at name part}
- temp_str:=search_string(cur_name);
- if temp_str>0 then
- begin cur_name:=temp_str;
- decr(str_ptr); {no |flush_string|, |pool_ptr| will be wrong!}
- for j:=str_start_macro(str_ptr+1) to pool_ptr-1 do
- begin str_pool[j-ext_delimiter+area_delimiter+1]:=str_pool[j];
- end;
- pool_ptr:=pool_ptr-ext_delimiter+area_delimiter+1; {update |pool_ptr|}
- end;
- cur_ext:=slow_make_string; {remake extension string}
-@z
-
-@x
-begin slow_print(a); slow_print(n); slow_print(e);
-@y
-var must_quote: boolean; {whether to quote the filename}
-@!j:pool_pointer; {index into |str_pool|}
-begin
-must_quote:=false;
-if a<>0 then begin
- j:=str_start_macro(a);
- while (not must_quote) and (j<str_start_macro(a+1)) do begin
- must_quote:=str_pool[j]=" "; incr(j);
- end;
-end;
-if n<>0 then begin
- j:=str_start_macro(n);
- while (not must_quote) and (j<str_start_macro(n+1)) do begin
- must_quote:=str_pool[j]=" "; incr(j);
- end;
-end;
-if e<>0 then begin
- j:=str_start_macro(e);
- while (not must_quote) and (j<str_start_macro(e+1)) do begin
- must_quote:=str_pool[j]=" "; incr(j);
- end;
-end;
-{FIXME: Alternative is to assume that any filename that has to be quoted has
- at least one quoted component...if we pick this, a number of insertions
- of |print_file_name| should go away.
-|must_quote|:=((|a|<>0)and(|str_pool|[|str_start|[|a|]]=""""))or
- ((|n|<>0)and(|str_pool|[|str_start|[|n|]]=""""))or
- ((|e|<>0)and(|str_pool|[|str_start|[|e|]]=""""));}
-if must_quote then print_char("""");
-if a<>0 then
- for j:=str_start_macro(a) to str_start_macro(a+1)-1 do
- if so(str_pool[j])<>"""" then
- print(so(str_pool[j]));
-if n<>0 then
- for j:=str_start_macro(n) to str_start_macro(n+1)-1 do
- if so(str_pool[j])<>"""" then
- print(so(str_pool[j]));
-if e<>0 then
- for j:=str_start_macro(e) to str_start_macro(e+1)-1 do
- if so(str_pool[j])<>"""" then
- print(so(str_pool[j]));
-if must_quote then print_char("""");
-@z
-
-@x
@d append_to_name(#)==begin c:=#; incr(k);
if k<=file_name_size then nameoffile[k]:=xchr[c];
end
@@ -1319,78 +1032,6 @@ nameoffile[namelength+1]:=0;
@z
@x
-@p function make_name_string:str_number;
-var k:1..file_name_size; {index into |nameoffile|}
-begin if (pool_ptr+namelength>pool_size)or(str_ptr=max_strings)or
- (cur_length>0) then
- make_name_string:="?"
-else begin for k:=1 to namelength do append_char(nameoffile[k]);
- make_name_string:=make_string;
- end;
-@y
-@p function make_name_string:str_number;
-var k:1..file_name_size; {index into |nameoffile|}
-save_area_delimiter, save_ext_delimiter: pool_pointer;
-save_name_in_progress, save_stop_at_space: boolean;
-begin if (pool_ptr+namelength>pool_size)or(str_ptr=max_strings)or
- (cur_length>0) then
- make_name_string:="?"
-else begin for k:=1 to namelength do append_char(nameoffile[k]);
- make_name_string:=make_string;
- {At this point we also set |cur_name|, |cur_ext|, and |cur_area| to
- match the contents of |nameoffile|.}
- save_area_delimiter:=area_delimiter;
- save_ext_delimiter:=ext_delimiter;
- save_name_in_progress:=name_in_progress;
- save_stop_at_space:=stop_at_space;
- name_in_progress:=true;
- begin_name;
- stop_at_space:=false;
- k:=1;
- while (k<=namelength)and(more_name(nameoffile[k])) do
- incr(k);
- stop_at_space:=save_stop_at_space;
- end_name;
- name_in_progress:=save_name_in_progress;
- area_delimiter:=save_area_delimiter;
- ext_delimiter:=save_ext_delimiter;
- end;
-@z
-
-@x
- if not more_name(cur_chr) then goto done;
-@y
- {If |cur_chr| is a space and we're not scanning a token list, check
- whether we're at the end of the buffer. Otherwise we end up adding
- spurious spaces to file names in some cases.}
- if (cur_chr=" ") and (state<>token_list) and (loc>limit) then goto done;
- if not more_name(cur_chr) then goto done;
-@z
-
-@x
-var k:0..buf_size; {index into |buffer|}
-@y
-var k:0..buf_size; {index into |buffer|}
-@!saved_cur_name:str_number; {to catch empty terminal input}
-@z
-
-@x
-if e=".tex" then show_context;
-@y
-if (e=".tex") or (e="") then show_context;
-@z
-
-@x
-clear_terminal; prompt_input(": "); @<Scan file name in the buffer@>;
-if cur_ext="" then cur_ext:=e;
-@y
-saved_cur_name:=cur_name;
-clear_terminal; prompt_input(": "); @<Scan file name in the buffer@>;
-if cur_ext="" then cur_ext:=e;
-if length(cur_name)=0 then cur_name:=saved_cur_name;
-@z
-
-@x
@d ensure_dvi_open==if output_file_name=0 then
@y
@d log_name == texmf_log_name
@@ -1409,14 +1050,14 @@ if job_name=0 then job_name:="texput";
@y
if job_name=0 then job_name:=getjobname("texput");
@.texput@>
-pack_job_name(".fls");
+pack_job_name('.fls');
recorder_change_filename(stringcast(nameoffile+1));
@z
@x
begin wlog(banner);
@y
-begin if srcspecialsp or filelineerrorstylep or parsefirstlinep
+begin if filelineerrorstylep or parsefirstlinep
then
wlog(banner_k)
else
@@ -1447,10 +1088,6 @@ if shellenabledp then begin
end;
wlog('\write18 enabled.')
end;
-if srcspecialsp then begin
- wlog_cr;
- wlog(' Source specials enabled.')
- end;
if filelineerrorstylep then begin
wlog_cr;
wlog(' file:line:error style messages enabled.')
@@ -1463,9 +1100,9 @@ end
@z
@x
- prompt_file_name("input file name",".tex");
+ prompt_file_name('input file name','.tex');
@y
- prompt_file_name("input file name","");
+ prompt_file_name('input file name','');
@z
@x
@@ -1613,9 +1250,6 @@ endifn ('IPC')
continue: adjust_space_factor;@/
@y
@<Append character |cur_chr|...@>=
-if ((head=tail) and (mode>0)) then begin
- if (insertsrcspecialauto) then append_src_special;
-end;
continue: adjust_space_factor;@/
@z
@@ -1635,7 +1269,6 @@ if indented then begin
p:=new_null_box; box_dir(p):=par_direction;
width(p):=par_indent;@+
tail_append(p);
- if (insertsrcspecialeverypar) then insert_src_special;@+
@z
@x
@@ -1657,20 +1290,6 @@ end;
@z
@x
-if every_math<>null then begin_token_list(every_math,every_math_text);
-@y
-if (insertsrcspecialeverymath) then insert_src_special;
-if every_math<>null then begin_token_list(every_math,every_math_text);
-@z
-
-@x
- if every_vbox<>null then begin_token_list(every_vbox,every_vbox_text);
-@y
- if (insertsrcspecialeveryvbox) then insert_src_special;
- if every_vbox<>null then begin_token_list(every_vbox,every_vbox_text);
-@z
-
-@x
if (cur_cs=0)or(cur_cs>frozen_control_sequence) then
@y
if (cur_cs=0)or(cur_cs>eqtb_top)or
@@ -1678,11 +1297,6 @@ if (cur_cs=0)or(cur_cs>eqtb_top)or
@z
@x
-@!flushable_string:str_number; {string not yet referenced}
-@y
-@z
-
-@x
interaction:=cur_chr;
@y
interaction:=cur_chr;
@@ -1774,7 +1388,7 @@ if x<>@$ then goto bad_fmt; {check that strings are the same}
@y
@+Init
libcfree(str_pool); libcfree(str_start);
-libcfree(yhash); libcfree(zeqtb); libcfree(fixmem); libcfree(varmem);
+libcfree(yhash); libcfree(zeqtb); libcfree(fixmem); libcfree(varmemcast(varmem));
@+Tini
undump_int(x);
format_debug('format magic number')(x);
@@ -2065,8 +1679,8 @@ print(" (format="); print(job_name); print_char(" ");
@d setup_bound_var(#)==bound_default:=#; setup_bound_var_end
@d setup_bound_var_end(#)==bound_name:=#; setup_bound_var_end_end
@d setup_bound_var_end_end(#)==if luainit>0 then begin
- get_lua_number('texconfig',bound_name,addressof(#));
- if #=0 then #:=bound_default;
+ get_lua_number('texconfig',bound_name,addressof(#));
+ if #=0 then #:=bound_default;
end
else
setupboundvariable(addressof(#), bound_name, bound_default);
@@ -2201,7 +1815,7 @@ end {|main_body|};
@x
wterm(banner);
@y
- if srcspecialsp or filelineerrorstylep or parsefirstlinep then
+ if filelineerrorstylep or parsefirstlinep then
wterm(banner_k)
else
wterm(banner);
@@ -2222,9 +1836,6 @@ end {|main_body|};
end;
wterm_ln('\write18 enabled.');
end;
- if srcspecialsp then begin
- wterm_ln(' Source specials enabled.')
- end;
if filelineerrorstylep then begin
wterm_ln(' file:line:error style messages enabled.')
end;
@@ -2301,13 +1912,6 @@ tini@/
@z
@x
-primitive("special",extension,special_node);@/
-@y
-primitive("special",extension,special_node);@/
-text(frozen_special):="special"; eqtb[frozen_special]:=eqtb[cur_val];@/
-@z
-
-@x
else if cur_val>15 then cur_val:=16;
@y
else if (cur_val>15) and (cur_val <> 18) then cur_val:=16;
@@ -2350,7 +1954,7 @@ if j=18 then
str_room(1); append_char(0); {Append a null byte to the expansion.}
clobbered:=false;
for d:=0 to cur_length-1 do {Convert to external character set.}
- begin
+ begin
str_pool[str_start_macro(str_ptr)+d]:=xchr[str_pool[str_start_macro(str_ptr)+d]];
if (str_pool[str_start_macro(str_ptr)+d]=null_code)
and (d<cur_length-1) then clobbered:=true;
@@ -2589,44 +2193,6 @@ exit:end;
@* \[55] Index.
@y
-@ @<Declare action procedures for use by |main_control|@>=
-
-procedure insert_src_special;
-var toklist, p, q,r : pointer;
-begin
- if (source_filename_stack[in_open] > 0 and isnewsource (source_filename_stack[in_open]
-, line)) then begin
- toklist := get_avail;
- p := toklist;
- info(p) := cs_token_flag+frozen_special;
- r := get_avail; link(p):=r; p := link(p);
- info(p) := left_brace_token+"{";
- q := str_toks (makesrcspecial (source_filename_stack[in_open], line));
- link(p) := link(temp_token_head);
- p := q;
- r := get_avail; link(p):=r; p := link(p);
- info(p) := right_brace_token+"}";
- ins_list (toklist);
- remembersourceinfo (source_filename_stack[in_open], line);
- end;
-end;
-
-procedure append_src_special;
-var q : pointer;
-begin
- if (source_filename_stack[in_open] > 0 and isnewsource (source_filename_stack[in_open]
-, line)) then begin
- new_whatsit (special_node);
- write_stream(tail) := 0;
- q:=get_avail; def_ref := q;
- token_ref_count(def_ref) := null;
- q := str_toks (makesrcspecial (source_filename_stack[in_open], line));
- link(def_ref) := link(temp_head);
- write_tokens(tail) := def_ref;
- remembersourceinfo (source_filename_stack[in_open], line);
- end;
-end;
-
@ This function used to be in pdftex, but is useful in tex too.
@p function get_nullstr: str_number;
diff --git a/Build/source/texk/web2c/luatexdir/luatex.defines b/Build/source/texk/web2c/luatexdir/luatex.defines
index 7a1ac4e79d8..b4e5baeba34 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.defines
+++ b/Build/source/texk/web2c/luatexdir/luatex.defines
@@ -1,26 +1,28 @@
-{
-Copyright (c) 1996-2006, 2008 Han The Thanh, Taco Hoekwater
+{ luatex.defines
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of luaTeX.
+ This file is part of LuaTeX.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. }
-$Id$
-}
+{ $Id$ }
-{ luatex.defines: additions for luaTeX }
+{ luatex.defines: additions for LuaTeX }
+
+@define function simple_advance_width();
@define function new_node();
@define function new_glyph_node;
@@ -61,7 +63,6 @@ $Id$
@define function make_lang_data();
@define procedure ext_do_line_break();
@define procedure initialize_active;
-@define var active_node_size;
@define var prev_char_p;
@define function cur_break();
@define function break_node();
@@ -75,10 +76,16 @@ $Id$
@define procedure dump_language_data;
@define procedure undump_language_data;
@define function insert_discretionary();
+@define function compound_word_break();
@define procedure set_pre_hyphen_char();
@define procedure set_post_hyphen_char();
+@define procedure set_pre_exhyphen_char();
+@define procedure set_post_exhyphen_char();
@define function get_pre_hyphen_char();
@define function get_post_hyphen_char();
+@define function get_pre_exhyphen_char();
+@define function get_post_exhyphen_char();
+
{ macros from luatex.h }
@define function pdf_char_marked();
@@ -91,15 +98,13 @@ $Id$
@define procedure luacall();
@define procedure luatokencall();
@define procedure closelua();
+@define function get_lua_name();
+
+{ for virtual file input }
-@define function luacstring_input;
-@define function luacstring_penultimate;
-@define function luacstring_detokenized;
-@define function luacstring_cattable;
-@define function luacstring_defaultcattable;
-@define function luacstring_simple;
@define procedure luacstring_close();
@define procedure luacstring_start();
+@define var DEFAULT_CAT_TABLE;
{ for callbacks }
@@ -146,11 +151,13 @@ $Id$
@define var define_font_callback;
@define var token_filter_callback;
@define var pre_linebreak_filter_callback;
+@define var linebreak_filter_callback;
@define var post_linebreak_filter_callback;
@define var buildpage_filter_callback;
@define var hyphenate_callback;
@define function lua_hyphenate_callback();
+@define function lua_linebreak_callback();
@define procedure get_saved_lua_boolean();
@define procedure get_saved_lua_number();
@@ -167,16 +174,39 @@ $Id$
{ bits for extended char code access }
+@define const tex_mathcode ;
+@define const aleph_mathcode ;
+@define const xetex_mathcode ;
+@define const xetexnum_mathcode;
+
+@define type mathcodeval;
+@define @field origin_value;
+@define @field class_value;
+@define @field family_value;
+@define @field character_value;
+
+@define type delcodeval;
+@define @field small_family_value;
+@define @field small_character_value;
+@define @field large_family_value;
+@define @field large_character_value;
+
@define function get_math_code();
+@define function get_math_code_num();
@define procedure set_math_code();
-@define function get_del_code_a();
-@define function get_del_code_b();
+@define function get_del_code();
@define procedure set_del_code();
+@define procedure show_mathcode_value();
+
+@define function scan_mathchar();
+@define function scan_delimiter_as_mathchar();
+@define function mathchar_from_integer();
@define procedure unsave_math_codes ();
@define procedure initialize_math_codes;
@define procedure dump_math_codes;
@define procedure undump_math_codes;
+@define procedure free_math_codes;
@define function get_lc_code();
@define procedure set_lc_code();
@@ -197,6 +227,7 @@ $Id$
@define procedure unsave_cat_codes ();
@define procedure unsave_text_codes ();
@define procedure initializetextcodes;
+@define procedure free_text_codes;
@define procedure dumptextcodes;
@define procedure undumptextcodes;
@@ -209,6 +240,8 @@ $Id$
@define procedure flush_loggable_info;
@define var extra_version_info;
+@define var SVN_REV;
+@define procedure do_write_wterm();
{ bits and pieces from aleph }
@@ -227,6 +260,8 @@ $Id$
@define procedure undump_ocp_table ();
@define procedure run_external_ocp ();
+@define function copy_font_info();
+
{ 'texfont' library definitions }
@define procedure dump_font ();
@@ -404,6 +439,13 @@ $Id$
@define procedure writefontstuff;
+{functions from filename.c }
+@define procedure pack_job_name();
+@define procedure prompt_file_name();
+@define procedure scan_file_name;
+@define function make_name_string;
+@define procedure print_file_name();
+
{ functions from utils.c }
@define procedure escapehex();
@define procedure escapename();
@@ -445,6 +487,9 @@ $Id$
@define function getlly;
@define function geturx;
@define function getury;
+@define function pdf_do_page_divert();
+@define procedure pdf_do_page_undivert();
+@define function output_pages_tree;
{functions from texpdf.c }
@@ -457,6 +502,9 @@ $Id$
{functions from textoken.c }
@define function get_next;
+@define function scan_keyword();
+@define procedure scan_direction;
+@define function active_to_cs();
{ functions from vfpacket.c }
@define function new_vf_packet();
@@ -471,10 +519,13 @@ $Id$
@define function check_image_b();
@define function check_image_c();
@define function check_image_i();
+@define function epdf_xsize();
+@define function epdf_ysize();
@define function epdf_orig_x();
@define function epdf_orig_y();
@define function image_pages();
@define function image_colordepth();
+@define function image_groupref();
@define function image_index();
@define function image_width();
@define function image_height();
@@ -482,6 +533,7 @@ $Id$
@define function image_objnum();
@define function image_imgnum();
@define function is_pdf_image();
+@define function is_png_image();
@define function read_image();
@define function new_image_entry;
@define procedure update_image_procset();
@@ -491,8 +543,20 @@ $Id$
@define procedure set_image_index();
@define procedure out_image();
+@define procedure dumpimagemeta;
+@define procedure undumpimagemeta();
+
{ functions from limglib.c }
-@define procedure lua_setximage();
+
+{ functions from pdfpage.c }
+@define procedure pdf_place_rule();
+@define procedure pdf_place_glyph();
+@define procedure pdf_place_form();
+@define procedure pdf_goto_pagemode;
+@define procedure pdf_page_init;
+@define procedure pdf_set_pos();
+@define procedure pdf_end_string_nl;
+@define procedure pdf_print_charwidth();
{ functions from writet3.c }
@define function get_pk_char_width();
@@ -507,6 +571,9 @@ $Id$
{ functions from tounicode.c }
@define procedure def_tounicode();
+{ functions from luatex.web }
+@define function auto_expand_vf();
+
{ end of luatex.defines }
{texmf.defines}
@@ -556,3 +623,276 @@ $Id$
@define procedure write_ln ();
@define procedure recorder_change_filename ();
+
+{ functions from the synctex controller in synctex.c }
+
+@define procedure synctex_init_command;
+@define procedure synctex_start_input;
+@define procedure synctex_terminate();
+@define procedure synctex_sheet();
+@define procedure synctex_teehs;
+@define procedure synctex_vlist();
+@define procedure synctex_tsilv();
+@define procedure synctex_void_vlist();
+@define procedure synctex_hlist();
+@define procedure synctex_tsilh();
+@define procedure synctex_void_hlist();
+@define procedure synctex_math();
+@define procedure synctex_kern();
+@define procedure synctex_char();
+@define procedure synctex_node();
+@define procedure synctex_current;
+@define procedure synctex_horizontal_rule_or_glue();
+
+{math stuff}
+
+@define procedure initialize_math;
+@define procedure show_math_node();
+@define procedure print_math_comp();
+@define procedure print_limit_switch();
+@define procedure print_style();
+
+@define procedure scan_extdef_math_code();
+@define procedure scan_extdef_del_code();
+
+@define function fam_fnt();
+@define procedure def_fam_fnt();
+@define procedure dump_math_data;
+@define procedure undump_math_data;
+@define procedure unsave_math_data();
+
+@define const fence_noad;
+@define const ord_noad;
+@define const op_noad;
+@define const bin_noad;
+@define const rel_noad;
+@define const open_noad;
+@define const close_noad;
+@define const punct_noad;
+@define const inner_noad;
+@define const limits;
+@define const no_limits;
+@define const under_noad;
+@define const over_noad;
+@define const accent_noad;
+@define const vcenter_noad;
+
+@define const left_noad_side ;
+@define const middle_noad_side ;
+@define const right_noad_side ;
+
+@define procedure print_size();
+@define procedure finish_display_alignment();
+@define function new_sub_box();
+@define function math_vcenter_group();
+@define procedure close_math_group();
+@define procedure set_math_char();
+@define function new_style();
+@define const display_style;
+@define const text_style;
+@define const script_style;
+@define const script_script_style;
+@define const cramped_display_style;
+@define const cramped_text_style;
+@define const cramped_script_style;
+@define const cramped_script_script_style;
+
+@define procedure def_math_param();
+@define procedure print_math_param();
+@define function get_math_param();
+@define procedure math_char_in_text();
+
+
+@define const math_param_quad;
+@define const math_param_axis;
+@define const math_param_operator_size;
+@define const math_param_overbar_kern;
+@define const math_param_overbar_rule;
+@define const math_param_overbar_vgap;
+@define const math_param_underbar_kern;
+@define const math_param_underbar_rule;
+@define const math_param_underbar_vgap;
+@define const math_param_radical_kern;
+@define const math_param_radical_rule;
+@define const math_param_radical_vgap;
+@define const math_param_radical_degree_before;
+@define const math_param_radical_degree_after;
+@define const math_param_radical_degree_raise;
+@define const math_param_stack_vgap;
+@define const math_param_stack_num_up;
+@define const math_param_stack_denom_down;
+@define const math_param_fraction_rule;
+@define const math_param_fraction_num_vgap;
+@define const math_param_fraction_num_up;
+@define const math_param_fraction_denom_vgap;
+@define const math_param_fraction_denom_down;
+@define const math_param_fraction_del_size;
+@define const math_param_limit_above_vgap;
+@define const math_param_limit_above_bgap;
+@define const math_param_limit_above_kern;
+@define const math_param_limit_below_vgap;
+@define const math_param_limit_below_bgap;
+@define const math_param_limit_below_kern;
+@define const math_param_under_delimiter_vgap;
+@define const math_param_under_delimiter_bgap;
+@define const math_param_over_delimiter_vgap;
+@define const math_param_over_delimiter_bgap;
+@define const math_param_sub_shift_drop;
+@define const math_param_sup_shift_drop;
+@define const math_param_sub_shift_down;
+@define const math_param_sub_sup_shift_down;
+@define const math_param_sub_top_max;
+@define const math_param_sup_shift_up;
+@define const math_param_sup_bottom_min;
+@define const math_param_sup_sub_bottom_max;
+@define const math_param_subsup_vgap;
+@define const math_param_space_after_script;
+@define const math_param_connector_overlap_min;
+@define const math_param_first_mu_glue;
+@define const math_param_ord_ord_spacing;
+@define const math_param_ord_op_spacing;
+@define const math_param_ord_bin_spacing;
+@define const math_param_ord_rel_spacing;
+@define const math_param_ord_open_spacing;
+@define const math_param_ord_close_spacing;
+@define const math_param_ord_punct_spacing;
+@define const math_param_ord_inner_spacing;
+@define const math_param_op_ord_spacing;
+@define const math_param_op_op_spacing;
+@define const math_param_op_bin_spacing;
+@define const math_param_op_rel_spacing;
+@define const math_param_op_open_spacing;
+@define const math_param_op_close_spacing;
+@define const math_param_op_punct_spacing;
+@define const math_param_op_inner_spacing;
+@define const math_param_bin_ord_spacing;
+@define const math_param_bin_op_spacing;
+@define const math_param_bin_bin_spacing;
+@define const math_param_bin_rel_spacing;
+@define const math_param_bin_open_spacing;
+@define const math_param_bin_close_spacing;
+@define const math_param_bin_punct_spacing;
+@define const math_param_bin_inner_spacing;
+@define const math_param_rel_ord_spacing;
+@define const math_param_rel_op_spacing;
+@define const math_param_rel_bin_spacing;
+@define const math_param_rel_rel_spacing;
+@define const math_param_rel_open_spacing;
+@define const math_param_rel_close_spacing;
+@define const math_param_rel_punct_spacing;
+@define const math_param_rel_inner_spacing;
+@define const math_param_open_ord_spacing;
+@define const math_param_open_op_spacing;
+@define const math_param_open_bin_spacing;
+@define const math_param_open_rel_spacing;
+@define const math_param_open_open_spacing;
+@define const math_param_open_close_spacing;
+@define const math_param_open_punct_spacing;
+@define const math_param_open_inner_spacing;
+@define const math_param_close_ord_spacing;
+@define const math_param_close_op_spacing;
+@define const math_param_close_bin_spacing;
+@define const math_param_close_rel_spacing;
+@define const math_param_close_open_spacing;
+@define const math_param_close_close_spacing;
+@define const math_param_close_punct_spacing;
+@define const math_param_close_inner_spacing;
+@define const math_param_punct_ord_spacing;
+@define const math_param_punct_op_spacing;
+@define const math_param_punct_bin_spacing;
+@define const math_param_punct_rel_spacing;
+@define const math_param_punct_open_spacing;
+@define const math_param_punct_close_spacing;
+@define const math_param_punct_punct_spacing;
+@define const math_param_punct_inner_spacing;
+@define const math_param_inner_ord_spacing;
+@define const math_param_inner_op_spacing;
+@define const math_param_inner_bin_spacing;
+@define const math_param_inner_rel_spacing;
+@define const math_param_inner_open_spacing;
+@define const math_param_inner_close_spacing;
+@define const math_param_inner_punct_spacing;
+@define const math_param_inner_inner_spacing;
+
+
+@define const hlist_node;
+@define const vlist_node;
+@define const rule_node;
+@define const ins_node;
+@define const mark_node;
+@define const adjust_node;
+@define const disc_node;
+@define const whatsit_node;
+@define const math_node;
+@define const glue_node;
+@define const kern_node;
+@define const penalty_node;
+@define const unset_node;
+@define const margin_kern_node;
+@define const glyph_node;
+@define const align_record_node;
+@define const inserting_node;
+@define const split_up_node;
+@define const expr_node;
+@define const span_node;
+@define const action_node;
+@define const glue_spec_node;
+@define const temp_node;
+@define const align_stack_node;
+@define const movement_node;
+@define const if_node;
+@define const shape_node;
+
+@define const write_node_size;
+@define const open_node_size;
+
+@define procedure print_short_node_contents();
+@define procedure show_node_list();
+
+@define const zero_glue ;
+@define const sfi_glue ;
+@define const fil_glue ;
+@define const fill_glue ;
+@define const ss_glue ;
+@define const fil_neg_glue ;
+@define const page_ins_head ;
+@define const contrib_head ;
+@define const page_head ;
+@define const temp_head ;
+@define const hold_head ;
+@define const adjust_head ;
+@define const pre_adjust_head ;
+@define const align_head ;
+@define const end_span ;
+
+
+@define const tex_command;
+@define const etex_command;
+@define const aleph_command;
+@define const pdftex_command;
+@define const luatex_command;
+
+@define procedure primitive_tex();
+@define procedure primitive_etex();
+@define procedure primitive_aleph();
+@define procedure primitive_omega();
+@define procedure primitive_pdftex();
+@define procedure primitive_luatex();
+@define procedure primitive_core();
+@define procedure print_cmd_chr();
+
+@define procedure init_primitives;
+@define procedure ini_init_primitives;
+@define procedure dump_primitives;
+@define procedure undump_primitives;
+@define function compute_pool_hash();
+
+@define const undefined_primitive;
+@define const hash_prime;
+
+@define function get_prim_eq_type();
+@define function get_prim_equiv();
+@define function prim_lookup();
+@define function id_lookup();
+
+@define procedure tex_def_font();
diff --git a/Build/source/texk/web2c/luatexdir/luatex.h b/Build/source/texk/web2c/luatexdir/luatex.h
index aef2f355396..2ee976b478e 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.h
+++ b/Build/source/texk/web2c/luatexdir/luatex.h
@@ -1,69 +1,29 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* luatex.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-$Id $
-*/
-
-/* some code array functions */
-
-extern void set_math_code (integer n, halfword v, quarterword grouplevel);
-extern halfword get_math_code (integer n);
-
-extern void set_del_code (integer n, halfword v, halfword w, quarterword grouplevel);
-extern halfword get_del_code_a (integer n);
-extern halfword get_del_code_b (integer n);
-
-extern void unsavemathcodes (quarterword grouplevel);
-extern void initializemathcodes ();
-extern void dumpmathcodes ();
-extern void undumpmathcodes ();
-
-extern void set_lc_code (integer n, halfword v, quarterword grouplevel);
-extern halfword get_lc_code (integer n);
-extern void set_uc_code (integer n, halfword v, quarterword grouplevel);
-extern halfword get_uc_code (integer n);
-extern void set_sf_code (integer n, halfword v, quarterword grouplevel);
-extern halfword get_sf_code (integer n);
-extern void set_cat_code (integer h, integer n, halfword v, quarterword grouplevel);
-extern halfword get_cat_code (integer h, integer n);
-
-extern void unsavetextcodes (quarterword grouplevel);
-extern void unsavecatcodes (integer h,quarterword grouplevel);
-extern void copy_cat_codes (int from, int to);
-extern void initex_cat_codes (int h);
-extern void clearcatcodestack (integer h);
-extern boolean validcatcodetable (int h);
-
-extern void initializetextcodes ();
-extern void dumptextcodes ();
-extern void undumptextcodes ();
-
-typedef enum {
- escape, left_brace, right_brace, math_shift,
- tab_mark, car_ret, mac_param, sup_mark,
- sub_mark, ignore, spacer, letter,
- other_char, active_char, comment, invalid_char } cat_codes;
+/* $Id$ */
extern void do_vf(internal_font_number tmp_f);
-extern int readbinfile(FILE *f, unsigned char **b, integer *s);
+extern int readbinfile(FILE * f, unsigned char **b, integer * s);
#define read_tfm_file readbinfile
#define read_vf_file readbinfile
@@ -99,7 +59,7 @@ extern void b_test_in();
#define vf_b_open_in(f) \
open_input (&(f), kpse_vf_format, FOPEN_RBIN_MODE)
-extern int open_outfile(FILE **f, char *name, char *mode);
+extern int open_outfile(FILE ** f, char *name, char *mode);
#define do_a_open_out(f) open_outfile(&(f),(char *)(nameoffile+1),FOPEN_W_MODE)
#define do_b_open_out(f) open_outfile(&(f),(char *)(nameoffile+1),FOPEN_WBIN_MODE)
@@ -111,63 +71,10 @@ extern int open_outfile(FILE **f, char *name, char *mode);
extern volatile memory_word *varmem;
extern halfword var_mem_min;
extern halfword var_mem_max;
-extern halfword get_node (integer s);
-extern void free_node (halfword p, integer s) ;
-extern void init_node_mem (integer r, integer s) ;
-extern void dump_node_mem (void) ;
-extern void undump_node_mem (void);
-
-
-typedef enum {
- find_write_file_callback = 1,
- find_output_file_callback,
- find_image_file_callback,
- find_format_file_callback,
- find_read_file_callback, open_read_file_callback,
- find_ocp_file_callback, read_ocp_file_callback,
- find_vf_file_callback, read_vf_file_callback,
- find_data_file_callback, read_data_file_callback,
- find_font_file_callback, read_font_file_callback,
- find_map_file_callback, read_map_file_callback,
- find_enc_file_callback, read_enc_file_callback,
- find_type1_file_callback, read_type1_file_callback,
- find_truetype_file_callback, read_truetype_file_callback,
- find_opentype_file_callback, read_opentype_file_callback,
- find_sfd_file_callback, read_sfd_file_callback,
- find_pk_file_callback, read_pk_file_callback,
- show_error_hook_callback,
- process_input_buffer_callback,
- start_page_number_callback, stop_page_number_callback,
- start_run_callback, stop_run_callback,
- define_font_callback,
- token_filter_callback,
- pre_output_filter_callback,
- buildpage_filter_callback,
- hpack_filter_callback, vpack_filter_callback,
- char_exists_callback,
- hyphenate_callback,
- ligaturing_callback,
- kerning_callback,
- pre_linebreak_filter_callback,
- linebreak_filter_callback,
- post_linebreak_filter_callback,
- total_callbacks } callback_callback_types;
-
-extern int callback_set[];
-
-#define callback_defined(a) callback_set[a]
-
-extern int run_callback (int i, char *values, ...);
-extern int run_saved_callback (int i, char *name, char *values, ...);
-extern int run_and_save_callback (int i, char *values, ...);
-extern void destroy_saved_callback (int i);
-
-extern void get_saved_lua_boolean (int i, char *name, boolean *target);
-extern void get_saved_lua_number (int i, char *name, integer *target);
-extern void get_saved_lua_string (int i, char *name, char **target);
-
-extern void get_lua_boolean (char *table, char *name, boolean *target);
-extern void get_lua_number (char *table, char *name, integer *target);
-extern void get_lua_string (char *table, char *name, char **target);
+extern halfword get_node(integer s);
+extern void free_node(halfword p, integer s);
+extern void init_node_mem(integer s);
+extern void dump_node_mem(void);
+extern void undump_node_mem(void);
#include <luatexdir/ptexlib.h>
diff --git a/Build/source/texk/web2c/luatexdir/luatex.mk b/Build/source/texk/web2c/luatexdir/luatex.mk
index fdc7df211bd..6a0a5d6386d 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.mk
+++ b/Build/source/texk/web2c/luatexdir/luatex.mk
@@ -1,6 +1,7 @@
# Makefile fragment for pdfeTeX and web2c. --infovore@xs4all.nl. Public domain.
# This fragment contains the parts of the makefile that are most likely to
-# differ between releases of pdfeTeX.
+# differ between releases of luatex
+# $Id$
# We build luatex
luatex = @LTEX@ luatex
@@ -19,11 +20,12 @@ LIBXPDFSRCDIR=$(srcdir)/$(LIBXPDFDIR)
LIBOBSDCOMPATDIR=../../libs/obsdcompat
LIBOBSDCOMPATFSRCDIR=$(srcdir)/$(LIBOBSDCOMPATDIR)
-XCPPFLAGS=-I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/.. -I$(ZLIBSRCDIR) -I$(LIBPNGSRCDIR) -I$(LIBXPDFSRCDIR) -Dextra_version_info=`date +-%Y%m%d%H`
+SVN_REV := $(shell $(srcdir)/$(luatexdir)/get_svnversion.sh $(srcdir))
+
+XCPPFLAGS=-I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) -I$(LIBOBSDCOMPATFSRCDIR)/.. -I$(ZLIBSRCDIR) -I$(LIBPNGSRCDIR) -I$(LIBXPDFSRCDIR) -Dextra_version_info=`date +-%Y%m%d%H` -DSVN_REV=\"$(SVN_REV)\"
Makefile: $(srcdir)/$(luatexdir)/luatex.mk
-# luatex_bin = luatex ttf2afm pdftosrc
luatex_bin = luatex
linux_build_dir = $(HOME)/luatex/build/linux/texk/web2c
@@ -36,24 +38,25 @@ $(luatexdir)/luatex.version: $(srcdir)/$(luatexdir)/luatex.web
>$(luatexdir)/luatex.version
# The C sources.
-luatex_c = luatexini.c luatex0.c luatex1.c luatex2.c luatex3.c
-luatex_o = luatexini.o luatex0.o luatex1.o luatex2.o luatex3.o luatexextra.o loadpool.o
+luatex_c = luatexini.c luatex0.c
+luatex_o = luatexini.o luatex0.o luatexextra.o luatex-pool.o $(luatex_o-with_synctex)
# Making luatex
luatex: luatexd.h $(luatex_o) $(luatexextra_o) $(luatexlibsdep)
- @CXXHACKLINK@ $(luatex_o) $(luatexextra_o) $(luatexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
+ @CXXHACKLINK@ $(luatex_o) $(luatexextra_o) $(luatexlibs) $(socketlibs) @SOCKETHACK@ @CXXHACKLDLIBS@ @CXXLDEXTRA@
# C file dependencies.
$(luatex_c) luatexcoerce.h luatexd.h: luatex.p $(web2c_texmf) $(srcdir)/$(luatexdir)/luatex.defines $(srcdir)/$(luatexdir)/luatex.h
$(web2c) luatex
-luatexextra.c: $(luatexdir)/luatexextra.h lib/texmfmp.c
+# $(luatexd.h-with_synctex)
+luatexextra.c: luatexd.h $(luatexdir)/luatexextra.h lib/texmfmp.c
test -d $(luatexdir) || mkdir $(luatexdir)
sed s/TEX-OR-MF-OR-MP/luatex/ $(srcdir)/lib/texmfmp.c >$@
$(luatexdir)/luatexextra.h: $(luatexdir)/luatexextra.in $(luatexdir)/luatex.version
test -d $(luatexdir) || mkdir $(luatexdir)
sed -e s/LUATEX-VERSION/`cat $(luatexdir)/luatex.version`/ \
$(srcdir)/$(luatexdir)/luatexextra.in >$@
-loadpool.c: luatex.pool $(makecpool)
+luatex-pool.c: luatex.pool
$(makecpool) luatex.pool luatexdir/ptexlib.h >$@ || rm -f $@
# luatangle we need a private version of tangle
@@ -83,8 +86,8 @@ luatex.p luatex.pool: luatangle $(srcdir)/$(luatexdir)/luatex.web $(srcdir)/$(lu
# for developing only
#luatex-org.web: $(TIE) $(luatex_ch_srcs_org)
# $(TIE) -m $@ $(luatex_ch_srcs_org)
-#luatex-all.web: $(TIE) $(srcdir)/$(luatexdir)/luatex.web luatex.ch
-# $(TIE) -m $@ $(srcdir)/$(luatexdir)/luatex.web luatex.ch
+luatex-all.web: $(TIE) $(srcdir)/$(luatexdir)/luatex.web $(srcdir)/$(luatexdir)/luatex.ch
+ $(TIE) -m $@ $(srcdir)/$(luatexdir)/luatex.web $(srcdir)/$(luatexdir)/luatex.ch
#luatex-all.tex: luatex-all.web
# $(WEAVE) luatex-all.web
# echo -e '1s/ webmac/ pdfwebmac/\nw\nq' | ed $@ >/dev/null 2>&1
@@ -123,8 +126,6 @@ install-luatex: install-luatex-exec
install-programs: @LTEX@ install-luatex-exec
install-luatex-exec: $(luatex) $(bindir)
for p in luatex; do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
- cd $(DESTDIR)$(bindir) && rm -f texlua && $(LN) luatex texlua
- cd $(DESTDIR)$(bindir) && rm -f texluac && $(LN) luatex texluac
#
# luatex binaries archive
diff --git a/Build/source/texk/web2c/luatexdir/luatex.web b/Build/source/texk/web2c/luatexdir/luatex.web
index 5bd87dd7b96..df2a5372c85 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.web
+++ b/Build/source/texk/web2c/luatexdir/luatex.web
@@ -1,19 +1,24 @@
-% Copyright (c) 2007 Hartmut Henkel, Taco Hoekwater
-
-% This file is part of luaTeX.
-
-% luaTeX is free software; you can redistribute it and/or modify it under the
-% terms of the GNU General Public License as published by the Free Software
-% Foundation; either version 2 of the License, or (at your option) any later
-% version.
-
-% luaTeX is distributed in the hope that it will be useful, but WITHOUT ANY
-% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-% A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-% You should have received a copy of the GNU General Public License
-% along with luaTeX; if not, write to the Free Software Foundation, Inc.,
-% 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+% luatex.web
+%
+% Copyright 2006-2009 Taco Hoekwater <taco@@luatex.org>
+% Copyright 2006-2009 Hartmut Henkel <hartmut@@luatex.org>
+%
+% This file is part of LuaTeX.
+%
+% LuaTeX is free software; you can redistribute it and/or modify it under
+% the terms of the GNU General Public License as published by the Free
+% Software Foundation; either version 2 of the License, or (at your
+% option) any later version.
+%
+% LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+% FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+% License for more details.
+%
+% You should have received a copy of the GNU General Public License along
+% with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
+%
+% $Id$
% pdfTeX is copyright (C) 1996-2006 Han The Thanh, <thanh@@pdftex.org>.
% e-TeX is copyright (C) 1994,98 by Peter Breitenlohner.
@@ -62,9 +67,10 @@
% Version 3.1415 preserved nonexplicit kerns, tidied up (February 1993).
% Version 3.14159 allowed fontmemsize to change; bulletproofing (March 1995).
% Version 3.141592 fixed \xleaders, glueset, weird alignments (December 2002).
+% Version 3.1415926 was a general cleanup with minor fixes (February 2008).
-% Although considerable effort has been expended to make the luaTeX program
+% Although considerable effort has been expended to make the LuaTeX program
% correct and reliable, no warranty is implied; the authors disclaim any
% obligation or liability for damages, including but not limited to
% special, indirect, or consequential damages arising out of or in
@@ -177,6 +183,7 @@ complete version of \TeX\ was designed and coded by the author in late
{\mc SAIL} language, for which an excellent debugging system was
available. Preliminary plans to convert the {\mc SAIL} code into a form
somewhat like the present ``web'' were developed by Luis Trabb~Pardo and
+@^Trabb Pardo, Luis Isidoro@>
the author at the beginning of 1979, and a complete implementation was
created by Ignacio~A. Zabala in 1979 and 1980. The \TeX82 program, which
@^Zabala Salelles, Ignacio Andr\'es@>
@@ -242,15 +249,16 @@ known as `\eTeX'.
@d pdftex_revision=="0" { \.{\\pdftexrevision} }
@d pdftex_version_string=='-2.00.0' {current \pdfTeX\ version}
@#
-@d luatex_version==25 { \.{\\luatexversion} }
-@d luatex_revision=="4" { \.{\\luatexrevision} }
-@d luatex_version_string=='snapshot-0.25.4' {current \LuaTeX\ version}
+@d luatex_version==37 { \.{\\luatexversion} }
+@d luatex_revision=="0" { \.{\\luatexrevision} }
+@d luatex_version_string=='snapshot-0.37.0' {current \LuaTeX\ version}
@d luatex_date_info==-extra_version_info { the compile date is negated }
+@d luatex_svnversion==SVN_REV { as proposed by Peter M\"unster }
@#
-@d luaTeX_banner=='This is LuaTeX, Version ',luatex_version_string,extra_version_info
+@d LuaTeX_banner=='This is LuaTeX, Version ',luatex_version_string,extra_version_info
{printed when \LuaTeX\ starts}
@#
-@d banner==luaTeX_banner
+@d banner==LuaTeX_banner
@#
@d TEX==ETEX {change program name into |ETEX|}
@@ -307,6 +315,7 @@ portions of the program heading.
Actually the heading shown here is not quite normal: The |program| line
does not mention any |output| file, because \ph\ would ask the \TeX\ user
to specify a file name if |output| were specified here.
+@:PASCAL H}{\ph@>
@^system dependencies@>
@d mtype==t@&y@&p@&e {this is a \.{WEB} coding trick:}
@@ -327,6 +336,44 @@ procedure initialize; {this procedure gets things started properly}
@t\4@>@<Basic printing procedures@>@/
@t\4@>@<Error handling procedures@>@/
+@ Here is a workaround for the unfortunate limitation of WEB2C that
+doesn't know how to deal with symbolic case labels.
+
+@d hlist_node_case==0
+@d vlist_node_case==1
+@d rule_node_case==2
+@d ins_node_case==3
+@d mark_node_case==4
+@d adjust_node_case==5
+@d disc_node_case==7
+@d whatsit_node_case==8
+@d math_node_case==9
+@d glue_node_case==10
+@d kern_node_case==11
+@d penalty_node_case==12
+@d unset_node_case==13
+@d margin_kern_node_case==36
+
+@<Initialize whatever \TeX\ might access@>=
+pdfassert(hlist_node_case=hlist_node);
+pdfassert(vlist_node_case=vlist_node);
+pdfassert(rule_node_case=rule_node);
+pdfassert(ins_node_case=ins_node);
+pdfassert(mark_node_case=mark_node);
+pdfassert(adjust_node_case=adjust_node);
+pdfassert(disc_node_case=disc_node);
+pdfassert(whatsit_node_case=whatsit_node);
+pdfassert(math_node_case=math_node);
+pdfassert(glue_node_case=glue_node);
+pdfassert(kern_node_case=kern_node);
+pdfassert(penalty_node_case=penalty_node);
+pdfassert(unset_node_case=unset_node);
+pdfassert(margin_kern_node_case=margin_kern_node);
+
+
+
+
+
@ The overall \TeX\ program begins with the heading just shown, after which
comes a bunch of procedure declarations and function declarations.
Finally we will get to the main program, which begins with the
@@ -399,8 +446,9 @@ directives shown below specify full checking and inclusion of the \PASCAL\
debugger when \TeX\ is being debugged, but they cause range checking and other
redundant code to be eliminated when the production system is being generated.
Arithmetic overflow will be detected in all cases.
+@:PASCAL H}{\ph@>
@^system dependencies@>
-@^Overflow in arithmetic@>
+@^overflow in arithmetic@>
@<Compiler directives@>=
@{@&$C-,A+,D-@} {no range check, catch arithmetic overflow, no debug overhead}
@@ -434,6 +482,7 @@ if the compiler wants one. (Of course, if no default mechanism is
available, the |case| statements of \TeX\ will have to be laboriously
extended by listing all remaining cases. People who are stuck with such
\PASCAL s have, in fact, done this, successfully but not happily!)
+@:PASCAL H}{\ph@>
@d othercases == others: {default for cases not listed explicitly}
@d endcases == @+end {follows the default case in an extended |case| statement}
@@ -492,9 +541,8 @@ emphasize this distinction.
@d font_base=0 {smallest internal font number; must not be less
than |min_quarterword|}
-@d hash_size=2100 {maximum number of control sequences; it should be at most
+@d hash_size=65536 {maximum number of control sequences; it should be at most
about |(fix_mem_max-fix_mem_min)/10|}
-@d hash_prime=1777 {a prime number equal to about 85\pct! of |hash_size|}
@d ocp_base=0 {smallest internal ocp number; must not be less
than |min_quarterword|}
@d ocp_biggest=32767 {the real biggest ocp}
@@ -515,17 +563,14 @@ emphasize this distinction.
@d too_big_char=1114112 {2097152} {|biggest_char+1|}
@d special_char=1114113 {2097153} {|biggest_char+2|}
@d number_chars=1114112 {2097152} {|biggest_char+1|}
-@d number_active_chars=65536+65536 {to reduce the memory req. only two planes }
@d string_offset=2097152
@d font_biggest=5535 {the real biggest font}
@d number_fonts=font_biggest-font_base+1
-@d number_math_fonts=768
-@d math_font_biggest=767
@d biggest_lang=32767
@d too_big_lang=32768
@d text_size=0 {size code for the largest size in a family}
-@d script_size=256 {size code for the medium size in a family}
-@d script_script_size=512 {size code for the smallest size in a family}
+@d script_size=1 {size code for the medium size in a family}
+@d script_script_size=2 {size code for the smallest size in a family}
@ In case somebody has inadvertently made bad settings of the ``constants,''
@@ -1022,13 +1067,13 @@ begin
if (test)and(fnam<>0)and(length(fnam)>0) then begin
@<Fixup |nameoffile| after callback@>;
lua_a_open_out := do_a_open_out(f);
- name_file_pointer := f;
+ name_file_pointer := f;
end
else
lua_a_open_out := false;
end
else begin
- if openoutnameok(stringcast(nameoffile+1)) then begin
+ if openoutnameok(stringcast(nameoffile+1)) then begin
lua_a_open_out := a_open_out(f);
name_file_pointer := f;
end
@@ -1050,13 +1095,13 @@ begin
if (test)and(fnam<>0)and(length(fnam)>0) then begin
@<Fixup |nameoffile| after callback@>;
lua_b_open_out := do_b_open_out(f);
- name_file_pointer := f;
+ name_file_pointer := f;
end
else
lua_b_open_out := false;
end
else begin
- if openoutnameok(stringcast(nameoffile+1)) then begin
+ if openoutnameok(stringcast(nameoffile+1)) then begin
lua_b_open_out := b_open_out(f);
name_file_pointer := f;
end
@@ -1076,6 +1121,7 @@ namelength := length(fnam);
flush_string
@ Files can be closed with the \ph\ routine `|close(f)|', which
+@:PASCAL H}{\ph@>
@^system dependencies@>
should be used when all input or output with respect to |f| has been completed.
This makes |f| available to be opened again, if desired; and if |f| was used for
@@ -1210,9 +1256,9 @@ end;
function lua_input_ln(var f:alpha_file;n:quarterword;@!bypass_eoln:boolean):boolean;
var lua_result:boolean;
- last_ptr:integer;
+ last_ptr:integer;
callback_id:integer;
- bypass_p:boolean;
+ bypass_p:boolean;
begin
if n=0 then
callback_id:=input_file_callback_id[index]
@@ -1220,12 +1266,12 @@ else
callback_id:=read_file_callback_id[n];
if callback_id>0 then begin
last:=first;
- last_ptr := first;
+ last_ptr := first;
lua_result := run_saved_callback(callback_id,'reader','->l', addressof(last_ptr));
- if (lua_result=true)and(last_ptr<>0) then begin
- last := last_ptr;
- if last>max_buf_stack then max_buf_stack:=last;
- lua_input_ln := true;
+ if (lua_result=true)and(last_ptr<>0) then begin
+ last := last_ptr;
+ if last>max_buf_stack then max_buf_stack:=last;
+ lua_input_ln := true;
@<Fix up the input buffer using callbacks@>;
end
else
@@ -1234,7 +1280,7 @@ if callback_id>0 then begin
else begin
bypass_p := bypass_eoln; {this is for -Wextra}
lua_result := input_ln(f,bypass_p);
- if lua_result=true then begin
+ if lua_result=true then begin
lua_input_ln := true;
@<Fix up the input buffer using callbacks@>;
end
@@ -1251,8 +1297,8 @@ if last>=first then begin
last_ptr := first;
lua_result := run_callback(callback_id, 'l->l', (last-first), addressof(last_ptr));
if (lua_result=true)and(last_ptr<>0) then begin
- last := last_ptr;
- if last>max_buf_stack then max_buf_stack:=last;
+ last := last_ptr;
+ if last>max_buf_stack then max_buf_stack:=last;
end;
end;
end
@@ -1271,6 +1317,7 @@ is considered an output file the file variable is |term_out|.
@ Here is how to open the terminal files
in \ph. The `\.{/I}' switch suppresses the first |get|.
+@:PASCAL H}{\ph@>
@^system dependencies@>
@d t_open_in==reset(term_in,'TTY:','/O/I') {open the terminal for text input}
@@ -1288,6 +1335,7 @@ issue an unexpected error message). The third, |wake_up_terminal|,
is supposed to revive the terminal if the user has disabled it by
some instruction to the operating system. The following macros show how
these operations can be specified in \ph:
+@:PASCAL H}{\ph@>
@^system dependencies@>
@d update_terminal == break(term_out) {empty the terminal output buffer}
@@ -1416,6 +1464,7 @@ into some integer greater than~|biggest_char|.
Some \PASCAL\ compilers won't pack integers into a single byte unless the
integers lie in the range |-128..127|. To accommodate such systems
we access the string pool only via macros that can easily be redefined.
+@^system dependencies@>
@d si(#) == # {convert from |ASCII_code| to |packed_ASCII_code|}
@d so(#) == # {convert from |packed_ASCII_code| to |ASCII_code|}
@@ -1466,12 +1515,12 @@ end
@p procedure string_room(t:integer);
begin
- str_room(t);
+ str_room(t);
end;
@#
procedure append_pool_char(c:ASCII_code);
begin
- append_char(c);
+ append_char(c);
end;
@@ -1514,37 +1563,37 @@ begin
if b<@"80 then
a := b
else if b>=@"F0 then begin
- a := (b-@"F0) * 64;
- b := buffer[k+1];
- test_sequence_byte(b);
- a := (a + (b-128)) * 64;
- b := buffer[k+2];
- test_sequence_byte(b);
- a := (a + (b-128)) * 64;
- b := buffer[k+3];
- test_sequence_byte(b);
- a := a + (b-128);
+ a := (b-@"F0) * 64;
+ b := buffer[k+1];
+ test_sequence_byte(b);
+ a := (a + (b-128)) * 64;
+ b := buffer[k+2];
+ test_sequence_byte(b);
+ a := (a + (b-128)) * 64;
+ b := buffer[k+3];
+ test_sequence_byte(b);
+ a := a + (b-128);
end
else if b>=@"E0 then begin
- a := (b-@"E0) * 64;
- b := buffer[k+1];
- test_sequence_byte(b);
- a := (a + (b-128)) * 64;
- b := buffer[k+2];
- test_sequence_byte(b);
- a := a + (b-128);
+ a := (b-@"E0) * 64;
+ b := buffer[k+1];
+ test_sequence_byte(b);
+ a := (a + (b-128)) * 64;
+ b := buffer[k+2];
+ test_sequence_byte(b);
+ a := a + (b-128);
end
else if b>=@"C0 then begin
- a := (b-@"C0) * 64;
- b := buffer[k+1];
- test_sequence_byte(b);
- a := a + (b-128);
+ a := (b-@"C0) * 64;
+ b := buffer[k+1];
+ test_sequence_byte(b);
+ a := a + (b-128);
end
else begin { NI: this is an encoding error }
- print_err("Buffer contains an invalid utf-8 sequence");
+ print_err("Buffer contains an invalid utf-8 sequence");
@.Text line contains...@>
- help2("A funny symbol somehow ended up in the input buffer.")@/
- ("Just continue, I'll change it to 0xFFFD.");@/
+ help2("A funny symbol somehow ended up in the input buffer.")@/
+ ("Just continue, I'll change it to 0xFFFD.");@/
deletions_allowed:=false; error; deletions_allowed:=true;
a:=@"FFFD;
end;
@@ -1601,7 +1650,7 @@ if s<string_offset then begin
if length(t)=1 then
if str_pool[str_start_macro(t)]=s then
goto found;
- a := pool_to_unichar(str_start_macro(t));
+ a := pool_to_unichar(str_start_macro(t));
if a<>s then goto not_found;
end
else
@@ -1675,8 +1724,8 @@ extended character set recommended in {\sl The \TeX book\/} would, for
example, be `|k in [0,@'10..@'12,@'14,@'15,@'33,@'177..@'377]|'.
If character |k| cannot be printed, and |k<@'200|, then character |k+@'100| or
|k-@'100| must be printable; moreover, ASCII codes |[@'41..@'46,
-@'60..@'71, @'141..@'146, @'160..@'171]| must be printable.
-Thus, at least 80 printable characters are needed.
+@'60..@'71, @'136, @'141..@'146, @'160..@'171]| must be printable.
+Thus, at least 81 printable characters are needed.
@:TeXbook}{\sl The \TeX book@>
@^character set dependencies@>
@^system dependencies@>
@@ -1878,32 +1927,32 @@ begin
if b<=@"7F then
a := b
else if b>=@"F0 then begin
- a := (b-@"F0) * 64;
- b := str_pool[t+1];
- a := (a + (b-128)) * 64;
- b := str_pool[t+2];
- a := (a + (b-128)) * 64;
- b := str_pool[t+3];
- a := a + (b-128);
+ a := (b-@"F0) * 64;
+ b := str_pool[t+1];
+ a := (a + (b-128)) * 64;
+ b := str_pool[t+2];
+ a := (a + (b-128)) * 64;
+ b := str_pool[t+3];
+ a := a + (b-128);
end
else if b>=@"E0 then begin
- a := (b-@"E0) * 64;
- b := str_pool[t+1];
- a := (a + (b-128)) * 64;
- b := str_pool[t+2];
- a := a + (b-128);
+ a := (b-@"E0) * 64;
+ b := str_pool[t+1];
+ a := (a + (b-128)) * 64;
+ b := str_pool[t+2];
+ a := a + (b-128);
end
else if b>=@"C0 then begin
- a := (b-@"C0) * 64;
- b := str_pool[t+1];
- a := a + (b-128);
+ a := (b-@"C0) * 64;
+ b := str_pool[t+1];
+ a := a + (b-128);
end
else begin { NI: this is an encoding error }
- wlog_ln('! Pool contains an invalid utf-8 sequence');
- wterm_ln('! Pool contains an invalid utf-8 sequence');
+ wlog_ln('! Pool contains an invalid utf-8 sequence');
+ wterm_ln('! Pool contains an invalid utf-8 sequence');
@.Text line contains...@>
- help2("A funny symbol somehow ended up in the string pool.")@/
- ("Just continue, I'll change it to 0xFFFD.");@/
+ help2("A funny symbol somehow ended up in the string pool.")@/
+ ("Just continue, I'll change it to 0xFFFD.");@/
deletions_allowed:=false; error; deletions_allowed:=true;
a:=@"FFFD;
end;
@@ -1941,7 +1990,7 @@ else if s<string_offset then
end
else begin
if s>=@"110000 then
- print_char(s-@"110000)
+ print_char(s-@"110000)
else begin
print_char(@"F0 + (s div @"40000));
print_char(@"80 + ((s mod @"40000) div @"1000));
@@ -1955,8 +2004,8 @@ j:=str_start_macro(s);
while j<str_start_macro(s+1) do
begin { 0x110000 in utf=8: 0xF4 0x90 0x80 0x80 }
if (str_pool[j]=@"F4)and(j<str_start_macro(s+4))and(str_pool[j+1]=@"90) then begin
- v := (((7*64+63)*64)+ (str_pool[j+2]-128))*64 +(str_pool[j+3]-128);
- print_char(v-@"110000); j := j+4;
+ v := (((7*64+63)*64)+ (str_pool[j+2]-128))*64 +(str_pool[j+3]-128);
+ print_char(v-@"110000); j := j+4;
end
else begin
print_char(str_pool[j]); incr(j);
@@ -2034,9 +2083,9 @@ to negative arguments, since such operations are not implemented consistently
by all \PASCAL\ compilers.
@<Basic print...@>=
-procedure print_int(@!n:integer); {prints an integer in decimal form}
+procedure print_int(@!n:longinteger); {prints an integer in decimal form}
var k:0..23; {index to current digit; we assume that $|n|<10^{23}$}
-@!m:integer; {used to negate |n| in possibly dangerous cases}
+@!m:longinteger; {used to negate |n| in possibly dangerous cases}
begin k:=0;
if n<0 then
begin print_char("-");
@@ -2302,6 +2351,11 @@ begin
help1(a);
end;
@#
+procedure dohelp0;
+begin
+ help0;
+end;
+@#
procedure do_print_err (s:str_number);
begin
print_err(s);
@@ -2529,15 +2583,19 @@ end;
@<Error hand...@>=
procedure lua_norm_error(@!s:str_number); {lua found a problem}
+var saved_new_line_char: integer;
begin
+saved_new_line_char:=new_line_char;
+new_line_char:=10;
print_err("LuaTeX error "); print(s);
help2("The lua interpreter ran into a problem, so the")@/
("remainder of this lua chunk will be ignored.");
error;
+new_line_char:=saved_new_line_char;
end;
procedure lua_fatal_error(@!s:str_number); {lua found a problem}
-begin normalize_selector;
+begin new_line_char:=10; normalize_selector;
print_err("LuaTeX fatal error "); print(s);
succumb;
end;
@@ -2599,10 +2657,10 @@ a way to make |interrupt| nonzero using the \PASCAL\ debugger.
@<Global...@>=
@!interrupt:integer; {should \TeX\ pause for instructions?}
@!OK_to_interrupt:boolean; {should interrupts be observed?}
-@!detokenized_line:boolean; {indicates this is a 'detokenized' input line }
-@!line_catcode_table:integer; {the used catcode table for input lines}
-@!local_catcode_table:boolean; {the used catcode table for input lines}
@!static_int_base:integer; {C version of |int_base|}
+@!static_glue_base:integer; {C version of |glue_base|}
+@!static_dimen_base:integer; {C version of |dimen_base|}
+@!static_local_base:integer; {C version of |local_base|}
@ @p procedure check_interrupt;
begin
@@ -2611,8 +2669,7 @@ end;
@ @<Set init...@>=
-interrupt:=0; OK_to_interrupt:=true; detokenized_line:=false;
-line_catcode_table:=0; local_catcode_table:=false;
+interrupt:=0; OK_to_interrupt:=true;
@ When an interrupt has been detected, the program goes into its
highest interaction level and lets the user have nearly the full flexibility of
@@ -2726,7 +2783,7 @@ meters); two such quantities can be added without overflow on a 32-bit
computer.
The present implementation of \TeX\ does not check for overflow when
-@^Overflow in arithmetic@>
+@^overflow in arithmetic@>
dimensions are added or subtracted. This could be done by inserting a
few dozen tests of the form `\ignorespaces|if x>=@'10000000000 then
@t\\{report\_overflow}@>|', but the chance of overflow is so remote that
@@ -3521,8 +3578,6 @@ end;
of |mem| is a nonempty, doubly-linked circular list of empty nodes,
pointed to by the roving pointer |rover|.
-@d temp_node==46
-@d temp_node_size==2
@d vmem(#) == varmem[#]
@d vlink(#) == vmem(#).hh.rh {the |link| field of a memory word}
@d vinfo(#) == vmem(#).hh.lh {the |info| field of a memory word}
@@ -3625,8 +3680,6 @@ glue should stretch or shrink or remain rigid; and |glue_order(p)|
specifies the order of infinity to which glue setting applies (|normal|,
|sfi|, |fil|, |fill|, or |filll|). The |subtype| field is not used.
-@d hlist_node=0 {|type| of hlist nodes}
-@d box_node_size=8 {number of words to allocate for a box node}
@d width_offset=2 {position of |width| field in a box node}
@d depth_offset=3 {position of |depth| field in a box node}
@d height_offset=4 {position of |height| field in a box node}
@@ -3642,9 +3695,7 @@ specifies the order of infinity to which glue setting applies (|normal|,
@d normal=0 {the most common case when several cases are named}
@d stretching = 1 {glue setting applies to the stretch components}
@d shrinking = 2 {glue setting applies to the shrink components}
-@d glue_offset = 7 {position of |glue_set| in a box node}
-@d glue_set(#) == vmem(#+glue_offset).gr
- {a word of type |glue_ratio| for glue setting}
+@d glue_set(#) == vmem(#+7).gr {a word of type |glue_ratio| for glue setting}
@ The |new_null_box| function returns a pointer to an |hlist_node| in
which all subfields have the values corresponding to `\.{\\hbox\{\}}'.
@@ -3661,8 +3712,6 @@ end;
@ A |vlist_node| is like an |hlist_node| in all respects except that it
contains a vertical list.
-@d vlist_node=1 {|type| of vlist nodes}
-
@ A |rule_node| stands for a solid black rectangle; it has |width|,
|depth|, and |height| fields just as in an |hlist_node|. However, if
any of these dimensions is $-2^{30}$, the actual value will be determined
@@ -3670,8 +3719,6 @@ by running the rule up to the boundary of the innermost enclosing box.
This is called a ``running dimension.'' The |width| is never running in
an hlist; the |height| and |depth| are never running in a~vlist.
-@d rule_node=2 {|type| of rule nodes}
-@d rule_node_size=6 {number of words to allocate for a rule node}
@d null_flag==-@'10000000000 {$-2^{30}$, signifies a missing item}
@d is_running(#) == (#=null_flag) {tests for a running dimension}
@d rule_dir(#)==vlink(#+5)
@@ -3700,8 +3747,6 @@ will be used if this insertion floats to a subsequent page after a
split insertion of the same class. There is one more field, the
|ins_ptr|, which points to the beginning of the vlist for the insertion.
-@d ins_node=3 {|type| of insertion nodes}
-@d ins_node_size=6 {number of words to allocate for an insertion}
@d float_cost(#)==vmem(#+2).int {the |floating_penalty| to be used}
@d ins_ptr(#)==vinfo(#+5) {the vertical list to be inserted}
@d split_top_ptr(#)==vlink(#+5) {the |split_top_skip| to be used}
@@ -3710,8 +3755,6 @@ split insertion of the same class. There is one more field, the
of a token list that contains the user's \.{\\mark} text.
In addition there is a |mark_class| field that contains the mark class.
-@d mark_node=4 {|type| of a mark node}
-@d mark_node_size=3 {number of words to allocate for a mark node}
@d mark_ptr(#)==vlink(#+2) {head of the token list for a mark}
@d mark_class(#)==vinfo(#+2) {the mark class}
@@ -3721,8 +3764,6 @@ vertical list; i.e., it is used to implement \TeX's `\.{\\vadjust}'
operation. The |adjust_ptr| field points to the vlist containing this
material.
-@d adjust_node=5 {|type| of an adjust node}
-@d adjust_node_size=3
@d adjust_pre == subtype {pre-adjustment?}
@d adjust_ptr(#)==vlink(#+2) {vertical list to be moved out of horizontal list}
@#{|append_list| is used to append a list to |tail|}
@@ -3750,8 +3791,6 @@ and their base (through |make_accent|), and math nucleus items (in the
conversion from |mlist| to |hlist|).
-@d glyph_node_size=5
-@d glyph_node=33 {|type| of a glyph node}
@d is_char_node(#) == ((#<>null)and(type(#)=glyph_node))
@d font(#)==vlink(#+2) {the font code in a |glyph_node|}
@d character(#)==vinfo(#+2) {the character code in a |glyph_node|}
@@ -3854,8 +3893,6 @@ decides to make the break, and the discretionary node will disappear at
that time; thus, the output routine sees only discretionaries that were
not chosen.
-@d disc_node=7 {|type| of a discretionary node}
-@d disc_node_size=10
@d automatic_disc=2
@d syllable_disc=3
@d disc_type==subtype {the kind of discretionary}
@@ -3889,15 +3926,11 @@ The present implementation of \TeX\ treats the features associated with
illustrate how such routines might be coded. We shall defer further
discussion of extensions until the end of this program.
-@d whatsit_node=8 {|type| of special extension nodes}
-
@ A |math_node|, which occurs only in horizontal lists, appears before and
after mathematical formulas. The |subtype| field is |before| before the
formula and |after| after it. There is a |surround| field, which represents
the amount of surrounding space inserted by \.{\\mathsurround}.
-@d math_node=9 {|type| of a math node}
-@d math_node_size=3
@d surround(#)==vlink(#+2)
@d before=0 {|subtype| for math node that introduces a formula}
@d after=1 {|subtype| for math node that winds up a formula}
@@ -3944,8 +3977,6 @@ instead of scaled \.{pt}); and |cond_math_glue| denotes the `\.{\\nonscript}'
feature that cancels the glue node immediately following if it appears
in a subscript.
-@d glue_node=10 {|type| of node that points to a glue specification}
-@d glue_node_size=3
@d cond_math_glue=98 {special |subtype| to suppress glue in the next node}
@d mu_glue=99 {|subtype| for math glue}
@d a_leaders=100 {|subtype| for aligned leaders}
@@ -3968,8 +3999,6 @@ fields called |stretch_order| and |shrink_order|; these contain the
orders of infinity (|normal|, |sfi|, |fil|, |fill|, or |filll|)
corresponding to the stretch and shrink values.
-@d glue_spec_size=4 {number of words to allocate for a glue specification}
-@d glue_spec_node=43
@d glue_ref_count(#) == vlink(#+3) {reference count of a glue specification}
@d stretch(#) == vlink(#+1) {the stretchability of this glob of glue}
@d shrink(#) == vinfo(#+1) {the shrinkability of this glob of glue}
@@ -4018,7 +4047,7 @@ glue_ptr(p):=q; incr(glue_ref_count(q));
new_glue:=p;
end;
-@ Still another subroutine is needed: this one is sort of a combination
+@ Still another subroutine is needed: This one is sort of a combination
of |new_param_glue| and |new_glue|. It creates a glue node for one of
the current glue parameters, but it makes a fresh copy of the glue
specification, since that specification will probably be subject to change,
@@ -4043,14 +4072,10 @@ kerns inserted from font information or math mode calculations) or |explicit|
(for kerns inserted from non-math accents) or |mu_glue| (for kerns
inserted from \.{\\mkern} specifications in math formulas).
-@d kern_node=11 {|type| of a kern node}
-@d kern_node_size=3
@d explicit=1 {|subtype| of kern nodes from \.{\\kern} and \.{\\/}}
@d acc_kern=2 {|subtype| of kern nodes from accents}
@# {memory structure for marginal kerns}
-@d margin_kern_node = 32
-@d margin_kern_node_size = 4
@d margin_char(#) == vlink(#+3)
@# {|subtype| of marginal kerns}
@@ -4084,8 +4109,6 @@ treated as infinity, and no break will be allowed for such high values.
Similarly, any penalty |<=-10000| is treated as negative infinity, and a
break will be forced.
-@d penalty_node=12 {|type| of a penalty node}
-@d penalty_node_size=3 {has to be the same as |glue_node_size|}
@d inf_penalty=inf_bad {``infinite'' penalty value}
@d eject_penalty=-inf_penalty {``negatively infinite'' penalty value}
@d penalty(#) == vlink(#+2) {the added cost of breaking a list here}
@@ -4113,8 +4136,7 @@ The |subtype| field is called |span_count|; an unset box typically
contains the data for |qo(span_count)+1| columns.
Unset nodes will be changed to box nodes when alignment is completed.
-@d unset_node=13 {|type| for an unset node}
-@d glue_stretch(#)==vmem(#+glue_offset).sc {total stretch in an unset node}
+@d glue_stretch(#)==vmem(#+7).sc {total stretch in an unset node}
@d glue_shrink==shift_amount {total shrink in an unset node}
@d span_count==subtype {indicates the number of spanned columns}
@@ -4133,32 +4155,23 @@ the \.{WEB} macro definitions above, so that format changes will leave
\TeX's other algorithms intact.
@^system dependencies@>
-@* \[11] Memory layout.
-Some areas of |mem| are dedicated to fixed usage, since static allocation is
-more efficient than dynamic allocation when we can get away with it. For
-example, |zero_glue| used for glue that is `\.{0pt plus 0pt minus 0pt}'. The
-following macro definitions accomplish the static allocation by giving
-symbolic names to the fixed positions.
-
-@d zero_glue==0 {specification for \.{0pt plus 0pt minus 0pt}}
-@d sfi_glue==zero_glue+glue_spec_size {\.{0pt plus 1fi minus 0pt}}
-@d fil_glue==sfi_glue+glue_spec_size {\.{0pt plus 1fil minus 0pt}}
-@d fill_glue==fil_glue+glue_spec_size {\.{0pt plus 1fill minus 0pt}}
-@d ss_glue==fill_glue+glue_spec_size {\.{0pt plus 1fil minus 1fil}}
-@d fil_neg_glue==ss_glue+glue_spec_size {\.{0pt plus -1fil minus 0pt}}
-@d page_ins_head==fil_neg_glue+glue_spec_size {list of insertion data for current page}
-@d contrib_head==page_ins_head+temp_node_size {list of items not yet on current page}
-@d page_head==contrib_head+temp_node_size {list for current page}
-@d temp_head==page_head+temp_node_size {head of a temporary list of some kind}
-@d hold_head==temp_head+temp_node_size {head of a temporary list of another kind}
-@d adjust_head==hold_head+temp_node_size {head of adjustment list returned by |hpack|}
-@d pre_adjust_head==adjust_head+temp_node_size {head of pre-adjustment list returned by |hpack|}
-@d active==pre_adjust_head+temp_node_size {head of active list in |line_break|}
-@d align_head==active+active_node_size {head of preamble list for alignments}
-@d end_span==align_head+temp_node_size {tail of spanned-width lists}
-@d begin_point==end_span+span_node_size {left-side dot for words in hyphenation}
-@d end_point==begin_point+glyph_node_size {right-side dot for words in hyphenation}
-@d var_mem_stat_max==(end_point+glyph_node_size-1) {largest statically allocated word in the variable-size |mem|}
+@* \[11] Memory layout.
+
+Some areas of |mem| are dedicated to fixed usage, since static
+allocation is more efficient than dynamic allocation when we can get
+away with it. For example, |zero_glue| used for glue that is `\.{0pt
+plus 0pt minus 0pt}'. A few C macro definitions accomplish the static
+allocation of node memory locations by giving symbolic names to fixed
+positions. The list of imported constant identifiers is: |zero_glue|,
+|sfi_glue|, |fil_glue|, |fill_glue|, |ss_glue|, |fil_neg_glue| (all
+glue specs), |page_ins_head| (list of insertion data for current
+page), |contrib_head| (list of insertion data for current page),
+|page_head| (list for current page), |temp_head| and |hold_head|
+(temporary lists), |adjust_head| (head of adjustment list returned by
+|hpack|), |pre_adjust_head| (head of pre-adjustment list returned by
+|hpack|), |align_head| (head of alignment preamble), and
+|end_span| (tail of spanned-width lists).
+
@<Glob...@>=
garbage:pointer; {head of a junk list, write only}
@@ -4176,52 +4189,7 @@ initializing itself the slow~way.
@ @<Initialize table entries...@>=
procedure init_link_heads;forward;
-init_node_mem(var_mem_stat_max,500);
-glue_ref_count(zero_glue):=null+1; width(zero_glue):=0;
-type(zero_glue):=glue_spec_node; vlink(zero_glue):=null;
-stretch(zero_glue):=0; stretch_order(zero_glue):=normal;@/
-shrink(zero_glue):=0; shrink_order(zero_glue):=normal;@/
-glue_ref_count(sfi_glue):=null+1; width(sfi_glue):=0;
-type(sfi_glue):=glue_spec_node; vlink(sfi_glue):=null;
-stretch(sfi_glue):=0; stretch_order(sfi_glue):=sfi;@/
-shrink(sfi_glue):=0; shrink_order(sfi_glue):=normal;@/
-glue_ref_count(fil_glue):=null+1; width(fil_glue):=0;
-type(fil_glue):=glue_spec_node; vlink(fil_glue):=null;
-stretch(fil_glue):=unity; stretch_order(fil_glue):=fil;@/
-shrink(fil_glue):=0; shrink_order(fil_glue):=normal;@/
-glue_ref_count(fill_glue):=null+1; width(fill_glue):=0;
-type(fill_glue):=glue_spec_node; vlink(fill_glue):=null;
-stretch(fill_glue):=unity; stretch_order(fill_glue):=fill;@/
-shrink(fill_glue):=0; shrink_order(fill_glue):=normal;@/
-glue_ref_count(ss_glue):=null+1; width(ss_glue):=0;
-type(ss_glue):=glue_spec_node; vlink(ss_glue):=null;
-stretch(ss_glue):=unity; stretch_order(ss_glue):=fil;@/
-shrink(ss_glue):=unity; shrink_order(ss_glue):=fil;@/
-glue_ref_count(fil_neg_glue):=null+1; width(fil_neg_glue):=0;
-type(fil_neg_glue):=glue_spec_node; vlink(fil_neg_glue):=null;
-stretch(fil_neg_glue):=-unity; stretch_order(fil_neg_glue):=fil;@/
-shrink(fil_neg_glue):=0; shrink_order(fil_neg_glue):=normal;@/
-{initialize node list heads}
-vinfo(page_ins_head):=0; vlink(page_ins_head):=null; alink(page_ins_head):=null;
-vinfo(contrib_head):=0; vlink(contrib_head):=null; alink(contrib_head):=null;
-vinfo(page_head):=0; vlink(page_head):=null; alink(page_head):=null;
-vinfo(temp_head):=0; vlink(temp_head):=null; alink(temp_head):=null;
-vinfo(hold_head):=0; vlink(hold_head):=null; alink(hold_head):=null;
-vinfo(adjust_head):=0; vlink(adjust_head):=null; alink(adjust_head):=null;
-vinfo(pre_adjust_head):=0; vlink(pre_adjust_head):=null; alink(pre_adjust_head):=null;
-vinfo(active):=0; vlink(active):=null; alink(active):=null;
-vinfo(align_head):=0; vlink(align_head):=null; alink(align_head):=null;
-vinfo(end_span):=0; vlink(end_span):=null; alink(end_span):=null;
-type(begin_point):=glyph_node; subtype(begin_point):=0; vlink(begin_point):=null;
-vinfo(begin_point+1):=null; alink(begin_point):=null;
-font(begin_point):=0; character(begin_point):='.';
-vinfo(begin_point+3):=0; vlink(begin_point+3):=0;
-vinfo(begin_point+4):=0; vlink(begin_point+4):=0;
-type(end_point):=glyph_node; subtype(end_point):=0; vlink(end_point):=null;
-vinfo(end_point+1):=null; alink(end_point):=null;
-font(end_point):=0; character(end_point):='.';
-vinfo(end_point+3):=0; vlink(end_point+3):=0;
-vinfo(end_point+4):=0; vlink(end_point+4):=0;
+init_node_mem(500);
avail:=null; fix_mem_end:=0;
init_list_heads;
@<Initialize the special list heads and constant nodes@>;
@@ -4268,11 +4236,21 @@ sort of ``complicated'' are indicated only by printing `\.{[]}'.
@p
procedure print_font_identifier(f: internal_font_number);
+var fonttext:str_number;
begin
if pdf_font_blink(f) = null_font then
- print_esc(font_id_text(f))
+ fonttext := font_id_text(f)
else
- print_esc(font_id_text(pdf_font_blink(f)));
+ fonttext := font_id_text(pdf_font_blink(f));
+ if fonttext>0 then
+ print_esc(fonttext)
+ else begin
+ print_esc("FONT");
+ if pdf_font_blink(f) = null_font then
+ print_int(f)
+ else
+ print_int(pdf_font_blink(f));
+ end;
if pdf_tracing_fonts > 0 then begin
print(" (");
print_font_name(f);
@@ -4314,17 +4292,7 @@ begin while p<>null do
end;
@ @<Print a short indication of the contents of node |p|@>=
-case type(p) of
-hlist_node,vlist_node,ins_node,whatsit_node,mark_node,adjust_node,
- unset_node: print("[]");
-rule_node: print_char("|");
-glue_node: if glue_ptr(p)<>zero_glue then print_char(" ");
-math_node: print_char("$");
-disc_node: begin short_display(vlink(pre_break(p)));
- short_display(vlink(post_break(p)));@/
- end;
-othercases do_nothing
-endcases
+print_short_node_contents(p)
@ The |show_node_list| routine requires some auxiliary subroutines: one to
print a font-and-character combination, one to print a token list without
@@ -4393,8 +4361,7 @@ end;
@ We also need to declare some procedures that appear later in this
documentation.
-@p @<Declare procedures needed for displaying the elements of mlists@>@;
-@<Declare the procedure called |print_skip_param|@>
+@p @<Declare the procedure called |print_skip_param|@>
@ Since boxes can be inside of boxes, |show_node_list| is inherently recursive,
@^recursion@>
@@ -4402,12 +4369,6 @@ up to a given maximum number of levels. The history of nesting is indicated
by the current string, which will be printed at the beginning of each line;
the length of this string, namely |cur_length|, is the depth of nesting.
-Recursive calls on |show_node_list| therefore use the following pattern:
-
-@d node_list_display(#)==
- begin append_char("."); show_node_list(#); flush_char;
- end {|str_room| need not be checked; see |show_box| below}
-
@ A global variable called |depth_threshold| is used to record the maximum
depth of nesting for which |show_node_list| will show information. If we
have |depth_threshold=0|, for example, only the top level information will
@@ -4419,224 +4380,6 @@ be given and no sublists will be traversed. Another global variable, called
@!depth_threshold : integer; {maximum nesting depth in box displays}
@!breadth_max : integer; {maximum number of items shown at the same list level}
-@ Now we are ready for |show_node_list| itself. This procedure has been
-written to be ``extra robust'' in the sense that it should not crash or get
-into a loop even if the data structures have been messed up by bugs in
-the rest of the program. You can safely call its parent routine
-|show_box(p)| for arbitrary values of |p| when you are debugging \TeX.
-However, in the presence of bad data, the procedure may
-@^dirty \PASCAL@>@^debugging@>
-fetch a |memory_word| whose variant is different from the way it was stored;
-for example, it might try to read |mem[p].hh| when |mem[p]|
-contains a scaled integer, if |p| is a pointer that has been
-clobbered or chosen at random.
-
-@p procedure show_node_list(@!p:integer); {prints a node list symbolically}
-label exit;
-var n:integer; {the number of items already printed at this level}
-@!g:real; {a glue ratio, as a floating point number}
-begin if cur_length>depth_threshold then
- begin if p>null then print(" []");
- {indicate that there's been some truncation}
- return;
- end;
-n:=0;
-while p<>null do
- begin print_ln; print_current_string; {display the nesting history}
- if tracing_online<-2 then print_int(p);
- incr(n); if n>breadth_max then {time to stop}
- begin print("etc."); return;
-@.etc@>
- end;
- @<Display node |p|@>;
- p:=vlink(p);
- end;
-exit:
-end;
-
-@ @<Display node |p|@>=
-if is_char_node(p) then begin
- print_font_and_char(p);
- if is_ligature(p) then @<Display ligature |p|@>;
- end
-else case type(p) of
- hlist_node,vlist_node,unset_node: @<Display box |p|@>;
- rule_node: @<Display rule |p|@>;
- ins_node: @<Display insertion |p|@>;
- whatsit_node: @<Display the whatsit node |p|@>;
- glue_node: @<Display glue |p|@>;
- margin_kern_node: begin
- print_esc("kern");
- print_scaled(width(p));
- if subtype(p) = left_side then
- print(" (left margin)")
- else
- print(" (right margin)");
- end;
- kern_node: @<Display kern |p|@>;
- math_node: @<Display math node |p|@>;
- penalty_node: @<Display penalty |p|@>;
- disc_node: @<Display discretionary |p|@>;
- mark_node: @<Display mark |p|@>;
- adjust_node: @<Display adjustment |p|@>;
- @t\4@>@<Cases of |show_node_list| that arise in mlists only@>@;
- othercases print("Unknown node type!")
- endcases
-
-@ @<Display box |p|@>=
-begin if type(p)=hlist_node then print_esc("h")
-else if type(p)=vlist_node then print_esc("v")
-else print_esc("unset");
-print("box("); print_scaled(height(p)); print_char("+");
-print_scaled(depth(p)); print(")x"); print_scaled(width(p));
-if type(p)=unset_node then
- @<Display special fields of the unset node |p|@>
-else begin @<Display the value of |glue_set(p)|@>;
- if shift_amount(p)<>0 then
- begin print(", shifted "); print_scaled(shift_amount(p));
- end;
- print(", direction "); print_dir(box_dir(p));
- end;
-{|pdfassert(list_ptr(p)<>0);|}
-node_list_display(list_ptr(p)); {recursive call}
-end
-
-@ @<Display special fields of the unset node |p|@>=
-begin if span_count(p)<>min_quarterword then
- begin print(" ("); print_int(qo(span_count(p))+1);
- print(" columns)");
- end;
-if glue_stretch(p)<>0 then
- begin print(", stretch "); print_glue(glue_stretch(p),glue_order(p),0);
- end;
-if glue_shrink(p)<>0 then
- begin print(", shrink "); print_glue(glue_shrink(p),glue_sign(p),0);
- end;
-end
-
-@ The code will have to change in this place if |glue_ratio| is
-a structured type instead of an ordinary |real|. Note that this routine
-should avoid arithmetic errors even if the |glue_set| field holds an
-arbitrary random value. The following code assumes that a properly
-formed nonzero |real| number has absolute value $2^{20}$ or more when
-it is regarded as an integer; this precaution was adequate to prevent
-floating point underflow on the author's computer.
-@^system dependencies@>
-@^dirty \PASCAL@>
-
-@<Display the value of |glue_set(p)|@>=
-g:=float(glue_set(p));
-if (g<>float_constant(0))and(glue_sign(p)<>normal) then
- begin print(", glue set ");
- if glue_sign(p)=shrinking then print("- ");
- if abs(vmem(p+glue_offset).int)<@'4000000 then print("?.?")
- else if abs(g)>float_constant(20000) then
- begin if g>float_constant(0) then print_char(">")
- else print("< -");
- print_glue(20000*unity,glue_order(p),0);
- end
- else print_glue(round(unity*g),glue_order(p),0);
-@^real multiplication@>
- end
-
-@ @<Display rule |p|@>=
-begin print_esc("rule("); print_rule_dimen(height(p)); print_char("+");
-print_rule_dimen(depth(p)); print(")x"); print_rule_dimen(width(p));
-end
-
-@ @<Display insertion |p|@>=
-begin print_esc("insert"); print_int(qo(subtype(p)));
-print(", natural size "); print_scaled(height(p));
-print("; split("); print_spec(split_top_ptr(p),0);
-print_char(","); print_scaled(depth(p));
-print("); float cost "); print_int(float_cost(p));
-node_list_display(ins_ptr(p)); {recursive call}
-end
-
-@ @<Display glue |p|@>=
-if subtype(p)>=a_leaders then @<Display leaders |p|@>
-else begin print_esc("glue");
- if subtype(p)<>normal then
- begin print_char("(");
- if subtype(p)<cond_math_glue then
- print_skip_param(subtype(p)-1)
- else if subtype(p)=cond_math_glue then print_esc("nonscript")
- else print_esc("mskip");
- print_char(")");
- end;
- if subtype(p)<>cond_math_glue then
- begin print_char(" ");
- if subtype(p)<cond_math_glue then print_spec(glue_ptr(p),0)
- else print_spec(glue_ptr(p),"mu");
- end;
- end
-
-@ @<Display leaders |p|@>=
-begin print_esc("");
-if subtype(p)=c_leaders then print_char("c")
-else if subtype(p)=x_leaders then print_char("x");
-print("leaders "); print_spec(glue_ptr(p),0);
-node_list_display(leader_ptr(p)); {recursive call}
-end
-
-@ An ``explicit'' kern value is indicated implicitly by an explicit space.
-
-@<Display kern |p|@>=
-if subtype(p)<>mu_glue then
- begin print_esc("kern");
- if subtype(p)<>normal then print_char(" ");
- print_scaled(width(p));
- if subtype(p)=acc_kern then print(" (for accent)");
-@.for accent@>
- end
-else begin print_esc("mkern"); print_scaled(width(p)); print("mu");
- end
-
-@ @<Display math node |p|@>=
-begin print_esc("math");
-if subtype(p)=before then print("on")
-else print("off");
-if width(p)<>0 then
- begin print(", surrounded "); print_scaled(width(p));
- end;
-end
-
-@ @<Display ligature |p|@>=
-begin print(" (ligature ");
-if is_leftboundary(p) then print_char("|");
-font_in_short_display:=font(p); short_display(lig_ptr(p));
-if is_rightboundary(p) then print_char("|");
-print_char(")");
-end
-
-@ @<Display penalty |p|@>=
-begin print_esc("penalty "); print_int(penalty(p));
-end
-
-@ The |post_break| list of a discretionary node is indicated by a prefixed
-`\.{\char'174}' instead of the `\..' before the |pre_break| list.
-
-@<Display discretionary |p|@>=
-begin print_esc("discretionary");
-if vlink(no_break(p))<>null then
- begin print(" replacing "); node_list_display(vlink(no_break(p)));
- end;
-node_list_display(vlink(pre_break(p))); {recursive call}
-append_char("|"); show_node_list(vlink(post_break(p))); flush_char; {recursive call}
-end
-
-@ @<Display mark |p|@>=
-begin print_esc("mark");
-if mark_class(p)<>0 then
- begin print_char("s"); print_int(mark_class(p));
- end;
-print_mark(mark_ptr(p));
-end
-
-@ @<Display adjustment |p|@>=
-begin print_esc("vadjust"); if adjust_pre(p) <> 0 then print(" pre ");
-node_list_display(adjust_ptr(p)); {recursive call}
-end
@ The recursive machinery is started by calling |show_box|.
@^recursion@>
@@ -4830,7 +4573,8 @@ expanded by `\.{\\the}'.
@d char_given=min_internal {character code defined by \.{\\chardef}}
@d math_given=char_given+1 {math code defined by \.{\\mathchardef}}
@d omath_given=math_given+1 {math code defined by \.{\\omathchardef}}
-@d last_item=omath_given+1 {most recent item ( \.{\\lastpenalty},
+@d xmath_given=omath_given+1 {math code defined by \.{\\Umathchardef}}
+@d last_item=xmath_given+1 {most recent item ( \.{\\lastpenalty},
\.{\\lastkern}, \.{\\lastskip} )}
@d max_non_prefixed_command=last_item
{largest command code that can't be \.{\\global}}
@@ -4874,22 +4618,30 @@ break down otherwise.
\.{\\insertpenalties} )}
@d set_box_dimen=set_page_int+1
{change dimension of box ( \.{\\wd}, \.{\\ht}, \.{\\dp} )}
-@d set_shape=set_box_dimen+1
+@d set_tex_shape=set_box_dimen+1
{specify fancy paragraph shape ( \.{\\parshape} )}
-@d def_code=set_shape+1
+@d set_etex_shape=set_tex_shape+1
+ {specify etex specials ( \.{\\interlinepenalties}, etc.~)}
+@d def_char_code=set_etex_shape+1
{define a character code ( \.{\\catcode}, etc.~)}
-@d extdef_code=def_code+1
+@d def_del_code=def_char_code+1
+ {define a delimiter code ( \.{\\delcode})}
+@d extdef_math_code=def_del_code+1
{define an extended character code ( \.{\\omathcode}, etc.~)}
-@d def_family=extdef_code+1
+@d extdef_del_code=extdef_math_code+1
+ {define an extended delimiter code ( \.{\\odelcode}, etc.~)}
+@d def_family=extdef_del_code+1
{declare math fonts ( \.{\\textfont}, etc.~)}
-@d set_font=def_family+1
+@d set_math_param=def_family+1
+ {declare math parameters ( \.{\\Umathquad}, etc.~)}
+@d set_font=set_math_param+1
{set current font ( font identifiers )}
@d def_font=set_font+1
{define a font file ( \.{\\font} )}
@d register=def_font+1
{internal register ( \.{\\count}, \.{\\dimen}, etc.~)}
@d assign_box_dir=register+1 {(\.{\\boxdir})}
-@d assign_dir=register+2 {(\.{\\pagedir}, \.{\\textdir})}
+@d assign_dir=register+2 {(\.{\\pagedir}, \.{\\bodydir}, \.{\\pardir}, \.{\\textdir}), \.{\\mathdir}}
@d max_internal=assign_dir
{the largest code that can follow \.{\\the}}
@d advance=max_internal+1
@@ -4916,7 +4668,9 @@ break down otherwise.
{define level of interaction ( \.{\\batchmode}, etc.~)}
@d letterspace_font=set_interaction+1
{letterspace a font ( \.{\\letterspacefont} )}
-@d set_ocp=letterspace_font+1
+@d pdf_copy_font=letterspace_font+1
+ {create a new font instance ( \.{\\pdfcopyfont} )}
+@d set_ocp=pdf_copy_font+1
{Place a translation process in the stream}
@d def_ocp=set_ocp+1
{Define and load a translation process}
@@ -5076,7 +4830,7 @@ user's output routine.
A seventh quantity, |eTeX_aux|, is used by the extended features \eTeX.
In math mode it is known as |delim_ptr| and points to the most
-recent |left_noad| or |middle_noad| of a |math_left_group|.
+recent |fence_noad| of a |math_left_group|.
In horizontal mode, the |prev_graf| field is used for initial language data.
@@ -5087,7 +4841,7 @@ level is kept in the global quantities |mode|, |head|, |tail|, |prev_graf|,
|aux|, and |mode_line|, which live in a \PASCAL\ record that is ready to
be pushed onto |nest| if necessary.
-@d ignore_depth==-65536000 {|prev_depth| value that is ignored}
+@d ignore_depth==-65536000 {magic dimension value to mean `ignore me'}
@<Types...@>=
@!list_state_record=record@!mode_field:-mmode..mmode;@+
@@ -5097,8 +4851,6 @@ be pushed onto |nest| if necessary.
@!aux_field: memory_word;
@!dirs_field: halfword;
@!math_field: integer;
- @!local_par_field: pointer;
- @!local_par_bool_field: boolean;
end;
@ @d mode==cur_list.mode_field {current mode}
@@ -5115,10 +4867,6 @@ be pushed onto |nest| if necessary.
@d dir_save==cur_list.dirs_field {dir stack when a paragraph is interrupted}
@d dir_math_save==cur_list.math_field
{should begin/end dir nodes be placed around mathematics?}
-@d local_par==cur_list.local_par_field
- {pointer to whatsit for local stuff}
-@d local_par_bool==cur_list.local_par_bool_field
- {has local stuff been changed in this group?}
@<Glob...@>=
@!nest:array[0..nest_size] of list_state_record;
@@ -5179,7 +4927,6 @@ eTeX_aux:=null;
prev_depth:=ignore_depth; mode_line:=0;
prev_graf:=0; shown_mode:=0;
dir_save:=null; dir_math_save:=false;
-local_par:=null; local_par_bool:=false;
@<Start a new current page@>;
@ @p @<LOCAL: Declare |make_local_par_node|@>;
@@ -5199,7 +4946,6 @@ begin if nest_ptr>max_nest_stack then
nest[nest_ptr]:=cur_list; {stack the record}
incr(nest_ptr); head:=new_node(temp_node,0); tail:=head; prev_graf:=0; mode_line:=line;
dir_save:=null; dir_math_save:=false;
-local_par:=make_local_par_node; local_par_bool:=false;
eTeX_aux:=null;
end;
@@ -5210,10 +4956,6 @@ is a node that should be returned to free memory.
@p procedure pop_nest; {leave a semantic level, re-enter the old}
begin
-if local_par<>null then begin
- if local_par_bool then begin end {|tail_append(local_par)|}
- else flush_node(local_par);
- end;
flush_node(head); decr(nest_ptr); cur_list:=nest[nest_ptr];
end;
@@ -5252,7 +4994,7 @@ end;
@ @<Show the auxiliary...@>=
case abs(m) div (max_command+1) of
0: begin print_nl("prevdepth ");
- if a.sc<=ignore_depth then print("ignored")
+ if a.sc<=pdf_ignored_dimen then print("ignored")
else print_scaled(a.sc);
if nest[p].pg_field<>0 then
begin print(", prevgraf ");
@@ -5283,11 +5025,11 @@ or what their current values are, for all quantities that are subject to
the nesting structure provided by \TeX's grouping mechanism. There are six
parts to |eqtb|:
-\yskip\hangg 1) |eqtb[active_base..(hash_base-1)]| holds the current
-equivalents of single-character control sequences.
+\yskip\hangg 1) |eqtb[null_cs]| holds the current equivalent of the
+zero-length control sequence.
\yskip\hangg 2) |eqtb[hash_base..(glue_base-1)]| holds the current
-equivalents of multiletter control sequences.
+equivalents of single- and multiletter control sequences.
\yskip\hangg 3) |eqtb[glue_base..(local_base-1)]| holds the current
equivalents of glue parameters like the current baselineskip.
@@ -5343,8 +5085,9 @@ things.
paragraphs is to define these names, and to set up the initial values of the
equivalents.
-In the first region we have |number_active_chars| equivalents for ``active
-characters'' that act as control sequences.
+In the first region we have a single entry for the `null csname' of
+length zero. In luatex, the active characters and and single-letter
+control sequence names are part of the next region.
Then comes region~2, which corresponds to the hash table that we will
define later. The maximum address in this region is used for a dummy
@@ -5352,8 +5095,7 @@ control sequence that is perpetually undefined. There also are several
locations for control sequences that are perpetually defined
(since they are used in error recovery).
-@d active_base=1 {beginning of region 1, for active character equivalents}
-@d null_cs=active_base+number_active_chars {equivalent of \.{\\csname\\endcsname}}
+@d null_cs=1 {equivalent of \.{\\csname\\endcsname}}
@d hash_base=null_cs+1 {beginning of region 2, for the hash table}
@d frozen_control_sequence=hash_base+hash_size {for error recovery}
@d frozen_protection=frozen_control_sequence {inaccessible but definable}
@@ -5369,7 +5111,9 @@ locations for control sequences that are perpetually defined
{permanent `\.{\\notexpanded:}'}
@d frozen_primitive=frozen_control_sequence+11
{permanent `\.{\\pdfprimitive}'}
-@d frozen_null_font=frozen_control_sequence+12
+@d frozen_special=frozen_control_sequence+12
+ {permanent `\.{\\special}'}
+@d frozen_null_font=frozen_control_sequence+13
{permanent `\.{\\nullfont}'}
@d font_id_base=frozen_null_font-font_base
{begins table of |number_fonts| permanent font identifiers}
@@ -5388,9 +5132,17 @@ locations for control sequences that are perpetually defined
eq_type(undefined_control_sequence):=undefined_cs;
equiv(undefined_control_sequence):=null;
eq_level(undefined_control_sequence):=level_zero;
-for k:=active_base to undefined_control_sequence-1 do
+for k:=null_cs to undefined_control_sequence-1 do
eqtb[k]:=eqtb[undefined_control_sequence];
+@ Create a C version of |undefined_control_sequence|.
+
+@<Global...@>=
+@!static_undefined_control_sequence:integer;
+
+@ @<Set init...@>=
+static_undefined_control_sequence:=undefined_control_sequence;
+
@ Here is a routine that displays the current meaning of an |eqtb| entry
in region 1 or~2. (Similar routines for the other regions will appear
below.)
@@ -5455,6 +5207,10 @@ parameters have larger numbers than the others.
@<Current |mem| equivalent of glue parameter number |n|@>=glue_par(n)
+@ @<Set init...@>=
+static_local_base:=local_base;
+static_glue_base:=glue_base;
+
@ Sometimes we need to convert \TeX's internal code numbers into symbolic
form. The |print_skip_param| routine gives the symbolic name of a glue
parameter.
@@ -5489,54 +5245,43 @@ by using the routine called |primitive|, defined below. Let us enter them
now, so that we don't have to list all those parameter names anywhere else.
@<Put each of \TeX's primitives into the hash table@>=
-primitive("lineskip",assign_glue,glue_base+line_skip_code);@/
+primitive_tex("lineskip",assign_glue,glue_base+line_skip_code,glue_base);@/
@!@:line_skip_}{\.{\\lineskip} primitive@>
-primitive("baselineskip",assign_glue,glue_base+baseline_skip_code);@/
+primitive_tex("baselineskip",assign_glue,glue_base+baseline_skip_code,glue_base);@/
@!@:baseline_skip_}{\.{\\baselineskip} primitive@>
-primitive("parskip",assign_glue,glue_base+par_skip_code);@/
+primitive_tex("parskip",assign_glue,glue_base+par_skip_code,glue_base);@/
@!@:par_skip_}{\.{\\parskip} primitive@>
-primitive("abovedisplayskip",assign_glue,glue_base+above_display_skip_code);@/
+primitive_tex("abovedisplayskip",assign_glue,glue_base+above_display_skip_code,glue_base);@/
@!@:above_display_skip_}{\.{\\abovedisplayskip} primitive@>
-primitive("belowdisplayskip",assign_glue,glue_base+below_display_skip_code);@/
+primitive_tex("belowdisplayskip",assign_glue,glue_base+below_display_skip_code,glue_base);@/
@!@:below_display_skip_}{\.{\\belowdisplayskip} primitive@>
-primitive("abovedisplayshortskip",
- assign_glue,glue_base+above_display_short_skip_code);@/
+primitive_tex("abovedisplayshortskip",assign_glue,glue_base+above_display_short_skip_code,glue_base);@/
@!@:above_display_short_skip_}{\.{\\abovedisplayshortskip} primitive@>
-primitive("belowdisplayshortskip",
- assign_glue,glue_base+below_display_short_skip_code);@/
+primitive_tex("belowdisplayshortskip",assign_glue,glue_base+below_display_short_skip_code,glue_base);@/
@!@:below_display_short_skip_}{\.{\\belowdisplayshortskip} primitive@>
-primitive("leftskip",assign_glue,glue_base+left_skip_code);@/
+primitive_tex("leftskip",assign_glue,glue_base+left_skip_code,glue_base);@/
@!@:left_skip_}{\.{\\leftskip} primitive@>
-primitive("rightskip",assign_glue,glue_base+right_skip_code);@/
+primitive_tex("rightskip",assign_glue,glue_base+right_skip_code,glue_base);@/
@!@:right_skip_}{\.{\\rightskip} primitive@>
-primitive("topskip",assign_glue,glue_base+top_skip_code);@/
+primitive_tex("topskip",assign_glue,glue_base+top_skip_code,glue_base);@/
@!@:top_skip_}{\.{\\topskip} primitive@>
-primitive("splittopskip",assign_glue,glue_base+split_top_skip_code);@/
+primitive_tex("splittopskip",assign_glue,glue_base+split_top_skip_code,glue_base);@/
@!@:split_top_skip_}{\.{\\splittopskip} primitive@>
-primitive("tabskip",assign_glue,glue_base+tab_skip_code);@/
+primitive_tex("tabskip",assign_glue,glue_base+tab_skip_code,glue_base);@/
@!@:tab_skip_}{\.{\\tabskip} primitive@>
-primitive("spaceskip",assign_glue,glue_base+space_skip_code);@/
+primitive_tex("spaceskip",assign_glue,glue_base+space_skip_code,glue_base);@/
@!@:space_skip_}{\.{\\spaceskip} primitive@>
-primitive("xspaceskip",assign_glue,glue_base+xspace_skip_code);@/
+primitive_tex("xspaceskip",assign_glue,glue_base+xspace_skip_code,glue_base);@/
@!@:xspace_skip_}{\.{\\xspaceskip} primitive@>
-primitive("parfillskip",assign_glue,glue_base+par_fill_skip_code);@/
+primitive_tex("parfillskip",assign_glue,glue_base+par_fill_skip_code,glue_base);@/
@!@:par_fill_skip_}{\.{\\parfillskip} primitive@>
-primitive("thinmuskip",assign_mu_glue,glue_base+thin_mu_skip_code);@/
+primitive_tex("thinmuskip",assign_mu_glue,glue_base+thin_mu_skip_code,glue_base+thin_mu_skip_code);@/
@!@:thin_mu_skip_}{\.{\\thinmuskip} primitive@>
-primitive("medmuskip",assign_mu_glue,glue_base+med_mu_skip_code);@/
+primitive_tex("medmuskip",assign_mu_glue,glue_base+med_mu_skip_code,glue_base+thin_mu_skip_code);@/
@!@:med_mu_skip_}{\.{\\medmuskip} primitive@>
-primitive("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code);@/
+primitive_tex("thickmuskip",assign_mu_glue,glue_base+thick_mu_skip_code,glue_base+thin_mu_skip_code);@/
@!@:thick_mu_skip_}{\.{\\thickmuskip} primitive@>
-@ @<Cases of |print_cmd_chr| for symbolic printing of primitives@>=
-assign_glue,assign_mu_glue: if chr_code<skip_base then
- print_skip_param(chr_code-glue_base)
- else if chr_code<mu_skip_base then
- begin print_esc("skip"); print_int(chr_code-skip_base);
- end
- else begin print_esc("muskip"); print_int(chr_code-mu_skip_base);
- end;
-
@ All glue parameters and registers are initially `\.{0pt plus0pt minus0pt}'.
@<Initialize table entries...@>=
@@ -5608,10 +5353,8 @@ registers.
@d local_right_box_base=local_left_box_base+1
@d box_base=local_right_box_base+1 {table of |number_regs| box registers}
@d cur_font_loc=box_base+number_regs {internal font number outside math mode}
-@d math_font_base=cur_font_loc+1
- {table of |number_math_fonts| math font numbers}
-@d cat_code_base=math_font_base+number_math_fonts
- {table of |number_chars| command codes (the ``catcodes'')}
+@d math_param_base=cur_font_loc+1 {current math parameter data index }
+@d cat_code_base=math_param_base+1 {current category code data index }
@d lc_code_base=cat_code_base+1 {table of |number_chars| lowercase mappings}
@d uc_code_base=lc_code_base+1 {table of |number_chars| uppercase mappings}
@d sf_code_base=uc_code_base+1 {table of |number_chars| spacefactor mappings}
@@ -5637,56 +5380,35 @@ registers.
@d local_right_box==equiv(local_right_box_base)
@d box(#)==equiv(box_base+#)
@d cur_font==equiv(cur_font_loc)
-@d fam_fnt(#)==equiv(math_font_base+#)
@<Put each...@>=
-primitive("output",assign_toks,output_routine_loc);
+primitive_tex("output",assign_toks,output_routine_loc,local_base);
@!@:output_}{\.{\\output} primitive@>
-primitive("everypar",assign_toks,every_par_loc);
+primitive_tex("everypar",assign_toks,every_par_loc,local_base);
@!@:every_par_}{\.{\\everypar} primitive@>
-primitive("everymath",assign_toks,every_math_loc);
+primitive_tex("everymath",assign_toks,every_math_loc,local_base);
@!@:every_math_}{\.{\\everymath} primitive@>
-primitive("everydisplay",assign_toks,every_display_loc);
+primitive_tex("everydisplay",assign_toks,every_display_loc,local_base);
@!@:every_display_}{\.{\\everydisplay} primitive@>
-primitive("everyhbox",assign_toks,every_hbox_loc);
+primitive_tex("everyhbox",assign_toks,every_hbox_loc,local_base);
@!@:every_hbox_}{\.{\\everyhbox} primitive@>
-primitive("everyvbox",assign_toks,every_vbox_loc);
+primitive_tex("everyvbox",assign_toks,every_vbox_loc,local_base);
@!@:every_vbox_}{\.{\\everyvbox} primitive@>
-primitive("everyjob",assign_toks,every_job_loc);
+primitive_tex("everyjob",assign_toks,every_job_loc,local_base);
@!@:every_job_}{\.{\\everyjob} primitive@>
-primitive("everycr",assign_toks,every_cr_loc);
+primitive_tex("everycr",assign_toks,every_cr_loc,local_base);
@!@:every_cr_}{\.{\\everycr} primitive@>
-primitive("errhelp",assign_toks,err_help_loc);
+primitive_tex("errhelp",assign_toks,err_help_loc,local_base);
@!@:err_help_}{\.{\\errhelp} primitive@>
-primitive("pdfpagesattr",assign_toks,pdf_pages_attr_loc);
+primitive_pdftex("pdfpagesattr",assign_toks,pdf_pages_attr_loc,local_base);
@!@:pdf_pages_attr_}{\.{\\pdfpagesattr} primitive@>
-primitive("pdfpageattr",assign_toks,pdf_page_attr_loc);
+primitive_pdftex("pdfpageattr",assign_toks,pdf_page_attr_loc,local_base);
@!@:pdf_page_attr_}{\.{\\pdfpageattr} primitive@>
-primitive("pdfpageresources",assign_toks,pdf_page_resources_loc);
+primitive_pdftex("pdfpageresources",assign_toks,pdf_page_resources_loc,local_base);
@!@:pdf_page_resources_}{\.{\\pdfpageresources} primitive@>
-primitive("pdfpkmode",assign_toks,pdf_pk_mode_loc);
+primitive_pdftex("pdfpkmode",assign_toks,pdf_pk_mode_loc,local_base);
@!@:pdf_pk_mode_}{\.{\\pdfpkmode} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-assign_toks: if chr_code>=toks_base then
- begin print_esc("toks"); print_int(chr_code-toks_base);
- end
-else case chr_code of
- output_routine_loc: print_esc("output");
- every_par_loc: print_esc("everypar");
- every_math_loc: print_esc("everymath");
- every_display_loc: print_esc("everydisplay");
- every_hbox_loc: print_esc("everyhbox");
- every_vbox_loc: print_esc("everyvbox");
- every_job_loc: print_esc("everyjob");
- every_cr_loc: print_esc("everycr");
- @/@<Cases of |assign_toks| for |print_cmd_chr|@>@/
- pdf_pages_attr_loc: print_esc("pdfpagesattr");
- pdf_page_attr_loc: print_esc("pdfpageattr");
- pdf_page_resources_loc: print_esc("pdfpageresources");
- pdf_pk_mode_loc: print_esc("pdfpkmode");
- othercases print_esc("errhelp")
- endcases;
@ We initialize most things to null or undefined values. An undefined font
is represented by the internal code |font_base|.
@@ -5701,7 +5423,7 @@ possible.
@d null_font==font_base
@d null_ocp==ocp_base
@d null_ocp_list==ocp_list_base
-@d var_code==@"7000000 {math code meaning ``use the current family''}
+@d var_code==7 {math code meaning ``use the current family''}
@<Initialize table entries...@>=
par_shape_ptr:=null; eq_type(par_shape_loc):=shape_ref;
@@ -5714,19 +5436,21 @@ box(0):=null; eq_type(box_base):=box_ref; eq_level(box_base):=level_one;
for k:=box_base+1 to box_base+biggest_reg do eqtb[k]:=eqtb[box_base];
cur_font:=null_font; eq_type(cur_font_loc):=data;
eq_level(cur_font_loc):=level_one;@/
-for k:=math_font_base to math_font_base+47 do eqtb[k]:=eqtb[cur_font_loc];
equiv(cat_code_base):=0; eq_type(cat_code_base):=data;
eq_level(cat_code_base):=level_one;@/
+eqtb[math_param_base]:=eqtb[cat_code_base];
eqtb[lc_code_base] :=eqtb[cat_code_base];
eqtb[uc_code_base] :=eqtb[cat_code_base];
eqtb[sf_code_base] :=eqtb[cat_code_base];
eqtb[math_code_base]:=eqtb[cat_code_base];@/
cat_code_table:=0;
+initialize_math_codes;
+initialize_text_codes;
initex_cat_codes(0);
-for k:="0" to "9" do set_math_code(k,(hi(k+var_code)),level_one);@/
+for k:="0" to "9" do set_math_code(k,tex_mathcode,var_code,0,k,level_one);@/
for k:="A" to "Z" do begin
- set_math_code(k,(hi(k+var_code+@"10000)),level_one);
- set_math_code(k+32,(hi(k+32+var_code+@"10000)),level_one);@/
+ set_math_code(k,tex_mathcode,var_code,1,k,level_one);
+ set_math_code((k+32),tex_mathcode,var_code,1,(k+32),level_one);@/
set_lc_code(k,k+32,level_one); set_lc_code(k+32,k+32,level_one);@/
set_uc_code(k,k,level_one); set_uc_code(k+32,k,level_one);@/
set_sf_code(k,999,level_one);
@@ -5734,19 +5458,19 @@ for k:="A" to "Z" do begin
@ @<Set init...@>=
static_int_base:=int_base;
-initialize_math_codes;
-initialize_text_codes;
@ @<Show equivalent |n|, in region 4@>=
if (n=par_shape_loc) or ((n>=etex_pen_base) and (n<etex_pens)) then
- begin print_cmd_chr(set_shape,n); print_char("=");
+ begin if n=par_shape_loc then print_cmd_chr(set_tex_shape,n)
+ else print_cmd_chr(set_etex_shape,n);
+ print_char("=");
if equiv(n)=null then print_char("0")
else if n>par_shape_loc then
begin print_int(penalty(equiv(n))); print_char(" ");
print_int(penalty(equiv(n)+1));
if penalty(equiv(n))>1 then print_esc("ETC.");
end
- else print_int(vinfo(par_shape_ptr));
+ else print_int(vinfo(par_shape_ptr+1));
end
else if n<toks_base then
{TH TODO make extra cases for ocps here! }
@@ -5763,52 +5487,14 @@ else if n<cur_font_loc then
else begin depth_threshold:=0; breadth_max:=1; show_node_list(equiv(n));
end;
end
-else if n<cat_code_base then @<Show the font identifier in |eqtb[n]|@>
-else @<Show the halfword code in |eqtb[n]|@>
+else if n=cur_font_loc then @<Show the font identifier in |eqtb[n]|@>
@ @<Show the font identifier in |eqtb[n]|@>=
-begin if n=cur_font_loc then print("current font")
-else if n<math_font_base+script_size then
- begin print_esc("textfont"); print_int(n-math_font_base);
- end
-else if n<math_font_base+script_script_size then
- begin print_esc("scriptfont"); print_int(n-math_font_base-script_size);
- end
-else begin print_esc("scriptscriptfont"); print_int(n-math_font_base-script_script_size);
- end;
-print_char("=");@/
+begin print("current font"); print_char("=");@/
print_esc(hash[font_id_base+equiv(n)].rh);
{that's |font_id_text(equiv(n))|}
end
-@
-@d is_omath(#)== ((((#) mod @"1000000) div @"10000)>15) or
- (((#) mod @"10000)>255)
-
-@<Show the halfword code in |eqtb[n]|@>=
-if n<math_code_base then
- begin if n<lc_code_base then
- begin print_esc("catcode"); print_int(n-cat_code_base);
- end
- else if n<uc_code_base then
- begin print_esc("lccode"); print_int(n-lc_code_base);
- end
- else if n<sf_code_base then
- begin print_esc("uccode"); print_int(n-uc_code_base);
- end
- else begin print_esc("sfcode"); print_int(n-sf_code_base);
- end;
- print_char("="); print_int(equiv(n));
- end
-else begin
- if is_omath(get_math_code(n-math_code_base)) then
- print_esc("omathcode")
- else
- print_esc("mathcode");
- print_int(n-math_code_base);
- print_char("="); print_int(get_math_code(n-math_code_base));
- end
-
@ Region 5 of |eqtb| contains the integer parameters and registers defined
here, as well as the |del_code| table. The latter table differs from the
|cat_code..math_code| tables that precede it, since delimiter codes are
@@ -5828,10 +5514,8 @@ that will be defined later.
@d broken_penalty_code=8 {penalty for breaking a page at a broken line}
@d bin_op_penalty_code=9 {penalty for breaking after a binary operation}
@d rel_penalty_code=10 {penalty for breaking after a relation}
-@d pre_display_penalty_code=11
- {penalty for breaking just before a displayed formula}
-@d post_display_penalty_code=12
- {penalty for breaking just after a displayed formula}
+@d pre_display_penalty_code=11 {penalty for breaking just before a displayed formula}
+@d post_display_penalty_code=12 {penalty for breaking just after a displayed formula}
@d inter_line_penalty_code=13 {additional penalty between lines}
@d double_hyphen_demerits_code=14 {demerits for double hyphen break}
@d final_hyphen_demerits_code=15 {demerits for final hyphen break}
@@ -5883,9 +5567,10 @@ that will be defined later.
@d disable_lig_code=61
@d disable_kern_code=62
@d cat_code_table_code=63
-@d cur_lang_code=64 {current language id}
-@d ex_hyphen_char_code=65
-@d tex_int_pars=66 {total number of \.{\\TeX} + Aleph integer parameters}
+@d output_box_code=64
+@d cur_lang_code=65 {current language id}
+@d ex_hyphen_char_code=66
+@d tex_int_pars=67 {total number of \.{\\TeX} + Aleph integer parameters}
@#
@d dir_base=int_base+tex_int_pars
@d page_direction_code=0
@@ -5895,7 +5580,7 @@ that will be defined later.
@d math_direction_code=4
@d dir_pars=5
@#
-@d pdftex_first_integer_code = dir_base+dir_pars {base for \pdfTeX's integer parameters}
+@d pdftex_first_integer_code = tex_int_pars+dir_pars {base for \pdfTeX's integer parameters}
@d pdf_output_code = pdftex_first_integer_code + 0 {switch on PDF output if positive}
@d pdf_compress_level_code = pdftex_first_integer_code + 1 {compress level of streams}
@d pdf_decimal_digits_code = pdftex_first_integer_code + 2 {digits after the decimal point of numbers}
@@ -5920,7 +5605,8 @@ that will be defined later.
@d pdf_gen_tounicode_code = pdftex_first_integer_code + 24 {generate ToUnicode for fonts?}
@d pdf_draftmode_code = pdftex_first_integer_code + 25 {switch on draftmode if positive}
@d pdf_replace_font_code = pdftex_first_integer_code + 26 {generate ToUnicode for fonts?}
-@d pdf_int_pars=pdftex_first_integer_code + 27 {total number of \pdfTeX's integer parameters}
+@d pdf_inclusion_copy_font_code = pdftex_first_integer_code + 27 {generate ToUnicode for fonts?}
+@d pdf_int_pars=pdftex_first_integer_code + 28 {total number of \pdfTeX's integer parameters}
@#
@d etex_int_base=pdf_int_pars {base for \eTeX's integer parameters}
@d tracing_assigns_code=etex_int_base {show assignments}
@@ -5933,9 +5619,13 @@ that will be defined later.
@d saving_vdiscards_code=etex_int_base+7 {save items discarded from vlists}
@d saving_hyph_codes_code=etex_int_base+8 {save hyphenation codes for languages}
@d suppress_fontnotfound_error_code=etex_int_base+9 {surpress errors for missing fonts}
-@d etex_int_pars=etex_int_base+10 {total number of \eTeX's integer parameters}
+@d suppress_long_error_code=etex_int_base+10 {surpress errors for missing fonts}
+@d suppress_ifcsname_error_code=etex_int_base+11 {surpress errors for failed \.{\\ifcsname}}
+@d suppress_outer_error_code=etex_int_base+12 {surpress errors for \.{\\outer}}
+@d etex_int_pars=etex_int_base+13 {total number of \eTeX's integer parameters}
@#
-@d int_pars=etex_int_pars {total number of integer parameters}
+@d synctex_code=etex_int_pars { is synctex file generation enabled ? }
+@d int_pars=synctex_code+1 {total number of integer parameters}
@d count_base=int_base+int_pars {|number_regs| user \.{\\count} registers}
@d attribute_base=count_base+number_regs {|number_attrs| user \.{\\attribute} registers}
@d del_code_base=attribute_base+number_attrs {|number_chars| delimiter code mappings}
@@ -6016,6 +5706,7 @@ that will be defined later.
@d disable_lig==int_par(disable_lig_code)
@d disable_kern==int_par(disable_kern_code)
@d cat_code_table==int_par(cat_code_table_code)
+@d output_box==int_par(output_box_code)
@#
@d pdf_adjust_spacing == int_par(pdf_adjust_spacing_code)
@d pdf_protrude_chars == int_par(pdf_protrude_chars_code)
@@ -6040,6 +5731,7 @@ that will be defined later.
@d pdf_image_hicolor == int_par(pdf_image_hicolor_code)
@d pdf_image_apply_gamma == int_par(pdf_image_apply_gamma_code)
@d pdf_draftmode == int_par(pdf_draftmode_code)
+@d pdf_inclusion_copy_font == int_par(pdf_inclusion_copy_font_code)
@d pdf_replace_font == int_par(pdf_replace_font_code)
@#
@d tracing_assigns==int_par(tracing_assigns_code)
@@ -6052,11 +5744,18 @@ that will be defined later.
@d saving_vdiscards==int_par(saving_vdiscards_code)
@d saving_hyph_codes==int_par(saving_hyph_codes_code)
@d suppress_fontnotfound_error==int_par(suppress_fontnotfound_error_code)
+@d suppress_long_error==int_par(suppress_long_error_code)
+@d suppress_ifcsname_error==int_par(suppress_ifcsname_error_code)
+@d synctex==int_par(synctex_code)
@<Assign the values |depth_threshold:=show_box_depth|...@>=
depth_threshold:=show_box_depth;
breadth_max:=show_box_breadth
+
+@ @<Set init...@>=
+static_dimen_base:=dimen_base;
+
@ We can print the symbolic name of an integer parameter as follows.
@p procedure print_param(@!n:integer);
@@ -6122,6 +5821,7 @@ luastartup_id_code:print_esc("luastartup");
disable_lig_code:print_esc("noligs");
disable_kern_code:print_esc("nokerns");
cat_code_table_code:print_esc("catcodetable");
+output_box_code:print_esc("outputbox");
@#
local_inter_line_penalty_code: print_esc("localinterlinepenalty");
local_broken_penalty_code: print_esc("localbrokenpenalty");
@@ -6153,6 +5853,7 @@ pdf_protrude_chars_code: print_esc("pdfprotrudechars");
pdf_tracing_fonts_code: print_esc("pdftracingfonts");
pdf_gen_tounicode_code: print_esc("pdfgentounicode");
pdf_draftmode_code: print_esc("pdfdraftmode");
+pdf_inclusion_copy_font_code: print_esc("pdfinclusioncopyfonts");
pdf_replace_font_code: print_esc("pdfreplacefont");
@/@<Cases for |print_param|@>@/
othercases begin print("[unknown integer parameter!]"); end
@@ -6162,189 +5863,183 @@ end;
@ The integer parameter names must be entered into the hash table.
@<Put each...@>=
-primitive("pretolerance",assign_int,int_base+pretolerance_code);@/
+primitive_tex("pretolerance",assign_int,int_base+pretolerance_code,int_base);@/
@!@:pretolerance_}{\.{\\pretolerance} primitive@>
-primitive("tolerance",assign_int,int_base+tolerance_code);@/
+primitive_tex("tolerance",assign_int,int_base+tolerance_code,int_base);@/
@!@:tolerance_}{\.{\\tolerance} primitive@>
-primitive("linepenalty",assign_int,int_base+line_penalty_code);@/
+primitive_tex("linepenalty",assign_int,int_base+line_penalty_code,int_base);@/
@!@:line_penalty_}{\.{\\linepenalty} primitive@>
-primitive("hyphenpenalty",assign_int,int_base+hyphen_penalty_code);@/
+primitive_tex("hyphenpenalty",assign_int,int_base+hyphen_penalty_code,int_base);@/
@!@:hyphen_penalty_}{\.{\\hyphenpenalty} primitive@>
-primitive("exhyphenpenalty",assign_int,int_base+ex_hyphen_penalty_code);@/
+primitive_tex("exhyphenpenalty",assign_int,int_base+ex_hyphen_penalty_code,int_base);@/
@!@:ex_hyphen_penalty_}{\.{\\exhyphenpenalty} primitive@>
-primitive("clubpenalty",assign_int,int_base+club_penalty_code);@/
+primitive_tex("clubpenalty",assign_int,int_base+club_penalty_code,int_base);@/
@!@:club_penalty_}{\.{\\clubpenalty} primitive@>
-primitive("widowpenalty",assign_int,int_base+widow_penalty_code);@/
+primitive_tex("widowpenalty",assign_int,int_base+widow_penalty_code,int_base);@/
@!@:widow_penalty_}{\.{\\widowpenalty} primitive@>
-primitive("displaywidowpenalty",
- assign_int,int_base+display_widow_penalty_code);@/
+primitive_tex("displaywidowpenalty", assign_int,int_base+display_widow_penalty_code,int_base);@/
@!@:display_widow_penalty_}{\.{\\displaywidowpenalty} primitive@>
-primitive("brokenpenalty",assign_int,int_base+broken_penalty_code);@/
+primitive_tex("brokenpenalty",assign_int,int_base+broken_penalty_code,int_base);@/
@!@:broken_penalty_}{\.{\\brokenpenalty} primitive@>
-primitive("binoppenalty",assign_int,int_base+bin_op_penalty_code);@/
+primitive_tex("binoppenalty",assign_int,int_base+bin_op_penalty_code,int_base);@/
@!@:bin_op_penalty_}{\.{\\binoppenalty} primitive@>
-primitive("relpenalty",assign_int,int_base+rel_penalty_code);@/
+primitive_tex("relpenalty",assign_int,int_base+rel_penalty_code,int_base);@/
@!@:rel_penalty_}{\.{\\relpenalty} primitive@>
-primitive("predisplaypenalty",assign_int,int_base+pre_display_penalty_code);@/
+primitive_tex("predisplaypenalty",assign_int,int_base+pre_display_penalty_code,int_base);@/
@!@:pre_display_penalty_}{\.{\\predisplaypenalty} primitive@>
-primitive("postdisplaypenalty",assign_int,int_base+post_display_penalty_code);@/
+primitive_tex("postdisplaypenalty",assign_int,int_base+post_display_penalty_code,int_base);@/
@!@:post_display_penalty_}{\.{\\postdisplaypenalty} primitive@>
-primitive("interlinepenalty",assign_int,int_base+inter_line_penalty_code);@/
+primitive_tex("interlinepenalty",assign_int,int_base+inter_line_penalty_code,int_base);@/
@!@:inter_line_penalty_}{\.{\\interlinepenalty} primitive@>
-primitive("doublehyphendemerits",
- assign_int,int_base+double_hyphen_demerits_code);@/
+primitive_tex("doublehyphendemerits", assign_int,int_base+double_hyphen_demerits_code,int_base);@/
@!@:double_hyphen_demerits_}{\.{\\doublehyphendemerits} primitive@>
-primitive("finalhyphendemerits",
- assign_int,int_base+final_hyphen_demerits_code);@/
+primitive_tex("finalhyphendemerits", assign_int,int_base+final_hyphen_demerits_code,int_base);@/
@!@:final_hyphen_demerits_}{\.{\\finalhyphendemerits} primitive@>
-primitive("adjdemerits",assign_int,int_base+adj_demerits_code);@/
+primitive_tex("adjdemerits",assign_int,int_base+adj_demerits_code,int_base);@/
@!@:adj_demerits_}{\.{\\adjdemerits} primitive@>
-primitive("mag",assign_int,int_base+mag_code);@/
+primitive_tex("mag",assign_int,int_base+mag_code,int_base);@/
@!@:mag_}{\.{\\mag} primitive@>
-primitive("delimiterfactor",assign_int,int_base+delimiter_factor_code);@/
+primitive_tex("delimiterfactor",assign_int,int_base+delimiter_factor_code,int_base);@/
@!@:delimiter_factor_}{\.{\\delimiterfactor} primitive@>
-primitive("looseness",assign_int,int_base+looseness_code);@/
+primitive_tex("looseness",assign_int,int_base+looseness_code,int_base);@/
@!@:looseness_}{\.{\\looseness} primitive@>
-primitive("time",assign_int,int_base+time_code);@/
+primitive_tex("time",assign_int,int_base+time_code,int_base);@/
@!@:time_}{\.{\\time} primitive@>
-primitive("day",assign_int,int_base+day_code);@/
+primitive_tex("day",assign_int,int_base+day_code,int_base);@/
@!@:day_}{\.{\\day} primitive@>
-primitive("month",assign_int,int_base+month_code);@/
+primitive_tex("month",assign_int,int_base+month_code,int_base);@/
@!@:month_}{\.{\\month} primitive@>
-primitive("year",assign_int,int_base+year_code);@/
+primitive_tex("year",assign_int,int_base+year_code,int_base);@/
@!@:year_}{\.{\\year} primitive@>
-primitive("showboxbreadth",assign_int,int_base+show_box_breadth_code);@/
+primitive_tex("showboxbreadth",assign_int,int_base+show_box_breadth_code,int_base);@/
@!@:show_box_breadth_}{\.{\\showboxbreadth} primitive@>
-primitive("showboxdepth",assign_int,int_base+show_box_depth_code);@/
+primitive_tex("showboxdepth",assign_int,int_base+show_box_depth_code,int_base);@/
@!@:show_box_depth_}{\.{\\showboxdepth} primitive@>
-primitive("hbadness",assign_int,int_base+hbadness_code);@/
+primitive_tex("hbadness",assign_int,int_base+hbadness_code,int_base);@/
@!@:hbadness_}{\.{\\hbadness} primitive@>
-primitive("vbadness",assign_int,int_base+vbadness_code);@/
+primitive_tex("vbadness",assign_int,int_base+vbadness_code,int_base);@/
@!@:vbadness_}{\.{\\vbadness} primitive@>
-primitive("pausing",assign_int,int_base+pausing_code);@/
+primitive_tex("pausing",assign_int,int_base+pausing_code,int_base);@/
@!@:pausing_}{\.{\\pausing} primitive@>
-primitive("tracingonline",assign_int,int_base+tracing_online_code);@/
+primitive_tex("tracingonline",assign_int,int_base+tracing_online_code,int_base);@/
@!@:tracing_online_}{\.{\\tracingonline} primitive@>
-primitive("tracingmacros",assign_int,int_base+tracing_macros_code);@/
+primitive_tex("tracingmacros",assign_int,int_base+tracing_macros_code,int_base);@/
@!@:tracing_macros_}{\.{\\tracingmacros} primitive@>
-primitive("tracingstats",assign_int,int_base+tracing_stats_code);@/
+primitive_tex("tracingstats",assign_int,int_base+tracing_stats_code,int_base);@/
@!@:tracing_stats_}{\.{\\tracingstats} primitive@>
-primitive("tracingparagraphs",assign_int,int_base+tracing_paragraphs_code);@/
+primitive_tex("tracingparagraphs",assign_int,int_base+tracing_paragraphs_code,int_base);@/
@!@:tracing_paragraphs_}{\.{\\tracingparagraphs} primitive@>
-primitive("tracingpages",assign_int,int_base+tracing_pages_code);@/
+primitive_tex("tracingpages",assign_int,int_base+tracing_pages_code,int_base);@/
@!@:tracing_pages_}{\.{\\tracingpages} primitive@>
-primitive("tracingoutput",assign_int,int_base+tracing_output_code);@/
+primitive_tex("tracingoutput",assign_int,int_base+tracing_output_code,int_base);@/
@!@:tracing_output_}{\.{\\tracingoutput} primitive@>
-primitive("tracinglostchars",assign_int,int_base+tracing_lost_chars_code);@/
+primitive_tex("tracinglostchars",assign_int,int_base+tracing_lost_chars_code,int_base);@/
@!@:tracing_lost_chars_}{\.{\\tracinglostchars} primitive@>
-primitive("tracingcommands",assign_int,int_base+tracing_commands_code);@/
+primitive_tex("tracingcommands",assign_int,int_base+tracing_commands_code,int_base);@/
@!@:tracing_commands_}{\.{\\tracingcommands} primitive@>
-primitive("tracingrestores",assign_int,int_base+tracing_restores_code);@/
+primitive_tex("tracingrestores",assign_int,int_base+tracing_restores_code,int_base);@/
@!@:tracing_restores_}{\.{\\tracingrestores} primitive@>
-primitive("uchyph",assign_int,int_base+uc_hyph_code);@/
+primitive_tex("uchyph",assign_int,int_base+uc_hyph_code,int_base);@/
@!@:uc_hyph_}{\.{\\uchyph} primitive@>
-primitive("outputpenalty",assign_int,int_base+output_penalty_code);@/
+primitive_tex("outputpenalty",assign_int,int_base+output_penalty_code,int_base);@/
@!@:output_penalty_}{\.{\\outputpenalty} primitive@>
-primitive("maxdeadcycles",assign_int,int_base+max_dead_cycles_code);@/
+primitive_tex("maxdeadcycles",assign_int,int_base+max_dead_cycles_code,int_base);@/
@!@:max_dead_cycles_}{\.{\\maxdeadcycles} primitive@>
-primitive("hangafter",assign_int,int_base+hang_after_code);@/
+primitive_tex("hangafter",assign_int,int_base+hang_after_code,int_base);@/
@!@:hang_after_}{\.{\\hangafter} primitive@>
-primitive("floatingpenalty",assign_int,int_base+floating_penalty_code);@/
+primitive_tex("floatingpenalty",assign_int,int_base+floating_penalty_code,int_base);@/
@!@:floating_penalty_}{\.{\\floatingpenalty} primitive@>
-primitive("globaldefs",assign_int,int_base+global_defs_code);@/
+primitive_tex("globaldefs",assign_int,int_base+global_defs_code,int_base);@/
@!@:global_defs_}{\.{\\globaldefs} primitive@>
-primitive("fam",assign_int,int_base+cur_fam_code);@/
+primitive_tex("fam",assign_int,int_base+cur_fam_code,int_base);@/
@!@:fam_}{\.{\\fam} primitive@>
-primitive("escapechar",assign_int,int_base+escape_char_code);@/
+primitive_tex("escapechar",assign_int,int_base+escape_char_code,int_base);@/
@!@:escape_char_}{\.{\\escapechar} primitive@>
-primitive("defaulthyphenchar",assign_int,int_base+default_hyphen_char_code);@/
+primitive_tex("defaulthyphenchar",assign_int,int_base+default_hyphen_char_code,int_base);@/
@!@:default_hyphen_char_}{\.{\\defaulthyphenchar} primitive@>
-primitive("defaultskewchar",assign_int,int_base+default_skew_char_code);@/
+primitive_tex("defaultskewchar",assign_int,int_base+default_skew_char_code,int_base);@/
@!@:default_skew_char_}{\.{\\defaultskewchar} primitive@>
-primitive("endlinechar",assign_int,int_base+end_line_char_code);@/
+primitive_tex("endlinechar",assign_int,int_base+end_line_char_code,int_base);@/
@!@:end_line_char_}{\.{\\endlinechar} primitive@>
-primitive("newlinechar",assign_int,int_base+new_line_char_code);@/
+primitive_tex("newlinechar",assign_int,int_base+new_line_char_code,int_base);@/
@!@:new_line_char_}{\.{\\newlinechar} primitive@>
-primitive("language",assign_int,int_base+language_code);@/
+primitive_tex("language",assign_int,int_base+language_code,int_base);@/
@!@:language_}{\.{\\language} primitive@>
-primitive("setlanguage",assign_int,int_base+cur_lang_code);@/
+primitive_tex("setlanguage",assign_int,int_base+cur_lang_code,int_base);@/
@!@:cur_lang_}{\.{\\setlanguage} primitive@>
-primitive("exhyphenchar",assign_int,int_base+ex_hyphen_char_code);@/
+primitive_tex("exhyphenchar",assign_int,int_base+ex_hyphen_char_code,int_base);@/
@!@:ex_hyphen_char_}{\.{\\exhyphenchar} primitive@>
-primitive("lefthyphenmin",assign_int,int_base+left_hyphen_min_code);@/
+primitive_tex("lefthyphenmin",assign_int,int_base+left_hyphen_min_code,int_base);@/
@!@:left_hyphen_min_}{\.{\\lefthyphenmin} primitive@>
-primitive("righthyphenmin",assign_int,int_base+right_hyphen_min_code);@/
+primitive_tex("righthyphenmin",assign_int,int_base+right_hyphen_min_code,int_base);@/
@!@:right_hyphen_min_}{\.{\\righthyphenmin} primitive@>
-primitive("holdinginserts",assign_int,int_base+holding_inserts_code);@/
+primitive_tex("holdinginserts",assign_int,int_base+holding_inserts_code,int_base);@/
@!@:holding_inserts_}{\.{\\holdinginserts} primitive@>
-primitive("errorcontextlines",assign_int,int_base+error_context_lines_code);@/
+primitive_tex("errorcontextlines",assign_int,int_base+error_context_lines_code,int_base);@/
@!@:error_context_lines_}{\.{\\errorcontextlines} primitive@>
-primitive("luastartup",assign_int,int_base+luastartup_id_code);@/
+primitive_luatex("luastartup",assign_int,int_base+luastartup_id_code,int_base);@/
@!@:luastartup_id_}{\.{\\luastartup} primitive@>
-primitive("nokerns",assign_int,int_base+disable_kern_code);@/
+primitive_luatex("nokerns",assign_int,int_base+disable_kern_code,int_base);@/
@!@:disable_kern_}{\.{\\noligkerns} primitive@>
-primitive("noligs",assign_int,int_base+disable_lig_code);@/
+primitive_luatex("noligs",assign_int,int_base+disable_lig_code,int_base);@/
@!@:disable_lig_}{\.{\\noligs} primitive@>
-primitive("catcodetable",assign_int,int_base+cat_code_table_code);@/
+primitive_luatex("catcodetable",assign_int,int_base+cat_code_table_code,int_base);@/
@!@:cat_code_table_}{\.{\\catcodetable} primitive@>
-primitive("pdfoutput",assign_int,int_base+pdf_output_code);@/
+primitive_luatex("outputbox",assign_int,int_base+output_box_code,int_base);@/
+@!@:output_box_}{\.{\\outputbox} primitive@>
+primitive_pdftex("pdfoutput",assign_int,int_base+pdf_output_code,int_base);@/
@!@:pdf_output_}{\.{\\pdfoutput} primitive@>
-primitive("pdfcompresslevel",assign_int,int_base+pdf_compress_level_code);@/
+primitive_pdftex("pdfcompresslevel",assign_int,int_base+pdf_compress_level_code,int_base);@/
@!@:pdf_compress_level_}{\.{\\pdfcompresslevel} primitive@>
-primitive("pdfobjcompresslevel",assign_int,int_base+pdf_objcompresslevel_code);@/
+primitive_pdftex("pdfobjcompresslevel",assign_int,int_base+pdf_objcompresslevel_code,int_base);@/
@!@:pdf_objcompresslevel_}{\.{\\pdfobjcompresslevel} primitive@>
-primitive("pdfdecimaldigits",assign_int,int_base+pdf_decimal_digits_code);@/
+primitive_pdftex("pdfdecimaldigits",assign_int,int_base+pdf_decimal_digits_code,int_base);@/
@!@:pdf_decimal_digits_}{\.{\\pdfdecimaldigits} primitive@>
-primitive("pdfmovechars",assign_int,int_base+pdf_move_chars_code);@/
+primitive_pdftex("pdfmovechars",assign_int,int_base+pdf_move_chars_code,int_base);@/
@!@:pdf_move_chars_}{\.{\\pdfmovechars} primitive@>
-primitive("pdfimageresolution",assign_int,int_base+pdf_image_resolution_code);@/
+primitive_pdftex("pdfimageresolution",assign_int,int_base+pdf_image_resolution_code,int_base);@/
@!@:pdf_image_resolution_}{\.{\\pdfimageresolution} primitive@>
-primitive("pdfpkresolution",assign_int,int_base+pdf_pk_resolution_code);@/
+primitive_pdftex("pdfpkresolution",assign_int,int_base+pdf_pk_resolution_code,int_base);@/
@!@:pdf_pk_resolution_}{\.{\\pdfpkresolution} primitive@>
-primitive("pdfuniqueresname",assign_int,int_base+pdf_unique_resname_code);@/
+primitive_pdftex("pdfuniqueresname",assign_int,int_base+pdf_unique_resname_code,int_base);@/
@!@:pdf_unique_resname_}{\.{\\pdfuniqueresname} primitive@>
-primitive("pdfoptionpdfminorversion",assign_int,int_base+pdf_minor_version_code);@/
+primitive_pdftex("pdfoptionpdfminorversion",assign_int,int_base+pdf_minor_version_code,int_base);@/
@!@:pdf_minor_version_}{\.{\\pdfoptionpdfminorversion} primitive@>
-primitive("pdfoptionalwaysusepdfpagebox",assign_int,int_base+pdf_option_always_use_pdfpagebox_code);@/
+primitive_pdftex("pdfoptionalwaysusepdfpagebox",assign_int,int_base+pdf_option_always_use_pdfpagebox_code,int_base);@/
@!@:pdf_option_always_use_pdfpagebox_}{\.{\\pdfoptionalwaysusepdfpagebox} primitive@>
-primitive("pdfoptionpdfinclusionerrorlevel",assign_int,int_base+pdf_option_pdf_inclusion_errorlevel_code);@/
+primitive_pdftex("pdfoptionpdfinclusionerrorlevel",assign_int,int_base+pdf_option_pdf_inclusion_errorlevel_code,int_base);@/
@!@:pdf_option_pdf_inclusion_errorlevel_}{\.{\\pdfoptionpdfinclusionerrorlevel} primitive@>
-primitive("pdfminorversion",assign_int,int_base+pdf_minor_version_code);@/
+primitive_pdftex("pdfminorversion",assign_int,int_base+pdf_minor_version_code,int_base);@/
@!@:pdf_minor_version_}{\.{\\pdfminorversion} primitive@>
-primitive("pdfforcepagebox",assign_int,int_base+pdf_force_pagebox_code);@/
+primitive_pdftex("pdfforcepagebox",assign_int,int_base+pdf_force_pagebox_code,int_base);@/
@!@:pdf_force_pagebox_}{\.{\\pdfforcepagebox} primitive@>
-primitive("pdfpagebox",assign_int,int_base+pdf_pagebox_code);@/
+primitive_pdftex("pdfpagebox",assign_int,int_base+pdf_pagebox_code,int_base);@/
@!@:pdf_pagebox_}{\.{\\pdfpagebox} primitive@>
-primitive("pdfinclusionerrorlevel",assign_int,int_base+pdf_inclusion_errorlevel_code);@/
+primitive_pdftex("pdfinclusionerrorlevel",assign_int,int_base+pdf_inclusion_errorlevel_code,int_base);@/
@!@:pdf_inclusion_errorlevel_}{\.{\\pdfinclusionerrorlevel} primitive@>
-primitive("pdfgamma",assign_int,int_base+pdf_gamma_code);@/
+primitive_pdftex("pdfgamma",assign_int,int_base+pdf_gamma_code,int_base);@/
@!@:pdf_gamma_}{\.{\\pdfgamma} primitive@>
-primitive("pdfimagegamma",assign_int,int_base+pdf_image_gamma_code);@/
+primitive_pdftex("pdfimagegamma",assign_int,int_base+pdf_image_gamma_code,int_base);@/
@!@:pdf_image_gamma_}{\.{\\pdfimagegamma} primitive@>
-primitive("pdfimagehicolor",assign_int,int_base+pdf_image_hicolor_code);@/
+primitive_pdftex("pdfimagehicolor",assign_int,int_base+pdf_image_hicolor_code,int_base);@/
@!@:pdf_image_hicolor_}{\.{\\pdfimagehicolor} primitive@>
-primitive("pdfimageapplygamma",assign_int,int_base+pdf_image_apply_gamma_code);@/
+primitive_pdftex("pdfimageapplygamma",assign_int,int_base+pdf_image_apply_gamma_code,int_base);@/
@!@:pdf_image_apply_gamma_}{\.{\\pdfimageapplygamma} primitive@>
-primitive("pdfadjustspacing",assign_int,int_base+pdf_adjust_spacing_code);@/
+primitive_pdftex("pdfadjustspacing",assign_int,int_base+pdf_adjust_spacing_code,int_base);@/
@!@:pdf_adjust_spacing_}{\.{\\pdfadjustspacing} primitive@>
-primitive("pdfprotrudechars",assign_int,int_base+pdf_protrude_chars_code);@/
+primitive_pdftex("pdfprotrudechars",assign_int,int_base+pdf_protrude_chars_code,int_base);@/
@!@:pdf_protrude_chars_}{\.{\\pdfprotrudechars} primitive@>
-primitive("pdftracingfonts",assign_int,int_base+pdf_tracing_fonts_code);@/
+primitive_pdftex("pdftracingfonts",assign_int,int_base+pdf_tracing_fonts_code,int_base);@/
@!@:pdf_tracing_fonts_}{\.{\\pdftracingfonts} primitive@>
-primitive("pdfgentounicode",assign_int,int_base+pdf_gen_tounicode_code);@/
+primitive_pdftex("pdfgentounicode",assign_int,int_base+pdf_gen_tounicode_code,int_base);@/
@!@:pdf_gen_tounicode_}{\.{\\pdfgentounicode} primitive@>
-primitive("pdfdraftmode",assign_int,int_base+pdf_draftmode_code);@/
+primitive_pdftex("pdfdraftmode",assign_int,int_base+pdf_draftmode_code,int_base);@/
@!@:pdf_draftmode_}{\.{\\pdfdraftmode} primitive@>
-primitive("pdfreplacefont",assign_int,int_base+pdf_replace_font_code);@/
+primitive_pdftex("pdfinclusioncopyfonts",assign_int,int_base+pdf_inclusion_copy_font_code,int_base);@/
+@!@:pdf_inclusion_copy_font_}{\.{\\pdfinclusioncopyfonts} primitive@>
+primitive_pdftex("pdfreplacefont",assign_int,int_base+pdf_replace_font_code,int_base);@/
@!@:pdf_replace_font_}{\.{\\pdfreplacefont} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-assign_int: if chr_code<count_base then print_param(chr_code-int_base)
- else begin print_esc("count"); print_int(chr_code-count_base);
- end;
-assign_attr: begin print_esc("attribute"); print_int(chr_code-attribute_base);
- end;
-
@ The integer parameters should really be initialized by a macro package;
the following initialization does the minimum to keep \TeX\ from
complete failure.
@@ -6356,8 +6051,9 @@ for k:=attribute_base to del_code_base-1 do eqtb[k].int:=-1;
mag:=1000; tolerance:=10000; hang_after:=1; max_dead_cycles:=25;
escape_char:="\"; end_line_char:=carriage_return;
eqtb[int_base+level_local_dir_code].int:=level_one;
-set_del_code(".",0,0,level_one); {this null delimiter is used in error recovery}
+set_del_code(".",tex_mathcode,0,0,0,0,level_one); {this null delimiter is used in error recovery}
ex_hyphen_char:="-";
+output_box:=255;
@ The following procedure, which is called just before \TeX\ initializes its
input and output, establishes the initial values of the date and time.
@@ -6384,10 +6080,6 @@ else if n<attribute_base then
else if n<del_code_base then
begin print_esc("attribute"); print_int(n-attribute_base);
print_char("="); print_int(eqtb[n].int);
- end
-else begin
- {TH: todo, this stuff doesnt work}
- print_esc("delcode");
end;
end
@@ -6444,9 +6136,11 @@ here, and the |number_regs| \.{\\dimen} registers.
@d h_offset_code=18 {amount of horizontal offset when shipping pages out}
@d v_offset_code=19 {amount of vertical offset when shipping pages out}
@d emergency_stretch_code=20 {reduces badnesses on final pass of line-breaking}
-@d page_right_offset_code=21
-@d page_bottom_offset_code=22
-@d pdftex_first_dimen_code = 23 {first number defined in this section}
+@d page_left_offset_code=21
+@d page_top_offset_code=22
+@d page_right_offset_code=23
+@d page_bottom_offset_code=24
+@d pdftex_first_dimen_code = 25 {first number defined in this section}
@d pdf_h_origin_code = pdftex_first_dimen_code + 0 {horigin of the PDF output}
@d pdf_v_origin_code = pdftex_first_dimen_code + 1 {vorigin of the PDF output}
@d page_width_code = pdftex_first_dimen_code + 2 {page width of the PDF output}
@@ -6458,8 +6152,9 @@ here, and the |number_regs| \.{\\dimen} registers.
@d pdf_last_line_depth_code = pdftex_first_dimen_code + 8
@d pdf_each_line_height_code = pdftex_first_dimen_code + 9
@d pdf_each_line_depth_code = pdftex_first_dimen_code + 10
-@d pdf_px_dimen_code = pdftex_first_dimen_code + 11
-@d pdftex_last_dimen_code = pdftex_first_dimen_code + 11 {last number defined in this section}
+@d pdf_ignored_dimen_code = pdftex_first_dimen_code + 11
+@d pdf_px_dimen_code = pdftex_first_dimen_code + 12
+@d pdftex_last_dimen_code = pdftex_first_dimen_code + 12 {last number defined in this section}
@d dimen_pars = pdftex_last_dimen_code + 1 {total number of dimension parameters}
@d scaled_base=dimen_base+dimen_pars
{table of |number_regs| user-defined \.{\\dimen} registers}
@@ -6488,6 +6183,8 @@ here, and the |number_regs| \.{\\dimen} registers.
@d h_offset==dimen_par(h_offset_code)
@d v_offset==dimen_par(v_offset_code)
@d emergency_stretch==dimen_par(emergency_stretch_code)
+@d page_left_offset==dimen_par(page_left_offset_code)
+@d page_top_offset==dimen_par(page_top_offset_code)
@d page_right_offset==dimen_par(page_right_offset_code)
@d page_bottom_offset==dimen_par(page_bottom_offset_code)
@d pdf_h_origin == dimen_par(pdf_h_origin_code)
@@ -6501,6 +6198,7 @@ here, and the |number_regs| \.{\\dimen} registers.
@d pdf_last_line_depth == dimen_par(pdf_last_line_depth_code)
@d pdf_each_line_height == dimen_par(pdf_each_line_height_code)
@d pdf_each_line_depth == dimen_par(pdf_each_line_depth_code)
+@d pdf_ignored_dimen == dimen_par(pdf_ignored_dimen_code)
@d pdf_px_dimen == dimen_par(pdf_px_dimen_code)
@p procedure print_length_param(@!n:integer);
@@ -6526,7 +6224,9 @@ hang_indent_code:print_esc("hangindent");
h_offset_code:print_esc("hoffset");
v_offset_code:print_esc("voffset");
emergency_stretch_code:print_esc("emergencystretch");
-page_right_offset_code:print_esc("pagerightoffset");
+page_left_offset_code: print_esc("pageleftoffset");
+page_top_offset_code: print_esc("pagetopoffset");
+page_right_offset_code: print_esc("pagerightoffset");
page_bottom_offset_code:print_esc("pagebottomoffset");
pdf_h_origin_code: print_esc("pdfhorigin");
pdf_v_origin_code: print_esc("pdfvorigin");
@@ -6539,93 +6239,100 @@ pdf_first_line_height_code: print_esc("pdffirstlineheight");
pdf_last_line_depth_code: print_esc("pdflastlinedepth");
pdf_each_line_height_code: print_esc("pdfeachlineheight");
pdf_each_line_depth_code: print_esc("pdfeachlinedepth");
+pdf_ignored_dimen_code: print_esc("pdfignoreddimen");
pdf_px_dimen_code: print_esc("pdfpxdimen");
othercases print("[unknown dimen parameter!]")
endcases;
end;
@ @<Put each...@>=
-primitive("parindent",assign_dimen,dimen_base+par_indent_code);@/
+primitive_tex("parindent",assign_dimen,dimen_base+par_indent_code,dimen_base);@/
@!@:par_indent_}{\.{\\parindent} primitive@>
-primitive("mathsurround",assign_dimen,dimen_base+math_surround_code);@/
+primitive_tex("mathsurround",assign_dimen,dimen_base+math_surround_code,dimen_base);@/
@!@:math_surround_}{\.{\\mathsurround} primitive@>
-primitive("lineskiplimit",assign_dimen,dimen_base+line_skip_limit_code);@/
+primitive_tex("lineskiplimit",assign_dimen,dimen_base+line_skip_limit_code,dimen_base);@/
@!@:line_skip_limit_}{\.{\\lineskiplimit} primitive@>
-primitive("hsize",assign_dimen,dimen_base+hsize_code);@/
+primitive_tex("hsize",assign_dimen,dimen_base+hsize_code,dimen_base);@/
@!@:hsize_}{\.{\\hsize} primitive@>
-primitive("vsize",assign_dimen,dimen_base+vsize_code);@/
+primitive_tex("vsize",assign_dimen,dimen_base+vsize_code,dimen_base);@/
@!@:vsize_}{\.{\\vsize} primitive@>
-primitive("maxdepth",assign_dimen,dimen_base+max_depth_code);@/
+primitive_tex("maxdepth",assign_dimen,dimen_base+max_depth_code,dimen_base);@/
@!@:max_depth_}{\.{\\maxdepth} primitive@>
-primitive("splitmaxdepth",assign_dimen,dimen_base+split_max_depth_code);@/
+primitive_tex("splitmaxdepth",assign_dimen,dimen_base+split_max_depth_code,dimen_base);@/
@!@:split_max_depth_}{\.{\\splitmaxdepth} primitive@>
-primitive("boxmaxdepth",assign_dimen,dimen_base+box_max_depth_code);@/
+primitive_tex("boxmaxdepth",assign_dimen,dimen_base+box_max_depth_code,dimen_base);@/
@!@:box_max_depth_}{\.{\\boxmaxdepth} primitive@>
-primitive("hfuzz",assign_dimen,dimen_base+hfuzz_code);@/
+primitive_tex("hfuzz",assign_dimen,dimen_base+hfuzz_code,dimen_base);@/
@!@:hfuzz_}{\.{\\hfuzz} primitive@>
-primitive("vfuzz",assign_dimen,dimen_base+vfuzz_code);@/
+primitive_tex("vfuzz",assign_dimen,dimen_base+vfuzz_code,dimen_base);@/
@!@:vfuzz_}{\.{\\vfuzz} primitive@>
-primitive("delimitershortfall",
- assign_dimen,dimen_base+delimiter_shortfall_code);@/
+primitive_tex("delimitershortfall", assign_dimen,dimen_base+delimiter_shortfall_code,dimen_base);@/
@!@:delimiter_shortfall_}{\.{\\delimitershortfall} primitive@>
-primitive("nulldelimiterspace",
- assign_dimen,dimen_base+null_delimiter_space_code);@/
+primitive_tex("nulldelimiterspace", assign_dimen,dimen_base+null_delimiter_space_code,dimen_base);@/
@!@:null_delimiter_space_}{\.{\\nulldelimiterspace} primitive@>
-primitive("scriptspace",assign_dimen,dimen_base+script_space_code);@/
+primitive_tex("scriptspace",assign_dimen,dimen_base+script_space_code,dimen_base);@/
@!@:script_space_}{\.{\\scriptspace} primitive@>
-primitive("predisplaysize",assign_dimen,dimen_base+pre_display_size_code);@/
+primitive_tex("predisplaysize",assign_dimen,dimen_base+pre_display_size_code,dimen_base);@/
@!@:pre_display_size_}{\.{\\predisplaysize} primitive@>
-primitive("displaywidth",assign_dimen,dimen_base+display_width_code);@/
+primitive_tex("displaywidth",assign_dimen,dimen_base+display_width_code,dimen_base);@/
@!@:display_width_}{\.{\\displaywidth} primitive@>
-primitive("displayindent",assign_dimen,dimen_base+display_indent_code);@/
+primitive_tex("displayindent",assign_dimen,dimen_base+display_indent_code,dimen_base);@/
@!@:display_indent_}{\.{\\displayindent} primitive@>
-primitive("overfullrule",assign_dimen,dimen_base+overfull_rule_code);@/
+primitive_tex("overfullrule",assign_dimen,dimen_base+overfull_rule_code,dimen_base);@/
@!@:overfull_rule_}{\.{\\overfullrule} primitive@>
-primitive("hangindent",assign_dimen,dimen_base+hang_indent_code);@/
+primitive_tex("hangindent",assign_dimen,dimen_base+hang_indent_code,dimen_base);@/
@!@:hang_indent_}{\.{\\hangindent} primitive@>
-primitive("hoffset",assign_dimen,dimen_base+h_offset_code);@/
+primitive_tex("hoffset",assign_dimen,dimen_base+h_offset_code,dimen_base);@/
@!@:h_offset_}{\.{\\hoffset} primitive@>
-primitive("voffset",assign_dimen,dimen_base+v_offset_code);@/
+primitive_tex("voffset",assign_dimen,dimen_base+v_offset_code,dimen_base);@/
@!@:v_offset_}{\.{\\voffset} primitive@>
-primitive("emergencystretch",assign_dimen,dimen_base+emergency_stretch_code);@/
+primitive_tex("emergencystretch",assign_dimen,dimen_base+emergency_stretch_code,dimen_base);@/
@!@:emergency_stretch_}{\.{\\emergencystretch} primitive@>
-primitive("pdfhorigin",assign_dimen,dimen_base+pdf_h_origin_code);@/
+primitive_pdftex("pdfhorigin",assign_dimen,dimen_base+pdf_h_origin_code,dimen_base);@/
@!@:pdf_h_origin_}{\.{\\pdfhorigin} primitive@>
-primitive("pdfvorigin",assign_dimen,dimen_base+pdf_v_origin_code);@/
+primitive_pdftex("pdfvorigin",assign_dimen,dimen_base+pdf_v_origin_code,dimen_base);@/
@!@:pdf_v_origin_}{\.{\\pdfvorigin} primitive@>
@#
-primitive("pagewidth",assign_dimen,dimen_base+page_width_code);@/
-primitive("pdfpagewidth",assign_dimen,dimen_base+page_width_code);@/
+primitive_omega("pagewidth",assign_dimen,dimen_base+page_width_code,dimen_base);@/
+primitive_pdftex("pdfpagewidth",assign_dimen,dimen_base+page_width_code,dimen_base);@/
@!@:page_width_}{\.{\\pdfpagewidth} primitive@>
-primitive("pageheight",assign_dimen,dimen_base+page_height_code);@/
-primitive("pdfpageheight",assign_dimen,dimen_base+page_height_code);@/
+primitive_omega("pageheight",assign_dimen,dimen_base+page_height_code,dimen_base);@/
+primitive_pdftex("pdfpageheight",assign_dimen,dimen_base+page_height_code,dimen_base);@/
@!@:page_height_}{\.{\\pdfpageheight} primitive@>
@#
-primitive("pdflinkmargin",assign_dimen,dimen_base+pdf_link_margin_code);@/
+primitive_pdftex("pdflinkmargin",assign_dimen,dimen_base+pdf_link_margin_code,dimen_base);@/
@!@:pdf_link_margin_}{\.{\\pdflinkmargin} primitive@>
-primitive("pdfdestmargin",assign_dimen,dimen_base+pdf_dest_margin_code);@/
+primitive_pdftex("pdfdestmargin",assign_dimen,dimen_base+pdf_dest_margin_code,dimen_base);@/
@!@:pdf_dest_margin_}{\.{\\pdfdestmargin} primitive@>
-primitive("pdfthreadmargin",assign_dimen,dimen_base+pdf_thread_margin_code);@/
+primitive_pdftex("pdfthreadmargin",assign_dimen,dimen_base+pdf_thread_margin_code,dimen_base);@/
@!@:pdf_thread_margin_}{\.{\\pdfthreadmargin} primitive@>
-primitive("pdffirstlineheight",assign_dimen,dimen_base+pdf_first_line_height_code);@/
+primitive_pdftex("pdffirstlineheight",assign_dimen,dimen_base+pdf_first_line_height_code,dimen_base);@/
@!@:pdf_first_line_height_}{\.{\\pdffirstlineheight} primitive@>
-primitive("pdflastlinedepth",assign_dimen,dimen_base+pdf_last_line_depth_code);@/
+primitive_pdftex("pdflastlinedepth",assign_dimen,dimen_base+pdf_last_line_depth_code,dimen_base);@/
@!@:pdf_last_line_depth_}{\.{\\pdflastlinedepth} primitive@>
-primitive("pdfeachlineheight",assign_dimen,dimen_base+pdf_each_line_height_code);@/
+primitive_pdftex("pdfeachlineheight",assign_dimen,dimen_base+pdf_each_line_height_code,dimen_base);@/
@!@:pdf_each_line_height_}{\.{\\pdfeachlineheight} primitive@>
-primitive("pdfeachlinedepth",assign_dimen,dimen_base+pdf_each_line_depth_code);@/
+primitive_pdftex("pdfeachlinedepth",assign_dimen,dimen_base+pdf_each_line_depth_code,dimen_base);@/
@!@:pdf_each_line_depth_}{\.{\\pdfeachlinedepth} primitive@>
-primitive("pdfpxdimen",assign_dimen,dimen_base+pdf_px_dimen_code);@/
+primitive_pdftex("pdfignoreddimen",assign_dimen,dimen_base+pdf_ignored_dimen_code,dimen_base);@/
+@!@:pdf_ignored_dimen_}{\.{\\pdfignoreddimen} primitive@>
+primitive_pdftex("pdfpxdimen",assign_dimen,dimen_base+pdf_px_dimen_code,dimen_base);@/
@!@:pdf_px_dimen_}{\.{\\pdfpxdimen} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-assign_dimen: if chr_code<scaled_base then
- print_length_param(chr_code-dimen_base)
- else begin print_esc("dimen"); print_int(chr_code-scaled_base);
- end;
-
@ @<Initialize table entries...@>=
for k:=dimen_base to eqtb_size do eqtb[k].sc:=0;
+page_left_offset := one_inch;
+page_top_offset := one_inch;
+page_right_offset := one_inch;
+page_bottom_offset := one_inch;
+
+@ @<Initialize table entries...@>=
+pdf_ignored_dimen := ignore_depth;
+pdf_each_line_height := pdf_ignored_dimen;
+pdf_each_line_depth := pdf_ignored_dimen;
+pdf_first_line_height := pdf_ignored_dimen;
+pdf_last_line_depth := pdf_ignored_dimen;
+
@ @<Show equivalent |n|, in region 6@>=
begin if n<scaled_base then print_length_param(n-dimen_base)
@@ -6637,9 +6344,9 @@ end
@ Here is a procedure that displays the contents of |eqtb[n]|
symbolically.
-@p@t\4@>@<Declare the procedure called |print_cmd_chr|@>@;@/
+@p
@!stat procedure show_eqtb(@!n:pointer);
-begin if n<active_base then print_char("?") {this can't happen}
+begin if n<null_cs then print_char("?") {this can't happen}
else if n<glue_base then @<Show equivalent |n|, in region 1 or 2@>
else if n<local_base then @<Show equivalent |n|, in region 3@>
else if n<int_base then @<Show equivalent |n|, in region 4@>
@@ -6655,8 +6362,8 @@ but \TeX\ needs to store the |eq_level| information in another array
called |xeq_level|.
@<Glob...@>=
-@!eqtb:array[active_base..eqtb_size] of memory_word;
-@!xeq_level:array[int_base..eqtb_size] of quarterword;
+@!eqtb:array[null_cs..eqtb_size] of memory_word;
+@!xeq_level:array[null_cs..eqtb_size] of quarterword;
@ @<Set init...@>=
for k:=int_base to eqtb_size do xeq_level[k]:=level_one;
@@ -6701,50 +6408,10 @@ A global boolean variable called |no_new_control_sequence| is set to
@!no_new_control_sequence:boolean; {are new identifiers legal?}
@!cs_count:integer; {total number of known identifiers}
-@ Primitive support needs a few extra variables and definitions
-
-@d prim_size=2100 {maximum number of primitives }
-@d prim_prime=1777 {about 85\pct! of |primitive_size|}
-@d prim_base=1
-@d prim_next(#) == prim[#].lh {link for coalesced lists}
-@d prim_text(#) == prim[#].rh {string number for control sequence name}
-@d prim_is_full == (prim_used=prim_base) {test if all positions are occupied}
-@d prim_eq_level_field(#)==#.hh.b1
-@d prim_eq_type_field(#)==#.hh.b0
-@d prim_equiv_field(#)==#.hh.rh
-@d prim_eq_level(#)==prim_eq_level_field(prim_eqtb[#]) {level of definition}
-@d prim_eq_type(#)==prim_eq_type_field(prim_eqtb[#]) {command code for equivalent}
-@d prim_equiv(#)==prim_equiv_field(prim_eqtb[#]) {equivalent value}
-@d undefined_primitive=0
-
-@<Glob...@>=
-@!prim: array [0..prim_size] of two_halves; {the primitives table}
-@!prim_used:pointer; {allocation pointer for |prim|}
-@!prim_eqtb:array[0..prim_size] of memory_word;
-
@ The extra set of functions make sure we can query the
primitive meanings of thing s from C code
@p
-function get_char_cat_code(c:integer):quarterword;
-begin
- if local_catcode_table then
- get_char_cat_code:=get_cat_code(line_catcode_table,c)
- else
- get_char_cat_code:=get_cat_code(cat_code_table,c)
-end;
-function get_prim_eq_level(p:integer):quarterword;
-begin
- get_prim_eq_level := prim_eq_level(p);
-end;
-function get_prim_eq_type(p:integer):quarterword;
-begin
- get_prim_eq_type := prim_eq_type(p);
-end;
-function get_prim_equiv(p:integer):halfword;
-begin
- get_prim_equiv := prim_equiv(p);
-end;
function get_eq_type(p:integer):quarterword;
begin
get_eq_type := eq_type(p);
@@ -6762,9 +6429,7 @@ begin
get_equiv := equiv(p);
end;
function get_cs_text(cs:integer):str_number;
-begin if cs<hash_base then
- if cs<null_cs then get_cs_text := cs-active_base
- else get_cs_text := "\csname\endcsname"
+begin if cs=null_cs then get_cs_text := "\csname\endcsname"
else if (text(cs)<0)or(text(cs)>=str_ptr) then get_cs_text := ""
else get_cs_text := text(cs);
end;
@@ -6776,6 +6441,14 @@ function get_count_base:halfword;
begin
get_count_base := count_base;
end;
+function get_skip_base:halfword;
+begin
+ get_skip_base := skip_base;
+end;
+function get_mu_skip_base:halfword;
+begin
+ get_mu_skip_base := mu_skip_base;
+end;
function get_attribute_base:halfword;
begin
get_attribute_base := attribute_base;
@@ -6788,10 +6461,18 @@ function get_int_base:halfword;
begin
get_int_base := int_base;
end;
+function get_dimen_base:halfword;
+begin
+ get_dimen_base := dimen_base;
+end;
function get_toks_base:halfword;
begin
get_toks_base := toks_base;
end;
+function get_del_code_base:halfword;
+begin
+ get_del_code_base := del_code_base;
+end;
function get_every_eof:halfword;
begin
get_every_eof := every_eof;
@@ -6815,17 +6496,12 @@ end;
@ @<Set init...@>=
no_new_control_sequence:=true; {new identifiers are usually forbidden}
-prim_next(0):=0; prim_text(0):=0;
-for k:=1 to prim_size do prim[k]:=prim[0];
-prim_eq_level(0) := level_zero;
-prim_eq_type(0) := undefined_cs;
-prim_equiv(0) := null;
-for k:=1 to prim_size do prim_eqtb[k]:=prim_eqtb[0];
+init_primitives;
next(hash_base):=0; text(hash_base):=0;
for k:=hash_base+1 to undefined_control_sequence-1 do hash[k]:=hash[hash_base];
@ @<Initialize table entries...@>=
-prim_used:=prim_size; {nothing is used}
+ini_init_primitives;
hash_used:=frozen_control_sequence; {nothing is used}
cs_count:=0;
eq_type(frozen_dont_expand):=dont_expand;
@@ -6837,166 +6513,6 @@ equiv(frozen_primitive):=1;
eq_level(frozen_primitive):=level_one;
text(frozen_primitive):="primitive";
-@ Here is the subroutine that searches the hash table for an identifier
-that matches a given string of length |l>1| appearing in |buffer[j..
-(j+l-1)]|. If the identifier is found, the corresponding hash table address
-is returned. Otherwise, if the global variable |no_new_control_sequence|
-is |true|, the dummy address |undefined_control_sequence| is returned.
-Otherwise the identifier is inserted into the hash table and its location
-is returned.
-
-@p function id_lookup(@!j,@!l:integer):pointer; {search the hash table}
-label found; {go here if you found it}
-var h:integer; {hash code}
-@!d:integer; {number of characters in incomplete current string}
-@!p:pointer; {index in |hash| array}
-@!k:pointer; {index in |buffer| array}
-begin @<Compute the hash code |h|@>;
-p:=h+hash_base; {we start searching here; note that |0<=h<hash_prime|}
-loop@+begin if text(p)>0 then if length(text(p))=l then
- if str_eq_buf(text(p),j) then goto found;
- if next(p)=0 then
- begin if no_new_control_sequence then
- p:=undefined_control_sequence
- else @<Insert a new control sequence after |p|, then make
- |p| point to it@>;
- goto found;
- end;
- p:=next(p);
- end;
-found: id_lookup:=p;
-end;
-
-@ @<Insert a new control...@>=
-begin if text(p)>0 then
- begin repeat if hash_is_full then overflow("hash size",hash_size);
-@:TeX capacity exceeded hash size}{\quad hash size@>
- decr(hash_used);
- until text(hash_used)=0; {search for an empty location in |hash|}
- next(p):=hash_used; p:=hash_used;
- end;
-str_room(l); d:=cur_length;
-while pool_ptr>str_start_macro(str_ptr) do
- begin decr(pool_ptr); str_pool[pool_ptr+l]:=str_pool[pool_ptr];
- end; {move current string up to make room for another}
-for k:=j to j+l-1 do append_char(buffer[k]);
-text(p):=make_string; pool_ptr:=pool_ptr+d;
-@!stat incr(cs_count);@+tats@;@/
-end
-
-@ The value of |hash_prime| should be roughly 85\pct! of |hash_size|, and it
-should be a prime number. The theory of hashing tells us to expect fewer
-than two table probes, on the average, when the search is successful.
-[See J.~S. Vitter, {\sl Journal of the ACM\/ \bf30} (1983), 231--258.]
-@^Vitter, Jeffrey Scott@>
-
-@<Compute the hash code |h|@>=
-h:=buffer[j];
-for k:=j+1 to j+l-1 do
- begin h:=h+h+buffer[k];
- while h>=hash_prime do h:=h-hash_prime;
- end
-
-@ Here is the subroutine that searches the primitive table for an identifier
-
-@p function prim_lookup(@!s:str_number):pointer; {search the primitives table}
-label found; {go here if you found it}
-var h:integer; {hash code}
-@!p:pointer; {index in |hash| array}
-@!k:pointer; {index in string pool}
-@!the_hash_prime:halfword;
-@!j,@!l:integer;
-begin
-the_hash_prime:= prim_prime;
-if s<string_offset then begin
- p := s;
- if (p<0) or (get_prim_eq_level(p)<>level_one) then
- p := undefined_primitive;
-end
-else begin
- j:=str_start_macro(s);
- if s = str_ptr then l := cur_length else l := length(s);
- @<Compute the string hash code |h|@>;
- p:=h+prim_base; {we start searching here; note that |0<=h<hash_prime|}
- loop@+begin if prim_text(p)>0 then if length(prim_text(p))=l then
- if str_eq_str(prim_text(p),s) then goto found;
- if prim_next(p)=0 then
- begin if no_new_control_sequence then
- p:=undefined_primitive
- else @<Insert a new primitive after |p|, then make
- |p| point to it@>;
- goto found;
- end;
- p:=prim_next(p);
- end;
- end;
-found: prim_lookup:=p;
-end;
-
-function string_lookup(@!s:str_number):pointer; {search the primitives table}
-label found; {go here if you found it}
-var h:integer; {hash code}
-@!p:pointer; {index in |hash| array}
-@!k:pointer; {index in string pool}
-@!the_hash_prime: halfword;
-@!j,@!l:integer;
-begin
-the_hash_prime := hash_prime;
-if s<string_offset then begin
- p := s;
- if (p<0) or (eq_level(p)<>level_one) then
- p := undefined_cs;
-end
-else begin
- j:=str_start_macro(s);
- if s = str_ptr then l := cur_length else l := length(s);
- @<Compute the string hash code |h|@>;
- p:=h+hash_base; {we start searching here; note that |0<=h<hash_prime|}
- loop@+begin if text(p)>0 then if length(text(p))=l then
- if str_eq_str(text(p),s) then goto found;
- if next(p)=0 then
- begin
- p:=undefined_cs ;
- goto found;
- end;
- p:=next(p);
- end;
- end;
-found: string_lookup:=p;
-end;
-
-function is_primitive(csname:str_number):boolean;
- var n,m:integer;
-begin
- m := prim_lookup(csname);
- n := string_lookup(csname);
- is_primitive :=((n<>undefined_cs) and
- (m<>undefined_primitive) and
- (eq_type(n)=get_prim_eq_type(m)) and
- (equiv(n)=get_prim_equiv(m)));
-end;
-
-@ @<Insert a new primitive...@>=
-begin if prim_text(p)>0 then
- begin repeat if prim_is_full then overflow("primitive size",prim_size);
-@:TeX capacity exceeded primitive size}{\quad primitive size@>
- decr(prim_used);
- until prim_text(prim_used)=0; {search for an empty location in |prim|}
- prim_next(p):=prim_used; p:=prim_used;
- end;
-prim_text(p):=s;
-end
-
-@ The value of |prim_prime| should be roughly 85\pct! of
-|prim_size|, and it should be a prime number.
-
-@<Compute the string hash code |h|@>=
-h:=str_pool[j];
-for k:=j+1 to j+l-1 do
- begin h:=h+h+str_pool[k];
- while h>=the_hash_prime do h:=h-the_hash_prime;
- end
-
@ The procedure |print_cs| prints the name of a control sequence, given
a pointer to its address in |eqtb|. A space is printed after the name
@@ -7010,28 +6526,38 @@ they may be unprintable.
((length(#)=3)and(str_pool[str_start_macro(#)]>=@"E0))or
((length(#)=2)and(str_pool[str_start_macro(#)]>=@"C0))
+@d is_active_csname(#)==((length(text(#))>3)and
+ (str_pool[str_start_macro(text(#))]=@"EF)and
+ (str_pool[str_start_macro(text(#))+1]=@"BF)and
+ (str_pool[str_start_macro(text(#))+2]=@"BF))
+
+@d active_csname_value(#)==pool_to_unichar(str_start_macro(text(#))+3)
+
@<Basic printing...@>=
procedure print_cs(@!p:integer); {prints a purported control sequence}
-begin if p<hash_base then {single character}
+begin if p<hash_base then { nullcs}
if p=null_cs then
begin print_esc("csname"); print_esc("endcsname");
end
- else if p<active_base then print_esc("IMPOSSIBLE.")
+ else print_esc("IMPOSSIBLE.")
@.IMPOSSIBLE@>
- else print(p-active_base)
else if p>=undefined_control_sequence then print_esc("IMPOSSIBLE.")
else if (text(p)<0)or(text(p)>=str_ptr) then print_esc("NONEXISTENT.")
@.NONEXISTENT@>
-else begin
- print_esc(text(p));
- if single_letter(text(p)) then begin
- if get_cat_code(cat_code_table,pool_to_unichar(str_start_macro(text(p))))=letter then
- print_char(" ")
+else begin
+ if is_active_csname(p) then
+ print(active_csname_value(p))
+ else begin
+ print_esc(text(p));
+ if single_letter(text(p)) then begin
+ if get_cat_code(cat_code_table,pool_to_unichar(str_start_macro(text(p))))=letter then
+ print_char(" ")
+ else
+ do_nothing;
+ end
else
- do_nothing;
+ print_char(" ");
end
- else
- print_char(" ");
end;
end;
@@ -7040,158 +6566,154 @@ prints a space after the control sequence.
@<Basic printing procedures@>=
procedure sprint_cs(@!p:pointer); {prints a control sequence}
-begin if p<hash_base then
- if p<null_cs then print(p-active_base)
- else begin print_esc("csname"); print_esc("endcsname");
- end
-else print_esc(text(p));
-end;
-
-@ We need to put \TeX's ``primitive'' control sequences into the hash
-table, together with their command code (which will be the |eq_type|)
-and an operand (which will be the |equiv|). The |primitive| procedure
-does this, in a way that no \TeX\ user can. The global value |cur_val|
-contains the new |eqtb| pointer after |primitive| has acted.
-
-@p @!init procedure primitive(@!ss:str_number;@!c:quarterword;@!o:halfword);
-var k:pool_pointer; {index into |str_pool|}
-@!s:str_number; {actual |str_number| used }
-@!j:0..buf_size; {index into |buffer|}
-@!l:small_number; {length of the string}
-@!prim_val:integer; {needed to fill |prim_eqtb|}
-begin if ss<number_chars then begin
- if ss>127 then confusion("prim"); { should be ASCII }
- append_char(ss);
- s:=make_string;
+begin if p=null_cs then begin
+ print_esc("csname"); print_esc("endcsname");
end
-else
- s:=ss;
-k:=str_start_macro(s); l:=str_start_macro(s+1)-k;
- {we will move |s| into the (possibly non-empty) |buffer|}
-if first+l>buf_size+1 then
- check_buffer_overflow(first+l);
-@:TeX capacity exceeded buffer size}{\quad buffer size@>
-for j:=0 to l-1 do buffer[first+j]:=so(str_pool[k+j]);
-cur_val:=id_lookup(first,l); {|no_new_control_sequence| is |false|}
-flush_string; text(cur_val):=s; {we don't want to have the string twice}
-prim_val:=prim_lookup(s);
-eq_level(cur_val):=level_one; eq_type(cur_val):=c; equiv(cur_val):=o;
-prim_eq_level(prim_val) := level_one;
-prim_eq_type(prim_val) := c;
-prim_equiv(prim_val) := o;
+else begin
+ if is_active_csname(p) then
+ print(active_csname_value(p))
+ else
+ print_esc(text(p));
+ end;
end;
-tini
+
@ Many of \TeX's primitives need no |equiv|, since they are identifiable
by their |eq_type| alone. These primitives are loaded into the hash table
as follows:
@<Put each of \TeX's primitives into the hash table@>=
-primitive(" ",ex_space,0);@/
+primitive_tex(" ",ex_space,0,0);@/
@!@:Single-character primitives /}{\quad\.{\\\ }@>
-primitive("/",ital_corr,0);@/
+primitive_tex("/",ital_corr,0,0);@/
@!@:Single-character primitives /}{\quad\.{\\/}@>
-primitive("accent",accent,0);@/
+primitive_tex("accent",accent,0,0);@/
@!@:accent_}{\.{\\accent} primitive@>
-primitive("advance",advance,0);@/
+primitive_tex("advance",advance,0,0);@/
@!@:advance_}{\.{\\advance} primitive@>
-primitive("afterassignment",after_assignment,0);@/
+primitive_tex("afterassignment",after_assignment,0,0);@/
@!@:after_assignment_}{\.{\\afterassignment} primitive@>
-primitive("aftergroup",after_group,0);@/
+primitive_tex("aftergroup",after_group,0,0);@/
@!@:after_group_}{\.{\\aftergroup} primitive@>
-primitive("begingroup",begin_group,0);@/
+primitive_tex("begingroup",begin_group,0,0);@/
@!@:begin_group_}{\.{\\begingroup} primitive@>
-primitive("char",char_num,0);@/
+primitive_tex("char",char_num,0,0);@/
@!@:char_}{\.{\\char} primitive@>
-primitive("csname",cs_name,0);@/
+primitive_tex("csname",cs_name,0,0);@/
@!@:cs_name_}{\.{\\csname} primitive@>
-primitive("delimiter",delim_num,0);@/
+primitive_tex("delimiter",delim_num,0,0);@/
@!@:delimiter_}{\.{\\delimiter} primitive@>
-primitive("odelimiter",delim_num,1);@/
+primitive_omega("odelimiter",delim_num,1,0);@/
@!@:odelimiter_}{\.{\\odelimiter} primitive@>
-primitive("divide",divide,0);@/
+primitive_luatex("Udelimiter",delim_num,2,0);@/
+@!@:odelimiter_}{\.{\\Udelimiter} primitive@>
+primitive_tex("divide",divide,0,0);@/
@!@:divide_}{\.{\\divide} primitive@>
-primitive("endcsname",end_cs_name,0);@/
+primitive_tex("endcsname",end_cs_name,0,0);@/
@!@:end_cs_name_}{\.{\\endcsname} primitive@>
-primitive("endgroup",end_group,0);
+primitive_tex("endgroup",end_group,0,0);
@!@:end_group_}{\.{\\endgroup} primitive@>
text(frozen_end_group):="endgroup"; eqtb[frozen_end_group]:=eqtb[cur_val];@/
-primitive("expandafter",expand_after,0);@/
+primitive_tex("expandafter",expand_after,0,0);@/
@!@:expand_after_}{\.{\\expandafter} primitive@>
-primitive("font",def_font,0);@/
+primitive_tex("font",def_font,0,0);@/
@!@:font_}{\.{\\font} primitive@>
-primitive("letterspacefont",letterspace_font,0);@/
+primitive_pdftex("letterspacefont",letterspace_font,0,0);@/
@!@:letterspace_font_}{\.{\\letterspacefont} primitive@>
-primitive("fontdimen",assign_font_dimen,0);@/
+primitive_pdftex("pdfcopyfont",pdf_copy_font,0,0);@/
+@!@:pdf_copy_font_}{\.{\\pdfcopyfont} primitive@>
+primitive_tex("fontdimen",assign_font_dimen,0,0);@/
@!@:font_dimen_}{\.{\\fontdimen} primitive@>
-primitive("halign",halign,0);@/
+primitive_tex("halign",halign,0,0);@/
@!@:halign_}{\.{\\halign} primitive@>
-primitive("hrule",hrule,0);@/
+primitive_tex("hrule",hrule,0,0);@/
@!@:hrule_}{\.{\\hrule} primitive@>
-primitive("ignorespaces",ignore_spaces,0);@/
+primitive_tex("ignorespaces",ignore_spaces,0,0);@/
@!@:ignore_spaces_}{\.{\\ignorespaces} primitive@>
-primitive("insert",insert,0);@/
+primitive_tex("insert",insert,0,0);@/
@!@:insert_}{\.{\\insert} primitive@>
-primitive("leftghost",char_ghost,0);@/
+primitive_omega("leftghost",char_ghost,0,0);@/
@!@:leftghost_}{\.{\\leftghost} primitive@>
-primitive("mark",mark,0);@/
+primitive_tex("mark",mark,0,0);@/
@!@:mark_}{\.{\\mark} primitive@>
-primitive("mathaccent",math_accent,0);@/
+primitive_tex("mathaccent",math_accent,0,0);@/
@!@:math_accent_}{\.{\\mathaccent} primitive@>
-primitive("mathchar",math_char_num,0);@/
-@!@:math_char_}{\.{\\mathchar} primitive@>
-primitive("omathaccent",math_accent,1);@/
+primitive_omega("omathaccent",math_accent,1,0);@/
@!@:math_accent_}{\.{\\omathaccent} primitive@>
-primitive("omathchar",math_char_num,1);@/
+primitive_luatex("Umathaccent",math_accent,2,0);@/
+@!@:math_accent_}{\.{\\Umathaccent} primitive@>
+primitive_luatex("Umathbotaccent",math_accent,3,0);@/
+@!@:math_accent_}{\.{\\Umathbotaccent} primitive@>
+primitive_luatex("Umathaccents",math_accent,4,0);@/
+@!@:math_accent_}{\.{\\Umathaccents} primitive@>
+primitive_tex("mathchar",math_char_num,0,0);@/
+@!@:math_char_}{\.{\\mathchar} primitive@>
+primitive_omega("omathchar",math_char_num,1,0);@/
@!@:math_char_}{\.{\\omathchar} primitive@>
-primitive("mathchoice",math_choice,0);@/
+primitive_luatex("Umathchar",math_char_num,2,0);@/
+@!@:math_char_}{\.{\\Umathchar} primitive@>
+primitive_luatex("Umathcharnum",math_char_num,3,0);@/
+@!@:math_char_}{\.{\\Umathcharnum} primitive@>
+primitive_tex("mathchoice",math_choice,0,0);@/
@!@:math_choice_}{\.{\\mathchoice} primitive@>
-primitive("multiply",multiply,0);@/
+primitive_tex("multiply",multiply,0,0);@/
@!@:multiply_}{\.{\\multiply} primitive@>
-primitive("noalign",no_align,0);@/
+primitive_tex("noalign",no_align,0,0);@/
@!@:no_align_}{\.{\\noalign} primitive@>
-primitive("noboundary",no_boundary,0);@/
+primitive_tex("noboundary",no_boundary,0,0);@/
@!@:no_boundary_}{\.{\\noboundary} primitive@>
-primitive("noexpand",no_expand,0);@/
+primitive_tex("noexpand",no_expand,0,0);@/
@!@:no_expand_}{\.{\\noexpand} primitive@>
-primitive("primitive",no_expand,1);@/
+primitive_luatex("primitive",no_expand,1,0);@/
@!@:primitive_}{\.{\\primitive} primitive@>
-primitive("pdfprimitive",no_expand,1);@/
+primitive_pdftex("pdfprimitive",no_expand,1,0);@/
@!@:pdfprimitive_}{\.{\\pdfprimitive} primitive@>
-primitive("nonscript",non_script,0);@/
+primitive_tex("nonscript",non_script,0,0);@/
@!@:non_script_}{\.{\\nonscript} primitive@>
-primitive("omit",omit,0);@/
+primitive_tex("omit",omit,0,0);@/
@!@:omit_}{\.{\\omit} primitive@>
-primitive("parshape",set_shape,par_shape_loc);@/
+primitive_tex("parshape",set_tex_shape,par_shape_loc,par_shape_loc);@/
@!@:par_shape_}{\.{\\parshape} primitive@>
-primitive("penalty",break_penalty,0);@/
+primitive_tex("penalty",break_penalty,0,0);@/
@!@:penalty_}{\.{\\penalty} primitive@>
-primitive("prevgraf",set_prev_graf,0);@/
+primitive_tex("prevgraf",set_prev_graf,0,0);@/
@!@:prev_graf_}{\.{\\prevgraf} primitive@>
-primitive("radical",radical,0);@/
+primitive_tex("radical",radical,0,0);@/
@!@:radical_}{\.{\\radical} primitive@>
-primitive("oradical",radical,1);@/
+primitive_omega("oradical",radical,1,0);@/
@!@:radical_}{\.{\\oradical} primitive@>
-primitive("read",read_to_cs,0);@/
+primitive_luatex("Uradical",radical,2,0);@/
+@!@:radical_}{\.{\\Uradical} primitive@>
+primitive_luatex("Uroot",radical,3,0);@/
+@!@:radical_}{\.{\\Uroot} primitive@>
+primitive_luatex("Uunderdelimiter",radical,4,0);@/
+@!@:radical_}{\.{\\Uunderdelimiter} primitive@>
+primitive_luatex("Uoverdelimiter",radical,5,0);@/
+@!@:radical_}{\.{\\Uoverdelimiter} primitive@>
+primitive_luatex("Udelimiterunder",radical,6,0);@/
+@!@:radical_}{\.{\\Udelimiterunder} primitive@>
+primitive_luatex("Udelimiterover",radical,7,0);@/
+@!@:radical_}{\.{\\Udelimiterover} primitive@>
+primitive_tex("read",read_to_cs,0,0);@/
@!@:read_}{\.{\\read} primitive@>
-primitive("relax",relax,too_big_char);
+primitive_tex("relax",relax,too_big_char,too_big_char);
@!@:relax_}{\.{\\relax} primitive@>
text(frozen_relax):="relax"; eqtb[frozen_relax]:=eqtb[cur_val];@/
-primitive("rightghost",char_ghost,1);@/
+primitive_omega("rightghost",char_ghost,1,0);@/
@!@:rightghost_}{\.{\\rightghost} primitive@>
-primitive("setbox",set_box,0);@/
+primitive_tex("setbox",set_box,0,0);@/
@!@:set_box_}{\.{\\setbox} primitive@>
-primitive("the",the,0);@/
+primitive_tex("the",the,0,0);@/
@!@:the_}{\.{\\the} primitive@>
-primitive("toks",toks_register,0);@/
+primitive_tex("toks",toks_register,0,0);@/
@!@:toks_}{\.{\\toks} primitive@>
-primitive("vadjust",vadjust,0);@/
+primitive_tex("vadjust",vadjust,0,0);@/
@!@:vadjust_}{\.{\\vadjust} primitive@>
-primitive("valign",valign,0);@/
+primitive_tex("valign",valign,0,0);@/
@!@:valign_}{\.{\\valign} primitive@>
-primitive("vcenter",vcenter,0);@/
+primitive_tex("vcenter",vcenter,0,0);@/
@!@:vcenter_}{\.{\\vcenter} primitive@>
-primitive("vrule",vrule,0);@/
+primitive_tex("vrule",vrule,0,0);@/
@!@:vrule_}{\.{\\vrule} primitive@>
@ Each primitive has a corresponding inverse, so that it is possible to
@@ -7200,65 +6722,6 @@ Every call of |primitive| in this program is therefore accompanied by some
straightforward code that forms part of the |print_cmd_chr| routine
below.
-@<Cases of |print_cmd_chr|...@>=
-accent: print_esc("accent");
-advance: print_esc("advance");
-after_assignment: print_esc("afterassignment");
-after_group: print_esc("aftergroup");
-assign_font_dimen: print_esc("fontdimen");
-begin_group: print_esc("begingroup");
-break_penalty: print_esc("penalty");
-char_num: print_esc("char");
-char_ghost: if cur_chr=0 then print_esc("leftghost")
- else print_esc("rightghost");
-cs_name: print_esc("csname");
-def_font: print_esc("font");
-letterspace_font: print_esc("letterspacefont");
-delim_num: if chr_code=0 then print_esc("delimiter") else print_esc("odelimiter") ;
-divide: print_esc("divide");
-end_cs_name: print_esc("endcsname");
-end_group: print_esc("endgroup");
-ex_space: print_esc(" ");
-expand_after: if chr_code=0 then print_esc("expandafter")
- @<Cases of |expandafter| for |print_cmd_chr|@>;
-halign: print_esc("halign");
-hrule: print_esc("hrule");
-ignore_spaces: if chr_code=0 then print_esc("ignorespaces") else print_esc("primitive");
-insert: print_esc("insert");
-ital_corr: print_esc("/");
-mark: begin
- if chr_code=0 then print_esc("mark")
- else if chr_code=1 then print_esc("clearmarks")
- else print_esc("marks");
- end;
-math_accent: if chr_code=0 then print_esc("mathaccent") else print_esc("omathaccent");
-math_char_num: if chr_code=0 then print_esc("mathchar") else print_esc("omathchar");
-math_choice: print_esc("mathchoice");
-multiply: print_esc("multiply");
-no_align: print_esc("noalign");
-no_boundary:print_esc("noboundary");
-no_expand: if chr_code=0 then print_esc("noexpand")
- else print_esc("primitive");
-non_script: print_esc("nonscript");
-omit: print_esc("omit");
-radical: if chr_code=0 then print_esc("radical") else print_esc("oradical");
-read_to_cs: if chr_code=0 then print_esc("read")
- @<Cases of |read| for |print_cmd_chr|@>;
-relax: print_esc("relax");
-set_box: print_esc("setbox");
-set_prev_graf: print_esc("prevgraf");
-set_shape: case chr_code of
- par_shape_loc: print_esc("parshape");
- @<Cases of |set_shape| for |print_cmd_chr|@>@;@/
- end; {there are no other cases}
-the: if chr_code=0 then print_esc("the")
- @<Cases of |the| for |print_cmd_chr|@>;
-toks_register: print_esc("toks");
-vadjust: print_esc("vadjust");
-valign: print_esc("valign");
-vcenter: print_esc("vcenter");
-vrule: print_esc("vrule");
-
@ We will deal with the other primitives later, at some point in the program
where their |eq_type| and |equiv| values are more meaningful. For example,
the primitives for math mode will be loaded when we consider the routines
@@ -7312,7 +6775,7 @@ source line number at which the current level of grouping was entered.
@d save_level(#)==save_stack[#].hh.b1
{saved level for regions 5 and 6, or group code}
@d save_index(#)==save_stack[#].hh.rh
- {|eqtb| location or |save_stack| location}
+ {|eqtb| location or token or |save_stack| location}
@d restore_old_value=0 {|save_type| when a value should be restored later}
@d restore_zero=1 {|save_type| when an undefined entry should be restored}
@d insert_token=2 {|save_type| when a token is being saved for later use}
@@ -7340,7 +6803,7 @@ one that starts with \.{\\begingroup} should end with \.{\\endgroup}.
@d align_group=6 {code for `\.{\\halign}\grp', `\.{\\valign}\grp'}
@d no_align_group=7 {code for `\.{\\noalign}\grp'}
@d output_group=8 {code for output routine}
-@d math_group=9 {code for, e.g, `\.{\char'136}\grp'}
+@d math_group=9 {code for, e.g., `\.{\char'136}\grp'}
@d disc_group=10 {code for `\.{\\discretionary}\grp\grp\grp'}
@d insert_group=11 {code for `\.{\\insert}\grp', `\.{\\vadjust}\grp'}
@d vcenter_group=12 {code for `\.{\\vcenter}\grp'}
@@ -7544,6 +7007,7 @@ begin a:=false; l:=level_one; {just in case}
unsave_math_codes(cur_level);
unsave_cat_codes (cat_code_table,cur_level);
unsave_text_codes(cur_level);
+unsave_math_data(cur_level);
if cur_level>level_one then
begin decr(cur_level);
@<Clear off top level from |save_stack|@>;
@@ -7774,7 +7238,7 @@ if (p<fix_mem_min) or (p>fix_mem_end) then
end;
if info(p)>=cs_token_flag then begin
if not ((inhibit_par_tokens) and (info(p)=par_token)) then
- print_cs(info(p)-cs_token_flag);
+ print_cs(info(p)-cs_token_flag);
end
else begin m:=info(p) div string_offset; c:=info(p) mod string_offset;
if info(p)<0 then print_esc("BAD.")
@@ -7790,7 +7254,7 @@ parameters by seeing one in a |match| command before it runs into any
case m of
left_brace,right_brace,math_shift,tab_mark,sup_mark,sub_mark,spacer,
letter,other_char: print(c);
-mac_param: begin print(c); print(c);
+mac_param: begin if not in_lua_escape then print(c); print(c);
end;
out_param: begin print(match_chr);
if c<=9 then print_char(c+"0")
@@ -7877,39 +7341,6 @@ low-level languages that do not support recursion.
@!cur_cs: pointer; {control sequence found here, zero if none found}
@!cur_tok: halfword; {packed representative of |cur_cmd| and |cur_chr|}
-@ The |print_cmd_chr| routine prints a symbolic interpretation of a
-command code and its modifier. This is used in certain `\.{You can\'t}'
-error messages, and in the implementation of diagnostic routines like
-\.{\\show}.
-
-The body of |print_cmd_chr| is a rather tedious listing of print
-commands, and most of it is essentially an inverse to the |primitive|
-routine that enters a \TeX\ primitive into |eqtb|. Therefore much of
-this procedure appears elsewhere in the program,
-together with the corresponding |primitive| calls.
-
-@d chr_cmd(#)==begin print(#); print(chr_code);
- end
-
-@<Declare the procedure called |print_cmd_chr|@>=
-procedure print_cmd_chr(@!cmd:quarterword;@!chr_code:halfword);
-var n:integer; {temp variable}
-begin case cmd of
-left_brace: chr_cmd("begin-group character ");
-right_brace: chr_cmd("end-group character ");
-math_shift: chr_cmd("math shift character ");
-mac_param: chr_cmd("macro parameter character ");
-sup_mark: chr_cmd("superscript character ");
-sub_mark: chr_cmd("subscript character ");
-endv: print("end of alignment template");
-spacer: chr_cmd("blank space ");
-letter: chr_cmd("the letter ");
-other_char: chr_cmd("the character ");
-@t\4@>@<Cases of |print_cmd_chr| for symbolic printing of primitives@>@/
-othercases print("[unknown command code!]")
-endcases;
-end;
-
@ Here is a procedure that displays the current command.
@p procedure show_cur_cmd_chr;
@@ -7968,6 +7399,9 @@ convention~(1), so it is declared in the following way:
@!start_field,@!loc_field, @!limit_field, @!name_field,
@!ocp_lstack_field: halfword; {used for omega translation processes}
@!ocp_no_field: halfword; {used for omega translation processes}
+ @!synctex_tag_field: integer; {stack the tag of the current file}
+ @!cattable_field: integer; {category table used by the current line (see textoken.c)}
+ @!partial_field: boolean; {is the current line partial? (see textoken.c)}
@!nofilter_field: boolean; {used by token filtering}
end;
@@ -7988,8 +7422,11 @@ in our discussion of basic input-output routines. The other components of
@d limit==cur_input.limit_field {end of current line in |buffer|}
@d nofilter==cur_input.nofilter_field {is token filtering explicitly disallowed?}
@d name==cur_input.name_field {name of the current file}
+@d synctex_tag==cur_input.synctex_tag_field {{\sl Sync\TeX} tag of the current file}
@d current_ocp_lstack==cur_input.ocp_lstack_field {name of the current ocp}
@d current_ocp_no==cur_input.ocp_no_field {name of the current ocp}
+@d line_catcode_table==cur_input.cattable_field
+@d line_partial==cur_input.partial_field
@ Let's look more closely now at the control variables
(|state|,~|index|,~|start|,~|loc|,~|limit|,~|name|),
@@ -8615,6 +8052,8 @@ eof_seen[index]:=false;
grp_stack[index]:=cur_boundary; if_stack[index]:=cond_ptr;
line_stack[index]:=line; start:=first; state:=mid_line;
name:=0; {|terminal_input| is now |true|}
+line_catcode_table:=DEFAULT_CAT_TABLE; line_partial:=false;
+@<Prepare terminal input {\sl Sync\TeX} information@>;
end;
@ Conversely, the variables must be downdated when such a level of input
@@ -8651,6 +8090,7 @@ scanner_status:=normal; warning_index:=null; first:=1;
state:=new_line; start:=1; index:=0; line:=0; name:=0;
current_ocp_lstack:=0; current_ocp_no:=0; nofilter:=false;
force_eof:=false; luacstrings :=0;
+line_catcode_table:=DEFAULT_CAT_TABLE; line_partial:=false;
align_state:=1000000;@/
if not init_terminal then goto final_end;
limit:=last; first:=last+1; {|init_terminal| has set |loc| and |last|}
@@ -8689,13 +8129,10 @@ when detecting a blank line.
@!par_token:halfword; {token representing `\.{\\par}'}
@ @<Put each...@>=
-primitive("par",par_end,too_big_char); {cf. |scan_file_name|}
+primitive_tex("par",par_end,too_big_char,too_big_char); {cf.\ |scan_file_name|}
@!@:par_}{\.{\\par} primitive@>
par_loc:=cur_val; par_token:=cs_token_flag+par_loc;
-@ @<Cases of |print_cmd_chr|...@>=
-par_end:print_esc("par");
-
@ The function |get_next| is now defined in |textoken.c|. Parts of
this routine are executed more often than any other instructions of \TeX.
@^mastication@>@^inner loop@>
@@ -8755,9 +8192,7 @@ or the evaluation of the conditional.
|get_next| has already been called.
\yskip\noindent
-In fact, these three procedures account for {\sl all\/} uses of |get_next|,
-except for two places in the ``inner loop'' when |cur_tok| need not be set,
-and except when the arguments to \.{\\ifx} are being scanned.
+In fact, these three procedures account for almost every use of |get_next|.
@ No new control sequences will be defined except during a call of
|get_token|, or when \.{\\csname} compresses a token list, because
@@ -9029,16 +8464,11 @@ end
which will be declared later; the processing of \.{\\endinput} is trivial.
@<Put each...@>=
-primitive("input",input,0);@/
+primitive_tex("input",input,0,0);@/
@!@:input_}{\.{\\input} primitive@>
-primitive("endinput",input,1);@/
+primitive_tex("endinput",input,1,0);@/
@!@:end_input_}{\.{\\endinput} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-input: if chr_code=0 then print_esc("input")
- @/@<Cases of |input| for |print_cmd_chr|@>@/
- else print_esc("endinput");
-
@ @<Initiate or terminate input...@>=
if cur_chr=1 then force_eof:=true
@/@<Cases for |input|@>@/
@@ -9157,42 +8587,31 @@ for i:=0 to biggest_mark do begin
end;
@ @<Put each...@>=
-primitive("topmark",top_bot_mark,top_mark_code);
+primitive_tex("topmark",top_bot_mark,top_mark_code,0);
@!@:top_mark_}{\.{\\topmark} primitive@>
-primitive("firstmark",top_bot_mark,first_mark_code);
+primitive_tex("firstmark",top_bot_mark,first_mark_code,0);
@!@:first_mark_}{\.{\\firstmark} primitive@>
-primitive("botmark",top_bot_mark,bot_mark_code);
+primitive_tex("botmark",top_bot_mark,bot_mark_code,0);
@!@:bot_mark_}{\.{\\botmark} primitive@>
-primitive("splitfirstmark",top_bot_mark,split_first_mark_code);
+primitive_tex("splitfirstmark",top_bot_mark,split_first_mark_code,0);
@!@:split_first_mark_}{\.{\\splitfirstmark} primitive@>
-primitive("splitbotmark",top_bot_mark,split_bot_mark_code);
+primitive_tex("splitbotmark",top_bot_mark,split_bot_mark_code,0);
@!@:split_bot_mark_}{\.{\\splitbotmark} primitive@>
-primitive("clearmarks",mark,clear_marks_code);@/
+primitive_luatex("clearmarks",mark,clear_marks_code,0);@/
@!@:clearmarks_}{\.{\\clearmarks} primitive@>
-primitive("marks",mark,marks_code);
+primitive_etex("marks",mark,marks_code,0);
@!@:marks_}{\.{\\marks} primitive@>
-primitive("topmarks",top_bot_mark,top_mark_code+marks_code);
+primitive_etex("topmarks",top_bot_mark,top_mark_code+marks_code,0);
@!@:top_marks_}{\.{\\topmarks} primitive@>
-primitive("firstmarks",top_bot_mark,first_mark_code+marks_code);
+primitive_etex("firstmarks",top_bot_mark,first_mark_code+marks_code,0);
@!@:first_marks_}{\.{\\firstmarks} primitive@>
-primitive("botmarks",top_bot_mark,bot_mark_code+marks_code);
+primitive_etex("botmarks",top_bot_mark,bot_mark_code+marks_code,0);
@!@:bot_marks_}{\.{\\botmarks} primitive@>
-primitive("splitfirstmarks",top_bot_mark,split_first_mark_code+marks_code);
+primitive_etex("splitfirstmarks",top_bot_mark,split_first_mark_code+marks_code,0);
@!@:split_first_marks_}{\.{\\splitfirstmarks} primitive@>
-primitive("splitbotmarks",top_bot_mark,split_bot_mark_code+marks_code);
+primitive_etex("splitbotmarks",top_bot_mark,split_bot_mark_code+marks_code,0);
@!@:split_bot_marks_}{\.{\\splitbotmarks} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-top_bot_mark: begin case (chr_code mod marks_code) of
- first_mark_code: print_esc("firstmark");
- bot_mark_code: print_esc("botmark");
- split_first_mark_code: print_esc("splitfirstmark");
- split_bot_mark_code: print_esc("splitbotmark");
- othercases print_esc("topmark")
- endcases;
- if chr_code>=marks_code then print_char("s");
- end;
-
@ The following code is activated when |cur_cmd=top_bot_mark| and
when |cur_chr| is a code like |top_mark_code|.
@@ -9334,8 +8753,9 @@ if cur_tok=info(r) then
@<Contribute the recently matched tokens to the current parameter, and
|goto continue| if a partial match is still in effect;
but abort if |s=null|@>;
-if cur_tok=par_token then if long_state<>long_call then
- @<Report a runaway argument and abort@>;
+if cur_tok=par_token then if long_state<>long_call then
+ if not suppress_long_error then
+ @<Report a runaway argument and abort@>;
if cur_tok<right_brace_limit then
if cur_tok<left_brace_limit then
@<Contribute an entire group to the current parameter@>
@@ -9379,6 +8799,7 @@ help6("I've run across a `}' that doesn't seem to match anything.")@/
("argument that might be the root of the problem. But if")@/
("your `}' was spurious, just type `2' and it will go away.");
incr(align_state); long_state:=call; cur_tok:=par_token; ins_error;
+goto continue;
end {a white lie; the \.{\\par} won't always trigger a runaway}
@ If |long_state=outer_call|, a runaway argument has already been reported.
@@ -9447,7 +8868,8 @@ begin unbalance:=1;
@^inner loop@>
loop@+ begin fast_store_new_token(cur_tok); get_token;
if cur_tok=par_token then if long_state<>long_call then
- @<Report a runaway argument and abort@>;
+ if not suppress_long_error then
+ @<Report a runaway argument and abort@>;
if cur_tok<right_brace_limit then
if cur_tok<left_brace_limit then incr(unbalance)
else begin decr(unbalance);
@@ -9541,62 +8963,6 @@ end;
repeat get_x_token;
until cur_cmd<>spacer
-@ In case you are getting bored, here is a slightly less trivial routine:
-Given a string of lowercase letters, like `\.{pt}' or `\.{plus}' or
-`\.{width}', the |scan_keyword| routine checks to see whether the next
-tokens of input match this string. The match must be exact, except that
-uppercase letters will match their lowercase counterparts; uppercase
-equivalents are determined by subtracting |"a"-"A"|, rather than using the
-|uc_code| table, since \TeX\ uses this routine only for its own limited
-set of keywords.
-
-If a match is found, the characters are effectively removed from the input
-and |true| is returned. Otherwise |false| is returned, and the input
-is left essentially unchanged (except for the fact that some macros
-may have been expanded, etc.).
-@^inner loop@>
-
-@p function scan_keyword(@!s:str_number):boolean; {look for a given string}
-label exit;
-var p:pointer; {tail of the backup list}
-@!q:pointer; {new node being added to the token list via |store_new_token|}
-@!k:pool_pointer; {index into |str_pool|}
-begin
-if s<number_chars then begin
- @<Get the next non-blank non-call token@>;
- if (cur_cs=0)and((cur_chr=s)or(cur_chr=s-"a"+"A")) then
- scan_keyword:=true
- else
- begin back_input;
- scan_keyword:=false; return;
- end;
- end
-else begin
- p:=backup_head; link(p):=null;
- k:=str_start_macro(s);
- while k<str_start_macro(s+1) do
- begin get_x_token; {recursion is possible here}
-@^recursion@>
- if (cur_cs=0)and@|
- ((cur_chr=so(str_pool[k]))or(cur_chr=so(str_pool[k])-"a"+"A")) then
- begin store_new_token(cur_tok); incr(k);
- end
- else if (cur_cmd<>spacer)or(p<>backup_head) then
- begin
- if p<>backup_head then begin
- q:=get_avail; info(q):=cur_tok; link(q):=null;
- link(p) := q;
- back_list(link(backup_head));
- end
- else
- back_input;
- scan_keyword:=false; return;
- end;
- end;
- flush_list(link(backup_head)); scan_keyword:=true;
-end;
-exit:end;
-
@ Here is a procedure that sounds an alarm when mu and non-mu units
are being switched.
@@ -9673,22 +9039,15 @@ as their command code; they are distinguished by the |chr_code|, which
is either |int_val|, |attr_val|, |dimen_val|, |glue_val|, or |mu_val|.
@<Put each...@>=
-primitive("count",register,int_val);
+primitive_tex("count",register,int_val,0);
@!@:count_}{\.{\\count} primitive@>
-primitive("attribute",register,attr_val);
+primitive_luatex("attribute",register,attr_val,0);
@!@:count_}{\.{\\attribute} primitive@>
-primitive("dimen",register,dimen_val);
+primitive_tex("dimen",register,dimen_val,0);
@!@:dimen_}{\.{\\dimen} primitive@>
-primitive("skip",register,glue_val);
+primitive_tex("skip",register,glue_val,0);
@!@:skip_}{\.{\\skip} primitive@>
-primitive("muskip",register,mu_val);
-
-@ @<Cases of |print_cmd_chr|...@>=
-register: if chr_code=int_val then print_esc("count")
- else if chr_code=attr_val then print_esc("attribute")
- else if chr_code=dimen_val then print_esc("dimen")
- else if chr_code=glue_val then print_esc("skip")
- else print_esc("muskip");
+primitive_tex("muskip",register,mu_val,0);
@ OK, we're ready for |scan_something_internal| itself. A second parameter,
|negative|, is set |true| if the value that is found should be negated.
@@ -9708,10 +9067,16 @@ var m:halfword; {|chr_code| part of the operand token}
@!p:0..nest_size; {index into |nest|}
begin m:=cur_chr;
case cur_cmd of
-def_code: @<Fetch a character code from some table@>;
-extdef_code: @<Fetch an ext character code from some table@>;
-toks_register,assign_toks,def_family,set_font,def_font,letterspace_font: @<Fetch a token list or
- font identifier, provided that |level=tok_val|@>;
+def_char_code: @<Fetch a character code from some table@>;
+def_del_code: @<Fetch a character code from some table@>;
+extdef_math_code: @<Fetch an ext character code from some table@>;
+extdef_del_code: @<Fetch an ext character code from some table@>;
+toks_register,assign_toks,set_font,def_font,letterspace_font,pdf_copy_font:
+ @<Fetch a token list or font identifier, provided that |level=tok_val|@>;
+def_family:
+ @<Fetch a math font identifier@>;
+set_math_param:
+ @<Fetch a math param@>;
assign_int: scanned_result(eqtb[m].int)(int_val);
assign_attr: scanned_result(eqtb[m].int)(int_val);
assign_box_dir: begin
@@ -9729,9 +9094,10 @@ set_aux: @<Fetch the |space_factor| or the |prev_depth|@>;
set_prev_graf: @<Fetch the |prev_graf|@>;
set_page_int:@<Fetch the |dead_cycles| or the |insert_penalties|@>;
set_page_dimen: @<Fetch something on the |page_so_far|@>;
-set_shape: @<Fetch the |par_shape| size@>;
+set_tex_shape: @<Fetch the |par_shape| size@>;
+set_etex_shape: @<Fetch a penalties array element@>;
set_box_dimen: @<Fetch a box dimension@>;
-char_given,math_given,omath_given: scanned_result(cur_chr)(int_val);
+char_given,math_given,omath_given,xmath_given: scanned_result(cur_chr)(int_val);
assign_font_dimen: @<Fetch a font dimension@>;
assign_font_int: @<Fetch a font integer@>;
register: @<Fetch a register@>;
@@ -9746,9 +9112,13 @@ procedure scan_something_simple(@!cmd:halfword;@!subitem:halfword);
{fetch an internal parameter}
label exit;
var m:halfword; {|chr_code| part of the operand token}
+@!q:halfword; {general purpose index}
@!p:0..nest_size; {index into |nest|}
@!level:small_number; { allowed level}
-begin m:=subitem; level:=tok_val;
+@!negative:boolean;
+@!save_cur_chr:integer;
+begin m:=subitem; level:=tok_val;
+negative:=false; {never actually used, added for etexs |last_item| cases}
case cmd of
assign_toks: scanned_result(equiv(m))(tok_val);
assign_int: scanned_result(eqtb[m].int)(int_val);
@@ -9761,8 +9131,16 @@ set_aux: @<Fetch the |space_factor| or the |prev_depth|@>;
set_prev_graf: @<Fetch the |prev_graf|@>;
set_page_int:@<Fetch the |dead_cycles| or the |insert_penalties|@>;
set_page_dimen: @<Fetch something on the |page_so_far|@>;
-set_shape: @<Fetch the |par_shape| size@>;
-char_given,math_given,omath_given: scanned_result(m)(int_val); {TH: TODO, doesnt work}
+set_tex_shape: @<Fetch the |par_shape| size@>;
+set_etex_shape: @<Fetch a penalties array element@>;
+last_item: begin
+ save_cur_chr:=cur_chr;
+ cur_chr:=subitem;
+ @<Fetch an item in the current node, if appropriate@>;
+ cur_chr:=save_cur_chr;
+ end;
+char_given,math_given,omath_given,xmath_given:
+ scanned_result(m)(int_val); {TH: TODO, doesnt work}
othercases @<Complain that |texlib| can't do this; give zero result@>
endcases;@/
exit:end;
@@ -9770,18 +9148,7 @@ exit:end;
@ @<Fetch a character code from some table@>=
begin scan_char_num;
if m=math_code_base then begin
- cur_val1:=get_math_code(cur_val);
- if ((cur_val1 div @"1000000)>8) or
- (((cur_val1 mod @"1000000) div @"10000)>15) or
- ((cur_val1 mod @"10000)>255) then
- begin print_err("Extended mathchar used as mathchar");
-@.Bad mathchar@>
- help2("A mathchar number must be between 0 and ""7FFF.")@/
- ("I changed this one to zero."); int_error(cur_val1); cur_val1:=0;
- end;
- cur_val1:=((cur_val1 div @"1000000)*@"1000) +
- (((cur_val1 mod @"1000000) div @"10000)*@"100) +
- (cur_val1 mod @"10000);
+ cur_val1:=get_math_code_num(cur_val);
scanned_result(cur_val1)(int_val);
end
else if m=lc_code_base then begin
@@ -9806,7 +9173,10 @@ end
@ @<Fetch an ext character code from some table@>=
begin scan_char_num;
-if m=math_code_base then scanned_result(get_math_code(cur_val))(int_val)
+if m=math_code_base then begin
+ cur_val1:=get_math_code_num(cur_val);
+ scanned_result(cur_val1)(int_val);
+ end
{ TH: next two lines should not be possible }
else if m<math_code_base then scanned_result(equiv(m+cur_val))(int_val)
else scanned_result(eqtb[m+cur_val].int)(int_val);
@@ -9832,6 +9202,42 @@ else begin back_input; scan_font_ident;
scanned_result(font_id_base+cur_val)(ident_val);
end
+@ @<Fetch a math font identifier@>=
+begin scan_char_num; cur_val1:=fam_fnt(cur_val,m);
+ scanned_result(cur_val1)(int_val);
+ end
+
+@ @<Fetch a math param@>=
+begin cur_val1:=cur_chr; get_token;
+ if cur_cmd<>math_style then
+ begin print_err("Missing math style, treated as \\displaystyle");
+@.Missing number...@>
+ help1("A style should have been here; I inserted `\\displaystyle'.");
+ cur_val:=display_style;
+ back_error;
+ end
+ else
+ cur_val:=cur_chr;
+ if cur_val1<math_param_first_mu_glue then begin
+ if cur_val1=math_param_radical_degree_raise then begin
+ cur_val1 := get_math_param(cur_val1,cur_chr);
+ scanned_result(cur_val1)(int_val);
+ end
+ else begin
+ cur_val1 := get_math_param(cur_val1,cur_chr);
+ scanned_result(cur_val1)(dimen_val);
+ end;
+ end
+ else begin
+ cur_val1 := get_math_param(cur_val1,cur_chr);
+ if cur_val1=thin_mu_skip_code then cur_val1:=thin_mu_skip
+ else if cur_val1=med_mu_skip_code then cur_val1:=med_mu_skip
+ else if cur_val1=thick_mu_skip_code then cur_val1:=thick_mu_skip;
+ scanned_result(cur_val1)(mu_val);
+ end;
+ end
+
+
@ Users refer to `\.{\\the\\spacefactor}' only in horizontal
mode, and to `\.{\\the\\prevdepth}' only in vertical mode; so we put the
associated mode in the modifier part of the |set_aux| command.
@@ -9873,88 +9279,57 @@ the codes for its extensions: |eTeX_version_code|, \dots\ .
@d eTeX_expr=eTeX_mu+1 {first of \eTeX\ codes for expressions}
@<Put each...@>=
-primitive("spacefactor",set_aux,hmode);
+primitive_tex("spacefactor",set_aux,hmode,0);
@!@:space_factor_}{\.{\\spacefactor} primitive@>
-primitive("prevdepth",set_aux,vmode);@/
+primitive_tex("prevdepth",set_aux,vmode,0);@/
@!@:prev_depth_}{\.{\\prevdepth} primitive@>
-primitive("deadcycles",set_page_int,0);
+primitive_tex("deadcycles",set_page_int,0,0);
@!@:dead_cycles_}{\.{\\deadcycles} primitive@>
-primitive("insertpenalties",set_page_int,1);
+primitive_tex("insertpenalties",set_page_int,1,0);
@!@:insert_penalties_}{\.{\\insertpenalties} primitive@>
-primitive("wd",set_box_dimen,width_offset);
+primitive_tex("wd",set_box_dimen,width_offset,0);
@!@:wd_}{\.{\\wd} primitive@>
-primitive("ht",set_box_dimen,height_offset);
+primitive_tex("ht",set_box_dimen,height_offset,0);
@!@:ht_}{\.{\\ht} primitive@>
-primitive("dp",set_box_dimen,depth_offset);
+primitive_tex("dp",set_box_dimen,depth_offset,0);
@!@:dp_}{\.{\\dp} primitive@>
-primitive("lastpenalty",last_item,int_val);
+primitive_tex("lastpenalty",last_item,int_val,0);
@!@:last_penalty_}{\.{\\lastpenalty} primitive@>
-primitive("lastkern",last_item,dimen_val);
+primitive_tex("lastkern",last_item,dimen_val,0);
@!@:last_kern_}{\.{\\lastkern} primitive@>
-primitive("lastskip",last_item,glue_val);
+primitive_tex("lastskip",last_item,glue_val,0);
@!@:last_skip_}{\.{\\lastskip} primitive@>
-primitive("inputlineno",last_item,input_line_no_code);
+primitive_tex("inputlineno",last_item,input_line_no_code,0);
@!@:input_line_no_}{\.{\\inputlineno} primitive@>
-primitive("badness",last_item,badness_code);
+primitive_tex("badness",last_item,badness_code,0);
@!@:badness_}{\.{\\badness} primitive@>
-primitive("pdftexversion",last_item,pdftex_version_code);@/
+primitive_pdftex("pdftexversion",last_item,pdftex_version_code,0);@/
@!@:pdftex_version_}{\.{\\pdftexversion} primitive@>
-primitive("luatexversion",last_item,luatex_version_code);@/
+primitive_luatex("luatexversion",last_item,luatex_version_code,0);@/
@!@:luatex_version_}{\.{\\luatexversion} primitive@>
-primitive("pdflastobj",last_item,pdf_last_obj_code);@/
+primitive_pdftex("pdflastobj",last_item,pdf_last_obj_code,0);@/
@!@:pdf_last_obj_}{\.{\\pdflastobj} primitive@>
-primitive("pdflastxform",last_item,pdf_last_xform_code);@/
+primitive_pdftex("pdflastxform",last_item,pdf_last_xform_code,0);@/
@!@:pdf_last_xform_}{\.{\\pdflastxform} primitive@>
-primitive("pdflastximage",last_item,pdf_last_ximage_code);@/
+primitive_pdftex("pdflastximage",last_item,pdf_last_ximage_code,0);@/
@!@:pdf_last_ximage_}{\.{\\pdflastximage} primitive@>
-primitive("pdflastximagepages",last_item,pdf_last_ximage_pages_code);@/
+primitive_pdftex("pdflastximagepages",last_item,pdf_last_ximage_pages_code,0);@/
@!@:pdf_last_ximage_pages_}{\.{\\pdflastximagepages} primitive@>
-primitive("pdflastannot",last_item,pdf_last_annot_code);@/
+primitive_pdftex("pdflastannot",last_item,pdf_last_annot_code,0);@/
@!@:pdf_last_annot_}{\.{\\pdflastannot} primitive@>
-primitive("pdflastxpos",last_item,pdf_last_x_pos_code);@/
+primitive_pdftex("pdflastxpos",last_item,pdf_last_x_pos_code,0);@/
@!@:pdf_last_x_pos_}{\.{\\pdflastxpos} primitive@>
-primitive("pdflastypos",last_item,pdf_last_y_pos_code);@/
+primitive_pdftex("pdflastypos",last_item,pdf_last_y_pos_code,0);@/
@!@:pdf_last_y_pos_}{\.{\\pdflastypos} primitive@>
-primitive("pdfretval",last_item,pdf_retval_code);@/
+primitive_pdftex("pdfretval",last_item,pdf_retval_code,0);@/
@!@:pdf_retval_}{\.{\\pdfretval} primitive@>
-primitive("pdflastximagecolordepth",last_item,pdf_last_ximage_colordepth_code);@/
+primitive_pdftex("pdflastximagecolordepth",last_item,pdf_last_ximage_colordepth_code,0);@/
@!@:pdf_last_ximage_colordepth_}{\.{\\pdflastximagecolordepth} primitive@>
-primitive("pdfrandomseed",last_item,random_seed_code);
+primitive_pdftex("pdfrandomseed",last_item,random_seed_code,0);
@!@:random_seed_}{\.{\\pdfrandomseed} primitive@>
-primitive("pdflastlink",last_item,pdf_last_link_code);@/
+primitive_pdftex("pdflastlink",last_item,pdf_last_link_code,0);@/
@!@:pdf_last_link_}{\.{\\pdflastlink} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-set_aux: if chr_code=vmode then print_esc("prevdepth")
-@+else print_esc("spacefactor");
-set_page_int: if chr_code=0 then print_esc("deadcycles")
-@/@<Cases of |set_page_int| for |print_cmd_chr|@>@/
-@+else print_esc("insertpenalties");
-set_box_dimen: if chr_code=width_offset then print_esc("wd")
-else if chr_code=height_offset then print_esc("ht")
-else print_esc("dp");
-last_item: case chr_code of
- int_val: print_esc("lastpenalty");
- dimen_val: print_esc("lastkern");
- glue_val: print_esc("lastskip");
- input_line_no_code: print_esc("inputlineno");
- @/@<Cases of |last_item| for |print_cmd_chr|@>@/
- pdftex_version_code: print_esc("pdftexversion");
- luatex_version_code: print_esc("luatexversion");
- pdf_last_obj_code: print_esc("pdflastobj");
- pdf_last_xform_code: print_esc("pdflastxform");
- pdf_last_ximage_code: print_esc("pdflastximage");
- pdf_last_ximage_pages_code: print_esc("pdflastximagepages");
- pdf_last_annot_code: print_esc("pdflastannot");
- pdf_last_x_pos_code: print_esc("pdflastxpos");
- pdf_last_y_pos_code: print_esc("pdflastypos");
- pdf_retval_code: print_esc("pdfretval");
- pdf_last_ximage_colordepth_code: print_esc("pdflastximagecolordepth");
- random_seed_code: print_esc("pdfrandomseed");
- pdf_last_link_code: print_esc("pdflastlink");
- othercases print_esc("badness")
- endcases;
-
@ @<Fetch the |space_factor| or the |prev_depth|@>=
if abs(mode)<>m then
begin print_err("Improper "); print_cmd_chr(set_aux,m);
@@ -9968,11 +9343,8 @@ if abs(mode)<>m then
if level<>tok_val then scanned_result(0)(dimen_val)
else scanned_result(0)(int_val);
end
-else if m=vmode then
- begin cur_val:=prev_depth; cur_val_level:=dimen_val;
- end
-else begin cur_val:=space_factor; cur_val_level:=int_val;
- end
+else if m=vmode then scanned_result(prev_depth)(dimen_val)
+else scanned_result(space_factor)(int_val)
@ @<Fetch the |dead_cycles| or the |insert_penalties|@>=
begin if m=0 then cur_val:=dead_cycles
@@ -10007,9 +9379,8 @@ else begin nest[nest_ptr]:=cur_list; p:=nest_ptr;
end
@ @<Fetch the |par_shape| size@>=
-begin if m>par_shape_loc then @<Fetch a penalties array element@>
-else if par_shape_ptr=null then cur_val:=0
-else cur_val:=vinfo(par_shape_ptr);
+begin if par_shape_ptr=null then cur_val:=0
+else cur_val:=vinfo(par_shape_ptr+1);
cur_val_level:=int_val;
end
@@ -10186,6 +9557,9 @@ applications of |scan_int| that have already been made inside of
@d dir_prev_end(#)==((#) mod 4)
@d dir_prev(#)==(((#)+1) mod 4)=dir_prev_end
+@d dir_horizontal(#)==(((#)=dir_L) or ((#)=dir_R))
+@d dir_vertical(#)==(((#)=dir_T) or ((#)=dir_B))
+
{box directions}
@d dir_TL_=0
@d dir_TR_=1
@@ -10214,43 +9588,11 @@ applications of |scan_int| that have already been made inside of
@d dir__BB=14
@d dir__BR=15
-@d is_mirrored(#)==dir_opposite(dir_primary[#])(dir_tertiary[#])
-@d is_rotated(#)==dir_parallel(dir_secondary[#])(dir_tertiary[#])
+@d is_mirrored(#)==(dir_opposite(dir_primary[#])(dir_tertiary[#]))
+@d is_rotated(#)==(dir_parallel(dir_secondary[#])(dir_tertiary[#]))
@d font_direction(#)==(# mod 16)
@d box_direction(#)==(# div 4)
-@d scan_single_dir(#)==begin
-if scan_keyword("T") then #:=dir_T
-else if scan_keyword("L") then #:=dir_L
-else if scan_keyword("B") then #:=dir_B
-else if scan_keyword("R") then #:=dir_R
-else begin
- print_err("Bad direction"); cur_val:=0;
- goto exit;
- end
-end
-
-@<Declare procedures that scan restricted classes of integers@>=
-procedure scan_direction;
-var d1,d2,d3: integer;
-begin
-get_x_token;
-if cur_cmd=assign_dir then begin
- cur_val:=eqtb[cur_chr].int;
- goto exit;
- end
-else back_input;
-scan_single_dir(d1);
-scan_single_dir(d2);
-if dir_parallel(d1)(d2) then begin
- print_err("Bad direction"); cur_val:=0;
- goto exit;
- end;
-scan_single_dir(d3);
-cur_val:=d1*8+dir_rearrange[d2]*4+d3;
-exit:
-end;
-
@ It is nice to have routines that say what they do, so the original
|scan_eight_bit_int| is superceded by |scan_register_num| and
|scan_mark_num|. It may become split up even further in the future.
@@ -10351,12 +9693,6 @@ if (cur_val<0)or(cur_val>@'777777777) then
help2("A numeric delimiter code must be between 0 and 2^{27}-1.")@/
("I changed this one to zero."); int_error(cur_val); cur_val:=0;
end;
-cur_val1 := (((cur_val mod @"1000) div @"100) * @"10000) +
- (cur_val mod @"100);
-cur_val := cur_val div @"1000;
-cur_val := ((cur_val div @"1000) * @"1000000) +
- (((cur_val mod @"1000) div @"100) * @"10000) +
- (cur_val mod @"100);
end;
procedure scan_fifty_one_bit_int;
@@ -10430,7 +9766,7 @@ comes into action before any of the basic scanning routines has assigned
them a value.
@<Set init...@>=
-cur_val:=0; cur_val_level:=int_val; radix:=0; cur_order:=0;
+cur_val:=0; cur_val_level:=int_val; radix:=0; cur_order:=normal;
@ The |scan_int| routine is used also to scan the integer part of a
fraction; for example, the `\.3' in `\.{3.14159}' will be found by
@@ -10473,10 +9809,10 @@ if cur_tok<cs_token_flag then
if cur_cmd=right_brace then incr(align_state)
else decr(align_state);
end
-else if cur_tok<cs_token_flag+null_cs then
- cur_val:=cur_tok-cs_token_flag-active_base
else begin {the value of a csname in this context is its name}
- if single_letter(text(cur_tok-cs_token_flag)) then
+ if is_active_csname(cur_tok-cs_token_flag) then
+ cur_val:=active_csname_value(cur_tok-cs_token_flag)
+ else if single_letter(text(cur_tok-cs_token_flag)) then
cur_val:=pool_to_unichar(str_start_macro(text(cur_tok-cs_token_flag)))
else
cur_val:=too_big_char;
@@ -10672,9 +10008,9 @@ if inf then @<Scan for \(f)\.{fil} units; |goto attach_fraction| if found@>;
@<Scan for \(u)units that are internal dimensions;
|goto attach_sign| with |cur_val| set if found@>;
if mu then @<Scan for \(m)\.{mu} units and |goto attach_fraction|@>;
-if scan_keyword("true") then @<Adjust \(f)for the magnification ratio@>;
+if scan_keyword('true') then @<Adjust \(f)for the magnification ratio@>;
@.true@>
-if scan_keyword("pt") then goto attach_fraction; {the easy case}
+if scan_keyword('pt') then goto attach_fraction; {the easy case}
@.pt@>
@<Scan for \(a)all other units and adjust |cur_val| and |f| accordingly;
|goto done| in the case of scaled points@>;
@@ -10689,10 +10025,10 @@ L}' will lead to two error messages (one for each additional keyword
Not so for luatex, it just parses the construct in reverse.
@<Scan for \(f)\.{fil} units...@>=
-if scan_keyword("filll") then begin cur_order:=filll; goto attach_fraction; end
-else if scan_keyword("fill") then begin cur_order:=fill; goto attach_fraction; end
-else if scan_keyword("fil") then begin cur_order:=fil; goto attach_fraction; end
-else if scan_keyword("fi") then begin cur_order:=sfi; goto attach_fraction; end
+if scan_keyword('filll') then begin cur_order:=filll; goto attach_fraction; end
+else if scan_keyword('fill') then begin cur_order:=fill; goto attach_fraction; end
+else if scan_keyword('fil') then begin cur_order:=fil; goto attach_fraction; end
+else if scan_keyword('fi') then begin cur_order:=sfi; goto attach_fraction; end
@ @<Scan for \(u)units that are internal dimensions...@>=
save_cur_val:=cur_val;
@@ -10706,11 +10042,11 @@ else begin if mu then
v:=cur_val; goto found;
end;
if mu then goto not_found;
-if scan_keyword("em") then v:=(@<The em width for |cur_font|@>)
+if scan_keyword('em') then v:=(@<The em width for |cur_font|@>)
@.em@>
-else if scan_keyword("ex") then v:=(@<The x-height for |cur_font|@>)
+else if scan_keyword('ex') then v:=(@<The x-height for |cur_font|@>)
@.ex@>
-else if scan_keyword("px") then v:=pdf_px_dimen
+else if scan_keyword('px') then v:=pdf_px_dimen
@.px@>
else goto not_found;
@<Scan an optional space@>;
@@ -10719,7 +10055,7 @@ goto attach_sign;
not_found:
@ @<Scan for \(m)\.{mu} units and |goto attach_fraction|@>=
-if scan_keyword("mu") then goto attach_fraction
+if scan_keyword('mu') then goto attach_fraction
@.mu@>
else begin print_err("Illegal unit of measure ("); print("mu inserted)");
@.Illegal unit of measure@>
@@ -10749,36 +10085,37 @@ in {\sl Technische Grundlagen zur Satzherstellung\/} (Bern, 1980).
The Didot point has been newly standardized in 1978;
it's now exactly $\rm 1\,nd=0.375\,mm$.
Conversion uses the equation $0.375=21681/20320/72.27\cdot25.4$.
-The new Cicero follows the new Didot point; $\rm 1\,nc=12\,nd$. These
-would lead to the ratios $21681/20320$ and $65043/5080$, respectively.
+The new Cicero follows the new Didot point; $\rm 1\,nc=12\,nd$.
+These would lead to the ratios $21681/20320$ and $65043/5080$,
+respectively.
The closest approximations supported by the algorithm would be
$11183/10481$ and $1370/107$. In order to maintain the
-relation $\rm 1\,nc=12\,nd$, we pick the ratio $685/642$ for $\rm nd$,
-however.
+relation $\rm 1\,nc=12\,nd$, we pick the ratio $685/642$ for
+$\rm nd$, however.
@d set_conversion_end(#)== denom:=#; end
@d set_conversion(#)==@+begin num:=#; set_conversion_end
@<Scan for \(a)all other units and adjust |cur_val| and |f|...@>=
-if scan_keyword("in") then set_conversion(7227)(100)
+if scan_keyword('in') then set_conversion(7227)(100)
@.in@>
-else if scan_keyword("pc") then set_conversion(12)(1)
+else if scan_keyword('pc') then set_conversion(12)(1)
@.pc@>
-else if scan_keyword("cm") then set_conversion(7227)(254)
+else if scan_keyword('cm') then set_conversion(7227)(254)
@.cm@>
-else if scan_keyword("mm") then set_conversion(7227)(2540)
+else if scan_keyword('mm') then set_conversion(7227)(2540)
@.mm@>
-else if scan_keyword("bp") then set_conversion(7227)(7200)
+else if scan_keyword('bp') then set_conversion(7227)(7200)
@.bp@>
-else if scan_keyword("dd") then set_conversion(1238)(1157)
+else if scan_keyword('dd') then set_conversion(1238)(1157)
@.dd@>
-else if scan_keyword("cc") then set_conversion(14856)(1157)
+else if scan_keyword('cc') then set_conversion(14856)(1157)
@.cc@>
-else if scan_keyword("nd") then set_conversion(685)(642)
+else if scan_keyword('nd') then set_conversion(685)(642)
@.nd@>
-else if scan_keyword("nc") then set_conversion(1370)(107)
+else if scan_keyword('nc') then set_conversion(1370)(107)
@.nc@>
-else if scan_keyword("sp") then goto done
+else if scan_keyword('sp') then goto done
@.sp@>
else @<Complain about unknown unit and |goto done2|@>;
cur_val:=xn_over_d(cur_val,num,denom);
@@ -10845,12 +10182,12 @@ exit:end;
@ @<Create a new glue specification whose width is |cur_val|...@>=
q:=new_spec(zero_glue); width(q):=cur_val;
-if scan_keyword("plus") then
+if scan_keyword('plus') then
@.plus@>
begin scan_dimen(mu,true,false);
stretch(q):=cur_val; stretch_order(q):=cur_order;
end;
-if scan_keyword("minus") then
+if scan_keyword('minus') then
@.minus@>
begin scan_dimen(mu,true,false);
shrink(q):=cur_val; shrink_order(q):=cur_order;
@@ -10878,15 +10215,15 @@ else begin
height(q):=default_rule; depth(q):=0;
rule_dir(q):=text_direction;
end;
-reswitch: if scan_keyword("width") then
+reswitch: if scan_keyword('width') then
@.width@>
begin scan_normal_dimen; width(q):=cur_val; goto reswitch;
end;
-if scan_keyword("height") then
+if scan_keyword('height') then
@.height@>
begin scan_normal_dimen; height(q):=cur_val; goto reswitch;
end;
-if scan_keyword("depth") then
+if scan_keyword('depth') then
@.depth@>
begin scan_normal_dimen; depth(q):=cur_val; goto reswitch;
end;
@@ -11078,104 +10415,74 @@ such that |job_name_code| remains last.
@d pdf_colorstack_init_code = pdftex_first_expand_code + 16 {command code for \.{\\pdfcolorstackinit}}
@d luatex_revision_code = pdftex_first_expand_code + 17 {command code for \.{\\luatexrevision}}
@d luatex_date_code = pdftex_first_expand_code + 18 {command code for \.{\\luatexdate}}
-@d pdftex_convert_codes = pdftex_first_expand_code + 19 {end of \pdfTeX's command codes}
+@d expanded_code = pdftex_first_expand_code + 19 {command code for \.{\\luatexdate}}
+@d pdftex_convert_codes = pdftex_first_expand_code + 20 {end of \pdfTeX's command codes}
@d job_name_code=pdftex_convert_codes {command code for \.{\\jobname}}
@<Put each...@>=
-primitive("number",convert,number_code);@/
+primitive_tex("number",convert,number_code,0);@/
@!@:number_}{\.{\\number} primitive@>
-primitive("romannumeral",convert,roman_numeral_code);@/
+primitive_tex("romannumeral",convert,roman_numeral_code,0);@/
@!@:roman_numeral_}{\.{\\romannumeral} primitive@>
-primitive("string",convert,string_code);@/
+primitive_tex("string",convert,string_code,0);@/
@!@:string_}{\.{\\string} primitive@>
-primitive("meaning",convert,meaning_code);@/
+primitive_tex("meaning",convert,meaning_code,0);@/
@!@:meaning_}{\.{\\meaning} primitive@>
-primitive("eTeXVersion",convert,etex_code);@/
+primitive_etex("eTeXVersion",convert,etex_code,0);@/
@!@:omega_version_}{\.{\\OmegaVersion} primitive@>
-primitive("OmegaVersion",convert,omega_code);@/
+primitive_omega("OmegaVersion",convert,omega_code,0);@/
@!@:omega_version_}{\.{\\OmegaVersion} primitive@>
-primitive("AlephVersion",convert,aleph_code);@/
+primitive_aleph("AlephVersion",convert,aleph_code,0);@/
@!@:aleph_version_}{\.{\\AlephVersion} primitive@>
-primitive("fontname",convert,font_name_code);@/
+primitive_tex("fontname",convert,font_name_code,0);@/
@!@:font_name_}{\.{\\fontname} primitive@>
-primitive("pdftexrevision",convert,pdftex_revision_code);@/
+primitive_pdftex("pdftexrevision",convert,pdftex_revision_code,0);@/
@!@:pdftex_revision_}{\.{\\pdftexrevision} primitive@>
-primitive("luatexrevision",convert,luatex_revision_code);@/
+primitive_luatex("luatexrevision",convert,luatex_revision_code,0);@/
@!@:luatex_revision_}{\.{\\luatexrevision} primitive@>
-primitive("luatexdatestamp",convert,luatex_date_code);@/
+primitive_luatex("luatexdatestamp",convert,luatex_date_code,0);@/
@!@:luatex_date_}{\.{\\luatexdatestamp} primitive@>
-primitive("pdftexbanner",convert,pdftex_banner_code);@/
+primitive_pdftex("pdftexbanner",convert,pdftex_banner_code,0);@/
@!@:pdftex_banner_}{\.{\\pdftexbanner} primitive@>
-primitive("pdffontname",convert,pdf_font_name_code);@/
+primitive_pdftex("pdffontname",convert,pdf_font_name_code,0);@/
@!@:pdf_font_name_}{\.{\\pdffontname} primitive@>
-primitive("pdffontobjnum",convert,pdf_font_objnum_code);@/
+primitive_pdftex("pdffontobjnum",convert,pdf_font_objnum_code,0);@/
@!@:pdf_font_objnum_}{\.{\\pdffontobjnum} primitive@>
-primitive("pdffontsize",convert,pdf_font_size_code);@/
+primitive_pdftex("pdffontsize",convert,pdf_font_size_code,0);@/
@!@:pdf_font_size_}{\.{\\pdffontsize} primitive@>
-primitive("pdfpageref",convert,pdf_page_ref_code);@/
+primitive_pdftex("pdfpageref",convert,pdf_page_ref_code,0);@/
@!@:pdf_page_ref_}{\.{\\pdfpageref} primitive@>
-primitive("leftmarginkern",convert,left_margin_kern_code);@/
+primitive_pdftex("leftmarginkern",convert,left_margin_kern_code,0);@/
@!@:left_margin_kern_}{\.{\\leftmarginkern} primitive@>
-primitive("rightmarginkern",convert,right_margin_kern_code);@/
+primitive_pdftex("rightmarginkern",convert,right_margin_kern_code,0);@/
@!@:right_margin_kern_}{\.{\\rightmarginkern} primitive@>
-primitive("pdfxformname",convert,pdf_xform_name_code);@/
+primitive_pdftex("pdfxformname",convert,pdf_xform_name_code,0);@/
@!@:pdf_xform_name_}{\.{\\pdfxformname} primitive@>
-primitive("pdfcreationdate",convert,pdf_creation_date_code);@/
+primitive_pdftex("pdfcreationdate",convert,pdf_creation_date_code,0);@/
@!@:pdf_creation_date_}{\.{\\pdfcreationdate} primitive@>
-primitive("pdfuniformdeviate",convert,uniform_deviate_code);@/
+primitive_pdftex("pdfuniformdeviate",convert,uniform_deviate_code,0);@/
@!@:uniform_deviate_}{\.{\\pdfuniformdeviate} primitive@>
-primitive("pdfcolorstackinit",convert,pdf_colorstack_init_code);@/
+primitive_pdftex("pdfcolorstackinit",convert,pdf_colorstack_init_code,0);@/
@!@:pdf_colorstack_init_}{\.{\\pdfcolorstackinit} primitive@>
-primitive("pdfnormaldeviate",convert,normal_deviate_code);@/
+primitive_pdftex("pdfnormaldeviate",convert,normal_deviate_code,0);@/
@!@:normal_deviate_}{\.{\\pdfnormaldeviate} primitive@>
-primitive("directlua",convert,lua_code);@/
+primitive_core("directlua",convert,lua_code,0);@/
@!@:lua_}{\.{\\directlua} primitive@>
-primitive("luaescapestring",convert,lua_escape_string_code);@/
+primitive_luatex("luaescapestring",convert,lua_escape_string_code,0);@/
@!@:lua_}{\.{\\luaescapestring} primitive@>
+primitive_pdftex("expanded",convert,expanded_code,0);@/
+@!@:expanded_}{\.{\\expanded} primitive@>
@#
-primitive("jobname",convert,job_name_code);@/
+primitive_tex("jobname",convert,job_name_code,0);@/
@!@:job_name_}{\.{\\jobname} primitive@>
-primitive("formatname",convert,format_name_code);@/
+primitive_luatex("formatname",convert,format_name_code,0);@/
@!@:format_name_}{\.{\\formatname} primitive@>
-primitive("pdfinsertht",convert,pdf_insert_ht_code);@/
+primitive_pdftex("pdfinsertht",convert,pdf_insert_ht_code,0);@/
@!@:pdf_insert_ht_}{\.{\\pdfinsertht} primitive@>
-primitive("pdfximagebbox",convert,pdf_ximage_bbox_code);@/
+primitive_pdftex("pdfximagebbox",convert,pdf_ximage_bbox_code,0);@/
@!@:pdf_ximage_bbox_}{\.{\\pdfximagebbox} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-convert: case chr_code of
- number_code: print_esc("number");
- roman_numeral_code: print_esc("romannumeral");
- string_code: print_esc("string");
- meaning_code: print_esc("meaning");
- etex_code: print_esc("eTeXVersion");
- omega_code: print_esc("OmegaVersion");
- aleph_code: print_esc("AlephVersion");
- font_name_code: print_esc("fontname");
- pdftex_revision_code: print_esc("pdftexrevision");
- luatex_revision_code: print_esc("luatexrevision");
- luatex_date_code: print_esc("luatexdatestamp");
- pdftex_banner_code: print_esc("pdftexbanner");
- pdf_font_name_code: print_esc("pdffontname");
- pdf_font_objnum_code: print_esc("pdffontobjnum");
- pdf_font_size_code: print_esc("pdffontsize");
- pdf_page_ref_code: print_esc("pdfpageref");
- left_margin_kern_code: print_esc("leftmarginkern");
- right_margin_kern_code: print_esc("rightmarginkern");
- pdf_xform_name_code: print_esc("pdfxformname");
- pdf_creation_date_code: print_esc("pdfcreationdate");
- pdf_colorstack_init_code: print_esc("pdfcolorstackinit");
- uniform_deviate_code: print_esc("pdfuniformdeviate");
- normal_deviate_code: print_esc("pdfnormaldeviate");
- pdf_insert_ht_code: print_esc("pdfinsertht");
- pdf_ximage_bbox_code: print_esc("pdfximagebbox");
- lua_code: print_esc("directlua");
- lua_escape_string_code: print_esc("luaescapestring");
- @/@<Cases of |convert| for |print_cmd_chr|@>@/
- othercases print_esc("jobname")
- endcases;
-
@ The procedure |conv_toks| uses |str_toks| to insert the token list
for |convert| functions into the scanner; `\.{\\outer}' control sequences
are allowed to follow `\.{\\string}' and `\.{\\meaning}'.
@@ -11200,6 +10507,7 @@ p, q: pointer;
@!j: integer; {second temp integer}
@!b:pool_pointer; {base of temporary string}
@!s: str_number; {first temp string}
+@!sn: integer; {lua chunk name}
@!u: str_number; {third temp string}
@!junk: pointer;
begin
@@ -11213,6 +10521,12 @@ selector:=old_setting; junk:=str_toks(b); ins_list(link(temp_token_head));
exit:
end;
+@ @<Glob...@>=
+in_lua_escape:boolean;
+
+@ @<Set init...@>=
+in_lua_escape:=false;
+
@ @<Scan the argument for command |c|@>=
case c of
number_code,roman_numeral_code: scan_int;
@@ -11262,11 +10576,11 @@ pdf_creation_date_code:
job_name_code: if job_name=0 then open_log_file;
pdf_colorstack_init_code:
begin
- bool := scan_keyword("page");
- if scan_keyword("direct") then
+ bool := scan_keyword('page');
+ if scan_keyword('direct') then
cur_val := direct_always
else
- if scan_keyword("page") then
+ if scan_keyword('page') then
cur_val := direct_page
else
cur_val := set_origin;
@@ -11297,54 +10611,77 @@ uniform_deviate_code: scan_int;
normal_deviate_code: do_nothing;
lua_escape_string_code:
begin
- u:=0;
+ u:=0;
{ check if a string is already being built}
if str_start_macro(str_ptr)<pool_ptr then u:=make_string;
save_scanner_status := scanner_status;
save_def_ref := def_ref;
save_warning_index := warning_index;
scan_pdf_ext_toks;
+ bool := in_lua_escape;
+ in_lua_escape:=true;
s := tokens_to_string(def_ref);
+ in_lua_escape:=bool;
delete_token_ref(def_ref);
def_ref := save_def_ref;
warning_index := save_warning_index;
scanner_status := save_scanner_status;
junk := lua_str_toks(str_start_macro(s));
- ins_list(link(temp_token_head));
+ ins_list(link(temp_token_head));
flush_str(s);
- if u<>0 then begin decr(str_ptr); u:=0; end;
+ if u<>0 then begin decr(str_ptr); u:=0; end;
+ return;
+ end;
+expanded_code:
+ begin
+ save_scanner_status := scanner_status;
+ save_warning_index := warning_index;
+ save_def_ref := def_ref;
+ save_cur_string;
+ scan_pdf_ext_toks;
+ warning_index := save_warning_index;
+ scanner_status := save_scanner_status;
+ ins_list(link(def_ref));
+ def_ref := save_def_ref;
+ restore_cur_string;
return;
end;
lua_code:
begin
- u:=0;
- { check if a string is already being built}
+ u:=0;
+ { Have to check if a string is already being built, because lua code
+ may call library functions that may call C functions that
+ themselves use the string pool, like e.g. |maketexstring| }
if str_start_macro(str_ptr)<pool_ptr then u:=make_string;
save_scanner_status := scanner_status;
save_def_ref := def_ref;
save_warning_index := warning_index;
- scan_register_num;
- i := cur_val;
+ sn:=0;
+ if scan_keyword('name') then begin
+ scan_pdf_ext_toks;
+ sn := def_ref;
+ end;
+ @<Parse optional lua state integer, or an instance name to be stored in |sn|@>;
scan_pdf_ext_toks;
s := def_ref;
warning_index := save_warning_index;
def_ref := save_def_ref;
scanner_status := save_scanner_status;
luacstrings:=0;
- luatokencall(i,s);
+ luatokencall(s,sn);
delete_token_ref(s);
- if u<>0 then begin
+ if u<>0 then begin
if str_ptr=u+1 then
decr(str_ptr)
else begin {copy old string to the top location}
i:=0;
- str_room(length(u));
+ str_room(length(u));
while i<length(u) do
str_pool[pool_ptr+i]:=str_pool[str_start_macro(u)+i];
end;
end;
- if luacstrings>0 then
- lua_string_start;
+ if luacstrings>0 then
+ lua_string_start;
return;
end;
pdf_insert_ht_code: scan_register_num;
@@ -11360,6 +10697,26 @@ pdf_ximage_bbox_code: begin
@<Cases of `Scan the argument for command |c|'@>
end {there are no other cases}
+@ @<Parse optional lua state...@>=
+begin
+ @<Get the next non-blank non-relax non-call token@>;
+ back_input; { have to push it back, whatever it is }
+ if cur_cmd<>left_brace then begin
+ scan_register_num;
+ if get_lua_name(cur_val) then
+ sn:=(cur_val-65536)
+ else begin
+ i:=tracing_online;
+ tracing_online:=1;
+ begin_diagnostic;
+ print_nl("Warning: support for multiple lua states has been dropped.");
+ print_nl(" Please stop using a number after \directlua and \latelua.");
+ end_diagnostic(true);
+ tracing_online:=i;
+ end;
+ end;
+end
+
@ @<Print the result of command |c|@>=
case c of
number_code: print_int(cur_val);
@@ -11437,12 +10794,15 @@ pdf_insert_ht_code: begin
print("pt");
end;
pdf_ximage_bbox_code: begin
- case j of
- 1: print_scaled(epdf_orig_x(i));
- 2: print_scaled(epdf_orig_y(i));
- 3: print_scaled(epdf_orig_x(i) + image_width(i));
- 4: print_scaled(epdf_orig_y(i) + image_height(i));
- endcases;
+ if is_pdf_image(i) then begin
+ case j of
+ 1: print_scaled(epdf_orig_x(i));
+ 2: print_scaled(epdf_orig_y(i));
+ 3: print_scaled(epdf_orig_x(i) + epdf_xsize(i));
+ 4: print_scaled(epdf_orig_y(i) + epdf_ysize(i));
+ endcases;
+ end else
+ print_scaled(0);
print("pt");
end;
format_name_code: print(format_name);
@@ -11456,24 +10816,49 @@ begin
is_convert:=(c=convert);
end;
-function the_convert_string (c:halfword):str_number;
+function the_convert_string (c:halfword;i:integer):str_number;
var old_setting:0..max_selector; {saved |selector| setting}
- is_known:boolean;
+ is_known:boolean;
begin
old_setting:=selector;
selector:=new_string;
is_known:=true;
case c of
- etex_code: print(eTeX_version_string);
- omega_code: print(Omega_version_string);
- aleph_code: print(Aleph_version_string);
- pdftex_revision_code: print(pdftex_revision);
- luatex_revision_code: print(luatex_revision);
- luatex_date_code: print_int(luatex_date_info);
- pdftex_banner_code: print(pdftex_banner);
- normal_deviate_code: print_int(norm_rand);
- format_name_code: print(format_name);
- job_name_code: print(job_name);
+ number_code: print_int(i);
+ roman_numeral_code: print_roman_int(i);
+ etex_code: print(eTeX_version_string);
+ omega_code: print(Omega_version_string);
+ aleph_code: print(Aleph_version_string);
+ pdftex_revision_code: print(pdftex_revision);
+ luatex_revision_code: print(luatex_revision);
+ luatex_date_code: print_int(luatex_date_info);
+ pdftex_banner_code: print(pdftex_banner);
+ normal_deviate_code: print_int(norm_rand);
+ uniform_deviate_code: print_int(unif_rand(i));
+ format_name_code: print(format_name);
+ job_name_code: print(job_name);
+ font_name_code: begin
+ append_string(font_name(i));
+ if font_size(i)<>font_dsize(i) then
+ begin print(" at "); print_scaled(font_size(i));
+ print("pt");
+ end;
+ end;
+ font_identifier_code: print_font_identifier(i);
+ pdf_page_ref_code: print_int(get_obj(obj_type_page, i, false));
+ pdf_xform_name_code: print_int(obj_info(i));
+ pdf_font_name_code, pdf_font_objnum_code: begin
+ set_ff(i);
+ if c = pdf_font_name_code then
+ print_int(obj_info(pdf_font_num(ff)))
+ else
+ print_int(pdf_font_num(ff));
+ end;
+ pdf_font_size_code: begin
+ print_scaled(font_size(i));
+ print("pt");
+ end;
+
@/@<Cases of `Print the result of command |c|'@>@/
othercases is_known:=false
end;
@@ -11747,70 +11132,45 @@ We consider now the way \TeX\ handles various kinds of \.{\\if} commands.
@d if_primitive_code=21 { `\.{\\ifprimitive}' }
@<Put each...@>=
-primitive("if",if_test,if_char_code);
+primitive_tex("if",if_test,if_char_code,0);
@!@:if_char_}{\.{\\if} primitive@>
-primitive("ifcat",if_test,if_cat_code);
+primitive_tex("ifcat",if_test,if_cat_code,0);
@!@:if_cat_code_}{\.{\\ifcat} primitive@>
-primitive("ifnum",if_test,if_int_code);
+primitive_tex("ifnum",if_test,if_int_code,0);
@!@:if_int_}{\.{\\ifnum} primitive@>
-primitive("ifdim",if_test,if_dim_code);
+primitive_tex("ifdim",if_test,if_dim_code,0);
@!@:if_dim_}{\.{\\ifdim} primitive@>
-primitive("ifodd",if_test,if_odd_code);
+primitive_tex("ifodd",if_test,if_odd_code,0);
@!@:if_odd_}{\.{\\ifodd} primitive@>
-primitive("ifvmode",if_test,if_vmode_code);
+primitive_tex("ifvmode",if_test,if_vmode_code,0);
@!@:if_vmode_}{\.{\\ifvmode} primitive@>
-primitive("ifhmode",if_test,if_hmode_code);
+primitive_tex("ifhmode",if_test,if_hmode_code,0);
@!@:if_hmode_}{\.{\\ifhmode} primitive@>
-primitive("ifmmode",if_test,if_mmode_code);
+primitive_tex("ifmmode",if_test,if_mmode_code,0);
@!@:if_mmode_}{\.{\\ifmmode} primitive@>
-primitive("ifinner",if_test,if_inner_code);
+primitive_tex("ifinner",if_test,if_inner_code,0);
@!@:if_inner_}{\.{\\ifinner} primitive@>
-primitive("ifvoid",if_test,if_void_code);
+primitive_tex("ifvoid",if_test,if_void_code,0);
@!@:if_void_}{\.{\\ifvoid} primitive@>
-primitive("ifhbox",if_test,if_hbox_code);
+primitive_tex("ifhbox",if_test,if_hbox_code,0);
@!@:if_hbox_}{\.{\\ifhbox} primitive@>
-primitive("ifvbox",if_test,if_vbox_code);
+primitive_tex("ifvbox",if_test,if_vbox_code,0);
@!@:if_vbox_}{\.{\\ifvbox} primitive@>
-primitive("ifx",if_test,ifx_code);
+primitive_tex("ifx",if_test,ifx_code,0);
@!@:ifx_}{\.{\\ifx} primitive@>
-primitive("ifeof",if_test,if_eof_code);
+primitive_tex("ifeof",if_test,if_eof_code,0);
@!@:if_eof_}{\.{\\ifeof} primitive@>
-primitive("iftrue",if_test,if_true_code);
+primitive_tex("iftrue",if_test,if_true_code,0);
@!@:if_true_}{\.{\\iftrue} primitive@>
-primitive("iffalse",if_test,if_false_code);
+primitive_tex("iffalse",if_test,if_false_code,0);
@!@:if_false_}{\.{\\iffalse} primitive@>
-primitive("ifcase",if_test,if_case_code);
+primitive_tex("ifcase",if_test,if_case_code,0);
@!@:if_case_}{\.{\\ifcase} primitive@>
-primitive("ifprimitive",if_test,if_primitive_code);
+primitive_luatex("ifprimitive",if_test,if_primitive_code,0);
@!@:if_primitive_}{\.{\\ifprimitive} primitive@>
-primitive("ifpdfprimitive",if_test,if_primitive_code);
+primitive_pdftex("ifpdfprimitive",if_test,if_primitive_code,0);
@!@:if_primitive_}{\.{\\ifpdfprimitive} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-if_test: begin if chr_code>=unless_code then print_esc("unless");
-case chr_code mod unless_code of
- if_cat_code:print_esc("ifcat");
- if_int_code:print_esc("ifnum");
- if_dim_code:print_esc("ifdim");
- if_odd_code:print_esc("ifodd");
- if_vmode_code:print_esc("ifvmode");
- if_hmode_code:print_esc("ifhmode");
- if_mmode_code:print_esc("ifmmode");
- if_inner_code:print_esc("ifinner");
- if_void_code:print_esc("ifvoid");
- if_hbox_code:print_esc("ifhbox");
- if_vbox_code:print_esc("ifvbox");
- ifx_code:print_esc("ifx");
- if_eof_code:print_esc("ifeof");
- if_true_code:print_esc("iftrue");
- if_false_code:print_esc("iffalse");
- if_case_code:print_esc("ifcase");
- if_primitive_code:print_esc("ifprimitive");
- @/@<Cases of |if_test| for |print_cmd_chr|@>@/
- othercases print_esc("if")
- endcases;
-end;
-
@ Conditions can be inside conditions, and this nesting has a stack
that is independent of the |save_stack|.
@@ -11827,8 +11187,6 @@ Otherwise |cond_ptr| points to a two-word node; the |type|, |subtype|, and
|cond_ptr| at the next level, and the second word contains the
corresponding |if_line|.
-@d if_node==49
-@d if_node_size=2 {number of words in stack entry for conditionals}
@d if_limit_subtype(#)==subtype(#+1)
@d if_limit_type(#)==type(#+1)
@d if_line_field(#)==vlink(#+1)
@@ -11847,19 +11205,14 @@ corresponding |if_line|.
cond_ptr:=null; if_limit:=normal; cur_if:=0; if_line:=0;
@ @<Put each...@>=
-primitive("fi",fi_or_else,fi_code);
+primitive_tex("fi",fi_or_else,fi_code,0);
@!@:fi_}{\.{\\fi} primitive@>
text(frozen_fi):="fi"; eqtb[frozen_fi]:=eqtb[cur_val];
-primitive("or",fi_or_else,or_code);
+primitive_tex("or",fi_or_else,or_code,0);
@!@:or_}{\.{\\or} primitive@>
-primitive("else",fi_or_else,else_code);
+primitive_tex("else",fi_or_else,else_code,0);
@!@:else_}{\.{\\else} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-fi_or_else: if chr_code=fi_code then print_esc("fi")
- else if chr_code=or_code then print_esc("or")
- else print_esc("else");
-
@ When we skip conditional text, we keep track of the line number
where skipping began, for use in error messages.
@@ -12057,17 +11410,13 @@ else b:=(type(p)=vlist_node);
end
@ An active character will be treated as category 13 following
-\.{\\if\\noexpand} or following \.{\\ifcat\\noexpand}. We use the fact that
-active characters have the smallest tokens, among all control sequences.
-
-The |(biggest_char-number_active_chars)| part is needed because only the
-bottom two planes are present as active characters in |eqtb|.
+\.{\\if\\noexpand} or following \.{\\ifcat\\noexpand}.
@d get_x_token_or_active_char==@t@>@;
begin get_x_token;
- if cur_cmd=relax then if cur_chr=no_expand_flag then
+ if cur_cmd=relax then if cur_chr=no_expand_flag then if is_active_csname(cur_cs) then
begin cur_cmd:=active_char;
- cur_chr:=cur_tok-cs_token_flag-active_base+(biggest_char-number_active_chars);
+ cur_chr:=active_csname_value(cur_tok-cs_token_flag);
end;
end
@@ -12199,31 +11548,7 @@ System-dependent changes to allow such things should probably
be made with reluctance, and only when an entire file name that
includes spaces is ``quoted'' somehow.
-@ In order to isolate the system-dependent aspects of file names, the
-@^system dependencies@>
-system-independent parts of \TeX\ are expressed in terms
-of three system-dependent
-procedures called |begin_name|, |more_name|, and |end_name|. In
-essence, if the user-specified characters of the file name are $c_1\ldots c_n$,
-the system-independent driver program does the operations
-$$|begin_name|;\,|more_name|(c_1);\,\ldots\,;|more_name|(c_n);
-\,|end_name|.$$
-These three procedures communicate with each other via global variables.
-Afterwards the file name will appear in the string pool as three strings
-called |cur_name|\penalty10000\hskip-.05em,
-|cur_area|, and |cur_ext|; the latter two are null (i.e.,
-|""|), unless they were explicitly specified by the user.
-
-Actually the situation is slightly more complicated, because \TeX\ needs
-to know when the file name ends. The |more_name| routine is a function
-(with side effects) that returns |true| on the calls |more_name|$(c_1)$,
-\dots, |more_name|$(c_{n-1})$. The final call |more_name|$(c_n)$
-returns |false|; or, it returns |true| and the token following $c_n$ is
-something like `\.{\\hbox}' (i.e., not a character). In other words,
-|more_name| is supposed to return |true| unless it is sure that the
-file name has been completely scanned; and |end_name| is supposed to be able
-to finish the assembly of |cur_name|, |cur_area|, and |cur_ext| regardless of
-whether $|more_name|(c_n)$ returned |true| or |false|.
+@ Here are the global values that file names will be scanned into.
@<Glob...@>=
@!cur_name:str_number; {name of file just scanned}
@@ -12261,60 +11586,6 @@ from place to place.
@d OMEGA_ocp_area=="OmegaOCPs:"
@.OmegaOCPs@>
-@ Here now is the first of the system-dependent routines for file name scanning.
-@^system dependencies@>
-
-@p procedure begin_name;
-begin area_delimiter:=0; ext_delimiter:=0;
-end;
-
-@ And here's the second. The string pool might change as the file name is
-being scanned, since a new \.{\\csname} might be entered; therefore we keep
-|area_delimiter| and |ext_delimiter| relative to the beginning of the current
-string, instead of assigning an absolute address like |pool_ptr| to them.
-@^system dependencies@>
-
-@p function more_name(@!c:ASCII_code):boolean;
-begin if c=" " then more_name:=false
-else begin str_room(1); append_char(c); {contribute |c| to the current string}
- if (c=">")or(c=":") then
- begin area_delimiter:=cur_length; ext_delimiter:=0;
- end
- else if (c=".")and(ext_delimiter=0) then ext_delimiter:=cur_length;
- more_name:=true;
- end;
-end;
-
-@ The third.
-@^system dependencies@>
-
-@p procedure end_name;
-begin if str_ptr+3>(max_strings+string_offset) then
- overflow("number of strings",max_strings-init_str_ptr);
-@:TeX capacity exceeded number of strings}{\quad number of strings@>
-if area_delimiter=0 then cur_area:=""
-else begin cur_area:=str_ptr;
- str_start_macro(str_ptr+1):=str_start_macro(str_ptr)+area_delimiter; incr(str_ptr);
- end;
-if ext_delimiter=0 then
- begin cur_ext:=""; cur_name:=make_string;
- end
-else begin cur_name:=str_ptr;
- str_start_macro(str_ptr+1):=str_start_macro(str_ptr)+ext_delimiter-area_delimiter-1;
- incr(str_ptr); cur_ext:=make_string;
- end;
-end;
-
-@ Conversely, here is a routine that takes three strings and prints a file
-name that might have produced them. (The routine is system dependent, because
-some operating systems put the file area last instead of first.)
-@^system dependencies@>
-
-@<Basic printing...@>=
-procedure print_file_name(@!n,@!a,@!e:integer);
-begin slow_print(a); slow_print(n); slow_print(e);
-end;
-
@ Another system-dependent routine is needed to convert three internal
\TeX\ strings
into the |nameoffile| value that is used to open files. The present code
@@ -12346,7 +11617,7 @@ and extensions related to format files.
@d format_default_length=20 {length of the |TEX_format_default| string}
@d format_area_length=11 {length of its area part}
@d format_ext_length=4 {length of its `\.{.fmt}' part}
-@d format_extension=".fmt" {the extension, as a \.{WEB} constant}
+@d format_extension=='.fmt' {the extension, as a \.{WEB} constant}
@<Glob...@>=
@!TEX_format_default:packed array[1..format_default_length] of char;
@@ -12437,33 +11708,6 @@ we dare not use `|str_room|'.
@d b_make_name_string(#)==make_name_string
@d w_make_name_string(#)==make_name_string
-@p function make_name_string:str_number;
-var k:1..file_name_size; {index into |nameoffile|}
-begin if (pool_ptr+namelength>pool_size)or(str_ptr=max_strings)or
- (cur_length>0) then
- make_name_string:="?"
-else begin for k:=1 to namelength do append_char(nameoffile[k]);
- make_name_string:=make_string;
- end;
-end;
-
-@ Now let's consider the ``driver''
-routines by which \TeX\ deals with file names
-in a system-independent manner. First comes a procedure that looks for a
-file name in the input by calling |get_x_token| for the information.
-
-@p procedure scan_file_name;
-label done;
-begin name_in_progress:=true; begin_name;
-@<Get the next non-blank non-call...@>;
-loop@+begin if (cur_cmd>other_char)or(cur_chr>biggest_char) then {not a character}
- begin back_input; goto done;
- end;
- if not more_name(cur_chr) then goto done;
- get_x_token;
- end;
-done: end_name; name_in_progress:=false;
-end;
@ The global variable |name_in_progress| is used to prevent recursive
use of |scan_file_name|, since the |begin_name| and other procedures
@@ -12486,67 +11730,20 @@ and `\.{.fmt}' in the names of \TeX's output files.
We have |job_name=0| if and only if the `\.{log}' file has not been opened,
except of course for a short time just after |job_name| has become nonzero.
-@<Initialize the output...@>=
-job_name:=0; name_in_progress:=false; log_opened:=false;
-
-@ Here is a routine that manufactures the output file names, assuming that
-|job_name<>0|. It ignores and changes the current settings of |cur_area|
-and |cur_ext|.
-
@d pack_cur_name==pack_file_name(cur_name,cur_area,cur_ext)
-@p procedure pack_job_name(@!s:str_number); {|s = ".log"|, |".dvi"|, or
- |format_extension|}
-begin cur_area:=""; cur_ext:=s;
-cur_name:=job_name; pack_cur_name;
-end;
-
-@ If some trouble arises when \TeX\ tries to open a file, the following
-routine calls upon the user to supply another file name. Parameter~|s|
-is used in the error message to identify the type of file; parameter~|e|
-is the default extension if none is given. Upon exit from the routine,
-variables |cur_name|, |cur_area|, |cur_ext|, and |nameoffile| are
-ready for another attempt at file opening.
-
-@p procedure prompt_file_name(@!s,@!e:str_number);
-label done;
-var k:0..buf_size; {index into |buffer|}
-begin if interaction=scroll_mode then wake_up_terminal;
-if s="input file name" then print_err("I can't find file `")
-@.I can't find file x@>
-else print_err("I can't write on file `");
-@.I can't write on file x@>
-print_file_name(cur_name,cur_area,cur_ext); print("'.");
-if e=".tex" then show_context;
-print_nl("Please type another "); print(s);
-@.Please type...@>
-if interaction<scroll_mode then
- fatal_error("*** (job aborted, file error in nonstop mode)");
-@.job aborted, file error...@>
-clear_terminal; prompt_input(": "); @<Scan file name in the buffer@>;
-if cur_ext="" then cur_ext:=e;
-pack_cur_name;
-end;
-
-@ @<Scan file name in the buffer@>=
-begin begin_name; k:=first;
-while (buffer[k]=" ")and(k<last) do incr(k);
-loop@+ begin if k=last then goto done;
- if not more_name(buffer[k]) then goto done;
- incr(k);
- end;
-done:end_name;
-end
+@<Initialize the output...@>=
+job_name:=0; name_in_progress:=false; log_opened:=false;
@ Here's an example of how these conventions are used. Whenever it is time to
ship out a box of stuff, we shall use the macro |ensure_dvi_open|.
@d ensure_dvi_open==if output_file_name=0 then
begin if job_name=0 then open_log_file;
- pack_job_name(".dvi");
+ pack_job_name('.dvi');
while not lua_b_open_out(dvi_file) do
- prompt_file_name("file name for output",".dvi");
- dvi_file:=name_file_pointer ;
+ prompt_file_name('file name for output','.dvi');
+ dvi_file:=name_file_pointer ;
output_file_name:=b_make_name_string(dvi_file);
end
@@ -12568,7 +11765,7 @@ var old_setting:0..max_selector; {previous |selector| setting}
begin old_setting:=selector;
if job_name=0 then job_name:="texput";
@.texput@>
-pack_job_name(".log");
+pack_job_name('.log');
while not lua_a_open_out(addressof(log_file),0) do @<Try to get a different log file name@>;
log_file := name_file_pointer;
log_name:=a_make_name_string(log_file);
@@ -12582,10 +11779,8 @@ if not callback_defined(start_run_callback) then begin
if buffer[l]=end_line_char then decr(l); { TODO: multichar endlinechar}
for k:=1 to l do print(buffer[k]);
print_ln; {now the transcript file contains the first line of input}
- end
-else begin
- flush_loggable_info;
-end;
+ end;
+flush_loggable_info; {should be done always}
selector:=old_setting+2; {|log_only| or |term_and_log|}
end;
@@ -12605,7 +11800,7 @@ this file.
@<Try to get a different log file name@>=
begin selector:=term_only;
-prompt_file_name("transcript file name",".log");
+prompt_file_name('transcript file name','.log');
end
@ @<Print the banner...@>=
@@ -12625,12 +11820,12 @@ when an `\.{\\input}' command is being processed.
label done;
var temp_str:str_number;
begin scan_file_name; {set |cur_name| to desired file name}
-if cur_ext="" then cur_ext:=".tex";
+{|if cur_ext="" then cur_ext:=".tex";|}
pack_cur_name;
loop@+ begin begin_file_reading; {set up |cur_file| and new level of input}
if lua_a_open_in(cur_file,0) then goto done;
end_file_reading; {remove the level that didn't work}
- prompt_file_name("input file name",".tex");
+ prompt_file_name('input file name','.tex');
end;
done:
cur_file := name_file_pointer;
@@ -12651,6 +11846,7 @@ state:=new_line;
if name=str_ptr-1 then {we can conserve string pool space now}
begin flush_string; name:=cur_name;
end;
+@<Prepare new file {\sl Sync\TeX} information@>;
@<Read the first line of the new file@>;
end;
@@ -12696,7 +11892,7 @@ create_null_font;
font_bytes:=0;
@ @<Put each...@>=
-primitive("nullfont",set_font,null_font);
+primitive_tex("nullfont",set_font,null_font,0);
@!@:null_font_}{\.{\\nullfont} primitive@>
text(frozen_null_font):="nullfont"; eqtb[frozen_null_font]:=eqtb[cur_val];
@@ -12712,13 +11908,13 @@ procedure scan_font_ident;
var f:internal_font_number;
@!m:halfword;
begin @<Get the next non-blank non-call...@>;
-if (cur_cmd=def_font) or (cur_cmd=letterspace_font) then f:=cur_font
+if (cur_cmd=def_font) or (cur_cmd=letterspace_font) or (cur_cmd=pdf_copy_font) then f:=cur_font
else if cur_cmd=set_font then begin
f:=cur_chr;
set_font_touched(f,1);
end
else if cur_cmd=def_family then begin
- m:=cur_chr; scan_math_family_int; f:=equiv(m+cur_val);
+ m:=cur_chr; scan_math_family_int; f:=fam_fnt(cur_val,m);
set_font_touched(f,1);
end
else begin print_err("Missing font identifier");
@@ -12799,14 +11995,22 @@ prints a warning message unless the user has suppressed it.
@p procedure char_warning(@!f:internal_font_number;@!c:integer);
var old_setting: integer; {saved value of |tracing_online|}
+ k:0..22; {index to current digit; we assume that $0\L n<16^{22}$}
begin if tracing_lost_chars>0 then
begin old_setting:=tracing_online;
if tracing_lost_chars>1 then tracing_online:=1;
begin begin_diagnostic;
print_nl("Missing character: There is no ");
@.Missing character@>
- print(c); print(" (");
- print_int(c); print(") in font ");
+ print(c); print(" (U+");
+ k:=0;
+ if c<16 then print_char('0');
+ if c<256 then print_char('0');
+ if c<4096 then print_char('0');
+ repeat dig[k]:=c mod 16; c:=c div 16; incr(k);
+ until c=0;
+ print_the_digs(k);
+ print(") in font ");
print_font_name(f);
print_char("!"); end_diagnostic(false);
end;
@@ -12877,7 +12081,7 @@ procedure add_ocp_stack(min_index:integer; min_value:scaled);
var p:ocp_lstack_index;
llstack_no:scaled;
counter:integer;
- m:scaled;
+ m:scaled;
begin
m:=min_value; { TH: whatever this is ..}
p:=ocp_list_lstack(holding[min_index]);
@@ -13014,7 +12218,7 @@ ocp_info(null_ocp)(offset_ocp_info+4) := 36; {|OTP_STOP|}
@ @<Put each...@>=
-primitive("nullocp", set_ocp, null_ocp);
+primitive_omega("nullocp", set_ocp, null_ocp,0);
text(frozen_null_ocp) := "nullocp";
eqtb[frozen_null_ocp] := eqtb[cur_val];
geq_define(ocp_active_number_base, data, 0);
@@ -13317,7 +12521,7 @@ ocp_lstackmem_ptr:=1;
@ $\Omega$ always knows at least one ocp list, namely the null ocp list.
@ @<Put each...@>=
-primitive("nullocplist", set_ocp_list, null_ocp_list);
+primitive_omega("nullocplist", set_ocp_list, null_ocp_list,0);
text(frozen_null_ocp_list) := "nullocplist";
eqtb[frozen_null_ocp_list] := eqtb[cur_val];
@@ -14274,15 +13478,13 @@ dvi_out(font_check_2(f));
dvi_out(font_check_3(f));@/
dvi_four(font_size(f));
dvi_four(font_dsize(f));@/
-dvi_out(strlen(font_area(f)));
+dvi_out(0); { |font_area(f)| is unused }
dvi_out(strlen(font_name(f)));
@<Output the font name whose internal number is |f|@>;
end;
@ @<Output the font name whose internal number is |f|@>=
fa := get_font_name(f); k := 0;
-while fa[k]<>0 do begin dvi_out(fa[k]); incr(k); end;
-fa := get_font_area(f); k := 0;
while fa[k]<>0 do begin dvi_out(fa[k]); incr(k); end
@ Versions of \TeX\ intended for small computers might well choose to omit
@@ -14343,8 +13545,6 @@ byte number of the \.{DVI} command in question (including the appropriate
on the stack; and the |vinfo| field encodes the options for possible change
in the \.{DVI} command.
-@d movement_node=48
-@d movement_node_size=3 {number of words per entry in the down and right stacks}
@d location(#)==vmem(#+1).int {\.{DVI} byte number for a movement command}
@<Glob...@>=
@@ -14359,16 +13559,13 @@ of motion, and |o| is either |down1| or |right1|. We use the fact that
the command codes have convenient arithmetic properties: |y1-down1=w1-right1|
and |z1-down1=x1-right1|.
-@d dvi_set(#)==oval:=#; ocmd:=set1; out_cmd
-@d dvi_put(#)==oval:=#; ocmd:=put1; out_cmd
-@d dvi_set_rule_end(#)==dvi_four(#)
-@d dvi_set_rule(#)==dvi_out(set_rule); dvi_four(#); dvi_set_rule_end
-@d dvi_put_rule_end(#)==dvi_four(#)
-@d dvi_put_rule(#)==dvi_out(put_rule); dvi_four(#); dvi_put_rule_end
-@d dvi_right(#)==dvi_out(right4); dvi_four(#);
-@d dvi_left(#)==dvi_out(right4); dvi_four(-#);
-@d dvi_down(#)==dvi_out(down4); dvi_four(#);
-@d dvi_up(#)==dvi_out(down4); dvi_four(-#);
+@d dvi_set_end(#)==dvi.h := dvi.h + (#); end
+@d dvi_set(#)==begin synch_dvi_with_pos; oval:=#; ocmd:=set1; out_cmd; dvi_set_end
+@d dvi_put(#)==begin synch_dvi_with_pos; oval:=#; ocmd:=put1; out_cmd; end
+@d dvi_set_rule_end(#)==dvi_four(#); dvi.h := dvi.h + (#); end
+@d dvi_set_rule(#)==begin synch_dvi_with_pos; dvi_out(set_rule); dvi_four(#); dvi_set_rule_end
+@d dvi_put_rule_end(#)==dvi_four(#); end
+@d dvi_put_rule(#)==begin synch_dvi_with_pos; dvi_out(put_rule); dvi_four(#); dvi_put_rule_end
@p procedure movement(@!w:scaled;@!o:eight_bits);
label exit,found,not_found,2,1;
@@ -14376,48 +13573,16 @@ var mstate:small_number; {have we seen a |y| or |z|?}
@!p,@!q:pointer; {current and top nodes on the stack}
@!k:integer; {index into |dvi_buf|, modulo |dvi_buf_size|}
begin
-case box_direction(dvi_direction) of
- dir_TL_: begin
- end;
- dir_TR_: begin
- if o=right1 then negate(w);
- end;
- dir_LT_: begin
- if o=right1 then o:=down1
- else o:=right1;
- end;
- dir_LB_: begin
- if o=right1 then begin
- o:=down1; negate(w);
- end
- else o:=right1;
- end;
- dir_BL_: begin
- if o=down1 then negate(w);
- end;
- dir_BR_: begin
- negate(w);
- end;
- dir_RT_: begin
- if o=right1 then o:=down1
- else begin o:=right1; negate(w);
- end;
- end;
- dir_RB_: begin
- if o=right1 then o:=down1 else o:=right1;
- negate(w);
- end;
- end;
if false then begin
-q:=new_node(movement_node,0); {new node for the top of the stack}
-width(q):=w; location(q):=dvi_offset+dvi_ptr;
-if o=down1 then
- begin vlink(q):=down_ptr; down_ptr:=q;
- end
-else begin vlink(q):=right_ptr; right_ptr:=q;
- end;
-@<Look at the other stack entries until deciding what sort of \.{DVI} command
- to generate; |goto found| if node |p| is a ``hit''@>;
+ q:=new_node(movement_node,0); {new node for the top of the stack}
+ width(q):=w; location(q):=dvi_offset+dvi_ptr;
+ if o=down1 then
+ begin vlink(q):=down_ptr; down_ptr:=q;
+ end
+ else begin vlink(q):=right_ptr; right_ptr:=q;
+ end;
+ @<Look at the other stack entries until deciding what sort of \.{DVI} command
+ to generate; |goto found| if node |p| is a ``hit''@>;
end;
@<Generate a |down| or |right| command for |w| and |return|@>;
found: @<Generate a |y0| or |z0| command in order to reuse a previous
@@ -14593,14 +13758,14 @@ distances are computed in terms of glue together with the depth and
height of adjacent boxes, and we want the \.{DVI} file to lump these
three quantities together into a single motion.
-Therefore, \TeX\ maintains two pairs of global variables: |dvi_h| and |dvi_v|
+Therefore, \TeX\ maintains two pairs of global variables: |dvi.h| and |dvi.v|
are the |h| and |v| coordinates corresponding to the commands actually
-output to the \.{DVI} file, while |cur_h| and |cur_v| are the coordinates
+output to the \.{DVI} file, while |cur.h| and |cur.v| are the coordinates
corresponding to the current state of the output routines. Coordinate
-changes will accumulate in |cur_h| and |cur_v| without being reflected
+changes will accumulate in |cur.h| and |cur.v| without being reflected
in the output, until such a change becomes necessary or desirable; we
-can call the |movement| procedure whenever we want to make |dvi_h=cur_h|
-or |dvi_v=cur_v|.
+can call the |movement| procedure whenever we want to make |dvi.h=pos.h|
+or |dvi.v=pos.v|.
The current font reflected in the \.{DVI} output is called |dvi_f|;
there is no need for a `\\{cur\_f}' variable.
@@ -14608,40 +13773,80 @@ there is no need for a `\\{cur\_f}' variable.
The depth of nesting of |hlist_out| and |vlist_out| is called |cur_s|;
this is essentially the depth of |push| commands in the \.{DVI} output.
-@d synch_h==if cur_h<>dvi_h then
- begin movement(cur_h-dvi_h,right1); dvi_h:=cur_h;
+@d synch_h==if pos.h <> dvi.h then begin
+ movement(pos.h - dvi.h, right1);
+ dvi.h := pos.h;
end
-@d synch_v==if cur_v<>dvi_v then
- begin movement(cur_v-dvi_v,down1); dvi_v:=cur_v;
+
+@d synch_v==if pos.v <> dvi.v then begin
+ movement(dvi.v - pos.v, down1);
+ dvi.v := pos.v;
end
-@<Glob...@>=
-@!dvi_h,@!dvi_v:scaled; {a \.{DVI} reader program thinks we are here}
-@!cur_h,@!cur_v:scaled; {\TeX\ thinks we are here}
+@d synch_dvi_with_pos==begin
+ synch_h; synch_v;
+ end
+
+@d synch_pos_with_cur==case box_direction(dvi_direction) of
+ dir_TL_: begin pos.h := box_pos.h + cur.h; pos.v := box_pos.v - cur.v; end;
+ dir_TR_: begin pos.h := box_pos.h - cur.h; pos.v := box_pos.v - cur.v; end;
+ dir_BL_: begin pos.h := box_pos.h + cur.h; pos.v := box_pos.v + cur.v; end;
+ dir_BR_: begin pos.h := box_pos.h - cur.h; pos.v := box_pos.v + cur.v; end;
+ dir_LT_: begin pos.h := box_pos.h + cur.v; pos.v := box_pos.v - cur.h; end;
+ dir_RT_: begin pos.h := box_pos.h - cur.v; pos.v := box_pos.v - cur.h; end;
+ dir_LB_: begin pos.h := box_pos.h + cur.v; pos.v := box_pos.v + cur.h; end;
+ dir_RB_: begin pos.h := box_pos.h - cur.v; pos.v := box_pos.v + cur.h; end;
+ end
+
+@d synch_dvi_with_cur==begin
+ synch_pos_with_cur;
+ synch_dvi_with_pos;
+end
+
+@d set_to_zero(#)==begin #.h := 0; #.v := 0; end
+
+@ @p function synch_p_with_c(cur: scaledpos): scaledpos;
+var pos: scaledpos;
+begin
+ synch_pos_with_cur;
+ synch_p_with_c := pos;
+end;
+
+@ @<Types...@>=
+@!scaledpos = record
+ h, v: scaled;
+ end;
+
+@ @<Glob...@>=
+@!cur: scaledpos; {\TeX\ position relative to origin of the surrounding box, in box coordinate system}
+@!box_pos: scaledpos; {position of box origin in page coordinates}
+@!pos: scaledpos; {global position on page, in $\rm sp$, from lower left page corner}
+@!dvi: scaledpos; {a \.{DVI} position in page coordinates, in sync with DVI file}
@!dvi_f:internal_font_number; {the current font}
@!cur_s:integer; {current depth of output box nesting, initially $-1$}
@ @<Calculate DVI page dimensions and margins@>=
if page_width > 0 then
- cur_page_width := page_width
+ cur_page_size.h := page_width
else
- cur_page_width := width(p) + 2*(h_offset + one_inch);
+ case box_direction(dvi_direction) of
+ dir_TL_, dir_BL_: cur_page_size.h := width(p) + 2 * page_left_offset;
+ dir_TR_, dir_BR_: cur_page_size.h := width(p) + 2 * page_right_offset;
+ dir_LT_, dir_LB_: cur_page_size.h := height(p) + depth(p) + 2 * page_left_offset;
+ dir_RT_, dir_RB_: cur_page_size.h := height(p) + depth(p) + 2 * page_right_offset;
+ end;
if page_height > 0 then
- cur_page_height := page_height
-else
- cur_page_height := height(p) + depth(p) + 2*(v_offset + one_inch);
-if page_bottom_offset <> 0 then
- cur_bottom_offset := page_bottom_offset
-else
- cur_bottom_offset := 2*one_inch;
-if page_right_offset <> 0 then
- cur_right_offset := page_right_offset
+ cur_page_size.v := page_height
else
- cur_right_offset := 2*one_inch
-
+ case box_direction(dvi_direction) of
+ dir_TL_, dir_TR_: cur_page_size.v := height(p) + depth(p) + 2 * page_top_offset;
+ dir_BL_, dir_BR_: cur_page_size.v := height(p) + depth(p) + 2 * page_bottom_offset;
+ dir_LT_, dir_RT_: cur_page_size.v := width(p) + 2 * page_top_offset;
+ dir_LB_, dir_RB_: cur_page_size.v := width(p) + 2 * page_bottom_offset;
+ end
@ @<Initialize variables as |ship_out| begins@>=
-dvi_h:=0; dvi_v:=0; cur_h:=0; cur_v:=0; dvi_f:=null_font;
+set_to_zero(dvi); set_to_zero(cur); dvi_f:=null_font;
@<Calculate DVI page dimensions and margins@>;
ensure_dvi_open;
if total_pages=0 then
@@ -14649,6 +13854,10 @@ if total_pages=0 then
@^preamble of \.{DVI} file@>
dvi_four(25400000); dvi_four(473628672); {conversion ratio for sp}
prepare_mag; dvi_four(mag); {magnification factor is frozen}
+ if mag<>1000 then
+ one_true_inch:=xn_over_d(one_hundred_inch,10,mag)
+ else
+ one_true_inch:=one_inch;
old_setting:=selector; selector:=new_string;
print(" LuaTeX output "); print_int(year); print_char(".");
print_two(month); print_char("."); print_two(day);
@@ -14661,20 +13870,20 @@ if total_pages=0 then
@ When |hlist_out| is called, its duty is to output the box represented
by the |hlist_node| pointed to by |temp_ptr|. The reference point of that
-box has coordinates |(cur_h,cur_v)|.
+box has coordinates |(cur.h,cur.v)|.
Similarly, when |vlist_out| is called, its duty is to output the box represented
by the |vlist_node| pointed to by |temp_ptr|. The reference point of that
-box has coordinates |(cur_h,cur_v)|.
+box has coordinates |(cur.h,cur.v)|.
@^recursion@>
@p procedure@?vlist_out; forward; {|hlist_out| and |vlist_out| are mutually
recursive}
-@ The recursive procedures |hlist_out| and |vlist_out| each have local variables
-|save_h| and |save_v| to hold the values of |dvi_h| and |dvi_v| just before
-entering a new level of recursion. In effect, the values of |save_h| and
-|save_v| on \TeX's run-time stack correspond to the values of |h| and |v|
+@ The recursive procedures |hlist_out| and |vlist_out| each have a local variable
+|save_dvi| to hold the value of |dvi| just before
+entering a new level of recursion. In effect, the value of |save_dvi|
+on \TeX's run-time stack corresponds to the values of |h| and |v|
that a \.{DVI}-reading program will push onto its coordinate stack.
@d move_past=13 {go to this label when advancing past glue or a rule}
@@ -14687,18 +13896,19 @@ label move_past, fin_rule, next_p;
var base_line: scaled; {the baseline coordinate for this box}
c_wd,c_ht,c_dp: scaled;
{the real width, height and depth of the character}
+w: scaled; { temporary value for directional width calculation }
+dir_nest: integer; { for tracking nested direction nodes }
edge_v: scaled;
edge_h: scaled;
effective_horizontal: scaled;
basepoint_horizontal: scaled;
basepoint_vertical: scaled;
-saving_h: scaled;
-saving_v: scaled;
save_direction: integer;
dir_ptr,dir_tmp:pointer;
-dvi_dir_h,dvi_dir_ptr,dvi_temp_ptr:integer;
@!left_edge: scaled; {the left coordinate for this box}
-@!save_h,@!save_v: scaled; {what |dvi_h| and |dvi_v| should pop to}
+@!save_h: scaled; {what |cur.h| should pop to}
+@!save_dvi: scaledpos; {what |dvi| should pop to}
+@!save_box_pos: scaledpos; {what |box_pos| should pop to}
@!this_box: pointer; {pointer to containing box}
@!g_order: glue_ord; {applicable order of infinity for glue}
@!g_sign: normal..shrinking; {selects type of glue}
@@ -14711,22 +13921,24 @@ dvi_dir_h,dvi_dir_ptr,dvi_temp_ptr:integer;
@!edge:scaled; {right edge of sub-box or leader space}
@!glue_temp:real; {glue value before rounding}
@!cur_glue:real; {glue seen so far}
+@!save_cur_glue:real; { saved version, for direction switch }
@!cur_g:scaled; {rounded equivalent of |cur_glue| times the glue ratio}
+@!save_cur_g:scaled; { saved version, for direction switch }
begin cur_g:=0; cur_glue:=float_constant(0);
this_box:=temp_ptr; g_order:=glue_order(this_box);
g_sign:=glue_sign(this_box); p:=list_ptr(this_box);
+set_to_zero(cur); box_pos:=pos;
save_direction:=dvi_direction;
dvi_direction:=box_dir(this_box);
@<DIR: Initialize |dir_ptr| for |ship_out|@>;
-saving_h:=dvi_h; saving_v:=dvi_v;
incr(cur_s);
if cur_s>0 then dvi_out(push);
if cur_s>max_push then max_push:=cur_s;
-save_loc:=dvi_offset+dvi_ptr; base_line:=cur_v; left_edge:=cur_h;
+save_loc:=dvi_offset+dvi_ptr; base_line:=cur.v; left_edge:=cur.h;
+@<Start hlist {\sl Sync\TeX} information record@>;
while p<>null do @<Output node |p| for |hlist_out| and move to the next node,
- maintaining the condition |cur_v=base_line|@>;
-cur_h:=saving_h; cur_v:=saving_v;
-synch_h; synch_v;
+ maintaining the condition |cur.v=base_line|@>;
+@<Finish hlist {\sl Sync\TeX} information record@>;
prune_movements(save_loc);
if cur_s>0 then dvi_pop(save_loc);
decr(cur_s);
@@ -14758,128 +13970,130 @@ reaching a non-|char_node|. The program uses the fact that |set_char_0=0|.
@<Output node |p| for |hlist_out|...@>=
if is_char_node(p) then
- begin synch_h; synch_v;
- repeat f:=font(p); c:=character(p);
+ begin
+ repeat
+ if x_displace(p)<>0 then cur.h := cur.h + x_displace(p);
+ if y_displace(p)<>0 then cur.v := cur.v - y_displace(p);
+ synch_pos_with_cur; f:=font(p); c:=character(p);
ci := char_info_short(f,c);
if f<>dvi_f then @<Change font |dvi_f| to |f|@>;
- if is_rotated(dvi_direction) then begin
- c_ht:=charinfo_width(ci) div 2;
- c_wd:=charinfo_height(ci)+charinfo_depth(ci);
- c_dp:=0;
- end
- else begin
- c_ht:=charinfo_height(ci);
- c_dp:=charinfo_depth(ci);
- c_wd:=charinfo_width(ci);
- end;
- cur_h:=cur_h+c_wd;
+ c_ht:=charinfo_height(ci);
+ c_dp:=charinfo_depth(ci);
+ c_wd:=charinfo_width(ci);
if (font_natural_dir(f)<>-1) then begin
case font_direction(dvi_direction) of
dir__LT,dir__LB: begin
- dvi_set(c);
+ dvi_set(c)(c_wd);
end;
dir__RT,dir__RB: begin
dvi_put(c);
- dvi_left(c_wd);
end;
- dir__TL,dir__TR: begin
+ dir__TL,dir__TR,dir__BL,dir__BR: begin
+ c_wd := c_ht + c_dp;
dvi_put(c);
- dvi_down(c_wd);
end;
- dir__BL,dir__BR: begin
+ dir__LL: begin
+ pos_right(c_wd);
dvi_put(c);
- dvi_up(c_wd);
end;
- dir__LL,dir__LR: begin
+ dir__RR: begin
+ pos_left(c_wd);
dvi_put(c);
- dvi_right(c_wd);
end;
- dir__RL,dir__RR: begin
+ dir__LR: begin
+ dvi_set(c)(c_wd);
+ end;
+ dir__RL: begin
dvi_put(c);
- dvi_left(c_wd);
end;
- dir__TT,dir__TB: begin
+ dir__TT: begin
+ c_wd := c_ht + c_dp;
+ pos_down(c_wd);
dvi_put(c);
- dvi_down(c_wd);
end;
- dir__BT,dir__BB: begin
+ dir__TB: begin
+ c_wd := c_ht + c_dp;
dvi_put(c);
- dvi_up(c_wd);
end;
- end;
+ dir__BT: begin
+ c_wd := c_ht + c_dp;
+ dvi_put(c);
+ end;
+ dir__BB: begin
+ c_wd := c_ht + c_dp;
+ pos_up(c_wd);
+ dvi_put(c);
+ end;
+ endcases;
end else begin
case font_direction(dvi_direction) of
dir__LT: begin
- dvi_set(c);
+ dvi_set(c)(c_wd);
end;
dir__LB: begin
- dvi_down(c_ht);
- dvi_set(c);
- dvi_up(c_ht);
+ pos_down(c_ht);
+ dvi_set(c)(c_wd);
end;
dir__RT: begin
- dvi_left(c_wd);
+ pos_left(c_wd);
dvi_put(c);
end;
dir__RB: begin
- dvi_left(c_wd);
- dvi_down(c_ht);
+ pos_down(c_ht);
+ pos_left(c_wd);
dvi_put(c);
- dvi_up(c_ht);
end;
dir__TL: begin
- dvi_down(c_wd);
- dvi_left(c_ht);
+ pos_down(c_ht);
+ pos_left(c_wd);
dvi_put(c);
- dvi_right(c_ht);
+ c_wd := c_ht + c_dp;
end;
dir__TR: begin
- dvi_down(c_wd);
- dvi_left(c_dp);
+ pos_down(c_ht);
dvi_put(c);
- dvi_right(c_dp);
+ c_wd := c_ht + c_dp;
end;
dir__BL: begin
- dvi_left(c_ht);
+ pos_left(c_wd);
+ pos_up(c_dp);
dvi_put(c);
- dvi_right(c_ht);
- dvi_up(c_wd);
+ c_wd := c_ht + c_dp;
end;
dir__BR: begin
- dvi_left(c_dp);
+ pos_up(c_dp);
dvi_put(c);
- dvi_right(c_dp);
- dvi_up(c_wd);
+ c_wd := c_ht + c_dp;
end;
dir__LL,dir__LR: begin
- dvi_down(c_ht);
- dvi_put(c);
- dvi_up(c_ht);
- dvi_right(c_wd);
+ pos_down((c_ht - c_dp) div 2);
+ dvi_set(c)(c_wd);
end;
dir__RL,dir__RR: begin
- dvi_left(c_wd);
- dvi_down(c_ht);
+ pos_left(c_wd);
+ pos_down((c_ht - c_dp) div 2);
dvi_put(c);
- dvi_up(c_ht);
end;
dir__TT,dir__TB: begin
- dvi_down(c_wd);
- dvi_left(c_ht);
+ pos_down(c_ht);
+ pos_left(c_wd div 2);
dvi_put(c);
- dvi_right(c_ht);
+ c_wd:=c_ht + c_dp;
end;
dir__BT,dir__BB: begin
- dvi_left(c_ht);
+ pos_up(c_dp);
+ pos_left(c_wd div 2);
dvi_put(c);
- dvi_right(c_ht);
- dvi_up(c_wd);
+ c_wd := c_ht + c_dp;
end;
- end;
+ endcases;
end;
+ if x_displace(p)<>0 then cur.h := cur.h - x_displace(p);
+ if y_displace(p)<>0 then cur.v := cur.v + y_displace(p);
+ cur.h:=cur.h+c_wd;
p:=vlink(p);
until not is_char_node(p);
- dvi_h:=cur_h;
+ @<Record current point {\sl Sync\TeX} information@>;
end
else @<Output the non-|char_node| |p| for |hlist_out|
and move to the next node@>
@@ -14894,8 +14108,8 @@ end
@ @<Output the non-|char_node| |p| for |hlist_out|...@>=
begin case type(p) of
-hlist_node,vlist_node:@<Output a box in an hlist@>;
-rule_node: begin
+hlist_node_case,vlist_node_case:@<Output a box in an hlist@>;
+rule_node_case: begin
if not (dir_orthogonal(dir_primary[rule_dir(p)])(dir_primary[dvi_direction]))
then begin
rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p);
@@ -14907,21 +14121,31 @@ rule_node: begin
end;
goto fin_rule;
end;
-whatsit_node: @<Output the whatsit node |p| in an hlist@>;
-glue_node: @<Move right or output leaders@>;
-disc_node: if vlink(no_break(p))<>null then begin
+whatsit_node_case: @<Output the whatsit node |p| in an hlist@>;
+glue_node_case: @<Move right or output leaders@>;
+disc_node_case: if vlink(no_break(p))<>null then begin
vlink(tlink(no_break(p))):=vlink(p);
q:=vlink(no_break(p));
vlink(no_break(p)):=null;
vlink(p):=q;
end;
-margin_kern_node,kern_node:cur_h:=cur_h+width(p);
-math_node:cur_h:=cur_h+surround(p);
+margin_kern_node_case:cur.h:=cur.h+width(p);
+kern_node_case: begin
+ @<Record |kern_node| {\sl Sync\TeX} information@>;
+ cur.h:=cur.h+width(p);
+end;
+math_node_case: begin
+ @<Record |math_node| {\sl Sync\TeX} information@>;
+ cur.h:=cur.h+surround(p);
+end;
othercases do_nothing
endcases;@/
goto next_p;
fin_rule: @<Output a rule in an hlist@>;
-move_past: cur_h:=cur_h+rule_wd;
+move_past: begin
+ cur.h:=cur.h+rule_wd;
+ @<Record horizontal |rule_node| or |glue_node| {\sl Sync\TeX} information@>;
+end;
next_p:p:=vlink(p);
end
@@ -14938,7 +14162,7 @@ if not (dir_orthogonal(dir_primary[box_dir(p)])(dir_primary[dvi_direction]))
end
else begin
effective_horizontal:=height(p)+depth(p);
- if not (is_mirrored(box_dir(p))) then
+ if not is_mirrored(box_dir(p)) then
if dir_eq(dir_primary[box_dir(p)])(dir_secondary[dvi_direction]) then
basepoint_horizontal:=height(p)
else
@@ -14953,20 +14177,25 @@ else begin
else
basepoint_vertical:= (width(p) div 2);
end;
-if not (is_mirrored(dvi_direction)) then
+if not is_mirrored(dvi_direction) then
basepoint_vertical := basepoint_vertical + shift_amount(p)
{shift the box `down'}
else
basepoint_vertical := basepoint_vertical - shift_amount(p);
{shift the box `up'}
-if list_ptr(p)=null then cur_h:=cur_h + effective_horizontal
+if list_ptr(p)=null then begin
+ @<Record void list {\sl Sync\TeX} information@>;
+ cur.h:=cur.h + effective_horizontal;
+ end
else begin
- temp_ptr:=p; edge:=cur_h; cur_h:=cur_h + basepoint_horizontal;
- edge_v:=cur_v; cur_v:=base_line + basepoint_vertical;
- synch_h; synch_v; save_h:=dvi_h; save_v:=dvi_v;
+ temp_ptr:=p; edge:=cur.h; cur.h:=cur.h + basepoint_horizontal;
+ edge_v:=cur.v; cur.v:=base_line + basepoint_vertical;
+ synch_dvi_with_cur; save_dvi:=dvi;
+ save_box_pos:=box_pos;
if type(p)=vlist_node then vlist_out@+else hlist_out;
- dvi_h:=save_h; dvi_v:=save_v;
- cur_h:=edge+effective_horizontal; cur_v:=base_line;
+ dvi:=save_dvi;
+ box_pos:=save_box_pos;
+ cur.h:=edge+effective_horizontal; cur.v:=base_line;
end
end
@@ -14975,46 +14204,42 @@ if is_running(rule_ht) then rule_ht:=height(this_box);
if is_running(rule_dp) then rule_dp:=depth(this_box);
rule_ht:=rule_ht+rule_dp; {this is the rule thickness}
if (rule_ht>0)and(rule_wd>0) then {we don't output empty rules}
- begin synch_h; cur_v:=base_line+rule_dp; synch_v;
- case font_direction(dvi_direction) of
- dir__LT: begin
+ begin cur.v:=base_line+rule_dp; synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
dvi_set_rule(rule_ht)(rule_wd);
end;
- dir__LB: begin
- dvi_down(rule_ht);
+ dir_BL_: begin
+ pos_down(rule_ht);
dvi_set_rule(rule_ht)(rule_wd);
- dvi_up(rule_ht);
end;
- dir__RT: begin
- dvi_left(rule_wd);
+ dir_TR_: begin
+ pos_left(rule_wd);
dvi_put_rule(rule_ht)(rule_wd);
end;
- dir__RB: begin
- dvi_left(rule_wd);
- dvi_down(rule_ht);
+ dir_BR_: begin
+ pos_left(rule_wd);
+ pos_down(rule_ht);
dvi_put_rule(rule_ht)(rule_wd);
- dvi_up(rule_ht);
end;
- dir__TL: begin
- dvi_down(rule_wd);
- dvi_left(rule_ht);
+ dir_LT_: begin
+ pos_down(rule_wd);
+ pos_left(rule_ht);
dvi_set_rule(rule_wd)(rule_ht);
end;
- dir__TR: begin
- dvi_down(rule_wd);
+ dir_RT_: begin
+ pos_down(rule_wd);
dvi_put_rule(rule_wd)(rule_ht);
end;
- dir__BL: begin
- dvi_left(rule_ht);
+ dir_LB_: begin
+ pos_left(rule_ht);
dvi_set_rule(rule_wd)(rule_ht);
- dvi_up(rule_wd);
end;
- dir__BR: begin
+ dir_RB_: begin
dvi_put_rule(rule_wd)(rule_ht);
- dvi_up(rule_wd);
end;
end;
- cur_v:=base_line; dvi_h:=dvi_h+rule_wd;
+ cur.v:=base_line;
end
@ @d billion==float_constant(1000000000)
@@ -15061,50 +14286,50 @@ else
leader_wd:=height(leader_box)+depth(leader_box);
if (leader_wd>0)and(rule_wd>0) then
begin rule_wd:=rule_wd+10; {compensate for floating-point rounding}
- edge:=cur_h+rule_wd; lx:=0;
- @<Let |cur_h| be the position of the first box, and set |leader_wd+lx|
+ edge:=cur.h+rule_wd; lx:=0;
+ @<Let |cur.h| be the position of the first box, and set |leader_wd+lx|
to the spacing between corresponding parts of boxes@>;
- while cur_h+leader_wd<=edge do
- @<Output a leader box at |cur_h|,
- then advance |cur_h| by |leader_wd+lx|@>;
- cur_h:=edge-10; goto next_p;
+ while cur.h+leader_wd<=edge do
+ @<Output a leader box at |cur.h|,
+ then advance |cur.h| by |leader_wd+lx|@>;
+ cur.h:=edge-10; goto next_p;
end;
end
@ The calculations related to leaders require a bit of care. First, in the
-case of |a_leaders| (aligned leaders), we want to move |cur_h| to
+case of |a_leaders| (aligned leaders), we want to move |cur.h| to
|left_edge| plus the smallest multiple of |leader_wd| for which the result
-is not less than the current value of |cur_h|; i.e., |cur_h| should become
+is not less than the current value of |cur.h|; i.e., |cur.h| should become
$|left_edge|+|leader_wd|\times\lceil
-(|cur_h|-|left_edge|)/|leader_wd|\rceil$. The program here should work in
+(|cur.h|-|left_edge|)/|leader_wd|\rceil$. The program here should work in
all cases even though some implementations of \PASCAL\ give nonstandard
-results for the |div| operation when |cur_h| is less than |left_edge|.
+results for the |div| operation when |cur.h| is less than |left_edge|.
-In the case of |c_leaders| (centered leaders), we want to increase |cur_h|
+In the case of |c_leaders| (centered leaders), we want to increase |cur.h|
by half of the excess space not occupied by the leaders; and in the
-case of |x_leaders| (expanded leaders) we increase |cur_h|
+case of |x_leaders| (expanded leaders) we increase |cur.h|
by $1/(q+1)$ of this excess space, where $q$ is the number of times the
leader box will be replicated. Slight inaccuracies in the division might
accumulate; half of this rounding error is placed at each end of the leaders.
-@<Let |cur_h| be the position of the first box, ...@>=
+@<Let |cur.h| be the position of the first box, ...@>=
if subtype(p)=a_leaders then
- begin save_h:=cur_h;
- cur_h:=left_edge+leader_wd*((cur_h-left_edge)@!div leader_wd);
- if cur_h<save_h then cur_h:=cur_h+leader_wd;
+ begin save_h:=cur.h;
+ cur.h:=left_edge+leader_wd*((cur.h-left_edge)@!div leader_wd);
+ if cur.h<save_h then cur.h:=cur.h+leader_wd;
end
else begin lq:=rule_wd div leader_wd; {the number of box copies}
lr:=rule_wd mod leader_wd; {the remaining space}
- if subtype(p)=c_leaders then cur_h:=cur_h+(lr div 2)
+ if subtype(p)=c_leaders then cur.h:=cur.h+(lr div 2)
else begin lx:=lr div (lq+1);
- cur_h:=cur_h+((lr-(lq-1)*lx) div 2);
+ cur.h:=cur.h+((lr-(lq-1)*lx) div 2);
end;
end
@ The `\\{synch}' operations here are intended to decrease the number of
bytes needed to specify horizontal and vertical motion in the \.{DVI} output.
-@<Output a leader box at |cur_h|, ...@>=
+@<Output a leader box at |cur.h|, ...@>=
begin
if not (dir_orthogonal(dir_primary[box_dir(leader_box)])(dir_primary[dvi_direction]))
then begin
@@ -15115,7 +14340,7 @@ if not (dir_orthogonal(dir_primary[box_dir(leader_box)])(dir_primary[dvi_directi
basepoint_horizontal:=0;
end
else begin
- if not (is_mirrored(box_dir(leader_box))) then
+ if not is_mirrored(box_dir(leader_box)) then
if dir_eq(dir_primary[box_dir(leader_box)])(dir_secondary[dvi_direction]) then
basepoint_horizontal:=height(leader_box)
else
@@ -15130,21 +14355,23 @@ else begin
else
basepoint_vertical:= (width(leader_box) div 2);
end;
-if not (is_mirrored(dvi_direction)) then
+if not is_mirrored(dvi_direction) then
basepoint_vertical := basepoint_vertical + shift_amount(leader_box)
{shift the box `down'}
else
basepoint_vertical := basepoint_vertical - shift_amount(leader_box);
{shift the box `up'}
temp_ptr:=leader_box;
-edge_h:=cur_h; cur_h:=cur_h + basepoint_horizontal;
-edge_v:=cur_v; cur_v:=base_line + basepoint_vertical;
-synch_h; synch_v; save_h:=dvi_h; save_v:=dvi_v;
+edge_h:=cur.h; cur.h:=cur.h + basepoint_horizontal;
+edge_v:=cur.v; cur.v:=base_line + basepoint_vertical;
+synch_dvi_with_cur; save_dvi:=dvi;
+save_box_pos:=box_pos;
outer_doing_leaders:=doing_leaders; doing_leaders:=true;
if type(leader_box)=vlist_node then vlist_out@+else hlist_out;
doing_leaders:=outer_doing_leaders;
-dvi_h:=save_h; dvi_v:=save_v;
-cur_h:=edge_h+leader_wd+lx; cur_v:=base_line;
+box_pos:=save_box_pos;
+dvi:=save_dvi;
+cur.h:=edge_h+leader_wd+lx; cur.v:=base_line;
end
@ The |vlist_out| routine is similar to |hlist_out|, but a bit simpler.
@@ -15153,7 +14380,9 @@ end
label move_past, fin_rule, next_p;
var left_edge: scaled; {the left coordinate for this box}
@!top_edge: scaled; {the top coordinate for this box}
-@!save_h,@!save_v: scaled; {what |dvi_h| and |dvi_v| should pop to}
+@!save_v: scaled; {what |cur.v| should pop to}
+@!save_dvi: scaledpos; {what |dvi| should pop to}
+@!save_box_pos: scaledpos; {what |box_pos| should pop to}
@!this_box: pointer; {pointer to containing box}
@!g_order: glue_ord; {applicable order of infinity for glue}
@!g_sign: normal..shrinking; {selects type of glue}
@@ -15172,24 +14401,23 @@ var left_edge: scaled; {the left coordinate for this box}
@!basepoint_horizontal: scaled;
@!basepoint_vertical: scaled;
@!edge_v: scaled;
-@!saving_v: scaled;
-@!saving_h: scaled;
begin cur_g:=0; cur_glue:=float_constant(0);
this_box:=temp_ptr; g_order:=glue_order(this_box);
g_sign:=glue_sign(this_box); p:=list_ptr(this_box);
{pdfassert(p<>0);}
-saving_v:=dvi_v; saving_h:=dvi_h;
+set_to_zero(cur); box_pos:=pos;
save_direction:=dvi_direction;
dvi_direction:=box_dir(this_box);
incr(cur_s);
if cur_s>0 then dvi_out(push);
if cur_s>max_push then max_push:=cur_s;
-save_loc:=dvi_offset+dvi_ptr; left_edge:=cur_h; cur_v:=cur_v-height(this_box);
-top_edge:=cur_v;
+save_loc:=dvi_offset+dvi_ptr; left_edge:=cur.h;
+@<Start vlist {\sl Sync\TeX} information record@>;
+cur.v:=cur.v-height(this_box);
+top_edge:=cur.v;
while p<>null do @<Output node |p| for |vlist_out| and move to the next node,
- maintaining the condition |cur_h=left_edge|@>;
-cur_v:=saving_v; cur_h:=saving_h;
-synch_v; synch_h;
+ maintaining the condition |cur.h=left_edge|@>;
+@<Finish vlist {\sl Sync\TeX} information record@>;
prune_movements(save_loc);
if cur_s>0 then dvi_pop(save_loc);
decr(cur_s);
@@ -15205,8 +14433,8 @@ end
@ @<Output the non-|char_node| |p| for |vlist_out|@>=
begin case type(p) of
-hlist_node,vlist_node:@<Output a box in a vlist@>;
-rule_node: begin
+hlist_node_case,vlist_node_case:@<Output a box in a vlist@>;
+rule_node_case: begin
if not (dir_orthogonal(dir_primary[rule_dir(p)])(dir_primary[dvi_direction]))
then begin
rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p);
@@ -15218,14 +14446,14 @@ rule_node: begin
end;
goto fin_rule;
end;
-whatsit_node: @<Output the whatsit node |p| in a vlist@>;
-glue_node: @<Move down or output leaders@>;
-kern_node:cur_v:=cur_v+width(p);
+whatsit_node_case: @<Output the whatsit node |p| in a vlist@>;
+glue_node_case: @<Move down or output leaders@>;
+kern_node_case:cur.v:=cur.v+width(p);
othercases do_nothing
endcases;@/
goto next_p;
fin_rule: @<Output a rule in a vlist, |goto next_p|@>;
-move_past: cur_v:=cur_v+rule_ht;
+move_past: cur.v:=cur.v+rule_ht;
end
@ The |synch_v| here allows the \.{DVI} output to use one-byte commands
@@ -15237,7 +14465,7 @@ begin
if not (dir_orthogonal(dir_primary[box_dir(p)])(dir_primary[dvi_direction]))
then begin
effective_vertical:=height(p)+depth(p);
- if (type(p)=hlist_node) and (is_mirrored(box_dir(p))) then
+ if (type(p)=hlist_node) and is_mirrored(box_dir(p)) then
basepoint_vertical:=depth(p)
else
basepoint_vertical:=height(p);
@@ -15248,7 +14476,7 @@ if not (dir_orthogonal(dir_primary[box_dir(p)])(dir_primary[dvi_direction]))
end
else begin
effective_vertical:=width(p);
- if not (is_mirrored(box_dir(p))) then
+ if not is_mirrored(box_dir(p)) then
if dir_eq(dir_primary[box_dir(p)])(dir_secondary[dvi_direction]) then
basepoint_horizontal:=height(p)
else
@@ -15266,61 +14494,60 @@ else begin
basepoint_horizontal := basepoint_horizontal + shift_amount(p);
{shift the box `right'}
if list_ptr(p)=null then begin
- cur_v:=cur_v+effective_vertical;
+ cur.v:=cur.v+effective_vertical;
+ @<Record void list {\sl Sync\TeX} information@>;
end
else begin
- synch_h; synch_v; edge_v:=cur_v;
- cur_h:=left_edge + basepoint_horizontal;
- cur_v:=cur_v + basepoint_vertical;
- synch_h; synch_v; save_h:=dvi_h; save_v:=dvi_v;
+ edge_v:=cur.v;
+ cur.h:=left_edge + basepoint_horizontal;
+ cur.v:=cur.v + basepoint_vertical;
+ synch_dvi_with_cur; save_dvi:=dvi;
+ save_box_pos:=box_pos;
temp_ptr:=p;
if type(p)=vlist_node then vlist_out@+else hlist_out;
- dvi_h:=save_h; dvi_v:=save_v;
- cur_h:=left_edge; cur_v:=edge_v + effective_vertical;
+ dvi:=save_dvi;
+ box_pos:=save_box_pos;
+ cur.h:=left_edge; cur.v:=edge_v + effective_vertical;
end
end
@ @<Output a rule in a vlist...@>=
if is_running(rule_wd) then rule_wd:=width(this_box);
rule_ht:=rule_ht+rule_dp; {this is the rule thickness}
-cur_v:=cur_v+rule_ht;
+cur.v:=cur.v+rule_ht;
if (rule_ht>0)and(rule_wd>0) then {we don't output empty rules}
- begin synch_h; synch_v;
- case font_direction(dvi_direction) of
- dir__LT: begin
+ begin synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
dvi_put_rule(rule_ht)(rule_wd);
end;
- dir__LB: begin
- dvi_down(rule_ht);
+ dir_BL_: begin
+ pos_down(rule_ht);
dvi_put_rule(rule_ht)(rule_wd);
- dvi_up(rule_ht);
end;
- dir__RT: begin
- dvi_left(rule_wd);
+ dir_TR_: begin
+ pos_left(rule_wd);
dvi_set_rule(rule_ht)(rule_wd);
end;
- dir__RB: begin
- dvi_down(rule_ht);
- dvi_left(rule_wd);
+ dir_BR_: begin
+ pos_down(rule_ht);
+ pos_left(rule_wd);
dvi_set_rule(rule_ht)(rule_wd);
- dvi_up(rule_ht);
end;
- dir__TL: begin
- dvi_down(rule_wd);
- dvi_left(rule_ht);
+ dir_LT_: begin
+ pos_down(rule_wd);
+ pos_left(rule_ht);
dvi_set_rule(rule_wd)(rule_ht);
- dvi_up(rule_wd);
end;
- dir__TR: begin
- dvi_down(rule_wd);
+ dir_RT_: begin
+ pos_down(rule_wd);
dvi_put_rule(rule_wd)(rule_ht);
- dvi_up(rule_wd);
end;
- dir__BL: begin
- dvi_left(rule_ht);
+ dir_LB_: begin
+ pos_left(rule_ht);
dvi_set_rule(rule_wd)(rule_ht);
end;
- dir__BR: begin
+ dir_RB_: begin
dvi_put_rule(rule_wd)(rule_ht);
end;
end;
@@ -15363,39 +14590,39 @@ else
leader_ht:=width(leader_box);
if (leader_ht>0)and(rule_ht>0) then
begin rule_ht:=rule_ht+10; {compensate for floating-point rounding}
- edge:=cur_v+rule_ht; lx:=0;
- @<Let |cur_v| be the position of the first box, and set |leader_ht+lx|
+ edge:=cur.v+rule_ht; lx:=0;
+ @<Let |cur.v| be the position of the first box, and set |leader_ht+lx|
to the spacing between corresponding parts of boxes@>;
- while cur_v+leader_ht<=edge do
- @<Output a leader box at |cur_v|,
- then advance |cur_v| by |leader_ht+lx|@>;
- cur_v:=edge-10; goto next_p;
+ while cur.v+leader_ht<=edge do
+ @<Output a leader box at |cur.v|,
+ then advance |cur.v| by |leader_ht+lx|@>;
+ cur.v:=edge-10; goto next_p;
end;
end
-@ @<Let |cur_v| be the position of the first box, ...@>=
+@ @<Let |cur.v| be the position of the first box, ...@>=
if subtype(p)=a_leaders then
- begin save_v:=cur_v;
- cur_v:=top_edge+leader_ht*((cur_v-top_edge)@!div leader_ht);
- if cur_v<save_v then cur_v:=cur_v+leader_ht;
+ begin save_v:=cur.v;
+ cur.v:=top_edge+leader_ht*((cur.v-top_edge)@!div leader_ht);
+ if cur.v<save_v then cur.v:=cur.v+leader_ht;
end
else begin lq:=rule_ht div leader_ht; {the number of box copies}
lr:=rule_ht mod leader_ht; {the remaining space}
- if subtype(p)=c_leaders then cur_v:=cur_v+(lr div 2)
+ if subtype(p)=c_leaders then cur.v:=cur.v+(lr div 2)
else begin lx:=lr div (lq+1);
- cur_v:=cur_v+((lr-(lq-1)*lx) div 2);
+ cur.v:=cur.v+((lr-(lq-1)*lx) div 2);
end;
end
-@ When we reach this part of the program, |cur_v| indicates the top of a
+@ When we reach this part of the program, |cur.v| indicates the top of a
leader box, not its baseline.
-@<Output a leader box at |cur_v|, ...@>=
+@<Output a leader box at |cur.v|, ...@>=
begin
if not (dir_orthogonal(dir_primary[box_dir(leader_box)])(dir_primary[dvi_direction]))
then begin
effective_vertical:=height(leader_box)+depth(leader_box);
- if (type(leader_box)=hlist_node) and (is_mirrored(box_dir(leader_box))) then
+ if (type(leader_box)=hlist_node) and is_mirrored(box_dir(leader_box)) then
basepoint_vertical:=depth(leader_box)
else
basepoint_vertical:=height(leader_box);
@@ -15406,7 +14633,7 @@ if not (dir_orthogonal(dir_primary[box_dir(leader_box)])(dir_primary[dvi_directi
end
else begin
effective_vertical:=width(leader_box);
- if not (is_mirrored(box_dir(leader_box))) then
+ if not is_mirrored(box_dir(leader_box)) then
if dir_eq(dir_primary[box_dir(leader_box)])(dir_secondary[dvi_direction]) then
basepoint_horizontal:=height(leader_box)
else
@@ -15424,15 +14651,17 @@ else begin
basepoint_horizontal := basepoint_horizontal + shift_amount(leader_box);
{shift the box `right'}
temp_ptr:=leader_box;
-cur_h:=left_edge + basepoint_horizontal;
-edge_v:=cur_v ;
-cur_v:=cur_v + basepoint_vertical;
-synch_h; synch_v; save_h:=dvi_h; save_v:=dvi_v;
+cur.h:=left_edge + basepoint_horizontal;
+edge_v:=cur.v ;
+cur.v:=cur.v + basepoint_vertical;
+synch_dvi_with_cur; save_dvi:=dvi;
+save_box_pos:=box_pos;
outer_doing_leaders:=doing_leaders; doing_leaders:=true;
if type(leader_box)=vlist_node then vlist_out@+else hlist_out;
doing_leaders:=outer_doing_leaders;
-dvi_h:=save_h; dvi_v:=save_v;
-cur_h:=left_edge; cur_v:=edge_v+leader_ht+lx;
+box_pos:=save_box_pos;
+dvi:=save_dvi;
+cur.h:=left_edge; cur.v:=edge_v+leader_ht+lx;
end
@ The |hlist_out| and |vlist_out| procedures are now complete, so we are
@@ -15447,9 +14676,10 @@ var page_loc:integer; {location of the current |bop|}
pre_callback_id:integer;
post_callback_id:integer;
ret:boolean;
-begin
-pre_callback_id:=callback_defined(start_page_number_callback);
-post_callback_id:=callback_defined(stop_page_number_callback);
+begin
+@<Start sheet {\sl Sync\TeX} information record@>;
+pre_callback_id:=callback_defined(start_page_number_callback);
+post_callback_id:=callback_defined(stop_page_number_callback);
if (tracing_output>0)and(pre_callback_id=0) then
begin print_nl(""); print_ln;
print("Completed box being shipped out");
@@ -15480,6 +14710,7 @@ update_terminal; {progress report}
@<Flush the box from memory, showing statistics if requested@>;
if post_callback_id>0 then
ret:=run_callback(post_callback_id,'->');
+@<Finish sheet {\sl Sync\TeX} information record@>;
end;
@ @<Flush the box from memory, showing statistics if requested@>=
@@ -15506,63 +14737,42 @@ page_loc:=dvi_offset+dvi_ptr;
dvi_out(bop);
for k:=0 to 9 do dvi_four(count(k));
dvi_four(last_bop); last_bop:=page_loc;
+{Think in upright page/paper coordinates): First preset |pos.h| and |pos.v| to the DVI origin.}
+pos.h := one_true_inch;
+pos.v := cur_page_size.v - one_true_inch;
+box_pos := pos; dvi := pos;
+{Then calculate |cur.h| and |cur.v| within the upright coordinate system
+for the DVI origin depending on the |page_direction|.}
dvi_direction:=page_direction;
case box_direction(dvi_direction) of
dir_TL_,dir_LT_: begin
+ cur.h := page_left_offset;
+ cur.v := page_top_offset;
end;
dir_TR_,dir_RT_: begin
- dvi_right(cur_page_width-cur_right_offset);
- dvi_h:=-cur_right_offset;
- end;
-dir_RB_,dir_BR_: begin
- dvi_right(cur_page_width-cur_right_offset);
- dvi_down(cur_page_height-cur_bottom_offset);
- dvi_h:=-cur_right_offset;
- dvi_v:=-cur_bottom_offset;
+ cur.h := cur_page_size.h - page_right_offset;
+ cur.v := page_top_offset;
end;
dir_BL_,dir_LB_: begin
- dvi_down(cur_page_height-cur_bottom_offset);
- dvi_v:=-cur_bottom_offset;
- end;
-end;
-cur_h:=h_offset;
-cur_v:=height(p)+v_offset;
-case box_direction(dvi_direction) of
-dir_TL_: begin
- dvi_down(cur_v);
- dvi_right(cur_h);
- end;
-dir_TR_: begin
- dvi_down(cur_v);
- dvi_right(-cur_h);
+ cur.h := page_left_offset;
+ cur.v := cur_page_size.v - page_bottom_offset;
end;
-dir_LT_: begin
- dvi_right(cur_v);
- dvi_down(cur_h);
- end;
-dir_LB_: begin
- dvi_right(cur_v);
- dvi_down(-cur_h);
- end;
-dir_BL_: begin
- dvi_down(-cur_v);
- dvi_right(cur_h);
- end;
-dir_BR_: begin
- dvi_down(-cur_v);
- dvi_right(-cur_h);
- end;
-dir_RT_: begin
- dvi_right(-cur_v);
- dvi_down(cur_h);
- end;
-dir_RB_: begin
- dvi_right(-cur_v);
- dvi_down(-cur_h);
- end;
-end;
-dvi_h:=cur_h;
-dvi_v:=cur_v;
+dir_RB_,dir_BR_: begin
+ cur.h := cur_page_size.h - page_right_offset;
+ cur.v := cur_page_size.v - page_bottom_offset;
+ end;
+end;
+cur.h := cur.h - one_true_inch; {correct for DVI origin}
+cur.v := cur.v - one_true_inch;
+{The movement is actually done within the upright page coordinate system.}
+dvi_direction := dir_TL_; {only temporarily for this adjustment}
+synch_pos_with_cur; box_pos := pos; {keep track on page}
+{Then switch to page box coordinate system; do |height(p)| movement.}
+dvi_direction := page_direction;
+cur.h := 0;
+cur.v := height(p);
+synch_pos_with_cur;
+{Now we are at the point on the page where the origin of the page box should go.}
temp_ptr:=p;
if type(p)=vlist_node then vlist_out@+else hlist_out;
dvi_out(eop); incr(total_pages); cur_s:=-1;
@@ -15595,7 +14805,8 @@ if width(p)+h_offset>max_h then max_h:=width(p)+h_offset
@ At the end of the program, we must finish things off by writing the
post\-amble. If |total_pages=0|, the \.{DVI} file was never opened.
-If |total_pages>=65536|, the \.{DVI} file will lie.
+If |total_pages>=65536|, the \.{DVI} file will lie. And if
+|max_push>=65536|, the user deserves whatever chaos might ensue.
An integer variable |k| will be declared for use by this routine.
@@ -15684,6 +14895,11 @@ begin
get_nullfont := null_font;
end;
+function get_par_shape_ptr: halfword;
+begin
+ get_par_shape_ptr := par_shape_ptr;
+end;
+
function get_escape_char: integer;
begin
get_escape_char := escape_char;
@@ -15719,6 +14935,7 @@ begin
get_tex_dimen := dimen_par(code);
end;
+
function get_x_height(f: internal_font_number): scaled;
begin
get_x_height := x_height(f);
@@ -15760,7 +14977,7 @@ end;
function new_dummy_font: internal_font_number;
begin
- new_dummy_font := read_font_info(null_cs, "dummy", "", -1000, -1);
+ new_dummy_font := read_font_info(null_cs, "dummy", -1000, -1);
end;
function get_hash_size: integer;
@@ -15778,11 +14995,12 @@ begin
get_hash_base:= hash_base;
end;
-function get_active_base: integer;
+function get_font_id_base: integer;
begin
- get_active_base:= active_base;
+ get_font_id_base:= font_id_base;
end;
+
function get_cur_font: internal_font_number;
begin
get_cur_font:= cur_font;
@@ -15936,7 +15154,7 @@ end
@!pdf_file: byte_file; {the PDF output file}
@!pdf_buf: ^real_eight_bits; {pointer to the PDF output buffer or PDF object stream buffer}
@!pdf_buf_size: integer; {end of PDF output buffer or PDF object stream buffer}
-@!pdf_ptr: integer; {pointer to the first unused byte in the PDF buffer or object stream buffer}
+@!pdf_ptr: longinteger; {pointer to the first unused byte in the PDF buffer or object stream buffer}
@!pdf_op_buf: ^real_eight_bits; {the PDF output buffer}
@!pdf_os_buf: ^real_eight_bits; {the PDF object stream buffer}
@!pdf_os_buf_size: integer; {current size of the PDF object stream buffer, grows dynamically}
@@ -15949,23 +15167,23 @@ end
@!pdf_os_mode: boolean; {true if producing object stream}
@!pdf_os_enable: boolean; {true if object streams are globally enabled}
@!pdf_os_cur_objnum: integer; {number of current object stream object}
-@!pdf_gone: integer; {number of bytes that were flushed to output}
-@!pdf_save_offset: integer; {to save |pdf_offset|}
+@!pdf_gone: longinteger; {number of bytes that were flushed to output}
+@!pdf_save_offset: longinteger; {to save |pdf_offset|}
@!zip_write_state: integer; {which state of compression we are in}
@!fixed_pdf_minor_version: integer; {fixed minor part of the PDF version}
+@!fixed_pdf_minor_version_set: boolean; {flag if the PDF version has been set}
@!fixed_pdf_objcompresslevel: integer; {fixed level for activating PDF object streams}
-@!pdf_minor_version_written: boolean; {flag if the PDF version has been written}
@!fixed_pdfoutput: integer; {fixed output format}
@!fixed_pdfoutput_set: boolean; {|fixed_pdfoutput| has been set?}
@!fixed_gamma: integer;
@!fixed_image_gamma: integer;
@!fixed_image_hicolor: boolean;
@!fixed_image_apply_gamma: integer;
+@!fixed_pdf_draftmode: integer; {fixed \\pdfdraftmode}
+@!pdf_page_group_val: integer;
@!epochseconds: integer;
@!microseconds: integer;
-@!fixed_pdf_draftmode: integer; {fixed \\pdfdraftmode}
-@!fixed_pdf_draftmode_set: boolean; {|fixed_pdf_draftmode| has been set?}
-
+@!page_divert_val: integer;
@ @<Set init...@>=
pdf_gone := 0;
@@ -15980,9 +15198,10 @@ pdf_os_buf_size := inf_pdf_os_buf_size;
pdf_buf := pdf_op_buf;
pdf_seek_write_length := false;
zip_write_state := no_zip;
-pdf_minor_version_written := false;
+fixed_pdf_minor_version_set := false;
fixed_pdfoutput_set := false;
-fixed_pdf_draftmode_set := false;
+pdf_page_group_val := -1;
+page_divert_val := 0;
@ @p
function fix_int(val, min, max: integer): integer;
@@ -15996,55 +15215,95 @@ begin
end;
@ This ensures that |pdfminorversion| is set only before any bytes have
-been written to the generated PDF file. Here also the PDF file is opened
-by |ensure_pdf_open| and the PDF header is written.
+been written to the generated \.{PDF} file. Here also all variables for
+\.{PDF} output are initialized, the \.{PDF} file is opened by |ensure_pdf_open|,
+and the \.{PDF} header is written.
@p procedure check_pdfminorversion;
begin
- if not pdf_minor_version_written then begin
- pdf_minor_version_written := true;
- if (pdf_minor_version < 0) or (pdf_minor_version > 9) then begin
- print_err("pdfTeX error (illegal pdfminorversion)");
- print_ln;
- help2 ("The pdfminorversion must be between 0 and 9.")@/
- ("I changed this to 4.");
- int_error (pdf_minor_version);
- pdf_minor_version := 4;
- end;
- fixed_pdf_minor_version := pdf_minor_version;
- fixed_gamma := fix_int(pdf_gamma, 0, 1000000);
- fixed_image_gamma := fix_int(pdf_image_gamma, 0, 1000000);
- fixed_image_hicolor := fix_int(pdf_image_hicolor, 0, 1);
- fixed_image_apply_gamma := fix_int(pdf_image_apply_gamma, 0, 1);
- fixed_pdf_objcompresslevel := fix_int(pdf_objcompresslevel, 0, 3);
- fixed_pdf_draftmode := fix_int(pdf_draftmode, 0, 1);
- fixed_replace_font := fix_int(pdf_replace_font, 0, 1);
- if (fixed_pdf_minor_version >= 5) and (fixed_pdf_objcompresslevel > 0) then
- pdf_os_enable := true
- else begin
- if fixed_pdf_objcompresslevel > 0 then begin
- pdf_warning("Object streams", "\pdfobjcompresslevel > 0 requires \pdfminorversion > 4. Object streams disabled now.", true, true);
- fixed_pdf_objcompresslevel := 0;
- end;
- pdf_os_enable := false;
- end;
- ensure_pdf_open;
- fix_pdfoutput;
- pdf_print("%PDF-1.");
- pdf_print_int_ln(fixed_pdf_minor_version);
- pdf_print("%");
- pdf_out(208); {'P' + 128}
- pdf_out(212); {'T' + 128}
- pdf_out(197); {'E' + 128}
- pdf_out(216); {'X' + 128}
- pdf_print_nl;
+ fix_pdfoutput;
+ pdfassert(fixed_pdfoutput > 0);
+ if not fixed_pdf_minor_version_set then begin
+ fixed_pdf_minor_version_set := true;
+ @<Initialize variables for \.{PDF} output@>;
+ @<Write \.{PDF} header@>;
end
else begin
- if fixed_pdf_minor_version <> pdf_minor_version then
- pdf_error("setup",
- "\pdfminorversion cannot be changed after data is written to the PDF file");
+ @<Check that variables for \.{PDF} output are unchanged@>;
end;
+ if fixed_pdf_draftmode <> 0 then begin
+ pdf_compress_level := 0; {re-fix it, might have been changed inbetween}
+ fixed_pdf_objcompresslevel := 0;
+ end;
+end;
+
+@ @<Initialize variables for \.{PDF} output@>=
+prepare_mag;
+if (pdf_minor_version < 0) or (pdf_minor_version > 9) then begin
+ print_err("LuaTeX error (illegal pdfminorversion)");
+ print_ln;
+ help2 ("The pdfminorversion must be between 0 and 9.")@/
+ ("I changed this to 4.");
+ int_error (pdf_minor_version);
+ pdf_minor_version := 4;
+end;
+fixed_pdf_minor_version := pdf_minor_version;
+fixed_decimal_digits := fix_int(pdf_decimal_digits, 0, 4);
+fixed_gamma := fix_int(pdf_gamma, 0, 1000000);
+fixed_image_gamma := fix_int(pdf_image_gamma, 0, 1000000);
+fixed_image_hicolor := fix_int(pdf_image_hicolor, 0, 1);
+fixed_image_apply_gamma := fix_int(pdf_image_apply_gamma, 0, 1);
+fixed_pdf_objcompresslevel := fix_int(pdf_objcompresslevel, 0, 3);
+fixed_pdf_draftmode := fix_int(pdf_draftmode, 0, 1);
+fixed_inclusion_copy_font:= fix_int(pdf_inclusion_copy_font, 0, 1);
+fixed_replace_font := fix_int(pdf_replace_font, 0, 1);
+fixed_pk_resolution := fix_int(pdf_pk_resolution, 72, 8000);
+if (fixed_pdf_minor_version >= 5) and (fixed_pdf_objcompresslevel > 0) then
+ pdf_os_enable := true
+else begin
+ if fixed_pdf_objcompresslevel > 0 then begin
+ pdf_warning("Object streams",
+ "\pdfobjcompresslevel > 0 requires \pdfminorversion > 4. Object streams disabled now.", true, true);
+ fixed_pdf_objcompresslevel := 0;
+ end;
+ pdf_os_enable := false;
end;
+if pdf_pk_resolution = 0 then {if not set from format file or by user}
+ pdf_pk_resolution := pk_dpi; {take it from \.{texmf.cnf}}
+pk_scale_factor :=
+ divide_scaled(72, fixed_pk_resolution, 5 + fixed_decimal_digits);
+if not callback_defined(read_pk_file_callback) then begin
+ if pdf_pk_mode <> null then begin
+ kpseinitprog('PDFTEX', fixed_pk_resolution,
+ makecstring(tokens_to_string(pdf_pk_mode)), nil);
+ flush_string;
+ end else
+ kpseinitprog('PDFTEX', fixed_pk_resolution, nil, nil);
+ if not kpsevarvalue('MKTEXPK') then
+ kpsesetprogramenabled (kpsepkformat, 1, kpsesrccmdline);
+ end;
+set_job_id(year, month, day, time);
+if (pdf_unique_resname > 0) and (pdf_resname_prefix = 0) then
+ pdf_resname_prefix := get_resname_prefix
+
+@ @<Check that variables for \.{PDF} output are unchanged@>=
+if fixed_pdf_minor_version <> pdf_minor_version then
+ pdf_error("setup",
+ "\pdfminorversion cannot be changed after data is written to the PDF file");
+if fixed_pdf_draftmode <> pdf_draftmode then
+ pdf_error("setup",
+ "\pdfdraftmode cannot be changed after data is written to the PDF file");
+
+@ @<Write \.{PDF} header@>=
+ensure_pdf_open;
+pdf_print("%PDF-1.");
+pdf_print_int_ln(fixed_pdf_minor_version);
+pdf_print("%");
+pdf_out(208); {'P' + 128}
+pdf_out(212); {'T' + 128}
+pdf_out(197); {'E' + 128}
+pdf_out(216); {'X' + 128}
+pdf_print_nl;
@ Checks that we have a name for the generated PDF file and that it's open.
@@ -16054,10 +15313,10 @@ begin
return;
if job_name = 0 then
open_log_file;
- pack_job_name(".pdf");
- if fixed_pdf_draftmode = 0 then
- while not lua_b_open_out(pdf_file) do
- prompt_file_name("file name for output",".pdf");
+ pack_job_name('.pdf');
+ if fixed_pdf_draftmode = 0 then
+ while not lua_b_open_out(pdf_file) do
+ prompt_file_name('file name for output','.pdf');
pdf_file:=name_file_pointer;
output_file_name := b_make_name_string(pdf_file);
end;
@@ -16068,8 +15327,10 @@ neccesary. We call |pdf_begin_stream| to begin a stream and |pdf_end_stream|
to finish it. The stream contents will be compressed if compression is turn on.
@p procedure pdf_flush; {flush out the |pdf_buf|}
+var saved_pdf_gone : longinteger;
begin
if not pdf_os_mode then begin
+ saved_pdf_gone := pdf_gone;
case zip_write_state of
no_zip: if pdf_ptr > 0 then begin
if fixed_pdf_draftmode = 0 then write_pdf(0, pdf_ptr - 1);
@@ -16084,6 +15345,8 @@ begin
end;
end;
pdf_ptr := 0;
+ if saved_pdf_gone > pdf_gone then
+ pdf_error("file size", "File size exceeds architectural limits (pdf_gone wraps around)");
end;
end;
@@ -16093,6 +15356,7 @@ begin
pdf_seek_write_length := true; {fill in length at |pdf_end_stream| call}
pdf_stream_length_offset := pdf_offset - 11;
pdf_stream_length := 0;
+ pdf_last_byte := 0;
if pdf_compress_level > 0 then begin
pdf_print_ln("/Filter /FlateDecode");
pdf_print_ln(">>");
@@ -16150,7 +15414,7 @@ end
procedure pdf_error(t, p: str_number);
begin
normalize_selector;
- print_err("pdfTeX error");
+ print_err("LuaTeX error");
if t <> 0 then begin
print(" (");
print(t);
@@ -16166,7 +15430,7 @@ begin
wake_up_terminal;
if prepend_nl then
print_ln;
- print("pdfTeX warning");
+ print("LuaTeX warning");
if t <> 0 then begin
print(" (");
print(t);
@@ -16175,7 +15439,7 @@ begin
print(": "); print(p);
if append_nl then
print_ln;
- if history=spotless then history:=warning_issued;
+ if history=spotless then history:=warning_issued;
end;
procedure pdf_os_get_os_buf(s: integer); {check that |s| bytes more
@@ -16247,12 +15511,10 @@ accurary.
@<Glob...@>=
@!one_hundred_inch: scaled; {scaled value corresponds to 100in}
@!one_inch: scaled; {scaled value corresponds to 1in (rounded!)}
+@!one_true_inch: scaled; {scaled value corresponds to 1truein (rounded!)}
@!one_hundred_bp: scaled; {scaled value corresponds to 100bp}
@!one_bp: scaled; {scaled value corresponds to 1bp (rounded!)}
@!ten_pow: array[0..9] of integer; {$10^0..10^9$}
-@!scaled_out: integer; {amount of |scaled| that was taken out in
-|divide_scaled|}
-@!init_pdf_output: boolean;
@ @<Set init...@>=
one_hundred_inch := 7227 * 65536; {exact, 473628672}
@@ -16262,8 +15524,6 @@ one_bp := (one_hundred_bp + 50) div 100; {rounded to 65782}
ten_pow[0] := 1;
for i := 1 to 9 do
ten_pow[i] := 10*ten_pow[i - 1];
-init_pdf_output := false;
-
@ The function |divide_scaled| divides |s| by |m| using |dd| decimal
digits of precision. It is defined in C because it is a good candidate
@@ -16290,51 +15550,7 @@ else
round_xn_over_d := -u;
end;
-@ Next subroutines are needed for controling spacing in PDF page description.
-For a given character |c| from a font |f|,
-the procedure |adv_char_width| advances |pdf_h|
-by {\it about\/} the amount |w|, which is the character width.
-But we cannot simply add |w| to |pdf_h|.
-Instead we have to bring the required shift into the same raster,
-on which also the \.{/Widths} array values,
-as they appear in the PDF file, are based.
-The |scaled_out| value is the |w| value moved into this raster.
-The \.{/Widths} values are used by the PDF reader independently
-to update its positions.
-So one has to be sure, that calculations are properly synchronized.
-Currently the \.{/Widths} array values are output
-with one digit after the decimal point,
-therefore the raster on which |adv_char_width| is operating
-is $1/10000$ of the |pdf_font_size|.
-
-For PK fonts things are more complicated,
-as we have to deal with scaling bitmaps as well.
-
-@p
-procedure adv_char_width(f: internal_font_number; c: integer); {update |pdf_h|
-by character width |w| from font |f|}
-var w, s_out: scaled;
- s: integer;
-begin
- w := char_width(f,c);
- if hasfmentry(f) then begin
- if pdf_cur_Tm_a = 1000 then begin
- call_func(divide_scaled_n(w, pdf_font_size(f), 10000.0));
- pdf_delta_h := pdf_delta_h + scaled_out;
- end
- else begin
- s := divide_scaled_n(round_xn_over_d(w, 1000, pdf_cur_Tm_a),
- pdf_font_size(f), 10000.0);
- s_out := round_xn_over_d(round_xn_over_d(pdf_font_size(f), abs(s), 10000),
- pdf_cur_Tm_a, 1000);
- if s < 0 then
- s_out := -s_out;
- pdf_delta_h := pdf_delta_h + s_out;
- end;
- end else
- pdf_delta_h := pdf_delta_h + get_pk_char_width(f, w);
-end;
-
+@ @p
procedure pdf_print_bp(s: scaled); {print scaled as |bp|}
begin
pdf_print_real(divide_scaled(s, one_hundred_bp, fixed_decimal_digits + 2),
@@ -16351,135 +15567,23 @@ end;
@* \[32c] PDF page description.
-@d pdf_h_offset == (h_offset + pdf_h_origin)
-@d pdf_v_offset == (v_offset + pdf_v_origin)
-@d pdf_x(#) == ((#) - pdf_h_offset + one_inch) {convert $x$-coordinate from \.{DVI} to PDF}
-@d pdf_y(#) == (cur_page_height - (#) - pdf_v_offset + one_inch) {convert $y$-coordinate from \.{DVI} to PDF}
-
@<Glob...@>=
-@!pdf_f: internal_font_number; {the current font in PDF output page}
-@!pdf_h: scaled; {current horizontal coordinate in PDF output page}
-@!pdf_v: scaled; {current vertical coordinate in PDF output page}
-@!pdf_tj_start_h: scaled; {horizontal coordinate in PDF output page just before \.{TJ} array start}
-@!cur_delta_h: scaled; {horizontal |cur_h| offset from |pdf_tj_start_h|}
-@!pdf_delta_h: scaled; {horizontal offset from |pdf_tj_start_h|}
-@!pdf_origin_h: scaled; {current horizontal origin in PDF output page}
-@!pdf_origin_v: scaled; {current vertical origin in PDF output page}
-@!pdf_doing_string: boolean; {we are writing string to PDF file?}
-@!pdf_doing_text: boolean; {we are writing text section to PDF file?}
-@!min_bp_val: scaled;
-@!min_font_val: scaled; {(TJ array system)}
@!fixed_pk_resolution: integer;
@!fixed_decimal_digits: integer;
@!fixed_gen_tounicode: integer;
+@!fixed_inclusion_copy_font: integer;
@!fixed_replace_font: integer;
@!pk_scale_factor: integer;
@!pdf_output_option: integer;
@!pdf_output_value: integer;
@!pdf_draftmode_option: integer;
@!pdf_draftmode_value: integer;
-@!pdf_cur_Tm_a: integer; {value |a| of the current text matrix, i.e.,
- the current horizontal scaling factor}
-@!pdf_cur_Tm_c: integer; {value |c| of the current text matrix, i.e., slant (skew, obliqueness)}
-@!pdf_last_f: internal_font_number; {last font in PDF output page}
-@!pdf_last_fs: internal_font_number; {last font size in PDF output page}
-
-@ Following procedures implement low-level subroutines to convert \TeX{}
-internal structures to PDF page description.
-
-@p procedure pdf_set_origin(h, v: scaled); {set the origin to |h|, |v|}
-begin
- if (abs(h - pdf_origin_h) >= min_bp_val) or
- (abs(v - pdf_origin_v) >= min_bp_val) then begin
- pdf_print("1 0 0 1 ");
- pdf_print_bp(h - pdf_origin_h);
- pdf_origin_h := pdf_origin_h + scaled_out;
- pdf_out(" ");
- pdf_print_bp(pdf_origin_v - v);
- pdf_origin_v := pdf_origin_v - scaled_out;
- pdf_print_ln(" cm");
- end;
- pdf_h := pdf_origin_h;
- pdf_tj_start_h := pdf_h;
- pdf_v := pdf_origin_v;
-end;
-
-procedure pdf_set_origin_temp(h, v: scaled); {set the origin to |h|, |v| inside group}
-begin
- if (abs(h - pdf_origin_h) >= min_bp_val) or
- (abs(v - pdf_origin_v) >= min_bp_val) then begin
- pdf_print("1 0 0 1 ");
- pdf_print_bp(h - pdf_origin_h);
- pdf_out(" ");
- pdf_print_bp(pdf_origin_v - v);
- pdf_print_ln(" cm");
- end;
-end;
-
-procedure pdf_end_string; {end the current string}
-begin
- if pdf_doing_string then begin
- pdf_print(")]TJ");
- pdf_doing_string := false;
- end;
-end;
-
-procedure pdf_end_string_nl; {end the current string, with new-line}
-begin
- if pdf_doing_string then begin
- pdf_print_ln(")]TJ");
- pdf_doing_string := false;
- end;
-end;
-
-procedure pdf_set_textmatrix(v, v_out: scaled; f: internal_font_number);
-{set the next starting point to |cur_h|, |cur_v|}
-var pdf_new_Tm_a, pdf_new_Tm_c: integer; {values |a| and |c| of the new text matrix}
-begin
- pdf_out(" ");
- if f = pdf_f then begin
- pdf_new_Tm_a := pdf_cur_Tm_a;
- pdf_new_Tm_c := pdf_cur_Tm_c;
- end else begin
- if pdf_font_auto_expand(f) then
- pdf_new_Tm_a := 1000 + pdf_font_expand_ratio(f)
- else
- pdf_new_Tm_a := 1000;
- pdf_new_Tm_c := 0 * font_slant(f); {don't activate it yet, needs fixing writefont.c etc.}
- end;
- if (pdf_new_Tm_a <> 1000) or (pdf_cur_Tm_a <> 1000)
- or (pdf_new_Tm_c <> 0) or (pdf_cur_Tm_c <> 0)
- then begin
- pdf_print_real(pdf_new_Tm_a, 3);
- pdf_print(" 0 ");
- pdf_print_real(pdf_new_Tm_c, 3);
- pdf_print(" 1 ");
- pdf_print_bp(cur_h - pdf_origin_h);
- pdf_h := pdf_origin_h + scaled_out;
- pdf_out(" ");
- pdf_print_bp(pdf_origin_v - cur_v);
- pdf_v := pdf_origin_v - scaled_out;
- pdf_print(" Tm");
- pdf_cur_Tm_a := pdf_new_Tm_a;
- pdf_cur_Tm_c := pdf_new_Tm_c;
- pdfassert(pdf_cur_Tm_a > 0);
- end else begin
- pdf_print_bp(cur_h - pdf_tj_start_h); {works only for unexpanded fonts}
- pdf_h := pdf_tj_start_h + scaled_out;
- pdf_out(" ");
- pdf_print_real(v, fixed_decimal_digits); {use |v| and |v_out| to avoid duplicate calculation}
- pdf_v := pdf_v - v_out;
- pdf_print(" Td");
- end;
- pdf_tj_start_h := pdf_h;
- pdf_delta_h := 0;
-end;
+@ @p
procedure pdf_use_font(f: internal_font_number; fontnum: integer);
{mark |f| as a used font; set |font_used(f)|, |pdf_font_size(f)| and |pdf_font_num(f)|}
begin
- call_func(divide_scaled(font_size(f), one_hundred_bp, 6));
- set_pdf_font_size(f,scaled_out);
+ set_pdf_font_size(f,font_size(f));
set_font_used(f,true);
pdfassert((fontnum > 0) or ((fontnum < 0) and (pdf_font_num(-fontnum) > 0)));
set_pdf_font_num(f,fontnum);
@@ -16509,7 +15613,7 @@ begin
{if |f| is auto expanded then ensure the base font is initialized}
if pdf_font_auto_expand(f) and (pdf_font_blink(f) <> null_font) then begin
b := pdf_font_blink(f);
- {TODO: reinstate this check. disabled because wide fonts font have fmentries}
+ {TODO: reinstate this check. disabled because wide fonts font have fmentries}
if false and (not hasfmentry(b)) then
pdf_error("font expansion", "auto expansion is only possible with scalable fonts");
if not font_used(b) then
@@ -16548,7 +15652,7 @@ begin
pdf_init_font(cur_val);
end;
-procedure pdf_set_font(f: internal_font_number);
+function pdf_set_font(f: internal_font_number): internal_font_number;
{set the actual font on PDF page}
label found, found1;
var p: pointer;
@@ -16569,134 +15673,10 @@ begin
end;
pdf_append_list(f)(pdf_font_list); {|f| not found in |pdf_font_list|, append it now}
found:
- if (k = pdf_last_f) and (font_size(f) = pdf_last_fs) then
- return;
- pdf_print("/F");
- pdf_print_int(k);
- pdf_print_resname_prefix;
- pdf_out(" ");
- pdf_print_real(divide_scaled(font_size(f), one_hundred_bp, 6), 4);
- pdf_print(" Tf");
- pdf_last_f := k;
- pdf_last_fs := font_size(f);
-end;
-
-procedure pdf_begin_text; {begin a text section}
-begin
- pdf_set_origin(0, cur_page_height);
- pdf_print_ln("BT");
- pdf_doing_text := true;
- pdf_f := null_font;
- pdf_last_f := null_font;
- pdf_last_fs := 0;
- pdf_doing_string := false;
- pdf_cur_Tm_a := 1000;
- pdf_cur_Tm_c := 0;
+ pdf_set_font := k;
end;
@ @p
-procedure pdf_begin_string(f: internal_font_number); {begin to draw a string}
-var s_out, v, v_out: scaled;
- s: integer;
-begin s_out:=0;
- if not pdf_doing_text then
- pdf_begin_text;
- if f <> pdf_f then begin
- pdf_end_string;
- pdf_set_font(f);
- end;
- if pdf_cur_Tm_a = 1000 then begin
- s := divide_scaled_n(cur_h - (pdf_tj_start_h + pdf_delta_h), pdf_font_size(f), 1000.0);
- s_out := scaled_out;
- end
- else begin
- s := divide_scaled_n(round_xn_over_d(cur_h - (pdf_tj_start_h + pdf_delta_h), 1000,
- pdf_cur_Tm_a), pdf_font_size(f), 1000.0);
- if abs(s) < @'100000 then begin
- s_out := round_xn_over_d(round_xn_over_d(pdf_font_size(f), abs(s), 1000),
- pdf_cur_Tm_a, 1000);
- if s < 0 then
- s_out := -s_out;
- end;
- {no need to calculate |s_out| when |abs(s) >= @'100000|, since the text
- matrix will be reset below}
- end;
- if abs(cur_v - pdf_v) >= min_bp_val then begin
- v := divide_scaled(pdf_v - cur_v, one_hundred_bp,
- fixed_decimal_digits + 2);
- v_out := scaled_out;
- end
- else begin
- v := 0;
- v_out := 0;
- end;
- if (f <> pdf_f) or (v <> 0) or (abs(s) >= @'100000) then begin
- pdf_end_string;
- pdf_set_textmatrix(v, v_out, f);
- pdf_f := f;
- s := 0;
- end;
- if not pdf_doing_string then begin
- pdf_print(" [");
- if s = 0 then
- pdf_out("(");
- end;
- if s <> 0 then begin
- if pdf_doing_string then
- pdf_out(")");
- pdf_print_int(-s);
- pdf_out("(");
- pdf_delta_h := pdf_delta_h + s_out;
- end;
- pdf_doing_string := true;
-end;
-
-procedure pdf_end_text; {end a text section}
-begin
- if pdf_doing_text then begin
- pdf_end_string_nl;
- pdf_print_ln("ET");
- pdf_doing_text := false;
- end;
-end;
-
-procedure pdf_set_rule(x, y, w, h: scaled); {draw a rule}
-begin
- pdf_end_text;
- pdf_print_ln("q");
- if h <= one_bp then begin
- pdf_set_origin_temp(x, y - (h + 1)/2);
- pdf_print("[]0 d 0 J ");
- pdf_print_bp(h); pdf_print(" w 0 0 m ");
- pdf_print_bp(w); pdf_print_ln(" 0 l S");
- end
- else if w <= one_bp then begin
- pdf_set_origin_temp(x + (w + 1)/2, cur_v);
- pdf_print("[]0 d 0 J ");
- pdf_print_bp(w); pdf_print(" w 0 0 m 0 ");
- pdf_print_bp(h); pdf_print_ln(" l S");
- end
- else begin
- pdf_set_origin_temp(x, y);
- pdf_print("0 0 ");
- pdf_print_bp(w); pdf_out(" ");
- pdf_print_bp(h); pdf_print_ln(" re f");
- end;
- pdf_print_ln("Q");
-end;
-
-procedure pdf_rectangle(left, top, right, bottom: scaled); {output a
-rectangle specification to PDF file}
-begin
- prepare_mag;
- pdf_print("/Rect [");
- pdf_print_mag_bp(pdf_x(left)); pdf_out(" ");
- pdf_print_mag_bp(pdf_y(bottom)); pdf_out(" ");
- pdf_print_mag_bp(pdf_x(right)); pdf_out(" ");
- pdf_print_mag_bp(pdf_y(top));
- pdf_print_ln("]");
-end;
-
procedure literal(s: str_number; literal_mode: integer; warn: boolean);
var j: pool_pointer; {current character code position}
begin
@@ -16723,49 +15703,54 @@ begin
end;
case literal_mode of
set_origin: begin
- pdf_end_text;
- pdf_set_origin(cur_h, cur_v);
+ pdf_goto_pagemode;
+ synch_pos_with_cur;
+ pdf_set_pos(pos.h, pos.v);
end;
direct_page:
- pdf_end_text;
+ pdf_goto_pagemode;
direct_always:
pdf_end_string_nl;
othercases confusion("literal1")
endcases;
- if s>string_offset then
+ if s>string_offset then
while j<str_start_macro(s+1) do begin
- pdf_out(str_pool[j]);
- incr(j);
- end
- else
- pdf_out(s);
+ pdf_out(str_pool[j]);
+ incr(j);
+ end
+ else
+ pdf_out(s);
pdf_print_nl;
end;
-procedure latelua(lua_id: quarterword; s: str_number);
-var b, j: pool_pointer; {current character code position}
+procedure latelua(s: pointer; r: pointer);
+var b: pool_pointer; {current character code position}
begin
- j:=str_start_macro(s);
b := pool_ptr;
- luacall(lua_id,(s-string_offset));
- while b<pool_ptr do begin
- pdf_out(str_pool[b]);
- incr(b);
+ luacall(s,r);
+ if b<pool_ptr then begin
+ pdf_goto_pagemode;
+ while b<pool_ptr do begin
+ pdf_out(str_pool[b]);
+ incr(b);
+ end;
+ pdf_print_nl;
end;
- pdf_print_nl;
end;
@* \[32d] The cross-reference table.
The cross-reference table |obj_tab| is an array of |obj_tab_size| of
-|tab_entry|. Each entry contains five integer fields and represents an object
+|obj_entry|. Each entry contains five integer fields and represents an object
in PDF file whose object number is the index of this entry in |obj_tab|.
Objects in |obj_tab| maybe linked into list; objects in such a linked list have
the same type.
@<Types...@>=
@!obj_entry = record@;@/
- int0, int1, int2, int3, int4: integer;
+ int0, int1: integer;
+ int2: longinteger;
+ int3, int4: integer;
end;
@ The first field contains information representing identifier of this object.
@@ -16776,10 +15761,9 @@ The second field of |obj_entry| contains link to the next
object in |obj_tab| if this object is linked in a list.
The third field holds the byte offset of the object in the output PDF file,
-or its byte offset within an object stream.
-Objects that have been not written yet have this field set to zero. However
-sometimes we have to use this field to store some info before the object is
-written out.
+or its byte offset within an object stream. As long as the object is not
+written, this field is used for flags about the write status of the object;
+then it has a negative value.
The fourth field holds the object number of the object stream, into which
the object is included.
@@ -16790,39 +15774,41 @@ well.
@d obj_info(#) == obj_tab[#].int0 {information representing identifier of this object}
@d obj_link(#) == obj_tab[#].int1 {link to the next entry in linked list}
-@d obj_offset(#) == obj_tab[#].int2 {byte offset for this object in PDF output file, or object stream number for this object}
+@d obj_offset(#) == obj_tab[#].int2 {negative (flags), or byte offset for this object in PDF output file, or object stream number for this object}
@d obj_os_idx(#) == obj_tab[#].int3 {index of this object in object stream}
@d obj_aux(#) == obj_tab[#].int4 {auxiliary pointer}
-@d is_obj_written(#) == (obj_offset(#) <> 0)
+
+@d set_obj_fresh(#) == obj_offset(#) := -2
+@d set_obj_scheduled(#) == if intcast(obj_offset(#)) = -2 then obj_offset(#) := -1
+@d is_obj_scheduled(#) == (intcast(obj_offset(#)) > -2)
+@d is_obj_written(#) == (intcast(obj_offset(#)) > -1)
@# {types of objects}
@d obj_type_others == 0 {objects which are not linked in any list}
@d obj_type_page == 1 {index of linked list of Page objects}
-@d obj_type_pages == 2 {index of linked list of Pages objects}
-@d obj_type_font == 3 {index of linked list of Fonts objects}
-@d obj_type_outline == 4 {index of linked list of outline objects}
-@d obj_type_dest == 5 {index of linked list of destination objects}
-@d obj_type_obj == 6 {index of linked list of raw objects}
-@d obj_type_xform == 7 {index of linked list of XObject forms}
-@d obj_type_ximage == 8 {index of linked list of XObject image}
-@d obj_type_thread == 9 {index of linked list of num article threads}
+@d obj_type_font == 2 {index of linked list of Fonts objects}
+@d obj_type_outline == 3 {index of linked list of outline objects}
+@d obj_type_dest == 4 {index of linked list of destination objects}
+@d obj_type_obj == 5 {index of linked list of raw objects}
+@d obj_type_xform == 6 {index of linked list of XObject forms}
+@d obj_type_ximage == 7 {index of linked list of XObject image}
+@d obj_type_thread == 8 {index of linked list of num article threads}
@d head_tab_max == obj_type_thread {max index of |head_tab|}
@# {max number of kids for balanced trees}
-@d pages_tree_kids_max == 6 {max number of kids of Pages tree node}
@d name_tree_kids_max == 6 {max number of kids of node of name tree for
name destinations}
@# {when a whatsit node representing annotation is created, words |1..3| are
width, height and depth of this annotation; after shipping out words |1..4|
are rectangle specification of annotation. For whatsit node representing
-destination |pdf_left| and |pdf_top| are used for some types of destinations}
+destination |pdf_ann_left| and |pdf_ann_top| are used for some types of destinations}
@# {coordinates of destinations/threads/annotations (in whatsit node)}
-@d pdf_left(#) == vmem(# + 2).sc
-@d pdf_top(#) == vmem(# + 3).sc
-@d pdf_right(#) == vmem(# + 4).sc
-@d pdf_bottom(#) == vmem(# + 5).sc
+@d pdf_ann_left(#) == vmem(# + 2).sc
+@d pdf_ann_top(#) == vmem(# + 3).sc
+@d pdf_ann_right(#) == vmem(# + 4).sc
+@d pdf_ann_bottom(#) == vmem(# + 5).sc
@# {dimension of destinations/threads/annotations (in whatsit node)}
@d pdf_width(#) == vmem(# + 2).sc
@@ -16840,7 +15826,6 @@ destination |pdf_left| and |pdf_top| are used for some types of destinations}
@d scan_special == 3 {look into special text}
@# {data structure for \.{\\pdfcolorstack}}
-@d pdf_colorstack_node_size == 4
@d pdf_colorstack_stack(#) == vlink(#+2) {stack number}
@d pdf_colorstack_cmd(#) == vinfo(#+2) {command: set, push, pop, current}
@d pdf_colorstack_data(#) == vlink(#+3) {data}
@@ -16853,22 +15838,17 @@ destination |pdf_left| and |pdf_top| are used for some types of destinations}
@d colorstack_current == 3
@# {data structure for \.{\\pdfsetmatrix}}
-@d pdf_setmatrix_node_size == 3
@d pdf_setmatrix_data(#) == vlink(#+2) {data}
-@# {data structure for \.{\\pdsave}}
-@d pdf_save_node_size == 3
+@# {data structure for \.{\\pdfsave}}
@# {data structure for \.{\\pdfrestore}}
-@d pdf_restore_node_size == 3
-
@# {data structure for \.{\\latelua}}
-@d late_lua_data(#) == vlink(#+2) {data}
-@d late_lua_reg(#) == vinfo(#+2) {register id}
+@d late_lua_data == write_tokens {data}
+@d late_lua_name(#) == vlink(#+3) {name}
@# {data structure for \.{\\pdfobj} and \.{\\pdfrefobj}}
-@d pdf_refobj_node_size == 3 {size of whatsit node representing the raw object}
@d pdf_obj_objnum(#) == vinfo(# + 2) {number of the raw object}
@d obj_data_ptr == obj_aux {pointer to |pdf_mem|}
@d pdfmem_obj_size == 4 {size of memory in |pdf_mem| which |obj_data_ptr| holds}
@@ -16881,11 +15861,10 @@ destination |pdf_left| and |pdf_top| are used for some types of destinations}
read from an external file?}
@# {data structure for \.{\\pdfxform} and \.{\\pdfrefxform}}
-@d pdf_refxform_node_size == 6 {size of whatsit node for xform; words 1..3 are
- form dimensions}
-@d pdf_xform_objnum(#) == vinfo(# + 4) {object number}
@d pdfmem_xform_size == 6 {size of memory in |pdf_mem| which
|obj_data_ptr| holds}
+
+@d pdf_xform_objnum(#) == vinfo(# + 4) {object number}
@d obj_xform_width(#) == pdf_mem[obj_data_ptr(#) + 0]
@d obj_xform_height(#) == pdf_mem[obj_data_ptr(#) + 1]
@d obj_xform_depth(#) == pdf_mem[obj_data_ptr(#) + 2]
@@ -16897,14 +15876,11 @@ destination |pdf_left| and |pdf_top| are used for some types of destinations}
Resources}
@# {data structure for \.{\\pdfximage} and \.{\\pdfrefximage}}
-@d pdf_refximage_node_size == 6 {size of whatsit node for ximage; words 2..4
- are image dimensions}
-@d pdf_ximage_ref(#) == vinfo(# + 5) {image reference number}
+@d pdf_ximage_idx(#) == vinfo(# + 5) {image index in array}
@# {data structure of annotations; words 1..4 represent the coordinates of
the annotation}
@d obj_annot_ptr == obj_aux {pointer to corresponding whatsit node}
-@d pdf_annot_node_size == 8 {size of whatsit node representing annotation}
@d pdf_annot_data(#) == vinfo(# + 6) {raw data of general annotations}
@d pdf_link_attr(#) == vinfo(# + 6) {attributes of link annotations}
@d pdf_link_action(#) == vlink(# + 6) {pointer to action structure}
@@ -16918,8 +15894,6 @@ destination |pdf_left| and |pdf_top| are used for some types of destinations}
@d pdf_action_user == 3 {user-defined action}
@# {data structure of actions}
-@d pdf_action_size == 4 {size of action structure in |mem|}
-@d action_node == 45
@d pdf_action_type(#) == type(#+1) {action type}
@d pdf_action_named_id(#) == subtype(#+1) {identifier is type of name}
@d pdf_action_id(#) == vlink(#+1) {destination/thread name identifier}
@@ -16932,9 +15906,8 @@ destination |pdf_left| and |pdf_top| are used for some types of destinations}
before all outline entries are defined, so memory allocated for outline
entries can't not be deallocated and will stay in memory. For this reason we
will store data of outline entries in |pdf_mem| instead of |mem|}
-
@d pdfmem_outline_size == 8 {size of memory in |pdf_mem| which
-|obj_outline_ptr| points to}
+ |obj_outline_ptr| points to}
@d obj_outline_count == obj_info{count of all opened children}
@d obj_outline_ptr == obj_aux {pointer to |pdf_mem|}
@d obj_outline_title(#) == pdf_mem[obj_outline_ptr(#)]
@@ -16959,9 +15932,6 @@ action}
@# {data structure of destinations}
@d obj_dest_ptr == obj_aux {pointer to |pdf_dest_node|}
-@d pdf_dest_node_size == 8 {size of whatsit node for destination;
-words |1..4| hold dest dimensions, word |6| identifier type, subtype
-and identifier of destination, word |6| the corresponding object number}
@d pdf_dest_type(#) == type(# + 6) {type of destination}
@d pdf_dest_named_id(#) == subtype(# + 6) {is named identifier?}
@d pdf_dest_id(#) == vlink(# + 6) {destination identifier}
@@ -16971,7 +15941,6 @@ object}
@# {data structure of threads; words 1..4 represent the coordinates of the
corners}
-@d pdf_thread_node_size == 8
@d pdf_thread_named_id(#) == subtype(# + 6) {is a named identifier}
@d pdf_thread_id(#) == vlink(# + 6) {thread identifier}
@d pdf_thread_attr(#) == vinfo(# + 7) {attributes of thread}
@@ -17010,8 +15979,8 @@ so we can use this field for both}
@!pdf_last_pages: integer; {pointer to most recently generated pages object}
@!pdf_last_page: integer; {pointer to most recently generated page object}
@!pdf_last_stream: integer; {pointer to most recently generated stream}
-@!pdf_stream_length: integer; {length of most recently generated stream}
-@!pdf_stream_length_offset: integer; {file offset of the last stream length}
+@!pdf_stream_length: longinteger; {length of most recently generated stream}
+@!pdf_stream_length_offset: longinteger; {file offset of the last stream length}
@!pdf_seek_write_length: boolean; {flag whether to seek back and write \.{/Length}}
@!pdf_last_byte: integer; {byte most recently written to PDF file; for \.{endstream} in new line}
@!pdf_append_list_arg: integer; {for use with |pdf_append_list|}
@@ -17085,7 +16054,7 @@ begin
incr(sys_obj_ptr);
obj_ptr := sys_obj_ptr;
obj_info(obj_ptr) := i;
- obj_offset(obj_ptr) := 0;
+ set_obj_fresh(obj_ptr);
obj_aux(obj_ptr) := 0;
avl_put_obj(obj_ptr, t);
if t = obj_type_page then begin
@@ -17321,7 +16290,7 @@ end;
@ Subroutines to print out various PDF objects
-@p procedure pdf_print_fw_int(n, w: integer); {print out an integer with
+@p procedure pdf_print_fw_int(n: longinteger; w: integer); {print out an integer with
fixed width; used for outputting cross-reference table}
var k: integer; {$0\le k\le23$}
begin
@@ -17335,10 +16304,10 @@ begin
end;
end;
-procedure pdf_out_bytes(n, w: integer); {print out an integer as
+procedure pdf_out_bytes(n: longinteger; w: integer); {print out an integer as
a number of bytes; used for outputting \.{/XRef} cross-reference stream}
var k: integer;
-byte: array[0..3] of integer; {digits in a number being output}
+byte: array[0..7] of integer; {digits in a number being output}
begin
k := 0;
repeat byte[k] := n mod 256; n := n div 256; incr(k);
@@ -17419,15 +16388,101 @@ The |has_packet()| C macro checks for this condition.
@ The following code typesets a character to PDF output.
-@p procedure output_one_char(ffi:internal_font_number;c:integer);
+@p
+procedure output_one_char(ffi:internal_font_number;c:integer);
+var c_wd,c_ht,c_dp: scaled; {the real width, height and depth of the character}
+ci: charinfo_short;
+save, save_box_pos: scaledpos;
+save_direction: integer;
begin
- if has_packet(ffi,c) then
- do_vf_packet(ffi, c)
- else begin
- pdf_begin_string(ffi);
- pdf_print_char(ffi, c);
- adv_char_width(ffi, c);
- end;
+ ci := char_info_short(ffi,c);
+ c_ht:=charinfo_height(ci);
+ c_dp:=charinfo_depth(ci);
+ c_wd:=charinfo_width(ci);
+ synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
+ case font_direction(dvi_direction) of
+ dir__LL, dir__LR: pos_down((c_ht - c_dp) div 2);
+ dir__LT: ;
+ dir__LB: pos_down(c_ht);
+ endcases;
+ end;
+ dir_TR_: begin
+ pos_left(c_wd);
+ case font_direction(dvi_direction) of
+ dir__RL, dir__RR: pos_down((c_ht - c_dp) div 2);
+ dir__RT: ;
+ dir__RB: pos_down(c_ht);
+ endcases;
+ end;
+ dir_BL_: begin
+ case font_direction(dvi_direction) of
+ dir__LL, dir__LR: pos_down((c_ht - c_dp) div 2);
+ dir__LT: pos_up(c_dp);
+ dir__LB: pos_down(c_ht);
+ endcases;
+ end;
+ dir_BR_: begin
+ pos_left(c_wd);
+ case font_direction(dvi_direction) of
+ dir__RL, dir__RR: pos_down((c_ht - c_dp) div 2);
+ dir__RT: pos_up(c_dp);
+ dir__RB: pos_down(c_ht);
+ endcases;
+ end;
+ dir_LT_: begin
+ pos_down(c_ht);
+ case font_direction(dvi_direction) of
+ dir__TL: pos_left(c_wd);
+ dir__TR: ;
+ dir__TB, dir__TT: pos_left(c_wd div 2);
+ endcases;
+ end;
+ dir_RT_: begin
+ pos_down(c_ht);
+ case font_direction(dvi_direction) of
+ dir__TL: pos_left(c_wd);
+ dir__TR: ;
+ dir__TB, dir__TT: pos_left(c_wd div 2);
+ endcases;
+ end;
+ dir_LB_: begin
+ pos_up(c_dp);
+ case font_direction(dvi_direction) of
+ dir__BL: pos_left(c_wd);
+ dir__BR: ;
+ dir__BB, dir__BT: pos_left(c_wd div 2);
+ endcases;
+ end;
+ dir_RB_: begin
+ pos_up(c_dp);
+ case font_direction(dvi_direction) of
+ dir__BL: pos_left(c_wd);
+ dir__BR: ;
+ dir__BB, dir__BT: pos_left(c_wd div 2);
+ endcases;
+ end;
+ endcases;
+ if has_packet(ffi,c) then begin
+ save := cur;
+ save_box_pos := box_pos;
+ box_pos := pos;
+ save_direction := dvi_direction;
+ dvi_direction := dir_TL_; {local virtual font coordinate system}
+ set_to_zero(cur);
+ do_vf_packet(ffi, c);
+ dvi_direction := save_direction;
+ box_pos := save_box_pos;
+ cur := save;
+ end else
+ pdf_place_glyph(ffi, c);
+ case box_direction(dvi_direction) of
+ dir_TL_, dir_TR_, dir_BL_, dir_BR_:
+ cur.h := cur.h + c_wd;
+ dir_LT_, dir_RT_, dir_LB_, dir_RB_:
+ cur.h := cur.h + c_ht + c_dp;
+ endcases;
end;
@ @<Declare procedures that need to be declared forward for \pdfTeX@>=
@@ -17438,24 +16493,19 @@ procedure scan_pdf_ext_toks; forward;
@ Here come some subroutines to deal with expanded fonts for HZ-algorithm.
-@d set_char_and_font(#) ==
-if is_char_node(#) then begin
- c := character(#);
- f := font(#);
-end
+@d non_existent_path == "///..."
@p
function get_default_hyphen_char:integer;
begin
- get_default_hyphen_char:=default_hyphen_char;
+ get_default_hyphen_char:=default_hyphen_char;
end;
@#
function get_default_skew_char:integer;
begin
- get_default_skew_char:=default_skew_char;
+ get_default_skew_char:=default_skew_char;
end;
@#
-
procedure copy_expand_params(k, f: internal_font_number; e: integer);
{set expansion-related parameters for an expanded font |k|, based on the base
font |f| and the expansion amount |e|}
@@ -17473,7 +16523,9 @@ var k: internal_font_number;
begin
if fs <> 0 then begin
for k := 1 to max_font_id do
- if cmp_font_name(k, s) and (font_size(k) = fs) then begin
+ if (tex_font_area(k) <> non_existent_path) and
+ cmp_font_name(k, s) and
+ (font_size(k) = fs) then begin
flush_str(s);
tfm_lookup := k;
return;
@@ -17481,8 +16533,9 @@ begin
end
else begin
for k := 1 to max_font_id do
- if cmp_font_name(k, s) then begin
- flush_string; {|font_name|}
+ if (tex_font_area(k) <> non_existent_path) and
+ cmp_font_name(k, s) then begin
+ flush_string; {|font_name|}
flush_str(s);
tfm_lookup := k;
return;
@@ -17504,10 +16557,10 @@ begin
if k = null_font then begin
if pdf_font_auto_expand(f) then begin
k := auto_expand_font(f, e);
- font_id_text(k) := font_id_text(f);
+ font_id_text(k) := font_id_text(f);
end
else
- k := read_font_info(null_cs, s, "", font_size(f), font_natural_dir(f));
+ k := read_font_info(null_cs, s, font_size(f), font_natural_dir(f));
end;
copy_expand_params(k, f, e);
load_expand_font := k;
@@ -17579,21 +16632,21 @@ begin
end;
procedure set_expand_params(f: internal_font_number; auto_expand: boolean;
- font_stretch, font_shrink, font_step, expand_ratio: integer);
+ stretch_limit, shrink_limit, font_step, expand_ratio: integer);
{expand a font with given parameters}
begin
set_pdf_font_step(f, font_step);
set_pdf_font_auto_expand(f, auto_expand);
- if font_stretch > 0 then
- set_pdf_font_stretch(f,get_expand_font(f, font_stretch));
- if font_shrink > 0 then
- set_pdf_font_shrink(f, get_expand_font(f, -font_shrink));
+ if stretch_limit > 0 then
+ set_pdf_font_stretch(f,get_expand_font(f, stretch_limit));
+ if shrink_limit > 0 then
+ set_pdf_font_shrink(f, get_expand_font(f, -shrink_limit));
if expand_ratio <> 0 then
set_pdf_font_expand_ratio(f,expand_ratio);
end;
procedure read_expand_font; {read font expansion spec and load expanded font}
-var font_shrink, font_stretch, font_step: integer;
+var shrink_limit, stretch_limit, font_step: integer;
f: internal_font_number;
auto_expand: boolean;
begin
@@ -17603,26 +16656,26 @@ begin
if f = null_font then
pdf_error("font expansion", "invalid font identifier");
if pdf_font_blink(f) <> null_font then
- pdf_error("font expansion", "\pdffontexpand cannot be used this way (the base font has been expanded or letter-spaced)");
+ pdf_error("font expansion", "\pdffontexpand cannot be used this way (the base font has been expanded)");
scan_optional_equals;
scan_int;
- font_stretch := fix_int(cur_val, 0, 1000);
+ stretch_limit := fix_int(cur_val, 0, 1000);
scan_int;
- font_shrink := fix_int(cur_val, 0, 500);
+ shrink_limit := fix_int(cur_val, 0, 500);
scan_int;
font_step := fix_int(cur_val, 0, 100);
if font_step = 0 then
pdf_error("font expansion", "invalid step");
- font_stretch := font_stretch - font_stretch mod font_step;
- if font_stretch < 0 then
- font_stretch := 0;
- font_shrink := font_shrink - font_shrink mod font_step;
- if font_shrink < 0 then
- font_shrink := 0;
- if (font_stretch = 0) and (font_shrink = 0) then
+ stretch_limit := stretch_limit - stretch_limit mod font_step;
+ if stretch_limit < 0 then
+ stretch_limit := 0;
+ shrink_limit := shrink_limit - shrink_limit mod font_step;
+ if shrink_limit < 0 then
+ shrink_limit := 0;
+ if (stretch_limit = 0) and (shrink_limit = 0) then
pdf_error("font expansion", "invalid limit(s)");
auto_expand := false;
- if scan_keyword("autoexpand") then begin
+ if scan_keyword('autoexpand') then begin
auto_expand := true;
@<Scan an optional space@>;
end;
@@ -17633,42 +16686,41 @@ begin
if (pdf_font_step(f) <> 0) then
{this font has been expanded, ensure the expansion parameters are identical}
begin
- if (pdf_font_step(f) <> font_step) or
- ((pdf_font_stretch(f) = null_font) and (font_stretch <> 0)) or
+ if pdf_font_step(f) <> font_step then
+ pdf_error("font expansion", "font has been expanded with different expansion step");
+
+ if ((pdf_font_stretch(f) = null_font) and (stretch_limit <> 0)) or
((pdf_font_stretch(f) <> null_font) and
- (pdf_font_expand_ratio(pdf_font_stretch(f)) <> font_stretch)) or
- ((pdf_font_shrink(f) = null_font) and (font_shrink <> 0)) or
+ (pdf_font_expand_ratio(pdf_font_stretch(f)) <> stretch_limit)) then
+ pdf_error("font expansion", "font has been expanded with different stretch limit");
+
+ if ((pdf_font_shrink(f) = null_font) and (shrink_limit <> 0)) or
((pdf_font_shrink(f) <> null_font) and
- (pdf_font_expand_ratio(pdf_font_shrink(f)) <> -font_shrink)) or
- (pdf_font_auto_expand(f) <> auto_expand)
- then
- pdf_error("font expansion", "font has been expanded with different parameters");
+ (-pdf_font_expand_ratio(pdf_font_shrink(f)) <> shrink_limit)) then
+ pdf_error("font expansion", "font has been expanded with different shrink limit");
+
+ if pdf_font_auto_expand(f) <> auto_expand then
+ pdf_error("font expansion", "font has been expanded with different auto expansion value");
end
else begin
if font_used(f) then
pdf_warning("font expansion", "font should be expanded before its first use",
true, true);
- set_expand_params(f, auto_expand, font_stretch, font_shrink, font_step, 0);
+ set_expand_params(f, auto_expand, stretch_limit, shrink_limit, font_step, 0);
if font_type(f) = virtual_font_type then
vf_expand_local_fonts(f);
end;
end;
-procedure new_letterspaced_font(a: small_number);
+procedure new_letterspaced_font(a: small_number);
{letter-space a font by creating a virtual font}
var u:pointer; {user's font identifier}
@!t:str_number; {name for the frozen font identifier}
-@!old_setting:0..max_selector; {holds |selector| setting}
@!f, k:internal_font_number;
begin
get_r_token; u:=cur_cs;
- if u>=hash_base then t:=text(u)
- else if u=null_cs then t:="FONT"
- else begin old_setting:=selector; selector:=new_string;
- print("FONT"); print(u-active_base); selector:=old_setting;
- @.FONTx@>
- str_room(1); t:=make_string;
- end;
+ if u>=hash_base then t:=text(u) else t:="FONT";
+@.FONTx@>
define(u,set_font,null_font); scan_optional_equals; scan_font_ident;
k := cur_val;
scan_int;
@@ -17676,6 +16728,22 @@ begin
equiv(u):=f; eqtb[font_id_base+f]:=eqtb[u]; font_id_text(f):=t;
end;
+procedure make_font_copy(a: small_number);
+{make a font copy for further use with font expansion}
+var u:pointer; {user's font identifier}
+@!t:str_number; {name for the frozen font identifier}
+@!f, k:internal_font_number;
+begin
+ get_r_token; u:=cur_cs;
+ if u>=hash_base then t:=text(u) else t:="FONT";
+@.FONTx@>
+ define(u,set_font,null_font); scan_optional_equals; scan_font_ident;
+ k := cur_val;
+ f := copy_font_info(k);
+ equiv(u):=f; eqtb[font_id_base+f]:=eqtb[u]; font_id_text(f):=t;
+end;
+
+
@ We need to hold information about used characters in each font for partial
downloading.
@@ -17790,7 +16858,8 @@ begin
selector:=old_setting;
str_room(7);
str_pool[pool_ptr] := 0; { make C string for pdfsetmatrix }
- pdfsetmatrix(str_start_macro(str_ptr), cur_h, cur_page_height - cur_v);
+ synch_pos_with_cur;
+ pdfsetmatrix(str_start_macro(str_ptr), pos);
str_room(7);
append_char(" ");
append_char("0");
@@ -17806,13 +16875,15 @@ end;
procedure pdf_out_save;
begin
- checkpdfsave(cur_h, cur_v);
+ synch_pos_with_cur;
+ checkpdfsave(pos);
literal("q", set_origin, false);
end;
procedure pdf_out_restore;
begin
- checkpdfrestore(cur_h, cur_v);
+ synch_pos_with_cur;
+ checkpdfrestore(pos);
literal("Q", set_origin, false);
end;
@@ -17829,15 +16900,12 @@ begin
end;
procedure do_late_lua(p: pointer);
-var old_setting:0..max_selector; {holds print |selector|}
- s: str_number;
begin
- old_setting:=selector; selector:=new_string;
- show_token_list(link(late_lua_data(p)),null,pool_size-pool_ptr);
- selector:=old_setting;
- s := make_string;
- latelua(late_lua_reg(p), s);
- flush_str(s);
+ if not doing_leaders then begin
+ expand_late_lua(p);
+ latelua(def_ref, late_lua_name(p));
+ flush_list(def_ref);
+ end;
end;
procedure pdf_print_toks(p: pointer); {print tokens list |p|}
@@ -17870,8 +16938,6 @@ end;
procedure pdf_hlist_out; {output an |hlist_node| box}
label move_past, fin_rule, next_p;
var base_line: scaled; {the baseline coordinate for this box}
-c_wd,c_ht,c_dp: scaled;
- {the real width, height and depth of the character}
w: scaled; { temporary value for directional width calculation }
dir_nest: integer; { for tracking nested direction nodes }
edge_v: scaled;
@@ -17879,12 +16945,11 @@ edge_h: scaled;
effective_horizontal: scaled;
basepoint_horizontal: scaled;
basepoint_vertical: scaled;
-saving_h: scaled;
-saving_v: scaled;
save_direction: integer;
dvi_ptr,dir_ptr,dir_tmp:pointer;
@!left_edge: scaled; {the left coordinate for this box}
-@!save_h: scaled; {what |cur_h| should pop to}
+@!save_h: scaled; {what |cur.h| should pop to}
+@!save_box_pos: scaledpos; {what |box_pos| should pop to}
@!this_box: pointer; {pointer to containing box}
@!g_order: glue_ord; {applicable order of infinity for glue}
@!g_sign: normal..shrinking; {selects type of glue}
@@ -17894,6 +16959,7 @@ dvi_ptr,dir_ptr,dir_tmp:pointer;
@!lx:scaled; {extra space between leader boxes}
@!outer_doing_leaders:boolean; {were we doing leaders?}
@!edge:scaled; {right edge of sub-box or leader space}
+@!border:scaled; {right edge of sub-box or leader space}
@!prev_p:pointer; {one step behind |p|}
@!glue_temp:real; {glue value before rounding}
@!cur_glue:real; {glue seen so far}
@@ -17904,20 +16970,21 @@ dvi_ptr,dir_ptr,dir_tmp:pointer;
begin cur_g:=0; cur_glue:=float_constant(0);
this_box:=temp_ptr; g_order:=glue_order(this_box);
g_sign:=glue_sign(this_box); p:=list_ptr(this_box);
+set_to_zero(cur); box_pos:=pos;
save_direction:=dvi_direction;
dvi_direction:=box_dir(this_box);
dvi_ptr:=0; lx:=0;
@<DIR: Initialize |dir_ptr| for |ship_out|@>;
-saving_h:=cur_h; saving_v:=cur_v;
incr(cur_s);
-base_line:=cur_v;
-left_edge:=cur_h;
+base_line:=cur.v;
+left_edge:=cur.h;
prev_p:=this_box+list_offset;
@<Create link annotations for the current hbox if needed@>;
+@<Start hlist {\sl Sync\TeX} information record@>;
while p<>null do
@<Output node |p| for |pdf_hlist_out| and move to the next node,
- maintaining the condition |cur_v=base_line|@>;
-cur_h:=saving_h; cur_v:=saving_v;
+ maintaining the condition |cur.v=base_line|@>;
+@<Finish hlist {\sl Sync\TeX} information record@>;
decr(cur_s);
dvi_direction:=save_direction;
@<DIR: Reset |dir_ptr|@>;
@@ -17932,184 +16999,39 @@ end
@
-@d pdf_dvicmd_set(#)==output_one_char(f,#)
-@d pdf_dvicmd_put(#)==output_one_char(f,#); cur_h:=cur_h-c_wd
-@d pdf_dvicmd_right(#)==cur_h := cur_h + #
-@d pdf_dvicmd_left(#)== cur_h := cur_h - #
-@d pdf_dvicmd_down(#)== cur_v := cur_v - #
-@d pdf_dvicmd_up(#)== cur_v := cur_v + #
-@d pdf_dvicmd_h(#)==case box_direction(dvi_direction) of
- dir_TL_: begin cur_h := cur_h + #; end;
- dir_TR_: begin cur_h := cur_h - #; end;
- dir_LT_: begin do_nothing; {if o=right1 then o:=down1 else o:=right1;} end;
- dir_LB_: begin do_nothing; {if o=right1 then begin o:=down1; negate(w); end else o:=right1;} end;
- dir_BL_: begin do_nothing; {if o=down1 then negate(w); } end;
- dir_BR_: begin do_nothing; { negate(w);} end;
- dir_RT_: begin do_nothing; {if o=right1 then o:=down1 else begin o:=right1; negate(w); end;} end;
- dir_RB_: begin do_nothing; {if o=right1 then o:=down1 else o:=right1; negate(w);} end;
- end
-
+@d pos_right(#) == pos.h := pos.h + (#)
+@d pos_left(#) == pos.h := pos.h - (#)
+@d pos_up(#) == pos.v := pos.v + (#)
+@d pos_down(#) == pos.v := pos.v - (#)
@<Output node |p| for |pdf_hlist_out|...@>=
begin
-if is_char_node(p) then
- begin
- repeat f:=font(p); c:=character(p);
- ci := char_info_short (f,c);
- {|writeln('hlist_out: a char node ', c:1 , ' in font ',f:1);|}
- if is_valid_char(c) then begin
- if is_rotated(dvi_direction) then begin
- c_ht:=charinfo_width(ci) div 2;
- c_dp:=0;
- c_wd:=charinfo_height(ci)+charinfo_depth(ci);
- end
- else begin
- c_ht:=charinfo_height(ci);
- c_dp:=charinfo_depth(ci);
- c_wd:=charinfo_width(ci);
- end;
- if (font_natural_dir(f)<>-1) then
- case font_direction(dvi_direction) of
- dir__LT,dir__LB: begin
- if x_displace(p)<>0 then pdf_dvicmd_right(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_up(-y_displace(p));
- pdf_dvicmd_set(c);
- if x_displace(p)<>0 then pdf_dvicmd_left(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_down(-y_displace(p));
- end;
- dir__RT,dir__RB: begin
- if x_displace(p)<>0 then pdf_dvicmd_left(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_up(-y_displace(p));
- pdf_dvicmd_left(c_wd);
- pdf_dvicmd_put(c);
- if x_displace(p)<>0 then pdf_dvicmd_right(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_down(-y_displace(p));
- end;
- dir__TL,dir__TR: begin
- pdf_dvicmd_put(c);
- pdf_dvicmd_down(c_wd);
- end;
- dir__BL,dir__BR: begin
- pdf_dvicmd_put(c);
- pdf_dvicmd_up(c_wd);
- end;
- dir__LL,dir__LR: begin
- pdf_dvicmd_put(c);
- pdf_dvicmd_right(c_wd);
- end;
- dir__RL,dir__RR: begin
- pdf_dvicmd_put(c);
- pdf_dvicmd_left(c_wd);
- end;
- dir__TT,dir__TB: begin
- pdf_dvicmd_put(c);
- pdf_dvicmd_down(c_wd);
- end;
- dir__BT,dir__BB: begin
- pdf_dvicmd_put(c);
- pdf_dvicmd_up(c_wd);
- end;
- end
- else
- case font_direction(dvi_direction) of
- dir__LT: begin
- if x_displace(p)<>0 then pdf_dvicmd_right(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_up(-y_displace(p));
- pdf_dvicmd_set(c);
- if x_displace(p)<>0 then pdf_dvicmd_left(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_down(-y_displace(p));
- end;
- dir__LB: begin
- pdf_dvicmd_down(c_ht);
- pdf_dvicmd_set(c);
- pdf_dvicmd_up(c_ht);
- end;
- dir__RT: begin
- if x_displace(p)<>0 then pdf_dvicmd_left(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_up(-y_displace(p));
- pdf_dvicmd_left(c_wd);
- pdf_dvicmd_put(c);
- if x_displace(p)<>0 then pdf_dvicmd_right(x_displace(p));
- if y_displace(p)<>0 then pdf_dvicmd_down(-y_displace(p));
- end;
- dir__RB: begin
- pdf_dvicmd_left(c_wd);
- pdf_dvicmd_down(c_ht);
- pdf_dvicmd_put(c);
- pdf_dvicmd_up(c_ht);
- end;
- dir__TL: begin
- pdf_dvicmd_down(c_wd);
- pdf_dvicmd_left(c_ht);
- pdf_dvicmd_put(c);
- pdf_dvicmd_right(c_ht);
- end;
- dir__TR: begin
- pdf_dvicmd_down(c_wd);
- pdf_dvicmd_left(c_dp);
- pdf_dvicmd_put(c);
- pdf_dvicmd_right(c_dp);
- end;
- dir__BL: begin
- pdf_dvicmd_left(c_ht);
- pdf_dvicmd_put(c);
- pdf_dvicmd_right(c_ht);
- pdf_dvicmd_up(c_wd);
- end;
- dir__BR: begin
- pdf_dvicmd_left(c_dp);
- pdf_dvicmd_put(c);
- pdf_dvicmd_right(c_dp);
- pdf_dvicmd_up(c_wd);
- end;
- dir__LL,dir__LR: begin
- pdf_dvicmd_down(c_ht);
- pdf_dvicmd_put(c);
- pdf_dvicmd_up(c_ht);
- pdf_dvicmd_right(c_wd);
- end;
- dir__RL,dir__RR: begin
- pdf_dvicmd_left(c_wd);
- pdf_dvicmd_down(c_ht);
- pdf_dvicmd_put(c);
- pdf_dvicmd_up(c_ht);
- end;
- dir__TT,dir__TB: begin
- pdf_dvicmd_down(c_wd);
- pdf_dvicmd_left(c_ht);
- pdf_dvicmd_put(c);
- pdf_dvicmd_right(c_ht);
- end;
- dir__BT,dir__BB: begin
- pdf_dvicmd_left(c_ht);
- pdf_dvicmd_put(c);
- pdf_dvicmd_right(c_ht);
- pdf_dvicmd_up(c_wd);
- end;
- end;
- cur_h:=cur_h+c_wd;
- end
- else
- char_warning(f, c);
- prev_p:=p;
- p:=vlink(p);
+if is_char_node(p) then begin
+ repeat
+ if x_displace(p)<>0 then cur.h := cur.h + x_displace(p);
+ if y_displace(p)<>0 then cur.v := cur.v - y_displace(p);
+ output_one_char(font(p), character(p));
+ if x_displace(p)<>0 then cur.h := cur.h - x_displace(p);
+ if y_displace(p)<>0 then cur.v := cur.v + y_displace(p);
+ p:=vlink(p);
until not is_char_node(p);
- end
+ @<Record current point {\sl Sync\TeX} information@>;
+end
else @<Output the non-|char_node| |p| for |pdf_hlist_out|
and move to the next node@>;
end
@ @<Output the non-|char_node| |p| for |pdf_hlist_out|...@>=
begin case type(p) of
-hlist_node,vlist_node:@<(\pdfTeX) Output a box in an hlist@>;
-disc_node: if vlink(no_break(p))<>null then begin
+hlist_node_case,vlist_node_case:@<(\pdfTeX) Output a box in an hlist@>;
+disc_node_case: if vlink(no_break(p))<>null then begin
q:=tail_of_list (vlink(no_break(p))); {TODO, this should be a tlink}
vlink(q):=vlink(p);
q:=vlink(no_break(p));
vlink(no_break(p)):=null;
vlink(p):=q;
end;
-rule_node: begin
+rule_node_case: begin
if not (dir_orthogonal(dir_primary[rule_dir(p)])(dir_primary[dvi_direction]))
then begin
rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p);
@@ -18121,15 +17043,25 @@ rule_node: begin
end;
goto fin_rule;
end;
-whatsit_node: @<Output the whatsit node |p| in |pdf_hlist_out|@>;
-glue_node: @<(\pdfTeX) Move right or output leaders@>;
-margin_kern_node,kern_node: pdf_dvicmd_h(width(p));
-math_node: pdf_dvicmd_h(surround(p));
+whatsit_node_case: @<Output the whatsit node |p| in |pdf_hlist_out|@>;
+glue_node_case: @<(\pdfTeX) Move right or output leaders@>;
+margin_kern_node_case: cur.h := cur.h + width(p);
+kern_node_case: begin
+ @<Record |kern_node| {\sl Sync\TeX} information@>;
+ cur.h := cur.h + width(p);
+ end;
+math_node_case: begin
+ @<Record |math_node| {\sl Sync\TeX} information@>;
+ cur.h := cur.h + surround(p);
+ end;
othercases do_nothing
endcases;@/
goto next_p;
fin_rule: @<(\pdfTeX) Output a rule in an hlist@>;
-move_past: pdf_dvicmd_h(rule_wd);
+move_past: begin
+ cur.h := cur.h + rule_wd;
+ @<Record horizontal |rule_node| or |glue_node| {\sl Sync\TeX} information@>;
+ end;
next_p:prev_p:=p; p:=vlink(p);
end
@@ -18146,7 +17078,7 @@ if not (dir_orthogonal(dir_primary[box_dir(p)])(dir_primary[dvi_direction]))
end
else begin
effective_horizontal:=height(p)+depth(p);
- if not (is_mirrored(box_dir(p))) then
+ if not is_mirrored(box_dir(p)) then
if dir_eq(dir_primary[box_dir(p)])(dir_secondary[dvi_direction]) then
basepoint_horizontal:=height(p)
else
@@ -18161,74 +17093,45 @@ else begin
else
basepoint_vertical:= (width(p) div 2);
end;
-if not (is_mirrored(dvi_direction)) then
+if not is_mirrored(dvi_direction) then
basepoint_vertical := basepoint_vertical + shift_amount(p)
{shift the box `down'}
else
basepoint_vertical := basepoint_vertical - shift_amount(p);
{shift the box `up'}
-if list_ptr(p)=null then begin pdf_dvicmd_h(effective_horizontal); end
+if list_ptr(p)=null then begin
+ @<Record void list {\sl Sync\TeX} information@>;
+ cur.h := cur.h + effective_horizontal;
+ end
else begin
temp_ptr:=p;
- edge:=cur_h; pdf_dvicmd_h(basepoint_horizontal);
- edge_v:=cur_v; cur_v:=base_line + basepoint_vertical;
+ edge:=cur.h; cur.h := cur.h + basepoint_horizontal;
+ edge_v:=cur.v; cur.v:=base_line + basepoint_vertical;
+ synch_pos_with_cur;
+ save_box_pos:=box_pos;
if type(p)=vlist_node then pdf_vlist_out@+else pdf_hlist_out;
- cur_h:=edge; pdf_dvicmd_h(effective_horizontal);
- cur_v:=base_line;
+ box_pos:=save_box_pos;
+ cur.h:=edge; cur.h := cur.h + effective_horizontal;
+ cur.v:=base_line;
end
end
@ @<(\pdfTeX) Output a rule in an hlist@>=
if is_running(rule_ht) then rule_ht:=height(this_box);
if is_running(rule_dp) then rule_dp:=depth(this_box);
-rule_ht:=rule_ht+rule_dp; {this is the rule thickness}
-if (rule_ht>0)and(rule_wd>0) then {we don't output empty rules}
- begin cur_v:=base_line+rule_dp;
- case font_direction(dvi_direction) of
- dir__LT: begin
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- end;
- dir__LB: begin
- pdf_dvicmd_down(rule_ht);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_up(rule_ht);
- end;
- dir__RT: begin
- pdf_dvicmd_left(rule_wd);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_right(rule_wd);
- end;
- dir__RB: begin
- pdf_dvicmd_left(rule_wd);
- pdf_dvicmd_down(rule_ht);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_left(rule_wd);
- pdf_dvicmd_up(rule_ht);
- end;
- dir__TL: begin
- pdf_dvicmd_down(rule_wd);
- pdf_dvicmd_left(rule_ht);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- end;
- dir__TR: begin
- pdf_dvicmd_down(rule_wd);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_left(rule_ht);
- end;
- dir__BL: begin
- pdf_dvicmd_left(rule_ht);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_up(rule_wd);
- end;
- dir__BR: begin
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_left(rule_ht);
- pdf_dvicmd_up(rule_wd);
- end;
- end;
- {|cur_h:=cur_h+rule_wd;|}{|dir__RT| is corrected elsewhere}
- cur_v:=base_line;
- end
+if ((rule_ht+rule_dp)>0)and(rule_wd>0) then begin {we don't output empty rules}
+ synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: pdf_place_rule(pos.h, pos.v - rule_dp, rule_wd, rule_ht + rule_dp);
+ dir_BL_: pdf_place_rule(pos.h, pos.v - rule_ht, rule_wd, rule_ht + rule_dp);
+ dir_TR_: pdf_place_rule(pos.h - rule_wd, pos.v - rule_dp, rule_wd, rule_ht + rule_dp);
+ dir_BR_: pdf_place_rule(pos.h - rule_wd, pos.v - rule_ht, rule_wd, rule_ht + rule_dp);
+ dir_LT_: pdf_place_rule(pos.h - rule_ht, pos.v - rule_wd, rule_ht + rule_dp, rule_wd);
+ dir_RT_: pdf_place_rule(pos.h - rule_dp, pos.v - rule_wd, rule_ht + rule_dp, rule_wd);
+ dir_LB_: pdf_place_rule(pos.h - rule_ht, pos.v, rule_ht + rule_dp, rule_wd);
+ dir_RB_: pdf_place_rule(pos.h - rule_dp, pos.v, rule_ht + rule_dp, rule_wd);
+ end;
+end
@ @<(\pdfTeX) Move right or output leaders@>=
begin g:=glue_ptr(p); rule_wd:=width(g)-cur_g;
@@ -18266,29 +17169,34 @@ else
leader_wd:=height(leader_box)+depth(leader_box);
if (leader_wd>0)and(rule_wd>0) then
begin
- edge:=cur_h+rule_wd;
{TODO this double |case| is a hack, and not quite the proper
solution, but it produces the correct output for |xleaders|
in TRT mode, which is important for KASHIDAH fills.}
case box_direction(dvi_direction) of
dir_TR_,dir_RT_: begin
- edge:=cur_h;
- cur_h:=cur_h-rule_wd;
+ border:=cur.h+leader_wd;
+ cur.h:=cur.h-rule_wd+leader_wd;
+ edge:=cur.h-leader_wd;
+ end;
+ othercases begin { |dir_TL_,dir_LT_| }
+ edge:=cur.h+rule_wd;
+ border:=edge;
end;
end;
- @<Let |cur_h| be the position of the first box, and set |leader_wd+lx|
+ @<Let |cur.h| be the position of the first box, and set |leader_wd+lx|
to the spacing between corresponding parts of boxes@>;
- while cur_h+leader_wd<=edge do
- @<(\pdfTeX) Output a leader box at |cur_h|,
- then advance |cur_h| by |leader_wd+lx|@>;
+ while cur.h+leader_wd<=border do
+ @<(\pdfTeX) Output a leader box at |cur.h|,
+ then advance |cur.h| by |leader_wd+lx|@>;
case box_direction(dvi_direction) of
- dir_TR_,dir_RT_: cur_h:=cur_h-rule_wd;
+ dir_TR_,dir_RT_: cur.h:=edge;
+ dir_TL_,dir_LT_: cur.h:=edge;
end;
goto next_p;
end;
end
-@ @<(\pdfTeX) Output a leader box at |cur_h|, ...@>=
+@ @<(\pdfTeX) Output a leader box at |cur.h|, ...@>=
begin
if not (dir_orthogonal(dir_primary[box_dir(leader_box)])(dir_primary[dvi_direction]))
then begin
@@ -18300,7 +17208,7 @@ if not (dir_orthogonal(dir_primary[box_dir(leader_box)])(dir_primary[dvi_directi
basepoint_horizontal:=0;
end
else begin
- if not (is_mirrored(box_dir(leader_box))) then
+ if not is_mirrored(box_dir(leader_box)) then
if dir_eq(dir_primary[box_dir(leader_box)])(dir_secondary[dvi_direction]) then
basepoint_horizontal:=height(leader_box)
else
@@ -18315,19 +17223,22 @@ else begin
else
basepoint_vertical:= (width(leader_box) div 2);
end;
-if not (is_mirrored(dvi_direction)) then
+if not is_mirrored(dvi_direction) then
basepoint_vertical := basepoint_vertical + shift_amount(leader_box)
{shift the box `down'}
else
basepoint_vertical := basepoint_vertical - shift_amount(leader_box);
{shift the box `up'}
temp_ptr:=leader_box;
-edge_h:=cur_h; cur_h:=cur_h + basepoint_horizontal;
-edge_v:=cur_v; cur_v:=base_line + basepoint_vertical;
+edge_h:=cur.h; cur.h:=cur.h + basepoint_horizontal;
+edge_v:=cur.v; cur.v:=base_line + basepoint_vertical;
+synch_pos_with_cur;
+save_box_pos:=box_pos;
outer_doing_leaders:=doing_leaders; doing_leaders:=true;
if type(leader_box)=vlist_node then pdf_vlist_out@+else pdf_hlist_out;
doing_leaders:=outer_doing_leaders;
-cur_h:=edge_h+leader_wd+lx; cur_v:=base_line;
+box_pos:=save_box_pos;
+cur.h:=edge_h+leader_wd+lx; cur.v:=base_line;
end
@ The |pdf_vlist_out| routine is similar to |pdf_hlist_out|, but a bit simpler.
@@ -18335,7 +17246,8 @@ end
label move_past, fin_rule, next_p;
var left_edge: scaled; {the left coordinate for this box}
@!top_edge: scaled; {the top coordinate for this box}
-@!save_v: scaled; {what |cur_v| should pop to}
+@!save_v: scaled; {what |cur.v| should pop to}
+@!save_box_pos: scaledpos; {what |box_pos| should pop to}
@!this_box: pointer; {pointer to containing box}
@!g_order: glue_ord; {applicable order of infinity for glue}
@!g_sign: normal..shrinking; {selects type of glue}
@@ -18353,23 +17265,23 @@ var left_edge: scaled; {the left coordinate for this box}
@!basepoint_horizontal: scaled;
@!basepoint_vertical: scaled;
@!edge_v: scaled;
-@!saving_v: scaled;
-@!saving_h: scaled;
begin cur_g:=0; cur_glue:=float_constant(0);
this_box:=temp_ptr; g_order:=glue_order(this_box);
g_sign:=glue_sign(this_box); p:=list_ptr(this_box);
{pdfassert(p<>0);}
-saving_v:=cur_v; saving_h:=cur_h;
-{|writeln(''); writeln('vlist_out: left edge: ', cur_h:1 , '');|}
+set_to_zero(cur); box_pos:=pos;
+{|writeln(''); writeln('vlist_out: left edge: ', cur.h:1 , '');|}
save_direction:=dvi_direction;
dvi_direction:=box_dir(this_box);
incr(cur_s);
-left_edge:=cur_h; cur_v:=cur_v-height(this_box); top_edge:=cur_v;
+left_edge:=cur.h;
+@<Start vlist {\sl Sync\TeX} information record@>;
+cur.v:=cur.v-height(this_box); top_edge:=cur.v;
@<Create thread for the current vbox if needed@>;
while p<>null do
@<Output node |p| for |pdf_vlist_out| and move to the next node,
- maintaining the condition |cur_h=left_edge|@>;
-cur_v:=saving_v; cur_h:=saving_h;
+ maintaining the condition |cur.h=left_edge|@>;
+@<Finish vlist {\sl Sync\TeX} information record@>;
decr(cur_s);
dvi_direction:=save_direction;
end;
@@ -18388,8 +17300,8 @@ end
@ @<Output the non-|char_node| |p| for |pdf_vlist_out|@>=
begin case type(p) of
-hlist_node,vlist_node:@<(\pdfTeX) Output a box in a vlist@>;
-rule_node: begin
+hlist_node_case,vlist_node_case:@<(\pdfTeX) Output a box in a vlist@>;
+rule_node_case: begin
if not (dir_orthogonal(dir_primary[rule_dir(p)])(dir_primary[dvi_direction]))
then begin
rule_ht:=height(p); rule_dp:=depth(p); rule_wd:=width(p);
@@ -18401,14 +17313,14 @@ rule_node: begin
end;
goto fin_rule;
end;
-whatsit_node: @<Output the whatsit node |p| in |pdf_vlist_out|@>;
-glue_node: @<(\pdfTeX) Move down or output leaders@>;
-kern_node:cur_v:=cur_v+width(p);
+whatsit_node_case: @<Output the whatsit node |p| in |pdf_vlist_out|@>;
+glue_node_case: @<(\pdfTeX) Move down or output leaders@>;
+kern_node_case:cur.v := cur.v + width(p);
othercases do_nothing
endcases;@/
goto next_p;
fin_rule: @<(\pdfTeX) Output a rule in a vlist, |goto next_p|@>;
-move_past: cur_v:=cur_v+rule_ht;
+move_past: cur.v := cur.v + rule_ht;
end
@ TODO: the direct test to switch between |width(p)| and |-width(p)|
@@ -18422,7 +17334,7 @@ begin
if not (dir_orthogonal(dir_primary[box_dir(p)])(dir_primary[dvi_direction]))
then begin
effective_vertical:=height(p)+depth(p);
- if (type(p)=hlist_node) and (is_mirrored(box_dir(p))) then
+ if (type(p)=hlist_node) and is_mirrored(box_dir(p)) then
basepoint_vertical:=depth(p)
else
basepoint_vertical:=height(p);
@@ -18437,7 +17349,7 @@ if not (dir_orthogonal(dir_primary[box_dir(p)])(dir_primary[dvi_direction]))
end
else begin
effective_vertical:=width(p);
- if not (is_mirrored(box_dir(p))) then
+ if not is_mirrored(box_dir(p)) then
if dir_eq(dir_primary[box_dir(p)])(dir_secondary[dvi_direction]) then
basepoint_horizontal:=height(p)
else
@@ -18454,68 +17366,39 @@ else begin
end;
basepoint_horizontal := basepoint_horizontal + shift_amount(p);
if list_ptr(p)=null then begin
- cur_v:=cur_v+effective_vertical;
+ cur.v:=cur.v+effective_vertical;
+ @<Record void list {\sl Sync\TeX} information@>;
end
else begin
- edge_v:=cur_v;
- cur_h:=left_edge + basepoint_horizontal;
- cur_v:=cur_v + basepoint_vertical;
+ edge_v:=cur.v;
+ cur.h:=left_edge + basepoint_horizontal;
+ cur.v:=cur.v + basepoint_vertical;
+ synch_pos_with_cur;
+ save_box_pos:=box_pos;
temp_ptr:=p;
if type(p)=vlist_node then pdf_vlist_out@+else pdf_hlist_out;
- cur_h:=left_edge; cur_v:=edge_v + effective_vertical;
+ box_pos:=save_box_pos;
+ cur.h:=left_edge; cur.v:=edge_v + effective_vertical;
end
end
@ @<(\pdfTeX) Output a rule in a vlist...@>=
if is_running(rule_wd) then rule_wd:=width(this_box);
rule_ht:=rule_ht+rule_dp; {this is the rule thickness}
-cur_v:=cur_v+rule_ht;
-if (rule_ht>0)and(rule_wd>0) then {we don't output empty rules}
- begin
- case font_direction(dvi_direction) of
- dir__LT: begin
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- {|pdf_dvicmd_left(rule_wd);|}
- end;
- dir__LB: begin
- pdf_dvicmd_down(rule_ht);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_left(rule_wd);
- pdf_dvicmd_up(rule_ht);
- end;
- dir__RT: begin
- pdf_dvicmd_left(rule_wd);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_left(rule_wd);
- end;
- dir__RB: begin
- pdf_dvicmd_down(rule_ht);
- pdf_dvicmd_left(rule_wd);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_up(rule_ht);
- end;
- dir__TL: begin
- pdf_dvicmd_down(rule_wd);
- pdf_dvicmd_left(rule_ht);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_up(rule_wd);
- end;
- dir__TR: begin
- pdf_dvicmd_down(rule_wd);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_left(rule_wd);
- pdf_dvicmd_up(rule_wd);
- end;
- dir__BL: begin
- pdf_dvicmd_left(rule_ht);
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- end;
- dir__BR: begin
- pdf_set_rule(cur_h, cur_v, rule_wd, rule_ht);
- pdf_dvicmd_left(rule_wd);
- end;
- end;
+if (rule_ht>0)and(rule_wd>0) then begin {we don't output empty rules}
+ synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: pdf_place_rule(pos.h, pos.v - rule_ht, rule_wd, rule_ht);
+ dir_BL_: pdf_place_rule(pos.h, pos.v, rule_wd, rule_ht);
+ dir_TR_: pdf_place_rule(pos.h - rule_wd, pos.v - rule_ht, rule_wd, rule_ht);
+ dir_BR_: pdf_place_rule(pos.h - rule_wd, pos.v, rule_wd, rule_ht);
+ dir_LT_: pdf_place_rule(pos.h, pos.v - rule_wd, rule_ht, rule_wd);
+ dir_RT_: pdf_place_rule(pos.h - rule_ht, pos.v - rule_wd, rule_ht, rule_wd);
+ dir_LB_: pdf_place_rule(pos.h, pos.v, rule_ht, rule_wd);
+ dir_RB_: pdf_place_rule(pos.h - rule_ht, pos.v, rule_ht, rule_wd);
end;
+ cur.v := cur.v + rule_ht;
+end;
goto next_p
@ @<(\pdfTeX) Move down or output leaders@>=
@@ -18551,29 +17434,32 @@ if type(leader_box)=rule_node then
leader_ht:=height(leader_box)+depth(leader_box);
if (leader_ht>0)and(rule_ht>0) then
begin rule_ht:=rule_ht+10; {compensate for floating-point rounding}
- edge:=cur_v+rule_ht; lx:=0;
- @<Let |cur_v| be the position of the first box, and set |leader_ht+lx|
+ edge:=cur.v+rule_ht; lx:=0;
+ @<Let |cur.v| be the position of the first box, and set |leader_ht+lx|
to the spacing between corresponding parts of boxes@>;
- while cur_v+leader_ht<=edge do
- @<(\pdfTeX) Output a leader box at |cur_v|,
- then advance |cur_v| by |leader_ht+lx|@>;
- cur_v:=edge-10; goto next_p;
+ while cur.v+leader_ht<=edge do
+ @<(\pdfTeX) Output a leader box at |cur.v|,
+ then advance |cur.v| by |leader_ht+lx|@>;
+ cur.v:=edge-10; goto next_p;
end;
end
-@ @<(\pdfTeX) Output a leader box at |cur_v|, ...@>=
-begin cur_h:=left_edge+shift_amount(leader_box);
-cur_v:=cur_v+height(leader_box); save_v:=cur_v;
+@ @<(\pdfTeX) Output a leader box at |cur.v|, ...@>=
+begin cur.h:=left_edge+shift_amount(leader_box);
+cur.v:=cur.v+height(leader_box); save_v:=cur.v;
+synch_pos_with_cur;
+save_box_pos:=box_pos;
temp_ptr:=leader_box;
outer_doing_leaders:=doing_leaders; doing_leaders:=true;
if type(leader_box)=vlist_node then pdf_vlist_out@+else pdf_hlist_out;
doing_leaders:=outer_doing_leaders;
-cur_h:=left_edge;
-cur_v:=save_v-height(leader_box)+leader_ht+lx;
+box_pos:=save_box_pos;
+cur.h:=left_edge;
+cur.v:=save_v-height(leader_box)+leader_ht+lx;
end
-@ |fix_pdfoutput| freezes |pdfoutput| when something has been written to
-the output.
+@ |fix_pdfoutput| freezes |fixed_pdfoutput| as soon as anything has been written
+to the output file, be it \.{PDF} or \.{DVI}.
@p procedure fix_pdfoutput;
begin
@@ -18584,25 +17470,6 @@ begin
else if fixed_pdfoutput <> pdf_output then
pdf_error("setup",
"\pdfoutput can only be changed before anything is written to the output");
- if fixed_pdfoutput_set then fix_pdf_draftmode;
-end;
-
-@ |fix_pdf_draftmode| freezes |pdfdraftmode| when something has been written to
-the output and also switches somes things off when draftmode is on.
-@p procedure fix_pdf_draftmode;
-begin
- if not fixed_pdf_draftmode_set then begin
- fixed_pdf_draftmode := pdf_draftmode;
- fixed_pdf_draftmode_set := true;
- end
- else if fixed_pdf_draftmode <> pdf_draftmode then
- pdf_error("setup",
- "\pdfdraftmode can only be changed before anything is written to the output");
- if fixed_pdf_draftmode_set and fixed_pdf_draftmode > 0 then begin
- fixed_pdf_draftmode_set := true;
- pdf_compress_level := 0;
- fixed_pdf_objcompresslevel := 0;
- end;
end;
@ |pdf_ship_out| is used instead of |ship_out| to shipout a box to PDF
@@ -18618,23 +17485,23 @@ save_ximage_list: pointer; {to save |pdf_ximage_list|}
save_xform_list: pointer; {to save |pdf_xform_list|}
save_image_procset: integer; {to save |pdf_image_procset|}
save_text_procset: integer; {to save |pdf_text_procset|}
-save_cur_page_height: scaled; {to save |cur_page_height| during flushing pending forms}
+save_cur_page_size: scaledpos; {to save |cur_page_size| during flushing pending forms}
+form_margin: scaled;
pdf_last_resources: integer; {pointer to most recently generated Resources object}
pre_callback_id:integer;
post_callback_id:integer;
ret:boolean;
-begin
-pre_callback_id:=callback_defined(start_page_number_callback);
-post_callback_id:=callback_defined(stop_page_number_callback);
+begin
+@<Start sheet {\sl Sync\TeX} information record@>;
+form_margin := one_bp;
+pre_callback_id:=callback_defined(start_page_number_callback);
+post_callback_id:=callback_defined(stop_page_number_callback);
if (tracing_output>0)and(pre_callback_id=0) then
begin print_nl(""); print_ln;
print("Completed box being shipped out");
@.Completed box...@>
end;
-if not init_pdf_output then begin
- @<Initialize variables for \.{PDF} output@>;
- init_pdf_output := true;
-end;
+check_pdfminorversion;
is_shipping_page := shipping_page;
if shipping_page then begin
if pre_callback_id>0 then
@@ -18651,8 +17518,8 @@ if shipping_page then begin
end;
update_terminal;
end;
-if (tracing_output>0)and(post_callback_id=0) then
- begin if shipping_page then print_char("]");
+if (tracing_output>0)and(post_callback_id=0)and shipping_page then
+ begin print_char("]");
begin_diagnostic; show_box(p); end_diagnostic(true);
end;
@<(\pdfTeX) Ship box |p| out@>;
@@ -18663,6 +17530,7 @@ update_terminal; {progress report}
@<Flush the box from memory, showing statistics if requested@>;
if post_callback_id>0 then
ret:=run_callback(post_callback_id,'->');
+@<Finish sheet {\sl Sync\TeX} information record@>;
end;
@ @<(\pdfTeX) Ship box |p| out@>=
@@ -18677,9 +17545,12 @@ cur_s:=-1;
done:
@ @<Initialize variables as |pdf_ship_out| begins@>=
-fix_pdfoutput;
-temp_ptr:=p;
prepare_mag;
+if mag<>1000 then
+ one_true_inch:=xn_over_d(one_hundred_inch,10,mag)
+else
+ one_true_inch:=one_inch;
+temp_ptr:=p;
pdf_last_resources := pdf_new_objnum;
@<Reset resource lists@>;
dvi_direction:=page_direction;
@@ -18691,7 +17562,7 @@ if not shipping_page then begin
end
else begin
pdf_last_page := get_obj(obj_type_page, total_pages + 1, 0);
- obj_aux(pdf_last_page) := 1; {mark that this page has beed created}
+ obj_aux(pdf_last_page) := 1; {mark that this page has been created}
pdf_new_dict(obj_type_others, 0, 0);
pdf_last_stream := obj_ptr;
@<Reset PDF mark lists@>;
@@ -18715,39 +17586,92 @@ last_thread := null
@ @<Calculate PDF page dimensions and margins@>=
if is_shipping_page then begin
- if page_width > 0 then
- cur_page_width := page_width
- else
- cur_page_width := width(p) + 2 * pdf_h_offset;
- if page_height > 0 then
- cur_page_height := page_height
- else
- cur_page_height := height(p) + depth(p) + 2 * pdf_v_offset;
- if page_bottom_offset <> 0 then
- cur_bottom_offset := page_bottom_offset
- else
- cur_bottom_offset := one_inch;
- if page_right_offset <> 0 then
- cur_right_offset := page_right_offset
- else
- cur_right_offset := one_inch;
- cur_h := pdf_h_offset;
- cur_v := height(p) + pdf_v_offset;
+ @<Calculate DVI page dimensions and margins@>;
+ {Think in upright page/paper coordinates): First preset |pos.h| and |pos.v| to the DVI origin.}
+ pos.h := pdf_h_origin;
+ pos.v := cur_page_size.v - pdf_v_origin;
+ box_pos := pos;
+ {Then calculate |cur.h| and |cur.v| within the upright coordinate system
+ for the DVI origin depending on the |page_direction|.}
+ dvi_direction:=page_direction;
case box_direction(dvi_direction) of
- dir_TL_,dir_LT_: begin end;
- dir_TR_,dir_RT_: begin cur_h:=cur_page_width-cur_right_offset; end;
- dir_RB_,dir_BR_: begin cur_h:=cur_page_width-cur_right_offset; cur_v:=-cur_bottom_offset; end;
- dir_BL_,dir_LB_: begin cur_v:=-cur_bottom_offset; end;
+ dir_TL_,dir_LT_: begin
+ cur.h := page_left_offset;
+ cur.v := page_top_offset;
+ end;
+ dir_TR_,dir_RT_: begin
+ cur.h := cur_page_size.h - page_right_offset;
+ cur.v := page_top_offset;
+ end;
+ dir_BL_,dir_LB_: begin
+ cur.h := page_left_offset;
+ cur.v := cur_page_size.v - page_bottom_offset;
+ end;
+ dir_RB_,dir_BR_: begin
+ cur.h := cur_page_size.h - page_right_offset;
+ cur.v := cur_page_size.v - page_bottom_offset;
+ end;
end;
+ cur.h := cur.h - one_true_inch; {correct for DVI origin}
+ cur.v := cur.v - one_true_inch;
+ {The movement is actually done within the upright page coordinate system.}
+ dvi_direction := dir_TL_; {only temporarily for this adjustment}
+ synch_pos_with_cur; box_pos := pos; {keep track on page}
+ {Then switch to page box coordinate system; do |height(p)| movement.}
+ dvi_direction := page_direction;
+ cur.h := 0;
+ cur.v := height(p);
+ synch_pos_with_cur;
+ {Now we are at the point on the page where the origin of the page box should go.}
end
else begin
- cur_page_width := width(p);
- cur_page_height := height(p) + depth(p);
- cur_h := 0;
- cur_v := height(p);
+ dvi_direction:=box_dir(p);
+ case box_direction(dvi_direction) of
+ dir_TL_,dir_TR_,dir_BL_,dir_BR_: begin
+ cur_page_size.h := width(p);
+ cur_page_size.v := height(p) + depth(p);
+ end;
+ dir_LT_,dir_RT_,dir_LB_,dir_RB_: begin
+ cur_page_size.h := height(p) + depth(p);
+ cur_page_size.v := width(p);
+ end;
+ end;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
+ pos.h := 0;
+ pos.v := depth(p);
+ end;
+ dir_TR_: begin
+ pos.h := width(p);
+ pos.v := depth(p);
+ end;
+ dir_BL_: begin
+ pos.h := 0;
+ pos.v := height(p);
+ end;
+ dir_BR_: begin
+ pos.h := width(p);
+ pos.v := height(p);
+ end;
+ dir_LT_: begin
+ pos.h := height(p);
+ pos.v := width(p);
+ end;
+ dir_RT_: begin
+ pos.h := depth(p);
+ pos.v := width(p);
+ end;
+ dir_LB_: begin
+ pos.h := height(p);
+ pos.v := 0;
+ end;
+ dir_RB_: begin
+ pos.h := depth(p);
+ pos.v := 0;
+ end;
+ end;
end;
-pdf_origin_h := 0;
-pdf_origin_v := cur_page_height;
+pdf_page_init;
@ Here we write out the header for Form.
@@ -18759,9 +17683,10 @@ if obj_xform_attr(pdf_cur_form) <> null then begin
delete_toks(obj_xform_attr(pdf_cur_form));
end;
pdf_print("/BBox [");
-pdf_print("0 0 ");
-pdf_print_bp(cur_page_width); pdf_out(" ");
-pdf_print_bp(cur_page_height); pdf_print_ln("]");
+pdf_print_bp(-form_margin); pdf_print(" ");
+pdf_print_bp(-form_margin); pdf_print(" ");
+pdf_print_bp(cur_page_size.h + form_margin); pdf_out(" ");
+pdf_print_bp(cur_page_size.v + form_margin); pdf_print_ln("]");
pdf_print_ln("/FormType 1");
pdf_print_ln("/Matrix [1 0 0 1 0 0]");
pdf_indirect_ln("Resources", pdf_last_resources)
@@ -18801,7 +17726,7 @@ if shipping_page then begin
end
@ @<Finish stream of page/form contents@>=
-pdf_end_text;
+pdf_goto_pagemode;
pdfshipoutend(shipping_page);
pdf_end_stream
@@ -18906,26 +17831,26 @@ pdf_print_ln(" ]")
@ @<Write out page object@>=
pdf_begin_dict(pdf_last_page, 1);
+pdf_last_pages := pdf_do_page_divert(pdf_last_page, page_divert_val);
pdf_print_ln("/Type /Page");
pdf_indirect_ln("Contents", pdf_last_stream);
pdf_indirect_ln("Resources", pdf_last_resources);
pdf_print("/MediaBox [0 0 ");
-pdf_print_mag_bp(cur_page_width); pdf_out(" ");
-pdf_print_mag_bp(cur_page_height);
+pdf_print_mag_bp(cur_page_size.h); pdf_out(" ");
+pdf_print_mag_bp(cur_page_size.v);
pdf_print_ln("]");
if pdf_page_attr <> null then
pdf_print_toks_ln(pdf_page_attr);
-@<Generate parent pages object@>;
+pdf_indirect_ln("Parent", pdf_last_pages);
+if pdf_page_group_val > 0 then begin
+ pdf_print("/Group ");
+ pdf_print_int(pdf_page_group_val);
+ pdf_print_ln(" 0 R");
+ pdf_page_group_val := -1;
+end;
@<Generate array of annotations or beads in page@>;
pdf_end_dict
-@ @<Generate parent pages object@>=
-if total_pages mod pages_tree_kids_max = 1 then begin
- pdf_create_obj(obj_type_pages, pages_tree_kids_max);
- pdf_last_pages := obj_ptr;
-end;
-pdf_indirect_ln("Parent", pdf_last_pages)
-
@ @<Generate array of annotations or beads in page@>=
if (pdf_annot_list <> null) or (pdf_link_list <> null) then begin
pdf_print("/Annots [ ");
@@ -18964,7 +17889,7 @@ var s: str_number;
file_opened:boolean;
k:integer;
res:boolean;
- fnam: str_number;
+ fnam: str_number;
callback_id:integer;
begin
s := tokens_to_string(obj_obj_data(n));
@@ -18982,14 +17907,14 @@ begin
if obj_obj_is_file(n) > 0 then begin
data_size:=0; data_cur:=0; data_buffer:=0;
pack_file_name(s,"","");
- callback_id:=callback_defined(find_data_file_callback);
- if callback_id>0 then begin
- res := run_callback(callback_id,'S->s',stringcast(nameoffile+1),addressof(fnam));
- if (res)and(fnam<>0)and(length(fnam)>0) then begin
- @<Fixup |nameoffile| after callback@>;
- end;
+ callback_id:=callback_defined(find_data_file_callback);
+ if callback_id>0 then begin
+ res := run_callback(callback_id,'S->s',stringcast(nameoffile+1),addressof(fnam));
+ if (res)and(fnam<>0)and(length(fnam)>0) then begin
+ @<Fixup |nameoffile| after callback@>;
+ end;
end;
- callback_id:=callback_defined(read_data_file_callback);
+ callback_id:=callback_defined(read_data_file_callback);
if callback_id>0 then begin
file_opened := false;
res := run_callback(callback_id,'S->bSd',stringcast(nameoffile+1),
@@ -19010,7 +17935,7 @@ begin
pdf_out(data_buffer[data_cur]);
incr(data_cur);
end;
- if data_buffer<>0 then libcfree(data_buffer);
+ if data_buffer<>0 then libcfree(data_buffer);
print(">>");
end
else if obj_obj_is_stream(n) > 0 then
@@ -19037,7 +17962,7 @@ end
@ When flushing pending forms we need to save and restore resource lists
(|pdf_font_list|, |pdf_obj_list|, |pdf_xform_list| and |pdf_ximage_list|),
which are also used by page shipping.
-Saving and restoring |cur_page_height| is needed for proper
+Saving and restoring |cur_page_size| is needed for proper
writing out pending PDF marks.
@<Write out pending forms@>=
@@ -19048,9 +17973,9 @@ if pdf_xform_list <> null then begin
pdf_cur_form := info(k);
@<Save resource lists@>;
@<Reset resource lists@>;
- save_cur_page_height := cur_page_height;
+ save_cur_page_size := cur_page_size;
pdf_ship_out(obj_xform_box(pdf_cur_form), false);
- cur_page_height := save_cur_page_height;
+ cur_page_size := save_cur_page_size;
@<Restore resource lists@>;
end;
k := link(k);
@@ -19091,8 +18016,6 @@ if pdf_ximage_list <> null then begin
end
@ @<Write out pending PDF marks@>=
-pdf_origin_h := 0;
-pdf_origin_v := cur_page_height;
@<Write out PDF annotations@>;
@<Write out PDF link annotations@>;
@<Write out PDF mark destinations@>;
@@ -19106,7 +18029,7 @@ if pdf_annot_list <> null then begin
pdf_begin_dict(info(k), 1);
pdf_print_ln("/Type /Annot");
pdf_print_toks_ln(pdf_annot_data(i));
- pdf_rectangle(pdf_left(i), pdf_top(i), pdf_right(i), pdf_bottom(i));
+ pdf_rectangle(i);
pdf_end_dict;
k := link(k);
end;
@@ -19119,14 +18042,13 @@ while k <> null do begin
i := obj_annot_ptr(info(k));
pdf_begin_dict(info(k), 1);
pdf_print_ln("/Type /Annot");
+ if pdf_action_type(pdf_link_action(i)) <> pdf_action_user then
+ pdf_print_ln("/Subtype /Link");
if pdf_link_attr(i) <> null then
pdf_print_toks_ln(pdf_link_attr(i));
- pdf_rectangle(pdf_left(i), pdf_top(i), pdf_right(i), pdf_bottom(i));
- if pdf_action_type(pdf_link_action(i)) <> pdf_action_user
- then begin
- pdf_print_ln("/Subtype /Link");
+ pdf_rectangle(i);
+ if pdf_action_type(pdf_link_action(i)) <> pdf_action_user then
pdf_print("/A ");
- end;
write_action(pdf_link_action(i));
pdf_end_dict;
k := link(k);
@@ -19164,8 +18086,8 @@ if pdf_dest_list <> null then begin
case pdf_dest_type(i) of
pdf_dest_xyz: begin
pdf_print("/XYZ ");
- pdf_print_mag_bp(pdf_x(pdf_left(i))); pdf_out(" ");
- pdf_print_mag_bp(pdf_y(pdf_top(i))); pdf_out(" ");
+ pdf_print_mag_bp(pdf_ann_left(i)); pdf_out(" ");
+ pdf_print_mag_bp(pdf_ann_top(i)); pdf_out(" ");
if pdf_dest_xyz_zoom(i) = null then
pdf_print("null")
else begin
@@ -19178,21 +18100,21 @@ if pdf_dest_list <> null then begin
pdf_print("/Fit");
pdf_dest_fith: begin
pdf_print("/FitH ");
- pdf_print_mag_bp(pdf_y(pdf_top(i)));
+ pdf_print_mag_bp(pdf_ann_top(i));
end;
pdf_dest_fitv: begin
pdf_print("/FitV ");
- pdf_print_mag_bp(pdf_x(pdf_left(i)));
+ pdf_print_mag_bp(pdf_ann_left(i));
end;
pdf_dest_fitb:
pdf_print("/FitB");
pdf_dest_fitbh: begin
pdf_print("/FitBH ");
- pdf_print_mag_bp(pdf_y(pdf_top(i)));
+ pdf_print_mag_bp(pdf_ann_top(i));
end;
pdf_dest_fitbv: begin
pdf_print("/FitBV ");
- pdf_print_mag_bp(pdf_x(pdf_left(i)));
+ pdf_print_mag_bp(pdf_ann_left(i));
end;
pdf_dest_fitr: begin
pdf_print("/FitR ");
@@ -19213,13 +18135,21 @@ end
@ @<Declare procedures needed in |pdf_hlist_out|, |pdf_vlist_out|@>=
procedure pdf_print_rect_spec(r: pointer); {prints a rect spec}
begin
- pdf_print_mag_bp(pdf_x(pdf_left(r)));
+ pdf_print_mag_bp(pdf_ann_left(r));
pdf_out(" ");
- pdf_print_mag_bp(pdf_y(pdf_bottom(r)));
+ pdf_print_mag_bp(pdf_ann_bottom(r));
pdf_out(" ");
- pdf_print_mag_bp(pdf_x(pdf_right(r)));
+ pdf_print_mag_bp(pdf_ann_right(r));
pdf_out(" ");
- pdf_print_mag_bp(pdf_y(pdf_top(r)));
+ pdf_print_mag_bp(pdf_ann_top(r));
+end;
+
+procedure pdf_rectangle(r:pointer); {output a rectangle specification to PDF file}
+begin
+ prepare_mag;
+ pdf_print("/Rect [");
+ pdf_print_rect_spec(r);
+ pdf_print_ln("]");
end;
@ @<Write out PDF bead rectangle specifications@>=
@@ -19333,31 +18263,6 @@ begin
dvi_ship_out(p);
end;
-@ @<Initialize variables for \.{PDF} output@>=
-check_pdfminorversion;
-prepare_mag;
-fixed_decimal_digits := fix_int(pdf_decimal_digits, 0, 4);
-min_bp_val :=
- divide_scaled(one_hundred_bp, ten_pow[fixed_decimal_digits + 2], 0);
-if pdf_pk_resolution = 0 then {if not set from format file or by user}
- pdf_pk_resolution := pk_dpi; {take it from \.{texmf.cnf}}
-fixed_pk_resolution := fix_int(pdf_pk_resolution, 72, 8000);
-pk_scale_factor :=
- divide_scaled(72, fixed_pk_resolution, 5 + fixed_decimal_digits);
-if not callback_defined(read_pk_file_callback) then begin
- if pdf_pk_mode <> null then begin
- kpseinitprog('PDFTEX', fixed_pk_resolution,
- makecstring(tokens_to_string(pdf_pk_mode)), nil);
- flush_string;
- end else
- kpseinitprog('PDFTEX', fixed_pk_resolution, nil, nil);
- if not kpsevarvalue('MKTEXPK') then
- kpsesetprogramenabled (kpsepkformat, 1, kpsesrccmdline);
- end;
-set_job_id(year, month, day, time);
-if (pdf_unique_resname > 0) and (pdf_resname_prefix = 0) then
- pdf_resname_prefix := get_resname_prefix
-
@ Finishing the PDF output file.
The following procedures sort the table of destination names
@@ -19413,53 +18318,48 @@ are already written completely to PDF output file.
@<Finish the PDF file@>=
if total_pages=0 then begin
- if callback_id=0 then
- print_nl("No pages of output.")
+ if callback_id=0 then
+ print_nl("No pages of output.")
else
- res:=run_callback(callback_id,'->');
- @.No pages of output@>
+ res:=run_callback(callback_id,'->');
+ @.No pages of output@>
if pdf_gone > 0 then
garbage_warning;
end
else begin
if fixed_pdf_draftmode = 0 then begin
- pdf_flush; {to make sure that the output file name has been already
- created}
- if total_pages mod pages_tree_kids_max <> 0 then
- obj_info(pdf_last_pages) := total_pages mod pages_tree_kids_max;
- {last pages object may have less than |pages_tree_kids_max| children}
- flush_jbig2_page0_objects; {flush page 0 objects from JBIG2 images, if any}
- @<Check for non-existing pages@>;
- @<Reverse the linked list of Page and Pages objects@>;
- @<Check for non-existing destinations@>;
- @<Output fonts definition@>;
- @<Output pages tree@>;
- @<Output outlines@>;
- @<Output name tree@>;
- @<Output article threads@>;
- @<Output the catalog object@>;
- pdf_print_info; {last candidate for object stream}
- if pdf_os_enable then begin
- pdf_os_switch(true);
- pdf_os_write_objstream;
- pdf_flush;
- pdf_os_switch(false);
- @<Output the cross-reference stream dictionary@>;
+ pdf_flush; {to make sure that the output file name has been already created}
+ flush_jbig2_page0_objects; {flush page 0 objects from JBIG2 images, if any}
+ @<Check for non-existing pages@>;
+ @<Check for non-existing destinations@>;
+ @<Output fonts definition@>;
+ pdf_last_pages := output_pages_tree;
+ @<Output outlines@>;
+ @<Output name tree@>;
+ @<Output article threads@>;
+ @<Output the catalog object@>;
+ pdf_print_info; {last candidate for object stream}
+ if pdf_os_enable then begin
+ pdf_os_switch(true);
+ pdf_os_write_objstream;
+ pdf_flush;
+ pdf_os_switch(false);
+ @<Output the cross-reference stream dictionary@>;
+ pdf_flush;
+ end else begin
+ @<Output the |obj_tab|@>;
+ end;
+ @<Output the trailer@>;
pdf_flush;
- end else begin
- @<Output the |obj_tab|@>;
- end;
- @<Output the trailer@>;
- pdf_flush;
- if callback_id=0 then begin
- print_nl("Output written on "); print_file_name(0, output_file_name, 0);
- @.Output written on x@>
- print(" ("); print_int(total_pages); print(" page");
- if total_pages<>1 then print_char("s");
- print(", "); print_int(pdf_offset); print(" bytes).");
- end
- else
- res:=run_callback(callback_id,'->');
+ if callback_id=0 then begin
+ print_nl("Output written on "); print_file_name(0, output_file_name, 0);
+ @.Output written on x@>
+ print(" ("); print_int(total_pages); print(" page");
+ if total_pages<>1 then print_char("s");
+ print(", "); print_int(pdf_offset); print(" bytes).");
+ end
+ else
+ res:=run_callback(callback_id,'->');
end;
libpdffinish;
if fixed_pdf_draftmode = 0 then b_close(pdf_file)
@@ -19511,27 +18411,6 @@ while obj_aux(k) = 0 do begin
end;
head_tab[obj_type_page] := k
-@ @<Reverse the linked list of Page and Pages objects@>=
-k := head_tab[obj_type_page];
-l := 0;
-repeat
- i := obj_link(k);
- obj_link(k) := l;
- l := k;
- k := i;
-until k = 0;
-head_tab[obj_type_page] := l;
-k := head_tab[obj_type_pages];
-pages_tail := k;
-l := 0;
-repeat
- i := obj_link(k);
- obj_link(k) := l;
- l := k;
- k := i;
-until k = 0;
-head_tab[obj_type_pages] := l
-
@ @<Output fonts definition@>=
for k := 1 to max_font_id do
if font_used(k) and (pdf_font_num(k) < 0) then begin
@@ -19550,7 +18429,9 @@ for k := 1 to max_font_id do
print_font_identifier(i);
print(" and ");
print_font_identifier(k);
- print(" has conflicting attributes"); print_ln; print_ln;
+ print(" have conflicting attributes; I will ignore the attributes assigned to ");
+ print_font_identifier(i);
+ print_ln; print_ln;
end;
end;
fixed_gen_tounicode := pdf_gen_tounicode;
@@ -19563,77 +18444,12 @@ while k <> 0 do begin
end;
write_fontstuff
-@ We will generate in each single step the parents of all Pages/Page objects in
-the previous level. These new generated Pages object will create a new level of
-Pages tree. We will repeat this until search only one Pages object. This one
-will be the Root object.
-
-@<Output pages tree@>=
-a := sys_obj_ptr + 1; {all Pages objects whose children are not Page objects
- should have index greater than |a|}
-l := head_tab[obj_type_pages]; {|l| is the index of current Pages object
- which is being output}
-k := head_tab[obj_type_page]; {|k| is the index of current child of |l|}
-b := 0;
-repeat
- i := 0; {counter of Pages object in current level}
- c := 0; {first Pages object in previous level}
- if obj_link(l) = 0 then
- is_root := true {only Pages object; total pages is
- not greater than |pages_tree_kids_max|}
- else
- is_root := false;
- repeat
- if not is_root then begin
- if i mod pages_tree_kids_max = 0 then begin {create a new Pages object
- for next level}
- pdf_last_pages := pdf_new_objnum;
- if c = 0 then
- c := pdf_last_pages;
- obj_link(pages_tail) := pdf_last_pages;
- pages_tail := pdf_last_pages;
- obj_link(pdf_last_pages) := 0;
- obj_info(pdf_last_pages) := obj_info(l);
- end
- else
- obj_info(pdf_last_pages) := obj_info(pdf_last_pages) +
- obj_info(l);
- end;
- @<Output the current Pages object in this level@>;
- incr(i);
- l := obj_link(l);
- until (l = c);
- b := c;
- if l = 0 then
- goto done;
-until false;
-done:
-
-@ @<Output the current Pages object in this level@>=
-pdf_begin_dict(l, 1);
-pdf_print_ln("/Type /Pages");
-pdf_int_entry_ln("Count", obj_info(l));
-if not is_root then
- pdf_indirect_ln("Parent", pdf_last_pages);
-pdf_print("/Kids [");
-j := 0;
-repeat
- pdf_print_int(k);
- pdf_print(" 0 R ");
- k := obj_link(k);
- incr(j);
-until ((l < a) and (j = obj_info(l))) or
- (k = 0) or ((k = b) and (b <> 0)) or
- (j = pages_tree_kids_max);
-remove_last_space;
-pdf_print_ln("]");
-if k = 0 then begin
- k := head_tab[obj_type_pages];
- head_tab[obj_type_pages] := 0;
+@ @p
+procedure print_pdf_pages_attr;
+begin
+ if pdf_pages_attr <> null then
+ pdf_print_toks_ln(pdf_pages_attr);
end;
-if is_root and (pdf_pages_attr <> null) then
- pdf_print_toks_ln(pdf_pages_attr);
-pdf_end_dict;
@ The name tree is very similiar to Pages tree so its construction should be
certain from Pages tree construction. For intermediate node |obj_info| will be
@@ -19826,7 +18642,7 @@ begin
end;
@ @<Print the Producer key@>=
-pdf_print("/Producer (luaTeX-");
+pdf_print("/Producer (LuaTeX-");
pdf_print_int(luatex_version div 100);
pdf_out(".");
pdf_print_int(luatex_version mod 100);
@@ -19843,21 +18659,25 @@ print_mod_date;
@ @<Glob...@>=
@!pdftex_banner: str_number; {the complete banner}
-@ @<Output the |obj_tab|@>=
+@ @<Build a linked list of free objects@>=
l := 0;
+set_obj_fresh(l); {null object at begin of list of free objects}
for k := 1 to sys_obj_ptr do
- if obj_offset(k) = 0 then begin
+ if not is_obj_written(k) then begin
obj_link(l) := k;
l := k;
end;
-obj_link(l) := 0;
+obj_link(l) := 0
+
+@ @<Output the |obj_tab|@>=
+@<Build a linked list of free objects@>;
pdf_save_offset := pdf_offset;
pdf_print_ln("xref");
pdf_print("0 "); pdf_print_int_ln(obj_ptr + 1);
pdf_print_fw_int(obj_link(0), 10);
pdf_print_ln(" 65535 f ");
for k := 1 to obj_ptr do begin
- if obj_offset(k) = 0 then begin
+ if not is_obj_written(k) then begin
pdf_print_fw_int(obj_link(k), 10);
pdf_print_ln(" 00000 f ");
end
@@ -19869,21 +18689,15 @@ end
@ @<Output the cross-reference stream dictionary@>=
pdf_new_dict(obj_type_others, 0, 0);
-if obj_offset(sys_obj_ptr) > 16777215 then
+if ((obj_offset(sys_obj_ptr)/256) > 16777215) then
+ xref_offset_width := 5
+else if obj_offset(sys_obj_ptr) > 16777215 then
xref_offset_width := 4
else if obj_offset(sys_obj_ptr) > 65535 then
xref_offset_width := 3
-else if obj_offset(sys_obj_ptr) > 255 then
- xref_offset_width := 2
else
- xref_offset_width := 1;
-l := 0;
-for k := 1 to sys_obj_ptr do
- if obj_offset(k) = 0 then begin
- obj_link(l) := k;
- l := k;
- end;
-obj_link(l) := 0;
+ xref_offset_width := 2;
+@<Build a linked list of free objects@>;
pdf_print_ln("/Type /XRef");
pdf_print("/Index [0 ");
pdf_print_int(obj_ptr);
@@ -19902,7 +18716,7 @@ print_ID(output_file_name);
pdf_print_nl;
pdf_begin_stream;
for k := 0 to sys_obj_ptr do begin
- if obj_offset(k) = 0 then begin {a free object}
+ if not is_obj_written(k) then begin {a free object}
pdf_out(0);
pdf_out_bytes(obj_link(k), xref_offset_width);
pdf_out(255);
@@ -20004,26 +18818,26 @@ attr_list:=attr_list_cache;
if three_codes then begin
s:=saved(0);
continue:
- if scan_keyword("attr") then begin
+ if scan_keyword('attr') then begin
scan_register_num; i:=cur_val;
scan_optional_equals;
scan_int; v:=cur_val;
- if (attr_list<>null) and (attr_list=attr_list_cache) then begin
+ if (attr_list<>null) and (attr_list=attr_list_cache) then begin
attr_list:=copy_attribute_list(attr_list_cache);
- add_node_attr_ref(attr_list); {will be used once}
+ add_node_attr_ref(attr_list); {will be used once}
end;
attr_list:=do_set_attribute(attr_list,i,v);
goto continue;
end;
- if scan_keyword("dir") then begin
+ if scan_keyword('dir') then begin
scan_direction; spec_direction:=cur_val;
goto continue;
end;
end;
if attr_list=attr_list_cache then begin add_node_attr_ref(attr_list); end;
-if scan_keyword("to") then spec_code:=exactly
+if scan_keyword('to') then spec_code:=exactly
@.to@>
-else if scan_keyword("spread") then spec_code:=additional
+else if scan_keyword('spread') then spec_code:=additional
@.spread@>
else begin spec_code:=additional; cur_val:=0;
goto found;
@@ -20089,19 +18903,6 @@ location |adjust_tail|.
@!last_leftmost_char: pointer;
@!last_rightmost_char: pointer;
-@ @d cal_margin_kern_var(#) ==
-begin
- character(cp) := character(#);
- font(cp) := font(#);
- do_subst_font(cp, 1000);
- if font(cp) <> font(#) then
- margin_kern_stretch := margin_kern_stretch + left_pw(#) - left_pw(cp);
- font(cp) := font(#);
- do_subst_font(cp, -1000);
- if font(cp) <> font(#) then
- margin_kern_shrink := margin_kern_shrink + left_pw(cp) - left_pw(#);
-end
-
@ @<Glob...@>=
next_char_p:pointer; {pointer to the next char of an implicit kern}
prev_char_p:pointer; {pointer to the previous char of an implicit kern}
@@ -20122,9 +18923,6 @@ font expansion is being used. We define some constants used when calling
@d substituted = 3 {|subtype| of kern nodes that should be substituted}
-@d left_pw(#) == char_pw(#, left_side)
-@d right_pw(#) == char_pw(#, right_side)
-
@p function char_stretch(p:halfword): scaled;
var k: internal_font_number;
dw: scaled;
@@ -20234,7 +19032,7 @@ begin
else begin
{|short_display_n(p, 5);|}
pdf_error("font expansion", "invalid node type");
- return;
+ return;
end;
f := font(r);
ef := get_ef_code(f, character(r));
@@ -20365,7 +19163,7 @@ exit:
if (m = cal_expand_ratio) and (font_expand_ratio <> 0) then begin
font_expand_ratio := fix_int(font_expand_ratio, -1000, 1000);
q := list_ptr(r);
- list_ptr(r):=null; flush_node(r);
+ list_ptr(r):=null; flush_node(r);
r:=hpack(q, w, subst_ex_font);
end;
while dir_ptr<>null do pop_dir_node;
@@ -20374,7 +19172,6 @@ end;
function filtered_hpack(@!p:pointer;@!qt:pointer;@!w:scaled;@!m:small_number;@!grp:integer):pointer;
var q:pointer;
- d:integer; { a direction }
begin
new_hyphenation(p,qt);
call_func(new_ligkern(p,qt)); {don't care about the tail in this case}
@@ -20398,14 +19195,14 @@ begin while is_char_node(p) do
the hbox that will contain~it, then move to the next node@>;
if p<>null then
begin case type(p) of
- hlist_node,vlist_node,rule_node,unset_node:
+ hlist_node_case,vlist_node_case,rule_node_case,unset_node_case:
@<Incorporate box dimensions into the dimensions of
the hbox that will contain~it@>;
- ins_node,mark_node,adjust_node: begin if adjust_tail<>null then
+ ins_node_case,mark_node_case,adjust_node_case: begin if adjust_tail<>null then
@<Transfer node |p| to the adjustment list@>; end;
- whatsit_node:@<Incorporate a whatsit node into an hbox@>;
- glue_node:@<Incorporate glue into the horizontal totals@>;
- margin_kern_node: begin
+ whatsit_node_case:@<Incorporate a whatsit node into an hbox@>;
+ glue_node_case:@<Incorporate glue into the horizontal totals@>;
+ margin_kern_node_case: begin
if m = cal_expand_ratio then begin
f := font(margin_char(p));
do_subst_font(margin_char(p), 1000);
@@ -20425,7 +19222,7 @@ if p<>null then
end;
x := x + width(p);
end;
- kern_node: begin
+ kern_node_case: begin
if subtype(p) = normal then begin
if m = cal_expand_ratio then begin
font_stretch := font_stretch + kern_stretch(p);
@@ -20446,8 +19243,8 @@ if p<>null then
end;
x := x + width(p);
end;
- math_node: x:=x+surround(p);
- disc_node:
+ math_node_case: x:=x+surround(p);
+ disc_node_case:
begin
if m = subst_ex_font then do_subst_font(p, font_expand_ratio);
if vlink(no_break(p))<>null then begin
@@ -20476,7 +19273,7 @@ if (type(p)=hlist_node) or (type(p)=vlist_node) then begin
if (width(p) div 2)-s>h then h:=(width(p) div 2)-s;
if (width(p) div 2)+s>d then d:=(width(p) div 2)+s;
end
- else if (type(p)=hlist_node) and (is_mirrored(hpack_dir)) then begin
+ else if (type(p)=hlist_node) and is_mirrored(hpack_dir) then begin
x:=x+width(p);
s:=shift_amount(p);
if depth(p)-s>h then h:=depth(p)-s;
@@ -20778,12 +19575,12 @@ end;
begin if is_char_node(p) then confusion("vpack")
@:this can't happen vpack}{\quad vpack@>
else case type(p) of
- hlist_node,vlist_node,rule_node,unset_node:
+ hlist_node_case,vlist_node_case,rule_node_case,unset_node_case:
@<Incorporate box dimensions into the dimensions of
the vbox that will contain~it@>;
- whatsit_node:@<Incorporate a whatsit node into a vbox@>;
- glue_node: @<Incorporate glue into the vertical totals@>;
- kern_node: begin x:=x+d+width(p); d:=0;
+ whatsit_node_case:@<Incorporate a whatsit node into a vbox@>;
+ glue_node_case: @<Incorporate glue into the vertical totals@>;
+ kern_node_case: begin x:=x+d+width(p); d:=0;
end;
othercases do_nothing
endcases;
@@ -20798,7 +19595,7 @@ if (type(p)=hlist_node) or (type(p)=vlist_node) then begin
s:=shift_amount(p);
if depth(p)+height(p)+s>w then w:=depth(p)+height(p)+s;
end
- else if (type(p)=hlist_node) and (is_mirrored(box_dir(p))) then begin
+ else if (type(p)=hlist_node) and is_mirrored(box_dir(p)) then begin
x:=x+d+depth(p); d:=height(p);
s:=shift_amount(p);
if width(p)+s>w then w:=width(p)+s;
@@ -20924,10 +19721,10 @@ baselineskip calculation is handled by the |append_to_vlist| routine.
@p procedure append_to_vlist(@!b:pointer);
var d:scaled; {deficiency of space between baselines}
-@!p:pointer; {a new glue specification}
-begin if prev_depth>ignore_depth then
+@!p:pointer; {a new glue node}
+begin if prev_depth>pdf_ignored_dimen then
begin
- if (type(b)=hlist_node) and (is_mirrored(box_dir(b))) then
+ if (type(b)=hlist_node) and is_mirrored(box_dir(b)) then
d:=width(baseline_skip)-prev_depth-depth(b)
else
d:=width(baseline_skip)-prev_depth-height(b);
@@ -20938,1757 +19735,23 @@ begin if prev_depth>ignore_depth then
vlink(tail):=p; tail:=p;
end;
vlink(tail):=b; tail:=b;
-if (type(b)=hlist_node) and (is_mirrored(box_dir(b))) then
+if (type(b)=hlist_node) and is_mirrored(box_dir(b)) then
prev_depth:=height(b)
else
prev_depth:=depth(b);
end;
@* \[34] Data structures for math mode.
-When \TeX\ reads a formula that is enclosed between \.\$'s, it constructs an
-{\sl mlist}, which is essentially a tree structure representing that
-formula. An mlist is a linear sequence of items, but we can regard it as
-a tree structure because mlists can appear within mlists. For example, many
-of the entries can be subscripted or superscripted, and such ``scripts''
-are mlists in their own right.
-
-An entire formula is parsed into such a tree before any of the actual
-typesetting is done, because the current style of type is usually not
-known until the formula has been fully scanned. For example, when the
-formula `\.{\$a+b \\over c+d\$}' is being read, there is no way to tell
-that `\.{a+b}' will be in script size until `\.{\\over}' has appeared.
-
-During the scanning process, each element of the mlist being built is
-classified as a relation, a binary operator, an open parenthesis, etc.,
-or as a construct like `\.{\\sqrt}' that must be built up. This classification
-appears in the mlist data structure.
-
-After a formula has been fully scanned, the mlist is converted to an hlist
-so that it can be incorporated into the surrounding text. This conversion is
-controlled by a recursive procedure that decides all of the appropriate
-styles by a ``top-down'' process starting at the outermost level and working
-in towards the subformulas. The formula is ultimately pasted together using
-combinations of horizontal and vertical boxes, with glue and penalty nodes
-inserted as necessary.
-
-An mlist is represented internally as a linked list consisting chiefly
-of ``noads'' (pronounced ``no-adds''), to distinguish them from the somewhat
-similar ``nodes'' in hlists and vlists. Certain kinds of ordinary nodes are
-allowed to appear in mlists together with the noads; \TeX\ tells the difference
-by means of the |type| field, since a noad's |type| is always greater than
-that of a node. An mlist does not contain character nodes, hlist nodes, vlist
-nodes, math nodes or unset nodes; in particular, each mlist item appears in the
-variable-size part of |mem|, so the |type| field is always present.
-
-@ Each noad is five or more words long. The first word contains the
-|type| and |subtype| and |link| fields that are already so familiar to
-us; the second contains the attribute list pointer, and the third,
-fourth an fifth words are called the noad's |nucleus|, |subscr|, and
-|supscr| fields. (This use of a combined attribute list is temporary.
-Eventually, each of fields need their own list)
-
-Consider, for example, the simple formula `\.{\$x\^2\$}', which would be
-parsed into an mlist containing a single element called an |ord_noad|.
-The |nucleus| of this noad is a representation of `\.x', the |subscr| is
-empty, and the |supscr| is a representation of `\.2'.
-
-The |nucleus|, |subscr|, and |supscr| fields are further broken into
-subfields. If |p| points to a noad, and if |q| is one of its principal
-fields (e.g., |q=subscr(p)|), there are several possibilities for the
-subfields, depending on the |math_type| of |q|.
-
-\yskip\hang|math_type(q)=math_char| means that |fam(q)| refers to one of
-the sixteen font families, and |character(q)| is the number of a character
-within a font of that family, as in a character node.
-
-\yskip\hang|math_type(q)=math_text_char| is similar, but the character is
-unsubscripted and unsuperscripted and it is followed immediately by another
-character from the same font. (This |math_type| setting appears only
-briefly during the processing; it is used to suppress unwanted italic
-corrections.)
-
-\yskip\hang|math_type(q)=empty| indicates a field with no value (the
-corresponding attribute of noad |p| is not present).
-
-\yskip\hang|math_type(q)=sub_box| means that |vinfo(q)| points to a box
-node (either an |hlist_node| or a |vlist_node|) that should be used as the
-value of the field. The |shift_amount| in the subsidiary box node is the
-amount by which that box will be shifted downward.
-
-\yskip\hang|math_type(q)=sub_mlist| means that |vinfo(q)| points to
-an mlist; the mlist must be converted to an hlist in order to obtain
-the value of this field.
-
-\yskip\noindent In the latter case, we might have |vinfo(q)=null|. This
-is not the same as |math_type(q)=empty|; for example, `\.{\$P\_\{\}\$}'
-and `\.{\$P\$}' produce different results (the former will not have the
-``italic correction'' added to the width of |P|, but the ``script skip''
-will be added).
-
-The definitions of subfields given here are a little wasteful of space,
-since a quarterword is being used for the |math_type| although only three
-bits would be needed. However, there are hardly ever many noads present at
-once, since they are soon converted to nodes that take up even more space,
-so we can afford to represent them in whatever way simplifies the
-programming.
-
-I tried exchanging |mcharacter()| and |math_type()| so that a character
-could use the full Unicode range, but for some reason that does not work
-properly. TH
-
-@d noad_size=5 {number of words in a normal noad}
-@d nucleus(#)==#+2 {the |nucleus| field of a noad}
-@d supscr(#)==#+3 {the |supscr| field of a noad}
-@d subscr(#)==#+4 {the |subscr| field of a noad}
-@d math_type==vlink {a |quarterword| in |mem|}
-@d fam(#)==type(#) {a |quarterword| in |mem|}
-@d mcharacter(#)==subtype(#)
-@d math_char=1 {|math_type| when the attribute is simple}
-@d sub_box=2 {|math_type| when the attribute is a box}
-@d sub_mlist=3 {|math_type| when the attribute is a formula}
-@d math_text_char=4 {|math_type| when italic correction is dubious}
-
-@ Each portion of a formula is classified as Ord, Op, Bin, Rel, Ope,
-Clo, Pun, or Inn, for purposes of spacing and line breaking. An
-|ord_noad|, |op_noad|, |bin_noad|, |rel_noad|, |open_noad|, |close_noad|,
-|punct_noad|, or |inner_noad| is used to represent portions of the various
-types. For example, an `\.=' sign in a formula leads to the creation of a
-|rel_noad| whose |nucleus| field is a representation of an equals sign
-(usually |fam=0|, |character=@'75|). A formula preceded by \.{\\mathrel}
-also results in a |rel_noad|. When a |rel_noad| is followed by an
-|op_noad|, say, and possibly separated by one or more ordinary nodes (not
-noads), \TeX\ will insert a penalty node (with the current |rel_penalty|)
-just after the formula that corresponds to the |rel_noad|, unless there
-already was a penalty immediately following; and a ``thick space'' will be
-inserted just before the formula that corresponds to the |op_noad|.
-
-A noad of type |ord_noad|, |op_noad|, \dots, |inner_noad| usually
-has a |subtype=normal|. The only exception is that an |op_noad| might
-have |subtype=limits| or |no_limits|, if the normal positioning of
-limits has been overridden for this operator.
-
-@d ord_noad=unset_node+3 {|type| of a noad classified Ord}
-@d op_noad=ord_noad+1 {|type| of a noad classified Op}
-@d bin_noad=ord_noad+2 {|type| of a noad classified Bin}
-@d rel_noad=ord_noad+3 {|type| of a noad classified Rel}
-@d open_noad=ord_noad+4 {|type| of a noad classified Ope}
-@d close_noad=ord_noad+5 {|type| of a noad classified Clo}
-@d punct_noad=ord_noad+6 {|type| of a noad classified Pun}
-@d inner_noad=ord_noad+7 {|type| of a noad classified Inn}
-@d limits=1 {|subtype| of |op_noad| whose scripts are to be above, below}
-@d no_limits=2 {|subtype| of |op_noad| whose scripts are to be normal}
-
-@ A |radical_noad| is five words long; the fifth word is the |left_delimiter|
-field, which usually represents a square root sign.
-
-A |fraction_noad| is six words long; it has a |right_delimiter| field
-as well as a |left_delimiter|.
-
-Delimiter fields are of type |four_quarters|, and they have four subfields
-called |small_fam|, |small_char|, |large_fam|, |large_char|. These subfields
-represent variable-size delimiters by giving the ``small'' and ``large''
-starting characters, as explained in Chapter~17 of {\sl The \TeX book}.
-@:TeXbook}{\sl The \TeX book@>
-
-A |fraction_noad| is actually quite different from all other noads. Not
-only does it have six words, it has |thickness|, |denominator|, and
-|numerator| fields instead of |nucleus|, |subscr|, and |supscr|. The
-|thickness| is a scaled value that tells how thick to make a fraction
-rule; however, the special value |default_code| is used to stand for the
-|default_rule_thickness| of the current size. The |numerator| and
-|denominator| point to mlists that define a fraction; we always have
-$$\hbox{|math_type(numerator)=math_type(denominator)=sub_mlist|}.$$ The
-|left_delimiter| and |right_delimiter| fields specify delimiters that will
-be placed at the left and right of the fraction. In this way, a
-|fraction_noad| is able to represent all of \TeX's operators \.{\\over},
-\.{\\atop}, \.{\\above}, \.{\\overwithdelims}, \.{\\atopwithdelims}, and
- \.{\\abovewithdelims}.
-
-@d left_delimiter(#)==#+5 {first delimiter field of a noad}
-@d right_delimiter(#)==#+6 {second delimiter field of a fraction noad}
-@d radical_noad=inner_noad+1 {|type| of a noad for square roots}
-@d radical_noad_size=6 {number of |mem| words in a radical noad}
-@d fraction_noad=radical_noad+1 {|type| of a noad for generalized fractions}
-@d fraction_noad_size=7 {number of |mem| words in a fraction noad}
-@d small_fam(#)==vmem(#).qqqq.b0 {|fam| for ``small'' delimiter}
-@d small_char(#)==vmem(#).qqqq.b1 {|character| for ``small'' delimiter}
-@d large_fam(#)==vmem(#).qqqq.b2 {|fam| for ``large'' delimiter}
-@d large_char(#)==vmem(#).qqqq.b3 {|character| for ``large'' delimiter}
-@d thickness(#)==vmem(#+2).sc {|thickness| field in a fraction noad}
-@d default_code==@'10000000000 {denotes |default_rule_thickness|}
-@d numerator==supscr {|numerator| field in a fraction noad}
-@d denominator==subscr {|denominator| field in a fraction noad}
-
-@ The global variable |empty_field| is set up for initialization of empty
-fields in new noads. Similarly, |null_delimiter| is for the initialization
-of delimiter fields.
-
-@<Glob...@>=
-@!empty_field:two_halves;
-@!null_delimiter:four_quarters;
-
-@ @<Set init...@>=
-empty_field.rh:=empty; empty_field.lh:=null;@/
-null_delimiter.b0:=0; null_delimiter.b1:=min_quarterword;@/
-null_delimiter.b2:=0; null_delimiter.b3:=min_quarterword;
-
-@ The |new_noad| function creates an |ord_noad| that is completely null.
-
-@p function new_noad:pointer;
-var p:pointer;
-begin p:=new_node(ord_noad,normal);
-vmem(nucleus(p)).hh:=empty_field;
-vmem(subscr(p)).hh:=empty_field;
-vmem(supscr(p)).hh:=empty_field;
-new_noad:=p;
-end;
-
-@ A few more kinds of noads will complete the set: An |under_noad| has its
-nucleus underlined; an |over_noad| has it overlined. An |accent_noad| places
-an accent over its nucleus; the accent character appears as
-|fam(accent_chr(p))| and |mcharacter(accent_chr(p))|. A |vcenter_noad|
-centers its nucleus vertically with respect to the axis of the formula;
-in such noads we always have |math_type(nucleus(p))=sub_box|.
-
-And finally, we have |left_noad| and |right_noad| types, to implement
-\TeX's \.{\\left} and \.{\\right} as well as \eTeX's \.{\\middle}.
-The |nucleus| of such noads is
-replaced by a |delimiter| field; thus, for example, `\.{\\left(}' produces
-a |left_noad| such that |delimiter(p)| holds the family and character
-codes for all left parentheses. A |left_noad| never appears in an mlist
-except as the first element, and a |right_noad| never appears in an mlist
-except as the last element; furthermore, we either have both a |left_noad|
-and a |right_noad|, or neither one is present. The |subscr| and |supscr|
-fields are always |empty| in a |left_noad| and a |right_noad|.
-
-@d under_noad=fraction_noad+1 {|type| of a noad for underlining}
-@d over_noad=under_noad+1 {|type| of a noad for overlining}
-@d accent_noad=over_noad+1 {|type| of a noad for accented subformulas}
-@d accent_noad_size=6 {number of |mem| words in an accent noad}
-@d accent_chr(#)==#+5 {the |accent_chr| field of an accent noad}
-@d vcenter_noad=accent_noad+1 {|type| of a noad for \.{\\vcenter}}
-@d left_noad=vcenter_noad+1 {|type| of a noad for \.{\\left}}
-@d right_noad=left_noad+1 {|type| of a noad for \.{\\right}}
-@d delimiter==nucleus {|delimiter| field in left and right noads}
-@d middle_noad==1 {|subtype| of right noad representing \.{\\middle}}
-@d scripts_allowed(#)==(type(#)>=ord_noad)and(type(#)<left_noad)
-
-@ Math formulas can also contain instructions like \.{\\textstyle} that
-override \TeX's normal style rules. A |style_node| is inserted into the
-data structure to record such instructions; it is three words long, so it
-is considered a node instead of a noad. The |subtype| is either |display_style|
-or |text_style| or |script_style| or |script_script_style|. The
-second and third words of a |style_node| are not used, but they are
-present because a |choice_node| is converted to a |style_node|.
-
-\TeX\ uses even numbers 0, 2, 4, 6 to encode the basic styles
-|display_style|, \dots, |script_script_style|, and adds~1 to get the
-``cramped'' versions of these styles. This gives a numerical order that
-is backwards from the convention of Appendix~G in {\sl The \TeX book\/};
-i.e., a smaller style has a larger numerical value.
-@:TeXbook}{\sl The \TeX book@>
-
-@d style_node=unset_node+1 {|type| of a style node}
-@d style_node_size=4 {number of words in a style node}
-@d display_style=0 {|subtype| for \.{\\displaystyle}}
-@d text_style=2 {|subtype| for \.{\\textstyle}}
-@d script_style=4 {|subtype| for \.{\\scriptstyle}}
-@d script_script_style=6 {|subtype| for \.{\\scriptscriptstyle}}
-@d cramped=1 {add this to an uncramped style if you want to cramp it}
-
-@p function new_style(@!s:small_number):pointer; {create a style node}
-var p:pointer; {the new node}
-begin p:=new_node(style_node,s);
-new_style:=p;
-end;
-
-@ Finally, the \.{\\mathchoice} primitive creates a |choice_node|, which
-has special subfields |display_mlist|, |text_mlist|, |script_mlist|,
-and |script_script_mlist| pointing to the mlists for each style.
-
-@d choice_node=unset_node+2 {|type| of a choice node}
-@d display_mlist(#)==vinfo(#+2) {mlist to be used in display style}
-@d text_mlist(#)==vlink(#+2) {mlist to be used in text style}
-@d script_mlist(#)==vinfo(#+3) {mlist to be used in script style}
-@d script_script_mlist(#)==vlink(#+3) {mlist to be used in scriptscript style}
-@p function new_choice:pointer; {create a choice node}
-var p:pointer; {the new node}
-begin p:=new_node(choice_node,0); {the |subtype| is not used}
-new_choice:=p;
-end;
-
-@ Let's consider now the previously unwritten part of |show_node_list|
-that displays the things that can only be present in mlists; this
-program illustrates how to access the data structures just defined.
-
-In the context of the following program, |p| points to a node or noad that
-should be displayed, and the current string contains the ``recursion history''
-that leads to this point. The recursion history consists of a dot for each
-outer level in which |p| is subsidiary to some node, or in which |p| is
-subsidiary to the |nucleus| field of some noad; the dot is replaced by
-`\.\_' or `\.\^' or `\./' or `\.\\' if |p| is descended from the |subscr|
-or |supscr| or |denominator| or |numerator| fields of noads. For example,
-the current string would be `\.{.\^.\_/}' if |p| points to the |ord_noad| for
-|x| in the (ridiculous) formula
-`\.{\$\\sqrt\{a\^\{\\mathinner\{b\_\{c\\over x+y\}\}\}\}\$}'.
-
-@<Cases of |show_node_list| that arise...@>=
-style_node:print_style(subtype(p));
-choice_node:@<Display choice node |p|@>;
-ord_noad,op_noad,bin_noad,rel_noad,open_noad,close_noad,punct_noad,inner_noad,
- radical_noad,over_noad,under_noad,vcenter_noad,accent_noad,
- left_noad,right_noad:@<Display normal noad |p|@>;
-fraction_noad:@<Display fraction noad |p|@>;
-
-@ Here are some simple routines used in the display of noads.
-
-@<Declare procedures needed for displaying the elements of mlists@>=
-procedure print_fam_and_char(@!p:pointer); {prints family and character}
-begin print_esc("fam"); print_int(fam(p)); print_char(" ");
-print(qo(mcharacter(p)));
-end;
-@#
-procedure print_delimiter(@!p:pointer); {prints a delimiter as 24-bit hex value}
-{TH: FIX to do: print 48-bit integer where needed!}
-var a:integer; {accumulator}
-begin a:=small_fam(p)*256+qo(small_char(p));
-a:=a*@"1000+large_fam(p)*256+qo(large_char(p));
-if a<0 then print_int(a) {this should never happen}
-else print_hex(a);
-end;
-
-@ The next subroutine will descend to another level of recursion when a
-subsidiary mlist needs to be displayed. The parameter |c| indicates what
-character is to become part of the recursion history. An empty mlist is
-distinguished from a field with |math_type(p)=empty|, because these are
-not equivalent (as explained above).
-@^recursion@>
-
-@<Declare procedures needed for displaying...@>=
-procedure@?show_info; forward;@t\2@>@?{|show_node_list(vinfo(temp_ptr))|}
-procedure print_subsidiary_data(@!p:pointer;@!c:ASCII_code);
- {display a noad field}
-begin if cur_length>=depth_threshold then
- begin if math_type(p)<>empty then print(" []");
- end
-else begin append_char(c); {include |c| in the recursion history}
- temp_ptr:=p; {prepare for |show_info| if recursion is needed}
- case math_type(p) of
- math_char: begin print_ln; print_current_string; print_fam_and_char(p);
- end;
- sub_box: show_info; {recursive call}
- sub_mlist: if vinfo(p)=null then
- begin print_ln; print_current_string; print("{}");
- end
- else show_info; {recursive call}
- othercases do_nothing {|empty|}
- endcases;@/
- flush_char; {remove |c| from the recursion history}
- end;
-end;
-
-@ The inelegant introduction of |show_info| in the code above seems better
-than the alternative of using \PASCAL's strange |forward| declaration for a
-procedure with parameters. The \PASCAL\ convention about dropping parameters
-from a post-|forward| procedure is, frankly, so intolerable to the author
-of \TeX\ that he would rather stoop to communication via a global temporary
-variable. (A similar stoopidity occurred with respect to |hlist_out| and
-|vlist_out| above, and it will occur with respect to |mlist_to_hlist| below.)
-@^Knuth, Donald Ervin@>
-@:PASCAL}{\PASCAL@>
-
-@p procedure show_info; {the reader will kindly forgive this}
-begin show_node_list(vinfo(temp_ptr));
-end;
-
-@ @<Declare procedures needed for displaying...@>=
-procedure print_style(@!c:integer);
-begin case c div 2 of
-0: print_esc("displaystyle"); {|display_style=0|}
-1: print_esc("textstyle"); {|text_style=2|}
-2: print_esc("scriptstyle"); {|script_style=4|}
-3: print_esc("scriptscriptstyle"); {|script_script_style=6|}
-othercases print("Unknown style!")
-endcases;
-end;
-
-@ @<Display choice node |p|@>=
-begin print_esc("mathchoice");
-append_char("D"); show_node_list(display_mlist(p)); flush_char;
-append_char("T"); show_node_list(text_mlist(p)); flush_char;
-append_char("S"); show_node_list(script_mlist(p)); flush_char;
-append_char("s"); show_node_list(script_script_mlist(p)); flush_char;
-end
-
-@ @<Display normal noad |p|@>=
-begin case type(p) of
-ord_noad: print_esc("mathord");
-op_noad: print_esc("mathop");
-bin_noad: print_esc("mathbin");
-rel_noad: print_esc("mathrel");
-open_noad: print_esc("mathopen");
-close_noad: print_esc("mathclose");
-punct_noad: print_esc("mathpunct");
-inner_noad: print_esc("mathinner");
-over_noad: print_esc("overline");
-under_noad: print_esc("underline");
-vcenter_noad: print_esc("vcenter");
-radical_noad: begin
- {TH: TODO print oradical where needed and fix otherwise}
- print_esc("radical"); print_delimiter(left_delimiter(p));
- end;
-accent_noad: begin print_esc("accent"); print_fam_and_char(accent_chr(p));
- end;
-left_noad: begin print_esc("left"); print_delimiter(nucleus(p));
- end;
-right_noad: begin if subtype(p)=normal then print_esc("right")
- else print_esc("middle");
- print_delimiter(nucleus(p));
- end;
-end;
-if type(p)<left_noad then
- begin if subtype(p)<>normal then
- if subtype(p)=limits then print_esc("limits")
- else print_esc("nolimits");
- print_subsidiary_data(nucleus(p),".");
- end;
-print_subsidiary_data(supscr(p),"^");
-print_subsidiary_data(subscr(p),"_");
-end
-
-@ @<Display fraction noad |p|@>=
-begin print_esc("fraction, thickness ");
-if thickness(p)=default_code then print("= default")
-else print_scaled(thickness(p));
-if (small_fam(left_delimiter(p))<>0)or@+
- (small_char(left_delimiter(p))<>min_quarterword)or@|
- (large_fam(left_delimiter(p))<>0)or@|
- (large_char(left_delimiter(p))<>min_quarterword) then
- begin print(", left-delimiter "); print_delimiter(left_delimiter(p));
- end;
-if (small_fam(right_delimiter(p))<>0)or@|
- (small_char(right_delimiter(p))<>min_quarterword)or@|
- (large_fam(right_delimiter(p))<>0)or@|
- (large_char(right_delimiter(p))<>min_quarterword) then
- begin print(", right-delimiter "); print_delimiter(right_delimiter(p));
- end;
-print_subsidiary_data(numerator(p),"\");
-print_subsidiary_data(denominator(p),"/");
-end
+Is done in C.
@* \[35] Subroutines for math mode.
-In order to convert mlists to hlists, i.e., noads to nodes, we need several
-subroutines that are conveniently dealt with now.
-
-Let us first introduce the macros that make it easy to get at the parameters and
-other font information. A size code, which is a multiple of 16, is added to a
-family number to get an index into the table of internal font numbers
-for each combination of family and size. (Be alert: Size codes get
-larger as the type gets smaller.)
-
-@<Basic printing procedures@>=
-procedure print_size(@!s:integer);
-begin if s=0 then print_esc("textfont")
-else if s=script_size then print_esc("scriptfont")
-else print_esc("scriptscriptfont");
-end;
-
-@ Before an mlist is converted to an hlist, \TeX\ makes sure that
-the fonts in family~2 have enough parameters to be math-symbol
-fonts, and that the fonts in family~3 have enough parameters to be
-math-extension fonts. The math-symbol parameters are referred to by using the
-following macros, which take a size code as their parameter; for example,
-|num1(cur_size)| gives the value of the |num1| parameter for the current size.
-@^parameters for symbols@>
-@^font parameters@>
-
-@d mathsy_end(#)==
-@d mathsy(#)==font_param(fam_fnt(2+cur_size),#) mathsy_end
-@d math_x_height==mathsy(5) {height of `\.x'}
-@d math_quad==mathsy(6) {\.{18mu}}
-@d num1==mathsy(8) {numerator shift-up in display styles}
-@d num2==mathsy(9) {numerator shift-up in non-display, non-\.{\\atop}}
-@d num3==mathsy(10) {numerator shift-up in non-display \.{\\atop}}
-@d denom1==mathsy(11) {denominator shift-down in display styles}
-@d denom2==mathsy(12) {denominator shift-down in non-display styles}
-@d sup1==mathsy(13) {superscript shift-up in uncramped display style}
-@d sup2==mathsy(14) {superscript shift-up in uncramped non-display}
-@d sup3==mathsy(15) {superscript shift-up in cramped styles}
-@d sub1==mathsy(16) {subscript shift-down if superscript is absent}
-@d sub2==mathsy(17) {subscript shift-down if superscript is present}
-@d sup_drop==mathsy(18) {superscript baseline below top of large box}
-@d sub_drop==mathsy(19) {subscript baseline below bottom of large box}
-@d delim1==mathsy(20) {size of \.{\\atopwithdelims} delimiters
- in display styles}
-@d delim2==mathsy(21) {size of \.{\\atopwithdelims} delimiters in non-displays}
-@d axis_height==mathsy(22) {height of fraction lines above the baseline}
-@d total_mathsy_params=22
-
-@ The math-extension parameters have similar macros, but the size code is
-omitted (since it is always |cur_size| when we refer to such parameters).
-@^parameters for symbols@>
-@^font parameters@>
-
-@d mathex(#)==font_param(fam_fnt(3+cur_size),#)
-@d default_rule_thickness==mathex(8) {thickness of \.{\\over} bars}
-@d big_op_spacing1==mathex(9) {minimum clearance above a displayed op}
-@d big_op_spacing2==mathex(10) {minimum clearance below a displayed op}
-@d big_op_spacing3==mathex(11) {minimum baselineskip above displayed op}
-@d big_op_spacing4==mathex(12) {minimum baselineskip below displayed op}
-@d big_op_spacing5==mathex(13) {padding above and below displayed limits}
-@d total_mathex_params=13
-
-@ We also need to compute the change in style between mlists and their
-subsidiaries. The following macros define the subsidiary style for
-an overlined nucleus (|cramped_style|), for a subscript or a superscript
-(|sub_style| or |sup_style|), or for a numerator or denominator (|num_style|
-or |denom_style|).
-
-@d cramped_style(#)==2*(# div 2)+cramped {cramp the style}
-@d sub_style(#)==2*(# div 4)+script_style+cramped {smaller and cramped}
-@d sup_style(#)==2*(# div 4)+script_style+(# mod 2) {smaller}
-@d num_style(#)==#+2-2*(# div 6) {smaller unless already script-script}
-@d denom_style(#)==2*(# div 2)+cramped+2-2*(# div 6) {smaller, cramped}
-
-@ When the style changes, the following piece of program computes associated
-information:
-
-@<Set up the values of |cur_size| and |cur_mu|, based on |cur_style|@>=
-begin if cur_style<script_style then cur_size:=text_size
-else cur_size:=script_size*((cur_style-text_style) div 2);
-cur_mu:=x_over_n(math_quad(cur_size),18);
-end
-
-@ Here is a function that returns a pointer to a rule node having a given
-thickness |t|. The rule will extend horizontally to the boundary of the vlist
-that eventually contains it.
-
-@p function fraction_rule(@!t:scaled):pointer;
- {construct the bar for a fraction}
-var p:pointer; {the new node}
-begin p:=new_rule; rule_dir(p):=math_direction;
-height(p):=t; depth(p):=0; fraction_rule:=p;
-end;
-
-@ The |overbar| function returns a pointer to a vlist box that consists of
-a given box |b|, above which has been placed a kern of height |k| under a
-fraction rule of thickness |t| under additional space of height |t|.
-
-@p function overbar(@!b:pointer;@!k,@!t:scaled):pointer;
-var p,@!q:pointer; {nodes being constructed}
-begin p:=new_kern(k); vlink(p):=b; q:=fraction_rule(t); vlink(q):=p;
-p:=new_kern(t); vlink(p):=q;
-pack_direction:=math_direction; overbar:=vpack(p,natural);
-end;
-
-@ The |var_delimiter| function, which finds or constructs a sufficiently
-large delimiter, is the most interesting of the auxiliary functions that
-currently concern us. Given a pointer |d| to a delimiter field in some noad,
-together with a size code |s| and a vertical distance |v|, this function
-returns a pointer to a box that contains the smallest variant of |d| whose
-height plus depth is |v| or more. (And if no variant is large enough, it
-returns the largest available variant.) In particular, this routine will
-construct arbitrarily large delimiters from extensible components, if
-|d| leads to such characters.
-
-The value returned is a box whose |shift_amount| has been set so that
-the box is vertically centered with respect to the axis in the given size.
-If a built-up symbol is returned, the height of the box before shifting
-will be the height of its topmost component.
-
-@p@t\4@>@<Declare subprocedures for |var_delimiter|@>
-function var_delimiter(@!d:pointer;@!s:integer;@!v:scaled):pointer;
-label found,continue;
-var b:pointer; {the box that will be constructed}
-@!f,@!g: internal_font_number; {best-so-far and tentative font codes}
-@!c,@!x,@!y: integer; {best-so-far and tentative character codes}
-@!cc: integer; { a temporary character code for extensibles }
-@!m,@!n: integer; {the number of extensible pieces}
-@!u: scaled; {height-plus-depth of a tentative character}
-@!w: scaled; {largest height-plus-depth so far}
-@!z: integer; {runs through font family members}
-@!large_attempt: boolean; {are we trying the ``large'' variant?}
-begin f:=null_font; c:=0; w:=0; large_attempt:=false;
-z:=small_fam(d); x:=small_char(d);
-loop@+ begin @<Look at the variants of |(z,x)|; set |f| and |c| whenever
- a better character is found; |goto found| as soon as a
- large enough variant is encountered@>;
- if large_attempt then goto found; {there were none large enough}
- large_attempt:=true; z:=large_fam(d); x:=large_char(d);
- end;
-found: if f<>null_font then
- @<Make variable |b| point to a box for |(f,c)|@>
-else begin b:=new_null_box;
- width(b):=null_delimiter_space; {use this width if no delimiter was found}
- end;
-z:=cur_size; cur_size:=s;
-shift_amount(b):=half(height(b)-depth(b)) - axis_height(cur_size);
-cur_size:=z;
-var_delimiter:=b;
-end;
-
-@ The search process is complicated slightly by the facts that some of the
-characters might not be present in some of the fonts, and they might not
-be probed in increasing order of height.
-
-@<Look at the variants of |(z,x)|; set |f| and |c|...@>=
-if (z<>0)or(x<>min_quarterword) then
- begin z:=z+s+script_size;
- repeat z:=z-script_size; g:=fam_fnt(z);
- if g<>null_font then
- @<Look at the list of characters starting with |x| in
- font |g|; set |f| and |c| whenever
- a better character is found; |goto found| as soon as a
- large enough variant is encountered@>;
- until z<script_size;
- end
-
-@ @<Look at the list of characters starting with |x|...@>=
-begin y:=x;
-if (y>=font_bc(g))and(y<=font_ec(g)) then
- begin continue:
- if char_exists(g,y) then
- begin if char_tag(g,y)=ext_tag then
- begin f:=g; c:=y; goto found;
- end;
- u:=char_height(g,y)+char_depth(g,y);
- if u>w then
- begin f:=g; c:=y; w:=u;
- if u>=v then goto found;
- end;
- if char_tag(g,y)=list_tag then
- begin y:=char_remainder(g,y); goto continue;
- end;
- end;
- end;
-end
-
-@ Here is a subroutine that creates a new box, whose list contains a
-single character, and whose width includes the italic correction for
-that character. The height or depth of the box will be negative, if
-the height or depth of the character is negative; thus, this routine
-may deliver a slightly different result than |hpack| would produce.
-
-@<Declare subprocedures for |var_delimiter|@>=
-function char_box(@!f:internal_font_number;@!c:quarterword):pointer;
-var @!b,@!p:pointer; {the new box and its character node}
-begin
-b:=new_null_box; ci:=char_info_short(f,c);
-width(b):=charinfo_width(ci)+char_italic(f,c);
-height(b):=charinfo_height(ci); depth(b):=charinfo_depth(ci);
-p:=new_char(f,c); list_ptr(b):=p; char_box:=b;
-end;
-
-@ When the following code is executed, |char_tag(q)| will be equal to
-|ext_tag| if and only if a built-up symbol is supposed to be returned.
-
-@<Make variable |b| point to a box for |(f,c)|@>=
-if char_tag(f,c)=ext_tag then
- @<Construct an extensible character in a new box |b|,
- using recipe |rem_byte(q)| and font |f|@>
-else b:=char_box(f,c)
-
-@ When we build an extensible character, it's handy to have the
-following subroutine, which puts a given character on top
-of the characters already in box |b|:
-
-@<Declare subprocedures for |var_delimiter|@>=
-procedure stack_into_box(@!b:pointer;@!f:internal_font_number;
- @!c:quarterword);
-var p:pointer; {new node placed into |b|}
-begin p:=char_box(f,c); vlink(p):=list_ptr(b); list_ptr(b):=p;
-height(b):=height(p);
-end;
-
-@ Another handy subroutine computes the height plus depth of
-a given character:
-
-@<Declare subprocedures for |var_delimiter|@>=
-function height_plus_depth(@!f:internal_font_number;@!c:quarterword):scaled;
-begin
-height_plus_depth:=char_height(f,c)+char_depth(f,c);
-end;
-
-@ @<Construct an extensible...@>=
-begin b:=new_null_box;
-type(b):=vlist_node;
-@<Compute the minimum suitable height, |w|, and the corresponding
- number of extension steps, |n|; also set |width(b)|@>;
-cc:=ext_bot(f,c);
-if cc<>min_quarterword then stack_into_box(b,f,cc);
-cc:=ext_rep(f,c);
-for m:=1 to n do stack_into_box(b,f,cc);
-cc:=ext_mid(f,c);
-if cc<>min_quarterword then
- begin stack_into_box(b,f,cc); cc:=ext_rep(f,c);
- for m:=1 to n do stack_into_box(b,f,cc);
- end;
-cc:=ext_top(f,c);
-if cc<>min_quarterword then stack_into_box(b,f,cc);
-depth(b):=w-height(b);
-end
-
-@ The width of an extensible character is the width of the repeatable
-module. If this module does not have positive height plus depth,
-we don't use any copies of it, otherwise we use as few as possible
-(in groups of two if there is a middle part).
-
-@<Compute the minimum suitable height, |w|, and...@>=
-cc:=ext_rep(f,c); u:=height_plus_depth(f,cc);
-w:=0; width(b):=char_width(f,cc)+char_italic(f,cc);@/
-cc:=ext_bot(f,c);@+if cc<>min_quarterword then w:=w+height_plus_depth(f,cc);
-cc:=ext_mid(f,c);@+if cc<>min_quarterword then w:=w+height_plus_depth(f,cc);
-cc:=ext_top(f,c);@+if cc<>min_quarterword then w:=w+height_plus_depth(f,cc);
-n:=0;
-if u>0 then while w<v do
- begin w:=w+u; incr(n);
- if (ext_mid(f,c))<>min_quarterword then w:=w+u;
- end
-
-@ The next subroutine is much simpler; it is used for numerators and
-denominators of fractions as well as for displayed operators and
-their limits above and below. It takes a given box~|b| and
-changes it so that the new box is centered in a box of width~|w|.
-The centering is done by putting \.{\\hss} glue at the left and right
-of the list inside |b|, then packaging the new box; thus, the
-actual box might not really be centered, if it already contains
-infinite glue.
-
-The given box might contain a single character whose italic correction
-has been added to the width of the box; in this case a compensating
-kern is inserted.
-
-@p function rebox(@!b:pointer;@!w:scaled):pointer;
-var p,q:pointer; {temporary registers for list manipulation}
-@!f:internal_font_number; {font in a one-character box}
-@!v:scaled; {width of a character without italic correction}
-begin if (width(b)<>w)and(list_ptr(b)<>null) then
- begin if type(b)=vlist_node then b:=hpack(b,natural);
- p:=list_ptr(b);
- if (is_char_node(p))and(vlink(p)=null) then
- begin f:=font(p); v:=char_width(f,character(p));
- if v<>width(b) then begin
- q:=new_kern(width(b)-v); vlink(p):=q;
- end;
- end;
- list_ptr(b):=null; flush_node(b);
- b:=new_glue(ss_glue); vlink(b):=p;
- while vlink(p)<>null do p:=vlink(p);
- q:=new_glue(ss_glue); vlink(p):=q;
- rebox:=hpack(b,w,exactly);
- end
-else begin width(b):=w; rebox:=b;
- end;
-end;
-
-@ Here is a subroutine that creates a new glue specification from another
-one that is expressed in `\.{mu}', given the value of the math unit.
-
-@d mu_mult(#)==nx_plus_y(n,#,xn_over_d(#,f,@'200000))
-
-@p function math_glue(@!g:pointer;@!m:scaled):pointer;
-var p:pointer; {the new glue specification}
-@!n:integer; {integer part of |m|}
-@!f:scaled; {fraction part of |m|}
-begin n:=x_over_n(m,@'200000); f:=remainder;@/
-if f<0 then
- begin decr(n); f:=f+@'200000;
- end;
-p:=new_node(glue_spec_node,0);
-width(p):=mu_mult(width(g)); {convert \.{mu} to \.{pt}}
-stretch_order(p):=stretch_order(g);
-if stretch_order(p)=normal then stretch(p):=mu_mult(stretch(g))
-else stretch(p):=stretch(g);
-shrink_order(p):=shrink_order(g);
-if shrink_order(p)=normal then shrink(p):=mu_mult(shrink(g))
-else shrink(p):=shrink(g);
-math_glue:=p;
-end;
-
-@ The |math_kern| subroutine removes |mu_glue| from a kern node, given
-the value of the math unit.
-
-@p procedure math_kern(@!p:pointer;@!m:scaled);
-var @!n:integer; {integer part of |m|}
-@!f:scaled; {fraction part of |m|}
-begin if subtype(p)=mu_glue then
- begin n:=x_over_n(m,@'200000); f:=remainder;@/
- if f<0 then
- begin decr(n); f:=f+@'200000;
- end;
- width(p):=mu_mult(width(p)); subtype(p):=explicit;
- end;
-end;
-@ Sometimes it is necessary to destroy an mlist. The following
-subroutine empties the current list, assuming that |abs(mode)=mmode|.
-
-@p procedure flush_math;
-begin flush_node_list(vlink(head)); flush_node_list(incompleat_noad);
-vlink(head):=null; tail:=head; incompleat_noad:=null;
-end;
+Is one in C.
@* \[36] Typesetting math formulas.
-\TeX's most important routine for dealing with formulas is called
-|mlist_to_hlist|. After a formula has been scanned and represented as an
-mlist, this routine converts it to an hlist that can be placed into a box
-or incorporated into the text of a paragraph. There are three implicit
-parameters, passed in global variables: |cur_mlist| points to the first
-node or noad in the given mlist (and it might be |null|); |cur_style| is a
-style code; and |mlist_penalties| is |true| if penalty nodes for potential
-line breaks are to be inserted into the resulting hlist. After
-|mlist_to_hlist| has acted, |vlink(temp_head)| points to the translated hlist.
-
-Since mlists can be inside mlists, the procedure is recursive. And since this
-is not part of \TeX's inner loop, the program has been written in a manner
-that stresses compactness over efficiency.
-@^recursion@>
-
-@<Glob...@>=
-@!cur_mlist:pointer; {beginning of mlist to be translated}
-@!cur_style:integer; {style code at current place in the list}
-@!cur_size:integer; {size code corresponding to |cur_style|}
-@!cur_mu:scaled; {the math unit width corresponding to |cur_size|}
-@!mlist_penalties:boolean; {should |mlist_to_hlist| insert penalties?}
-
-@ The recursion in |mlist_to_hlist| is due primarily to a subroutine
-called |clean_box| that puts a given noad field into a box using a given
-math style; |mlist_to_hlist| can call |clean_box|, which can call
-|mlist_to_hlist|.
-@^recursion@>
-
-The box returned by |clean_box| is ``clean'' in the
-sense that its |shift_amount| is zero.
-
-@p procedure@?mlist_to_hlist; forward;@t\2@>@/
-function clean_box(@!p:pointer;@!s:integer):pointer;
-label found;
-var q:pointer; {beginning of a list to be boxed}
-@!save_style:integer; {|cur_style| to be restored}
-@!x:pointer; {box to be returned}
-@!r:pointer; {temporary pointer}
-begin
-case math_type(p) of
-math_char: begin cur_mlist:=new_noad; vmem(nucleus(cur_mlist)):=vmem(p);
- end;
-sub_box: begin q:=vinfo(p); goto found;
- end;
-sub_mlist: cur_mlist:=vinfo(p);
-othercases begin q:=new_null_box; goto found;
- end
-endcases;@/
-save_style:=cur_style; cur_style:=s; mlist_penalties:=false;@/
-mlist_to_hlist; q:=vlink(temp_head); {recursive call}
-cur_style:=save_style; {restore the style}
-@<Set up the values of |cur_size| and |cur_mu|, based on |cur_style|@>;
-found: if is_char_node(q)or(q=null) then x:=hpack(q,natural)
- else if (vlink(q)=null)and(type(q)<=vlist_node)and(shift_amount(q)=0) then
- x:=q {it's already clean}
- else x:=hpack(q,natural);
-@<Simplify a trivial box@>;
-clean_box:=x;
-end;
-
-@ Here we save memory space in a common case.
-
-@<Simplify a trivial box@>=
-q:=list_ptr(x);
-if is_char_node(q) then
- begin r:=vlink(q);
- if r<>null then if vlink(r)=null then if not is_char_node(r) then
- if type(r)=kern_node then {unneeded italic correction}
- begin flush_node(r); vlink(q):=null;
- end;
- end
-
-@ It is convenient to have a procedure that converts a |math_char|
-field to an ``unpacked'' form. The |fetch| routine sets |cur_f| and |cur_c|
-to the font code and character code of a given noad field.
-It also takes care of issuing error messages for
-nonexistent characters; in such cases, |char_exists(cur_f,cur_c)| will be |false|
-after |fetch| has acted, and the field will also have been reset to |empty|.
-
-@p procedure fetch(@!a:pointer); {unpack the |math_char| field |a|}
-begin cur_c:=mcharacter(a); cur_f:=fam_fnt(fam(a)+cur_size);
-if cur_f=null_font then
- @<Complain about an undefined family@>
-else begin
- if not(char_exists(cur_f,cur_c)) then
- begin char_warning(cur_f,qo(cur_c));
- math_type(a):=empty;
- end;
- end;
-end;
-
-@ @<Complain about an undefined family@>=
-begin print_err(""); print_size(cur_size); print_char(" ");
-print_int(fam(a)); print(" is undefined (character ");
-print(qo(cur_c)); print_char(")");
-help4("Somewhere in the math formula just ended, you used the")@/
-("stated character from an undefined font family. For example,")@/
-("plain TeX doesn't allow \it or \sl in subscripts. Proceed,")@/
-("and I'll try to forget that I needed that character.");
-error; math_type(a):=empty;
-end
-
-@ The outputs of |fetch| are placed in global variables.
-
-@<Glob...@>=
-@!cur_f:internal_font_number; {the |font| field of a |math_char|}
-@!cur_c:quarterword; {the |character| field of a |math_char|}
-
-@ We need to do a lot of different things, so |mlist_to_hlist| makes two
-passes over the given mlist.
-
-The first pass does most of the processing: It removes ``mu'' spacing from
-glue, it recursively evaluates all subsidiary mlists so that only the
-top-level mlist remains to be handled, it puts fractions and square roots
-and such things into boxes, it attaches subscripts and superscripts, and
-it computes the overall height and depth of the top-level mlist so that
-the size of delimiters for a |left_noad| and a |right_noad| will be known.
-The hlist resulting from each noad is recorded in that noad's |new_hlist|
-field, an integer field that replaces the |nucleus| or |thickness|.
-@^recursion@>
-
-The second pass eliminates all noads and inserts the correct glue and
-penalties between nodes.
-
-@d new_hlist(#)==vmem(nucleus(#)).int {the translation of an mlist}
-
-@ Here is the overall plan of |mlist_to_hlist|, and the list of its
-local variables.
-
-@d done_with_noad=80 {go here when a noad has been fully translated}
-@d done_with_node=81 {go here when a node has been fully converted}
-@d check_dimensions=82 {go here to update |max_h| and |max_d|}
-@d delete_q=83 {go here to delete |q| and move to the next node}
-
-@p@t\4@>@<Declare math construction procedures@>
-procedure mlist_to_hlist;
-label reswitch, check_dimensions, done_with_noad, done_with_node, delete_q,
- done;
-var mlist:pointer; {beginning of the given list}
-@!penalties:boolean; {should penalty nodes be inserted?}
-@!style:integer; {the given style}
-@!save_style:integer; {holds |cur_style| during recursion}
-@!q:pointer; {runs through the mlist}
-@!r:pointer; {the most recent noad preceding |q|}
-@!r_type:integer; {the |type| of noad |r|, or |op_noad| if |r=null|}
-@!t:integer; {the effective |type| of noad |q| during the second pass}
-@!p,@!x,@!y,@!z: pointer; {temporary registers for list construction}
-@!pen:integer; {a penalty to be inserted}
-@!s:integer; {the size of a noad to be deleted}
-@!max_hl,@!max_d:scaled; {maximum height and depth of the list translated so far}
-@!delta:scaled; {offset between subscript and superscript}
-begin mlist:=cur_mlist; penalties:=mlist_penalties;
-style:=cur_style; {tuck global parameters away as local variables}
-q:=mlist; r:=null; r_type:=op_noad; max_hl:=0; max_d:=0; x:=null; p:=null;
-@<Set up the values of |cur_size| and |cur_mu|, based on |cur_style|@>;
-while q<>null do @<Process node-or-noad |q| as much as possible in preparation
- for the second pass of |mlist_to_hlist|, then move to the next
- item in the mlist@>;
-@<Convert \(a)a final |bin_noad| to an |ord_noad|@>;
-@<Make a second pass over the mlist, removing all noads and inserting the
- proper spacing and penalties@>;
-end;
-
-@ We use the fact that no character nodes appear in an mlist, hence
-the field |type(q)| is always present.
-
-@<Process node-or-noad...@>=
-begin @<Do first-pass processing based on |type(q)|; |goto done_with_noad|
- if a noad has been fully processed, |goto check_dimensions| if it
- has been translated into |new_hlist(q)|, or |goto done_with_node|
- if a node has been fully processed@>;
-check_dimensions: z:=hpack(new_hlist(q),natural);
-if height(z)>max_hl then max_hl:=height(z);
-if depth(z)>max_d then max_d:=depth(z);
-list_ptr(z):=null; flush_node(z);
-done_with_noad: r:=q; r_type:=type(r);
-if r_type=right_noad then
- begin r_type:=left_noad; cur_style:=style; @<Set up the values...@>;
- end;
-done_with_node: q:=vlink(q);
-end
-
-@ One of the things we must do on the first pass is change a |bin_noad| to
-an |ord_noad| if the |bin_noad| is not in the context of a binary operator.
-The values of |r| and |r_type| make this fairly easy.
-
-@<Do first-pass processing...@>=
-reswitch: delta:=0;
-case type(q) of
-bin_noad: case r_type of
- bin_noad,op_noad,rel_noad,open_noad,punct_noad,left_noad:
- begin type(q):=ord_noad; goto reswitch;
- end;
- othercases do_nothing
- endcases;
-rel_noad,close_noad,punct_noad,right_noad: begin@t@>@;@/
- @<Convert \(a)a final |bin_noad| to an |ord_noad|@>;
- if type(q)=right_noad then goto done_with_noad;
- end;
-@t\4@>@<Cases for noads that can follow a |bin_noad|@>@;
-@t\4@>@<Cases for nodes that can appear in an mlist, after which we
- |goto done_with_node|@>@;
-othercases confusion("mlist1")
-@:this can't happen mlist1}{\quad mlist1@>
-endcases;@/
-@<Convert \(n)|nucleus(q)| to an hlist and attach the sub/superscripts@>
-
-@ @<Convert \(a)a final |bin_noad| to an |ord_noad|@>=
-if r_type=bin_noad then type(r):=ord_noad
-
-@ @<Cases for nodes that can appear in an mlist...@>=
-style_node: begin cur_style:=subtype(q);
- @<Set up the values of |cur_size| and |cur_mu|, based on |cur_style|@>;
- goto done_with_node;
- end;
-choice_node: @<Change this node to a style node followed by the correct choice,
- then |goto done_with_node|@>;
-ins_node,mark_node,adjust_node,
- whatsit_node,penalty_node,disc_node: goto done_with_node;
-rule_node: begin if height(q)>max_hl then max_hl:=height(q);
- if depth(q)>max_d then max_d:=depth(q); goto done_with_node;
- end;
-glue_node: begin @<Convert \(m)math glue to ordinary glue@>;
- goto done_with_node;
- end;
-kern_node: begin math_kern(q,cur_mu); goto done_with_node;
- end;
-
-@ @d choose_mlist(#)==begin p:=#(q); #(q):=null;@+end
-
-@<Change this node to a style node...@>=
-begin case cur_style div 2 of
-0: choose_mlist(display_mlist); {|display_style=0|}
-1: choose_mlist(text_mlist); {|text_style=2|}
-2: choose_mlist(script_mlist); {|script_style=4|}
-3: choose_mlist(script_script_mlist); {|script_script_style=6|}
-end; {there are no other cases}
-flush_node_list(display_mlist(q));
-flush_node_list(text_mlist(q));
-flush_node_list(script_mlist(q));
-flush_node_list(script_script_mlist(q));@/
-type(q):=style_node; subtype(q):=cur_style; width(q):=0; depth(q):=0;
-if p<>null then
- begin z:=vlink(q); vlink(q):=p;
- while vlink(p)<>null do p:=vlink(p);
- vlink(p):=z;
- end;
-goto done_with_node;
-end
-
-@ Conditional math glue (`\.{\\nonscript}') results in a |glue_node|
-pointing to |zero_glue|, with |subtype(q)=cond_math_glue|; in such a case
-the node following will be eliminated if it is a glue or kern node and if the
-current size is different from |text_size|. Unconditional math glue
-(`\.{\\muskip}') is converted to normal glue by multiplying the dimensions
-by |cur_mu|.
-@!@:non_script_}{\.{\\nonscript} primitive@>
-
-@<Convert \(m)math glue to ordinary glue@>=
-if subtype(q)=mu_glue then
- begin x:=glue_ptr(q);
- y:=math_glue(x,cur_mu); delete_glue_ref(x); glue_ptr(q):=y;
- subtype(q):=normal;
- end
-else if (cur_size<>text_size)and(subtype(q)=cond_math_glue) then
- begin p:=vlink(q);
- if p<>null then if (type(p)=glue_node)or(type(p)=kern_node) then
- begin vlink(q):=vlink(p); vlink(p):=null; flush_node_list(p);
- end;
- end
-
-@ @<Cases for noads that can follow a |bin_noad|@>=
-left_noad: goto done_with_noad;
-fraction_noad: begin make_fraction(q); goto check_dimensions;
- end;
-op_noad: begin delta:=make_op(q);
- if subtype(q)=limits then goto check_dimensions;
- end;
-ord_noad: make_ord(q);
-open_noad,inner_noad: do_nothing;
-radical_noad: make_radical(q);
-over_noad: make_over(q);
-under_noad: make_under(q);
-accent_noad: make_math_accent(q);
-vcenter_noad: make_vcenter(q);
-
-@ Most of the actual construction work of |mlist_to_hlist| is done
-by procedures with names
-like |make_fraction|, |make_radical|, etc. To illustrate
-the general setup of such procedures, let's begin with a couple of
-simple ones.
-
-@<Declare math...@>=
-procedure make_over(@!q:pointer);
-var p:pointer;
-begin p:=overbar(clean_box(nucleus(q),cramped_style(cur_style)),@|
- 3*default_rule_thickness,default_rule_thickness);
-vinfo(nucleus(q)):=p;
-math_type(nucleus(q)):=sub_box;
-end;
-
-@ @<Declare math...@>=
-procedure make_under(@!q:pointer);
-var p,@!x,@!y,@!r: pointer; {temporary registers for box construction}
-@!delta:scaled; {overall height plus depth}
-begin x:=clean_box(nucleus(q),cur_style);
-p:=new_kern(3*default_rule_thickness); vlink(x):=p;
-r:=fraction_rule(default_rule_thickness); vlink(p):=r;
-pack_direction:=math_direction; y:=vpack(x,natural);
-delta:=height(y)+depth(y)+default_rule_thickness;
-height(y):=height(x); depth(y):=delta-height(y);
-vinfo(nucleus(q)):=y; math_type(nucleus(q)):=sub_box;
-end;
-
-@ @<Declare math...@>=
-procedure make_vcenter(@!q:pointer);
-var v:pointer; {the box that should be centered vertically}
-@!delta:scaled; {its height plus depth}
-begin v:=vinfo(nucleus(q));
-if type(v)<>vlist_node then confusion("vcenter");
-@:this can't happen vcenter}{\quad vcenter@>
-delta:=height(v)+depth(v);
-height(v):=axis_height(cur_size)+half(delta);
-depth(v):=delta-height(v);
-end;
-
-@ According to the rules in the \.{DVI} file specifications, we ensure alignment
-@^square roots@>
-between a square root sign and the rule above its nucleus by assuming that the
-baseline of the square-root symbol is the same as the bottom of the rule. The
-height of the square-root symbol will be the thickness of the rule, and the
-depth of the square-root symbol should exceed or equal the height-plus-depth
-of the nucleus plus a certain minimum clearance~|clr|. The symbol will be
-placed so that the actual clearance is |clr| plus half the excess.
-
-@<Declare math...@>=
-procedure make_radical(@!q:pointer);
-var x,@!y,@!p:pointer; {temporary registers for box construction}
-@!delta,@!clr:scaled; {dimensions involved in the calculation}
-begin x:=clean_box(nucleus(q),cramped_style(cur_style));
-if cur_style<text_style then {display style}
- clr:=default_rule_thickness+(abs(math_x_height(cur_size)) div 4)
-else begin clr:=default_rule_thickness; clr:=clr + (abs(clr) div 4);
- end;
-y:=var_delimiter(left_delimiter(q),cur_size,height(x)+depth(x)+clr+
- default_rule_thickness);
-delta:=depth(y)-(height(x)+depth(x)+clr);
-if delta>0 then clr:=clr+half(delta); {increase the actual clearance}
-shift_amount(y):=-(height(x)+clr);
-p:=overbar(x,clr,height(y)); vlink(y):=p;
-p:=hpack(y,natural); vinfo(nucleus(q)):=p;
-math_type(nucleus(q)):=sub_box;
-end;
-
-@ Slants are not considered when placing accents in math mode. The accenter is
-centered over the accentee, and the accent width is treated as zero with
-respect to the size of the final box.
-
-@<Declare math...@>=
-procedure make_math_accent(@!q:pointer);
-label done;
-var p,@!x,@!y:pointer; {temporary registers for box construction}
-@!c:quarterword; {accent character}
-@!f:internal_font_number; {its font}
-@!s:scaled; {amount to skew the accent to the right}
-@!h:scaled; {height of character being accented}
-@!delta:scaled; {space to remove between accent and accentee}
-@!w:scaled; {width of the accentee, not including sub/superscripts}
-begin fetch(accent_chr(q));
-if char_exists(cur_f,cur_c) then
- begin c:=cur_c; f:=cur_f;@/
- @<Compute the amount of skew@>;
- x:=clean_box(nucleus(q),cramped_style(cur_style)); w:=width(x); h:=height(x);
- @<Switch to a larger accent if available and appropriate@>;
- if h<x_height(f) then delta:=h@+else delta:=x_height(f);
- if (math_type(supscr(q))<>empty)or(math_type(subscr(q))<>empty) then
- if math_type(nucleus(q))=math_char then
- @<Swap the subscript and superscript into box |x|@>;
- y:=char_box(f,c);
- shift_amount(y):=s+half(w-width(y));
- width(y):=0; p:=new_kern(-delta); vlink(p):=x; vlink(y):=p;
- pack_direction:=math_direction;
- y:=vpack(y,natural); width(y):=width(x);
- if height(y)<h then @<Make the height of box |y| equal to |h|@>;
- vinfo(nucleus(q)):=y;
- math_type(nucleus(q)):=sub_box;
- end;
-end;
-
-@ @<Make the height of box |y|...@>=
-begin p:=new_kern(h-height(y)); vlink(p):=list_ptr(y); list_ptr(y):=p;
-height(y):=h;
-end
-
-@ @<Switch to a larger accent if available and appropriate@>=
-loop@+ begin if char_tag(f,c)<>list_tag then goto done;
- y:=char_remainder(f,c);
- if not char_exists(f,y) then goto done;
- if char_width(f,y)>w then goto done;
- c:=y;
- end;
-done:
-
-@ @<Compute the amount of skew@>=
-s:=0;
-if math_type(nucleus(q))=math_char then
- begin fetch(nucleus(q));
- s := get_kern(cur_f,cur_c,skew_char(cur_f));
- end
-
-@ @<Swap the subscript and superscript into box |x|@>=
-begin flush_node_list(x); x:=new_noad;
-vmem(nucleus(x)):=vmem(nucleus(q));
-vmem(supscr(x)):=vmem(supscr(q));
-vmem(subscr(x)):=vmem(subscr(q));@/
-vmem(supscr(q)).hh:=empty_field;
-vmem(subscr(q)).hh:=empty_field;@/
-math_type(nucleus(q)):=sub_mlist; vinfo(nucleus(q)):=x;
-x:=clean_box(nucleus(q),cur_style); delta:=delta+height(x)-h; h:=height(x);
-end
-
-@ The |make_fraction| procedure is a bit different because it sets
-|new_hlist(q)| directly rather than making a sub-box.
-
-@<Declare math...@>=
-procedure make_fraction(@!q:pointer);
-var p,@!v,@!x,@!y,@!z:pointer; {temporary registers for box construction}
-@!delta,@!delta1,@!delta2,@!shift_up,@!shift_down,@!clr:scaled;
- {dimensions for box calculations}
-begin if thickness(q)=default_code then thickness(q):=default_rule_thickness;
-@<Create equal-width boxes |x| and |z| for the numerator and denominator,
- and compute the default amounts |shift_up| and |shift_down| by which they
- are displaced from the baseline@>;
-if thickness(q)=0 then @<Adjust \(s)|shift_up| and |shift_down| for the case
- of no fraction line@>
-else @<Adjust \(s)|shift_up| and |shift_down| for the case of a fraction line@>;
-@<Construct a vlist box for the fraction, according to |shift_up| and
- |shift_down|@>;
-@<Put the \(f)fraction into a box with its delimiters, and make |new_hlist(q)|
- point to it@>;
-end;
-
-@ @<Create equal-width boxes |x| and |z| for the numerator and denom...@>=
-x:=clean_box(numerator(q),num_style(cur_style));
-z:=clean_box(denominator(q),denom_style(cur_style));
-vinfo(numerator(q)):=null;
-vinfo(denominator(q)):=null;
-if width(x)<width(z) then x:=rebox(x,width(z))
-else z:=rebox(z,width(x));
-if cur_style<text_style then {display style}
- begin shift_up:=num1(cur_size); shift_down:=denom1(cur_size);
- end
-else begin shift_down:=denom2(cur_size);
- if thickness(q)<>0 then shift_up:=num2(cur_size)
- else shift_up:=num3(cur_size);
- end
-
-@ The numerator and denominator must be separated by a certain minimum
-clearance, called |clr| in the following program. The difference between
-|clr| and the actual clearance is |2delta|.
-
-@<Adjust \(s)|shift_up| and |shift_down| for the case of no fraction line@>=
-begin if cur_style<text_style then clr:=7*default_rule_thickness
-else clr:=3*default_rule_thickness;
-delta:=half(clr-((shift_up-depth(x))-(height(z)-shift_down)));
-if delta>0 then
- begin shift_up:=shift_up+delta;
- shift_down:=shift_down+delta;
- end;
-end
-
-@ In the case of a fraction line, the minimum clearance depends on the actual
-thickness of the line.
-
-@<Adjust \(s)|shift_up| and |shift_down| for the case of a fraction line@>=
-begin if cur_style<text_style then clr:=3*thickness(q)
-else clr:=thickness(q);
-delta:=half(thickness(q));
-delta1:=clr-((shift_up-depth(x))-(axis_height(cur_size)+delta));
-delta2:=clr-((axis_height(cur_size)-delta)-(height(z)-shift_down));
-if delta1>0 then shift_up:=shift_up+delta1;
-if delta2>0 then shift_down:=shift_down+delta2;
-end
-
-@ @<Construct a vlist box for the fraction...@>=
-v:=new_null_box; type(v):=vlist_node;
-height(v):=shift_up+height(x); depth(v):=depth(z)+shift_down;
-width(v):=width(x); {this also equals |width(z)|}
-if thickness(q)=0 then
- begin p:=new_kern((shift_up-depth(x))-(height(z)-shift_down));
- vlink(p):=z;
- end
-else begin y:=fraction_rule(thickness(q));@/
- p:=new_kern((axis_height(cur_size)-delta)-@|(height(z)-shift_down));@/
- vlink(y):=p; vlink(p):=z;@/
- p:=new_kern((shift_up-depth(x))-(axis_height(cur_size)+delta));
- vlink(p):=y;
- end;
-vlink(x):=p; list_ptr(v):=x
-
-@ @<Put the \(f)fraction into a box with its delimiters...@>=
-if cur_style<text_style then delta:=delim1(cur_size)
-else delta:=delim2(cur_size);
-x:=var_delimiter(left_delimiter(q), cur_size, delta); vlink(x):=v;@/
-z:=var_delimiter(right_delimiter(q), cur_size, delta); vlink(v):=z;@/
-y:=hpack(x,natural);
-new_hlist(q):=y
-
-@ If the nucleus of an |op_noad| is a single character, it is to be
-centered vertically with respect to the axis, after first being enlarged
-(via a character list in the font) if we are in display style. The normal
-convention for placing displayed limits is to put them above and below the
-operator in display style.
-
-The italic correction is removed from the character if there is a subscript
-and the limits are not being displayed. The |make_op|
-routine returns the value that should be used as an offset between
-subscript and superscript.
-
-After |make_op| has acted, |subtype(q)| will be |limits| if and only if
-the limits have been set above and below the operator. In that case,
-|new_hlist(q)| will already contain the desired final box.
-
-@<Declare math...@>=
-function make_op(@!q:pointer):scaled;
-var delta:scaled; {offset between subscript and superscript}
-@!p,@!v,@!x,@!y,@!z:pointer; {temporary registers for box construction}
-@!c:quarterword; {register for character examination}
-@!shift_up,@!shift_down:scaled; {dimensions for box calculation}
-begin if (subtype(q)=normal)and(cur_style<text_style) then
- subtype(q):=limits;
-if math_type(nucleus(q))=math_char then
- begin fetch(nucleus(q));
- if (cur_style<text_style)and(char_tag(cur_f,cur_c)=list_tag) then {make it larger}
- begin c:=char_remainder(cur_f,cur_c);
- if char_exists(cur_f,c) then
- begin cur_c:=c; mcharacter(nucleus(q)):=c;
- end;
- end;
- delta:=char_italic(cur_f,cur_c); x:=clean_box(nucleus(q),cur_style);
- if (math_type(subscr(q))<>empty)and(subtype(q)<>limits) then
- width(x):=width(x)-delta; {remove italic correction}
- shift_amount(x):=half(height(x)-depth(x)) - axis_height(cur_size);
- {center vertically}
- math_type(nucleus(q)):=sub_box; vinfo(nucleus(q)):=x;
- end
-else delta:=0;
-if subtype(q)=limits then
- @<Construct a box with limits above and below it, skewed by |delta|@>;
-make_op:=delta;
-end;
-
-@ The following program builds a vlist box |v| for displayed limits. The
-width of the box is not affected by the fact that the limits may be skewed.
-
-@<Construct a box with limits above and below it...@>=
-begin x:=clean_box(supscr(q),sup_style(cur_style));
-y:=clean_box(nucleus(q),cur_style);
-z:=clean_box(subscr(q),sub_style(cur_style));
-v:=new_null_box; type(v):=vlist_node; width(v):=width(y);
-if width(x)>width(v) then width(v):=width(x);
-if width(z)>width(v) then width(v):=width(z);
-x:=rebox(x,width(v)); y:=rebox(y,width(v)); z:=rebox(z,width(v));@/
-shift_amount(x):=half(delta); shift_amount(z):=-shift_amount(x);
-height(v):=height(y); depth(v):=depth(y);
-@<Attach the limits to |y| and adjust |height(v)|, |depth(v)| to
- account for their presence@>;
-new_hlist(q):=v;
-end
-
-@ We use |shift_up| and |shift_down| in the following program for the
-amount of glue between the displayed operator |y| and its limits |x| and
-|z|. The vlist inside box |v| will consist of |x| followed by |y| followed
-by |z|, with kern nodes for the spaces between and around them.
-
-@<Attach the limits to |y| and adjust |height(v)|, |depth(v)|...@>=
-if math_type(supscr(q))=empty then
- begin list_ptr(x):=null; flush_node(x); list_ptr(v):=y;
- end
-else begin shift_up:=big_op_spacing3-depth(x);
- if shift_up<big_op_spacing1 then shift_up:=big_op_spacing1;
- p:=new_kern(shift_up); vlink(p):=y; vlink(x):=p;@/
- p:=new_kern(big_op_spacing5); vlink(p):=x; list_ptr(v):=p;
- height(v):=height(v)+big_op_spacing5+height(x)+depth(x)+shift_up;
- end;
-if math_type(subscr(q))=empty then begin list_ptr(z):=null; flush_node(z); end
-else begin shift_down:=big_op_spacing4-height(z);
- if shift_down<big_op_spacing2 then shift_down:=big_op_spacing2;
- p:=new_kern(shift_down); vlink(y):=p; vlink(p):=z;@/
- p:=new_kern(big_op_spacing5); vlink(z):=p;
- depth(v):=depth(v)+big_op_spacing5+height(z)+depth(z)+shift_down;
- end
-
-@ A ligature found in a math formula does not create a ligature, because
-there is no question of hyphenation afterwards; the ligature will simply be
-stored in an ordinary |glyph_node|, after residing in an |ord_noad|.
-
-The |math_type| is converted to |math_text_char| here if we would not want to
-apply an italic correction to the current character unless it belongs
-to a math font (i.e., a font with |space=0|).
-
-No boundary characters enter into these ligatures.
-
-@<Declare math...@>=
-procedure make_ord(@!q:pointer);
-label restart,exit;
-var a:integer; { the left-side character for lig/kern testing }
-@!p,@!r:pointer; {temporary registers for list manipulation}
-k:scaled; { a kern }
-lig:liginfo; { a ligature }
-begin restart:@t@>@;@/
-if math_type(subscr(q))=empty then if math_type(supscr(q))=empty then
- if math_type(nucleus(q))=math_char then
- begin p:=vlink(q);
- if p<>null then if (type(p)>=ord_noad)and(type(p)<=punct_noad) then
- if math_type(nucleus(p))=math_char then
- if fam(nucleus(p))=fam(nucleus(q)) then
- begin math_type(nucleus(q)):=math_text_char;
- fetch(nucleus(q)); a:=cur_c;
- if (has_kern(cur_f,a))or(has_lig(cur_f,a)) then
- begin cur_c:=mcharacter(nucleus(p));
- @<If character |a| has a kern with |cur_c|, attach
- the kern after~|q|; or if it has a ligature with |cur_c|, combine
- noads |q| and~|p| appropriately; then |return| if the cursor has
- moved past a noad, or |goto restart|@>;
- end;
- end;
- end;
-exit:end;
-
-@ Note that a ligature between an |ord_noad| and another kind of noad
-is replaced by an |ord_noad|, when the two noads collapse into one.
-But we could make a parenthesis (say) change shape when it follows
-certain letters. Presumably a font designer will define such
-ligatures only when this convention makes sense.
-
-\chardef\?='174 % vertical line to indicate character retention
-
-@<If character |a| has a kern with |cur_c|, ...@>=
-begin
-if disable_lig=0 and has_lig(cur_f,a) then begin
- lig:=get_ligature(cur_f,a,cur_c);
- if is_valid_ligature(lig) then begin
- check_interrupt; {allow a way out of infinite ligature loop}
- case lig_type(lig) of
- qi(1),qi(5): mcharacter(nucleus(q)):=lig_replacement(lig); {\.{=:\?}, \.{=:\?>}}
- qi(2),qi(6): mcharacter(nucleus(p)):=lig_replacement(lig); {\.{\?=:}, \.{\?=:>}}
- qi(3),qi(7),qi(11):begin r:=new_noad; {\.{\?=:\?}, \.{\?=:\?>}, \.{\?=:\?>>}}
- mcharacter(nucleus(r)):=lig_replacement(lig);
- fam(nucleus(r)):=fam(nucleus(q));@/
- vlink(q):=r; vlink(r):=p;
- if lig_type(lig)<qi(11) then math_type(nucleus(r)):=math_char
- else math_type(nucleus(r)):=math_text_char; {prevent combination}
- end;
- othercases begin vlink(q):=vlink(p);
- mcharacter(nucleus(q)):=lig_replacement(lig); {\.{=:}}
- vmem(subscr(q)):=vmem(subscr(p)); vmem(supscr(q)):=vmem(supscr(p));@/
- flush_node(p);
- end
- endcases;
- if lig_type(lig)>qi(3) then return;
- math_type(nucleus(q)):=math_char; goto restart;
- end;
- end;
-if disable_kern=0 and has_kern(cur_f,a) then begin
- k:=get_kern(cur_f,a,cur_c);
- if k<>0 then begin
- p:=new_kern(k); vlink(p):=vlink(q); vlink(q):=p; return;
- end;
- end;
-end
-
-@ When we get to the following part of the program, we have ``fallen through''
-from cases that did not lead to |check_dimensions| or |done_with_noad| or
-|done_with_node|. Thus, |q|~points to a noad whose nucleus may need to be
-converted to an hlist, and whose subscripts and superscripts need to be
-appended if they are present.
-
-If |nucleus(q)| is not a |math_char|, the variable |delta| is the amount
-by which a superscript should be moved right with respect to a subscript
-when both are present.
-@^subscripts@>
-@^superscripts@>
-
-@<Convert \(n)|nucleus(q)| to an hlist and attach the sub/superscripts@>=
-case math_type(nucleus(q)) of
-math_char, math_text_char:
- @<Create a character node |p| for |nucleus(q)|, possibly followed
- by a kern node for the italic correction, and set |delta| to the
- italic correction if a subscript is present@>;
-empty: p:=null;
-sub_box: p:=vinfo(nucleus(q));
-sub_mlist: begin cur_mlist:=vinfo(nucleus(q)); save_style:=cur_style;
- mlist_penalties:=false; mlist_to_hlist; {recursive call}
-@^recursion@>
- cur_style:=save_style; @<Set up the values...@>;
- p:=hpack(vlink(temp_head),natural);
- end;
-othercases confusion("mlist2")
-@:this can't happen mlist2}{\quad mlist2@>
-endcases;@/
-new_hlist(q):=p;
-if (math_type(subscr(q))=empty)and(math_type(supscr(q))=empty) then
- goto check_dimensions;
-make_scripts(q,delta)
-
-@ @<Create a character node |p| for |nucleus(q)|...@>=
-begin fetch(nucleus(q));
-if char_exists(cur_f,cur_c) then
- begin delta:=char_italic(cur_f,cur_c); p:=new_glyph(cur_f,cur_c);
- if (math_type(nucleus(q))=math_text_char)and(space(cur_f)<>0) then
- delta:=0; {no italic correction in mid-word of text font}
- if (math_type(subscr(q))=empty)and(delta<>0) then
- begin x:=new_kern(delta); vlink(p):=x; delta:=0;
- end;
- end
-else p:=null;
-end
-
-@ The purpose of |make_scripts(q,delta)| is to attach the subscript and/or
-superscript of noad |q| to the list that starts at |new_hlist(q)|,
-given that subscript and superscript aren't both empty. The superscript
-will appear to the right of the subscript by a given distance |delta|.
-We set |shift_down| and |shift_up| to the minimum amounts to shift the
-baseline of subscripts and superscripts based on the given nucleus.
-
-@<Declare math...@>=
-procedure make_scripts(@!q:pointer;@!delta:scaled);
-var p,@!x,@!y,@!z:pointer; {temporary registers for box construction}
-@!shift_up,@!shift_down,@!clr:scaled; {dimensions in the calculation}
-@!t:integer; {subsidiary size code}
-begin p:=new_hlist(q);
-if is_char_node(p) then
- begin shift_up:=0; shift_down:=0;
- end
-else begin z:=hpack(p,natural);
- t:=cur_size;
- if cur_style<script_style
- then cur_size:=script_size@+else cur_size:=script_script_size;
- shift_up:=height(z)-sup_drop(cur_size);
- shift_down:=depth(z)+sub_drop(cur_size);
- cur_size:=t;
- list_ptr(z):=null; flush_node(z);
- end;
-if math_type(supscr(q))=empty then
- @<Construct a subscript box |x| when there is no superscript@>
-else begin @<Construct a superscript box |x|@>;
- if math_type(subscr(q))=empty then shift_amount(x):=-shift_up
- else @<Construct a sub/superscript combination box |x|, with the
- superscript offset by |delta|@>;
- end;
-if new_hlist(q)=null then new_hlist(q):=x
-else begin p:=new_hlist(q);
- while vlink(p)<>null do p:=vlink(p);
- vlink(p):=x;
- end;
-end;
-
-@ When there is a subscript without a superscript, the top of the subscript
-should not exceed the baseline plus four-fifths of the x-height.
-
-@<Construct a subscript box |x| when there is no superscript@>=
-begin x:=clean_box(subscr(q),sub_style(cur_style));
-width(x):=width(x)+script_space;
-if shift_down<sub1(cur_size) then shift_down:=sub1(cur_size);
-clr:=height(x)-(abs(math_x_height(cur_size)*4) div 5);
-if shift_down<clr then shift_down:=clr;
-shift_amount(x):=shift_down;
-end
-
-@ The bottom of a superscript should never descend below the baseline plus
-one-fourth of the x-height.
-
-@<Construct a superscript box |x|@>=
-begin x:=clean_box(supscr(q),sup_style(cur_style));
-width(x):=width(x)+script_space;
-if odd(cur_style) then clr:=sup3(cur_size)
-else if cur_style<text_style then clr:=sup1(cur_size)
-else clr:=sup2(cur_size);
-if shift_up<clr then shift_up:=clr;
-clr:=depth(x)+(abs(math_x_height(cur_size)) div 4);
-if shift_up<clr then shift_up:=clr;
-end
-
-@ When both subscript and superscript are present, the subscript must be
-separated from the superscript by at least four times |default_rule_thickness|.
-If this condition would be violated, the subscript moves down, after which
-both subscript and superscript move up so that the bottom of the superscript
-is at least as high as the baseline plus four-fifths of the x-height.
-
-@<Construct a sub/superscript combination box |x|...@>=
-begin y:=clean_box(subscr(q),sub_style(cur_style));
-width(y):=width(y)+script_space;
-if shift_down<sub2(cur_size) then shift_down:=sub2(cur_size);
-clr:=4*default_rule_thickness-
- ((shift_up-depth(x))-(height(y)-shift_down));
-if clr>0 then
- begin shift_down:=shift_down+clr;
- clr:=(abs(math_x_height(cur_size)*4) div 5)-(shift_up-depth(x));
- if clr>0 then
- begin shift_up:=shift_up+clr;
- shift_down:=shift_down-clr;
- end;
- end;
-shift_amount(x):=delta; {superscript is |delta| to the right of the subscript}
-p:=new_kern((shift_up-depth(x))-(height(y)-shift_down)); vlink(x):=p; vlink(p):=y;
-pack_direction:=math_direction;
-x:=vpack(x,natural); shift_amount(x):=shift_down;
-end
-
-@ We have now tied up all the loose ends of the first pass of |mlist_to_hlist|.
-The second pass simply goes through and hooks everything together with the
-proper glue and penalties. It also handles the |left_noad| and |right_noad| that
-might be present, since |max_hl| and |max_d| are now known. Variable |p| points
-to a node at the current end of the final hlist.
-
-@<Make a second pass over the mlist, ...@>=
-p:=temp_head; vlink(p):=null; q:=mlist; r_type:=0; cur_style:=style;
-@<Set up the values of |cur_size| and |cur_mu|, based on |cur_style|@>;
-while q<>null do
- begin @<If node |q| is a style node, change the style and |goto delete_q|;
- otherwise if it is not a noad, put it into the hlist,
- advance |q|, and |goto done|; otherwise set |s| to the size
- of noad |q|, set |t| to the associated type (|ord_noad..
- inner_noad|), and set |pen| to the associated penalty@>;
- @<Append inter-element spacing based on |r_type| and |t|@>;
- @<Append any |new_hlist| entries for |q|, and any appropriate penalties@>;
- if type(q)=right_noad then t:=open_noad;
- r_type:=t;
- delete_q: r:=q; q:=vlink(q);
- flush_node(r); {|r| had better be a noad-like thing }
- done: end
-
-@ Just before doing the big |case| switch in the second pass, the program
-sets up default values so that most of the branches are short.
-
-@<If node |q| is a style node, change the style...@>=
-t:=ord_noad; s:=noad_size; pen:=inf_penalty;
-case type(q) of
-op_noad,open_noad,close_noad,punct_noad,inner_noad: t:=type(q);
-bin_noad: begin t:=bin_noad; pen:=bin_op_penalty;
- end;
-rel_noad: begin t:=rel_noad; pen:=rel_penalty;
- end;
-ord_noad,vcenter_noad,over_noad,under_noad: do_nothing;
-radical_noad: s:=radical_noad_size;
-accent_noad: s:=accent_noad_size;
-fraction_noad: begin t:=inner_noad; s:=fraction_noad_size;
- end;
-left_noad,right_noad: t:=make_left_right(q,style,max_d,max_hl);
-style_node: @<Change the current style and |goto delete_q|@>;
-whatsit_node,penalty_node,rule_node,disc_node,adjust_node,ins_node,mark_node,
- glue_node,kern_node:@t@>@;@/
- begin vlink(p):=q; p:=q; q:=vlink(q); vlink(p):=null; goto done;
- end;
-othercases confusion("mlist3")
-@:this can't happen mlist3}{\quad mlist3@>
-endcases
-
-@ The |make_left_right| function constructs a left or right delimiter of
-the required size and returns the value |open_noad| or |close_noad|. The
-|right_noad| and |left_noad| will both be based on the original |style|,
-so they will have consistent sizes.
-
-We use the fact that |right_noad-left_noad=close_noad-open_noad|.
-
-@<Declare math...@>=
-function make_left_right(@!q:pointer;@!style:integer;
- @!max_d,@!max_hv:scaled):small_number;
-var delta,@!delta1,@!delta2:scaled; {dimensions used in the calculation}
-tmp:pointer;
-begin cur_style:=style; @<Set up the values...@>;
-delta2:=max_d+axis_height(cur_size);
-delta1:=max_hv+max_d-delta2;
-if delta2>delta1 then delta1:=delta2; {|delta1| is max distance from axis}
-delta:=(delta1 div 500)*delimiter_factor;
-delta2:=delta1+delta1-delimiter_shortfall;
-if delta<delta2 then delta:=delta2;
-tmp:=var_delimiter(delimiter(q),cur_size,delta);
-new_hlist(q):=tmp;
-make_left_right:=type(q)-(left_noad-open_noad); {|open_noad| or |close_noad|}
-end;
-
-@ @<Change the current style and |goto delete_q|@>=
-begin cur_style:=subtype(q); s:=style_node_size;
-@<Set up the values of |cur_size| and |cur_mu|, based on |cur_style|@>;
-goto delete_q;
-end
-
-@ The inter-element spacing in math formulas depends on a $8\times8$ table that
-\TeX\ preloads as a 64-digit string. The elements of this string have the
-following significance:
-$$\vbox{\halign{#\hfil\cr
-\.0 means no space;\cr
-\.1 means a conditional thin space (\.{\\nonscript\\mskip\\thinmuskip});\cr
-\.2 means a thin space (\.{\\mskip\\thinmuskip});\cr
-\.3 means a conditional medium space
- (\.{\\nonscript\\mskip\\medmuskip});\cr
-\.4 means a conditional thick space
- (\.{\\nonscript\\mskip\\thickmuskip});\cr
-\.* means an impossible case.\cr}}$$
-This is all pretty cryptic, but {\sl The \TeX book\/} explains what is
-supposed to happen, and the string makes it happen.
-@:TeXbook}{\sl The \TeX book@>
-
-A global variable |magic_offset| is computed so that if |a| and |b| are
-in the range |ord_noad..inner_noad|, then |str_pool[a*8+b+magic_offset]|
-is the digit for spacing between noad types |a| and |b|.
-
-If \PASCAL\ had provided a good way to preload constant arrays, this part of
-the program would not have been so strange.
-@:PASCAL}{\PASCAL@>
-
-@d math_spacing=@;@/
-@t\hskip-35pt@>
-"0234000122*4000133**3**344*0400400*000000234000111*1111112341011"
-@t$ \hskip-35pt$@>
-
-@<Glob...@>=
-@!magic_offset:integer; {used to find inter-element spacing}
-
-@ @<Compute the magic offset@>=
-magic_offset:=str_start_macro(math_spacing)-9*ord_noad
-
-@ @<Append inter-element spacing based on |r_type| and |t|@>=
-if r_type>0 then {not the first noad}
- begin case so(str_pool[r_type*8+t+magic_offset]) of
- "0": x:=0;
- "1": if cur_style<script_style then x:=thin_mu_skip_code@+else x:=0;
- "2": x:=thin_mu_skip_code;
- "3": if cur_style<script_style then x:=med_mu_skip_code@+else x:=0;
- "4": if cur_style<script_style then x:=thick_mu_skip_code@+else x:=0;
- othercases confusion("mlist4")
-@:this can't happen mlist4}{\quad mlist4@>
- endcases;
- if x<>0 then
- begin y:=math_glue(glue_par(x),cur_mu);
- z:=new_glue(y); glue_ref_count(y):=null; vlink(p):=z; p:=z;@/
- subtype(z):=x+1; {store a symbolic subtype}
- end;
- end
-
-@ We insert a penalty node after the hlist entries of noad |q| if |pen|
-is not an ``infinite'' penalty, and if the node immediately following |q|
-is not a penalty node or a |rel_noad| or absent entirely.
-
-@<Append any |new_hlist| entries for |q|, and any appropriate penalties@>=
-if new_hlist(q)<>null then
- begin vlink(p):=new_hlist(q);
- repeat p:=vlink(p);
- until vlink(p)=null;
- end;
-if penalties then if vlink(q)<>null then if pen<inf_penalty then
- begin r_type:=type(vlink(q));
- if r_type<>penalty_node then if r_type<>rel_noad then
- begin z:=new_penalty(pen); vlink(p):=z; p:=z;
- end;
- end
+Is done in C.
@* \[37] Alignment.
It's sort of a miracle whenever \.{\\halign} and \.{\\valign} work, because
@@ -22826,7 +19889,6 @@ Their |glue_sign| and |glue_order| are pre-empted as well, since it
is necessary to store information about what to do when a template ends.
This information is called the |extra_info| field.
-@d align_record_node=34
@d u_part(#)==vlink(#+depth_offset) {pointer to \<u_j> token list}
@d v_part(#)==vinfo(#+depth_offset) {pointer to \<v_j> token list}
@d span_ptr(#)==vinfo(#+1) {column spanning list}
@@ -22851,7 +19913,6 @@ when they have to be pushed down, they are stored in 6-word nodes, and
|align_ptr| points to the topmost such node.
@d preamble==vlink(align_head) {the current preamble list}
-@d align_stack_node=47
@<Glob...@>=
@!cur_align:pointer; {current position in preamble list}
@@ -23000,12 +20061,12 @@ as its command code.
@d end_template_token==cs_token_flag+frozen_end_template
@<Put each of \TeX's primitives into the hash table@>=
-primitive("span",tab_mark,span_code);@/
+primitive_tex("span",tab_mark,span_code,span_code);@/
@!@:span_}{\.{\\span} primitive@>
-primitive("cr",car_ret,cr_code);
+primitive_tex("cr",car_ret,cr_code,cr_code);
@!@:cr_}{\.{\\cr} primitive@>
text(frozen_cr):="cr"; eqtb[frozen_cr]:=eqtb[cur_val];@/
-primitive("crcr",car_ret,cr_cr_code);
+primitive_tex("crcr",car_ret,cr_cr_code,cr_code);
@!@:cr_cr_}{\.{\\crcr} primitive@>
text(frozen_end_template):="endtemplate"; text(frozen_endv):="endtemplate";
eq_type(frozen_endv):=endv; equiv(frozen_endv):=null_list;
@@ -23013,12 +20074,6 @@ eq_level(frozen_endv):=level_one;@/
eqtb[frozen_end_template]:=eqtb[frozen_endv];
eq_type(frozen_end_template):=end_template;
-@ @<Cases of |print_cmd_chr|...@>=
-tab_mark: if chr_code=span_code then print_esc("span")
- else chr_cmd("alignment tab character ");
-car_ret: if chr_code=cr_code then print_esc("cr")
- else print_esc("crcr");
-
@ The preamble is copied directly, except that \.{\\tabskip} causes a change
to the tabskip glue, thereby possibly expanding macros that immediately
follow it. An appearance of \.{\\span} also causes such an expansion.
@@ -23140,7 +20195,7 @@ entered, so that the columns will generate a list for subsequent packaging.
procedure init_span(@!p:pointer);
begin push_nest;
if mode=-hmode then space_factor:=1000
-else begin prev_depth:=ignore_depth; normal_paragraph;
+else begin prev_depth:=pdf_ignored_dimen; normal_paragraph;
end;
cur_span:=p;
end;
@@ -23295,8 +20350,6 @@ that column. The code has to make sure that there is room for
The |new_span_node| function is defined in |texnodes.c|.
-@d span_node==41
-@d span_node_size==3 {number of |mem| words for a span node}
@d span_span(#)==vlink(#+1) {that is normally |alink| }
@<Initialize the special list heads...@>=
@@ -23380,7 +20433,7 @@ widths. Let $w_{ij}$ be the maximum of the natural widths of all entries
that span columns $i$ through $j$, inclusive. The alignrecord for column~$i$
contains $w_{ii}$ in its |width| field, and there is also a linked list of
the nonzero $w_{ij}$ for increasing $j$, accessible via the |info| field;
-these span nodes contain the value $j-i-1+|min_quarterword|$ in their
+these span nodes contain the value $j-i+|min_quarterword|$ in their
|link| fields. The values of $w_{ii}$ were initialized to |null_flag|, which
we regard as $-\infty$.
@@ -23596,7 +20649,7 @@ program will be deferred until we're more familiar with such operations.)
@<Insert the \(c)current list into its environment@>=
aux_save:=aux; p:=vlink(head); q:=tail; pop_nest;
-if mode=mmode then @<Finish an alignment in a display@>
+if mode=mmode then finish_display_alignment(p,q,aux_save)
else begin aux:=aux_save; vlink(tail):=p;
if p<>null then tail:=q;
if mode=vmode then begin check_filter('alignment'); build_page; end;
@@ -23623,7 +20676,7 @@ line-breaking problem can be regarded as a special case of the problem of
computing the shortest path in an acyclic network. The cited paper includes
numerous examples and describes the history of line breaking as it has been
practiced by printers through the ages. The present implementation adds two
-new ideas to the algorithm of 1980: memory space requirements are considerably
+new ideas to the algorithm of 1980: Memory space requirements are considerably
reduced by using smaller records for inactive nodes than for active ones,
and arithmetic overflow is avoided by using ``delta distances'' instead of
keeping track of the total distance from the beginning of the paragraph to the
@@ -23670,7 +20723,7 @@ line_break_context := bottom_level;
@ In it's complete form, |line_break| is a rather lengthy
procedure---sort of a small world unto itself---we must build it up
-little by little. Below you see only te general outline.
+little by little. Below you see only the general outline.
The main task performed here is to move the list from |head| to
|temp_head| and go into the enclosing semantic level. We also append
@@ -23689,6 +20742,7 @@ Most other processing is delegated to external functions.
@p procedure line_break(@!d:boolean);
var final_par_glue:pointer;
start_of_par:pointer;
+callback_id:integer;
begin pack_begin_line:=mode_line; {this is for over/underfull box messages}
vlink(temp_head):=vlink(head);
new_hyphenation(temp_head, tail);
@@ -23710,28 +20764,52 @@ else begin
end;
final_par_glue:=new_param_glue(par_fill_skip_code);
couple_nodes(tail,final_par_glue);
-if not output_active then
- lua_node_filter(pre_linebreak_filter_callback,
- line_break_context,temp_head,addressof(tail));
+lua_node_filter(pre_linebreak_filter_callback,
+ line_break_context,temp_head,addressof(tail));
last_line_fill:=vlink(tail);
pop_nest;
start_of_par:=tail;
-ext_do_line_break(d,pretolerance,tracing_paragraphs,tolerance,emergency_stretch,
- looseness,hyphen_penalty,ex_hyphen_penalty,
- pdf_adjust_spacing, par_shape_ptr, adj_demerits,
- pdf_protrude_chars, line_penalty, last_line_fit,
- double_hyphen_demerits, final_hyphen_demerits,
- hang_indent, hsize, hang_after, left_skip, right_skip,
- pdf_each_line_height,pdf_each_line_depth,
- pdf_first_line_height, pdf_last_line_depth,
- inter_line_penalties_ptr, inter_line_penalty,
- club_penalty, club_penalties_ptr,
- display_widow_penalties_ptr,widow_penalties_ptr,
- display_widow_penalty, widow_penalty,
- broken_penalty, final_par_glue);
-if not output_active then
- lua_node_filter(post_linebreak_filter_callback,
- line_break_context,start_of_par,addressof(tail));
+callback_id:=callback_defined(linebreak_filter_callback);
+if callback_id<>0 then begin
+ callback_id := lua_linebreak_callback(d, temp_head, addressof(tail));
+ if callback_id>0 then begin
+ just_box := tail;
+ if just_box<>null then
+ while vlink(just_box)<>null do
+ just_box := vlink(just_box);
+ if (just_box=null)or(type(just_box) <> hlist_node) then begin
+ help3("A linebreaking routine should return a non-empty list of nodes")
+ ("and the last one of those has to be a \\hbox.")
+ ("Sorry, I cannot recover from this.");
+ print_err("Invalid linebreak_filter");
+ succumb;
+ end
+ end
+ else begin
+ if tracing_paragraphs>0 then begin
+ begin_diagnostic;
+ print_nl("Lua linebreak_filter failed, reverting to default on line "); print_int(line);
+ end_diagnostic(true);
+ end;
+ end;
+end;
+if callback_id=0 then begin
+ ext_do_line_break(d,pretolerance,tracing_paragraphs,tolerance,emergency_stretch,
+ looseness,hyphen_penalty,ex_hyphen_penalty,
+ pdf_adjust_spacing, par_shape_ptr, adj_demerits,
+ pdf_protrude_chars, line_penalty, last_line_fit,
+ double_hyphen_demerits, final_hyphen_demerits,
+ hang_indent, hsize, hang_after, left_skip, right_skip,
+ pdf_each_line_height,pdf_each_line_depth,
+ pdf_first_line_height, pdf_last_line_depth,
+ inter_line_penalties_ptr, inter_line_penalty,
+ club_penalty, club_penalties_ptr,
+ display_widow_penalties_ptr,widow_penalties_ptr,
+ display_widow_penalty, widow_penalty,
+ broken_penalty, final_par_glue, pdf_ignored_dimen);
+end;
+lua_node_filter(post_linebreak_filter_callback,
+ line_break_context,start_of_par,addressof(tail));
pack_begin_line:=0;
end;
@#
@@ -23742,13 +20820,7 @@ end;
The choice between |check_head_filter| and |check_contrib_filter| is not
quite clear to me yet, but it seems that the latter is the better choice.
-@d check_head_filter(#)==if (not output_active) and (vlink(head)<>null) then
-lua_node_filter_s(buildpage_filter_callback,#,head,addressof(tail))
-
-@d check_contrib_filter(#)==if (not output_active) and (vlink(contrib_head)<>null) then
-lua_node_filter_s(buildpage_filter_callback,#,contrib_head,addressof(garbage))
-
-@d check_filter==check_head_filter
+@d check_filter(#)==if not output_active then lua_node_filter_s(buildpage_filter_callback,#)
@* \[39] Breaking paragraphs into lines, continued.
@@ -23795,6 +20867,21 @@ begin scan_optional_equals; scan_int;
set_post_hyphen_char(language,cur_val);
end;
+@ `\.{\\preexhyphenchar}', sets the |pre_break| character, and
+`\.{\\postexhyphenchar}' the |post_break| character. Their
+defaults are both zero (nul).
+
+@p procedure new_pre_exhyphen_char;
+begin scan_optional_equals; scan_int;
+ set_pre_exhyphen_char(language,cur_val);
+end;
+@#
+procedure new_post_exhyphen_char;
+begin scan_optional_equals; scan_int;
+ set_post_exhyphen_char(language,cur_val);
+end;
+
+
@* \[43] Initializing the hyphenation tables.
None of the trie-related stuff is applicable any more in luatex.
@@ -23823,12 +20910,12 @@ var prev_p:pointer; {lags one step behind |p|}
begin prev_p:=temp_head; vlink(temp_head):=p; r:=null;
while p<>null do
case type(p) of
- hlist_node,vlist_node,rule_node:@<Insert glue for |split_top_skip|
+ hlist_node_case,vlist_node_case,rule_node_case:@<Insert glue for |split_top_skip|
and set~|p:=null|@>;
- whatsit_node,mark_node,ins_node: begin
+ whatsit_node_case,mark_node_case,ins_node_case: begin
prev_p:=p; p:=vlink(prev_p);
end;
- glue_node,kern_node,penalty_node: begin
+ glue_node_case,kern_node_case,penalty_node_case: begin
q:=p; p:=vlink(q); vlink(q):=null;
vlink(prev_p):=p;
if s then
@@ -23928,19 +21015,19 @@ not_found: if prev_dp>d then
@ @<Use node |p| to update the current height and depth measurements...@>=
case type(p) of
-hlist_node,vlist_node,rule_node: begin@t@>@;@/
+hlist_node_case,vlist_node_case,rule_node_case: begin@t@>@;@/
cur_height:=cur_height+prev_dp+height(p); prev_dp:=depth(p);
goto not_found;
end;
-whatsit_node:@<Process whatsit |p| in |vert_break| loop, |goto not_found|@>;
-glue_node: if precedes_break(prev_p) then pi:=0
+whatsit_node_case:@<Process whatsit |p| in |vert_break| loop, |goto not_found|@>;
+glue_node_case: if precedes_break(prev_p) then pi:=0
else goto update_heights;
-kern_node: begin if vlink(p)=null then t:=penalty_node
+kern_node_case: begin if vlink(p)=null then t:=penalty_node
else t:=type(vlink(p));
if t=glue_node then pi:=0@+else goto update_heights;
end;
-penalty_node: pi:=penalty(p);
-mark_node,ins_node: goto not_found;
+penalty_node_case: pi:=penalty(p);
+mark_node_case,ins_node_case: goto not_found;
othercases confusion("vertbreak")
@:this can't happen vertbreak}{\quad vertbreak@>
endcases
@@ -24132,8 +21219,8 @@ node $r_j$ is followed by |r@t$_{j+1}$@>=vlink(r@t$_j$@>)|; and if there are
each node in this list refers to an insertion number; for example, `\.{\\insert
250}' would correspond to a node whose |subtype| is |qi(250)|
(the same as the |subtype| field of the relevant |ins_node|). These |subtype|
-fields are in increasing order, and |subtype(page_ins_head)=
-qi(255)|, so |page_ins_head| serves as a convenient sentinel
+fields are in increasing order, and |subtype(page_ins_head)=65535, so
+|page_ins_head| serves as a convenient sentinel
at the end of the list. A record is present for each insertion number that
appears in the current page.
@@ -24160,8 +21247,6 @@ The data structure definitions here use the fact that the |@!height| field
appears in the fourth word of a box node.
@^data structure assumptions@>
-@d inserting_node=37 {an insertion class that has not yet overflowed}
-@d split_up_node=38 {an overflowed insertion class}
@d broken_ptr(#)==vlink(#+2)
{an insertion for this class will break here if anywhere}
@d broken_ins(#)==vinfo(#+2) {this insertion might break at |broken_ptr|}
@@ -24169,7 +21254,7 @@ appears in the fourth word of a box node.
@d best_ins_ptr(#)==vinfo(#+3) {the optimum most recent insertion}
@<Initialize the special list heads...@>=
-subtype(page_ins_head):=qi(255);
+subtype(page_ins_head):=65535;
type(page_ins_head):=split_up_node; vlink(page_ins_head):=page_ins_head;
@ An array |page_so_far| records the heights and depths of everything
@@ -24207,35 +21292,23 @@ all split and floating insertions.
@!insert_penalties:integer; {sum of the penalties for held-over insertions}
@ @<Put each...@>=
-primitive("pagegoal",set_page_dimen,0);
+primitive_tex("pagegoal",set_page_dimen,0,0);
@!@:page_goal_}{\.{\\pagegoal} primitive@>
-primitive("pagetotal",set_page_dimen,1);
+primitive_tex("pagetotal",set_page_dimen,1,0);
@!@:page_total_}{\.{\\pagetotal} primitive@>
-primitive("pagestretch",set_page_dimen,2);
+primitive_tex("pagestretch",set_page_dimen,2,0);
@!@:page_stretch_}{\.{\\pagestretch} primitive@>
-primitive("pagefilstretch",set_page_dimen,3);
+primitive_tex("pagefilstretch",set_page_dimen,3,0);
@!@:page_fil_stretch_}{\.{\\pagefilstretch} primitive@>
-primitive("pagefillstretch",set_page_dimen,4);
+primitive_tex("pagefillstretch",set_page_dimen,4,0);
@!@:page_fill_stretch_}{\.{\\pagefillstretch} primitive@>
-primitive("pagefilllstretch",set_page_dimen,5);
+primitive_tex("pagefilllstretch",set_page_dimen,5,0);
@!@:page_filll_stretch_}{\.{\\pagefilllstretch} primitive@>
-primitive("pageshrink",set_page_dimen,6);
+primitive_tex("pageshrink",set_page_dimen,6,0);
@!@:page_shrink_}{\.{\\pageshrink} primitive@>
-primitive("pagedepth",set_page_dimen,7);
+primitive_tex("pagedepth",set_page_dimen,7,0);
@!@:page_depth_}{\.{\\pagedepth} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-set_page_dimen: case chr_code of
-0: print_esc("pagegoal");
-1: print_esc("pagetotal");
-2: print_esc("pagestretch");
-3: print_esc("pagefilstretch");
-4: print_esc("pagefillstretch");
-5: print_esc("pagefilllstretch");
-6: print_esc("pageshrink");
-othercases print_esc("pagedepth")
-endcases;
-
@ @d print_plus_end(#)==print(#);@+end
@d print_plus(#)==if page_so_far[#]<>0 then
begin print(" plus "); print_scaled(page_so_far[#]); print_plus_end
@@ -24266,7 +21339,9 @@ if page_head<>page_tail then
while r<>page_ins_head do
begin print_ln; print_esc("insert"); t:=qo(subtype(r));
print_int(t); print(" adds ");
- t:=x_over_n(height(r),1000)*count(t); print_scaled(t);
+ if count(t)=1000 then t:=height(r)
+ else t:=x_over_n(height(r),1000)*count(t);
+ print_scaled(t);
if type(r)=split_up_node then
begin q:=page_head; t:=0;
repeat q:=vlink(q);
@@ -24344,7 +21419,7 @@ last_glue:=max_halfword; last_penalty:=0; last_kern:=0;
last_node_type:=-1;
page_depth:=0; page_max_depth:=0
-@ At certain times box 255 is supposed to be void (i.e., |null|),
+@ At certain times box \outputbox is supposed to be void (i.e., |null|),
or an insertion box is supposed to be ready to accept a vertical list.
If not, an error message is printed, and the following subroutine
flushes the unwanted contents, reporting them to the user.
@@ -24461,23 +21536,23 @@ we know its successor.
@<If the current page is empty...@>=
case type(p) of
-hlist_node,vlist_node,rule_node: if page_contents<box_there then
+hlist_node_case,vlist_node_case,rule_node_case: if page_contents<box_there then
@<Initialize the current page, insert the \.{\\topskip} glue
ahead of |p|, and |goto continue|@>
else @<Prepare to move a box or rule node to the current page,
then |goto contribute|@>;
-whatsit_node: @<Prepare to move whatsit |p| to the current page,
+whatsit_node_case: @<Prepare to move whatsit |p| to the current page,
then |goto contribute|@>;
-glue_node: if page_contents<box_there then goto done1
+glue_node_case: if page_contents<box_there then goto done1
else if precedes_break(page_tail) then pi:=0
else goto update_heights;
-kern_node: if page_contents<box_there then goto done1
+kern_node_case: if page_contents<box_there then goto done1
else if vlink(p)=null then return
else if type(vlink(p))=glue_node then pi:=0
else goto update_heights;
-penalty_node: if page_contents<box_there then goto done1@+else pi:=penalty(p);
-mark_node: goto contribute;
-ins_node: @<Append an insertion to the current page and |goto contribute|@>;
+penalty_node_case: if page_contents<box_there then goto done1@+else pi:=penalty(p);
+mark_node_case: goto contribute;
+ins_node_case: @<Append an insertion to the current page and |goto contribute|@>;
othercases confusion("page")
@:this can't happen page}{\quad page@>
endcases
@@ -24486,7 +21561,7 @@ endcases
begin if page_contents=empty then freeze_page_specs(box_there)
else page_contents:=box_there;
q:=new_skip_param(top_skip_code); {now |temp_ptr=glue_ptr(q)|}
-if (type(p)=hlist_node) and (is_mirrored(body_direction)) then begin
+if (type(p)=hlist_node) and is_mirrored(body_direction) then begin
if width(temp_ptr)>depth(p) then width(temp_ptr):=width(temp_ptr)-depth(p)
else width(temp_ptr):=0;
end
@@ -24499,7 +21574,7 @@ end
@ @<Prepare to move a box or rule node to the current page...@>=
begin
-if (type(p)=hlist_node) and (is_mirrored(body_direction)) then begin
+if (type(p)=hlist_node) and is_mirrored(body_direction) then begin
page_total:=page_total+page_depth+depth(p);
page_depth:=height(p);
end
@@ -24688,7 +21763,7 @@ end
@ When the page builder has looked at as much material as could appear before
the next page break, it makes its decision. The break that gave minimum
-badness will be used to put a completed ``page'' into box 255, with insertions
+badness will be used to put a completed ``page'' into box \.{\\outputbox}, with insertions
appended to their other boxes.
We also set the values of |top_mark|, |first_mark|, and |bot_mark|. The
@@ -24720,7 +21795,7 @@ for i:=0 to biggest_used_mark do begin
delete_first_mark(i);
end;
end;
-@<Put the \(o)optimal current page into box 255, update |first_mark| and
+@<Put the \(o)optimal current page into box |output_box|, update |first_mark| and
|bot_mark|, append insertions to their boxes, and put the
remaining nodes back on the contribution list@>;
for i:=0 to biggest_used_mark do begin
@@ -24747,9 +21822,9 @@ pointer |p| runs through the vlist, with |prev_p| trailing behind;
pointer |q| is the tail of a list of insertions that
are being held over for a subsequent page.
-@<Put the \(o)optimal current page into box 255...@>=
+@<Put the \(o)optimal current page into box ...@>=
if c=best_page_break then best_page_break:=null; {|c| not yet linked in}
-@<Ensure that box 255 is empty before output@>;
+@<Ensure that box |output_box| is empty before output@>;
insert_penalties:=0; {this will count the number of insertions held over}
save_split_top_skip:=split_top_skip;
if holding_inserts<=0 then
@@ -24767,17 +21842,17 @@ while p<>best_page_break do
prev_p:=p; p:=vlink(prev_p);
end;
split_top_skip:=save_split_top_skip;
-@<Break the current page at node |p|, put it in box~255,
+@<Break the current page at node |p|, put it in box~|output_box|,
and put the remaining nodes on the contribution list@>;
@<Delete \(t)the page-insertion nodes@>
-@ @<Ensure that box 255 is empty before output@>=
-if box(255)<>null then
- begin print_err(""); print_esc("box"); print("255 is not void");
-@:box255}{\.{\\box255 is not void}@>
- help2("You shouldn't use \box255 except in \output routines.")@/
+@ @<Ensure that box |output_box| is empty before output@>=
+if box(output_box)<>null then
+ begin print_err(""); print_esc("box"); print_int(output_box); print(" is not void");
+@:box\\outputbox}{\.{\\box\\outputbox is not void}@>
+ help2("You shouldn't use \box\outputbox except in \output routines.")@/
("Proceed, and I'll discard its present contents.");
- box_error(255);
+ box_error(output_box);
end
@ @<Update the values of |first_mark| and |bot_mark|@>=
@@ -24812,7 +21887,7 @@ if p<>null then
save_vbadness:=vbadness; vbadness:=inf_bad;
save_vfuzz:=vfuzz; vfuzz:=max_dimen; {inhibit error messages}
pack_direction:=body_direction;
-box(255):=filtered_vpackage(vlink(page_head),best_size,exactly,page_max_depth,output_group);
+box(output_box):=filtered_vpackage(vlink(page_head),best_size,exactly,page_max_depth,output_group);
vbadness:=save_vbadness; vfuzz:=save_vfuzz;
if last_glue<>max_halfword then delete_glue_ref(last_glue);
@<Start a new current page@>; {this sets |last_glue:=max_halfword|}
@@ -24912,7 +21987,7 @@ begin if vlink(page_head)<>null then
vlink(page_head):=null; page_tail:=page_head;
end;
flush_node_list(page_disc); page_disc:=null;
-ship_out(box(255)); box(255):=null;
+ship_out(box(output_box)); box(output_box):=null;
end
@ @<Explain that too many dead cycles have occurred in a row@>=
@@ -24920,14 +21995,14 @@ begin print_err("Output loop---"); print_int(dead_cycles);
@.Output loop...@>
print(" consecutive dead cycles");
help3("I've concluded that your \output is awry; it never does a")@/
-("\shipout, so I'm shipping \box255 out myself. Next time")@/
+("\shipout, so I'm shipping \box\outputbox out myself. Next time")@/
("increase \maxdeadcycles if you want me to be more patient!"); error;
end
@ @<Fire up the user's output routine and |return|@>=
begin output_active:=true;
incr(dead_cycles);
-push_nest; mode:=-vmode; prev_depth:=ignore_depth; mode_line:=-line;
+push_nest; mode:=-vmode; prev_depth:=pdf_ignored_dimen; mode_line:=-line;
begin_token_list(output_routine,output_text);
new_save_level(output_group); normal_paragraph;
scan_left_brace;
@@ -24943,7 +22018,7 @@ begin if (loc<>null) or
@<Recover from an unbalanced output routine@>;
end_token_list; {conserve stack space in case more outputs are triggered}
end_graf; unsave; output_active:=false; insert_penalties:=0;@/
-@<Ensure that box 255 is empty after output@>;
+@<Ensure that box |output_box| is empty after output@>;
if tail<>head then {current list goes after heldover insertions}
begin vlink(page_tail):=vlink(head);
page_tail:=tail;
@@ -24955,7 +22030,7 @@ if vlink(page_head)<>null then {and both go before heldover contributions}
vlink(page_head):=null; page_tail:=page_head;
end;
flush_node_list(page_disc); page_disc:=null;
-pop_nest; build_page;
+pop_nest; check_filter('after_output'); build_page;
end
@ @<Recover from an unbalanced output routine@>=
@@ -24967,15 +22042,15 @@ repeat get_token;
until loc=null;
end {loops forever if reading from a file, since |null=min_halfword<=0|}
-@ @<Ensure that box 255 is empty after output@>=
-if box(255)<>null then
+@ @<Ensure that box |output_box| is empty after output@>=
+if box(output_box)<>null then
begin print_err("Output routine didn't use all of ");
- print_esc("box"); print_int(255);
+ print_esc("box"); print_int(output_box);
@.Output routine didn't use...@>
- help3("Your \output commands should empty \box255,")@/
- ("e.g., by saying `\shipout\box255'.")@/
+ help3("Your \output commands should empty \box\outputbox,")@/
+ ("e.g., by saying `\shipout\box\outputbox'.")@/
("Proceed; I'll discard its present contents.");
- box_error(255);
+ box_error(output_box);
end
@* \[46] The chief executive.
@@ -25033,6 +22108,7 @@ label big_switch,reswitch,continue,exit;
var@!t,k:integer; {general-purpose temporary variables}
p:pointer; {for whatsit nodes and testing whether an auto kern should be inserted}
chr_stack:integer; { to temporarily save an |cur_chr| to be appended }
+mval:mathcodeval; { to build up an argument to |set_math_char| }
begin t:=0; {for -Wall}
chr_stack:=-1;
if every_job<>null then begin_token_list(every_job,every_job_text);
@@ -25059,7 +22135,7 @@ hmode+no_boundary: begin @<Append a |cancel_boundary_node| @>;
hmode+char_ghost: begin t:=cur_chr; get_x_token;
if (cur_cmd=letter)or(cur_cmd=other_char)or(cur_cmd=char_given)or
(cur_cmd=char_num) then begin
- p:=new_glyph(cur_font,cur_chr);
+ p:=new_glyph(cur_font,cur_chr);
if t=0 then begin set_is_leftghost(p); end
else begin set_is_rightghost(p); end;
tail_append(p);
@@ -25124,13 +22200,15 @@ if (cur_cmd=letter)or(cur_cmd=other_char)or
scan_char_num; cur_chr:=cur_val;
end;
if (chr_stack=ex_hyphen_char)and(cur_chr<>ex_hyphen_char)and(mode>0) then begin
- tail_append(new_disc); subtype(tail):=automatic_disc;
+ tail:=compound_word_break(tail,cur_lang);
+ subtype(tail):=automatic_disc;
end;
goto continue;
end
else begin
if (chr_stack=ex_hyphen_char) and (mode>0) then begin
- tail_append(new_disc); subtype(tail):=automatic_disc;
+ tail:=compound_word_break(tail,cur_lang);
+ subtype(tail):=automatic_disc;
end;
chr_stack:=-1;
goto reswitch;
@@ -25235,6 +22313,7 @@ any_mode(ignore_spaces): begin
end;
end;
vmode+stop: if its_all_over then return; {this is the only way out}
+@t\4@>@<Math cases in non-math modes@>;
@t\4@>@<Forbidden cases detected in |main_control|@>@+@,any_mode(mac_param):
report_illegal_case;
@<Math-only cases in non-math modes, or vice versa@>: insert_dollar_sign;
@@ -25248,8 +22327,7 @@ mode by mistake. \TeX\ will insert a dollar sign and rescan the current token.
@d non_math(#)==vmode+#,hmode+#
@<Math-only cases in non-math modes...@>=
-non_math(sup_mark), non_math(sub_mark), non_math(math_char_num),
-non_math(math_given), non_math(omath_given),
+non_math(sup_mark), non_math(sub_mark),
non_math(math_comp), non_math(delim_num),
non_math(left_right), non_math(above), non_math(radical),
non_math(math_style), non_math(math_choice), non_math(vcenter),
@@ -25258,6 +22336,36 @@ non_math(mskip), non_math(math_accent),
mmode+endv, mmode+par_end, mmode+stop, mmode+vskip, mmode+un_vbox,
mmode+valign, mmode+hrule
+@ @<Math cases in non-math modes@>=
+vmode+math_char_num, vmode+math_given, vmode+omath_given, vmode+xmath_given: begin
+ back_input; new_graf(true);
+ end;
+hmode+math_char_num: begin
+ if cur_chr=0 then
+ mval := scan_mathchar(tex_mathcode)
+ else if cur_chr=1 then
+ mval := scan_mathchar(aleph_mathcode)
+ else if cur_chr=2 then
+ mval := scan_mathchar(xetex_mathcode)
+ else
+ mval := scan_mathchar(xetexnum_mathcode);
+ math_char_in_text(mval);
+ end;
+hmode+math_given: begin
+ mval := mathchar_from_integer(cur_chr,tex_mathcode);
+ math_char_in_text(mval);
+ end;
+hmode+omath_given: begin
+ mval := mathchar_from_integer(cur_chr,aleph_mathcode);
+ math_char_in_text(mval);
+ end;
+hmode+xmath_given: begin
+ mval := mathchar_from_integer(cur_chr,xetex_mathcode);
+ math_char_in_text(mval);
+ end
+
+
+
@ @<Declare action...@>=
procedure insert_dollar_sign;
begin back_input; cur_tok:=math_shift_token+"$";
@@ -25317,14 +22425,11 @@ end;
endgame, since both of them have `|stop|' as their command code.
@<Put each...@>=
-primitive("end",stop,0);@/
+primitive_tex("end",stop,0,0);@/
@!@:end_}{\.{\\end} primitive@>
-primitive("dump",stop,1);@/
+primitive_tex("dump",stop,1,0);@/
@!@:dump_}{\.{\\dump} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-stop:if chr_code=1 then print_esc("dump")@+else print_esc("end");
-
@ We don't want to leave |main_control| immediately when a |stop| command
is sensed, because it may be necessary to invoke an \.{\\output} routine
several times before things really grind to a halt. (The output routine
@@ -25345,7 +22450,7 @@ begin if privileged then
width(tail):=hsize;
tail_append(new_glue(fill_glue));
tail_append(new_penalty(-@'10000000000));@/
- build_page; {append \.{\\hbox to \\hsize\{\}\\vfill\\penalty-'10000000000}}
+ check_filter('end'); build_page; {append \.{\\hbox to \\hsize\{\}\\vfill\\penalty-'10000000000}}
end;
its_all_over:=false;
exit:end;
@@ -25364,11 +22469,11 @@ is short, since the |scan_rule_spec| routine already does most of what is
required; thus, there is no need for a special action procedure.
Note that baselineskip calculations are disabled after a rule in vertical
-mode, by setting |prev_depth:=ignore_depth|.
+mode, by setting |prev_depth:=pdf_ignored_dimen|.
@<Cases of |main_control| that build...@>=
vmode+hrule,hmode+vrule,mmode+vrule: begin tail_append(scan_rule_spec);
- if abs(mode)=vmode then prev_depth:=ignore_depth
+ if abs(mode)=vmode then prev_depth:=pdf_ignored_dimen
else if abs(mode)=hmode then space_factor:=1000;
end;
@@ -25393,52 +22498,33 @@ The difference is in the value of |cur_chr|.
@d mskip_code=5 {identifies \.{\\mskip}}
@<Put each...@>=
-primitive("hskip",hskip,skip_code);@/
+primitive_tex("hskip",hskip,skip_code,0);@/
@!@:hskip_}{\.{\\hskip} primitive@>
-primitive("hfil",hskip,fil_code);
+primitive_tex("hfil",hskip,fil_code,0);
@!@:hfil_}{\.{\\hfil} primitive@>
-primitive("hfill",hskip,fill_code);@/
+primitive_tex("hfill",hskip,fill_code,0);@/
@!@:hfill_}{\.{\\hfill} primitive@>
-primitive("hss",hskip,ss_code);
+primitive_tex("hss",hskip,ss_code,0);
@!@:hss_}{\.{\\hss} primitive@>
-primitive("hfilneg",hskip,fil_neg_code);@/
+primitive_tex("hfilneg",hskip,fil_neg_code,0);@/
@!@:hfil_neg_}{\.{\\hfilneg} primitive@>
-primitive("vskip",vskip,skip_code);@/
+primitive_tex("vskip",vskip,skip_code,0);@/
@!@:vskip_}{\.{\\vskip} primitive@>
-primitive("vfil",vskip,fil_code);
+primitive_tex("vfil",vskip,fil_code,0);
@!@:vfil_}{\.{\\vfil} primitive@>
-primitive("vfill",vskip,fill_code);@/
+primitive_tex("vfill",vskip,fill_code,0);@/
@!@:vfill_}{\.{\\vfill} primitive@>
-primitive("vss",vskip,ss_code);
+primitive_tex("vss",vskip,ss_code,0);
@!@:vss_}{\.{\\vss} primitive@>
-primitive("vfilneg",vskip,fil_neg_code);@/
+primitive_tex("vfilneg",vskip,fil_neg_code,0);@/
@!@:vfil_neg_}{\.{\\vfilneg} primitive@>
-primitive("mskip",mskip,mskip_code);@/
+primitive_tex("mskip",mskip,mskip_code,0);@/
@!@:mskip_}{\.{\\mskip} primitive@>
-primitive("kern",kern,explicit);
+primitive_tex("kern",kern,explicit,0);
@!@:kern_}{\.{\\kern} primitive@>
-primitive("mkern",mkern,mu_glue);@/
+primitive_tex("mkern",mkern,mu_glue,0);@/
@!@:mkern_}{\.{\\mkern} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-hskip: case chr_code of
- skip_code:print_esc("hskip");
- fil_code:print_esc("hfil");
- fill_code:print_esc("hfill");
- ss_code:print_esc("hss");
- othercases print_esc("hfilneg")
- endcases;
-vskip: case chr_code of
- skip_code:print_esc("vskip");
- fil_code:print_esc("vfil");
- fill_code:print_esc("vfill");
- ss_code:print_esc("vss");
- othercases print_esc("vfilneg")
- endcases;
-mskip: print_esc("mskip");
-kern: print_esc("kern");
-mkern: print_esc("mkern");
-
@ All the work relating to glue creation has been relegated to the
following subroutine. It does not call |build_page|, because it is
used in at least one place where that would be a mistake.
@@ -25592,7 +22678,8 @@ procedure handle_right_brace;
var p,@!q:pointer; {for short-term use}
@!d:scaled; {holds |split_max_depth| in |insert_group|}
@!f:integer; {holds |floating_penalty| in |insert_group|}
-begin case cur_group of
+begin p:=null;
+case cur_group of
simple_group: begin
temp_no_whatsits:=no_local_whatsits;
temp_no_dirs:=no_local_dirs;
@@ -25696,57 +22783,40 @@ where the latter two are used denote \.{\\vbox} and \.{\\hbox}, respectively.
@d vtop_code=4 {|chr_code| for `\.{\\vtop}'}
@<Put each...@>=
-primitive("moveleft",hmove,1);
+primitive_tex("moveleft",hmove,1,0);
@!@:move_left_}{\.{\\moveleft} primitive@>
-primitive("moveright",hmove,0);@/
+primitive_tex("moveright",hmove,0,0);@/
@!@:move_right_}{\.{\\moveright} primitive@>
-primitive("raise",vmove,1);
+primitive_tex("raise",vmove,1,0);
@!@:raise_}{\.{\\raise} primitive@>
-primitive("lower",vmove,0);
+primitive_tex("lower",vmove,0,0);
@!@:lower_}{\.{\\lower} primitive@>
@#
-primitive("box",make_box,box_code);
+primitive_tex("box",make_box,box_code,0);
@!@:box_}{\.{\\box} primitive@>
-primitive("copy",make_box,copy_code);
+primitive_tex("copy",make_box,copy_code,0);
@!@:copy_}{\.{\\copy} primitive@>
-primitive("lastbox",make_box,last_box_code);
+primitive_tex("lastbox",make_box,last_box_code,0);
@!@:last_box_}{\.{\\lastbox} primitive@>
-primitive("vsplit",make_box,vsplit_code);
+primitive_tex("vsplit",make_box,vsplit_code,0);
@!@:vsplit_}{\.{\\vsplit} primitive@>
-primitive("vtop",make_box,vtop_code);@/
+primitive_tex("vtop",make_box,vtop_code,0);@/
@!@:vtop_}{\.{\\vtop} primitive@>
-primitive("vbox",make_box,vtop_code+vmode);
+primitive_tex("vbox",make_box,vtop_code+vmode,0);
@!@:vbox_}{\.{\\vbox} primitive@>
-primitive("hbox",make_box,vtop_code+hmode);@/
+primitive_tex("hbox",make_box,vtop_code+hmode,0);@/
@!@:hbox_}{\.{\\hbox} primitive@>
-primitive("shipout",leader_ship,a_leaders-1); {|ship_out_flag=leader_flag-1|}
+primitive_tex("shipout",leader_ship,a_leaders-1,0); {|ship_out_flag=leader_flag-1|}
@!@:ship_out_}{\.{\\shipout} primitive@>
-primitive("leaders",leader_ship,a_leaders);
+primitive_tex("leaders",leader_ship,a_leaders,0);
@!@:leaders_}{\.{\\leaders} primitive@>
-primitive("cleaders",leader_ship,c_leaders);
+primitive_tex("cleaders",leader_ship,c_leaders,0);
@!@:c_leaders_}{\.{\\cleaders} primitive@>
-primitive("xleaders",leader_ship,x_leaders);
+primitive_tex("xleaders",leader_ship,x_leaders,0);
@!@:x_leaders_}{\.{\\xleaders} primitive@>;
-primitive("boxdir",assign_box_dir,0);
+primitive_aleph("boxdir",assign_box_dir,0,0);
@!@:box_dir}{\.{\\boxdir} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-hmove: if chr_code=1 then print_esc("moveleft")@+else print_esc("moveright");
-vmove: if chr_code=1 then print_esc("raise")@+else print_esc("lower");
-make_box: case chr_code of
- box_code: print_esc("box");
- copy_code: print_esc("copy");
- last_box_code: print_esc("lastbox");
- vsplit_code: print_esc("vsplit");
- vtop_code: print_esc("vtop");
- vtop_code+vmode: print_esc("vbox");
- othercases print_esc("hbox")
- endcases;
-leader_ship: if chr_code=a_leaders then print_esc("leaders")
- else if chr_code=c_leaders then print_esc("cleaders")
- else if chr_code=x_leaders then print_esc("xleaders")
- else print_esc("shipout");
-
@ Constructions that require a box are started by calling |scan_box| with
a specified context code. The |scan_box| routine verifies
that a |make_box| command comes next and then it calls |begin_box|.
@@ -25777,7 +22847,6 @@ case can occur only with leaders.
@<Declare act...@>=
procedure box_end(@!box_context:integer);
-var p:pointer; {|ord_noad| for new box in math mode}
begin if box_context<box_flag then @<Append box |cur_box| to the current list,
shifted by |box_context|@>
else if box_context<ship_out_flag then @<Store \(c)|cur_box| in a box register@>
@@ -25810,10 +22879,7 @@ begin if cur_box<>null then
if mode>0 then begin check_filter('box'); build_page; end;
end
else begin if abs(mode)=hmode then space_factor:=1000
- else begin p:=new_noad;
- math_type(nucleus(p)):=sub_box;
- vinfo(nucleus(p)):=cur_box; cur_box:=p;
- end;
+ else cur_box:=new_sub_box(cur_box);
vlink(tail):=cur_box; tail:=cur_box;
end;
end;
@@ -25827,8 +22893,7 @@ else geq_define(box_base+box_context-global_box_flag,box_ref,cur_box)
@ @<Append a new leader node ...@>=
begin @<Get the next non-blank non-relax...@>;
if ((cur_cmd=hskip)and(abs(mode)<>vmode))or@|
- ((cur_cmd=vskip)and(abs(mode)=vmode))or@|
- ((cur_cmd=mskip)and(abs(mode)=mmode)) then
+ ((cur_cmd=vskip)and(abs(mode)=vmode)) then
begin append_glue; subtype(tail):=box_context-(leader_flag-a_leaders);
leader_ptr(tail):=cur_box;
end
@@ -25902,7 +22967,7 @@ done:end
@<Split off part of a vertical box, make |cur_box| point to it@>=
begin scan_register_num; n:=cur_val;
-if not scan_keyword("to") then
+if not scan_keyword('to') then
@.to@>
begin print_err("Missing `to' inserted");
@.Missing `to' inserted@>
@@ -25934,7 +22999,7 @@ else begin if k=vmode then scan_spec(vbox_group,true)
end;
push_nest; mode:=-k;
if k=vmode then
- begin prev_depth:=ignore_depth;
+ begin prev_depth:=pdf_ignored_dimen;
if every_vbox<>null then begin_token_list(every_vbox,every_vbox_text);
end
else begin space_factor:=1000;
@@ -26015,16 +23080,13 @@ or when the paragraph is explicitly started by `\.{\\quitvmode}',
`\.{\\indent}' or `\.{\\noindent}'.
@<Put each...@>=
-primitive("indent",start_par,1);
+primitive_tex("indent",start_par,1,0);
@!@:indent_}{\.{\\indent} primitive@>
-primitive("noindent",start_par,0);
+primitive_tex("noindent",start_par,0,0);
@!@:no_indent_}{\.{\\noindent} primitive@>
-primitive("quitvmode",start_par,2);
+primitive_pdftex("quitvmode",start_par,2,0);
@!@:quit_vmode_}{\.{\\quitvmode} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-start_par: if chr_code=0 then print_esc("noindent")@+ else if chr_code=1 then print_esc("indent")@+ else print_esc("quitvmode");
-
@ @<Cases of |main_control| that build...@>=
vmode+start_par: new_graf(cur_chr>0);
vmode+letter,vmode+other_char,vmode+char_num,vmode+char_given,
@@ -26041,8 +23103,6 @@ var p,q,dir_graf_tmp:pointer;
begin prev_graf:=0;
if (mode=vmode)or(head<>tail) then begin
tail_append(new_param_glue(par_skip_code));
- if nest_ptr=0 then
- check_filter('begin_of_par');
end;
push_nest; mode:=hmode; space_factor:=1000;
@<LOCAL: Add local paragraph node@>;
@@ -26067,7 +23127,7 @@ while vlink(q)<>null do q:=vlink(q);
tail:=q;
if every_par<>null then begin_token_list(every_par,every_par_text);
if nest_ptr=1 then begin
- build_page; {put |par_skip| glue on current page}
+ check_filter('new_graf'); build_page; {put |par_skip| glue on current page}
end;
end;
@@ -26076,13 +23136,11 @@ hmode+start_par,mmode+start_par: if cur_chr<>2 then indent_in_hmode;
@ @<Declare act...@>=
procedure indent_in_hmode;
-var p,@!q:pointer;
+var p:pointer;
begin if cur_chr>0 then {\.{\\indent}}
begin p:=new_null_box; width(p):=par_indent;
if abs(mode)=hmode then space_factor:=1000
- else begin q:=new_noad; math_type(nucleus(q)):=sub_box;
- vinfo(nucleus(q)):=p; p:=q;
- end;
+ else p:=new_sub_box(p);
tail_append(p);
end;
end;
@@ -26098,7 +23156,7 @@ vmode+par_end: begin normal_paragraph;
hmode+par_end: begin if align_state<0 then off_save; {this tries to
recover from an alignment that didn't end properly}
if (mode>0) and (nest[(nest_ptr-1)].mode_field=vmode) then
- line_break_context:=bottom_level;
+ line_break_context:=bottom_level;
end_graf; {this takes us to the enclosing mode, if |mode>0|}
if mode=vmode then begin check_filter('hmode_par'); build_page; end;
end;
@@ -26150,23 +23208,23 @@ vmode+vadjust,
@ @<Declare act...@>=
procedure begin_insert_or_adjust;
-begin if cur_cmd=vadjust then cur_val:=255
+begin if cur_cmd=vadjust then cur_val:=output_box
else begin scan_register_num;
- if cur_val=255 then
- begin print_err("You can't "); print_esc("insert"); print_int(255);
-@.You can't \\insert255@>
- help1("I'm changing to \insert0; box 255 is special.");
+ if cur_val=output_box then
+ begin print_err("You can't "); print_esc("insert"); print_int(output_box);
+@.You can't \\insert\outputbox@>
+ help1("I'm changing to \insert0; box \outputbox is special.");
error; cur_val:=0;
end;
end;
saved(0) := cur_val;
-if (cur_cmd = vadjust) and scan_keyword("pre") then
+if (cur_cmd = vadjust) and scan_keyword('pre') then
saved(1) := 1
else
saved(1) := 0;
save_ptr := save_ptr + 2;
new_save_level(insert_group); scan_left_brace; normal_paragraph;
-push_nest; mode:=-vmode; prev_depth:=ignore_depth;
+push_nest; mode:=-vmode; prev_depth:=pdf_ignored_dimen;
end;
@ @<Cases of |handle...@>=
@@ -26174,9 +23232,9 @@ insert_group: begin
line_break_context:=insert_group;
end_graf; q:=split_top_skip; add_glue_ref(q);
d:=split_max_depth; f:=floating_penalty; unsave; save_ptr := save_ptr - 2;
- {now |saved(0)| is the insertion number, or 255 for |vadjust|}
+ {now |saved(0)| is the insertion number, or |output_box| for |vadjust|}
p:=vpack(vlink(head),natural); pop_nest;
- if saved(0)<>255 then
+ if saved(0)<>output_box then
begin tail_append(new_node(ins_node,saved(0)));
height(tail):=height(p)+depth(p); ins_ptr(tail):=list_ptr(p);
split_top_ptr(tail):=q; depth(tail):=d; float_cost(tail):=f;
@@ -26275,31 +23333,21 @@ begin if (cur_chr<>glue_node)or(last_glue<>max_halfword) then
end
@ @<Put each...@>=
-primitive("unpenalty",remove_item,penalty_node);@/
+primitive_tex("unpenalty",remove_item,penalty_node,0);@/
@!@:un_penalty_}{\.{\\unpenalty} primitive@>
-primitive("unkern",remove_item,kern_node);@/
+primitive_tex("unkern",remove_item,kern_node,0);@/
@!@:un_kern_}{\.{\\unkern} primitive@>
-primitive("unskip",remove_item,glue_node);@/
+primitive_tex("unskip",remove_item,glue_node,0);@/
@!@:un_skip_}{\.{\\unskip} primitive@>
-primitive("unhbox",un_hbox,box_code);@/
+primitive_tex("unhbox",un_hbox,box_code,0);@/
@!@:un_hbox_}{\.{\\unhbox} primitive@>
-primitive("unhcopy",un_hbox,copy_code);@/
+primitive_tex("unhcopy",un_hbox,copy_code,0);@/
@!@:un_hcopy_}{\.{\\unhcopy} primitive@>
-primitive("unvbox",un_vbox,box_code);@/
+primitive_tex("unvbox",un_vbox,box_code,0);@/
@!@:un_vbox_}{\.{\\unvbox} primitive@>
-primitive("unvcopy",un_vbox,copy_code);@/
+primitive_tex("unvcopy",un_vbox,copy_code,0);@/
@!@:un_vcopy_}{\.{\\unvcopy} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-remove_item: if chr_code=glue_node then print_esc("unskip")
- else if chr_code=kern_node then print_esc("unkern")
- else print_esc("unpenalty");
-un_hbox: if chr_code=copy_code then print_esc("unhcopy")
- else print_esc("unhbox");
-un_vbox: if chr_code=copy_code then print_esc("unvcopy")
- @<Cases of |un_vbox| for |print_cmd_chr|@>@/
- else print_esc("unvbox");
-
@ The |un_hbox| and |un_vbox| commands unwrap one of the |number_regs| current boxes.
@<Cases of |main_control| that build...@>=
@@ -26373,21 +23421,15 @@ generated by primitive commands.
@d explicit_disc=1
@<Put each...@>=
-primitive("-",discretionary,explicit_disc);
+primitive_tex("-",discretionary,explicit_disc,0);
@!@:Single-character primitives -}{\quad\.{\\-}@>
-primitive("discretionary",discretionary,discretionary_disc);
+primitive_tex("discretionary",discretionary,discretionary_disc,0);
@!@:discretionary_}{\.{\\discretionary} primitive@>
-primitive("localleftbox",assign_local_box,0);
+primitive_omega("localleftbox",assign_local_box,0,0);
@!@:assign_local_box}{\.{\\localleftbox} primitive@>
-primitive("localrightbox",assign_local_box,1);
+primitive_omega("localrightbox",assign_local_box,1,0);
@!@:assign_local_box}{\.{\\localrightbox} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-discretionary: if chr_code=explicit_disc then
- print_esc("-")@+else print_esc("discretionary");
-assign_local_box: if chr_code=0 then print_esc("localleftbox")
- else print_esc("localrightbox");
-
@ @<Cases of |main_control| that build...@>=
hmode+discretionary,mmode+discretionary: append_discretionary;
any_mode(assign_local_box): append_local_box(cur_chr);
@@ -26409,9 +23451,9 @@ subtype(tail):=cur_chr;
if cur_chr=explicit_disc then begin
c:=get_pre_hyphen_char(cur_lang);
if c<>0 then begin
- vlink(pre_break(tail)):=new_char(cur_font,c);
+ vlink(pre_break(tail)):=new_char(cur_font,c);
alink(vlink(pre_break(tail))):=pre_break(tail);
- tlink(pre_break(tail)):=vlink(pre_break(tail));
+ tlink(pre_break(tail)):=vlink(pre_break(tail));
end;
c:=get_post_hyphen_char(cur_lang);
if c<>0 then begin
@@ -26516,7 +23558,7 @@ while p<>null do
end_diagnostic(true);
flush_node_list(p); vlink(q):=null; goto done;
end;
- q:=p; p:=vlink(q); incr(n);
+ alink(p):=q; q:=p; p:=vlink(q); incr(n);
end;
done:
@@ -26662,9 +23704,10 @@ Let's take a look at what happens when they are used correctly.
@<Cases of |main_control| that build...@>=
vmode+halign,hmode+valign:init_align;
-mmode+halign: if privileged then
+mmode+halign: if privileged then begin
if cur_group=math_shift_group then init_align
else off_save;
+ end;
vmode+endv,hmode+endv: do_endv;
@ An |align_group| code is supposed to remain on the |save_stack|
@@ -26717,500 +23760,134 @@ error;
end;
@* \[48] Building math lists.
-The routines that \TeX\ uses to create mlists are similar to those we have
-just seen for the generation of hlists and vlists. But it is necessary to
-make ``noads'' as well as nodes, so the reader should review the
-discussion of math mode data structures before trying to make sense out of
-the following program.
-Here is a little routine that needs to be done whenever a subformula
-is about to be processed. The parameter is a code like |math_group|.
-
-@<Declare act...@>=
-procedure push_math(@!c:group_code);
-begin
-if math_direction<>text_direction then dir_math_save:=true;
-push_nest; mode:=-mmode; incompleat_noad:=null;
-@<DIR: |new_save_level| math@>;
-end;
-
-@ We get into math mode from horizontal mode when a `\.\$' (i.e., a
-|math_shift| character) is scanned. We must check to see whether this
-`\.\$' is immediately followed by another, in case display math mode is
-called for.
+@ Almost all of this section is now in C, see |math.c|. Let here are just
+the definitions of the primitives and the infrastructure hooks into |main_control|,
+|print_cmd_chr| and |handle_right_brace|.
@<Cases of |main_control| that build...@>=
hmode+math_shift:init_math;
-
-@ @<Declare act...@>=
-procedure init_math;
-label found,not_found,done;
-var w:scaled; {new or partial |pre_display_size|}
-@!l:scaled; {new |display_width|}
-@!s:scaled; {new |display_indent|}
-@!p:pointer; {current node when calculating |pre_display_size|}
-@!q:pointer; {glue specification when calculating |pre_display_size|}
-@!f:internal_font_number; {font in current |char_node|}
-@!n:integer; {scope of paragraph shape specification}
-@!v:scaled; {|w| plus possible glue amount}
-@!d:scaled; {increment to |v|}
-begin get_token; {|get_x_token| would fail on \.{\\ifmmode}\thinspace!}
-if (cur_cmd=math_shift)and(mode>0) then @<Go into display math mode@>
-else begin back_input; @<Go into ordinary math mode@>;
- end;
-end;
-
-@ @<Go into ordinary math mode@>=
-begin push_math(math_shift_group); eq_word_define(int_base+cur_fam_code,-1);
-if every_math<>null then begin_token_list(every_math,every_math_text);
-end
-
-@ We get into ordinary math mode from display math mode when `\.{\\eqno}' or
-`\.{\\leqno}' appears. In such cases |cur_chr| will be 0 or~1, respectively;
-the value of |cur_chr| is placed onto |save_stack| for safe keeping.
-
-@<Cases of |main_control| that build...@>=
-mmode+eq_no: if privileged then
+mmode+eq_no: if privileged then begin
if cur_group=math_shift_group then start_eq_no
else off_save;
+ end;
@ @<Put each...@>=
-primitive("eqno",eq_no,0);
+primitive_tex("eqno",eq_no,0,0);
@!@:eq_no_}{\.{\\eqno} primitive@>
-primitive("leqno",eq_no,1);
+primitive_tex("leqno",eq_no,1,0);
@!@:leq_no_}{\.{\\leqno} primitive@>
-@ When \TeX\ is in display math mode, |cur_group=math_shift_group|,
-so it is not necessary for the |start_eq_no| procedure to test for
-this condition.
-
-@<Declare act...@>=
-procedure start_eq_no;
-begin saved(0):=cur_chr; incr(save_ptr);
-@<Go into ordinary math mode@>;
-end;
-
-@ @<Cases of |print_cmd_chr|...@>=
-eq_no:if chr_code=1 then print_esc("leqno")@+else print_esc("eqno");
-
@ @<Forbidden...@>=non_math(eq_no),
-@ When we enter display math mode, we need to call |line_break| to
-process the partial paragraph that has just been interrupted by the
-display. Then we can set the proper values of |display_width| and
-|display_indent| and |pre_display_size|.
-
-@<Go into display math mode@>=
-begin if head=tail then {`\.{\\noindent\$\$}' or `\.{\$\${ }\$\$}'}
- begin pop_nest; w:=-max_dimen;
- end
-else begin
- line_break(true);@/
- @<Calculate the natural width, |w|, by which the characters of the
- final line extend to the right of the reference point,
- plus two ems; or set |w:=max_dimen| if the non-blank information
- on that line is affected by stretching or shrinking@>;
- end;
-{now we are in vertical mode, working on the list that will contain the display}
-@<Calculate the length, |l|, and the shift amount, |s|, of the display lines@>;
-push_math(math_shift_group); mode:=mmode;
-eq_word_define(int_base+cur_fam_code,-1);@/
-eq_word_define(dimen_base+pre_display_size_code,w);
-eq_word_define(dimen_base+display_width_code,l);
-eq_word_define(dimen_base+display_indent_code,s);
-if every_display<>null then begin_token_list(every_display,every_display_text);
-if nest_ptr=1 then begin check_contrib_filter('before_display'); build_page; end;
-end
-
-@ @<Calculate the natural width, |w|, by which...@>=
-v:=shift_amount(just_box)+2*quad(cur_font); w:=-max_dimen;
-p:=list_ptr(just_box);
-while p<>null do
- begin @<Let |d| be the natural width of node |p|;
- if the node is ``visible,'' |goto found|;
- if the node is glue that stretches or shrinks, set |v:=max_dimen|@>;
- if v<max_dimen then v:=v+d;
- goto not_found;
- found: if v<max_dimen then
- begin v:=v+d; w:=v;
- end
- else begin w:=max_dimen; goto done;
- end;
- not_found: p:=vlink(p);
- end;
-done:
-
-@ @<Let |d| be the natural width of node |p|...@>=
-if is_char_node(p) then
- begin f:=font(p); d:=glyph_width(p);
- goto found;
- end;
-case type(p) of
-hlist_node,vlist_node,rule_node: begin d:=width(p); goto found;
- end;
-margin_kern_node: d:=width(p);
-kern_node: d:=width(p);
-math_node: d:=surround(p);
-glue_node:@<Let |d| be the natural width of this glue; if stretching
- or shrinking, set |v:=max_dimen|; |goto found| in the case of leaders@>;
-whatsit_node: @<Let |d| be the width of the whatsit |p|@>;
-othercases d:=0
-endcases
-
-@ We need to be careful that |w|, |v|, and |d| do not depend on any |glue_set|
-values, since such values are subject to system-dependent rounding.
-System-dependent numbers are not allowed to infiltrate parameters like
-|pre_display_size|, since \TeX82 is supposed to make the same decisions on all
-machines.
-
-@<Let |d| be the natural width of this glue...@>=
-begin q:=glue_ptr(p); d:=width(q);
-if glue_sign(just_box)=stretching then
- begin if (glue_order(just_box)=stretch_order(q))and@|
- (stretch(q)<>0) then
- v:=max_dimen;
- end
-else if glue_sign(just_box)=shrinking then
- begin if (glue_order(just_box)=shrink_order(q))and@|
- (shrink(q)<>0) then
- v:=max_dimen;
- end;
-if subtype(p)>=a_leaders then goto found;
-end
-
-@ A displayed equation is considered to be three lines long, so we
-calculate the length and offset of line number |prev_graf+2|.
-
-@<Calculate the length, |l|, ...@>=
-if par_shape_ptr=null then
- if (hang_indent<>0)and@|
- (((hang_after>=0)and(prev_graf+2>hang_after))or@|
- (prev_graf+1<-hang_after)) then
- begin l:=hsize-abs(hang_indent);
- if hang_indent>0 then s:=hang_indent@+else s:=0;
- end
- else begin l:=hsize; s:=0;
- end
-else begin n:=vinfo(par_shape_ptr);
- if prev_graf+2>=n then p:=par_shape_ptr+2*n
- else p:=par_shape_ptr+2*(prev_graf+2);
- s:=vmem(p-1).sc; l:=vmem(p).sc;
- end
-
-@ Subformulas of math formulas cause a new level of math mode to be entered,
-on the semantic nest as well as the save stack. These subformulas arise in
-several ways: (1)~A left brace by itself indicates the beginning of a
-subformula that will be put into a box, thereby freezing its glue and
-preventing line breaks. (2)~A subscript or superscript is treated as a
-subformula if it is not a single character; the same applies to
-the nucleus of things like \.{\\underline}. (3)~The \.{\\left} primitive
-initiates a subformula that will be terminated by a matching \.{\\right}.
-The group codes placed on |save_stack| in these three cases are
-|math_group|, |math_group|, and |math_left_group|, respectively.
-
-Here is the code that handles case (1); the other cases are not quite as
-trivial, so we shall consider them later.
-
-@<Cases of |main_control| that build...@>=
-mmode+left_brace: begin tail_append(new_noad);
- back_input; scan_math(nucleus(tail));
- end;
-
-@ Recall that the |nucleus|, |subscr|, and |supscr| fields in a noad are
-broken down into subfields called |math_type| and either |info| or
-|(fam,character)|. The job of |scan_math| is to figure out what to place
-in one of these principal fields; it looks at the subformula that
-comes next in the input, and places an encoding of that subformula
-into a given word of |mem|.
-
-@d fam_in_range==((cur_fam>=0)and(cur_fam<256))
-
-@<Declare act...@>=
-@t\4@>@<Declare the function called |fin_mlist|@>@t@>@;@/
-
-procedure scan_math(@!p:pointer);
-label restart,reswitch,exit;
-var c:integer; {math character code}
-begin restart:@<Get the next non-blank non-relax...@>;
-reswitch:case cur_cmd of
-letter,other_char,char_given: begin c:=get_math_code(cur_chr);
- if c=@"8000000 then
- begin @<Treat |cur_chr| as an active character@>;
- goto restart;
- end;
- end;
-char_num: begin scan_char_num; cur_chr:=cur_val; cur_cmd:=char_given;
- goto reswitch;
- end;
-math_char_num: begin
- if cur_chr=0 then scan_fifteen_bit_int
- else scan_big_fifteen_bit_int;
- c:=cur_val;
- end;
-math_given: begin
- c := ((cur_chr div @"1000) * @"1000000) +
- (((cur_chr mod @"1000) div @"100) * @"10000) +
- (cur_chr mod @"100);
- end;
-omath_given: begin c:=cur_chr;
- end;
-delim_num: begin
- if cur_chr=0 then scan_twenty_seven_bit_int
- else scan_fifty_one_bit_int;
- c:=cur_val;
- end;
-othercases @<Scan a subformula enclosed in braces and |return|@>
-endcases;@/
-math_type(p):=math_char; mcharacter(p):=qi(c mod @"10000);
-if (c>=var_code)and fam_in_range then fam(p):=cur_fam
-else fam(p):=(c div @"10000) mod @"100;
-exit:end;
-
-@ An active character that is an |outer_call| is allowed here.
-
-@<Treat |cur_chr|...@>=
-begin cur_cs:=(cur_chr mod number_active_chars)+active_base;
-cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs);
-x_token; back_input;
-end
-
-@ The pointer |p| is placed on |save_stack| while a complex subformula
-is being scanned.
-
-@<Scan a subformula...@>=
-begin back_input; scan_left_brace;@/
-saved(0):=p; incr(save_ptr); push_math(math_group); return;
-end
-
-@ The simplest math formula is, of course, `\.{\${ }\$}', when no noads are
-generated. The next simplest cases involve a single character, e.g.,
-`\.{\$x\$}'. Even though such cases may not seem to be very interesting,
-the reader can perhaps understand how happy the author was when `\.{\$x\$}'
-was first properly typeset by \TeX. The code in this section was used.
-@^Knuth, Donald Ervin@>
-
-@<Cases of |main_control| that build...@>=
+@ @<Cases of |main_control| that build...@>=
+mmode+left_brace: math_left_brace;
mmode+letter,mmode+other_char,mmode+char_given:
set_math_char(get_math_code(cur_chr));
mmode+char_num: begin scan_char_num; cur_chr:=cur_val;
set_math_char(get_math_code(cur_chr));
end;
mmode+math_char_num: begin
- if cur_chr=0 then scan_fifteen_bit_int
- else scan_big_fifteen_bit_int;
- set_math_char(cur_val);
+ if cur_chr=0 then
+ mval := scan_mathchar(tex_mathcode)
+ else if cur_chr=1 then
+ mval := scan_mathchar(aleph_mathcode)
+ else if cur_chr=2 then
+ mval := scan_mathchar(xetex_mathcode)
+ else
+ mval := scan_mathchar(xetexnum_mathcode);
+ set_math_char(mval);
end;
mmode+math_given: begin
- set_math_char(((cur_chr div @"1000) * @"1000000) +
- (((cur_chr mod @"1000) div @"100) * @"10000) +
- (cur_chr mod @"100));
+ mval := mathchar_from_integer(cur_chr,tex_mathcode);
+ set_math_char(mval);
end;
-mmode+omath_given: set_math_char(cur_chr);
-mmode+delim_num: begin
- if cur_chr=0 then scan_twenty_seven_bit_int
- else scan_fifty_one_bit_int;
- set_math_char(cur_val);
+mmode+omath_given: begin
+ mval := mathchar_from_integer(cur_chr,aleph_mathcode);
+ set_math_char(mval);
end;
-
-@ The |set_math_char| procedure creates a new noad appropriate to a given
-math code, and appends it to the current mlist. However, if the math code
-is sufficiently large, the |cur_chr| is treated as an active character and
-nothing is appended.
-
-@<Declare act...@>=
-procedure set_math_char(@!c:integer);
-var p:pointer; {the new noad}
-begin if c>=@"8000000 then
- @<Treat |cur_chr|...@>
-else begin p:=new_noad; math_type(nucleus(p)):=math_char;
- mcharacter(nucleus(p)):=qi(c mod @"10000);
- fam(nucleus(p)):=(c div @"10000) mod @"100;
- if c>=var_code then
- begin if fam_in_range then fam(nucleus(p)):=cur_fam;
- type(p):=ord_noad;
- end
- else
- type(p):=ord_noad+(c div @"1000000);
- vlink(tail):=p; tail:=p;
+mmode+xmath_given: begin
+ mval := mathchar_from_integer(cur_chr,xetex_mathcode);
+ set_math_char(mval);
+ end;
+mmode+delim_num: begin
+ if cur_chr=0 then
+ mval := scan_delimiter_as_mathchar(tex_mathcode)
+ else if cur_chr=1 then
+ mval := scan_delimiter_as_mathchar(aleph_mathcode)
+ else
+ mval := scan_delimiter_as_mathchar(xetex_mathcode);
+ set_math_char(mval);
end;
-end;
@ Primitive math operators like \.{\\mathop} and \.{\\underline} are given
the command code |math_comp|, supplemented by the noad type that they
generate.
@<Put each...@>=
-primitive("mathord",math_comp,ord_noad);
+primitive_tex("mathord",math_comp,ord_noad,0);
@!@:math_ord_}{\.{\\mathord} primitive@>
-primitive("mathop",math_comp,op_noad);
+primitive_tex("mathop",math_comp,op_noad,0);
@!@:math_op_}{\.{\\mathop} primitive@>
-primitive("mathbin",math_comp,bin_noad);
+primitive_tex("mathbin",math_comp,bin_noad,0);
@!@:math_bin_}{\.{\\mathbin} primitive@>
-primitive("mathrel",math_comp,rel_noad);
+primitive_tex("mathrel",math_comp,rel_noad,0);
@!@:math_rel_}{\.{\\mathrel} primitive@>
-primitive("mathopen",math_comp,open_noad);
+primitive_tex("mathopen",math_comp,open_noad,0);
@!@:math_open_}{\.{\\mathopen} primitive@>
-primitive("mathclose",math_comp,close_noad);
+primitive_tex("mathclose",math_comp,close_noad,0);
@!@:math_close_}{\.{\\mathclose} primitive@>
-primitive("mathpunct",math_comp,punct_noad);
+primitive_tex("mathpunct",math_comp,punct_noad,0);
@!@:math_punct_}{\.{\\mathpunct} primitive@>
-primitive("mathinner",math_comp,inner_noad);
+primitive_tex("mathinner",math_comp,inner_noad,0);
@!@:math_inner_}{\.{\\mathinner} primitive@>
-primitive("underline",math_comp,under_noad);
+primitive_tex("underline",math_comp,under_noad,0);
@!@:underline_}{\.{\\underline} primitive@>
-primitive("overline",math_comp,over_noad);@/
+primitive_tex("overline",math_comp,over_noad,0);@/
@!@:overline_}{\.{\\overline} primitive@>
-primitive("displaylimits",limit_switch,normal);
+primitive_tex("displaylimits",limit_switch,normal,0);
@!@:display_limits_}{\.{\\displaylimits} primitive@>
-primitive("limits",limit_switch,limits);
+primitive_tex("limits",limit_switch,limits,0);
@!@:limits_}{\.{\\limits} primitive@>
-primitive("nolimits",limit_switch,no_limits);
+primitive_tex("nolimits",limit_switch,no_limits,0);
@!@:no_limits_}{\.{\\nolimits} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-math_comp: case chr_code of
- ord_noad: print_esc("mathord");
- op_noad: print_esc("mathop");
- bin_noad: print_esc("mathbin");
- rel_noad: print_esc("mathrel");
- open_noad: print_esc("mathopen");
- close_noad: print_esc("mathclose");
- punct_noad: print_esc("mathpunct");
- inner_noad: print_esc("mathinner");
- under_noad: print_esc("underline");
- othercases print_esc("overline")
- endcases;
-limit_switch: if chr_code=limits then print_esc("limits")
- else if chr_code=no_limits then print_esc("nolimits")
- else print_esc("displaylimits");
-
@ @<Cases of |main_control| that build...@>=
-mmode+math_comp: begin tail_append(new_noad);
- type(tail):=cur_chr; scan_math(nucleus(tail));
- end;
+mmode+math_comp: math_math_comp;
mmode+limit_switch: math_limit_switch;
-
-@ @<Declare act...@>=
-procedure math_limit_switch;
-label exit;
-begin if head<>tail then if type(tail)=op_noad then
- begin subtype(tail):=cur_chr; return;
- end;
-print_err("Limit controls must follow a math operator");
-@.Limit controls must follow...@>
-help1("I'm ignoring this misplaced \limits or \nolimits command."); error;
-exit:end;
-
-@ Delimiter fields of noads are filled in by the |scan_delimiter| routine.
-The first parameter of this procedure is the |mem| address where the
-delimiter is to be placed; the second tells if this delimiter follows
-\.{\\radical} or not.
-
-@<Declare act...@>=
-procedure scan_delimiter(@!p:pointer;@!r:integer);
-begin if r=1 then scan_twenty_seven_bit_int
-else if r=2 then scan_fifty_one_bit_int
-else begin @<Get the next non-blank non-relax...@>;
- case cur_cmd of
- letter,other_char: begin
- cur_val:=get_del_code_a(cur_chr); cur_val1:=get_del_code_b(cur_chr);
- end;
- delim_num: if cur_chr=0 then scan_twenty_seven_bit_int
- else scan_fifty_one_bit_int;
- othercases begin cur_val:=-1; cur_val1:=-1; end;
- endcases;
- end;
-if cur_val<0 then begin @<Report that an invalid delimiter code is being changed
- to null; set~|cur_val:=0|@>;
- cur_val1:=0;
- end;
-small_fam(p):=(cur_val div @"10000) mod @"100;
-small_char(p):=qi(cur_val mod @"10000);
-large_fam(p):=(cur_val1 div @"10000) mod @"100;
-large_char(p):=qi(cur_val1 mod @"10000);
-end;
-
-@ @<Report that an invalid delimiter...@>=
-begin print_err("Missing delimiter (. inserted)");
-@.Missing delimiter...@>
-help6("I was expecting to see something like `(' or `\{' or")@/
- ("`\}' here. If you typed, e.g., `{' instead of `\{', you")@/
- ("should probably delete the `{' by typing `1' now, so that")@/
- ("braces don't get unbalanced. Otherwise just proceed.")@/
- ("Acceptable delimiters are characters whose \delcode is")@/
- ("nonnegative, or you can use `\delimiter <delimiter code>'.");
-back_error; cur_val:=0;
-end
-
-@ @<Cases of |main_control| that build...@>=
-mmode+radical:math_radical;
-
-@ @<Declare act...@>=
-procedure math_radical;
-begin tail_append(new_node(radical_noad,normal));
-vmem(nucleus(tail)).hh:=empty_field;
-vmem(subscr(tail)).hh:=empty_field;
-vmem(supscr(tail)).hh:=empty_field;
-scan_delimiter(left_delimiter(tail),cur_chr+1);
-scan_math(nucleus(tail));
-end;
-
-@ @<Cases of |main_control| that build...@>=
+mmode+radical: math_radical;
mmode+accent,mmode+math_accent:math_ac;
-
-@ @<Declare act...@>=
-procedure math_ac;
-begin if cur_cmd=accent then
- @<Complain that the user should have said \.{\\mathaccent}@>;
-tail_append(new_node(accent_noad,normal));
-vmem(nucleus(tail)).hh:=empty_field;
-vmem(subscr(tail)).hh:=empty_field;
-vmem(supscr(tail)).hh:=empty_field;
-math_type(accent_chr(tail)):=math_char;
-if cur_chr=0 then scan_fifteen_bit_int
-else scan_big_fifteen_bit_int;
-mcharacter(accent_chr(tail)):=qi(cur_val mod @"1000);
-if (cur_val>=var_code)and fam_in_range then fam(accent_chr(tail)):=cur_fam
-else fam(accent_chr(tail)):=(cur_val div @"10000) mod @"100;
-scan_math(nucleus(tail));
-end;
-
-@ @<Complain that the user should have said \.{\\mathaccent}@>=
-begin print_err("Please use "); print_esc("mathaccent");
-print(" for accents in math mode");
-@.Please use \\mathaccent...@>
-help2("I'm changing \accent to \mathaccent here; wish me luck.")@/
- ("(Accents are not the same in formulas as they are in text.)");
-error;
-end
-
-@ @<Cases of |main_control| that build...@>=
mmode+vcenter: begin scan_spec(vcenter_group,false); normal_paragraph;
- push_nest; mode:=-vmode; prev_depth:=ignore_depth;
+ push_nest; mode:=-vmode; prev_depth:=pdf_ignored_dimen;
if every_vbox<>null then begin_token_list(every_vbox,every_vbox_text);
end;
@ @<Cases of |handle...@>=
vcenter_group: begin line_break_context:=vcenter_group; end_graf; unsave; save_ptr:=save_ptr-2;
p:=vpack(vlink(head),saved(1),saved(0)); pop_nest;
- tail_append(new_noad); type(tail):=vcenter_noad;
- math_type(nucleus(tail)):=sub_box; vinfo(nucleus(tail)):=p;
+ p:=math_vcenter_group(p);
+ tail_append(p);
end;
@ The routine that inserts a |style_node| holds no surprises.
@<Put each...@>=
-primitive("displaystyle",math_style,display_style);
+primitive_tex("displaystyle",math_style,display_style,0);
@!@:display_style_}{\.{\\displaystyle} primitive@>
-primitive("textstyle",math_style,text_style);
+primitive_tex("textstyle",math_style,text_style,0);
@!@:text_style_}{\.{\\textstyle} primitive@>
-primitive("scriptstyle",math_style,script_style);
+primitive_tex("scriptstyle",math_style,script_style,0);
@!@:script_style_}{\.{\\scriptstyle} primitive@>
-primitive("scriptscriptstyle",math_style,script_script_style);
+primitive_tex("scriptscriptstyle",math_style,script_script_style,0);
@!@:script_script_style_}{\.{\\scriptscriptstyle} primitive@>
-
-@ @<Cases of |print_cmd_chr|...@>=
-math_style: print_style(chr_code);
+primitive_luatex("crampeddisplaystyle",math_style,cramped_display_style,0);
+@!@:cramped_display_style_}{\.{\\crampeddisplaystyle} primitive@>
+primitive_luatex("crampedtextstyle",math_style,cramped_text_style,0);
+@!@:cramped_text_style_}{\.{\\crampedtextstyle} primitive@>
+primitive_luatex("crampedscriptstyle",math_style,cramped_script_style,0);
+@!@:cramped_script_style_}{\.{\\crampedscriptstyle} primitive@>
+primitive_luatex("crampedscriptscriptstyle",math_style,cramped_script_script_style,0);
+@!@:cramped_script_script_style_}{\.{\\crampedscriptscriptstyle} primitive@>
@ @<Cases of |main_control| that build...@>=
mmode+math_style: tail_append(new_style(cur_chr));
@@ -27219,531 +23896,58 @@ mmode+non_script: begin tail_append(new_glue(zero_glue));
end;
mmode+math_choice: append_choices;
-@ The routine that scans the four mlists of a \.{\\mathchoice} is very
-much like the routine that builds discretionary nodes.
-
-@<Declare act...@>=
-procedure append_choices;
-begin tail_append(new_choice); incr(save_ptr); saved(-1):=0;
-push_math(math_choice_group); scan_left_brace;
-end;
-
@ @<Cases of |handle_right_brace|...@>=
math_choice_group: build_choices;
-@ @<Declare act...@>=
-procedure build_choices;
-label exit;
-var p:pointer; {the current mlist}
-begin @<DIR: |unsave| math@>; p:=fin_mlist(null);
-case saved(-1) of
-0:display_mlist(tail):=p;
-1:text_mlist(tail):=p;
-2:script_mlist(tail):=p;
-3:begin script_script_mlist(tail):=p; decr(save_ptr); return;
- end;
-end; {there are no other cases}
-incr(saved(-1)); push_math(math_choice_group); scan_left_brace;
-exit:end;
-
-@ Subscripts and superscripts are attached to the previous nucleus by the
-@^superscripts@>@^subscripts@>
-action procedure called |sub_sup|. We use the facts that |sub_mark=sup_mark+1|
-and |subscr(p)=supscr(p)+1|.
-
-@<Cases of |main_control| that build...@>=
+@ @<Cases of |main_control| that build...@>=
mmode+sub_mark,mmode+sup_mark: sub_sup;
-@ @<Declare act...@>=
-procedure sub_sup;
-var t:small_number; {type of previous sub/superscript}
-@!p:pointer; {field to be filled by |scan_math|}
-begin t:=empty; p:=null;
-if tail<>head then if scripts_allowed(tail) then
- begin p:=supscr(tail)+cur_cmd-sup_mark; {|supscr| or |subscr|}
- t:=math_type(p);
- end;
-if (p=null)or(t<>empty) then @<Insert a dummy noad to be sub/superscripted@>;
-scan_math(p);
-end;
-
-@ @<Insert a dummy...@>=
-begin tail_append(new_noad);
-p:=supscr(tail)+cur_cmd-sup_mark; {|supscr| or |subscr|}
-if t<>empty then
- begin if cur_cmd=sup_mark then
- begin print_err("Double superscript");
-@.Double superscript@>
- help1("I treat `x^1^2' essentially like `x^1{}^2'.");
- end
- else begin print_err("Double subscript");
-@.Double subscript@>
- help1("I treat `x_1_2' essentially like `x_1{}_2'.");
- end;
- error;
- end;
-end
-
-@ An operation like `\.{\\over}' causes the current mlist to go into a
-state of suspended animation: |incompleat_noad| points to a |fraction_noad|
-that contains the mlist-so-far as its numerator, while the denominator
-is yet to come. Finally when the mlist is finished, the denominator will
-go into the incompleat fraction noad, and that noad will become the
-whole formula, unless it is surrounded by `\.{\\left}' and `\.{\\right}'
-delimiters.
-
+@
@d above_code=0 { `\.{\\above}' }
@d over_code=1 { `\.{\\over}' }
@d atop_code=2 { `\.{\\atop}' }
@d delimited_code=3 { `\.{\\abovewithdelims}', etc.}
@<Put each...@>=
-primitive("above",above,above_code);@/
+primitive_tex("above",above,above_code,0);@/
@!@:above_}{\.{\\above} primitive@>
-primitive("over",above,over_code);@/
+primitive_tex("over",above,over_code,0);@/
@!@:over_}{\.{\\over} primitive@>
-primitive("atop",above,atop_code);@/
+primitive_tex("atop",above,atop_code,0);@/
@!@:atop_}{\.{\\atop} primitive@>
-primitive("abovewithdelims",above,delimited_code+above_code);@/
+primitive_tex("abovewithdelims",above,delimited_code+above_code,0);@/
@!@:above_with_delims_}{\.{\\abovewithdelims} primitive@>
-primitive("overwithdelims",above,delimited_code+over_code);@/
+primitive_tex("overwithdelims",above,delimited_code+over_code,0);@/
@!@:over_with_delims_}{\.{\\overwithdelims} primitive@>
-primitive("atopwithdelims",above,delimited_code+atop_code);
+primitive_tex("atopwithdelims",above,delimited_code+atop_code,0);
@!@:atop_with_delims_}{\.{\\atopwithdelims} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-above: case chr_code of
- over_code:print_esc("over");
- atop_code:print_esc("atop");
- delimited_code+above_code:print_esc("abovewithdelims");
- delimited_code+over_code:print_esc("overwithdelims");
- delimited_code+atop_code:print_esc("atopwithdelims");
- othercases print_esc("above")
- endcases;
-
@ @<Cases of |main_control| that build...@>=
mmode+above: math_fraction;
-@ @<Declare act...@>=
-procedure math_fraction;
-var c:small_number; {the type of generalized fraction we are scanning}
-begin c:=cur_chr;
-if incompleat_noad<>null then
- @<Ignore the fraction operation and complain about this ambiguous case@>
-else begin incompleat_noad:=new_node(fraction_noad,normal);
- math_type(numerator(incompleat_noad)):=sub_mlist;
- vinfo(numerator(incompleat_noad)):=vlink(head);
- vmem(denominator(incompleat_noad)).hh:=empty_field;
- vmem(left_delimiter(incompleat_noad)).qqqq:=null_delimiter;
- vmem(right_delimiter(incompleat_noad)).qqqq:=null_delimiter;@/
- vlink(head):=null; tail:=head;
- @<Use code |c| to distinguish between generalized fractions@>;
- end;
-end;
-
-@ @<Use code |c|...@>=
-if c>=delimited_code then
- begin scan_delimiter(left_delimiter(incompleat_noad),false);
- scan_delimiter(right_delimiter(incompleat_noad),false);
- end;
-case c mod delimited_code of
-above_code: begin scan_normal_dimen;
- thickness(incompleat_noad):=cur_val;
- end;
-over_code: thickness(incompleat_noad):=default_code;
-atop_code: thickness(incompleat_noad):=0;
-end {there are no other cases}
-
-@ @<Ignore the fraction...@>=
-begin if c>=delimited_code then
- begin scan_delimiter(garbage,false); scan_delimiter(garbage,false);
- end;
-if c mod delimited_code=above_code then scan_normal_dimen;
-print_err("Ambiguous; you need another { and }");
-@.Ambiguous...@>
-help3("I'm ignoring this fraction specification, since I don't")@/
- ("know whether a construction like `x \over y \over z'")@/
- ("means `{x \over y} \over z' or `x \over {y \over z}'.");
-error;
-end
-
-@ At the end of a math formula or subformula, the |fin_mlist| routine is
-called upon to return a pointer to the newly completed mlist, and to
-pop the nest back to the enclosing semantic level. The parameter to
-|fin_mlist|, if not null, points to a |right_noad| that ends the
-current mlist; this |right_noad| has not yet been appended.
-
-@<Declare the function called |fin_mlist|@>=
-function fin_mlist(@!p:pointer):pointer;
-var q:pointer; {the mlist to return}
-begin if incompleat_noad<>null then @<Compleat the incompleat noad@>
-else begin vlink(tail):=p; q:=vlink(head);
- end;
-pop_nest; fin_mlist:=q;
-end;
-
-@ @<Compleat...@>=
-begin math_type(denominator(incompleat_noad)):=sub_mlist;
-vinfo(denominator(incompleat_noad)):=vlink(head);
-if p=null then q:=incompleat_noad
-else begin q:=vinfo(numerator(incompleat_noad));
- if (type(q)<>left_noad)or(delim_ptr=null) then confusion("right");
-@:this can't happen right}{\quad right@>
- vinfo(numerator(incompleat_noad)):=vlink(delim_ptr);
- vlink(delim_ptr):=incompleat_noad; vlink(incompleat_noad):=p;
- end;
-end
-
-@ Now at last we're ready to see what happens when a right brace occurs
-in a math formula. Two special cases are simplified here: Braces are effectively
-removed when they surround a single Ord without sub/superscripts, or when they
-surround an accent that is the nucleus of an Ord atom.
-
-@<Cases of |handle...@>=
-math_group: begin @<DIR: |unsave| math@>; decr(save_ptr);@/
- math_type(saved(0)):=sub_mlist; p:=fin_mlist(null); vinfo(saved(0)):=p;
- if p<>null then if vlink(p)=null then
- if type(p)=ord_noad then
- begin if math_type(subscr(p))=empty then
- if math_type(supscr(p))=empty then
- begin vmem(saved(0)).hh:=vmem(nucleus(p)).hh;
- flush_node(p);
- end;
- end
- else if type(p)=accent_noad then if saved(0)=nucleus(tail) then
- if type(tail)=ord_noad then @<Replace the tail of the list by |p|@>;
- end;
-
-@ @<Replace the tail...@>=
-begin q:=head; while vlink(q)<>tail do q:=vlink(q);
-vlink(q):=p; flush_node(tail); tail:=p;
-end
+@ @<Cases of |handle...@>=
+math_group: close_math_group(p);
-@ We have dealt with all constructions of math mode except `\.{\\left}' and
-`\.{\\right}', so the picture is completed by the following sections of
-the program.
+@
@<Put each...@>=
-primitive("left",left_right,left_noad);
+primitive_tex("left",left_right,left_noad_side,0);
@!@:left_}{\.{\\left} primitive@>
-primitive("right",left_right,right_noad);
+primitive_tex("right",left_right,right_noad_side,0);
@!@:right_}{\.{\\right} primitive@>
+primitive_tex("middle",left_right,middle_noad_side,0);
+@!@:middle_}{\.{\\middle} primitive@>
text(frozen_right):="right"; eqtb[frozen_right]:=eqtb[cur_val];
-@ @<Cases of |print_cmd_chr|...@>=
-left_right: if chr_code=left_noad then print_esc("left")
-@/@<Cases of |left_right| for |print_cmd_chr|@>@/
-else print_esc("right");
-
@ @<Cases of |main_control| that build...@>=
mmode+left_right: math_left_right;
-@ @<Declare act...@>=
-procedure math_left_right;
-var t:small_number; {|left_noad| or |right_noad|}
-@!p:pointer; {new noad}
-@!q:pointer; {resulting mlist}
-begin t:=cur_chr;
-if (t<>left_noad)and(cur_group<>math_left_group) then
- @<Try to recover from mismatched \.{\\right}@>
-else begin p:=new_noad; type(p):=t;
- scan_delimiter(delimiter(p),false);
- if t=middle_noad then
- begin type(p):=right_noad; subtype(p):=middle_noad;
- end;
- if t=left_noad then q:=p
- else begin q:=fin_mlist(p);
- @<DIR: |unsave| math@>; {end of |math_left_group|}
- end;
- if t<>right_noad then
- begin push_math(math_left_group); vlink(head):=q; tail:=p;
- delim_ptr:=p;
- end
- else begin
- tail_append(new_noad); type(tail):=inner_noad;
- math_type(nucleus(tail)):=sub_mlist;
- vinfo(nucleus(tail)):=q;
- end;
- end;
-end;
-
-@ @<Try to recover from mismatch...@>=
-begin if cur_group=math_shift_group then
- begin scan_delimiter(garbage,false);
- print_err("Extra ");
- if t=middle_noad then
- begin print_esc("middle");
-@.Extra \\middle.@>
- help1("I'm ignoring a \middle that had no matching \left.");
- end
- else begin print_esc("right");
-@.Extra \\right.@>
- help1("I'm ignoring a \right that had no matching \left.");
- end;
- error;
- end
-else off_save;
-end
-
@ Here is the only way out of math mode.
@<Cases of |main_control| that build...@>=
mmode+math_shift: if cur_group=math_shift_group then after_math
else off_save;
-@ @<Declare act...@>=
-procedure after_math;
-var l:boolean; {`\.{\\leqno}' instead of `\.{\\eqno}'}
-@!danger:boolean; {not enough symbol fonts are present}
-@!m:integer; {|mmode| or |-mmode|}
-@!p:pointer; {the formula}
-@!a:pointer; {box containing equation number}
-@<Local variables for finishing a displayed formula@>@;
-begin danger:=false;
-@<Check that the necessary fonts for math symbols are present;
- if not, flush the current math lists and set |danger:=true|@>;
-m:=mode; l:=false; p:=fin_mlist(null); {this pops the nest}
-if mode=-m then {end of equation number}
- begin @<Check that another \.\$ follows@>;
- cur_mlist:=p; cur_style:=text_style; mlist_penalties:=false;
- mlist_to_hlist; a:=hpack(vlink(temp_head),natural);
- @<DIR: |unsave| math@>;
- decr(save_ptr); {now |cur_group=math_shift_group|}
- if saved(0)=1 then l:=true;
- danger:=false;
- @<Check that the necessary fonts for math symbols are present;
- if not, flush the current math lists and set |danger:=true|@>;
- m:=mode; p:=fin_mlist(null);
- end
-else a:=null;
-if m<0 then @<Finish math in text@>
-else begin if a=null then @<Check that another \.\$ follows@>;
- @<Finish displayed math@>;
- end;
-end;
-
-@ @<Check that the necessary fonts...@>=
-if (font_params(fam_fnt(2+text_size))<total_mathsy_params)or@|
- (font_params(fam_fnt(2+script_size))<total_mathsy_params)or@|
- (font_params(fam_fnt(2+script_script_size))<total_mathsy_params) then
- begin print_err("Math formula deleted: Insufficient symbol fonts");@/
-@.Math formula deleted...@>
- help3("Sorry, but I can't typeset math unless \textfont 2")@/
- ("and \scriptfont 2 and \scriptscriptfont 2 have all")@/
- ("the \fontdimen values needed in math symbol fonts.");
- error; flush_math; danger:=true;
- end
-else if (font_params(fam_fnt(3+text_size))<total_mathex_params)or@|
- (font_params(fam_fnt(3+script_size))<total_mathex_params)or@|
- (font_params(fam_fnt(3+script_script_size))<total_mathex_params) then
- begin print_err("Math formula deleted: Insufficient extension fonts");@/
- help3("Sorry, but I can't typeset math unless \textfont 3")@/
- ("and \scriptfont 3 and \scriptscriptfont 3 have all")@/
- ("the \fontdimen values needed in math extension fonts.");
- error; flush_math; danger:=true;
- end
-
-@ The |unsave| is done after everything else here; hence an appearance of
-`\.{\\mathsurround}' inside of `\.{\$...\$}' affects the spacing at these
-particular \.\$'s. This is consistent with the conventions of
-`\.{\$\$...\$\$}', since `\.{\\abovedisplayskip}' inside a display affects the
-space above that display.
-
-@<Finish math in text@> =
-begin tail_append(new_math(math_surround,before));
-if dir_math_save then
- @<Append a begin direction to the tail of the current list@>;
-cur_mlist:=p; cur_style:=text_style; mlist_penalties:=(mode>0); mlist_to_hlist;
-vlink(tail):=vlink(temp_head);
-while vlink(tail)<>null do tail:=vlink(tail);
-if dir_math_save then
- @<Append an end direction to the tail of the current list@>;
-dir_math_save:=false;
-tail_append(new_math(math_surround,after));
-space_factor:=1000;
-@<DIR: |unsave| math@>;
-end
-
-@ \TeX\ gets to the following part of the program when the first `\.\$' ending
-a display has been scanned.
-
-@<Check that another \.\$ follows@>=
-begin get_x_token;
-if cur_cmd<>math_shift then
- begin print_err("Display math should end with $$");
-@.Display math...with \$\$@>
- help2("The `$' that I just saw supposedly matches a previous `$$'.")@/
- ("So I shall assume that you typed `$$' both times.");
- back_error;
- end;
-end
-
-@ We have saved the worst for last: The fussiest part of math mode processing
-occurs when a displayed formula is being centered and placed with an optional
-equation number.
-
-@<Local variables for finishing...@>=
-@!b:pointer; {box containing the equation}
-@!w:scaled; {width of the equation}
-@!z:scaled; {width of the line}
-@!e:scaled; {width of equation number}
-@!q:scaled; {width of equation number plus space to separate from equation}
-@!d:scaled; {displacement of equation in the line}
-@!s:scaled; {move the line right this much}
-@!g1,@!g2:small_number; {glue parameter codes for before and after}
-@!r:pointer; {kern node used to position the display}
-@!t:pointer; {tail of adjustment list}
-@!pre_t:pointer; {tail of pre-adjustment list}
-
-@ At this time |p| points to the mlist for the formula; |a| is either
-|null| or it points to a box containing the equation number; and we are in
-vertical mode (or internal vertical mode).
-
-@<Finish displayed math@>=
-cur_mlist:=p; cur_style:=display_style; mlist_penalties:=false;
-mlist_to_hlist; p:=vlink(temp_head);@/
-adjust_tail:=adjust_head; pre_adjust_tail:=pre_adjust_head;
-b:=hpack(p,natural); p:=list_ptr(b);
-t:=adjust_tail; adjust_tail:=null;@/
-pre_t:=pre_adjust_tail; pre_adjust_tail:=null;@/
-w:=width(b); z:=display_width; s:=display_indent;
-if (a=null)or danger then
- begin e:=0; q:=0;
- end
-else begin e:=width(a); q:=e+math_quad(text_size);
- end;
-if w+q>z then
- @<Squeeze the equation as much as possible; if there is an equation
- number that should go on a separate line by itself,
- set~|e:=0|@>;
-@<Determine the displacement, |d|, of the left edge of the equation, with
- respect to the line size |z|, assuming that |l=false|@>;
-@<Append the glue or equation number preceding the display@>;
-@<Append the display and perhaps also the equation number@>;
-@<Append the glue or equation number following the display@>;
-resume_after_display
-
-@ @<Declare act...@>=
-procedure resume_after_display;
-begin if cur_group<>math_shift_group then confusion("display");
-@:this can't happen display}{\quad display@>
-@<DIR: |unsave| math@>;
-prev_graf:=prev_graf+3;
-push_nest; mode:=hmode; space_factor:=1000;
-@<LOCAL: Add local paragraph node@>;
-@<Scan an optional space@>;
-if nest_ptr=1 then begin check_filter('after_display'); build_page; end;
-end;
-
-@ The user can force the equation number to go on a separate line
-by causing its width to be zero.
-
-@<Squeeze the equation as much as possible...@>=
-begin if (e<>0)and((w-total_shrink[normal]+q<=z)or@|
- (total_shrink[sfi]<>0)or(total_shrink[fil]<>0)or
- (total_shrink[fill]<>0)or(total_shrink[filll]<>0)) then
- begin list_ptr(b):=null; flush_node(b);
- b:=hpack(p,z-q,exactly);
- end
-else begin e:=0;
- if w>z then
- begin
- list_ptr(b):=null; flush_node(b);
- b:=hpack(p,z,exactly);
- end;
- end;
-w:=width(b);
-end
-
-@ We try first to center the display without regard to the existence of
-the equation number. If that would make it too close (where ``too close''
-means that the space between display and equation number is less than the
-width of the equation number), we either center it in the remaining space
-or move it as far from the equation number as possible. The latter alternative
-is taken only if the display begins with glue, since we assume that the
-user put glue there to control the spacing precisely.
-
-@<Determine the displacement, |d|, of the left edge of the equation...@>=
-d:=half(z-w);
-if (e>0)and(d<2*e) then {too close}
- begin d:=half(z-w-e);
- if p<>null then if not is_char_node(p) then if type(p)=glue_node then d:=0;
- end
-
-@ If the equation number is set on a line by itself, either before or
-after the formula, we append an infinite penalty so that no page break will
-separate the display from its number; and we use the same size and
-displacement for all three potential lines of the display, even though
-`\.{\\parshape}' may specify them differently.
-
-@<Append the glue or equation number preceding the display@>=
-tail_append(new_penalty(pre_display_penalty));@/
-if (d+s<=pre_display_size)or l then {not enough clearance}
- begin g1:=above_display_skip_code; g2:=below_display_skip_code;
- end
-else begin g1:=above_display_short_skip_code;
- g2:=below_display_short_skip_code;
- end;
-if l and(e=0) then {it follows that |type(a)=hlist_node|}
- begin shift_amount(a):=s; append_to_vlist(a);
- tail_append(new_penalty(inf_penalty));
- end
-else tail_append(new_param_glue(g1))
-
-@ @<Append the display and perhaps also the equation number@>=
-if e<>0 then
- begin r:=new_kern(z-w-e-d);
- if l then
- begin vlink(a):=r; vlink(r):=b; b:=a; d:=0;
- end
- else begin vlink(b):=r; vlink(r):=a;
- end;
- b:=hpack(b,natural);
- end;
-shift_amount(b):=s+d; append_to_vlist(b)
-
-@ @<Append the glue or equation number following the display@>=
-if (a<>null)and(e=0)and not l then
- begin tail_append(new_penalty(inf_penalty));
- shift_amount(a):=s+z-width(a);
- append_to_vlist(a);
- g2:=0;
- end;
-if t<>adjust_head then {migrating material comes after equation number}
- begin vlink(tail):=vlink(adjust_head); tail:=t;
- end;
-if pre_t<>pre_adjust_head then
- begin vlink(tail):=vlink(pre_adjust_head); tail:=pre_t;
- end;
-tail_append(new_penalty(post_display_penalty));
-if g2>0 then tail_append(new_param_glue(g2))
-
-@ When \.{\\halign} appears in a display, the alignment routines operate
-essentially as they do in vertical mode. Then the following program is
-activated, with |p| and |q| pointing to the beginning and end of the
-resulting list, and with |aux_save| holding the |prev_depth| value.
-
-@<Finish an alignment in a display@>=
-begin do_assignments;
-if cur_cmd<>math_shift then @<Pontificate about improper alignment in display@>
-else @<Check that another \.\$ follows@>;
-pop_nest;
-tail_append(new_penalty(pre_display_penalty));
-tail_append(new_param_glue(above_display_skip_code));
-vlink(tail):=p;
-if p<>null then tail:=q;
-tail_append(new_penalty(post_display_penalty));
-tail_append(new_param_glue(below_display_skip_code));
-prev_depth:=aux_save.sc; resume_after_display;
-end
-
-@ @<Pontificate...@>=
-begin print_err("Missing $$ inserted");
-@.Missing {\$\$} inserted@>
-help2("Displays can use special alignments (like \eqalignno)")@/
- ("only if nothing but the alignment itself is between $$'s.");
-back_error;
-end
@* \[49] Mode-independent processing.
The long |main_control| procedure has now been fully specified, except for
@@ -27761,31 +23965,21 @@ by adding the corresponding codes. (\PASCAL's |set| operations could also
have been used.)
@<Put each...@>=
-primitive("long",prefix,1);
+primitive_tex("long",prefix,1,0);
@!@:long_}{\.{\\long} primitive@>
-primitive("outer",prefix,2);
+primitive_tex("outer",prefix,2,0);
@!@:outer_}{\.{\\outer} primitive@>
-primitive("global",prefix,4);
+primitive_tex("global",prefix,4,0);
@!@:global_}{\.{\\global} primitive@>
-primitive("def",def,0);
+primitive_tex("def",def,0,0);
@!@:def_}{\.{\\def} primitive@>
-primitive("gdef",def,1);
+primitive_tex("gdef",def,1,0);
@!@:gdef_}{\.{\\gdef} primitive@>
-primitive("edef",def,2);
+primitive_tex("edef",def,2,0);
@!@:edef_}{\.{\\edef} primitive@>
-primitive("xdef",def,3);
+primitive_tex("xdef",def,3,0);
@!@:xdef_}{\.{\\xdef} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-prefix: if chr_code=1 then print_esc("long")
- else if chr_code=2 then print_esc("outer")
- @/@<Cases of |prefix| for |print_cmd_chr|@>@/
- else print_esc("global");
-def: if chr_code=0 then print_esc("def")
- else if chr_code=1 then print_esc("gdef")
- else if chr_code=2 then print_esc("edef")
- else print_esc("xdef");
-
@ Every prefix, and every command code that might or might not be prefixed,
calls the action procedure |prefixed_command|. This routine accumulates
a sequence of prefixes until coming to a non-prefix, then it carries out
@@ -27807,13 +24001,18 @@ any_mode(set_prev_graf),
any_mode(set_page_dimen),
any_mode(set_page_int),
any_mode(set_box_dimen),
-any_mode(set_shape),
-any_mode(def_code),
-any_mode(extdef_code),
+any_mode(set_tex_shape),
+any_mode(set_etex_shape),
+any_mode(def_char_code),
+any_mode(def_del_code),
+any_mode(extdef_math_code),
+any_mode(extdef_del_code),
any_mode(def_family),
+any_mode(set_math_param),
any_mode(set_font),
any_mode(def_font),
any_mode(letterspace_font),
+any_mode(pdf_copy_font),
any_mode(register),
any_mode(advance),
any_mode(multiply),
@@ -27849,6 +24048,7 @@ var a:small_number; {accumulated prefix codes so far}
@!p,@!q:pointer; {for temporary short-term use}
@!n:integer; {ditto}
@!e:boolean; {should a definition be expanded? or was \.{\\let} not done?}
+@!mval:mathcodeval; {for handling of \.{\\mathchardef}s}
begin a:=0;
while cur_cmd=prefix do
begin if not odd(a div cur_chr) then a:=a+cur_chr;
@@ -27871,7 +24071,7 @@ exit:end;
begin print_err("You can't use a prefix with `");
@.You can't use a prefix with x@>
print_cmd_chr(cur_cmd,cur_chr); print_char("'");
-help1("I'll pretend you didn't say \long or \outer or \global.");
+help1("I'll pretend you didn't say \long or \outer or \global or \protected.");
back_error; return;
end
@@ -27895,10 +24095,6 @@ since the following routines test for the \.{\\global} prefix as follows.
@d global==(a>=4)
@d define(#)==if global then geq_define(#)@+else eq_define(#)
@d word_define(#)==if global then geq_word_define(#)@+else eq_word_define(#)
-@d define_math_code(#)==if global
- then set_math_code(#,level_one)@+else set_math_code(#,cur_level)
-@d define_del_code(#)==if global
- then set_del_code(#,level_one)@+else set_del_code(#,cur_level)
@d define_lc_code(#)==if global
then set_lc_code(#,level_one)@+else set_lc_code(#,cur_level)
@d define_uc_code(#)==if global
@@ -27907,6 +24103,11 @@ since the following routines test for the \.{\\global} prefix as follows.
then set_sf_code(#,level_one)@+else set_sf_code(#,cur_level)
@d define_cat_code(#)==if global
then set_cat_code(cat_code_table,#,level_one)@+else set_cat_code(cat_code_table,#,cur_level)
+@d define_fam_fnt(#)==if global
+ then def_fam_fnt(#,level_one)@+else def_fam_fnt(#,cur_level)
+@d define_math_param(#)==if global
+ then def_math_param(#,level_one)@+else def_math_param(#,cur_level)
+
@<Adjust \(f)for the setting of \.{\\globaldefs}@>=
if global_defs<>0 then
@@ -27952,17 +24153,76 @@ function is_dim_assign(cmd:halfword):boolean;
begin
is_dim_assign := (cmd=assign_dimen);
end;
-procedure assign_internal_int(cmd:halfword;value:integer);
-var a:small_number;
-begin
- a:=0;
- word_define(cmd,value);
-end;
-procedure assign_internal_dim(cmd:halfword;value:integer);
-var a:small_number;
+
+@ @<Declare subprocedures for |prefixed_command|@>=
+procedure assign_internal_value(a:small_number;p:halfword;cur_val:integer);
+var n:halfword;
begin
- a:=0;
- word_define(cmd,value);
+if (p>=int_base)and(p<attribute_base) then begin
+ if p=(int_base+cat_code_table_code) then begin
+ if valid_catcode_table(cur_val) then begin
+ if cur_val<>cat_code_table then
+ word_define(p,cur_val);
+ end
+ else begin
+ print_err("Invalid \catcode table");
+ help2("You can only switch to a \catcode table that is initialized")
+ ("using \savecatcodetable or \initcatcodetable, or to table 0");
+ error;
+ end;
+ end
+ else if (p=(int_base+output_box_code)and((cur_val>65535)or(cur_val<0))) then begin
+ print_err("Invalid \outputbox");
+ help1("The value for \outputbox has to be between 0 and 65535.");
+ error;
+ end
+ else if ((p=new_line_char)and((cur_val>127)or(cur_val<0))) then begin
+ print_err("Invalid \newlinechar");
+ help1("The value for \newlinechar has to be between 0 and 127.");
+ error;
+ end
+ else if p=end_line_char then begin
+ if (cur_val<0)or(cur_val>biggest_char) then
+ word_define(p,-1)
+ else
+ word_define(p,13);
+ end
+ else
+ word_define(p,cur_val);
+{If we are defining subparagraph penalty levels while we are
+in hmode, then we put out a whatsit immediately, otherwise
+we leave it alone. This mechanism might not be sufficiently
+powerful, and some other algorithm, searching down the stack,
+might be necessary. Good first step.}
+ if (abs(mode)=hmode) and
+ ((p=(int_base+local_inter_line_penalty_code)) or
+ (p=(int_base+local_broken_penalty_code))) then begin
+ @<LOCAL: Add local paragraph node@>;
+ eq_word_define(int_base+no_local_whatsits_code,no_local_whatsits+1);
+ end;
+ if p=int_base+language_code then word_define(int_base+cur_lang_code,cur_val);
+ end
+else if (p>=dimen_base)and(p<eqtb_size) then begin
+ if p=(dimen_base+page_left_offset_code) then begin
+ n:=cur_val - one_inch;
+ word_define(dimen_base+h_offset_code, n);
+ end
+ else if p=(dimen_base+h_offset_code) then begin
+ n:=cur_val + one_inch;
+ word_define(dimen_base+page_left_offset_code, n);
+ end
+ else if p=(dimen_base+page_top_offset_code) then begin
+ n:=cur_val - one_inch;
+ word_define(dimen_base+v_offset_code, n);
+ end
+ else if p=(dimen_base+v_offset_code) then begin
+ n:=cur_val + one_inch;
+ word_define(dimen_base+page_top_offset_code, n);
+ end;
+ word_define(p,cur_val);
+ end
+else
+ confusion("assign internal value");
end;
@@ -27990,14 +24250,11 @@ def: begin if odd(cur_chr)and not global and(global_defs>=0) then a:=a+4;
@ Both \.{\\let} and \.{\\futurelet} share the command code |let|.
@<Put each...@>=
-primitive("let",let,normal);@/
+primitive_tex("let",let,normal,0);@/
@!@:let_}{\.{\\let} primitive@>
-primitive("futurelet",let,normal+1);@/
+primitive_tex("futurelet",let,normal+1,0);@/
@!@:future_let_}{\.{\\futurelet} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-let: if chr_code<>normal then print_esc("futurelet")@+else print_esc("let");
-
@ @<Assignments@>=
let: begin n:=cur_chr;
get_r_token; p:=cur_cs;
@@ -28026,52 +24283,36 @@ corresponding |chr| is the |eqtb| location of the internal register in question.
@d char_def_code=0 {|shorthand_def| for \.{\\chardef}}
@d math_char_def_code=1 {|shorthand_def| for \.{\\mathchardef}}
@d omath_char_def_code=2 {|shorthand_def| for \.{\\omathchardef}}
-@d count_def_code=3 {|shorthand_def| for \.{\\countdef}}
-@d attribute_def_code=4 {|shorthand_def| for \.{\\attributedef}}
-@d dimen_def_code=5 {|shorthand_def| for \.{\\dimendef}}
-@d skip_def_code=6 {|shorthand_def| for \.{\\skipdef}}
-@d mu_skip_def_code=7 {|shorthand_def| for \.{\\muskipdef}}
-@d toks_def_code=8 {|shorthand_def| for \.{\\toksdef}}
+@d xmath_char_def_code=3 {|shorthand_def| for \.{\\Umathchardef}}
+@d count_def_code=4 {|shorthand_def| for \.{\\countdef}}
+@d attribute_def_code=5 {|shorthand_def| for \.{\\attributedef}}
+@d dimen_def_code=6 {|shorthand_def| for \.{\\dimendef}}
+@d skip_def_code=7 {|shorthand_def| for \.{\\skipdef}}
+@d mu_skip_def_code=8 {|shorthand_def| for \.{\\muskipdef}}
+@d toks_def_code=9 {|shorthand_def| for \.{\\toksdef}}
@<Put each...@>=
-primitive("chardef",shorthand_def,char_def_code);@/
+primitive_tex("chardef",shorthand_def,char_def_code,0);@/
@!@:char_def_}{\.{\\chardef} primitive@>
-primitive("mathchardef",shorthand_def,math_char_def_code);@/
+primitive_tex("mathchardef",shorthand_def,math_char_def_code,0);@/
@!@:math_char_def_}{\.{\\mathchardef} primitive@>
-primitive("omathchardef",shorthand_def,omath_char_def_code);@/
+primitive_omega("omathchardef",shorthand_def,omath_char_def_code,0);@/
@!@:math_char_def_}{\.{\\omathchardef} primitive@>
-primitive("countdef",shorthand_def,count_def_code);@/
+primitive_luatex("Umathchardef",shorthand_def,xmath_char_def_code,0);@/
+@!@:math_char_def_}{\.{\\Umathchardef} primitive@>
+primitive_tex("countdef",shorthand_def,count_def_code,0);@/
@!@:count_def_}{\.{\\countdef} primitive@>
-primitive("attributedef",shorthand_def,attribute_def_code);@/
+primitive_luatex("attributedef",shorthand_def,attribute_def_code,0);@/
@!@:attribute_def_}{\.{\\attributedef} primitive@>
-primitive("dimendef",shorthand_def,dimen_def_code);@/
+primitive_tex("dimendef",shorthand_def,dimen_def_code,0);@/
@!@:dimen_def_}{\.{\\dimendef} primitive@>
-primitive("skipdef",shorthand_def,skip_def_code);@/
+primitive_tex("skipdef",shorthand_def,skip_def_code,0);@/
@!@:skip_def_}{\.{\\skipdef} primitive@>
-primitive("muskipdef",shorthand_def,mu_skip_def_code);@/
+primitive_tex("muskipdef",shorthand_def,mu_skip_def_code,0);@/
@!@:mu_skip_def_}{\.{\\muskipdef} primitive@>
-primitive("toksdef",shorthand_def,toks_def_code);@/
+primitive_tex("toksdef",shorthand_def,toks_def_code,0);@/
@!@:toks_def_}{\.{\\toksdef} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-shorthand_def: case chr_code of
- char_def_code: print_esc("chardef");
- math_char_def_code: print_esc("mathchardef");
- omath_char_def_code: print_esc("omathchardef");
- count_def_code: print_esc("countdef");
- attribute_def_code: print_esc("attributedef");
- dimen_def_code: print_esc("dimendef");
- skip_def_code: print_esc("skipdef");
- mu_skip_def_code: print_esc("muskipdef");
- othercases print_esc("toksdef")
- endcases;
-char_given: begin print_esc("char"); print_hex(chr_code);
- end;
-math_given: begin print_esc("mathchar"); print_hex(chr_code);
- end;
-omath_given: begin print_esc("omathchar"); print_hex(chr_code);
- end;
-
@ We temporarily define |p| to be |relax|, so that an occurrence of |p|
while scanning the definition will simply stop the scanning instead of
producing an ``undefined control sequence'' error or expanding the
@@ -28083,12 +24324,21 @@ shorthand_def: begin n:=cur_chr; get_r_token; p:=cur_cs;
case n of
char_def_code: begin scan_char_num; define(p,char_given,cur_val);
end;
- math_char_def_code: begin scan_real_fifteen_bit_int;
+ math_char_def_code: begin
+ mval:=scan_mathchar(tex_mathcode);
+ cur_val:=(mval.class_value*16+mval.family_value)*256+mval.character_value;
define(p,math_given,cur_val);
end;
- omath_char_def_code: begin scan_big_fifteen_bit_int;
+ omath_char_def_code: begin
+ mval:=scan_mathchar(aleph_mathcode);
+ cur_val:=(mval.class_value*256+mval.family_value)*65536+mval.character_value;
define(p,omath_given,cur_val);
end;
+ xmath_char_def_code: begin
+ mval:=scan_mathchar(xetex_mathcode);
+ cur_val:=(mval.class_value+(8*mval.family_value))*(65536*32)+mval.character_value;
+ define(p,xmath_given,cur_val);
+ end;
othercases begin scan_register_num;
case n of
count_def_code: define(p,assign_int,count_base+cur_val);
@@ -28104,7 +24354,8 @@ shorthand_def: begin n:=cur_chr; get_r_token; p:=cur_cs;
@ @<Assignments@>=
read_to_cs: begin j:=cur_chr; scan_int; n:=cur_val;
- if not scan_keyword("to") then
+ if not scan_keyword('to') then
+@.to@>
begin print_err("Missing `to' inserted");
@.Missing `to'...@>
help2("You should have said `\read<number> to \cs'.")@/
@@ -28160,45 +24411,8 @@ end
@<Assignments@>=
assign_int: begin p:=cur_chr; scan_optional_equals; scan_int;
- if p=(int_base+cat_code_table_code) then begin
- if valid_catcode_table(cur_val) then begin
- if cur_val<>cat_code_table then
- word_define(p,cur_val);
- end
- else begin
- print_err("Invalid \catcode table");
- help2("You can only switch to a \catcode table that is initialized")
- ("using \savecatcodetable or \initcatcodetable, or to table 0");
- error;
- end;
- end
- else if (p=new_line_char)and(cur_val>127) then begin
- print_err("Invalid \newlinechar");
- help1("The value for \newlinechar has to be between 0 and 127.");
- error;
- end
- else if p=end_line_char then begin
- if (cur_val<0)or(cur_val>biggest_char) then
- word_define(p,-1)
- else
- word_define(p,13);
- end
- else
- word_define(p,cur_val);
-{If we are defining subparagraph penalty levels while we are
-in hmode, then we put out a whatsit immediately, otherwise
-we leave it alone. This mechanism might not be sufficiently
-powerful, and some other algorithm, searching down the stack,
-might be necessary. Good first step.}
- if (abs(mode)=hmode) and
- ((p=(int_base+local_inter_line_penalty_code)) or
- (p=(int_base+local_broken_penalty_code))) then begin
- @<LOCAL: Add local paragraph node@>;
- eq_word_define(int_base+no_local_whatsits_code,no_local_whatsits+1);
- local_par_bool:=true;
- end;
- if p=int_base+language_code then word_define(int_base+cur_lang_code,cur_val);
- end;
+ assign_internal_value(a,p,cur_val);
+ end;
assign_attr: begin p:=cur_chr; scan_optional_equals; scan_int;
if (p-attribute_base)>max_used_attr then max_used_attr:=(p-attribute_base);
attr_list_cache:=cache_disabled;
@@ -28207,7 +24421,7 @@ assign_dir: begin
@<DIR: Assign direction codes@>
end;
assign_dimen: begin p:=cur_chr; scan_optional_equals;
- scan_normal_dimen; word_define(p,cur_val);
+ scan_normal_dimen; assign_internal_value(a,p,cur_val);
end;
assign_glue,assign_mu_glue: begin p:=cur_chr; n:=cur_cmd; scan_optional_equals;
if n=assign_mu_glue then scan_glue(mu_val)@+else scan_glue(glue_val);
@@ -28231,39 +24445,146 @@ end;
and the font families are declared by |def_family|.
@<Put each...@>=
-primitive("catcode",def_code,cat_code_base);
+primitive_tex("catcode",def_char_code,cat_code_base,cat_code_base);
@!@:cat_code_}{\.{\\catcode} primitive@>
-primitive("mathcode",def_code,math_code_base);
+primitive_tex("mathcode",def_char_code,math_code_base,cat_code_base);
@!@:math_code_}{\.{\\mathcode} primitive@>
-primitive("lccode",def_code,lc_code_base);
+primitive_tex("lccode",def_char_code,lc_code_base,cat_code_base);
@!@:lc_code_}{\.{\\lccode} primitive@>
-primitive("uccode",def_code,uc_code_base);
+primitive_tex("uccode",def_char_code,uc_code_base,cat_code_base);
@!@:uc_code_}{\.{\\uccode} primitive@>
-primitive("sfcode",def_code,sf_code_base);
+primitive_tex("sfcode",def_char_code,sf_code_base,cat_code_base);
@!@:sf_code_}{\.{\\sfcode} primitive@>
-primitive("delcode",def_code,del_code_base);
+primitive_tex("delcode",def_del_code,del_code_base,del_code_base);
@!@:del_code_}{\.{\\delcode} primitive@>
-primitive("textfont",def_family,math_font_base);
+primitive_tex("textfont",def_family,text_size,0);
@!@:text_font_}{\.{\\textfont} primitive@>
-primitive("scriptfont",def_family,math_font_base+script_size);
+primitive_tex("scriptfont",def_family,script_size,0);
@!@:script_font_}{\.{\\scriptfont} primitive@>
-primitive("scriptscriptfont",def_family,math_font_base+script_script_size);
+primitive_tex("scriptscriptfont",def_family,script_script_size,0);
@!@:script_script_font_}{\.{\\scriptscriptfont} primitive@>
-primitive("omathcode",extdef_code,math_code_base);
+primitive_luatex("Umathquad", set_math_param, math_param_quad,0);
+primitive_luatex("Umathaxis", set_math_param, math_param_axis,0);
+primitive_luatex("Umathoperatorsize", set_math_param, math_param_operator_size,0);
+primitive_luatex("Umathoverbarkern", set_math_param, math_param_overbar_kern,0);
+primitive_luatex("Umathoverbarrule", set_math_param, math_param_overbar_rule,0);
+primitive_luatex("Umathoverbarvgap", set_math_param, math_param_overbar_vgap,0);
+primitive_luatex("Umathunderbarkern", set_math_param, math_param_underbar_kern,0);
+primitive_luatex("Umathunderbarrule", set_math_param, math_param_underbar_rule,0);
+primitive_luatex("Umathunderbarvgap", set_math_param, math_param_underbar_vgap,0);
+primitive_luatex("Umathradicalkern", set_math_param, math_param_radical_kern,0);
+primitive_luatex("Umathradicalrule", set_math_param, math_param_radical_rule,0);
+primitive_luatex("Umathradicalvgap", set_math_param, math_param_radical_vgap,0);
+primitive_luatex("Umathradicaldegreebefore",set_math_param, math_param_radical_degree_before,0);
+primitive_luatex("Umathradicaldegreeafter", set_math_param, math_param_radical_degree_after,0);
+primitive_luatex("Umathradicaldegreeraise", set_math_param, math_param_radical_degree_raise,0);
+primitive_luatex("Umathstackvgap", set_math_param, math_param_stack_vgap,0);
+primitive_luatex("Umathstacknumup", set_math_param, math_param_stack_num_up,0);
+primitive_luatex("Umathstackdenomdown", set_math_param, math_param_stack_denom_down,0);
+primitive_luatex("Umathfractionrule", set_math_param, math_param_fraction_rule,0);
+primitive_luatex("Umathfractionnumvgap", set_math_param, math_param_fraction_num_vgap,0);
+primitive_luatex("Umathfractionnumup", set_math_param, math_param_fraction_num_up,0);
+primitive_luatex("Umathfractiondenomvgap",set_math_param, math_param_fraction_denom_vgap,0);
+primitive_luatex("Umathfractiondenomdown",set_math_param, math_param_fraction_denom_down,0);
+primitive_luatex("Umathfractiondelsize", set_math_param, math_param_fraction_del_size,0);
+primitive_luatex("Umathlimitabovevgap", set_math_param, math_param_limit_above_vgap,0);
+primitive_luatex("Umathlimitabovebgap", set_math_param, math_param_limit_above_bgap,0);
+primitive_luatex("Umathlimitabovekern", set_math_param, math_param_limit_above_kern,0);
+primitive_luatex("Umathlimitdownvgap", set_math_param, math_param_limit_below_vgap,0);
+primitive_luatex("Umathlimitdownbgap", set_math_param, math_param_limit_below_bgap,0);
+primitive_luatex("Umathlimitdownkern", set_math_param, math_param_limit_below_kern,0);
+primitive_luatex("Umathunderdelimitervgap", set_math_param, math_param_under_delimiter_vgap,0);
+primitive_luatex("Umathunderdelimiterbgap", set_math_param, math_param_under_delimiter_bgap,0);
+primitive_luatex("Umathoverdelimitervgap",set_math_param, math_param_over_delimiter_vgap,0);
+primitive_luatex("Umathoverdelimiterbgap",set_math_param, math_param_over_delimiter_bgap,0);
+primitive_luatex("Umathsubshiftdrop", set_math_param, math_param_sub_shift_drop,0);
+primitive_luatex("Umathsupshiftdrop", set_math_param, math_param_sup_shift_drop,0);
+primitive_luatex("Umathsubshiftdown", set_math_param, math_param_sub_shift_down,0);
+primitive_luatex("Umathsubsupshiftdown", set_math_param, math_param_sub_sup_shift_down,0);
+primitive_luatex("Umathsubtopmax", set_math_param, math_param_sub_top_max,0);
+primitive_luatex("Umathsupshiftup", set_math_param, math_param_sup_shift_up,0);
+primitive_luatex("Umathsupbottommin", set_math_param, math_param_sup_bottom_min,0);
+primitive_luatex("Umathsupsubbottommax", set_math_param, math_param_sup_sub_bottom_max,0);
+primitive_luatex("Umathsubsupvgap", set_math_param, math_param_subsup_vgap,0);
+primitive_luatex("Umathspaceafterscript", set_math_param, math_param_space_after_script,0);
+primitive_luatex("Umathconnectoroverlapmin", set_math_param, math_param_connector_overlap_min,0);
+primitive_luatex("Umathordordspacing", set_math_param, math_param_ord_ord_spacing,0);
+primitive_luatex("Umathordopspacing", set_math_param, math_param_ord_op_spacing,0);
+primitive_luatex("Umathordbinspacing", set_math_param, math_param_ord_bin_spacing,0);
+primitive_luatex("Umathordrelspacing", set_math_param, math_param_ord_rel_spacing,0);
+primitive_luatex("Umathordopenspacing", set_math_param, math_param_ord_open_spacing,0);
+primitive_luatex("Umathordclosespacing", set_math_param, math_param_ord_close_spacing,0);
+primitive_luatex("Umathordpunctspacing", set_math_param, math_param_ord_punct_spacing,0);
+primitive_luatex("Umathordinnerspacing", set_math_param, math_param_ord_inner_spacing,0);
+primitive_luatex("Umathopordspacing", set_math_param, math_param_op_ord_spacing,0);
+primitive_luatex("Umathopopspacing", set_math_param, math_param_op_op_spacing,0);
+primitive_luatex("Umathopbinspacing", set_math_param, math_param_op_bin_spacing,0);
+primitive_luatex("Umathoprelspacing", set_math_param, math_param_op_rel_spacing,0);
+primitive_luatex("Umathopopenspacing", set_math_param, math_param_op_open_spacing,0);
+primitive_luatex("Umathopclosespacing", set_math_param, math_param_op_close_spacing,0);
+primitive_luatex("Umathoppunctspacing", set_math_param, math_param_op_punct_spacing,0);
+primitive_luatex("Umathopinnerspacing", set_math_param, math_param_op_inner_spacing,0);
+primitive_luatex("Umathbinordspacing", set_math_param, math_param_bin_ord_spacing,0);
+primitive_luatex("Umathbinopspacing", set_math_param, math_param_bin_op_spacing,0);
+primitive_luatex("Umathbinbinspacing", set_math_param, math_param_bin_bin_spacing,0);
+primitive_luatex("Umathbinrelspacing", set_math_param, math_param_bin_rel_spacing,0);
+primitive_luatex("Umathbinopenspacing", set_math_param, math_param_bin_open_spacing,0);
+primitive_luatex("Umathbinclosespacing", set_math_param, math_param_bin_close_spacing,0);
+primitive_luatex("Umathbinpunctspacing", set_math_param, math_param_bin_punct_spacing,0);
+primitive_luatex("Umathbininnerspacing", set_math_param, math_param_bin_inner_spacing,0);
+primitive_luatex("Umathrelordspacing", set_math_param, math_param_rel_ord_spacing,0);
+primitive_luatex("Umathrelopspacing", set_math_param, math_param_rel_op_spacing,0);
+primitive_luatex("Umathrelbinspacing", set_math_param, math_param_rel_bin_spacing,0);
+primitive_luatex("Umathrelrelspacing", set_math_param, math_param_rel_rel_spacing,0);
+primitive_luatex("Umathrelopenspacing", set_math_param, math_param_rel_open_spacing,0);
+primitive_luatex("Umathrelclosespacing", set_math_param, math_param_rel_close_spacing,0);
+primitive_luatex("Umathrelpunctspacing", set_math_param, math_param_rel_punct_spacing,0);
+primitive_luatex("Umathrelinnerspacing", set_math_param, math_param_rel_inner_spacing,0);
+primitive_luatex("Umathopenordspacing", set_math_param, math_param_open_ord_spacing,0);
+primitive_luatex("Umathopenopspacing", set_math_param, math_param_open_op_spacing,0);
+primitive_luatex("Umathopenbinspacing", set_math_param, math_param_open_bin_spacing,0);
+primitive_luatex("Umathopenrelspacing", set_math_param, math_param_open_rel_spacing,0);
+primitive_luatex("Umathopenopenspacing", set_math_param, math_param_open_open_spacing,0);
+primitive_luatex("Umathopenclosespacing", set_math_param, math_param_open_close_spacing,0);
+primitive_luatex("Umathopenpunctspacing", set_math_param, math_param_open_punct_spacing,0);
+primitive_luatex("Umathopeninnerspacing", set_math_param, math_param_open_inner_spacing,0);
+primitive_luatex("Umathcloseordspacing", set_math_param, math_param_close_ord_spacing,0);
+primitive_luatex("Umathcloseopspacing", set_math_param, math_param_close_op_spacing,0);
+primitive_luatex("Umathclosebinspacing", set_math_param, math_param_close_bin_spacing,0);
+primitive_luatex("Umathcloserelspacing", set_math_param, math_param_close_rel_spacing,0);
+primitive_luatex("Umathcloseopenspacing", set_math_param, math_param_close_open_spacing,0);
+primitive_luatex("Umathcloseclosespacing",set_math_param, math_param_close_close_spacing,0);
+primitive_luatex("Umathclosepunctspacing",set_math_param, math_param_close_punct_spacing,0);
+primitive_luatex("Umathcloseinnerspacing",set_math_param, math_param_close_inner_spacing,0);
+primitive_luatex("Umathpunctordspacing", set_math_param, math_param_punct_ord_spacing,0);
+primitive_luatex("Umathpunctopspacing", set_math_param, math_param_punct_op_spacing,0);
+primitive_luatex("Umathpunctbinspacing", set_math_param, math_param_punct_bin_spacing,0);
+primitive_luatex("Umathpunctrelspacing", set_math_param, math_param_punct_rel_spacing,0);
+primitive_luatex("Umathpunctopenspacing", set_math_param, math_param_punct_open_spacing,0);
+primitive_luatex("Umathpunctclosespacing",set_math_param, math_param_punct_close_spacing,0);
+primitive_luatex("Umathpunctpunctspacing",set_math_param, math_param_punct_punct_spacing,0);
+primitive_luatex("Umathpunctinnerspacing",set_math_param, math_param_punct_inner_spacing,0);
+primitive_luatex("Umathinnerordspacing", set_math_param, math_param_inner_ord_spacing,0);
+primitive_luatex("Umathinneropspacing", set_math_param, math_param_inner_op_spacing,0);
+primitive_luatex("Umathinnerbinspacing", set_math_param, math_param_inner_bin_spacing,0);
+primitive_luatex("Umathinnerrelspacing", set_math_param, math_param_inner_rel_spacing,0);
+primitive_luatex("Umathinneropenspacing", set_math_param, math_param_inner_open_spacing,0);
+primitive_luatex("Umathinnerclosespacing",set_math_param, math_param_inner_close_spacing,0);
+primitive_luatex("Umathinnerpunctspacing",set_math_param, math_param_inner_punct_spacing,0);
+primitive_luatex("Umathinnerinnerspacing",set_math_param, math_param_inner_inner_spacing,0);
+primitive_omega("omathcode",extdef_math_code,math_code_base,math_code_base);
@!@:math_code_}{\.{\\omathcode} primitive@>
-primitive("odelcode",extdef_code,del_code_base);
+primitive_omega("odelcode",extdef_del_code,del_code_base,del_code_base);
@!@:del_code_}{\.{\\odelcode} primitive@>
+primitive_luatex("Umathcode",extdef_math_code,math_code_base+1,math_code_base);
+@!@:math_code_}{\.{\\Umathcode} primitive@>
+primitive_luatex("Udelcode",extdef_del_code,del_code_base+1,del_code_base);
+@!@:del_code_}{\.{\\Udelcode} primitive@>
+primitive_luatex("Umathcodenum",extdef_math_code,math_code_base+2,math_code_base);
+@!@:math_code_}{\.{\\Umathcodenum} primitive@>
+primitive_luatex("Udelcodenum",extdef_del_code,del_code_base+2,del_code_base);
+@!@:del_code_}{\.{\\Udelcodenum} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-def_code: if chr_code=cat_code_base then print_esc("catcode")
- else if chr_code=math_code_base then print_esc("mathcode")
- else if chr_code=lc_code_base then print_esc("lccode")
- else if chr_code=uc_code_base then print_esc("uccode")
- else if chr_code=sf_code_base then print_esc("sfcode")
- else print_esc("delcode");
-extdef_code: if chr_code=math_code_base then print_esc("omathcode")
- else print_esc("odelcode");
-def_family: print_size(chr_code-math_font_base);
@ The different types of code values have different legal ranges; the
following program is careful to check each case properly.
@@ -28280,18 +24601,12 @@ following program is careful to check each case properly.
@<Assignments@>=
-def_code: begin @<Let |n| be the largest legal code value, based on |cur_chr|@>;
+def_char_code,def_del_code: begin
+ @<Let |n| be the largest legal code value, based on |cur_chr|@>;
p:=cur_chr;
if cur_chr=math_code_base then begin
- scan_char_num; p:= cur_val;
- scan_optional_equals;
- scan_int;
- check_def_code(math_code_base);
- if cur_val=@"8000 then cur_val:=@"8000000
- else cur_val:=((cur_val div @"1000) * @"1000000) +
- (((cur_val mod @"1000) div @"100) * @"10000) +
- (cur_val mod @"100);
- define_math_code(p,cur_val);
+ if global then cur_val1:=level_one else cur_val1:=cur_level;
+ scan_extdef_math_code(cur_val1,tex_mathcode);
end
else if cur_chr=lc_code_base then begin
scan_char_num; p:= cur_val;
@@ -28322,56 +24637,63 @@ def_code: begin @<Let |n| be the largest legal code value, based on |cur_chr|@>;
define_cat_code(p,cur_val);
end
else if cur_chr=del_code_base then begin
- scan_char_num; p:= cur_val;
- scan_optional_equals;
- scan_int;
- check_def_code(del_code_base);
- cur_val1:=cur_val div @"1000;
- cur_val1:=(cur_val1 div @"100)*@"10000 + (cur_val1 mod @"100);
- cur_val:=cur_val mod @"1000;
- cur_val:=(cur_val div @"100)*@"10000 + (cur_val mod @"100);
- define_del_code(p,cur_val1,cur_val);
- end;
- end;
-extdef_code: begin
- if cur_chr=del_code_base then begin
- p:=cur_chr; scan_char_num; p:=p+cur_val; scan_optional_equals;
- scan_int; cur_val1:=cur_val; scan_int; {backwards}
- if (cur_val1>@"FFFFFF) or (cur_val>@"FFFFFF) then
- begin print_err("Invalid code ("); print_int(cur_val1); print(" ");
- print_int(cur_val);
- print("), should be at most ""FFFFFF ""FFFFFF");
- help1("I'm going to use 0 instead of that illegal code value.");@/
- error; cur_val1:=0; cur_val:=0;
- end;
- define_del_code(p,cur_val1,cur_val);
- end
- else begin
- p:=cur_chr; scan_char_num; p:=cur_val; scan_optional_equals;
- scan_int;
- if (cur_val>@"8000000) then
- begin print_err("Invalid code ("); print_int(cur_val);
-@.Invalid code@>
- print("), should be at most "); print_int(@"8000000);
- help1("I'm going to use 0 instead of that illegal code value.");@/
- error; cur_val:=0;
- end;
- define_math_code(p,cur_val);
- end;
+ if global then cur_val1:=level_one else cur_val1:=cur_level;
+ scan_extdef_del_code(cur_val1,tex_mathcode);
+ end;
+ end;
+extdef_math_code, extdef_del_code: begin
+ if global then cur_val1:=level_one else cur_val1:=cur_level;
+ if cur_chr=math_code_base then
+ scan_extdef_math_code(cur_val1,aleph_mathcode)
+ else if cur_chr=math_code_base+1 then
+ scan_extdef_math_code(cur_val1,xetex_mathcode)
+ else if cur_chr=math_code_base+2 then
+ scan_extdef_math_code(cur_val1,xetexnum_mathcode)
+ else if cur_chr=del_code_base then
+ scan_extdef_del_code(cur_val1,aleph_mathcode)
+ else if cur_chr=del_code_base+1 then
+ scan_extdef_del_code(cur_val1,xetex_mathcode)
+ else if cur_chr=del_code_base+2 then
+ scan_extdef_del_code(cur_val1,xetexnum_mathcode);
end;
+
@ @<Let |n| be the largest...@>=
if cur_chr=cat_code_base then n:=max_char_code
else if cur_chr=lc_code_base then n:=biggest_char
else if cur_chr=uc_code_base then n:=biggest_char
-else if cur_chr=math_code_base then n:=@'100000
else if cur_chr=sf_code_base then n:=@'77777
-else if cur_chr=del_code_base then n:=@'77777777
else n:=biggest_char
@ @<Assignments@>=
-def_family: begin p:=cur_chr; scan_math_family_int; p:=p+cur_val;
- scan_optional_equals; scan_font_ident; define(p,data,cur_val);
+def_family: begin p:=cur_chr; scan_math_family_int; cur_val1:=cur_val;
+ scan_optional_equals; scan_font_ident;
+ define_fam_fnt(cur_val1,p,cur_val);
+ end;
+set_math_param: begin p:=cur_chr; get_token;
+ if cur_cmd<>math_style then begin
+ print_err("Missing math style, treated as \displaystyle");
+@.Missing number...@>
+ help1("A style should have been here; I inserted `\displaystyle'.");
+ cur_val1:=display_style;
+ back_error;
+ end
+ else
+ cur_val1:=cur_chr;
+ scan_optional_equals;
+ if p<math_param_first_mu_glue then begin
+ if p=math_param_radical_degree_raise then
+ scan_int
+ else
+ scan_dimen(false, false, false);
+ end
+ else begin
+ scan_glue(mu_val); trap_zero_glue;
+ if cur_val=thin_mu_skip then cur_val:=thin_mu_skip_code
+ else if cur_val=med_mu_skip then cur_val:=med_mu_skip_code
+ else if cur_val=thick_mu_skip then cur_val:=thick_mu_skip_code
+ end;
+ define_math_param(p,cur_val1,cur_val);
end;
@ Next we consider changes to \TeX's numeric registers.
@@ -28389,7 +24711,8 @@ var l,@!q,@!r,@!s:pointer; {for list manipulation}
begin q:=cur_cmd;
@<Compute the register location |l| and its type |p|; but |return| if invalid@>;
if q=register then scan_optional_equals
-else if scan_keyword("by") then do_nothing; {optional `\.{by}'}
+else if scan_keyword('by') then do_nothing; {optional `\.{by}'}
+@.by@>
arith_error:=false;
if q<multiply then @<Compute result of |register| or
|advance|, put it in |cur_val|@>
@@ -28399,6 +24722,7 @@ if arith_error then
@.Arithmetic overflow@>
help2("I can't carry out that multiplication or division,")@/
("since the result is out of range.");
+ if p>=glue_val then delete_glue_ref(cur_val);
error; return;
end;
if p<glue_val then begin
@@ -28406,13 +24730,16 @@ if p<glue_val then begin
if (l-attribute_base)>max_used_attr then max_used_attr:=(l-attribute_base);
attr_list_cache:=cache_disabled;
end;
- word_define(l,cur_val);
+ if (p=int_val) or (p=dimen_val) then
+ assign_internal_value(a,l,cur_val)
+ else
+ word_define(l,cur_val);
end
else begin trap_zero_glue; define(l,glue_ref,cur_val);
end;
exit: end;
-@ Here we use the fact that the consecutive codes |int_val...mu_val| and
+@ Here we use the fact that the consecutive codes |int_val..mu_val| and
|assign_int..assign_mu_glue| correspond to each other nicely.
@<Compute the register location |l| and its type |p|...@>=
@@ -28584,20 +24911,10 @@ end;
@ Paragraph shapes are set up in an obvious way. It needs one word more than in
\TeX, though.
-@d shape_node=54 { storage for shape pointers }
-
@<Assignments@>=
-set_shape: begin q:=cur_chr; scan_optional_equals; scan_int; n:=cur_val;
+set_tex_shape: begin q:=cur_chr; scan_optional_equals; scan_int; n:=cur_val;
if n<=0 then p:=null
- else if q>par_shape_loc then
- begin n:=(cur_val div 2)+1; p:=new_node(shape_node,2*n+1+1); vinfo(p+1):=n;
- n:=cur_val; vmem(p+2).int:=n; {number of penalties}
- for j:=p+3 to p+n+2 do
- begin scan_int; vmem(j).int:=cur_val; {penalty values}
- end;
- if not odd(n) then vmem(p+n+3).int:=0; {unused}
- end
- else begin p:=new_node(shape_node,2*(n+1)+1); vinfo(p+1):=n;
+ else begin p:=new_node(shape_node,2*(n+1)+1); vinfo(p+1):=n;
for j:=1 to n do
begin scan_normal_dimen;
vmem(p+2*j).sc:=cur_val; {indentation}
@@ -28607,26 +24924,33 @@ set_shape: begin q:=cur_chr; scan_optional_equals; scan_int; n:=cur_val;
end;
define(q,shape_ref,p);
end;
+set_etex_shape: begin q:=cur_chr; scan_optional_equals; scan_int; n:=cur_val;
+ if n<=0 then p:=null
+ else begin n:=(cur_val div 2)+1; p:=new_node(shape_node,2*n+1+1); vinfo(p+1):=n;
+ n:=cur_val; vmem(p+2).int:=n; {number of penalties}
+ for j:=p+3 to p+n+2 do
+ begin scan_int; vmem(j).int:=cur_val; {penalty values}
+ end;
+ if not odd(n) then vmem(p+n+3).int:=0; {unused}
+ end;
+ define(q,shape_ref,p);
+ end;
@ New language information data is loaded by the |hyph_data| command.
@<Put each...@>=
-primitive("hyphenation",hyph_data,0);
+primitive_tex("hyphenation",hyph_data,0,0);
@!@:hyphenation_}{\.{\\hyphenation} primitive@>
-primitive("patterns",hyph_data,1);
+primitive_tex("patterns",hyph_data,1,0);
@!@:patterns_}{\.{\\patterns} primitive@>
-primitive("prehyphenchar",hyph_data,2);
+primitive_luatex("prehyphenchar",hyph_data,2,0);
@!@:prehyphenchar_}{\.{\\prehyphenchar} primitive@>
-primitive("posthyphenchar",hyph_data,3);
+primitive_luatex("posthyphenchar",hyph_data,3,0);
@!@:posthyphenchar_}{\.{\\posthyphenchar} primitive@>
-
-@ @<Cases of |print_cmd_chr|...@>=
-hyph_data: case cur_chr of
- 0: print_esc("hyphenation");
- 1: print_esc("patterns");
- 2: print_esc("prehyphenchar");
- 3: print_esc("posthyphenchar");
- endcases;
+primitive_luatex("preexhyphenchar",hyph_data,4,0);
+@!@:preexhyphenchar_}{\.{\\preexhyphenchar} primitive@>
+primitive_luatex("postexhyphenchar",hyph_data,5,0);
+@!@:postexhyphenchar_}{\.{\\postexhyphenchar} primitive@>
@ @<Assignments@>=
hyph_data: begin
@@ -28635,6 +24959,8 @@ hyph_data: begin
1: new_patterns;
2: new_pre_hyphen_char;
3: new_post_hyphen_char;
+ 4: new_pre_exhyphen_char;
+ 5: new_post_exhyphen_char;
endcases;
goto done;
end;
@@ -28664,158 +24990,38 @@ assign_font_int: begin
end;
@ @<Put each...@>=
-primitive("hyphenchar",assign_font_int,0);
+primitive_tex("hyphenchar",assign_font_int,0,0);
@!@:hyphen_char_}{\.{\\hyphenchar} primitive@>
-primitive("skewchar",assign_font_int,1);
+primitive_tex("skewchar",assign_font_int,1,0);
@!@:skew_char_}{\.{\\skewchar} primitive@>
-primitive("lpcode",assign_font_int,lp_code_base);
+primitive_pdftex("lpcode",assign_font_int,lp_code_base,0);
@!@:lp_code_}{\.{\\lpcode} primitive@>
-primitive("rpcode",assign_font_int,rp_code_base);
+primitive_pdftex("rpcode",assign_font_int,rp_code_base,0);
@!@:rp_code_}{\.{\\rpcode} primitive@>
-primitive("efcode",assign_font_int,ef_code_base);
+primitive_pdftex("efcode",assign_font_int,ef_code_base,0);
@!@:ef_code_}{\.{\\efcode} primitive@>
-primitive("tagcode",assign_font_int,tag_code);
+primitive_pdftex("tagcode",assign_font_int,tag_code,0);
@!@:tag_code_}{\.{\\tagcode} primitive@>
-primitive("pdfnoligatures",assign_font_int,no_lig_code);
+primitive_pdftex("pdfnoligatures",assign_font_int,no_lig_code,0);
@!@:no_lig_code_}{\.{\\pdfnoligatures} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-assign_font_int: case chr_code of
-0: print_esc("hyphenchar");
-1: print_esc("skewchar");
-lp_code_base: print_esc("lpcode");
-rp_code_base: print_esc("rpcode");
-ef_code_base: print_esc("efcode");
-tag_code: print_esc("tagcode");
-no_lig_code: print_esc("pdfnoligatures");
-endcases;
-
@ Here is where the information for a new font gets loaded.
@<Assignments@>=
-def_font: def_new_font(a);
+def_font: tex_def_font(a); {in C}
letterspace_font: new_letterspaced_font(a);
-
-@ @<Declare subprocedures for |prefixed_command|@>=
-procedure def_new_font(@!a:small_number);
-var u:pointer; {user's font identifier}
-@!s:scaled; {stated ``at'' size, or negative of scaled magnification}
-@!f:internal_font_number; {runs through existing fonts}
-@!t:str_number; {name for the frozen font identifier}
-@!old_setting:0..max_selector; {holds |selector| setting}
-@!offset:integer;
-@!natural_dir:integer;{the natural direction of the font}
-@!flushable_string:str_number; {string not yet referenced}
-@!junk:pointer;
-begin if job_name=0 then open_log_file;
- {avoid confusing \.{texput} with the font name}
-@.texput@>
-get_r_token; u:=cur_cs;
-if u>=hash_base then t:=text(u)
-else if u=null_cs then t:="FONT"
-else begin old_setting:=selector; selector:=new_string;
- print("FONT"); print(u-active_base); selector:=old_setting;
-@.FONTx@>
- str_room(1); t:=make_string;
- end;
-define(u,set_font,null_font); scan_optional_equals;
-@<Get the next non-blank non-call token@>;
-if cur_cmd<>left_brace then begin
- back_input;
- scan_file_name;
- end
-else begin
- back_input;
- junk:=scan_toks(false,true);
- old_setting:=selector; selector:=new_string;
- token_show(def_ref); selector:=old_setting;
- flush_list(def_ref);
- str_room(1);
- cur_name:=make_string;
- cur_ext:="";
- cur_area:="";
- end;
-@<Scan the font size specification@>;
-name_in_progress:=true;
-if scan_keyword("offset") then begin
- scan_int;
- offset:=cur_val;
- if (cur_val<0) then begin
- print_err("Illegal offset has been changed to 0");
- help1("The offset must be bigger than 0."); int_error(cur_val);
- offset:=0;
- end
- end
-else offset:=0;
-if scan_keyword("naturaldir") then begin
- scan_direction;
- natural_dir:=cur_val;
- end
-else natural_dir:=-1;
-name_in_progress:=false;
-if cur_area = "" then
- f:=read_font_info(u,cur_name,"",s,natural_dir)
-else
- f:=read_font_info(u,cur_name,cur_area,s,natural_dir);
-equiv(u):=f; eqtb[font_id_base+f]:=eqtb[u]; font_id_text(f):=t;
-end;
-
-@ @<Scan the font size specification@>=
-name_in_progress:=true; {this keeps |cur_name| from being changed}
-if scan_keyword("at") then @<Put the \(p)(positive) `at' size into |s|@>
-@.at@>
-else if scan_keyword("scaled") then
-@.scaled@>
- begin scan_int; s:=-cur_val;
- if (cur_val<=0)or(cur_val>32768) then
- begin print_err("Illegal magnification has been changed to 1000");@/
-@.Illegal magnification...@>
- help1("The magnification ratio must be between 1 and 32768.");
- int_error(cur_val); s:=-1000;
- end;
- end
-else s:=-1000;
-name_in_progress:=false
-
-@ @<Put the \(p)(positive) `at' size into |s|@>=
-begin scan_normal_dimen; s:=cur_val;
-if (s<=0)or(s>=@'1000000000) then
- begin print_err("Improper `at' size (");
- print_scaled(s); print("pt), replaced by 10pt");
-@.Improper `at' size...@>
- help2("I can only handle fonts at positive sizes that are")@/
- ("less than 2048pt, so I've changed what you said to 10pt.");
- error; s:=10*unity;
- end;
-end
-
-
-@ @<Cases of |print_cmd_chr|...@>=
-set_font:begin print("select font "); print_font_name(chr_code);
- if font_size(chr_code)<>font_dsize(chr_code) then
- begin print(" at "); print_scaled(font_size(chr_code));
- print("pt");
- end;
- end;
+pdf_copy_font: make_font_copy(a);
@ @<Put each...@>=
-primitive("batchmode",set_interaction,batch_mode);
+primitive_tex("batchmode",set_interaction,batch_mode,0);
@!@:batch_mode_}{\.{\\batchmode} primitive@>
-primitive("nonstopmode",set_interaction,nonstop_mode);
+primitive_tex("nonstopmode",set_interaction,nonstop_mode,0);
@!@:nonstop_mode_}{\.{\\nonstopmode} primitive@>
-primitive("scrollmode",set_interaction,scroll_mode);
+primitive_tex("scrollmode",set_interaction,scroll_mode,0);
@!@:scroll_mode_}{\.{\\scrollmode} primitive@>
-primitive("errorstopmode",set_interaction,error_stop_mode);
+primitive_tex("errorstopmode",set_interaction,error_stop_mode,0);
@!@:error_stop_mode_}{\.{\\errorstopmode} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-set_interaction: case chr_code of
- batch_mode: print_esc("batchmode");
- nonstop_mode: print_esc("nonstopmode");
- scroll_mode: print_esc("scrollmode");
- othercases print_esc("errorstopmode")
- endcases;
-
@ @<Assignments@>=
set_interaction: new_interaction;
@@ -28865,15 +25071,11 @@ any_mode(after_group):begin get_token; save_for_after(cur_tok);
@ Files for \.{\\read} are opened and closed by the |in_stream| command.
@<Put each...@>=
-primitive("openin",in_stream,1);
+primitive_tex("openin",in_stream,1,0);
@!@:open_in_}{\.{\\openin} primitive@>
-primitive("closein",in_stream,0);
+primitive_tex("closein",in_stream,0,0);
@!@:close_in_}{\.{\\closein} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-in_stream: if chr_code=0 then print_esc("closein")
- else print_esc("openin");
-
@ @<Cases of |main_control| that don't...@>=
any_mode(in_stream): open_or_close_in;
@@ -28903,15 +25105,11 @@ current mode.
any_mode(message):issue_message;
@ @<Put each...@>=
-primitive("message",message,0);
+primitive_tex("message",message,0,0);
@!@:message_}{\.{\\message} primitive@>
-primitive("errmessage",message,1);
+primitive_tex("errmessage",message,1,0);
@!@:err_message_}{\.{\\errmessage} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-message: if chr_code=0 then print_esc("message")
- else print_esc("errmessage");
-
@ @<Declare act...@>=
procedure issue_message;
var old_setting:0..max_selector; {holds |selector| setting}
@@ -28971,15 +25169,11 @@ building a token list and then changing the cases of the letters in it.
any_mode(case_shift):shift_case;
@ @<Put each...@>=
-primitive("lowercase",case_shift,lc_code_base);
+primitive_tex("lowercase",case_shift,lc_code_base,lc_code_base);
@!@:lowercase_}{\.{\\lowercase} primitive@>
-primitive("uppercase",case_shift,uc_code_base);
+primitive_tex("uppercase",case_shift,uc_code_base,lc_code_base);
@!@:uppercase_}{\.{\\uppercase} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-case_shift:if chr_code=lc_code_base then print_esc("lowercase")
- else print_esc("uppercase");
-
@ @<Declare act...@>=
procedure shift_case;
var b:pointer; {|lc_code_base| or |uc_code_base|}
@@ -28996,22 +25190,26 @@ back_list(link(def_ref)); free_avail(def_ref); {omit reference count}
end;
@ When the case of a |chr_code| changes, we don't change the |cmd|.
-We also change active characters, using the fact that
-|cs_token_flag+active_base| is a multiple of~|string_offset|.
-@^data structure assumptions@>
+We also change active characters.
@<Change the case of the token in |p|, if a change is appropriate@>=
t:=info(p);
-if t<cs_token_flag+null_cs then
- begin
+if t<cs_token_flag then begin
c:=t mod string_offset;
- if b=uc_code_base then begin
- i:=get_uc_code(c);
- if i<>0 then info(p):=t-c+i;
- end
- else
- begin if get_lc_code(c)<>0 then info(p):=t-c+get_lc_code(c); end;
+ if b=uc_code_base then
+ i:=get_uc_code(c)
+ else
+ i:=get_lc_code(c);
+ if i<>0 then info(p):=t-c+i;
end
+else if is_active_csname(t-cs_token_flag) then begin
+ c:=active_csname_value(t-cs_token_flag);
+ if b=uc_code_base then
+ i:=get_uc_code(c)
+ else
+ i:= get_lc_code(c);
+ if i<>0 then info(p):=active_to_cs(i,true)+cs_token_flag;
+end
@ We come finally to the last pieces missing from |main_control|, namely the
`\.{\\show}' commands that are useful when debugging.
@@ -29025,24 +25223,15 @@ any_mode(xray): show_whatever;
@d show_lists=3 { \.{\\showlists} }
@<Put each...@>=
-primitive("show",xray,show_code);
+primitive_tex("show",xray,show_code,0);
@!@:show_}{\.{\\show} primitive@>
-primitive("showbox",xray,show_box_code);
+primitive_tex("showbox",xray,show_box_code,0);
@!@:show_box_}{\.{\\showbox} primitive@>
-primitive("showthe",xray,show_the_code);
+primitive_tex("showthe",xray,show_the_code,0);
@!@:show_the_}{\.{\\showthe} primitive@>
-primitive("showlists",xray,show_lists);
+primitive_tex("showlists",xray,show_lists,0);
@!@:show_lists_}{\.{\\showlists} primitive@>
-@ @<Cases of |print_cmd_chr|...@>=
-xray: case chr_code of
- show_box_code:print_esc("showbox");
- show_the_code:print_esc("showthe");
- show_lists:print_esc("showlists");
- @<Cases of |xray| for |print_cmd_chr|@>@;@/
- othercases print_esc("show")
- endcases;
-
@ @<Declare act...@>=
procedure show_whatever;
label common_ending;
@@ -29090,18 +25279,6 @@ if cur_cs<>0 then
print_meaning; goto common_ending;
end
-@ @<Cases of |print_cmd_chr|...@>=
-undefined_cs: print("undefined");
-call,long_call,outer_call,long_outer_call: begin n:=cmd-call;
- if info(link(chr_code))=protected_token then n:=n+4;
- if odd(n div 4) then print_esc("protected");
- if odd(n) then print_esc("long");
- if odd(n div 2) then print_esc("outer");
- if n>0 then print_char(" ");
- print("macro");
- end;
-end_template: print_esc("outer endtemplate");
-
@ @<Show the current contents of a box@>=
begin scan_register_num; begin_diagnostic;
print_nl("> \box"); print_int(cur_val); print_char("=");
@@ -29137,7 +25314,7 @@ so that the inverse relation between them is clear.
The global variable |format_ident| is a string that is printed right
after the |banner| line when \TeX\ is ready to start. For \.{INITEX} this
string says simply `\.{(INITEX)}'; for other versions of \TeX\ it says,
-for example, `\.{(preloaded format=plain 82.11.19)}', showing the year,
+for example, `\.{(preloaded format=plain 1982.11.19)}', showing the year,
month, and day that the format file was created. We have |format_ident=0|
before \TeX's tables are loaded.
@@ -29171,6 +25348,7 @@ begin @<If dumping is not allowed, abort@>;
@<Dump the ocp information@>;
@<Dump the ocp list information@>;
@<Dump the hyphenation tables@>;
+@<Dump pdftex data@>;
@<Dump a couple more things and the closing check word@>;
@<Dump the lua bytecodes@>;
@<Close the format file@>;
@@ -29204,8 +25382,10 @@ begin @<Undump constants for consistency check@>;
@<Undump the ocp information@>;
@<Undump the ocp list information@>;
@<Undump the hyphenation tables@>;
+@<Undump pdftex data@>;
@<Undump a couple more things and the closing check word@>;
@<Undump the lua bytecodes@>;
+prev_depth := pdf_ignored_dimen;
load_fmt_file:=true; return; {it worked!}
bad_fmt: wake_up_terminal;
wterm_ln('(Fatal format file error; I''m stymied)');
@@ -29371,7 +25551,7 @@ format file represents $n+m$ consecutive entries of |eqtb|, with |m| extra
copies of $x_n$, namely $(x_1,\ldots,x_n,x_n,\ldots,x_n)$.
@<Dump regions 1 to 4 of |eqtb|@>=
-k:=active_base;
+k:=null_cs;
repeat j:=k;
while j<int_base-1 do
begin if (equiv(j)=equiv(j+1))and(eq_type(j)=eq_type(j+1))and@|
@@ -29413,7 +25593,7 @@ k:=j+1; dump_int(k-l);
until k>eqtb_size
@ @<Undump regions 1 to 6 of |eqtb|@>=
-k:=active_base;
+k:=null_cs;
repeat undump_int(x);
if (x<1)or(k+x>eqtb_size+1) then goto bad_fmt;
for j:=k to k+x-1 do undump_wd(eqtb[j]);
@@ -29430,8 +25610,7 @@ two words, |p| and |hash[p]|. The hash table is, of course, densely packed
for |p>=hash_used|, so the remaining entries are output in a~block.
@<Dump the hash table@>=
-for p:=0 to prim_size do dump_hh(prim[p]);
-for p:=0 to prim_size do dump_wd(prim_eqtb[p]);
+dump_primitives;
dump_int(hash_used); cs_count:=frozen_control_sequence-1-hash_used;
for p:=hash_base to hash_used do if text(p)<>0 then
begin dump_int(p); dump_hh(hash[p]); incr(cs_count);
@@ -29441,8 +25620,7 @@ dump_int(cs_count);@/
print_ln; print_int(cs_count); print(" multiletter control sequences")
@ @<Undump the hash table@>=
-for p:=0 to prim_size do undump_hh(prim[p]);
-for p:=0 to prim_size do undump_wd(prim_eqtb[p]);
+undump_primitives;
undump(hash_base)(frozen_control_sequence)(hash_used); p:=hash_base-1;
repeat undump(p+1)(hash_used)(p); undump_hh(hash[p]);
until p=hash_used;
@@ -29454,13 +25632,15 @@ dump_int(max_font_id);
for k:=0 to max_font_id do
@<Dump the array info for internal font number |k|@>;
print_ln; print_int(max_font_id); print(" preloaded font");
-if max_font_id<>1 then print_char("s")
+if max_font_id<>1 then print_char("s");
+dump_math_data
@ @<Undump the font information@>=
undump_int(x);
set_max_font_id(x);
for k:=0 to max_font_id do
- @<Undump the array info for internal font number |k|@>
+ @<Undump the array info for internal font number |k|@>;
+undump_math_data
@ @<Dump the array info for internal font number |k|@>=
begin dump_font(k);
@@ -29548,6 +25728,79 @@ dump_language_data
@ @<Undump the hyphenation tables@>=
undump_language_data
+@ Store some of the pdftex data structures in the format. The idea here is
+to ensure that any data structures referenced from pdftex-specific whatsit
+nodes are retained. For the sake of simplicity and speed, all the filled parts
+of |pdf_mem| and |obj_tab| are retained, in the present implementation. We also
+retain three of the linked lists that start from |head_tab|, so that it is
+possible to, say, load an image in the \.{INITEX} run and then reference it in a
+\.{VIRTEX} run that uses the dumped format.
+
+@<Dump pdftex data@>=
+begin
+dumpimagemeta; {the image information array }
+dump_int(pdf_mem_size);
+dump_int(pdf_mem_ptr);
+for k:=1 to pdf_mem_ptr-1 do begin
+ dump_int(pdf_mem[k]);
+ end;
+print_ln; print_int(pdf_mem_ptr-1); print(" words of pdf memory");
+dump_int(obj_tab_size);
+dump_int(obj_ptr);
+dump_int(sys_obj_ptr);
+for k:=1 to sys_obj_ptr do begin
+ dump_int(obj_tab[k].int0);
+ dump_int(obj_tab[k].int1);
+ dump_int(obj_tab[k].int3);
+ dump_int(obj_tab[k].int4);
+ end;
+print_ln; print_int(sys_obj_ptr); print(" indirect objects");
+dump_int(pdf_obj_count);
+dump_int(pdf_xform_count);
+dump_int(pdf_ximage_count);
+dump_int(head_tab[obj_type_obj]);
+dump_int(head_tab[obj_type_xform]);
+dump_int(head_tab[obj_type_ximage]);
+dump_int(pdf_last_obj);
+dump_int(pdf_last_xform);
+dump_int(pdf_last_ximage);
+end
+
+@ And restoring the pdftex data structures from the format. The
+two function arguments to |undumpimagemeta| have been restored
+already in an earlier module.
+
+@<Undump pdftex data@>=
+begin
+undumpimagemeta(pdf_minor_version,pdf_inclusion_errorlevel); {the image information array }
+undump_int(pdf_mem_size);
+pdf_mem := xreallocarray(pdf_mem, integer, pdf_mem_size);
+undump_int(pdf_mem_ptr);
+for k:=1 to pdf_mem_ptr-1 do begin
+ undump_int(pdf_mem[k]);
+ end;
+undump_int(obj_tab_size);
+undump_int(obj_ptr);
+undump_int(sys_obj_ptr);
+for k:=1 to sys_obj_ptr do begin
+ undump_int(obj_tab[k].int0);
+ undump_int(obj_tab[k].int1);
+ obj_tab[k].int2 := -1;
+ undump_int(obj_tab[k].int3);
+ undump_int(obj_tab[k].int4);
+ end;
+undump_int(pdf_obj_count);
+undump_int(pdf_xform_count);
+undump_int(pdf_ximage_count);
+undump_int(head_tab[obj_type_obj]);
+undump_int(head_tab[obj_type_xform]);
+undump_int(head_tab[obj_type_ximage]);
+undump_int(pdf_last_obj);
+undump_int(pdf_last_xform);
+undump_int(pdf_last_ximage);
+end
+
+
@ This is also done in C
@<Dump the lua bytecodes@>=
@@ -29583,7 +25836,7 @@ if interaction=batch_mode then selector:=log_only
else selector:=term_and_log;
pack_job_name(format_extension);
while not w_open_out(fmt_file) do
- prompt_file_name("format file name",format_extension);
+ prompt_file_name('format file name',format_extension);
print_nl("Beginning to dump on file ");
@.Beginning to dump...@>
slow_print(w_make_name_string(fmt_file)); flush_string;
@@ -29673,6 +25926,7 @@ ready_already:=314159;
start_of_TEX: @<Initialize the output routines@>;
@<Get the first line of input and prepare to start@>;
history:=spotless; {ready to go!}
+@<Initialize synctex primitive@>
main_control; {come to life}
final_cleanup; {prepare for death}
end_of_TEX: close_files_and_terminate;
@@ -29703,6 +25957,8 @@ end;
procedure print_version_banner;
begin
wterm(banner);
+wterm(', build ');
+do_write_wterm(luatex_svnversion);
end;
@@ -29723,52 +25979,54 @@ This program doesn't bother to close the input files that may still be open.
@<Last-minute...@>=
procedure close_files_and_terminate;
label done, done1;
-var a, b, c, i, j, k, l: integer; {all-purpose index}
- is_root: boolean; {|pdf_last_pages| is root of Pages tree?}
+var a, b, i, j, k, l: integer; {all-purpose index}
is_names: boolean; {flag for name tree output: is it Names or Kids?}
root, outlines, threads, names_tree, dests: integer;
xref_offset_width, names_head, names_tail: integer;
- callback_id:integer;
- res:boolean;
+ callback_id:integer;
+ res:boolean;
begin
callback_id:=callback_defined(stop_run_callback);
@<Finish the extensions@>;
@!stat if tracing_stats>0 then
if callback_id=0 then @<Output statistics about this job@>;@;@+tats@/
wake_up_terminal;
-if not fixed_pdfoutput_set then
+if not fixed_pdfoutput_set then {else there will be an infinite loop in error case}
fix_pdfoutput;
if fixed_pdfoutput > 0 then begin
if history = fatal_error_stop then begin
remove_pdffile;
print_err(" ==> Fatal error occurred, no output PDF file produced!")
- end
+ end
else begin
@<Finish the PDF file@>;
- if callback_id=0 then begin
- if log_opened then
- begin wlog_cr;
- wlog_ln('PDF statistics:');
- wlog_ln(' ',obj_ptr:1,' PDF objects out of ',obj_tab_size:1,
- ' (max. ',sup_obj_tab_size:1,')');
- if pdf_os_cntr > 0 then begin
- wlog(' ',((pdf_os_cntr - 1) * pdf_os_max_objs + pdf_os_objidx + 1):1,
- ' compressed objects within ',pdf_os_cntr:1,' object stream');
- if pdf_os_cntr > 1 then
- wlog('s');
- wlog_cr;
+ if callback_id=0 then begin
+ if log_opened then
+ begin wlog_cr;
+ wlog_ln('PDF statistics:');
+ wlog_ln(' ',obj_ptr:1,' PDF objects out of ',obj_tab_size:1,
+ ' (max. ',sup_obj_tab_size:1,')');
+ if pdf_os_cntr > 0 then begin
+ wlog(' ',((pdf_os_cntr - 1) * pdf_os_max_objs + pdf_os_objidx + 1):1,
+ ' compressed objects within ',pdf_os_cntr:1,' object stream');
+ if pdf_os_cntr > 1 then
+ wlog('s');
+ wlog_cr;
+ end;
+ wlog_ln(' ',pdf_dest_names_ptr:1,' named destinations out of ',dest_names_size:1,
+ ' (max. ',sup_dest_names_size:1,')');
+ wlog_ln(' ',pdf_mem_ptr:1,' words of extra memory for PDF output out of ',pdf_mem_size:1,
+ ' (max. ',sup_pdf_mem_size:1,')');
end;
- wlog_ln(' ',pdf_dest_names_ptr:1,' named destinations out of ',dest_names_size:1,
- ' (max. ',sup_dest_names_size:1,')');
- wlog_ln(' ',pdf_mem_ptr:1,' words of extra memory for PDF output out of ',pdf_mem_size:1,
- ' (max. ',sup_pdf_mem_size:1,')');
- end;
end;
end;
end
else begin
@<Finish the \.{DVI} file@>;
end;
+@<Close {\sl Sync\TeX} file and write status@>;
+free_text_codes;
+free_math_codes;
if log_opened then
begin wlog_cr; selector:=selector-2;
if (selector=term_only)and(callback_id=0) then begin
@@ -29827,8 +26085,8 @@ while input_ptr>0 do
if state=token_list then end_token_list@+else end_file_reading;
while open_parens>0 do
begin
- if tracefilenames then print(" )");
- decr(open_parens);
+ if tracefilenames then print(" )");
+ decr(open_parens);
end;
if cur_level>level_one then
begin print_nl("("); print_esc("end occurred ");
@@ -29863,6 +26121,7 @@ if c=1 then
delete_split_first_mark(i); delete_split_bot_mark(i);
end;
for c:=last_box_code to vsplit_code do flush_node_list(disc_ptr[c]);
+ if last_glue<>max_halfword then delete_glue_ref(last_glue);
@<Close the pseudo files@>;
store_fmt_file; return;@+tini@/
print_nl("(\dump is performed only by INITEX)"); return;
@@ -29907,7 +26166,7 @@ else buffer[limit]:=end_line_char;
fix_date_and_time;@/
random_seed :=(microseconds*1000)+(epochseconds mod 1000000);@/
init_randoms(random_seed);@/
-@<Compute the magic offset@>;
+initialize_math;
@<Initialize the print |selector|...@>;
if (loc<limit)and(get_cat_code(cat_code_table,buffer[loc])<>escape) then start_input;
{\.{\\input} assumed}
@@ -30033,18 +26292,17 @@ case of \.{\\openout}, we need three words and three auxiliary subfields
to hold the string numbers for name, area, and extension.
@d open_node=0 {|subtype| in whatsits that represent files to \.{\\openout}}
-@d open_node_size==4 {number of words in an open/whatsit node}
@d write_node=1 {|subtype| in whatsits that represent things to \.{\\write}}
-@d write_node_size==3 {number of words in a write/whatsit node}
@d close_node=2 {|subtype| in whatsits that represent streams to \.{\\closeout}}
-@d close_node_size==3 {number of words in a write/whatsit node}
@d special_node=3 {|subtype| in whatsits that represent \.{\\special} things}
-@d special_node_size==3 {number of words in a write/whatsit node}
-@d dir_node_size=4 {number of words in change direction node}
@d dir_dir(#)==vinfo(#+2) {keep the direction to be taken}
@d dir_level(#)==vlink(#+2) {the save level at which the direction was defined}
@d dir_dvi_ptr(#)==vinfo(#+3) {for reflecting dvi output}
@d dir_dvi_h(#)==vlink(#+3) {for reflecting dvi output}
+@d dir_box_pos_h(#)==vinfo(#+4) {for reflecting dvi output}
+@d dir_box_pos_v(#)==vlink(#+4) {for reflecting dvi output}
+@d dir_cur_h(#)==vinfo(#+5) {for reflecting dvi output}
+@d dir_cur_v(#)==vlink(#+5) {for reflecting dvi output}
@d what_lang(#)==vlink(#+2) {language number, in the range |0..255|}
@d what_lhm(#)==type(#+2) {minimum left fragment, in the range |1..63|}
@d what_rhm(#)==subtype(#+2) {minimum right fragment, in the range |1..63|}
@@ -30132,15 +26390,12 @@ stays the same.
@d pdf_annot_node == pdftex_first_extension_code + 7
@d pdf_start_link_node == pdftex_first_extension_code + 8
@d pdf_end_link_node == pdftex_first_extension_code + 9
-@d pdf_end_link_node_size==3
@d pdf_outline_code == pdftex_first_extension_code + 10
@d pdf_dest_node == pdftex_first_extension_code + 11
@d pdf_thread_node == pdftex_first_extension_code + 12
@d pdf_start_thread_node == pdftex_first_extension_code + 13
@d pdf_end_thread_node == pdftex_first_extension_code + 14
-@d pdf_end_thread_node_size==3
@d pdf_save_pos_node == pdftex_first_extension_code + 15
-@d pdf_save_pos_node_size==3
@d pdf_info_code == pdftex_first_extension_code + 16
@d pdf_thread_data_node == pdftex_first_extension_code + 16
@d pdf_catalog_code == pdftex_first_extension_code + 17
@@ -30155,7 +26410,6 @@ stays the same.
@d set_random_seed_code == pdftex_first_extension_code + 25
@d pdf_glyph_to_unicode_code == pdftex_first_extension_code + 26
@d late_lua_node == pdftex_first_extension_code + 27
-@d close_lua_node == pdftex_first_extension_code + 28
@d save_cat_code_table_code == pdftex_first_extension_code + 29
@d init_cat_code_table_code == pdftex_first_extension_code + 30
@d pdf_colorstack_node == pdftex_first_extension_code + 31
@@ -30165,94 +26419,95 @@ stays the same.
@d pdftex_last_extension_code == pdftex_first_extension_code + 34
@<Put each...@>=
-primitive("openout",extension,open_node);@/
+primitive_tex("openout",extension,open_node,0);@/
@!@:open_out_}{\.{\\openout} primitive@>
-primitive("write",extension,write_node); write_loc:=cur_val;@/
+primitive_tex("write",extension,write_node,0); write_loc:=cur_val;@/
@!@:write_}{\.{\\write} primitive@>
-primitive("closeout",extension,close_node);@/
+primitive_tex("closeout",extension,close_node,0);@/
@!@:close_out_}{\.{\\closeout} primitive@>
-primitive("special",extension,special_node);@/
+primitive_tex("special",extension,special_node,0);@/
@!@:special_}{\.{\\special} primitive@>
-primitive("immediate",extension,immediate_code);@/
+text(frozen_special):="special"; eqtb[frozen_special]:=eqtb[cur_val];@/
+primitive_tex("immediate",extension,immediate_code,0);@/
@!@:immediate_}{\.{\\immediate} primitive@>
-primitive("localinterlinepenalty",assign_int,local_inter_line_penalty_code);@/
-primitive("localbrokenpenalty",assign_int,local_broken_penalty_code);@/
-primitive("pagedir",assign_dir,dir_base+page_direction_code);@/
-primitive("bodydir",assign_dir,dir_base+body_direction_code);@/
-primitive("pardir",assign_dir,dir_base+par_direction_code);@/
-primitive("textdir",assign_dir,dir_base+text_direction_code);@/
-primitive("mathdir",assign_dir,dir_base+math_direction_code);@/
-primitive("pagerightoffset",assign_dimen,dimen_base+page_right_offset_code);
-primitive("pagebottomoffset",assign_dimen,dimen_base+page_bottom_offset_code);
-primitive("pdfliteral",extension,pdf_literal_node);@/
+primitive_omega("localinterlinepenalty",assign_int,int_base+local_inter_line_penalty_code,int_base);@/
+primitive_omega("localbrokenpenalty",assign_int,int_base+local_broken_penalty_code,int_base);@/
+primitive_omega("pagedir",assign_dir,dir_base+page_direction_code,dir_base);@/
+primitive_omega("bodydir",assign_dir,dir_base+body_direction_code,dir_base);@/
+primitive_omega("pardir",assign_dir,dir_base+par_direction_code,dir_base);@/
+primitive_omega("textdir",assign_dir,dir_base+text_direction_code,dir_base);@/
+primitive_omega("mathdir",assign_dir,dir_base+math_direction_code,dir_base);@/
+primitive_luatex("pageleftoffset",assign_dimen,dimen_base+page_left_offset_code,dimen_base);
+primitive_luatex("pagetopoffset",assign_dimen,dimen_base+page_top_offset_code,dimen_base);
+primitive_aleph("pagerightoffset",assign_dimen,dimen_base+page_right_offset_code,dimen_base);
+primitive_aleph("pagebottomoffset",assign_dimen,dimen_base+page_bottom_offset_code,dimen_base);
+primitive_pdftex("pdfliteral",extension,pdf_literal_node,0);@/
@!@:pdf_literal_}{\.{\\pdfliteral} primitive@>
-primitive("pdfcolorstack",extension,pdf_colorstack_node);@/
+primitive_pdftex("pdfcolorstack",extension,pdf_colorstack_node,0);@/
@!@:pdf_colorstack_}{\.{\\pdfcolorstack} primitive@>
-primitive("pdfsetmatrix",extension,pdf_setmatrix_node);@/
+primitive_pdftex("pdfsetmatrix",extension,pdf_setmatrix_node,0);@/
@!@:pdf_setmatrix_}{\.{\\pdfsetmatrix} primitive@>
-primitive("pdfsave",extension,pdf_save_node);@/
+primitive_pdftex("pdfsave",extension,pdf_save_node,0);@/
@!@:pdf_save_}{\.{\\pdfsave} primitive@>
-primitive("pdfrestore",extension,pdf_restore_node);@/
+primitive_pdftex("pdfrestore",extension,pdf_restore_node,0);@/
@!@:pdf_restore_}{\.{\\pdfrestore} primitive@>
-primitive("pdfobj",extension,pdf_obj_code);@/
+primitive_pdftex("pdfobj",extension,pdf_obj_code,0);@/
@!@:pdf_obj_}{\.{\\pdfobj} primitive@>
-primitive("pdfrefobj",extension,pdf_refobj_node);@/
+primitive_pdftex("pdfrefobj",extension,pdf_refobj_node,0);@/
@!@:pdf_refobj_}{\.{\\pdfrefobj} primitive@>
-primitive("pdfxform",extension,pdf_xform_code);@/
+primitive_pdftex("pdfxform",extension,pdf_xform_code,0);@/
@!@:pdf_xform_}{\.{\\pdfxform} primitive@>
-primitive("pdfrefxform",extension,pdf_refxform_node);@/
+primitive_pdftex("pdfrefxform",extension,pdf_refxform_node,0);@/
@!@:pdf_refxform_}{\.{\\pdfrefxform} primitive@>
-primitive("pdfximage",extension,pdf_ximage_code);@/
+primitive_pdftex("pdfximage",extension,pdf_ximage_code,0);@/
@!@:pdf_ximage_}{\.{\\pdfximage} primitive@>
-primitive("pdfrefximage",extension,pdf_refximage_node);@/
+primitive_pdftex("pdfrefximage",extension,pdf_refximage_node,0);@/
@!@:pdf_refximage_}{\.{\\pdfrefximage} primitive@>
-primitive("pdfannot",extension,pdf_annot_node);@/
+primitive_pdftex("pdfannot",extension,pdf_annot_node,0);@/
@!@:pdf_annot_}{\.{\\pdfannot} primitive@>
-primitive("pdfstartlink",extension,pdf_start_link_node);@/
+primitive_pdftex("pdfstartlink",extension,pdf_start_link_node,0);@/
@!@:pdf_start_link_}{\.{\\pdfstartlink} primitive@>
-primitive("pdfendlink",extension,pdf_end_link_node);@/
+primitive_pdftex("pdfendlink",extension,pdf_end_link_node,0);@/
@!@:pdf_end_link_}{\.{\\pdfendlink} primitive@>
-primitive("pdfoutline",extension,pdf_outline_code);@/
+primitive_pdftex("pdfoutline",extension,pdf_outline_code,0);@/
@!@:pdf_outline_}{\.{\\pdfoutline} primitive@>
-primitive("pdfdest",extension,pdf_dest_node);@/
+primitive_pdftex("pdfdest",extension,pdf_dest_node,0);@/
@!@:pdf_dest_}{\.{\\pdfdest} primitive@>
-primitive("pdfthread",extension,pdf_thread_node);@/
+primitive_pdftex("pdfthread",extension,pdf_thread_node,0);@/
@!@:pdf_thread_}{\.{\\pdfthread} primitive@>
-primitive("pdfstartthread",extension,pdf_start_thread_node);@/
+primitive_pdftex("pdfstartthread",extension,pdf_start_thread_node,0);@/
@!@:pdf_start_thread_}{\.{\\pdfstartthread} primitive@>
-primitive("pdfendthread",extension,pdf_end_thread_node);@/
+primitive_pdftex("pdfendthread",extension,pdf_end_thread_node,0);@/
@!@:pdf_end_thread_}{\.{\\pdfendthread} primitive@>
-primitive("pdfsavepos",extension,pdf_save_pos_node);@/
+primitive_pdftex("pdfsavepos",extension,pdf_save_pos_node,0);@/
@!@:pdf_save_pos_}{\.{\\pdfsavepos} primitive@>
-primitive("pdfinfo",extension,pdf_info_code);@/
+primitive_pdftex("pdfinfo",extension,pdf_info_code,0);@/
@!@:pdf_info_}{\.{\\pdfinfo} primitive@>
-primitive("pdfcatalog",extension,pdf_catalog_code);@/
+primitive_pdftex("pdfcatalog",extension,pdf_catalog_code,0);@/
@!@:pdf_catalog_}{\.{\\pdfcatalog} primitive@>
-primitive("pdfnames",extension,pdf_names_code);@/
+primitive_pdftex("pdfnames",extension,pdf_names_code,0);@/
@!@:pdf_names_}{\.{\\pdfnames} primitive@>
-primitive("pdfincludechars",extension,pdf_include_chars_code);@/
+primitive_pdftex("pdfincludechars",extension,pdf_include_chars_code,0);@/
@!@:pdf_include_chars_}{\.{\\pdfincludechars} primitive@>
-primitive("pdffontattr",extension,pdf_font_attr_code);@/
+primitive_pdftex("pdffontattr",extension,pdf_font_attr_code,0);@/
@!@:pdf_font_attr_}{\.{\\pdffontattr} primitive@>
-primitive("pdfmapfile",extension,pdf_map_file_code);@/
+primitive_pdftex("pdfmapfile",extension,pdf_map_file_code,0);@/
@!@:pdf_map_file_}{\.{\\pdfmapfile} primitive@>
-primitive("pdfmapline",extension,pdf_map_line_code);@/
+primitive_pdftex("pdfmapline",extension,pdf_map_line_code,0);@/
@!@:pdf_map_line_}{\.{\\pdfmapline} primitive@>
-primitive("pdftrailer",extension,pdf_trailer_code);@/
+primitive_pdftex("pdftrailer",extension,pdf_trailer_code,0);@/
@!@:pdf_trailer_}{\.{\\pdftrailer} primitive@>
-primitive("savecatcodetable",extension,save_cat_code_table_code);@/
+primitive_luatex("savecatcodetable",extension,save_cat_code_table_code,0);@/
@!@:save_cat_code_table_}{\.{\\savecatcodetable} primitive@>
-primitive("initcatcodetable",extension,init_cat_code_table_code);@/
+primitive_luatex("initcatcodetable",extension,init_cat_code_table_code,0);@/
@!@:init_cat_code_table_}{\.{\\initcatcodetable} primitive@>
-primitive("pdfsetrandomseed",extension,set_random_seed_code);@/
+primitive_pdftex("pdfsetrandomseed",extension,set_random_seed_code,0);@/
@!@:set_random_seed_code}{\.{\\pdfsetrandomseed} primitive@>
-primitive("latelua",extension,late_lua_node);@/
+primitive_luatex("latelua",extension,late_lua_node,0);@/
@!@:late_lua_node_}{\.{\\latelua} primitive@>
-primitive("closelua",extension,close_lua_node);@/
-@!@:close_lua_node_}{\.{\\closelua} primitive@>
-primitive("pdffontexpand",extension,pdf_font_expand_code);@/
+primitive_pdftex("pdffontexpand",extension,pdf_font_expand_code,0);@/
@!@:pdf_font_expand_}{\.{\\pdffontexpand} primitive@>
-primitive("pdfglyphtounicode",extension,pdf_glyph_to_unicode_code);@/
+primitive_pdftex("pdfglyphtounicode",extension,pdf_glyph_to_unicode_code,0);@/
@!@:pdf_glyph_to_unicode_}{\.{\\pdfglyphtounicode} primitive@>
@ The variable |write_loc| just introduced is used to provide an
@@ -30261,52 +26516,6 @@ appropriate error message in case of ``runaway'' write texts.
@<Glob...@>=
@!write_loc:pointer; {|eqtb| address of \.{\\write}}
-@ @<Cases of |print_cmd_chr|...@>=
-extension: case chr_code of
- open_node:print_esc("openout");
- write_node:print_esc("write");
- close_node:print_esc("closeout");
- special_node:print_esc("special");
- immediate_code:print_esc("immediate");
- pdf_annot_node: print_esc("pdfannot");
- pdf_catalog_code: print_esc("pdfcatalog");
- pdf_dest_node: print_esc("pdfdest");
- pdf_end_link_node: print_esc("pdfendlink");
- pdf_end_thread_node: print_esc("pdfendthread");
- pdf_font_attr_code: print_esc("pdffontattr");
- pdf_font_expand_code: print_esc("pdffontexpand");
- pdf_include_chars_code: print_esc("pdfincludechars");
- pdf_info_code: print_esc("pdfinfo");
- pdf_literal_node: print_esc("pdfliteral");
- pdf_colorstack_node: print_esc("pdfcolorstack");
- pdf_setmatrix_node: print_esc("pdfsetmatrix");
- pdf_save_node: print_esc("pdfsave");
- pdf_restore_node: print_esc("pdfrestore");
- pdf_map_file_code: print_esc("pdfmapfile");
- pdf_map_line_code: print_esc("pdfmapline");
- pdf_names_code: print_esc("pdfnames");
- pdf_obj_code: print_esc("pdfobj");
- pdf_outline_code: print_esc("pdfoutline");
- pdf_refobj_node: print_esc("pdfrefobj");
- pdf_refxform_node: print_esc("pdfrefxform");
- pdf_refximage_node: print_esc("pdfrefximage");
- pdf_save_pos_node: print_esc("pdfsavepos");
- pdf_start_link_node: print_esc("pdfstartlink");
- pdf_start_thread_node: print_esc("pdfstartthread");
- pdf_thread_node: print_esc("pdfthread");
- pdf_trailer_code: print_esc("pdftrailer");
- pdf_xform_code: print_esc("pdfxform");
- pdf_ximage_code: print_esc("pdfximage");
- save_cat_code_table_code: print_esc("savecatcodetable");
- init_cat_code_table_code: print_esc("initcatcodetable");
- set_random_seed_code: print_esc("pdfsetrandomseed");
- pdf_glyph_to_unicode_code: print_esc("pdfglyphtounicode");
- late_lua_node: print_esc("latelua");
- close_lua_node: print_esc("closelua");
- cancel_boundary_node: print_esc("noboundary");
- othercases print("[unknown extension!]")
- endcases;
-
@ When an |extension| command occurs in |main_control|, in any mode,
the |do_extension| routine is called.
@@ -30318,6 +26527,7 @@ any_mode(extension):do_extension;
procedure do_extension;
var i,@!j,@!k:integer; {all-purpose integers}
@!p,@!q,@!r:pointer; {all-purpose pointers}
+@!sn:integer; {a potential lua state name}
begin case cur_chr of
open_node:@<Implement \.{\\openout}@>;
write_node:@<Implement \.{\\write}@>;
@@ -30358,7 +26568,6 @@ begin case cur_chr of
set_random_seed_code: @<Implement \.{\\pdfsetrandomseed}@>;
pdf_glyph_to_unicode_code: @<Implement \.{\\pdfglyphtounicode}@>;
late_lua_node: @<Implement \.{\\latelua}@>;
- close_lua_node: @<Implement \.{\\closelua}@>;
othercases confusion("ext1")
@:this can't happen ext1}{\quad ext1@>
endcases;
@@ -30468,9 +26677,9 @@ end;
begin
check_pdfoutput("\pdfliteral", true);
new_whatsit(pdf_literal_node);
- if scan_keyword("direct") then
+ if scan_keyword('direct') then
pdf_literal_mode(tail) := direct_always
- else if scan_keyword("page") then
+ else if scan_keyword('page') then
pdf_literal_mode(tail) := direct_page
else
pdf_literal_mode(tail) := set_origin;
@@ -30497,20 +26706,20 @@ begin
print_err("Invalid negative color stack number");
@.Invalid negative color stack number@>
help2("I'll use default color stack 0 here.")@/
- ("Proceed, with fingers corssed.");
+ ("Proceed, with fingers crossed.");
error;
cur_val := 0;
end;
- if scan_keyword("set") then begin
+ if scan_keyword('set') then begin
i := colorstack_set;
end
- else if scan_keyword("push") then begin
+ else if scan_keyword('push') then begin
i := colorstack_push;
end
- else if scan_keyword("pop") then begin
+ else if scan_keyword('pop') then begin
i := colorstack_pop;
end
- else if scan_keyword("current") then begin
+ else if scan_keyword('current') then begin
i := colorstack_current;
end
else begin
@@ -30520,7 +26729,7 @@ begin
new_whatsit(pdf_colorstack_node);
pdf_colorstack_stack(tail) := cur_val;
pdf_colorstack_cmd(tail) := i;
- pdf_colorstack_data(tail) := null;
+ pdf_colorstack_data(tail) := null;
if i <= colorstack_data then begin
scan_pdf_ext_toks;
pdf_colorstack_data(tail) := def_ref;
@@ -30561,20 +26770,17 @@ end
begin
check_pdfoutput("\latelua", true);
new_whatsit(late_lua_node);
- scan_register_num;
- late_lua_reg(tail) := cur_val;
- scan_pdf_ext_toks;
+ if scan_keyword('name') then begin
+ scan_pdf_ext_toks;
+ late_lua_name(tail) := def_ref;
+ end;
+ sn:=0;
+ @<Parse optional lua state...@>;
+ if sn then late_lua_name(tail) := sn;
+ call_func(scan_toks(false, false));
late_lua_data(tail) := def_ref;
end
-@ @<Implement \.{\\closelua}@>=
-begin
- check_pdfoutput("\closelua", true);
- new_whatsit(close_lua_node);
- scan_register_num;
- late_lua_reg(tail) := cur_val;
-end
-
@ The \.{\\pdfobj} primitive is used to create a ``raw'' object in the PDF
output file. The object contents will be hold in memory and will be written
out only when the object is referenced by \.{\\pdfrefobj}. When \.{\\pdfobj}
@@ -30588,7 +26794,7 @@ end
@ @<Implement \.{\\pdfobj}@>=
begin
check_pdfoutput("\pdfobj", true);
- if scan_keyword("reserveobjnum") then begin
+ if scan_keyword('reserveobjnum') then begin
@<Scan an optional space@>;
incr(pdf_obj_count);
pdf_create_obj(obj_type_obj, pdf_obj_count);
@@ -30596,7 +26802,7 @@ begin
end
else begin
k := -1;
- if scan_keyword("useobjnum") then begin
+ if scan_keyword('useobjnum') then begin
scan_int;
k := cur_val;
if (k <= 0) or (k > obj_ptr) or (obj_data_ptr(k) <> 0) then begin
@@ -30611,9 +26817,9 @@ begin
k := obj_ptr;
end;
obj_data_ptr(k) := pdf_get_mem(pdfmem_obj_size);
- if scan_keyword("stream") then begin
+ if scan_keyword('stream') then begin
obj_obj_is_stream(k) := 1;
- if scan_keyword("attr") then begin
+ if scan_keyword('attr') then begin
scan_pdf_ext_toks;
obj_obj_stream_attr(k) := def_ref;
end
@@ -30622,7 +26828,7 @@ begin
end
else
obj_obj_is_stream(k) := 0;
- if scan_keyword("file") then
+ if scan_keyword('file') then
obj_obj_is_file(k) := 1
else
obj_obj_is_file(k) := 0;
@@ -30684,27 +26890,27 @@ begin
pdf_create_obj(obj_type_xform, pdf_xform_count);
k := obj_ptr;
obj_data_ptr(k) := pdf_get_mem(pdfmem_xform_size);
- if scan_keyword("attr") then begin
+ if scan_keyword('attr') then begin
scan_pdf_ext_toks;
obj_xform_attr(k) := def_ref;
end
else
obj_xform_attr(k) := null;
- if scan_keyword("resources") then begin
+ if scan_keyword('resources') then begin
scan_pdf_ext_toks;
obj_xform_resources(k) := def_ref;
end
else
obj_xform_resources(k) := null;
scan_int;
- p:=box(cur_val);
+ p:=box(cur_val);
if p = null then
pdf_error("ext1", "\pdfxform cannot be used with a void box");
obj_xform_width(k) := width(p);
obj_xform_height(k) := height(p);
obj_xform_depth(k) := depth(p);
obj_xform_box(k) := p; {save pointer to the box}
- box(cur_val):=null;
+ box(cur_val):=null;
pdf_last_xform := k;
end
@@ -30740,15 +26946,15 @@ warn_pdfpagebox := true;
function scan_pdf_box_spec: integer; {scans PDF pagebox specification}
begin
scan_pdf_box_spec := 0;
- if scan_keyword("mediabox") then
+ if scan_keyword('mediabox') then
scan_pdf_box_spec := pdf_box_spec_media
- else if scan_keyword("cropbox") then
+ else if scan_keyword('cropbox') then
scan_pdf_box_spec := pdf_box_spec_crop
- else if scan_keyword("bleedbox") then
+ else if scan_keyword('bleedbox') then
scan_pdf_box_spec := pdf_box_spec_bleed
- else if scan_keyword("trimbox") then
+ else if scan_keyword('trimbox') then
scan_pdf_box_spec := pdf_box_spec_trim
- else if scan_keyword("artbox") then
+ else if scan_keyword('artbox') then
scan_pdf_box_spec := pdf_box_spec_art
end;
@@ -30761,17 +26967,17 @@ begin
height(alt_rule) := null_flag;
depth(alt_rule) := null_flag;
reswitch:
- if scan_keyword("width") then begin
+ if scan_keyword('width') then begin
scan_normal_dimen;
width(alt_rule) := cur_val;
goto reswitch;
end;
- if scan_keyword("height") then begin
+ if scan_keyword('height') then begin
scan_normal_dimen;
height(alt_rule) := cur_val;
goto reswitch;
end;
- if scan_keyword("depth") then begin
+ if scan_keyword('depth') then begin
scan_normal_dimen;
depth(alt_rule) := cur_val;
goto reswitch;
@@ -30780,7 +26986,7 @@ end;
procedure scan_image;
label reswitch;
-var i, k, img_wd, img_ht, img_dp, ref: integer;
+var k, img_wd, img_ht, img_dp, ref: integer;
named, attr: str_number;
s: str_number;
page, pagebox, colorspace: integer;
@@ -30796,22 +27002,22 @@ begin
named := 0;
page := 1;
colorspace := 0;
- if scan_keyword("attr") then begin
+ if scan_keyword('attr') then begin
scan_pdf_ext_toks;
attr := tokens_to_string(def_ref);
delete_token_ref(def_ref);
end;
- if scan_keyword("named") then begin
+ if scan_keyword('named') then begin
scan_pdf_ext_toks;
named := tokens_to_string(def_ref);
delete_token_ref(def_ref);
page := 0;
end
- else if scan_keyword("page") then begin
+ else if scan_keyword('page') then begin
scan_int;
page := cur_val;
end;
- if scan_keyword("colorspace") then begin
+ if scan_keyword('colorspace') then begin
scan_int;
colorspace := cur_val;
end;
@@ -30868,7 +27074,7 @@ begin
pdf_check_obj(obj_type_ximage, cur_val);
new_whatsit(pdf_refximage_node);
j := obj_data_ptr(cur_val);
- pdf_ximage_ref(tail) := j;
+ pdf_ximage_idx(tail) := j;
pdf_width(tail) := image_width(j);
pdf_height(tail) := image_height(j);
pdf_depth(tail) := image_depth(j);
@@ -30941,11 +27147,11 @@ var p: integer;
begin
p := new_node(action_node,0);
scan_action := p;
- if scan_keyword("user") then
+ if scan_keyword('user') then
pdf_action_type(p) := pdf_action_user
- else if scan_keyword("goto") then
+ else if scan_keyword('goto') then
pdf_action_type(p) := pdf_action_goto
- else if scan_keyword("thread") then
+ else if scan_keyword('thread') then
pdf_action_type(p) := pdf_action_thread
else
pdf_error("ext1", "action type missing");
@@ -30954,11 +27160,11 @@ begin
pdf_action_tokens(p) := def_ref;
return;
end;
- if scan_keyword("file") then begin
+ if scan_keyword('file') then begin
scan_pdf_ext_toks;
pdf_action_file(p) := def_ref;
end;
- if scan_keyword("page") then begin
+ if scan_keyword('page') then begin
if pdf_action_type(p) <> pdf_action_goto then
pdf_error("ext1", "only GoTo action can be used with `page'");
pdf_action_type(p) := pdf_action_page;
@@ -30970,12 +27176,12 @@ begin
scan_pdf_ext_toks;
pdf_action_tokens(p) := def_ref;
end
- else if scan_keyword("name") then begin
+ else if scan_keyword('name') then begin
scan_pdf_ext_toks;
pdf_action_named_id(p) := 1;
pdf_action_id(p) := def_ref;
end
- else if scan_keyword("num") then begin
+ else if scan_keyword('num') then begin
if (pdf_action_type(p) = pdf_action_goto) and
(pdf_action_file(p) <> null) then
pdf_error("ext1",
@@ -30988,10 +27194,10 @@ begin
end
else
pdf_error("ext1", "identifier type missing");
- if scan_keyword("newwindow") then begin
+ if scan_keyword('newwindow') then begin
pdf_action_new_window(p) := 1;
@<Scan an optional space@>; end
- else if scan_keyword("nonewwindow") then begin
+ else if scan_keyword('nonewwindow') then begin
pdf_action_new_window(p) := 2;
@<Scan an optional space@>; end
else
@@ -31013,7 +27219,7 @@ begin
pdf_height(tail) := height(alt_rule);
pdf_depth(tail) := depth(alt_rule);
if (w = pdf_thread_node) or (w = pdf_start_thread_node) then begin
- if scan_keyword("attr") then begin
+ if scan_keyword('attr') then begin
scan_pdf_ext_toks;
pdf_thread_attr(tail) := def_ref;
end
@@ -31028,11 +27234,11 @@ end;
@ @<Implement \.{\\pdfannot}@>=
begin
check_pdfoutput("\pdfannot", true);
- if scan_keyword("reserveobjnum") then begin
+ if scan_keyword('reserveobjnum') then begin
pdf_last_annot := pdf_new_objnum;
@<Scan an optional space@>; end
else begin
- if scan_keyword("useobjnum") then begin
+ if scan_keyword('useobjnum') then begin
scan_int;
k := cur_val;
if (k <= 0) or (k > obj_ptr) or (obj_annot_ptr(k) <> 0) then
@@ -31059,8 +27265,8 @@ begin
pdf_error("ext1", "\pdfstartlink cannot be used in vertical mode");
k := pdf_new_objnum;
new_annot_whatsit(pdf_start_link_node);
- pdf_link_attr(tail) := null;
- if scan_keyword("attr") then begin
+ pdf_link_attr(tail) := null;
+ if scan_keyword('attr') then begin
scan_pdf_ext_toks;
pdf_link_attr(tail) := def_ref;
end;
@@ -31096,14 +27302,14 @@ end;
@ @<Implement \.{\\pdfoutline}@>=
begin
check_pdfoutput("\pdfoutline", true);
- if scan_keyword("attr") then begin
+ if scan_keyword('attr') then begin
scan_pdf_ext_toks;
r := def_ref;
end
else
r := 0;
p := scan_action;
- if scan_keyword("count") then begin
+ if scan_keyword('count') then begin
scan_int;
i := cur_val;
end
@@ -31198,7 +27404,7 @@ begin
check_pdfoutput("\pdfdest", true);
q := tail;
new_whatsit(pdf_dest_node);
- if scan_keyword("num") then begin
+ if scan_keyword('num') then begin
scan_int;
if cur_val <= 0 then
pdf_error("ext1", "num identifier must be positive");
@@ -31207,16 +27413,16 @@ begin
pdf_dest_id(tail) := cur_val;
pdf_dest_named_id(tail) := 0;
end
- else if scan_keyword("name") then begin
+ else if scan_keyword('name') then begin
scan_pdf_ext_toks;
pdf_dest_id(tail) := def_ref;
pdf_dest_named_id(tail) := 1;
end
else
pdf_error("ext1", "identifier type missing");
- if scan_keyword("xyz") then begin
+ if scan_keyword('xyz') then begin
pdf_dest_type(tail) := pdf_dest_xyz;
- if scan_keyword("zoom") then begin
+ if scan_keyword('zoom') then begin
scan_int;
if cur_val > max_halfword then
pdf_error("ext1", "number too big");
@@ -31225,19 +27431,19 @@ begin
else
pdf_dest_xyz_zoom(tail) := null;
end
- else if scan_keyword("fitbh") then
+ else if scan_keyword('fitbh') then
pdf_dest_type(tail) := pdf_dest_fitbh
- else if scan_keyword("fitbv") then
+ else if scan_keyword('fitbv') then
pdf_dest_type(tail) := pdf_dest_fitbv
- else if scan_keyword("fitb") then
+ else if scan_keyword('fitb') then
pdf_dest_type(tail) := pdf_dest_fitb
- else if scan_keyword("fith") then
+ else if scan_keyword('fith') then
pdf_dest_type(tail) := pdf_dest_fith
- else if scan_keyword("fitv") then
+ else if scan_keyword('fitv') then
pdf_dest_type(tail) := pdf_dest_fitv
- else if scan_keyword("fitr") then
+ else if scan_keyword('fitr') then
pdf_dest_type(tail) := pdf_dest_fitr
- else if scan_keyword("fit") then
+ else if scan_keyword('fit') then
pdf_dest_type(tail) := pdf_dest_fit
else
pdf_error("ext1", "destination type missing");
@@ -31267,7 +27473,7 @@ end
@ @<Declare procedures needed in |do_ext...@>=
procedure scan_thread_id;
begin
- if scan_keyword("num") then begin
+ if scan_keyword('num') then begin
scan_int;
if cur_val <= 0 then
pdf_error("ext1", "num identifier must be positive");
@@ -31276,7 +27482,7 @@ begin
pdf_thread_id(tail) := cur_val;
pdf_thread_named_id(tail) := 0;
end
- else if scan_keyword("name") then begin
+ else if scan_keyword('name') then begin
scan_pdf_ext_toks;
pdf_thread_id(tail) := def_ref;
pdf_thread_named_id(tail) := 1;
@@ -31348,7 +27554,7 @@ begin
scan_pdf_ext_toks;
if pdf_output > 0 then
pdf_catalog_toks := concat_tokens(pdf_catalog_toks, def_ref);
- if scan_keyword("openaction") then begin
+ if scan_keyword('openaction') then begin
if pdf_catalog_openaction <> 0 then
pdf_error("ext1", "duplicate of openaction")
else begin
@@ -31398,14 +27604,14 @@ end
@ @<Implement \.{\\savecatcodetable}@>=
begin
scan_int;
- if (cur_val<0)or(cur_val>@"FFFFFFF) then begin
- print_err("Invalid \catcode table");
- help1("All \catcode table ids must be between 0 and 0xFFFFFFF");
- error;
+ if (cur_val<0)or(cur_val>@"FFFF) then begin
+ print_err("Invalid \catcode table");
+ help1("All \catcode table ids must be between 0 and 0xFFFF");
+ error;
end
else begin if cur_val=cat_code_table then begin
print_err("Invalid \catcode table");
- help1("You cannot overwrite the current \catcode table");
+ help1("You cannot overwrite the current \catcode table");
error;
end
else
@@ -31416,15 +27622,15 @@ end
@ @<Implement \.{\\initcatcodetable}@>=
begin
scan_int;
- if (cur_val<0)or(cur_val>@"FFFFFFF) then begin
- print_err("Invalid \catcode table");
- help1("All \catcode table ids must be between 0 and 0xFFFFFFF");
- error;
+ if (cur_val<0)or(cur_val>@"FFFF) then begin
+ print_err("Invalid \catcode table");
+ help1("All \catcode table ids must be between 0 and 0xFFFF");
+ error;
end
else begin if cur_val=cat_code_table then begin
print_err("Invalid \catcode table");
- help1("You cannot overwrite the current \catcode table");
- error;
+ help1("You cannot overwrite the current \catcode table");
+ error;
end
else
initex_cat_codes(cur_val);
@@ -31605,27 +27811,6 @@ begin
until a = b;
end;
-@ @<Display <rule spec> for whatsit node created by \pdfTeX@>=
-print("(");
-print_rule_dimen(pdf_height(p));
-print_char("+");
-print_rule_dimen(pdf_depth(p));
-print(")x");
-print_rule_dimen(pdf_width(p))
-
-@ Each new type of node that appears in our data structure must be capable
-of being displayed, copied, destroyed, and so on. The routines that we
-need for write-oriented whatsits are somewhat like those for mark nodes;
-other extensions might, of course, involve more subtlety here.
-
-@<Basic printing...@>=
-procedure print_write_whatsit(@!s:str_number;@!p:pointer);
-begin print_esc(s);
-if write_stream(p)<16 then print_int(write_stream(p))
-else if write_stream(p)=16 then print_char("*")
-@.*\relax@>
-else print_char("-");
-end;
@ Three extra node types carry information from |main_control|.
@@ -31646,237 +27831,10 @@ typesetting engine itself. Each has an id, a type, and a value. The
type of the value depends on the |user_node_type| field.
@d user_defined_node==cancel_boundary_node+1
-@d user_defined_node_size=4
@d user_node_id(#)==vlink(#+2)
@d user_node_type(#)==vinfo(#+2)
@d user_node_value(#)==vinfo(#+3)
-@ @<Display the whatsit...@>=
-case subtype(p) of
-open_node:begin print_write_whatsit("openout",p);
- print_char("="); print_file_name(open_name(p),open_area(p),open_ext(p));
- end;
-write_node:begin print_write_whatsit("write",p);
- print_mark(write_tokens(p));
- end;
-close_node:print_write_whatsit("closeout",p);
-special_node:begin print_esc("special");
- print_mark(write_tokens(p));
- end;
-dir_node:
- if dir_dir(p)<0 then begin
- print_esc("enddir"); print(" "); print_dir(dir_dir(p)+64);
- end
- else begin
- print_esc("begindir"); print(" "); print_dir(dir_dir(p));
- end;
-@<LOCAL: print out |local_paragraph| node@>;
-pdf_literal_node: begin
- print_esc("pdfliteral");
- case pdf_literal_mode(p) of
- set_origin:
- do_nothing;
- direct_page:
- print(" page");
- direct_always:
- print(" direct");
- othercases confusion("literal2")
- endcases;
- print_mark(pdf_literal_data(p));
-end;
-pdf_colorstack_node: begin
- print_esc("pdfcolorstack ");
- print_int(pdf_colorstack_stack(p));
- case pdf_colorstack_cmd(p) of
- colorstack_set:
- print(" set ");
- colorstack_push:
- print(" push ");
- colorstack_pop:
- print(" pop");
- colorstack_current:
- print(" current");
- othercases confusion("pdfcolorstack")
- endcases;
- if pdf_colorstack_cmd(p) <= colorstack_data then
- print_mark(pdf_colorstack_data(p));
-end;
-pdf_setmatrix_node: begin
- print_esc("pdfsetmatrix");
- print_mark(pdf_setmatrix_data(p));
-end;
-pdf_save_node: begin
- print_esc("pdfsave");
-end;
-pdf_restore_node: begin
- print_esc("pdfrestore");
-end;
-cancel_boundary_node: begin
- print_esc("noboundary");
-end;
-late_lua_node: begin
- print_esc("latelua");
- print_int(late_lua_reg(p));
- print_mark(late_lua_data(p));
-end;
-close_lua_node: begin
- print_esc("closelua");
- print_int(late_lua_reg(p));
-end;
-pdf_refobj_node: begin
- print_esc("pdfrefobj");
- if obj_obj_is_stream(pdf_obj_objnum(p)) > 0 then begin
- if obj_obj_stream_attr(pdf_obj_objnum(p)) <> null then begin
- print(" attr");
- print_mark(obj_obj_stream_attr(pdf_obj_objnum(p)));
- end;
- print(" stream");
- end;
- if obj_obj_is_file(pdf_obj_objnum(p)) > 0 then
- print(" file");
- print_mark(obj_obj_data(pdf_obj_objnum(p)));
-end;
-pdf_refxform_node: begin
- print_esc("pdfrefxform");
- print("(");
- print_scaled(obj_xform_height(pdf_xform_objnum(p)));
- print_char("+");
- print_scaled(obj_xform_depth(pdf_xform_objnum(p)));
- print(")x");
- print_scaled(obj_xform_width(pdf_xform_objnum(p)));
-end;
-pdf_refximage_node: begin
- print_esc("pdfrefximage");
- print("(");
- print_scaled(pdf_height(p));
- print_char("+");
- print_scaled(pdf_depth(p));
- print(")x");
- print_scaled(pdf_width(p));
-end;
-pdf_annot_node: begin
- print_esc("pdfannot");
- @<Display <rule spec> for whatsit node created by \pdfTeX@>;
- print_mark(pdf_annot_data(p));
-end;
-pdf_start_link_node: begin
- print_esc("pdflink");
- @<Display <rule spec> for whatsit node created by \pdfTeX@>;
- if pdf_link_attr(p) <> null then begin
- print(" attr");
- print_mark(pdf_link_attr(p));
- end;
- print(" action");
- if pdf_action_type(pdf_link_action(p)) = pdf_action_user then begin
- print(" user");
- print_mark(pdf_action_tokens(pdf_link_action(p)));
- return;
- end;
- if pdf_action_file(pdf_link_action(p)) <> null then begin
- print(" file");
- print_mark(pdf_action_file(pdf_link_action(p)));
- end;
- case pdf_action_type(pdf_link_action(p)) of
- pdf_action_goto: begin
- if pdf_action_named_id(pdf_link_action(p)) > 0 then begin
- print(" goto name");
- print_mark(pdf_action_id(pdf_link_action(p)));
- end
- else begin
- print(" goto num");
- print_int(pdf_action_id(pdf_link_action(p)))
- end;
- end;
- pdf_action_page: begin
- print(" page");
- print_int(pdf_action_id(pdf_link_action(p)));
- print_mark(pdf_action_tokens(pdf_link_action(p)));
- end;
- pdf_action_thread: begin
- if pdf_action_named_id(pdf_link_action(p)) > 0 then begin
- print(" thread name");
- print_mark(pdf_action_id(pdf_link_action(p)));
- end
- else begin
- print(" thread num");
- print_int(pdf_action_id(pdf_link_action(p)));
- end;
- end;
- othercases pdf_error("displaying", "unknown action type");
- endcases;
-end;
-pdf_end_link_node: print_esc("pdfendlink");
-pdf_dest_node: begin
- print_esc("pdfdest");
- if pdf_dest_named_id(p) > 0 then begin
- print(" name");
- print_mark(pdf_dest_id(p));
- end
- else begin
- print(" num");
- print_int(pdf_dest_id(p));
- end;
- print(" ");
- case pdf_dest_type(p) of
- pdf_dest_xyz: begin
- print("xyz");
- if pdf_dest_xyz_zoom(p) <> null then begin
- print(" zoom");
- print_int(pdf_dest_xyz_zoom(p));
- end;
- end;
- pdf_dest_fitbh: print("fitbh");
- pdf_dest_fitbv: print("fitbv");
- pdf_dest_fitb: print("fitb");
- pdf_dest_fith: print("fith");
- pdf_dest_fitv: print("fitv");
- pdf_dest_fitr: begin
- print("fitr");
- @<Display <rule spec> for whatsit node created by \pdfTeX@>;
- end;
- pdf_dest_fit: print("fit");
- othercases print("unknown!");
- endcases;
-end;
-pdf_thread_node,
-pdf_start_thread_node: begin
- if subtype(p) = pdf_thread_node then
- print_esc("pdfthread")
- else
- print_esc("pdfstartthread");
- print("("); print_rule_dimen(pdf_height(p)); print_char("+");
- print_rule_dimen(pdf_depth(p)); print(")x");
- print_rule_dimen(pdf_width(p));
- if pdf_thread_attr(p) <> null then begin
- print(" attr");
- print_mark(pdf_thread_attr(p));
- end;
- if pdf_thread_named_id(p) > 0 then begin
- print(" name");
- print_mark(pdf_thread_id(p));
- end
- else begin
- print(" num");
- print_int(pdf_thread_id(p));
- end;
-end;
-pdf_end_thread_node: print_esc("pdfendthread");
-pdf_save_pos_node: print_esc("pdfsavepos");
-user_defined_node: begin
- print_esc("whatsit");
- print_int(user_node_id(p));
- print_char("=");
- case user_node_type(p) of
- "a": print("<>");
- "n": begin print("["); show_node_list(user_node_value(p)); print("]"); end;
- "s": begin print(""""); print(user_node_value(p)); print(""""); end;
- "t": print_mark(user_node_value(p));
- othercases { only d }
- print_int(user_node_value(p));
- endcases;
- end;
-othercases print("whatsit?")
-endcases
@ @<Incorporate a whatsit node into a vbox@>=
if (subtype(p) = pdf_refxform_node) or (subtype(p) = pdf_refximage_node) then
@@ -31901,12 +27859,6 @@ end;
end;
end
-@ @<Let |d| be the width of the whatsit |p|@>=
-if (subtype(p) = pdf_refxform_node) or (subtype(p) = pdf_refximage_node) then
- d := pdf_width(p)
-else
- d := 0
-
@ @<Prepare to move whatsit |p| to the current page, then |goto contribute|@>=
begin
if (subtype(p) = pdf_refxform_node) or (subtype(p) = pdf_refximage_node) then
@@ -31939,7 +27891,7 @@ that actually send out the requested data. Let's do \.{\\special} first
procedure special_out(@!p:pointer);
var old_setting:0..max_selector; {holds print |selector|}
@!k:pool_pointer; {index into |str_pool|}
-begin synch_h; synch_v;@/
+begin synch_dvi_with_cur;@/
old_setting:=selector; selector:=new_string;
show_token_list(link(write_tokens(p)),null,pool_size-pool_ptr);
selector:=old_setting;
@@ -31983,6 +27935,13 @@ else begin {write to the terminal if file isn't open}
token_show(def_ref); print_ln;
flush_list(def_ref); selector:=old_setting;
end;
+procedure expand_late_lua(@!p:pointer);
+var @!old_mode:integer; {saved |mode|}
+@!q,@!r:pointer; {temporary variables for list manipulation}
+begin @<Expand macros in the token list
+ and make |link(def_ref)| point to the result@>;
+end;
+
@ The final line of this routine is slightly subtle; at least, the author
didn't think about it until getting burnt! There is a used-up token list
@@ -32029,18 +27988,20 @@ open_node,write_node,close_node:@<Do some work that has been queued up
for \.{\\write}@>;
special_node:special_out(p);
pdf_save_pos_node:
- @<Save current position in DVI mode@>;
+ @<Save current position@>;
local_par_node:do_nothing;
cancel_boundary_node: do_nothing;
+user_defined_node: do_nothing;
othercases confusion("ext4") {TH: those will be pdf extension nodes in dvi mode, most likely}
@:this can't happen ext4}{\quad ext4@>
endcases;
end;
-@ @<Save current position in DVI mode@>=
+@ @<Save current position@>=
begin
- pdf_last_x_pos := cur_h + one_inch;
- pdf_last_y_pos := cur_page_height - cur_v - one_inch;
+ synch_pos_with_cur;
+ pdf_last_x_pos := pos.h;
+ pdf_last_y_pos := pos.v;
end
@ We don't implement \.{\\write} inside of leaders. (The reason is that
@@ -32060,7 +28021,7 @@ if not doing_leaders then
if cur_ext="" then cur_ext:=".tex";
pack_cur_name;
while not lua_a_open_out(write_file[j],(j+1)) do
- prompt_file_name("output file name",".tex");
+ prompt_file_name('output file name','.tex');
write_file[j]:= name_file_pointer;
write_open[j]:=true;
end;
@@ -32081,10 +28042,6 @@ if cur_cmd=extension then begin
flush_node_list(tail); tail:=p; vlink(p):=null;
end
else case cur_chr of
- close_lua_node: begin
- scan_register_num;
- closelua(cur_val);
- end;
pdf_obj_code: begin
do_extension; {scan object and set |pdf_last_obj|}
if obj_data_ptr(pdf_last_obj) = 0 then {this object has not been initialized yet}
@@ -32118,7 +28075,6 @@ for k:=0 to 15 do if write_open[k] then lua_a_close_out(write_file[k])
@d local_box_right(#)==vlink(#+4) {\.{\\localleftbox}}
@d local_box_right_width(#)==vinfo(#+4)
@d local_par_dir(#)==vinfo(#+5)
-@d local_par_size==6
@<LOCAL: Declare |make_local_par_node|@>=
function make_local_par_node:pointer;
@@ -32140,51 +28096,18 @@ local_par_dir(p):=par_direction;
make_local_par_node:=p;
end
-@ @<LOCAL: print out |local_paragraph| node@>=
-local_par_node: begin
- print_esc("whatsit");
- append_char(".");
- print_ln; print_current_string;
- print_esc("localinterlinepenalty"); print("=");
- print_int(local_pen_inter(p));
- print_ln; print_current_string;
- print_esc("localbrokenpenalty"); print("=");
- print_int(local_pen_broken(p));
- print_ln; print_current_string;
- print_esc("localleftbox");
- if local_box_left(p)=null then print("=null")
- else begin
- append_char(".");
- show_node_list(local_box_left(p));
- decr(pool_ptr);
- end;
- print_ln; print_current_string;
- print_esc("localrightbox");
- if local_box_right(p)=null then print("=null")
- else begin
- append_char(".");
- show_node_list(local_box_right(p));
- decr(pool_ptr);
- end;
- decr(pool_ptr);
- end
-
@ @<LOCAL: Add local paragraph node@>=
begin tail_append(make_local_par_node) end
@ @<DIR: Assign direction codes@>=
case cur_chr of
dir_base+page_direction_code: begin
- if its_all_over then begin
scan_direction;
eq_word_define(dir_base+page_direction_code,cur_val);
- end;
end;
dir_base+body_direction_code: begin
- if its_all_over then begin
scan_direction;
eq_word_define(dir_base+body_direction_code,cur_val);
- end;
end;
dir_base+par_direction_code: begin
scan_direction;
@@ -32239,12 +28162,6 @@ dir_dir(p):=s; dir_dvi_ptr(p):=-1;
dir_level(p):=cur_level; new_dir:=p;
end
-@ @<Append a begin direction to the tail of the current list@>=
-tail_append(new_dir(math_direction))
-
-@ @<Append an end direction to the tail of the current list@>=
-tail_append(new_dir(math_direction-64))
-
@ @<DIR: Add local dir node@>=
tail_append(new_dir(text_direction))
@@ -32267,26 +28184,6 @@ begin
pop_dir_node
end
-@ @<DIR: |unsave| math@>=
-begin
-unsave;
-decr(save_ptr);
-flush_node_list(text_dir_ptr);
-text_dir_ptr:=saved(0);
-end
-
-@ @<DIR: |new_save_level| math@>=
-begin
-saved(0):=text_dir_ptr;
-text_dir_ptr:=new_dir(math_direction);
-incr(save_ptr);
-new_save_level(c);
-eq_word_define(dir_base+body_direction_code,math_direction);
-eq_word_define(dir_base+par_direction_code,math_direction);
-eq_word_define(dir_base+text_direction_code,math_direction);
-eq_word_define(int_base+level_local_dir_code,cur_level);
-end
-
@ @<DIR: Adjust |text_dir_ptr| for |scan_spec|@>=
begin
if spec_direction<>-1 then begin
@@ -32328,92 +28225,36 @@ end
@ @<Output a reflection instruction if the direction has changed@>=
begin
-if dir_dir(p)>=0 then
- begin synch_h; synch_v;
- push_dir_node(p);
- if dir_opposite(dir_secondary[dir_dir(dir_ptr)])(dir_secondary[dvi_direction])
- then begin
- if (dir_secondary[dvi_direction]=0) or
- (dir_secondary[dvi_direction]=2) then
- dvi_out(down4)
- else
- dvi_out(right4);
- dir_dvi_ptr(dir_ptr):=dvi_ptr;
- dir_dvi_h(dir_ptr):=dvi_h;
- dvi_four(0);
- cur_h:=0; dvi_h:=0;
- end
- else begin
- dir_dvi_ptr(dir_ptr):=dvi_ptr;
- dir_dvi_h(dir_ptr):=dvi_h;
- end;
- dvi_direction:=dir_dir(dir_ptr);
+ if dir_dir(p)>=0 then begin
+ push_dir_node(p);
+ @<(PDF) Calculate the needed width to the matching |enddir|, and store it in |w|, as
+ well as in the enddir's |dir_dvi_h|@>;
+ if (dir_opposite(dir_secondary[dir_dir(dir_ptr)])(dir_secondary[dvi_direction]))
+ or (dir_eq(dir_secondary[dir_dir(dir_ptr)])(dir_secondary[dvi_direction]))
+ then begin
+ dir_cur_h(temp_ptr) := cur.h + w;
+ if dir_opposite(dir_secondary[dir_dir(dir_ptr)])(dir_secondary[dvi_direction]) then
+ cur.h := cur.h + w;
+ end else
+ dir_cur_h(temp_ptr) := cur.h;
+ dir_cur_v(temp_ptr) := cur.v;
+ dir_box_pos_h(temp_ptr) := box_pos.h;
+ dir_box_pos_v(temp_ptr) := box_pos.v;
+ synch_pos_with_cur; {no need for |synch_dvi_with_cur|, as there is no DVI grouping}
+ box_pos := pos; {fake a nested |hlist_out|}
+ set_to_zero(cur);
+ dvi_direction:=dir_dir(dir_ptr);
end
-else begin
- dvi_dir_h:=dir_dvi_h(dir_ptr);
- dvi_dir_ptr:=dir_dvi_ptr(dir_ptr);
- pop_dir_node;
- synch_h; synch_v;
- if dir_ptr<>null then
- dvi_direction:=dir_dir(dir_ptr)
- else
- dvi_direction:=0;
- if dir_opposite(dir_secondary[dir_dir(p)+64])(dir_secondary[dvi_direction])
- then begin
- dvi_temp_ptr:=dvi_ptr;
- dvi_ptr:=dvi_dir_ptr;
- if (dir_secondary[dvi_direction]=0) or
- (dir_secondary[dvi_direction]=1) then
- dvi_four(dvi_h)
- else
- dvi_four(-dvi_h);
- dvi_ptr:=dvi_temp_ptr;
- if (dir_secondary[dvi_direction]=0) or
- (dir_secondary[dvi_direction]=2) then
- dvi_out(down4)
- else
- dvi_out(right4);
- if (dir_secondary[dvi_direction]=0) or
- (dir_secondary[dvi_direction]=1) then
- dvi_four(dvi_h)
+ else begin
+ pop_dir_node;
+ box_pos.h := dir_box_pos_h(p);
+ box_pos.v := dir_box_pos_v(p);
+ cur.h := dir_cur_h(p);
+ cur.v := dir_cur_v(p);
+ if dir_ptr<>null then
+ dvi_direction:=dir_dir(dir_ptr)
else
- dvi_four(-dvi_h);
- end;
- cur_h:=dvi_dir_h+dvi_h; dvi_h:=cur_h;
- end
-end
-
-@ Many things regarding output work differently in pdf compared to dvi
-output. The easiest way to deal with in-line direction changes in pdf
-mode seems to be to move forward to find the needed width of the
-reversed section, then skip forward (or backward, depending on your
-viewpont) by that distance.
-
-@<(PDF) Output a reflection instruction if the direction has changed@>=
-begin
-if dir_dir(p)>=0 then begin
- push_dir_node(p);
- if dir_opposite(dir_secondary[dir_dir(dir_ptr)])(dir_secondary[dvi_direction])
- then begin
- @<(PDF) Calculate the needed width to the matching |enddir|, and store it in |w|, as
- well as in the enddir's |dir_dvi_h|@>;
- case box_direction(dvi_direction) of
- dir_TL_,dir_BL_: pdf_dvicmd_right(w);
- dir_TR_,dir_BR_: pdf_dvicmd_left(w);
- end;
- end;
- dvi_direction:=dir_dir(dir_ptr);
- end
-else begin
- pop_dir_node;
- if dir_ptr<>null then
- dvi_direction:=dir_dir(dir_ptr)
- else
- dvi_direction:=0;
- case box_direction(dvi_direction) of
- dir_TL_,dir_BL_: pdf_dvicmd_right(dir_dvi_h(p));
- dir_TR_,dir_BR_: pdf_dvicmd_left(dir_dvi_h(p));
- end;
+ dvi_direction:=0;
end
end
@@ -32423,7 +28264,34 @@ this segment, it stores the accumulated with in the |dir_dvi_h| field
of that end node, so that when that node is found later in the
processing, the correct glue correction can be applied.
-@<(PDF) Calculate the needed width to the matching |enddir|...@>=
+@p
+function simple_advance_width(p:halfword):scaled;
+var q:halfword;
+@!w:scaled;
+begin
+ q:=p; w:=0;
+ while (q<>null) and (vlink(q)<>null) do begin
+ q:=vlink(q);
+ if is_char_node(q) then begin
+ w:=w+glyph_width(q);
+ end
+ else begin
+ case type(q) of
+ hlist_node_case,vlist_node_case,rule_node_case,
+ margin_kern_node_case,kern_node_case:
+ w:=w+width(q);
+ disc_node_case: if vlink(no_break(q))<>null then begin
+ w:=w+simple_advance_width(no_break(q));
+ end;
+ othercases do_nothing;
+ endcases;
+ end;
+ end;
+ simple_advance_width:=w;
+end;
+
+
+@ @<(PDF) Calculate the needed width to the matching |enddir|...@>=
begin
q:=p; w:=0;
save_cur_g:=cur_g;
@@ -32433,15 +28301,15 @@ begin
{|w:=w-cur_g; cur_glue:=0;|}
dir_nest:=1;
while (q<>null) and (vlink(q)<>null) do begin
- q:=vlink(q);
+ q:=vlink(q);
if is_char_node(q) then begin
w:=w+glyph_width(q); {TODO no vertical support for now}
end
else begin
case type(q) of
- hlist_node,vlist_node,rule_node,
- margin_kern_node,kern_node:w:=w+width(q);
- glue_node: begin
+ hlist_node_case,vlist_node_case,rule_node_case,
+ margin_kern_node_case,kern_node_case:w:=w+width(q);
+ glue_node_case: begin
g:=glue_ptr(q);
w:=w+width(g)-cur_g;
if g_sign<>normal then
@@ -32460,13 +28328,17 @@ begin
end;
w:=w+cur_g;
end;
- math_node: w:=w+surround(q);
- whatsit_node: begin
+ disc_node_case: if vlink(no_break(q))<>null then begin
+ w:=w+simple_advance_width(no_break(q));
+ end;
+ math_node_case: w:=w+surround(q);
+ whatsit_node_case: begin
if subtype(q)=dir_node then begin
if dir_dir(q)>=0 then incr(dir_nest) else decr(dir_nest);
if dir_nest=0 then begin
dir_dvi_h(q) := w;
- q:=null;
+ temp_ptr := q;
+ q:=null;
end;
end
else if (subtype(q) = pdf_refxform_node) or
@@ -32491,10 +28363,7 @@ dest_name_entry = record
end;
@ @<Glob...@>=
-@!cur_page_width: scaled; {width of page being shipped}
-@!cur_page_height: scaled; {height of page being shipped}
-@!cur_right_offset: scaled; {horizontal inverted offset of page being shipped}
-@!cur_bottom_offset: scaled; {vertical inverted offset of page being shipped}
+@!cur_page_size: scaledpos; {width and height of page being shipped}
@!pdf_obj_list: pointer; {list of objects in the current page}
@!pdf_xform_list: pointer; {list of forms in the current page}
@!pdf_ximage_list: pointer; {list of images in the current page}
@@ -32621,33 +28490,39 @@ begin d:=0;
pdf_print_ln(" >>");
end;
-procedure set_rect_dimens(p, parent_box: pointer; x, y, w, h, d, margin: scaled);
+procedure set_rect_dimens(p, parent_box: pointer; x, y, wd, ht, dp, margin: scaled);
+var ll, ur, pos_ll, pos_ur, tmp: scaledpos;
begin
- pdf_left(p) := cur_h;
- if is_running(w) then
- pdf_right(p) := x + width(parent_box)
+ ll.h := cur.h;
+ if is_running(dp) then
+ ll.v := y + depth(parent_box)
else
- pdf_right(p) := cur_h + w;
- if is_running(h) then
- pdf_top(p) := y - height(parent_box)
+ ll.v := cur.v + dp;
+ if is_running(wd) then
+ ur.h := x + width(parent_box)
else
- pdf_top(p) := cur_v - h;
- if is_running(d) then
- pdf_bottom(p) := y + depth(parent_box)
+ ur.h := cur.h + wd;
+ if is_running(ht) then
+ ur.v := y - height(parent_box)
else
- pdf_bottom(p) := cur_v + d;
+ ur.v := cur.v - ht;
+ pos_ll := synch_p_with_c(ll);
+ pos_ur := synch_p_with_c(ur);
+ if pos_ll.h > pos_ur.h then begin
+ tmp.h := pos_ll.h; pos_ll.h := pos_ur.h; pos_ur.h := tmp.h; end;
+ if pos_ll.v > pos_ur.v then begin
+ tmp.v := pos_ll.v; pos_ll.v := pos_ur.v; pos_ur.v := tmp.v; end;
if is_shipping_page and matrixused then begin
- matrixtransformrect(pdf_left(p), cur_page_height - pdf_bottom(p),
- pdf_right(p), cur_page_height - pdf_top(p));
- pdf_left(p) := getllx;
- pdf_bottom(p) := cur_page_height - getlly;
- pdf_right(p) := geturx;
- pdf_top(p) := cur_page_height - getury;
+ matrixtransformrect(pos_ll.h, pos_ll.v, pos_ur.h, pos_ur.v);
+ pos_ll.h := getllx;
+ pos_ll.v := getlly;
+ pos_ur.h := geturx;
+ pos_ur.v := getury;
end;
- pdf_left(p) := pdf_left(p) - margin;
- pdf_top(p) := pdf_top(p) - margin;
- pdf_right(p) := pdf_right(p) + margin;
- pdf_bottom(p) := pdf_bottom(p) + margin;
+ pdf_ann_left(p) := pos_ll.h - margin;
+ pdf_ann_bottom(p) := pos_ll.v - margin;
+ pdf_ann_right(p) := pos_ur.h + margin;
+ pdf_ann_top(p) := pos_ur.v + margin;
end;
procedure do_annot(p, parent_box: pointer; x, y: scaled);
@@ -32656,13 +28531,16 @@ begin
pdf_error("ext4", "annotations cannot be inside an XForm");
if doing_leaders then
return;
+ if is_obj_scheduled(pdf_annot_objnum(p)) then
+ pdf_annot_objnum(p) := pdf_new_objnum;
set_rect_dimens(p, parent_box, x, y,
pdf_width(p), pdf_height(p), pdf_depth(p), 0);
obj_annot_ptr(pdf_annot_objnum(p)) := p;
pdf_append_list(pdf_annot_objnum(p))(pdf_annot_list);
+ set_obj_scheduled(pdf_annot_objnum(p));
end;
-@ To implement nesting link annotations, we need a stack to hold copy of
+@ To implement nested link annotations, we need a stack to hold copy of
|pdf_start_link_node|'s that are being written out, together with their box
nesting level.
@@ -32673,7 +28551,7 @@ nesting level.
@ @<Types...@>=
@!pdf_link_stack_record = record
- nesting_level: small_number;
+ nesting_level: integer;
link_node: pointer; {holds a copy of the corresponding |pdf_start_link_node|}
ref_link_node: pointer; {points to original |pdf_start_link_node|, or a
copy of |link_node| created by |append_link| in
@@ -32711,6 +28589,8 @@ begin
if not is_shipping_page then
pdf_error("ext4", "link annotations cannot be inside an XForm");
pdfassert(type(parent_box) = hlist_node);
+ if is_obj_scheduled(pdf_link_objnum(p)) then
+ pdf_link_objnum(p) := pdf_new_objnum;
push_link_level(p);
set_rect_dimens(p, parent_box, x, y,
pdf_width(p), pdf_height(p), pdf_depth(p),
@@ -32718,10 +28598,12 @@ begin
obj_annot_ptr(pdf_link_objnum(p)) := p; {the reference for the pdf annot object
must be set here}
pdf_append_list(pdf_link_objnum(p))(pdf_link_list);
+ set_obj_scheduled(pdf_link_objnum(p));
end;
procedure end_link;
var p: pointer;
+tmp1, tmp2: scaledpos;
begin
if pdf_link_stack_ptr < 1 then
pdf_error("ext4", "pdf_link_stack empty, \pdfendlink used without \pdfstartlink?");
@@ -32734,14 +28616,22 @@ begin
if is_running(pdf_width(pdf_link_stack_top.link_node)) then begin
p := pdf_link_stack_top.ref_link_node;
if is_shipping_page and matrixused then begin
- matrixrecalculate(cur_h + pdf_link_margin);
- pdf_left(p) := getllx - pdf_link_margin;
- pdf_top(p) := cur_page_height - getury - pdf_link_margin;
- pdf_right(p) := geturx + pdf_link_margin;
- pdf_bottom(p) := cur_page_height - getlly + pdf_link_margin;
- end
- else
- pdf_right(p) := cur_h + pdf_link_margin;
+ matrixrecalculate(cur.h + pdf_link_margin);
+ pdf_ann_left(p) := getllx - pdf_link_margin;
+ pdf_ann_top(p) := cur_page_size.v - getury - pdf_link_margin;
+ pdf_ann_right(p) := geturx + pdf_link_margin;
+ pdf_ann_bottom(p) := cur_page_size.v - getlly + pdf_link_margin;
+ end
+ else begin
+ tmp1.h := cur.h; tmp1.v := cur.v;
+ tmp2 := synch_p_with_c(tmp1);
+ case box_direction(dvi_direction) of
+ dir_TL_, dir_BL_: pdf_ann_right(p) := tmp2.h + pdf_link_margin;
+ dir_TR_, dir_BR_: pdf_ann_left(p) := tmp2.h - pdf_link_margin;
+ dir_LT_, dir_RT_: pdf_ann_bottom(p) := tmp2.v - pdf_link_margin;
+ dir_LB_, dir_RB_: pdf_ann_top(p) := tmp2.v + pdf_link_margin;
+ endcases;
+ end;
end;
pop_link_level;
end;
@@ -32846,11 +28736,20 @@ begin
end;
procedure end_thread;
+var tmp1, tmp2: scaledpos;
begin
if pdf_thread_level <> cur_s then
pdf_error("ext4", "\pdfendthread ended up in different nesting level than \pdfstartthread");
- if is_running(pdf_thread_dp) and (last_thread <> null) then
- pdf_bottom(last_thread) := cur_v + pdf_thread_margin;
+ if is_running(pdf_thread_dp) and (last_thread <> null) then begin
+ tmp1.h := cur.h; tmp1.v := cur.v;
+ tmp2 := synch_p_with_c(tmp1);
+ case box_direction(dvi_direction) of
+ dir_TL_, dir_TR_: pdf_ann_bottom(last_thread) := tmp2.v - pdf_thread_margin;
+ dir_BL_, dir_BR_: pdf_ann_top(last_thread) := tmp2.v + pdf_thread_margin;
+ dir_LT_, dir_LB_: pdf_ann_right(last_thread) := tmp2.h + pdf_thread_margin;
+ dir_RT_, dir_RB_: pdf_ann_left(last_thread) := tmp2.h - pdf_thread_margin;
+ endcases;
+ end;
if pdf_last_thread_named_id then
delete_token_ref(pdf_last_thread_id);
last_thread := null;
@@ -32884,6 +28783,7 @@ end;
procedure do_dest(p, parent_box: pointer; x, y: scaled);
var k: integer;
+tmp1, tmp2: scaledpos;
begin
if not is_shipping_page then
pdf_error("ext4", "destinations cannot be inside an XForm");
@@ -32904,8 +28804,10 @@ begin
pdf_width(p), pdf_height(p), pdf_depth(p),
pdf_dest_margin)
else begin
- pdf_left(p) := cur_h;
- pdf_top(p) := cur_v;
+ tmp1.h := cur.h; tmp1.v := cur.v;
+ tmp2 := synch_p_with_c(tmp1);
+ pdf_ann_left(p) := tmp2.h;
+ pdf_ann_top(p) := tmp2.v;
end;
pdf_dest_fith,
pdf_dest_fitbh:
@@ -32913,16 +28815,22 @@ begin
set_rect_dimens(p, parent_box, x, y,
pdf_width(p), pdf_height(p), pdf_depth(p),
pdf_dest_margin)
- else
- pdf_top(p) := cur_v;
+ else begin
+ tmp1.h := cur.h; tmp1.v := cur.v;
+ tmp2 := synch_p_with_c(tmp1);
+ pdf_ann_top(p) := tmp2.v;
+ end;
pdf_dest_fitv,
pdf_dest_fitbv:
- if matrixused then
+ if matrixused then
set_rect_dimens(p, parent_box, x, y,
pdf_width(p), pdf_height(p), pdf_depth(p),
pdf_dest_margin)
- else
- pdf_left(p) := cur_h;
+ else begin
+ tmp1.h := cur.h; tmp1.v := cur.v;
+ tmp2 := synch_p_with_c(tmp1);
+ pdf_ann_left(p) := tmp2.h;
+ end;
pdf_dest_fit,
pdf_dest_fitb:
do_nothing;
@@ -32933,20 +28841,20 @@ begin
endcases;
end;
-procedure out_form(p: pointer);
-var v: scaled;
+procedure output_form(p: pointer);
begin
- pdf_end_text;
- pdf_print_ln("q");
+ pdf_goto_pagemode;
+ pdf_place_form(pos.h, pos.v, obj_info(pdf_xform_objnum(p)));
if pdf_lookup_list(pdf_xform_list, pdf_xform_objnum(p)) = null then
pdf_append_list(pdf_xform_objnum(p))(pdf_xform_list);
- v := cur_v + obj_xform_depth(pdf_xform_objnum(p));
- pdf_set_origin_temp(cur_h, v);
- pdf_print("/Fm");
- pdf_print_int(obj_info(pdf_xform_objnum(p)));
- pdf_print_resname_prefix;
- pdf_print_ln(" Do");
- pdf_print_ln("Q");
+end;
+
+procedure output_image(idx: integer);
+begin
+ pdf_goto_pagemode;
+ out_image(idx, pos.h, pos.v);
+ if pdf_lookup_list(pdf_ximage_list, image_objnum(idx)) = null then
+ pdf_append_list(image_objnum(idx))(pdf_ximage_list);
end;
@ @<Output the whatsit node |p| in |pdf_vlist_out|@>=
@@ -32963,14 +28871,15 @@ pdf_restore_node:
pdf_out_restore;
late_lua_node:
do_late_lua(p);
-close_lua_node:
- closelua(late_lua_reg(p));
pdf_refobj_node:
- pdf_append_list(pdf_obj_objnum(p))(pdf_obj_list);
+ if not is_obj_scheduled(pdf_obj_objnum(p)) then begin
+ pdf_append_list(pdf_obj_objnum(p))(pdf_obj_list);
+ set_obj_scheduled(pdf_obj_objnum(p));
+ end;
pdf_refxform_node:
@<Output a Form node in a vlist@>;
pdf_refximage_node:
- @<Output a Image node in a vlist@>;
+ @<Output an Image node in a vlist@>;
pdf_annot_node:
do_annot(p, this_box, left_edge, top_edge + height(this_box));
pdf_start_link_node:
@@ -32985,7 +28894,7 @@ pdf_start_thread_node:
pdf_end_thread_node:
end_thread;
pdf_save_pos_node:
- @<Save current position to |pdf_last_x_pos|, |pdf_last_y_pos|@>;
+ @<Save current position@>;
special_node:
pdf_special(p);
othercases out_what(p);
@@ -32994,25 +28903,56 @@ endcases
@ @<Glob...@>=
@!is_shipping_page: boolean; {set to |shipping_page| when |pdf_ship_out| starts}
-@ @<Save current position to |pdf_last_x_pos|, |pdf_last_y_pos|@>=
-begin
- pdf_last_x_pos := cur_h;
- pdf_last_y_pos := cur_page_height - cur_v
-end
-
-@ @<Output a Image node in a vlist@>=
-begin cur_v:=cur_v+pdf_height(p)+pdf_depth(p);
- cur_h:=left_edge;
- out_image(pdf_ximage_ref(p), cur_h-pdf_origin_h, pdf_origin_v-cur_v);
- if pdf_lookup_list(pdf_ximage_list, image_objnum(pdf_ximage_ref(p))) = null then
- pdf_append_list(image_objnum(pdf_ximage_ref(p)))(pdf_ximage_list);
+@ @<Output an Image node in a vlist@>=
+begin cur.h:=left_edge;
+ synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
+ pos_down(pdf_height(p)+pdf_depth(p));
+ end;
+ dir_TR_: begin
+ pos_left(pdf_width(p));
+ pos_down(pdf_height(p)+pdf_depth(p));
+ end;
+ dir_BL_: begin
+ end;
+ dir_BR_: begin
+ pos_left(pdf_width(p));
+ end;
+ dir_LT_: begin
+ pos_down(pdf_width(p));
+ end;
+ dir_RT_: begin
+ pos_left(pdf_height(p)+pdf_depth(p));
+ pos_down(pdf_width(p));
+ end;
+ dir_LB_: begin
+ end;
+ dir_RB_: begin
+ pos_left(pdf_height(p)+pdf_depth(p));
+ end;
+ othercases
+ endcases;
+ output_image(pdf_ximage_idx(p));
+ cur.v:=cur.v+pdf_height(p)+pdf_depth(p);
end
@ @<Output a Form node in a vlist@>=
-begin cur_v:=cur_v+pdf_height(p);
- cur_h:=left_edge;
- out_form(p);
- cur_v:=cur_v+pdf_depth(p);
+begin
+ cur.h:=left_edge;
+ synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
+ pos_down(pdf_height(p)+pdf_depth(p));
+ end;
+ dir_TR_: begin
+ pos_left(pdf_width(p));
+ pos_down(pdf_height(p)+pdf_depth(p));
+ end;
+ othercases
+ endcases;
+ output_form(p);
+ cur.v:=cur.v+pdf_height(p)+pdf_depth(p);
end
@ @<Output the whatsit node |p| in |pdf_hlist_out|@>=
@@ -33029,14 +28969,15 @@ pdf_restore_node:
pdf_out_restore;
late_lua_node:
do_late_lua(p);
-close_lua_node:
- closelua(late_lua_reg(p));
pdf_refobj_node:
- pdf_append_list(pdf_obj_objnum(p))(pdf_obj_list);
+ if not is_obj_scheduled(pdf_obj_objnum(p)) then begin
+ pdf_append_list(pdf_obj_objnum(p))(pdf_obj_list);
+ set_obj_scheduled(pdf_obj_objnum(p));
+ end;
pdf_refxform_node:
@<Output a Form node in a hlist@>;
pdf_refximage_node:
- @<Output a Image node in a hlist@>;
+ @<Output an Image node in a hlist@>;
pdf_annot_node:
do_annot(p, this_box, left_edge, base_line);
pdf_start_link_node:
@@ -33052,27 +28993,68 @@ pdf_start_thread_node:
pdf_end_thread_node:
pdf_error("ext4", "\pdfendthread ended up in hlist");
pdf_save_pos_node:
- @<Save current position to |pdf_last_x_pos|, |pdf_last_y_pos|@>;
+ @<Save current position@>;
special_node:
pdf_special(p);
othercases if subtype(p)<>dir_node then out_what(p)
-else @<(PDF) Output a reflection instruction if the direction has changed@>;
+else @<Output a reflection instruction if the direction has changed@>;
endcases
-@ @<Output a Image node in a hlist@>=
+@ @<Output an Image node in a hlist@>=
begin
- cur_v:=base_line+pdf_depth(p);
- out_image(pdf_ximage_ref(p), cur_h-pdf_origin_h, pdf_origin_v-cur_v);
- if pdf_lookup_list(pdf_ximage_list, image_objnum(pdf_ximage_ref(p))) = null then
- pdf_append_list(image_objnum(pdf_ximage_ref(p)))(pdf_ximage_list);
- edge:=cur_h+pdf_width(p); cur_h:=edge; cur_v:=base_line;
+ cur.v:=base_line;
+ synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
+ pos_down(pdf_depth(p));
+ end;
+ dir_TR_: begin
+ pos_left(pdf_width(p));
+ pos_down(pdf_depth(p));
+ end;
+ dir_BL_: begin
+ pos_down(pdf_height(p));
+ end;
+ dir_BR_: begin
+ pos_left(pdf_width(p));
+ pos_down(pdf_height(p));
+ end;
+ dir_LT_: begin
+ pos_left(pdf_height(p));
+ pos_down(pdf_width(p));
+ end;
+ dir_RT_: begin
+ pos_left(pdf_depth(p));
+ pos_down(pdf_width(p));
+ end;
+ dir_LB_: begin
+ pos_left(pdf_height(p));
+ end;
+ dir_RB_: begin
+ pos_left(pdf_depth(p));
+ end;
+ othercases
+ endcases;
+ output_image(pdf_ximage_idx(p));
+ edge:=cur.h+pdf_width(p); cur.h:=edge;
end
@ @<Output a Form node in a hlist@>=
begin
- cur_v:=base_line;
- out_form(p);
- edge:=cur_h+pdf_width(p); cur_h:=edge;
+ cur.v:=base_line;
+ synch_pos_with_cur;
+ case box_direction(dvi_direction) of
+ dir_TL_: begin
+ pos_down(pdf_depth(p));
+ end;
+ dir_TR_: begin
+ pos_down(pdf_depth(p));
+ pos_left(pdf_width(p));
+ end;
+ othercases
+ endcases;
+ output_form(p);
+ edge:=cur.h+pdf_width(p); cur.h:=edge;
end
@* \[53a] The extended features of \eTeX.
@@ -33122,39 +29104,30 @@ that integer.
@d Aleph_revision_code=job_name_code+1 {command code for \.{\\Alephrevision}}
@d Omega_revision_code=job_name_code+2 {command code for \.{\\Omegarevision}}
@d eTeX_revision_code=job_name_code+3 {command code for \.{\\eTeXrevision}}
+@d font_identifier_code==job_name_code+4 {command code for \.{tex.fontidentifer} (lua)}
@<Generate all \eTeX...@>=
-primitive("lastnodetype",last_item,last_node_type_code);
+primitive_etex("lastnodetype",last_item,last_node_type_code,0);
@!@:last_node_type_}{\.{\\lastnodetype} primitive@>
-primitive("Alephversion",last_item,Aleph_version_code);
+primitive_aleph("Alephversion",last_item,Aleph_version_code,0);
@!@:eTeX_version_}{\.{\\Alephversion} primitive@>
-primitive("Omegaversion",last_item,Omega_version_code);
+primitive_aleph("Omegaversion",last_item,Omega_version_code,0);
@!@:eTeX_version_}{\.{\\Omegaversion} primitive@>
-primitive("eTeXversion",last_item,eTeX_version_code);
+primitive_etex("eTeXversion",last_item,eTeX_version_code,0);
@!@:eTeX_version_}{\.{\\eTeXversion} primitive@>
-primitive("Alephminorversion",last_item,Aleph_minor_version_code);
+primitive_aleph("Alephminorversion",last_item,Aleph_minor_version_code,0);
@!@:eTeX_minor_version_}{\.{\\Alephminorversion} primitive@>
-primitive("Omegaminorversion",last_item,Omega_minor_version_code);
+primitive_aleph("Omegaminorversion",last_item,Omega_minor_version_code,0);
@!@:eTeX_minor_version_}{\.{\\Omegaminorversion} primitive@>
-primitive("eTeXminorversion",last_item,eTeX_minor_version_code);
+primitive_etex("eTeXminorversion",last_item,eTeX_minor_version_code,0);
@!@:eTeX_minor_version_}{\.{\\eTeXminorversion} primitive@>
-primitive("Alephrevision",convert,Aleph_revision_code);@/
+primitive_aleph("Alephrevision",convert,Aleph_revision_code,0);@/
@!@:eTeX_revision_}{\.{\\Alephrevision} primitive@>
-primitive("Omegarevision",convert,Omega_revision_code);@/
+primitive_aleph("Omegarevision",convert,Omega_revision_code,0);@/
@!@:eTeX_revision_}{\.{\\Omegarevision} primitive@>
-primitive("eTeXrevision",convert,eTeX_revision_code);@/
+primitive_etex("eTeXrevision",convert,eTeX_revision_code,0);@/
@!@:eTeX_revision_}{\.{\\eTeXrevision} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-last_node_type_code: print_esc("lastnodetype");
-Aleph_version_code: print_esc("Alephversion");
-Omega_version_code: print_esc("Omegaversion");
-eTeX_version_code: print_esc("eTeXversion");
-Aleph_minor_version_code: print_esc("Alephminorversion");
-Omega_minor_version_code: print_esc("Omegaminorversion");
-eTeX_minor_version_code: print_esc("eTeXminorversion");
-
-
@ @<Cases for fetching an integer value@>=
Aleph_version_code: cur_val:=Aleph_version;
Omega_version_code: cur_val:=Omega_version;
@@ -33163,11 +29136,6 @@ Aleph_minor_version_code: cur_val:=Aleph_minor_version;
Omega_minor_version_code: cur_val:=Omega_minor_version;
eTeX_minor_version_code: cur_val:=eTeX_minor_version;
-@ @<Cases of |convert| for |print_cmd_chr|@>=
-Aleph_revision_code: print_esc("Alephrevision");
-Omega_revision_code: print_esc("Omegarevision");
-eTeX_revision_code: print_esc("eTeXrevision");
-
@ @<Cases of `Scan the argument for command |c|'@>=
Aleph_revision_code: do_nothing;
Omega_revision_code: do_nothing;
@@ -33182,35 +29150,39 @@ eTeX_revision_code: print(eTeX_revision);
equivalents.
@<Generate all \eTeX...@>=
-primitive("everyeof",assign_toks,every_eof_loc);
+primitive_etex("everyeof",assign_toks,every_eof_loc,local_base);
@!@:every_eof_}{\.{\\everyeof} primitive@>
-primitive("tracingassigns",assign_int,int_base+tracing_assigns_code);@/
+primitive_etex("tracingassigns",assign_int,int_base+tracing_assigns_code,int_base);@/
@!@:tracing_assigns_}{\.{\\tracingassigns} primitive@>
-primitive("tracinggroups",assign_int,int_base+tracing_groups_code);@/
+primitive_etex("tracinggroups",assign_int,int_base+tracing_groups_code,int_base);@/
@!@:tracing_groups_}{\.{\\tracinggroups} primitive@>
-primitive("tracingifs",assign_int,int_base+tracing_ifs_code);@/
+primitive_etex("tracingifs",assign_int,int_base+tracing_ifs_code,int_base);@/
@!@:tracing_ifs_}{\.{\\tracingifs} primitive@>
-primitive("tracingscantokens",assign_int,int_base+tracing_scan_tokens_code);@/
+primitive_etex("tracingscantokens",assign_int,int_base+tracing_scan_tokens_code,int_base);@/
@!@:tracing_scan_tokens_}{\.{\\tracingscantokens} primitive@>
-primitive("tracingnesting",assign_int,int_base+tracing_nesting_code);@/
+primitive_etex("tracingnesting",assign_int,int_base+tracing_nesting_code,int_base);@/
@!@:tracing_nesting_}{\.{\\tracingnesting} primitive@>
-primitive("predisplaydirection",
- assign_int,int_base+pre_display_direction_code);@/
+primitive_etex("predisplaydirection", assign_int,int_base+pre_display_direction_code,int_base);@/
@!@:pre_display_direction_}{\.{\\predisplaydirection} primitive@>
-primitive("lastlinefit",assign_int,int_base+last_line_fit_code);@/
+primitive_etex("lastlinefit",assign_int,int_base+last_line_fit_code,int_base);@/
@!@:last_line_fit_}{\.{\\lastlinefit} primitive@>
-primitive("savingvdiscards",assign_int,int_base+saving_vdiscards_code);@/
+primitive_etex("savingvdiscards",assign_int,int_base+saving_vdiscards_code,int_base);@/
@!@:saving_vdiscards_}{\.{\\savingvdiscards} primitive@>
-primitive("savinghyphcodes",assign_int,int_base+saving_hyph_codes_code);@/
+primitive_etex("savinghyphcodes",assign_int,int_base+saving_hyph_codes_code,int_base);@/
@!@:saving_hyph_codes_}{\.{\\savinghyphcodes} primitive@>
-primitive("suppressfontnotfounderror",assign_int,int_base+suppress_fontnotfound_error_code);@/
-@!@:suppress_fontnotfound_error_codes_}{\.{\\suppressfontnotfounderror} primitive@>
+primitive_luatex("suppressfontnotfounderror",assign_int,int_base+suppress_fontnotfound_error_code,int_base);@/
+@!@:suppress_fontnotfound_error_code_}{\.{\\suppressfontnotfounderror} primitive@>
+primitive_luatex("suppresslongerror",assign_int,int_base+suppress_long_error_code,int_base);@/
+@!@:suppress_long_error_code_}{\.{\\suppresslongerror} primitive@>
+primitive_luatex("suppressifcsnameerror",assign_int,int_base+suppress_ifcsname_error_code,int_base);@/
+@!@:suppress_ifcsname_error_code_}{\.{\\suppressifcsnameerror} primitive@>
+primitive_luatex("suppressoutererror",assign_int,int_base+suppress_outer_error_code,int_base);@/
+@!@:suppress_outer_error_code_}{\.{\\suppressoutererror} primitive@>
+primitive_luatex("synctex",assign_int,int_base+synctex_code,int_base);@/
+@!@:synctex_}{\.{\\synctex} primitive@>
@ @d every_eof==equiv(every_eof_loc)
-@<Cases of |assign_toks| for |print_cmd_chr|@>=
-every_eof_loc: print_esc("everyeof");
-
@ @<Cases for |print_param|@>=
tracing_assigns_code:print_esc("tracingassigns");
tracing_groups_code:print_esc("tracinggroups");
@@ -33222,6 +29194,9 @@ last_line_fit_code:print_esc("lastlinefit");
saving_vdiscards_code:print_esc("savingvdiscards");
saving_hyph_codes_code:print_esc("savinghyphcodes");
suppress_fontnotfound_error_code:print_esc("suppressfontnotfounderror");
+suppress_long_error_code:print_esc("suppresslongerror");
+suppress_outer_error_code:print_esc("suppressoutererror");
+synctex_code:print_esc("synctex");
@ In order to handle \.{\\everyeof} we need an array |eof_seen| of
boolean variables.
@@ -33290,15 +29265,11 @@ respectively.
@d current_group_type_code=eTeX_int+2 {code for \.{\\currentgrouptype}}
@<Generate all \eTeX...@>=
-primitive("currentgrouplevel",last_item,current_group_level_code);
+primitive_etex("currentgrouplevel",last_item,current_group_level_code,0);
@!@:current_group_level_}{\.{\\currentgrouplevel} primitive@>
-primitive("currentgrouptype",last_item,current_group_type_code);
+primitive_etex("currentgrouptype",last_item,current_group_type_code,0);
@!@:current_group_type_}{\.{\\currentgrouptype} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-current_group_level_code: print_esc("currentgrouplevel");
-current_group_type_code: print_esc("currentgrouptype");
-
@ @<Cases for fetching an integer value@>=
current_group_level_code: cur_val:=cur_level-level_one;
current_group_type_code: cur_val:=cur_group;
@@ -33312,18 +29283,13 @@ and the type and branch of the current conditional.
@d current_if_branch_code=eTeX_int+5 {code for \.{\\currentifbranch}}
@<Generate all \eTeX...@>=
-primitive("currentiflevel",last_item,current_if_level_code);
+primitive_etex("currentiflevel",last_item,current_if_level_code,0);
@!@:current_if_level_}{\.{\\currentiflevel} primitive@>
-primitive("currentiftype",last_item,current_if_type_code);
+primitive_etex("currentiftype",last_item,current_if_type_code,0);
@!@:current_if_type_}{\.{\\currentiftype} primitive@>
-primitive("currentifbranch",last_item,current_if_branch_code);
+primitive_etex("currentifbranch",last_item,current_if_branch_code,0);
@!@:current_if_branch_}{\.{\\currentifbranch} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-current_if_level_code: print_esc("currentiflevel");
-current_if_type_code: print_esc("currentiftype");
-current_if_branch_code: print_esc("currentifbranch");
-
@ @<Cases for fetching an integer value@>=
current_if_level_code: begin q:=cond_ptr; cur_val:=0;
while q<>null do
@@ -33348,25 +29314,19 @@ font.
@d font_char_ic_code=eTeX_dim+3 {code for \.{\\fontcharic}}
@<Generate all \eTeX...@>=
-primitive("charwd",last_item,font_char_wd_code);
-primitive("fontcharwd",last_item,font_char_wd_code);
+primitive_omega("charwd",last_item,font_char_wd_code,0);
+primitive_etex("fontcharwd",last_item,font_char_wd_code,0);
@!@:font_char_wd_}{\.{\\fontcharwd} primitive@>
-primitive("charht",last_item,font_char_ht_code);
-primitive("fontcharht",last_item,font_char_ht_code);
+primitive_omega("charht",last_item,font_char_ht_code,0);
+primitive_etex("fontcharht",last_item,font_char_ht_code,0);
@!@:font_char_ht_}{\.{\\fontcharht} primitive@>
-primitive("chardp",last_item,font_char_dp_code);
-primitive("fontchardp",last_item,font_char_dp_code);
+primitive_omega("chardp",last_item,font_char_dp_code,0);
+primitive_etex("fontchardp",last_item,font_char_dp_code,0);
@!@:font_char_dp_}{\.{\\fontchardp} primitive@>
-primitive("charic",last_item,font_char_ic_code);
-primitive("fontcharic",last_item,font_char_ic_code);
+primitive_omega("charit",last_item,font_char_ic_code,0);
+primitive_etex("fontcharic",last_item,font_char_ic_code,0);
@!@:font_char_ic_}{\.{\\fontcharic} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-font_char_wd_code: print_esc("fontcharwd");
-font_char_ht_code: print_esc("fontcharht");
-font_char_dp_code: print_esc("fontchardp");
-font_char_ic_code: print_esc("fontcharic");
-
@ @<Cases for fetching a dimension value@>=
font_char_wd_code,
font_char_ht_code,
@@ -33393,18 +29353,13 @@ commands return the indent and length parameters of the current
@d par_shape_dimen_code=eTeX_dim+6 {code for \.{\\parshapedimen}}
@<Generate all \eTeX...@>=
-primitive("parshapelength",last_item,par_shape_length_code);
+primitive_etex("parshapelength",last_item,par_shape_length_code,0);
@!@:par_shape_length_}{\.{\\parshapelength} primitive@>
-primitive("parshapeindent",last_item,par_shape_indent_code);
+primitive_etex("parshapeindent",last_item,par_shape_indent_code,0);
@!@:par_shape_indent_}{\.{\\parshapeindent} primitive@>
-primitive("parshapedimen",last_item,par_shape_dimen_code);
+primitive_etex("parshapedimen",last_item,par_shape_dimen_code,0);
@!@:par_shape_dimen_}{\.{\\parshapedimen} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-par_shape_length_code: print_esc("parshapelength");
-par_shape_indent_code: print_esc("parshapeindent");
-par_shape_dimen_code: print_esc("parshapedimen");
-
@ @<Cases for fetching a dimension value@>=
par_shape_length_code,
par_shape_indent_code,
@@ -33413,8 +29368,8 @@ par_shape_dimen_code: begin q:=cur_chr-par_shape_length_code; scan_int;
else begin if q=2 then
begin q:=cur_val mod 2; cur_val:=(cur_val+q)div 2;
end;
- if cur_val>vinfo(par_shape_ptr) then cur_val:=vinfo(par_shape_ptr);
- cur_val:=vmem(par_shape_ptr+2*cur_val-q).sc;
+ if cur_val>vinfo(par_shape_ptr+1) then cur_val:=vinfo(par_shape_ptr+1);
+ cur_val:=vmem(par_shape_ptr+2*cur_val-q+1).sc;
end;
cur_val_level:=dimen_val;
end;
@@ -33425,12 +29380,9 @@ levels.
@d show_groups=4 { \.{\\showgroups} }
@<Generate all \eTeX...@>=
-primitive("showgroups",xray,show_groups);
+primitive_etex("showgroups",xray,show_groups,0);
@!@:show_groups_}{\.{\\showgroups} primitive@>
-@ @<Cases of |xray| for |print_cmd_chr|@>=
-show_groups:print_esc("showgroups");
-
@ @<Cases for |show_whatever|@>=
show_groups: begin begin_diagnostic; show_save_groups;
end;
@@ -33498,7 +29450,7 @@ loop@+begin print_nl("### "); print_group(true);
goto found2;
end;
insert_group:
- begin if saved(-2)=255 then print_esc("vadjust")
+ begin if saved(-2)=output_box then print_esc("vadjust")
else begin print_esc("insert"); print_int(saved(-2));
end;
goto found2;
@@ -33515,7 +29467,7 @@ loop@+begin print_nl("### "); print_group(true);
print_char("$"); goto found;
end;
math_left_group:
- begin if type(nest[p+1].eTeX_aux_field)=left_noad then print_esc("left")
+ begin if subtype(nest[p+1].eTeX_aux_field)=left_noad_side then print_esc("left")
else print_esc("middle");
goto found;
end;
@@ -33596,12 +29548,9 @@ end;
@d show_tokens=5 { \.{\\showtokens} , must be odd! }
@<Generate all \eTeX...@>=
-primitive("showtokens",xray,show_tokens);
+primitive_etex("showtokens",xray,show_tokens,0);
@!@:show_tokens_}{\.{\\showtokens} primitive@>
-@ @<Cases of |xray| for |print_cmd_chr|@>=
-show_tokens:print_esc("showtokens");
-
@ The \.{\\unexpanded} primitive prevents expansion of tokens much as
the result from \.{\\the} applied to a token variable. The
\.{\\detokenize} primitive converts a token list into a list of
@@ -33611,15 +29560,11 @@ use the fact that the command modifiers for \.{\\unexpanded} and
are even.
@<Generate all \eTeX...@>=
-primitive("unexpanded",the,1);@/
+primitive_etex("unexpanded",the,1,0);@/
@!@:unexpanded_}{\.{\\unexpanded} primitive@>
-primitive("detokenize",the,show_tokens);@/
+primitive_etex("detokenize",the,show_tokens,0);@/
@!@:detokenize_}{\.{\\detokenize} primitive@>
-@ @<Cases of |the| for |print_cmd_chr|@>=
-else if chr_code=1 then print_esc("unexpanded")
-else print_esc("detokenize")
-
@ @<Handle \.{\\unexpanded} or \.{\\detokenize} and |return|@>=
if odd(cur_chr) then
begin c:=cur_chr; scan_general_text;
@@ -33637,12 +29582,9 @@ if odd(cur_chr) then
@d show_ifs=6 { \.{\\showifs} }
@<Generate all \eTeX...@>=
-primitive("showifs",xray,show_ifs);
+primitive_etex("showifs",xray,show_ifs,0);
@!@:show_ifs_}{\.{\\showifs} primitive@>
-@ @<Cases of |xray| for |print_cmd_chr|@>=
-show_ifs:print_esc("showifs");
-
@
@d print_if_line(#)==if #<>0 then
begin print(" entered on line "); print_int(#);
@@ -33669,12 +29611,9 @@ show_ifs: begin begin_diagnostic; print_nl(""); print_ln;
interaction mode.
@<Generate all \eTeX...@>=
-primitive("interactionmode",set_page_int,2);
+primitive_etex("interactionmode",set_page_int,2,0);
@!@:interaction_mode_}{\.{\\interactionmode} primitive@>
-@ @<Cases of |set_page_int| for |print_cmd_chr|@>=
-else if chr_code=2 then print_esc("interactionmode")
-
@ @<Cases for `Fetch the |dead_cycles| or the |insert_penalties|'@>=
else if m=2 then cur_val:=interaction
@@ -33694,29 +29633,15 @@ else if c=2 then
end;
end
-@ The |middle| feature of \eTeX\ allows one ore several \.{\\middle}
-delimiters to appear between \.{\\left} and \.{\\right}.
-
-@<Generate all \eTeX...@>=
-primitive("middle",left_right,middle_noad);
-@!@:middle_}{\.{\\middle} primitive@>
-
-@ @<Cases of |left_right| for |print_cmd_chr|@>=
-else if chr_code=middle_noad then print_esc("middle")
-
@ The |scan_tokens| feature of \eTeX\ defines the \.{\\scantokens}
primitive.
@<Generate all \eTeX...@>=
-primitive("scantokens",input,2);
+primitive_etex("scantokens",input,2,0);
@!@:scan_tokens_}{\.{\\scantokens} primitive@>
-primitive("scantextokens",input,3);
+primitive_luatex("scantextokens",input,3,0);
@!@:scan_tex_tokens_}{\.{\\scantextokens} primitive@>
-@ @<Cases of |input| for |print_cmd_chr|@>=
-else if chr_code=2 then print_esc("scantokens")
-else if chr_code=3 then print_esc("scantextokens")
-
@ @<Cases for |input|@>=
else if cur_chr=2 then pseudo_start
else if cur_chr=3 then begin pseudo_start; name := 19; end
@@ -33783,7 +29708,10 @@ if tracing_scan_tokens>0 then
else if (term_offset>0)or(file_offset>0) then print_char(" ");
name:=20; print("( "); incr(open_parens); update_terminal;
end
-else name:=18
+else begin
+ name:=18;
+ @<Prepare pseudo file {\sl Sync\TeX} information@>;
+end
@ Here we read a line from the current pseudo file into |buffer|.
@@ -33819,7 +29747,7 @@ end;
@<Declare \eTeX\ procedures for tr...@>=
procedure pseudo_close; {close the top level pseudo file}
-var p,@!q: pointer;
+var p: pointer;
begin p:=vlink(pseudo_files);
flush_node(pseudo_files);
pseudo_files:=p;
@@ -33829,12 +29757,9 @@ end;
while pseudo_files<>null do pseudo_close; {flush pseudo files}
@ @<Generate all \eTeX...@>=
-primitive("readline",read_to_cs,1);@/
+primitive_etex("readline",read_to_cs,1,0);@/
@!@:read_line_}{\.{\\readline} primitive@>
-@ @<Cases of |read| for |print_cmd_chr|@>=
-else print_esc("readline")
-
@ @<Handle \.{\\readline} and |goto done|@>=
if j=1 then
begin while loc<=limit do {current line not yet finished}
@@ -33857,36 +29782,25 @@ if j=1 then
@d if_abs_dim_code=23 { `\.{\\ifabsdim}' }
@<Generate all \eTeX...@>=
-primitive("unless",expand_after,1);@/
+primitive_etex("unless",expand_after,1,0);@/
@!@:unless_}{\.{\\unless} primitive@>
-primitive("ifdefined",if_test,if_def_code);
+primitive_etex("ifdefined",if_test,if_def_code,0);
@!@:if_defined_}{\.{\\ifdefined} primitive@>
-primitive("ifcsname",if_test,if_cs_code);
+primitive_etex("ifcsname",if_test,if_cs_code,0);
@!@:if_cs_name_}{\.{\\ifcsname} primitive@>
-primitive("iffontchar",if_test,if_font_char_code);
+primitive_etex("iffontchar",if_test,if_font_char_code,0);
@!@:if_font_char_}{\.{\\iffontchar} primitive@>
-primitive("ifincsname",if_test,if_in_csname_code);
+primitive_pdftex("ifincsname",if_test,if_in_csname_code,0);
@!@:if_in_csname_}{\.{\\ifincsname} primitive@>
-primitive("ifabsnum",if_test,if_abs_num_code);
+primitive_luatex("ifabsnum",if_test,if_abs_num_code,0);
@!@:if_abs_num_}{\.{\\ifabsnum} primitive@>
-primitive("ifabsdim",if_test,if_abs_dim_code);
+primitive_luatex("ifabsdim",if_test,if_abs_dim_code,0);
@!@:if_abs_dim_}{\.{\\ifabsdim} primitive@>
-primitive("ifpdfabsnum",if_test,if_abs_num_code);
+primitive_pdftex("ifpdfabsnum",if_test,if_abs_num_code,0);
@!@:if_abs_num_}{\.{\\ifpdfabsnum} primitive@>
-primitive("ifpdfabsdim",if_test,if_abs_dim_code);
+primitive_pdftex("ifpdfabsdim",if_test,if_abs_dim_code,0);
@!@:if_abs_dim_}{\.{\\ifpdfabsdim} primitive@>
-@ @<Cases of |expandafter| for |print_cmd_chr|@>=
-else print_esc("unless")
-
-@ @<Cases of |if_test| for |print_cmd_chr|@>=
-if_def_code:print_esc("ifdefined");
-if_cs_code:print_esc("ifcsname");
-if_font_char_code:print_esc("iffontchar");
-if_in_csname_code:print_esc("ifincsname");
-if_abs_num_code:print_esc("ifabsnum");
-if_abs_dim_code:print_esc("ifabsdim");
-
@ The result of a boolean condition is reversed when the conditional is
preceded by \.{\\unless}.
@@ -33926,10 +29840,22 @@ if_cs_code:begin n:=get_avail; p:=n; {head of the list of characters}
repeat get_x_token;
if cur_cs=0 then store_new_token(cur_tok);
until cur_cs<>0;
- if cur_cmd<>end_cs_name then @<Complain about missing \.{\\endcsname}@>;
- @<Look up the characters of list |n| in the hash table, and set |cur_cs|@>;
+ if cur_cmd<>end_cs_name then begin
+ if suppress_ifcsname_error then begin
+ repeat get_x_token;
+ until cur_cmd=end_cs_name;
+ end
+ else begin
+ @<Complain about missing \.{\\endcsname}@>;
+ @<Look up the characters of list |n| in the hash table, and set |cur_cs|@>;
+ b:=(eq_type(cur_cs)<>undefined_cs);
+ end;
+ end
+ else begin
+ @<Look up the characters of list |n| in the hash table, and set |cur_cs|@>;
+ b:=(eq_type(cur_cs)<>undefined_cs);
+ end;
flush_list(n);
- b:=(eq_type(cur_cs)<>undefined_cs);
end;
@ @<Look up the characters of list |n| in the hash table...@>=
@@ -34002,12 +29928,9 @@ expansions when lists of expanded tokens are built, e.g., for \.{\\edef}
or during \.{\\write}.
@<Generate all \eTeX...@>=
-primitive("protected",prefix,8);
+primitive_etex("protected",prefix,8,0);
@!@:protected_}{\.{\\protected} primitive@>
-@ @<Cases of |prefix| for |print_cmd_chr|@>=
-else if chr_code=8 then print_esc("protected")
-
@ The |get_x_or_protected| procedure is like |get_x_token| except that
protected macros are not expanded.
@@ -34138,21 +30061,15 @@ end;
@ Here are the additional \eTeX\ primitives for expressions.
@<Generate all \eTeX...@>=
-primitive("numexpr",last_item,eTeX_expr-int_val+int_val);
+primitive_etex("numexpr",last_item,eTeX_expr-int_val+int_val,0);
@!@:num_expr_}{\.{\\numexpr} primitive@>
-primitive("dimexpr",last_item,eTeX_expr-int_val+dimen_val);
+primitive_etex("dimexpr",last_item,eTeX_expr-int_val+dimen_val,0);
@!@:dim_expr_}{\.{\\dimexpr} primitive@>
-primitive("glueexpr",last_item,eTeX_expr-int_val+glue_val);
+primitive_etex("glueexpr",last_item,eTeX_expr-int_val+glue_val,0);
@!@:glue_expr_}{\.{\\glueexpr} primitive@>
-primitive("muexpr",last_item,eTeX_expr-int_val+mu_val);
+primitive_etex("muexpr",last_item,eTeX_expr-int_val+mu_val,0);
@!@:mu_expr_}{\.{\\muexpr} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-eTeX_expr-int_val+int_val: print_esc("numexpr");
-eTeX_expr-int_val+dimen_val: print_esc("dimexpr");
-eTeX_expr-int_val+glue_val: print_esc("glueexpr");
-eTeX_expr-int_val+mu_val: print_esc("muexpr");
-
@ This code for reducing |cur_val_level| and\slash or negating the
result is similar to the one for all the other cases of
|scan_something_internal|, with the difference that |scan_expr| has
@@ -34305,7 +30222,6 @@ expression so far and |r| is the state of its evaluation; |t| is the
term so far and |s| is the state of its evaluation; finally |n| is the
numerator for a combined multiplication and division, if any.
-@d expr_node=39 { stack entry for subexpressions}
@d expr_type(#)==type(#+1)
@d expr_state(#)==subtype(#+1)
@d expr_e_field(#)==vlink(#+1) {saved expression so far}
@@ -34562,21 +30478,15 @@ and their orders of ``infinity'' of a glue specification.
@d glue_shrink_code=eTeX_dim+8 {code for \.{\\glueshrink}}
@<Generate all \eTeX...@>=
-primitive("gluestretchorder",last_item,glue_stretch_order_code);
+primitive_etex("gluestretchorder",last_item,glue_stretch_order_code,0);
@!@:glue_stretch_order_}{\.{\\gluestretchorder} primitive@>
-primitive("glueshrinkorder",last_item,glue_shrink_order_code);
+primitive_etex("glueshrinkorder",last_item,glue_shrink_order_code,0);
@!@:glue_shrink_order_}{\.{\\glueshrinkorder} primitive@>
-primitive("gluestretch",last_item,glue_stretch_code);
+primitive_etex("gluestretch",last_item,glue_stretch_code,0);
@!@:glue_stretch_}{\.{\\gluestretch} primitive@>
-primitive("glueshrink",last_item,glue_shrink_code);
+primitive_etex("glueshrink",last_item,glue_shrink_code,0);
@!@:glue_shrink_}{\.{\\glueshrink} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-glue_stretch_order_code: print_esc("gluestretchorder");
-glue_shrink_order_code: print_esc("glueshrinkorder");
-glue_stretch_code: print_esc("gluestretch");
-glue_shrink_code: print_esc("glueshrink");
-
@ @<Cases for fetching an integer value@>=
glue_stretch_order_code, glue_shrink_order_code:
begin scan_normal_glue; q:=cur_val;
@@ -34601,15 +30511,11 @@ into normal glue and vice versa; they allow to manipulate math glue with
@d glue_to_mu_code=eTeX_mu {code for \.{\\gluetomu}}
@<Generate all \eTeX...@>=
-primitive("mutoglue",last_item,mu_to_glue_code);
+primitive_etex("mutoglue",last_item,mu_to_glue_code,0);
@!@:mu_to_glue_}{\.{\\mutoglue} primitive@>
-primitive("gluetomu",last_item,glue_to_mu_code);
+primitive_etex("gluetomu",last_item,glue_to_mu_code,0);
@!@:glue_to_mu_}{\.{\\gluetomu} primitive@>
-@ @<Cases of |last_item| for |print_cmd_chr|@>=
-mu_to_glue_code: print_esc("mutoglue");
-glue_to_mu_code: print_esc("gluetomu");
-
@ @<Cases for fetching a glue value@>=
mu_to_glue_code: scan_mu_glue;
@@ -34640,15 +30546,11 @@ distinguished by their |chr_code| values |last_box_code| and
|copy_code|.
@<Generate all \eTeX...@>=
-primitive("pagediscards",un_vbox,last_box_code);@/
+primitive_etex("pagediscards",un_vbox,last_box_code,0);@/
@!@:page_discards_}{\.{\\pagediscards} primitive@>
-primitive("splitdiscards",un_vbox,vsplit_code);@/
+primitive_etex("splitdiscards",un_vbox,vsplit_code,0);@/
@!@:split_discards_}{\.{\\splitdiscards} primitive@>
-@ @<Cases of |un_vbox| for |print_cmd_chr|@>=
-else if chr_code=last_box_code then print_esc("pagediscards")
-else if chr_code=vsplit_code then print_esc("splitdiscards")
-
@ @<Handle saved items and |goto done|@>=
begin vlink(tail):=disc_ptr[cur_chr]; disc_ptr[cur_chr]:=null;
goto done;
@@ -34664,27 +30566,22 @@ penalty values to be used instead of the corresponding single values.
@d display_widow_penalties_ptr==equiv(display_widow_penalties_loc)
@<Generate all \eTeX...@>=
-primitive("interlinepenalties",set_shape,inter_line_penalties_loc);@/
+primitive_etex("interlinepenalties",set_etex_shape,inter_line_penalties_loc,etex_pen_base);@/
@!@:inter_line_penalties_}{\.{\\interlinepenalties} primitive@>
-primitive("clubpenalties",set_shape,club_penalties_loc);@/
+primitive_etex("clubpenalties",set_etex_shape,club_penalties_loc,etex_pen_base);@/
@!@:club_penalties_}{\.{\\clubpenalties} primitive@>
-primitive("widowpenalties",set_shape,widow_penalties_loc);@/
+primitive_etex("widowpenalties",set_etex_shape,widow_penalties_loc,etex_pen_base);@/
@!@:widow_penalties_}{\.{\\widowpenalties} primitive@>
-primitive("displaywidowpenalties",set_shape,display_widow_penalties_loc);@/
+primitive_etex("displaywidowpenalties",set_etex_shape,display_widow_penalties_loc,etex_pen_base);@/
@!@:display_widow_penalties_}{\.{\\displaywidowpenalties} primitive@>
-@ @<Cases of |set_shape| for |print_cmd_chr|@>=
-inter_line_penalties_loc: print_esc("interlinepenalties");
-club_penalties_loc: print_esc("clubpenalties");
-widow_penalties_loc: print_esc("widowpenalties");
-display_widow_penalties_loc: print_esc("displaywidowpenalties");
-
@ @<Fetch a penalties array element@>=
begin scan_int;
if (equiv(m)=null)or(cur_val<0) then cur_val:=0
else begin if cur_val>penalty(equiv(m)) then cur_val:=penalty(equiv(m));
cur_val:=penalty(equiv(m)+cur_val);
end;
+cur_val_level:=int_val;
end
@ This is needed to get the relative order of the marks code correct
@@ -34715,11 +30612,28 @@ end;
function set_tex_dimen_register (j:integer;v:scaled):integer;
var a:small_number;
begin {return non-nil for error}
-a:=0;
+if global_defs>0 then a:=4 else a:=0;
word_define(j+scaled_base,v);
set_tex_dimen_register := 0;
end;
+function get_tex_skip_register (j:integer):halfword;
+begin
+ get_tex_skip_register := skip(j);
+end;
+
+function set_tex_skip_register (j:integer;v:halfword):integer;
+var a:small_number;
+begin {return non-nil for error}
+ if global_defs>0 then a:=4 else a:=0;
+ if type(v) <> glue_spec_node then
+ set_tex_skip_register := 1
+ else begin
+ word_define(j+skip_base,v);
+ set_tex_skip_register := 0;
+ end;
+end;
+
function get_tex_count_register (j:integer):scaled;
begin
get_tex_count_register := count(j);
@@ -34728,9 +30642,9 @@ end;
function set_tex_count_register (j:integer;v:scaled):integer;
var a:small_number;
begin {return non-nil for error}
-a:=0;
-word_define(j+count_base,v);
-set_tex_count_register := 0;
+ if global_defs>0 then a:=4 else a:=0;
+ word_define(j+count_base,v);
+ set_tex_count_register := 0;
end;
function get_tex_attribute_register (j:integer):scaled;
@@ -34741,7 +30655,9 @@ end;
function set_tex_attribute_register (j:integer;v:scaled):integer;
var a:small_number;
begin {return non-nil for error}
-a:=0;
+if global_defs>0 then a:=4 else a:=0;
+if (j)>max_used_attr then max_used_attr:=(j);
+attr_list_cache:=cache_disabled;
word_define(j+attribute_base,v);
set_tex_attribute_register := 0;
end;
@@ -34751,7 +30667,7 @@ var s:str_number;
begin
s:="";
if toks(j) <> min_halfword then begin
- s := tokens_to_string(toks(j));
+ s := tokens_to_string(toks(j));
end;
get_tex_toks_register := s;
end;
@@ -34770,7 +30686,7 @@ begin
pool_ptr := s_pool_ptr;
token_ref_count(ref) := 0;
link(ref) := link(temp_token_head);
- a:=0;
+ if global_defs>0 then a:=4 else a:=0;
define(j+toks_base,call,ref);
flush_str(s);
end;
@@ -34783,8 +30699,8 @@ end;
function set_tex_box_register (j:integer;v:scaled):integer;
var a:small_number;
begin {return non-nil for error}
-a:=0;
-eq_define(j+box_base,box_ref,v);
+if global_defs>0 then a:=4 else a:=0;
+define(j+box_base,box_ref,v);
set_tex_box_register := 0;
end;
@@ -34851,12 +30767,12 @@ end;
function get_cur_v: integer;
begin
- get_cur_v := cur_page_height - cur_v;
+ get_cur_v := cur_page_size.v - cur.v;
end;
function get_cur_h: integer;
begin
- get_cur_h := cur_h;
+ get_cur_h := cur.h;
end;
@* \[54] $\Omega$ changes.
@@ -35067,22 +30983,25 @@ state:=mid_line;
start:=first;
last:=start;
loc:=start;
+line_catcode_table:=DEFAULT_CAT_TABLE; line_partial:=false;
for otp_counter:=1 to otp_output_end do begin
{ convert back to utf-8 }
- t := otp_output_buf[otp_counter];
- if otp_counter < otp_output_end then
- if ((t>=@"D800) and (t<@"DC00)) then
- if (otp_output_buf[otp_counter+1]>=@"DC00)
- and (otp_output_buf[otp_counter+1]<@"E000) then begin
- incr(otp_counter);
- t := (t-@"D800) * @"400 + (otp_output_buf[otp_counter]-@"DC00) + @"10000;
- end
- else if ((t>=@"DC00) and (t<@"E000)) then
- if (otp_output_buf[otp_counter+1]>=@"D800)
- and (otp_output_buf[otp_counter+1]<@"DC00) then begin
- incr(otp_counter);
- t := (otp_output_buf[otp_counter]-@"D800) * @"400 + (t-@"DC00) + @"10000;
- end;
+ t := otp_output_buf[otp_counter];
+ if otp_counter < otp_output_end then begin
+ if ((t>=@"D800) and (t<@"DC00)) then begin
+ if (otp_output_buf[otp_counter+1]>=@"DC00)
+ and (otp_output_buf[otp_counter+1]<@"E000) then begin
+ incr(otp_counter);
+ t := (t-@"D800) * @"400 + (otp_output_buf[otp_counter]-@"DC00) + @"10000;
+ end
+ else if ((t>=@"DC00) and (t<@"E000)) then
+ if (otp_output_buf[otp_counter+1]>=@"D800)
+ and (otp_output_buf[otp_counter+1]<@"DC00) then begin
+ incr(otp_counter);
+ t := (otp_output_buf[otp_counter]-@"D800) * @"400 + (t-@"DC00) + @"10000;
+ end;
+ end;
+ end;
if t <= @"7F then
buffer[last]:= t
else if t<=@"7FF then begin
@@ -35092,7 +31011,7 @@ for otp_counter:=1 to otp_output_end do begin
@<Report overflow of the input buffer, and abort@>;
buffer[last]:=@"80 + t mod @"40;
end
- else if t<=@"FFFF then begin
+ else if t<=@"FFFF then begin
buffer[last]:=@"E0 + t div @"1000;
incr(last);
if last=buf_size-2 then
@@ -35550,38 +31469,19 @@ end
end
@ @<Put each...@>=
-primitive("ocp", def_ocp, 0);
-primitive("externalocp", def_ocp, 1);
-primitive("ocplist", def_ocp_list, 0);
-primitive("pushocplist", push_ocp_list, 0);
-primitive("popocplist", pop_ocp_list, 0);
-primitive("clearocplists", clear_ocp_lists, 0);
-primitive("addbeforeocplist", ocp_list_op, add_before_op);
-primitive("addafterocplist", ocp_list_op, add_after_op);
-primitive("removebeforeocplist", ocp_list_op, remove_before_op);
-primitive("removeafterocplist", ocp_list_op, remove_after_op);
-primitive("ocptracelevel", ocp_trace_level, 0);
+primitive_omega("ocp", def_ocp, 0,0);
+primitive_omega("externalocp", def_ocp, 1,0);
+primitive_omega("ocplist", def_ocp_list, 0,0);
+primitive_omega("pushocplist", push_ocp_list, 0,0);
+primitive_omega("popocplist", pop_ocp_list, 0,0);
+primitive_omega("clearocplists", clear_ocp_lists, 0,0);
+primitive_omega("addbeforeocplist", ocp_list_op, add_before_op,0);
+primitive_omega("addafterocplist", ocp_list_op, add_after_op,0);
+primitive_omega("removebeforeocplist", ocp_list_op, remove_before_op,0);
+primitive_omega("removeafterocplist", ocp_list_op, remove_after_op,0);
+primitive_omega("ocptracelevel", ocp_trace_level, 0,0);
equiv(ocp_trace_level_base):=0;
-@ @<Cases of |print_cmd_chr|...@>=
-set_ocp: begin
- print("select ocp ");
- slow_print(ocp_name(chr_code));
- end;
-def_ocp: if cur_chr=0 then print_esc("ocp")
- else print_esc("externalocp");
-set_ocp_list: print("select ocp list ");
-def_ocp_list: print_esc("ocplist");
-push_ocp_list: print_esc("pushocplist");
-pop_ocp_list: print_esc("popocplist");
-clear_ocp_lists: print_esc("clearocplists");
-ocp_list_op:
- if chr_code=add_before_op then print_esc("addbeforeocplist")
- else if chr_code=add_after_op then print_esc("addafterocplist")
- else if chr_code=remove_before_op then print_esc("removebeforeocplist")
- else {|chr_code|=|remove_after_op|} print_esc("removeafterocplist");
-ocp_trace_level: print_esc("ocptracelevel");
-
@ @<Assignments@>=
set_ocp: begin
print_err("To use ocps, use the "); print_esc("pushocplist");
@@ -35611,7 +31511,6 @@ label common_ending;
var u:pointer; {user's ocp identifier}
@!f:internal_ocp_number; {runs through existing ocps}
@!t:str_number; {name for the frozen ocp identifier}
-@!old_setting:0..max_selector; {holds |selector| setting}
@!flushable_string:str_number; {string not yet referenced}
@!external_ocp:boolean; {external binary file}
begin if job_name=0 then open_log_file;
@@ -35620,13 +31519,7 @@ begin if job_name=0 then open_log_file;
if cur_chr=1 then external_ocp:=true
else external_ocp:=false;
get_r_token; u:=cur_cs;
-if u>=hash_base then t:=text(u)
-else if u=null_cs then t:="OCP"
-else begin old_setting:=selector; selector:=new_string;
- print("OCP"); print(u-active_base); selector:=old_setting;
-@.OCPx@>
- str_room(1); t:=make_string;
- end;
+if u>=hash_base then t:=text(u) else t:="OCP";
define(u,set_ocp,null_ocp); scan_optional_equals; scan_file_name;
@<If this ocp has already been loaded, set |f| to the internal
ocp number and |goto common_ending|@>;
@@ -35659,18 +31552,11 @@ procedure new_ocp_list(@!a:small_number);
var u:pointer; {user's ocp list identifier}
@!f:internal_ocp_list_number; {runs through existing ocp lists}
@!t:str_number; {name for the frozen ocp list identifier}
-@!old_setting:0..max_selector; {holds |selector| setting}
begin if job_name=0 then open_log_file;
{avoid confusing \.{texput} with the ocp list name}
@.texput@>
get_r_token; u:=cur_cs;
-if u>=hash_base then t:=text(u)
-else if u=null_cs then t:="OCPLIST"
-else begin old_setting:=selector; selector:=new_string;
- print("OCPLIST"); print(u-active_base); selector:=old_setting;
-@.OCPx@>
- str_room(1); t:=make_string;
- end;
+if u>=hash_base then t:=text(u) else t:="OCPLIST";
define(u,set_ocp_list,null_ocp_list); scan_optional_equals;
f:=read_ocp_list;
equiv(u) := f; eqtb[ocp_list_id_base+f] := eqtb[u];
@@ -35744,6 +31630,203 @@ define(ocp_active_max_ptr_base, data, active_max_ptr);
end;
+@* \[54/SyncTeX] The {\sl Synchronize \TeX nology}.
+This section is devoted to the {\sl Synchronize \TeX nology}
+- or simply {\sl Sync\TeX} - used to synchronize between input and output.
+This section explains how synchronization basics are implemented.
+Before we enter into more technical details,
+let us recall in a few words what is synchronization.
+
+\TeX\ typesetting system clearly separates the input and the output material,
+and synchronization will provide a new link between both that can help
+text editors and viewers to work together.
+More precisely, forwards synchronization is the ability,
+given a location in the input source file,
+to find what is the corresponding place in the output.
+Backwards synchronization just performs the opposite:
+given a location in the output,
+retrieve the corresponding material in the input source file.
+
+For better code management and maintainance, we adopt a naming convention.
+Throughout this program, code related to the {\sl Synchronize \TeX nology} is tagged
+with the ``{\sl synctex}'' key word. Any code extract where {\sl Sync\TeX} plays
+its part, either explicitly or implicitly, (should) contain the string ``{\sl synctex}''.
+This naming convention also holds for external files.
+Moreover, all the code related to {\sl Sync\TeX} is gathered in this section,
+except the definitions.
+
+@ Enabling synchronization should be performed from the command line,
+|synctexoption| is used for that purpose.
+This global integer variable is declared here but it is not used here.
+This is just a placeholder where the command line controller will put
+the {\sl Sync\TeX} related options, and the {\sl Sync\TeX} controller will read them.
+
+@ @<Glob...@>=
+@!synctexoption:integer;
+
+@ A convenient primitive is provided:
+\.{\\synctex=1} in the input source file enables synchronization whereas
+\.{\\synctex=0} disables it.
+Its memory address is |synctex_code|.
+It is initialized by the {\sl Sync\TeX} controller to the command-line option if given.
+The controller may filter some reserved bits.
+
+@ In order to give the {\sl Sync\TeX} controller read and write access to
+the contents of the \.{\\synctex} primitive, we declare |synctexoffset|,
+such that |mem[synctexoffset]| and \.{\\synctex} correspond to
+the same memory storage. |synctexoffset| is initialized to
+the correct value when quite everything is initialized.
+
+@ @<Glob...@>=
+@!synctexoffset:integer; {holds the true value of |synctex_code|}
+
+@ @<Initialize whatever...@>=
+synctexoffset:=int_base+synctex_code;
+
+@ @<Initialize synctex primitive@>=
+synctex_init_command;
+
+@ Synchronization is achieved with the help of an auxiliary file named
+`\.{{\sl jobname}.synctex}' ({\sl jobname} is the contents of the
+\.{\\jobname} macro), where a {\sl Sync\TeX} controller implemented
+in the external |synctex.c| file will store geometrical information.
+This {\sl Sync\TeX} controller will take care of every technical details
+concerning the {\sl Sync\TeX} file, we will only focus on the messages
+the controller will receive from the \TeX\ program.
+
+The most accurate synchronization information should allow to map
+any character of the input source file to the corresponding location
+in the output, if relevant.
+Ideally, the synchronization information of the input material consists of
+the file name, the line and column numbers of every character.
+The synchronization information in the output is simply the page number and
+either point coordinates, or box dimensions and position.
+The problem is that the mapping between these informations is only known at
+ship out time, which means that we must keep track of the input
+synchronization information until the pages ship out.
+
+As \TeX\ only knows about file names and line numbers,
+but forgets the column numbers, we only consider a
+restricted input synchronization information called {\sl Sync\TeX\ information}.
+It consists of a unique file name identifier, the {\sl Sync\TeX\ file tag},
+and the line number.
+
+Keeping track of such information,
+should be different whether characters or nodes are involved.
+Actually, only certain nodes are involved in {\sl Sync\TeX},
+we call them {\sl synchronized nodes}.
+Synchronized nodes store the {\sl Sync\TeX} information in their last two words:
+the first one contains a {\sl Sync\TeX\ file tag} uniquely identifying
+the input file, and the second one contains the current line number,
+as returned by the \.{\\inputlineno} primitive.
+The |synctex_field_size| macro contains the necessary size to store
+the {\sl Sync\TeX} information in a node.
+
+When declaring the size of a new node, it is recommanded to use the following
+convention: if the node is synchronized, use a definition similar to
+|my_synchronized_node_size|={\sl xxx}+|synctex_field_size|.
+Moreover, one should expect that the {\sl Sync\TeX} information is always stored
+in the last two words of a synchronized node.
+
+@ By default, every node with a sufficiently big size is initialized
+at creation time in the |get_node| routine with the current
+{\sl Sync\TeX} information, whether or not the node is synchronized.
+One purpose is to set this information very early in order to minimize code
+dependencies, including forthcoming extensions.
+Another purpose is to avoid the assumption that every node type has a dedicated getter,
+where initialization should take place. Actually, it appears that some nodes are created
+using directly the |get_node| routine and not the dedicated constructor.
+And finally, initializing the node at only one place is less error prone.
+
+@ Instead of storing the input file name, it is better to store just an identifier.
+Each time \TeX\ opens a new file, it notifies the {\sl Sync\TeX} controller with
+a |synctex_start_input| message.
+This controller will create a new {\sl Sync\TeX} file tag and
+will update the current input state record accordingly.
+If the input comes from the terminal or a pseudo file, the |synctex_tag| is set to 0.
+It results in automatically disabling synchronization for material
+input from the terminal or pseudo files.
+
+@ @<Prepare new file {\sl Sync\TeX} information@>=
+synctex_start_input; {Give control to the {\sl Sync\TeX} controller}
+
+@ @<Prepare terminal input {\sl Sync\TeX} information@>=
+synctex_tag:=0;
+
+@ @<Prepare pseudo file {\sl Sync\TeX} information@>=
+synctex_tag:=0;
+
+@ @<Close {\sl Sync\TeX} file and write status@>=
+synctex_terminate(log_opened); {Let the {\sl Sync\TeX} controller close its files.}
+
+@ Synchronized nodes are boxes, math, kern and glue nodes.
+Other nodes should be synchronized too, in particular math noads.
+\TeX\ assumes that math, kern and glue nodes have the same size,
+this is why both are synchronized.
+{\sl In fine}, only horizontal lists are really used in {\sl Sync\TeX},
+but all box nodes are considered the same with respect to synchronization,
+because a box node type is allowed to change at execution time.
+
+The next sections are the various messages sent to the {\sl Sync\TeX} controller.
+The argument is either the box or the node currently shipped out.
+The vertical boxes are not recorded, but the code is available for clients.
+
+@ @<Start sheet {\sl Sync\TeX} information record@>=
+pdf_output_value:=pdf_output; {{\sl Sync\TeX}: we assume that |pdf_output| is properly set up}
+synctex_sheet(mag);
+
+@ @<Finish sheet {\sl Sync\TeX} information record@>=
+synctex_teehs;
+
+@ @<Start vlist {\sl Sync\TeX} information record@>=
+synctex_vlist(this_box);
+
+@ @<Finish vlist {\sl Sync\TeX} information record@>=
+synctex_tsilv(this_box);
+
+@ @<Start hlist {\sl Sync\TeX} information record@>=
+synctex_hlist(this_box);
+
+@ @<Finish hlist {\sl Sync\TeX} information record@>=
+synctex_tsilh(this_box);
+
+@ @<Record void list {\sl Sync\TeX} information@>=
+ if type(p)=vlist_node then begin
+ synctex_void_vlist(p,this_box);
+ end
+ else begin
+ synctex_void_hlist(p,this_box);
+ end;
+
+@ @<Record current point {\sl Sync\TeX} information@>=
+synctex_current;
+
+@ @<Record horizontal |rule_node| or |glue_node| {\sl Sync\TeX} information@>=
+synctex_horizontal_rule_or_glue(p,this_box);
+
+@ @<Record |kern_node| {\sl Sync\TeX} information@>=
+synctex_kern(p,this_box);
+
+@ @<Record |math_node| {\sl Sync\TeX} information@>=
+synctex_math(p,this_box);
+
+
+@ {\sl Nota Bene:}
+The {\sl Sync\TeX} code is very close to the memory model.
+It is not connected to any other part of the code,
+except for memory management. It is possible to neutralize the {\sl Sync\TeX} code
+rather simply. The first step is to define a null |synctex_field_size|.
+The second step is to comment out the code in ``Initialize bigger nodes...'' and every
+``Copy ... {\sl Sync\TeX} information''.
+The last step will be to comment out the |synctex_tag_field| related code in the
+definition of |synctex_tag| and the various ``Prepare ... {\sl Sync\TeX} information''.
+Then all the remaining code should be just harmless.
+The resulting program would behave exactly the same as if absolutely no {\sl Sync\TeX}
+related code was there, including memory management.
+Of course, all this assumes that {\sl Sync\TeX} is turned off from the command line.
+@^synctex@>
+@^synchronization@>
+
@* \[54] System-dependent changes.
This section should be replaced, if necessary, by any special
modifications of the program
diff --git a/Build/source/texk/web2c/luatexdir/luatexextra.in b/Build/source/texk/web2c/luatexdir/luatexextra.in
index ffbd65f3c1c..faa2ef972d8 100644
--- a/Build/source/texk/web2c/luatexdir/luatexextra.in
+++ b/Build/source/texk/web2c/luatexdir/luatexextra.in
@@ -1,32 +1,31 @@
-/*
-Copyright (c) 1996-2004 Han The Thanh, <thanh@pdftex.org>
+/* luatexextra.in: banner etc. for luaTeX.
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-$Id$
-*/
-
-/* luatexextra.in: banner etc. for luaTeX.
+/* $Id$ */
+/*
This is included by luaTeX, from ../luatexextra.c
(generated from ../lib/texmfmp.c).
*/
-#define BANNER "This is luaTeX, Version 3.141592-LUATEX-VERSION-ETEX-VERSION"
+#define BANNER "This is LuaTeX, Version LUATEX-VERSION"
#define COPYRIGHT_HOLDER "Taco Hoekwater"
#define AUTHOR NULL
#define PROGRAM_HELP LUATEXHELP
@@ -39,4 +38,3 @@ $Id$
#define INI_PROGRAM "luainitex"
#define VIR_PROGRAM "luavirtex"
#define TEXMFENGINENAME "luatex"
-
diff --git a/Build/source/texk/web2c/luatexdir/luatexlib.mk b/Build/source/texk/web2c/luatexdir/luatexlib.mk
index d16ed88a709..55e9ce8dd2a 100644
--- a/Build/source/texk/web2c/luatexdir/luatexlib.mk
+++ b/Build/source/texk/web2c/luatexdir/luatexlib.mk
@@ -1,4 +1,4 @@
-## luatexlib.mk - Makefile fragment for libraries used by pdf[ex]tex.
+## luatexlib.mk - Makefile fragment for libraries used by luatex.
# $Id$
# Public domain.
@@ -10,16 +10,12 @@ Makefile: luatexdir/luatexlib.mk
# libpdf itself
luapdflib = luatexdir/libpdf.a
-luapdflib_sources = $(srcdir)/luatexdir/*.c $(srcdir)/luatexdir/*.cc \
- $(srcdir)/luatexdir/*.h
+luapdflib_sources = $(srcdir)/luatexdir/*.c $(srcdir)/luatexdir/*.h \
+ $(srcdir)/luatexdir/*/*.c $(srcdir)/luatexdir/*/*.h \
+ $(srcdir)/luatexdir/*/*.cc
$(luapdflib): $(luapdflib_sources) luatexdir/luatexextra.h ctangle
- cd luatexdir && mkdir -p font image lua lang tex && $(MAKE) $(common_makeargs) libpdf.a
-
-# makecpool:
-
-luatexdir/makecpool: luatexdir/makecpool.c
- cd luatexdir && $(MAKE) $(common_makeargs) makecpool
+ cd luatexdir && mkdir -p font image lua lang pdf tex utils && $(MAKE) $(common_makeargs) libpdf.a
# lua
@@ -35,9 +31,6 @@ ifeq ($(target),i386-mingw32)
luatarget = mingw
endif
else
-ifeq ($(target),i386-linux)
- luatarget = posix
-endif
endif
@@ -63,7 +56,7 @@ $(SLNUNICODEDEP): $(SLNUNICODEDIR)/slnunico.c $(SLNUNICODEDIR)/slnudata.c
# because the zlib path is relative and can't be found otherwise.
#
# final trickyness: configure writes a Makefile in the source
-# directory. it is not needed by anything, so I delete it right away
+# directory. it is needed by anything, so I delete it right away
zzipretarget=
@@ -102,6 +95,19 @@ $(LUAFSDEP): $(LUAFSDIR)/src/lfs.c $(LUAFSDIR)/src/lfs.h
mkdir -p $(LUAFSDIR) && cd $(LUAFSDIR) && cp -R $(LUAFSSRCDIR)/* . && \
cd src && $(CC) $(CFLAGS) $(LUAFSINC) -g -o lfs.o -c lfs.c
+
+# luasocket
+
+LUASOCKETDIR=../../libs/luasocket
+LUASOCKETSRCDIR=$(srcdir)/$(LUASOCKETDIR)
+LUASOCKETDEP=$(LUASOCKETDIR)/src/socket.a
+LUASOCKETINC=-I../../lua51
+
+$(LUASOCKETDEP): $(LUASOCKETDIR)/src/luasocket.c $(LUASOCKETDIR)/src/luasocket.h
+ mkdir -p $(LUASOCKETDIR) && cd $(LUASOCKETDIR) && cp -R $(LUASOCKETSRCDIR)/* . && \
+ cd src && make
+
+
# luapeg
LUAPEGDIR=../../libs/luapeg
LUAPEGSRCDIR=$(srcdir)/$(LUAPEGDIR)
@@ -124,10 +130,14 @@ LUAFFDIR=../../libs/luafontforge
LUAFFSRCDIR=$(srcdir)/$(LUAFFDIR)
LUAFFDEP=$(LUAFFDIR)/libff.a
$(LUAFFDEP): always
- mkdir -p $(LUAFFDIR) && cp -f $(LUAFFSRCDIR)/Makefile $(LUAFFDIR)
- mkdir -p $(LUAFFDIR)/fontforge && cp -f $(LUAFFSRCDIR)/fontforge/fontforge/Makefile $(LUAFFDIR)/fontforge
- mkdir -p $(LUAFFDIR)/Unicode && cp -f $(LUAFFSRCDIR)/fontforge/Unicode/Makefile $(LUAFFDIR)/Unicode
- cd $(LUAFFDIR) && $(MAKE)
+ mkdir -p $(LUAFFDIR) && cd $(LUAFFDIR) && cp -f $(LUAFFSRCDIR)/Makefile . && $(MAKE)
+
+# luaprof
+LUAPROFDIR=../../libs/luaprofiler
+LUAPROFSRCDIR=$(srcdir)/$(LUAPROFDIR)
+LUAPROFDEP=$(LUAPROFDIR)/libprofiler.a
+$(LUAPROFDEP): always
+ mkdir -p $(LUAPROFDIR) && cd $(LUAPROFDIR) && cp -f $(LUAPROFSRCDIR)/Makefile . && $(MAKE)
# luazlib
@@ -138,16 +148,20 @@ LUAZLIBINC=-I$(ZLIBSRCDIR) -I$(LIBLUASRCDIR)
$(LUAZLIBDEP): $(LUAZLIBDIR)/lgzip.c $(LUAZLIBDIR)/lzlib.c
mkdir -p $(LUAZLIBDIR) && cd $(LUAZLIBDIR) && cp -f $(LUAZLIBSRCDIR)/* . && $(CC) $(CFLAGS) $(LUAZLIBINC) -g -o lgzip.o -c lgzip.c && $(CC) $(CFLAGS) $(LUAZLIBINC) -g -o lzlib.o -c lzlib.c
+# mplib (temporary)
+
+LIBMPDIR=mpdir
+LIBMPLIBDEP=$(LIBMPDIR)/lmplib.o $(LIBMPDIR)/.libs/libmplib.a
# Convenience variables.
luatexlibs = $(luapdflib) $(LDLIBPNG) $(LDZLIB) $(LDLIBXPDF) $(LIBMD5DEP) $(LDLIBOBSD) \
- $(LIBLUADEP) $(SLNUNICODEDEP) $(LUAZIPDEP) $(ZZIPLIBDEP) $(LUAFSDEP) \
- $(LUAPEGDEP) $(LUAMDVDEP) $(LUAZLIBDEP) $(LUAFFDEP)
+ $(LIBLUADEP) $(SLNUNICODEDEP) $(LUAZIPDEP) $(ZZIPLIBDEP) $(LUAFSDEP) $(LUASOCKETDEP) \
+ $(LUAPEGDEP) $(LUAMDVDEP) $(LUAZLIBDEP) $(LUAFFDEP) $(LUAPROFDEP) $(LIBMPLIBDEP)
luatexlibsdep = $(luapdflib) $(LIBPNGDEP) $(ZLIBDEP) $(LIBXPDFDEP) $(LIBMD5DEP) $(LIBOBSDDEP) \
- $(LIBLUADEP) $(SLNUNICODEDEP) $(ZZIPLIBDEP) $(LUAZIPDEP) $(LUAFSDEP) \
- $(LUAPEGDEP) $(LUAMDVDEP) $(LUAZLIBDEP) $(LUAFFDEP) $(makecpool)
+ $(LIBLUADEP) $(SLNUNICODEDEP) $(ZZIPLIBDEP) $(LUAZIPDEP) $(LUAFSDEP) $(LUASOCKETDEP) \
+ $(LUAPEGDEP) $(LUAMDVDEP) $(LUAZLIBDEP) $(LUAFFDEP) $(LUAPROFDEP) $(makecpool)
## end of luatexlib.mk - Makefile fragment for libraries used by pdf[ex]tex.
diff --git a/Build/source/texk/web2c/luatexdir/luazlib/lzlib.c b/Build/source/texk/web2c/luatexdir/luazlib/lzlib.c
index 74c9dd21a64..69558e31d96 100644
--- a/Build/source/texk/web2c/luatexdir/luazlib/lzlib.c
+++ b/Build/source/texk/web2c/luatexdir/luazlib/lzlib.c
@@ -195,7 +195,7 @@ static int lzlib_inflate(lua_State *L)
static int lzstream_decompress(lua_State *L)
{
z_stream *s = lzstream_check(L, 1, LZINFLATE);
- s->next_in = (char*)luaL_checkstring(L, 2);
+ s->next_in = (Bytef*)luaL_checkstring(L, 2);
s->avail_in = lua_strlen(L, 2);
{
@@ -204,7 +204,7 @@ static int lzstream_decompress(lua_State *L)
luaL_buffinit(L, &b);
do {
- s->next_out = luaL_prepbuffer(&b);
+ s->next_out = (Bytef*)luaL_prepbuffer(&b);
s->avail_out = LUAL_BUFFERSIZE;
/* munch some more */
@@ -231,7 +231,7 @@ static int lzstream_decompress(lua_State *L)
static int lzstream_compress(lua_State *L)
{
z_stream *s = lzstream_check(L, 1, LZDEFLATE);
- s->next_in = (char*)luaL_checkstring(L, 2);
+ s->next_in = (Bytef*)luaL_checkstring(L, 2);
s->avail_in = lua_strlen(L, 2);
{
@@ -240,7 +240,7 @@ static int lzstream_compress(lua_State *L)
luaL_buffinit(L, &b);
do {
- s->next_out = luaL_prepbuffer(&b);
+ s->next_out = (Bytef*)luaL_prepbuffer(&b);
s->avail_out = LUAL_BUFFERSIZE;
/* bake some more */
@@ -273,7 +273,7 @@ static int lzstream_flush(lua_State *L)
return 1;
}
- s->next_in = "";
+ s->next_in = (Bytef*)"";
s->avail_in = 0;
{
@@ -282,7 +282,7 @@ static int lzstream_flush(lua_State *L)
luaL_buffinit(L, &b);
do {
- s->next_out = luaL_prepbuffer(&b);
+ s->next_out = (Bytef*)luaL_prepbuffer(&b);
s->avail_out = LUAL_BUFFERSIZE;
r = deflate(s, Z_FINISH);
@@ -349,7 +349,7 @@ static int lzlib_adler32(lua_State *L)
const char* buf = luaL_checkstring(L, 2);
int len = lua_strlen(L, 2);
- lua_pushnumber(L, adler32(adler, buf, len));
+ lua_pushnumber(L, adler32(adler, (const Bytef*)buf, len));
}
return 1;
}
@@ -369,7 +369,7 @@ static int lzlib_crc32(lua_State *L)
const char* buf = luaL_checkstring(L, 2);
int len = lua_strlen(L, 2);
- lua_pushnumber(L, crc32(crc, buf, len));
+ lua_pushnumber(L, crc32(crc, (const Bytef*)buf, len));
}
return 1;
}
@@ -409,12 +409,12 @@ static int lzlib_compress(lua_State *L)
return 2;
}
- zs.next_in = (char*)next_in;
+ zs.next_in = (Bytef*)next_in;
zs.avail_in = avail_in;
for(;;)
{
- zs.next_out = luaL_prepbuffer(&b);
+ zs.next_out = (Bytef*)luaL_prepbuffer(&b);
zs.avail_out = LUAL_BUFFERSIZE;
/* munch some more */
@@ -453,6 +453,7 @@ static int lzlib_decompress(lua_State *L)
luaL_Buffer b;
luaL_buffinit(L, &b);
+
zs.zalloc = Z_NULL;
zs.zfree = Z_NULL;
@@ -470,12 +471,12 @@ static int lzlib_decompress(lua_State *L)
return 2;
}
- zs.next_in = (char*)next_in;
+ zs.next_in = (Bytef*)next_in;
zs.avail_in = avail_in;
for(;;)
{
- zs.next_out = luaL_prepbuffer(&b);
+ zs.next_out = (Bytef*)luaL_prepbuffer(&b);
zs.avail_out = LUAL_BUFFERSIZE;
/* bake some more */
diff --git a/Build/source/texk/web2c/luatexdir/macnames.c b/Build/source/texk/web2c/luatexdir/macnames.c
deleted file mode 100644
index 832e05e052d..00000000000
--- a/Build/source/texk/web2c/luatexdir/macnames.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
-
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id$
-*/
-
-const char notdef[] = ".notdef";
-
-const char *mac_glyph_names[] = {
-/* 0x00 */
- notdef,
- ".null",
- "CR",
- "space",
- "exclam",
- "quotedbl",
- "numbersign",
- "dollar",
- "percent",
- "ampersand",
- "quotesingle",
- "parenleft",
- "parenright",
- "asterisk",
- "plus",
- "comma",
-/* 0x10 */
- "hyphen",
- "period",
- "slash",
- "zero",
- "one",
- "two",
- "three",
- "four",
- "five",
- "six",
- "seven",
- "eight",
- "nine",
- "colon",
- "semicolon",
- "less",
-/* 0x20 */
- "equal",
- "greater",
- "question",
- "at",
- "A",
- "B",
- "C",
- "D",
- "E",
- "F",
- "G",
- "H",
- "I",
- "J",
- "K",
- "L",
-/* 0x30 */
- "M",
- "N",
- "O",
- "P",
- "Q",
- "R",
- "S",
- "T",
- "U",
- "V",
- "W",
- "X",
- "Y",
- "Z",
- "bracketleft",
- "backslash",
-/* 0x40 */
- "bracketright",
- "asciicircum",
- "underscore",
- "grave",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
-/* 0x50 */
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- "braceleft",
- "bar",
-/* 0x60 */
- "braceright",
- "asciitilde",
- "Adieresis",
- "Aring",
- "Ccedilla",
- "Eacute",
- "Ntilde",
- "Odieresis",
- "Udieresis",
- "aacute",
- "agrave",
- "acircumflex",
- "adieresis",
- "atilde",
- "aring",
- "ccedilla",
-/* 0x70 */
- "eacute",
- "egrave",
- "ecircumflex",
- "edieresis",
- "iacute",
- "igrave",
- "icircumflex",
- "idieresis",
- "ntilde",
- "oacute",
- "ograve",
- "ocircumflex",
- "odieresis",
- "otilde",
- "uacute",
- "ugrave",
-/* 0x80 */
- "ucircumflex",
- "udieresis",
- "dagger",
- "degree",
- "cent",
- "sterling",
- "section",
- "bullet",
- "paragraph",
- "germandbls",
- "registered",
- "copyright",
- "trademark",
- "acute",
- "dieresis",
- "notequal",
-/* 0x90 */
- "AE",
- "Oslash",
- "infinity",
- "plusminus",
- "lessequal",
- "greaterequal",
- "yen",
- "mu",
- "partialdiff",
- "Sigma",
- "Pi",
- "pi",
- "integral",
- "ordfeminine",
- "ordmasculine",
- "Omega",
-/* 0xa0 */
- "ae",
- "oslash",
- "questiondown",
- "exclamdown",
- "logicalnot",
- "radical",
- "florin",
- "approxequal",
- "Delta",
- "guillemotleft",
- "guillemotright",
- "ellipsis",
- "nbspace",
- "Agrave",
- "Atilde",
- "Otilde",
-/* 0xb0 */
- "OE",
- "oe",
- "endash",
- "emdash",
- "quotedblleft",
- "quotedblright",
- "quoteleft",
- "quoteright",
- "divide",
- "lozenge",
- "ydieresis",
- "Ydieresis",
- "fraction",
- "currency",
- "guilsinglleft",
- "guilsinglright",
-/* 0xc0 */
- "fi",
- "fl",
- "daggerdbl",
- "periodcentered",
- "quotesinglbase",
- "quotedblbase",
- "perthousand",
- "Acircumflex",
- "Ecircumflex",
- "Aacute",
- "Edieresis",
- "Egrave",
- "Iacute",
- "Icircumflex",
- "Idieresis",
- "Igrave",
-/* 0xd0 */
- "Oacute",
- "Ocircumflex",
- "applelogo",
- "Ograve",
- "Uacute",
- "Ucircumflex",
- "Ugrave",
- "dotlessi",
- "circumflex",
- "tilde",
- "macron",
- "breve",
- "dotaccent",
- "ring",
- "cedilla",
- "hungarumlaut",
-/* 0xe0 */
- "ogonek",
- "caron",
- "Lslash",
- "lslash",
- "Scaron",
- "scaron",
- "Zcaron",
- "zcaron",
- "brokenbar",
- "Eth",
- "eth",
- "Yacute",
- "yacute",
- "Thorn",
- "thorn",
- "minus",
-/* 0xf0 */
- "multiply",
- "onesuperior",
- "twosuperior",
- "threesuperior",
- "onehalf",
- "onequarter",
- "threequarters",
- "franc",
- "Gbreve",
- "gbreve",
- "Idot",
- "Scedilla",
- "scedilla",
- "Cacute",
- "cacute",
- "Ccaron",
-/* 0x100 */
- "ccaron",
- "dmacron"
-};
-
-const char *ambiguous_names[] = {
- "Delta", /* increment */
- "Omega", /* Ohm */
- "Pi", /* product */
- "Sigma", /* summation */
- "dmacron", /* dslash */
- "macron", /* overscore */
- "periodcentered", /* middot */
- NULL
-};
diff --git a/Build/source/texk/web2c/luatexdir/makecpool.c b/Build/source/texk/web2c/luatexdir/makecpool.c
new file mode 100644
index 00000000000..dd5b31f0b92
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/makecpool.c
@@ -0,0 +1,93 @@
+/* Copyright 2007, 2008 Taco Hoekwater.
+ You may freely use, modify and/or distribute this file. */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+static const char __svn_version[] =
+ "$Id: makecpool.c 1230 2008-05-03 11:11:32Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/makecpool.c $";
+
+int main(int argc, char *argv[])
+{
+ char *filename;
+ char *headername;
+ FILE *fh;
+ char data[1024];
+ int is_metafont = 0;
+ int is_metapost = 0;
+ int is_luatex = 0;
+ if (argc != 3) {
+ fprintf(stderr,
+ "%s: need exactly two arguments (pool name and C header name).\n",
+ argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ filename = argv[1];
+ headername = argv[2];
+ fh = fopen(filename, "r");
+ if (!fh) {
+ fprintf(stderr, "%s: can't open %s for reading.\n", argv[0], filename);
+ exit(EXIT_FAILURE);
+ }
+ if (strstr(filename, "luatex.pool") != NULL)
+ is_luatex = 1;
+ else if (strstr(filename, "mp.pool") != NULL)
+ is_metapost = 1;
+ else if (strstr(filename, "mf.pool") != NULL)
+ is_metafont = 1;
+ printf("/*\n"
+ " * This file is auto-generated by makecpool.\n"
+ " * %s %s %s\n"
+ " */\n"
+ "\n"
+ "#include <stdio.h>\n"
+ "#include <string.h>\n"
+ "#include \"%s\"\n"
+ "\n"
+ "static const char *poolfilearr[] = {\n", argv[0], filename,
+ headername, headername);
+ while (fgets(data, 1024, fh)) {
+ int i;
+ int len = strlen(data);
+ int o = 0; /* skip first bytes */
+ if (data[len - 1] == '\n') {
+ data[len - 1] = 0;
+ len--;
+ }
+ if (data[0] == '*')
+ break;
+ if (data[0] >= '0' && data[0] <= '9' && data[1] >= '0'
+ && data[1] <= '9') {
+ o = 2;
+ }
+ printf(" \"");
+ for (i = o; i < len; i++) {
+ if (data[i] == '"' || data[i] == '\\')
+ putchar('\\');
+ if (data[i] == '?')
+ printf("\" \""); /* suppress trigraphs */
+ putchar(data[i]);
+ }
+ printf("\",\n");
+ }
+ fclose(fh);
+ printf(" NULL };\n"
+ "int loadpoolstrings (integer spare_size) {\n"
+ " const char *s;\n"
+ " strnumber g=0;\n"
+ " int i=0,j=0;\n"
+ " while ((s = poolfilearr[j++])) {\n"
+ " int l = strlen (s);\n"
+ " i += l;\n" " if (i>=spare_size) return 0;\n");
+ if (is_luatex)
+ printf(" while (l-- > 0) str_pool[pool_ptr++] = *s++;\n"
+ " g = make_string();\n");
+ else
+ printf(" while (l-- > 0) strpool[poolptr++] = *s++;\n"
+ " g = makestring();\n");
+ if (is_metapost || is_metafont)
+ printf(" strref[g]= 127;\n");
+ printf(" }\n" " return g;\n" "}\n");
+ return EXIT_SUCCESS;
+}
diff --git a/Build/source/texk/web2c/luatexdir/managed-sa.c b/Build/source/texk/web2c/luatexdir/managed-sa.c
index cc63d7e75f5..97872c1efe3 100644
--- a/Build/source/texk/web2c/luatexdir/managed-sa.c
+++ b/Build/source/texk/web2c/luatexdir/managed-sa.c
@@ -1,245 +1,287 @@
+/* managed-sa.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "managed-sa.h"
+static const char __svn_version[] =
+ "$Id$ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/managed-sa.c $";
-static void
-store_sa_stack (sa_tree a, integer n, integer v, integer gl) {
- sa_stack_item st;
- st.code = n;
- st.value = v;
- st.level = gl;
- if (a->stack == NULL) {
- a->stack = Mxmalloc_array(sa_stack_item,a->stack_size);
- } else if (((a->stack_ptr)+1)>=a->stack_size) {
- a->stack_size += a->stack_step;
- a->stack = Mxrealloc_array(a->stack,sa_stack_item,a->stack_size);
- }
- (a->stack_ptr)++;
- a->stack[a->stack_ptr] = st;
+static void store_sa_stack(sa_tree a, integer n, integer v, integer gl)
+{
+ sa_stack_item st;
+ st.code = n;
+ st.value = v;
+ st.level = gl;
+ if (a->stack == NULL) {
+ a->stack = Mxmalloc_array(sa_stack_item, a->stack_size);
+ } else if (((a->stack_ptr) + 1) >= a->stack_size) {
+ a->stack_size += a->stack_step;
+ a->stack = Mxrealloc_array(a->stack, sa_stack_item, a->stack_size);
+ }
+ (a->stack_ptr)++;
+ a->stack[a->stack_ptr] = st;
}
-static void
-skip_in_stack (sa_tree a, integer n) {
- int p = a->stack_ptr;
- if (a->stack == NULL)
- return;
- while (p>0) {
- if (a->stack[p].code == n && a->stack[p].level > 0) {
- a->stack[p].level = -(a->stack[p].level);
+static void skip_in_stack(sa_tree a, integer n)
+{
+ int p = a->stack_ptr;
+ if (a->stack == NULL)
+ return;
+ while (p > 0) {
+ if (a->stack[p].code == n && a->stack[p].level > 0) {
+ a->stack[p].level = -(a->stack[p].level);
+ }
+ p--;
}
- p--;
- }
}
-sa_tree_item
-get_sa_item (const sa_tree head, const integer n) {
- register int h;
- register int m;
- if (head->tree != NULL) {
- h = HIGHPART_PART(n);
- if (head->tree[h] != NULL) {
- m = MIDPART_PART(n);
- if (head->tree[h][m] != NULL) {
- return head->tree[h][m][LOWPART_PART(n)];
- }
+sa_tree_item get_sa_item(const sa_tree head, const integer n)
+{
+ register int h;
+ register int m;
+ if (head->tree != NULL) {
+ h = HIGHPART_PART(n);
+ if (head->tree[h] != NULL) {
+ m = MIDPART_PART(n);
+ if (head->tree[h][m] != NULL) {
+ return head->tree[h][m][LOWPART_PART(n)];
+ }
+ }
}
- }
- return head->dflt;
+ return head->dflt;
}
-void
-set_sa_item (sa_tree head, integer n, sa_tree_item v, integer gl) {
- int h,m,l;
- int i;
- h = HIGHPART_PART(n);
- m = MIDPART_PART(n);
- l = LOWPART_PART(n);
- if (head->tree == NULL) {
- head->tree = (sa_tree_item ***) Mxmalloc_array(sa_tree_item **,HIGHPART);
- for (i=0; i<HIGHPART; i++) { head->tree[i] = NULL; }
- }
- if (head->tree[h] == NULL) {
- head->tree[h] = (sa_tree_item **) Mxmalloc_array(sa_tree_item *,MIDPART);
- for (i=0; i<MIDPART; i++) { head->tree[h][i] = NULL; }
- }
- if (head->tree[h][m] == NULL) {
- head->tree[h][m] = (sa_tree_item *) Mxmalloc_array(sa_tree_item,LOWPART);
- for (i=0; i<LOWPART; i++) { head->tree[h][m][i] = head->dflt; }
- }
- if (gl<=1) {
- skip_in_stack(head,n);
- } else {
- store_sa_stack(head,n,head->tree[h][m][l],gl);
- }
- head->tree[h][m][l] = v;
+void set_sa_item(sa_tree head, integer n, sa_tree_item v, integer gl)
+{
+ int h, m, l;
+ int i;
+ h = HIGHPART_PART(n);
+ m = MIDPART_PART(n);
+ l = LOWPART_PART(n);
+ if (head->tree == NULL) {
+ head->tree =
+ (sa_tree_item ***) Mxmalloc_array(sa_tree_item **, HIGHPART);
+ for (i = 0; i < HIGHPART; i++) {
+ head->tree[i] = NULL;
+ }
+ }
+ if (head->tree[h] == NULL) {
+ head->tree[h] =
+ (sa_tree_item **) Mxmalloc_array(sa_tree_item *, MIDPART);
+ for (i = 0; i < MIDPART; i++) {
+ head->tree[h][i] = NULL;
+ }
+ }
+ if (head->tree[h][m] == NULL) {
+ head->tree[h][m] =
+ (sa_tree_item *) Mxmalloc_array(sa_tree_item, LOWPART);
+ for (i = 0; i < LOWPART; i++) {
+ head->tree[h][m][i] = head->dflt;
+ }
+ }
+ if (gl <= 1) {
+ skip_in_stack(head, n);
+ } else {
+ store_sa_stack(head, n, head->tree[h][m][l], gl);
+ }
+ head->tree[h][m][l] = v;
}
-static void
-rawset_sa_item (sa_tree head, integer n, integer v) {
- head->tree[HIGHPART_PART(n)][MIDPART_PART(n)][LOWPART_PART(n)] = v;
+void rawset_sa_item(sa_tree head, integer n, integer v)
+{
+ head->tree[HIGHPART_PART(n)][MIDPART_PART(n)][LOWPART_PART(n)] = v;
}
-void
-clear_sa_stack (sa_tree a) {
- if (a->stack != NULL) {
- Mxfree(a->stack);
- }
- a->stack = NULL;
- a->stack_ptr = 0;
- a->stack_size = a->stack_step;
+void clear_sa_stack(sa_tree a)
+{
+ if (a->stack != NULL) {
+ Mxfree(a->stack);
+ }
+ a->stack = NULL;
+ a->stack_ptr = 0;
+ a->stack_size = a->stack_step;
}
-void
-destroy_sa_tree (sa_tree a) {
- int h,m;
- if (a == NULL)
- return;
- if (a->tree != NULL) {
- for (h=0; h<HIGHPART;h++ ) {
- if (a->tree[h] != NULL) {
- for (m=0; m<MIDPART; m++ ) {
- if (a->tree[h][m] != NULL) {
- Mxfree(a->tree[h][m]);
- }
- }
- Mxfree(a->tree[h]);
- }
+void destroy_sa_tree(sa_tree a)
+{
+ int h, m;
+ if (a == NULL)
+ return;
+ if (a->tree != NULL) {
+ for (h = 0; h < HIGHPART; h++) {
+ if (a->tree[h] != NULL) {
+ for (m = 0; m < MIDPART; m++) {
+ if (a->tree[h][m] != NULL) {
+ Mxfree(a->tree[h][m]);
+ }
+ }
+ Mxfree(a->tree[h]);
+ }
+ }
+ Mxfree(a->tree);
}
- Mxfree(a->tree);
- }
- if (a->stack != NULL) {
- Mxfree(a->stack);
- }
- Mxfree(a);
+ if (a->stack != NULL) {
+ Mxfree(a->stack);
+ }
+ Mxfree(a);
}
-sa_tree
-copy_sa_tree(sa_tree b) {
- int h,m,l;
- sa_tree a = (sa_tree)Mxmalloc_array(sa_tree_head,1);
- a->stack_step = b->stack_step;
- a->stack_size = b->stack_size;
- a->dflt = b->dflt;
- a->stack = NULL;
- a->stack_ptr = 0;
- a->tree = NULL;
- if (b->tree !=NULL) {
- a->tree = (sa_tree_item ***)Mxmalloc_array(void *,HIGHPART);
- for (h=0; h<HIGHPART;h++ ) {
- if (b->tree[h] != NULL) {
- a->tree[h]=(sa_tree_item **)Mxmalloc_array(void *,MIDPART);
- for (m=0; m<MIDPART; m++ ) {
- if (b->tree[h][m]!=NULL) {
- a->tree[h][m]=Mxmalloc_array(sa_tree_item,LOWPART);
- for (l=0; l<LOWPART; l++) {
- a->tree[h][m][l] = b->tree[h][m][l] ;
- }
- } else {
- a->tree[h][m] = NULL;
- }
- }
- } else {
- a->tree[h]= NULL;
- }
- }
- }
- return a;
+sa_tree copy_sa_tree(sa_tree b)
+{
+ int h, m, l;
+ sa_tree a = (sa_tree) Mxmalloc_array(sa_tree_head, 1);
+ a->stack_step = b->stack_step;
+ a->stack_size = b->stack_size;
+ a->dflt = b->dflt;
+ a->stack = NULL;
+ a->stack_ptr = 0;
+ a->tree = NULL;
+ if (b->tree != NULL) {
+ a->tree = (sa_tree_item ***) Mxmalloc_array(void *, HIGHPART);
+ for (h = 0; h < HIGHPART; h++) {
+ if (b->tree[h] != NULL) {
+ a->tree[h] = (sa_tree_item **) Mxmalloc_array(void *, MIDPART);
+ for (m = 0; m < MIDPART; m++) {
+ if (b->tree[h][m] != NULL) {
+ a->tree[h][m] = Mxmalloc_array(sa_tree_item, LOWPART);
+ for (l = 0; l < LOWPART; l++) {
+ a->tree[h][m][l] = b->tree[h][m][l];
+ }
+ } else {
+ a->tree[h][m] = NULL;
+ }
+ }
+ } else {
+ a->tree[h] = NULL;
+ }
+ }
+ }
+ return a;
}
-sa_tree
-new_sa_tree (integer size, sa_tree_item dflt) {
- sa_tree_head *a;
- a = (sa_tree_head *)xmalloc(sizeof(sa_tree_head));
- a->dflt = dflt;
- a->stack = NULL;
- a->tree = NULL;
- a->stack_size = size;
- a->stack_step = size;
- a->stack_ptr = 0;
- return (sa_tree)a;
+sa_tree new_sa_tree(integer size, sa_tree_item dflt)
+{
+ sa_tree_head *a;
+ a = (sa_tree_head *) xmalloc(sizeof(sa_tree_head));
+ a->dflt = dflt;
+ a->stack = NULL;
+ a->tree = NULL;
+ a->stack_size = size;
+ a->stack_step = size;
+ a->stack_ptr = 0;
+ return (sa_tree) a;
}
-void
-restore_sa_stack (sa_tree head, integer gl) {
- sa_stack_item st;
- if (head->stack == NULL)
- return;
- while (head->stack_ptr>0 && abs(head->stack[head->stack_ptr].level)>=gl) {
- st = head->stack[head->stack_ptr];
- if (st.level>0) {
- rawset_sa_item (head, st.code, st.value);
- }
- (head->stack_ptr)--;
- }
+void restore_sa_stack(sa_tree head, integer gl)
+{
+ sa_stack_item st;
+ if (head->stack == NULL)
+ return;
+ while (head->stack_ptr > 0 && abs(head->stack[head->stack_ptr].level) >= gl) {
+ st = head->stack[head->stack_ptr];
+ if (st.level > 0) {
+ rawset_sa_item(head, st.code, st.value);
+ }
+ (head->stack_ptr)--;
+ }
}
-void
-dump_sa_tree (sa_tree a) {
- boolean f;
- unsigned int x;
- int h,m,l;
- if (a == NULL)
- return;
- dump_int(a->stack_step);
- dump_int(a->dflt);
- if (a->tree != NULL) {
- for (h=0; h<HIGHPART;h++ ) {
- if (a->tree[h] != NULL) {
- f = 1; dump_qqqq(f);
- for (m=0; m<MIDPART; m++ ) {
- if (a->tree[h][m] != NULL) {
- f = 1; dump_qqqq(f);
- for (l=0;l<LOWPART;l++) {
- x = a->tree[h][m][l]; dump_int(x);
- }
- } else {
- f = 0; dump_qqqq(f);
- }
- }
- } else {
- f = 0; dump_qqqq(f);
- }
+void dump_sa_tree(sa_tree a)
+{
+ boolean f;
+ unsigned int x;
+ int h, m, l;
+ assert(a != NULL);
+ dump_int(a->stack_step);
+ dump_int(a->dflt);
+ if (a->tree != NULL) {
+ dump_int(1);
+ for (h = 0; h < HIGHPART; h++) {
+ if (a->tree[h] != NULL) {
+ f = 1;
+ dump_qqqq(f);
+ for (m = 0; m < MIDPART; m++) {
+ if (a->tree[h][m] != NULL) {
+ f = 1;
+ dump_qqqq(f);
+ for (l = 0; l < LOWPART; l++) {
+ x = a->tree[h][m][l];
+ dump_int(x);
+ }
+ } else {
+ f = 0;
+ dump_qqqq(f);
+ }
+ }
+ } else {
+ f = 0;
+ dump_qqqq(f);
+ }
+ }
+ } else {
+ dump_int(0);
}
- }
}
-sa_tree
-undump_sa_tree(void) {
- unsigned int x;
- int h,m,l;
- boolean f;
- sa_tree a = (sa_tree)Mxmalloc_array(sa_tree_head,1);
- undump_int(x) ; a->stack_step = x; a->stack_size = x;
- undump_int(x) ; a->dflt = x;
- a->stack = Mxmalloc_array(sa_stack_item,a->stack_size);
- a->stack_ptr = 0;
- a->tree = (sa_tree_item ***)Mxmalloc_array(void *,HIGHPART);
- for (h=0; h<HIGHPART;h++ ) {
- undump_qqqq(f);
- if (f>0) {
- a->tree[h]=(sa_tree_item **)Mxmalloc_array(void *,MIDPART);
- for (m=0; m<MIDPART; m++ ) {
- undump_qqqq(f);
- if (f>0) {
- a->tree[h][m]=Mxmalloc_array(sa_tree_item,LOWPART);
- for (l=0; l<LOWPART; l++) {
- undump_int(x); a->tree[h][m][l] = x;
- }
- } else {
- a->tree[h][m] = NULL;
- }
- }
- } else {
- a->tree[h]= NULL;
- }
- }
- return a;
+sa_tree undump_sa_tree(void)
+{
+ unsigned int x;
+ int h, m, l;
+ boolean f;
+ sa_tree a = (sa_tree) Mxmalloc_array(sa_tree_head, 1);
+ undump_int(x);
+ a->stack_step = x;
+ a->stack_size = x;
+ undump_int(x);
+ a->dflt = x;
+ a->stack = Mxmalloc_array(sa_stack_item, a->stack_size);
+ a->stack_ptr = 0;
+ a->tree = NULL;
+ undump_int(x);
+ if (x == 0)
+ return a;
+ a->tree = (sa_tree_item ***) Mxmalloc_array(void *, HIGHPART);
+ for (h = 0; h < HIGHPART; h++) {
+ undump_qqqq(f);
+ if (f > 0) {
+ a->tree[h] = (sa_tree_item **) Mxmalloc_array(void *, MIDPART);
+ for (m = 0; m < MIDPART; m++) {
+ undump_qqqq(f);
+ if (f > 0) {
+ a->tree[h][m] = Mxmalloc_array(sa_tree_item, LOWPART);
+ for (l = 0; l < LOWPART; l++) {
+ undump_int(x);
+ a->tree[h][m][l] = x;
+ }
+ } else {
+ a->tree[h][m] = NULL;
+ }
+ }
+ } else {
+ a->tree[h] = NULL;
+ }
+ }
+ return a;
}
-
-
diff --git a/Build/source/texk/web2c/luatexdir/managed-sa.h b/Build/source/texk/web2c/luatexdir/managed-sa.h
index b73aece81b1..880a6acd9bc 100644
--- a/Build/source/texk/web2c/luatexdir/managed-sa.h
+++ b/Build/source/texk/web2c/luatexdir/managed-sa.h
@@ -1,74 +1,74 @@
-/*
- Copyright (c) 2007 Taco Hoekwater <taco@luatex.org>
-
- This file is part of LuaTeX.
-
- LuaTeX is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- LuaTeX is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LuaTeX; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- $Id$ */
+/* managed-sa.h
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id$ */
#ifndef MANAGED_SA_H
-#define MANAGED_SA_H 1
+# define MANAGED_SA_H 1
/* the next two sets of three had better match up exactly, but using bare numbers
is easier on the C compiler */
-#define HIGHPART 128
-#define MIDPART 128
-#define LOWPART 128
+# define HIGHPART 128
+# define MIDPART 128
+# define LOWPART 128
-#define HIGHPART_PART(a) ((a>>14)&127)
-#define MIDPART_PART(a) ((a>>7)&127)
-#define LOWPART_PART(a) (a&127)
+# define HIGHPART_PART(a) (((a)>>14)&127)
+# define MIDPART_PART(a) (((a)>>7)&127)
+# define LOWPART_PART(a) ((a)&127)
-#define Mxmalloc_array(a,b) xmalloc(b*sizeof(a))
-#define Mxrealloc_array(a,b,c) xrealloc(a,c*sizeof(b))
-#define Mxfree(a) free(a); a=NULL
+# define Mxmalloc_array(a,b) xmalloc((b)*sizeof(a))
+# define Mxrealloc_array(a,b,c) xrealloc((a),(c)*sizeof(b))
+# define Mxfree(a) free(a); a=NULL
-typedef unsigned int sa_tree_item;
+typedef unsigned int sa_tree_item;
typedef struct {
- int code;
- int level;
- sa_tree_item value;
+ int code;
+ int level;
+ sa_tree_item value;
} sa_stack_item;
typedef struct {
- int stack_size; /* initial stack size */
- int stack_step; /* increment stack step */
- int stack_ptr; /* current stack point */
- int dflt; /* default item value */
- sa_tree_item *** tree; /* item tree head */
- sa_stack_item * stack; /* stack tree head */
+ int stack_size; /* initial stack size */
+ int stack_step; /* increment stack step */
+ int stack_ptr; /* current stack point */
+ int dflt; /* default item value */
+ sa_tree_item ***tree; /* item tree head */
+ sa_stack_item *stack; /* stack tree head */
} sa_tree_head;
typedef sa_tree_head *sa_tree;
-extern sa_tree_item get_sa_item (const sa_tree head, const integer n) ;
-extern void set_sa_item (sa_tree head, integer n, sa_tree_item v, integer gl) ;
+extern sa_tree_item get_sa_item(const sa_tree head, const integer n);
+extern void set_sa_item(sa_tree head, integer n, sa_tree_item v, integer gl);
-extern sa_tree new_sa_tree (integer size, sa_tree_item dflt);
+extern sa_tree new_sa_tree(integer size, sa_tree_item dflt);
-extern sa_tree copy_sa_tree (sa_tree head);
-extern void destroy_sa_tree (sa_tree head);
+extern sa_tree copy_sa_tree(sa_tree head);
+extern void destroy_sa_tree(sa_tree head);
-extern void dump_sa_tree (sa_tree a);
-extern sa_tree undump_sa_tree (void) ;
+extern void dump_sa_tree(sa_tree a);
+extern sa_tree undump_sa_tree(void);
-extern void restore_sa_stack (sa_tree a, integer gl);
-extern void clear_sa_stack (sa_tree a);
+extern void restore_sa_stack(sa_tree a, integer gl);
+extern void clear_sa_stack(sa_tree a);
#endif
diff --git a/Build/source/texk/web2c/luatexdir/mathcodes.c b/Build/source/texk/web2c/luatexdir/mathcodes.c
index 77e15e7c66c..ef5af17afc0 100644
--- a/Build/source/texk/web2c/luatexdir/mathcodes.c
+++ b/Build/source/texk/web2c/luatexdir/mathcodes.c
@@ -1,191 +1,471 @@
+/* mathnodes.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-/*
-Copyright (c) 2006 Taco Hoekwater, <taco@elvenkind.com>
+ This file is part of LuaTeX.
-This file is part of LuaTeX.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-LuaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-LuaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with LuaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id $
-*/
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "managed-sa.h"
+#include "commands.h"
-/* the 0xFFFFFFFF is a flag value */
+extern void rawset_sa_item(sa_tree head, integer n, integer v);
+
+static const char __svn_version[] =
+ "$Id$ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/mathcodes.c $";
+
+/* math codes */
+static sa_tree mathcode_head = NULL;
+
+#define MATHCODEHEAP 8
+
+static mathcodeval *mathcode_heap = NULL;
+static int mathcode_heapsize = MATHCODEHEAP;
+static int mathcode_heapptr = 0;
+
+/* the 0xFFFFFFFF is a flag value */
#define MATHCODESTACK 8
#define MATHCODEDEFAULT 0xFFFFFFFF
-static sa_tree mathcode_head = NULL;
+/* delcodes */
+
+static sa_tree delcode_head = NULL;
-typedef struct delcodeval {
- integer valuea;
- integer valueb;
-} delcodeval;
+#define DELCODEHEAP 8
-/* delcodes are a bit more work */
+static delcodeval *delcode_heap = NULL;
+static int delcode_heapsize = DELCODEHEAP;
+static int delcode_heapptr = 0;
#define DELCODESTACK 4
#define DELCODEDEFAULT 0xFFFFFFFF
-static sa_tree delcode_head = NULL;
+/* some helpers for mathcode printing */
+
+#define print_hex_digit(A) do { \
+ if ((A)>=10) print_char('A'+(A)-10); \
+ else print_char('0'+(A)); \
+ } while (0)
+
+#define two_hex(A) do { \
+ print_hex_digit((A)/16); \
+ print_hex_digit((A)%16); \
+ } while (0)
+
+#define four_hex(A) do { \
+ two_hex((A)/256); \
+ two_hex((A)%256); \
+ } while (0)
+
+#define six_hex(A) do { \
+ two_hex((A)/65536); \
+ two_hex(((A)%65536)/256); \
+ two_hex((A)%256); \
+ } while (0)
+
+void show_mathcode_value(mathcodeval c)
+{
+ if (c.origin_value == aleph_mathcode) {
+ print_char('"');
+ print_hex_digit(c.class_value);
+ two_hex(c.family_value);
+ four_hex(c.character_value);
+ } else if (c.origin_value == xetex_mathcode) {
+ print_char('"');
+ print_hex_digit(c.class_value);
+ print_char('"');
+ two_hex(c.family_value);
+ print_char('"');
+ six_hex(c.character_value);
+ } else if (c.origin_value == xetexnum_mathcode) {
+ int m;
+ m = (c.class_value + (c.family_value * 8)) * 2097152 +
+ c.character_value;
+ print_int(m);
+ } else {
+ print_char('"');
+ print_hex_digit(c.class_value);
+ print_hex_digit(c.family_value);
+ two_hex(c.character_value);
+ }
+}
-#define DELCODEHEAP 8
-static delcodeval * delcode_heap = NULL;
-static int delcode_heapsize = DELCODEHEAP;
-static int delcode_heapptr = 0;
+void show_mathcode(integer n)
+{
+ mathcodeval c = get_math_code(n);
+ if (c.origin_value == aleph_mathcode) {
+ tprint_esc("omathcode");
+ } else if (c.origin_value == xetex_mathcode) {
+ tprint_esc("Umathcode");
+ } else if (c.origin_value == xetexnum_mathcode) {
+ tprint_esc("Umathcodenum");
+ } else {
+ tprint_esc("mathcode");
+ }
+ print_int(n);
+ print_char('=');
+ show_mathcode_value(c);
+}
-void
-unsavemathcode (quarterword gl) {
- restore_sa_stack(mathcode_head,gl);
+void unsavemathcode(quarterword gl)
+{
+ sa_stack_item st;
+ if (mathcode_head->stack == NULL)
+ return;
+ while (mathcode_head->stack_ptr > 0 &&
+ abs(mathcode_head->stack[mathcode_head->stack_ptr].level)
+ >= (integer) gl) {
+ st = mathcode_head->stack[mathcode_head->stack_ptr];
+ if (st.level > 0) {
+ rawset_sa_item(mathcode_head, st.code, st.value);
+ /* now do a trace message, if requested */
+ if (int_par(param_tracing_restores_code) > 0) {
+ begin_diagnostic();
+ print_char('{');
+ tprint("restoring");
+ print_char(' ');
+ show_mathcode(st.code);
+ print_char('}');
+ end_diagnostic(false);
+ }
+ }
+ (mathcode_head->stack_ptr)--;
+ }
}
-void
-set_math_code (integer n, halfword v, quarterword gl) {
- set_sa_item(mathcode_head,n,v,gl);
+void set_math_code(integer n,
+ integer commandorigin,
+ integer mathclass,
+ integer mathfamily, integer mathcharacter, quarterword level)
+{
+ mathcodeval d;
+ d.origin_value = commandorigin;
+ d.class_value = mathclass;
+ d.family_value = mathfamily;
+ d.character_value = mathcharacter;
+ if (mathcode_heapptr == mathcode_heapsize) {
+ mathcode_heapsize += MATHCODEHEAP;
+ mathcode_heap =
+ Mxrealloc_array(mathcode_heap, mathcodeval, mathcode_heapsize);
+ }
+ mathcode_heap[mathcode_heapptr] = d;
+ set_sa_item(mathcode_head, n, mathcode_heapptr, level);
+ mathcode_heapptr++;
+ if (int_par(param_tracing_assigns_code) > 0) {
+ begin_diagnostic();
+ print_char('{');
+ tprint("assigning");
+ print_char(' ');
+ show_mathcode(n);
+ print_char('}');
+ end_diagnostic(false);
+ }
}
-halfword
-get_math_code (integer n) {
- unsigned int ret;
- ret = get_sa_item(mathcode_head,n);
- if (ret==MATHCODEDEFAULT) {
- return (halfword)n;
- } else {
- return (halfword)ret;
- }
+mathcodeval get_math_code(integer n)
+{
+ unsigned int ret;
+ ret = get_sa_item(mathcode_head, n);
+ if (ret == MATHCODEDEFAULT) {
+ mathcodeval d;
+ d.class_value = 0;
+ d.family_value = 0;
+ d.origin_value = (n < 256 ? tex_mathcode :
+ (n < 65536 ? aleph_mathcode : xetex_mathcode));
+ d.character_value = n;
+ return d;
+ } else {
+ return mathcode_heap[ret];
+ }
}
-void
-initializemathcode (void) {
- mathcode_head = new_sa_tree(MATHCODESTACK,MATHCODEDEFAULT);
+
+integer get_math_code_num(integer n)
+{
+ mathcodeval mval;
+ mval = get_math_code(n);
+ if (mval.origin_value == tex_mathcode) {
+ return (mval.class_value * 16 + mval.family_value) * 256 +
+ mval.character_value;
+ } else if (mval.origin_value == aleph_mathcode) {
+ return (mval.class_value * 256 + mval.family_value) * 65536 +
+ mval.character_value;
+ } else if (mval.origin_value == xetexnum_mathcode
+ || mval.origin_value == xetex_mathcode) {
+ return (mval.class_value + (mval.family_value * 8)) * (65536 * 32) +
+ mval.character_value;
+ }
+ return 0;
}
-void
-dumpmathcode (void) {
- dump_sa_tree(mathcode_head);
+void initializemathcode(void)
+{
+ mathcode_head = new_sa_tree(MATHCODESTACK, MATHCODEDEFAULT);
+ mathcode_heap = Mxmalloc_array(mathcodeval, MATHCODEHEAP);
}
-void
-undumpmathcode (void) {
- mathcode_head = undump_sa_tree();
+void dumpmathcode(void)
+{
+ int k;
+ mathcodeval d;
+ dump_sa_tree(mathcode_head);
+ dump_int(mathcode_heapsize);
+ dump_int(mathcode_heapptr);
+ for (k = 0; k < mathcode_heapptr; k++) {
+ d = mathcode_heap[k];
+ dump_int(d.origin_value);
+ dump_int(d.class_value);
+ dump_int(d.family_value);
+ dump_int(d.character_value);
+ }
}
+void undumpmathcode(void)
+{
+ int k;
+ mathcodeval d;
+ mathcode_head = undump_sa_tree();
+ undump_int(mathcode_heapsize);
+ undump_int(mathcode_heapptr);
+ mathcode_heap = Mxmalloc_array(mathcodeval, mathcode_heapsize);
+ for (k = 0; k < mathcode_heapptr; k++) {
+ undump_int(d.origin_value);
+ undump_int(d.class_value);
+ undump_int(d.family_value);
+ undump_int(d.character_value);
+ mathcode_heap[k] = d;
+ }
+ d.origin_value = 0;
+ d.class_value = 0;
+ d.family_value = 0;
+ d.character_value = 0;
+ for (k = mathcode_heapptr; k < mathcode_heapsize; k++) {
+ mathcode_heap[k] = d;
+ }
+}
+
+
+void show_delcode(integer n)
+{
+ delcodeval c;
+ c = get_del_code(n);
+ if (c.origin_value == tex_mathcode) {
+ tprint_esc("delcode");
+ } else if (c.origin_value == aleph_mathcode) {
+ tprint_esc("odelcode");
+ } else if (c.origin_value == xetex_mathcode) {
+ tprint_esc("Udelcode");
+ } else if (c.origin_value == xetexnum_mathcode) {
+ tprint_esc("Udelcodenum");
+ }
+ print_int(n);
+ print_char('=');
+ if (c.small_family_value < 0) {
+ print_char('-');
+ print_char('1');
+ } else {
+ if (c.origin_value == tex_mathcode) {
+ print_char('"');
+ print_hex_digit(c.small_family_value);
+ two_hex(c.small_character_value);
+ print_hex_digit(c.large_family_value);
+ two_hex(c.large_character_value);
+ } else if (c.origin_value == aleph_mathcode) {
+ print_char('"');
+ two_hex(c.small_family_value);
+ four_hex(c.small_character_value);
+ print_char('"');
+ two_hex(c.large_family_value);
+ four_hex(c.large_character_value);
+ } else if (c.origin_value == xetex_mathcode) {
+ print_char('"');
+ two_hex(c.small_family_value);
+ six_hex(c.small_character_value);
+ } else if (c.origin_value == xetexnum_mathcode) {
+ int m;
+ m = c.small_family_value * 2097152 + c.small_character_value;
+ print_int(m);
+ }
+ }
+}
+
+
+
/* TODO: clean up the heap */
-void
-unsavedelcode (quarterword gl) {
- restore_sa_stack(delcode_head,gl);
-}
-
-void
-set_del_code (integer n, halfword v, halfword w, quarterword gl) {
- delcodeval d;
- d.valuea = v; d.valueb = w;
- if (delcode_heapptr==delcode_heapsize) {
- delcode_heapsize += DELCODEHEAP;
- delcode_heap = Mxrealloc_array(delcode_heap,delcodeval,delcode_heapsize);
- }
- delcode_heap[delcode_heapptr] = d;
- set_sa_item(delcode_head,n,delcode_heapptr,gl);
- delcode_heapptr++;
-}
-
-halfword
-get_del_code_a (integer n) {
- int ret;
- ret = get_sa_item(delcode_head,n);
- if (ret==DELCODEDEFAULT) {
- return (halfword)-1;
- } else {
- return (halfword)delcode_heap[ret].valuea;
- }
-}
-
-halfword
-get_del_code_b (integer n) {
- unsigned int ret;
- ret = get_sa_item(delcode_head,n);
- if (ret==DELCODEDEFAULT) {
- return (halfword)-1;
- } else {
- return (halfword)delcode_heap[ret].valueb;
- }
-}
-
-void
-initializedelcode (void) {
- delcode_head = new_sa_tree(DELCODESTACK,DELCODEDEFAULT);
- delcode_heap = Mxmalloc_array(delcodeval,DELCODEHEAP);
-}
-
-void
-dumpdelcode (void) {
- int k;
- delcodeval d;
- dump_sa_tree(delcode_head);
- dump_int(delcode_heapsize);
- dump_int(delcode_heapptr);
- for (k=0;k<delcode_heapptr;k++) {
- d = delcode_heap[k];
- dump_int(d.valuea);
- dump_int(d.valueb);
- }
-}
-
-void
-undumpdelcode (void) {
- int k;
- delcodeval d;
- delcode_head = undump_sa_tree();
- undump_int(delcode_heapsize);
- undump_int(delcode_heapptr);
- delcode_heap = Mxmalloc_array(delcodeval,delcode_heapsize);
- for (k=0;k<delcode_heapptr;k++) {
- undump_int(d.valuea);
- undump_int(d.valueb);
- delcode_heap[k] = d;
- }
- d.valuea=0; d.valueb=0;
- for (k=delcode_heapptr;k<delcode_heapsize;k++) {
- delcode_heap[k] = d;
- }
-}
-
-void
-unsave_math_codes (quarterword grouplevel) {
- unsavemathcode(grouplevel);
- unsavedelcode(grouplevel);
-}
-
-void initialize_math_codes (void) {
- initializemathcode();
- initializedelcode();
-}
-
-void dump_math_codes(void) {
- dumpmathcode();
- dumpdelcode();
-}
-
-void undump_math_codes(void) {
- undumpmathcode();
- undumpdelcode();
+void unsavedelcode(quarterword gl)
+{
+ sa_stack_item st;
+ if (delcode_head->stack == NULL)
+ return;
+ while (delcode_head->stack_ptr > 0 &&
+ abs(delcode_head->stack[delcode_head->stack_ptr].level)
+ >= (integer) gl) {
+ st = delcode_head->stack[delcode_head->stack_ptr];
+ if (st.level > 0) {
+ rawset_sa_item(delcode_head, st.code, st.value);
+ /* now do a trace message, if requested */
+ if (int_par(param_tracing_restores_code) > 0) {
+ begin_diagnostic();
+ print_char('{');
+ tprint("restoring");
+ print_char(' ');
+ show_delcode(st.code);
+ print_char('}');
+ end_diagnostic(false);
+ }
+ }
+ (delcode_head->stack_ptr)--;
+ }
+
+}
+
+void set_del_code(integer n,
+ integer commandorigin,
+ integer smathfamily,
+ integer smathcharacter,
+ integer lmathfamily, integer lmathcharacter, quarterword gl)
+{
+ delcodeval d;
+ d.class_value = 0;
+ d.origin_value = commandorigin;
+ d.small_family_value = smathfamily;
+ d.small_character_value = smathcharacter;
+ d.large_family_value = lmathfamily;
+ d.large_character_value = lmathcharacter;
+ if (delcode_heapptr == delcode_heapsize) {
+ delcode_heapsize += DELCODEHEAP;
+ delcode_heap =
+ Mxrealloc_array(delcode_heap, delcodeval, delcode_heapsize);
+ }
+ delcode_heap[delcode_heapptr] = d;
+ set_sa_item(delcode_head, n, delcode_heapptr, gl);
+ if (int_par(param_tracing_assigns_code) > 0) {
+ begin_diagnostic();
+ print_char('{');
+ tprint("assigning");
+ print_char(' ');
+ show_delcode(n);
+ print_char('}');
+ end_diagnostic(false);
+ }
+ delcode_heapptr++;
+}
+
+delcodeval get_del_code(integer n)
+{
+ unsigned ret;
+ ret = get_sa_item(delcode_head, n);
+ if (ret == DELCODEDEFAULT) {
+ delcodeval d;
+ d.class_value = 0;
+ d.origin_value = tex_mathcode;
+ d.small_family_value = -1;
+ d.small_character_value = 0;
+ d.large_family_value = 0;
+ d.large_character_value = 0;
+ return d;
+ } else {
+ return delcode_heap[ret];
+ }
+}
+
+void initializedelcode(void)
+{
+ delcode_head = new_sa_tree(DELCODESTACK, DELCODEDEFAULT);
+ delcode_heap = Mxmalloc_array(delcodeval, DELCODEHEAP);
+}
+
+void dumpdelcode(void)
+{
+ int k;
+ delcodeval d;
+ dump_sa_tree(delcode_head);
+ dump_int(delcode_heapsize);
+ dump_int(delcode_heapptr);
+ for (k = 0; k < delcode_heapptr; k++) {
+ d = delcode_heap[k];
+ dump_int(d.origin_value);
+ dump_int(d.class_value);
+ dump_int(d.small_family_value);
+ dump_int(d.small_character_value);
+ dump_int(d.large_family_value);
+ dump_int(d.large_character_value);
+ }
+}
+
+void undumpdelcode(void)
+{
+ int k;
+ delcodeval d;
+ delcode_head = undump_sa_tree();
+ undump_int(delcode_heapsize);
+ undump_int(delcode_heapptr);
+ delcode_heap = Mxmalloc_array(delcodeval, delcode_heapsize);
+ for (k = 0; k < delcode_heapptr; k++) {
+ undump_int(d.origin_value);
+ undump_int(d.class_value);
+ undump_int(d.small_family_value);
+ undump_int(d.small_character_value);
+ undump_int(d.large_family_value);
+ undump_int(d.large_character_value);
+ delcode_heap[k] = d;
+ }
+ d.origin_value = tex_mathcode;
+ d.class_value = 0;
+ d.small_family_value = -1;
+ d.small_character_value = 0;
+ d.large_family_value = 0;
+ d.large_character_value = 0;
+ for (k = delcode_heapptr; k < delcode_heapsize; k++) {
+ delcode_heap[k] = d;
+ }
+}
+
+void unsave_math_codes(quarterword grouplevel)
+{
+ unsavemathcode(grouplevel);
+ unsavedelcode(grouplevel);
+}
+
+void initialize_math_codes(void)
+{
+ initializemathcode();
+ initializedelcode();
+}
+
+void free_math_codes(void)
+{
+ destroy_sa_tree(mathcode_head);
+ xfree(mathcode_heap);
+ destroy_sa_tree(delcode_head);
+ xfree(delcode_heap);
+}
+
+void dump_math_codes(void)
+{
+ dumpmathcode();
+ dumpdelcode();
+}
+
+void undump_math_codes(void)
+{
+ undumpmathcode();
+ undumpdelcode();
}
diff --git a/Build/source/texk/web2c/luatexdir/mp/avl.c b/Build/source/texk/web2c/luatexdir/mp/avl.c
new file mode 100644
index 00000000000..703c4b2e72d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/mp/avl.c
@@ -0,0 +1,792 @@
+/* Produced by texiweb from libavl.w on 2003/01/06 at 18:07. */
+
+/* libavl - library for manipulation of binary trees.
+ Copyright (C) 1998-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The author may be contacted at <blp@gnu.org> on the Internet, or
+ write to Ben Pfaff, Stanford University, Computer Science Dept., 353
+ Serra Mall, Stanford CA 94305, USA.
+*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "avl.h"
+
+/* Creates and returns a new table
+ with comparison function |compare| using parameter |param|
+ and memory allocator |allocator|.
+ Returns |NULL| if memory allocation failed. */
+struct avl_table *avl_create (avl_comparison_func * compare, void *param,
+ struct libavl_allocator *allocator)
+{
+ struct avl_table *tree;
+
+ assert (compare != NULL);
+
+ if (allocator == NULL)
+ allocator = &avl_allocator_default;
+
+ tree = allocator->libavl_malloc (allocator, sizeof *tree);
+ if (tree == NULL)
+ return NULL;
+
+ tree->avl_root = NULL;
+ tree->avl_compare = compare;
+ tree->avl_param = param;
+ tree->avl_alloc = allocator;
+ tree->avl_count = 0;
+ tree->avl_generation = 0;
+
+ return tree;
+}
+
+/* Search |tree| for an item matching |item|, and return it if found.
+ Otherwise return |NULL|. */
+void *avl_find (const struct avl_table *tree, const void *item)
+{
+ const struct avl_node *p;
+
+ assert (tree != NULL && item != NULL);
+ for (p = tree->avl_root; p != NULL;) {
+ int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param);
+
+ if (cmp < 0)
+ p = p->avl_link[0];
+ else if (cmp > 0)
+ p = p->avl_link[1];
+ else /* |cmp == 0| */
+ return p->avl_data;
+ }
+
+ return NULL;
+}
+
+/* Inserts |item| into |tree| and returns a pointer to |item|'s address.
+ If a duplicate item is found in the tree,
+ returns a pointer to the duplicate without inserting |item|.
+ Returns |NULL| in case of memory allocation failure. */
+void **avl_probe (struct avl_table *tree, void *item)
+{
+ struct avl_node *y, *z; /* Top node to update balance factor, and parent. */
+ struct avl_node *p, *q; /* Iterator, and parent. */
+ struct avl_node *n; /* Newly inserted node. */
+ struct avl_node *w; /* New root of rebalanced subtree. */
+ int dir; /* Direction to descend. */
+
+ unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */
+ int k = 0; /* Number of cached results. */
+
+ assert (tree != NULL && item != NULL);
+
+ z = (struct avl_node *) &tree->avl_root;
+ y = tree->avl_root;
+ dir = 0;
+ for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir]) {
+ int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param);
+ if (cmp == 0)
+ return &p->avl_data;
+
+ if (p->avl_balance != 0)
+ z = q, y = p, k = 0;
+ da[k++] = dir = cmp > 0;
+ }
+
+ n = q->avl_link[dir] =
+ tree->avl_alloc->libavl_malloc (tree->avl_alloc, sizeof *n);
+ if (n == NULL)
+ return NULL;
+
+ tree->avl_count++;
+ n->avl_data = item;
+ n->avl_link[0] = n->avl_link[1] = NULL;
+ n->avl_balance = 0;
+ if (y == NULL)
+ return &n->avl_data;
+
+ for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++)
+ if (da[k] == 0)
+ p->avl_balance--;
+ else
+ p->avl_balance++;
+
+ if (y->avl_balance == -2) {
+ struct avl_node *x = y->avl_link[0];
+ if (x->avl_balance == -1) {
+ w = x;
+ y->avl_link[0] = x->avl_link[1];
+ x->avl_link[1] = y;
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ assert (x->avl_balance == +1);
+ w = x->avl_link[1];
+ x->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = x;
+ y->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = y;
+ if (w->avl_balance == -1)
+ x->avl_balance = 0, y->avl_balance = +1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == +1| */
+ x->avl_balance = -1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ }
+ } else if (y->avl_balance == +2) {
+ struct avl_node *x = y->avl_link[1];
+ if (x->avl_balance == +1) {
+ w = x;
+ y->avl_link[1] = x->avl_link[0];
+ x->avl_link[0] = y;
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ assert (x->avl_balance == -1);
+ w = x->avl_link[0];
+ x->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = x;
+ y->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = y;
+ if (w->avl_balance == +1)
+ x->avl_balance = 0, y->avl_balance = -1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == -1| */
+ x->avl_balance = +1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ }
+ } else
+ return &n->avl_data;
+ z->avl_link[y != z->avl_link[0]] = w;
+
+ tree->avl_generation++;
+ return &n->avl_data;
+}
+
+/* Inserts |item| into |table|.
+ Returns |NULL| if |item| was successfully inserted
+ or if a memory allocation error occurred.
+ Otherwise, returns the duplicate item. */
+void *avl_insert (struct avl_table *table, void *item)
+{
+ void **p = avl_probe (table, item);
+ return p == NULL || *p == item ? NULL : *p;
+}
+
+/* Inserts |item| into |table|, replacing any duplicate item.
+ Returns |NULL| if |item| was inserted without replacing a duplicate,
+ or if a memory allocation error occurred.
+ Otherwise, returns the item that was replaced. */
+void *avl_replace (struct avl_table *table, void *item)
+{
+ void **p = avl_probe (table, item);
+ if (p == NULL || *p == item)
+ return NULL;
+ else {
+ void *r = *p;
+ *p = item;
+ return r;
+ }
+}
+
+/* Deletes from |tree| and returns an item matching |item|.
+ Returns a null pointer if no matching item found. */
+void *avl_delete (struct avl_table *tree, const void *item)
+{
+ /* Stack of nodes. */
+ struct avl_node *pa[AVL_MAX_HEIGHT]; /* Nodes. */
+ unsigned char da[AVL_MAX_HEIGHT]; /* |avl_link[]| indexes. */
+ int k; /* Stack pointer. */
+
+ struct avl_node *p; /* Traverses tree to find node to delete. */
+ int cmp; /* Result of comparison between |item| and |p|. */
+
+ assert (tree != NULL && item != NULL);
+
+ k = 0;
+ p = (struct avl_node *) &tree->avl_root;
+ for (cmp = -1; cmp != 0;
+ cmp = tree->avl_compare (item, p->avl_data, tree->avl_param)) {
+ int dir = cmp > 0;
+
+ pa[k] = p;
+ da[k++] = dir;
+
+ p = p->avl_link[dir];
+ if (p == NULL)
+ return NULL;
+ }
+ item = p->avl_data;
+
+ if (p->avl_link[1] == NULL)
+ pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0];
+ else {
+ struct avl_node *r = p->avl_link[1];
+ if (r->avl_link[0] == NULL) {
+ r->avl_link[0] = p->avl_link[0];
+ r->avl_balance = p->avl_balance;
+ pa[k - 1]->avl_link[da[k - 1]] = r;
+ da[k] = 1;
+ pa[k++] = r;
+ } else {
+ struct avl_node *s;
+ int j = k++;
+
+ for (;;) {
+ da[k] = 0;
+ pa[k++] = r;
+ s = r->avl_link[0];
+ if (s->avl_link[0] == NULL)
+ break;
+
+ r = s;
+ }
+
+ s->avl_link[0] = p->avl_link[0];
+ r->avl_link[0] = s->avl_link[1];
+ s->avl_link[1] = p->avl_link[1];
+ s->avl_balance = p->avl_balance;
+
+ pa[j - 1]->avl_link[da[j - 1]] = s;
+ da[j] = 1;
+ pa[j] = s;
+ }
+ }
+
+ tree->avl_alloc->libavl_free (tree->avl_alloc, p);
+
+ assert (k > 0);
+ while (--k > 0) {
+ struct avl_node *y = pa[k];
+
+ if (da[k] == 0) {
+ y->avl_balance++;
+ if (y->avl_balance == +1)
+ break;
+ else if (y->avl_balance == +2) {
+ struct avl_node *x = y->avl_link[1];
+ if (x->avl_balance == -1) {
+ struct avl_node *w;
+ assert (x->avl_balance == -1);
+ w = x->avl_link[0];
+ x->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = x;
+ y->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = y;
+ if (w->avl_balance == +1)
+ x->avl_balance = 0, y->avl_balance = -1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == -1| */
+ x->avl_balance = +1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ pa[k - 1]->avl_link[da[k - 1]] = w;
+ } else {
+ y->avl_link[1] = x->avl_link[0];
+ x->avl_link[0] = y;
+ pa[k - 1]->avl_link[da[k - 1]] = x;
+ if (x->avl_balance == 0) {
+ x->avl_balance = -1;
+ y->avl_balance = +1;
+ break;
+ } else
+ x->avl_balance = y->avl_balance = 0;
+ }
+ }
+ } else {
+ y->avl_balance--;
+ if (y->avl_balance == -1)
+ break;
+ else if (y->avl_balance == -2) {
+ struct avl_node *x = y->avl_link[0];
+ if (x->avl_balance == +1) {
+ struct avl_node *w;
+ assert (x->avl_balance == +1);
+ w = x->avl_link[1];
+ x->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = x;
+ y->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = y;
+ if (w->avl_balance == -1)
+ x->avl_balance = 0, y->avl_balance = +1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == +1| */
+ x->avl_balance = -1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ pa[k - 1]->avl_link[da[k - 1]] = w;
+ } else {
+ y->avl_link[0] = x->avl_link[1];
+ x->avl_link[1] = y;
+ pa[k - 1]->avl_link[da[k - 1]] = x;
+ if (x->avl_balance == 0) {
+ x->avl_balance = +1;
+ y->avl_balance = -1;
+ break;
+ } else
+ x->avl_balance = y->avl_balance = 0;
+ }
+ }
+ }
+ }
+
+ tree->avl_count--;
+ tree->avl_generation++;
+ return (void *) item;
+}
+
+/* Refreshes the stack of parent pointers in |trav|
+ and updates its generation number. */
+static void trav_refresh (struct avl_traverser *trav)
+{
+ assert (trav != NULL);
+
+ trav->avl_generation = trav->avl_table->avl_generation;
+
+ if (trav->avl_node != NULL) {
+ avl_comparison_func *cmp = trav->avl_table->avl_compare;
+ void *param = trav->avl_table->avl_param;
+ struct avl_node *node = trav->avl_node;
+ struct avl_node *i;
+
+ trav->avl_height = 0;
+ for (i = trav->avl_table->avl_root; i != node;) {
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ assert (i != NULL);
+
+ trav->avl_stack[trav->avl_height++] = i;
+ i = i->avl_link[cmp (node->avl_data, i->avl_data, param) > 0];
+ }
+ }
+}
+
+/* Initializes |trav| for use with |tree|
+ and selects the null node. */
+void avl_t_init (struct avl_traverser *trav, struct avl_table *tree)
+{
+ trav->avl_table = tree;
+ trav->avl_node = NULL;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+}
+
+/* Initializes |trav| for |tree|
+ and selects and returns a pointer to its least-valued item.
+ Returns |NULL| if |tree| contains no nodes. */
+void *avl_t_first (struct avl_traverser *trav, struct avl_table *tree)
+{
+ struct avl_node *x;
+
+ assert (tree != NULL && trav != NULL);
+
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+
+ x = tree->avl_root;
+ if (x != NULL)
+ while (x->avl_link[0] != NULL) {
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+ }
+ trav->avl_node = x;
+
+ return x != NULL ? x->avl_data : NULL;
+}
+
+/* Initializes |trav| for |tree|
+ and selects and returns a pointer to its greatest-valued item.
+ Returns |NULL| if |tree| contains no nodes. */
+void *avl_t_last (struct avl_traverser *trav, struct avl_table *tree)
+{
+ struct avl_node *x;
+
+ assert (tree != NULL && trav != NULL);
+
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+
+ x = tree->avl_root;
+ if (x != NULL)
+ while (x->avl_link[1] != NULL) {
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+ }
+ trav->avl_node = x;
+
+ return x != NULL ? x->avl_data : NULL;
+}
+
+/* Searches for |item| in |tree|.
+ If found, initializes |trav| to the item found and returns the item
+ as well.
+ If there is no matching item, initializes |trav| to the null item
+ and returns |NULL|. */
+void *avl_t_find (struct avl_traverser *trav, struct avl_table *tree,
+ void *item)
+{
+ struct avl_node *p, *q;
+
+ assert (trav != NULL && tree != NULL && item != NULL);
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+ for (p = tree->avl_root; p != NULL; p = q) {
+ int cmp = tree->avl_compare (item, p->avl_data, tree->avl_param);
+
+ if (cmp < 0)
+ q = p->avl_link[0];
+ else if (cmp > 0)
+ q = p->avl_link[1];
+ else { /* |cmp == 0| */
+
+ trav->avl_node = p;
+ return p->avl_data;
+ }
+
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = p;
+ }
+
+ trav->avl_height = 0;
+ trav->avl_node = NULL;
+ return NULL;
+}
+
+/* Attempts to insert |item| into |tree|.
+ If |item| is inserted successfully, it is returned and |trav| is
+ initialized to its location.
+ If a duplicate is found, it is returned and |trav| is initialized to
+ its location. No replacement of the item occurs.
+ If a memory allocation failure occurs, |NULL| is returned and |trav|
+ is initialized to the null item. */
+void *avl_t_insert (struct avl_traverser *trav, struct avl_table *tree,
+ void *item)
+{
+ void **p;
+
+ assert (trav != NULL && tree != NULL && item != NULL);
+
+ p = avl_probe (tree, item);
+ if (p != NULL) {
+ trav->avl_table = tree;
+ trav->avl_node = ((struct avl_node *)
+ ((char *) p - offsetof (struct avl_node, avl_data)));
+ trav->avl_generation = tree->avl_generation - 1;
+ return *p;
+ } else {
+ avl_t_init (trav, tree);
+ return NULL;
+ }
+}
+
+/* Initializes |trav| to have the same current node as |src|. */
+void *avl_t_copy (struct avl_traverser *trav, const struct avl_traverser *src)
+{
+ assert (trav != NULL && src != NULL);
+
+ if (trav != src) {
+ trav->avl_table = src->avl_table;
+ trav->avl_node = src->avl_node;
+ trav->avl_generation = src->avl_generation;
+ if (trav->avl_generation == trav->avl_table->avl_generation) {
+ trav->avl_height = src->avl_height;
+ memcpy (trav->avl_stack, (const void *) src->avl_stack,
+ sizeof *trav->avl_stack * trav->avl_height);
+ }
+ }
+
+ return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
+}
+
+/* Returns the next data item in inorder
+ within the tree being traversed with |trav|,
+ or if there are no more data items returns |NULL|. */
+void *avl_t_next (struct avl_traverser *trav)
+{
+ struct avl_node *x;
+
+ assert (trav != NULL);
+
+ if (trav->avl_generation != trav->avl_table->avl_generation)
+ trav_refresh (trav);
+
+ x = trav->avl_node;
+ if (x == NULL) {
+ return avl_t_first (trav, trav->avl_table);
+ } else if (x->avl_link[1] != NULL) {
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+
+ while (x->avl_link[0] != NULL) {
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+ }
+ } else {
+ struct avl_node *y;
+
+ do {
+ if (trav->avl_height == 0) {
+ trav->avl_node = NULL;
+ return NULL;
+ }
+
+ y = x;
+ x = trav->avl_stack[--trav->avl_height];
+ }
+ while (y == x->avl_link[1]);
+ }
+ trav->avl_node = x;
+
+ return x->avl_data;
+}
+
+/* Returns the previous data item in inorder
+ within the tree being traversed with |trav|,
+ or if there are no more data items returns |NULL|. */
+void *avl_t_prev (struct avl_traverser *trav)
+{
+ struct avl_node *x;
+
+ assert (trav != NULL);
+
+ if (trav->avl_generation != trav->avl_table->avl_generation)
+ trav_refresh (trav);
+
+ x = trav->avl_node;
+ if (x == NULL) {
+ return avl_t_last (trav, trav->avl_table);
+ } else if (x->avl_link[0] != NULL) {
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+
+ while (x->avl_link[1] != NULL) {
+ assert (trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+ }
+ } else {
+ struct avl_node *y;
+
+ do {
+ if (trav->avl_height == 0) {
+ trav->avl_node = NULL;
+ return NULL;
+ }
+
+ y = x;
+ x = trav->avl_stack[--trav->avl_height];
+ }
+ while (y == x->avl_link[0]);
+ }
+ trav->avl_node = x;
+
+ return x->avl_data;
+}
+
+/* Returns |trav|'s current item. */
+void *avl_t_cur (struct avl_traverser *trav)
+{
+ assert (trav != NULL);
+
+ return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
+}
+
+/* Replaces the current item in |trav| by |new| and returns the item replaced.
+ |trav| must not have the null item selected.
+ The new item must not upset the ordering of the tree. */
+void *avl_t_replace (struct avl_traverser *trav, void *new)
+{
+ void *old;
+
+ assert (trav != NULL && trav->avl_node != NULL && new != NULL);
+ old = trav->avl_node->avl_data;
+ trav->avl_node->avl_data = new;
+ return old;
+}
+
+static void
+copy_error_recovery (struct avl_node **stack, int height,
+ struct avl_table *new, avl_item_func * destroy)
+{
+ assert (stack != NULL && height >= 0 && new != NULL);
+
+ for (; height > 2; height -= 2)
+ stack[height - 1]->avl_link[1] = NULL;
+ avl_destroy (new, destroy);
+}
+
+/* Copies |org| to a newly created tree, which is returned.
+ If |copy != NULL|, each data item in |org| is first passed to |copy|,
+ and the return values are inserted into the tree,
+ with |NULL| return values taken as indications of failure.
+ On failure, destroys the partially created new tree,
+ applying |destroy|, if non-null, to each item in the new tree so far,
+ and returns |NULL|.
+ If |allocator != NULL|, it is used for allocation in the new tree.
+ Otherwise, the same allocator used for |org| is used. */
+struct avl_table *avl_copy (const struct avl_table *org, avl_copy_func * copy,
+ avl_item_func * destroy,
+ struct libavl_allocator *allocator)
+{
+ struct avl_node *stack[2 * (AVL_MAX_HEIGHT + 1)];
+ int height = 0;
+
+ struct avl_table *new;
+ const struct avl_node *x;
+ struct avl_node *y;
+
+ assert (org != NULL);
+ new = avl_create (org->avl_compare, org->avl_param,
+ allocator != NULL ? allocator : org->avl_alloc);
+ if (new == NULL)
+ return NULL;
+ new->avl_count = org->avl_count;
+ if (new->avl_count == 0)
+ return new;
+
+ x = (const struct avl_node *) &org->avl_root;
+ y = (struct avl_node *) &new->avl_root;
+ for (;;) {
+ while (x->avl_link[0] != NULL) {
+ assert (height < 2 * (AVL_MAX_HEIGHT + 1));
+
+ y->avl_link[0] =
+ new->avl_alloc->libavl_malloc (new->avl_alloc,
+ sizeof *y->avl_link[0]);
+ if (y->avl_link[0] == NULL) {
+ if (y != (struct avl_node *) &new->avl_root) {
+ y->avl_data = NULL;
+ y->avl_link[1] = NULL;
+ }
+
+ copy_error_recovery (stack, height, new, destroy);
+ return NULL;
+ }
+
+ stack[height++] = (struct avl_node *) x;
+ stack[height++] = y;
+ x = x->avl_link[0];
+ y = y->avl_link[0];
+ }
+ y->avl_link[0] = NULL;
+
+ for (;;) {
+ y->avl_balance = x->avl_balance;
+ if (copy == NULL)
+ y->avl_data = x->avl_data;
+ else {
+ y->avl_data = copy (x->avl_data, org->avl_param);
+ if (y->avl_data == NULL) {
+ y->avl_link[1] = NULL;
+ copy_error_recovery (stack, height, new, destroy);
+ return NULL;
+ }
+ }
+
+ if (x->avl_link[1] != NULL) {
+ y->avl_link[1] =
+ new->avl_alloc->libavl_malloc (new->avl_alloc,
+ sizeof *y->avl_link[1]);
+ if (y->avl_link[1] == NULL) {
+ copy_error_recovery (stack, height, new, destroy);
+ return NULL;
+ }
+
+ x = x->avl_link[1];
+ y = y->avl_link[1];
+ break;
+ } else
+ y->avl_link[1] = NULL;
+
+ if (height <= 2)
+ return new;
+
+ y = stack[--height];
+ x = stack[--height];
+ }
+ }
+}
+
+/* Frees storage allocated for |tree|.
+ If |destroy != NULL|, applies it to each data item in inorder. */
+void avl_destroy (struct avl_table *tree, avl_item_func * destroy)
+{
+ struct avl_node *p, *q;
+
+ assert (tree != NULL);
+
+ for (p = tree->avl_root; p != NULL; p = q)
+ if (p->avl_link[0] == NULL) {
+ q = p->avl_link[1];
+ if (destroy != NULL && p->avl_data != NULL)
+ destroy (p->avl_data, tree->avl_param);
+ tree->avl_alloc->libavl_free (tree->avl_alloc, p);
+ } else {
+ q = p->avl_link[0];
+ p->avl_link[0] = q->avl_link[1];
+ q->avl_link[1] = p;
+ }
+
+ tree->avl_alloc->libavl_free (tree->avl_alloc, tree);
+}
+
+/* Allocates |size| bytes of space using |malloc()|.
+ Returns a null pointer if allocation fails. */
+void *avl_malloc (struct libavl_allocator *allocator, size_t size)
+{
+ assert (allocator != NULL && size > 0);
+ return malloc (size);
+}
+
+/* Frees |block|. */
+void avl_free (struct libavl_allocator *allocator, void *block)
+{
+ assert (allocator != NULL && block != NULL);
+ free (block);
+}
+
+/* Default memory allocator that uses |malloc()| and |free()|. */
+struct libavl_allocator avl_allocator_default = {
+ avl_malloc,
+ avl_free
+};
+
+#undef NDEBUG
+#include <assert.h>
+
+/* Asserts that |avl_insert()| succeeds at inserting |item| into |table|. */
+void
+ (avl_assert_insert) (struct avl_table * table, void *item) {
+ void **p = avl_probe (table, item);
+ assert (p != NULL && *p == item);
+}
+
+/* Asserts that |avl_delete()| really removes |item| from |table|,
+ and returns the removed item. */
+void *(avl_assert_delete) (struct avl_table * table, void *item) {
+ void *p = avl_delete (table, item);
+ assert (p != NULL);
+ return p;
+}
diff --git a/Build/source/texk/web2c/luatexdir/mp/avl.h b/Build/source/texk/web2c/luatexdir/mp/avl.h
new file mode 100644
index 00000000000..acdf8bacc53
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/mp/avl.h
@@ -0,0 +1,118 @@
+/* Produced by texiweb from libavl.w on 2003/01/06 at 18:07. */
+
+/* libavl - library for manipulation of binary trees.
+ Copyright (C) 1998-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The author may be contacted at <blp@gnu.org> on the Internet, or
+ write to Ben Pfaff, Stanford University, Computer Science Dept., 353
+ Serra Mall, Stanford CA 94305, USA.
+*/
+
+#ifndef AVL_H
+# define AVL_H 1
+
+# include <stddef.h>
+# if defined(__cplusplus)
+extern "C" {
+# endif
+
+
+/* Function types. */
+ typedef int avl_comparison_func (const void *avl_a, const void *avl_b,
+ void *avl_param);
+ typedef void avl_item_func (void *avl_item, void *avl_param);
+ typedef void *avl_copy_func (void *avl_item, void *avl_param);
+
+# ifndef LIBAVL_ALLOCATOR
+# define LIBAVL_ALLOCATOR
+/* Memory allocator. */
+ struct libavl_allocator {
+ void *(*libavl_malloc) (struct libavl_allocator *, size_t libavl_size);
+ void (*libavl_free) (struct libavl_allocator *, void *libavl_block);
+ };
+# endif
+
+/* Default memory allocator. */
+ extern struct libavl_allocator avl_allocator_default;
+ void *avl_malloc (struct libavl_allocator *, size_t);
+ void avl_free (struct libavl_allocator *, void *);
+
+/* Maximum AVL height. */
+# ifndef AVL_MAX_HEIGHT
+# define AVL_MAX_HEIGHT 32
+# endif
+
+/* Tree data structure. */
+ struct avl_table {
+ struct avl_node *avl_root; /* Tree's root. */
+ avl_comparison_func *avl_compare; /* Comparison function. */
+ void *avl_param; /* Extra argument to |avl_compare|. */
+ struct libavl_allocator *avl_alloc; /* Memory allocator. */
+ size_t avl_count; /* Number of items in tree. */
+ unsigned long avl_generation; /* Generation number. */
+ };
+
+/* An AVL tree node. */
+ struct avl_node {
+ struct avl_node *avl_link[2]; /* Subtrees. */
+ void *avl_data; /* Pointer to data. */
+ signed char avl_balance; /* Balance factor. */
+ };
+
+/* AVL traverser structure. */
+ struct avl_traverser {
+ struct avl_table *avl_table; /* Tree being traversed. */
+ struct avl_node *avl_node; /* Current node in tree. */
+ struct avl_node *avl_stack[AVL_MAX_HEIGHT];
+ /* All the nodes above |avl_node|. */
+ size_t avl_height; /* Number of nodes in |avl_parent|. */
+ unsigned long avl_generation; /* Generation number. */
+ };
+
+/* Table functions. */
+ struct avl_table *avl_create (avl_comparison_func *, void *,
+ struct libavl_allocator *);
+ struct avl_table *avl_copy (const struct avl_table *, avl_copy_func *,
+ avl_item_func *, struct libavl_allocator *);
+ void avl_destroy (struct avl_table *, avl_item_func *);
+ void **avl_probe (struct avl_table *, void *);
+ void *avl_insert (struct avl_table *, void *);
+ void *avl_replace (struct avl_table *, void *);
+ void *avl_delete (struct avl_table *, const void *);
+ void *avl_find (const struct avl_table *, const void *);
+ void avl_assert_insert (struct avl_table *, void *);
+ void *avl_assert_delete (struct avl_table *, void *);
+
+# define avl_count(table) ((size_t) (table)->avl_count)
+
+/* Table traverser functions. */
+ void avl_t_init (struct avl_traverser *, struct avl_table *);
+ void *avl_t_first (struct avl_traverser *, struct avl_table *);
+ void *avl_t_last (struct avl_traverser *, struct avl_table *);
+ void *avl_t_find (struct avl_traverser *, struct avl_table *, void *);
+ void *avl_t_insert (struct avl_traverser *, struct avl_table *, void *);
+ void *avl_t_copy (struct avl_traverser *, const struct avl_traverser *);
+ void *avl_t_next (struct avl_traverser *);
+ void *avl_t_prev (struct avl_traverser *);
+ void *avl_t_cur (struct avl_traverser *);
+ void *avl_t_replace (struct avl_traverser *, void *);
+
+# if defined(__cplusplus)
+}
+# endif
+#endif /* avl.h */
diff --git a/Build/source/texk/web2c/luatexdir/mp/lmplib.c b/Build/source/texk/web2c/luatexdir/mp/lmplib.c
new file mode 100644
index 00000000000..7bea10e1406
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/mp/lmplib.c
@@ -0,0 +1,1238 @@
+/* lmplib.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <math.h> /* temporary */
+
+#ifndef pdfTeX
+# include <lua.h>
+# include <lauxlib.h>
+# include <lualib.h>
+#else
+# include <../lua51/lua.h>
+# include <../lua51/lauxlib.h>
+# include <../lua51/lualib.h>
+#endif
+
+#include "mplib.h"
+#include "mplibps.h"
+
+ /*@unused@*/ static const char _svn_version[] =
+ "$Id: lmplib.c 1364 2008-07-04 16:09:46Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/lua/lmplib.c $";
+
+/* metatable identifiers and tests */
+
+#define MPLIB_METATABLE "MPlib"
+#define MPLIB_FIG_METATABLE "MPlib.fig"
+#define MPLIB_GR_METATABLE "MPlib.gr"
+
+#define is_mp(L,b) (MP *)luaL_checkudata(L,b,MPLIB_METATABLE)
+#define is_fig(L,b) (struct mp_edge_object **)luaL_checkudata(L,b,MPLIB_FIG_METATABLE)
+#define is_gr_object(L,b) (struct mp_graphic_object **)luaL_checkudata(L,b,MPLIB_GR_METATABLE)
+
+/* Lua string pre-hashing */
+
+#define mplib_init_S(a) do { \
+ lua_pushliteral(L,#a); \
+ mplib_##a##_ptr = (char *)lua_tostring(L,-1); \
+ mplib_##a##_index = luaL_ref (L,LUA_REGISTRYINDEX); \
+ } while (0)
+
+#define mplib_push_S(a) do { \
+ lua_rawgeti(L,LUA_REGISTRYINDEX,mplib_##a##_index); \
+ } while (0)
+
+#define mplib_is_S(a,i) (mplib_##a##_ptr==(char *)lua_tostring(L,i))
+
+#define mplib_make_S(a) \
+ static int mplib_##a##_index = 0; \
+ static char *mplib_##a##_ptr = NULL
+
+static int mplib_type_Ses[mp_special_code + 1] = { 0 }; /* [0] is not used */
+
+mplib_make_S(fill);
+mplib_make_S(outline);
+mplib_make_S(text);
+mplib_make_S(special);
+mplib_make_S(start_bounds);
+mplib_make_S(stop_bounds);
+mplib_make_S(start_clip);
+mplib_make_S(stop_clip);
+
+mplib_make_S(left_type);
+mplib_make_S(right_type);
+mplib_make_S(x_coord);
+mplib_make_S(y_coord);
+mplib_make_S(left_x);
+mplib_make_S(left_y);
+mplib_make_S(right_x);
+mplib_make_S(right_y);
+
+mplib_make_S(color);
+mplib_make_S(dash);
+mplib_make_S(depth);
+mplib_make_S(dsize);
+mplib_make_S(font);
+mplib_make_S(height);
+mplib_make_S(htap);
+mplib_make_S(linecap);
+mplib_make_S(linejoin);
+mplib_make_S(miterlimit);
+mplib_make_S(path);
+mplib_make_S(pen);
+mplib_make_S(postscript);
+mplib_make_S(prescript);
+mplib_make_S(transform);
+mplib_make_S(type);
+mplib_make_S(width);
+
+static void mplib_init_Ses(lua_State * L)
+{
+ mplib_init_S(fill);
+ mplib_init_S(outline);
+ mplib_init_S(text);
+ mplib_init_S(start_bounds);
+ mplib_init_S(stop_bounds);
+ mplib_init_S(start_clip);
+ mplib_init_S(stop_clip);
+ mplib_init_S(special);
+
+ mplib_type_Ses[mp_fill_code] = mplib_fill_index;
+ mplib_type_Ses[mp_stroked_code] = mplib_outline_index;
+ mplib_type_Ses[mp_text_code] = mplib_text_index;
+ mplib_type_Ses[mp_start_bounds_code] = mplib_start_bounds_index;
+ mplib_type_Ses[mp_stop_bounds_code] = mplib_stop_bounds_index;
+ mplib_type_Ses[mp_start_clip_code] = mplib_start_clip_index;
+ mplib_type_Ses[mp_stop_clip_code] = mplib_stop_clip_index;
+ mplib_type_Ses[mp_special_code] = mplib_special_index;
+
+ mplib_init_S(left_type);
+ mplib_init_S(right_type);
+ mplib_init_S(x_coord);
+ mplib_init_S(y_coord);
+ mplib_init_S(left_x);
+ mplib_init_S(left_y);
+ mplib_init_S(right_x);
+ mplib_init_S(right_y);
+
+ mplib_init_S(color);
+ mplib_init_S(dash);
+ mplib_init_S(depth);
+ mplib_init_S(dsize);
+ mplib_init_S(font);
+ mplib_init_S(height);
+ mplib_init_S(htap);
+ mplib_init_S(linecap);
+ mplib_init_S(linejoin);
+ mplib_init_S(miterlimit);
+ mplib_init_S(path);
+ mplib_init_S(pen);
+ mplib_init_S(postscript);
+ mplib_init_S(prescript);
+ mplib_init_S(transform);
+ mplib_init_S(type);
+ mplib_init_S(width);
+}
+
+
+/* Enumeration arrays to map MPlib enums to Lua strings */
+
+static const char *interaction_options[] =
+ { "unknown", "batch", "nonstop", "scroll", "errorstop", NULL };
+
+static const char *mplib_filetype_names[] =
+ { "term", "error", "mp", "log", "ps", "mem", "tfm", "map", "pfb", "enc", NULL };
+
+static const char *knot_type_enum[] =
+ { "endpoint", "explicit", "given", "curl", "open", "end_cycle" };
+
+static const char *fill_fields[] =
+ { "type", "path", "htap", "pen", "color", "linejoin", "miterlimit",
+ "prescript", "postscript", NULL };
+
+static const char *stroked_fields[] =
+ { "type", "path", "pen", "color", "linejoin", "miterlimit", "linecap",
+ "dash", "prescript", "postscript", NULL };
+
+static const char *text_fields[] =
+ { "type", "text", "dsize", "font", "color", "width", "height", "depth",
+ "transform", "prescript", "postscript", NULL };
+
+static const char *special_fields[] =
+ { "type", "prescript", NULL };
+
+static const char *start_bounds_fields[] =
+ { "type", "path", NULL };
+
+static const char *start_clip_fields[] =
+ { "type", "path", NULL };
+
+static const char *stop_bounds_fields[] =
+ { "type", NULL };
+
+static const char *stop_clip_fields[] =
+ { "type", NULL };
+
+static const char *no_fields[] =
+ { NULL };
+
+
+/* The list of supported MPlib options (not all make sense) */
+
+typedef enum {
+ P_ERROR_LINE, P_MAX_LINE,
+ P_MAIN_MEMORY, P_HASH_SIZE, P_PARAM_SIZE, P_IN_OPEN, P_RANDOM_SEED,
+ P_INTERACTION, P_INI_VERSION, P_MEM_NAME, P_JOB_NAME, P_FIND_FILE,
+ P__SENTINEL } mplib_parm_idx;
+
+typedef struct {
+ const char *name; /* parameter name */
+ mplib_parm_idx idx; /* parameter index */
+} mplib_parm_struct;
+
+static mplib_parm_struct mplib_parms[] = {
+ {"error_line", P_ERROR_LINE },
+ {"print_line", P_MAX_LINE },
+ {"main_memory", P_MAIN_MEMORY },
+ {"hash_size", P_HASH_SIZE },
+ {"param_size", P_PARAM_SIZE },
+ {"max_in_open", P_IN_OPEN },
+ {"random_seed", P_RANDOM_SEED },
+ {"interaction", P_INTERACTION },
+ {"ini_version", P_INI_VERSION },
+ {"mem_name", P_MEM_NAME },
+ {"job_name", P_JOB_NAME },
+ {"find_file", P_FIND_FILE },
+ {NULL, P__SENTINEL }
+};
+
+
+/* Start by defining the needed callback routines for the library */
+
+static char *mplib_find_file(MP mp, const char *fname, const char *fmode, int ftype)
+{
+ lua_State *L = (lua_State *)mp_userdata(mp);
+ lua_checkstack(L, 4);
+ lua_getfield(L, LUA_REGISTRYINDEX, "mplib_file_finder");
+ if (lua_isfunction(L, -1)) {
+ char *s = NULL, *x = NULL;
+ lua_pushstring(L, fname);
+ lua_pushstring(L, fmode);
+ if (ftype >= mp_filetype_text) {
+ lua_pushnumber(L, (lua_Number)(ftype - mp_filetype_text));
+ } else {
+ lua_pushstring(L, mplib_filetype_names[ftype]);
+ }
+ if (lua_pcall(L, 3, 1, 0) != 0) {
+ fprintf(stdout, "Error in mp.find_file: %s\n",
+ (char *) lua_tostring(L, -1));
+ return NULL;
+ }
+ x = (char *) lua_tostring(L, -1);
+ if (x != NULL)
+ s = strdup(x);
+ lua_pop(L, 1); /* pop the string */
+ return s;
+ } else {
+ lua_pop(L, 1);
+ }
+ if (fmode[0] != 'r' || (!access(fname, R_OK)) || ftype) {
+ return strdup(fname);
+ }
+ return NULL;
+}
+
+static int mplib_find_file_function(lua_State * L)
+{
+ if (!(lua_isfunction(L, -1) || lua_isnil(L, -1))) {
+ return 1; /* error */
+ }
+ lua_pushstring(L, "mplib_file_finder");
+ lua_pushvalue(L, -2);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+ return 0;
+}
+
+#define xfree(A) if ((A)!=NULL) { free((A)); A = NULL; }
+
+static int mplib_new(lua_State * L)
+{
+ MP *mp_ptr;
+ mp_ptr = lua_newuserdata(L, sizeof(MP *));
+ if (mp_ptr) {
+ int i;
+ struct MP_options *options = mp_options();
+ options->userdata = (void *) L;
+ options->noninteractive = 1; /* required ! */
+ options->find_file = mplib_find_file;
+ options->print_found_names = 1;
+ if (lua_type(L, 1) == LUA_TTABLE) {
+ for (i = 0; mplib_parms[i].name != NULL; i++) {
+ lua_getfield(L, 1, mplib_parms[i].name);
+ if (lua_isnil(L, -1)) {
+ lua_pop(L, 1);
+ continue; /* skip unset */
+ }
+ switch (mplib_parms[i].idx) {
+ case P_ERROR_LINE:
+ options->error_line = (int)lua_tointeger(L, -1);
+ if (options->error_line<60) options->error_line =60;
+ if (options->error_line>250) options->error_line = 250;
+ options->half_error_line = (options->error_line/2)+10;
+ break;
+ case P_MAX_LINE:
+ options->max_print_line = (int)lua_tointeger(L, -1);
+ if (options->max_print_line<60) options->max_print_line = 60;
+ break;
+ case P_MAIN_MEMORY:
+ options->main_memory = (int)lua_tointeger(L, -1);
+ break;
+ case P_HASH_SIZE:
+ options->hash_size = (unsigned)lua_tointeger(L, -1);
+ break;
+ case P_PARAM_SIZE:
+ options->param_size = (int)lua_tointeger(L, -1);
+ break;
+ case P_IN_OPEN:
+ options->max_in_open = (int)lua_tointeger(L, -1);
+ break;
+ case P_RANDOM_SEED:
+ options->random_seed = (int)lua_tointeger(L, -1);
+ break;
+ case P_INTERACTION:
+ options->interaction =
+ luaL_checkoption(L, -1, "errorstopmode",
+ interaction_options);
+ break;
+ case P_INI_VERSION:
+ options->ini_version = lua_toboolean(L, -1);
+ break;
+ case P_MEM_NAME:
+ options->mem_name = strdup((char *) lua_tostring(L, -1));
+ break;
+ case P_JOB_NAME:
+ options->job_name = strdup((char *) lua_tostring(L, -1));
+ break;
+ case P_FIND_FILE:
+ if (mplib_find_file_function(L)) { /* error here */
+ fprintf(stdout,
+ "Invalid arguments to mp.new({find_file=...})\n");
+ }
+ break;
+ default:
+ break;
+ }
+ lua_pop(L, 1);
+ }
+ }
+ *mp_ptr = mp_initialize(options);
+ xfree(options->command_line);
+ xfree(options->mem_name);
+ free(options);
+ if (*mp_ptr) {
+ luaL_getmetatable(L, MPLIB_METATABLE);
+ lua_setmetatable(L, -2);
+ return 1;
+ }
+ }
+ lua_pushnil(L);
+ return 1;
+}
+
+static int mplib_collect(lua_State * L)
+{
+ MP *mp_ptr = is_mp(L, 1);
+ if (*mp_ptr != NULL) {
+ (void)mp_finish(*mp_ptr);
+ *mp_ptr = NULL;
+ }
+ return 0;
+}
+
+static int mplib_tostring(lua_State * L)
+{
+ MP *mp_ptr = is_mp(L, 1);
+ if (*mp_ptr != NULL) {
+ (void)lua_pushfstring(L, "<MP %p>", *mp_ptr);
+ return 1;
+ }
+ return 0;
+}
+
+static int mplib_wrapresults(lua_State * L, mp_run_data *res, int status)
+{
+ lua_checkstack(L, 5);
+ lua_newtable(L);
+ if (res->term_out.size != 0) {
+ lua_pushstring(L, res->term_out.data);
+ lua_setfield(L, -2, "term");
+ }
+ if (res->error_out.size != 0) {
+ lua_pushstring(L, res->error_out.data);
+ lua_setfield(L, -2, "error");
+ }
+ if (res->log_out.size != 0) {
+ lua_pushstring(L, res->log_out.data);
+ lua_setfield(L, -2, "log");
+ }
+ if (res->edges != NULL) {
+ struct mp_edge_object **v;
+ struct mp_edge_object *p = res->edges;
+ int i = 1;
+ lua_newtable(L);
+ while (p != NULL) {
+ v = lua_newuserdata(L, sizeof(struct mp_edge_object *));
+ *v = p;
+ luaL_getmetatable(L, MPLIB_FIG_METATABLE);
+ lua_setmetatable(L, -2);
+ lua_rawseti(L, -2, i);
+ i++;
+ p = p->next;
+ }
+ lua_setfield(L, -2, "fig");
+ res->edges = NULL;
+ }
+ lua_pushnumber(L, (lua_Number)status);
+ lua_setfield(L, -2, "status");
+ return 1;
+}
+
+static int mplib_execute(lua_State * L)
+{
+ MP *mp_ptr = is_mp(L, 1);
+ if (*mp_ptr != NULL && lua_isstring(L, 2)) {
+ size_t l;
+ char *s = (char *) lua_tolstring(L, 2, &l);
+ int h = mp_execute(*mp_ptr, s, l);
+ mp_run_data *res = mp_rundata(*mp_ptr);
+ return mplib_wrapresults(L, res, h);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_finish(lua_State * L)
+{
+ MP *mp_ptr = is_mp(L, 1);
+ if (*mp_ptr != NULL) {
+ int i;
+ int h = mp_execute(*mp_ptr,NULL,0);
+ mp_run_data *res = mp_rundata(*mp_ptr);
+ i = mplib_wrapresults(L, res, h);
+ (void)mp_finish(*mp_ptr);
+ *mp_ptr = NULL;
+ return i;
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_char_dimension(lua_State * L, int t)
+{
+ MP *mp_ptr = is_mp(L, 1);
+ if (*mp_ptr != NULL) {
+ char *fname = (char *)luaL_checkstring(L,2);
+ int charnum = (int)luaL_checkinteger(L,3);
+ if (charnum<0 || charnum>255) {
+ lua_pushnumber(L, (lua_Number)0);
+ } else {
+ lua_pushnumber(L,(lua_Number)mp_get_char_dimension(*mp_ptr,fname,charnum,t));
+ }
+ } else {
+ lua_pushnumber(L, (lua_Number)0);
+ }
+ return 1;
+}
+
+static int mplib_charwidth(lua_State * L)
+{
+ return mplib_char_dimension(L, 'w');
+}
+
+static int mplib_chardepth(lua_State * L)
+{
+ return mplib_char_dimension(L, 'd');
+}
+
+static int mplib_charheight(lua_State * L)
+{
+ return mplib_char_dimension(L, 'h');
+}
+
+static int mplib_version(lua_State * L)
+{
+ char *s = mp_metapost_version();
+ lua_pushstring(L, s);
+ free(s);
+ return 1;
+}
+
+static int mplib_statistics(lua_State * L)
+{
+ MP *mp_ptr = is_mp(L, 1);
+ if (*mp_ptr != NULL) {
+ lua_newtable(L);
+ lua_pushnumber(L, (lua_Number)mp_memory_usage(*mp_ptr));
+ lua_setfield(L, -2, "main_memory");
+ lua_pushnumber(L, (lua_Number)mp_hash_usage(*mp_ptr));
+ lua_setfield(L, -2, "hash_size");
+ lua_pushnumber(L, (lua_Number)mp_param_usage(*mp_ptr));
+ lua_setfield(L, -2, "param_size");
+ lua_pushnumber(L, (lua_Number)mp_open_usage(*mp_ptr));
+ lua_setfield(L, -2, "max_in_open");
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+
+/* figure methods */
+
+static int mplib_fig_collect(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ if (*hh != NULL) {
+ mp_gr_toss_objects(*hh);
+ *hh = NULL;
+ }
+ return 0;
+}
+
+static int mplib_fig_body(lua_State * L)
+{
+ int i = 1;
+ struct mp_graphic_object **v;
+ struct mp_graphic_object *p;
+ struct mp_edge_object **hh = is_fig(L, 1);
+ lua_newtable(L);
+ p = (*hh)->body;
+ while (p != NULL) {
+ v = lua_newuserdata(L, sizeof(struct mp_graphic_object *));
+ *v = p;
+ luaL_getmetatable(L, MPLIB_GR_METATABLE);
+ lua_setmetatable(L, -2);
+ lua_rawseti(L, -2, i);
+ i++;
+ p = p->next;
+ }
+ (*hh)->body = NULL; /* prevent double free */
+ return 1;
+}
+
+static int mplib_fig_copy_body(lua_State * L)
+{
+ int i = 1;
+ struct mp_graphic_object **v;
+ struct mp_graphic_object *p;
+ struct mp_edge_object **hh = is_fig(L, 1);
+ lua_newtable(L);
+ p = (*hh)->body;
+ while (p != NULL) {
+ v = lua_newuserdata(L, sizeof(struct mp_graphic_object *));
+ *v = mp_gr_copy_object((*hh)->parent, p);
+ luaL_getmetatable(L, MPLIB_GR_METATABLE);
+ lua_setmetatable(L, -2);
+ lua_rawseti(L, -2, i);
+ i++;
+ p = p->next;
+ }
+ return 1;
+}
+
+
+static int mplib_fig_tostring(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ (void)lua_pushfstring(L, "<figure %p>", *hh);
+ return 1;
+}
+
+static int mplib_fig_postscript(lua_State * L)
+{
+ mp_run_data *res;
+ struct mp_edge_object **hh = is_fig(L, 1);
+ int prologues = (int)luaL_optnumber(L, 2, (lua_Number)-1);
+ int procset = (int)luaL_optnumber(L, 3, (lua_Number)-1);
+ if (mp_ps_ship_out(*hh, prologues, procset)
+ && (res = mp_rundata((*hh)->parent))
+ && (res->ps_out.size != 0)) {
+ lua_pushstring(L, res->ps_out.data);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_fig_filename(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ if (*hh != NULL) {
+ char *s = (*hh)->filename;
+ lua_pushstring(L, s);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_fig_width(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ if (*hh != NULL) {
+ lua_pushnumber(L, (double) (*hh)->width / 65536.0);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_fig_height(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ if (*hh != NULL) {
+ lua_pushnumber(L, (double) (*hh)->height / 65536.0);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_fig_depth(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ if (*hh != NULL) {
+ lua_pushnumber(L, (double) (*hh)->depth / 65536.0);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_fig_italcorr(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ if (*hh != NULL) {
+ lua_pushnumber(L, (double) (*hh)->ital_corr / 65536.0);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+static int mplib_fig_charcode(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ if (*hh != NULL) {
+ lua_pushnumber(L, (lua_Number)(*hh)->charcode);
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+
+
+static int mplib_fig_bb(lua_State * L)
+{
+ struct mp_edge_object **hh = is_fig(L, 1);
+ lua_newtable(L);
+ lua_pushnumber(L, (double) (*hh)->minx / 65536.0);
+ lua_rawseti(L, -2, 1);
+ lua_pushnumber(L, (double) (*hh)->miny / 65536.0);
+ lua_rawseti(L, -2, 2);
+ lua_pushnumber(L, (double) (*hh)->maxx / 65536.0);
+ lua_rawseti(L, -2, 3);
+ lua_pushnumber(L, (double) (*hh)->maxy / 65536.0);
+ lua_rawseti(L, -2, 4);
+ return 1;
+}
+
+/* object methods */
+
+static int mplib_gr_collect(lua_State * L)
+{
+ struct mp_graphic_object **hh = is_gr_object(L, 1);
+ if (*hh != NULL) {
+ mp_gr_toss_object(*hh);
+ *hh = NULL;
+ }
+ return 0;
+}
+
+static int mplib_gr_tostring(lua_State * L)
+{
+ struct mp_graphic_object **hh = is_gr_object(L, 1);
+ (void)lua_pushfstring(L, "<object %p>", *hh);
+ return 1;
+}
+
+#define pyth(a,b) (sqrt((a)*(a) + (b)*(b)))
+
+#define aspect_bound (10.0/65536.0)
+#define aspect_default (1.0/65536.0)
+
+static double eps = 0.0001;
+
+static double coord_range_x (mp_knot *h, double dz) {
+ double z;
+ double zlo = 0.0, zhi = 0.0;
+ mp_knot *f = h;
+ while (h != NULL) {
+ z = (double)h->x_coord;
+ if (z < zlo) zlo = z; else if (z > zhi) zhi = z;
+ z = (double)h->right_x;
+ if (z < zlo) zlo = z; else if (z > zhi) zhi = z;
+ z = (double)h->left_x;
+ if (z < zlo) zlo = z; else if (z > zhi) zhi = z;
+ h = h->next;
+ if (h==f)
+ break;
+ }
+ return (zhi - zlo <= dz ? aspect_bound : aspect_default);
+}
+
+static double coord_range_y (mp_knot *h, double dz) {
+ double z;
+ double zlo = 0.0, zhi = 0.0;
+ mp_knot *f = h;
+ while (h != NULL) {
+ z = (double)h->y_coord;
+ if (z < zlo) zlo = z; else if (z > zhi) zhi = z;
+ z = (double)h->right_y;
+ if (z < zlo) zlo = z; else if (z > zhi) zhi = z;
+ z = (double)h->left_y;
+ if (z < zlo) zlo = z; else if (z > zhi) zhi = z;
+ h = h->next;
+ if (h==f)
+ break;
+ }
+ return (zhi - zlo <= dz ? aspect_bound : aspect_default);
+}
+
+
+static int mplib_gr_peninfo(lua_State * L) {
+ double x_coord, y_coord, left_x, left_y, right_x, right_y;
+ double wx, wy;
+ double rx = 1.0, sx = 0.0, sy = 0.0, ry = 1.0, tx = 0.0, ty = 0.0;
+ double divider = 1.0;
+ double width = 1.0;
+ mp_knot *p = NULL, *path = NULL;
+ struct mp_graphic_object **hh = is_gr_object(L, -1);
+ if (!*hh) {
+ lua_pushnil(L);
+ return 1;
+ }
+ if ((*hh)->type == mp_fill_code) {
+ p = ((mp_fill_object *)(*hh))->pen_p;
+ path = ((mp_fill_object *)(*hh))->path_p;
+ } else if ((*hh)->type == mp_stroked_code) {
+ p = ((mp_stroked_object *)(*hh))->pen_p;
+ path = ((mp_stroked_object *)(*hh))->path_p;
+ }
+ if (p==NULL || path == NULL) {
+ lua_pushnil(L);
+ return 1;
+ }
+ x_coord = p->x_coord/65536.0;
+ y_coord = p->y_coord/65536.0;
+ left_x = p->left_x/65536.0;
+ left_y = p->left_y/65536.0;
+ right_x = p->right_x/65536.0;
+ right_y = p->right_y/65536.0;
+ if ((right_x == x_coord) && (left_y == y_coord)) {
+ wx = fabs(left_x - x_coord);
+ wy = fabs(right_y - y_coord);
+ } else {
+ wx = pyth(left_x - x_coord, right_x - x_coord);
+ wy = pyth(left_y - y_coord, right_y - y_coord);
+ }
+ if ((wy/coord_range_x(path, wx)) >= (wx/coord_range_y(path, wy)))
+ width = wy;
+ else
+ width = wx;
+ tx = x_coord;
+ ty = y_coord;
+ sx = left_x - tx;
+ rx = left_y - ty;
+ ry = right_x - tx;
+ sy = right_y - ty;
+ if (width !=1.0) {
+ if (width == 0.0) {
+ sx = 1.0; sy = 1.0;
+ } else {
+ rx/=width; ry/=width; sx/=width; sy/=width;
+ }
+ }
+ if (fabs(sx) < eps) sx = eps;
+ if (fabs(sy) < eps) sy = eps;
+ divider = sx*sy - rx*ry;
+ lua_newtable(L);
+ lua_pushnumber(L,width); lua_setfield(L,-2,"width");
+ lua_pushnumber(L,rx); lua_setfield(L,-2,"rx");
+ lua_pushnumber(L,sx); lua_setfield(L,-2,"sx");
+ lua_pushnumber(L,sy); lua_setfield(L,-2,"sy");
+ lua_pushnumber(L,ry); lua_setfield(L,-2,"ry");
+ lua_pushnumber(L,tx); lua_setfield(L,-2,"tx");
+ lua_pushnumber(L,ty); lua_setfield(L,-2,"ty");
+ return 1;
+}
+
+
+static int mplib_gr_fields(lua_State * L)
+{
+ const char **fields;
+ int i;
+ struct mp_graphic_object **hh = is_gr_object(L, 1);
+ if (*hh) {
+ switch ((*hh)->type) {
+ case mp_fill_code:
+ fields = fill_fields;
+ break;
+ case mp_stroked_code:
+ fields = stroked_fields;
+ break;
+ case mp_text_code:
+ fields = text_fields;
+ break;
+ case mp_special_code:
+ fields = special_fields;
+ break;
+ case mp_start_clip_code:
+ fields = start_clip_fields;
+ break;
+ case mp_start_bounds_code:
+ fields = start_bounds_fields;
+ break;
+ case mp_stop_clip_code:
+ fields = stop_clip_fields;
+ break;
+ case mp_stop_bounds_code:
+ fields = stop_bounds_fields;
+ break;
+ default:
+ fields = no_fields;
+ }
+ lua_newtable(L);
+ for (i = 0; fields[i] != NULL; i++) {
+ lua_pushstring(L, fields[i]);
+ lua_rawseti(L, -2, (i + 1));
+ }
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+
+#define mplib_push_number(L,x) lua_pushnumber(L,(lua_Number)(x)/65536.0)
+
+#define MPLIB_PATH 0
+#define MPLIB_PEN 1
+
+static void mplib_push_path(lua_State * L, struct mp_knot *h, int is_pen)
+{
+ struct mp_knot *p; /* for scanning the path */
+ int i = 1;
+ p = h;
+ if (p != NULL) {
+ lua_newtable(L);
+ do {
+ lua_createtable(L, 0, 6);
+ if (!is_pen) {
+ if (p->left_type != mp_explicit) {
+ mplib_push_S(left_type);
+ lua_pushstring(L, knot_type_enum[p->left_type]);
+ lua_rawset(L, -3);
+ }
+ if (p->right_type != mp_explicit) {
+ mplib_push_S(right_type);
+ lua_pushstring(L, knot_type_enum[p->right_type]);
+ lua_rawset(L, -3);
+ }
+ }
+ mplib_push_S(x_coord);
+ mplib_push_number(L, p->x_coord);
+ lua_rawset(L, -3);
+ mplib_push_S(y_coord);
+ mplib_push_number(L, p->y_coord);
+ lua_rawset(L, -3);
+ mplib_push_S(left_x);
+ mplib_push_number(L, p->left_x);
+ lua_rawset(L, -3);
+ mplib_push_S(left_y);
+ mplib_push_number(L, p->left_y);
+ lua_rawset(L, -3);
+ mplib_push_S(right_x);
+ mplib_push_number(L, p->right_x);
+ lua_rawset(L, -3);
+ mplib_push_S(right_y);
+ mplib_push_number(L, p->right_y);
+ lua_rawset(L, -3);
+ lua_rawseti(L, -2, i);
+ i++;
+ if (p->right_type == mp_endpoint) {
+ return;
+ }
+ p = p->next;
+ } while (p != h);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+/* this assumes that the top of the stack is a table
+ or nil already in the case
+ */
+static void mplib_push_pentype(lua_State * L, struct mp_knot *h)
+{
+ struct mp_knot *p; /* for scanning the path */
+ p = h;
+ if (p == NULL) {
+ /* do nothing */
+ } else if (p == p->next) {
+ mplib_push_S(type);
+ lua_pushstring(L, "elliptical");
+ lua_rawset(L, -3);
+ } else {
+ }
+}
+
+#define set_color_objects(pq) \
+ object_color_model = pq->color_model; \
+ object_color_a = pq->color.a_val; \
+ object_color_b = pq->color.b_val; \
+ object_color_c = pq->color.c_val; \
+ object_color_d = pq->color.d_val;
+
+
+static void mplib_push_color(lua_State * L, struct mp_graphic_object *p)
+{
+ int object_color_model;
+ int object_color_a, object_color_b, object_color_c, object_color_d;
+ if (p != NULL) {
+ if (p->type == mp_fill_code) {
+ mp_fill_object *h = (mp_fill_object *) p;
+ set_color_objects(h);
+ } else if (p->type == mp_stroked_code) {
+ mp_stroked_object *h = (mp_stroked_object *) p;
+ set_color_objects(h);
+ } else {
+ mp_text_object *h = (mp_text_object *) p;
+ set_color_objects(h);
+ }
+ lua_newtable(L);
+ if (object_color_model >= mp_grey_model) {
+ mplib_push_number(L, object_color_a);
+ lua_rawseti(L, -2, 1);
+ if (object_color_model >= mp_rgb_model) {
+ mplib_push_number(L, object_color_b);
+ lua_rawseti(L, -2, 2);
+ mplib_push_number(L, object_color_c);
+ lua_rawseti(L, -2, 3);
+ if (object_color_model == mp_cmyk_model) {
+ mplib_push_number(L, object_color_d);
+ lua_rawseti(L, -2, 4);
+ }
+ }
+ }
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+/* the dash scale is not exported, the field has no external value */
+static void mplib_push_dash(lua_State * L, struct mp_stroked_object *h)
+{
+ mp_dash_object *d;
+ double ds;
+ if (h != NULL && h->dash_p != NULL) {
+ d = h->dash_p;
+ lua_newtable(L);
+ mplib_push_number(L, d->offset);
+ lua_setfield(L, -2, "offset");
+ if (d->array != NULL) {
+ int i = 0;
+ lua_newtable(L);
+ while (*(d->array + i) != -1) {
+ ds = *(d->array + i) / 65536.0;
+ lua_pushnumber(L, ds);
+ i++;
+ lua_rawseti(L, -2, i);
+ }
+ lua_setfield(L, -2, "dashes");
+ }
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+static void mplib_push_transform(lua_State * L, struct mp_text_object *h)
+{
+ int i = 1;
+ if (h != NULL) {
+ lua_createtable(L, 6, 0);
+ mplib_push_number(L, h->tx);
+ lua_rawseti(L, -2, i);
+ i++;
+ mplib_push_number(L, h->ty);
+ lua_rawseti(L, -2, i);
+ i++;
+ mplib_push_number(L, h->txx);
+ lua_rawseti(L, -2, i);
+ i++;
+ mplib_push_number(L, h->tyx);
+ lua_rawseti(L, -2, i);
+ i++;
+ mplib_push_number(L, h->txy);
+ lua_rawseti(L, -2, i);
+ i++;
+ mplib_push_number(L, h->tyy);
+ lua_rawseti(L, -2, i);
+ i++;
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+#define FIELD(A) (mplib_is_S(A,2))
+
+static void mplib_fill(lua_State * L, struct mp_fill_object *h)
+{
+ if (FIELD(path)) {
+ mplib_push_path(L, h->path_p, MPLIB_PATH);
+ } else if (FIELD(htap)) {
+ mplib_push_path(L, h->htap_p, MPLIB_PATH);
+ } else if (FIELD(pen)) {
+ mplib_push_path(L, h->pen_p, MPLIB_PEN);
+ mplib_push_pentype(L, h->pen_p);
+ } else if (FIELD(color)) {
+ mplib_push_color(L, (mp_graphic_object *) h);
+ } else if (FIELD(linejoin)) {
+ lua_pushnumber(L, (lua_Number)h->ljoin);
+ } else if (FIELD(miterlimit)) {
+ mplib_push_number(L, h->miterlim);
+ } else if (FIELD(prescript)) {
+ lua_pushstring(L, h->pre_script);
+ } else if (FIELD(postscript)) {
+ lua_pushstring(L, h->post_script);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+static void mplib_stroked(lua_State * L, struct mp_stroked_object *h)
+{
+ if (FIELD(path)) {
+ mplib_push_path(L, h->path_p, MPLIB_PATH);
+ } else if (FIELD(pen)) {
+ mplib_push_path(L, h->pen_p, MPLIB_PEN);
+ mplib_push_pentype(L, h->pen_p);
+ } else if (FIELD(color)) {
+ mplib_push_color(L, (mp_graphic_object *) h);
+ } else if (FIELD(dash)) {
+ mplib_push_dash(L, h);
+ } else if (FIELD(linecap)) {
+ lua_pushnumber(L, (lua_Number)h->lcap);
+ } else if (FIELD(linejoin)) {
+ lua_pushnumber(L, (lua_Number)h->ljoin);
+ } else if (FIELD(miterlimit)) {
+ mplib_push_number(L, h->miterlim);
+ } else if (FIELD(prescript)) {
+ lua_pushstring(L, h->pre_script);
+ } else if (FIELD(postscript)) {
+ lua_pushstring(L, h->post_script);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+static void mplib_text(lua_State * L, struct mp_text_object *h)
+{
+ if (FIELD(text)) {
+ lua_pushstring(L, h->text_p);
+ } else if (FIELD(dsize)) {
+ mplib_push_number(L, (h->font_dsize / 16));
+ } else if (FIELD(font)) {
+ lua_pushstring(L, h->font_name);
+ } else if (FIELD(color)) {
+ mplib_push_color(L, (mp_graphic_object *) h);
+ } else if (FIELD(width)) {
+ mplib_push_number(L, h->width);
+ } else if (FIELD(height)) {
+ mplib_push_number(L, h->height);
+ } else if (FIELD(depth)) {
+ mplib_push_number(L, h->depth);
+ } else if (FIELD(transform)) {
+ mplib_push_transform(L, h);
+ } else if (FIELD(prescript)) {
+ lua_pushstring(L, h->pre_script);
+ } else if (FIELD(postscript)) {
+ lua_pushstring(L, h->post_script);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+static void mplib_special(lua_State * L, struct mp_special_object *h)
+{
+ if (FIELD(prescript)) {
+ lua_pushstring(L, h->pre_script);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+static void mplib_start_bounds(lua_State * L, struct mp_bounds_object *h)
+{
+ if (FIELD(path)) {
+ mplib_push_path(L, h->path_p, MPLIB_PATH);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+static void mplib_start_clip(lua_State * L, struct mp_clip_object *h)
+{
+ if (FIELD(path)) {
+ mplib_push_path(L, h->path_p, MPLIB_PATH);
+ } else {
+ lua_pushnil(L);
+ }
+}
+
+static int mplib_gr_index(lua_State * L)
+{
+ struct mp_graphic_object **hh = is_gr_object(L, 1);
+ if (*hh) {
+ struct mp_graphic_object *h = *hh;
+
+ if (mplib_is_S(type, 2)) {
+ lua_rawgeti(L, LUA_REGISTRYINDEX, mplib_type_Ses[h->type]);
+ } else {
+ switch (h->type) {
+ case mp_fill_code:
+ mplib_fill(L, (mp_fill_object *) h);
+ break;
+ case mp_stroked_code:
+ mplib_stroked(L, (mp_stroked_object *) h);
+ break;
+ case mp_text_code:
+ mplib_text(L, (mp_text_object *) h);
+ break;
+ case mp_special_code:
+ mplib_special(L, (mp_special_object *) h);
+ break;
+ case mp_start_clip_code:
+ mplib_start_clip(L, (mp_clip_object *) h);
+ break;
+ case mp_start_bounds_code:
+ mplib_start_bounds(L, (mp_bounds_object *) h);
+ break;
+ case mp_stop_clip_code:
+ case mp_stop_bounds_code:
+ default:
+ lua_pushnil(L);
+ }
+ }
+ } else {
+ lua_pushnil(L);
+ }
+ return 1;
+}
+
+
+static const struct luaL_reg mplib_meta[] = {
+ {"__gc", mplib_collect},
+ {"__tostring", mplib_tostring},
+ {NULL, NULL} /* sentinel */
+};
+
+static const struct luaL_reg mplib_fig_meta[] = {
+ {"__gc", mplib_fig_collect},
+ {"__tostring", mplib_fig_tostring},
+ {"objects", mplib_fig_body},
+ {"copy_objects", mplib_fig_copy_body},
+ {"filename", mplib_fig_filename},
+ {"postscript", mplib_fig_postscript},
+ {"boundingbox", mplib_fig_bb},
+ {"width", mplib_fig_width},
+ {"height", mplib_fig_height},
+ {"depth", mplib_fig_depth},
+ {"italcorr", mplib_fig_italcorr},
+ {"charcode", mplib_fig_charcode},
+ {NULL, NULL} /* sentinel */
+};
+
+static const struct luaL_reg mplib_gr_meta[] = {
+ {"__gc", mplib_gr_collect},
+ {"__tostring", mplib_gr_tostring},
+ {"__index", mplib_gr_index},
+ {NULL, NULL} /* sentinel */
+};
+
+static const struct luaL_reg mplib_d[] = {
+ {"execute", mplib_execute},
+ {"finish", mplib_finish},
+ {"char_width", mplib_charwidth},
+ {"char_height", mplib_charheight},
+ {"char_depth", mplib_chardepth},
+ {"statistics", mplib_statistics},
+ {NULL, NULL} /* sentinel */
+};
+
+
+static const struct luaL_reg mplib_m[] = {
+ {"new", mplib_new},
+ {"version", mplib_version},
+ {"fields", mplib_gr_fields},
+ {"pen_info", mplib_gr_peninfo},
+ {NULL, NULL} /* sentinel */
+};
+
+
+int luaopen_mplib(lua_State * L)
+{
+ mplib_init_Ses(L);
+
+ luaL_newmetatable(L, MPLIB_GR_METATABLE);
+ lua_pushvalue(L, -1); /* push metatable */
+ lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
+ luaL_register(L, NULL, mplib_gr_meta); /* object meta methods */
+ lua_pop(L, 1);
+
+ luaL_newmetatable(L, MPLIB_FIG_METATABLE);
+ lua_pushvalue(L, -1); /* push metatable */
+ lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
+ luaL_register(L, NULL, mplib_fig_meta); /* figure meta methods */
+ lua_pop(L, 1);
+
+ luaL_newmetatable(L, MPLIB_METATABLE);
+ lua_pushvalue(L, -1); /* push metatable */
+ lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
+ luaL_register(L, NULL, mplib_meta); /* meta methods */
+ luaL_register(L, NULL, mplib_d); /* dict methods */
+ luaL_register(L, "mplib", mplib_m); /* module functions */
+ return 1;
+}
diff --git a/Build/source/texk/web2c/luatexdir/mp/memio.w b/Build/source/texk/web2c/luatexdir/mp/memio.w
new file mode 100644
index 00000000000..06bf9bf91d4
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/mp/memio.w
@@ -0,0 +1,405 @@
+% $Id: psout.w 616 2008-07-09 14:05:55Z taco $
+%
+% Copyright 2008 Taco Hoekwater.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+% TeX is a trademark of the American Mathematical Society.
+% METAFONT is a trademark of Addison-Wesley Publishing Company.
+% PostScript is a trademark of Adobe Systems Incorporated.
+
+% Here is TeX material that gets inserted after \input webmac
+
+\font\tenlogo=logo10 % font used for the METAFONT logo
+\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+\def\title{MetaPost MEM reading and writing}
+\def\topofcontents{\hsize 5.5in
+ \vglue -30pt plus 1fil minus 1.5in
+ \def\?##1]{\hbox to 1in{\hfil##1.\ }}
+ }
+\def\botofcontents{\vskip 0pt plus 1fil minus 1.5in}
+\pdfoutput=1
+\pageno=3
+
+@ As usual, need true and false.
+
+@d true 1
+@d false 0
+@d null 0 /* the null pointer */
+@d incr(A) (A)=(A)+1 /* increase a variable by unity */
+@d decr(A) (A)=(A)-1 /* decrease a variable by unity */
+@d qo(A) (A) /* to read eight bits from a quarterword */
+@d qi(A) (quarterword)(A) /* to store eight bits in a quarterword */
+@d max_quarterword 0x3FFF /* largest allowable value in a |quarterword| */
+@d max_halfword 0xFFFFFFF /* largest allowable value in a |halfword| */
+@d max_str_ref 127 /* ``infinite'' number of references */
+
+
+@c
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mplib.h"
+#include "mpmp.h"
+
+@ @c void mp_store_mem_file (MP mp) {
+ integer k; /* all-purpose index */
+ pointer p,q; /* all-purpose pointers */
+ integer x; /* something to dump */
+ four_quarters w; /* four ASCII codes */
+ memory_word WW;
+ @<Create the |mem_ident|, open the mem file,
+ and inform the user that dumping has begun@>;
+ @<Dump constants for consistency check@>;
+ @<Dump the string pool@>;
+ @<Dump the dynamic memory@>;
+ @<Dump the table of equivalents and the hash table@>;
+ @<Dump a few more things and the closing check word@>;
+ @<Close the mem file@>;
+}
+
+@ Corresponding to the procedure that dumps a mem file, we also have a function
+that reads~one~in. The function returns |false| if the dumped mem is
+incompatible with the present \MP\ table sizes, etc.
+
+@d too_small(A) { wake_up_terminal;
+ wterm_ln("---! Must increase the "); wterm((A));
+@.Must increase the x@>
+ goto OFF_BASE;
+ }
+
+@c
+boolean mp_load_mem_file (MP mp) {
+ integer k; /* all-purpose index */
+ pointer p,q; /* all-purpose pointers */
+ integer x; /* something undumped */
+ str_number s; /* some temporary string */
+ four_quarters w; /* four ASCII codes */
+ memory_word WW;
+ @<Undump the string pool@>;
+ @<Undump the dynamic memory@>;
+ @<Undump the table of equivalents and the hash table@>;
+ @<Undump a few more things and the closing check word@>;
+ return true; /* it worked! */
+OFF_BASE:
+ wake_up_terminal;
+ wterm_ln("(Fatal mem file error; I'm stymied)\n");
+@.Fatal mem file error@>
+ return false;
+}
+
+@ Mem files consist of |memory_word| items, and we use the following
+macros to dump words of different types:
+
+@d dump_wd(A) { WW=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); }
+@d dump_int(A) { int cint=(A); (mp->write_binary_file)(mp,mp->mem_file,&cint,sizeof(cint)); }
+@d dump_hh(A) { WW.hh=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); }
+@d dump_qqqq(A) { WW.qqqq=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); }
+@d dump_string(A) { dump_int((int)(strlen(A)+1));
+ (mp->write_binary_file)(mp,mp->mem_file,A,strlen(A)+1); }
+
+@ The inverse macros are slightly more complicated, since we need to check
+the range of the values we are reading in. We say `|undump(a)(b)(x)|' to
+read an integer value |x| that is supposed to be in the range |a<=x<=b|.
+
+@d mgeti(A) do {
+ size_t wanted = sizeof(A);
+ void *A_ptr = &A;
+ (mp->read_binary_file)(mp, mp->mem_file,&A_ptr,&wanted);
+ if (wanted!=sizeof(A)) goto OFF_BASE;
+} while (0)
+
+@d mgetw(A) do {
+ size_t wanted = sizeof(A);
+ void *A_ptr = &A;
+ (mp->read_binary_file)(mp, mp->mem_file,&A_ptr,&wanted);
+ if (wanted!=sizeof(A)) goto OFF_BASE;
+} while (0)
+
+@d undump_wd(A) { mgetw(WW); A=WW; }
+@d undump_int(A) { int cint; mgeti(cint); A=cint; }
+@d undump_hh(A) { mgetw(WW); A=WW.hh; }
+@d undump_qqqq(A) { mgetw(WW); A=WW.qqqq; }
+@d undump_strings(A,B,C) {
+ undump_int(x); if ( (x<(A)) || (x>(B)) ) goto OFF_BASE; else C=str(x); }
+@d undump(A,B,C) { undump_int(x);
+ if ( (x<(A)) || (x>(int)(B)) ) goto OFF_BASE; else C=x; }
+@d undump_size(A,B,C,D) { undump_int(x);
+ if (x<(A)) goto OFF_BASE;
+ if (x>(B)) too_small((C)); else D=x; }
+@d undump_string(A) {
+ size_t the_wanted;
+ void *the_string;
+ integer XX=0;
+ undump_int(XX);
+ the_wanted = (size_t)XX;
+ the_string = mp_xmalloc(mp,(size_t)XX,1);
+ (mp->read_binary_file)(mp,mp->mem_file,&the_string,&the_wanted);
+ A = (char *)the_string;
+ if (the_wanted!=(size_t)XX) goto OFF_BASE;
+}
+
+@ The next few sections of the program should make it clear how we use the
+dump/undump macros.
+
+@<Dump constants for consistency check@>=
+x = metapost_magic; dump_int(x);
+dump_int(mp->mem_top);
+dump_int((integer)mp->hash_size);
+dump_int(mp->hash_prime)
+dump_int(mp->param_size);
+dump_int(mp->max_in_open);
+
+@ Sections of a \.{WEB} program that are ``commented out'' still contribute
+strings to the string pool; therefore \.{INIMP} and \MP\ will have
+the same strings. (And it is, of course, a good thing that they do.)
+@.WEB@>
+@^string pool@>
+
+@ @c
+int mp_undump_constants (MP mp) {
+ integer x;
+ undump_int(x);
+ if (x!=metapost_magic) return x;
+ undump_int(x); mp->mem_top = x;
+ undump_int(x); mp->hash_size = (unsigned)x;
+ undump_int(x); mp->hash_prime = x;
+ undump_int(x); mp->param_size = x;
+ undump_int(x); mp->max_in_open = x;
+ return metapost_magic;
+ OFF_BASE:
+ return -1;
+}
+
+@ We do string pool compaction to avoid dumping unused strings.
+
+@d dump_four_ASCII
+ w.b0=qi(mp->str_pool[k]); w.b1=qi(mp->str_pool[k+1]);
+ w.b2=qi(mp->str_pool[k+2]); w.b3=qi(mp->str_pool[k+3]);
+ dump_qqqq(w)
+
+@<Dump the string pool@>=
+mp_do_compaction(mp, mp->pool_size);
+dump_int(mp->pool_ptr);
+dump_int(mp->max_str_ptr);
+dump_int(mp->str_ptr);
+k=0;
+while ( (mp->next_str[k]==k+1) && (k<=mp->max_str_ptr) )
+ k++;
+dump_int(k);
+while ( k<=mp->max_str_ptr ) {
+ dump_int(mp->next_str[k]); incr(k);
+}
+k=0;
+while (1) {
+ dump_int(mp->str_start[k]); /* TODO: valgrind warning here */
+ if ( k==mp->str_ptr ) {
+ break;
+ } else {
+ k=mp->next_str[k];
+ }
+}
+k=0;
+while (k+4<mp->pool_ptr ) {
+ dump_four_ASCII; k=k+4;
+}
+k=mp->pool_ptr-4; dump_four_ASCII;
+mp_print_ln(mp); mp_print(mp, "at most "); mp_print_int(mp, mp->max_str_ptr);
+mp_print(mp, " strings of total length ");
+mp_print_int(mp, mp->pool_ptr)
+
+@ @d undump_four_ASCII
+ undump_qqqq(w);
+ mp->str_pool[k]=(ASCII_code)qo(w.b0); mp->str_pool[k+1]=(ASCII_code)qo(w.b1);
+ mp->str_pool[k+2]=(ASCII_code)qo(w.b2); mp->str_pool[k+3]=(ASCII_code)qo(w.b3)
+
+@<Undump the string pool@>=
+undump_int(mp->pool_ptr);
+mp_reallocate_pool(mp, mp->pool_ptr) ;
+undump_int(mp->max_str_ptr);
+mp_reallocate_strings (mp,mp->max_str_ptr) ;
+undump(0,mp->max_str_ptr,mp->str_ptr);
+undump(0,mp->max_str_ptr+1,s);
+for (k=0;k<=s-1;k++)
+ mp->next_str[k]=k+1;
+for (k=s;k<=mp->max_str_ptr;k++)
+ undump(s+1,mp->max_str_ptr+1,mp->next_str[k]);
+mp->fixed_str_use=0;
+k=0;
+while (1) {
+ undump(0,mp->pool_ptr,mp->str_start[k]);
+ if ( k==mp->str_ptr ) break;
+ mp->str_ref[k]=max_str_ref;
+ incr(mp->fixed_str_use);
+ mp->last_fixed_str=k; k=mp->next_str[k];
+}
+k=0;
+while ( k+4<mp->pool_ptr ) {
+ undump_four_ASCII; k=k+4;
+}
+k=mp->pool_ptr-4; undump_four_ASCII;
+mp->init_str_use=mp->fixed_str_use; mp->init_pool_ptr=mp->pool_ptr;
+mp->max_pool_ptr=mp->pool_ptr;
+mp->strs_used_up=mp->fixed_str_use;
+mp->pool_in_use=mp->str_start[mp->str_ptr]; mp->strs_in_use=mp->fixed_str_use;
+mp->max_pl_used=mp->pool_in_use; mp->max_strs_used=mp->strs_in_use;
+mp->pact_count=0; mp->pact_chars=0; mp->pact_strs=0;
+
+@ By sorting the list of available spaces in the variable-size portion of
+|mem|, we are usually able to get by without having to dump very much
+of the dynamic memory.
+
+We recompute |var_used| and |dyn_used|, so that \.{INIMP} dumps valid
+information even when it has not been gathering statistics.
+
+@<Dump the dynamic memory@>=
+mp_sort_avail(mp); mp->var_used=0;
+dump_int(mp->lo_mem_max); dump_int(mp->rover);
+p=0; q=mp->rover; x=0;
+do {
+ for (k=p;k<= q+1;k++)
+ dump_wd(mp->mem[k]);
+ x=x+q+2-p; mp->var_used=mp->var_used+q-p;
+ p=q+node_size(q); q=rmp_link(q);
+} while (q!=mp->rover);
+mp->var_used=mp->var_used+mp->lo_mem_max-p;
+mp->dyn_used=mp->mem_end+1-mp->hi_mem_min;
+for (k=p;k<= mp->lo_mem_max;k++ )
+ dump_wd(mp->mem[k]);
+x=x+mp->lo_mem_max+1-p;
+dump_int(mp->hi_mem_min); dump_int(mp->avail);
+for (k=mp->hi_mem_min;k<=mp->mem_end;k++ )
+ dump_wd(mp->mem[k]);
+x=x+mp->mem_end+1-mp->hi_mem_min;
+p=mp->avail;
+while ( p!=null ) {
+ decr(mp->dyn_used); p=mp_link(p);
+}
+dump_int(mp->var_used); dump_int(mp->dyn_used);
+mp_print_ln(mp); mp_print_int(mp, x);
+mp_print(mp, " memory locations dumped; current usage is ");
+mp_print_int(mp, mp->var_used); mp_print_char(mp, xord('&')); mp_print_int(mp, mp->dyn_used)
+
+@ @<Undump the dynamic memory@>=
+undump(lo_mem_stat_max+1000,hi_mem_stat_min-1,mp->lo_mem_max);
+undump(lo_mem_stat_max+1,mp->lo_mem_max,mp->rover);
+p=0; q=mp->rover;
+do {
+ for (k=p;k<= q+1; k++)
+ undump_wd(mp->mem[k]);
+ p=q+node_size(q);
+ if ( (p>mp->lo_mem_max)||((q>=rmp_link(q))&&(rmp_link(q)!=mp->rover)) )
+ goto OFF_BASE;
+ q=rmp_link(q);
+} while (q!=mp->rover);
+for (k=p;k<=mp->lo_mem_max;k++ )
+ undump_wd(mp->mem[k]);
+undump(mp->lo_mem_max+1,hi_mem_stat_min,mp->hi_mem_min);
+undump(null,mp->mem_top,mp->avail); mp->mem_end=mp->mem_top;
+mp->last_pending=spec_head;
+for (k=mp->hi_mem_min;k<= mp->mem_end;k++)
+ undump_wd(mp->mem[k]);
+undump_int(mp->var_used); undump_int(mp->dyn_used)
+
+@ A different scheme is used to compress the hash table, since its lower region
+is usually sparse. When |text(p)<>0| for |p<=hash_used|, we output three
+words: |p|, |hash[p]|, and |eqtb[p]|. The hash table is, of course, densely
+packed for |p>=hash_used|, so the remaining entries are output in~a~block.
+
+@<Dump the table of equivalents and the hash table@>=
+dump_int(mp->hash_used);
+mp->st_count=frozen_inaccessible-1-mp->hash_used;
+for (p=1;p<=mp->hash_used;p++) {
+ if ( text(p)!=0 ) {
+ dump_int(p); dump_hh(mp->hash[p]); dump_hh(mp->eqtb[p]); incr(mp->st_count);
+ }
+}
+for (p=mp->hash_used+1;p<=(int)hash_end;p++) {
+ dump_hh(mp->hash[p]); dump_hh(mp->eqtb[p]);
+}
+dump_int(mp->st_count);
+mp_print_ln(mp); mp_print_int(mp, mp->st_count); mp_print(mp, " symbolic tokens")
+
+@ @<Undump the table of equivalents and the hash table@>=
+undump(1,frozen_inaccessible,mp->hash_used);
+p=0;
+do {
+ undump(p+1,mp->hash_used,p);
+ undump_hh(mp->hash[p]); undump_hh(mp->eqtb[p]);
+} while (p!=mp->hash_used);
+for (p=mp->hash_used+1;p<=(int)hash_end;p++ ) {
+ undump_hh(mp->hash[p]); undump_hh(mp->eqtb[p]);
+}
+undump_int(mp->st_count)
+
+@ We have already printed a lot of statistics, so we set |mp_tracing_stats:=0|
+to prevent them appearing again.
+
+@<Dump a few more things and the closing check word@>=
+dump_int(mp->max_internal);
+dump_int(mp->int_ptr);
+for (k=1;k<= mp->int_ptr;k++ ) {
+ dump_int(mp->internal[k]);
+ dump_string(mp->int_name[k]);
+}
+dump_int(mp->start_sym);
+dump_int(mp->interaction);
+dump_string(mp->mem_ident);
+dump_int(mp->bg_loc); dump_int(mp->eg_loc); dump_int(mp->serial_no); dump_int(69073);
+mp->internal[mp_tracing_stats]=0
+
+@ @<Undump a few more things and the closing check word@>=
+undump_int(x);
+if (x>mp->max_internal) mp_grow_internals(mp,x);
+undump_int(mp->int_ptr);
+for (k=1;k<= mp->int_ptr;k++) {
+ undump_int(mp->internal[k]);
+ undump_string(mp->int_name[k]);
+}
+undump(0,frozen_inaccessible,mp->start_sym);
+if (mp->interaction==mp_unspecified_mode) {
+ undump(mp_unspecified_mode,mp_error_stop_mode,mp->interaction);
+} else {
+ undump(mp_unspecified_mode,mp_error_stop_mode,x);
+}
+undump_string(mp->mem_ident);
+undump(1,hash_end,mp->bg_loc);
+undump(1,hash_end,mp->eg_loc);
+undump_int(mp->serial_no);
+undump_int(x);
+if (x!=69073) goto OFF_BASE
+
+@ @<Create the |mem_ident|...@>=
+{
+ char *tmp = mp_xmalloc(mp,11,1);
+ mp_xfree(mp->mem_ident);
+ mp->mem_ident = mp_xmalloc(mp,256,1);
+ mp_snprintf(tmp,11,"%04d.%02d.%02d",
+ (int)mp_round_unscaled(mp, mp->internal[mp_year]),
+ (int)mp_round_unscaled(mp, mp->internal[mp_month]),
+ (int)mp_round_unscaled(mp, mp->internal[mp_day]));
+ mp_snprintf(mp->mem_ident,256," (mem=%s %s)",mp->job_name, tmp);
+ mp_xfree(tmp);
+ mp_pack_job_name(mp, ".mem");
+ while (! mp_w_open_out(mp, &mp->mem_file) )
+ mp_prompt_file_name(mp, "mem file name", ".mem");
+ mp_print_nl(mp, "Beginning to dump on file ");
+@.Beginning to dump...@>
+ mp_print(mp, mp->name_of_file);
+ mp_print_nl(mp, mp->mem_ident);
+}
+
+@ @<Close the mem file@>=
+(mp->close_file)(mp,mp->mem_file)
diff --git a/Build/source/texk/web2c/luatexdir/lua/mp.w b/Build/source/texk/web2c/luatexdir/mp/mp.w
index 4894a54e9aa..ef61a38f820 100644
--- a/Build/source/texk/web2c/luatexdir/lua/mp.w
+++ b/Build/source/texk/web2c/luatexdir/mp/mp.w
@@ -1,10 +1,20 @@
-% $Id: mp.web,v 1.8 2005/08/24 10:54:02 taco Exp $
-% MetaPost, by John Hobby. Public domain.
-
-% Much of this program was copied with permission from MF.web Version 1.9
-% It interprets a language very similar to D.E. Knuth's METAFONT, but with
-% changes designed to make it more suitable for PostScript output.
-
+% $Id: mp.w 806 2008-12-23 16:22:29Z taco $
+%
+% Copyright 2008 Taco Hoekwater.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
% TeX is a trademark of the American Mathematical Society.
% METAFONT is a trademark of Addison-Wesley Publishing Company.
% PostScript is a trademark of Adobe Systems Incorporated.
@@ -25,7 +35,8 @@
\def\section{\mathhexbox278}
\let\swap=\leftrightarrow
\def\round{\mathop{\rm round}\nolimits}
-\mathchardef\vb="026A % synonym for `\|'
+\mathchardef\vbv="026A % synonym for `\|'
+\def\vb{\relax\ifmmode\vbv\else$\vbv$\fi}
\def\(#1){} % this is used to make section names sort themselves better
\def\9#1{} % this is used for sort keys in the index via @@:sort key}{entry@@>
@@ -35,7 +46,12 @@
@* \[1] Introduction.
-This is \MP, a graphics-language processor based on D. E. Knuth's \MF.
+This is \MP\ by John Hobby, a graphics-language processor based on D. E. Knuth's \MF.
+
+Much of the original Pascal version of this program was copied with
+permission from MF.web Version 1.9. It interprets a language very
+similar to D.E. Knuth's METAFONT, but with changes designed to make it
+more suitable for PostScript output.
The main purpose of the following program is to explain the algorithms of \MP\
as clearly as possible. However, the program has been written so that it
@@ -73,14 +89,15 @@ undergoes any modifications, so that it will be clear which version of
@^extensions to \MP@>
@^system dependencies@>
-@d banner "This is MetaPost, Version 1.003" /* printed when \MP\ starts */
-@d metapost_version "1.003"
-@d mplib_version "0.40"
-@d version_string " (Cweb version 0.40)"
-
+@d default_banner "This is MetaPost, Version 1.102" /* printed when \MP\ starts */
@d true 1
@d false 0
+@(mpmp.h@>=
+#define metapost_version "1.102"
+#define metapost_magic (('M'*256) + 'P')*65536 + 1102
+#define metapost_old_magic (('M'*256) + 'P')*65536 + 1080
+
@ The external library header for \MP\ is |mplib.h|. It contains a
few typedefs and the header defintions for the externally used
fuctions.
@@ -107,8 +124,12 @@ wholesale.
@(mpmp.h@>=
#include <setjmp.h>
typedef struct psout_data_struct * psout_data;
+#ifndef HAVE_BOOLEAN
typedef int boolean;
-typedef signed int integer;
+#endif
+#ifndef INTEGER_TYPE
+typedef int integer;
+#endif
@<Declare helpers@>
@<Types in the outer block@>
@<Constants in the outer block@>
@@ -126,16 +147,21 @@ typedef struct MP_instance {
@<Internal library declarations@>
@ @c
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h> /* for access() */
+#endif
#include <time.h> /* for struct tm \& co */
#include "mplib.h"
+#include "mplibps.h" /* external header */
#include "mpmp.h" /* internal header */
#include "mppsout.h" /* internal header */
+extern font_number mp_read_font_info (MP mp, char *fname); /* tfmin.w */
@h
@<Declarations@>
@<Basic printing procedures@>
@@ -144,95 +170,149 @@ typedef struct MP_instance {
@ Here are the functions that set up the \MP\ instance.
@<Declarations@> =
-@<Declare |mp_reallocate| functions@>
-struct MP_options *mp_options (void);
-MP mp_new (struct MP_options *opt);
+MP_options *mp_options (void);
+MP mp_initialize (MP_options *opt);
@ @c
-struct MP_options *mp_options (void) {
- struct MP_options *opt;
- opt = malloc(sizeof(MP_options));
+MP_options *mp_options (void) {
+ MP_options *opt;
+ size_t l = sizeof(MP_options);
+ opt = malloc(l);
if (opt!=NULL) {
- memset (opt,0,sizeof(MP_options));
+ memset (opt,0,l);
+ opt->ini_version = true;
}
return opt;
}
-@ The |__attribute__| pragma is gcc-only.
+@ @<Internal library declarations@>=
+@<Declare subroutines for parsing file names@>
-@<Internal library ... @>=
-#if !defined(__GNUC__) || (__GNUC__ < 2)
-# define __attribute__(x)
-#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
+@ The whole instance structure is initialized with zeroes,
+this greatly reduces the number of statements needed in
+the |Allocate or initialize variables| block.
-@ @c
-MP __attribute__ ((noinline))
-mp_new (struct MP_options *opt) {
- MP mp;
- mp = malloc(1*sizeof(MP_instance));
- if (mp==NULL)
- return mp;
- @<Set |ini_version|@>;
- @<Setup the non-local jump buffer in |mp_new|@>;
- @<Allocate or initialize variables@>
- if (opt->main_memory>mp->mem_max)
- mp_reallocate_memory(mp,opt->main_memory);
- mp_reallocate_paths(mp,1000);
- mp_reallocate_fonts(mp,8);
+@d set_callback_option(A) do { mp->A = mp_##A;
+ if (opt->A!=NULL) mp->A = opt->A;
+} while (0)
+
+@c
+static MP mp_do_new (jmp_buf *buf) {
+ MP mp = malloc(sizeof(MP_instance));
+ if (mp==NULL) {
+ xfree(buf);
+ return NULL;
+ }
+ memset(mp,0,sizeof(MP_instance));
+ mp->jump_buf = buf;
return mp;
}
@ @c
-void mp_free (MP mp) {
+static void mp_free (MP mp) {
int k; /* loop variable */
@<Dealloc variables@>
+ if (mp->noninteractive) {
+ @<Finish non-interactive use@>;
+ }
+ xfree(mp->jump_buf);
xfree(mp);
}
@ @c
-void __attribute__((noinline))
-mp_do_initialize ( MP mp) {
+static void mp_do_initialize ( MP mp) {
@<Local variables for initialization@>
@<Set initial values of key variables@>
}
-int mp_initialize (MP mp) { /* this procedure gets things started properly */
+
+@ This procedure gets things started properly.
+@c
+MP mp_initialize (MP_options *opt) {
+ MP mp;
+ jmp_buf *buf = malloc(sizeof(jmp_buf));
+ if (buf == NULL || setjmp(*buf) != 0)
+ return NULL;
+ mp = mp_do_new(buf);
+ if (mp == NULL)
+ return NULL;
+ mp->userdata=opt->userdata;
+ @<Set |ini_version|@>;
+ mp->noninteractive=opt->noninteractive;
+ set_callback_option(find_file);
+ set_callback_option(open_file);
+ set_callback_option(read_ascii_file);
+ set_callback_option(read_binary_file);
+ set_callback_option(close_file);
+ set_callback_option(eof_file);
+ set_callback_option(flush_file);
+ set_callback_option(write_ascii_file);
+ set_callback_option(write_binary_file);
+ set_callback_option(shipout_backend);
+ if (opt->banner && *(opt->banner)) {
+ mp->banner = xstrdup(opt->banner);
+ } else {
+ mp->banner = xstrdup(default_banner);
+ }
+ if (opt->command_line && *(opt->command_line))
+ mp->command_line = xstrdup(opt->command_line);
+ if (mp->noninteractive) {
+ @<Prepare function pointers for non-interactive use@>;
+ }
+ /* open the terminal for output */
+ t_open_out;
+ @<Find constant sizes@>;
+ @<Allocate or initialize variables@>
+ mp_reallocate_memory(mp,mp->mem_max);
+ mp_reallocate_paths(mp,1000);
+ mp_reallocate_fonts(mp,8);
mp->history=mp_fatal_error_stop; /* in case we quit during initialization */
- @<Install and test the non-local jump buffer@>;
- t_open_out; /* open the terminal for output */
@<Check the ``constant'' values...@>;
if ( mp->bad>0 ) {
char ss[256];
- snprintf(ss,256,"Ouch---my internal constants have been clobbered!\n"
+ mp_snprintf(ss,256,"Ouch---my internal constants have been clobbered!\n"
"---case %i",(int)mp->bad);
do_fprintf(mp->err_out,(char *)ss);
@.Ouch...clobbered@>
- return mp->history;
+ return mp;
}
mp_do_initialize(mp); /* erase preloaded mem */
if (mp->ini_version) {
@<Run inimpost commands@>;
}
- @<Initialize the output routines@>;
- @<Get the first line of input and prepare to start@>;
- mp_set_job_id(mp);
- mp_init_map_file(mp, mp->troff_mode);
- mp->history=mp_spotless; /* ready to go! */
- if (mp->troff_mode) {
- mp->internal[mp_gtroffmode]=unity;
- mp->internal[mp_prologues]=unity;
- }
- if ( mp->start_sym>0 ) { /* insert the `\&{everyjob}' symbol */
- mp->cur_sym=mp->start_sym; mp_back_input(mp);
+ if (!mp->noninteractive) {
+ @<Initialize the output routines@>;
+ @<Get the first line of input and prepare to start@>;
+ @<Initializations after first line is read@>;
+ } else {
+ mp->history=mp_spotless;
}
- return mp->history;
+ return mp;
}
-@
-@<Exported function headers@>=
-extern struct MP_options *mp_options (void);
-extern MP mp_new (struct MP_options *opt) ;
-extern void mp_free (MP mp);
-extern int mp_initialize (MP mp);
+@ @<Initializations after first line is read@>=
+mp_open_log_file(mp);
+mp_set_job_id(mp);
+mp_init_map_file(mp, mp->troff_mode);
+mp->history=mp_spotless; /* ready to go! */
+if (mp->troff_mode) {
+ mp->internal[mp_gtroffmode]=unity;
+ mp->internal[mp_prologues]=unity;
+}
+if ( mp->start_sym>0 ) { /* insert the `\&{everyjob}' symbol */
+ mp->cur_sym=mp->start_sym; mp_back_input(mp);
+}
+
+@ @<Exported function headers@>=
+extern MP_options *mp_options (void);
+extern MP mp_initialize (MP_options *opt) ;
+extern int mp_status(MP mp);
+extern void *mp_userdata(MP mp);
+
+@ @c
+int mp_status(MP mp) { return mp->history; }
+
+@ @c
+void *mp_userdata(MP mp) { return mp->userdata; }
@ The overall \MP\ program begins with the heading just shown, after which
comes a bunch of procedure declarations and function declarations.
@@ -271,7 +351,7 @@ in production versions of \MP.
should probably be left at this value */
@ Like the preceding parameters, the following quantities can be changed
-at compile time to extend or reduce \MP's capacity. But if they are changed,
+to extend or reduce \MP's capacity. But if they are changed,
it is necessary to rerun the initialization program \.{INIMP}
@.INIMP@>
to generate new tables for the production \MP\ program.
@@ -283,25 +363,30 @@ numbers are computed from them.
int max_strings; /* maximum number of strings; must not exceed |max_halfword| */
int pool_size; /* maximum number of characters in strings, including all
error messages and help texts, and the names of all identifiers */
+int old_pool_size; /* a helper used by |mp_cat| */
int mem_max; /* greatest index in \MP's internal |mem| array;
must be strictly less than |max_halfword|;
must be equal to |mem_top| in \.{INIMP}, otherwise |>=mem_top| */
int mem_top; /* largest index in the |mem| array dumped by \.{INIMP};
must not be greater than |mem_max| */
+int hash_prime; /* a prime number equal to about 85\pct! of |hash_size| */
@ @<Option variables@>=
int error_line; /* width of context lines on terminal error messages */
int half_error_line; /* width of first lines of contexts in terminal
error messages; should be between 30 and |error_line-15| */
int max_print_line; /* width of longest text lines output; should be at least 60 */
-int hash_size; /* maximum number of symbolic tokens,
+unsigned hash_size; /* maximum number of symbolic tokens,
must be less than |max_halfword-3*param_size| */
-int hash_prime; /* a prime number equal to about 85\pct! of |hash_size| */
int param_size; /* maximum number of simultaneous macro parameters */
int max_in_open; /* maximum number of input files and error insertions that
can be going on simultaneously */
int main_memory; /* only for options, to set up |mem_max| and |mem_top| */
void *userdata; /* this allows the calling application to setup local */
+char *banner; /* the banner that is printed to the screen and log */
+
+@ @<Dealloc variables@>=
+xfree(mp->banner);
@
@d set_value(a,b,c) do { a=c; if (b>c) a=b; } while (0)
@@ -309,22 +394,18 @@ void *userdata; /* this allows the calling application to setup local */
@<Allocate or ...@>=
mp->max_strings=500;
mp->pool_size=10000;
+mp->old_pool_size=10000;
set_value(mp->error_line,opt->error_line,79);
set_value(mp->half_error_line,opt->half_error_line,50);
-set_value(mp->max_print_line,opt->max_print_line,100);
-mp->main_memory=5000;
-mp->mem_max=5000;
-mp->mem_top=5000;
-set_value(mp->hash_size,opt->hash_size,9500);
-set_value(mp->hash_prime,opt->hash_prime,7919);
-set_value(mp->param_size,opt->param_size,150);
-set_value(mp->max_in_open,opt->max_in_open,10);
-mp->userdata=opt->userdata;
+if (mp->half_error_line>mp->error_line-15 )
+ mp->half_error_line = mp->error_line-15;
+mp->max_print_line=100;
+set_value(mp->max_print_line,opt->max_print_line,79);
@ In case somebody has inadvertently made bad settings of the ``constants,''
\MP\ checks them using a global variable called |bad|.
-This is the first of many sections of \MP\ where global variables are
+This is the second of many sections of \MP\ where global variables are
defined.
@<Glob...@>=
@@ -333,12 +414,13 @@ integer bad; /* is some ``constant'' wrong? */
@ Later on we will say `\ignorespaces|if (mem_max>=max_halfword) bad=10;|',
or something similar. (We can't do that until |max_halfword| has been defined.)
+In case you are wondering about the non-consequtive values of |bad|: some
+of the things that used to be WEB constants are now runtime variables
+with checking at assignment time.
+
@<Check the ``constant'' values for consistency@>=
mp->bad=0;
-if ( (mp->half_error_line<30)||(mp->half_error_line>mp->error_line-15) ) mp->bad=1;
-if ( mp->max_print_line<60 ) mp->bad=2;
if ( mp->mem_top<=1100 ) mp->bad=4;
-if (mp->hash_prime>mp->hash_size ) mp->bad=5;
@ Some |goto| labels are used by the following definitions. The label
`|restart|' is occasionally used at the very beginning of a procedure; and
@@ -358,10 +440,7 @@ end up the same, the shared code may be gathered together at
@d negate(A) (A)=-(A) /* change the sign of a variable */
@d double(A) (A)=(A)+(A)
@d odd(A) ((A)%2==1)
-@d chr(A) (A)
@d do_nothing /* empty statement */
-@d Return goto exit /* terminate a procedure call */
-@f return nil /* \.{WEB} will henceforth say |return| instead of \\{return} */
@* \[2] The character set.
In order to make \MP\ readily portable to a wide variety of
@@ -387,16 +466,6 @@ that the character set contains at least the letters and symbols associated
with ASCII codes 040 through 0176; all of these characters are now
available on most computer terminals.
-We shall use the name |text_char| to stand for the data type of the characters
-that are converted to and from |ASCII_code| when they are input and output.
-We shall also assume that |text_char| consists of the elements
-|chr(first_text_char)| through |chr(last_text_char)|, inclusive.
-The following definitions should be adjusted if necessary.
-@^system dependencies@>
-
-@d first_text_char 0 /* ordinal number of the smallest element of |text_char| */
-@d last_text_char 255 /* ordinal number of the largest element of |text_char| */
-
@<Types...@>=
typedef unsigned char text_char; /* the data type of characters in text files */
@@ -407,10 +476,11 @@ integer i;
the user's external character set by means of arrays |xord| and |xchr|
that are analogous to Pascal's |ord| and |chr| functions.
-@d xchr(A) mp->xchr[(A)]
-@d xord(A) mp->xord[(A)]
+@(mpmp.h@>=
+#define xchr(A) mp->xchr[(A)]
+#define xord(A) mp->xord[(A)]
-@<Glob...@>=
+@ @<Glob...@>=
ASCII_code xord[256]; /* specifies conversion of input characters */
text_char xchr[256]; /* specifies conversion of output characters */
@@ -429,7 +499,7 @@ more difficult, so they should be introduced cautiously if at all.
@^system dependencies@>
@<Set initial ...@>=
-for (i=0;i<=0377;i++) { xchr(i)=i; }
+for (i=0;i<=0377;i++) { xchr(i)=(text_char)i; }
@ The following system-independent code makes the |xord| array contain a
suitable inverse to the information in |xchr|. Note that if |xchr[i]=xchr[j]|
@@ -438,11 +508,11 @@ where |i<j<0177|, the value of |xord[xchr[i]]| will turn out to be
codes below 040 in case there is a coincidence.
@<Set initial ...@>=
-for (i=first_text_char;i<=last_text_char;i++) {
- xord(chr(i))=0177;
+for (i=0;i<=255;i++) {
+ xord(xchr(i))=0177;
}
-for (i=0200;i<=0377;i++) { xord(xchr(i))=i;}
-for (i=0;i<=0176;i++) { xord(xchr(i))=i;}
+for (i=0200;i<=0377;i++) { xord(xchr(i))=(ASCII_code)i;}
+for (i=0;i<=0176;i++) { xord(xchr(i))=(ASCII_code)i;}
@* \[3] Input and output.
The bane of portability is the fact that different operating systems treat
@@ -502,7 +572,6 @@ typedef int (*mp_file_eoftest)(MP, void *);
typedef void (*mp_file_flush)(MP, void *);
typedef void (*mp_file_writer)(MP, void *, const char *);
typedef void (*mp_binfile_writer)(MP, void *, void *, size_t);
-#define NOTTESTING 1
@ @<Option variables@>=
mp_file_finder find_file;
@@ -522,45 +591,27 @@ This function may disappear altogether, it is currently only
used for the default font map file.
@c
-char *mp_find_file (MP mp, const char *fname, const char *fmode, int ftype) {
+static char *mp_find_file (MP mp, const char *fname, const char *fmode, int ftype) {
(void) mp;
if (fmode[0] != 'r' || (! access (fname,R_OK)) || ftype) {
- return strdup(fname);
+ return mp_strdup(fname);
}
return NULL;
}
-@ This has to be done very early on, so it is best to put it in with
-the |mp_new| allocations
-
-@d set_callback_option(A) do { mp->A = mp_##A;
- if (opt->A!=NULL) mp->A = opt->A;
-} while (0)
-
-@<Allocate or initialize ...@>=
-set_callback_option(find_file);
-set_callback_option(open_file);
-set_callback_option(read_ascii_file);
-set_callback_option(read_binary_file);
-set_callback_option(close_file);
-set_callback_option(eof_file);
-set_callback_option(flush_file);
-set_callback_option(write_ascii_file);
-set_callback_option(write_binary_file);
-
@ Because |mp_find_file| is used so early, it has to be in the helpers
section.
-@<Internal ...@>=
-char *mp_find_file (MP mp, const char *fname, const char *fmode, int ftype) ;
-void *mp_open_file (MP mp , const char *fname, const char *fmode, int ftype) ;
-char *mp_read_ascii_file (MP mp, void *f, size_t *size) ;
-void mp_read_binary_file (MP mp, void *f, void **d, size_t *size) ;
-void mp_close_file (MP mp, void *f) ;
-int mp_eof_file (MP mp, void *f) ;
-void mp_flush_file (MP mp, void *f) ;
-void mp_write_ascii_file (MP mp, void *f, const char *s) ;
-void mp_write_binary_file (MP mp, void *f, void *s, size_t t) ;
+@<Declarations@>=
+static char *mp_find_file (MP mp, const char *fname, const char *fmode, int ftype) ;
+static void *mp_open_file (MP mp , const char *fname, const char *fmode, int ftype) ;
+static char *mp_read_ascii_file (MP mp, void *f, size_t *size) ;
+static void mp_read_binary_file (MP mp, void *f, void **d, size_t *size) ;
+static void mp_close_file (MP mp, void *f) ;
+static int mp_eof_file (MP mp, void *f) ;
+static void mp_flush_file (MP mp, void *f) ;
+static void mp_write_ascii_file (MP mp, void *f, const char *s) ;
+static void mp_write_binary_file (MP mp, void *f, void *s, size_t t) ;
@ The function to open files can now be very short.
@@ -571,7 +622,6 @@ void *mp_open_file(MP mp, const char *fname, const char *fmode, int ftype) {
realmode[0] = *fmode;
realmode[1] = 'b';
realmode[2] = 0;
-#if NOTTESTING
if (ftype==mp_filetype_terminal) {
return (fmode[0] == 'r' ? stdin : stdout);
} else if (ftype==mp_filetype_error) {
@@ -579,7 +629,6 @@ void *mp_open_file(MP mp, const char *fname, const char *fmode, int ftype) {
} else if (fname != NULL && (fmode[0] != 'r' || (! access (fname,R_OK)))) {
return (void *)fopen(fname, realmode);
}
-#endif
return NULL;
}
@@ -590,16 +639,32 @@ char name_of_file[file_name_size+1]; /* the name of a system file */
int name_length;/* this many characters are actually
relevant in |name_of_file| (the rest are blank) */
-@ @<Option variables@>=
-int print_found_names; /* configuration parameter */
-
@ If this parameter is true, the terminal and log will report the found
file names for input files instead of the requested ones.
It is off by default because it creates an extra filename lookup.
-@<Allocate or initialize ...@>=
+@<Option variables@>=
+int print_found_names; /* configuration parameter */
+
+@ @<Allocate or initialize ...@>=
mp->print_found_names = (opt->print_found_names>0 ? true : false);
+@ The |file_line_error_style| parameter makes \MP\ use a more
+standard compiler error message format instead of the Knuthian
+exclamation mark. It needs the actual version of the current input
+file name, that will be saved by |a_open_in| in the global
+|mp->long_name|.
+
+@<Glob...@>=
+char *long_name;
+
+@ @<Option variables@>=
+int file_line_error_style; /* configuration parameter */
+
+@ @<Allocate or initialize ...@>=
+mp->file_line_error_style = (opt->file_line_error_style>0 ? true : false);
+mp->long_name = NULL;
+
@ \MP's file-opening procedures return |false| if no file identified by
|name_of_file| could be opened.
@@ -608,11 +673,17 @@ It is not used for opening a mem file for read, because that file name
is never printed.
@d OPEN_FILE(A) do {
- if (mp->print_found_names) {
+ if (mp->print_found_names || mp->file_line_error_style) {
char *s = (mp->find_file)(mp,mp->name_of_file,A,ftype);
if (s!=NULL) {
*f = (mp->open_file)(mp,mp->name_of_file,A, ftype);
- strncpy(mp->name_of_file,s,file_name_size);
+ if (mp->print_found_names) {
+ strncpy(mp->name_of_file,s,file_name_size);
+ }
+ if ((*(A) == 'r') && (ftype == mp_filetype_program)) {
+ xfree(mp->long_name);
+ mp->long_name = xstrdup(s);
+ }
xfree(s);
} else {
*f = NULL;
@@ -624,7 +695,7 @@ is never printed.
return (*f ? true : false)
@c
-boolean mp_a_open_in (MP mp, void **f, int ftype) {
+static boolean mp_a_open_in (MP mp, void **f, int ftype) {
/* open a text file for input */
OPEN_FILE("r");
}
@@ -635,12 +706,12 @@ boolean mp_w_open_in (MP mp, void **f) {
return (*f ? true : false);
}
@#
-boolean mp_a_open_out (MP mp, void **f, int ftype) {
+static boolean mp_a_open_out (MP mp, void **f, int ftype) {
/* open a text file for output */
OPEN_FILE("w");
}
@#
-boolean mp_b_open_out (MP mp, void **f, int ftype) {
+static boolean mp_b_open_out (MP mp, void **f, int ftype) {
/* open a binary file for output */
OPEN_FILE("w");
}
@@ -651,8 +722,11 @@ boolean mp_w_open_out (MP mp, void **f) {
OPEN_FILE("w");
}
+@ @<Internal library ...@>=
+boolean mp_w_open_out (MP mp, void **f);
+
@ @c
-char *mp_read_ascii_file (MP mp, void *ff, size_t *size) {
+static char *mp_read_ascii_file (MP mp, void *ff, size_t *size) {
int c;
size_t len = 0, lim = 128;
char *s = NULL;
@@ -661,14 +735,13 @@ char *mp_read_ascii_file (MP mp, void *ff, size_t *size) {
(void) mp; /* for -Wunused */
if (f==NULL)
return NULL;
-#if NOTTESTING
c = fgetc(f);
if (c==EOF)
return NULL;
s = malloc(lim);
if (s==NULL) return NULL;
while (c!=EOF && c!='\n' && c!='\r') {
- if (len==lim) {
+ if ((len+1)==lim) {
s =realloc(s, (lim+(lim>>2)));
if (s==NULL) return NULL;
lim+=(lim>>2);
@@ -683,70 +756,55 @@ char *mp_read_ascii_file (MP mp, void *ff, size_t *size) {
}
s[len] = 0;
*size = len;
-#endif
return s;
}
@ @c
void mp_write_ascii_file (MP mp, void *f, const char *s) {
(void) mp;
-#if NOTTESTING
if (f!=NULL) {
fputs(s,(FILE *)f);
}
-#endif
}
@ @c
void mp_read_binary_file (MP mp, void *f, void **data, size_t *size) {
size_t len = 0;
(void) mp;
-#if NOTTESTING
if (f!=NULL)
len = fread(*data,1,*size,(FILE *)f);
-#endif
*size = len;
}
@ @c
void mp_write_binary_file (MP mp, void *f, void *s, size_t size) {
(void) mp;
-#if NOTTESTING
if (f!=NULL)
- fwrite(s,size,1,(FILE *)f);
-#endif
+ (void)fwrite(s,size,1,(FILE *)f);
}
@ @c
void mp_close_file (MP mp, void *f) {
(void) mp;
-#if NOTTESTING
if (f!=NULL)
fclose((FILE *)f);
-#endif
}
@ @c
int mp_eof_file (MP mp, void *f) {
(void) mp;
-#if NOTTESTING
if (f!=NULL)
return feof((FILE *)f);
else
return 1;
-#else
- return 0;
-#endif
}
@ @c
void mp_flush_file (MP mp, void *f) {
(void) mp;
-#if NOTTESTING
if (f!=NULL)
fflush((FILE *)f);
-#endif
}
@ Input from text files is read one line at a time, using a routine called
@@ -772,7 +830,7 @@ mp->buffer = xmalloc((mp->buf_size+1),sizeof(ASCII_code));
xfree(mp->buffer);
@ @c
-void mp_reallocate_buffer(MP mp, size_t l) {
+static void mp_reallocate_buffer(MP mp, size_t l) {
ASCII_code *buffer;
if (l>max_halfword) {
mp_confusion(mp,"buffer size"); /* can't happen (I hope) */
@@ -800,7 +858,7 @@ the |buf_size| parameter must be to accommodate the present job, is
also kept up to date by |input_ln|.
@c
-boolean mp_input_ln (MP mp, void *f ) {
+static boolean mp_input_ln (MP mp, void *f ) {
/* inputs the next line or returns |false| */
char *s;
size_t size = 0;
@@ -812,7 +870,7 @@ boolean mp_input_ln (MP mp, void *f ) {
mp->last = mp->first+size;
if ( mp->last>=mp->max_buf_stack ) {
mp->max_buf_stack=mp->last+1;
- while ( mp->max_buf_stack>=mp->buf_size ) {
+ while ( mp->max_buf_stack>mp->buf_size ) {
mp_reallocate_buffer(mp,(mp->buf_size+(mp->buf_size>>2)));
}
}
@@ -841,8 +899,6 @@ to the input buffer. The variable |command_line| will be filled by the
logic because in the |INI| version, the |buffer| is also used for primitive
initialization.
-@^system dependencies@>
-
@d t_open_out do {/* open the terminal for text output */
mp->term_out = (mp->open_file)(mp,"terminal", "w", mp_filetype_terminal);
mp->err_out = (mp->open_file)(mp,"error", "w", mp_filetype_error);
@@ -858,21 +914,9 @@ initialization.
}
} while (0)
-@d t_close_out do { /* close the terminal */
- (mp->close_file)(mp,mp->term_out);
- (mp->close_file)(mp,mp->err_out);
-} while (0)
-
-@d t_close_in do { /* close the terminal */
- (mp->close_file)(mp,mp->term_in);
-} while (0)
-
@<Option variables@>=
char *command_line;
-@ @<Allocate or initialize ...@>=
-mp->command_line = xstrdup(opt->command_line);
-
@ Sometimes it is necessary to synchronize the input/output mixture that
happens on the user's terminal, and three system-dependent
procedures are used for this
@@ -887,9 +931,10 @@ some instruction to the operating system. The following macros show how
these operations can be specified:
@^system dependencies@>
-@d update_terminal (mp->flush_file)(mp,mp->term_out) /* empty the terminal output buffer */
-@d clear_terminal do_nothing /* clear the terminal input buffer */
-@d wake_up_terminal (mp->flush_file)(mp,mp->term_out)
+@(mpmp.h@>=
+#define update_terminal (mp->flush_file)(mp,mp->term_out) /* empty the terminal output buffer */
+#define clear_terminal do_nothing /* clear the terminal input buffer */
+#define wake_up_terminal (mp->flush_file)(mp,mp->term_out)
/* cancel the user's cancellation of output */
@ We need a special routine to read the first line of \MP\ input from
@@ -937,17 +982,11 @@ not be typed immediately after~`\.{**}'.)
@d loc mp->cur_input.loc_field /* location of first unread character in |buffer| */
-@ The following program does the required initialization
-without retrieving a possible command line.
-It should be clear how to modify this routine to deal with command lines,
-if the system permits them.
-@^system dependencies@>
-
@c
boolean mp_init_terminal (MP mp) { /* gets the terminal input started */
t_open_in;
if (mp->last!=0) {
- loc = mp->first = 0;
+ loc = 0; mp->first = 0;
return true;
}
while (1) {
@@ -960,7 +999,7 @@ boolean mp_init_terminal (MP mp) { /* gets the terminal input started */
@.End of file on the terminal@>
return false;
}
- loc=mp->first;
+ loc=(halfword)mp->first;
while ( (loc<(int)mp->last)&&(mp->buffer[loc]==' ') )
incr(loc);
if ( loc<(int)mp->last ) {
@@ -973,7 +1012,7 @@ boolean mp_init_terminal (MP mp) { /* gets the terminal input started */
}
@ @<Declarations@>=
-boolean mp_init_terminal (MP mp) ;
+static boolean mp_init_terminal (MP mp) ;
@* \[4] String handling.
@@ -1041,19 +1080,17 @@ by the printing routines, and vice versa.
@d str(A) mp_str(mp,A)
@d rts(A) mp_rts(mp,A)
+@d null_str rts("")
@<Internal ...@>=
int mp_xstrcmp (const char *a, const char *b);
char * mp_str (MP mp, str_number s);
@ @<Declarations@>=
-str_number mp_rts (MP mp, const char *s);
-str_number mp_make_string (MP mp);
+static str_number mp_rts (MP mp, const char *s);
+static str_number mp_make_string (MP mp);
-@ The attempt to catch interrupted strings that is in |mp_rts|, is not
-very good: it does not handle nesting over more than one level.
-
-@c
+@ @c
int mp_xstrcmp (const char *a, const char *b) {
if (a==NULL && b==NULL)
return 0;
@@ -1064,14 +1101,17 @@ int mp_xstrcmp (const char *a, const char *b) {
return strcmp(a,b);
}
-@ @c
+@ The attempt to catch interrupted strings that is in |mp_rts|, is not
+very good: it does not handle nesting over more than one level.
+
+@c
char * mp_str (MP mp, str_number ss) {
char *s;
- int len;
+ size_t len;
if (ss==mp->str_ptr) {
return NULL;
} else {
- len = length(ss);
+ len = (size_t)length(ss);
s = xmalloc(len+1,sizeof(char));
strncpy(s,(char *)(mp->str_pool+(mp->str_start[ss])),len);
s[len] = 0;
@@ -1125,8 +1165,7 @@ overhead of procedure calls. For example, here is
a simple macro that computes the length of a string.
@.WEB@>
-@d str_stop(A) mp->str_start[mp->next_str[(A)]] /* one cell past the end of string
- number \# */
+@d str_stop(A) mp->str_start[mp->next_str[(A)]] /* one cell past the end of string \# */
@d length(A) (str_stop((A))-mp->str_start[(A)]) /* the number of characters in string \# */
@ The length of the current string is called |cur_length|. If we decide that
@@ -1147,7 +1186,7 @@ by compacting the string pool if necessary. If this does not work,
|do_compaction| aborts \MP\ and gives an apologetic error message.
@d append_char(A) /* put |ASCII_code| \# at the end of |str_pool| */
-{ mp->str_pool[mp->pool_ptr]=(A); incr(mp->pool_ptr);
+{ mp->str_pool[mp->pool_ptr]=(ASCII_code)(A); incr(mp->pool_ptr);
}
@d str_room(A) /* make sure that the pool hasn't overflowed */
{ if ( mp->pool_ptr+(A) > mp->max_pool_ptr ) {
@@ -1159,8 +1198,8 @@ by compacting the string pool if necessary. If this does not work,
argument |mp->pool_size| to prevent |do_compaction| from aborting when
string space is exhausted.
-@<Declare the procedure called |unit_str_room|@>=
-void mp_unit_str_room (MP mp);
+@<Declarations@>=
+static void mp_unit_str_room (MP mp);
@ @c
void mp_unit_str_room (MP mp) {
@@ -1181,8 +1220,7 @@ a string is ever referred to more than 126 times, simultaneously, we
put it in this category. Hence a single byte suffices to store each |str_ref|.
@d max_str_ref 127 /* ``infinite'' number of references */
-@d add_str_ref(A) { if ( mp->str_ref[(A)]<max_str_ref ) incr(mp->str_ref[(A)]);
- }
+@d add_str_ref(A) { if ( mp->str_ref[(A)]<max_str_ref ) incr(mp->str_ref[(A)]); }
@<Glob...@>=
int *str_ref;
@@ -1202,9 +1240,8 @@ xfree(mp->str_ref);
}
}
-@<Declare the procedure called |flush_string|@>=
-void mp_flush_string (MP mp,str_number s) ;
-
+@<Declarations@>=
+static void mp_flush_string (MP mp,str_number s) ;
@ We can't flush the first set of static strings at all, so there
is no point in trying
@@ -1238,7 +1275,7 @@ str_number mp_intern (MP mp, const char *s) {
}
@ @<Declarations@>=
-str_number mp_intern (MP mp, const char *s);
+static str_number mp_intern (MP mp, const char *s);
@ Once a sequence of characters has been appended to |str_pool|, it
@@ -1254,9 +1291,7 @@ initialized yet. We never allow |str_ptr| to reach |mp->max_strings|;
|do_compaction| is responsible for making sure of this.
@<Declarations@>=
-@<Declare the procedure called |do_compaction|@>
-@<Declare the procedure called |unit_str_room|@>
-str_number mp_make_string (MP mp);
+static str_number mp_make_string (MP mp);
@ @c
str_number mp_make_string (MP mp) { /* current string enters the pool */
@@ -1270,10 +1305,6 @@ RESTART:
mp_do_compaction(mp, 0);
goto RESTART;
} else {
-#ifdef DEBUG
- if ( mp->strs_used_up!=mp->max_str_ptr ) mp_confusion(mp, "s");
-@:this can't happen s}{\quad \.s@>
-#endif
mp->max_str_ptr=mp->str_ptr;
mp->next_str[mp->str_ptr]=mp->max_str_ptr+1;
}
@@ -1305,7 +1336,7 @@ strings are permanently allocated with |max_str_ref| in their |str_ref| entries.
str_number last_fixed_str; /* last permanently allocated string */
str_number fixed_str_use; /* number of permanently allocated strings */
-@ @<Declare the procedure called |do_compaction|@>=
+@ @<Internal library ...@>=
void mp_do_compaction (MP mp, pool_pointer needed) ;
@ @c
@@ -1327,6 +1358,7 @@ void mp_do_compaction (MP mp, pool_pointer needed) {
@<Move string |r| back so that |str_start[r]=p|; make |p| the location
after the end of the string@>;
}
+DONE:
@<Move the current string back so that it starts at |p|@>;
if ( needed<mp->pool_size ) {
@<Make sure that there is room for another string with |needed| characters@>;
@@ -1356,7 +1388,7 @@ s=mp->next_str[s];
mp->next_str[r]=s;
mp->next_str[t]=mp->next_str[mp->str_ptr];
mp->next_str[mp->str_ptr]=t;
-if ( s==mp->str_ptr ) break;
+if ( s==mp->str_ptr ) goto DONE;
}
@ The string currently starts at |str_start[r]| and ends just before
@@ -1393,14 +1425,14 @@ if ( mp->pool_ptr+needed>mp->max_pool_ptr ) {
mp->max_pool_ptr=mp->pool_ptr+needed;
}
-@ @<Declarations@>=
+@ @<Internal library ...@>=
void mp_reallocate_strings (MP mp, str_number str_use) ;
void mp_reallocate_pool(MP mp, pool_pointer needed) ;
@ @c
void mp_reallocate_strings (MP mp, str_number str_use) {
while ( str_use>=mp->max_strings-1 ) {
- int l = mp->max_strings + (mp->max_strings>>2);
+ int l = mp->max_strings + (mp->max_strings/4);
XREALLOC (mp->str_ref, l, int);
XREALLOC (mp->str_start, l, pool_pointer);
XREALLOC (mp->next_str, l, str_number);
@@ -1409,7 +1441,7 @@ void mp_reallocate_strings (MP mp, str_number str_use) {
}
void mp_reallocate_pool(MP mp, pool_pointer needed) {
while ( needed>mp->pool_size ) {
- int l = mp->pool_size + (mp->pool_size>>2);
+ int l = mp->pool_size + (mp->pool_size/4);
XREALLOC (mp->str_pool, l, ASCII_code);
mp->pool_size = l;
}
@@ -1422,14 +1454,6 @@ if ( (mp->str_start[mp->str_ptr]!=mp->pool_in_use)||(str_use!=mp->strs_in_use) )
incr(mp->pact_count);
mp->pact_chars=mp->pact_chars+mp->pool_ptr-str_stop(mp->last_fixed_str);
mp->pact_strs=mp->pact_strs+str_use-mp->fixed_str_use;
-#ifdef DEBUG
-s=mp->str_ptr; t=str_use;
-while ( s<=mp->max_str_ptr ){
- if ( t>mp->max_str_ptr ) mp_confusion(mp, "\"");
- incr(t); s=mp->next_str[s];
-};
-if ( t<=mp->max_str_ptr ) mp_confusion(mp, "\"");
-#endif
@ A few more global variables are needed to keep track of statistics when
|stat| $\ldots$ |tats| blocks are not commented out.
@@ -1449,7 +1473,7 @@ same length that appears in |buffer| starting at position |k|;
the result is |true| if and only if the strings are equal.
@c
-boolean mp_str_eq_buf (MP mp,str_number s, integer k) {
+static boolean mp_str_eq_buf (MP mp,str_number s, integer k) {
/* test equality of strings */
pool_pointer j; /* running index */
j=mp->str_start[s];
@@ -1466,7 +1490,7 @@ is lexicographically greater than, less than, or equal to the second,
the result is respectively positive, negative, or zero.
@c
-integer mp_str_vs_str (MP mp, str_number s, str_number t) {
+static integer mp_str_vs_str (MP mp, str_number s, str_number t) {
/* test equality of strings */
pool_pointer j,k; /* running indices */
integer ls,lt; /* lengths */
@@ -1478,7 +1502,7 @@ integer mp_str_vs_str (MP mp, str_number s, str_number t) {
if ( mp->str_pool[j]!=mp->str_pool[k] ) {
return (mp->str_pool[j]-mp->str_pool[k]);
}
- incr(j); incr(k);
+ j++; k++;
}
return (ls-lt);
}
@@ -1511,7 +1535,7 @@ void mp_get_strings_started (MP mp) {
}
@ @<Declarations@>=
-void mp_get_strings_started (MP mp);
+static void mp_get_strings_started (MP mp);
@ The first 256 strings will consist of a single character only.
@@ -1533,9 +1557,6 @@ even people with an extended character set will want to represent string
to produce visible strings instead of tabs or line-feeds or carriage-returns
or bell-rings or characters that are treated anomalously in text files.
-Unprintable characters of codes 128--255 are, similarly, rendered
-\.{\^\^80}--\.{\^\^ff}.
-
The boolean expression defined here should be |true| unless \MP\ internal
code number~|k| corresponds to a non-troublesome visible symbol in the
local character set.
@@ -1546,7 +1567,7 @@ must be printable.
@^system dependencies@>
@<Character |k| cannot be printed@>=
- (k<' ')||(k>'~')
+ (k<' ')||(k==127)
@* \[5] On-line and off-line printing.
Messages that are sent to a user's terminal and to the transcript-log file
@@ -1604,7 +1625,7 @@ to the terminal, the transcript file, or the \ps\ output file, respectively.
void * log_file; /* transcript of \MP\ session */
void * ps_file; /* the generic font output goes here */
unsigned int selector; /* where to print a message */
-unsigned char dig[23]; /* digits in a number being output */
+unsigned char dig[23]; /* digits in a number, for rounding */
integer tally; /* the number of characters recently printed */
unsigned int term_offset;
/* the number of characters on the current terminal line */
@@ -1615,7 +1636,6 @@ integer trick_count; /* threshold for pseudoprinting, explained later */
integer first_count; /* another variable for pseudoprinting */
@ @<Allocate or initialize ...@>=
-memset(mp->dig,0,23);
mp->trick_buf = xmalloc((mp->error_line+1),sizeof(ASCII_code));
@ @<Dealloc variables@>=
@@ -1630,15 +1650,16 @@ for terminal output, and it is possible to adhere to those conventions
by changing |wterm|, |wterm_ln|, and |wterm_cr| here.
@^system dependencies@>
-@d do_fprintf(f,b) (mp->write_ascii_file)(mp,f,b)
-@d wterm(A) do_fprintf(mp->term_out,(A))
-@d wterm_chr(A) { unsigned char ss[2]; ss[0]=(A); ss[1]=0; do_fprintf(mp->term_out,(char *)ss); }
-@d wterm_cr do_fprintf(mp->term_out,"\n")
-@d wterm_ln(A) { wterm_cr; do_fprintf(mp->term_out,(A)); }
-@d wlog(A) do_fprintf(mp->log_file,(A))
-@d wlog_chr(A) { unsigned char ss[2]; ss[0]=(A); ss[1]=0; do_fprintf(mp->log_file,(char *)ss); }
-@d wlog_cr do_fprintf(mp->log_file, "\n")
-@d wlog_ln(A) { wlog_cr; do_fprintf(mp->log_file,(A)); }
+@(mpmp.h@>=
+#define do_fprintf(f,b) (mp->write_ascii_file)(mp,f,b)
+#define wterm(A) do_fprintf(mp->term_out,(A))
+#define wterm_chr(A) { unsigned char ss[2]; ss[0]=(A); ss[1]='\0'; wterm((char *)ss);}
+#define wterm_cr do_fprintf(mp->term_out,"\n")
+#define wterm_ln(A) { wterm_cr; do_fprintf(mp->term_out,(A)); }
+#define wlog(A) do_fprintf(mp->log_file,(A))
+#define wlog_chr(A) { unsigned char ss[2]; ss[0]=(A); ss[1]='\0'; wlog((char *)ss);}
+#define wlog_cr do_fprintf(mp->log_file, "\n")
+#define wlog_ln(A) { wlog_cr; do_fprintf(mp->log_file,(A)); }
@ To end a line of text output, we call |print_ln|. Cases |0..max_write_files|
@@ -1646,11 +1667,11 @@ use an array |wr_file| that will be declared later.
@d mp_print_text(A) mp_print_str(mp,text((A)))
-@<Internal ...@>=
+@<Internal library ...@>=
+void mp_print (MP mp, const char *s);
void mp_print_ln (MP mp);
void mp_print_visible_char (MP mp, ASCII_code s);
void mp_print_char (MP mp, ASCII_code k);
-void mp_print (MP mp, const char *s);
void mp_print_str (MP mp, str_number s);
void mp_print_nl (MP mp, const char *s);
void mp_print_two (MP mp,scaled x, scaled y) ;
@@ -1719,7 +1740,7 @@ void mp_print_visible_char (MP mp, ASCII_code s) { /* prints a single character
mp->trick_buf[mp->tally % mp->error_line]=s;
break;
case new_string:
- if ( mp->pool_ptr>=mp->max_pool_ptr ) {
+ if (mp->pool_ptr>=mp->pool_size || mp->pool_ptr>=mp->max_pool_ptr ) {
mp_unit_str_room(mp);
if ( mp->pool_ptr>=mp->pool_size )
goto DONE; /* drop characters if string space is full */
@@ -1727,7 +1748,7 @@ void mp_print_visible_char (MP mp, ASCII_code s) { /* prints a single character
append_char(s);
break;
default:
- { char ss[2]; ss[0] = xchr(s); ss[1]=0;
+ { text_char ss[2]; ss[0] = xchr(s); ss[1]=0;
do_fprintf(mp->wr_file[(mp->selector-write_file)],(char *)ss);
}
}
@@ -1743,13 +1764,8 @@ printed in three- or four-symbol form like `\.{\^\^A}' or `\.{\^\^e4}'.
characters when |selector| is in the range |0..max_write_files-1|.
The user might want to write unprintable characters.
-@d print_lc_hex(A) do { l=(A);
- mp_print_visible_char(mp, (l<10 ? l+'0' : l-10+'a'));
- } while (0)
-
@<Basic printing...@>=
void mp_print_char (MP mp, ASCII_code k) { /* prints a single character */
- int l; /* small index or counter */
if ( mp->selector<pseudo || mp->selector>=write_file) {
mp_print_visible_char(mp, k);
} else if ( @<Character |k| cannot be printed@> ) {
@@ -1758,9 +1774,12 @@ void mp_print_char (MP mp, ASCII_code k) { /* prints a single character */
mp_print_visible_char(mp, k+0100);
} else if ( k<0200 ) {
mp_print_visible_char(mp, k-0100);
- } else {
- print_lc_hex(k / 16);
- print_lc_hex(k % 16);
+ } else {
+ int l; /* small index or counter */
+ l = (k / 16);
+ mp_print_visible_char(mp, xord(l<10 ? l+'0' : l-10+'a'));
+ l = (k % 16);
+ mp_print_visible_char(mp, xord(l<10 ? l+'0' : l-10+'a'));
}
} else {
mp_print_visible_char(mp, k);
@@ -1776,17 +1795,22 @@ assumes that it is always safe to print a visible ASCII character.)
@^system dependencies@>
@<Basic print...@>=
-void mp_do_print (MP mp, const char *ss, unsigned int len) { /* prints string |s| */
- unsigned int j = 0;
+static void mp_do_print (MP mp, const char *ss, size_t len) { /* prints string |s| */
+ size_t j = 0;
+ if (mp->selector == new_string) {
+ str_room((integer)(len*4));
+ }
while ( j<len ){
- mp_print_char(mp, ss[j]); incr(j);
+ /* this was |xord((int)ss[j])| but that doesnt work */
+ mp_print_char(mp, (ASCII_code)ss[j]); j++;
}
}
@
@<Basic print...@>=
void mp_print (MP mp, const char *ss) {
- mp_do_print(mp, ss, strlen(ss));
+ if (ss==NULL) return;
+ mp_do_print(mp, ss,strlen(ss));
}
void mp_print_str (MP mp, str_number s) {
pool_pointer j; /* current character code position */
@@ -1795,7 +1819,7 @@ void mp_print_str (MP mp, str_number s) {
@.???@>
}
j=mp->str_start[s];
- mp_do_print(mp, (char *)(mp->str_pool+j), (str_stop(s)-j));
+ mp_do_print(mp, (char *)(mp->str_pool+j), (size_t)(str_stop(s)-j));
}
@@ -1806,8 +1830,7 @@ and mem identifier together will occupy at most |max_print_line|
character positions.
@<Initialize the output...@>=
-wterm (banner);
-wterm (version_string);
+wterm (mp->banner);
if (mp->mem_ident!=NULL)
mp_print(mp,mp->mem_ident);
mp_print_ln(mp);
@@ -1836,61 +1859,33 @@ void mp_print_nl (MP mp, const char *s) { /* prints string |s| at beginning of l
mp_print(mp, s);
}
-@ An array of digits in the range |0..9| is printed by |print_the_digs|.
-
-@<Basic print...@>=
-void mp_print_the_digs (MP mp, eight_bits k) {
- /* prints |dig[k-1]|$\,\ldots\,$|dig[0]| */
- while ( k>0 ){
- decr(k); mp_print_char(mp, '0'+mp->dig[k]);
- }
-}
-
@ The following procedure, which prints out the decimal representation of a
-given integer |n|, has been written carefully so that it works properly
-if |n=0| or if |(-n)| would cause overflow. It does not apply |%| or |/|
-to negative arguments, since such operations are not implemented consistently
-on all platforms.
+given integer |n|, assumes that all integers fit nicely into a |int|.
+@^system dependencies@>
@<Basic print...@>=
void mp_print_int (MP mp,integer n) { /* prints an integer in decimal form */
- integer m; /* used to negate |n| in possibly dangerous cases */
- int k = 0; /* index to current digit; we assume that $|n|<10^{23}$ */
- if ( n<0 ) {
- mp_print_char(mp, '-');
- if ( n>-100000000 ) {
- negate(n);
- } else {
- m=-1-n; n=m / 10; m=(m % 10)+1; k=1;
- if ( m<10 ) {
- mp->dig[0]=m;
- } else {
- mp->dig[0]=0; incr(n);
- }
- }
- }
- do {
- mp->dig[k]=n % 10; n=n / 10; incr(k);
- } while (n!=0);
- mp_print_the_digs(mp, k);
+ char s[12];
+ mp_snprintf(s,12,"%d", (int)n);
+ mp_print(mp,s);
}
-@ @<Internal ...@>=
+@ @<Internal library ...@>=
void mp_print_int (MP mp,integer n);
@ \MP\ also makes use of a trivial procedure to print two digits. The
following subroutine is usually called with a parameter in the range |0<=n<=99|.
@c
-void mp_print_dd (MP mp,integer n) { /* prints two least significant digits */
+static void mp_print_dd (MP mp,integer n) { /* prints two least significant digits */
n=abs(n) % 100;
- mp_print_char(mp, '0'+(n / 10));
- mp_print_char(mp, '0'+(n % 10));
+ mp_print_char(mp, xord('0'+(n / 10)));
+ mp_print_char(mp, xord('0'+(n % 10)));
}
-@ @<Internal ...@>=
-void mp_print_dd (MP mp,integer n);
+@ @<Declarations@>=
+static void mp_print_dd (MP mp,integer n);
@ Here is a procedure that asks the user to type a line of input,
assuming that the |selector| setting is either |term_only| or |term_and_log|.
@@ -1909,25 +1904,25 @@ This procedure is never called when |interaction<mp_scroll_mode|.
@c
void mp_term_input (MP mp) { /* gets a line from the terminal */
size_t k; /* index into |buffer| */
- update_terminal; /* Now the user sees the prompt for sure */
- if (!mp_input_ln(mp, mp->term_in )) {
- if (!mp->noninteractive) {
+ if (mp->noninteractive) {
+ if (!mp_input_ln(mp, mp->term_in ))
+ longjmp(*(mp->jump_buf),1); /* chunk finished */
+ mp->buffer[mp->last]=xord('%');
+ } else {
+ update_terminal; /* Now the user sees the prompt for sure */
+ if (!mp_input_ln(mp, mp->term_in )) {
mp_fatal_error(mp, "End of file on the terminal!");
@.End of file on the terminal@>
- } else { /* we are done with this input chunk */
- longjmp(mp->jump_buf,1);
}
- }
- if (!mp->noninteractive) {
mp->term_offset=0; /* the user's line ended with \<\rm return> */
decr(mp->selector); /* prepare to echo the input */
if ( mp->last!=mp->first ) {
- for (k=mp->first;k<=mp->last-1;k++) {
+ for (k=mp->first;k<mp->last;k++) {
mp_print_char(mp, mp->buffer[k]);
}
}
mp_print_ln(mp);
- mp->buffer[mp->last]='%';
+ mp->buffer[mp->last]=xord('%');
incr(mp->selector); /* restore previous status */
}
}
@@ -1979,7 +1974,6 @@ if (mp->interaction==mp_unspecified_mode || mp->interaction>mp_error_stop_mode)
mp->interaction=mp_error_stop_mode;
if (mp->interaction<mp_unspecified_mode)
mp->interaction=mp_batch_mode;
-mp->noninteractive=opt->noninteractive;
@
@@ -1992,7 +1986,19 @@ void mp_print_err(MP mp, const char * A);
void mp_print_err(MP mp, const char * A) {
if ( mp->interaction==mp_error_stop_mode )
wake_up_terminal;
- mp_print_nl(mp, "! ");
+ if (mp->file_line_error_style && file_state && !terminal_input) {
+ mp_print_nl(mp, "");
+ if (mp->long_name != NULL) {
+ mp_print(mp, mp->long_name);
+ } else {
+ mp_print(mp, mp_str(mp,name));
+ }
+ mp_print(mp, ":");
+ mp_print_int(mp, line);
+ mp_print(mp, ": ");
+ } else{
+ mp_print_nl(mp, "! ");
+ }
mp_print(mp, A);
@.!\relax@>
}
@@ -2028,12 +2034,13 @@ Another global variable, |error_count|, is increased by one when an
the end of every statement. If |error_count| reaches 100, \MP\ decides
that there is no point in continuing further.
-@<Types...@>=
-enum mp_history_states {
+@<Exported types@>=
+enum mp_history_state {
mp_spotless=0, /* |history| value when nothing has been amiss yet */
mp_warning_issued, /* |history| value when |begin_diagnostic| has been called */
mp_error_message_issued, /* |history| value when |error| has been called */
- mp_fatal_error_stop /* |history| value when termination was premature */
+ mp_fatal_error_stop, /* |history| value when termination was premature */
+ mp_system_error_stop /* |history| value when termination was due to disaster */
};
@ @<Glob...@>=
@@ -2045,7 +2052,7 @@ int error_count; /* the number of scrolled errors since the last statement ended
be changed to |spotless| if \MP\ survives the initialization process.
@<Allocate or ...@>=
-mp->deletions_allowed=true; mp->error_count=0; /* |history| is initialized elsewhere */
+mp->deletions_allowed=true; /* |history| is initialized elsewhere */
@ Since errors can be detected almost anywhere in \MP, we want to declare the
error procedures near the beginning of the program. But the error procedures
@@ -2059,14 +2066,12 @@ occurs while \MP\ is trying to fix a non-fatal one. But such recursion
is never more than two levels deep.
@<Declarations@>=
-void mp_get_next (MP mp);
-void mp_term_input (MP mp);
-void mp_show_context (MP mp);
-void mp_begin_file_reading (MP mp);
-void mp_open_log_file (MP mp);
-void mp_clear_for_error_prompt (MP mp);
-void mp_debug_help (MP mp);
-@<Declare the procedure called |flush_string|@>
+static void mp_get_next (MP mp);
+static void mp_term_input (MP mp);
+static void mp_show_context (MP mp);
+static void mp_begin_file_reading (MP mp);
+static void mp_open_log_file (MP mp);
+static void mp_clear_for_error_prompt (MP mp);
@ @<Internal ...@>=
void mp_normalize_selector (MP mp);
@@ -2075,12 +2080,12 @@ void mp_normalize_selector (MP mp);
contains entries in positions |0..(help_ptr-1)|. They should be printed
in reverse order, i.e., with |help_line[0]| appearing last.
-@d hlp1(A) mp->help_line[0]=(A); }
-@d hlp2(A) mp->help_line[1]=(A); hlp1
-@d hlp3(A) mp->help_line[2]=(A); hlp2
-@d hlp4(A) mp->help_line[3]=(A); hlp3
-@d hlp5(A) mp->help_line[4]=(A); hlp4
-@d hlp6(A) mp->help_line[5]=(A); hlp5
+@d hlp1(A) mp->help_line[0]=A; }
+@d hlp2(A,B) mp->help_line[1]=A; hlp1(B)
+@d hlp3(A,B,C) mp->help_line[2]=A; hlp2(B,C)
+@d hlp4(A,B,C,D) mp->help_line[3]=A; hlp3(B,C,D)
+@d hlp5(A,B,C,D,E) mp->help_line[4]=A; hlp4(B,C,D,E)
+@d hlp6(A,B,C,D,E,F) mp->help_line[5]=A; hlp5(B,C,D,E,F)
@d help0 mp->help_ptr=0 /* sometimes there might be no help */
@d help1 { mp->help_ptr=1; hlp1 /* use this with one help line */
@d help2 { mp->help_ptr=2; hlp2 /* use this with two help lines */
@@ -2097,7 +2102,7 @@ str_number err_help; /* a string set up by \&{errhelp} */
str_number filename_template; /* a string set up by \&{filenametemplate} */
@ @<Allocate or ...@>=
-mp->help_ptr=0; mp->use_err_help=false; mp->err_help=0; mp->filename_template=0;
+mp->use_err_help=false;
@ The |jump_out| procedure just cuts across all active procedure levels and
goes to |end_of_MP|. This is the only nonlocal |goto| statement in the
@@ -2110,24 +2115,17 @@ of |mp_run|. Those are the only library enty points.
@^system dependencies@>
@<Glob...@>=
-jmp_buf jump_buf;
-
-@ @<Install and test the non-local jump buffer@>=
-if (setjmp(mp->jump_buf) != 0) { return mp->history; }
-
-@ @<Setup the non-local jump buffer in |mp_new|@>=
-if (setjmp(mp->jump_buf) != 0) return NULL;
-
+jmp_buf *jump_buf;
@ If the array of internals is still |NULL| when |jump_out| is called, a
crash occured during initialization, and it is not safe to run the normal
cleanup routine.
@<Error hand...@>=
-void mp_jump_out (MP mp) {
- if(mp->internal!=NULL)
+static void mp_jump_out (MP mp) {
+ if (mp->internal!=NULL && mp->history < mp_system_error_stop)
mp_close_files_and_terminate(mp);
- longjmp(mp->jump_buf,1);
+ longjmp(*(mp->jump_buf),1);
}
@ Here now is the general |error| routine.
@@ -2139,7 +2137,7 @@ void mp_error (MP mp) { /* completes the job of error reporting */
pool_pointer j; /* character position being printed */
if ( mp->history<mp_error_message_issued )
mp->history=mp_error_message_issued;
- mp_print_char(mp, '.'); mp_show_context(mp);
+ mp_print_char(mp, xord('.')); mp_show_context(mp);
if ((!mp->noninteractive) && (mp->interaction==mp_error_stop_mode )) {
@<Get user's advice and |return|@>;
}
@@ -2152,7 +2150,7 @@ void mp_error (MP mp) { /* completes the job of error reporting */
@<Put help message on the transcript file@>;
}
void mp_warn (MP mp, const char *msg) {
- int saved_selector = mp->selector;
+ unsigned saved_selector = mp->selector;
mp_normalize_selector(mp);
mp_print_nl(mp,"Warning: ");
mp_print(mp,msg);
@@ -2161,12 +2159,12 @@ void mp_warn (MP mp, const char *msg) {
}
@ @<Exported function ...@>=
-void mp_error (MP mp);
-void mp_warn (MP mp, const char *msg);
+extern void mp_error (MP mp);
+extern void mp_warn (MP mp, const char *msg);
@ @<Get user's advice...@>=
-while (1) {
+while (true) {
CONTINUE:
mp_clear_for_error_prompt(mp); prompt_input("? ");
@.?\relax@>
@@ -2185,25 +2183,23 @@ edited and the relevant line number.
@^system dependencies@>
@<Exported types@>=
-typedef void (*mp_run_editor_command)(MP, char *, int);
+typedef void (*mp_editor_cmd)(MP, char *, int);
@ @<Option variables@>=
-mp_run_editor_command run_editor;
+mp_editor_cmd run_editor;
@ @<Allocate or initialize ...@>=
set_callback_option(run_editor);
@ @<Declarations@>=
-void mp_run_editor (MP mp, char *fname, int fline);
+static void mp_run_editor (MP mp, char *fname, int fline);
-@ @c void mp_run_editor (MP mp, char *fname, int fline) {
- mp_print_nl(mp, "You want to edit file ");
+@ @c
+void mp_run_editor (MP mp, char *fname, int fline) {
+ char *s = xmalloc(256,1);
+ mp_snprintf(s, 256,"You want to edit file %s at line %d\n", fname, fline);
+ wterm_ln(s);
@.You want to edit file x@>
- mp_print(mp, fname);
- mp_print(mp, " at line ");
- mp_print_int(mp, fline);
- mp->interaction=mp_scroll_mode;
- mp_jump_out(mp);
}
@
@@ -2219,27 +2215,25 @@ case '5': case '6': case '7': case '8': case '9':
@<Delete |c-"0"| tokens and |continue|@>;
}
break;
-#ifdef DEBUG
-case 'D':
- mp_debug_help(mp); continue;
- break;
-#endif
case 'E':
if ( mp->file_ptr>0 ){
+ mp->interaction=mp_scroll_mode;
+ mp_close_files_and_terminate(mp);
(mp->run_editor)(mp,
str(mp->input_stack[mp->file_ptr].name_field),
mp_true_line(mp));
+ mp_jump_out(mp);
}
break;
case 'H':
@<Print the help information and |continue|@>;
- break;
+ /* |break;| */
case 'I':
@<Introduce new material from the terminal and |return|@>;
- break;
+ /* |break;| */
case 'Q': case 'R': case 'S':
@<Change the interaction level and |return|@>;
- break;
+ /* |break;| */
case 'X':
mp->interaction=mp_scroll_mode; mp_jump_out(mp);
break;
@@ -2287,12 +2281,12 @@ to be familiar with \MP's input stacks.
{
mp_begin_file_reading(mp); /* enter a new syntactic level for terminal input */
if ( mp->last>mp->first+1 ) {
- loc=mp->first+1; mp->buffer[mp->first]=' ';
+ loc=(halfword)(mp->first+1); mp->buffer[mp->first]=xord(' ');
} else {
- prompt_input("insert>"); loc=mp->first;
+ prompt_input("insert>"); loc=(halfword)mp->first;
@.insert>@>
};
- mp->first=mp->last+1; mp->cur_input.limit_field=mp->last; return;
+ mp->first=mp->last+1; mp->cur_input.limit_field=(halfword)mp->last; return;
}
@ We allow deletion of up to 99 tokens at a time.
@@ -2301,7 +2295,7 @@ to be familiar with \MP's input stacks.
{
s1=mp->cur_cmd; s2=mp->cur_mod; s3=mp->cur_sym; mp->OK_to_interrupt=false;
if ( (mp->last>mp->first+1) && (mp->buffer[mp->first+1]>='0')&&(mp->buffer[mp->first+1]<='9') )
- c=c*10+mp->buffer[mp->first+1]-'0'*11;
+ c=xord(c*10+mp->buffer[mp->first+1]-'0'*11);
else
c=c-'0';
while ( c>0 ) {
@@ -2310,8 +2304,8 @@ to be familiar with \MP's input stacks.
decr(c);
};
mp->cur_cmd=s1; mp->cur_mod=s2; mp->cur_sym=s3; mp->OK_to_interrupt=true;
- help2("I have just deleted some text, as you asked.")
- ("You can now delete more, or insert, or whatever.");
+ help2("I have just deleted some text, as you asked.",
+ "You can now delete more, or insert, or whatever.");
mp_show_context(mp);
goto CONTINUE;
}
@@ -2323,17 +2317,17 @@ to be familiar with \MP's input stacks.
mp->use_err_help=false;
} else {
if ( mp->help_ptr==0 ) {
- help2("Sorry, I don't know how to help in this situation.")
- ("Maybe you should try asking a human?");
+ help2("Sorry, I don't know how to help in this situation.",
+ "Maybe you should try asking a human?");
}
do {
decr(mp->help_ptr); mp_print(mp, mp->help_line[mp->help_ptr]); mp_print_ln(mp);
} while (mp->help_ptr!=0);
};
- help4("Sorry, I already gave what help I could...")
- ("Maybe you should try asking a human?")
- ("An error might have occurred before I noticed any problems.")
- ("``If all else fails, read the instructions.''");
+ help4("Sorry, I already gave what help I could...",
+ "Maybe you should try asking a human?",
+ "An error might have occurred before I noticed any problems.",
+ "``If all else fails, read the instructions.''");
goto CONTINUE;
}
@@ -2343,8 +2337,8 @@ while ( j<str_stop(mp->err_help) ) {
if ( mp->str_pool[j]!='%' ) mp_print_str(mp, mp->str_pool[j]);
else if ( j+1==str_stop(mp->err_help) ) mp_print_ln(mp);
else if ( mp->str_pool[j+1]!='%' ) mp_print_ln(mp);
- else { incr(j); mp_print_char(mp, '%'); };
- incr(j);
+ else { j++; mp_print_char(mp, xord('%')); };
+ j++;
}
@ @<Put help message on the transcript file@>=
@@ -2369,7 +2363,7 @@ running a bit longer.
void mp_normalize_selector (MP mp) {
if ( mp->log_opened ) mp->selector=term_and_log;
else mp->selector=term_only;
- if ( mp->job_name==NULL ) mp_open_log_file(mp);
+ if ( mp->job_name==NULL) mp_open_log_file(mp);
if ( mp->interaction==mp_batch_mode ) decr(mp->selector);
}
@@ -2378,7 +2372,6 @@ void mp_normalize_selector (MP mp) {
@d succumb { if ( mp->interaction==mp_error_stop_mode )
mp->interaction=mp_scroll_mode; /* no more interaction */
if ( mp->log_opened ) mp_error(mp);
- /*| if ( mp->interaction>mp_batch_mode ) mp_debug_help(mp); |*/
mp->history=mp_fatal_error_stop; mp_jump_out(mp); /* irrecoverable error */
}
@@ -2390,19 +2383,20 @@ void mp_fatal_error (MP mp, const char *s) { /* prints |s|, and that's it */
}
@ @<Exported function ...@>=
-void mp_fatal_error (MP mp, const char *s);
+extern void mp_fatal_error (MP mp, const char *s);
@ Here is the most dreaded error message.
@<Error hand...@>=
void mp_overflow (MP mp, const char *s, integer n) { /* stop due to finiteness */
+ char msg[256];
mp_normalize_selector(mp);
- print_err("MetaPost capacity exceeded, sorry [");
+ mp_snprintf(msg, 256, "MetaPost capacity exceeded, sorry [%s=%d]",s,(int)n);
@.MetaPost capacity exceeded ...@>
- mp_print(mp, s); mp_print_char(mp, '='); mp_print_int(mp, n); mp_print_char(mp, ']');
- help2("If you really absolutely need more capacity,")
- ("you can ask a wizard to enlarge me.");
+ print_err(msg);
+ help2("If you really absolutely need more capacity,",
+ "you can ask a wizard to enlarge me.");
succumb;
}
@@ -2420,19 +2414,21 @@ help to pinpoint the problem.
@<Internal library ...@>=
void mp_confusion (MP mp, const char *s);
-@ @<Error hand...@>=
+@ Consistency check violated; |s| tells where.
+@<Error hand...@>=
void mp_confusion (MP mp, const char *s) {
- /* consistency check violated; |s| tells where */
+ char msg[256];
mp_normalize_selector(mp);
if ( mp->history<mp_error_message_issued ) {
- print_err("This can't happen ("); mp_print(mp, s); mp_print_char(mp, ')');
+ mp_snprintf(msg, 256, "This can't happen (%s)",s);
@.This can't happen@>
+ print_err(msg);
help1("I'm broken. Please show this to someone who can fix can fix");
} else {
print_err("I can\'t go on meeting you like this");
@.I can't go on...@>
- help2("One of your faux pas seems to have wounded me deeply...")
- ("in fact, I'm barely conscious. Please fix it and try again.");
+ help2("One of your faux pas seems to have wounded me deeply...",
+ "in fact, I'm barely conscious. Please fix it and try again.");
}
succumb;
}
@@ -2452,9 +2448,11 @@ a way to make |interrupt| nonzero using the C debugger.
integer interrupt; /* should \MP\ pause for instructions? */
boolean OK_to_interrupt; /* should interrupts be observed? */
integer run_state; /* are we processing input ?*/
+boolean finished; /* set true by |close_files_and_terminate| */
@ @<Allocate or ...@>=
-mp->interrupt=0; mp->OK_to_interrupt=true; mp->run_state=0;
+mp->OK_to_interrupt=true;
+mp->finished=false;
@ When an interrupt has been detected, the program goes into its
highest interaction level and lets the user have the full flexibility of
@@ -2462,16 +2460,16 @@ the |error| routine. \MP\ checks for interrupts only at times when it is
safe to do this.
@c
-void mp_pause_for_instructions (MP mp) {
+static void mp_pause_for_instructions (MP mp) {
if ( mp->OK_to_interrupt ) {
mp->interaction=mp_error_stop_mode;
if ( (mp->selector==log_only)||(mp->selector==no_print) )
incr(mp->selector);
print_err("Interruption");
@.Interruption@>
- help3("You rang?")
- ("Try to insert some instructions for me (e.g.,`I show x'),")
- ("unless you just want to quit by typing `X'.");
+ help3("You rang?",
+ "Try to insert some instructions for me (e.g.,`I show x'),",
+ "unless you just want to quit by typing `X'.");
mp->deletions_allowed=false; mp_error(mp); mp->deletions_allowed=true;
mp->interrupt=0;
}
@@ -2482,9 +2480,11 @@ inserted behind the scenes. We can save string space and program space
by putting this common code into a subroutine.
@c
-void mp_missing_err (MP mp, const char *s) {
- print_err("Missing `"); mp_print(mp, s); mp_print(mp, "' has been inserted");
+static void mp_missing_err (MP mp, const char *s) {
+ char msg[256];
+ mp_snprintf(msg, 256, "Missing `%s' has been inserted", s);
@.Missing...inserted@>
+ print_err(msg);
}
@* \[7] Arithmetic with scaled numbers.
@@ -2505,7 +2505,8 @@ language is being used properly. The \TeX\ processor has been defined
carefully so that both varieties of arithmetic will produce identical
output, but it would be too inefficient to constrain \MP\ in a similar way.
-@d el_gordo 017777777777 /* $2^{31}-1$, the largest value that \MP\ likes */
+@d el_gordo 0x7fffffff /* $2^{31}-1$, the largest value that \MP\ likes */
+
@ One of \MP's most common operations is the calculation of
$\lfloor{a+b\over2}\rfloor$,
@@ -2522,7 +2523,7 @@ that is used only when the quantity being halved is known to be positive
or zero.
@d half(A) ((A) / 2)
-@d halfp(A) ((A) >> 1)
+@d halfp(A) (integer)((unsigned)(A) >> 1)
@ A single computation might use several subroutine calls, and it is
desirable to avoid producing multiple error messages in case of arithmetic
@@ -2542,13 +2543,13 @@ an arithmetic error has been detected.
@d check_arith { if ( mp->arith_error ) mp_clear_arith(mp); }
@c
-void mp_clear_arith (MP mp) {
+static void mp_clear_arith (MP mp) {
print_err("Arithmetic overflow");
@.Arithmetic overflow@>
- help4("Uh, oh. A little while ago one of the quantities that I was")
- ("computing got too large, so I'm afraid your answers will be")
- ("somewhat askew. You'll probably have to adopt different")
- ("tactics next time. But I shall try to carry on anyway.");
+ help4("Uh, oh. A little while ago one of the quantities that I was",
+ "computing got too large, so I'm afraid your answers will be",
+ "somewhat askew. You'll probably have to adopt different",
+ "tactics next time. But I shall try to carry on anyway.");
mp_error(mp);
mp->arith_error=false;
}
@@ -2557,7 +2558,7 @@ void mp_clear_arith (MP mp) {
but in places where overflow isn't too unlikely the |slow_add| routine
is used.
-@c integer mp_slow_add (MP mp,integer x, integer y) {
+@c static integer mp_slow_add (MP mp,integer x, integer y) {
if ( x>=0 ) {
if ( y<=el_gordo-x ) {
return x+y;
@@ -2586,20 +2587,19 @@ positions from the right end of a binary computer word.
@<Types...@>=
typedef integer scaled; /* this type is used for scaled integers */
-typedef unsigned char small_number; /* this type is self-explanatory */
@ The following function is used to create a scaled integer from a given decimal
fraction $(.d_0d_1\ldots d_{k-1})$, where |0<=k<=17|. The digit $d_i$ is
given in |dig[i]|, and the calculation produces a correctly rounded result.
@c
-scaled mp_round_decimals (MP mp,small_number k) {
+static scaled mp_round_decimals (MP mp,quarterword k) {
/* converts a decimal fraction */
- integer a = 0; /* the accumulator */
+ unsigned a = 0; /* the accumulator */
while ( k-->0 ) {
a=(a+mp->dig[k]*two) / 10;
}
- return halfp(a+1);
+ return (scaled)halfp(a+1);
}
@ Conversely, here is a procedure analogous to |print_int|. If the output
@@ -2620,18 +2620,18 @@ terminate before $s$ can possibly become zero.
void mp_print_scaled (MP mp,scaled s) { /* prints scaled real, rounded to five digits */
scaled delta; /* amount of allowable inaccuracy */
if ( s<0 ) {
- mp_print_char(mp, '-');
+ mp_print_char(mp, xord('-'));
negate(s); /* print the sign, if negative */
}
mp_print_int(mp, s / unity); /* print the integer part */
s=10*(s % unity)+5;
if ( s!=5 ) {
delta=10;
- mp_print_char(mp, '.');
+ mp_print_char(mp, xord('.'));
do {
if ( delta>unity )
s=s+0100000-(delta / 2); /* round the final digit */
- mp_print_char(mp, '0'+(s / unity));
+ mp_print_char(mp, xord('0'+(s / unity)));
s=10*(s % unity);
delta=delta*10;
} while (s>delta);
@@ -2643,11 +2643,11 @@ separated by a comma.
@<Basic printing...@>=
void mp_print_two (MP mp,scaled x, scaled y) { /* prints `|(x,y)|' */
- mp_print_char(mp, '(');
+ mp_print_char(mp, xord('('));
mp_print_scaled(mp, x);
- mp_print_char(mp, ',');
+ mp_print_char(mp, xord(','));
mp_print_scaled(mp, y);
- mp_print_char(mp, ')');
+ mp_print_char(mp, xord(')'));
}
@ The |scaled| quantities in \MP\ programs are generally supposed to be
@@ -2715,13 +2715,14 @@ such changes aren't advisable; simplicity and robustness are
preferable to trickery, unless the cost is too high.
@^inner loop@>
-@<Internal ...@>=
-fraction mp_make_fraction (MP mp,integer p, integer q);
+@<Internal library declarations@>=
integer mp_take_scaled (MP mp,integer q, scaled f) ;
+@ @<Declarations@>=
+static fraction mp_make_fraction (MP mp,integer p, integer q);
+
@ If FIXPT is not defined, we need these preprocessor values
-@d ELGORDO 0x7fffffff
@d TWEXP31 2147483648.0
@d TWEXP28 268435456.0
@d TWEXP16 65536.0
@@ -2731,52 +2732,50 @@ integer mp_take_scaled (MP mp,integer q, scaled f) ;
@c
fraction mp_make_fraction (MP mp,integer p, integer q) {
+ fraction i;
+ if ( q==0 ) mp_confusion(mp, "/");
+@:this can't happen /}{\quad \./@>
#ifdef FIXPT
+{
integer f; /* the fraction bits, with a leading 1 bit */
integer n; /* the integer part of $\vert p/q\vert$ */
- integer be_careful; /* disables certain compiler optimizations */
boolean negative = false; /* should the result be negated? */
if ( p<0 ) {
negate(p); negative=true;
}
- if ( q<=0 ) {
-#ifdef DEBUG
- if ( q==0 ) mp_confusion(mp, '/');
-#endif
-@:this can't happen /}{\quad \./@>
+ if ( q<0 ) {
negate(q); negative = ! negative;
- };
+ }
n=p / q; p=p % q;
if ( n>=8 ){
mp->arith_error=true;
- return ( negative ? -el_gordo : el_gordo);
+ i= ( negative ? -el_gordo : el_gordo);
} else {
n=(n-1)*fraction_one;
@<Compute $f=\lfloor 2^{28}(1+p/q)+{1\over2}\rfloor$@>;
- return (negative ? (-(f+n)) : (f+n));
+ i = (negative ? (-(f+n)) : (f+n));
}
+}
#else /* FIXPT */
+ {
register double d;
- register integer i;
-#ifdef DEBUG
- if (q==0) mp_confusion(mp,'/');
-#endif /* DEBUG */
d = TWEXP28 * (double)p /(double)q;
if ((p^q) >= 0) {
d += 0.5;
- if (d>=TWEXP31) {mp->arith_error=true; return ELGORDO;}
+ if (d>=TWEXP31) {mp->arith_error=true; return el_gordo;}
i = (integer) d;
- if (d==i && ( ((q>0 ? -q : q)&077777)
+ if (d==(double)i && ( ((q>0 ? -q : q)&077777)
* (((i&037777)<<1)-1) & 04000)!=0) --i;
} else {
d -= 0.5;
- if (d<= -TWEXP31) {mp->arith_error=true; return -ELGORDO;}
+ if (d<= -TWEXP31) {mp->arith_error=true; return -el_gordo;}
i = (integer) d;
- if (d==i && ( ((q>0 ? q : -q)&077777)
+ if (d==(double)i && ( ((q>0 ? q : -q)&077777)
* (((i&037777)<<1)+1) & 04000)!=0) ++i;
}
- return i;
+ }
#endif /* FIXPT */
+ return i;
}
@ The |repeat| loop here preserves the following invariant relations
@@ -2794,6 +2793,7 @@ in a register, not store it in memory.
@<Compute $f=\lfloor 2^{28}(1+p/q)+{1\over2}\rfloor$@>=
{
+ integer be_careful; /* disables certain compiler optimizations */
f=1;
do {
be_careful=p-q; p=be_careful+p;
@@ -2817,7 +2817,7 @@ the present implementation consumes almost 20\pct! of \MP's computation
time during typical jobs, so a machine-language substitute is advisable.
@^inner loop@> @^system dependencies@>
-@<Declarations@>=
+@<Internal library declarations@>=
integer mp_take_fraction (MP mp,integer q, fraction f) ;
@ @c
@@ -2858,19 +2858,19 @@ integer mp_take_fraction (MP mp,integer p, fraction q) {
if (d>=TWEXP31) {
if (d!=TWEXP31 || (((p&077777)*(q&077777))&040000)==0)
mp->arith_error = true;
- return ELGORDO;
+ return el_gordo;
}
i = (integer) d;
- if (d==i && (((p&077777)*(q&077777))&040000)!=0) --i;
+ if (d==(double)i && (((p&077777)*(q&077777))&040000)!=0) --i;
} else {
d -= 0.5;
if (d<= -TWEXP31) {
if (d!= -TWEXP31 || ((-(p&077777)*(q&077777))&040000)==0)
mp->arith_error = true;
- return -ELGORDO;
+ return -el_gordo;
}
i = (integer) d;
- if (d==i && ((-(p&077777)*(q&077777))&040000)!=0) ++i;
+ if (d==(double)i && ((-(p&077777)*(q&077777))&040000)!=0) ++i;
}
return i;
#endif /* FIXPT */
@@ -2951,19 +2951,19 @@ integer mp_take_scaled (MP mp,integer p, scaled q) {
if (d>=TWEXP31) {
if (d!=TWEXP31 || (((p&077777)*(q&077777))&040000)==0)
mp->arith_error = true;
- return ELGORDO;
+ return el_gordo;
}
i = (integer) d;
- if (d==i && (((p&077777)*(q&077777))&040000)!=0) --i;
+ if (d==(double)i && (((p&077777)*(q&077777))&040000)!=0) --i;
} else {
d -= 0.5;
if (d<= -TWEXP31) {
if (d!= -TWEXP31 || ((-(p&077777)*(q&077777))&040000)==0)
mp->arith_error = true;
- return -ELGORDO;
+ return -el_gordo;
}
i = (integer) d;
- if (d==i && ((-(p&077777)*(q&077777))&040000)!=0) ++i;
+ if (d==(double)i && ((-(p&077777)*(q&077777))&040000)!=0) ++i;
}
return i;
#endif /* FIXPT */
@@ -2995,51 +2995,48 @@ scaled mp_make_scaled (MP mp,integer p, integer q) ;
@ @c
scaled mp_make_scaled (MP mp,integer p, integer q) {
-#ifdef FIXPT
- integer f; /* the fraction bits, with a leading 1 bit */
- integer n; /* the integer part of $\vert p/q\vert$ */
- boolean negative; /* should the result be negated? */
- integer be_careful; /* disables certain compiler optimizations */
- if ( p>=0 ) negative=false;
- else { negate(p); negative=true; };
- if ( q<=0 ) {
-#ifdef DEBUG
- if ( q==0 ) mp_confusion(mp, "/");
+ register integer i;
+ if ( q==0 ) mp_confusion(mp, "/");
@:this can't happen /}{\quad \./@>
-#endif
- negate(q); negative=! negative;
- }
- n=p / q; p=p % q;
- if ( n>=0100000 ) {
- mp->arith_error=true;
- return (negative ? (-el_gordo) : el_gordo);
- } else {
- n=(n-1)*unity;
- @<Compute $f=\lfloor 2^{16}(1+p/q)+{1\over2}\rfloor$@>;
- return ( negative ? (-(f+n)) :(f+n));
- }
+ {
+#ifdef FIXPT
+ integer f; /* the fraction bits, with a leading 1 bit */
+ integer n; /* the integer part of $\vert p/q\vert$ */
+ boolean negative; /* should the result be negated? */
+ integer be_careful; /* disables certain compiler optimizations */
+ if ( p>=0 ) negative=false;
+ else { negate(p); negative=true; };
+ if ( q<0 ) {
+ negate(q); negative=! negative;
+ }
+ n=p / q; p=p % q;
+ if ( n>=0100000 ) {
+ mp->arith_error=true;
+ return (negative ? (-el_gordo) : el_gordo);
+ } else {
+ n=(n-1)*unity;
+ @<Compute $f=\lfloor 2^{16}(1+p/q)+{1\over2}\rfloor$@>;
+ i = (negative ? (-(f+n)) :(f+n));
+ }
#else /* FIXPT */
register double d;
- register integer i;
-#ifdef DEBUG
- if (q==0) mp_confusion(mp,"/");
-#endif /* DEBUG */
d = TWEXP16 * (double)p /(double)q;
if ((p^q) >= 0) {
d += 0.5;
- if (d>=TWEXP31) {mp->arith_error=true; return ELGORDO;}
+ if (d>=TWEXP31) {mp->arith_error=true; return el_gordo;}
i = (integer) d;
- if (d==i && ( ((q>0 ? -q : q)&077777)
+ if (d==(double)i && ( ((q>0 ? -q : q)&077777)
* (((i&037777)<<1)-1) & 04000)!=0) --i;
} else {
d -= 0.5;
- if (d<= -TWEXP31) {mp->arith_error=true; return -ELGORDO;}
+ if (d<= -TWEXP31) {mp->arith_error=true; return -el_gordo;}
i = (integer) d;
- if (d==i && ( ((q>0 ? q : -q)&077777)
+ if (d==(double)i && ( ((q>0 ? q : -q)&077777)
* (((i&037777)<<1)+1) & 04000)!=0) ++i;
}
- return i;
#endif /* FIXPT */
+ }
+ return i;
}
@ @<Compute $f=\lfloor 2^{16}(1+p/q)+{1\over2}\rfloor$@>=
@@ -3076,7 +3073,7 @@ arguments |st|, |ct|, |sf|, and |cf|, representing $\sin\theta$, $\cos\theta$,
$\sin\phi$, and $\cos\phi$, respectively.
@c
-fraction mp_velocity (MP mp,fraction st, fraction ct, fraction sf,
+static fraction mp_velocity (MP mp,fraction st, fraction ct, fraction sf,
fraction cf, scaled t) {
integer acc,num,denom; /* registers for intermediate calculations */
acc=mp_take_fraction(mp, st-(sf / 16), sf-(st / 16));
@@ -3102,7 +3099,7 @@ The result is $+1$, 0, or~$-1$ in the three respective cases.
@d mp_ab_vs_cd(M,A,B,C,D) mp_do_ab_vs_cd(A,B,C,D)
@c
-integer mp_do_ab_vs_cd (integer a,integer b, integer c, integer d) {
+static integer mp_do_ab_vs_cd (integer a,integer b, integer c, integer d) {
integer q,r; /* temporary registers */
@<Reduce to the case that |a,c>=0|, |b,d>0|@>;
while (1) {
@@ -3138,8 +3135,8 @@ and truncation operations.
@<Internal library declarations@>=
#define mp_floor_scaled(M,i) ((i)&(-65536))
-#define mp_round_unscaled(M,i) (((i>>15)+1)>>1)
-#define mp_round_fraction(M,i) (((i>>11)+1)>>1)
+#define mp_round_unscaled(M,i) (i>0 ? (((i/32768)+1)/2) : (((i/32768)-1)/2))
+#define mp_round_fraction(M,i) (i>0 ? (((i/2048)+1)/2) : (((i/2048)-1)/2))
@* \[8] Algebraic and transcendental functions.
@@ -3155,12 +3152,13 @@ relations $x=2^{46-2k}x_0\bmod 2^{30}$, $0<y=\lfloor 2^{16-2k}x_0\rfloor
might, however, be zero at the start of the first iteration.
@<Declarations@>=
-scaled mp_square_rt (MP mp,scaled x) ;
+static scaled mp_square_rt (MP mp,scaled x) ;
@ @c
scaled mp_square_rt (MP mp,scaled x) {
- small_number k; /* iteration control counter */
- integer y,q; /* registers for intermediate calculations */
+ quarterword k; /* iteration control counter */
+ integer y; /* register for intermediate calculations */
+ unsigned q; /* register for intermediate calculations */
if ( x<=0 ) {
@<Handle square root of zero or negative argument@>;
} else {
@@ -3174,7 +3172,7 @@ scaled mp_square_rt (MP mp,scaled x) {
@<Decrease |k| by 1, maintaining the invariant
relations between |x|, |y|, and~|q|@>;
} while (k!=0);
- return (halfp(q));
+ return (scaled)(halfp(q));
}
}
@@ -3184,8 +3182,8 @@ scaled mp_square_rt (MP mp,scaled x) {
print_err("Square root of ");
@.Square root...replaced by 0@>
mp_print_scaled(mp, x); mp_print(mp, " has been replaced by 0");
- help2("Since I don't take square roots of negative numbers,")
- ("I'm zeroing this one. Proceed, with fingers crossed.");
+ help2("Since I don't take square roots of negative numbers,",
+ "I'm zeroing this one. Proceed, with fingers crossed.");
mp_error(mp);
};
return 0;
@@ -3194,11 +3192,11 @@ scaled mp_square_rt (MP mp,scaled x) {
@ @<Decrease |k| by 1, maintaining...@>=
x+=x; y+=y;
if ( x>=fraction_four ) { /* note that |fraction_four=@t$2^{30}$@>| */
- x=x-fraction_four; incr(y);
+ x=x-fraction_four; y++;
};
x+=x; y=y+y-q; q+=q;
-if ( x>=fraction_four ) { x=x-fraction_four; incr(y); };
-if ( y>q ){ y=y-q; q=q+2; }
+if ( x>=fraction_four ) { x=x-fraction_four; y++; };
+if ( y>(int)q ){ y=y-q; q=q+2; }
else if ( y<=0 ) { q=q-2; y=y+q; };
decr(k)
@@ -3255,7 +3253,7 @@ while (1) {
It converges slowly when $b$ is near $a$, but otherwise it works fine.
@c
-integer mp_pyth_sub (MP mp,integer a, integer b) {
+static integer mp_pyth_sub (MP mp,integer a, integer b) {
fraction r; /* register used to transform |a| and |b| */
boolean big; /* is the input dangerously near $2^{31}$? */
a=abs(a); b=abs(b);
@@ -3265,7 +3263,7 @@ integer mp_pyth_sub (MP mp,integer a, integer b) {
if ( a<fraction_four ) {
big=false;
} else {
- a=halfp(a); b=halfp(b); big=true;
+ a=(integer)halfp(a); b=(integer)halfp(b); big=true;
}
@<Replace |a| by an approximation to $\psqrt{a^2-b^2}$@>;
if ( big ) double(a);
@@ -3289,8 +3287,8 @@ while (1) {
mp_print(mp, "+-+"); mp_print_scaled(mp, b);
mp_print(mp, " has been replaced by 0");
@.Pythagorean...@>
- help2("Since I don't take square roots of negative numbers,")
- ("I'm zeroing this one. Proceed, with fingers crossed.");
+ help2("Since I don't take square roots of negative numbers,",
+ "I'm zeroing this one. Proceed, with fingers crossed.");
mp_error(mp);
}
a=0;
@@ -3303,9 +3301,9 @@ a bit more calculation, which the author claims to have done correctly:
2^{-k}+{1\over2}2^{-2k}+{1\over3}2^{-3k}+\cdots\,$, rounded to the
nearest integer.
-@d two_to_the(A) (1<<(A))
+@d two_to_the(A) (1<<(unsigned)(A))
-@<Constants ...@>=
+@<Declarations@>=
static const integer spec_log[29] = { 0, /* special logarithms */
93032640, 38612034, 17922280, 8662214, 4261238, 2113709,
1052693, 525315, 262400, 131136, 65552, 32772, 16385,
@@ -3330,7 +3328,7 @@ not become negative; also, the actual amount subtracted from~|y| is~96,
not~100, because we want to add~4 for rounding before the final division by~8.)
@c
-scaled mp_m_log (MP mp,scaled x) {
+static scaled mp_m_log (MP mp,scaled x) {
integer y,z; /* auxiliary registers */
integer k; /* iteration counter */
if ( x<=0 ) {
@@ -3353,7 +3351,7 @@ scaled mp_m_log (MP mp,scaled x) {
@ @<Increase |k| until |x| can...@>=
{
z=((x-1) / two_to_the(k))+1; /* $z=\lceil x/2^k\rceil$ */
- while ( x<fraction_four+z ) { z=halfp(z+1); incr(k); };
+ while ( x<fraction_four+z ) { z=halfp(z+1); k++; };
y+=spec_log[k]; x-=z;
}
@@ -3362,8 +3360,8 @@ scaled mp_m_log (MP mp,scaled x) {
print_err("Logarithm of ");
@.Logarithm...replaced by 0@>
mp_print_scaled(mp, x); mp_print(mp, " has been replaced by 0");
- help2("Since I don't take logs of non-positive numbers,")
- ("I'm zeroing this one. Proceed, with fingers crossed.");
+ help2("Since I don't take logs of non-positive numbers,",
+ "I'm zeroing this one. Proceed, with fingers crossed.");
mp_error(mp);
return 0;
}
@@ -3373,8 +3371,8 @@ when |x| is |scaled|. The result is an integer approximation to
$2^{16}\exp(x/2^{24})$, when |x| is regarded as an integer.
@c
-scaled mp_m_exp (MP mp,scaled x) {
- small_number k; /* loop control index */
+static scaled mp_m_exp (MP mp,scaled x) {
+ quarterword k; /* loop control index */
integer y,z; /* auxiliary registers */
if ( x>174436200 ) {
/* $2^{24}\ln((2^{31}-1)/2^{16})\approx 174436199.51$ */
@@ -3418,14 +3416,14 @@ while ( z>0 ) {
z-=spec_log[k];
y=y-1-((y-two_to_the(k-1)) / two_to_the(k));
}
- incr(k);
+ k++;
}
@ The trigonometric subroutines use an auxiliary table such that
|spec_atan[k]| contains an approximation to the |angle| whose tangent
is~$1/2^k$. $\arctan2^{-k}$ times $2^{20}\cdot180/\pi$
-@<Constants ...@>=
+@<Declarations@>=
static const angle spec_atan[27] = { 0, 27855475, 14718068, 7471121, 3750058,
1876857, 938658, 469357, 234682, 117342, 58671, 29335, 14668, 7334, 3667,
1833, 917, 458, 229, 115, 57, 29, 14, 7, 4, 2, 1 };
@@ -3454,10 +3452,10 @@ to be computationally simplest.
@d eighth_octant (first_octant+negate_y)
@c
-angle mp_n_arg (MP mp,integer x, integer y) {
+static angle mp_n_arg (MP mp,integer x, integer y) {
angle z; /* auxiliary register */
integer t; /* temporary storage */
- small_number k; /* loop counter */
+ quarterword k; /* loop counter */
int octant; /* octant code */
if ( x>=0 ) {
octant=first_octant;
@@ -3482,8 +3480,8 @@ angle mp_n_arg (MP mp,integer x, integer y) {
{
print_err("angle(0,0) is taken as zero");
@.angle(0,0)...zero@>
- help2("The `angle' between two identical points is undefined.")
- ("I'm zeroing this one. Proceed, with fingers crossed.");
+ help2("The `angle' between two identical points is undefined.",
+ "I'm zeroing this one. Proceed, with fingers crossed.");
mp_error(mp);
return 0;
}
@@ -3535,13 +3533,13 @@ there is no chance of integer overflow.
@<Increase |z|...@>=
k=0;
do {
- y+=y; incr(k);
+ y+=y; k++;
if ( y>x ){
z=z+spec_atan[k]; t=x; x=x+(y / two_to_the(k+k)); y=y-t;
};
} while (k!=15);
do {
- y+=y; incr(k);
+ y+=y; k++;
if ( y>x ) { z=z+spec_atan[k]; y=y-x; };
} while (k!=26)
@@ -3560,9 +3558,9 @@ will be between $2^{28}$ and $2^{30}$, so that there will be hardly
any loss of accuracy. Then |x| and~|y| are divided by~|r|.
@c
-void mp_n_sin_cos (MP mp,angle z) { /* computes a multiple of the sine
+static void mp_n_sin_cos (MP mp,angle z) { /* computes a multiple of the sine
and cosine */
- small_number k; /* loop control variable */
+ quarterword k; /* loop control variable */
int q; /* specifies the quadrant */
fraction r; /* magnitude of |(x,y)| */
integer x,y,t; /* temporary registers */
@@ -3605,7 +3603,7 @@ while ( z>0 ){
x=t+y / two_to_the(k);
y=y-t / two_to_the(k);
}
- incr(k);
+ k++;
}
if ( y<0 ) y=0 /* this precaution may never be needed */
@@ -3645,7 +3643,7 @@ and then it will fetch |randoms[j_random]|.
else decr(mp->j_random); }
@c
-void mp_new_randoms (MP mp) {
+static void mp_new_randoms (MP mp) {
int k; /* index into |randoms| */
fraction x; /* accumulator */
for (k=0;k<=23;k++) {
@@ -3662,7 +3660,7 @@ void mp_new_randoms (MP mp) {
}
@ @<Declarations@>=
-void mp_init_randoms (MP mp,scaled seed);
+static void mp_init_randoms (MP mp,scaled seed);
@ To initialize the |randoms| table, we call the following routine.
@@ -3691,7 +3689,7 @@ with about half the probability that it will produce any other particular
values between 0 and~|x|, because it rounds its answers.
@c
-scaled mp_unif_rand (MP mp,scaled x) {
+static scaled mp_unif_rand (MP mp,scaled x) {
scaled y; /* trial value */
next_random; y=mp_take_fraction(mp, abs(x),mp->randoms[mp->j_random]);
if ( y==abs(x) ) return 0;
@@ -3704,7 +3702,7 @@ can readily be obtained with the ratio method (Algorithm 3.4.1R in
{\sl The Art of Computer Programming\/}).
@c
-scaled mp_norm_rand (MP mp) {
+static scaled mp_norm_rand (MP mp) {
integer x,u,l; /* what the book would call $2^{16}X$, $2^{28}U$, and $-2^{24}\ln U$ */
do {
do {
@@ -3753,9 +3751,6 @@ if (mp->ini_version) {
} else {
if ( mp->mem_max<mp->mem_top ) mp->bad=8;
}
-if ( max_quarterword<255 ) mp->bad=9;
-if ( max_halfword<65535 ) mp->bad=10;
-if ( max_quarterword>max_halfword ) mp->bad=11;
if ( mp->mem_max>=max_halfword ) mp->bad=12;
if ( mp->max_strings>max_halfword ) mp->bad=13;
@@ -3764,7 +3759,7 @@ from quarterwords. These are legacy macros.
@^system dependencies@>
@d qo(A) (A) /* to read eight bits from a quarterword */
-@d qi(A) (A) /* to store eight bits in a quarterword */
+@d qi(A) (quarterword)(A) /* to store eight bits in a quarterword */
@ The reader should study the following definitions closely:
@^system dependencies@>
@@ -3807,16 +3802,16 @@ what type it is; so we print it in all modes.
@c
void mp_print_word (MP mp,memory_word w) {
/* prints |w| in all ways */
- mp_print_int(mp, w.cint); mp_print_char(mp, ' ');
- mp_print_scaled(mp, w.sc); mp_print_char(mp, ' ');
+ mp_print_int(mp, w.cint); mp_print_char(mp, xord(' '));
+ mp_print_scaled(mp, w.sc); mp_print_char(mp, xord(' '));
mp_print_scaled(mp, w.sc / 010000); mp_print_ln(mp);
- mp_print_int(mp, w.hh.lh); mp_print_char(mp, '=');
- mp_print_int(mp, w.hh.b0); mp_print_char(mp, ':');
- mp_print_int(mp, w.hh.b1); mp_print_char(mp, ';');
- mp_print_int(mp, w.hh.rh); mp_print_char(mp, ' ');
- mp_print_int(mp, w.qqqq.b0); mp_print_char(mp, ':');
- mp_print_int(mp, w.qqqq.b1); mp_print_char(mp, ':');
- mp_print_int(mp, w.qqqq.b2); mp_print_char(mp, ':');
+ mp_print_int(mp, w.hh.lh); mp_print_char(mp, xord('='));
+ mp_print_int(mp, w.hh.b0); mp_print_char(mp, xord(':'));
+ mp_print_int(mp, w.hh.b1); mp_print_char(mp, xord(';'));
+ mp_print_int(mp, w.hh.rh); mp_print_char(mp, xord(' '));
+ mp_print_int(mp, w.qqqq.b0); mp_print_char(mp, xord(':'));
+ mp_print_int(mp, w.qqqq.b1); mp_print_char(mp, xord(':'));
+ mp_print_int(mp, w.qqqq.b2); mp_print_char(mp, xord(':'));
mp_print_int(mp, w.qqqq.b3);
}
@@ -3873,16 +3868,20 @@ pointer hi_mem_min; /* the smallest location of one-word memory in use */
@
@d xfree(A) do { mp_xfree(A); A=NULL; } while (0)
-@d xrealloc(P,A,B) mp_xrealloc(mp,P,A,B)
-@d xmalloc(A,B) mp_xmalloc(mp,A,B)
+@d xrealloc(P,A,B) mp_xrealloc(mp,P,(size_t)A,B)
+@d xmalloc(A,B) mp_xmalloc(mp,(size_t)A,B)
@d xstrdup(A) mp_xstrdup(mp,A)
@d XREALLOC(a,b,c) a = xrealloc(a,(b+1),sizeof(c));
@<Declare helpers@>=
-void mp_xfree (void *x);
-void *mp_xrealloc (MP mp, void *p, size_t nmem, size_t size) ;
-void *mp_xmalloc (MP mp, size_t nmem, size_t size) ;
-char *mp_xstrdup(MP mp, const char *s);
+extern char *mp_strdup(const char *p) ;
+extern char *mp_strldup(const char *p, size_t l) ;
+extern void mp_xfree ( @= /*@@only@@*/ /*@@out@@*/ /*@@null@@*/ @> void *x);
+extern @= /*@@only@@*/ @> void *mp_xrealloc (MP mp, void *p, size_t nmem, size_t size) ;
+extern @= /*@@only@@*/ @> void *mp_xmalloc (MP mp, size_t nmem, size_t size) ;
+extern @= /*@@only@@*/ @> char *mp_xstrdup(MP mp, const char *s);
+extern @= /*@@only@@*/ @> char *mp_xstrldup(MP mp, const char *s, size_t l);
+extern void mp_do_snprintf(char *str, int size, const char *fmt, ...);
@ The |max_size_test| guards against overflow, on the assumption that
|size_t| is at least 31bits wide.
@@ -3890,6 +3889,18 @@ char *mp_xstrdup(MP mp, const char *s);
@d max_size_test 0x7FFFFFFF
@c
+char *mp_strldup(const char *p, size_t l) {
+ char *r;
+ if (p==NULL) return NULL;
+ r = malloc ((size_t)(l*sizeof(char)+1));
+ if (r==NULL)
+ return NULL;
+ return memcpy (r,p,(size_t)(l+1));
+}
+char *mp_strdup(const char *p) {
+ if (p==NULL) return NULL;
+ return mp_strldup(p, strlen(p));
+}
void mp_xfree (void *x) {
if (x!=NULL) free(x);
}
@@ -3902,7 +3913,7 @@ void *mp_xrealloc (MP mp, void *p, size_t nmem, size_t size) {
w = realloc (p,(nmem*size));
if (w==NULL) {
do_fprintf(mp->err_out,"Out of memory!\n");
- mp->history =mp_fatal_error_stop; mp_jump_out(mp);
+ mp->history =mp_system_error_stop; mp_jump_out(mp);
}
return w;
}
@@ -3915,23 +3926,160 @@ void *mp_xmalloc (MP mp, size_t nmem, size_t size) {
w = malloc (nmem*size);
if (w==NULL) {
do_fprintf(mp->err_out,"Out of memory!\n");
- mp->history =mp_fatal_error_stop; mp_jump_out(mp);
+ mp->history =mp_system_error_stop; mp_jump_out(mp);
}
return w;
}
-char *mp_xstrdup(MP mp, const char *s) {
+char *mp_xstrldup(MP mp, const char *s, size_t l) {
char *w;
if (s==NULL)
return NULL;
- w = strdup(s);
+ w = mp_strldup(s, l);
if (w==NULL) {
do_fprintf(mp->err_out,"Out of memory!\n");
- mp->history =mp_fatal_error_stop; mp_jump_out(mp);
+ mp->history =mp_system_error_stop; mp_jump_out(mp);
}
return w;
}
+char *mp_xstrdup(MP mp, const char *s) {
+ if (s==NULL) return NULL;
+ return mp_xstrldup(mp,s,strlen(s));
+}
+@ @<Internal library declarations@>=
+#ifdef HAVE_SNPRINTF
+extern int snprintf(char *str, size_t size, const char *format, ...);
+#define mp_snprintf (void)snprintf
+#else
+#define mp_snprintf mp_do_snprintf
+#endif
+
+@ This internal version is rather stupid, but good enough for its purpose.
+
+@c
+static char *mp_itoa (int i) {
+ char res[32] ;
+ unsigned idx = 30;
+ unsigned v = (unsigned)abs(i);
+ memset(res,0,32*sizeof(char));
+ while (v>=10) {
+ char d = (char)(v % 10);
+ v = v / 10;
+ res[idx--] = (char)d + '0';
+ }
+ res[idx--] = (char)v + '0';
+ if (i<0) {
+ res[idx--] = '-';
+ }
+ return mp_strdup((res+idx+1));
+}
+static char *mp_utoa (unsigned v) {
+ char res[32] ;
+ unsigned idx = 30;
+ memset(res,0,32*sizeof(char));
+ while (v>=10) {
+ char d = (char)(v % 10);
+ v = v / 10;
+ res[idx--] = d + '0';
+ }
+ res[idx--] = (char)v + '0';
+ return mp_strdup((res+idx+1));
+}
+void mp_do_snprintf (char *str, int size, const char *format, ...) {
+ const char *fmt;
+ char *res;
+ int fw, pad;
+ va_list ap;
+ va_start(ap, format);
+ res = str;
+ for (fmt=format;*fmt!='\0';fmt++) {
+ if (*fmt=='%') {
+ fw=0;
+ pad=0;
+ fmt++;
+ switch(*fmt) {
+ case '0':
+ pad=1;
+ break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ assert(fw==0);
+ fw = *fmt-'0';
+ break;
+ case 's':
+ {
+ char *s = va_arg(ap, char *);
+ while (*s) {
+ *res = *s++;
+ if (size-->0) res++;
+ }
+ }
+ break;
+ case 'i':
+ case 'd':
+ {
+ char *s = mp_itoa(va_arg(ap, int));
+ if (fw) {
+ int ffw = fw-strlen(s);
+ while (ffw-->0) {
+ *res = (pad ? '0' : ' ');
+ if (size-->0) res++;
+ }
+ }
+ if (s != NULL) {
+ while (*s) {
+ *res = *s++;
+ if (size-->0) res++;
+ }
+ }
+ }
+ break;
+ case 'u':
+ {
+ char *s = mp_utoa(va_arg(ap, unsigned));
+ if (fw) {
+ int ffw = fw-strlen(s);
+ while (ffw-->0) {
+ *res = (pad ? '0' : ' ');
+ if (size-->0) res++;
+ }
+ }
+ if (s != NULL) {
+ while (*s) {
+ *res = *s++;
+ if (size-->0) res++;
+ }
+ }
+ }
+ break;
+ case '%':
+ *res = '%';
+ if (size-->0) res++;
+ break;
+ default:
+ *res = '%';
+ if (size-->0) res++;
+ *res = *fmt;
+ if (size-->0) res++;
+ break;
+ }
+ } else {
+ *res = *fmt;
+ if (size-->0) res++;
+ }
+ }
+ *res = '\0';
+ va_end(ap);
+}
+
@
@<Allocate or initialize ...@>=
mp->mem = xmalloc ((mp->mem_max+1),sizeof (memory_word));
@@ -3953,16 +4101,17 @@ integer var_used; integer dyn_used; /* how much memory is in use */
simplest. The pointer variable |mem_end| holds the highest-numbered location
of |mem| that has ever been used. The free locations of |mem| that
occur between |hi_mem_min| and |mem_end|, inclusive, are of type
-|two_halves|, and we write |info(p)| and |link(p)| for the |lh|
+|two_halves|, and we write |info(p)| and |mp_link(p)| for the |lh|
and |rh| fields of |mem[p]| when it is of this type. The single-word
free locations form a linked list
-$$|avail|,\;\hbox{|link(avail)|},\;\hbox{|link(link(avail))|},\;\ldots$$
+$$|avail|,\;\hbox{|mp_link(avail)|},\;\hbox{|mp_link(mp_link(avail))|},\;\ldots$$
terminated by |null|.
-@d link(A) mp->mem[(A)].hh.rh /* the |link| field of a memory word */
-@d info(A) mp->mem[(A)].hh.lh /* the |info| field of a memory word */
+@(mpmp.h@>=
+#define mp_link(A) mp->mem[(A)].hh.rh /* the |link| field of a memory word */
+#define mp_info(A) mp->mem[(A)].hh.lh /* the |info| field of a memory word */
-@<Glob...@>=
+@ @<Glob...@>=
pointer avail; /* head of the list of available one-word nodes */
pointer mem_end; /* the last one-word node used in |mem| */
@@ -3970,20 +4119,16 @@ pointer mem_end; /* the last one-word node used in |mem| */
a token like `\&{enddef}' or `\&{endfor}'. We will define some procedures
later that try to help pinpoint the trouble.
-@c
-@<Declare the procedure called |show_token_list|@>
-@<Declare the procedure called |runaway|@>
-
@ The function |get_avail| returns a pointer to a new one-word node whose
|link| field is null. However, \MP\ will halt if there is no more room left.
@^inner loop@>
@c
-pointer mp_get_avail (MP mp) { /* single-word node allocation */
+static pointer mp_get_avail (MP mp) { /* single-word node allocation */
pointer p; /* the new node being got */
p=mp->avail; /* get top location in the |avail| stack */
if ( p!=null ) {
- mp->avail=link(mp->avail); /* and pop it off */
+ mp->avail=mp_link(mp->avail); /* and pop it off */
} else if ( mp->mem_end<mp->mem_max ) { /* or go into virgin territory */
incr(mp->mem_end); p=mp->mem_end;
} else {
@@ -3995,7 +4140,7 @@ pointer mp_get_avail (MP mp) { /* single-word node allocation */
@:MetaPost capacity exceeded main memory size}{\quad main memory size@>
}
}
- link(p)=null; /* provide an oft-desired initialization of the new node */
+ mp_link(p)=null; /* provide an oft-desired initialization of the new node */
incr(mp->dyn_used);/* maintain statistics */
return p;
}
@@ -4003,7 +4148,7 @@ pointer mp_get_avail (MP mp) { /* single-word node allocation */
@ Conversely, a one-word node is recycled by calling |free_avail|.
@d free_avail(A) /* single-word node liberation */
- { link((A))=mp->avail; mp->avail=(A); decr(mp->dyn_used); }
+ { mp_link((A))=mp->avail; mp->avail=(A); decr(mp->dyn_used); }
@ There's also a |fast_get_avail| routine, which saves the procedure-call
overhead at the expense of extra programming. This macro is used in
@@ -4013,7 +4158,7 @@ the places that would otherwise account for the most calls of |get_avail|.
@d fast_get_avail(A) {
(A)=mp->avail; /* avoid |get_avail| if possible, to save time */
if ( (A)==null ) { (A)=mp_get_avail(mp); }
- else { mp->avail=link((A)); link((A))=null; incr(mp->dyn_used); }
+ else { mp->avail=mp_link((A)); mp_link((A))=null; incr(mp->dyn_used); }
}
@ The available-space list that keeps track of the variable-size portion
@@ -4033,12 +4178,14 @@ of its other fields and its other words.
when |max_halfword| appears in the |link| field of a nonempty node.)
@d empty_flag max_halfword /* the |link| of an empty variable-size node */
-@d is_empty(A) (link((A))==empty_flag) /* tests for empty node */
-@d node_size info /* the size field in empty variable-size nodes */
-@d llink(A) info((A)+1) /* left link in doubly-linked list of empty nodes */
-@d rlink(A) link((A)+1) /* right link in doubly-linked list of empty nodes */
+@d is_empty(A) (mp_link((A))==empty_flag) /* tests for empty node */
-@<Glob...@>=
+@(mpmp.h@>=
+#define node_size mp_info /* the size field in empty variable-size nodes */
+#define lmp_link(A) mp_info((A)+1) /* left link in doubly-linked list of empty nodes */
+#define rmp_link(A) mp_link((A)+1) /* right link in doubly-linked list of empty nodes */
+
+@ @<Glob...@>=
pointer rover; /* points to some node in the list of empties */
@ A call to |get_node| with argument |s| returns a pointer to a new node
@@ -4064,15 +4211,15 @@ pointer mp_get_node (MP mp,integer s) { /* variable-size node allocation */
do {
@<Try to allocate within node |p| and its physical successors,
and |goto found| if allocation was possible@>;
- if (rlink(p)==null || (rlink(p)==p && p!=mp->rover)) {
+ if (rmp_link(p)==null || (rmp_link(p)==p && p!=mp->rover)) {
print_err("Free list garbled");
- help3("I found an entry in the list of free nodes that links")
- ("badly. I will try to ignore the broken link, but something")
- ("is seriously amiss. It is wise to warn the maintainers.")
+ help3("I found an entry in the list of free nodes that links",
+ "badly. I will try to ignore the broken link, but something",
+ "is seriously amiss. It is wise to warn the maintainers.")
mp_error(mp);
- rlink(p)=mp->rover;
+ rmp_link(p)=mp->rover;
}
- p=rlink(p); /* move to the next node in the ring */
+ p=rmp_link(p); /* move to the next node in the ring */
} while (p!=mp->rover); /* repeat until the whole list has been traversed */
if ( s==010000000000 ) {
return max_halfword;
@@ -4086,7 +4233,7 @@ pointer mp_get_node (MP mp,integer s) { /* variable-size node allocation */
/* sorry, nothing satisfactory is left */
@:MetaPost capacity exceeded main memory size}{\quad main memory size@>
FOUND:
- link(r)=null; /* this node is now nonempty */
+ mp_link(r)=null; /* this node is now nonempty */
mp->var_used+=s; /* maintain usage statistics */
return r;
}
@@ -4107,10 +4254,10 @@ implemented on ``virtual memory'' systems.
/* |lo_mem_max+2<=t<hi_mem_min| */
}
if ( t>max_halfword ) t=max_halfword;
- p=llink(mp->rover); q=mp->lo_mem_max; rlink(p)=q; llink(mp->rover)=q;
- rlink(q)=mp->rover; llink(q)=p; link(q)=empty_flag;
+ p=lmp_link(mp->rover); q=mp->lo_mem_max; rmp_link(p)=q; lmp_link(mp->rover)=q;
+ rmp_link(q)=mp->rover; lmp_link(q)=p; mp_link(q)=empty_flag;
node_size(q)=t-mp->lo_mem_max;
- mp->lo_mem_max=t; link(mp->lo_mem_max)=null; info(mp->lo_mem_max)=null;
+ mp->lo_mem_max=t; mp_link(mp->lo_mem_max)=null; mp_info(mp->lo_mem_max)=null;
mp->rover=q;
goto RESTART;
}
@@ -4118,10 +4265,10 @@ implemented on ``virtual memory'' systems.
@ @<Try to allocate...@>=
q=p+node_size(p); /* find the physical successor */
while ( is_empty(q) ) { /* merge node |p| with node |q| */
- t=rlink(q); tt=llink(q);
+ t=rmp_link(q); tt=lmp_link(q);
@^inner loop@>
if ( q==mp->rover ) mp->rover=t;
- llink(t)=tt; rlink(tt)=t;
+ lmp_link(t)=tt; rmp_link(tt)=t;
q=q+node_size(q);
}
r=q-s;
@@ -4129,7 +4276,7 @@ if ( r>p+1 ) {
@<Allocate from the top of node |p| and |goto found|@>;
}
if ( r==p ) {
- if ( rlink(p)!=p ) {
+ if ( rmp_link(p)!=p ) {
@<Allocate entire node |p| and |goto found|@>;
}
}
@@ -4146,8 +4293,8 @@ node_size(p)=q-p /* reset the size in case it grew */
@<Allocate entire...@>=
{
- mp->rover=rlink(p); t=llink(p);
- llink(mp->rover)=t; rlink(t)=mp->rover;
+ mp->rover=rmp_link(p); t=lmp_link(p);
+ lmp_link(mp->rover)=t; rmp_link(t)=mp->rover;
goto FOUND;
}
@@ -4161,50 +4308,14 @@ void mp_free_node (MP mp, pointer p, halfword s) ;
@ @c
void mp_free_node (MP mp, pointer p, halfword s) { /* variable-size node
liberation */
- pointer q; /* |llink(rover)| */
- node_size(p)=s; link(p)=empty_flag;
+ pointer q; /* |lmp_link(rover)| */
+ node_size(p)=s; mp_link(p)=empty_flag;
@^inner loop@>
- q=llink(mp->rover); llink(p)=q; rlink(p)=mp->rover; /* set both links */
- llink(mp->rover)=p; rlink(q)=p; /* insert |p| into the ring */
+ q=lmp_link(mp->rover); lmp_link(p)=q; rmp_link(p)=mp->rover; /* set both links */
+ lmp_link(mp->rover)=p; rmp_link(q)=p; /* insert |p| into the ring */
mp->var_used-=s; /* maintain statistics */
}
-@ Just before \.{INIMP} writes out the memory, it sorts the doubly linked
-available space list. The list is probably very short at such times, so a
-simple insertion sort is used. The smallest available location will be
-pointed to by |rover|, the next-smallest by |rlink(rover)|, etc.
-
-@c
-void mp_sort_avail (MP mp) { /* sorts the available variable-size nodes
- by location */
- pointer p,q,r; /* indices into |mem| */
- pointer old_rover; /* initial |rover| setting */
- p=mp_get_node(mp, 010000000000); /* merge adjacent free areas */
- p=rlink(mp->rover); rlink(mp->rover)=max_halfword; old_rover=mp->rover;
- while ( p!=old_rover ) {
- @<Sort |p| into the list starting at |rover|
- and advance |p| to |rlink(p)|@>;
- }
- p=mp->rover;
- while ( rlink(p)!=max_halfword ) {
- llink(rlink(p))=p; p=rlink(p);
- };
- rlink(p)=mp->rover; llink(mp->rover)=p;
-}
-
-@ The following |while| loop is guaranteed to
-terminate, since the list that starts at
-|rover| ends with |max_halfword| during the sorting procedure.
-
-@<Sort |p|...@>=
-if ( p<mp->rover ) {
- q=p; p=rlink(q); rlink(q)=mp->rover; mp->rover=q;
-} else {
- q=mp->rover;
- while ( rlink(q)<p ) q=rlink(q);
- r=rlink(p); rlink(p)=rlink(q); rlink(q)=p; p=r;
-}
-
@* \[11] Memory layout.
Some areas of |mem| are dedicated to fixed usage, since static allocation is
more efficient than dynamic allocation when we can get away with it. For
@@ -4215,23 +4326,22 @@ symbolic names to the fixed positions. Static variable-size nodes appear
in locations |0| through |lo_mem_stat_max|, and static single-word nodes
appear in locations |hi_mem_stat_min| through |mem_top|, inclusive.
-@d null_dash (2) /* the first two words are reserved for a null value */
-@d dep_head (null_dash+3) /* we will define |dash_node_size=3| */
-@d zero_val (dep_head+2) /* two words for a permanently zero value */
-@d temp_val (zero_val+2) /* two words for a temporary value node */
-@d end_attr temp_val /* we use |end_attr+2| only */
-@d inf_val (end_attr+2) /* and |inf_val+1| only */
-@d test_pen (inf_val+2)
- /* nine words for a pen used when testing the turning number */
-@d bad_vardef (test_pen+9) /* two words for \&{vardef} error recovery */
-@d lo_mem_stat_max (bad_vardef+1) /* largest statically
- allocated word in the variable-size |mem| */
-@#
@d sentinel mp->mem_top /* end of sorted lists */
@d temp_head (mp->mem_top-1) /* head of a temporary list of some kind */
@d hold_head (mp->mem_top-2) /* head of a temporary list of another kind */
-@d spec_head (mp->mem_top-3) /* head of a list of unprocessed \&{special} items */
-@d hi_mem_stat_min (mp->mem_top-3) /* smallest statically allocated word in
+
+@(mpmp.h@>=
+#define spec_head (mp->mem_top-3) /* head of a list of unprocessed \&{special} items */
+#define null_dash (2) /* the first two words are reserved for a null value */
+#define dep_head (null_dash+3) /* we will define |dash_node_size=3| */
+#define zero_val (dep_head+2) /* two words for a permanently zero value */
+#define temp_val (zero_val+2) /* two words for a temporary value node */
+#define end_attr temp_val /* we use |end_attr+2| only */
+#define inf_val (end_attr+2) /* and |inf_val+1| only */
+#define bad_vardef (inf_val+2) /* two words for \&{vardef} error recovery */
+#define lo_mem_stat_max (bad_vardef+1) /* largest statically
+ allocated word in the variable-size |mem| */
+#define hi_mem_stat_min (mp->mem_top-3) /* smallest statically allocated word in
the one-word |mem| */
@ The following code gets the dynamic part of |mem| off to a good start,
@@ -4239,11 +4349,11 @@ when \MP\ is initializing itself the slow way.
@<Initialize table entries (done by \.{INIMP} only)@>=
mp->rover=lo_mem_stat_max+1; /* initialize the dynamic memory */
-link(mp->rover)=empty_flag;
+mp_link(mp->rover)=empty_flag;
node_size(mp->rover)=1000; /* which is a 1000-word available node */
-llink(mp->rover)=mp->rover; rlink(mp->rover)=mp->rover;
+lmp_link(mp->rover)=mp->rover; rmp_link(mp->rover)=mp->rover;
mp->lo_mem_max=mp->rover+1000;
-link(mp->lo_mem_max)=null; info(mp->lo_mem_max)=null;
+mp_link(mp->lo_mem_max)=null; mp_info(mp->lo_mem_max)=null;
for (k=hi_mem_stat_min;k<=(int)mp->mem_top;k++) {
mp->mem[k]=mp->mem[mp->lo_mem_max]; /* clear list heads */
}
@@ -4251,7 +4361,6 @@ mp->avail=null; mp->mem_end=mp->mem_top;
mp->hi_mem_min=hi_mem_stat_min; /* initialize the one-word memory */
mp->var_used=lo_mem_stat_max+1;
mp->dyn_used=mp->mem_top+1-(hi_mem_stat_min); /* initialize statistics */
-@<Initialize a pen at |test_pen| so that it fits in nine words@>;
@ The procedure |flush_list(p)| frees an entire linked list of one-word
nodes that starts at a given position, until coming to |sentinel| or a
@@ -4261,24 +4370,24 @@ nodes, until coming to a |null| pointer.
@^inner loop@>
@c
-void mp_flush_list (MP mp,pointer p) { /* makes list of single-word nodes available */
+static void mp_flush_list (MP mp,pointer p) { /* makes list of single-word nodes available */
pointer q,r; /* list traversers */
if ( p>=mp->hi_mem_min ) if ( p!=sentinel ) {
r=p;
do {
- q=r; r=link(r);
+ q=r; r=mp_link(r);
decr(mp->dyn_used);
if ( r<mp->hi_mem_min ) break;
} while (r!=sentinel);
/* now |q| is the last node on the list */
- link(q)=mp->avail; mp->avail=p;
+ mp_link(q)=mp->avail; mp->avail=p;
}
}
@#
-void mp_flush_node_list (MP mp,pointer p) {
+static void mp_flush_node_list (MP mp,pointer p) {
pointer q; /* the node being recycled */
while ( p!=null ){
- q=p; p=link(p);
+ q=p; p=mp_link(p);
if ( q<mp->hi_mem_min )
mp_free_node(mp, q,2);
else
@@ -4315,15 +4424,14 @@ xfree(mp->free);
xfree(mp->was_free);
@ @<Allocate or ...@>=
-mp->was_mem_end=0; /* indicate that everything was previously free */
-mp->was_lo_max=0; mp->was_hi_min=mp->mem_max;
+mp->was_hi_min=mp->mem_max;
mp->panicking=false;
-@ @<Declare |mp_reallocate| functions@>=
-void mp_reallocate_memory(MP mp, int l) ;
+@ @<Declarations@>=
+static void mp_reallocate_memory(MP mp, int l) ;
@ @c
-void mp_reallocate_memory(MP mp, int l) {
+static void mp_reallocate_memory(MP mp, int l) {
XREALLOC(mp->free, l, unsigned char);
XREALLOC(mp->was_free, l, unsigned char);
if (mp->mem) {
@@ -4378,16 +4486,16 @@ while ( p!=null ) {
@.AVAIL list clobbered...@>
mp_print_int(mp, q); break;
}
- mp->free[p]=true; q=p; p=link(q);
+ mp->free[p]=true; q=p; p=mp_link(q);
}
@ @<Check variable-size...@>=
p=mp->rover; q=null; clobbered=false;
do {
if ( (p>=mp->lo_mem_max)||(p<0) ) clobbered=true;
- else if ( (rlink(p)>=mp->lo_mem_max)||(rlink(p)<0) ) clobbered=true;
+ else if ( (rmp_link(p)>=mp->lo_mem_max)||(rmp_link(p)<0) ) clobbered=true;
else if ( !(is_empty(p))||(node_size(p)<2)||
- (p+node_size(p)>mp->lo_mem_max)|| (llink(rlink(p))!=p) ) clobbered=true;
+ (p+node_size(p)>mp->lo_mem_max)|| (lmp_link(rmp_link(p))!=p) ) clobbered=true;
if ( clobbered ) {
mp_print_nl(mp, "Double-AVAIL list clobbered at ");
@.Double-AVAIL list clobbered...@>
@@ -4401,7 +4509,7 @@ do {
}
mp->free[q]=true;
}
- q=p; p=rlink(p);
+ q=p; p=rmp_link(p);
} while (p!=mp->rover)
@@ -4412,8 +4520,8 @@ while ( p<=mp->lo_mem_max ) { /* node |p| should not be empty */
mp_print_nl(mp, "Bad flag at "); mp_print_int(mp, p);
@.Bad flag...@>
}
- while ( (p<=mp->lo_mem_max) && ! mp->free[p] ) incr(p);
- while ( (p<=mp->lo_mem_max) && mp->free[p] ) incr(p);
+ while ( (p<=mp->lo_mem_max) && ! mp->free[p] ) p++;
+ while ( (p<=mp->lo_mem_max) && mp->free[p] ) p++;
}
@ @<Print newly busy...@>=
@@ -4445,7 +4553,7 @@ blocks compactly. During this operation |q| is the last new busy location and
if ( q>r ) {
mp_print(mp, ".."); mp_print_int(mp, q);
}
- mp_print_char(mp, ' '); mp_print_int(mp, p);
+ mp_print_char(mp, xord(' ')); mp_print_int(mp, p);
r=p;
}
q=p;
@@ -4471,24 +4579,64 @@ drops are tolerable.
void mp_search_mem (MP mp, pointer p) { /* look for pointers to |p| */
integer q; /* current position being searched */
for (q=0;q<=mp->lo_mem_max;q++) {
- if ( link(q)==p ){
- mp_print_nl(mp, "LINK("); mp_print_int(mp, q); mp_print_char(mp, ')');
+ if ( mp_link(q)==p ){
+ mp_print_nl(mp, "LINK("); mp_print_int(mp, q); mp_print_char(mp, xord(')'));
}
- if ( info(q)==p ) {
- mp_print_nl(mp, "INFO("); mp_print_int(mp, q); mp_print_char(mp, ')');
+ if ( mp_info(q)==p ) {
+ mp_print_nl(mp, "INFO("); mp_print_int(mp, q); mp_print_char(mp, xord(')'));
}
}
for (q=mp->hi_mem_min;q<=mp->mem_end;q++) {
- if ( link(q)==p ) {
- mp_print_nl(mp, "LINK("); mp_print_int(mp, q); mp_print_char(mp, ')');
+ if ( mp_link(q)==p ) {
+ mp_print_nl(mp, "LINK("); mp_print_int(mp, q); mp_print_char(mp, xord(')'));
}
- if ( info(q)==p ) {
- mp_print_nl(mp, "INFO("); mp_print_int(mp, q); mp_print_char(mp, ')');
+ if ( mp_info(q)==p ) {
+ mp_print_nl(mp, "INFO("); mp_print_int(mp, q); mp_print_char(mp, xord(')'));
}
}
@<Search |eqtb| for equivalents equal to |p|@>;
}
+@ Just before \.{INIMP} writes out the memory, it sorts the doubly linked
+available space list. The list is probably very short at such times, so a
+simple insertion sort is used. The smallest available location will be
+pointed to by |rover|, the next-smallest by |rmp_link(rover)|, etc.
+
+@<Internal library ...@>=
+void mp_sort_avail (MP mp);
+
+@ @c
+void mp_sort_avail (MP mp) { /* sorts the available variable-size nodes
+ by location */
+ pointer p,q,r; /* indices into |mem| */
+ pointer old_rover; /* initial |rover| setting */
+ p=mp_get_node(mp, 010000000000); /* merge adjacent free areas */
+ p=rmp_link(mp->rover); rmp_link(mp->rover)=max_halfword; old_rover=mp->rover;
+ while ( p!=old_rover ) {
+ @<Sort |p| into the list starting at |rover|
+ and advance |p| to |rmp_link(p)|@>;
+ }
+ p=mp->rover;
+ while ( rmp_link(p)!=max_halfword ) {
+ lmp_link(rmp_link(p))=p; p=rmp_link(p);
+ };
+ rmp_link(p)=mp->rover; lmp_link(mp->rover)=p;
+}
+
+@ The following |while| loop is guaranteed to
+terminate, since the list that starts at
+|rover| ends with |max_halfword| during the sorting procedure.
+
+@<Sort |p|...@>=
+if ( p<mp->rover ) {
+ q=p; p=rmp_link(q); rmp_link(q)=mp->rover; mp->rover=q;
+} else {
+ q=mp->rover;
+ while ( rmp_link(q)<p ) q=rmp_link(q);
+ r=rmp_link(p); rmp_link(p)=rmp_link(q); rmp_link(q)=p; p=r;
+}
+
+
@* \[12] The command codes.
Before we can go much further, we need to define symbolic names for the internal
code numbers that represent the various commands obeyed by \MP. These codes
@@ -4666,10 +4814,10 @@ mp_suffixed_macro /* variable defined with \&{vardef} and \.{\AT!\#} */
} ;
@ @<Declarations@>=
-void mp_print_type (MP mp,small_number t) ;
+static void mp_print_type (MP mp,quarterword t) ;
@ @<Basic printing procedures@>=
-void mp_print_type (MP mp,small_number t) {
+void mp_print_type (MP mp,quarterword t) {
switch (t) {
case mp_vacuous:mp_print(mp, "mp_vacuous"); break;
case mp_boolean_type:mp_print(mp, "boolean"); break;
@@ -4704,7 +4852,7 @@ as well as a |type|. The possibilities for |name_type| are defined
here; they will be explained in more detail later.
@<Types...@>=
-enum mp_name_type {
+enum mp_name_types {
mp_root=0, /* |name_type| at the top level of a variable */
mp_saved_root, /* same, when the variable has been saved */
mp_structured_root, /* |name_type| where a |mp_structured| branch occurs */
@@ -4786,8 +4934,8 @@ values they test for.
@d pen_part 72 /* operation code for \.{penpart} */
@d dash_part 73 /* operation code for \.{dashpart} */
@d sqrt_op 74 /* operation code for \.{sqrt} */
-@d m_exp_op 75 /* operation code for \.{mexp} */
-@d m_log_op 76 /* operation code for \.{mlog} */
+@d mp_m_exp_op 75 /* operation code for \.{mexp} */
+@d mp_m_log_op 76 /* operation code for \.{mlog} */
@d sin_d_op 77 /* operation code for \.{sind} */
@d cos_d_op 78 /* operation code for \.{cosd} */
@d floor_op 79 /* operation code for \.{floor} */
@@ -4844,7 +4992,7 @@ values they test for.
@d mp_version 129 /* operation code for \.{mpversion} */
@d envelope_of 130 /* operation code for \.{envelope} */
-@c void mp_print_op (MP mp,quarterword c) {
+@c static void mp_print_op (MP mp,quarterword c) {
if (c<=mp_numeric_type ) {
mp_print_type(mp, c);
} else {
@@ -4894,8 +5042,8 @@ values they test for.
case pen_part:mp_print(mp, "penpart"); break;
case dash_part:mp_print(mp, "dashpart"); break;
case sqrt_op:mp_print(mp, "sqrt"); break;
- case m_exp_op:mp_print(mp, "mexp"); break;
- case m_log_op:mp_print(mp, "mlog"); break;
+ case mp_m_exp_op:mp_print(mp, "mexp"); break;
+ case mp_m_log_op:mp_print(mp, "mlog"); break;
case sin_d_op:mp_print(mp, "sind"); break;
case cos_d_op:mp_print(mp, "cosd"); break;
case floor_op:mp_print(mp, "floor"); break;
@@ -4914,19 +5062,19 @@ values they test for.
case textual_op:mp_print(mp, "textual"); break;
case clipped_op:mp_print(mp, "clipped"); break;
case bounded_op:mp_print(mp, "bounded"); break;
- case plus:mp_print_char(mp, '+'); break;
- case minus:mp_print_char(mp, '-'); break;
- case times:mp_print_char(mp, '*'); break;
- case over:mp_print_char(mp, '/'); break;
+ case plus:mp_print_char(mp, xord('+')); break;
+ case minus:mp_print_char(mp, xord('-')); break;
+ case times:mp_print_char(mp, xord('*')); break;
+ case over:mp_print_char(mp, xord('/')); break;
case pythag_add:mp_print(mp, "++"); break;
case pythag_sub:mp_print(mp, "+-+"); break;
case or_op:mp_print(mp, "or"); break;
case and_op:mp_print(mp, "and"); break;
- case less_than:mp_print_char(mp, '<'); break;
+ case less_than:mp_print_char(mp, xord('<')); break;
case less_or_equal:mp_print(mp, "<="); break;
- case greater_than:mp_print_char(mp, '>'); break;
+ case greater_than:mp_print_char(mp, xord('>')); break;
case greater_or_equal:mp_print(mp, ">="); break;
- case equal_to:mp_print_char(mp, '='); break;
+ case equal_to:mp_print_char(mp, xord('=')); break;
case unequal_to:mp_print(mp, "<>"); break;
case concatenate:mp_print(mp, "&"); break;
case rotated_by:mp_print(mp, "rotated"); break;
@@ -5014,7 +5162,9 @@ int troff_mode;
@ @<Allocate or initialize ...@>=
mp->max_internal=2*max_given_internal;
mp->internal = xmalloc ((mp->max_internal+1), sizeof(scaled));
+memset(mp->internal,0,(mp->max_internal+1)* sizeof(scaled));
mp->int_name = xmalloc ((mp->max_internal+1), sizeof(char *));
+memset(mp->int_name,0,(mp->max_internal+1) * sizeof(char *));
mp->troff_mode=(opt->troff_mode>0 ? true : false);
@ @<Exported function ...@>=
@@ -5024,10 +5174,6 @@ int mp_troff_mode(MP mp);
int mp_troff_mode(MP mp) { return mp->troff_mode; }
@ @<Set initial ...@>=
-for (k=0;k<= mp->max_internal; k++ ) {
- mp->internal[k]=0;
- mp->int_name[k]=NULL;
-}
mp->int_ptr=max_given_internal;
@ The symbolic names for internal quantities are put into \MP's hash table
@@ -5123,7 +5269,7 @@ There is a first state, that is only used for |gs_colormodel|. It flags
the fact that there has not been any kind of color specification by
the user so far in the game.
-@<Types...@>=
+@(mplib.h@>=
enum mp_color_model {
mp_no_model=1,
mp_grey_model=3,
@@ -5187,7 +5333,7 @@ Note that the values are |scaled| integers. Hence \MP\ can no longer
be used after the year 32767.
@c
-void mp_fix_date_and_time (MP mp) {
+static void mp_fix_date_and_time (MP mp) {
time_t aclock = time ((time_t *) 0);
struct tm *tmptr = localtime (&aclock);
mp->internal[mp_time]=
@@ -5198,7 +5344,7 @@ void mp_fix_date_and_time (MP mp) {
}
@ @<Declarations@>=
-void mp_fix_date_and_time (MP mp) ;
+static void mp_fix_date_and_time (MP mp) ;
@ \MP\ is occasionally supposed to print diagnostic information that
goes only into the transcript file, unless |mp_tracing_online| is positive.
@@ -5206,12 +5352,11 @@ Now that we have defined |mp_tracing_online| we can define
two routines that adjust the destination of print commands:
@<Declarations@>=
-void mp_begin_diagnostic (MP mp) ;
-void mp_end_diagnostic (MP mp,boolean blank_line);
-void mp_print_diagnostic (MP mp, const char *s, const char *t, boolean nuline) ;
+static void mp_begin_diagnostic (MP mp) ;
+static void mp_end_diagnostic (MP mp,boolean blank_line);
+static void mp_print_diagnostic (MP mp, const char *s, const char *t, boolean nuline) ;
@ @<Basic printing...@>=
-@<Declare a function called |true_line|@>
void mp_begin_diagnostic (MP mp) { /* prepare to do some tracing */
mp->old_setting=mp->selector;
if ((mp->internal[mp_tracing_online]<=0)&&(mp->selector==term_and_log)){
@@ -5242,7 +5387,7 @@ void mp_print_diagnostic (MP mp, const char *s, const char *t, boolean nuline) {
if ( nuline ) mp_print_nl(mp, s); else mp_print(mp, s);
mp_print(mp, " at line ");
mp_print_int(mp, mp_true_line(mp));
- mp_print(mp, t); mp_print_char(mp, ':');
+ mp_print(mp, t); mp_print_char(mp, xord(':'));
}
@ The 256 |ASCII_code| characters are grouped into classes by means of
@@ -5328,12 +5473,12 @@ table, it is never removed.
The actual sequence of characters forming a symbolic token is
stored in the |str_pool| array together with all the other strings. An
auxiliary array |hash| consists of items with two halfword fields per
-word. The first of these, called |next(p)|, points to the next identifier
+word. The first of these, called |mp_next(p)|, points to the next identifier
belonging to the same coalesced list as the identifier corresponding to~|p|;
and the other, called |text(p)|, points to the |str_start| entry for
|p|'s identifier. If position~|p| of the hash table is empty, we have
|text(p)=0|; if position |p| is either empty or the end of a coalesced
-hash list, we have |next(p)=0|.
+hash list, we have |mp_next(p)=0|.
An auxiliary pointer variable called |hash_used| is maintained in such a
way that all locations |p>=hash_used| are nonempty. The global variable
@@ -5347,39 +5492,43 @@ values of each symbolic token. The entries of this array consist of
two halfwords called |eq_type| (a command code) and |equiv| (a secondary
piece of information that qualifies the |eq_type|).
-@d next(A) mp->hash[(A)].lh /* link for coalesced lists */
-@d text(A) mp->hash[(A)].rh /* string number for symbolic token name */
@d eq_type(A) mp->eqtb[(A)].lh /* the current ``meaning'' of a symbolic token */
@d equiv(A) mp->eqtb[(A)].rh /* parametric part of a token's meaning */
-@d hash_base 257 /* hashing actually starts here */
@d hash_is_full (mp->hash_used==hash_base) /* are all positions occupied? */
-@<Glob...@>=
+@(mpmp.h@>=
+#define mp_next(A) mp->hash[(A)].lh /* link for coalesced lists */
+#define text(A) mp->hash[(A)].rh /* string number for symbolic token name */
+#define hash_base 257 /* hashing actually starts here */
+
+@ @<Glob...@>=
pointer hash_used; /* allocation pointer for |hash| */
integer st_count; /* total number of known identifiers */
@ Certain entries in the hash table are ``frozen'' and not redefinable,
since they are used in error recovery.
-@d hash_top (hash_base+mp->hash_size) /* the first location of the frozen area */
-@d frozen_inaccessible hash_top /* |hash| location to protect the frozen area */
-@d frozen_repeat_loop (hash_top+1) /* |hash| location of a loop-repeat token */
-@d frozen_right_delimiter (hash_top+2) /* |hash| location of a permanent `\.)' */
-@d frozen_left_bracket (hash_top+3) /* |hash| location of a permanent `\.[' */
-@d frozen_slash (hash_top+4) /* |hash| location of a permanent `\./' */
-@d frozen_colon (hash_top+5) /* |hash| location of a permanent `\.:' */
-@d frozen_semicolon (hash_top+6) /* |hash| location of a permanent `\.;' */
-@d frozen_end_for (hash_top+7) /* |hash| location of a permanent \&{endfor} */
-@d frozen_end_def (hash_top+8) /* |hash| location of a permanent \&{enddef} */
-@d frozen_fi (hash_top+9) /* |hash| location of a permanent \&{fi} */
-@d frozen_end_group (hash_top+10) /* |hash| location of a permanent `\.{endgroup}' */
-@d frozen_etex (hash_top+11) /* |hash| location of a permanent \&{etex} */
-@d frozen_mpx_break (hash_top+12) /* |hash| location of a permanent \&{mpxbreak} */
-@d frozen_bad_vardef (hash_top+13) /* |hash| location of `\.{a bad variable}' */
-@d frozen_undefined (hash_top+14) /* |hash| location that never gets defined */
-@d hash_end (hash_top+14) /* the actual size of the |hash| and |eqtb| arrays */
+@(mpmp.h@>=
+#define hash_top (integer)(hash_base+mp->hash_size) /* the first location of the frozen area */
+#define frozen_inaccessible hash_top /* |hash| location to protect the frozen area */
+#define frozen_repeat_loop (hash_top+1) /* |hash| location of a loop-repeat token */
+#define frozen_right_delimiter (hash_top+2) /* |hash| location of a permanent `\.)' */
+#define frozen_left_bracket (hash_top+3) /* |hash| location of a permanent `\.[' */
+#define frozen_slash (hash_top+4) /* |hash| location of a permanent `\./' */
+#define frozen_colon (hash_top+5) /* |hash| location of a permanent `\.:' */
+#define frozen_semicolon (hash_top+6) /* |hash| location of a permanent `\.;' */
+#define frozen_end_for (hash_top+7) /* |hash| location of a permanent \&{endfor} */
+#define frozen_end_def (hash_top+8) /* |hash| location of a permanent \&{enddef} */
+#define frozen_fi (hash_top+9) /* |hash| location of a permanent \&{fi} */
+#define frozen_end_group (hash_top+10) /* |hash| location of a permanent `\.{endgroup}' */
+#define frozen_etex (hash_top+11) /* |hash| location of a permanent \&{etex} */
+#define frozen_mpx_break (hash_top+12) /* |hash| location of a permanent \&{mpxbreak} */
+#define frozen_bad_vardef (hash_top+13) /* |hash| location of `\.{a bad variable}' */
+#define frozen_undefined (hash_top+14) /* |hash| location that never gets defined */
+#define hash_end (integer)(hash_top+14) /* the actual size of the |hash| and |eqtb| arrays */
-@<Glob...@>=
+
+@ @<Glob...@>=
two_halves *hash; /* the hash table */
two_halves *eqtb; /* the equivalents */
@@ -5392,7 +5541,7 @@ xfree(mp->hash);
xfree(mp->eqtb);
@ @<Set init...@>=
-next(1)=0; text(1)=0; eq_type(1)=tag_token; equiv(1)=null;
+mp_next(1)=0; text(1)=0; eq_type(1)=tag_token; equiv(1)=null;
for (k=2;k<=hash_end;k++) {
mp->hash[k]=mp->hash[1]; mp->eqtb[k]=mp->eqtb[1];
}
@@ -5425,7 +5574,7 @@ will always be found, and the corresponding hash table address
will be returned.
@c
-pointer mp_id_lookup (MP mp,integer j, integer l) { /* search the hash table */
+static pointer mp_id_lookup (MP mp,integer j, integer l) { /* search the hash table */
integer h; /* hash code */
pointer p; /* index in |hash| array */
pointer k; /* index in |buffer| array */
@@ -5437,11 +5586,11 @@ pointer mp_id_lookup (MP mp,integer j, integer l) { /* search the hash table */
while (true) {
if (text(p)>0 && length(text(p))==l && mp_str_eq_buf(mp, text(p),j))
break;
- if ( next(p)==0 ) {
+ if ( mp_next(p)==0 ) {
@<Insert a new symbolic token after |p|, then
make |p| point to it and |break|@>;
}
- p=next(p);
+ p=mp_next(p);
}
return p;
}
@@ -5455,15 +5604,15 @@ pointer mp_id_lookup (MP mp,integer j, integer l) { /* search the hash table */
if ( text(p)>0 ) {
do {
if ( hash_is_full )
- mp_overflow(mp, "hash size",mp->hash_size);
+ mp_overflow(mp, "hash size",(integer)mp->hash_size);
@:MetaPost capacity exceeded hash size}{\quad hash size@>
decr(mp->hash_used);
} while (text(mp->hash_used)!=0); /* search for an empty location in |hash| */
- next(p)=mp->hash_used;
+ mp_next(p)=mp->hash_used;
p=mp->hash_used;
}
str_room(l);
-for (k=j;k<=j+l-1;k++) {
+for (k=j;k<j+l;k++) {
append_char(mp->buffer[k]);
}
text(p)=mp_make_string(mp);
@@ -5481,7 +5630,7 @@ than two table probes, on the average, when the search is successful.
@<Compute the hash code |h|@>=
h=mp->buffer[j];
-for (k=j+1;k<=j+l-1;k++){
+for (k=j+1;k<j+l;k++){
h=h+h+mp->buffer[k];
while ( h>=mp->hash_prime ) h=h-mp->hash_prime;
}
@@ -5491,7 +5640,7 @@ for (q=1;q<=hash_end;q++) {
if ( equiv(q)==p ) {
mp_print_nl(mp, "EQUIV(");
mp_print_int(mp, q);
- mp_print_char(mp, ')');
+ mp_print_char(mp, xord(')'));
}
}
@@ -5502,10 +5651,10 @@ does this, in a way that no \MP\ user can. The global value |cur_sym|
contains the new |eqtb| pointer after |primitive| has acted.
@c
-void mp_primitive (MP mp, const char *ss, halfword c, halfword o) {
+static void mp_primitive (MP mp, const char *ss, halfword c, halfword o) {
pool_pointer k; /* index into |str_pool| */
- small_number j; /* index into |buffer| */
- small_number l; /* length of the string */
+ quarterword j; /* index into |buffer| */
+ quarterword l; /* length of the string */
str_number s;
s = intern(ss);
k=mp->str_start[s]; l=str_stop(s)-k;
@@ -5642,12 +5791,12 @@ case new_internal:mp_print(mp, "newinternal"); break;
case of_token:mp_print(mp, "of"); break;
case path_join:mp_print(mp, ".."); break;
case mp_random_seed:mp_print(mp, "randomseed"); break;
-case relax:mp_print_char(mp, '\\'); break;
-case right_brace:mp_print(mp, "}"); break;
-case right_bracket:mp_print(mp, "]"); break;
+case relax:mp_print_char(mp, xord('\\')); break;
+case right_brace:mp_print_char(mp, xord('}')); break;
+case right_bracket:mp_print_char(mp, xord(']')); break;
case save_command:mp_print(mp, "save"); break;
case scan_tokens:mp_print(mp, "scantokens"); break;
-case semicolon:mp_print(mp, ";"); break;
+case semicolon:mp_print_char(mp, xord(';')); break;
case ship_out_command:mp_print(mp, "shipout"); break;
case skip_to:mp_print(mp, "skipto"); break;
case special_command: if ( m==2 ) mp_print(mp, "fontmapline"); else
@@ -5698,8 +5847,8 @@ Note that
the `\\{type}' field of a node has nothing to do with ``type'' in a
printer's sense. It's curious that the same word is used in such different ways.
-@d type(A) mp->mem[(A)].hh.b0 /* identifies what kind of value this is */
-@d name_type(A) mp->mem[(A)].hh.b1 /* a clue to the name of this value */
+@d mp_type(A) mp->mem[(A)].hh.b0 /* identifies what kind of value this is */
+@d mp_name_type(A) mp->mem[(A)].hh.b1 /* a clue to the name of this value */
@d token_node_size 2 /* the number of words in a large token node */
@d value_loc(A) ((A)+1) /* the word that contains the |value| field */
@d value(A) mp->mem[value_loc((A))].cint /* the value stored in a large token node */
@@ -5714,15 +5863,15 @@ if ( text_base+mp->param_size>max_halfword ) mp->bad=18;
|value(null)=0|. We will make use of this coincidence later.
@<Initialize table entries...@>=
-link(null)=null; value(null)=0;
+mp_link(null)=null; value(null)=0;
@ A numeric token is created by the following trivial routine.
@c
-pointer mp_new_num_tok (MP mp,scaled v) {
+static pointer mp_new_num_tok (MP mp,scaled v) {
pointer p; /* the new node */
p=mp_get_node(mp, token_node_size); value(p)=v;
- type(p)=mp_known; name_type(p)=mp_token;
+ mp_type(p)=mp_known; mp_name_type(p)=mp_token;
return p;
}
@@ -5730,14 +5879,14 @@ pointer mp_new_num_tok (MP mp,scaled v) {
each node contains a token and a link. Here's a subroutine that gets rid
of a token list when it is no longer needed.
-@c void mp_flush_token_list (MP mp,pointer p) {
+@c static void mp_flush_token_list (MP mp,pointer p) {
pointer q; /* the node being recycled */
while ( p!=null ) {
- q=p; p=link(p);
+ q=p; p=mp_link(p);
if ( q>=mp->hi_mem_min ) {
free_avail(q);
} else {
- switch (type(q)) {
+ switch (mp_type(q)) {
case mp_vacuous: case mp_boolean_type: case mp_known:
break;
case mp_string_type:
@@ -5781,14 +5930,14 @@ variable names within a capsule.)
Unusual entries are printed in the form of all-caps tokens
preceded by a space, e.g., `\.{\char`\ BAD}'.
-@<Declare the procedure called |show_token_list|@>=
-void mp_show_token_list (MP mp, integer p, integer q, integer l,
+@<Declarations@>=
+static void mp_show_token_list (MP mp, integer p, integer q, integer l,
integer null_tally) ;
@ @c
void mp_show_token_list (MP mp, integer p, integer q, integer l,
integer null_tally) {
- small_number class,c; /* the |char_class| of previous and new tokens */
+ quarterword class,c; /* the |char_class| of previous and new tokens */
integer r,v; /* temporary registers */
class=percent_class;
mp->tally=null_tally;
@@ -5797,7 +5946,7 @@ void mp_show_token_list (MP mp, integer p, integer q, integer l,
@<Do magic computation@>;
@<Display token |p| and set |c| to its class;
but |return| if there are problems@>;
- class=c; p=link(p);
+ class=c; p=mp_link(p);
}
if ( p!=null )
mp_print(mp, " ETC.");
@@ -5814,7 +5963,7 @@ if ( (p<0)||(p>mp->mem_end) ) {
if ( p<mp->hi_mem_min ) {
@<Display two-word token@>;
} else {
- r=info(p);
+ r=mp_info(p);
if ( r>=expr_base ) {
@<Display a parameter token@>;
} else {
@@ -5839,17 +5988,17 @@ if ( p<mp->hi_mem_min ) {
}
@ @<Display two-word token@>=
-if ( name_type(p)==mp_token ) {
- if ( type(p)==mp_known ) {
+if ( mp_name_type(p)==mp_token ) {
+ if ( mp_type(p)==mp_known ) {
@<Display a numeric token@>;
- } else if ( type(p)!=mp_string_type ) {
+ } else if ( mp_type(p)!=mp_string_type ) {
mp_print(mp, " BAD");
@.BAD@>
} else {
- mp_print_char(mp, '"'); mp_print_str(mp, value(p)); mp_print_char(mp, '"');
+ mp_print_char(mp, xord('"')); mp_print_str(mp, value(p)); mp_print_char(mp, xord('"'));
c=string_class;
}
-} else if ((name_type(p)!=mp_capsule)||(type(p)<mp_vacuous)||(type(p)>mp_independent) ) {
+} else if ((mp_name_type(p)!=mp_capsule)||(mp_type(p)<mp_vacuous)||(mp_type(p)>mp_independent) ) {
mp_print(mp, " BAD");
} else {
mp_print_capsule(mp,p); c=right_paren_class;
@@ -5857,26 +6006,26 @@ if ( name_type(p)==mp_token ) {
@ @<Display a numeric token@>=
if ( class==digit_class )
- mp_print_char(mp, ' ');
+ mp_print_char(mp, xord(' '));
v=value(p);
if ( v<0 ){
if ( class==left_bracket_class )
- mp_print_char(mp, ' ');
- mp_print_char(mp, '['); mp_print_scaled(mp, v); mp_print_char(mp, ']');
+ mp_print_char(mp, xord(' '));
+ mp_print_char(mp, xord('[')); mp_print_scaled(mp, v); mp_print_char(mp, xord(']'));
c=right_bracket_class;
} else {
mp_print_scaled(mp, v); c=digit_class;
}
-@ Strictly speaking, a genuine token will never have |info(p)=0|.
+@ Strictly speaking, a genuine token will never have |mp_info(p)=0|.
But we will see later (in the |print_variable_name| routine) that
-it is convenient to let |info(p)=0| stand for `\.{[]}'.
+it is convenient to let |mp_info(p)=0| stand for `\.{[]}'.
@<Display a collective subscript@>=
{
if ( class==left_bracket_class )
- mp_print_char(mp, ' ');
+ mp_print_char(mp, xord(' '));
mp_print(mp, "[]"); c=right_bracket_class;
}
@@ -5892,7 +6041,7 @@ if ( r<suffix_base ) {
mp_print(mp, "(TEXT"); r=r-(text_base);
@.TEXT@>
}
-mp_print_int(mp, r); mp_print_char(mp, ')'); c=right_paren_class;
+mp_print_int(mp, r); mp_print_char(mp, xord(')')); c=right_paren_class;
}
@@ -5901,20 +6050,20 @@ mp_print_int(mp, r); mp_print_char(mp, ')'); c=right_paren_class;
c=mp->char_class[mp->str_pool[mp->str_start[r]]];
if ( c==class ) {
switch (c) {
- case letter_class:mp_print_char(mp, '.'); break;
+ case letter_class:mp_print_char(mp, xord('.')); break;
case isolated_classes: break;
- default: mp_print_char(mp, ' '); break;
+ default: mp_print_char(mp, xord(' ')); break;
}
}
mp_print_str(mp, r);
}
@ @<Declarations@>=
-void mp_print_capsule (MP mp, pointer p);
+static void mp_print_capsule (MP mp, pointer p);
@ @<Declare miscellaneous procedures that were declared |forward|@>=
void mp_print_capsule (MP mp, pointer p) {
- mp_print_char(mp, '('); mp_print_exp(mp,p,0); mp_print_char(mp, ')');
+ mp_print_char(mp, xord('(')); mp_print_exp(mp,p,0); mp_print_char(mp, xord(')'));
}
@ Macro definitions are kept in \MP's memory in the form of token lists
@@ -5930,7 +6079,7 @@ The next node or nodes after the reference count serve to describe the
formal parameters. They consist of zero or more parameter tokens followed
by a code for the type of macro.
-@d ref_count info
+@d ref_count mp_info
/* reference count preceding a macro definition or picture header */
@d add_mac_ref(A) incr(ref_count((A))) /* make a new reference to a macro list */
@d general_macro 0 /* preface to a macro defined with a parameter list */
@@ -5944,7 +6093,7 @@ by a code for the type of macro.
@d text_macro 7 /* preface to a macro with an undelimited \&{text} parameter */
@c
-void mp_delete_mac_ref (MP mp,pointer p) {
+static void mp_delete_mac_ref (MP mp,pointer p) {
/* |p| points to the reference count of a macro list that is
losing one reference */
if ( ref_count(p)==null ) mp_flush_token_list(mp, p);
@@ -5955,23 +6104,22 @@ void mp_delete_mac_ref (MP mp,pointer p) {
reference count.
@c
-@<Declare the procedure called |print_cmd_mod|@>
-void mp_show_macro (MP mp, pointer p, integer q, integer l) {
+static void mp_show_macro (MP mp, pointer p, integer q, integer l) {
pointer r; /* temporary storage */
- p=link(p); /* bypass the reference count */
- while ( info(p)>text_macro ){
- r=link(p); link(p)=null;
- mp_show_token_list(mp, p,null,l,0); link(p)=r; p=r;
+ p=mp_link(p); /* bypass the reference count */
+ while ( mp_info(p)>text_macro ){
+ r=mp_link(p); mp_link(p)=null;
+ mp_show_token_list(mp, p,null,l,0); mp_link(p)=r; p=r;
if ( l>0 ) l=l-mp->tally; else return;
} /* control printing of `\.{ETC.}' */
@.ETC@>
mp->tally=0;
- switch(info(p)) {
+ switch(mp_info(p)) {
case general_macro:mp_print(mp, "->"); break;
@.->@>
case primary_macro: case secondary_macro: case tertiary_macro:
- mp_print_char(mp, '<');
- mp_print_cmd_mod(mp, param_type,info(p));
+ mp_print_char(mp, xord('<'));
+ mp_print_cmd_mod(mp, param_type,mp_info(p));
mp_print(mp, ">->");
break;
case expr_macro:mp_print(mp, "<expr>->"); break;
@@ -5979,7 +6127,7 @@ void mp_show_macro (MP mp, pointer p, integer q, integer l) {
case suffix_macro:mp_print(mp, "<suffix>->"); break;
case text_macro:mp_print(mp, "<text>->"); break;
} /* there are no other cases */
- mp_show_token_list(mp, link(p),q,l-mp->tally,0);
+ mp_show_token_list(mp, mp_link(p),q,l-mp->tally,0);
}
@* \[15] Data structures for variables.
@@ -6014,8 +6162,8 @@ and |subscr_head|. Those fields point to additional nodes that
contain structural information, as we shall see.
@d subscr_head_loc(A) (A)+1 /* where |value|, |subscr_head| and |attr_head| are */
-@d attr_head(A) info(subscr_head_loc((A))) /* pointer to attribute info */
-@d subscr_head(A) link(subscr_head_loc((A))) /* pointer to subscript info */
+@d attr_head(A) mp_info(subscr_head_loc((A))) /* pointer to attribute info */
+@d subscr_head(A) mp_link(subscr_head_loc((A))) /* pointer to subscript info */
@d value_node_size 2 /* the number of words in a value node */
@ An attribute node is three words long. Two of these words contain |type|
@@ -6026,7 +6174,7 @@ hash address of the token that names this attribute; and there's also a
next higher level (i.e., at the level to which this attribute is
subsidiary). The |name_type| in an attribute node is `|attr|'. The
|link| field points to the next attribute with the same parent; these are
-arranged in increasing order, so that |attr_loc(link(p))>attr_loc(p)|. The
+arranged in increasing order, so that |attr_loc(mp_link(p))>attr_loc(p)|. The
final attribute node links to the constant |end_attr|, whose |attr_loc|
field is greater than any legal hash address. The |attr_head| in the
parent points to a node whose |name_type| is |mp_structured_root|; this
@@ -6062,32 +6210,32 @@ and `\.{x20b}' have been mentioned in a user's program, where
\.{x[]b} has been declared to be of \&{boolean} type. Let |h(x)|, |h(a)|,
and |h(b)| be the hash addresses of \.x, \.a, and~\.b. Then
|eq_type(h(x))=name| and |equiv(h(x))=p|, where |p|~is a two-word value
-node with |name_type(p)=root| and |link(p)=h(x)|. We have |type(p)=mp_structured|,
+node with |mp_name_type(p)=root| and |mp_link(p)=h(x)|. We have |type(p)=mp_structured|,
|attr_head(p)=q|, and |subscr_head(p)=r|, where |q| points to a value
node and |r| to a subscript node. (Are you still following this? Use
a pencil to draw a diagram.) The lone variable `\.x' is represented by
|type(q)| and |value(q)|; furthermore
-|name_type(q)=mp_structured_root| and |link(q)=q1|, where |q1| points
-to an attribute node representing `\.{x[]}'. Thus |name_type(q1)=attr|,
+|mp_name_type(q)=mp_structured_root| and |mp_link(q)=q1|, where |q1| points
+to an attribute node representing `\.{x[]}'. Thus |mp_name_type(q1)=attr|,
|attr_loc(q1)=collective_subscript=0|, |parent(q1)=p|,
|type(q1)=mp_structured|, |attr_head(q1)=qq|, and |subscr_head(q1)=qq1|;
|qq| is a three-word ``attribute-as-value'' node with |type(qq)=numeric_type|
(assuming that \.{x5} is numeric, because |qq| represents `\.{x[]}'
-with no further attributes), |name_type(qq)=structured_root|,
+with no further attributes), |mp_name_type(qq)=structured_root|,
|attr_loc(qq)=0|, |parent(qq)=p|, and
-|link(qq)=qq1|. (Now pay attention to the next part.) Node |qq1| is
+|mp_link(qq)=qq1|. (Now pay attention to the next part.) Node |qq1| is
an attribute node representing `\.{x[][]}', which has never yet
occurred; its |type| field is |undefined|, and its |value| field is
-undefined. We have |name_type(qq1)=attr|, |attr_loc(qq1)=collective_subscript|,
-|parent(qq1)=q1|, and |link(qq1)=qq2|. Since |qq2| represents
+undefined. We have |mp_name_type(qq1)=attr|, |attr_loc(qq1)=collective_subscript|,
+|parent(qq1)=q1|, and |mp_link(qq1)=qq2|. Since |qq2| represents
`\.{x[]b}', |type(qq2)=mp_unknown_boolean|; also |attr_loc(qq2)=h(b)|,
-|parent(qq2)=q1|, |name_type(qq2)=attr|, |link(qq2)=end_attr|.
+|parent(qq2)=q1|, |mp_name_type(qq2)=attr|, |mp_link(qq2)=end_attr|.
(Maybe colored lines will help untangle your picture.)
Node |r| is a subscript node with |type| and |value|
-representing `\.{x5}'; |name_type(r)=subscr|, |subscript(r)=5.0|,
-and |link(r)=r1| is another subscript node. To complete the picture,
-see if you can guess what |link(r1)| is; give up? It's~|q1|.
-Furthermore |subscript(r1)=20.0|, |name_type(r1)=subscr|,
+representing `\.{x5}'; |mp_name_type(r)=subscr|, |subscript(r)=5.0|,
+and |mp_link(r)=r1| is another subscript node. To complete the picture,
+see if you can guess what |mp_link(r1)| is; give up? It's~|q1|.
+Furthermore |subscript(r1)=20.0|, |mp_name_type(r1)=subscr|,
|type(r1)=mp_structured|, |attr_head(r1)=qqq|, |subscr_head(r1)=qqq1|,
and we finish things off with three more nodes
|qqq|, |qqq1|, and |qqq2| hung onto~|r1|. (Perhaps you should start again
@@ -6108,8 +6256,8 @@ branches of the structure below subscript nodes do not carry significant
information in their collective subscript attributes.
@d attr_loc_loc(A) ((A)+2) /* where the |attr_loc| and |parent| fields are */
-@d attr_loc(A) info(attr_loc_loc((A))) /* hash address of this attribute */
-@d parent(A) link(attr_loc_loc((A))) /* pointer to |mp_structured| variable */
+@d attr_loc(A) mp_info(attr_loc_loc((A))) /* hash address of this attribute */
+@d parent(A) mp_link(attr_loc_loc((A))) /* pointer to |mp_structured| variable */
@d subscript_loc(A) ((A)+2) /* where the |subscript| field lives */
@d subscript(A) mp->mem[subscript_loc((A))].sc /* subscript of this variable */
@d attr_node_size 3 /* the number of words in an attribute node */
@@ -6159,9 +6307,9 @@ while expressions are being evaluated. We call them {\sl capsules}.
@d cmykcolor_node_size 8 /* the number of words in a color node */
@<Glob...@>=
-small_number big_node_size[mp_pair_type+1];
-small_number sector0[mp_pair_type+1];
-small_number sector_offset[mp_black_part_sector+1];
+quarterword big_node_size[mp_pair_type+1];
+quarterword sector0[mp_pair_type+1];
+quarterword sector_offset[mp_black_part_sector+1];
@ The |sector0| array gives for each big node type, |name_type| values
for its first subfield; the |sector_offset| array gives for each
@@ -6194,31 +6342,31 @@ for~|p|. The individual parts of such nodes are initially of type
|mp_independent|.
@c
-void mp_init_big_node (MP mp,pointer p) {
+static void mp_init_big_node (MP mp,pointer p) {
pointer q; /* the new node */
- small_number s; /* its size */
- s=mp->big_node_size[type(p)]; q=mp_get_node(mp, s);
+ quarterword s; /* its size */
+ s=mp->big_node_size[mp_type(p)]; q=mp_get_node(mp, s);
do {
s=s-2;
@<Make variable |q+s| newly independent@>;
- name_type(q+s)=halfp(s)+mp->sector0[type(p)];
- link(q+s)=null;
+ mp_name_type(q+s)=halfp(s)+mp->sector0[mp_type(p)];
+ mp_link(q+s)=null;
} while (s!=0);
- link(q)=p; value(p)=q;
+ mp_link(q)=p; value(p)=q;
}
@ The |id_transform| function creates a capsule for the
identity transformation.
@c
-pointer mp_id_transform (MP mp) {
+static pointer mp_id_transform (MP mp) {
pointer p,q,r; /* list manipulation registers */
- p=mp_get_node(mp, value_node_size); type(p)=mp_transform_type;
- name_type(p)=mp_capsule; value(p)=null; mp_init_big_node(mp, p); q=value(p);
+ p=mp_get_node(mp, value_node_size); mp_type(p)=mp_transform_type;
+ mp_name_type(p)=mp_capsule; value(p)=null; mp_init_big_node(mp, p); q=value(p);
r=q+transform_node_size;
do {
r=r-2;
- type(r)=mp_known; value(r)=0;
+ mp_type(r)=mp_known; value(r)=0;
} while (r!=q);
value(xx_part_loc(q))=unity;
value(yy_part_loc(q))=unity;
@@ -6230,10 +6378,10 @@ to |null| until they are first used as the root of a variable.
The following subroutine establishes the root node on such grand occasions.
@c
-void mp_new_root (MP mp,pointer x) {
+static void mp_new_root (MP mp,pointer x) {
pointer p; /* the new node */
- p=mp_get_node(mp, value_node_size); type(p)=undefined; name_type(p)=mp_root;
- link(p)=x; equiv(x)=p;
+ p=mp_get_node(mp, value_node_size); mp_type(p)=undefined; mp_name_type(p)=mp_root;
+ mp_link(p)=x; equiv(x)=p;
}
@ These conventions for variable representation are illustrated by the
@@ -6241,23 +6389,23 @@ void mp_new_root (MP mp,pointer x) {
variable given only a pointer to its two-word value packet.
@<Declarations@>=
-void mp_print_variable_name (MP mp, pointer p);
+static void mp_print_variable_name (MP mp, pointer p);
@ @c
void mp_print_variable_name (MP mp, pointer p) {
pointer q; /* a token list that will name the variable's suffix */
pointer r; /* temporary for token list creation */
- while ( name_type(p)>=mp_x_part_sector ) {
+ while ( mp_name_type(p)>=mp_x_part_sector ) {
@<Preface the output with a part specifier; |return| in the
case of a capsule@>;
}
q=null;
- while ( name_type(p)>mp_saved_root ) {
+ while ( mp_name_type(p)>mp_saved_root ) {
@<Ascend one level, pushing a token onto list |q|
and replacing |p| by its parent@>;
}
- r=mp_get_avail(mp); info(r)=link(p); link(r)=q;
- if ( name_type(p)==mp_saved_root ) mp_print(mp, "(SAVED)");
+ r=mp_get_avail(mp); mp_info(r)=mp_link(p); mp_link(r)=q;
+ if ( mp_name_type(p)==mp_saved_root ) mp_print(mp, "(SAVED)");
@.SAVED@>
mp_show_token_list(mp, r,null,el_gordo,mp->tally);
mp_flush_token_list(mp, r);
@@ -6265,27 +6413,27 @@ void mp_print_variable_name (MP mp, pointer p) {
@ @<Ascend one level, pushing a token onto list |q|...@>=
{
- if ( name_type(p)==mp_subscr ) {
+ if ( mp_name_type(p)==mp_subscr ) {
r=mp_new_num_tok(mp, subscript(p));
do {
- p=link(p);
- } while (name_type(p)!=mp_attr);
- } else if ( name_type(p)==mp_structured_root ) {
- p=link(p); goto FOUND;
+ p=mp_link(p);
+ } while (mp_name_type(p)!=mp_attr);
+ } else if ( mp_name_type(p)==mp_structured_root ) {
+ p=mp_link(p); goto FOUND;
} else {
- if ( name_type(p)!=mp_attr ) mp_confusion(mp, "var");
+ if ( mp_name_type(p)!=mp_attr ) mp_confusion(mp, "var");
@:this can't happen var}{\quad var@>
- r=mp_get_avail(mp); info(r)=attr_loc(p);
+ r=mp_get_avail(mp); mp_info(r)=attr_loc(p);
}
- link(r)=q; q=r;
+ mp_link(r)=q; q=r;
FOUND:
p=parent(p);
}
@ @<Preface the output with a part specifier...@>=
-{ switch (name_type(p)) {
- case mp_x_part_sector: mp_print_char(mp, 'x'); break;
- case mp_y_part_sector: mp_print_char(mp, 'y'); break;
+{ switch (mp_name_type(p)) {
+ case mp_x_part_sector: mp_print_char(mp, xord('x')); break;
+ case mp_y_part_sector: mp_print_char(mp, xord('y')); break;
case mp_xx_part_sector: mp_print(mp, "xx"); break;
case mp_xy_part_sector: mp_print(mp, "xy"); break;
case mp_yx_part_sector: mp_print(mp, "yx"); break;
@@ -6304,28 +6452,28 @@ FOUND:
@.CAPSULE@>
} /* there are no other cases */
mp_print(mp, "part ");
- p=link(p-mp->sector_offset[name_type(p)]);
+ p=mp_link(p-mp->sector_offset[mp_name_type(p)]);
}
@ The |interesting| function returns |true| if a given variable is not
in a capsule, or if the user wants to trace capsules.
@c
-boolean mp_interesting (MP mp,pointer p) {
- small_number t; /* a |name_type| */
+static boolean mp_interesting (MP mp,pointer p) {
+ quarterword t; /* a |name_type| */
if ( mp->internal[mp_tracing_capsules]>0 ) {
return true;
} else {
- t=name_type(p);
+ t=mp_name_type(p);
if ( t>=mp_x_part_sector ) if ( t!=mp_capsule )
- t=name_type(link(p-mp->sector_offset[t]));
+ t=mp_name_type(mp_link(p-mp->sector_offset[t]));
return (t!=mp_capsule);
}
}
@ Now here is a subroutine that converts an unstructured type into an
equivalent structured type, by inserting a |mp_structured| node that is
-capable of growing. This operation is done only when |name_type(p)=root|,
+capable of growing. This operation is done only when |mp_name_type(p)=root|,
|subscr|, or |attr|.
The procedure returns a pointer to the new node that has taken node~|p|'s
@@ -6333,11 +6481,11 @@ place in the structure. Node~|p| itself does not move, nor are its
|value| or |type| fields changed in any way.
@c
-pointer mp_new_structure (MP mp,pointer p) {
+static pointer mp_new_structure (MP mp,pointer p) {
pointer q,r=0; /* list manipulation registers */
- switch (name_type(p)) {
+ switch (mp_name_type(p)) {
case mp_root:
- q=link(p); r=mp_get_node(mp, value_node_size); equiv(q)=r;
+ q=mp_link(p); r=mp_get_node(mp, value_node_size); equiv(q)=r;
break;
case mp_subscr:
@<Link a new subscript node |r| in place of node |p|@>;
@@ -6350,10 +6498,10 @@ pointer mp_new_structure (MP mp,pointer p) {
@:this can't happen struct}{\quad struct@>
break;
}
- link(r)=link(p); type(r)=mp_structured; name_type(r)=name_type(p);
- attr_head(r)=p; name_type(p)=mp_structured_root;
- q=mp_get_node(mp, attr_node_size); link(p)=q; subscr_head(r)=q;
- parent(q)=r; type(q)=undefined; name_type(q)=mp_attr; link(q)=end_attr;
+ mp_link(r)=mp_link(p); mp_type(r)=mp_structured; mp_name_type(r)=mp_name_type(p);
+ attr_head(r)=p; mp_name_type(p)=mp_structured_root;
+ q=mp_get_node(mp, attr_node_size); mp_link(p)=q; subscr_head(r)=q;
+ parent(q)=r; mp_type(q)=undefined; mp_name_type(q)=mp_attr; mp_link(q)=end_attr;
attr_loc(q)=collective_subscript;
return r;
}
@@ -6362,14 +6510,14 @@ pointer mp_new_structure (MP mp,pointer p) {
{
q=p;
do {
- q=link(q);
- } while (name_type(q)!=mp_attr);
- q=parent(q); r=subscr_head_loc(q); /* |link(r)=subscr_head(q)| */
+ q=mp_link(q);
+ } while (mp_name_type(q)!=mp_attr);
+ q=parent(q); r=subscr_head_loc(q); /* |mp_link(r)=subscr_head(q)| */
do {
- q=r; r=link(r);
+ q=r; r=mp_link(r);
} while (r!=p);
r=mp_get_node(mp, subscr_node_size);
- link(q)=r; subscript(r)=subscript(p);
+ mp_link(q)=r; subscript(r)=subscript(p);
}
@ If the attribute is |collective_subscript|, there are two pointers to
@@ -6379,14 +6527,14 @@ node~|p|, so we must change both of them.
{
q=parent(p); r=attr_head(q);
do {
- q=r; r=link(r);
+ q=r; r=mp_link(r);
} while (r!=p);
- r=mp_get_node(mp, attr_node_size); link(q)=r;
+ r=mp_get_node(mp, attr_node_size); mp_link(q)=r;
mp->mem[attr_loc_loc(r)]=mp->mem[attr_loc_loc(p)]; /* copy |attr_loc| and |parent| */
if ( attr_loc(p)==collective_subscript ) {
q=subscr_head_loc(parent(p));
- while ( link(q)!=p ) q=link(q);
- link(q)=r;
+ while ( mp_link(q)!=p ) q=mp_link(q);
+ mp_link(q)=r;
}
}
@@ -6407,13 +6555,13 @@ Otherwise |p| will be a non-null pointer to a node such that
@d abort_find { return null; }
@c
-pointer mp_find_variable (MP mp,pointer t) {
+static pointer mp_find_variable (MP mp,pointer t) {
pointer p,q,r,s; /* nodes in the ``value'' line */
pointer pp,qq,rr,ss; /* nodes in the ``collective'' line */
integer n; /* subscript or attribute */
memory_word save_word; /* temporary storage for a word of |mem| */
@^inner loop@>
- p=info(t); t=link(t);
+ p=mp_info(t); t=mp_link(t);
if ( (eq_type(p) % outer_tag) != tag_token ) abort_find;
if ( equiv(p)==null ) mp_new_root(mp, p);
p=equiv(p); pp=p;
@@ -6422,17 +6570,17 @@ pointer mp_find_variable (MP mp,pointer t) {
if ( t<mp->hi_mem_min ) {
@<Descend one level for the subscript |value(t)|@>
} else {
- @<Descend one level for the attribute |info(t)|@>;
+ @<Descend one level for the attribute |mp_info(t)|@>;
}
- t=link(t);
+ t=mp_link(t);
}
- if ( type(pp)>=mp_structured ) {
- if ( type(pp)==mp_structured ) pp=attr_head(pp); else abort_find;
+ if ( mp_type(pp)>=mp_structured ) {
+ if ( mp_type(pp)==mp_structured ) pp=attr_head(pp); else abort_find;
}
- if ( type(p)==mp_structured ) p=attr_head(p);
- if ( type(p)==undefined ) {
- if ( type(pp)==undefined ) { type(pp)=mp_numeric_type; value(pp)=null; };
- type(p)=type(pp); value(p)=null;
+ if ( mp_type(p)==mp_structured ) p=attr_head(p);
+ if ( mp_type(p)==undefined ) {
+ if ( mp_type(pp)==undefined ) { mp_type(pp)=mp_numeric_type; value(pp)=null; };
+ mp_type(p)=mp_type(pp); value(p)=null;
};
return p;
}
@@ -6442,13 +6590,13 @@ pointer mp_find_variable (MP mp,pointer t) {
values.
@<Make sure that both nodes |p| and |pp|...@>=
-if ( type(pp)!=mp_structured ) {
- if ( type(pp)>mp_structured ) abort_find;
+if ( mp_type(pp)!=mp_structured ) {
+ if ( mp_type(pp)>mp_structured ) abort_find;
ss=mp_new_structure(mp, pp);
if ( p==pp ) p=ss;
pp=ss;
}; /* now |type(pp)=mp_structured| */
-if ( type(p)!=mp_structured ) /* it cannot be |>mp_structured| */
+if ( mp_type(p)!=mp_structured ) /* it cannot be |>mp_structured| */
p=mp_new_structure(mp, p) /* now |type(p)=mp_structured| */
@ We want this part of the program to be reasonably fast, in case there are
@@ -6460,31 +6608,31 @@ subscript list, even though that word isn't part of a subscript node.
@<Descend one level for the subscript |value(t)|@>=
{
n=value(t);
- pp=link(attr_head(pp)); /* now |attr_loc(pp)=collective_subscript| */
- q=link(attr_head(p)); save_word=mp->mem[subscript_loc(q)];
- subscript(q)=el_gordo; s=subscr_head_loc(p); /* |link(s)=subscr_head(p)| */
+ pp=mp_link(attr_head(pp)); /* now |attr_loc(pp)=collective_subscript| */
+ q=mp_link(attr_head(p)); save_word=mp->mem[subscript_loc(q)];
+ subscript(q)=el_gordo; s=subscr_head_loc(p); /* |mp_link(s)=subscr_head(p)| */
do {
- r=s; s=link(s);
+ r=s; s=mp_link(s);
} while (n>subscript(s));
if ( n==subscript(s) ) {
p=s;
} else {
- p=mp_get_node(mp, subscr_node_size); link(r)=p; link(p)=s;
- subscript(p)=n; name_type(p)=mp_subscr; type(p)=undefined;
+ p=mp_get_node(mp, subscr_node_size); mp_link(r)=p; mp_link(p)=s;
+ subscript(p)=n; mp_name_type(p)=mp_subscr; mp_type(p)=undefined;
}
mp->mem[subscript_loc(q)]=save_word;
}
-@ @<Descend one level for the attribute |info(t)|@>=
+@ @<Descend one level for the attribute |mp_info(t)|@>=
{
- n=info(t);
+ n=mp_info(t);
ss=attr_head(pp);
do {
- rr=ss; ss=link(ss);
+ rr=ss; ss=mp_link(ss);
} while (n>attr_loc(ss));
if ( n<attr_loc(ss) ) {
- qq=mp_get_node(mp, attr_node_size); link(rr)=qq; link(qq)=ss;
- attr_loc(qq)=n; name_type(qq)=mp_attr; type(qq)=undefined;
+ qq=mp_get_node(mp, attr_node_size); mp_link(rr)=qq; mp_link(qq)=ss;
+ attr_loc(qq)=n; mp_name_type(qq)=mp_attr; mp_type(qq)=undefined;
parent(qq)=pp; ss=qq;
}
if ( p==pp ) {
@@ -6492,13 +6640,13 @@ subscript list, even though that word isn't part of a subscript node.
} else {
pp=ss; s=attr_head(p);
do {
- r=s; s=link(s);
+ r=s; s=mp_link(s);
} while (n>attr_loc(s));
if ( n==attr_loc(s) ) {
p=s;
} else {
- q=mp_get_node(mp, attr_node_size); link(r)=q; link(q)=s;
- attr_loc(q)=n; name_type(q)=mp_attr; type(q)=undefined;
+ q=mp_get_node(mp, attr_node_size); mp_link(r)=q; mp_link(q)=s;
+ attr_loc(q)=n; mp_name_type(q)=mp_attr; mp_type(q)=undefined;
parent(q)=p; p=q;
}
}
@@ -6525,42 +6673,38 @@ parameter |t| points to a list of one-word nodes that represent
suffixes, with |info=collective_subscript| for subscripts.
@<Declarations@>=
-@<Declare subroutines for printing expressions@>
-@<Declare basic dependency-list subroutines@>
-@<Declare the recycling subroutines@>
-void mp_flush_cur_exp (MP mp,scaled v) ;
-@<Declare the procedure called |flush_below_variable|@>
+static void mp_flush_cur_exp (MP mp,scaled v) ;
@ @c
-void mp_flush_variable (MP mp,pointer p, pointer t, boolean discard_suffixes) {
+static void mp_flush_variable (MP mp,pointer p, pointer t, boolean discard_suffixes) {
pointer q,r; /* list manipulation */
halfword n; /* attribute to match */
while ( t!=null ) {
- if ( type(p)!=mp_structured ) return;
- n=info(t); t=link(t);
+ if ( mp_type(p)!=mp_structured ) return;
+ n=mp_info(t); t=mp_link(t);
if ( n==collective_subscript ) {
- r=subscr_head_loc(p); q=link(r); /* |q=subscr_head(p)| */
- while ( name_type(q)==mp_subscr ){
+ r=subscr_head_loc(p); q=mp_link(r); /* |q=subscr_head(p)| */
+ while ( mp_name_type(q)==mp_subscr ){
mp_flush_variable(mp, q,t,discard_suffixes);
if ( t==null ) {
- if ( type(q)==mp_structured ) r=q;
- else { link(r)=link(q); mp_free_node(mp, q,subscr_node_size); }
+ if ( mp_type(q)==mp_structured ) r=q;
+ else { mp_link(r)=mp_link(q); mp_free_node(mp, q,subscr_node_size); }
} else {
r=q;
}
- q=link(r);
+ q=mp_link(r);
}
}
p=attr_head(p);
do {
- r=p; p=link(p);
+ r=p; p=mp_link(p);
} while (attr_loc(p)<n);
if ( attr_loc(p)!=n ) return;
}
if ( discard_suffixes ) {
mp_flush_below_variable(mp, p);
} else {
- if ( type(p)==mp_structured ) p=attr_head(p);
+ if ( mp_type(p)==mp_structured ) p=attr_head(p);
mp_recycle_value(mp, p);
}
}
@@ -6568,28 +6712,28 @@ void mp_flush_variable (MP mp,pointer p, pointer t, boolean discard_suffixes) {
@ The next procedure is simpler; it wipes out everything but |p| itself,
which becomes undefined.
-@<Declare the procedure called |flush_below_variable|@>=
-void mp_flush_below_variable (MP mp, pointer p);
+@<Declarations@>=
+static void mp_flush_below_variable (MP mp, pointer p);
@ @c
void mp_flush_below_variable (MP mp,pointer p) {
pointer q,r; /* list manipulation registers */
- if ( type(p)!=mp_structured ) {
+ if ( mp_type(p)!=mp_structured ) {
mp_recycle_value(mp, p); /* this sets |type(p)=undefined| */
} else {
q=subscr_head(p);
- while ( name_type(q)==mp_subscr ) {
- mp_flush_below_variable(mp, q); r=q; q=link(q);
+ while ( mp_name_type(q)==mp_subscr ) {
+ mp_flush_below_variable(mp, q); r=q; q=mp_link(q);
mp_free_node(mp, r,subscr_node_size);
}
- r=attr_head(p); q=link(r); mp_recycle_value(mp, r);
- if ( name_type(p)<=mp_saved_root ) mp_free_node(mp, r,value_node_size);
+ r=attr_head(p); q=mp_link(r); mp_recycle_value(mp, r);
+ if ( mp_name_type(p)<=mp_saved_root ) mp_free_node(mp, r,value_node_size);
else mp_free_node(mp, r,subscr_node_size);
/* we assume that |subscr_node_size=attr_node_size| */
do {
- mp_flush_below_variable(mp, q); r=q; q=link(q); mp_free_node(mp, r,attr_node_size);
+ mp_flush_below_variable(mp, q); r=q; q=mp_link(q); mp_free_node(mp, r,attr_node_size);
} while (q!=end_attr);
- type(p)=undefined;
+ mp_type(p)=undefined;
}
}
@@ -6599,8 +6743,8 @@ determines what type of undefined value should be given, based on
the current type before recycling.
@c
-small_number mp_und_type (MP mp,pointer p) {
- switch (type(p)) {
+static quarterword mp_und_type (MP mp,pointer p) {
+ switch (mp_type(p)) {
case undefined: case mp_vacuous:
return undefined;
case mp_boolean_type: case mp_unknown_boolean:
@@ -6615,7 +6759,7 @@ small_number mp_und_type (MP mp,pointer p) {
return mp_unknown_picture;
case mp_transform_type: case mp_color_type: case mp_cmykcolor_type:
case mp_pair_type: case mp_numeric_type:
- return type(p);
+ return mp_type(p);
case mp_known: case mp_dependent: case mp_proto_dependent: case mp_independent:
return mp_numeric_type;
} /* there are no other cases */
@@ -6628,7 +6772,7 @@ definition that is currently attached to that symbol. If the |saving|
parameter is true, a subsidiary structure is saved instead of destroyed.
@c
-void mp_clear_symbol (MP mp,pointer p, boolean saving) {
+static void mp_clear_symbol (MP mp,pointer p, boolean saving) {
pointer q; /* |equiv(p)| */
q=equiv(p);
switch (eq_type(p) % outer_tag) {
@@ -6641,7 +6785,7 @@ void mp_clear_symbol (MP mp,pointer p, boolean saving) {
case tag_token:
if ( q!=null ) {
if ( saving ) {
- name_type(q)=mp_saved_root;
+ mp_name_type(q)=mp_saved_root;
} else {
mp_flush_below_variable(mp, q);
mp_free_node(mp,q,value_node_size);
@@ -6667,17 +6811,17 @@ distinguished by their |info| fields. If |p| points to a saved item,
then
\smallskip\hang
-|info(p)=0| stands for a group boundary; each \&{begingroup} contributes
+|mp_info(p)=0| stands for a group boundary; each \&{begingroup} contributes
such an item to the save stack and each \&{endgroup} cuts back the stack
until the most recent such entry has been removed.
\smallskip\hang
-|info(p)=q|, where |1<=q<=hash_end|, means that |mem[p+1]| holds the former
+|mp_info(p)=q|, where |1<=q<=hash_end|, means that |mem[p+1]| holds the former
contents of |eqtb[q]|. Such save stack entries are generated by \&{save}
commands.
\smallskip\hang
-|info(p)=hash_end+q|, where |q>0|, means that |value(p)| is a |scaled|
+|mp_info(p)=hash_end+q|, where |q>0|, means that |value(p)| is a |scaled|
integer to be restored to internal parameter number~|q|. Such entries
are generated by \&{interim} commands.
@@ -6686,8 +6830,8 @@ The global variable |save_ptr| points to the top item on the save stack.
@d save_node_size 2 /* number of words per non-boundary save-stack node */
@d saved_equiv(A) mp->mem[(A)+1].hh /* where an |eqtb| entry gets saved */
-@d save_boundary_item(A) { (A)=mp_get_avail(mp); info((A))=0;
- link((A))=mp->save_ptr; mp->save_ptr=(A);
+@d save_boundary_item(A) { (A)=mp_get_avail(mp); mp_info((A))=0;
+ mp_link((A))=mp->save_ptr; mp->save_ptr=(A);
}
@<Glob...@>=
@@ -6703,10 +6847,11 @@ Nothing is stacked when |save_ptr=null|, however; there's no way to remove
things from the stack when the program is not inside a group, so there's
no point in wasting the space.
-@c void mp_save_variable (MP mp,pointer q) {
+@c
+static void mp_save_variable (MP mp,pointer q) {
pointer p; /* temporary register */
if ( mp->save_ptr!=null ){
- p=mp_get_node(mp, save_node_size); info(p)=q; link(p)=mp->save_ptr;
+ p=mp_get_node(mp, save_node_size); mp_info(p)=q; mp_link(p)=mp->save_ptr;
saved_equiv(p)=mp->eqtb[q]; mp->save_ptr=p;
}
mp_clear_symbol(mp, q,(mp->save_ptr!=null));
@@ -6716,11 +6861,12 @@ no point in wasting the space.
quantity like |mp_tracing_pens|. It creates a save stack entry of the
third kind.
-@c void mp_save_internal (MP mp,halfword q) {
+@c
+static void mp_save_internal (MP mp,halfword q) {
pointer p; /* new item for the save stack */
if ( mp->save_ptr!=null ){
- p=mp_get_node(mp, save_node_size); info(p)=hash_end+q;
- link(p)=mp->save_ptr; value(p)=mp->internal[q]; mp->save_ptr=p;
+ p=mp_get_node(mp, save_node_size); mp_info(p)=hash_end+q;
+ mp_link(p)=mp->save_ptr; value(p)=mp->internal[q]; mp->save_ptr=p;
}
}
@@ -6729,36 +6875,36 @@ equivalents in reverse order. This routine will be called only when there
is at least one boundary item on the save stack.
@c
-void mp_unsave (MP mp) {
+static void mp_unsave (MP mp) {
pointer q; /* index to saved item */
pointer p; /* temporary register */
- while ( info(mp->save_ptr)!=0 ) {
- q=info(mp->save_ptr);
+ while ( mp_info(mp->save_ptr)!=0 ) {
+ q=mp_info(mp->save_ptr);
if ( q>hash_end ) {
if ( mp->internal[mp_tracing_restores]>0 ) {
mp_begin_diagnostic(mp); mp_print_nl(mp, "{restoring ");
- mp_print(mp, mp->int_name[q-(hash_end)]); mp_print_char(mp, '=');
- mp_print_scaled(mp, value(mp->save_ptr)); mp_print_char(mp, '}');
+ mp_print(mp, mp->int_name[q-(hash_end)]); mp_print_char(mp, xord('='));
+ mp_print_scaled(mp, value(mp->save_ptr)); mp_print_char(mp, xord('}'));
mp_end_diagnostic(mp, false);
}
mp->internal[q-(hash_end)]=value(mp->save_ptr);
} else {
if ( mp->internal[mp_tracing_restores]>0 ) {
mp_begin_diagnostic(mp); mp_print_nl(mp, "{restoring ");
- mp_print_text(q); mp_print_char(mp, '}');
+ mp_print_text(q); mp_print_char(mp, xord('}'));
mp_end_diagnostic(mp, false);
}
mp_clear_symbol(mp, q,false);
mp->eqtb[q]=saved_equiv(mp->save_ptr);
if ( eq_type(q) % outer_tag==tag_token ) {
p=equiv(q);
- if ( p!=null ) name_type(p)=mp_root;
+ if ( p!=null ) mp_name_type(p)=mp_root;
}
}
- p=link(mp->save_ptr);
+ p=mp_link(mp->save_ptr);
mp_free_node(mp, mp->save_ptr,save_node_size); mp->save_ptr=p;
}
- p=link(mp->save_ptr); free_avail(mp->save_ptr); mp->save_ptr=p;
+ p=mp_link(mp->save_ptr); free_avail(mp->save_ptr); mp->save_ptr=p;
}
@* \[17] Data structures for paths.
@@ -6775,7 +6921,7 @@ for |0<=t<=1|.
There is a 8-word node for each knot $z_k$, containing one word of
control information and six words for the |x| and |y| coordinates of
$z_k^-$ and $z_k$ and~$z_k^+$. The control information appears in the
-|left_type| and |right_type| fields, which each occupy a quarter of
+|mp_left_type| and |mp_right_type| fields, which each occupy a quarter of
the first word in the node; they specify properties of the curve as it
enters and leaves the knot. There's also a halfword |link| field,
which points to the following knot, and a final supplementary word (of
@@ -6783,18 +6929,18 @@ which only a quarter is used).
If the path is a closed contour, knots 0 and |n| are identical;
i.e., the |link| in knot |n-1| points to knot~0. But if the path
-is not closed, the |left_type| of knot~0 and the |right_type| of knot~|n|
+is not closed, the |mp_left_type| of knot~0 and the |mp_right_type| of knot~|n|
are equal to |endpoint|. In the latter case the |link| in knot~|n| points
to knot~0, and the control points $z_0^-$ and $z_n^+$ are not used.
-@d left_type(A) mp->mem[(A)].hh.b0 /* characterizes the path entering this knot */
-@d right_type(A) mp->mem[(A)].hh.b1 /* characterizes the path leaving this knot */
-@d x_coord(A) mp->mem[(A)+1].sc /* the |x| coordinate of this knot */
-@d y_coord(A) mp->mem[(A)+2].sc /* the |y| coordinate of this knot */
-@d left_x(A) mp->mem[(A)+3].sc /* the |x| coordinate of previous control point */
-@d left_y(A) mp->mem[(A)+4].sc /* the |y| coordinate of previous control point */
-@d right_x(A) mp->mem[(A)+5].sc /* the |x| coordinate of next control point */
-@d right_y(A) mp->mem[(A)+6].sc /* the |y| coordinate of next control point */
+@d mp_left_type(A) mp->mem[(A)].hh.b0 /* characterizes the path entering this knot */
+@d mp_right_type(A) mp->mem[(A)].hh.b1 /* characterizes the path leaving this knot */
+@d mp_x_coord(A) mp->mem[(A)+1].sc /* the |x| coordinate of this knot */
+@d mp_y_coord(A) mp->mem[(A)+2].sc /* the |y| coordinate of this knot */
+@d mp_left_x(A) mp->mem[(A)+3].sc /* the |x| coordinate of previous control point */
+@d mp_left_y(A) mp->mem[(A)+4].sc /* the |y| coordinate of previous control point */
+@d mp_right_x(A) mp->mem[(A)+5].sc /* the |x| coordinate of next control point */
+@d mp_right_y(A) mp->mem[(A)+6].sc /* the |y| coordinate of next control point */
@d x_loc(A) ((A)+1) /* where the |x| coordinate is stored in a knot */
@d y_loc(A) ((A)+2) /* where the |y| coordinate is stored in a knot */
@d knot_coord(A) mp->mem[(A)].sc /* |x| or |y| coordinate given |x_loc| or |y_loc| */
@@ -6804,13 +6950,13 @@ to knot~0, and the control points $z_0^-$ and $z_n^+$ are not used.
/* coordinate of next control point given |x_loc| or |y_loc| */
@d knot_node_size 8 /* number of words in a knot node */
-@<Types...@>=
+@(mplib.h@>=
enum mp_knot_type {
- mp_endpoint=0, /* |left_type| at path beginning and |right_type| at path end */
- mp_explicit, /* |left_type| or |right_type| when control points are known */
- mp_given, /* |left_type| or |right_type| when a direction is given */
- mp_curl, /* |left_type| or |right_type| when a curl is desired */
- mp_open, /* |left_type| or |right_type| when \MP\ should choose the direction */
+ mp_endpoint=0, /* |mp_left_type| at path beginning and |mp_right_type| at path end */
+ mp_explicit, /* |mp_left_type| or |mp_right_type| when control points are known */
+ mp_given, /* |mp_left_type| or |mp_right_type| when a direction is given */
+ mp_curl, /* |mp_left_type| or |mp_right_type| when a curl is desired */
+ mp_open, /* |mp_left_type| or |mp_right_type| when \MP\ should choose the direction */
mp_end_cycle
};
@@ -6819,26 +6965,26 @@ space they will ultimately occupy is taken up by information that can be
used to compute them. There are four cases:
\yskip
-\textindent{$\bullet$} If |right_type=mp_open|, the curve should leave
+\textindent{$\bullet$} If |mp_right_type=mp_open|, the curve should leave
the knot in the same direction it entered; \MP\ will figure out a
suitable direction.
\yskip
-\textindent{$\bullet$} If |right_type=mp_curl|, the curve should leave the
+\textindent{$\bullet$} If |mp_right_type=mp_curl|, the curve should leave the
knot in a direction depending on the angle at which it enters the next
knot and on the curl parameter stored in |right_curl|.
\yskip
-\textindent{$\bullet$} If |right_type=mp_given|, the curve should leave the
+\textindent{$\bullet$} If |mp_right_type=mp_given|, the curve should leave the
knot in a nonzero direction stored as an |angle| in |right_given|.
\yskip
-\textindent{$\bullet$} If |right_type=mp_explicit|, the B\'ezier control
+\textindent{$\bullet$} If |mp_right_type=mp_explicit|, the B\'ezier control
point for leaving this knot has already been computed; it is in the
-|right_x| and |right_y| fields.
+|mp_right_x| and |mp_right_y| fields.
\yskip\noindent
-The rules for |left_type| are similar, but they refer to the curve entering
+The rules for |mp_left_type| are similar, but they refer to the curve entering
the knot, and to \\{left} fields instead of \\{right} fields.
Non-|explicit| control points will be chosen based on ``tension'' parameters
@@ -6853,7 +6999,7 @@ where \.p is the path `\.{z4..controls z45 and z54..z5}', will be represented
by the six knots
\def\lodash{\hbox to 1.1em{\thinspace\hrulefill\thinspace}}
$$\vbox{\halign{#\hfil&&\qquad#\hfil\cr
-|left_type|&\\{left} info&|x_coord,y_coord|&|right_type|&\\{right} info\cr
+|mp_left_type|&\\{left} info&|mp_x_coord,mp_y_coord|&|mp_right_type|&\\{right} info\cr
\noalign{\yskip}
|endpoint|&\lodash$,\,$\lodash&$x_0,y_0$&|curl|&$1.0,1.0$\cr
|open|&\lodash$,1.0$&$x_1,y_1$&|open|&\lodash$,-1.0$\cr
@@ -6869,16 +7015,16 @@ These types must satisfy certain restrictions because of the form of \MP's
path syntax:
(i)~|open| type never appears in the same node together with |endpoint|,
|given|, or |curl|.
-(ii)~The |right_type| of a node is |explicit| if and only if the
-|left_type| of the following node is |explicit|.
+(ii)~The |mp_right_type| of a node is |explicit| if and only if the
+|mp_left_type| of the following node is |explicit|.
(iii)~|endpoint| types occur only at the ends, as mentioned above.
-@d left_curl left_x /* curl information when entering this knot */
-@d left_given left_x /* given direction when entering this knot */
-@d left_tension left_y /* tension information when entering this knot */
-@d right_curl right_x /* curl information when leaving this knot */
-@d right_given right_x /* given direction when leaving this knot */
-@d right_tension right_y /* tension information when leaving this knot */
+@d left_curl mp_left_x /* curl information when entering this knot */
+@d left_given mp_left_x /* given direction when entering this knot */
+@d left_tension mp_left_y /* tension information when entering this knot */
+@d right_curl mp_right_x /* curl information when leaving this knot */
+@d right_given mp_right_x /* given direction when leaving this knot */
+@d right_tension mp_right_y /* tension information when leaving this knot */
@ Knots can be user-supplied, or they can be created by program code,
like the |split_cubic| function, or |copy_path|. The distinction is
@@ -6889,10 +7035,10 @@ one knot from another, we will set |originator(p):=mp_metapost_user| when
it appeared in the actual metapost program, and
|originator(p):=mp_program_code| in all other cases.
-@d originator(A) mp->mem[(A)+7].hh.b0 /* the creator of this knot */
+@d mp_originator(A) mp->mem[(A)+7].hh.b0 /* the creator of this knot */
-@<Types...@>=
-enum {
+@<Exported types@>=
+enum mp_knot_originator {
mp_program_code=0, /* not created by a user */
mp_metapost_user /* created by a user */
};
@@ -6901,15 +7047,15 @@ enum {
in symbolic form. It illustrates the conventions discussed above,
and checks for anomalies that might arise while \MP\ is being debugged.
-@<Declare subroutines for printing expressions@>=
-void mp_pr_path (MP mp,pointer h);
+@<Declarations@>=
+static void mp_pr_path (MP mp,pointer h);
@ @c
void mp_pr_path (MP mp,pointer h) {
pointer p,q; /* for list traversal */
p=h;
do {
- q=link(p);
+ q=mp_link(p);
if ( (p==null)||(q==null) ) {
mp_print_nl(mp, "???"); return; /* this won't happen */
@.???@>
@@ -6917,21 +7063,21 @@ void mp_pr_path (MP mp,pointer h) {
@<Print information for adjacent knots |p| and |q|@>;
DONE1:
p=q;
- if ( (p!=h)||(left_type(h)!=mp_endpoint) ) {
+ if ( (p!=h)||(mp_left_type(h)!=mp_endpoint) ) {
@<Print two dots, followed by |given| or |curl| if present@>;
}
} while (p!=h);
- if ( left_type(h)!=mp_endpoint )
+ if ( mp_left_type(h)!=mp_endpoint )
mp_print(mp, "cycle");
}
@ @<Print information for adjacent knots...@>=
-mp_print_two(mp, x_coord(p),y_coord(p));
-switch (right_type(p)) {
+mp_print_two(mp, mp_x_coord(p),mp_y_coord(p));
+switch (mp_right_type(p)) {
case mp_endpoint:
- if ( left_type(p)==mp_open ) mp_print(mp, "{open?}"); /* can't happen */
+ if ( mp_left_type(p)==mp_open ) mp_print(mp, "{open?}"); /* can't happen */
@.open?@>
- if ( (left_type(q)!=mp_endpoint)||(q!=h) ) q=null; /* force an error */
+ if ( (mp_left_type(q)!=mp_endpoint)||(q!=h) ) q=null; /* force an error */
goto DONE1;
break;
case mp_explicit:
@@ -6949,7 +7095,7 @@ default:
@.???@>
break;
}
-if ( left_type(q)<=mp_explicit ) {
+if ( mp_left_type(q)<=mp_explicit ) {
mp_print(mp, "..control?"); /* can't happen */
@.control?@>
} else if ( (right_tension(p)!=unity)||(left_tension(q)!=unity) ) {
@@ -6962,13 +7108,13 @@ were |scaled|, the magnitude of a |given| direction vector will be~4096.
@<Print two dots...@>=
{
mp_print_nl(mp, " ..");
- if ( left_type(p)==mp_given ) {
- mp_n_sin_cos(mp, left_given(p)); mp_print_char(mp, '{');
- mp_print_scaled(mp, mp->n_cos); mp_print_char(mp, ',');
- mp_print_scaled(mp, mp->n_sin); mp_print_char(mp, '}');
- } else if ( left_type(p)==mp_curl ){
+ if ( mp_left_type(p)==mp_given ) {
+ mp_n_sin_cos(mp, left_given(p)); mp_print_char(mp, xord('{'));
+ mp_print_scaled(mp, mp->n_cos); mp_print_char(mp, xord(','));
+ mp_print_scaled(mp, mp->n_sin); mp_print_char(mp, xord('}'));
+ } else if ( mp_left_type(p)==mp_curl ){
mp_print(mp, "{curl ");
- mp_print_scaled(mp, left_curl(p)); mp_print_char(mp, '}');
+ mp_print_scaled(mp, left_curl(p)); mp_print_char(mp, xord('}'));
}
}
@@ -6987,19 +7133,19 @@ were |scaled|, the magnitude of a |given| direction vector will be~4096.
@ @<Print control points between |p| and |q|, then |goto done1|@>=
{
mp_print(mp, "..controls ");
- mp_print_two(mp, right_x(p),right_y(p));
+ mp_print_two(mp, mp_right_x(p),mp_right_y(p));
mp_print(mp, " and ");
- if ( left_type(q)!=mp_explicit ) {
+ if ( mp_left_type(q)!=mp_explicit ) {
mp_print(mp, "??"); /* can't happen */
@.??@>
} else {
- mp_print_two(mp, left_x(q),left_y(q));
+ mp_print_two(mp, mp_left_x(q),mp_left_y(q));
}
goto DONE1;
}
@ @<Print information for a curve that begins |open|@>=
-if ( (left_type(p)!=mp_explicit)&&(left_type(p)!=mp_open) ) {
+if ( (mp_left_type(p)!=mp_explicit)&&(mp_left_type(p)!=mp_open) ) {
mp_print(mp, "{open?}"); /* can't happen */
@.open?@>
}
@@ -7009,23 +7155,26 @@ if ( (left_type(p)!=mp_explicit)&&(left_type(p)!=mp_open) ) {
@<Print information for a curve that begins |curl|...@>=
{
- if ( left_type(p)==mp_open )
+ if ( mp_left_type(p)==mp_open )
mp_print(mp, "??"); /* can't happen */
@.??@>
- if ( right_type(p)==mp_curl ) {
+ if ( mp_right_type(p)==mp_curl ) {
mp_print(mp, "{curl "); mp_print_scaled(mp, right_curl(p));
} else {
- mp_n_sin_cos(mp, right_given(p)); mp_print_char(mp, '{');
- mp_print_scaled(mp, mp->n_cos); mp_print_char(mp, ',');
+ mp_n_sin_cos(mp, right_given(p)); mp_print_char(mp, xord('{'));
+ mp_print_scaled(mp, mp->n_cos); mp_print_char(mp, xord(','));
mp_print_scaled(mp, mp->n_sin);
}
- mp_print_char(mp, '}');
+ mp_print_char(mp, xord('}'));
}
@ It is convenient to have another version of |pr_path| that prints the path
as a diagnostic message.
-@<Declare subroutines for printing expressions@>=
+@<Declarations@>=
+static void mp_print_path (MP mp,pointer h, const char *s, boolean nuline) ;
+
+@ @c
void mp_print_path (MP mp,pointer h, const char *s, boolean nuline) {
mp_print_diagnostic(mp, "Path", s, nuline); mp_print_ln(mp);
@.Path at line...@>
@@ -7036,30 +7185,30 @@ void mp_print_path (MP mp,pointer h, const char *s, boolean nuline) {
@ If we want to duplicate a knot node, we can say |copy_knot|:
@c
-pointer mp_copy_knot (MP mp,pointer p) {
+static pointer mp_copy_knot (MP mp,pointer p) {
pointer q; /* the copy */
int k; /* runs through the words of a knot node */
q=mp_get_node(mp, knot_node_size);
for (k=0;k<knot_node_size;k++) {
mp->mem[q+k]=mp->mem[p+k];
}
- originator(q)=originator(p);
+ mp_originator(q)=mp_originator(p);
return q;
}
@ The |copy_path| routine makes a clone of a given path.
@c
-pointer mp_copy_path (MP mp, pointer p) {
+static pointer mp_copy_path (MP mp, pointer p) {
pointer q,pp,qq; /* for list manipulation */
q=mp_copy_knot(mp, p);
- qq=q; pp=link(p);
+ qq=q; pp=mp_link(p);
while ( pp!=p ) {
- link(qq)=mp_copy_knot(mp, pp);
- qq=link(qq);
- pp=link(pp);
+ mp_link(qq)=mp_copy_knot(mp, pp);
+ qq=mp_link(qq);
+ pp=mp_link(pp);
}
- link(qq)=q;
+ mp_link(qq)=q;
return q;
}
@@ -7069,21 +7218,21 @@ pointer mp_copy_path (MP mp, pointer p) {
The |gr_XXXX| macros are defined in |mppsout.h|.
@c
-mp_knot *mp_export_knot (MP mp,pointer p) {
+static mp_knot *mp_export_knot (MP mp,pointer p) {
mp_knot *q; /* the copy */
if (p==null)
return NULL;
- q = mp_xmalloc(mp, 1, sizeof (mp_knot));
+ q = xmalloc(1, sizeof (mp_knot));
memset(q,0,sizeof (mp_knot));
- gr_left_type(q) = left_type(p);
- gr_right_type(q) = right_type(p);
- gr_x_coord(q) = x_coord(p);
- gr_y_coord(q) = y_coord(p);
- gr_left_x(q) = left_x(p);
- gr_left_y(q) = left_y(p);
- gr_right_x(q) = right_x(p);
- gr_right_y(q) = right_y(p);
- gr_originator(q) = originator(p);
+ gr_left_type(q) = (unsigned short)mp_left_type(p);
+ gr_right_type(q) = (unsigned short)mp_right_type(p);
+ gr_x_coord(q) = mp_x_coord(p);
+ gr_y_coord(q) = mp_y_coord(p);
+ gr_left_x(q) = mp_left_x(p);
+ gr_left_y(q) = mp_left_y(p);
+ gr_right_x(q) = mp_right_x(p);
+ gr_right_y(q) = mp_right_y(p);
+ gr_originator(q) = (unsigned char)mp_originator(p);
return q;
}
@@ -7091,17 +7240,17 @@ mp_knot *mp_export_knot (MP mp,pointer p) {
of a given path.
@c
-mp_knot *mp_export_knot_list (MP mp, pointer p) {
+static mp_knot *mp_export_knot_list (MP mp, pointer p) {
mp_knot *q, *qq; /* for list manipulation */
pointer pp; /* for list manipulation */
if (p==null)
return NULL;
q=mp_export_knot(mp, p);
- qq=q; pp=link(p);
+ qq=q; pp=mp_link(p);
while ( pp!=p ) {
gr_next_knot(qq)=mp_export_knot(mp, pp);
qq=gr_next_knot(qq);
- pp=link(pp);
+ pp=mp_link(pp);
}
gr_next_knot(qq)=q;
return q;
@@ -7117,20 +7266,20 @@ this trick makes it easier to implement `\&{doublepath}'.
All node types are assumed to be |endpoint| or |explicit| only.
@c
-pointer mp_htap_ypoc (MP mp,pointer p) {
+static pointer mp_htap_ypoc (MP mp,pointer p) {
pointer q,pp,qq,rr; /* for list manipulation */
q=mp_get_node(mp, knot_node_size); /* this will correspond to |p| */
qq=q; pp=p;
while (1) {
- right_type(qq)=left_type(pp); left_type(qq)=right_type(pp);
- x_coord(qq)=x_coord(pp); y_coord(qq)=y_coord(pp);
- right_x(qq)=left_x(pp); right_y(qq)=left_y(pp);
- left_x(qq)=right_x(pp); left_y(qq)=right_y(pp);
- originator(qq)=originator(pp);
- if ( link(pp)==p ) {
- link(q)=qq; mp->path_tail=pp; return q;
+ mp_right_type(qq)=mp_left_type(pp); mp_left_type(qq)=mp_right_type(pp);
+ mp_x_coord(qq)=mp_x_coord(pp); mp_y_coord(qq)=mp_y_coord(pp);
+ mp_right_x(qq)=mp_left_x(pp); mp_right_y(qq)=mp_left_y(pp);
+ mp_left_x(qq)=mp_right_x(pp); mp_left_y(qq)=mp_right_y(pp);
+ mp_originator(qq)=mp_originator(pp);
+ if ( mp_link(pp)==p ) {
+ mp_link(q)=qq; mp->path_tail=pp; return q;
}
- rr=mp_get_node(mp, knot_node_size); link(rr)=qq; qq=rr; pp=link(pp);
+ rr=mp_get_node(mp, knot_node_size); mp_link(rr)=qq; qq=rr; pp=mp_link(pp);
}
}
@@ -7140,8 +7289,8 @@ pointer path_tail; /* the node that links to the beginning of a path */
@ When a cyclic list of knot nodes is no longer needed, it can be recycled by
calling the following subroutine.
-@<Declare the recycling subroutines@>=
-void mp_toss_knot_list (MP mp,pointer p) ;
+@<Declarations@>=
+static void mp_toss_knot_list (MP mp,pointer p) ;
@ @c
void mp_toss_knot_list (MP mp,pointer p) {
@@ -7149,7 +7298,7 @@ void mp_toss_knot_list (MP mp,pointer p) {
pointer r; /* the next node */
q=p;
do {
- r=link(q);
+ r=mp_link(q);
mp_free_node(mp, q,knot_node_size); q=r;
} while (q!=p);
}
@@ -7163,11 +7312,10 @@ path information, as described above.
A path decomposes into independent segments at ``breakpoint'' knots,
which are knots whose left and right angles are both prespecified in
-some way (i.e., their |left_type| and |right_type| aren't both open).
+some way (i.e., their |mp_left_type| and |mp_right_type| aren't both open).
@c
-@<Declare the procedure called |solve_choices|@>
-void mp_make_choices (MP mp,pointer knots) {
+static void mp_make_choices (MP mp,pointer knots) {
pointer h; /* the first breakpoint */
pointer p,q; /* consecutive breakpoints being processed */
@<Other local variables for |make_choices|@>;
@@ -7193,8 +7341,8 @@ void mp_make_choices (MP mp,pointer knots) {
{
print_err("Some number got too big");
@.Some number got too big@>
- help2("The path that I just computed is out of range.")
- ("So it will probably look funny. Proceed, for a laugh.");
+ help2("The path that I just computed is out of range.",
+ "So it will probably look funny. Proceed, for a laugh.");
mp_put_get_error(mp); mp->arith_error=false;
}
@@ -7205,58 +7353,59 @@ knots.
@<If consecutive knots are equal, join them explicitly@>=
p=knots;
do {
- q=link(p);
- if ( x_coord(p)==x_coord(q) && y_coord(p)==y_coord(q) && right_type(p)>mp_explicit ) {
- right_type(p)=mp_explicit;
- if ( left_type(p)==mp_open ) {
- left_type(p)=mp_curl; left_curl(p)=unity;
+ q=mp_link(p);
+ if ( mp_x_coord(p)==mp_x_coord(q) &&
+ mp_y_coord(p)==mp_y_coord(q) && mp_right_type(p)>mp_explicit ) {
+ mp_right_type(p)=mp_explicit;
+ if ( mp_left_type(p)==mp_open ) {
+ mp_left_type(p)=mp_curl; left_curl(p)=unity;
}
- left_type(q)=mp_explicit;
- if ( right_type(q)==mp_open ) {
- right_type(q)=mp_curl; right_curl(q)=unity;
+ mp_left_type(q)=mp_explicit;
+ if ( mp_right_type(q)==mp_open ) {
+ mp_right_type(q)=mp_curl; right_curl(q)=unity;
}
- right_x(p)=x_coord(p); left_x(q)=x_coord(p);
- right_y(p)=y_coord(p); left_y(q)=y_coord(p);
+ mp_right_x(p)=mp_x_coord(p); mp_left_x(q)=mp_x_coord(p);
+ mp_right_y(p)=mp_y_coord(p); mp_left_y(q)=mp_y_coord(p);
}
p=q;
} while (p!=knots)
@ If there are no breakpoints, it is necessary to compute the direction
-angles around an entire cycle. In this case the |left_type| of the first
+angles around an entire cycle. In this case the |mp_left_type| of the first
node is temporarily changed to |end_cycle|.
@<Find the first breakpoint, |h|, on the path...@>=
h=knots;
while (1) {
- if ( left_type(h)!=mp_open ) break;
- if ( right_type(h)!=mp_open ) break;
- h=link(h);
+ if ( mp_left_type(h)!=mp_open ) break;
+ if ( mp_right_type(h)!=mp_open ) break;
+ h=mp_link(h);
if ( h==knots ) {
- left_type(h)=mp_end_cycle; break;
+ mp_left_type(h)=mp_end_cycle; break;
}
}
-@ If |right_type(p)<given| and |q=link(p)|, we must have
-|right_type(p)=left_type(q)=mp_explicit| or |endpoint|.
+@ If |mp_right_type(p)<given| and |q=mp_link(p)|, we must have
+|mp_right_type(p)=mp_left_type(q)=mp_explicit| or |endpoint|.
@<Fill in the control points between |p| and the next breakpoint...@>=
-q=link(p);
-if ( right_type(p)>=mp_given ) {
- while ( (left_type(q)==mp_open)&&(right_type(q)==mp_open) ) q=link(q);
+q=mp_link(p);
+if ( mp_right_type(p)>=mp_given ) {
+ while ( (mp_left_type(q)==mp_open)&&(mp_right_type(q)==mp_open) ) q=mp_link(q);
@<Fill in the control information between
consecutive breakpoints |p| and |q|@>;
-} else if ( right_type(p)==mp_endpoint ) {
+} else if ( mp_right_type(p)==mp_endpoint ) {
@<Give reasonable values for the unused control points between |p| and~|q|@>;
}
p=q
@ This step makes it possible to transform an explicitly computed path without
-checking the |left_type| and |right_type| fields.
+checking the |mp_left_type| and |mp_right_type| fields.
@<Give reasonable values for the unused control points between |p| and~|q|@>=
{
- right_x(p)=x_coord(p); right_y(p)=y_coord(p);
- left_x(q)=x_coord(q); left_y(q)=y_coord(q);
+ mp_right_x(p)=mp_x_coord(p); mp_right_y(p)=mp_y_coord(p);
+ mp_left_x(q)=mp_x_coord(q); mp_left_y(q)=mp_y_coord(q);
}
@ Before we can go further into the way choices are made, we need to
@@ -7391,12 +7540,6 @@ scaled *delta_y;
scaled *delta; /* knot differences */
angle *psi; /* turning angles */
-@ @<Allocate or initialize ...@>=
-mp->delta_x = NULL;
-mp->delta_y = NULL;
-mp->delta = NULL;
-mp->psi = NULL;
-
@ @<Dealloc variables@>=
xfree(mp->delta_x);
xfree(mp->delta_y);
@@ -7414,9 +7557,9 @@ xfree(mp->psi);
RESTART:
k=0; s=p; n=mp->path_size;
do {
- t=link(s);
- mp->delta_x[k]=x_coord(t)-x_coord(s);
- mp->delta_y[k]=y_coord(t)-y_coord(s);
+ t=mp_link(s);
+ mp->delta_x[k]=mp_x_coord(t)-mp_x_coord(s);
+ mp->delta_y[k]=mp_y_coord(t)-mp_y_coord(s);
mp->delta[k]=mp_pyth_add(mp, mp->delta_x[k],mp->delta_y[k]);
if ( k>0 ) {
sine=mp_make_fraction(mp, mp->delta_y[k-1],mp->delta[k-1]);
@@ -7428,39 +7571,39 @@ RESTART:
}
incr(k); s=t;
if ( k==mp->path_size ) {
- mp_reallocate_paths(mp, mp->path_size+(mp->path_size>>2));
+ mp_reallocate_paths(mp, mp->path_size+(mp->path_size/4));
goto RESTART; /* retry, loop size has changed */
}
if ( s==q ) n=k;
- } while (!((k>=n)&&(left_type(s)!=mp_end_cycle)));
+ } while (!((k>=n)&&(mp_left_type(s)!=mp_end_cycle)));
if ( k==n ) mp->psi[n]=0; else mp->psi[k]=mp->psi[1];
}
-@ When we get to this point of the code, |right_type(p)| is either
+@ When we get to this point of the code, |mp_right_type(p)| is either
|given| or |curl| or |open|. If it is |open|, we must have
-|left_type(p)=mp_end_cycle| or |left_type(p)=mp_explicit|. In the latter
+|mp_left_type(p)=mp_end_cycle| or |mp_left_type(p)=mp_explicit|. In the latter
case, the |open| type is converted to |given|; however, if the
velocity coming into this knot is zero, the |open| type is
converted to a |curl|, since we don't know the incoming direction.
-Similarly, |left_type(q)| is either |given| or |curl| or |open| or
+Similarly, |mp_left_type(q)| is either |given| or |curl| or |open| or
|mp_end_cycle|. The |open| possibility is reduced either to |given| or to |curl|.
@<Remove |open| types at the breakpoints@>=
-if ( left_type(q)==mp_open ) {
- delx=right_x(q)-x_coord(q); dely=right_y(q)-y_coord(q);
+if ( mp_left_type(q)==mp_open ) {
+ delx=mp_right_x(q)-mp_x_coord(q); dely=mp_right_y(q)-mp_y_coord(q);
if ( (delx==0)&&(dely==0) ) {
- left_type(q)=mp_curl; left_curl(q)=unity;
+ mp_left_type(q)=mp_curl; left_curl(q)=unity;
} else {
- left_type(q)=mp_given; left_given(q)=mp_n_arg(mp, delx,dely);
+ mp_left_type(q)=mp_given; left_given(q)=mp_n_arg(mp, delx,dely);
}
}
-if ( (right_type(p)==mp_open)&&(left_type(p)==mp_explicit) ) {
- delx=x_coord(p)-left_x(p); dely=y_coord(p)-left_y(p);
+if ( (mp_right_type(p)==mp_open)&&(mp_left_type(p)==mp_explicit) ) {
+ delx=mp_x_coord(p)-mp_left_x(p); dely=mp_y_coord(p)-mp_left_y(p);
if ( (delx==0)&&(dely==0) ) {
- right_type(p)=mp_curl; right_curl(p)=unity;
+ mp_right_type(p)=mp_curl; right_curl(p)=unity;
} else {
- right_type(p)=mp_given; right_given(p)=mp_n_arg(mp, delx,dely);
+ mp_right_type(p)=mp_given; right_given(p)=mp_n_arg(mp, delx,dely);
}
}
@@ -7504,20 +7647,14 @@ fraction *uu; /* values of $u_k$ */
angle *vv; /* values of $v_k$ */
fraction *ww; /* values of $w_k$ */
-@ @<Allocate or initialize ...@>=
-mp->theta = NULL;
-mp->uu = NULL;
-mp->vv = NULL;
-mp->ww = NULL;
-
@ @<Dealloc variables@>=
xfree(mp->theta);
xfree(mp->uu);
xfree(mp->vv);
xfree(mp->ww);
-@ @<Declare |mp_reallocate| functions@>=
-void mp_reallocate_paths (MP mp, int l);
+@ @<Declarations@>=
+static void mp_reallocate_paths (MP mp, int l);
@ @c
void mp_reallocate_paths (MP mp, int l) {
@@ -7536,21 +7673,23 @@ void mp_reallocate_paths (MP mp, int l) {
first equation or by realizing that no equations are needed, and to fit
this initialization into a framework suitable for the overall computation.
-@<Declare the procedure called |solve_choices|@>=
-@<Declare subroutines needed by |solve_choices|@>
+@<Declarations@>=
+static void mp_solve_choices (MP mp,pointer p, pointer q, halfword n) ;
+
+@ @c
void mp_solve_choices (MP mp,pointer p, pointer q, halfword n) {
int k; /* current knot number */
pointer r,s,t; /* registers for list traversal */
@<Other local variables for |solve_choices|@>;
k=0; s=p; r=0;
while (1) {
- t=link(s);
+ t=mp_link(s);
if ( k==0 ) {
@<Get the linear equations started; or |return|
with the control points in place, if linear equations
needn't be solved@>
} else {
- switch (left_type(s)) {
+ switch (mp_left_type(s)) {
case mp_end_cycle: case mp_open:
@<Set up equation to match mock curvatures
at $z_k$; then |goto found| with $\theta_n$
@@ -7576,16 +7715,16 @@ FOUND:
defined. The first linear equation, if any, will have $A_0=B_0=0$.
@<Get the linear equations started...@>=
-switch (right_type(s)) {
+switch (mp_right_type(s)) {
case mp_given:
- if ( left_type(t)==mp_given ) {
+ if ( mp_left_type(t)==mp_given ) {
@<Reduce to simple case of two givens and |return|@>
} else {
@<Set up the equation for a given value of $\theta_0$@>;
}
break;
case mp_curl:
- if ( left_type(t)==mp_curl ) {
+ if ( mp_left_type(t)==mp_curl ) {
@<Reduce to simple case of straight line and |return|@>
} else {
@<Set up the equation for a curl at $\theta_0$@>;
@@ -7625,7 +7764,7 @@ scaled lt,rt; /* tension values */
@<Calculate the ratio $\\{ff}=C_k/(C_k+B_k-u_{k-1}A_k)$@>;
mp->uu[k]=mp_take_fraction(mp, ff,bb);
@<Calculate the values of $v_k$ and $w_k$@>;
- if ( left_type(s)==mp_end_cycle ) {
+ if ( mp_left_type(s)==mp_end_cycle ) {
@<Adjust $\theta_n$ to equal $\theta_0$ and |goto found|@>;
}
}
@@ -7681,7 +7820,7 @@ $-B_1\psi_1-A_1v_0=-(B_1-u_0A_1)\psi_1=-\\{cc}\cdot B_1\psi_1$.
@<Calculate the values of $v_k$ and $w_k$@>=
acc=-mp_take_fraction(mp, mp->psi[k+1],mp->uu[k]);
-if ( right_type(r)==mp_curl ) {
+if ( mp_right_type(r)==mp_curl ) {
mp->ww[k]=0;
mp->vv[k]=acc-mp_take_fraction(mp, mp->psi[1],fraction_one-ff);
} else {
@@ -7716,7 +7855,7 @@ if ( k==0 ) k=n;
} while (k!=n); /* now $\theta_n=\\{aa}+\\{bb}\cdot\theta_n$ */
aa=mp_make_fraction(mp, aa,fraction_one-bb);
mp->theta[n]=aa; mp->vv[0]=aa;
-for (k=1;k<=n-1;k++) {
+for (k=1;k<n;k++) {
mp->vv[k]=mp->vv[k]+mp_take_fraction(mp, aa,mp->ww[k]);
}
goto FOUND;
@@ -7768,7 +7907,11 @@ with the result reduced to 4 if it exceeds 4. (This reduction of curl
is necessary only if the curl and tension are both large.)
The values of $\alpha$ and $\beta$ will be at most~4/3.
-@<Declare subroutines needed by |solve_choices|@>=
+@<Declarations@>=
+static fraction mp_curl_ratio (MP mp,scaled gamma, scaled a_tension,
+ scaled b_tension) ;
+
+@ @c
fraction mp_curl_ratio (MP mp,scaled gamma, scaled a_tension,
scaled b_tension) {
fraction alpha,beta,num,denom,ff; /* registers */
@@ -7799,7 +7942,7 @@ for (k=n-1;k>=0;k--) {
}
s=p; k=0;
do {
- t=link(s);
+ t=mp_link(s);
mp_n_sin_cos(mp, mp->theta[k]); mp->st=mp->n_sin; mp->ct=mp->n_cos;
mp_n_sin_cos(mp, -mp->psi[k+1]-mp->theta[k+1]); mp->sf=mp->n_sin; mp->cf=mp->n_cos;
mp_set_controls(mp, s,t,k);
@@ -7817,7 +7960,10 @@ fraction ct;
fraction sf;
fraction cf; /* sines and cosines */
-@ @<Declare subroutines needed by |solve_choices|@>=
+@ @<Declarations@>=
+static void mp_set_controls (MP mp,pointer p, pointer q, integer k);
+
+@ @c
void mp_set_controls (MP mp,pointer p, pointer q, integer k) {
fraction rr,ss; /* velocities, divided by thrice the tension */
scaled lt,rt; /* tensions */
@@ -7829,19 +7975,19 @@ void mp_set_controls (MP mp,pointer p, pointer q, integer k) {
@<Decrease the velocities,
if necessary, to stay inside the bounding triangle@>;
}
- right_x(p)=x_coord(p)+mp_take_fraction(mp,
+ mp_right_x(p)=mp_x_coord(p)+mp_take_fraction(mp,
mp_take_fraction(mp, mp->delta_x[k],mp->ct)-
mp_take_fraction(mp, mp->delta_y[k],mp->st),rr);
- right_y(p)=y_coord(p)+mp_take_fraction(mp,
+ mp_right_y(p)=mp_y_coord(p)+mp_take_fraction(mp,
mp_take_fraction(mp, mp->delta_y[k],mp->ct)+
mp_take_fraction(mp, mp->delta_x[k],mp->st),rr);
- left_x(q)=x_coord(q)-mp_take_fraction(mp,
+ mp_left_x(q)=mp_x_coord(q)-mp_take_fraction(mp,
mp_take_fraction(mp, mp->delta_x[k],mp->cf)+
mp_take_fraction(mp, mp->delta_y[k],mp->sf),ss);
- left_y(q)=y_coord(q)-mp_take_fraction(mp,
+ mp_left_y(q)=mp_y_coord(q)-mp_take_fraction(mp,
mp_take_fraction(mp, mp->delta_y[k],mp->cf)-
mp_take_fraction(mp, mp->delta_x[k],mp->sf),ss);
- right_type(p)=mp_explicit; left_type(q)=mp_explicit;
+ mp_right_type(p)=mp_explicit; mp_left_type(q)=mp_explicit;
}
@ The boundedness conditions $\\{rr}\L\sin\phi\,/\sin(\theta+\phi)$ and
@@ -7876,27 +8022,27 @@ if (((mp->st>=0)&&(mp->sf>=0))||((mp->st<=0)&&(mp->sf<=0)) ) {
@ @<Reduce to simple case of straight line and |return|@>=
{
- right_type(p)=mp_explicit; left_type(q)=mp_explicit;
+ mp_right_type(p)=mp_explicit; mp_left_type(q)=mp_explicit;
lt=abs(left_tension(q)); rt=abs(right_tension(p));
if ( rt==unity ) {
- if ( mp->delta_x[0]>=0 ) right_x(p)=x_coord(p)+((mp->delta_x[0]+1) / 3);
- else right_x(p)=x_coord(p)+((mp->delta_x[0]-1) / 3);
- if ( mp->delta_y[0]>=0 ) right_y(p)=y_coord(p)+((mp->delta_y[0]+1) / 3);
- else right_y(p)=y_coord(p)+((mp->delta_y[0]-1) / 3);
+ if ( mp->delta_x[0]>=0 ) mp_right_x(p)=mp_x_coord(p)+((mp->delta_x[0]+1) / 3);
+ else mp_right_x(p)=mp_x_coord(p)+((mp->delta_x[0]-1) / 3);
+ if ( mp->delta_y[0]>=0 ) mp_right_y(p)=mp_y_coord(p)+((mp->delta_y[0]+1) / 3);
+ else mp_right_y(p)=mp_y_coord(p)+((mp->delta_y[0]-1) / 3);
} else {
ff=mp_make_fraction(mp, unity,3*rt); /* $\alpha/3$ */
- right_x(p)=x_coord(p)+mp_take_fraction(mp, mp->delta_x[0],ff);
- right_y(p)=y_coord(p)+mp_take_fraction(mp, mp->delta_y[0],ff);
+ mp_right_x(p)=mp_x_coord(p)+mp_take_fraction(mp, mp->delta_x[0],ff);
+ mp_right_y(p)=mp_y_coord(p)+mp_take_fraction(mp, mp->delta_y[0],ff);
}
if ( lt==unity ) {
- if ( mp->delta_x[0]>=0 ) left_x(q)=x_coord(q)-((mp->delta_x[0]+1) / 3);
- else left_x(q)=x_coord(q)-((mp->delta_x[0]-1) / 3);
- if ( mp->delta_y[0]>=0 ) left_y(q)=y_coord(q)-((mp->delta_y[0]+1) / 3);
- else left_y(q)=y_coord(q)-((mp->delta_y[0]-1) / 3);
+ if ( mp->delta_x[0]>=0 ) mp_left_x(q)=mp_x_coord(q)-((mp->delta_x[0]+1) / 3);
+ else mp_left_x(q)=mp_x_coord(q)-((mp->delta_x[0]-1) / 3);
+ if ( mp->delta_y[0]>=0 ) mp_left_y(q)=mp_y_coord(q)-((mp->delta_y[0]+1) / 3);
+ else mp_left_y(q)=mp_y_coord(q)-((mp->delta_y[0]-1) / 3);
} else {
ff=mp_make_fraction(mp, unity,3*lt); /* $\beta/3$ */
- left_x(q)=x_coord(q)-mp_take_fraction(mp, mp->delta_x[0],ff);
- left_y(q)=y_coord(q)-mp_take_fraction(mp, mp->delta_y[0],ff);
+ mp_left_x(q)=mp_x_coord(q)-mp_take_fraction(mp, mp->delta_x[0],ff);
+ mp_left_y(q)=mp_y_coord(q)-mp_take_fraction(mp, mp->delta_y[0],ff);
}
return;
}
@@ -7941,7 +8087,7 @@ is already negative at |t=0|), |crossing_point| returns the value zero.
@d zero_crossing { return 0; }
@d mp_crossing_point(M,A,B,C) mp_do_crossing_point(A,B,C)
-@c fraction mp_do_crossing_point (integer a, integer b, integer c) {
+@c static fraction mp_do_crossing_point (integer a, integer b, integer c) {
integer d; /* recursive counter */
integer x,xx,x0,x1,x2; /* temporary registers for bisection */
if ( a<0 ) zero_crossing;
@@ -8007,7 +8153,7 @@ It is convenient to define a \.{WEB} macro |t_of_the_way| such that
@d t_of_the_way(A,B) ((A)-mp_take_fraction(mp,((A)-(B)),t))
-@c scaled mp_eval_cubic (MP mp,pointer p, pointer q, fraction t) {
+@c static scaled mp_eval_cubic (MP mp,pointer p, pointer q, fraction t) {
scaled x1,x2,x3; /* intermediate values */
x1=t_of_the_way(knot_coord(p),right_coord(p));
x2=t_of_the_way(right_coord(p),left_coord(q));
@@ -8029,10 +8175,10 @@ enum mp_bb_code {
} ;
@
-@d minx mp->bbmin[mp_x_code]
-@d maxx mp->bbmax[mp_x_code]
-@d miny mp->bbmin[mp_y_code]
-@d maxy mp->bbmax[mp_y_code]
+@d mp_minx mp->bbmin[mp_x_code]
+@d mp_maxx mp->bbmax[mp_x_code]
+@d mp_miny mp->bbmin[mp_y_code]
+@d mp_maxy mp->bbmax[mp_y_code]
@<Glob...@>=
scaled bbmin[mp_y_code+1];
@@ -8048,7 +8194,7 @@ for $0<t\le1$. In other words, the procedure adjusts the bounds to
accommodate |knot_coord(q)| and any extremes over the range $0<t<1$.
The |c| parameter is |x_code| or |y_code|.
-@c void mp_bound_cubic (MP mp,pointer p, pointer q, small_number c) {
+@c static void mp_bound_cubic (MP mp,pointer p, pointer q, quarterword c) {
boolean wavy; /* whether we need to look for extremes */
scaled del1,del2,del3,del,dmax; /* proportional to the control
points of a quadratic derived from a cubic */
@@ -8130,14 +8276,14 @@ must cut it to zero to avoid confusion.
@ Finding the bounding box of a path is basically a matter of applying
|bound_cubic| twice for each pair of adjacent knots.
-@c void mp_path_bbox (MP mp,pointer h) {
+@c static void mp_path_bbox (MP mp,pointer h) {
pointer p,q; /* a pair of adjacent knots */
- minx=x_coord(h); miny=y_coord(h);
- maxx=minx; maxy=miny;
+ mp_minx=mp_x_coord(h); mp_miny=mp_y_coord(h);
+ mp_maxx=mp_minx; mp_maxy=mp_miny;
p=h;
do {
- if ( right_type(p)==mp_endpoint ) return;
- q=link(p);
+ if ( mp_right_type(p)==mp_endpoint ) return;
+ q=mp_link(p);
mp_bound_cubic(mp, x_loc(p),x_loc(q),mp_x_code);
mp_bound_cubic(mp, y_loc(p),y_loc(q),mp_y_code);
p=q;
@@ -8212,8 +8358,8 @@ for ${1\over3}\vb\dot B(0)\vb$, ${2\over3}\vb\dot B({1\over2})\vb$, and
${1\over3}\vb\dot B(1)\vb$. These quantities are relatively expensive to compute
and they are needed in different instances of |arc_test|.
-@c @<Declare subroutines needed by |arc_test|@>
-scaled mp_arc_test (MP mp, scaled dx0, scaled dy0, scaled dx1, scaled dy1,
+@c
+static scaled mp_arc_test (MP mp, scaled dx0, scaled dy0, scaled dx1, scaled dy1,
scaled dx2, scaled dy2, scaled v0, scaled v02,
scaled v2, scaled a_goal, scaled tol) {
boolean simple; /* are the control points confined to a $90^\circ$ sector? */
@@ -8397,7 +8543,10 @@ If rounding error causes this condition to be violated slightly, we just ignore
it and proceed with binary search. This finds a time when the function value
reaches |x| and the slope is positive.
-@<Declare subroutines needed by |arc_test|@>=
+@<Declarations@>=
+static scaled mp_solve_rising_cubic (MP mp,scaled a, scaled b, scaled c, scaled x) ;
+
+@ @c
scaled mp_solve_rising_cubic (MP mp,scaled a, scaled b, scaled c, scaled x) {
scaled ab, bc, ac; /* bisection results */
integer t; /* $2^k+q$ where unscaled answer is in $[q2^{-k},(q+1)2^{-k})$ */
@@ -8444,7 +8593,7 @@ length less than |fraction_four|.
@d arc_tol 16 /* quit when change in arc length estimate reaches this */
-@c scaled mp_do_arc_test (MP mp,scaled dx0, scaled dy0, scaled dx1,
+@c static scaled mp_do_arc_test (MP mp,scaled dx0, scaled dy0, scaled dx1,
scaled dy1, scaled dx2, scaled dy2, scaled a_goal) {
scaled v0,v1,v2; /* length of each $({\it dx},{\it dy})$ pair */
scaled v02; /* twice the norm of the quadratic at $t={1\over2}$ */
@@ -8464,16 +8613,16 @@ length less than |fraction_four|.
@ Now it is easy to find the arc length of an entire path.
-@c scaled mp_get_arc_length (MP mp,pointer h) {
+@c static scaled mp_get_arc_length (MP mp,pointer h) {
pointer p,q; /* for traversing the path */
scaled a,a_tot; /* current and total arc lengths */
a_tot = 0;
p = h;
- while ( right_type(p)!=mp_endpoint ){
- q = link(p);
- a = mp_do_arc_test(mp, right_x(p)-x_coord(p), right_y(p)-y_coord(p),
- left_x(q)-right_x(p), left_y(q)-right_y(p),
- x_coord(q)-left_x(q), y_coord(q)-left_y(q), el_gordo);
+ while ( mp_right_type(p)!=mp_endpoint ){
+ q = mp_link(p);
+ a = mp_do_arc_test(mp, mp_right_x(p)-mp_x_coord(p), mp_right_y(p)-mp_y_coord(p),
+ mp_left_x(q)-mp_right_x(p), mp_left_y(q)-mp_right_y(p),
+ mp_x_coord(q)-mp_left_x(q), mp_y_coord(q)-mp_left_y(q), el_gordo);
a_tot = mp_slow_add(mp, a, a_tot);
if ( q==h ) break; else p=q;
}
@@ -8492,7 +8641,7 @@ time value greater than the length of the path. Since it could be much greater,
we must be prepared to compute the arc length of path~|h| and divide this into
|arc0| to find how many multiples of the length of path~|h| to add.
-@c scaled mp_get_arc_time (MP mp,pointer h, scaled arc0) {
+@c static scaled mp_get_arc_time (MP mp,pointer h, scaled arc0) {
pointer p,q; /* for traversing the path */
scaled t_tot; /* accumulator for the result */
scaled t; /* the result of |do_arc_test| */
@@ -8505,11 +8654,11 @@ we must be prepared to compute the arc length of path~|h| and divide this into
t_tot = 0;
arc = arc0;
p = h;
- while ( (right_type(p)!=mp_endpoint) && (arc>0) ) {
- q = link(p);
- t = mp_do_arc_test(mp, right_x(p)-x_coord(p), right_y(p)-y_coord(p),
- left_x(q)-right_x(p), left_y(q)-right_y(p),
- x_coord(q)-left_x(q), y_coord(q)-left_y(q), arc);
+ while ( (mp_right_type(p)!=mp_endpoint) && (arc>0) ) {
+ q = mp_link(p);
+ t = mp_do_arc_test(mp, mp_right_x(p)-mp_x_coord(p), mp_right_y(p)-mp_y_coord(p),
+ mp_left_x(q)-mp_right_x(p), mp_left_y(q)-mp_right_y(p),
+ mp_x_coord(q)-mp_left_x(q), mp_y_coord(q)-mp_left_y(q), arc);
@<Update |arc| and |t_tot| after |do_arc_test| has just returned |t|@>;
if ( q==h ) {
@<Update |t_tot| and |arc| to avoid going around the cyclic
@@ -8528,7 +8677,7 @@ else { t_tot = t_tot + unity; arc = arc - t; }
@ @<Deal with a negative |arc0| value and |return|@>=
{
- if ( left_type(h)==mp_endpoint ) {
+ if ( mp_left_type(h)==mp_endpoint ) {
t_tot=0;
} else {
p = mp_htap_ypoc(mp, h);
@@ -8567,13 +8716,13 @@ counter-clockwise order.
Since we will need to scan pen polygons both forward and backward, a pen
should be represented as a doubly linked ring of knot nodes. There is
room for the extra back pointer because we do not need the
-|left_type| or |right_type| fields. In fact, we don't need the |left_x|,
-|left_y|, |right_x|, or |right_y| fields either but we leave these alone
+|mp_left_type| or |mp_right_type| fields. In fact, we don't need the |mp_left_x|,
+|mp_left_y|, |mp_right_x|, or |mp_right_y| fields either but we leave these alone
so that certain procedures can operate on both pens and paths. In particular,
pens can be copied using |copy_path| and recycled using |toss_knot_list|.
-@d knil info
- /* this replaces the |left_type| and |right_type| fields in a pen knot */
+@d knil mp_info
+ /* this replaces the |mp_left_type| and |mp_right_type| fields in a pen knot */
@ The |make_pen| procedure turns a path into a pen by initializing
the |knil| pointers and making sure the knots form a convex polygon.
@@ -8583,12 +8732,12 @@ straight line.
@d copy_pen(A) mp_make_pen(mp, mp_copy_path(mp, (A)),false)
-@c @<Declare a function called |convex_hull|@>
-pointer mp_make_pen (MP mp,pointer h, boolean need_hull) {
+@c
+static pointer mp_make_pen (MP mp,pointer h, boolean need_hull) {
pointer p,q; /* two consecutive knots */
q=h;
do {
- p=q; q=link(q);
+ p=q; q=mp_link(q);
knil(q)=p;
} while (q!=h);
if ( need_hull ){
@@ -8605,51 +8754,37 @@ Since it suffices to keep track of how the three points $(0,0)$, $(1,0)$,
and $(0,1)$ are transformed, an elliptical pen can be stored in a single
knot node and transformed as if it were a path.
-@d pen_is_elliptical(A) ((A)==link((A)))
+@d pen_is_elliptical(A) ((A)==mp_link((A)))
-@c pointer mp_get_pen_circle (MP mp,scaled diam) {
+@c
+static pointer mp_get_pen_circle (MP mp,scaled diam) {
pointer h; /* the knot node to return */
h=mp_get_node(mp, knot_node_size);
- link(h)=h; knil(h)=h;
- originator(h)=mp_program_code;
- x_coord(h)=0; y_coord(h)=0;
- left_x(h)=diam; left_y(h)=0;
- right_x(h)=0; right_y(h)=diam;
+ mp_link(h)=h; knil(h)=h;
+ mp_originator(h)=mp_program_code;
+ mp_x_coord(h)=0; mp_y_coord(h)=0;
+ mp_left_x(h)=diam; mp_left_y(h)=0;
+ mp_right_x(h)=0; mp_right_y(h)=diam;
return h;
}
@ If the polygon being returned by |make_pen| has only one vertex, it will
be interpreted as an elliptical pen. This is no problem since a degenerate
polygon can equally well be thought of as a degenerate ellipse. We need only
-initialize the |left_x|, |left_y|, |right_x|, and |right_y| fields.
+initialize the |mp_left_x|, |mp_left_y|, |mp_right_x|, and |mp_right_y| fields.
@<Make sure |h| isn't confused with an elliptical pen@>=
if ( pen_is_elliptical( h) ){
- left_x(h)=x_coord(h); left_y(h)=y_coord(h);
- right_x(h)=x_coord(h); right_y(h)=y_coord(h);
+ mp_left_x(h)=mp_x_coord(h); mp_left_y(h)=mp_y_coord(h);
+ mp_right_x(h)=mp_x_coord(h); mp_right_y(h)=mp_y_coord(h);
}
-@ We have to cheat a little here but most operations on pens only use
-the first three words in each knot node.
-@^data structure assumptions@>
-
-@<Initialize a pen at |test_pen| so that it fits in nine words@>=
-x_coord(test_pen)=-half_unit;
-y_coord(test_pen)=0;
-x_coord(test_pen+3)=half_unit;
-y_coord(test_pen+3)=0;
-x_coord(test_pen+6)=0;
-y_coord(test_pen+6)=unity;
-link(test_pen)=test_pen+3;
-link(test_pen+3)=test_pen+6;
-link(test_pen+6)=test_pen;
-knil(test_pen)=test_pen+6;
-knil(test_pen+3)=test_pen;
-knil(test_pen+6)=test_pen+3
-
@ Printing a polygonal pen is very much like printing a path
-@<Declare subroutines for printing expressions@>=
+@<Declarations@>=
+static void mp_pr_pen (MP mp,pointer h) ;
+
+@ @c
void mp_pr_pen (MP mp,pointer h) {
pointer p,q; /* for list traversal */
if ( pen_is_elliptical(h) ) {
@@ -8657,7 +8792,7 @@ void mp_pr_pen (MP mp,pointer h) {
} else {
p=h;
do {
- mp_print_two(mp, x_coord(p),y_coord(p));
+ mp_print_two(mp, mp_x_coord(p),mp_y_coord(p));
mp_print_nl(mp, " .. ");
@<Advance |p| making sure the links are OK and |return| if there is
a problem@>;
@@ -8667,7 +8802,7 @@ void mp_pr_pen (MP mp,pointer h) {
}
@ @<Advance |p| making sure the links are OK and |return| if there is...@>=
-q=link(p);
+q=mp_link(p);
if ( (q==null) || (knil(q)!=p) ) {
mp_print_nl(mp, "???"); return; /* this won't happen */
@.???@>
@@ -8677,24 +8812,27 @@ p=q
@ @<Print the elliptical pen |h|@>=
{
mp_print(mp, "pencircle transformed (");
-mp_print_scaled(mp, x_coord(h));
-mp_print_char(mp, ',');
-mp_print_scaled(mp, y_coord(h));
-mp_print_char(mp, ',');
-mp_print_scaled(mp, left_x(h)-x_coord(h));
-mp_print_char(mp, ',');
-mp_print_scaled(mp, right_x(h)-x_coord(h));
-mp_print_char(mp, ',');
-mp_print_scaled(mp, left_y(h)-y_coord(h));
-mp_print_char(mp, ',');
-mp_print_scaled(mp, right_y(h)-y_coord(h));
-mp_print_char(mp, ')');
+mp_print_scaled(mp, mp_x_coord(h));
+mp_print_char(mp, xord(','));
+mp_print_scaled(mp, mp_y_coord(h));
+mp_print_char(mp, xord(','));
+mp_print_scaled(mp, mp_left_x(h)-mp_x_coord(h));
+mp_print_char(mp, xord(','));
+mp_print_scaled(mp, mp_right_x(h)-mp_x_coord(h));
+mp_print_char(mp, xord(','));
+mp_print_scaled(mp, mp_left_y(h)-mp_y_coord(h));
+mp_print_char(mp, xord(','));
+mp_print_scaled(mp, mp_right_y(h)-mp_y_coord(h));
+mp_print_char(mp, xord(')'));
}
@ Here us another version of |pr_pen| that prints the pen as a diagnostic
message.
-@<Declare subroutines for printing expressions@>=
+@<Declarations@>=
+static void mp_print_pen (MP mp,pointer h, const char *s, boolean nuline) ;
+
+@ @c
void mp_print_pen (MP mp,pointer h, const char *s, boolean nuline) {
mp_print_diagnostic(mp, "Pen",s,nuline); mp_print_ln(mp);
@.Pen at line...@>
@@ -8702,33 +8840,33 @@ void mp_print_pen (MP mp,pointer h, const char *s, boolean nuline) {
mp_end_diagnostic(mp, true);
}
-@ Making a polygonal pen into a path involves restoring the |left_type| and
-|right_type| fields and setting the control points so as to make a polygonal
+@ Making a polygonal pen into a path involves restoring the |mp_left_type| and
+|mp_right_type| fields and setting the control points so as to make a polygonal
path.
@c
-void mp_make_path (MP mp,pointer h) {
+static void mp_make_path (MP mp,pointer h) {
pointer p; /* for traversing the knot list */
- small_number k; /* a loop counter */
+ quarterword k; /* a loop counter */
@<Other local variables in |make_path|@>;
if ( pen_is_elliptical(h) ) {
@<Make the elliptical pen |h| into a path@>;
} else {
p=h;
do {
- left_type(p)=mp_explicit;
- right_type(p)=mp_explicit;
+ mp_left_type(p)=mp_explicit;
+ mp_right_type(p)=mp_explicit;
@<copy the coordinates of knot |p| into its control points@>;
- p=link(p);
+ p=mp_link(p);
} while (p!=h);
}
}
@ @<copy the coordinates of knot |p| into its control points@>=
-left_x(p)=x_coord(p);
-left_y(p)=y_coord(p);
-right_x(p)=x_coord(p);
-right_y(p)=y_coord(p)
+mp_left_x(p)=mp_x_coord(p);
+mp_left_y(p)=mp_y_coord(p);
+mp_right_x(p)=mp_x_coord(p);
+mp_right_y(p)=mp_y_coord(p)
@ We need an eight knot path to get a good approximation to an ellipse.
@@ -8739,18 +8877,18 @@ right_y(p)=y_coord(p)
for (k=0;k<=7;k++ ) {
@<Initialize |p| as the |k|th knot of a circle of unit diameter,
transforming it appropriately@>;
- if ( k==7 ) link(p)=h; else link(p)=mp_get_node(mp, knot_node_size);
- p=link(p);
+ if ( k==7 ) mp_link(p)=h; else mp_link(p)=mp_get_node(mp, knot_node_size);
+ p=mp_link(p);
}
}
@ @<Extract the transformation parameters from the elliptical pen~|h|@>=
-center_x=x_coord(h);
-center_y=y_coord(h);
-width_x=left_x(h)-center_x;
-width_y=left_y(h)-center_y;
-height_x=right_x(h)-center_x;
-height_y=right_y(h)-center_y
+center_x=mp_x_coord(h);
+center_y=mp_y_coord(h);
+width_x=mp_left_x(h)-center_x;
+width_y=mp_left_y(h)-center_y;
+height_x=mp_right_x(h)-center_x;
+height_y=mp_right_y(h)-center_y
@ @<Other local variables in |make_path|@>=
scaled center_x,center_y; /* translation parameters for an elliptical pen */
@@ -8766,21 +8904,21 @@ to use there.
@<Initialize |p| as the |k|th knot of a circle of unit diameter,...@>=
kk=(k+6)% 8;
-x_coord(p)=center_x+mp_take_fraction(mp, mp->half_cos[k],width_x)
+mp_x_coord(p)=center_x+mp_take_fraction(mp, mp->half_cos[k],width_x)
+mp_take_fraction(mp, mp->half_cos[kk],height_x);
-y_coord(p)=center_y+mp_take_fraction(mp, mp->half_cos[k],width_y)
+mp_y_coord(p)=center_y+mp_take_fraction(mp, mp->half_cos[k],width_y)
+mp_take_fraction(mp, mp->half_cos[kk],height_y);
dx=-mp_take_fraction(mp, mp->d_cos[kk],width_x)
+mp_take_fraction(mp, mp->d_cos[k],height_x);
dy=-mp_take_fraction(mp, mp->d_cos[kk],width_y)
+mp_take_fraction(mp, mp->d_cos[k],height_y);
-right_x(p)=x_coord(p)+dx;
-right_y(p)=y_coord(p)+dy;
-left_x(p)=x_coord(p)-dx;
-left_y(p)=y_coord(p)-dy;
-left_type(p)=mp_explicit;
-right_type(p)=mp_explicit;
-originator(p)=mp_program_code
+mp_right_x(p)=mp_x_coord(p)+dx;
+mp_right_y(p)=mp_y_coord(p)+dy;
+mp_left_x(p)=mp_x_coord(p)-dx;
+mp_left_y(p)=mp_y_coord(p)-dy;
+mp_left_type(p)=mp_explicit;
+mp_right_type(p)=mp_explicit;
+mp_originator(p)=mp_program_code
@ @<Glob...@>=
fraction half_cos[8]; /* ${1\over2}\cos(45k)$ */
@@ -8815,8 +8953,10 @@ error might allow the convexity to be lost.
The convex hull algorithm used here is described by F.~P. Preparata and
M.~I. Shamos [{\sl Computational Geometry}, Springer-Verlag, 1985].
-@<Declare a function called |convex_hull|@>=
-@<Declare a procedure called |move_knot|@>
+@<Declarations@>=
+static pointer mp_convex_hull (MP mp,pointer h);
+
+@ @c
pointer mp_convex_hull (MP mp,pointer h) { /* Make a polygonal pen convex */
pointer l,r; /* the leftmost and rightmost knots */
pointer p,q; /* knots being scanned */
@@ -8828,7 +8968,7 @@ pointer mp_convex_hull (MP mp,pointer h) { /* Make a polygonal pen convex */
@<Set |l| to the leftmost knot in polygon~|h|@>;
@<Set |r| to the rightmost knot in polygon~|h|@>;
if ( l!=r ) {
- s=link(r);
+ s=mp_link(r);
@<Find any knots on the path from |l| to |r| above the |l|-|r| line and
move them past~|r|@>;
@<Find any knots on the path from |s| to |l| below the |l|-|r| line and
@@ -8836,7 +8976,7 @@ pointer mp_convex_hull (MP mp,pointer h) { /* Make a polygonal pen convex */
@<Sort the path from |l| to |r| by increasing $x$@>;
@<Sort the path from |r| to |l| by decreasing $x$@>;
}
- if ( l!=link(l) ) {
+ if ( l!=mp_link(l) ) {
@<Do a Gramm scan and remove vertices where there is no left turn@>;
}
return l;
@@ -8847,31 +8987,31 @@ pointer mp_convex_hull (MP mp,pointer h) { /* Make a polygonal pen convex */
@<Set |l| to the leftmost knot in polygon~|h|@>=
l=h;
-p=link(h);
+p=mp_link(h);
while ( p!=h ) {
- if ( x_coord(p)<=x_coord(l) )
- if ( (x_coord(p)<x_coord(l)) || (y_coord(p)<y_coord(l)) )
+ if ( mp_x_coord(p)<=mp_x_coord(l) )
+ if ( (mp_x_coord(p)<mp_x_coord(l)) || (mp_y_coord(p)<mp_y_coord(l)) )
l=p;
- p=link(p);
+ p=mp_link(p);
}
@ @<Set |r| to the rightmost knot in polygon~|h|@>=
r=h;
-p=link(h);
+p=mp_link(h);
while ( p!=h ) {
- if ( x_coord(p)>=x_coord(r) )
- if ( (x_coord(p)>x_coord(r)) || (y_coord(p)>y_coord(r)) )
+ if ( mp_x_coord(p)>=mp_x_coord(r) )
+ if ( (mp_x_coord(p)>mp_x_coord(r)) || (mp_y_coord(p)>mp_y_coord(r)) )
r=p;
- p=link(p);
+ p=mp_link(p);
}
@ @<Find any knots on the path from |l| to |r| above the |l|-|r| line...@>=
-dx=x_coord(r)-x_coord(l);
-dy=y_coord(r)-y_coord(l);
-p=link(l);
+dx=mp_x_coord(r)-mp_x_coord(l);
+dy=mp_y_coord(r)-mp_y_coord(l);
+p=mp_link(l);
while ( p!=r ) {
- q=link(p);
- if ( mp_ab_vs_cd(mp, dx,y_coord(p)-y_coord(l),dy,x_coord(p)-x_coord(l))>0 )
+ q=mp_link(p);
+ if ( mp_ab_vs_cd(mp, dx,mp_y_coord(p)-mp_y_coord(l),dy,mp_x_coord(p)-mp_x_coord(l))>0 )
mp_move_knot(mp, p, r);
p=q;
}
@@ -8879,21 +9019,24 @@ while ( p!=r ) {
@ The |move_knot| procedure removes |p| from a doubly linked list and inserts
it after |q|.
-@ @<Declare a procedure called |move_knot|@>=
+@ @<Declarations@>=
+static void mp_move_knot (MP mp,pointer p, pointer q) ;
+
+@ @c
void mp_move_knot (MP mp,pointer p, pointer q) {
- link(knil(p))=link(p);
- knil(link(p))=knil(p);
+ mp_link(knil(p))=mp_link(p);
+ knil(mp_link(p))=knil(p);
knil(p)=q;
- link(p)=link(q);
- link(q)=p;
- knil(link(p))=p;
+ mp_link(p)=mp_link(q);
+ mp_link(q)=p;
+ knil(mp_link(p))=p;
}
@ @<Find any knots on the path from |s| to |l| below the |l|-|r| line...@>=
p=s;
while ( p!=l ) {
- q=link(p);
- if ( mp_ab_vs_cd(mp, dx,y_coord(p)-y_coord(l),dy,x_coord(p)-x_coord(l))<0 )
+ q=mp_link(p);
+ if ( mp_ab_vs_cd(mp, dx,mp_y_coord(p)-mp_y_coord(l),dy,mp_x_coord(p)-mp_x_coord(l))<0 )
mp_move_knot(mp, p,l);
p=q;
}
@@ -8903,27 +9046,27 @@ Secondary comparisons on $y$ ensure that the sort is consistent with the
choice of |l| and |r|.
@<Sort the path from |l| to |r| by increasing $x$@>=
-p=link(l);
+p=mp_link(l);
while ( p!=r ) {
q=knil(p);
- while ( x_coord(q)>x_coord(p) ) q=knil(q);
- while ( x_coord(q)==x_coord(p) ) {
- if ( y_coord(q)>y_coord(p) ) q=knil(q); else break;
+ while ( mp_x_coord(q)>mp_x_coord(p) ) q=knil(q);
+ while ( mp_x_coord(q)==mp_x_coord(p) ) {
+ if ( mp_y_coord(q)>mp_y_coord(p) ) q=knil(q); else break;
}
- if ( q==knil(p) ) p=link(p);
- else { p=link(p); mp_move_knot(mp, knil(p),q); };
+ if ( q==knil(p) ) p=mp_link(p);
+ else { p=mp_link(p); mp_move_knot(mp, knil(p),q); };
}
@ @<Sort the path from |r| to |l| by decreasing $x$@>=
-p=link(r);
+p=mp_link(r);
while ( p!=l ){
q=knil(p);
- while ( x_coord(q)<x_coord(p) ) q=knil(q);
- while ( x_coord(q)==x_coord(p) ) {
- if ( y_coord(q)<y_coord(p) ) q=knil(q); else break;
+ while ( mp_x_coord(q)<mp_x_coord(p) ) q=knil(q);
+ while ( mp_x_coord(q)==mp_x_coord(p) ) {
+ if ( mp_y_coord(q)<mp_y_coord(p) ) q=knil(q); else break;
}
- if ( q==knil(p) ) p=link(p);
- else { p=link(p); mp_move_knot(mp, knil(p),q); };
+ if ( q==knil(p) ) p=mp_link(p);
+ else { p=mp_link(p); mp_move_knot(mp, knil(p),q); };
}
@ The condition involving |ab_vs_cd| tests if there is not a left turn
@@ -8932,14 +9075,14 @@ where the |then| clause is not executed.
@<Do a Gramm scan and remove vertices where there...@>=
{
-p=l; q=link(l);
+p=l; q=mp_link(l);
while (1) {
- dx=x_coord(q)-x_coord(p);
- dy=y_coord(q)-y_coord(p);
- p=q; q=link(q);
+ dx=mp_x_coord(q)-mp_x_coord(p);
+ dy=mp_y_coord(q)-mp_y_coord(p);
+ p=q; q=mp_link(q);
if ( p==l ) break;
if ( p!=r )
- if ( mp_ab_vs_cd(mp, dx,y_coord(q)-y_coord(p),dy,x_coord(q)-x_coord(p))<=0 ) {
+ if ( mp_ab_vs_cd(mp, dx,mp_y_coord(q)-mp_y_coord(p),dy,mp_x_coord(q)-mp_x_coord(p))<=0 ) {
@<Remove knot |p| and back up |p| and |q| but don't go past |l|@>;
}
}
@@ -8949,7 +9092,7 @@ while (1) {
{
s=knil(p);
mp_free_node(mp, p,knot_node_size);
-link(s)=q; knil(q)=s;
+mp_link(s)=q; knil(q)=s;
if ( s==l ) p=s;
else { p=knil(s); q=s; };
}
@@ -8959,7 +9102,7 @@ offset associated with the given direction |(x,y)|. If two different offsets
apply, it chooses one of them.
@c
-void mp_find_offset (MP mp,scaled x, scaled y, pointer h) {
+static void mp_find_offset (MP mp,scaled x, scaled y, pointer h) {
pointer p,q; /* consecutive knots */
scaled wx,wy,hx,hy;
/* the transformation matrix for an elliptical pen */
@@ -8970,13 +9113,13 @@ void mp_find_offset (MP mp,scaled x, scaled y, pointer h) {
} else {
q=h;
do {
- p=q; q=link(q);
- } while (!(mp_ab_vs_cd(mp, x_coord(q)-x_coord(p),y, y_coord(q)-y_coord(p),x)>=0));
+ p=q; q=mp_link(q);
+ } while (!(mp_ab_vs_cd(mp, mp_x_coord(q)-mp_x_coord(p),y, mp_y_coord(q)-mp_y_coord(p),x)>=0));
do {
- p=q; q=link(q);
- } while (!(mp_ab_vs_cd(mp, x_coord(q)-x_coord(p),y, y_coord(q)-y_coord(p),x)<=0));
- mp->cur_x=x_coord(p);
- mp->cur_y=y_coord(p);
+ p=q; q=mp_link(q);
+ } while (!(mp_ab_vs_cd(mp, mp_x_coord(q)-mp_x_coord(p),y, mp_y_coord(q)-mp_y_coord(p),x)<=0));
+ mp->cur_x=mp_x_coord(p);
+ mp->cur_y=mp_y_coord(p);
}
}
@@ -8986,7 +9129,7 @@ scaled cur_y; /* all-purpose return value registers */
@ @<Find the offset for |(x,y)| on the elliptical pen~|h|@>=
if ( (x==0) && (y==0) ) {
- mp->cur_x=x_coord(h); mp->cur_y=y_coord(h);
+ mp->cur_x=mp_x_coord(h); mp->cur_y=mp_y_coord(h);
} else {
@<Find the non-constant part of the transformation for |h|@>;
while ( (abs(x)<fraction_half) && (abs(y)<fraction_half) ){
@@ -8994,15 +9137,15 @@ if ( (x==0) && (y==0) ) {
};
@<Make |(xx,yy)| the offset on the untransformed \&{pencircle} for the
untransformed version of |(x,y)|@>;
- mp->cur_x=x_coord(h)+mp_take_fraction(mp, xx,wx)+mp_take_fraction(mp, yy,hx);
- mp->cur_y=y_coord(h)+mp_take_fraction(mp, xx,wy)+mp_take_fraction(mp, yy,hy);
+ mp->cur_x=mp_x_coord(h)+mp_take_fraction(mp, xx,wx)+mp_take_fraction(mp, yy,hx);
+ mp->cur_y=mp_y_coord(h)+mp_take_fraction(mp, xx,wy)+mp_take_fraction(mp, yy,hy);
}
@ @<Find the non-constant part of the transformation for |h|@>=
-wx=left_x(h)-x_coord(h);
-wy=left_y(h)-y_coord(h);
-hx=right_x(h)-x_coord(h);
-hy=right_y(h)-y_coord(h)
+wx=mp_left_x(h)-mp_x_coord(h);
+wy=mp_left_y(h)-mp_y_coord(h);
+hx=mp_right_x(h)-mp_x_coord(h);
+hy=mp_right_y(h)-mp_y_coord(h)
@ @<Make |(xx,yy)| the offset on the untransformed \&{pencircle} for the...@>=
yy=-(mp_take_fraction(mp, x,hy)+mp_take_fraction(mp, y,-hx));
@@ -9018,20 +9161,20 @@ But we can handle that case by just calling |find_offset| twice. The answer
is stored in the global variables |minx|, |maxx|, |miny|, and |maxy|.
@c
-void mp_pen_bbox (MP mp,pointer h) {
+static void mp_pen_bbox (MP mp,pointer h) {
pointer p; /* for scanning the knot list */
if ( pen_is_elliptical(h) ) {
@<Find the bounding box of an elliptical pen@>;
} else {
- minx=x_coord(h); maxx=minx;
- miny=y_coord(h); maxy=miny;
- p=link(h);
+ mp_minx=mp_x_coord(h); mp_maxx=mp_minx;
+ mp_miny=mp_y_coord(h); mp_maxy=mp_miny;
+ p=mp_link(h);
while ( p!=h ) {
- if ( x_coord(p)<minx ) minx=x_coord(p);
- if ( y_coord(p)<miny ) miny=y_coord(p);
- if ( x_coord(p)>maxx ) maxx=x_coord(p);
- if ( y_coord(p)>maxy ) maxy=y_coord(p);
- p=link(p);
+ if ( mp_x_coord(p)<mp_minx ) mp_minx=mp_x_coord(p);
+ if ( mp_y_coord(p)<mp_miny ) mp_miny=mp_y_coord(p);
+ if ( mp_x_coord(p)>mp_maxx ) mp_maxx=mp_x_coord(p);
+ if ( mp_y_coord(p)>mp_maxy ) mp_maxy=mp_y_coord(p);
+ p=mp_link(p);
}
}
}
@@ -9039,11 +9182,11 @@ void mp_pen_bbox (MP mp,pointer h) {
@ @<Find the bounding box of an elliptical pen@>=
{
mp_find_offset(mp, 0,fraction_one,h);
-maxx=mp->cur_x;
-minx=2*x_coord(h)-mp->cur_x;
+mp_maxx=mp->cur_x;
+mp_minx=2*mp_x_coord(h)-mp->cur_x;
mp_find_offset(mp, -fraction_one,0,h);
-maxy=mp->cur_y;
-miny=2*y_coord(h)-mp->cur_y;
+mp_maxy=mp->cur_y;
+mp_miny=2*mp_y_coord(h)-mp->cur_y;
}
@* \[21] Edge structures.
@@ -9061,7 +9204,7 @@ lists of graphical objects. \MP\ has no easy way to determine whether
two such objects overlap, but it suffices to draw the first one first and
let the second one overwrite it if necessary.
-@<Types...@>=
+@(mplib.h@>=
enum mp_graphical_object_code {
@<Graphical object codes@>
mp_final_graphic
@@ -9074,11 +9217,11 @@ pointer to a cyclic path and the value to use for \ps' \&{currentrgbcolor}
parameter. If a pen is used for filling |pen_p|, |ljoin_val| and |miterlim_val|
give the relevant information.
-@d path_p(A) link((A)+1)
+@d mp_path_p(A) mp_link((A)+1)
/* a pointer to the path that needs filling */
-@d pen_p(A) info((A)+1)
+@d mp_pen_p(A) mp_info((A)+1)
/* a pointer to the pen to fill or stroke with */
-@d color_model(A) type((A)+2) /* the color model */
+@d mp_color_model(A) mp_type((A)+2) /* the color model */
@d obj_red_loc(A) ((A)+3) /* the first of three locations for the color */
@d obj_cyan_loc obj_red_loc /* the first of four locations for the color */
@d obj_grey_loc obj_red_loc /* the location for the color */
@@ -9094,34 +9237,34 @@ give the relevant information.
@d yellow_val blue_val
@d black_val(A) mp->mem[(A)+6].sc
/* the blue component of the color in the range $0\ldots1$ */
-@d ljoin_val(A) name_type((A)) /* the value of \&{linejoin} */
+@d ljoin_val(A) mp_name_type((A)) /* the value of \&{linejoin} */
@:mp_linejoin_}{\&{linejoin} primitive@>
@d miterlim_val(A) mp->mem[(A)+7].sc /* the value of \&{miterlimit} */
@:mp_miterlimit_}{\&{miterlimit} primitive@>
@d obj_color_part(A) mp->mem[(A)+3-red_part].sc
/* interpret an object pointer that has been offset by |red_part..blue_part| */
-@d pre_script(A) mp->mem[(A)+8].hh.lh
-@d post_script(A) mp->mem[(A)+8].hh.rh
+@d mp_pre_script(A) mp->mem[(A)+8].hh.lh
+@d mp_post_script(A) mp->mem[(A)+8].hh.rh
@d fill_node_size 9
@ @<Graphical object codes@>=
mp_fill_code=1,
@ @c
-pointer mp_new_fill_node (MP mp,pointer p) {
+static pointer mp_new_fill_node (MP mp,pointer p) {
/* make a fill node for cyclic path |p| and color black */
pointer t; /* the new node */
t=mp_get_node(mp, fill_node_size);
- type(t)=mp_fill_code;
- path_p(t)=p;
- pen_p(t)=null; /* |null| means don't use a pen */
+ mp_type(t)=mp_fill_code;
+ mp_path_p(t)=p;
+ mp_pen_p(t)=null; /* |null| means don't use a pen */
red_val(t)=0;
green_val(t)=0;
blue_val(t)=0;
black_val(t)=0;
- color_model(t)=mp_uninitialized_model;
- pre_script(t)=null;
- post_script(t)=null;
+ mp_color_model(t)=mp_uninitialized_model;
+ mp_pre_script(t)=null;
+ mp_post_script(t)=null;
@<Set the |ljoin_val| and |miterlim_val| fields in object |t|@>;
return t;
}
@@ -9141,9 +9284,9 @@ factor for the dash pattern, and a pointer that is non-null if the stroke
is to be dashed. The purpose of the scale factor is to allow a picture to
be transformed without touching the picture that |dash_p| points to.
-@d dash_p(A) link((A)+9)
+@d mp_dash_p(A) mp_link((A)+9)
/* a pointer to the edge structure that gives the dash pattern */
-@d lcap_val(A) type((A)+9)
+@d lcap_val(A) mp_type((A)+9)
/* the value of \&{linecap} */
@:mp_linecap_}{\&{linecap} primitive@>
@d dash_scale(A) mp->mem[(A)+10].sc /* dash lengths are scaled by this factor */
@@ -9153,21 +9296,21 @@ be transformed without touching the picture that |dash_p| points to.
mp_stroked_code=2,
@ @c
-pointer mp_new_stroked_node (MP mp,pointer p) {
- /* make a stroked node for path |p| with |pen_p(p)| temporarily |null| */
+static pointer mp_new_stroked_node (MP mp,pointer p) {
+ /* make a stroked node for path |p| with |mp_pen_p(p)| temporarily |null| */
pointer t; /* the new node */
t=mp_get_node(mp, stroked_node_size);
- type(t)=mp_stroked_code;
- path_p(t)=p; pen_p(t)=null;
- dash_p(t)=null;
+ mp_type(t)=mp_stroked_code;
+ mp_path_p(t)=p; mp_pen_p(t)=null;
+ mp_dash_p(t)=null;
dash_scale(t)=unity;
red_val(t)=0;
green_val(t)=0;
blue_val(t)=0;
black_val(t)=0;
- color_model(t)=mp_uninitialized_model;
- pre_script(t)=null;
- post_script(t)=null;
+ mp_color_model(t)=mp_uninitialized_model;
+ mp_pre_script(t)=null;
+ mp_post_script(t)=null;
@<Set the |ljoin_val| and |miterlim_val| fields in object |t|@>;
if ( mp->internal[mp_linecap]>unity ) lcap_val(t)=2;
else if ( mp->internal[mp_linecap]>0 ) lcap_val(t)=1;
@@ -9184,27 +9327,27 @@ except for the initialization of the scale factor |s|. The factor of 64 is
needed because |square_rt| scales its result by $2^8$ while we need $2^{14}$
to counteract the effect of |take_fraction|.
-@<Declare subroutines needed by |print_edges|@>=
+@ @c
scaled mp_sqrt_det (MP mp,scaled a, scaled b, scaled c, scaled d) {
scaled maxabs; /* $max(|a|,|b|,|c|,|d|)$ */
- integer s; /* amount by which the result of |square_rt| needs to be scaled */
+ unsigned s; /* amount by which the result of |square_rt| needs to be scaled */
@<Initialize |maxabs|@>;
s=64;
while ( (maxabs<fraction_one) && (s>1) ){
a+=a; b+=b; c+=c; d+=d;
- maxabs+=maxabs; s=halfp(s);
+ maxabs+=maxabs; s=(unsigned)(halfp(s));
}
- return s*mp_square_rt(mp, abs(mp_take_fraction(mp, a,d)-mp_take_fraction(mp, b,c)));
+ return (scaled)(s*mp_square_rt(mp, abs(mp_take_fraction(mp, a,d)-mp_take_fraction(mp, b,c))));
}
@#
-scaled mp_get_pen_scale (MP mp,pointer p) {
+static scaled mp_get_pen_scale (MP mp,pointer p) {
return mp_sqrt_det(mp,
- left_x(p)-x_coord(p), right_x(p)-x_coord(p),
- left_y(p)-y_coord(p), right_y(p)-y_coord(p));
+ mp_left_x(p)-mp_x_coord(p), mp_right_x(p)-mp_x_coord(p),
+ mp_left_y(p)-mp_y_coord(p), mp_right_y(p)-mp_y_coord(p));
}
-@ @<Internal library ...@>=
-scaled mp_sqrt_det (MP mp,scaled a, scaled b, scaled c, scaled d) ;
+@ @<Declarations@>=
+static scaled mp_sqrt_det (MP mp,scaled a, scaled b, scaled c, scaled d) ;
@ @<Initialize |maxabs|@>=
@@ -9216,7 +9359,7 @@ if ( abs(d)>maxabs ) maxabs=abs(d)
@ When a picture contains text, this is represented by a fourteen-word node
where the color information and |type| and |link| fields are augmented by
additional fields that describe the text and how it is transformed.
-The |path_p| and |pen_p| pointers are replaced by a number that identifies
+The |path_p| and |mp_pen_p| pointers are replaced by a number that identifies
the font and a string number that gives the text to be displayed.
The |width|, |height|, and |depth| fields
give the dimensions of the text at its design size, and the remaining six
@@ -9224,8 +9367,8 @@ words give a transformation to be applied to the text. The |new_text_node|
function initializes everything to default values so that the text comes out
black with its reference point at the origin.
-@d text_p(A) link((A)+1) /* a string pointer for the text to display */
-@d font_n(A) info((A)+1) /* the font number */
+@d mp_text_p(A) mp_link((A)+1) /* a string pointer for the text to display */
+@d mp_font_n(A) mp_info((A)+1) /* the font number */
@d width_val(A) mp->mem[(A)+7].sc /* unscaled width of the text */
@d height_val(A) mp->mem[(A)+9].sc /* unscaled height of the text */
@d depth_val(A) mp->mem[(A)+10].sc /* unscaled depth of the text */
@@ -9244,21 +9387,21 @@ black with its reference point at the origin.
@ @<Graphical object codes@>=
mp_text_code=3,
-@ @c @<Declare text measuring subroutines@>
-pointer mp_new_text_node (MP mp,char *f,str_number s) {
+@ @c
+static pointer mp_new_text_node (MP mp,char *f,str_number s) {
/* make a text node for font |f| and text string |s| */
pointer t; /* the new node */
t=mp_get_node(mp, text_node_size);
- type(t)=mp_text_code;
- text_p(t)=s;
- font_n(t)=mp_find_font(mp, f); /* this identifies the font */
+ mp_type(t)=mp_text_code;
+ mp_text_p(t)=s;
+ mp_font_n(t)=(halfword)mp_find_font(mp, f); /* this identifies the font */
red_val(t)=0;
green_val(t)=0;
blue_val(t)=0;
black_val(t)=0;
- color_model(t)=mp_uninitialized_model;
- pre_script(t)=null;
- post_script(t)=null;
+ mp_color_model(t)=mp_uninitialized_model;
+ mp_pre_script(t)=null;
+ mp_post_script(t)=null;
tx_val(t)=0; ty_val(t)=0;
txx_val(t)=unity; txy_val(t)=0;
tyx_val(t)=0; tyy_val(t)=unity;
@@ -9287,12 +9430,12 @@ give the size in words for each object type.
@#
@d stop_type(A) ((A)+2)
/* matching |type| for |start_clip_code| or |start_bounds_code| */
-@d has_color(A) (type((A))<mp_start_clip_code)
+@d has_color(A) (mp_type((A))<mp_start_clip_code)
/* does a graphical object have color fields? */
-@d has_pen(A) (type((A))<mp_text_code)
- /* does a graphical object have a |pen_p| field? */
-@d is_start_or_stop(A) (type((A))>=mp_start_clip_code)
-@d is_stop(A) (type((A))>=mp_stop_clip_code)
+@d has_pen(A) (mp_type((A))<mp_text_code)
+ /* does a graphical object have a |mp_pen_p| field? */
+@d is_start_or_stop(A) (mp_type((A))>=mp_start_clip_code)
+@d is_stop(A) (mp_type((A))>=mp_stop_clip_code)
@ @<Graphical object codes@>=
mp_start_clip_code=4, /* |type| of a node that starts clipping */
@@ -9301,19 +9444,19 @@ mp_stop_clip_code=6, /* |type| of a node that stops clipping */
mp_stop_bounds_code=7, /* |type| of a node that stops \&{setbounds} */
@ @c
-pointer mp_new_bounds_node (MP mp,pointer p, small_number c) {
+static pointer mp_new_bounds_node (MP mp,pointer p, quarterword c) {
/* make a node of type |c| where |p| is the clipping or \&{setbounds} path */
pointer t; /* the new node */
t=mp_get_node(mp, mp->gr_object_size[c]);
- type(t)=c;
- path_p(t)=p;
+ mp_type(t)=c;
+ mp_path_p(t)=p;
return t;
}
@ We need an array to keep track of the sizes of graphical objects.
@<Glob...@>=
-small_number gr_object_size[mp_stop_bounds_code+1];
+quarterword gr_object_size[mp_stop_bounds_code+1];
@ @<Set init...@>=
mp->gr_object_size[mp_fill_code]=fill_node_size;
@@ -9343,7 +9486,7 @@ with a pointer to the list of dash nodes.
@d start_x(A) mp->mem[(A)+1].sc /* the starting $x$~coordinate in a dash node */
@d stop_x(A) mp->mem[(A)+2].sc /* the ending $x$~coordinate in a dash node */
@d dash_node_size 3
-@d dash_list link
+@d dash_list mp_link
/* in an edge header this points to the first dash node */
@d dash_y(A) mp->mem[(A)+1].sc /* $y$ value for the dash list in an edge header */
@@ -9371,8 +9514,8 @@ field is needed to keep track of this.
@d miny_val(A) mp->mem[(A)+3].sc
@d maxx_val(A) mp->mem[(A)+4].sc
@d maxy_val(A) mp->mem[(A)+5].sc
-@d bblast(A) link((A)+6) /* last item considered in bounding box computation */
-@d bbtype(A) info((A)+6) /* tells how bounding box data depends on \&{truecorners} */
+@d bblast(A) mp_link((A)+6) /* last item considered in bounding box computation */
+@d bbtype(A) mp_info((A)+6) /* tells how bounding box data depends on \&{truecorners} */
@d dummy_loc(A) ((A)+7) /* where the object list begins in an edge header */
@d no_bounds 0
/* |bbtype| value when bounding box data is valid for all \&{truecorners} values */
@@ -9382,7 +9525,7 @@ field is needed to keep track of this.
/* |bbtype| value when bounding box data is for \&{truecorners}${}>0$ */
@c
-void mp_init_bbox (MP mp,pointer h) {
+static void mp_init_bbox (MP mp,pointer h) {
/* Initialize the bounding box information in edge structure |h| */
bblast(h)=dummy_loc(h);
bbtype(h)=no_bounds;
@@ -9395,15 +9538,15 @@ void mp_init_bbox (MP mp,pointer h) {
@ The only other entries in an edge header are a reference count in the first
word and a pointer to the tail of the object list in the last word.
-@d obj_tail(A) info((A)+7) /* points to the last entry in the object list */
+@d obj_tail(A) mp_info((A)+7) /* points to the last entry in the object list */
@d edge_header_size 8
@c
-void mp_init_edges (MP mp,pointer h) {
+static void mp_init_edges (MP mp,pointer h) {
/* initialize an edge header to null values */
dash_list(h)=null_dash;
obj_tail(h)=dummy_loc(h);
- link(dummy_loc(h))=null;
+ mp_link(dummy_loc(h))=null;
ref_count(h)=null;
mp_init_bbox(mp, h);
}
@@ -9420,18 +9563,18 @@ of the need to dereference edge structures that are used as dash patterns.
decr(ref_count(A));
}
-@<Declare the recycling subroutines@>=
-void mp_flush_dash_list (MP mp,pointer h);
-pointer mp_toss_gr_object (MP mp,pointer p) ;
-void mp_toss_edges (MP mp,pointer h) ;
+@<Declarations@>=
+static void mp_flush_dash_list (MP mp,pointer h);
+static pointer mp_toss_gr_object (MP mp,pointer p) ;
+static void mp_toss_edges (MP mp,pointer h) ;
@ @c void mp_toss_edges (MP mp,pointer h) {
pointer p,q; /* pointers that scan the list being recycled */
pointer r; /* an edge structure that object |p| refers to */
mp_flush_dash_list(mp, h);
- q=link(dummy_loc(h));
+ q=mp_link(dummy_loc(h));
while ( (q!=null) ) {
- p=q; q=link(q);
+ p=q; q=mp_link(q);
r=mp_toss_gr_object(mp, p);
if ( r!=null ) delete_edge_ref(r);
}
@@ -9441,7 +9584,7 @@ void mp_flush_dash_list (MP mp,pointer h) {
pointer p,q; /* pointers that scan the list being recycled */
q=dash_list(h);
while ( q!=null_dash ) {
- p=q; q=link(q);
+ p=q; q=mp_link(q);
mp_free_node(mp, p,dash_node_size);
}
dash_list(h)=null_dash;
@@ -9451,33 +9594,33 @@ pointer mp_toss_gr_object (MP mp,pointer p) {
pointer e; /* the edge structure to return */
e=null;
@<Prepare to recycle graphical object |p|@>;
- mp_free_node(mp, p,mp->gr_object_size[type(p)]);
+ mp_free_node(mp, p,mp->gr_object_size[mp_type(p)]);
return e;
}
@ @<Prepare to recycle graphical object |p|@>=
-switch (type(p)) {
+switch (mp_type(p)) {
case mp_fill_code:
- mp_toss_knot_list(mp, path_p(p));
- if ( pen_p(p)!=null ) mp_toss_knot_list(mp, pen_p(p));
- if ( pre_script(p)!=null ) delete_str_ref(pre_script(p));
- if ( post_script(p)!=null ) delete_str_ref(post_script(p));
+ mp_toss_knot_list(mp, mp_path_p(p));
+ if ( mp_pen_p(p)!=null ) mp_toss_knot_list(mp, mp_pen_p(p));
+ if ( mp_pre_script(p)!=null ) delete_str_ref(mp_pre_script(p));
+ if ( mp_post_script(p)!=null ) delete_str_ref(mp_post_script(p));
break;
case mp_stroked_code:
- mp_toss_knot_list(mp, path_p(p));
- if ( pen_p(p)!=null ) mp_toss_knot_list(mp, pen_p(p));
- if ( pre_script(p)!=null ) delete_str_ref(pre_script(p));
- if ( post_script(p)!=null ) delete_str_ref(post_script(p));
- e=dash_p(p);
+ mp_toss_knot_list(mp, mp_path_p(p));
+ if ( mp_pen_p(p)!=null ) mp_toss_knot_list(mp, mp_pen_p(p));
+ if ( mp_pre_script(p)!=null ) delete_str_ref(mp_pre_script(p));
+ if ( mp_post_script(p)!=null ) delete_str_ref(mp_post_script(p));
+ e=mp_dash_p(p);
break;
case mp_text_code:
- delete_str_ref(text_p(p));
- if ( pre_script(p)!=null ) delete_str_ref(pre_script(p));
- if ( post_script(p)!=null ) delete_str_ref(post_script(p));
+ delete_str_ref(mp_text_p(p));
+ if ( mp_pre_script(p)!=null ) delete_str_ref(mp_pre_script(p));
+ if ( mp_post_script(p)!=null ) delete_str_ref(mp_post_script(p));
break;
case mp_start_clip_code:
case mp_start_bounds_code:
- mp_toss_knot_list(mp, path_p(p));
+ mp_toss_knot_list(mp, mp_path_p(p));
break;
case mp_stop_clip_code:
case mp_stop_bounds_code:
@@ -9489,8 +9632,8 @@ to be done before making a significant change to an edge structure. Much of
the work is done in a separate routine |copy_objects| that copies a list of
graphical objects into a new edge header.
-@c @<Declare a function called |copy_objects|@>
-pointer mp_private_edges (MP mp,pointer h) {
+@c
+static pointer mp_private_edges (MP mp,pointer h) {
/* make a private copy of the edge structure headed by |h| */
pointer hh; /* the edge header for the new copy */
pointer p,pp; /* pointers for copying the dash list */
@@ -9498,7 +9641,7 @@ pointer mp_private_edges (MP mp,pointer h) {
return h;
} else {
decr(ref_count(h));
- hh=mp_copy_objects(mp, link(dummy_loc(h)),null);
+ hh=mp_copy_objects(mp, mp_link(dummy_loc(h)),null);
@<Copy the dash list from |h| to |hh|@>;
@<Copy the bounding box information from |h| to |hh| and make |bblast(hh)|
point into the new object list@>;
@@ -9506,36 +9649,36 @@ pointer mp_private_edges (MP mp,pointer h) {
}
}
-@ Here we use the fact that |dash_list(hh)=link(hh)|.
+@ Here we use the fact that |dash_list(hh)=mp_link(hh)|.
@^data structure assumptions@>
@<Copy the dash list from |h| to |hh|@>=
pp=hh; p=dash_list(h);
while ( (p!=null_dash) ) {
- link(pp)=mp_get_node(mp, dash_node_size);
- pp=link(pp);
+ mp_link(pp)=mp_get_node(mp, dash_node_size);
+ pp=mp_link(pp);
start_x(pp)=start_x(p);
stop_x(pp)=stop_x(p);
- p=link(p);
+ p=mp_link(p);
}
-link(pp)=null_dash;
+mp_link(pp)=null_dash;
dash_y(hh)=dash_y(h)
@ |h| is an edge structure
@c
-mp_dash_object *mp_export_dashes (MP mp, pointer q, scaled *w) {
+static mp_dash_object *mp_export_dashes (MP mp, pointer q, scaled *w) {
mp_dash_object *d;
pointer p, h;
scaled scf; /* scale factor */
- scaled *dashes = NULL;
+ int *dashes = NULL;
int num_dashes = 1;
- h = dash_p(q);
+ h = mp_dash_p(q);
if (h==null || dash_list(h)==null_dash)
return NULL;
p = dash_list(h);
- scf=mp_get_pen_scale(mp, pen_p(q));
+ scf=mp_get_pen_scale(mp, mp_pen_p(q));
if (scf==0) {
if (*w==0) scf = dash_scale(q); else return NULL;
} else {
@@ -9543,21 +9686,20 @@ mp_dash_object *mp_export_dashes (MP mp, pointer q, scaled *w) {
scf=mp_take_scaled(mp, scf,dash_scale(q));
}
*w = scf;
- d = mp_xmalloc(mp,1,sizeof(mp_dash_object));
+ d = xmalloc(1,sizeof(mp_dash_object));
start_x(null_dash)=start_x(p)+dash_y(h);
while (p != null_dash) {
- dashes = mp_xrealloc(mp, dashes, num_dashes+2, sizeof(scaled));
+ dashes = xrealloc(dashes, (num_dashes+2), sizeof(scaled));
dashes[(num_dashes-1)] =
mp_take_scaled(mp,(stop_x(p)-start_x(p)),scf);
dashes[(num_dashes)] =
- mp_take_scaled(mp,(start_x(link(p))-stop_x(p)),scf);
+ mp_take_scaled(mp,(start_x(mp_link(p))-stop_x(p)),scf);
dashes[(num_dashes+1)] = -1; /* terminus */
num_dashes+=2;
- p=link(p);
+ p=mp_link(p);
}
- d->array_field = dashes;
- d->offset_field =
- mp_take_scaled(mp,mp_dash_offset(mp, h),scf);
+ d->array = dashes;
+ d->offset = mp_take_scaled(mp,mp_dash_offset(mp, h),scf);
return d;
}
@@ -9573,7 +9715,7 @@ p=dummy_loc(h); pp=dummy_loc(hh);
while ((p!=bblast(h)) ) {
if ( p==null ) mp_confusion(mp, "bblast");
@:this can't happen bblast}{\quad bblast@>
- p=link(p); pp=link(pp);
+ p=mp_link(p); pp=mp_link(pp);
}
bblast(hh)=pp
@@ -9582,56 +9724,59 @@ structure. It starts copying at object~|p| and stops just before object~|q|.
If |q| is null, it copies the entire sublist headed at |p|. The resulting edge
structure requires further initialization by |init_bbox|.
-@<Declare a function called |copy_objects|@>=
+@<Declarations@>=
+static pointer mp_copy_objects (MP mp, pointer p, pointer q);
+
+@ @c
pointer mp_copy_objects (MP mp, pointer p, pointer q) {
pointer hh; /* the new edge header */
pointer pp; /* the last newly copied object */
- small_number k; /* temporary register */
+ quarterword k; /* temporary register */
hh=mp_get_node(mp, edge_header_size);
dash_list(hh)=null_dash;
ref_count(hh)=null;
pp=dummy_loc(hh);
while ( (p!=q) ) {
- @<Make |link(pp)| point to a copy of object |p|, and update |p| and |pp|@>;
+ @<Make |mp_link(pp)| point to a copy of object |p|, and update |p| and |pp|@>;
}
obj_tail(hh)=pp;
- link(pp)=null;
+ mp_link(pp)=null;
return hh;
}
-@ @<Make |link(pp)| point to a copy of object |p|, and update |p| and |pp|@>=
-{ k=mp->gr_object_size[type(p)];
- link(pp)=mp_get_node(mp, k);
- pp=link(pp);
+@ @<Make |mp_link(pp)| point to a copy of object |p|, and update |p| and |pp|@>=
+{ k=mp->gr_object_size[mp_type(p)];
+ mp_link(pp)=mp_get_node(mp, k);
+ pp=mp_link(pp);
while ( (k>0) ) { decr(k); mp->mem[pp+k]=mp->mem[p+k]; };
@<Fix anything in graphical object |pp| that should differ from the
corresponding field in |p|@>;
- p=link(p);
+ p=mp_link(p);
}
@ @<Fix anything in graphical object |pp| that should differ from the...@>=
-switch (type(p)) {
+switch (mp_type(p)) {
case mp_start_clip_code:
case mp_start_bounds_code:
- path_p(pp)=mp_copy_path(mp, path_p(p));
+ mp_path_p(pp)=mp_copy_path(mp, mp_path_p(p));
break;
case mp_fill_code:
- path_p(pp)=mp_copy_path(mp, path_p(p));
- if ( pre_script(p)!=null ) add_str_ref(pre_script(p));
- if ( post_script(p)!=null ) add_str_ref(post_script(p));
- if ( pen_p(p)!=null ) pen_p(pp)=copy_pen(pen_p(p));
+ mp_path_p(pp)=mp_copy_path(mp, mp_path_p(p));
+ if ( mp_pre_script(p)!=null ) add_str_ref(mp_pre_script(p));
+ if ( mp_post_script(p)!=null ) add_str_ref(mp_post_script(p));
+ if ( mp_pen_p(p)!=null ) mp_pen_p(pp)=copy_pen(mp_pen_p(p));
break;
case mp_stroked_code:
- if ( pre_script(p)!=null ) add_str_ref(pre_script(p));
- if ( post_script(p)!=null ) add_str_ref(post_script(p));
- path_p(pp)=mp_copy_path(mp, path_p(p));
- pen_p(pp)=copy_pen(pen_p(p));
- if ( dash_p(p)!=null ) add_edge_ref(dash_p(pp));
+ if ( mp_pre_script(p)!=null ) add_str_ref(mp_pre_script(p));
+ if ( mp_post_script(p)!=null ) add_str_ref(mp_post_script(p));
+ mp_path_p(pp)=mp_copy_path(mp, mp_path_p(p));
+ mp_pen_p(pp)=copy_pen(mp_pen_p(p));
+ if ( mp_dash_p(p)!=null ) add_edge_ref(mp_dash_p(pp));
break;
case mp_text_code:
- if ( pre_script(p)!=null ) add_str_ref(pre_script(p));
- if ( post_script(p)!=null ) add_str_ref(post_script(p));
- add_str_ref(text_p(pp));
+ if ( mp_pre_script(p)!=null ) add_str_ref(mp_pre_script(p));
+ if ( mp_post_script(p)!=null ) add_str_ref(mp_post_script(p));
+ add_str_ref(mp_text_p(pp));
break;
case mp_stop_clip_code:
case mp_stop_bounds_code:
@@ -9648,27 +9793,29 @@ unless |p| points to a stop bounds or stop clip node, in which case it executes
|e| instead.
@d skip_component(A)
- if ( ! is_start_or_stop((A)) ) (A)=link((A));
+ if ( ! is_start_or_stop((A)) ) (A)=mp_link((A));
else if ( ! is_stop((A)) ) (A)=mp_skip_1component(mp, (A));
else
@c
-pointer mp_skip_1component (MP mp,pointer p) {
+static pointer mp_skip_1component (MP mp,pointer p) {
integer lev; /* current nesting level */
lev=0;
do {
if ( is_start_or_stop(p) ) {
if ( is_stop(p) ) decr(lev); else incr(lev);
}
- p=link(p);
+ p=mp_link(p);
} while (lev!=0);
return p;
}
@ Here is a diagnostic routine for printing an edge structure in symbolic form.
-@<Declare subroutines for printing expressions@>=
-@<Declare subroutines needed by |print_edges|@>
+@<Declarations@>=
+static void mp_print_edges (MP mp,pointer h, const char *s, boolean nuline) ;
+
+@ @c
void mp_print_edges (MP mp,pointer h, const char *s, boolean nuline) {
pointer p; /* a graphical object to be printed */
pointer hh,pp; /* temporary pointers */
@@ -9676,10 +9823,10 @@ void mp_print_edges (MP mp,pointer h, const char *s, boolean nuline) {
boolean ok_to_dash; /* |false| for polygonal pen strokes */
mp_print_diagnostic(mp, "Edge structure",s,nuline);
p=dummy_loc(h);
- while ( link(p)!=null ) {
- p=link(p);
+ while ( mp_link(p)!=null ) {
+ p=mp_link(p);
mp_print_ln(mp);
- switch (type(p)) {
+ switch (mp_type(p)) {
@<Cases for printing graphical object node |p|@>;
default:
mp_print(mp, "[unknown object type!]");
@@ -9696,12 +9843,12 @@ void mp_print_edges (MP mp,pointer h, const char *s, boolean nuline) {
case mp_fill_code:
mp_print(mp, "Filled contour ");
mp_print_obj_color(mp, p);
- mp_print_char(mp, ':'); mp_print_ln(mp);
- mp_pr_path(mp, path_p(p)); mp_print_ln(mp);
- if ( (pen_p(p)!=null) ) {
+ mp_print_char(mp, xord(':')); mp_print_ln(mp);
+ mp_pr_path(mp, mp_path_p(p)); mp_print_ln(mp);
+ if ( (mp_pen_p(p)!=null) ) {
@<Print join type for graphical object |p|@>;
mp_print(mp, " with pen"); mp_print_ln(mp);
- mp_pr_pen(mp, pen_p(p));
+ mp_pr_pen(mp, mp_pen_p(p));
}
break;
@@ -9739,21 +9886,23 @@ mp_print(mp, " ends, ");
@ Here is a routine that prints the color of a graphical object if it isn't
black (the default color).
-@<Declare subroutines needed by |print_edges|@>=
-@<Declare a procedure called |print_compact_node|@>
+@<Declarations@>=
+static void mp_print_obj_color (MP mp,pointer p) ;
+
+@ @c
void mp_print_obj_color (MP mp,pointer p) {
- if ( color_model(p)==mp_grey_model ) {
+ if ( mp_color_model(p)==mp_grey_model ) {
if ( grey_val(p)>0 ) {
mp_print(mp, "greyed ");
mp_print_compact_node(mp, obj_grey_loc(p),1);
};
- } else if ( color_model(p)==mp_cmyk_model ) {
+ } else if ( mp_color_model(p)==mp_cmyk_model ) {
if ( (cyan_val(p)>0) || (magenta_val(p)>0) ||
(yellow_val(p)>0) || (black_val(p)>0) ) {
mp_print(mp, "processcolored ");
mp_print_compact_node(mp, obj_cyan_loc(p),4);
};
- } else if ( color_model(p)==mp_rgb_model ) {
+ } else if ( mp_color_model(p)==mp_rgb_model ) {
if ( (red_val(p)>0) || (green_val(p)>0) || (blue_val(p)>0) ) {
mp_print(mp, "colored ");
mp_print_compact_node(mp, obj_red_loc(p),3);
@@ -9764,47 +9913,50 @@ void mp_print_obj_color (MP mp,pointer p) {
@ We also need a procedure for printing consecutive scaled values as if they
were a known big node.
-@<Declare a procedure called |print_compact_node|@>=
-void mp_print_compact_node (MP mp,pointer p, small_number k) {
+@<Declarations@>=
+static void mp_print_compact_node (MP mp,pointer p, quarterword k) ;
+
+@ @c
+void mp_print_compact_node (MP mp,pointer p, quarterword k) {
pointer q; /* last location to print */
q=p+k-1;
- mp_print_char(mp, '(');
+ mp_print_char(mp, xord('('));
while ( p<=q ){
mp_print_scaled(mp, mp->mem[p].sc);
- if ( p<q ) mp_print_char(mp, ',');
+ if ( p<q ) mp_print_char(mp, xord(','));
incr(p);
}
- mp_print_char(mp, ')');
+ mp_print_char(mp, xord(')'));
}
@ @<Cases for printing graphical object node |p|@>=
case mp_stroked_code:
mp_print(mp, "Filled pen stroke ");
mp_print_obj_color(mp, p);
- mp_print_char(mp, ':'); mp_print_ln(mp);
- mp_pr_path(mp, path_p(p));
- if ( dash_p(p)!=null ) {
+ mp_print_char(mp, xord(':')); mp_print_ln(mp);
+ mp_pr_path(mp, mp_path_p(p));
+ if ( mp_dash_p(p)!=null ) {
mp_print_nl(mp, "dashed (");
@<Finish printing the dash pattern that |p| refers to@>;
}
mp_print_ln(mp);
@<Print join and cap types for stroked node |p|@>;
mp_print(mp, " with pen"); mp_print_ln(mp);
- if ( pen_p(p)==null ) mp_print(mp, "???"); /* shouldn't happen */
+ if ( mp_pen_p(p)==null ) mp_print(mp, "???"); /* shouldn't happen */
@.???@>
- else mp_pr_pen(mp, pen_p(p));
+ else mp_pr_pen(mp, mp_pen_p(p));
break;
@ Normally, the |dash_list| field in an edge header is set to |null_dash|
when it is not known to define a suitable dash pattern. This is disallowed
-here because the |dash_p| field should never point to such an edge header.
+here because the |mp_dash_p| field should never point to such an edge header.
Note that memory is allocated for |start_x(null_dash)| and we are free to
give it any convenient value.
@<Finish printing the dash pattern that |p| refers to@>=
-ok_to_dash=pen_is_elliptical(pen_p(p));
+ok_to_dash=pen_is_elliptical(mp_pen_p(p));
if ( ! ok_to_dash ) scf=unity; else scf=dash_scale(p);
-hh=dash_p(p);
+hh=mp_dash_p(p);
pp=dash_list(hh);
if ( (pp==null_dash) || (dash_y(hh)<0) ) {
mp_print(mp, " ??");
@@ -9813,16 +9965,19 @@ if ( (pp==null_dash) || (dash_y(hh)<0) ) {
mp_print(mp, "on ");
mp_print_scaled(mp, mp_take_scaled(mp, stop_x(pp)-start_x(pp),scf));
mp_print(mp, " off ");
- mp_print_scaled(mp, mp_take_scaled(mp, start_x(link(pp))-stop_x(pp),scf));
- pp = link(pp);
- if ( pp!=null_dash ) mp_print_char(mp, ' ');
+ mp_print_scaled(mp, mp_take_scaled(mp, start_x(mp_link(pp))-stop_x(pp),scf));
+ pp = mp_link(pp);
+ if ( pp!=null_dash ) mp_print_char(mp, xord(' '));
}
mp_print(mp, ") shifted ");
mp_print_scaled(mp, -mp_take_scaled(mp, mp_dash_offset(mp, hh),scf));
if ( ! ok_to_dash || (dash_y(hh)==0) ) mp_print(mp, " (this will be ignored)");
}
-@ @<Declare subroutines needed by |print_edges|@>=
+@ @<Declarations@>=
+static scaled mp_dash_offset (MP mp,pointer h) ;
+
+@ @c
scaled mp_dash_offset (MP mp,pointer h) {
scaled x; /* the answer */
if (dash_list(h)==null_dash || dash_y(h)<0) mp_confusion(mp, "dash0");
@@ -9838,9 +9993,9 @@ scaled mp_dash_offset (MP mp,pointer h) {
@ @<Cases for printing graphical object node |p|@>=
case mp_text_code:
- mp_print_char(mp, '"'); mp_print_str(mp,text_p(p));
- mp_print(mp, "\" infont \""); mp_print(mp, mp->font_name[font_n(p)]);
- mp_print_char(mp, '"'); mp_print_ln(mp);
+ mp_print_char(mp, xord('"')); mp_print_str(mp,mp_text_p(p));
+ mp_print(mp, "\" infont \""); mp_print(mp, mp->font_name[mp_font_n(p)]);
+ mp_print_char(mp, xord('"')); mp_print_ln(mp);
mp_print_obj_color(mp, p);
mp_print(mp, "transformed ");
mp_print_compact_node(mp, text_tx_loc(p),6);
@@ -9850,7 +10005,7 @@ case mp_text_code:
case mp_start_clip_code:
mp_print(mp, "clipping path:");
mp_print_ln(mp);
- mp_pr_path(mp, path_p(p));
+ mp_pr_path(mp, mp_path_p(p));
break;
case mp_stop_clip_code:
mp_print(mp, "stop clipping");
@@ -9860,7 +10015,7 @@ case mp_stop_clip_code:
case mp_start_bounds_code:
mp_print(mp, "setbounds path:");
mp_print_ln(mp);
- mp_pr_path(mp, path_p(p));
+ mp_pr_path(mp, mp_path_p(p));
break;
case mp_stop_bounds_code:
mp_print(mp, "end of setbounds");
@@ -9876,11 +10031,11 @@ be no retracing. If the resulting paths cover a range of $x$~coordinates of
length $\Delta x$, we set |dash_y(h)| to the length of the dash pattern by
finding the maximum of $\Delta x$ and the absolute value of~$y_0$.
-@c @<Declare a procedure called |x_retrace_error|@>
-pointer mp_make_dashes (MP mp,pointer h) { /* returns |h| or |null| */
+@c
+static pointer mp_make_dashes (MP mp,pointer h) { /* returns |h| or |null| */
pointer p; /* this scans the stroked nodes in the object list */
pointer p0; /* if not |null| this points to the first stroked node */
- pointer pp,qq,rr; /* pointers into |path_p(p)| */
+ pointer pp,qq,rr; /* pointers into |mp_path_p(p)| */
pointer d,dd; /* pointers used to create the dash list */
scaled y0;
@<Other local variables in |make_dashes|@>;
@@ -9888,18 +10043,18 @@ pointer mp_make_dashes (MP mp,pointer h) { /* returns |h| or |null| */
if ( dash_list(h)!=null_dash )
return h;
p0=null;
- p=link(dummy_loc(h));
+ p=mp_link(dummy_loc(h));
while ( p!=null ) {
- if ( type(p)!=mp_stroked_code ) {
+ if ( mp_type(p)!=mp_stroked_code ) {
@<Compain that the edge structure contains a node of the wrong type
and |goto not_found|@>;
}
- pp=path_p(p);
- if ( p0==null ){ p0=p; y0=y_coord(pp); };
+ pp=mp_path_p(p);
+ if ( p0==null ){ p0=p; y0=mp_y_coord(pp); };
@<Make |d| point to a new dash node created from stroke |p| and path |pp|
or |goto not_found| if there is an error@>;
@<Insert |d| into the dash list and |goto not_found| if there is an error@>;
- p=link(p);
+ p=mp_link(p);
}
if ( dash_list(h)==null_dash )
goto NOT_FOUND; /* No error message */
@@ -9913,56 +10068,59 @@ NOT_FOUND:
@ @<Compain that the edge structure contains a node of the wrong type...@>=
{
print_err("Picture is too complicated to use as a dash pattern");
-help3("When you say `dashed p', picture p should not contain any")
- ("text, filled regions, or clipping paths. This time it did")
- ("so I'll just make it a solid line instead.");
+help3("When you say `dashed p', picture p should not contain any",
+ "text, filled regions, or clipping paths. This time it did",
+ "so I'll just make it a solid line instead.");
mp_put_get_error(mp);
goto NOT_FOUND;
}
@ A similar error occurs when monotonicity fails.
-@<Declare a procedure called |x_retrace_error|@>=
+@<Declarations@>=
+static void mp_x_retrace_error (MP mp) ;
+
+@ @c
void mp_x_retrace_error (MP mp) {
print_err("Picture is too complicated to use as a dash pattern");
-help3("When you say `dashed p', every path in p should be monotone")
- ("in x and there must be no overlapping. This failed")
- ("so I'll just make it a solid line instead.");
+help3("When you say `dashed p', every path in p should be monotone",
+ "in x and there must be no overlapping. This failed",
+ "so I'll just make it a solid line instead.");
mp_put_get_error(mp);
}
-@ We stash |p| in |info(d)| if |dash_p(p)<>0| so that subsequent processing can
+@ We stash |p| in |mp_info(d)| if |mp_dash_p(p)<>0| so that subsequent processing can
handle the case where the pen stroke |p| is itself dashed.
@<Make |d| point to a new dash node created from stroke |p| and path...@>=
@<Make sure |p| and |p0| are the same color and |goto not_found| if there is
an error@>;
rr=pp;
-if ( link(pp)!=pp ) {
+if ( mp_link(pp)!=pp ) {
do {
- qq=rr; rr=link(rr);
+ qq=rr; rr=mp_link(rr);
@<Check for retracing between knots |qq| and |rr| and |goto not_found|
if there is a problem@>;
- } while (right_type(rr)!=mp_endpoint);
+ } while (mp_right_type(rr)!=mp_endpoint);
}
d=mp_get_node(mp, dash_node_size);
-if ( dash_p(p)==0 ) info(d)=0; else info(d)=p;
-if ( x_coord(pp)<x_coord(rr) ) {
- start_x(d)=x_coord(pp);
- stop_x(d)=x_coord(rr);
+if ( mp_dash_p(p)==0 ) mp_info(d)=0; else mp_info(d)=p;
+if ( mp_x_coord(pp)<mp_x_coord(rr) ) {
+ start_x(d)=mp_x_coord(pp);
+ stop_x(d)=mp_x_coord(rr);
} else {
- start_x(d)=x_coord(rr);
- stop_x(d)=x_coord(pp);
+ start_x(d)=mp_x_coord(rr);
+ stop_x(d)=mp_x_coord(pp);
}
@ We also need to check for the case where the segment from |qq| to |rr| is
monotone in $x$ but is reversed relative to the path from |pp| to |qq|.
@<Check for retracing between knots |qq| and |rr| and |goto not_found|...@>=
-x0=x_coord(qq);
-x1=right_x(qq);
-x2=left_x(rr);
-x3=x_coord(rr);
+x0=mp_x_coord(qq);
+x1=mp_right_x(qq);
+x2=mp_left_x(rr);
+x3=mp_x_coord(rr);
if ( (x0>x1) || (x1>x2) || (x2>x3) ) {
if ( (x0<x1) || (x1<x2) || (x2<x3) ) {
if ( mp_ab_vs_cd(mp, x2-x1,x2-x1,x1-x0,x3-x2)>0 ) {
@@ -9970,8 +10128,8 @@ if ( (x0>x1) || (x1>x2) || (x2>x3) ) {
}
}
}
-if ( (x_coord(pp)>x0) || (x0>x3) ) {
- if ( (x_coord(pp)<x0) || (x0<x3) ) {
+if ( (mp_x_coord(pp)>x0) || (x0>x3) ) {
+ if ( (mp_x_coord(pp)<x0) || (x0<x3) ) {
mp_x_retrace_error(mp); goto NOT_FOUND;
}
}
@@ -9983,35 +10141,35 @@ if ( (x_coord(pp)>x0) || (x0>x3) ) {
if ( (red_val(p)!=red_val(p0)) || (black_val(p)!=black_val(p0)) ||
(green_val(p)!=green_val(p0)) || (blue_val(p)!=blue_val(p0)) ) {
print_err("Picture is too complicated to use as a dash pattern");
- help3("When you say `dashed p', everything in picture p should")
- ("be the same color. I can\'t handle your color changes")
- ("so I'll just make it a solid line instead.");
+ help3("When you say `dashed p', everything in picture p should",
+ "be the same color. I can\'t handle your color changes",
+ "so I'll just make it a solid line instead.");
mp_put_get_error(mp);
goto NOT_FOUND;
}
@ @<Insert |d| into the dash list and |goto not_found| if there is an error@>=
start_x(null_dash)=stop_x(d);
-dd=h; /* this makes |link(dd)=dash_list(h)| */
-while ( start_x(link(dd))<stop_x(d) )
- dd=link(dd);
+dd=h; /* this makes |mp_link(dd)=dash_list(h)| */
+while ( start_x(mp_link(dd))<stop_x(d) )
+ dd=mp_link(dd);
if ( dd!=h ) {
if ( (stop_x(dd)>start_x(d)) )
{ mp_x_retrace_error(mp); goto NOT_FOUND; };
}
-link(d)=link(dd);
-link(dd)=d
+mp_link(d)=mp_link(dd);
+mp_link(dd)=d
@ @<Set |dash_y(h)| and merge the first and last dashes if necessary@>=
d=dash_list(h);
-while ( (link(d)!=null_dash) )
- d=link(d);
+while ( (mp_link(d)!=null_dash) )
+ d=mp_link(d);
dd=dash_list(h);
dash_y(h)=stop_x(d)-start_x(dd);
if ( abs(y0)>dash_y(h) ) {
dash_y(h)=abs(y0);
} else if ( d!=dd ) {
- dash_list(h)=link(dd);
+ dash_list(h)=mp_link(dd);
stop_x(d)=stop_x(dd)+dash_y(h);
mp_free_node(mp, dd,dash_node_size);
}
@@ -10031,36 +10189,36 @@ corresponding dash nodes, we must be prepared to break up these dashes into
smaller dashes.
@<Scan |dash_list(h)| and deal with any dashes that are themselves dashed@>=
-d=h; /* now |link(d)=dash_list(h)| */
-while ( link(d)!=null_dash ) {
- ds=info(link(d));
+d=h; /* now |mp_link(d)=dash_list(h)| */
+while ( mp_link(d)!=null_dash ) {
+ ds=mp_info(mp_link(d));
if ( ds==null ) {
- d=link(d);
+ d=mp_link(d);
} else {
- hh=dash_p(ds);
+ hh=mp_dash_p(ds);
hsf=dash_scale(ds);
if ( (hh==null) ) mp_confusion(mp, "dash1");
@:this can't happen dash0}{\quad dash1@>
if ( dash_y(hh)==0 ) {
- d=link(d);
+ d=mp_link(d);
} else {
if ( dash_list(hh)==null ) mp_confusion(mp, "dash1");
@:this can't happen dash0}{\quad dash1@>
- @<Replace |link(d)| by a dashed version as determined by edge header
+ @<Replace |mp_link(d)| by a dashed version as determined by edge header
|hh| and scale factor |ds|@>;
}
}
}
@ @<Other local variables in |make_dashes|@>=
-pointer dln; /* |link(d)| */
+pointer dln; /* |mp_link(d)| */
pointer hh; /* an edge header that tells how to break up |dln| */
scaled hsf; /* the dash pattern from |hh| gets scaled by this */
pointer ds; /* the stroked node from which |hh| and |hsf| are derived */
scaled xoff; /* added to $x$ values in |dash_list(hh)| to match |dln| */
-@ @<Replace |link(d)| by a dashed version as determined by edge header...@>=
-dln=link(d);
+@ @<Replace |mp_link(d)| by a dashed version as determined by edge header...@>=
+dln=mp_link(d);
dd=dash_list(hh);
xoff=start_x(dln)-mp_take_scaled(mp, hsf,start_x(dd))-
mp_take_scaled(mp, hsf,mp_dash_offset(mp, hh));
@@ -10073,10 +10231,10 @@ while ( start_x(dln)<=stop_x(dln) ) {
@<If |dd| has `fallen off the end', back up to the beginning and fix |xoff|@>;
@<Insert a dash between |d| and |dln| for the overlap with the offset version
of |dd|@>;
- dd=link(dd);
+ dd=mp_link(dd);
start_x(dln)=xoff+mp_take_scaled(mp, hsf,start_x(dd));
}
-link(d)=link(dln);
+mp_link(d)=mp_link(dln);
mp_free_node(mp, dln,dash_node_size)
@ The name of this module is a bit of a lie because we just find the
@@ -10086,7 +10244,7 @@ in the gap between |dd| and its predecessor.
@<Advance |dd| until finding the first dash that overlaps |dln| when...@>=
while ( xoff+mp_take_scaled(mp, hsf,stop_x(dd))<start_x(dln) ) {
- dd=link(dd);
+ dd=mp_link(dd);
}
@ @<If |dd| has `fallen off the end', back up to the beginning and fix...@>=
@@ -10100,9 +10258,9 @@ if ( dd==null_dash ) {
@<Insert a dash between |d| and |dln| for the overlap with the offset...@>=
if ( (xoff+mp_take_scaled(mp, hsf,start_x(dd)))<=stop_x(dln) ) {
- link(d)=mp_get_node(mp, dash_node_size);
- d=link(d);
- link(d)=dln;
+ mp_link(d)=mp_get_node(mp, dash_node_size);
+ d=mp_link(d);
+ mp_link(d)=dln;
if ( start_x(dln)>(xoff+mp_take_scaled(mp, hsf,start_x(dd))))
start_x(d)=start_x(dln);
else
@@ -10119,26 +10277,26 @@ header's bounding box to accommodate the box computed by |path_bbox| or
|pen_bbox|. (This is stored in global variables |minx|, |miny|, |maxx|, and
|maxy|.)
-@c void mp_adjust_bbox (MP mp,pointer h) {
- if ( minx<minx_val(h) ) minx_val(h)=minx;
- if ( miny<miny_val(h) ) miny_val(h)=miny;
- if ( maxx>maxx_val(h) ) maxx_val(h)=maxx;
- if ( maxy>maxy_val(h) ) maxy_val(h)=maxy;
+@c static void mp_adjust_bbox (MP mp,pointer h) {
+ if ( mp_minx<minx_val(h) ) minx_val(h)=mp_minx;
+ if ( mp_miny<miny_val(h) ) miny_val(h)=mp_miny;
+ if ( mp_maxx>maxx_val(h) ) maxx_val(h)=mp_maxx;
+ if ( mp_maxy>maxy_val(h) ) maxy_val(h)=mp_maxy;
}
@ Here is a special routine for updating the bounding box information in
edge header~|h| to account for the squared-off ends of a non-cyclic path~|p|
that is to be stroked with the pen~|pp|.
-@c void mp_box_ends (MP mp, pointer p, pointer pp, pointer h) {
+@c static void mp_box_ends (MP mp, pointer p, pointer pp, pointer h) {
pointer q; /* a knot node adjacent to knot |p| */
fraction dx,dy; /* a unit vector in the direction out of the path at~|p| */
scaled d; /* a factor for adjusting the length of |(dx,dy)| */
scaled z; /* a coordinate being tested against the bounding box */
scaled xx,yy; /* the extreme pen vertex in the |(dx,dy)| direction */
integer i; /* a loop counter */
- if ( right_type(p)!=mp_endpoint ) {
- q=link(p);
+ if ( mp_right_type(p)!=mp_endpoint ) {
+ q=mp_link(p);
while (1) {
@<Make |(dx,dy)| the final direction for the path segment from
|q| to~|p|; set~|d|@>;
@@ -10151,7 +10309,7 @@ that is to be stroked with the pen~|pp|.
dx=-dx; dy=-dy;
}
}
- if ( right_type(p)==mp_endpoint ) {
+ if ( mp_right_type(p)==mp_endpoint ) {
return;
} else {
@<Advance |p| to the end of the path and make |q| the previous knot@>;
@@ -10161,23 +10319,23 @@ that is to be stroked with the pen~|pp|.
}
@ @<Make |(dx,dy)| the final direction for the path segment from...@>=
-if ( q==link(p) ) {
- dx=x_coord(p)-right_x(p);
- dy=y_coord(p)-right_y(p);
+if ( q==mp_link(p) ) {
+ dx=mp_x_coord(p)-mp_right_x(p);
+ dy=mp_y_coord(p)-mp_right_y(p);
if ( (dx==0)&&(dy==0) ) {
- dx=x_coord(p)-left_x(q);
- dy=y_coord(p)-left_y(q);
+ dx=mp_x_coord(p)-mp_left_x(q);
+ dy=mp_y_coord(p)-mp_left_y(q);
}
} else {
- dx=x_coord(p)-left_x(p);
- dy=y_coord(p)-left_y(p);
+ dx=mp_x_coord(p)-mp_left_x(p);
+ dy=mp_y_coord(p)-mp_left_y(p);
if ( (dx==0)&&(dy==0) ) {
- dx=x_coord(p)-right_x(q);
- dy=y_coord(p)-right_y(q);
+ dx=mp_x_coord(p)-mp_right_x(q);
+ dy=mp_y_coord(p)-mp_right_y(q);
}
}
-dx=x_coord(p)-x_coord(q);
-dy=y_coord(p)-y_coord(q)
+dx=mp_x_coord(p)-mp_x_coord(q);
+dy=mp_y_coord(p)-mp_y_coord(q)
@ @<Normalize the direction |(dx,dy)| and find the pen offset |(xx,yy)|@>=
dx=mp_make_fraction(mp, dx,d);
@@ -10191,18 +10349,18 @@ d=mp_take_fraction(mp, xx-mp->cur_x,dx)+mp_take_fraction(mp, yy-mp->cur_y,dy);
if ( ((d<0)&&(i==1)) || ((d>0)&&(i==2)))
mp_confusion(mp, "box_ends");
@:this can't happen box ends}{\quad\\{box\_ends}@>
-z=x_coord(p)+mp->cur_x+mp_take_fraction(mp, d,dx);
+z=mp_x_coord(p)+mp->cur_x+mp_take_fraction(mp, d,dx);
if ( z<minx_val(h) ) minx_val(h)=z;
if ( z>maxx_val(h) ) maxx_val(h)=z;
-z=y_coord(p)+mp->cur_y+mp_take_fraction(mp, d,dy);
+z=mp_y_coord(p)+mp->cur_y+mp_take_fraction(mp, d,dy);
if ( z<miny_val(h) ) miny_val(h)=z;
if ( z>maxy_val(h) ) maxy_val(h)=z
@ @<Advance |p| to the end of the path and make |q| the previous knot@>=
do {
q=p;
- p=link(p);
-} while (right_type(p)!=mp_endpoint)
+ p=mp_link(p);
+} while (mp_right_type(p)!=mp_endpoint)
@ The major difficulty in finding the bounding box of an edge structure is the
effect of clipping paths. We treat them conservatively by only clipping to the
@@ -10212,7 +10370,8 @@ requires recursive calls to |set_bbox| in order to find the bounding box of
the objects to be clipped. Such calls are distinguished by the fact that the
boolean parameter |top_level| is false.
-@c void mp_set_bbox (MP mp,pointer h, boolean top_level) {
+@c
+void mp_set_bbox (MP mp,pointer h, boolean top_level) {
pointer p; /* a graphical object being considered */
scaled sminx,sminy,smaxx,smaxy;
/* for saving the bounding box during recursive calls */
@@ -10220,10 +10379,10 @@ boolean parameter |top_level| is false.
integer lev; /* nesting level for |mp_start_bounds_code| nodes */
@<Wipe out any existing bounding box information if |bbtype(h)| is
incompatible with |internal[mp_true_corners]|@>;
- while ( link(bblast(h))!=null ) {
- p=link(bblast(h));
+ while ( mp_link(bblast(h))!=null ) {
+ p=mp_link(bblast(h));
bblast(h)=p;
- switch (type(p)) {
+ switch (mp_type(p)) {
case mp_stop_clip_code:
if ( top_level ) mp_confusion(mp, "bbox"); else return;
@:this can't happen bbox}{\quad bbox@>
@@ -10234,8 +10393,8 @@ boolean parameter |top_level| is false.
if ( ! top_level ) mp_confusion(mp, "bbox");
}
-@ @<Internal library declarations@>=
-void mp_set_bbox (MP mp,pointer h, boolean top_level);
+@ @<Declarations@>=
+static void mp_set_bbox (MP mp,pointer h, boolean top_level);
@ @<Wipe out any existing bounding box information if |bbtype(h)| is...@>=
switch (bbtype(h)) {
@@ -10251,15 +10410,15 @@ case bounds_unset:
@ @<Other cases for updating the bounding box...@>=
case mp_fill_code:
- mp_path_bbox(mp, path_p(p));
- if ( pen_p(p)!=null ) {
- x0=minx; y0=miny;
- x1=maxx; y1=maxy;
- mp_pen_bbox(mp, pen_p(p));
- minx=minx+x0;
- miny=miny+y0;
- maxx=maxx+x1;
- maxy=maxy+y1;
+ mp_path_bbox(mp, mp_path_p(p));
+ if ( mp_pen_p(p)!=null ) {
+ x0=mp_minx; y0=mp_miny;
+ x1=mp_maxx; y1=mp_maxy;
+ mp_pen_bbox(mp, mp_pen_p(p));
+ mp_minx=mp_minx+x0;
+ mp_miny=mp_miny+y0;
+ mp_maxx=mp_maxx+x1;
+ mp_maxy=mp_maxy+y1;
}
mp_adjust_bbox(mp, h);
break;
@@ -10270,7 +10429,7 @@ case mp_start_bounds_code:
bbtype(h)=bounds_unset;
} else {
bbtype(h)=bounds_set;
- mp_path_bbox(mp, path_p(p));
+ mp_path_bbox(mp, mp_path_p(p));
mp_adjust_bbox(mp, h);
@<Scan to the matching |mp_stop_bounds_code| node and update |p| and
|bblast(h)|@>;
@@ -10284,11 +10443,11 @@ case mp_stop_bounds_code:
@ @<Scan to the matching |mp_stop_bounds_code| node and update |p| and...@>=
lev=1;
while ( lev!=0 ) {
- if ( link(p)==null ) mp_confusion(mp, "bbox2");
+ if ( mp_link(p)==null ) mp_confusion(mp, "bbox2");
@:this can't happen bbox2}{\quad bbox2@>
- p=link(p);
- if ( type(p)==mp_start_bounds_code ) incr(lev);
- else if ( type(p)==mp_stop_bounds_code ) decr(lev);
+ p=mp_link(p);
+ if ( mp_type(p)==mp_start_bounds_code ) incr(lev);
+ else if ( mp_type(p)==mp_stop_bounds_code ) decr(lev);
}
bblast(h)=p
@@ -10299,17 +10458,17 @@ when using butt end caps. The basic computation is for round end caps and
@<Other cases for updating the bounding box...@>=
case mp_stroked_code:
- mp_path_bbox(mp, path_p(p));
- x0=minx; y0=miny;
- x1=maxx; y1=maxy;
- mp_pen_bbox(mp, pen_p(p));
- minx=minx+x0;
- miny=miny+y0;
- maxx=maxx+x1;
- maxy=maxy+y1;
+ mp_path_bbox(mp, mp_path_p(p));
+ x0=mp_minx; y0=mp_miny;
+ x1=mp_maxx; y1=mp_maxy;
+ mp_pen_bbox(mp, mp_pen_p(p));
+ mp_minx=mp_minx+x0;
+ mp_miny=mp_miny+y0;
+ mp_maxx=mp_maxx+x1;
+ mp_maxy=mp_maxy+y1;
mp_adjust_bbox(mp, h);
- if ( (left_type(path_p(p))==mp_endpoint)&&(lcap_val(p)==2) )
- mp_box_ends(mp, path_p(p), pen_p(p), h);
+ if ( (mp_left_type(mp_path_p(p))==mp_endpoint)&&(lcap_val(p)==2) )
+ mp_box_ends(mp, mp_path_p(p), mp_pen_p(p), h);
break;
@ The height width and depth information stored in a text node determines a
@@ -10321,19 +10480,19 @@ case mp_text_code:
x1=mp_take_scaled(mp, txx_val(p),width_val(p));
y0=mp_take_scaled(mp, txy_val(p),-depth_val(p));
y1=mp_take_scaled(mp, txy_val(p),height_val(p));
- minx=tx_val(p);
- maxx=minx;
- if ( y0<y1 ) { minx=minx+y0; maxx=maxx+y1; }
- else { minx=minx+y1; maxx=maxx+y0; }
- if ( x1<0 ) minx=minx+x1; else maxx=maxx+x1;
+ mp_minx=tx_val(p);
+ mp_maxx=mp_minx;
+ if ( y0<y1 ) { mp_minx=mp_minx+y0; mp_maxx=mp_maxx+y1; }
+ else { mp_minx=mp_minx+y1; mp_maxx=mp_maxx+y0; }
+ if ( x1<0 ) mp_minx=mp_minx+x1; else mp_maxx=mp_maxx+x1;
x1=mp_take_scaled(mp, tyx_val(p),width_val(p));
y0=mp_take_scaled(mp, tyy_val(p),-depth_val(p));
y1=mp_take_scaled(mp, tyy_val(p),height_val(p));
- miny=ty_val(p);
- maxy=miny;
- if ( y0<y1 ) { miny=miny+y0; maxy=maxy+y1; }
- else { miny=miny+y1; maxy=maxy+y0; }
- if ( x1<0 ) miny=miny+x1; else maxy=maxy+x1;
+ mp_miny=ty_val(p);
+ mp_maxy=mp_miny;
+ if ( y0<y1 ) { mp_miny=mp_miny+y0; mp_maxy=mp_maxy+y1; }
+ else { mp_miny=mp_miny+y1; mp_maxy=mp_maxy+y0; }
+ if ( x1<0 ) mp_miny=mp_miny+x1; else mp_maxy=mp_maxy+x1;
mp_adjust_bbox(mp, h);
break;
@@ -10342,17 +10501,17 @@ type |mp_stop_clip_code| that matches |p|.
@<Other cases for updating the bounding box...@>=
case mp_start_clip_code:
- mp_path_bbox(mp, path_p(p));
- x0=minx; y0=miny;
- x1=maxx; y1=maxy;
+ mp_path_bbox(mp, mp_path_p(p));
+ x0=mp_minx; y0=mp_miny;
+ x1=mp_maxx; y1=mp_maxy;
sminx=minx_val(h); sminy=miny_val(h);
smaxx=maxx_val(h); smaxy=maxy_val(h);
@<Reinitialize the bounding box in header |h| and call |set_bbox| recursively
- starting at |link(p)|@>;
+ starting at |mp_link(p)|@>;
@<Clip the bounding box in |h| to the rectangle given by |x0|, |x1|,
|y0|, |y1|@>;
- minx=sminx; miny=sminy;
- maxx=smaxx; maxy=smaxy;
+ mp_minx=sminx; mp_miny=sminy;
+ mp_maxx=smaxx; mp_maxy=smaxy;
mp_adjust_bbox(mp, h);
break;
@@ -10381,7 +10540,7 @@ and a pointer~|h| to the first knot of a pen polygon,
the |offset_prep| routine changes the path into cubics that are
associated with particular pen offsets. Thus if the cubic between |p|
and~|q| is associated with the |k|th offset and the cubic between |q| and~|r|
-has offset |l| then |info(q)=zero_off+l-k|. (The constant |zero_off| is added
+has offset |l| then |mp_info(q)=zero_off+l-k|. (The constant |zero_off| is added
to because |l-k| could be negative.)
After overwriting the type information with offset differences, we no longer
@@ -10397,11 +10556,11 @@ Since an envelope spec only determines relative changes in pen offsets,
@<Glob...@>=
integer spec_offset; /* number of pen edges between |h| and the initial offset */
-@ @c @<Declare subroutines needed by |offset_prep|@>
-pointer mp_offset_prep (MP mp,pointer c, pointer h) {
+@ @c
+static pointer mp_offset_prep (MP mp,pointer c, pointer h) {
halfword n; /* the number of vertices in the pen polygon */
pointer c0,p,q,q0,r,w, ww; /* for list manipulation */
- integer k_needed; /* amount to be added to |info(p)| when it is computed */
+ integer k_needed; /* amount to be added to |mp_info(p)| when it is computed */
pointer w0; /* a pointer to pen offset to use just before |p| */
scaled dxin,dyin; /* the direction into knot |p| */
integer turn_amt; /* change in pen offsets for the current cubic */
@@ -10411,7 +10570,7 @@ pointer mp_offset_prep (MP mp,pointer c, pointer h) {
@<Initialize the incoming direction and pen offset at |c|@>;
p=c; c0=c; k_needed=0;
do {
- q=link(p);
+ q=mp_link(p);
@<Split the cubic between |p| and |q|, if necessary, into cubics
associated with single offsets, after which |q| should
point to the end of the final such cubic@>;
@@ -10419,7 +10578,7 @@ pointer mp_offset_prep (MP mp,pointer c, pointer h) {
@<Advance |p| to node |q|, removing any ``dead'' cubics that
might have been introduced by the splitting process@>;
} while (q!=c);
- @<Fix the offset change in |info(c)| and set |c| to the return value of
+ @<Fix the offset change in |mp_info(c)| and set |c| to the return value of
|offset_prep|@>;
return c;
}
@@ -10440,7 +10599,7 @@ mp->spec_p1=null; mp->spec_p2=null;
n=0; p=h;
do {
incr(n);
- p=link(p);
+ p=mp_link(p);
} while (p!=h)
@ Since the true incoming direction isn't known yet, we just pick a direction
@@ -10448,11 +10607,11 @@ consistent with the pen offset~|h|. If this is wrong, it can be corrected
later.
@<Initialize the incoming direction and pen offset at |c|@>=
-dxin=x_coord(link(h))-x_coord(knil(h));
-dyin=y_coord(link(h))-y_coord(knil(h));
+dxin=mp_x_coord(mp_link(h))-mp_x_coord(knil(h));
+dyin=mp_y_coord(mp_link(h))-mp_y_coord(knil(h));
if ( (dxin==0)&&(dyin==0) ) {
- dxin=y_coord(knil(h))-y_coord(h);
- dyin=x_coord(h)-x_coord(knil(h));
+ dxin=mp_y_coord(knil(h))-mp_y_coord(h);
+ dyin=mp_x_coord(h)-mp_x_coord(knil(h));
}
w0=h
@@ -10469,10 +10628,10 @@ on Sarovar.)
@<Advance |p| to node |q|, removing any ``dead'' cubics...@>=
q0=q;
do {
- r=link(p);
- if ( x_coord(p)==right_x(p) && y_coord(p)==right_y(p) &&
- x_coord(p)==left_x(r) && y_coord(p)==left_y(r) &&
- x_coord(p)==x_coord(r) && y_coord(p)==y_coord(r) &&
+ r=mp_link(p);
+ if ( mp_x_coord(p)==mp_right_x(p) && mp_y_coord(p)==mp_right_y(p) &&
+ mp_x_coord(p)==mp_left_x(r) && mp_y_coord(p)==mp_left_y(r) &&
+ mp_x_coord(p)==mp_x_coord(r) && mp_y_coord(p)==mp_y_coord(r) &&
r!=p ) {
@<Remove the cubic following |p| and update the data structures
to merge |r| into |p|@>;
@@ -10481,17 +10640,17 @@ do {
} while (p!=q);
/* Check if we removed too much */
if ((q!=q0)&&(q!=c||c==c0))
- q = link(q)
+ q = mp_link(q)
@ @<Remove the cubic following |p| and update the data structures...@>=
-{ k_needed=info(p)-zero_off;
+{ k_needed=mp_info(p)-zero_off;
if ( r==q ) {
q=p;
} else {
- info(p)=k_needed+info(r);
+ mp_info(p)=k_needed+mp_info(r);
k_needed=0;
};
- if ( r==c ) { info(p)=info(c); c=p; };
+ if ( r==c ) { mp_info(p)=mp_info(c); c=p; };
if ( r==mp->spec_p1 ) mp->spec_p1=p;
if ( r==mp->spec_p2 ) mp->spec_p2=p;
r=p; mp_remove_cubic(mp, p);
@@ -10500,34 +10659,40 @@ if ((q!=q0)&&(q!=c||c==c0))
@ Not setting the |info| field of the newly created knot allows the splitting
routine to work for paths.
-@<Declare subroutines needed by |offset_prep|@>=
+@<Declarations@>=
+static void mp_split_cubic (MP mp,pointer p, fraction t) ;
+
+@ @c
void mp_split_cubic (MP mp,pointer p, fraction t) { /* splits the cubic after |p| */
scaled v; /* an intermediate value */
pointer q,r; /* for list manipulation */
- q=link(p); r=mp_get_node(mp, knot_node_size); link(p)=r; link(r)=q;
- originator(r)=mp_program_code;
- left_type(r)=mp_explicit; right_type(r)=mp_explicit;
- v=t_of_the_way(right_x(p),left_x(q));
- right_x(p)=t_of_the_way(x_coord(p),right_x(p));
- left_x(q)=t_of_the_way(left_x(q),x_coord(q));
- left_x(r)=t_of_the_way(right_x(p),v);
- right_x(r)=t_of_the_way(v,left_x(q));
- x_coord(r)=t_of_the_way(left_x(r),right_x(r));
- v=t_of_the_way(right_y(p),left_y(q));
- right_y(p)=t_of_the_way(y_coord(p),right_y(p));
- left_y(q)=t_of_the_way(left_y(q),y_coord(q));
- left_y(r)=t_of_the_way(right_y(p),v);
- right_y(r)=t_of_the_way(v,left_y(q));
- y_coord(r)=t_of_the_way(left_y(r),right_y(r));
-}
-
-@ This does not set |info(p)| or |right_type(p)|.
-
-@<Declare subroutines needed by |offset_prep|@>=
+ q=mp_link(p); r=mp_get_node(mp, knot_node_size); mp_link(p)=r; mp_link(r)=q;
+ mp_originator(r)=mp_program_code;
+ mp_left_type(r)=mp_explicit; mp_right_type(r)=mp_explicit;
+ v=t_of_the_way(mp_right_x(p),mp_left_x(q));
+ mp_right_x(p)=t_of_the_way(mp_x_coord(p),mp_right_x(p));
+ mp_left_x(q)=t_of_the_way(mp_left_x(q),mp_x_coord(q));
+ mp_left_x(r)=t_of_the_way(mp_right_x(p),v);
+ mp_right_x(r)=t_of_the_way(v,mp_left_x(q));
+ mp_x_coord(r)=t_of_the_way(mp_left_x(r),mp_right_x(r));
+ v=t_of_the_way(mp_right_y(p),mp_left_y(q));
+ mp_right_y(p)=t_of_the_way(mp_y_coord(p),mp_right_y(p));
+ mp_left_y(q)=t_of_the_way(mp_left_y(q),mp_y_coord(q));
+ mp_left_y(r)=t_of_the_way(mp_right_y(p),v);
+ mp_right_y(r)=t_of_the_way(v,mp_left_y(q));
+ mp_y_coord(r)=t_of_the_way(mp_left_y(r),mp_right_y(r));
+}
+
+@ This does not set |mp_info(p)| or |mp_right_type(p)|.
+
+@<Declarations@>=
+static void mp_remove_cubic (MP mp,pointer p) ;
+
+@ @c
void mp_remove_cubic (MP mp,pointer p) { /* removes the dead cubic following~|p| */
pointer q; /* the node that disappears */
- q=link(p); link(p)=link(q);
- right_x(p)=right_x(q); right_y(p)=right_y(q);
+ q=mp_link(p); mp_link(p)=mp_link(q);
+ mp_right_x(p)=mp_right_x(q); mp_right_y(p)=mp_right_y(q);
mp_free_node(mp, q,knot_node_size);
}
@@ -10545,12 +10710,12 @@ We may have to split a cubic into many pieces before each
piece corresponds to a unique offset.
@<Split the cubic between |p| and |q|, if necessary, into cubics...@>=
-info(p)=zero_off+k_needed;
+mp_info(p)=zero_off+k_needed;
k_needed=0;
@<Prepare for derivative computations;
|goto not_found| if the current cubic is dead@>;
@<Find the initial direction |(dx,dy)|@>;
-@<Update |info(p)| and find the offset $w_k$ such that
+@<Update |mp_info(p)| and find the offset $w_k$ such that
$d_{k-1}\preceq(\\{dx},\\{dy})\prec d_k$; also advance |w0| for
the direction change at |p|@>;
@<Find the final direction |(dxin,dyin)|@>;
@@ -10558,10 +10723,13 @@ k_needed=0;
@<Complete the offset splitting process@>;
w0=mp_pen_walk(mp, w0,turn_amt)
-@ @<Declare subroutines needed by |offset_prep|@>=
+@ @<Declarations@>=
+static pointer mp_pen_walk (MP mp,pointer w, integer k) ;
+
+@ @c
pointer mp_pen_walk (MP mp,pointer w, integer k) {
/* walk |k| steps around a pen from |w| */
- while ( k>0 ) { w=link(w); decr(k); };
+ while ( k>0 ) { w=mp_link(w); decr(k); };
while ( k<0 ) { w=knil(w); incr(k); };
return w;
}
@@ -10590,11 +10758,11 @@ fraction t; /* where the derivative passes through zero */
fraction s; /* a temporary value */
@ @<Prepare for derivative computations...@>=
-x0=right_x(p)-x_coord(p);
-x2=x_coord(q)-left_x(q);
-x1=left_x(q)-right_x(p);
-y0=right_y(p)-y_coord(p); y2=y_coord(q)-left_y(q);
-y1=left_y(q)-right_y(p);
+x0=mp_right_x(p)-mp_x_coord(p);
+x2=mp_x_coord(q)-mp_left_x(q);
+x1=mp_left_x(q)-mp_right_x(p);
+y0=mp_right_y(p)-mp_y_coord(p); y2=mp_y_coord(q)-mp_left_y(q);
+y1=mp_left_y(q)-mp_right_y(p);
max_coef=abs(x0);
if ( abs(x1)>max_coef ) max_coef=abs(x1);
if ( abs(x2)>max_coef ) max_coef=abs(x2);
@@ -10628,11 +10796,16 @@ The |fin_offset_prep| subroutine solves the stated subproblem.
It has a parameter called |rise| that is |1| in
case~(i), |-1| in case~(ii). Parameters |x0| through |y2| represent
the derivative of the cubic following |p|.
-The |w| parameter should point to offset~$w_k$ and |info(p)| should already
+The |w| parameter should point to offset~$w_k$ and |mp_info(p)| should already
be set properly. The |turn_amt| parameter gives the absolute value of the
overall net change in pen offsets.
-@<Declare subroutines needed by |offset_prep|@>=
+@<Declarations@>=
+static void mp_fin_offset_prep (MP mp,pointer p, pointer w, integer
+ x0,integer x1, integer x2, integer y0, integer y1, integer y2,
+ integer rise, integer turn_amt) ;
+
+@ @c
void mp_fin_offset_prep (MP mp,pointer p, pointer w, integer
x0,integer x1, integer x2, integer y0, integer y1, integer y2,
integer rise, integer turn_amt) {
@@ -10642,10 +10815,10 @@ void mp_fin_offset_prep (MP mp,pointer p, pointer w, integer
fraction t; /* place where the derivative passes a critical slope */
fraction s; /* slope or reciprocal slope */
integer v; /* intermediate value for updating |x0..y2| */
- pointer q; /* original |link(p)| */
- q=link(p);
+ pointer q; /* original |mp_link(p)| */
+ q=mp_link(p);
while (1) {
- if ( rise>0 ) ww=link(w); /* a pointer to $w\k$ */
+ if ( rise>0 ) ww=mp_link(w); /* a pointer to $w\k$ */
else ww=knil(w); /* a pointer to $w_{k-1}$ */
@<Compute test coefficients |(t0,t1,t2)|
for $d(t)$ versus $d_k$ or $d_{k-1}$@>;
@@ -10665,7 +10838,7 @@ function cross from positive to negative when $d_{k-1}\preceq d(t)\preceq d_k$
begins to fail.
@<Compute test coefficients |(t0,t1,t2)| for $d(t)$ versus...@>=
-du=x_coord(ww)-x_coord(w); dv=y_coord(ww)-y_coord(w);
+du=mp_x_coord(ww)-mp_x_coord(w); dv=mp_y_coord(ww)-mp_y_coord(w);
if ( abs(du)>=abs(dv) ) {
s=mp_make_fraction(mp, dv,du);
t0=mp_take_fraction(mp, x0,s)-y0;
@@ -10687,7 +10860,7 @@ respectively, yielding another solution of $(*)$.
@<Split the cubic at $t$, and split off another...@>=
{
-mp_split_cubic(mp, p,t); p=link(p); info(p)=zero_off+rise;
+mp_split_cubic(mp, p,t); p=mp_link(p); mp_info(p)=zero_off+rise;
decr(turn_amt);
v=t_of_the_way(x0,x1); x1=t_of_the_way(x1,x2);
x0=t_of_the_way(v,x1);
@@ -10699,10 +10872,10 @@ if ( turn_amt<0 ) {
t=mp_crossing_point(mp, 0,-t1,-t2);
if ( t>fraction_one ) t=fraction_one;
incr(turn_amt);
- if ( (t==fraction_one)&&(link(p)!=q) ) {
- info(link(p))=info(link(p))-rise;
+ if ( (t==fraction_one)&&(mp_link(p)!=q) ) {
+ mp_info(mp_link(p))=mp_info(mp_link(p))-rise;
} else {
- mp_split_cubic(mp, p,t); info(link(p))=zero_off-rise;
+ mp_split_cubic(mp, p,t); mp_info(mp_link(p))=zero_off-rise;
v=t_of_the_way(x1,x2); x1=t_of_the_way(x0,x1);
x2=t_of_the_way(x1,v);
v=t_of_the_way(y1,y2); y1=t_of_the_way(y0,y1);
@@ -10746,11 +10919,11 @@ counter-clockwise in order to make \&{doublepath} envelopes come out
@:double_path_}{\&{doublepath} primitive@>
right.) This code depends on |w0| being the offset for |(dxin,dyin)|.
-@<Update |info(p)| and find the offset $w_k$ such that...@>=
+@<Update |mp_info(p)| and find the offset $w_k$ such that...@>=
turn_amt=mp_get_turn_amt(mp,w0,dx,dy,(mp_ab_vs_cd(mp, dy,dxin,dx,dyin)>=0));
w=mp_pen_walk(mp, w0, turn_amt);
w0=w;
-info(p)=info(p)+turn_amt
+mp_info(p)=mp_info(p)+turn_amt
@ Decide how many pen offsets to go away from |w| in order to find the offset
for |(dx,dy)|, going counterclockwise if |ccw| is |true|. This assumes that
@@ -10761,7 +10934,11 @@ If the pen polygon has only two edges, they could both be parallel
to |(dx,dy)|. In this case, we must be careful to stop after crossing the first
such edge in order to avoid an infinite loop.
-@<Declare subroutines needed by |offset_prep|@>=
+@<Declarations@>=
+static integer mp_get_turn_amt (MP mp,pointer w, scaled dx,
+ scaled dy, boolean ccw);
+
+@ @c
integer mp_get_turn_amt (MP mp,pointer w, scaled dx,
scaled dy, boolean ccw) {
pointer ww; /* a neighbor of knot~|w| */
@@ -10769,18 +10946,18 @@ integer mp_get_turn_amt (MP mp,pointer w, scaled dx,
integer t; /* |ab_vs_cd| result */
s=0;
if ( ccw ) {
- ww=link(w);
+ ww=mp_link(w);
do {
- t=mp_ab_vs_cd(mp, dy,(x_coord(ww)-x_coord(w)),
- dx,(y_coord(ww)-y_coord(w)));
+ t=mp_ab_vs_cd(mp, dy,(mp_x_coord(ww)-mp_x_coord(w)),
+ dx,(mp_y_coord(ww)-mp_y_coord(w)));
if ( t<0 ) break;
incr(s);
- w=ww; ww=link(ww);
+ w=ww; ww=mp_link(ww);
} while (t>0);
} else {
ww=knil(w);
- while ( mp_ab_vs_cd(mp, dy,(x_coord(w)-x_coord(ww)),
- dx,(y_coord(w)-y_coord(ww))) < 0) {
+ while ( mp_ab_vs_cd(mp, dy,(mp_x_coord(w)-mp_x_coord(ww)),
+ dx,(mp_y_coord(w)-mp_y_coord(ww))) < 0) {
decr(s);
w=ww; ww=knil(ww);
}
@@ -10790,21 +10967,21 @@ integer mp_get_turn_amt (MP mp,pointer w, scaled dx,
@ When we're all done, the final offset is |w0| and the final curve direction
is |(dxin,dyin)|. With this knowledge of the incoming direction at |c|, we
-can correct |info(c)| which was erroneously based on an incoming offset
+can correct |mp_info(c)| which was erroneously based on an incoming offset
of~|h|.
-@d fix_by(A) info(c)=info(c)+(A)
+@d fix_by(A) mp_info(c)=mp_info(c)+(A)
-@<Fix the offset change in |info(c)| and set |c| to the return value of...@>=
-mp->spec_offset=info(c)-zero_off;
-if ( link(c)==c ) {
- info(c)=zero_off+n;
+@<Fix the offset change in |mp_info(c)| and set |c| to the return value of...@>=
+mp->spec_offset=mp_info(c)-zero_off;
+if ( mp_link(c)==c ) {
+ mp_info(c)=zero_off+n;
} else {
fix_by(k_needed);
- while ( w0!=h ) { fix_by(1); w0=link(w0); };
- while ( info(c)<=zero_off-n ) fix_by(n);
- while ( info(c)>zero_off ) fix_by(-n);
- if ( (info(c)!=zero_off)&&(mp_ab_vs_cd(mp, dy0,dxin,dx0,dyin)>=0) ) fix_by(n);
+ while ( w0!=h ) { fix_by(1); w0=mp_link(w0); };
+ while ( mp_info(c)<=zero_off-n ) fix_by(n);
+ while ( mp_info(c)>zero_off ) fix_by(-n);
+ if ( (mp_info(c)!=zero_off)&&(mp_ab_vs_cd(mp, dy0,dxin,dx0,dyin)>=0) ) fix_by(n);
}
@ Finally we want to reduce the general problem to situations that
@@ -10819,13 +10996,13 @@ ww=knil(w);
if ( t>fraction_one ) {
mp_fin_offset_prep(mp, p,w,x0,x1,x2,y0,y1,y2,1,turn_amt);
} else {
- mp_split_cubic(mp, p,t); r=link(p);
+ mp_split_cubic(mp, p,t); r=mp_link(p);
x1a=t_of_the_way(x0,x1); x1=t_of_the_way(x1,x2);
x2a=t_of_the_way(x1a,x1);
y1a=t_of_the_way(y0,y1); y1=t_of_the_way(y1,y2);
y2a=t_of_the_way(y1a,y1);
mp_fin_offset_prep(mp, p,w,x0,x1a,x2a,y0,y1a,y2a,1,0); x0=x2a; y0=y2a;
- info(r)=zero_off-1;
+ mp_info(r)=zero_off-1;
if ( turn_amt>=0 ) {
t1=t_of_the_way(t1,t2);
if ( t1>0 ) t1=0;
@@ -10839,12 +11016,12 @@ if ( t>fraction_one ) {
}
@ @<Split off another rising cubic for |fin_offset_prep|@>=
-mp_split_cubic(mp, r,t); info(link(r))=zero_off+1;
+mp_split_cubic(mp, r,t); mp_info(mp_link(r))=zero_off+1;
x1a=t_of_the_way(x1,x2); x1=t_of_the_way(x0,x1);
x0a=t_of_the_way(x1,x1a);
y1a=t_of_the_way(y1,y2); y1=t_of_the_way(y0,y1);
y0a=t_of_the_way(y1,y1a);
-mp_fin_offset_prep(mp, link(r),w,x0a,x1a,x2,y0a,y1a,y2,1,turn_amt);
+mp_fin_offset_prep(mp, mp_link(r),w,x0a,x1a,x2,y0a,y1a,y2,1,turn_amt);
x2=x0a; y2=y0a
@ At this point, the direction of the incoming pen edge is |(-du,-dv)|.
@@ -10907,8 +11084,8 @@ same sign, we pick this as |d_sign|, since it means we have a flex, not a cusp.
Otherwise we proceed to the cusp code.
@<Check rotation direction based on node position@>=
-u0=x_coord(q)-x_coord(p);
-u1=y_coord(q)-y_coord(p);
+u0=mp_x_coord(q)-mp_x_coord(p);
+u1=mp_y_coord(q)-mp_y_coord(p);
d_sign = half(mp_ab_vs_cd(mp, dx, u1, u0, dy)+
mp_ab_vs_cd(mp, u0, dyin, dxin, u1));
@@ -10942,48 +11119,48 @@ ss=mp_take_fraction(mp, (x0+x2),t_of_the_way(u0,u1))+
that the |cur_pen| has not been walked around to the first offset.
@c
-void mp_print_spec (MP mp,pointer cur_spec, pointer cur_pen, const char *s) {
+static void mp_print_spec (MP mp,pointer cur_spec, pointer cur_pen, const char *s) {
pointer p,q; /* list traversal */
pointer w; /* the current pen offset */
mp_print_diagnostic(mp, "Envelope spec",s,true);
p=cur_spec; w=mp_pen_walk(mp, cur_pen,mp->spec_offset);
mp_print_ln(mp);
- mp_print_two(mp, x_coord(cur_spec),y_coord(cur_spec));
+ mp_print_two(mp, mp_x_coord(cur_spec),mp_y_coord(cur_spec));
mp_print(mp, " % beginning with offset ");
- mp_print_two(mp, x_coord(w),y_coord(w));
+ mp_print_two(mp, mp_x_coord(w),mp_y_coord(w));
do {
while (1) {
- q=link(p);
+ q=mp_link(p);
@<Print the cubic between |p| and |q|@>;
p=q;
- if ((p==cur_spec) || (info(p)!=zero_off))
+ if ((p==cur_spec) || (mp_info(p)!=zero_off))
break;
}
- if ( info(p)!=zero_off ) {
- @<Update |w| as indicated by |info(p)| and print an explanation@>;
+ if ( mp_info(p)!=zero_off ) {
+ @<Update |w| as indicated by |mp_info(p)| and print an explanation@>;
}
} while (p!=cur_spec);
mp_print_nl(mp, " & cycle");
mp_end_diagnostic(mp, true);
}
-@ @<Update |w| as indicated by |info(p)| and print an explanation@>=
+@ @<Update |w| as indicated by |mp_info(p)| and print an explanation@>=
{
- w=mp_pen_walk(mp, w, (info(p)-zero_off));
+ w=mp_pen_walk(mp, w, (mp_info(p)-zero_off));
mp_print(mp, " % ");
- if ( info(p)>zero_off ) mp_print(mp, "counter");
+ if ( mp_info(p)>zero_off ) mp_print(mp, "counter");
mp_print(mp, "clockwise to offset ");
- mp_print_two(mp, x_coord(w),y_coord(w));
+ mp_print_two(mp, mp_x_coord(w),mp_y_coord(w));
}
@ @<Print the cubic between |p| and |q|@>=
{
mp_print_nl(mp, " ..controls ");
- mp_print_two(mp, right_x(p),right_y(p));
+ mp_print_two(mp, mp_right_x(p),mp_right_y(p));
mp_print(mp, " and ");
- mp_print_two(mp, left_x(q),left_y(q));
+ mp_print_two(mp, mp_left_x(q),mp_left_y(q));
mp_print_nl(mp, " ..");
- mp_print_two(mp, x_coord(q),y_coord(q));
+ mp_print_two(mp, mp_x_coord(q),mp_y_coord(q));
}
@ Once we have an envelope spec, the remaining task to construct the actual
@@ -11004,9 +11181,9 @@ None of these parameters apply to inside joins where the convolution tracing
has retrograde lines. In such cases we use a simple connect-the-endpoints
approach that is achieved by setting |join_type:=2|.
-@c @<Declare a function called |insert_knot|@>
-pointer mp_make_envelope (MP mp,pointer c, pointer h, small_number ljoin,
- small_number lcap, scaled miterlim) {
+@c
+static pointer mp_make_envelope (MP mp,pointer c, pointer h, quarterword ljoin,
+ quarterword lcap, scaled miterlim) {
pointer p,q,r,q0; /* for manipulating the path */
int join_type=0; /* codes |0..3| for mitered, round, beveled, or square */
pointer w,w0; /* the pen knot for the current offset */
@@ -11021,9 +11198,9 @@ pointer mp_make_envelope (MP mp,pointer c, pointer h, small_number ljoin,
w=h;
p=c;
do {
- q=link(p); q0=q;
- qx=x_coord(q); qy=y_coord(q);
- k=info(q);
+ q=mp_link(p); q0=q;
+ qx=mp_x_coord(q); qy=mp_y_coord(q);
+ k=mp_info(q);
k0=k; w0=w;
if ( k!=zero_off ) {
@<Set |join_type| to indicate how to handle offset changes at~|q|@>;
@@ -11032,10 +11209,10 @@ pointer mp_make_envelope (MP mp,pointer c, pointer h, small_number ljoin,
while ( k!=zero_off ) {
@<Step |w| and move |k| one step closer to |zero_off|@>;
if ( (join_type==1)||(k==zero_off) )
- q=mp_insert_knot(mp, q,qx+x_coord(w),qy+y_coord(w));
+ q=mp_insert_knot(mp, q,qx+mp_x_coord(w),qy+mp_y_coord(w));
};
- if ( q!=link(p) ) {
- @<Set |p=link(p)| and add knots between |p| and |q| as
+ if ( q!=mp_link(p) ) {
+ @<Set |p=mp_link(p)| and add knots between |p| and |q| as
required by |join_type|@>;
}
p=q;
@@ -11088,48 +11265,51 @@ scaled tmp; /* a temporary value */
knot in which case they get shifted at the very end.
@<Add offset |w| to the cubic from |p| to |q|@>=
-right_x(p)=right_x(p)+x_coord(w);
-right_y(p)=right_y(p)+y_coord(w);
-left_x(q)=left_x(q)+x_coord(w);
-left_y(q)=left_y(q)+y_coord(w);
-x_coord(q)=x_coord(q)+x_coord(w);
-y_coord(q)=y_coord(q)+y_coord(w);
-left_type(q)=mp_explicit;
-right_type(q)=mp_explicit
+mp_right_x(p)=mp_right_x(p)+mp_x_coord(w);
+mp_right_y(p)=mp_right_y(p)+mp_y_coord(w);
+mp_left_x(q)=mp_left_x(q)+mp_x_coord(w);
+mp_left_y(q)=mp_left_y(q)+mp_y_coord(w);
+mp_x_coord(q)=mp_x_coord(q)+mp_x_coord(w);
+mp_y_coord(q)=mp_y_coord(q)+mp_y_coord(w);
+mp_left_type(q)=mp_explicit;
+mp_right_type(q)=mp_explicit
@ @<Step |w| and move |k| one step closer to |zero_off|@>=
-if ( k>zero_off ){ w=link(w); decr(k); }
+if ( k>zero_off ){ w=mp_link(w); decr(k); }
else { w=knil(w); incr(k); }
@ The cubic from |q| to the new knot at |(x,y)| becomes a line segment and
-the |right_x| and |right_y| fields of |r| are set from |q|. This is done in
+the |mp_right_x| and |mp_right_y| fields of |r| are set from |q|. This is done in
case the cubic containing these control points is ``yet to be examined.''
-@<Declare a function called |insert_knot|@>=
+@<Declarations@>=
+static pointer mp_insert_knot (MP mp,pointer q, scaled x, scaled y);
+
+@ @c
pointer mp_insert_knot (MP mp,pointer q, scaled x, scaled y) {
/* returns the inserted knot */
pointer r; /* the new knot */
r=mp_get_node(mp, knot_node_size);
- link(r)=link(q); link(q)=r;
- right_x(r)=right_x(q);
- right_y(r)=right_y(q);
- x_coord(r)=x;
- y_coord(r)=y;
- right_x(q)=x_coord(q);
- right_y(q)=y_coord(q);
- left_x(r)=x_coord(r);
- left_y(r)=y_coord(r);
- left_type(r)=mp_explicit;
- right_type(r)=mp_explicit;
- originator(r)=mp_program_code;
+ mp_link(r)=mp_link(q); mp_link(q)=r;
+ mp_right_x(r)=mp_right_x(q);
+ mp_right_y(r)=mp_right_y(q);
+ mp_x_coord(r)=x;
+ mp_y_coord(r)=y;
+ mp_right_x(q)=mp_x_coord(q);
+ mp_right_y(q)=mp_y_coord(q);
+ mp_left_x(r)=mp_x_coord(r);
+ mp_left_y(r)=mp_y_coord(r);
+ mp_left_type(r)=mp_explicit;
+ mp_right_type(r)=mp_explicit;
+ mp_originator(r)=mp_program_code;
return r;
}
-@ After setting |p:=link(p)|, either |join_type=1| or |q=link(p)|.
+@ After setting |p:=mp_link(p)|, either |join_type=1| or |q=mp_link(p)|.
-@<Set |p=link(p)| and add knots between |p| and |q| as...@>=
+@<Set |p=mp_link(p)| and add knots between |p| and |q| as...@>=
{
- p=link(p);
+ p=mp_link(p);
if ( (join_type==0)||(join_type==3) ) {
if ( join_type==0 ) {
@<Insert a new knot |r| between |p| and |q| as required for a mitered join@>
@@ -11138,8 +11318,8 @@ pointer mp_insert_knot (MP mp,pointer q, scaled x, scaled y) {
squared join@>;
}
if ( r!=null ) {
- right_x(r)=x_coord(r);
- right_y(r)=y_coord(r);
+ mp_right_x(r)=mp_x_coord(r);
+ mp_right_y(r)=mp_y_coord(r);
}
}
}
@@ -11153,11 +11333,11 @@ problems, so we just set |r:=null| in that case.
if ( abs(det)<26844 ) {
r=null; /* sine $<10^{-4}$ */
} else {
- tmp=mp_take_fraction(mp, x_coord(q)-x_coord(p),dyout)-
- mp_take_fraction(mp, y_coord(q)-y_coord(p),dxout);
+ tmp=mp_take_fraction(mp, mp_x_coord(q)-mp_x_coord(p),dyout)-
+ mp_take_fraction(mp, mp_y_coord(q)-mp_y_coord(p),dxout);
tmp=mp_make_fraction(mp, tmp,det);
- r=mp_insert_knot(mp, p,x_coord(p)+mp_take_fraction(mp, tmp,dxin),
- y_coord(p)+mp_take_fraction(mp, tmp,dyin));
+ r=mp_insert_knot(mp, p,mp_x_coord(p)+mp_take_fraction(mp, tmp,dxin),
+ mp_y_coord(p)+mp_take_fraction(mp, tmp,dyin));
}
}
@@ -11166,8 +11346,8 @@ fraction det; /* a determinant used for mitered join calculations */
@ @<Make |r| the last of two knots inserted between |p| and |q| to form a...@>=
{
- ht_x=y_coord(w)-y_coord(w0);
- ht_y=x_coord(w0)-x_coord(w);
+ ht_x=mp_y_coord(w)-mp_y_coord(w0);
+ ht_y=mp_x_coord(w0)-mp_x_coord(w);
while ( (abs(ht_x)<fraction_half)&&(abs(ht_y)<fraction_half) ) {
ht_x+=ht_x; ht_y+=ht_y;
}
@@ -11175,12 +11355,12 @@ fraction det; /* a determinant used for mitered join calculations */
product with |(ht_x,ht_y)|@>;
tmp=mp_make_fraction(mp, max_ht,mp_take_fraction(mp, dxin,ht_x)+
mp_take_fraction(mp, dyin,ht_y));
- r=mp_insert_knot(mp, p,x_coord(p)+mp_take_fraction(mp, tmp,dxin),
- y_coord(p)+mp_take_fraction(mp, tmp,dyin));
+ r=mp_insert_knot(mp, p,mp_x_coord(p)+mp_take_fraction(mp, tmp,dxin),
+ mp_y_coord(p)+mp_take_fraction(mp, tmp,dyin));
tmp=mp_make_fraction(mp, max_ht,mp_take_fraction(mp, dxout,ht_x)+
mp_take_fraction(mp, dyout,ht_y));
- r=mp_insert_knot(mp, r,x_coord(q)+mp_take_fraction(mp, tmp,dxout),
- y_coord(q)+mp_take_fraction(mp, tmp,dyout));
+ r=mp_insert_knot(mp, r,mp_x_coord(q)+mp_take_fraction(mp, tmp,dxout),
+ mp_y_coord(q)+mp_take_fraction(mp, tmp,dyout));
}
@ @<Other local variables for |make_envelope|@>=
@@ -11199,27 +11379,27 @@ ww=w;
while (1) {
@<Step |ww| and move |kk| one step closer to |k0|@>;
if ( kk==k0 ) break;
- tmp=mp_take_fraction(mp, (x_coord(ww)-x_coord(w0)),ht_x)+
- mp_take_fraction(mp, (y_coord(ww)-y_coord(w0)),ht_y);
+ tmp=mp_take_fraction(mp, (mp_x_coord(ww)-mp_x_coord(w0)),ht_x)+
+ mp_take_fraction(mp, (mp_y_coord(ww)-mp_y_coord(w0)),ht_y);
if ( tmp>max_ht ) max_ht=tmp;
}
@ @<Step |ww| and move |kk| one step closer to |k0|@>=
-if ( kk>k0 ) { ww=link(ww); decr(kk); }
+if ( kk>k0 ) { ww=mp_link(ww); decr(kk); }
else { ww=knil(ww); incr(kk); }
@ @<If endpoint, double the path |c|, and set |spec_p1| and |spec_p2|@>=
-if ( left_type(c)==mp_endpoint ) {
+if ( mp_left_type(c)==mp_endpoint ) {
mp->spec_p1=mp_htap_ypoc(mp, c);
mp->spec_p2=mp->path_tail;
- originator(mp->spec_p1)=mp_program_code;
- link(mp->spec_p2)=link(mp->spec_p1);
- link(mp->spec_p1)=c;
+ mp_originator(mp->spec_p1)=mp_program_code;
+ mp_link(mp->spec_p2)=mp_link(mp->spec_p1);
+ mp_link(mp->spec_p1)=c;
mp_remove_cubic(mp, mp->spec_p1);
c=mp->spec_p1;
- if ( c!=link(c) ) {
- originator(mp->spec_p2)=mp_program_code;
+ if ( c!=mp_link(c) ) {
+ mp_originator(mp->spec_p2)=mp_program_code;
mp_remove_cubic(mp, mp->spec_p2);
} else {
@<Make |c| look like a cycle of length one@>;
@@ -11228,26 +11408,26 @@ if ( left_type(c)==mp_endpoint ) {
@ @<Make |c| look like a cycle of length one@>=
{
- left_type(c)=mp_explicit; right_type(c)=mp_explicit;
- left_x(c)=x_coord(c); left_y(c)=y_coord(c);
- right_x(c)=x_coord(c); right_y(c)=y_coord(c);
+ mp_left_type(c)=mp_explicit; mp_right_type(c)=mp_explicit;
+ mp_left_x(c)=mp_x_coord(c); mp_left_y(c)=mp_y_coord(c);
+ mp_right_x(c)=mp_x_coord(c); mp_right_y(c)=mp_y_coord(c);
}
@ In degenerate situations we might have to look at the knot preceding~|q|.
That knot is |p| but if |p<>c|, its coordinates have already been offset by |w|.
@<Set the incoming and outgoing directions at |q|; in case of...@>=
-dxin=x_coord(q)-left_x(q);
-dyin=y_coord(q)-left_y(q);
+dxin=mp_x_coord(q)-mp_left_x(q);
+dyin=mp_y_coord(q)-mp_left_y(q);
if ( (dxin==0)&&(dyin==0) ) {
- dxin=x_coord(q)-right_x(p);
- dyin=y_coord(q)-right_y(p);
+ dxin=mp_x_coord(q)-mp_right_x(p);
+ dyin=mp_y_coord(q)-mp_right_y(p);
if ( (dxin==0)&&(dyin==0) ) {
- dxin=x_coord(q)-x_coord(p);
- dyin=y_coord(q)-y_coord(p);
+ dxin=mp_x_coord(q)-mp_x_coord(p);
+ dyin=mp_y_coord(q)-mp_y_coord(p);
if ( p!=c ) { /* the coordinates of |p| have been offset by |w| */
- dxin=dxin+x_coord(w);
- dyin=dyin+y_coord(w);
+ dxin=dxin+mp_x_coord(w);
+ dyin=dyin+mp_y_coord(w);
}
}
}
@@ -11264,20 +11444,20 @@ if ( tmp==0 ) {
and~|r| have already been offset by |h|.
@<Set the outgoing direction at |q|@>=
-dxout=right_x(q)-x_coord(q);
-dyout=right_y(q)-y_coord(q);
+dxout=mp_right_x(q)-mp_x_coord(q);
+dyout=mp_right_y(q)-mp_y_coord(q);
if ( (dxout==0)&&(dyout==0) ) {
- r=link(q);
- dxout=left_x(r)-x_coord(q);
- dyout=left_y(r)-y_coord(q);
+ r=mp_link(q);
+ dxout=mp_left_x(r)-mp_x_coord(q);
+ dyout=mp_left_y(r)-mp_y_coord(q);
if ( (dxout==0)&&(dyout==0) ) {
- dxout=x_coord(r)-x_coord(q);
- dyout=y_coord(r)-y_coord(q);
+ dxout=mp_x_coord(r)-mp_x_coord(q);
+ dyout=mp_y_coord(r)-mp_y_coord(q);
}
}
if ( q==c ) {
- dxout=dxout-x_coord(h);
- dyout=dyout-y_coord(h);
+ dxout=dxout-mp_x_coord(h);
+ dyout=dyout-mp_y_coord(h);
}
tmp=mp_pyth_add(mp, dxout,dyout);
if ( tmp==0 ) mp_confusion(mp, "degenerate spec");
@@ -11308,7 +11488,7 @@ and the given direction so that |(x,y)=(1,0)|; i.e., the main task will be
to find when a given path first travels ``due east.''
@c
-scaled mp_find_direction_time (MP mp,scaled x, scaled y, pointer h) {
+static scaled mp_find_direction_time (MP mp,scaled x, scaled y, pointer h) {
scaled max; /* $\max\bigl(\vert x\vert,\vert y\vert\bigr)$ */
pointer p,q; /* for list traversal */
scaled n; /* the direction time at knot |p| */
@@ -11318,8 +11498,8 @@ scaled mp_find_direction_time (MP mp,scaled x, scaled y, pointer h) {
but |return| with zero result if it's zero@>;
n=0; p=h; phi=0;
while (1) {
- if ( right_type(p)==mp_endpoint ) break;
- q=link(p);
+ if ( mp_right_type(p)==mp_endpoint ) break;
+ q=mp_link(p);
@<Rotate the cubic between |p| and |q|; then
|goto found| if the rotated cubic travels due east at some time |tt|;
but |break| if an entire cyclic path has been traversed@>;
@@ -11371,10 +11551,10 @@ angle theta,phi; /* angles of exit and entry at a knot */
fraction t; /* temp storage */
@ @<Set local variables |x1,x2,x3| and |y1,y2,y3| to multiples...@>=
-x1=right_x(p)-x_coord(p); x2=left_x(q)-right_x(p);
-x3=x_coord(q)-left_x(q);
-y1=right_y(p)-y_coord(p); y2=left_y(q)-right_y(p);
-y3=y_coord(q)-left_y(q);
+x1=mp_right_x(p)-mp_x_coord(p); x2=mp_left_x(q)-mp_right_x(p);
+x3=mp_x_coord(q)-mp_left_x(q);
+y1=mp_right_y(p)-mp_y_coord(p); y2=mp_left_y(q)-mp_right_y(p);
+y3=mp_y_coord(q)-mp_left_y(q);
max=abs(x1);
if ( abs(x2)>max ) max=abs(x2);
if ( abs(x3)>max ) max=abs(x3);
@@ -11627,7 +11807,7 @@ the quantities needed for bisection-intersection.
@<Glob...@>=
integer *bisect_stack;
-unsigned int bisect_ptr;
+integer bisect_ptr;
@ @<Allocate or initialize ...@>=
mp->bisect_stack = xmalloc((bistack_size+1),sizeof(integer));
@@ -11686,11 +11866,12 @@ integer time_to_go; /* this many backtracks before giving up */
integer max_t; /* maximum of $2^{l+1}$ so far achieved */
@ The given cubics $B(w_0,w_1,w_2,w_3;t)$ and
-$B(z_0,z_1,z_2,z_3;t)$ are specified in adjacent knot nodes |(p,link(p))|
-and |(pp,link(pp))|, respectively.
+$B(z_0,z_1,z_2,z_3;t)$ are specified in adjacent knot nodes |(p,mp_link(p))|
+and |(pp,mp_link(pp))|, respectively.
-@c void mp_cubic_intersection (MP mp,pointer p, pointer pp) {
- pointer q,qq; /* |link(p)|, |link(pp)| */
+@c
+static void mp_cubic_intersection (MP mp,pointer p, pointer pp) {
+ pointer q,qq; /* |mp_link(p)|, |mp_link(pp)| */
mp->time_to_go=max_patience; mp->max_t=2;
@<Initialize for intersections at level zero@>;
CONTINUE:
@@ -11730,8 +11911,8 @@ split |cubic_intersection| up into two procedures.
@<Glob...@>=
integer delx;integer dely; /* the components of $\Delta=2^l(w_0-z_0)$ */
integer tol; /* bound on the uncertainty in the overlap test */
-unsigned int uv;
-unsigned int xy; /* pointers to the current packets of interest */
+integer uv;
+integer xy; /* pointers to the current packets of interest */
integer three_l; /* |tol_step| times the bisection level */
integer appr_t;integer appr_tt; /* best approximations known to the answers */
@@ -11740,16 +11921,16 @@ integer overflow will not occur.
@^overflow in arithmetic@>
@<Initialize for intersections at level zero@>=
-q=link(p); qq=link(pp); mp->bisect_ptr=int_packets;
-u1r=right_x(p)-x_coord(p); u2r=left_x(q)-right_x(p);
-u3r=x_coord(q)-left_x(q); set_min_max(ur_packet);
-v1r=right_y(p)-y_coord(p); v2r=left_y(q)-right_y(p);
-v3r=y_coord(q)-left_y(q); set_min_max(vr_packet);
-x1r=right_x(pp)-x_coord(pp); x2r=left_x(qq)-right_x(pp);
-x3r=x_coord(qq)-left_x(qq); set_min_max(xr_packet);
-y1r=right_y(pp)-y_coord(pp); y2r=left_y(qq)-right_y(pp);
-y3r=y_coord(qq)-left_y(qq); set_min_max(yr_packet);
-mp->delx=x_coord(p)-x_coord(pp); mp->dely=y_coord(p)-y_coord(pp);
+q=mp_link(p); qq=mp_link(pp); mp->bisect_ptr=int_packets;
+u1r=mp_right_x(p)-mp_x_coord(p); u2r=mp_left_x(q)-mp_right_x(p);
+u3r=mp_x_coord(q)-mp_left_x(q); set_min_max(ur_packet);
+v1r=mp_right_y(p)-mp_y_coord(p); v2r=mp_left_y(q)-mp_right_y(p);
+v3r=mp_y_coord(q)-mp_left_y(q); set_min_max(vr_packet);
+x1r=mp_right_x(pp)-mp_x_coord(pp); x2r=mp_left_x(qq)-mp_right_x(pp);
+x3r=mp_x_coord(qq)-mp_left_x(qq); set_min_max(xr_packet);
+y1r=mp_right_y(pp)-mp_y_coord(pp); y2r=mp_left_y(qq)-mp_right_y(pp);
+y3r=mp_y_coord(qq)-mp_left_y(qq); set_min_max(yr_packet);
+mp->delx=mp_x_coord(p)-mp_x_coord(pp); mp->dely=mp_y_coord(p)-mp_y_coord(pp);
mp->tol=0; mp->uv=r_packets; mp->xy=r_packets;
mp->three_l=0; mp->cur_t=1; mp->cur_tt=1
@@ -11827,7 +12008,8 @@ It invokes |cubic_intersection| in lexicographic order until finding a
pair of cubics that intersect. The final intersection times are placed in
|cur_t| and~|cur_tt|.
-@c void mp_path_intersection (MP mp,pointer h, pointer hh) {
+@c
+static void mp_path_intersection (MP mp,pointer h, pointer hh) {
pointer p,pp; /* link registers that traverse the given paths */
integer n,nn; /* integer parts of intersection times, minus |unity| */
@<Change one-point paths into dead cycles@>;
@@ -11835,20 +12017,20 @@ pair of cubics that intersect. The final intersection times are placed in
do {
n=-unity; p=h;
do {
- if ( right_type(p)!=mp_endpoint ) {
+ if ( mp_right_type(p)!=mp_endpoint ) {
nn=-unity; pp=hh;
do {
- if ( right_type(pp)!=mp_endpoint ) {
+ if ( mp_right_type(pp)!=mp_endpoint ) {
mp_cubic_intersection(mp, p,pp);
if ( mp->cur_t>0 ) {
mp->cur_t=mp->cur_t+n; mp->cur_tt=mp->cur_tt+nn;
return;
}
}
- nn=nn+unity; pp=link(pp);
+ nn=nn+unity; pp=mp_link(pp);
} while (pp!=hh);
}
- n=n+unity; p=link(p);
+ n=n+unity; p=mp_link(p);
} while (p!=h);
mp->tol_step=mp->tol_step+3;
} while (mp->tol_step<=3);
@@ -11856,13 +12038,13 @@ pair of cubics that intersect. The final intersection times are placed in
}
@ @<Change one-point paths...@>=
-if ( right_type(h)==mp_endpoint ) {
- right_x(h)=x_coord(h); left_x(h)=x_coord(h);
- right_y(h)=y_coord(h); left_y(h)=y_coord(h); right_type(h)=mp_explicit;
+if ( mp_right_type(h)==mp_endpoint ) {
+ mp_right_x(h)=mp_x_coord(h); mp_left_x(h)=mp_x_coord(h);
+ mp_right_y(h)=mp_y_coord(h); mp_left_y(h)=mp_y_coord(h); mp_right_type(h)=mp_explicit;
}
-if ( right_type(hh)==mp_endpoint ) {
- right_x(hh)=x_coord(hh); left_x(hh)=x_coord(hh);
- right_y(hh)=y_coord(hh); left_y(hh)=y_coord(hh); right_type(hh)=mp_explicit;
+if ( mp_right_type(hh)==mp_endpoint ) {
+ mp_right_x(hh)=mp_x_coord(hh); mp_left_x(hh)=mp_x_coord(hh);
+ mp_right_y(hh)=mp_y_coord(hh); mp_left_y(hh)=mp_y_coord(hh); mp_right_type(hh)=mp_explicit;
}
@* \[24] Dynamic linear equations.
@@ -11916,7 +12098,7 @@ numbers. Diagnosed and patched by Thorsten Dahlheimer.
@d new_indep(A) /* create a new independent variable */
{ if ( mp->serial_no>el_gordo-s_scale )
mp_fatal_error(mp, "variable instance identifiers exhausted");
- type((A))=mp_independent; mp->serial_no=mp->serial_no+s_scale;
+ mp_type((A))=mp_independent; mp->serial_no=mp->serial_no+s_scale;
value((A))=mp->serial_no;
}
@@ -11928,10 +12110,10 @@ integer serial_no; /* the most recent serial number, times |s_scale| */
@ But how are dependency lists represented? It's simple: The linear combination
$\alpha_1v_1+\cdots+\alpha_kv_k+\beta$ appears in |k+1| value nodes. If
|q=dep_list(p)| points to this list, and if |k>0|, then |value(q)=
-@t$\alpha_1$@>| (which is a |fraction|); |info(q)| points to the location
-of $\alpha_1$; and |link(p)| points to the dependency list
+@t$\alpha_1$@>| (which is a |fraction|); |mp_info(q)| points to the location
+of $\alpha_1$; and |mp_link(p)| points to the dependency list
$\alpha_2v_2+\cdots+\alpha_kv_k+\beta$. On the other hand if |k=0|,
-then |value(q)=@t$\beta$@>| (which is |scaled|) and |info(q)=null|.
+then |value(q)=@t$\beta$@>| (which is |scaled|) and |mp_info(q)=null|.
The independent variables $v_1$, \dots,~$v_k$ have been sorted so that
they appear in decreasing order of their |value| fields (i.e., of
their serial numbers). \ (It is convenient to use decreasing order,
@@ -11945,22 +12127,22 @@ called the {\sl final link\/} of the dependency list. \MP\ maintains
a doubly-linked master list of all dependency lists, in terms of a permanently
allocated node
in |mem| called |dep_head|. If there are no dependencies, we have
-|link(dep_head)=dep_head| and |prev_dep(dep_head)=dep_head|;
-otherwise |link(dep_head)| points to the first dependent variable, say~|p|,
+|mp_link(dep_head)=dep_head| and |prev_dep(dep_head)=dep_head|;
+otherwise |mp_link(dep_head)| points to the first dependent variable, say~|p|,
and |prev_dep(p)=dep_head|. We have |type(p)=mp_dependent|, and |dep_list(p)|
points to its dependency list. If the final link of that dependency list
-occurs in location~|q|, then |link(q)| points to the next dependent
+occurs in location~|q|, then |mp_link(q)| points to the next dependent
variable (say~|r|); and we have |prev_dep(r)=q|, etc.
-@d dep_list(A) link(value_loc((A)))
+@d dep_list(A) mp_link(value_loc((A)))
/* half of the |value| field in a |dependent| variable */
-@d prev_dep(A) info(value_loc((A)))
+@d prev_dep(A) mp_info(value_loc((A)))
/* the other half; makes a doubly linked list */
@d dep_node_size 2 /* the number of words per dependency node */
@<Initialize table entries...@>= mp->serial_no=0;
-link(dep_head)=dep_head; prev_dep(dep_head)=dep_head;
-info(dep_head)=null; dep_list(dep_head)=null;
+mp_link(dep_head)=dep_head; prev_dep(dep_head)=dep_head;
+mp_info(dep_head)=null; dep_list(dep_head)=null;
@ Actually the description above contains a little white lie. There's
another kind of variable called |mp_proto_dependent|, which is
@@ -11973,44 +12155,48 @@ nodes reachable from |dep_head|.
The second parameter should be either |dependent| or |mp_proto_dependent|,
to indicate the scaling of the coefficients.
-@<Declare subroutines for printing expressions@>=
-void mp_print_dependency (MP mp,pointer p, small_number t) {
+@<Declarations@>=
+static void mp_print_dependency (MP mp,pointer p, quarterword t);
+
+@ @c
+void mp_print_dependency (MP mp,pointer p, quarterword t) {
integer v; /* a coefficient */
pointer pp,q; /* for list manipulation */
pp=p;
- while (1) {
- v=abs(value(p)); q=info(p);
+ while (true) {
+ v=abs(value(p)); q=mp_info(p);
if ( q==null ) { /* the constant term */
if ( (v!=0)||(p==pp) ) {
- if ( value(p)>0 ) if ( p!=pp ) mp_print_char(mp, '+');
+ if ( value(p)>0 ) if ( p!=pp ) mp_print_char(mp, xord('+'));
mp_print_scaled(mp, value(p));
}
return;
}
@<Print the coefficient, unless it's $\pm1.0$@>;
- if ( type(q)!=mp_independent ) mp_confusion(mp, "dep");
+ if ( mp_type(q)!=mp_independent ) mp_confusion(mp, "dep");
@:this can't happen dep}{\quad dep@>
mp_print_variable_name(mp, q); v=value(q) % s_scale;
while ( v>0 ) { mp_print(mp, "*4"); v=v-2; }
- p=link(p);
+ p=mp_link(p);
}
}
@ @<Print the coefficient, unless it's $\pm1.0$@>=
-if ( value(p)<0 ) mp_print_char(mp, '-');
-else if ( p!=pp ) mp_print_char(mp, '+');
+if ( value(p)<0 ) mp_print_char(mp, xord('-'));
+else if ( p!=pp ) mp_print_char(mp, xord('+'));
if ( t==mp_dependent ) v=mp_round_fraction(mp, v);
if ( v!=unity ) mp_print_scaled(mp, v)
@ The maximum absolute value of a coefficient in a given dependency list
is returned by the following simple function.
-@c fraction mp_max_coef (MP mp,pointer p) {
+@c
+static fraction mp_max_coef (MP mp,pointer p) {
fraction x; /* the maximum so far */
x=0;
- while ( info(p)!=null ) {
+ while ( mp_info(p)!=null ) {
if ( abs(value(p))>x ) x=abs(value(p));
- p=link(p);
+ p=mp_link(p);
}
return x;
}
@@ -12070,20 +12256,20 @@ proto-dependencies.
@d scaled_threshold 8 /* a |scaled| coefficient less than this is zeroed */
@d half_scaled_threshold 4 /* half of |scaled_threshold| */
-@<Declare basic dependency-list subroutines@>=
-pointer mp_p_plus_fq ( MP mp, pointer p, integer f,
- pointer q, small_number t, small_number tt) ;
+@<Declarations@>=
+static pointer mp_p_plus_fq ( MP mp, pointer p, integer f,
+ pointer q, quarterword t, quarterword tt) ;
@ @c
pointer mp_p_plus_fq ( MP mp, pointer p, integer f,
- pointer q, small_number t, small_number tt) {
- pointer pp,qq; /* |info(p)| and |info(q)|, respectively */
+ pointer q, quarterword t, quarterword tt) {
+ pointer pp,qq; /* |mp_info(p)| and |mp_info(q)|, respectively */
pointer r,s; /* for list manipulation */
integer threshold; /* defines a neighborhood of zero */
integer v; /* temporary register */
if ( t==mp_dependent ) threshold=fraction_threshold;
else threshold=scaled_threshold;
- r=temp_head; pp=info(p); qq=info(q);
+ r=temp_head; pp=mp_info(p); qq=mp_info(q);
while (1) {
if ( pp==qq ) {
if ( pp==null ) {
@@ -12095,31 +12281,31 @@ pointer mp_p_plus_fq ( MP mp, pointer p, integer f,
} else if ( value(pp)<value(qq) ) {
@<Contribute a term from |q|, multiplied by~|f|@>
} else {
- link(r)=p; r=p; p=link(p); pp=info(p);
+ mp_link(r)=p; r=p; p=mp_link(p); pp=mp_info(p);
}
}
if ( t==mp_dependent )
value(p)=mp_slow_add(mp, value(p),mp_take_fraction(mp, value(q),f));
else
value(p)=mp_slow_add(mp, value(p),mp_take_scaled(mp, value(q),f));
- link(r)=p; mp->dep_final=p;
- return link(temp_head);
+ mp_link(r)=p; mp->dep_final=p;
+ return mp_link(temp_head);
}
@ @<Contribute a term from |p|, plus |f|...@>=
{
if ( tt==mp_dependent ) v=value(p)+mp_take_fraction(mp, f,value(q));
else v=value(p)+mp_take_scaled(mp, f,value(q));
- value(p)=v; s=p; p=link(p);
+ value(p)=v; s=p; p=mp_link(p);
if ( abs(v)<threshold ) {
mp_free_node(mp, s,dep_node_size);
} else {
if ( (abs(v)>=coef_bound) && mp->watch_coefs ) {
- type(qq)=independent_needing_fix; mp->fix_needed=true;
+ mp_type(qq)=independent_needing_fix; mp->fix_needed=true;
}
- link(r)=s; r=s;
+ mp_link(r)=s; r=s;
};
- pp=info(p); q=link(q); qq=info(q);
+ pp=mp_info(p); q=mp_link(q); qq=mp_info(q);
}
@ @<Contribute a term from |q|, multiplied by~|f|@>=
@@ -12127,27 +12313,28 @@ pointer mp_p_plus_fq ( MP mp, pointer p, integer f,
if ( tt==mp_dependent ) v=mp_take_fraction(mp, f,value(q));
else v=mp_take_scaled(mp, f,value(q));
if ( abs(v)>halfp(threshold) ) {
- s=mp_get_node(mp, dep_node_size); info(s)=qq; value(s)=v;
+ s=mp_get_node(mp, dep_node_size); mp_info(s)=qq; value(s)=v;
if ( (abs(v)>=coef_bound) && mp->watch_coefs ) {
- type(qq)=independent_needing_fix; mp->fix_needed=true;
+ mp_type(qq)=independent_needing_fix; mp->fix_needed=true;
}
- link(r)=s; r=s;
+ mp_link(r)=s; r=s;
}
- q=link(q); qq=info(q);
+ q=mp_link(q); qq=mp_info(q);
}
@ It is convenient to have another subroutine for the special case
of |p_plus_fq| when |f=1.0|. In this routine lists |p| and |q| are
both of the same type~|t| (either |dependent| or |mp_proto_dependent|).
-@c pointer mp_p_plus_q (MP mp,pointer p, pointer q, small_number t) {
- pointer pp,qq; /* |info(p)| and |info(q)|, respectively */
+@c
+static pointer mp_p_plus_q (MP mp,pointer p, pointer q, quarterword t) {
+ pointer pp,qq; /* |mp_info(p)| and |mp_info(q)|, respectively */
pointer r,s; /* for list manipulation */
integer threshold; /* defines a neighborhood of zero */
integer v; /* temporary register */
if ( t==mp_dependent ) threshold=fraction_threshold;
else threshold=scaled_threshold;
- r=temp_head; pp=info(p); qq=info(q);
+ r=temp_head; pp=mp_info(p); qq=mp_info(q);
while (1) {
if ( pp==qq ) {
if ( pp==null ) {
@@ -12158,31 +12345,31 @@ both of the same type~|t| (either |dependent| or |mp_proto_dependent|).
}
} else {
if ( value(pp)<value(qq) ) {
- s=mp_get_node(mp, dep_node_size); info(s)=qq; value(s)=value(q);
- q=link(q); qq=info(q); link(r)=s; r=s;
+ s=mp_get_node(mp, dep_node_size); mp_info(s)=qq; value(s)=value(q);
+ q=mp_link(q); qq=mp_info(q); mp_link(r)=s; r=s;
} else {
- link(r)=p; r=p; p=link(p); pp=info(p);
+ mp_link(r)=p; r=p; p=mp_link(p); pp=mp_info(p);
}
}
}
value(p)=mp_slow_add(mp, value(p),value(q));
- link(r)=p; mp->dep_final=p;
- return link(temp_head);
+ mp_link(r)=p; mp->dep_final=p;
+ return mp_link(temp_head);
}
@ @<Contribute a term from |p|, plus the...@>=
{
v=value(p)+value(q);
- value(p)=v; s=p; p=link(p); pp=info(p);
+ value(p)=v; s=p; p=mp_link(p); pp=mp_info(p);
if ( abs(v)<threshold ) {
mp_free_node(mp, s,dep_node_size);
} else {
if ( (abs(v)>=coef_bound ) && mp->watch_coefs ) {
- type(qq)=independent_needing_fix; mp->fix_needed=true;
+ mp_type(qq)=independent_needing_fix; mp->fix_needed=true;
}
- link(r)=s; r=s;
+ mp_link(r)=s; r=s;
}
- q=link(q); qq=info(q);
+ q=mp_link(q); qq=mp_info(q);
}
@ A somewhat simpler routine will multiply a dependency list
@@ -12193,8 +12380,9 @@ Parameters |t0| and |t1| are the list types before and after;
they should agree unless |t0=mp_dependent| and |t1=mp_proto_dependent|
and |v_is_scaled=true|.
-@c pointer mp_p_times_v (MP mp,pointer p, integer v, small_number t0,
- small_number t1, boolean v_is_scaled) {
+@c
+static pointer mp_p_times_v (MP mp,pointer p, integer v, quarterword t0,
+ quarterword t1, boolean v_is_scaled) {
pointer r,s; /* for list manipulation */
integer w; /* tentative coefficient */
integer threshold;
@@ -12203,34 +12391,34 @@ and |v_is_scaled=true|.
if ( t1==mp_dependent ) threshold=half_fraction_threshold;
else threshold=half_scaled_threshold;
r=temp_head;
- while ( info(p)!=null ) {
+ while ( mp_info(p)!=null ) {
if ( scaling_down ) w=mp_take_fraction(mp, v,value(p));
else w=mp_take_scaled(mp, v,value(p));
if ( abs(w)<=threshold ) {
- s=link(p); mp_free_node(mp, p,dep_node_size); p=s;
+ s=mp_link(p); mp_free_node(mp, p,dep_node_size); p=s;
} else {
if ( abs(w)>=coef_bound ) {
- mp->fix_needed=true; type(info(p))=independent_needing_fix;
+ mp->fix_needed=true; mp_type(mp_info(p))=independent_needing_fix;
}
- link(r)=p; r=p; value(p)=w; p=link(p);
+ mp_link(r)=p; r=p; value(p)=w; p=mp_link(p);
}
}
- link(r)=p;
+ mp_link(r)=p;
if ( v_is_scaled ) value(p)=mp_take_scaled(mp, value(p),v);
else value(p)=mp_take_fraction(mp, value(p),v);
- return link(temp_head);
+ return mp_link(temp_head);
}
@ Similarly, we sometimes need to divide a dependency list
by a given |scaled| constant.
-@<Declare basic dependency-list subroutines@>=
-pointer mp_p_over_v (MP mp,pointer p, scaled v, small_number
- t0, small_number t1) ;
+@<Declarations@>=
+static pointer mp_p_over_v (MP mp,pointer p, scaled v, quarterword
+ t0, quarterword t1) ;
@ @c
-pointer mp_p_over_v (MP mp,pointer p, scaled v, small_number
- t0, small_number t1) {
+pointer mp_p_over_v (MP mp,pointer p, scaled v, quarterword
+ t0, quarterword t1) {
pointer r,s; /* for list manipulation */
integer w; /* tentative coefficient */
integer threshold;
@@ -12239,7 +12427,7 @@ pointer mp_p_over_v (MP mp,pointer p, scaled v, small_number
if ( t1==mp_dependent ) threshold=half_fraction_threshold;
else threshold=half_scaled_threshold;
r=temp_head;
- while ( info( p)!=null ) {
+ while ( mp_info( p)!=null ) {
if ( scaling_down ) {
if ( abs(v)<02000000 ) w=mp_make_scaled(mp, value(p),v*010000);
else w=mp_make_scaled(mp, mp_round_fraction(mp, value(p)),v);
@@ -12247,16 +12435,16 @@ pointer mp_p_over_v (MP mp,pointer p, scaled v, small_number
w=mp_make_scaled(mp, value(p),v);
}
if ( abs(w)<=threshold ) {
- s=link(p); mp_free_node(mp, p,dep_node_size); p=s;
+ s=mp_link(p); mp_free_node(mp, p,dep_node_size); p=s;
} else {
if ( abs(w)>=coef_bound ) {
- mp->fix_needed=true; type(info(p))=independent_needing_fix;
+ mp->fix_needed=true; mp_type(mp_info(p))=independent_needing_fix;
}
- link(r)=p; r=p; value(p)=w; p=link(p);
+ mp_link(r)=p; r=p; value(p)=w; p=mp_link(p);
}
}
- link(r)=p; value(p)=mp_make_scaled(mp, value(p),v);
- return link(temp_head);
+ mp_link(r)=p; value(p)=mp_make_scaled(mp, value(p),v);
+ return mp_link(temp_head);
}
@ Here's another utility routine for dependency lists. When an independent
@@ -12270,36 +12458,37 @@ final link are inherited from~|p|; and the fourth parameter tells whether
or not |p| is |mp_proto_dependent|. However, the global variable |dep_final|
is not altered if |x| does not occur in list~|p|.
-@c pointer mp_p_with_x_becoming_q (MP mp,pointer p,
- pointer x, pointer q, small_number t) {
+@c
+static pointer mp_p_with_x_becoming_q (MP mp,pointer p,
+ pointer x, pointer q, quarterword t) {
pointer r,s; /* for list manipulation */
integer v; /* coefficient of |x| */
integer sx; /* serial number of |x| */
s=p; r=temp_head; sx=value(x);
- while ( value(info(s))>sx ) { r=s; s=link(s); };
- if ( info(s)!=x ) {
+ while ( value(mp_info(s))>sx ) { r=s; s=mp_link(s); };
+ if ( mp_info(s)!=x ) {
return p;
} else {
- link(temp_head)=p; link(r)=link(s); v=value(s);
+ mp_link(temp_head)=p; mp_link(r)=mp_link(s); v=value(s);
mp_free_node(mp, s,dep_node_size);
- return mp_p_plus_fq(mp, link(temp_head),v,q,t,mp_dependent);
+ return mp_p_plus_fq(mp, mp_link(temp_head),v,q,t,mp_dependent);
}
}
@ Here's a simple procedure that reports an error when a variable
has just received a known value that's out of the required range.
-@<Declare basic dependency-list subroutines@>=
-void mp_val_too_big (MP mp,scaled x) ;
+@<Declarations@>=
+static void mp_val_too_big (MP mp,scaled x) ;
@ @c void mp_val_too_big (MP mp,scaled x) {
if ( mp->internal[mp_warning_check]>0 ) {
- print_err("Value is too large ("); mp_print_scaled(mp, x); mp_print_char(mp, ')');
+ print_err("Value is too large ("); mp_print_scaled(mp, x); mp_print_char(mp, xord(')'));
@.Value is too large@>
- help4("The equation I just processed has given some variable")
- ("a value of 4096 or more. Continue and I'll try to cope")
- ("with that big value; but it might be dangerous.")
- ("(Set warningcheck:=0 to suppress this message.)");
+ help4("The equation I just processed has given some variable",
+ "a value of 4096 or more. Continue and I'll try to cope",
+ "with that big value; but it might be dangerous.",
+ "(Set warningcheck:=0 to suppress this message.)");
mp_error(mp);
}
}
@@ -12308,20 +12497,20 @@ void mp_val_too_big (MP mp,scaled x) ;
removes its dependency list. Here |p| points to the variable, and
|q| points to the dependency list (which is one node long).
-@<Declare basic dependency-list subroutines@>=
-void mp_make_known (MP mp,pointer p, pointer q) ;
+@<Declarations@>=
+static void mp_make_known (MP mp,pointer p, pointer q) ;
@ @c void mp_make_known (MP mp,pointer p, pointer q) {
int t; /* the previous type */
- prev_dep(link(q))=prev_dep(p);
- link(prev_dep(p))=link(q); t=type(p);
- type(p)=mp_known; value(p)=value(q); mp_free_node(mp, q,dep_node_size);
+ prev_dep(mp_link(q))=prev_dep(p);
+ mp_link(prev_dep(p))=mp_link(q); t=mp_type(p);
+ mp_type(p)=mp_known; value(p)=value(q); mp_free_node(mp, q,dep_node_size);
if ( abs(value(p))>=fraction_one ) mp_val_too_big(mp, value(p));
if (( mp->internal[mp_tracing_equations]>0) && mp_interesting(mp, p) ) {
mp_begin_diagnostic(mp); mp_print_nl(mp, "#### ");
@:]]]\#\#\#\#_}{\.{\#\#\#\#}@>
mp_print_variable_name(mp, p);
- mp_print_char(mp, '='); mp_print_scaled(mp, value(p));
+ mp_print_char(mp, xord('=')); mp_print_scaled(mp, value(p));
mp_end_diagnostic(mp, false);
}
if (( mp->cur_exp==p ) && mp->cur_type==t ) {
@@ -12337,23 +12526,24 @@ whose coefficients must be divided by~4.
In unusual cases, this fixup process might reduce one or more coefficients
to zero, so that a variable will become known more or less by default.
-@<Declare basic dependency-list subroutines@>=
-void mp_fix_dependencies (MP mp);
+@<Declarations@>=
+static void mp_fix_dependencies (MP mp);
-@ @c void mp_fix_dependencies (MP mp) {
+@ @c
+static void mp_fix_dependencies (MP mp) {
pointer p,q,r,s,t; /* list manipulation registers */
pointer x; /* an independent variable */
- r=link(dep_head); s=null;
+ r=mp_link(dep_head); s=null;
while ( r!=dep_head ){
t=r;
@<Run through the dependency list for variable |t|, fixing
all nodes, and ending with final link~|q|@>;
- r=link(q);
+ r=mp_link(q);
if ( q==dep_list(t) ) mp_make_known(mp, t,q);
}
while ( s!=null ) {
- p=link(s); x=info(s); free_avail(s); s=p;
- type(x)=mp_independent; value(x)=value(x)+2;
+ p=mp_link(s); x=mp_info(s); free_avail(s); s=p;
+ mp_type(x)=mp_independent; value(x)=value(x)+2;
}
mp->fix_needed=false;
}
@@ -12361,18 +12551,18 @@ void mp_fix_dependencies (MP mp);
@ @d independent_being_fixed 1 /* this variable already appears in |s| */
@<Run through the dependency list for variable |t|...@>=
-r=value_loc(t); /* |link(r)=dep_list(t)| */
+r=value_loc(t); /* |mp_link(r)=dep_list(t)| */
while (1) {
- q=link(r); x=info(q);
+ q=mp_link(r); x=mp_info(q);
if ( x==null ) break;
- if ( type(x)<=independent_being_fixed ) {
- if ( type(x)<independent_being_fixed ) {
- p=mp_get_avail(mp); link(p)=s; s=p;
- info(s)=x; type(x)=independent_being_fixed;
+ if ( mp_type(x)<=independent_being_fixed ) {
+ if ( mp_type(x)<independent_being_fixed ) {
+ p=mp_get_avail(mp); mp_link(p)=s; s=p;
+ mp_info(s)=x; mp_type(x)=independent_being_fixed;
}
value(q)=value(q) / 4;
if ( value(q)==0 ) {
- link(r)=link(q); mp_free_node(mp, q,dep_node_size); q=r;
+ mp_link(r)=mp_link(q); mp_free_node(mp, q,dep_node_size); q=r;
}
}
r=q;
@@ -12383,20 +12573,21 @@ while (1) {
linking it into the list of all known dependencies. We assume that
|dep_final| points to the final node of list~|p|.
-@c void mp_new_dep (MP mp,pointer q, pointer p) {
+@c
+static void mp_new_dep (MP mp,pointer q, pointer p) {
pointer r; /* what used to be the first dependency */
dep_list(q)=p; prev_dep(q)=dep_head;
- r=link(dep_head); link(mp->dep_final)=r; prev_dep(r)=mp->dep_final;
- link(dep_head)=q;
+ r=mp_link(dep_head); mp_link(mp->dep_final)=r; prev_dep(r)=mp->dep_final;
+ mp_link(dep_head)=q;
}
@ Here is one of the ways a dependency list gets started.
The |const_dependency| routine produces a list that has nothing but
a constant term.
-@c pointer mp_const_dependency (MP mp, scaled v) {
+@c static pointer mp_const_dependency (MP mp, scaled v) {
mp->dep_final=mp_get_node(mp, dep_node_size);
- value(mp->dep_final)=v; info(mp->dep_final)=null;
+ value(mp->dep_final)=v; mp_info(mp->dep_final)=null;
return mp->dep_final;
}
@@ -12411,7 +12602,8 @@ often that we can't refer to it with a nonzero coefficient,
recognized by testing that the returned list pointer is equal to
|dep_final|.
-@c pointer mp_single_dependency (MP mp,pointer p) {
+@c
+static pointer mp_single_dependency (MP mp,pointer p) {
pointer q; /* the new dependency list */
integer m; /* the number of doublings */
m=value(p) % s_scale;
@@ -12419,22 +12611,23 @@ recognized by testing that the returned list pointer is equal to
return mp_const_dependency(mp, 0);
} else {
q=mp_get_node(mp, dep_node_size);
- value(q)=two_to_the(28-m); info(q)=p;
- link(q)=mp_const_dependency(mp, 0);
+ value(q)=(integer)two_to_the(28-m); mp_info(q)=p;
+ mp_link(q)=mp_const_dependency(mp, 0);
return q;
}
}
@ We sometimes need to make an exact copy of a dependency list.
-@c pointer mp_copy_dep_list (MP mp,pointer p) {
+@c
+static pointer mp_copy_dep_list (MP mp,pointer p) {
pointer q; /* the new dependency list */
q=mp_get_node(mp, dep_node_size); mp->dep_final=q;
while (1) {
- info(mp->dep_final)=info(p); value(mp->dep_final)=value(p);
- if ( info(mp->dep_final)==null ) break;
- link(mp->dep_final)=mp_get_node(mp, dep_node_size);
- mp->dep_final=link(mp->dep_final); p=link(p);
+ mp_info(mp->dep_final)=mp_info(p); value(mp->dep_final)=value(p);
+ if ( mp_info(mp->dep_final)==null ) break;
+ mp_link(mp->dep_final)=mp_get_node(mp, dep_node_size);
+ mp->dep_final=mp_link(mp->dep_final); p=mp_link(p);
}
return q;
}
@@ -12449,7 +12642,8 @@ thereby possibly making other dependent variables known.
The given list |p| is, of course, totally destroyed by all this processing.
-@c void mp_linear_eq (MP mp, pointer p, small_number t) {
+@c
+static void mp_linear_eq (MP mp, pointer p, quarterword t) {
pointer q,r,s; /* for link manipulation */
pointer x; /* the variable that loses its independence */
integer n; /* the number of times |x| had been halved */
@@ -12458,7 +12652,7 @@ The given list |p| is, of course, totally destroyed by all this processing.
pointer final_node; /* the constant term of the new dependency list */
integer w; /* a tentative coefficient */
@<Find a node |q| in list |p| whose coefficient |v| is largest@>;
- x=info(q); n=value(x) % s_scale;
+ x=mp_info(q); n=value(x) % s_scale;
@<Divide list |p| by |-v|, removing node |q|@>;
if ( mp->internal[mp_tracing_equations]>0 ) {
@<Display the new dependency@>;
@@ -12469,10 +12663,10 @@ The given list |p| is, of course, totally destroyed by all this processing.
}
@ @<Find a node |q| in list |p| whose coefficient |v| is largest@>=
-q=p; r=link(p); v=value(q);
-while ( info(r)!=null ) {
+q=p; r=mp_link(p); v=value(q);
+while ( mp_info(r)!=null ) {
if ( abs(value(r))>abs(v) ) { q=r; v=value(r); };
- r=link(r);
+ r=mp_link(r);
}
@ Here we want to change the coefficients from |scaled| to |fraction|,
@@ -12480,26 +12674,26 @@ except in the constant term. In the common case of a trivial equation
like `\.{x=3.14}', we will have |v=-fraction_one|, |q=p|, and |t=mp_dependent|.
@<Divide list |p| by |-v|, removing node |q|@>=
-s=temp_head; link(s)=p; r=p;
+s=temp_head; mp_link(s)=p; r=p;
do {
if ( r==q ) {
- link(s)=link(r); mp_free_node(mp, r,dep_node_size);
+ mp_link(s)=mp_link(r); mp_free_node(mp, r,dep_node_size);
} else {
w=mp_make_fraction(mp, value(r),v);
if ( abs(w)<=half_fraction_threshold ) {
- link(s)=link(r); mp_free_node(mp, r,dep_node_size);
+ mp_link(s)=mp_link(r); mp_free_node(mp, r,dep_node_size);
} else {
value(r)=-w; s=r;
}
}
- r=link(s);
-} while (info(r)!=null);
+ r=mp_link(s);
+} while (mp_info(r)!=null);
if ( t==mp_proto_dependent ) {
value(r)=-mp_make_scaled(mp, value(r),v);
} else if ( v!=-fraction_one ) {
value(r)=-mp_make_fraction(mp, value(r),v);
}
-final_node=r; p=link(temp_head)
+final_node=r; p=mp_link(temp_head)
@ @<Display the new dependency@>=
if ( mp_interesting(mp, x) ) {
@@ -12508,28 +12702,28 @@ if ( mp_interesting(mp, x) ) {
@:]]]\#\#_}{\.{\#\#}@>
w=n;
while ( w>0 ) { mp_print(mp, "*4"); w=w-2; };
- mp_print_char(mp, '='); mp_print_dependency(mp, p,mp_dependent);
+ mp_print_char(mp, xord('=')); mp_print_dependency(mp, p,mp_dependent);
mp_end_diagnostic(mp, false);
}
@ @<Simplify all existing dependencies by substituting for |x|@>=
-prev_r=dep_head; r=link(dep_head);
+prev_r=dep_head; r=mp_link(dep_head);
while ( r!=dep_head ) {
- s=dep_list(r); q=mp_p_with_x_becoming_q(mp, s,x,p,type(r));
- if ( info(q)==null ) {
+ s=dep_list(r); q=mp_p_with_x_becoming_q(mp, s,x,p,mp_type(r));
+ if ( mp_info(q)==null ) {
mp_make_known(mp, r,q);
} else {
dep_list(r)=q;
- do { q=link(q); } while (info(q)!=null);
+ do { q=mp_link(q); } while (mp_info(q)!=null);
prev_r=q;
}
- r=link(prev_r);
+ r=mp_link(prev_r);
}
@ @<Change variable |x| from |independent| to |dependent| or |known|@>=
if ( n>0 ) @<Divide list |p| by $2^n$@>;
-if ( info(p)==null ) {
- type(x)=mp_known;
+if ( mp_info(p)==null ) {
+ mp_type(x)=mp_known;
value(x)=value(p);
if ( abs(value(x))>=fraction_one ) mp_val_too_big(mp, value(x));
mp_free_node(mp, p,dep_node_size);
@@ -12538,32 +12732,32 @@ if ( info(p)==null ) {
mp_free_node(mp, x,value_node_size);
}
} else {
- type(x)=mp_dependent; mp->dep_final=final_node; mp_new_dep(mp, x,p);
+ mp_type(x)=mp_dependent; mp->dep_final=final_node; mp_new_dep(mp, x,p);
if ( mp->cur_exp==x ) if ( mp->cur_type==mp_independent ) mp->cur_type=mp_dependent;
}
@ @<Divide list |p| by $2^n$@>=
{
- s=temp_head; link(temp_head)=p; r=p;
+ s=temp_head; mp_link(temp_head)=p; r=p;
do {
if ( n>30 ) w=0;
else w=value(r) / two_to_the(n);
- if ( (abs(w)<=half_fraction_threshold)&&(info(r)!=null) ) {
- link(s)=link(r);
+ if ( (abs(w)<=half_fraction_threshold)&&(mp_info(r)!=null) ) {
+ mp_link(s)=mp_link(r);
mp_free_node(mp, r,dep_node_size);
} else {
value(r)=w; s=r;
}
- r=link(s);
- } while (info(s)!=null);
- p=link(temp_head);
+ r=mp_link(s);
+ } while (mp_info(s)!=null);
+ p=mp_link(temp_head);
}
@ The |check_mem| procedure, which is used only when \MP\ is being
debugged, makes sure that the current dependency lists are well formed.
@<Check the list of linear dependencies@>=
-q=dep_head; p=link(q);
+q=dep_head; p=mp_link(q);
while ( p!=dep_head ) {
if ( prev_dep(p)!=q ) {
mp_print_nl(mp, "Bad PREVDEP at "); mp_print_int(mp, p);
@@ -12571,9 +12765,9 @@ while ( p!=dep_head ) {
}
p=dep_list(p);
while (1) {
- r=info(p); q=p; p=link(q);
+ r=mp_info(p); q=p; p=mp_link(q);
if ( r==null ) break;
- if ( value(info(p))>=value(r) ) {
+ if ( value(mp_info(p))>=value(r) ) {
mp_print_nl(mp, "Out of order at "); mp_print_int(mp, p);
@.Out of order...@>
}
@@ -12609,10 +12803,11 @@ lots of memory space.
@ The following procedure is called when a capsule node is being
added to a ring (e.g., when an unknown variable is mentioned in an expression).
-@c pointer mp_new_ring_entry (MP mp,pointer p) {
+@c
+static pointer mp_new_ring_entry (MP mp,pointer p) {
pointer q; /* the new capsule node */
- q=mp_get_node(mp, value_node_size); name_type(q)=mp_capsule;
- type(q)=type(p);
+ q=mp_get_node(mp, value_node_size); mp_name_type(q)=mp_capsule;
+ mp_type(q)=mp_type(p);
if ( value(p)==null ) value(q)=p; else value(q)=value(p);
value(p)=q;
return q;
@@ -12622,7 +12817,10 @@ added to a ring (e.g., when an unknown variable is mentioned in an expression).
The following procedure simply detaches a quantity from its ring,
without recycling the storage.
-@<Declare the recycling subroutines@>=
+@<Declarations@>=
+static void mp_ring_delete (MP mp,pointer p);
+
+@ @c
void mp_ring_delete (MP mp,pointer p) {
pointer q;
q=value(p);
@@ -12639,13 +12837,14 @@ propagation of values.
If the parameter |flush_p| is |true|, node |p| itself needn't receive a
value, it will soon be recycled.
-@c void mp_nonlinear_eq (MP mp,integer v, pointer p, boolean flush_p) {
- small_number t; /* the type of ring |p| */
+@c
+static void mp_nonlinear_eq (MP mp,integer v, pointer p, boolean flush_p) {
+ quarterword t; /* the type of ring |p| */
pointer q,r; /* link manipulation registers */
- t=type(p)-unknown_tag; q=value(p);
- if ( flush_p ) type(p)=mp_vacuous; else p=q;
+ t=mp_type(p)-unknown_tag; q=value(p);
+ if ( flush_p ) mp_type(p)=mp_vacuous; else p=q;
do {
- r=value(q); type(q)=t;
+ r=value(q); mp_type(q)=t;
switch (t) {
case mp_boolean_type: value(q)=v; break;
case mp_string_type: value(q)=v; add_str_ref(v); break;
@@ -12660,7 +12859,8 @@ value, it will soon be recycled.
@ If two members of rings are equated, and if they have the same type,
the |ring_merge| procedure is called on to make them equivalent.
-@c void mp_ring_merge (MP mp,pointer p, pointer q) {
+@c
+static void mp_ring_merge (MP mp,pointer p, pointer q) {
pointer r; /* traverses one list */
r=value(p);
while ( r!=p ) {
@@ -12677,8 +12877,8 @@ the |ring_merge| procedure is called on to make them equivalent.
{
print_err("Redundant equation");
@.Redundant equation@>
- help2("I already knew that this equation was true.")
- ("But perhaps no harm has been done; let's continue.");
+ help2("I already knew that this equation was true.",
+ "But perhaps no harm has been done; let's continue.");
mp_put_get_error(mp);
}
@@ -12725,7 +12925,7 @@ input mechanism. These stacks record the current state of an implicitly
recursive process, but the |get_next| procedure is not recursive.
@<Glob...@>=
-eight_bits cur_cmd; /* current command set by |get_next| */
+integer cur_cmd; /* current command set by |get_next| */
integer cur_mod; /* operand of current command */
halfword cur_sym; /* hash address of current symbol */
@@ -12737,7 +12937,10 @@ routine that enters a \MP\ primitive into |hash| and |eqtb|. Therefore almost
all of this procedure appears elsewhere in the program, together with the
corresponding |primitive| calls.
-@<Declare the procedure called |print_cmd_mod|@>=
+@<Declarations@>=
+static void mp_print_cmd_mod (MP mp,integer c, integer m) ;
+
+@ @c
void mp_print_cmd_mod (MP mp,integer c, integer m) {
switch (c) {
@<Cases of |print_cmd_mod| for symbolic printing of primitives@>
@@ -12751,9 +12954,9 @@ user's transcript file.
@d show_cur_cmd_mod mp_show_cmd_mod(mp, mp->cur_cmd,mp->cur_mod)
@c
-void mp_show_cmd_mod (MP mp,integer c, integer m) {
+static void mp_show_cmd_mod (MP mp,integer c, integer m) {
mp_begin_diagnostic(mp); mp_print_nl(mp, "{");
- mp_print_cmd_mod(mp, c,m); mp_print_char(mp, '}');
+ mp_print_cmd_mod(mp, c,m); mp_print_char(mp, xord('}'));
mp_end_diagnostic(mp, false);
}
@@ -12788,7 +12991,7 @@ xfree(mp->input_stack);
in our discussion of basic input-output routines. The other components of
|cur_input| are defined in the same way:
-@d index mp->cur_input.index_field /* reference for buffer information */
+@d iindex mp->cur_input.index_field /* reference for buffer information */
@d start mp->cur_input.start_field /* starting position in |buffer| */
@d limit mp->cur_input.limit_field /* end of current line in |buffer| */
@d name mp->cur_input.name_field /* name of the current file */
@@ -12866,14 +13069,14 @@ by analogy with |line_stack|.
@^system dependencies@>
@d terminal_input (name==is_term) /* are we reading from the terminal? */
-@d cur_file mp->input_file[index] /* the current |void *| variable */
-@d line mp->line_stack[index] /* current line number in the current source file */
-@d in_name mp->iname_stack[index] /* a string used to construct \.{MPX} file names */
-@d in_area mp->iarea_stack[index] /* another string for naming \.{MPX} files */
+@d cur_file mp->input_file[iindex] /* the current |void *| variable */
+@d line mp->line_stack[iindex] /* current line number in the current source file */
+@d in_name mp->iname_stack[iindex] /* a string used to construct \.{MPX} file names */
+@d in_area mp->iarea_stack[iindex] /* another string for naming \.{MPX} files */
@d absent 1 /* |name_field| value for unused |mpx_in_stack| entries */
-@d mpx_reading (mp->mpx_name[index]>absent)
+@d mpx_reading (mp->mpx_name[iindex]>absent)
/* when reading a file, is it an \.{MPX} file? */
-@d finished 0
+@d mpx_finished 0
/* |name_field| value when the corresponding \.{MPX} file is finished */
@<Glob...@>=
@@ -12917,7 +13120,7 @@ xfree(mp->mpx_name);
@ However, all this discussion about input state really applies only to the
case that we are inputting from a file. There is another important case,
namely when we are currently getting input from a token list. In this case
-|index>max_in_open|, and the conventions about the other state variables
+|iindex>max_in_open|, and the conventions about the other state variables
are different:
\yskip\hang|loc| is a pointer to the current node in the token list, i.e.,
@@ -12928,7 +13131,7 @@ fully read.
may or may not contain a reference count, depending on the type of token
list involved.
-\yskip\hang|token_type|, which takes the place of |index| in the
+\yskip\hang|token_type|, which takes the place of |iindex| in the
discussion above, is a code number that explains what kind of token list
is being scanned.
@@ -12966,9 +13169,9 @@ The token list begins with a reference count if and only if |token_type=
macro|.
@^reference counts@>
-@d token_type index /* type of current token list */
-@d token_state (index>(int)mp->max_in_open) /* are we scanning a token list? */
-@d file_state (index<=(int)mp->max_in_open) /* are we scanning a file line? */
+@d token_type iindex /* type of current token list */
+@d token_state (iindex>(int)mp->max_in_open) /* are we scanning a token list? */
+@d file_state (iindex<=(int)mp->max_in_open) /* are we scanning a file line? */
@d param_start limit /* base of macro parameters in |param_stack| */
@d forever_text (mp->max_in_open+1) /* |token_type| code for loop texts */
@d loop_text (mp->max_in_open+2) /* |token_type| code for loop texts */
@@ -12993,13 +13196,16 @@ mp->param_stack = xmalloc((mp->param_size+1),sizeof(pointer));
xfree(mp->param_stack);
@ Notice that the |line| isn't valid when |token_state| is true because it
-depends on |index|. If we really need to know the line number for the
-topmost file in the index stack we use the following function. If a page
+depends on |iindex|. If we really need to know the line number for the
+topmost file in the iindex stack we use the following function. If a page
number or other information is needed, this routine should be modified to
compute it as well.
@^system dependencies@>
-@<Declare a function called |true_line|@>=
+@<Declarations@>=
+static integer mp_true_line (MP mp) ;
+
+@ @c
integer mp_true_line (MP mp) {
int k; /* an index into the input stack */
if ( file_state && (name>max_spec_src) ) {
@@ -13034,7 +13240,7 @@ at most |error_line|. Non-current input levels whose |token_type| is
`|backed_up|' are shown only if they have not been fully read.
@c void mp_show_context (MP mp) { /* prints where the scanner is */
- int old_setting; /* saved |selector| setting */
+ unsigned old_setting; /* saved |selector| setting */
@<Local variables for formatting calculations@>
mp->file_ptr=mp->input_ptr; mp->input_stack[mp->file_ptr]=mp->cur_input;
/* store current state */
@@ -13081,7 +13287,7 @@ if ( name>max_spec_src ) {
} else {
mp_print_nl(mp, "<read>");
}
-mp_print_char(mp, ' ')
+mp_print_char(mp, xord(' '))
@ Can't use case statement here because the |token_type| is not
a constant expression.
@@ -13119,7 +13325,7 @@ the |link| field in a capsule parameter is |void| and that
@<Print the current loop value@>=
{ mp_print_nl(mp, "<for("); p=mp->param_stack[param_start];
if ( p!=null ) {
- if ( link(p)==mp_void ) mp_print_exp(mp, p,0); /* we're in a \&{for} loop */
+ if ( mp_link(p)==mp_void ) mp_print_exp(mp, p,0); /* we're in a \&{for} loop */
else mp_show_token_list(mp, p,null,20,mp->tally);
}
mp_print(mp, ")> ");
@@ -13135,10 +13341,10 @@ together, we get the macro's full name.
mp_show_token_list(mp, mp->param_stack[param_start+1],null,20,mp->tally);
} else {
q=p;
- while ( link(q)!=null ) q=link(q);
- link(q)=mp->param_stack[param_start+1];
+ while ( mp_link(q)!=null ) q=mp_link(q);
+ mp_link(q)=mp->param_stack[param_start+1];
mp_show_token_list(mp, p,null,20,mp->tally);
- link(q)=null;
+ mp_link(q)=null;
}
}
@@ -13211,7 +13417,7 @@ for (q=p;q<=mp->first_count-1;q++) {
}
mp_print_ln(mp);
for (q=1;q<=n;q++) {
- mp_print_char(mp, ' '); /* print |n| spaces to begin line~2 */
+ mp_print_char(mp, xord(' ')); /* print |n| spaces to begin line~2 */
}
if ( m+n<=mp->error_line ) p=mp->first_count+m;
else p=mp->first_count+(mp->error_line-n-3);
@@ -13253,7 +13459,7 @@ new level (having, initially, the same properties as the old).
if ( mp->input_ptr>mp->max_in_stack ) {
mp->max_in_stack=mp->input_ptr;
if ( mp->input_ptr==mp->stack_size ) {
- int l = (mp->stack_size+(mp->stack_size>>2));
+ int l = (mp->stack_size+(mp->stack_size/4));
XREALLOC(mp->input_stack, l, in_state_record);
mp->stack_size = l;
}
@@ -13274,7 +13480,8 @@ set |name|, reset~|loc|, and increase the macro's reference count.
@d back_list(A) mp_begin_token_list(mp, (A),backed_up) /* backs up a simple token list */
-@c void mp_begin_token_list (MP mp,pointer p, quarterword t) {
+@c
+static void mp_begin_token_list (MP mp,pointer p, quarterword t) {
push_input; start=p; token_type=t;
param_start=mp->param_ptr; loc=p;
}
@@ -13283,7 +13490,8 @@ set |name|, reset~|loc|, and increase the macro's reference count.
should be done as we leave that level of input.
@^inner loop@>
-@c void mp_end_token_list (MP mp) { /* leave a token-list input level */
+@c
+static void mp_end_token_list (MP mp) { /* leave a token-list input level */
pointer p; /* temporary register */
if ( token_type>=backed_up ) { /* token list to be deleted */
if ( token_type<=inserted ) {
@@ -13296,7 +13504,7 @@ should be done as we leave that level of input.
decr(mp->param_ptr);
p=mp->param_stack[mp->param_ptr];
if ( p!=null ) {
- if ( link(p)==mp_void ) { /* it's an \&{expr} parameter */
+ if ( mp_link(p)==mp_void ) { /* it's an \&{expr} parameter */
mp_recycle_value(mp, p); mp_free_node(mp, p,value_node_size);
} else {
mp_flush_token_list(mp, p); /* it's a \&{suffix} or \&{text} parameter */
@@ -13312,23 +13520,23 @@ token by the |cur_tok| routine.
@^inner loop@>
@c @<Declare the procedure called |make_exp_copy|@>
-pointer mp_cur_tok (MP mp) {
+static pointer mp_cur_tok (MP mp) {
pointer p; /* a new token node */
- small_number save_type; /* |cur_type| to be restored */
+ quarterword save_type; /* |cur_type| to be restored */
integer save_exp; /* |cur_exp| to be restored */
if ( mp->cur_sym==0 ) {
if ( mp->cur_cmd==capsule_token ) {
save_type=mp->cur_type; save_exp=mp->cur_exp;
- mp_make_exp_copy(mp, mp->cur_mod); p=mp_stash_cur_exp(mp); link(p)=null;
+ mp_make_exp_copy(mp, mp->cur_mod); p=mp_stash_cur_exp(mp); mp_link(p)=null;
mp->cur_type=save_type; mp->cur_exp=save_exp;
} else {
p=mp_get_node(mp, token_node_size);
- value(p)=mp->cur_mod; name_type(p)=mp_token;
- if ( mp->cur_cmd==numeric_token ) type(p)=mp_known;
- else type(p)=mp_string_type;
+ value(p)=mp->cur_mod; mp_name_type(p)=mp_token;
+ if ( mp->cur_cmd==numeric_token ) mp_type(p)=mp_known;
+ else mp_type(p)=mp_string_type;
}
} else {
- fast_get_avail(p); info(p)=mp->cur_sym;
+ fast_get_avail(p); mp_info(p)=mp->cur_sym;
}
return p;
}
@@ -13339,7 +13547,7 @@ just scanned back into the input stream, ready to be read again.
If |cur_sym<>0|, the values of |cur_cmd| and |cur_mod| are irrelevant.
@<Declarations@>=
-void mp_back_input (MP mp);
+static void mp_back_input (MP mp);
@ @c void mp_back_input (MP mp) {/* undoes one token of input */
pointer p; /* a token list of length one */
@@ -13353,16 +13561,12 @@ void mp_back_input (MP mp);
offending token just before issuing an error message. We disable interrupts
during the call of |back_input| so that the help message won't be lost.
-@<Declarations@>=
-void mp_error (MP mp);
-void mp_back_error (MP mp);
-
-@ @c void mp_back_error (MP mp) { /* back up one token and call |error| */
+@ @c static void mp_back_error (MP mp) { /* back up one token and call |error| */
mp->OK_to_interrupt=false;
mp_back_input(mp);
mp->OK_to_interrupt=true; mp_error(mp);
}
-void mp_ins_error (MP mp) { /* back up one inserted token and call |error| */
+static void mp_ins_error (MP mp) { /* back up one inserted token and call |error| */
mp->OK_to_interrupt=false;
mp_back_input(mp); token_type=inserted;
mp->OK_to_interrupt=true; mp_error(mp);
@@ -13379,10 +13583,10 @@ or |limit| or |line|.
mp_overflow(mp, "text input levels",mp->max_in_open);
@:MetaPost capacity exceeded text input levels}{\quad text input levels@>
if ( mp->first==mp->buf_size )
- mp_reallocate_buffer(mp,(mp->buf_size+(mp->buf_size>>2)));
- incr(mp->in_open); push_input; index=mp->in_open;
- mp->mpx_name[index]=absent;
- start=mp->first;
+ mp_reallocate_buffer(mp,(mp->buf_size+(mp->buf_size/4)));
+ incr(mp->in_open); push_input; iindex=mp->in_open;
+ mp->mpx_name[iindex]=absent;
+ start=(halfword)mp->first;
name=is_term; /* |terminal_input| is now |true| */
}
@@ -13390,8 +13594,8 @@ or |limit| or |line|.
is finished. Any associated \.{MPX} file must also be closed and popped
off the file stack.
-@c void mp_end_file_reading (MP mp) {
- if ( mp->in_open>index ) {
+@c static void mp_end_file_reading (MP mp) {
+ if ( mp->in_open>iindex ) {
if ( (mp->mpx_name[mp->in_open]==absent)||(name<=max_spec_src) ) {
mp_confusion(mp, "endinput");
@:this can't happen endinput}{\quad endinput@>
@@ -13401,8 +13605,8 @@ off the file stack.
decr(mp->in_open);
}
}
- mp->first=start;
- if ( index!=mp->in_open ) mp_confusion(mp, "endinput");
+ mp->first=(size_t)start;
+ if ( iindex!=mp->in_open ) mp_confusion(mp, "endinput");
if ( name>max_spec_src ) {
(mp->close_file)(mp,cur_file);
delete_str_ref(name);
@@ -13416,16 +13620,16 @@ off the file stack.
associated with the current input file. It returns |false| if this doesn't
work.
-@c boolean mp_begin_mpx_reading (MP mp) {
- if ( mp->in_open!=index+1 ) {
+@c static boolean mp_begin_mpx_reading (MP mp) {
+ if ( mp->in_open!=iindex+1 ) {
return false;
} else {
if ( mp->mpx_name[mp->in_open]<=absent ) mp_confusion(mp, "mpx");
@:this can't happen mpx}{\quad mpx@>
if ( mp->first==mp->buf_size )
- mp_reallocate_buffer(mp,(mp->buf_size+(mp->buf_size>>2)));
- push_input; index=mp->in_open;
- start=mp->first;
+ mp_reallocate_buffer(mp,(mp->buf_size+(mp->buf_size/4)));
+ push_input; iindex=mp->in_open;
+ start=(halfword)mp->first;
name=mp->mpx_name[mp->in_open]; add_str_ref(name);
@<Put an empty line in the input buffer@>;
return true;
@@ -13434,13 +13638,13 @@ work.
@ This procedure temporarily stops reading an \.{MPX} file.
-@c void mp_end_mpx_reading (MP mp) {
- if ( mp->in_open!=index ) mp_confusion(mp, "mpx");
+@c static void mp_end_mpx_reading (MP mp) {
+ if ( mp->in_open!=iindex ) mp_confusion(mp, "mpx");
@:this can't happen mpx}{\quad mpx@>
if ( loc<limit ) {
@<Complain that we are not at the end of a line in the \.{MPX} file@>;
}
- mp->first=start;
+ mp->first=(size_t)start;
pop_input;
}
@@ -13451,10 +13655,10 @@ by an auxiliary program called \.{DVItoMP}.
@ @<Complain that we are not at the end of a line in the \.{MPX} file@>=
{
print_err("`mpxbreak' must be at the end of a line");
-help4("This file contains picture expressions for btex...etex")
- ("blocks. Such files are normally generated automatically")
- ("but this one seems to be messed up. I'm going to ignore")
- ("the rest of this line.");
+help4("This file contains picture expressions for btex...etex",
+ "blocks. Such files are normally generated automatically",
+ "but this one seems to be messed up. I'm going to ignore",
+ "the rest of this line.");
mp_error(mp);
}
@@ -13476,11 +13680,11 @@ actions.
mp->in_open=0; mp->open_parens=0; mp->max_buf_stack=0;
mp->param_ptr=0; mp->max_param_stack=0;
mp->first=1;
- start=1; index=0; line=0; name=is_term;
+ start=1; iindex=0; line=0; name=is_term;
mp->mpx_name[0]=absent;
mp->force_eof=false;
if ( ! mp_init_terminal(mp) ) mp_jump_out(mp);
- limit=mp->last; mp->first=mp->last+1;
+ limit=(halfword)mp->last; mp->first=mp->last+1;
/* |init_terminal| has set |loc| and |last| */
}
@@ -13533,7 +13737,8 @@ is called when an `\&{outer}' symbolic token has been scanned or
when the end of a file has been reached. These two cases are distinguished
by |cur_sym|, which is zero at the end of a file.
-@c boolean mp_check_outer_validity (MP mp) {
+@c
+static boolean mp_check_outer_validity (MP mp) {
pointer p; /* points to inserted token list */
if ( mp->scanner_status==normal ) {
return true;
@@ -13549,9 +13754,9 @@ by |cur_sym|, which is zero at the end of a file.
print_err("Incomplete if; all text was ignored after line ");
@.Incomplete if...@>
mp_print_int(mp, mp->warning_info);
- help3("A forbidden `outer' token occurred in skipped text.")
- ("This kind of error happens when you say `if...' and forget")
- ("the matching `fi'. I've inserted a `fi'; this might work.");
+ help3("A forbidden `outer' token occurred in skipped text.",
+ "This kind of error happens when you say `if...' and forget",
+ "the matching `fi'. I've inserted a `fi'; this might work.");
if ( mp->cur_sym==0 )
mp->help_line[2]="The file ended while I was skipping conditional text.";
mp->cur_sym=frozen_fi; mp_ins_error(mp);
@@ -13568,8 +13773,8 @@ if ( mp->cur_sym!=0 ) {
mp->deletions_allowed=false;
print_err("TeX mode didn't end; all text was ignored after line ");
mp_print_int(mp, mp->warning_info);
- help2("The file ended while I was looking for the `etex' to")
- ("finish this TeX material. I've inserted `etex' now.");
+ help2("The file ended while I was looking for the `etex' to",
+ "finish this TeX material. I've inserted `etex' now.");
mp->cur_sym = frozen_etex;
mp_ins_error(mp);
mp->deletions_allowed=true;
@@ -13578,7 +13783,7 @@ if ( mp->cur_sym!=0 ) {
@ @<Back up an outer symbolic token so that it can be reread@>=
if ( mp->cur_sym!=0 ) {
- p=mp_get_avail(mp); info(p)=mp->cur_sym;
+ p=mp_get_avail(mp); mp_info(p)=mp->cur_sym;
back_list(p); /* prepare to read the symbolic token again */
}
@@ -13593,10 +13798,10 @@ if ( mp->cur_sym!=0 ) {
@.Forbidden token found...@>
}
mp_print(mp, " while scanning ");
- help4("I suspect you have forgotten an `enddef',")
- ("causing me to read past where you wanted me to stop.")
- ("I'll try to recover; but if the error is serious,")
- ("you'd better type `E' or `X' now and fix your file.");
+ help4("I suspect you have forgotten an `enddef',",
+ "causing me to read past where you wanted me to stop.",
+ "I'll try to recover; but if the error is serious,",
+ "you'd better type `E' or `X' now and fix your file.");
switch (mp->scanner_status) {
@<Complete the error message,
and set |cur_sym| to a token that might help recover from the error@>
@@ -13644,7 +13849,10 @@ case loop_defining:
@ The |runaway| procedure displays the first part of the text that occurred
when \MP\ began its special |scanner_status|, if that text has been saved.
-@<Declare the procedure called |runaway|@>=
+@<Declarations@>=
+static void mp_runaway (MP mp) ;
+
+@ @c
void mp_runaway (MP mp) {
if ( mp->scanner_status>flushing ) {
mp_print_nl(mp, "Runaway ");
@@ -13655,14 +13863,14 @@ void mp_runaway (MP mp) {
case loop_defining: mp_print(mp, "loop?"); break;
} /* there are no other cases */
mp_print_ln(mp);
- mp_show_token_list(mp, link(hold_head),null,mp->error_line-10,0);
+ mp_show_token_list(mp, mp_link(hold_head),null,mp->error_line-10,0);
}
}
@ We need to mention a procedure that may be called by |get_next|.
@<Declarations@>=
-void mp_firm_up_the_line (MP mp);
+static void mp_firm_up_the_line (MP mp);
@ And now we're ready to take the plunge into |get_next| itself.
Note that the behavior depends on the |scanner_status| because percent signs
@@ -13681,7 +13889,7 @@ void mp_get_next (MP mp) {
/* go here at crucial stages when scanning a number */
int k; /* an index into |buffer| */
ASCII_code c; /* the current character in the buffer */
- ASCII_code class; /* its class number */
+ int class; /* its class number */
integer n,f; /* registers for decimal-to-binary conversion */
RESTART:
mp->cur_sym=0;
@@ -13774,8 +13982,8 @@ FOUND:
{
print_err("Text line contains an invalid character");
@.Text line contains...@>
- help2("A funny symbol that I can\'t read has just been input.")
- ("Continue, and I'll forget that it ever happened.");
+ help2("A funny symbol that I can\'t read has just been input.",
+ "Continue, and I'll forget that it ever happened.");
mp->deletions_allowed=false; mp_error(mp); mp->deletions_allowed=true;
goto RESTART;
}
@@ -13783,9 +13991,9 @@ FOUND:
@ @<Get a string token and |return|@>=
{
if ( mp->buffer[loc]=='"' ) {
- mp->cur_mod=rts("");
+ mp->cur_mod=null_str;
} else {
- k=loc; mp->buffer[limit+1]='"';
+ k=loc; mp->buffer[limit+1]=xord('"');
do {
incr(loc);
} while (mp->buffer[loc]!='"');
@@ -13815,9 +14023,9 @@ because the |clear_for_error_prompt| routine might have reinstated
loc=limit; /* the next character to be read on this line will be |"%"| */
print_err("Incomplete string token has been flushed");
@.Incomplete string token...@>
- help3("Strings should finish on the same line as they began.")
- ("I've deleted the partial string; you might want to")
- ("insert another by typing, e.g., `I\"new string\"'.");
+ help3("Strings should finish on the same line as they began.",
+ "I've deleted the partial string; you might want to",
+ "insert another by typing, e.g., `I\"new string\"'.");
mp->deletions_allowed=false; mp_error(mp);
mp->deletions_allowed=true;
goto RESTART;
@@ -13855,8 +14063,8 @@ if ( n<32768 ) {
} else if ( mp->scanner_status!=tex_flushing ) {
print_err("Enormous number has been reduced");
@.Enormous number...@>
- help2("I can\'t handle numbers bigger than 32767.99998;")
- ("so I've changed your constant to that maximum amount.");
+ help2("I can\'t handle numbers bigger than 32767.99998;",
+ "so I've changed your constant to that maximum amount.");
mp->deletions_allowed=false; mp_error(mp); mp->deletions_allowed=true;
mp->cur_mod=el_gordo;
}
@@ -13870,10 +14078,10 @@ mp->cur_cmd=numeric_token; return
(mp->scanner_status!=tex_flushing) ) {
print_err("Number is too large (");
mp_print_scaled(mp, mp->cur_mod);
- mp_print_char(mp, ')');
- help3("It is at least 4096. Continue and I'll try to cope")
- ("with that big value; but it might be dangerous.")
- ("(Set warningcheck:=0 to suppress this message.)");
+ mp_print_char(mp, xord(')'));
+ help3("It is at least 4096. Continue and I'll try to cope",
+ "with that big value; but it might be dangerous.",
+ "(Set warningcheck:=0 to suppress this message.)");
mp_error(mp);
}
}
@@ -13884,7 +14092,7 @@ mp->cur_cmd=numeric_token; return
@<Input from token list;...@>=
if ( loc>=mp->hi_mem_min ) { /* one-word token */
- mp->cur_sym=info(loc); loc=link(loc); /* move to next */
+ mp->cur_sym=mp_info(loc); loc=mp_link(loc); /* move to next */
if ( mp->cur_sym>=expr_base ) {
if ( mp->cur_sym>=suffix_base ) {
@<Insert a suffix or text parameter and |goto restart|@>;
@@ -13912,9 +14120,9 @@ if ( loc>=mp->hi_mem_min ) { /* one-word token */
@ @<Get a stored numeric or string or capsule token...@>=
{
- if ( name_type(loc)==mp_token ) {
+ if ( mp_name_type(loc)==mp_token ) {
mp->cur_mod=value(loc);
- if ( type(loc)==mp_known ) {
+ if ( mp_type(loc)==mp_known ) {
mp->cur_cmd=numeric_token;
} else {
mp->cur_cmd=string_token; add_str_ref(mp->cur_mod);
@@ -13922,14 +14130,14 @@ if ( loc>=mp->hi_mem_min ) { /* one-word token */
} else {
mp->cur_mod=loc; mp->cur_cmd=capsule_token;
};
- loc=link(loc); return;
+ loc=mp_link(loc); return;
}
@ All of the easy branches of |get_next| have now been taken care of.
There is one more branch.
@<Move to next line of file, or |goto restart|...@>=
-if ( name>max_spec_src ) {
+if ( name>max_spec_src) {
@<Read next line of file into |buffer|, or
|goto restart| if the file has ended@>;
} else {
@@ -13937,21 +14145,22 @@ if ( name>max_spec_src ) {
/* text was inserted during error recovery or by \&{scantokens} */
mp_end_file_reading(mp); goto RESTART; /* resume previous level */
}
- if ( mp->selector<log_only || mp->selector>=write_file) mp_open_log_file(mp);
+ if (mp->job_name == NULL && ( mp->selector<log_only || mp->selector>=write_file))
+ mp_open_log_file(mp);
if ( mp->interaction>mp_nonstop_mode ) {
if ( limit==start ) /* previous line was empty */
mp_print_nl(mp, "(Please type a command or say `end')");
@.Please type...@>
- mp_print_ln(mp); mp->first=start;
+ mp_print_ln(mp); mp->first=(size_t)start;
prompt_input("*"); /* input on-line into |buffer| */
@.*\relax@>
- limit=mp->last; mp->buffer[limit]='%';
- mp->first=limit+1; loc=start;
+ limit=(halfword)mp->last; mp->buffer[limit]=xord('%');
+ mp->first=(size_t)(limit+1); loc=start;
} else {
mp_fatal_error(mp, "*** (job aborted, no legal end found)");
@.job aborted@>
/* nonstop mode, which is intended for overnight batch processing,
- never waits for on-line input */
+ never waits for on-line input */
}
}
@@ -13968,7 +14177,7 @@ when an error condition causes us to |goto restart| without calling
@<Read next line of file into |buffer|, or
|goto restart| if the file has ended@>=
{
- incr(line); mp->first=start;
+ incr(line); mp->first=(size_t)start;
if ( ! mp->force_eof ) {
if ( mp_input_ln(mp, cur_file ) ) /* not end of file */
mp_firm_up_the_line(mp); /* this sets |limit| */
@@ -13982,14 +14191,14 @@ when an error condition causes us to |goto restart| without calling
@<Complain that the \.{MPX} file ended unexpectly; then set
|cur_sym:=frozen_mpx_break| and |goto comon_ending|@>;
} else {
- mp_print_char(mp, ')'); decr(mp->open_parens);
+ mp_print_char(mp, xord(')')); decr(mp->open_parens);
update_terminal; /* show user that file has been read */
mp_end_file_reading(mp); /* resume previous level */
if ( mp_check_outer_validity(mp) ) goto RESTART;
else goto RESTART;
}
}
- mp->buffer[limit]='%'; mp->first=limit+1; loc=start; /* ready to read */
+ mp->buffer[limit]=xord('%'); mp->first=(size_t)(limit+1); loc=start; /* ready to read */
}
@ We should never actually come to the end of an \.{MPX} file because such
@@ -13998,12 +14207,12 @@ files should have an \&{mpxbreak} after the translation of the last
@<Complain that the \.{MPX} file ended unexpectly; then set...@>=
{
- mp->mpx_name[index]=finished;
+ mp->mpx_name[iindex]=mpx_finished;
print_err("mpx file ended unexpectedly");
- help4("The file had too few picture expressions for btex...etex")
- ("blocks. Such files are normally generated automatically")
- ("but this one got messed up. You might want to insert a")
- ("picture expression now.");
+ help4("The file had too few picture expressions for btex...etex",
+ "blocks. Such files are normally generated automatically",
+ "but this one got messed up. You might want to insert a",
+ "picture expression now.");
mp->deletions_allowed=false; mp_error(mp); mp->deletions_allowed=true;
mp->cur_sym=frozen_mpx_break; goto COMMON_ENDING;
}
@@ -14012,8 +14221,9 @@ files should have an \&{mpxbreak} after the translation of the last
without really doing so.
@<Put an empty line in the input buffer@>=
-mp->last=mp->first; limit=mp->last; /* simulate |input_ln| and |firm_up_the_line| */
-mp->buffer[limit]='%'; mp->first=limit+1; loc=start
+mp->last=mp->first; limit=(halfword)mp->last;
+ /* simulate |input_ln| and |firm_up_the_line| */
+mp->buffer[limit]=xord('%'); mp->first=(size_t)(limit+1); loc=start
@ If the user has set the |mp_pausing| parameter to some positive value,
and if nonstop mode has not been selected, each line of input is displayed
@@ -14025,21 +14235,23 @@ used instead of the line in the file.
@c void mp_firm_up_the_line (MP mp) {
size_t k; /* an index into |buffer| */
- limit=mp->last;
- if ( mp->internal[mp_pausing]>0) if ( mp->interaction>mp_nonstop_mode ) {
+ limit=(halfword)mp->last;
+ if ((!mp->noninteractive)
+ && (mp->internal[mp_pausing]>0 )
+ && (mp->interaction>mp_nonstop_mode )) {
wake_up_terminal; mp_print_ln(mp);
if ( start<limit ) {
- for (k=(size_t)start;k<=(size_t)(limit-1);k++) {
+ for (k=(size_t)start;k<(size_t)limit;k++) {
mp_print_str(mp, mp->buffer[k]);
}
}
- mp->first=limit; prompt_input("=>"); /* wait for user response */
+ mp->first=(size_t)limit; prompt_input("=>"); /* wait for user response */
@.=>@>
if ( mp->last>mp->first ) {
- for (k=mp->first;k<=mp->last-1;k++) { /* move line down in buffer */
+ for (k=mp->first;k<mp->last;k++) { /* move line down in buffer */
mp->buffer[k+start-mp->first]=mp->buffer[k];
}
- limit=start+mp->last-mp->first;
+ limit=(halfword)(start+mp->last-mp->first);
}
}
}
@@ -14084,15 +14296,15 @@ is encountered.
@d get_t_next {mp_get_next(mp); if ( mp->cur_cmd<=max_pre_command ) mp_t_next(mp); }
@<Declarations@>=
-void mp_start_mpx_input (MP mp);
+static void mp_start_mpx_input (MP mp);
@ @c
-void mp_t_next (MP mp) {
+static void mp_t_next (MP mp) {
int old_status; /* saves the |scanner_status| */
integer old_info; /* saves the |warning_info| */
while ( mp->cur_cmd<=max_pre_command ) {
if ( mp->cur_cmd==mpx_break ) {
- if ( ! file_state || (mp->mpx_name[index]==absent) ) {
+ if ( ! file_state || (mp->mpx_name[iindex]==absent) ) {
@<Complain about a misplaced \&{mpxbreak}@>;
} else {
mp_end_mpx_reading(mp);
@@ -14104,7 +14316,7 @@ void mp_t_next (MP mp) {
} else if ( mpx_reading ) {
@<Complain that \.{MPX} files cannot contain \TeX\ material@>;
} else if ( (mp->cur_mod!=verbatim_code)&&
- (mp->mpx_name[index]!=finished) ) {
+ (mp->mpx_name[iindex]!=mpx_finished) ) {
if ( ! mp_begin_mpx_reading(mp) ) mp_start_mpx_input(mp);
} else {
goto TEX_FLUSH;
@@ -14135,25 +14347,25 @@ mp->warning_info=old_info
@ @<Complain that \.{MPX} files cannot contain \TeX\ material@>=
{ print_err("An mpx file cannot contain btex or verbatimtex blocks");
-help4("This file contains picture expressions for btex...etex")
- ("blocks. Such files are normally generated automatically")
- ("but this one seems to be messed up. I'll just keep going")
- ("and hope for the best.");
+help4("This file contains picture expressions for btex...etex",
+ "blocks. Such files are normally generated automatically",
+ "but this one seems to be messed up. I'll just keep going",
+ "and hope for the best.");
mp_error(mp);
}
@ @<Complain that we are not reading a file@>=
{ print_err("You can only use `btex' or `verbatimtex' in a file");
-help3("I'll have to ignore this preprocessor command because it")
- ("only works when there is a file to preprocess. You might")
- ("want to delete everything up to the next `etex`.");
+help3("I'll have to ignore this preprocessor command because it",
+ "only works when there is a file to preprocess. You might",
+ "want to delete everything up to the next `etex`.");
mp_error(mp);
}
@ @<Complain about a misplaced \&{mpxbreak}@>=
{ print_err("Misplaced mpxbreak");
-help2("I'll ignore this preprocessor command because it")
- ("doesn't belong here");
+help2("I'll ignore this preprocessor command because it",
+ "doesn't belong here");
mp_error(mp);
}
@@ -14247,12 +14459,12 @@ And the final parameter tells how many of the special operations
When such parameters are present, they are called \.{(SUFFIX0)},
\.{(SUFFIX1)}, and \.{(SUFFIX2)}.
-@c pointer mp_scan_toks (MP mp,command_code terminator, pointer
- subst_list, pointer tail_end, small_number suffix_count) {
+@c static pointer mp_scan_toks (MP mp,command_code terminator, pointer
+ subst_list, pointer tail_end, quarterword suffix_count) {
pointer p; /* tail of the token list being built */
pointer q; /* temporary for link management */
integer balance; /* left delimiters minus right delimiters */
- p=hold_head; balance=1; link(hold_head)=null;
+ p=hold_head; balance=1; mp_link(hold_head)=null;
while (1) {
get_t_next;
if ( mp->cur_sym>0 ) {
@@ -14263,20 +14475,20 @@ When such parameters are present, they are called \.{(SUFFIX0)},
@<Handle quoted symbols, \.{\#\AT!}, \.{\AT!}, or \.{\AT!\#}@>;
}
}
- link(p)=mp_cur_tok(mp); p=link(p);
+ mp_link(p)=mp_cur_tok(mp); p=mp_link(p);
}
- link(p)=tail_end; mp_flush_node_list(mp, subst_list);
- return link(hold_head);
+ mp_link(p)=tail_end; mp_flush_node_list(mp, subst_list);
+ return mp_link(hold_head);
}
@ @<Substitute for |cur_sym|...@>=
{
q=subst_list;
while ( q!=null ) {
- if ( info(q)==mp->cur_sym ) {
+ if ( mp_info(q)==mp->cur_sym ) {
mp->cur_sym=value(q); mp->cur_cmd=relax; break;
}
- q=link(q);
+ q=mp_link(q);
}
}
@@ -14312,7 +14524,7 @@ mp_primitive(mp, "@@#",macro_special,macro_suffix);
case macro_special:
switch (m) {
case macro_prefix: mp_print(mp, "#@@"); break;
- case macro_at: mp_print_char(mp, '@@'); break;
+ case macro_at: mp_print_char(mp, xord('@@')); break;
case macro_suffix: mp_print(mp, "@@#"); break;
default: mp_print(mp, "quote"); break;
}
@@ -14330,15 +14542,15 @@ the user's token is unredefinable, the `|frozen_inaccessible|' token is
substituted; the latter is redefinable but essentially impossible to use,
hence \MP's tables won't get fouled up.
-@c void mp_get_symbol (MP mp) { /* sets |cur_sym| to a safe symbol */
+@c static void mp_get_symbol (MP mp) { /* sets |cur_sym| to a safe symbol */
RESTART:
get_t_next;
- if ( (mp->cur_sym==0)||(mp->cur_sym>frozen_inaccessible) ) {
+ if ( (mp->cur_sym==0)||(mp->cur_sym>(integer)frozen_inaccessible) ) {
print_err("Missing symbolic token inserted");
@.Missing symbolic token...@>
- help3("Sorry: You can\'t redefine a number, string, or expr.")
- ("I've inserted an inaccessible symbol so that your")
- ("definition will be completed without mixing me up too badly.");
+ help3("Sorry: You can\'t redefine a number, string, or expr.",
+ "I've inserted an inaccessible symbol so that your",
+ "definition will be completed without mixing me up too badly.");
if ( mp->cur_sym>0 )
mp->help_line[2]="Sorry: You can\'t redefine my error-recovery tokens.";
else if ( mp->cur_cmd==string_token )
@@ -14351,22 +14563,22 @@ RESTART:
former value, if it was a variable. The following stronger version of
|get_symbol| does that.
-@c void mp_get_clear_symbol (MP mp) {
+@c static void mp_get_clear_symbol (MP mp) {
mp_get_symbol(mp); mp_clear_symbol(mp, mp->cur_sym,false);
}
@ Here's another little subroutine; it checks that an equals sign
or assignment sign comes along at the proper place in a macro definition.
-@c void mp_check_equals (MP mp) {
+@c static void mp_check_equals (MP mp) {
if ( mp->cur_cmd!=equals ) if ( mp->cur_cmd!=assignment ) {
mp_missing_err(mp, "=");
@.Missing `='@>
- help5("The next thing in this `def' should have been `=',")
- ("because I've already looked at the definition heading.")
- ("But don't worry; I'll pretend that an equals sign")
- ("was present. Everything from here to `enddef'")
- ("will be the replacement text of this macro.");
+ help5("The next thing in this `def' should have been `=',",
+ "because I've already looked at the definition heading.",
+ "But don't worry; I'll pretend that an equals sign",
+ "was present. Everything from here to `enddef'",
+ "will be the replacement text of this macro.");
mp_back_error(mp);
}
}
@@ -14376,19 +14588,19 @@ handled now that we have |scan_toks|. In this case there are
two parameters, which will be \.{EXPR0} and \.{EXPR1} (i.e.,
|expr_base| and |expr_base+1|).
-@c void mp_make_op_def (MP mp) {
+@c static void mp_make_op_def (MP mp) {
command_code m; /* the type of definition */
pointer p,q,r; /* for list manipulation */
m=mp->cur_mod;
mp_get_symbol(mp); q=mp_get_node(mp, token_node_size);
- info(q)=mp->cur_sym; value(q)=expr_base;
+ mp_info(q)=mp->cur_sym; value(q)=expr_base;
mp_get_clear_symbol(mp); mp->warning_info=mp->cur_sym;
mp_get_symbol(mp); p=mp_get_node(mp, token_node_size);
- info(p)=mp->cur_sym; value(p)=expr_base+1; link(p)=q;
+ mp_info(p)=mp->cur_sym; value(p)=expr_base+1; mp_link(p)=q;
get_t_next; mp_check_equals(mp);
mp->scanner_status=op_defining; q=mp_get_avail(mp); ref_count(q)=null;
- r=mp_get_avail(mp); link(q)=r; info(r)=general_macro;
- link(r)=mp_scan_toks(mp, macro_def,p,null,0);
+ r=mp_get_avail(mp); mp_link(q)=r; mp_info(r)=general_macro;
+ mp_link(r)=mp_scan_toks(mp, macro_def,p,null,0);
mp->scanner_status=normal; eq_type(mp->warning_info)=m;
equiv(mp->warning_info)=q; mp_get_x_next(mp);
}
@@ -14429,9 +14641,8 @@ case param_type:
and \&{vardef}. When the following procedure is called, |cur_mod|
should be either |start_def| or |var_def|.
-@c @<Declare the procedure called |check_delimiter|@>
-@<Declare the function called |scan_declared_variable|@>
-void mp_scan_def (MP mp) {
+@c
+static void mp_scan_def (MP mp) {
int m; /* the type of definition */
int n; /* the number of special suffix parameters */
int k; /* the total number of parameters */
@@ -14441,7 +14652,7 @@ void mp_scan_def (MP mp) {
pointer p; /* temporary storage */
halfword base; /* |expr_base|, |suffix_base|, or |text_base| */
pointer l_delim,r_delim; /* matching delimiters */
- m=mp->cur_mod; c=general_macro; link(hold_head)=null;
+ m=mp->cur_mod; c=general_macro; mp_link(hold_head)=null;
q=mp_get_avail(mp); ref_count(q)=null; r=null;
@<Scan the token or variable to be defined;
set |n|, |scanner_status|, and |warning_info|@>;
@@ -14453,7 +14664,7 @@ void mp_scan_def (MP mp) {
@<Absorb undelimited parameters, putting them into list |r|@>;
}
mp_check_equals(mp);
- p=mp_get_avail(mp); info(p)=c; link(q)=p;
+ p=mp_get_avail(mp); mp_info(p)=c; mp_link(q)=p;
@<Attach the replacement text to the tail of node |p|@>;
mp->scanner_status=normal; mp_get_x_next(mp);
}
@@ -14463,11 +14674,11 @@ a \&{vardef}, because the user may want to redefine `\.{endgroup}'.
@<Attach the replacement text to the tail of node |p|@>=
if ( m==start_def ) {
- link(p)=mp_scan_toks(mp, macro_def,r,null,n);
+ mp_link(p)=mp_scan_toks(mp, macro_def,r,null,n);
} else {
- q=mp_get_avail(mp); info(q)=mp->bg_loc; link(p)=q;
- p=mp_get_avail(mp); info(p)=mp->eg_loc;
- link(q)=mp_scan_toks(mp, macro_def,r,p,n);
+ q=mp_get_avail(mp); mp_info(q)=mp->bg_loc; mp_link(p)=q;
+ p=mp_get_avail(mp); mp_info(p)=mp->eg_loc;
+ mp_link(q)=mp_scan_toks(mp, macro_def,r,p,n);
}
if ( mp->warning_info==bad_vardef )
mp_flush_token_list(mp, value(bad_vardef))
@@ -14483,27 +14694,27 @@ if ( m==start_def ) {
eq_type(mp->warning_info)=defined_macro; equiv(mp->warning_info)=q;
} else {
p=mp_scan_declared_variable(mp);
- mp_flush_variable(mp, equiv(info(p)),link(p),true);
+ mp_flush_variable(mp, equiv(mp_info(p)),mp_link(p),true);
mp->warning_info=mp_find_variable(mp, p); mp_flush_list(mp, p);
if ( mp->warning_info==null ) @<Change to `\.{a bad variable}'@>;
mp->scanner_status=var_defining; n=2;
if ( mp->cur_cmd==macro_special ) if ( mp->cur_mod==macro_suffix ) {/* \.{\AT!\#} */
n=3; get_t_next;
}
- type(mp->warning_info)=mp_unsuffixed_macro-2+n; value(mp->warning_info)=q;
+ mp_type(mp->warning_info)=mp_unsuffixed_macro-2+n; value(mp->warning_info)=q;
} /* |mp_suffixed_macro=mp_unsuffixed_macro+1| */
@ @<Change to `\.{a bad variable}'@>=
{
print_err("This variable already starts with a macro");
@.This variable already...@>
- help2("After `vardef a' you can\'t say `vardef a.b'.")
- ("So I'll have to discard this definition.");
+ help2("After `vardef a' you can\'t say `vardef a.b'.",
+ "So I'll have to discard this definition.");
mp_error(mp); mp->warning_info=bad_vardef;
}
@ @<Initialize table entries...@>=
-name_type(bad_vardef)=mp_root; link(bad_vardef)=frozen_bad_vardef;
+mp_name_type(bad_vardef)=mp_root; mp_link(bad_vardef)=frozen_bad_vardef;
equiv(frozen_bad_vardef)=bad_vardef; eq_type(frozen_bad_vardef)=tag_token;
@ @<Absorb delimited parameters, putting them into lists |q| and |r|@>=
@@ -14524,12 +14735,12 @@ do {
@ @<Absorb parameter tokens for type |base|@>=
do {
- link(q)=mp_get_avail(mp); q=link(q); info(q)=base+k;
+ mp_link(q)=mp_get_avail(mp); q=mp_link(q); mp_info(q)=base+k;
mp_get_symbol(mp); p=mp_get_node(mp, token_node_size);
- value(p)=base+k; info(p)=mp->cur_sym;
+ value(p)=base+k; mp_info(p)=mp->cur_sym;
if ( k==mp->param_size ) mp_overflow(mp, "parameter stack size",mp->param_size);
@:MetaPost capacity exceeded parameter stack size}{\quad parameter stack size@>
- incr(k); link(p)=r; r=p; get_t_next;
+ incr(k); mp_link(p)=r; r=p; get_t_next;
} while (mp->cur_cmd==comma)
@ @<Absorb undelimited parameters, putting them into list |r|@>=
@@ -14544,12 +14755,12 @@ do {
else c=text_macro;
}
if ( k==mp->param_size ) mp_overflow(mp, "parameter stack size",mp->param_size);
- incr(k); mp_get_symbol(mp); info(p)=mp->cur_sym; link(p)=r; r=p; get_t_next;
+ incr(k); mp_get_symbol(mp); mp_info(p)=mp->cur_sym; mp_link(p)=r; r=p; get_t_next;
if ( c==expr_macro ) if ( mp->cur_cmd==of_token ) {
c=of_macro; p=mp_get_node(mp, token_node_size);
if ( k==mp->param_size ) mp_overflow(mp, "parameter stack size",mp->param_size);
- value(p)=expr_base+k; mp_get_symbol(mp); info(p)=mp->cur_sym;
- link(p)=r; r=p; get_t_next;
+ value(p)=expr_base+k; mp_get_symbol(mp); mp_info(p)=mp->cur_sym;
+ mp_link(p)=r; r=p; get_t_next;
}
}
@@ -14576,24 +14787,24 @@ procedures at this point, and to insert some other procedures
that will be invoked by |get_x_next|.
@<Declarations@>=
-void mp_scan_primary (MP mp);
-void mp_scan_secondary (MP mp);
-void mp_scan_tertiary (MP mp);
-void mp_scan_expression (MP mp);
-void mp_scan_suffix (MP mp);
-@<Declare the procedure called |macro_call|@>
-void mp_get_boolean (MP mp);
-void mp_pass_text (MP mp);
-void mp_conditional (MP mp);
-void mp_start_input (MP mp);
-void mp_begin_iteration (MP mp);
-void mp_resume_iteration (MP mp);
-void mp_stop_iteration (MP mp);
+static void mp_scan_primary (MP mp);
+static void mp_scan_secondary (MP mp);
+static void mp_scan_tertiary (MP mp);
+static void mp_scan_expression (MP mp);
+static void mp_scan_suffix (MP mp);
+static void mp_get_boolean (MP mp);
+static void mp_pass_text (MP mp);
+static void mp_conditional (MP mp);
+static void mp_start_input (MP mp);
+static void mp_begin_iteration (MP mp);
+static void mp_resume_iteration (MP mp);
+static void mp_stop_iteration (MP mp);
@ An auxiliary subroutine called |expand| is used by |get_x_next|
when it has to do exotic expansion commands.
-@c void mp_expand (MP mp) {
+@c
+static void mp_expand (MP mp) {
pointer p; /* for list manipulation */
size_t k; /* something that we hope is |<=buf_size| */
pool_pointer j; /* index into |str_pool| */
@@ -14641,8 +14852,8 @@ when it has to do exotic expansion commands.
{
print_err("Extra `endfor'");
@.Extra `endfor'@>
- help2("I'm not currently working on a for loop,")
- ("so I had better not try to end anything.");
+ help2("I'm not currently working on a for loop,",
+ "so I had better not try to end anything.");
mp_error(mp);
}
@@ -14675,8 +14886,8 @@ that will be |null| if no loop is in progress.
if ( mp->loop_ptr==null ) {
print_err("Lost loop");
@.Lost loop@>
- help2("I'm confused; after exiting from a loop, I still seem")
- ("to want to repeat it. I'll try to forget the problem.");
+ help2("I'm confused; after exiting from a loop, I still seem",
+ "to want to repeat it. I'll try to forget the problem.");
mp_error(mp);
} else {
mp_resume_iteration(mp); /* this procedure is in Part 37 below */
@@ -14699,8 +14910,8 @@ that will be |null| if no loop is in progress.
} else if ( mp->cur_cmd!=semicolon ) {
mp_missing_err(mp, ";");
@.Missing `;'@>
- help2("After `exitif <boolean exp>' I expect to see a semicolon.")
- ("I shall pretend that one was there."); mp_back_error(mp);
+ help2("After `exitif <boolean exp>' I expect to see a semicolon.",
+ "I shall pretend that one was there."); mp_back_error(mp);
}
}
@@ -14717,7 +14928,7 @@ is less than |loop_text|.
mp_end_token_list(mp);
}
} while (p==null);
- if ( p!=info(mp->loop_ptr) ) mp_fatal_error(mp, "*** (loop confusion)");
+ if ( p!=mp_info(mp->loop_ptr) ) mp_fatal_error(mp, "*** (loop confusion)");
@.loop confusion@>
mp_stop_iteration(mp); /* this procedure is in Part 34 below */
}
@@ -14735,8 +14946,8 @@ is less than |loop_text|.
if ( mp->cur_type!=mp_string_type ) {
mp_disp_err(mp, null,"Not a string");
@.Not a string@>
- help2("I'm going to flush this expression, since")
- ("scantokens should be followed by a known string.");
+ help2("I'm going to flush this expression, since",
+ "scantokens should be followed by a known string.");
mp_put_get_flush_error(mp, 0);
} else {
mp_back_input(mp);
@@ -14750,15 +14961,15 @@ is less than |loop_text|.
k=mp->first+length(mp->cur_exp);
if ( k>=mp->max_buf_stack ) {
while ( k>=mp->buf_size ) {
- mp_reallocate_buffer(mp,(mp->buf_size+(mp->buf_size>>2)));
+ mp_reallocate_buffer(mp,(mp->buf_size+(mp->buf_size/4)));
}
mp->max_buf_stack=k+1;
}
- j=mp->str_start[mp->cur_exp]; limit=k;
+ j=mp->str_start[mp->cur_exp]; limit=(halfword)k;
while ( mp->first<(size_t)limit ) {
mp->buffer[mp->first]=mp->str_pool[j]; incr(j); incr(mp->first);
}
- mp->buffer[limit]='%'; mp->first=limit+1; loc=start;
+ mp->buffer[limit]=xord('%'); mp->first=(size_t)(limit+1); loc=start;
mp_flush_cur_exp(mp, 0);
}
@@ -14771,7 +14982,7 @@ macros are being expanded.
@^inner loop@>
@<Declarations@>=
-void mp_get_x_next (MP mp);
+static void mp_get_x_next (MP mp);
@ @c void mp_get_x_next (MP mp) {
pointer save_exp; /* a capsule to save |cur_type| and |cur_exp| */
@@ -14804,8 +15015,8 @@ second parameter.
What is this second parameter? It's simply a linked list of one-word items,
whose |info| fields point to the arguments. In other words, if |arg_list=null|,
-no arguments have been scanned yet; otherwise |info(arg_list)| points to
-the first scanned argument, and |link(arg_list)| points to the list of
+no arguments have been scanned yet; otherwise |mp_info(arg_list)| points to
+the first scanned argument, and |mp_link(arg_list)| points to the list of
further arguments (if any).
Arguments of type \&{expr} are so-called capsules, which we will
@@ -14820,11 +15031,8 @@ are being acquired.) Then the macro body is fed to the scanner; i.e.,
the replacement text of the macro is placed at the top of the \MP's
input stack, so that |get_t_next| will proceed to read it next.
-@<Declare the procedure called |macro_call|@>=
-@<Declare the procedure called |print_macro_name|@>
-@<Declare the procedure called |print_arg|@>
-@<Declare the procedure called |scan_text_arg|@>
-void mp_macro_call (MP mp,pointer def_ref, pointer arg_list,
+@<Declarations@>=
+static void mp_macro_call (MP mp,pointer def_ref, pointer arg_list,
pointer macro_name) ;
@ @c
@@ -14836,7 +15044,7 @@ void mp_macro_call (MP mp,pointer def_ref, pointer arg_list,
integer n; /* the number of arguments */
pointer tail = 0; /* tail of the argument list */
pointer l_delim=0,r_delim=0; /* a delimiter pair */
- r=link(def_ref); add_mac_ref(def_ref);
+ r=mp_link(def_ref); add_mac_ref(def_ref);
if ( arg_list==null ) {
n=0;
} else {
@@ -14859,16 +15067,16 @@ mp_show_macro(mp, def_ref,null,100000);
if ( arg_list!=null ) {
n=0; p=arg_list;
do {
- q=info(p);
+ q=mp_info(p);
mp_print_arg(mp, q,n,0);
- incr(n); p=link(p);
+ incr(n); p=mp_link(p);
} while (p!=null);
}
mp_end_diagnostic(mp, false)
-@ @<Declare the procedure called |print_macro_name|@>=
-void mp_print_macro_name (MP mp,pointer a, pointer n);
+@ @<Declarations@>=
+static void mp_print_macro_name (MP mp,pointer a, pointer n);
@ @c
void mp_print_macro_name (MP mp,pointer a, pointer n) {
@@ -14876,62 +15084,62 @@ void mp_print_macro_name (MP mp,pointer a, pointer n) {
if ( n!=null ) {
mp_print_text(n);
} else {
- p=info(a);
+ p=mp_info(a);
if ( p==null ) {
- mp_print_text(info(info(link(a))));
+ mp_print_text(mp_info(mp_info(mp_link(a))));
} else {
q=p;
- while ( link(q)!=null ) q=link(q);
- link(q)=info(link(a));
+ while ( mp_link(q)!=null ) q=mp_link(q);
+ mp_link(q)=mp_info(mp_link(a));
mp_show_token_list(mp, p,null,1000,0);
- link(q)=null;
+ mp_link(q)=null;
}
}
}
-@ @<Declare the procedure called |print_arg|@>=
-void mp_print_arg (MP mp,pointer q, integer n, pointer b) ;
+@ @<Declarations@>=
+static void mp_print_arg (MP mp,pointer q, integer n, pointer b) ;
@ @c
void mp_print_arg (MP mp,pointer q, integer n, pointer b) {
- if ( link(q)==mp_void ) mp_print_nl(mp, "(EXPR");
+ if ( mp_link(q)==mp_void ) mp_print_nl(mp, "(EXPR");
else if ( (b<text_base)&&(b!=text_macro) ) mp_print_nl(mp, "(SUFFIX");
else mp_print_nl(mp, "(TEXT");
mp_print_int(mp, n); mp_print(mp, ")<-");
- if ( link(q)==mp_void ) mp_print_exp(mp, q,1);
+ if ( mp_link(q)==mp_void ) mp_print_exp(mp, q,1);
else mp_show_token_list(mp, q,null,1000,0);
}
@ @<Determine the number |n| of arguments already supplied...@>=
{
n=1; tail=arg_list;
- while ( link(tail)!=null ) {
- incr(n); tail=link(tail);
+ while ( mp_link(tail)!=null ) {
+ incr(n); tail=mp_link(tail);
}
}
@ @<Scan the remaining arguments, if any; set |r|...@>=
mp->cur_cmd=comma+1; /* anything |<>comma| will do */
-while ( info(r)>=expr_base ) {
- @<Scan the delimited argument represented by |info(r)|@>;
- r=link(r);
+while ( mp_info(r)>=expr_base ) {
+ @<Scan the delimited argument represented by |mp_info(r)|@>;
+ r=mp_link(r);
}
if ( mp->cur_cmd==comma ) {
print_err("Too many arguments to ");
@.Too many arguments...@>
- mp_print_macro_name(mp, arg_list,macro_name); mp_print_char(mp, ';');
+ mp_print_macro_name(mp, arg_list,macro_name); mp_print_char(mp, xord(';'));
mp_print_nl(mp, " Missing `"); mp_print_text(r_delim);
@.Missing `)'...@>
mp_print(mp, "' has been inserted");
- help3("I'm going to assume that the comma I just read was a")
- ("right delimiter, and then I'll begin expanding the macro.")
- ("You might want to delete some tokens before continuing.");
+ help3("I'm going to assume that the comma I just read was a",
+ "right delimiter, and then I'll begin expanding the macro.",
+ "You might want to delete some tokens before continuing.");
mp_error(mp);
}
-if ( info(r)!=general_macro ) {
+if ( mp_info(r)!=general_macro ) {
@<Scan undelimited argument(s)@>;
}
-r=link(r)
+r=mp_link(r)
@ At this point, the reader will find it advisable to review the explanation
of token list format that was presented earlier, paying special attention to
@@ -14942,17 +15150,17 @@ aspects of the following program on faith; we will explain |cur_type|
and |cur_exp| later. (Several things in this program depend on each other,
and it's necessary to jump into the circle somewhere.)
-@<Scan the delimited argument represented by |info(r)|@>=
+@<Scan the delimited argument represented by |mp_info(r)|@>=
if ( mp->cur_cmd!=comma ) {
mp_get_x_next(mp);
if ( mp->cur_cmd!=left_delimiter ) {
print_err("Missing argument to ");
@.Missing argument...@>
mp_print_macro_name(mp, arg_list,macro_name);
- help3("That macro has more parameters than you thought.")
- ("I'll continue by pretending that each missing argument")
- ("is either zero or null.");
- if ( info(r)>=suffix_base ) {
+ help3("That macro has more parameters than you thought.",
+ "I'll continue by pretending that each missing argument",
+ "is either zero or null.");
+ if ( mp_info(r)>=suffix_base ) {
mp->cur_exp=null; mp->cur_type=mp_token_list;
} else {
mp->cur_exp=0; mp->cur_type=mp_known;
@@ -14962,7 +15170,7 @@ if ( mp->cur_cmd!=comma ) {
}
l_delim=mp->cur_sym; r_delim=mp->cur_mod;
}
-@<Scan the argument represented by |info(r)|@>;
+@<Scan the argument represented by |mp_info(r)|@>;
if ( mp->cur_cmd!=comma )
@<Check that the proper right delimiter was present@>;
FOUND:
@@ -14970,18 +15178,18 @@ FOUND:
@ @<Check that the proper right delim...@>=
if ( (mp->cur_cmd!=right_delimiter)||(mp->cur_mod!=l_delim) ) {
- if ( info(link(r))>=expr_base ) {
+ if ( mp_info(mp_link(r))>=expr_base ) {
mp_missing_err(mp, ",");
@.Missing `,'@>
- help3("I've finished reading a macro argument and am about to")
- ("read another; the arguments weren't delimited correctly.")
- ("You might want to delete some tokens before continuing.");
+ help3("I've finished reading a macro argument and am about to",
+ "read another; the arguments weren't delimited correctly.",
+ "You might want to delete some tokens before continuing.");
mp_back_error(mp); mp->cur_cmd=comma;
} else {
mp_missing_err(mp, str(text(r_delim)));
@.Missing `)'@>
- help2("I've gotten to the end of the macro parameter list.")
- ("You might want to delete some tokens before continuing.");
+ help2("I've gotten to the end of the macro parameter list.",
+ "You might want to delete some tokens before continuing.");
mp_back_error(mp);
}
}
@@ -14993,23 +15201,23 @@ a token list pointed to by |cur_exp|, in which case we will have
@<Append the current expression to |arg_list|@>=
{
p=mp_get_avail(mp);
- if ( mp->cur_type==mp_token_list ) info(p)=mp->cur_exp;
- else info(p)=mp_stash_cur_exp(mp);
+ if ( mp->cur_type==mp_token_list ) mp_info(p)=mp->cur_exp;
+ else mp_info(p)=mp_stash_cur_exp(mp);
if ( mp->internal[mp_tracing_macros]>0 ) {
- mp_begin_diagnostic(mp); mp_print_arg(mp, info(p),n,info(r));
+ mp_begin_diagnostic(mp); mp_print_arg(mp, mp_info(p),n,mp_info(r));
mp_end_diagnostic(mp, false);
}
if ( arg_list==null ) arg_list=p;
- else link(tail)=p;
+ else mp_link(tail)=p;
tail=p; incr(n);
}
-@ @<Scan the argument represented by |info(r)|@>=
-if ( info(r)>=text_base ) {
+@ @<Scan the argument represented by |mp_info(r)|@>=
+if ( mp_info(r)>=text_base ) {
mp_scan_text_arg(mp, l_delim,r_delim);
} else {
mp_get_x_next(mp);
- if ( info(r)>=suffix_base ) mp_scan_suffix(mp);
+ if ( mp_info(r)>=suffix_base ) mp_scan_suffix(mp);
else mp_scan_expression(mp);
}
@@ -15018,15 +15226,15 @@ or zero; the latter case is for undelimited text arguments, which
end with the first semicolon or \&{endgroup} or \&{end} that is not
contained in a group.
-@<Declare the procedure called |scan_text_arg|@>=
-void mp_scan_text_arg (MP mp,pointer l_delim, pointer r_delim) ;
+@<Declarations@>=
+static void mp_scan_text_arg (MP mp,pointer l_delim, pointer r_delim) ;
@ @c
void mp_scan_text_arg (MP mp,pointer l_delim, pointer r_delim) {
integer balance; /* excess of |l_delim| over |r_delim| */
pointer p; /* list tail */
mp->warning_info=l_delim; mp->scanner_status=absorbing;
- p=hold_head; balance=1; link(hold_head)=null;
+ p=hold_head; balance=1; mp_link(hold_head)=null;
while (1) {
get_t_next;
if ( l_delim==0 ) {
@@ -15034,9 +15242,9 @@ void mp_scan_text_arg (MP mp,pointer l_delim, pointer r_delim) {
} else {
@<Adjust the balance for a delimited argument; |break| if done@>;
}
- link(p)=mp_cur_tok(mp); p=link(p);
+ mp_link(p)=mp_cur_tok(mp); p=mp_link(p);
}
- mp->cur_exp=link(hold_head); mp->cur_type=mp_token_list;
+ mp->cur_exp=mp_link(hold_head); mp->cur_type=mp_token_list;
mp->scanner_status=normal;
}
@@ -15060,13 +15268,13 @@ if ( end_of_statement ) { /* |cur_cmd=semicolon|, |end_group|, or |stop| */
@ @<Scan undelimited argument(s)@>=
{
- if ( info(r)<text_macro ) {
+ if ( mp_info(r)<text_macro ) {
mp_get_x_next(mp);
- if ( info(r)!=suffix_macro ) {
+ if ( mp_info(r)!=suffix_macro ) {
if ( (mp->cur_cmd==equals)||(mp->cur_cmd==assignment) ) mp_get_x_next(mp);
}
}
- switch (info(r)) {
+ switch (mp_info(r)) {
case primary_macro:mp_scan_primary(mp); break;
case secondary_macro:mp_scan_secondary(mp); break;
case tertiary_macro:mp_scan_tertiary(mp); break;
@@ -15085,12 +15293,12 @@ if ( end_of_statement ) { /* |cur_cmd=semicolon|, |end_group|, or |stop| */
@ @<Scan an expression followed by `\&{of} $\langle$primary$\rangle$'@>=
{
- mp_scan_expression(mp); p=mp_get_avail(mp); info(p)=mp_stash_cur_exp(mp);
+ mp_scan_expression(mp); p=mp_get_avail(mp); mp_info(p)=mp_stash_cur_exp(mp);
if ( mp->internal[mp_tracing_macros]>0 ) {
- mp_begin_diagnostic(mp); mp_print_arg(mp, info(p),n,0);
+ mp_begin_diagnostic(mp); mp_print_arg(mp, mp_info(p),n,0);
mp_end_diagnostic(mp, false);
}
- if ( arg_list==null ) arg_list=p; else link(tail)=p;
+ if ( arg_list==null ) arg_list=p; else mp_link(tail)=p;
tail=p;incr(n);
if ( mp->cur_cmd!=of_token ) {
mp_missing_err(mp, "of"); mp_print(mp, " for ");
@@ -15114,8 +15322,8 @@ if ( end_of_statement ) { /* |cur_cmd=semicolon|, |end_group|, or |stop| */
if ((mp->cur_cmd!=right_delimiter)||(mp->cur_mod!=l_delim) ) {
mp_missing_err(mp, str(text(r_delim)));
@.Missing `)'@>
- help2("I've gotten to the end of the macro parameter list.")
- ("You might want to delete some tokens before continuing.");
+ help2("I've gotten to the end of the macro parameter list.",
+ "You might want to delete some tokens before continuing.");
mp_back_error(mp);
}
mp_get_x_next(mp);
@@ -15138,7 +15346,7 @@ mp_begin_token_list(mp, def_ref,macro); name=macro_name; loc=r;
if ( n>0 ) {
p=arg_list;
do {
- mp->param_stack[mp->param_ptr]=info(p); incr(mp->param_ptr); p=link(p);
+ mp->param_stack[mp->param_ptr]=mp_info(p); incr(mp->param_ptr); p=mp_link(p);
} while (p!=null);
mp_flush_list(mp, arg_list);
}
@@ -15146,7 +15354,8 @@ if ( n>0 ) {
@ It's sometimes necessary to put a single argument onto |param_stack|.
The |stack_argument| subroutine does this.
-@c void mp_stack_argument (MP mp,pointer p) {
+@c
+static void mp_stack_argument (MP mp,pointer p) {
if ( mp->param_ptr==mp->max_param_stack ) {
incr(mp->max_param_stack);
if ( mp->max_param_stack>mp->param_size )
@@ -15184,7 +15393,7 @@ corresponding |if_line|.
@<Glob...@>=
pointer cond_ptr; /* top of the condition stack */
integer if_limit; /* upper bound on |fi_or_else| codes */
-small_number cur_if; /* type of conditional being worked on */
+quarterword cur_if; /* type of conditional being worked on */
integer if_line; /* line where that conditional began */
@ @<Set init...@>=
@@ -15250,22 +15459,23 @@ condition has been evaluated, a colon will be inserted.
A construction like `\.{if fi}' would otherwise get \MP\ confused.
@<Push the condition stack@>=
-{ p=mp_get_node(mp, if_node_size); link(p)=mp->cond_ptr; type(p)=mp->if_limit;
- name_type(p)=mp->cur_if; if_line_field(p)=mp->if_line;
+{ p=mp_get_node(mp, if_node_size); mp_link(p)=mp->cond_ptr; mp_type(p)=mp->if_limit;
+ mp_name_type(p)=mp->cur_if; if_line_field(p)=mp->if_line;
mp->cond_ptr=p; mp->if_limit=if_code; mp->if_line=mp_true_line(mp);
mp->cur_if=if_code;
}
@ @<Pop the condition stack@>=
{ p=mp->cond_ptr; mp->if_line=if_line_field(p);
- mp->cur_if=name_type(p); mp->if_limit=type(p); mp->cond_ptr=link(p);
+ mp->cur_if=mp_name_type(p); mp->if_limit=mp_type(p); mp->cond_ptr=mp_link(p);
mp_free_node(mp, p,if_node_size);
}
@ Here's a procedure that changes the |if_limit| code corresponding to
a given value of |cond_ptr|.
-@c void mp_change_if_limit (MP mp,small_number l, pointer p) {
+@c
+static void mp_change_if_limit (MP mp,quarterword l, pointer p) {
pointer q;
if ( p==mp->cond_ptr ) {
mp->if_limit=l; /* that's the easy case */
@@ -15274,10 +15484,10 @@ a given value of |cond_ptr|.
while (1) {
if ( q==null ) mp_confusion(mp, "if");
@:this can't happen if}{\quad if@>
- if ( link(q)==p ) {
- type(q)=l; return;
+ if ( mp_link(q)==p ) {
+ mp_type(q)=l; return;
}
- q=link(q);
+ q=mp_link(q);
}
}
}
@@ -15286,12 +15496,12 @@ a given value of |cond_ptr|.
statements. Therefore, \MP\ has to check for their presence.
@c
-void mp_check_colon (MP mp) {
+static void mp_check_colon (MP mp) {
if ( mp->cur_cmd!=colon ) {
mp_missing_err(mp, ":");
@.Missing `:'@>
- help2("There should've been a colon after the condition.")
- ("I shall pretend that one was there.");;
+ help2("There should've been a colon after the condition.",
+ "I shall pretend that one was there.");
mp_back_error(mp);
}
}
@@ -15301,7 +15511,8 @@ an |if_test| command; in that case |get_x_next| calls |conditional|,
which is a recursive procedure.
@^recursion@>
-@c void mp_conditional (MP mp) {
+@c
+void mp_conditional (MP mp) {
pointer save_cond_ptr; /* |cond_ptr| corresponding to this conditional */
int new_if_limit; /* future value of |if_limit| */
pointer p; /* temporary register */
@@ -15380,8 +15591,8 @@ To bring our treatment of |get_x_next| to a close, we need to consider what
There's a global variable |loop_ptr| that keeps track of the \&{for} loops
that are currently active. If |loop_ptr=null|, no loops are in progress;
-otherwise |info(loop_ptr)| points to the iterative text of the current
-(innermost) loop, and |link(loop_ptr)| points to the data for any other
+otherwise |mp_info(loop_ptr)| points to the iterative text of the current
+(innermost) loop, and |mp_link(loop_ptr)| points to the data for any other
loops that enclose the current one.
A loop-control node also has two other fields, called |loop_type| and
@@ -15407,8 +15618,8 @@ that edge header.
because the link field of words in the dynamic memory area cannot be arbitrary.
@d loop_list_loc(A) ((A)+1) /* where the |loop_list| field resides */
-@d loop_type(A) info(loop_list_loc((A))) /* the type of \&{for} loop */
-@d loop_list(A) link(loop_list_loc((A))) /* the remaining list elements */
+@d loop_type(A) mp_info(loop_list_loc((A))) /* the type of \&{for} loop */
+@d loop_list(A) mp_link(loop_list_loc((A))) /* the remaining list elements */
@d loop_node_size 2 /* the number of words in a loop control node */
@d progression_node_size 4 /* the number of words in a progression node */
@d step_size(A) mp->mem[(A)+2].sc /* the step size in an arithmetic progression */
@@ -15426,14 +15637,15 @@ mp->loop_ptr=null;
a \&{for} loop don't have known numeric values, the |bad_for|
subroutine screams at the user.
-@c void mp_bad_for (MP mp, const char * s) {
+@c
+static void mp_bad_for (MP mp, const char * s) {
mp_disp_err(mp, null,"Improper "); /* show the bad expression above the message */
@.Improper...replaced by 0@>
mp_print(mp, s); mp_print(mp, " has been replaced by 0");
- help4("When you say `for x=a step b until c',")
- ("the initial value `a' and the step size `b'")
- ("and the final value `c' must have known numeric values.")
- ("I'm zeroing this one. Proceed, with fingers crossed.");
+ help4("When you say `for x=a step b until c',",
+ "the initial value `a' and the step size `b'",
+ "and the final value `c' must have known numeric values.",
+ "I'm zeroing this one. Proceed, with fingers crossed.");
mp_put_get_flush_error(mp, 0);
}
@@ -15455,7 +15667,7 @@ didn't write it until later. The reader may wish to come back to it.)
loop_type(s)=mp_void; p=null; mp_get_x_next(mp);
} else {
mp_get_symbol(mp); p=mp_get_node(mp, token_node_size);
- info(p)=mp->cur_sym; value(p)=m;
+ mp_info(p)=mp->cur_sym; value(p)=m;
mp_get_x_next(mp);
if ( mp->cur_cmd==within_token ) {
@<Set up a picture iteration@>;
@@ -15473,9 +15685,9 @@ didn't write it until later. The reader may wish to come back to it.)
if ( (mp->cur_cmd!=equals)&&(mp->cur_cmd!=assignment) ) {
mp_missing_err(mp, "=");
@.Missing `='@>
- help3("The next thing in this loop should have been `=' or `:='.")
- ("But don't worry; I'll pretend that an equals sign")
- ("was present, and I'll look for the values next.");
+ help3("The next thing in this loop should have been `=' or `:='.",
+ "But don't worry; I'll pretend that an equals sign",
+ "was present, and I'll look for the values next.");
mp_back_error(mp);
}
@@ -15483,9 +15695,9 @@ if ( (mp->cur_cmd!=equals)&&(mp->cur_cmd!=assignment) ) {
if ( mp->cur_cmd!=colon ) {
mp_missing_err(mp, ":");
@.Missing `:'@>
- help3("The next thing in this loop should have been a `:'.")
- ("So I'll pretend that a colon was present;")
- ("everything from here to `endfor' will be iterated.");
+ help3("The next thing in this loop should have been a `:'.",
+ "So I'll pretend that a colon was present;",
+ "everything from here to `endfor' will be iterated.");
mp_back_error(mp);
}
@@ -15499,10 +15711,10 @@ tokens unchanged. Furthermore the |frozen_repeat_loop| is an \&{outer}
token, so it won't be lost accidentally.)
@ @<Scan the loop text...@>=
-q=mp_get_avail(mp); info(q)=frozen_repeat_loop;
+q=mp_get_avail(mp); mp_info(q)=frozen_repeat_loop;
mp->scanner_status=loop_defining; mp->warning_info=n;
-info(s)=mp_scan_toks(mp, iteration,p,q,0); mp->scanner_status=normal;
-link(s)=mp->loop_ptr; mp->loop_ptr=s
+mp_info(s)=mp_scan_toks(mp, iteration,p,q,0); mp->scanner_status=normal;
+mp_link(s)=mp->loop_ptr; mp->loop_ptr=s
@ @<Initialize table...@>=
eq_type(frozen_repeat_loop)=repeat_loop+outer_tag;
@@ -15529,14 +15741,14 @@ text(frozen_repeat_loop)=intern(" ENDFOR");
mp_stop_iteration(mp);
return;
}
- loop_list(mp->loop_ptr)=link(p); q=info(p); free_avail(p);
+ loop_list(mp->loop_ptr)=mp_link(p); q=mp_info(p); free_avail(p);
} else if ( p==mp_void ) {
- mp_begin_token_list(mp, info(mp->loop_ptr),forever_text); return;
+ mp_begin_token_list(mp, mp_info(mp->loop_ptr),forever_text); return;
} else {
@<Make |q| a capsule containing the next picture component from
|loop_list(loop_ptr)| or |goto not_found|@>;
}
- mp_begin_token_list(mp, info(mp->loop_ptr),loop_text);
+ mp_begin_token_list(mp, mp_info(mp->loop_ptr),loop_text);
mp_stack_argument(mp, q);
if ( mp->internal[mp_tracing_commands]>unity ) {
@<Trace the start of a loop@>;
@@ -15554,9 +15766,9 @@ NOT_FOUND:
{
mp_begin_diagnostic(mp); mp_print_nl(mp, "{loop value=");
@.loop value=n@>
- if ( (q!=null)&&(link(q)==mp_void) ) mp_print_exp(mp, q,1);
+ if ( (q!=null)&&(mp_link(q)==mp_void) ) mp_print_exp(mp, q,1);
else mp_show_token_list(mp, q,null,50,0);
- mp_print_char(mp, '}'); mp_end_diagnostic(mp, false);
+ mp_print_char(mp, xord('}')); mp_end_diagnostic(mp, false);
}
@ @<Make |q| a capsule containing the next picture component from...@>=
@@ -15582,20 +15794,20 @@ from the input stack.
} else if ( p==null ){
q=loop_list(mp->loop_ptr);
while ( q!=null ) {
- p=info(q);
+ p=mp_info(q);
if ( p!=null ) {
- if ( link(p)==mp_void ) { /* it's an \&{expr} parameter */
+ if ( mp_link(p)==mp_void ) { /* it's an \&{expr} parameter */
mp_recycle_value(mp, p); mp_free_node(mp, p,value_node_size);
} else {
mp_flush_token_list(mp, p); /* it's a \&{suffix} or \&{text} parameter */
}
}
- p=q; q=link(q); free_avail(p);
+ p=q; q=mp_link(q); free_avail(p);
}
} else if ( p>progression_flag ) {
delete_edge_ref(p);
}
- p=mp->loop_ptr; mp->loop_ptr=link(p); mp_flush_token_list(mp, info(p));
+ p=mp->loop_ptr; mp->loop_ptr=mp_link(p); mp_flush_token_list(mp, mp_info(p));
mp_free_node(mp, p,loop_node_size);
}
@@ -15607,7 +15819,7 @@ a \&{for} construction (if |m=expr_base|) or a \&{forsuffixes} construction
(if |m=suffix_base|).
@<Scan the values to be used in the loop@>=
-loop_type(s)=null; q=loop_list_loc(s); link(q)=null; /* |link(q)=loop_list(s)| */
+loop_type(s)=null; q=loop_list_loc(s); mp_link(q)=null; /* |mp_link(q)=loop_list(s)| */
do {
mp_get_x_next(mp);
if ( m!=expr_base ) {
@@ -15621,8 +15833,8 @@ do {
}
mp->cur_exp=mp_stash_cur_exp(mp);
}
- link(q)=mp_get_avail(mp); q=link(q);
- info(q)=mp->cur_exp; mp->cur_type=mp_vacuous;
+ mp_link(q)=mp_get_avail(mp); q=mp_link(q);
+ mp_info(q)=mp->cur_exp; mp->cur_type=mp_vacuous;
CONTINUE:
;
} while (mp->cur_cmd==comma)
@@ -15637,8 +15849,8 @@ CONTINUE:
if ( mp->cur_cmd!=until_token ) {
mp_missing_err(mp, "until");
@.Missing `until'@>
- help2("I assume you meant to say `until' after `step'.")
- ("So I'll look for the final value and colon next.");
+ help2("I assume you meant to say `until' after `step'.",
+ "So I'll look for the final value and colon next.");
mp_back_error(mp);
}
mp_get_x_next(mp); mp_scan_expression(mp);
@@ -15656,10 +15868,10 @@ parse a picture expression and prepare to iterate over it.
mp_scan_expression(mp);
@<Make sure the current expression is a known picture@>;
loop_type(s)=mp->cur_exp; mp->cur_type=mp_vacuous;
- q=link(dummy_loc(mp->cur_exp));
+ q=mp_link(dummy_loc(mp->cur_exp));
if ( q!= null )
if ( is_start_or_stop(q) )
- if ( mp_skip_1component(mp, q)==null ) q=link(q);
+ if ( mp_skip_1component(mp, q)==null ) q=mp_link(q);
loop_list(s)=q;
}
@@ -15765,36 +15977,54 @@ while scanning a file name.
integer area_delimiter;
/* most recent `\.>' or `\.:' relative to |str_start[str_ptr]| */
integer ext_delimiter; /* the relevant `\..', if any */
+boolean quoted_filename; /* whether the filename is wrapped in " markers */
@ Here now is the first of the system-dependent routines for file name scanning.
@^system dependencies@>
-@<Declare subroutines for parsing file names@>=
+The file name length is limited to |file_name_size|. That is good, because
+in the current configuration we cannot call |mp_do_compaction| while a name
+is being scanned, |mp->area_delimiter| and |mp->ext_delimiter| are direct
+offsets into |mp->str_pool|. I am not in a great hurry to fix this, because
+calling |str_room()| just once is more efficient anyway. TODO.
+
+@<Declarations@>=
+static void mp_begin_name (MP mp);
+static boolean mp_more_name (MP mp, ASCII_code c);
+static void mp_end_name (MP mp);
+
+@ @c
void mp_begin_name (MP mp) {
xfree(mp->cur_name);
xfree(mp->cur_area);
xfree(mp->cur_ext);
mp->area_delimiter=-1;
mp->ext_delimiter=-1;
+ mp->quoted_filename=false;
+ str_room(file_name_size);
}
@ And here's the second.
@^system dependencies@>
-@<Declare subroutines for parsing file names@>=
-boolean mp_more_name (MP mp, ASCII_code c) {
- if (c==' ') {
+@d IS_DIR_SEP(c) (c=='/' || c=='\\')
+
+@c
+boolean mp_more_name (MP mp, ASCII_code c) {
+ if (c=='"') {
+ mp->quoted_filename= ! mp->quoted_filename;
+ } else if ((c==' '|| c=='\t') && (mp->quoted_filename==false)) {
return false;
- } else {
- if ( (c=='>')||(c==':') ) {
+ } else {
+ if (IS_DIR_SEP (c)) {
mp->area_delimiter=mp->pool_ptr;
mp->ext_delimiter=-1;
- } else if ( (c=='.')&&(mp->ext_delimiter<0) ) {
+ } else if ( c=='.' ) {
mp->ext_delimiter=mp->pool_ptr;
}
- str_room(1); append_char(c); /* contribute |c| to the current string */
- return true;
+ append_char(c); /* contribute |c| to the current string */
}
+ return true;
}
@ The third.
@@ -15805,7 +16035,7 @@ boolean mp_more_name (MP mp, ASCII_code c) {
strncpy(A,(char *)(mp->str_pool+B),C);
A[C] = 0;}
-@<Declare subroutines for parsing file names@>=
+@c
void mp_end_name (MP mp) {
pool_pointer s; /* length of area, name, and extension */
unsigned int len;
@@ -15814,16 +16044,16 @@ void mp_end_name (MP mp) {
if ( mp->area_delimiter<0 ) {
mp->cur_area=xstrdup("");
} else {
- len = mp->area_delimiter-s;
+ len = (unsigned)(mp->area_delimiter-s+1);
copy_pool_segment(mp->cur_area,s,len);
- s += len+1;
+ s += len;
}
if ( mp->ext_delimiter<0 ) {
mp->cur_ext=xstrdup("");
- len = mp->pool_ptr-s;
+ len = (unsigned)(mp->pool_ptr-s);
} else {
- copy_pool_segment(mp->cur_ext,mp->ext_delimiter,(mp->pool_ptr-mp->ext_delimiter));
- len = mp->ext_delimiter-s;
+ copy_pool_segment(mp->cur_ext,mp->ext_delimiter,(size_t)(mp->pool_ptr-mp->ext_delimiter));
+ len = (unsigned)(mp->ext_delimiter-s);
}
copy_pool_segment(mp->cur_name,s,len);
mp->pool_ptr=s; /* don't need this partial string */
@@ -15835,8 +16065,15 @@ some operating systems put the file area last instead of first.)
@^system dependencies@>
@<Basic printing...@>=
-void mp_print_file_name (MP mp, char * n, char * a, char * e) {
+static void mp_print_file_name (MP mp, char * n, char * a, char * e) {
+ boolean must_quote = false;
+ if (((a != NULL) && (strchr(a,' ') != NULL)) ||
+ ((n != NULL) && (strchr(n,' ') != NULL)) ||
+ ((e != NULL) && (strchr(e,' ') != NULL)))
+ must_quote = true;
+ if (must_quote) mp_print_char(mp, (ASCII_code)'"');
mp_print(mp, a); mp_print(mp, n); mp_print(mp, e);
+ if (must_quote) mp_print_char(mp, (ASCII_code)'"');
}
@ Another system-dependent routine is needed to convert three internal
@@ -15845,26 +16082,26 @@ to the |name_of_file| value that is used to open files. The present code
allows both lowercase and uppercase letters in the file name.
@^system dependencies@>
-@d append_to_name(A) { c=(A);
+@d append_to_name(A) { c=xord((int)(A));
if ( k<file_name_size ) {
- mp->name_of_file[k]=xchr(c);
+ mp->name_of_file[k]=(char)xchr(c);
incr(k);
}
}
-@<Declare subroutines for parsing file names@>=
+@ @c
void mp_pack_file_name (MP mp, const char *n, const char *a, const char *e) {
integer k; /* number of positions filled in |name_of_file| */
ASCII_code c; /* character being packed */
const char *j; /* a character index */
k=0;
- assert(n);
+ assert(n!=NULL);
if (a!=NULL) {
- for (j=a;*j;j++) { append_to_name(*j); }
+ for (j=a;*j!='\0';j++) { append_to_name(*j); }
}
- for (j=n;*j;j++) { append_to_name(*j); }
+ for (j=n;*j!='\0';j++) { append_to_name(*j); }
if (e!=NULL) {
- for (j=e;*j;j++) { append_to_name(*j); }
+ for (j=e;*j!='\0';j++) { append_to_name(*j); }
}
mp->name_of_file[k]=0;
mp->name_length=k;
@@ -15873,107 +16110,77 @@ void mp_pack_file_name (MP mp, const char *n, const char *a, const char *e) {
@ @<Internal library declarations@>=
void mp_pack_file_name (MP mp, const char *n, const char *a, const char *e) ;
-@ A messier routine is also needed, since mem file names must be scanned
-before \MP's string mechanism has been initialized. We shall use the
-global variable |MP_mem_default| to supply the text for default system areas
-and extensions related to mem files.
-@^system dependencies@>
-
-@d mem_default_length 9 /* length of the |MP_mem_default| string */
-@d mem_ext_length 4 /* length of its `\.{.mem}' part */
-@d mem_extension ".mem" /* the extension, as a \.{WEB} constant */
-
-@<Glob...@>=
-char *MP_mem_default;
-
@ @<Option variables@>=
char *mem_name; /* for commandline */
-@ @<Allocate or initialize ...@>=
-mp->MP_mem_default = xstrdup("plain.mem");
+@ @<Find constant sizes@>=
mp->mem_name = xstrdup(opt->mem_name);
-@.plain@>
-@^system dependencies@>
+if (mp->mem_name) {
+ size_t l = strlen(mp->mem_name);
+ if (l>4) {
+ char *test = strstr(mp->mem_name,".mem");
+ if (test == mp->mem_name+l-4) {
+ *test = 0;
+ }
+ }
+}
+
@ @<Dealloc variables@>=
-xfree(mp->MP_mem_default);
xfree(mp->mem_name);
-@ @<Check the ``constant'' values for consistency@>=
-if ( mem_default_length>file_name_size ) mp->bad=20;
-
-@ Here is the messy routine that was just mentioned. It sets |name_of_file|
-from the first |n| characters of |MP_mem_default|, followed by
-|buffer[a..b-1]|, followed by the last |mem_ext_length| characters of
-|MP_mem_default|.
-
-We dare not give error messages here, since \MP\ calls this routine before
-the |error| routine is ready to roll. Instead, we simply drop excess characters,
-since the error will be detected in another way when a strange file name
-isn't found.
-@^system dependencies@>
-
-@c void mp_pack_buffered_name (MP mp,small_number n, integer a,
- integer b) {
- integer k; /* number of positions filled in |name_of_file| */
- ASCII_code c; /* character being packed */
- integer j; /* index into |buffer| or |MP_mem_default| */
- if ( n+b-a+1+mem_ext_length>file_name_size )
- b=a+file_name_size-n-1-mem_ext_length;
- k=0;
- for (j=0;j<n;j++) {
- append_to_name(xord((int)mp->MP_mem_default[j]));
- }
- for (j=a;j<b;j++) {
- append_to_name(mp->buffer[j]);
- }
- for (j=mem_default_length-mem_ext_length;
- j<mem_default_length;j++) {
- append_to_name(xord((int)mp->MP_mem_default[j]));
- }
- mp->name_of_file[k]=0;
- mp->name_length=k;
-}
-
-@ Here is the only place we use |pack_buffered_name|. This part of the program
-becomes active when a ``virgin'' \MP\ is trying to get going, just after
-the preliminary initialization, or when the user is substituting another
-mem file by typing `\.\&' after the initial `\.{**}' prompt. The buffer
-contains the first line of input in |buffer[loc..(last-1)]|, where
-|loc<last| and |buffer[loc]<>" "|.
+@ This part of the program becomes active when a ``virgin'' \MP\ is
+trying to get going, just after the preliminary initialization, or
+when the user is substituting another mem file by typing `\.\&' after
+the initial `\.{**}' prompt. The buffer contains the first line of
+input in |buffer[loc..(last-1)]|, where |loc<last| and |buffer[loc]<>""|.
@<Declarations@>=
-boolean mp_open_mem_file (MP mp) ;
+static boolean mp_open_mem_name (MP mp) ;
+static boolean mp_open_mem_file (MP mp) ;
@ @c
-boolean mp_open_mem_file (MP mp) {
- int j; /* the first space after the file name */
+boolean mp_open_mem_name (MP mp) {
if (mp->mem_name!=NULL) {
- mp->mem_file = (mp->open_file)(mp,mp->mem_name, "r", mp_filetype_memfile);
+ size_t l = strlen(mp->mem_name);
+ char *s = xstrdup (mp->mem_name);
+ if (l>4) {
+ char *test = strstr(s,".mem");
+ if (test == NULL || test != s+l-4) {
+ s = xrealloc (s, l+5, 1);
+ strcat (s, ".mem");
+ }
+ } else {
+ s = xrealloc (s, l+5, 1);
+ strcat (s, ".mem");
+ }
+ mp->mem_file = (mp->open_file)(mp,s, "r", mp_filetype_memfile);
+ xfree(s);
if ( mp->mem_file ) return true;
}
- j=loc;
- if ( mp->buffer[loc]=='&' ) {
- incr(loc); j=loc; mp->buffer[mp->last]=' ';
- while ( mp->buffer[j]!=' ' ) incr(j);
- mp_pack_buffered_name(mp, 0,loc,j); /* try first without the system file area */
- if ( mp_w_open_in(mp, &mp->mem_file) ) goto FOUND;
+ return false;
+}
+boolean mp_open_mem_file (MP mp) {
+ if (mp->mem_file != NULL)
+ return true;
+ if (mp_open_mem_name(mp))
+ return true;
+ if (mp_xstrcmp(mp->mem_name, "plain")) {
wake_up_terminal;
wterm_ln("Sorry, I can\'t find that mem file; will try PLAIN.");
@.Sorry, I can't find...@>
update_terminal;
+ /* now pull out all the stops: try for the system \.{plain} file */
+ xfree(mp->mem_name);
+ mp->mem_name = xstrdup("plain");
+ if (mp_open_mem_name(mp))
+ return true;
}
- /* now pull out all the stops: try for the system \.{plain} file */
- mp_pack_buffered_name(mp, mem_default_length-mem_ext_length,0,0);
- if ( ! mp_w_open_in(mp, &mp->mem_file) ) {
- wake_up_terminal;
- wterm_ln("I can\'t find the PLAIN mem file!\n");
+ wake_up_terminal;
+ wterm_ln("I can\'t find the PLAIN mem file!\n");
@.I can't find PLAIN...@>
@.plain@>
- return false;
- }
-FOUND:
- loc=j; return true;
+ return false;
}
@ Operating systems often make it possible to determine the exact name (and
@@ -15989,7 +16196,7 @@ most recently opened, if it is possible to do this.
#define mp_w_make_name_string(A,B) mp_make_name_string(A)
@ @c
-str_number mp_make_name_string (MP mp) {
+static str_number mp_make_name_string (MP mp) {
int k; /* index into |name_of_file| */
str_room(mp->name_length);
for (k=0;k<mp->name_length;k++) {
@@ -16015,7 +16222,8 @@ be made with reluctance, and only when an entire file name that
includes special characters is ``quoted'' somehow.
@^system dependencies@>
-@c void mp_scan_file_name (MP mp) {
+@c
+static void mp_scan_file_name (MP mp) {
mp_begin_name(mp);
while ( mp->buffer[loc]==' ' ) incr(loc);
while (1) {
@@ -16029,6 +16237,9 @@ includes special characters is ``quoted'' somehow.
@ Here is another version that takes its input from a string.
@<Declare subroutines for parsing file names@>=
+void mp_str_scan_file (MP mp, str_number s) ;
+
+@ @c
void mp_str_scan_file (MP mp, str_number s) {
pool_pointer p,q; /* current position and stopping point */
mp_begin_name(mp);
@@ -16043,12 +16254,15 @@ void mp_str_scan_file (MP mp, str_number s) {
@ And one that reads from a |char*|.
@<Declare subroutines for parsing file names@>=
+extern void mp_ptr_scan_file (MP mp, char *s);
+
+@ @c
void mp_ptr_scan_file (MP mp, char *s) {
char *p, *q; /* current position and stopping point */
mp_begin_name(mp);
p=s; q=p+strlen(s);
while ( p<q ){
- if ( ! mp_more_name(mp, *p)) break;
+ if ( ! mp_more_name(mp, xord((int)(*p)))) break;
p++;
}
mp_end_name(mp);
@@ -16072,6 +16286,18 @@ except of course for a short time just after |job_name| has become nonzero.
@<Allocate or ...@>=
mp->job_name=mp_xstrdup(mp, opt->job_name);
+if (opt->noninteractive && opt->ini_version) {
+ if (mp->job_name == NULL)
+ mp->job_name=mp_xstrdup(mp,mp->mem_name);
+ if (mp->job_name != NULL) {
+ size_t l = strlen(mp->job_name);
+ if (l>4) {
+ char *test = strstr(mp->job_name,".mem");
+ if (test == mp->job_name+l-4)
+ *test = 0;
+ }
+ }
+}
mp->log_opened=false;
@ @<Dealloc variables@>=
@@ -16083,7 +16309,7 @@ and |cur_ext|.
@d pack_cur_name mp_pack_file_name(mp, mp->cur_name,mp->cur_area,mp->cur_ext)
-@<Declarations@>=
+@<Internal library ...@>=
void mp_pack_job_name (MP mp, const char *s) ;
@ @c
@@ -16101,7 +16327,7 @@ is the default extension if none is given. Upon exit from the routine,
variables |cur_name|, |cur_area|, |cur_ext|, and |name_of_file| are
ready for another attempt at file opening.
-@<Declarations@>=
+@<Internal library ...@>=
void mp_prompt_file_name (MP mp, const char * s, const char * e) ;
@ @c void mp_prompt_file_name (MP mp, const char * s, const char * e) {
@@ -16114,15 +16340,15 @@ void mp_prompt_file_name (MP mp, const char * s, const char * e) ;
@.I can't find file x@>
} else {
print_err("I can\'t write on file `");
- }
@.I can't write on file x@>
+ }
mp_print_file_name(mp, mp->cur_name,mp->cur_area,mp->cur_ext);
mp_print(mp, "'.");
if (strcmp(e,"")==0)
mp_show_context(mp);
mp_print_nl(mp, "Please type another "); mp_print(mp, s);
@.Please type...@>
- if ( mp->interaction<mp_scroll_mode )
+ if (mp->noninteractive || mp->interaction<mp_scroll_mode )
mp_fatal_error(mp, "*** (job aborted, file error in nonstop mode)");
@.job aborted, file error...@>
saved_cur_name = xstrdup(mp->cur_name);
@@ -16153,7 +16379,7 @@ void mp_prompt_file_name (MP mp, const char * s, const char * e) ;
it catch up to what has previously been printed on the terminal.
@c void mp_open_log_file (MP mp) {
- int old_setting; /* previous |selector| setting */
+ unsigned old_setting; /* previous |selector| setting */
int k; /* index into |months| and |buffer| */
int l; /* end of first input line */
integer m; /* the current month */
@@ -16172,9 +16398,9 @@ it catch up to what has previously been printed on the terminal.
@<Print the banner line, including the date and time@>;
mp->input_stack[mp->input_ptr]=mp->cur_input;
/* make sure bottom level is in memory */
-@.**@>
if (!mp->noninteractive) {
mp_print_nl(mp, "**");
+@.**@>
l=mp->input_stack[0].limit_field-1; /* last position of first line */
for (k=0;k<=l;k++) mp_print_str(mp, mp->buffer[k]);
mp_print_ln(mp); /* now the transcript file contains the first line of input */
@@ -16207,24 +16433,25 @@ this file.
@ @<Print the banner...@>=
{
- wlog(banner);
+ wlog(mp->banner);
mp_print(mp, mp->mem_ident); mp_print(mp, " ");
mp_print_int(mp, mp_round_unscaled(mp, mp->internal[mp_day]));
- mp_print_char(mp, ' ');
+ mp_print_char(mp, xord(' '));
m=mp_round_unscaled(mp, mp->internal[mp_month]);
- for (k=3*m-3;k<3*m;k++) { wlog_chr(months[k]); }
- mp_print_char(mp, ' ');
+ for (k=3*m-3;k<3*m;k++) { wlog_chr((unsigned char)months[k]); }
+ mp_print_char(mp, xord(' '));
mp_print_int(mp, mp_round_unscaled(mp, mp->internal[mp_year]));
- mp_print_char(mp, ' ');
+ mp_print_char(mp, xord(' '));
m=mp_round_unscaled(mp, mp->internal[mp_time]);
- mp_print_dd(mp, m / 60); mp_print_char(mp, ':'); mp_print_dd(mp, m % 60);
+ mp_print_dd(mp, m / 60); mp_print_char(mp, xord(':')); mp_print_dd(mp, m % 60);
}
@ The |try_extension| function tries to open an input file determined by
|cur_name|, |cur_area|, and the argument |ext|. It returns |false| if it
can't find the file in |cur_area| or the appropriate system area.
-@c boolean mp_try_extension (MP mp, const char *ext) {
+@c
+static boolean mp_try_extension (MP mp, const char *ext) {
mp_pack_file_name(mp, mp->cur_name,mp->cur_area, ext);
in_name=xstrdup(mp->cur_name);
in_area=xstrdup(mp->cur_area);
@@ -16263,8 +16490,8 @@ when an `\.{input}' command is being processed.
} /* |open_log_file| doesn't |show_context|, so |limit|
and |loc| needn't be set to meaningful values yet */
if ( ((int)mp->term_offset+(int)strlen(fname)) > (mp->max_print_line-2)) mp_print_ln(mp);
- else if ( (mp->term_offset>0)||(mp->file_offset>0) ) mp_print_char(mp, ' ');
- mp_print_char(mp, '('); incr(mp->open_parens); mp_print(mp, fname);
+ else if ( (mp->term_offset>0)||(mp->file_offset>0) ) mp_print_char(mp, xord(' '));
+ mp_print_char(mp, xord('(')); incr(mp->open_parens); mp_print(mp, fname);
xfree(fname);
update_terminal;
@<Flush |name| and replace it with |cur_name| if it won't be needed@>;
@@ -16287,7 +16514,7 @@ so there is no need to test the return value.
line=1;
(void)mp_input_ln(mp, cur_file );
mp_firm_up_the_line(mp);
- mp->buffer[limit]='%'; mp->first=limit+1; loc=start;
+ mp->buffer[limit]=xord('%'); mp->first=(size_t)(limit+1); loc=start;
}
@ @<Put the desired file name in |(cur_name,cur_ext,cur_area)|@>=
@@ -16295,9 +16522,9 @@ while ( token_state &&(loc==null) ) mp_end_token_list(mp);
if ( token_state ) {
print_err("File names can't appear within macros");
@.File names can't...@>
- help3("Sorry...I've converted what follows to tokens,")
- ("possibly garbaging the name you gave.")
- ("Please delete the tokens and insert the name again.");
+ help3("Sorry...I've converted what follows to tokens,",
+ "possibly garbaging the name you gave.",
+ "Please delete the tokens and insert the name again.");
mp_error(mp);
}
if ( file_state ) {
@@ -16322,8 +16549,9 @@ with the current input file.
goto NOT_FOUND;
}
name=mp_a_make_name_string(mp, cur_file);
- mp->mpx_name[index]=name; add_str_ref(name);
+ mp->mpx_name[iindex]=name; add_str_ref(name);
@<Read the first line of the new file@>;
+ xfree(origname);
return;
NOT_FOUND:
@<Explain that the \.{MPX} file can't be read and |succumb|@>;
@@ -16339,16 +16567,16 @@ available to perform the function of \.{DVItoMP}.)
@^system dependencies@>
@ @<Exported types@>=
-typedef int (*mp_run_make_mpx_command)(MP mp, char *origname, char *mtxname);
+typedef int (*mp_makempx_cmd)(MP mp, char *origname, char *mtxname);
@ @<Option variables@>=
-mp_run_make_mpx_command run_make_mpx;
+mp_makempx_cmd run_make_mpx;
@ @<Allocate or initialize ...@>=
set_callback_option(run_make_mpx);
-@ @<Internal library declarations@>=
-int mp_run_make_mpx (MP mp, char *origname, char *mtxname);
+@ @<Declarations@>=
+static int mp_run_make_mpx (MP mp, char *origname, char *mtxname);
@ The default does nothing.
@c
@@ -16373,10 +16601,10 @@ mp_print(mp, origname);
mp_print_nl(mp, ">> ");
mp_print(mp, mp->name_of_file);
mp_print_nl(mp, "! Unable to make mpx file");
-help4("The two files given above are one of your source files")
- ("and an auxiliary file I need to read to find out what your")
- ("btex..etex blocks mean. If you don't know why I had trouble,")
- ("try running it manually through MPtoTeX, TeX, and DVItoMP");
+help4("The two files given above are one of your source files",
+ "and an auxiliary file I need to read to find out what your",
+ "btex..etex blocks mean. If you don't know why I had trouble,",
+ "try running it manually through MPtoTeX, TeX, and DVItoMP");
succumb;
@ The last file-opening commands are for files accessed via the \&{readfrom}
@@ -16403,29 +16631,28 @@ mp->max_read_files=8;
mp->rd_file = xmalloc((mp->max_read_files+1),sizeof(void *));
mp->rd_fname = xmalloc((mp->max_read_files+1),sizeof(char *));
memset(mp->rd_fname, 0, sizeof(char *)*(mp->max_read_files+1));
-mp->read_files=0;
mp->max_write_files=8;
mp->wr_file = xmalloc((mp->max_write_files+1),sizeof(void *));
mp->wr_fname = xmalloc((mp->max_write_files+1),sizeof(char *));
memset(mp->wr_fname, 0, sizeof(char *)*(mp->max_write_files+1));
-mp->write_files=0;
@ This routine starts reading the file named by string~|s| without setting
|loc|, |limit|, or |name|. It returns |false| if the file is empty or cannot
be opened. Otherwise it updates |rd_file[n]| and |rd_fname[n]|.
-@c boolean mp_start_read_input (MP mp,char *s, readf_index n) {
+@c
+static boolean mp_start_read_input (MP mp,char *s, readf_index n) {
mp_ptr_scan_file(mp, s);
pack_cur_name;
mp_begin_file_reading(mp);
- if ( ! mp_a_open_in(mp, &mp->rd_file[n], (mp_filetype_text+n)) )
+ if ( ! mp_a_open_in(mp, &mp->rd_file[n], (int)(mp_filetype_text+n)) )
goto NOT_FOUND;
if ( ! mp_input_ln(mp, mp->rd_file[n] ) ) {
(mp->close_file)(mp,mp->rd_file[n]);
goto NOT_FOUND;
}
- mp->rd_fname[n]=xstrdup(mp->name_of_file);
+ mp->rd_fname[n]=xstrdup(s);
return true;
NOT_FOUND:
mp_end_file_reading(mp);
@@ -16435,14 +16662,14 @@ NOT_FOUND:
@ Open |wr_file[n]| using file name~|s| and update |wr_fname[n]|.
@<Declarations@>=
-void mp_open_write_file (MP mp, char *s, readf_index n) ;
+static void mp_open_write_file (MP mp, char *s, readf_index n) ;
@ @c void mp_open_write_file (MP mp,char *s, readf_index n) {
mp_ptr_scan_file(mp, s);
pack_cur_name;
- while ( ! mp_a_open_out(mp, &mp->wr_file[n], (mp_filetype_text+n)) )
+ while ( ! mp_a_open_out(mp, &mp->wr_file[n], (int)(mp_filetype_text+n)) )
mp_prompt_file_name(mp, "file name for write output","");
- mp->wr_fname[n]=xstrdup(mp->name_of_file);
+ mp->wr_fname[n]=xstrdup(s);
}
@@ -16468,7 +16695,7 @@ backup mechanisms have been added in order to provide reasonable error
recovery.
@<Glob...@>=
-small_number cur_type; /* the type of the expression just found */
+quarterword cur_type; /* the type of the expression just found */
integer cur_exp; /* the value of the expression just found */
@ @<Set init...@>=
@@ -16622,7 +16849,7 @@ The special link |mp_void| is put on the capsule returned by
that must be easily distinguishable from token lists.
@<Declare the stashing/unstashing routines@>=
-pointer mp_stash_cur_exp (MP mp) {
+static pointer mp_stash_cur_exp (MP mp) {
pointer p; /* the capsule that will be returned */
switch (mp->cur_type) {
case unknown_types:
@@ -16636,11 +16863,11 @@ pointer mp_stash_cur_exp (MP mp) {
p=mp->cur_exp;
break;
default:
- p=mp_get_node(mp, value_node_size); name_type(p)=mp_capsule;
- type(p)=mp->cur_type; value(p)=mp->cur_exp;
+ p=mp_get_node(mp, value_node_size); mp_name_type(p)=mp_capsule;
+ mp_type(p)=mp->cur_type; value(p)=mp->cur_exp;
break;
}
- mp->cur_type=mp_vacuous; link(p)=mp_void;
+ mp->cur_type=mp_vacuous; mp_link(p)=mp_void;
return p;
}
@@ -16665,11 +16892,11 @@ are alive or dormant. The \\{unstash} procedure assumes that they are
dead or dormant; it resuscitates them.
@<Declare the stashing/unstashing...@>=
-void mp_unstash_cur_exp (MP mp,pointer p) ;
+static void mp_unstash_cur_exp (MP mp,pointer p) ;
@ @c
void mp_unstash_cur_exp (MP mp,pointer p) {
- mp->cur_type=type(p);
+ mp->cur_type=mp_type(p);
switch (mp->cur_type) {
case unknown_types:
case mp_transform_type:
@@ -16698,12 +16925,15 @@ than~1, complicated structures (pens, pictures, and paths) will be displayed
in full.
@.linearform@>
-@<Declare subroutines for printing expressions@>=
+@<Declarations@>=
@<Declare the procedure called |print_dp|@>
@<Declare the stashing/unstashing routines@>
-void mp_print_exp (MP mp,pointer p, small_number verbosity) {
+static void mp_print_exp (MP mp,pointer p, quarterword verbosity) ;
+
+@ @c
+void mp_print_exp (MP mp,pointer p, quarterword verbosity) {
boolean restore_cur_exp; /* should |cur_exp| be restored? */
- small_number t; /* the type of the expression */
+ quarterword t; /* the type of the expression */
pointer q; /* a big node being displayed */
integer v=0; /* the value of the expression */
if ( p!=null ) {
@@ -16711,7 +16941,7 @@ void mp_print_exp (MP mp,pointer p, small_number verbosity) {
} else {
p=mp_stash_cur_exp(mp); restore_cur_exp=true;
}
- t=type(p);
+ t=mp_type(p);
if ( t<mp_dependent ) v=value(p); else if ( t<mp_independent ) v=dep_list(p);
@<Print an abbreviated value of |v| with format depending on |t|@>;
if ( restore_cur_exp ) mp_unstash_cur_exp(mp, p);
@@ -16727,7 +16957,7 @@ case unknown_types: case mp_numeric_type:
@<Display a variable that's been declared but not defined@>;
break;
case mp_string_type:
- mp_print_char(mp, '"'); mp_print_str(mp, v); mp_print_char(mp, '"');
+ mp_print_char(mp, xord('"')); mp_print_str(mp, v); mp_print_char(mp, xord('"'));
break;
case mp_pen_type: case mp_path_type: case mp_picture_type:
@<Display a complex type@>;
@@ -16747,15 +16977,15 @@ default: mp_confusion(mp, "exp"); break;
@ @<Display a big node@>=
{
- mp_print_char(mp, '('); q=v+mp->big_node_size[t];
+ mp_print_char(mp, xord('(')); q=v+mp->big_node_size[t];
do {
- if ( type(v)==mp_known ) mp_print_scaled(mp, value(v));
- else if ( type(v)==mp_independent ) mp_print_variable_name(mp, v);
- else mp_print_dp(mp, type(v),dep_list(v),verbosity);
+ if ( mp_type(v)==mp_known ) mp_print_scaled(mp, value(v));
+ else if ( mp_type(v)==mp_independent ) mp_print_variable_name(mp, v);
+ else mp_print_dp(mp, mp_type(v),dep_list(v),verbosity);
v=v+2;
- if ( v!=q ) mp_print_char(mp, ',');
+ if ( v!=q ) mp_print_char(mp, xord(','));
} while (v!=q);
- mp_print_char(mp, ')');
+ mp_print_char(mp, xord(')'));
}
@ Values of type \&{picture}, \&{path}, and \&{pen} are displayed verbosely
@@ -16780,11 +17010,11 @@ if ( verbosity<=1 ) {
}
@ @<Declare the procedure called |print_dp|@>=
-void mp_print_dp (MP mp,small_number t, pointer p,
- small_number verbosity) {
+static void mp_print_dp (MP mp, quarterword t, pointer p,
+ quarterword verbosity) {
pointer q; /* the node following |p| */
- q=link(p);
- if ( (info(q)==null) || (verbosity>0) ) mp_print_dependency(mp, p,t);
+ q=mp_link(p);
+ if ( (mp_info(q)==null) || (verbosity>0) ) mp_print_dependency(mp, p,t);
else mp_print(mp, "linearform");
}
@@ -16794,8 +17024,8 @@ the ring consists entirely of capsules.
@<Display a variable that's been declared but not defined@>=
{ mp_print_type(mp, t);
if ( v!=null )
- { mp_print_char(mp, ' ');
- while ( (name_type(v)==mp_capsule) && (v!=p) ) v=value(v);
+ { mp_print_char(mp, xord(' '));
+ while ( (mp_name_type(v)==mp_capsule) && (v!=p) ) v=value(v);
mp_print_variable_name(mp, v);
};
}
@@ -16806,15 +17036,17 @@ or |disp_err| instead of |print_err|.
@d exp_err(A) mp_disp_err(mp, null,(A)) /* displays the current expression */
-@<Declare subroutines for printing expressions@>=
+@<Declarations@>=
+static void mp_disp_err (MP mp,pointer p, const char *s) ;
+
+@ @c
void mp_disp_err (MP mp,pointer p, const char *s) {
if ( mp->interaction==mp_error_stop_mode ) wake_up_terminal;
mp_print_nl(mp, ">> ");
@.>>@>
mp_print_exp(mp, p,1); /* ``medium verbose'' printing of the expression */
- if (strlen(s)) {
- mp_print_nl(mp, "! "); mp_print(mp, s);
-@.!\relax@>
+ if (strlen(s)>0) {
+ print_err(s);
}
}
@@ -16824,7 +17056,8 @@ to |known| and stores a given value in |cur_exp|. We can think of |cur_type|
and |cur_exp| as either alive or dormant after this has been done,
because |cur_exp| will not contain a pointer value.
-@ @c void mp_flush_cur_exp (MP mp,scaled v) {
+@ @c
+static void mp_flush_cur_exp (MP mp,scaled v) {
switch (mp->cur_type) {
case unknown_types: case mp_transform_type: case mp_color_type: case mp_pair_type:
case mp_dependent: case mp_proto_dependent: case mp_independent: case mp_cmykcolor_type:
@@ -16846,15 +17079,16 @@ because |cur_exp| will not contain a pointer value.
@ There's a much more general procedure that is capable of releasing
the storage associated with any two-word value packet.
-@<Declare the recycling subroutines@>=
-void mp_recycle_value (MP mp,pointer p) ;
+@<Declarations@>=
+static void mp_recycle_value (MP mp,pointer p) ;
-@ @c void mp_recycle_value (MP mp,pointer p) {
- small_number t; /* a type code */
+@ @c
+static void mp_recycle_value (MP mp,pointer p) {
+ quarterword t; /* a type code */
integer vv; /* another value */
pointer q,r,s,pp; /* link manipulation registers */
integer v=0; /* a value */
- t=type(p);
+ t=mp_type(p);
if ( t<mp_dependent ) v=value(p);
switch (t) {
case undefined: case mp_vacuous: case mp_boolean_type: case mp_known:
@@ -16881,7 +17115,7 @@ void mp_recycle_value (MP mp,pointer p) ;
case mp_unsuffixed_macro: case mp_suffixed_macro:
mp_delete_mac_ref(mp, value(p)); break;
} /* there are no other cases */
- type(p)=undefined;
+ mp_type(p)=undefined;
}
@ @<Recycle a big node@>=
@@ -16896,10 +17130,10 @@ if ( v!=null ){
@ @<Recycle a dependency list@>=
{
q=dep_list(p);
- while ( info(q)!=null ) q=link(q);
- link(prev_dep(p))=link(q);
- prev_dep(link(q))=prev_dep(p);
- link(q)=null; mp_flush_node_list(mp, dep_list(p));
+ while ( mp_info(q)!=null ) q=mp_link(q);
+ mp_link(prev_dep(p))=mp_link(q);
+ prev_dep(mp_link(q))=prev_dep(p);
+ mp_link(q)=null; mp_flush_node_list(mp, dep_list(p));
}
@ When an independent variable disappears, it simply fades away, unless
@@ -16935,24 +17169,24 @@ proto-dependent cases.
{
mp->max_c[mp_dependent]=0; mp->max_c[mp_proto_dependent]=0;
mp->max_link[mp_dependent]=null; mp->max_link[mp_proto_dependent]=null;
- q=link(dep_head);
+ q=mp_link(dep_head);
while ( q!=dep_head ) {
- s=value_loc(q); /* now |link(s)=dep_list(q)| */
+ s=value_loc(q); /* now |mp_link(s)=dep_list(q)| */
while (1) {
- r=link(s);
- if ( info(r)==null ) break;
- if ( info(r)!=p ) {
+ r=mp_link(s);
+ if ( mp_info(r)==null ) break;
+ if ( mp_info(r)!=p ) {
s=r;
} else {
- t=type(q); link(s)=link(r); info(r)=q;
+ t=mp_type(q); mp_link(s)=mp_link(r); mp_info(r)=q;
if ( abs(value(r))>mp->max_c[t] ) {
@<Record a new maximum coefficient of type |t|@>;
} else {
- link(r)=mp->max_link[t]; mp->max_link[t]=r;
+ mp_link(r)=mp->max_link[t]; mp->max_link[t]=r;
}
}
}
- q=link(r);
+ q=mp_link(r);
}
if ( (mp->max_c[mp_dependent]>0)||(mp->max_c[mp_proto_dependent]>0) ) {
@<Choose a dependent variable to take the place of the disappearing
@@ -16971,7 +17205,7 @@ pointer max_link[mp_proto_dependent+1]; /* other occurrences of |p| */
@ @<Record a new maximum coefficient...@>=
{
if ( mp->max_c[t]>0 ) {
- link(mp->max_ptr[t])=mp->max_link[t]; mp->max_link[t]=mp->max_ptr[t];
+ mp_link(mp->max_ptr[t])=mp->max_link[t]; mp->max_link[t]=mp->max_ptr[t];
}
mp->max_c[t]=abs(value(r)); mp->max_ptr[t]=r;
}
@@ -16986,7 +17220,7 @@ pointer max_link[mp_proto_dependent+1]; /* other occurrences of |p| */
variable~|p|@>;
t=mp_dependent+mp_proto_dependent-t; /* complement |t| */
if ( mp->max_c[t]>0 ) { /* we need to pick up an unchosen dependency */
- link(mp->max_ptr[t])=mp->max_link[t]; mp->max_link[t]=mp->max_ptr[t];
+ mp_link(mp->max_ptr[t])=mp->max_link[t]; mp->max_link[t]=mp->max_ptr[t];
}
if ( t!=mp_dependent ) { @<Substitute new dependencies in place of |p|@>; }
else { @<Substitute new proto-dependencies in place of |p|@>;}
@@ -16996,7 +17230,7 @@ pointer max_link[mp_proto_dependent+1]; /* other occurrences of |p| */
}
@ Let |s=max_ptr[t]|. At this point we have $|value|(s)=\pm|max_c|[t]$,
-and |info(s)| points to the dependent variable~|pp| of type~|t| from
+and |mp_info(s)| points to the dependent variable~|pp| of type~|t| from
whose dependency list we have removed node~|s|. We must reinsert
node~|s| into the dependency list, with coefficient $-1.0$, and with
|pp| as the new independent variable. Since |pp| will have a larger serial
@@ -17004,12 +17238,12 @@ number than any other variable, we can put node |s| at the head of the
list.
@<Determine the dep...@>=
-s=mp->max_ptr[t]; pp=info(s); v=value(s);
+s=mp->max_ptr[t]; pp=mp_info(s); v=value(s);
if ( t==mp_dependent ) value(s)=-fraction_one; else value(s)=-unity;
-r=dep_list(pp); link(s)=r;
-while ( info(r)!=null ) r=link(r);
-q=link(r); link(r)=null;
-prev_dep(q)=prev_dep(pp); link(prev_dep(pp))=q;
+r=dep_list(pp); mp_link(s)=r;
+while ( mp_info(r)!=null ) r=mp_link(r);
+q=mp_link(r); mp_link(r)=null;
+prev_dep(q)=prev_dep(pp); mp_link(prev_dep(pp))=q;
new_indep(pp);
if ( mp->cur_exp==pp ) if ( mp->cur_type==t ) mp->cur_type=mp_independent;
if ( mp->internal[mp_tracing_equations]>0 ) {
@@ -17023,7 +17257,7 @@ by the dependency list~|s|.
if ( mp_interesting(mp, p) ) {
mp_begin_diagnostic(mp); mp_print_nl(mp, "### ");
@:]]]\#\#\#_}{\.{\#\#\#}@>
- if ( v>0 ) mp_print_char(mp, '-');
+ if ( v>0 ) mp_print_char(mp, xord('-'));
if ( t==mp_dependent ) vv=mp_round_fraction(mp, mp->max_c[mp_dependent]);
else vv=mp->max_c[mp_proto_dependent];
if ( vv!=unity ) mp_print_scaled(mp, vv);
@@ -17031,7 +17265,7 @@ if ( mp_interesting(mp, p) ) {
while ( value(p) % s_scale>0 ) {
mp_print(mp, "*4"); value(p)=value(p)-2;
}
- if ( t==mp_dependent ) mp_print_char(mp, '='); else mp_print(mp, " = ");
+ if ( t==mp_dependent ) mp_print_char(mp, xord('=')); else mp_print(mp, " = ");
mp_print_dependency(mp, s,t);
mp_end_diagnostic(mp, false);
}
@@ -17043,11 +17277,11 @@ dependency lists must be brought up to date.
for (t=mp_dependent;t<=mp_proto_dependent;t++){
r=mp->max_link[t];
while ( r!=null ) {
- q=info(r);
+ q=mp_info(r);
dep_list(q)=mp_p_plus_fq(mp, dep_list(q),
mp_make_fraction(mp, value(r),-v),s,t,mp_dependent);
if ( dep_list(q)==mp->dep_final ) mp_make_known(mp, q,mp->dep_final);
- q=r; r=link(r); mp_free_node(mp, q,dep_node_size);
+ q=r; r=mp_link(r); mp_free_node(mp, q,dep_node_size);
}
}
@@ -17055,13 +17289,13 @@ for (t=mp_dependent;t<=mp_proto_dependent;t++){
for (t=mp_dependent;t<=mp_proto_dependent;t++) {
r=mp->max_link[t];
while ( r!=null ) {
- q=info(r);
+ q=mp_info(r);
if ( t==mp_dependent ) { /* for safety's sake, we change |q| to |mp_proto_dependent| */
if ( mp->cur_exp==q ) if ( mp->cur_type==mp_dependent )
mp->cur_type=mp_proto_dependent;
dep_list(q)=mp_p_over_v(mp, dep_list(q),unity,
mp_dependent,mp_proto_dependent);
- type(q)=mp_proto_dependent;
+ mp_type(q)=mp_proto_dependent;
value(r)=mp_round_fraction(mp, value(r));
}
dep_list(q)=mp_p_plus_fq(mp, dep_list(q),
@@ -17069,7 +17303,7 @@ for (t=mp_dependent;t<=mp_proto_dependent;t++) {
mp_proto_dependent,mp_proto_dependent);
if ( dep_list(q)==mp->dep_final )
mp_make_known(mp, q,mp->dep_final);
- q=r; r=link(r); mp_free_node(mp, q,dep_node_size);
+ q=r; r=mp_link(r); mp_free_node(mp, q,dep_node_size);
}
}
@@ -17084,9 +17318,9 @@ then they get it back again. (Or perhaps they get another token, if
the user has changed things.)
@<Declarations@>=
-void mp_flush_error (MP mp,scaled v);
-void mp_put_get_error (MP mp);
-void mp_put_get_flush_error (MP mp,scaled v) ;
+static void mp_flush_error (MP mp,scaled v);
+static void mp_put_get_error (MP mp);
+static void mp_put_get_flush_error (MP mp,scaled v) ;
@ @c
void mp_flush_error (MP mp,scaled v) {
@@ -17187,15 +17421,16 @@ DONE:
@ Errors at the beginning of expressions are flagged by |bad_exp|.
-@c void mp_bad_exp (MP mp, const char * s) {
+@c
+static void mp_bad_exp (MP mp, const char * s) {
int save_flag;
print_err(s); mp_print(mp, " expression can't begin with `");
mp_print_cmd_mod(mp, mp->cur_cmd,mp->cur_mod);
- mp_print_char(mp, '\'');
- help4("I'm afraid I need some sort of value in order to continue,")
- ("so I've tentatively inserted `0'. You may want to")
- ("delete this zero and insert something else;")
- ("see Chapter 27 of The METAFONTbook for an example.");
+ mp_print_char(mp, xord('\''));
+ help4("I'm afraid I need some sort of value in order to continue,",
+ "so I've tentatively inserted `0'. You may want to",
+ "delete this zero and insert something else;",
+ "see Chapter 27 of The METAFONTbook for an example.");
@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>
mp_back_input(mp); mp->cur_sym=0; mp->cur_cmd=numeric_token;
mp->cur_mod=0; mp_ins_error(mp);
@@ -17225,9 +17460,10 @@ if ( mp->interrupt!=0 ) if ( mp->OK_to_interrupt ) {
@ The |stash_in| subroutine puts the current (numeric) expression into a field
within a ``big node.''
-@c void mp_stash_in (MP mp,pointer p) {
+@c
+static void mp_stash_in (MP mp,pointer p) {
pointer q; /* temporary register */
- type(p)=mp->cur_type;
+ mp_type(p)=mp->cur_type;
if ( mp->cur_type==mp_known ) {
value(p)=mp->cur_exp;
} else {
@@ -17236,7 +17472,7 @@ within a ``big node.''
} else {
mp->mem[value_loc(p)]=mp->mem[value_loc(mp->cur_exp)];
/* |dep_list(p):=dep_list(cur_exp)| and |prev_dep(p):=prev_dep(cur_exp)| */
- link(prev_dep(p))=p;
+ mp_link(prev_dep(p))=p;
}
mp_free_node(mp, mp->cur_exp,value_node_size);
}
@@ -17252,9 +17488,9 @@ we copy it, then recycle it.
{
q=mp_single_dependency(mp, mp->cur_exp);
if ( q==mp->dep_final ){
- type(p)=mp_known; value(p)=0; mp_free_node(mp, q,dep_node_size);
+ mp_type(p)=mp_known; value(p)=0; mp_free_node(mp, q,dep_node_size);
} else {
- type(p)=mp_dependent; mp_new_dep(mp, p,q);
+ mp_type(p)=mp_dependent; mp_new_dep(mp, p,q);
}
mp_recycle_value(mp, mp->cur_exp);
}
@@ -17267,9 +17503,9 @@ are synonymous with |x_part_loc| and |y_part_loc|.
p=mp_stash_cur_exp(mp);
mp_get_x_next(mp); mp_scan_expression(mp);
@<Make sure the second part of a pair or color has a numeric type@>;
-q=mp_get_node(mp, value_node_size); name_type(q)=mp_capsule;
-if ( mp->cur_cmd==comma ) type(q)=mp_color_type;
-else type(q)=mp_pair_type;
+q=mp_get_node(mp, value_node_size); mp_name_type(q)=mp_capsule;
+if ( mp->cur_cmd==comma ) mp_type(q)=mp_color_type;
+else mp_type(q)=mp_pair_type;
mp_init_big_node(mp, q); r=value(q);
mp_stash_in(mp, y_part_loc(r));
mp_unstash_cur_exp(mp, p);
@@ -17278,7 +17514,7 @@ if ( mp->cur_cmd==comma ) {
@<Scan the last of a triplet of numerics@>;
}
if ( mp->cur_cmd==comma ) {
- type(q)=mp_cmykcolor_type;
+ mp_type(q)=mp_cmykcolor_type;
mp_init_big_node(mp, q); t=value(q);
mp->mem[cyan_part_loc(t)]=mp->mem[red_part_loc(r)];
value(cyan_part_loc(t))=value(red_part_loc(r));
@@ -17291,7 +17527,7 @@ if ( mp->cur_cmd==comma ) {
@<Scan the last of a quartet of numerics@>;
}
mp_check_delimiter(mp, l_delim,r_delim);
-mp->cur_type=type(q);
+mp->cur_type=mp_type(q);
mp->cur_exp=q;
}
@@ -17299,10 +17535,10 @@ mp->cur_exp=q;
if ( mp->cur_type<mp_known ) {
exp_err("Nonnumeric ypart has been replaced by 0");
@.Nonnumeric...replaced by 0@>
- help4("I've started to scan a pair `(a,b)' or a color `(a,b,c)';")
- ("but after finding a nice `a' I found a `b' that isn't")
- ("of numeric type. So I've changed that part to zero.")
- ("(The b that I didn't like appears above the error message.)");
+ help4("I've started to scan a pair `(a,b)' or a color `(a,b,c)';",
+ "but after finding a nice `a' I found a `b' that isn't",
+ "of numeric type. So I've changed that part to zero.",
+ "(The b that I didn't like appears above the error message.)");
mp_put_get_flush_error(mp, 0);
}
@@ -17312,9 +17548,9 @@ if ( mp->cur_type<mp_known ) {
if ( mp->cur_type<mp_known ) {
exp_err("Nonnumeric third part has been replaced by 0");
@.Nonnumeric...replaced by 0@>
- help3("I've just scanned a color `(a,b,c)' or cmykcolor(a,b,c,d); but the `c'")
- ("isn't of numeric type. So I've changed that part to zero.")
- ("(The c that I didn't like appears above the error message.)");
+ help3("I've just scanned a color `(a,b,c)' or cmykcolor(a,b,c,d); but the `c'",
+ "isn't of numeric type. So I've changed that part to zero.",
+ "(The c that I didn't like appears above the error message.)");
mp_put_get_flush_error(mp, 0);
}
mp_stash_in(mp, blue_part_loc(r));
@@ -17326,9 +17562,9 @@ if ( mp->cur_type<mp_known ) {
if ( mp->cur_type<mp_known ) {
exp_err("Nonnumeric blackpart has been replaced by 0");
@.Nonnumeric...replaced by 0@>
- help3("I've just scanned a cmykcolor `(c,m,y,k)'; but the `k' isn't")
- ("of numeric type. So I've changed that part to zero.")
- ("(The k that I didn't like appears above the error message.)");
+ help3("I've just scanned a cmykcolor `(c,m,y,k)'; but the `k' isn't",
+ "of numeric type. So I've changed that part to zero.",
+ "(The k that I didn't like appears above the error message.)");
mp_put_get_flush_error(mp, 0);
}
mp_stash_in(mp, black_part_loc(r));
@@ -17354,8 +17590,8 @@ integer group_line; /* where a group began */
@.A group...never ended@>
mp_print_int(mp, group_line);
mp_print(mp, " never ended");
- help2("I saw a `begingroup' back there that hasn't been matched")
- ("by `endgroup'. So I've inserted `endgroup' now.");
+ help2("I saw a `begingroup' back there that hasn't been matched",
+ "by `endgroup'. So I've inserted `endgroup' now.");
mp_back_error(mp); mp->cur_cmd=end_group;
}
mp_unsave(mp);
@@ -17479,7 +17715,7 @@ of the save stack, as described earlier.)
mp_get_x_next(mp);
if ( mp->cur_cmd==assignment ) {
mp->cur_exp=mp_get_avail(mp);
- info(mp->cur_exp)=q+hash_end; mp->cur_type=mp_token_list;
+ mp_info(mp->cur_exp)=q+hash_end; mp->cur_type=mp_token_list;
goto DONE;
}
mp_back_input(mp);
@@ -17502,14 +17738,14 @@ that is currently growing.
Another local variable, |tt|, contains partial information about the
declared type of the variable-so-far. If |tt>=mp_unsuffixed_macro|, the
-relation |tt=type(q)| will always hold. If |tt=undefined|, the routine
+relation |tt=mp_type(q)| will always hold. If |tt=undefined|, the routine
doesn't bother to update its information about type. And if
|undefined<tt<mp_unsuffixed_macro|, the precise value of |tt| isn't critical.
@ @<Other local variables for |scan_primary|@>=
pointer pre_head,post_head,tail;
/* prefix and suffix list variables */
-small_number tt; /* approximation to the type of the variable-so-far */
+quarterword tt; /* approximation to the type of the variable-so-far */
pointer t; /* a token */
pointer macro_ref = 0; /* reference count for a suffixed macro */
@@ -17517,7 +17753,7 @@ pointer macro_ref = 0; /* reference count for a suffixed macro */
{
fast_get_avail(pre_head); tail=pre_head; post_head=null; tt=mp_vacuous;
while (1) {
- t=mp_cur_tok(mp); link(tail)=t;
+ t=mp_cur_tok(mp); mp_link(tail)=t;
if ( tt!=undefined ) {
@<Find the approximate type |tt| and corresponding~|q|@>;
if ( tt>=mp_unsuffixed_macro ) {
@@ -17539,9 +17775,9 @@ pointer macro_ref = 0; /* reference count for a suffixed macro */
@ @<Either begin an unsuffixed macro call or...@>=
{
- link(tail)=null;
+ mp_link(tail)=null;
if ( tt>mp_unsuffixed_macro ) { /* |tt=mp_suffixed_macro| */
- post_head=mp_get_avail(mp); tail=post_head; link(tail)=t;
+ post_head=mp_get_avail(mp); tail=post_head; mp_link(tail)=t;
tt=undefined; macro_ref=value(q); add_mac_ref(macro_ref);
} else {
@<Set up unsuffixed macro call and |goto restart|@>;
@@ -17573,19 +17809,21 @@ so as to avoid any embarrassment about our incorrect assumption.
@ Here's a routine that puts the current expression back to be read again.
-@c void mp_back_expr (MP mp) {
+@c
+static void mp_back_expr (MP mp) {
pointer p; /* capsule token */
- p=mp_stash_cur_exp(mp); link(p)=null; back_list(p);
+ p=mp_stash_cur_exp(mp); mp_link(p)=null; back_list(p);
}
@ Unknown subscripts lead to the following error message.
-@c void mp_bad_subscript (MP mp) {
+@c
+static void mp_bad_subscript (MP mp) {
exp_err("Improper subscript has been replaced by zero");
@.Improper subscript...@>
- help3("A bracketed subscript must have a known numeric value;")
- ("unfortunately, what I found was the value that appears just")
- ("above this error message. So I'll try a zero subscript.");
+ help3("A bracketed subscript must have a known numeric value;",
+ "unfortunately, what I found was the value that appears just",
+ "above this error message. So I'll try a zero subscript.");
mp_flush_error(mp, 0);
}
@@ -17596,20 +17834,20 @@ into the variable structure; we need to start searching from the root each time.
@<Find the approximate type |tt| and corresponding~|q|@>=
@^inner loop@>
{
- p=link(pre_head); q=info(p); tt=undefined;
+ p=mp_link(pre_head); q=mp_info(p); tt=undefined;
if ( eq_type(q) % outer_tag==tag_token ) {
q=equiv(q);
if ( q==null ) goto DONE2;
while (1) {
- p=link(p);
+ p=mp_link(p);
if ( p==null ) {
- tt=type(q); goto DONE2;
+ tt=mp_type(q); goto DONE2;
};
- if ( type(q)!=mp_structured ) goto DONE2;
- q=link(attr_head(q)); /* the |collective_subscript| attribute */
+ if ( mp_type(q)!=mp_structured ) goto DONE2;
+ q=mp_link(attr_head(q)); /* the |collective_subscript| attribute */
if ( p>=mp->hi_mem_min ) { /* it's not a subscript */
- do { q=link(q); } while (! (attr_loc(q)>=info(p)));
- if ( attr_loc(q)>info(p) ) goto DONE2;
+ do { q=mp_link(q); } while (! (attr_loc(q)>=mp_info(p)));
+ if ( attr_loc(q)>mp_info(p) ) goto DONE2;
}
}
}
@@ -17620,7 +17858,7 @@ DONE2:
@ How do things stand now? Well, we have scanned an entire variable name,
including possible subscripts and/or attributes; |cur_cmd|, |cur_mod|, and
|cur_sym| represent the token that follows. If |post_head=null|, a
-token list for this variable name starts at |link(pre_head)|, with all
+token list for this variable name starts at |mp_link(pre_head)|, with all
subscripts evaluated. But if |post_head<>null|, the variable turned out
to be a suffixed macro; |pre_head| is the head of the prefix list, while
|post_head| is the head of a token list containing both `\.{\AT!}' and
@@ -17636,15 +17874,15 @@ unexpectedly disappears. Its help message isn't quite right for
our present purposes, but we'll be able to fix that up.
@c
-void mp_obliterated (MP mp,pointer q) {
+static void mp_obliterated (MP mp,pointer q) {
print_err("Variable "); mp_show_token_list(mp, q,null,1000,0);
mp_print(mp, " has been obliterated");
@.Variable...obliterated@>
- help5("It seems you did a nasty thing---probably by accident,")
- ("but nevertheless you nearly hornswoggled me...")
- ("While I was evaluating the right-hand side of this")
- ("command, something happened, and the left-hand side")
- ("is no longer a variable! So I won't change anything.");
+ help5("It seems you did a nasty thing---probably by accident,",
+ "but nevertheless you nearly hornswoggled me...",
+ "While I was evaluating the right-hand side of this",
+ "command, something happened, and the left-hand side",
+ "is no longer a variable! So I won't change anything.");
}
@ If the variable does exist, we also need to check
@@ -17655,7 +17893,7 @@ variable has, indeed, been scanned.
if ( post_head!=null ) {
@<Set up suffixed macro call and |goto restart|@>;
}
-q=link(pre_head); free_avail(pre_head);
+q=mp_link(pre_head); free_avail(pre_head);
if ( mp->cur_cmd==my_var_flag ) {
mp->cur_type=mp_token_list; mp->cur_exp=q; goto DONE;
}
@@ -17677,8 +17915,8 @@ and ``at'' parameters must be packaged in an appropriate list of lists.
@<Set up unsuffixed macro call and |goto restart|@>=
{
- p=mp_get_avail(mp); info(pre_head)=link(pre_head); link(pre_head)=p;
- info(p)=t; mp_macro_call(mp, value(q),pre_head,null);
+ p=mp_get_avail(mp); mp_info(pre_head)=mp_link(pre_head); mp_link(pre_head)=p;
+ mp_info(p)=t; mp_macro_call(mp, value(q),pre_head,null);
mp_get_x_next(mp);
goto RESTART;
}
@@ -17689,9 +17927,9 @@ token list.
@<Set up suffixed macro call and |goto restart|@>=
{
- mp_back_input(mp); p=mp_get_avail(mp); q=link(post_head);
- info(pre_head)=link(pre_head); link(pre_head)=post_head;
- info(post_head)=q; link(post_head)=p; info(p)=link(q); link(q)=null;
+ mp_back_input(mp); p=mp_get_avail(mp); q=mp_link(post_head);
+ mp_info(pre_head)=mp_link(pre_head); mp_link(pre_head)=post_head;
+ mp_info(post_head)=q; mp_link(post_head)=p; mp_info(p)=mp_link(q); mp_link(q)=null;
mp_macro_call(mp, macro_ref,pre_head,null); decr(ref_count(macro_ref));
mp_get_x_next(mp); goto RESTART;
}
@@ -17702,10 +17940,10 @@ because of the multiplicity of possible cases.
@<Declare the procedure called |make_exp_copy|@>=
@<Declare subroutines needed by |make_exp_copy|@>
-void mp_make_exp_copy (MP mp,pointer p) {
+static void mp_make_exp_copy (MP mp,pointer p) {
pointer q,r,t; /* registers for list manipulation */
RESTART:
- mp->cur_type=type(p);
+ mp->cur_type=mp_type(p);
switch (mp->cur_type) {
case mp_vacuous: case mp_boolean_type: case mp_known:
mp->cur_exp=value(p); break;
@@ -17753,9 +17991,9 @@ RESTART:
tail of dependency list~|p|.
@<Declare subroutines needed by |make_exp_copy|@>=
-void mp_encapsulate (MP mp,pointer p) {
- mp->cur_exp=mp_get_node(mp, value_node_size); type(mp->cur_exp)=mp->cur_type;
- name_type(mp->cur_exp)=mp_capsule; mp_new_dep(mp, mp->cur_exp,p);
+static void mp_encapsulate (MP mp,pointer p) {
+ mp->cur_exp=mp_get_node(mp, value_node_size); mp_type(mp->cur_exp)=mp->cur_type;
+ mp_name_type(mp->cur_exp)=mp_capsule; mp_new_dep(mp, mp->cur_exp,p);
}
@ The most tedious case arises when the user refers to a
@@ -17767,7 +18005,7 @@ or |known|.
{
if ( value(p)==null )
mp_init_big_node(mp, p);
- t=mp_get_node(mp, value_node_size); name_type(t)=mp_capsule; type(t)=mp->cur_type;
+ t=mp_get_node(mp, value_node_size); mp_name_type(t)=mp_capsule; mp_type(t)=mp->cur_type;
mp_init_big_node(mp, t);
q=value(p)+mp->big_node_size[mp->cur_type];
r=value(t)+mp->big_node_size[mp->cur_type];
@@ -17781,19 +18019,19 @@ or |known|.
a big node that will be part of a capsule.
@<Declare subroutines needed by |make_exp_copy|@>=
-void mp_install (MP mp,pointer r, pointer q) {
+static void mp_install (MP mp,pointer r, pointer q) {
pointer p; /* temporary register */
- if ( type(q)==mp_known ){
- value(r)=value(q); type(r)=mp_known;
- } else if ( type(q)==mp_independent ) {
+ if ( mp_type(q)==mp_known ){
+ value(r)=value(q); mp_type(r)=mp_known;
+ } else if ( mp_type(q)==mp_independent ) {
p=mp_single_dependency(mp, q);
if ( p==mp->dep_final ) {
- type(r)=mp_known; value(r)=0; mp_free_node(mp, p,dep_node_size);
+ mp_type(r)=mp_known; value(r)=0; mp_free_node(mp, p,dep_node_size);
} else {
- type(r)=mp_dependent; mp_new_dep(mp, r,p);
+ mp_type(r)=mp_dependent; mp_new_dep(mp, r,p);
}
} else {
- type(r)=type(q); mp_new_dep(mp, r,mp_copy_dep_list(mp, dep_list(q)));
+ mp_type(r)=mp_type(q); mp_new_dep(mp, r,mp_copy_dep_list(mp, dep_list(q)));
}
}
@@ -17812,9 +18050,9 @@ provided that \.a is numeric.
if ( mp->cur_cmd!=right_bracket ) {
mp_missing_err(mp, "]");
@.Missing `]'@>
- help3("I've scanned an expression of the form `a[b,c',")
- ("so a right bracket should have come next.")
- ("I shall pretend that one was there.");
+ help3("I've scanned an expression of the form `a[b,c',",
+ "so a right bracket should have come next.",
+ "I shall pretend that one was there.");
mp_back_error(mp);
}
r=mp_stash_cur_exp(mp); mp_make_exp_copy(mp, q);
@@ -17827,7 +18065,7 @@ provided that \.a is numeric.
\&{suffix} parameters of a macro.
@<Declare the basic parsing subroutines@>=
-void mp_scan_suffix (MP mp) {
+static void mp_scan_suffix (MP mp) {
pointer h,t; /* head and tail of the list being built */
pointer p; /* temporary register */
h=mp_get_avail(mp); t=h;
@@ -17838,13 +18076,13 @@ void mp_scan_suffix (MP mp) {
if ( mp->cur_cmd==numeric_token ) {
p=mp_new_num_tok(mp, mp->cur_mod);
} else if ((mp->cur_cmd==tag_token)||(mp->cur_cmd==internal_quantity) ) {
- p=mp_get_avail(mp); info(p)=mp->cur_sym;
+ p=mp_get_avail(mp); mp_info(p)=mp->cur_sym;
} else {
break;
}
- link(t)=p; t=p; mp_get_x_next(mp);
+ mp_link(t)=p; t=p; mp_get_x_next(mp);
}
- mp->cur_exp=link(h); free_avail(h); mp->cur_type=mp_token_list;
+ mp->cur_exp=mp_link(h); free_avail(h); mp->cur_type=mp_token_list;
}
@ @<Scan a bracketed subscript and set |cur_cmd:=numeric_token|@>=
@@ -17854,9 +18092,9 @@ void mp_scan_suffix (MP mp) {
if ( mp->cur_cmd!=right_bracket ) {
mp_missing_err(mp, "]");
@.Missing `]'@>
- help3("I've seen a `[' and a subscript value, in a suffix,")
- ("so a right bracket should have come next.")
- ("I shall pretend that one was there.");
+ help3("I've seen a `[' and a subscript value, in a suffix,",
+ "so a right bracket should have come next.",
+ "I shall pretend that one was there.");
mp_back_error(mp);
}
mp->cur_cmd=numeric_token; mp->cur_mod=mp->cur_exp;
@@ -17875,7 +18113,7 @@ been scanned; we solve this by increasing the reference count of its token
list, so that the macro can be called even after it has been clobbered.
@<Declare the basic parsing subroutines@>=
-void mp_scan_secondary (MP mp) {
+static void mp_scan_secondary (MP mp) {
pointer p; /* for list manipulation */
halfword c,d; /* operation codes or modifiers */
pointer mac_name; /* token defined with \&{primarydef} */
@@ -17912,17 +18150,18 @@ CONTINUE:
@ The following procedure calls a macro that has two parameters,
|p| and |cur_exp|.
-@c void mp_binary_mac (MP mp,pointer p, pointer c, pointer n) {
+@c
+static void mp_binary_mac (MP mp,pointer p, pointer c, pointer n) {
pointer q,r; /* nodes in the parameter list */
- q=mp_get_avail(mp); r=mp_get_avail(mp); link(q)=r;
- info(q)=p; info(r)=mp_stash_cur_exp(mp);
+ q=mp_get_avail(mp); r=mp_get_avail(mp); mp_link(q)=r;
+ mp_info(q)=p; mp_info(r)=mp_stash_cur_exp(mp);
mp_macro_call(mp, c,q,n);
}
@ The next procedure, |scan_tertiary|, is pretty much the same deal.
@<Declare the basic parsing subroutines@>=
-void mp_scan_tertiary (MP mp) {
+static void mp_scan_tertiary (MP mp) {
pointer p; /* for list manipulation */
halfword c,d; /* operation codes or modifiers */
pointer mac_name; /* token defined with \&{secondarydef} */
@@ -17960,7 +18199,7 @@ paths, which materialize here.
@d finish_path 26 /* another */
@<Declare the basic parsing subroutines@>=
-void mp_scan_expression (MP mp) {
+static void mp_scan_expression (MP mp) {
pointer p,q,r,pp,qq; /* for list manipulation */
halfword c,d; /* operation codes or modifiers */
int my_var_flag; /* initial value of |var_flag| */
@@ -17985,7 +18224,7 @@ CONTINUE:
mac_name=mp->cur_sym; add_mac_ref(c);
}
if ( (d<ampersand)||((d==ampersand)&&
- ((type(p)==mp_pair_type)||(type(p)==mp_path_type))) ) {
+ ((mp_type(p)==mp_pair_type)||(mp_type(p)==mp_path_type))) ) {
@<Scan a path construction operation;
but |return| if |p| has the wrong type@>;
} else {
@@ -18036,22 +18275,22 @@ FINISH_PATH:
else if ( mp->cur_type==mp_path_type ) p=mp->cur_exp;
else return;
q=p;
- while ( link(q)!=p ) q=link(q);
- if ( left_type(p)!=mp_endpoint ) { /* open up a cycle */
- r=mp_copy_knot(mp, p); link(q)=r; q=r;
+ while ( mp_link(q)!=p ) q=mp_link(q);
+ if ( mp_left_type(p)!=mp_endpoint ) { /* open up a cycle */
+ r=mp_copy_knot(mp, p); mp_link(q)=r; q=r;
}
- left_type(p)=mp_open; right_type(q)=mp_open;
+ mp_left_type(p)=mp_open; mp_right_type(q)=mp_open;
}
@ A pair of numeric values is changed into a knot node for a one-point path
when \MP\ discovers that the pair is part of a path.
-@c @<Declare the procedure called |known_pair|@>
-pointer mp_new_knot (MP mp) { /* convert a pair to a knot with two endpoints */
+@c
+static pointer mp_new_knot (MP mp) { /* convert a pair to a knot with two endpoints */
pointer q; /* the new node */
- q=mp_get_node(mp, knot_node_size); left_type(q)=mp_endpoint;
- right_type(q)=mp_endpoint; originator(q)=mp_metapost_user; link(q)=q;
- mp_known_pair(mp); x_coord(q)=mp->cur_x; y_coord(q)=mp->cur_y;
+ q=mp_get_node(mp, knot_node_size); mp_left_type(q)=mp_endpoint;
+ mp_right_type(q)=mp_endpoint; mp_originator(q)=mp_metapost_user; mp_link(q)=q;
+ mp_known_pair(mp); mp_x_coord(q)=mp->cur_x; mp_y_coord(q)=mp->cur_y;
return q;
}
@@ -18060,18 +18299,21 @@ of the current expression, assuming that the current expression is a
pair of known numerics. Unknown components are zeroed, and the
current expression is flushed.
-@<Declare the procedure called |known_pair|@>=
+@<Declarations@>=
+static void mp_known_pair (MP mp);
+
+@ @c
void mp_known_pair (MP mp) {
pointer p; /* the pair node */
if ( mp->cur_type!=mp_pair_type ) {
exp_err("Undefined coordinates have been replaced by (0,0)");
@.Undefined coordinates...@>
- help5("I need x and y numbers for this part of the path.")
- ("The value I found (see above) was no good;")
- ("so I'll try to keep going by using zero instead.")
- ("(Chapter 27 of The METAFONTbook explains that")
+ help5("I need x and y numbers for this part of the path.",
+ "The value I found (see above) was no good;",
+ "so I'll try to keep going by using zero instead.",
+ "(Chapter 27 of The METAFONTbook explains that",
@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>
- ("you might want to type `I ??" "?' now.)");
+ "you might want to type `I ??" "?' now.)");
mp_put_get_flush_error(mp, 0); mp->cur_x=0; mp->cur_y=0;
} else {
p=value(mp->cur_exp);
@@ -18082,30 +18324,30 @@ void mp_known_pair (MP mp) {
}
@ @<Make sure that both |x| and |y| parts of |p| are known...@>=
-if ( type(x_part_loc(p))==mp_known ) {
+if ( mp_type(x_part_loc(p))==mp_known ) {
mp->cur_x=value(x_part_loc(p));
} else {
mp_disp_err(mp, x_part_loc(p),
"Undefined x coordinate has been replaced by 0");
@.Undefined coordinates...@>
- help5("I need a `known' x value for this part of the path.")
- ("The value I found (see above) was no good;")
- ("so I'll try to keep going by using zero instead.")
- ("(Chapter 27 of The METAFONTbook explains that")
+ help5("I need a `known' x value for this part of the path.",
+ "The value I found (see above) was no good;",
+ "so I'll try to keep going by using zero instead.",
+ "(Chapter 27 of The METAFONTbook explains that",
@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>
- ("you might want to type `I ??" "?' now.)");
+ "you might want to type `I ??" "?' now.)");
mp_put_get_error(mp); mp_recycle_value(mp, x_part_loc(p)); mp->cur_x=0;
}
-if ( type(y_part_loc(p))==mp_known ) {
+if ( mp_type(y_part_loc(p))==mp_known ) {
mp->cur_y=value(y_part_loc(p));
} else {
mp_disp_err(mp, y_part_loc(p),
"Undefined y coordinate has been replaced by 0");
- help5("I need a `known' y value for this part of the path.")
- ("The value I found (see above) was no good;")
- ("so I'll try to keep going by using zero instead.")
- ("(Chapter 27 of The METAFONTbook explains that")
- ("you might want to type `I ??" "?' now.)");
+ help5("I need a `known' y value for this part of the path.",
+ "The value I found (see above) was no good;",
+ "so I'll try to keep going by using zero instead.",
+ "(Chapter 27 of The METAFONTbook explains that",
+ "you might want to type `I ??" "?' now.)");
mp_put_get_error(mp); mp_recycle_value(mp, y_part_loc(p)); mp->cur_y=0;
}
@@ -18124,7 +18366,7 @@ if ( d==path_join ) {
mp_get_x_next(mp);
if ( mp->cur_cmd==left_brace ) {
@<Put the post-join direction information into |x| and |t|@>;
-} else if ( right_type(q)!=mp_explicit ) {
+} else if ( mp_right_type(q)!=mp_explicit ) {
t=mp_open; x=0;
}
@@ -18138,7 +18380,8 @@ appears in |cur_exp|).
There's nothing difficult about this subroutine, but the program is rather
lengthy because a variety of potential errors need to be nipped in the bud.
-@c small_number mp_scan_direction (MP mp) {
+@c
+static quarterword mp_scan_direction (MP mp) {
int t; /* the type of information found */
scaled x; /* an |x| coordinate */
mp_get_x_next(mp);
@@ -18150,9 +18393,9 @@ lengthy because a variety of potential errors need to be nipped in the bud.
if ( mp->cur_cmd!=right_brace ) {
mp_missing_err(mp, "}");
@.Missing `\char`\}'@>
- help3("I've scanned a direction spec for part of a path,")
- ("so a right brace should have come next.")
- ("I shall pretend that one was there.");
+ help3("I've scanned a direction spec for part of a path,",
+ "so a right brace should have come next.",
+ "I shall pretend that one was there.");
mp_back_error(mp);
}
mp_get_x_next(mp);
@@ -18186,60 +18429,60 @@ t=mp_curl;
if ( mp->cur_type!=mp_known ) {
exp_err("Undefined x coordinate has been replaced by 0");
@.Undefined coordinates...@>
- help5("I need a `known' x value for this part of the path.")
- ("The value I found (see above) was no good;")
- ("so I'll try to keep going by using zero instead.")
- ("(Chapter 27 of The METAFONTbook explains that")
+ help5("I need a `known' x value for this part of the path.",
+ "The value I found (see above) was no good;",
+ "so I'll try to keep going by using zero instead.",
+ "(Chapter 27 of The METAFONTbook explains that",
@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>
- ("you might want to type `I ??" "?' now.)");
+ "you might want to type `I ??" "?' now.)");
mp_put_get_flush_error(mp, 0);
}
x=mp->cur_exp;
if ( mp->cur_cmd!=comma ) {
mp_missing_err(mp, ",");
@.Missing `,'@>
- help2("I've got the x coordinate of a path direction;")
- ("will look for the y coordinate next.");
+ help2("I've got the x coordinate of a path direction;",
+ "will look for the y coordinate next.");
mp_back_error(mp);
}
mp_get_x_next(mp); mp_scan_expression(mp);
if ( mp->cur_type!=mp_known ) {
exp_err("Undefined y coordinate has been replaced by 0");
- help5("I need a `known' y value for this part of the path.")
- ("The value I found (see above) was no good;")
- ("so I'll try to keep going by using zero instead.")
- ("(Chapter 27 of The METAFONTbook explains that")
- ("you might want to type `I ??" "?' now.)");
+ help5("I need a `known' y value for this part of the path.",
+ "The value I found (see above) was no good;",
+ "so I'll try to keep going by using zero instead.",
+ "(Chapter 27 of The METAFONTbook explains that",
+ "you might want to type `I ??" "?' now.)");
mp_put_get_flush_error(mp, 0);
}
mp->cur_y=mp->cur_exp; mp->cur_x=x;
}
-@ At this point |right_type(q)| is usually |open|, but it may have been
+@ At this point |mp_right_type(q)| is usually |open|, but it may have been
set to some other value by a previous operation. We must maintain
-the value of |right_type(q)| in cases such as
+the value of |mp_right_type(q)| in cases such as
`\.{..\{curl2\}z\{0,0\}..}'.
@<Put the pre-join...@>=
{
t=mp_scan_direction(mp);
if ( t!=mp_open ) {
- right_type(q)=t; right_given(q)=mp->cur_exp;
- if ( left_type(q)==mp_open ) {
- left_type(q)=t; left_given(q)=mp->cur_exp;
+ mp_right_type(q)=t; right_given(q)=mp->cur_exp;
+ if ( mp_left_type(q)==mp_open ) {
+ mp_left_type(q)=t; left_given(q)=mp->cur_exp;
} /* note that |left_given(q)=left_curl(q)| */
}
}
-@ Since |left_tension| and |left_y| share the same position in knot nodes,
-and since |left_given| is similarly equivalent to |left_x|, we use
+@ Since |left_tension| and |mp_left_y| share the same position in knot nodes,
+and since |left_given| is similarly equivalent to |mp_left_x|, we use
|x| and |y| to hold the given direction and tension information when
there are no explicit control points.
@<Put the post-join...@>=
{
t=mp_scan_direction(mp);
- if ( right_type(q)!=mp_explicit ) x=mp->cur_exp;
+ if ( mp_right_type(q)!=mp_explicit ) x=mp->cur_exp;
else t=mp_explicit; /* the direction information is superfluous */
}
@@ -18294,10 +18537,10 @@ if ( (mp->cur_type!=mp_known)||(mp->cur_exp<min_tension) ) {
@ @<Set explicit control points@>=
{
- right_type(q)=mp_explicit; t=mp_explicit; mp_get_x_next(mp); mp_scan_primary(mp);
- mp_known_pair(mp); right_x(q)=mp->cur_x; right_y(q)=mp->cur_y;
+ mp_right_type(q)=mp_explicit; t=mp_explicit; mp_get_x_next(mp); mp_scan_primary(mp);
+ mp_known_pair(mp); mp_right_x(q)=mp->cur_x; mp_right_y(q)=mp->cur_y;
if ( mp->cur_cmd!=and_command ) {
- x=right_x(q); y=right_y(q);
+ x=mp_right_x(q); y=mp_right_y(q);
} else {
mp_get_x_next(mp); mp_scan_primary(mp);
mp_known_pair(mp); x=mp->cur_x; y=mp->cur_y;
@@ -18309,11 +18552,11 @@ if ( (mp->cur_type!=mp_known)||(mp->cur_exp<min_tension) ) {
if ( mp->cur_type!=mp_path_type ) pp=mp_new_knot(mp);
else pp=mp->cur_exp;
qq=pp;
- while ( link(qq)!=pp ) qq=link(qq);
- if ( left_type(pp)!=mp_endpoint ) { /* open up a cycle */
- r=mp_copy_knot(mp, pp); link(qq)=r; qq=r;
+ while ( mp_link(qq)!=pp ) qq=mp_link(qq);
+ if ( mp_left_type(pp)!=mp_endpoint ) { /* open up a cycle */
+ r=mp_copy_knot(mp, pp); mp_link(qq)=r; qq=r;
}
- left_type(pp)=mp_open; right_type(qq)=mp_open;
+ mp_left_type(pp)=mp_open; mp_right_type(qq)=mp_open;
}
@ If a person tries to define an entire path by saying `\.{(x,y)\&cycle}',
@@ -18331,50 +18574,50 @@ shouldn't have length zero.
@ @<Join the partial paths and reset |p| and |q|...@>=
{
if ( d==ampersand ) {
- if ( (x_coord(q)!=x_coord(pp))||(y_coord(q)!=y_coord(pp)) ) {
+ if ( (mp_x_coord(q)!=mp_x_coord(pp))||(mp_y_coord(q)!=mp_y_coord(pp)) ) {
print_err("Paths don't touch; `&' will be changed to `..'");
@.Paths don't touch@>
- help3("When you join paths `p&q', the ending point of p")
- ("must be exactly equal to the starting point of q.")
- ("So I'm going to pretend that you said `p..q' instead.");
+ help3("When you join paths `p&q', the ending point of p",
+ "must be exactly equal to the starting point of q.",
+ "So I'm going to pretend that you said `p..q' instead.");
mp_put_get_error(mp); d=path_join; right_tension(q)=unity; y=unity;
}
}
-@<Plug an opening in |right_type(pp)|, if possible@>;
+@<Plug an opening in |mp_right_type(pp)|, if possible@>;
if ( d==ampersand ) {
@<Splice independent paths together@>;
} else {
- @<Plug an opening in |right_type(q)|, if possible@>;
- link(q)=pp; left_y(pp)=y;
- if ( t!=mp_open ) { left_x(pp)=x; left_type(pp)=t; };
+ @<Plug an opening in |mp_right_type(q)|, if possible@>;
+ mp_link(q)=pp; mp_left_y(pp)=y;
+ if ( t!=mp_open ) { mp_left_x(pp)=x; mp_left_type(pp)=t; };
}
q=qq;
}
-@ @<Plug an opening in |right_type(q)|...@>=
-if ( right_type(q)==mp_open ) {
- if ( (left_type(q)==mp_curl)||(left_type(q)==mp_given) ) {
- right_type(q)=left_type(q); right_given(q)=left_given(q);
+@ @<Plug an opening in |mp_right_type(q)|...@>=
+if ( mp_right_type(q)==mp_open ) {
+ if ( (mp_left_type(q)==mp_curl)||(mp_left_type(q)==mp_given) ) {
+ mp_right_type(q)=mp_left_type(q); right_given(q)=left_given(q);
}
}
-@ @<Plug an opening in |right_type(pp)|...@>=
-if ( right_type(pp)==mp_open ) {
+@ @<Plug an opening in |mp_right_type(pp)|...@>=
+if ( mp_right_type(pp)==mp_open ) {
if ( (t==mp_curl)||(t==mp_given) ) {
- right_type(pp)=t; right_given(pp)=x;
+ mp_right_type(pp)=t; right_given(pp)=x;
}
}
@ @<Splice independent paths together@>=
{
- if ( left_type(q)==mp_open ) if ( right_type(q)==mp_open ) {
- left_type(q)=mp_curl; left_curl(q)=unity;
+ if ( mp_left_type(q)==mp_open ) if ( mp_right_type(q)==mp_open ) {
+ mp_left_type(q)=mp_curl; left_curl(q)=unity;
}
- if ( right_type(pp)==mp_open ) if ( t==mp_open ) {
- right_type(pp)=mp_curl; right_curl(pp)=unity;
+ if ( mp_right_type(pp)==mp_open ) if ( t==mp_open ) {
+ mp_right_type(pp)=mp_curl; right_curl(pp)=unity;
}
- right_type(q)=right_type(pp); link(q)=link(pp);
- right_x(q)=right_x(pp); right_y(q)=right_y(pp);
+ mp_right_type(q)=mp_right_type(pp); mp_link(q)=mp_link(pp);
+ mp_right_x(q)=mp_right_x(pp); mp_right_y(q)=mp_right_y(pp);
mp_free_node(mp, pp,knot_node_size);
if ( qq==pp ) qq=q;
}
@@ -18383,15 +18626,15 @@ if ( right_type(pp)==mp_open ) {
if ( cycle_hit ) {
if ( d==ampersand ) p=q;
} else {
- left_type(p)=mp_endpoint;
- if ( right_type(p)==mp_open ) {
- right_type(p)=mp_curl; right_curl(p)=unity;
+ mp_left_type(p)=mp_endpoint;
+ if ( mp_right_type(p)==mp_open ) {
+ mp_right_type(p)=mp_curl; right_curl(p)=unity;
}
- right_type(q)=mp_endpoint;
- if ( left_type(q)==mp_open ) {
- left_type(q)=mp_curl; left_curl(q)=unity;
+ mp_right_type(q)=mp_endpoint;
+ if ( mp_left_type(q)==mp_open ) {
+ mp_left_type(q)=mp_curl; left_curl(q)=unity;
}
- link(q)=p;
+ mp_link(q)=p;
}
mp_make_choices(mp, p);
mp->cur_type=mp_path_type; mp->cur_exp=p
@@ -18400,13 +18643,13 @@ mp->cur_type=mp_path_type; mp->cur_exp=p
supposed to be either |true_code| or |false_code|.
@<Declare the basic parsing subroutines@>=
-void mp_get_boolean (MP mp) {
+static void mp_get_boolean (MP mp) {
mp_get_x_next(mp); mp_scan_expression(mp);
if ( mp->cur_type!=mp_boolean_type ) {
exp_err("Undefined condition will be treated as `false'");
@.Undefined condition...@>
- help2("The expression shown above should have had a definite")
- ("true-or-false value. I'm changing it to `false'.");
+ help2("The expression shown above should have had a definite",
+ "true-or-false value. I'm changing it to `false'.");
mp_put_get_flush_error(mp, false_code); mp->cur_type=mp_boolean_type;
}
}
@@ -18520,9 +18763,9 @@ mp_primitive(mp, "dashpart",unary,dash_part);
@:dash_part_}{\&{dashpart} primitive@>
mp_primitive(mp, "sqrt",unary,sqrt_op);
@:sqrt_}{\&{sqrt} primitive@>
-mp_primitive(mp, "mexp",unary,m_exp_op);
+mp_primitive(mp, "mexp",unary,mp_m_exp_op);
@:m_exp_}{\&{mexp} primitive@>
-mp_primitive(mp, "mlog",unary,m_log_op);
+mp_primitive(mp, "mlog",unary,mp_m_log_op);
@:m_log_}{\&{mlog} primitive@>
mp_primitive(mp, "sind",unary,sin_d_op);
@:sin_d_}{\&{sind} primitive@>
@@ -18650,7 +18893,7 @@ case and_command:
@ OK, let's look at the simplest \\{do} procedure first.
@c @<Declare nullary action procedure@>
-void mp_do_nullary (MP mp,quarterword c) {
+static void mp_do_nullary (MP mp,quarterword c) {
check_arith;
if ( mp->internal[mp_tracing_commands]>two )
mp_show_cmd_mod(mp, nullary,c);
@@ -18689,7 +18932,7 @@ void mp_do_nullary (MP mp,quarterword c) {
@ @<Read a string...@>=
{
- if ( mp->interaction<=mp_nonstop_mode )
+ if (mp->noninteractive || mp->interaction<=mp_nonstop_mode )
mp_fatal_error(mp, "*** (cannot readstring in nonstop modes)");
mp_begin_file_reading(mp); name=is_read;
limit=start; prompt_input("");
@@ -18697,10 +18940,10 @@ void mp_do_nullary (MP mp,quarterword c) {
}
@ @<Declare nullary action procedure@>=
-void mp_finish_read (MP mp) { /* copy |buffer| line to |cur_exp| */
+static void mp_finish_read (MP mp) { /* copy |buffer| line to |cur_exp| */
size_t k;
str_room((int)mp->last-start);
- for (k=start;k<=mp->last-1;k++) {
+ for (k=(size_t)start;k<mp->last;k++) {
append_char(mp->buffer[k]);
}
mp_end_file_reading(mp); mp->cur_type=mp_string_type;
@@ -18711,7 +18954,7 @@ void mp_finish_read (MP mp) { /* copy |buffer| line to |cur_exp| */
operand to |do_unary| appears in |cur_type| and |cur_exp|.
@c @<Declare unary action procedures@>
-void mp_do_unary (MP mp,quarterword c) {
+static void mp_do_unary (MP mp,quarterword c) {
pointer p,q,r; /* for list manipulation */
integer x; /* a temporary register */
check_arith;
@@ -18733,11 +18976,11 @@ void mp_do_unary (MP mp,quarterword c) {
are known.
@<Declare unary action procedures@>=
-boolean mp_nice_pair (MP mp,integer p, quarterword t) {
+static boolean mp_nice_pair (MP mp,integer p, quarterword t) {
if ( t==mp_pair_type ) {
p=value(p);
- if ( type(x_part_loc(p))==mp_known )
- if ( type(y_part_loc(p))==mp_known )
+ if ( mp_type(x_part_loc(p))==mp_known )
+ if ( mp_type(y_part_loc(p))==mp_known )
return true;
}
return false;
@@ -18747,16 +18990,16 @@ boolean mp_nice_pair (MP mp,integer p, quarterword t) {
fully known colors.
@<Declare unary action procedures@>=
-boolean mp_nice_color_or_pair (MP mp,integer p, quarterword t) {
+static boolean mp_nice_color_or_pair (MP mp,integer p, quarterword t) {
pointer q,r; /* for scanning the big node */
if ( (t!=mp_pair_type)&&(t!=mp_color_type)&&(t!=mp_cmykcolor_type) ) {
return false;
} else {
q=value(p);
- r=q+mp->big_node_size[type(p)];
+ r=q+mp->big_node_size[mp_type(p)];
do {
r=r-2;
- if ( type(r)!=mp_known )
+ if ( mp_type(r)!=mp_known )
return false;
} while (r!=q);
return true;
@@ -18764,31 +19007,31 @@ boolean mp_nice_color_or_pair (MP mp,integer p, quarterword t) {
}
@ @<Declare unary action...@>=
-void mp_print_known_or_unknown_type (MP mp,small_number t, integer v) {
- mp_print_char(mp, '(');
+static void mp_print_known_or_unknown_type (MP mp,quarterword t, integer v) {
+ mp_print_char(mp, xord('('));
if ( t>mp_known ) mp_print(mp, "unknown numeric");
else { if ( (t==mp_pair_type)||(t==mp_color_type)||(t==mp_cmykcolor_type) )
if ( ! mp_nice_color_or_pair(mp, v,t) ) mp_print(mp, "unknown ");
mp_print_type(mp, t);
}
- mp_print_char(mp, ')');
+ mp_print_char(mp, xord(')'));
}
@ @<Declare unary action...@>=
-void mp_bad_unary (MP mp,quarterword c) {
+static void mp_bad_unary (MP mp,quarterword c) {
exp_err("Not implemented: "); mp_print_op(mp, c);
@.Not implemented...@>
mp_print_known_or_unknown_type(mp, mp->cur_type,mp->cur_exp);
- help3("I'm afraid I don't know how to apply that operation to that")
- ("particular type. Continue, and I'll simply return the")
- ("argument (shown above) as the result of the operation.");
+ help3("I'm afraid I don't know how to apply that operation to that",
+ "particular type. Continue, and I'll simply return the",
+ "argument (shown above) as the result of the operation.");
mp_put_get_error(mp);
}
@ @<Trace the current unary operation@>=
{
mp_begin_diagnostic(mp); mp_print_nl(mp, "{");
- mp_print_op(mp, c); mp_print_char(mp, '(');
+ mp_print_op(mp, c); mp_print_char(mp, xord('('));
mp_print_exp(mp, null,0); /* show the operand, but not verbosely */
mp_print(mp, ")}"); mp_end_diagnostic(mp, false);
}
@@ -18820,7 +19063,7 @@ case mp_independent:
r=p+mp->big_node_size[mp->cur_type];
do {
r=r-2;
- if ( type(r)==mp_known ) negate(value(r));
+ if ( mp_type(r)==mp_known ) negate(value(r));
else mp_negate_dep_list(mp, dep_list(r));
} while (r!=p);
} /* if |cur_type=mp_known| then |cur_exp=0| */
@@ -18839,11 +19082,11 @@ default:
}
@ @<Declare unary action...@>=
-void mp_negate_dep_list (MP mp,pointer p) {
+static void mp_negate_dep_list (MP mp,pointer p) {
while (1) {
negate(value(p));
- if ( info(p)==null ) return;
- p=link(p);
+ if ( mp_info(p)==null ) return;
+ p=mp_link(p);
}
}
@@ -18858,8 +19101,8 @@ case not_op:
@<Additional cases of unary operators@>=
case sqrt_op:
-case m_exp_op:
-case m_log_op:
+case mp_m_exp_op:
+case mp_m_log_op:
case sin_d_op:
case cos_d_op:
case floor_op:
@@ -18871,8 +19114,8 @@ case char_exists_op:
} else {
switch (c) {
case sqrt_op:mp->cur_exp=mp_square_rt(mp, mp->cur_exp);break;
- case m_exp_op:mp->cur_exp=mp_m_exp(mp, mp->cur_exp);break;
- case m_log_op:mp->cur_exp=mp_m_log(mp, mp->cur_exp);break;
+ case mp_m_exp_op:mp->cur_exp=mp_m_exp(mp, mp->cur_exp);break;
+ case mp_m_log_op:mp->cur_exp=mp_m_log(mp, mp->cur_exp);break;
case sin_d_op:
case cos_d_op:
mp_n_sin_cos(mp, (mp->cur_exp % three_sixty_units)*16);
@@ -18908,15 +19151,18 @@ case angle_op:
be a path, we call |pair_to_path|.
@<Declare unary action...@>=
-void mp_pair_to_path (MP mp) {
+static void mp_pair_to_path (MP mp) {
mp->cur_exp=mp_new_knot(mp);
mp->cur_type=mp_path_type;
}
@
-@d pict_color_type(A) ((link(dummy_loc(mp->cur_exp))!=null) &&
- (has_color(link(dummy_loc(mp->cur_exp)))) &&
- (color_model(link(dummy_loc(mp->cur_exp)))==A))
+@d pict_color_type(A) ((mp_link(dummy_loc(mp->cur_exp))!=null) &&
+ (has_color(mp_link(dummy_loc(mp->cur_exp)))) &&
+ ((mp_color_model(mp_link(dummy_loc(mp->cur_exp)))==A)
+ ||
+ ((mp_color_model(mp_link(dummy_loc(mp->cur_exp)))==mp_uninitialized_model) &&
+ (mp->internal[mp_default_color_model]/unity)==(A))))
@<Additional cases of unary operators@>=
case x_part:
@@ -18969,27 +19215,27 @@ case color_model_part:
break;
@ @<Declarations@>=
-void mp_bad_color_part(MP mp, quarterword c);
+static void mp_bad_color_part(MP mp, quarterword c);
@ @c
-void mp_bad_color_part(MP mp, quarterword c) {
+static void mp_bad_color_part(MP mp, quarterword c) {
pointer p; /* the big node */
- p=link(dummy_loc(mp->cur_exp));
+ p=mp_link(dummy_loc(mp->cur_exp));
exp_err("Wrong picture color model: "); mp_print_op(mp, c);
@.Wrong picture color model...@>
- if (color_model(p)==mp_grey_model)
+ if (mp_color_model(p)==mp_grey_model)
mp_print(mp, " of grey object");
- else if (color_model(p)==mp_cmyk_model)
+ else if (mp_color_model(p)==mp_cmyk_model)
mp_print(mp, " of cmyk object");
- else if (color_model(p)==mp_rgb_model)
+ else if (mp_color_model(p)==mp_rgb_model)
mp_print(mp, " of rgb object");
- else if (color_model(p)==mp_no_model)
+ else if (mp_color_model(p)==mp_no_model)
mp_print(mp, " of marking object");
else
mp_print(mp," of defaulted object");
- help3("You can only ask for the redpart, greenpart, bluepart of a rgb object,")
- ("the cyanpart, magentapart, yellowpart or blackpart of a cmyk object, ")
- ("or the greypart of a grey object. No mixing and matching, please.");
+ help3("You can only ask for the redpart, greenpart, bluepart of a rgb object,",
+ "the cyanpart, magentapart, yellowpart or blackpart of a cmyk object, ",
+ "or the greypart of a grey object. No mixing and matching, please.");
mp_error(mp);
if (c==black_part)
mp_flush_cur_exp(mp,unity);
@@ -19001,16 +19247,16 @@ void mp_bad_color_part(MP mp, quarterword c) {
a big node. We want to delete all but one part of the big node.
@<Declare unary action...@>=
-void mp_take_part (MP mp,quarterword c) {
+static void mp_take_part (MP mp,quarterword c) {
pointer p; /* the big node */
- p=value(mp->cur_exp); value(temp_val)=p; type(temp_val)=mp->cur_type;
- link(p)=temp_val; mp_free_node(mp, mp->cur_exp,value_node_size);
+ p=value(mp->cur_exp); value(temp_val)=p; mp_type(temp_val)=mp->cur_type;
+ mp_link(p)=temp_val; mp_free_node(mp, mp->cur_exp,value_node_size);
mp_make_exp_copy(mp, p+mp->sector_offset[c+mp_x_part_sector-x_part]);
mp_recycle_value(mp, temp_val);
}
@ @<Initialize table entries...@>=
-name_type(temp_val)=mp_capsule;
+mp_name_type(temp_val)=mp_capsule;
@ @<Additional cases of unary operators@>=
case font_part:
@@ -19023,17 +19269,17 @@ case dash_part:
break;
@ @<Declarations@>=
-void mp_scale_edges (MP mp);
+static void mp_scale_edges (MP mp);
@ @<Declare unary action...@>=
-void mp_take_pict_part (MP mp,quarterword c) {
+static void mp_take_pict_part (MP mp,quarterword c) {
pointer p; /* first graphical object in |cur_exp| */
- p=link(dummy_loc(mp->cur_exp));
+ p=mp_link(dummy_loc(mp->cur_exp));
if ( p!=null ) {
switch (c) {
case x_part: case y_part: case xx_part:
case xy_part: case yx_part: case yy_part:
- if ( type(p)==mp_text_code ) mp_flush_cur_exp(mp, text_trans_part(p+c));
+ if ( mp_type(p)==mp_text_code ) mp_flush_cur_exp(mp, text_trans_part(p+c));
else goto NOT_FOUND;
break;
case red_part: case green_part: case blue_part:
@@ -19043,7 +19289,7 @@ void mp_take_pict_part (MP mp,quarterword c) {
case cyan_part: case magenta_part: case yellow_part:
case black_part:
if ( has_color(p) ) {
- if ( color_model(p)==mp_uninitialized_model )
+ if ( mp_color_model(p)==mp_uninitialized_model && c==black_part)
mp_flush_cur_exp(mp, unity);
else
mp_flush_cur_exp(mp, obj_color_part(p+c+(red_part-cyan_part)));
@@ -19056,10 +19302,10 @@ void mp_take_pict_part (MP mp,quarterword c) {
break;
case color_model_part:
if ( has_color(p) ) {
- if ( color_model(p)==mp_uninitialized_model )
+ if ( mp_color_model(p)==mp_uninitialized_model )
mp_flush_cur_exp(mp, mp->internal[mp_default_color_model]);
else
- mp_flush_cur_exp(mp, color_model(p)*unity);
+ mp_flush_cur_exp(mp, mp_color_model(p)*unity);
} else goto NOT_FOUND;
break;
@<Handle other cases in |take_pict_part| or |goto not_found|@>;
@@ -19073,45 +19319,45 @@ NOT_FOUND:
@ @<Handle other cases in |take_pict_part| or |goto not_found|@>=
case text_part:
- if ( type(p)!=mp_text_code ) goto NOT_FOUND;
+ if ( mp_type(p)!=mp_text_code ) goto NOT_FOUND;
else {
- mp_flush_cur_exp(mp, text_p(p));
+ mp_flush_cur_exp(mp, mp_text_p(p));
add_str_ref(mp->cur_exp);
mp->cur_type=mp_string_type;
};
break;
case font_part:
- if ( type(p)!=mp_text_code ) goto NOT_FOUND;
+ if ( mp_type(p)!=mp_text_code ) goto NOT_FOUND;
else {
- mp_flush_cur_exp(mp, rts(mp->font_name[font_n(p)]));
+ mp_flush_cur_exp(mp, rts(mp->font_name[mp_font_n(p)]));
add_str_ref(mp->cur_exp);
mp->cur_type=mp_string_type;
};
break;
case path_part:
- if ( type(p)==mp_text_code ) goto NOT_FOUND;
+ if ( mp_type(p)==mp_text_code ) goto NOT_FOUND;
else if ( is_stop(p) ) mp_confusion(mp, "pict");
@:this can't happen pict}{\quad pict@>
else {
- mp_flush_cur_exp(mp, mp_copy_path(mp, path_p(p)));
+ mp_flush_cur_exp(mp, mp_copy_path(mp, mp_path_p(p)));
mp->cur_type=mp_path_type;
}
break;
case pen_part:
if ( ! has_pen(p) ) goto NOT_FOUND;
else {
- if ( pen_p(p)==null ) goto NOT_FOUND;
- else { mp_flush_cur_exp(mp, copy_pen(pen_p(p)));
+ if ( mp_pen_p(p)==null ) goto NOT_FOUND;
+ else { mp_flush_cur_exp(mp, copy_pen(mp_pen_p(p)));
mp->cur_type=mp_pen_type;
};
}
break;
case dash_part:
- if ( type(p)!=mp_stroked_code ) goto NOT_FOUND;
- else { if ( dash_p(p)==null ) goto NOT_FOUND;
- else { add_edge_ref(dash_p(p));
+ if ( mp_type(p)!=mp_stroked_code ) goto NOT_FOUND;
+ else { if ( mp_dash_p(p)==null ) goto NOT_FOUND;
+ else { add_edge_ref(mp_dash_p(p));
mp->se_sf=dash_scale(p);
- mp->se_pic=dash_p(p);
+ mp->se_pic=mp_dash_p(p);
mp_scale_edges(mp);
mp_flush_cur_exp(mp, mp->se_pic);
mp->cur_type=mp_picture_type;
@@ -19130,17 +19376,17 @@ scaled se_sf; /* the scale factor argument to |scale_edges| */
@ @<Convert the current expression to a null value appropriate...@>=
switch (c) {
case text_part: case font_part:
- mp_flush_cur_exp(mp, rts(""));
+ mp_flush_cur_exp(mp, null_str);
mp->cur_type=mp_string_type;
break;
case path_part:
mp_flush_cur_exp(mp, mp_get_node(mp, knot_node_size));
- left_type(mp->cur_exp)=mp_endpoint;
- right_type(mp->cur_exp)=mp_endpoint;
- link(mp->cur_exp)=mp->cur_exp;
- x_coord(mp->cur_exp)=0;
- y_coord(mp->cur_exp)=0;
- originator(mp->cur_exp)=mp_metapost_user;
+ mp_left_type(mp->cur_exp)=mp_endpoint;
+ mp_right_type(mp->cur_exp)=mp_endpoint;
+ mp_link(mp->cur_exp)=mp->cur_exp;
+ mp_x_coord(mp->cur_exp)=0;
+ mp_y_coord(mp->cur_exp)=0;
+ mp_originator(mp->cur_exp)=mp_metapost_user;
mp->cur_type=mp_path_type;
break;
case pen_part:
@@ -19188,7 +19434,7 @@ case font_size:
break;
@ @<Declare unary action...@>=
-void mp_str_to_num (MP mp,quarterword c) { /* converts a string to a number */
+static void mp_str_to_num (MP mp,quarterword c) { /* converts a string to a number */
integer n; /* accumulator */
ASCII_code m; /* current character */
pool_pointer k; /* index into |str_pool| */
@@ -19200,13 +19446,13 @@ void mp_str_to_num (MP mp,quarterword c) { /* converts a string to a number */
} else {
if ( c==oct_op ) b=8; else b=16;
n=0; bad_char=false;
- for (k=mp->str_start[mp->cur_exp];k<=str_stop(mp->cur_exp)-1;k++) {
+ for (k=mp->str_start[mp->cur_exp];k<str_stop(mp->cur_exp);k++) {
m=mp->str_pool[k];
if ( (m>='0')&&(m<='9') ) m=m-'0';
else if ( (m>='A')&&(m<='F') ) m=m-'A'+10;
else if ( (m>='a')&&(m<='f') ) m=m-'a'+10;
else { bad_char=true; m=0; };
- if ( m>=b ) { bad_char=true; m=0; };
+ if ( (int)m>=b ) { bad_char=true; m=0; };
if ( n<32768 / b ) n=n*b+m; else n=32767;
}
@<Give error messages if |bad_char| or |n>=4096|@>;
@@ -19228,10 +19474,10 @@ if ( bad_char ) {
if ( (n>4095) ) {
if ( mp->internal[mp_warning_check]>0 ) {
print_err("Number too large (");
- mp_print_int(mp, n); mp_print_char(mp, ')');
+ mp_print_int(mp, n); mp_print_char(mp, xord(')'));
@.Number too large@>
- help2("I have trouble with numbers greater than 4095; watch out.")
- ("(Set warningcheck:=0 to suppress this message.)");
+ help2("I have trouble with numbers greater than 4095; watch out.",
+ "(Set warningcheck:=0 to suppress this message.)");
mp_put_get_error(mp);
}
}
@@ -19257,25 +19503,25 @@ case length_op:
break;
@ @<Declare unary action...@>=
-scaled mp_path_length (MP mp) { /* computes the length of the current path */
+static scaled mp_path_length (MP mp) { /* computes the length of the current path */
scaled n; /* the path length so far */
pointer p; /* traverser */
p=mp->cur_exp;
- if ( left_type(p)==mp_endpoint ) n=-unity; else n=0;
- do { p=link(p); n=n+unity; } while (p!=mp->cur_exp);
+ if ( mp_left_type(p)==mp_endpoint ) n=-unity; else n=0;
+ do { p=mp_link(p); n=n+unity; } while (p!=mp->cur_exp);
return n;
}
@ @<Declare unary action...@>=
-scaled mp_pict_length (MP mp) {
+static scaled mp_pict_length (MP mp) {
/* counts interior components in picture |cur_exp| */
scaled n; /* the count so far */
pointer p; /* traverser */
n=0;
- p=link(dummy_loc(mp->cur_exp));
+ p=mp_link(dummy_loc(mp->cur_exp));
if ( p!=null ) {
if ( is_start_or_stop(p) )
- if ( mp_skip_1component(mp, p)==null ) p=link(p);
+ if ( mp_skip_1component(mp, p)==null ) p=mp_link(p);
while ( p!=null ) {
skip_component(p) return n;
n=n+unity;
@@ -19290,7 +19536,7 @@ scaled mp_pict_length (MP mp) {
case turning_op:
if ( mp->cur_type==mp_pair_type ) mp_flush_cur_exp(mp, 0);
else if ( mp->cur_type!=mp_path_type ) mp_bad_unary(mp, turning_op);
- else if ( left_type(mp->cur_exp)==mp_endpoint )
+ else if ( mp_left_type(mp->cur_exp)==mp_endpoint )
mp_flush_cur_exp(mp, 0); /* not a cyclic path */
else
mp_flush_cur_exp(mp, mp_turn_cycles_wrapper(mp, mp->cur_exp));
@@ -19300,7 +19546,7 @@ case turning_op:
argument is |origin|.
@<Declare unary action...@>=
-angle mp_an_angle (MP mp,scaled xpar, scaled ypar) {
+static angle mp_an_angle (MP mp,scaled xpar, scaled ypar) {
if ( (! ((xpar==0) && (ypar==0))) )
return mp_n_arg(mp, xpar,ypar);
return 0;
@@ -19312,32 +19558,29 @@ that receives eight integers corresponding to the four controlling points,
and returns a single angle. Besides those, we have to account for discrete
moves at the actual points.
-@d floor(a) (a>=0 ? a : -(int)(-a))
-@d bezier_error (720<<20)+1
-@d sign(v) ((v)>0 ? 1 : ((v)<0 ? -1 : 0 ))
-@d print_roots(a)
-@d out ((double)(xo>>20))
-@d mid ((double)(xm>>20))
-@d in ((double)(xi>>20))
+@d mp_floor(a) ((a)>=0 ? (int)(a) : -(int)(-(a)))
+@d bezier_error (720*(256*256*16))+1
+@d mp_sign(v) ((v)>0 ? 1 : ((v)<0 ? -1 : 0 ))
+@d mp_out(A) (double)((A)/(256*256*16))
@d divisor (256*256)
-@d double2angle(a) (int)floor(a*256.0*256.0*16.0)
+@d double2angle(a) (int)mp_floor(a*256.0*256.0*16.0)
@<Declare unary action...@>=
-angle mp_bezier_slope(MP mp, integer AX,integer AY,integer BX,integer BY,
+static angle mp_bezier_slope(MP mp, integer AX,integer AY,integer BX,integer BY,
integer CX,integer CY,integer DX,integer DY);
@ @c
-angle mp_bezier_slope(MP mp, integer AX,integer AY,integer BX,integer BY,
+static angle mp_bezier_slope(MP mp, integer AX,integer AY,integer BX,integer BY,
integer CX,integer CY,integer DX,integer DY) {
double a, b, c;
integer deltax,deltay;
double ax,ay,bx,by,cx,cy,dx,dy;
angle xi = 0, xo = 0, xm = 0;
double res = 0;
- ax=AX/divisor; ay=AY/divisor;
- bx=BX/divisor; by=BY/divisor;
- cx=CX/divisor; cy=CY/divisor;
- dx=DX/divisor; dy=DY/divisor;
+ ax=(double)(AX/divisor); ay=(double)(AY/divisor);
+ bx=(double)(BX/divisor); by=(double)(BY/divisor);
+ cx=(double)(CX/divisor); cy=(double)(CY/divisor);
+ dx=(double)(DX/divisor); dy=(double)(DY/divisor);
deltax = (BX-AX); deltay = (BY-AY);
if (deltax==0 && deltay == 0) { deltax=(CX-AX); deltay=(CY-AY); }
@@ -19357,53 +19600,45 @@ angle mp_bezier_slope(MP mp, integer AX,integer AY,integer BX,integer BY,
c = (cx-bx)*(dy-cy) - (dx-cx)*(cy-by); /* c = (cp-bp)x(dp-cp);*/
if ((a==0)&&(c==0)) {
- res = (b==0 ? 0 : (out-in));
- print_roots("no roots (a)");
+ res = (b==0 ? 0 : (mp_out(xo)-mp_out(xi)));
} else if ((a==0)||(c==0)) {
- if ((sign(b) == sign(a)) || (sign(b) == sign(c))) {
- res = out-in; /* ? */
+ if ((mp_sign(b) == mp_sign(a)) || (mp_sign(b) == mp_sign(c))) {
+ res = mp_out(xo)-mp_out(xi); /* ? */
if (res<-180.0)
res += 360.0;
else if (res>180.0)
res -= 360.0;
- print_roots("no roots (b)");
} else {
- res = out-in; /* ? */
- print_roots("one root (a)");
+ res = mp_out(xo)-mp_out(xi); /* ? */
}
- } else if ((sign(a)*sign(c))<0) {
- res = out-in; /* ? */
+ } else if ((mp_sign(a)*mp_sign(c))<0) {
+ res = mp_out(xo)-mp_out(xi); /* ? */
if (res<-180.0)
res += 360.0;
else if (res>180.0)
res -= 360.0;
- print_roots("one root (b)");
} else {
- if (sign(a) == sign(b)) {
- res = out-in; /* ? */
+ if (mp_sign(a) == mp_sign(b)) {
+ res = mp_out(xo)-mp_out(xi); /* ? */
if (res<-180.0)
res += 360.0;
else if (res>180.0)
res -= 360.0;
- print_roots("no roots (d)");
} else {
if ((b*b) == (4*a*c)) {
- res = bezier_error;
- print_roots("double root"); /* cusp */
+ res = (double)bezier_error;
} else if ((b*b) < (4*a*c)) {
- res = out-in; /* ? */
+ res = mp_out(xo)-mp_out(xi); /* ? */
if (res<=0.0 &&res>-180.0)
res += 360.0;
else if (res>=0.0 && res<180.0)
res -= 360.0;
- print_roots("no roots (e)");
} else {
- res = out-in;
+ res = mp_out(xo)-mp_out(xi);
if (res<-180.0)
res += 360.0;
else if (res>180.0)
res -= 360.0;
- print_roots("two roots"); /* two inflections */
}
}
}
@@ -19411,19 +19646,19 @@ angle mp_bezier_slope(MP mp, integer AX,integer AY,integer BX,integer BY,
}
@
-@d p_nextnext link(link(p))
-@d p_next link(p)
+@d p_nextnext mp_link(mp_link(p))
+@d p_next mp_link(p)
@d seven_twenty_deg 05500000000 /* $720\cdot2^{20}$, represents $720^\circ$ */
@<Declare unary action...@>=
-scaled mp_new_turn_cycles (MP mp,pointer c) {
+static scaled mp_new_turn_cycles (MP mp,pointer c) {
angle res,ang; /* the angles of intermediate results */
scaled turns; /* the turn counter */
pointer p; /* for running around the path */
integer xp,yp; /* coordinates of next point */
integer x,y; /* helper coordinates */
angle in_angle,out_angle; /* helper angles */
- int old_setting; /* saved |selector| setting */
+ unsigned old_setting; /* saved |selector| setting */
res=0;
turns= 0;
p=c;
@@ -19434,9 +19669,9 @@ scaled mp_new_turn_cycles (MP mp,pointer c) {
mp_end_diagnostic(mp, false);
}
do {
- xp = x_coord(p_next); yp = y_coord(p_next);
- ang = mp_bezier_slope(mp,x_coord(p), y_coord(p), right_x(p), right_y(p),
- left_x(p_next), left_y(p_next), xp, yp);
+ xp = mp_x_coord(p_next); yp = mp_y_coord(p_next);
+ ang = mp_bezier_slope(mp,mp_x_coord(p), mp_y_coord(p), mp_right_x(p), mp_right_y(p),
+ mp_left_x(p_next), mp_left_y(p_next), xp, yp);
if ( ang>seven_twenty_deg ) {
print_err("Strange path");
mp_error(mp);
@@ -19453,14 +19688,14 @@ scaled mp_new_turn_cycles (MP mp,pointer c) {
turns = turns - unity;
}
/* incoming angle at next point */
- x = left_x(p_next); y = left_y(p_next);
- if ( (xp==x)&&(yp==y) ) { x = right_x(p); y = right_y(p); };
- if ( (xp==x)&&(yp==y) ) { x = x_coord(p); y = y_coord(p); };
+ x = mp_left_x(p_next); y = mp_left_y(p_next);
+ if ( (xp==x)&&(yp==y) ) { x = mp_right_x(p); y = mp_right_y(p); };
+ if ( (xp==x)&&(yp==y) ) { x = mp_x_coord(p); y = mp_y_coord(p); };
in_angle = mp_an_angle(mp, xp - x, yp - y);
/* outgoing angle at next point */
- x = right_x(p_next); y = right_y(p_next);
- if ( (xp==x)&&(yp==y) ) { x = left_x(p_nextnext); y = left_y(p_nextnext); };
- if ( (xp==x)&&(yp==y) ) { x = x_coord(p_nextnext); y = y_coord(p_nextnext); };
+ x = mp_right_x(p_next); y = mp_right_y(p_next);
+ if ( (xp==x)&&(yp==y) ) { x = mp_left_x(p_nextnext); y = mp_left_y(p_nextnext); };
+ if ( (xp==x)&&(yp==y) ) { x = mp_x_coord(p_nextnext); y = mp_y_coord(p_nextnext); };
out_angle = mp_an_angle(mp, x - xp, y- yp);
ang = (out_angle - in_angle);
reduce_angle(ang);
@@ -19475,7 +19710,7 @@ scaled mp_new_turn_cycles (MP mp,pointer c) {
turns = turns - unity;
};
};
- p = link(p);
+ p = mp_link(p);
} while (p!=c);
mp->selector=old_setting;
return turns;
@@ -19521,21 +19756,21 @@ at than the pascal code, because it could use |point -1 of p|. In
pascal, the fastest way to loop around the path is not to look
backward once, but forward twice. These defines help hide the trick.
-@d p_to link(link(p))
-@d p_here link(p)
+@d p_to mp_link(mp_link(p))
+@d p_here mp_link(p)
@d p_from p
@<Declare unary action...@>=
-scaled mp_turn_cycles (MP mp,pointer c) {
+static scaled mp_turn_cycles (MP mp,pointer c) {
angle res,ang; /* the angles of intermediate results */
scaled turns; /* the turn counter */
pointer p; /* for running around the path */
res=0; turns= 0; p=c;
do {
- ang = mp_an_angle (mp, x_coord(p_to) - x_coord(p_here),
- y_coord(p_to) - y_coord(p_here))
- - mp_an_angle (mp, x_coord(p_here) - x_coord(p_from),
- y_coord(p_here) - y_coord(p_from));
+ ang = mp_an_angle (mp, mp_x_coord(p_to) - mp_x_coord(p_here),
+ mp_y_coord(p_to) - mp_y_coord(p_here))
+ - mp_an_angle (mp, mp_x_coord(p_here) - mp_x_coord(p_from),
+ mp_y_coord(p_here) - mp_y_coord(p_from));
reduce_angle(ang);
res = res + ang;
if ( res >= three_sixty_deg ) {
@@ -19546,17 +19781,17 @@ scaled mp_turn_cycles (MP mp,pointer c) {
res = res + three_sixty_deg;
turns = turns - unity;
};
- p = link(p);
+ p = mp_link(p);
} while (p!=c);
return turns;
}
@ @<Declare unary action...@>=
-scaled mp_turn_cycles_wrapper (MP mp,pointer c) {
+static scaled mp_turn_cycles_wrapper (MP mp,pointer c) {
scaled nval,oval;
scaled saved_t_o; /* tracing\_online saved */
- if ( (link(c)==c)||(link(link(c))==c) ) {
- if ( mp_an_angle (mp, x_coord(c) - right_x(c), y_coord(c) - right_y(c)) > 0 )
+ if ( (mp_link(c)==c)||(mp_link(mp_link(c))==c) ) {
+ if ( mp_an_angle (mp, mp_x_coord(c) - mp_right_x(c), mp_y_coord(c) - mp_right_y(c)) > 0 )
return unity;
else
return -unity;
@@ -19579,18 +19814,6 @@ scaled mp_turn_cycles_wrapper (MP mp,pointer c) {
}
}
-@ @<Declare unary action...@>=
-scaled mp_count_turns (MP mp,pointer c) {
- pointer p; /* a knot in envelope spec |c| */
- integer t; /* total pen offset changes counted */
- t=0; p=c;
- do {
- t=t+info(p)-zero_off;
- p=link(p);
- } while (p!=c);
- return ((t / 3)*unity);
-}
-
@ @d type_range(A,B) {
if ( (mp->cur_type>=(A)) && (mp->cur_type<=(B)) )
mp_flush_cur_exp(mp, true_code);
@@ -19623,7 +19846,7 @@ case known_op: case unknown_op:
mp_test_known(mp, c); break;
@ @<Declare unary action procedures@>=
-void mp_test_known (MP mp,quarterword c) {
+static void mp_test_known (MP mp,quarterword c) {
int b; /* is the current expression known? */
pointer p,q; /* locations in a big node */
b=false_code;
@@ -19639,7 +19862,7 @@ void mp_test_known (MP mp,quarterword c) {
q=p+mp->big_node_size[mp->cur_type];
do {
q=q-2;
- if ( type(q)!=mp_known )
+ if ( mp_type(q)!=mp_known )
goto DONE;
} while (q!=p);
b=true_code;
@@ -19656,7 +19879,7 @@ void mp_test_known (MP mp,quarterword c) {
@ @<Additional cases of unary operators@>=
case cycle_op:
if ( mp->cur_type!=mp_path_type ) mp_flush_cur_exp(mp, false_code);
- else if ( left_type(mp->cur_exp)!=mp_endpoint ) mp_flush_cur_exp(mp, true_code);
+ else if ( mp_left_type(mp->cur_exp)!=mp_endpoint ) mp_flush_cur_exp(mp, true_code);
else mp_flush_cur_exp(mp, false_code);
mp->cur_type=mp_boolean_type;
break;
@@ -19679,8 +19902,8 @@ case textual_op:
case clipped_op:
case bounded_op:
if ( mp->cur_type!=mp_picture_type ) mp_flush_cur_exp(mp, false_code);
- else if ( link(dummy_loc(mp->cur_exp))==null ) mp_flush_cur_exp(mp, false_code);
- else if ( type(link(dummy_loc(mp->cur_exp)))==c+mp_fill_code-filled_op )
+ else if ( mp_link(dummy_loc(mp->cur_exp))==null ) mp_flush_cur_exp(mp, false_code);
+ else if ( mp_type(mp_link(dummy_loc(mp->cur_exp)))==c+mp_fill_code-filled_op )
mp_flush_cur_exp(mp, true_code);
else mp_flush_cur_exp(mp, false_code);
mp->cur_type=mp_boolean_type;
@@ -19705,7 +19928,7 @@ case make_path_op:
case reverse:
if ( mp->cur_type==mp_path_type ) {
p=mp_htap_ypoc(mp, mp->cur_exp);
- if ( right_type(p)==mp_endpoint ) p=link(p);
+ if ( mp_right_type(p)==mp_endpoint ) p=mp_link(p);
mp_toss_knot_list(mp, mp->cur_exp); mp->cur_exp=p;
} else if ( mp->cur_type==mp_pair_type ) mp_pair_to_path(mp);
else mp_bad_unary(mp, reverse);
@@ -19715,32 +19938,32 @@ case reverse:
given ordered pair of values.
@<Declare unary action procedures@>=
-void mp_pair_value (MP mp,scaled x, scaled y) {
+static void mp_pair_value (MP mp,scaled x, scaled y) {
pointer p; /* a pair node */
p=mp_get_node(mp, value_node_size);
mp_flush_cur_exp(mp, p); mp->cur_type=mp_pair_type;
- type(p)=mp_pair_type; name_type(p)=mp_capsule; mp_init_big_node(mp, p);
+ mp_type(p)=mp_pair_type; mp_name_type(p)=mp_capsule; mp_init_big_node(mp, p);
p=value(p);
- type(x_part_loc(p))=mp_known; value(x_part_loc(p))=x;
- type(y_part_loc(p))=mp_known; value(y_part_loc(p))=y;
+ mp_type(x_part_loc(p))=mp_known; value(x_part_loc(p))=x;
+ mp_type(y_part_loc(p))=mp_known; value(y_part_loc(p))=y;
}
@ @<Additional cases of unary operators@>=
case ll_corner_op:
if ( ! mp_get_cur_bbox(mp) ) mp_bad_unary(mp, ll_corner_op);
- else mp_pair_value(mp, minx,miny);
+ else mp_pair_value(mp, mp_minx, mp_miny);
break;
case lr_corner_op:
if ( ! mp_get_cur_bbox(mp) ) mp_bad_unary(mp, lr_corner_op);
- else mp_pair_value(mp, maxx,miny);
+ else mp_pair_value(mp, mp_maxx, mp_miny);
break;
case ul_corner_op:
if ( ! mp_get_cur_bbox(mp) ) mp_bad_unary(mp, ul_corner_op);
- else mp_pair_value(mp, minx,maxy);
+ else mp_pair_value(mp, mp_minx, mp_maxy);
break;
case ur_corner_op:
if ( ! mp_get_cur_bbox(mp) ) mp_bad_unary(mp, ur_corner_op);
- else mp_pair_value(mp, maxx,maxy);
+ else mp_pair_value(mp, mp_maxx, mp_maxy);
break;
@ Here is a function that sets |minx|, |maxx|, |miny|, |maxy| to the bounding
@@ -19748,17 +19971,17 @@ box of the current expression. The boolean result is |false| if the expression
has the wrong type.
@<Declare unary action procedures@>=
-boolean mp_get_cur_bbox (MP mp) {
+static boolean mp_get_cur_bbox (MP mp) {
switch (mp->cur_type) {
case mp_picture_type:
mp_set_bbox(mp, mp->cur_exp,true);
if ( minx_val(mp->cur_exp)>maxx_val(mp->cur_exp) ) {
- minx=0; maxx=0; miny=0; maxy=0;
+ mp_minx=0; mp_maxx=0; mp_miny=0; mp_maxy=0;
} else {
- minx=minx_val(mp->cur_exp);
- maxx=maxx_val(mp->cur_exp);
- miny=miny_val(mp->cur_exp);
- maxy=maxy_val(mp->cur_exp);
+ mp_minx=minx_val(mp->cur_exp);
+ mp_maxx=maxx_val(mp->cur_exp);
+ mp_miny=miny_val(mp->cur_exp);
+ mp_maxy=maxy_val(mp->cur_exp);
}
break;
case mp_path_type:
@@ -19784,7 +20007,7 @@ case close_from_op:
a line from the file or to close the file.
@<Declare unary action procedures@>=
-void mp_do_read_or_close (MP mp,quarterword c) {
+static void mp_do_read_or_close (MP mp,quarterword c) {
readf_index n,n0; /* indices for searching |rd_fname| */
@<Find the |n| where |rd_fname[n]=cur_exp|; if |cur_exp| must be inserted,
call |start_read_input| and |goto found| or |not_found|@>;
@@ -19826,7 +20049,7 @@ FOUND:
void **rd_file;
char **rd_fname;
readf_index l,k;
- l = mp->max_read_files + (mp->max_read_files>>2);
+ l = mp->max_read_files + (mp->max_read_files/4);
rd_file = xmalloc((l+1), sizeof(void *));
rd_fname = xmalloc((l+1), sizeof(char *));
for (k=0;k<=l;k++) {
@@ -19881,11 +20104,11 @@ with the current expression.
@d binary_return { mp_finish_binary(mp, old_p, old_exp); return; }
@c @<Declare binary action procedures@>
-void mp_finish_binary (MP mp, pointer old_p, pointer old_exp ){
+static void mp_finish_binary (MP mp, pointer old_p, pointer old_exp ){
check_arith;
@<Recycle any sidestepped |independent| capsules@>;
}
-void mp_do_binary (MP mp,pointer p, quarterword c) {
+static void mp_do_binary (MP mp,pointer p, quarterword c) {
pointer q,r,rr; /* for list manipulation */
pointer old_p,old_exp; /* capsules to recycle */
integer v; /* for numeric manipulation */
@@ -19907,26 +20130,26 @@ void mp_do_binary (MP mp,pointer p, quarterword c) {
}
@ @<Declare binary action...@>=
-void mp_bad_binary (MP mp,pointer p, quarterword c) {
+static void mp_bad_binary (MP mp,pointer p, quarterword c) {
mp_disp_err(mp, p,"");
exp_err("Not implemented: ");
@.Not implemented...@>
if ( c>=min_of ) mp_print_op(mp, c);
- mp_print_known_or_unknown_type(mp, type(p),p);
+ mp_print_known_or_unknown_type(mp, mp_type(p),p);
if ( c>=min_of ) mp_print(mp, "of"); else mp_print_op(mp, c);
mp_print_known_or_unknown_type(mp, mp->cur_type,mp->cur_exp);
- help3("I'm afraid I don't know how to apply that operation to that")
- ("combination of types. Continue, and I'll return the second")
- ("argument (see above) as the result of the operation.");
+ help3("I'm afraid I don't know how to apply that operation to that",
+ "combination of types. Continue, and I'll return the second",
+ "argument (see above) as the result of the operation.");
mp_put_get_error(mp);
}
-void mp_bad_envelope_pen (MP mp) {
+static void mp_bad_envelope_pen (MP mp) {
mp_disp_err(mp, null,"");
exp_err("Not implemented: envelope(elliptical pen)of(path)");
@.Not implemented...@>
- help3("I'm afraid I don't know how to apply that operation to that")
- ("combination of types. Continue, and I'll return the second")
- ("argument (see above) as the result of the operation.");
+ help3("I'm afraid I don't know how to apply that operation to that",
+ "combination of types. Continue, and I'll return the second",
+ "argument (see above) as the result of the operation.");
mp_put_get_error(mp);
}
@@ -19934,7 +20157,7 @@ void mp_bad_envelope_pen (MP mp) {
{
mp_begin_diagnostic(mp); mp_print_nl(mp, "{(");
mp_print_exp(mp,p,0); /* show the operand, but not verbosely */
- mp_print_char(mp,')'); mp_print_op(mp,c); mp_print_char(mp,'(');
+ mp_print_char(mp,xord(')')); mp_print_op(mp,c); mp_print_char(mp,xord('('));
mp_print_exp(mp,null,0); mp_print(mp,")}");
mp_end_diagnostic(mp, false);
}
@@ -19961,7 +20184,7 @@ independent component. We will define a simple function called `|tarnished|'
that returns |null| if and only if its argument is not tarnished.
@<Sidestep |independent| cases in capsule |p|@>=
-switch (type(p)) {
+switch (mp_type(p)) {
case mp_transform_type:
case mp_color_type:
case mp_cmykcolor_type:
@@ -19992,25 +20215,25 @@ if ( old_exp!=null ) {
}
@ @<Declare binary action...@>=
-pointer mp_tarnished (MP mp,pointer p) {
+static pointer mp_tarnished (MP mp,pointer p) {
pointer q; /* beginning of the big node */
pointer r; /* current position in the big node */
- q=value(p); r=q+mp->big_node_size[type(p)];
+ q=value(p); r=q+mp->big_node_size[mp_type(p)];
do {
r=r-2;
- if ( type(r)==mp_independent ) return mp_void;
+ if ( mp_type(r)==mp_independent ) return mp_void;
} while (r!=q);
return null;
}
@ @<Add or subtract the current expression from |p|@>=
-if ( (mp->cur_type<mp_color_type)||(type(p)<mp_color_type) ) {
+if ( (mp->cur_type<mp_color_type)||(mp_type(p)<mp_color_type) ) {
mp_bad_binary(mp, p,c);
} else {
- if ((mp->cur_type>mp_pair_type)&&(type(p)>mp_pair_type) ) {
+ if ((mp->cur_type>mp_pair_type)&&(mp_type(p)>mp_pair_type) ) {
mp_add_or_subtract(mp, p,null,c);
} else {
- if ( mp->cur_type!=type(p) ) {
+ if ( mp->cur_type!=mp_type(p) ) {
mp_bad_binary(mp, p,c);
} else {
q=value(p); r=value(mp->cur_exp);
@@ -20036,20 +20259,20 @@ be monkeying around with really big values.
@<Declare binary action...@>=
@<Declare the procedure called |dep_finish|@>
-void mp_add_or_subtract (MP mp,pointer p, pointer q, quarterword c) {
- small_number s,t; /* operand types */
+static void mp_add_or_subtract (MP mp,pointer p, pointer q, quarterword c) {
+ quarterword s,t; /* operand types */
pointer r; /* list traverser */
integer v; /* second operand value */
if ( q==null ) {
t=mp->cur_type;
if ( t<mp_dependent ) v=mp->cur_exp; else v=dep_list(mp->cur_exp);
} else {
- t=type(q);
+ t=mp_type(q);
if ( t<mp_dependent ) v=value(q); else v=dep_list(q);
}
if ( t==mp_known ) {
if ( c==minus ) negate(v);
- if ( type(p)==mp_known ) {
+ if ( mp_type(p)==mp_known ) {
v=mp_slow_add(mp, value(p),v);
if ( q==null ) mp->cur_exp=v; else value(q)=v;
return;
@@ -20063,42 +20286,43 @@ void mp_add_or_subtract (MP mp,pointer p, pointer q, quarterword c) {
@ @<Add a known value to the constant term of |dep_list(p)|@>=
r=dep_list(p);
-while ( info(r)!=null ) r=link(r);
+while ( mp_info(r)!=null ) r=mp_link(r);
value(r)=mp_slow_add(mp, value(r),v);
if ( q==null ) {
- q=mp_get_node(mp, value_node_size); mp->cur_exp=q; mp->cur_type=type(p);
- name_type(q)=mp_capsule;
+ q=mp_get_node(mp, value_node_size); mp->cur_exp=q; mp->cur_type=mp_type(p);
+ mp_name_type(q)=mp_capsule;
}
-dep_list(q)=dep_list(p); type(q)=type(p);
-prev_dep(q)=prev_dep(p); link(prev_dep(p))=q;
-type(p)=mp_known; /* this will keep the recycler from collecting non-garbage */
+dep_list(q)=dep_list(p); mp_type(q)=mp_type(p);
+prev_dep(q)=prev_dep(p); mp_link(prev_dep(p))=q;
+mp_type(p)=mp_known; /* this will keep the recycler from collecting non-garbage */
@ We prefer |dependent| lists to |mp_proto_dependent| ones, because it is
nice to retain the extra accuracy of |fraction| coefficients.
But we have to handle both kinds, and mixtures too.
@<Add operand |p| to the dependency list |v|@>=
-if ( type(p)==mp_known ) {
+if ( mp_type(p)==mp_known ) {
@<Add the known |value(p)| to the constant term of |v|@>;
} else {
- s=type(p); r=dep_list(p);
+ s=mp_type(p); r=dep_list(p);
if ( t==mp_dependent ) {
if ( s==mp_dependent ) {
- if ( mp_max_coef(mp, r)+mp_max_coef(mp, v)<coef_bound )
- v=mp_p_plus_q(mp, v,r,mp_dependent); goto DONE;
+ if ( mp_max_coef(mp, r)+mp_max_coef(mp, v)<coef_bound ) {
+ v=mp_p_plus_q(mp, v,r,mp_dependent); goto DONE;
+ }
} /* |fix_needed| will necessarily be false */
- t=mp_proto_dependent;
- v=mp_p_over_v(mp, v,unity,mp_dependent,mp_proto_dependent);
- }
- if ( s==mp_proto_dependent ) v=mp_p_plus_q(mp, v,r,mp_proto_dependent);
- else v=mp_p_plus_fq(mp, v,unity,r,mp_proto_dependent,mp_dependent);
- DONE:
- @<Output the answer, |v| (which might have become |known|)@>;
+ t=mp_proto_dependent;
+ v=mp_p_over_v(mp, v,unity,mp_dependent,mp_proto_dependent);
}
+ if ( s==mp_proto_dependent ) v=mp_p_plus_q(mp, v,r,mp_proto_dependent);
+ else v=mp_p_plus_fq(mp, v,unity,r,mp_proto_dependent,mp_dependent);
+ DONE:
+ @<Output the answer, |v| (which might have become |known|)@>;
+}
@ @<Add the known |value(p)| to the constant term of |v|@>=
{
- while ( info(v)!=null ) v=link(v);
+ while ( mp_info(v)!=null ) v=mp_link(v);
value(v)=mp_slow_add(mp, value(p),value(v));
}
@@ -20113,17 +20337,17 @@ or |q|) formerly held a dependency list with the same
final pointer as the list |v|.
@<Declare the procedure called |dep_finish|@>=
-void mp_dep_finish (MP mp, pointer v, pointer q, small_number t) {
+static void mp_dep_finish (MP mp, pointer v, pointer q, quarterword t) {
pointer p; /* the destination */
scaled vv; /* the value, if it is |known| */
if ( q==null ) p=mp->cur_exp; else p=q;
- dep_list(p)=v; type(p)=t;
- if ( info(v)==null ) {
+ dep_list(p)=v; mp_type(p)=t;
+ if ( mp_info(v)==null ) {
vv=value(v);
if ( q==null ) {
mp_flush_cur_exp(mp, vv);
} else {
- mp_recycle_value(mp, p); type(q)=mp_known; value(q)=vv;
+ mp_recycle_value(mp, p); mp_type(q)=mp_known; value(q)=vv;
}
} else if ( q==null ) {
mp->cur_type=t;
@@ -20137,9 +20361,9 @@ void mp_dep_finish (MP mp, pointer v, pointer q, small_number t) {
case less_than: case less_or_equal: case greater_than:
case greater_or_equal: case equal_to: case unequal_to:
check_arith; /* at this point |arith_error| should be |false|? */
- if ( (mp->cur_type>mp_pair_type)&&(type(p)>mp_pair_type) ) {
+ if ( (mp->cur_type>mp_pair_type)&&(mp_type(p)>mp_pair_type) ) {
mp_add_or_subtract(mp, p,null,minus); /* |cur_exp:=(p)-cur_exp| */
- } else if ( mp->cur_type!=type(p) ) {
+ } else if ( mp->cur_type!=mp_type(p) ) {
mp_bad_binary(mp, p,c); goto DONE;
} else if ( mp->cur_type==mp_string_type ) {
mp_flush_cur_exp(mp, mp_str_vs_str(mp, value(p),mp->cur_exp));
@@ -20164,8 +20388,8 @@ if ( mp->cur_type!=mp_known ) {
mp_disp_err(mp, p,"");
help1("The quantities shown above have not been equated.")
} else {
- help2("Oh dear. I can\'t decide if the expression above is positive,")
- ("negative, or zero. So this comparison test won't be `true'.");
+ help2("Oh dear. I can\'t decide if the expression above is positive,",
+ "negative, or zero. So this comparison test won't be `true'.");
}
exp_err("Unknown relation will be considered false");
@.Unknown relation...@>
@@ -20198,12 +20422,12 @@ make no change.
q=value(p); r=value(mp->cur_exp);
rr=r+mp->big_node_size[mp->cur_type]-2;
while (1) { mp_add_or_subtract(mp, q,r,minus);
- if ( type(r)!=mp_known ) break;
+ if ( mp_type(r)!=mp_known ) break;
if ( value(r)!=0 ) break;
if ( r==rr ) break;
q=q+2; r=r+2;
}
- mp_take_part(mp, name_type(r)+x_part-mp_x_part_sector);
+ mp_take_part(mp, mp_name_type(r)+x_part-mp_x_part_sector);
}
@ Here we use the sneaky fact that |and_op-false_code=or_op-true_code|.
@@ -20211,20 +20435,20 @@ make no change.
@<Additional cases of binary operators@>=
case and_op:
case or_op:
- if ( (type(p)!=mp_boolean_type)||(mp->cur_type!=mp_boolean_type) )
+ if ( (mp_type(p)!=mp_boolean_type)||(mp->cur_type!=mp_boolean_type) )
mp_bad_binary(mp, p,c);
else if ( value(p)==c+false_code-and_op ) mp->cur_exp=value(p);
break;
@ @<Additional cases of binary operators@>=
case times:
- if ( (mp->cur_type<mp_color_type)||(type(p)<mp_color_type) ) {
+ if ( (mp->cur_type<mp_color_type)||(mp_type(p)<mp_color_type) ) {
mp_bad_binary(mp, p,times);
- } else if ( (mp->cur_type==mp_known)||(type(p)==mp_known) ) {
+ } else if ( (mp->cur_type==mp_known)||(mp_type(p)==mp_known) ) {
@<Multiply when at least one operand is known@>;
- } else if ( (mp_nice_color_or_pair(mp, p,type(p))&&(mp->cur_type>mp_pair_type))
+ } else if ( (mp_nice_color_or_pair(mp, p,mp_type(p))&&(mp->cur_type>mp_pair_type))
||(mp_nice_color_or_pair(mp, mp->cur_exp,mp->cur_type)&&
- (type(p)>mp_pair_type)) ) {
+ (mp_type(p)>mp_pair_type)) ) {
mp_hard_times(mp, p);
binary_return;
} else {
@@ -20234,7 +20458,7 @@ case times:
@ @<Multiply when at least one operand is known@>=
{
- if ( type(p)==mp_known ) {
+ if ( mp_type(p)==mp_known ) {
v=value(p); mp_free_node(mp, p,value_node_size);
} else {
v=mp->cur_exp; mp_unstash_cur_exp(mp, p);
@@ -20255,19 +20479,19 @@ case times:
}
@ @<Declare binary action...@>=
-void mp_dep_mult (MP mp,pointer p, integer v, boolean v_is_scaled) {
+static void mp_dep_mult (MP mp,pointer p, integer v, boolean v_is_scaled) {
pointer q; /* the dependency list being multiplied by |v| */
- small_number s,t; /* its type, before and after */
+ quarterword s,t; /* its type, before and after */
if ( p==null ) {
q=mp->cur_exp;
- } else if ( type(p)!=mp_known ) {
+ } else if ( mp_type(p)!=mp_known ) {
q=p;
} else {
if ( v_is_scaled ) value(p)=mp_take_scaled(mp, value(p),v);
else value(p)=mp_take_fraction(mp, value(p),v);
return;
};
- t=type(q); q=dep_list(q); s=t;
+ t=mp_type(q); q=dep_list(q); s=t;
if ( t==mp_dependent ) if ( v_is_scaled )
if (mp_ab_vs_cd(mp, mp_max_coef(mp,q),abs(v),coef_bound-1,unity)>=0 )
t=mp_proto_dependent;
@@ -20279,7 +20503,8 @@ void mp_dep_mult (MP mp,pointer p, integer v, boolean v_is_scaled) {
internally, when |v| is a |fraction| whose magnitude is at most~1,
and when |cur_type>=mp_color_type|.
-@c void mp_frac_mult (MP mp,scaled n, scaled d) {
+@c
+static void mp_frac_mult (MP mp,scaled n, scaled d) {
/* multiplies |cur_exp| by |n/d| */
pointer p; /* a pair node */
pointer old_exp; /* a capsule to recycle */
@@ -20321,7 +20546,7 @@ and when |cur_type>=mp_color_type|.
@ @<Trace the fraction multiplication@>=
{
mp_begin_diagnostic(mp);
- mp_print_nl(mp, "{("); mp_print_scaled(mp,n); mp_print_char(mp,'/');
+ mp_print_nl(mp, "{("); mp_print_scaled(mp,n); mp_print_char(mp,xord('/'));
mp_print_scaled(mp,d); mp_print(mp,")*("); mp_print_exp(mp,null,0);
mp_print(mp,")}");
mp_end_diagnostic(mp, false);
@@ -20330,32 +20555,32 @@ and when |cur_type>=mp_color_type|.
@ The |hard_times| routine multiplies a nice color or pair by a dependency list.
@<Declare binary action procedures@>=
-void mp_hard_times (MP mp,pointer p) {
+static void mp_hard_times (MP mp,pointer p) {
pointer q; /* a copy of the dependent variable |p| */
pointer r; /* a component of the big node for the nice color or pair */
scaled v; /* the known value for |r| */
- if ( type(p)<=mp_pair_type ) {
+ if ( mp_type(p)<=mp_pair_type ) {
q=mp_stash_cur_exp(mp); mp_unstash_cur_exp(mp, p); p=q;
}; /* now |cur_type=mp_pair_type| or |cur_type=mp_color_type| */
r=value(mp->cur_exp)+mp->big_node_size[mp->cur_type];
while (1) {
r=r-2;
v=value(r);
- type(r)=type(p);
+ mp_type(r)=mp_type(p);
if ( r==value(mp->cur_exp) )
break;
mp_new_dep(mp, r,mp_copy_dep_list(mp, dep_list(p)));
mp_dep_mult(mp, r,v,true);
}
mp->mem[value_loc(r)]=mp->mem[value_loc(p)];
- link(prev_dep(p))=r;
+ mp_link(prev_dep(p))=r;
mp_free_node(mp, p,value_node_size);
mp_dep_mult(mp, r,v,true);
}
@ @<Additional cases of binary operators@>=
case over:
- if ( (mp->cur_type!=mp_known)||(type(p)<mp_color_type) ) {
+ if ( (mp->cur_type!=mp_known)||(mp_type(p)<mp_color_type) ) {
mp_bad_binary(mp, p,over);
} else {
v=mp->cur_exp; mp_unstash_cur_exp(mp, p);
@@ -20378,13 +20603,13 @@ case over:
break;
@ @<Declare binary action...@>=
-void mp_dep_div (MP mp,pointer p, scaled v) {
+static void mp_dep_div (MP mp,pointer p, scaled v) {
pointer q; /* the dependency list being divided by |v| */
- small_number s,t; /* its type, before and after */
+ quarterword s,t; /* its type, before and after */
if ( p==null ) q=mp->cur_exp;
- else if ( type(p)!=mp_known ) q=p;
+ else if ( mp_type(p)!=mp_known ) q=p;
else { value(p)=mp_make_scaled(mp, value(p),v); return; };
- t=type(q); q=dep_list(q); s=t;
+ t=mp_type(q); q=dep_list(q); s=t;
if ( t==mp_dependent )
if ( mp_ab_vs_cd(mp, mp_max_coef(mp,q),unity,coef_bound-1,abs(v))>=0 )
t=mp_proto_dependent;
@@ -20396,15 +20621,15 @@ void mp_dep_div (MP mp,pointer p, scaled v) {
{
exp_err("Division by zero");
@.Division by zero@>
- help2("You're trying to divide the quantity shown above the error")
- ("message by zero. I'm going to divide it by one instead.");
+ help2("You're trying to divide the quantity shown above the error",
+ "message by zero. I'm going to divide it by one instead.");
mp_put_get_error(mp);
}
@ @<Additional cases of binary operators@>=
case pythag_add:
case pythag_sub:
- if ( (mp->cur_type==mp_known)&&(type(p)==mp_known) ) {
+ if ( (mp->cur_type==mp_known)&&(mp_type(p)==mp_known) ) {
if ( c==pythag_add ) mp->cur_exp=mp_pyth_add(mp, value(p),mp->cur_exp);
else mp->cur_exp=mp_pyth_sub(mp, value(p),mp->cur_exp);
} else mp_bad_binary(mp, p,c);
@@ -20417,16 +20642,16 @@ of coordinate data.
case rotated_by: case slanted_by:
case scaled_by: case shifted_by: case transformed_by:
case x_scaled: case y_scaled: case z_scaled:
- if ( type(p)==mp_path_type ) {
+ if ( mp_type(p)==mp_path_type ) {
path_trans(c,p); binary_return;
- } else if ( type(p)==mp_pen_type ) {
+ } else if ( mp_type(p)==mp_pen_type ) {
pen_trans(c,p);
mp->cur_exp=mp_convex_hull(mp, mp->cur_exp);
/* rounding error could destroy convexity */
binary_return;
- } else if ( (type(p)==mp_pair_type)||(type(p)==mp_transform_type) ) {
+ } else if ( (mp_type(p)==mp_pair_type)||(mp_type(p)==mp_transform_type) ) {
mp_big_trans(mp, p,c);
- } else if ( type(p)==mp_picture_type ) {
+ } else if ( mp_type(p)==mp_picture_type ) {
mp_do_edges_trans(mp, p,c); binary_return;
} else {
mp_bad_binary(mp, p,c);
@@ -20443,7 +20668,7 @@ moved to the global variables |txx|, |txy|, |tyx|, |tyy|, |tx|, |ty|;
and |cur_exp| is changed to the known value zero.
@<Declare binary action...@>=
-void mp_set_up_trans (MP mp,quarterword c) {
+static void mp_set_up_trans (MP mp,quarterword c) {
pointer p,q,r; /* list manipulation registers */
if ( (c!=transformed_by)||(mp->cur_type!=mp_transform_type) ) {
@<Put the current transform into |cur_exp|@>;
@@ -20473,9 +20698,9 @@ scaled ty; /* current transform coefficients */
}; /* there are no other cases */
mp_disp_err(mp, p,"Improper transformation argument");
@.Improper transformation argument@>
- help3("The expression shown above has the wrong type,")
- ("so I can\'t transform anything using it.")
- ("Proceed, and I'll omit the transformation.");
+ help3("The expression shown above has the wrong type,",
+ "so I can\'t transform anything using it.",
+ "Proceed, and I'll omit the transformation.");
mp_put_get_error(mp);
DONE:
mp_recycle_value(mp, p);
@@ -20486,7 +20711,7 @@ DONE:
q=value(mp->cur_exp); r=q+transform_node_size;
do {
r=r-2;
- if ( type(r)!=mp_known ) return;
+ if ( mp_type(r)!=mp_known ) return;
} while (r!=q);
mp->txx=value(xx_part_loc(q));
mp->txy=value(xy_part_loc(q));
@@ -20498,38 +20723,38 @@ mp_flush_cur_exp(mp, 0)
@ @<For each of the eight cases...@>=
case rotated_by:
- if ( type(p)==mp_known )
+ if ( mp_type(p)==mp_known )
@<Install sines and cosines, then |goto done|@>;
break;
case slanted_by:
- if ( type(p)>mp_pair_type ) {
+ if ( mp_type(p)>mp_pair_type ) {
mp_install(mp, xy_part_loc(q),p); goto DONE;
};
break;
case scaled_by:
- if ( type(p)>mp_pair_type ) {
+ if ( mp_type(p)>mp_pair_type ) {
mp_install(mp, xx_part_loc(q),p); mp_install(mp, yy_part_loc(q),p);
goto DONE;
};
break;
case shifted_by:
- if ( type(p)==mp_pair_type ) {
+ if ( mp_type(p)==mp_pair_type ) {
r=value(p); mp_install(mp, x_part_loc(q),x_part_loc(r));
mp_install(mp, y_part_loc(q),y_part_loc(r)); goto DONE;
};
break;
case x_scaled:
- if ( type(p)>mp_pair_type ) {
+ if ( mp_type(p)>mp_pair_type ) {
mp_install(mp, xx_part_loc(q),p); goto DONE;
};
break;
case y_scaled:
- if ( type(p)>mp_pair_type ) {
+ if ( mp_type(p)>mp_pair_type ) {
mp_install(mp, yy_part_loc(q),p); goto DONE;
};
break;
case z_scaled:
- if ( type(p)==mp_pair_type )
+ if ( mp_type(p)==mp_pair_type )
@<Install a complex multiplier, then |goto done|@>;
break;
case transformed_by:
@@ -20551,7 +20776,7 @@ case transformed_by:
mp_install(mp, xx_part_loc(q),x_part_loc(r));
mp_install(mp, yy_part_loc(q),x_part_loc(r));
mp_install(mp, yx_part_loc(q),y_part_loc(r));
- if ( type(y_part_loc(r))==mp_known ) negate(value(y_part_loc(r)));
+ if ( mp_type(y_part_loc(r))==mp_known ) negate(value(y_part_loc(r)));
else mp_negate_dep_list(mp, dep_list(y_part_loc(r)));
mp_install(mp, xy_part_loc(q),y_part_loc(r));
goto DONE;
@@ -20561,14 +20786,14 @@ case transformed_by:
insists that the transformation be entirely known.
@<Declare binary action...@>=
-void mp_set_up_known_trans (MP mp,quarterword c) {
+static void mp_set_up_known_trans (MP mp,quarterword c) {
mp_set_up_trans(mp, c);
if ( mp->cur_type!=mp_known ) {
exp_err("Transform components aren't all known");
@.Transform components...@>
- help3("I'm unable to apply a partially specified transformation")
- ("except to a fully known pair or transform.")
- ("Proceed, and I'll omit the transformation.");
+ help3("I'm unable to apply a partially specified transformation",
+ "except to a fully known pair or transform.",
+ "Proceed, and I'll omit the transformation.");
mp_put_get_flush_error(mp, 0);
mp->txx=unity; mp->txy=0; mp->tyx=0; mp->tyy=unity;
mp->tx=0; mp->ty=0;
@@ -20579,7 +20804,7 @@ void mp_set_up_known_trans (MP mp,quarterword c) {
coordinates in locations |p| and~|q|.
@<Declare binary action...@>=
-void mp_trans (MP mp,pointer p, pointer q) {
+static void mp_trans (MP mp,pointer p, pointer q) {
scaled v; /* the new |x| value */
v=mp_take_scaled(mp, mp->mem[p].sc,mp->txx)+
mp_take_scaled(mp, mp->mem[q].sc,mp->txy)+mp->tx;
@@ -20598,39 +20823,39 @@ to the path~|p|.
mp_do_path_trans(mp, mp->cur_exp); }
@<Declare binary action...@>=
-void mp_do_path_trans (MP mp,pointer p) {
+static void mp_do_path_trans (MP mp,pointer p) {
pointer q; /* list traverser */
q=p;
do {
- if ( left_type(q)!=mp_endpoint )
- mp_trans(mp, q+3,q+4); /* that's |left_x| and |left_y| */
- mp_trans(mp, q+1,q+2); /* that's |x_coord| and |y_coord| */
- if ( right_type(q)!=mp_endpoint )
- mp_trans(mp, q+5,q+6); /* that's |right_x| and |right_y| */
+ if ( mp_left_type(q)!=mp_endpoint )
+ mp_trans(mp, q+3,q+4); /* that's |mp_left_x| and |mp_left_y| */
+ mp_trans(mp, q+1,q+2); /* that's |mp_x_coord| and |mp_y_coord| */
+ if ( mp_right_type(q)!=mp_endpoint )
+ mp_trans(mp, q+5,q+6); /* that's |mp_right_x| and |mp_right_y| */
@^data structure assumptions@>
- q=link(q);
+ q=mp_link(q);
} while (q!=p);
}
-@ Transforming a pen is very similar, except that there are no |left_type|
-and |right_type| fields.
+@ Transforming a pen is very similar, except that there are no |mp_left_type|
+and |mp_right_type| fields.
@d pen_trans(A,B) { mp_set_up_known_trans(mp, (A));
mp_unstash_cur_exp(mp, (B));
mp_do_pen_trans(mp, mp->cur_exp); }
@<Declare binary action...@>=
-void mp_do_pen_trans (MP mp,pointer p) {
+static void mp_do_pen_trans (MP mp,pointer p) {
pointer q; /* list traverser */
if ( pen_is_elliptical(p) ) {
- mp_trans(mp, p+3,p+4); /* that's |left_x| and |left_y| */
- mp_trans(mp, p+5,p+6); /* that's |right_x| and |right_y| */
+ mp_trans(mp, p+3,p+4); /* that's |mp_left_x| and |mp_left_y| */
+ mp_trans(mp, p+5,p+6); /* that's |mp_right_x| and |mp_right_y| */
};
q=p;
do {
- mp_trans(mp, q+1,q+2); /* that's |x_coord| and |y_coord| */
+ mp_trans(mp, q+1,q+2); /* that's |mp_x_coord| and |mp_y_coord| */
@^data structure assumptions@>
- q=link(q);
+ q=mp_link(q);
} while (q!=p);
}
@@ -20644,7 +20869,7 @@ that they have to return a (possibly new) structure because of the need to call
|private_edges|.
@<Declare binary action...@>=
-pointer mp_edges_trans (MP mp, pointer h) {
+static pointer mp_edges_trans (MP mp, pointer h) {
pointer q; /* the object being transformed */
pointer r,s; /* for list manipulation */
scaled sx,sy; /* saved transformation parameters */
@@ -20659,19 +20884,19 @@ pointer mp_edges_trans (MP mp, pointer h) {
}
@<Make the bounding box of |h| unknown if it can't be updated properly
without scanning the whole structure@>;
- q=link(dummy_loc(h));
+ q=mp_link(dummy_loc(h));
while ( q!=null ) {
@<Transform graphical object |q|@>;
- q=link(q);
+ q=mp_link(q);
}
return h;
}
-void mp_do_edges_trans (MP mp,pointer p, quarterword c) {
+static void mp_do_edges_trans (MP mp,pointer p, quarterword c) {
mp_set_up_known_trans(mp, c);
value(p)=mp_edges_trans(mp, value(p));
mp_unstash_cur_exp(mp, p);
}
-void mp_scale_edges (MP mp) {
+static void mp_scale_edges (MP mp) {
mp->txx=mp->se_sf; mp->tyy=mp->se_sf;
mp->txy=0; mp->tyx=0; mp->tx=0; mp->ty=0;
mp->se_pic=mp_edges_trans(mp, mp->se_pic);
@@ -20692,9 +20917,9 @@ if ( (mp->txy!=0)||(mp->tyx!=0)||
r=dash_list(h);
dash_list(h)=null_dash;
while ( r!=null_dash ) {
- s=r; r=link(r);
+ s=r; r=mp_link(r);
v=start_x(s); start_x(s)=stop_x(s); stop_x(s)=v;
- link(s)=dash_list(h);
+ mp_link(s)=dash_list(h);
dash_list(h)=s;
}
}
@@ -20704,7 +20929,7 @@ r=dash_list(h);
while ( r!=null_dash ) {
start_x(r)=mp_take_scaled(mp, start_x(r),mp->txx)+mp->tx;
stop_x(r)=mp_take_scaled(mp, stop_x(r),mp->txx)+mp->tx;
- r=link(r);
+ r=mp_link(r);
}
@ @<Make the bounding box of |h| unknown if it can't be updated properly...@>=
@@ -20749,13 +20974,13 @@ sum is similar.
structure~|h|.
@<Transform graphical object |q|@>=
-switch (type(q)) {
+switch (mp_type(q)) {
case mp_fill_code: case mp_stroked_code:
- mp_do_path_trans(mp, path_p(q));
- @<Transform |pen_p(q)|, making sure polygonal pens stay counter-clockwise@>;
+ mp_do_path_trans(mp, mp_path_p(q));
+ @<Transform |mp_pen_p(q)|, making sure polygonal pens stay counter-clockwise@>;
break;
case mp_start_clip_code: case mp_start_bounds_code:
- mp_do_path_trans(mp, path_p(q));
+ mp_do_path_trans(mp, mp_path_p(q));
break;
case mp_text_code:
r=text_tx_loc(q);
@@ -20766,21 +20991,21 @@ case mp_stop_clip_code: case mp_stop_bounds_code:
} /* there are no other cases */
@ Note that the shift parameters |(tx,ty)| apply only to the path being stroked.
-The |dash_scale| has to be adjusted to scale the dash lengths in |dash_p(q)|
+The |dash_scale| has to be adjusted to scale the dash lengths in |mp_dash_p(q)|
since the \ps\ output procedures will try to compensate for the transformation
-we are applying to |pen_p(q)|. Since this compensation is based on the square
+we are applying to |mp_pen_p(q)|. Since this compensation is based on the square
root of the determinant, |sqdet| is the appropriate factor.
-@<Transform |pen_p(q)|, making sure...@>=
-if ( pen_p(q)!=null ) {
+@<Transform |mp_pen_p(q)|, making sure...@>=
+if ( mp_pen_p(q)!=null ) {
sx=mp->tx; sy=mp->ty;
mp->tx=0; mp->ty=0;
- mp_do_pen_trans(mp, pen_p(q));
- if ( ((type(q)==mp_stroked_code)&&(dash_p(q)!=null)) )
+ mp_do_pen_trans(mp, mp_pen_p(q));
+ if ( ((mp_type(q)==mp_stroked_code)&&(mp_dash_p(q)!=null)) )
dash_scale(q)=mp_take_scaled(mp, dash_scale(q),sqdet);
- if ( ! pen_is_elliptical(pen_p(q)) )
+ if ( ! pen_is_elliptical(mp_pen_p(q)) )
if ( sgndet<0 )
- pen_p(q)=mp_make_pen(mp, mp_copy_path(mp, pen_p(q)),true);
+ mp_pen_p(q)=mp_make_pen(mp, mp_copy_path(mp, mp_pen_p(q)),true);
/* this unreverses the pen */
mp->tx=sx; mp->ty=sy;
}
@@ -20802,13 +21027,13 @@ and when some of their components are unknown.
@<Declare binary action...@>=
@<Declare subroutines needed by |big_trans|@>
-void mp_big_trans (MP mp,pointer p, quarterword c) {
+static void mp_big_trans (MP mp,pointer p, quarterword c) {
pointer q,r,pp,qq; /* list manipulation registers */
- small_number s; /* size of a big node */
- s=mp->big_node_size[type(p)]; q=value(p); r=q+s;
+ quarterword s; /* size of a big node */
+ s=mp->big_node_size[mp_type(p)]; q=value(p); r=q+s;
do {
r=r-2;
- if ( type(r)!=mp_known ) {
+ if ( mp_type(r)!=mp_known ) {
@<Transform an unknown big node and |return|@>;
}
} while (r!=q);
@@ -20835,39 +21060,39 @@ and let |q| point to a another value field. The |bilin1| procedure
replaces |p| by $p\cdot t+q\cdot u+\delta$.
@<Declare subroutines needed by |big_trans|@>=
-void mp_bilin1 (MP mp, pointer p, scaled t, pointer q,
+static void mp_bilin1 (MP mp, pointer p, scaled t, pointer q,
scaled u, scaled delta) {
pointer r; /* list traverser */
if ( t!=unity ) mp_dep_mult(mp, p,t,true);
if ( u!=0 ) {
- if ( type(q)==mp_known ) {
+ if ( mp_type(q)==mp_known ) {
delta+=mp_take_scaled(mp, value(q),u);
} else {
@<Ensure that |type(p)=mp_proto_dependent|@>;
dep_list(p)=mp_p_plus_fq(mp, dep_list(p),u,dep_list(q),
- mp_proto_dependent,type(q));
+ mp_proto_dependent,mp_type(q));
}
}
- if ( type(p)==mp_known ) {
+ if ( mp_type(p)==mp_known ) {
value(p)+=delta;
} else {
r=dep_list(p);
- while ( info(r)!=null ) r=link(r);
+ while ( mp_info(r)!=null ) r=mp_link(r);
delta+=value(r);
if ( r!=dep_list(p) ) value(r)=delta;
- else { mp_recycle_value(mp, p); type(p)=mp_known; value(p)=delta; };
+ else { mp_recycle_value(mp, p); mp_type(p)=mp_known; value(p)=delta; };
}
if ( mp->fix_needed ) mp_fix_dependencies(mp);
}
@ @<Ensure that |type(p)=mp_proto_dependent|@>=
-if ( type(p)!=mp_proto_dependent ) {
- if ( type(p)==mp_known )
+if ( mp_type(p)!=mp_proto_dependent ) {
+ if ( mp_type(p)==mp_known )
mp_new_dep(mp, p,mp_const_dependency(mp, value(p)));
else
dep_list(p)=mp_p_times_v(mp, dep_list(p),unity,mp_dependent,
mp_proto_dependent,true);
- type(p)=mp_proto_dependent;
+ mp_type(p)=mp_proto_dependent;
}
@ @<Transform a known big node@>=
@@ -20899,12 +21124,12 @@ at |dep_final|. The following procedure adds |v| times another
numeric quantity to~|p|.
@<Declare subroutines needed by |big_trans|@>=
-void mp_add_mult_dep (MP mp,pointer p, scaled v, pointer r) {
- if ( type(r)==mp_known ) {
+static void mp_add_mult_dep (MP mp,pointer p, scaled v, pointer r) {
+ if ( mp_type(r)==mp_known ) {
value(mp->dep_final)+=mp_take_scaled(mp, value(r),v);
} else {
dep_list(p)=mp_p_plus_fq(mp, dep_list(p),v,dep_list(r),
- mp_proto_dependent,type(r));
+ mp_proto_dependent,mp_type(r));
if ( mp->fix_needed ) mp_fix_dependencies(mp);
}
}
@@ -20917,10 +21142,10 @@ unless it is |null| (which stands for zero). Location~|p| will be
replaced by $p\cdot t+v\cdot u+q$.
@<Declare subroutines needed by |big_trans|@>=
-void mp_bilin2 (MP mp,pointer p, pointer t, scaled v,
+static void mp_bilin2 (MP mp,pointer p, pointer t, scaled v,
pointer u, pointer q) {
scaled vv; /* temporary storage for |value(p)| */
- vv=value(p); type(p)=mp_proto_dependent;
+ vv=value(p); mp_type(p)=mp_proto_dependent;
mp_new_dep(mp, p,mp_const_dependency(mp, 0)); /* this sets |dep_final| */
if ( vv!=0 )
mp_add_mult_dep(mp, p,vv,t); /* |dep_final| doesn't change */
@@ -20928,7 +21153,7 @@ void mp_bilin2 (MP mp,pointer p, pointer t, scaled v,
if ( q!=null ) mp_add_mult_dep(mp, p,unity,q);
if ( dep_list(p)==mp->dep_final ) {
vv=value(mp->dep_final); mp_recycle_value(mp, p);
- type(p)=mp_known; value(p)=vv;
+ mp_type(p)=mp_known; value(p)=vv;
}
}
@@ -20948,7 +21173,7 @@ void mp_bilin2 (MP mp,pointer p, pointer t, scaled v,
@ Finally, in |bilin3| everything is |known|.
@<Declare subroutines needed by |big_trans|@>=
-void mp_bilin3 (MP mp,pointer p, scaled t,
+static void mp_bilin3 (MP mp,pointer p, scaled t,
scaled v, scaled u, scaled delta) {
if ( t!=unity )
delta+=mp_take_scaled(mp, value(p),t);
@@ -20960,37 +21185,49 @@ void mp_bilin3 (MP mp,pointer p, scaled t,
@ @<Additional cases of binary operators@>=
case concatenate:
- if ( (mp->cur_type==mp_string_type)&&(type(p)==mp_string_type) ) mp_cat(mp, p);
+ if ( (mp->cur_type==mp_string_type)&&(mp_type(p)==mp_string_type) ) mp_cat(mp, p);
else mp_bad_binary(mp, p,concatenate);
break;
case substring_of:
- if ( mp_nice_pair(mp, p,type(p))&&(mp->cur_type==mp_string_type) )
+ if ( mp_nice_pair(mp, p,mp_type(p))&&(mp->cur_type==mp_string_type) )
mp_chop_string(mp, value(p));
else mp_bad_binary(mp, p,substring_of);
break;
case subpath_of:
if ( mp->cur_type==mp_pair_type ) mp_pair_to_path(mp);
- if ( mp_nice_pair(mp, p,type(p))&&(mp->cur_type==mp_path_type) )
+ if ( mp_nice_pair(mp, p,mp_type(p))&&(mp->cur_type==mp_path_type) )
mp_chop_path(mp, value(p));
else mp_bad_binary(mp, p,subpath_of);
break;
@ @<Declare binary action...@>=
-void mp_cat (MP mp,pointer p) {
+static void mp_cat (MP mp,pointer p) {
str_number a,b; /* the strings being concatenated */
- pool_pointer k; /* index into |str_pool| */
- a=value(p); b=mp->cur_exp; str_room(length(a)+length(b));
- for (k=mp->str_start[a];k<=str_stop(a)-1;k++) {
- append_char(mp->str_pool[k]);
- }
- for (k=mp->str_start[b];k<=str_stop(b)-1;k++) {
- append_char(mp->str_pool[k]);
+ integer k; /* run length */
+ integer needed;
+ a=value(p); b=mp->cur_exp; k=length(a);
+ needed=mp->pool_ptr+k+length(b);
+ /* this will free some memory, hopefully */
+ if (mp->pool_ptr>(11*mp->old_pool_size)/10) {
+ mp->old_pool_size = mp->pool_ptr;
+ mp_do_compaction(mp, mp->pool_size);
+ }
+ if ( needed > mp->max_pool_ptr ) {
+ if ( needed > mp->pool_size ) {
+ mp_reallocate_pool(mp,needed);
+ }
+ mp->max_pool_ptr=needed;
}
+ memcpy(mp->str_pool+mp->pool_ptr, mp->str_pool+mp->str_start[a],(size_t)k);
+ mp->pool_ptr+=k;
+ k=length(b);
+ memcpy(mp->str_pool+mp->pool_ptr, mp->str_pool+mp->str_start[b],(size_t)k);
+ mp->pool_ptr+=k;
mp->cur_exp=mp_make_string(mp); delete_str_ref(b);
}
@ @<Declare binary action...@>=
-void mp_chop_string (MP mp,pointer p) {
+static void mp_chop_string (MP mp,pointer p) {
integer a, b; /* start and stop points */
integer l; /* length of the original string */
integer k; /* runs from |a| to |b| */
@@ -21015,7 +21252,7 @@ void mp_chop_string (MP mp,pointer p) {
append_char(mp->str_pool[k]);
}
} else {
- for (k=mp->str_start[s]+a;k<=mp->str_start[s]+b-1;k++) {
+ for (k=mp->str_start[s]+a;k<mp->str_start[s]+b;k++) {
append_char(mp->str_pool[k]);
}
}
@@ -21023,7 +21260,7 @@ void mp_chop_string (MP mp,pointer p) {
}
@ @<Declare binary action...@>=
-void mp_chop_path (MP mp,pointer p) {
+static void mp_chop_path (MP mp,pointer p) {
pointer q; /* a knot in the original path */
pointer pp,qq,rr,ss; /* link variables for copies of path nodes */
scaled a,b,k,l; /* indices for chopping */
@@ -21034,17 +21271,17 @@ void mp_chop_path (MP mp,pointer p) {
@<Dispense with the cases |a<0| and/or |b>l|@>;
q=mp->cur_exp;
while ( a>=unity ) {
- q=link(q); a=a-unity; b=b-unity;
+ q=mp_link(q); a=a-unity; b=b-unity;
}
if ( b==a ) {
@<Construct a path from |pp| to |qq| of length zero@>;
} else {
@<Construct a path from |pp| to |qq| of length $\lceil b\rceil$@>;
}
- left_type(pp)=mp_endpoint; right_type(qq)=mp_endpoint; link(qq)=pp;
+ mp_left_type(pp)=mp_endpoint; mp_right_type(qq)=mp_endpoint; mp_link(qq)=pp;
mp_toss_knot_list(mp, mp->cur_exp);
if ( reversed ) {
- mp->cur_exp=link(mp_htap_ypoc(mp, pp)); mp_toss_knot_list(mp, pp);
+ mp->cur_exp=mp_link(mp_htap_ypoc(mp, pp)); mp_toss_knot_list(mp, pp);
} else {
mp->cur_exp=pp;
}
@@ -21052,14 +21289,14 @@ void mp_chop_path (MP mp,pointer p) {
@ @<Dispense with the cases |a<0| and/or |b>l|@>=
if ( a<0 ) {
- if ( left_type(mp->cur_exp)==mp_endpoint ) {
+ if ( mp_left_type(mp->cur_exp)==mp_endpoint ) {
a=0; if ( b<0 ) b=0;
} else {
do { a=a+l; b=b+l; } while (a<0); /* a cycle always has length |l>0| */
}
}
if ( b>l ) {
- if ( left_type(mp->cur_exp)==mp_endpoint ) {
+ if ( mp_left_type(mp->cur_exp)==mp_endpoint ) {
b=l; if ( a>l ) a=l;
} else {
while ( a>=l ) {
@@ -21072,11 +21309,11 @@ if ( b>l ) {
{
pp=mp_copy_knot(mp, q); qq=pp;
do {
- q=link(q); rr=qq; qq=mp_copy_knot(mp, q); link(rr)=qq; b=b-unity;
+ q=mp_link(q); rr=qq; qq=mp_copy_knot(mp, q); mp_link(rr)=qq; b=b-unity;
} while (b>0);
if ( a>0 ) {
- ss=pp; pp=link(pp);
- mp_split_cubic(mp, ss,a*010000); pp=link(ss);
+ ss=pp; pp=mp_link(pp);
+ mp_split_cubic(mp, ss,a*010000); pp=mp_link(ss);
mp_free_node(mp, ss,knot_node_size);
if ( rr==ss ) {
b=mp_make_scaled(mp, b,unity-a); rr=pp;
@@ -21085,13 +21322,13 @@ if ( b>l ) {
if ( b<0 ) {
mp_split_cubic(mp, rr,(b+unity)*010000);
mp_free_node(mp, qq,knot_node_size);
- qq=link(rr);
+ qq=mp_link(rr);
}
}
@ @<Construct a path from |pp| to |qq| of length zero@>=
{
- if ( a>0 ) { mp_split_cubic(mp, q,a*010000); q=link(q); };
+ if ( a>0 ) { mp_split_cubic(mp, q,a*010000); q=mp_link(q); };
pp=mp_copy_knot(mp, q); qq=pp;
}
@@ -21099,42 +21336,42 @@ if ( b>l ) {
case point_of: case precontrol_of: case postcontrol_of:
if ( mp->cur_type==mp_pair_type )
mp_pair_to_path(mp);
- if ( (mp->cur_type==mp_path_type)&&(type(p)==mp_known) )
+ if ( (mp->cur_type==mp_path_type)&&(mp_type(p)==mp_known) )
mp_find_point(mp, value(p),c);
else
mp_bad_binary(mp, p,c);
break;
case pen_offset_of:
- if ( (mp->cur_type==mp_pen_type)&& mp_nice_pair(mp, p,type(p)) )
+ if ( (mp->cur_type==mp_pen_type)&& mp_nice_pair(mp, p,mp_type(p)) )
mp_set_up_offset(mp, value(p));
else
mp_bad_binary(mp, p,pen_offset_of);
break;
case direction_time_of:
if ( mp->cur_type==mp_pair_type ) mp_pair_to_path(mp);
- if ( (mp->cur_type==mp_path_type)&& mp_nice_pair(mp, p,type(p)) )
+ if ( (mp->cur_type==mp_path_type)&& mp_nice_pair(mp, p,mp_type(p)) )
mp_set_up_direction_time(mp, value(p));
else
mp_bad_binary(mp, p,direction_time_of);
break;
case envelope_of:
- if ( (type(p) != mp_pen_type) || (mp->cur_type != mp_path_type) )
+ if ( (mp_type(p) != mp_pen_type) || (mp->cur_type != mp_path_type) )
mp_bad_binary(mp, p,envelope_of);
else
mp_set_up_envelope(mp, p);
break;
@ @<Declare binary action...@>=
-void mp_set_up_offset (MP mp,pointer p) {
+static void mp_set_up_offset (MP mp,pointer p) {
mp_find_offset(mp, value(x_part_loc(p)),value(y_part_loc(p)),mp->cur_exp);
mp_pair_value(mp, mp->cur_x,mp->cur_y);
}
-void mp_set_up_direction_time (MP mp,pointer p) {
+static void mp_set_up_direction_time (MP mp,pointer p) {
mp_flush_cur_exp(mp, mp_find_direction_time(mp, value(x_part_loc(p)),
value(y_part_loc(p)),mp->cur_exp));
}
-void mp_set_up_envelope (MP mp,pointer p) {
- small_number ljoin, lcap;
+static void mp_set_up_envelope (MP mp,pointer p) {
+ quarterword ljoin, lcap;
scaled miterlim;
pointer q = mp_copy_path(mp, mp->cur_exp); /* the original path */
/* TODO: accept elliptical pens for straight paths */
@@ -21159,23 +21396,23 @@ void mp_set_up_envelope (MP mp,pointer p) {
}
@ @<Declare binary action...@>=
-void mp_find_point (MP mp,scaled v, quarterword c) {
+static void mp_find_point (MP mp,scaled v, quarterword c) {
pointer p; /* the path */
scaled n; /* its length */
p=mp->cur_exp;
- if ( left_type(p)==mp_endpoint ) n=-unity; else n=0;
- do { p=link(p); n=n+unity; } while (p!=mp->cur_exp);
+ if ( mp_left_type(p)==mp_endpoint ) n=-unity; else n=0;
+ do { p=mp_link(p); n=n+unity; } while (p!=mp->cur_exp);
if ( n==0 ) {
v=0;
} else if ( v<0 ) {
- if ( left_type(p)==mp_endpoint ) v=0;
+ if ( mp_left_type(p)==mp_endpoint ) v=0;
else v=n-1-((-v-1) % n);
} else if ( v>n ) {
- if ( left_type(p)==mp_endpoint ) v=n;
+ if ( mp_left_type(p)==mp_endpoint ) v=n;
else v=v % n;
}
p=mp->cur_exp;
- while ( v>=unity ) { p=link(p); v=v-unity; };
+ while ( v>=unity ) { p=mp_link(p); v=v-unity; };
if ( v!=0 ) {
@<Insert a fractional node by splitting the cubic@>;
}
@@ -21183,20 +21420,20 @@ void mp_find_point (MP mp,scaled v, quarterword c) {
}
@ @<Insert a fractional node...@>=
-{ mp_split_cubic(mp, p,v*010000); p=link(p); }
+{ mp_split_cubic(mp, p,v*010000); p=mp_link(p); }
@ @<Set the current expression to the desired path coordinates...@>=
switch (c) {
case point_of:
- mp_pair_value(mp, x_coord(p),y_coord(p));
+ mp_pair_value(mp, mp_x_coord(p),mp_y_coord(p));
break;
case precontrol_of:
- if ( left_type(p)==mp_endpoint ) mp_pair_value(mp, x_coord(p),y_coord(p));
- else mp_pair_value(mp, left_x(p),left_y(p));
+ if ( mp_left_type(p)==mp_endpoint ) mp_pair_value(mp, mp_x_coord(p),mp_y_coord(p));
+ else mp_pair_value(mp, mp_left_x(p),mp_left_y(p));
break;
case postcontrol_of:
- if ( right_type(p)==mp_endpoint ) mp_pair_value(mp, x_coord(p),y_coord(p));
- else mp_pair_value(mp, right_x(p),right_y(p));
+ if ( mp_right_type(p)==mp_endpoint ) mp_pair_value(mp, mp_x_coord(p),mp_y_coord(p));
+ else mp_pair_value(mp, mp_right_x(p),mp_right_y(p));
break;
} /* there are no other cases */
@@ -21204,7 +21441,7 @@ case postcontrol_of:
case arc_time_of:
if ( mp->cur_type==mp_pair_type )
mp_pair_to_path(mp);
- if ( (mp->cur_type==mp_path_type)&&(type(p)==mp_known) )
+ if ( (mp->cur_type==mp_path_type)&&(mp_type(p)==mp_known) )
mp_flush_cur_exp(mp, mp_get_arc_time(mp, mp->cur_exp,value(p)));
else
mp_bad_binary(mp, p,c);
@@ -21212,12 +21449,12 @@ case arc_time_of:
@ @<Additional cases of bin...@>=
case intersect:
- if ( type(p)==mp_pair_type ) {
+ if ( mp_type(p)==mp_pair_type ) {
q=mp_stash_cur_exp(mp); mp_unstash_cur_exp(mp, p);
mp_pair_to_path(mp); p=mp_stash_cur_exp(mp); mp_unstash_cur_exp(mp, q);
};
if ( mp->cur_type==mp_pair_type ) mp_pair_to_path(mp);
- if ( (mp->cur_type==mp_path_type)&&(type(p)==mp_path_type) ) {
+ if ( (mp->cur_type==mp_path_type)&&(mp_type(p)==mp_path_type) ) {
mp_path_intersection(mp, value(p),mp->cur_exp);
mp_pair_value(mp, mp->cur_t,mp->cur_tt);
} else {
@@ -21227,7 +21464,7 @@ case intersect:
@ @<Additional cases of bin...@>=
case in_font:
- if ( (mp->cur_type!=mp_string_type)||(type(p)!=mp_string_type))
+ if ( (mp->cur_type!=mp_string_type)||(mp_type(p)!=mp_string_type))
mp_bad_binary(mp, p,in_font);
else { mp_do_infont(mp, p); binary_return; }
break;
@@ -21236,12 +21473,12 @@ case in_font:
(the text string) but not its first (the font name).
@<Declare binary action...@>=
-void mp_do_infont (MP mp,pointer p) {
+static void mp_do_infont (MP mp,pointer p) {
pointer q;
q=mp_get_node(mp, edge_header_size);
mp_init_edges(mp, q);
- link(obj_tail(q))=mp_new_text_node(mp,str(mp->cur_exp),value(p));
- obj_tail(q)=link(obj_tail(q));
+ mp_link(obj_tail(q))=mp_new_text_node(mp,str(mp->cur_exp),value(p));
+ obj_tail(q)=mp_link(obj_tail(q));
mp_free_node(mp, p,value_node_size);
mp_flush_cur_exp(mp, q);
mp->cur_type=mp_picture_type;
@@ -21298,12 +21535,12 @@ occur when the statement is null.
if ( mp->cur_cmd<semicolon ) {
print_err("A statement can't begin with `");
@.A statement can't begin with x@>
- mp_print_cmd_mod(mp, mp->cur_cmd,mp->cur_mod); mp_print_char(mp, '\'');
- help5("I was looking for the beginning of a new statement.")
- ("If you just proceed without changing anything, I'll ignore")
- ("everything up to the next `;'. Please insert a semicolon")
- ("now in front of anything that you don't want me to delete.")
- ("(See Chapter 27 of The METAFONTbook for an example.)");
+ mp_print_cmd_mod(mp, mp->cur_cmd,mp->cur_mod); mp_print_char(mp, xord('\''));
+ help5("I was looking for the beginning of a new statement.",
+ "If you just proceed without changing anything, I'll ignore",
+ "everything up to the next `;'. Please insert a semicolon",
+ "now in front of anything that you don't want me to delete.",
+ "(See Chapter 27 of The METAFONTbook for an example.)");
@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>
mp_back_error(mp); mp_get_x_next(mp);
}
@@ -21317,12 +21554,12 @@ also terminate a statement.
{
print_err("Extra tokens will be flushed");
@.Extra tokens will be flushed@>
- help6("I've just read as much of that statement as I could fathom,")
- ("so a semicolon should have been next. It's very puzzling...")
- ("but I'll try to get myself back together, by ignoring")
- ("everything up to the next `;'. Please insert a semicolon")
- ("now in front of anything that you don't want me to delete.")
- ("(See Chapter 27 of The METAFONTbook for an example.)");
+ help6("I've just read as much of that statement as I could fathom,",
+ "so a semicolon should have been next. It's very puzzling...",
+ "but I'll try to get myself back together, by ignoring",
+ "everything up to the next `;'. Please insert a semicolon",
+ "now in front of anything that you don't want me to delete.",
+ "(See Chapter 27 of The METAFONTbook for an example.)");
@:METAFONTbook}{\sl The {\logos METAFONT\/}book@>
mp_back_error(mp); mp->scanner_status=flushing;
do {
@@ -21364,9 +21601,9 @@ expression.
else if ( mp->cur_type!=mp_vacuous ){
exp_err("Isolated expression");
@.Isolated expression@>
- help3("I couldn't find an `=' or `:=' after the")
- ("expression that is shown above this error message,")
- ("so I guess I'll just ignore it and carry on.");
+ help3("I couldn't find an `=' or `:=' after the",
+ "expression that is shown above this error message,",
+ "so I guess I'll just ignore it and carry on.");
mp_put_get_error(mp);
}
mp_flush_cur_exp(mp, 0); mp->cur_type=mp_vacuous;
@@ -21389,10 +21626,9 @@ to be scanned. After the routines are finished, |cur_type| and |cur_exp|
will be equal to the right-hand side (which will normally be equal
to the left-hand side).
-@<Declare action procedures for use by |do_statement|@>=
-@<Declare the procedure called |try_eq|@>
+@<Declarations@>=
@<Declare the procedure called |make_eq|@>
-void mp_do_equation (MP mp) ;
+static void mp_do_equation (MP mp) ;
@ @c
void mp_do_equation (MP mp) {
@@ -21404,7 +21640,7 @@ void mp_do_equation (MP mp) {
else if ( mp->cur_cmd==assignment ) mp_do_assignment(mp);
if ( mp->internal[mp_tracing_commands]>two )
@<Trace the current equation@>;
- if ( mp->cur_type==mp_unknown_path ) if ( type(lhs)==mp_pair_type ) {
+ if ( mp->cur_type==mp_unknown_path ) if ( mp_type(lhs)==mp_pair_type ) {
p=mp_stash_cur_exp(mp); mp_unstash_cur_exp(mp, lhs); lhs=p;
}; /* in this case |make_eq| will change the pair to a path */
mp_make_eq(mp, lhs); /* equate |lhs| to |(cur_type,cur_exp)| */
@@ -21413,10 +21649,7 @@ void mp_do_equation (MP mp) {
@ And |do_assignment| is similar to |do_equation|:
@<Declarations@>=
-void mp_do_assignment (MP mp);
-
-@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_assignment (MP mp) ;
+static void mp_do_assignment (MP mp);
@ @c
void mp_do_assignment (MP mp) {
@@ -21426,8 +21659,8 @@ void mp_do_assignment (MP mp) {
if ( mp->cur_type!=mp_token_list ) {
exp_err("Improper `:=' will be changed to `='");
@.Improper `:='@>
- help2("I didn't find a variable name at the left of the `:=',")
- ("so I'm going to pretend that you said `=' instead.");
+ help2("I didn't find a variable name at the left of the `:=',",
+ "so I'm going to pretend that you said `=' instead.");
mp_error(mp); mp_do_equation(mp);
} else {
lhs=mp->cur_exp; mp->cur_type=mp_vacuous;
@@ -21436,7 +21669,7 @@ void mp_do_assignment (MP mp) {
else if ( mp->cur_cmd==assignment ) mp_do_assignment(mp);
if ( mp->internal[mp_tracing_commands]>two )
@<Trace the current assignment@>;
- if ( info(lhs)>hash_end ) {
+ if ( mp_info(lhs)>hash_end ) {
@<Assign the current expression to an internal variable@>;
} else {
@<Assign the current expression to the variable |lhs|@>;
@@ -21455,24 +21688,24 @@ void mp_do_assignment (MP mp) {
@ @<Trace the current assignment@>=
{
mp_begin_diagnostic(mp); mp_print_nl(mp, "{");
- if ( info(lhs)>hash_end )
- mp_print(mp, mp->int_name[info(lhs)-(hash_end)]);
+ if ( mp_info(lhs)>hash_end )
+ mp_print(mp, mp->int_name[mp_info(lhs)-(hash_end)]);
else
mp_show_token_list(mp, lhs,null,1000,0);
mp_print(mp, ":="); mp_print_exp(mp, null,0);
- mp_print_char(mp, '}'); mp_end_diagnostic(mp, false);
+ mp_print_char(mp, xord('}')); mp_end_diagnostic(mp, false);
}
@ @<Assign the current expression to an internal variable@>=
if ( mp->cur_type==mp_known ) {
- mp->internal[info(lhs)-(hash_end)]=mp->cur_exp;
+ mp->internal[mp_info(lhs)-(hash_end)]=mp->cur_exp;
} else {
exp_err("Internal quantity `");
@.Internal quantity...@>
- mp_print(mp, mp->int_name[info(lhs)-(hash_end)]);
+ mp_print(mp, mp->int_name[mp_info(lhs)-(hash_end)]);
mp_print(mp, "' must receive a known value");
- help2("I can\'t set an internal quantity to anything but a known")
- ("numeric value, so I'll have to ignore this assignment.");
+ help2("I can\'t set an internal quantity to anything but a known",
+ "numeric value, so I'll have to ignore this assignment.");
mp_put_get_error(mp);
}
@@ -21482,7 +21715,7 @@ if ( mp->cur_type==mp_known ) {
if ( p!=null ) {
q=mp_stash_cur_exp(mp); mp->cur_type=mp_und_type(mp, p);
mp_recycle_value(mp, p);
- type(p)=mp->cur_type; value(p)=null; mp_make_exp_copy(mp, p);
+ mp_type(p)=mp->cur_type; value(p)=null; mp_make_exp_copy(mp, p);
p=mp_stash_cur_exp(mp); mp_unstash_cur_exp(mp, q); mp_make_eq(mp, p);
} else {
mp_obliterated(mp, lhs); mp_put_get_error(mp);
@@ -21494,16 +21727,16 @@ if ( mp->cur_type==mp_known ) {
a pointer to a capsule that is to be equated to the current expression.
@<Declare the procedure called |make_eq|@>=
-void mp_make_eq (MP mp,pointer lhs) ;
+static void mp_make_eq (MP mp,pointer lhs) ;
@
@c void mp_make_eq (MP mp,pointer lhs) {
- small_number t; /* type of the left-hand side */
+ quarterword t; /* type of the left-hand side */
pointer p,q; /* pointers inside of big nodes */
integer v=0; /* value of the left-hand side */
RESTART:
- t=type(lhs);
+ t=mp_type(lhs);
if ( t<=mp_pair_type ) v=value(lhs);
switch (t) {
@<For each type |t|, make an equation and |goto done| unless |cur_type|
@@ -21519,14 +21752,14 @@ DONE:
mp_disp_err(mp, lhs,"");
exp_err("Equation cannot be performed (");
@.Equation cannot be performed@>
-if ( type(lhs)<=mp_pair_type ) mp_print_type(mp, type(lhs));
+if ( mp_type(lhs)<=mp_pair_type ) mp_print_type(mp, mp_type(lhs));
else mp_print(mp, "numeric");
-mp_print_char(mp, '=');
+mp_print_char(mp, xord('='));
if ( mp->cur_type<=mp_pair_type ) mp_print_type(mp, mp->cur_type);
else mp_print(mp, "numeric");
-mp_print_char(mp, ')');
-help2("I'm sorry, but I don't know how to make such things equal.")
- ("(See the two expressions just above the error message.)");
+mp_print_char(mp, xord(')'));
+help2("I'm sorry, but I don't know how to make such things equal.",
+ "(See the two expressions just above the error message.)");
mp_put_get_error(mp)
@ @<For each type |t|, make an equation and |goto done| unless...@>=
@@ -21579,14 +21812,14 @@ case mp_vacuous:
}
print_err("Redundant or inconsistent equation");
@.Redundant or inconsistent equation@>
- help2("An equation between already-known quantities can't help.")
- ("But don't worry; continue and I'll just ignore it.");
+ help2("An equation between already-known quantities can't help.",
+ "But don't worry; continue and I'll just ignore it.");
mp_put_get_error(mp); goto DONE;
NOT_FOUND:
print_err("Inconsistent equation");
@.Inconsistent equation@>
- help2("The equation I just read contradicts what was said before.")
- ("But don't worry; continue and I'll just ignore it.");
+ help2("The equation I just read contradicts what was said before.",
+ "But don't worry; continue and I'll just ignore it.");
mp_put_get_error(mp); goto DONE;
}
@@ -21607,8 +21840,8 @@ either a location within a pair or transform node pointed to by
serves as the second argument). The idea is to leave |cur_exp| unchanged,
but to equate the two operands.
-@<Declare the procedure called |try_eq|@>=
-void mp_try_eq (MP mp,pointer l, pointer r) ;
+@<Declarations@>=
+static void mp_try_eq (MP mp,pointer l, pointer r) ;
@
@c void mp_try_eq (MP mp,pointer l, pointer r) {
@@ -21621,12 +21854,12 @@ void mp_try_eq (MP mp,pointer l, pointer r) ;
@<Remove the left operand from its container, negate it, and
put it into dependency list~|p| with constant term~|q|@>;
@<Add the right operand to list |p|@>;
- if ( info(p)==null ) {
+ if ( mp_info(p)==null ) {
@<Deal with redundant or inconsistent equation@>;
} else {
mp_linear_eq(mp, p,t);
if ( r==null ) if ( mp->cur_type!=mp_known ) {
- if ( type(mp->cur_exp)==mp_known ) {
+ if ( mp_type(mp->cur_exp)==mp_known ) {
pp=mp->cur_exp; mp->cur_exp=value(mp->cur_exp); mp->cur_type=mp_known;
mp_free_node(mp, pp,value_node_size);
}
@@ -21635,7 +21868,7 @@ void mp_try_eq (MP mp,pointer l, pointer r) ;
}
@ @<Remove the left operand from its container, negate it, and...@>=
-t=type(l);
+t=mp_type(l);
if ( t==mp_known ) {
t=mp_dependent; p=mp_const_dependency(mp, -value(l)); q=p;
} else if ( t==mp_independent ) {
@@ -21645,11 +21878,11 @@ if ( t==mp_known ) {
p=dep_list(l); q=p;
while (1) {
negate(value(q));
- if ( info(q)==null ) break;
- q=link(q);
+ if ( mp_info(q)==null ) break;
+ q=mp_link(q);
}
- link(prev_dep(l))=link(q); prev_dep(link(q))=prev_dep(l);
- type(l)=mp_known;
+ mp_link(prev_dep(l))=mp_link(q); prev_dep(mp_link(q))=prev_dep(l);
+ mp_type(l)=mp_known;
}
@ @<Deal with redundant or inconsistent equation@>=
@@ -21658,9 +21891,9 @@ if ( t==mp_known ) {
print_err("Inconsistent equation");
@.Inconsistent equation@>
mp_print(mp, " (off by "); mp_print_scaled(mp, value(p));
- mp_print_char(mp, ')');
- help2("The equation I just read contradicts what was said before.")
- ("But don't worry; continue and I'll just ignore it.");
+ mp_print_char(mp, xord(')'));
+ help2("The equation I just read contradicts what was said before.",
+ "But don't worry; continue and I'll just ignore it.");
mp_put_get_error(mp);
} else if ( r==null ) {
@<Exclaim about a redundant equation@>;
@@ -21678,10 +21911,10 @@ if ( r==null ) {
else pp=dep_list(mp->cur_exp);
}
} else {
- if ( type(r)==mp_known ) {
+ if ( mp_type(r)==mp_known ) {
value(q)=value(q)+value(r); goto DONE1;
} else {
- tt=type(r);
+ tt=mp_type(r);
if ( tt==mp_independent ) pp=mp_single_dependency(mp, r);
else pp=dep_list(r);
}
@@ -21700,8 +21933,8 @@ if ( t==tt ) {
p=mp_p_plus_fq(mp, p,unity,pp,mp_proto_dependent,mp_dependent);
} else {
q=p;
- while ( info(q)!=null ) {
- value(q)=mp_round_fraction(mp, value(q)); q=link(q);
+ while ( mp_info(q)!=null ) {
+ value(q)=mp_round_fraction(mp, value(q)); q=mp_link(q);
}
t=mp_proto_dependent; p=mp_p_plus_q(mp, p,pp,t);
}
@@ -21714,14 +21947,17 @@ following procedure has acted, the token after the declared variable
will have been scanned, so it will appear in |cur_cmd|, |cur_mod|,
and~|cur_sym|.
-@<Declare the function called |scan_declared_variable|@>=
+@<Declarations@>=
+static pointer mp_scan_declared_variable (MP mp) ;
+
+@ @c
pointer mp_scan_declared_variable (MP mp) {
pointer x; /* hash address of the variable's root */
pointer h,t; /* head and tail of the token list to be returned */
pointer l; /* hash address of left bracket */
mp_get_symbol(mp); x=mp->cur_sym;
if ( mp->cur_cmd!=tag_token ) mp_clear_symbol(mp, x,false);
- h=mp_get_avail(mp); info(h)=x; t=h;
+ h=mp_get_avail(mp); mp_info(h)=x; t=h;
while (1) {
mp_get_x_next(mp);
if ( mp->cur_sym==0 ) break;
@@ -21732,7 +21968,7 @@ pointer mp_scan_declared_variable (MP mp) {
break;
}
}
- link(t)=mp_get_avail(mp); t=link(t); info(t)=mp->cur_sym;
+ mp_link(t)=mp_get_avail(mp); t=mp_link(t); mp_info(t)=mp->cur_sym;
}
if ( (eq_type(x)%outer_tag)!=tag_token ) mp_clear_symbol(mp, x,false);
if ( equiv(x)==null ) mp_new_root(mp, x);
@@ -21785,11 +22021,11 @@ case type_name: mp_print_type(mp, m); break;
|type_name| has just been scanned.
@<Declare action procedures for use by |do_statement|@>=
-void mp_do_type_declaration (MP mp) ;
+static void mp_do_type_declaration (MP mp) ;
@ @c
void mp_do_type_declaration (MP mp) {
- small_number t; /* the type being declared */
+ quarterword t; /* the type being declared */
pointer p; /* token list for a declared variable */
pointer q; /* value node for the variable */
if ( mp->cur_mod>=mp_transform_type )
@@ -21798,15 +22034,15 @@ void mp_do_type_declaration (MP mp) {
t=mp->cur_mod+unknown_tag;
do {
p=mp_scan_declared_variable(mp);
- mp_flush_variable(mp, equiv(info(p)),link(p),false);
+ mp_flush_variable(mp, equiv(mp_info(p)),mp_link(p),false);
q=mp_find_variable(mp, p);
if ( q!=null ) {
- type(q)=t; value(q)=null;
+ mp_type(q)=t; value(q)=null;
} else {
print_err("Declared variable conflicts with previous vardef");
@.Declared variable conflicts...@>
- help2("You can't use, e.g., `numeric foo[]' after `vardef foo'.")
- ("Proceed, and I'll ignore the illegal redeclaration.");
+ help2("You can't use, e.g., `numeric foo[]' after `vardef foo'.",
+ "Proceed, and I'll ignore the illegal redeclaration.");
mp_put_get_error(mp);
}
mp_flush_list(mp, p);
@@ -21820,11 +22056,11 @@ void mp_do_type_declaration (MP mp) {
{
print_err("Illegal suffix of declared variable will be flushed");
@.Illegal suffix...flushed@>
- help5("Variables in declarations must consist entirely of")
- ("names and collective subscripts, e.g., `x[]a'.")
- ("Are you trying to use a reserved word in a variable name?")
- ("I'm going to discard the junk I found here,")
- ("up to the next comma or the end of the declaration.");
+ help5("Variables in declarations must consist entirely of",
+ "names and collective subscripts, e.g., `x[]a'.",
+ "Are you trying to use a reserved word in a variable name?",
+ "I'm going to discard the junk I found here,",
+ "up to the next comma or the end of the declaration.");
if ( mp->cur_cmd==numeric_token )
mp->help_line[2]="Explicit subscripts like `x15a' aren't permitted.";
mp_put_get_error(mp); mp->scanner_status=flushing;
@@ -21840,75 +22076,505 @@ until coming to the end of the user's program.
Each execution of |do_statement| concludes with
|cur_cmd=semicolon|, |end_group|, or |stop|.
-@c void mp_main_control (MP mp) {
+@c
+static void mp_main_control (MP mp) {
do {
mp_do_statement(mp);
if ( mp->cur_cmd==end_group ) {
print_err("Extra `endgroup'");
@.Extra `endgroup'@>
- help2("I'm not currently working on a `begingroup',")
- ("so I had better not try to end anything.");
+ help2("I'm not currently working on a `begingroup',",
+ "so I had better not try to end anything.");
mp_flush_error(mp, 0);
}
} while (mp->cur_cmd!=stop);
}
-int __attribute__((noinline))
-mp_run (MP mp) {
+int mp_run (MP mp) {
if (mp->history < mp_fatal_error_stop ) {
- @<Install and test the non-local jump buffer@>;
+ xfree(mp->jump_buf);
+ mp->jump_buf = malloc(sizeof(jmp_buf));
+ if (mp->jump_buf == NULL || setjmp(*(mp->jump_buf)) != 0)
+ return mp->history;
mp_main_control(mp); /* come to life */
mp_final_cleanup(mp); /* prepare for death */
mp_close_files_and_terminate(mp);
}
return mp->history;
}
-int __attribute__((noinline))
-mp_execute (MP mp) {
- if (mp->history < mp_fatal_error_stop ) {
- mp->history = mp_spotless;
- mp->file_offset = 0;
- mp->term_offset = 0;
- mp->tally = 0;
- @<Install and test the non-local jump buffer@>;
- if (mp->run_state==0) {
- mp->run_state = 1;
+
+@ For |mp_execute|, we need to define a structure to store the
+redirected input and output. This structure holds the five relevant
+streams: the three informational output streams, the PostScript
+generation stream, and the input stream. These streams have many
+things in common, so it makes sense to give them their own structure
+definition.
+
+\item{fptr} is a virtual file pointer
+\item{data} is the data this stream holds
+\item{cur} is a cursor pointing into |data|
+\item{size} is the allocated length of the data stream
+\item{used} is the actual length of the data stream
+
+There are small differences between input and output: |term_in| never
+uses |used|, whereas the other four never use |cur|.
+
+@<Exported types@>=
+typedef struct {
+ void * fptr;
+ char * data;
+ char * cur;
+ size_t size;
+ size_t used;
+} mp_stream;
+
+typedef struct {
+ mp_stream term_out;
+ mp_stream error_out;
+ mp_stream log_out;
+ mp_stream ps_out;
+ mp_stream term_in;
+ struct mp_edge_object *edges;
+} mp_run_data;
+
+@ We need a function to clear an output stream, this is called at the
+beginning of |mp_execute|. We also need one for destroying an output
+stream, this is called just before a stream is (re)opened.
+
+@c
+static void mp_reset_stream(mp_stream *str) {
+ xfree(str->data);
+ str->cur = NULL;
+ str->size = 0;
+ str->used = 0;
+}
+static void mp_free_stream(mp_stream *str) {
+ xfree(str->fptr);
+ mp_reset_stream(str);
+}
+
+@ @<Declarations@>=
+static void mp_reset_stream(mp_stream *str);
+static void mp_free_stream(mp_stream *str);
+
+@ The global instance contains a pointer instead of the actual structure
+even though it is essentially static, because that makes it is easier to move
+the object around.
+
+@<Global ...@>=
+mp_run_data run_data;
+
+@ Another type is needed: the indirection will overload some of the
+file pointer objects in the instance (but not all). For clarity, an
+indirect object is used that wraps a |FILE *|.
+
+@<Types ... @>=
+typedef struct File {
+ FILE *f;
+} File;
+
+@ Here are all of the functions that need to be overloaded for |mp_execute|.
+
+@<Declarations@>=
+static void *mplib_open_file(MP mp, const char *fname, const char *fmode, int ftype);
+static int mplib_get_char(void *f, mp_run_data * mplib_data);
+static void mplib_unget_char(void *f, mp_run_data * mplib_data, int c);
+static char *mplib_read_ascii_file(MP mp, void *ff, size_t * size);
+static void mplib_write_ascii_file(MP mp, void *ff, const char *s);
+static void mplib_read_binary_file(MP mp, void *ff, void **data, size_t * size);
+static void mplib_write_binary_file(MP mp, void *ff, void *s, size_t size);
+static void mplib_close_file(MP mp, void *ff);
+static int mplib_eof_file(MP mp, void *ff);
+static void mplib_flush_file(MP mp, void *ff);
+static void mplib_shipout_backend(MP mp, int h);
+
+@ The |xmalloc(1,1)| calls make sure the stored indirection values are unique.
+
+@d reset_stream(a) do {
+ mp_reset_stream(&(a));
+ if (!ff->f) {
+ ff->f = xmalloc(1,1);
+ (a).fptr = ff->f;
+ } } while (0)
+
+@c
+
+static void *mplib_open_file(MP mp, const char *fname, const char *fmode, int ftype)
+{
+ File *ff = xmalloc(1, sizeof(File));
+ mp_run_data *run = mp_rundata(mp);
+ ff->f = NULL;
+ if (ftype == mp_filetype_terminal) {
+ if (fmode[0] == 'r') {
+ if (!ff->f) {
+ ff->f = xmalloc(1,1);
+ run->term_in.fptr = ff->f;
+ }
+ } else {
+ reset_stream(run->term_out);
+ }
+ } else if (ftype == mp_filetype_error) {
+ reset_stream(run->error_out);
+ } else if (ftype == mp_filetype_log) {
+ reset_stream(run->log_out);
+ } else if (ftype == mp_filetype_postscript) {
+ mp_free_stream(&(run->ps_out));
+ ff->f = xmalloc(1,1);
+ run->ps_out.fptr = ff->f;
} else {
- mp_input_ln(mp,mp->term_in);
- mp_firm_up_the_line(mp);
- mp->buffer[limit]='%';
- mp->first=limit+1;
- loc=start;
+ char realmode[3];
+ char *f = (mp->find_file)(mp, fname, fmode, ftype);
+ if (f == NULL)
+ return NULL;
+ realmode[0] = *fmode;
+ realmode[1] = 'b';
+ realmode[2] = 0;
+ ff->f = fopen(f, realmode);
+ free(f);
+ if ((fmode[0] == 'r') && (ff->f == NULL)) {
+ free(ff);
+ return NULL;
+ }
+ }
+ return ff;
+}
+
+static int mplib_get_char(void *f, mp_run_data * run)
+{
+ int c;
+ if (f == run->term_in.fptr && run->term_in.data != NULL) {
+ if (run->term_in.size == 0) {
+ if (run->term_in.cur != NULL) {
+ run->term_in.cur = NULL;
+ } else {
+ xfree(run->term_in.data);
+ }
+ c = EOF;
+ } else {
+ run->term_in.size--;
+ c = *(run->term_in.cur)++;
+ }
+ } else {
+ c = fgetc(f);
+ }
+ return c;
+}
+
+static void mplib_unget_char(void *f, mp_run_data * run, int c)
+{
+ if (f == run->term_in.fptr && run->term_in.cur != NULL) {
+ run->term_in.size++;
+ run->term_in.cur--;
+ } else {
+ ungetc(c, f);
+ }
+}
+
+
+static char *mplib_read_ascii_file(MP mp, void *ff, size_t * size)
+{
+ char *s = NULL;
+ if (ff != NULL) {
+ int c;
+ size_t len = 0, lim = 128;
+ mp_run_data *run = mp_rundata(mp);
+ FILE *f = ((File *) ff)->f;
+ if (f == NULL)
+ return NULL;
+ *size = 0;
+ c = mplib_get_char(f, run);
+ if (c == EOF)
+ return NULL;
+ s = malloc(lim);
+ if (s == NULL)
+ return NULL;
+ while (c != EOF && c != '\n' && c != '\r') {
+ if (len == lim) {
+ s = xrealloc(s, (lim + (lim >> 2)),1);
+ if (s == NULL)
+ return NULL;
+ lim += (lim >> 2);
+ }
+ s[len++] = c;
+ c = mplib_get_char(f, run);
+ }
+ if (c == '\r') {
+ c = mplib_get_char(f, run);
+ if (c != EOF && c != '\n')
+ mplib_unget_char(f, run, c);
+ }
+ s[len] = 0;
+ *size = len;
+ }
+ return s;
+}
+
+static void mp_append_string (MP mp, mp_stream *a,const char *b) {
+ size_t l = strlen(b);
+ if ((a->used+l)>=a->size) {
+ a->size += 256+(a->size)/5+l;
+ a->data = xrealloc(a->data,a->size,1);
+ }
+ (void)strcpy(a->data+a->used,b);
+ a->used += l;
+}
+
+
+static void mplib_write_ascii_file(MP mp, void *ff, const char *s)
+{
+ if (ff != NULL) {
+ void *f = ((File *) ff)->f;
+ mp_run_data *run = mp_rundata(mp);
+ if (f != NULL) {
+ if (f == run->term_out.fptr) {
+ mp_append_string(mp,&(run->term_out), s);
+ } else if (f == run->error_out.fptr) {
+ mp_append_string(mp,&(run->error_out), s);
+ } else if (f == run->log_out.fptr) {
+ mp_append_string(mp,&(run->log_out), s);
+ } else if (f == run->ps_out.fptr) {
+ mp_append_string(mp,&(run->ps_out), s);
+ } else {
+ fprintf((FILE *) f, "%s", s);
+ }
+ }
+ }
+}
+
+static void mplib_read_binary_file(MP mp, void *ff, void **data, size_t * size)
+{
+ (void) mp;
+ if (ff != NULL) {
+ size_t len = 0;
+ FILE *f = ((File *) ff)->f;
+ if (f != NULL)
+ len = fread(*data, 1, *size, f);
+ *size = len;
+ }
+}
+
+static void mplib_write_binary_file(MP mp, void *ff, void *s, size_t size)
+{
+ (void) mp;
+ if (ff != NULL) {
+ FILE *f = ((File *) ff)->f;
+ if (f != NULL)
+ (void)fwrite(s, size, 1, f);
+ }
+}
+
+static void mplib_close_file(MP mp, void *ff)
+{
+ if (ff != NULL) {
+ mp_run_data *run = mp_rundata(mp);
+ void *f = ((File *) ff)->f;
+ if (f != NULL) {
+ if (f != run->term_out.fptr
+ && f != run->error_out.fptr
+ && f != run->log_out.fptr
+ && f != run->ps_out.fptr
+ && f != run->term_in.fptr) {
+ fclose(f);
+ }
+ }
+ free(ff);
+ }
+}
+
+static int mplib_eof_file(MP mp, void *ff)
+{
+ if (ff != NULL) {
+ mp_run_data *run = mp_rundata(mp);
+ FILE *f = ((File *) ff)->f;
+ if (f == NULL)
+ return 1;
+ if (f == run->term_in.fptr && run->term_in.data != NULL) {
+ return (run->term_in.size == 0);
+ }
+ return feof(f);
+ }
+ return 1;
+}
+
+static void mplib_flush_file(MP mp, void *ff)
+{
+ (void) mp;
+ (void) ff;
+ return;
+}
+
+static void mplib_shipout_backend(MP mp, int h)
+{
+ mp_edge_object *hh = mp_gr_export(mp, h);
+ if (hh) {
+ mp_run_data *run = mp_rundata(mp);
+ if (run->edges==NULL) {
+ run->edges = hh;
+ } else {
+ mp_edge_object *p = run->edges;
+ while (p->next!=NULL) { p = p->next; }
+ p->next = hh;
+ }
+ }
+}
+
+
+@ This is where we fill them all in.
+@<Prepare function pointers for non-interactive use@>=
+{
+ mp->open_file = mplib_open_file;
+ mp->close_file = mplib_close_file;
+ mp->eof_file = mplib_eof_file;
+ mp->flush_file = mplib_flush_file;
+ mp->write_ascii_file = mplib_write_ascii_file;
+ mp->read_ascii_file = mplib_read_ascii_file;
+ mp->write_binary_file = mplib_write_binary_file;
+ mp->read_binary_file = mplib_read_binary_file;
+ mp->shipout_backend = mplib_shipout_backend;
+}
+
+@ Perhaps this is the most important API function in the library.
+
+@<Exported function ...@>=
+extern mp_run_data *mp_rundata (MP mp) ;
+
+@ @c
+mp_run_data *mp_rundata (MP mp) {
+ return &(mp->run_data);
+}
+
+@ @<Dealloc ...@>=
+mp_free_stream(&(mp->run_data.term_in));
+mp_free_stream(&(mp->run_data.term_out));
+mp_free_stream(&(mp->run_data.log_out));
+mp_free_stream(&(mp->run_data.error_out));
+mp_free_stream(&(mp->run_data.ps_out));
+
+@ @<Finish non-interactive use@>=
+xfree(mp->term_out);
+xfree(mp->term_in);
+xfree(mp->err_out);
+
+@ @<Start non-interactive work@>=
+@<Initialize the output routines@>;
+mp->input_ptr=0; mp->max_in_stack=0;
+mp->in_open=0; mp->open_parens=0; mp->max_buf_stack=0;
+mp->param_ptr=0; mp->max_param_stack=0;
+start = loc = iindex = 0; mp->first = 0;
+line=0; name=is_term;
+mp->mpx_name[0]=absent;
+mp->force_eof=false;
+t_open_in;
+mp->scanner_status=normal;
+if (mp->mem_ident==NULL) {
+ if ( ! mp_load_mem_file(mp) ) {
+ (mp->close_file)(mp, mp->mem_file);
+ mp->history = mp_fatal_error_stop;
+ return mp->history;
+ }
+ (mp->close_file)(mp, mp->mem_file);
+}
+mp_fix_date_and_time(mp);
+if (mp->random_seed==0)
+ mp->random_seed = (mp->internal[mp_time] / unity)+mp->internal[mp_day];
+mp_init_randoms(mp, mp->random_seed);
+@<Initialize the print |selector|...@>;
+mp_open_log_file(mp);
+mp_set_job_id(mp);
+mp_init_map_file(mp, mp->troff_mode);
+mp->history=mp_spotless; /* ready to go! */
+if (mp->troff_mode) {
+ mp->internal[mp_gtroffmode]=unity;
+ mp->internal[mp_prologues]=unity;
+}
+if ( mp->start_sym>0 ) { /* insert the `\&{everyjob}' symbol */
+ mp->cur_sym=mp->start_sym; mp_back_input(mp);
+}
+
+@ @c
+int mp_execute (MP mp, char *s, size_t l) {
+ mp_reset_stream(&(mp->run_data.term_out));
+ mp_reset_stream(&(mp->run_data.log_out));
+ mp_reset_stream(&(mp->run_data.error_out));
+ mp_reset_stream(&(mp->run_data.ps_out));
+ if (mp->finished) {
+ return mp->history;
+ } else if (!mp->noninteractive) {
+ mp->history = mp_fatal_error_stop ;
+ return mp->history;
+ }
+ if (mp->history < mp_fatal_error_stop ) {
+ xfree(mp->jump_buf);
+ mp->jump_buf = malloc(sizeof(jmp_buf));
+ if (mp->jump_buf == NULL || setjmp(*(mp->jump_buf)) != 0) {
+ return mp->history;
+ }
+ if (s==NULL) { /* this signals EOF */
+ mp_final_cleanup(mp); /* prepare for death */
+ mp_close_files_and_terminate(mp);
+ return mp->history;
+ }
+ mp->tally=0;
+ mp->term_offset=0; mp->file_offset=0;
+ /* Perhaps some sort of warning here when |data| is not
+ * yet exhausted would be nice ... this happens after errors
+ */
+ if (mp->run_data.term_in.data)
+ xfree(mp->run_data.term_in.data);
+ mp->run_data.term_in.data = xstrdup(s);
+ mp->run_data.term_in.cur = mp->run_data.term_in.data;
+ mp->run_data.term_in.size = l;
+ if (mp->run_state == 0) {
+ mp->selector=term_only;
+ @<Start non-interactive work@>;
}
+ mp->run_state =1;
+ (void)mp_input_ln(mp,mp->term_in);
+ mp_firm_up_the_line(mp);
+ mp->buffer[limit]=xord('%');
+ mp->first=(size_t)(limit+1);
+ loc=start;
do {
mp_do_statement(mp);
} while (mp->cur_cmd!=stop);
+ mp_final_cleanup(mp);
+ mp_close_files_and_terminate(mp);
}
return mp->history;
}
-int __attribute__((noinline))
-mp_finish (MP mp) {
- if (mp->history < mp_fatal_error_stop ) {
- @<Install and test the non-local jump buffer@>;
+
+@ This function cleans up
+@c
+int mp_finish (MP mp) {
+ int history = 0;
+ if (mp->finished || mp->history >= mp_fatal_error_stop) {
+ history = mp->history;
+ mp_free(mp);
+ return history;
+ }
+ xfree(mp->jump_buf);
+ mp->jump_buf = malloc(sizeof(jmp_buf));
+ if (mp->jump_buf == NULL || setjmp(*(mp->jump_buf)) != 0) {
+ history = mp->history;
+ } else {
+ history = mp->history;
mp_final_cleanup(mp); /* prepare for death */
- mp_close_files_and_terminate(mp);
}
- return mp->history;
+ mp_close_files_and_terminate(mp);
+ mp_free(mp);
+ return history;
}
-const char * mp_mplib_version (MP mp) {
- (void)mp;
- return mplib_version;
-}
-const char * mp_metapost_version (MP mp) {
- (void)mp;
- return metapost_version;
+
+@ People may want to know the library version
+@c
+char * mp_metapost_version (void) {
+ return mp_strdup(metapost_version);
}
@ @<Exported function headers@>=
int mp_run (MP mp);
-int mp_execute (MP mp);
+int mp_execute (MP mp, char *s, size_t l);
int mp_finish (MP mp);
-const char * mp_mplib_version (MP mp);
-const char * mp_metapost_version (MP mp);
+char * mp_metapost_version (void);
@ @<Put each...@>=
mp_primitive(mp, "end",stop,0);
@@ -21934,7 +22600,7 @@ Here's one of the simplest:
case mp_random_seed: mp_do_random_seed(mp); break;
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_random_seed (MP mp) ;
+static void mp_do_random_seed (MP mp) ;
@ @c void mp_do_random_seed (MP mp) {
mp_get_x_next(mp);
@@ -21948,8 +22614,8 @@ void mp_do_random_seed (MP mp) ;
if ( mp->cur_type!=mp_known ) {
exp_err("Unknown value will be ignored");
@.Unknown value...ignored@>
- help2("Your expression was too random for me to handle,")
- ("so I won't change the random seed just now.");
+ help2("Your expression was too random for me to handle,",
+ "so I won't change the random seed just now.");
mp_put_get_flush_error(mp, 0);
} else {
@<Initialize the random seed to |cur_exp|@>;
@@ -21963,7 +22629,7 @@ void mp_do_random_seed (MP mp) ;
mp->old_setting=mp->selector; mp->selector=log_only;
mp_print_nl(mp, "{randomseed:=");
mp_print_scaled(mp, mp->cur_exp);
- mp_print_char(mp, '}');
+ mp_print_char(mp, xord('}'));
mp_print_nl(mp, ""); mp->selector=mp->old_setting;
}
}
@@ -22016,7 +22682,7 @@ case protection_command:
break;
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_protection (MP mp) ;
+static void mp_do_protection (MP mp) ;
@ @c void mp_do_protection (MP mp) {
int m; /* 0 to unprotect, 1 to protect */
@@ -22044,7 +22710,7 @@ hash address of its mate.
case delimiters: mp_def_delims(mp); break;
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_def_delims (MP mp) ;
+static void mp_def_delims (MP mp) ;
@ @c void mp_def_delims (MP mp) {
pointer l_delim,r_delim; /* the new delimiter pair */
@@ -22058,7 +22724,10 @@ void mp_def_delims (MP mp) ;
@ Here is a procedure that is called when \MP\ has reached a point
where some right delimiter is mandatory.
-@<Declare the procedure called |check_delimiter|@>=
+@<Declarations@>=
+static void mp_check_delimiter (MP mp,pointer l_delim, pointer r_delim);
+
+@ @c
void mp_check_delimiter (MP mp,pointer l_delim, pointer r_delim) {
if ( mp->cur_cmd==right_delimiter )
if ( mp->cur_mod==l_delim )
@@ -22066,16 +22735,16 @@ void mp_check_delimiter (MP mp,pointer l_delim, pointer r_delim) {
if ( mp->cur_sym!=r_delim ) {
mp_missing_err(mp, str(text(r_delim)));
@.Missing `)'@>
- help2("I found no right delimiter to match a left one. So I've")
- ("put one in, behind the scenes; this may fix the problem.");
+ help2("I found no right delimiter to match a left one. So I've",
+ "put one in, behind the scenes; this may fix the problem.");
mp_back_error(mp);
} else {
print_err("The token `"); mp_print_text(r_delim);
@.The token...delimiter@>
mp_print(mp, "' is no longer a right delimiter");
- help3("Strange: This token has lost its former meaning!")
- ("I'll read it as a right delimiter this time;")
- ("but watch out, I'll probably miss it later.");
+ help3("Strange: This token has lost its former meaning!",
+ "I'll read it as a right delimiter this time;",
+ "but watch out, I'll probably miss it later.");
mp_error(mp);
}
}
@@ -22093,8 +22762,8 @@ case let_command: mp_do_let(mp); break;
case new_internal: mp_do_new_internal(mp); break;
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_statement (MP mp);
-void mp_do_interim (MP mp);
+static void mp_do_statement (MP mp);
+static void mp_do_interim (MP mp);
@ @c void mp_do_interim (MP mp) {
mp_get_x_next(mp);
@@ -22116,7 +22785,7 @@ void mp_do_interim (MP mp);
too soon, lest commands like `{\tt let x=x}' have a surprising effect.
@<Declare action procedures for use by |do_statement|@>=
-void mp_do_let (MP mp) ;
+static void mp_do_let (MP mp) ;
@ @c void mp_do_let (MP mp) {
pointer l; /* hash location of the left-hand symbol */
@@ -22124,9 +22793,9 @@ void mp_do_let (MP mp) ;
if ( mp->cur_cmd!=equals ) if ( mp->cur_cmd!=assignment ) {
mp_missing_err(mp, "=");
@.Missing `='@>
- help3("You should have said `let symbol = something'.")
- ("But don't worry; I'll pretend that an equals sign")
- ("was present. The next token I read will be `something'.");
+ help3("You should have said `let symbol = something'.",
+ "But don't worry; I'll pretend that an equals sign",
+ "was present. The next token I read will be `something'.");
mp_back_error(mp);
}
mp_get_symbol(mp);
@@ -22145,8 +22814,10 @@ void mp_do_let (MP mp) ;
}
@ @<Declarations@>=
+static void mp_do_new_internal (MP mp) ;
+
+@ @<Internal library ...@>=
void mp_grow_internals (MP mp, int l);
-void mp_do_new_internal (MP mp) ;
@ @c
void mp_grow_internals (MP mp, int l) {
@@ -22173,11 +22844,10 @@ void mp_grow_internals (MP mp, int l) {
mp->max_internal = l;
}
-
void mp_do_new_internal (MP mp) {
do {
if ( mp->int_ptr==mp->max_internal ) {
- mp_grow_internals(mp, (mp->max_internal + (mp->max_internal>>2)));
+ mp_grow_internals(mp, (mp->max_internal + (mp->max_internal/4)));
}
mp_get_clear_symbol(mp); incr(mp->int_ptr);
eq_type(mp->cur_sym)=internal_quantity;
@@ -22238,7 +22908,7 @@ if it's |show_code|, complicated structures are abbreviated, otherwise
they aren't.
@<Declare action procedures for use by |do_statement|@>=
-void mp_do_show (MP mp) ;
+static void mp_do_show (MP mp) ;
@ @c void mp_do_show (MP mp) {
do {
@@ -22250,7 +22920,7 @@ void mp_do_show (MP mp) ;
}
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_disp_token (MP mp) ;
+static void mp_disp_token (MP mp) ;
@ @c void mp_disp_token (MP mp) {
mp_print_nl(mp, "> ");
@@ -22258,7 +22928,7 @@ void mp_disp_token (MP mp) ;
if ( mp->cur_sym==0 ) {
@<Show a numeric or string or capsule token@>;
} else {
- mp_print_text(mp->cur_sym); mp_print_char(mp, '=');
+ mp_print_text(mp->cur_sym); mp_print_char(mp, xord('='));
if ( eq_type(mp->cur_sym)>=outer_tag ) mp_print(mp, "(outer) ");
mp_print_cmd_mod(mp, mp->cur_cmd,mp->cur_mod);
if ( mp->cur_cmd==defined_macro ) {
@@ -22275,8 +22945,8 @@ void mp_disp_token (MP mp) ;
} else if ( mp->cur_cmd==capsule_token ) {
mp_print_capsule(mp,mp->cur_mod);
} else {
- mp_print_char(mp, '"');
- mp_print_str(mp, mp->cur_mod); mp_print_char(mp, '"');
+ mp_print_char(mp, xord('"'));
+ mp_print_str(mp, mp->cur_mod); mp_print_char(mp, xord('"'));
delete_str_ref(mp->cur_mod);
}
}
@@ -22305,7 +22975,7 @@ case tertiary_secondary_macro:
case expression_tertiary_macro:
mp_print_cmd_mod(mp, macro_def,c);
mp_print(mp, "'d macro:");
- mp_print_ln(mp); mp_show_token_list(mp, link(link(m)),null,1000,0);
+ mp_print_ln(mp); mp_show_token_list(mp, mp_link(mp_link(m)),null,1000,0);
break;
case repeat_loop:
mp_print(mp, "[repeat the loop]");
@@ -22315,7 +22985,7 @@ case internal_quantity:
break;
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_show_token (MP mp) ;
+static void mp_do_show_token (MP mp) ;
@ @c void mp_do_show_token (MP mp) {
do {
@@ -22325,19 +22995,19 @@ void mp_do_show_token (MP mp) ;
}
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_show_stats (MP mp) ;
+static void mp_do_show_stats (MP mp) ;
@ @c void mp_do_show_stats (MP mp) {
mp_print_nl(mp, "Memory usage ");
@.Memory usage...@>
- mp_print_int(mp, mp->var_used); mp_print_char(mp, '&'); mp_print_int(mp, mp->dyn_used);
+ mp_print_int(mp, mp->var_used); mp_print_char(mp, xord('&')); mp_print_int(mp, mp->dyn_used);
mp_print(mp, " ("); mp_print_int(mp, mp->hi_mem_min-mp->lo_mem_max-1);
mp_print(mp, " still untouched)"); mp_print_ln(mp);
mp_print_nl(mp, "String usage ");
mp_print_int(mp, mp->strs_in_use-mp->init_str_use);
- mp_print_char(mp, '&'); mp_print_int(mp, mp->pool_in_use-mp->init_pool_ptr);
+ mp_print_char(mp, xord('&')); mp_print_int(mp, mp->pool_in_use-mp->init_pool_ptr);
mp_print(mp, " (");
- mp_print_int(mp, mp->max_strings-1-mp->strs_used_up); mp_print_char(mp, '&');
+ mp_print_int(mp, mp->max_strings-1-mp->strs_used_up); mp_print_char(mp, xord('&'));
mp_print_int(mp, mp->pool_size-mp->pool_ptr);
mp_print(mp, " now untouched)"); mp_print_ln(mp);
mp_get_x_next(mp);
@@ -22347,18 +23017,18 @@ void mp_do_show_stats (MP mp) ;
of a variable, for use by |do_show_var|.
@<Declare action procedures for use by |do_statement|@>=
-void mp_disp_var (MP mp,pointer p) ;
+static void mp_disp_var (MP mp,pointer p) ;
@ @c void mp_disp_var (MP mp,pointer p) {
pointer q; /* traverses attributes and subscripts */
int n; /* amount of macro text to show */
- if ( type(p)==mp_structured ) {
+ if ( mp_type(p)==mp_structured ) {
@<Descend the structure@>;
- } else if ( type(p)>=mp_unsuffixed_macro ) {
+ } else if ( mp_type(p)>=mp_unsuffixed_macro ) {
@<Display a variable macro@>;
- } else if ( type(p)!=undefined ){
+ } else if ( mp_type(p)!=undefined ){
mp_print_nl(mp, ""); mp_print_variable_name(mp, p);
- mp_print_char(mp, '=');
+ mp_print_char(mp, xord('='));
mp_print_exp(mp, p,0);
}
}
@@ -22366,17 +23036,17 @@ void mp_disp_var (MP mp,pointer p) ;
@ @<Descend the structure@>=
{
q=attr_head(p);
- do { mp_disp_var(mp, q); q=link(q); } while (q!=end_attr);
+ do { mp_disp_var(mp, q); q=mp_link(q); } while (q!=end_attr);
q=subscr_head(p);
- while ( name_type(q)==mp_subscr ) {
- mp_disp_var(mp, q); q=link(q);
+ while ( mp_name_type(q)==mp_subscr ) {
+ mp_disp_var(mp, q); q=mp_link(q);
}
}
@ @<Display a variable macro@>=
{
mp_print_nl(mp, ""); mp_print_variable_name(mp, p);
- if ( type(p)>mp_unsuffixed_macro )
+ if ( mp_type(p)>mp_unsuffixed_macro )
mp_print(mp, "@@#"); /* |suffixed_macro| */
mp_print(mp, "=macro:");
if ( (int)mp->file_offset>=mp->max_print_line-20 ) n=5;
@@ -22385,7 +23055,7 @@ void mp_disp_var (MP mp,pointer p) ;
}
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_show_var (MP mp) ;
+static void mp_do_show_var (MP mp) ;
@ @c void mp_do_show_var (MP mp) {
do {
@@ -22401,21 +23071,21 @@ void mp_do_show_var (MP mp) ;
}
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_show_dependencies (MP mp) ;
+static void mp_do_show_dependencies (MP mp) ;
@ @c void mp_do_show_dependencies (MP mp) {
pointer p; /* link that runs through all dependencies */
- p=link(dep_head);
+ p=mp_link(dep_head);
while ( p!=dep_head ) {
if ( mp_interesting(mp, p) ) {
mp_print_nl(mp, ""); mp_print_variable_name(mp, p);
- if ( type(p)==mp_dependent ) mp_print_char(mp, '=');
+ if ( mp_type(p)==mp_dependent ) mp_print_char(mp, xord('='));
else mp_print(mp, " = "); /* extra spaces imply proto-dependency */
- mp_print_dependency(mp, dep_list(p),type(p));
+ mp_print_dependency(mp, dep_list(p),mp_type(p));
}
p=dep_list(p);
- while ( info(p)!=null ) p=link(p);
- p=link(p);
+ while ( mp_info(p)!=null ) p=mp_link(p);
+ p=mp_link(p);
}
mp_get_x_next(mp);
}
@@ -22424,7 +23094,7 @@ void mp_do_show_dependencies (MP mp) ;
show commands.
@<Declare action procedures for use by |do_statement|@>=
-void mp_do_show_whatever (MP mp) ;
+static void mp_do_show_whatever (MP mp) ;
@ @c void mp_do_show_whatever (MP mp) {
if ( mp->interaction==mp_error_stop_mode ) wake_up_terminal;
@@ -22456,8 +23126,8 @@ void mp_do_show_whatever (MP mp) ;
@ Pre and postscripts need two new identifiers:
-@d with_pre_script 11
-@d with_post_script 13
+@d with_mp_pre_script 11
+@d with_mp_post_script 13
@<Put each...@>=
mp_primitive(mp, "doublepath",thing_to_add,double_path_code);
@@ -22470,10 +23140,10 @@ mp_primitive(mp, "withpen",with_option,mp_pen_type);
@:with_pen_}{\&{withpen} primitive@>
mp_primitive(mp, "dashed",with_option,mp_picture_type);
@:dashed_}{\&{dashed} primitive@>
-mp_primitive(mp, "withprescript",with_option,with_pre_script);
-@:with_pre_script_}{\&{withprescript} primitive@>
-mp_primitive(mp, "withpostscript",with_option,with_post_script);
-@:with_post_script_}{\&{withpostscript} primitive@>
+mp_primitive(mp, "withprescript",with_option,with_mp_pre_script);
+@:with_mp_pre_script_}{\&{withprescript} primitive@>
+mp_primitive(mp, "withpostscript",with_option,with_mp_post_script);
+@:with_mp_post_script_}{\&{withpostscript} primitive@>
mp_primitive(mp, "withoutcolor",with_option,mp_no_model);
@:with_color_}{\&{withoutcolor} primitive@>
mp_primitive(mp, "withgreyscale",with_option,mp_grey_model);
@@ -22494,8 +23164,8 @@ case thing_to_add:
break;
case with_option:
if ( m==mp_pen_type ) mp_print(mp, "withpen");
- else if ( m==with_pre_script ) mp_print(mp, "withprescript");
- else if ( m==with_post_script ) mp_print(mp, "withpostscript");
+ else if ( m==with_mp_pre_script ) mp_print(mp, "withprescript");
+ else if ( m==with_mp_post_script ) mp_print(mp, "withpostscript");
else if ( m==mp_no_model ) mp_print(mp, "withoutcolor");
else if ( m==mp_rgb_model ) mp_print(mp, "withrgbcolor");
else if ( m==mp_uninitialized_model ) mp_print(mp, "withcolor");
@@ -22510,12 +23180,12 @@ clause$\rangle$ updates all graphical objects whose |type| is compatible.
Other objects are ignored.
@<Declare action procedures for use by |do_statement|@>=
-void mp_scan_with_list (MP mp,pointer p) ;
+static void mp_scan_with_list (MP mp,pointer p) ;
@ @c void mp_scan_with_list (MP mp,pointer p) {
- small_number t; /* |cur_mod| of the |with_option| (should match |cur_type|) */
+ quarterword t; /* |cur_mod| of the |with_option| (should match |cur_type|) */
pointer q; /* for list manipulation */
- int old_setting; /* saved |selector| setting */
+ unsigned old_setting; /* saved |selector| setting */
pointer k; /* for finding the near-last item in a list */
str_number s; /* for string cleanup after combining */
pointer cp,pp,dp,ap,bp;
@@ -22526,8 +23196,8 @@ void mp_scan_with_list (MP mp,pointer p) ;
t=mp->cur_mod;
mp_get_x_next(mp);
if ( t!=mp_no_model ) mp_scan_expression(mp);
- if (((t==with_pre_script)&&(mp->cur_type!=mp_string_type))||
- ((t==with_post_script)&&(mp->cur_type!=mp_string_type))||
+ if (((t==with_mp_pre_script)&&(mp->cur_type!=mp_string_type))||
+ ((t==with_mp_post_script)&&(mp->cur_type!=mp_string_type))||
((t==mp_uninitialized_model)&&
((mp->cur_type!=mp_cmykcolor_type)&&(mp->cur_type!=mp_color_type)
&&(mp->cur_type!=mp_known)&&(mp->cur_type!=mp_boolean_type)))||
@@ -22564,53 +23234,53 @@ void mp_scan_with_list (MP mp,pointer p) ;
} else if ( t==mp_pen_type ) {
if ( pp==mp_void ) @<Make |pp| an object in list~|p| that needs a pen@>;
if ( pp!=null ) {
- if ( pen_p(pp)!=null ) mp_toss_knot_list(mp, pen_p(pp));
- pen_p(pp)=mp->cur_exp; mp->cur_type=mp_vacuous;
+ if ( mp_pen_p(pp)!=null ) mp_toss_knot_list(mp, mp_pen_p(pp));
+ mp_pen_p(pp)=mp->cur_exp; mp->cur_type=mp_vacuous;
}
- } else if ( t==with_pre_script ) {
+ } else if ( t==with_mp_pre_script ) {
if ( ap==mp_void )
ap=p;
while ( (ap!=null)&&(! has_color(ap)) )
- ap=link(ap);
+ ap=mp_link(ap);
if ( ap!=null ) {
- if ( pre_script(ap)!=null ) { /* build a new,combined string */
- s=pre_script(ap);
+ if ( mp_pre_script(ap)!=null ) { /* build a new,combined string */
+ s=mp_pre_script(ap);
old_setting=mp->selector;
mp->selector=new_string;
- str_room(length(pre_script(ap))+length(mp->cur_exp)+2);
+ str_room(length(mp_pre_script(ap))+length(mp->cur_exp)+2);
mp_print_str(mp, mp->cur_exp);
append_char(13); /* a forced \ps\ newline */
- mp_print_str(mp, pre_script(ap));
- pre_script(ap)=mp_make_string(mp);
+ mp_print_str(mp, mp_pre_script(ap));
+ mp_pre_script(ap)=mp_make_string(mp);
delete_str_ref(s);
mp->selector=old_setting;
} else {
- pre_script(ap)=mp->cur_exp;
+ mp_pre_script(ap)=mp->cur_exp;
}
mp->cur_type=mp_vacuous;
}
- } else if ( t==with_post_script ) {
+ } else if ( t==with_mp_post_script ) {
if ( bp==mp_void )
k=p;
bp=k;
- while ( link(k)!=null ) {
- k=link(k);
+ while ( mp_link(k)!=null ) {
+ k=mp_link(k);
if ( has_color(k) ) bp=k;
}
if ( bp!=null ) {
- if ( post_script(bp)!=null ) {
- s=post_script(bp);
+ if ( mp_post_script(bp)!=null ) {
+ s=mp_post_script(bp);
old_setting=mp->selector;
mp->selector=new_string;
- str_room(length(post_script(bp))+length(mp->cur_exp)+2);
- mp_print_str(mp, post_script(bp));
+ str_room(length(mp_post_script(bp))+length(mp->cur_exp)+2);
+ mp_print_str(mp, mp_post_script(bp));
append_char(13); /* a forced \ps\ newline */
mp_print_str(mp, mp->cur_exp);
- post_script(bp)=mp_make_string(mp);
+ mp_post_script(bp)=mp_make_string(mp);
delete_str_ref(s);
mp->selector=old_setting;
} else {
- post_script(bp)=mp->cur_exp;
+ mp_post_script(bp)=mp->cur_exp;
}
mp->cur_type=mp_vacuous;
}
@@ -22619,8 +23289,8 @@ void mp_scan_with_list (MP mp,pointer p) ;
@<Make |dp| a stroked node in list~|p|@>;
}
if ( dp!=null ) {
- if ( dash_p(dp)!=null ) delete_edge_ref(dash_p(dp));
- dash_p(dp)=mp_make_dashes(mp, mp->cur_exp);
+ if ( mp_dash_p(dp)!=null ) delete_edge_ref(mp_dash_p(dp));
+ mp_dash_p(dp)=mp_make_dashes(mp, mp->cur_exp);
dash_scale(dp)=unity;
mp->cur_type=mp_vacuous;
}
@@ -22633,11 +23303,11 @@ void mp_scan_with_list (MP mp,pointer p) ;
@ @<Complain about improper type@>=
{ exp_err("Improper type");
@.Improper type@>
-help2("Next time say `withpen <known pen expression>';")
- ("I'll ignore the bad `with' clause and look for another.");
-if ( t==with_pre_script )
+help2("Next time say `withpen <known pen expression>';",
+ "I'll ignore the bad `with' clause and look for another.");
+if ( t==with_mp_pre_script )
mp->help_line[1]="Next time say `withprescript <known string expression>';";
-else if ( t==with_post_script )
+else if ( t==with_mp_post_script )
mp->help_line[1]="Next time say `withpostscript <known string expression>';";
else if ( t==mp_picture_type )
mp->help_line[1]="Next time say `dashed <known picture expression>';";
@@ -22675,7 +23345,7 @@ black_val(cp)=0;
red_val(cp)=value(red_part_loc(q));
green_val(cp)=value(green_part_loc(q));
blue_val(cp)=value(blue_part_loc(q));
-color_model(cp)=mp_rgb_model;
+mp_color_model(cp)=mp_rgb_model;
if ( red_val(cp)<0 ) red_val(cp)=0;
if ( green_val(cp)<0 ) green_val(cp)=0;
if ( blue_val(cp)<0 ) blue_val(cp)=0;
@@ -22690,7 +23360,7 @@ cyan_val(cp)=value(cyan_part_loc(q));
magenta_val(cp)=value(magenta_part_loc(q));
yellow_val(cp)=value(yellow_part_loc(q));
black_val(cp)=value(black_part_loc(q));
-color_model(cp)=mp_cmyk_model;
+mp_color_model(cp)=mp_cmyk_model;
if ( cyan_val(cp)<0 ) cyan_val(cp)=0;
if ( magenta_val(cp)<0 ) magenta_val(cp)=0;
if ( yellow_val(cp)<0 ) yellow_val(cp)=0;
@@ -22708,7 +23378,7 @@ magenta_val(cp)=0;
yellow_val(cp)=0;
black_val(cp)=0;
grey_val(cp)=q;
-color_model(cp)=mp_grey_model;
+mp_color_model(cp)=mp_grey_model;
if ( grey_val(cp)<0 ) grey_val(cp)=0;
if ( grey_val(cp)>unity ) grey_val(cp)=unity;
}
@@ -22720,14 +23390,14 @@ magenta_val(cp)=0;
yellow_val(cp)=0;
black_val(cp)=0;
grey_val(cp)=0;
-color_model(cp)=mp_no_model;
+mp_color_model(cp)=mp_no_model;
}
@ @<Make |cp| a colored object in object list~|p|@>=
{ cp=p;
while ( cp!=null ){
if ( has_color(cp) ) break;
- cp=link(cp);
+ cp=mp_link(cp);
}
}
@@ -22735,63 +23405,63 @@ color_model(cp)=mp_no_model;
{ pp=p;
while ( pp!=null ) {
if ( has_pen(pp) ) break;
- pp=link(pp);
+ pp=mp_link(pp);
}
}
@ @<Make |dp| a stroked node in list~|p|@>=
{ dp=p;
while ( dp!=null ) {
- if ( type(dp)==mp_stroked_code ) break;
- dp=link(dp);
+ if ( mp_type(dp)==mp_stroked_code ) break;
+ dp=mp_link(dp);
}
}
@ @<Copy the information from objects |cp|, |pp|, and |dp| into...@>=
@<Copy |cp|'s color into the colored objects linked to~|cp|@>;
if ( pp>mp_void ) {
- @<Copy |pen_p(pp)| into stroked and filled nodes linked to |pp|@>;
+ @<Copy |mp_pen_p(pp)| into stroked and filled nodes linked to |pp|@>;
}
if ( dp>mp_void ) {
- @<Make stroked nodes linked to |dp| refer to |dash_p(dp)|@>;
+ @<Make stroked nodes linked to |dp| refer to |mp_dash_p(dp)|@>;
}
@ @<Copy |cp|'s color into the colored objects linked to~|cp|@>=
-{ q=link(cp);
+{ q=mp_link(cp);
while ( q!=null ) {
if ( has_color(q) ) {
red_val(q)=red_val(cp);
green_val(q)=green_val(cp);
blue_val(q)=blue_val(cp);
black_val(q)=black_val(cp);
- color_model(q)=color_model(cp);
+ mp_color_model(q)=mp_color_model(cp);
}
- q=link(q);
+ q=mp_link(q);
}
}
-@ @<Copy |pen_p(pp)| into stroked and filled nodes linked to |pp|@>=
-{ q=link(pp);
+@ @<Copy |mp_pen_p(pp)| into stroked and filled nodes linked to |pp|@>=
+{ q=mp_link(pp);
while ( q!=null ) {
if ( has_pen(q) ) {
- if ( pen_p(q)!=null ) mp_toss_knot_list(mp, pen_p(q));
- pen_p(q)=copy_pen(pen_p(pp));
+ if ( mp_pen_p(q)!=null ) mp_toss_knot_list(mp, mp_pen_p(q));
+ mp_pen_p(q)=copy_pen(mp_pen_p(pp));
}
- q=link(q);
+ q=mp_link(q);
}
}
-@ @<Make stroked nodes linked to |dp| refer to |dash_p(dp)|@>=
-{ q=link(dp);
+@ @<Make stroked nodes linked to |dp| refer to |mp_dash_p(dp)|@>=
+{ q=mp_link(dp);
while ( q!=null ) {
- if ( type(q)==mp_stroked_code ) {
- if ( dash_p(q)!=null ) delete_edge_ref(dash_p(q));
- dash_p(q)=dash_p(dp);
+ if ( mp_type(q)==mp_stroked_code ) {
+ if ( mp_dash_p(q)!=null ) delete_edge_ref(mp_dash_p(q));
+ mp_dash_p(q)=mp_dash_p(dp);
dash_scale(q)=unity;
- if ( dash_p(q)!=null ) add_edge_ref(dash_p(q));
+ if ( mp_dash_p(q)!=null ) add_edge_ref(mp_dash_p(q));
}
- q=link(q);
+ q=mp_link(q);
}
}
@@ -22801,7 +23471,7 @@ a token list for that variable. Since the edge structure is about to be
updated, we use |private_edges| to make sure that this is possible.
@<Declare action procedures for use by |do_statement|@>=
-pointer mp_find_edges_var (MP mp, pointer t) ;
+static pointer mp_find_edges_var (MP mp, pointer t) ;
@ @c pointer mp_find_edges_var (MP mp, pointer t) {
pointer p;
@@ -22809,13 +23479,13 @@ pointer mp_find_edges_var (MP mp, pointer t) ;
p=mp_find_variable(mp, t); cur_edges=null;
if ( p==null ) {
mp_obliterated(mp, t); mp_put_get_error(mp);
- } else if ( type(p)!=mp_picture_type ) {
+ } else if ( mp_type(p)!=mp_picture_type ) {
print_err("Variable "); mp_show_token_list(mp, t,null,1000,0);
@.Variable x is the wrong type@>
mp_print(mp, " is the wrong type (");
- mp_print_type(mp, type(p)); mp_print_char(mp, ')');
- help2("I was looking for a \"known\" picture variable.")
- ("So I'll not change anything just now.");
+ mp_print_type(mp, mp_type(p)); mp_print_char(mp, xord(')'));
+ help2("I was looking for a \"known\" picture variable.",
+ "So I'll not change anything just now.");
mp_put_get_error(mp);
} else {
value(p)=mp_private_edges(mp, value(p));
@@ -22853,7 +23523,7 @@ quarterword last_add_type;
/* command modifier that identifies the last \&{addto} command */
@ @<Declare action procedures for use by |do_statement|@>=
-pointer mp_start_draw_cmd (MP mp,quarterword sep) ;
+static pointer mp_start_draw_cmd (MP mp,quarterword sep) ;
@ @c pointer mp_start_draw_cmd (MP mp,quarterword sep) {
pointer lhv; /* variable to add to left */
@@ -22873,17 +23543,17 @@ pointer mp_start_draw_cmd (MP mp,quarterword sep) ;
@ @<Abandon edges command because there's no variable@>=
{ exp_err("Not a suitable variable");
@.Not a suitable variable@>
- help4("At this point I needed to see the name of a picture variable.")
- ("(Or perhaps you have indeed presented me with one; I might")
- ("have missed it, if it wasn't followed by the proper token.)")
- ("So I'll not change anything just now.");
+ help4("At this point I needed to see the name of a picture variable.",
+ "(Or perhaps you have indeed presented me with one; I might",
+ "have missed it, if it wasn't followed by the proper token.)",
+ "So I'll not change anything just now.");
mp_put_get_flush_error(mp, 0);
}
@ Here is an example of how to use |start_draw_cmd|.
@<Declare action procedures for use by |do_statement|@>=
-void mp_do_bounds (MP mp) ;
+static void mp_do_bounds (MP mp) ;
@ @c void mp_do_bounds (MP mp) {
pointer lhv,lhe; /* variable on left, the corresponding edge structure */
@@ -22898,10 +23568,10 @@ void mp_do_bounds (MP mp) ;
} else if ( mp->cur_type!=mp_path_type ) {
exp_err("Improper `clip'");
@.Improper `addto'@>
- help2("This expression should have specified a known path.")
- ("So I'll not change anything just now.");
+ help2("This expression should have specified a known path.",
+ "So I'll not change anything just now.");
mp_put_get_flush_error(mp, 0);
- } else if ( left_type(mp->cur_exp)==mp_endpoint ) {
+ } else if ( mp_left_type(mp->cur_exp)==mp_endpoint ) {
@<Complain about a non-cycle@>;
} else {
@<Make |cur_exp| into a \&{setbounds} or clipping path and add it to |lhe|@>;
@@ -22912,18 +23582,18 @@ void mp_do_bounds (MP mp) ;
@ @<Complain about a non-cycle@>=
{ print_err("Not a cycle");
@.Not a cycle@>
- help2("That contour should have ended with `..cycle' or `&cycle'.")
- ("So I'll not change anything just now."); mp_put_get_error(mp);
+ help2("That contour should have ended with `..cycle' or `&cycle'.",
+ "So I'll not change anything just now."); mp_put_get_error(mp);
}
@ @<Make |cur_exp| into a \&{setbounds} or clipping path and add...@>=
{ p=mp_new_bounds_node(mp, mp->cur_exp,m);
- link(p)=link(dummy_loc(lhe));
- link(dummy_loc(lhe))=p;
+ mp_link(p)=mp_link(dummy_loc(lhe));
+ mp_link(dummy_loc(lhe))=p;
if ( obj_tail(lhe)==dummy_loc(lhe) ) obj_tail(lhe)=p;
p=mp_get_node(mp, mp->gr_object_size[stop_type(m)]);
- type(p)=stop_type(m);
- link(obj_tail(lhe))=p;
+ mp_type(p)=stop_type(m);
+ mp_link(obj_tail(lhe))=p;
obj_tail(lhe)=p;
mp_init_bbox(mp, lhe);
}
@@ -22932,7 +23602,7 @@ void mp_do_bounds (MP mp) ;
cases to deal with.
@<Declare action procedures for use by |do_statement|@>=
-void mp_do_add_to (MP mp) ;
+static void mp_do_add_to (MP mp) ;
@ @c void mp_do_add_to (MP mp) {
pointer lhv,lhe; /* variable on left, the corresponding edge structure */
@@ -22962,11 +23632,12 @@ setting |e:=null| prevents anything from being added to |lhe|.
if ( mp->cur_type!=mp_picture_type ) {
exp_err("Improper `addto'");
@.Improper `addto'@>
- help2("This expression should have specified a known picture.")
- ("So I'll not change anything just now."); mp_put_get_flush_error(mp, 0);
+ help2("This expression should have specified a known picture.",
+ "So I'll not change anything just now.");
+ mp_put_get_flush_error(mp, 0);
} else {
e=mp_private_edges(mp, mp->cur_exp); mp->cur_type=mp_vacuous;
- p=link(dummy_loc(e));
+ p=mp_link(dummy_loc(e));
}
}
@@ -22979,11 +23650,11 @@ attempts to add to the edge structure.
if ( mp->cur_type!=mp_path_type ) {
exp_err("Improper `addto'");
@.Improper `addto'@>
- help2("This expression should have specified a known path.")
- ("So I'll not change anything just now.");
+ help2("This expression should have specified a known path.",
+ "So I'll not change anything just now.");
mp_put_get_flush_error(mp, 0);
} else if ( add_type==contour_code ) {
- if ( left_type(mp->cur_exp)==mp_endpoint ) {
+ if ( mp_left_type(mp->cur_exp)==mp_endpoint ) {
@<Complain about a non-cycle@>;
} else {
p=mp_new_fill_node(mp, mp->cur_exp);
@@ -23007,19 +23678,19 @@ if ( lhe==null ) {
do_nothing;
}
} else if ( p!=null ) {
- link(obj_tail(lhe))=p;
+ mp_link(obj_tail(lhe))=p;
obj_tail(lhe)=p;
if ( add_type==double_path_code )
- if ( pen_p(p)==null )
- pen_p(p)=mp_get_pen_circle(mp, 0);
+ if ( mp_pen_p(p)==null )
+ mp_pen_p(p)=mp_get_pen_circle(mp, 0);
}
@ @<Merge |e| into |lhe| and delete |e|@>=
-{ if ( link(dummy_loc(e))!=null ) {
- link(obj_tail(lhe))=link(dummy_loc(e));
+{ if ( mp_link(dummy_loc(e))!=null ) {
+ mp_link(obj_tail(lhe))=mp_link(dummy_loc(e));
obj_tail(lhe)=obj_tail(e);
obj_tail(e)=dummy_loc(e);
- link(dummy_loc(e))=null;
+ mp_link(dummy_loc(e))=null;
mp_flush_dash_list(mp, lhe);
}
mp_toss_edges(mp, e);
@@ -23029,9 +23700,8 @@ if ( lhe==null ) {
case ship_out_command: mp_do_ship_out(mp); break;
@ @<Declare action procedures for use by |do_statement|@>=
-@<Declare the function called |tfm_check|@>
@<Declare the \ps\ output procedures@>
-void mp_do_ship_out (MP mp) ;
+static void mp_do_ship_out (MP mp) ;
@ @c void mp_do_ship_out (MP mp) {
integer c; /* the character code */
@@ -23079,7 +23749,7 @@ mp->start_sym=0;
if ( f>g ) {
mp->pool_ptr = mp->pool_ptr - g;
while ( f>g ) {
- mp_print_char(mp, '0');
+ mp_print_char(mp, xord('0'));
decr(f);
};
mp_print_int(mp, (A));
@@ -23109,7 +23779,7 @@ case message_command: mp_do_message(mp); break;
@ @<Declare action procedures for use by |do_statement|@>=
@<Declare a procedure called |no_string_err|@>
-void mp_do_message (MP mp) ;
+static void mp_do_message (MP mp) ;
@
@c void mp_do_message (MP mp) {
@@ -23137,7 +23807,7 @@ void mp_do_message (MP mp) ;
}
@ @<Declare a procedure called |no_string_err|@>=
-void mp_no_string_err (MP mp, const char *s) {
+static void mp_no_string_err (MP mp, const char *s) {
exp_err("Not a string");
@.Not a string@>
help1(s);
@@ -23172,11 +23842,11 @@ boolean long_help_seen; /* has the long \.{\\errmessage} help been used? */
help1("(That was another `errmessage'.)") ;
} else {
if ( mp->interaction<mp_error_stop_mode ) mp->long_help_seen=true;
- help4("This error message was generated by an `errmessage'")
- ("command, so I can\'t give any explicit help.")
- ("Pretend that you're Miss Marple: Examine all clues,")
+ help4("This error message was generated by an `errmessage'",
+ "command, so I can\'t give any explicit help.",
+ "Pretend that you're Miss Marple: Examine all clues,",
@^Marple, Jane@>
- ("and deduce the truth by inspired guesses.");
+ "and deduce the truth by inspired guesses.");
}
mp_put_get_error(mp); mp->use_err_help=false;
}
@@ -23185,12 +23855,12 @@ boolean long_help_seen; /* has the long \.{\\errmessage} help been used? */
case write_command: mp_do_write(mp); break;
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_write (MP mp) ;
+static void mp_do_write (MP mp) ;
@ @c void mp_do_write (MP mp) {
str_number t; /* the line of text to be written */
write_index n,n0; /* for searching |wr_fname| and |wr_file| arrays */
- int old_setting; /* for saving |selector| during output */
+ unsigned old_setting; /* for saving |selector| during output */
mp_get_x_next(mp);
mp_scan_expression(mp);
if ( mp->cur_type!=mp_string_type ) {
@@ -23241,7 +23911,7 @@ void mp_do_write (MP mp) ;
void **wr_file;
char **wr_fname;
write_index l,k;
- l = mp->max_write_files + (mp->max_write_files>>2);
+ l = mp->max_write_files + (mp->max_write_files/4);
wr_file = xmalloc((l+1),sizeof(void *));
wr_fname = xmalloc((l+1),sizeof(char *));
for (k=0;k<=l;k++) {
@@ -23584,11 +24254,9 @@ eight_bits label_char[257]; /* characters for |label_loc| */
short label_ptr; /* highest position occupied in |label_loc| */
@ @<Allocate or initialize ...@>=
-mp->header_last = 0; mp->header_size = 128; /* just for init */
+mp->header_last=7;
+mp->header_size = 128; /* just for init */
mp->header_byte = xmalloc(mp->header_size, sizeof(char));
-mp->lig_kern = NULL; /* allocated when needed */
-mp->kern = NULL; /* allocated when needed */
-mp->param = NULL; /* allocated when needed */
@ @<Dealloc variables@>=
xfree(mp->header_byte);
@@ -23602,17 +24270,17 @@ for (k=0;k<= 255;k++ ) {
mp->char_exists[k]=false; mp->char_tag[k]=no_tag; mp->char_remainder[k]=0;
mp->skip_table[k]=undefined_label;
}
-memset(mp->header_byte,0,mp->header_size);
+memset(mp->header_byte,0,(size_t)mp->header_size);
mp->bc=255; mp->ec=0; mp->nl=0; mp->nk=0; mp->ne=0; mp->np=0;
mp->internal[mp_boundary_char]=-unity;
mp->bch_label=undefined_label;
mp->label_loc[0]=-1; mp->label_ptr=0;
@ @<Declarations@>=
-scaled mp_tfm_check (MP mp,small_number m) ;
+static scaled mp_tfm_check (MP mp,quarterword m) ;
-@ @<Declare the function called |tfm_check|@>=
-scaled mp_tfm_check (MP mp,small_number m) {
+@ @c
+static scaled mp_tfm_check (MP mp,quarterword m) {
if ( abs(mp->internal[m])>=fraction_half ) {
print_err("Enormous "); mp_print(mp, mp->int_name[m]);
@.Enormous charwd...@>
@@ -23631,10 +24299,10 @@ scaled mp_tfm_check (MP mp,small_number m) {
}
@ @<Store the width information for character code~|c|@>=
-if ( c<mp->bc ) mp->bc=c;
-if ( c>mp->ec ) mp->ec=c;
+if ( c<mp->bc ) mp->bc=(eight_bits)c;
+if ( c>mp->ec ) mp->ec=(eight_bits)c;
mp->char_exists[c]=true;
-mp->tfm_width[c]=mp_tfm_check(mp, mp_char_wd);
+mp->tfm_width[c]=mp_tfm_check(mp,mp_char_wd);
mp->tfm_height[c]=mp_tfm_check(mp, mp_char_ht);
mp->tfm_depth[c]=mp_tfm_check(mp, mp_char_dp);
mp->tfm_ital_corr[c]=mp_tfm_check(mp, mp_char_ic)
@@ -23674,37 +24342,37 @@ case tfm_command:
break;
@ @<Declare action procedures for use by |do_statement|@>=
-eight_bits mp_get_code (MP mp) ;
+static eight_bits mp_get_code (MP mp) ;
@ @c eight_bits mp_get_code (MP mp) { /* scans a character code value */
integer c; /* the code value found */
mp_get_x_next(mp); mp_scan_expression(mp);
if ( mp->cur_type==mp_known ) {
c=mp_round_unscaled(mp, mp->cur_exp);
- if ( c>=0 ) if ( c<256 ) return c;
+ if ( c>=0 ) if ( c<256 ) return (eight_bits)c;
} else if ( mp->cur_type==mp_string_type ) {
if ( length(mp->cur_exp)==1 ) {
c=mp->str_pool[mp->str_start[mp->cur_exp]];
- return c;
+ return (eight_bits)c;
}
}
exp_err("Invalid code has been replaced by 0");
@.Invalid code...@>
- help2("I was looking for a number between 0 and 255, or for a")
- ("string of length 1. Didn't find it; will use 0 instead.");
+ help2("I was looking for a number between 0 and 255, or for a",
+ "string of length 1. Didn't find it; will use 0 instead.");
mp_put_get_flush_error(mp, 0); c=0;
- return c;
+ return (eight_bits)c;
}
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_set_tag (MP mp,halfword c, small_number t, halfword r) ;
+static void mp_set_tag (MP mp,halfword c, quarterword t, halfword r) ;
-@ @c void mp_set_tag (MP mp,halfword c, small_number t, halfword r) {
+@ @c void mp_set_tag (MP mp,halfword c, quarterword t, halfword r) {
if ( mp->char_tag[c]==no_tag ) {
mp->char_tag[c]=t; mp->char_remainder[c]=r;
if ( t==lig_tag ){
incr(mp->label_ptr); mp->label_loc[mp->label_ptr]=r;
- mp->label_char[mp->label_ptr]=c;
+ mp->label_char[mp->label_ptr]=(eight_bits)c;
}
} else {
@<Complain about a character tag conflict@>;
@@ -23714,7 +24382,7 @@ void mp_set_tag (MP mp,halfword c, small_number t, halfword r) ;
@ @<Complain about a character tag conflict@>=
{
print_err("Character ");
- if ( (c>' ')&&(c<127) ) mp_print_char(mp,c);
+ if ( (c>' ')&&(c<127) ) mp_print_char(mp,xord(c));
else if ( c==256 ) mp_print(mp, "||");
else { mp_print(mp, "code "); mp_print_int(mp, c); };
mp_print(mp, " is already ");
@@ -23724,13 +24392,13 @@ void mp_set_tag (MP mp,halfword c, small_number t, halfword r) ;
case list_tag: mp_print(mp, "in a charlist"); break;
case ext_tag: mp_print(mp, "extensible"); break;
} /* there are no other cases */
- help2("It's not legal to label a character more than once.")
- ("So I'll not change anything just now.");
+ help2("It's not legal to label a character more than once.",
+ "So I'll not change anything just now.");
mp_put_get_error(mp);
}
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_tfm_command (MP mp) ;
+static void mp_do_tfm_command (MP mp) ;
@ @c void mp_do_tfm_command (MP mp) {
int c,cc; /* character codes */
@@ -23761,8 +24429,8 @@ void mp_do_tfm_command (MP mp) ;
if ( (mp->cur_type!=mp_known)||(mp->cur_exp<half_unit) ) {
exp_err("Improper location");
@.Improper location@>
- help2("I was looking for a known, positive number.")
- ("For safety's sake I'll ignore the present command.");
+ help2("I was looking for a known, positive number.",
+ "For safety's sake I'll ignore the present command.");
mp_put_get_error(mp);
} else {
j=mp_round_unscaled(mp, mp->cur_exp);
@@ -23907,8 +24575,8 @@ We may need to cancel skips that span more than 127 lig/kern steps.
if ( mp->cur_type!=mp_known ) {
exp_err("Improper kern");
@.Improper kern@>
- help2("The amount of kern should be a known numeric value.")
- ("I'm zeroing this one. Proceed, with fingers crossed.");
+ help2("The amount of kern should be a known numeric value.",
+ "I'm zeroing this one. Proceed, with fingers crossed.");
mp_put_get_flush_error(mp, 0);
}
mp->kern[mp->nk]=mp->cur_exp;
@@ -23950,15 +24618,15 @@ We may need to cancel skips that span more than 127 lig/kern steps.
@<Store a list of header bytes@>=
do {
if ( j>=mp->header_size ) {
- int l = mp->header_size + (mp->header_size >> 2);
- char *t = xmalloc(l,sizeof(char));
+ size_t l = (size_t)(mp->header_size + (mp->header_size/4));
+ char *t = xmalloc(l,1);
memset(t,0,l);
- memcpy(t,mp->header_byte,mp->header_size);
+ memcpy(t,mp->header_byte,(size_t)mp->header_size);
xfree (mp->header_byte);
mp->header_byte = t;
- mp->header_size = l;
+ mp->header_size = (int)l;
}
- mp->header_byte[j]=mp_get_code(mp);
+ mp->header_byte[j]=(char)mp_get_code(mp);
incr(j); incr(mp->header_last);
} while (mp->cur_cmd==comma)
@@ -23997,7 +24665,7 @@ value(inf_val)=fraction_four;
@ Straight linear insertion is good enough for sorting, since the lists
are usually not terribly long. As we work on the data, the current list
-will start at |link(temp_head)| and end at |inf_val|; the nodes in this
+will start at |mp_link(temp_head)| and end at |inf_val|; the nodes in this
list will be in increasing order of their |value| fields.
Given such a list, the |sort_in| function takes a value and returns a pointer
@@ -24008,20 +24676,21 @@ At the time we need to do these operations, most of \MP's work has been
completed, so we will have plenty of memory to play with. The value nodes
that are allocated for sorting will never be returned to free storage.
-@d clear_the_list link(temp_head)=inf_val
+@d clear_the_list mp_link(temp_head)=inf_val
-@c pointer mp_sort_in (MP mp,scaled v) {
+@c
+static pointer mp_sort_in (MP mp,scaled v) {
pointer p,q,r; /* list manipulation registers */
p=temp_head;
while (1) {
- q=link(p);
+ q=mp_link(p);
if ( v<=value(q) ) break;
p=q;
}
if ( v<value(q) ) {
- r=mp_get_node(mp, value_node_size); value(r)=v; link(r)=q; link(p)=r;
+ r=mp_get_node(mp, value_node_size); value(r)=v; mp_link(r)=q; mp_link(p)=r;
}
- return link(p);
+ return mp_link(p);
}
@ Now we come to the interesting part, where we reduce the list if necessary
@@ -24035,14 +24704,15 @@ In particular, |min_cover(0)| returns the number of distinct values in the
current list and sets |perturbation| to the minimum distance between
adjacent values.
-@c integer mp_min_cover (MP mp,scaled d) {
+@c
+static integer mp_min_cover (MP mp,scaled d) {
pointer p; /* runs through the current list */
scaled l; /* the least element covered by the current interval */
integer m; /* lower bound on the size of the minimum cover */
- m=0; p=link(temp_head); mp->perturbation=el_gordo;
+ m=0; p=mp_link(temp_head); mp->perturbation=el_gordo;
while ( p!=inf_val ){
incr(m); l=value(p);
- do { p=link(p); } while (value(p)<=l+d);
+ do { p=mp_link(p); } while (value(p)<=l+d);
if ( value(p)-l<mp->perturbation )
mp->perturbation=value(p)-l;
}
@@ -24059,7 +24729,8 @@ to |min_cover|. The idea is to increase the interval size rapidly until
finding the range, then to go sequentially until the exact borderline has
been discovered.
-@c scaled mp_threshold (MP mp,integer m) {
+@c
+static scaled mp_threshold (MP mp,integer m) {
scaled d; /* lower bound on the smallest interval size */
mp->excess=mp_min_cover(mp, 0)-m;
if ( mp->excess<=0 ) {
@@ -24075,25 +24746,26 @@ been discovered.
}
@ The |skimp| procedure reduces the current list to at most |m| entries,
-by changing values if necessary. It also sets |info(p):=k| if |value(p)|
+by changing values if necessary. It also sets |mp_info(p):=k| if |value(p)|
is the |k|th distinct value on the resulting list, and it sets
|perturbation| to the maximum amount by which a |value| field has
been changed. The size of the resulting list is returned as the
value of |skimp|.
-@c integer mp_skimp (MP mp,integer m) {
+@c
+static integer mp_skimp (MP mp,integer m) {
scaled d; /* the size of intervals being coalesced */
pointer p,q,r; /* list manipulation registers */
scaled l; /* the least value in the current interval */
scaled v; /* a compromise value */
d=mp_threshold(mp, m); mp->perturbation=0;
- q=temp_head; m=0; p=link(temp_head);
+ q=temp_head; m=0; p=mp_link(temp_head);
while ( p!=inf_val ) {
- incr(m); l=value(p); info(p)=m;
- if ( value(link(p))<=l+d ) {
+ incr(m); l=value(p); mp_info(p)=m;
+ if ( value(mp_link(p))<=l+d ) {
@<Replace an interval of values by its midpoint@>;
}
- q=p; p=link(p);
+ q=p; p=mp_link(p);
}
return m;
}
@@ -24101,23 +24773,24 @@ value of |skimp|.
@ @<Replace an interval...@>=
{
do {
- p=link(p); info(p)=m;
+ p=mp_link(p); mp_info(p)=m;
decr(mp->excess); if ( mp->excess==0 ) d=0;
- } while (value(link(p))<=l+d);
+ } while (value(mp_link(p))<=l+d);
v=l+halfp(value(p)-l);
if ( value(p)-v>mp->perturbation )
mp->perturbation=value(p)-v;
r=q;
do {
- r=link(r); value(r)=v;
+ r=mp_link(r); value(r)=v;
} while (r!=p);
- link(q)=p; /* remove duplicate values from the current list */
+ mp_link(q)=p; /* remove duplicate values from the current list */
}
@ A warning message is issued whenever something is perturbed by
more than 1/16\thinspace pt.
-@c void mp_tfm_warning (MP mp,small_number m) {
+@c
+static void mp_tfm_warning (MP mp,quarterword m) {
mp_print_nl(mp, "(some ");
mp_print(mp, mp->int_name[m]);
@.some charwds...@>
@@ -24143,7 +24816,7 @@ for (k=mp->bc;k<=mp->ec;k++) {
if ( mp->char_exists[k] )
mp->tfm_width[k]=mp_sort_in(mp, mp->tfm_width[k]);
}
-mp->nw=mp_skimp(mp, 255)+1; mp->dimen_head[1]=link(temp_head);
+mp->nw=mp_skimp(mp, 255)+1; mp->dimen_head[1]=mp_link(temp_head);
if ( mp->perturbation>=010000 ) mp_tfm_warning(mp, mp_char_wd)
@ @<Glob...@>=
@@ -24161,7 +24834,7 @@ for (k=mp->bc;k<=mp->ec;k++) {
else mp->tfm_height[k]=mp_sort_in(mp, mp->tfm_height[k]);
}
}
-mp->nh=mp_skimp(mp, 15)+1; mp->dimen_head[2]=link(temp_head);
+mp->nh=mp_skimp(mp, 15)+1; mp->dimen_head[2]=mp_link(temp_head);
if ( mp->perturbation>=010000 ) mp_tfm_warning(mp, mp_char_ht);
clear_the_list;
for (k=mp->bc;k<=mp->ec;k++) {
@@ -24170,7 +24843,7 @@ for (k=mp->bc;k<=mp->ec;k++) {
else mp->tfm_depth[k]=mp_sort_in(mp, mp->tfm_depth[k]);
}
}
-mp->nd=mp_skimp(mp, 15)+1; mp->dimen_head[3]=link(temp_head);
+mp->nd=mp_skimp(mp, 15)+1; mp->dimen_head[3]=mp_link(temp_head);
if ( mp->perturbation>=010000 ) mp_tfm_warning(mp, mp_char_dp);
clear_the_list;
for (k=mp->bc;k<=mp->ec;k++) {
@@ -24179,11 +24852,11 @@ for (k=mp->bc;k<=mp->ec;k++) {
else mp->tfm_ital_corr[k]=mp_sort_in(mp, mp->tfm_ital_corr[k]);
}
}
-mp->ni=mp_skimp(mp, 63)+1; mp->dimen_head[4]=link(temp_head);
+mp->ni=mp_skimp(mp, 63)+1; mp->dimen_head[4]=mp_link(temp_head);
if ( mp->perturbation>=010000 ) mp_tfm_warning(mp, mp_char_ic)
@ @<Initialize table entries...@>=
-value(zero_val)=0; info(zero_val)=0;
+value(zero_val)=0; mp_info(zero_val)=0;
@ Bytes 5--8 of the header are set to the design size, unless the user has
some crazy reason for specifying them differently.
@@ -24199,7 +24872,7 @@ $$\hbox{|make_scaled(16*max_tfm_dimen,internal[mp_design_size])|}
@d three_bytes 0100000000 /* $2^{24}$ */
@c
-void mp_fix_design_size (MP mp) {
+static void mp_fix_design_size (MP mp) {
scaled d; /* the design size */
d=mp->internal[mp_design_size];
if ( (d<unity)||(d>=fraction_half) ) {
@@ -24208,13 +24881,13 @@ void mp_fix_design_size (MP mp) {
@.illegal design size...@>
d=040000000; mp->internal[mp_design_size]=d;
}
- if ( mp->header_byte[4]<0 ) if ( mp->header_byte[5]<0 )
- if ( mp->header_byte[6]<0 ) if ( mp->header_byte[7]<0 ) {
+ if ( mp->header_byte[4]==0 && mp->header_byte[5]==0 &&
+ mp->header_byte[6]==0 && mp->header_byte[7]==0 ) {
mp->header_byte[4]=d / 04000000;
mp->header_byte[5]=(d / 4096) % 256;
mp->header_byte[6]=(d / 16) % 256;
mp->header_byte[7]=(d % 16)*16;
- };
+ }
mp->max_tfm_dimen=16*mp->internal[mp_design_size]-1-mp->internal[mp_design_size] / 010000000;
if ( mp->max_tfm_dimen>=fraction_half ) mp->max_tfm_dimen=fraction_half-1;
}
@@ -24223,7 +24896,8 @@ void mp_fix_design_size (MP mp) {
design size. If the data was out of range, it is corrected and the
global variable |tfm_changed| is increased by~one.
-@c integer mp_dimen_out (MP mp,scaled x) {
+@c
+static integer mp_dimen_out (MP mp,scaled x) {
if ( abs(x)>mp->max_tfm_dimen ) {
incr(mp->tfm_changed);
if ( x>0 ) x=mp->max_tfm_dimen; else x=-mp->max_tfm_dimen;
@@ -24241,15 +24915,16 @@ the |fix_check_sum| procedure replaces them by a ``check sum'' computed
from the |tfm_width| data relative to the design size.
@^check sum@>
-@c void mp_fix_check_sum (MP mp) {
+@c
+static void mp_fix_check_sum (MP mp) {
eight_bits k; /* runs through character codes */
eight_bits B1,B2,B3,B4; /* bytes of the check sum */
integer x; /* hash value used in check sum computation */
if ( mp->header_byte[0]==0 && mp->header_byte[1]==0 &&
mp->header_byte[2]==0 && mp->header_byte[3]==0 ) {
@<Compute a check sum in |(b1,b2,b3,b4)|@>;
- mp->header_byte[0]=B1; mp->header_byte[1]=B2;
- mp->header_byte[2]=B3; mp->header_byte[3]=B4;
+ mp->header_byte[0]=(char)B1; mp->header_byte[1]=(char)B2;
+ mp->header_byte[2]=(char)B3; mp->header_byte[3]=(char)B4;
return;
}
}
@@ -24259,25 +24934,27 @@ B1=mp->bc; B2=mp->ec; B3=mp->bc; B4=mp->ec; mp->tfm_changed=0;
for (k=mp->bc;k<=mp->ec;k++) {
if ( mp->char_exists[k] ) {
x=mp_dimen_out(mp, value(mp->tfm_width[k]))+(k+4)*020000000; /* this is positive */
- B1=(B1+B1+x) % 255;
- B2=(B2+B2+x) % 253;
- B3=(B3+B3+x) % 251;
- B4=(B4+B4+x) % 247;
+ B1=(eight_bits)((B1+B1+x) % 255);
+ B2=(eight_bits)((B2+B2+x) % 253);
+ B3=(eight_bits)((B3+B3+x) % 251);
+ B4=(eight_bits)((B4+B4+x) % 247);
}
+ if (k==mp->ec) break;
}
@ Finally we're ready to actually write the \.{TFM} information.
Here are some utility routines for this purpose.
@d tfm_out(A) do { /* output one byte to |tfm_file| */
- unsigned char s=(A);
+ unsigned char s=(unsigned char)(A);
(mp->write_binary_file)(mp,mp->tfm_file,(void *)&s,1);
} while (0)
-@c void mp_tfm_two (MP mp,integer x) { /* output two bytes to |tfm_file| */
+@c
+static void mp_tfm_two (MP mp,integer x) { /* output two bytes to |tfm_file| */
tfm_out(x / 256); tfm_out(x % 256);
}
-void mp_tfm_four (MP mp,integer x) { /* output four bytes to |tfm_file| */
+static void mp_tfm_four (MP mp,integer x) { /* output four bytes to |tfm_file| */
if ( x>=0 ) tfm_out(x / three_bytes);
else {
x=x+010000000000; /* use two's complement for negative values */
@@ -24288,7 +24965,7 @@ void mp_tfm_four (MP mp,integer x) { /* output four bytes to |tfm_file| */
x=x % unity; tfm_out(x / 0400);
tfm_out(x % 0400);
}
-void mp_tfm_qqqq (MP mp,four_quarters x) { /* output four quarterwords to |tfm_file| */
+static void mp_tfm_qqqq (MP mp,four_quarters x) { /* output four quarterwords to |tfm_file| */
tfm_out(qo(x.b0)); tfm_out(qo(x.b1));
tfm_out(qo(x.b2)); tfm_out(qo(x.b3));
}
@@ -24307,7 +24984,7 @@ mp->metric_file_name=xstrdup(mp->name_of_file);
if ( mp->internal[mp_tracing_stats]>0 )
@<Log the subfile sizes of the \.{TFM} file@>;
mp_print_nl(mp, "Font metrics written on ");
-mp_print(mp, mp->metric_file_name); mp_print_char(mp, '.');
+mp_print(mp, mp->metric_file_name); mp_print_char(mp, xord('.'));
@.Font metrics written...@>
(mp->close_file)(mp,mp->tfm_file)
@@ -24316,7 +24993,7 @@ this code.
@<Output the subfile sizes and header bytes@>=
k=mp->header_last;
-LH=(k+3) / 4; /* this is the number of header words */
+LH=(k+4) / 4; /* this is the number of header words */
if ( mp->bc>mp->ec ) mp->bc=1; /* if there are no characters, |ec=0| and |bc=1| */
@<Compute the ligature/kern program offset and implant the
left boundary label@>;
@@ -24337,9 +25014,9 @@ for (k=mp->bc;k<=mp->ec;k++) {
if ( ! mp->char_exists[k] ) {
mp_tfm_four(mp, 0);
} else {
- tfm_out(info(mp->tfm_width[k])); /* the width index */
- tfm_out((info(mp->tfm_height[k]))*16+info(mp->tfm_depth[k]));
- tfm_out((info(mp->tfm_ital_corr[k]))*4+mp->char_tag[k]);
+ tfm_out(mp_info(mp->tfm_width[k])); /* the width index */
+ tfm_out((mp_info(mp->tfm_height[k]))*16+mp_info(mp->tfm_depth[k]));
+ tfm_out((mp_info(mp->tfm_ital_corr[k]))*4+mp->char_tag[k]);
tfm_out(mp->char_remainder[k]);
};
}
@@ -24347,7 +25024,7 @@ mp->tfm_changed=0;
for (k=1;k<=4;k++) {
mp_tfm_four(mp, 0); p=mp->dimen_head[k];
while ( p!=inf_val ) {
- mp_tfm_four(mp, mp_dimen_out(mp, value(p))); p=link(p);
+ mp_tfm_four(mp, mp_dimen_out(mp, value(p))); p=mp_link(p);
}
}
@@ -24361,9 +25038,11 @@ starting addresses; we have $-1=|label_loc|[0]<|label_loc|[1]\le\cdots
@<Compute the ligature/kern program offset...@>=
mp->bchar=mp_round_unscaled(mp, mp->internal[mp_boundary_char]);
-if ((mp->bchar<0)||(mp->bchar>255))
- { mp->bchar=-1; mp->lk_started=false; lk_offset=0; }
-else { mp->lk_started=true; lk_offset=1; };
+if ((mp->bchar<0)||(mp->bchar>255)) {
+ mp->bchar=-1; mp->lk_started=false; lk_offset=0;
+} else {
+ mp->lk_started=true; lk_offset=1;
+}
@<Find the minimum |lk_offset| and adjust all remainders@>;
if ( mp->bch_label<undefined_label )
{ skip_byte(mp->nl)=qi(255); next_char(mp->nl)=qi(0);
@@ -24414,11 +25093,11 @@ if ( mp->lk_started ) { /* |lk_offset=1| for the special |bchar| */
} while (! (mp->label_loc[mp->label_ptr]<mp->ll));
}
}
-for (k=0;k<=mp->nl-1;k++) mp_tfm_qqqq(mp, mp->lig_kern[k]);
-for (k=0;k<=mp->nk-1;k++) mp_tfm_four(mp, mp_dimen_out(mp, mp->kern[k]))
+for (k=0;k<mp->nl;k++) mp_tfm_qqqq(mp, mp->lig_kern[k]);
+for (k=0;k<mp->nk;k++) mp_tfm_four(mp, mp_dimen_out(mp, mp->kern[k]))
@ @<Output the extensible character recipes...@>=
-for (k=0;k<=mp->ne-1;k++)
+for (k=0;k<mp->ne;k++)
mp_tfm_qqqq(mp, mp->exten[k]);
for (k=1;k<=mp->np;k++) {
if ( k==1 ) {
@@ -24449,7 +25128,7 @@ if ( mp->tfm_changed>0 ) {
char s[200];
wlog_ln(" ");
if ( mp->bch_label<undefined_label ) decr(mp->nl);
- snprintf(s,128,"(You used %iw,%ih,%id,%ii,%il,%ik,%ie,%ip metric file positions)",
+ mp_snprintf(s,128,"(You used %iw,%ih,%id,%ii,%il,%ik,%ie,%ip metric file positions)",
mp->nw, mp->nh, mp->nd, mp->ni, mp->nl, mp->nk, mp->ne,mp->np);
wlog_ln(s);
}
@@ -24482,7 +25161,7 @@ size_t font_mem_size; /* number of words for \.{TFM} information for text f
memory_word *font_info; /* height, width, and depth data */
char **font_enc_name; /* encoding names, if any */
boolean *font_ps_name_fixed; /* are the postscript names fixed already? */
-int next_fmem; /* next unused entry in |font_info| */
+size_t next_fmem; /* next unused entry in |font_info| */
font_number last_fnum; /* last font number used so far */
scaled *font_dsize; /* 16 times the ``design'' size in \ps\ points */
char **font_name; /* name as specified in the \&{infont} command */
@@ -24500,19 +25179,7 @@ pointer *font_sizes;
mp->font_mem_size = 10000;
mp->font_info = xmalloc ((mp->font_mem_size+1),sizeof(memory_word));
memset (mp->font_info,0,sizeof(memory_word)*(mp->font_mem_size+1));
-mp->font_enc_name = NULL;
-mp->font_ps_name_fixed = NULL;
-mp->font_dsize = NULL;
-mp->font_name = NULL;
-mp->font_ps_name = NULL;
-mp->font_bc = NULL;
-mp->font_ec = NULL;
mp->last_fnum = null_font;
-mp->char_base = NULL;
-mp->width_base = NULL;
-mp->height_base = NULL;
-mp->depth_base = NULL;
-mp->font_sizes = null;
@ @<Dealloc variables@>=
for (k=1;k<=(int)mp->last_fnum;k++) {
@@ -24560,7 +25227,7 @@ void mp_reallocate_fonts (MP mp, font_number l) {
mp->font_max = l;
}
-@ @<Declare |mp_reallocate| functions@>=
+@ @<Internal library declarations@>=
void mp_reallocate_fonts (MP mp, font_number l);
@@ -24597,200 +25264,22 @@ The corresponding words in the width, height, and depth tables are stored as
|scaled| values in units of \ps\ points.
With the macros below, the |char_info| word for character~|c| in font~|f| is
-|char_info(f)(c)| and the width is
-$$\hbox{|char_width(f)(char_info(f)(c)).sc|.}$$
-
-@d char_info_end(A) (A)].qqqq
-@d char_info(A) mp->font_info[mp->char_base[(A)]+char_info_end
-@d char_width_end(A) (A).b0].sc
-@d char_width(A) mp->font_info[mp->width_base[(A)]+char_width_end
-@d char_height_end(A) (A).b1].sc
-@d char_height(A) mp->font_info[mp->height_base[(A)]+char_height_end
-@d char_depth_end(A) (A).b2].sc
-@d char_depth(A) mp->font_info[mp->depth_base[(A)]+char_depth_end
-@d ichar_exists(A) ((A).b0>0)
-
-@ The |font_ps_name| for a built-in font should be what PostScript expects.
-A preliminary name is obtained here from the \.{TFM} name as given in the
-|fname| argument. This gets updated later from an external table if necessary.
+|char_mp_info(f,c)| and the width is
+$$\hbox{|char_width(f,char_mp_info(f,c)).sc|.}$$
-@<Declare text measuring subroutines@>=
-@<Declare subroutines for parsing file names@>
-font_number mp_read_font_info (MP mp, char *fname) {
- boolean file_opened; /* has |tfm_infile| been opened? */
- font_number n; /* the number to return */
- halfword lf,tfm_lh,bc,ec,nw,nh,nd; /* subfile size parameters */
- size_t whd_size; /* words needed for heights, widths, and depths */
- int i,ii; /* |font_info| indices */
- int jj; /* counts bytes to be ignored */
- scaled z; /* used to compute the design size */
- fraction d;
- /* height, width, or depth as a fraction of design size times $2^{-8}$ */
- eight_bits h_and_d; /* height and depth indices being unpacked */
- unsigned char tfbyte; /* a byte read from the file */
- n=null_font;
- @<Open |tfm_infile| for input@>;
- @<Read data from |tfm_infile|; if there is no room, say so and |goto done|;
- otherwise |goto bad_tfm| or |goto done| as appropriate@>;
-BAD_TFM:
- @<Complain that the \.{TFM} file is bad@>;
-DONE:
- if ( file_opened ) (mp->close_file)(mp,mp->tfm_infile);
- if ( n!=null_font ) {
- mp->font_ps_name[n]=mp_xstrdup(mp,fname);
- mp->font_name[n]=mp_xstrdup(mp,fname);
- }
- return n;
-}
-
-@ \MP\ doesn't bother to check the entire \.{TFM} file for errors or explain
-precisely what is wrong if it does find a problem. Programs called \.{TFtoPL}
-@.TFtoPL@> @.PLtoTF@>
-and \.{PLtoTF} can be used to debug \.{TFM} files.
-
-@<Complain that the \.{TFM} file is bad@>=
-print_err("Font ");
-mp_print(mp, fname);
-if ( file_opened ) mp_print(mp, " not usable: TFM file is bad");
-else mp_print(mp, " not usable: TFM file not found");
-help3("I wasn't able to read the size data for this font so this")
- ("`infont' operation won't produce anything. If the font name")
- ("is right, you might ask an expert to make a TFM file");
-if ( file_opened )
- mp->help_line[0]="is right, try asking an expert to fix the TFM file";
-mp_error(mp)
-
-@ @<Read data from |tfm_infile|; if there is no room, say so...@>=
-@<Read the \.{TFM} size fields@>;
-@<Use the size fields to allocate space in |font_info|@>;
-@<Read the \.{TFM} header@>;
-@<Read the character data and the width, height, and depth tables and
- |goto done|@>
-
-@ A bad \.{TFM} file can be shorter than it claims to be. The code given here
-might try to read past the end of the file if this happens. Changes will be
-needed if it causes a system error to refer to |tfm_infile^| or call
-|get_tfm_infile| when |eof(tfm_infile)| is true. For example, the definition
-@^system dependencies@>
-of |tfget| could be changed to
-``|begin get(tfm_infile); if eof(tfm_infile) then goto bad_tfm; end|.''
-
-@d tfget do {
- size_t wanted=1;
- void *tfbyte_ptr = &tfbyte;
- (mp->read_binary_file)(mp,mp->tfm_infile,&tfbyte_ptr,&wanted);
- if (wanted==0) goto BAD_TFM;
-} while (0)
-@d read_two(A) { (A)=tfbyte;
- if ( (A)>127 ) goto BAD_TFM;
- tfget; (A)=(A)*0400+tfbyte;
-}
-@d tf_ignore(A) { for (jj=(A);jj>=1;jj--) tfget; }
-
-@<Read the \.{TFM} size fields@>=
-tfget; read_two(lf);
-tfget; read_two(tfm_lh);
-tfget; read_two(bc);
-tfget; read_two(ec);
-if ( (bc>1+ec)||(ec>255) ) goto BAD_TFM;
-tfget; read_two(nw);
-tfget; read_two(nh);
-tfget; read_two(nd);
-whd_size=(ec+1-bc)+nw+nh+nd;
-if ( lf<(int)(6+tfm_lh+whd_size) ) goto BAD_TFM;
-tf_ignore(10)
-
-@ Offsets are added to |char_base[n]| and |width_base[n]| so that is not
-necessary to apply the |so| and |qo| macros when looking up the width of a
-character in the string pool. In order to ensure nonnegative |char_base|
-values when |bc>0|, it may be necessary to reserve a few unused |font_info|
-elements.
-
-@<Use the size fields to allocate space in |font_info|@>=
-if ( mp->next_fmem<bc) mp->next_fmem=bc; /* ensure nonnegative |char_base| */
-if (mp->last_fnum==mp->font_max)
- mp_reallocate_fonts(mp,(mp->font_max+(mp->font_max>>2)));
-while (mp->next_fmem+whd_size>=mp->font_mem_size) {
- size_t l = mp->font_mem_size+(mp->font_mem_size>>2);
- memory_word *font_info;
- font_info = xmalloc ((l+1),sizeof(memory_word));
- memset (font_info,0,sizeof(memory_word)*(l+1));
- memcpy (font_info,mp->font_info,sizeof(memory_word)*(mp->font_mem_size+1));
- xfree(mp->font_info);
- mp->font_info = font_info;
- mp->font_mem_size = l;
-}
-incr(mp->last_fnum);
-n=mp->last_fnum;
-mp->font_bc[n]=bc;
-mp->font_ec[n]=ec;
-mp->char_base[n]=mp->next_fmem-bc;
-mp->width_base[n]=mp->next_fmem+ec-bc+1;
-mp->height_base[n]=mp->width_base[n]+nw;
-mp->depth_base[n]=mp->height_base[n]+nh;
-mp->next_fmem=mp->next_fmem+whd_size;
-
-
-@ @<Read the \.{TFM} header@>=
-if ( tfm_lh<2 ) goto BAD_TFM;
-tf_ignore(4);
-tfget; read_two(z);
-tfget; z=z*0400+tfbyte;
-tfget; z=z*0400+tfbyte; /* now |z| is 16 times the design size */
-mp->font_dsize[n]=mp_take_fraction(mp, z,267432584);
- /* times ${72\over72.27}2^{28}$ to convert from \TeX\ points */
-tf_ignore(4*(tfm_lh-2))
-
-@ @<Read the character data and the width, height, and depth tables...@>=
-ii=mp->width_base[n];
-i=mp->char_base[n]+bc;
-while ( i<ii ) {
- tfget; mp->font_info[i].qqqq.b0=qi(tfbyte);
- tfget; h_and_d=tfbyte;
- mp->font_info[i].qqqq.b1=h_and_d / 16;
- mp->font_info[i].qqqq.b2=h_and_d % 16;
- tfget; tfget;
- incr(i);
-}
-while ( i<mp->next_fmem ) {
- @<Read a four byte dimension, scale it by the design size, store it in
- |font_info[i]|, and increment |i|@>;
-}
-goto DONE
-
-@ The raw dimension read into |d| should have magnitude at most $2^{24}$ when
-interpreted as an integer, and this includes a scale factor of $2^{20}$. Thus
-we can multiply it by sixteen and think of it as a |fraction| that has been
-divided by sixteen. This cancels the extra scale factor contained in
-|font_dsize[n|.
-
-@<Read a four byte dimension, scale it by the design size, store it in...@>=
-{
-tfget; d=tfbyte;
-if ( d>=0200 ) d=d-0400;
-tfget; d=d*0400+tfbyte;
-tfget; d=d*0400+tfbyte;
-tfget; d=d*0400+tfbyte;
-mp->font_info[i].sc=mp_take_fraction(mp, d*16,mp->font_dsize[n]);
-incr(i);
-}
-
-@ This function does no longer use the file name parser, because |fname| is
-a C string already.
-@<Open |tfm_infile| for input@>=
-file_opened=false;
-mp_ptr_scan_file(mp, fname);
-if ( strlen(mp->cur_area)==0 ) { xfree(mp->cur_area); }
-if ( strlen(mp->cur_ext)==0 ) { xfree(mp->cur_ext); mp->cur_ext=xstrdup(".tfm"); }
-pack_cur_name;
-mp->tfm_infile = (mp->open_file)(mp, mp->name_of_file, "r",mp_filetype_metrics);
-if ( !mp->tfm_infile ) goto BAD_TFM;
-file_opened=true
+@d char_mp_info(A,B) mp->font_info[mp->char_base[(A)]+(B)].qqqq
+@d char_width(A,B) mp->font_info[mp->width_base[(A)]+(B).b0].sc
+@d char_height(A,B) mp->font_info[mp->height_base[(A)]+(B).b1].sc
+@d char_depth(A,B) mp->font_info[mp->depth_base[(A)]+(B).b2].sc
+@d ichar_exists(A) ((A).b0>0)
@ When we have a font name and we don't know whether it has been loaded yet,
we scan the |font_name| array before calling |read_font_info|.
-@<Declare text measuring subroutines@>=
+@<Declarations@>=
+static font_number mp_find_font (MP mp, char *f) ;
+
+@ @c
font_number mp_find_font (MP mp, char *f) {
font_number n;
for (n=0;n<=mp->last_fnum;n++) {
@@ -24804,6 +25293,38 @@ font_number mp_find_font (MP mp, char *f) {
return n;
}
+@ This is an interface function for getting the width of character,
+as a double in ps units
+
+@c double mp_get_char_dimension (MP mp, char *fname, int c, int t) {
+ unsigned n;
+ four_quarters cc;
+ font_number f = 0;
+ double w = -1.0;
+ for (n=0;n<=mp->last_fnum;n++) {
+ if (mp_xstrcmp(fname,mp->font_name[n])==0 ) {
+ f = n;
+ break;
+ }
+ }
+ if (f==0)
+ return 0.0;
+ cc = char_mp_info(f,c);
+ if (! ichar_exists(cc) )
+ return 0.0;
+ if (t=='w')
+ w = (double)char_width(f,cc);
+ else if (t=='h')
+ w = (double)char_height(f,cc);
+ else if (t=='d')
+ w = (double)char_depth(f,cc);
+ return w/655.35*(72.27/72);
+}
+
+@ @<Exported function ...@>=
+double mp_get_char_dimension (MP mp, char *fname, int n, int t);
+
+
@ One simple application of |find_font| is the implementation of the |font_size|
operator that gets the design size for a given font name.
@@ -24814,7 +25335,10 @@ mp_flush_cur_exp(mp, (mp->font_dsize[mp_find_font(mp, str(mp->cur_exp))]+8) / 16
from the bounding box computation and expect the \ps\ interpreter to drop it.
This routine issues a warning message if the user has asked for it.
-@<Declare text measuring subroutines@>=
+@<Declarations@>=
+static void mp_lost_warning (MP mp,font_number f, pool_pointer k);
+
+@ @c
void mp_lost_warning (MP mp,font_number f, pool_pointer k) {
if ( mp->internal[mp_tracing_lost_chars]>0 ) {
mp_begin_diagnostic(mp);
@@ -24823,7 +25347,7 @@ void mp_lost_warning (MP mp,font_number f, pool_pointer k) {
@.Missing character@>
mp_print_str(mp, mp->str_pool[k]);
mp_print(mp, " in font ");
- mp_print(mp, mp->font_name[f]); mp_print_char(mp, '!');
+ mp_print(mp, mp->font_name[f]); mp_print_char(mp, xord('!'));
mp_end_diagnostic(mp, false);
}
}
@@ -24832,9 +25356,12 @@ void mp_lost_warning (MP mp,font_number f, pool_pointer k) {
able to find the bounding box of an item of text in an edge structure. The
|set_text_box| procedure takes a text node and adds this information.
-@<Declare text measuring subroutines@>=
+@<Declarations@>=
+static void mp_set_text_box (MP mp,pointer p);
+
+@ @c
void mp_set_text_box (MP mp,pointer p) {
- font_number f; /* |font_n(p)| */
+ font_number f; /* |mp_font_n(p)| */
ASCII_code bc,ec; /* range of valid characters for font |f| */
pool_pointer k,kk; /* current character and character to stop at */
four_quarters cc; /* the |char_info| for the current character */
@@ -24842,11 +25369,11 @@ void mp_set_text_box (MP mp,pointer p) {
width_val(p)=0;
height_val(p)=-el_gordo;
depth_val(p)=-el_gordo;
- f=font_n(p);
+ f=(font_number)mp_font_n(p);
bc=mp->font_bc[f];
ec=mp->font_ec[f];
- kk=str_stop(text_p(p));
- k=mp->str_start[text_p(p)];
+ kk=str_stop(mp_text_p(p));
+ k=mp->str_start[mp_text_p(p)];
while ( k<kk ) {
@<Adjust |p|'s bounding box to contain |str_pool[k]|; advance |k|@>;
}
@@ -24858,13 +25385,13 @@ void mp_set_text_box (MP mp,pointer p) {
if ( (mp->str_pool[k]<bc)||(mp->str_pool[k]>ec) ) {
mp_lost_warning(mp, f,k);
} else {
- cc=char_info(f)(mp->str_pool[k]);
+ cc=char_mp_info(f,mp->str_pool[k]);
if ( ! ichar_exists(cc) ) {
mp_lost_warning(mp, f,k);
} else {
- width_val(p)=width_val(p)+char_width(f)(cc);
- h=char_height(f)(cc);
- d=char_depth(f)(cc);
+ width_val(p)=width_val(p)+char_width(f,cc);
+ h=char_height(f,cc);
+ d=char_depth(f,cc);
if ( h>height_val(p) ) height_val(p)=h;
if ( d>depth_val(p) ) depth_val(p)=d;
}
@@ -24884,10 +25411,11 @@ if ( height_val(p)<-depth_val(p) ) {
@ The new primitives fontmapfile and fontmapline.
@<Declare action procedures for use by |do_statement|@>=
-void mp_do_mapfile (MP mp) ;
-void mp_do_mapline (MP mp) ;
+static void mp_do_mapfile (MP mp) ;
+static void mp_do_mapline (MP mp) ;
-@ @c void mp_do_mapfile (MP mp) {
+@ @c
+static void mp_do_mapfile (MP mp) {
mp_get_x_next(mp); mp_scan_expression(mp);
if ( mp->cur_type!=mp_string_type ) {
@<Complain about improper map operation@>;
@@ -24895,7 +25423,7 @@ void mp_do_mapline (MP mp) ;
mp_map_file(mp,mp->cur_exp);
}
}
-void mp_do_mapline (MP mp) {
+static void mp_do_mapline (MP mp) {
mp_get_x_next(mp); mp_scan_expression(mp);
if ( mp->cur_type!=mp_string_type ) {
@<Complain about improper map operation@>;
@@ -24972,9 +25500,10 @@ etcetera to make it worthwile to move the code to |psout.w|.
void mp_open_output_file (MP mp) ;
@ @c
-char *mp_set_output_file_name (MP mp, integer c) {
+static char *mp_set_output_file_name (MP mp, integer c) {
char *ss = NULL; /* filename extension proposal */
- int old_setting; /* previous |selector| setting */
+ char *nn = NULL; /* temp string for str() */
+ unsigned old_setting; /* previous |selector| setting */
pool_pointer i; /* indexes into |filename_template| */
integer cc; /* a temporary integer for template building */
integer f,g=0; /* field widths */
@@ -24986,14 +25515,15 @@ char *mp_set_output_file_name (MP mp, integer c) {
else
@<Use |c| to compute the file extension |s|@>;
mp_pack_job_name(mp, s);
- ss = s ;
+ free(s);
+ ss = xstrdup(mp->name_of_file);
} else { /* initializations */
str_number s, n; /* a file extension derived from |c| */
old_setting=mp->selector;
mp->selector=new_string;
f = 0;
i = mp->str_start[mp->filename_template];
- n = rts(""); /* initialize */
+ n = null_str; /* initialize */
while ( i<str_stop(mp->filename_template) ) {
if ( mp->str_pool[i]=='%' ) {
CONTINUE:
@@ -25035,29 +25565,31 @@ char *mp_set_output_file_name (MP mp, integer c) {
mp_print_str(mp, mp->str_pool[i]);
};
incr(i);
- };
+ }
s = mp_make_string(mp);
mp->selector= old_setting;
if (length(n)==0) {
n=s;
- s=rts("");
- };
- mp_pack_file_name(mp, str(n),"",str(s));
+ s=null_str;
+ }
+ ss = str(s);
+ nn = str(n);
+ mp_pack_file_name(mp, nn,"",ss);
+ free(nn);
delete_str_ref(n);
- ss = str(s);
delete_str_ref(s);
}
return ss;
}
-char * mp_get_output_file_name (MP mp) {
- char *fname; /* return value */
+static char * mp_get_output_file_name (MP mp) {
+ char *f;
char *saved_name; /* saved |name_of_file| */
- saved_name = mp_xstrdup(mp, mp->name_of_file);
- (void)mp_set_output_file_name(mp, mp_round_unscaled(mp, mp->internal[mp_char_code]));
- fname = mp_xstrdup(mp, mp->name_of_file);
+ saved_name = xstrdup(mp->name_of_file);
+ f = xstrdup(mp_set_output_file_name(mp, mp_round_unscaled(mp, mp->internal[mp_char_code])));
mp_pack_file_name(mp, saved_name,NULL,NULL);
- return fname;
+ free(saved_name);
+ return f;
}
void mp_open_output_file (MP mp) {
@@ -25078,7 +25610,7 @@ extreme cases so it may have to be shortened on some systems.
@<Use |c| to compute the file extension |s|@>=
{
s = xmalloc(7,1);
- snprintf(s,7,".%i",(int)c);
+ mp_snprintf(s,7,".%i",(int)c);
}
@ The user won't want to see all the output file names so we only save the
@@ -25119,12 +25651,12 @@ xfree(mp->last_file_name);
@ @<Begin the progress report for the output of picture~|c|@>=
if ( (int)mp->term_offset>mp->max_print_line-6 ) mp_print_ln(mp);
-else if ( (mp->term_offset>0)||(mp->file_offset>0) ) mp_print_char(mp, ' ');
-mp_print_char(mp, '[');
+else if ( (mp->term_offset>0)||(mp->file_offset>0) ) mp_print_char(mp, xord(' '));
+mp_print_char(mp, xord('['));
if ( c>=0 ) mp_print_int(mp, c)
@ @<End progress report@>=
-mp_print_char(mp, ']');
+mp_print_char(mp, xord(']'));
update_terminal;
incr(mp->total_shipped)
@@ -25132,16 +25664,22 @@ incr(mp->total_shipped)
if ( mp->total_shipped>0 ) {
mp_print_nl(mp, "");
mp_print_int(mp, mp->total_shipped);
- mp_print(mp, " output file");
- if ( mp->total_shipped>1 ) mp_print_char(mp, 's');
- mp_print(mp, " written: ");
- mp_print(mp, mp->first_file_name);
- if ( mp->total_shipped>1 ) {
- if ( 31+strlen(mp->first_file_name)+
+ if (mp->noninteractive) {
+ mp_print(mp, " figure");
+ if ( mp->total_shipped>1 ) mp_print_char(mp, xord('s'));
+ mp_print(mp, " created.");
+ } else {
+ mp_print(mp, " output file");
+ if ( mp->total_shipped>1 ) mp_print_char(mp, xord('s'));
+ mp_print(mp, " written: ");
+ mp_print(mp, mp->first_file_name);
+ if ( mp->total_shipped>1 ) {
+ if ( 31+strlen(mp->first_file_name)+
strlen(mp->last_file_name)> (unsigned)mp->max_print_line)
- mp_print_ln(mp);
- mp_print(mp, " .. ");
- mp_print(mp, mp->last_file_name);
+ mp_print_ln(mp);
+ mp_print(mp, " .. ");
+ mp_print(mp, mp->last_file_name);
+ }
}
}
@@ -25170,16 +25708,16 @@ case special_command:
break;
@ @<Declare action procedures for use by |do_statement|@>=
-void mp_do_special (MP mp) ;
+static void mp_do_special (MP mp) ;
@ @c void mp_do_special (MP mp) {
mp_get_x_next(mp); mp_scan_expression(mp);
if ( mp->cur_type!=mp_string_type ) {
@<Complain about improper special operation@>;
} else {
- link(mp->last_pending)=mp_stash_cur_exp(mp);
- mp->last_pending=link(mp->last_pending);
- link(mp->last_pending)=null;
+ mp_link(mp->last_pending)=mp_stash_cur_exp(mp);
+ mp->last_pending=mp_link(mp->last_pending);
+ mp_link(mp->last_pending)=null;
}
}
@@ -25196,7 +25734,7 @@ void mp_do_special (MP mp) ;
mp_special_code=8,
@ @<Export pending specials@>=
-p=link(spec_head);
+p=mp_link(spec_head);
while ( p!=null ) {
mp_special_object *tp;
tp = (mp_special_object *)mp_new_graphic_object(mp,mp_special_code);
@@ -25204,29 +25742,29 @@ while ( p!=null ) {
if (hh->body==NULL) hh->body = (mp_graphic_object *)tp;
else gr_link(hp) = (mp_graphic_object *)tp;
hp = (mp_graphic_object *)tp;
- p=link(p);
+ p=mp_link(p);
}
-mp_flush_token_list(mp, link(spec_head));
-link(spec_head)=null;
+mp_flush_token_list(mp, mp_link(spec_head));
+mp_link(spec_head)=null;
mp->last_pending=spec_head
@ We are now ready for the main output procedure. Note that the |selector|
setting is saved in a global variable so that |begin_diagnostic| can access it.
@<Declare the \ps\ output procedures@>=
-void mp_ship_out (MP mp, pointer h) ;
+static void mp_ship_out (MP mp, pointer h) ;
@ Once again, the |gr_XXXX| macros are defined in |mppsout.h|
@d export_color(q,p)
- if ( color_model(p)==mp_uninitialized_model ) {
- gr_color_model(q) = (mp->internal[mp_default_color_model]>>16);
+ if ( mp_color_model(p)==mp_uninitialized_model ) {
+ gr_color_model(q) = (unsigned char)(mp->internal[mp_default_color_model]/65536);
gr_cyan_val(q) = 0;
gr_magenta_val(q) = 0;
gr_yellow_val(q) = 0;
gr_black_val(q) = (gr_color_model(q)==mp_cmyk_model ? unity : 0);
} else {
- gr_color_model(q) = color_model(p);
+ gr_color_model(q) = (unsigned char)mp_color_model(p);
gr_cyan_val(q) = cyan_val(p);
gr_magenta_val(q) = magenta_val(p);
gr_yellow_val(q) = yellow_val(p);
@@ -25234,92 +25772,100 @@ void mp_ship_out (MP mp, pointer h) ;
}
@d export_scripts(q,p)
- if (pre_script(p)!=null) gr_pre_script(q) = str(pre_script(p));
- if (post_script(p)!=null) gr_post_script(q) = str(post_script(p));
+ if (mp_pre_script(p)!=null) gr_pre_script(q) = str(mp_pre_script(p));
+ if (mp_post_script(p)!=null) gr_post_script(q) = str(mp_post_script(p));
@c
struct mp_edge_object *mp_gr_export(MP mp, pointer h) {
pointer p; /* the current graphical object */
integer t; /* a temporary value */
+ integer c; /* a rounded charcode */
scaled d_width; /* the current pen width */
mp_edge_object *hh; /* the first graphical object */
- struct mp_graphic_object *hq; /* something |hp| points to */
- struct mp_text_object *tt;
- struct mp_fill_object *tf;
- struct mp_stroked_object *ts;
- struct mp_clip_object *tc;
- struct mp_bounds_object *tb;
- struct mp_graphic_object *hp = NULL; /* the current graphical object */
+ mp_graphic_object *hq; /* something |hp| points to */
+ mp_text_object *tt;
+ mp_fill_object *tf;
+ mp_stroked_object *ts;
+ mp_clip_object *tc;
+ mp_bounds_object *tb;
+ mp_graphic_object *hp = NULL; /* the current graphical object */
mp_set_bbox(mp, h, true);
- hh = mp_xmalloc(mp,1,sizeof(mp_edge_object));
+ hh = xmalloc(1,sizeof(mp_edge_object));
hh->body = NULL;
- hh->_next = NULL;
- hh->_parent = mp;
- hh->_minx = minx_val(h);
- hh->_miny = miny_val(h);
- hh->_maxx = maxx_val(h);
- hh->_maxy = maxy_val(h);
- hh->_filename = mp_get_output_file_name(mp);
+ hh->next = NULL;
+ hh->parent = mp;
+ hh->minx = minx_val(h);
+ hh->miny = miny_val(h);
+ hh->maxx = maxx_val(h);
+ hh->maxy = maxy_val(h);
+ hh->filename = mp_get_output_file_name(mp);
+ c = mp_round_unscaled(mp,mp->internal[mp_char_code]);
+ hh->charcode = c;
+ hh->width = mp->internal[mp_char_wd];
+ hh->height = mp->internal[mp_char_ht];
+ hh->depth = mp->internal[mp_char_dp];
+ hh->ital_corr = mp->internal[mp_char_ic];
@<Export pending specials@>;
- p=link(dummy_loc(h));
+ p=mp_link(dummy_loc(h));
while ( p!=null ) {
- hq = mp_new_graphic_object(mp,type(p));
- switch (type(p)) {
+ hq = mp_new_graphic_object(mp,mp_type(p));
+ switch (mp_type(p)) {
case mp_fill_code:
tf = (mp_fill_object *)hq;
- gr_pen_p(tf) = mp_export_knot_list(mp,pen_p(p));
- d_width = mp_get_pen_scale(mp, pen_p(p));
- if ((pen_p(p)==null) || pen_is_elliptical(pen_p(p))) {
- gr_path_p(tf) = mp_export_knot_list(mp,path_p(p));
+ gr_pen_p(tf) = mp_export_knot_list(mp,mp_pen_p(p));
+ d_width = mp_get_pen_scale(mp, mp_pen_p(p));
+ if ((mp_pen_p(p)==null) || pen_is_elliptical(mp_pen_p(p))) {
+ gr_path_p(tf) = mp_export_knot_list(mp,mp_path_p(p));
} else {
pointer pc, pp;
- pc = mp_copy_path(mp, path_p(p));
- pp = mp_make_envelope(mp, pc, pen_p(p),ljoin_val(p),0,miterlim_val(p));
+ pc = mp_copy_path(mp, mp_path_p(p));
+ pp = mp_make_envelope(mp, pc, mp_pen_p(p),ljoin_val(p),0,miterlim_val(p));
gr_path_p(tf) = mp_export_knot_list(mp,pp);
mp_toss_knot_list(mp, pp);
- pc = mp_htap_ypoc(mp, path_p(p));
- pp = mp_make_envelope(mp, pc, pen_p(p),ljoin_val(p),0,miterlim_val(p));
+ pc = mp_htap_ypoc(mp, mp_path_p(p));
+ pp = mp_make_envelope(mp, pc, mp_pen_p(p),ljoin_val(p),0,miterlim_val(p));
gr_htap_p(tf) = mp_export_knot_list(mp,pp);
mp_toss_knot_list(mp, pp);
}
export_color(tf,p) ;
export_scripts(tf,p);
- gr_ljoin_val(tf) = ljoin_val(p);
+ gr_ljoin_val(tf) = (unsigned char)ljoin_val(p);
gr_miterlim_val(tf) = miterlim_val(p);
break;
case mp_stroked_code:
ts = (mp_stroked_object *)hq;
- gr_pen_p(ts) = mp_export_knot_list(mp,pen_p(p));
- d_width = mp_get_pen_scale(mp, pen_p(p));
- if (pen_is_elliptical(pen_p(p))) {
- gr_path_p(ts) = mp_export_knot_list(mp,path_p(p));
+ gr_pen_p(ts) = mp_export_knot_list(mp,mp_pen_p(p));
+ d_width = mp_get_pen_scale(mp, mp_pen_p(p));
+ if (pen_is_elliptical(mp_pen_p(p))) {
+ gr_path_p(ts) = mp_export_knot_list(mp,mp_path_p(p));
} else {
pointer pc;
- pc=mp_copy_path(mp, path_p(p));
+ pc=mp_copy_path(mp, mp_path_p(p));
t=lcap_val(p);
- if ( left_type(pc)!=mp_endpoint ) {
- left_type(mp_insert_knot(mp, pc,x_coord(pc),y_coord(pc)))=mp_endpoint;
- right_type(pc)=mp_endpoint;
- pc=link(pc);
+ if ( mp_left_type(pc)!=mp_endpoint ) {
+ mp_left_type(mp_insert_knot(mp, pc,mp_x_coord(pc),mp_y_coord(pc)))=mp_endpoint;
+ mp_right_type(pc)=mp_endpoint;
+ pc=mp_link(pc);
t=1;
}
- pc=mp_make_envelope(mp,pc,pen_p(p),ljoin_val(p),t,miterlim_val(p));
+ pc=mp_make_envelope(mp,pc,mp_pen_p(p),ljoin_val(p),t,miterlim_val(p));
gr_path_p(ts) = mp_export_knot_list(mp,pc);
mp_toss_knot_list(mp, pc);
}
export_color(ts,p) ;
export_scripts(ts,p);
- gr_ljoin_val(ts) = ljoin_val(p);
+ gr_ljoin_val(ts) = (unsigned char)ljoin_val(p);
gr_miterlim_val(ts) = miterlim_val(p);
- gr_lcap_val(ts) = lcap_val(p);
+ gr_lcap_val(ts) = (unsigned char)lcap_val(p);
gr_dash_p(ts) = mp_export_dashes(mp,p,&d_width);
break;
case mp_text_code:
tt = (mp_text_object *)hq;
- gr_text_p(tt) = str(text_p(p));
- gr_font_n(tt) = font_n(p);
- gr_font_name(tt) = mp_xstrdup(mp,mp->font_name[font_n(p)]);
- gr_font_dsize(tt) = mp->font_dsize[font_n(p)];
+ gr_text_p(tt) = str(mp_text_p(p));
+ gr_text_l(tt) = (size_t)length(mp_text_p(p));
+ gr_font_n(tt) = (unsigned int)mp_font_n(p);
+ gr_font_name(tt) = mp_xstrdup(mp,mp->font_name[mp_font_n(p)]);
+ gr_font_dsize(tt) = (unsigned int)mp->font_dsize[mp_font_n(p)];
export_color(tt,p) ;
export_scripts(tt,p);
gr_width_val(tt) = width_val(p);
@@ -25334,11 +25880,11 @@ struct mp_edge_object *mp_gr_export(MP mp, pointer h) {
break;
case mp_start_clip_code:
tc = (mp_clip_object *)hq;
- gr_path_p(tc) = mp_export_knot_list(mp,path_p(p));
+ gr_path_p(tc) = mp_export_knot_list(mp,mp_path_p(p));
break;
case mp_start_bounds_code:
tb = (mp_bounds_object *)hq;
- gr_path_p(tb) = mp_export_knot_list(mp,path_p(p));
+ gr_path_p(tb) = mp_export_knot_list(mp,mp_path_p(p));
break;
case mp_stop_clip_code:
case mp_stop_bounds_code:
@@ -25347,13 +25893,13 @@ struct mp_edge_object *mp_gr_export(MP mp, pointer h) {
}
if (hh->body==NULL) hh->body=hq; else gr_link(hp) = hq;
hp = hq;
- p=link(p);
+ p=mp_link(p);
}
return hh;
}
-@ @<Exported function ...@>=
-struct mp_edge_object *mp_gr_export(MP mp, int h);
+@ @<Declarations@>=
+static struct mp_edge_object *mp_gr_export(MP mp, int h);
@ This function is now nearly trivial.
@@ -25369,15 +25915,16 @@ void mp_ship_out (MP mp, pointer h) { /* output edge structure |h| */
}
@ @<Declarations@>=
-void mp_shipout_backend (MP mp, pointer h);
+static void mp_shipout_backend (MP mp, pointer h);
@ @c
void mp_shipout_backend (MP mp, pointer h) {
mp_edge_object *hh; /* the first graphical object */
hh = mp_gr_export(mp,h);
- mp_gr_ship_out (hh,
- (mp->internal[mp_prologues]>>16),
- (mp->internal[mp_procset]>>16));
+ (void)mp_gr_ship_out (hh,
+ (mp->internal[mp_prologues]/65536),
+ (mp->internal[mp_procset]/65536),
+ false);
mp_gr_toss_objects(hh);
}
@@ -25387,9 +25934,6 @@ typedef void (*mp_backend_writer)(MP, int);
@ @<Option variables@>=
mp_backend_writer shipout_backend;
-@ @<Allocate or initialize ...@>=
-set_callback_option(shipout_backend);
-
@ Now that we've finished |ship_out|, let's look at the other commands
by which a user can send things to the \.{GF} file.
@@ -25430,6 +25974,7 @@ before \MP's tables are loaded.
@<Glob...@>=
char * mem_ident;
+void * mem_file; /* for input or output of mem information */
@ @<Set init...@>=
mp->mem_ident=NULL;
@@ -25437,357 +25982,14 @@ mp->mem_ident=NULL;
@ @<Initialize table entries...@>=
mp->mem_ident=xstrdup(" (INIMP)");
-@ @<Declare act...@>=
-void mp_store_mem_file (MP mp) ;
-
-@ @c void mp_store_mem_file (MP mp) {
- integer k; /* all-purpose index */
- pointer p,q; /* all-purpose pointers */
- integer x; /* something to dump */
- four_quarters w; /* four ASCII codes */
- memory_word WW;
- @<Create the |mem_ident|, open the mem file,
- and inform the user that dumping has begun@>;
- @<Dump constants for consistency check@>;
- @<Dump the string pool@>;
- @<Dump the dynamic memory@>;
- @<Dump the table of equivalents and the hash table@>;
- @<Dump a few more things and the closing check word@>;
- @<Close the mem file@>;
-}
-
-@ Corresponding to the procedure that dumps a mem file, we also have a function
-that reads~one~in. The function returns |false| if the dumped mem is
-incompatible with the present \MP\ table sizes, etc.
-
-@d off_base 6666 /* go here if the mem file is unacceptable */
-@d too_small(A) { wake_up_terminal;
- wterm_ln("---! Must increase the "); wterm((A));
-@.Must increase the x@>
- goto OFF_BASE;
- }
-
-@c
-boolean mp_load_mem_file (MP mp) {
- integer k; /* all-purpose index */
- pointer p,q; /* all-purpose pointers */
- integer x; /* something undumped */
- str_number s; /* some temporary string */
- four_quarters w; /* four ASCII codes */
- memory_word WW;
- @<Undump constants for consistency check@>;
- @<Undump the string pool@>;
- @<Undump the dynamic memory@>;
- @<Undump the table of equivalents and the hash table@>;
- @<Undump a few more things and the closing check word@>;
- return true; /* it worked! */
-OFF_BASE:
- wake_up_terminal;
- wterm_ln("(Fatal mem file error; I'm stymied)\n");
-@.Fatal mem file error@>
- return false;
-}
-
@ @<Declarations@>=
-boolean mp_load_mem_file (MP mp) ;
-
-@ Mem files consist of |memory_word| items, and we use the following
-macros to dump words of different types:
-
-@d dump_wd(A) { WW=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); }
-@d dump_int(A) { int cint=(A); (mp->write_binary_file)(mp,mp->mem_file,&cint,sizeof(cint)); }
-@d dump_hh(A) { WW.hh=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); }
-@d dump_qqqq(A) { WW.qqqq=(A); (mp->write_binary_file)(mp,mp->mem_file,&WW,sizeof(WW)); }
-@d dump_string(A) { dump_int(strlen(A)+1);
- (mp->write_binary_file)(mp,mp->mem_file,A,strlen(A)+1); }
-
-@<Glob...@>=
-void * mem_file; /* for input or output of mem information */
-
-@ The inverse macros are slightly more complicated, since we need to check
-the range of the values we are reading in. We say `|undump(a)(b)(x)|' to
-read an integer value |x| that is supposed to be in the range |a<=x<=b|.
-
-@d mgeti(A) do {
- size_t wanted = sizeof(A);
- void *A_ptr = &A;
- (mp->read_binary_file)(mp, mp->mem_file,&A_ptr,&wanted);
- if (wanted!=sizeof(A)) goto OFF_BASE;
-} while (0)
-
-@d mgetw(A) do {
- size_t wanted = sizeof(A);
- void *A_ptr = &A;
- (mp->read_binary_file)(mp, mp->mem_file,&A_ptr,&wanted);
- if (wanted!=sizeof(A)) goto OFF_BASE;
-} while (0)
-
-@d undump_wd(A) { mgetw(WW); A=WW; }
-@d undump_int(A) { int cint; mgeti(cint); A=cint; }
-@d undump_hh(A) { mgetw(WW); A=WW.hh; }
-@d undump_qqqq(A) { mgetw(WW); A=WW.qqqq; }
-@d undump_strings(A,B,C) {
- undump_int(x); if ( (x<(A)) || (x>(B)) ) goto OFF_BASE; else C=str(x); }
-@d undump(A,B,C) { undump_int(x); if ( (x<(A)) || (x>(int)(B)) ) goto OFF_BASE; else C=x; }
-@d undump_size(A,B,C,D) { undump_int(x);
- if (x<(A)) goto OFF_BASE;
- if (x>(B)) { too_small((C)); } else { D=x;} }
-@d undump_string(A) do {
- size_t the_wanted;
- void *the_string;
- integer XX=0;
- undump_int(XX);
- the_wanted = XX;
- the_string = xmalloc(XX,sizeof(char));
- (mp->read_binary_file)(mp,mp->mem_file,&the_string,&the_wanted);
- A = (char *)the_string;
- if (the_wanted!=(size_t)XX) goto OFF_BASE;
-} while (0)
-
-@ The next few sections of the program should make it clear how we use the
-dump/undump macros.
-
-@<Dump constants for consistency check@>=
-dump_int(mp->mem_top);
-dump_int(mp->hash_size);
-dump_int(mp->hash_prime)
-dump_int(mp->param_size);
-dump_int(mp->max_in_open);
-
-@ Sections of a \.{WEB} program that are ``commented out'' still contribute
-strings to the string pool; therefore \.{INIMP} and \MP\ will have
-the same strings. (And it is, of course, a good thing that they do.)
-@.WEB@>
-@^string pool@>
-
-@<Undump constants for consistency check@>=
-undump_int(x); mp->mem_top = x;
-undump_int(x); if (mp->hash_size != x) goto OFF_BASE;
-undump_int(x); if (mp->hash_prime != x) goto OFF_BASE;
-undump_int(x); if (mp->param_size != x) goto OFF_BASE;
-undump_int(x); if (mp->max_in_open != x) goto OFF_BASE
-
-@ We do string pool compaction to avoid dumping unused strings.
-
-@d dump_four_ASCII
- w.b0=qi(mp->str_pool[k]); w.b1=qi(mp->str_pool[k+1]);
- w.b2=qi(mp->str_pool[k+2]); w.b3=qi(mp->str_pool[k+3]);
- dump_qqqq(w)
-
-@<Dump the string pool@>=
-mp_do_compaction(mp, mp->pool_size);
-dump_int(mp->pool_ptr);
-dump_int(mp->max_str_ptr);
-dump_int(mp->str_ptr);
-k=0;
-while ( (mp->next_str[k]==k+1) && (k<=mp->max_str_ptr) )
- incr(k);
-dump_int(k);
-while ( k<=mp->max_str_ptr ) {
- dump_int(mp->next_str[k]); incr(k);
-}
-k=0;
-while (1) {
- dump_int(mp->str_start[k]); /* TODO: valgrind warning here */
- if ( k==mp->str_ptr ) {
- break;
- } else {
- k=mp->next_str[k];
- }
-}
-k=0;
-while (k+4<mp->pool_ptr ) {
- dump_four_ASCII; k=k+4;
-}
-k=mp->pool_ptr-4; dump_four_ASCII;
-mp_print_ln(mp); mp_print(mp, "at most "); mp_print_int(mp, mp->max_str_ptr);
-mp_print(mp, " strings of total length ");
-mp_print_int(mp, mp->pool_ptr)
-
-@ @d undump_four_ASCII
- undump_qqqq(w);
- mp->str_pool[k]=qo(w.b0); mp->str_pool[k+1]=qo(w.b1);
- mp->str_pool[k+2]=qo(w.b2); mp->str_pool[k+3]=qo(w.b3)
-
-@<Undump the string pool@>=
-undump_int(mp->pool_ptr);
-mp_reallocate_pool(mp, mp->pool_ptr) ;
-undump_int(mp->max_str_ptr);
-mp_reallocate_strings (mp,mp->max_str_ptr) ;
-undump(0,mp->max_str_ptr,mp->str_ptr);
-undump(0,mp->max_str_ptr+1,s);
-for (k=0;k<=s-1;k++)
- mp->next_str[k]=k+1;
-for (k=s;k<=mp->max_str_ptr;k++)
- undump(s+1,mp->max_str_ptr+1,mp->next_str[k]);
-mp->fixed_str_use=0;
-k=0;
-while (1) {
- undump(0,mp->pool_ptr,mp->str_start[k]);
- if ( k==mp->str_ptr ) break;
- mp->str_ref[k]=max_str_ref;
- incr(mp->fixed_str_use);
- mp->last_fixed_str=k; k=mp->next_str[k];
-}
-k=0;
-while ( k+4<mp->pool_ptr ) {
- undump_four_ASCII; k=k+4;
-}
-k=mp->pool_ptr-4; undump_four_ASCII;
-mp->init_str_use=mp->fixed_str_use; mp->init_pool_ptr=mp->pool_ptr;
-mp->max_pool_ptr=mp->pool_ptr;
-mp->strs_used_up=mp->fixed_str_use;
-mp->pool_in_use=mp->str_start[mp->str_ptr]; mp->strs_in_use=mp->fixed_str_use;
-mp->max_pl_used=mp->pool_in_use; mp->max_strs_used=mp->strs_in_use;
-mp->pact_count=0; mp->pact_chars=0; mp->pact_strs=0;
-
-@ By sorting the list of available spaces in the variable-size portion of
-|mem|, we are usually able to get by without having to dump very much
-of the dynamic memory.
-
-We recompute |var_used| and |dyn_used|, so that \.{INIMP} dumps valid
-information even when it has not been gathering statistics.
-
-@<Dump the dynamic memory@>=
-mp_sort_avail(mp); mp->var_used=0;
-dump_int(mp->lo_mem_max); dump_int(mp->rover);
-p=0; q=mp->rover; x=0;
-do {
- for (k=p;k<= q+1;k++)
- dump_wd(mp->mem[k]);
- x=x+q+2-p; mp->var_used=mp->var_used+q-p;
- p=q+node_size(q); q=rlink(q);
-} while (q!=mp->rover);
-mp->var_used=mp->var_used+mp->lo_mem_max-p;
-mp->dyn_used=mp->mem_end+1-mp->hi_mem_min;
-for (k=p;k<= mp->lo_mem_max;k++ )
- dump_wd(mp->mem[k]);
-x=x+mp->lo_mem_max+1-p;
-dump_int(mp->hi_mem_min); dump_int(mp->avail);
-for (k=mp->hi_mem_min;k<=mp->mem_end;k++ )
- dump_wd(mp->mem[k]);
-x=x+mp->mem_end+1-mp->hi_mem_min;
-p=mp->avail;
-while ( p!=null ) {
- decr(mp->dyn_used); p=link(p);
-}
-dump_int(mp->var_used); dump_int(mp->dyn_used);
-mp_print_ln(mp); mp_print_int(mp, x);
-mp_print(mp, " memory locations dumped; current usage is ");
-mp_print_int(mp, mp->var_used); mp_print_char(mp, '&'); mp_print_int(mp, mp->dyn_used)
-
-@ @<Undump the dynamic memory@>=
-undump(lo_mem_stat_max+1000,hi_mem_stat_min-1,mp->lo_mem_max);
-undump(lo_mem_stat_max+1,mp->lo_mem_max,mp->rover);
-p=0; q=mp->rover;
-do {
- for (k=p;k<= q+1; k++)
- undump_wd(mp->mem[k]);
- p=q+node_size(q);
- if ( (p>mp->lo_mem_max)||((q>=rlink(q))&&(rlink(q)!=mp->rover)) )
- goto OFF_BASE;
- q=rlink(q);
-} while (q!=mp->rover);
-for (k=p;k<=mp->lo_mem_max;k++ )
- undump_wd(mp->mem[k]);
-undump(mp->lo_mem_max+1,hi_mem_stat_min,mp->hi_mem_min);
-undump(null,mp->mem_top,mp->avail); mp->mem_end=mp->mem_top;
-mp->last_pending=spec_head;
-for (k=mp->hi_mem_min;k<= mp->mem_end;k++)
- undump_wd(mp->mem[k]);
-undump_int(mp->var_used); undump_int(mp->dyn_used)
-
-@ A different scheme is used to compress the hash table, since its lower region
-is usually sparse. When |text(p)<>0| for |p<=hash_used|, we output three
-words: |p|, |hash[p]|, and |eqtb[p]|. The hash table is, of course, densely
-packed for |p>=hash_used|, so the remaining entries are output in~a~block.
-
-@<Dump the table of equivalents and the hash table@>=
-dump_int(mp->hash_used);
-mp->st_count=frozen_inaccessible-1-mp->hash_used;
-for (p=1;p<=mp->hash_used;p++) {
- if ( text(p)!=0 ) {
- dump_int(p); dump_hh(mp->hash[p]); dump_hh(mp->eqtb[p]); incr(mp->st_count);
- }
-}
-for (p=mp->hash_used+1;p<=(int)hash_end;p++) {
- dump_hh(mp->hash[p]); dump_hh(mp->eqtb[p]);
-}
-dump_int(mp->st_count);
-mp_print_ln(mp); mp_print_int(mp, mp->st_count); mp_print(mp, " symbolic tokens")
-
-@ @<Undump the table of equivalents and the hash table@>=
-undump(1,frozen_inaccessible,mp->hash_used);
-p=0;
-do {
- undump(p+1,mp->hash_used,p);
- undump_hh(mp->hash[p]); undump_hh(mp->eqtb[p]);
-} while (p!=mp->hash_used);
-for (p=mp->hash_used+1;p<=(int)hash_end;p++ ) {
- undump_hh(mp->hash[p]); undump_hh(mp->eqtb[p]);
-}
-undump_int(mp->st_count)
-
-@ We have already printed a lot of statistics, so we set |mp_tracing_stats:=0|
-to prevent them appearing again.
-
-@<Dump a few more things and the closing check word@>=
-dump_int(mp->max_internal);
-dump_int(mp->int_ptr);
-for (k=1;k<= mp->int_ptr;k++ ) {
- dump_int(mp->internal[k]);
- dump_string(mp->int_name[k]);
-}
-dump_int(mp->start_sym);
-dump_int(mp->interaction);
-dump_string(mp->mem_ident);
-dump_int(mp->bg_loc); dump_int(mp->eg_loc); dump_int(mp->serial_no); dump_int(69073);
-mp->internal[mp_tracing_stats]=0
-
-@ @<Undump a few more things and the closing check word@>=
-undump_int(x);
-if (x>mp->max_internal) mp_grow_internals(mp,x);
-undump_int(mp->int_ptr);
-for (k=1;k<= mp->int_ptr;k++) {
- undump_int(mp->internal[k]);
- undump_string(mp->int_name[k]);
-}
-undump(0,frozen_inaccessible,mp->start_sym);
-if (mp->interaction==mp_unspecified_mode) {
- undump(mp_unspecified_mode,mp_error_stop_mode,mp->interaction);
-} else {
- undump(mp_unspecified_mode,mp_error_stop_mode,x);
-}
-undump_string(mp->mem_ident);
-undump(1,hash_end,mp->bg_loc);
-undump(1,hash_end,mp->eg_loc);
-undump_int(mp->serial_no);
-undump_int(x);
-if (x!=69073) goto OFF_BASE
-
-@ @<Create the |mem_ident|...@>=
-{
- xfree(mp->mem_ident);
- mp->mem_ident = xmalloc(256,1);
- snprintf(mp->mem_ident,256," (mem=%s %i.%i.%i)",
- mp->job_name,
- (int)(mp_round_unscaled(mp, mp->internal[mp_year]) % 100),
- (int)mp_round_unscaled(mp, mp->internal[mp_month]),
- (int)mp_round_unscaled(mp, mp->internal[mp_day]));
- mp_pack_job_name(mp, mem_extension);
- while (! mp_w_open_out(mp, &mp->mem_file) )
- mp_prompt_file_name(mp, "mem file name", mem_extension);
- mp_print_nl(mp, "Beginning to dump on file ");
-@.Beginning to dump...@>
- mp_print(mp, mp->name_of_file);
- mp_print_nl(mp, mp->mem_ident);
-}
+extern void mp_store_mem_file (MP mp) ;
+extern boolean mp_load_mem_file (MP mp);
+extern int mp_undump_constants (MP mp);
@ @<Dealloc variables@>=
xfree(mp->mem_ident);
-@ @<Close the mem file@>=
-(mp->close_file)(mp,mp->mem_file)
@* \[46] The main program.
This is it: the part of \MP\ that executes all those procedures we have
@@ -25799,7 +26001,6 @@ have been forgotten.
@c @<Declare the basic parsing subroutines@>
@<Declare miscellaneous procedures that were declared |forward|@>
-@<Last-minute procedures@>
@ We've noted that there are two versions of \MP. One, called \.{INIMP},
@.INIMP@>
@@ -25823,6 +26024,72 @@ int ini_version; /* are we iniMP? */
@ @<Set |ini_version|@>=
mp->ini_version = (opt->ini_version ? true : false);
+@ The code below make the final chosen hash size the next larger
+multiple of 2 from the requested size, and this array is a list of
+suitable prime numbers to go with such values.
+
+The top limit is chosen such that it is definately lower than
+|max_halfword-3*param_size|, because |param_size| cannot be larger
+than |max_halfword/sizeof(pointer)|.
+
+@<Declarations@>=
+static int mp_prime_choices[] =
+ { 12289, 24593, 49157, 98317,
+ 196613, 393241, 786433, 1572869,
+ 3145739, 6291469, 12582917, 25165843,
+ 50331653, 100663319 };
+
+@ @<Find constant sizes@>=
+if (mp->ini_version) {
+ unsigned i = 14;
+ set_value(mp->mem_top,opt->main_memory,5000);
+ mp->mem_max = mp->mem_top;
+ set_value(mp->param_size,opt->param_size,150);
+ set_value(mp->max_in_open,opt->max_in_open,10);
+ if (opt->hash_size>0x8000000)
+ opt->hash_size=0x8000000;
+ if (opt->hash_size>0) {
+ set_value(mp->hash_size,(2*opt->hash_size-1),16384);
+ } else {
+ mp->hash_size = 16384;
+ }
+ mp->hash_size = mp->hash_size>>i;
+ while (mp->hash_size>=2) {
+ mp->hash_size /= 2;
+ i++;
+ }
+ mp->hash_size = mp->hash_size << i;
+ if (mp->hash_size>0x8000000)
+ mp->hash_size=0x8000000;
+ mp->hash_prime=mp_prime_choices[(i-14)];
+} else {
+ int i = -1;
+ if (mp->mem_name == NULL) {
+ mp->mem_name = mp_xstrdup(mp,"plain");
+ }
+ if (mp_open_mem_file(mp)) {
+ char *sfile = NULL;
+ i = mp_undump_constants(mp);
+ if (i != metapost_magic)
+ goto OFF_BASE;
+ set_value(mp->mem_max,opt->main_memory,mp->mem_top);
+ goto DONE;
+OFF_BASE:
+ wterm_ln("(Fatal mem file error; ");
+ sfile = (mp->find_file)(mp, mp->mem_name, "r", mp_filetype_memfile);
+ if (sfile!=NULL) wterm(sfile);
+ if (i>metapost_old_magic && i<metapost_magic) {
+ wterm(" was written by an older version)\n");
+ } else {
+ wterm(" appears not to be a mem file)\n");
+ }
+ }
+ mp->history = mp_fatal_error_stop;
+ mp_jump_out(mp);
+}
+DONE:
+
+
@ Here we do whatever is needed to complete \MP's job gracefully on the
local operating system. The code here might come into play after a fatal
error; it must therefore consist entirely of ``safe'' operations that
@@ -25833,39 +26100,40 @@ might lead to an infinite loop.
This program doesn't bother to close the input files that may still be open.
-@<Last-minute...@>=
+@ @c
void mp_close_files_and_terminate (MP mp) {
integer k; /* all-purpose index */
integer LH; /* the length of the \.{TFM} header, in words */
int lk_offset; /* extra words inserted at beginning of |lig_kern| array */
pointer p; /* runs through a list of \.{TFM} dimensions */
+ if (mp->finished)
+ return;
@<Close all open files in the |rd_file| and |wr_file| arrays@>;
if ( mp->internal[mp_tracing_stats]>0 )
@<Output statistics about this job@>;
wake_up_terminal;
@<Do all the finishing work on the \.{TFM} file@>;
@<Explain what output files were written@>;
- if ( mp->log_opened ){
+ if ( mp->log_opened && ! mp->noninteractive ){
wlog_cr;
(mp->close_file)(mp,mp->log_file);
mp->selector=mp->selector-2;
if ( mp->selector==term_only ) {
mp_print_nl(mp, "Transcript written on ");
@.Transcript written...@>
- mp_print(mp, mp->log_name); mp_print_char(mp, '.');
+ mp_print(mp, mp->log_name); mp_print_char(mp, xord('.'));
}
}
mp_print_ln(mp);
- t_close_out;
- t_close_in;
+ mp->finished = true;
}
@ @<Declarations@>=
-void mp_close_files_and_terminate (MP mp) ;
+static void mp_close_files_and_terminate (MP mp) ;
@ @<Close all open files in the |rd_file| and |wr_file| arrays@>=
if (mp->rd_fname!=NULL) {
- for (k=0;k<=(int)mp->read_files-1;k++ ) {
+ for (k=0;k<(int)mp->read_files;k++ ) {
if ( mp->rd_fname[k]!=NULL ) {
(mp->close_file)(mp,mp->rd_file[k]);
xfree(mp->rd_fname[k]);
@@ -25873,7 +26141,7 @@ if (mp->rd_fname!=NULL) {
}
}
if (mp->wr_fname!=NULL) {
- for (k=0;k<=(int)mp->write_files-1;k++) {
+ for (k=0;k<(int)mp->write_files;k++) {
if ( mp->wr_fname[k]!=NULL ) {
(mp->close_file)(mp,mp->wr_file[k]);
xfree(mp->wr_fname[k]);
@@ -25917,11 +26185,11 @@ if ( mp->internal[mp_fontmaking]>0 ) {
}
@ @<Make the dynamic memory into one big available node@>=
-mp->rover=lo_mem_stat_max+1; link(mp->rover)=empty_flag; mp->lo_mem_max=mp->hi_mem_min-1;
+mp->rover=lo_mem_stat_max+1; mp_link(mp->rover)=empty_flag; mp->lo_mem_max=mp->hi_mem_min-1;
if ( mp->lo_mem_max-mp->rover>max_halfword ) mp->lo_mem_max=max_halfword+mp->rover;
node_size(mp->rover)=mp->lo_mem_max-mp->rover;
-llink(mp->rover)=mp->rover; rlink(mp->rover)=mp->rover;
-link(mp->lo_mem_max)=null; info(mp->lo_mem_max)=null
+lmp_link(mp->rover)=mp->rover; rmp_link(mp->rover)=mp->rover;
+mp_link(mp->lo_mem_max)=null; mp_info(mp->lo_mem_max)=null
@ The present section goes directly to the log file instead of using
|print| commands, because there's no need for these strings to take
@@ -25933,26 +26201,26 @@ if ( mp->log_opened ) {
wlog_ln(" ");
wlog_ln("Here is how much of MetaPost's memory you used:");
@.Here is how much...@>
- snprintf(s,128," %i string%s out of %i",(int)mp->max_strs_used-mp->init_str_use,
+ mp_snprintf(s,128," %i string%s out of %i",(int)mp->max_strs_used-mp->init_str_use,
(mp->max_strs_used!=mp->init_str_use+1 ? "s" : ""),
(int)(mp->max_strings-1-mp->init_str_use));
wlog_ln(s);
- snprintf(s,128," %i string characters out of %i",
+ mp_snprintf(s,128," %i string characters out of %i",
(int)mp->max_pl_used-mp->init_pool_ptr,
(int)mp->pool_size-mp->init_pool_ptr);
wlog_ln(s);
- snprintf(s,128," %i words of memory out of %i",
+ mp_snprintf(s,128," %i words of memory out of %i",
(int)mp->lo_mem_max+mp->mem_end-mp->hi_mem_min+2,
(int)mp->mem_end);
wlog_ln(s);
- snprintf(s,128," %i symbolic tokens out of %i", (int)mp->st_count, (int)mp->hash_size);
+ mp_snprintf(s,128," %i symbolic tokens out of %i", (int)mp->st_count, (int)mp->hash_size);
wlog_ln(s);
- snprintf(s,128," %ii,%in,%ip,%ib stack positions out of %ii,%in,%ip,%ib",
+ mp_snprintf(s,128," %ii,%in,%ip,%ib stack positions out of %ii,%in,%ip,%ib",
(int)mp->max_in_stack,(int)mp->int_ptr,
(int)mp->max_param_stack,(int)mp->max_buf_stack+1,
(int)mp->stack_size,(int)mp->max_internal,(int)mp->param_size,(int)mp->buf_size);
wlog_ln(s);
- snprintf(s,128," %i string compactions (moved %i characters, %i strings)",
+ mp_snprintf(s,128," %i string compactions (moved %i characters, %i strings)",
(int)mp->pact_count,(int)mp->pact_chars,(int)mp->pact_strs);
wlog_ln(s);
}
@@ -25982,9 +26250,9 @@ int mp_open_usage (MP mp ) {
@ We get to the |final_cleanup| routine when \&{end} or \&{dump} has
been scanned.
-@<Last-minute...@>=
+@c
void mp_final_cleanup (MP mp) {
- small_number c; /* 0 for \&{end}, 1 for \&{dump} */
+ quarterword c; /* 0 for \&{end}, 1 for \&{dump} */
c=mp->cur_mod;
if ( mp->job_name==NULL ) mp_open_log_file(mp);
while ( mp->input_ptr>0 ) {
@@ -26005,7 +26273,7 @@ void mp_final_cleanup (MP mp) {
}
mp_print(mp, " was incomplete)");
mp->if_line=if_line_field(mp->cond_ptr);
- mp->cur_if=name_type(mp->cond_ptr); mp->cond_ptr=link(mp->cond_ptr);
+ mp->cur_if=mp_name_type(mp->cond_ptr); mp->cond_ptr=mp_link(mp->cond_ptr);
}
if ( mp->history!=mp_spotless )
if ( ((mp->history==mp_warning_issued)||(mp->interaction<mp_error_stop_mode)) )
@@ -26025,11 +26293,11 @@ void mp_final_cleanup (MP mp) {
}
@ @<Declarations@>=
-void mp_final_cleanup (MP mp) ;
-void mp_init_prim (MP mp) ;
-void mp_init_tab (MP mp) ;
+static void mp_final_cleanup (MP mp) ;
+static void mp_init_prim (MP mp) ;
+static void mp_init_tab (MP mp) ;
-@ @<Last-minute...@>=
+@ @c
void mp_init_prim (MP mp) { /* initialize all the primitives */
@<Put each...@>;
}
@@ -26041,8 +26309,7 @@ void mp_init_tab (MP mp) { /* initialize other tables */
@ When we begin the following code, \MP's tables may still contain garbage;
-the strings might not even be present. Thus we must proceed cautiously to get
-bootstrapped in.
+thus we must proceed cautiously to get bootstrapped in.
But when we finish this part of the program, \MP\ is ready to call on the
|main_control| routine to do its work.
@@ -26050,19 +26317,19 @@ But when we finish this part of the program, \MP\ is ready to call on the
@<Get the first line...@>=
{
@<Initialize the input routines@>;
- if ( (mp->mem_ident==NULL)||(mp->buffer[loc]=='&') ) {
- if ( mp->mem_ident!=NULL ) {
- mp_do_initialize(mp); /* erase preloaded mem */
- }
- if ( ! mp_open_mem_file(mp) ) return mp_fatal_error_stop;
+ if (mp->mem_ident==NULL) {
if ( ! mp_load_mem_file(mp) ) {
(mp->close_file)(mp, mp->mem_file);
- return mp_fatal_error_stop;
+ mp->history = mp_fatal_error_stop;
+ return mp;
}
(mp->close_file)(mp, mp->mem_file);
- while ( (loc<limit)&&(mp->buffer[loc]==' ') ) incr(loc);
}
- mp->buffer[limit]='%';
+ @<Initializations following first line@>;
+}
+
+@ @<Initializations following first line@>=
+ mp->buffer[limit]=(ASCII_code)'%';
mp_fix_date_and_time(mp);
if (mp->random_seed==0)
mp->random_seed = (mp->internal[mp_time] / unity)+mp->internal[mp_day];
@@ -26070,99 +26337,17 @@ But when we finish this part of the program, \MP\ is ready to call on the
@<Initialize the print |selector|...@>;
if ( loc<limit ) if ( mp->buffer[loc]!='\\' )
mp_start_input(mp); /* \&{input} assumed */
-}
@ @<Run inimpost commands@>=
{
mp_get_strings_started(mp);
mp_init_tab(mp); /* initialize the tables */
mp_init_prim(mp); /* call |primitive| for each primitive */
- mp->init_str_use=mp->str_ptr; mp->init_pool_ptr=mp->pool_ptr;
- mp->max_str_ptr=mp->str_ptr; mp->max_pool_ptr=mp->pool_ptr;
+ mp->init_str_use=mp->max_str_ptr=mp->str_ptr;
+ mp->init_pool_ptr=mp->max_pool_ptr=mp->pool_ptr;
mp_fix_date_and_time(mp);
}
-
-@* \[47] Debugging.
-Once \MP\ is working, you should be able to diagnose most errors with
-the \.{show} commands and other diagnostic features. But for the initial
-stages of debugging, and for the revelation of really deep mysteries, you
-can compile \MP\ with a few more aids. An additional routine called |debug_help|
-will also come into play when you type `\.D' after an error message;
-|debug_help| also occurs just before a fatal error causes \MP\ to succumb.
-@^debugging@>
-@^system dependencies@>
-
-The interface to |debug_help| is primitive, but it is good enough when used
-with a debugger that allows you to set breakpoints and to read
-variables and change their values. After getting the prompt `\.{debug \#}', you
-type either a negative number (this exits |debug_help|), or zero (this
-goes to a location where you can set a breakpoint, thereby entering into
-dialog with the debugger), or a positive number |m| followed by
-an argument |n|. The meaning of |m| and |n| will be clear from the
-program below. (If |m=13|, there is an additional argument, |l|.)
-@.debug \#@>
-
-@<Last-minute...@>=
-void mp_debug_help (MP mp) { /* routine to display various things */
- integer k;
- int l,m,n;
- char *aline;
- size_t len;
- while (1) {
- wake_up_terminal;
- mp_print_nl(mp, "debug # (-1 to exit):"); update_terminal;
-@.debug \#@>
- m = 0;
- aline = (mp->read_ascii_file)(mp,mp->term_in, &len);
- if (len) { sscanf(aline,"%i",&m); xfree(aline); }
- if ( m<=0 )
- return;
- n = 0 ;
- aline = (mp->read_ascii_file)(mp,mp->term_in, &len);
- if (len) { sscanf(aline,"%i",&n); xfree(aline); }
- switch (m) {
- @<Numbered cases for |debug_help|@>;
- default: mp_print(mp, "?"); break;
- }
- }
-}
-
-@ @<Numbered cases...@>=
-case 1: mp_print_word(mp, mp->mem[n]); /* display |mem[n]| in all forms */
- break;
-case 2: mp_print_int(mp, info(n));
- break;
-case 3: mp_print_int(mp, link(n));
- break;
-case 4: mp_print_int(mp, eq_type(n)); mp_print_char(mp, ':'); mp_print_int(mp, equiv(n));
- break;
-case 5: mp_print_variable_name(mp, n);
- break;
-case 6: mp_print_int(mp, mp->internal[n]);
- break;
-case 7: mp_do_show_dependencies(mp);
- break;
-case 9: mp_show_token_list(mp, n,null,100000,0);
- break;
-case 10: mp_print_str(mp, n);
- break;
-case 11: mp_check_mem(mp, n>0); /* check wellformedness; print new busy locations if |n>0| */
- break;
-case 12: mp_search_mem(mp, n); /* look for pointers to |n| */
- break;
-case 13:
- l = 0;
- aline = (mp->read_ascii_file)(mp,mp->term_in, &len);
- if (len) { sscanf(aline,"%i",&l); xfree(aline); }
- mp_print_cmd_mod(mp, n,l);
- break;
-case 14: for (k=0;k<=n;k++) mp_print_str(mp, mp->buffer[k]);
- break;
-case 15: mp->panicking=! mp->panicking;
- break;
-
-
@ Saving the filename template
@<Save the filename template@>=
@@ -26174,6 +26359,9 @@ case 15: mp->panicking=! mp->panicking;
}
}
+@* \[47] Debugging.
+
+
@* \[48] System-dependent changes.
This section should be replaced, if necessary, by any special
modification of the program
diff --git a/Build/source/texk/web2c/luatexdir/lua/psout.w b/Build/source/texk/web2c/luatexdir/mp/psout.w
index 90cf6923e01..d3a2bb682e7 100644
--- a/Build/source/texk/web2c/luatexdir/lua/psout.w
+++ b/Build/source/texk/web2c/luatexdir/mp/psout.w
@@ -1,10 +1,20 @@
-% $Id: mp.web,v 1.8 2005/08/24 10:54:02 taco Exp $
-% MetaPost, by John Hobby. Public domain.
-
-% Much of this program was copied with permission from MF.web Version 1.9
-% It interprets a language very similar to D.E. Knuth's METAFONT, but with
-% changes designed to make it more suitable for PostScript output.
-
+% $Id: psout.w 804 2008-12-23 15:22:15Z taco $
+%
+% Copyright 2008 Taco Hoekwater.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
% TeX is a trademark of the American Mathematical Society.
% METAFONT is a trademark of Addison-Wesley Publishing Company.
% PostScript is a trademark of Adobe Systems Incorporated.
@@ -26,7 +36,8 @@
\def\section{\mathhexbox278}
\let\swap=\leftrightarrow
\def\round{\mathop{\rm round}\nolimits}
-\mathchardef\vb="026A % synonym for `\|'
+\mathchardef\vbv="026A % synonym for `\|'
+\def\vb{\relax\ifmmode\vbv\else$\vbv$\fi}
\def\[#1]{} % from pascal web
\def\(#1){} % this is used to make section names sort themselves better
\def\9#1{} % this is used for sort keys in the index via @@:sort key}{entry@@>
@@ -58,6 +69,7 @@
@d max_quarterword 0x3FFF /* largest allowable value in a |quarterword| */
@c
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -65,6 +77,7 @@
#include <assert.h>
#include "avl.h"
#include "mplib.h"
+#include "mplibps.h" /* external header */
#include "mpmp.h" /* internal header */
#include "mppsout.h" /* internal header */
@h
@@ -87,6 +100,33 @@ typedef struct psout_data_struct {
} psout_data_struct ;
@<Exported function headers@>
+@ @c
+static boolean mp_isdigit (int a) {
+ return (a>='0'&&a<='9');
+}
+static int mp_tolower (int a) {
+ if (a>='A' && a <='Z')
+ return a - 'A' + 'a';
+ return a;
+}
+static int mp_strcasecmp (const char *s1, const char *s2) {
+ int r;
+ char *ss1, *ss2, *c;
+ ss1 = mp_strdup(s1);
+ c = ss1;
+ while (*c != '\0') {
+ *c = mp_tolower(*c); c++;
+ }
+ ss2 = mp_strdup(s2);
+ c = ss2;
+ while (*c != '\0') {
+ *c = mp_tolower(*c); c++;
+ }
+ r = strcmp(ss1,ss2);
+ free (ss1); free(ss2);
+ return r;
+}
+
@ @<Exported function headers@>=
void mp_backend_initialize (MP mp) ;
void mp_backend_free (MP mp) ;
@@ -126,13 +166,13 @@ mp->ps->ps_offset = 0;
@d wps_ln(A) { wterm_cr; (mp->write_ascii_file)(mp,mp->ps_file,(A)); }
@c
-void mp_ps_print_ln (MP mp) { /* prints an end-of-line */
+static void mp_ps_print_ln (MP mp) { /* prints an end-of-line */
wps_cr;
mp->ps->ps_offset=0;
}
@ @c
-void mp_ps_print_char (MP mp, ASCII_code s) { /* prints a single character */
+static void mp_ps_print_char (MP mp, int s) { /* prints a single character */
if ( s==13 ) {
wps_cr; mp->ps->ps_offset=0;
} else {
@@ -141,8 +181,8 @@ void mp_ps_print_char (MP mp, ASCII_code s) { /* prints a single character */
}
@ @c
-void mp_ps_do_print (MP mp, const char *ss, unsigned int len) { /* prints string |s| */
- unsigned int j = 0;
+static void mp_ps_do_print (MP mp, const char *ss, size_t len) { /* prints string |s| */
+ size_t j = 0;
while ( j<len ){
mp_ps_print_char(mp, ss[j]); incr(j);
}
@@ -150,12 +190,12 @@ void mp_ps_do_print (MP mp, const char *ss, unsigned int len) { /* prints string
@ Deciding where to break the ps output line.
-@d ps_room(A) if ( (mp->ps->ps_offset+(int)(A))>mp->max_print_line ) {
+@d ps_room(A) if (mp->ps->ps_offset>0 && (mp->ps->ps_offset+(int)(A))>mp->max_print_line ) {
mp_ps_print_ln(mp); /* optional line break */
}
@c
-void mp_ps_print (MP mp, const char *ss) {
+static void mp_ps_print (MP mp, const char *ss) {
ps_room(strlen(ss));
mp_ps_do_print(mp, ss, strlen(ss));
}
@@ -164,7 +204,7 @@ void mp_ps_print (MP mp, const char *ss) {
string appears at the beginning of a new line.
@c
-void mp_ps_print_nl (MP mp, const char *s) { /* prints string |s| at beginning of line */
+static void mp_ps_print_nl (MP mp, const char *s) { /* prints string |s| at beginning of line */
if ( mp->ps->ps_offset>0 ) mp_ps_print_ln(mp);
mp_ps_print(mp, s);
}
@@ -172,7 +212,7 @@ void mp_ps_print_nl (MP mp, const char *s) { /* prints string |s| at beginning o
@ An array of digits in the range |0..9| is printed by |print_the_digs|.
@c
-void mp_ps_print_the_digs (MP mp, eight_bits k) {
+static void mp_ps_print_the_digs (MP mp, int k) {
/* prints |dig[k-1]|$\,\ldots\,$|dig[0]| */
while ( k-->0 ){
mp_ps_print_char(mp, '0'+mp->dig[k]);
@@ -186,7 +226,7 @@ to negative arguments, since such operations are not implemented consistently
by all \PASCAL\ compilers.
@c
-void mp_ps_print_int (MP mp,integer n) { /* prints an integer in decimal form */
+static void mp_ps_print_int (MP mp,integer n) { /* prints an integer in decimal form */
integer m; /* used to negate |n| in possibly dangerous cases */
int k = 0; /* index to current digit; we assume that $|n|<10^{23}$ */
if ( n<0 ) {
@@ -196,26 +236,23 @@ void mp_ps_print_int (MP mp,integer n) { /* prints an integer in decimal form */
} else {
m=-1-n; n=m / 10; m=(m % 10)+1; k=1;
if ( m<10 ) {
- mp->dig[0]=m;
+ mp->dig[0]=(unsigned char)m;
} else {
mp->dig[0]=0; incr(n);
}
}
}
do {
- mp->dig[k]=n % 10; n=n / 10; incr(k);
+ mp->dig[k]=(unsigned char)(n % 10); n=n / 10; incr(k);
} while (n!=0);
mp_ps_print_the_digs(mp, k);
}
-@ @<Internal ...@>=
-void mp_ps_print_int (MP mp,integer n);
-
@ \MP\ also makes use of a trivial procedure to print two digits. The
following subroutine is usually called with a parameter in the range |0<=n<=99|.
@c
-void mp_ps_print_dd (MP mp,integer n) { /* prints two least significant digits */
+static void mp_ps_print_dd (MP mp,integer n) { /* prints two least significant digits */
n=abs(n) % 100;
mp_ps_print_char(mp, '0'+(n / 10));
mp_ps_print_char(mp, '0'+(n % 10));
@@ -236,7 +273,7 @@ We can stop if and only if $f=0$ satisfies this condition; the loop will
terminate before $s$ can possibly become zero.
@c
-void mp_ps_print_scaled (MP mp,scaled s) {
+static void mp_ps_print_scaled (MP mp,scaled s) {
scaled delta; /* amount of allowable inaccuracy */
if ( s<0 ) {
mp_ps_print_char(mp, '-');
@@ -265,8 +302,8 @@ First, here are a few helpers for parsing files
@d check_buf(size, buf_size)
if ((unsigned)(size) > (unsigned)(buf_size)) {
char S[128];
- snprintf(S,128,"buffer overflow: (%d,%d) at file %s, line %d",
- size,buf_size, __FILE__, __LINE__ );
+ mp_snprintf(S,128,"buffer overflow: (%u,%u) at file %s, line %d",
+ (unsigned)(size),(unsigned)(buf_size), __FILE__, __LINE__ );
mp_fatal_error(mp,S);
}
@@ -329,7 +366,7 @@ void * enc_file;
@d enc_close() (mp->close_file)(mp,mp->ps->enc_file)
@c
-int enc_getchar(MP mp) {
+static int enc_getchar(MP mp) {
size_t len = 1;
unsigned char abyte=0;
void *byte_ptr = &abyte;
@@ -367,7 +404,7 @@ static void mp_load_enc (MP mp, char *enc_name,
char buf[ENC_BUF_SIZE], *p, *r;
int names_count;
char *myname;
- int save_selector = mp->selector;
+ unsigned save_selector = mp->selector;
if (!mp_enc_open (mp,enc_name)) {
mp_print (mp,"cannot open encoding file for reading");
return;
@@ -441,8 +478,7 @@ static void mp_read_enc (MP mp, enc_entry * e) {
@c
static void mp_write_enc (MP mp, enc_entry * e) {
int i;
- int s;
- int foffset;
+ size_t s, foffset;
char **g;
if (e->objnum != 0) /* the encoding has been written already */
return;
@@ -454,6 +490,7 @@ static void mp_write_enc (MP mp, enc_entry * e) {
mp_ps_print_nl(mp, "/");
mp_ps_print(mp, e->enc_name);
mp_ps_print(mp, " [ ");
+ mp_ps_print_ln (mp);
foffset = strlen(e->file_name)+3;
for (i = 0; i < 256; i++) {
s = strlen(g[i]);
@@ -559,17 +596,15 @@ static void enc_free (MP mp);
avl_destroy (mp->ps->enc_tree, mp_destroy_enc_entry);
}
-@ @<Exported function headers@>=
-void mp_reload_encodings (MP mp) ;
-
@ @<Declarations@>=
-static void mp_font_encodings (MP mp, int lastfnum, int encodings_only) ;
+static void mp_reload_encodings (MP mp) ;
+static void mp_font_encodings (MP mp, font_number lastfnum, boolean encodings_only) ;
@ @c void mp_reload_encodings (MP mp) {
- int f;
+ font_number f;
enc_entry *e;
fm_entry *fm_cur;
- int lastfnum = mp->last_fnum;
+ font_number lastfnum = mp->last_fnum;
for (f=null_font+1;f<=lastfnum;f++) {
if (mp->font_enc_name[f]!=NULL ) {
mp_xfree(mp->font_enc_name[f]);
@@ -583,8 +618,8 @@ static void mp_font_encodings (MP mp, int lastfnum, int encodings_only) ;
}
}
}
-static void mp_font_encodings (MP mp, int lastfnum, int encodings_only) {
- int f;
+static void mp_font_encodings (MP mp, font_number lastfnum, boolean encodings_only) {
+ font_number f;
enc_entry *e;
fm_entry *fm;
for (f=null_font+1;f<=lastfnum;f++) {
@@ -615,7 +650,7 @@ void * fm_file;
@d fm_eof() (mp->eof_file)(mp,mp->ps->fm_file)
@c
-int fm_getchar(MP mp) {
+static int fm_getchar(MP mp) {
size_t len = 1;
unsigned char abyte=0;
void *byte_ptr = &abyte;
@@ -725,7 +760,7 @@ static void delete_ff_entry (ff_entry * ff) {
static char *mk_base_tfm (MP mp, char *tfmname, int *i) {
static char buf[SMALL_BUF_SIZE];
char *p = tfmname, *r = strend (p) - 1, *q = r;
- while (q > p && isdigit (*q))
+ while (q > p && mp_isdigit (*q))
--q;
if (!(q > p) || q == r || (*q != '+' && *q != '-'))
return NULL;
@@ -736,8 +771,8 @@ static char *mk_base_tfm (MP mp, char *tfmname, int *i) {
return buf;
}
-@ @<Exported function headers@>=
-boolean mp_has_fm_entry (MP mp,font_number f, fm_entry **fm);
+@ @<Declarations@>=
+static boolean mp_has_fm_entry (MP mp,font_number f, fm_entry **fm);
@ @c
boolean mp_has_fm_entry (MP mp,font_number f, fm_entry **fm) {
@@ -836,13 +871,13 @@ static int avl_do_entry (MP mp, fm_entry * fp, int mode) {
p = (fm_entry *) avl_find (mp->ps->tfm_tree, fp);
if (p != NULL) {
if (mode == FM_DUPIGNORE) {
- snprintf(s,128,"fontmap entry for `%s' already exists, duplicates ignored",
+ mp_snprintf(s,128,"fontmap entry for `%s' already exists, duplicates ignored",
fp->tfm_name);
mp_warn(mp,s);
goto exit;
} else { /* mode == |FM_REPLACE| / |FM_DELETE| */
if (mp_has_font_size(mp,p->tfm_num)) {
- snprintf(s,128,
+ mp_snprintf(s,128,
"fontmap entry for `%s' has been used, replace/delete not allowed",
fp->tfm_name);
mp_warn(mp,s);
@@ -869,7 +904,7 @@ static int avl_do_entry (MP mp, fm_entry * fp, int mode) {
p = (fm_entry *) avl_find (mp->ps->ps_tree, fp);
if (p != NULL) {
if (mode == FM_DUPIGNORE) {
- snprintf(s,128,
+ mp_snprintf(s,128,
"ps_name entry for `%s' already exists, duplicates ignored",
fp->ps_name);
mp_warn(mp,s);
@@ -877,7 +912,7 @@ static int avl_do_entry (MP mp, fm_entry * fp, int mode) {
} else { /* mode == |FM_REPLACE| / |FM_DELETE| */
if (mp_has_font_size(mp,p->tfm_num)) {
/* REPLACE/DELETE not allowed */
- snprintf(s,128,
+ mp_snprintf(s,128,
"fontmap entry for `%s' has been used, replace/delete not allowed",
p->tfm_name);
mp_warn(mp,s);
@@ -914,7 +949,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
if (is_basefont (fm)) {
if (is_fontfile (fm) && !is_included (fm)) {
if (warn) {
- snprintf(s,128, "invalid entry for `%s': "
+ mp_snprintf(s,128, "invalid entry for `%s': "
"font file must be included or omitted for base fonts",
fm->tfm_name);
mp_warn(mp,s);
@@ -925,7 +960,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
/* if no font file given, drop this entry */
/* |if (!is_fontfile (fm)) {
if (warn) {
- snprintf(s,128,
+ mp_snprintf(s,128,
"invalid entry for `%s': font file missing",
fm->tfm_name);
mp_warn(mp,s);
@@ -937,7 +972,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
}
if (is_truetype (fm) && is_reencoded (fm) && !is_subsetted (fm)) {
if (warn) {
- snprintf(s,128,
+ mp_snprintf(s,128,
"invalid entry for `%s': only subsetted TrueType font can be reencoded",
fm->tfm_name);
mp_warn(mp,s);
@@ -947,7 +982,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
if ((fm->slant != 0 || fm->extend != 0) &&
(is_truetype (fm))) {
if (warn) {
- snprintf(s,128,
+ mp_snprintf(s,128,
"invalid entry for `%s': "
"SlantFont/ExtendFont can be used only with embedded T1 fonts",
fm->tfm_name);
@@ -957,18 +992,18 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
}
if (abs (fm->slant) > 1000) {
if (warn) {
- snprintf(s,128,
- "invalid entry for `%s': too big value of SlantFont (%g)",
- fm->tfm_name, fm->slant / 1000.0);
+ mp_snprintf(s,128,
+ "invalid entry for `%s': too big value of SlantFont (%d/1000.0)",
+ fm->tfm_name, (int)fm->slant);
mp_warn(mp,s);
}
a += 16;
}
if (abs (fm->extend) > 2000) {
if (warn) {
- snprintf(s,128,
- "invalid entry for `%s': too big value of ExtendFont (%g)",
- fm->tfm_name, fm->extend / 1000.0);
+ mp_snprintf(s,128,
+ "invalid entry for `%s': too big value of ExtendFont (%d/1000.0)",
+ fm->tfm_name, (int)fm->extend);
mp_warn(mp,s);
}
a += 32;
@@ -977,7 +1012,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
!(is_truetype (fm) && is_included (fm) &&
is_subsetted (fm) && !is_reencoded (fm))) {
if (warn) {
- snprintf(s,128,
+ mp_snprintf(s,128,
"invalid entry for `%s': "
"PidEid can be used only with subsetted non-reencoded TrueType fonts",
fm->tfm_name);
@@ -1073,9 +1108,9 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
set_field (ps_name);
else
r = p; /* unget the field */
- if (isdigit (*r)) { /* font flags given */
+ if (mp_isdigit (*r)) { /* font flags given */
fm->flags = atoi (r);
- while (isdigit (*r))
+ while (mp_isdigit (*r))
r++;
}
while (1) { /* loop through "specials", encoding, font file */
@@ -1094,11 +1129,11 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
s--; /* e. g. 0.5ExtendFont: \%f = 0.5E */
if (str_prefix (s, "SlantFont")) {
d *= 1000.0; /* correct rounding also for neg. numbers */
- fm->slant = (integer) (d > 0 ? d + 0.5 : d - 0.5);
+ fm->slant = (short int) (d > 0 ? d + 0.5 : d - 0.5);
r = s + strlen ("SlantFont");
} else if (str_prefix (s, "ExtendFont")) {
d *= 1000.0;
- fm->extend = (integer) (d > 0 ? d + 0.5 : d - 0.5);
+ fm->extend = (short int) (d > 0 ? d + 0.5 : d - 0.5);
if (fm->extend == 1000)
fm->extend = 0;
r = s + strlen ("ExtendFont");
@@ -1108,7 +1143,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
r++); /* jump over name */
c = *r; /* remember char for temporary end of string */
*r = '\0';
- snprintf(warn_s,128,
+ mp_snprintf(warn_s,128,
"invalid entry for `%s': unknown name `%s' ignored",
fm->tfm_name, s);
mp_warn(mp,warn_s);
@@ -1121,7 +1156,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
if (*r == '"') /* closing quote */
r++;
else {
- snprintf(warn_s,128,
+ mp_snprintf(warn_s,128,
"invalid entry for `%s': closing quote missing",
fm->tfm_name);
mp_warn(mp,warn_s);
@@ -1130,11 +1165,11 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
break;
case 'P': /* handle cases for subfonts like 'PidEid=3,1' */
if (sscanf (r, "PidEid=%i, %i %n", &a, &b, &c) >= 2) {
- fm->pid = a;
- fm->eid = b;
+ fm->pid = (short int)a;
+ fm->eid = (short int)b;
r += c;
- break;
- }
+ break;
+ } /* fallthrough */
default: /* encoding or font file specification */
a = b = 0;
if (*r == '<') {
@@ -1144,7 +1179,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
}
read_field (r, q, buf);
/* encoding, formats: '8r.enc' or '<8r.enc' or '<[8r.enc' */
- if (strlen (buf) > 4 && strcasecmp (strend (buf) - 4, ".enc") == 0) {
+ if (strlen (buf) > 4 && mp_strcasecmp (strend (buf) - 4, ".enc") == 0) {
fm->encoding = mp_add_enc (mp, buf);
u = v = 0; /* u, v used if intervening blank: "<< foo" */
} else if (strlen (buf) > 0) { /* file name given */
@@ -1171,7 +1206,7 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
if (fm->ps_name != NULL && check_basefont (fm->ps_name))
set_basefont (fm);
if (is_fontfile (fm)
- && strcasecmp (strend (fm_fontfile (fm)) - 4, ".ttf") == 0)
+ && mp_strcasecmp (strend (fm_fontfile (fm)) - 4, ".ttf") == 0)
set_truetype (fm);
if (check_fm_entry (mp,fm, true) != 0)
goto bad_line;
@@ -1200,10 +1235,10 @@ static int check_fm_entry (MP mp, fm_entry * fm, boolean warn) {
n = mp->ps->mitem->map_line;
mp->ps->fm_file = (mp->open_file)(mp, n, "r", mp_filetype_fontmap);
if (!mp->ps->fm_file) {
- snprintf(s,256,"cannot open font map file %s",n);
+ mp_snprintf(s,256,"cannot open font map file %s",n);
mp_warn(mp,s);
} else {
- int save_selector = mp->selector;
+ unsigned save_selector = mp->selector;
mp_normalize_selector(mp);
mp_print (mp, "{");
mp_print (mp, n);
@@ -1357,12 +1392,10 @@ void mp_init_map_file (MP mp, int is_troff);
void mp_map_file (MP mp, str_number t) {
char *s = mp_xstrdup(mp,mp_str (mp,t));
mp_process_map_item (mp, s, MAPFILE);
- mp_xfree (s);
}
void mp_map_line (MP mp, str_number t) {
char *s = mp_xstrdup(mp,mp_str (mp,t));
mp_process_map_item (mp, s, MAPLINE);
- mp_xfree (s);
}
@
@@ -1492,7 +1525,6 @@ mp->ps->job_id_string = NULL;
void mp_set_job_id (MP mp) {
char *name_string, *format_string, *s;
size_t slen;
- int i;
if (mp->ps->job_id_string != NULL)
return;
if ( mp->job_name==NULL )
@@ -1503,14 +1535,15 @@ void mp_set_job_id (MP mp) {
strlen (name_string) +
strlen (format_string);
s = mp_xmalloc (mp,slen, sizeof (char));
- i = snprintf (s, slen,
- "%.4d/%.2d/%.2d %.2d:%.2d %s %s",
- (mp->internal[mp_year]>>16),
- (mp->internal[mp_month]>>16),
- (mp->internal[mp_day]>>16),
- (mp->internal[mp_time]>>16) / 60,
- (mp->internal[mp_time]>>16) % 60,
- name_string, format_string);
+ @= /*@@-bufferoverflowhigh@@*/ @>
+ sprintf (s,"%.4u/%.2u/%.2u %.2u:%.2u %s %s",
+ ((unsigned)mp->internal[mp_year]>>16),
+ ((unsigned)mp->internal[mp_month]>>16),
+ ((unsigned)mp->internal[mp_day]>>16),
+ ((unsigned)mp->internal[mp_time]>>16) / 60,
+ ((unsigned)mp->internal[mp_time]>>16) % 60,
+ name_string, format_string);
+ @= /*@@=bufferoverflowhigh@@*/ @>
mp->ps->job_id_string = mp_xstrdup (mp,s);
mp_xfree (s);
mp_xfree (name_string);
@@ -1533,11 +1566,11 @@ mp_xfree(mp->ps->job_id_string);
subsets prefixes somewhat disjunct
@c
-static unsigned long crc32 (int oldcrc, const Byte *buf, int len) {
+static unsigned long crc32 (unsigned long oldcrc, const Byte *buf, size_t len) {
unsigned long ret = 0;
- int i;
+ size_t i;
if (oldcrc==0)
- ret = (23<<24)+(45<<16)+(67<<8)+89;
+ ret = (unsigned long)((23<<24)+(45<<16)+(67<<8)+89);
else
for (i=0;i<len;i++)
ret = (ret<<2)+buf[i];
@@ -1552,7 +1585,7 @@ static boolean mp_char_marked (MP mp,font_number f, eight_bits c) {
return false;
}
-static void make_subset_tag (MP mp, fm_entry * fm_cur, char **glyph_names, int tex_font)
+static void make_subset_tag (MP mp, fm_entry * fm_cur, char **glyph_names, font_number tex_font)
{
char tag[7];
unsigned long crc;
@@ -1579,7 +1612,7 @@ static void make_subset_tag (MP mp, fm_entry * fm_cur, char **glyph_names, int t
fnstr_append (mp,"built-in");
fnstr_append (mp," CharSet: ");
for (i = 0; i < 256; i++)
- if (mp_char_marked (mp,tex_font, i) && glyph_names[i] != notdef) {
+ if (mp_char_marked (mp,tex_font, (eight_bits)i) && glyph_names[i] != notdef) {
if (glyph_names[i]!=NULL) {
fnstr_append (mp,"/");
fnstr_append (mp,glyph_names[i]);
@@ -1609,7 +1642,7 @@ static void make_subset_tag (MP mp, fm_entry * fm_cur, char **glyph_names, int t
@
@d external_enc() (fm_cur->encoding)->glyph_names
-@d is_used_char(c) mp_char_marked (mp, tex_font, c)
+@d is_used_char(c) mp_char_marked (mp, tex_font, (eight_bits)c)
@d end_last_eexec_line()
mp->ps->hexline_length = HEXLINE_WIDTH;
end_hexline(mp);
@@ -1636,13 +1669,13 @@ mp->ps->dvips_extra_charset=NULL;
mp->ps->t1_byte_waiting=0;
@
-@d t1_ungetchar(A) mp->ps->t1_byte_waiting=A
+@d t1_ungetchar(A) mp->ps->t1_byte_waiting=(int)(A)
@d t1_eof() (mp->eof_file)(mp,mp->ps->t1_file)
@d t1_close() (mp->close_file)(mp,mp->ps->t1_file)
@d valid_code(c) (c >= 0 && c < 256)
@c
-int t1_getchar (MP mp) {
+static int t1_getchar (MP mp) {
size_t len = 1;
unsigned char abyte=0;
void *byte_ptr = &abyte;
@@ -1652,7 +1685,7 @@ int t1_getchar (MP mp) {
} else {
(mp->read_binary_file)(mp,mp->ps->t1_file,&byte_ptr,&len);
}
- return abyte;
+ return (int)abyte;
}
@ @<Static variables in the outer block@>=
@@ -1754,16 +1787,15 @@ typedef struct {
boolean valid;
} cs_entry;
-@ @<Glob...@>=
+@
+@d t1_c1 52845
+@d t1_c2 22719
+
+@<Glob...@>=
unsigned short t1_dr, t1_er;
-unsigned short t1_c1, t1_c2;
unsigned short t1_cslen;
short t1_lenIV;
-@ @<Set initial...@>=
-mp->ps->t1_c1 = 52845;
-mp->ps->t1_c2 = 22719;
-
@ @<Types...@>=
typedef char t1_line_entry;
typedef char t1_buf_entry;
@@ -1802,7 +1834,7 @@ static const char *cs_token_pairs_list[][2] = {
const char **cs_token_pair;
boolean t1_pfa, t1_cs, t1_scan, t1_eexec_encrypt, t1_synthetic;
int t1_in_eexec; /* 0 before eexec-encrypted, 1 during, 2 after */
-long t1_block_length;
+int t1_block_length;
int last_hexbyte;
void *t1_file;
int hexline_length;
@@ -1823,8 +1855,6 @@ mp->ps->hexline_length = 0;
@d t1_end_eexec() t1_suffix("mark currentfile closefile")
@d t1_cleartomark() t1_prefix("cleartomark")
-@d isdigit(A) ((A)>='0'&&(A)<='9')
-
@c
static void end_hexline (MP mp) {
if (mp->ps->hexline_length >= HEXLINE_WIDTH) {
@@ -1848,13 +1878,13 @@ static int t1_getbyte (MP mp)
c = t1_getchar (mp);
if (c == 3) {
while (!t1_eof ())
- t1_getchar (mp);
+ (void)t1_getchar (mp);
return EOF;
}
mp->ps->t1_block_length = t1_getchar (mp) & 0xff;
- mp->ps->t1_block_length |= (t1_getchar (mp) & 0xff) << 8;
- mp->ps->t1_block_length |= (t1_getchar (mp) & 0xff) << 16;
- mp->ps->t1_block_length |= (t1_getchar (mp) & 0xff) << 24;
+ mp->ps->t1_block_length |= (unsigned)(t1_getchar (mp) & 0xff) << 8;
+ mp->ps->t1_block_length |= (unsigned)(t1_getchar (mp) & 0xff) << 16;
+ mp->ps->t1_block_length |= (unsigned)(t1_getchar (mp) & 0xff) << 24;
c = t1_getchar (mp);
}
mp->ps->t1_block_length--;
@@ -1874,36 +1904,37 @@ static byte edecrypt (MP mp, byte cipher) {
byte plain;
if (mp->ps->t1_pfa) {
while (cipher == 10 || cipher == 13)
- cipher = t1_getbyte (mp);
- mp->ps->last_hexbyte = cipher = (hexval (cipher) << 4) + hexval (t1_getbyte (mp));
+ cipher = (byte)t1_getbyte (mp);
+ mp->ps->last_hexbyte = cipher = (byte)(((byte)hexval (cipher) << 4) +
+ hexval (t1_getbyte (mp)));
}
plain = (cipher ^ (mp->ps->t1_dr >> 8));
- mp->ps->t1_dr = (cipher + mp->ps->t1_dr) * mp->ps->t1_c1 + mp->ps->t1_c2;
+ mp->ps->t1_dr = (cipher + mp->ps->t1_dr) * t1_c1 + t1_c2;
return plain;
}
-static byte cdecrypt (MP mp, byte cipher, unsigned short *cr)
+static byte cdecrypt (byte cipher, unsigned short *cr)
{
const byte plain = (cipher ^ (*cr >> 8));
- *cr = (cipher + *cr) * mp->ps->t1_c1 + mp->ps->t1_c2;
+ *cr = (cipher + *cr) * t1_c1 + t1_c2;
return plain;
}
static byte eencrypt (MP mp, byte plain)
{
const byte cipher = (plain ^ (mp->ps->t1_er >> 8));
- mp->ps->t1_er = (cipher + mp->ps->t1_er) * mp->ps->t1_c1 + mp->ps->t1_c2;
+ mp->ps->t1_er = (cipher + mp->ps->t1_er) * t1_c1 + t1_c2;
return cipher;
}
-static byte cencrypt (MP mp, byte plain, unsigned short *cr)
+static byte cencrypt (byte plain, unsigned short *cr)
{
const byte cipher = (plain ^ (*cr >> 8));
- *cr = (cipher + *cr) * mp->ps->t1_c1 + mp->ps->t1_c2;
+ *cr = (cipher + *cr) * t1_c1 + t1_c2;
return cipher;
}
static char *eol (char *s) {
char *p = strend (s);
- if (p - s > 1 && p[-1] != 10) {
+ if (p!=NULL && p - s > 1 && p[-1] != 10) {
*p++ = 10;
*p = 0;
}
@@ -1916,11 +1947,11 @@ static float t1_scan_num (MP mp, char *p, char **r)
skip (p, ' ');
if (sscanf (p, "%g", &f) != 1) {
remove_eol (p, mp->ps->t1_line_array);
- snprintf(s,128, "a number expected: `%s'", mp->ps->t1_line_array);
+ mp_snprintf(s,128, "a number expected: `%s'", mp->ps->t1_line_array);
mp_fatal_error(mp,s);
}
if (r != NULL) {
- for (; isdigit (*p) || *p == '.' ||
+ for (; mp_isdigit (*p) || *p == '.' ||
*p == 'e' || *p == 'E' || *p == '+' || *p == '-'; p++);
*r = p;
}
@@ -1945,17 +1976,17 @@ static boolean str_suffix (const char *begin_buf, const char *end_buf,
@d alloc_array(T, n, s) do {
if (mp->ps->T##_array == NULL) {
mp->ps->T##_limit = (s);
- if ((unsigned)(n) > mp->ps->T##_limit)
- mp->ps->T##_limit = (n);
+ if ((size_t)(n) > mp->ps->T##_limit)
+ mp->ps->T##_limit = (size_t)(n);
mp->ps->T##_array = mp_xmalloc (mp,mp->ps->T##_limit,sizeof(T##_entry));
mp->ps->T##_ptr = mp->ps->T##_array;
}
- else if ((unsigned)(mp->ps->T##_ptr - mp->ps->T##_array + (n)) > mp->ps->T##_limit) {
+ else if ((size_t)(mp->ps->T##_ptr - mp->ps->T##_array + (n)) > mp->ps->T##_limit) {
size_t last_ptr_index;
- last_ptr_index = mp->ps->T##_ptr - mp->ps->T##_array;
+ last_ptr_index = (size_t)(mp->ps->T##_ptr - mp->ps->T##_array);
mp->ps->T##_limit *= 2;
- if ((unsigned)(mp->ps->T##_ptr - mp->ps->T##_array + (n)) > mp->ps->T##_limit)
- mp->ps->T##_limit = mp->ps->T##_ptr - mp->ps->T##_array + (n);
+ if ((size_t)(mp->ps->T##_ptr - mp->ps->T##_array + (n)) > mp->ps->T##_limit)
+ mp->ps->T##_limit = (size_t)(mp->ps->T##_ptr - mp->ps->T##_array + (n));
mp->ps->T##_array = mp_xrealloc(mp,mp->ps->T##_array,mp->ps->T##_limit, sizeof(T##_entry));
mp->ps->T##_ptr = mp->ps->T##_array + last_ptr_index;
}
@@ -1989,7 +2020,7 @@ static void t1_getline (MP mp) {
goto EXIT;
while (!t1_eof ()) {
if (mp->ps->t1_in_eexec == 1)
- c = edecrypt (mp,c);
+ c = edecrypt (mp,(byte)c);
alloc_array (t1_line, 1, T1_BUF_SIZE);
append_char_to_buf (c, mp->ps->t1_line_ptr, mp->ps->t1_line_array, mp->ps->t1_line_limit);
if (mp->ps->t1_in_eexec == 0 && eexec_scan >= 0 && eexec_scan < eexec_len) {
@@ -2006,12 +2037,15 @@ static void t1_getline (MP mp) {
p = mp->ps->t1_line_ptr - 5;
while (*p != ' ')
p--;
- mp->ps->t1_cslen = l = t1_scan_num (mp, p + 1, 0);
+ l = (int)t1_scan_num (mp, p + 1, 0);
+ mp->ps->t1_cslen = (unsigned short)l;
mp->ps->cs_start = mp->ps->t1_line_ptr - mp->ps->t1_line_array;
/* |mp->ps->cs_start| is an index now */
alloc_array (t1_line, l, T1_BUF_SIZE);
- while (l-- > 0)
- *mp->ps->t1_line_ptr++ = edecrypt (mp,t1_getbyte (mp));
+ while (l-- > 0) {
+ *mp->ps->t1_line_ptr = (t1_line_entry)edecrypt (mp,(byte)t1_getbyte (mp));
+ mp->ps->t1_line_ptr++;
+ }
}
c = t1_getbyte (mp);
}
@@ -2034,7 +2068,7 @@ static void t1_putline (MP mp)
return;
if (mp->ps->t1_eexec_encrypt) {
while (p < mp->ps->t1_line_ptr)
- out_eexec_char (eencrypt (mp,*p++));
+ out_eexec_char (eencrypt (mp,(byte)*p++));
} else {
while (p < mp->ps->t1_line_ptr)
t1_putchar (*p++);
@@ -2049,16 +2083,7 @@ static void t1_puts (MP mp, const char *s)
t1_putline (mp);
}
-static void t1_printf (MP mp, const char *fmt, ...)
-{
- va_list args;
- va_start (args, fmt);
- vsprintf (mp->ps->t1_line_array, fmt, args);
- t1_puts (mp,mp->ps->t1_line_array);
- va_end (args);
-}
-
-static void t1_init_params (MP mp, char *open_name_prefix,
+static void t1_init_params (MP mp, const char *open_name_prefix,
char *cur_file_name) {
if ((open_name_prefix != NULL) && strlen(open_name_prefix)) {
t1_log (open_name_prefix);
@@ -2089,13 +2114,13 @@ static void t1_check_block_len (MP mp, boolean decrypt) {
return;
c = t1_getbyte (mp);
if (decrypt)
- c = edecrypt (mp,c);
+ c = edecrypt (mp,(byte)c);
l = mp->ps->t1_block_length;
if (!(l == 0 && (c == 10 || c == 13))) {
- snprintf(s,128,"%i bytes more than expected were ignored", l+ 1);
+ mp_snprintf(s,128,"%i bytes more than expected were ignored", l+ 1);
mp_warn(mp,s);
while (l-- > 0)
- t1_getbyte (mp);
+ (void)t1_getbyte (mp);
}
}
static void t1_start_eexec (MP mp, fm_entry *fm_cur) {
@@ -2103,7 +2128,7 @@ static void t1_start_eexec (MP mp, fm_entry *fm_cur) {
if (!mp->ps->t1_pfa)
t1_check_block_len (mp, false);
for (mp->ps->t1_line_ptr = mp->ps->t1_line_array, i = 0; i < 4; i++) {
- edecrypt (mp, t1_getbyte (mp));
+ (void)edecrypt (mp, (byte)t1_getbyte (mp));
*mp->ps->t1_line_ptr++ = 0;
}
mp->ps->t1_eexec_encrypt = true;
@@ -2117,7 +2142,7 @@ static void t1_stop_eexec (MP mp) {
if (!mp->ps->t1_pfa)
t1_check_block_len (mp,true);
else {
- c = edecrypt (mp, t1_getbyte (mp));
+ c = edecrypt (mp, (byte)t1_getbyte (mp));
if (!(c == 10 || c == 13)) {
if (mp->ps->last_hexbyte == 0)
t1_puts (mp,"00");
@@ -2178,7 +2203,7 @@ static key_entry font_keys[FONT_KEYS_NUM] = {
@d MAX_KEY_CODE (FONTBBOX1_CODE + 1)
@c
-static void t1_scan_keys (MP mp, int tex_font,fm_entry *fm_cur) {
+static void t1_scan_keys (MP mp, font_number tex_font,fm_entry *fm_cur) {
int i, k;
char *p, *r;
key_entry *key;
@@ -2194,9 +2219,9 @@ static void t1_scan_keys (MP mp, int tex_font,fm_entry *fm_cur) {
}
if (t1_prefix ("/FontType")) {
p = mp->ps->t1_line_array + strlen ("FontType") + 1;
- if ((i = t1_scan_num (mp,p, 0)) != 1) {
+ if ((i = (int)t1_scan_num (mp,p, 0)) != 1) {
char s[128];
- snprintf(s,125,"Type%d fonts unsupported by metapost", i);
+ mp_snprintf(s,125,"Type%d fonts unsupported by metapost", i);
mp_fatal_error(mp,s);
}
return;
@@ -2213,7 +2238,7 @@ static void t1_scan_keys (MP mp, int tex_font,fm_entry *fm_cur) {
if (*p != '/') {
char s[128];
remove_eol (p, mp->ps->t1_line_array);
- snprintf(s,128,"a name expected: `%s'", mp->ps->t1_line_array);
+ mp_snprintf(s,128,"a name expected: `%s'", mp->ps->t1_line_array);
mp_fatal_error(mp,s);
}
r = ++p; /* skip the slash */
@@ -2255,13 +2280,13 @@ static void t1_scan_keys (MP mp, int tex_font,fm_entry *fm_cur) {
}
key->value = t1_scan_num (mp, p, 0);
}
-static void t1_scan_param (MP mp, int tex_font,fm_entry *fm_cur)
+static void t1_scan_param (MP mp, font_number tex_font,fm_entry *fm_cur)
{
static const char *lenIV = "/lenIV";
if (!mp->ps->t1_scan || *mp->ps->t1_line_array != '/')
return;
if (t1_prefix (lenIV)) {
- mp->ps->t1_lenIV = t1_scan_num (mp,mp->ps->t1_line_array + strlen (lenIV), 0);
+ mp->ps->t1_lenIV = (short int)t1_scan_num (mp,mp->ps->t1_line_array + strlen (lenIV), 0);
return;
}
t1_scan_keys (mp, tex_font,fm_cur);
@@ -2282,7 +2307,7 @@ static void t1_builtin_enc (MP mp) {
* At this moment "/Encoding" is the prefix of |mp->ps->t1_line_array|
*/
if (t1_suffix ("def")) { /* predefined encoding */
- sscanf (mp->ps->t1_line_array + strlen ("/Encoding"), "%256s", mp->ps->t1_buf_array);
+ (void)sscanf (mp->ps->t1_line_array + strlen ("/Encoding"), "%256s", mp->ps->t1_buf_array);
if (strcmp (mp->ps->t1_buf_array, "StandardEncoding") == 0) {
for (i = 0; i < 256; i++)
if (standard_glyph_names[i] == notdef)
@@ -2293,7 +2318,7 @@ static void t1_builtin_enc (MP mp) {
mp->ps->t1_encoding = ENC_STANDARD;
} else {
char s[128];
- snprintf(s,128, "cannot subset font (unknown predefined encoding `%s')",
+ mp_snprintf(s,128, "cannot subset font (unknown predefined encoding `%s')",
mp->ps->t1_buf_array);
mp_fatal_error(mp,s);
}
@@ -2343,7 +2368,7 @@ static void t1_builtin_enc (MP mp) {
else {
char s[128];
remove_eol (r, mp->ps->t1_line_array);
- snprintf(s,128,"a name or `] def' or `] readonly def' expected: `%s'",
+ mp_snprintf(s,128,"a name or `] def' or `] readonly def' expected: `%s'",
mp->ps->t1_line_array);
mp_fatal_error(mp,s);
}
@@ -2353,7 +2378,7 @@ static void t1_builtin_enc (MP mp) {
}
} else { /* the second case */
p = strchr (mp->ps->t1_line_array, 10);
- for (;;) {
+ for (;p!=NULL;) {
if (*p == 10) {
t1_getline (mp);
p = mp->ps->t1_line_array;
@@ -2426,18 +2451,20 @@ typedef struct {
static boolean t1_open_fontfile (MP mp, fm_entry *fm_cur,const char *open_name_prefix) {
ff_entry *ff;
ff = check_ff_exist (mp, fm_cur);
+ mp->ps->t1_file = NULL;
if (ff->ff_path != NULL) {
mp->ps->t1_file = (mp->open_file)(mp,ff->ff_path, "r", mp_filetype_font);
- } else {
+ }
+ if (mp->ps->t1_file == NULL) {
mp_warn (mp, "cannot open Type 1 font file for reading");
return false;
}
- t1_init_params (mp,(char *)open_name_prefix,fm_cur->ff_name);
+ t1_init_params (mp,open_name_prefix,fm_cur->ff_name);
mp->ps->fontfile_found = true;
return true;
}
-static void t1_scan_only (MP mp, int tex_font, fm_entry *fm_cur) {
+static void t1_scan_only (MP mp, font_number tex_font, fm_entry *fm_cur) {
do {
t1_getline (mp);
t1_scan_param (mp,tex_font, fm_cur);
@@ -2451,7 +2478,7 @@ static void t1_scan_only (MP mp, int tex_font, fm_entry *fm_cur) {
while (!(t1_charstrings () || t1_subrs ()));
}
-static void t1_include (MP mp, int tex_font, fm_entry *fm_cur) {
+static void t1_include (MP mp, font_number tex_font, fm_entry *fm_cur) {
do {
t1_getline (mp);
t1_scan_param (mp,tex_font, fm_cur);
@@ -2485,7 +2512,7 @@ static void t1_include (MP mp, int tex_font, fm_entry *fm_cur) {
@
@d check_subr(SUBR) if (SUBR >= mp->ps->subr_size || SUBR < 0) {
char s[128];
- snprintf(s,128,"Subrs array: entry index out of range (%i)",SUBR);
+ mp_snprintf(s,128,"Subrs array: entry index out of range (%i)",SUBR);
mp_fatal_error(mp,s);
}
@@ -2506,14 +2533,14 @@ static void cs_store (MP mp, boolean is_subr) {
*mp->ps->t1_buf_ptr++ = *p++);
*mp->ps->t1_buf_ptr = 0;
if (is_subr) {
- subr = t1_scan_num (mp, p + 1, 0);
+ subr = (int)t1_scan_num (mp, p + 1, 0);
check_subr (subr);
ptr = mp->ps->subr_tab + subr;
} else {
ptr = mp->ps->cs_ptr++;
if (mp->ps->cs_ptr - mp->ps->cs_tab > mp->ps->cs_size) {
char s[128];
- snprintf(s,128,"CharStrings dict: more entries than dict size (%i)",mp->ps->cs_size);
+ mp_snprintf(s,128,"CharStrings dict: more entries than dict size (%i)",mp->ps->cs_size);
mp_fatal_error(mp,s);
}
if (strcmp (mp->ps->t1_buf_array + 1, notdef) == 0) /* skip the slash */
@@ -2523,17 +2550,17 @@ static void cs_store (MP mp, boolean is_subr) {
}
/* copy " RD " + cs data to |mp->ps->t1_buf_array| */
memcpy (mp->ps->t1_buf_array, mp->ps->t1_line_array + mp->ps->cs_start - 4,
- (unsigned) (mp->ps->t1_cslen + 4));
+ (size_t) (mp->ps->t1_cslen + 4));
/* copy the end of cs data to |mp->ps->t1_buf_array| */
for (p = mp->ps->t1_line_array + mp->ps->cs_start + mp->ps->t1_cslen, mp->ps->t1_buf_ptr =
mp->ps->t1_buf_array + mp->ps->t1_cslen + 4; *p != 10; *mp->ps->t1_buf_ptr++ = *p++);
*mp->ps->t1_buf_ptr++ = 10;
if (is_subr && mp->ps->cs_token_pair == NULL)
mp->ps->cs_token_pair = check_cs_token_pair (mp);
- ptr->len = mp->ps->t1_buf_ptr - mp->ps->t1_buf_array;
+ ptr->len = (unsigned short)(mp->ps->t1_buf_ptr - mp->ps->t1_buf_array);
ptr->cslen = mp->ps->t1_cslen;
- ptr->data = mp_xmalloc (mp,ptr->len , sizeof (byte));
- memcpy (ptr->data, mp->ps->t1_buf_array, ptr->len);
+ ptr->data = mp_xmalloc (mp, (size_t)ptr->len , sizeof (byte));
+ memcpy (ptr->data, mp->ps->t1_buf_array, (size_t)ptr->len);
ptr->valid = true;
}
@@ -2554,7 +2581,7 @@ static boolean is_cc_init = false;
#define stack_error(N) { \
char s[256]; \
- snprintf(s,255,"CharString: invalid access (%i) to stack (%i entries)", \
+ mp_snprintf(s,255,"CharString: invalid access (%i) to stack (%i entries)", \
(int) N, (int)(stack_ptr - cc_stack)); \
mp_warn(mp,s); \
goto cs_error; \
@@ -2611,7 +2638,7 @@ static void cc_init (void) {
@
-@d cs_getchar(mp) cdecrypt(mp,*data++, &cr)
+@d cs_getchar(mp) cdecrypt(*data++, &cr)
@d mark_subr(mp,n) cs_mark(mp,0, n)
@d mark_cs(mp,s) cs_mark(mp,s, 0)
@@ -2623,12 +2650,14 @@ static void cs_warn (MP mp, const char *cs_name, int subr, const char *fmt, ...)
char s[300];
va_list args;
va_start (args, fmt);
- vsprintf (buf, fmt, args);
+ @= /*@@-bufferoverflowhigh@@*/ @>
+ (void)vsprintf (buf, fmt, args);
+ @= /*@@=bufferoverflowhigh@@*/ @>
va_end (args);
if (cs_name == NULL) {
- snprintf(s,299,"Subr (%i): %s", (int) subr, buf);
+ mp_snprintf(s,299,"Subr (%i): %s", (int) subr, buf);
} else {
- snprintf(s,299,"CharString (/%s): %s", cs_name, buf);
+ mp_snprintf(s,299,"CharString (/%s): %s", cs_name, buf);
}
mp_warn(mp,s);
}
@@ -2658,7 +2687,7 @@ static void cs_mark (MP mp, const char *cs_name, int subr)
break;
if (ptr == mp->ps->cs_ptr) {
char s[128];
- snprintf (s,128,"glyph `%s' undefined", cs_name);
+ mp_snprintf (s,128,"glyph `%s' undefined", cs_name);
mp_warn(mp,s);
return;
}
@@ -2672,10 +2701,10 @@ static void cs_mark (MP mp, const char *cs_name, int subr)
return;
ptr->is_used = true;
cr = 4330;
- cs_len = ptr->cslen;
+ cs_len = (int)ptr->cslen;
data = ptr->data + 4;
for (i = 0; i < mp->ps->t1_lenIV; i++, cs_len--)
- cs_getchar (mp);
+ (void)cs_getchar (mp);
while (cs_len > 0) {
--cs_len;
b = cs_getchar (mp);
@@ -2684,10 +2713,10 @@ static void cs_mark (MP mp, const char *cs_name, int subr)
a = b - 139;
else if (b <= 250) {
--cs_len;
- a = ((b - 247) << 8) + 108 + cs_getchar (mp);
+ a = (int)((unsigned)(b - 247) << 8) + 108 + cs_getchar (mp);
} else if (b <= 254) {
--cs_len;
- a = -((b - 251) << 8) - 108 - cs_getchar (mp);
+ a = -(int)((unsigned)(b - 251) << 8) - 108 - cs_getchar (mp);
} else {
cs_len -= 4;
a = (cs_getchar (mp) & 0xff) << 24;
@@ -2770,7 +2799,7 @@ static void cs_mark (MP mp, const char *cs_name, int subr)
ptr->is_used = false;
}
-static void t1_subset_ascii_part (MP mp, int tex_font, fm_entry *fm_cur)
+static void t1_subset_ascii_part (MP mp, font_number tex_font, fm_entry *fm_cur)
{
int i, j;
t1_getline (mp);
@@ -2798,8 +2827,10 @@ static void t1_subset_ascii_part (MP mp, int tex_font, fm_entry *fm_cur)
for (i = 0, j = 0; i < 256; i++) {
if (is_used_char (i) && mp->ps->t1_glyph_names[i] != notdef) {
j++;
- t1_printf (mp,"dup %i /%s put\n", (int) t1_char (i),
- mp->ps->t1_glyph_names[i]);
+ mp_snprintf (mp->ps->t1_line_array, (int)mp->ps->t1_line_limit,
+ "dup %i /%s put\n", (int) t1_char (i),
+ mp->ps->t1_glyph_names[i]);
+ t1_puts(mp,mp->ps->t1_line_array);
}
}
/* We didn't mark anything for the Encoding array. */
@@ -2840,9 +2871,9 @@ static void init_cs_entry ( cs_entry * cs) {
cs->valid = false;
}
-static void t1_mark_glyphs (MP mp, int tex_font);
+static void t1_mark_glyphs (MP mp, font_number tex_font);
-static void t1_read_subrs (MP mp, int tex_font, fm_entry *fm_cur)
+static void t1_read_subrs (MP mp, font_number tex_font, fm_entry *fm_cur)
{
int i, s;
cs_entry *ptr;
@@ -2857,16 +2888,16 @@ static void t1_read_subrs (MP mp, int tex_font, fm_entry *fm_cur)
mp->ps->t1_scan = false;
if (!t1_subrs ())
return;
- mp->ps->subr_size_pos = strlen ("/Subrs") + 1;
+ mp->ps->subr_size_pos = (int)(strlen ("/Subrs") + 1);
/* |subr_size_pos| points to the number indicating dict size after "/Subrs" */
- mp->ps->subr_size = t1_scan_num (mp,mp->ps->t1_line_array + mp->ps->subr_size_pos, 0);
+ mp->ps->subr_size = (int)t1_scan_num (mp,mp->ps->t1_line_array + mp->ps->subr_size_pos, 0);
if (mp->ps->subr_size == 0) {
while (!t1_charstrings ())
t1_getline (mp);
return;
}
/* |subr_tab = xtalloc (subr_size, cs_entry);| */
- mp->ps->subr_tab = (cs_entry *)mp_xmalloc (mp,mp->ps->subr_size, sizeof (cs_entry));
+ mp->ps->subr_tab = (cs_entry *)mp_xmalloc (mp,(size_t)mp->ps->subr_size, sizeof (cs_entry));
for (ptr = mp->ps->subr_tab; ptr - mp->ps->subr_tab < mp->ps->subr_size; ptr++)
init_cs_entry (ptr);
mp->ps->subr_array_start = mp_xstrdup (mp,mp->ps->t1_line_array);
@@ -2941,9 +2972,9 @@ static void t1_flush_cs (MP mp, boolean is_subr)
mp->ps->t1_line_ptr = mp->ps->t1_line_array;
for (p = start_line; p - start_line < size_pos;)
*mp->ps->t1_line_ptr++ = *p++;
- while (isdigit (*p))
+ while (mp_isdigit (*p))
p++;
- sprintf (mp->ps->t1_line_ptr, "%u", count);
+ mp_snprintf (mp->ps->t1_line_ptr, (int)mp->ps->t1_line_limit, "%u", (unsigned)count);
strcat (mp->ps->t1_line_ptr, p);
mp->ps->t1_line_ptr = eol (mp->ps->t1_line_array);
t1_putline (mp);
@@ -2952,11 +2983,12 @@ static void t1_flush_cs (MP mp, boolean is_subr)
if (is_subr) {
cr = 4330;
cs_len = 0;
- return_cs = mp_xmalloc (mp, (mp->ps->t1_lenIV + 1) , sizeof(byte));
+ return_cs = mp_xmalloc (mp, (size_t)(mp->ps->t1_lenIV + 1) , sizeof(byte));
if ( mp->ps->t1_lenIV > 0) {
- for (cs_len = 0, r = return_cs; cs_len < mp->ps->t1_lenIV; cs_len++, r++)
- *r = cencrypt (mp,0x00, &cr);
- *r = cencrypt (mp,CS_RETURN, &cr);
+ for (cs_len = 0, r = return_cs;
+ cs_len<(unsigned short)mp->ps->t1_lenIV; cs_len++, r++)
+ *r = cencrypt (0x00, &cr);
+ *r = cencrypt (CS_RETURN, &cr);
} else {
*return_cs = CS_RETURN;
}
@@ -2966,24 +2998,27 @@ static void t1_flush_cs (MP mp, boolean is_subr)
for (ptr = tab; ptr < end_tab; ptr++) {
if (ptr->is_used) {
if (is_subr)
- sprintf (mp->ps->t1_line_array, "dup %i %u", (int) (ptr - tab),
- ptr->cslen);
+ mp_snprintf (mp->ps->t1_line_array, (int)mp->ps->t1_line_limit,
+ "dup %i %u", (int) (ptr - tab), ptr->cslen);
else
- sprintf (mp->ps->t1_line_array, "/%s %u", ptr->glyph_name, ptr->cslen);
+ mp_snprintf (mp->ps->t1_line_array, (int)mp->ps->t1_line_limit,
+ "/%s %u", ptr->glyph_name, ptr->cslen);
p = strend (mp->ps->t1_line_array);
- memcpy (p, ptr->data, ptr->len);
+ memcpy (p, ptr->data, (size_t)ptr->len);
mp->ps->t1_line_ptr = p + ptr->len;
t1_putline (mp);
} else {
/* replace unsused subr's by |return_cs| */
if (is_subr) {
- sprintf (mp->ps->t1_line_array, "dup %i %u%s ", (int) (ptr - tab),
+ mp_snprintf (mp->ps->t1_line_array, (int)mp->ps->t1_line_limit,
+ "dup %i %u%s ", (int) (ptr - tab),
cs_len, mp->ps->cs_token_pair[0]);
p = strend (mp->ps->t1_line_array);
- memcpy (p, return_cs, cs_len);
+ memcpy (p, return_cs, (size_t)cs_len);
mp->ps->t1_line_ptr = p + cs_len;
t1_putline (mp);
- sprintf (mp->ps->t1_line_array, " %s", mp->ps->cs_token_pair[1]);
+ mp_snprintf (mp->ps->t1_line_array, (int)mp->ps->t1_line_limit,
+ " %s", mp->ps->cs_token_pair[1]);
mp->ps->t1_line_ptr = eol (mp->ps->t1_line_array);
t1_putline (mp);
}
@@ -2992,7 +3027,7 @@ static void t1_flush_cs (MP mp, boolean is_subr)
if (ptr->glyph_name != notdef)
mp_xfree (ptr->glyph_name);
}
- sprintf (mp->ps->t1_line_array, "%s", line_end);
+ mp_snprintf (mp->ps->t1_line_array, (int)mp->ps->t1_line_limit, "%s", line_end);
mp->ps->t1_line_ptr = eol (mp->ps->t1_line_array);
t1_putline (mp);
if (is_subr)
@@ -3002,7 +3037,7 @@ static void t1_flush_cs (MP mp, boolean is_subr)
mp_xfree (line_end);
}
-static void t1_mark_glyphs (MP mp, int tex_font)
+static void t1_mark_glyphs (MP mp, font_number tex_font)
{
int i;
char *charset = extra_charset ();
@@ -3026,7 +3061,7 @@ static void t1_mark_glyphs (MP mp, int tex_font)
if (is_used_char (i)) {
if (mp->ps->t1_glyph_names[i] == notdef) {
char S[128];
- snprintf(S,128, "character %i is mapped to %s", i, notdef);
+ mp_snprintf(S,128, "character %i is mapped to %s", i, notdef);
mp_warn(mp,S);
} else
mark_cs (mp,mp->ps->t1_glyph_names[i]);
@@ -3051,7 +3086,7 @@ static void t1_mark_glyphs (MP mp, int tex_font)
mp->ps->subr_max = ptr - mp->ps->subr_tab;
}
-static void t1_subset_charstrings (MP mp, int tex_font)
+static void t1_subset_charstrings (MP mp, font_number tex_font)
{
cs_entry *ptr;
mp->ps->cs_size_pos =
@@ -3059,8 +3094,8 @@ static void t1_subset_charstrings (MP mp, int tex_font)
- mp->ps->t1_line_array + 1;
/* |cs_size_pos| points to the number indicating
dict size after "/CharStrings" */
- mp->ps->cs_size = t1_scan_num (mp,mp->ps->t1_line_array + mp->ps->cs_size_pos, 0);
- mp->ps->cs_ptr = mp->ps->cs_tab = mp_xmalloc (mp,mp->ps->cs_size, sizeof(cs_entry));
+ mp->ps->cs_size = (int)t1_scan_num (mp,mp->ps->t1_line_array + mp->ps->cs_size_pos, 0);
+ mp->ps->cs_ptr = mp->ps->cs_tab = mp_xmalloc (mp,(size_t)mp->ps->cs_size, sizeof(cs_entry));
for (ptr = mp->ps->cs_tab; ptr - mp->ps->cs_tab < mp->ps->cs_size; ptr++)
init_cs_entry (ptr);
mp->ps->cs_notdef = NULL;
@@ -3110,7 +3145,7 @@ static void t1_subset_end (MP mp)
}
}
-static int t1_updatefm (MP mp, int f, fm_entry *fm)
+static int t1_updatefm (MP mp, font_number f, fm_entry *fm)
{
char *s, *p;
mp->ps->read_encoding_only = true;
@@ -3129,8 +3164,8 @@ static int t1_updatefm (MP mp, int f, fm_entry *fm)
}
-static void writet1 (MP mp, int tex_font, fm_entry *fm_cur) {
- int save_selector = mp->selector;
+static void writet1 (MP mp, font_number tex_font, fm_entry *fm_cur) {
+ unsigned save_selector = mp->selector;
mp_normalize_selector(mp);
mp->ps->read_encoding_only = false;
if (!is_included (fm_cur)) { /* scan parameters from font file */
@@ -3231,51 +3266,49 @@ char fontname_buf[FONTNAME_BUF_SIZE];
@d fm_fontfile(fm) (fm)->ff_name
@<Declarations@>=
-static boolean mp_font_is_reencoded (MP mp, int f);
-static boolean mp_font_is_included (MP mp, int f);
-static boolean mp_font_is_subsetted (MP mp, int f);
+static boolean mp_font_is_reencoded (MP mp, font_number f);
+static boolean mp_font_is_included (MP mp, font_number f);
+static boolean mp_font_is_subsetted (MP mp, font_number f);
@ @c
-static boolean mp_font_is_reencoded (MP mp, int f) {
+boolean mp_font_is_reencoded (MP mp, font_number f) {
fm_entry *fm;
if (mp_has_font_size(mp,f) && mp_has_fm_entry (mp, f, &fm)) {
if (fm != NULL
&& (fm->ps_name != NULL)
&& is_reencoded (fm))
- return 1;
+ return true;
}
- return 0;
+ return false;
}
-static boolean mp_font_is_included (MP mp, int f) {
+boolean mp_font_is_included (MP mp, font_number f) {
fm_entry *fm;
if (mp_has_font_size(mp,f) && mp_has_fm_entry (mp, f, &fm)) {
if (fm != NULL
&& (fm->ps_name != NULL && fm->ff_name != NULL)
&& is_included (fm))
- return 1;
+ return true;
}
- return 0;
+ return false;
}
-static boolean mp_font_is_subsetted (MP mp, int f) {
+boolean mp_font_is_subsetted (MP mp, font_number f) {
fm_entry *fm;
if (mp_has_font_size(mp,f) && mp_has_fm_entry (mp, f,&fm)) {
if (fm != NULL
&& (fm->ps_name != NULL && fm->ff_name != NULL)
&& is_included (fm) && is_subsetted (fm))
- return 1;
+ return true;
}
- return 0;
+ return false;
}
-@ @<Exported function headers@>=
-char * mp_fm_encoding_name (MP mp, int f);
-char * mp_fm_font_name (MP mp, int f);
-
@ @<Declarations@>=
-static char * mp_fm_font_subset_name (MP mp, int f);
+static char * mp_fm_encoding_name (MP mp, font_number f);
+static char * mp_fm_font_name (MP mp, font_number f);
+static char * mp_fm_font_subset_name (MP mp, font_number f);
@
-@c char * mp_fm_encoding_name (MP mp, int f) {
+@c char * mp_fm_encoding_name (MP mp, font_number f) {
enc_entry *e;
fm_entry *fm;
if (mp_has_fm_entry (mp, f, &fm)) {
@@ -3294,7 +3327,7 @@ static char * mp_fm_font_subset_name (MP mp, int f);
mp_error(mp);
return NULL;
}
-char * mp_fm_font_name (MP mp, int f) {
+char * mp_fm_font_name (MP mp, font_number f) {
fm_entry *fm;
if (mp_has_fm_entry (mp, f,&fm)) {
if (fm != NULL && (fm->ps_name != NULL)) {
@@ -3317,13 +3350,13 @@ char * mp_fm_font_name (MP mp, int f) {
return NULL;
}
-static char * mp_fm_font_subset_name (MP mp, int f) {
+static char * mp_fm_font_subset_name (MP mp, font_number f) {
fm_entry *fm;
if (mp_has_fm_entry (mp, f, &fm)) {
if (fm != NULL && (fm->ps_name != NULL)) {
if (is_subsetted(fm)) {
char *s = mp_xmalloc(mp,strlen(fm->ps_name)+8,1);
- snprintf(s,strlen(fm->ps_name)+8,"%s-%s",fm->subset_tag,fm->ps_name);
+ mp_snprintf(s,(int)strlen(fm->ps_name)+8,"%s-%s",fm->subset_tag,fm->ps_name);
return s;
} else {
return mp_xstrdup(mp,fm->ps_name);
@@ -3337,11 +3370,11 @@ static char * mp_fm_font_subset_name (MP mp, int f) {
}
@ @<Declarations@>=
-static integer mp_fm_font_slant (MP mp, int f);
-static integer mp_fm_font_extend (MP mp, int f);
+static integer mp_fm_font_slant (MP mp, font_number f);
+static integer mp_fm_font_extend (MP mp, font_number f);
@
-@c static integer mp_fm_font_slant (MP mp, int f) {
+@c static integer mp_fm_font_slant (MP mp, font_number f) {
fm_entry *fm;
if (mp_has_fm_entry (mp, f, &fm)) {
if (fm != NULL && (fm->ps_name != NULL)) {
@@ -3350,7 +3383,7 @@ static integer mp_fm_font_extend (MP mp, int f);
}
return 0;
}
-static integer mp_fm_font_extend (MP mp, int f) {
+static integer mp_fm_font_extend (MP mp, font_number f) {
fm_entry *fm;
if (mp_has_fm_entry (mp, f, &fm)) {
if (fm != NULL && (fm->ps_name != NULL)) {
@@ -3367,10 +3400,10 @@ static boolean mp_do_ps_font (MP mp, font_number f);
fm_entry *fm_cur;
(void)mp_has_fm_entry (mp, f, &fm_cur); /* for side effects */
if (fm_cur == NULL)
- return 1;
+ return true;
if (is_truetype(fm_cur) ||
(fm_cur->ps_name == NULL && fm_cur->ff_name == NULL)) {
- return 0;
+ return false;
}
if (is_included(fm_cur)) {
mp_ps_print_nl(mp,"%%BeginResource: font ");
@@ -3384,7 +3417,7 @@ static boolean mp_do_ps_font (MP mp, font_number f);
mp_ps_print_nl(mp,"%%EndResource");
mp_ps_print_ln(mp);
}
- return 1;
+ return true;
}
@ Included subset fonts do not need and encoding vector, make
@@ -3396,7 +3429,7 @@ static void mp_list_used_resources (MP mp, int prologues, int procset);
@ @c static void mp_list_used_resources (MP mp, int prologues, int procset) {
font_number f; /* fonts used in a text node or as loop counters */
int ff; /* a loop counter */
- font_number ldf; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
+ int ldf; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
boolean firstitem;
if ( procset>0 )
mp_ps_print_nl(mp, "%%DocumentResources: procset mpost");
@@ -3407,14 +3440,14 @@ static void mp_list_used_resources (MP mp, int prologues, int procset);
for (f=null_font+1;f<=mp->last_fnum;f++) {
if ( (mp_has_font_size(mp,f))&&(mp_font_is_reencoded(mp,f)) ) {
for (ff=ldf;ff>=null_font;ff--) {
- if ( mp_has_font_size(mp,ff) )
+ if ( mp_has_font_size(mp,(font_number)ff) )
if ( mp_xstrcmp(mp->font_enc_name[f],mp->font_enc_name[ff])==0 )
goto FOUND;
}
if ( mp_font_is_subsetted(mp,f) )
goto FOUND;
if ( mp->ps->ps_offset+1+strlen(mp->font_enc_name[f])>
- (unsigned)mp->max_print_line )
+ (size_t)mp->max_print_line )
mp_ps_print_nl(mp, "%%+ encoding");
if ( firstitem ) {
firstitem=false;
@@ -3422,7 +3455,7 @@ static void mp_list_used_resources (MP mp, int prologues, int procset);
}
mp_ps_print_char(mp, ' ');
mp_ps_print(mp, mp->font_enc_name[f]);
- ldf=f;
+ ldf=(int)f;
}
FOUND:
;
@@ -3432,12 +3465,12 @@ static void mp_list_used_resources (MP mp, int prologues, int procset);
for (f=null_font+1;f<=mp->last_fnum;f++) {
if ( mp_has_font_size(mp,f) ) {
for (ff=ldf;ff>=null_font;ff--) {
- if ( mp_has_font_size(mp,ff) )
+ if ( mp_has_font_size(mp,(font_number)ff) )
if ( mp_xstrcmp(mp->font_name[f],mp->font_name[ff])==0 )
goto FOUND2;
}
if ( mp->ps->ps_offset+1+strlen(mp->font_ps_name[f])>
- (unsigned)mp->max_print_line )
+ (size_t)mp->max_print_line )
mp_ps_print_nl(mp, "%%+ font");
if ( firstitem ) {
firstitem=false;
@@ -3449,7 +3482,7 @@ static void mp_list_used_resources (MP mp, int prologues, int procset);
mp_ps_print(mp, mp_fm_font_subset_name(mp,f));
else
mp_ps_print(mp, mp->font_ps_name[f]);
- ldf=f;
+ ldf=(int)f;
}
FOUND2:
;
@@ -3463,7 +3496,7 @@ static void mp_list_supplied_resources (MP mp, int prologues, int procset);
@ @c static void mp_list_supplied_resources (MP mp, int prologues, int procset) {
font_number f; /* fonts used in a text node or as loop counters */
int ff; /* a loop counter */
- font_number ldf; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
+ int ldf; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
boolean firstitem;
if ( procset>0 )
mp_ps_print_nl(mp, "%%DocumentSuppliedResources: procset mpost");
@@ -3474,13 +3507,13 @@ static void mp_list_supplied_resources (MP mp, int prologues, int procset);
for (f=null_font+1;f<=mp->last_fnum;f++) {
if ( (mp_has_font_size(mp,f))&&(mp_font_is_reencoded(mp,f)) ) {
for (ff=ldf;ff>= null_font;ff++) {
- if ( mp_has_font_size(mp,ff) )
+ if ( mp_has_font_size(mp,(font_number)ff) )
if ( mp_xstrcmp(mp->font_enc_name[f],mp->font_enc_name[ff])==0 )
goto FOUND;
}
if ( (prologues==3)&&(mp_font_is_subsetted(mp,f)))
goto FOUND;
- if ( mp->ps->ps_offset+1+strlen(mp->font_enc_name[f])>(unsigned)mp->max_print_line )
+ if ( mp->ps->ps_offset+1+strlen(mp->font_enc_name[f])>(size_t)mp->max_print_line )
mp_ps_print_nl(mp, "%%+ encoding");
if ( firstitem ) {
firstitem=false;
@@ -3488,7 +3521,7 @@ static void mp_list_supplied_resources (MP mp, int prologues, int procset);
}
mp_ps_print_char(mp, ' ');
mp_ps_print(mp, mp->font_enc_name[f]);
- ldf=f;
+ ldf=(int)f;
}
FOUND:
;
@@ -3499,13 +3532,13 @@ static void mp_list_supplied_resources (MP mp, int prologues, int procset);
for (f=null_font+1;f<=mp->last_fnum;f++) {
if ( mp_has_font_size(mp,f) ) {
for (ff=ldf;ff>= null_font;ff--) {
- if ( mp_has_font_size(mp,ff) )
+ if ( mp_has_font_size(mp,(font_number)ff) )
if ( mp_xstrcmp(mp->font_name[f],mp->font_name[ff])==0 )
goto FOUND2;
}
if ( ! mp_font_is_included(mp,f) )
goto FOUND2;
- if ( mp->ps->ps_offset+1+strlen(mp->font_ps_name[f])>(unsigned)mp->max_print_line )
+ if ( mp->ps->ps_offset+1+strlen(mp->font_ps_name[f])>(size_t)mp->max_print_line )
mp_ps_print_nl(mp, "%%+ font");
if ( firstitem ) {
firstitem=false;
@@ -3516,7 +3549,7 @@ static void mp_list_supplied_resources (MP mp, int prologues, int procset);
mp_ps_print(mp, mp_fm_font_subset_name(mp,f));
else
mp_ps_print(mp, mp->font_ps_name[f]);
- ldf=f;
+ ldf=(int)f;
}
FOUND2:
;
@@ -3531,20 +3564,20 @@ static void mp_list_needed_resources (MP mp, int prologues);
@ @c static void mp_list_needed_resources (MP mp, int prologues) {
font_number f; /* fonts used in a text node or as loop counters */
int ff; /* a loop counter */
- font_number ldf; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
+ int ldf; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
boolean firstitem;
ldf=null_font;
firstitem=true;
for (f=null_font+1;f<=mp->last_fnum;f++ ) {
if ( mp_has_font_size(mp,f)) {
for (ff=ldf;ff>=null_font;ff--) {
- if ( mp_has_font_size(mp,ff) )
+ if ( mp_has_font_size(mp,(font_number)ff) )
if ( mp_xstrcmp(mp->font_name[f],mp->font_name[ff])==0 )
goto FOUND;
};
if ((prologues==3)&&(mp_font_is_included(mp,f)) )
goto FOUND;
- if ( mp->ps->ps_offset+1+strlen(mp->font_ps_name[f])>(unsigned)mp->max_print_line )
+ if ( mp->ps->ps_offset+1+strlen(mp->font_ps_name[f])>(size_t)mp->max_print_line )
mp_ps_print_nl(mp, "%%+ font");
if ( firstitem ) {
firstitem=false;
@@ -3552,7 +3585,7 @@ static void mp_list_needed_resources (MP mp, int prologues);
}
mp_ps_print_char(mp, ' ');
mp_ps_print(mp, mp->font_ps_name[f]);
- ldf=f;
+ ldf=(int)f;
}
FOUND:
;
@@ -3564,7 +3597,7 @@ static void mp_list_needed_resources (MP mp, int prologues);
for (f=null_font+1;f<= mp->last_fnum;f++) {
if ( mp_has_font_size(mp,f) ) {
for (ff=ldf;ff>=null_font;ff-- ) {
- if ( mp_has_font_size(mp,ff) )
+ if ( mp_has_font_size(mp,(font_number)ff) )
if ( mp_xstrcmp(mp->font_name[f],mp->font_name[ff])==0 )
goto FOUND2;
}
@@ -3573,7 +3606,7 @@ static void mp_list_needed_resources (MP mp, int prologues);
mp_ps_print(mp, "%%IncludeResource: font ");
mp_ps_print(mp, mp->font_ps_name[f]);
mp_ps_print_ln(mp);
- ldf=f;
+ ldf=(int)f;
}
FOUND2:
;
@@ -3637,26 +3670,26 @@ static void mp_write_font_definition (MP mp, font_number f, int prologues);
static void mp_ps_print_defined_name (MP mp, font_number f, int prologues);
@
-@c static void mp_ps_print_defined_name(MP mp, font_number A, int prologues) {
+@c static void mp_ps_print_defined_name(MP mp, font_number f, int prologues) {
mp_ps_print(mp, " /");
- if ((mp_font_is_subsetted(mp,(A)))&&
- (mp_font_is_included(mp,(A)))&&(prologues==3))
- mp_ps_print(mp, mp_fm_font_subset_name(mp,(A)));
+ if ((mp_font_is_subsetted(mp,f))&&
+ (mp_font_is_included(mp,f))&&(prologues==3))
+ mp_ps_print(mp, mp_fm_font_subset_name(mp,f));
else
- mp_ps_print(mp, mp->font_ps_name[(A)]);
- if ( mp_xstrcmp(mp->font_name[(A)],"psyrgo")==0 )
+ mp_ps_print(mp, mp->font_ps_name[f]);
+ if ( mp_xstrcmp(mp->font_name[f],"psyrgo")==0 )
mp_ps_print(mp, "-Slanted");
- if ( mp_xstrcmp(mp->font_name[(A)],"zpzdr-reversed")==0 )
+ if ( mp_xstrcmp(mp->font_name[f],"zpzdr-reversed")==0 )
mp_ps_print(mp, "-Reverse");
- if ( applied_reencoding((A)) ) {
+ if ( applied_reencoding(f) ) {
mp_ps_print(mp, "-");
- mp_ps_print(mp, mp->font_enc_name[(A)]);
+ mp_ps_print(mp, mp->font_enc_name[f]);
}
- if ( mp_fm_font_slant(mp,(A))!=0 ) {
- mp_ps_print(mp, "-Slant_"); mp_ps_print_int(mp, mp_fm_font_slant(mp,(A))) ;
+ if ( mp_fm_font_slant(mp,f)!=0 ) {
+ mp_ps_print(mp, "-Slant_"); mp_ps_print_int(mp, mp_fm_font_slant(mp,f)) ;
}
- if ( mp_fm_font_extend(mp,(A))!=0 ) {
- mp_ps_print(mp, "-Extend_"); mp_ps_print_int(mp, mp_fm_font_extend(mp,(A)));
+ if ( mp_fm_font_extend(mp,f)!=0 ) {
+ mp_ps_print(mp, "-Extend_"); mp_ps_print_int(mp, mp_fm_font_extend(mp,f));
}
}
@@ -3704,19 +3737,19 @@ that use the left-over |b3| field in the |char_info| words; i.e.,
@<Types...@>=
enum mp_char_mark_state {mp_unused=0, mp_used};
-@ @<Exported...@>=
-void mp_mark_string_chars (MP mp,font_number f, char *s) ;
+@ @<Declarations@>=
+static void mp_mark_string_chars (MP mp,font_number f, char *s, size_t l) ;
@ @c
-void mp_mark_string_chars (MP mp,font_number f, char *s) {
+void mp_mark_string_chars (MP mp,font_number f, char *s, size_t l) {
integer b; /* |char_base[f]| */
- ASCII_code bc,ec; /* only characters between these bounds are marked */
+ int bc,ec; /* only characters between these bounds are marked */
char *k; /* an index into string |s| */
b=mp->char_base[f];
- bc=mp->font_bc[f];
- ec=mp->font_ec[f];
- k=s; /* str_stop */
- while (*k){
+ bc=(int)mp->font_bc[f];
+ ec=(int)mp->font_ec[f];
+ k=s;
+ while (l-->0){
if ( (*k>=bc)&&(*k<=ec) )
mp->font_info[b+*k].qqqq.b3=mp_used;
k++;
@@ -3724,8 +3757,8 @@ void mp_mark_string_chars (MP mp,font_number f, char *s) {
}
-@ @<Exported ...@>=
-void mp_unmark_font (MP mp,font_number f) ;
+@ @<Declarations@>=
+static void mp_unmark_font (MP mp,font_number f) ;
@ @c
void mp_unmark_font (MP mp,font_number f) {
@@ -3737,8 +3770,8 @@ void mp_unmark_font (MP mp,font_number f) {
}
-@ @<Exported...@>=
-void mp_print_improved_prologue (MP mp, mp_edge_object *h, int prologues, int procset) ;
+@ @<Declarations@>=
+static void mp_print_improved_prologue (MP mp, mp_edge_object *h, int p1, int procset) ;
@ @c
void mp_print_improved_prologue (MP mp, mp_edge_object *h, int prologues, int procset) {
@@ -3746,7 +3779,7 @@ void mp_print_improved_prologue (MP mp, mp_edge_object *h, int prologues, int pr
pointer *cur_fsize; /* current positions in |font_sizes| */
boolean done_fonts; /* have we finished listing the fonts in the header? */
font_number f; /* a font number for loops */
- cur_fsize = mp_xmalloc(mp,(mp->font_max+1),sizeof(pointer));
+ cur_fsize = mp_xmalloc(mp,(size_t)(mp->font_max+1),sizeof(pointer));
mp_list_used_resources(mp, prologues, procset);
mp_list_supplied_resources(mp, prologues, procset);
mp_list_needed_resources(mp, prologues);
@@ -3783,7 +3816,7 @@ void mp_print_improved_prologue (MP mp, mp_edge_object *h, int prologues, int pr
mp_ps_print(mp, " def");
} else {
char s[256];
- snprintf(s,256,"font %s cannot be found in any fontmapfile!", mp->font_name[f]);
+ mp_snprintf(s,256,"font %s cannot be found in any fontmapfile!", mp->font_name[f]);
mp_warn(mp,s);
mp_ps_name_out(mp, mp->font_name[f],true);
mp_ps_name_out(mp, mp->font_name[f],true);
@@ -3811,8 +3844,8 @@ static font_number mp_print_font_comments (MP mp , mp_edge_object *h, int prolog
boolean done_fonts; /* have we finished listing the fonts in the header? */
font_number f; /* a font number for loops */
scaled ds; /* design size and scale factor for a text node */
- font_number ldf=0; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
- cur_fsize = mp_xmalloc(mp,(mp->font_max+1),sizeof(pointer));
+ int ldf=0; /* the last \.{DocumentFont} listed (otherwise |null_font|) */
+ cur_fsize = mp_xmalloc(mp,(size_t)(mp->font_max+1),sizeof(pointer));
if ( prologues>0 ) {
@<Give a \.{DocumentFonts} comment listing all fonts with non-null
|font_sizes| and eliminate duplicates@>;
@@ -3833,7 +3866,7 @@ static font_number mp_print_font_comments (MP mp , mp_edge_object *h, int prolog
} while (! done_fonts);
}
mp_xfree(cur_fsize);
- return ldf;
+ return (font_number)ldf;
}
@ @<Make |cur_fsize| a copy of the |font_sizes| array@>=
@@ -3856,11 +3889,11 @@ search.
if ( mp_xstrcmp(mp->font_ps_name[f],mp->font_ps_name[ff])==0 )
goto FOUND;
}
- if ( mp->ps->ps_offset+1+strlen(mp->font_ps_name[f])>(unsigned)mp->max_print_line )
+ if ( mp->ps->ps_offset+1+strlen(mp->font_ps_name[f])>(size_t)mp->max_print_line )
mp_ps_print_nl(mp, "%%+");
mp_ps_print_char(mp, ' ');
mp_ps_print(mp, mp->font_ps_name[f]);
- ldf=f;
+ ldf=(int)f;
FOUND:
;
}
@@ -3868,7 +3901,7 @@ search.
}
@ @c
-static void mp_hex_digit_out (MP mp,small_number d) {
+static void mp_hex_digit_out (MP mp,quarterword d) {
if ( d<10 ) mp_ps_print_char(mp, d+'0');
else mp_ps_print_char(mp, d+'a'-10);
}
@@ -3890,7 +3923,8 @@ static halfword mp_ps_marks_out (MP mp,font_number f, eight_bits c) {
eight_bits bc,ec; /* only encode characters between these bounds */
integer lim; /* the maximum number of marks to encode before truncating */
int p; /* |font_info| index for the current character */
- int d,b; /* used to construct a hexadecimal digit */
+ int d; /* used to construct a hexadecimal digit */
+ unsigned b; /* used to construct a hexadecimal digit */
lim=4*(emergency_line_length-mp->ps->ps_offset-4);
bc=mp->font_bc[f];
ec=mp->font_ec[f];
@@ -3913,7 +3947,7 @@ p=mp->char_base[f]+bc;
while ( (mp->font_info[p].qqqq.b3==mp_unused)&&(bc<ec) ) {
p++; bc++;
}
-if ( ec>=bc+lim ) ec=bc+lim-1;
+if ( ec>=(eight_bits)(bc+lim)) ec=(eight_bits)(bc+lim-1);
p=mp->char_base[f]+ec;
while ( (mp->font_info[p].qqqq.b3==mp_unused)&&(bc<ec) ) {
p--; ec--;
@@ -3921,8 +3955,8 @@ while ( (mp->font_info[p].qqqq.b3==mp_unused)&&(bc<ec) ) {
@ @<Print the initial label indicating that the bitmap starts at |bc|@>=
mp_ps_print_char(mp, ' ');
-mp_hex_digit_out(mp, bc / 16);
-mp_hex_digit_out(mp, bc % 16);
+mp_hex_digit_out(mp, (quarterword)bc / 16);
+mp_hex_digit_out(mp, (quarterword)bc % 16);
mp_ps_print_char(mp, ':')
@
@@ -3931,13 +3965,13 @@ mp_ps_print_char(mp, ':')
b=8; d=0;
for (p=mp->char_base[f]+bc;p<=mp->char_base[f]+ec;p++) {
if ( b==0 ) {
- mp_hex_digit_out(mp, d);
+ mp_hex_digit_out(mp, (quarterword)d);
d=0; b=8;
}
if ( mp->font_info[p].qqqq.b3!=mp_unused ) d=d+b;
b=b>>1;
}
-mp_hex_digit_out(mp, d)
+mp_hex_digit_out(mp, (quarterword)d)
@ Here is a simple function that determines whether there are any marked
@@ -3981,7 +4015,7 @@ TODO: these two defines are also defined in mp.w!
mp_ps_print_char(mp, ' ');
mp_ps_print_scaled(mp, ds);
if ( mp->ps->ps_offset+5>emergency_line_length ) break;
- t=mp_ps_marks_out(mp, f,t);
+ t=mp_ps_marks_out(mp, f, (eight_bits)t);
}
cur_fsize[f]=link(cur_fsize[f]);
}
@@ -4007,8 +4041,8 @@ anyway. The user should not make \&{prologues} positive if this will cause
trouble.
@:prologues_}{\&{prologues} primitive@>
-@<Exported...@>=
-void mp_print_prologue (MP mp, mp_edge_object *h, int prologues, int procset);
+@<Declarations@>=
+static void mp_print_prologue (MP mp, mp_edge_object *h, int prologues, int procset);
@ @c
void mp_print_prologue (MP mp, mp_edge_object *h, int prologues, int procset) {
@@ -4073,8 +4107,8 @@ void mp_ps_pair_out (MP mp,scaled x, scaled y) {
mp_ps_print_scaled(mp, y); mp_ps_print_char(mp, ' ');
}
-@ @<Exported...@>=
-void mp_ps_pair_out (MP mp,scaled x, scaled y) ;
+@ @<Declarations@>=
+static void mp_ps_pair_out (MP mp,scaled x, scaled y) ;
@ @c
void mp_ps_print_cmd (MP mp, const char *l, const char *s) {
@@ -4082,14 +4116,15 @@ void mp_ps_print_cmd (MP mp, const char *l, const char *s) {
else { ps_room(strlen(l)); mp_ps_print(mp, l); };
}
-@ @<Exported...@>=
-void mp_ps_print_cmd (MP mp, const char *l, const char *s) ;
+@ @<Declarations@>=
+static void mp_ps_print_cmd (MP mp, const char *l, const char *s) ;
@ @c
-void mp_ps_string_out (MP mp, const char *s) {
+void mp_ps_string_out (MP mp, const char *s, size_t l) {
ASCII_code k; /* bits to be converted to octal */
mp_ps_print(mp, "(");
- while ((k=*s++)) {
+ while (l-->0) {
+ k=(ASCII_code)*s++;
if ( mp->ps->ps_offset+5>mp->max_print_line ) {
mp_ps_print_char(mp, '\\');
mp_ps_print_ln(mp);
@@ -4108,8 +4143,8 @@ void mp_ps_string_out (MP mp, const char *s) {
mp_ps_print_char(mp, ')');
}
-@ @<Exported...@>=
-void mp_ps_string_out (MP mp, const char *s) ;
+@ @<Declarations@>=
+static void mp_ps_string_out (MP mp, const char *s, size_t l) ;
@ This is a define because the function does not use its |mp| argument.
@@ -4118,7 +4153,7 @@ void mp_ps_string_out (MP mp, const char *s) ;
@c
static boolean mp_do_is_ps_name (char *s) {
ASCII_code k; /* the character being checked */
- while ((k=*s++)) {
+ while ((k=(ASCII_code)*s++)) {
if ( (k<=' ')||(k>'~') ) return false;
if ( (k=='(')||(k==')')||(k=='<')||(k=='>')||
(k=='{')||(k=='}')||(k=='/')||(k=='%') ) return false;
@@ -4126,8 +4161,8 @@ static boolean mp_do_is_ps_name (char *s) {
return true;
}
-@ @<Exported...@>=
-void mp_ps_name_out (MP mp, char *s, boolean lit) ;
+@ @<Declarations@>=
+static void mp_ps_name_out (MP mp, char *s, boolean lit) ;
@ @c
void mp_ps_name_out (MP mp, char *s, boolean lit) {
@@ -4137,7 +4172,7 @@ void mp_ps_name_out (MP mp, char *s, boolean lit) {
if ( lit ) mp_ps_print_char(mp, '/');
mp_ps_print(mp, s);
} else {
- mp_ps_string_out(mp, s);
+ mp_ps_string_out(mp, s, strlen(s));
if ( ! lit ) mp_ps_print(mp, "cvx ");
mp_ps_print(mp, "cvn");
}
@@ -4156,34 +4191,37 @@ is not standard \ps, since it allows \TeX\ to calculate the box dimensions
accurately. (Overfull boxes are avoided if an illustration is made to
match a given \.{\char`\\hsize}.)
-@<Exported...@>=
-void mp_print_initial_comment(MP mp,mp_edge_object *hh, int prologues);
+@<Declarations@>=
+static void mp_print_initial_comment(MP mp,mp_edge_object *hh, int prologues);
@ @c
void mp_print_initial_comment(MP mp,mp_edge_object *hh, int prologues) {
scaled t;
+ char *s;
mp_ps_print(mp, "%!PS");
if ( prologues>0 )
mp_ps_print(mp, "-Adobe-3.0 EPSF-3.0");
mp_ps_print_nl(mp, "%%BoundingBox: ");
- if ( hh->_minx>hh->_maxx) {
+ if ( hh->minx>hh->maxx) {
mp_ps_print(mp, "0 0 0 0");
} else if ( prologues<0 ) {
- mp_ps_pair_out(mp, hh->_minx,hh->_miny);
- mp_ps_pair_out(mp, hh->_maxx,hh->_maxy);
+ mp_ps_pair_out(mp, hh->minx,hh->miny);
+ mp_ps_pair_out(mp, hh->maxx,hh->maxy);
} else {
- mp_ps_pair_out(mp, mp_floor_scaled(mp, hh->_minx),mp_floor_scaled(mp, hh->_miny));
- mp_ps_pair_out(mp, -mp_floor_scaled(mp, -hh->_maxx),-mp_floor_scaled(mp, -hh->_maxy));
+ mp_ps_pair_out(mp, mp_floor_scaled(mp, hh->minx),mp_floor_scaled(mp, hh->miny));
+ mp_ps_pair_out(mp, -mp_floor_scaled(mp, -hh->maxx),-mp_floor_scaled(mp, -hh->maxy));
}
mp_ps_print_nl(mp, "%%HiResBoundingBox: ");
- if ( hh->_minx>hh->_maxx ) {
+ if ( hh->minx>hh->maxx ) {
mp_ps_print(mp, "0 0 0 0");
} else {
- mp_ps_pair_out(mp, hh->_minx,hh->_miny);
- mp_ps_pair_out(mp, hh->_maxx,hh->_maxy);
+ mp_ps_pair_out(mp, hh->minx,hh->miny);
+ mp_ps_pair_out(mp, hh->maxx,hh->maxy);
}
mp_ps_print_nl(mp, "%%Creator: MetaPost ");
- mp_ps_print(mp, mp_metapost_version(mp));
+ s = mp_metapost_version();
+ mp_ps_print(mp, s);
+ mp_xfree(s);
mp_ps_print_nl(mp, "%%CreationDate: ");
mp_ps_print_int(mp, mp_round_unscaled(mp, mp->internal[mp_year]));
mp_ps_print_char(mp, '.');
@@ -4200,55 +4238,36 @@ void mp_print_initial_comment(MP mp,mp_edge_object *hh, int prologues) {
@ The most important output procedure is the one that gives the \ps\ version of
a \MP\ path.
-@<Types...@>=
-#define gr_left_type(A) (A)->left_type_field
-#define gr_right_type(A) (A)->right_type_field
-#define gr_x_coord(A) (A)->x_coord_field
-#define gr_y_coord(A) (A)->y_coord_field
-#define gr_left_x(A) (A)->left_x_field
-#define gr_left_y(A) (A)->left_y_field
-#define gr_right_x(A) (A)->right_x_field
-#define gr_right_y(A) (A)->right_y_field
-#define gr_next_knot(A) (A)->next_field
-#define gr_originator(A) (A)->originator_field
+@(mplibps.h@>=
typedef struct mp_knot {
- unsigned short left_type_field;
- unsigned short right_type_field;
- scaled x_coord_field;
- scaled y_coord_field;
- scaled left_x_field;
- scaled left_y_field;
- scaled right_x_field;
- scaled right_y_field;
- struct mp_knot * next_field;
- quarterword originator_field;
+ unsigned short left_type;
+ unsigned short right_type;
+ signed int x_coord;
+ signed int y_coord;
+ signed int left_x;
+ signed int left_y;
+ signed int right_x;
+ signed int right_y;
+ struct mp_knot * next;
+ unsigned char originator;
} mp_knot;
-@ @c
-mp_knot * mp_gr_insert_knot (MP mp, mp_knot *q, scaled x, scaled y) {
- /* returns the inserted knot */
- mp_knot *r; /* the new knot */
- r= mp_xmalloc(mp, 1, sizeof (mp_knot));
- gr_next_knot(r)=gr_next_knot(q); gr_next_knot(q)=r;
- gr_right_x(r)=gr_right_x(q);
- gr_right_y(r)=gr_right_y(q);
- gr_x_coord(r)=x;
- gr_y_coord(r)=y;
- gr_right_x(q)=gr_x_coord(q);
- gr_right_y(q)=gr_y_coord(q);
- gr_left_x(r)=gr_x_coord(r);
- gr_left_y(r)=gr_y_coord(r);
- gr_left_type(r)=mp_explicit;
- gr_right_type(r)=mp_explicit;
- gr_originator(r)=mp_program_code;
- return r;
-}
-
+@ @<Types...@>=
+#define gr_left_type(A) (A)->left_type
+#define gr_right_type(A) (A)->right_type
+#define gr_x_coord(A) (A)->x_coord
+#define gr_y_coord(A) (A)->y_coord
+#define gr_left_x(A) (A)->left_x
+#define gr_left_y(A) (A)->left_y
+#define gr_right_x(A) (A)->right_x
+#define gr_right_y(A) (A)->right_y
+#define gr_next_knot(A) (A)->next
+#define gr_originator(A) (A)->originator
@ If we want to duplicate a knot node, we can say |copy_knot|:
@c
-mp_knot *mp_gr_copy_knot (MP mp, mp_knot *p) {
+static mp_knot *mp_gr_copy_knot (MP mp, mp_knot *p) {
mp_knot *q; /* the copy */
q = mp_xmalloc(mp, 1, sizeof (mp_knot));
memcpy(q,p,sizeof (mp_knot));
@@ -4259,7 +4278,7 @@ mp_knot *mp_gr_copy_knot (MP mp, mp_knot *p) {
@ The |copy_path| routine makes a clone of a given path.
@c
-mp_knot *mp_gr_copy_path (MP mp, mp_knot *p) {
+static mp_knot *mp_gr_copy_path (MP mp, mp_knot *p) {
mp_knot *q, *pp, *qq; /* for list manipulation */
if (p==NULL)
return NULL;
@@ -4302,7 +4321,7 @@ mp_knot * mp_gr_htap_ypoc (MP mp, mp_knot *p) {
gr_originator(qq)=gr_originator(pp);
if ( gr_next_knot(pp)==p ) {
gr_next_knot(q)=qq;
- /* mp->path_tail=pp; */ /* ? */
+ /* |mp->path_tail=pp;| */ /* ? */
return q;
}
rr=mp_xmalloc(mp, 1, sizeof (mp_knot));
@@ -4316,7 +4335,7 @@ mp_knot * mp_gr_htap_ypoc (MP mp, mp_knot *p) {
calling the following subroutine.
@<Declarations@>=
-void mp_do_gr_toss_knot_list (mp_knot *p) ;
+static void mp_do_gr_toss_knot_list (mp_knot *p) ;
@
@d mp_gr_toss_knot_list(B,A) mp_do_gr_toss_knot_list(A)
@@ -4337,7 +4356,7 @@ void mp_do_gr_toss_knot_list (mp_knot * p) {
@ @c
-void mp_gr_ps_path_out (MP mp, mp_knot *h) {
+static void mp_gr_ps_path_out (MP mp, mp_knot *h) {
mp_knot *p, *q; /* for scanning the path */
scaled d; /* a temporary value */
boolean curved; /* |true| unless the cubic is almost straight */
@@ -4395,9 +4414,9 @@ if ( abs(gr_right_x(p)-gr_x_coord(p)-d)<=bend_tolerance )
@ The colored objects use a struct with anonymous fields to express the color parts:
-@<Types...@>=
+@(mplibps.h@>=
typedef struct {
- scaled _a_val, _b_val, _c_val, _d_val;
+ int a_val, b_val, c_val, d_val;
} mp_color;
@ The exported form of a dash pattern is simpler than the internal
@@ -4405,10 +4424,10 @@ format, it is closely modelled to the PostScript model. The array of
dashes is ended by a single negative value, because this is not
allowed in PostScript.
-@<Types...@>=
+@(mplibps.h@>=
typedef struct {
- scaled offset_field;
- scaled *array_field;
+ int offset;
+ int *array;
} mp_dash_object ;
@@ -4416,30 +4435,30 @@ typedef struct {
@d mp_gr_toss_dashes(A,B) mp_do_gr_toss_dashes(B)
@<Declarations@>=
-void mp_do_gr_toss_dashes(mp_dash_object *dl);
+static void mp_do_gr_toss_dashes(mp_dash_object *dl);
@ @c
void mp_do_gr_toss_dashes(mp_dash_object *dl) {
if (dl==NULL)
return;
- mp_xfree(dl->array_field);
+ mp_xfree(dl->array);
mp_xfree(dl);
}
@ @c
-mp_dash_object *mp_gr_copy_dashes(MP mp, mp_dash_object *dl) {
+static mp_dash_object *mp_gr_copy_dashes(MP mp, mp_dash_object *dl) {
mp_dash_object *q = NULL;
(void)mp;
if (dl==NULL)
return NULL;
q = mp_xmalloc(mp, 1, sizeof (mp_dash_object));
memcpy (q,dl,sizeof(mp_dash_object));
- if (dl->array_field != NULL) {
- int i = 0;
- while (*(dl->array_field+i) != -1) i++;
- q->array_field = mp_xmalloc(mp, i, sizeof (scaled));
- memcpy(q->array_field,dl->array_field, (i*sizeof(scaled)));
+ if (dl->array != NULL) {
+ size_t i = 0;
+ while (*(dl->array+i) != -1) i++;
+ q->array = mp_xmalloc(mp, i, sizeof (scaled));
+ memcpy(q->array,dl->array, (i*sizeof(scaled)));
}
return q;
}
@@ -4451,44 +4470,46 @@ structures and access macros.
@d gr_has_color(A) (gr_type((A))<mp_start_clip_code)
@<Types...@>=
-#define gr_type(A) (A)->_type_field
-#define gr_link(A) (A)->_link_field
-#define gr_color_model(A) (A)->color_model_field
-#define gr_red_val(A) (A)->color_field._a_val
-#define gr_green_val(A) (A)->color_field._b_val
-#define gr_blue_val(A) (A)->color_field._c_val
-#define gr_cyan_val(A) (A)->color_field._a_val
-#define gr_magenta_val(A) (A)->color_field._b_val
-#define gr_yellow_val(A) (A)->color_field._c_val
-#define gr_black_val(A) (A)->color_field._d_val
-#define gr_grey_val(A) (A)->color_field._a_val
-#define gr_path_p(A) (A)->path_p_field
-#define gr_htap_p(A) ((mp_fill_object *)A)->htap_p_field
-#define gr_pen_p(A) (A)->pen_p_field
-#define gr_ljoin_val(A) (A)->ljoin_field
-#define gr_lcap_val(A) ((mp_stroked_object *)A)->lcap_field
-#define gr_miterlim_val(A) (A)->miterlim_field
-#define gr_pre_script(A) (A)->pre_script_field
-#define gr_post_script(A) (A)->post_script_field
-#define gr_dash_p(A) ((mp_stroked_object *)A)->dash_p_field
-#define gr_name_type(A) ((mp_text_object *)A)->name_type_field
-#define gr_text_p(A) ((mp_text_object *)A)->text_p_field
-#define gr_font_n(A) ((mp_text_object *)A)->font_n_field
-#define gr_font_name(A) ((mp_text_object *)A)->font_name_field
-#define gr_font_dsize(A) ((mp_text_object *)A)->font_dsize_field
-#define gr_width_val(A) ((mp_text_object *)A)->width_field
-#define gr_height_val(A) ((mp_text_object *)A)->height_field
-#define gr_depth_val(A) ((mp_text_object *)A)->depth_field
-#define gr_tx_val(A) ((mp_text_object *)A)->tx_field
-#define gr_ty_val(A) ((mp_text_object *)A)->ty_field
-#define gr_txx_val(A) ((mp_text_object *)A)->txx_field
-#define gr_txy_val(A) ((mp_text_object *)A)->txy_field
-#define gr_tyx_val(A) ((mp_text_object *)A)->tyx_field
-#define gr_tyy_val(A) ((mp_text_object *)A)->tyy_field
-
+#define gr_type(A) (A)->type
+#define gr_link(A) (A)->next
+#define gr_color_model(A) (A)->color_model
+#define gr_red_val(A) (A)->color.a_val
+#define gr_green_val(A) (A)->color.b_val
+#define gr_blue_val(A) (A)->color.c_val
+#define gr_cyan_val(A) (A)->color.a_val
+#define gr_magenta_val(A) (A)->color.b_val
+#define gr_yellow_val(A) (A)->color.c_val
+#define gr_black_val(A) (A)->color.d_val
+#define gr_grey_val(A) (A)->color.a_val
+#define gr_path_p(A) (A)->path_p
+#define gr_htap_p(A) ((mp_fill_object *)A)->htap_p
+#define gr_pen_p(A) (A)->pen_p
+#define gr_ljoin_val(A) (A)->ljoin
+#define gr_lcap_val(A) ((mp_stroked_object *)A)->lcap
+#define gr_miterlim_val(A) (A)->miterlim
+#define gr_pre_script(A) (A)->pre_script
+#define gr_post_script(A) (A)->post_script
+#define gr_dash_p(A) ((mp_stroked_object *)A)->dash_p
+#define gr_size_index(A) ((mp_text_object *)A)->size_index
+#define gr_text_p(A) ((mp_text_object *)A)->text_p
+#define gr_text_l(A) ((mp_text_object *)A)->text_l
+#define gr_font_n(A) ((mp_text_object *)A)->font_n
+#define gr_font_name(A) ((mp_text_object *)A)->font_name
+#define gr_font_dsize(A) ((mp_text_object *)A)->font_dsize
+#define gr_width_val(A) ((mp_text_object *)A)->width
+#define gr_height_val(A) ((mp_text_object *)A)->height
+#define gr_depth_val(A) ((mp_text_object *)A)->depth
+#define gr_tx_val(A) ((mp_text_object *)A)->tx
+#define gr_ty_val(A) ((mp_text_object *)A)->ty
+#define gr_txx_val(A) ((mp_text_object *)A)->txx
+#define gr_txy_val(A) ((mp_text_object *)A)->txy
+#define gr_tyx_val(A) ((mp_text_object *)A)->tyx
+#define gr_tyy_val(A) ((mp_text_object *)A)->tyy
+
+@ @(mplibps.h@>=
#define GRAPHIC_BODY \
- halfword _type_field; \
- struct mp_graphic_object * _link_field
+ int type; \
+ struct mp_graphic_object * next
typedef struct mp_graphic_object {
GRAPHIC_BODY;
@@ -4496,74 +4517,77 @@ typedef struct mp_graphic_object {
typedef struct mp_text_object {
GRAPHIC_BODY;
- char *pre_script_field;
- char *post_script_field;
- mp_color color_field;
- quarterword color_model_field;
- quarterword name_type_field;
- char *text_p_field;
- char *font_name_field ;
- scaled font_dsize_field ;
- font_number font_n_field ;
- scaled width_field ;
- scaled height_field ;
- scaled depth_field ;
- scaled tx_field ;
- scaled ty_field ;
- scaled txx_field ;
- scaled txy_field ;
- scaled tyx_field ;
- scaled tyy_field ;
+ char *pre_script;
+ char *post_script;
+ mp_color color;
+ unsigned char color_model;
+ unsigned char size_index;
+ char *text_p;
+ size_t text_l;
+ char *font_name ;
+ unsigned int font_dsize ;
+ unsigned int font_n ;
+ int width ;
+ int height ;
+ int depth ;
+ int tx ;
+ int ty ;
+ int txx ;
+ int txy ;
+ int tyx ;
+ int tyy ;
} mp_text_object;
typedef struct mp_fill_object {
GRAPHIC_BODY;
- char *pre_script_field;
- char *post_script_field;
- mp_color color_field;
- quarterword color_model_field;
- quarterword ljoin_field ;
- mp_knot * path_p_field;
- mp_knot * htap_p_field;
- mp_knot * pen_p_field;
- scaled miterlim_field ;
+ char *pre_script;
+ char *post_script;
+ mp_color color;
+ unsigned char color_model;
+ unsigned char ljoin ;
+ mp_knot * path_p;
+ mp_knot * htap_p;
+ mp_knot * pen_p;
+ int miterlim ;
} mp_fill_object;
typedef struct mp_stroked_object {
GRAPHIC_BODY;
- char *pre_script_field;
- char *post_script_field;
- mp_color color_field;
- quarterword color_model_field;
- quarterword ljoin_field ;
- quarterword lcap_field ;
- mp_knot * path_p_field;
- mp_knot * pen_p_field;
- scaled miterlim_field ;
- mp_dash_object *dash_p_field;
+ char *pre_script;
+ char *post_script;
+ mp_color color;
+ unsigned char color_model;
+ unsigned char ljoin ;
+ unsigned char lcap ;
+ mp_knot * path_p;
+ mp_knot * pen_p;
+ int miterlim ;
+ mp_dash_object *dash_p;
} mp_stroked_object;
typedef struct mp_clip_object {
GRAPHIC_BODY;
- mp_knot * path_p_field;
+ mp_knot * path_p;
} mp_clip_object;
typedef struct mp_bounds_object {
GRAPHIC_BODY;
- mp_knot * path_p_field;
+ mp_knot * path_p;
} mp_bounds_object;
typedef struct mp_special_object {
GRAPHIC_BODY;
- char *pre_script_field;
+ char *pre_script;
} mp_special_object ;
typedef struct mp_edge_object {
struct mp_graphic_object * body;
- struct mp_edge_object * _next;
- char * _filename;
- MP _parent;
- scaled _minx, _miny, _maxx, _maxy;
+ struct mp_edge_object * next;
+ char * filename;
+ MP parent;
+ int minx, miny, maxx, maxy;
+ int width, height, depth, ital_corr;
+ int charcode;
} mp_edge_object;
@ @<Exported function headers@>=
@@ -4572,7 +4596,7 @@ mp_graphic_object *mp_new_graphic_object(MP mp, int type);
@ @c
mp_graphic_object *mp_new_graphic_object (MP mp, int type) {
mp_graphic_object *p;
- int size ;
+ size_t size ;
switch (type) {
case mp_fill_code: size = sizeof(mp_fill_object); break;
case mp_stroked_code: size = sizeof(mp_stroked_object); break;
@@ -4597,7 +4621,7 @@ needed without wasting time and space setting them unnecessarily.
@d gs_green mp->ps->gs_state->green_field
@d gs_blue mp->ps->gs_state->blue_field
@d gs_black mp->ps->gs_state->black_field
-@d gs_colormodel mp->ps->gs_state->colormodel_field
+@d gs_colormodel mp->ps->gs_state->colormodel_field
@d gs_ljoin mp->ps->gs_state->ljoin_field
@d gs_lcap mp->ps->gs_state->lcap_field
@d gs_adj_wx mp->ps->gs_state->adj_wx_field
@@ -4650,13 +4674,9 @@ should be black so that the translation of an all-black picture will have no
Hence we use |c=0| when initializing the graphics state and we use |c<0|
to recover from a situation where we have lost track of the graphics state.
-@c
-void mp_gs_unknown_graphics_state (MP mp,scaled c) ;
-
-@
@d mp_void (null+1) /* a null pointer different from |null| */
-@c void mp_gs_unknown_graphics_state (MP mp,scaled c) {
+@c static void mp_gs_unknown_graphics_state (MP mp,scaled c) {
struct _gs_state *p; /* to shift graphic states around */
if ( (c==0)||(c==-1) ) {
if ( mp->ps->gs_state==NULL ) {
@@ -4694,7 +4714,7 @@ void mp_gs_unknown_graphics_state (MP mp,scaled c) ;
that \ps's idea of the graphics state agrees with what is stored in the object.
@<Declarations@>=
-void mp_gr_fix_graphics_state (MP mp, mp_graphic_object *p) ;
+static void mp_gr_fix_graphics_state (MP mp, mp_graphic_object *p) ;
@ @c
void mp_gr_fix_graphics_state (MP mp, mp_graphic_object *p) {
@@ -4702,7 +4722,7 @@ void mp_gr_fix_graphics_state (MP mp, mp_graphic_object *p) {
mp_knot *pp, *path_p; /* for list manipulation */
mp_dash_object *hh;
scaled wx,wy,ww; /* dimensions of pen bounding box */
- boolean adj_wx; /* whether pixel rounding should be based on |wx| or |wy| */
+ quarterword adj_wx; /* whether pixel rounding should be based on |wx| or |wy| */
integer tx,ty; /* temporaries for computing |adj_wx| */
if ( gr_has_color(p) )
@<Make sure \ps\ will use the right color for object~|p|@>;
@@ -4730,23 +4750,23 @@ void mp_gr_fix_graphics_state (MP mp, mp_graphic_object *p) {
if ( gr_type(p)==mp_stroked_code ) {
mp_stroked_object *ts = (mp_stroked_object *)p;
if ( (gr_left_type(gr_path_p(ts))==mp_endpoint)||(gr_dash_p(ts)!=NULL) )
- if ( gs_lcap!=gr_lcap_val(ts) ) {
+ if ( gs_lcap!=(quarterword)gr_lcap_val(ts) ) {
ps_room(13);
mp_ps_print_char(mp, ' ');
mp_ps_print_char(mp, '0'+gr_lcap_val(ts));
mp_ps_print_cmd(mp, " setlinecap"," lc");
- gs_lcap=gr_lcap_val(ts);
+ gs_lcap=(quarterword)gr_lcap_val(ts);
}
}
@
@d set_ljoin_miterlim(p)
- if ( gs_ljoin!=gr_ljoin_val(p) ) {
+ if ( gs_ljoin!=(quarterword)gr_ljoin_val(p) ) {
ps_room(14);
mp_ps_print_char(mp, ' ');
mp_ps_print_char(mp, '0'+gr_ljoin_val(p));
mp_ps_print_cmd(mp, " setlinejoin"," lj");
- gs_ljoin=gr_ljoin_val(p);
+ gs_ljoin=(quarterword)gr_ljoin_val(p);
}
if ( gs_miterlim!=gr_miterlim_val(p) ) {
ps_room(27);
@@ -4767,11 +4787,11 @@ if ( gr_type(p)==mp_stroked_code ) {
@
@d set_color_objects(pq)
- object_color_model = pq->color_model_field;
- object_color_a = pq->color_field._a_val;
- object_color_b = pq->color_field._b_val;
- object_color_c = pq->color_field._c_val;
- object_color_d = pq->color_field._d_val;
+ object_color_model = pq->color_model;
+ object_color_a = pq->color.a_val;
+ object_color_b = pq->color.b_val;
+ object_color_c = pq->color.c_val;
+ object_color_d = pq->color.d_val;
@<Make sure \ps\ will use the right color for object~|p|@>=
{
@@ -4866,7 +4886,7 @@ to compute in \ps.
@<Use |pen_p(p)| and |path_p(p)| to decide whether |wx| or |wy| is more
important and set |adj_wx| and |ww| accordingly@>;
if ( (ww!=gs_width) || (adj_wx!=gs_adj_wx) ) {
- if ( adj_wx ) {
+ if ( adj_wx != 0 ) {
ps_room(13);
mp_ps_print_char(mp, ' '); mp_ps_print_scaled(mp, ww);
mp_ps_print_cmd(mp,
@@ -4911,8 +4931,8 @@ of the pen transformation is more that |aspect_bound*(ww+1)|.
tx=1; ty=1;
if ( mp_gr_coord_rangeOK(path_p, do_y_loc, wy) ) tx=aspect_bound;
else if ( mp_gr_coord_rangeOK(path_p, do_x_loc, wx) ) ty=aspect_bound;
-if ( wy / ty>=wx / tx ) { ww=wy; adj_wx=false; }
-else { ww=wx; adj_wx=true; }
+if ( wy / ty>=wx / tx ) { ww=wy; adj_wx=0; }
+else { ww=wx; adj_wx=1; }
@ This routine quickly tests if path |h| is ``essentially horizontal'' or
``essentially vertical,'' where |zoff| is |x_loc(0)| or |y_loc(0)| and |dz| is
@@ -4920,12 +4940,12 @@ allowable range for $x$ or~$y$. We do not need and cannot afford a full
bounding-box computation.
@<Declarations@>=
-boolean mp_gr_coord_rangeOK (mp_knot *h,
- small_number zoff, scaled dz);
+static boolean mp_gr_coord_rangeOK (mp_knot *h,
+ quarterword zoff, scaled dz);
@ @c
boolean mp_gr_coord_rangeOK (mp_knot *h,
- small_number zoff, scaled dz) {
+ quarterword zoff, scaled dz) {
mp_knot *p; /* for scanning the path form |h| */
scaled zlo,zhi; /* coordinate range so far */
scaled z; /* coordinate currently being tested */
@@ -4987,43 +5007,31 @@ if ( hh==NULL ) {
@<Set the dash pattern from |dash_list(hh)| scaled by |scf|@>;
}
-@ @<Declarations@>=
-scaled mp_gr_get_pen_scale (MP mp, mp_knot *p) ;
-
-
-@ @c
-scaled mp_gr_get_pen_scale (MP mp, mp_knot *p) {
- return mp_sqrt_det(mp,
- gr_left_x(p)-gr_x_coord(p), gr_right_x(p)-gr_x_coord(p),
- gr_left_y(p)-gr_y_coord(p), gr_right_y(p)-gr_y_coord(p));
-}
-
-
@ The original code had a check here to ensure that the result from
|mp_take_scaled| did not go out of bounds.
@<Set the dash pattern from |dash_list(hh)| scaled by |scf|@>=
{ gs_dash_p=hh;
- if ( (gr_dash_p(p)==NULL) || (hh==NULL) || (hh->array_field==NULL)) {
+ if ( (gr_dash_p(p)==NULL) || (hh==NULL) || (hh->array==NULL)) {
mp_ps_print_cmd(mp, " [] 0 setdash"," rd");
} else {
int i;
ps_room(28);
mp_ps_print(mp, " [");
- for (i=0; *(hh->array_field+i) != -1;i++) {
+ for (i=0; *(hh->array+i) != -1;i++) {
ps_room(13);
- mp_ps_print_scaled(mp, *(hh->array_field+i));
+ mp_ps_print_scaled(mp, *(hh->array+i));
mp_ps_print_char(mp, ' ') ;
}
ps_room(22);
mp_ps_print(mp, "] ");
- mp_ps_print_scaled(mp, hh->offset_field);
+ mp_ps_print_scaled(mp, hh->offset);
mp_ps_print_cmd(mp, " setdash"," sd");
}
}
@ @<Declarations@>=
-boolean mp_gr_same_dashes (mp_dash_object *h, mp_dash_object *hh) ;
+static boolean mp_gr_same_dashes (mp_dash_object *h, mp_dash_object *hh) ;
@ This function test if |h| and |hh| represent the same dash pattern.
@@ -5033,20 +5041,20 @@ boolean mp_gr_same_dashes (mp_dash_object *h, mp_dash_object *hh) {
int i = 0;
if ( h==hh ) ret=true;
else if ( (h==NULL)||(hh==NULL) ) ret=false;
- else if ( h->offset_field!=hh->offset_field ) ret=false;
- else if ( h->array_field == hh->array_field) ret=true;
- else if ( h->array_field == NULL || hh->array_field == NULL) ret=false;
+ else if ( h->offset!=hh->offset ) ret=false;
+ else if ( h->array == hh->array ) ret=true;
+ else if ( h->array == NULL || hh->array == NULL) ret=false;
else { @<Compare |dash_list(h)| and |dash_list(hh)|@>; }
return ret;
}
@ @<Compare |dash_list(h)| and |dash_list(hh)|@>=
{
- while (*(h->array_field+i)!=-1 &&
- *(hh->array_field+i)!=-1 &&
- *(h->array_field+i) == *(hh->array_field+i)) i++;
+ while (*(h->array+i)!=-1 &&
+ *(hh->array+i)!=-1 &&
+ *(h->array+i) == *(hh->array+i)) i++;
if (i>0) {
- if (*(h->array_field+(i))==-1 && *(hh->array_field+(i)) == -1)
+ if (*(h->array+i)==-1 && *(hh->array+i) == -1)
ret=true;
}
}
@@ -5061,7 +5069,7 @@ If |fill_also=true|, the path is to be filled as well as stroked so we must
insert commands to do this after giving the path.
@<Declarations@>=
-void mp_gr_stroke_ellipse (MP mp, mp_graphic_object *h, boolean fill_also) ;
+static void mp_gr_stroke_ellipse (MP mp, mp_graphic_object *h, boolean fill_also) ;
@
@c void mp_gr_stroke_ellipse (MP mp, mp_graphic_object *h, boolean fill_also) {
@@ -5188,7 +5196,7 @@ if ( abs(det)<d1 ) {
@ Here is a simple routine that just fills a cycle.
@<Declarations@>=
-void mp_gr_ps_fill_out (MP mp, mp_knot *p);
+static void mp_gr_ps_fill_out (MP mp, mp_knot *p);
@ @c
void mp_gr_ps_fill_out (MP mp, mp_knot *p) { /* fill cyclic path~|p| */
@@ -5208,7 +5216,7 @@ non-shifting part of the transformation matrix. It is careful to avoid
additions that might cause undetected overflow.
@<Declarations@>=
-scaled mp_gr_choose_scale (MP mp, mp_graphic_object *p) ;
+static scaled mp_gr_choose_scale (MP mp, mp_graphic_object *p) ;
@ @c scaled mp_gr_choose_scale (MP mp, mp_graphic_object *p) {
/* |p| should point to a text node */
@@ -5232,7 +5240,7 @@ has to fit in a |name_type|, which is a quarterword.
@d fscale_tolerance 65 /* that's $.001\times2^{16}$ */
@<Declarations@>=
-quarterword mp_size_index (MP mp, font_number f, scaled s) ;
+static quarterword mp_size_index (MP mp, font_number f, scaled s) ;
@ @c
quarterword mp_size_index (MP mp, font_number f, scaled s) {
@@ -5256,7 +5264,7 @@ quarterword mp_size_index (MP mp, font_number f, scaled s) {
}
@ @<Declarations@>=
-scaled mp_indexed_size (MP mp,font_number f, quarterword j);
+static scaled mp_indexed_size (MP mp,font_number f, quarterword j);
@ @c
scaled mp_indexed_size (MP mp,font_number f, quarterword j) {
@@ -5273,7 +5281,7 @@ scaled mp_indexed_size (MP mp,font_number f, quarterword j) {
}
@ @<Declarations@>=
-void mp_clear_sizes (MP mp) ;
+static void mp_clear_sizes (MP mp) ;
@ @c void mp_clear_sizes (MP mp) {
font_number f; /* the font whose size list is being cleared */
@@ -5297,10 +5305,8 @@ a scale factor equal to $1/\sqrt2$ times the Frobenius norm of the
non-shifting part of the transformation matrix. It is careful to avoid
additions that might cause undetected overflow.
-@<Declare the \ps\ output procedures@>=
-scaled mp_choose_scale (MP mp, mp_graphic_object *p) ;
-@ @c scaled mp_choose_scale (MP mp, mp_graphic_object *p) {
+@ @c static scaled mp_choose_scale (MP mp, mp_graphic_object *p) {
/* |p| should point to a text node */
scaled a,b,c,d,ad,bc; /* temporary values */
a=gr_txx_val(p);
@@ -5325,7 +5331,7 @@ position in the size list for its font.
@ @<Declarations@>=
-void mp_apply_mark_string_chars(MP mp, mp_edge_object *h, int next_size);
+static void mp_apply_mark_string_chars(MP mp, mp_edge_object *h, int next_size);
@ @c
void mp_apply_mark_string_chars(MP mp, mp_edge_object *h, int next_size) {
@@ -5334,8 +5340,8 @@ void mp_apply_mark_string_chars(MP mp, mp_edge_object *h, int next_size) {
while ( p!= NULL ) {
if ( gr_type(p)==mp_text_code ) {
if ( gr_font_n(p)!=null_font ) {
- if ( gr_name_type(p)==next_size )
- mp_mark_string_chars(mp, gr_font_n(p),gr_text_p(p));
+ if ( gr_size_index(p)==(unsigned char)next_size )
+ mp_mark_string_chars(mp, gr_font_n(p),gr_text_p(p),gr_text_l(p));
}
}
p=gr_link(p);
@@ -5360,7 +5366,7 @@ while ( p!=null ) {
case 2:
case 3:
mp->font_sizes[f] = mp_void;
- mp_mark_string_chars(mp, f, gr_text_p(p));
+ mp_mark_string_chars(mp, f, gr_text_p(p),gr_text_l(p));
if (mp_has_fm_entry(mp,f,NULL) ) {
if (mp->font_enc_name[f]==NULL )
mp->font_enc_name[f] = mp_fm_encoding_name(mp,f);
@@ -5371,9 +5377,9 @@ while ( p!=null ) {
mp->font_sizes[f]=mp_void;
break;
default:
- gr_name_type(p)=mp_size_index(mp, f,mp_choose_scale(mp, p));
- if ( gr_name_type(p)==0 )
- mp_mark_string_chars(mp, f, gr_text_p(p));
+ gr_size_index(p)=(unsigned char)mp_size_index(mp, f,mp_choose_scale(mp, p));
+ if ( gr_size_index(p)==0 )
+ mp_mark_string_chars(mp, f, gr_text_p(p),gr_text_l(p));
}
}
}
@@ -5384,21 +5390,31 @@ while ( p!=null ) {
@
@d pen_is_elliptical(A) ((A)==gr_next_knot((A)))
-@<Exported function headers@>=
-void mp_gr_ship_out (mp_edge_object *hh, int prologues, int procset) ;
+@<Exported function ...@>=
+int mp_gr_ship_out (mp_edge_object *hh, int prologues, int procset, int standalone) ;
@ @c
-void mp_gr_ship_out (mp_edge_object *hh, int prologues, int procset) {
+int mp_gr_ship_out (mp_edge_object *hh, int qprologues, int qprocset,int standalone) {
mp_graphic_object *p;
scaled ds,scf; /* design size and scale factor for a text node */
font_number f; /* for loops over fonts while (un)marking characters */
boolean transformed; /* is the coordinate system being transformed? */
- MP mp = hh->_parent;
- if (mp->history >= mp_fatal_error_stop ) return;
- if (prologues<0)
- prologues = (mp->internal[mp_prologues]>>16);
- if (procset<0)
- procset = (mp->internal[mp_procset]>>16);
+ int prologues, procset;
+ MP mp = hh->parent;
+ if (standalone) {
+ mp->jump_buf = malloc(sizeof(jmp_buf));
+ if (mp->jump_buf == NULL || setjmp(*(mp->jump_buf)))
+ return 0;
+ }
+ if (mp->history >= mp_fatal_error_stop ) return 1;
+ if (qprologues<0)
+ prologues = (int)((unsigned)mp->internal[mp_prologues]>>16);
+ else
+ prologues=qprologues;
+ if (qprocset<0)
+ procset = (int)((unsigned)mp->internal[mp_procset]>>16);
+ else
+ procset=qprocset;
mp_open_output_file(mp);
mp_print_initial_comment(mp, hh, prologues);
p = hh->body;
@@ -5446,15 +5462,15 @@ void mp_gr_ship_out (mp_edge_object *hh, int prologues, int procset) {
}
break;
case mp_text_code:
- if ( (gr_font_n(p)!=null_font) && (strlen(gr_text_p(p))>0) ) {
+ if ( (gr_font_n(p)!=null_font) && (gr_text_l(p)>0) ) {
if ( prologues>0 )
scf=mp_gr_choose_scale(mp, p);
else
- scf=mp_indexed_size(mp, gr_font_n(p), gr_name_type(p));
+ scf=mp_indexed_size(mp, gr_font_n(p), (quarterword)gr_size_index(p));
@<Shift or transform as necessary before outputting text node~|p| at scale
factor~|scf|; set |transformed:=true| if the original transformation must
be restored@>;
- mp_ps_string_out(mp, gr_text_p(p));
+ mp_ps_string_out(mp, gr_text_p(p),gr_text_l(p));
mp_ps_name_out(mp, mp->font_name[gr_font_n(p)],false);
@<Print the size information and \ps\ commands for text node~|p|@>;
mp_ps_print_ln(mp);
@@ -5497,8 +5513,21 @@ void mp_gr_ship_out (mp_edge_object *hh, int prologues, int procset) {
(mp->close_file)(mp,mp->ps_file);
if ( prologues<=0 )
mp_clear_sizes(mp);
+ return 1;
+}
+
+@ @(mplibps.h@>=
+int mp_ps_ship_out (mp_edge_object *hh, int prologues, int procset) ;
+
+@ @c
+int mp_ps_ship_out (mp_edge_object *hh, int prologues, int procset) {
+ return mp_gr_ship_out (hh, prologues, procset, (int)true);
}
+
+
+
+
@
@d do_write_prescript(a,b) {
if ( (gr_pre_script((b *)a))!=NULL ) {
@@ -5514,19 +5543,6 @@ void mp_gr_ship_out (mp_edge_object *hh, int prologues, int procset) {
else if (gr_type(p)==mp_text_code) { do_write_prescript(p,mp_text_object); }
}
-@ The envelope of a cyclic path~|q| could be computed by calling
-|make_envelope| once for |q| and once for its reversal. We don't do this
-because it would fail color regions that are covered by the pen regardless
-of where it is placed on~|q|.
-
-@<Break the cycle and set |t:=1| if path |q| is cyclic@>=
-if ( gr_left_type(q)!=mp_endpoint ) {
- gr_left_type(mp_gr_insert_knot(mp, q,gr_x_coord(q),gr_y_coord(q)))=mp_endpoint;
- gr_right_type(q)=mp_endpoint;
- q=gr_next_knot(q);
- t=1;
-}
-
@ @<Print the size information and \ps\ commands for text node~|p|@>=
ps_room(18);
mp_ps_print_char(mp, ' ');
@@ -5555,8 +5571,7 @@ if ( transformed ) {
}
mp_ps_print_ln(mp)
-
-@ @<Exported function headers@>=
+@ @(mplibps.h@>=
void mp_gr_toss_objects ( mp_edge_object *hh) ;
void mp_gr_toss_object (mp_graphic_object *p) ;
@@ -5616,10 +5631,11 @@ void mp_gr_toss_objects (mp_edge_object *hh) {
mp_gr_toss_object(p);
p=q;
}
+ mp_xfree(hh->filename);
mp_xfree(hh);
}
-@ @<Exported function headers@>=
+@ @(mplibps.h@>=
mp_graphic_object *mp_gr_copy_object (MP mp, mp_graphic_object *p) ;
@ @c
@@ -5655,7 +5671,8 @@ mp_gr_copy_object (MP mp, mp_graphic_object *p) {
tt = (mp_text_object *)mp_new_graphic_object(mp, mp_text_code);
gr_pre_script(tt) = mp_xstrdup(mp, gr_pre_script((mp_text_object *)p));
gr_post_script(tt) = mp_xstrdup(mp, gr_post_script((mp_text_object *)p));
- gr_text_p(tt) = mp_xstrdup(mp, gr_text_p(p));
+ gr_text_p(tt) = mp_xstrldup(mp, gr_text_p(p), gr_text_l(p));
+ gr_text_l(tt) = gr_text_l(p);
gr_font_name(tt) = mp_xstrdup(mp, gr_font_name(p));
q = (mp_graphic_object *)tt;
break;
diff --git a/Build/source/texk/web2c/luatexdir/mp/tfmin.w b/Build/source/texk/web2c/luatexdir/mp/tfmin.w
new file mode 100644
index 00000000000..8b9ef84ef73
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/mp/tfmin.w
@@ -0,0 +1,242 @@
+% $Id: mp.w 597 2008-07-03 15:35:34Z taco $
+%
+% Copyright 2008 Taco Hoekwater.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+% TeX is a trademark of the American Mathematical Society.
+% METAFONT is a trademark of Addison-Wesley Publishing Company.
+% PostScript is a trademark of Adobe Systems Incorporated.
+
+% Here is TeX material that gets inserted after \input webmac
+
+\font\tenlogo=logo10 % font used for the METAFONT logo
+\font\logos=logosl10
+\def\MF{{\tenlogo META}\-{\tenlogo FONT}}
+\def\MP{{\tenlogo META}\-{\tenlogo POST}}
+
+\def\title{Reading TEX metrics files}
+\pdfoutput=1
+
+@ Introduction.
+
+@ Needed headers and macros
+
+@d qi(A) (quarterword)(A) /* to store eight bits in a quarterword */
+@d null_font 0 /* the |font_number| for an empty font */
+@d false 0
+@d true 1
+@d hlp1(A) mp->help_line[0]=A; }
+@d hlp2(A,B) mp->help_line[1]=A; hlp1(B)
+@d hlp3(A,B,C) mp->help_line[2]=A; hlp2(B,C)
+@d help3 { mp->help_ptr=3; hlp3 /* use this with three help lines */
+
+@c
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mplib.h"
+#include "mpmp.h" /* internal header */
+@h
+
+@ The |font_ps_name| for a built-in font should be what PostScript expects.
+A preliminary name is obtained here from the \.{TFM} name as given in the
+|fname| argument. This gets updated later from an external table if necessary.
+
+@c
+font_number mp_read_font_info (MP mp, char *fname) {
+ boolean file_opened; /* has |tfm_infile| been opened? */
+ font_number n; /* the number to return */
+ halfword lf,tfm_lh,bc,ec,nw,nh,nd; /* subfile size parameters */
+ size_t whd_size; /* words needed for heights, widths, and depths */
+ int i,ii; /* |font_info| indices */
+ int jj; /* counts bytes to be ignored */
+ scaled z; /* used to compute the design size */
+ fraction d; /* height, width, or depth as a fraction of design size times $2^{-8}$ */
+ int h_and_d; /* height and depth indices being unpacked */
+ int tfbyte = 0; /* a byte read from the file */
+ n=null_font;
+ @<Open |tfm_infile| for input@>;
+ @<Read data from |tfm_infile|; if there is no room, say so and |goto done|;
+ otherwise |goto bad_tfm| or |goto done| as appropriate@>;
+BAD_TFM:
+ @<Complain that the \.{TFM} file is bad@>;
+DONE:
+ if ( file_opened ) (mp->close_file)(mp,mp->tfm_infile);
+ if ( n!=null_font ) {
+ mp->font_ps_name[n]=mp_xstrdup(mp,fname);
+ mp->font_name[n]=mp_xstrdup(mp,fname);
+ }
+ return n;
+}
+
+@ \MP\ doesn't bother to check the entire \.{TFM} file for errors or explain
+precisely what is wrong if it does find a problem. Programs called \.{TFtoPL}
+@.TFtoPL@> @.PLtoTF@>
+and \.{PLtoTF} can be used to debug \.{TFM} files.
+
+@<Complain that the \.{TFM} file is bad@>=
+mp_print_err(mp,"Font ");
+mp_print(mp, fname);
+if ( file_opened ) mp_print(mp, " not usable: TFM file is bad");
+else mp_print(mp, " not usable: TFM file not found");
+help3("I wasn't able to read the size data for this font so this",
+ "`infont' operation won't produce anything. If the font name",
+ "is right, you might ask an expert to make a TFM file");
+if ( file_opened )
+ mp->help_line[0]="is right, try asking an expert to fix the TFM file";
+mp_error(mp)
+
+@ @<Read data from |tfm_infile|; if there is no room, say so...@>=
+@<Read the \.{TFM} size fields@>;
+@<Use the size fields to allocate space in |font_info|@>;
+@<Read the \.{TFM} header@>;
+@<Read the character data and the width, height, and depth tables and
+ |goto done|@>
+
+@ A bad \.{TFM} file can be shorter than it claims to be. The code given here
+might try to read past the end of the file if this happens. Changes will be
+needed if it causes a system error to refer to |tfm_infile^| or call
+|get_tfm_infile| when |eof(tfm_infile)| is true. For example, the definition
+@^system dependencies@>
+of |tfget| could be changed to
+``|begin get(tfm_infile); if eof(tfm_infile) then goto bad_tfm; end|.''
+
+@d tfget do {
+ size_t wanted=1;
+ unsigned char abyte=0;
+ void *tfbyte_ptr = &abyte;
+ (mp->read_binary_file)(mp,mp->tfm_infile, &tfbyte_ptr,&wanted);
+ if (wanted==0) goto BAD_TFM;
+ tfbyte = (int)abyte;
+} while (0)
+@d read_two(A) { (A)=tfbyte;
+ if ( (A)>127 ) goto BAD_TFM;
+ tfget; (A)=(A)*0400+tfbyte;
+}
+@d tf_ignore(A) { for (jj=(A);jj>=1;jj--) tfget; }
+
+@<Read the \.{TFM} size fields@>=
+tfget; read_two(lf);
+tfget; read_two(tfm_lh);
+tfget; read_two(bc);
+tfget; read_two(ec);
+if ( (bc>1+ec)||(ec>255) ) goto BAD_TFM;
+tfget; read_two(nw);
+tfget; read_two(nh);
+tfget; read_two(nd);
+whd_size=(size_t)((ec+1-bc)+nw+nh+nd);
+if ( lf<(int)(6+tfm_lh+whd_size) ) goto BAD_TFM;
+tf_ignore(10)
+
+@ Offsets are added to |char_base[n]| and |width_base[n]| so that is not
+necessary to apply the |so| and |qo| macros when looking up the width of a
+character in the string pool. In order to ensure nonnegative |char_base|
+values when |bc>0|, it may be necessary to reserve a few unused |font_info|
+elements.
+
+@<Use the size fields to allocate space in |font_info|@>=
+if ( mp->next_fmem<(size_t)bc)
+ mp->next_fmem=(size_t)bc; /* ensure nonnegative |char_base| */
+if (mp->last_fnum==mp->font_max)
+ mp_reallocate_fonts(mp,(mp->font_max+(mp->font_max/4)));
+while (mp->next_fmem+whd_size>=mp->font_mem_size) {
+ size_t l = mp->font_mem_size+(mp->font_mem_size/4);
+ memory_word *font_info;
+ font_info = mp_xmalloc (mp,(l+1),sizeof(memory_word));
+ memset (font_info,0,sizeof(memory_word)*(l+1));
+ memcpy (font_info,mp->font_info,sizeof(memory_word)*(mp->font_mem_size+1));
+ mp_xfree(mp->font_info);
+ mp->font_info = font_info;
+ mp->font_mem_size = l;
+}
+mp->last_fnum++;
+n=mp->last_fnum;
+mp->font_bc[n]=(eight_bits)bc;
+mp->font_ec[n]=(eight_bits)ec;
+mp->char_base[n]=(int)(mp->next_fmem-bc);
+mp->width_base[n]=(int)(mp->next_fmem+ec-bc+1);
+mp->height_base[n]=mp->width_base[n]+nw;
+mp->depth_base[n]=mp->height_base[n]+nh;
+mp->next_fmem=mp->next_fmem+whd_size;
+
+
+@ @<Read the \.{TFM} header@>=
+if ( tfm_lh<2 ) goto BAD_TFM;
+tf_ignore(4);
+tfget; read_two(z);
+tfget; z=z*0400+tfbyte;
+tfget; z=z*0400+tfbyte; /* now |z| is 16 times the design size */
+mp->font_dsize[n]=mp_take_fraction(mp, z,267432584);
+ /* times ${72\over72.27}2^{28}$ to convert from \TeX\ points */
+tf_ignore(4*(tfm_lh-2))
+
+@ @<Read the character data and the width, height, and depth tables...@>=
+ii=mp->width_base[n];
+i=mp->char_base[n]+bc;
+while ( i<ii ) {
+ tfget; mp->font_info[i].qqqq.b0=qi(tfbyte);
+ tfget; h_and_d=tfbyte;
+ mp->font_info[i].qqqq.b1=qi(h_and_d / 16);
+ mp->font_info[i].qqqq.b2=qi(h_and_d % 16);
+ tfget; tfget;
+ i++;
+}
+while ( i<(int)mp->next_fmem ) {
+ @<Read a four byte dimension, scale it by the design size, store it in
+ |font_info[i]|, and increment |i|@>;
+}
+goto DONE
+
+@ The raw dimension read into |d| should have magnitude at most $2^{24}$ when
+interpreted as an integer, and this includes a scale factor of $2^{20}$. Thus
+we can multiply it by sixteen and think of it as a |fraction| that has been
+divided by sixteen. This cancels the extra scale factor contained in
+|font_dsize[n|.
+
+@<Read a four byte dimension, scale it by the design size, store it in...@>=
+{
+tfget; d=tfbyte;
+if ( d>=0200 ) d=d-0400;
+tfget; d=d*0400+tfbyte;
+tfget; d=d*0400+tfbyte;
+tfget; d=d*0400+tfbyte;
+mp->font_info[i].cint=mp_take_fraction(mp, d*16,mp->font_dsize[n]);
+i++;
+}
+
+@ This function does no longer use the file name parser, because |fname| is
+a C string already.
+
+@<Open |tfm_infile| for input@>=
+file_opened=false;
+mp_ptr_scan_file(mp, fname);
+if ( strlen(mp->cur_area)==0 ) { mp_xfree(mp->cur_area); mp->cur_area=NULL; }
+if ( strlen(mp->cur_ext)==0 ) {
+ mp_xfree(mp->cur_ext);
+ mp->cur_ext=mp_xstrdup(mp,".tfm");
+}
+mp_pack_file_name(mp, mp->cur_name,mp->cur_area,mp->cur_ext);
+mp->tfm_infile = (mp->open_file)(mp, mp->name_of_file, "r",mp_filetype_metrics);
+if ( !mp->tfm_infile ) goto BAD_TFM;
+file_opened=true
+
+
+
+
+
+
+
+
diff --git a/Build/source/texk/web2c/luatexdir/nodes.h b/Build/source/texk/web2c/luatexdir/nodes.h
index ba2c09ecc78..16cfc3f258d 100644
--- a/Build/source/texk/web2c/luatexdir/nodes.h
+++ b/Build/source/texk/web2c/luatexdir/nodes.h
@@ -1,55 +1,80 @@
+/* nodes.h
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-#include <stdarg.h>
-
-#ifndef __NODES_H__
-#define __NODES_H__
+ This file is part of LuaTeX.
-/* these don't really belong here */
-
-#define token_ref_count(a) info((a)) /* reference count preceding a token list */
-#define add_token_ref(a) token_ref_count(a)++ /* new reference to a token list */
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-/* these are in texlang.c */
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-#define set_vlink(a,b) vlink(a)=b
-#define get_vlink(a) vlink(a)
-#define get_character(a) character(a)
+/* $Id$ */
-extern halfword insert_discretionary ( halfword t, halfword pre, halfword post, halfword replace);
-extern halfword insert_syllable_discretionary ( halfword t, lang_variables *lan);
-extern halfword insert_word_discretionary ( halfword t, lang_variables *lan);
-extern halfword insert_complex_discretionary ( halfword t, lang_variables *lan,
- halfword pre, halfword post, halfword replace);
-extern halfword insert_character ( halfword t, int n);
-extern void set_disc_field (halfword f, halfword t);
+#include <stdarg.h>
+#ifndef __NODES_H__
+# define __NODES_H__
-#define max_halfword 0x3FFFFFFF
-#ifndef null
-#define null 0
-#endif
-#define null_flag -0x40000000
-#define zero_glue 0
-#define normal 0
+/* these don't really belong here */
-#define vinfo(a) varmem[(a)].hh.v.LH
-#define vlink(a) varmem[(a)].hh.v.RH
-#define type(a) varmem[(a)].hh.u.B0
-#define subtype(a) varmem[(a)].hh.u.B1
-#define node_attr(a) vinfo((a)+1)
-#define alink(a) vlink((a)+1)
+# define token_ref_count(a) info((a)) /* reference count preceding a token list */
+# define add_token_ref(a) token_ref_count(a)++ /* new reference to a token list */
-#define node_size(a) varmem[(a)].hh.v.LH
-#define rlink(a) vlink((a)+1) /* aka alink() */
-#define llink(a) vinfo((a)+1) /* overlaps with node_attr() */
+/* these are in texlang.c */
-#define add_glue_ref(a) glue_ref_count(a)++ /* new reference to a glue spec */
+# define set_vlink(a,b) vlink(a)=b
+# define get_vlink(a) vlink(a)
+# define get_character(a) character(a)
+
+extern halfword insert_discretionary(halfword t, halfword pre, halfword post,
+ halfword replace);
+extern halfword insert_syllable_discretionary(halfword t, lang_variables * lan);
+extern halfword insert_word_discretionary(halfword t, lang_variables * lan);
+extern halfword insert_complex_discretionary(halfword t, lang_variables * lan,
+ halfword pre, halfword post,
+ halfword replace);
+extern halfword insert_character(halfword t, int n);
+extern void set_disc_field(halfword f, halfword t);
+
+
+# define max_halfword 0x3FFFFFFF
+# define max_dimen 0x3FFFFFFF
+# ifndef null
+# define null 0
+# endif
+# define null_flag -0x40000000
+# define zero_glue 0
+# define normal 0
+
+# define vinfo(a) varmem[(a)].hh.v.LH
+# define vlink(a) varmem[(a)].hh.v.RH
+# define type(a) varmem[(a)].hh.u.B0
+# define subtype(a) varmem[(a)].hh.u.B1
+# define node_attr(a) vinfo((a)+1)
+# define alink(a) vlink((a)+1)
+
+# define node_size(a) varmem[(a)].hh.v.LH
+
+# define rlink(a) vlink((a)+1)
+ /* aka alink() */
+# define llink(a) vinfo((a)+1)
+ /* overlaps with node_attr() */
+
+# define add_glue_ref(a) glue_ref_count(a)++ /* new reference to a glue spec */
/* really special head node pointers that only need links */
-#define temp_node_size 2
+# define temp_node_size 2
/* attribute lists */
@@ -57,550 +82,632 @@ extern void set_disc_field (halfword f, halfword t);
* be the same size
*/
-#define attribute_node_size 2
+# define attribute_node_size 2
-#define attr_list_ref(a) vinfo((a)+1) /* the reference count */
-#define attribute_id(a) vinfo((a)+1)
-#define attribute_value(a) vlink((a)+1)
+# define attr_list_ref(a) vinfo((a)+1)
+ /* the reference count */
+# define attribute_id(a) vinfo((a)+1)
+# define attribute_value(a) vlink((a)+1)
-#define cache_disabled max_halfword
-#define add_node_attr_ref(a) { if (a!=null) attr_list_ref((a))++; }
+# define cache_disabled max_halfword
+# define add_node_attr_ref(a) { if (a!=null) attr_list_ref((a))++; }
-#define replace_attribute_list(a,b) do { \
- delete_attribute_ref(node_attr(a)); \
- node_attr(a)=b; \
+# define replace_attribute_list(a,b) do { \
+ delete_attribute_ref(node_attr(a)); \
+ node_attr(a)=b; \
} while (0)
-extern void update_attribute_cache (void) ;
-extern halfword copy_attribute_list(halfword n) ;
+extern void update_attribute_cache(void);
+extern halfword copy_attribute_list(halfword n);
extern halfword do_set_attribute(halfword p, int i, int val);
/* a glue spec */
-#define glue_spec_size 4
-#define stretch(a) vlink((a)+1)
+# define glue_spec_size 4
+# define stretch(a) vlink((a)+1)
/* width == a+2 */
-#define shrink(a) vinfo((a)+1)
-#define stretch_order(a) type((a)+3)
-#define shrink_order(a) subtype((a)+3)
-#define glue_ref_count(a) vlink((a)+3)
+# define shrink(a) vinfo((a)+1)
+# define stretch_order(a) type((a)+3)
+# define shrink_order(a) subtype((a)+3)
+# define glue_ref_count(a) vlink((a)+3)
+
+typedef enum {
+ cond_math_glue = 98, /* special |subtype| to suppress glue in the next node */
+ mu_glue, /* |subtype| for math glue */
+ a_leaders, /* |subtype| for aligned leaders */
+ c_leaders, /* |subtype| for centered leaders */
+ x_leaders /* |subtype| for expanded leaders */
+} glue_subtype_codes;
/* pdf action spec */
-#define pdf_action_size 4
+# define pdf_action_size 4
typedef enum {
- pdf_action_page = 0,
- pdf_action_goto,
- pdf_action_thread,
- pdf_action_user } pdf_action_types;
-
-#define pdf_action_type(a) type((a) + 1)
-#define pdf_action_named_id(a) subtype((a) + 1)
-#define pdf_action_id(a) vlink((a) + 1)
-#define pdf_action_file(a) vinfo((a) + 2)
-#define pdf_action_new_window(a) vlink((a) + 2)
-#define pdf_action_tokens(a) vinfo((a) + 3)
-#define pdf_action_refcount(a) vlink((a) + 3)
+ pdf_action_page = 0,
+ pdf_action_goto,
+ pdf_action_thread,
+ pdf_action_user
+} pdf_action_types;
+
+# define pdf_action_type(a) type((a) + 1)
+# define pdf_action_named_id(a) subtype((a) + 1)
+# define pdf_action_id(a) vlink((a) + 1)
+# define pdf_action_file(a) vinfo((a) + 2)
+# define pdf_action_new_window(a) vlink((a) + 2)
+# define pdf_action_tokens(a) vinfo((a) + 3)
+# define pdf_action_refcount(a) vlink((a) + 3)
/*increase count of references to this action*/
-#define add_action_ref(a) pdf_action_refcount((a))++
+# define add_action_ref(a) pdf_action_refcount((a))++
/* decrease count of references to this
action; free it if there is no reference to this action*/
-#define delete_action_ref(a) { \
- if (pdf_action_refcount(a) == null) { \
- if (pdf_action_type(a) == pdf_action_user) { \
- delete_token_ref(pdf_action_tokens(a)); \
- } else { \
- if (pdf_action_file(a) != null) \
- delete_token_ref(pdf_action_file(a)); \
- if (pdf_action_type(a) == pdf_action_page) \
- delete_token_ref(pdf_action_tokens(a)); \
- else if (pdf_action_named_id(a) > 0) \
- delete_token_ref(pdf_action_id(a)); \
- } \
- free_node(a, pdf_action_size); \
- } else { \
- decr(pdf_action_refcount(a)); \
- } \
+# define delete_action_ref(a) { \
+ if (pdf_action_refcount(a) == null) { \
+ if (pdf_action_type(a) == pdf_action_user) { \
+ delete_token_ref(pdf_action_tokens(a)); \
+ } else { \
+ if (pdf_action_file(a) != null) \
+ delete_token_ref(pdf_action_file(a)); \
+ if (pdf_action_type(a) == pdf_action_page) \
+ delete_token_ref(pdf_action_tokens(a)); \
+ else if (pdf_action_named_id(a) > 0) \
+ delete_token_ref(pdf_action_id(a)); \
+ } \
+ free_node(a, pdf_action_size); \
+ } else { \
+ decr(pdf_action_refcount(a)); \
+ } \
}
/* normal nodes */
-#define inf_bad 10000 /* infinitely bad value */
-#define inf_penalty inf_bad /*``infinite'' penalty value*/
-#define eject_penalty -(inf_penalty) /*``negatively infinite'' penalty value */
+# define inf_bad 10000 /* infinitely bad value */
+# define inf_penalty inf_bad /*``infinite'' penalty value */
+# define eject_penalty -(inf_penalty) /*``negatively infinite'' penalty value */
-#define penalty_node_size 3
-#define penalty(a) vlink((a)+2)
+# define penalty_node_size 3
+# define penalty(a) vlink((a)+2)
-#define glue_node_size 3
-#define glue_ptr(a) vinfo((a)+2)
-#define leader_ptr(a) vlink((a)+2)
+# define glue_node_size 4
+# define glue_ptr(a) vinfo((a)+2)
+# define leader_ptr(a) vlink((a)+2)
+# define synctex_tag_glue(a) vinfo((a)+3)
+# define synctex_line_glue(a) vlink((a)+3)
/* disc nodes could eventually be smaller, because the indirect
pointers are not really needed (8 instead of 10).
*/
-#define disc_node_size 10
+# define disc_node_size 10
typedef enum {
- discretionary_disc=0,
- explicit_disc,
- automatic_disc,
- syllable_disc } discretionary_types;
-
-#define pre_break_head(a) ((a)+4)
-#define post_break_head(a) ((a)+6)
-#define no_break_head(a) ((a)+8)
-
-#define pre_break(a) vinfo((a)+2)
-#define post_break(a) vlink((a)+2)
-#define no_break(a) vlink((a)+3)
-#define tlink llink
-
-#define vlink_pre_break(a) vlink(pre_break_head(a))
-#define vlink_post_break(a) vlink(post_break_head(a))
-#define vlink_no_break(a) vlink(no_break_head(a))
-
-#define tlink_pre_break(a) tlink(pre_break_head(a))
-#define tlink_post_break(a) tlink(post_break_head(a))
-#define tlink_no_break(a) tlink(no_break_head(a))
-
-#define kern_node_size 3
-#define explicit 1 /*|subtype| of kern nodes from \.{\\kern} and \.{\\/}*/
-#define acc_kern 2 /*|subtype| of kern nodes from accents */
-
-#define box_node_size 8
-#define width(a) varmem[(a+2)].cint
-#define depth(a) varmem[(a+3)].cint
-#define height(a) varmem[(a+4)].cint
-#define shift_amount(a) vlink((a)+5)
-#define box_dir(a) vinfo((a)+5)
-#define list_ptr(a) vlink((a)+6)
-#define glue_order(a) subtype((a)+6)
-#define glue_sign(a) type((a)+6)
-#define glue_set(a) varmem[(a+7)].gr
+ discretionary_disc = 0,
+ explicit_disc,
+ automatic_disc,
+ syllable_disc
+} discretionary_types;
+
+# define pre_break_head(a) ((a)+4)
+# define post_break_head(a) ((a)+6)
+# define no_break_head(a) ((a)+8)
+
+# define pre_break(a) vinfo((a)+2)
+# define post_break(a) vlink((a)+2)
+# define no_break(a) vlink((a)+3)
+# define tlink llink
+
+# define vlink_pre_break(a) vlink(pre_break_head(a))
+# define vlink_post_break(a) vlink(post_break_head(a))
+# define vlink_no_break(a) vlink(no_break_head(a))
+
+# define tlink_pre_break(a) tlink(pre_break_head(a))
+# define tlink_post_break(a) tlink(post_break_head(a))
+# define tlink_no_break(a) tlink(no_break_head(a))
+
+# define kern_node_size 4
+# define explicit 1 /*|subtype| of kern nodes from \.{\\kern} and \.{\\/} */
+# define acc_kern 2 /*|subtype| of kern nodes from accents */
+# define synctex_tag_kern(a) vinfo((a)+3)
+# define synctex_line_kern(a) vlink((a)+3)
+
+# define box_node_size 9
+# define width(a) varmem[(a+2)].cint
+# define depth(a) varmem[(a+3)].cint
+# define height(a) varmem[(a+4)].cint
+# define shift_amount(a) vlink((a)+5)
+# define box_dir(a) vinfo((a)+5)
+# define list_ptr(a) vlink((a)+6)
+# define glue_order(a) subtype((a)+6)
+# define glue_sign(a) type((a)+6)
+# define glue_set(a) varmem[(a+7)].gr
+# define synctex_tag_box(a) vinfo((a)+8)
+# define synctex_line_box(a) vlink((a)+8)
+
/* unset nodes */
-#define glue_stretch(a) varmem[(a)+7].cint
-#define glue_shrink shift_amount
-#define span_count subtype
+# define glue_stretch(a) varmem[(a)+7].cint
+# define glue_shrink shift_amount
+# define span_count subtype
-#define rule_node_size 6
-#define rule_dir(a) vlink((a)+5)
+# define rule_node_size 7
+# define rule_dir(a) vlink((a)+5)
+# define synctex_tag_rule(a) vinfo((a)+6)
+# define synctex_line_rule(a) vlink((a)+6)
-#define mark_node_size 3
-#define mark_ptr(a) vlink((a)+2)
-#define mark_class(a) vinfo((a)+2)
+# define mark_node_size 3
+# define mark_ptr(a) vlink((a)+2)
+# define mark_class(a) vinfo((a)+2)
-#define adjust_node_size 3
-#define adjust_ptr(a) vlink(a+2)
+# define adjust_node_size 3
+# define adjust_ptr(a) vlink(a+2)
-#define glyph_node_size 5
+# define glyph_node_size 5
-#define character(a) vinfo((a)+2)
-#define font(a) vlink((a)+2)
-#define lang_data(a) vinfo((a)+3)
-#define lig_ptr(a) vlink((a)+3)
-#define x_displace(a) vinfo((a)+4)
-#define y_displace(a) vlink((a)+4)
-#define is_char_node(a) (a!=null && type(a)==glyph_node)
+# define character(a) vinfo((a)+2)
+# define font(a) vlink((a)+2)
+# define lang_data(a) vinfo((a)+3)
+# define lig_ptr(a) vlink((a)+3)
+# define x_displace(a) vinfo((a)+4)
+# define y_displace(a) vlink((a)+4)
+# define is_char_node(a) (a!=null && type(a)==glyph_node)
-#define char_lang(a) ((const int)(((unsigned)lang_data(a) & 0x7FFF0000)>>16))
-#define char_lhmin(a) ((const int)(((unsigned)lang_data(a) & 0x0000FF00)>>8))
-#define char_rhmin(a) ((const int)(((unsigned)lang_data(a) & 0x000000FF)))
-#define char_uchyph(a) ((const int)(((unsigned)lang_data(a) & 0x80000000)>>31))
+# define char_lang(a) ((const int)(((unsigned)lang_data(a) & 0x7FFF0000)>>16))
+# define char_lhmin(a) ((const int)(((unsigned)lang_data(a) & 0x0000FF00)>>8))
+# define char_rhmin(a) ((const int)(((unsigned)lang_data(a) & 0x000000FF)))
+# define char_uchyph(a) ((const int)(((unsigned)lang_data(a) & 0x80000000)>>31))
-#define make_lang_data(a,b,c,d) (a>0 ? (1<<31): 0)+ \
- (b<<16)+ (((c>0 && c<256) ? c : 1)<<8)+(((d>0 && d<256) ? d : 1))
+# define make_lang_data(a,b,c,d) (a>0 ? (1<<31): 0)+ \
+ (b<<16)+ (((c>0 && c<256) ? c : 255)<<8)+(((d>0 && d<256) ? d : 255))
-#define init_lang_data(a) lang_data(a)=256+1
+# define init_lang_data(a) lang_data(a)=256+1
-#define set_char_lang(a,b) lang_data(a)=make_lang_data(char_uchyph(a),b,char_lhmin(a),char_rhmin(a))
-#define set_char_lhmin(a,b) lang_data(a)=make_lang_data(char_uchyph(a),char_lang(a),b,char_rhmin(a))
-#define set_char_rhmin(a,b) lang_data(a)=make_lang_data(char_uchyph(a),char_lang(a),char_lhmin(a),b)
-#define set_char_uchyph(a,b) lang_data(a)=make_lang_data(b,char_lang(a),char_lhmin(a),char_rhmin(a))
+# define set_char_lang(a,b) lang_data(a)=make_lang_data(char_uchyph(a),b,char_lhmin(a),char_rhmin(a))
+# define set_char_lhmin(a,b) lang_data(a)=make_lang_data(char_uchyph(a),char_lang(a),b,char_rhmin(a))
+# define set_char_rhmin(a,b) lang_data(a)=make_lang_data(char_uchyph(a),char_lang(a),char_lhmin(a),b)
+# define set_char_uchyph(a,b) lang_data(a)=make_lang_data(b,char_lang(a),char_lhmin(a),char_rhmin(a))
-#define margin_kern_node_size 4
-#define margin_char(a) vlink((a)+3)
+# define margin_kern_node_size 4
+# define margin_char(a) vlink((a)+3)
/*@# {|subtype| of marginal kerns}*/
-#define left_side 0
-#define right_side 1
+# define left_side 0
+# define right_side 1
-#define math_node_size 3
-#define surround(a) vlink((a)+2)
-#define before 0 /*|subtype| for math node that introduces a formula*/
-#define after 1 /*|subtype| for math node that winds up a formula*/
+# define math_node_size 4
+# define surround(a) vlink((a)+2)
+# define before 0 /*|subtype| for math node that introduces a formula */
+# define after 1 /*|subtype| for math node that winds up a formula */
+# define synctex_tag_math(a) vinfo((a)+3)
+# define synctex_line_math(a) vlink((a)+3)
+# define ins_node_size 6
+# define float_cost(a) varmem[(a)+2].cint
+# define ins_ptr(a) vinfo((a)+5)
+# define split_top_ptr(a) vlink((a)+5)
-#define ins_node_size 6
-#define float_cost(a) varmem[(a)+2].cint
-#define ins_ptr(a) vinfo((a)+5)
-#define split_top_ptr(a) vlink((a)+5)
+# define page_ins_node_size 5
-
-#define page_ins_node_size 5
-
-#define broken_ptr(a) vlink((a)+2) /* an insertion for this class will break here if anywhere */
-#define broken_ins(a) vinfo((a)+2) /* this insertion might break at |broken_ptr| */
-#define last_ins_ptr(a) vlink((a)+3) /*the most recent insertion for this |subtype|*/
-#define best_ins_ptr(a) vinfo((a)+3) /*the optimum most recent insertion*/
+# define broken_ptr(a) vlink((a)+2) /* an insertion for this class will break here if anywhere */
+# define broken_ins(a) vinfo((a)+2) /* this insertion might break at |broken_ptr| */
+# define last_ins_ptr(a) vlink((a)+3) /*the most recent insertion for this |subtype| */
+# define best_ins_ptr(a) vinfo((a)+3) /*the optimum most recent insertion */
/* height = 4 */
typedef enum {
- hlist_node = 0,
- vlist_node = 1,
- rule_node,
- ins_node,
- mark_node,
- adjust_node,
- /* 6 used to be ligatures */
- disc_node=7,
- whatsit_node,
- math_node,
- glue_node,
- kern_node,
- penalty_node,
- unset_node, /* 13 */
- style_node,
- choice_node,
- ord_noad,
- op_noad,
- bin_noad,
- rel_noad,
- open_noad,
- close_noad,
- punct_noad,
- inner_noad,
- radical_noad,
- fraction_noad,
- under_noad,
- over_noad,
- accent_noad,
- vcenter_noad,
- left_noad,
- right_noad,
- margin_kern_node = 32,
- glyph_node = 33,
- align_record_node = 34,
- pseudo_file_node = 35,
- pseudo_line_node = 36,
- inserting_node = 37,
- split_up_node = 38,
- expr_node = 39,
- nesting_node = 40,
- span_node = 41,
- attribute_node = 42,
- glue_spec_node = 43,
- attribute_list_node = 44,
- action_node = 45,
- temp_node = 46,
- align_stack_node = 47,
- movement_node = 48,
- if_node = 49,
- unhyphenated_node = 50,
- hyphenated_node = 51,
- delta_node = 52,
- passive_node = 53,
- shape_node = 54 } node_types ;
-
-#define last_known_node temp_node /* used by \lastnodetype */
-
-#define movement_node_size 3
-#define expr_node_size 3
-#define if_node_size 2
-#define align_stack_node_size 6
-#define nesting_node_size 2
-
-#define span_node_size 3
-#define span_span(a) vlink((a)+1)
-#define span_link(a) vinfo((a)+1)
-
-#define pseudo_file_node_size 2
-#define pseudo_lines(a) vlink((a)+1)
-
-#define nodetype_has_attributes(t) (((t)<=glyph_node) && ((t)!=unset_node))
-
-#define style_node_size 4 /* number of words in a style node*/
-#define radical_noad_size 6 /*number of |mem| words in a radical noad*/
-#define accent_noad_size 6 /*number of |mem| words in an accent noad*/
-
-
-#define display_mlist(a) vinfo((a)+2) /* mlist to be used in display style*/
-#define text_mlist(a) vlink((a)+2) /* mlist to be used in text style */
-#define script_mlist(a) vinfo((a)+3) /* mlist to be used in script style */
-#define script_script_mlist(a) vlink((a)+3) /* mlist to be used in scriptscript style */
-
-#define noad_size 5 /*number of words in a normal noad*/
-#define nucleus(a) (a)+2 /* the |nucleus| field of a noad */
-#define supscr(a) (a)+3 /* the |supscr| field of a noad */
-#define subscr(a) (a)+4 /* the |subscr| field of a noad */
-#define math_type vlink /* a |quarterword| in |mem| */
-#define fam(a) type((a)) /* a |quarterword| in |mem| */
-
-#define fraction_noad_size 7 /*number of |mem| words in a fraction noad*/
-#define numerator supscr /*|numerator| field in a fraction noad*/
-#define denominator subscr /*|denominator| field in a fraction noad*/
-
-typedef enum {
- math_char=1, /* |math_type| when the attribute is simple */
- sub_box, /* |math_type| when the attribute is a box */
- sub_mlist, /* |math_type| when the attribute is a formula */
- math_text_char /* |math_type| when italic correction is dubious */
-} math_types;
+ hlist_node = 0,
+ vlist_node = 1,
+ rule_node,
+ ins_node,
+ mark_node,
+ adjust_node,
+ /* 6 used to be ligatures */
+ disc_node = 7,
+ whatsit_node,
+ math_node,
+ glue_node, /* 10 */
+ kern_node,
+ penalty_node,
+ unset_node,
+ style_node,
+ choice_node, /* 15 */
+ ord_noad,
+ op_noad,
+ bin_noad,
+ rel_noad,
+ open_noad, /* 20 */
+ close_noad,
+ punct_noad,
+ inner_noad,
+ radical_noad,
+ fraction_noad, /* 25 */
+ under_noad,
+ over_noad,
+ accent_noad,
+ vcenter_noad,
+ fence_noad, /* 30 */
+ math_char_node, /* kernel fields */
+ sub_box_node,
+ sub_mlist_node,
+ math_text_char_node,
+ delim_node, /* shield fields */
+ margin_kern_node,
+ glyph_node,
+ align_record_node,
+ pseudo_file_node,
+ pseudo_line_node, /* 40 */
+ inserting_node,
+ split_up_node,
+ expr_node,
+ nesting_node,
+ span_node,
+ attribute_node,
+ glue_spec_node,
+ attribute_list_node,
+ action_node,
+ temp_node,
+ align_stack_node,
+ movement_node,
+ if_node,
+ unhyphenated_node,
+ hyphenated_node,
+ delta_node,
+ passive_node,
+ shape_node,
+} node_types;
+
+# define last_known_node temp_node /* used by \lastnodetype */
+
+# define movement_node_size 3
+# define expr_node_size 3
+# define if_node_size 2
+# define align_stack_node_size 6
+# define nesting_node_size 2
+
+# define span_node_size 3
+# define span_span(a) vlink((a)+1)
+# define span_link(a) vinfo((a)+1)
+
+# define pseudo_file_node_size 2
+# define pseudo_lines(a) vlink((a)+1)
+
+# define nodetype_has_attributes(t) (((t)<=glyph_node) && ((t)!=unset_node))
+
+/* style and choice nodes */
+/* style nodes can be smaller, the information is encoded in |subtype|,
+ but choice nodes are on-the-spot converted to style nodes */
+
+# define style_node_size 4 /* number of words in a style node */
+
+# define display_mlist(a) vinfo((a)+2) /* mlist to be used in display style */
+# define text_mlist(a) vlink((a)+2) /* mlist to be used in text style */
+# define script_mlist(a) vinfo((a)+3) /* mlist to be used in script style */
+# define script_script_mlist(a) vlink((a)+3) /* mlist to be used in scriptscript style */
+
+/* regular noads */
+
+# define noad_size 4 /* number of words in a normal noad */
+# define new_hlist(a) vlink((a)+2) /* the translation of an mlist */
+# define nucleus(a) vinfo((a)+2) /* the |nucleus| field of a noad */
+# define supscr(a) vlink((a)+3) /* the |supscr| field of a noad */
+# define subscr(a) vinfo((a)+3) /* the |subscr| field of a noad */
+
+/* accent noads */
+/* like a regular noad, but with two extra fields. */
+
+# define accent_noad_size 5 /*number of |mem| words in an accent noad */
+# define accent_chr(a) vinfo((a)+4) /* the |accent_chr| field of an accent noad */
+# define bot_accent_chr(a) vlink((a)+4) /* the |bot_accent_chr| field of an accent noad */
+
+/* left and right noads */
+
+# define fence_noad_size 3
+# define delimiter(a) vlink((a)+2) /* |delimiter| field in left and right noads */
+
+/* subtype of fence noads */
+
+# define left_noad_side 1
+# define middle_noad_side 2
+# define right_noad_side 3
+
+/* fraction noads */
+
+# define fraction_noad_size 5 /*number of |mem| words in a fraction noad */
+# define thickness(a) vlink((a)+2) /* |thickness| field in a fraction noad */
+# define numerator(a) vlink((a)+3) /*|numerator| field in a fraction noad */
+# define denominator(a) vinfo((a)+3) /*|denominator| field in a fraction noad */
+# define left_delimiter(a) vlink((a)+4) /* first delimiter field of a noad */
+# define right_delimiter(a) vinfo((a)+4) /* second delimiter field of a fraction noad */
+
+/* radical noads */
+/* this is like a fraction, but it only stores a |left_delimiter| */
+# define radical_noad_size 5 /*number of |mem| words in a radical noad */
+
+# define degree(a) vinfo((a)+4) /* the root degree in a radical noad */
+
+# define math_kernel_node_size 3
+
+/* accessors for the |nucleus|-style node fields */
+# define math_fam(a) vinfo((a)+2)
+# define math_character(a) vlink((a)+2)
+# define math_list(a) vlink((a)+2)
+
+/* accessors for the |delimiter|-style two-word subnode fields */
+
+# define math_shield_node_size 4
+ /* not used yet */
+# define small_fam(A) vinfo((A)+2) /* |fam| for ``small'' delimiter */
+# define small_char(A) vlink((A)+2) /* |character| for ``small'' delimiter */
+# define large_fam(A) vinfo((A)+3) /* |fam| for ``large'' delimiter */
+# define large_char(A) vlink((A)+3) /* |character| for ``large'' delimiter */
typedef enum {
- open_node = 0,
- write_node,
- close_node,
- special_node,
- language_node,
- set_language_code,
- local_par_node,
- dir_node,
- pdf_literal_node,
- pdf_obj_code,
- pdf_refobj_node, /* 10 */
- pdf_xform_code,
- pdf_refxform_node,
- pdf_ximage_code,
- pdf_refximage_node,
- pdf_annot_node,
- pdf_start_link_node,
- pdf_end_link_node,
- pdf_outline_code,
- pdf_dest_node,
- pdf_thread_node, /* 20 */
- pdf_start_thread_node,
- pdf_end_thread_node,
- pdf_save_pos_node,
- pdf_thread_data_node,
- pdf_link_data_node,
- pdf_names_code,
- pdf_font_attr_code,
- pdf_include_chars_code,
- pdf_map_file_code,
- pdf_map_line_code, /* 30 */
- pdf_trailer_code,
- pdf_font_expand_code,
- set_random_seed_code,
- pdf_glyph_to_unicode_code,
- late_lua_node, /* 35 */
- close_lua_node,
- save_cat_code_table_code,
- init_cat_code_table_code,
- pdf_colorstack_node,
- pdf_setmatrix_node, /* 40 */
- pdf_save_node,
- pdf_restore_node,
- cancel_boundary_node,
- user_defined_node /* 44 */ } whatsit_types ;
-
-#define pdf_info_code pdf_thread_data_node
-#define pdf_catalog_code pdf_link_data_node
-
-
-#define GLYPH_CHARACTER (1 << 0)
-#define GLYPH_LIGATURE (1 << 1)
-#define GLYPH_GHOST (1 << 2)
-#define GLYPH_LEFT (1 << 3)
-#define GLYPH_RIGHT (1 << 4)
-
-#define is_character(p) ((subtype(p)) & GLYPH_CHARACTER)
-#define is_ligature(p) ((subtype(p)) & GLYPH_LIGATURE )
-#define is_ghost(p) ((subtype(p)) & GLYPH_GHOST )
-
-#define is_simple_character(p) (is_character(p) && !is_ligature(p) && !is_ghost(p))
-
-#define is_leftboundary(p) (is_ligature(p) && ((subtype(p)) & GLYPH_LEFT ))
-#define is_rightboundary(p) (is_ligature(p) && ((subtype(p)) & GLYPH_RIGHT ))
-#define is_leftghost(p) (is_ghost(p) && ((subtype(p)) & GLYPH_LEFT ))
-#define is_rightghost(p) (is_ghost(p) && ((subtype(p)) & GLYPH_RIGHT ))
-
-#define set_is_glyph(p) subtype(p) &= ~GLYPH_CHARACTER
-#define set_is_character(p) subtype(p) |= GLYPH_CHARACTER
-#define set_is_ligature(p) subtype(p) |= GLYPH_LIGATURE
-#define set_is_ghost(p) subtype(p) |= GLYPH_GHOST
-
-#define set_to_glyph(p) subtype(p) = (subtype(p) & 0xFF00)
-#define set_to_character(p) subtype(p) = (subtype(p) & 0xFF00) | GLYPH_CHARACTER
-#define set_to_ligature(p) subtype(p) = (subtype(p) & 0xFF00) | GLYPH_LIGATURE
-#define set_to_ghost(p) subtype(p) = (subtype(p) & 0xFF00) | GLYPH_GHOST
-
-#define set_is_leftboundary(p) { set_to_ligature(p); subtype(p) |= GLYPH_LEFT; }
-#define set_is_rightboundary(p) { set_to_ligature(p); subtype(p) |= GLYPH_RIGHT; }
-#define set_is_leftghost(p) { set_to_ghost(p); subtype(p) |= GLYPH_LEFT; }
-#define set_is_rightghost(p) { set_to_ghost(p); subtype(p) |= GLYPH_RIGHT; }
-
-
-#define special_node_size 3
-
-#define dir_node_size 4
-#define dir_dir(a) vinfo((a)+2)
-#define dir_level(a) vlink((a)+2)
-#define dir_dvi_ptr(a) vinfo((a)+3)
-#define dir_dvi_h(a) vlink((a)+3)
-
-#define write_node_size 3
-#define close_node_size 3
-#define write_tokens(a) vlink(a+2)
-#define write_stream(a) vinfo(a+2)
-
-#define open_node_size 4
-#define open_name(a) vlink((a)+2)
-#define open_area(a) vinfo((a)+3)
-#define open_ext(a) vlink((a)+3)
-
-#define late_lua_data(a) vlink((a)+2)
-#define late_lua_reg(a) vinfo((a)+2)
-
-#define local_par_size 6
-
-#define local_pen_inter(a) vinfo((a)+2)
-#define local_pen_broken(a) vlink((a)+2)
-#define local_box_left(a) vlink((a)+3)
-#define local_box_left_width(a) vinfo((a)+3)
-#define local_box_right(a) vlink((a)+4)
-#define local_box_right_width(a) vinfo((a)+4)
-#define local_par_dir(a) vinfo((a)+5)
-
-
-#define pdf_literal_data(a) vlink(a+2)
-#define pdf_literal_mode(a) vinfo(a+2)
-
-#define pdf_refobj_node_size 3
-
-#define pdf_obj_objnum(a) vinfo((a) + 2)
-
-#define pdf_refxform_node_size 6
-#define pdf_refximage_node_size 6
-#define pdf_annot_node_size 8
-#define pdf_dest_node_size 8
-#define pdf_thread_node_size 8
-
-#define pdf_width(a) varmem[(a) + 2].cint
-#define pdf_height(a) varmem[(a) + 3].cint
-#define pdf_depth(a) varmem[(a) + 4].cint
-
-#define pdf_ximage_objnum(a) vinfo((a) + 5) /* this will be removed soon */
-#define pdf_ximage_ref(a) vinfo((a) + 5)
-#define pdf_xform_objnum(a) vinfo((a) + 5)
-
-#define pdf_annot_data(a) vinfo((a) + 6)
-#define pdf_link_attr(a) vinfo((a) + 6)
-#define pdf_link_action(a) vlink((a) + 6)
-#define pdf_annot_objnum(a) varmem[(a) + 7].cint
-#define pdf_link_objnum(a) varmem[(a) + 7].cint
-
-#define pdf_dest_type(a) type((a) + 6)
-#define pdf_dest_named_id(a) subtype((a) + 6)
-#define pdf_dest_id(a) vlink((a) + 6)
-#define pdf_dest_xyz_zoom(a) vinfo((a) + 7)
-#define pdf_dest_objnum(a) vlink((a) + 7)
-
-#define pdf_thread_named_id(a) subtype((a) + 6)
-#define pdf_thread_id(a) vlink((a) + 6)
-#define pdf_thread_attr(a) vinfo((a) + 7)
+ open_node = 0,
+ write_node,
+ close_node,
+ special_node,
+ language_node,
+ set_language_code,
+ local_par_node,
+ dir_node,
+ pdf_literal_node,
+ pdf_obj_code,
+ pdf_refobj_node, /* 10 */
+ pdf_xform_code,
+ pdf_refxform_node,
+ pdf_ximage_code,
+ pdf_refximage_node,
+ pdf_annot_node,
+ pdf_start_link_node,
+ pdf_end_link_node,
+ pdf_outline_code,
+ pdf_dest_node,
+ pdf_thread_node, /* 20 */
+ pdf_start_thread_node,
+ pdf_end_thread_node,
+ pdf_save_pos_node,
+ pdf_thread_data_node,
+ pdf_link_data_node,
+ pdf_names_code,
+ pdf_font_attr_code,
+ pdf_include_chars_code,
+ pdf_map_file_code,
+ pdf_map_line_code, /* 30 */
+ pdf_trailer_code,
+ pdf_font_expand_code,
+ set_random_seed_code,
+ pdf_glyph_to_unicode_code,
+ late_lua_node, /* 35 */
+ close_lua_node,
+ save_cat_code_table_code,
+ init_cat_code_table_code,
+ pdf_colorstack_node,
+ pdf_setmatrix_node, /* 40 */
+ pdf_save_node,
+ pdf_restore_node,
+ cancel_boundary_node,
+ user_defined_node /* 44 */
+} whatsit_types;
+
+
+# define get_node_size(i,j) (i!=whatsit_node ? node_data[i].size : whatsit_node_data[j].size)
+# define get_node_name(i,j) (i!=whatsit_node ? node_data[i].name : whatsit_node_data[j].name)
+
+
+# define pdf_info_code pdf_thread_data_node
+# define pdf_catalog_code pdf_link_data_node
+
+
+# define GLYPH_CHARACTER (1 << 0)
+# define GLYPH_LIGATURE (1 << 1)
+# define GLYPH_GHOST (1 << 2)
+# define GLYPH_LEFT (1 << 3)
+# define GLYPH_RIGHT (1 << 4)
+
+# define is_character(p) ((subtype(p)) & GLYPH_CHARACTER)
+# define is_ligature(p) ((subtype(p)) & GLYPH_LIGATURE )
+# define is_ghost(p) ((subtype(p)) & GLYPH_GHOST )
+
+# define is_simple_character(p) (is_character(p) && !is_ligature(p) && !is_ghost(p))
+
+# define is_leftboundary(p) (is_ligature(p) && ((subtype(p)) & GLYPH_LEFT ))
+# define is_rightboundary(p) (is_ligature(p) && ((subtype(p)) & GLYPH_RIGHT ))
+# define is_leftghost(p) (is_ghost(p) && ((subtype(p)) & GLYPH_LEFT ))
+# define is_rightghost(p) (is_ghost(p) && ((subtype(p)) & GLYPH_RIGHT ))
+
+# define set_is_glyph(p) subtype(p) &= ~GLYPH_CHARACTER
+# define set_is_character(p) subtype(p) |= GLYPH_CHARACTER
+# define set_is_ligature(p) subtype(p) |= GLYPH_LIGATURE
+# define set_is_ghost(p) subtype(p) |= GLYPH_GHOST
+
+# define set_to_glyph(p) subtype(p) = (subtype(p) & 0xFF00)
+# define set_to_character(p) subtype(p) = (subtype(p) & 0xFF00) | GLYPH_CHARACTER
+# define set_to_ligature(p) subtype(p) = (subtype(p) & 0xFF00) | GLYPH_LIGATURE
+# define set_to_ghost(p) subtype(p) = (subtype(p) & 0xFF00) | GLYPH_GHOST
+
+# define set_is_leftboundary(p) { set_to_ligature(p); subtype(p) |= GLYPH_LEFT; }
+# define set_is_rightboundary(p) { set_to_ligature(p); subtype(p) |= GLYPH_RIGHT; }
+# define set_is_leftghost(p) { set_to_ghost(p); subtype(p) |= GLYPH_LEFT; }
+# define set_is_rightghost(p) { set_to_ghost(p); subtype(p) |= GLYPH_RIGHT; }
+
+
+# define special_node_size 3
+
+# define dir_node_size 6
+# define dir_dir(a) vinfo((a)+2)
+# define dir_level(a) vlink((a)+2)
+# define dir_dvi_ptr(a) vinfo((a)+3)
+# define dir_dvi_h(a) vlink((a)+3)
+# define dir_box_pos_h(a) vinfo((a)+4)
+# define dir_box_pos_v(a) vlink((a)+4)
+# define dir_cur_h(a) vinfo((a)+5)
+# define dir_cur_v(a) vlink((a)+5)
+
+# define write_node_size 3
+# define close_node_size 3
+# define write_tokens(a) vlink(a+2)
+# define write_stream(a) vinfo(a+2)
+
+# define open_node_size 4
+# define open_name(a) vlink((a)+2)
+# define open_area(a) vinfo((a)+3)
+# define open_ext(a) vlink((a)+3)
+
+# define late_lua_node_size 4
+# define late_lua_data(a) vlink((a)+2)
+# define late_lua_reg(a) vinfo((a)+2)
+# define late_lua_name(a) vlink((a)+3)
+
+# define local_par_size 6
+
+# define local_pen_inter(a) vinfo((a)+2)
+# define local_pen_broken(a) vlink((a)+2)
+# define local_box_left(a) vlink((a)+3)
+# define local_box_left_width(a) vinfo((a)+3)
+# define local_box_right(a) vlink((a)+4)
+# define local_box_right_width(a) vinfo((a)+4)
+# define local_par_dir(a) vinfo((a)+5)
+
+
+# define pdf_literal_data(a) vlink(a+2)
+# define pdf_literal_mode(a) vinfo(a+2)
+
+# define pdf_refobj_node_size 3
+
+# define pdf_obj_objnum(a) vinfo((a) + 2)
+
+# define pdf_refxform_node_size 6
+# define pdf_refximage_node_size 6
+# define pdf_annot_node_size 8
+# define pdf_dest_node_size 8
+# define pdf_thread_node_size 8
-#define pdf_end_link_node_size 3
-#define pdf_end_thread_node_size 3
-#define pdf_save_pos_node_size 3
+# define pdf_width(a) varmem[(a) + 2].cint
+# define pdf_height(a) varmem[(a) + 3].cint
+# define pdf_depth(a) varmem[(a) + 4].cint
-#define pdf_colorstack_node_size 4
-#define pdf_setmatrix_node_size 3
+# define pdf_ximage_objnum(a) vinfo((a) + 5) /* this will be removed soon */
+# define pdf_ximage_ref(a) vinfo((a) + 5)
+# define pdf_xform_objnum(a) vinfo((a) + 5)
-#define pdf_colorstack_stack(a) vlink((a)+2)
-#define pdf_colorstack_cmd(a) vinfo((a)+2)
-#define pdf_colorstack_data(a) vlink((a)+3)
-#define pdf_setmatrix_data(a) vlink((a)+2)
+# define pdf_annot_data(a) vinfo((a) + 6)
+# define pdf_link_attr(a) vinfo((a) + 6)
+# define pdf_link_action(a) vlink((a) + 6)
+# define pdf_annot_objnum(a) varmem[(a) + 7].cint
+# define pdf_link_objnum(a) varmem[(a) + 7].cint
-#define pdf_save_node_size 3
-#define pdf_restore_node_size 3
+# define pdf_dest_type(a) type((a) + 6)
+# define pdf_dest_named_id(a) subtype((a) + 6)
+# define pdf_dest_id(a) vlink((a) + 6)
+# define pdf_dest_xyz_zoom(a) vinfo((a) + 7)
+# define pdf_dest_objnum(a) vlink((a) + 7)
+
+# define pdf_thread_named_id(a) subtype((a) + 6)
+# define pdf_thread_id(a) vlink((a) + 6)
+# define pdf_thread_attr(a) vinfo((a) + 7)
+
+# define pdf_end_link_node_size 3
+# define pdf_end_thread_node_size 3
+# define pdf_save_pos_node_size 3
+
+# define pdf_colorstack_node_size 4
+# define pdf_setmatrix_node_size 3
+
+# define pdf_colorstack_stack(a) vlink((a)+2)
+# define pdf_colorstack_cmd(a) vinfo((a)+2)
+# define pdf_colorstack_data(a) vlink((a)+3)
+# define pdf_setmatrix_data(a) vlink((a)+2)
+
+# define pdf_save_node_size 3
+# define pdf_restore_node_size 3
typedef enum {
- colorstack_set=0,
- colorstack_push,
- colorstack_pop,
- colorstack_current } colorstack_commands;
+ colorstack_set = 0,
+ colorstack_push,
+ colorstack_pop,
+ colorstack_current
+} colorstack_commands;
-#define colorstack_data colorstack_push /* last value where data field is set */
+# define colorstack_data colorstack_push /* last value where data field is set */
-#define user_defined_node_size 4
-#define user_node_type(a) vinfo((a)+2)
-#define user_node_id(a) vlink((a)+2)
-#define user_node_value(a) vinfo((a)+3)
+# define user_defined_node_size 4
+# define user_node_type(a) vinfo((a)+2)
+# define user_node_id(a) vlink((a)+2)
+# define user_node_value(a) vinfo((a)+3)
-#define cancel_boundary_size 3
+# define cancel_boundary_size 3
typedef enum {
- exactly=0, /*a box dimension is pre-specified*/
- additional, /*a box dimension is increased from the natural one*/
- cal_expand_ratio, /* calculate amount for font expansion after breaking
- paragraph into lines*/
- subst_ex_font /* substitute fonts */
+ exactly = 0, /*a box dimension is pre-specified */
+ additional, /*a box dimension is increased from the natural one */
+ cal_expand_ratio, /* calculate amount for font expansion after breaking
+ paragraph into lines */
+ subst_ex_font /* substitute fonts */
} hpack_subtypes;
-#define active_node_size 4 /*number of words in extended active nodes*/
-#define fitness subtype /*|very_loose_fit..tight_fit| on final line for this break*/
-#define break_node(a) vlink((a)+1) /*pointer to the corresponding passive node */
-#define line_number(a) vinfo((a)+1) /*line that begins at this breakpoint*/
-#define total_demerits(a) varmem[(a)+2].cint /* the quantity that \TeX\ minimizes*/
-#define active_short(a) vinfo(a+3) /* |shortfall| of this line */
-#define active_glue(a) vlink(a+3) /*corresponding glue stretch or shrink*/
-
-#define passive_node_size 7
-#define cur_break(a) vlink((a)+1) /*in passive node, points to position of this breakpoint*/
-#define prev_break(a) vinfo((a)+1) /*points to passive node that should precede this one */
-#define passive_pen_inter(a) vinfo((a)+2)
-#define passive_pen_broken(a) vlink((a)+2)
-#define passive_left_box(a) vlink((a)+3)
-#define passive_left_box_width(a) vinfo((a)+3)
-#define passive_last_left_box(a) vlink((a)+4)
-#define passive_last_left_box_width(a) vinfo((a)+4)
-#define passive_right_box(a) vlink((a)+5)
-#define passive_right_box_width(a) vinfo((a)+5)
-#define serial(a) vlink((a)+6) /* serial number for symbolic identification*/
-
-#define delta_node_size 10 /* 8 fields, stored in a+1..9 */
-
-#define couple_nodes(a,b) {assert(b!=null);vlink(a)=b;alink(b)=a;}
-#define try_couple_nodes(a,b) if (b==null) vlink(a)=b; else {couple_nodes(a,b);}
-#define uncouple_node(a) {assert(a!=null);vlink(a)=null;alink(a)=null;}
-
-#define cache_disabled max_halfword
-
-extern void delete_attribute_ref(halfword b) ;
-extern void build_attribute_list(halfword b) ;
+# define active_node_size 4 /*number of words in extended active nodes */
+# define fitness subtype /*|very_loose_fit..tight_fit| on final line for this break */
+# define break_node(a) vlink((a)+1) /*pointer to the corresponding passive node */
+# define line_number(a) vinfo((a)+1) /*line that begins at this breakpoint */
+# define total_demerits(a) varmem[(a)+2].cint /* the quantity that \TeX\ minimizes */
+# define active_short(a) vinfo(a+3) /* |shortfall| of this line */
+# define active_glue(a) vlink(a+3) /*corresponding glue stretch or shrink */
+
+# define passive_node_size 7
+# define cur_break(a) vlink((a)+1) /*in passive node, points to position of this breakpoint */
+# define prev_break(a) vinfo((a)+1) /*points to passive node that should precede this one */
+# define passive_pen_inter(a) vinfo((a)+2)
+# define passive_pen_broken(a) vlink((a)+2)
+# define passive_left_box(a) vlink((a)+3)
+# define passive_left_box_width(a) vinfo((a)+3)
+# define passive_last_left_box(a) vlink((a)+4)
+# define passive_last_left_box_width(a) vinfo((a)+4)
+# define passive_right_box(a) vlink((a)+5)
+# define passive_right_box_width(a) vinfo((a)+5)
+# define serial(a) vlink((a)+6) /* serial number for symbolic identification */
+
+# define delta_node_size 10 /* 8 fields, stored in a+1..9 */
+
+# define couple_nodes(a,b) {assert(b!=null);vlink(a)=b;alink(b)=a;}
+# define try_couple_nodes(a,b) if (b==null) vlink(a)=b; else {couple_nodes(a,b);}
+# define uncouple_node(a) {assert(a!=null);vlink(a)=null;alink(a)=null;}
+
+# define cache_disabled max_halfword
+
+extern void delete_attribute_ref(halfword b);
+extern void build_attribute_list(halfword b);
extern int unset_attribute(halfword n, int c, int w);
extern void set_attribute(halfword n, int c, int w);
extern int has_attribute(halfword n, int c, int w);
-extern halfword new_span_node (halfword n, int c, scaled w);
-extern halfword string_to_pseudo(integer l,integer pool_ptr, integer nl);
+extern halfword new_span_node(halfword n, int c, scaled w);
+extern halfword string_to_pseudo(integer l, integer pool_ptr, integer nl);
+
+extern void print_short_node_contents(halfword n);
+extern void show_node_list(integer i);
+extern pointer actual_box_width(pointer r, scaled base_width);
/* TH: these two defines still need checking. The node ordering in luatex is not
quite the same as in tex82 */
-#define precedes_break(a) (type((a))<math_node && (type(a)!=whatsit_node || subtype(a)!=dir_node))
-#define non_discardable(a) (type((a))<math_node)
+# define precedes_break(a) (type((a))<math_node && (type(a)!=whatsit_node || subtype(a)!=dir_node))
+# define non_discardable(a) (type((a))<math_node)
/* from luanode.c */
typedef struct _node_info {
- int id;
- int size;
- char **fields;
- char *name;
-} node_info;
+ int id;
+ int size;
+ char **fields;
+ char *name;
+} node_info;
extern node_info node_data[];
extern node_info whatsit_node_data[];
@@ -610,39 +717,42 @@ extern void flush_node(halfword);
extern halfword copy_node_list(halfword);
extern halfword copy_node(halfword);
extern void check_node(halfword);
-extern void check_node_mem (void);
-extern void fix_node_list (halfword);
+extern void check_node_mem(void);
+extern void fix_node_list(halfword);
extern int fix_node_lists;
-extern char *sprint_node_mem_usage (void) ;
-extern halfword raw_glyph_node(void) ;
+extern char *sprint_node_mem_usage(void);
+extern halfword raw_glyph_node(void);
extern halfword new_glyph_node(void);
extern int valid_node(halfword);
-#define unity 0x10000
+# define unity 0x10000
typedef enum {
- normal_g=0,
- sfi,
- fil,
- fill,
- filll } glue_orders;
-
-#define zero_glue 0
-#define sfi_glue zero_glue+glue_spec_size
-#define fil_glue sfi_glue+glue_spec_size
-#define fill_glue fil_glue+glue_spec_size
-#define ss_glue fill_glue+glue_spec_size
-#define fil_neg_glue ss_glue+glue_spec_size
-#define page_ins_head fil_neg_glue+glue_spec_size
-#define contrib_head page_ins_head+temp_node_size
-#define page_head contrib_head+temp_node_size
-#define temp_head page_head+temp_node_size
-#define hold_head temp_head+temp_node_size
-#define adjust_head hold_head+temp_node_size
-#define pre_adjust_head adjust_head+temp_node_size
-#define active pre_adjust_head+temp_node_size
-#define align_head active+active_node_size
-#define end_span align_head+temp_node_size
-#define begin_point end_span+glyph_node_size
-#define end_point begin_point+glyph_node_size
+ normal_g = 0,
+ sfi,
+ fil,
+ fill,
+ filll
+} glue_orders;
+
+# define zero_glue 0
+# define sfi_glue zero_glue+glue_spec_size
+# define fil_glue sfi_glue+glue_spec_size
+# define fill_glue fil_glue+glue_spec_size
+# define ss_glue fill_glue+glue_spec_size
+# define fil_neg_glue ss_glue+glue_spec_size
+# define page_ins_head fil_neg_glue+glue_spec_size
+# define contrib_head page_ins_head+temp_node_size
+# define page_head contrib_head+temp_node_size
+# define temp_head page_head+temp_node_size
+# define hold_head temp_head+temp_node_size
+# define adjust_head hold_head+temp_node_size
+# define pre_adjust_head adjust_head+temp_node_size
+# define active pre_adjust_head+temp_node_size
+# define align_head active+active_node_size
+# define end_span align_head+temp_node_size
+# define begin_point end_span+span_node_size
+# define end_point begin_point+glyph_node_size
+# define var_mem_stat_max (end_point+glyph_node_size-1)
+
#endif
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pagetree.c b/Build/source/texk/web2c/luatexdir/pdf/pagetree.c
new file mode 100644
index 00000000000..d88bdea51e8
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/pdf/pagetree.c
@@ -0,0 +1,268 @@
+/* pagetree.c
+
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: pagetree.c 2031 2009-03-16 10:30:47Z taco $ */
+
+#include "ptexlib.h"
+
+#include "openbsd-compat.h"
+#ifdef HAVE_ASPRINTF /* asprintf is not defined in openbsd-compat.h, but in stdio.h */
+# include <stdio.h>
+#endif
+
+#include "sys/types.h"
+#ifndef __MINGW32__
+# include "sysexits.h"
+#else
+# define EX_SOFTWARE 70
+#endif
+
+static const char __svn_version[] = "$Id: pagetree.c 2031 2009-03-16 10:30:47Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/pdf/pagetree.c $";
+
+/**********************************************************************/
+/* Page diversions */
+
+#ifdef DEBUG
+# define PAGES_TREE_KIDSMAX 3
+#else
+# define PAGES_TREE_KIDSMAX 6
+#endif
+
+static struct avl_table *divert_list_tree = NULL;
+
+typedef struct pages_entry_ {
+ integer objnum; /* object number of this /Pages object */
+ integer number_of_pages; /* total number of all pages below */
+ integer number_of_kids; /* number of direct kid objects */
+ integer kids[PAGES_TREE_KIDSMAX]; /* array of kid object numbers */
+ struct pages_entry_ *next;
+} pages_entry;
+
+typedef struct divert_list_entry_ {
+ integer divnum;
+ pages_entry *first;
+ pages_entry *last;
+} divert_list_entry;
+
+static int comp_divert_list_entry(const void *pa, const void *pb, void *p)
+{
+ if (((const divert_list_entry *) pa)->divnum >
+ ((const divert_list_entry *) pb)->divnum)
+ return 1;
+ if (((const divert_list_entry *) pa)->divnum <
+ ((const divert_list_entry *) pb)->divnum)
+ return -1;
+ return 0;
+}
+
+static pages_entry *new_pages_entry()
+{
+ pages_entry *p;
+ int i;
+ p = xtalloc(1, pages_entry);
+ p->number_of_pages = p->number_of_kids = 0;
+ for (i = 0; i < PAGES_TREE_KIDSMAX; i++)
+ p->kids[i] = 0;
+ p->next = NULL;
+ pdf_create_obj(0, 0);
+ p->objnum = obj_ptr;
+ return p;
+}
+
+static divert_list_entry *new_divert_list_entry()
+{
+ divert_list_entry *d;
+ d = xtalloc(1, divert_list_entry);
+ d->first = d->last = NULL;
+ return d;
+}
+
+static void ensure_list_tree()
+{
+ if (divert_list_tree == NULL) {
+ divert_list_tree =
+ avl_create(comp_divert_list_entry, NULL, &avl_xallocator);
+ assert(divert_list_tree != NULL);
+ }
+}
+
+static divert_list_entry *get_divert_list(integer divnum)
+{
+ divert_list_entry *d, tmp;
+ void **aa;
+ tmp.divnum = divnum;
+ d = (divert_list_entry *) avl_find(divert_list_tree, &tmp);
+ if (d == NULL) {
+ d = new_divert_list_entry();
+ d->divnum = divnum;
+ aa = avl_probe(divert_list_tree, d);
+ assert(aa != NULL);
+ }
+ return d;
+}
+
+/* pdf_do_page_divert() returns the current /Parent object number */
+
+integer pdf_do_page_divert(integer objnum, integer divnum)
+{
+ divert_list_entry *d;
+ pages_entry *p;
+#ifdef DEBUG
+ pages_entry *q;
+ struct avl_traverser t;
+ int i;
+#endif
+ // initialize the tree
+ ensure_list_tree();
+ // make sure we have a list for this diversion
+ d = get_divert_list(divnum);
+ if (d->first == NULL || d->last->number_of_kids == PAGES_TREE_KIDSMAX) {
+ // append a new pages_entry
+ p = new_pages_entry();
+ if (d->first == NULL)
+ d->first = p;
+ else
+ d->last->next = p;
+ d->last = p;
+ }
+ p = d->last;
+ p->kids[p->number_of_kids++] = objnum;
+ p->number_of_pages++;
+#ifdef DEBUG
+ printf("\n");
+ avl_t_init(&t, divert_list_tree);
+ for (d = avl_t_first(&t, divert_list_tree); d != NULL; d = avl_t_next(&t)) {
+ printf("===== D-LIST %d: ", d->divnum);
+ for (q = d->first; q != NULL; q = q->next) {
+ printf("P=%d NK=%d (", q->objnum, q->number_of_kids);
+ for (i = 0; i < q->number_of_kids; i++)
+ printf("%d ", q->kids[i]);
+ printf(") ");
+ }
+ printf("\n");
+ }
+ printf("\n");
+#endif
+ return p->objnum;
+}
+
+static void movelist(divert_list_entry * d, divert_list_entry * dto)
+{
+ if (d != NULL && d->first != NULL && d->divnum != dto->divnum) { /* no undivert of empty list or into self */
+ if (dto->first == NULL)
+ dto->first = d->first;
+ else
+ dto->last->next = d->first;
+ dto->last = d->last;
+ d->first = d->last = NULL; /* one could as well remove this divert_list_entry */
+ }
+}
+
+/* undivert from diversion <divnum> into diversion <curdivnum> */
+
+void pdf_do_page_undivert(integer divnum, integer curdivnum)
+{
+ divert_list_entry *d, *dto, tmp;
+ struct avl_traverser t;
+#ifdef DEBUG
+ pages_entry *p;
+ int i;
+#endif
+ // initialize the tree
+ ensure_list_tree();
+ // find the diversion <curdivnum> list where diversion <divnum> should go
+ dto = get_divert_list(curdivnum);
+ if (divnum == 0) { /* 0 = special case: undivert _all_ lists */
+ avl_t_init(&t, divert_list_tree);
+ for (d = avl_t_first(&t, divert_list_tree); d != NULL;
+ d = avl_t_next(&t))
+ movelist(d, dto);
+ } else {
+ tmp.divnum = divnum;
+ d = (divert_list_entry *) avl_find(divert_list_tree, &tmp);
+ movelist(d, dto);
+ }
+#ifdef DEBUG
+ printf("\n");
+ avl_t_init(&t, divert_list_tree);
+ for (d = avl_t_first(&t, divert_list_tree); d != NULL; d = avl_t_next(&t)) {
+ printf("===== U-LIST %d: ", d->divnum);
+ for (p = d->first; p != NULL; p = p->next) {
+ printf("P=%d NK=%d (", p->objnum, p->number_of_kids);
+ for (i = 0; i < p->number_of_kids; i++)
+ printf("%d ", p->kids[i]);
+ printf(") ");
+ }
+ printf("\n");
+ }
+ printf("\n");
+#endif
+}
+
+/* write a /Pages object */
+
+static void write_pages(pages_entry * p, int parent)
+{
+ int i;
+ assert(p != NULL);
+ pdf_begin_dict(p->objnum, 1);
+ pdf_printf("/Type /Pages\n");
+ if (parent == 0) /* it's root */
+ print_pdf_pages_attr();
+ else
+ pdf_printf("/Parent %d 0 R\n", parent);
+ pdf_printf("/Count %d\n/Kids [", (int) p->number_of_pages);
+ for (i = 0; i < p->number_of_kids; i++)
+ pdf_printf("%d 0 R ", (int) p->kids[i]);
+ remove_last_space();
+ pdf_printf("]\n");
+ pdf_end_dict();
+}
+
+/* loop over all /Pages objects, output them, create their parents,
+ * recursing bottom up, return the /Pages root object number */
+
+static integer output_pages_list(pages_entry * pe)
+{
+ pages_entry *p, *q, *r;
+ assert(pe != NULL);
+ if (pe->next == NULL) { /* everything fits into one pages_entry */
+ write_pages(pe, 0); /* --> /Pages root found */
+ return pe->objnum;
+ }
+ q = r = new_pages_entry(); /* one level higher needed */
+ for (p = pe; p != NULL; p = p->next) {
+ if (q->number_of_kids == PAGES_TREE_KIDSMAX) {
+ q->next = new_pages_entry();
+ q = q->next;
+ }
+ q->kids[q->number_of_kids++] = p->objnum;
+ q->number_of_pages += p->number_of_pages;
+ write_pages(p, q->objnum);
+ }
+ return output_pages_list(r); /* recurse through next higher level */
+}
+
+integer output_pages_tree()
+{
+ divert_list_entry *d;
+ pdf_do_page_undivert(0, 0); /* concatenate all diversions into diversion 0 */
+ d = get_divert_list(0); /* get diversion 0 */
+ return output_pages_list(d->first);
+}
diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfpage.c b/Build/source/texk/web2c/luatexdir/pdf/pdfpage.c
new file mode 100644
index 00000000000..783eabda742
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/pdf/pdfpage.c
@@ -0,0 +1,565 @@
+/* pdfpage.c
+
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: pdfpage.c 2046 2009-03-17 20:06:05Z hhenkel $ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+#include <math.h>
+
+#include "ptexlib.h"
+
+static const char __svn_version[] =
+ "$Id: pdfpage.c 2046 2009-03-17 20:06:05Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/pdf/pdfpage.c $";
+
+#define lround(a) (long) floor((a) + 0.5)
+#define setpdffloat(a,b,c) {(a).m = (b); (a).e = (c);}
+#define pdf2double(a) ((double) (a).m / exp10[(a).e])
+
+/* eternal constants */
+#define one_bp ((double) 65536 * (double) 72.27 / 72) /* number of sp per 1bp */
+#define e_tj 3 /* must be 3; movements in []TJ are in fontsize/10^3 units */
+
+/* definitions from luatex.web */
+#define pdf_font_blink(a) font_tables[a]->_pdf_font_blink
+
+pdfstructure *pstruct = NULL;
+
+static long *exp10 = NULL;
+
+/**********************************************************************/
+
+static pdfstructure *new_pdfstructure()
+{
+ return xmalloc(sizeof(pdfstructure));
+}
+
+static void calc_k1(pdfstructure * p)
+{
+ p->k1 = exp10[p->pdf.h.e] / one_bp;
+}
+
+static void calc_k2(pdfstructure * p)
+{
+ p->tm[0].m =
+ lround(pdf2double(p->hz) * pdf2double(p->ext) * exp10[p->tm[0].e]);
+ p->k2 =
+ exp10[e_tj +
+ p->cw.e] / (exp10[p->pdf.h.e] * pdf2double(p->fs) *
+ pdf2double(p->tm[0]));
+}
+
+void pdf_page_init()
+{
+ pdfstructure *p;
+ int i, decimal_digits = fixed_decimal_digits;
+ if (exp10 == NULL) {
+ exp10 = xmalloc(10 * sizeof(long));
+ exp10[0] = 1;
+ for (i = 1; i < 10; i++)
+ exp10[i] = 10 * exp10[i - 1];
+ }
+ if (pstruct == NULL)
+ pstruct = new_pdfstructure();
+ p = pstruct;
+ setpdffloat(p->pdf.h, 0, decimal_digits);
+ setpdffloat(p->pdf.v, 0, decimal_digits);
+ p->cw.e = 1;
+ p->fs.e = decimal_digits + 2; /* "+ 2" makes less corrections inside []TJ */
+ setpdffloat(p->hz, 1000, 3); /* m = 1000 = default = unexpanded, e must be 3 */
+ setpdffloat(p->ext, 1000, 3); /* m = 1000 = default = unextended, e must be 3 */
+ /* for placement outside BT...ET */
+ setpdffloat(p->cm[0], 1, 0);
+ setpdffloat(p->cm[1], 0, 0);
+ setpdffloat(p->cm[2], 0, 0);
+ setpdffloat(p->cm[3], 1, 0);
+ setpdffloat(p->cm[4], 0, decimal_digits); /* horizontal movement on page */
+ setpdffloat(p->cm[5], 0, decimal_digits); /* vertical movement on page */
+ /* for placement inside BT...ET */
+ setpdffloat(p->tm[0], exp10[6], 6); /* mantissa holds HZ expand * ExtendFont */
+ setpdffloat(p->tm[1], 0, 0);
+ setpdffloat(p->tm[2], 0, 3); /* mantissa holds SlantFont, 0 = default */
+ setpdffloat(p->tm[3], 1, 0);
+ setpdffloat(p->tm[4], 0, decimal_digits); /* mantissa holds delta from pdf_bt_pos.h */
+ setpdffloat(p->tm[5], 0, decimal_digits); /* mantissa holds delta from pdf_bt_pos.v */
+ /* */
+ p->f_cur = null_font;
+ p->f_pdf = null_font;
+ p->wmode = WMODE_H;
+ p->mode = PMODE_PAGE;
+ calc_k1(p);
+}
+
+/**********************************************************************/
+
+#ifdef SYNCH_POS_WITH_CUR
+/* some time this will be needed */
+synch_pos_with_cur(scaledpos * pos, scaledpos * cur, scaledpos * box_pos)
+{
+ switch (dvi_direction) {
+ case dir_TL_:
+ pos->h = box_pos->h + cur->h;
+ pos->v = box_pos->v - cur->v;
+ break;
+ case dir_TR_:
+ pos->h = box_pos->h - cur->h;
+ pos->v = box_pos->v - cur->v;
+ break;
+ case dir_BL_:
+ pos->h = box_pos->h + cur->h;
+ pos->v = box_pos->v + cur->v;
+ break;
+ case dir_BR_:
+ pos->h = box_pos->h - cur->h;
+ pos->v = box_pos->v + cur->v;
+ break;
+ case dir_LT_:
+ pos->h = box_pos->h + cur->v;
+ pos->v = box_pos->v - cur->h;
+ break;
+ case dir_RT_:
+ pos->h = box_pos->h - cur->v;
+ pos->v = box_pos->v - cur->h;
+ break;
+ case dir_LB_:
+ pos->h = box_pos->h + cur->v;
+ pos->v = box_pos->v + cur->h;
+ break;
+ case dir_RB_:
+ pos->h = box_pos->h - cur->v;
+ pos->v = box_pos->v + cur->h;
+ break;
+ default:;
+ }
+}
+#endif
+
+/**********************************************************************/
+
+boolean calc_pdfpos(pdfstructure * p, scaledpos * pos)
+{
+ scaledpos new;
+ int move_pdfpos = FALSE;
+ switch (p->mode) {
+ case PMODE_PAGE:
+ new.h = lround(pos->h * p->k1);
+ new.v = lround(pos->v * p->k1);
+ p->cm[4].m = new.h - p->pdf.h.m; /* cm is concatenated */
+ p->cm[5].m = new.v - p->pdf.v.m;
+ if (abs(p->cm[4].m) >= 1 || abs(p->cm[5].m) >= 1)
+ move_pdfpos = TRUE;
+ break;
+ case PMODE_TEXT:
+ new.h = lround(pos->h * p->k1);
+ new.v = lround(pos->v * p->k1);
+ p->tm[4].m = new.h - p->pdf_bt_pos.h.m; /* Tm replaces */
+ p->tm[5].m = new.v - p->pdf_bt_pos.v.m;
+ if (abs(p->tm[4].m) >= 1 || abs(p->tm[5].m) >= 1)
+ move_pdfpos = TRUE;
+ break;
+ case PMODE_CHAR:
+ case PMODE_CHARARRAY:
+ switch (p->wmode) {
+ case WMODE_H:
+ new.h = lround((pos->h * p->k1 - p->pdf_tj_pos.h.m) * p->k2);
+ new.v = lround(pos->v * p->k1);
+ p->tj_delta.m =
+ -lround((new.h - p->cw.m) / exp10[p->cw.e - p->tj_delta.e]);
+ p->tm[5].m = new.v - p->pdf.v.m; /* p->tm[4] is meaningless */
+ if (abs(p->tj_delta.m) >= 1 || abs(p->tm[5].m) >= 1)
+ move_pdfpos = TRUE;
+ break;
+ case WMODE_V:
+ new.h = lround(pos->h * p->k1);
+ new.v = lround((p->pdf_tj_pos.v.m - pos->v * p->k1) * p->k2);
+ p->tm[4].m = new.h - p->pdf.h.m; /* p->tm[5] is meaningless */
+ p->tj_delta.m =
+ -lround((new.v - p->cw.m) / exp10[p->cw.e - p->tj_delta.e]);
+ if (abs(p->tj_delta.m) >= 1 || abs(p->tm[4].m) >= 1)
+ move_pdfpos = TRUE;
+ break;
+ default:
+ assert(0);
+ }
+ break;
+ default:
+ assert(0);
+ }
+ return move_pdfpos;
+}
+
+/**********************************************************************/
+
+void print_pdffloat(pdffloat * f)
+{
+ char a[24];
+ int e = f->e, i, j;
+ long l, m = f->m;
+ if (m < 0) {
+ pdf_printf("-");
+ m *= -1;
+ }
+ l = m / exp10[e];
+ pdf_print_int(l);
+ l = m % exp10[e];
+ if (l != 0) {
+ pdf_printf(".");
+ j = snprintf(a, 23, "%ld", l + exp10[e]);
+ assert(j < 23);
+ for (i = e; i > 0; i--) {
+ if (a[i] != '0')
+ break;
+ a[i] = '\0';
+ }
+ pdf_printf("%s", a + 1);
+ }
+}
+
+static void print_pdf_matrix(pdffloat * tm)
+{
+ int i;
+ for (i = 0; i < 5; i++) {
+ print_pdffloat(tm + i);
+ pdf_printf(" ");
+ }
+ print_pdffloat(tm + i);
+}
+
+void pdf_print_cm(pdffloat * cm)
+{
+ print_pdf_matrix(cm);
+ pdf_printf(" cm\n");
+}
+
+static void pdf_print_tm(pdffloat * tm)
+{
+ print_pdf_matrix(tm);
+ pdf_printf(" Tm ");
+}
+
+static void set_pos(pdfstructure * p, scaledpos * pos)
+{
+ boolean move;
+ assert(is_pagemode(p));
+ move = calc_pdfpos(p, pos);
+ if (move == TRUE) {
+ pdf_print_cm(p->cm);
+ p->pdf.h.m += p->cm[4].m;
+ p->pdf.v.m += p->cm[5].m;
+ }
+}
+
+static void set_pos_temp(pdfstructure * p, scaledpos * pos)
+{
+ boolean move;
+ assert(is_pagemode(p));
+ move = calc_pdfpos(p, pos);
+ if (move == TRUE)
+ pdf_print_cm(p->cm);
+}
+
+void pdf_set_pos(scaled h, scaled v)
+{
+ scaledpos pos;
+ pos.h = h;
+ pos.v = v;
+ set_pos(pstruct, &pos);
+}
+
+void pdf_set_pos_temp(scaled h, scaled v)
+{
+ scaledpos pos;
+ pos.h = h;
+ pos.v = v;
+ set_pos_temp(pstruct, &pos);
+}
+
+/**********************************************************************/
+
+static long pdf_char_width(pdfstructure * p, internal_font_number f, int i)
+{
+ /* use exactly this formula also for calculating the /Width array values */
+ return
+ lround((double) char_width(f, i) / font_size(f) *
+ exp10[e_tj + p->cw.e]);
+}
+
+void pdf_print_charwidth(internal_font_number f, int i)
+{
+ pdffloat cw;
+ assert(pdf_font_blink(f) == null_font); /* must use unexpanded font! */
+ cw.m = pdf_char_width(pstruct, f, i);
+ cw.e = pstruct->cw.e;
+ print_pdffloat(&cw);
+}
+
+/**********************************************************************/
+
+static void begin_text(pdfstructure * p)
+{
+ assert(is_pagemode(p));
+ p->pdf_bt_pos = p->pdf;
+ pdf_printf("BT\n");
+ p->mode = PMODE_TEXT;
+}
+
+static void end_text(pdfstructure * p)
+{
+ assert(is_textmode(p));
+ pdf_printf("ET\n");
+ p->pdf = p->pdf_bt_pos;
+ p->mode = PMODE_PAGE;
+}
+
+static void begin_charmode(pdfstructure * p)
+{
+ assert(is_chararraymode(p));
+ pdf_printf("(");
+ p->mode = PMODE_CHAR;
+}
+
+static void end_charmode(pdfstructure * p)
+{
+ assert(is_charmode(p));
+ pdf_printf(")");
+ p->mode = PMODE_CHARARRAY;
+}
+
+static void begin_chararray(pdfstructure * p)
+{
+ assert(is_textmode(p));
+ p->pdf_tj_pos = p->pdf;
+ p->cw.m = 0;
+ pdf_printf("[");
+ p->mode = PMODE_CHARARRAY;
+}
+
+static void end_chararray(pdfstructure * p)
+{
+ assert(is_chararraymode(p));
+ pdf_printf("]TJ\n");
+ p->pdf = p->pdf_tj_pos;
+ p->mode = PMODE_TEXT;
+}
+
+void pdf_end_string_nl()
+{
+ if (is_charmode(pstruct))
+ end_charmode(pstruct);
+ if (is_chararraymode(pstruct))
+ end_chararray(pstruct);
+}
+
+/**********************************************************************/
+
+static void goto_pagemode(pdfstructure * p)
+{
+ if (!is_pagemode(p)) {
+ if (is_charmode(p))
+ end_charmode(p);
+ if (is_chararraymode(p))
+ end_chararray(p);
+ if (is_textmode(p))
+ end_text(p);
+ assert(is_pagemode(p));
+ }
+}
+
+void pdf_goto_pagemode()
+{
+ goto_pagemode(pstruct);
+}
+
+static void goto_textmode(pdfstructure * p)
+{
+ scaledpos origin = {
+ 0, 0
+ };
+ if (!is_textmode(p)) {
+ if (is_pagemode(p)) {
+ set_pos(p, &origin); /* reset to page origin */
+ begin_text(p);
+ } else {
+ if (is_charmode(p))
+ end_charmode(p);
+ if (is_chararraymode(p))
+ end_chararray(p);
+ }
+ assert(is_textmode(p));
+ }
+}
+
+void pos_finish(pdfstructure * p)
+{
+ goto_pagemode(p);
+}
+
+/**********************************************************************/
+
+static void place_rule(pdfstructure * p, scaledpos * pos, scaled wd, scaled ht)
+{
+ pdfpos dim;
+ scaledpos tmppos = *pos;
+ goto_pagemode(p);
+ dim.h.m = lround(wd * p->k1);
+ dim.h.e = p->pdf.h.e;
+ dim.v.m = lround(ht * p->k1);
+ dim.v.e = p->pdf.v.e;
+ pdf_printf("q\n");
+ if (ht <= one_bp) {
+ tmppos.v += lround(0.5 * ht);
+ set_pos_temp(p, &tmppos);
+ pdf_printf("[]0 d 0 J ");
+ print_pdffloat(&(dim.v));
+ pdf_printf(" w 0 0 m ");
+ print_pdffloat(&(dim.h));
+ pdf_printf(" 0 l S\n");
+ } else if (wd <= one_bp) {
+ tmppos.h += lround(0.5 * wd);
+ set_pos_temp(p, &tmppos);
+ pdf_printf("[]0 d 0 J ");
+ print_pdffloat(&(dim.h));
+ pdf_printf(" w 0 0 m 0 ");
+ print_pdffloat(&(dim.v));
+ pdf_printf(" l S\n");
+ } else {
+ set_pos_temp(p, &tmppos);
+ pdf_printf("0 0 ");
+ print_pdffloat(&(dim.h));
+ pdf_printf(" ");
+ print_pdffloat(&(dim.v));
+ pdf_printf(" re f\n");
+ }
+ pdf_printf("Q\n");
+}
+
+void pdf_place_rule(scaled h, scaled v, scaled wd, scaled ht)
+{
+ scaledpos pos;
+ pos.h = h;
+ pos.v = v;
+ place_rule(pstruct, &pos, wd, ht);
+}
+
+/**********************************************************************/
+
+static void setup_fontparameters(pdfstructure * p, internal_font_number f)
+{
+ p->f_cur = f;
+ p->f_pdf = pdf_set_font(f);
+ p->tj_delta.e = p->cw.e - 1; /* "- 1" makes less corrections inside []TJ */
+ /* no need to be more precise than TeX (1sp) */
+ while (p->tj_delta.e > 0
+ && (double) font_size(f) / exp10[p->tj_delta.e + e_tj] < 0.5)
+ p->tj_delta.e--; /* happens for very tiny fonts */
+ assert(p->cw.e >= p->tj_delta.e); /* else we would need, e. g., exp10[-1] */
+ p->fs.m = lround(font_size(f) / one_bp * exp10[p->fs.e]);
+ p->hz.m = pdf_font_expand_ratio(f) + exp10[p->hz.e];
+ calc_k2(p);
+}
+
+static void set_textmatrix(pdfstructure * p, scaledpos * pos)
+{
+ boolean move;
+ assert(is_textmode(p));
+ move = calc_pdfpos(p, pos);
+ if (move == TRUE) {
+ pdf_print_tm(p->tm);
+ p->pdf.h.m = p->pdf_bt_pos.h.m + p->tm[4].m; /* Tm replaces */
+ p->pdf.v.m = p->pdf_bt_pos.v.m + p->tm[5].m;
+ }
+}
+
+static void set_font(pdfstructure * p)
+{
+ pdf_printf("/F%d", p->f_pdf);
+ pdf_print_resname_prefix();
+ pdf_printf(" ");
+ print_pdffloat(&(p->fs));
+ pdf_printf(" Tf ");
+}
+
+/**********************************************************************/
+
+static void
+place_glyph(pdfstructure * p, scaledpos * pos, internal_font_number f,
+ integer c)
+{
+ int move;
+ if (f != p->f_cur || is_textmode(p) || is_pagemode(p)) {
+ goto_textmode(p);
+ if (f != p->f_cur)
+ setup_fontparameters(p, f);
+ set_font(p);
+ set_textmatrix(p, pos);
+ begin_chararray(p);
+ }
+ assert(is_charmode(p) || is_chararraymode(p));
+ move = calc_pdfpos(p, pos);
+ if (move == TRUE) {
+ if ((p->wmode == WMODE_H && abs(p->tm[5].m) >= 1)
+ || (p->wmode == WMODE_V && abs(p->tm[4].m) >= 1)
+ || abs(p->tj_delta.m) >= 1000000) {
+ goto_textmode(p);
+ set_textmatrix(p, pos);
+ begin_chararray(p);
+ move = calc_pdfpos(p, pos);
+ }
+ assert((p->wmode == WMODE_H && p->tm[5].m == 0)
+ || (p->wmode == WMODE_V && p->tm[4].m == 0));
+ if (move == TRUE) {
+ if (is_charmode(p))
+ end_charmode(p);
+ assert(abs(p->tj_delta.m) >= 1);
+ print_pdffloat(&(p->tj_delta));
+ p->cw.m -= p->tj_delta.m * exp10[p->cw.e - p->tj_delta.e];
+ }
+ }
+ if (is_chararraymode(p))
+ begin_charmode(p);
+ pdf_print_char(f, c); /* this also does pdf_mark_char() */
+ p->cw.m += pdf_char_width(p, p->f_pdf, c); /* aka adv_char_width() */
+}
+
+void pdf_place_glyph(internal_font_number f, integer c)
+{
+ if (char_exists(f, c))
+ place_glyph(pstruct, &pos, f, c);
+}
+
+/**********************************************************************/
+
+static void place_form(pdfstructure * p, scaledpos * pos, integer i)
+{
+ goto_pagemode(p);
+ pdf_printf("q\n");
+ set_pos_temp(p, pos);
+ pdf_printf("/Fm%d", i);
+ pdf_print_resname_prefix();
+ pdf_printf(" Do\nQ\n");
+}
+
+void pdf_place_form(scaled h, scaled v, integer i)
+{
+ scaledpos pos;
+ pos.h = h;
+ pos.v = v;
+ place_form(pstruct, &pos, i);
+}
diff --git a/Build/source/texk/web2c/luatexdir/pdftosrc.1 b/Build/source/texk/web2c/luatexdir/pdftosrc.1
deleted file mode 100644
index 3ee4b680d6f..00000000000
--- a/Build/source/texk/web2c/luatexdir/pdftosrc.1
+++ /dev/null
@@ -1,219 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii pdftosrc.1
-.\"
-.\" $Id$
-.\"
-.TH pdftosrc 1 "3 November 2005" "User Manuals"
-.SH NAME
-pdftosrc \- extract source file or stream from PDF file
-.SH SYNOPSIS
-.B pdftosrc
-.I PDF-file
-.R [
-.I stream-object-number
-.R ]
-.SH DESCRIPTION
-If only
-.I PDF-file
-is given as argument,
-.B pdftosrc
-extracts the embedded source file
-from the first found stream object
-with /Type /SourceFile within the
-.I PDF-file
-and writes it to a file with the name /SourceName
-as defined in that PDF stream object
-(see application example below).
-
-If both
-.I PDF-file
-and
-.I stream-object-number
-are given as arguments,
-.B pdftosrc
-extracts and uncompresses the PDF stream of the object
-given by its
-.I stream-object-number
-from the
-.I PDF-file
-and writes it to a file named
-.IR PDF-file . stream-object-number
-with the ending
-.I .pdf
-or
-.I .PDF
-stripped from the original
-.I PDF-file
-name.
-
-In either case
-an existing file with the output file name will be overwritten.
-.SH OPTIONS
-None.
-.SH FILES
-Just the executable
-.BR pdftosrc .
-.SH ENVIRONMENT
-None.
-.SH DIAGNOSTICS
-At success the exit code of
-.B pdftosrc
-is 0, else 1.
-
-All messages go to stderr.
-At program invocation,
-.B pdftosrc
-issues the current version number of the program
-.BR xpdf ,
-on which
-.B pdftosrc
-is based:
-
-.RS
-pdftosrc version 3.00
-
-.RE
-When
-.B pdftosrc
-was successful with the output file writing,
-one of the following messages will be issued:
-
-.RS
-Source file extracted to
-.I source-file-name
-
-.RE
-or
-
-.RS
-Stream object extracted to
-.IR PDF-file . stream-object-number
-
-.RE
-
-.RE
-When the object given by the
-.I stream-object-number
-does not contain a stream,
-.B pdftosrc
-issues the following error message:
-
-.RS
-Not a Stream object
-
-.RE
-When the
-.I PDF-file
-can't be opened, the error message is:
-
-.RS
-Error: Couldn't open file
-.RI ' PDF-file '.
-
-.RE
-When
-.B pdftosrc
-encounters an invalid PDF file,
-the error message (several lines) is:
-
-.RS
-Error: May not be a PDF file (continuing anyway)
-.RE
-.RS
-(more lines)
-.RE
-.RS
-Invalid PDF file
-
-.RE
-There are also more error messages from
-.B pdftosrc
-for various kinds of broken PDF files.
-.SH NOTES
-An embedded source file will be written out unchanged,
-i. e. it will not be uncompressed in this process.
-
-Only the stream of the object will be written,
-i. e. not the dictionary of that object.
-
-Knowing which
-.I stream-object-number
-to query requires information about the PDF file
-that has to be gained elsewhere,
-e. g. by looking into the PDF file with an editor.
-
-The stream extraction capabilities of
-.B pdftosrc
-(e. g. regarding understood PDF versions and filter types)
-follow the capabilities of the underlying
-.B xpdf
-program version.
-
-Currently the generation number of the stream object
-is not supported.
-The default value 0 (zero) is taken.
-
-The wording
-.I stream-object-number
-has nothing to do with the `object streams' introduced
-by the Adobe PDF Reference,
-5th edition, version 1.6.
-.SH EXAMPLES
-When using pdftex or pdfetex,
-a source file can be embedded into some
-.I PDF-file
-by using pdftex primitives,
-as illustrated by the following example:
-
-\\immediate\\pdfobj
-.RE
- stream attr {/Type /SourceFile /SourceName (myfile.zip)}
-.RS
-.RE
- file{myfile.zip}
-.RS
-.RE
-\\pdfcatalog{/SourceObject \\the\\pdflastobj\\space 0 R}
-
-Then this zip file can be extracted from the
-.I PDF-file
-by calling
-.B pdftosrc
-.IR PDF-file .
-.SH BUGS
-Not all embedded source files will be extracted,
-only the first found one.
-
-Email bug reports to
-.B pdftex@tug.org.
-.SH SEE ALSO
-.BR xpdf (1),
-.BR pdfimages (1),
-.BR pdftotext (1),
-.BR pdftex (1),
-.BR pdfetex (1).
-.SH AUTHORS
-.B pdftosrc
-written by Han The Thanh, using
-.B xpdf
-functionality from Derek Noonburg.
-
-Man page written by Hartmut Henkel.
-.SH COPYRIGHT
-Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
-
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
diff --git a/Build/source/texk/web2c/luatexdir/pdftosrc.cc b/Build/source/texk/web2c/luatexdir/pdftosrc.cc
deleted file mode 100644
index 64f1a3174bc..00000000000
--- a/Build/source/texk/web2c/luatexdir/pdftosrc.cc
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
-
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id$
-*/
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <aconf.h>
-#include <assert.h>
-#include <GString.h>
-#include <gmem.h>
-#include <gfile.h>
-#include "Object.h"
-#include "Stream.h"
-#include "Array.h"
-#include "Dict.h"
-#include "XRef.h"
-#include "Catalog.h"
-#include "Page.h"
-#include "GfxFont.h"
-#include "PDFDoc.h"
-#include "GlobalParams.h"
-#include "Error.h"
-
-static XRef *xref = 0;
-
-int main(int argc, char *argv[])
-{
- char *p, buf[1024];
- PDFDoc *doc;
- GString *fileName;
- Stream *s;
- Object srcStream, srcName, catalogDict;
- FILE *outfile;
- char *outname;
- int objnum = 0, objgen = 0;
- bool extract_xref_table = false;
- int c;
- fprintf(stderr, "pdftosrc version %s\n", xpdfVersion);
- if (argc < 2) {
- fprintf(stderr,
- "Usage: pdftosrc <PDF-file> [<stream-object-number>]\n");
- exit(1);
- }
- fileName = new GString(argv[1]);
- globalParams = new GlobalParams();
- doc = new PDFDoc(fileName);
- if (!doc->isOk()) {
- fprintf(stderr, "Invalid PDF file\n");
- exit(1);
- }
- if (argc >= 3) {
- objnum = atoi(argv[2]);
- if (argc >= 4)
- objgen = atoi(argv[3]);
- }
- xref = doc->getXRef();
- catalogDict.initNull();
- xref->getCatalog(&catalogDict);
- if (!catalogDict.isDict("Catalog")) {
- fprintf(stderr, "No Catalog found\n");
- exit(1);
- }
- srcStream.initNull();
- if (objnum == 0) {
- catalogDict.dictLookup("SourceObject", &srcStream);
- if (!srcStream.isStream("SourceFile")) {
- fprintf(stderr, "No SourceObject found\n");
- exit(1);
- }
- srcName.initNull();
- srcStream.getStream()->getDict()->lookup("SourceName", &srcName);
- if (!srcName.isString()) {
- fprintf(stderr, "No SourceName found\n");
- exit(1);
- }
- outname = srcName.getString()->getCString();
- // We cannot free srcName, as objname shares its string.
- // srcName.free();
- } else if (objnum > 0) {
- xref->fetch(objnum, objgen, &srcStream);
- if (!srcStream.isStream()) {
- fprintf(stderr, "Not a Stream object\n");
- exit(1);
- }
- sprintf(buf, "%s", fileName->getCString());
- if ((p = strrchr(buf, '.')) == 0)
- p = strchr(buf, 0);
- if (objgen == 0)
- sprintf(p, ".%i", objnum);
- else
- sprintf(p, ".%i+%i", objnum, objgen);
- outname = buf;
- } else { // objnum < 0 means we are extracting the XRef table
- extract_xref_table = true;
- sprintf(buf, "%s", fileName->getCString());
- if ((p = strrchr(buf, '.')) == 0)
- p = strchr(buf, 0);
- sprintf(p, ".xref");
- outname = buf;
- }
- if (!(outfile = fopen(outname, "wb"))) {
- fprintf(stderr, "Cannot open file \"%s\" for writing\n", outname);
- exit(1);
- }
- if (extract_xref_table) {
- int size = xref->getSize();
- int i;
- for (i = 0; i < size; i++) {
- if (xref->getEntry(i)->offset == 0xffffffff)
- break;
- }
- size = i;
- fprintf(outfile, "xref\n");
- fprintf(outfile, "0 %i\n", size);
- for (i = 0; i < size; i++) {
- XRefEntry *e = xref->getEntry(i);
- if (e->type != xrefEntryCompressed)
- fprintf(outfile, "%.10lu %.5i %s\n",
- (long unsigned) e->offset, e->gen,
- (e->type == xrefEntryFree ? "f" : "n"));
- else { // e->offset is the object number of the object stream
- // e->gen is the local index inside that object stream
- //int objStrOffset = xref->getEntry(e->offset)->offset;
- Object tmpObj;
-
- xref->fetch(i, e->gen, &tmpObj); // to ensure xref->objStr is set
- ObjectStream *objStr = xref->getObjStr();
- assert(objStr != NULL);
- int *localOffsets = objStr->getOffsets();
- assert(localOffsets != NULL);
-// fprintf(outfile, "%0.10lu %i n\n",
-// (long unsigned) (objStrOffset), e->gen);
- fprintf(outfile, "%.10lu 00000 n\n",
- (long unsigned) (objStr->getFirstOffset() +
- localOffsets[e->gen]));
-// (long unsigned) (objStrOffset + objStr->getStart() + localOffsets[e->gen]));
- tmpObj.free();
- }
- }
- } else {
- s = srcStream.getStream();
- s->reset();
- while ((c = s->getChar()) != EOF)
- fputc(c, outfile);
- srcStream.free();
- }
- if (objnum == 0)
- fprintf(stderr, "Source file extracted to %s\n", outname);
- else if (objnum > 0)
- fprintf(stderr, "Stream object extracted to %s\n", outname);
- else
- fprintf(stderr, "Cross-reference table extracted to %s\n", outname);
- fclose(outfile);
- catalogDict.free();
- delete doc;
- delete globalParams;
-}
diff --git a/Build/source/texk/web2c/luatexdir/pdftosrc.rc b/Build/source/texk/web2c/luatexdir/pdftosrc.rc
deleted file mode 100644
index 6929fbade24..00000000000
--- a/Build/source/texk/web2c/luatexdir/pdftosrc.rc
+++ /dev/null
@@ -1,35 +0,0 @@
-/* pdftosrc.rc: pdftosrc resources -*- C++ -*-
-
- Copyright (C) 1996-2003 Fabrice Popineau <fabrice.popineau@supelec.fr>
-
- This file is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- This file is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this file; if not, write to the Free Software
- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#include <texlive-version.h>
-
-#define VER_FILEVERSION TEXLIVE_MAJOR_VERSION,TEXLIVE_MINOR_VERSION,TEXLIVE_BETA_NUMBER,TEXLIVE_ALPHA_NUMBER
-#define VER_FILEVERSION_STR TEXLIVE_PRODUCTVERSION_STR " pdftosrc 2.01"
-
-#define VER_INTERNALNAME_STR "pdftosrc"
-#define VER_ORIGINALFILENAME_STR "pdftosrc.exe"
-
-#define VER_FILEDESCRIPTION_STR "PDF Source Extractor"
-
-#define VER_COMPANYNAME_STR ""
-#define VER_LEGALCOPYRIGHT_STR ""
-
-#include <texlive.version>
-
-/* pdftosrc.rc ends here */
diff --git a/Build/source/texk/web2c/luatexdir/primitive.h b/Build/source/texk/web2c/luatexdir/primitive.h
new file mode 100644
index 00000000000..b3d202a8e59
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/primitive.h
@@ -0,0 +1,82 @@
+/* primitive.h
+
+ Copyright 2008-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: primitive.h 2086 2009-03-22 15:32:08Z oneiros $ */
+
+#ifndef LUATEX_PRIMITIVE_H
+# define LUATEX_PRIMITIVE_H 1
+
+/* This enum is a list of origins for primitive commands */
+
+typedef enum {
+ tex_command = 1,
+ etex_command = 2,
+ aleph_command = 4,
+ omega_command = 8,
+ pdftex_command = 16,
+ luatex_command = 32,
+ core_command = 64,
+} command_origin;
+
+# define eq_level(a) zeqtb[a].hh.u.B1
+# define eq_type(a) zeqtb[a].hh.u.B0
+# define equiv(a) zeqtb[a].hh.v.RH
+
+# define undefined_primitive 0
+# define prim_size 2100 /* maximum number of primitives */
+# define prim_prime 1777 /* about 85\pct! of |primitive_size| */
+
+# define hash_prime 55711 /* a prime number equal to about 85\pct! of |hash_size| */
+# define hash_base 2
+
+extern void init_primitives(void);
+extern void ini_init_primitives(void);
+
+extern halfword compute_pool_hash(pool_pointer j, pool_pointer l,
+ halfword prime_number);
+extern pointer prim_lookup(str_number s);
+
+extern boolean is_primitive(str_number csname);
+
+extern quarterword get_prim_eq_type(integer p);
+extern halfword get_prim_equiv(integer p);
+extern str_number get_prim_text(integer p);
+extern quarterword get_prim_origin(integer p);
+
+extern void dump_primitives(void);
+extern void undump_primitives(void);
+
+# define primitive_tex(a,b,c,d) primitive((a),(b),(c),(d),tex_command)
+# define primitive_etex(a,b,c,d) primitive((a),(b),(c),(d),etex_command)
+# define primitive_aleph(a,b,c,d) primitive((a),(b),(c),(d),aleph_command)
+# define primitive_omega(a,b,c,d) primitive((a),(b),(c),(d),omega_command)
+# define primitive_pdftex(a,b,c,d) primitive((a),(b),(c),(d),pdftex_command)
+# define primitive_luatex(a,b,c,d) primitive((a),(b),(c),(d),luatex_command)
+# define primitive_core(a,b,c,d) primitive((a),(b),(c),(d),core_command)
+
+extern void primitive(str_number ss, quarterword c, halfword o, halfword off,
+ int cmd_origin);
+extern void primitive_def(char *s, size_t l, quarterword c, halfword o);
+extern void print_cmd_chr(quarterword cmd, halfword chr_code);
+
+extern pointer string_lookup(char *s, size_t l);
+extern pointer id_lookup(integer j, integer l);
+
+
+#endif /* LUATEX_PRIMITIVE_H */
diff --git a/Build/source/texk/web2c/luatexdir/ptexlib.h b/Build/source/texk/web2c/luatexdir/ptexlib.h
index aad25eb4ab2..90b16589ed0 100644
--- a/Build/source/texk/web2c/luatexdir/ptexlib.h
+++ b/Build/source/texk/web2c/luatexdir/ptexlib.h
@@ -1,28 +1,30 @@
-/*
- Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* ptexlib.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
-This file is part of luatex.
+ This file is part of LuaTeX.
-luatex is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-luatex is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with luatex; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-$Id$
-*/
+/* $Id$ */
#ifndef LUATEXLIB
# define LUATEXLIB
+#define SVN_REV "unknown" /* temp hack */
+
/* WEB2C macros and prototypes */
# if !defined(LUATEXCOERCE)
# ifdef luatex
@@ -32,14 +34,69 @@ $Id$
# include "luatexd.h"
# endif
+# ifdef MSVC
+extern double rint(double x);
+# endif
+
/* pdftexlib macros */
# include "ptexmac.h"
-# include "avlstuff.h"
+/* synctex */
+# include "utils/synctex.h"
+
+# include "utils/avlstuff.h"
# include "image/image.h"
# include "openbsd-compat.h"
+/***********************************************************************/
+/* from pdfpage.c */
+
+typedef struct {
+ long m; /* mantissa (significand) */
+ int e; /* exponent * -1 */
+} pdffloat;
+
+typedef struct {
+ pdffloat h;
+ pdffloat v;
+} pdfpos;
+
+typedef enum { PMODE_NONE, PMODE_PAGE, PMODE_TEXT, PMODE_CHARARRAY,
+ PMODE_CHAR
+} pos_mode;
+
+typedef enum { WMODE_H, WMODE_V } writing_mode; /* []TJ runs horizontal or vertical */
+
+# define is_pagemode(p) ((p)->mode == PMODE_PAGE)
+# define is_textmode(p) ((p)->mode == PMODE_TEXT)
+# define is_chararraymode(p) ((p)->mode == PMODE_CHARARRAY)
+# define is_charmode(p) ((p)->mode == PMODE_CHAR)
+
+# define setpdffloat(a,b,c) {(a).m = (b); (a).e = (c);}
+
+typedef struct {
+ pdfpos pdf; /* pos. on page (PDF page raster) */
+ pdfpos pdf_bt_pos; /* pos. at begin of BT-ET group (PDF page raster) */
+ pdfpos pdf_tj_pos; /* pos. at begin of TJ array (PDF page raster) */
+ pdffloat cw; /* pos. within [(..)..]TJ array (glyph raster);
+ cw.e = fractional digits in /Widths array */
+ pdffloat tj_delta; /* rel. movement in [(..)..]TJ array (glyph raster) */
+ pdffloat fs; /* font size in PDF units */
+ pdffloat hz; /* HZ expansion factor */
+ pdffloat ext; /* ExtendFont factor */
+ pdffloat cm[6]; /* cm array */
+ pdffloat tm[6]; /* Tm array */
+ double k1; /* conv. factor from TeX sp to PDF page raster */
+ double k2; /* conv. factor from PDF page raster to TJ array raster */
+ internal_font_number f_cur; /* TeX font number */
+ internal_font_number f_pdf; /* /F* font number, of unexpanded base font! */
+ writing_mode wmode; /* PDF writing mode WMode (horizontal/vertical) */
+ pos_mode mode; /* current positioning mode */
+} pdfstructure;
+
+/***********************************************************************/
+
/* pdftexlib type declarations */
typedef struct {
const char *pdfname;
@@ -75,6 +132,11 @@ typedef struct {
char *unicode_seq; /* multiple unicode sequence */
} glyph_unicode_entry;
+# define FD_FLAGS_NOT_SET_IN_MAPLINE -1
+# define FD_FLAGS_DEFAULT_EMBED 4 /* a symbol font */
+# define FD_FLAGS_DEFAULT_NON_EMBED 0x22
+ /* a nonsymbolic serif font */
+
typedef struct {
/* parameters scanned from the map file: */
char *tfm_name; /* TFM file name (1st field in map line) */
@@ -95,11 +157,10 @@ typedef struct {
} fm_entry;
typedef struct glw_entry_ { /* subset glyphs for inclusion in CID-based fonts */
- unsigned short id; /* glyph CID */
- unsigned short wd; /* glyph width in 1/1000 em parts */
+ unsigned int id; /* glyph CID */
+ signed int wd; /* glyph width in 1/1000 em parts */
} glw_entry;
-
/**********************************************************************/
typedef struct {
@@ -164,6 +225,16 @@ extern size_t last_ptr_index;
int loadpoolstrings(integer spare_size);
+/* filename.c */
+extern void scan_file_name(void);
+extern void pack_job_name(char *s);
+extern void prompt_file_name(char *s, char *e);
+extern str_number make_name_string(void);
+extern void print_file_name(str_number, str_number, str_number);
+
+/* A hack to counter fixwrites */
+# define do_write_wterm(a) fprintf(stdout, "%s", a)
+
/* pdftexlib function prototypes */
/* epdf.c */
@@ -183,6 +254,7 @@ extern void pdf_init_map_file(string map_name);
extern fm_entry *new_fm_entry(void);
extern void delete_fm_entry(fm_entry *);
extern int avl_do_entry(fm_entry *, int);
+extern int check_std_t1font(char *s);
/* papersiz.c */
extern integer myatodim(char **);
@@ -201,9 +273,8 @@ extern void def_tounicode(strnumber, strnumber);
extern integer write_tounicode(char **, char *);
/* utils.c */
-extern boolean str_eq_cstr(strnumber, char *);
extern char *makecstring(integer);
-extern char *makeclstring(integer, int *);
+extern char *makeclstring(integer, size_t *);
extern void print_string(char *j);
extern void append_string(char *s);
extern void getcreationdate(void);
@@ -211,6 +282,7 @@ extern void tconfusion(char *s);
extern void tprint(char *s);
extern void tprint_nl(char *s);
extern void tprint_esc(char *s);
+extern char *stripzeros(char *);
# define overflow_string(a,b) { overflow(maketexstring(a),b); flush_str(last_tex_string); }
@@ -239,7 +311,7 @@ extern void pdftex_warn(const char *, ...);
extern void set_job_id(int, int, int, int);
__attribute__ ((format(printf, 1, 2)))
extern void tex_printf(const char *, ...);
-extern void write_stream_length(integer, integer);
+extern void write_stream_length(integer, longinteger);
extern char *convertStringToPDFString(const char *in, int len);
extern void print_ID(strnumber);
extern void print_creation_date();
@@ -260,11 +332,11 @@ extern integer colorstackpush(int colstack_no, integer s);
extern integer colorstackpop(int colstack_no);
extern integer colorstackcurrent(int colstack_no);
extern integer colorstackskippagestart(int colstack_no);
-extern void checkpdfsave(int cur_h, int cur_v);
-extern void checkpdfrestore(int cur_h, int cur_v);
+extern void checkpdfsave(scaledpos pos);
+extern void checkpdfrestore(scaledpos pos);
extern void pdfshipoutbegin(boolean shipping_page);
extern void pdfshipoutend(boolean shipping_page);
-extern void pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v);
+extern void pdfsetmatrix(poolpointer in, scaledpos pos);
extern void matrixtransformpoint(scaled x, scaled y);
extern void matrixtransformrect(scaled llx, scaled lly, scaled urx, scaled ury);
extern boolean matrixused();
@@ -274,6 +346,24 @@ extern scaled getlly();
extern scaled geturx();
extern scaled getury();
+/* pdf/pdfpage.c */
+void pdf_place_rule(scaled h, scaled v, scaled wd, scaled ht);
+void pdf_place_glyph(internal_font_number f, integer c);
+void pdf_place_form(scaled h, scaled v, integer i);
+void pdf_goto_pagemode();
+void pdf_page_init();
+void pdf_set_pos(scaled h, scaled v);
+void pdf_end_string_nl();
+void pdf_print_charwidth(internal_font_number f, int i);
+boolean calc_pdfpos(pdfstructure * p, scaledpos * pos);
+void print_pdffloat(pdffloat * f);
+void pdf_print_cm(pdffloat * cm);
+
+/* pdf/pagetree.c */
+extern integer pdf_do_page_divert(integer, integer);
+extern void pdf_do_page_undivert(integer, integer);
+extern integer output_pages_tree();
+
/* writeenc.c */
extern fe_entry *get_fe_entry(char *);
extern void enc_free(void);
@@ -290,8 +380,7 @@ extern boolean check_image_b(integer);
extern boolean check_image_c(integer);
extern boolean check_image_i(integer);
extern boolean is_pdf_image(integer);
-extern integer epdforigx(integer);
-extern integer epdforigy(integer);
+extern boolean is_png_image(integer);
extern integer image_pages(integer);
extern integer image_index(integer);
extern integer image_width(integer);
@@ -306,10 +395,14 @@ extern void img_free(void);
extern void update_image_procset(integer);
extern void write_image(integer);
extern integer image_colordepth(integer img);
+extern integer image_groupref(integer img);
extern void scale_image(integer);
extern void set_image_dimensions(integer, integer, integer, integer);
extern void set_image_index(integer, integer);
extern void out_image(integer, scaled, scaled);
+extern void dumpimagemeta(void);
+extern void undumpimagemeta(integer, integer);
+extern void pdf_print_resname_prefix(void);
/* writejbig2.c */
extern void flush_jbig2_page0_objects();
@@ -373,6 +466,8 @@ typedef enum {
typedef struct _lang_variables {
int pre_hyphen_char;
int post_hyphen_char;
+ int pre_exhyphen_char;
+ int post_exhyphen_char;
} lang_variables;
@@ -384,11 +479,13 @@ struct tex_language {
int id;
int pre_hyphen_char;
int post_hyphen_char;
+ int pre_exhyphen_char;
+ int post_exhyphen_char;
};
# define MAX_WORD_LEN 256 /* in chars */
-extern struct tex_language *new_language(void);
+extern struct tex_language *new_language(int n);
extern struct tex_language *get_language(int n);
extern void load_patterns(struct tex_language *lang, unsigned char *buf);
extern void load_hyphenation(struct tex_language *lang, unsigned char *buf);
@@ -405,29 +502,35 @@ extern void set_post_hyphen_char(integer lan, integer val);
extern integer get_pre_hyphen_char(integer lan);
extern integer get_post_hyphen_char(integer lan);
+extern void set_pre_exhyphen_char(integer lan, integer val);
+extern void set_post_exhyphen_char(integer lan, integer val);
+extern integer get_pre_exhyphen_char(integer lan);
+extern integer get_post_exhyphen_char(integer lan);
+extern halfword compound_word_break(halfword t, int clang);
+
extern halfword new_ligkern(halfword head, halfword tail);
extern halfword handle_ligaturing(halfword head, halfword tail);
extern halfword handle_kerning(halfword head, halfword tail);
-# define push_dir(a) \
- { dir_tmp=new_dir((a)); \
- vlink(dir_tmp)=dir_ptr; dir_ptr=dir_tmp; \
- dir_ptr=dir_tmp; \
+# define push_dir(a) \
+ { dir_tmp=new_dir((a)); \
+ vlink(dir_tmp)=dir_ptr; dir_ptr=dir_tmp; \
+ dir_ptr=dir_tmp; \
}
-# define push_dir_node(a) \
- { dir_tmp=new_node(whatsit_node,dir_node); \
- dir_dir(dir_tmp)=dir_dir((a)); \
- dir_level(dir_tmp)=dir_level((a)); \
- dir_dvi_h(dir_tmp)=dir_dvi_h((a)); \
- dir_dvi_ptr(dir_tmp)=dir_dvi_ptr((a)); \
- vlink(dir_tmp)=dir_ptr; dir_ptr=dir_tmp; \
+# define push_dir_node(a) \
+ { dir_tmp=new_node(whatsit_node,dir_node); \
+ dir_dir(dir_tmp)=dir_dir((a)); \
+ dir_level(dir_tmp)=dir_level((a)); \
+ dir_dvi_h(dir_tmp)=dir_dvi_h((a)); \
+ dir_dvi_ptr(dir_tmp)=dir_dvi_ptr((a)); \
+ vlink(dir_tmp)=dir_ptr; dir_ptr=dir_tmp; \
}
-# define pop_dir_node() \
- { dir_tmp=dir_ptr; \
- dir_ptr=vlink(dir_tmp); \
- flush_node(dir_tmp); \
+# define pop_dir_node() \
+ { dir_tmp=dir_ptr; \
+ dir_ptr=vlink(dir_tmp); \
+ flush_node(dir_tmp); \
}
@@ -475,7 +578,8 @@ void ext_do_line_break(boolean d,
halfword widow_penalties_ptr,
int display_widow_penalty,
int widow_penalty,
- int broken_penalty, halfword final_par_glue);
+ int broken_penalty, halfword final_par_glue,
+ halfword pdf_ignored_dimen);
void ext_post_line_break(boolean d,
int right_skip,
@@ -502,7 +606,8 @@ void ext_post_line_break(boolean d,
scaled second_width,
scaled second_indent,
scaled first_width,
- scaled first_indent, halfword best_line);
+ scaled first_indent, halfword best_line,
+ halfword pdf_ignored_dimen);
halfword lua_hpack_filter(halfword head_node, scaled size, int pack_type,
int extrainfo);
@@ -510,8 +615,9 @@ void lua_node_filter(int filterid, int extrainfo, halfword head_node,
halfword * tail_node);
halfword lua_vpack_filter(halfword head_node, scaled size, int pack_type,
scaled maxd, int extrainfo);
-void lua_node_filter_s(int filterid, char *extrainfo, halfword head_node,
- halfword * tail_node);
+void lua_node_filter_s(int filterid, char *extrainfo);
+int lua_linebreak_callback(int is_broken, halfword head_node,
+ halfword * new_head);
void load_tex_patterns(int curlang, halfword head);
void load_tex_hyphenation(int curlang, halfword head);
@@ -527,18 +633,61 @@ void set_cat_code(integer h, integer n, halfword v, quarterword gl);
halfword get_cat_code(integer h, integer n);
void unsave_cat_codes(integer h, quarterword gl);
int valid_catcode_table(int h);
+void initex_cat_codes(int h);
void unsave_text_codes(quarterword grouplevel);
void initialize_text_codes(void);
void dump_text_codes(void);
void undump_text_codes(void);
+void copy_cat_codes(int from, int to);
+void free_math_codes(void);
+void free_text_codes(void);
/* mathcodes.c */
-void set_math_code(integer n, halfword v, quarterword gl);
-halfword get_math_code(integer n);
-void set_del_code(integer n, halfword v, halfword w, quarterword gl);
-halfword get_del_code_a(integer n);
-halfword get_del_code_b(integer n);
+# define no_mathcode 0 /* this is a flag for |scan_delimiter| */
+# define tex_mathcode 8
+# define aleph_mathcode 16
+# define xetex_mathcode 21
+# define xetexnum_mathcode 22
+
+typedef struct mathcodeval {
+ integer class_value;
+ integer origin_value;
+ integer family_value;
+ integer character_value;
+} mathcodeval;
+
+void set_math_code(integer n,
+ integer commandorigin,
+ integer mathclass,
+ integer mathfamily, integer mathcharacter, quarterword gl);
+
+mathcodeval get_math_code(integer n);
+integer get_math_code_num(integer n);
+mathcodeval scan_mathchar(int extcode);
+mathcodeval scan_delimiter_as_mathchar(int extcode);
+
+mathcodeval mathchar_from_integer(integer value, int extcode);
+void show_mathcode_value(mathcodeval d);
+
+
+typedef struct delcodeval {
+ integer class_value;
+ integer origin_value;
+ integer small_family_value;
+ integer small_character_value;
+ integer large_family_value;
+ integer large_character_value;
+} delcodeval;
+
+void set_del_code(integer n,
+ integer commandorigin,
+ integer smathfamily,
+ integer smathcharacter,
+ integer lmathfamily, integer lmathcharacter, quarterword gl);
+
+delcodeval get_del_code(integer n);
+
void unsave_math_codes(quarterword grouplevel);
void initialize_math_codes(void);
void dump_math_codes(void);
@@ -558,13 +707,10 @@ void undump_luac_registers(void);
/* ltexlib.c */
void luacstring_start(int n);
void luacstring_close(int n);
-int luacstring_detokenized(void);
-int luacstring_defaultcattable(void);
integer luacstring_cattable(void);
-int luacstring_simple(void);
-int luacstring_penultimate(void);
int luacstring_input(void);
-
+int luacstring_partial(void);
+int luacstring_final_line(void);
/* luatoken.c */
void do_get_token_lua(integer callback_id);
@@ -574,11 +720,13 @@ int visible_last_node_type(int n);
void print_node_mem_stats(int n, int o);
/* writeimg.c */
+integer epdf_xsize(integer i);
+integer epdf_ysize(integer i);
integer epdf_orig_y(integer i);
integer epdf_orig_x(integer i);
/* limglib.c */
-void lua_setximage(integer i);
+void vf_out_image(unsigned i);
/* vfovf.c */
void vf_expand_local_fonts(internal_font_number f);
@@ -587,29 +735,114 @@ internal_font_number letter_space_font(halfword u, internal_font_number f,
internal_font_number auto_expand_font(internal_font_number f, integer e);
str_number expand_font_name(internal_font_number f, integer e);
void pdf_check_vf_cur_val(void);
+internal_font_number copy_font_info(internal_font_number f);
/* ltexiolib.c */
void flush_loggable_info(void);
/* luastuff.c */
-void closelua(int n);
-void luacall(int n, int s);
-void luatokencall(int n, int p);
+void luacall(int s, int nameptr);
+void luatokencall(int p, int nameptr);
void tex_error(char *msg, char **hlp);
scaled divide_scaled(scaled s, scaled m, integer dd);
scaled divide_scaled_n(double s, double m, double d);
+/* mlist.c */
+void run_mlist_to_hlist(pointer p, integer m_style, boolean penalties);
+void fixup_math_parameters(integer fam_id, integer size_id, integer f,
+ integer lvl);
+
/* texpdf.c */
void pdf_print_char(internal_font_number f, integer c);
void pdf_print(str_number n);
void pdf_print_str(str_number n);
-void pdf_print_int(integer n);
+void pdf_print_int(longinteger n);
+void pdf_print_real(integer m, integer d);
/* textoken.c */
+# define NO_CAT_TABLE -2
+# define DEFAULT_CAT_TABLE -1
+
+extern boolean str_eq_cstr(str_number, char *, size_t);
void get_next(void);
+extern void check_outer_validity(void);
+boolean scan_keyword(char *);
+void scan_direction(void);
+halfword active_to_cs(int, int);
void get_token_lua(void);
+int get_char_cat_code(int);
+
+/* texdeffont.c */
+
+void tex_def_font(small_number a);
+
+/* lcallbacklib.c */
+
+# include <../lua51/lua.h>
+
+
+typedef enum {
+ find_write_file_callback = 1,
+ find_output_file_callback,
+ find_image_file_callback,
+ find_format_file_callback,
+ find_read_file_callback, open_read_file_callback,
+ find_ocp_file_callback, read_ocp_file_callback,
+ find_vf_file_callback, read_vf_file_callback,
+ find_data_file_callback, read_data_file_callback,
+ find_font_file_callback, read_font_file_callback,
+ find_map_file_callback, read_map_file_callback,
+ find_enc_file_callback, read_enc_file_callback,
+ find_type1_file_callback, read_type1_file_callback,
+ find_truetype_file_callback, read_truetype_file_callback,
+ find_opentype_file_callback, read_opentype_file_callback,
+ find_sfd_file_callback, read_sfd_file_callback,
+ find_pk_file_callback, read_pk_file_callback,
+ show_error_hook_callback,
+ process_input_buffer_callback,
+ start_page_number_callback, stop_page_number_callback,
+ start_run_callback, stop_run_callback,
+ define_font_callback,
+ token_filter_callback,
+ pre_output_filter_callback,
+ buildpage_filter_callback,
+ hpack_filter_callback, vpack_filter_callback,
+ char_exists_callback,
+ hyphenate_callback,
+ ligaturing_callback,
+ kerning_callback,
+ pre_linebreak_filter_callback,
+ linebreak_filter_callback,
+ post_linebreak_filter_callback,
+ mlist_to_hlist_callback,
+ total_callbacks
+} callback_callback_types;
+
+extern int callback_set[];
+extern int lua_active;
+
+# define callback_defined(a) callback_set[a]
+
+extern int run_callback(int i, char *values, ...);
+extern int run_saved_callback(int i, char *name, char *values, ...);
+extern int run_and_save_callback(int i, char *values, ...);
+extern void destroy_saved_callback(int i);
+extern boolean get_callback(lua_State * L, int i);
+
+extern void get_saved_lua_boolean(int i, char *name, boolean * target);
+extern void get_saved_lua_number(int i, char *name, integer * target);
+extern void get_saved_lua_string(int i, char *name, char **target);
+
+extern void get_lua_boolean(char *table, char *name, boolean * target);
+extern void get_lua_number(char *table, char *name, integer * target);
+extern void get_lua_string(char *table, char *name, char **target);
+
+extern char *get_lua_name(int i);
+
+# include "texmath.h"
+# include "primitive.h"
#endif /* PDFTEXLIB */
diff --git a/Build/source/texk/web2c/luatexdir/ptexmac.h b/Build/source/texk/web2c/luatexdir/ptexmac.h
index 2f795ce3e71..99c4f8b4ed1 100644
--- a/Build/source/texk/web2c/luatexdir/ptexmac.h
+++ b/Build/source/texk/web2c/luatexdir/ptexmac.h
@@ -1,24 +1,24 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* ptexmac.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-$Id$
-*/
+/* $Id$ */
#ifndef PDFTEXMAC
# define PDFTEXMAC
@@ -80,12 +80,12 @@ $Id$
# define pdftex_debug tex_printf
extern void check_buffer_overflow(int wsize);
-extern void check_pool_overflow (int wsize);
+extern void check_pool_overflow(int wsize);
-# define check_buf(size, buf_size) \
- if ((unsigned)(size) > (unsigned)(buf_size)) \
- pdftex_fail("buffer overflow: %d > %d at file %s, line %d", \
- (int)(size), (int)(buf_size), __FILE__, __LINE__ )
+# define check_buf(size, buf_size) \
+ if ((unsigned)(size) > (unsigned)(buf_size)) \
+ pdftex_fail("buffer overflow: %d > %d at file %s, line %d", \
+ (int)(size), (int)(buf_size), __FILE__, __LINE__ )
# define append_char_to_buf(c, p, buf, buf_size) do { \
if (c == 9) \
@@ -125,10 +125,10 @@ extern void check_pool_overflow (int wsize);
T##_array = xtalloc(T##_limit, T##_entry); \
T##_ptr = T##_array; \
} \
- else if ((unsigned)(T##_ptr - T##_array + (n)) > T##_limit) { \
+ else if ((unsigned)(T##_ptr - T##_array + (n)) > (unsigned)(T##_limit)) { \
last_ptr_index = T##_ptr - T##_array; \
T##_limit *= 2; \
- if ((unsigned)(T##_ptr - T##_array + (n)) > T##_limit) \
+ if ((unsigned)(T##_ptr - T##_array + (n)) > (unsigned)(T##_limit)) \
T##_limit = T##_ptr - T##_array + (n); \
xretalloc(T##_array, T##_limit, T##_entry); \
T##_ptr = T##_array + last_ptr_index; \
diff --git a/Build/source/texk/web2c/luatexdir/slnunicode/slnunico.c b/Build/source/texk/web2c/luatexdir/slnunicode/slnunico.c
index c40c4f7b539..4957ac38e58 100644
--- a/Build/source/texk/web2c/luatexdir/slnunicode/slnunico.c
+++ b/Build/source/texk/web2c/luatexdir/slnunicode/slnunico.c
@@ -942,6 +942,8 @@ static int gmatch_aux (lua_State *L) {
ms.L = L;
ms.src_init = s;
ms.src_end = s+ls;
+ ms.mode = lua_tointeger(L, lua_upvalueindex(4));
+ ms.mb = MODE_MBYTE(ms.mode);
for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3));
src <= ms.src_end;
src++)
@@ -966,7 +968,8 @@ static int gmatch (lua_State *L) {
luaL_checkstring(L, 2);
lua_settop(L, 2);
lua_pushinteger(L, 0);
- lua_pushcclosure(L, gmatch_aux, 3);
+ lua_pushinteger(L, lua_upvalueindex(1));
+ lua_pushcclosure(L, gmatch_aux, 4);
return 1;
}
diff --git a/Build/source/texk/web2c/luatexdir/svnversion.h b/Build/source/texk/web2c/luatexdir/svnversion.h
deleted file mode 100644
index 9a139c2d294..00000000000
--- a/Build/source/texk/web2c/luatexdir/svnversion.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define BUILD_REVISION "$Revision: 915 $"
-#define BUILD_DATE 20071128
-#define BUILD_TIME 1092554
diff --git a/Build/source/texk/web2c/luatexdir/tex/filename.c b/Build/source/texk/web2c/luatexdir/tex/filename.c
new file mode 100644
index 00000000000..ed347c4ff55
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/tex/filename.c
@@ -0,0 +1,339 @@
+/* filename.c
+
+ Copyright 2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+#include "luatex-api.h"
+#include <ptexlib.h>
+#include "tokens.h"
+#include "commands.h"
+
+static const char _svn_version[] =
+ "$Id: filename.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/filename.c $";
+
+#define wake_up_terminal() ;
+#define clear_terminal() ;
+
+#define cur_length (pool_ptr - str_start_macro(str_ptr))
+
+#define batch_mode 0 /* omits all stops and omits terminal output */
+#define nonstop_mode 1 /* omits all stops */
+#define scroll_mode 2 /* omits error stops */
+#define error_stop_mode 3 /* stops at every opportunity to interact */
+#define biggest_char 1114111
+
+/* put |ASCII_code| \# at the end of |str_pool| */
+#define append_char(A) str_pool[pool_ptr++]=(A)
+#define str_room(A) check_pool_overflow((pool_ptr+(A)))
+
+/*
+ In order to isolate the system-dependent aspects of file names, the
+ @^system dependencies@>
+ system-independent parts of \TeX\ are expressed in terms
+ of three system-dependent
+ procedures called |begin_name|, |more_name|, and |end_name|. In
+ essence, if the user-specified characters of the file name are $c_1\ldots c_n$,
+ the system-independent driver program does the operations
+ $$|begin_name|;\,|more_name|(c_1);\,\ldots\,;\,|more_name|(c_n);
+ \,|end_name|.$$
+ These three procedures communicate with each other via global variables.
+ Afterwards the file name will appear in the string pool as three strings
+ called |cur_name|\penalty10000\hskip-.05em,
+ |cur_area|, and |cur_ext|; the latter two are null (i.e.,
+ |""|), unless they were explicitly specified by the user.
+
+ Actually the situation is slightly more complicated, because \TeX\ needs
+ to know when the file name ends. The |more_name| routine is a function
+ (with side effects) that returns |true| on the calls |more_name|$(c_1)$,
+ \dots, |more_name|$(c_{n-1})$. The final call |more_name|$(c_n)$
+ returns |false|; or, it returns |true| and the token following $c_n$ is
+ something like `\.{\\hbox}' (i.e., not a character). In other words,
+ |more_name| is supposed to return |true| unless it is sure that the
+ file name has been completely scanned; and |end_name| is supposed to be able
+ to finish the assembly of |cur_name|, |cur_area|, and |cur_ext| regardless of
+ whether $|more_name|(c_n)$ returned |true| or |false|.
+*/
+
+/* Here now is the first of the system-dependent routines for file name scanning.
+ @^system dependencies@> */
+
+static void begin_name(void)
+{
+ area_delimiter = 0;
+ ext_delimiter = 0;
+ quoted_filename = false;
+}
+
+/* And here's the second. The string pool might change as the file name is
+ being scanned, since a new \.{\\csname} might be entered; therefore we keep
+ |area_delimiter| and |ext_delimiter| relative to the beginning of the current
+ string, instead of assigning an absolute address like |pool_ptr| to them.
+ @^system dependencies@> */
+
+static boolean more_name(ASCII_code c)
+{
+ if (c == ' ' && stop_at_space && (!quoted_filename)) {
+ return false;
+ } else if (c == '"') {
+ quoted_filename = !quoted_filename;
+ return true;
+ } else {
+ str_room(1);
+ append_char(c); /* contribute |c| to the current string */
+ if (ISDIRSEP(c)) {
+ area_delimiter = cur_length;
+ ext_delimiter = 0;
+ } else if (c == '.')
+ ext_delimiter = cur_length;
+ return true;
+ }
+}
+
+/* The third.
+ @^system dependencies@>
+
+*/
+
+static void end_name(void)
+{
+ if (str_ptr + 3 > (max_strings + string_offset))
+ overflow_string("number of strings", max_strings - init_str_ptr);
+ /* @:TeX capacity exceeded number of strings}{\quad number of strings@> */
+
+ if (area_delimiter == 0) {
+ cur_area = get_nullstr();
+ } else {
+ cur_area = str_ptr;
+ str_start_macro(str_ptr + 1) =
+ str_start_macro(str_ptr) + area_delimiter;
+ incr(str_ptr);
+ }
+ if (ext_delimiter == 0) {
+ cur_ext = get_nullstr();
+ cur_name = make_string();
+ } else {
+ cur_name = str_ptr;
+ str_start_macro(str_ptr + 1) =
+ str_start_macro(str_ptr) + ext_delimiter - area_delimiter - 1;
+ incr(str_ptr);
+ cur_ext = make_string();
+ }
+}
+
+/* Now let's consider the ``driver'' routines by which \TeX\ deals with file names
+ in a system-independent manner. First comes a procedure that looks for a
+ file name in the input by calling |get_x_token| for the information.
+*/
+
+void scan_file_name(void)
+{
+ name_in_progress = true;
+ begin_name();
+ /* @<Get the next non-blank non-call token@>; */
+ do {
+ get_x_token();
+ } while ((cur_cmd == spacer_cmd) || (cur_cmd == relax_cmd));
+
+ while (true) {
+ if ((cur_cmd > other_char_cmd) || (cur_chr > biggest_char)) { /* not a character */
+ back_input();
+ break;
+ }
+ /* If |cur_chr| is a space and we're not scanning a token list, check
+ whether we're at the end of the buffer. Otherwise we end up adding
+ spurious spaces to file names in some cases. */
+ if ((cur_chr == ' ') && (state != token_list) && (loc > limit)
+ && !quoted_filename)
+ break;
+ if (!more_name(cur_chr))
+ break;
+ get_x_token();
+ }
+ end_name();
+ name_in_progress = false;
+}
+
+
+/*
+ Here is a routine that manufactures the output file names, assuming that
+ |job_name<>0|. It ignores and changes the current settings of |cur_area|
+ and |cur_ext|.
+*/
+
+#define pack_cur_name() pack_file_name(cur_name,cur_area,cur_ext)
+
+void pack_job_name(char *s)
+{ /* |s = ".log"|, |".dvi"|, or |format_extension| */
+ cur_area = get_nullstr();
+ cur_ext = maketexstring(s);
+ cur_name = job_name;
+ pack_cur_name();
+}
+
+/* If some trouble arises when \TeX\ tries to open a file, the following
+ routine calls upon the user to supply another file name. Parameter~|s|
+ is used in the error message to identify the type of file; parameter~|e|
+ is the default extension if none is given. Upon exit from the routine,
+ variables |cur_name|, |cur_area|, |cur_ext|, and |nameoffile| are
+ ready for another attempt at file opening.
+*/
+
+void prompt_file_name(char *s, char *e)
+{
+ int k; /* index into |buffer| */
+ str_number saved_cur_name; /* to catch empty terminal input */
+ char prompt[256];
+ str_number texprompt;
+ char *ar, *na, *ex;
+ saved_cur_name = cur_name;
+ if (interaction == scroll_mode) {
+ wake_up_terminal();
+ }
+ ar = xstrdup(makecstring(cur_area));
+ na = xstrdup(makecstring(cur_name));
+ ex = xstrdup(makecstring(cur_ext));
+ if (strcmp(s, "input file name") == 0) { /* @.I can't find file x@> */
+ snprintf(prompt, 255, "I can't find file `%s%s%s'.", ar, na, ex);
+ } else { /*@.I can't write on file x@> */
+ snprintf(prompt, 255, "I can't write on file `%s%s%s'.", ar, na, ex);
+ }
+ free(ar);
+ free(na);
+ free(ex);
+ texprompt = maketexstring((char *) prompt);
+ do_print_err(texprompt);
+ flush_str(texprompt);
+ if ((strcmp(e, ".tex") == 0) || (strcmp(e, "") == 0))
+ show_context();
+ tprint_nl("Please type another "); /*@.Please type...@> */
+ tprint(s);
+ if (interaction < scroll_mode)
+ fatal_error(maketexstring
+ ("*** (job aborted, file error in nonstop mode)"));
+ clear_terminal();
+ texprompt = maketexstring(": ");
+ prompt_input(texprompt);
+ flush_str(texprompt);
+ begin_name();
+ k = first;
+ while ((buffer[k] == ' ') && (k < last))
+ k++;
+ while (true) {
+ if (k == last)
+ break;
+ if (!more_name(buffer[k]))
+ break;
+ k++;
+ }
+ end_name();
+ if (cur_ext == get_nullstr())
+ cur_ext = maketexstring(e);
+ if (length(cur_name) == 0)
+ cur_name = saved_cur_name;
+ pack_cur_name();
+}
+
+
+str_number make_name_string(void)
+{
+ int k; /* index into |nameoffile| */
+ pool_pointer save_area_delimiter, save_ext_delimiter;
+ boolean save_name_in_progress, save_stop_at_space;
+ str_number ret;
+ if ((pool_ptr + namelength > pool_size) ||
+ (str_ptr == max_strings) || (cur_length > 0)) {
+ ret = maketexstring("?");
+ } else {
+ for (k = 1; k <= namelength; k++)
+ append_char(nameoffile[k]);
+ ret = make_string();
+ }
+ /* At this point we also reset |cur_name|, |cur_ext|, and |cur_area| to
+ match the contents of |nameoffile|. */
+ save_area_delimiter = area_delimiter;
+ save_ext_delimiter = ext_delimiter;
+ save_name_in_progress = name_in_progress;
+ save_stop_at_space = stop_at_space;
+ name_in_progress = true;
+ begin_name();
+ stop_at_space = false;
+ k = 1;
+ while ((k <= namelength) && (more_name(nameoffile[k])))
+ k++;
+ stop_at_space = save_stop_at_space;
+ end_name();
+ name_in_progress = save_name_in_progress;
+ area_delimiter = save_area_delimiter;
+ ext_delimiter = save_ext_delimiter;
+ return ret;
+}
+
+
+
+void print_file_name(str_number n, str_number a, str_number e)
+{
+ boolean must_quote; /* whether to quote the filename */
+ pool_pointer j; /* index into |str_pool| */
+ must_quote = false;
+ if (a != 0) {
+ j = str_start_macro(a);
+ while ((!must_quote) && (j < str_start_macro(a + 1))) {
+ must_quote = (str_pool[j] == ' ');
+ incr(j);
+ }
+ }
+ if (n != 0) {
+ j = str_start_macro(n);
+ while ((!must_quote) && (j < str_start_macro(n + 1))) {
+ must_quote = (str_pool[j] == ' ');
+ incr(j);
+ }
+ }
+ if (e != 0) {
+ j = str_start_macro(e);
+ while ((!must_quote) && (j < str_start_macro(e + 1))) {
+ must_quote = (str_pool[j] == ' ');
+ incr(j);
+ }
+ }
+ /* FIXME: Alternative is to assume that any filename that has to be quoted has
+ at least one quoted component...if we pick this, a number of insertions
+ of |print_file_name| should go away.
+ |must_quote|:=((|a|<>0)and(|str_pool|[|str_start|[|a|]]=""""))or
+ ((|n|<>0)and(|str_pool|[|str_start|[|n|]]=""""))or
+ ((|e|<>0)and(|str_pool|[|str_start|[|e|]]="""")); */
+
+ if (must_quote)
+ print_char('"');
+ if (a != 0) {
+ for (j = str_start_macro(a); j <= str_start_macro(a + 1) - 1; j++)
+ if (str_pool[j] != '"')
+ print_char(str_pool[j]);
+ }
+ if (n != 0) {
+ for (j = str_start_macro(n); j <= str_start_macro(n + 1) - 1; j++)
+ if (str_pool[j] != '"')
+ print_char(str_pool[j]);
+ }
+ if (e != 0) {
+ for (j = str_start_macro(e); j <= str_start_macro(e + 1) - 1; j++)
+ if (str_pool[j] != '"')
+ print_char(str_pool[j]);
+ }
+ if (must_quote)
+ print_char('"');
+}
diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.c b/Build/source/texk/web2c/luatexdir/tex/linebreak.c
index 768d1999af8..6f86577dc20 100644
--- a/Build/source/texk/web2c/luatexdir/tex/linebreak.c
+++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.c
@@ -1,9 +1,29 @@
-/* $Id: linebreak.c 1168 2008-04-15 13:43:34Z taco $ */
+/* linebreak.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+static const char _svn_version[] =
+ "$Id: linebreak.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/linebreak.c $";
+
/* Glue nodes in a horizontal list that is being paragraphed are not supposed to
include ``infinite'' shrinkability; that is why the algorithm maintains
four registers for stretching but only one for shrinking. If the user tries to
@@ -407,18 +427,11 @@ want to do this without the overhead of |for| loops. The |do_all_six|
macro makes such six-tuples convenient.
*/
-#define save_active_width(a) prev_active_width[(a)] = active_width[(a)]
-#define restore_active_width(a) active_width[(a)] = prev_active_width[(a)]
-
static scaled active_width[10] = { 0 }; /*distance from first active node to~|cur_p| */
static scaled background[10] = { 0 }; /*length of an ``empty'' line */
static scaled break_width[10] = { 0 }; /*length being computed after current break */
static boolean auto_breaking; /*make |auto_breaking| accessible out of |line_break| */
-static boolean try_prev_break; /*force break at the previous legal breakpoint? */
-static halfword prev_legal; /*the previous legal breakpoint */
-static halfword rejected_cur_p; /*the last |cur_p| that has been rejected */
-static boolean before_rejected_cur_p; /*|cur_p| is still before |rejected_cur_p|? */
/* Let's state the principles of the delta nodes more precisely and concisely,
so that the following programs will be less obscure. For each legal
@@ -900,7 +913,7 @@ print_feasible_break(halfword cur_p, pointer r, halfword b, integer pi,
#define set_break_width_to_background(a) break_width[a]=background[(a)]
#define convert_to_break_width(a) \
- varmem[(prev_r+(a))].cint -= (cur_active_width[(a)]+break_width[(a)])
+ varmem[(prev_r+(a))].cint = varmem[(prev_r+(a))].cint-cur_active_width[(a)]+break_width[(a)]
#define store_break_width(a) active_width[(a)]=break_width[(a)]
@@ -919,8 +932,6 @@ print_feasible_break(halfword cur_p, pointer r, halfword b, integer pi,
#define total_font_stretch cur_active_width[8]
#define total_font_shrink cur_active_width[9]
-#define max_dimen 07777777777 /* $2^{30}-1$ */
-
#define left_side 0
#define right_side 1
@@ -1141,11 +1152,12 @@ ext_try_break(integer pi,
then |goto continue| if a line from |r| to |cur_p| is infeasible,
otherwise record a new feasible break@>; */
artificial_demerits = false;
- shortfall = line_width - cur_active_width[1]
- - ((break_node(r) == null)
- ? init_internal_left_box_width
- : passive_last_left_box_width(break_node(r)))
- - internal_right_box_width;
+ shortfall = line_width - cur_active_width[1];
+ if (break_node(r) == null)
+ shortfall -= init_internal_left_box_width;
+ else
+ shortfall -= passive_last_left_box_width(break_node(r));
+ shortfall -= internal_right_box_width;
if (pdf_protrude_chars > 1) {
halfword l, o;
l = (break_node(r) == null) ? first_p : cur_break(break_node(r));
@@ -1505,7 +1517,8 @@ ext_do_line_break(boolean d,
halfword widow_penalties_ptr,
int display_widow_penalty,
int widow_penalty,
- int broken_penalty, halfword final_par_glue)
+ int broken_penalty,
+ halfword final_par_glue, halfword pdf_ignored_dimen)
{
/* DONE,DONE1,DONE2,DONE3,DONE4,DONE5,CONTINUE; */
halfword cur_p, q, r, s; /* miscellaneous nodes of temporary interest */
@@ -1549,7 +1562,8 @@ ext_do_line_break(boolean d,
}
} else {
last_special_line = vinfo(par_shape_ptr + 1) - 1;
- second_indent = varmem[(par_shape_ptr + (2 * last_special_line))].cint;
+ second_indent =
+ varmem[(par_shape_ptr + 2 * (last_special_line + 1))].cint;
second_width =
varmem[(par_shape_ptr + 2 * (last_special_line + 1) + 1)].cint;
}
@@ -1647,9 +1661,10 @@ ext_do_line_break(boolean d,
/* /Create an active breakpoint representing the beginning of the paragraph */
auto_breaking = true;
cur_p = vlink(temp_head);
- assert(alink(cur_p) == temp_head);
/* LOCAL: Initialize with first |local_paragraph| node */
- if ((type(cur_p) == whatsit_node) && (subtype(cur_p) == local_par_node)) {
+ if ((cur_p != null) && (type(cur_p) == whatsit_node)
+ && (subtype(cur_p) == local_par_node)) {
+ assert(alink(cur_p) == temp_head);
internal_pen_inter = local_pen_inter(cur_p);
internal_pen_broken = local_pen_broken(cur_p);
init_internal_left_box = local_box_left(cur_p);
@@ -1670,10 +1685,6 @@ ext_do_line_break(boolean d,
}
/* /LOCAL: Initialize with first |local_paragraph| node */
set_prev_char_p(null);
- prev_legal = null;
- rejected_cur_p = null;
- try_prev_break = false;
- before_rejected_cur_p = false;
first_p = cur_p;
/* to access the first node of paragraph as the first active node
has |break_node=null| */
@@ -2156,7 +2167,8 @@ ext_post_line_break(d,
best_bet,
last_special_line,
second_width,
- second_indent, first_width, first_indent, best_line);
+ second_indent, first_width, first_indent, best_line,
+ pdf_ignored_dimen);
/* /Break the paragraph at the chosen... */
/* Clean up the memory by removing the break nodes; */
clean_up_the_memory();
diff --git a/Build/source/texk/web2c/luatexdir/tex/math.c b/Build/source/texk/web2c/luatexdir/tex/math.c
new file mode 100644
index 00000000000..d1e2c2a773b
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/tex/math.c
@@ -0,0 +1,2255 @@
+/* math.c
+
+ Copyright 2008-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+#include "luatex-api.h"
+#include <ptexlib.h>
+
+#include "nodes.h"
+#include "commands.h"
+#include "managed-sa.h"
+
+#include "tokens.h"
+
+static const char _svn_version[] =
+ "$Id: math.c 2099 2009-03-24 10:35:01Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/math.c $";
+
+#define mode cur_list.mode_field
+#define head cur_list.head_field
+#define tail cur_list.tail_field
+#define prev_graf cur_list.pg_field
+#define eTeX_aux cur_list.eTeX_aux_field
+#define delim_ptr eTeX_aux
+#define aux cur_list.aux_field
+#define prev_depth aux.cint
+#define space_factor aux.hh.lhfield
+#define incompleat_noad aux.cint
+
+#define stretching 1
+#define shrinking 2
+
+#define append_char(A) str_pool[pool_ptr++]=(A)
+#define flush_char pool_ptr-- /* forget the last character in the pool */
+#define cur_length (pool_ptr - str_start_macro(str_ptr))
+#define saved(A) save_stack[save_ptr+(A)].cint
+
+#define vmode 1
+#define hmode (vmode+max_command_cmd+1)
+#define mmode (hmode+max_command_cmd+1)
+
+#define cur_fam int_par(param_cur_fam_code)
+#define text_direction zeqtb[param_text_direction_code].cint
+
+#define scan_normal_dimen() scan_dimen(false,false,false)
+
+#define var_code 7
+
+extern void rawset_sa_item(sa_tree hed, integer n, integer v);
+
+/* TODO: not sure if this is the right order */
+#define back_error(A,B) do { \
+ OK_to_interrupt=false; \
+ back_input(); \
+ OK_to_interrupt=true; \
+ tex_error(A,B); \
+ } while (0)
+
+int scan_math(pointer);
+pointer fin_mlist(pointer);
+
+#define pre_display_size dimen_par(param_pre_display_size_code)
+#define hsize dimen_par(param_hsize_code)
+#define display_width dimen_par(param_display_width_code)
+#define display_indent dimen_par(param_display_indent_code)
+#define math_surround dimen_par(param_math_surround_code)
+#define hang_indent dimen_par(param_hang_indent_code)
+#define hang_after int_par(param_hang_after_code)
+#define every_math loc_par(param_every_math_code)
+#define every_display loc_par(param_every_display_code)
+#define par_shape_ptr loc_par(param_par_shape_code)
+
+/*
+When \TeX\ reads a formula that is enclosed between \.\$'s, it constructs an
+{\sl mlist}, which is essentially a tree structure representing that
+formula. An mlist is a linear sequence of items, but we can regard it as
+a tree structure because mlists can appear within mlists. For example, many
+of the entries can be subscripted or superscripted, and such ``scripts''
+are mlists in their own right.
+
+An entire formula is parsed into such a tree before any of the actual
+typesetting is done, because the current style of type is usually not
+known until the formula has been fully scanned. For example, when the
+formula `\.{\$a+b \\over c+d\$}' is being read, there is no way to tell
+that `\.{a+b}' will be in script size until `\.{\\over}' has appeared.
+
+During the scanning process, each element of the mlist being built is
+classified as a relation, a binary operator, an open parenthesis, etc.,
+or as a construct like `\.{\\sqrt}' that must be built up. This classification
+appears in the mlist data structure.
+
+After a formula has been fully scanned, the mlist is converted to an hlist
+so that it can be incorporated into the surrounding text. This conversion is
+controlled by a recursive procedure that decides all of the appropriate
+styles by a ``top-down'' process starting at the outermost level and working
+in towards the subformulas. The formula is ultimately pasted together using
+combinations of horizontal and vertical boxes, with glue and penalty nodes
+inserted as necessary.
+
+An mlist is represented internally as a linked list consisting chiefly
+of ``noads'' (pronounced ``no-adds''), to distinguish them from the somewhat
+similar ``nodes'' in hlists and vlists. Certain kinds of ordinary nodes are
+allowed to appear in mlists together with the noads; \TeX\ tells the difference
+by means of the |type| field, since a noad's |type| is always greater than
+that of a node. An mlist does not contain character nodes, hlist nodes, vlist
+nodes, math nodes or unset nodes; in particular, each mlist item appears in the
+variable-size part of |mem|, so the |type| field is always present.
+
+@ Each noad is five or more words long. The first word contains the
+|type| and |subtype| and |link| fields that are already so familiar to
+us; the second contains the attribute list pointer, and the third,
+fourth an fifth words are called the noad's |nucleus|, |subscr|, and
+|supscr| fields. (This use of a combined attribute list is temporary.
+Eventually, each of fields need their own list)
+
+Consider, for example, the simple formula `\.{\$x\^2\$}', which would be
+parsed into an mlist containing a single element called an |ord_noad|.
+The |nucleus| of this noad is a representation of `\.x', the |subscr| is
+empty, and the |supscr| is a representation of `\.2'.
+
+The |nucleus|, |subscr|, and |supscr| fields are further broken into
+subfields. If |p| points to a noad, and if |q| is one of its principal
+fields (e.g., |q=subscr(p)|), |q=null| indicates a field with no value (the
+corresponding attribute of noad |p| is not present). Otherwise, there are
+several possibilities for the subfields, depending on the |type| of |q|.
+
+\yskip\hang|type(q)=math_char_node| means that |math_fam(q)| refers to one of
+the sixteen font families, and |character(q)| is the number of a character
+within a font of that family, as in a character node.
+
+\yskip\hang|type(q)=math_text_char_node| is similar, but the character is
+unsubscripted and unsuperscripted and it is followed immediately by another
+character from the same font. (This |type| setting appears only
+briefly during the processing; it is used to suppress unwanted italic
+corrections.)
+
+\yskip\hang|type(q)=sub_box_node| means that |math_list(q)| points to a box
+node (either an |hlist_node| or a |vlist_node|) that should be used as the
+value of the field. The |shift_amount| in the subsidiary box node is the
+amount by which that box will be shifted downward.
+
+\yskip\hang|type(q)=sub_mlist_node| means that |math_list(q)| points to
+an mlist; the mlist must be converted to an hlist in order to obtain
+the value of this field.
+
+\yskip\noindent In the latter case, we might have |math_list(q)=null|. This
+is not the same as |q=null|; for example, `\.{\$P\_\{\}\$}'
+and `\.{\$P\$}' produce different results (the former will not have the
+``italic correction'' added to the width of |P|, but the ``script skip''
+will be added).
+
+*/
+
+
+void unsave_math(void)
+{
+ unsave();
+ decr(save_ptr);
+ flush_node_list(text_dir_ptr);
+ text_dir_ptr = saved(0);
+}
+
+
+/*
+Sometimes it is necessary to destroy an mlist. The following
+subroutine empties the current list, assuming that |abs(mode)=mmode|.
+*/
+
+void flush_math(void)
+{
+ flush_node_list(vlink(head));
+ flush_node_list(incompleat_noad);
+ vlink(head) = null;
+ tail = head;
+ incompleat_noad = null;
+}
+
+/* Before we can do anything in math mode, we need fonts. */
+
+#define MATHFONTSTACK 8
+#define MATHFONTDEFAULT 0 /* == nullfont */
+
+static sa_tree math_fam_head = NULL;
+
+integer fam_fnt(integer fam_id, integer size_id)
+{
+ integer n = fam_id + (256 * size_id);
+ return (integer) get_sa_item(math_fam_head, n);
+}
+
+void def_fam_fnt(integer fam_id, integer size_id, integer f, integer lvl)
+{
+ integer n = fam_id + (256 * size_id);
+ set_sa_item(math_fam_head, n, f, lvl);
+ fixup_math_parameters(fam_id, size_id, f, lvl);
+ if (int_par(param_tracing_assigns_code) > 0) {
+ begin_diagnostic();
+ tprint("{assigning");
+ print_char(' ');
+ print_size(size_id);
+ print_int(fam_id);
+ print_char('=');
+ print_font_identifier(fam_fnt(fam_id, size_id));
+ print_char('}');
+ end_diagnostic(false);
+ }
+}
+
+void unsave_math_fam_data(integer gl)
+{
+ sa_stack_item st;
+ if (math_fam_head->stack == NULL)
+ return;
+ while (math_fam_head->stack_ptr > 0 &&
+ abs(math_fam_head->stack[math_fam_head->stack_ptr].level)
+ >= (integer) gl) {
+ st = math_fam_head->stack[math_fam_head->stack_ptr];
+ if (st.level > 0) {
+ rawset_sa_item(math_fam_head, st.code, st.value);
+ /* now do a trace message, if requested */
+ if (int_par(param_tracing_restores_code) > 0) {
+ int size_id = st.code / 256;
+ int fam_id = st.code % 256;
+ begin_diagnostic();
+ tprint("{restoring");
+ print_char(' ');
+ print_size(size_id);
+ print_int(fam_id);
+ print_char('=');
+ print_font_identifier(fam_fnt(fam_id, size_id));
+ print_char('}');
+ end_diagnostic(false);
+ }
+ }
+ (math_fam_head->stack_ptr)--;
+ }
+}
+
+
+
+/* and parameters */
+
+static char *math_param_names[] = {
+ "Umathquad",
+ "Umathaxis",
+ "Umathoperatorsize",
+ "Umathoverbarkern",
+ "Umathoverbarrule",
+ "Umathoverbarvgap",
+ "Umathunderbarkern",
+ "Umathunderbarrule",
+ "Umathunderbarvgap",
+ "Umathradicalkern",
+ "Umathradicalrule",
+ "Umathradicalvgap",
+ "Umathradicaldegreebefore",
+ "Umathradicaldegreeafter",
+ "Umathradicaldegreeraise",
+ "Umathstackvgap",
+ "Umathstacknumup",
+ "Umathstackdenomdown",
+ "Umathfractionrule",
+ "Umathfractionnumvgap",
+ "Umathfractionnumup",
+ "Umathfractiondenomvgap",
+ "Umathfractiondenomdown",
+ "Umathfractiondelsize",
+ "Umathlimitabovevgap",
+ "Umathlimitabovebgap",
+ "Umathlimitabovekern",
+ "Umathlimitdownvgap",
+ "Umathlimitdownbgap",
+ "Umathlimitdownkern",
+ "Umathunderdelimitervgap",
+ "Umathunderdelimiterbgap",
+ "Umathoverdelimitervgap",
+ "Umathoverdelimiterbgap",
+ "Umathsubshiftdrop",
+ "Umathsupshiftdrop",
+ "Umathsubshiftdown",
+ "Umathsubsupshiftdown",
+ "Umathsubtopmax",
+ "Umathsupshiftup",
+ "Umathsupbottommin",
+ "Umathsupsubbottommax",
+ "Umathsubsupvgap",
+ "Umathspaceafterscript",
+ "Umathconnectoroverlapmin",
+ "Umathordordspacing",
+ "Umathordopspacing",
+ "Umathordbinspacing",
+ "Umathordrelspacing",
+ "Umathordopenspacing",
+ "Umathordclosespacing",
+ "Umathordpunctspacing",
+ "Umathordinnerspacing",
+ "Umathopordspacing",
+ "Umathopopspacing",
+ "Umathopbinspacing",
+ "Umathoprelspacing",
+ "Umathopopenspacing",
+ "Umathopclosespacing",
+ "Umathoppunctspacing",
+ "Umathopinnerspacing",
+ "Umathbinordspacing",
+ "Umathbinopspacing",
+ "Umathbinbinspacing",
+ "Umathbinrelspacing",
+ "Umathbinopenspacing",
+ "Umathbinclosespacing",
+ "Umathbinpunctspacing",
+ "Umathbininnerspacing",
+ "Umathrelordspacing",
+ "Umathrelopspacing",
+ "Umathrelbinspacing",
+ "Umathrelrelspacing",
+ "Umathrelopenspacing",
+ "Umathrelclosespacing",
+ "Umathrelpunctspacing",
+ "Umathrelinnerspacing",
+ "Umathopenordspacing",
+ "Umathopenopspacing",
+ "Umathopenbinspacing",
+ "Umathopenrelspacing",
+ "Umathopenopenspacing",
+ "Umathopenclosespacing",
+ "Umathopenpunctspacing",
+ "Umathopeninnerspacing",
+ "Umathcloseordspacing",
+ "Umathcloseopspacing",
+ "Umathclosebinspacing",
+ "Umathcloserelspacing",
+ "Umathcloseopenspacing",
+ "Umathcloseclosespacing",
+ "Umathclosepunctspacing",
+ "Umathcloseinnerspacing",
+ "Umathpunctordspacing",
+ "Umathpunctopspacing",
+ "Umathpunctbinspacing",
+ "Umathpunctrelspacing",
+ "Umathpunctopenspacing",
+ "Umathpunctclosespacing",
+ "Umathpunctpunctspacing",
+ "Umathpunctinnerspacing",
+ "Umathinnerordspacing",
+ "Umathinneropspacing",
+ "Umathinnerbinspacing",
+ "Umathinnerrelspacing",
+ "Umathinneropenspacing",
+ "Umathinnerclosespacing",
+ "Umathinnerpunctspacing",
+ "Umathinnerinnerspacing",
+ NULL
+};
+
+#define MATHPARAMSTACK 8
+#define MATHPARAMDEFAULT undefined_math_parameter
+
+static sa_tree math_param_head = NULL;
+
+void print_math_param(int param_code)
+{
+ if (param_code >= 0 && param_code < math_param_last)
+ tprint_esc(math_param_names[param_code]);
+ else
+ tprint("Unknown math parameter code!");
+}
+
+void def_math_param(int param_id, int style_id, scaled value, int lvl)
+{
+ integer n = param_id + (256 * style_id);
+ set_sa_item(math_param_head, n, value, lvl);
+ if (int_par(param_tracing_assigns_code) > 0) {
+ begin_diagnostic();
+ tprint("{assigning");
+ print_char(' ');
+ print_math_param(param_id);
+ print_style(style_id);
+ print_char('=');
+ print_int(value);
+ print_char('}');
+ end_diagnostic(false);
+ }
+}
+
+scaled get_math_param(int param_id, int style_id)
+{
+ integer n = param_id + (256 * style_id);
+ return (scaled) get_sa_item(math_param_head, n);
+}
+
+
+void unsave_math_param_data(integer gl)
+{
+ sa_stack_item st;
+ if (math_param_head->stack == NULL)
+ return;
+ while (math_param_head->stack_ptr > 0 &&
+ abs(math_param_head->stack[math_param_head->stack_ptr].level)
+ >= (integer) gl) {
+ st = math_param_head->stack[math_param_head->stack_ptr];
+ if (st.level > 0) {
+ rawset_sa_item(math_param_head, st.code, st.value);
+ /* now do a trace message, if requested */
+ if (int_par(param_tracing_restores_code) > 0) {
+ int param_id = st.code % 256;
+ int style_id = st.code / 256;
+ begin_diagnostic();
+ tprint("{restoring");
+ print_char(' ');
+ print_math_param(param_id);
+ print_style(style_id);
+ print_char('=');
+ print_int(get_math_param(param_id, style_id));
+ print_char('}');
+ end_diagnostic(false);
+ }
+ }
+ (math_param_head->stack_ptr)--;
+ }
+}
+
+
+/* saving and unsaving of both */
+
+void unsave_math_data(integer gl)
+{
+ unsave_math_fam_data(gl);
+ unsave_math_param_data(gl);
+}
+
+void dump_math_data(void)
+{
+ if (math_fam_head == NULL)
+ math_fam_head = new_sa_tree(MATHFONTSTACK, MATHFONTDEFAULT);
+ dump_sa_tree(math_fam_head);
+ if (math_param_head == NULL)
+ math_param_head = new_sa_tree(MATHPARAMSTACK, MATHPARAMDEFAULT);
+ dump_sa_tree(math_param_head);
+}
+
+void undump_math_data(void)
+{
+ math_fam_head = undump_sa_tree();
+ math_param_head = undump_sa_tree();
+}
+
+/* */
+
+void initialize_math(void)
+{
+ if (math_fam_head == NULL)
+ math_fam_head = new_sa_tree(MATHFONTSTACK, MATHFONTDEFAULT);
+ if (math_param_head == NULL) {
+ math_param_head = new_sa_tree(MATHPARAMSTACK, MATHPARAMDEFAULT);
+ initialize_math_spacing();
+ }
+ return;
+}
+
+
+/*
+@ Each portion of a formula is classified as Ord, Op, Bin, Rel, Ope,
+Clo, Pun, or Inn, for purposes of spacing and line breaking. An
+|ord_noad|, |op_noad|, |bin_noad|, |rel_noad|, |open_noad|, |close_noad|,
+|punct_noad|, or |inner_noad| is used to represent portions of the various
+types. For example, an `\.=' sign in a formula leads to the creation of a
+|rel_noad| whose |nucleus| field is a representation of an equals sign
+(usually |fam=0|, |character=@'75|). A formula preceded by \.{\\mathrel}
+also results in a |rel_noad|. When a |rel_noad| is followed by an
+|op_noad|, say, and possibly separated by one or more ordinary nodes (not
+noads), \TeX\ will insert a penalty node (with the current |rel_penalty|)
+just after the formula that corresponds to the |rel_noad|, unless there
+already was a penalty immediately following; and a ``thick space'' will be
+inserted just before the formula that corresponds to the |op_noad|.
+
+A noad of type |ord_noad|, |op_noad|, \dots, |inner_noad| usually
+has a |subtype=normal|. The only exception is that an |op_noad| might
+have |subtype=limits| or |no_limits|, if the normal positioning of
+limits has been overridden for this operator.
+
+A |radical_noad| also has a |left_delimiter| field, which usually
+represents a square root sign.
+
+A |fraction_noad| has a |right_delimiter| field as well as a |left_delimiter|.
+
+Delimiter fields have four subfields
+called |small_fam|, |small_char|, |large_fam|, |large_char|. These subfields
+represent variable-size delimiters by giving the ``small'' and ``large''
+starting characters, as explained in Chapter~17 of {\sl The \TeX book}.
+@:TeXbook}{\sl The \TeX book@>
+
+A |fraction_noad| is actually quite different from all other noads.
+It has |thickness|, |denominator|, and |numerator| fields instead of
+|nucleus|, |subscr|, and |supscr|. The |thickness| is a scaled value
+that tells how thick to make a fraction rule; however, the special
+value |default_code| is used to stand for the
+|default_rule_thickness| of the current size. The |numerator| and
+|denominator| point to mlists that define a fraction; we always have
+$$\hbox{|type(numerator)=type(denominator)=sub_mlist|}.$$ The
+|left_delimiter| and |right_delimiter| fields specify delimiters that will
+be placed at the left and right of the fraction. In this way, a
+|fraction_noad| is able to represent all of \TeX's operators \.{\\over},
+\.{\\atop}, \.{\\above}, \.{\\overwithdelims}, \.{\\atopwithdelims}, and
+ \.{\\abovewithdelims}.
+*/
+
+
+/* The |new_noad| function creates an |ord_noad| that is completely null */
+
+pointer new_noad(void)
+{
+ pointer p;
+ p = new_node(ord_noad, normal);
+ /* all noad fields are zero after this */
+ return p;
+}
+
+pointer new_sub_box(pointer cur_box)
+{
+ pointer p, q;
+ p = new_noad();
+ q = new_node(sub_box_node, 0);
+ nucleus(p) = q;
+ math_list(nucleus(p)) = cur_box;
+ return p;
+}
+
+/*
+@ A few more kinds of noads will complete the set: An |under_noad| has its
+nucleus underlined; an |over_noad| has it overlined. An |accent_noad| places
+an accent over its nucleus; the accent character appears as
+|math_fam(accent_chr(p))| and |math_character(accent_chr(p))|. A |vcenter_noad|
+centers its nucleus vertically with respect to the axis of the formula;
+in such noads we always have |type(nucleus(p))=sub_box|.
+
+And finally, we have the |fence_noad| type, to implement
+\TeX's \.{\\left} and \.{\\right} as well as \eTeX's \.{\\middle}.
+The |nucleus| of such noads is
+replaced by a |delimiter| field; thus, for example, `\.{\\left(}' produces
+a |fence_noad| such that |delimiter(p)| holds the family and character
+codes for all left parentheses. A |fence_noad| of subtype |left_noad_side|
+never appears in an mlist except as the first element, and a |fence_noad|
+with subtype |right_noad_side| never appears in an mlist
+except as the last element; furthermore, we either have both a |left_noad_side|
+and a |right_noad_side|, or neither one is present.
+*/
+
+/*
+@ Math formulas can also contain instructions like \.{\\textstyle} that
+override \TeX's normal style rules. A |style_node| is inserted into the
+data structure to record such instructions; it is three words long, so it
+is considered a node instead of a noad. The |subtype| is either |display_style|
+or |text_style| or |script_style| or |script_script_style|. The
+second and third words of a |style_node| are not used, but they are
+present because a |choice_node| is converted to a |style_node|.
+
+\TeX\ uses even numbers 0, 2, 4, 6 to encode the basic styles
+|display_style|, \dots, |script_script_style|, and adds~1 to get the
+``cramped'' versions of these styles. This gives a numerical order that
+is backwards from the convention of Appendix~G in {\sl The \TeX book\/};
+i.e., a smaller style has a larger numerical value.
+@:TeXbook}{\sl The \TeX book@>
+*/
+
+const char *math_style_names[] = { "display", "crampeddisplay",
+ "text", "crampedtext",
+ "script", "crampedscript",
+ "scriptscript", "crampedscriptscript",
+ NULL
+};
+
+pointer new_style(small_number s)
+{ /* create a style node */
+ return new_node(style_node, s);
+}
+
+/* Finally, the \.{\\mathchoice} primitive creates a |choice_node|, which
+has special subfields |display_mlist|, |text_mlist|, |script_mlist|,
+and |script_script_mlist| pointing to the mlists for each style.
+*/
+
+
+pointer new_choice(void)
+{ /* create a choice node */
+ return new_node(choice_node, 0); /* the |subtype| is not used */
+}
+
+/*
+@ Let's consider now the previously unwritten part of |show_node_list|
+that displays the things that can only be present in mlists; this
+program illustrates how to access the data structures just defined.
+
+In the context of the following program, |p| points to a node or noad that
+should be displayed, and the current string contains the ``recursion history''
+that leads to this point. The recursion history consists of a dot for each
+outer level in which |p| is subsidiary to some node, or in which |p| is
+subsidiary to the |nucleus| field of some noad; the dot is replaced by
+`\.\_' or `\.\^' or `\./' or `\.\\' if |p| is descended from the |subscr|
+or |supscr| or |denominator| or |numerator| fields of noads. For example,
+the current string would be `\.{.\^.\_/}' if |p| points to the |ord_noad| for
+|x| in the (ridiculous) formula
+`\.{\$\\sqrt\{a\^\{\\mathinner\{b\_\{c\\over x+y\}\}\}\}\$}'.
+*/
+
+
+void display_normal_noad(pointer p); /* forward */
+void display_fence_noad(pointer p); /* forward */
+void display_fraction_noad(pointer p); /* forward */
+
+void show_math_node(pointer p)
+{
+ switch (type(p)) {
+ case style_node:
+ print_style(subtype(p));
+ break;
+ case choice_node:
+ tprint_esc("mathchoice");
+ append_char('D');
+ show_node_list(display_mlist(p));
+ flush_char;
+ append_char('T');
+ show_node_list(text_mlist(p));
+ flush_char;
+ append_char('S');
+ show_node_list(script_mlist(p));
+ flush_char;
+ append_char('s');
+ show_node_list(script_script_mlist(p));
+ flush_char;
+ break;
+ case ord_noad:
+ case op_noad:
+ case bin_noad:
+ case rel_noad:
+ case open_noad:
+ case close_noad:
+ case punct_noad:
+ case inner_noad:
+ case radical_noad:
+ case over_noad:
+ case under_noad:
+ case vcenter_noad:
+ case accent_noad:
+ display_normal_noad(p);
+ break;
+ case fence_noad:
+ display_fence_noad(p);
+ break;
+ case fraction_noad:
+ display_fraction_noad(p);
+ break;
+ default:
+ tprint("Unknown node type!");
+ break;
+ }
+}
+
+
+/* Here are some simple routines used in the display of noads. */
+
+void print_fam_and_char(pointer p)
+{ /* prints family and character */
+ tprint_esc("fam");
+ print_int(math_fam(p));
+ print_char(' ');
+ print(math_character(p));
+}
+
+void print_delimiter(pointer p)
+{
+ integer a;
+ if (small_fam(p) < 0) {
+ print_int(-1); /* this should never happen */
+ } else if (small_fam(p) < 16 && large_fam(p) < 16 &&
+ small_char(p) < 256 && large_char(p) < 256) {
+ /* traditional tex style */
+ a = small_fam(p) * 256 + small_char(p);
+ a = a * 0x1000 + large_fam(p) * 256 + large_char(p);
+ print_hex(a);
+ } else if ((large_fam(p) == 0 && large_char(p) == 0) ||
+ small_char(p) > 65535 || large_char(p) > 65535) {
+ /* modern xetex/luatex style */
+ print_hex(small_fam(p));
+ print_hex(small_char(p));
+ } else {
+ /* assume this is omega-style */
+ a = small_fam(p) * 65536 + small_char(p);
+ print_hex(a);
+ a = large_fam(p) * 65536 + large_char(p);
+ print_hex(a);
+ }
+}
+
+/*
+@ The next subroutine will descend to another level of recursion when a
+subsidiary mlist needs to be displayed. The parameter |c| indicates what
+character is to become part of the recursion history. An empty mlist is
+distinguished from a missing field, because these are not equivalent
+(as explained above).
+@^recursion@>
+*/
+
+
+void print_subsidiary_data(pointer p, ASCII_code c)
+{ /* display a noad field */
+ if (cur_length >= depth_threshold) {
+ if (p != null)
+ tprint(" []");
+ } else {
+ append_char(c); /* include |c| in the recursion history */
+ if (p != null) {
+ switch (type(p)) {
+ case math_char_node:
+ print_ln();
+ print_current_string();
+ print_fam_and_char(p);
+ break;
+ case sub_box_node:
+ show_node_list(math_list(p));
+ break;
+ case sub_mlist_node:
+ if (math_list(p) == null) {
+ print_ln();
+ print_current_string();
+ tprint("{}");
+ } else {
+ show_node_list(math_list(p));
+ }
+ break;
+ }
+ }
+ flush_char; /* remove |c| from the recursion history */
+ }
+}
+
+void print_style(integer c)
+{
+ if (c <= cramped_script_script_style) {
+ tprint_esc((char *) math_style_names[c]);
+ tprint("style");
+ } else {
+ tprint("Unknown style!");
+ }
+}
+
+
+void display_normal_noad(pointer p)
+{
+ switch (type(p)) {
+ case ord_noad:
+ tprint_esc("mathord");
+ break;
+ case op_noad:
+ tprint_esc("mathop");
+ if (subtype(p) == limits)
+ tprint_esc("limits");
+ else if (subtype(p) == no_limits)
+ tprint_esc("nolimits");
+ break;
+ case bin_noad:
+ tprint_esc("mathbin");
+ break;
+ case rel_noad:
+ tprint_esc("mathrel");
+ break;
+ case open_noad:
+ tprint_esc("mathopen");
+ break;
+ case close_noad:
+ tprint_esc("mathclose");
+ break;
+ case punct_noad:
+ tprint_esc("mathpunct");
+ break;
+ case inner_noad:
+ tprint_esc("mathinner");
+ break;
+ case over_noad:
+ tprint_esc("overline");
+ break;
+ case under_noad:
+ tprint_esc("underline");
+ break;
+ case vcenter_noad:
+ tprint_esc("vcenter");
+ break;
+ case radical_noad:
+ if (subtype(p) == 7)
+ tprint_esc("Udelimiterover");
+ else if (subtype(p) == 6)
+ tprint_esc("Udelimiterunder");
+ else if (subtype(p) == 5)
+ tprint_esc("Uoverdelimiter");
+ else if (subtype(p) == 4)
+ tprint_esc("Uunderdelimiter");
+ else if (subtype(p) == 3)
+ tprint_esc("Uroot");
+ else
+ tprint_esc("radical");
+ print_delimiter(left_delimiter(p));
+ if (degree(p) != null) {
+ print_subsidiary_data(degree(p), '/');
+ }
+ break;
+ case accent_noad:
+ if (accent_chr(p) != null) {
+ if (bot_accent_chr(p) != null) {
+ tprint_esc("Umathaccents");
+ print_fam_and_char(accent_chr(p));
+ print_fam_and_char(bot_accent_chr(p));
+ } else {
+ tprint_esc("accent");
+ print_fam_and_char(accent_chr(p));
+ }
+ } else {
+ tprint_esc("Umathbotaccent");
+ print_fam_and_char(bot_accent_chr(p));
+ }
+ break;
+ }
+ print_subsidiary_data(nucleus(p), '.');
+ print_subsidiary_data(supscr(p), '^');
+ print_subsidiary_data(subscr(p), '_');
+}
+
+void display_fence_noad(pointer p)
+{
+ if (subtype(p) == right_noad_side)
+ tprint_esc("right");
+ else if (subtype(p) == left_noad_side)
+ tprint_esc("left");
+ else
+ tprint_esc("middle");
+ print_delimiter(delimiter(p));
+}
+
+void display_fraction_noad(pointer p)
+{
+ tprint_esc("fraction, thickness ");
+ if (thickness(p) == default_code)
+ tprint("= default");
+ else
+ print_scaled(thickness(p));
+ if ((left_delimiter(p) != null) &&
+ ((small_fam(left_delimiter(p)) != 0) ||
+ (small_char(left_delimiter(p)) != 0) ||
+ (large_fam(left_delimiter(p)) != 0) ||
+ (large_char(left_delimiter(p)) != 0))) {
+ tprint(", left-delimiter ");
+ print_delimiter(left_delimiter(p));
+ }
+ if ((right_delimiter(p) != null) &&
+ ((small_fam(right_delimiter(p)) != 0) ||
+ (small_char(right_delimiter(p)) != 0) ||
+ (large_fam(right_delimiter(p)) != 0) ||
+ (large_char(right_delimiter(p)) != 0))) {
+ tprint(", right-delimiter ");
+ print_delimiter(right_delimiter(p));
+ }
+ print_subsidiary_data(numerator(p), '\\');
+ print_subsidiary_data(denominator(p), '/');
+}
+
+/* This function is for |print_cmd_chr| only */
+
+void print_math_comp(halfword chr_code)
+{
+ switch (chr_code) {
+ case ord_noad:
+ tprint_esc("mathord");
+ break;
+ case op_noad:
+ tprint_esc("mathop");
+ break;
+ case bin_noad:
+ tprint_esc("mathbin");
+ break;
+ case rel_noad:
+ tprint_esc("mathrel");
+ break;
+ case open_noad:
+ tprint_esc("mathopen");
+ break;
+ case close_noad:
+ tprint_esc("mathclose");
+ break;
+ case punct_noad:
+ tprint_esc("mathpunct");
+ break;
+ case inner_noad:
+ tprint_esc("mathinner");
+ break;
+ case under_noad:
+ tprint_esc("underline");
+ break;
+ default:
+ tprint_esc("overline");
+ break;
+ }
+}
+
+void print_limit_switch(halfword chr_code)
+{
+ if (chr_code == limits)
+ tprint_esc("limits");
+ else if (chr_code == no_limits)
+ tprint_esc("nolimits");
+ else
+ tprint_esc("displaylimits");
+}
+
+
+/*
+The routines that \TeX\ uses to create mlists are similar to those we have
+just seen for the generation of hlists and vlists. But it is necessary to
+make ``noads'' as well as nodes, so the reader should review the
+discussion of math mode data structures before trying to make sense out of
+the following program.
+
+Here is a little routine that needs to be done whenever a subformula
+is about to be processed. The parameter is a code like |math_group|.
+*/
+
+void new_save_level_math(group_code c)
+{
+ saved(0) = text_dir_ptr;
+ text_dir_ptr = new_dir(math_direction);
+ incr(save_ptr);
+ new_save_level(c);
+ eq_word_define(static_int_base + param_body_direction_code, math_direction);
+ eq_word_define(static_int_base + param_par_direction_code, math_direction);
+ eq_word_define(static_int_base + param_text_direction_code, math_direction);
+ eq_word_define(static_int_base + param_level_local_dir_code, cur_level);
+}
+
+void push_math(group_code c)
+{
+ if (math_direction != text_direction)
+ dir_math_save = true;
+ push_nest();
+ mode = -mmode;
+ incompleat_noad = null;
+ new_save_level_math(c);
+}
+
+void enter_ordinary_math(void)
+{
+ push_math(math_shift_group);
+ eq_word_define(static_int_base + param_cur_fam_code, -1);
+ if (every_math != null)
+ begin_token_list(every_math, every_math_text);
+}
+
+void enter_display_math(void);
+
+/* We get into math mode from horizontal mode when a `\.\$' (i.e., a
+|math_shift| character) is scanned. We must check to see whether this
+`\.\$' is immediately followed by another, in case display math mode is
+called for.
+*/
+
+void init_math(void)
+{
+ get_token(); /* |get_x_token| would fail on \.{\\ifmmode}\thinspace! */
+ if ((cur_cmd == math_shift_cmd) && (mode > 0)) {
+ enter_display_math();
+ } else {
+ back_input();
+ enter_ordinary_math();
+ }
+}
+
+/*
+We get into ordinary math mode from display math mode when `\.{\\eqno}' or
+`\.{\\leqno}' appears. In such cases |cur_chr| will be 0 or~1, respectively;
+the value of |cur_chr| is placed onto |save_stack| for safe keeping.
+*/
+
+
+/*
+When \TeX\ is in display math mode, |cur_group=math_shift_group|,
+so it is not necessary for the |start_eq_no| procedure to test for
+this condition.
+*/
+
+void start_eq_no(void)
+{
+ saved(0) = cur_chr;
+ incr(save_ptr);
+ enter_ordinary_math();
+}
+
+/*
+Subformulas of math formulas cause a new level of math mode to be entered,
+on the semantic nest as well as the save stack. These subformulas arise in
+several ways: (1)~A left brace by itself indicates the beginning of a
+subformula that will be put into a box, thereby freezing its glue and
+preventing line breaks. (2)~A subscript or superscript is treated as a
+subformula if it is not a single character; the same applies to
+the nucleus of things like \.{\\underline}. (3)~The \.{\\left} primitive
+initiates a subformula that will be terminated by a matching \.{\\right}.
+The group codes placed on |save_stack| in these three cases are
+|math_group|, |math_group|, and |math_left_group|, respectively.
+
+Here is the code that handles case (1); the other cases are not quite as
+trivial, so we shall consider them later.
+*/
+
+void math_left_brace(void)
+{
+ pointer q;
+ tail_append(new_noad());
+ q = new_node(math_char_node, 0);
+ nucleus(tail) = q;
+ back_input();
+ (void) scan_math(nucleus(tail));
+}
+
+/*
+When we enter display math mode, we need to call |line_break| to
+process the partial paragraph that has just been interrupted by the
+display. Then we can set the proper values of |display_width| and
+|display_indent| and |pre_display_size|.
+*/
+
+
+void enter_display_math(void)
+{
+ scaled w; /* new or partial |pre_display_size| */
+ scaled l; /* new |display_width| */
+ scaled s; /* new |display_indent| */
+ pointer p;
+ integer n; /* scope of paragraph shape specification */
+ if (head == tail) { /* `\.{\\noindent\$\$}' or `\.{\$\${ }\$\$}' */
+ pop_nest();
+ w = -max_dimen;
+ } else {
+ line_break(true);
+ w = actual_box_width(just_box, (2 * quad(get_cur_font())));
+ }
+ /* now we are in vertical mode, working on the list that will contain the display */
+ /* A displayed equation is considered to be three lines long, so we
+ calculate the length and offset of line number |prev_graf+2|. */
+ if (par_shape_ptr == null) {
+ if ((hang_indent != 0) &&
+ (((hang_after >= 0) && (prev_graf + 2 > hang_after)) ||
+ (prev_graf + 1 < -hang_after))) {
+ l = hsize - abs(hang_indent);
+ if (hang_indent > 0)
+ s = hang_indent;
+ else
+ s = 0;
+ } else {
+ l = hsize;
+ s = 0;
+ }
+ } else {
+ n = vinfo(par_shape_ptr + 1);
+ if (prev_graf + 2 >= n)
+ p = par_shape_ptr + 2 * n + 1;
+ else
+ p = par_shape_ptr + 2 * (prev_graf + 2) + 1;
+ s = varmem[(p - 1)].cint;
+ l = varmem[p].cint;
+ }
+
+ push_math(math_shift_group);
+ mode = mmode;
+ eq_word_define(static_int_base + param_cur_fam_code, -1);
+ eq_word_define(static_dimen_base + param_pre_display_size_code, w);
+ eq_word_define(static_dimen_base + param_display_width_code, l);
+ eq_word_define(static_dimen_base + param_display_indent_code, s);
+ if (every_display != null)
+ begin_token_list(every_display, every_display_text);
+ if (nest_ptr == 1) {
+ if (!output_active)
+ lua_node_filter_s(buildpage_filter_callback, "before_display");
+ build_page();
+ }
+}
+
+/* The next routine parses all variations of a delimiter code. The |extcode|
+ * tells what syntax form to use (\TeX, \Aleph, \XeTeX, \XeTeXnum, ...) , the
+ * |doclass| tells whether or not read a math class also (for \delimiter c.s.).
+ * (the class is passed on for conversion to |\mathchar|).
+ */
+
+#define fam_in_range ((cur_fam>=0)&&(cur_fam<256))
+
+delcodeval do_scan_extdef_del_code(int extcode, boolean doclass)
+{
+ char *hlp[] = {
+ "I'm going to use 0 instead of that illegal code value.",
+ NULL
+ };
+ delcodeval d;
+ integer cur_val1; /* and the global |cur_val| */
+ integer mcls, msfam = 0, mschr = 0, mlfam = 0, mlchr = 0;
+ mcls = 0;
+ if (extcode == tex_mathcode) { /* \delcode, this is the easiest */
+ scan_int();
+ /* "MFCCFCC or "FCCFCC */
+ if (doclass) {
+ mcls = (cur_val / 0x1000000);
+ cur_val = (cur_val & 0xFFFFFF);
+ }
+ if (cur_val > 0xFFFFFF) {
+ tex_error("Invalid delimiter code", hlp);
+ cur_val = 0;
+ }
+ msfam = (cur_val / 0x100000);
+ mschr = (cur_val % 0x100000) / 0x1000;
+ mlfam = (cur_val & 0xFFF) / 0x100;
+ mlchr = (cur_val % 0x100);
+ } else if (extcode == aleph_mathcode) { /* \odelcode */
+ /* "MFFCCCC"FFCCCC or "FFCCCC"FFCCCC */
+ scan_int();
+ if (doclass) {
+ mcls = (cur_val / 0x1000000);
+ cur_val = (cur_val & 0xFFFFFF);
+ }
+ cur_val1 = cur_val;
+ scan_int();
+ if ((cur_val1 > 0xFFFFFF) || (cur_val > 0xFFFFFF)) {
+ tex_error("Invalid delimiter code", hlp);
+ cur_val1 = 0;
+ cur_val = 0;
+ }
+ msfam = (cur_val1 / 0x10000);
+ mschr = (cur_val1 % 0x10000);
+ mlfam = (cur_val / 0x10000);
+ mlchr = (cur_val % 0x10000);
+ } else if (extcode == xetex_mathcode) { /* \Udelcode */
+ /* <0-7>,<0-0xFF>,<0-0x10FFFF> or <0-0xFF>,<0-0x10FFFF> */
+ if (doclass) {
+ scan_int();
+ mcls = cur_val;
+ }
+ scan_int();
+ msfam = cur_val;
+ scan_char_num();
+ mschr = cur_val;
+ if (msfam < 0 || msfam > 255) {
+ tex_error("Invalid delimiter code", hlp);
+ msfam = 0;
+ mschr = 0;
+ }
+ mlfam = 0;
+ mlchr = 0;
+ } else if (extcode == xetexnum_mathcode) { /* \Udelcodenum */
+ /* "FF<21bits> */
+ /* the largest numeric value is $2^29-1$, but
+ the top of bit 21 can't be used as it contains invalid USV's
+ */
+ if (doclass) { /* such a primitive doesn't exist */
+ tconfusion("xetexnum_mathcode");
+ }
+ scan_int();
+ msfam = (cur_val / 0x200000);
+ mschr = cur_val & 0x1FFFFF;
+ if (msfam < 0 || msfam > 255 || mschr > 0x10FFFF) {
+ tex_error("Invalid delimiter code", hlp);
+ msfam = 0;
+ mschr = 0;
+ }
+ mlfam = 0;
+ mlchr = 0;
+ } else {
+ /* something's gone wrong */
+ tconfusion("unknown_extcode");
+ }
+ d.origin_value = extcode;
+ d.class_value = mcls;
+ d.small_family_value = msfam;
+ d.small_character_value = mschr;
+ d.large_family_value = mlfam;
+ d.large_character_value = mlchr;
+ return d;
+}
+
+void scan_extdef_del_code(int level, int extcode)
+{
+ delcodeval d;
+ integer p;
+ scan_char_num();
+ p = cur_val;
+ scan_optional_equals();
+ d = do_scan_extdef_del_code(extcode, false);
+ set_del_code(p, extcode, d.small_family_value, d.small_character_value,
+ d.large_family_value, d.large_character_value, level);
+}
+
+mathcodeval scan_mathchar(int extcode)
+{
+ char *hlp[] = {
+ "I'm going to use 0 instead of that illegal code value.",
+ NULL
+ };
+ mathcodeval d;
+ integer mcls = 0, mfam = 0, mchr = 0;
+ if (extcode == tex_mathcode) { /* \mathcode */
+ /* "TFCC */
+ scan_int();
+ if (cur_val > 0x8000) {
+ tex_error("Invalid math code", hlp);
+ cur_val = 0;
+ }
+ mcls = (cur_val / 0x1000);
+ mfam = ((cur_val % 0x1000) / 0x100);
+ mchr = (cur_val % 0x100);
+ } else if (extcode == aleph_mathcode) { /* \omathcode */
+ /* "TFFCCCC */
+ scan_int();
+ if (cur_val > 0x8000000) {
+ tex_error("Invalid math code", hlp);
+ cur_val = 0;
+ }
+ mcls = (cur_val / 0x1000000);
+ mfam = ((cur_val % 0x1000000) / 0x10000);
+ mchr = (cur_val % 0x10000);
+ } else if (extcode == xetex_mathcode) {
+ /* <0-0x7> <0-0xFF> <0-0x10FFFF> */
+ scan_int();
+ mcls = cur_val;
+ scan_int();
+ mfam = cur_val;
+ scan_char_num();
+ mchr = cur_val;
+ if (mcls < 0 || mcls > 7 || mfam > 255) {
+ tex_error("Invalid math code", hlp);
+ mchr = 0;
+ mfam = 0;
+ mcls = 0;
+ }
+ } else if (extcode == xetexnum_mathcode) {
+ /* "FFT<21bits> */
+ /* the largest numeric value is $2^32-1$, but
+ the top of bit 21 can't be used as it contains invalid USV's
+ */
+ /* Note: |scan_int| won't accept families 128-255 because these use bit 32 */
+ scan_int();
+ mfam = (cur_val / 0x200000) & 0x7FF;
+ mcls = mfam % 0x08;
+ mfam = mfam / 0x08;
+ mchr = cur_val & 0x1FFFFF;
+ if (mchr > 0x10FFFF) {
+ tex_error("Invalid math code", hlp);
+ mcls = 0;
+ mfam = 0;
+ mchr = 0;
+ }
+ } else {
+ /* something's gone wrong */
+ tconfusion("unknown_extcode");
+ }
+ d.class_value = mcls;
+ d.family_value = mfam;
+ d.origin_value = extcode;
+ d.character_value = mchr;
+ return d;
+}
+
+
+void scan_extdef_math_code(int level, int extcode)
+{
+ mathcodeval d;
+ integer p;
+ scan_char_num();
+ p = cur_val;
+ scan_optional_equals();
+ d = scan_mathchar(extcode);
+ set_math_code(p, extcode, d.class_value,
+ d.family_value, d.character_value, level);
+}
+
+
+/* this reads in a delcode when actually a mathcode is needed */
+
+mathcodeval scan_delimiter_as_mathchar(int extcode)
+{
+ delcodeval dval;
+ mathcodeval mval;
+ dval = do_scan_extdef_del_code(extcode, true);
+ mval.origin_value = 0;
+ mval.class_value = dval.class_value;
+ mval.family_value = dval.small_family_value;
+ mval.character_value = dval.small_character_value;
+ return mval;
+}
+
+/* this has to match the inverse routine in the pascal code
+ * where the |\Umathchardef| is executed
+ */
+
+mathcodeval mathchar_from_integer(integer value, int extcode)
+{
+ mathcodeval mval;
+ mval.origin_value = extcode;
+ if (extcode == tex_mathcode) {
+ mval.class_value = (value / 0x1000);
+ mval.family_value = ((value % 0x1000) / 0x100);
+ mval.character_value = (value % 0x100);
+ } else if (extcode == aleph_mathcode) {
+ mval.class_value = (value / 0x1000000);
+ mval.family_value = ((value % 0x1000000) / 0x10000);
+ mval.character_value = (value % 0x10000);
+ } else { /* some xetexended xetex thing */
+ int mfam = (value / 0x200000) & 0x7FF;
+ mval.class_value = mfam % 0x08;
+ mval.family_value = mfam / 0x08;
+ mval.character_value = value & 0x1FFFFF;
+ }
+ return mval;
+}
+
+/* Recall that the |nucleus|, |subscr|, and |supscr| fields in a noad
+are broken down into subfields called |type| and either |math_list| or
+|(math_fam,math_character)|. The job of |scan_math| is to figure out
+what to place in one of these principal fields; it looks at the
+subformula that comes next in the input, and places an encoding of
+that subformula into a given word of |mem|.
+*/
+
+
+#define get_next_nb_nr() do { get_x_token(); } while (cur_cmd==spacer_cmd||cur_cmd==relax_cmd)
+
+
+int scan_math(pointer p)
+{
+ /* label restart,reswitch,exit; */
+ mathcodeval mval;
+ assert(p != null);
+ RESTART:
+ get_next_nb_nr();
+ RESWITCH:
+ switch (cur_cmd) {
+ case letter_cmd:
+ case other_char_cmd:
+ case char_given_cmd:
+ mval = get_math_code(cur_chr);
+ if (mval.class_value == 8) {
+ /* An active character that is an |outer_call| is allowed here */
+ cur_cs = active_to_cs(cur_chr, true);
+ cur_cmd = eq_type(cur_cs);
+ cur_chr = equiv(cur_cs);
+ x_token();
+ back_input();
+ goto RESTART;
+ }
+ break;
+ case char_num_cmd:
+ scan_char_num();
+ cur_chr = cur_val;
+ cur_cmd = char_given_cmd;
+ goto RESWITCH;
+ break;
+ case math_char_num_cmd:
+ if (cur_chr == 0)
+ mval = scan_mathchar(tex_mathcode);
+ else if (cur_chr == 1)
+ mval = scan_mathchar(aleph_mathcode);
+ else if (cur_chr == 2)
+ mval = scan_mathchar(xetex_mathcode);
+ else if (cur_chr == 3)
+ mval = scan_mathchar(xetexnum_mathcode);
+ else
+ tconfusion("scan_math");
+ break;
+ case math_given_cmd:
+ mval = mathchar_from_integer(cur_chr, tex_mathcode);
+ break;
+ case omath_given_cmd:
+ mval = mathchar_from_integer(cur_chr, aleph_mathcode);
+ break;
+ case xmath_given_cmd:
+ mval = mathchar_from_integer(cur_chr, xetex_mathcode);
+ break;
+ case delim_num_cmd:
+ if (cur_chr == 0)
+ mval = scan_delimiter_as_mathchar(tex_mathcode);
+ else if (cur_chr == 1)
+ mval = scan_delimiter_as_mathchar(aleph_mathcode);
+ else if (cur_chr == 2)
+ mval = scan_delimiter_as_mathchar(xetex_mathcode);
+ else
+ tconfusion("scan_math");
+ break;
+ default:
+ /* The pointer |p| is placed on |save_stack| while a complex subformula
+ is being scanned. */
+ back_input();
+ scan_left_brace();
+ saved(0) = p;
+ incr(save_ptr);
+ push_math(math_group);
+ return 1;
+ }
+ type(p) = math_char_node;
+ math_character(p) = mval.character_value;
+ if ((mval.class_value == var_code) && fam_in_range)
+ math_fam(p) = cur_fam;
+ else
+ math_fam(p) = mval.family_value;
+ return 0;
+}
+
+
+/*
+ The |set_math_char| procedure creates a new noad appropriate to a given
+math code, and appends it to the current mlist. However, if the math code
+is sufficiently large, the |cur_chr| is treated as an active character and
+nothing is appended.
+*/
+
+void set_math_char(mathcodeval mval)
+{
+ pointer p; /* the new noad */
+ if (mval.class_value == 8) {
+ /* An active character that is an |outer_call| is allowed here */
+ cur_cs = active_to_cs(cur_chr, true);
+ cur_cmd = eq_type(cur_cs);
+ cur_chr = equiv(cur_cs);
+ x_token();
+ back_input();
+ } else {
+ pointer q;
+ p = new_noad();
+ q = new_node(math_char_node, 0);
+ nucleus(p) = q;
+ math_character(nucleus(p)) = mval.character_value;
+ math_fam(nucleus(p)) = mval.family_value;
+ if (mval.class_value == var_code) {
+ if (fam_in_range)
+ math_fam(nucleus(p)) = cur_fam;
+ type(p) = ord_noad;
+ } else {
+ type(p) = ord_noad + mval.class_value;
+ }
+ vlink(tail) = p;
+ tail = p;
+ }
+}
+
+
+/*
+ The |math_char_in_text| procedure creates a new node representing a math char
+in text code, and appends it to the current list. However, if the math code
+is sufficiently large, the |cur_chr| is treated as an active character and
+nothing is appended.
+*/
+
+void math_char_in_text(mathcodeval mval)
+{
+ pointer p; /* the new node */
+ if (mval.class_value == 8) {
+ /* An active character that is an |outer_call| is allowed here */
+ cur_cs = active_to_cs(cur_chr, true);
+ cur_cmd = eq_type(cur_cs);
+ cur_chr = equiv(cur_cs);
+ x_token();
+ back_input();
+ } else {
+ p = new_char(fam_fnt(mval.family_value, text_size),
+ mval.character_value);
+ vlink(tail) = p;
+ tail = p;
+ }
+}
+
+
+void math_math_comp(void)
+{
+ pointer q;
+ tail_append(new_noad());
+ type(tail) = cur_chr;
+ q = new_node(math_char_node, 0);
+ nucleus(tail) = q;
+ (void) scan_math(nucleus(tail));
+}
+
+
+void math_limit_switch(void)
+{
+ char *hlp[] = {
+ "I'm ignoring this misplaced \\limits or \\nolimits command.",
+ NULL
+ };
+ if (head != tail) {
+ if (type(tail) == op_noad) {
+ subtype(tail) = cur_chr;
+ return;
+ }
+ }
+ tex_error("Limit controls must follow a math operator", hlp);
+}
+
+/*
+ Delimiter fields of noads are filled in by the |scan_delimiter| routine.
+The first parameter of this procedure is the |mem| address where the
+delimiter is to be placed; the second tells if this delimiter follows
+\.{\\radical} or not.
+*/
+
+
+void scan_delimiter(pointer p, integer r)
+{
+ delcodeval dval;
+ if (r == tex_mathcode) { /* \radical */
+ dval = do_scan_extdef_del_code(tex_mathcode, true);
+ } else if (r == aleph_mathcode) { /* \oradical */
+ dval = do_scan_extdef_del_code(aleph_mathcode, true);
+ } else if (r == xetex_mathcode) { /* \Uradical */
+ dval = do_scan_extdef_del_code(xetex_mathcode, false);
+ } else if (r == no_mathcode) {
+ get_next_nb_nr();
+ switch (cur_cmd) {
+ case letter_cmd:
+ case other_char_cmd:
+ dval = get_del_code(cur_chr);
+ break;
+ case delim_num_cmd:
+ if (cur_chr == 0) /* \delimiter */
+ dval = do_scan_extdef_del_code(tex_mathcode, true);
+ else if (cur_chr == 1) /* \odelimiter */
+ dval = do_scan_extdef_del_code(aleph_mathcode, true);
+ else if (cur_chr == 2) /* \Udelimiter */
+ dval = do_scan_extdef_del_code(xetex_mathcode, true);
+ else
+ tconfusion("scan_delimiter1");
+ break;
+ default:
+ dval.small_family_value = -1;
+ break;
+ }
+ } else {
+ tconfusion("scan_delimiter2");
+ }
+ if (p == null)
+ return;
+ if (dval.small_family_value < 0) {
+ char *hlp[] = {
+ "I was expecting to see something like `(' or `\\{' or",
+ "`\\}' here. If you typed, e.g., `{' instead of `\\{', you",
+ "should probably delete the `{' by typing `1' now, so that",
+ "braces don't get unbalanced. Otherwise just proceed",
+ "Acceptable delimiters are characters whose \\delcode is",
+ "nonnegative, or you can use `\\delimiter <delimiter code>'.",
+ NULL
+ };
+ back_error("Missing delimiter (. inserted)", hlp);
+ small_fam(p) = 0;
+ small_char(p) = 0;
+ large_fam(p) = 0;
+ large_char(p) = 0;
+ } else {
+ small_fam(p) = dval.small_family_value;
+ small_char(p) = dval.small_character_value;
+ large_fam(p) = dval.large_family_value;
+ large_char(p) = dval.large_character_value;
+ }
+ return;
+}
+
+
+void math_radical(void)
+{
+ halfword q;
+ int chr_code = cur_chr;
+ tail_append(new_node(radical_noad, chr_code));
+ q = new_node(delim_node, 0);
+ left_delimiter(tail) = q;
+ if (chr_code == 0) /* \radical */
+ scan_delimiter(left_delimiter(tail), tex_mathcode);
+ else if (chr_code == 1) /* \oradical */
+ scan_delimiter(left_delimiter(tail), aleph_mathcode);
+ else if (chr_code == 2) /* \Uradical */
+ scan_delimiter(left_delimiter(tail), xetex_mathcode);
+ else if (chr_code == 3) /* \Uroot */
+ scan_delimiter(left_delimiter(tail), xetex_mathcode);
+ else if (chr_code == 4) /* \Uunderdelimiter */
+ scan_delimiter(left_delimiter(tail), xetex_mathcode);
+ else if (chr_code == 5) /* \Uoverdelimiter */
+ scan_delimiter(left_delimiter(tail), xetex_mathcode);
+ else if (chr_code == 6) /* \Udelimiterunder */
+ scan_delimiter(left_delimiter(tail), xetex_mathcode);
+ else if (chr_code == 7) /* \Udelimiterover */
+ scan_delimiter(left_delimiter(tail), xetex_mathcode);
+ else
+ tconfusion("math_radical");
+ if (chr_code == 3) {
+ q = new_node(math_char_node, 0);
+ vlink(q) = tail;
+ degree(tail) = q;
+ if (!scan_math(degree(tail))) {
+ q = new_node(math_char_node, 0);
+ nucleus(tail) = q;
+ (void) scan_math(nucleus(tail));
+ }
+ } else {
+ q = new_node(math_char_node, 0);
+ nucleus(tail) = q;
+ (void) scan_math(nucleus(tail));
+ }
+}
+
+void math_ac(void)
+{
+ halfword q;
+ mathcodeval t, b;
+ t.character_value = 0;
+ t.family_value = 0;
+ b.character_value = 0;
+ b.family_value = 0;
+ if (cur_cmd == accent_cmd) {
+ char *hlp[] = {
+ "I'm changing \\accent to \\mathaccent here; wish me luck.",
+ "(Accents are not the same in formulas as they are in text.)",
+ NULL
+ };
+ tex_error("Please use \\mathaccent for accents in math mode", hlp);
+ }
+ tail_append(new_node(accent_noad, normal));
+ if (cur_chr == 0) { /* \mathaccent */
+ t = scan_mathchar(tex_mathcode);
+ } else if (cur_chr == 1) { /* \omathaccent */
+ t = scan_mathchar(aleph_mathcode);
+ } else if (cur_chr == 2) { /* \Umathaccent */
+ t = scan_mathchar(xetex_mathcode);
+ } else if (cur_chr == 3) { /* \Umathbotaccent */
+ b = scan_mathchar(xetex_mathcode);
+ } else if (cur_chr == 4) { /* \Umathaccents */
+ t = scan_mathchar(xetex_mathcode);
+ b = scan_mathchar(xetex_mathcode);
+ } else {
+ tconfusion("math_ac");
+ }
+ if (!(t.character_value == 0 && t.family_value == 0)) {
+ q = new_node(math_char_node, 0);
+ accent_chr(tail) = q;
+ math_character(accent_chr(tail)) = t.character_value;
+ if ((t.class_value == var_code) && fam_in_range)
+ math_fam(accent_chr(tail)) = cur_fam;
+ else
+ math_fam(accent_chr(tail)) = t.family_value;
+ }
+ if (!(b.character_value == 0 && b.family_value == 0)) {
+ q = new_node(math_char_node, 0);
+ bot_accent_chr(tail) = q;
+ math_character(bot_accent_chr(tail)) = b.character_value;
+ if ((b.class_value == var_code) && fam_in_range)
+ math_fam(bot_accent_chr(tail)) = cur_fam;
+ else
+ math_fam(bot_accent_chr(tail)) = b.family_value;
+ }
+ q = new_node(math_char_node, 0);
+ nucleus(tail) = q;
+ (void) scan_math(nucleus(tail));
+}
+
+pointer math_vcenter_group(pointer p)
+{
+ pointer q, r;
+ q = new_noad();
+ type(q) = vcenter_noad;
+ r = new_node(sub_box_node, 0);
+ nucleus(q) = r;
+ math_list(nucleus(q)) = p;
+ return q;
+}
+
+/*
+The routine that scans the four mlists of a \.{\\mathchoice} is very
+much like the routine that builds discretionary nodes.
+*/
+
+void append_choices(void)
+{
+ tail_append(new_choice());
+ incr(save_ptr);
+ saved(-1) = 0;
+ push_math(math_choice_group);
+ scan_left_brace();
+}
+void build_choices(void)
+{
+ pointer p; /* the current mlist */
+ unsave_math();
+ p = fin_mlist(null);
+ switch (saved(-1)) {
+ case 0:
+ display_mlist(tail) = p;
+ break;
+ case 1:
+ text_mlist(tail) = p;
+ break;
+ case 2:
+ script_mlist(tail) = p;
+ break;
+ case 3:
+ script_script_mlist(tail) = p;
+ decr(save_ptr);
+ return;
+ break;
+ } /* there are no other cases */
+ incr(saved(-1));
+ push_math(math_choice_group);
+ scan_left_brace();
+}
+
+/*
+ Subscripts and superscripts are attached to the previous nucleus by the
+ action procedure called |sub_sup|.
+*/
+
+void sub_sup(void)
+{
+ pointer q;
+ if (tail == head || (!scripts_allowed(tail))) {
+ tail_append(new_noad());
+ q = new_node(sub_mlist_node, 0);
+ nucleus(tail) = q;
+ }
+ if (cur_cmd == sup_mark_cmd) {
+ if (supscr(tail) != null) {
+ char *hlp[] = {
+ "I treat `x^1^2' essentially like `x^1{}^2'.", NULL
+ };
+ tail_append(new_noad());
+ q = new_node(sub_mlist_node, 0);
+ nucleus(tail) = q;
+ tex_error("Double superscript", hlp);
+ }
+ q = new_node(math_char_node, 0);
+ supscr(tail) = q;
+ (void) scan_math(supscr(tail));
+ } else {
+ if (subscr(tail) != null) {
+ char *hlp[] = {
+ "I treat `x_1_2' essentially like `x_1{}_2'.", NULL
+ };
+ tail_append(new_noad());
+ q = new_node(sub_mlist_node, 0);
+ nucleus(tail) = q;
+ tex_error("Double subscript", hlp);
+ }
+ q = new_node(math_char_node, 0);
+ subscr(tail) = q;
+ (void) scan_math(subscr(tail));
+ }
+}
+
+/*
+An operation like `\.{\\over}' causes the current mlist to go into a
+state of suspended animation: |incompleat_noad| points to a |fraction_noad|
+that contains the mlist-so-far as its numerator, while the denominator
+is yet to come. Finally when the mlist is finished, the denominator will
+go into the incompleat fraction noad, and that noad will become the
+whole formula, unless it is surrounded by `\.{\\left}' and `\.{\\right}'
+delimiters.
+*/
+
+void math_fraction(void)
+{
+ small_number c; /* the type of generalized fraction we are scanning */
+ pointer q;
+ c = cur_chr;
+ if (incompleat_noad != null) {
+ char *hlp[] = {
+ "I'm ignoring this fraction specification, since I don't",
+ "know whether a construction like `x \\over y \\over z'",
+ "means `{x \\over y} \\over z' or `x \\over {y \\over z}'.",
+ NULL
+ };
+ if (c >= delimited_code) {
+ scan_delimiter(null, no_mathcode);
+ scan_delimiter(null, no_mathcode);
+ }
+ if ((c % delimited_code) == above_code)
+ scan_normal_dimen();
+ tex_error("Ambiguous; you need another { and }", hlp);
+ } else {
+ incompleat_noad = new_node(fraction_noad, normal);
+ numerator(incompleat_noad) = new_node(sub_mlist_node, 0);
+ math_list(numerator(incompleat_noad)) = vlink(head);
+ vlink(head) = null;
+ tail = head;
+
+ if (c >= delimited_code) {
+ q = new_node(delim_node, 0);
+ left_delimiter(incompleat_noad) = q;
+ q = new_node(delim_node, 0);
+ right_delimiter(incompleat_noad) = q;
+ scan_delimiter(left_delimiter(incompleat_noad), no_mathcode);
+ scan_delimiter(right_delimiter(incompleat_noad), no_mathcode);
+ }
+ switch (c % delimited_code) {
+ case above_code:
+ scan_normal_dimen();
+ thickness(incompleat_noad) = cur_val;
+ break;
+ case over_code:
+ thickness(incompleat_noad) = default_code;
+ break;
+ case atop_code:
+ thickness(incompleat_noad) = 0;
+ break;
+ } /* there are no other cases */
+ }
+}
+
+
+
+/* At the end of a math formula or subformula, the |fin_mlist| routine is
+called upon to return a pointer to the newly completed mlist, and to
+pop the nest back to the enclosing semantic level. The parameter to
+|fin_mlist|, if not null, points to a |fence_noad| that ends the
+current mlist; this |fence_noad| has not yet been appended.
+*/
+
+
+pointer fin_mlist(pointer p)
+{
+ pointer q; /* the mlist to return */
+ if (incompleat_noad != null) {
+ if (denominator(incompleat_noad) != null) {
+ type(denominator(incompleat_noad)) = sub_mlist_node;
+ } else {
+ q = new_node(sub_mlist_node, 0);
+ denominator(incompleat_noad) = q;
+ }
+ math_list(denominator(incompleat_noad)) = vlink(head);
+ if (p == null) {
+ q = incompleat_noad;
+ } else {
+ q = math_list(numerator(incompleat_noad));
+ if ((type(q) != fence_noad) || (subtype(q) != left_noad_side)
+ || (delim_ptr == null))
+ tconfusion("right"); /* this can't happen */
+ math_list(numerator(incompleat_noad)) = vlink(delim_ptr);
+ vlink(delim_ptr) = incompleat_noad;
+ vlink(incompleat_noad) = p;
+ }
+ } else {
+ vlink(tail) = p;
+ q = vlink(head);
+ }
+ pop_nest();
+ return q;
+}
+
+
+/* Now at last we're ready to see what happens when a right brace occurs
+in a math formula. Two special cases are simplified here: Braces are effectively
+removed when they surround a single Ord without sub/superscripts, or when they
+surround an accent that is the nucleus of an Ord atom.
+*/
+
+void close_math_group(pointer p)
+{
+ pointer q;
+ unsave_math();
+
+ decr(save_ptr);
+ type(saved(0)) = sub_mlist_node;
+ p = fin_mlist(null);
+ math_list(saved(0)) = p;
+ if (p != null) {
+ if (vlink(p) == null) {
+ if (type(p) == ord_noad) {
+ if (subscr(p) == null && supscr(p) == null) {
+ type(saved(0)) = type(nucleus(p));
+ if (type(nucleus(p)) == math_char_node) {
+ math_fam(saved(0)) = math_fam(nucleus(p));
+ math_character(saved(0)) = math_character(nucleus(p));
+ } else {
+ math_list(saved(0)) = math_list(nucleus(p));
+ math_list(nucleus(p)) = null;
+ }
+ node_attr(saved(0)) = node_attr(nucleus(p));
+ node_attr(nucleus(p)) = null;
+ flush_node(p);
+ }
+ }
+ } else {
+ if (type(p) == accent_noad) {
+ if (saved(0) == nucleus(tail)) {
+ /* todo: check this branch */
+ if (type(tail) == ord_noad) {
+ q = head;
+ while (vlink(q) != tail)
+ q = vlink(q);
+ vlink(q) = p;
+ nucleus(tail) = null;
+ subscr(tail) = null;
+ supscr(tail) = null;
+ node_attr(p) = node_attr(tail);
+ node_attr(tail) = null;
+ flush_node(tail);
+ tail = p;
+ }
+ }
+ }
+ }
+ }
+ if (vlink(saved(0)) > 0) {
+ pointer q;
+ q = new_node(math_char_node, 0);
+ nucleus(vlink(saved(0))) = q;
+ vlink(saved(0)) = null;
+ saved(0) = q;
+ (void) scan_math(saved(0));
+ /* restart */
+ }
+}
+
+/*
+We have dealt with all constructions of math mode except `\.{\\left}' and
+`\.{\\right}', so the picture is completed by the following sections of
+the program. The |middle| feature of \eTeX\ allows one ore several \.{\\middle}
+delimiters to appear between \.{\\left} and \.{\\right}.
+*/
+
+void math_left_right(void)
+{
+ small_number t; /* |left_noad_side| .. |right_noad_side| */
+ pointer p; /* new noad */
+ pointer q; /* resulting mlist */
+ pointer r; /* temporary */
+ t = cur_chr;
+ if ((t != left_noad_side) && (cur_group != math_left_group)) {
+ if (cur_group == math_shift_group) {
+ scan_delimiter(null, no_mathcode);
+ if (t == middle_noad_side) {
+ char *hlp[] = {
+ "I'm ignoring a \\middle that had no matching \\left.",
+ NULL
+ };
+ tex_error("Extra \\middle", hlp);
+ } else {
+ char *hlp[] = {
+ "I'm ignoring a \\right that had no matching \\left.",
+ NULL
+ };
+ tex_error("Extra \\right", hlp);
+ }
+ } else {
+ off_save();
+ }
+ } else {
+ p = new_noad();
+ type(p) = fence_noad;
+ subtype(p) = t;
+ r = new_node(delim_node, 0);
+ delimiter(p) = r;
+ scan_delimiter(delimiter(p), no_mathcode);
+ if (t == left_noad_side) {
+ q = p;
+ } else {
+ q = fin_mlist(p);
+ unsave_math();
+ }
+ if (t != right_noad_side) {
+ push_math(math_left_group);
+ vlink(head) = q;
+ tail = p;
+ delim_ptr = p;
+ } else {
+ tail_append(new_noad());
+ type(tail) = inner_noad;
+ r = new_node(sub_mlist_node, 0);
+ nucleus(tail) = r;
+ math_list(nucleus(tail)) = q;
+ }
+ }
+}
+
+
+/* \TeX\ gets to the following part of the program when
+the first `\.\$' ending a display has been scanned.
+*/
+
+static void check_second_math_shift(void)
+{
+ get_x_token();
+ if (cur_cmd != math_shift_cmd) {
+ char *hlp[] = {
+ "The `$' that I just saw supposedly matches a previous `$$'.",
+ "So I shall assume that you typed `$$' both times.",
+ NULL
+ };
+ back_error("Display math should end with $$", hlp);
+ }
+}
+
+void finish_displayed_math(boolean l, boolean danger, pointer a);
+
+void after_math(void)
+{
+ boolean danger; /* not enough symbol fonts are present */
+ integer m; /* |mmode| or |-mmode| */
+ pointer p; /* the formula */
+ pointer a = null; /* box containing equation number */
+ boolean l = false; /* `\.{\\leqno}' instead of `\.{\\eqno}' */
+ danger = check_necessary_fonts();
+ m = mode;
+ p = fin_mlist(null); /* this pops the nest */
+ if (mode == -m) { /* end of equation number */
+ check_second_math_shift();
+ run_mlist_to_hlist(p, text_style, false);
+ a = hpack(vlink(temp_head), 0, additional);
+ unsave_math();
+ decr(save_ptr); /* now |cur_group=math_shift_group| */
+ if (saved(0) == 1)
+ l = true;
+ danger = check_necessary_fonts();
+ m = mode;
+ p = fin_mlist(null);
+ }
+ if (m < 0) {
+ /* The |unsave| is done after everything else here; hence an appearance of
+ `\.{\\mathsurround}' inside of `\.{\$...\$}' affects the spacing at these
+ particular \.\$'s. This is consistent with the conventions of
+ `\.{\$\$...\$\$}', since `\.{\\abovedisplayskip}' inside a display affects the
+ space above that display.
+ */
+ tail_append(new_math(math_surround, before));
+ if (dir_math_save) {
+ tail_append(new_dir(math_direction));
+ }
+ run_mlist_to_hlist(p, text_style, (mode > 0));
+ vlink(tail) = vlink(temp_head);
+ while (vlink(tail) != null)
+ tail = vlink(tail);
+ if (dir_math_save) {
+ tail_append(new_dir(math_direction - 64));
+ }
+ dir_math_save = false;
+ tail_append(new_math(math_surround, after));
+ space_factor = 1000;
+ unsave_math();
+ } else {
+ if (a == null)
+ check_second_math_shift();
+ run_mlist_to_hlist(p, display_style, false);
+ finish_displayed_math(l, danger, a);
+ }
+}
+
+
+void resume_after_display(void)
+{
+ if (cur_group != math_shift_group)
+ tconfusion("display");
+ unsave_math();
+ prev_graf = prev_graf + 3;
+ push_nest();
+ mode = hmode;
+ space_factor = 1000;
+ tail_append(make_local_par_node());
+ get_x_token();
+ if (cur_cmd != spacer_cmd)
+ back_input();
+ if (nest_ptr == 1) {
+ lua_node_filter_s(buildpage_filter_callback, "after_display");
+ build_page();
+ }
+}
+
+
+/*
+We have saved the worst for last: The fussiest part of math mode processing
+occurs when a displayed formula is being centered and placed with an optional
+equation number.
+*/
+/* At this time |p| points to the mlist for the formula; |a| is either
+ |null| or it points to a box containing the equation number; and we are in
+ vertical mode (or internal vertical mode).
+*/
+
+void finish_displayed_math(boolean l, boolean danger, pointer a)
+{
+ pointer b; /* box containing the equation */
+ scaled w; /* width of the equation */
+ scaled z; /* width of the line */
+ scaled e; /* width of equation number */
+ scaled q; /* width of equation number plus space to separate from equation */
+ scaled d; /* displacement of equation in the line */
+ scaled s; /* move the line right this much */
+ small_number g1, g2; /* glue parameter codes for before and after */
+ pointer r; /* kern node used to position the display */
+ pointer t; /* tail of adjustment list */
+ pointer pre_t; /* tail of pre-adjustment list */
+ pointer p;
+ p = vlink(temp_head);
+ adjust_tail = adjust_head;
+ pre_adjust_tail = pre_adjust_head;
+ b = hpack(p, 0, additional);
+ p = list_ptr(b);
+ t = adjust_tail;
+ adjust_tail = null;
+ pre_t = pre_adjust_tail;
+ pre_adjust_tail = null;
+ w = width(b);
+ z = display_width;
+ s = display_indent;
+ if ((a == null) || danger) {
+ e = 0;
+ q = 0;
+ } else {
+ e = width(a);
+ q = e + get_math_quad(text_size);
+ }
+ if (w + q > z) {
+ /* The user can force the equation number to go on a separate line
+ by causing its width to be zero. */
+ if ((e != 0) && ((w - total_shrink[normal] + q <= z) ||
+ (total_shrink[sfi] != 0) || (total_shrink[fil] != 0) ||
+ (total_shrink[fill] != 0)
+ || (total_shrink[filll] != 0))) {
+ list_ptr(b) = null;
+ flush_node(b);
+ b = hpack(p, z - q, exactly);
+ } else {
+ e = 0;
+ if (w > z) {
+ list_ptr(b) = null;
+ flush_node(b);
+ b = hpack(p, z, exactly);
+ }
+ }
+ w = width(b);
+ }
+ /* We try first to center the display without regard to the existence of
+ the equation number. If that would make it too close (where ``too close''
+ means that the space between display and equation number is less than the
+ width of the equation number), we either center it in the remaining space
+ or move it as far from the equation number as possible. The latter alternative
+ is taken only if the display begins with glue, since we assume that the
+ user put glue there to control the spacing precisely.
+ */
+ d = half(z - w);
+ if ((e > 0) && (d < 2 * e)) { /* too close */
+ d = half(z - w - e);
+ if (p != null)
+ if (!is_char_node(p))
+ if (type(p) == glue_node)
+ d = 0;
+ }
+
+ /* If the equation number is set on a line by itself, either before or
+ after the formula, we append an infinite penalty so that no page break will
+ separate the display from its number; and we use the same size and
+ displacement for all three potential lines of the display, even though
+ `\.{\\parshape}' may specify them differently.
+ */
+ tail_append(new_penalty(int_par(param_pre_display_penalty_code)));
+ if ((d + s <= pre_display_size) || l) { /* not enough clearance */
+ g1 = param_above_display_skip_code;
+ g2 = param_below_display_skip_code;
+ } else {
+ g1 = param_above_display_short_skip_code;
+ g2 = param_below_display_short_skip_code;
+ }
+ if (l && (e == 0)) { /* it follows that |type(a)=hlist_node| */
+ shift_amount(a) = s;
+ append_to_vlist(a);
+ tail_append(new_penalty(inf_penalty));
+ } else {
+ tail_append(new_param_glue(g1));
+ }
+
+ if (e != 0) {
+ r = new_kern(z - w - e - d);
+ if (l) {
+ vlink(a) = r;
+ vlink(r) = b;
+ b = a;
+ d = 0;
+ } else {
+ vlink(b) = r;
+ vlink(r) = a;
+ }
+ b = hpack(b, 0, additional);
+ }
+ shift_amount(b) = s + d;
+ append_to_vlist(b);
+
+ if ((a != null) && (e == 0) && !l) {
+ tail_append(new_penalty(inf_penalty));
+ shift_amount(a) = s + z - width(a);
+ append_to_vlist(a);
+ g2 = 0;
+ }
+ if (t != adjust_head) { /* migrating material comes after equation number */
+ vlink(tail) = vlink(adjust_head);
+ tail = t;
+ }
+ if (pre_t != pre_adjust_head) {
+ vlink(tail) = vlink(pre_adjust_head);
+ tail = pre_t;
+ }
+ tail_append(new_penalty(int_par(param_post_display_penalty_code)));
+ if (g2 > 0)
+ tail_append(new_param_glue(g2));
+
+ resume_after_display();
+}
+
+
+/*
+ When \.{\\halign} appears in a display, the alignment routines operate
+essentially as they do in vertical mode. Then the following program is
+activated, with |p| and |q| pointing to the beginning and end of the
+resulting list, and with |aux_save| holding the |prev_depth| value.
+*/
+
+
+void finish_display_alignment(pointer p, pointer q, memory_word aux_save)
+{
+ do_assignments();
+ if (cur_cmd != math_shift_cmd) {
+ char *hlp[] = {
+ "Displays can use special alignments (like \\eqalignno)",
+ "only if nothing but the alignment itself is between $$'s.",
+ NULL
+ };
+ back_error("Missing $$ inserted", hlp);
+ } else {
+ check_second_math_shift();
+ }
+ pop_nest();
+ tail_append(new_penalty(int_par(param_pre_display_penalty_code)));
+ tail_append(new_param_glue(param_above_display_skip_code));
+ vlink(tail) = p;
+ if (p != null)
+ tail = q;
+ tail_append(new_penalty(int_par(param_post_display_penalty_code)));
+ tail_append(new_param_glue(param_below_display_skip_code));
+ prev_depth = aux_save.cint;
+ resume_after_display();
+}
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.c b/Build/source/texk/web2c/luatexdir/tex/mlist.c
new file mode 100644
index 00000000000..51858c42899
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.c
@@ -0,0 +1,3864 @@
+/* mlist.c
+
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+#include "luatex-api.h"
+#include <ptexlib.h>
+
+#include "nodes.h"
+#include "commands.h"
+
+static const char _svn_version[] =
+ "$Id: mlist.c 2099 2009-03-24 10:35:01Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/mlist.c $";
+
+#define delimiter_factor int_par(param_delimiter_factor_code)
+#define delimiter_shortfall dimen_par(param_delimiter_shortfall_code)
+#define bin_op_penalty int_par(param_bin_op_penalty_code)
+#define rel_penalty int_par(param_rel_penalty_code)
+#define null_delimiter_space dimen_par(param_null_delimiter_space_code)
+#define script_space dimen_par(param_script_space_code)
+#define disable_lig int_par(param_disable_lig_code)
+#define disable_kern int_par(param_disable_kern_code)
+
+#define reset_attributes(p,newatt) do { \
+ delete_attribute_ref(node_attr(p)); \
+ node_attr(p) = newatt; \
+ if (newatt!=null) { \
+ assert(type(newatt)==attribute_list_node); \
+ add_node_attr_ref(node_attr(p)); \
+ } \
+ } while (0)
+
+
+#define DEFINE_MATH_PARAMETERS(A,B,C,D) do { \
+ if (B==text_size) { \
+ def_math_param(A, text_style, (C),D); \
+ def_math_param(A, cramped_text_style, (C),D); \
+ } else if (B==script_size) { \
+ def_math_param(A, script_style, (C),D); \
+ def_math_param(A, cramped_script_style, (C),D); \
+ } else if (B==script_script_size) { \
+ def_math_param(A, script_script_style, (C),D); \
+ def_math_param(A, cramped_script_script_style, (C),D); \
+ } \
+ } while (0)
+
+#define DEFINE_DMATH_PARAMETERS(A,B,C,D) do { \
+ if (B==text_size) { \
+ def_math_param(A, display_style,(C),D); \
+ def_math_param(A, cramped_display_style,(C),D); \
+ } \
+ } while (0)
+
+
+#define is_new_mathfont(A) (font_math_params(A)>0)
+#define is_old_mathfont(A,B) (font_math_params(A)==0 && font_params(A)>=(B))
+
+
+#define font_MATH_par(a,b) \
+ (font_math_params(a)>=b ? font_math_param(a,b) : undefined_math_parameter)
+
+
+/* here are the math parameters that are font-dependant */
+
+/*
+@ Before an mlist is converted to an hlist, \TeX\ makes sure that
+the fonts in family~2 have enough parameters to be math-symbol
+fonts, and that the fonts in family~3 have enough parameters to be
+math-extension fonts. The math-symbol parameters are referred to by using the
+following macros, which take a size code as their parameter; for example,
+|num1(cur_size)| gives the value of the |num1| parameter for the current size.
+@^parameters for symbols@>
+@^font parameters@>
+*/
+
+#define total_mathsy_params 22
+#define total_mathex_params 13
+
+#define mathsy(A,B) font_param(fam_fnt(2,A),B)
+#define math_x_height(A) mathsy(A,5) /* height of `\.x' */
+#define math_quad(A) mathsy(A,6) /* \.{18mu} */
+#define num1(A) mathsy(A,8) /* numerator shift-up in display styles */
+#define num2(A) mathsy(A,9) /* numerator shift-up in non-display, non-\.{\\atop} */
+#define num3(A) mathsy(A,10) /* numerator shift-up in non-display \.{\\atop} */
+#define denom1(A) mathsy(A,11) /* denominator shift-down in display styles */
+#define denom2(A) mathsy(A,12) /* denominator shift-down in non-display styles */
+#define sup1(A) mathsy(A,13) /* superscript shift-up in uncramped display style */
+#define sup2(A) mathsy(A,14) /* superscript shift-up in uncramped non-display */
+#define sup3(A) mathsy(A,15) /* superscript shift-up in cramped styles */
+#define sub1(A) mathsy(A,16) /* subscript shift-down if superscript is absent */
+#define sub2(A) mathsy(A,17) /* subscript shift-down if superscript is present */
+#define sup_drop(A) mathsy(A,18) /* superscript baseline below top of large box */
+#define sub_drop(A) mathsy(A,19) /* subscript baseline below bottom of large box */
+#define delim1(A) mathsy(A,20) /* size of \.{\\atopwithdelims} delimiters in display styles */
+#define delim2(A) mathsy(A,21) /* size of \.{\\atopwithdelims} delimiters in non-displays */
+#define axis_height(A) mathsy(A,22) /* height of fraction lines above the baseline */
+
+/*
+The math-extension parameters have similar macros, but the size code is
+omitted (since it is always |cur_size| when we refer to such parameters).
+@^parameters for symbols@>
+@^font parameters@>
+*/
+
+#define mathex(A,B) font_param(fam_fnt(3,A),B)
+#define default_rule_thickness(A) mathex(A,8) /* thickness of \.{\\over} bars */
+#define big_op_spacing1(A) mathex(A,9) /* minimum clearance above a displayed op */
+#define big_op_spacing2(A) mathex(A,10) /* minimum clearance below a displayed op */
+#define big_op_spacing3(A) mathex(A,11) /* minimum baselineskip above displayed op */
+#define big_op_spacing4(A) mathex(A,12) /* minimum baselineskip below displayed op */
+#define big_op_spacing5(A) mathex(A,13) /* padding above and below displayed limits */
+
+/* I made a bunch of extensions cf. the MATH table in OpenType, but some of
+the MathConstants values have no matching usage in \LuaTeX\ right now.
+
+ScriptPercentScaleDown,
+ScriptScriptPercentScaleDown:
+ These should be handled by the macro package, on the engine
+ side there are three separate fonts
+
+DelimitedSubFormulaMinHeight:
+ This is perhaps related to word's natural math input? I have
+ no idea what to do about it
+
+MathLeading:
+ LuaTeX does not currently handle multi-line displays, and
+ the parameter does not seem to make much sense elsewhere
+
+FlattenedAccentBaseHeight:
+ This is based on the 'flac' GSUB feature. It would not be hard
+ to support that, but proper math accent placements cf. MATH
+ needs support for MathTopAccentAttachment table to be
+ implemented first
+
+SkewedFractionHorizontalGap,
+SkewedFractionVerticalGap:
+ I am not sure it makes sense implementing skewed fractions,
+ so I would like to see an example first
+
+Also still TODO for OpenType Math:
+ * cutins (math_kern)
+ * extensible large operators
+ * bottom accents
+ * prescripts
+
+*/
+
+/* this is not really a math parameter at all */
+
+void math_param_error(char *param, int style)
+{
+ char s[256];
+ char *hlp[] = {
+ "Sorry, but I can't typeset math unless various parameters have",
+ "been set. This is normally done by loading special math fonts",
+ "into the math family slots. Your font set is lacking at least",
+ "the parameter mentioned earlier.",
+ NULL
+ };
+ snprintf(s, 256, "Math error: parameter \\Umath%s\\%sstyle is not set",
+ param, math_style_names[style]);
+ tex_error(s, hlp);
+ /* flush_math(); */
+ return;
+}
+
+
+static scaled accent_base_height(integer f)
+{
+ scaled a;
+ a = x_height(f);
+ if (a == 0 && is_new_mathfont(f)) {
+ a = font_MATH_par(f, AccentBaseHeight);
+ if (a == undefined_math_parameter)
+ a = 0;
+ }
+ return a;
+}
+
+/* the non-staticness of this function is for the benefit of |math.c| */
+
+scaled get_math_quad(int var)
+{
+ scaled a = get_math_param(math_param_quad, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("quad", var);
+ a = 0;
+ }
+ return a;
+}
+
+/* this parameter is different because it is called with a size
+ specifier instead of a style specifier. */
+
+static scaled math_axis(int b)
+{
+ scaled a;
+ int var;
+ if (b == script_size)
+ var = script_style;
+ else if (b == script_script_size)
+ var = script_script_style;
+ else
+ var = text_style;
+ a = get_math_param(math_param_axis, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("axis", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled minimum_operator_size(int var)
+{
+ scaled a = get_math_param(math_param_operator_size, var);
+ return a;
+}
+
+/* Old-style fonts do not define the radical_rule. This allows |make_radical| to select
+ * the backward compatibility code, and it means that we can't raise an error here.
+ */
+
+static scaled radical_rule(int var)
+{
+ scaled a = get_math_param(math_param_radical_rule, var);
+ return a;
+}
+
+static scaled radical_degree_before(int var)
+{
+ scaled a = get_math_param(math_param_radical_degree_before, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("radicaldegreebefore", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled connector_overlap_min(int var)
+{
+ scaled a = get_math_param(math_param_connector_overlap_min, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("connectoroverlapmin", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+static scaled radical_degree_after(int var)
+{
+ scaled a = get_math_param(math_param_radical_degree_after, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("radicaldegreeafter", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled radical_degree_raise(int var)
+{
+ scaled a = get_math_param(math_param_radical_degree_raise, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("radicaldegreeraise", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+/* now follow all the trivial functions for the math parameters */
+
+static scaled overbar_kern(int var)
+{
+ scaled a = get_math_param(math_param_overbar_kern, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("overbarkern", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled overbar_rule(int var)
+{
+ scaled a = get_math_param(math_param_overbar_rule, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("overbarrule", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled overbar_vgap(int var)
+{
+ scaled a = get_math_param(math_param_overbar_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("overbarvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled underbar_rule(int var)
+{
+ scaled a = get_math_param(math_param_underbar_rule, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("underbarrule", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled underbar_vgap(int var)
+{
+ scaled a = get_math_param(math_param_underbar_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("underbarvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled underbar_kern(int var)
+{
+ scaled a = get_math_param(math_param_underbar_kern, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("underbarkern", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled under_delimiter_vgap(int var)
+{
+ scaled a = get_math_param(math_param_under_delimiter_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("underdelimitervgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled under_delimiter_bgap(int var)
+{
+ scaled a = get_math_param(math_param_under_delimiter_bgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("underdelimiterbgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+static scaled over_delimiter_vgap(int var)
+{
+ scaled a = get_math_param(math_param_over_delimiter_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("overdelimitervgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled over_delimiter_bgap(int var)
+{
+ scaled a = get_math_param(math_param_over_delimiter_bgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("overdelimiterbgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+
+static scaled radical_vgap(int var)
+{
+ scaled a = get_math_param(math_param_radical_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("radicalvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+static scaled radical_kern(int var)
+{
+ scaled a = get_math_param(math_param_radical_kern, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("radicalkern", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled stack_vgap(int var)
+{
+ scaled a = get_math_param(math_param_stack_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("stackvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled stack_num_up(int var)
+{
+ scaled a = get_math_param(math_param_stack_num_up, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("stacknumup", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled stack_denom_down(int var)
+{
+ scaled a = get_math_param(math_param_stack_denom_down, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("stackdenomdown", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled fraction_rule(int var)
+{
+ scaled a = get_math_param(math_param_fraction_rule, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("fractionrule", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+static scaled fraction_num_vgap(int var)
+{
+ scaled a = get_math_param(math_param_fraction_num_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("fractionnumvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled fraction_denom_vgap(int var)
+{
+ scaled a = get_math_param(math_param_fraction_denom_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("fractiondenomvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled fraction_num_up(int var)
+{
+ scaled a = get_math_param(math_param_fraction_num_up, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("fractionnumup", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled fraction_denom_down(int var)
+{
+ scaled a = get_math_param(math_param_fraction_denom_down, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("fractiondenomdown", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled fraction_del_size(int var)
+{
+ scaled a = get_math_param(math_param_fraction_del_size, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("fractiondelsize", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled limit_above_vgap(int var)
+{
+ scaled a = get_math_param(math_param_limit_above_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("limitabovevgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled limit_above_bgap(int var)
+{
+ scaled a = get_math_param(math_param_limit_above_bgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("limitabovebgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled limit_above_kern(int var)
+{
+ scaled a = get_math_param(math_param_limit_above_kern, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("limitabovekern", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled limit_below_vgap(int var)
+{
+ scaled a = get_math_param(math_param_limit_below_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("limitbelowvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled limit_below_bgap(int var)
+{
+ scaled a = get_math_param(math_param_limit_below_bgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("limitbelowbgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled limit_below_kern(int var)
+{
+ scaled a = get_math_param(math_param_limit_below_kern, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("limitbelowkern", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+static scaled sub_shift_drop(int var)
+{
+ scaled a = get_math_param(math_param_sub_shift_drop, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("subshiftdrop", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled sup_shift_drop(int var)
+{
+ scaled a = get_math_param(math_param_sup_shift_drop, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("supshiftdrop", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled sub_shift_down(int var)
+{
+ scaled a = get_math_param(math_param_sub_shift_down, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("subshiftdown", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled sub_sup_shift_down(int var)
+{
+ scaled a = get_math_param(math_param_sub_sup_shift_down, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("subsupshiftdown", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled sub_top_max(int var)
+{
+ scaled a = get_math_param(math_param_sub_top_max, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("subtopmax", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled sup_shift_up(int var)
+{
+ scaled a = get_math_param(math_param_sup_shift_up, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("supshiftup", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled sup_bottom_min(int var)
+{
+ scaled a = get_math_param(math_param_sup_bottom_min, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("supbottommin", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled sup_sub_bottom_max(int var)
+{
+ scaled a = get_math_param(math_param_sup_sub_bottom_max, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("supsubbottommax", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled subsup_vgap(int var)
+{
+ scaled a = get_math_param(math_param_subsup_vgap, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("subsupvgap", var);
+ a = 0;
+ }
+ return a;
+}
+
+static scaled space_after_script(int var)
+{
+ scaled a = get_math_param(math_param_space_after_script, var);
+ if (a == undefined_math_parameter) {
+ math_param_error("spaceafterscript", var);
+ a = 0;
+ }
+ return a;
+}
+
+
+/* This function is no longer useful */
+
+boolean check_necessary_fonts(void)
+{
+ return false; /* temp */
+}
+
+void fixup_math_parameters(integer fam_id, integer size_id, integer f,
+ integer lvl)
+{
+ if (is_new_mathfont(f)) { /* fix all known parameters */
+
+ DEFINE_MATH_PARAMETERS(math_param_quad, size_id, font_size(f), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_quad, size_id, font_size(f), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_axis, size_id,
+ font_MATH_par(f, AxisHeight), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_axis, size_id,
+ font_MATH_par(f, AxisHeight), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_overbar_kern, size_id,
+ font_MATH_par(f, OverbarExtraAscender), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_overbar_kern, size_id,
+ font_MATH_par(f, OverbarExtraAscender), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_overbar_rule, size_id,
+ font_MATH_par(f, OverbarRuleThickness), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_overbar_rule, size_id,
+ font_MATH_par(f, OverbarRuleThickness), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_overbar_vgap, size_id,
+ font_MATH_par(f, OverbarVerticalGap), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_overbar_vgap, size_id,
+ font_MATH_par(f, OverbarVerticalGap), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_underbar_kern, size_id,
+ font_MATH_par(f, UnderbarExtraDescender), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_underbar_kern, size_id,
+ font_MATH_par(f, UnderbarExtraDescender), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_underbar_rule, size_id,
+ font_MATH_par(f, UnderbarRuleThickness), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_underbar_rule, size_id,
+ font_MATH_par(f, UnderbarRuleThickness), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_underbar_vgap, size_id,
+ font_MATH_par(f, UnderbarVerticalGap), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_underbar_vgap, size_id,
+ font_MATH_par(f, UnderbarVerticalGap), lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_under_delimiter_vgap, size_id,
+ font_MATH_par(f, StretchStackGapAboveMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_under_delimiter_vgap, size_id,
+ font_MATH_par(f, StretchStackGapAboveMin), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_under_delimiter_bgap, size_id,
+ font_MATH_par(f, StretchStackBottomShiftDown),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_under_delimiter_bgap, size_id,
+ font_MATH_par(f, StretchStackBottomShiftDown),
+ lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_over_delimiter_vgap, size_id,
+ font_MATH_par(f, StretchStackGapBelowMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_over_delimiter_vgap, size_id,
+ font_MATH_par(f, StretchStackGapBelowMin), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_over_delimiter_bgap, size_id,
+ font_MATH_par(f, StretchStackTopShiftUp), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_over_delimiter_bgap, size_id,
+ font_MATH_par(f, StretchStackTopShiftUp), lvl);
+
+
+ DEFINE_MATH_PARAMETERS(math_param_stack_num_up, size_id,
+ font_MATH_par(f, StackTopShiftUp), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_stack_num_up, size_id,
+ font_MATH_par(f, StackTopDisplayStyleShiftUp),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_stack_denom_down, size_id,
+ font_MATH_par(f, StackBottomShiftDown), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_stack_denom_down, size_id,
+ font_MATH_par(f,
+ StackBottomDisplayStyleShiftDown),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_stack_vgap, size_id,
+ font_MATH_par(f, StackGapMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_stack_vgap, size_id,
+ font_MATH_par(f, StackDisplayStyleGapMin), lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_radical_kern, size_id,
+ font_MATH_par(f, RadicalExtraAscender), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_kern, size_id,
+ font_MATH_par(f, RadicalExtraAscender), lvl);
+
+ DEFINE_DMATH_PARAMETERS(math_param_operator_size, size_id,
+ font_MATH_par(f, DisplayOperatorMinHeight),
+ lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_radical_rule, size_id,
+ font_MATH_par(f, RadicalRuleThickness), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_rule, size_id,
+ font_MATH_par(f, RadicalRuleThickness), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_radical_vgap, size_id,
+ font_MATH_par(f, RadicalVerticalGap), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_vgap, size_id,
+ font_MATH_par(f,
+ RadicalDisplayStyleVerticalGap),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_radical_degree_before, size_id,
+ font_MATH_par(f, RadicalKernBeforeDegree), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_degree_before, size_id,
+ font_MATH_par(f, RadicalKernBeforeDegree), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_radical_degree_after, size_id,
+ font_MATH_par(f, RadicalKernAfterDegree), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_degree_after, size_id,
+ font_MATH_par(f, RadicalKernAfterDegree), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_radical_degree_raise, size_id,
+ font_MATH_par(f,
+ RadicalDegreeBottomRaisePercent),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_degree_raise, size_id,
+ font_MATH_par(f,
+ RadicalDegreeBottomRaisePercent),
+ lvl);
+ if (size_id == text_size) {
+ def_math_param(math_param_sup_shift_up, display_style,
+ font_MATH_par(f, SuperscriptShiftUp), lvl);
+ def_math_param(math_param_sup_shift_up, cramped_display_style,
+ font_MATH_par(f, SuperscriptShiftUpCramped), lvl);
+ def_math_param(math_param_sup_shift_up, text_style,
+ font_MATH_par(f, SuperscriptShiftUp), lvl);
+ def_math_param(math_param_sup_shift_up, cramped_text_style,
+ font_MATH_par(f, SuperscriptShiftUpCramped), lvl);
+ } else if (size_id == script_size) {
+ def_math_param(math_param_sup_shift_up, script_style,
+ font_MATH_par(f, SuperscriptShiftUp), lvl);
+ def_math_param(math_param_sup_shift_up, cramped_script_style,
+ font_MATH_par(f, SuperscriptShiftUpCramped), lvl);
+ } else if (size_id == script_script_size) {
+ def_math_param(math_param_sup_shift_up, script_script_style,
+ font_MATH_par(f, SuperscriptShiftUp), lvl);
+ def_math_param(math_param_sup_shift_up, cramped_script_script_style,
+ font_MATH_par(f, SuperscriptShiftUpCramped), lvl);
+ }
+
+ DEFINE_MATH_PARAMETERS(math_param_sub_shift_drop, size_id,
+ font_MATH_par(f, SubscriptBaselineDropMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sub_shift_drop, size_id,
+ font_MATH_par(f, SubscriptBaselineDropMin),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sup_shift_drop, size_id,
+ font_MATH_par(f, SuperscriptBaselineDropMax),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sup_shift_drop, size_id,
+ font_MATH_par(f, SuperscriptBaselineDropMax),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sub_shift_down, size_id,
+ font_MATH_par(f, SubscriptShiftDown), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sub_shift_down, size_id,
+ font_MATH_par(f, SubscriptShiftDown), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sub_sup_shift_down, size_id,
+ font_MATH_par(f, SubscriptShiftDown), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sub_sup_shift_down, size_id,
+ font_MATH_par(f, SubscriptShiftDown), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sub_top_max, size_id,
+ font_MATH_par(f, SubscriptTopMax), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sub_top_max, size_id,
+ font_MATH_par(f, SubscriptTopMax), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sup_bottom_min, size_id,
+ font_MATH_par(f, SuperscriptBottomMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sup_bottom_min, size_id,
+ font_MATH_par(f, SuperscriptBottomMin), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sup_sub_bottom_max, size_id,
+ font_MATH_par(f,
+ SuperscriptBottomMaxWithSubscript),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sup_sub_bottom_max, size_id,
+ font_MATH_par(f,
+ SuperscriptBottomMaxWithSubscript),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_subsup_vgap, size_id,
+ font_MATH_par(f, SubSuperscriptGapMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_subsup_vgap, size_id,
+ font_MATH_par(f, SubSuperscriptGapMin), lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_limit_above_vgap, size_id,
+ font_MATH_par(f, UpperLimitGapMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_above_vgap, size_id,
+ font_MATH_par(f, UpperLimitGapMin), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_above_bgap, size_id,
+ font_MATH_par(f, UpperLimitBaselineRiseMin),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_above_bgap, size_id,
+ font_MATH_par(f, UpperLimitBaselineRiseMin),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_above_kern, size_id, 0, lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_above_kern, size_id, 0, lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_below_vgap, size_id,
+ font_MATH_par(f, LowerLimitGapMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_below_vgap, size_id,
+ font_MATH_par(f, LowerLimitGapMin), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_below_bgap, size_id,
+ font_MATH_par(f, LowerLimitBaselineDropMin),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_below_bgap, size_id,
+ font_MATH_par(f, LowerLimitBaselineDropMin),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_below_kern, size_id, 0, lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_below_kern, size_id, 0, lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_fraction_rule, size_id,
+ font_MATH_par(f, FractionRuleThickness), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_rule, size_id,
+ font_MATH_par(f, FractionRuleThickness), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_num_vgap, size_id,
+ font_MATH_par(f, FractionNumeratorGapMin), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_num_vgap, size_id,
+ font_MATH_par(f,
+ FractionNumeratorDisplayStyleGapMin),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_num_up, size_id,
+ font_MATH_par(f, FractionNumeratorShiftUp), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_num_up, size_id,
+ font_MATH_par(f,
+ FractionNumeratorDisplayStyleShiftUp),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_denom_vgap, size_id,
+ font_MATH_par(f, FractionDenominatorGapMin),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_denom_vgap, size_id,
+ font_MATH_par(f,
+ FractionDenominatorDisplayStyleGapMin),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_denom_down, size_id,
+ font_MATH_par(f, FractionDenominatorShiftDown),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_denom_down, size_id,
+ font_MATH_par(f,
+ FractionDenominatorDisplayStyleShiftDown),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_del_size, size_id, 0, lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_del_size, size_id, 0, lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_space_after_script, size_id,
+ font_MATH_par(f, SpaceAfterScript), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_space_after_script, size_id,
+ font_MATH_par(f, SpaceAfterScript), lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_connector_overlap_min, size_id,
+ font_MATH_par(f, MinConnectorOverlap), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_connector_overlap_min, size_id,
+ font_MATH_par(f, MinConnectorOverlap), lvl);
+
+
+ } else if (fam_id == 2 && is_old_mathfont(f, total_mathsy_params)) {
+ /* fix old-style |sy| parameters */
+ DEFINE_MATH_PARAMETERS(math_param_quad, size_id, math_quad(size_id),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_quad, size_id, math_quad(size_id),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_axis, size_id, axis_height(size_id),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_axis, size_id, axis_height(size_id),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_stack_num_up, size_id, num3(size_id),
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_stack_num_up, size_id, num1(size_id),
+ lvl);
+ DEFINE_MATH_PARAMETERS(math_param_stack_denom_down, size_id,
+ denom2(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_stack_denom_down, size_id,
+ denom1(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_num_up, size_id,
+ num2(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_num_up, size_id,
+ num1(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_denom_down, size_id,
+ denom2(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_denom_down, size_id,
+ denom1(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_del_size, size_id,
+ delim2(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_del_size, size_id,
+ delim1(size_id), lvl);
+ if (size_id == text_size) {
+ def_math_param(math_param_sup_shift_up, display_style,
+ sup1(size_id), lvl);
+ def_math_param(math_param_sup_shift_up, cramped_display_style,
+ sup3(size_id), lvl);
+ def_math_param(math_param_sup_shift_up, text_style, sup2(size_id),
+ lvl);
+ def_math_param(math_param_sup_shift_up, cramped_text_style,
+ sup3(size_id), lvl);
+ } else if (size_id == script_size) {
+ def_math_param(math_param_sub_shift_drop, display_style,
+ sub_drop(size_id), lvl);
+ def_math_param(math_param_sub_shift_drop, cramped_display_style,
+ sub_drop(size_id), lvl);
+ def_math_param(math_param_sub_shift_drop, text_style,
+ sub_drop(size_id), lvl);
+ def_math_param(math_param_sub_shift_drop, cramped_text_style,
+ sub_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop, display_style,
+ sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop, cramped_display_style,
+ sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop, text_style,
+ sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop, cramped_text_style,
+ sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_up, script_style, sup2(size_id),
+ lvl);
+ def_math_param(math_param_sup_shift_up, cramped_script_style,
+ sup3(size_id), lvl);
+ } else if (size_id == script_script_size) {
+ def_math_param(math_param_sub_shift_drop, script_style,
+ sub_drop(size_id), lvl);
+ def_math_param(math_param_sub_shift_drop, cramped_script_style,
+ sub_drop(size_id), lvl);
+ def_math_param(math_param_sub_shift_drop, script_script_style,
+ sub_drop(size_id), lvl);
+ def_math_param(math_param_sub_shift_drop,
+ cramped_script_script_style, sub_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop, script_style,
+ sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop, cramped_script_style,
+ sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop, script_script_style,
+ sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_drop,
+ cramped_script_script_style, sup_drop(size_id), lvl);
+ def_math_param(math_param_sup_shift_up, script_script_style,
+ sup2(size_id), lvl);
+ def_math_param(math_param_sup_shift_up, cramped_script_script_style,
+ sup3(size_id), lvl);
+ }
+ DEFINE_MATH_PARAMETERS(math_param_sub_shift_down, size_id,
+ sub1(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sub_shift_down, size_id,
+ sub1(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sub_sup_shift_down, size_id,
+ sub2(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sub_sup_shift_down, size_id,
+ sub2(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sub_top_max, size_id,
+ (abs(math_x_height(size_id) * 4) / 5), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sub_top_max, size_id,
+ (abs(math_x_height(size_id) * 4) / 5), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sup_bottom_min, size_id,
+ (abs(math_x_height(size_id)) / 4), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sup_bottom_min, size_id,
+ (abs(math_x_height(size_id)) / 4), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_sup_sub_bottom_max, size_id,
+ (abs(math_x_height(size_id) * 4) / 5), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_sup_sub_bottom_max, size_id,
+ (abs(math_x_height(size_id) * 4) / 5), lvl);
+
+ } else if (fam_id == 3 && is_old_mathfont(f, total_mathex_params)) {
+ /* fix old-style |ex| parameters */
+ DEFINE_MATH_PARAMETERS(math_param_overbar_kern, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_overbar_rule, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_overbar_vgap, size_id,
+ 3 * default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_overbar_kern, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_overbar_rule, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_overbar_vgap, size_id,
+ 3 * default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_underbar_kern, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_underbar_rule, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_underbar_vgap, size_id,
+ 3 * default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_underbar_kern, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_underbar_rule, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_underbar_vgap, size_id,
+ 3 * default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_radical_kern, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_kern, size_id,
+ default_rule_thickness(size_id), lvl);
+ /* The display-size radical_vgap is done in |finalize_math_pamaters| because it needs values from both the
+ sy and the ex font. */
+ DEFINE_MATH_PARAMETERS(math_param_radical_vgap, size_id,
+ (default_rule_thickness(size_id) +
+ (abs(default_rule_thickness(size_id)) / 4)),
+ lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_stack_vgap, size_id,
+ 3 * default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_stack_vgap, size_id,
+ 7 * default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_rule, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_rule, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_num_vgap, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_num_vgap, size_id,
+ 3 * default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_fraction_denom_vgap, size_id,
+ default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_fraction_denom_vgap, size_id,
+ 3 * default_rule_thickness(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_above_vgap, size_id,
+ big_op_spacing1(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_above_vgap, size_id,
+ big_op_spacing1(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_above_bgap, size_id,
+ big_op_spacing3(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_above_bgap, size_id,
+ big_op_spacing3(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_above_kern, size_id,
+ big_op_spacing5(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_above_kern, size_id,
+ big_op_spacing5(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_below_vgap, size_id,
+ big_op_spacing2(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_below_vgap, size_id,
+ big_op_spacing2(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_below_bgap, size_id,
+ big_op_spacing4(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_below_bgap, size_id,
+ big_op_spacing4(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_limit_below_kern, size_id,
+ big_op_spacing5(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_limit_below_kern, size_id,
+ big_op_spacing5(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_subsup_vgap, size_id,
+ 4 * default_rule_thickness(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_subsup_vgap, size_id,
+ 4 * default_rule_thickness(size_id), lvl);
+ /* All of the |space_after_script|s are done in finalize_math_parameters because the
+ \.{\\scriptspace} may have been altered by the user
+ */
+ DEFINE_MATH_PARAMETERS(math_param_connector_overlap_min, size_id, 0,
+ lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_connector_overlap_min, size_id, 0,
+ lvl);
+
+ DEFINE_MATH_PARAMETERS(math_param_under_delimiter_vgap, size_id,
+ big_op_spacing2(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_under_delimiter_vgap, size_id,
+ big_op_spacing2(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_under_delimiter_bgap, size_id,
+ big_op_spacing4(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_under_delimiter_bgap, size_id,
+ big_op_spacing4(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_over_delimiter_vgap, size_id,
+ big_op_spacing1(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_over_delimiter_vgap, size_id,
+ big_op_spacing1(size_id), lvl);
+ DEFINE_MATH_PARAMETERS(math_param_over_delimiter_bgap, size_id,
+ big_op_spacing3(size_id), lvl);
+ DEFINE_DMATH_PARAMETERS(math_param_over_delimiter_bgap, size_id,
+ big_op_spacing3(size_id), lvl);
+
+
+ }
+}
+
+/* this needs to be called just at the start of |mlist_to_hlist| */
+void finalize_math_parameters(void)
+{
+ integer saved_trace = int_par(param_tracing_assigns_code);
+ int_par(param_tracing_assigns_code) = 0;
+ if (get_math_param(math_param_space_after_script, display_style) ==
+ undefined_math_parameter) {
+ def_math_param(math_param_space_after_script, display_style,
+ script_space, cur_level);
+ def_math_param(math_param_space_after_script, text_style, script_space,
+ cur_level);
+ def_math_param(math_param_space_after_script, script_style,
+ script_space, cur_level);
+ def_math_param(math_param_space_after_script, script_script_style,
+ script_space, cur_level);
+ def_math_param(math_param_space_after_script, cramped_display_style,
+ script_space, cur_level);
+ def_math_param(math_param_space_after_script, cramped_text_style,
+ script_space, cur_level);
+ def_math_param(math_param_space_after_script, cramped_script_style,
+ script_space, cur_level);
+ def_math_param(math_param_space_after_script,
+ cramped_script_script_style, script_space, cur_level);
+ }
+ if (get_math_param(math_param_radical_vgap, display_style) ==
+ undefined_math_parameter) {
+ def_math_param(math_param_radical_vgap, display_style,
+ (default_rule_thickness(text_size) +
+ (abs(math_x_height(text_size)) / 4)), cur_level);
+ def_math_param(math_param_radical_vgap, cramped_display_style,
+ (default_rule_thickness(text_size) +
+ (abs(math_x_height(text_size)) / 4)), cur_level);
+ }
+ if (get_math_param(math_param_radical_degree_raise, display_style) ==
+ undefined_math_parameter) {
+ DEFINE_MATH_PARAMETERS(math_param_radical_degree_raise,
+ script_script_size, 60, cur_level);
+ DEFINE_MATH_PARAMETERS(math_param_radical_degree_raise, script_size, 60,
+ cur_level);
+ DEFINE_MATH_PARAMETERS(math_param_radical_degree_raise, text_size, 60,
+ cur_level);
+ DEFINE_DMATH_PARAMETERS(math_param_radical_degree_raise, text_size, 60,
+ cur_level);
+ }
+ if (get_math_param(math_param_radical_degree_before, display_style) ==
+ undefined_math_parameter) {
+ def_math_param(math_param_radical_degree_before,
+ cramped_script_script_style,
+ xn_over_d(get_math_quad(cramped_script_script_style), 5,
+ 18), cur_level);
+ def_math_param(math_param_radical_degree_before, script_script_style,
+ xn_over_d(get_math_quad(script_script_style), 5, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_before, cramped_script_style,
+ xn_over_d(get_math_quad(cramped_script_style), 5, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_before, script_style,
+ xn_over_d(get_math_quad(script_style), 5, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_before, cramped_text_style,
+ xn_over_d(get_math_quad(cramped_text_style), 5, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_before, text_style,
+ xn_over_d(get_math_quad(text_style), 5, 18), cur_level);
+ def_math_param(math_param_radical_degree_before, cramped_display_style,
+ xn_over_d(get_math_quad(cramped_display_style), 5, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_before, display_style,
+ xn_over_d(get_math_quad(display_style), 5, 18),
+ cur_level);
+ }
+
+ if (get_math_param(math_param_radical_degree_after, display_style) ==
+ undefined_math_parameter) {
+ def_math_param(math_param_radical_degree_after,
+ cramped_script_script_style,
+ -xn_over_d(get_math_quad(cramped_script_script_style),
+ 10, 18), cur_level);
+ def_math_param(math_param_radical_degree_after, script_script_style,
+ -xn_over_d(get_math_quad(script_script_style), 10, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_after, cramped_script_style,
+ -xn_over_d(get_math_quad(cramped_script_style), 10, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_after, script_style,
+ -xn_over_d(get_math_quad(script_style), 10, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_after, cramped_text_style,
+ -xn_over_d(get_math_quad(cramped_text_style), 10, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_after, text_style,
+ -xn_over_d(get_math_quad(text_style), 10, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_after, cramped_display_style,
+ -xn_over_d(get_math_quad(cramped_display_style), 10, 18),
+ cur_level);
+ def_math_param(math_param_radical_degree_after, display_style,
+ -xn_over_d(get_math_quad(display_style), 10, 18),
+ cur_level);
+ }
+ int_par(param_tracing_assigns_code) = saved_trace;
+
+}
+
+
+/*
+In order to convert mlists to hlists, i.e., noads to nodes, we need several
+subroutines that are conveniently dealt with now.
+
+Let us first introduce the macros that make it easy to get at the parameters and
+other font information. A size code, which is a multiple of 256, is added to a
+family number to get an index into the table of internal font numbers
+for each combination of family and size. (Be alert: Size codes get
+larger as the type gets smaller.)
+*/
+
+
+char *math_size_string(integer s)
+{
+ if (s == text_size)
+ return "textfont";
+ else if (s == script_size)
+ return "scriptfont";
+ else
+ return "scriptscriptfont";
+}
+
+void print_size(integer s)
+{
+ if (s == text_size)
+ tprint_esc("textfont");
+ else if (s == script_size)
+ tprint_esc("scriptfont");
+ else
+ tprint_esc("scriptscriptfont");
+}
+
+
+/*
+ @ When the style changes, the following piece of program computes associated
+ information:
+*/
+
+#define setup_cur_size_and_mu() do { \
+ if (cur_style==script_style || \
+ cur_style==cramped_script_style) \
+ cur_size=script_size; \
+ else if (cur_style==script_script_style || \
+ cur_style==cramped_script_script_style) \
+ cur_size=script_script_size; \
+ else cur_size=text_size; \
+ cur_mu=x_over_n(get_math_quad(cur_size),18); \
+ } while (0)
+
+/* a simple routine that creates a flat copy of a nucleus */
+
+pointer math_clone(pointer q)
+{
+ pointer x;
+ if (q == null)
+ return null;
+ x = new_node(type(q), 0);
+ reset_attributes(x, node_attr(q));
+ if (type(q) == math_char_node) {
+ math_fam(x) = math_fam(q);
+ math_character(x) = math_character(q);
+ } else {
+ math_list(x) = math_list(q);
+ }
+ return x;
+}
+
+
+
+
+/*
+ @ Here is a function that returns a pointer to a rule node having a given
+ thickness |t|. The rule will extend horizontally to the boundary of the vlist
+ that eventually contains it.
+*/
+
+pointer do_fraction_rule(scaled t, pointer att)
+{
+ pointer p; /* the new node */
+ p = new_rule();
+ rule_dir(p) = math_direction;
+ height(p) = t;
+ depth(p) = 0;
+ reset_attributes(p, att);
+ return p;
+}
+
+/*
+ @ The |overbar| function returns a pointer to a vlist box that consists of
+ a given box |b|, above which has been placed a kern of height |k| under a
+ fraction rule of thickness |t| under additional space of height |ht|.
+*/
+
+pointer overbar(pointer b, scaled k, scaled t, scaled ht, pointer att)
+{
+ pointer p, q; /* nodes being constructed */
+ p = new_kern(k);
+ vlink(p) = b;
+ reset_attributes(p, att);
+ q = do_fraction_rule(t, att);
+ vlink(q) = p;
+ p = new_kern(ht);
+ reset_attributes(p, att);
+ vlink(p) = q;
+ pack_direction = math_direction;
+ q = vpackage(p, 0, additional, max_dimen);
+ reset_attributes(q, att);
+ return q;
+}
+
+/*
+ Here is a subroutine that creates a new box, whose list contains a
+ single character, and whose width includes the italic correction for
+ that character. The height or depth of the box will be negative, if
+ the height or depth of the character is negative; thus, this routine
+ may deliver a slightly different result than |hpack| would produce.
+*/
+
+static pointer char_box(internal_font_number f, integer c, pointer bb)
+{
+ pointer b, p; /* the new box and its character node */
+ b = new_null_box();
+ width(b) = char_width(f, c) + char_italic(f, c);
+ height(b) = char_height(f, c);
+ depth(b) = char_depth(f, c);
+ reset_attributes(b, bb);
+ p = new_char(f, c);
+ reset_attributes(p, bb);
+ list_ptr(b) = p;
+ return b;
+}
+
+/*
+ Another handy subroutine computes the height plus depth of
+ a given character:
+*/
+
+scaled height_plus_depth(internal_font_number f, integer c)
+{
+ return (char_height(f, c) + char_depth(f, c));
+}
+
+
+/*
+ When we build an extensible character, it's handy to have the
+ following subroutine, which puts a given character on top
+ of the characters already in box |b|:
+*/
+
+scaled stack_into_box(pointer b, internal_font_number f, integer c)
+{
+ pointer p; /* new node placed into |b| */
+ p = char_box(f, c, node_attr(b));
+ vlink(p) = list_ptr(b);
+ list_ptr(b) = p;
+ height(b) = height(p);
+ return height_plus_depth(f, c);
+}
+
+
+scaled stack_into_hbox(pointer b, internal_font_number f, integer c)
+{
+ pointer p, q; /* new node placed into |b| */
+ p = char_box(f, c, node_attr(b));
+ q = list_ptr(b);
+ if (q == null) {
+ list_ptr(b) = p;
+ } else {
+ while (vlink(q) != null)
+ q = vlink(q);
+ vlink(q) = p;
+ }
+ if (height(b) < height(p))
+ height(b) = height(p);
+ if (depth(b) < depth(p))
+ depth(b) = depth(p);
+ return char_width(f, c);
+}
+
+
+
+void add_delim_kern(pointer b, scaled s)
+{
+ pointer p; /* new node placed into |b| */
+ p = new_kern(s);
+ reset_attributes(p, node_attr(b));
+ vlink(p) = list_ptr(b);
+ list_ptr(b) = p;
+}
+
+void add_delim_hkern(pointer b, scaled s)
+{
+ pointer p, q; /* new node placed into |b| */
+ p = new_kern(s);
+ reset_attributes(p, node_attr(b));
+ q = list_ptr(b);
+ if (q == null) {
+ list_ptr(b) = p;
+ } else {
+ while (vlink(q) != null)
+ q = vlink(q);
+ vlink(q) = p;
+ }
+}
+
+
+
+/* */
+
+pointer get_delim_box(extinfo * ext, internal_font_number f, scaled v,
+ pointer att, int boxtype)
+{
+ pointer b;
+ extinfo *cur;
+ scaled min_overlap, prev_overlap;
+ scaled b_max; /* natural (maximum) height of the stack */
+ scaled s_max; /* amount of possible shrink in the stack */
+ scaled a, wd, ht, dp, last_ht;
+ integer cc; /* a temporary character code for extensibles */
+ integer i; /* a temporary counter number of extensible pieces */
+ int with_extenders;
+ int num_extenders, num_normal, num_total;
+ scaled c, d, u;
+ scaled *max_shrinks = NULL;
+ assert(ext != NULL);
+ b = new_null_box();
+ type(b) = boxtype;
+ reset_attributes(b, att);
+ min_overlap = connector_overlap_min(cur_style);
+ assert(min_overlap >= 0);
+ with_extenders = 0;
+ num_extenders = 0;
+ num_normal = 0;
+ cur = ext;
+ while (cur != NULL) {
+ if (!char_exists(f, cur->glyph)) {
+ char *hlp[] = {
+ "Each glyph part in an extensible item should exist in the font.",
+ "I will give up trying to find a suitable size for now. Fix your font!",
+ NULL
+ };
+ tex_error("Variant part doesn't exist.", hlp);
+ width(b) = null_delimiter_space;
+ return b;
+ }
+ if (cur->extender > 0)
+ num_extenders++;
+ else
+ num_normal++;
+ /* no negative overlaps or advances are allowed */
+ if (cur->start_overlap < 0 || cur->end_overlap < 0 || cur->advance < 0) {
+ char *hlp[] = {
+ "All measurements in extensible items should be positive.",
+ "To get around this problem, I have changed the font metrics.",
+ "Fix your font!",
+ NULL
+ };
+ tex_error("Extensible recipe has negative fields.", hlp);
+ if (cur->start_overlap < 0)
+ cur->start_overlap = 0;
+ if (cur->end_overlap < 0)
+ cur->end_overlap = 0;
+ if (cur->advance < 0)
+ cur->advance = 0;
+ }
+ cur = cur->next;
+ }
+ if (num_normal == 0) {
+ char *hlp[] = {
+ "Each extensible recipe should have at least one non-repeatable part.",
+ "To get around this problem, I have changed the first part to be",
+ "non-repeatable. Fix your font!",
+ NULL
+ };
+ tex_error("Extensible recipe has no fixed parts.", hlp);
+ ext->extender = 0;
+ num_normal = 1;
+ num_extenders--;
+ }
+ /* |ext| holds a linked list of numerous items that may or may not be
+ repeatable. For the total height, we have to figure out how many items
+ are needed to create a stack of at least |v|.
+ The next |while| loop does that. It has two goals: it finds out
+ the natural height |b_max| of the all the parts needed to reach
+ at least |v|, and it sets |with_extenders| to the number of times
+ each of the repeatable items in |ext| has to be repeated to reach
+ that height.
+ */
+ cur = ext;
+ prev_overlap = -1;
+ b_max = 0;
+ s_max = 0;
+ for (cur = ext; cur != NULL; cur = cur->next) {
+ /* substract width of the current overlap if this is not the first */
+ if (cur->extender == 0) { /* not an extender */
+ a = cur->advance;
+ if (a == 0) {
+ if (boxtype == vlist_node)
+ a = height_plus_depth(f, cur->glyph); /* for tfm fonts */
+ else
+ a = char_width(f, cur->glyph); /* for tfm fonts */
+ assert(a > 0);
+ }
+ b_max += a; /* add the advance value */
+ if (prev_overlap >= 0) {
+ c = min_overlap;
+ if (c >= a)
+ c = (a - 1);
+ b_max -= c;
+ d = c;
+ if (prev_overlap > cur->start_overlap) {
+ if (cur->start_overlap > d)
+ d = cur->start_overlap;
+ } else {
+ if (prev_overlap > d)
+ d = prev_overlap;
+ }
+ s_max += (d - c);
+ }
+ prev_overlap = cur->end_overlap;
+ }
+ }
+ if (b_max < v && num_extenders > 0) { /* not large enough, but can grow */
+ RETRY:
+ with_extenders++;
+ cur = ext;
+ prev_overlap = -1;
+ b_max = 0;
+ s_max = 0;
+ i = with_extenders;
+ while (cur != NULL) {
+ a = cur->advance;
+ if (a == 0) {
+ if (boxtype == vlist_node)
+ a = height_plus_depth(f, cur->glyph); /* for tfm fonts */
+ else
+ a = char_width(f, cur->glyph);
+ assert(a >= 0);
+ }
+ /* substract width of the current overlap if this is not the first */
+ if (prev_overlap >= 0) {
+ c = min_overlap;
+ if (c >= a)
+ c = (a - 1);
+ b_max -= c;
+ d = c;
+ if (prev_overlap > cur->start_overlap) {
+ if (cur->start_overlap > d)
+ d = cur->start_overlap;
+ } else {
+ if (prev_overlap > d)
+ d = prev_overlap;
+ }
+ s_max += (d - c);
+ }
+ if (cur->extender == 0) { /* not an extender */
+ i = 0;
+ prev_overlap = cur->end_overlap;
+ } else {
+ i--;
+ prev_overlap = cur->end_overlap;
+ }
+ b_max += a; /* add the advance value */
+ if (i <= 0) { /* can be $-1$ if the first glyph is an extender */
+ cur = cur->next;
+ i = with_extenders;
+ }
+ }
+ if (b_max < v) { /* not large enough, but can grow */
+ goto RETRY;
+ }
+ }
+ /* now |b_max| is the natural height or width, |with_extenders| holds
+ the count of each extender that is needed, and the maximum
+ amount the stack can shrink by is |s_max|.
+
+ |(b_max-v)| is the total amount of extra height or width that needs
+ to be gotten rid of, and the total number of items in the stack is
+ |(num_extenders*with_extenders)+num_normal|
+ */
+ /* create an array of maximum shrinks and fill it */
+ num_total = ((num_extenders * with_extenders) + num_normal);
+ if (num_total == 1) {
+ /* weird, but could happen */
+ cc = ext->glyph;
+ (void) stack_into_box(b, f, cc);
+ width(b) = char_width(f, cc);
+ height(b) = char_height(f, cc);
+ depth(b) = char_depth(f, cc);
+ return b;
+ }
+ max_shrinks = xcalloc(num_total, sizeof(scaled));
+ cur = ext;
+ prev_overlap = -1;
+ c = 0;
+ i = 0;
+ REDO:
+ while (cur != NULL) {
+ if (cur->extender == 0 || with_extenders) {
+ if (prev_overlap >= 0) {
+ d = prev_overlap;
+ if (d > cur->start_overlap)
+ d = cur->start_overlap;
+ if (d < min_overlap)
+ d = min_overlap;
+ max_shrinks[c++] = (d - min_overlap);
+ }
+ prev_overlap = cur->end_overlap;
+ if (cur->extender == 0) {
+ /* simple char, just reset |i| */
+ i = 0;
+ } else {
+ if (i == 0) { /* first in loop */
+ i = with_extenders;
+ if (i != 1)
+ goto REDO;
+ } else if (i == 1) {
+ /* done */
+ i = 0;
+ } else {
+ i--;
+ if (i != 1)
+ goto REDO;
+ }
+ }
+ }
+ cur = cur->next;
+ }
+ /* now create the box contents */
+ cur = ext;
+ wd = 0;
+ d = 0;
+ ht = 0;
+ dp = 0;
+ if (boxtype == vlist_node) {
+ while (cur != NULL) {
+ cc = cur->glyph;
+ if (char_width(f, cc) > wd)
+ wd = char_width(f, cc);
+ if (cur->extender > 0) {
+ i = with_extenders;
+ while (i > 0) {
+ ht += stack_into_box(b, f, cc);
+ if (d < (num_total - 1)) {
+ u = min_overlap;
+ if (s_max != 0)
+ u += xn_over_d(max_shrinks[d], (b_max - v), s_max);
+ add_delim_kern(b, -u);
+ ht -= u;
+ }
+ d++;
+ i--;
+ }
+ } else {
+ ht += stack_into_box(b, f, cc);
+ if (d < (num_total - 1)) {
+ u = min_overlap;
+ if (s_max != 0)
+ u += xn_over_d(max_shrinks[d], (b_max - v), s_max);
+ add_delim_kern(b, -u);
+ ht -= u;
+ }
+ d++;
+ }
+ cur = cur->next;
+ }
+ xfree(max_shrinks);
+ /* it is important to use |ht| here instead of |v| because if there
+ was not enough shrink to get the correct size, it has to be centered
+ based on its actual height. That actual height is not the same as
+ |b_max| either because |min_overlap| can have ben set by the user
+ outside of the font's control.
+ */
+ last_ht = 0;
+ height(b) = ht;
+ depth(b) = 0;
+ /* the next correction is needed for radicals */
+ if (list_ptr(b) != null && type(list_ptr(b)) == hlist_node && list_ptr(list_ptr(b)) != null && type(list_ptr(list_ptr(b))) == glyph_node) { /* and it should be */
+ last_ht =
+ char_height(font(list_ptr(list_ptr(b))),
+ character(list_ptr(list_ptr(b))));
+ height(b) = last_ht;
+ depth(b) = ht - last_ht;
+ }
+ /*
+ fprintf (stdout,"v=%f,b_max=%f,ht=%f,n=%d\n", (float)v/65536.0,
+ (float)b_max/65536.0,(float)height(b)/65536.0,num_total);
+ */
+ width(b) = wd;
+ } else {
+ /* horizontal version */
+
+ while (cur != NULL) {
+ cc = cur->glyph;
+ if (char_height(f, cc) > ht)
+ ht = char_height(f, cc);
+ if (char_depth(f, cc) > dp)
+ dp = char_depth(f, cc);
+ if (cur->extender > 0) {
+ i = with_extenders;
+ while (i > 0) {
+ wd += stack_into_hbox(b, f, cc);
+ if (d < (num_total - 1)) {
+ u = min_overlap;
+ if (s_max != 0)
+ u += xn_over_d(max_shrinks[d], (b_max - v), s_max);
+ add_delim_hkern(b, -u);
+ wd -= u;
+ }
+ d++;
+ i--;
+ }
+ } else {
+ wd += stack_into_hbox(b, f, cc);
+ if (d < (num_total - 1)) {
+ u = min_overlap;
+ if (s_max != 0)
+ u += xn_over_d(max_shrinks[d], (b_max - v), s_max);
+ add_delim_hkern(b, -u);
+ wd -= u;
+ }
+ d++;
+ }
+ cur = cur->next;
+ }
+ xfree(max_shrinks);
+ /* it is important to use |wd| here instead of |v| because if there
+ was not enough shrink to get the correct size, it has to be centered
+ based on its actual width. That actual width is not the same as
+ |b_max| either because |min_overlap| can have ben set by the user
+ outside of the font's control.
+ */
+ width(b) = wd;
+ }
+ return b;
+}
+
+pointer get_delim_vbox(extinfo * ext, internal_font_number f, scaled v,
+ pointer att)
+{
+ return get_delim_box(ext, f, v, att, vlist_node);
+}
+
+pointer get_delim_hbox(extinfo * ext, internal_font_number f, scaled v,
+ pointer att)
+{
+ return get_delim_box(ext, f, v, att, hlist_node);
+}
+
+
+
+/*
+ @ The |var_delimiter| function, which finds or constructs a sufficiently
+ large delimiter, is the most interesting of the auxiliary functions that
+ currently concern us. Given a pointer |d| to a delimiter field in some noad,
+ together with a size code |s| and a vertical distance |v|, this function
+ returns a pointer to a box that contains the smallest variant of |d| whose
+ height plus depth is |v| or more. (And if no variant is large enough, it
+ returns the largest available variant.) In particular, this routine will
+ construct arbitrarily large delimiters from extensible components, if
+ |d| leads to such characters.
+
+ The value returned is a box whose |shift_amount| has been set so that
+ the box is vertically centered with respect to the axis in the given size.
+ If a built-up symbol is returned, the height of the box before shifting
+ will be the height of its topmost component.
+*/
+
+void endless_loop_error(internal_font_number g, integer y)
+{
+ char s[256];
+ char *hlp[] = {
+ "You managed to create a seemingly endless charlist chain in the current",
+ "font. I have counted until 10000 already and still have not escaped, so"
+ "I will jump out of the loop all by myself now. Fix your font!",
+ NULL
+ };
+ snprintf(s, 256, "Math error: endless loop in charlist (U+%04x in %s)",
+ (int) y, font_name(g));
+ tex_error(s, hlp);
+}
+
+pointer var_delimiter(pointer d, integer s, scaled v)
+{
+ /* label found,continue; */
+ pointer b; /* the box that will be constructed */
+ internal_font_number f, g; /* best-so-far and tentative font codes */
+ integer c, i, x, y; /* best-so-far and tentative character codes */
+ scaled u; /* height-plus-depth of a tentative character */
+ scaled w; /* largest height-plus-depth so far */
+ integer z; /* runs through font family members */
+ boolean large_attempt; /* are we trying the ``large'' variant? */
+ pointer att; /* to save the current attribute list */
+ extinfo *ext;
+ att = null;
+ f = null_font;
+ c = 0;
+ w = 0;
+ large_attempt = false;
+ if (d == null)
+ goto FOUND;
+ z = small_fam(d);
+ x = small_char(d);
+ i = 0;
+ while (true) {
+ /* The search process is complicated slightly by the facts that some of the
+ characters might not be present in some of the fonts, and they might not
+ be probed in increasing order of height. */
+ if ((z != 0) || (x != 0)) {
+ g = fam_fnt(z, s);
+ if (g != null_font) {
+ y = x;
+ CONTINUE:
+ i++;
+ if (char_exists(g, y)) {
+ if (char_tag(g, y) == ext_tag) {
+ f = g;
+ c = y;
+ goto FOUND;
+ }
+ u = height_plus_depth(g, y);
+ if (u > w) {
+ f = g;
+ c = y;
+ w = u;
+ if (u >= v)
+ goto FOUND;
+ }
+ if (i > 10000) {
+ /* endless loop */
+ endless_loop_error(g, y);
+ goto FOUND;
+ }
+ if (char_tag(g, y) == list_tag) {
+ y = char_remainder(g, y);
+ goto CONTINUE;
+ }
+ }
+ }
+ }
+ if (large_attempt)
+ goto FOUND; /* there were none large enough */
+ large_attempt = true;
+ z = large_fam(d);
+ x = large_char(d);
+ }
+ FOUND:
+ if (d != null) {
+ att = node_attr(d);
+ node_attr(d) = null;
+ flush_node(d);
+ }
+ if (f != null_font) {
+ /* When the following code is executed, |char_tag(q)| will be equal to
+ |ext_tag| if and only if a built-up symbol is supposed to be returned.
+ */
+ ext = NULL;
+ if ((char_tag(f, c) == ext_tag) &&
+ ((ext = get_charinfo_vert_variants(char_info(f, c))) != NULL)) {
+ b = get_delim_vbox(ext, f, v, att);
+ width(b) += char_italic(f, c);
+ } else {
+ b = char_box(f, c, att);
+ }
+ } else {
+ b = new_null_box();
+ reset_attributes(b, att);
+ width(b) = null_delimiter_space; /* use this width if no delimiter was found */
+ }
+ shift_amount(b) = half(height(b) - depth(b)) - math_axis(s);
+ delete_attribute_ref(att);
+ return b;
+}
+
+pointer flat_var_delimiter(pointer d, integer s, scaled v)
+{
+ /* label found,continue; */
+ pointer b; /* the box that will be constructed */
+ internal_font_number f, g; /* best-so-far and tentative font codes */
+ integer c, i, x, y; /* best-so-far and tentative character codes */
+ scaled u; /* height-plus-depth of a tentative character */
+ scaled w; /* largest height-plus-depth so far */
+ integer z; /* runs through font family members */
+ boolean large_attempt; /* are we trying the ``large'' variant? */
+ pointer att; /* to save the current attribute list */
+ extinfo *ext;
+ f = null_font;
+ c = 0;
+ w = 0;
+ att = null;
+ large_attempt = false;
+ if (d == null)
+ goto FOUND;
+ z = small_fam(d);
+ x = small_char(d);
+ i = 0;
+ while (true) {
+ /* The search process is complicated slightly by the facts that some of the
+ characters might not be present in some of the fonts, and they might not
+ be probed in increasing order of height. */
+ if ((z != 0) || (x != 0)) {
+ g = fam_fnt(z, s);
+ if (g != null_font) {
+ y = x;
+ CONTINUE:
+ i++;
+ if (char_exists(g, y)) {
+ if (char_tag(g, y) == ext_tag) {
+ f = g;
+ c = y;
+ goto FOUND;
+ }
+ u = char_width(g, y);
+ if (u > w) {
+ f = g;
+ c = y;
+ w = u;
+ if (u >= v)
+ goto FOUND;
+ }
+ if (i > 10000) {
+ /* endless loop */
+ endless_loop_error(g, y);
+ goto FOUND;
+ }
+ if (char_tag(g, y) == list_tag) {
+ y = char_remainder(g, y);
+ goto CONTINUE;
+ }
+ }
+ }
+ }
+ if (large_attempt)
+ goto FOUND; /* there were none large enough */
+ large_attempt = true;
+ z = large_fam(d);
+ x = large_char(d);
+ }
+ FOUND:
+ if (d != null) {
+ att = node_attr(d);
+ node_attr(d) = null;
+ flush_node(d);
+ }
+ if (f != null_font) {
+ /* When the following code is executed, |char_tag(q)| will be equal to
+ |ext_tag| if and only if a built-up symbol is supposed to be returned.
+ */
+ ext = NULL;
+ if ((char_tag(f, c) == ext_tag) &&
+ ((ext = get_charinfo_hor_variants(char_info(f, c))) != NULL)) {
+ b = get_delim_hbox(ext, f, v, att);
+ width(b) += char_italic(f, c);
+ } else {
+ b = char_box(f, c, att);
+ }
+ } else {
+ b = new_null_box();
+ reset_attributes(b, att);
+ width(b) = 0; /* use this width if no delimiter was found */
+ }
+ delete_attribute_ref(att);
+ return b;
+}
+
+
+/*
+The next subroutine is much simpler; it is used for numerators and
+denominators of fractions as well as for displayed operators and
+their limits above and below. It takes a given box~|b| and
+changes it so that the new box is centered in a box of width~|w|.
+The centering is done by putting \.{\\hss} glue at the left and right
+of the list inside |b|, then packaging the new box; thus, the
+actual box might not really be centered, if it already contains
+infinite glue.
+
+
+The given box might contain a single character whose italic correction
+has been added to the width of the box; in this case a compensating
+kern is inserted.
+*/
+
+pointer rebox(pointer b, scaled w)
+{
+ pointer p, q, r, att; /* temporary registers for list manipulation */
+ internal_font_number f; /* font in a one-character box */
+ scaled v; /* width of a character without italic correction */
+
+ if ((width(b) != w) && (list_ptr(b) != null)) {
+ if (type(b) == vlist_node) {
+ p = hpack(b, 0, additional);
+ reset_attributes(p, node_attr(b));
+ b = p;
+ }
+ p = list_ptr(b);
+ att = node_attr(b);
+ add_node_attr_ref(att);
+ if ((is_char_node(p)) && (vlink(p) == null)) {
+ f = font(p);
+ v = char_width(f, character(p));
+ if (v != width(b)) {
+ q = new_kern(width(b) - v);
+ reset_attributes(q, att);
+ vlink(p) = q;
+ }
+ }
+ list_ptr(b) = null;
+ flush_node(b);
+ b = new_glue(ss_glue);
+ reset_attributes(b, att);
+ vlink(b) = p;
+ while (vlink(p) != null)
+ p = vlink(p);
+ q = new_glue(ss_glue);
+ reset_attributes(q, att);
+ vlink(p) = q;
+ r = hpack(b, w, exactly);
+ reset_attributes(r, att);
+ delete_attribute_ref(att);
+ return r;
+ } else {
+ width(b) = w;
+ return b;
+ }
+}
+
+/*
+ Here is a subroutine that creates a new glue specification from another
+one that is expressed in `\.{mu}', given the value of the math unit.
+*/
+
+#define mu_mult(A) mult_and_add(n,(A),xn_over_d((A),f,unity),max_dimen)
+
+pointer math_glue(pointer g, scaled m)
+{
+ pointer p; /* the new glue specification */
+ integer n; /* integer part of |m| */
+ scaled f; /* fraction part of |m| */
+ n = x_over_n(m, unity);
+ f = tex_remainder;
+ if (f < 0) {
+ decr(n);
+ f = f + unity;
+ }
+ p = new_node(glue_spec_node, 0);
+ width(p) = mu_mult(width(g)); /* convert \.{mu} to \.{pt} */
+ stretch_order(p) = stretch_order(g);
+ if (stretch_order(p) == normal)
+ stretch(p) = mu_mult(stretch(g));
+ else
+ stretch(p) = stretch(g);
+ shrink_order(p) = shrink_order(g);
+ if (shrink_order(p) == normal)
+ shrink(p) = mu_mult(shrink(g));
+ else
+ shrink(p) = shrink(g);
+ return p;
+}
+
+/*
+The |math_kern| subroutine removes |mu_glue| from a kern node, given
+the value of the math unit.
+*/
+
+void math_kern(pointer p, scaled m)
+{
+ integer n; /* integer part of |m| */
+ scaled f; /* fraction part of |m| */
+ if (subtype(p) == mu_glue) {
+ n = x_over_n(m, unity);
+ f = tex_remainder;
+ if (f < 0) {
+ decr(n);
+ f = f + unity;
+ }
+ width(p) = mu_mult(width(p));
+ subtype(p) = explicit;
+ }
+}
+
+/*
+ \TeX's most important routine for dealing with formulas is called
+|mlist_to_hlist|. After a formula has been scanned and represented as an
+mlist, this routine converts it to an hlist that can be placed into a box
+or incorporated into the text of a paragraph. There are three implicit
+parameters, passed in global variables: |cur_mlist| points to the first
+node or noad in the given mlist (and it might be |null|); |cur_style| is a
+style code; and |mlist_penalties| is |true| if penalty nodes for potential
+line breaks are to be inserted into the resulting hlist. After
+|mlist_to_hlist| has acted, |vlink(temp_head)| points to the translated hlist.
+
+Since mlists can be inside mlists, the procedure is recursive. And since this
+is not part of \TeX's inner loop, the program has been written in a manner
+that stresses compactness over efficiency.
+@^recursion@>
+*/
+
+pointer cur_mlist; /* beginning of mlist to be translated */
+integer cur_style; /* style code at current place in the list */
+integer cur_size; /* size code corresponding to |cur_style| */
+scaled cur_mu; /* the math unit width corresponding to |cur_size| */
+boolean mlist_penalties; /* should |mlist_to_hlist| insert penalties? */
+
+void run_mlist_to_hlist(pointer p, integer m_style, boolean penalties)
+{
+ int callback_id;
+ int a, sfix;
+ lua_State *L = Luas;
+ finalize_math_parameters();
+ callback_id = callback_defined(mlist_to_hlist_callback);
+ if (p != null && callback_id > 0) {
+ sfix = lua_gettop(L);
+ if (!get_callback(L, callback_id)) {
+ lua_settop(L, sfix);
+ return;
+ }
+ nodelist_to_lua(L, p); /* arg 1 */
+ lua_pushstring(L, math_style_names[m_style]); /* arg 2 */
+ lua_pushboolean(L, penalties); /* arg 3 */
+ if (lua_pcall(L, 3, 1, 0) != 0) { /* 3 args, 1 result */
+ fprintf(stdout, "error: %s\n", lua_tostring(L, -1));
+ lua_settop(L, sfix);
+ error();
+ return;
+ }
+ a = nodelist_from_lua(L);
+ lua_settop(L, sfix);
+ vlink(temp_head) = a;
+ } else {
+ cur_mlist = p;
+ cur_style = m_style;
+ mlist_penalties = penalties;
+ mlist_to_hlist();
+ }
+}
+
+
+/*
+@ The recursion in |mlist_to_hlist| is due primarily to a subroutine
+called |clean_box| that puts a given noad field into a box using a given
+math style; |mlist_to_hlist| can call |clean_box|, which can call
+|mlist_to_hlist|.
+@^recursion@>
+
+
+The box returned by |clean_box| is ``clean'' in the
+sense that its |shift_amount| is zero.
+*/
+
+pointer clean_box(pointer p, integer s)
+{
+ pointer q; /* beginning of a list to be boxed */
+ integer save_style; /* |cur_style| to be restored */
+ pointer x; /* box to be returned */
+ pointer r; /* temporary pointer */
+ switch (type(p)) {
+ case math_char_node:
+ cur_mlist = new_noad();
+ r = math_clone(p);
+ nucleus(cur_mlist) = r;
+ break;
+ case sub_box_node:
+ q = math_list(p);
+ goto FOUND;
+ break;
+ case sub_mlist_node:
+ cur_mlist = math_list(p);
+ break;
+ default:
+ q = new_null_box();
+ goto FOUND;
+ }
+ save_style = cur_style;
+ cur_style = s;
+ mlist_penalties = false;
+ mlist_to_hlist();
+ q = vlink(temp_head); /* recursive call */
+ cur_style = save_style; /* restore the style */
+ setup_cur_size_and_mu();
+ FOUND:
+ if (is_char_node(q) || (q == null))
+ x = hpack(q, 0, additional);
+ else if ((vlink(q) == null) && (type(q) <= vlist_node)
+ && (shift_amount(q) == 0))
+ x = q; /* it's already clean */
+ else
+ x = hpack(q, 0, additional);
+ if (x != q && q != null)
+ reset_attributes(x, node_attr(q));
+ /* Here we save memory space in a common case. */
+ q = list_ptr(x);
+ if (is_char_node(q)) {
+ r = vlink(q);
+ if (r != null) {
+ if (vlink(r) == null) {
+ if (!is_char_node(r)) {
+ if (type(r) == kern_node) {
+ /* unneeded italic correction */
+ flush_node(r);
+ vlink(q) = null;
+ }
+ }
+ }
+ }
+ }
+ return x;
+}
+
+/*
+ It is convenient to have a procedure that converts a |math_char|
+field to an ``unpacked'' form. The |fetch| routine sets |cur_f| and |cur_c|
+to the font code and character code of a given noad field.
+It also takes care of issuing error messages for
+nonexistent characters; in such cases, |char_exists(cur_f,cur_c)| will be |false|
+after |fetch| has acted, and the field will also have been reset to |null|.
+*/
+/* The outputs of |fetch| are placed in global variables. */
+
+internal_font_number cur_f; /* the |font| field of a |math_char| */
+integer cur_c; /* the |character| field of a |math_char| */
+
+void fetch(pointer a)
+{ /* unpack the |math_char| field |a| */
+ cur_c = math_character(a);
+ cur_f = fam_fnt(math_fam(a), cur_size);
+ if (cur_f == null_font) {
+ char *msg;
+ char *hlp[] = {
+ "Somewhere in the math formula just ended, you used the",
+ "stated character from an undefined font family. For example,",
+ "plain TeX doesn't allow \\it or \\sl in subscripts. Proceed,",
+ "and I'll try to forget that I needed that character.",
+ NULL
+ };
+ msg = xmalloc(256);
+ snprintf(msg, 255, "\\%s%d is undefined (character %d)",
+ math_size_string(cur_size), (int) math_fam(a), (int) cur_c);
+ tex_error(msg, hlp);
+ free(msg);
+ } else {
+ if (!(char_exists(cur_f, cur_c))) {
+ char_warning(cur_f, cur_c);
+ }
+ }
+}
+
+
+/*
+We need to do a lot of different things, so |mlist_to_hlist| makes two
+passes over the given mlist.
+
+The first pass does most of the processing: It removes ``mu'' spacing from
+glue, it recursively evaluates all subsidiary mlists so that only the
+top-level mlist remains to be handled, it puts fractions and square roots
+and such things into boxes, it attaches subscripts and superscripts, and
+it computes the overall height and depth of the top-level mlist so that
+the size of delimiters for a |fence_noad| will be known.
+The hlist resulting from each noad is recorded in that noad's |new_hlist|
+field, an integer field that replaces the |nucleus| or |thickness|.
+@^recursion@>
+
+The second pass eliminates all noads and inserts the correct glue and
+penalties between nodes.
+*/
+
+void assign_new_hlist(pointer q, pointer r)
+{
+ switch (type(q)) {
+ case fraction_noad:
+ math_list(numerator(q)) = null;
+ flush_node(numerator(q));
+ numerator(q) = null;
+ math_list(denominator(q)) = null;
+ flush_node(denominator(q));
+ denominator(q) = null;
+ break;
+ case radical_noad:
+ case ord_noad:
+ case op_noad:
+ case bin_noad:
+ case rel_noad:
+ case open_noad:
+ case close_noad:
+ case punct_noad:
+ case inner_noad:
+ case over_noad:
+ case under_noad:
+ case vcenter_noad:
+ case accent_noad:
+ if (nucleus(q) != null) {
+ math_list(nucleus(q)) = null;
+ flush_node(nucleus(q));
+ nucleus(q) = null;
+ }
+ break;
+ }
+ new_hlist(q) = r;
+}
+
+#define choose_mlist(A) do { p=A(q); A(q)=null; } while (0)
+
+/*
+Most of the actual construction work of |mlist_to_hlist| is done
+by procedures with names
+like |make_fraction|, |make_radical|, etc. To illustrate
+the general setup of such procedures, let's begin with a couple of
+simple ones.
+*/
+
+void make_over(pointer q)
+{
+ pointer p;
+ p = overbar(clean_box(nucleus(q), cramped_style(cur_style)),
+ overbar_vgap(cur_style),
+ overbar_rule(cur_style),
+ overbar_kern(cur_style), node_attr(nucleus(q)));
+ math_list(nucleus(q)) = p;
+ type(nucleus(q)) = sub_box_node;
+}
+
+void make_under(pointer q)
+{
+ pointer p, x, y, r; /* temporary registers for box construction */
+ scaled delta; /* overall height plus depth */
+ x = clean_box(nucleus(q), cur_style);
+ p = new_kern(underbar_vgap(cur_style));
+ reset_attributes(p, node_attr(q));
+ vlink(x) = p;
+ r = do_fraction_rule(underbar_rule(cur_style), node_attr(q));
+ vlink(p) = r;
+ pack_direction = math_direction;
+ y = vpackage(x, 0, additional, max_dimen);
+ reset_attributes(y, node_attr(q));
+ delta = height(y) + depth(y) + underbar_kern(cur_style);
+ height(y) = height(x);
+ depth(y) = delta - height(y);
+ math_list(nucleus(q)) = y;
+ type(nucleus(q)) = sub_box_node;
+}
+
+void make_vcenter(pointer q)
+{
+ pointer v; /* the box that should be centered vertically */
+ scaled delta; /* its height plus depth */
+ v = math_list(nucleus(q));
+ if (type(v) != vlist_node)
+ tconfusion("vcenter"); /* this can't happen vcenter */
+ delta = height(v) + depth(v);
+ height(v) = math_axis(cur_size) + half(delta);
+ depth(v) = delta - height(v);
+}
+
+/*
+@ According to the rules in the \.{DVI} file specifications, we ensure alignment
+@^square roots@>
+between a square root sign and the rule above its nucleus by assuming that the
+baseline of the square-root symbol is the same as the bottom of the rule. The
+height of the square-root symbol will be the thickness of the rule, and the
+depth of the square-root symbol should exceed or equal the height-plus-depth
+of the nucleus plus a certain minimum clearance~|psi|. The symbol will be
+placed so that the actual clearance is |psi| plus half the excess.
+*/
+
+void make_radical(pointer q)
+{
+ pointer x, y, p; /* temporary registers for box construction */
+ scaled delta, clr, theta, h; /* dimensions involved in the calculation */
+ x = clean_box(nucleus(q), cramped_style(cur_style));
+ clr = radical_vgap(cur_style);
+ theta = radical_rule(cur_style);
+ if (theta == undefined_math_parameter) {
+ theta = fraction_rule(cur_style);
+ y = var_delimiter(left_delimiter(q), cur_size,
+ height(x) + depth(x) + clr + theta);
+ left_delimiter(q) = null;
+ theta = height(y);
+ delta = depth(y) - (height(x) + depth(x) + clr);
+ if (delta > 0)
+ clr = clr + half(delta); /* increase the actual clearance */
+ shift_amount(y) = -(height(x) + clr);
+ h = shift_amount(y) + height(y);
+ } else {
+ y = var_delimiter(left_delimiter(q), cur_size,
+ height(x) + depth(x) + clr + theta);
+ left_delimiter(q) = null;
+ delta = height(y) - (height(x) + clr + theta);
+ shift_amount(y) = delta;
+ h = -(height(y) - shift_amount(y));
+ }
+ p = overbar(x, clr, theta, radical_kern(cur_style), node_attr(y));
+ vlink(y) = p;
+ if (degree(q) != null) {
+ scaled wr, br, ar;
+ pointer r = clean_box(degree(q), script_script_style);
+ reset_attributes(r, node_attr(degree(q)));
+ wr = width(r);
+ if (wr == 0) {
+ flush_node(r);
+ } else {
+ br = radical_degree_before(cur_style);
+ ar = radical_degree_after(cur_style);
+ if (-ar > (wr + br))
+ ar = -(wr + br);
+ x = new_kern(ar);
+ reset_attributes(x, node_attr(degree(q)));
+ vlink(x) = y;
+ shift_amount(r) =
+ (xn_over_d(h, radical_degree_raise(cur_style), 100));
+ vlink(r) = x;
+ x = new_kern(br);
+ reset_attributes(x, node_attr(degree(q)));
+ vlink(x) = r;
+ y = x;
+ }
+ degree(q) = null;
+ }
+ p = hpack(y, 0, additional);
+ reset_attributes(p, node_attr(q));
+ math_list(nucleus(q)) = p;
+ type(nucleus(q)) = sub_box_node;
+}
+
+
+/* Construct a vlist box */
+static pointer
+wrapup_delimiter (pointer x, pointer y, pointer q,
+ scaled shift_up, scaled shift_down) {
+ pointer p; /* temporary register for box construction */
+ pointer v = new_null_box();
+ type(v) = vlist_node;
+ height(v) = shift_up + height(x);
+ depth(v) = depth(y) + shift_down;
+ reset_attributes(v, node_attr(q));
+ p = new_kern((shift_up - depth(x)) - (height(y) - shift_down));
+ reset_attributes(p, node_attr(q));
+ vlink(p) = y;
+ vlink(x) = p;
+ list_ptr(v) = x;
+ return v;
+}
+
+#define fixup_widths(x,y) do { \
+ if (width(y) >= width(x)) { \
+ width(x) = width(y); \
+ } else { \
+ width(y) = width(x); \
+ } \
+ } while (0)
+
+/* this has the |nucleus| box |x| as a limit above an extensible delimiter |y| */
+
+void make_over_delimiter(pointer q)
+{
+ pointer x, y, v; /* temporary registers for box construction */
+ scaled shift_up, shift_down, clr, delta;
+ x = clean_box(nucleus(q), sub_style(cur_style));
+ y = flat_var_delimiter(left_delimiter(q), cur_size, width(x));
+ left_delimiter(q) = null;
+ fixup_widths(x,y);
+ shift_up = over_delimiter_bgap(cur_style);
+ shift_down = 0; /* under_delimiter_bgap(cur_style); */
+ clr = over_delimiter_vgap(cur_style);
+ delta = clr - ((shift_up - depth(x)) - (height(y) - shift_down));
+ if (delta > 0) {
+ shift_up = shift_up + delta;
+ }
+ v = wrapup_delimiter (x, y, q, shift_up, shift_down);
+ width(v) = width(x); /* this also equals |width(y)| */
+ math_list(nucleus(q)) = v;
+ type(nucleus(q)) = sub_box_node;
+}
+
+/* this has the extensible delimiter |x| as a limit above |nucleus| box |y| */
+
+void make_delimiter_over(pointer q)
+{
+ pointer x, y, v; /* temporary registers for box construction */
+ scaled shift_up, shift_down, clr, delta;
+ y = clean_box(nucleus(q), cur_style);
+ x = flat_var_delimiter(left_delimiter(q), cur_size+(cur_size==script_script_size?0:1), width(y));
+ left_delimiter(q) = null;
+ fixup_widths(x,y);
+ shift_up = over_delimiter_bgap(cur_style);
+ shift_down = 0;
+ clr = over_delimiter_vgap(cur_style);
+ delta = clr - ((shift_up - depth(x)) - (height(y) - shift_down));
+ if (delta > 0) {
+ shift_up = shift_up + delta;
+ }
+ v = wrapup_delimiter (x, y, q, shift_up, shift_down);
+ width(v) = width(x); /* this also equals |width(y)| */
+ math_list(nucleus(q)) = v;
+ type(nucleus(q)) = sub_box_node;
+}
+
+
+/* this has the extensible delimiter |y| as a limit below a |nucleus| box |x| */
+
+void make_delimiter_under(pointer q)
+{
+ pointer x, y, v; /* temporary registers for box construction */
+ scaled shift_up, shift_down, clr, delta;
+ x = clean_box(nucleus(q), cur_style);
+ y = flat_var_delimiter(left_delimiter(q), cur_size+(cur_size==script_script_size?0:1) , width(x));
+ left_delimiter(q) = null;
+ fixup_widths(x,y);
+ shift_up = 0; /* over_delimiter_bgap(cur_style); */
+ shift_down = under_delimiter_bgap(cur_style);
+ clr = under_delimiter_vgap(cur_style);
+ delta = clr - ((shift_up - depth(x)) - (height(y) - shift_down));
+ if (delta > 0) {
+ shift_down = shift_down + delta;
+ }
+ v = wrapup_delimiter (x, y, q, shift_up, shift_down);
+ width(v) = width(y); /* this also equals |width(y)| */
+ math_list(nucleus(q)) = v;
+ type(nucleus(q)) = sub_box_node;
+
+}
+
+/* this has the extensible delimiter |x| as a limit below |nucleus| box |y| */
+
+void make_under_delimiter(pointer q)
+{
+ pointer x, y, v; /* temporary registers for box construction */
+ scaled shift_up, shift_down, clr, delta;
+ y = clean_box(nucleus(q), sup_style(cur_style));
+ x = flat_var_delimiter(left_delimiter(q), cur_size, width(y));
+ left_delimiter(q) = null;
+ fixup_widths(x,y);
+ shift_up = 0; /* over_delimiter_bgap(cur_style); */
+ shift_down = under_delimiter_bgap(cur_style);
+ clr = under_delimiter_vgap(cur_style);
+ delta = clr - ((shift_up - depth(x)) - (height(y) - shift_down));
+ if (delta > 0) {
+ shift_down = shift_down + delta;
+ }
+ v = wrapup_delimiter (x, y, q, shift_up, shift_down);
+ width(v) = width(y); /* this also equals |width(y)| */
+ math_list(nucleus(q)) = v;
+ type(nucleus(q)) = sub_box_node;
+
+}
+
+/*
+Slants are not considered when placing accents in math mode. The accenter is
+centered over the accentee, and the accent width is treated as zero with
+respect to the size of the final box.
+*/
+
+#define TOP_CODE 1
+#define BOT_CODE 2
+
+void do_make_math_accent(pointer q, internal_font_number f, integer c,
+ int top_or_bot)
+{
+ pointer p, r, x, y; /* temporary registers for box construction */
+ scaled s; /* amount to skew the accent to the right */
+ scaled h; /* height of character being accented */
+ scaled delta; /* space to remove between accent and accentee */
+ scaled w; /* width of the accentee, not including sub/superscripts */
+ boolean s_is_absolute; /* will be true if a top-accent is placed in |s| */
+ extinfo *ext;
+ pointer attr_p;
+ attr_p = (top_or_bot == TOP_CODE ? accent_chr(q) : bot_accent_chr(q));
+ s_is_absolute = false;
+ c = cur_c;
+ f = cur_f;
+ /* Compute the amount of skew, or set |s| to an alignment point */
+ s = 0;
+ if (type(nucleus(q)) == math_char_node) {
+ fetch(nucleus(q));
+ if (top_or_bot == TOP_CODE) {
+ s = char_top_accent(cur_f, cur_c);
+ if (s != 0) {
+ s_is_absolute = true;
+ } else {
+ s = get_kern(cur_f, cur_c, skew_char(cur_f));
+ }
+ } else { /* new skewchar madness for bot accents */
+ s = char_bot_accent(cur_f, cur_c);
+ if (s != 0) {
+ s_is_absolute = true;
+ }
+ }
+ }
+ x = clean_box(nucleus(q), cramped_style(cur_style));
+ w = width(x);
+ h = height(x);
+ /* Switch to a larger accent if available and appropriate */
+ y = null;
+ while (1) {
+ ext = NULL;
+ if ((char_tag(f, c) == ext_tag) &&
+ ((ext = get_charinfo_hor_variants(char_info(f, c))) != NULL)) {
+ scaled w1 = xn_over_d(w, delimiter_factor, 1000);
+ if (w - w1 > delimiter_shortfall)
+ w1 = w - delimiter_shortfall;
+ y = get_delim_hbox(ext, f, w1, node_attr(attr_p));
+ break;
+ } else if (char_tag(f, c) != list_tag) {
+ break;
+ } else {
+ integer yy = char_remainder(f, c);
+ if (!char_exists(f, yy))
+ break;
+ if (char_width(f, yy) > w)
+ break;
+ c = yy;
+ }
+ }
+ if (y == null) {
+ y = char_box(f, c, node_attr(attr_p));
+ }
+ if (top_or_bot == TOP_CODE) {
+ if (h < accent_base_height(f))
+ delta = h;
+ else
+ delta = accent_base_height(f);
+ } else {
+ delta = 0; /* hm */
+ }
+ if ((supscr(q) != null) || (subscr(q) != null)) {
+ if (type(nucleus(q)) == math_char_node) {
+ /* Swap the subscript and superscript into box |x| */
+ flush_node_list(x);
+ x = new_noad();
+ r = math_clone(nucleus(q));
+ nucleus(x) = r;
+ supscr(x) = supscr(q);
+ supscr(q) = null;
+ subscr(x) = subscr(q);
+ subscr(q) = null;
+ type(nucleus(q)) = sub_mlist_node;
+ math_list(nucleus(q)) = x;
+ x = clean_box(nucleus(q), cur_style);
+ delta = delta + height(x) - h;
+ h = height(x);
+ }
+ }
+ if (s_is_absolute) {
+ scaled sa;
+ if (top_or_bot == TOP_CODE)
+ sa = char_top_accent(f, c);
+ else
+ sa = char_bot_accent(f, c);
+ if (sa == 0) {
+ sa = half(width(y)); /* just take the center */
+ }
+ shift_amount(y) = s - sa;
+ } else {
+ shift_amount(y) = s + half(w - width(y));
+ }
+ width(y) = 0;
+ if (top_or_bot == TOP_CODE) {
+ p = new_kern(-delta);
+ vlink(p) = x;
+ vlink(y) = p;
+ } else {
+ /*
+ p = new_kern(-delta);
+ vlink(x) = p;
+ vlink(p) = y;
+ y = x;
+ */
+ vlink(x) = y;
+ y = x;
+ }
+ pack_direction = math_direction;
+ r = vpackage(y, 0, additional, max_dimen);
+ reset_attributes(r, node_attr(q));
+ width(r) = w;
+ y = r;
+ if (top_or_bot == TOP_CODE) {
+ if (height(y) < h) {
+ /* Make the height of box |y| equal to |h| */
+ p = new_kern(h - height(y));
+ reset_attributes(p, node_attr(q));
+ vlink(p) = list_ptr(y);
+ list_ptr(y) = p;
+ height(y) = h;
+ }
+ } else {
+ shift_amount(y) = -(h - height(y));
+ }
+ math_list(nucleus(q)) = y;
+ type(nucleus(q)) = sub_box_node;
+}
+
+void make_math_accent(pointer q)
+{
+ if (accent_chr(q) != null) {
+ fetch(accent_chr(q));
+ if (char_exists(cur_f, cur_c)) {
+ do_make_math_accent(q, cur_f, cur_c, TOP_CODE);
+ }
+ flush_node(accent_chr(q));
+ accent_chr(q) = null;
+ }
+ if (bot_accent_chr(q) != null) {
+ fetch(bot_accent_chr(q));
+ if (char_exists(cur_f, cur_c)) {
+ do_make_math_accent(q, cur_f, cur_c, BOT_CODE);
+ }
+ flush_node(bot_accent_chr(q));
+ bot_accent_chr(q) = null;
+ }
+}
+
+/*
+The |make_fraction| procedure is a bit different because it sets
+|new_hlist(q)| directly rather than making a sub-box.
+*/
+
+void make_fraction(pointer q)
+{
+ pointer p, v, x, y, z; /* temporary registers for box construction */
+ scaled delta, delta1, delta2, shift_up, shift_down, clr;
+ /* dimensions for box calculations */
+ if (thickness(q) == default_code)
+ thickness(q) = fraction_rule(cur_style);
+ /* Create equal-width boxes |x| and |z| for the numerator and denominator,
+ and compute the default amounts |shift_up| and |shift_down| by which they
+ are displaced from the baseline */
+ x = clean_box(numerator(q), num_style(cur_style));
+ z = clean_box(denominator(q), denom_style(cur_style));
+ if (width(x) < width(z))
+ x = rebox(x, width(z));
+ else
+ z = rebox(z, width(x));
+ if (thickness(q) == 0) {
+ shift_up = stack_num_up(cur_style);
+ shift_down = stack_denom_down(cur_style);
+ /* The numerator and denominator must be separated by a certain minimum
+ clearance, called |clr| in the following program. The difference between
+ |clr| and the actual clearance is |2delta|. */
+ clr = stack_vgap(cur_style);
+ delta = half(clr - ((shift_up - depth(x)) - (height(z) - shift_down)));
+ if (delta > 0) {
+ shift_up = shift_up + delta;
+ shift_down = shift_down + delta;
+ }
+ } else {
+ shift_up = fraction_num_up(cur_style);
+ shift_down = fraction_denom_down(cur_style);
+ /* In the case of a fraction line, the minimum clearance depends on the actual
+ thickness of the line. */
+ delta = half(thickness(q));
+ clr = fraction_num_vgap(cur_style);
+ clr = ext_xn_over_d(clr, thickness(q), fraction_rule(cur_style));
+ delta1 = clr - ((shift_up - depth(x)) - (math_axis(cur_size) + delta));
+ if (delta1 > 0)
+ shift_up = shift_up + delta1;
+ clr = fraction_denom_vgap(cur_style);
+ clr = ext_xn_over_d(clr, thickness(q), fraction_rule(cur_style));
+ delta2 =
+ clr - ((math_axis(cur_size) - delta) - (height(z) - shift_down));
+ if (delta2 > 0)
+ shift_down = shift_down + delta2;
+ }
+ /* Construct a vlist box for the fraction, according to |shift_up| and |shift_down| */
+ v = new_null_box();
+ type(v) = vlist_node;
+ height(v) = shift_up + height(x);
+ depth(v) = depth(z) + shift_down;
+ width(v) = width(x); /* this also equals |width(z)| */
+ reset_attributes(v, node_attr(q));
+ if (thickness(q) == 0) {
+ p = new_kern((shift_up - depth(x)) - (height(z) - shift_down));
+ vlink(p) = z;
+ } else {
+ y = do_fraction_rule(thickness(q), node_attr(q));
+ p = new_kern((math_axis(cur_size) - delta) - (height(z) - shift_down));
+ reset_attributes(p, node_attr(q));
+ vlink(y) = p;
+ vlink(p) = z;
+ p = new_kern((shift_up - depth(x)) - (math_axis(cur_size) + delta));
+ vlink(p) = y;
+ }
+ reset_attributes(p, node_attr(q));
+ vlink(x) = p;
+ list_ptr(v) = x;
+ /* Put the fraction into a box with its delimiters, and make |new_hlist(q)|
+ point to it */
+ delta = fraction_del_size(cur_style);
+ x = var_delimiter(left_delimiter(q), cur_size, delta);
+ left_delimiter(q) = null;
+ vlink(x) = v;
+ z = var_delimiter(right_delimiter(q), cur_size, delta);
+ right_delimiter(q) = null;
+ vlink(v) = z;
+ y = hpack(x, 0, additional);
+ reset_attributes(y, node_attr(q));
+ assign_new_hlist(q, y);
+}
+
+
+/*
+If the nucleus of an |op_noad| is a single character, it is to be
+centered vertically with respect to the axis, after first being enlarged
+(via a character list in the font) if we are in display style. The normal
+convention for placing displayed limits is to put them above and below the
+operator in display style.
+
+The italic correction is removed from the character if there is a subscript
+and the limits are not being displayed. The |make_op|
+routine returns the value that should be used as an offset between
+subscript and superscript.
+
+After |make_op| has acted, |subtype(q)| will be |limits| if and only if
+the limits have been set above and below the operator. In that case,
+|new_hlist(q)| will already contain the desired final box.
+*/
+
+scaled make_op(pointer q)
+{
+ scaled delta; /* offset between subscript and superscript */
+ pointer p, v, x, y, z; /* temporary registers for box construction */
+ integer c; /* register for character examination */
+ scaled shift_up, shift_down; /* dimensions for box calculation */
+ scaled ok_size;
+ if ((subtype(q) == normal) && (cur_style < text_style))
+ subtype(q) = limits;
+ if (type(nucleus(q)) == math_char_node) {
+ fetch(nucleus(q));
+ if (cur_style < text_style) { /* try to make it larger */
+ if (minimum_operator_size(cur_style) != undefined_math_parameter)
+ ok_size = minimum_operator_size(cur_style);
+ else
+ ok_size = height_plus_depth(cur_f, cur_c) + 1;
+ while ((char_tag(cur_f, cur_c) == list_tag) &&
+ height_plus_depth(cur_f, cur_c) < ok_size) {
+ c = char_remainder(cur_f, cur_c);
+ if (!char_exists(cur_f, c))
+ break;
+ cur_c = c;
+ math_character(nucleus(q)) = c;
+ }
+ }
+ delta = char_italic(cur_f, cur_c);
+ x = clean_box(nucleus(q), cur_style);
+ if ((subscr(q) != null) && (subtype(q) != limits))
+ width(x) = width(x) - delta; /* remove italic correction */
+ shift_amount(x) = half(height(x) - depth(x)) - math_axis(cur_size);
+ /* center vertically */
+ type(nucleus(q)) = sub_box_node;
+ math_list(nucleus(q)) = x;
+ } else {
+ delta = 0;
+ }
+ if (subtype(q) == limits) {
+ /* The following program builds a vlist box |v| for displayed limits. The
+ width of the box is not affected by the fact that the limits may be skewed. */
+ x = clean_box(supscr(q), sup_style(cur_style));
+ y = clean_box(nucleus(q), cur_style);
+ z = clean_box(subscr(q), sub_style(cur_style));
+ v = new_null_box();
+ reset_attributes(v, node_attr(q));
+ type(v) = vlist_node;
+ width(v) = width(y);
+ if (width(x) > width(v))
+ width(v) = width(x);
+ if (width(z) > width(v))
+ width(v) = width(z);
+ x = rebox(x, width(v));
+ y = rebox(y, width(v));
+ z = rebox(z, width(v));
+ shift_amount(x) = half(delta);
+ shift_amount(z) = -shift_amount(x);
+ height(v) = height(y);
+ depth(v) = depth(y);
+ /* Attach the limits to |y| and adjust |height(v)|, |depth(v)| to
+ account for their presence */
+ /* We use |shift_up| and |shift_down| in the following program for the
+ amount of glue between the displayed operator |y| and its limits |x| and
+ |z|. The vlist inside box |v| will consist of |x| followed by |y| followed
+ by |z|, with kern nodes for the spaces between and around them. */
+ if (supscr(q) == null) {
+ list_ptr(x) = null;
+ flush_node(x);
+ list_ptr(v) = y;
+ } else {
+ shift_up = limit_above_bgap(cur_style) - depth(x);
+ if (shift_up < limit_above_vgap(cur_style))
+ shift_up = limit_above_vgap(cur_style);
+ p = new_kern(shift_up);
+ reset_attributes(p, node_attr(q));
+ vlink(p) = y;
+ vlink(x) = p;
+ p = new_kern(limit_above_kern(cur_style));
+ reset_attributes(p, node_attr(q));
+ vlink(p) = x;
+ list_ptr(v) = p;
+ height(v) =
+ height(v) + limit_above_kern(cur_style) + height(x) + depth(x) +
+ shift_up;
+ }
+ if (subscr(q) == null) {
+ list_ptr(z) = null;
+ flush_node(z);
+ } else {
+ shift_down = limit_below_bgap(cur_style) - height(z);
+ if (shift_down < limit_below_vgap(cur_style))
+ shift_down = limit_below_vgap(cur_style);
+ p = new_kern(shift_down);
+ reset_attributes(p, node_attr(q));
+ vlink(y) = p;
+ vlink(p) = z;
+ p = new_kern(limit_below_kern(cur_style));
+ reset_attributes(p, node_attr(q));
+ vlink(z) = p;
+ depth(v) =
+ depth(v) + limit_below_kern(cur_style) + height(z) + depth(z) +
+ shift_down;
+ }
+ if (subscr(q) != null) {
+ math_list(subscr(q)) = null;
+ flush_node(subscr(q));
+ subscr(q) = null;
+ }
+ if (supscr(q) != null) {
+ math_list(supscr(q)) = null;
+ flush_node(supscr(q));
+ supscr(q) = null;
+ }
+ assign_new_hlist(q, v);
+ }
+ return delta;
+}
+
+/*
+A ligature found in a math formula does not create a ligature, because
+there is no question of hyphenation afterwards; the ligature will simply be
+stored in an ordinary |glyph_node|, after residing in an |ord_noad|.
+
+The |type| is converted to |math_text_char| here if we would not want to
+apply an italic correction to the current character unless it belongs
+to a math font (i.e., a font with |space=0|).
+
+No boundary characters enter into these ligatures.
+*/
+
+void make_ord(pointer q)
+{
+ integer a; /* the left-side character for lig/kern testing */
+ pointer p, r, s; /* temporary registers for list manipulation */
+ scaled k; /* a kern */
+ liginfo lig; /* a ligature */
+ RESTART:
+ if (subscr(q) == null &&
+ supscr(q) == null && type(nucleus(q)) == math_char_node) {
+ p = vlink(q);
+ if ((p != null) &&
+ (type(p) >= ord_noad) && (type(p) <= punct_noad) &&
+ (type(nucleus(p)) == math_char_node) &&
+ (math_fam(nucleus(p)) == math_fam(nucleus(q)))) {
+ type(nucleus(q)) = math_text_char_node;
+ fetch(nucleus(q));
+ a = cur_c;
+ if ((has_kern(cur_f, a)) || (has_lig(cur_f, a))) {
+ cur_c = math_character(nucleus(p));
+ /* If character |a| has a kern with |cur_c|, attach
+ the kern after~|q|; or if it has a ligature with |cur_c|, combine
+ noads |q| and~|p| appropriately; then |return| if the cursor has
+ moved past a noad, or |goto restart| */
+
+ /* Note that a ligature between an |ord_noad| and another kind of noad
+ is replaced by an |ord_noad|, when the two noads collapse into one.
+ But we could make a parenthesis (say) change shape when it follows
+ certain letters. Presumably a font designer will define such
+ ligatures only when this convention makes sense. */
+
+ if (disable_lig == 0 && has_lig(cur_f, a)) {
+ lig = get_ligature(cur_f, a, cur_c);
+ if (is_valid_ligature(lig)) {
+ check_interrupt(); /* allow a way out of infinite ligature loop */
+ switch (lig_type(lig)) {
+ case 1:
+ case 5:
+ math_character(nucleus(q)) = lig_replacement(lig); /* \.{=:|}, \.{=:|>} */
+ break;
+ case 2:
+ case 6:
+ math_character(nucleus(p)) = lig_replacement(lig); /* \.{|=:}, \.{|=:>} */
+ break;
+ case 3:
+ case 7:
+ case 11:
+ r = new_noad(); /* \.{|=:|}, \.{|=:|>}, \.{|=:|>>} */
+ reset_attributes(r, node_attr(q));
+ s = new_node(math_char_node, 0);
+ reset_attributes(s, node_attr(q));
+ nucleus(r) = s;
+ math_character(nucleus(r)) = lig_replacement(lig);
+ math_fam(nucleus(r)) = math_fam(nucleus(q));
+ vlink(q) = r;
+ vlink(r) = p;
+ if (lig_type(lig) < 11)
+ type(nucleus(r)) = math_char_node;
+ else
+ type(nucleus(r)) = math_text_char_node; /* prevent combination */
+ break;
+ default:
+ vlink(q) = vlink(p);
+ math_character(nucleus(q)) = lig_replacement(lig); /* \.{=:} */
+ s = math_clone(subscr(p));
+ subscr(q) = s;
+ s = math_clone(supscr(p));
+ supscr(q) = s;
+ math_reset(subscr(p)); /* just in case */
+ math_reset(supscr(p));
+ flush_node(p);
+ break;
+ }
+ if (lig_type(lig) > 3)
+ return;
+ type(nucleus(q)) = math_char_node;
+ goto RESTART;
+ }
+ }
+ if (disable_kern == 0 && has_kern(cur_f, a)) {
+ k = get_kern(cur_f, a, cur_c);
+ if (k != 0) {
+ p = new_kern(k);
+ reset_attributes(p, node_attr(q));
+ vlink(p) = vlink(q);
+ vlink(q) = p;
+ return;
+ }
+ }
+ }
+ }
+ }
+}
+
+
+/*
+The purpose of |make_scripts(q,delta)| is to attach the subscript and/or
+superscript of noad |q| to the list that starts at |new_hlist(q)|,
+given that subscript and superscript aren't both empty. The superscript
+will appear to the right of the subscript by a given distance |delta|.
+
+We set |shift_down| and |shift_up| to the minimum amounts to shift the
+baseline of subscripts and superscripts based on the given nucleus.
+*/
+
+void make_scripts(pointer q, scaled delta)
+{
+ pointer p, x, y, z; /* temporary registers for box construction */
+ scaled shift_up, shift_down, clr; /* dimensions in the calculation */
+ p = new_hlist(q);
+ if (is_char_node(p)) {
+ shift_up = 0;
+ shift_down = 0;
+ } else {
+ z = hpack(p, 0, additional);
+ shift_up = height(z) - sup_shift_drop(cur_style); /* r18 */
+ shift_down = depth(z) + sub_shift_drop(cur_style); /* r19 */
+ list_ptr(z) = null;
+ flush_node(z);
+ }
+ if (supscr(q) == null) {
+ /* Construct a subscript box |x| when there is no superscript */
+ /* When there is a subscript without a superscript, the top of the subscript
+ should not exceed the baseline plus four-fifths of the x-height. */
+ x = clean_box(subscr(q), sub_style(cur_style));
+ width(x) = width(x) + space_after_script(cur_style);
+ if (shift_down < sub_shift_down(cur_style))
+ shift_down = sub_shift_down(cur_style);
+ clr = height(x) - sub_top_max(cur_style);
+ if (shift_down < clr)
+ shift_down = clr;
+ shift_amount(x) = shift_down;
+ } else {
+ /* Construct a superscript box |x| */
+ /*The bottom of a superscript should never descend below the baseline plus
+ one-fourth of the x-height. */
+ x = clean_box(supscr(q), sup_style(cur_style));
+ width(x) = width(x) + space_after_script(cur_style);
+ clr = sup_shift_up(cur_style);
+ if (shift_up < clr)
+ shift_up = clr;
+ clr = depth(x) + sup_bottom_min(cur_style);
+ if (shift_up < clr)
+ shift_up = clr;
+
+ if (subscr(q) == null) {
+ shift_amount(x) = -shift_up;
+ } else {
+ /* Construct a sub/superscript combination box |x|, with the
+ superscript offset by |delta| */
+ /* When both subscript and superscript are present, the subscript must be
+ separated from the superscript by at least four times |default_rule_thickness|.
+ If this condition would be violated, the subscript moves down, after which
+ both subscript and superscript move up so that the bottom of the superscript
+ is at least as high as the baseline plus four-fifths of the x-height. */
+
+ y = clean_box(subscr(q), sub_style(cur_style));
+ width(y) = width(y) + space_after_script(cur_style);
+ if (shift_down < sub_sup_shift_down(cur_style))
+ shift_down = sub_sup_shift_down(cur_style);
+ clr = subsup_vgap(cur_style) -
+ ((shift_up - depth(x)) - (height(y) - shift_down));
+ if (clr > 0) {
+ shift_down = shift_down + clr;
+ clr = sup_sub_bottom_max(cur_style) - (shift_up - depth(x));
+ if (clr > 0) {
+ shift_up = shift_up + clr;
+ shift_down = shift_down - clr;
+ }
+ }
+ shift_amount(x) = delta; /* superscript is |delta| to the right of the subscript */
+ p = new_kern((shift_up - depth(x)) - (height(y) - shift_down));
+ reset_attributes(p, node_attr(q));
+ vlink(x) = p;
+ vlink(p) = y;
+ pack_direction = math_direction;
+ x = vpackage(x, 0, additional, max_dimen);
+ reset_attributes(x, node_attr(q));
+ shift_amount(x) = shift_down;
+ }
+ }
+ if (new_hlist(q) == null) {
+ new_hlist(q) = x;
+ } else {
+ p = new_hlist(q);
+ while (vlink(p) != null)
+ p = vlink(p);
+ vlink(p) = x;
+ }
+ if (subscr(q) != null) {
+ math_list(subscr(q)) = null;
+ flush_node(subscr(q));
+ subscr(q) = null;
+ }
+ if (supscr(q) != null) {
+ math_list(supscr(q)) = null;
+ flush_node(supscr(q));
+ supscr(q) = null;
+ }
+
+}
+
+/*
+The |make_left_right| function constructs a left or right delimiter of
+the required size and returns the value |open_noad| or |close_noad|. The
+|left_noad_side| and |right_noad_side| will both be based on the original |style|,
+so they will have consistent sizes.
+*/
+
+small_number make_left_right(pointer q, integer style, scaled max_d,
+ scaled max_hv)
+{
+ scaled delta, delta1, delta2; /* dimensions used in the calculation */
+ pointer tmp;
+ cur_style = style;
+ setup_cur_size_and_mu();
+ delta2 = max_d + math_axis(cur_size);
+ delta1 = max_hv + max_d - delta2;
+ if (delta2 > delta1)
+ delta1 = delta2; /* |delta1| is max distance from axis */
+ delta = (delta1 / 500) * delimiter_factor;
+ delta2 = delta1 + delta1 - delimiter_shortfall;
+ if (delta < delta2)
+ delta = delta2;
+ tmp = var_delimiter(delimiter(q), cur_size, delta);
+ delimiter(q) = null;
+ assign_new_hlist(q, tmp);
+ if (subtype(q) == left_noad_side)
+ return open_noad;
+ else
+ return close_noad;
+}
+
+
+/*
+The inter-element spacing in math formulas depends on a $8\times8$ table that
+\TeX\ preloads as a 64-digit string. The elements of this string have the
+following significance:
+$$\vbox{\halign{#\hfil\cr
+\.0 means no space;\cr
+\.1 means a conditional thin space (\.{\\nonscript\\mskip\\thinmuskip});\cr
+\.2 means a thin space (\.{\\mskip\\thinmuskip});\cr
+\.3 means a conditional medium space
+ (\.{\\nonscript\\mskip\\medmuskip});\cr
+\.4 means a conditional thick space
+ (\.{\\nonscript\\mskip\\thickmuskip});\cr
+\.* means an impossible case.\cr}}$$
+This is all pretty cryptic, but {\sl The \TeX book\/} explains what is
+supposed to happen, and the string makes it happen.
+@:TeXbook}{\sl The \TeX book@>
+*/
+
+char math_spacing[] =
+ "0234000122*4000133**3**344*0400400*000000234000111*1111112341011";
+
+#define level_one 1
+#define thin_mu_skip param_thin_mu_skip_code
+#define med_mu_skip param_med_mu_skip_code
+#define thick_mu_skip param_thick_mu_skip_code
+
+
+#define TEXT_STYLES(A,B) do { \
+ def_math_param(A,display_style,(B),level_one); \
+ def_math_param(A,cramped_display_style,(B),level_one); \
+ def_math_param(A,text_style,(B),level_one); \
+ def_math_param(A,cramped_text_style,(B),level_one); \
+ } while (0)
+
+#define SCRIPT_STYLES(A,B) do { \
+ def_math_param(A,script_style,(B),level_one); \
+ def_math_param(A,cramped_script_style,(B),level_one); \
+ def_math_param(A,script_script_style,(B),level_one); \
+ def_math_param(A,cramped_script_script_style,(B),level_one); \
+ } while (0)
+
+#define ALL_STYLES(A,B) do { \
+ TEXT_STYLES(A,(B)); \
+ SCRIPT_STYLES(A,(B)); \
+ } while (0)
+
+#define SPLIT_STYLES(A,B,C) do { \
+ TEXT_STYLES(A,(B)); \
+ SCRIPT_STYLES(A,(C)); \
+ } while (0)
+
+
+void initialize_math_spacing(void)
+{
+ /* *INDENT-OFF* */
+ ALL_STYLES (math_param_ord_ord_spacing, 0);
+ ALL_STYLES (math_param_ord_op_spacing, thin_mu_skip);
+ SPLIT_STYLES (math_param_ord_bin_spacing, med_mu_skip, 0);
+ SPLIT_STYLES (math_param_ord_rel_spacing, thick_mu_skip, 0);
+ ALL_STYLES (math_param_ord_open_spacing, 0);
+ ALL_STYLES (math_param_ord_close_spacing, 0);
+ ALL_STYLES (math_param_ord_punct_spacing, 0);
+ SPLIT_STYLES (math_param_ord_inner_spacing, thin_mu_skip, 0);
+
+ ALL_STYLES (math_param_op_ord_spacing, thin_mu_skip);
+ ALL_STYLES (math_param_op_op_spacing, thin_mu_skip);
+ ALL_STYLES (math_param_op_bin_spacing, 0);
+ SPLIT_STYLES (math_param_op_rel_spacing, thick_mu_skip, 0);
+ ALL_STYLES (math_param_op_open_spacing, 0);
+ ALL_STYLES (math_param_op_close_spacing, 0);
+ ALL_STYLES (math_param_op_punct_spacing, 0);
+ SPLIT_STYLES (math_param_op_inner_spacing, thin_mu_skip, 0);
+
+ SPLIT_STYLES (math_param_bin_ord_spacing, med_mu_skip, 0);
+ SPLIT_STYLES (math_param_bin_op_spacing, med_mu_skip, 0);
+ ALL_STYLES (math_param_bin_bin_spacing, 0);
+ ALL_STYLES (math_param_bin_rel_spacing, 0);
+ SPLIT_STYLES (math_param_bin_open_spacing, med_mu_skip, 0);
+ ALL_STYLES (math_param_bin_close_spacing, 0);
+ ALL_STYLES (math_param_bin_punct_spacing, 0);
+ SPLIT_STYLES (math_param_bin_inner_spacing, med_mu_skip, 0);
+
+ SPLIT_STYLES (math_param_rel_ord_spacing, thick_mu_skip, 0);
+ SPLIT_STYLES (math_param_rel_op_spacing, thick_mu_skip, 0);
+ ALL_STYLES (math_param_rel_bin_spacing, 0);
+ ALL_STYLES (math_param_rel_rel_spacing, 0);
+ SPLIT_STYLES (math_param_rel_open_spacing, thick_mu_skip, 0);
+ ALL_STYLES (math_param_rel_close_spacing, 0);
+ ALL_STYLES (math_param_rel_punct_spacing, 0);
+ SPLIT_STYLES (math_param_rel_inner_spacing, thick_mu_skip, 0);
+
+ ALL_STYLES (math_param_open_ord_spacing, 0);
+ ALL_STYLES (math_param_open_op_spacing, 0);
+ ALL_STYLES (math_param_open_bin_spacing, 0);
+ ALL_STYLES (math_param_open_rel_spacing, 0);
+ ALL_STYLES (math_param_open_open_spacing, 0);
+ ALL_STYLES (math_param_open_close_spacing, 0);
+ ALL_STYLES (math_param_open_punct_spacing, 0);
+ ALL_STYLES (math_param_open_inner_spacing, 0);
+
+ ALL_STYLES (math_param_close_ord_spacing, 0);
+ ALL_STYLES (math_param_close_op_spacing, thin_mu_skip);
+ SPLIT_STYLES (math_param_close_bin_spacing, med_mu_skip, 0);
+ SPLIT_STYLES (math_param_close_rel_spacing, thick_mu_skip, 0);
+ ALL_STYLES (math_param_close_open_spacing, 0);
+ ALL_STYLES (math_param_close_close_spacing, 0);
+ ALL_STYLES (math_param_close_punct_spacing, 0);
+ SPLIT_STYLES (math_param_close_inner_spacing, thin_mu_skip, 0);
+
+ SPLIT_STYLES (math_param_punct_ord_spacing, thin_mu_skip, 0);
+ SPLIT_STYLES (math_param_punct_op_spacing, thin_mu_skip, 0);
+ ALL_STYLES (math_param_punct_bin_spacing, 0);
+ SPLIT_STYLES (math_param_punct_rel_spacing, thin_mu_skip, 0);
+ SPLIT_STYLES (math_param_punct_open_spacing, thin_mu_skip, 0);
+ SPLIT_STYLES (math_param_punct_close_spacing, thin_mu_skip, 0);
+ SPLIT_STYLES (math_param_punct_punct_spacing, thin_mu_skip, 0);
+ SPLIT_STYLES (math_param_punct_inner_spacing, thin_mu_skip, 0);
+
+ SPLIT_STYLES (math_param_inner_ord_spacing, thin_mu_skip, 0);
+ ALL_STYLES (math_param_inner_op_spacing, thin_mu_skip);
+ SPLIT_STYLES (math_param_inner_bin_spacing, med_mu_skip, 0);
+ SPLIT_STYLES (math_param_inner_rel_spacing, thick_mu_skip, 0);
+ SPLIT_STYLES (math_param_inner_open_spacing, thin_mu_skip, 0);
+ ALL_STYLES (math_param_inner_close_spacing, 0);
+ SPLIT_STYLES (math_param_inner_punct_spacing, thin_mu_skip, 0);
+ SPLIT_STYLES (math_param_inner_inner_spacing, thin_mu_skip, 0);
+ /* *INDENT-ON* */
+}
+
+
+pointer math_spacing_glue_old(int l_type, int r_type, int m_style)
+{
+ pointer y, z;
+ int x;
+ z = null;
+ switch (math_spacing[l_type * 8 + r_type - 9 * ord_noad]) {
+ case '0':
+ x = 0;
+ break;
+ case '1':
+ x = (m_style < script_style ? param_thin_mu_skip_code : 0);
+ break;
+ case '2':
+ x = param_thin_mu_skip_code;
+ break;
+ case '3':
+ x = (m_style < script_style ? param_med_mu_skip_code : 0);
+ break;
+ case '4':
+ x = (m_style < script_style ? param_thick_mu_skip_code : 0);
+ break;
+ default:
+ tconfusion("mlist4"); /* this can't happen mlist4 */
+ x = -1;
+ break;
+ }
+ if (x != 0) {
+ y = math_glue(glue_par(x), cur_mu);
+ z = new_glue(y);
+ glue_ref_count(y) = null;
+ subtype(z) = x + 1; /* store a symbolic subtype */
+ }
+ return z;
+}
+
+#define both_types(A,B) ((A)*8+B)
+
+pointer math_spacing_glue(int l_type, int r_type, int m_style)
+{
+ int x = -1;
+ pointer z = null;
+ switch (both_types(l_type, r_type)) {
+ /* *INDENT-OFF* */
+ case both_types(ord_noad, ord_noad ): x = get_math_param(math_param_ord_ord_spacing,m_style); break;
+ case both_types(ord_noad, op_noad ): x = get_math_param(math_param_ord_op_spacing,m_style); break;
+ case both_types(ord_noad, bin_noad ): x = get_math_param(math_param_ord_bin_spacing,m_style); break;
+ case both_types(ord_noad, rel_noad ): x = get_math_param(math_param_ord_rel_spacing,m_style); break;
+ case both_types(ord_noad, open_noad ): x = get_math_param(math_param_ord_open_spacing,m_style); break;
+ case both_types(ord_noad, close_noad): x = get_math_param(math_param_ord_close_spacing,m_style); break;
+ case both_types(ord_noad, punct_noad): x = get_math_param(math_param_ord_punct_spacing,m_style); break;
+ case both_types(ord_noad, inner_noad): x = get_math_param(math_param_ord_inner_spacing,m_style); break;
+ case both_types(op_noad, ord_noad ): x = get_math_param(math_param_op_ord_spacing,m_style); break;
+ case both_types(op_noad, op_noad ): x = get_math_param(math_param_op_op_spacing,m_style); break;
+ /*case both_types(op_noad, bin_noad ): x = get_math_param(math_param_op_bin_spacing,m_style); break;*/
+ case both_types(op_noad, rel_noad ): x = get_math_param(math_param_op_rel_spacing,m_style); break;
+ case both_types(op_noad, open_noad ): x = get_math_param(math_param_op_open_spacing,m_style); break;
+ case both_types(op_noad, close_noad): x = get_math_param(math_param_op_close_spacing,m_style); break;
+ case both_types(op_noad, punct_noad): x = get_math_param(math_param_op_punct_spacing,m_style); break;
+ case both_types(op_noad, inner_noad): x = get_math_param(math_param_op_inner_spacing,m_style); break;
+ case both_types(bin_noad, ord_noad ): x = get_math_param(math_param_bin_ord_spacing,m_style); break;
+ case both_types(bin_noad, op_noad ): x = get_math_param(math_param_bin_op_spacing,m_style); break;
+ /*case both_types(bin_noad, bin_noad ): x = get_math_param(math_param_bin_bin_spacing,m_style); break;*/
+ /*case both_types(bin_noad, rel_noad ): x = get_math_param(math_param_bin_rel_spacing,m_style); break;*/
+ case both_types(bin_noad, open_noad ): x = get_math_param(math_param_bin_open_spacing,m_style); break;
+ /*case both_types(bin_noad, close_noad): x = get_math_param(math_param_bin_close_spacing,m_style); break;*/
+ /*case both_types(bin_noad, punct_noad): x = get_math_param(math_param_bin_punct_spacing,m_style); break;*/
+ case both_types(bin_noad, inner_noad): x = get_math_param(math_param_bin_inner_spacing,m_style); break;
+ case both_types(rel_noad, ord_noad ): x = get_math_param(math_param_rel_ord_spacing,m_style); break;
+ case both_types(rel_noad, op_noad ): x = get_math_param(math_param_rel_op_spacing,m_style); break;
+ /*case both_types(rel_noad, bin_noad ): x = get_math_param(math_param_rel_bin_spacing,m_style); break;*/
+ case both_types(rel_noad, rel_noad ): x = get_math_param(math_param_rel_rel_spacing,m_style); break;
+ case both_types(rel_noad, open_noad ): x = get_math_param(math_param_rel_open_spacing,m_style); break;
+ case both_types(rel_noad, close_noad): x = get_math_param(math_param_rel_close_spacing,m_style); break;
+ case both_types(rel_noad, punct_noad): x = get_math_param(math_param_rel_punct_spacing,m_style); break;
+ case both_types(rel_noad, inner_noad): x = get_math_param(math_param_rel_inner_spacing,m_style); break;
+ case both_types(open_noad, ord_noad ): x = get_math_param(math_param_open_ord_spacing,m_style); break;
+ case both_types(open_noad, op_noad ): x = get_math_param(math_param_open_op_spacing,m_style); break;
+ /*case both_types(open_noad, bin_noad ): x = get_math_param(math_param_open_bin_spacing,m_style); break;*/
+ case both_types(open_noad, rel_noad ): x = get_math_param(math_param_open_rel_spacing,m_style); break;
+ case both_types(open_noad, open_noad ): x = get_math_param(math_param_open_open_spacing,m_style); break;
+ case both_types(open_noad, close_noad): x = get_math_param(math_param_open_close_spacing,m_style); break;
+ case both_types(open_noad, punct_noad): x = get_math_param(math_param_open_punct_spacing,m_style); break;
+ case both_types(open_noad, inner_noad): x = get_math_param(math_param_open_inner_spacing,m_style); break;
+ case both_types(close_noad,ord_noad ): x = get_math_param(math_param_close_ord_spacing,m_style); break;
+ case both_types(close_noad,op_noad ): x = get_math_param(math_param_close_op_spacing,m_style); break;
+ case both_types(close_noad,bin_noad ): x = get_math_param(math_param_close_bin_spacing,m_style); break;
+ case both_types(close_noad,rel_noad ): x = get_math_param(math_param_close_rel_spacing,m_style); break;
+ case both_types(close_noad,open_noad ): x = get_math_param(math_param_close_open_spacing,m_style); break;
+ case both_types(close_noad,close_noad): x = get_math_param(math_param_close_close_spacing,m_style); break;
+ case both_types(close_noad,punct_noad): x = get_math_param(math_param_close_punct_spacing,m_style); break;
+ case both_types(close_noad,inner_noad): x = get_math_param(math_param_close_inner_spacing,m_style); break;
+ case both_types(punct_noad,ord_noad ): x = get_math_param(math_param_punct_ord_spacing,m_style); break;
+ case both_types(punct_noad,op_noad ): x = get_math_param(math_param_punct_op_spacing,m_style); break;
+ /*case both_types(punct_noad,bin_noad ): x = get_math_param(math_param_punct_bin_spacing,m_style); break;*/
+ case both_types(punct_noad,rel_noad ): x = get_math_param(math_param_punct_rel_spacing,m_style); break;
+ case both_types(punct_noad,open_noad ): x = get_math_param(math_param_punct_open_spacing,m_style); break;
+ case both_types(punct_noad,close_noad): x = get_math_param(math_param_punct_close_spacing,m_style); break;
+ case both_types(punct_noad,punct_noad): x = get_math_param(math_param_punct_punct_spacing,m_style); break;
+ case both_types(punct_noad,inner_noad): x = get_math_param(math_param_punct_inner_spacing,m_style); break;
+ case both_types(inner_noad,ord_noad ): x = get_math_param(math_param_inner_ord_spacing,m_style); break;
+ case both_types(inner_noad,op_noad ): x = get_math_param(math_param_inner_op_spacing,m_style); break;
+ case both_types(inner_noad,bin_noad ): x = get_math_param(math_param_inner_bin_spacing,m_style); break;
+ case both_types(inner_noad,rel_noad ): x = get_math_param(math_param_inner_rel_spacing,m_style); break;
+ case both_types(inner_noad,open_noad ): x = get_math_param(math_param_inner_open_spacing,m_style); break;
+ case both_types(inner_noad,close_noad): x = get_math_param(math_param_inner_close_spacing,m_style); break;
+ case both_types(inner_noad,punct_noad): x = get_math_param(math_param_inner_punct_spacing,m_style); break;
+ case both_types(inner_noad,inner_noad): x = get_math_param(math_param_inner_inner_spacing,m_style); break;
+ /* *INDENT-ON* */
+ }
+ if (x < 0) {
+ tconfusion("mathspacing");
+ }
+ if (x != 0) {
+ pointer y;
+ if (x <= thick_mu_skip) { /* trap thin/med/thick settings cf. old TeX */
+ y = math_glue(glue_par(x), cur_mu);
+ z = new_glue(y);
+ glue_ref_count(y) = null;
+ subtype(z) = x + 1; /* store a symbolic subtype */
+ } else {
+ y = math_glue(x, cur_mu);
+ z = new_glue(y);
+ glue_ref_count(y) = null;
+ }
+ }
+ return z;
+}
+
+
+
+/* Here is the overall plan of |mlist_to_hlist|, and the list of its
+ local variables.
+*/
+
+void mlist_to_hlist(void)
+{
+ pointer mlist; /* beginning of the given list */
+ boolean penalties; /* should penalty nodes be inserted? */
+ integer style; /* the given style */
+ integer save_style; /* holds |cur_style| during recursion */
+ pointer q; /* runs through the mlist */
+ pointer r; /* the most recent noad preceding |q| */
+ integer r_type; /* the |type| of noad |r|, or |op_noad| if |r=null| */
+ integer r_subtype; /* the |subtype| of noad |r| if |r_type| is |fence_noad| */
+ integer t; /* the effective |type| of noad |q| during the second pass */
+ pointer p, x, y, z; /* temporary registers for list construction */
+ integer pen; /* a penalty to be inserted */
+ integer s; /* the size of a noad to be deleted */
+ scaled max_hl, max_d; /* maximum height and depth of the list translated so far */
+ scaled delta; /* offset between subscript and superscript */
+ mlist = cur_mlist;
+ penalties = mlist_penalties;
+ style = cur_style; /* tuck global parameters away as local variables */
+ q = mlist;
+ r = null;
+ r_type = op_noad;
+ r_subtype = 0;
+ max_hl = 0;
+ max_d = 0;
+ x = null;
+ p = null;
+ setup_cur_size_and_mu();
+ while (q != null) {
+ /* We use the fact that no character nodes appear in an mlist, hence
+ the field |type(q)| is always present. */
+
+ /* One of the things we must do on the first pass is change a |bin_noad| to
+ an |ord_noad| if the |bin_noad| is not in the context of a binary operator.
+ The values of |r| and |r_type| make this fairly easy. */
+ RESWITCH:
+ delta = 0;
+ switch (type(q)) {
+ case bin_noad:
+ switch (r_type) {
+ case bin_noad:
+ case op_noad:
+ case rel_noad:
+ case open_noad:
+ case punct_noad:
+ type(q) = ord_noad;
+ goto RESWITCH;
+ break;
+ case fence_noad:
+ if (r_subtype == left_noad_side) {
+ type(q) = ord_noad;
+ goto RESWITCH;
+ }
+ }
+ break;
+ case rel_noad:
+ case close_noad:
+ case punct_noad:
+ if (r_type == bin_noad)
+ type(r) = ord_noad;
+ break;
+ case fence_noad:
+ if (subtype(q) != left_noad_side)
+ if (r_type == bin_noad)
+ type(r) = ord_noad;
+ goto DONE_WITH_NOAD;
+ break;
+ case fraction_noad:
+ make_fraction(q);
+ goto CHECK_DIMENSIONS;
+ break;
+ case op_noad:
+ delta = make_op(q);
+ if (subtype(q) == limits)
+ goto CHECK_DIMENSIONS;
+ break;
+ case ord_noad:
+ make_ord(q);
+ break;
+ case open_noad:
+ case inner_noad:
+ break;
+ case radical_noad:
+ if (subtype(q) == 4)
+ make_under_delimiter(q);
+ else if (subtype(q) == 5)
+ make_over_delimiter(q);
+ else if (subtype(q) == 6)
+ make_delimiter_under(q);
+ else if (subtype(q) == 7)
+ make_delimiter_over(q);
+ else
+ make_radical(q);
+ break;
+ case over_noad:
+ make_over(q);
+ break;
+ case under_noad:
+ make_under(q);
+ break;
+ case accent_noad:
+ make_math_accent(q);
+ break;
+ case vcenter_noad:
+ make_vcenter(q);
+ break;
+ case style_node:
+ cur_style = subtype(q);
+ setup_cur_size_and_mu();
+ goto DONE_WITH_NODE;
+ break;
+ case choice_node:
+ switch (cur_style / 2) {
+ case 0:
+ choose_mlist(display_mlist);
+ break; /* |display_style=0| */
+ case 1:
+ choose_mlist(text_mlist);
+ break; /* |text_style=2| */
+ case 2:
+ choose_mlist(script_mlist);
+ break; /* |script_style=4| */
+ case 3:
+ choose_mlist(script_script_mlist);
+ break; /* |script_script_style=6| */
+ } /* there are no other cases */
+ flush_node_list(display_mlist(q));
+ flush_node_list(text_mlist(q));
+ flush_node_list(script_mlist(q));
+ flush_node_list(script_script_mlist(q));
+ type(q) = style_node;
+ subtype(q) = cur_style;
+ if (p != null) {
+ z = vlink(q);
+ vlink(q) = p;
+ while (vlink(p) != null)
+ p = vlink(p);
+ vlink(p) = z;
+ }
+ goto DONE_WITH_NODE;
+ break;
+ case ins_node:
+ case mark_node:
+ case adjust_node:
+ case whatsit_node:
+ case penalty_node:
+ case disc_node:
+ goto DONE_WITH_NODE;
+ break;
+ case rule_node:
+ if (height(q) > max_hl)
+ max_hl = height(q);
+ if (depth(q) > max_d)
+ max_d = depth(q);
+ goto DONE_WITH_NODE;
+ break;
+ case glue_node:
+ /*
+ Conditional math glue (`\.{\\nonscript}') results in a |glue_node|
+ pointing to |zero_glue|, with |subtype(q)=cond_math_glue|; in such a case
+ the node following will be eliminated if it is a glue or kern node and if the
+ current size is different from |text_size|. Unconditional math glue
+ (`\.{\\muskip}') is converted to normal glue by multiplying the dimensions
+ by |cur_mu|.
+ @:non_script_}{\.{\\nonscript} primitive@>
+ */
+ if (subtype(q) == mu_glue) {
+ x = glue_ptr(q);
+ y = math_glue(x, cur_mu);
+ delete_glue_ref(x);
+ glue_ptr(q) = y;
+ subtype(q) = normal;
+ } else if ((cur_size != text_size)
+ && (subtype(q) == cond_math_glue)) {
+ p = vlink(q);
+ if (p != null)
+ if ((type(p) == glue_node) || (type(p) == kern_node)) {
+ vlink(q) = vlink(p);
+ vlink(p) = null;
+ flush_node_list(p);
+ }
+ }
+ goto DONE_WITH_NODE;
+ break;
+ case kern_node:
+ math_kern(q, cur_mu);
+ goto DONE_WITH_NODE;
+ break;
+ default:
+ tconfusion("mlist1"); /* this can't happen mlist1 */
+ }
+ /* When we get to the following part of the program, we have ``fallen through''
+ from cases that did not lead to |check_dimensions| or |done_with_noad| or
+ |done_with_node|. Thus, |q|~points to a noad whose nucleus may need to be
+ converted to an hlist, and whose subscripts and superscripts need to be
+ appended if they are present.
+
+ If |nucleus(q)| is not a |math_char|, the variable |delta| is the amount
+ by which a superscript should be moved right with respect to a subscript
+ when both are present.
+ @^subscripts@>
+ @^superscripts@>
+ */
+ switch (type(nucleus(q))) {
+ case math_char_node:
+ case math_text_char_node:
+ fetch(nucleus(q));
+ if (char_exists(cur_f, cur_c)) {
+ delta = char_italic(cur_f, cur_c);
+ p = new_glyph(cur_f, cur_c);
+ reset_attributes(p, node_attr(nucleus(q)));
+ if ((type(nucleus(q)) == math_text_char_node)
+ && (space(cur_f) != 0))
+ delta = 0; /* no italic correction in mid-word of text font */
+ if ((subscr(q) == null) && (delta != 0)) {
+ x = new_kern(delta);
+ reset_attributes(x, node_attr(nucleus(q)));
+ vlink(p) = x;
+ delta = 0;
+ }
+ } else {
+ p = null;
+ }
+ break;
+ case sub_box_node:
+ p = math_list(nucleus(q));
+ break;
+ case sub_mlist_node:
+ cur_mlist = math_list(nucleus(q));
+ save_style = cur_style;
+ mlist_penalties = false;
+ mlist_to_hlist(); /* recursive call */
+ cur_style = save_style;
+ setup_cur_size_and_mu();
+ p = hpack(vlink(temp_head), 0, additional);
+ reset_attributes(p, node_attr(nucleus(q)));
+ break;
+ default:
+ tconfusion("mlist2"); /* this can't happen mlist2 */
+ }
+ assign_new_hlist(q, p);
+ if ((subscr(q) == null) && (supscr(q) == null))
+ goto CHECK_DIMENSIONS;
+ make_scripts(q, delta);
+ CHECK_DIMENSIONS:
+ z = hpack(new_hlist(q), 0, additional);
+ if (height(z) > max_hl)
+ max_hl = height(z);
+ if (depth(z) > max_d)
+ max_d = depth(z);
+ list_ptr(z) = null;
+ flush_node(z); /* only drop the \hbox */
+ DONE_WITH_NOAD:
+ r = q;
+ r_type = type(r);
+ if (r_type == fence_noad) {
+ r_subtype = left_noad_side;
+ cur_style = style;
+ setup_cur_size_and_mu();
+ }
+ DONE_WITH_NODE:
+ q = vlink(q);
+ }
+ if (r_type == bin_noad)
+ type(r) = ord_noad;
+ /* Make a second pass over the mlist, removing all noads and inserting the
+ proper spacing and penalties */
+
+ /* We have now tied up all the loose ends of the first pass of |mlist_to_hlist|.
+ The second pass simply goes through and hooks everything together with the
+ proper glue and penalties. It also handles the |fence_noad|s that
+ might be present, since |max_hl| and |max_d| are now known. Variable |p| points
+ to a node at the current end of the final hlist.
+ */
+ p = temp_head;
+ vlink(p) = null;
+ q = mlist;
+ r_type = 0;
+ cur_style = style;
+ setup_cur_size_and_mu();
+ NEXT_NODE:
+ while (q != null) {
+ /* If node |q| is a style node, change the style and |goto delete_q|;
+ otherwise if it is not a noad, put it into the hlist,
+ advance |q|, and |goto done|; otherwise set |s| to the size
+ of noad |q|, set |t| to the associated type (|ord_noad..
+ inner_noad|), and set |pen| to the associated penalty */
+ /* Just before doing the big |case| switch in the second pass, the program
+ sets up default values so that most of the branches are short. */
+ t = ord_noad;
+ s = noad_size;
+ pen = inf_penalty;
+ switch (type(q)) {
+ case op_noad:
+ case open_noad:
+ case close_noad:
+ case punct_noad:
+ case inner_noad:
+ t = type(q);
+ break;
+ case bin_noad:
+ t = bin_noad;
+ pen = bin_op_penalty;
+ break;
+ case rel_noad:
+ t = rel_noad;
+ pen = rel_penalty;
+ break;
+ case ord_noad:
+ case vcenter_noad:
+ case over_noad:
+ case under_noad:
+ break;
+ case radical_noad:
+ s = radical_noad_size;
+ break;
+ case accent_noad:
+ s = accent_noad_size;
+ break;
+ case fraction_noad:
+ t = inner_noad;
+ s = fraction_noad_size;
+ break;
+ case fence_noad:
+ t = make_left_right(q, style, max_d, max_hl);
+ break;
+ case style_node:
+ /* Change the current style and |goto delete_q| */
+ cur_style = subtype(q);
+ s = style_node_size;
+ setup_cur_size_and_mu();
+ goto DELETE_Q;
+ break;
+ case whatsit_node:
+ case penalty_node:
+ case rule_node:
+ case disc_node:
+ case adjust_node:
+ case ins_node:
+ case mark_node:
+ case glue_node:
+ case kern_node:
+ vlink(p) = q;
+ p = q;
+ q = vlink(q);
+ vlink(p) = null;
+ goto NEXT_NODE;
+ break;
+ default:
+ tconfusion("mlist3"); /* this can't happen mlist3 */
+ }
+ /* Append inter-element spacing based on |r_type| and |t| */
+ if (r_type > 0) { /* not the first noad */
+ z = math_spacing_glue(r_type, t, cur_style);
+ if (z != null) {
+ reset_attributes(z, node_attr(p));
+ vlink(p) = z;
+ p = z;
+ }
+ }
+
+ /* Append any |new_hlist| entries for |q|, and any appropriate penalties */
+ /* We insert a penalty node after the hlist entries of noad |q| if |pen|
+ is not an ``infinite'' penalty, and if the node immediately following |q|
+ is not a penalty node or a |rel_noad| or absent entirely. */
+
+ if (new_hlist(q) != null) {
+ vlink(p) = new_hlist(q);
+ do {
+ p = vlink(p);
+ } while (vlink(p) != null);
+ }
+ if (penalties && vlink(q) != null && pen < inf_penalty) {
+ r_type = type(vlink(q));
+ if (r_type != penalty_node && r_type != rel_noad) {
+ z = new_penalty(pen);
+ reset_attributes(z, node_attr(q));
+ vlink(p) = z;
+ p = z;
+ }
+ }
+ if (type(q) == fence_noad && subtype(q) == right_noad_side)
+ t = open_noad;
+ r_type = t;
+ DELETE_Q:
+ r = q;
+ q = vlink(q);
+ /* The m-to-hlist conversion takes place in-place,
+ so the various dependant fields may not be freed
+ (as would happen if |flush_node| was called).
+ A low-level |free_node| is easier than attempting
+ to nullify such dependant fields for all possible
+ node and noad types.
+ */
+ if (nodetype_has_attributes(type(r)))
+ delete_attribute_ref(node_attr(r));
+ free_node(r, get_node_size(type(r), subtype(r)));
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c
index 5a7ea253be8..2711f53d25e 100644
--- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c
+++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c
@@ -1,9 +1,29 @@
-/* $Id: postlinebreak.c 1155 2008-04-14 07:53:21Z oneiros $ */
+/* postlinebreak.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+static const char _svn_version[] =
+ "$Id: postlinebreak.c 1694 2008-12-28 20:53:16Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/postlinebreak.c $";
+
/* So far we have gotten a little way into the |line_break| routine, having
covered its important |try_break| subroutine. Now let's consider the
rest of the process.
@@ -55,7 +75,7 @@ and begin direction instructions at the beginnings of lines.
#define next_break prev_break /*new name for |prev_break| after links are reversed */
-#define append_list(a,b) \
+#define append_list(a,b) \
{ vlink(cur_list.tail_field)=vlink((a)); cur_list.tail_field = b; }
#define left_skip_code 7 /*glue at left of justified lines */
@@ -87,7 +107,8 @@ void ext_post_line_break(boolean d,
scaled second_width,
scaled second_indent,
scaled first_width,
- scaled first_indent, halfword best_line)
+ scaled first_indent, halfword best_line,
+ halfword pdf_ignored_dimen)
{
boolean have_directional = true;
@@ -151,7 +172,7 @@ void ext_post_line_break(boolean d,
halfword tmp = new_dir(dir_dir(q));
halfword nxt = vlink(temp_head);
couple_nodes(temp_head, tmp);
- couple_nodes(tmp, nxt);
+ try_couple_nodes(tmp, nxt); /* \break\par */
}
if (dir_ptr != null) {
flush_node_list(dir_ptr);
@@ -192,9 +213,9 @@ void ext_post_line_break(boolean d,
assert(vlink(r) == q);
/* |r| refers to the node after which the dir nodes should be closed */
} else if (type(r) == disc_node) {
- halfword a = alink(r), v;
+ halfword a = alink(r);
+ halfword v = vlink(r);
assert(a != null);
- v = vlink(r);
if (v == null) { /* nested disc, let's unfold */
fprintf(stderr, "Nested disc [%d]<-[%d]->null\n", (int) a,
(int) r);
@@ -203,7 +224,7 @@ void ext_post_line_break(boolean d,
while (alink(a) != null)
a = alink(a);
assert(type(a) == nesting_node);
- assert(subtype(a) = no_break_head(0)); /* No_break */
+ assert(subtype(a) == no_break_head(0)); /* No_break */
d = a - subtype(a); /* MAGIC subtype is offset of nesting with disc */
assert(type(d) == disc_node);
v = vlink(d);
@@ -397,13 +418,15 @@ void ext_post_line_break(boolean d,
/* Append the new box to the current vertical list, followed by the list of
special nodes taken out of the box by the packager; */
- if (pdf_each_line_height != 0)
+ if (pdf_each_line_height != pdf_ignored_dimen)
height(just_box) = pdf_each_line_height;
- if (pdf_each_line_depth != 0)
+ if (pdf_each_line_depth != pdf_ignored_dimen)
depth(just_box) = pdf_each_line_depth;
- if ((pdf_first_line_height != 0) && (cur_line == cur_list.pg_field + 1))
+ if ((pdf_first_line_height != pdf_ignored_dimen)
+ && (cur_line == cur_list.pg_field + 1))
height(just_box) = pdf_first_line_height;
- if ((pdf_last_line_depth != 0) && (cur_line + 1 == best_line))
+ if ((pdf_last_line_depth != pdf_ignored_dimen)
+ && (cur_line + 1 == best_line))
depth(just_box) = pdf_last_line_depth;
if (pre_adjust_head != pre_adjust_tail)
@@ -496,9 +519,8 @@ void ext_post_line_break(boolean d,
q = vlink(r);
if (q == cur_break(cur_p) || is_char_node(q))
break;
- if (!
- ((type(q) == whatsit_node)
- && (subtype(q) == local_par_node))) {
+ if (!((type(q) == whatsit_node)
+ && (subtype(q) == local_par_node))) {
if (non_discardable(q)
|| (type(q) == kern_node && subtype(q) != explicit))
break;
diff --git a/Build/source/texk/web2c/luatexdir/tex/primitive.c b/Build/source/texk/web2c/luatexdir/tex/primitive.c
new file mode 100644
index 00000000000..9f2f4e84d36
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/tex/primitive.c
@@ -0,0 +1,668 @@
+/* primitive.c
+
+ Copyright 2008-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+#include "luatex-api.h"
+#include <ptexlib.h>
+
+#include "commands.h"
+#include "primitive.h"
+#include "tokens.h"
+
+static const char _svn_version[] =
+ "$Id: primitive.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/primitive.c $";
+
+/* as usual, the file starts with a bunch of #defines that mimic pascal @ds */
+
+#define level_one 1
+#define flush_string() do { decr(str_ptr); pool_ptr=str_start_macro(str_ptr); } while (0)
+#define cur_length (pool_ptr - str_start_macro(str_ptr))
+#define append_char(a) str_pool[pool_ptr++]=(a)
+
+#define next(a) hash[(a)].lhfield /* link for coalesced lists */
+#define text(a) hash[(a)].rh /* string number for control sequence name */
+#define hash_is_full (hash_used==hash_base) /* test if all positions are occupied */
+#define hash_size 65536
+
+#define span_code 1114113
+#define unless_code 32 /* amount added for `\.{\\unless}' prefix */
+#define protected_token 0x1C00001 /* $2^{21}\cdot|end_match|+1$ */
+#define offset_ocp_name 1
+#define ocp_name(A) ocp_tables[(A)][offset_ocp_name]
+
+#define skip_base get_skip_base()
+#define mu_skip_base get_mu_skip_base()
+#define glue_base static_glue_base
+#define toks_base get_toks_base()
+#define count_base get_count_base()
+#define int_base static_int_base
+#define attribute_base get_attribute_base()
+#define scaled_base get_scaled_base()
+#define dimen_base get_dimen_base()
+
+
+
+/* \primitive support needs a few extra variables and definitions */
+
+#define prim_base 1
+
+/* The arrays |prim| and |prim_eqtb| are used for name -> cmd,chr lookups.
+ *
+ * The are modelled after |hash| and |eqtb|, except that primitives do not
+ * have an |eq_level|, that field is replaced by |origin|.
+ */
+
+#define prim_next(a) prim[(a)].lhfield /* link for coalesced lists */
+#define prim_text(a) prim[(a)].rh /* string number for control sequence name */
+#define prim_is_full (prim_used==prim_base) /* test if all positions are occupied */
+
+#define prim_origin_field(a) (a).hh.b1
+#define prim_eq_type_field(a) (a).hh.b0
+#define prim_equiv_field(a) (a).hh.rh
+#define prim_origin(a) prim_origin_field(prim_eqtb[(a)]) /* level of definition */
+#define prim_eq_type(a) prim_eq_type_field(prim_eqtb[(a)]) /* command code for equivalent */
+#define prim_equiv(a) prim_equiv_field(prim_eqtb[(a)]) /* equivalent value */
+
+static pointer prim_used; /* allocation pointer for |prim| */
+static two_halves prim[(prim_size + 1)]; /* the primitives table */
+static memory_word prim_eqtb[(prim_size + 1)];
+
+/* The array |prim_data| works the other way around, it is used for
+ cmd,chr -> name lookups. */
+
+typedef struct prim_info {
+ halfword subids; /* number of name entries */
+ halfword offset; /* offset to be used for |chr_code|s */
+ str_number *names; /* array of names */
+} prim_info;
+
+static prim_info prim_data[(last_cmd + 1)];
+
+/* initialize the memory arrays */
+
+void init_primitives(void)
+{
+ int k;
+ memset(prim_data, 0, (sizeof(prim_info) * (last_cmd + 1)));
+ memset(prim, 0, (sizeof(two_halves) * (prim_size + 1)));
+ memset(prim_eqtb, 0, (sizeof(memory_word) * (prim_size + 1)));
+ for (k = 0; k <= prim_size; k++)
+ prim_eq_type(k) = undefined_cs_cmd;
+}
+
+void ini_init_primitives(void)
+{
+ prim_used = prim_size; /* nothing is used */
+}
+
+
+/* The value of |hash_prime| should be roughly 85\pct! of |hash_size|, and it
+ should be a prime number. The theory of hashing tells us to expect fewer
+ than two table probes, on the average, when the search is successful.
+ [See J.~S. Vitter, {\sl Journal of the ACM\/ \bf30} (1983), 231--258.]
+ @^Vitter, Jeffrey Scott@>
+*/
+
+static halfword compute_hash(char *j, pool_pointer l, halfword prime_number)
+{
+ pool_pointer k;
+ halfword h = (unsigned char) *j;
+ for (k = 1; k <= l - 1; k++) {
+ h = h + h + (unsigned char) *(j + k);
+ while (h >= prime_number)
+ h = h - prime_number;
+ }
+ return h;
+}
+
+
+/* Here is the subroutine that searches the primitive table for an identifier */
+
+pointer prim_lookup(str_number s)
+{
+ integer h; /* hash code */
+ pointer p; /* index in |hash| array */
+ pool_pointer j, l;
+ if (s < string_offset) {
+ p = s;
+ if ((p < 0) || (get_prim_eq_type(p) == undefined_cs_cmd)) {
+ p = undefined_primitive;
+ }
+ } else {
+ j = str_start_macro(s);
+ if (s == str_ptr)
+ l = cur_length;
+ else
+ l = length(s);
+ h = compute_hash((char *) (str_pool + j), l, prim_prime);
+ p = h + prim_base; /* we start searching here; note that |0<=h<hash_prime| */
+ while (1) {
+ if (prim_text(p) > 0)
+ if (length(prim_text(p)) == l)
+ if (str_eq_str(prim_text(p), s))
+ goto FOUND;
+ if (prim_next(p) == 0) {
+ if (no_new_control_sequence) {
+ p = undefined_primitive;
+ } else {
+ /* Insert a new primitive after |p|, then make |p| point to it */
+ if (prim_text(p) > 0) {
+ do { /* search for an empty location in |prim| */
+ if (prim_is_full)
+ overflow_string("primitive size", prim_size);
+ decr(prim_used);
+ } while (prim_text(prim_used) != 0);
+ prim_next(p) = prim_used;
+ p = prim_used;
+ }
+ prim_text(p) = s;
+ }
+ goto FOUND;
+ }
+ p = prim_next(p);
+ }
+ }
+ FOUND:
+ return p;
+}
+
+/* how to test a csname for primitive-ness */
+
+boolean is_primitive(str_number csname)
+{
+ integer n, m;
+ m = prim_lookup(csname);
+ n = string_lookup(makecstring(csname), length(csname));
+ return ((n != undefined_cs_cmd) &&
+ (m != undefined_primitive) &&
+ (eq_type(n) == prim_eq_type(m)) && (equiv(n) == prim_equiv(m)));
+}
+
+
+/* a few simple accessors */
+
+quarterword get_prim_eq_type(integer p)
+{
+ return prim_eq_type(p);
+}
+
+quarterword get_prim_origin(integer p)
+{
+ return prim_origin(p);
+}
+
+halfword get_prim_equiv(integer p)
+{
+ return prim_equiv(p);
+}
+
+str_number get_prim_text(integer p)
+{
+ return prim_text(p);
+}
+
+
+/* dumping and undumping */
+
+void dump_primitives(void)
+{
+ int p, q;
+ for (p = 0; p <= prim_size; p++)
+ dump_hh(prim[p]);
+ for (p = 0; p <= prim_size; p++)
+ dump_wd(prim_eqtb[p]);
+ for (p = 0; p <= last_cmd; p++) {
+ dump_int(prim_data[p].offset);
+ dump_int(prim_data[p].subids);
+ for (q = 0; q < prim_data[p].subids; q++) {
+ dump_int(prim_data[p].names[q]);
+ }
+ }
+}
+
+void undump_primitives(void)
+{
+ int p, q;
+ for (p = 0; p <= prim_size; p++)
+ undump_hh(prim[p]);
+ for (p = 0; p <= prim_size; p++)
+ undump_wd(prim_eqtb[p]);
+
+ for (p = 0; p <= last_cmd; p++) {
+ undump_int(prim_data[p].offset);
+ undump_int(prim_data[p].subids);
+ if (prim_data[p].subids > 0) {
+ prim_data[p].names =
+ (str_number *) xcalloc((prim_data[p].subids),
+ sizeof(str_number *));
+ }
+ for (q = 0; q < prim_data[p].subids; q++) {
+ undump_int(prim_data[p].names[q]);
+ }
+ }
+}
+
+/*
+ We need to put \TeX's ``primitive'' control sequences into the hash
+ table, together with their command code (which will be the |eq_type|)
+ and an operand (which will be the |equiv|). The |primitive| procedure
+ does this, in a way that no \TeX\ user can. The global value |cur_val|
+ contains the new |eqtb| pointer after |primitive| has acted.
+*/
+
+/* Because the definitions of the actual user-accessible name of a
+ primitive can be postponed until runtime, the function |primitive_def|
+ is needed that does nothing except creating the control sequence name.
+*/
+
+void primitive_def(char *s, size_t l, quarterword c, halfword o)
+{
+ int nncs = no_new_control_sequence;
+ no_new_control_sequence = false;
+ cur_val = string_lookup(s, l); /* this creates the |text()| string */
+ no_new_control_sequence = nncs;
+ eq_level(cur_val) = level_one;
+ eq_type(cur_val) = c;
+ equiv(cur_val) = o;
+}
+
+/* The function |store_primitive_name| sets up the bookkeeping for the
+ reverse lookup. It is quite paranoid, because it is easy to mess this up
+ accidentally.
+
+ The |offset| is needed because sometimes character codes (in |o|)
+ are indices into |eqtb| or are offset by a magical value to make
+ sure they do not conflict with something else. We don't want the
+ |prim_data[c].names| to have too many entries as it will just be
+ wasted room, so |offset| is substracted from |o| because creating
+ or accessing the array. The |assert(idx<=0xFFFF)| is not strictly
+ needed, but it helps catch errors of this kind.
+*/
+
+void
+store_primitive_name(str_number s, quarterword c, halfword o, halfword offset)
+{
+ int idx;
+ if (prim_data[c].offset != 0 && prim_data[c].offset != offset) {
+ assert(false);
+ }
+ prim_data[c].offset = offset;
+ idx = ((int) o - offset);
+ assert(idx >= 0);
+ assert(idx <= 0xFFFF);
+ if (prim_data[c].subids < (idx + 1)) {
+ str_number *new =
+ (str_number *) xcalloc((idx + 1), sizeof(str_number *));
+ if (prim_data[c].names != NULL) {
+ assert(prim_data[c].subids);
+ memcpy(new, (prim_data[c].names),
+ (prim_data[c].subids * sizeof(str_number)));
+ free(prim_data[c].names);
+ }
+ prim_data[c].names = new;
+ prim_data[c].subids = idx + 1;
+ }
+ prim_data[c].names[idx] = s;
+}
+
+/* Compared to tex82, |primitive| has two extra parameters. The |off| is an offset
+ that will be passed on to |store_primitive_name|, the |cmd_origin| is the bit
+ that is used to group primitives by originator.
+*/
+
+void
+primitive(str_number ss, quarterword c, halfword o, halfword off,
+ int cmd_origin)
+{
+ str_number s; /* actual |str_number| used */
+ integer prim_val; /* needed to fill |prim_eqtb| */
+ assert(o >= off);
+ if (ss < string_offset) {
+ if (ss > 127)
+ tconfusion("prim"); /* should be ASCII */
+ append_char(ss);
+ s = make_string();
+ } else {
+ s = ss;
+ }
+ char *thes = makecstring(s);
+ if (true || cmd_origin == tex_command || cmd_origin == core_command) {
+ primitive_def(thes, strlen(thes), c, o);
+ }
+ prim_val = prim_lookup(s);
+ prim_origin(prim_val) = cmd_origin;
+ prim_eq_type(prim_val) = c;
+ prim_equiv(prim_val) = o;
+ store_primitive_name(s, c, o, off);
+}
+
+
+/*
+ * Here is a helper that does the actual hash insertion.
+ */
+
+static halfword insert_id(halfword p, unsigned char *j, pool_pointer l)
+{
+ integer d;
+ unsigned char *k;
+ /* This code far from ideal: the existance of |hash_extra| changes
+ all the potential (short) coalesced lists into a single (long)
+ one. This will create a slowdown. */
+ if (text(p) > 0) {
+ if (hash_high < hash_extra) {
+ incr(hash_high);
+ /* can't use eqtb_top here (perhaps because that is not finalized
+ yet when called from |primitive|?) */
+ next(p) = hash_high + get_eqtb_size();
+ p = next(p);
+ } else {
+ do {
+ if (hash_is_full)
+ overflow_string("hash size", hash_size + hash_extra);
+ decr(hash_used);
+ } while (text(hash_used) != 0); /* search for an empty location in |hash| */
+ next(p) = hash_used;
+ p = hash_used;
+ }
+ }
+ check_pool_overflow((pool_ptr + l));
+ d = cur_length;
+ while (pool_ptr > str_start_macro(str_ptr)) {
+ /* move current string up to make room for another */
+ decr(pool_ptr);
+ str_pool[pool_ptr + l] = str_pool[pool_ptr];
+ }
+ for (k = j; k <= j + l - 1; k++)
+ append_char(*k);
+ text(p) = make_string();
+ pool_ptr = pool_ptr + d;
+ incr(cs_count);
+ return p;
+}
+
+
+/*
+ Here is the subroutine that searches the hash table for an identifier
+ that matches a given string of length |l>1| appearing in |buffer[j..
+ (j+l-1)]|. If the identifier is found, the corresponding hash table address
+ is returned. Otherwise, if the global variable |no_new_control_sequence|
+ is |true|, the dummy address |undefined_control_sequence| is returned.
+ Otherwise the identifier is inserted into the hash table and its location
+ is returned.
+*/
+
+
+pointer id_lookup(integer j, integer l)
+{ /* search the hash table */
+ integer h; /* hash code */
+ pointer p; /* index in |hash| array */
+
+ h = compute_hash((char *) (buffer + j), l, hash_prime);
+ p = h + hash_base; /* we start searching here; note that |0<=h<hash_prime| */
+ while (1) {
+ if (text(p) > 0)
+ if (length(text(p)) == l)
+ if (str_eq_buf(text(p), j))
+ goto FOUND;
+ if (next(p) == 0) {
+ if (no_new_control_sequence) {
+ p = static_undefined_control_sequence;
+ } else {
+ p = insert_id(p, (buffer + j), l);
+ }
+ goto FOUND;
+ }
+ p = next(p);
+ }
+ FOUND:
+ return p;
+}
+
+/*
+ * Here is a similar subroutine for finding a primitive in the hash.
+ * This one is based on a C string.
+ */
+
+
+pointer string_lookup(char *s, size_t l)
+{ /* search the hash table */
+ integer h; /* hash code */
+ pointer p; /* index in |hash| array */
+ h = compute_hash(s, l, hash_prime);
+ p = h + hash_base; /* we start searching here; note that |0<=h<hash_prime| */
+ while (1) {
+ if (text(p) > 0)
+ if (str_eq_cstr(text(p), s, l))
+ goto FOUND;
+ if (next(p) == 0) {
+ if (no_new_control_sequence) {
+ p = static_undefined_control_sequence;
+ } else {
+ p = insert_id(p, (unsigned char *) s, l);
+ }
+ goto FOUND;
+ }
+ p = next(p);
+ }
+ FOUND:
+ return p;
+}
+
+/* The |print_cmd_chr| routine prints a symbolic interpretation of a
+ command code and its modifier. This is used in certain `\.{You can\'t}'
+ error messages, and in the implementation of diagnostic routines like
+ \.{\\show}.
+
+ The body of |print_cmd_chr| use to be a rather tedious listing of print
+ commands, and most of it was essentially an inverse to the |primitive|
+ routine that enters a \TeX\ primitive into |eqtb|.
+
+ Thanks to |prim_data|, there is no need for all that tediousness. What
+ is left of |primt_cnd_chr| are just the exceptions to the general rule
+ that the |cmd,chr_code| pair represents in a single primitive command.
+*/
+
+#define chr_cmd(A) do { tprint(A); print(chr_code); } while (0)
+
+void prim_cmd_chr(quarterword cmd, halfword chr_code)
+{
+ int idx = chr_code - prim_data[cmd].offset;
+ if (cmd <= last_cmd &&
+ idx >= 0 && idx < prim_data[cmd].subids &&
+ prim_data[cmd].names != NULL && prim_data[cmd].names[idx] != 0) {
+ tprint("\\");
+ print(prim_data[cmd].names[idx]);
+ } else {
+ /* TEX82 didn't print the |cmd,idx| information, but it may be useful */
+ tprint("[unknown command code! (");
+ print_int(cmd);
+ tprint(", ");
+ print_int(idx);
+ tprint(")]");
+ }
+}
+
+void print_cmd_chr(quarterword cmd, halfword chr_code)
+{
+ integer n; /* temp variable */
+ switch (cmd) {
+ case left_brace_cmd:
+ chr_cmd("begin-group character ");
+ break;
+ case right_brace_cmd:
+ chr_cmd("end-group character ");
+ break;
+ case math_shift_cmd:
+ chr_cmd("math shift character ");
+ break;
+ case mac_param_cmd:
+ chr_cmd("macro parameter character ");
+ break;
+ case sup_mark_cmd:
+ chr_cmd("superscript character ");
+ break;
+ case sub_mark_cmd:
+ chr_cmd("subscript character ");
+ break;
+ case endv_cmd:
+ tprint("end of alignment template");
+ break;
+ case spacer_cmd:
+ chr_cmd("blank space ");
+ break;
+ case letter_cmd:
+ chr_cmd("the letter ");
+ break;
+ case other_char_cmd:
+ chr_cmd("the character ");
+ break;
+ case tab_mark_cmd:
+ if (chr_code == span_code)
+ tprint_esc("span");
+ else
+ chr_cmd("alignment tab character ");
+ break;
+ case if_test_cmd:
+ if (chr_code >= unless_code)
+ tprint_esc("unless");
+ prim_cmd_chr(cmd, (chr_code % unless_code));
+ break;
+ case math_comp_cmd:
+ print_math_comp(chr_code);
+ break;
+ case limit_switch_cmd:
+ print_limit_switch(chr_code);
+ break;
+ case math_style_cmd:
+ print_style(chr_code);
+ break;
+ case char_given_cmd:
+ tprint_esc("char");
+ print_hex(chr_code);
+ break;
+ case math_given_cmd:
+ tprint_esc("mathchar");
+ show_mathcode_value(mathchar_from_integer(chr_code, tex_mathcode));
+ break;
+ case omath_given_cmd:
+ tprint_esc("omathchar");
+ show_mathcode_value(mathchar_from_integer(chr_code, aleph_mathcode));
+ break;
+ case xmath_given_cmd:
+ tprint_esc("Umathchar");
+ show_mathcode_value(mathchar_from_integer(chr_code, xetex_mathcode));
+ break;
+ case def_family_cmd:
+ print_size(chr_code);
+ break;
+ case set_math_param_cmd:
+ print_math_param(chr_code);
+ break;
+ case set_font_cmd:
+ tprint("select font ");
+ tprint(font_name(chr_code));
+ if (font_size(chr_code) != font_dsize(chr_code)) {
+ tprint(" at ");
+ print_scaled(font_size(chr_code));
+ tprint("pt");
+ }
+ break;
+ case undefined_cs_cmd:
+ tprint("undefined");
+ break;
+ case call_cmd:
+ case long_call_cmd:
+ case outer_call_cmd:
+ case long_outer_call_cmd:
+ n = cmd - call_cmd;
+ if (info(link(chr_code)) == protected_token)
+ n = n + 4;
+ if (odd(n / 4))
+ tprint_esc("protected");
+ if (odd(n))
+ tprint_esc("long");
+ if (odd(n / 2))
+ tprint_esc("outer");
+ if (n > 0)
+ tprint(" ");
+ tprint("macro");
+ break;
+ case extension_cmd:
+ if (chr_code < prim_data[cmd].subids &&
+ prim_data[cmd].names[chr_code] != 0) {
+ prim_cmd_chr(cmd, chr_code);
+ } else {
+ tprint("[unknown extension! (");
+ print_int(chr_code);
+ tprint(")]");
+
+ }
+ break;
+ case set_ocp_cmd:
+ tprint("select ocp ");
+ slow_print(ocp_name(chr_code));
+ break;
+ case set_ocp_list_cmd:
+ tprint("select ocp list ");
+ break;
+ case assign_glue_cmd:
+ case assign_mu_glue_cmd:
+ if (chr_code < skip_base) {
+ print_skip_param(chr_code - glue_base);
+ } else if (chr_code < mu_skip_base) {
+ tprint_esc("skip");
+ print_int(chr_code - skip_base);
+ } else {
+ tprint_esc("muskip");
+ print_int(chr_code - mu_skip_base);
+ }
+ break;
+ case assign_toks_cmd:
+ if (chr_code >= toks_base) {
+ tprint_esc("toks");
+ print_int(chr_code - toks_base);
+ } else {
+ prim_cmd_chr(cmd, chr_code);
+ }
+ break;
+ case assign_int_cmd:
+ if (chr_code < count_base) {
+ print_param(chr_code - int_base);
+ } else {
+ tprint_esc("count");
+ print_int(chr_code - count_base);
+ }
+ break;
+ case assign_attr_cmd:
+ tprint_esc("attribute");
+ print_int(chr_code - attribute_base);
+ break;
+ case assign_dimen_cmd:
+ if (chr_code < scaled_base) {
+ print_length_param(chr_code - dimen_base);
+ } else {
+ tprint_esc("dimen");
+ print_int(chr_code - scaled_base);
+ }
+ break;
+ default:
+ /* these are most commands, actually */
+ prim_cmd_chr(cmd, chr_code);
+ break;
+ }
+}
diff --git a/Build/source/texk/web2c/luatexdir/tex/texdeffont.c b/Build/source/texk/web2c/luatexdir/tex/texdeffont.c
new file mode 100644
index 00000000000..5be7d084781
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/tex/texdeffont.c
@@ -0,0 +1,189 @@
+/* texdeffont.c
+
+ Copyright 2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+#include "luatex-api.h"
+#include <ptexlib.h>
+
+#include "tokens.h"
+#include "nodes.h"
+#include "commands.h"
+
+static const char _svn_version[] =
+ "$Id: texdeffont.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/texdeffont.c $";
+
+#define text(a) hash[(a)].rh /* string number for control sequence name */
+#define null_cs 1 /* equivalent of \.{\\csname\\endcsname} */
+#define scan_normal_dimen() scan_dimen(false,false,false)
+
+char *scaled_to_string(scaled s)
+{ /* prints scaled real, rounded to five digits */
+ static char result[16];
+ int n, k;
+ scaled delta; /* amount of allowable inaccuracy */
+ k = 0;
+ if (s < 0) {
+ result[k++] = '-';
+ s = -s; /* print the sign, if negative */
+ }
+ {
+ int l = 0;
+ char dig[8] = { 0 };
+ n = s / unity;
+ /* process the integer part */
+ do {
+ dig[l++] = n % 10;
+ n = n / 10;;
+ } while (n > 0);
+ while (l > 0) {
+ result[k++] = (dig[--l] + '0');
+ }
+ }
+ result[k++] = '.';
+ s = 10 * (s % unity) + 5;
+ delta = 10;
+ do {
+ if (delta > unity)
+ s = s + 0100000 - 050000; /* round the last digit */
+ result[k++] = '0' + (s / unity);
+ s = 10 * (s % unity);
+ delta = delta * 10;
+ } while (s > delta);
+
+ result[k] = 0;
+ return (char *) result;
+}
+
+void tex_def_font(small_number a)
+{
+ pointer u; /* user's font identifier */
+ internal_font_number f; /* runs through existing fonts */
+ str_number t; /* name for the frozen font identifier */
+ int old_setting; /* holds |selector| setting */
+ integer offset = 0;
+ scaled s = -1000; /* stated ``at'' size, or negative of scaled magnification */
+ integer natural_dir = -1; /* the natural direction of the font */
+ if (job_name == 0)
+ open_log_file(); /* avoid confusing \.{texput} with the font name */
+ get_r_token();
+ u = cur_cs;
+ if (u >= null_cs)
+ t = text(u);
+ else
+ t = maketexstring("FONT");
+ if (a >= 4) {
+ geq_define(u, set_font_cmd, null_font);
+ } else {
+ eq_define(u, set_font_cmd, null_font);
+ }
+ scan_optional_equals();
+ /* @<Get the next non-blank non-call token@>; */
+ do {
+ get_x_token();
+ } while ((cur_cmd == spacer_cmd) || (cur_cmd == relax_cmd));
+
+ if (cur_cmd != left_brace_cmd) {
+ back_input();
+ scan_file_name();
+ if (cur_area != get_nullstr() || cur_ext != get_nullstr()) {
+ /* Have to do some rescue-ing here, fonts only have a name,
+ no area nor extension */
+ old_setting = selector;
+ selector = new_string;
+ if (cur_area != get_nullstr()) {
+ print(cur_area);
+ }
+ if (cur_name != get_nullstr()) {
+ print(cur_name);
+ }
+ if (cur_ext != get_nullstr()) {
+ print(cur_ext);
+ }
+ selector = old_setting;
+ cur_name = make_string();
+ cur_ext = get_nullstr();
+ cur_area = get_nullstr();
+ }
+ } else {
+ back_input();
+ (void) scan_toks(false, true);
+ old_setting = selector;
+ selector = new_string;
+ token_show(def_ref);
+ selector = old_setting;
+ flush_list(def_ref);
+ /* str_room(1); *//* what did that do ? */
+ cur_name = make_string();
+ cur_ext = get_nullstr();
+ cur_area = get_nullstr();
+ }
+ /* @<Scan the font size specification@>; */
+ name_in_progress = true; /* this keeps |cur_name| from being changed */
+ if (scan_keyword("at")) {
+ /* @<Put the \(p)(positive) `at' size into |s|@> */
+ scan_normal_dimen();
+ s = cur_val;
+ if ((s <= 0) || (s >= 01000000000)) {
+ char err[256];
+ char *errhelp[] =
+ { "I can only handle fonts at positive sizes that are",
+ "less than 2048pt, so I've changed what you said to 10pt.",
+ NULL
+ };
+ snprintf(err, 255, "Improper `at' size (%spt), replaced by 10pt",
+ scaled_to_string(s));
+ tex_error(err, errhelp);
+ s = 10 * unity;
+ }
+ } else if (scan_keyword("scaled")) {
+ scan_int();
+ s = -cur_val;
+ if ((cur_val <= 0) || (cur_val > 32768)) {
+ char err[256];
+ char *errhelp[] =
+ { "The magnification ratio must be between 1 and 32768.",
+ NULL };
+ snprintf(err, 255,
+ "Illegal magnification has been changed to 1000 (%d)",
+ (int) cur_val);
+ tex_error(err, errhelp);
+ s = -1000;
+ }
+ }
+ if (scan_keyword("offset")) {
+ scan_int();
+ offset = cur_val;
+ if (cur_val < 0) {
+ char err[256];
+ char *errhelp[] = { "The offset must be bigger than 0.", NULL };
+ snprintf(err, 255, "Illegal offset has been changed to 0 (%d)",
+ (int) cur_val);
+ tex_error(err, errhelp);
+ offset = 0;
+ }
+ }
+ if (scan_keyword("naturaldir")) {
+ scan_direction();
+ natural_dir = cur_val;
+ }
+ name_in_progress = false;
+ f = read_font_info(u, cur_name, s, natural_dir);
+ equiv(u) = f;
+ zeqtb[get_font_id_base() + f] = zeqtb[u];
+ text(get_font_id_base() + f) = t;
+}
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.c b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
index 733437ffe00..8dcdec2e1ad 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
@@ -1,10 +1,75 @@
-/* $Id: texnodes.c 1168 2008-04-15 13:43:34Z taco $ */
+/* texnodes.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "nodes.h"
+#include "commands.h"
+
+#include "tokens.h"
+#undef name
+
+#define nDEBUG
+
+static const char _svn_version[] =
+ "$Id: texnodes.c 2029 2009-03-14 19:10:25Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/texnodes.c $";
+
+#define append_char(A) str_pool[pool_ptr++]=(A)
+#define cur_length (pool_ptr - str_start_macro(str_ptr))
+#define flush_char() pool_ptr--
+
+#define stretching 1
+#define shrinking 2
+
+#define adjust_pre subtype
-#define MAX_CHAIN_SIZE 12
+typedef enum {
+ pdf_dest_xyz = 0,
+ pdf_dest_fit,
+ pdf_dest_fith,
+ pdf_dest_fitv,
+ pdf_dest_fitb,
+ pdf_dest_fitbh,
+ pdf_dest_fitbv,
+ pdf_dest_fitr,
+} pdf_destination_types;
+
+
+typedef enum {
+ set_origin = 0,
+ direct_page,
+ direct_always,
+} ctm_transform_modes;
+
+
+#define obj_aux(A) obj_tab[(A)].int4
+#define obj_data_ptr obj_aux
+#define obj_obj_data(A) pdf_mem[obj_data_ptr((A)) + 0]
+#define obj_obj_is_stream(A) pdf_mem[obj_data_ptr((A)) + 1]
+#define obj_obj_stream_attr(A) pdf_mem[obj_data_ptr((A)) + 2]
+#define obj_obj_is_file(A) pdf_mem[obj_data_ptr((A)) + 3]
+#define obj_xform_width(A) pdf_mem[obj_data_ptr((A)) + 0]
+#define obj_xform_height(A) pdf_mem[obj_data_ptr((A)) + 1]
+#define obj_xform_depth(A) pdf_mem[obj_data_ptr((A)) + 2]
+
+
+#define MAX_CHAIN_SIZE 13
volatile memory_word *varmem = NULL;
@@ -60,24 +125,33 @@ char *node_fields_glyph[] =
{ "attr", "char", "font", "lang", "left", "right", "uchyph",
"components", "xoffset", "yoffset", NULL
};
-char *node_fields_style[] = { NULL };
-char *node_fields_choice[] = { NULL };
-char *node_fields_ord[] = { NULL };
-char *node_fields_op[] = { NULL };
-char *node_fields_bin[] = { NULL };
-char *node_fields_rel[] = { NULL };
-char *node_fields_open[] = { NULL };
-char *node_fields_close[] = { NULL };
-char *node_fields_punct[] = { NULL };
-char *node_fields_inner[] = { NULL };
-char *node_fields_radical[] = { NULL };
-char *node_fields_fraction[] = { NULL };
-char *node_fields_under[] = { NULL };
-char *node_fields_over[] = { NULL };
-char *node_fields_accent[] = { NULL };
-char *node_fields_vcenter[] = { NULL };
-char *node_fields_left[] = { NULL };
-char *node_fields_right[] = { NULL };
+char *node_fields_style[] = { "attr", "style", NULL };
+char *node_fields_choice[] =
+ { "attr", "display", "text", "script", "scriptscript", NULL };
+char *node_fields_ord[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_op[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_bin[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_rel[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_open[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_close[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_punct[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_inner[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_under[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_over[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_vcenter[] = { "attr", "nucleus", "sub", "sup", NULL };
+char *node_fields_radical[] =
+ { "attr", "nucleus", "sub", "sup", "left", "degree", NULL };
+char *node_fields_fraction[] =
+ { "attr", "width", "num", "denom", "left", "right", NULL };
+char *node_fields_accent[] =
+ { "attr", "nucleus", "sub", "sup", "accent", "bot_accent", NULL };
+char *node_fields_fence[] = { "attr", "delim", NULL };
+char *node_fields_math_char[] = { "attr", "fam", "char", NULL };
+char *node_fields_sub_box[] = { "attr", "list", NULL };
+char *node_fields_sub_mlist[] = { "attr", "list", NULL };
+char *node_fields_math_text_char[] = { "attr", "fam", "char", NULL };
+char *node_fields_delim[] =
+ { "attr", "small_fam", "small_char", "large_fam", "large_char", NULL };
char *node_fields_inserting[] =
{ "height", "last_ins_ptr", "best_ins_ptr", NULL };
@@ -133,7 +207,7 @@ char *node_fields_whatsit_pdf_start_thread[] =
};
char *node_fields_whatsit_pdf_end_thread[] = { "attr", NULL };
char *node_fields_whatsit_pdf_save_pos[] = { "attr", NULL };
-char *node_fields_whatsit_late_lua[] = { "attr", "reg", "data", NULL };
+char *node_fields_whatsit_late_lua[] = { "attr", "reg", "data", "name", NULL };
char *node_fields_whatsit_close_lua[] = { "attr", "reg", NULL };
char *node_fields_whatsit_pdf_colorstack[] =
{ "attr", "stack", "cmd", "data", NULL };
@@ -175,18 +249,23 @@ node_info node_data[] = {
{over_noad, noad_size, node_fields_over, "over"},
{accent_noad, accent_noad_size, node_fields_accent, "accent"},
{vcenter_noad, noad_size, node_fields_vcenter, "vcenter"},
- {left_noad, noad_size, node_fields_left, "left"},
- {right_noad, noad_size, node_fields_right, "right"},
+ {fence_noad, fence_noad_size, node_fields_fence, "fence"},
+ {math_char_node, math_kernel_node_size, node_fields_math_char, "math_char"},
+ {sub_box_node, math_kernel_node_size, node_fields_sub_box, "sub_box"},
+ {sub_mlist_node, math_kernel_node_size, node_fields_sub_mlist, "sub_mlist"},
+ {math_text_char_node, math_kernel_node_size, node_fields_math_text_char,
+ "math_text_char"},
+ {delim_node, math_shield_node_size, node_fields_delim, "delim"},
{margin_kern_node, margin_kern_node_size, node_fields_margin_kern,
"margin_kern"},
- {glyph_node, glyph_node_size, node_fields_glyph, "glyph"}, /* 33 */
+ {glyph_node, glyph_node_size, node_fields_glyph, "glyph"},
{align_record_node, box_node_size, NULL, "align_record"},
{pseudo_file_node, pseudo_file_node_size, NULL, "pseudo_file"},
{pseudo_line_node, variable_node_size, NULL, "pseudo_line"},
{inserting_node, page_ins_node_size, node_fields_inserting, "page_insert"},
{split_up_node, page_ins_node_size, node_fields_splitup, "split_insert"},
{expr_node, expr_node_size, NULL, "expr_stack"},
- {nesting_node, nesting_node_size, NULL, "nested_list"}, /* 40 */
+ {nesting_node, nesting_node_size, NULL, "nested_list"},
{span_node, span_node_size, NULL, "span"},
{attribute_node, attribute_node_size, node_fields_attribute, "attribute"},
{glue_spec_node, glue_spec_size, node_fields_glue_spec, "glue_spec"},
@@ -197,7 +276,7 @@ node_info node_data[] = {
{align_stack_node, align_stack_node_size, NULL, "align_stack"},
{movement_node, movement_node_size, NULL, "movement_stack"},
{if_node, if_node_size, NULL, "if_stack"},
- {unhyphenated_node, active_node_size, NULL, "unhyphenated"}, /* 50 */
+ {unhyphenated_node, active_node_size, NULL, "unhyphenated"},
{hyphenated_node, active_node_size, NULL, "hyphenated"},
{delta_node, delta_node_size, NULL, "delta"},
{passive_node, passive_node_size, NULL, "passive"},
@@ -256,7 +335,8 @@ node_info whatsit_node_data[] = {
{fake_node, fake_node_size, NULL, fake_node_name},
{fake_node, fake_node_size, NULL, fake_node_name},
{fake_node, fake_node_size, NULL, fake_node_name},
- {late_lua_node, write_node_size, node_fields_whatsit_late_lua, "late_lua"},
+ {late_lua_node, late_lua_node_size, node_fields_whatsit_late_lua,
+ "late_lua"},
{close_lua_node, write_node_size, node_fields_whatsit_close_lua,
"close_lua"},
{fake_node, fake_node_size, NULL, fake_node_name},
@@ -278,9 +358,6 @@ node_info whatsit_node_data[] = {
#define last_whatsit_node user_defined_node
-#define get_node_size(i,j) (i!=whatsit_node ? node_data[i].size : whatsit_node_data[j].size)
-#define get_node_name(i,j) (i!=whatsit_node ? node_data[i].name : whatsit_node_data[j].name)
-
halfword new_node(int i, int j)
{
register int s;
@@ -297,10 +374,6 @@ halfword new_node(int i, int j)
case glyph_node:
init_lang_data(n);
break;
- case glue_node:
- case kern_node:
- case glue_spec_node:
- break;
case hlist_node:
case vlist_node:
box_dir(n) = -1;
@@ -345,11 +418,44 @@ halfword new_node(int i, int j)
default:
break;
}
+ /* handle synctex extension */
+ switch (i) {
+ case math_node:
+ synctex_tag_math(n) = cur_input.synctex_tag_field;
+ synctex_line_math(n) = line;
+ break;
+ case glue_node:
+ synctex_tag_glue(n) = cur_input.synctex_tag_field;
+ synctex_line_glue(n) = line;
+ break;
+ case kern_node:
+ /* synctex ignores implicit kerns */
+ if (j != 0) {
+ synctex_tag_kern(n) = cur_input.synctex_tag_field;
+ synctex_line_kern(n) = line;
+ }
+ break;
+ case hlist_node:
+ case vlist_node:
+ case unset_node:
+ synctex_tag_box(n) = cur_input.synctex_tag_field;
+ synctex_line_box(n) = line;
+ break;
+ case rule_node:
+ synctex_tag_rule(n) = cur_input.synctex_tag_field;
+ synctex_line_rule(n) = line;
+ break;
+ }
+ /* take care of attributes */
if (nodetype_has_attributes(i)) {
build_attribute_list(n);
}
type(n) = i;
subtype(n) = j;
+#ifdef DEBUG
+ fprintf(stderr, "Alloc-ing %s node %d\n",
+ get_node_name(type(n), subtype(n)), (int) n);
+#endif
return n;
}
@@ -382,7 +488,7 @@ halfword new_glyph_node(void)
halfword copy_node_list(halfword p)
{
- halfword q; /* previous position in new list */
+ halfword q = null; /* previous position in new list */
halfword h = null; /* head of the list */
copy_error_seen = 0;
while (p != null) {
@@ -410,14 +516,29 @@ halfword copy_node(const halfword p)
}
i = get_node_size(type(p), subtype(p));
r = get_node(i);
+
(void) memcpy((void *) (varmem + r), (void *) (varmem + p),
(sizeof(memory_word) * i));
+ /* handle synctex extension */
+ switch (type(p)) {
+ case math_node:
+ synctex_tag_math(r) = cur_input.synctex_tag_field;
+ synctex_line_math(r) = line;
+ break;
+ case kern_node:
+ synctex_tag_kern(r) = cur_input.synctex_tag_field;
+ synctex_line_kern(r) = line;
+ break;
+ }
+
if (nodetype_has_attributes(type(p))) {
add_node_attr_ref(node_attr(p));
alink(r) = null; /* needs checking */
}
vlink(r) = null;
+
+
switch (type(p)) {
case glyph_node:
s = copy_node_list(lig_ptr(p));
@@ -479,6 +600,74 @@ halfword copy_node(const halfword p)
s = copy_node_list(adjust_ptr(p));
adjust_ptr(r) = s;
break;
+
+ case choice_node:
+ s = copy_node_list(display_mlist(p));
+ display_mlist(r) = s;
+ s = copy_node_list(text_mlist(p));
+ text_mlist(r) = s;
+ s = copy_node_list(script_mlist(p));
+ script_mlist(r) = s;
+ s = copy_node_list(script_script_mlist(p));
+ script_script_mlist(r) = s;
+ break;
+ case ord_noad:
+ case op_noad:
+ case bin_noad:
+ case rel_noad:
+ case open_noad:
+ case close_noad:
+ case punct_noad:
+ case inner_noad:
+ case over_noad:
+ case under_noad:
+ case vcenter_noad:
+ case radical_noad:
+ case accent_noad:
+ s = copy_node_list(nucleus(p));
+ nucleus(r) = s;
+ s = copy_node_list(subscr(p));
+ subscr(r) = s;
+ s = copy_node_list(supscr(p));
+ supscr(r) = s;
+ if (type(p) == accent_noad) {
+ s = copy_node_list(accent_chr(p));
+ accent_chr(r) = s;
+ s = copy_node_list(bot_accent_chr(p));
+ bot_accent_chr(r) = s;
+ } else if (type(p) == radical_noad) {
+ s = copy_node(left_delimiter(p));
+ left_delimiter(r) = s;
+ s = copy_node_list(degree(p));
+ degree(r) = s;
+ }
+ break;
+ case fence_noad:
+ s = copy_node(delimiter(p));
+ delimiter(r) = s;
+ break;
+ /*
+ case style_node:
+ case delim_node:
+ case math_char_node:
+ case math_text_char_node:
+ break;
+ */
+ case sub_box_node:
+ case sub_mlist_node:
+ s = copy_node_list(math_list(p));
+ math_list(r) = s;
+ break;
+ case fraction_noad:
+ s = copy_node_list(numerator(p));
+ numerator(r) = s;
+ s = copy_node_list(denominator(p));
+ denominator(r) = s;
+ s = copy_node(left_delimiter(p));
+ left_delimiter(r) = s;
+ s = copy_node(right_delimiter(p));
+ right_delimiter(r) = s;
+ break;
case glue_spec_node:
glue_ref_count(r) = null;
break;
@@ -502,6 +691,8 @@ halfword copy_node(const halfword p)
add_token_ref(pdf_setmatrix_data(p));
break;
case late_lua_node:
+ if (late_lua_name(p) > 0)
+ add_token_ref(late_lua_name(p));
add_token_ref(late_lua_data(p));
break;
case pdf_annot_node:
@@ -531,6 +722,9 @@ halfword copy_node(const halfword p)
case 't':
add_token_ref(user_node_value(p));
break;
+ case 's':
+ /* |add_string_ref(user_node_value(p));| *//* if this was mpost .. */
+ break;
case 'n':
s = copy_node_list(user_node_value(p));
user_node_value(r) = s;
@@ -549,7 +743,9 @@ int valid_node(halfword p)
{
if (p > my_prealloc) {
if (p < var_mem_max) {
+#ifndef NDEBUG
if (varmem_sizes[p] > 0)
+#endif
return 1;
}
} else {
@@ -560,16 +756,15 @@ int valid_node(halfword p)
static void do_free_error(halfword p)
{
+ halfword r;
char errstr[255] = { 0 };
- char *errhlp[] =
- {
-"When I tried to free the node mentioned in the error message, it turned",
+ char *errhlp[] = {
+ "When I tried to free the node mentioned in the error message, it turned",
"out it was not (or no longer) actually in use.",
"Errors such as these are often caused by Lua node list alteration,",
"but could also point to a bug in the executable. It should be safe to continue.",
NULL
};
- halfword r;
check_node_mem();
if (free_error_seen)
@@ -586,6 +781,7 @@ static void do_free_error(halfword p)
get_node_name(type(p), subtype(p)), (int) p);
}
tex_error(errstr, errhlp);
+#ifndef NDEBUG
for (r = my_prealloc + 1; r < var_mem_max; r++) {
if (vlink(r) == p) {
halfword s = r;
@@ -646,16 +842,19 @@ static void do_free_error(halfword p)
}
}
}
+#endif
}
int free_error(halfword p)
{
assert(p > my_prealloc);
assert(p < var_mem_max);
+#ifndef NDEBUG
if (varmem_sizes[p] == 0) {
do_free_error(p);
return 1; /* double free */
}
+#endif
return 0;
}
@@ -663,9 +862,8 @@ int free_error(halfword p)
static void do_copy_error(halfword p)
{
char errstr[255] = { 0 };
- char *errhlp[] =
- {
-"When I tried to copy the node mentioned in the error message, it turned",
+ char *errhlp[] = {
+ "When I tried to copy the node mentioned in the error message, it turned",
"out it was not (or no longer) actually in use.",
"Errors such as these are often caused by Lua node list alteration,",
"but could also point to a bug in the executable. It should be safe to continue.",
@@ -692,10 +890,12 @@ int copy_error(halfword p)
{
assert(p >= 0);
assert(p < var_mem_max);
+#ifndef NDEBUG
if (p > my_prealloc && varmem_sizes[p] == 0) {
do_copy_error(p);
return 1; /* copy free node */
}
+#endif
return 0;
}
@@ -707,6 +907,10 @@ void flush_node(halfword p)
if (p == null) /* legal, but no-op */
return;
+#ifdef DEBUG
+ fprintf(stderr, "Free-ing %s node %d\n", get_node_name(type(p), subtype(p)),
+ (int) p);
+#endif
if (free_error(p))
return;
@@ -769,6 +973,8 @@ void flush_node(halfword p)
delete_token_ref(pdf_setmatrix_data(p));
break;
case late_lua_node:
+ if (late_lua_name(p) > 0)
+ delete_token_ref(late_lua_name(p));
delete_token_ref(late_lua_data(p));
break;
case pdf_annot_node:
@@ -809,8 +1015,22 @@ void flush_node(halfword p)
case 'n':
flush_node_list(user_node_value(p));
break;
+ case 's':
+ /* |delete_string_ref(user_node_value(p));| *//* if this was mpost .. */
+ break;
+ case 'd':
+ break;
default:
- tconfusion("extuser");
+ {
+ char *hlp[] = {
+ "The type of the value in a user defined whatsit node should be one",
+ "of 'a' (attribute list), 'd' (number), 'n' (node list), 's' (string),",
+ "or 't' (tokenlist). Yours has an unknown type, and therefore I don't",
+ "know how to free the node's value. A memory leak may result.",
+ NULL
+ };
+ tex_error("Unidentified user defined whatsit", hlp);
+ }
break;
}
break;
@@ -839,7 +1059,7 @@ void flush_node(halfword p)
case adjust_node:
flush_node_list(adjust_ptr(p));
break;
- case style_node:
+ case style_node: /* nothing to do */
break;
case choice_node:
flush_node_list(display_mlist(p));
@@ -855,28 +1075,38 @@ void flush_node(halfword p)
case close_noad:
case punct_noad:
case inner_noad:
- case radical_noad:
case over_noad:
case under_noad:
case vcenter_noad:
+ case radical_noad:
case accent_noad:
-
- /*
- * if (math_type(nucleus(p))>=sub_box)
- * flush_node_list(vinfo(nucleus(p)));
- * if (math_type(supscr(p))>=sub_box)
- * flush_node_list(vinfo(supscr(p)));
- * if (math_type(subscr(p))>=sub_box)
- * flush_node_list(vinfo(subscr(p)));
- */
-
+ flush_node_list(nucleus(p));
+ flush_node_list(subscr(p));
+ flush_node_list(supscr(p));
+ if (type(p) == accent_noad) {
+ flush_node_list(accent_chr(p));
+ flush_node_list(bot_accent_chr(p));
+ } else if (type(p) == radical_noad) {
+ flush_node(left_delimiter(p));
+ flush_node_list(degree(p));
+ }
+ break;
+ case fence_noad:
+ flush_node(delimiter(p));
break;
- case left_noad:
- case right_noad:
+ case delim_node: /* nothing to do */
+ case math_char_node:
+ case math_text_char_node:
+ break;
+ case sub_box_node:
+ case sub_mlist_node:
+ flush_node_list(math_list(p));
break;
case fraction_noad:
- flush_node_list(vinfo(numerator(p)));
- flush_node_list(vinfo(denominator(p)));
+ flush_node_list(numerator(p));
+ flush_node_list(denominator(p));
+ flush_node(left_delimiter(p));
+ flush_node(right_delimiter(p));
break;
case pseudo_file_node:
flush_node_list(pseudo_lines(p));
@@ -929,18 +1159,18 @@ void flush_node_list(halfword pp)
static int test_count = 1;
-#define dorangetest(a,b,c) do { \
+#define dorangetest(a,b,c) do { \
if (!(b>=0 && b<c)) { \
fprintf(stdout,"For node p:=%d, 0<=%d<%d (l.%d,r.%d)\n", \
(int)a, (int)b, (int)c, __LINE__,test_count); \
- tconfusion("dorangetest"); \
+ tconfusion("dorangetest"); \
} } while (0)
-#define dotest(a,b,c) do { \
+#define dotest(a,b,c) do { \
if (b!=c) { \
fprintf(stdout,"For node p:=%d, %d==%d (l.%d,r.%d)\n", \
(int)a, (int)b, (int)c, __LINE__,test_count); \
- tconfusion("dotest"); \
+ tconfusion("dotest"); \
} } while (0)
#define check_action_ref(a) { dorangetest(p,a,var_mem_max); }
@@ -985,6 +1215,8 @@ void check_node(halfword p)
check_token_ref(pdf_setmatrix_data(p));
break;
case late_lua_node:
+ if (late_lua_name(p) > 0)
+ check_token_ref(late_lua_name(p));
check_token_ref(late_lua_data(p));
break;
case pdf_annot_node:
@@ -1017,6 +1249,9 @@ void check_node(halfword p)
case 'n':
dorangetest(p, user_node_value(p), var_mem_max);
break;
+ case 's':
+ case 'd':
+ break;
default:
tconfusion("extuser");
break;
@@ -1066,15 +1301,11 @@ void check_node(halfword p)
dorangetest(p, script_script_mlist(p), var_mem_max);
break;
case fraction_noad:
- dorangetest(p, vinfo(numerator(p)), var_mem_max);
- dorangetest(p, vinfo(denominator(p)), var_mem_max);
+ dorangetest(p, numerator(p), var_mem_max);
+ dorangetest(p, denominator(p), var_mem_max);
+ dorangetest(p, left_delimiter(p), var_mem_max);
+ dorangetest(p, right_delimiter(p), var_mem_max);
break;
- case rule_node:
- case kern_node:
- case math_node:
- case penalty_node:
- case mark_node:
- case style_node:
case ord_noad:
case op_noad:
case bin_noad:
@@ -1083,13 +1314,36 @@ void check_node(halfword p)
case close_noad:
case punct_noad:
case inner_noad:
- case radical_noad:
case over_noad:
case under_noad:
case vcenter_noad:
+ dorangetest(p, nucleus(p), var_mem_max);
+ dorangetest(p, subscr(p), var_mem_max);
+ dorangetest(p, supscr(p), var_mem_max);
+ break;
+ case radical_noad:
+ dorangetest(p, nucleus(p), var_mem_max);
+ dorangetest(p, subscr(p), var_mem_max);
+ dorangetest(p, supscr(p), var_mem_max);
+ dorangetest(p, degree(p), var_mem_max);
+ dorangetest(p, left_delimiter(p), var_mem_max);
+ break;
case accent_noad:
- case left_noad:
- case right_noad:
+ dorangetest(p, nucleus(p), var_mem_max);
+ dorangetest(p, subscr(p), var_mem_max);
+ dorangetest(p, supscr(p), var_mem_max);
+ dorangetest(p, accent_chr(p), var_mem_max);
+ dorangetest(p, bot_accent_chr(p), var_mem_max);
+ break;
+ case fence_noad:
+ dorangetest(p, delimiter(p), var_mem_max);
+ break;
+ case rule_node:
+ case kern_node:
+ case math_node:
+ case penalty_node:
+ case mark_node:
+ case style_node:
case attribute_list_node:
case attribute_node:
case glue_spec_node:
@@ -1165,12 +1419,13 @@ void check_node_mem(void)
{
int i;
check_static_node_mem();
-
+#ifndef NDEBUG
for (i = (my_prealloc + 1); i < var_mem_max; i++) {
if (varmem_sizes[i] > 0) {
check_node(i);
}
}
+#endif
test_count++;
}
@@ -1214,7 +1469,7 @@ void print_free_chain(int c)
halfword p = free_chain[c];
fprintf(stdout, "\nfree chain[%d] =\n ", c);
while (p != null) {
- fprintf(stdout, "%d,", (int)p);
+ fprintf(stdout, "%d,", (int) p);
p = vlink(p);
}
fprintf(stdout, "null;\n");
@@ -1265,9 +1520,9 @@ void free_node_chain(halfword q, integer s)
}
-void init_node_mem(halfword prealloced, halfword t)
+void init_node_mem(halfword t)
{
- my_prealloc = prealloced;
+ my_prealloc = var_mem_stat_max;
assert(whatsit_node_data[user_defined_node].id == user_defined_node);
assert(node_data[passive_node].id == passive_node);
@@ -1285,10 +1540,112 @@ void init_node_mem(halfword prealloced, halfword t)
memset((void *) varmem_sizes, 0, sizeof(char) * t);
#endif
var_mem_max = t;
- rover = prealloced + 1;
+ rover = var_mem_stat_max + 1;
vlink(rover) = rover;
node_size(rover) = (t - rover);
var_used = 0;
+ /* initialize static glue specs */
+ glue_ref_count(zero_glue) = null + 1;
+ width(zero_glue) = 0;
+ type(zero_glue) = glue_spec_node;
+ vlink(zero_glue) = null;
+ stretch(zero_glue) = 0;
+ stretch_order(zero_glue) = normal;
+ shrink(zero_glue) = 0;
+ shrink_order(zero_glue) = normal;
+ glue_ref_count(sfi_glue) = null + 1;
+ width(sfi_glue) = 0;
+ type(sfi_glue) = glue_spec_node;
+ vlink(sfi_glue) = null;
+ stretch(sfi_glue) = 0;
+ stretch_order(sfi_glue) = sfi;
+ shrink(sfi_glue) = 0;
+ shrink_order(sfi_glue) = normal;
+ glue_ref_count(fil_glue) = null + 1;
+ width(fil_glue) = 0;
+ type(fil_glue) = glue_spec_node;
+ vlink(fil_glue) = null;
+ stretch(fil_glue) = unity;
+ stretch_order(fil_glue) = fil;
+ shrink(fil_glue) = 0;
+ shrink_order(fil_glue) = normal;
+ glue_ref_count(fill_glue) = null + 1;
+ width(fill_glue) = 0;
+ type(fill_glue) = glue_spec_node;
+ vlink(fill_glue) = null;
+ stretch(fill_glue) = unity;
+ stretch_order(fill_glue) = fill;
+ shrink(fill_glue) = 0;
+ shrink_order(fill_glue) = normal;
+ glue_ref_count(ss_glue) = null + 1;
+ width(ss_glue) = 0;
+ type(ss_glue) = glue_spec_node;
+ vlink(ss_glue) = null;
+ stretch(ss_glue) = unity;
+ stretch_order(ss_glue) = fil;
+ shrink(ss_glue) = unity;
+ shrink_order(ss_glue) = fil;
+ glue_ref_count(fil_neg_glue) = null + 1;
+ width(fil_neg_glue) = 0;
+ type(fil_neg_glue) = glue_spec_node;
+ vlink(fil_neg_glue) = null;
+ stretch(fil_neg_glue) = -unity;
+ stretch_order(fil_neg_glue) = fil;
+ shrink(fil_neg_glue) = 0;
+ shrink_order(fil_neg_glue) = normal;
+ /* initialize node list heads */
+ vinfo(page_ins_head) = 0;
+ vlink(page_ins_head) = null;
+ alink(page_ins_head) = null;
+ vinfo(contrib_head) = 0;
+ vlink(contrib_head) = null;
+ alink(contrib_head) = null;
+ vinfo(page_head) = 0;
+ vlink(page_head) = null;
+ alink(page_head) = null;
+ vinfo(temp_head) = 0;
+ vlink(temp_head) = null;
+ alink(temp_head) = null;
+ vinfo(hold_head) = 0;
+ vlink(hold_head) = null;
+ alink(hold_head) = null;
+ vinfo(adjust_head) = 0;
+ vlink(adjust_head) = null;
+ alink(adjust_head) = null;
+ vinfo(pre_adjust_head) = 0;
+ vlink(pre_adjust_head) = null;
+ alink(pre_adjust_head) = null;
+ vinfo(active) = 0;
+ vlink(active) = null;
+ alink(active) = null;
+ vinfo(align_head) = 0;
+ vlink(align_head) = null;
+ alink(align_head) = null;
+ vinfo(end_span) = 0;
+ vlink(end_span) = null;
+ alink(end_span) = null;
+ type(begin_point) = glyph_node;
+ subtype(begin_point) = 0;
+ vlink(begin_point) = null;
+ vinfo(begin_point + 1) = null;
+ alink(begin_point) = null;
+ font(begin_point) = 0;
+ character(begin_point) = '.';
+ vinfo(begin_point + 3) = 0;
+ vlink(begin_point + 3) = 0;
+ vinfo(begin_point + 4) = 0;
+ vlink(begin_point + 4) = 0;
+ type(end_point) = glyph_node;
+ subtype(end_point) = 0;
+ vlink(end_point) = null;
+ vinfo(end_point + 1) = null;
+ alink(end_point) = null;
+ font(end_point) = 0;
+ character(end_point) = '.';
+ vinfo(end_point + 3) = 0;
+ vlink(end_point + 3) = 0;
+ vinfo(end_point + 4) = 0;
+ vlink(end_point + 4) = 0;
}
void dump_node_mem(void)
@@ -1448,6 +1805,7 @@ char *sprint_node_mem_usage(void)
int i, b;
char *s, *ss;
+#ifndef NDEBUG
char msg[256];
int node_counts[last_normal_node + last_whatsit_node + 2] = { 0 };
@@ -1471,12 +1829,17 @@ char *sprint_node_mem_usage(void)
snprintf(msg, 255, "%s%d %s", (b ? ", " : ""), (int) node_counts[i],
get_node_name((i > last_normal_node ? whatsit_node : i),
j));
- ss = concat(s, msg);
+ ss = xmalloc(strlen(s) + strlen(msg) + 1);
+ strcpy(ss, s);
+ strcat(ss, msg);
free(s);
s = ss;
b = 1;
}
}
+#else
+ s = strdup("");
+#endif
return s;
}
@@ -1484,6 +1847,7 @@ halfword list_node_mem_usage(void)
{
halfword i, j;
halfword p = null, q = null;
+#ifndef NDEBUG
char *saved_varmem_sizes = xmallocarray(char, var_mem_max);
memcpy(saved_varmem_sizes, varmem_sizes, var_mem_max);
for (i = my_prealloc + 1; i < (var_mem_max - 1); i++) {
@@ -1498,17 +1862,17 @@ halfword list_node_mem_usage(void)
}
}
free(saved_varmem_sizes);
+#endif
return q;
}
-void print_node_mem_stats(int num, int online)
+void print_node_mem_stats(int tracingstats, int tracingonline)
{
int i, b;
halfword j;
char msg[256];
char *s;
integer free_chain_counts[MAX_CHAIN_SIZE] = { 0 };
-
snprintf(msg, 255, "node memory in use: %d words out of %d",
(int) (var_used + my_prealloc), (int) var_mem_max);
tprint_nl(msg);
@@ -1680,7 +2044,7 @@ halfword do_set_attribute(halfword p, int i, int val)
vlink(q) = p;
return q;
}
-
+ q = p;
assert(vlink(p) != null);
while (vlink(p) != null) {
int t = attribute_id(vlink(p));
@@ -1774,11 +2138,15 @@ int unset_attribute(halfword n, int i, int val)
t = attribute_id(vlink(p));
if (t > i)
return -1;
- if (t == i)
+ if (t == i) {
+ p = vlink(p);
break;
+ }
j++;
p = vlink(p);
}
+ if (attribute_id(p) != i)
+ return -1;
/* if we are still here, the attribute exists */
p = node_attr(n);
if (attr_list_ref(p) != 1) {
@@ -1825,3 +2193,738 @@ int has_attribute(halfword n, int i, int val)
}
return -1;
}
+
+void print_short_node_contents(halfword p)
+{
+ switch (type(p)) {
+ case hlist_node:
+ case vlist_node:
+ case ins_node:
+ case whatsit_node:
+ case mark_node:
+ case adjust_node:
+ case unset_node:
+ print_char('[');
+ print_char(']');
+ break;
+ case rule_node:
+ print_char('|');
+ break;
+ case glue_node:
+ if (glue_ptr(p) != zero_glue)
+ print_char(' ');
+ break;
+ case math_node:
+ print_char('$');
+ break;
+ case disc_node:
+ short_display(vlink(pre_break(p)));
+ short_display(vlink(post_break(p)));
+ break;
+ default:
+ assert(1);
+ break;
+ }
+}
+
+
+void show_pdftex_whatsit_rule_spec(integer p)
+{
+ tprint("(");
+ print_rule_dimen(pdf_height(p));
+ print_char('+');
+ print_rule_dimen(pdf_depth(p));
+ tprint(")x");
+ print_rule_dimen(pdf_width(p));
+}
+
+
+/*
+Each new type of node that appears in our data structure must be capable
+of being displayed, copied, destroyed, and so on. The routines that we
+need for write-oriented whatsits are somewhat like those for mark nodes;
+other extensions might, of course, involve more subtlety here.
+*/
+
+
+void print_write_whatsit(char *s, pointer p)
+{
+ tprint_esc(s);
+ if (write_stream(p) < 16)
+ print_int(write_stream(p));
+ else if (write_stream(p) == 16)
+ print_char('*');
+ else
+ print_char('-');
+}
+
+
+void show_whatsit_node(integer p)
+{
+ switch (subtype(p)) {
+ case open_node:
+ print_write_whatsit("openout", p);
+ print_char('=');
+ print_file_name(open_name(p), open_area(p), open_ext(p));
+ break;
+ case write_node:
+ print_write_whatsit("write", p);
+ print_mark(write_tokens(p));
+ break;
+ case close_node:
+ print_write_whatsit("closeout", p);
+ break;
+ case special_node:
+ tprint_esc("special");
+ print_mark(write_tokens(p));
+ break;
+ case dir_node:
+ if (dir_dir(p) < 0) {
+ tprint_esc("enddir");
+ print_char(' ');
+ print_dir(dir_dir(p) + 64);
+ } else {
+ tprint_esc("begindir");
+ print_char(' ');
+ print_dir(dir_dir(p));
+ }
+ case local_par_node:
+ tprint_esc("whatsit");
+ append_char('.');
+ print_ln();
+ print_current_string();
+ tprint_esc("localinterlinepenalty");
+ print_char('=');
+ print_int(local_pen_inter(p));
+ print_ln();
+ print_current_string();
+ tprint_esc("localbrokenpenalty");
+ print_char('=');
+ print_int(local_pen_broken(p));
+ print_ln();
+ print_current_string();
+ tprint_esc("localleftbox");
+ if (local_box_left(p) == null) {
+ tprint("=null");
+ } else {
+ append_char('.');
+ show_node_list(local_box_left(p));
+ decr(pool_ptr);
+ }
+ print_ln();
+ print_current_string();
+ tprint_esc("localrightbox");
+ if (local_box_right(p) == null) {
+ tprint("=null");
+ } else {
+ append_char('.');
+ show_node_list(local_box_right(p));
+ decr(pool_ptr);
+ }
+ decr(pool_ptr);
+ break;
+ case pdf_literal_node:
+ tprint_esc("pdfliteral");
+ switch (pdf_literal_mode(p)) {
+ case set_origin:
+ break;
+ case direct_page:
+ tprint(" page");
+ break;
+ case direct_always:
+ tprint(" direct");
+ break;
+ default:
+ tconfusion("literal2");
+ break;
+ }
+ print_mark(pdf_literal_data(p));
+ break;
+ case pdf_colorstack_node:
+ tprint_esc("pdfcolorstack ");
+ print_int(pdf_colorstack_stack(p));
+ switch (pdf_colorstack_cmd(p)) {
+ case colorstack_set:
+ tprint(" set ");
+ break;
+ case colorstack_push:
+ tprint(" push ");
+ break;
+ case colorstack_pop:
+ tprint(" pop");
+ break;
+ case colorstack_current:
+ tprint(" current");
+ break;
+ default:
+ tconfusion("pdfcolorstack");
+ break;
+ }
+ if (pdf_colorstack_cmd(p) <= colorstack_data)
+ print_mark(pdf_colorstack_data(p));
+ break;
+ case pdf_setmatrix_node:
+ tprint_esc("pdfsetmatrix");
+ print_mark(pdf_setmatrix_data(p));
+ break;
+ case pdf_save_node:
+ tprint_esc("pdfsave");
+ break;
+ case pdf_restore_node:
+ tprint_esc("pdfrestore");
+ break;
+ case cancel_boundary_node:
+ tprint_esc("noboundary");
+ break;
+ case late_lua_node:
+ tprint_esc("latelua");
+ print_int(late_lua_reg(p));
+ print_mark(late_lua_data(p));
+ break;
+ case close_lua_node:
+ tprint_esc("closelua");
+ print_int(late_lua_reg(p));
+ break;
+ case pdf_refobj_node:
+ tprint_esc("pdfrefobj");
+ if (obj_obj_is_stream(pdf_obj_objnum(p)) > 0) {
+ if (obj_obj_stream_attr(pdf_obj_objnum(p)) != null) {
+ tprint(" attr");
+ print_mark(obj_obj_stream_attr(pdf_obj_objnum(p)));
+ }
+ tprint(" stream");
+ }
+ if (obj_obj_is_file(pdf_obj_objnum(p)) > 0)
+ tprint(" file");
+ print_mark(obj_obj_data(pdf_obj_objnum(p)));
+ break;
+ case pdf_refxform_node:
+ tprint_esc("pdfrefxform");
+ print_char('(');
+ print_scaled(obj_xform_height(pdf_xform_objnum(p)));
+ print_char('+');
+ print_scaled(obj_xform_depth(pdf_xform_objnum(p)));
+ tprint(")x");
+ print_scaled(obj_xform_width(pdf_xform_objnum(p)));
+ break;
+ case pdf_refximage_node:
+ tprint_esc("pdfrefximage");
+ tprint("(");
+ print_scaled(pdf_height(p));
+ print_char('+');
+ print_scaled(pdf_depth(p));
+ tprint(")x");
+ print_scaled(pdf_width(p));
+ break;
+ case pdf_annot_node:
+ tprint_esc("pdfannot");
+ show_pdftex_whatsit_rule_spec(p);
+ print_mark(pdf_annot_data(p));
+ break;
+ case pdf_start_link_node:
+ tprint_esc("pdfstartlink");
+ show_pdftex_whatsit_rule_spec(p);
+ if (pdf_link_attr(p) != null) {
+ tprint(" attr");
+ print_mark(pdf_link_attr(p));
+ }
+ tprint(" action");
+ if (pdf_action_type(pdf_link_action(p)) == pdf_action_user) {
+ tprint(" user");
+ print_mark(pdf_action_tokens(pdf_link_action(p)));
+ return;
+ }
+ if (pdf_action_file(pdf_link_action(p)) != null) {
+ tprint(" file");
+ print_mark(pdf_action_file(pdf_link_action(p)));
+ }
+ switch (pdf_action_type(pdf_link_action(p))) {
+ case pdf_action_goto:
+ if (pdf_action_named_id(pdf_link_action(p)) > 0) {
+ tprint(" goto name");
+ print_mark(pdf_action_id(pdf_link_action(p)));
+ } else {
+ tprint(" goto num");
+ print_int(pdf_action_id(pdf_link_action(p)));
+ }
+ break;
+ case pdf_action_page:
+ tprint(" page");
+ print_int(pdf_action_id(pdf_link_action(p)));
+ print_mark(pdf_action_tokens(pdf_link_action(p)));
+ break;
+ case pdf_action_thread:
+ if (pdf_action_named_id(pdf_link_action(p)) > 0) {
+ tprint(" thread name");
+ print_mark(pdf_action_id(pdf_link_action(p)));
+ } else {
+ tprint(" thread num");
+ print_int(pdf_action_id(pdf_link_action(p)));
+ }
+ break;
+ default:
+ pdf_error(maketexstring("displaying"),
+ maketexstring("unknown action type"));
+ break;
+ }
+ break;
+ case pdf_end_link_node:
+ tprint_esc("pdfendlink");
+ break;
+ case pdf_dest_node:
+ tprint_esc("pdfdest");
+ if (pdf_dest_named_id(p) > 0) {
+ tprint(" name");
+ print_mark(pdf_dest_id(p));
+ } else {
+ tprint(" num");
+ print_int(pdf_dest_id(p));
+ }
+ print_char(' ');
+ switch (pdf_dest_type(p)) {
+ case pdf_dest_xyz:
+ tprint("xyz");
+ if (pdf_dest_xyz_zoom(p) != null) {
+ tprint(" zoom");
+ print_int(pdf_dest_xyz_zoom(p));
+ }
+ break;
+ case pdf_dest_fitbh:
+ tprint("fitbh");
+ break;
+ case pdf_dest_fitbv:
+ tprint("fitbv");
+ break;
+ case pdf_dest_fitb:
+ tprint("fitb");
+ break;
+ case pdf_dest_fith:
+ tprint("fith");
+ break;
+ case pdf_dest_fitv:
+ tprint("fitv");
+ break;
+ case pdf_dest_fitr:
+ tprint("fitr");
+ show_pdftex_whatsit_rule_spec(p);
+ break;
+ case pdf_dest_fit:
+ tprint("fit");
+ break;
+ default:
+ tprint("unknown!");
+ break;
+ }
+ break;
+ case pdf_thread_node:
+ case pdf_start_thread_node:
+ if (subtype(p) == pdf_thread_node)
+ tprint_esc("pdfthread");
+ else
+ tprint_esc("pdfstartthread");
+ tprint("(");
+ print_rule_dimen(pdf_height(p));
+ print_char('+');
+ print_rule_dimen(pdf_depth(p));
+ tprint(")x");
+ print_rule_dimen(pdf_width(p));
+ if (pdf_thread_attr(p) != null) {
+ tprint(" attr");
+ print_mark(pdf_thread_attr(p));
+ }
+ if (pdf_thread_named_id(p) > 0) {
+ tprint(" name");
+ print_mark(pdf_thread_id(p));
+ } else {
+ tprint(" num");
+ print_int(pdf_thread_id(p));
+ }
+ break;
+ case pdf_end_thread_node:
+ tprint_esc("pdfendthread");
+ break;
+ case pdf_save_pos_node:
+ tprint_esc("pdfsavepos");
+ break;
+ case user_defined_node:
+ tprint_esc("whatsit");
+ print_int(user_node_id(p));
+ print_char('=');
+ switch (user_node_type(p)) {
+ case 'a':
+ tprint("<>");
+ break;
+ case 'n':
+ tprint("[");
+ show_node_list(user_node_value(p));
+ tprint("]");
+ break;
+ case 's':
+ print_char('"');
+ print(user_node_value(p));
+ print_char('"');
+ break;
+ case 't':
+ print_mark(user_node_value(p));
+ break;
+ default: /* only 'd' */
+ print_int(user_node_value(p));
+ break;
+ }
+ break;
+ default:
+ tprint("whatsit?");
+ break;
+ }
+}
+
+
+/*
+ Now we are ready for |show_node_list| itself. This procedure has been
+ written to be ``extra robust'' in the sense that it should not crash or get
+ into a loop even if the data structures have been messed up by bugs in
+ the rest of the program. You can safely call its parent routine
+ |show_box(p)| for arbitrary values of |p| when you are debugging \TeX.
+ However, in the presence of bad data, the procedure may
+ fetch a |memory_word| whose variant is different from the way it was stored;
+ for example, it might try to read |mem[p].hh| when |mem[p]|
+ contains a scaled integer, if |p| is a pointer that has been
+ clobbered or chosen at random.
+*/
+
+/* |str_room| need not be checked; see |show_box| */
+
+/* Recursive calls on |show_node_list| therefore use the following pattern: */
+
+#define node_list_display(A) do { \
+ append_char('.'); \
+ show_node_list(A); \
+ flush_char(); \
+} while (0)
+
+void show_node_list(integer p)
+{ /* prints a node list symbolically */
+ integer n; /* the number of items already printed at this level */
+ real g; /* a glue ratio, as a floating point number */
+ if (cur_length > depth_threshold) {
+ if (p > null)
+ tprint(" []"); /* indicate that there's been some truncation */
+ return;
+ }
+ n = 0;
+ while (p != null) {
+ print_ln();
+ print_current_string(); /* display the nesting history */
+ if (int_par(param_tracing_online_code) < -2)
+ print_int(p);
+ incr(n);
+ if (n > breadth_max) { /* time to stop */
+ tprint("etc.");
+ return;
+ }
+ /* @<Display node |p|@> */
+ if (is_char_node(p)) {
+ print_font_and_char(p);
+ if (is_ligature(p)) {
+ /* @<Display ligature |p|@>; */
+ tprint(" (ligature ");
+ if (is_leftboundary(p))
+ print_char('|');
+ font_in_short_display = font(p);
+ short_display(lig_ptr(p));
+ if (is_rightboundary(p))
+ print_char('|');
+ print_char(')');
+ }
+ } else {
+ switch (type(p)) {
+ case hlist_node:
+ case vlist_node:
+ case unset_node:
+ /* @<Display box |p|@>; */
+ if (type(p) == hlist_node)
+ tprint_esc("h");
+ else if (type(p) == vlist_node)
+ tprint_esc("v");
+ else
+ tprint_esc("unset");
+ tprint("box(");
+ print_scaled(height(p));
+ print_char('+');
+ print_scaled(depth(p));
+ tprint(")x");
+ print_scaled(width(p));
+ if (type(p) == unset_node) {
+ /* @<Display special fields of the unset node |p|@>; */
+ if (span_count(p) != min_quarterword) {
+ tprint(" (");
+ print_int(span_count(p) + 1);
+ tprint(" columns)");
+ }
+ if (glue_stretch(p) != 0) {
+ tprint(", stretch ");
+ print_glue(glue_stretch(p), glue_order(p), 0);
+ }
+ if (glue_shrink(p) != 0) {
+ tprint(", shrink ");
+ print_glue(glue_shrink(p), glue_sign(p), 0);
+ }
+ } else {
+ /*<Display the value of |glue_set(p)|@> */
+ /* The code will have to change in this place if |glue_ratio| is
+ a structured type instead of an ordinary |real|. Note that this routine
+ should avoid arithmetic errors even if the |glue_set| field holds an
+ arbitrary random value. The following code assumes that a properly
+ formed nonzero |real| number has absolute value $2^{20}$ or more when
+ it is regarded as an integer; this precaution was adequate to prevent
+ floating point underflow on the author's computer.
+ */
+
+ g = (real) (glue_set(p));
+ if ((g != 0.0) && (glue_sign(p) != normal)) {
+ tprint(", glue set ");
+ if (glue_sign(p) == shrinking)
+ tprint("- ");
+ if (g > 20000.0 || g < -20000.0) {
+ if (g > 0.0)
+ print_char('>');
+ else
+ tprint("< -");
+ print_glue(20000 * unity, glue_order(p), 0);
+ } else {
+ print_glue(round(unity * g), glue_order(p), 0);
+ }
+ }
+
+ if (shift_amount(p) != 0) {
+ tprint(", shifted ");
+ print_scaled(shift_amount(p));
+ }
+ tprint(", direction ");
+ print_dir(box_dir(p));
+ }
+ node_list_display(list_ptr(p)); /* recursive call */
+ break;
+ case rule_node:
+ /* @<Display rule |p|@>; */
+ tprint_esc("rule(");
+ print_rule_dimen(height(p));
+ print_char('+');
+ print_rule_dimen(depth(p));
+ tprint(")x");
+ print_rule_dimen(width(p));
+ break;
+ case ins_node:
+ /* @<Display insertion |p|@>; */
+ tprint_esc("insert");
+ print_int(subtype(p));
+ tprint(", natural size ");
+ print_scaled(height(p));
+ tprint("; split(");
+ print_spec(split_top_ptr(p), 0);
+ print_char(',');
+ print_scaled(depth(p));
+ tprint("); float cost ");
+ print_int(float_cost(p));
+ node_list_display(ins_ptr(p)); /* recursive call */
+ break;
+ case whatsit_node:
+ show_whatsit_node(p);
+ break;
+ case glue_node:
+ /* @<Display glue |p|@>; */
+ if (subtype(p) >= a_leaders) {
+ /* @<Display leaders |p|@>; */
+ tprint_esc("");
+ if (subtype(p) == c_leaders)
+ print_char('c');
+ else if (subtype(p) == x_leaders)
+ print_char('x');
+ tprint("leaders ");
+ print_spec(glue_ptr(p), 0);
+ node_list_display(leader_ptr(p)); /* recursive call */
+ } else {
+ tprint_esc("glue");
+ if (subtype(p) != normal) {
+ print_char('(');
+ if (subtype(p) < cond_math_glue)
+ print_skip_param(subtype(p) - 1);
+ else if (subtype(p) == cond_math_glue)
+ tprint_esc("nonscript");
+ else
+ tprint_esc("mskip");
+ print_char(')');
+ }
+ if (subtype(p) != cond_math_glue) {
+ print_char(' ');
+ if (subtype(p) < cond_math_glue)
+ print_spec(glue_ptr(p), 0);
+ else
+ print_spec(glue_ptr(p), maketexstring("mu"));
+ }
+ }
+ break;
+ case margin_kern_node:
+ tprint_esc("kern");
+ print_scaled(width(p));
+ if (subtype(p) == left_side)
+ tprint(" (left margin)");
+ else
+ tprint(" (right margin)");
+ break;
+ case kern_node:
+ /* @<Display kern |p|@>; */
+ /* An ``explicit'' kern value is indicated implicitly by an explicit space. */
+ if (subtype(p) != mu_glue) {
+ tprint_esc("kern");
+ if (subtype(p) != normal)
+ print_char(' ');
+ print_scaled(width(p));
+ if (subtype(p) == acc_kern)
+ tprint(" (for accent)");
+ } else {
+ tprint_esc("mkern");
+ print_scaled(width(p));
+ tprint("mu");
+ }
+ break;
+ case math_node:
+ /* @<Display math node |p|@>; */
+ tprint_esc("math");
+ if (subtype(p) == before)
+ tprint("on");
+ else
+ tprint("off");
+ if (width(p) != 0) {
+ tprint(", surrounded ");
+ print_scaled(width(p));
+ }
+ break;
+ case penalty_node:
+ /* @<Display penalty |p|@>; */
+ tprint_esc("penalty ");
+ print_int(penalty(p));
+ break;
+ case disc_node:
+ /* @<Display discretionary |p|@>; */
+ /* The |post_break| list of a discretionary node is indicated by a prefixed
+ `\.{\char'174}' instead of the `\..' before the |pre_break| list. */
+ tprint_esc("discretionary");
+ if (vlink(no_break(p)) != null) {
+ tprint(" replacing ");
+ node_list_display(vlink(no_break(p)));
+ }
+ node_list_display(vlink(pre_break(p))); /* recursive call */
+ append_char('|');
+ show_node_list(vlink(post_break(p)));
+ flush_char(); /* recursive call */
+ break;
+ case mark_node:
+ /* @<Display mark |p|@>; */
+ tprint_esc("mark");
+ if (mark_class(p) != 0) {
+ print_char('s');
+ print_int(mark_class(p));
+ }
+ print_mark(mark_ptr(p));
+ break;
+ case adjust_node:
+ /* @<Display adjustment |p|@>; */
+ tprint_esc("vadjust");
+ if (adjust_pre(p) != 0)
+ tprint(" pre ");
+ node_list_display(adjust_ptr(p)); /* recursive call */
+ break;
+ default:
+ show_math_node(p);
+ break;
+ }
+ }
+ p = vlink(p);
+ }
+}
+
+/* This routine finds the 'base' width of a horizontal box, using the same logic
+ that \TeX82 used for \.{\\predisplaywidth} */
+
+pointer actual_box_width(pointer r, scaled base_width)
+{
+ scaled w; /* calculated |size| */
+ pointer p; /* current node when calculating |pre_display_size| */
+ pointer q; /* glue specification when calculating |pre_display_size| */
+ internal_font_number f; /* font in current |char_node| */
+ scaled d; /* increment to |v| */
+ scaled v; /* |w| plus possible glue amount */
+ w = -max_dimen;
+ v = shift_amount(r) + base_width;
+ p = list_ptr(r);
+ while (p != null) {
+ if (is_char_node(p)) {
+ f = font(p);
+ d = glyph_width(p);
+ goto found;
+ }
+ switch (type(p)) {
+ case hlist_node:
+ case vlist_node:
+ case rule_node:
+ d = width(p);
+ goto found;
+ break;
+ case margin_kern_node:
+ d = width(p);
+ break;
+ case kern_node:
+ d = width(p);
+ break;
+ case math_node:
+ d = surround(p);
+ break;
+ case glue_node:
+ /* We need to be careful that |w|, |v|, and |d| do not depend on any |glue_set|
+ values, since such values are subject to system-dependent rounding.
+ System-dependent numbers are not allowed to infiltrate parameters like
+ |pre_display_size|, since \TeX82 is supposed to make the same decisions on all
+ machines.
+ */
+ q = glue_ptr(p);
+ d = width(q);
+ if (glue_sign(r) == stretching) {
+ if ((glue_order(r) == stretch_order(q))
+ && (stretch(q) != 0))
+ v = max_dimen;
+ } else if (glue_sign(r) == shrinking) {
+ if ((glue_order(r) == shrink_order(q))
+ && (shrink(q) != 0))
+ v = max_dimen;
+ }
+ if (subtype(p) >= a_leaders)
+ goto found;
+ break;
+ case whatsit_node:
+ if ((subtype(p) == pdf_refxform_node)
+ || (subtype(p) == pdf_refximage_node))
+ d = pdf_width(p);
+ else
+ d = 0;
+ break;
+ default:
+ d = 0;
+ break;
+ }
+ if (v < max_dimen)
+ v = v + d;
+ goto not_found;
+ found:
+ if (v < max_dimen) {
+ v = v + d;
+ w = v;
+ } else {
+ w = max_dimen;
+ break;
+ }
+ not_found:
+ p = vlink(p);
+ }
+ return w;
+}
diff --git a/Build/source/texk/web2c/luatexdir/tex/texpdf.c b/Build/source/texk/web2c/luatexdir/tex/texpdf.c
index 000742dd001..c539bbae968 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texpdf.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texpdf.c
@@ -1,9 +1,29 @@
-/* $Id: texpdf.c 1158 2008-04-14 08:13:06Z oneiros $ */
+/* texpdf.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include <ctype.h>
+static const char _svn_version[] =
+ "$Id: texpdf.c 1436 2008-07-17 09:27:08Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/texpdf.c $";
+
#define number_chars 1114112
#define string_offset 2097152
#define str_start_macro(a) str_start[(a) - string_offset]
@@ -85,13 +105,13 @@ void pdf_print(str_number s)
/* print out a integer to PDF buffer */
-void pdf_print_int(integer n)
+void pdf_print_int(longinteger n)
{
register integer k = 0; /* current digit; we assume that $|n|<10^{23}$ */
if (n < 0) {
pdf_out('-');
if (n < -0x7FFFFFFF) { /* need to negate |n| more carefully */
- register integer m;
+ register longinteger m;
k++;
m = -1 - n;
n = m / 10;
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.c b/Build/source/texk/web2c/luatexdir/tex/textoken.c
index 366fa798791..1cfbd56b291 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.c
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.c
@@ -1,34 +1,47 @@
-/* $Id: textoken.c 1155 2008-04-14 07:53:21Z oneiros $ */
+/* textoken.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include "tokens.h"
+#include "commands.h"
-/* Integer parameters and other command-related defines. This needs it's own header file! */
+static const char _svn_version[] =
+ "$Id: textoken.c 2086 2009-03-22 15:32:08Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/tex/textoken.c $";
-#define end_line_char_code 48 /* character placed at the right end of the buffer */
-#define cat_code_table_code 63
-#define tex_int_pars 66 /* total number of \.{\\TeX} + Aleph integer parameters */
-/* this is not what happens in the pascal code! there the values shift from bare numbers to offsets ! */
-#define dir_base tex_int_pars
-#define dir_pars 5
-#define pdftex_first_integer_code dir_base+dir_pars /* base for \pdfTeX's integer parameters */
-#define pdf_int_pars pdftex_first_integer_code+27 /*total number of \pdfTeX's integer parameters */
-#define etex_int_base pdf_int_pars /*base for \eTeX's integer parameters */
-#define tracing_nesting_code etex_int_base+4 /*show incomplete groups and ifs within files */
+#define skipping 1 /* |scanner_status| when passing conditional text */
+#define defining 2 /* |scanner_status| when reading a macro definition */
+#define matching 3 /* |scanner_status| when reading macro arguments */
+#define aligning 4 /* |scanner_status| when reading an alignment preamble */
+#define absorbing 5 /* |scanner_status| when reading a balanced text */
-#define int_par(a) zeqtb[static_int_base+a].cint /* an integer parameter */
-#define cat_code_table int_par(cat_code_table_code)
-#define tracing_nesting int_par(tracing_nesting_code)
-#define end_line_char int_par(end_line_char_code)
+#define right_brace_token 0x400000 /* $2^{21}\cdot|right_brace|$ */
-#define every_eof get_every_eof()
+#define cat_code_table int_par(param_cat_code_table_code)
+#define tracing_nesting int_par(param_tracing_nesting_code)
+#define end_line_char int_par(param_end_line_char_code)
+#define suppress_outer_error int_par(param_suppress_outer_error_code)
-#define number_active_chars 65536+65536
-#define active_base 1 /* beginning of region 1, for active character equivalents */
-#define null_cs active_base+number_active_chars /* equivalent of \.{\\csname\\endcsname} */
+#define every_eof get_every_eof()
+#define null_cs 1 /* equivalent of \.{\\csname\\endcsname} */
#define eq_level(a) zeqtb[a].hh.u.B1
#define eq_type(a) zeqtb[a].hh.u.B0
@@ -39,28 +52,43 @@
#define nonstop_mode 1
-/* command codes */
-#define relax 0
-#define out_param 5
-#define max_command 117 /* fetched from C output */
-#define dont_expand 133 /* fetched from C output */
-
#define terminal_input (name==0) /* are we reading from the terminal? */
#define special_char 1114113 /* |biggest_char+2| */
#define cur_file input_file[index] /* the current |alpha_file| variable */
#define no_expand_flag special_char /*this characterizes a special variant of |relax| */
+#define detokenized_line() (line_catcode_table==NO_CAT_TABLE)
+
extern void insert_vj_template(void);
-#define do_get_cat_code(a) do { \
- if (local_catcode_table) \
- a=get_cat_code(line_catcode_table,cur_chr); \
- else \
- a=get_cat_code(cat_code_table,cur_chr); \
+#define do_get_cat_code(a) do { \
+ if (line_catcode_table!=DEFAULT_CAT_TABLE) \
+ a=get_cat_code(line_catcode_table,cur_chr); \
+ else \
+ a=get_cat_code(cat_code_table,cur_chr); \
} while (0)
+
+/* string compare */
+
+boolean str_eq_cstr(str_number r, char *s, size_t l)
+{
+ if (l != (size_t) length(r))
+ return false;
+ return (strncmp((const char *) (str_pool + str_start_macro(r)), s, l) == 0);
+}
+
+
+
+int get_char_cat_code(int cur_chr)
+{
+ int a;
+ do_get_cat_code(a);
+ return a;
+}
+
static void invalid_character_error(void)
{
char *hlp[] = { "A funny symbol that I can't read has just been input.",
@@ -72,14 +100,13 @@ static void invalid_character_error(void)
deletions_allowed = true;
}
-/* no longer done */
-
static boolean process_sup_mark(void); /* below */
static int scan_control_sequence(void); /* below */
typedef enum { next_line_ok, next_line_return,
- next_line_restart } next_line_retval;
+ next_line_restart
+} next_line_retval;
static next_line_retval next_line(void); /* below */
@@ -96,6 +123,8 @@ static void utf_error(void)
deletions_allowed = true;
}
+#define do_buffer_to_unichar(a,b) a = buffer[b] < 0x80 ? buffer[b++] : qbuffer_to_unichar(&b)
+
static integer qbuffer_to_unichar(integer * k)
{
register int ch;
@@ -131,13 +160,373 @@ static integer qbuffer_to_unichar(integer * k)
return (val);
}
+/* This is a very basic helper */
+
+char *u2s(unsigned unic)
+{
+ char *buf = xmalloc(5);
+ char *pt = buf;
+ if (unic < 0x80)
+ *pt++ = unic;
+ else if (unic < 0x800) {
+ *pt++ = 0xc0 | (unic >> 6);
+ *pt++ = 0x80 | (unic & 0x3f);
+ } else if (unic >= 0x110000) {
+ *pt++ = unic - 0x110000;
+ } else if (unic < 0x10000) {
+ *pt++ = 0xe0 | (unic >> 12);
+ *pt++ = 0x80 | ((unic >> 6) & 0x3f);
+ *pt++ = 0x80 | (unic & 0x3f);
+ } else {
+ int u, z, y, x;
+ unsigned val = unic - 0x10000;
+ u = ((val & 0xf0000) >> 16) + 1;
+ z = (val & 0x0f000) >> 12;
+ y = (val & 0x00fc0) >> 6;
+ x = val & 0x0003f;
+ *pt++ = 0xf0 | (u >> 2);
+ *pt++ = 0x80 | ((u & 3) << 4) | z;
+ *pt++ = 0x80 | y;
+ *pt++ = 0x80 | x;
+ }
+ *pt = '\0';
+ return buf;
+}
+
+
+/*
+ In case you are getting bored, here is a slightly less trivial routine:
+ Given a string of lowercase letters, like `\.{pt}' or `\.{plus}' or
+ `\.{width}', the |scan_keyword| routine checks to see whether the next
+ tokens of input match this string. The match must be exact, except that
+ uppercase letters will match their lowercase counterparts; uppercase
+ equivalents are determined by subtracting |"a"-"A"|, rather than using the
+ |uc_code| table, since \TeX\ uses this routine only for its own limited
+ set of keywords.
+
+ If a match is found, the characters are effectively removed from the input
+ and |true| is returned. Otherwise |false| is returned, and the input
+ is left essentially unchanged (except for the fact that some macros
+ may have been expanded, etc.).
+ @^inner loop@>
+*/
+
+boolean scan_keyword(char *s)
+{ /* look for a given string */
+ pointer p; /* tail of the backup list */
+ pointer q; /* new node being added to the token list via |store_new_token| */
+ char *k; /* index into |str_pool| */
+ if (strlen(s) == 1) {
+ /* @<Get the next non-blank non-call token@>; */
+ do {
+ get_x_token();
+ } while ((cur_cmd == spacer_cmd) || (cur_cmd == relax_cmd));
+ if ((cur_cs == 0) && ((cur_chr == *s) || (cur_chr == *s - 'a' + 'A'))) {
+ return true;
+ } else {
+ back_input();
+ return false;
+ }
+ } else {
+ p = backup_head;
+ link(p) = null;
+ k = s;
+ while (*k) {
+ get_x_token(); /* recursion is possible here */
+ if ((cur_cs == 0) &&
+ ((cur_chr == *k) || (cur_chr == *k - 'a' + 'A'))) {
+ store_new_token(cur_tok);
+ k++;
+ } else if ((cur_cmd != spacer_cmd) || (p != backup_head)) {
+ if (p != backup_head) {
+ q = get_avail();
+ info(q) = cur_tok;
+ link(q) = null;
+ link(p) = q;
+ begin_token_list(link(backup_head), backed_up);
+ } else {
+ back_input();
+ }
+ return false;
+ }
+ }
+ flush_list(link(backup_head));
+ }
+ return true;
+}
+
+/* |scan_direction| has to be defined here because luatangle will output
+ a character constant when it sees a string literal of length 1 */
+
+#define dir_T 0
+#define dir_L 1
+#define dir_B 2
+#define dir_R 3
+
+#define scan_single_dir(A) do { \
+ if (scan_keyword("T")) A=dir_T; \
+ else if (scan_keyword("L")) A=dir_L; \
+ else if (scan_keyword("B")) A=dir_B; \
+ else if (scan_keyword("R")) A=dir_R; \
+ else { \
+ tex_error("Bad direction", NULL); \
+ cur_val=0; \
+ return; \
+ } \
+ } while (0)
+
+void scan_direction(void)
+{
+ integer d1, d2, d3;
+ get_x_token();
+ if (cur_cmd == assign_dir_cmd) {
+ cur_val = zeqtb[cur_chr].cint;
+ return;
+ } else {
+ back_input();
+ }
+ scan_single_dir(d1);
+ scan_single_dir(d2);
+ if (dir_parallel(d1, d2)) {
+ tex_error("Bad direction", NULL);
+ cur_val = 0;
+ return;
+ }
+ scan_single_dir(d3);
+ get_x_token();
+ if (cur_cmd != spacer_cmd)
+ back_input();
+ cur_val = d1 * 8 + dir_rearrange[d2] * 4 + d3;
+}
+
+
+/* We can not return |undefined_control_sequence| under some conditions
+ * (inside |shift_case|, for example). This needs thinking.
+ */
+
+halfword active_to_cs(int curchr, int force)
+{
+ halfword curcs;
+ char *a, *b;
+ char *utfbytes = xmalloc(10);
+ int nncs = no_new_control_sequence;
+ a = u2s(0xFFFF);
+ utfbytes = strcpy(utfbytes, a);
+ if (force)
+ no_new_control_sequence = false;
+ if (curchr > 0) {
+ b = u2s(curchr);
+ utfbytes = strcat(utfbytes, b);
+ free(b);
+ curcs = string_lookup(utfbytes, strlen(utfbytes));
+ } else {
+ utfbytes[3] = '\0';
+ curcs = string_lookup(utfbytes, 4);
+ }
+ no_new_control_sequence = nncs;
+ free(a);
+ free(utfbytes);
+ return curcs;
+}
+
+/* TODO this function should listen to \.{\\escapechar} */
+
+#define is_active_cs(a) (length(a)>3 && \
+ (str_pool[str_start_macro(a)] == 0xEF) && \
+ (str_pool[str_start_macro(a)+1] == 0xBF) && \
+ (str_pool[str_start_macro(a)+2] == 0xBF))
+
+
+char *cs_to_string(pointer p)
+{ /* prints a control sequence */
+ char *s;
+ int k = 0;
+ static char ret[256] = { 0 };
+ if (p == null_cs) {
+ ret[k++] = '\\';
+ s = "csname";
+ while (*s) {
+ ret[k++] = *s++;
+ }
+ ret[k++] = '\\';
+ s = "endcsname";
+ while (*s) {
+ ret[k++] = *s++;
+ }
+ ret[k] = 0;
+
+ } else {
+ str_number txt = zget_cs_text(p);
+ s = makecstring(txt);
+ if (is_active_cs(txt)) {
+ s = s + 3;
+ while (*s) {
+ ret[k++] = *s++;
+ }
+ ret[k] = 0;
+ } else {
+ ret[k++] = '\\';
+ while (*s) {
+ ret[k++] = *s++;
+ }
+ ret[k] = 0;
+ }
+ }
+ return (char *) ret;
+}
+
+/* TODO this is a quick hack, will be solved differently soon */
+
+char *cmd_chr_to_string(int cmd, int chr)
+{
+ char *s;
+ strnumber str;
+ int sel = selector;
+ selector = new_string;
+ print_cmd_chr(cmd, chr);
+ str = make_string();
+ s = makecstring(str);
+ selector = sel;
+ flush_str(str);
+ return s;
+}
+
+/* Before getting into |get_next|, let's consider the subroutine that
+ is called when an `\.{\\outer}' control sequence has been scanned or
+ when the end of a file has been reached. These two cases are distinguished
+ by |cur_cs|, which is zero at the end of a file.
+*/
+
+static int frozen_control_sequence = 0;
+
+#define frozen_cr (frozen_control_sequence+1) /* permanent `\.{\\cr}' */
+#define frozen_fi (frozen_control_sequence+4) /* permanent `\.{\\fi}' */
+
+void check_outer_validity(void)
+{
+ pointer p; /* points to inserted token list */
+ pointer q; /* auxiliary pointer */
+ if (suppress_outer_error)
+ return;
+ if (frozen_control_sequence == 0) {
+ frozen_control_sequence = get_nullcs() + 1 + get_hash_size(); /* hashbase=nullcs+1 */
+ }
+ if (scanner_status != normal) {
+ deletions_allowed = false;
+ /* @<Back up an outer control sequence so that it can be reread@>; */
+ /* An outer control sequence that occurs in a \.{\\read} will not be reread,
+ since the error recovery for \.{\\read} is not very powerful. */
+ if (cur_cs != 0) {
+ if ((state == token_list) || (name < 1) || (name > 17)) {
+ p = get_avail();
+ info(p) = cs_token_flag + cur_cs;
+ begin_token_list(p, backed_up); /* prepare to read the control sequence again */
+ }
+ cur_cmd = spacer_cmd;
+ cur_chr = ' '; /* replace it by a space */
+ }
+ if (scanner_status > skipping) {
+ char *errhlp[] = { "I suspect you have forgotten a `}', causing me",
+ "to read past where you wanted me to stop.",
+ "I'll try to recover; but if the error is serious,",
+ "you'd better type `E' or `X' now and fix your file.",
+ NULL
+ };
+ char errmsg[256];
+ char *startmsg, *scannermsg;
+ /* @<Tell the user what has run away and try to recover@> */
+ runaway(); /* print a definition, argument, or preamble */
+ if (cur_cs == 0) {
+ startmsg = "File ended";
+ } else {
+ cur_cs = 0;
+ startmsg = "Forbidden control sequence found";
+ }
+ /* @<Print either `\.{definition}' or `\.{use}' or `\.{preamble}' or `\.{text}',
+ and insert tokens that should lead to recovery@>; */
+ /* The recovery procedure can't be fully understood without knowing more
+ about the \TeX\ routines that should be aborted, but we can sketch the
+ ideas here: For a runaway definition we will insert a right brace; for a
+ runaway preamble, we will insert a special \.{\\cr} token and a right
+ brace; and for a runaway argument, we will set |long_state| to
+ |outer_call| and insert \.{\\par}. */
+ p = get_avail();
+ switch (scanner_status) {
+ case defining:
+ scannermsg = "definition";
+ info(p) = right_brace_token + '}';
+ break;
+ case matching:
+ scannermsg = "use";
+ info(p) = par_token;
+ long_state = outer_call_cmd;
+ break;
+ case aligning:
+ scannermsg = "preamble";
+ info(p) = right_brace_token + '}';
+ q = p;
+ p = get_avail();
+ link(p) = q;
+ info(p) = cs_token_flag + frozen_cr;
+ align_state = -1000000;
+ break;
+ case absorbing:
+ scannermsg = "text";
+ info(p) = right_brace_token + '}';
+ break;
+ default: /* can't happen */
+ scannermsg = "unknown";
+ break;
+ } /*there are no other cases */
+ begin_token_list(p, inserted);
+ snprintf(errmsg, 255, "%s while scanning %s of %s",
+ startmsg, scannermsg, cs_to_string(warning_index));
+ tex_error(errmsg, errhlp);
+ } else {
+ char errmsg[256];
+ char *errhlp_no[] =
+ { "The file ended while I was skipping conditional text.",
+ "This kind of error happens when you say `\\if...' and forget",
+ "the matching `\\fi'. I've inserted a `\\fi'; this might work.",
+ NULL
+ };
+ char *errhlp_cs[] =
+ { "A forbidden control sequence occurred in skipped text.",
+ "This kind of error happens when you say `\\if...' and forget",
+ "the matching `\\fi'. I've inserted a `\\fi'; this might work.",
+ NULL
+ };
+ char **errhlp = (char **) errhlp_no;
+ if (cur_cs != 0) {
+ errhlp = errhlp_cs;
+ cur_cs = 0;
+ }
+ snprintf(errmsg, 255,
+ "Incomplete %s; all text was ignored after line %d",
+ cmd_chr_to_string(if_test_cmd, cur_if), skip_line);
+ /* @.Incomplete \\if...@> */
+ cur_tok = cs_token_flag + frozen_fi;
+ /* back up one inserted token and call |error| */
+ {
+ OK_to_interrupt = false;
+ back_input();
+ token_type = inserted;
+ OK_to_interrupt = true;
+ tex_error(errmsg, errhlp);
+ }
+ }
+ deletions_allowed = true;
+ }
+}
+
static boolean get_next_file(void)
{
SWITCH:
if (loc <= limit) { /* current line not yet finished */
- cur_chr = qbuffer_to_unichar(&loc);
+ do_buffer_to_unichar(cur_chr, loc);
+
RESWITCH:
- if (detokenized_line) {
+ if (detokenized_line()) {
cur_cmd = (cur_chr == ' ' ? 10 : 12);
} else {
do_get_cat_code(cur_cmd);
@@ -154,45 +543,49 @@ static boolean get_next_file(void)
command code to the state to get a single number that characterizes both.
*/
switch (state + cur_cmd) {
- case mid_line + ignore:
- case skip_blanks + ignore:
- case new_line + ignore:
- case skip_blanks + spacer:
- case new_line + spacer: /* @<Cases where character is ignored@> */
+ case mid_line + ignore_cmd:
+ case skip_blanks + ignore_cmd:
+ case new_line + ignore_cmd:
+ case skip_blanks + spacer_cmd:
+ case new_line + spacer_cmd: /* @<Cases where character is ignored@> */
goto SWITCH;
break;
- case mid_line + escape:
- case new_line + escape:
- case skip_blanks + escape: /* @<Scan a control sequence ...@>; */
+ case mid_line + escape_cmd:
+ case new_line + escape_cmd:
+ case skip_blanks + escape_cmd: /* @<Scan a control sequence ...@>; */
state = scan_control_sequence();
+ if (cur_cmd >= outer_call_cmd)
+ check_outer_validity();
break;
- case mid_line + active_char:
- case new_line + active_char:
- case skip_blanks + active_char: /* @<Process an active-character */
- cur_cs = cur_chr + active_base;
+ case mid_line + active_char_cmd:
+ case new_line + active_char_cmd:
+ case skip_blanks + active_char_cmd: /* @<Process an active-character */
+ cur_cs = active_to_cs(cur_chr, false);
cur_cmd = eq_type(cur_cs);
cur_chr = equiv(cur_cs);
state = mid_line;
+ if (cur_cmd >= outer_call_cmd)
+ check_outer_validity();
break;
- case mid_line + sup_mark:
- case new_line + sup_mark:
- case skip_blanks + sup_mark: /* @<If this |sup_mark| starts */
+ case mid_line + sup_mark_cmd:
+ case new_line + sup_mark_cmd:
+ case skip_blanks + sup_mark_cmd: /* @<If this |sup_mark| starts */
if (process_sup_mark())
goto RESWITCH;
else
state = mid_line;
break;
- case mid_line + invalid_char:
- case new_line + invalid_char:
- case skip_blanks + invalid_char: /* @<Decry the invalid character and |goto restart|@>; */
+ case mid_line + invalid_char_cmd:
+ case new_line + invalid_char_cmd:
+ case skip_blanks + invalid_char_cmd: /* @<Decry the invalid character and |goto restart|@>; */
invalid_character_error();
return false; /* because state may be token_list now */
break;
- case mid_line + spacer: /* @<Enter |skip_blanks| state, emit a space@>; */
+ case mid_line + spacer_cmd: /* @<Enter |skip_blanks| state, emit a space@>; */
state = skip_blanks;
cur_chr = ' ';
break;
- case mid_line + car_ret: /* @<Finish line, emit a space@>; */
+ case mid_line + car_ret_cmd: /* @<Finish line, emit a space@>; */
/* When a character of type |spacer| gets through, its character code is
changed to $\.{"\ "}=@'40$. This means that the ASCII codes for tab and space,
and for the space inserted at the end of a line, will
@@ -200,40 +593,42 @@ static boolean get_next_file(void)
since such characters are indistinguishable on most computer terminal displays.
*/
loc = limit + 1;
- cur_cmd = spacer;
+ cur_cmd = spacer_cmd;
cur_chr = ' ';
break;
- case skip_blanks + car_ret:
- case mid_line + comment:
- case new_line + comment:
- case skip_blanks + comment: /* @<Finish line, |goto switch|@>; */
+ case skip_blanks + car_ret_cmd:
+ case mid_line + comment_cmd:
+ case new_line + comment_cmd:
+ case skip_blanks + comment_cmd: /* @<Finish line, |goto switch|@>; */
loc = limit + 1;
goto SWITCH;
break;
- case new_line + car_ret: /* @<Finish line, emit a \.{\\par}@>; */
+ case new_line + car_ret_cmd: /* @<Finish line, emit a \.{\\par}@>; */
loc = limit + 1;
cur_cs = par_loc;
cur_cmd = eq_type(cur_cs);
cur_chr = equiv(cur_cs);
+ if (cur_cmd >= outer_call_cmd)
+ check_outer_validity();
break;
- case skip_blanks + left_brace:
- case new_line + left_brace:
+ case skip_blanks + left_brace_cmd:
+ case new_line + left_brace_cmd:
state = mid_line; /* fall through */
- case mid_line + left_brace:
+ case mid_line + left_brace_cmd:
align_state++;
break;
- case skip_blanks + right_brace:
- case new_line + right_brace:
+ case skip_blanks + right_brace_cmd:
+ case new_line + right_brace_cmd:
state = mid_line; /* fall through */
- case mid_line + right_brace:
+ case mid_line + right_brace_cmd:
align_state--;
break;
- case mid_line + math_shift:
- case mid_line + tab_mark:
- case mid_line + mac_param:
- case mid_line + sub_mark:
- case mid_line + letter:
- case mid_line + other_char:
+ case mid_line + math_shift_cmd:
+ case mid_line + tab_mark_cmd:
+ case mid_line + mac_param_cmd:
+ case mid_line + sub_mark_cmd:
+ case mid_line + letter_cmd:
+ case mid_line + other_char_cmd:
break;
default:
/*
@@ -282,30 +677,30 @@ static boolean get_next_file(void)
#define is_hex(a) ((a>='0'&&a<='9')||(a>='a'&&a<='f'))
-#define add_nybble(a) do { \
- if (a<='9') cur_chr=(cur_chr<<4)+a-'0'; \
- else cur_chr=(cur_chr<<4)+a-'a'+10; \
+#define add_nybble(a) do { \
+ if (a<='9') cur_chr=(cur_chr<<4)+a-'0'; \
+ else cur_chr=(cur_chr<<4)+a-'a'+10; \
} while (0)
-#define hex_to_cur_chr do { \
- if (c<='9') cur_chr=c-'0'; \
- else cur_chr=c-'a'+10; \
- add_nybble(cc); \
+#define hex_to_cur_chr do { \
+ if (c<='9') cur_chr=c-'0'; \
+ else cur_chr=c-'a'+10; \
+ add_nybble(cc); \
} while (0)
-#define four_hex_to_cur_chr do { \
- hex_to_cur_chr; \
- add_nybble(ccc); add_nybble(cccc); \
+#define four_hex_to_cur_chr do { \
+ hex_to_cur_chr; \
+ add_nybble(ccc); add_nybble(cccc); \
} while (0)
-#define five_hex_to_cur_chr do { \
- four_hex_to_cur_chr; \
- add_nybble(ccccc); \
+#define five_hex_to_cur_chr do { \
+ four_hex_to_cur_chr; \
+ add_nybble(ccccc); \
} while (0)
-#define six_hex_to_cur_chr do { \
- five_hex_to_cur_chr; \
- add_nybble(cccccc); \
+#define six_hex_to_cur_chr do { \
+ five_hex_to_cur_chr; \
+ add_nybble(cccccc); \
} while (0)
@@ -409,22 +804,22 @@ static int scan_control_sequence(void)
register int cat; /* |cat_code(cur_chr)|, usually */
while (1) {
integer k = loc;
- cur_chr = qbuffer_to_unichar(&k);
+ do_buffer_to_unichar(cur_chr, k);
do_get_cat_code(cat);
- if (cat != letter || k > limit) {
- retval = (cat == spacer ? skip_blanks : mid_line);
- if (cat == sup_mark && check_expanded_code(&k)) /* @<If an expanded...@>; */
+ if (cat != letter_cmd || k > limit) {
+ retval = (cat == spacer_cmd ? skip_blanks : mid_line);
+ if (cat == sup_mark_cmd && check_expanded_code(&k)) /* @<If an expanded...@>; */
continue;
} else {
retval = skip_blanks;
do {
- cur_chr = qbuffer_to_unichar(&k);
+ do_buffer_to_unichar(cur_chr, k);
do_get_cat_code(cat);
- } while (cat == letter && k <= limit);
+ } while (cat == letter_cmd && k <= limit);
- if (cat == sup_mark && check_expanded_code(&k)) /* @<If an expanded...@>; */
+ if (cat == sup_mark_cmd && check_expanded_code(&k)) /* @<If an expanded...@>; */
continue;
- if (cat != letter) {
+ if (cat != letter_cmd) {
decr(k);
if (cur_chr > 0xFFFF)
decr(k);
@@ -562,10 +957,7 @@ static boolean check_expanded_code(integer * kk)
static next_line_retval next_line(void)
{
- integer tab; /* a category table */
boolean inhibit_eol = false; /* a way to end a pseudo file without trailing space */
- detokenized_line = false;
- local_catcode_table = false;
if (name > 17) {
/* @<Read next line of file into |buffer|, or |goto restart| if the file has ended@> */
incr(line);
@@ -574,6 +966,7 @@ static next_line_retval next_line(void)
if (name <= 20) {
if (pseudo_input()) { /* not end of file */
firm_up_the_line(); /* this sets |limit| */
+ line_catcode_table = DEFAULT_CAT_TABLE;
if ((name == 19) && (pseudo_lines(pseudo_files) == null))
inhibit_eol = true;
} else if ((every_eof != null) && !eof_seen[index]) {
@@ -589,28 +982,20 @@ static next_line_retval next_line(void)
if (name == 21) {
if (luacstring_input()) { /* not end of strings */
firm_up_the_line();
- if ((luacstring_penultimate()) || (luacstring_simple()))
+ line_catcode_table = luacstring_cattable();
+ line_partial = luacstring_partial();
+ if (luacstring_final_line() || line_partial
+ || line_catcode_table == NO_CAT_TABLE)
inhibit_eol = true;
- if (!luacstring_simple())
+ if (!line_partial)
state = new_line;
- if (luacstring_detokenized()) {
- inhibit_eol = true;
- detokenized_line = true;
- } else {
- if (!luacstring_defaultcattable()) {
- tab = luacstring_cattable();
- if (valid_catcode_table(tab)) {
- local_catcode_table = true;
- line_catcode_table = tab;
- }
- }
- }
} else {
force_eof = true;
}
} else {
if (lua_input_ln(cur_file, 0, true)) { /* not end of file */
firm_up_the_line(); /* this sets |limit| */
+ line_catcode_table = DEFAULT_CAT_TABLE;
} else if ((every_eof != null) && (!eof_seen[index])) {
limit = first - 1;
eof_seen[index] = true; /* fake one empty line */
@@ -635,7 +1020,13 @@ static next_line_retval next_line(void)
/* update_terminal(); *//* show user that file has been read */
}
force_eof = false;
- end_file_reading();
+ if (name == 21 || /* lua input */
+ name == 19) { /* \scantextokens */
+ end_file_reading();
+ } else {
+ end_file_reading();
+ check_outer_validity();
+ }
return next_line_restart;
}
if (inhibit_eol || end_line_char_inactive)
@@ -695,18 +1086,22 @@ static boolean get_next_tokenlist(void)
if (t >= cs_token_flag) { /* a control sequence token */
cur_cs = t - cs_token_flag;
cur_cmd = eq_type(cur_cs);
- if (cur_cmd == dont_expand) { /* @<Get the next token, suppressing expansion@> */
- /* The present point in the program is reached only when the |expand|
- routine has inserted a special marker into the input. In this special
- case, |info(loc)| is known to be a control sequence token, and |link(loc)=null|.
- */
- cur_cs = info(loc) - cs_token_flag;
- loc = null;
- cur_cmd = eq_type(cur_cs);
- if (cur_cmd > max_command) {
- cur_cmd = relax;
- cur_chr = no_expand_flag;
- return true;
+ if (cur_cmd >= outer_call_cmd) {
+ if (cur_cmd == dont_expand_cmd) { /* @<Get the next token, suppressing expansion@> */
+ /* The present point in the program is reached only when the |expand|
+ routine has inserted a special marker into the input. In this special
+ case, |info(loc)| is known to be a control sequence token, and |link(loc)=null|.
+ */
+ cur_cs = info(loc) - cs_token_flag;
+ loc = null;
+ cur_cmd = eq_type(cur_cs);
+ if (cur_cmd > max_command_cmd) {
+ cur_cmd = relax_cmd;
+ cur_chr = no_expand_flag;
+ return true;
+ }
+ } else {
+ check_outer_validity();
}
}
cur_chr = equiv(cur_cs);
@@ -714,13 +1109,13 @@ static boolean get_next_tokenlist(void)
cur_cmd = t >> string_offset_bits; /* cur_cmd=t / string_offset; */
cur_chr = t & (string_offset - 1); /* cur_chr=t % string_offset; */
switch (cur_cmd) {
- case left_brace:
+ case left_brace_cmd:
align_state++;
break;
- case right_brace:
+ case right_brace_cmd:
align_state--;
break;
- case out_param: /* @<Insert macro parameter and |goto restart|@>; */
+ case out_param_cmd: /* @<Insert macro parameter and |goto restart|@>; */
begin_token_list(param_stack[param_start + cur_chr - 1], parameter);
return false;
break;
@@ -753,7 +1148,7 @@ void get_next(void)
}
}
/* @<If an alignment entry has just ended, take appropriate action@> */
- if ((cur_cmd == tab_mark || cur_cmd == car_ret) && align_state == 0) {
+ if ((cur_cmd == tab_mark_cmd || cur_cmd == car_ret_cmd) && align_state == 0) {
insert_vj_template();
goto RESTART;
}
diff --git a/Build/source/texk/web2c/luatexdir/texmath.h b/Build/source/texk/web2c/luatexdir/texmath.h
new file mode 100644
index 00000000000..fb0ae4a679e
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/texmath.h
@@ -0,0 +1,316 @@
+/* texmath.h
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id: texmath.h 1893 2009-02-23 11:30:05Z taco $ */
+
+#ifndef TEXMATH_H
+# define TEXMATH_H 1
+
+# define empty 0
+
+extern pointer new_noad(void);
+
+extern void show_math_node(halfword);
+extern void print_math_comp(halfword);
+extern void print_limit_switch(halfword);
+extern void print_style(halfword);
+extern void print_size(halfword);
+extern void flush_math(void);
+extern void math_left_brace(void);
+extern void finish_display_alignment(halfword, halfword, memory_word);
+extern halfword new_sub_box(halfword);
+
+# define math_reset(p) do { if (p!=null) flush_node(p); p = null; } while (0)
+
+# define scripts_allowed(A) ((type((A))>=ord_noad)&&(type((A))<fence_noad))
+
+# define default_code 010000000000 /* denotes |default_rule_thickness| */
+
+# define limits 1 /* |subtype| of |op_noad| whose scripts are to be above, below */
+# define no_limits 2 /* |subtype| of |op_noad| whose scripts are to be normal */
+
+extern void initialize_math(void);
+extern void initialize_math_spacing(void);
+extern halfword math_vcenter_group(halfword);
+extern void build_choices(void);
+extern void close_math_group(halfword);
+extern void init_math(void);
+extern void start_eq_no(void);
+extern void set_math_char(mathcodeval);
+extern void math_char_in_text(mathcodeval);
+extern void math_math_comp(void);
+extern void math_limit_switch(void);
+extern void math_radical(void);
+extern void math_ac(void);
+extern pointer new_style(small_number);
+extern void append_choices(void);
+extern void sub_sup(void);
+extern void math_fraction(void);
+extern void math_left_right(void);
+extern void after_math(void);
+
+extern void scan_extdef_del_code(int level, int extcode);
+extern void scan_extdef_math_code(int level, int extcode);
+
+extern integer fam_fnt(integer fam_id, integer size_id);
+extern void def_fam_fnt(integer fam_id, integer size_id, integer f,
+ integer lvl);
+extern void dump_math_data(void);
+extern void undump_math_data(void);
+void unsave_math_data(integer lvl);
+
+extern pointer cur_mlist;
+extern integer cur_style;
+extern boolean mlist_penalties;
+extern integer cur_size;
+
+scaled get_math_quad(int a);
+boolean check_necessary_fonts(void);
+
+/*
+ @ We also need to compute the change in style between mlists and their
+ subsidiaries. The following macros define the subsidiary style for
+ an overlined nucleus (|cramped_style|), for a subscript or a superscript
+ (|sub_style| or |sup_style|), or for a numerator or denominator (|num_style|
+ or |denom_style|).
+*/
+
+typedef enum {
+ display_style = 0, /* |subtype| for \.{\\displaystyle} */
+ cramped_display_style, /* |subtype| for \.{\\crampeddisplaystyle} */
+ text_style, /* |subtype| for \.{\\textstyle} */
+ cramped_text_style, /* |subtype| for \.{\\crampedtextstyle} */
+ script_style, /* |subtype| for \.{\\scriptstyle} */
+ cramped_script_style, /* |subtype| for \.{\\crampedscriptstyle} */
+ script_script_style, /* |subtype| for \.{\\scriptscriptstyle} */
+ cramped_script_script_style, /* |subtype| for \.{\\crampedscriptscriptstyle} */
+} math_style_subtypes;
+
+extern const char *math_style_names[];
+
+# define cramped 1 /* add this to an uncramped style if you want to cramp it */
+
+# define cramped_style(A) 2*((A)/2)+cramped /* cramp the style */
+# define sub_style(A) 2*((A)/4)+script_style+cramped /* smaller and cramped */
+# define sup_style(A) 2*((A)/4)+script_style+((A)%2) /* smaller */
+# define num_style(A) (A)+2-2*((A)/6) /* smaller unless already script-script */
+# define denom_style(A) 2*((A)/2)+cramped+2-2*((A)/6) /* smaller, cramped */
+
+void mlist_to_hlist(void);
+
+# define text_size 0
+# define script_size 1
+# define script_script_size 2
+
+# define math_direction int_par(param_math_direction_code)
+
+# define dir_math_save cur_list.math_field
+
+# define null_font 0
+# define min_quarterword 0
+
+# define undefined_math_parameter max_dimen
+
+typedef enum {
+ math_param_quad,
+ math_param_axis,
+ math_param_operator_size,
+ math_param_overbar_kern,
+ math_param_overbar_rule,
+ math_param_overbar_vgap,
+ math_param_underbar_kern,
+ math_param_underbar_rule,
+ math_param_underbar_vgap,
+ math_param_radical_kern,
+ math_param_radical_rule,
+ math_param_radical_vgap,
+ math_param_radical_degree_before,
+ math_param_radical_degree_after,
+ math_param_radical_degree_raise,
+ math_param_stack_vgap,
+ math_param_stack_num_up,
+ math_param_stack_denom_down,
+ math_param_fraction_rule,
+ math_param_fraction_num_vgap,
+ math_param_fraction_num_up,
+ math_param_fraction_denom_vgap,
+ math_param_fraction_denom_down,
+ math_param_fraction_del_size,
+ math_param_limit_above_vgap,
+ math_param_limit_above_bgap,
+ math_param_limit_above_kern,
+ math_param_limit_below_vgap,
+ math_param_limit_below_bgap,
+ math_param_limit_below_kern,
+ math_param_under_delimiter_vgap,
+ math_param_under_delimiter_bgap,
+ math_param_over_delimiter_vgap,
+ math_param_over_delimiter_bgap,
+ math_param_sub_shift_drop,
+ math_param_sup_shift_drop,
+ math_param_sub_shift_down,
+ math_param_sub_sup_shift_down,
+ math_param_sub_top_max,
+ math_param_sup_shift_up,
+ math_param_sup_bottom_min,
+ math_param_sup_sub_bottom_max,
+ math_param_subsup_vgap,
+ math_param_space_after_script,
+ math_param_connector_overlap_min,
+ math_param_ord_ord_spacing,
+ math_param_ord_op_spacing,
+ math_param_ord_bin_spacing,
+ math_param_ord_rel_spacing,
+ math_param_ord_open_spacing,
+ math_param_ord_close_spacing,
+ math_param_ord_punct_spacing,
+ math_param_ord_inner_spacing,
+ math_param_op_ord_spacing,
+ math_param_op_op_spacing,
+ math_param_op_bin_spacing,
+ math_param_op_rel_spacing,
+ math_param_op_open_spacing,
+ math_param_op_close_spacing,
+ math_param_op_punct_spacing,
+ math_param_op_inner_spacing,
+ math_param_bin_ord_spacing,
+ math_param_bin_op_spacing,
+ math_param_bin_bin_spacing,
+ math_param_bin_rel_spacing,
+ math_param_bin_open_spacing,
+ math_param_bin_close_spacing,
+ math_param_bin_punct_spacing,
+ math_param_bin_inner_spacing,
+ math_param_rel_ord_spacing,
+ math_param_rel_op_spacing,
+ math_param_rel_bin_spacing,
+ math_param_rel_rel_spacing,
+ math_param_rel_open_spacing,
+ math_param_rel_close_spacing,
+ math_param_rel_punct_spacing,
+ math_param_rel_inner_spacing,
+ math_param_open_ord_spacing,
+ math_param_open_op_spacing,
+ math_param_open_bin_spacing,
+ math_param_open_rel_spacing,
+ math_param_open_open_spacing,
+ math_param_open_close_spacing,
+ math_param_open_punct_spacing,
+ math_param_open_inner_spacing,
+ math_param_close_ord_spacing,
+ math_param_close_op_spacing,
+ math_param_close_bin_spacing,
+ math_param_close_rel_spacing,
+ math_param_close_open_spacing,
+ math_param_close_close_spacing,
+ math_param_close_punct_spacing,
+ math_param_close_inner_spacing,
+ math_param_punct_ord_spacing,
+ math_param_punct_op_spacing,
+ math_param_punct_bin_spacing,
+ math_param_punct_rel_spacing,
+ math_param_punct_open_spacing,
+ math_param_punct_close_spacing,
+ math_param_punct_punct_spacing,
+ math_param_punct_inner_spacing,
+ math_param_inner_ord_spacing,
+ math_param_inner_op_spacing,
+ math_param_inner_bin_spacing,
+ math_param_inner_rel_spacing,
+ math_param_inner_open_spacing,
+ math_param_inner_close_spacing,
+ math_param_inner_punct_spacing,
+ math_param_inner_inner_spacing,
+ math_param_last
+} math_parameters;
+
+# define math_param_first_mu_glue math_param_ord_ord_spacing
+
+extern void print_math_param(int param_code);
+extern void def_math_param(int param_code, int style_code, scaled value,
+ int lvl);
+extern scaled get_math_param(int param_code, int style_code);
+
+
+typedef enum {
+ ScriptPercentScaleDown = 1,
+ ScriptScriptPercentScaleDown,
+ DelimitedSubFormulaMinHeight,
+ DisplayOperatorMinHeight,
+ MathLeading,
+ AxisHeight,
+ AccentBaseHeight,
+ FlattenedAccentBaseHeight,
+ SubscriptShiftDown,
+ SubscriptTopMax,
+ SubscriptBaselineDropMin,
+ SuperscriptShiftUp,
+ SuperscriptShiftUpCramped,
+ SuperscriptBottomMin,
+ SuperscriptBaselineDropMax,
+ SubSuperscriptGapMin,
+ SuperscriptBottomMaxWithSubscript,
+ SpaceAfterScript,
+ UpperLimitGapMin,
+ UpperLimitBaselineRiseMin,
+ LowerLimitGapMin,
+ LowerLimitBaselineDropMin,
+ StackTopShiftUp,
+ StackTopDisplayStyleShiftUp,
+ StackBottomShiftDown,
+ StackBottomDisplayStyleShiftDown,
+ StackGapMin,
+ StackDisplayStyleGapMin,
+ StretchStackTopShiftUp,
+ StretchStackBottomShiftDown,
+ StretchStackGapAboveMin,
+ StretchStackGapBelowMin,
+ FractionNumeratorShiftUp,
+ FractionNumeratorDisplayStyleShiftUp,
+ FractionDenominatorShiftDown,
+ FractionDenominatorDisplayStyleShiftDown,
+ FractionNumeratorGapMin,
+ FractionNumeratorDisplayStyleGapMin,
+ FractionRuleThickness,
+ FractionDenominatorGapMin,
+ FractionDenominatorDisplayStyleGapMin,
+ SkewedFractionHorizontalGap,
+ SkewedFractionVerticalGap,
+ OverbarVerticalGap,
+ OverbarRuleThickness,
+ OverbarExtraAscender,
+ UnderbarVerticalGap,
+ UnderbarRuleThickness,
+ UnderbarExtraDescender,
+ RadicalVerticalGap,
+ RadicalDisplayStyleVerticalGap,
+ RadicalRuleThickness,
+ RadicalExtraAscender,
+ RadicalKernBeforeDegree,
+ RadicalKernAfterDegree,
+ RadicalDegreeBottomRaisePercent,
+ MinConnectorOverlap,
+} MATH_param_codes;
+
+# define MATH_param_max MinConnectorOverlap
+
+extern const char *MATH_param_names[];
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/textcodes.c b/Build/source/texk/web2c/luatexdir/textcodes.c
index 05f85b941c4..2257f360446 100644
--- a/Build/source/texk/web2c/luatexdir/textcodes.c
+++ b/Build/source/texk/web2c/luatexdir/textcodes.c
@@ -1,121 +1,139 @@
+/* textcodes.c
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-/*
-Copyright (c) 2006 Taco Hoekwater, <taco@elvenkind.com>
+ This file is part of LuaTeX.
-This file is part of LuaTeX.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-LuaTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-LuaTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with LuaTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id $
-*/
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "luatex-api.h"
#include <ptexlib.h>
#include <stdarg.h>
#include "managed-sa.h"
+#include "commands.h"
+
+static const char __svn_version[] =
+ "$Id$ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/textcodes.c $";
#define LCCODESTACK 8
#define LCCODEDEFAULT 0
-static sa_tree lccode_head = NULL;
+static sa_tree lccode_head = NULL;
#define UCCODESTACK 8
#define UCCODEDEFAULT 0
-static sa_tree uccode_head = NULL;
+static sa_tree uccode_head = NULL;
#define SFCODESTACK 8
#define SFCODEDEFAULT 1000
-static sa_tree sfcode_head = NULL;
+static sa_tree sfcode_head = NULL;
#define CATCODESTACK 8
#define CATCODEDEFAULT 12
-void set_lc_code (integer n, halfword v, quarterword gl) {
- set_sa_item(lccode_head,n,v,gl);
+
+void set_lc_code(integer n, halfword v, quarterword gl)
+{
+ set_sa_item(lccode_head, n, v, gl);
}
-halfword get_lc_code (integer n) {
- return (halfword)get_sa_item(lccode_head,n);
+halfword get_lc_code(integer n)
+{
+ return (halfword) get_sa_item(lccode_head, n);
}
-static void unsavelccodes (quarterword gl) {
- restore_sa_stack(lccode_head,gl);
+static void unsavelccodes(quarterword gl)
+{
+ restore_sa_stack(lccode_head, gl);
}
-static void initializelccodes (void) {
- lccode_head = new_sa_tree(LCCODESTACK,LCCODEDEFAULT);
+static void initializelccodes(void)
+{
+ lccode_head = new_sa_tree(LCCODESTACK, LCCODEDEFAULT);
}
-static void dumplccodes (void) {
- dump_sa_tree(lccode_head);
+static void dumplccodes(void)
+{
+ dump_sa_tree(lccode_head);
}
-static void undumplccodes (void) {
- lccode_head = undump_sa_tree();
+static void undumplccodes(void)
+{
+ lccode_head = undump_sa_tree();
}
-void set_uc_code (integer n, halfword v, quarterword gl) {
- set_sa_item(uccode_head,n,v,gl);
+void set_uc_code(integer n, halfword v, quarterword gl)
+{
+ set_sa_item(uccode_head, n, v, gl);
}
-halfword get_uc_code (integer n) {
- return (halfword)get_sa_item(uccode_head,n);
+halfword get_uc_code(integer n)
+{
+ return (halfword) get_sa_item(uccode_head, n);
}
-static void unsaveuccodes (quarterword gl) {
- restore_sa_stack(uccode_head,gl);
+static void unsaveuccodes(quarterword gl)
+{
+ restore_sa_stack(uccode_head, gl);
}
-static void initializeuccodes (void) {
- uccode_head = new_sa_tree(UCCODESTACK,UCCODEDEFAULT);
+static void initializeuccodes(void)
+{
+ uccode_head = new_sa_tree(UCCODESTACK, UCCODEDEFAULT);
}
-static void dumpuccodes (void) {
- dump_sa_tree(uccode_head);
+static void dumpuccodes(void)
+{
+ dump_sa_tree(uccode_head);
}
-static void undumpuccodes (void) {
- uccode_head = undump_sa_tree();
+static void undumpuccodes(void)
+{
+ uccode_head = undump_sa_tree();
}
-void set_sf_code (integer n, halfword v, quarterword gl) {
- set_sa_item(sfcode_head,n,v,gl);
+void set_sf_code(integer n, halfword v, quarterword gl)
+{
+ set_sa_item(sfcode_head, n, v, gl);
}
-halfword get_sf_code (integer n) {
- return (halfword)get_sa_item(sfcode_head,n);
+halfword get_sf_code(integer n)
+{
+ return (halfword) get_sa_item(sfcode_head, n);
}
-static void unsavesfcodes (quarterword gl) {
- restore_sa_stack(sfcode_head,gl);
+static void unsavesfcodes(quarterword gl)
+{
+ restore_sa_stack(sfcode_head, gl);
}
-static void initializesfcodes (void) {
- sfcode_head = new_sa_tree(SFCODESTACK,SFCODEDEFAULT);
+static void initializesfcodes(void)
+{
+ sfcode_head = new_sa_tree(SFCODESTACK, SFCODEDEFAULT);
}
-static void dumpsfcodes (void) {
- dump_sa_tree(sfcode_head);
+static void dumpsfcodes(void)
+{
+ dump_sa_tree(sfcode_head);
}
-static void undumpsfcodes (void) {
- sfcode_head = undump_sa_tree();
+static void undumpsfcodes(void)
+{
+ sfcode_head = undump_sa_tree();
}
@@ -123,156 +141,178 @@ static sa_tree *catcode_heads = NULL;
static int catcode_max = 0;
static unsigned char *catcode_valid = NULL;
-void check_catcode_sizes (int h) {
- int k;
- if (h < 0)
- uexit(1);
- if (h>catcode_max) {
- catcode_heads = Mxrealloc_array(catcode_heads,sa_tree,(h+1));
- catcode_valid = Mxrealloc_array(catcode_valid,unsigned char,(h+1));
- for (k=(catcode_max+1);k<=h;k++) {
- catcode_heads[k] = NULL;
- catcode_valid[k] = 0;
- }
- catcode_max = h;
- }
-}
-
-void set_cat_code (integer h, integer n, halfword v, quarterword gl) {
- check_catcode_sizes(h);
- if (catcode_heads[h] == NULL) {
- catcode_heads[h] = new_sa_tree(CATCODESTACK,CATCODEDEFAULT);
- }
- set_sa_item(catcode_heads[h],n,v,gl);
-}
-
-halfword get_cat_code (integer h, integer n) {
- check_catcode_sizes(h);
- if (catcode_heads[h] == NULL) {
- catcode_heads[h] = new_sa_tree(CATCODESTACK,CATCODEDEFAULT);
- }
- return (halfword)get_sa_item(catcode_heads[h],n);
-}
-
-void unsave_cat_codes (integer h, quarterword gl) {
- int k;
- check_catcode_sizes(h);
- for (k=0;k<=catcode_max;k++) {
- if (catcode_heads[k] != NULL)
- restore_sa_stack(catcode_heads[k],gl);
- }
-}
-
-void clearcatcodestack(integer h) {
- clear_sa_stack(catcode_heads[h]);
-}
-
-static void initializecatcodes (void) {
- catcode_max = 0;
- catcode_heads = Mxmalloc_array(sa_tree,(catcode_max+1));
- catcode_valid = Mxmalloc_array(unsigned char,(catcode_max+1));
- catcode_valid[0] = 1;
- catcode_heads[0] = new_sa_tree(CATCODESTACK,CATCODEDEFAULT);
-}
-
-static void dumpcatcodes (void) {
- int k,total;
- dump_int(catcode_max);
- total = 0;
- for (k=0;k<=catcode_max;k++) {
- if (catcode_valid[k]) {
- total++;
+#define CATCODE_MAX 65535
+
+#define update_catcode_max(h) if (h > catcode_max) catcode_max = h
+
+void set_cat_code(integer h, integer n, halfword v, quarterword gl)
+{
+ sa_tree s = catcode_heads[h];
+ update_catcode_max(h);
+ if (s == NULL) {
+ s = new_sa_tree(CATCODESTACK, CATCODEDEFAULT);
+ catcode_heads[h] = s;
+ }
+ set_sa_item(s, n, v, gl);
+}
+
+halfword get_cat_code(integer h, integer n)
+{
+ sa_tree s = catcode_heads[h];
+ update_catcode_max(h);
+ if (s == NULL) {
+ s = new_sa_tree(CATCODESTACK, CATCODEDEFAULT);
+ catcode_heads[h] = s;
}
- }
- dump_int(total);
- for (k=0;k<=catcode_max;k++) {
- if (catcode_valid[k]) {
- dump_int(k);
- dump_sa_tree(catcode_heads[k]);
+ return (halfword) get_sa_item(s, n);
+}
+
+void unsave_cat_codes(integer h, quarterword gl)
+{
+ int k;
+ update_catcode_max(h);
+ for (k = 0; k <= catcode_max; k++) {
+ if (catcode_heads[k] != NULL)
+ restore_sa_stack(catcode_heads[k], gl);
+ }
+}
+
+void clearcatcodestack(integer h)
+{
+ clear_sa_stack(catcode_heads[h]);
+}
+
+static void initializecatcodes(void)
+{
+ catcode_max = 0;
+ /* xfree(catcode_heads); *//* not needed */
+ /* xfree(catcode_valid); */
+ catcode_heads = Mxmalloc_array(sa_tree, (CATCODE_MAX + 1));
+ catcode_valid = Mxmalloc_array(unsigned char, (CATCODE_MAX + 1));
+ memset(catcode_heads, 0, sizeof(sa_tree) * (CATCODE_MAX + 1));
+ memset(catcode_valid, 0, sizeof(unsigned char) * (CATCODE_MAX + 1));
+ catcode_valid[0] = 1;
+ catcode_heads[0] = new_sa_tree(CATCODESTACK, CATCODEDEFAULT);
+}
+
+static void dumpcatcodes(void)
+{
+ int k, total;
+ dump_int(catcode_max);
+ total = 0;
+ for (k = 0; k <= catcode_max; k++) {
+ if (catcode_valid[k]) {
+ total++;
+ }
+ }
+ dump_int(total);
+ for (k = 0; k <= catcode_max; k++) {
+ if (catcode_valid[k]) {
+ dump_int(k);
+ dump_sa_tree(catcode_heads[k]);
+ }
+ }
+}
+
+static void undumpcatcodes(void)
+{
+ int total, h, k;
+ xfree(catcode_heads);
+ xfree(catcode_valid);
+ catcode_heads = Mxmalloc_array(sa_tree, (CATCODE_MAX + 1));
+ catcode_valid = Mxmalloc_array(unsigned char, (CATCODE_MAX + 1));
+ memset(catcode_heads, 0, sizeof(sa_tree) * (CATCODE_MAX + 1));
+ memset(catcode_valid, 0, sizeof(unsigned char) * (CATCODE_MAX + 1));
+ undump_int(catcode_max);
+ undump_int(total);
+ for (k = 0; k < total; k++) {
+ undump_int(h);
+ catcode_heads[h] = undump_sa_tree();
+ catcode_valid[h] = 1;
+ }
+}
+
+int valid_catcode_table(int h)
+{
+ if (h <= CATCODE_MAX && h >= 0 && catcode_valid[h]) {
+ return 1;
+ }
+ return 0;
+}
+
+void copy_cat_codes(int from, int to)
+{
+ if (from < 0 || from > CATCODE_MAX || catcode_valid[from] == 0) {
+ uexit(1);
+ }
+ update_catcode_max(to);
+ destroy_sa_tree(catcode_heads[to]);
+ catcode_heads[to] = copy_sa_tree(catcode_heads[from]);
+ catcode_valid[to] = 1;
+}
+
+void initex_cat_codes(int h)
+{
+ int k;
+ update_catcode_max(h);
+ destroy_sa_tree(catcode_heads[h]);
+ catcode_heads[h] = NULL;
+ set_cat_code(h, '\r', car_ret_cmd, 1);
+ set_cat_code(h, ' ', spacer_cmd, 1);
+ set_cat_code(h, '\\', escape_cmd, 1);
+ set_cat_code(h, '%', comment_cmd, 1);
+ set_cat_code(h, 127, invalid_char_cmd, 1);
+ set_cat_code(h, 0, ignore_cmd, 1);
+ for (k = 'A'; k <= 'Z'; k++) {
+ set_cat_code(h, k, letter_cmd, 1);
+ set_cat_code(h, k + 'a' - 'A', letter_cmd, 1);
}
- }
-}
-
-static void undumpcatcodes (void) {
- int total,h,k;
- undump_int(catcode_max);
- catcode_heads = Mxmalloc_array(sa_tree,(catcode_max+1));
- catcode_valid = Mxmalloc_array(unsigned char,(catcode_max+1));
- for (k=0;k<=catcode_max;k++) {
- catcode_heads[k]=NULL;
- catcode_valid[k]=0;
- }
- undump_int(total);
- for (k=0;k<total;k++) {
- undump_int(h);
- catcode_heads[h] = undump_sa_tree();
catcode_valid[h] = 1;
- }
-}
-
-int valid_catcode_table (int h) {
- if (h<=catcode_max && h>=0 && catcode_valid[h]) {
- return 1;
- }
- return 0;
-}
-
-void copy_cat_codes (int from, int to) {
- if (from<0 || from>catcode_max || catcode_valid[from] == 0) {
- uexit(1);
- }
- check_catcode_sizes(to);
- destroy_sa_tree(catcode_heads[to]);
- catcode_heads[to] = copy_sa_tree(catcode_heads[from]);
- catcode_valid[to] = 1;
-}
-
-void initex_cat_codes (int h) {
- int k;
- check_catcode_sizes(h);
- destroy_sa_tree(catcode_heads[h]);
- catcode_heads[h] = NULL;
- set_cat_code(h,'\r',car_ret,1);
- set_cat_code(h,' ',spacer,1);
- set_cat_code(h,'\\',escape,1);
- set_cat_code(h,'%',comment,1);
- set_cat_code(h,127,invalid_char,1);
- set_cat_code(h,0,ignore,1);
- for (k='A';k<='Z';k++) {
- set_cat_code(h,k,letter,1);
- set_cat_code(h,k+'a'-'A',letter,1);
- }
- catcode_valid[h] = 1;
-}
-
-void
-unsave_text_codes (quarterword grouplevel) {
- unsavesfcodes(grouplevel);
- unsaveuccodes(grouplevel);
- unsavelccodes(grouplevel);
-}
-
-void
-initialize_text_codes (void) {
- initializesfcodes();
- initializeuccodes();
- initializecatcodes();
- initializelccodes();
-}
-
-void
-dump_text_codes (void) {
- dumpsfcodes();
- dumpuccodes();
- dumplccodes();
- dumpcatcodes();
-}
-
-void
-undump_text_codes (void) {
- undumpsfcodes();
- undumpuccodes();
- undumplccodes();
- undumpcatcodes();
}
+void unsave_text_codes(quarterword grouplevel)
+{
+ unsavesfcodes(grouplevel);
+ unsaveuccodes(grouplevel);
+ unsavelccodes(grouplevel);
+}
+
+void initialize_text_codes(void)
+{
+ initializesfcodes();
+ initializeuccodes();
+ initializecatcodes();
+ initializelccodes();
+}
+
+void free_text_codes(void)
+{
+ int k;
+ destroy_sa_tree(lccode_head);
+ destroy_sa_tree(uccode_head);
+ destroy_sa_tree(sfcode_head);
+ for (k = 0; k <= catcode_max; k++) {
+ if (catcode_valid[k]) {
+ destroy_sa_tree(catcode_heads[k]);
+ }
+ }
+ xfree(catcode_heads);
+ xfree(catcode_valid);
+}
+
+
+void dump_text_codes(void)
+{
+ dumpsfcodes();
+ dumpuccodes();
+ dumplccodes();
+ dumpcatcodes();
+}
+
+void undump_text_codes(void)
+{
+ undumpsfcodes();
+ undumpuccodes();
+ undumplccodes();
+ undumpcatcodes();
+}
diff --git a/Build/source/texk/web2c/luatexdir/tokens.h b/Build/source/texk/web2c/luatexdir/tokens.h
index 6078644ba22..92902ec4126 100644
--- a/Build/source/texk/web2c/luatexdir/tokens.h
+++ b/Build/source/texk/web2c/luatexdir/tokens.h
@@ -1,34 +1,52 @@
-/* $Id$ */
+/* tokens.h
+
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+
+ This file is part of LuaTeX.
+
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+/* $Id$ */
#define token_list 0
#define cs_token_flag 0x1FFFFFFF
#define string_offset 0x200000
#define string_offset_bits 21
-#define token_type index /* type of current token list */
-#define param_start limit /* base of macro parameters in |param_stack| */
+#define token_type index /* type of current token list */
+#define param_start limit /* base of macro parameters in |param_stack| */
typedef enum {
- parameter=0, /* code for parameter */
- u_template=1, /* code for \<u_j> template */
- v_template=2, /* code for \<v_j> template */
- backed_up=3, /* code for text to be reread */
- inserted=4, /* code for inserted texts */
- macro=5, /* code for defined control sequences */
- output_text=6, /* code for output routines */
- every_par_text=7, /* code for \.{\\everypar} */
- every_math_text=8, /* code for \.{\\everymath} */
- every_display_text=9, /* code for \.{\\everydisplay} */
- every_hbox_text=10, /* code for \.{\\everyhbox} */
- every_vbox_text=11, /* code for \.{\\everyvbox} */
- every_job_text=12, /* code for \.{\\everyjob}/ */
- every_cr_text=13, /* code for \.{\\everycr} */
- mark_text=14, /* code for \.{\\topmark}, etc. */
- every_eof_text=19 /* was calculated, value fetched from the generated C */
+ parameter = 0, /* code for parameter */
+ u_template = 1, /* code for \<u_j> template */
+ v_template = 2, /* code for \<v_j> template */
+ backed_up = 3, /* code for text to be reread */
+ inserted = 4, /* code for inserted texts */
+ macro = 5, /* code for defined control sequences */
+ output_text = 6, /* code for output routines */
+ every_par_text = 7, /* code for \.{\\everypar} */
+ every_math_text = 8, /* code for \.{\\everymath} */
+ every_display_text = 9, /* code for \.{\\everydisplay} */
+ every_hbox_text = 10, /* code for \.{\\everyhbox} */
+ every_vbox_text = 11, /* code for \.{\\everyvbox} */
+ every_job_text = 12, /* code for \.{\\everyjob}/ */
+ every_cr_text = 13, /* code for \.{\\everycr} */
+ mark_text = 14, /* code for \.{\\topmark}, etc. */
+ every_eof_text = 19 /* was calculated, value fetched from the generated C */
} token_types;
-#undef link /* defined by cpascal.h */
+#undef link /* defined by cpascal.h */
#define info(a) fixmem[(a)].hhlh
#define link(a) fixmem[(a)].hhrh
@@ -41,28 +59,28 @@ typedef enum {
#define length(a) (str_start_macro((a)+1)-str_start_macro(a))
#if defined(index)
-#undef index
+# undef index
#endif
-#define loc cur_input.loc_field /* location of first unread character in |buffer| */
-#define state cur_input.state_field /* current scanner state */
-#define index cur_input.index_field /* reference for buffer information */
-#define start cur_input.start_field /* starting position in |buffer| */
-#define limit cur_input.limit_field /* end of current line in |buffer| */
-#define nofilter cur_input.nofilter_field /* is token filtering explicitly disallowed? */
-#define name cur_input.name_field /* name of the current file */
-#define current_ocp_lstack cur_input.ocp_lstack_field /* name of the current ocp */
-#define current_ocp_no cur_input.ocp_no_field /* name of the current ocp */
-
-#define max_char_code 15 /* largest catcode for individual characters */
+#define loc cur_input.loc_field /* location of first unread character in |buffer| */
+#define state cur_input.state_field /* current scanner state */
+#define index cur_input.index_field /* reference for buffer information */
+#define start cur_input.start_field /* starting position in |buffer| */
+#define limit cur_input.limit_field /* end of current line in |buffer| */
+#define nofilter cur_input.nofilter_field /* is token filtering explicitly disallowed? */
+#define name cur_input.name_field /* name of the current file */
+#define current_ocp_lstack cur_input.ocp_lstack_field /* name of the current ocp */
+#define current_ocp_no cur_input.ocp_no_field /* name of the current ocp */
+#define line_catcode_table cur_input.cattable_field /* catcode table to use for this line */
+#define line_partial cur_input.partial_field
-typedef enum {
- mid_line=1, /* |state| code when scanning a line of characters */
- skip_blanks=2+max_char_code, /* |state| code when ignoring blanks */
- new_line=3+max_char_code+max_char_code, /* |state| code at start of line */
-} state_codes ;
+#define max_char_code 15 /* largest catcode for individual characters */
-
-extern void make_token_table (lua_State *L, int cmd, int chr, int cs);
+typedef enum {
+ mid_line = 1, /* |state| code when scanning a line of characters */
+ skip_blanks = 2 + max_char_code, /* |state| code when ignoring blanks */
+ new_line = 3 + max_char_code + max_char_code, /* |state| code at start of line */
+} state_codes;
+extern void make_token_table(lua_State * L, int cmd, int chr, int cs);
diff --git a/Build/source/texk/web2c/luatexdir/ttf2afm.c b/Build/source/texk/web2c/luatexdir/ttf2afm.c
deleted file mode 100644
index 45524e658fa..00000000000
--- a/Build/source/texk/web2c/luatexdir/ttf2afm.c
+++ /dev/null
@@ -1,1053 +0,0 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
-
-This file is part of pdfTeX.
-
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id$
-*/
-
-/*
-#include <kpathsea/c-auto.h>
-#include <kpathsea/c-fopen.h>
-#include <kpathsea/c-limits.h>
-#include <kpathsea/c-memstr.h>
-#include <kpathsea/c-proto.h>
-#include <kpathsea/c-std.h>
-#include <kpathsea/c-unistd.h>
-#include <kpathsea/c-vararg.h>
-#include <kpathsea/getopt.h>
-*/
-#include <kpathsea/kpathsea.h>
-#include <time.h>
-#include <libgen.h>
-#include <pdftexdir/ptexmac.h>
-#include <pdftexdir/writettf.h>
-#include <string.h>
-
-/* constants used for print_glyph */
-#define AS_NAME 0
-#define AS_INDEX 1
-#define AS_UNICODE 2
-
-#define VERSION "1.02"
-
-/* FIXME */
-#define NOGLYPH_ASSIGNED_YET USHRT_MAX
-
-#define enc_getchar() xgetc(encfile)
-#define enc_eof() feof(encfile)
-#define pdftex_fail ttf_fail
-
-#define print_str(S) if (S != NULL) fprintf(outfile, #S " %s\n", S)
-#define print_dimen(N) if (N != 0) fprintf(outfile, #N " %i\n", (int)get_ttf_funit(N))
-
-#define get_ttf_funit(n) \
- (n < 0 ? -((-n/upem)*1000 + ((-n%upem)*1000)/upem) :\
- ((n/upem)*1000 + ((n%upem)*1000)/upem))
-
-typedef struct _unicode_entry {
- TTF_USHORT code;
- struct _unicode_entry *next;
-} unicode_entry;
-
-typedef struct {
- TTF_ULONG wx;
- const char *name;
- TTF_USHORT index;
- TTF_LONG bbox[4];
- TTF_LONG offset;
- char found;
- unicode_entry *unicode_list;
-} mtx_entry;
-
-typedef struct _kern_entry {
- TTF_FWORD value;
- TTF_USHORT adjacent;
- struct _kern_entry *next;
-} kern_entry;
-
-
-char *FontName = NULL;
-char *FullName = NULL;
-char *FamilyName = NULL;
-char *Notice = NULL;
-char *Version = NULL;
-char *Weight = NULL;
-TTF_LONG ItalicAngle = 0;
-TTF_LONG IsFixedPitch = 0;
-TTF_LONG FontBBox1 = 0;
-TTF_LONG FontBBox2 = 0;
-TTF_LONG FontBBox3 = 0;
-TTF_LONG FontBBox4 = 0;
-TTF_LONG UnderlinePosition = 0;
-TTF_LONG UnderlineThickness = 0;
-TTF_LONG CapHeight = 0;
-TTF_LONG XHeight = 0;
-TTF_LONG Ascender = 0;
-TTF_LONG Descender = 0;
-
-char *cur_file_name = NULL;
-char *bname = NULL;
-FILE *fontfile, *encfile, *outfile = NULL;
-char enc_line[ENC_BUF_SIZE];
-int print_glyph = AS_NAME; /* print glyph as names by default */
-int print_cmap = 0;
-int use_ext_enc = 0; /* use external encoding? */
-int select_unicode = 1; /* use the first unicode mapping by default */
-int printing_enc = 0; /* set to 1 while printing encodings */
-
-
-TTF_USHORT upem;
-TTF_USHORT ntabs;
-int nhmtx;
-int post_format;
-int loca_format;
-int nglyphs;
-int nkernpairs = 0;
-int names_count = 0;
-char *ps_glyphs_buf = NULL;
-dirtab_entry *dir_tab;
-mtx_entry *mtx_tab;
-kern_entry *kern_tab;
-char *enc_names[256];
-
-cmap_entry *cmap_tab;
-TTF_USHORT ncmapsubtabs;
-long cmap_offset;
-
-TTF_USHORT unicode_map[0xFFFF];
-
-#include "macnames.c"
-
-void ttf_fail(char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- fprintf(stderr, "\nError: ttf2afm");
- if (cur_file_name)
- fprintf(stderr, " (file %s)", cur_file_name);
- fprintf(stderr, ": ");
- vfprintf(stderr, fmt, args);
- fprintf(stderr, "\n");
- va_end(args);
- exit(-1);
-}
-
-void ttf_warn(char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- fprintf(stderr, "\nWarning: ttf2afm");
- if (cur_file_name)
- fprintf(stderr, " (file %s)", cur_file_name);
- fprintf(stderr, ": ");
- vfprintf(stderr, fmt, args);
- fprintf(stderr, "\n");
- va_end(args);
-}
-
-int xgetc(FILE * stream)
-{
- int c = getc(stream);
- if (c < 0 && c != EOF)
- ttf_fail("getc() failed");
- return c;
-}
-
-long ttf_getnum(int s)
-{
- long i = 0;
- int c;
- while (s > 0) {
- if ((c = xgetc(fontfile)) < 0)
- ttf_fail("unexpected EOF");
- i = (i << 8) + c;
- s--;
- }
- return i;
-}
-
-dirtab_entry *name_lookup(char *s)
-{
- dirtab_entry *p;
- for (p = dir_tab; p - dir_tab < ntabs; p++)
- if (strncmp(p->tag, s, 4) == 0)
- break;
- if (p - dir_tab == ntabs)
- p = NULL;
- return p;
-}
-
-void ttf_seek_tab(char *name, TTF_LONG offset)
-{
- dirtab_entry *p = name_lookup(name);
- if (p == NULL)
- ttf_fail("can't find table `%s'", name);
- if (fseek(fontfile, p->offset + offset, SEEK_SET) < 0)
- ttf_fail("fseek() failed while reading `%s' table", name);
-}
-
-void ttf_seek_off(char *name, TTF_LONG offset)
-{
- if (fseek(fontfile, offset, SEEK_SET) < 0)
- ttf_fail("fseek() failed while reading `%s' table", name);
-}
-
-void store_kern_value(TTF_USHORT i, TTF_USHORT j, TTF_FWORD v)
-{
- kern_entry *pk;
- for (pk = kern_tab + i; pk->next != NULL; pk = pk->next);
- pk->next = xtalloc(1, kern_entry);
- pk = pk->next;
- pk->next = NULL;
- pk->adjacent = j;
- pk->value = v;
-}
-
-TTF_FWORD get_kern_value(TTF_USHORT i, TTF_USHORT j)
-{
- kern_entry *pk;
- for (pk = kern_tab + i; pk->next != NULL; pk = pk->next)
- if (pk->adjacent == j)
- return pk->value;
- return 0;
-}
-
-void free_tabs()
-{
- int i;
- kern_entry *p, *q, *r;
- unicode_entry *u, *v;
- mtx_entry *pm;
- xfree(ps_glyphs_buf);
- xfree(dir_tab);
- xfree(cmap_tab);
- for (pm = mtx_tab; pm - mtx_tab < nglyphs; pm++)
- if (pm->unicode_list != NULL) {
- for (u = pm->unicode_list; u != NULL; u = v) {
- v = u->next;
- xfree(u);
- }
- }
- xfree(mtx_tab);
- for (i = 0; i < 256; i++)
- if (enc_names[i] != notdef)
- free(enc_names[i]);
- if (kern_tab == NULL)
- return;
- for (p = kern_tab; p - kern_tab < nglyphs; p++)
- if (p->next != NULL) {
- for (q = p->next; q != NULL; q = r) {
- r = q->next;
- xfree(q);
- }
- }
- xfree(kern_tab);
-}
-
-void enc_getline()
-{
- char *p;
- int c;
- restart:
- if (enc_eof())
- ttf_fail("unexpected end of file");
- p = enc_line;
- do {
- c = enc_getchar();
- append_char_to_buf(c, p, enc_line, ENC_BUF_SIZE);
- } while (c != 10);
- append_eol(p, enc_line, ENC_BUF_SIZE);
- if (p - enc_line <= 2 || *enc_line == '%')
- goto restart;
-}
-
-void read_encoding(char *encname)
-{
- char buf[ENC_BUF_SIZE], *q, *r;
- int i;
- cur_file_name = encname;
- if ((encfile = kpse_open_file(encname, kpse_enc_format)) == NULL)
- ttf_fail("can't open encoding file for reading");
- enc_getline();
- if (*enc_line != '/' || (r = strchr(enc_line, '[')) == 0)
- ttf_fail("invalid encoding vector: name or `[' missing:\n%s", enc_line);
- for (i = 0; i < 256; i++)
- enc_names[i] = (char *) notdef;
- if (r[1] == 32)
- r += 2;
- else
- r++;
- for (;;) {
- while (*r == '/') {
- for (q = buf, r++; *r != ' ' && *r != 10 && *r != ']' && *r != '/';
- *q++ = *r++);
- *q = 0;
- if (*r == ' ')
- r++;
- if (strcmp(buf, notdef) != 0)
- enc_names[names_count] = xstrdup(buf);
- if (++names_count > 256)
- ttf_fail("encoding vector contains more than 256 names");
- }
- if (*r != 10 && *r != '%') {
- if (str_prefix(r, "] def"))
- goto done;
- else
- ttf_fail
- ("invalid encoding vector: a name or `] def' expected:\n%s",
- enc_line);
- }
- enc_getline();
- r = enc_line;
- }
- done:
- xfclose(encfile, cur_file_name);
- if (names_count != 256)
- ttf_warn("encoding vector contains only %i names (expected %i)",
- names_count, 256);
-}
-
-void append_unicode(long glyph_index, TTF_USHORT code)
-{
- mtx_entry *m;
- unicode_entry *u, *v;
- assert(glyph_index >= 0 && glyph_index < nglyphs);
- u = xtalloc(1, unicode_entry);
- m = mtx_tab + glyph_index;
- u->next = NULL;
- u->code = code;
- if (m->unicode_list == NULL)
- m->unicode_list = u;
- else {
- for (v = m->unicode_list; v->next != NULL; v = v->next);
- v->next = u;
- }
-}
-
-void read_cmap()
-{
- cmap_entry *e;
- seg_entry *seg_tab, *s;
- TTF_USHORT *glyphId, format, segCount;
- long int n, i, k, length, index;
- int unicode_map_count = 0;
- ttf_seek_tab("cmap", TTF_USHORT_SIZE); /* skip the table vesrion number (=0) */
- ncmapsubtabs = get_ushort();
- cmap_offset = xftell(fontfile, cur_file_name) - 2 * TTF_USHORT_SIZE;
- cmap_tab = xtalloc(ncmapsubtabs, cmap_entry);
- for (e = cmap_tab; e - cmap_tab < ncmapsubtabs; e++) {
- e->platform_id = get_ushort();
- e->encoding_id = get_ushort();
- e->offset = get_ulong();
- }
- for (i = 0; i < 0xFFFF; ++i)
- unicode_map[i] = NOGLYPH_ASSIGNED_YET;
- for (e = cmap_tab; e - cmap_tab < ncmapsubtabs; e++) {
- ttf_seek_off("cmap", cmap_offset + e->offset);
- format = get_ushort();
- if (is_unicode_mapping(e) && format == 4) {
- ++unicode_map_count;
- if (unicode_map_count == select_unicode)
- goto read_unicode_mapping;
- }
- continue;
- read_unicode_mapping:
- length = get_ushort(); /* length of subtable */
- (void) get_ushort(); /* skip the version number */
- segCount = get_ushort() / 2;
- (void) get_ushort(); /* skip searchRange */
- (void) get_ushort(); /* skip entrySelector */
- (void) get_ushort(); /* skip rangeShift */
- seg_tab = xtalloc(segCount, seg_entry);
- for (s = seg_tab; s - seg_tab < segCount; s++)
- s->endCode = get_ushort();
- (void) get_ushort(); /* skip reversedPad */
- for (s = seg_tab; s - seg_tab < segCount; s++)
- s->startCode = get_ushort();
- for (s = seg_tab; s - seg_tab < segCount; s++)
- s->idDelta = get_ushort();
- for (s = seg_tab; s - seg_tab < segCount; s++)
- s->idRangeOffset = get_ushort();
- length -= 8 * TTF_USHORT_SIZE + 4 * segCount * TTF_USHORT_SIZE;
- n = length / TTF_USHORT_SIZE; /* number of glyphID's */
- glyphId = xtalloc(n, TTF_USHORT);
- for (i = 0; i < n; i++)
- glyphId[i] = get_ushort();
- for (s = seg_tab; s - seg_tab < segCount; s++) {
- for (i = s->startCode; i <= s->endCode; i++) {
- if (i == 0xFFFF)
- break;
- if (s->idRangeOffset != 0xFFFF) {
- if (s->idRangeOffset == 0)
- index = (s->idDelta + i) & 0xFFFF;
- else {
- k = (i - s->startCode) + s->idRangeOffset / 2 +
- (s - seg_tab) - segCount;
- assert(k >= 0 && k < n);
- index = glyphId[k];
- if (index != 0)
- index = (index + s->idDelta) & 0xFFFF;
- }
- if (index < 0 || index >= nglyphs)
- ttf_fail("cmap: glyph index out of range [0..%i)",
- nglyphs);
- if (unicode_map[i] != NOGLYPH_ASSIGNED_YET)
- ttf_fail
- ("cmap: unicode %.4X is mapped to multiple glyphs",
- i);
- if (unicode_map[i] == 0)
- ttf_warn("unicode %.4X is mapped to glyph 0", i);
- unicode_map[i] = index;
- append_unicode(index, i);
- }
- }
- }
- xfree(seg_tab);
- xfree(glyphId);
- break;
- }
- if (e - cmap_tab == ncmapsubtabs)
- ttf_fail("Invalid argument `-m %i': out of range [1..%i]",
- select_unicode, unicode_map_count);
-}
-
-void read_font()
-{
- long i, j, k, l, n, m, platform_id, encoding_id;
- TTF_FWORD kern_value;
- char buf[1024], *p;
- dirtab_entry *pd;
- kern_entry *pk;
- mtx_entry *pm;
- ttf_skip(TTF_FIXED_SIZE);
- ntabs = get_ushort();
- ttf_skip(3 * TTF_USHORT_SIZE);
- dir_tab = xtalloc(ntabs, dirtab_entry);
- for (pd = dir_tab; pd - dir_tab < ntabs; pd++) {
- pd->tag[0] = get_char();
- pd->tag[1] = get_char();
- pd->tag[2] = get_char();
- pd->tag[3] = get_char();
- ttf_skip(TTF_ULONG_SIZE);
- pd->offset = get_ulong();
- pd->length = get_ulong();
- }
- ttf_seek_tab("head",
- 2 * TTF_FIXED_SIZE + 2 * TTF_ULONG_SIZE + TTF_USHORT_SIZE);
- upem = get_ushort();
- ttf_skip(16);
- FontBBox1 = get_fword();
- FontBBox2 = get_fword();
- FontBBox3 = get_fword();
- FontBBox4 = get_fword();
- ttf_skip(TTF_USHORT_SIZE);
- ttf_skip(TTF_USHORT_SIZE + TTF_SHORT_SIZE);
- loca_format = get_short();
- ttf_seek_tab("maxp", TTF_FIXED_SIZE);
- nglyphs = get_ushort();
- mtx_tab = xtalloc(nglyphs + 1, mtx_entry);
- for (pm = mtx_tab; pm - mtx_tab < nglyphs + 1; pm++) {
- pm->name = NULL; /* notdef */
- pm->found = 0;
- pm->unicode_list = NULL;
- }
- ttf_seek_tab("hhea", TTF_FIXED_SIZE);
- Ascender = get_fword();
- Descender = get_fword();
- ttf_skip(TTF_FWORD_SIZE + TTF_UFWORD_SIZE + 3 * TTF_FWORD_SIZE +
- 8 * TTF_SHORT_SIZE);
- nhmtx = get_ushort();
- ttf_seek_tab("hmtx", 0);
- for (pm = mtx_tab; pm - mtx_tab < nhmtx; pm++) {
- pm->wx = get_ufword();
- ttf_skip(TTF_FWORD_SIZE);
- }
- i = pm[-1].wx;
- for (; pm - mtx_tab < nglyphs; pm++)
- pm->wx = i;
- ttf_seek_tab("post", 0);
- post_format = get_fixed();
- ItalicAngle = get_fixed();
- UnderlinePosition = get_fword();
- UnderlineThickness = get_fword();
- IsFixedPitch = get_ulong();
- ttf_skip(4 * TTF_ULONG_SIZE);
- switch (post_format) {
- case 0x00010000:
- for (pm = mtx_tab; pm - mtx_tab < NMACGLYPHS; pm++)
- pm->name = (char *) mac_glyph_names[pm - mtx_tab];
- break;
- case 0x00020000:
- l = get_ushort(); /* some fonts have this value different from nglyphs */
- for (pm = mtx_tab; pm - mtx_tab < l; pm++)
- pm->index = get_ushort();
- if ((pd = name_lookup("post")) == NULL)
- ttf_fail("can't find table `post'");
- n = pd->length - (xftell(fontfile, cur_file_name) - pd->offset);
- ps_glyphs_buf = xtalloc(n + 1, char);
- for (m = 0, p = ps_glyphs_buf; p - ps_glyphs_buf < n;) {
- for (i = get_byte(); i > 0; i--)
- *p++ = get_char();
- *p++ = 0;
- m++;
- }
- for (pm = mtx_tab; pm - mtx_tab < l; pm++) {
- if (pm->index < NMACGLYPHS)
- pm->name = (char *) mac_glyph_names[pm->index];
- else {
- k = pm->index - NMACGLYPHS;
- if (k < m) {
- for (p = ps_glyphs_buf; k > 0; k--)
- p = (char *) strend(p) + 1;
- pm->name = p;
- } else {
- pm->name = NULL; /* index out of valid range, fix name to notdef */
- }
- }
- }
- break;
- case 0x00030000:
- if (print_glyph == AS_NAME) {
- ttf_warn
- ("no names available in `post' table, print glyph names as indices");
- print_glyph = AS_INDEX;
- }
- break;
- default:
- ttf_fail("unsupported format (%.8X) of `post' table", post_format);
- }
- ttf_seek_tab("loca", 0);
- for (pm = mtx_tab; pm - mtx_tab < nglyphs + 1; pm++)
- pm->offset = (loca_format == 1 ? get_ulong() : get_ushort() << 1);
- if ((pd = name_lookup("glyf")) == NULL)
- ttf_fail("can't find table `glyf'");
- for (n = pd->offset, pm = mtx_tab; pm - mtx_tab < nglyphs; pm++) {
- ttf_seek_off("glyf", n + pm->offset);
- ttf_skip(TTF_SHORT_SIZE);
- pm->bbox[0] = get_fword();
- pm->bbox[1] = get_fword();
- pm->bbox[2] = get_fword();
- pm->bbox[3] = get_fword();
- }
-
- ttf_seek_tab("name", 0);
- i = ftell(fontfile);
- (void) get_ushort(); /* skip Format selector (=0) */
- n = get_ushort(); /* number of name records */
- j = get_ushort() + i; /* start of string storage */
- i += 3 * TTF_USHORT_SIZE; /* update the current offset */
- while (n-- > 0) {
- ttf_seek_off("name", i);
- platform_id = get_ushort();
- encoding_id = get_ushort();
- (void) get_ushort(); /* skip language_id */
- k = get_ushort(); /* name_id */
- l = get_ushort(); /* string length */
- if ((platform_id == 1 && encoding_id == 0) &&
- (k == 0 || k == 1 || k == 4 || k == 5 || k == 6)) {
- ttf_seek_off("name", j + get_ushort());
- for (p = buf; l-- > 0; p++)
- *p = get_char();
- *p++ = 0;
- p = xstrdup(buf);
- switch (k) {
- case 0:
- Notice = p;
- break;
- case 1:
- FamilyName = p;
- break;
- case 4:
- FullName = p;
- break;
- case 5:
- Version = p;
- break;
- case 6:
- FontName = p;
- break;
- }
- if (Notice != NULL && FamilyName != NULL &&
- FullName != NULL && FontName != NULL && Version != NULL)
- break;
- }
- i += 6 * TTF_USHORT_SIZE;
- }
- if ((pd = name_lookup("PCLT")) != NULL) {
- ttf_seek_off("PCLT",
- pd->offset + TTF_FIXED_SIZE + TTF_ULONG_SIZE +
- TTF_USHORT_SIZE);
- XHeight = get_ushort();
- if (XHeight > FontBBox4) {
- ttf_warn("XHeight is too big (%i)\n"
- "This is likely a font bug, so I discarded this parameter.",
- (int) get_ttf_funit(XHeight));
- XHeight = 0;
- }
- ttf_skip(2 * TTF_USHORT_SIZE);
- CapHeight = get_ushort();
- if (CapHeight > FontBBox4) {
- ttf_warn("CapHeight is too big (%i)\n"
- "This is likely a font bug, so I discarded this parameter.",
- (int) get_ttf_funit(CapHeight));
- CapHeight = 0;
- }
- }
- if ((pd = name_lookup("OS/2")) != NULL) {
- ttf_seek_off("OS/2", pd->offset + TTF_USHORT_SIZE + TTF_SHORT_SIZE);
- switch (get_ushort()) {
- case 100:
- Weight = xstrdup("Thin");
- break;
- case 200:
- Weight = xstrdup("ExtraLight");
- break;
- case 300:
- Weight = xstrdup("Light");
- break;
- case 400:
- Weight = xstrdup("Normal");
- break;
- case 500:
- Weight = xstrdup("Medium");
- break;
- case 600:
- Weight = xstrdup("SemiBold");
- break;
- case 700:
- Weight = xstrdup("Bold");
- break;
- case 800:
- Weight = xstrdup("ExtraBold");
- break;
- case 900:
- Weight = xstrdup("Black");
- break;
- }
- }
- read_cmap();
- if ((pd = name_lookup("kern")) == NULL)
- return;
- kern_tab = xtalloc(nglyphs, kern_entry);
- for (pk = kern_tab; pk - kern_tab < nglyphs; pk++) {
- pk->next = NULL;
- pk->value = 0;
- }
- ttf_seek_off("kern", pd->offset + TTF_USHORT_SIZE);
- for (n = get_ushort(); n > 0; n--) {
- ttf_skip(2 * TTF_USHORT_SIZE);
- k = get_ushort();
- if (!(k & 1) || (k & 2) || (k & 4))
- return;
- if (k >> 8 != 0) {
- ttf_warn("warning: only format 0 supported of `kern' \
- subtables, others are ignored\n");
- continue;
- }
- k = get_ushort();
- ttf_skip(3 * TTF_USHORT_SIZE);
- while (k-- > 0) {
- i = get_ushort();
- j = get_ushort();
- kern_value = get_fword();
- if (kern_value != 0) {
- store_kern_value(i, j, kern_value);
- nkernpairs++;
- }
- }
- }
-}
-
-int null_glyph(const char *s)
-{
- return (s == NULL || s == notdef);
- /*
- strcmp(s, ".null") == 0 ||
- strcmp(s, ".notdef") == 0 ||
- strcmp(s, "CR") == 0 ||
- strcmp(s, "nonmarkingreturn") == 0
- */
-}
-
-void print_glyph_name(FILE * f, long glyph_index, int convention)
-{
- unicode_entry *u;
- static char buf[1024];
- const char *n;
- assert(glyph_index >= 0 && glyph_index < nglyphs);
- n = mtx_tab[glyph_index].name;
- if (printing_enc && (n == notdef || glyph_index == 0)) {
- fputs(notdef, f);
- return;
- }
- switch (convention) {
- case AS_NAME:
- if (!null_glyph(n))
- fprintf(f, "%s", mtx_tab[glyph_index].name);
- else if (n == notdef && glyph_index == 0)
- fputs(notdef, f);
- else
- fprintf(f, "%s%li", GLYPH_PREFIX_INDEX, glyph_index);
- break;
- case AS_INDEX:
- fprintf(f, "%s%li", GLYPH_PREFIX_INDEX, glyph_index);
- break;
- case AS_UNICODE:
- u = mtx_tab[glyph_index].unicode_list;
- if (glyph_index == 0 || u == NULL)
- fprintf(f, "%s%li", GLYPH_PREFIX_INDEX, glyph_index);
- else {
- fprintf(f, "%s%.4X", GLYPH_PREFIX_UNICODE, u->code);
- if (u->next != NULL) {
- *buf = 0;
- for (; u != NULL; u = u->next) {
- assert(strlen(buf) + strlen(GLYPH_PREFIX_UNICODE) + 4 <
- sizeof(buf));
- sprintf(strend(buf), "%s%.4X ", GLYPH_PREFIX_UNICODE,
- u->code);
- }
- ttf_warn
- ("glyph %li have multiple encodings (the first one being used): %s",
- glyph_index, buf);
- }
- }
- break;
- }
-}
-
-void print_char_metric(FILE * f, int charcode, long glyph_index)
-{
- assert(glyph_index >= 0 && glyph_index < nglyphs);
- fprintf(f, "C %i ; WX %i ; N ", (int) charcode,
- (int) get_ttf_funit(mtx_tab[glyph_index].wx));
- print_glyph_name(f, glyph_index, print_glyph);
- fprintf(f, " ; B %i %i %i %i ;\n",
- (int) get_ttf_funit(mtx_tab[glyph_index].bbox[0]),
- (int) get_ttf_funit(mtx_tab[glyph_index].bbox[1]),
- (int) get_ttf_funit(mtx_tab[glyph_index].bbox[2]),
- (int) get_ttf_funit(mtx_tab[glyph_index].bbox[3]));
-}
-
-void print_afm(char *date, char *fontname)
-{
- int ncharmetrics;
- mtx_entry *pm;
- short mtx_index[256], *idx;
- unsigned int index;
- char **pe;
- kern_entry *pk, *qk;
- fputs("StartFontMetrics 2.0\n", outfile);
- fprintf(outfile,
- "Comment Converted at %s by ttf2afm from font file `%s'\n", date,
- fontname);
- print_str(FontName);
- print_str(FullName);
- print_str(FamilyName);
- print_str(Weight);
- fprintf(outfile, "ItalicAngle %i", (int) (ItalicAngle / 0x10000));
- if (ItalicAngle % 0x10000 > 0)
- fprintf(outfile, ".%i",
- (int) ((ItalicAngle % 0x10000) * 1000) / 0x10000);
- fputs("\n", outfile);
- fprintf(outfile, "IsFixedPitch %s\n", IsFixedPitch ? "true" : "false");
- fprintf(outfile, "FontBBox %i %i %i %i\n",
- (int) get_ttf_funit(FontBBox1),
- (int) get_ttf_funit(FontBBox2),
- (int) get_ttf_funit(FontBBox3), (int) get_ttf_funit(FontBBox4));
- print_dimen(UnderlinePosition);
- print_dimen(UnderlineThickness);
- print_str(Version);
- print_str(Notice);
- fputs("EncodingScheme FontSpecific\n", outfile);
- print_dimen(CapHeight);
- print_dimen(XHeight);
- print_dimen(Ascender);
- print_dimen(Descender);
- ncharmetrics = nglyphs;
- if (use_ext_enc == 0) { /* external encoding vector not given */
- fprintf(outfile, "StartCharMetrics %u\n", ncharmetrics);
- for (pm = mtx_tab; pm - mtx_tab < nglyphs; pm++) {
- pm->found = 1;
- print_char_metric(outfile, -1, pm - mtx_tab);
- }
- } else { /* external encoding vector given */
- for (idx = mtx_index; idx - mtx_index < 256; *idx++ = 0);
- for (pe = enc_names; pe - enc_names < names_count; pe++) {
- if (*pe == notdef)
- continue;
- /* scan form `uniABCD' */
- if (sscanf(*pe, GLYPH_PREFIX_UNICODE "%4X", &index) == 1) {
- if (unicode_map[index] != NOGLYPH_ASSIGNED_YET) {
- pm = mtx_tab + unicode_map[index];
- mtx_index[pe - enc_names] = pm - mtx_tab;
- pm->found = 1;
- } else
- ttf_warn("`unicode %s%.4X' is not mapped to any glyph",
- GLYPH_PREFIX_UNICODE, index);
- continue;
- }
- /* scan form `index123' */
- if (sscanf(*pe, GLYPH_PREFIX_INDEX "%u", &index) == 1) {
- if (index >= nglyphs)
- ttf_fail("`%s' out of valid range [0..%i)", *pe, nglyphs);
- pm = mtx_tab + index;
- mtx_index[pe - enc_names] = pm - mtx_tab;
- pm->found = 1;
- continue;
- }
- for (pm = mtx_tab; pm - mtx_tab < nglyphs; pm++)
- if (pm->name != NULL && strcmp(*pe, pm->name) == 0)
- break;
- if (pm - mtx_tab < nglyphs) {
- mtx_index[pe - enc_names] = pm - mtx_tab;
- pm->found = 1;
- continue;
- } else
- ttf_warn("glyph `%s' not found", *pe);
- }
- fprintf(outfile, "StartCharMetrics %u\n", ncharmetrics);
- for (idx = mtx_index; idx - mtx_index < 256; idx++) {
- if (*idx != 0 && mtx_tab[*idx].found == 1)
- print_char_metric(outfile, idx - mtx_index, *idx);
- }
- for (pm = mtx_tab; pm - mtx_tab < nglyphs; pm++) {
- if (pm->found == 0)
- print_char_metric(outfile, -1, pm - mtx_tab);
- }
- }
- fputs("EndCharMetrics\n", outfile);
- if (nkernpairs == 0)
- goto end_kerns;
- fprintf(outfile, "StartKernData\nStartKernPairs %i\n", nkernpairs);
- for (pk = kern_tab; pk - kern_tab < nglyphs; pk++)
- for (qk = pk; qk != NULL; qk = qk->next)
- if (qk->value != 0) {
- fputs("KPX ", outfile);
- print_glyph_name(outfile, pk - kern_tab, print_glyph);
- fputs(" ", outfile);
- print_glyph_name(outfile, qk->adjacent, print_glyph);
- fprintf(outfile, " %i\n", get_ttf_funit(qk->value));
- }
- fputs("EndKernPairs\nEndKernData\n", outfile);
- end_kerns:
- fputs("EndFontMetrics\n", outfile);
-}
-
-void print_encoding(char *fontname)
-{
- long int i, k, first_code, length;
- FILE *file;
- TTF_USHORT format;
- char *enc_name, *end_enc_name;
- cmap_entry *e;
- printing_enc = 1;
- enc_name = xtalloc(strlen(bname) + 20, char);
- strcpy(enc_name, bname);
- end_enc_name = strend(enc_name);
- for (e = cmap_tab; e - cmap_tab < ncmapsubtabs; e++) {
- ttf_seek_off("cmap", cmap_offset + e->offset);
- format = get_ushort();
- if (format != 0 && format != 4 && format != 6) {
- ttf_warn("format %i of encoding subtable unsupported",
- (int) format);
- continue;
- }
- sprintf(end_enc_name, ".e%i%i",
- (int) e->platform_id, (int) e->encoding_id);
- if ((file = xfopen(enc_name, FOPEN_W_MODE)) == NULL)
- ttf_fail("cannot open file for writing (%s)\n", enc_name);
- fprintf(file, "%% Encoding table from font file %s\n", fontname);
- fprintf(file, "%% Platform ID %i", (int) e->platform_id);
- switch (e->platform_id) {
- case 0:
- fprintf(file, " (Apple Unicode)");
- break;
- case 1:
- fprintf(file, " (Macintosh)");
- break;
- case 2:
- fprintf(file, " (ISO)");
- break;
- case 3:
- fprintf(file, " (Microsoft)");
- break;
- }
- fprintf(file, "\n");
- fprintf(file, "%% Encoding ID %i", (int) e->encoding_id);
- if (e->platform_id == 1 && e->encoding_id == 0)
- fprintf(file, " (Roman)");
- if (e->platform_id == 3)
- switch (e->encoding_id) {
- case 0:
- fprintf(file, " (Symbol)");
- break;
- case 1:
- fprintf(file, " (Unicode)");
- break;
- }
- fprintf(file, "\n");
- fprintf(file, "%% Format %i", (int) (format));
- switch (format) {
- case 0:
- fprintf(file, " (byte encoding table)");
- break;
- case 4:
- fprintf(file, " (segment mapping to delta values)");
- break;
- case 6:
- fprintf(file, " (trimmed table mapping)");
- break;
- }
- fprintf(file, "\n");
- fprintf(file, "/Encoding%i [\n", (int) (e - cmap_tab + 1));
- switch (format) {
- case 0:
- (void) get_ushort(); /* skip length */
- (void) get_ushort(); /* skip version number */
- for (i = 0; i < 256; i++) {
- fputs("/", file);
- print_glyph_name(file, get_byte(), print_glyph);
- fputs("\n", file);
- }
- break;
- case 4:
- for (i = 0; i < nglyphs; ++i) {
- fprintf(file, "%% Glyph %li -> ", i);
- print_glyph_name(file, i, AS_UNICODE);
- fputs("\n", file);
- }
- break;
- case 6:
- (void) get_ushort(); /* skip table length */
- (void) get_ushort(); /* skip version number */
- first_code = get_ushort(); /* first character code */
- for (i = 0; i < first_code; ++i)
- fprintf(file, "/%s\n", notdef);
- length = get_ushort(); /* number of character codes */
- for (i = first_code; i < first_code + length; i++) {
- k = get_ushort();
- if (i > 255)
- fputs("% ", file);
- fputs("/", file);
- print_glyph_name(file, k, print_glyph);
- fputs("\n", file);
- }
- for (i = first_code + length; i < 256; i++)
- fprintf(file, "/%s\n", notdef);
- break;
- default:
- ttf_warn("format %i of encoding subtable unsupported",
- (int) format);
- }
- fprintf(file, "] def\n");
- }
- xfree(enc_name);
-}
-
-void usage()
-{
- cur_file_name = NULL;
- fprintf(stderr,
- "Usage: ttf2afm [-i|-u|-c|-v] [-e enc] [-o filename] [-m NUM] fontfile\n"
- " -i: force printing glyph names in form 'index123'\n"
- " -u: force printing glyph names in form 'uniABCD'\n"
- " -c: print encoding tables to `basename.e<platformID><encodingID>'\n"
- " -v: print version\n"
- " -e enc: encode the AFM output using encoding vector from `enc'\n"
- " -o filename: write output to file `filename' instead of stdout\n"
- " -m NUM: select unicode mapping (default = 1, ie the first)\n"
- " fontfile: the TrueType fontfile\n"
- "\nPlease send bug reports or feature requests to <pdftex@tug.org>\n");
- _exit(-1);
-}
-
-int main(int argc, char **argv)
-{
- char date[128], *s;
- time_t t = time(&t);
- int c;
- kpse_set_progname(argv[0]);
- kpse_init_prog("ttf2afm", 0, 0, 0);
- while ((c = getopt(argc, argv, "iucve:o:m:")) != -1)
- switch (c) {
- case 'i':
- print_glyph = AS_INDEX;
- break;
- case 'u':
- print_glyph = AS_UNICODE;
- break;
- case 'c':
- print_cmap = 1;
- break;
- case 'e':
- cur_file_name = optarg;
- read_encoding(cur_file_name);
- use_ext_enc = 1;
- break;
- case 'o':
- cur_file_name = optarg;
- outfile = xfopen(cur_file_name, FOPEN_W_MODE);
- if (outfile == NULL)
- ttf_fail("cannot open file for writing");
- break;
- case 'm':
- select_unicode = atoi(optarg);
- break;
- case 'v':
- fprintf(stderr,
- "ttf2afm version " VERSION "\n"
- "Copyright (C) 1997-2005 Han The Thanh.\n"
- "There is NO warranty. Redistribution of this software is\n"
- "covered by the terms of both the pdfTeX copyright and\n"
- "the GNU General Public License.\n"
- "For more information about these matters, see the files\n"
- "named COPYING and the pdfTeX source.\n"
- "Primary author of ttf2afm: Han The Thanh.\n");
- _exit(0);
- default:
- usage();
- }
- if (argc - optind != 1)
- usage();
- sprintf(date, "%s\n", ctime(&t));
- *(char *) strchr(date, '\n') = 0;
- cur_file_name = argv[optind];
- if (print_cmap) {
- bname = xstrdup(xbasename(cur_file_name));
- if ((s = strrchr(bname, '.')) != NULL)
- *s = 0;
- }
- if ((fontfile =
- kpse_open_file(cur_file_name, kpse_truetype_format)) == NULL)
- ttf_fail("can't open font file for reading");
- read_font();
- if (outfile == NULL)
- outfile = stdout;
- print_afm(date, cur_file_name);
- if (print_cmap)
- print_encoding(cur_file_name);
- xfree(FontName);
- xfree(FullName);
- xfree(FamilyName);
- xfree(Notice);
- xfree(Version);
- xfree(Weight);
- free_tabs();
- xfclose(fontfile, cur_file_name);
- return 0;
-}
diff --git a/Build/source/texk/web2c/luatexdir/ttf2afm.rc b/Build/source/texk/web2c/luatexdir/ttf2afm.rc
deleted file mode 100644
index a63881df7d1..00000000000
--- a/Build/source/texk/web2c/luatexdir/ttf2afm.rc
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ttf2afm.rc: ttf2afm -*- C++ -*-
-
- Copyright (C) 1996-2003 Fabrice Popineau <fabrice.popineau@supelec.fr>
-
- This file is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
- option) any later version.
-
- This file is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this file; if not, write to the Free Software
- Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#include <texlive-version.h>
-
-#define VER_FILEVERSION TEXLIVE_MAJOR_VERSION,TEXLIVE_MINOR_VERSION,TEXLIVE_BETA_NUMBER,TEXLIVE_ALPHA_NUMBER
-#define VER_FILEVERSION_STR TEXLIVE_PRODUCTVERSION_STR " ttf2afm 1.10a"
-
-#define VER_INTERNALNAME_STR "ttf2afm"
-#define VER_ORIGINALFILENAME_STR "ttf2afm.exe"
-
-#define VER_FILEDESCRIPTION_STR "TTF-to-AFM Converter"
-
-#define VER_COMPANYNAME_STR ""
-#define VER_LEGALCOPYRIGHT_STR "Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>"
-
-#include "texlive.version"
-
-/* ttf2afm.rc ends here */
diff --git a/Build/source/texk/web2c/luatexdir/utils/avl.c b/Build/source/texk/web2c/luatexdir/utils/avl.c
new file mode 100644
index 00000000000..79c746cd10d
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/utils/avl.c
@@ -0,0 +1,794 @@
+/* Produced by texiweb from libavl.w. */
+
+/* libavl - library for manipulation of binary trees.
+ Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The author may be contacted at <blp@gnu.org> on the Internet, or
+ write to Ben Pfaff, Stanford University, Computer Science Dept., 353
+ Serra Mall, Stanford CA 94305, USA.
+*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "avl.h"
+
+/* Creates and returns a new table
+ with comparison function |compare| using parameter |param|
+ and memory allocator |allocator|.
+ Returns |NULL| if memory allocation failed. */
+struct avl_table *avl_create(avl_comparison_func * compare, void *param,
+ struct libavl_allocator *allocator)
+{
+ struct avl_table *tree;
+
+ assert(compare != NULL);
+
+ if (allocator == NULL)
+ allocator = &avl_allocator_default;
+
+ tree = allocator->libavl_malloc(allocator, sizeof *tree);
+ if (tree == NULL)
+ return NULL;
+
+ tree->avl_root = NULL;
+ tree->avl_compare = compare;
+ tree->avl_param = param;
+ tree->avl_alloc = allocator;
+ tree->avl_count = 0;
+ tree->avl_generation = 0;
+
+ return tree;
+}
+
+/* Search |tree| for an item matching |item|, and return it if found.
+ Otherwise return |NULL|. */
+void *avl_find(const struct avl_table *tree, const void *item)
+{
+ const struct avl_node *p;
+
+ assert(tree != NULL && item != NULL);
+ for (p = tree->avl_root; p != NULL;) {
+ int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param);
+
+ if (cmp < 0)
+ p = p->avl_link[0];
+ else if (cmp > 0)
+ p = p->avl_link[1];
+ else /* |cmp == 0| */
+ return p->avl_data;
+ }
+
+ return NULL;
+}
+
+/* Inserts |item| into |tree| and returns a pointer to |item|'s address.
+ If a duplicate item is found in the tree,
+ returns a pointer to the duplicate without inserting |item|.
+ Returns |NULL| in case of memory allocation failure. */
+void **avl_probe(struct avl_table *tree, void *item)
+{
+ struct avl_node *y, *z; /* Top node to update balance factor, and parent. */
+ struct avl_node *p, *q; /* Iterator, and parent. */
+ struct avl_node *n; /* Newly inserted node. */
+ struct avl_node *w; /* New root of rebalanced subtree. */
+ int dir; /* Direction to descend. */
+
+ unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */
+ int k = 0; /* Number of cached results. */
+
+ assert(tree != NULL && item != NULL);
+
+ z = (struct avl_node *) &tree->avl_root;
+ y = tree->avl_root;
+ dir = 0;
+ for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir]) {
+ int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param);
+ if (cmp == 0)
+ return &p->avl_data;
+
+ if (p->avl_balance != 0)
+ z = q, y = p, k = 0;
+ da[k++] = dir = cmp > 0;
+ }
+
+ n = q->avl_link[dir] =
+ tree->avl_alloc->libavl_malloc(tree->avl_alloc, sizeof *n);
+ if (n == NULL)
+ return NULL;
+
+ tree->avl_count++;
+ n->avl_data = item;
+ n->avl_link[0] = n->avl_link[1] = NULL;
+ n->avl_balance = 0;
+ if (y == NULL)
+ return &n->avl_data;
+
+ for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++)
+ if (da[k] == 0)
+ p->avl_balance--;
+ else
+ p->avl_balance++;
+
+ if (y->avl_balance == -2) {
+ struct avl_node *x = y->avl_link[0];
+ if (x->avl_balance == -1) {
+ w = x;
+ y->avl_link[0] = x->avl_link[1];
+ x->avl_link[1] = y;
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ assert(x->avl_balance == +1);
+ w = x->avl_link[1];
+ x->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = x;
+ y->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = y;
+ if (w->avl_balance == -1)
+ x->avl_balance = 0, y->avl_balance = +1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == +1| */
+ x->avl_balance = -1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ }
+ } else if (y->avl_balance == +2) {
+ struct avl_node *x = y->avl_link[1];
+ if (x->avl_balance == +1) {
+ w = x;
+ y->avl_link[1] = x->avl_link[0];
+ x->avl_link[0] = y;
+ x->avl_balance = y->avl_balance = 0;
+ } else {
+ assert(x->avl_balance == -1);
+ w = x->avl_link[0];
+ x->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = x;
+ y->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = y;
+ if (w->avl_balance == +1)
+ x->avl_balance = 0, y->avl_balance = -1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == -1| */
+ x->avl_balance = +1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ }
+ } else
+ return &n->avl_data;
+ z->avl_link[y != z->avl_link[0]] = w;
+
+ tree->avl_generation++;
+ return &n->avl_data;
+}
+
+/* Inserts |item| into |table|.
+ Returns |NULL| if |item| was successfully inserted
+ or if a memory allocation error occurred.
+ Otherwise, returns the duplicate item. */
+void *avl_insert(struct avl_table *table, void *item)
+{
+ void **p = avl_probe(table, item);
+ return p == NULL || *p == item ? NULL : *p;
+}
+
+/* Inserts |item| into |table|, replacing any duplicate item.
+ Returns |NULL| if |item| was inserted without replacing a duplicate,
+ or if a memory allocation error occurred.
+ Otherwise, returns the item that was replaced. */
+void *avl_replace(struct avl_table *table, void *item)
+{
+ void **p = avl_probe(table, item);
+ if (p == NULL || *p == item)
+ return NULL;
+ else {
+ void *r = *p;
+ *p = item;
+ return r;
+ }
+}
+
+/* Deletes from |tree| and returns an item matching |item|.
+ Returns a null pointer if no matching item found. */
+void *avl_delete(struct avl_table *tree, const void *item)
+{
+ /* Stack of nodes. */
+ struct avl_node *pa[AVL_MAX_HEIGHT]; /* Nodes. */
+ unsigned char da[AVL_MAX_HEIGHT]; /* |avl_link[]| indexes. */
+ int k; /* Stack pointer. */
+
+ struct avl_node *p; /* Traverses tree to find node to delete. */
+ int cmp; /* Result of comparison between |item| and |p|. */
+
+ assert(tree != NULL && item != NULL);
+
+ k = 0;
+ p = (struct avl_node *) &tree->avl_root;
+ for (cmp = -1; cmp != 0;
+ cmp = tree->avl_compare(item, p->avl_data, tree->avl_param)) {
+ int dir = cmp > 0;
+
+ pa[k] = p;
+ da[k++] = dir;
+
+ p = p->avl_link[dir];
+ if (p == NULL)
+ return NULL;
+ }
+ item = p->avl_data;
+
+ if (p->avl_link[1] == NULL)
+ pa[k - 1]->avl_link[da[k - 1]] = p->avl_link[0];
+ else {
+ struct avl_node *r = p->avl_link[1];
+ if (r->avl_link[0] == NULL) {
+ r->avl_link[0] = p->avl_link[0];
+ r->avl_balance = p->avl_balance;
+ pa[k - 1]->avl_link[da[k - 1]] = r;
+ da[k] = 1;
+ pa[k++] = r;
+ } else {
+ struct avl_node *s;
+ int j = k++;
+
+ for (;;) {
+ da[k] = 0;
+ pa[k++] = r;
+ s = r->avl_link[0];
+ if (s->avl_link[0] == NULL)
+ break;
+
+ r = s;
+ }
+
+ s->avl_link[0] = p->avl_link[0];
+ r->avl_link[0] = s->avl_link[1];
+ s->avl_link[1] = p->avl_link[1];
+ s->avl_balance = p->avl_balance;
+
+ pa[j - 1]->avl_link[da[j - 1]] = s;
+ da[j] = 1;
+ pa[j] = s;
+ }
+ }
+
+ tree->avl_alloc->libavl_free(tree->avl_alloc, p);
+
+ assert(k > 0);
+ while (--k > 0) {
+ struct avl_node *y = pa[k];
+
+ if (da[k] == 0) {
+ y->avl_balance++;
+ if (y->avl_balance == +1)
+ break;
+ else if (y->avl_balance == +2) {
+ struct avl_node *x = y->avl_link[1];
+ if (x->avl_balance == -1) {
+ struct avl_node *w;
+ assert(x->avl_balance == -1);
+ w = x->avl_link[0];
+ x->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = x;
+ y->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = y;
+ if (w->avl_balance == +1)
+ x->avl_balance = 0, y->avl_balance = -1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == -1| */
+ x->avl_balance = +1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ pa[k - 1]->avl_link[da[k - 1]] = w;
+ } else {
+ y->avl_link[1] = x->avl_link[0];
+ x->avl_link[0] = y;
+ pa[k - 1]->avl_link[da[k - 1]] = x;
+ if (x->avl_balance == 0) {
+ x->avl_balance = -1;
+ y->avl_balance = +1;
+ break;
+ } else
+ x->avl_balance = y->avl_balance = 0;
+ }
+ }
+ } else {
+ y->avl_balance--;
+ if (y->avl_balance == -1)
+ break;
+ else if (y->avl_balance == -2) {
+ struct avl_node *x = y->avl_link[0];
+ if (x->avl_balance == +1) {
+ struct avl_node *w;
+ assert(x->avl_balance == +1);
+ w = x->avl_link[1];
+ x->avl_link[1] = w->avl_link[0];
+ w->avl_link[0] = x;
+ y->avl_link[0] = w->avl_link[1];
+ w->avl_link[1] = y;
+ if (w->avl_balance == -1)
+ x->avl_balance = 0, y->avl_balance = +1;
+ else if (w->avl_balance == 0)
+ x->avl_balance = y->avl_balance = 0;
+ else /* |w->avl_balance == +1| */
+ x->avl_balance = -1, y->avl_balance = 0;
+ w->avl_balance = 0;
+ pa[k - 1]->avl_link[da[k - 1]] = w;
+ } else {
+ y->avl_link[0] = x->avl_link[1];
+ x->avl_link[1] = y;
+ pa[k - 1]->avl_link[da[k - 1]] = x;
+ if (x->avl_balance == 0) {
+ x->avl_balance = +1;
+ y->avl_balance = -1;
+ break;
+ } else
+ x->avl_balance = y->avl_balance = 0;
+ }
+ }
+ }
+ }
+
+ tree->avl_count--;
+ tree->avl_generation++;
+ return (void *) item;
+}
+
+/* Refreshes the stack of parent pointers in |trav|
+ and updates its generation number. */
+static void trav_refresh(struct avl_traverser *trav)
+{
+ assert(trav != NULL);
+
+ trav->avl_generation = trav->avl_table->avl_generation;
+
+ if (trav->avl_node != NULL) {
+ avl_comparison_func *cmp = trav->avl_table->avl_compare;
+ void *param = trav->avl_table->avl_param;
+ struct avl_node *node = trav->avl_node;
+ struct avl_node *i;
+
+ trav->avl_height = 0;
+ for (i = trav->avl_table->avl_root; i != node;) {
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ assert(i != NULL);
+
+ trav->avl_stack[trav->avl_height++] = i;
+ i = i->avl_link[cmp(node->avl_data, i->avl_data, param) > 0];
+ }
+ }
+}
+
+/* Initializes |trav| for use with |tree|
+ and selects the null node. */
+void avl_t_init(struct avl_traverser *trav, struct avl_table *tree)
+{
+ trav->avl_table = tree;
+ trav->avl_node = NULL;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+}
+
+/* Initializes |trav| for |tree|
+ and selects and returns a pointer to its least-valued item.
+ Returns |NULL| if |tree| contains no nodes. */
+void *avl_t_first(struct avl_traverser *trav, struct avl_table *tree)
+{
+ struct avl_node *x;
+
+ assert(tree != NULL && trav != NULL);
+
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+
+ x = tree->avl_root;
+ if (x != NULL)
+ while (x->avl_link[0] != NULL) {
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+ }
+ trav->avl_node = x;
+
+ return x != NULL ? x->avl_data : NULL;
+}
+
+/* Initializes |trav| for |tree|
+ and selects and returns a pointer to its greatest-valued item.
+ Returns |NULL| if |tree| contains no nodes. */
+void *avl_t_last(struct avl_traverser *trav, struct avl_table *tree)
+{
+ struct avl_node *x;
+
+ assert(tree != NULL && trav != NULL);
+
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+
+ x = tree->avl_root;
+ if (x != NULL)
+ while (x->avl_link[1] != NULL) {
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+ }
+ trav->avl_node = x;
+
+ return x != NULL ? x->avl_data : NULL;
+}
+
+/* Searches for |item| in |tree|.
+ If found, initializes |trav| to the item found and returns the item
+ as well.
+ If there is no matching item, initializes |trav| to the null item
+ and returns |NULL|. */
+void *avl_t_find(struct avl_traverser *trav, struct avl_table *tree, void *item)
+{
+ struct avl_node *p, *q;
+
+ assert(trav != NULL && tree != NULL && item != NULL);
+ trav->avl_table = tree;
+ trav->avl_height = 0;
+ trav->avl_generation = tree->avl_generation;
+ for (p = tree->avl_root; p != NULL; p = q) {
+ int cmp = tree->avl_compare(item, p->avl_data, tree->avl_param);
+
+ if (cmp < 0)
+ q = p->avl_link[0];
+ else if (cmp > 0)
+ q = p->avl_link[1];
+ else { /* |cmp == 0| */
+
+ trav->avl_node = p;
+ return p->avl_data;
+ }
+
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = p;
+ }
+
+ trav->avl_height = 0;
+ trav->avl_node = NULL;
+ return NULL;
+}
+
+/* Attempts to insert |item| into |tree|.
+ If |item| is inserted successfully, it is returned and |trav| is
+ initialized to its location.
+ If a duplicate is found, it is returned and |trav| is initialized to
+ its location. No replacement of the item occurs.
+ If a memory allocation failure occurs, |NULL| is returned and |trav|
+ is initialized to the null item. */
+void *avl_t_insert(struct avl_traverser *trav, struct avl_table *tree,
+ void *item)
+{
+ void **p;
+
+ assert(trav != NULL && tree != NULL && item != NULL);
+
+ p = avl_probe(tree, item);
+ if (p != NULL) {
+ trav->avl_table = tree;
+ trav->avl_node = ((struct avl_node *)
+ ((char *) p - offsetof(struct avl_node, avl_data)));
+ trav->avl_generation = tree->avl_generation - 1;
+ return *p;
+ } else {
+ avl_t_init(trav, tree);
+ return NULL;
+ }
+}
+
+/* Initializes |trav| to have the same current node as |src|. */
+void *avl_t_copy(struct avl_traverser *trav, const struct avl_traverser *src)
+{
+ assert(trav != NULL && src != NULL);
+
+ if (trav != src) {
+ trav->avl_table = src->avl_table;
+ trav->avl_node = src->avl_node;
+ trav->avl_generation = src->avl_generation;
+ if (trav->avl_generation == trav->avl_table->avl_generation) {
+ trav->avl_height = src->avl_height;
+ memcpy(trav->avl_stack, (const void *) src->avl_stack,
+ sizeof *trav->avl_stack * trav->avl_height);
+ }
+ }
+
+ return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
+}
+
+/* Returns the next data item in inorder
+ within the tree being traversed with |trav|,
+ or if there are no more data items returns |NULL|. */
+void *avl_t_next(struct avl_traverser *trav)
+{
+ struct avl_node *x;
+
+ assert(trav != NULL);
+
+ if (trav->avl_generation != trav->avl_table->avl_generation)
+ trav_refresh(trav);
+
+ x = trav->avl_node;
+ if (x == NULL) {
+ return avl_t_first(trav, trav->avl_table);
+ } else if (x->avl_link[1] != NULL) {
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+
+ while (x->avl_link[0] != NULL) {
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+ }
+ } else {
+ struct avl_node *y;
+
+ do {
+ if (trav->avl_height == 0) {
+ trav->avl_node = NULL;
+ return NULL;
+ }
+
+ y = x;
+ x = trav->avl_stack[--trav->avl_height];
+ }
+ while (y == x->avl_link[1]);
+ }
+ trav->avl_node = x;
+
+ return x->avl_data;
+}
+
+/* Returns the previous data item in inorder
+ within the tree being traversed with |trav|,
+ or if there are no more data items returns |NULL|. */
+void *avl_t_prev(struct avl_traverser *trav)
+{
+ struct avl_node *x;
+
+ assert(trav != NULL);
+
+ if (trav->avl_generation != trav->avl_table->avl_generation)
+ trav_refresh(trav);
+
+ x = trav->avl_node;
+ if (x == NULL) {
+ return avl_t_last(trav, trav->avl_table);
+ } else if (x->avl_link[0] != NULL) {
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[0];
+
+ while (x->avl_link[1] != NULL) {
+ assert(trav->avl_height < AVL_MAX_HEIGHT);
+ trav->avl_stack[trav->avl_height++] = x;
+ x = x->avl_link[1];
+ }
+ } else {
+ struct avl_node *y;
+
+ do {
+ if (trav->avl_height == 0) {
+ trav->avl_node = NULL;
+ return NULL;
+ }
+
+ y = x;
+ x = trav->avl_stack[--trav->avl_height];
+ }
+ while (y == x->avl_link[0]);
+ }
+ trav->avl_node = x;
+
+ return x->avl_data;
+}
+
+/* Returns |trav|'s current item. */
+void *avl_t_cur(struct avl_traverser *trav)
+{
+ assert(trav != NULL);
+
+ return trav->avl_node != NULL ? trav->avl_node->avl_data : NULL;
+}
+
+/* Replaces the current item in |trav| by |new| and returns the item replaced.
+ |trav| must not have the null item selected.
+ The new item must not upset the ordering of the tree. */
+void *avl_t_replace(struct avl_traverser *trav, void *new)
+{
+ void *old;
+
+ assert(trav != NULL && trav->avl_node != NULL && new != NULL);
+ old = trav->avl_node->avl_data;
+ trav->avl_node->avl_data = new;
+ return old;
+}
+
+/* Destroys |new| with |avl_destroy (new, destroy)|,
+ first setting right links of nodes in |stack| within |new|
+ to null pointers to avoid touching uninitialized data. */
+static void
+copy_error_recovery(struct avl_node **stack, int height,
+ struct avl_table *new, avl_item_func * destroy)
+{
+ assert(stack != NULL && height >= 0 && new != NULL);
+
+ for (; height > 2; height -= 2)
+ stack[height - 1]->avl_link[1] = NULL;
+ avl_destroy(new, destroy);
+}
+
+/* Copies |org| to a newly created tree, which is returned.
+ If |copy != NULL|, each data item in |org| is first passed to |copy|,
+ and the return values are inserted into the tree,
+ with |NULL| return values taken as indications of failure.
+ On failure, destroys the partially created new tree,
+ applying |destroy|, if non-null, to each item in the new tree so far,
+ and returns |NULL|.
+ If |allocator != NULL|, it is used for allocation in the new tree.
+ Otherwise, the same allocator used for |org| is used. */
+struct avl_table *avl_copy(const struct avl_table *org, avl_copy_func * copy,
+ avl_item_func * destroy,
+ struct libavl_allocator *allocator)
+{
+ struct avl_node *stack[2 * (AVL_MAX_HEIGHT + 1)];
+ int height = 0;
+
+ struct avl_table *new;
+ const struct avl_node *x;
+ struct avl_node *y;
+
+ assert(org != NULL);
+ new = avl_create(org->avl_compare, org->avl_param,
+ allocator != NULL ? allocator : org->avl_alloc);
+ if (new == NULL)
+ return NULL;
+ new->avl_count = org->avl_count;
+ if (new->avl_count == 0)
+ return new;
+
+ x = (const struct avl_node *) &org->avl_root;
+ y = (struct avl_node *) &new->avl_root;
+ for (;;) {
+ while (x->avl_link[0] != NULL) {
+ assert(height < 2 * (AVL_MAX_HEIGHT + 1));
+
+ y->avl_link[0] =
+ new->avl_alloc->libavl_malloc(new->avl_alloc,
+ sizeof *y->avl_link[0]);
+ if (y->avl_link[0] == NULL) {
+ if (y != (struct avl_node *) &new->avl_root) {
+ y->avl_data = NULL;
+ y->avl_link[1] = NULL;
+ }
+
+ copy_error_recovery(stack, height, new, destroy);
+ return NULL;
+ }
+
+ stack[height++] = (struct avl_node *) x;
+ stack[height++] = y;
+ x = x->avl_link[0];
+ y = y->avl_link[0];
+ }
+ y->avl_link[0] = NULL;
+
+ for (;;) {
+ y->avl_balance = x->avl_balance;
+ if (copy == NULL)
+ y->avl_data = x->avl_data;
+ else {
+ y->avl_data = copy(x->avl_data, org->avl_param);
+ if (y->avl_data == NULL) {
+ y->avl_link[1] = NULL;
+ copy_error_recovery(stack, height, new, destroy);
+ return NULL;
+ }
+ }
+
+ if (x->avl_link[1] != NULL) {
+ y->avl_link[1] =
+ new->avl_alloc->libavl_malloc(new->avl_alloc,
+ sizeof *y->avl_link[1]);
+ if (y->avl_link[1] == NULL) {
+ copy_error_recovery(stack, height, new, destroy);
+ return NULL;
+ }
+
+ x = x->avl_link[1];
+ y = y->avl_link[1];
+ break;
+ } else
+ y->avl_link[1] = NULL;
+
+ if (height <= 2)
+ return new;
+
+ y = stack[--height];
+ x = stack[--height];
+ }
+ }
+}
+
+/* Frees storage allocated for |tree|.
+ If |destroy != NULL|, applies it to each data item in inorder. */
+void avl_destroy(struct avl_table *tree, avl_item_func * destroy)
+{
+ struct avl_node *p, *q;
+
+ assert(tree != NULL);
+
+ for (p = tree->avl_root; p != NULL; p = q)
+ if (p->avl_link[0] == NULL) {
+ q = p->avl_link[1];
+ if (destroy != NULL && p->avl_data != NULL)
+ destroy(p->avl_data, tree->avl_param);
+ tree->avl_alloc->libavl_free(tree->avl_alloc, p);
+ } else {
+ q = p->avl_link[0];
+ p->avl_link[0] = q->avl_link[1];
+ q->avl_link[1] = p;
+ }
+
+ tree->avl_alloc->libavl_free(tree->avl_alloc, tree);
+}
+
+/* Allocates |size| bytes of space using |malloc()|.
+ Returns a null pointer if allocation fails. */
+void *avl_malloc(struct libavl_allocator *allocator, size_t size)
+{
+ assert(allocator != NULL && size > 0);
+ return malloc(size);
+}
+
+/* Frees |block|. */
+void avl_free(struct libavl_allocator *allocator, void *block)
+{
+ assert(allocator != NULL && block != NULL);
+ free(block);
+}
+
+/* Default memory allocator that uses |malloc()| and |free()|. */
+struct libavl_allocator avl_allocator_default = {
+ avl_malloc,
+ avl_free
+};
+
+#undef NDEBUG
+#include <assert.h>
+
+/* Asserts that |avl_insert()| succeeds at inserting |item| into |table|. */
+void
+ (avl_assert_insert) (struct avl_table * table, void *item) {
+ void **p = avl_probe(table, item);
+ assert(p != NULL && *p == item);
+}
+
+/* Asserts that |avl_delete()| really removes |item| from |table|,
+ and returns the removed item. */
+void *(avl_assert_delete) (struct avl_table * table, void *item) {
+ void *p = avl_delete(table, item);
+ assert(p != NULL);
+ return p;
+}
diff --git a/Build/source/texk/web2c/luatexdir/utils/avl.h b/Build/source/texk/web2c/luatexdir/utils/avl.h
new file mode 100644
index 00000000000..b9f9e3c01a9
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/utils/avl.h
@@ -0,0 +1,115 @@
+/* Produced by texiweb from libavl.w. */
+
+/* libavl - library for manipulation of binary trees.
+ Copyright (C) 1998-2002, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The author may be contacted at <blp@gnu.org> on the Internet, or
+ write to Ben Pfaff, Stanford University, Computer Science Dept., 353
+ Serra Mall, Stanford CA 94305, USA.
+*/
+
+#ifndef AVL_H
+#define AVL_H 1
+
+#include <stddef.h>
+
+/* Function types. */
+typedef int avl_comparison_func (const void *avl_a, const void *avl_b,
+ void *avl_param);
+typedef void avl_item_func (void *avl_item, void *avl_param);
+typedef void *avl_copy_func (void *avl_item, void *avl_param);
+
+#ifndef LIBAVL_ALLOCATOR
+#define LIBAVL_ALLOCATOR
+/* Memory allocator. */
+struct libavl_allocator
+ {
+ void *(*libavl_malloc) (struct libavl_allocator *, size_t libavl_size);
+ void (*libavl_free) (struct libavl_allocator *, void *libavl_block);
+ };
+#endif
+
+/* Default memory allocator. */
+extern struct libavl_allocator avl_allocator_default;
+void *avl_malloc (struct libavl_allocator *, size_t);
+void avl_free (struct libavl_allocator *, void *);
+
+/* Maximum AVL height. */
+#ifndef AVL_MAX_HEIGHT
+#define AVL_MAX_HEIGHT 32
+#endif
+
+/* Tree data structure. */
+struct avl_table
+ {
+ struct avl_node *avl_root; /* Tree's root. */
+ avl_comparison_func *avl_compare; /* Comparison function. */
+ void *avl_param; /* Extra argument to |avl_compare|. */
+ struct libavl_allocator *avl_alloc; /* Memory allocator. */
+ size_t avl_count; /* Number of items in tree. */
+ unsigned long avl_generation; /* Generation number. */
+ };
+
+/* An AVL tree node. */
+struct avl_node
+ {
+ struct avl_node *avl_link[2]; /* Subtrees. */
+ void *avl_data; /* Pointer to data. */
+ signed char avl_balance; /* Balance factor. */
+ };
+
+/* AVL traverser structure. */
+struct avl_traverser
+ {
+ struct avl_table *avl_table; /* Tree being traversed. */
+ struct avl_node *avl_node; /* Current node in tree. */
+ struct avl_node *avl_stack[AVL_MAX_HEIGHT];
+ /* All the nodes above |avl_node|. */
+ size_t avl_height; /* Number of nodes in |avl_parent|. */
+ unsigned long avl_generation; /* Generation number. */
+ };
+
+/* Table functions. */
+struct avl_table *avl_create (avl_comparison_func *, void *,
+ struct libavl_allocator *);
+struct avl_table *avl_copy (const struct avl_table *, avl_copy_func *,
+ avl_item_func *, struct libavl_allocator *);
+void avl_destroy (struct avl_table *, avl_item_func *);
+void **avl_probe (struct avl_table *, void *);
+void *avl_insert (struct avl_table *, void *);
+void *avl_replace (struct avl_table *, void *);
+void *avl_delete (struct avl_table *, const void *);
+void *avl_find (const struct avl_table *, const void *);
+void avl_assert_insert (struct avl_table *, void *);
+void *avl_assert_delete (struct avl_table *, void *);
+
+#define avl_count(table) ((size_t) (table)->avl_count)
+
+/* Table traverser functions. */
+void avl_t_init (struct avl_traverser *, struct avl_table *);
+void *avl_t_first (struct avl_traverser *, struct avl_table *);
+void *avl_t_last (struct avl_traverser *, struct avl_table *);
+void *avl_t_find (struct avl_traverser *, struct avl_table *, void *);
+void *avl_t_insert (struct avl_traverser *, struct avl_table *, void *);
+void *avl_t_copy (struct avl_traverser *, const struct avl_traverser *);
+void *avl_t_next (struct avl_traverser *);
+void *avl_t_prev (struct avl_traverser *);
+void *avl_t_cur (struct avl_traverser *);
+void *avl_t_replace (struct avl_traverser *, void *);
+
+#endif /* avl.h */
diff --git a/Build/source/texk/web2c/luatexdir/avlstuff.c b/Build/source/texk/web2c/luatexdir/utils/avlstuff.c
index 74fcf6b8eda..aa8522bf9dc 100644
--- a/Build/source/texk/web2c/luatexdir/avlstuff.c
+++ b/Build/source/texk/web2c/luatexdir/utils/avlstuff.c
@@ -1,31 +1,32 @@
-/*
-Copyright (c) 2004-2005 Han The Thanh, <thanh@pdftex.org>
+/* avlstuff.c
-This file is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by Free
-Software Foundation; either version 2 of the License, or (at your option)
-any later version.
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
+ This file is part of LuaTeX.
-You should have received a copy of the GNU General Public License along
-with this file; if not, write to the Free Software Foundation, Inc.,
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-$Id$
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include <kpathsea/c-vararg.h>
#include <kpathsea/c-proto.h>
#include "avl.h"
-static struct avl_table *PdfObjTree[pdf_objtype_max + 1] =
- { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+static const char __svn_version[] =
+ "$Id: avlstuff.c 2073 2009-03-21 10:06:50Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/utils/avlstuff.c $";
+
+static struct avl_table **PdfObjTree = NULL;
/**********************************************************************/
/* memory management functions for AVL */
@@ -62,8 +63,7 @@ int comp_string_entry(const void *pa, const void *pb, void *p)
}
/**********************************************************************/
-/* One AVL tree for each obj_type 0...pdfobjtypemax */
-
+/* One AVL tree for each obj_type 0...pdf_objtype_max */
typedef struct oentry_ {
integer int0;
@@ -80,28 +80,29 @@ int compare_info(const void *pa, const void *pb, void *param)
a = ((const oentry *) pa)->int0;
b = ((const oentry *) pb)->int0;
if (a < 0 && b < 0) { /* string comparison */
- if (a <= 2097152 && b <= 2097152) {
- a+=2097152;
- b+=2097152;
- as = str_start[-a];
- ae = str_start[-a + 1]; /* start of next string in pool */
- bs = str_start[-b];
- be = str_start[-b + 1];
- al = ae - as;
- bl = be - bs;
- if (al < bl) /* compare first by string length */
- return -1;
- if (al > bl)
- return 1;
- for (; as < ae; as++, bs++) {
- if (str_pool[as] < str_pool[bs])
+ if (a <= 2097152 && b <= 2097152) {
+ a += 2097152;
+ b += 2097152;
+ as = str_start[-a];
+ ae = str_start[-a + 1]; /* start of next string in pool */
+ bs = str_start[-b];
+ be = str_start[-b + 1];
+ al = ae - as;
+ bl = be - bs;
+ if (al < bl) /* compare first by string length */
return -1;
- if (str_pool[as] > str_pool[bs])
+ if (al > bl)
return 1;
+ for (; as < ae; as++, bs++) {
+ if (str_pool[as] < str_pool[bs])
+ return -1;
+ if (str_pool[as] > str_pool[bs])
+ return 1;
+ }
+ } else {
+ pdftex_fail
+ ("avlstuff.c: compare_items() for single characters: NI");
}
- } else {
- pdftex_fail("avlstuff.c: compare_items() for single characters: NI");
- }
} else { /* integer comparison */
if (a < b)
return -1;
@@ -115,7 +116,13 @@ void avl_put_obj(integer objptr, integer t)
{
static void **pp;
static oentry *oe;
+ int i;
+ if (PdfObjTree == NULL) {
+ PdfObjTree = xtalloc(pdf_objtype_max + 1, struct avl_table *);
+ for (i = 0; i <= pdf_objtype_max; i++)
+ PdfObjTree[i] = NULL;
+ }
if (PdfObjTree[t] == NULL) {
PdfObjTree[t] = avl_create(compare_info, NULL, &avl_xallocator);
if (PdfObjTree[t] == NULL)
@@ -129,7 +136,6 @@ void avl_put_obj(integer objptr, integer t)
pdftex_fail("avlstuff.c: avl_probe() out of memory in insertion");
}
-
/* replacement for linear search pascal function "find_obj()" */
integer avl_find_obj(integer t, integer i, integer byname)
@@ -141,7 +147,7 @@ integer avl_find_obj(integer t, integer i, integer byname)
tmp.int0 = -i;
else
tmp.int0 = i;
- if (PdfObjTree[t] == NULL)
+ if (PdfObjTree == NULL || PdfObjTree[t] == NULL)
return 0;
p = (oentry *) avl_find(PdfObjTree[t], &tmp);
if (p == NULL)
@@ -171,10 +177,14 @@ void PdfObjTree_free()
{
int i;
+ if (PdfObjTree == NULL)
+ return;
for (i = 0; i <= pdf_objtype_max; i++) {
if (PdfObjTree[i] != NULL)
avl_destroy(PdfObjTree[i], destroy_oentry);
}
+ xfree(PdfObjTree);
+ PdfObjTree = NULL;
}
/**********************************************************************/
diff --git a/Build/source/texk/web2c/luatexdir/avlstuff.h b/Build/source/texk/web2c/luatexdir/utils/avlstuff.h
index e5a4de894d2..6690d5036b8 100644
--- a/Build/source/texk/web2c/luatexdir/avlstuff.h
+++ b/Build/source/texk/web2c/luatexdir/utils/avlstuff.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2004 Han The Thanh, <thanh@pdftex.org>
+Copyright (c) 2004-2007 Han The Thanh, <thanh@pdftex.org>
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by Free
@@ -12,12 +12,10 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
-with this file; if not, write to the Free Software Foundation, Inc.,
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+with pdfTeX; if not, write to the Free Software Foundation, Inc., 51
+Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id$
-
-formatted by indent -kr
+$Id: avlstuff.h 2073 2009-03-21 10:06:50Z hhenkel $
*/
#include "avl.h"
diff --git a/Build/source/texk/web2c/luatexdir/utils/synctex.c b/Build/source/texk/web2c/luatexdir/utils/synctex.c
new file mode 100644
index 00000000000..459ef746d85
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/utils/synctex.c
@@ -0,0 +1,1493 @@
+/*
+Copyright (c) 2008 jerome DOT laurens AT u-bourgogne DOT fr
+
+This file is part of the SyncTeX package.
+
+License:
+--------
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE
+
+Except as contained in this notice, the name of the copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in this Software without prior written
+authorization from the copyright holder.
+
+Important notice:
+-----------------
+This file is named "synctex.c", it may or may not have a header counterpart
+depending on its use. It aims to provide basic components useful for the
+input/output synchronization technology for TeX.
+The purpose of the implementation is threefold
+- firstly, it defines a new input/output synchronization technology named
+ "synchronize texnology", "SyncTeX" or "synctex"
+- secondly, it defines the naming convention and format of the auxiliary file
+ used by this technology
+- thirdly, it defines the API of a controller and a controller, used in
+ particular by the pdfTeX and XeTeX programs to prepare synchronization.
+
+All these are up to a great extent de facto definitions, which means that they
+are partly defined by the implementation itself.
+
+This technology was first designed for pdfTeX, an extension of TeX managing the
+pdf output file format, but it can certainly be adapted to other programs built
+from TeX as long as the extensions do not break too much the core design.
+Moreover, the synchronize texnology only relies on code concept and not
+implementation details, so it can be ported to other TeX systems. In order to
+support SyncTeX, one can start reading the dedicated section in synctex.ch,
+sync-pdftex.ch and sync-xetex.ch. Actually, support is provided for TeX, e-TeX,
+pdfTeX and XeTeX.
+
+Other existing public synchronization technologies are defined by srcltx.sty -
+also used by source specials - and pdfsync.sty. Like them, the synchronize
+texnology is meant to be shared by various text editors, viewers and TeX
+engines. A centralized reference and source of information is available in TeX-Live.
+
+Versioning:
+-----------
+As synctex is embedded into different TeX implementation, there is an independent
+versionning system.
+For TeX implementations, the actual version is: 1
+For .synctex file format, the actual version is SYNCTEX_VERSION below
+
+Please, do not remove these explanations.
+
+Acknowledgments:
+----------------
+The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
+and significant help from XeTeX developer Jonathan Kew
+
+Nota Bene:
+----------
+If you include or use a significant part of the synctex package into a software,
+I would appreciate to be listed as contributor and see "SyncTeX" highlighted.
+
+Version 1
+Tue Jul 1 15:23:00 UTC 2008
+
+*/
+
+# define SYNCTEX_VERSION 1
+
+# define SYNCTEX_DEBUG 0
+
+/* Debugging: define the next macro to "return;" in order to disable the synctex code
+ * only suplemental function calls will be used. The compiler may optimize them. */
+# define SYNCTEX_RETURN_IF_DISABLED ;
+
+# define SYNCTEX_NOERR 0
+
+# define EXTERN extern
+
+# ifdef xfree
+# define SYNCTEX_FREE xfree
+# else
+# define SYNCTEX_FREE(x) free(x)
+# endif
+
+#define ruleht rule_ht
+#define ruledp rule_dp
+#define rulewd rule_wd
+#define zmem varmem
+#define jobname job_name
+#define totalpages total_pages
+#define curinput cur_input
+#define synctextagfield synctex_tag_field
+#define namefield name_field
+
+#define gettexstring(a) xstrdup(makecstring(a))
+/*EXTERN char *gettexstring(int n);*/
+
+/* the macros defined below do the same job than their almost eponym
+ * counterparts of *tex.web, the memory access is sometimes more direct
+ * because *tex.web won't share its own constants the main purpose is to
+ * maintain very few hook points into *tex.web in order both to ensure
+ * portability and not modifying to much the original code. see texmfmem.h
+ * and *tex.web for details, the synctex_ prefix prevents name conflicts, it
+ * is some kind of namespace
+*/
+# warning These structures MUST be kept in synchronization with the main program
+/* synctexoption is a global integer variable defined in *tex.web
+ * it is set to 1 by texmfmp.c if the command line has the '-synctex=1'
+ * option. */
+# define synctex_options synctexoption
+# define SYNCTEX_NO_OPTION INT_MAX
+/* if synctex_options is set to SYNCTEX_NO_OPTION, no command line option was provided. */
+
+/* glue code: really define the main memory,
+ * this is exactly the same "mem" as in *tex.web. */
+# define mem zmem
+/* glue code: synctexoffset is a global integer variable defined in *tex.web
+ * it is set to the offset where the primitive \synctex reads and writes its
+ * value. */
+# define SYNCTEX_VALUE zeqtb[synctexoffset].cint
+/* if there were a mean to share the value of synctex_code between *tex.web
+ * and this file, it would be great. */
+
+# define SYNCTEX_UNIT_FACTOR 1
+# define UNIT / synctex_ctxt.unit
+/* UNIT is the scale. TeX coordinates are very accurate and client won't need
+ * that, at leat in a first step. 1.0 <-> 2^16 = 65536.
+ * The TeX unit is sp (scaled point) or pt/65536 which means that the scale
+ * factor to retrieve a bp unit (a postscript) is 72/72.27/65536 =
+ * 1/4096/16.06 = 1/8192/8.03
+ * Here we use 1/SYNCTEX_UNIT_FACTOR as scale factor, then we can limit ourselves to
+ * integers. This default value assumes that TeX magnification factor is 1000.
+ * The real TeX magnification factor is used to fine tune the synctex context
+ * scale in the synctex_dot_open function.
+ * IMPORTANT: We can say that the natural unit of .synctex files is SYNCTEX_UNIT_FACTOR sp.
+ * To retrieve the proper bp unit, we'll have to divide by 8.03. To reduce
+ * rounding errors, we'll certainly have to add 0.5 for non negative integers
+ * and ±0.5 for negative integers. This trick is mainly to gain speed and
+ * size. A binary file would be more appropriate in that respect, but I guess
+ * that some clients like auctex would not like it very much. we cannot use
+ * "<<13" instead of "/SYNCTEX_UNIT_FACTOR" because the integers are signed and we do not
+ * want the sign bit to be propagated. The origin of the coordinates is at
+ * the top left corner of the page. For pdf mode, it is straightforward, but
+ * for dvi mode, we'll have to record the 1in offset in both directions,
+ * eventually modified by the magnification.
+*/
+
+/* WARNING:
+ The 9 definitions below must be in sync with their eponym declarations in
+ the proper synctex-*.ch* file.
+*/
+# define synchronization_field_size 1
+/* The default value is 2, it is suitable for original TeX and alike,
+ * but it is too big for XeTeX.
+ * The tag and the line are just the two last words of the node. This is a
+ * very handy design but this is not strictly required by the concept. If
+ * really necessary, one can define other storage rules.
+ * XeTeX redefines synchronization_field_size,
+ * SYNCTEX_TAG_MODEL and SYNCTEX_LINE_MODEL
+ * All the default values are targeted to TeX or e-TeX. */
+# define SYNCTEX_TAG_MODEL(NODE,SIZE)\
+ vinfo(NODE+SIZE-synchronization_field_size)
+# define SYNCTEX_LINE_MODEL(NODE,SIZE)\
+ vlink(NODE+SIZE-synchronization_field_size)
+/* SYNCTEX_TAG_MODEL and SYNCTEX_LINE_MODEL are used to define
+ * SYNCTEX_TAG and SYNCTEX_LINE in a model independant way
+ * Both are tag and line accessors */
+/*# define box_node_size (7+synchronization_field_size)*/
+/* see: @d box_node_size=...
+ * There should be an automatic process here because these definitions
+ * are redundant. However, this process would certainly be overcomplicated
+ * (building then parsing the *tex.web file would be a pain) */
+# define width_offset 2
+/* see: @d width_offset=... */
+# define depth_offset 3
+/* see: @d depth_offset=... */
+# define height_offset 4
+/* see: @d height_offset=... */
+
+/* Now define the local version of width(##), height(##) and depth(##) macros
+ These only depend on the 3 macros above. */
+# define SYNCTEX_TYPE(NODE) type(NODE)
+/*# define rule_node 2*/
+/*# define glue_node 10*/
+/*# define kern_node 11*/
+# define SYNCTEX_SUBTYPE(NODE) subtype(NODE)
+# define SYNCTEX_WIDTH(NODE) mem[NODE+width_offset].cint
+# define SYNCTEX_DEPTH(NODE) mem[NODE+depth_offset].cint
+# define SYNCTEX_HEIGHT(NODE) mem[NODE+height_offset].cint
+
+/* When an hlist ships out, it can contain many different kern/glue nodes with
+ * exactly the same sync tag and line. To reduce the size of the .synctex
+ * file, we only display a kern node sync info when either the sync tag or the
+ * line changes. Also, we try ro reduce the distance between the chosen nodes
+ * in order to improve accuracy. It means that we display information for
+ * consecutive nodes, as far as possible. This tricky part uses a "recorder",
+ * which is the address of the routine that knows how to write the
+ * synchronization info to the .synctex file. It also uses criteria to detect
+ * a change in the context, this is the macro SYNCTEX_CONTEXT_DID_CHANGE. The
+ * SYNCTEX_IGNORE macro is used to detect unproperly initialized nodes. See
+ * details in the implementation of the functions below. */
+# define SYNCTEX_IGNORE(NODE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE || !SYNCTEX_FILE
+
+/* Some parts of the code may differ depending on the ouput mode,
+ * dvi or xdv vs pdf, in particular the management of magnification.
+ * The default is dvi mode.
+ * Also, if pdftex is used, the origin of the coordinates is at 0, not at 1in
+ * Default values are suitable for TeX */
+# define SYNCTEX_OUTPUT "dvi"
+# define SYNCTEX_OFFSET_IS_PDF 0
+
+# define SYNCTEX_YES (-1)
+# define SYNCTEX_NO (0)
+# define SYNCTEX_NO_ERROR (0)
+
+# include "luatexd.h"
+# undef SYNCTEX_OFFSET_IS_PDF
+# define SYNCTEX_OFFSET_IS_PDF (pdf_output_value>0)
+# undef SYNCTEX_OUTPUT
+# define SYNCTEX_OUTPUT ((pdf_output_value>0)?"pdf":"dvi")
+
+#define __SyncTeX__ 1
+
+# if defined(__SyncTeX__)
+
+# include <stdio.h>
+# include <stdarg.h>
+# include "zlib.h"
+
+typedef void (*synctex_recorder_t)(halfword); /* recorders know how to record a node */
+typedef int (*synctex_fprintf_t)(void *, const char * , ...); /* print formatted to either FILE * or gzFile */
+
+# define SYNCTEX_BITS_PER_BYTE 8
+
+/* Here are all the local variables gathered in one "synchronization context" */
+static struct {
+ void *file; /* the foo.synctex or foo.synctex.gz I/O identifier */
+ synctex_fprintf_t fprintf; /* either fprintf or gzprintf */
+ char *busy_name; /* the real "foo.synctex(busy)" or "foo.synctex.gz(busy)" name */
+ char *root_name; /* in general jobname.tex */
+ integer count; /* The number of interesting records in "foo.synctex" */
+ /* next concern the last sync record encountered */
+ halfword node; /* the last synchronized node, must be set
+ * before the recorder */
+ synctex_recorder_t recorder;/* the recorder of the node above, the
+ * routine that knows how to record the
+ * node to the .synctex file */
+ integer tag, line; /* current tag and line */
+ integer curh, curv; /* current point */
+ integer magnification; /* The magnification as given by \mag */
+ integer unit; /* The unit, defaults to 1, use 8192 to produce shorter but less accurate info */
+ integer total_length; /* The total length of the bytes written since the last check point */
+ struct _flags {
+ unsigned int option_read:1; /* Command line option read (in case of problem or at the end) */
+ unsigned int off:1; /* Definitely turn off synctex, corresponds to cli option -synctex=0 */
+ unsigned int no_gz:1; /* Whether zlib is used or not */
+ unsigned int not_void:1; /* Whether it really contains synchronization material */
+ unsigned int warn:1; /* One shot warning flag */
+ unsigned int reserved:SYNCTEX_BITS_PER_BYTE*sizeof(int)-5; /* Align */
+ } flags;
+} synctex_ctxt = {
+NULL, NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, 0, {0,0,0,0,0,0}};
+
+#define SYNCTEX_FILE synctex_ctxt.file
+#define SYNCTEX_IS_OFF (synctex_ctxt.flags.off)
+#define SYNCTEX_NO_GZ (synctex_ctxt.flags.no_gz)
+#define SYNCTEX_NOT_VOID (synctex_ctxt.flags.not_void)
+#define SYNCTEX_WARNING_DISABLE (synctex_ctxt.flags.warn)
+#define SYNCTEX_fprintf (*synctex_ctxt.fprintf)
+
+/* Initialize the options, synchronize the variables.
+ * This is sent by *tex.web before any TeX macro is used.
+ * */
+void synctex_init_command(void)
+{
+ /* This is a one shot function, any subsequent call is void */
+ if (synctex_ctxt.flags.option_read) {
+ return;
+ }
+ if (SYNCTEX_NO_OPTION == synctex_options) {
+ /* No option given from the command line */
+ SYNCTEX_VALUE = 0;
+ } else if (synctex_options == 0) {
+ /* -synctex=0 was given: SyncTeX must be definitely disabled,
+ * any subsequent \synctex=1 will have no effect at all */
+ SYNCTEX_IS_OFF = SYNCTEX_YES;
+ SYNCTEX_VALUE = 0;
+ } else {
+ /* the command line options are not ignored */
+ if(synctex_options < 0) {
+ SYNCTEX_NO_GZ = SYNCTEX_YES;
+ }
+ /* Initialize the content of the \synctex primitive */
+ SYNCTEX_VALUE = synctex_options;
+ }
+ synctex_ctxt.flags.option_read = SYNCTEX_YES;
+ return;
+}
+
+/* Free all memory used and close the file,
+ * It is sent locally when there is a problem with synctex output. */
+void synctex_abort(void)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctex_abort\n");
+#endif
+ if (SYNCTEX_FILE) {
+ if (SYNCTEX_NO_GZ) {
+ xfclose((FILE *)SYNCTEX_FILE, synctex_ctxt.busy_name);
+ } else {
+ gzclose((gzFile)SYNCTEX_FILE);
+ }
+ SYNCTEX_FREE(synctex_ctxt.busy_name);
+ synctex_ctxt.busy_name = NULL;
+ }
+ SYNCTEX_FREE(synctex_ctxt.root_name);
+ synctex_ctxt.root_name = NULL;
+ SYNCTEX_IS_OFF = SYNCTEX_YES; /* disable synctex */
+}
+
+static inline int synctex_record_preamble(void);
+static inline int synctex_record_input(integer tag, char *name);
+
+static char *synctex_suffix = ".synctex";
+static char *synctex_suffix_gz = ".gz";
+static char *synctex_suffix_busy = "(busy)";
+
+/* synctex_dot_open ensures that the foo.synctex file is open.
+ * In case of problem, it definitely disables synchronization.
+ * Now all the output synchronization info is gathered in only one file.
+ * It is possible to split this info into as many different output files as sheets
+ * plus 1 for the control but the overall benefits are not so clear.
+ * For example foo-i.synctex would contain input synchronization
+ * information for page i alone.
+*/
+static void *synctex_dot_open(void)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nwarning: Synchronize DEBUG: synctex_dot_open\n");
+ printf("\nwarning: SYNCTEX_VALUE=%0X\n", SYNCTEX_VALUE);
+ printf("\nwarning: synctex_options=%0X\n", synctex_options);
+# endif
+ if (SYNCTEX_IS_OFF || !SYNCTEX_VALUE) {
+ return NULL; /* synchronization is disabled: do nothing */
+ }
+ if (SYNCTEX_FILE) {
+ return SYNCTEX_FILE; /* synchronization is alerady enabled */
+ }
+#if SYNCTEX_DEBUG
+ printf("\nwarning: Synchronize DEBUG: synctex_dot_open 1\n");
+# endif
+ /* this is the first time we are asked to open the file
+ this part of code is executed only once:
+ either SYNCTEX_FILE is nonnegative or synchronization is
+ definitely disabled. */
+ {
+ char *tmp = gettexstring(jobname);
+ /* jobname was set by the \jobname command on the *TeX side */
+ char * the_busy_name = xmalloc(strlen(tmp) + strlen(synctex_suffix) + strlen(synctex_suffix_gz) + strlen(synctex_suffix_busy) + 1);
+ if(!the_busy_name) {
+ SYNCTEX_FREE(tmp);
+ synctex_abort();
+ return NULL;
+ }
+ strcpy(the_busy_name, tmp);
+ SYNCTEX_FREE(tmp);
+ tmp = NULL;
+ strcat(the_busy_name, synctex_suffix);
+ /* Initialize SYNCTEX_NO_GZ with the content of \synctex to let the user choose the format. */
+ SYNCTEX_NO_GZ = SYNCTEX_VALUE<0?SYNCTEX_YES:SYNCTEX_NO;
+ if (!SYNCTEX_NO_GZ) {
+ strcat(the_busy_name, synctex_suffix_gz);
+ }
+ strcat(the_busy_name, synctex_suffix_busy);
+ if (SYNCTEX_NO_GZ) {
+ SYNCTEX_FILE = xfopen(the_busy_name, FOPEN_WBIN_MODE);
+ synctex_ctxt.fprintf = (synctex_fprintf_t)(&fprintf);
+ } else {
+ SYNCTEX_FILE = gzopen(the_busy_name, FOPEN_WBIN_MODE);
+ synctex_ctxt.fprintf = (synctex_fprintf_t)(&gzprintf);
+ }
+#if SYNCTEX_DEBUG
+ printf("\nwarning: Synchronize DEBUG: synctex_dot_open 2\n");
+#endif
+ if (SYNCTEX_FILE) {
+ if(SYNCTEX_NO_ERROR != synctex_record_preamble()) {
+ synctex_abort();
+ return NULL;
+ }
+ /* Initialization of the context */
+ synctex_ctxt.magnification = 1000;
+ synctex_ctxt.unit = SYNCTEX_UNIT_FACTOR;
+ /* synctex_ctxt.busy_name was NULL before, it now owns the_busy_name */
+ synctex_ctxt.busy_name = the_busy_name;
+ the_busy_name = NULL;
+ /* print the preamble, this is an quite an UTF8 file */
+ if (NULL != synctex_ctxt.root_name) {
+ synctex_record_input(1,synctex_ctxt.root_name);
+ SYNCTEX_FREE(synctex_ctxt.root_name);
+ synctex_ctxt.root_name = NULL;
+ }
+ synctex_ctxt.count = 0;
+#if SYNCTEX_DEBUG
+ fprintf(stdout,
+ "\nwarning: Synchronize DEBUG: synctex_dot_open SYNCTEX AVAILABLE\n");
+#endif
+ } else {
+ /* no .synctex file available, so disable synchronization */
+ SYNCTEX_IS_OFF = SYNCTEX_YES;
+ SYNCTEX_VALUE = 0;
+ printf("\nSyncTeX warning: no synchronization, problem with %s\n",the_busy_name);
+ /* and free the_busy_name */
+ SYNCTEX_FREE(the_busy_name);
+ the_busy_name = NULL;
+#if SYNCTEX_DEBUG
+ fprintf(stdout,
+ "\nwarning: Synchronize DEBUG: synctex_dot_open SYNCTEX DISABLED\n");
+#endif
+ }
+ }
+ return SYNCTEX_FILE;
+}
+
+/* Each time TeX opens a file, it sends a synctexstartinput message and enters
+ * this function. Here, a new synchronization tag is created and stored in
+ * the synctex_tag_field of the TeX current input context. Each synchronized
+ * TeX node will record this tag instead of the file name. synctexstartinput
+ * writes the mapping synctag <-> file name to the .synctex (or .synctex.gz) file. A client
+ * will read the .synctex file and retrieve this mapping, it will be able to
+ * open the correct file just knowing its tag. If the same file is read
+ * multiple times, it might be associated to different tags. Synchronization
+ * controllers, either in viewers, editors or standalone should be prepared to
+ * handle this situation and take the appropriate action if they want to
+ * optimize memory. No two different files will have the same positive tag.
+ * It is not advisable to definitely store the file names here. If the file
+ * names ever have to be stored, it should definitely be done at the TeX level
+ * just like src-specials do, such that other components of the program can use
+ * it. This function does not make any difference between the files, it
+ * treats the same way .tex, .aux, .sty ... files, even if many of them do not
+ * contain any material meant to be typeset.
+*/
+void synctex_start_input(void)
+{
+ static unsigned int synctex_tag_counter = 0;
+
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nwarning: Synchronize DEBUG: synctexstartinput %i",
+ synctex_tag_counter);
+ printf("\nwarning: SYNCTEX_VALUE=%i", SYNCTEX_VALUE);
+ printf("\nwarning: synctex_options=%0X", synctex_options);
+#endif
+
+ if (SYNCTEX_IS_OFF) {
+ return;
+ }
+ /* synctex_tag_counter is a counter uniquely identifying the file actually
+ * open. Each time tex opens a new file, synctexstartinput will increment this
+ * counter */
+ if (~synctex_tag_counter > 0) {
+ ++synctex_tag_counter;
+ } else {
+ /* we have reached the limit, subsequent files will be softly ignored
+ * this makes a lot of files... even in 32 bits
+ * Maybe we will limit this to 16bits and
+ * use the 16 other bits to store the column number */
+ curinput.synctextagfield = 0;
+ return;
+ }
+ curinput.synctextagfield = synctex_tag_counter; /* -> *TeX.web */
+ if (synctex_tag_counter == 1) {
+ /* this is the first file TeX ever opens, in general \jobname.tex we
+ * do not know yet if synchronization will ever be enabled so we have
+ * to store the file name, because we will need it later.
+ * This is necessary because \jobname can be different */
+ synctex_ctxt.root_name = gettexstring(curinput.namefield);
+ /* we could initialize the unit field to 1 to avoid floating point exception
+ * when accidentaly dividing by the unit.
+ * This occurs when some SYNCTEX_IGNORE macro is not used.
+ * But this must not happen unexpectedly, so we leave the unit to 0 */
+#if SYNCTEX_DEBUG
+ printf("\nwarning: Synchronize DEBUG: synctexstartinput first END\n");
+# endif
+ return;
+ }
+ if (SYNCTEX_FILE || (SYNCTEX_VALUE && (SYNCTEX_NO_ERROR != synctex_dot_open()))) {
+ char *tmp = gettexstring(curinput.namefield);
+ synctex_record_input(curinput.synctextagfield,tmp);
+ SYNCTEX_FREE(tmp);
+ }
+#if SYNCTEX_DEBUG
+ printf("\nwarning: Synchronize DEBUG: synctexstartinput END\n");
+# endif
+ return;
+}
+
+/* All the synctex... functions below have the smallest set of parameters. It
+ * appears to be either the address of a node, or nothing at all. Using zmem,
+ * which is the place where all the nodes are stored, one can retrieve every
+ * information about a node. The other information is obtained through the
+ * global context variable.
+ */
+
+static inline int synctex_record_postamble(void);
+
+
+/* Free all memory used and close the file,
+ * sent by close_files_and_terminate in tex.web.
+ * synctexterminate() is called when the TeX run terminates.
+ * If synchronization was active, the working synctex file is moved to
+ * the final synctex file name.
+ * If synchronization was not active of if there is no output,
+ * the synctex file is removed if any.
+ * That way we can be sure that any synctex file is in sync with a tex run.
+ * However, it does not mean that it will be in sync with the pdf, especially
+ * when the output is dvi or xdv and the dvi (or xdv) to pdf driver has not been applied.
+ */
+void synctex_terminate(boolean log_opened)
+{
+ char *tmp = NULL;
+ char * the_real_syncname = NULL;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexterminate\n");
+#endif
+ tmp = gettexstring(jobname);
+ the_real_syncname = xmalloc(strlen(tmp) + strlen(synctex_suffix) + strlen(synctex_suffix_gz) + 1);
+ if(!the_real_syncname) {
+ SYNCTEX_FREE(tmp);
+ synctex_abort();
+ return;
+ }
+ strcpy(the_real_syncname, tmp);
+ strcat(the_real_syncname, synctex_suffix);
+ if (!SYNCTEX_NO_GZ) {
+ /* Remove any uncompressed synctex file, from a previous build. */
+ remove(the_real_syncname);
+ strcat(the_real_syncname, synctex_suffix_gz);
+ }
+ /* allways remove the synctex output file before renaming it, windows requires it. */
+ if(0 != remove(the_real_syncname) && errno == EACCES) {
+ fprintf(stderr,"SyncTeX: Can't remove %s (file is open or read only)\n",the_real_syncname);
+ }
+ if (SYNCTEX_FILE) {
+ if (SYNCTEX_NOT_VOID) {
+ synctex_record_postamble();
+ /* close the synctex file*/
+ if (SYNCTEX_NO_GZ) {
+ xfclose((FILE *)SYNCTEX_FILE, synctex_ctxt.busy_name);
+ } else {
+ gzclose((gzFile)SYNCTEX_FILE);
+ }
+ /* renaming the working synctex file */
+ if(0 == rename(synctex_ctxt.busy_name,the_real_syncname)) {
+ if(log_opened) {
+ printf("\nSyncTeX written on %s",the_real_syncname); /* SyncTeX also refers to the contents */
+ }
+ } else {
+ fprintf(stderr,"SyncTeX: Can't rename %s to %s\n",synctex_ctxt.busy_name,the_real_syncname);
+ remove(synctex_ctxt.busy_name);
+ }
+ } else {
+ /* close and remove the synctex file because there are no pages of output */
+ if (SYNCTEX_NO_GZ) {
+ xfclose((FILE *)SYNCTEX_FILE, synctex_ctxt.busy_name);
+ } else {
+ gzclose((gzFile)SYNCTEX_FILE);
+ }
+ remove(synctex_ctxt.busy_name);
+ }
+ SYNCTEX_FILE = NULL;
+ }
+ if (SYNCTEX_NO_GZ) {
+ /* Remove any compressed synctex file, from a previous build. */
+ strcat(the_real_syncname, synctex_suffix_gz);
+ remove(the_real_syncname);
+ }
+ SYNCTEX_FREE(synctex_ctxt.busy_name);
+ synctex_ctxt.busy_name = NULL;
+ SYNCTEX_FREE(the_real_syncname);
+ SYNCTEX_FREE(tmp);
+ synctex_abort();
+}
+
+static inline int synctex_record_content(void);
+static inline int synctex_record_settings(void);
+static inline int synctex_record_sheet(integer sheet);
+
+/* Recording the "{..." line. In *tex.web, use synctex_sheet(pdf_output) at
+ * the very beginning of the ship_out procedure.
+*/
+void synctex_sheet(integer mag)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexsheet %i\n",mag);
+#endif
+ if (SYNCTEX_IS_OFF) {
+ if(SYNCTEX_VALUE && !SYNCTEX_WARNING_DISABLE) {
+ SYNCTEX_WARNING_DISABLE = SYNCTEX_YES;
+ printf("\nSyncTeX warning: Synchronization was disabled from\nthe command line with -synctex=0\nChanging the value of \\synctex has no effect.");
+ }
+ return;
+ }
+ if (SYNCTEX_FILE || (SYNCTEX_VALUE && (SYNCTEX_NO_ERROR != synctex_dot_open()))) {
+ /* First possibility: the .synctex file is already open because SyncTeX was activated on the CLI
+ * or it was activated with the \synctex macro and the first page is already shipped out.
+ * Second possibility: tries to open the .synctex, useful if synchronization was enabled
+ * from the source file and not from the CLI.
+ * totalpages is defined in tex.web */
+ if (totalpages == 0) {
+ /* Now it is time to properly set up the scale factor. */
+ if(mag>0) {
+ synctex_ctxt.magnification = mag;
+ }
+ if(SYNCTEX_NO_ERROR != synctex_record_settings()
+ || SYNCTEX_NO_ERROR != synctex_record_content()) {
+ synctex_abort();
+ return;
+ }
+ }
+ synctex_record_sheet(totalpages+1);
+ }
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexsheet END\n");
+#endif
+ return;
+}
+
+static inline int synctex_record_teehs(integer sheet);
+
+/* Recording the "}..." line. In *tex.web, use synctex_teehs at
+ * the very end of the ship_out procedure.
+*/
+void synctex_teehs(void)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexteehs\n");
+#endif
+ if (SYNCTEX_IS_OFF || !SYNCTEX_FILE ) {
+ return;
+ }
+ synctex_record_teehs(totalpages);/* not totalpages+1*/
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexteehs END\n");
+#endif
+ return;
+}
+
+static inline void synctex_record_vlist(halfword p);
+
+/* This message is sent when a vlist will be shipped out, more precisely at
+ * the beginning of the vliSYNCTEX_out procedure in *TeX.web. It will be balanced
+ * by a synctex_tsilv, sent at the end of the vliSYNCTEX_out procedure. p is the
+ * address of the vlist We assume that p is really a vlist node! */
+void synctex_vlist(halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexhlist\n");
+#endif
+ if (SYNCTEX_IGNORE(this_box)) {
+ return;
+ }
+ synctex_ctxt.node = this_box; /* 0 to reset */
+ synctex_ctxt.recorder = NULL; /* reset */
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(this_box,box_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(this_box,box_node_size);
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_record_vlist(this_box);
+}
+
+static inline void synctex_record_tsilv(halfword p);
+
+/* Recording a "f" line ending a vbox: this message is sent whenever a vlist
+ * has been shipped out. It is used to close the vlist nesting level. It is
+ * sent at the end of the vliSYNCTEX_out procedure in *TeX.web to balance a former
+ * synctex_vlist sent at the beginning of that procedure. */
+void synctex_tsilv(halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctextsilv\n");
+#endif
+ if (SYNCTEX_IGNORE(this_box)) {
+ return;
+ }
+ /* Ignoring any pending info to be recorded */
+ synctex_ctxt.node = this_box; /* 0 to reset */
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(this_box,box_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(this_box,box_node_size);
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_ctxt.recorder = NULL;
+ synctex_record_tsilv(this_box);
+}
+
+static inline void synctex_record_void_vlist(halfword p);
+
+/* This message is sent when a void vlist will be shipped out.
+ * There is no need to balance a void vlist. */
+void synctex_void_vlist(halfword p, halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexvoidvlist\n");
+#endif
+ if (SYNCTEX_IGNORE(p)) {
+ return;
+ }
+ synctex_ctxt.node = p; /* reset */
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,box_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,box_node_size);
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_ctxt.recorder = NULL; /* reset */
+ synctex_record_void_vlist(p);
+}
+
+static inline void synctex_record_hlist(halfword p);
+
+/* This message is sent when an hlist will be shipped out, more precisely at
+ * the beginning of the hliSYNCTEX_out procedure in *TeX.web. It will be balanced
+ * by a synctex_tsilh, sent at the end of the hliSYNCTEX_out procedure. p is the
+ * address of the hlist We assume that p is really an hlist node! */
+void synctex_hlist(halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexhlist\n");
+#endif
+ if (SYNCTEX_IGNORE(this_box)) {
+ return;
+ }
+ synctex_ctxt.node = this_box; /* 0 to reset */
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(this_box,box_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(this_box,box_node_size);
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_ctxt.recorder = NULL; /* reset */
+ synctex_record_hlist(this_box);
+}
+
+static inline void synctex_record_tsilh(halfword p);
+
+/* Recording a ")" line ending an hbox this message is sent whenever an hlist
+ * has been shipped out it is used to close the hlist nesting level. It is
+ * sent at the end of the hliSYNCTEX_out procedure in *TeX.web to balance a former
+ * synctex_hlist sent at the beginning of that procedure. */
+void synctex_tsilh(halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctextsilh\n");
+#endif
+ if (SYNCTEX_IGNORE(this_box)) {
+ return;
+ }
+ /* Ignoring any pending info to be recorded */
+ synctex_ctxt.node = this_box; /* 0 to force next node to be recorded! */
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(this_box,box_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(this_box,box_node_size);
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_ctxt.recorder = NULL; /* reset */
+ synctex_record_tsilh(this_box);
+}
+
+static inline void synctex_record_void_hlist(halfword p);
+
+/* This message is sent when a void hlist will be shipped out.
+ * There is no need to balance a void hlist. */
+void synctex_void_hlist(halfword p, halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexvoidhlist\n");
+#endif
+ if (SYNCTEX_IGNORE(p)) {
+ return;
+ }
+ /* the sync context has changed */
+ if (synctex_ctxt.recorder != NULL) {
+ /* but was not yet recorded */
+ (*synctex_ctxt.recorder) (synctex_ctxt.node);
+ }
+ synctex_ctxt.node = p; /* 0 to reset */
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,box_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,box_node_size);
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_ctxt.recorder = NULL; /* reset */
+ synctex_record_void_hlist(p);
+}
+
+/* glue code: these only work with nodes of size medium_node_size */
+# define small_node_size 3
+/* see: @d small_node_size=2 {number of words to allocate for most node types} */
+# define medium_node_size (small_node_size+synchronization_field_size)
+/* see: @d rule_node_size=4 */
+# /* define rule_node_size (4+synchronization_field_size)*/
+
+/* IN THE SEQUEL, ALL NODE ARE medium_node_size'd, UNTIL THE CONTRARY IS MENTIONNED */
+# undef SYNCTEX_IGNORE
+# define SYNCTEX_IGNORE(NODE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE \
+ || (0 >= SYNCTEX_TAG_MODEL(NODE,medium_node_size)) \
+ || (0 >= SYNCTEX_LINE_MODEL(NODE,medium_node_size))
+
+/* This macro will detect a change in the synchronization context. As long as
+ * the synchronization context remains the same, there is no need to write
+ * synchronization info: it would not help more. The synchronization context
+ * has changed when either the line number or the file tag has changed. */
+# define SYNCTEX_CONTEXT_DID_CHANGE(NODE) ((0 == synctex_ctxt.node)\
+ || (SYNCTEX_TAG_MODEL(NODE,medium_node_size) != synctex_ctxt.tag)\
+ || (SYNCTEX_LINE_MODEL(NODE,medium_node_size) != synctex_ctxt.line))
+
+void synctex_math_recorder(halfword p);
+
+/* glue code this message is sent whenever an inline math node will ship out
+ See: @ @<Output the non-|char_node| |p| for... */
+void synctex_math(halfword p, halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexmath\n");
+#endif
+ if (SYNCTEX_IGNORE(p)) {
+ return;
+ }
+ if ((synctex_ctxt.recorder != NULL) && SYNCTEX_CONTEXT_DID_CHANGE(p)) {
+ /* the sync context did change */
+ (*synctex_ctxt.recorder) (synctex_ctxt.node);
+ }
+ synctex_ctxt.node = p;
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,medium_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,medium_node_size);
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_ctxt.recorder = NULL;/* no need to record once more */
+ synctex_math_recorder(p);/* always record synchronously */
+}
+
+static inline void synctex_record_glue(halfword p);
+static inline void synctex_record_kern(halfword p);
+static inline void synctex_record_rule(halfword p);
+
+/* this message is sent whenever an horizontal glue node or rule node ships out
+ See: move_past:... */
+# define SYNCTEX_IGNORE_RULE(NODE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE \
+ || (0 >= SYNCTEX_TAG_MODEL(NODE,rule_node_size)) \
+ || (0 >= SYNCTEX_LINE_MODEL(NODE,rule_node_size))
+void synctex_horizontal_rule_or_glue(halfword p, halfword this_box)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexglue\n");
+#endif
+ if (SYNCTEX_TYPE(p) == rule_node) { /* not medium_node_size so we can't use SYNCTEX_IGNORE */
+ if (SYNCTEX_IGNORE_RULE(p)) {
+ return;
+ }
+ }
+ else {
+ if (SYNCTEX_IGNORE(p)) {
+ return;
+ }
+ }
+ synctex_ctxt.node = p;
+ pos = synch_p_with_c(cur);
+ synctex_ctxt.curh = pos.h;
+ synctex_ctxt.curv = pos.v;
+ synctex_ctxt.recorder = NULL;
+ switch(SYNCTEX_TYPE(p)) {
+ case rule_node:
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,rule_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,rule_node_size);
+ synctex_record_rule(p);/* always record synchronously: maybe some text is outside the box */
+ break;
+ case glue_node:
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,medium_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,medium_node_size);
+ synctex_record_glue(p);/* always record synchronously: maybe some text is outside the box */
+ break;
+ case kern_node:
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,medium_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,medium_node_size);
+ synctex_record_kern(p);/* always record synchronously: maybe some text is outside the box */
+ break;
+ default:
+ printf("\nSynchronize ERROR: unknown node type %i\n",SYNCTEX_TYPE(p));
+ }
+}
+
+void synctex_kern_recorder(halfword p);
+
+/* this message is sent whenever a kern node ships out
+ See: @ @<Output the non-|char_node| |p| for... */
+void synctex_kern(halfword p, halfword this_box)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexkern\n");
+#endif
+ if (SYNCTEX_IGNORE(p)) {
+ return;
+ }
+ if (SYNCTEX_CONTEXT_DID_CHANGE(p)) {
+ /* the sync context has changed */
+ if (synctex_ctxt.recorder != NULL) {
+ /* but was not yet recorded */
+ (*synctex_ctxt.recorder) (synctex_ctxt.node);
+ }
+ if(synctex_ctxt.node == this_box) {
+ /* first node in the list */
+ synctex_ctxt.node = p;
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,medium_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,medium_node_size);
+ synctex_ctxt.recorder = &synctex_kern_recorder;
+ } else {
+ synctex_ctxt.node = p;
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,medium_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,medium_node_size);
+ synctex_ctxt.recorder = NULL;
+ /* always record when the context has just changed
+ * and when not the first node */
+ synctex_kern_recorder(p);
+ }
+ } else {
+ /* just update the geometry and type (for future improvements) */
+ synctex_ctxt.node = p;
+ synctex_ctxt.tag = SYNCTEX_TAG_MODEL(p,medium_node_size);
+ synctex_ctxt.line = SYNCTEX_LINE_MODEL(p,medium_node_size);
+ synctex_ctxt.recorder = &synctex_kern_recorder;
+ }
+}
+
+/* This last part is used as a tool to infer TeX behaviour,
+ * but not for direct synchronization. */
+# undef SYNCTEX_IGNORE
+# define SYNCTEX_IGNORE(NODE) SYNCTEX_IS_OFF || !SYNCTEX_VALUE || !SYNCTEX_FILE \
+ || (synctex_ctxt.count>2000)
+
+void synctex_char_recorder(halfword p);
+
+/* this message is sent whenever a char node ships out */
+void synctexchar(halfword p, halfword this_box)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexchar\n");
+#endif
+ if (SYNCTEX_IGNORE(p)) {
+ return;
+ }
+ if (synctex_ctxt.recorder != NULL) {
+ /* but was not yet recorded */
+ (*synctex_ctxt.recorder) (synctex_ctxt.node);
+ }
+ synctex_ctxt.node = p;
+ synctex_ctxt.tag = 0;
+ synctex_ctxt.line = 0;
+ synctex_ctxt.recorder = NULL;
+ /* always record when the context has just changed */
+ synctex_char_recorder(p);
+}
+
+void synctex_node_recorder(halfword p);
+
+# undef SYNCTEX_IGNORE
+# define SYNCTEX_IGNORE(NODE) (SYNCTEX_IS_OFF || !SYNCTEX_VALUE || !SYNCTEX_FILE)
+
+/* this message should be sent to record information
+ for a node of an unknown type */
+void synctexnode(halfword p, halfword this_box)
+{
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexnode\n");
+#endif
+ if (SYNCTEX_IGNORE(p)) {
+ return;
+ }
+ /* always record, not very usefull yet */
+ synctex_node_recorder(p);
+}
+
+/* this message should be sent to record information
+ synchronously for the current location */
+void synctex_current(void)
+{
+ scaledpos pos;
+ SYNCTEX_RETURN_IF_DISABLED;
+#if SYNCTEX_DEBUG
+ printf("\nSynchronize DEBUG: synctexcurrent\n");
+#endif
+ if (SYNCTEX_IGNORE(nothing)) {
+ return;
+ } else {
+ pos = synch_p_with_c(cur);
+ size_t len = SYNCTEX_fprintf(SYNCTEX_FILE,"x%i,%i:%i,%i\n",
+ synctex_ctxt.tag,synctex_ctxt.line,
+ pos.h UNIT,pos.v UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ return;
+ }
+ }
+ synctex_abort();
+ return;
+}
+
+#pragma mark -
+#pragma mark Glue code Recorders
+
+/* Recording the settings */
+static inline int synctex_record_settings(void)
+{
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_settings\n");
+#endif
+ if(NULL == SYNCTEX_FILE) {
+ return SYNCTEX_NOERR;
+ }
+ if(SYNCTEX_FILE) {
+ size_t len = SYNCTEX_fprintf(SYNCTEX_FILE,"Output:%s\nMagnification:%i\nUnit:%i\nX Offset:%i\nY Offset:%i\n",
+ SYNCTEX_OUTPUT,synctex_ctxt.magnification,synctex_ctxt.unit,
+ ((SYNCTEX_OFFSET_IS_PDF != 0) ? 0 : 4736287 UNIT),
+ ((SYNCTEX_OFFSET_IS_PDF != 0) ? 0 : 4736287 UNIT));
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ return SYNCTEX_NOERR;
+ }
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "SyncTeX..." line */
+static inline int synctex_record_preamble(void)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_preamble\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"SyncTeX Version:%i\n",SYNCTEX_VERSION);
+ if(len>0) {
+ synctex_ctxt.total_length = len;
+ return SYNCTEX_NOERR;
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "Input:..." line */
+static inline int synctex_record_input(integer tag, char *name)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_input\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"Input:%i:%s\n",tag,name);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ return SYNCTEX_NOERR;
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "!..." line */
+static inline int synctex_record_anchor(void)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_anchor\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"!%i\n",synctex_ctxt.total_length);
+ if(len>0) {
+ synctex_ctxt.total_length = len;
+ ++synctex_ctxt.count;
+ return SYNCTEX_NOERR;
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "Content" line */
+static inline int synctex_record_content(void)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_content\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"Content:\n");
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ return SYNCTEX_NOERR;
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "{..." line */
+static inline int synctex_record_sheet(integer sheet)
+{
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_sheet\n");
+#endif
+ if(SYNCTEX_NOERR == synctex_record_anchor()) {
+ size_t len = SYNCTEX_fprintf(SYNCTEX_FILE,"{%i\n",sheet);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return SYNCTEX_NOERR;
+ }
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "}..." line */
+static inline int synctex_record_teehs(integer sheet)
+{
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_teehs\n");
+#endif
+ if(SYNCTEX_NOERR == synctex_record_anchor()) {
+ size_t len = SYNCTEX_fprintf(SYNCTEX_FILE,"}%i\n",sheet);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return SYNCTEX_NOERR;
+ }
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "v..." line */
+static inline void synctex_record_void_vlist(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_void_vlist\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"v%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box_node_size),
+ SYNCTEX_LINE_MODEL(p,box_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "[..." line */
+static inline void synctex_record_vlist(halfword p)
+{
+ size_t len = 0;
+ SYNCTEX_NOT_VOID = SYNCTEX_YES;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_vlist\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"[%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box_node_size),
+ SYNCTEX_LINE_MODEL(p,box_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "]..." line */
+static inline void synctex_record_tsilv(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_tsilv\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"]\n");
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "h..." line */
+static inline void synctex_record_void_hlist(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_void_hlist\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"h%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box_node_size),
+ SYNCTEX_LINE_MODEL(p,box_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "(..." line */
+static inline void synctex_record_hlist(halfword p)
+{
+ size_t len = 0;
+ SYNCTEX_NOT_VOID = SYNCTEX_YES;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_hlist\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"(%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,box_node_size),
+ SYNCTEX_LINE_MODEL(p,box_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ SYNCTEX_WIDTH(p) UNIT,
+ SYNCTEX_HEIGHT(p) UNIT,
+ SYNCTEX_DEPTH(p) UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a ")..." line */
+static inline void synctex_record_tsilh(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_tsilh\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,")\n");
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "Count..." line */
+static inline int synctex_record_count(void) {
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_count\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"Count:%i\n",synctex_ctxt.count);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ return SYNCTEX_NOERR;
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "Postamble" section */
+static inline int synctex_record_postamble(void)
+{
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_postamble\n");
+#endif
+ if(SYNCTEX_NOERR == synctex_record_anchor()) {
+ size_t len = SYNCTEX_fprintf(SYNCTEX_FILE,"Postamble:\n");
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ if(synctex_record_count() || synctex_record_anchor()) {
+ } else {
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"Post scriptum:\n");
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ return SYNCTEX_NOERR;
+ }
+ }
+ }
+ }
+ synctex_abort();
+ return -1;
+}
+
+/* Recording a "g..." line */
+static inline void synctex_record_glue(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_glue_recorder\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"g%i,%i:%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,medium_node_size),
+ SYNCTEX_LINE_MODEL(p,medium_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "k..." line */
+static inline void synctex_record_kern(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_kern_recorder\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"k%i,%i:%i,%i:%i\n",
+ SYNCTEX_TAG_MODEL(p,medium_node_size),
+ SYNCTEX_LINE_MODEL(p,medium_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ SYNCTEX_WIDTH(p) UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "r..." line */
+static inline void synctex_record_rule(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_record_tsilh\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"r%i,%i:%i,%i:%i,%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,rule_node_size),
+ SYNCTEX_LINE_MODEL(p,rule_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ rulewd UNIT,
+ ruleht UNIT,
+ ruledp UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+
+#pragma mark -
+#pragma mark Recorders
+
+/* Recording a "$..." line */
+void synctex_math_recorder(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_math_recorder\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"$%i,%i:%i,%i\n",
+ SYNCTEX_TAG_MODEL(p,medium_node_size),
+ SYNCTEX_LINE_MODEL(p,medium_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "k..." line */
+void synctex_kern_recorder(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_kern_recorder\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"k%i,%i:%i,%i:%i\n",
+ SYNCTEX_TAG_MODEL(p,medium_node_size),
+ SYNCTEX_LINE_MODEL(p,medium_node_size),
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ SYNCTEX_WIDTH(p) UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "c..." line */
+void synctex_char_recorder(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_char_recorder\n");
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"c%i,%i\n",
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+/* Recording a "?..." line, type, subtype and position */
+void synctex_node_recorder(halfword p)
+{
+ size_t len = 0;
+#if SYNCTEX_DEBUG > 999
+ printf("\nSynchronize DEBUG: synctex_node_recorder(0x%x)\n",p);
+#endif
+ len = SYNCTEX_fprintf(SYNCTEX_FILE,"?%i,%i:%i,%i\n",
+ synctex_ctxt.curh UNIT, synctex_ctxt.curv UNIT,
+ mem[p].hh.b0,mem[p].hh.b1);
+ if(len>0) {
+ synctex_ctxt.total_length += len;
+ ++synctex_ctxt.count;
+ return;
+ }
+ synctex_abort();
+ return;
+}
+
+# else
+# warning "SyncTeX is disabled"
+# endif
diff --git a/Build/source/texk/web2c/luatexdir/utils/synctex.h b/Build/source/texk/web2c/luatexdir/utils/synctex.h
new file mode 100644
index 00000000000..98b11447f20
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/utils/synctex.h
@@ -0,0 +1,113 @@
+/* synctex.h
+
+This file is part of the SyncTeX package.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE
+
+Acknowledgments:
+----------------
+The author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,
+and significant help from XeTeX developer Jonathan Kew
+
+Nota Bene:
+----------
+If you include or use a significant part of the synctex package into a software,
+I would appreciate to be listed as contributor and see "SyncTeX" highlighted.
+
+Version 1
+Thu Jun 19 09:39:21 UTC 2008
+
+*/
+
+# ifndef __SYNCTEX_HEADER__
+# define __SYNCTEX_HEADER__
+
+/* Send this message to init the synctex command value to the command line option.
+ * Sending this message too early will cause a bus error. */
+extern void synctex_init_command(void);
+
+/* Send this message to clean memory, and close the file. */
+extern void synctex_terminate(int log_opened);
+
+/* Send this message when starting a new input. */
+extern void synctex_start_input(void);
+
+/* Recording the "{..." line. In *tex.web, use synctex_sheet(pdf_output) at
+ * the very beginning of the ship_out procedure.
+*/
+extern void synctex_sheet(integer mag);
+
+/* Recording the "}..." line. In *tex.web, use synctex_teehs at
+ * the very end of the ship_out procedure.
+*/
+extern void synctex_teehs(void);
+
+/* This message is sent when a vlist will be shipped out, more precisely at
+ * the beginning of the vlist_out procedure in *TeX.web. It will be balanced
+ * by a synctex_tsilv, sent at the end of the vlist_out procedure. p is the
+ * address of the vlist We assume that p is really a vlist node! */
+extern void synctex_vlist(halfword this_box);
+
+/* Recording a "}" line ending a vbox: this message is sent whenever a vlist
+ * has been shipped out. It is used to close the vlist nesting level. It is
+ * sent at the end of each vlist_out procedure in *TeX.web to balance a former
+ * synctex_vlist sent at the beginning of that procedure. */
+extern void synctex_tsilv(halfword this_box);
+
+/* This message is sent when a void vlist will be shipped out.
+ * There is no need to balance a void vlist. */
+extern void synctex_void_vlist(halfword p, halfword this_box);
+
+/* Send this message when an hlist will be shipped out, more precisely at
+ * the beginning of the hlist_out procedure in *TeX.web. It must be balanced
+ * by a synctex_tsilh, sent at the end of the hlist_out procedure. p is the
+ * address of the hlist. */
+extern void synctex_hlist(halfword this_box);
+
+/* Send this message at the end of the various hlist_out procedure in *TeX.web
+ * to balance a former synctex_hlist. */
+extern void synctex_tsilh(halfword this_box);
+
+/* This message is sent when a void hlist will be shipped out.
+ * There is no need to balance a void hlist. */
+extern void synctex_void_hlist(halfword p, halfword this_box);
+
+/* Send this message whenever an inline math node will ship out. */
+extern void synctex_math(halfword p, halfword this_box);
+
+/* Send this message whenever an horizontal rule or glue node will ship out. */
+extern void synctex_horizontal_rule_or_glue(halfword p, halfword this_box);
+
+/* Send this message whenever a kern node will ship out. */
+extern void synctex_kern(halfword p, halfword this_box);
+
+/* this message is sent whenever a char node ships out */
+extern void synctex_char(halfword p, halfword this_box);
+
+/* this message should be sent to record information
+ for a node of an unknown type */
+extern void synctex_node(halfword p, halfword this_box);
+
+/* For debugging purpose only */
+extern void synctex_current(void);
+
+# endif
diff --git a/Build/source/texk/web2c/luatexdir/utils.c b/Build/source/texk/web2c/luatexdir/utils/utils.c
index 707ac7855f9..1096d9c08e9 100644
--- a/Build/source/texk/web2c/luatexdir/utils.c
+++ b/Build/source/texk/web2c/luatexdir/utils/utils.c
@@ -1,30 +1,33 @@
-/*
-Copyright (c) 1996-2006 Han The Thanh, <thanh@pdftex.org>
+/* utils.c
-This file is part of pdfTeX.
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2009 Taco Hoekwater <taco@luatex.org>
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This file is part of LuaTeX.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-$Id$
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
+
+#include "openbsd-compat.h"
+#ifdef HAVE_ASPRINTF /* asprintf is not defined in openbsd-compat.h, but in stdio.h */
+# include <stdio.h>
+#endif
#include "sys/types.h"
#ifndef __MINGW32__
-#include "sysexits.h"
+# include "sysexits.h"
#else
-#define EX_SOFTWARE 70
+# define EX_SOFTWARE 70
#endif
#include "md5.h"
#include <kpathsea/c-proto.h>
@@ -36,12 +39,12 @@ $Id$
#include "zlib.h"
#include "ptexlib.h"
-#include "svnversion.h"
-
-#include "openbsd-compat.h"
#include "png.h"
#include "xpdf/config.h" /* just to get the xpdf version */
+static const char __svn_version[] =
+ "$Id: utils.c 2085 2009-03-22 15:21:50Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/utils/utils.c $";
+
#define check_nprintf(size_get, size_want) \
if ((unsigned)(size_get) >= (unsigned)(size_want)) \
pdftex_fail ("snprintf failed: file %s, line %d", __FILE__, __LINE__);
@@ -59,29 +62,29 @@ size_t last_ptr_index; /* for use with alloc_array */
/* define fb_ptr, fb_array & fb_limit */
typedef char fb_entry;
-define_array (fb);
+define_array(fb);
/* define char_ptr, char_array & char_limit */
typedef char char_entry;
-define_array (char);
+define_array(char);
-integer fb_offset (void)
+integer fb_offset(void)
{
return fb_ptr - fb_array;
}
-void fb_seek (integer offset)
+void fb_seek(integer offset)
{
fb_ptr = fb_array + offset;
}
-void fb_putchar (eight_bits b)
+void fb_putchar(eight_bits b)
{
- alloc_array (fb, 1, SMALL_ARRAY_SIZE);
+ alloc_array(fb, 1, SMALL_ARRAY_SIZE);
*fb_ptr++ = b;
}
-void fb_flush (void)
+void fb_flush(void)
{
fb_entry *p;
integer n;
@@ -89,10 +92,10 @@ void fb_flush (void)
n = pdf_buf_size - pdf_ptr;
if (fb_ptr - p < n)
n = fb_ptr - p;
- memcpy (pdf_buf + pdf_ptr, p, (unsigned) n);
+ memcpy(pdf_buf + pdf_ptr, p, (unsigned) n);
pdf_ptr += n;
if (pdf_ptr == pdf_buf_size)
- pdf_flush ();
+ pdf_flush();
p += n;
}
fb_ptr = fb_array;
@@ -104,7 +107,7 @@ void make_subset_tag(fd_entry * fd)
int i, j = 0, a[SUBSET_TAG_LENGTH];
md5_state_t pms;
char *glyph;
- glw_entry *glw_glyph;
+ glw_entry *glw_glyph;
struct avl_traverser t;
md5_byte_t digest[16];
void **aa;
@@ -119,21 +122,21 @@ void make_subset_tag(fd_entry * fd)
do {
md5_init(&pms);
avl_t_init(&t, fd->gl_tree);
- if (is_cidkeyed(fd->fm)) { /* glw_entry items */
- for (glw_glyph = (glw_entry *) avl_t_first(&t, fd->gl_tree); glw_glyph != NULL;
- glw_glyph = (glw_entry *) avl_t_next(&t)) {
- glyph = malloc(12);
- sprintf(glyph,"%05u%05u ",glw_glyph->id,glw_glyph->wd);
- md5_append(&pms, (md5_byte_t *) glyph, strlen(glyph));
- free(glyph);
- }
- } else {
- for (glyph = (char *) avl_t_first(&t, fd->gl_tree); glyph != NULL;
- glyph = (char *) avl_t_next(&t)) {
- md5_append(&pms, (md5_byte_t *) glyph, strlen(glyph));
- md5_append(&pms, (md5_byte_t *) " ", 1);
- }
- }
+ if (is_cidkeyed(fd->fm)) { /* glw_entry items */
+ for (glw_glyph = (glw_entry *) avl_t_first(&t, fd->gl_tree);
+ glw_glyph != NULL; glw_glyph = (glw_entry *) avl_t_next(&t)) {
+ glyph = malloc(24);
+ sprintf(glyph, "%05u%05u ", glw_glyph->id, glw_glyph->wd);
+ md5_append(&pms, (md5_byte_t *) glyph, strlen(glyph));
+ free(glyph);
+ }
+ } else {
+ for (glyph = (char *) avl_t_first(&t, fd->gl_tree); glyph != NULL;
+ glyph = (char *) avl_t_next(&t)) {
+ md5_append(&pms, (md5_byte_t *) glyph, strlen(glyph));
+ md5_append(&pms, (md5_byte_t *) " ", 1);
+ }
+ }
md5_append(&pms, (md5_byte_t *) fd->fontname, strlen(fd->fontname));
md5_append(&pms, (md5_byte_t *) & j, sizeof(int)); /* to resolve collision */
md5_finish(&pms, digest);
@@ -156,315 +159,319 @@ void make_subset_tag(fd_entry * fd)
j);
}
-void pdf_puts (const char *s)
+void pdf_puts(const char *s)
{
- pdfroom (strlen (s) + 1);
+ pdfroom(strlen(s) + 1);
while (*s)
pdf_buf[pdf_ptr++] = *s++;
}
-__attribute__ ((format (printf, 1, 2)))
-void pdf_printf (const char *fmt, ...)
+__attribute__ ((format(printf, 1, 2)))
+void pdf_printf(const char *fmt, ...)
{
va_list args;
- va_start (args, fmt);
- vsnprintf (print_buf, PRINTF_BUF_SIZE, fmt, args);
- pdf_puts (print_buf);
- va_end (args);
+ va_start(args, fmt);
+ vsnprintf(print_buf, PRINTF_BUF_SIZE, fmt, args);
+ pdf_puts(print_buf);
+ va_end(args);
}
-strnumber maketexstring (const char *s)
+strnumber maketexstring(const char *s)
{
- if (s == NULL || *s == 0)
- return get_nullstr ();
- return maketexlstring(s,strlen(s));
+ if (s == NULL || *s == 0)
+ return get_nullstr();
+ return maketexlstring(s, strlen(s));
}
-strnumber maketexlstring (const char *s, size_t l)
+strnumber maketexlstring(const char *s, size_t l)
{
if (s == NULL || l == 0)
- return get_nullstr ();
- check_pool_overflow (pool_ptr + l);
+ return get_nullstr();
+ check_pool_overflow(pool_ptr + l);
while (l-- > 0)
str_pool[pool_ptr++] = *s++;
- last_tex_string = make_string ();
+ last_tex_string = make_string();
return last_tex_string;
}
-
/* print a C string through TeX */
-void
-print_string (char *j) {
- while (*j) {
- print_char(*j);
- j++;
- }
+void print_string(char *j)
+{
+ while (*j) {
+ print_char(*j);
+ j++;
+ }
}
/* append a C string to a TeX string */
-void
-append_string (char *s) {
- if (s == NULL || *s == 0)
- return;
- check_buf (pool_ptr + strlen(s), pool_size);
- while (*s)
- str_pool[pool_ptr++] = *s++;
- return;
+void append_string(char *s)
+{
+ if (s == NULL || *s == 0)
+ return;
+ check_buf(pool_ptr + strlen(s), pool_size);
+ while (*s)
+ str_pool[pool_ptr++] = *s++;
+ return;
}
-__attribute__ ((format (printf, 1, 2)))
-void tex_printf (const char *fmt, ...)
+__attribute__ ((format(printf, 1, 2)))
+void tex_printf(const char *fmt, ...)
{
va_list args;
- va_start (args, fmt);
- vsnprintf (print_buf, PRINTF_BUF_SIZE, fmt, args);
- print_string (print_buf);
- xfflush (stdout);
- va_end (args);
+ va_start(args, fmt);
+ vsnprintf(print_buf, PRINTF_BUF_SIZE, fmt, args);
+ print_string(print_buf);
+ xfflush(stdout);
+ va_end(args);
}
/* Helper for pdftex_fail. */
-static void safe_print (const char *str)
+static void safe_print(const char *str)
{
const char *c;
for (c = str; *c; ++c)
- print (*c);
+ print(*c);
}
-void remove_pdffile (void)
+void remove_pdffile(void)
{
if (!kpathsea_debug && output_file_name && !fixed_pdf_draftmode) {
- xfclose (pdf_file, makecstring (output_file_name));
- remove (makecstring (output_file_name));
+ xfclose(pdf_file, makecstring(output_file_name));
+ remove(makecstring(output_file_name));
}
}
/* pdftex_fail may be called when a buffer overflow has happened/is
happening, therefore may not call mktexstring. However, with the
current implementation it appears that error messages are misleading,
- possibly because pool overflows are detected too late.
+ possibly because pool overflows are detected too late.
The output format of this fuction must be the same as pdf_error in
pdftex.web! */
-__attribute__ ((noreturn, format (printf, 1, 2)))
-void pdftex_fail (const char *fmt, ...)
+__attribute__ ((noreturn, format(printf, 1, 2)))
+void pdftex_fail(const char *fmt, ...)
{
va_list args;
- va_start (args, fmt);
- print_ln ();
- safe_print ("!luaTeX error");
+ va_start(args, fmt);
+ print_ln();
+ safe_print("!LuaTeX error");
if (cur_file_name) {
- safe_print (" (file ");
- safe_print (cur_file_name);
- safe_print (")");
+ safe_print(" (file ");
+ safe_print(cur_file_name);
+ safe_print(")");
}
- safe_print (": ");
- vsnprintf (print_buf, PRINTF_BUF_SIZE, fmt, args);
- safe_print (print_buf);
- va_end (args);
- print_ln ();
+ safe_print(": ");
+ vsnprintf(print_buf, PRINTF_BUF_SIZE, fmt, args);
+ safe_print(print_buf);
+ va_end(args);
+ print_ln();
remove_pdffile();
- safe_print (" ==> Fatal error occurred, no output PDF file produced!");
- print_ln ();
+ safe_print(" ==> Fatal error occurred, no output PDF file produced!");
+ print_ln();
if (kpathsea_debug) {
- abort ();
+ abort();
} else {
- exit (EX_SOFTWARE);
+ exit(EX_SOFTWARE);
}
}
/* The output format of this fuction must be the same as pdf_warn in
pdftex.web! */
-__attribute__ ((format (printf, 1, 2)))
-void pdftex_warn (const char *fmt, ...)
+__attribute__ ((format(printf, 1, 2)))
+void pdftex_warn(const char *fmt, ...)
{
va_list args;
- va_start (args, fmt);
- print_ln ();
- tex_printf ("luaTeX warning");
+ va_start(args, fmt);
+ print_ln();
+ tex_printf("LuaTeX warning");
if (cur_file_name)
- tex_printf (" (file %s)", cur_file_name);
- tex_printf (": ");
- vsnprintf (print_buf, PRINTF_BUF_SIZE, fmt, args);
- print_string (print_buf);
- va_end (args);
- print_ln ();
-}
-
-
-void tex_error(char *msg, char **hlp) {
- strnumber aa = 0,bb = 0,cc = 0,dd = 0,ee = 0;
- int k = 0;
- while (hlp[k]!=NULL)
- k++;
- if (k>0) aa =maketexstring(hlp[0]);
- if (k>1) bb =maketexstring(hlp[1]);
- if (k>2) cc =maketexstring(hlp[2]);
- if (k>3) dd =maketexstring(hlp[3]);
- if (k>4) ee =maketexstring(hlp[4]);
-
- do_print_err(maketexstring(msg));
- flush_str(last_tex_string);
-
- switch (k) {
- case 1: dohelp1(aa); break;
- case 2: dohelp2(aa,bb); break;
- case 3: dohelp3(aa,bb,cc); break;
- case 4: dohelp4(aa,bb,cc,dd); break;
- case 5: dohelp5(aa,bb,cc,dd,ee); break;
- }
- error();
+ tex_printf(" (file %s)", cur_file_name);
+ tex_printf(": ");
+ vsnprintf(print_buf, PRINTF_BUF_SIZE, fmt, args);
+ print_string(print_buf);
+ va_end(args);
+ print_ln();
+}
+
+void tex_error(char *msg, char **hlp)
+{
+ strnumber aa = 0, bb = 0, cc = 0, dd = 0, ee = 0;
+ int k = 0;
+ if (hlp != NULL) {
+ while (hlp[k] != NULL)
+ k++;
+ if (k > 0)
+ aa = maketexstring(hlp[0]);
+ if (k > 1)
+ bb = maketexstring(hlp[1]);
+ if (k > 2)
+ cc = maketexstring(hlp[2]);
+ if (k > 3)
+ dd = maketexstring(hlp[3]);
+ if (k > 4)
+ ee = maketexstring(hlp[4]);
+ }
+ do_print_err(maketexstring(msg));
+ flush_str(last_tex_string);
+
+/* *INDENT-OFF* */
+ switch (k) {
+ case 0: dohelp0(); break;
+ case 1: dohelp1(aa); break;
+ case 2: dohelp2(aa, bb); break;
+ case 3: dohelp3(aa, bb, cc); break;
+ case 4: dohelp4(aa, bb, cc, dd); break;
+ case 5: dohelp5(aa, bb, cc, dd, ee); break;
+ }
+/* *INDENT-ON* */
+ error();
- if (ee) flush_str(ee);
- if (dd) flush_str(dd);
- if (cc) flush_str(cc);
- if (bb) flush_str(bb);
- if (aa) flush_str(aa);
+ if (ee)
+ flush_str(ee);
+ if (dd)
+ flush_str(dd);
+ if (cc)
+ flush_str(cc);
+ if (bb)
+ flush_str(bb);
+ if (aa)
+ flush_str(aa);
}
-
-void garbage_warning (void)
+void garbage_warning(void)
{
- pdftex_warn ("dangling objects discarded, no output file produced.");
- remove_pdffile ();
+ pdftex_warn("dangling objects discarded, no output file produced.");
+ remove_pdffile();
}
-char *makecstring (integer s) {
- int l;
- return makeclstring(s,&l);
+char *makecstring(integer s)
+{
+ size_t l;
+ return makeclstring(s, &l);
}
-
-char *makeclstring (integer s, int *len)
+char *makeclstring(integer s, size_t * len)
{
static char *cstrbuf = NULL;
char *p;
static int allocsize;
int allocgrow, i, l;
- if (s >=2097152) {
- s -= 2097152;
- l = str_start[s + 1] - str_start[s];
- *len = l;
- check_buf (l + 1, MAX_CSTRING_LEN);
- if (cstrbuf == NULL) {
- allocsize = l + 1;
- cstrbuf = xmallocarray (char, allocsize);
- } else if (l + 1 > allocsize) {
- allocgrow = allocsize * 0.2;
- if (l + 1 - allocgrow > allocsize)
- allocsize = l + 1;
- else if (allocsize < MAX_CSTRING_LEN - allocgrow)
- allocsize += allocgrow;
- else
- allocsize = MAX_CSTRING_LEN;
- cstrbuf = xreallocarray (cstrbuf, char, allocsize);
- }
- p = cstrbuf;
- for (i = 0; i < l; i++)
- *p++ = str_pool[i + str_start[s]];
- *p = 0;
+ if (s >= 2097152) {
+ s -= 2097152;
+ l = str_start[s + 1] - str_start[s];
+ *len = l;
+ check_buf(l + 1, MAX_CSTRING_LEN);
+ if (cstrbuf == NULL) {
+ allocsize = l + 1;
+ cstrbuf = xmallocarray(char, allocsize);
+ } else if (l + 1 > allocsize) {
+ allocgrow = allocsize * 0.2;
+ if (l + 1 - allocgrow > allocsize)
+ allocsize = l + 1;
+ else if (allocsize < MAX_CSTRING_LEN - allocgrow)
+ allocsize += allocgrow;
+ else
+ allocsize = MAX_CSTRING_LEN;
+ cstrbuf = xreallocarray(cstrbuf, char, allocsize);
+ }
+ p = cstrbuf;
+ for (i = 0; i < l; i++)
+ *p++ = str_pool[i + str_start[s]];
+ *p = 0;
} else {
- if (cstrbuf == NULL) {
- allocsize = 5;
- cstrbuf = xmallocarray (char, allocsize);
- }
- if (s <= 0x7F) {
- cstrbuf[0] = s;
- cstrbuf[1] = 0;
- *len = 1;
- } else if (s <= 0x7FF ) {
- cstrbuf[0] = 0xC0 + (s / 0x40);
- cstrbuf[1] = 0x80 + (s % 0x40);
- cstrbuf[2] = 0;
- *len = 2;
- } else if (s <= 0xFFFF ) {
- cstrbuf[0] = 0xE0 + (s / 0x1000);
- cstrbuf[1] = 0x80 + ((s % 0x1000) / 0x40);
- cstrbuf[2] = 0x80 + ((s % 0x1000) % 0x40);
- cstrbuf[3] = 0;
- *len = 3;
- } else {
- if (s >= 0x10FF00) {
- cstrbuf[0] = s-0x10FF00;
- cstrbuf[1] = 0;
- *len = 1;
- } else {
- cstrbuf[0] = 0xF0 + (s / 0x40000);
- cstrbuf[1] = 0x80 + ((s % 0x40000) / 0x1000);
- cstrbuf[2] = 0x80 + (((s % 0x40000) % 0x1000) / 0x40);
- cstrbuf[3] = 0x80 + (((s % 0x40000) % 0x1000) % 0x40);
- cstrbuf[4] = 0;
- *len = 4;
- }
- }
+ if (cstrbuf == NULL) {
+ allocsize = 5;
+ cstrbuf = xmallocarray(char, allocsize);
+ }
+ if (s <= 0x7F) {
+ cstrbuf[0] = s;
+ cstrbuf[1] = 0;
+ *len = 1;
+ } else if (s <= 0x7FF) {
+ cstrbuf[0] = 0xC0 + (s / 0x40);
+ cstrbuf[1] = 0x80 + (s % 0x40);
+ cstrbuf[2] = 0;
+ *len = 2;
+ } else if (s <= 0xFFFF) {
+ cstrbuf[0] = 0xE0 + (s / 0x1000);
+ cstrbuf[1] = 0x80 + ((s % 0x1000) / 0x40);
+ cstrbuf[2] = 0x80 + ((s % 0x1000) % 0x40);
+ cstrbuf[3] = 0;
+ *len = 3;
+ } else {
+ if (s >= 0x10FF00) {
+ cstrbuf[0] = s - 0x10FF00;
+ cstrbuf[1] = 0;
+ *len = 1;
+ } else {
+ cstrbuf[0] = 0xF0 + (s / 0x40000);
+ cstrbuf[1] = 0x80 + ((s % 0x40000) / 0x1000);
+ cstrbuf[2] = 0x80 + (((s % 0x40000) % 0x1000) / 0x40);
+ cstrbuf[3] = 0x80 + (((s % 0x40000) % 0x1000) % 0x40);
+ cstrbuf[4] = 0;
+ *len = 4;
+ }
+ }
}
return cstrbuf;
}
-void set_job_id (int year, int month, int day, int time)
+void set_job_id(int year, int month, int day, int time)
{
char *name_string, *format_string, *s;
size_t slen;
- int i;
+ int i;
if (job_id_string != NULL)
return;
- name_string = xstrdup (makecstring (job_name));
- format_string = xstrdup (makecstring (format_ident));
+ name_string = xstrdup(makecstring(job_name));
+ format_string = xstrdup(makecstring(format_ident));
slen = SMALL_BUF_SIZE +
- strlen (name_string) +
- strlen (format_string) +
- strlen (ptexbanner) +
- strlen (versionstring) + strlen (kpathsea_version_string);
- s = xtalloc (slen, char);
+ strlen(name_string) +
+ strlen(format_string) +
+ strlen(ptexbanner) +
+ strlen(versionstring) + strlen(kpathsea_version_string);
+ s = xtalloc(slen, char);
/* The Web2c version string starts with a space. */
- i = snprintf (s, slen,
- "%.4d/%.2d/%.2d %.2d:%.2d %s %s %s%s %s",
- year, month, day, time / 60, time % 60,
- name_string, format_string, ptexbanner,
- versionstring, kpathsea_version_string);
- check_nprintf(i,slen);
- job_id_string = xstrdup (s);
- xfree (s);
- xfree (name_string);
- xfree (format_string);
-}
-
-int get_build_revision (void) {
- int revision;
- if(sscanf (BUILD_REVISION,"$Revision: %d $", &revision)) {
- return revision;
- }
- return 0;
+ i = snprintf(s, slen,
+ "%.4d/%.2d/%.2d %.2d:%.2d %s %s %s%s %s",
+ year, month, day, time / 60, time % 60,
+ name_string, format_string, ptexbanner,
+ versionstring, kpathsea_version_string);
+ check_nprintf(i, slen);
+ job_id_string = xstrdup(s);
+ xfree(s);
+ xfree(name_string);
+ xfree(format_string);
}
-void make_pdftex_banner (void)
+void make_pdftex_banner(void)
{
static boolean pdftexbanner_init = false;
char *s;
size_t slen;
- int i;
+ int i;
if (pdftexbanner_init)
return;
slen = SMALL_BUF_SIZE +
- strlen (ptexbanner) +
- strlen (versionstring) + strlen (kpathsea_version_string);
- s = xtalloc (slen, char);
+ strlen(ptexbanner) +
+ strlen(versionstring) + strlen(kpathsea_version_string);
+ s = xtalloc(slen, char);
/* The Web2c version string starts with a space. */
- i = snprintf (s, slen,
- "%s%s %s", ptexbanner, versionstring, kpathsea_version_string);
- check_nprintf (i, slen);
- pdftex_banner = maketexstring (s);
- xfree (s);
+ i = snprintf(s, slen,
+ "%s%s %s", ptexbanner, versionstring, kpathsea_version_string);
+ check_nprintf(i, slen);
+ pdftex_banner = maketexstring(s);
+ xfree(s);
pdftexbanner_init = true;
}
-strnumber get_resname_prefix (void)
+strnumber get_resname_prefix(void)
{
/* static char name_str[] = */
/* "!\"$&'*+,-.0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\" */
@@ -474,59 +481,59 @@ strnumber get_resname_prefix (void)
char prefix[7]; /* make a tag of 6 chars long */
unsigned long crc;
short i;
- size_t base = strlen (name_str);
- crc = crc32 (0L, Z_NULL, 0);
- crc = crc32 (crc, (Bytef *) job_id_string, strlen (job_id_string));
+ size_t base = strlen(name_str);
+ crc = crc32(0L, Z_NULL, 0);
+ crc = crc32(crc, (Bytef *) job_id_string, strlen(job_id_string));
for (i = 0; i < 6; i++) {
prefix[i] = name_str[crc % base];
crc /= base;
}
prefix[6] = 0;
- return maketexstring (prefix);
+ return maketexstring(prefix);
}
-size_t xfwrite (void *ptr, size_t size, size_t nmemb, FILE * stream)
+size_t xfwrite(void *ptr, size_t size, size_t nmemb, FILE * stream)
{
- if (fwrite (ptr, size, nmemb, stream) != nmemb)
- pdftex_fail ("fwrite() failed");
+ if (fwrite(ptr, size, nmemb, stream) != nmemb)
+ pdftex_fail("fwrite() failed");
return nmemb;
}
-int xfflush (FILE * stream)
+int xfflush(FILE * stream)
{
- if (fflush (stream) != 0)
- pdftex_fail ("fflush() failed");
+ if (fflush(stream) != 0)
+ pdftex_fail("fflush() failed (%s)", strerror(errno));
return 0;
}
-int xgetc (FILE * stream)
+int xgetc(FILE * stream)
{
- int c = getc (stream);
+ int c = getc(stream);
if (c < 0 && c != EOF)
- pdftex_fail ("getc() failed");
+ pdftex_fail("getc() failed (%s)", strerror(errno));
return c;
}
-int xputc (int c, FILE * stream)
+int xputc(int c, FILE * stream)
{
- int i = putc (c, stream);
+ int i = putc(c, stream);
if (i < 0)
- pdftex_fail ("putc() failed");
+ pdftex_fail("putc() failed (%s)", strerror(errno));
return i;
}
-void write_stream_length (integer length, integer offset)
+void write_stream_length(integer length, longinteger offset)
{
if (jobname_cstr == NULL)
- jobname_cstr = xstrdup (makecstring (job_name));
- if (fixed_pdf_draftmode == 0) {
- xfseek (pdf_file, offset, SEEK_SET, jobname_cstr);
- fprintf (pdf_file, "%li", (long int) length);
- xfseek (pdf_file, pdfoffset (), SEEK_SET, jobname_cstr);
- }
+ jobname_cstr = xstrdup(makecstring(job_name));
+ if (fixed_pdf_draftmode == 0) {
+ xfseeko(pdf_file, (off_t) offset, SEEK_SET, jobname_cstr);
+ fprintf(pdf_file, "%li", (long int) length);
+ xfseeko(pdf_file, (off_t) pdfoffset(), SEEK_SET, jobname_cstr);
+ }
}
-scaled ext_xn_over_d (scaled x, scaled n, scaled d)
+scaled ext_xn_over_d(scaled x, scaled n, scaled d)
{
double r = (((double) x) * ((double) n)) / ((double) d);
if (r > DBL_EPSILON)
@@ -534,23 +541,23 @@ scaled ext_xn_over_d (scaled x, scaled n, scaled d)
else
r -= 0.5;
if (r >= (double) maxinteger || r <= -(double) maxinteger)
- pdftex_warn ("arithmetic: number too big");
+ pdftex_warn("arithmetic: number too big");
return (scaled) r;
}
-void libpdffinish ()
+void libpdffinish()
{
- xfree (fb_array);
- xfree (char_array);
- xfree (job_id_string);
- fm_free ();
- t1_free ();
- enc_free ();
- epdf_free ();
- ttf_free ();
- sfd_free ();
- glyph_unicode_free ();
- zip_free ();
+ xfree(fb_array);
+ xfree(char_array);
+ xfree(job_id_string);
+ fm_free();
+ t1_free();
+ enc_free();
+ epdf_free();
+ ttf_free();
+ sfd_free();
+ glyph_unicode_free();
+ zip_free();
}
/* Converts any string given in in in an allowed PDF string which can be
@@ -559,7 +566,7 @@ void libpdffinish ()
* This assumes that the string does not contain any already escaped
* characters!
*/
-char *convertStringToPDFString (const char *in, int len)
+char *convertStringToPDFString(const char *in, int len)
{
static char pstrbuf[MAX_PSTRING_LEN];
char *out = pstrbuf;
@@ -567,12 +574,12 @@ char *convertStringToPDFString (const char *in, int len)
char buf[5];
j = 0;
for (i = 0; i < len; i++) {
- check_buf (j + sizeof (buf), MAX_PSTRING_LEN);
+ check_buf(j + sizeof(buf), MAX_PSTRING_LEN);
if (((unsigned char) in[i] < '!') || ((unsigned char) in[i] > '~')) {
/* convert control characters into oct */
- k = snprintf (buf, sizeof (buf),
- "\\%03o", (unsigned int) (unsigned char) in[i]);
- check_nprintf (k, sizeof (buf));
+ k = snprintf(buf, sizeof(buf),
+ "\\%03o", (unsigned int) (unsigned char) in[i]);
+ check_nprintf(k, sizeof(buf));
out[j++] = buf[0];
out[j++] = buf[1];
out[j++] = buf[2];
@@ -594,7 +601,6 @@ char *convertStringToPDFString (const char *in, int len)
return pstrbuf;
}
-
/* Converts any string given in in in an allowed PDF string which can be
* handled by printf et.al.: \ is escaped to \\, parenthesis are escaped and
* control characters are octal encoded.
@@ -603,11 +609,11 @@ char *convertStringToPDFString (const char *in, int len)
*
* See escapename for parameter description.
*/
-void escapestring (poolpointer in)
+void escapestring(poolpointer in)
{
const poolpointer out = pool_ptr;
unsigned char ch;
- int i;
+ int i;
while (in < out) {
if (pool_ptr + 4 >= pool_size) {
pool_ptr = pool_size;
@@ -619,9 +625,9 @@ void escapestring (poolpointer in)
if ((ch < '!') || (ch > '~')) {
/* convert control characters into oct */
- i = snprintf ((char *) &str_pool[pool_ptr], 5,
- "\\%.3o", (unsigned int) ch);
- check_nprintf (i, 5);
+ i = snprintf((char *) &str_pool[pool_ptr], 5,
+ "\\%.3o", (unsigned int) ch);
+ check_nprintf(i, 5);
pool_ptr += i;
continue;
}
@@ -634,10 +640,9 @@ void escapestring (poolpointer in)
}
}
-
/* Convert any given string in a PDF name using escaping mechanism
of PDF 1.2. The result does not include the leading slash.
-
+
PDF specification 1.6, section 3.2.6 "Name Objects" explains:
<blockquote>
Beginning with PDF 1.2, any character except null (character code 0) may
@@ -668,7 +673,7 @@ void escapestring (poolpointer in)
125 escaped delimiter "}"
127..255 escaped recommended
else copy regular characters
-
+
Parameter "in" is a pointer into the string pool where
the input string is located. The output string is written
as temporary string right after the input string.
@@ -676,11 +681,11 @@ void escapestring (poolpointer in)
"pool_ptr" points to the start of the output string and
after the end when the procedure returns.
*/
-void escapename (poolpointer in)
+void escapename(poolpointer in)
{
const poolpointer out = pool_ptr;
unsigned char ch;
- int i;
+ int i;
while (in < out) {
if (pool_ptr + 3 >= pool_size) {
@@ -693,9 +698,9 @@ void escapename (poolpointer in)
if ((ch >= 1 && ch <= 32) || ch >= 127) {
/* escape */
- i = snprintf ((char *) &str_pool[pool_ptr], 4,
- "#%.2X", (unsigned int) ch);
- check_nprintf (i, 4);
+ i = snprintf((char *) &str_pool[pool_ptr], 4,
+ "#%.2X", (unsigned int) ch);
+ check_nprintf(i, 4);
pool_ptr += i;
continue;
}
@@ -715,9 +720,9 @@ void escapename (poolpointer in)
case 123:
case 125:
/* escape */
- i = snprintf ((char *) &str_pool[pool_ptr], 4,
- "#%.2X", (unsigned int) ch);
- check_nprintf (i, 4);
+ i = snprintf((char *) &str_pool[pool_ptr], 4,
+ "#%.2X", (unsigned int) ch);
+ check_nprintf(i, 4);
pool_ptr += i;
break;
default:
@@ -729,17 +734,17 @@ void escapename (poolpointer in)
/* Convert any given string in a PDF hexadecimal string. The
result does not include the angle brackets.
-
+
This procedure uses uppercase hexadecimal letters.
-
+
See escapename for description of parameters.
*/
-void escapehex (poolpointer in)
+void escapehex(poolpointer in)
{
const poolpointer out = pool_ptr;
unsigned char ch;
- int i;
-
+ int i;
+
while (in < out) {
if (pool_ptr + 2 >= pool_size) {
pool_ptr = pool_size;
@@ -749,8 +754,9 @@ void escapehex (poolpointer in)
ch = (unsigned char) str_pool[in++];
- i = snprintf ((char *) &str_pool[pool_ptr], 3,"%.2X", (unsigned int) ch);
- check_nprintf (i, 3);
+ i = snprintf((char *) &str_pool[pool_ptr], 3, "%.2X",
+ (unsigned int) ch);
+ check_nprintf(i, 3);
pool_ptr += 2;
}
}
@@ -759,17 +765,17 @@ void escapehex (poolpointer in)
Last hex digit can be omitted, it is replaced by zero, see
PDF specification.
-
+
Invalid digits are silently ignored.
See escapename for description of parameters.
*/
-void unescapehex (poolpointer in)
+void unescapehex(poolpointer in)
{
const poolpointer out = pool_ptr;
unsigned char ch;
boolean first = true;
- unsigned char a = 0; /* to avoid warning about uninitialized use of a */
+ unsigned char a = 0; /* to avoid warning about uninitialized use of a */
while (in < out) {
if (pool_ptr + 1 >= pool_size) {
pool_ptr = pool_size;
@@ -799,24 +805,23 @@ void unescapehex (poolpointer in)
first = true;
}
if (!first) { /* last hex digit is omitted */
- str_pool[pool_ptr++] = ch << 4;
+ str_pool[pool_ptr++] = a;
}
}
-
-/* Converts any string given in in in an allowed PDF string which is
+/* Converts any string given in in in an allowed PDF string which is
* hexadecimal encoded;
* sizeof(out) should be at least lin*2+1.
*/
-static void convertStringToHexString (const char *in, char *out, int lin)
+static void convertStringToHexString(const char *in, char *out, int lin)
{
- int i, j, k;
+ int i, j, k;
char buf[3];
j = 0;
for (i = 0; i < lin; i++) {
- k = snprintf (buf, sizeof (buf),
- "%02X", (unsigned int) (unsigned char) in[i]);
- check_nprintf (k, sizeof (buf));
+ k = snprintf(buf, sizeof(buf),
+ "%02X", (unsigned int) (unsigned char) in[i]);
+ check_nprintf(k, sizeof(buf));
out[j++] = buf[0];
out[j++] = buf[1];
}
@@ -836,15 +841,15 @@ static void convertStringToHexString (const char *in, char *out, int lin)
identifiers are set to the same value. If both identifiers match when a
file reference is resolved, it is very likely that the correct file has
been found; if only the first identifier matches, then a different
- version of the correct file has been found.
+ version of the correct file has been found.
To help ensure the uniqueness of file identifiers, it is recommend
that they be computed using a message digest algorithm such as MD5
(described in Internet RFC 1321, The MD5 Message-Digest Algorithm; see
the Bibliography), using the following information (see implementation
- note 106 in Appendix H):
- - The current time
- - A string representation of the file's location, usually a pathname
- - The size of the file in bytes
+ note 106 in Appendix H):
+ - The current time
+ - A string representation of the file's location, usually a pathname
+ - The size of the file in bytes
- The values of all entries in the file's document information
dictionary (see Section 9.2.1, Document Information Dictionary )
</blockquote>
@@ -854,7 +859,7 @@ static void convertStringToHexString (const char *in, char *out, int lin)
scanning the info dict is also difficult, we start with a simpler
implementation using just the first two items.
*/
-void print_ID (strnumber filename)
+void print_ID(strnumber filename)
{
time_t t;
size_t size;
@@ -865,24 +870,23 @@ void print_ID (strnumber filename)
char *file_name;
char pwd[4096];
/* start md5 */
- md5_init (&state);
+ md5_init(&state);
/* get the time */
- t = time (NULL);
- size =
- strftime (time_str, sizeof (time_str), "%Y%m%dT%H%M%SZ", gmtime (&t));
- md5_append (&state, (const md5_byte_t *) time_str, size);
+ t = time(NULL);
+ size = strftime(time_str, sizeof(time_str), "%Y%m%dT%H%M%SZ", gmtime(&t));
+ md5_append(&state, (const md5_byte_t *) time_str, size);
/* get the file name */
- if (getcwd (pwd, sizeof (pwd)) == NULL)
- pdftex_fail ("getcwd() failed (path too long?)");
- file_name = makecstring (filename);
- md5_append (&state, (const md5_byte_t *) pwd, strlen (pwd));
- md5_append (&state, (const md5_byte_t *) "/", 1);
- md5_append (&state, (const md5_byte_t *) file_name, strlen (file_name));
+ if (getcwd(pwd, sizeof(pwd)) == NULL)
+ pdftex_fail("getcwd() failed (%s), (path too long?)", strerror(errno));
+ file_name = makecstring(filename);
+ md5_append(&state, (const md5_byte_t *) pwd, strlen(pwd));
+ md5_append(&state, (const md5_byte_t *) "/", 1);
+ md5_append(&state, (const md5_byte_t *) file_name, strlen(file_name));
/* finish md5 */
- md5_finish (&state, digest);
+ md5_finish(&state, digest);
/* write the IDs */
- convertStringToHexString ((char *) digest, id, 16);
- pdf_printf ("/ID [<%s> <%s>]", id, id);
+ convertStringToHexString((char *) digest, id, 16);
+ pdf_printf("/ID [<%s> <%s>]", id, id);
}
/* Print the /CreationDate entry.
@@ -932,25 +936,22 @@ void print_ID (strnumber filename)
The main difficulty is get the time zone offset. strftime() does this in ISO
C99 (e.g. newer glibc) with %z, but we have to work with other systems (e.g.
- Solaris 2.5).
+ Solaris 2.5).
*/
static time_t start_time = 0;
#define TIME_STR_SIZE 30
-static char start_time_str[TIME_STR_SIZE];
-static char time_str[TIME_STR_SIZE];
- /* minimum size for time_str is 24: "D:YYYYmmddHHMMSS+HH'MM'" */
+static char start_time_str[TIME_STR_SIZE]; /* minimum size for time_str is 24: "D:YYYYmmddHHMMSS+HH'MM'" */
-static void makepdftime (time_t t, char *time_str)
+static void makepdftime(time_t t, char *time_str)
{
-
struct tm lt, gmt;
size_t size;
int i, off, off_hours, off_mins;
/* get the time */
- lt = *localtime (&t);
- size = strftime (time_str, TIME_STR_SIZE, "D:%Y%m%d%H%M%S", &lt);
+ lt = *localtime(&t);
+ size = strftime(time_str, TIME_STR_SIZE, "D:%Y%m%d%H%M%S", &lt);
/* expected format: "YYYYmmddHHMMSS" */
if (size == 0) {
/* unexpected, contents of time_str is undefined */
@@ -959,7 +960,7 @@ static void makepdftime (time_t t, char *time_str)
}
/* correction for seconds: %S can be in range 00..61,
- the PDF reference expects 00..59,
+ the PDF reference expects 00..59,
therefore we map "60" and "61" to "59" */
if (time_str[14] == '6') {
time_str[14] = '5';
@@ -968,7 +969,7 @@ static void makepdftime (time_t t, char *time_str)
}
/* get the time zone offset */
- gmt = *gmtime (&t);
+ gmt = *gmtime(&t);
/* this calculation method was found in exim's tod.c */
off = 60 * (lt.tm_hour - gmt.tm_hour) + lt.tm_min - gmt.tm_min;
@@ -983,47 +984,46 @@ static void makepdftime (time_t t, char *time_str)
time_str[size] = 0;
} else {
off_hours = off / 60;
- off_mins = abs (off - off_hours * 60);
- i = snprintf (&time_str[size], 9,
- "%+03d'%02d'", off_hours, off_mins);
- check_nprintf (i, 9);
+ off_mins = abs(off - off_hours * 60);
+ i = snprintf(&time_str[size], 9, "%+03d'%02d'", off_hours, off_mins);
+ check_nprintf(i, 9);
}
}
-void init_start_time ()
+void init_start_time()
{
if (start_time == 0) {
- start_time = time ((time_t *) NULL);
- makepdftime (start_time, start_time_str);
+ start_time = time((time_t *) NULL);
+ makepdftime(start_time, start_time_str);
}
}
-void print_creation_date ()
+void print_creation_date()
{
- init_start_time ();
- pdf_printf ("/CreationDate (%s)\n", start_time_str);
+ init_start_time();
+ pdf_printf("/CreationDate (%s)\n", start_time_str);
}
-void print_mod_date ()
+void print_mod_date()
{
- init_start_time ();
- pdf_printf ("/ModDate (%s)\n", start_time_str);
+ init_start_time();
+ pdf_printf("/ModDate (%s)\n", start_time_str);
}
-void getcreationdate ()
+void getcreationdate()
{
/* put creation date on top of string pool and update pool_ptr */
- size_t len = strlen (start_time_str);
+ size_t len = strlen(start_time_str);
- init_start_time ();
+ init_start_time();
- if ((unsigned)(pool_ptr + len) >= (unsigned)pool_size) {
+ if ((unsigned) (pool_ptr + len) >= (unsigned) pool_size) {
pool_ptr = pool_size;
/* error by str_toks that calls str_room(1) */
return;
}
- memcpy (&str_pool[pool_ptr], start_time_str, len);
+ memcpy(&str_pool[pool_ptr], start_time_str, len);
pool_ptr += len;
}
@@ -1034,9 +1034,9 @@ void getcreationdate ()
That means, file names that are legal on some operation systems
cannot any more be used since pdfTeX version 1.30.4.
*/
-char *makecfilename (strnumber s)
+char *makecfilename(strnumber s)
{
- char *name = makecstring (s);
+ char *name = makecstring(s);
char *p = name;
char *q = name;
@@ -1051,7 +1051,7 @@ char *makecfilename (strnumber s)
/* function strips trailing zeros in string with numbers; */
/* leading zeros are not stripped (as in real life) */
-char *stripzeros (char *a)
+char *stripzeros(char *a)
{
enum { NONUM, DOTNONUM, INT, DOT, LEADDOT, FRAC } s = NONUM, t = NONUM;
char *p, *q, *r;
@@ -1114,23 +1114,20 @@ char *stripzeros (char *a)
*q++ = *p++;
t = s;
}
- *q = '\0';
+ *q = '\0';
return a;
}
void initversionstring(char **versions)
{
(void) asprintf(versions,
- "This is build %d, created on %dT%06dZ\n"
"Compiled with libpng %s; using libpng %s\n"
"Compiled with zlib %s; using zlib %s\n"
"Compiled with xpdf version %s\n",
- get_build_revision(), BUILD_DATE, (BUILD_TIME-1000000),
PNG_LIBPNG_VER_STRING, png_libpng_ver,
ZLIB_VERSION, zlib_version, xpdfVersion);
}
-
/*************************************************/
/* Color Stack and Matrix Transformation Support */
/*************************************************/
@@ -1182,8 +1179,7 @@ static colstack_type *colstacks = NULL;
static int colstacks_size = 0;
static int colstacks_used = 0;
-/*
- Initialization is done, if the color stacks are used,
+/* Initialization is done, if the color stacks are used,
init_colorstacks() is defined as macro to avoid unnecessary
procedure calls.
*/
@@ -1212,8 +1208,7 @@ int colorstackused()
return colstacks_used;
}
-/*
- newcolorstack()
+/* newcolorstack()
A new color stack is setup with the given parameters.
The stack number is returned or -1 in case of error (no room).
*/
@@ -1262,9 +1257,7 @@ int newcolorstack(integer s, integer literal_mode, boolean page_start)
#define get_colstack(n) (&colstacks[n])
-/*
- Puts a string on top of the string pool and updates pool_ptr.
-*/
+/* Puts a string on top of the string pool and updates pool_ptr. */
void put_cstring_on_str_pool(poolpointer start, char *str)
{
size_t len;
@@ -1402,13 +1395,15 @@ integer colorstackskippagestart(int colstack_no)
if (!colstack->page_start) {
return 1;
}
+ if (colstack->page_current == NULL) {
+ return 0;
+ }
if (strcmp(COLOR_DEFAULT, colstack->page_current) == 0) {
return 2;
}
return 0;
}
-
/* stack for \pdfsetmatrix */
typedef struct {
@@ -1430,8 +1425,7 @@ boolean matrixused()
/* stack for positions of \pdfsave */
typedef struct {
- int pos_h;
- int pos_v;
+ scaledpos pos;
int matrix_stack;
} pos_entry;
static pos_entry *pos_stack = 0; /* the stack */
@@ -1452,7 +1446,7 @@ void matrix_stack_room()
}
}
-void checkpdfsave(int cur_h, int cur_v)
+void checkpdfsave(scaledpos pos)
{
pos_entry *new_stack;
@@ -1464,26 +1458,26 @@ void checkpdfsave(int cur_h, int cur_v)
xfree(pos_stack);
pos_stack = new_stack;
}
- pos_stack[pos_stack_used].pos_h = cur_h;
- pos_stack[pos_stack_used].pos_v = cur_v;
+ pos_stack[pos_stack_used].pos.h = pos.h;
+ pos_stack[pos_stack_used].pos.v = pos.v;
if (page_mode) {
pos_stack[pos_stack_used].matrix_stack = matrix_stack_used;
}
pos_stack_used++;
}
-void checkpdfrestore(int cur_h, int cur_v)
+void checkpdfrestore(scaledpos pos)
{
- int diff_h, diff_v;
+ scaledpos diff;
if (pos_stack_used == 0) {
pdftex_warn("%s", "\\pdfrestore: missing \\pdfsave");
return;
}
pos_stack_used--;
- diff_h = cur_h - pos_stack[pos_stack_used].pos_h;
- diff_v = cur_v - pos_stack[pos_stack_used].pos_v;
- if (diff_h != 0 || diff_v != 0) {
- pdftex_warn("Misplaced \\pdfrestore by (%usp, %usp)", diff_h, diff_v);
+ diff.h = pos.h - pos_stack[pos_stack_used].pos.h;
+ diff.v = pos.v - pos_stack[pos_stack_used].pos.v;
+ if (diff.h != 0 || diff.v != 0) {
+ pdftex_warn("Misplaced \\pdfrestore by (%dsp, %dsp)", diff.h, diff.v);
}
if (page_mode) {
matrix_stack_used = pos_stack[pos_stack_used].matrix_stack;
@@ -1503,16 +1497,15 @@ void pdfshipoutbegin(boolean shipping_page)
void pdfshipoutend(boolean shipping_page)
{
if (pos_stack_used > 0) {
- pdftex_warn("%u unmatched \\pdfsave after %s shipout",
+ pdftex_fail("%u unmatched \\pdfsave after %s shipout",
(unsigned int) pos_stack_used,
((shipping_page) ? "page" : "form"));
}
}
-/*
- \pdfsetmatrix{a b c d}
- e := cur_h
- f := cur_v
+/* \pdfsetmatrix{a b c d}
+ e := pos.h
+ f := pos.v
M_top: current active matrix at the top of
the matrix stack
@@ -1539,7 +1532,7 @@ void pdfshipoutend(boolean shipping_page)
*/
-void pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v)
+void pdfsetmatrix(poolpointer in, scaledpos pos)
{
/* Argument of \pdfsetmatrix starts with str_pool[in] and ends
before str_pool[pool_ptr]. */
@@ -1554,8 +1547,8 @@ void pdfsetmatrix(poolpointer in, scaled cur_h, scaled cur_v)
return;
}
/* calculate this transformation matrix */
- x.e = (double) cur_h *(1.0 - x.a) - (double) cur_v *x.c;
- x.f = (double) cur_v *(1.0 - x.d) - (double) cur_h *x.b;
+ x.e = (double) pos.h * (1.0 - x.a) - (double) pos.v * x.c;
+ x.f = (double) pos.v * (1.0 - x.d) - (double) pos.h * x.b;
matrix_stack_room();
z = &matrix_stack[matrix_stack_used];
if (matrix_stack_used > 0) {
@@ -1673,126 +1666,137 @@ void matrixrecalculate(scaled urx)
matrixtransformrect(last_llx, last_lly, urx, last_ury);
}
-void
-check_buffer_overflow (int wsize) {
- int nsize;
- if (wsize>buf_size) {
- nsize = buf_size + buf_size/5+5;
- if (nsize<wsize) {
- nsize = wsize+5;
- }
- buffer = (unsigned char *)xreallocarray (buffer, char, nsize);
- buf_size = nsize;
- }
+void check_buffer_overflow(int wsize)
+{
+ int nsize;
+ if (wsize > buf_size) {
+ nsize = buf_size + buf_size / 5 + 5;
+ if (nsize < wsize) {
+ nsize = wsize + 5;
+ }
+ buffer = (unsigned char *) xreallocarray(buffer, char, nsize);
+ buf_size = nsize;
+ }
}
#define EXTRA_STRING 500
-void
-check_pool_overflow (int wsize) {
- int nsize ;
- if ((wsize-1)>pool_size) {
- nsize = pool_size + pool_size/5+EXTRA_STRING;
- if (nsize<wsize) {
- nsize = wsize+EXTRA_STRING;
- }
- str_pool = (unsigned char *)xreallocarray (str_pool, char, nsize);
- pool_size = nsize;
- }
+void check_pool_overflow(int wsize)
+{
+ int nsize;
+ if ((wsize - 1) > pool_size) {
+ nsize = pool_size + pool_size / 5 + EXTRA_STRING;
+ if (nsize < wsize) {
+ nsize = wsize + EXTRA_STRING;
+ }
+ str_pool = (unsigned char *) xreallocarray(str_pool, char, nsize);
+ pool_size = nsize;
+ }
}
#define max_integer 0x7FFFFFFF
-/* the return value is a decimal number with the point |dd| places from the back,
+/* the return value is a decimal number with the point |dd| places from the back,
|scaled_out| is the number of scaled points corresponding to that.
*/
-scaled divide_scaled (scaled s, scaled m, integer dd) {
- register scaled q;
- register scaled r;
- int i;
- int sign = 1;
- if (s < 0) {
- sign = -sign;
- s = -s;
- }
- if (m < 0) {
- sign = -sign;
- m = -m;
- }
- if (m == 0) {
- pdf_error(maketexstring("arithmetic"), maketexstring("divided by zero"));
- } else if (m >= (max_integer / 10)) {
- pdf_error(maketexstring("arithmetic"), maketexstring("number too big"));
- }
- q = s / m;
- r = s % m;
- for (i = 1;i<=(int)dd;i++) {
- q = 10*q + (10*r) / m;
- r = (10*r) % m;
- }
- /* rounding */
- if (2*r >= m) {
- q++;
- r -= m;
- }
- /* set up the value of q, in scaled points */
- switch(dd) {
- case 0: scaled_out = sign*(s - r); break;
- case 1: scaled_out = sign*(s - (r/10)); break;
- case 2: scaled_out = sign*(s - (r/100)); break;
- case 3: scaled_out = sign*(s - (r/1000)); break;
- case 4: scaled_out = sign*(s - (r/10000)); break;
- case 5: scaled_out = sign*(s - (r/100000)); break;
- case 6: scaled_out = sign*(s - (r/1000000)); break;
- case 7: scaled_out = sign*(s - (r/10000000)); break;
- case 8: scaled_out = sign*(s - (r/100000000)); break;
- case 9: scaled_out = sign*(s - (r/1000000000)); break;
- }
- return sign*q;
-}
-
-
-/* Sometimes there is one sp of difference in |scaled_out|
- * compared to the 'perfect' answer given above, but this
- * routine is only used by the pdf backend, not for typesetting.
- */
+scaled divide_scaled(scaled s, scaled m, integer dd)
+{
+ register scaled q;
+ register scaled r;
+ int i;
+ int sign = 1;
+ if (s < 0) {
+ sign = -sign;
+ s = -s;
+ }
+ if (m < 0) {
+ sign = -sign;
+ m = -m;
+ }
+ if (m == 0) {
+ pdf_error(maketexstring("arithmetic"),
+ maketexstring("divided by zero"));
+ } else if (m >= (max_integer / 10)) {
+ pdf_error(maketexstring("arithmetic"), maketexstring("number too big"));
+ }
+ q = s / m;
+ r = s % m;
+ for (i = 1; i <= (int) dd; i++) {
+ q = 10 * q + (10 * r) / m;
+ r = (10 * r) % m;
+ }
+ /* rounding */
+ if (2 * r >= m) {
+ q++;
+ r -= m;
+ }
+ return sign * q;
+}
+
+/* Same function, but using doubles instead of integers (faster) */
-scaled
-divide_scaled_n (double sd, double md, double n) {
- int d = (int)(sd/md*n+0.5);
- scaled_out = (int)(d/n*md);
- return d;
+scaled divide_scaled_n(double sd, double md, double n)
+{
+ double dd, di = 0.0;
+ dd = sd / md * n;
+ if (dd > 0.0)
+ di = floor(dd + 0.5);
+ else if (dd < 0.0)
+ di = -floor((-dd) + 0.5);
+ return (scaled) di;
}
/* C print interface */
-void tprint (char *s) {
- while (*s)
- print_char(*s++);
+void tprint(char *s)
+{
+ while (*s)
+ print_char(*s++);
}
-void tprint_nl (char *s) {
- print_nlp();
- tprint(s);
+void tprint_nl(char *s)
+{
+ print_nlp();
+ tprint(s);
}
-#define escape_char_code 45 /* escape character for token output */
-#define int_par(a) zeqtb[static_int_base+(a)].cint /* an integer parameter */
+#define escape_char_code 45 /* escape character for token output */
+#define int_par(a) zeqtb[static_int_base+(a)].cint /* an integer parameter */
#define escape_char int_par(escape_char_code)
-void tprint_esc(char *s) { /* prints escape character, then |s| */
- int c=-1; /* the escape character code */
- if (zeqtb!=NULL) {
- c=escape_char;
- if (c>=0)
- print_char(c);
- }
- tprint(s);
+void tprint_esc(char *s)
+{ /* prints escape character, then |s| */
+ int c = -1; /* the escape character code */
+ if (zeqtb != NULL) {
+ c = escape_char;
+ if (c >= 0)
+ print_char(c);
+ }
+ tprint(s);
}
-void tconfusion(char *s) {
- confusion(maketexstring(s));
+void tconfusion(char *s)
+{
+ confusion(maketexstring(s));
}
+#ifdef MSVC
+
+# include <math.h>
+double rint(double x)
+{
+ double c, f, d1, d2;
+
+ c = ceil(x);
+ f = floor(x);
+ d1 = fabs(c - x);
+ d2 = fabs(x - f);
+ if (d1 > d2)
+ return f;
+ else
+ return c;
+}
+
+#endif
diff --git a/Build/source/texk/web2c/luatexdir/writezip.c b/Build/source/texk/web2c/luatexdir/utils/writezip.c
index b915413ccfe..8fb0a1a651b 100644
--- a/Build/source/texk/web2c/luatexdir/writezip.c
+++ b/Build/source/texk/web2c/luatexdir/utils/writezip.c
@@ -1,33 +1,34 @@
-/*
-Copyright (c) 1996-2007 Han The Thanh, <thanh@pdftex.org>
+/* writezip.c
+
+ Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
+ Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
-This file is part of pdfTeX.
+ This file is part of LuaTeX.
-pdfTeX is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ LuaTeX is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
-pdfTeX is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ LuaTeX is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
-You should have received a copy of the GNU General Public License
-along with pdfTeX; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-$Id $
-*/
+ You should have received a copy of the GNU General Public License along
+ with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
#include "ptexlib.h"
#include "zlib.h"
#include <assert.h>
+static const char __svn_version[] =
+ "$Id: writezip.c 2073 2009-03-21 10:06:50Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/src/texk/web2c/luatexdir/utils/writezip.c $";
+
#define ZIP_BUF_SIZE 32768
-#define check_err(f, fn) \
- if (f != Z_OK) \
+#define check_err(f, fn) \
+ if (f != Z_OK) \
pdftex_fail("zlib: %s() failed (error code %d)", fn, f)
static char *zipbuf = NULL;
@@ -67,7 +68,7 @@ void write_zip(boolean finish)
for (;;) {
if (c_stream.avail_out == 0) {
pdf_gone += xfwrite(zipbuf, 1, ZIP_BUF_SIZE, pdf_file);
- pdf_last_byte = zipbuf[ZIP_BUF_SIZE - 1]; /* not needed */
+ pdf_last_byte = zipbuf[ZIP_BUF_SIZE - 1]; /* not needed */
c_stream.next_out = (Bytef *) zipbuf;
c_stream.avail_out = ZIP_BUF_SIZE;
}